diff --git a/libs/str.cpp b/BSD similarity index 85% rename from libs/str.cpp rename to BSD index e863b5e6..70755aa7 100644 --- a/libs/str.cpp +++ b/BSD @@ -1,31 +1,28 @@ -/* Copyright (c) 2001, Loki software, inc. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of Loki software nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior + written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include "str.h" diff --git a/CHANGES b/CHANGES deleted file mode 100644 index 47deae20..00000000 --- a/CHANGES +++ /dev/null @@ -1,8216 +0,0 @@ -This is the changelog for developers, != changelog for the end user -that we distribute with the binaries. (see changelog) - -28/06/2007 (dunkfordyce@gmail.com) -- fixed mnemonics for MRU list -- fixed find functionality -- added option to always use caulk texture for new brushes -- fixed(?) a small bug in install.py that was trying to copy msvc files on linux - -28/06/2007 -- Added material-support to brushexport-plugin (Shaderman) - -26/04/2007 -- Disabled auto-search for texbrowser and entityinspector even when the option - is turned on in the gtkrc - -26/04/2007 -- Fixed q3map2 lightbounce bug (by Unknown) - -26/04/2007 -- Fixed another texcompression bug - -25/04/2007 -- Fixed texcompression beeing disabled after each restart -- Fixed gtk-searchpopup in treeviews - -15/04/2007 -namespace -- Fixed brushexport2 output float-format (Shaderman) - -27/03/2007 -namespace -- Fix: Added missing xml-writer pop-calls -- Ported mapxml plugin to Doom3 -- mapxml now exports brushes with its vertices - -19/03/2007 -namespace -- Fix: Selection is now deleted when creating a patch out of it (aumüller / namespace) - -08/03/2007 -namespace -- Win32 compile fix (woekele) - -07/03/2007 -namespace -- Updated UFA:Plugin (mattn2) - -04/03/2007 -namespace -- Reverted Q3 translucency fix since it randomly made brushes - fully transparent in Doom3 mode. - -04/03/2007 -namespace -- Final update for installerfiles (Shaderman / namespace) -- Removed installer.py validation checks since they are incompatible with Vista -- Updated msiquery module to python 2.5 -- Added msiquery module for python 2.5 - -03/03/2007 -namespace -(THIS IS A TRANSITIONAL REVISION, DO NOT USE, WAIT FOR UPDATED DEPS) -- Fixed weird msvcrt bugs caused by dbghelp.dll -- Activated new radiant icon on Linux (Topsun) -- First update for installerfiles (Shaderman) -- New MODT for q3map2 :) -- tiny changes - -28/02/2007 -namespace -- Radiant is now Vista compatible (Aero must be disabled) -- Updated all radiant dependencies (gtk is now 2-2.10) - New dependency packages can be found here -http://zerowing.idsoftware.com/files/radiant/developer/1.5/gtkradiant-1.5-dependencies-1.0.zip - or here -http://www.codecreator.net/radiant/gtkradiant-1.5-dependencies-1.0.zip -- Removed Win32 filechooser - - Fixes crashes caused by utf-8 encoded filenames - - Fixes Vista "SaveAs"-Bug -- Converted all projects to Visual Studio 2005 -- Codefixes for vc2k5 compiler -- Removed old unused projectfiles for Visual Studio 6 -- Simplified dependency filestructure -- Simplified install.py -- Updated CONTRIBUTORS list - -26/01/2007 -namespace -- SnapPlane reenabled by namespace because of multiple reports of - q3map2-crashes which were triggered by this patch. - -24/01/2007 -namespace -- Added Undo/Redo-Toolbarbuttons (Shaderman) -- Fixed Bug #1078 (sogined) - -18/01/2007 -namespace -- Weird shiftvalues are now hidden to the user, shiftvalues will - stay in ]-shader_size;shader_size[ range for display. - For the sake of floatingpoint precision, it would be nice - to keep the internal values in that range too, but thats "nice to have". -- Fixed missing librarypaths in ufoai-plugin - -18/01/2007 -LordHavoc -- disabled SnapPlane because it slightly corrupts collision brushes from - embedded model triangles - -17/01/2007 -namespace -- Fixed "jumping" texcoords when switching to a shader with different size -- (Todo) Toolbar: add button for refresh-models. (Shaderman) -- Aniso fix (Shaderman) -- Translucency fix (Shaderman) - -05/01/2007 -namespace -- UFO:Alien Invasion Plugin (mattn2) -- Fix: Filtering models in ET doesn't filter misc_gamemodels (Shaderman) - -25/12/2006 -namespace - - Brushplugin Version 2.0, supports multiple collapse modes and a materialignore list (namespace) - - Camera movement speed changes. Increase speed = SHIFT+KP_PLUS, decrease speed = SHIFT+KP_MINUS. - New option to link the strafe speed to camera movement speed (default: linked). (Shaderman) - - Fixed bug in sample plugin (Shaderman) - - Merry Christmas - -17/12/2006 -namespace - - Radiant warzow-support (Topsun + Warzow-Mappers) - -15/12/2006 -namespace - - Inverted bevel can be used with end caps (Topsun) - - Removed needless .pdb files from win32 installer (Topsun) - - Fixed .ase picomodel loader to load shaders again (Shaderman) - - Removed translucent brushes fix because of wrong rendering behaviour on Linux - - New cool(!) radiant icon by eb - -13/12/2006 -namespace -- Added tremoulus-support to q3map2 - -08/12/2006 -namespace -- Entity names are now drawn for group entities in Doom3 and Quake 3 mode (namespace) -- Fixed translucent brushes becoming invisible when selected (Shaderman) - -06/11/2006 -namespace -- (TODO) Texture sizes sometimes vary wildly. New texture browser option: View -> Fixed Size. - Code parts taken from DarkRadiant. (Shaderman) -- Added new texture browser option: View -> Hide Image Missing. (Shaderman) -- Fixed new D3 lights don't have a light_radius key. (Shaderman) -- Fixed hotkey collision (paste to camera/view menu). New View shortcut = ALT+W. (Shaderman) -- Fixed .wad MMB 3d view texture selection bug. (Shaderman) - -04/11/2006 -namespace -- Added warzow-support to q3map2 - -12/10/2006 -namespace -- Updated help menu web links (removed map-center.com, added ETB documentation) (Shaderman) -- Added check for existing worldspawn if a new one should be added with the entity menu (Shaderman) -- Fixed Entity -> Ungroup (Topsun) -- Fixed hotkey collision ALT+M (filter botclip/Modify menu). New Modify shortcut = ALT+O (Shaderman) -- Updated Window Layout images (Shaderman) -- Fixed (TODO) XYWindow: save show-workzone option (Shaderman) -- Fixed (TODO) Toolbar: add shortcut to tooltips for toolbar buttons (Shaderman) -- Fixed (TODO) GUI: detachable submenus (Shaderman) - -09/10/2006 -namespace -- Added option to toggle the camera window stats on/off (Shaderman) - (view --> show --> show stats) - - -08/10/2006 -namespace -- Fix for bug 1106 - .wad files don't get listed in the textures menu (Shaderman) - (http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1106) -- Added initial support for Prey (Shaderman) -- Fixed entity inspector sliders to always show (Shaderman) -- Added NOTES subsection to the entity inspector listing .def "editor_usage*" values (Shaderman) - -07/10/2006 -namespace -- Added "select inside" and "select touching" - Both functions now work with multiple selectionbrushes, allowing complex - selection operations. -- Added entries for the selectionfunctions in "Edit" and the main toolbar. - -06/10/2006 -namespace -- Changed ETB not to show any texture if a tag search doesn't match anything (Shaderman) -- Added View -> Filter -> "Invert filters/Reset filters" function (Shaderman) -- Fixed (TODO) Textures: remove "shaders only" option for doom3 (Shaderman) -- Fixed show shaders / shader only / shader info for doom3 and .wad file games (Shaderman) - -03/10/2006 -namespace -- Fix for Bug 1113 (Topsun) - (http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1113) - -03/10/2006 -namespace -- Changed ETB tag toolbar to a notebook with tag/texture pages (Shaderman) -- Added a context menu (add/delete/rename tag) to the ETB tag tree view (Shaderman) -- Added new win32 installer HOWTO (Shaderman/Topsun) - -01/10/2006 -namespace -- Added missing xml files for win32 installer - -30/09/2006 -namespace -- Fixed Etb saving custom tags to global tagfile (Shaderman/namespace) -- Fixed postbuild step for brushexport, shaderplug and sunplug (Shaderman) -- Added installersupport for new files and plugins (Shaderman) - -30/09/2006 -namespace -- Added LocalLcPath to plugin interface -- Added enhanced Texturebrowser (ETB) by Shaderman -- Added shaderplug by Shaderman, accompanies the ETB -- Added xmltagging lib by Shaderman, accompanies the ETB -- Added new icons for ETB, Console, Entityinspector and Lighteditor -- Fixed minor warning in Sunplug Project -- Fixed PATH_MAX namecollision in ptrview plugin on Linux -- Final fix for 64 bit patch.h issue - - - -12/09/2006 -namespace -- Fixed 64 Bit issue in patch.h, see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1109 - for details - -11/09/2006 -namespace -- Fixed unnecessary warnings, see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1108 - for details - -11/09/2006 -namespace -- Added sunplug (Mapcoordinator-plugin for ET) by Topsun - ET only: setting mapcoordsmins and mapcoordsmaxs in the worldspawn - Tester: Shaderman -- Added brushexport Plugin by namespace - Exports selected brushes as wavefront object. - Tester: Shaderman - -11/09/2006 -namespace -- Fixed compile error on x86_64, see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1105 - for details. - -09/09/2996 -namespace -- Added strafing for the camerawindow while holding ctrl -- Additional forward movement can be enabled by pressing shift during strafe - -22/08/2006 -SPoG -- Added VFS support for locating the archive a file was loaded from. -- Changed Doom3 entity definition parser to gracefully handle parse errors. -- Fixed crash when loading entity definitions in quake4 1.3 point release. - -13/08/2006 -SPoG -- Disabled 'detail' content flag checkbox in quake2 Surface Inspector. - -22/07/2006 -SPoG -- Fixed doom3 func_static with model not appearing to move when dragged. -- Changed ASE model loader to parse material names the same way as DoomEdit. -- Fixed title of wait-dialog when loading a model. -- Fixed doom3 func_static with blank 'model' key being invisible. -- Changed doom3 func_static model creation to replace selected models. -- Added support for loading both .ent and .def files at the same time. - -09/07/2006 -Shaderman -- Updated win32 libxml2 package to 2.6.24. -namespace -- Ported win32 stack-backtrace to use new DebugHelp API. -- Added stack-backtrace functionality for Linux/OSX. - -11/06/2006 -SPoG -- Fixed arbitrary rotation X and Y axes appearing to be transposed. - -04/06/2006 -SPoG -- Fixed crash when deleting items from Build menu. - -03/06/2006 -SPoG -- Changed doom3 entity creation to add model key for brush-entities. -- Fixed crash in Save Region. -- Fixed detail brushes being turned structural when texture is set. - -29/05/2006 -SPoG -- Changed default doom3 light_radius to be taken from the entity-definition. -- Fixed error when entering and exiting camera freemove with LMB pressed. - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1090 - -13/05/2006 -LordHavoc -- Added -fPIC for Linux builds to support x86_64. -- Removed static-linked libstdc++ hack for non-final builds. -- Removed gcc explicit linking hack for non-final builds. -- Added workaround for gcc static-member-pointer-as-template-argument bug. -- Fixed bobtoolz linux compile errors. -- Added Nexuiz and Darkplaces support. -SPoG -- Changed 'inconsistent vertex count' assert to be non-fatal. -- Changed 'failed to remove accelerator' assert to be non-fatal. -- Fixed crash due to broken module dependencies. -- Fixed default settings for Build Monitoring. -- Fixed nudge-selection when using the drag tool mode. -- Added support for patches in texture-painting tool. - -30/04/2006 -SPoG -- Fixed memory leak in signals library. -- Ported bobtoolz to use new module APIs. - -01/04/2006 -SPoG -- Added key-observer interface to entity module API. -- Rewrote callback library to add support for return-values. -- Added minimal API to support bobtoolz plugin. -- Refactored brush for-each functions to take Functor instead of Visitor. -- Added signals library. - -31/03/2006 -SPoG -- Changed doom3 light creation to use size of selected brushes. - -20/03/2006 -SPoG -- Fixed crash when resetting preferences after startup failure. -- Fixed crash on next-leak-spot with build-monitoring enabled. -- Fixed doom3/quake4 blended-decal rendering when toggling lighting mode. -- Fixed fit-texture with rotated texture transforms. - -20/03/2006 -SPoG -- Changed Copy/Paste to work on face textures if any faces are selected. -- Fixed GTK_WIDGET_REALIZED assert when selecting entities (linux). - -28/02/2006 -namespace, SPoG -- Added drag-resizing for doom3/quake4 light_radius boxes. - -25/02/2006 -SPoG -- Fixed objects sometimes dissappearing when at high zoom level in Ortho views. - -24/02/2006 -SPoG -- Added GPL text to win32 installer. -- Fixed gtk wimp theme not working after using gtkthemeselector. - -21/02/2006 -namespace -- Added command to toggle lighting/textured modes, shortcut F3. - -20/02/2006 -SPoG -- Fixed crash when disabling lighting for a second time. - -19/02/2006 -SPoG -- Fixed crash when loading invalid ASE models. - -11/02/2006 -SPoG -- Added install.py script. -- Updated COMPILING instructions. -- Fixed transparency rendering on quake3 shaders. -- Fixed hint/caulk filtering for Jedi Academy shaders. - -04/02/2006 -SPoG -- Added Radiant Manual shortcut to win32 installation. -- Added 'use alternative texture projection' option to prefs. -- Fixed caching bug causing import-map to not reload modified maps. -- Added blended-decal rendering for doom3 and quake4. - -30/01/2006 -SPoG -- Added expand-selection-to-entities with default shortcut ctrl+alt+e. -- Fixed crash in gtk file-chooser with some versions of GTK+. - -29/01/2006 -SPoG -- Changed create-group-entity to re-select brushes after creation. - -26/01/2006 -SPoG -- Changed far-clip-plane setting to increase exponentially with distance. -- Fixed selected entities moving when drag-resizing brushes. -- Changed patches to be selectable from the back in wireframe views. -- Speed improvements for transform-selection code. - -25/01/2006 -SPoG -- Added default-texture-scale option to preferences. -- Added default-grid-spacing option to preferences. - -23/01/2006 -Shamus -- Fixed editing of doom3/quake4 faces with negative texture scale factors. - -22/01/2006 -SPoG -- Fixed shortcut for toggle-far-clip. -- Fixed broken link in 1.5 user docs. - -10/01/2006 -SPoG -- Changed script parser to ignore comments that start in the middle of tokens. -- Added support for editor_int/editor_string keys in doom3 entity definitions. -- Changed doom3/quake4 .mtr and .guide searching to look in subfolders. -- Added experimental support for doom3/quake4 projected lights. - -20/12/2005 -SPoG -- Added support for quake4 .guide material templates. -- Fixed GCC4 compile errors with anonymous enums. -- Added light_radius and light_center GUI to doom3 entity inspector. - -10/12/2005 -SPoG -- Added support for loading and saving Quake4 map format. -- Added support for built-in shader images such as _noFalloff. -- Added experimental code to render projected lights. -- Added support for loading quake4 entity definitions. -- Fixed picomodel bug loading .lwo files with texture names >64 in length. - -22/10/2005 -SPoG -- Fixed minor memory leak in zip-archive reader. - -21/10/2005 -SPoG -- Fixed model rotation using free-rotation tool. -- Fixed behaviour of angle/rotation keys for Doom3 entities. -- Added entity angle-editing for entities that display a model. -- Stopped size-info being drawn if selection has zero size. -- Added support for 'angle' key on doom3 entities. - -20/10/2005 -SPoG -- Fixed minor one-time memory leak in build-shader-list. -- Added functional free-scale tool. -- Improved precision preservation for free-rotation and free-scale tools. -- Fixed misc_model rotation using free-rotation tool. - -09/10/2005 -SPoG -- Added entity angle-editing using rotate-tool or rotation toolbar buttons. -- Fixed start-on-primary-monitor (win32). -- Fixed camera-view freelook when window is on secondary monitor (win32). - -05/10/2005 -paxed -- Added texture-lock toolbar button. -SPoG -- Added stack-trace output to all debug popup messages (win32). -- Fixed vertex/edge selection behaviour on undoing brush edits. -- Changed doom3 light centre rendering to use a point instead of a box. -- Changed map and shader parsers to gracefully handle bad data. - -24/09/2005 -SPoG -- Fixed crash when importing a file after deleting the world entity. -- Changed copy/paste/import to select world brushes instead of world entity. -- Added win32-specific stack-trace logging support. - -31/08/2005 -SPoG -- Fixed clipper removing brushes on incorrect side of clip-plane when flipped. - -21/08/2005 -SPoG -- Optimised light-dragging. -- Changed connect-entities to not break existing connections where possible. - -24/07/2005 -SPoG -- Fixed q3 entity definition for item_health_small. - -02/07/2005 -SPoG -- Fixed build menu becoming empty if editing of default menu is cancelled. - -01/07/2005 -SPoG -- Fixed snap-planes-to-integer preference not being saved. - -26/06/2005 -SPoG -- Changed doom3 light_radius box to draw flat-shaded translucent in camera view. -- Fixed progress window not being shown when loading maps. -- Refactored shortcut handling to make focussed widgets override global shortcuts. - Allows using ctrl+c to copy console text, undo/redo without main-window focus. - -23/06/2005 -SPoG -- Fixed crash when handling assert/error before gtk_init. -- Changed Help menu to display only the help menu relevant to the current game. - -21/06/2005 -SPoG -- Fixed double-maps-directory when using non-native file open dialog on win32. -- Changed find/replace-textures window to update when selecting textures with MMB. -- Fixed handling of non-UTF-8 wad-names in textures menu. - -20/06/2005 -SPoG -- Changed home-path prefix to be optional on linux/osx for q1/q2. -- Changed OpenGL module to work correctly with GL_VERSION 2.0.0. -- Fixed spawnflags in Enemy Territory entity definitions. -- Added missing Enemy Territory entity types. - -19/06/2005 -SPoG -- Changed clipper-point selection/rendering to behave the same at all zoom levels. -- Changed clipper-point selection to always pick the closest point to the cursor. -- Fixed clipper colour not being updated until after restarting. -- Fixed QE tool not deselecting edges when left-clicking on a vertex without shift. -- Fixed grid rendering with grid settings other than 8-unit. -- Fixed textures menu always behaving as if show-shaderlist-only is enabled. - -18/06/2005 -SPoG -- Added saving of camera render mode preference. -- Changed default camera render mode to Textured for Doom3. -- Changed default texture render mode to Trilinear. - -17/06/2005 -SPoG -- Ported Team Arena entity definitions to xml format. -- Added xml q3 entity-definitions to win32 and linux setups. - -14/06/2005 -SPoG -- Fixed QE-tool component-drag selecting components of unselected brushes. - -13/06/2005 -SPoG -- Changed clipper mode and component-editing modes to be mutually exclusive. -- Changed camera A/Z/D/C keys to obey "discrete movement" checkbox. -- Added support for up/down movement in freelook mode. -- Fixed clipper-tool-uses-caulk option. -- Added prompt for engine path at startup if not found. - -12/06/2005 -SPoG -- Added entity-inspector GUI support for func_button/func_door direction attribute. -- Added angle/model/sound GUI to entity-inspector for old-style entity-definitions. -- Added clipper-plane rendering using stippled back-face-culled polygon. -- Fixed entity-inspector failing to handle non-ascii characters in entity keys. - -11/06/2005 -SPoG -- Fixed entity-inspector window position changing while hidden. - -09/06/2005 -SPoG -- Fixed region-set-selected for model entities. - -08/06/2005 -SPoG -- Added option to enable or disable snapping brush planes to integer on map load/save. -- Added 0.125 grid. -- Changed grid rendering to always show major/minor grid colours whatever the zoom level. -- Increased maximum zoom level for XY views. - -06/06/2005 -SPoG -- Added 'File > Refresh models' - reloads models that have changed outside Radiant. - -05/06/2005 -SPoG -- Fixed model files not being closed after being read. -- Fixed build menu dialog not saving changes to build commands. -- Changed build menu to save xml only if changed by user. -- Fixed CSG-merge. -- Reduced CSG-merge tolerance for misaligned brushes. -Michael Kluskens -- Updated STVEF default build menu to version 2 format. -- Updated STVEF game configuration file and removed synapse.config. - -02/04/2005 -SPoG -- Changed HashTable insert/remove operations to not invalidate iterators. -- Changed ReferenceCache realise/unrealise to take advantage of new HashTable behaviour. -- Refactored containers to use std::swap. -- Refactored bitfield.h. -Tr3B -- Fixed endianness for .lwo loading on linux. -- Extended q3map2 mathlib functionality. - -28/03/2005 -SPoG -- Specialised filters list for doom3 entity/material types. -- Added ASE-loader support for shader names specified as a bitmap absolute-path. -- Fixed monitored-compile debug-feedback display. -- Added TGA-loader support for vertical and horizontal flipping. -- Enabled auto-generation of smooth normals for all LWO models. - -27/03/2005 -Tr3B -- Fixed map-xml module. -- Added support for qer_trans keyword in doom3 materials. - -08/03/2005 -SPoG -- Added GUI updates during map load and engine-path/game-dir changes. -- Fixed main window being hidden behind another application on closing a floating window. - -07/03/2005 -SPoG -- Fixed crash when selecting the root node in the entity-list window. -- Fixed detail flag saving for quake3 map format. - -06/03/2005 -SPoG -- Optimised type-casts for scene-graph type system. -- Disabled substitution of 'unspecified' for entity key values that match the default. -- Refactored module-system api - added globalModuleServer(). -- Fixed rotation origin for doom3 func_static models. - -05/03/2005 -SPoG -- Added support for doom3 model-entity 'skin' key. -- Added noshadows/nospecular/nodiffuse/falloff doom3 light keys to entity-inspector. - -04/03/2005 -SPoG -- Added camera move up/down one floor. -- Added support for 'unspecified' contents/flags/value for Quake2 brush faces. - -26/02/2005 -SPoG -- Added auto-complete for shader attributes in entity inspector. -- Added support for doom3-material heightmap to normalmap conversion. - -22/02/2005 -SPoG -- Fixed missing prefix attribute in quake game configuration file. -- Added auto-completion for find/replace-textures texture-name entries. -- Removed redundant buttons and options in find/replace-textures window. - -21/02/2005 -SPoG -- Added auto-completion for surface-inspector texture-name entry. - -20/02/2005 -SPoG -- Fixed failure to load shaders containing '.' such as Heretic II model skins. -- Removed unused legacy cmdlib functions. -- Added support for fractional repeat values to brush-fit-texture. - -19/02/2005 -SPoG -- Changed entity-connect-selected to use the parent entity of a selected brush. -- Added q2map and bspc to installation packages. -Jamie Wilkinson -- Fixed path to q2map in quake2 build-menu. - -13/02/2005 -SPoG -- Fixed crash in 'Misc > Find Brush' when searching for a non-existent brush. - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1059 -- Limited the maximum number of sides of a prefab brush-cone to 32. - -11/02/2005 -SPoG -- Changed display of angled box-entities to show un-rotated bounding boxes. - -10/02/2005 -SPoG -- Disabled rotation of light entities for games other than Doom 3. - -09/02/2005 -David Constanzo -- Fixed episode flag names on Quake item_sigil and func_episodegate entities. - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1056 -- Added detailed description of Quake item_sigil and func_episodegate entities. -SPoG -- Fixed position of light-entity names. -- Fixed q3map2 feedback xml streams containing non-UTF-8 text. -- Optimised Locale<->UTF-8 text conversion. - -08/02/2005 -SPoG -- Fixed selecting a texture not resetting the current selected texture-projection. -- Added handling of OpenGL drivers that don't implement all reported extensions. - -07/02/2005 -SPoG -- Added support for multi-byte UTF-8 characters in xml content (not markup). -- Added UTF-8 support in entity-inspector, prefs dialog, recent-files menu, console. -- Fixed potentially misaligned objects. - -05/02/2005 -SPoG -- Added rendering of entity names for non-group entities. -- Removed context-dependent opengl calls before opengl context is created. - -04/02/2005 -SPoG -- Fixed crash when printing extended-ascii text in the console. -- Added conversion of extended-ascii text to utf8 for gtk text-buffer widgets. - -03/02/2005 -David Constanzo -- Fixed typo in Quake entity-definitions. -SPoG -- Fixed undo of brush-set-structural and brush-make-structural. -- Refactored image-loader module api. -- Added full support for Quake II and Heretic II surface-flags in surface-inspector. -- Fixed crash in patch-inspector for games other than doom3. - -01/02/2005 -SPoG -- Changed shader-list and entity-definition searching to also search base-dir. - -29/01/2005 -SPoG -- Fixed title of floating entities/console/textures window. -- Fixed destruction of floating windows on shutdown. -- Added shortcut handling when entity-inspector/texture-browser are active. -David Constanzo -- Fixed crash while auto-saving snapshots. - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1049 - -28/01/2005 -SPoG -- Added rendering of fixed S/T tesselation on doom3 patches. -- Changed creation of doom3 func_static entities to prompt for a model. -- Fixed zero-sized primitives being rendered for culled entity-connection-lines. - -25/01/2005 -SPoG -- Added support for setting fixed S/T tesselation on doom3 patches. -- Changed patch inspector to be completely non-modal. - -24/01/2005 -SPoG -- Added support for rotating lights using the rotation tool. - -23/01/2005 -SPoG -- Fixed crash on startup with texture-subsets enabled. - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1045 -- Added support for doom3 lights combined with brushes and patches. -- Added support for doom3 light_origin on lights. -- Added support for doom3 light_rotation and rotation key on lights. - -22/01/2005 -SPoG -- Fixed crash when accessing links from help menu. -- Fixed broken links in help menu. -- Added game-specific docs to win32 setup. -- Changed q3 connect-entities to preserve existing targetname key. -- Changed q3 connect-entities to generate targetname key based on target classname. - -21/01/2005 -SPoG -- Moved information in synapse.config into .game files. -- Added api versioning for module-system. - -20/01/2005 -SPoG -- Fixed keys/values for brush entities not being editable unless parent is selected. -- Fixed brush-entities not being deleted when the last child brush is deleted. -- Fixed scenarios where worldspawn is not the first entity in the map. - -19/01/2005 -SPoG -- Fixed numerical instability in brush winding-generation. - -16/01/2005 -SPoG -- Added Jedi Academy support to linux installer. -- Fixed main-window jumping to front during autosave. -- Fixed saving of empty brushes. -Jame Wilkinson -- Fixed build errors when compiling for big-endian target. - -15/01/2005 -SPoG -- Fixed launching q3map2 from build-menu on linux/osx. -- Added version checking of generated config files. -- Fixed key-up events being missed while holding ctrl/shift/alt. -- Fixed texture-compression support. -Jago -- Changed q1 trigger_relay and trigger_counter to be point entities. - -11/01/2005 -SPoG -- Changed brush-save to not write non-contributing faces. -- Fixed rendering artifacts on outlines of selected box-entities. - -10/01/2005 -SPoG -- Added patch-cap-cylinder. - -09/01/2005 -SPoG -- Fixed texture-browser scroll-to-selected-texture. -- Added brush face texture painting. - -08/01/2005 -SPoG -- Fixed ungroup-selected-entities. -- Added 'Entity' menu. -- Removed items unrelated to entity-creation from xy-window right-click menu. -- Fixed minor memory leaks in core. -- Removed code that ignores empty alpha-channel in tga loader. -- Fixed memory leak in model module. -- Fixed memory leaks in picomodel library: ase and lwo loaders. -- Changed default tool to 'QE' tool. - -04/01/2005 -SPoG -- Changed start-on-primary-screen default to 'true' with multiple screens. -- Added enter/escape as shortcuts for OK/Cancel buttons on modal dialogs. -- Disabled mouse-chase scrolling in XY window when drag-selecting. -- Fixed xlink I/O warnings on linux. -- Removed light-creation 'intensity' dialog in doom3 config. -- Changed the default vertical size of the shortcut-list window to 400. -- Fixed patch-creation with zero-sized workzone. -- Fixed crash when rendering doom3 light_radius box. - -03/01/2005 -SPoG -- Added arbfp1/arbvp1 vertex/fragment program lighting support. -- Fixed colour-selection dialog not going away after OK/Cancel. -- Fixed tangent/bitangent calculation on degenerate patches. -- Added resizing of patches with QE tool. - -02/01/2005 -SPoG -- Added stippled hidden-line rendering for rotate/translate manipulators. -- Refactored high-level camera/orthographic rendering functions. -- Fixed failure to load models with back-slashes in path. -- Improved peformance of doom3 lighting with large models. - -01/01/2005 -SPoG -- Changed entity renderering to draw connections for culled entities. -- Fixed runtime errors on shutdown after cycling between lighting/textured. -- Fixed 'Cancel' button in modal dialogs behaving like 'OK' button. -- Changed 'clip' brush filtering to use shader parameters instead of names. -- Added rendering of origin-point for selected model entities. -- Fixed doom3 light-interaction updates for model entities. - -31/12/2004 -SPoG -- Removed menu-splitting functionality. -- Refactored entity-class menu construction. -- Replaced const_reference with ConstReference. -- Renamed string_t to CopiedString. -- Changed code using Str::Format and Str::operator+= to use StringOutputStream. -- Refactored shortcut command parsing code. -- Changed light entity rendering to show light_radius box only in doom3 config. -- Added 2x overbrightening for doom3 lighting preview. - -16/12/2004 -SPoG -- Changed default doom3 light_radius to 300. -- Fixed initial value of doom3 light_center. -- Reduced frequency of gui updates during map load. - -13/12/2004 -SPoG -- Fixed crash in monitored-compile feedback dialog. - -12/12/2004 -SPoG -- Added visualisation of halflife texture-projection format. -- Added texture-lock for halflife texture-projection format. -- Changed brush-texture-lock default to enabled for doom3 and halflife. - -11/12/2004 -SPoG -- Refactored script-tokeniser. -- Fixed doom3 lighting on ATI cards. -- Added support for list attributes in entity definitions. -- Added utf8-normalisation on text printed to console. -- Fixed missing default_build_menu.xml in halflife game config. - -10/12/2004 -SPoG -- Fixed missing commas in entity-inspector comments. -- Added support for default values in entity-definitions. - -09/12/2004 -SPoG -- Enabled doom3 realtime lighting preview. - -05/12/2004 -SPoG -- Fixed gcc compile warnings in patch.cpp. -- Added q1 and q2 support to linux installer. - -02/12/2004 -SPoG -- Added highlighting of entity-list nodes that have selected descendants. - -29/11/2004 -SPoG -- Fixed xy-window failing to update after map-load. - -28/11/2004 -SPoG -- Fixed error on shutdown when game-select dialog is disabled. -- Added surface/light-interaction debugging mode. -- Added per-plane light-culling for brush faces. -- Added support for bump shaders using 'blend' layer keyword. -- Added support for light-shaders. -- Fixed edge/border clamping on light-attenuation textures. -- Added 'Lighting' camera render-mode for doom3 config. - -25/11/2004 -SPoG -- Fixed right-click-menu on linux. - -13/11/2004 -SPoG -- Changed light-entity to draw radii only when selected. - -07/11/2004 -SPoG -- Fixed shortcuts for creating n-sided brush-prisms. - -19/10/2003 -SPoG -- Fixed user-customisable shortcuts support. - -16/10/2003 -SPoG -- Added restore-main-window call when a modal-dialog dialog-box is shown. - -13/10/2003 -Jamie Wilkinson -- Fixed SConstruct cpu detection on Power Macintosh. -- Added more verbose warning settings for gcc builds. -SPoG -- Changed buffered-text-input-stream API to not use magic EOF value. - -06/10/2004 -Jamie Wilkinson -- Fixed debug-break on non-x86 platforms. - -05/10/2004 -SPoG -- Fixed new doom3 entities not being given unique names. - -02/10/2004 -SPoG -- Fixed autosave causing the main-window to jump to the front. -- Fixed window-title when changing view direction in floating-windows layout. -- Added status information to wait dialogs. -- Changed map-save to overwrite/refresh files modified/deleted outside radiant. -- Changed component selection in QE tool to treat near-equal points as one. -- Added texture browser window to View menu. -- Changed white overlay in camera-window to draw hidden lines in 75% grey. -- Reduced point-size for vertex/edge/face handles by 2/3. - -25/09/2004 -SPoG -- Added component-editing for curves on doom3 entities. -- Added normalisation of translation for texture-lock on doom3 brushes. -- Added update of surface inspector for texdef changes caused by texture-lock. -- Changed floating-windows layout to centre all ortho views on center-xy-views. -- Stopped autosave from saving unmodified maps after first-time load. -Shamus -- Textool improvements. - -21/09/2004 -Michael Schlueter -- Changed file-chooser dialogs to use GtkFileChooser. - -20/09/2004 -SPoG -- Added basic rendering for 'curve_CatmullRomSpline' on doom3 entities. - -19/09/2004 -SPoG -- Added basic rendering for 'curve_Nurbs' on doom3 entities. - -18/09/2004 -SPoG -- Added doom3 entity-definition editor_usage* key support. -- Added doom3 entity-definition editor_* key info to entity-inspector comments. -- Added specialised attribute-entry in entity-inspector for boolean attributes. -- Fixed crash in find-brush when entering the index of a fixed-size entity. -- Added support for rendering doom3 'targetN' -> 'name' entity connections. -- Changed connect-entities to use 'targetN' and 'name' keys on doom3 entities. -- Improved handling of brushes with near-duplicate planes. -- Fixed crash in snap-to-grid on brushes with non-contributing faces. - -17/09/2004 -Michael Schlueter -- Fixed gcc build errors. -SPoG -- Fixed stability problems with doom3 brush-entities. - -16/09/2004 -SPoG -- Added automatic renaming of entity target/name keys for paste and import-map. - -13/09/2004 -SPoG -- Fixed rotation/mirror toolbar buttons using wrong axes in certain situations. -- Fixed incorrect filter settings display in filters menu. -- Added automatic renaming of entity target/name keys when cloned. -- Fixed quake2 support. - -12/09/2004 -SPoG -- Added shortcut support for all menu commands and toolbar buttons. -- Fixed patch shader-name saving for doom3 patches created by user. - -10/09/2004 -SPoG -- Fixed patch-cap-endcap and patch-cap-reverse-endcap. - -09/09/2004 -SPoG -- Fixed status-bar labels showing 'Label' at startup. -- Fixed textures-menu grouping bug. -- Fixed mirroring on brushes with doom3 plane-defs. - -08/09/2004 -SPoG -- Changed patch-cap-selected to prompt for cap type only once. -- Fixed infinite-loop in patch-cap-selected. -- Changed autosave to only save if the map has changed since the last autosave. -- Changed "file exists, overwrite?" to go back to the file-chooser if 'no' is selected. - -07/09/2004 -Michael Schlueter -- Removed unused source files - qsysprintf, gtkfilesel. -- Changed linux exectuable-path resolution to use '/proc/self/exe'. -- Changed 'file exists, overwrite?' prompt to default to 'no'. - -06/09/2004 -SPoG -- Fixed crash when handling duplicate shader definitions. -- Fixed crash on startup after changing game-type (sp/mp). -- Changed compute-axis-base to be more stable in degenerate cases. -Michael Schlueter -- Cleaned up loki_path stuff. -Shamus -- Added textool rotation manipulator. - -01/09/2004 -Michael Schlueter -- Changed linux installer to copy *.game files from game-packs instead of generating them. - -29/08/2004 -SPoG -- Moved doom3 shader parsing into a separate function. -- Fixed saving of visibility of yz-side and xz-front in floating-windows layout. -- Added inheritance of doom3 entityDef 'editor_* *' keys. -- Added support for doom3 entityDef 'editor_* *' keys other than 'editor_var'. -- Changed entity-inspector attributes panel to be scrollable. -- Changed shaders module to load *.mtr for doom3 instead of using shaderlist. -- Improved doom3 material parsing. -- Fixed crash loading maps containing patches with large numbers of control points. -- Changed face-selection in camera view to use polygon test. -- Changed face-selection-mode rendering in camera view to cull back-faces. -- Changed shaders module to use diffusemap on doom3 shaders with no qer_editorimage. - -28/08/2004 -SPoG -- Fixed undefined-behaviour bug causing a crash with gcc optimisation. -- Fixed opengl extension support on linux. -- Added support for half-life .fgd entity-definitions. -- Fixed loading of half-life maps with texture-names containing '{'. - -26/08/2004 -SPoG -- Updated win32 install to use gtk+-2.4.7 and gtk-wimp-0.6.2. -- Removed 'unknown model type: ""' and 'Texture load failed: ""' errors. -- Changed pivot-point calculation to use entity-origin for fixed-size entities. -- Fixed errors drawing selection-rectangle in floating-windows layout. -- Fixed shortcuts becoming disabled in floating-windows layout. -- Removed snap-to-integer on entity angle/angles/scale keys. -- Fixed dragging of doom3 brush-entities. -Michael Schlueter -- Fixed gcc compiler error and warnings. -- linux installer fixes. - -25/08/2004 -Michael Schlueter -- Changed linux build system to copy '$GAME.game/*' for installer. -- Changed linux installer to use 1.5's module set. -- Removed optimisation from linux build to fix optimiser-related crash. -- Added Doom3 support to linux installer. -SPoG -- Changed texdef export to not snap shift/rotate to integer. - -17/08/2004 -SPoG -- Fixed texture-browser height update bug. -- Changed texture-browser to show only the texture-set selected from the menu. -- Fixed bug loading quake maps. - -16/08/2004 -SPoG -- Fixed shortcuts for shift/rotate/scale-texture on patches. -- Fixed patch-inspector rows/cols combos not being cleared between selections. -- Changed entity/brush counts to use counters instead of polling every second. -- Changed archivewad module to check lump types and ignore non-miptex files. -- Added support for worldcraft/hammer half-life map format. - -15/08/2004 -SPoG -- Added doom3 md5mesh loader. -- Added support for doom3 entityDef 'model' key. -- Changed textures-menu to show/load only shaders in the form 'textures//*'. -- Fixed texture-browser height calculation bug. -- Added support for doom3 entityDef 'editor_var *' key. -- Fixed support for patchDef3 subdivision settings. - -14/08/2004 -Chronos -- Added doom3 light_radius and light_center rendering. -SPoG -- Disabled default-shaders for doom3. -- Added one-click dragging of vertices/edges/faces on brushes and patches. -- Fixed detail flag being lost on brush-clone or save-as. - -12/08/2004 -SPoG -- Fixed workzone being invalidated when a brush is deleted. -- Fixed pivot updates when switching from translate-tool to rotate-tool. -- Fixed crash in misc_model. -- Changed file_dialog to show '*.*' when pattern is not specified. -- Added undo support for patch-inspector XYZUV tweaking. -- Removed 'Apply'/'Done' buttons from patch-inspector. - -11/08/2004 -redfella -- Converted RTCW entities.def to xml format. -SPoG -- Added support for "name" key for doom3 entities. - -10/08/2004 -SPoG -- Added support for loading text files from VFS archives. - -09/08/2004 -SPoG -- Changed .map writer to always use decimal notation for floats. -- Added filtering of monster_clip/full_clip/player_clip. -- Added support for inheritance in doom3 entity-definitions. -- Fixed doom3 patchDef2 material-name import/export. - -06/08/2004 -SPoG -- Doom3 support: - - Map load/save. - - Materials parsing. - - entityDef parsing. - - Fixed brush-primitives texturing bug. - - Added texture-lock for brush-primitives texturing on all transforms. - - Added support for model/rotation/origin keys on func_ entities. -- Added DDS image module. - -03/08/2004 -SPoG -- Fixed copy/paste copying all brushes of an entity when only one is selected. -- Fixed discrete-camera-movement shortcuts becoming disabled after using freemove-camera. - -27/07/2004 -Shallow -- Converted ET entities.def to xml format. - -26/07/2004 -SPoG -- Fixed SI when not in face-selection mode. -- Changed patch-create-prefab to use current workzone. -- Changed engine attribute to be optional in game-description. - -24/07/2004 -SPoG -- Changed module server to support wildcard modules. -- Cleaned up docs/developer, added README. -- Removed old TODO. - -23/07/2004 -Shamus -- Initial version of textool. -MindLink -- Fixed const bug for vs.net 2005 compiler. - -22/07/2004 -SPoG -- Fixed copy/paste and export-selected failing to export stuff. - -19/07/2004 -SPoG -- Updated win32 setup scripts for q1 entity definitions. - -18/07/2004 -SPoG -- Updated win32 setup scripts. -- Fixed bug loading 8-bit bmp with <256 palette entries. -- Added support for loading textures from arbitrary locations. -- Changed shaders module to load notex/shadernotex from bitmaps/ in .bmp format. -- Fixed bugs in brush-primitives texdef code. - -17/07/2004 -SPoG -- Added STV:EF support to win32 installer. -- Moved hardcoded game-specific configuration stuff into .game files. - -16/07/2004 -SPoG -- Fixed crash bug in brush edge/vertex/face selection. - -15/07/2004 -SPoG -- Moved .def files from //scripts/ to ///. -- Changed entity inspector UI to be driven by entities xml. - -14/07/2004 -SPoG -- Fixed map load/save in brusb-primitives mode. -- Added files required to run in brush-primitives mode. -- Added support for changing engine-path while a map is loaded. - - -11/07/2004 -SPoG -- Changed entity inspector to support custom UI for each entity-class. - -10/07/2004 -SPoG -- Added support for experimental xml version of .def format. -- Rewrote token parser. -- Rewrote .def parser. -- Fixed failure to read show-workzone preference. -- Refactored quake3 entities module. - -03/07/2004 -SPoG -- Changed QE-style Drag tool to move as well as resize. -- Fixed shortcuts becoming disabled. -- Fixed loading file types with upper-case extensions. - -30/06/2004 -AcidDeath -- Added support for plugin submenus. - -27/06/2004 -SPoG -- Added build-menu-command editing. -- Fixed texture-object reshuffle caused by changing gamma. -- Refactored vfs/shaders/renderstates/eclass/texturemenu unrealise/realise systems. - -26/06/2004 -SPoG -- Added printf-formatting support to output streams. -- Added error/warning printing to xml parser. -- Changed build-menu xml format to allow easier editing. -- Added sample plugin. - -25/06/2004 -SPoG -- Changed paste and import-map to select pasted/imported entities and world brushes. - -24/06/2004 -SPoG -- Changed create-entity API to use eclass instead of classname. -- Changed nodes with unknown entity types to use a group-entity if the node has children. - -18/06/2004 -SPoG -- Changed image-loaders interface to use a file object instead of VFS. -- Changed model-loader interface to support in-place model reloading. -- Changed picomodel-loader module to support configuration of suppported model types in synapse.config. -- PicoModel: added support for loading models from an abstract input stream. - -14/06/2004 -SPoG -- Refactored texture browser. -- Removed GLWindow. -- Fixed mousewheel movement in camera window. - -13/06/2004 -SPoG -- Added load-entire-wad from textures menu in Quake/HL mode. -- Fixed bug with writing negative integers to .map format. -- Fixed texture-browser hide-unused to show only in-use shaders. -- Fixed texture-browser scrollbar positioning and origin-clamping. -- Fixed prompting to save unchanged new maps. -- Changed unsaved-changes message box default to "Yes, save" instead of "OK, don't save". -- Changed all message boxes to appear centrally. -- Removed minimize/maximize buttons from all message boxes. - -12/06/2004 -SPoG -- Disabled shortcut keys during drags. -- Fixed window updates for edge/vertex multi-selection. -- Added apply/cancel on enter/escape for texture-browser filter entry. -- Changed undo system to use explicit start/finish pair to specify undoable operations. -- Changed undo system to print undoable command after command completion instead of before. -- Added printing of movement parameters for translate/rotate manipulator drags. -- Changed brush-subtract to not delete the selection after subtracting. -- Fixed texture browser to not display textures if only in-use by nodes in the undo-queue. -- Fixed another workzone-update performance issue causing area-selection to be slow. -- Added code to brush build-B-Rep to handle duplicate edges. - -10/06/2004 -SPoG -- Added lazy evaluation of local->world transforms and world-space AABBs. -- Added shortcut key for translate mode, default 'W'. -- Added toolbar buttons for edge/face/vertex modes. -- Changed Escape shortcut to deselect-components if components are selected. - -02/06/2004 -SPoG -- Fixed performance bug with workzone updates not being lazily evaluated. -- Fixed brush edge-graph bug by removing degenerate winding edges. - -01/06/2004 -SPoG -- Added mode information to status bar. -- Added console feedback describing undoable commands executed. -- Fixed assertion failures on updating degenerate edge/vertex selections. -- Fixed detail brushes turning structural when clipped. - -31/05/2004 -SPoG -- Added support for more than one edge/vertex selected per brush. - -29/05/2004 -SPoG -- Refactored groupdialog - decoupled notebook from console/textures/entity pages. -- Fixed crash in patch tesselator. -- Fixed floating windows startup crash. -- Fixed null texture name for patches. - -28/05/2004 -SPoG -- Hide arrows on translate manipulator when obscured by square part. -- Workaround for main window not being brought to front when a floating window is closed. -- Fixed rendering of selected components of degenerate brush faces. -- Fixed double typedef in picomodel. -- Fixed bug in allocator stuff. -- Fixed up clipper tool button state. -- Added workzone updates when selection bounds change. -- Fixed transient setting on floating inspector windows. - -27/05/2004 -Tr3b -- Fixed gcc build errors. -SPoG -- Fixed crash bug in game selection dialog. - -26/05/2004 -SPoG -- Cleaned up project settings. -- Changed autosave/snapshots to only save modified maps. -- Refactored build menu. - -23/05/2004 -SPoG -- Fixed minor picomodel ase loader smoothing-groups bug. - -19/05/2004 -SPoG -- Allocator system improvements, fixed warnings - -18/05/2004 -SPoG -- PicoModel: added support for per-vertex smoothing-group, used in generation of normals. -- PicoModel ASE loader: added support for per-face 'MESH_SMOOTHING' id. -- PicoModel: changed normal generation code to create smooth normals across texcoord/colour discontinuities. -- Fixed cosmetic menu bug. -- Fixed file handle leak in tga loader. -- Added experimental allocator system. - -15/05/2004 -Tr3b -- Fixed gcc build errors. - -11/05/2004 -SPoG -- Fixed version.h custom build step on win32 -- Refactored preferences dialog to eliminate dependencies on other modules. -- Redesigned preferences dialog ui layout. - -06/05/2004 -SPoG -- Refactored texture browser. - -05/05/2004 -SPoG -- Upgraded win32 gtk2 version to 2.4.1. -- Migrated from GtkCombo to GtkComboBox. -- Texture browser improvements. -- Fixed malloc/free mismatch bug. - -05/05/2004 -SPoG -- Refactored surface inspector and texture browser. - -02/05/2004 -Nurail -- Added imageq2 module with support for quake2 and heretic2 texture formats: wal, m8, m32. - -30/04/2004 -SPoG -- Changed texture window not to auto-scroll when selecting faces. -- Changed surface inspector to apply shader seperately from shift/scale/rotate. -- Changed selected face tracking to use separate selection list. - -26/04/2004 -SPoG -- Added per-file change tracking - only modified (unsaved) files are saved by SaveMap(). - -18/04/2004 -SPoG -- Fixed texture-increment-matches-grid. -- Changed selecting a texture to only change the shader on the selected brushes. -- Changed 'Axial' button in surface inspector to reset the texdef for selected brushes/faces. -- Removed MAX_TEXTUREDIRS limit. - -11/04/2004 -SPoG -- OS library module added to wrap calls to rename/unlink/access/stat. -- OpenGL-view selection tests constrained to current window. -- Cleaned up OpenURL. -- Added jk2 and sof2 support to win32 installer. - -09/04/2004 -TTimo -- update the OSX setup / .info generation code - -08/04/2004 -SPoG -- Added integer quantisation for brush edge/vertex drags to fix FP-drift on planes. -TTimo -- fix for scons 0.95 -- re-enable Python >= 2.1 version check -- OSX 10.3: remove obsolete dlsym_auto_underscore (bug #920) -- OSX: disable q2 tools build (broken thread code) - -07/04/2004 -SPoG -- Moved profile.cpp into a separate static library. - -06/04/2004 -SPoG -- Refactored preferences to be more modular. -- Fixed preferences being corrupted if a crash occurs during preference saving. -- Refactored window position saving. -- Fixed bug in radio button creation in preferences dialog. - -24/03/2004 -SPoG -- Changed surface inspector to unfocus after pressing escape or return, to enable shortcuts. -- Added refresh of surface inspector for shift/scale/rotate-texdef shortcuts. -- Fixed bug causing some operations to be applied twice. - -21/03/2004 -SPoG -- Added depth-test and normalisation for translate-manipulator rendering. -- Added basic clipper-preview rendering. - -18/03/2004 -SPoG -- Added maya-style arrow-heads to translate manipulator. -- Changed square part of translate manipulator to be viewplane-oriented. -- Changed square part of translate manipulator to take priority for selection. - -15/03/2004 -SPoG -- Added recalculation of pivot-point when grid size changes. -- Changed win32 SHGetFolderPath to link with shfolder.lib instead of shell32.lib. -- Fixed failure to recover brushes from an invalid state. - -14/03/2004 -SPoG -- Improved event handling to make manipulator-dragging smoother in complex scenes. -- Refactored camera window camera-movement handling. - -06/03/2004 -SPoG -- Fixed vertex/edge undo failing to update selected-vertex position. - -29/02/2004 -SPoG -- Re-enabled next-xy-view in floating windows mode. -- Reinstated light-radius rendering. -- Added Wolfenstein support to win32 setup. - -24/02/2004 -SPoG -- Changed create-brush-prism to use correct dimension for prism radius. -- Changed freelook selection to use window-centre position. - -22/02/2004 -SPoG -- Optimised undo for adding/removing scenegraph nodes. -- Changed entity-list view to sort the tree by name. - -18/02/2004 -SPoG -- Moved default shaderlist to ///default_shaderlist.txt -- Moved user shaderlist to ////shaderlist.txt - -11/02/2004 -SPoG -- Refactored clipboard copy/paste code to allow re-use. - -10/02/2004 -SPoG -- Fixed false-positive-intersection bug in CSG subtract algorithm. - -07/02/2004 -SPoG -- SceneGraph: Refactored per-instance functionality. -- Fixed intermittent culling bug caused by bad bounding boxes. -- Fixed missing ToggleCubicClip shortcut. -- Removed modal buttons from Surface Inspector. -- Changed Surface Inspector keys: - - Escape: revert not-yet-committed values to previous state. - - Enter: commit not-yet-committed values immediatly. -- Changed Surface Inspector to update when selection changes. - -31/01/2004 -SPoG -- Cleaned up functional.h template usage with typedefs. -- Fixed autosave path. -- Added q1 component to installer. -- Added radiant_manual component to installer. -- Added q3-example-maps package to installer. - -29/01/2004 -SPoG -- Added error reporting for module system initialisation failure. -- Added MSI package creation tools in setup/win32. - note: requires MSI SDK binaries in http://zerowing.idsoftware.com/radiant-files/msi/msitools.zip -- Added initial version of scripts to build basic win32 setup. - -26/01/2004 -SPoG -- Added storing EnginePath for each game in local.pref. -- Added EnginePath editing to prefs dialog. -- Added vfs shutdown/init when gamename changes. -- Added vfs shutdown/init when enginepath changes. - -25/01/2004 -SPoG -- Fixed filtering updates. -- Moved default bsp menu to //default_build_menu.xml -- Moved user bsp menu to ///build_menu.xml -- Moved synapse.config to //synapse.config -- Moved game-specific .xlink files to //*.xlink - -25/01/2004 -SPoG -- Redesigned filter system: - - Filtered status updated when filterable attributes change. - - Supports per-brush-face filtering. -- Removed long-dead project-settings stuff: - - Moved gamemode and gamename storage into local.pref temporarily. - - Moved bsp commands over to a new format, disabled gui editing for now. - -20/01/2004 -SPoG -- Changed win32 Application Data path lookup to use win32 API instead of getenv. - -14/01/2004 -SPoG -- Fixed main menu mnemonics. -- Fixed crash on exit after viewing pointfile. - -13/01/2004 -SPoG -- Fixed not always resetting -component-mode when selection is cleared. - -11/01/2004 -Tr3B -- Added parse/write support for BrushDef3 and PatchDef3. - Requires editing synapse.config to enable. -SPoG -- Rearranged menus: - File = new/open/import/export - Edit = manipulate scene hierarchy and selection - View = toggle entityinspector/entitylist/surfaceinspector/camera/xy - edit camera/xy parameters - filters/hideshow/region - Modify = transform scene elements - Build = bsp menu -- Fixed Brush-Primitives support: - Requires editing synapse.config to enable. - Supports load/save of BP mapfiles, and editing BP texdefs in surface inspector - (Not yet possible to convert between formats). - -15/12/2003 -SPoG -- Changed user-prefs to be stored in user-profile directory on win32. - -14/12/2003 -SPoG -- Fixed entitylist window visibility tracking. -- Implemented find/replace-shader for patches. -- Changed get-texture-from-selected to update find/replace-shader dialog. -- Implemented reparent-selected for more than one selected node. -- Added checks to stop assignment of invalid texture names. -- Fixed uninitialised texture-compression setting. -- Fixed bsp menu. - -------- spog_branch merged to trunk - -10/12/2003 -SPoG -- Ported imagehl module. -- Ported imagepng module. - -03/12/2003 -SPoG -- Changed brush winding generation to use use double precision planes. -- Fixed tracking of modifier key state. - -29/11/2003 -SPoG -- Replaced mathlib with c++ vector/matrix library. -- Added expression-templates for common vector/matrix operations. - -21/11/2003 -SPoG -- Refactored component-selection stuff. -- Ported m4x4_t library to c++ Matrix4. - -16/11/2003 -SPoG -- Changed shortcuts.ini to be written automatically. -- Moved more prefs into specific modules. -- Changed c++ NULL usage to 0 for maximum portability. - -11/11/2003 -SPoG -- #include cleanup. -- Added debug output/assert for module initialisation. - -09/11/2003 -SPoG -- Refactored status bar stuff. -- Refactored window updates to use closures. -- General cleanup and refactoring. - -08/11/2003 -SPoG -- Increased priority of window redraw events. -- Ported model module to new module system. - -07/11/2003 -SPoG -- Refactored window updates. - -05/11/2003 -SPoG -- Changed menubar/toolbars to be non-detachable. -- Fixed empty-undos created when left-clicking in XY window. -- Refactored camera modelview/projection matrix updates. -- Moved application-specific code out of mainframe.cpp. -- Reinstated brush/entity count in statusbar. - -04/11/2003 -SPoG -- Reinstated instant status-bar updates. - -30/10/2003 -SPoG -- Fixed crosshair cursor in clipper mode. - -29/10/2003 -SPoG -- Changed camera to maintain valid projection/modelview matrices. -- Moved manipulator-transform update from frustum class to selection system. -- Removed frame-rate dependency in 3d-window freelook. - -27/10/2003 -SPoG -- Smoothed out xy-window mouse-chasing. -- Changed mouse-chasing to occur 16 pixels inside the window edges. -- Changed xy-window to maintain valid projection/modelview matrices. -- Fixed invalid workzone generated when deselecting with no selection. - -26/10/2003 -SPoG -- Ported changes from trunk between rev 3818 and rev 4036. - -25/10/2003 -SPoG -- Refactored xy-window mouse event handling. - -22/10/2003 -SPoG -- Fixed freelook focus-out event. -- Changed selection mouse event handling to use modifiers on button-release. - -21/10/2003 -SPoG -- Refactored all mouse event handling for camera window. -- Changed menus/toolbars/accelerators to use anonymous closures. - -20/10/2003 -SPoG -- Fixed get-pointer-in-screen-coordinates on win32. -- Changed patch prefs to use preference-system module. -- Fixed selection of side-on faces. -- Changed brush rendering to avoid glPushClientAttrib - workaround for ATI driver issue. - -19/10/2003 -SPoG -- Changed VFS directory initialisation to occur after module initialisation. -- Changed load-preferences to occur after module initialisation. -- Added preference-system module. -- Changed undo prefs to use preference-system module. -- Restored splash screen with non-intrusive behaviour. -- Cleaned up main-toolbar creation. -- Fixed floating windows behaviour when main window is minimised. -- Changed shader-list parsing to use new script tokeniser. -- Changed deprecated code using GtkPixmap to use GtkImage. -- Removed bitmap-loading from core. -- Removed pc-speaker beep on map-save. - -17/10/2003 -SPoG -- Fixed crash when trying to undo on an empty undo queue. -- Refactored gtkdlgs, using helper functions to create common widgets. -- Changed Dialog class to use std::list for data. - -13/10/2003 -SPoG -- Refactored entity inspector. -- Removed miscellaneous unused functions. -- Refactored qe3 header. -- Moved texture-window preferences into texwindow.cpp. - -12/10/2003 -SPoG -- Moved layout-mode dependant code into main-frame creation. -- Replaced prefs system with new import/export system. -- Fixed gcc3.3 build errors. - -11/10/2003 -SPoG -- Moved unnecessary methods from MainFrame into free functions. -- Removed unsupported toolbar buttons and menu items. -- Changed misc->gamma to not require restart. -- Fixed unmaximised window-size when loading main window maximised. -- Fixed saving of rotate increment preference. - -10/10/2003 -SPoG -- Fixed keyboard shortcuts intercepting input to texture-subsets text-entry. - -09/10/2003 -SPoG -- Fixed gcc3 build errors, compiled and tested on linux. - -08/10/2003 -SPoG -- Fixed brush snap-to-grid creating huge coordinate values. -- Fixed minor bug in selection menu. - -07/10/2003 -SPoG -- Cleaned up MainFrame. -- Added quantisation of plane pts when dragging. -- Fixed create-empty-brush bug. - -06/10/2003 -SPoG -- Moved control of camera keyboard-accelerators into camera window module. - -05/10/2003 -SPoG -- Separated keyboard-accelerators from menu items, using functors. -- Completed factoring out HandleCommand. - -04/10/2003 -SPoG -- Changed 4-way-split mode to automatically reposition separators when window size changes. -- Fixed gtk error in floating-entity/textures/console window. -- Fixed position of console horizontal pane separator. - -03/10/2003 -SPoG -- Work-in-progress factoring out HandleCommand. - -02/10/2003 -SPoG -- Fixed pink icons on main window on win32. -- Replaced g_bIgnoreCommands with signal block/unblock. -- Refactored MainFrame startup. - -01/10/2003 -SPoG -- Fixed entity-window redraw on selection change. -- Moved control over VFS init/shutdown to module system. -- Fixed failure to release translucency render-states. -- Added support for realise/unrealise of all opengl texture objects. -- Refactored startup/shutdown logic. - Changed quit commands to do nothing but call gtk_main_quit(). - Added code after gtk_main() to destroy stuff. -- Changed 25ms timeout-handler to an idle-handler for window updates. - (reduces redraw-request response time on fast machines) -- Moved gl-shutdown control to glwidget. - Textures are realised/unrealised when the shared context is created/destroyed. -- Fixed lack of a valid gl context when unrealising gl textures. - -30/09/2003 -SPoG -- Added support for translucent entity rendering. - -29/09/2003 -SPoG -- Changed all global modules to use GlobalModule helper templates. -- Ported qgl.c to c++. -- Changed win32 project to dynamic-link with opengl32.lib. - -28/09/2003 -SPoG -- Added new experimental xml preference import/export system. -- Refactored dialog base class: - Moved common dialog-element-creation code into helper functions. - Changed UpdateData to use per-element callback functions. -- Refactored preferences dialog. - -26/09/2003 -SPoG -- Reversed winding order for circle primitives. - -25/09/2003 -SPoG -- Fixed slow selection response in large maps. - -21/09/2003 -SPoG -- Added sharing of global modules within a client. -- Added quake map module and wal image module. -- Ported mip image module and hlw image module. -- Cleaned up imagehl module. -- Fixed crash in pcx image module. -- Rewrote md3 model module. -- Ported mdl, md2 and mdc model modules. -- Added filtering of q1/q2 clip brushes. -- Added ati-crash-workaround rendering path. -- Upgraded to gtk+-2.2.4 on win32: - Fixed capslock affecting shortcut-keys. -- Upgraded to gtkglext-1.0.4 on win32. -- Fixed copy/paste. -- Added shortcut-key support to entity treeview. - -17/09/2003 -SPoG -- Fixed failure to call vfsFreeFile on an empty buffer. -- Fixed calling convention for dlls in new module system. -- Changed map.cpp to support maps without a worldspawn entity. -- Fixed crash on attempting to clone a map root. -- Added filter-update calls after loading or cloning stuff. -- Fixed reference cache failing to save a file. - -16/09/2003 -SPoG -- Refactored client-side module system code for direct module access. -- Changed shaders, vfs, model, brush, patch and entity module interfaces - to use abstract base class. -- Removed unused functions from shaders and vfs interfaces. - -15/09/2003 -SPoG -- Removed synapse dependencies for win32 makefiles. -- Added find-first-module-of-type helper function. - -14/09/2003 -SPoG -- Added new lightweight module system: - Initialises each module the first time it is requested. - Does not allow configurations with cyclic runtime dependencies. - Provides templates for simple type-safe client-side implementation. - Requires no client-side linkage. -- Split radiant API into multiple APIs: - core, textures, scenegraph, selection, renderstate, filters, filetypes. -- Ported radiant, core, mapq3, mapxml, md3model, entity, shaders, image, - vfspk3, archivewad, archivepak, archivezip to new module system. - -11/09/2003 -SPoG -- Removed edge and vertex integer-snapping during selection. - -10/09/2003 -SPoG -- Replaced map in referencecache.cpp with a hashtable. -- Changed ReferenceCache interface to take a path string, - which can be either absolute or relative. - -08/09/2003 -SPoG -- Cleaned up qertypes.h - split into multiple files. -- Moved texdef stuff into itexdef.h. -- Fixed shutdown destruction order bug. - -07/09/2003 -SPoG -- Refactored texwindow.cpp. - Moved texture management code into textures.cpp. - Added textures api. - Replaced globals from texwindow.h with accessor functions. -- Cleaned up shaders module. - Removed color-shader stuff. - Rewrote shader-activation logic to use textures API. - Removed appshaders API. -- Refactored shutdown logic. - Moved non-mainframe shutdown stuff into Radiant_Shutdown(). - Added deferred render-state realisation. -- Fixed failure to create gl contexts in 16-bit mode for latest nvidia drivers. -- Changed hashtable template to use traits parameter - for case-insensitive hasher and keyequal functions. -- Removed unused functions from qerplugin API. - -02/09/2003 -SPoG -- Refactored code to remove global-object accesses: - Passing global objects as parameters to functions. -- Refactored texwindow. -- Moved synapse server out of pluginmanager. - Changed pluginmanager to handle nothing but IPlugin stuff. - -01/09/2003 -SPoG -- Refactored scenelib.h, split into multiple files. -- Refactored #includes related to scenelib.h. -- Refactored preferences for xywindow and camwindow. -- Refactored references to g_pParentWnd in xywindow and camwindow. - -30/08/2003 -SPoG -- Ported changes from trunk since 17/08/2003. -- Ported all changes from bug800-spog_branch (vfs rewrite and q1 support). - -29/08/2003 -SPoG -- Refactored component-selection stuff. -- Fixed selection-tracking bug in patches. - -28/08/2003 -SPoG -- Added support for line-strips to Selectors. -- Fixed selection for entity treeview. -- Refactored external-resource loading. - -20/08/2003 -SPoG -- Fixed snap-to-grid in edge and vertex modes. -- Added a default model to use when a model load fails. - -19/08/2003 -SPoG -- Changed snap-to-grid to vastly reduce the possibility of creating an invalid plane. - -17/08/2003 -SPoG -- Ported changes from trunk since 01/08/2003. - -12/08/2003 -SPoG -- Changed entity key/value tracking to only track keys already added to the entity. -- Fixed bug causing undo system to track scene changes during a queue-flush operation. - -12/08/2003 -SPoG -- Fixed bug in project settings bsp-commands display. -- Fixed empty undos being created by rotation buttons. -- Fixed rotation pivot for rotation buttons. - -09/08/2003 -SPoG -- Added property svn:eol-style=native to all text files. -- Added property evn:eol-style=CRLF to all dsp and dsw files. -- Partially ported bobtoolz to use new spog_branch module APIs. -- Removed Sys_UpdateScene. -- Added Map_Name() for access to currentmap variable. -- Added initial drag-n-drop support for graph tree-model. - -01/08/2003 -SPoG -- Fixed uninitialised refcount in entity key class. -- Fixed memory leak in shader parsing. -- Added reference-counting holder for worldspawn node. -- Moved string class and utilities into a new header in libs dir. -- Fixed external-file-resource cache to use case-insensitive name compare on win32. -- Fixed shaders to use case-insensitive name compare. -- Fixed shader module to display SHADER_NOT_FOUND when appropriate. -- Changed the default texture name to "NULL" instead of SHADER_NOT_FOUND. -- Changed move-into-entity to perform parent-selection-to-last-selected-node. -- Added a new implementation of GtkTreeModel operating directly on the scenegraph. -- Fixed disable-screen-updates to queue update requests instead of ignoring them. -- Merged from trunk (tag head-cvs2svn-2). - -22/07/2003 -SPoG -- Changed scale/flip-selection to use the manipulator as a pivot point. -- Added OnShutdown callback for CSynapseClient, used in entity module. -- Fixed console updates when loading maps/models. - -20/07/2003 -SPoG -- Added renderer support for qer_alphatest and qer_cull. -- Merged 'picomodule' module into 'model' module. -- Added rendering of area-selection rectangle. - -19/07/2003 -SPoG -- Merged from trunk. - -18/07/2003 -SPoG -- Disabled deleting classname key in entity inspector window. -- Cleaned up some stuff in selection system. -- Added basic versions of std::mem_fun and std::bind1st to function-object library. - -10/07/2003 -SPoG -- Implemented connect-entities. - -09/07/2003 -SPoG -- Completed local-space rotation manipulator. -- Fixed cloning objects within a misc_model subgraph. -- Fixed crash bug in loading certain models. - -06/07/2003 -SPoG -- Added function-object library header, similar to boost::function. -- Changed undo system to improve performance. -- Refactored entity inspector implementation. - -22/06/2003 -SPoG -- Refactored selection observing stuff. -- Changed shader parsing to use new tokeniser. -- Changed implementation of entities to use generic container. -- Refactored entity wrapper system. -- Fixed undo on delete/reset entity keys. - -21/06/2003 -SPoG -- Added rendering of target/targetname connection lines. -- Moved entity and eclass stuff out of qertypes.h into ientity and ieclass. -- Refactored entity_t to hide it behind Entity interface. -- Removed global project settings entity. -- Cleaned up bsp-command editing in project settings dialog. - -17/06/2003 -SPoG -- Fixed back-face-culling for selections by working in screen-space. - -16/06/2003 -SPoG -- Added workaround for nvidia driver opengl vertex arrays bug. - -15/06/2003 -SPoG -- Refactored Patch implementation. -- Refactored scene graph system to allow multiple graph instances. - -13/06/2003 -SPoG -- Added snap-selected-components-to-grid for faces edges and vertices. - -11/06/2003 -SPoG -- Improved normal-quantisation code. - -10/06/2003 -SPoG -- Changed renderer vertex types to be struct instead of typedef'd array. -- Added experimental quantisation of normals. - -05/06/2003 -SPoG -- Fixed intermittent crash in face-fit-texture. -- Changed patch rendering to display components only in vertex mode. - -02/06/2003 -SPoG -- Added nameable interface for scene graph nodes. -- Fixed undo for set-detail and set-structural. -- Added rendering of arrow for angled entities. - -01/06/2003 -SPoG -- Fixed handling of invalid planes during brush b-rep build. -- Refactored brush copy-construction/assignment. -- Fixed lack of rebuild after removing empty faces. -- Added lightjunior entity display. -- Fixed display of spawnflags/info for selected entity. -- Fixed update of entity window on setting spawnflags. -- Fixed botclip filtering. -- Fixed uninitialised alpha channel on jpg images by ignoring alpha. - -31/05/2003 -SPoG -- Cleaned up undo calls in brush and patch implementation. -- Changed brush implementation to defer rebuilds until needed. -- Fixed undo for find/replace shader. -- Refactored brush implementation, removed empty-face list. -- Fixed crash on loading unrecognised entities containing brushes. -- Fixed crashes in renderer caused by state-stack underflow. -- Fixed handling of invalid and duplicate planes during brush editing. -- Fixed failure to save brush faces during save-as. -- Refactored brush data members. - -28/05/2003 -SPoG -- Fixed crash on selecting stuff from entity list window. - -27/05/2003 -SPoG -- Fixed window title after save-as. - -22/05/2003 -SPoG -- Refactored selection system interface slightly. -- Removed old brushwrapper stuff. -- Fixed clipper-split-selection to keep both parts selected. - -21/05/2003 -SPoG -- Added select-faces-by-shader. -- Fixed find/replace-shader. - -19/05/2003 -SPoG -- Fixed rotation on misc_model. - -13/05/2003 -SPoG -- Fixed lack of undo on create-n-sided-brush. - -29/04/2003 -SPoG -- Fixed per-face find/replace and per-face nudge rotation. - -25/04/2003 -SPoG -- Fixed find-brush. -- Changed rotation buttons to use perfect precision for 90-degree rotations. - -24/04/2003 -SPoG -- Added find-dir-for-relative-filename and find-dir-for-absolute-filename to vfs. -- Changed resource manager to handle per-mod resources using vfs. -- Changed resource manager to allow resources with absolute paths. -- Fixed selection-test behaving like an ellipse instead of a rectangle. - -23/04/2003 -SPoG -- Changed selection test to choose closest-to-cursor over closest-to-camera. - -22/04/2003 -SPoG -- Fixed reference counting on shaders loaded from a texture directory. -- Fixed show-in-use and show-all shaders. -- Fixed undo for patch-set-shader. -- Changed shaders module to use STL map container instead of CShaderArray. -- Fixed SelectAllOfType for entities and patches. -- Cleaned up unused functions in shaders API. -- Decoupled selecting a texture in texture window from applying a texture to selection. - -21/04/2003 -SPoG -- Fixed memory leaks in image loaders, texdef_t, csg subtract, picomodel module. -- Fixed uninitialised memory references in renderer, texdef_t, eclass loader, undo system. -- Refactored tga loader. -- Cleaned up image module, enabled pcx and bmp loaders. - -17/04/2003 -SPoG -- Fixed shift-texture on selected brush faces. -- Changed brush b-rep algorithm to have higher tolerance for similar planes. -- Changed brush b-rep algorithm to always produce a valid connectivity graph. -- Added setting/getting shader for patches. - -16/04/2003 -SPoG -- Fixed tracking of in-use shaders (though undo queue still keeps shader references). -- Changed brush faces to store state in undo-system cleanly. -- Fixed flush & reload shaders and sleep/wake. -- Ensured that shaders are never leaked. -- Fixed bool conversion warnings. - -15/04/2003 -SPoG -- Added clamping of planepts on export to nearest 65536th of 1 unit. -- Changed m4x4 rotation functions to use double-precision for angles in radians. -- Changed m4x4 quaternion rotation to use double-precision internally. -- Changed float printing to use %g instead of %f (strips trailing zeros). - -13/04/2003 -SPoG -- Fixed brush import failing to update bounding boxes. - -11/04/2003 -SPoG -- Refactored Brush class into Brush, BrushInstance and BrushNode. -- Fixed various flaws stopping brush b-rep algorithm from being 100% reliable. - -02/04/2003 -SPoG -- Changed manipulator to move to position of selected brush components. - -01/04/2003 -SPoG -- Fixed xml parser failing to resolve predefined entities. - -31/03/2003 -SPoG -- Fixed asserts in brush manipulation when creating invalid brushes. -- Removed automatic update of current texdef. -- Added Get Texture and Set Texture to textures menu. - -29/03/2003 -SPoG -- Fixed array template failing to free zero-sized allocations. -- Changed clipper mode to behave as a component-editing-mode. -- Removed right-click-to-drop-clip-point - use X and leftclick instead. - -28/03/2003 -SPoG -- Changed scene graph to sort objects in ascending order of creation time. - -27/03/2003 -SPoG -- Fixed bug in clone-selection causing only first selected brush to be cloned. -- Optimised select-all for brush/patch components. -- Changed edge/face/vertex toggles to toggle correctly. - -26/03/2003 -SPoG -- Removed win32/x dependencies from gl interface. -- Removed win32/glib dependencies from core interface. -- Replaced void* in gtk helper functions with forward-declared GtkWidget. -- Changed gtk helper functions to return enumerated values instead of win32 IDOK. -- Removed WINAPI macro for __stdcall from all interfaces. -- Removed unnecessary dependencies from core stdafx/qe3 header. - -25/03/2003 -SPoG -- Changed class-level render states to be static for Brush and Patch. -- Refactored brush implementation - breaking it up into smaller parts. -- Added refcounted ptr template to track refcounts. -- Fixed refcount bug introduced by new clone-selection. -- Fixed warnings in brush implementation. -- Cleaned up plugin interface header inclusion. - -24/03/2003 -SPoG -- Fixed crash on building unbounded brushes in release build. -- Changed assertion failures to be non-fatal in release build. -- Moved OS-specific gl headers into separate files. -- Moved app-shaders interface into a separate file. -- Cleaned up dependencies for brush implementation. - -23/03/2003 -SPoG -- Added per-instance selection of patch vertices. -- Fixed per-instance vertex selection rendering on multiple instances. -- Refactored patch/brush render code. -- Changed manipulator transforms to convert to local space before applying. -- Fixed selection test for picomodule meshes. -- Fixed selection test winding order for triangles. -- Fixed update of window title on new-map and load-map. -- Changed selection to work with exactly side-on faces. -- Refactored instance implementation to reduce code bloat. -- Fixed map export always exporting root. - -21/03/2003 -SPoG -- Fixed external resource tracking to preserve uppercase characters in names. -- Changed clone-selection to not use global copy/paste. - -20/03/2003 -SPoG -- Changed map-save to save all saveable files that the map references. - -16/03/2003 -SPoG -- Moved hashtable and hashfunc into libs. -- Cleaned up renderer interface and selection interface. -- Refactored frustum testing class. - -12/03/2003 -SPoG -- Moved winding-specific stuff from brush obj to winding obj. -- Refactored filter subsystem to remove dependency on entity/brush/patch. - -07/03/2003 -SPoG -- Fixed crash when clicking cancel from patch cap-dialog. -- Changed selection tests to ignore back-facing faces. - -05/03/2003 -SPoG -- Fixed failure to release cloned scene graph nodes. -- Fixed selection manager failing to release render states. -- Fixed eclass system failing to release render states. - -04/03/2003 -SPoG -- Fixed writing-past-end of vertex arrays in brush rendering. -- Fixed releasing data stored in undo system when deleting undoables. -- Fixed crash in misc_model when model fails to load. -- Fixed undo for clone/rotate/flip/nudge/set-texture operations. -- Cleaned up surface dialog. - -01/03/2003 -SPoG -- Changed clipper split-selection to keep result selected. -- Cleaned up and finalised picomodule, adding to cvs. - -28/02/2003 -SPoG -- Cleaned up entity list window. -- Fixed crash on freeing a map while entity list node is selected. -- Fixed crash on clone/copy of externally referenced brushes. -- Added multiple-selection support to entity list. -- Added updating entity list selection display on selection changes. - -26/02/2003 -SPoG -- Added stl_warnings include. -- Fixed tracking of map-modified-since-last-saved. - -24/02/2003 -SPoG -- Fixed missing map-release when map-load fails. -- Changed map-rename (save-as) to flush undo queue. -- Fixed bug in exporting selections. - -23/02/2003 -SPoG -- Fixed redo on changing misc_model "model" key. - -22/02/2003 -SPoG -- Changed undo interface to factor out global undo system. - -21/02/2003 -SPoG -- Started cleaning up Map subsystem. - -20/02/2003 -SPoG -- Added 'clone subgraph' feature to core, using direct xml import/export. -- Added 'save' feature to reference cache. -- Added scope timer object. -- Changed scene graph interface to allow setting scene root. -- Changed core to use reference cache to track current map. -- Removed mapmodel module. -- Fixed relative paths for loading maps as misc_model. - -19/02/2003 -SPoG -- Changed model/map modules to register their file types on load. -- Added map module manager to support unlimited map loader modules. - -18/02/2003 -SPoG -- Changed vertex buffer template to support resizing. -- Changed vertex buffer search algorithm to iterate instead of recurse. - -17/02/2003 -SPoG -- Fixed sorting bug with render-states. -- Fixed colour state when disabling gl_color_array. -- Fixed unterminated loop in scenegraph traversal. -- Fixed freeing project entity twice on shutdown (infinite loop). -- Fixed failing to destroy the scene graph on exit (oops). - -07/02/2003 -SPoG -- Added updating current texdef when a face is selected. -- Fixed crash when creating a brush with duplicate planes. - -06/02/2003 -SPoG -- Fixed various issues with 'save region'. -- Changed default current texdef to use game-specific scale. -- Changed brush creation to use current texdef. -- Changed clipper to use current texdef. -- Fixed bug in selection counting for patch control points. - -05/02/2003 -SPoG -- Fixed reversed solid-selection-outline preference. -- Finished factoring out face_t. -- Added script token writer interface for map export. -- Changed map export interface to use script token writer. - -04/02/2003 -SPoG -- Added depth-buffer-write enable/disable feature to renderer. -- Changed Pointfile class to use renderer. -- Continued factoring out face_t. - -03/02/2003 -SPoG -- Fixed temporary objects leaving dangling references in the undo system. -- Changed import-map to not modify existing selection. - -02/02/2003 -SPoG -- Fixed frustum culling for transformed nodes. -- Fixed hide/filter/region to work independently. -- Added highlighting of selected brush faces in component mode. -- Fixed bug detecting thin area-selection if dragged down or left. -- Renamed brush_type to Brush. -- Renamed face_type to Face. -- Started factoring out face_t. - -01/02/2003 -SPoG -- Improved edge and vertex manipulation. -- Removed unnecessary graph traversals for rendering/selection. - -31/01/2003 -SPoG -- Merged changes since last merge from merge-1_2_10-post to spog_branch. -- Merged changes since last merge from HEAD to spog_branch. -- Tagged HEAD after merging as 'merge-spog_branch-post'. -- Added walker to merge sibling worldspawns. -- Merged changes to Construct for PPC from trunk. -- Fixed over-enthusiastic worldspawn merging. -- Fixed misc_model "angle" key setting pitch instead of yaw. -- Fixed entity set-key-value changing scene-graph topology. - -30/01/2003 -SPoG -- Added subgraph traversal feature to scenegraph traversal. - -29/01/2003 -SPoG -- Changed scene graph implementation to allow nested traversals. - -28/01/2003 -SPoG -- Fixed angles key order for misc_model. - -27/01/2003 -SPoG -- Fixed typo causing set-texture-of-selection to behave incorrectly. - -26/01/2003 -SPoG -- Replaced all tabs with spaces in CHANGES. -- Fixed entity bounds updates for 'light'. -- Fixed code that doesn't conform to c++ standard as enforced by gcc. - -24/01/2003 -SPoG -- Added missing file: icharstream.h. -- Fixed bug with synchronisation of brush-face instance data. -- Added .map format import/export interfaces. -- Removed last remnants of IBrush. -- Removed IPatch. -- Moved walkers defined in in mainframe.cpp to appropriate places. - -23/01/2003 -SPoG -- Changed scenegraph traversals to use a compiled graph. - -20/01/2003 -SPoG -- Changed selection interface to hide per-instance data. -- Added streaming tokeniser for .map format. -- Changed mapq3 module to use streaming tokeniser. -- Added xml stream interface for input and output. -- Added xml stream parser based on libxml2 SAX. -- Changed mapxml module to use xml stream input. -- Changed brush and patch to use xml stream input. -- Added xml stream writer. -- Changed mapxml module to use stream output. -- Changed brush and patch to use xml stream output. - - -16/01/2003 -SPoG -- Disabled pivot updates while selection is being manipulated. -- Changed pivot calculation to use instanced world-bounding-box. -- Fixed crash bug in PositionView. - -14/01/2003 -SPoG -- Merged with branch merge-1_2_10-post at tag spog_merge_merge-1_2_10-post -- Removed 10k+ lines of unused #if 0 code. -- Removed unused declarations in qe3.h. -- Removed brush and face types from qertypes.h. -- Removed plugin API stuff dependant on brush type. -- Added per-instance selection for brush faces. - -08/01/2003 -SPoG -- Added selection counters for primitive/component modes. -- Added face-drag mode (default shortcut key = F). -- Added face-centre-point rendering/selection/editing. - -07/01/2003 -SPoG -- Changed selection to work per-instance. - -06/01/2003 -SPoG -- Changed selector interface to allow per-entity selection tests. - -06/12/2002 -SPoG -- Added selection-test and selector objects to clean up selection system. -- Unified key modifiers for selection in both primitive and component modes. -- Added mapmodel module to load .map and .xmap as misc_model. - -02/12/2002 -SPoG -- Added debug rendering of a selection test. -- Fixed bugs in triangle/line clipper, making selection work properly. -- Refactored selection system interface. -- Added undo for texture nudge. -- Fixed minor render-state bug. - -29/11/2002 -SPoG -- Optimised wireframe drawing of brushes with back-face culling. -- Optimised brush-winding generation. -- Changed winding generation to be more robust with large world extents. -- Fixed crashes with unbounded-face and degenerate-edge cases. - -20/11/2002 -SPoG -- Completed rotation manipulator. -- Added translation manipulator for the default editing mode. -- Changed XY mouse-chaser speed to depend on distance mouse moved outside window. - -15/11/2002 -SPoG -- Added initial version of maya-style manipulators - rotation manipulator. - -07/11/2002 -SPoG -- Fixed false asserts in Brush ConstructPrefab. -- Undo system optimisation - uses binary-sorted container to speed up finding already-added objects. -- Fixed crash when transforming objects which don't support edit_interface. -- Fixed clone command to nudge the selection after cloning. -- Fixed clipper to remove brushes that are completely behind the clip plane. - -06/11/2002 -SPoG -- Brushes: cleaned up per-face operations to use face visitor pattern. -- Fixed setting brush face texdef, with fully functioning undo on individual brush faces. - -04/11/2002 -SPoG -- Refactored renderer to two objects, camera and XY renderer - XY uses entity shaders. -- Experimental pivot object.. work-in-progress. -- Modified scene-graph instance-caching to maintain multiple instances within nodes. -- Fixed undo bug, deleting a void* doesn't call the destructor. -- Rewrote filters system to work with scene graph system. -- Cleaned up quake entity module to provide same functionality as before. -- Refactored render-state cache to use generic hashtable and reference-cache templates. - -19/10/2002 -SPoG - spog_branch - experimental - work-in-progress -- added scene graph library: defines interfaces, generic graph node types, - re-usable systems for traversals, traversal paths, node containers, - multiple-instance caching of world-space-transforms/bounding-volumes/visibility. -- added scene graph traversals to replace all traversals of 'active_brushes', - 'selected_brushes', 'filtered_brushes' and 'entities' linked-lists. -- added view module: view-volume-culling system acting on the scene graph, - uses scene heirarchy to minimise culling tests per frame. -- added opengl-state module: sorts opengl-state objects (shaders) to minimise - opengl state changes during rendering. -- added renderer module: culls objects outside the view volume, - gathers non-culled renderable objects from the scene graph, - keeps track of state during traversal, adds renderable objects to correct opengl-state. -- added selection module: sets view volume to the selection box/ray, culls - objects outside the view volume, gathers non-culled selectable objects - from the scene graph (entity/primitive/component), - selects gathered objects (select/toggle/cycle) or moves things if already-selected. -- added patch module: encapsulates a patch as a scene graph node, - optimised patch tesselation. -- added brush module: encapsulates a brush as a scene graph node, - adapts multiple-brush operations to use the scene graph. -- adapted entity module: encapsulates an entity as a scene graph node/subtree, - shares common code between different visualised entity types. -- adapted model module: encapsulates a model as a scene graph node/subtree. -- added undo module: completely new compact infinite-undo-system, - operates on undoable objects, uses minimal-state data to store objects, - uses refcounting to undo "deleted" objects. - -TODO: cleanup: many simple things are still broken or not functioning in the right way.. -see !\todo items in the code (not all are documented yet though). -Selection module probably needs refactoring some more - perhaps split off the move-already-selected stuff. -The dependencies are still pretty bad.. need to refactor stdafx.h/qertypes.h. -Some of the above modules are not really modules, they're static-linked to the core, but could easily be dynamic-linked. -The interfaces to brushes and entities still expose brush_t and entity_t for backwards-compatibility. -NOTE: some todos are #if 0 because their functionality is (or will be) replaced by the new systems. - ------- branch point - spog_branch - -30/08/2003 -SPoG -- Ported changes from trunk. - -17/08/2003 -SPoG -- Ported changes from trunk. -- Added quake pack to win32 setup scripts. -- Fixed crash in RunBsp. - -17/05/2003 -SPoG -- Renamed stream interfaces with C and I prefix. -- Shoehorned bytestream into idatastream. -- Moved member classes out of IArchive, replaced with member typedefs. -- Renamed filesystem, path, dynamic string, file input stream with C and I prefix. -- Documented filesystem, path, dynamic string, file input stream. -- Cleaned up game-specific encapsulation classes a little. - -16/05/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=815 - found out about string_t that slept through my reviews - -Updated list of broken stuff on this branch: - -- include/bytestream.h: remove this file, extend idatastream.h header -from the code conventions: - include/ directory: - This directory is holding the API header files for the synapse modules (plus a few build control and version related headers) - All headers that describe synapse APIs should start with an i: ishader.h igl.h - - The few files in include/ that don't start with a lowercase i are specific files for build control and configuration. - Regular developement never creates non i-prefixed files in include/ - -the merge with IDataStream goes like this (note the corrected class names): -class IInputStream -class IOutputStream - -class IDataStream : public IInputStream, IOutputStream - -class ISeekableStream -class ISeekableInputStream : public IInputStream, public ISeekableStream -class ISeekableOutputStream : public IOutputStream, public ISeekableStream - -typedef unsigned int size_type; goes away, use size_t - -- include/iarchive.h - -renamed VisitorFunc to IArchiveVisitor -move it out of IArchive class (keep it in iarchive.h though) -from code conventions: - Don't declare classes inside classes. Makes the code harder to read and isn't useful to anything. - -- remove libs/bytestreamutils.h -put that functionality into the IStream stuff / idatastream.h stuff -anything you retrieve from an IStream should be endian-correct - -- libs/filestream.h -I'd rather see a header without embedded code, and a .cpp file for it - -- libs/fs_filesystem.h libs/fs_path.h -those totally lack documentation about what they are doing -same as above. way too much embedded code. makes things harder to maintain. implement in a .cpp -and as usual, name the classes correctly, C and I prefixes - -- gamespecific_t: rename correctly to CGameSpecific -I like the idea of gathering all hardocded game-specific behaviours inside one same class. -But is it really the topic of bug800? - -- gamespecific_executable_t: rename correctly to CGameSpecificExecutable -shouldn't this be merged with CGameSpecific? - -12/05/2003 -SPoG -- Fixed win32 build error (win32 has no ). -- Added dir_good() check to handle failure of dir_open() in posix DIR wrapper. -- Renamed dynamic_string_t and path_t to DynamicString and UnixPath respectively. -- Removed unnecessary use of 'inline' and 'virtual' keywords in class definitions (bad habit). -- Documented archive interface. - -09/05/2003 -TTimo -- some easy fixes to get it to startup on Linux -- tagging the current source as bug800-spog, preparing rollback - - -SPoG -- Added an implementation of IArchive to do OS filesystem access. -- Changed vfspk3 to use above implementation for OS filesystem access. -- Added const qualifiers to vfsGetFullPath and everything dependant on it. -- Changed vfsGetFileList to use "*" to indicate all-files instead of a NULL pointer. -- Extended IArchive interface to allow for extra filesystem functionality. - Added method to check if a file exists quickly. - Added method to traverse the filesystem with control on start-dir and depth of recursion. -- Defined implementation requirements for IArchive. - An archive contains a heirarchy of directories and files, and may contain empty directories. - An archive can be traversed in directory order. - Directories can be distinguished from files during a traversal. - Directory paths will always end with a separator. - File entries can be opened as an IArchiveFile. - IArchiveFile provides a simple non-seekable input stream which can only be read forwards. - Any number of files may be opened and read from an archive simultaneously. - An archive may be released while one or more files are still open, the files will remain valid until released. -- Changed archivepak, archivezip and archivewad to implement all IArchive requirements. -- Factored common code from archive implementations out into new lib/headers: - fs_filesystem.h: a templated filesystem container, with iterators and efficient traversal. - fs_path.h: a dynamic filesystem path object, with separator checking and efficient memory management. - ibytestream.h: abstract interfaces for input byte streams. - bytestream.h: utilities operating on abstract input byte streams. - filestream.h: a c++ wrapper for stdc FILE object, implementing a seekable input stream. -- Added a new pkzip-reader implementation, designed to be orthogonal to the compression library used. -- Added a zlib input stream object, which decompresses data from an abstract byte stream on the fly. -- Removed archivezip code copy/pasted/hacked from zlib and unzip.c, replaced by pkzip-reader and zlib input stream. -- Changed vfsLoadFile to return 0 for a zero-sized file, only returning -1 if it failed to load the file. -- Removed halflife-specific disabling of shader-loading, thereby allowing common-hydra.shader to work. -- Added archivezip, archivewad and archivepak to win32 setup scripts. -- Updated win32 setup scripts for halflife media. -- Updated cons scripts for archivezip, archivewad and archivepak. -- Added printing of warnings when vfs functions are given invalid input paths. - - --------- branchpoint: "bug800-spog_branch" - - -30/08/2003 -SPoG -- Ported changes from trunk since branch point. - -11/08/2003 -SPoG -- Split qe3.h up into multiple headers. -- Cleaned up use of win32 symbols: - WINAPI macro for module functions removed. - GUID for module interfaces replaced by string. - boolean replaced by bool. - MB_OK etc gui defines replaced by enumerations. -- Removed plugin stuff deprecated by synapse from qerplugin.h. -- Cleaned up use of glib symbols: - guint32, gdouble, gboolean typedefs removed from non-glib-dependent code. - TRUE/FALSE replaced by c++ bool true/false. -- Removed all "extern" function declarations. -- Removed dependency on MainFrame from preferences.h. -- Moved synapse server and pluginmanager instances to pluginmanager.cpp. -- Split pluginmanager.cpp into three parts: - Radiant's synapse client stuff in plugin.cpp. - Implementation of brush/entity/patch-handles stuff in pluginapi.cpp. - Synapse server init/shutdown in pluginmanager.cpp. -- Added forward-declarations to avoid including other headers. -- Replaced CString usage with Str; -- Removed unused brush-scripts stuff. -- Cleaned up patch-vertex-area-selection logic. -- Removed very old code chunks that were commented or #if 0. -- Replaced project-entity with a dedicated key/value string map. - ----- branch point - spog-cleanup - -06/12/2003 -SCDS_ReyalP -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=930 - shortcuts to change texture window scale - -02/12/2003 -SCDS_ReyalP -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=913 - fix for single monitor window positioning save -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=924 - fixes to CenterXYView shortcut, correctly bound to Shift+Control+Tab now -TTimo -- add a 'q3map2' command line to win32_install.py, factorize and remove win32_install_q3map2.py - --- linux 1.3.14 test build 1 - -29/11/2003 -TTimo -- heretic2 has no q2map. linux setup tries to install and breaks - removed faulty setup line -- cleaned more Linux setup fuckage caused by q2/her2 - a tip: rm -rf build install before building and testing a new setup - -28/11/2003 -ydnar -- full SCC purge of the vs.net project files (for real this time) -- added seperate Q3Map2 build targets -- added seperate Q3Map2 post-build Python script -- _skybox entity support -- _skybox and _decal in entities.def (Q3) - --- win32 1.3.14 test build 1 - -28/11/2003 -djbob -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=899 - bobtoolz update (icon functionality is in menu too) -djbob & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=842 - migration of the win32 build system to vs.net/VC7 - new libxml and libpng packages are required: - http://zerowing.idsoftware.com/libxml/ - http://zerowing.idsoftware.com/libpng/ - updated win32_install.py for new names and paths -TTimo -- assraped the vcproj with sed to remove Scc entries -SCDS_ReyalP -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=88 - 2D background image plugin -TTimo -- putting together win32 setup updates for 1.3.14 - msvcr70.dll goes in core directory - bkgrnd2d plugin content - changed file paths (libxml/libpng) - .xlink for new JA content - -27/11/2003 -TTimo -- using a central scons.signatures file for checksums -- version bump to 1.3.14 -- a libxml-related build bug in qe3.cpp on Debian sid -- it looks like Sid no longer has inflate_mask exported from /usr/lib/libz.so - switched the mask to be defined in our source - this may be a problem on other distros, and on holy box (Woody) -SCDS_ReyalP -- bug 921 and 922, Z floating window fixes -- bug 926, hullcaulk, hintskip, subtlehint -EvilTypeGuy -- bug 505 - select all faces with a given texture - -19/11/2003 -ydnar -- clipper tool plane points default to 1st selected patch mesh - -17/11/2003 -TTimo -- upgraded server to subversion 0.33 - --- released 1.3.13 - -10/11/2003 -SCDS_reyalP -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=917 - floating windows startup crash - -09/11/2003 -TTimo -- fix M4_GAME_ET ( OSX setup ) -AstroCreep -- cleaned up JA shader scripts - -01/11/2003 -ydnar -- Merged ASE submaterial/subobject code from BirdDawg -- Made Q2/Heretic2 tools not use precompiled headers to eliminate Win32 compilation errors -- Added glColor4ubv() support to the GL function table -- Changed PicoModel rendering to use glColor4ubv() instead of 4 divides and pass-by-value glColor4f() -- Fixed bug 900 by setting alpha to 255 explicitly in image module, rather than 3 input components, - which was borking Q3Map2 jpeg loading, and thus compiles - -24/10/2003 -TTimo -- bump to 1.3.13 -Anders -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=826 -new osx patch, fixes strip bug in setup. merging setup patches to a single file -SCDS_reyalP -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=900 -Some jpegs get garbaged alpha channel - -22/10/2003 --- merge https://zerowing.idsoftware.com:666/radiant/GtkRadiant/branches/Release-1.3.12/ - 19/10/2003 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=826 - scons BUILD=info to generate a tarball and it's .info - - 18/10/2003 - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=888 - patch for 16 bit RGBA support in glwidget - - -- released 1.3.12 Linux - - 14/10/2003 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=879 - fixed hellish dlclose issue only occuring with holy builds - - -- released 1.3.12 win32 --- end merge -Arnout -- added epsilon testing to hashtable compares to eliminate almost-identical vertices -- pico surfaces now use the normals from LWO vertices - -21/10/2003 -Arnout -- added hashtable for faster vertex matching during LWO surface generation -- model rendering now uses DrawElements and will use vertex colours in wireframe/flats shade mode - -20/10/2003 -Arnout -- added LWO support to picomodel. - shader names are derived from surface name - only geometry from layer 0 is used -- added support for 'vertical flipped' TGAs - -19/10/2003 -Arnout -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=893 - fixed starton primary monitor - fixed mouse pointer setting on win32 to properly translate gdk's offset coordinate system in windows' one - --- released 1.3.12 win32 - -11/10/2003 -Spog -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=865 - fix texture subsets -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=889 - misc update, missing JA system textures -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=824 - fixed .pref file trashing -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=881 - BSP monitoring disabled by default in Q2 - -09/10/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=883 - more JA pack: shaders and mapextras.pk3 textures -- fix Q2 win32_install.py to put the tools at the right spot -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=878 - correctly support PNG images with an alpha channel -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=885 - fix console to refresh during a texture directory load -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=739 - fix weird Shift + Control + Z causing a Redo in non-floating window mode - -07/10/2003 -Nurail & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=872 - Q2 tools, added -fs_basepath. Need corresponding setup and .proj updates -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=875 - fixed broken surface properties in Q2 surface plugin -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=872 - more fixes, build paths in scons, take out INSTALL config on command line (not functional + not need) - added Q2 tools back to Linux setup -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=197 - using "*" as the shaders minor in surface plugin -- updated makeself copy to the latest from icculus.org cvs -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=574 - sprite plugins, tweak to make it functional for all games -- updated Q2 tools .dsp -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=876 - more Jedi Academy setup work and content - moving imagepng.dll module to the core, as now both Sof2 and JA need it - sample maps reorg, new siege_hoth_sample.map -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=874 - a lot more models - using a dynamic File Group in IS to cope with that -- Q2 IS setup fix, was not properly putting stuff in baseq2/ - IS setup: tweak to Q2 tools stuff - -06/10/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=872 - Q2 setup needs to be cleaned up and unified between win32 and Linux - using INSTALL_Q2 and TOOLS_Q2 in SCons script to install the Q2 tools - fixed the setup build dependencies to reference the Q2 tools targets - moved the Q2 specific modules imagewad and vfspak to q2/modules - -05/10/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=871 - updating the gtk2 version to 2.2.4 - adding an SVN module with the Gtk2 developer package: checkout gtk2-win32 - updating IS to the new files - sed'ing the .dsp to replace src-gtk2 by gtk2-win32 -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=609 - Q2 tools: comment out dupe strupr on win32 - update IS setup to missing Q2 stuff ( vfspak and tools ) -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=866 - Fixed Camera inspector window not refreshing. Was a missing top level gtk_widget_show call - -03/10/2003 -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=609 - quake2 tools build scripts - Linux setup updates - Q2 game pack in Linux setup -TTimo -- scan through all URL links in game.xlink to update them -- added JA links (Raven and MapCenter forums) - -30/09/2003 -TTimo -- update all synapse.config, win32 .dsw and install_win32.py for new surface module -- Jedi Academy and Quake II game packs in IS setups -- hardcoded hacks in editor core for JA, copied over from JKII -- bug #867, disable sleep by default -- q3map2 bug fix - -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=862 - Q2's 'no patch' stuff - -29/09/2003 -TTimo -- OSX: fixup setup.xml.in - --- merge bug856 back into trunk -16/09/2003 -Nurail -- new patch + win32 stuff for surface module -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=804 - refactored the XML synapse.config handling: - better detection of invalid XML file - less code, factorized to CSynapseClient::ConfigXML -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=828 - fixing bobtoolz 'shaders' major loading issues - added '*' minor. to be used with lots of caution. only if the given major will have a single API such as 'shaders' - also, map module was missing a VFS entry in non-HL configs. that's bad karma, using a minor "*" instead - NOTE: on a lot of modules we could be using a '*' entry instead of having lines in synapse.config -- took out obsolete md3model - -15/09/2003 -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=856 - quake2 surface module - -07/09/2003 -Nurail & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=856 - a surface inspector module to customize per-game API - removing DO_SURFACEPLUGIN define (enabled implicitely) - removing bSurfacePropertiesPlugin (true implicitely) - remove SI_SetActiveInRadiant, it's always on by default - why was USE_UNDOTABLE_DEFINE taken out? - put back in - removed DBG_PLUGIN define and related code, that stuff is from way back and no longer relevant - cleanup QERApp_FreeShaders in shader module from DO_SURFACEPLUGIN stuff - the WINAPI stuff in interfaces is not needed, that's an old remnant. Cleaned up --- end merge bug856 back into trunk - -19/09/2003 -Justin Blur -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=785 - fix ~/.radiant permission bug -Nurail & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=849 - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=851 - win32 updates for the new modules and install_win32.py - -16/09/2003 -Nurail & Hydra -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=848 - q2 map format minor - -08/09/2003 -Tr3B -- imagepng.so / PNG format support in Linux - NOTE: atm no official supported Linux game by GtkR uses this - -07/09/2003 -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=851 - imagewal.so module / wal image format -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=840 - md2 support in picomodel - -06/09/2003 -Nurail & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=848 - renaming mapq3.so to map.so - added hooks for Q2 map format load/save to single map module (minor mapq2) -Nurail -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=849 - vfspak port to synapse and updates - -04/09/2003 -SPoG -- Fixed crash in RunBsp caused by passing an invalid pointer to printf. -- Changed console to wrap long lines instead of using horizontal scrollbar. - -30/08/2003 -Anders & TTimo -- OSX setup, new patch to make scons SETUP=1 produce a .run -- don't put bspc Linux binary in the setup - -30/08/2003 -Anders & TTimo -- OSX setup, new patch to make scons SETUP=1 produce a .run -- don't put bspc Linux binary in the setup - -26/08/2003 -Anders -- more scons OSX, start on setup stuff - -25/08/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=855 - make 'move into worldspawn' work again -Anders Gudmundson & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=826 - OSX scons build system - -24/08/2003 -ydnar -- Removed "test.cpp" from radiant.dsp (merge artifact?) -- Added ddslib to radiant.dsw -- Correctly set lib deps for q3map2.dsp for ddslib -- [bug 852] Increased buffers from 260 bytes on Win32 to 4096 bytes - -TTimo -- bump to ver 1.3.12 -- EnsurePythonVersion broke in 0.91 (commented out) - -David Hogue -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=844 - q3data Linux. q3data can read .ase and turn them into .md3 - -23/08/2003 -ydnar -- Added ddslib to repository, based on nvidia sample code, cleaned up a bit - straight C, loads DXT1, DXT3 and DXT5 format DDS textures. - -22/08/2003 -TTimo -- https://zerowing.idsoftware.com:666/viewsvn/ -- Arnout's commit email script - try #2 - the commit script doesn't handle viewsvn root remaps (radiant instead of radiant.svn) - adding a prefix to the report - -04/08/2003 -TTimo -- conversion from CVS to Subversion: -repository convert completed (with revml) -module repositories glued together in a single one -hooking email commit scripts and backup scripts -- Python >= 2.1 required instead of 2.2 - -01/08/2003 -SPoG -- Changed gl widget to request maximum available depth buffer precision. -- Changed all uses of deprecated GtkCList and GtkCTree to use GtkTreeView/Model. -- Fixed directory handle leakage in synapse module search. -- Fixed dir_dialog always returning NULL for Textures -> Load Directory. - -23/07/2003 -SPoG -- Ported focus_out_event handlers in gensurf to gtk2 signals system. -- Fixed failure to load models for entities other than misc_model. -- Fixed crash in model module shutdown caused by mismatched resource capture/release. - -22/07/2003 -TTimo -- fix q3map2 .dsp for correct glib-2.0 includes (common/vfs.c) -- camera plugin installs to core now (RTCW and ET) -- fixups to the merged setup stuff -- patched cvsreport to provide explicit diff for some files #2 -- fix to work with scons 0.90 / added LIBPREFIX ('lib') where needed - https://sourceforge.net/tracker/?func=detail&atid=398971&aid=766975&group_id=30337 -SPoG -- Fixed crash in cmdlib ExtractFileBase when source filename is an empty string. - -20/07/2003 -TTimo -- SCons scripts for the ported plugins: bobtoolz, camera, prtview, gensurf -- ET Linux setup script + new plugins -- q3map2.x86 is installed and wrapped through a q3map2 script (libstdc++ LD_LIBRARY_PATH) -- update ChangeLog and credits -- put back the GTKRAD_DIR in .fgl - -19/07/2003 -SPoG -- Tagged trunk before merge as bug537-merge-3. -- Tagged branch port_gtk2_20030307 as gtk2-merge-final. -- Merged changes since tag bug537-merge-2 into trunk. -- Removed gtk dependency from plugin toolbar interface. -- Ported prtview, bobtoolz and gensurf to gtk2. - -18/07/2003 -Anders Gud -- OSX build fix - -16/07/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=814 - merging ET support code into to trunk -- cvsreport 0.3.0 - http://www.nongnu.org/cvsreport/ - rolling out this ver since old cvsreport setup broke -- fixup to build on Linux (including fixing plugin builds) - --- release-1_3_8-ET - -02/07/2003 -TTimo -- new setup build, with patches and updates from SD -- local fixing of bobtoolz dependency against libcmd, and itoolbar.h gtk header bustage - -19/06/2003 -TTimo -- missing plugins. add them to .dsw for default build, add them to IS setup: - camera, gensurf, bobtoolz, prtview -- fixup bobtoolz code for VC6. for(int i=0 causing duplicate definition errors -- removed pk3man from IS (we no longer distribute/maintain it) - TODO: cvs remove the IS files for it -- re-enabled plugins in build by default, disabled curry and textool - TODO: following error when bring up About box of bobtoolz: - BobToolz::ERROR->Failed To Load Exclusion List: C:\Program Files\GtkRadiant-ET-1.3\plugins\bobtoolz.dllbt\bt-el2.txt - -18/06/2003 -TTimo -- add ET game pack. from Arnout's full dump of editor source + game pack data - trunk tagged at ET-tag for this -- Dlg_SdAskCorePath: - szDir = "C:\\Program Files\\GtkRadiant-ET-1.<>"; - -09/06/2003 -ydnar -- Added Q3Map2 keys/entities to Quake 3 entities.def -- Removed obsolete vlight keys from Quake 3 entities.def -- Added MD5 functionality to mathlib, from: - http://sourceforge.net/projects/libmd5-rfc/ - -------- merged changes since tag bug537-merge-2 from branch port_gtk2_20030307 to trunk - -TTimo -- try checkin on branch see if cvsreport 0.3.0 will verbose it - -08/07/2003 -SPoG -- Fixed recent-files list for file names containing underscores. - -07/07/2003 -SPoG -- Fixed crash and file-type bugs in gtk file-dialog. -TTimo -- converted the setup code from perl to python -- added copy over of libgcc_s and libstdc++, and LD_LIBRARY_PATH in the wrapper script - -06/07/2003 -SPoG -- Changed console popup menu to include cut/copy/paste as well as clear. - -05/07/2003 -SPoG -- Fixed the way surface-inspector dialog responds to escape key. - -04/07/2003 -TTimo -- linux building / SCons - 0.90 is broken, use 0.14 for now. added version check - adding scons SETUP=1 option to spawn setup build - enable back vfswad in scons - TODO: grab Conscript-setup, convert it to python in build_setup function - -02/07/2003 -TTimo -- building a win32 setup, using -gtk2 suffix (game packs in Radiant-1.3-gtk2 and core in GtkRadiant-1.3-gtk2) -SPoG -- Ported vfswad to gtk2. -- Fixed memory leak in vfspk3 directory search. -- Added vfswad to win32_install.py. - -09/06/2003 -TTimo -- tagging setup/ as gtk2_setup_rollback - rolling back trunk setup code to the branch to build an experimental release -- merge trunk to branch: --- tagged HEAD with bug537-merge-2 --- merge HEAD between bug537 and bug537-merge-2 into the branch -- - 31/05/2003 - TTimo - - grab back vfswad code that I forgot in bug 800 rollback - - add prtview back to the project, fix it to build (#817) - - 27/05/2003 - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=817 - prtview fixes, upgrade to synapse - - -- release-1_3_8 --- end merge HEAD between bug537 and bug537-merge-2 into the branch -- -- freshly merged in vfswad is broken -- freshly merged in prtview is broken -- q3radiant.dsp -> GtkRadiant.dsp, outputs GtkRadiant.exe -- removed vc5 dsps -SPoG -- Updated win32 setup stuff to use gtk2 dlls. -- Modified setup.pl to run correctly (tested on cygwin perl 5.6). - -08/06/2003 -TTimo -- Linux: - check gcc 3.x, better ldd check - add gcc version to about message - kill old cons stuff -- added q3map2.x86 scons build -- header conflict libs/cmdlib.h tools/quake3/common/cmdlib.h - grepped through q3map2 source to change #include "cmdlib.h" to common/cmdlib.h -- killed more cons files remnants -SPoG -- Improved error reporting for win32 setup system. -- Fixed errors reported when running setup scripts. -- Fixed scale of xor selection rectangle in XY window. - -07/06/2003 -SPoG -- Fixed X Window System error when entering freelook on *nix. - -06/06/2003 -SPoG -- Fixed copy/paste on *nix. -- Changed copy/paste on *nix to use GtkClipboard api. -- Changed copy/paste on win32 to be non-window-specific. -- Further cleaned up MainFrame::Create. -- Changed freelook to use gdk_window_get_origin instead of gdk_window_get_root_origin to place the cursor. - -05/06/2003 -SPoG -- Fixed grey statusbar in 4-way-split mode. -- Redirected gtk messages before creating main window. -- Removed unused XYFriend hack from camwindow. - -04/06/2003 -TTimo -- win32_install.py settings loaded/saved from site.conf - -02/06/2003 -TTimo -- fixed python running with no output. Make sure VC6 finds native Python before any cygwin Python - look at the Directories settings in Tools > Options to either kill the c:\cygwin\bin path, or have Python path first -- renamed dupe files to avoid header collision and general confusion between entity and model -- added win32_install.py to perform post-build install (need to load the configuration paths from a non-cvs stored site.conf file) - -01/06/2003 -TTimo -- bind gen.dsp to makeversion.py -- added a run_python.bat to check for python presence and execute - -27/05/2003 -TTimo -- write makeversion.py module - hook it up to SCons build - cleaner, easier to use -- comment out vfswad build lines. source is still not in tree (bug 800 aftermath I think) - -18/05/2003 -SPoG -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=537 - Changed Sys_FPrintf_VA to immediately process console events during map load. - Changed startup to create main window after QE_Init(). - Fixed loading last map on startup. - Fixed crash on exit. - Fixed colour dialog. -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=537 - have to delay merging back to trunk. - have a behaviour problem between debug and release builds. - while debug is fine, release is screwed (see bug item) - --- tagged HEAD with bug537 --- merge HEAD between merge-gtk2-20030413 and bug537 into the branch ----- - 11/05/2003 - Dan Olofson & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=812 - workaround for ATI drivers bug (polygon backfaces) - use Preferences > 2D Display/rendering > ATI cards with broken drivers - Riant - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=806 - updated synapse.config for SoF2 png - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=805 - dir_dialog is broken - is only used in prefab path prompt - - -- release-1_3_7 - - 14/04/2003 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=801 - moved "ignoring sprite for entity.." to be a _DEBUG only thing - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=802 - fixed models not drawing on win32. was a setup bug - - OSX setup build updates - added dependency against libpng3-shlibs - - added openurl.sh to open urls on *nix (with setup updates) - Riant - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=803 - RTCW - default_project.proj in setup - - 13/04/2003 - Michael Schlueter & EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=684 - imagepng building under Linux - Riant & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=797 - fixed texture compression support - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=799 - regen project file from template on version upgrade - updated all default_project.proj to have "version" "1" - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=798 - missing modules/bitmaps/model_reload_entity.bmp from Linux setup --- end merge HEAD between merge-gtk2-20030413 and bug537 into the branch ----- - -17/05/2003 -TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=537 - http://www.qeradiant.com/wikifaq/index.php?Gtk2%20build%20notes - went through the new dll dependencies, listed required files preparing for a single zip package - updated all the project files to rely on src-gtk2/ - -13/04/2003 -SPoG -- Tagged HEAD with 'merge-gtk2-20030413' and merged HEAD --> port_gtk2_20030307. - -12/04/2003 -SPoG -- Added gtk-2.x libraries to win32 setup. -- Changed win32 setup to use 'dynamic' file-groups, making it possible to add files without - modifying installshield scripts. -- Modified win32/setup.pl to copy setup data to dynamic file-group directories. - -30/03/2003 -TTimo -- added scons scripts. the scons engine is included in the tree. you just need to have python - have ldd -r safe check on .so - TODO: - - make sure it's gcc3 - - check OSX - - add q3map2 build - -29/03/2003 -TTimo -- tracked and fixed the startup bomb on Debian sid: - `pkg-config gtk+-2.0 --libs` - -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 - http://www.gnu.org/manual/ld-2.9.1/html_chapter/ld_2.html#SEC3 - --export-dynamic - When creating a dynamically linked executable, add all symbols to the dynamic symbol table. - The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. - If you do not use this option, the dynamic symbol table will normally contain only those symbols - which are referenced by some dynamic object mentioned in the link. If you use dlopen to load - a dynamic object which needs to refer back to the symbols defined by the program, rather than - some other dynamic object, then you will probably need to use this option when linking the program - itself. - this causes symbol confusion, shaders.so's g_ShaderTable suddenly resolves to the core's g_ShaderTable - one is a 'shaders' API, the other an 'appshaders' .. everything gets badly mixed up - added a check in the cons script, using `pkg-config gtk+-2.0 --libs-only-L` `pkg-config gtk+-2.0 --libs-only-l` - (same for gtkglext) - -28/03/2003 -TTimo -- propagate jpeg compile fix from bug750 branch -- use PKG_CONFIG_PATH when building radiant/ (alternate gtkglext-1.0) -- on OSX, you need gtk+2-dev package, and pkgconfig, atk1 - build gtkglext from source http://gtkglext.sourceforge.net - -17/03/2003 -TTimo -- updated the build system to glib2/gtk2/gtkglext - atm it compiles and starts on my dev box (Debian Sid) - but doesn't reach end of initialization, hangs on - q = (qtexture_t*)g_hash_table_lookup (g_ShadersTable.m_pfnQTexmap (), stdName); - in shaders.cpp QERApp_Try_Texture_ForName - need to have the gtk2 dev packages, and libgtkglext1-dev - -12/03/2003 -SPoG -- Replaced alpha-blended area-selection rect with XOR rect. -- Fixed YX/XZ/YZ toggle in floating windows layout. -- Cleaned up xor rectangle code. - -11/03/2003 -SPoG -- Fixed console scroll-to-last-text-inserted. -- Fixed console error/warning colours. -- Refactored or removed WIN32-specific gtk-related stuff. -- Removed win32 SetCapture/ReleaseCapture on GLWindow. -- Removed win32 gtk_main_iteration calls in glwindow mousemoved. -- Cleaned up start-on-primary-monitor stuff. -- Changed main window to use standard save/load window position/size. -- Replaced deprecated gtk_widget_set_uposition with gtk_window_move. -- Removed win32/X gl functions from igl. -- TODO: replace/remove deprecated gtk_widget_usize. - -10/03/2003 -SPoG -- Changed fonts in win32 rc file to 8pt tahoma. -- Fixed flat-grey gui in Regular layout mode. -- Changed main-window save/restore maximized to use gtk API. -- Fixed button_press_event handling on console/entity/entitylist windows. - -09/03/2003 -SPoG -- Fixed crash on shutdown after changing floating-z-window preference. -- Removed win32_realize_floating hack. -- Refactored MainFrame::Create to make it more readable. -- Fixed key_press_event handlers for entity/surface/patch dialogs. -- Fixed delete_event handlers for dialogs derived from Dialog class. - -08/03/2003 -SPoG -- Fixed viewport for entity window comment text. -- Fixed x-shrinking for entity window comment text. -- Fixed menu underscore shortcut hack in MRU list. -- Changed groupdialog to connect switch_page signal after creating all pages. -- Changed gl widget to use gtkglext/pango to create fonts. -- Cleaned up gtkglext glwidget implementation. -- Reduced border size on toolbar widgets. -- Replaced font with font_name in win32 rc file. -- Added viewports for all scrolled text boxes. -- Fixed entities/textures/console window title update when page is changed. -- Fixed floating windows not being transient to main window (don't want them on taskbar). - -07/03/2003 -SPoG -- Created a new branch for the port to gtk 2.x. -- Fixed menu underscore shortcuts to use gtk_label_new_with_mnemonic. -- Fixed global keyboard shortcuts by using mainframe_keypress. -- Fixed use of deprecated gtk_color_selection_get_color. -- Removed use of deprecated gtk_paned_set_gutter_size. -- Replaced deprecated gtk_widget_draw with gtk_widget_queue_draw. -- Replaced deprecated gtk_object_get/set_data with g_object_get/set_data. -- Replaced deprecated gdk functions with 2.x equivalents. - - ------ branch port_gtk2_20030307 ------ - - -13/04/2003 -Michael Schlueter & EvilTypeGuy -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=684 - imagepng building under Linux -Riant & TTimo -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=797 - broken texture compression support - - - -31/01/2003 -SPoG -- bug #752 - Construct fix for ppc, patch applied. - -26/01/2003 -TTimo -- bug #750 - revamp of the setup stuff on Linux - (under way, see bug for progress - feel free to help!) -- reworked the cons scripts, setup is hooked in to cons now - also, added gcc version select on command line, using Cons_gcc.pm utility - -22/01/2003 -TTimo -- merged merge-1_2_10-post back to trunk - - -=============================================================== --- merging release-1_2_9 -> merge-post-1_2_10 into trunk - trunk before merge is tagged pre-merge-1_2_10 -=============================================================== - -22/01/2003 -TTimo -- finished up the TODO items, turned into bug items or dropped them. branch is ready to move back in to trunk - -18/01/2003 -TTimo -- fixed ID_SELECTION_MERGE - -17/01/2003 -TTimo -- fixups - FlushReloadSelectedToolbarButton -> CFlushReloadSelected - incorrect naming: RadiantToolbarModuleManager -> CRadiantToolbarModuleManager - ToolbarButton -> IToolbarButton, and C* implementations - http://www.qeradiant.com/wikifaq/admin.php?Code%20Conventions - -14/01/2003 -ydnar -- Minor Cons fix for OS X (bug 729) - -13/01/2003 -ydnar -- GtkRadiant now builds on OS X, Linux, and Win32 out of the same tree -- OSX build uses gtkfileselect-linux now, as the Darwin version was broken/old - fixme: change this to use OS X open dialog box or something? -- Minor fixes to a few files to fix gcc warnings -- Model module now builds on OS X and Linux, using Synapse properly -- PicoModel change to invert T coordinate on ASE models -- Q3Map2 change to export ASE models with T coordinate flipped -- Misc Q3Map2 changes - -09/01/2003 -ydnar -- Updated Construct with Darwin/OS X ld flags for 4MB stack size -- Misc Q3Map2 updates (2.3.35-dev) - -05/01/2003 -ydnar -- "angles" key now properly ordered, to work with current mathlib - (also changed in Q3Map2) - -31/12/2002 -ydnar -- PicoModel: Minor fix to MDC loader (naming/define) -- Q3Map2: 2.3.34-pre-1 updates -- MapXML dsp unix->dos newlines - -29/12/2002 -SPoG -- Merged q3map2-texturing prefs key. -- Merged vfs check for gamemode project key. - -27/12/2002 -TTimo -- fix GetTickCount stuff -- added q3map2 cons script -- fixed Linux build - -23/12/2002 -SPoG -- Added model cache API, moved model cache implementation from entity module to core. -- Added file-type registry API, replaced core file-type manager with registry. -- Changed model module to register supported file types with core registry. -- Removed or #ifdef'd non-functional code from model module. -- Added support for misc_gamemodel and model_static to entity module. -- Cleaned up entity module's on-epair-changed API. -- Moved light-entity-specific code to a seperate file in entity module. -- Cleaned up file dialog interface - specify file-type-lists with a string. - -22/12/2002 -SPoG -- Ported camera plugin to synapse, adding support for camera and ui APIs. - -20/12/2002 -SPoG -- Fixed default prefs setting for selected-brushes-camera, gridmajor-alt and gridminor-alt. -- Merged CEntityEclassModel::Draw in entity module. -- Ported imagepng module to synapse. -- Fixed warning for CamDragMultiSelect preference bool used as int. - -19/12/2002 -SPoG -- Fixed white-textures bug caused by texture compression preferences. -- Ported light-radius rendering to 1.3 entity module. - -18/12/2002 -SPoG -- Merged win32 project files, with the exception of camera plugin. -- Ported model module to synapse API. -- Redesigned toolbar API to remove gtk-dependency from toolbar plugins. -- Refactored window-position preference save/load. - -17/12/2002 -TTimo -- kick doxygen generation for branch merge-1_2_10-post - -15/12/2002 -TTimo -- having the linux version compile and start again. took out numerous elements while merging, built a list of TODO stuff - the main thing to do being to bring the win32 build back up too, then to go through TODO list and fix stuff - until the win32 version runs too, I check this in to a seperate branch merge-1_2_10-post -- There is quite a massive update in mainframe.cpp switch case for all events. - Looks like it's just a reordering of stuff, but it looks bad in the diffs. -- added m_MapReg pattern - -- At some point, I'm thinking that forcing correct TAB/SPACE conversion on the server end would be a good thing to have. - Nazisticly forcing the formatting sounds like the only viable solution. - - 11/12/2002 - RR2DO2 - - #418, mdc load and display (RTCW) - - #597, CenterCamera shortcut - Use Ctrl+Shift+TAB to center the views onto the current camera location - - #714, bitmap loading fixes and speedups - - #715, fixed Alt+Shift cycle/drill select to work with brush-based entities - EvilTypeGuy - - #718, fix compilation warnings - Riant - - #707, fixed HM mode in STV:EF - - 10/12/2002 - EvilTypeGuy - - Fix gcc3 compilation warning - EvilTypeGuy and X-Man - - Fix OpenURL so browser launching works on XDarwin (Mac) systems. - - 8/12/2002 - RR2DO2 - - #710, AssignSound pattern - - #711, SoF2 model_static drawing - - #713, sync 2d and 3d rendering of models - - #238, apply 0..1 T range when Fitting a patch (instead of 0..-1 previously) - - #633, Add ability to change default color in 3D window Misc > Colors > Camera background - ydnar - - Q3Map 2.3.33 (see changes.q3map2.txt) - - Quake 3 + TA common.shader updates (q3map_terrain, hint) - - 3/12/2002 - TTimo - - merging Stable-1_2-Apple into Stable-1_2 - - why INSTALL.TXT? re-used INSTALL, updated to point to wiki - - why the -machinedump test against i386-redhat-linux? removed - - using $is_darwin flag instead of $gcc_machine tests in the build scripts: - gotta leave some room for a Linux ppc build, and darwin x86 - exporting it for use in sub scripts - - the addition of ccache support broke some Apple SConstruct patches to $ENV{PATH}, fixing - merged version is compiling fine on Debian Sid - checking in on a branch, need to validate win32 build and OSX build before applying in Stable-1_2 - - -- release-1_2_11 - - 30/11/2002 - TTimo - - added seaw0lf to credits - - ydnar's changelog.q3map2, added to global.xlink and Linux setup - - 1.2.11 version tag - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=699 - updated IS setup for q3map_terrain keyword - also fixed details in STVEF media - Arnout - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=569 - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=698 - fixed drill select, Ctrl bug in vertex mode, and updated changelog.txt - - 29/11/2002 - TTimo - - 1.2.11-rc1 - - update changelog credits links for release - - update linux setup, putting EULA and new README instructions - - 28/11/2002 - ydnar - - Removed redundant 'p' from "developers" - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=637 - fixed - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=694 - fixed - - Updated to Q3Map 2.3.32 - - Added epsilon to texture plane choose code to eliminate numerical - inconsistencies on brush faces slanted at 45 degree angles (bug 637) - - Fixed bug in lightmap export after lighting when map contains 0 BSP lightmaps - - Adjusted some light tracing constants to fix certain brush/patch seam shadows - - Tinkered with skylight code again - - Fixed bug where lightgrid would be black if level was compiled with -nogrid - - Fixed -approx code to work in floating-point space, using _minlight - - Fixed bug where vertex light code was using invalid pvs data to create - light list for surface, leading to incorrect vertex lighting - - Fixed related bug in anti-light-leak code that was causing brush faces to go - black (bug 694) - - New: _minlight sets _minvertexlight and (new) _mingridlight automatically - - New: _mingridlight key to set minimum grid lighting - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=637 - added preference setting in Preferences > BSP monitoring - added an item on the wiki - - 27/11/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=662 - picomodel-based model.dll module (new model.dll, removed md3module.dll) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=664 - media/setup updates for q3map2 support - added modified quakev3.qe4, bumped internal version to 4 for all games - SOF2 and JKII were forcing BSP monitoring off because of sof2map, now only printing a warning - added -rename to SOF2 BSP phase - Q3 & RTCW new templates are working - haven't tested the STVEF & SOF2 versions - updated IS setup scripts to make sure quakev3.qe4 is updated in nightly release - (not needed on Linux, we will be doing a full release) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=662 - updated win32 setup to provide right model.dll stuff - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=621 - typo was causing memory error - - RR2DO2 & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=662 - more model fixes, fixed the Linux build to build model.so - added search path to modules/ for bitmaps - model reload, patch and bitmap - - 26/11/2002 - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=569 - area select - Alt+Shift for area select (complete tall) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=621 - broken undo creating ghost undo entities (and trashes memory) - partly fixes the issue, it's a memory error still - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=659 - updates to RTCW camera plugin - works in 4 view mode - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=663 - more fixes to plugin API - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=638 - libpng in the core DLLs instead of SoF2 (for q3map2 dependencies) - putting q3map2 binary with the Core Binaries - - 25/11/2002 - TTimo - - added ccache support to cons build system - http://ccache.samba.org/ - - 21/11/2002 - ydnar - - minor bugfix to PicoModel ASE material loader - - Q3Map2 updated to 2.3.31 (Splash Damage) - - Stitching the edges of lightmaps on patches that wrap around (cyls and cones) - so the seam is no longer visible - - The -patchmeta switch works better now, the patches are still stored in the - BSP for collision, but are pre-tesselated into nonplanar meta surfaces for - more efficient rendering - - Better, more uniform lightmap sample position finding on patch meshes - - Moved q3map_tcMod and q3map_alphaMod processing to the final phase - - New: q3map_skylight AMOUNT ITERATIONS to replace surfacelight on sky surfaces - for much faster and more uniform sky illumination - - Fixed bug in PicoModel ASE material parsing code - - Fixed a few seam/lightmap precision/projection errors - - Increased MAX_SHADER FILES to 1024 and fixed overrun error when more than that - number of shaders was listed in shaderlist.txt - - Increased a few compiler maximums for larger maps - - New: -np N switch on BSP phase, works like -shadeangle, in that it forces all - planar shaders to be nonplanar with the shading angle specified - - New: -nohint switch on BSP phase, omits hint brushes from compile for testing - - New: -debugaxis switch on light mode. Colors lightmaps based on their lightmap - axis (which direction the lightmap was projected on) - - New: -debugorigin switch on light mode. Colors lightmaps based on the luxel - origin relative to the raw lightmap's bounding box - - New: -debugcluster switch on light mode. Colors lightmaps based on the pvs - cluster the luxel falls into - - New: -convert switch to convert BSP to ASE file (experimental) - - New: q3map_lightmapmergable directive to allow terrain to be mapped onto a - single lightmap page for seamless terrain shadows - - 18/11/2002 - TTimo - - fixed pk3man build system to work with new cons layout - - fixing linux setup system to work with new cons layout - Linux 1.2.11 will be a full setup, much easier that way - - update makeself to the latest (and best) version - - add q3map2 to Linux setup. goes in core (g_strAppPath) - NOTE: has a dynamic dependency to libpng - - pk3man still has issues with the zlib code that's been thrown in it - unresolved which I don't have time to look at - since we plan to drop pk3man in 1.3, dropping it now is just as good - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=644 - detect GOTY install from registry and use it as default path - - 13/11/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=639 - reworked to have the UI in game settings dialog - (this is strictly win32 thing, if that broke Linux build, then fix the typos) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=630 - mouse AngleSpeed setting was getting clobbered. fixed and upped the max values - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=623 - applied a fix, rolls back the values when the compression formats are not supported - fix ain't very clean, if we have to deal with extensions some more, we need to deal with the settings persistance better - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=624 - updated the setup code for town_*.shader (both in full setup and update) - updated files in WolfPack - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=672 - using a QE4_VERSION define, added a message if there's a project template with wrong version - - 12/11/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=671 - guard junk.txt path between " " - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=663 - fix to CommitBrushHandleToEntity stuff - - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=660 - previously you could select patch control points when patch selected + vertex edit (V) in 2D view. Works in camera view now - - 12/11/2002 - TTimo - - nudging zerowing to trigger Stable-1_2-Apple doxygen generation - http://zerowing.idsoftware.com/doxygen/ - - 11/11/2002 - TTimo - - http://ttimo.net/web/anjuta - modified the .prj to work with the cons patches (linked dirs) - still way experimental - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=651 - fixing linking for radiant.x86 - - 10/11/2002 - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=669 - patch inspector bug - fixed - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=663 - fucked up change in the plugin API caused breakage of several plugins - still have to fix bobtoolz http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=665 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=661 - Undolevels not set properly - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=660 - drag selection to the camwindow for patches in controlpoint edit mode - (not sure about the actual shortcuts, Ctrl+Alt on my current Linux setup) - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=657 - mark map modified on editing entity keys - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=651 - added the correct link and ldflags statements to have static linking everywhere - didn't check gcc 3 build, check correct static on Debian Sid and holy box - has a $staticstdcxx in Construct to toggle On/Off if needed - - 09/11/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=651 - reworking the cons building. support for gcc2 and gcc3 - cons -- gcc= - read gcc version and configure accordingly - changed _NO_STLPORT to Q_NO_STLPORT - independant BASE_CFLAGS and BASE_CXXFLAGS - correcting usage of CC/CXX for c/cpp source and linking - fixed missing -lz in vfspk3.so - changed the way we build curry.so, works from the GtkRadiant tree now - (NOTE: gcc 3.2 build of curry.so spews quite a few warnings) - tweaked the way we do -fno-rtti -fno-exception - - 04/11/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=638 - .qe4 version 4, udpated q3's .qe4 template, update setup to put q3map2 in the right place - bumped version to 1.2.11-test for test setups - - 03/11/2002 - ydnar - - fixed bug in jpeg loading code (4 components instead of 3 for RGB images, mh) - - updated PicoModel to 0.8.8 and Q3Map2 sundry fixes (2.3.29): - - Merged with latest CVS, fixed minor issues with matrix order - - Fixed minor Sys_FPrintf/Sys_Printf substitution typo in Q3Map2 - - Expanded debug colors to 12 for debugging surface meshes - - PicoModel: fixed ASE loader to support > 1 texture coordinate per-vertex, - so more models supported correctly, also loading vertex normals - - PicoModel: md3 shader names are now cleaned. Suffixes (such as .tga or .jpg) - are stripped, and \ path separators are changed to / - - New: Add :q3map to the end of any shader name, and it will be interpreted as - the named shader minus :q3map. Example: - textures/shaderlab/concrete:q3map -> textures/shaderlab/concrete - One potential use is the -approx feature to collapse lightmapped surfaces - into vertexlit surfaces, saving lightmap space/memory - - New: q3map_clipModel -- does what you think it does, sort of. This code ix - really experimental, and should *only* be used on large models such as terrain - (not small decorative models). This code will be evolving. Note: the shader's - surfaceparms are inherited by the magic clip brush, so if you have nonsolid - in your model's shader that uses q3map_clipModel, then the brush will also - be nonsolid - - 03/11/2002 - TTimo - - cleaning up some cons stuff, checking that the setup building process is still good on Linux - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=622 - updated Linux setup to put the bitmap - - 02/11/2002 - ydnar - - PicoModel: replaced stricmp with _pico_stricmp - - 02/11/2002 - ydnar - - PicoModel: added obj.c and ms3d.c, removed wfobj.c - - 02/11/2002 - ydnar - seaw0lf - - Updated Q3Map2 to 2.3.29 sources - 2.3.29 - - Merged with latest CVS, fixed minor issues with matrix order - 2.3.28 - - Bug 654 (http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=654): - Fixed problem where brush faces, drawsurfaces, and surfaceparms weren't living - together in perfect harmony (terrain surfaceparms now inherited by brushes) - - Nodraw fog works now, albeit when you're underneath, surfaces above don't get - fogged properly. Could be good for foggy water where you want the above-water - portions to only be occluded by the water surface - - Bug 656 (http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=656): - Number of lightgrid points displayed (byte size is currently out of proportion - due to internal storage format) when Q3Map is called with the -info switch - - Fixed wack surface merging bug where code would attempt to merge triangles not - adjacent to the current set, causing bad lightmap projections on nonplanar - surfaces - - Fixed tiny 1-character bug in 2d lightmap texture allocator where adjacent - luxels were being checked for occlusion rather than the actual source luxel - 2.3.27 - - Fixed minor bug in scriplib bugfix where the last character in a file wasn't - being read. - - Fixed bug where 0-area or bogus triangles were causing crash in MapRawLightmap - if they used a shader with a normalmap (thanks ShadowSpawn) - - Fixed bug where lightmaps were getting hosed levelwide on a prerelease version - of 2.3.27 - - Fixed bug where lightmaps were getting knackered on models and certain patches - - Merged latest PicoModel version from seaw0lf, adding support for ASE and WF OBJ - models (preliminary) - - Increased MAX_MAP_PLANES to 0x40000 (~256k) - 2.3.26 - - Now using GtkRadiant's libpng and zlib config (linked as DLLs) - - Fixed bug in script parser where repeat calls to GetToken() were causing - memory corruption - - Fixed SOF2 -rename bug - - When using -game sof2 or -game jk2, the -flares argument is implied - - Added -noflares argument to disable the above behavior - - Added support for flares on entities. Use one of the following keys: - "_flare" "1" -- use default flare (different for each game) - "_flareshader" "path/to/flareshader" -- use a specific flare shader - Note: This only matters in SOF2/JK2 now. Make a light targetted (a spotlight) - to get it to aim the correct direction, otherwise it defaults to pointing - downward. You cannot have omnidirectional flares - - Lightgrid size is automatically increased to accomodate large maps. The - MAX_MAP_LIGHTGRID error will never happen again - - Update PicoModel to 0.8.7 sources - - ASE support - - Alias|Wavefront OBJ support - - .remap shader remapping suport - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=655 - handle grayscale jpegs gracefully - - mathlib: fixed VectorClear(), got rid of braces - - scriplib: fixed double-free memory corruption bug - - radiant: added new color scheme to emulate Lightwave/Maya/3DS Max - - 02/11/2002 - TTimo - - too many issues with build system reading system's libjpeg.h instead of libs/libjpeg.h - renamed libs/libjpeg.h to libs/radiant_libjpeg.h, updated sources - - 29/10/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=639 - running from a network share - saving prefs per-user - - 27/10/2002 - TTimo - - merged in some more m4x4 code for q3map2 - - fixed unresolved code in picomodel (strlwr / strnicmp) - - reworked the tools building to build both q3map and q3map2 without trouble - - 25/10/2002 - ydnar - - q3map2 and picomodel source, initial checkin to Stable-1_2 branch (does not compile yet, tweaking to be done) - - 23/10/2002 - TTimo - - camera.dll goes into $(RTCWRADIANTDIR)/plugins instead of $(RTCWRADIANTDIR)/modules - fixed up camera compile (exports) - added camera bitmap (plugin toolbar) - - 21/10/2002 - TTimo - - quickfix to the build (typo) - - changed dynamic linking on Linux to look for libGL.so.1 by default - fixes "all textures are blank" Linux bug with NVidia cards - (you still have to have a working NVidia GL installation though, xlibmesa-dev on Debian screws things up) - - checked in modified q3 .qe4 with q3map2 menu (see bug #638) - - 09/10/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=622 - reworked the plugin toolbar to rely on interface instead of straight exports - cleaned up the botclip monsterclip Brush_Draw filtering, added proper selection filtering (Brush_Ray) - merged bug-622 back into Stable-1_2, bug-622 branch is dead now - - 06/09/2002 - James Monroe - RR2DO2 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=619 - light globes, applying patch by RR2DO2 built from the initial light globe code - - note to self: indent -kr -nut -st -ts2 -i2 - - RR2DO2 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=622 - massive patch update from SD's GtkRadiant - - camera plugin: new bitmap - fixed Linux install path for camera plugin to wolf/plugins - - fixed various warnings in camera build gcc / Linux - - fixed pref crash if plugin toolbar disabled - - fixed Gtk-WARNING on bad cast in AddPlugInToolbarItem - - renamed the new select to 'Use paint-select in camera view:' in prefs - (camera paint-select, should be our default name for this) - - NEW: you can 'paint select' in the camera view: 'camera paint-select' - press shift and move the mouse over the camera view to paint over brushes you want to select - configurable in prefs to enable / use Shift key, or use 'classic mode' ctrl+alt - - NEW: light radius drawing - Added in-editor light envelope drawing. Outer circle is max envelope, - inner fullbright radius. Optional classic mode emulates the similar drawing - from Rituals and Ravens tools (not q3map correct, easier for the level designer - to understand/legacy). - - NOTE: 'angles' is q3map2 only - NOTE: could manipulate angles directly from the views (2d and 3d with some handles) - - NOTE TO SELF: - hey guys .. just a quick question if you don't mind .. I'm trying to track a Gtk-WARNING .. is there a way to make those apps cause a break to track them easily ? - just run your app with --g-fatal-warnings - - TODO: add new bitmap to win32 & linux setups - TODO: don't use exports for the plugin toolbar, use entry functions - do something like CPlugIn::InitBSPFrontendPlugin - TODO: botclip is broken with the new Brush_Ray code - - initial ChangeLog for the patch: - - 28-09-2002 - Arnout - + Added 'angles' support for models (misc_model/misc_gamemodel). - + Prevented pivot drawing of model from scaling and rotating. - + Cleaned up the dropdown boxes in the preferences a bit (all use - tables now, so not multiline). - + Added 'Classic Key Setup' option to camera paint select configuration, this - drag-selects with ctrl+alt instead of shift. - + Changed XYWnd::PositionView to position on the center of the - selection, not on the mins. - - 27-09-2002 - Arnout - + Added in-editor light envelope drawing. Outer circle is max envelope, - inner fullbright radius. Optional classic mode emulates the similar drawing - from Rituals and Ravens tools (not q3map correct, easier for the level designer - to understand/legacy). - - 26-09-2002 - Arnout - + Upped MAX_TEXTUREDIRS to 256 (from 128). - - 25-09-2002 - Arnout - + Fixed patches not being drawn in XY window with colour of parent - entity. - + Made paste to camera snap destination spot snap to grid. - - 18-09-2002 - Arnout - + Changed Select_Reselect to be much faster. - - 12-09-2002 - Arnout - + Fixed curve point drag-selection area not showing properly in XY - views. - + Fixed size info breaking over 9999.9 units. - + Fixed AllocateSelectedPatchHandles not setting patchesmode to - ESelectedPatches. - + Changed the horizontal and vertical tc shift spin control to have a - limit of 8192. - + Moved SPoG's implementation of redisperse cols to a seperate function - and reinstated the old code. - + Added 'Paste to Camera', shortcut Alt+V, which pastes the contents of - the clipboard to the current camera origin. - + Added centerview functionality to 4 window mode. Ctrl+tab will focus - on the selection, or if non existant, on the camera. - - 11-09-2002 - Arnout - + Made sure settings set in savedinfo.bin get initialized to their - proper defaults. - + Added botclip filter (filters *botclip* and *monsterclip*). - - 10-09-2002 - Arnout - + Removed .reg from normal map saving, can only save as region - using 'Save region'. - + Added outline style cycling (j) cycle between z buffered outlines and - selected colour rendering. - + Added colour dialog to pick the colour of selected surfaces in the - camwindow. - + Third coordinate for clip points now gets set to the center of the - selection. - + Changed arbitrary rotation dialog to accept negative angles as well. - + Changed texture alignment dialog to accept values up to 2 decimal - points. - + Fixed entity inspector to say 'Textures:' in the window title. - NOTE: still broke in floating window mode - + Changed entity inspector so that tab doesn't clear the epair value - field anymore, so it retains the value while jumping to it. - + Disabling camera paint-select now returns selection behaviour for groups to - the old behaviour as well (shift+click selects whole group). - + Changed load_plugin_bitmap to load bitmaps from g_strAppPath if - g_strGameToolsPath fails. - + Added plugin toolbar and api. - + Fixed m_pfnCommitBrushHandleToEntity, wasn't creating brushes - properly (well, not at all really). - - Older changes: - Arnout - + Added misc_gamemodel drawing. - + Ported camera paint-select over from 1.3. - + Fixed statusbar display of text (removed a bunch of \n's). - + Added area selection in 3d view for patches. - - 30/09/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=556 - quickfix crash bug - - 27/09/2002 - TTimo - - more CORERADIANTDIR cleanup (q3data) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=602 - added cascading to the entity submenu (doesn't cascade the main menu, only the sub ones, NPC_* for instance) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=556 - with clip and caulk filtered out, won't be selected anymore in camera view (i.e. selecting invisible faces) - added SF_CAMERA to the flags in the selection process - cleanup up various ugly syntaxes in the selection code: - don't ever do if (flags == SF_SINGLEFACE) on a bitmask and assert that the other flags will always be NULL - don't do arithmetic on bitmasks: - if ( (flags & SF_ENTITIES_FIRST) && t.brush == NULL) - return Test_Ray (origin, dir, flags - SF_ENTITIES_FIRST); - is WRONG - using flags & ~SF_ENTITIES_FIRST is the appropriate way - - 23/09/2002 - Riant - - new IS scripts to go with recent media updates - Riant & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=615 - reworked the fix to use "caulk_shader" in .game - updated IS .rul script to generate special values for Sof2 and JKII - - 21/09/2002 - Riant - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=595 - more texture compression, dialog and settings - Michael Schlueter - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=592 - fixes to the Linux build system, exclusive q3 or wolf working now - - 22/08/2002 - EvilTypeGuy - - Fix @*$&)@)$$ memory leak of my own doing, yes it's really been in there this long. - This should help memory usage drastically, especially when flushing & reloading - the same sets of textures, GtkRadiant's memory usage no longer becomes heinous. - - 14/08/2002 - EvilTypeGuy - - Fix build on some linux boxen by including qertypes.h for proper boolean type declaration - - -- release-1_2_10 - - 16/08/2002 - TTimo - - STVEF media update finalized (some .def) - - 1_2 Core Update for shader manual update - - in JKII, typo with nar_shader? replaced by nar_shaddar, with proper support in update too - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=530 - Q3/TA media update with cleaned up shaders - - validated the update content by a diff between 1.2.9 + 1.2.10-update and 1.2.10 full - - added a DO_NIGHTLY_BOOL to setup.rul AND a warning during setup about update content for games that are not installed - - built 1.2.10-sof2, SoF2 full install - - 15/08/2002 - Michael Schlueter - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=590 - added the option to build a Linux setup with the debug binaries - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=530 - cleaned up shaders, done nightly setup update on Linux - updated Linux nightly for 1.2 to use /usr/local/games/GtkRadiant-1.2 as default base - - using version 1.2.10-update. Full Sof2 setup will be 1.2.10-sof2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=426 - don't straffe when using Ctrl+Shift(+Alt) - - camera.so RTCW plugin in Linux setup - - quickfix to non-initialized var in camera code - - awfull piece of work that had been completely left out, nightly elements for JK2 and STVEF - added JKII media update and STVEF media update (for the DIR_GAME elements) - JKII nightly is finalized - - 14/08/2002 - TTimo - - fixed a missing file - - Linux build quickfix - - fixed silly rendering bug - - added pref to force texture compression off (hey why would you do that??) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=466 - fixed MAX_POINTS_ON_WINDING overflow in q3map (and relevant code to handle in radiant) - - 13/08/2002 - TTimo - - cleared up notexture (dead code) - - cleaned up QERApp_LoadTextureRGBA gamma table init - - having a shot at 1.3 texture compression - sees the extension, binds the texture with the currect setting - but rendering is fucked .. someone explain? - - 08/7/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=586 - search and destroy Q3Radiant -> Radiant - - 07/7/2002 - SCDS_reyalP - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=526 - wolf_entities.def update - - riant - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=548 - STV:EF updates - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=541 - SOF2 updates - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=584 - JKII updates - - 06/7/2002 - Riant - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=541 - Sof2 patches and IS setup - TTimo - - game pack prompt asking about STVEF, fixed - - mp_examples was leaked and non lighted, fixed - - imagepng.dll goes into Sof2 install / modules, and not in DIR_CORE - - libpng12.dll needs installed only with Sof2 pack (added 'SOF2 Pogram DLL') - default texture scale is 0.125 - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=582 - nomipmap -> nomipmaps in shader manual - - removed libs/pak, this was still being linked in to Radiant, but not used at all - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=580 - .PK3 are recognized along .pk3 files (strcmp ->strcasecmp) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=386 - added the RTCW camera plugin to IS setup - - Michael Schlueter - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=581 - GL warning fix - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=567 - GL font display fixes (mostly Linux) - applied the changes with some tweaking - - 31/6/2002 - TTimo - - compiling the camera plugin on Linux: - move the GUID and other misc compatibility definitions to include/misc_def.h - GetTickCount being used in camera.so, this is from radiant/missing.cpp (unresolved) - -> use QGetTickCount instead (in main function table) - - 30/6/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=530 - cleaned the .shader from 'light 1' statements - updated the IS script for the updated .shader - - 17/6/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=541 - Sof2 support, PNG format - wrote imagepng module, dynamic dependencies to zlib and libpng - changes in the core: - some hardcoded to "sof2.game" for png interface loading and extensions - in GetTextureExtension, killed outdated support for texture plugins - if ! "sof2.game", png is not loaded, support disabled - http://zerowing.idsoftware.com/libpng/ - correctly configured for VC build (post build steps and dependencies) - is required on win32 to build imagepng - - added m_pfnGetGameFileName to the main function table (was needed for png stuff) - - cleaned up the QERApp_LoadTextureRGBA path - using (unsigned char* pPixels, int nWidth, int nHeight) - cleaning up internal access path - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=386 - camera plugin for RTCW - TTimo: wrote the .dsp, post build steps etc. - IMPORTANT: you need to have RTCWRADIANTDIR env variable pointing to the RTCW Radiant files - (default C:\Program Files\Return To Castle Wolfenstein\Radiant) - - - 12/6/2002 - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=299 - MP/SP pk3 filtering in VFS - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=386 - .camera support: splines library, camera plugin - TTimo: portability fixups, cons build, guarding pragma, __cdecl BOOL - virtual functions but non-virtual destructor - declaration with no type - int idCameraFOV::start - control reaches end of non-void, making it void - enumeration not handled in switch - no _MAX_PATH, the portable one is PATH_MAX - implicit declaration of int _fullpath - for(int i = 0; .. - struct _IO_FILE has no member named '_bufsiz' - stricmp -> Q_stricmp - attempt at implementation in .h file (InitIglToQgl) - camera stuff still vastly broken (particularly on Linux), need to check in because of new fixes incoming - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=17 - quick fix to spawnflags getting corrupted when multiple entities selected - (doesn't completely solve the problems we have with spawnflags yet though) - -=============================================================== -END -- merging release-1_2_9 -> merge-post-1_2_10 into trunk - END -=============================================================== - -12/12/2002 - Hydra - - #197, HL support update - -11/12/2002 - TTimo - - added cmdlib dependency to mapq3.so (fixes unresolved) - -25/10/2002 - Hydra - - vfsGetFullPath() can now (optionally) search PK3/WAD files - - Half-life map loading is now un-borked (my original patch worked - but some conditional code in the patch was incorrectly applied. - That, coupled with the missing vfsFileExists and vfsFindFile replacements) - - A patch to imagehl/lbmlib.cpp/LoadIDSP() was missed out, causing all sprite - models to be reverse-rendered (due to an inverted alphamask) - - Renamed HydraToolz to HydraToolz-HL as it's half-life specific - changed project files and renamed all appropriate files and directories - (for the merge, just delete contrib/hydratoolz and apply the diff) - - - Comments on previous notes: - - - TODO: need to rationalize where the modules are placed and identify HL specific modules - (this affects the build system / post build step too) - imagehl and spritemodel are halflife specific and can be placed in - either $coreradiantdir/modules or $hlradiantdir/modules - I've updated the .dsp files so that they are copied to $coreradiantdir/modules - spritemodel can actually be used for other engines, not just HL so it makes sense - to keep it in $coreradiantdir/modules - hydratoolz is a half-life specific plugin and must go in $hlradiantdir/modules as it - is NOT to be used for any other engines. I've also updated the "about text" to - reflect this. - -14/08/2002 - EvilTypeGuy - - fix build process for textool plugin on some Linux boxen by including qertypes.h - -11/06/2002 - TTimo - - spritemodels in build system - - applying HL setup patch (att 270, bug 197) - - the templating went one filename seperator too far, causing all *.fgl to be modified .. - fixed so that we only have the relevant changes - - modules added to main Executable Files, TODO for later will need to identify what is HL specific - - .game generation: don't want enginename yet, gamename is ok - - updated HL .game generation for eclass_singleload and no_patch - - update hydratoolz location in setup - - update maphl in synapse.config - -07/06/2002 - TTimo - - realized that \func doesn't work in doxygen, should be \fn (updated everywhere) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=197 - applying the HL patch (see original list of changes below) - - ugly eclass API changes - eclassfgd/plugin.cpp.rej, eclass API changes involved, a bunch of .rej - SupportsMultiple tries to send configuration information from the eclass format file module to the eclass manager - dropping it, using a proper configuration node instead (eclass_singleload) - - added "no_patch" prop to disable patch support - the patch toolbar prompts are only present in prefs if there is patch support - otherwise everything is force-disabled - - PFN_VFSFINDFILE PFN_VFSFILEEXISTS: - one of the problems we have is that the 'manager' code and file format code are in the same module - (i.e. vfspk3 / vfswad: two formats, but the manager part is pretty much the same) - vfsFindFile(relative filename): - this worked by searching through the list of loaded pk3/wad files for the file - then trying to search through the search directories - - wasn't properly documented about what it does / how is the search performed - - not consistent with existing code, duplicate of vfsGetFullPath for the most part - can't be added to the VFS API as-is, it would confuse the interface - - usage of vfsFindFile in the code doesn't justify the way it proceeds for search - foxing it, replacing by calls to vfsGetFullPath - vfsFileExists(relative filename): - returns wether a file exist, can be flagged to search in pk3/wad or straight filesystem - - this is a duplicate / particular case of vfsGetFileCount - foxing it too, we need to extend and update vfsGetFileCount instead - - mapq3: the changes completely fucked q3 map parsing - need reorganization. same module provides parsing for all .map based formats - we use wrappers around the actual calls and globals in the module to select formats - MAPVERSION_Q2 and MAPVERSION_Q1 don't need to be there yet, they are not supported - MAPVERSION_HL means WC >= 2.2 - (when introduced, MAPVERSION_Q2 would be Q2 or qer+hl plugin (same)) - MAPVERSION_HL uses "maphl" minor name (instead of mapq2) - cleaned up the Q3 read/write code that got broken - cleaned up various commenting/hack that deal with Q2!=HL format .. we'll see about Q2 when we actually do it - bad cut and paste from cmdlib code, using actual dependency to cmdlib instead (see below for some cmdlib updates) - - took out all SafeRead SafeWrite code from cmdlib, removed annoying cmdlib dependency to Error function - all file access go through VFS module, the cmdlib 07/06/2002 15:47file code was way old - - radiant/points.cpp pointfile code changes (that's used only for non-monitored compiling now) - - applied patch 267 (hydratoolz fixes) - - commented out some bworldcraft flagged stuff in mapq3/parse.cpp - - updated the .dsw .dsp to compile and copy HL stuff - - TODO: need to rationalize where the modules are placed and identify HL specific modules - - TODO: seems to be a synapse crash when unloading plugins (hydratools) - (looks like I didn't look at the plugin unload code yet actually) - - TODO: make sure HL setup puts eclass_singleload="1" and no_patch="1" - - TODO: WATCHBSP_KEY and TEXTURE_KEY hardcoded for HL need cleanup - - TODO: imagehl duplicates some image functionality - imagehl is supposed to be only for HL-specific image formats - it 'adds' the required formats to the stuff that image makes available for everyone already - - TODO: HL doesn't have a BSP menu! - - TODO: rename mapq3/ into map/, the map module handles all .map formats - - TODO: it's likely that we only need a vfs/ module instead of vfspk3/ and vfspak/ - think about it, see if we really act on this (or do we need to abstract the manager and some file format modules) - - TODO: HL synapse.config needs to use maphl - - TODO: wtf is enginename="quake2" in hl.game - - TODO: I don't have a sample HL map to play with, so I didn't test the changes against - -05/06/2002 - TTimo - - fixups to make 1.3 start (Q3 mode) - - turned off C++ exception support in the modules/plugins, as we don't use it - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=543 - exit properly if missing chunks in synapse.config, don't crash - - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=558 - fix for version check in release build - - ====================================================================================== - -- http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=197 - HL support patch - ====================================================================================== - 04/6/2002 - Hydra - - Patched in some CVS changes and fixed a little issue with the - new entity file loader code. - - 28/5/2002 - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=544 - Selected Entity Bounding Box obscured by brushes fix. - - Moved the "wad" keypair creation code from the Map module into - a new plugin called HydraToolz, this means that wad keypair is - done manually by the user, as in fact it should be. (as the - order of the wads is actually important). - - Fixed a problem with the wads in the wad list being re-ordered. - - 27/5/2002 - Hydra - - Created an inital implementation of a sprite model plugin. - According to the powers that be, it seems creating a model - plugin is hackish. - It works ok, but there is no way to attach models (sprites if you will) - to non-fixedsize entities (like func_bombtarget) - Also, I can't get the alpha map stuff right so I had to invert the alpha - mask in the spr loader so that 0xff = not drawn pixel. - - 17/5/2002 - Hydra - - "Wad" keypairs are now used when loading a map and speeds up map loading - significantly. This sorts out quite a few issues that could otherwise occur. - - Map loader now uses textures from wads listed in the the "wad" keypair first. - - Added a texture name mapping cache system to the .map loader - this significantly improves load times of maps that don't store texture - names along with paths (e.g. "mytexture" not "mytextures/mytexture".) - - Added vfsFileExists() to the vfs table (for above) and added it to - vfspk3 and vfswad - - Map loading and saving times are printed to the console. - - Wad file names from the "wad" key pair are logged to the console when - a map is loaded - - The user is informed if the textures loaded were not found in the - wad files in the "wad" keypair. - - The user is informed if the textures was not found in any wad file at all - (Q2/HL only, the shader module still gives you similar information for other - games when a shader activation fails) - - - 8/5/2002 - Hydra - - Added basic support in mapq3 for reading maps saved by Worldcraft 2.2+ - in .map format (It uses [ ]'s round some of the texture co-ordinates) - TODO: do we need to be able to save a map in this format too ? - - Added support for loading ZHLT style point files (*.lin) - - Added wad filename information when loading textures. - (This helps take the ambiguity out of which wad files textures come from, - so that we can correctly setup the worldspawn "wads" e-pair manually.) - Note: This will be removed when the "wads" worldspawn key is built by radiant. - - added vfsFindFile() to vfs table. - - VFSWAD: vfsLoadFile() no longer ignores paths when loading textures - (this was by design, but the design has changed for the better) - - When loading a Quake2 map file, vfsFindFile() is used to find the actual path of - the shader/texture being loaded. - This fixes all the weird issues that crop up when we were able to use non - wad-relative texture names () and wad-relative(/). - (such as having an image loaded twice in memory.) - We also now get the correct shader name in the suface inspector too. - Note: not sure if this code should stay in the map parser, or wether it should - be moved to where shaders are first initialised. - Note: maybe this needs to be when a halflife map is loaded, not specifically a - quake2 map file. - - added EClass_SupportsMultiple to the EClass loader API. - Note: this is poop. FGD files can be additive but radiant makes it so they can't be. - This function would not be needed if the eclass loader itself took care of the init, - rather then the manager taking care of the init. Also note that if the loader were - to take care of the init then FGD files *CAN* be additive, as it's not down to the - format of the FGD files. However, it'll do for the moment because all the supplied - FGD files that come with halflife and it's mods are meant to be used one at a time. - - removed support for having an additional (not external) eclass loader. - Just ifdef'd for now, grep for USEADDITIONALECLASSLOADER. - We never mix entity definition formats and synapse.config allows us to just have the - right one and also there is no mechanism for setting g_bHaveEClassExt anymore. - - Texture subset on by default for halflife. - - default texture scale is now set to 1 instead of 0.5 for halflife. - (needs to be 1 for q1/q2 too) - - patch toolbar disabled by default for halflife and it's also disabled - in the preferences so it can't be turned back on) - (needs to be 1 for q1/q2 too) - - bsp monitoring disabled by default for halflife - - When you drop a light entity the epair "_light" is used instead of "light" (halflife specific) - - removed -fs_game additions to the map compiler commands; ZHLT doesn't support it. - - saving of contents/flags/values in q2 format maps disabled (ZHLT doesn't like em !#?!) - TODO: re-enable for Q2 (but not halflife) format maps when we can - can figure out what game/engine combo we're using from within a module - - configured mapq3 to have dynamic VFS API too - - Added halflife shaderlist.txt parsing back in, it's actually useful - afterall (for editor shaders). - ====================================================================================== - -- end HL support patch - ====================================================================================== - -01/06/2002 - TTimo - - merging 1.2.7 -> 1.2.9 changes into 1.3, merge notes: - - the win32 .dsp are a bit different, using the $(CORERADIANTDIR) post build commands now - - merged in the JKII/STVEF hardcoded chunks, should probably check that everything is still fine on that end - was setting the "dir" epair in project files intead of "gamename" like all other games? - (which should really be "fs_game" anyway, I wonder who decided to call it "gamename") - - rebuilt a setup. we have a problem with RADIANT_MAJOR RADIANT_MINOR it seems - TODO: setup needs to use GtkRadiant-1. as basename in start menu, and base for installation - C:\Program Files\GtkRadiant-1.3 and C:\quake3\Radiant-1.3 etc. for the game packs - TODO: add HL setup chunks! - -=============================================================== --- merging release-1_2_7 -> release-1_2_9 into 1.3 -=============================================================== -28/5/2002 - TTimo - - final fixes for Linux 1.2.9 setup - -27/5/2002 - TTimo - - bug 521, q3 entities.def trigger_hurt fix - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=542 - default texture scale is configured in .game - defaults to 0.5 (q3/wolf) if nothing specified, under the prop "default_scale" - removed the item from the prefs dialog too - updated the nightly setup to put the proper param in JKII .game - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=509 - changing texture window scale changes selected brushes texture - re-selecting the previous texture can be done, but is a bit tedious to write - made sure we deselect before re-init of the tex window view - - fixed linux setup code bug. won't be any update, only a full release on linux - -26/5/2002 - TTimo - - parallel cons working at last! was a problem with the targets list ('Default' command) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=515 - using the eclass extents for the box if model can't be found - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=435 - changed the submenu cascading params to avoid the overlap (we fit less stuff now obviously) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=540 - that sigchld handler is only used on Linux to report the run times - since we are rewriting the whole BSP code stuff, we can drop this for now - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=538 - removed that prompt and display - - we build radiant.x86 in cons scripts, updated the setup code - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=526 - updated the setup script to install new wolf_entities.def - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=302 - added q3map2 URL to global.xlink, updated Linux setup - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=465 - printing q3map version info through the net stream - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=539 - fixed various media, some related code, and Linux setup - - fixed watchbsp.cpp "jk2.game", was breaking game spawn for wolf (needed else if) - - SCDS_reyalP - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=504 - fixed bobtoolz vis viewer to work with RTCW (BSP version) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=526 - update of the Wolf entities file - -25/5/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=164 - corruption on exit, tried to look some more. Cleaned up some source, need looking at Gtk code closer - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=536 - cleaned up SHADER_NOT_FOUND SHADER_NOTEX internals some more - added a clean error exit in case this happens, fixed a crash that would happen anyway (Patch_LODMatchAll) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 - cleanup/sanitize of the pattern filtering code, it was ugly. did some doxygen documentation - fixed part of the print XY code, more broken stuff showed up, dropping it - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503 - region compiling was indeed fucked, spog b0rkage - fixed so that it works again - denying compile with camera out of the region - reworked SelectBrush to deal with regioning and select the right brushes - -24/5/2002 - TTimo - - Linux build fix - -23/5/2002 - Riant & TTimo - - STVEF patch and setup scripts - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=516 - moved error handling code to it's own file radiant/error.cpp - compiled with UNICODE define (that's why I had to isolate), and process the error string - so that Gtk can print it (that's only relevant to win32) - -22/5/2002 - TTimo - - quickfix, cleanup of the console verbosity - -11/5/2002 - TTimo - - final IS script updates for JKII game pack, version 1.2.8-jk2 - - fixed a bad karma #ifdef _DEBUG chunk in Texture_NextPos (causing crash of release build) - - added web url support in .xlink files (strstr on http://) - -10/5/2002 - TTimo - - cleaned the build step copy from $(QUAKE3RADIANTDIR) to $(CORERADIANTDIR) - - system shaders auto-load: display 'system' in the prefs - - force BSP monitoring off in jk2 mode - - cleaned up web update check, added HL (3) and Jedi Knight II (number 4) (on the web database too) - - updated IS setup script for mapextras.pk3 - Riant - - system shaders auto-load in prefs - Raven - - mapextras.pk3 as replacement for system.pk3 (system editor textures) - -8/5/2002 - Riant - - game pack and patches for JKII support - TTimo - - .game additions to specify .shader path (shaderlist and shader scripts) - NOTE: if we ever use q3map for JKII compiles, that would need to be propagated - - reworked the shaderlist to list all the included shaders - - built a system.pk3 pack for textures/system/ and textures/radiant/ (misses a few pieces still) - - MP / SP mapping mode toggle, SP ignores mp_*.def MP ignores sp_*.def - - fs_basepath does not get added during BSP command expansion for JKII mode - - more verbose on script location and junk.txt location when monitored compile is disabled - (the BSP compilation WANTS to be rewritten, it's getting VERY URGENT) - - JKII game back IS setup lands - -7/5/2002 - TTimo - - using radiant.x86 as Linux target (instead of radiant, didn't fit with the setup procedure) - - bumped version tag - - TODO: bug #453 code needs backported from 1.3 - -6/5/2002 - TTimo - - fixed typo in plugins/mapq3/write.cpp Map_Write - g_count_entities = 0; instead of g_count_brushes - - more fixes which showed up while merging this with 1.3 - --- release-1_2_7 ----------- tagged and Stable-1_2 merging into trunk - -02/5/2002 - Gef - - added filtering on unselect for newly created brushes/entities (bugzilla: #374) - SPoG - - added undo for pasted/cloned brushes - -============================================================ --- end release-1_2_7 -> release-1_2_9 merge -============================================================ - -15/05/2002 - TTimo - - rewrote the ref count code cleanly, added some elements to design and todo - - wrote the core shutdown code of synapse, 1.3 exits cleanly without crashing (well, in most cases it seems) - -10/05/2002 - TTimo - - began writing proper unloading and shutdown of synapse (see libs/synapse/docs/unload.txt) - design doc started, non active modules are unloaded after startup - need win32 implementation of ReleaseSO - - quickfix on win32 (ReleaseSO) - -07/05/2002 - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=512 - - cleaned up strHomeMaps and strFSBasePath stuff - prompts for maps, models, sounds etc are fs_game-dependant - - =========================================================================== - -- merging Stable-1_2 between Stable-1_2-tag and release_1_2_7 into trunk - merge ChangeLog - ============================================================================= - 07/05/2002 - - using RADIANT_MAJOR_VERSION and RADIANT_MINOR_VERSION for the version info, this was conflicting with synapse - - - m_strHomeMaps - http://zerowing.idsoftware.com/viewcvs/viewcvs.cgi/GtkRadiant/include/qertypes.h.diff?r1=1.27&r2=1.28&only_with_tag=MAIN - http://zerowing.idsoftware.com/archives/gtkradiant/2002-February/002170.html - posted on the ML, bringing it back in from 1.2 - - setup scripts: - easily merged, as the 1.3 scripts have not been touched mostly - - qe3.cpp conflict: - 1.2 tweaks stuff in the QE_*Project* functions - 1.3 has them mostly commented out - applying manually where relevant - the project settings stuff is very different, and the changes can't be applied as is - given the fixes I had to do in 1.2, I'd expect the current 1.3 version to be fairly broken - a complete kill and rewrite of the prefs/project stuff might be our option anyway - http://zerowing.idsoftware.com/archives/gtkradiant/2002-May/003038.html - qe3.cpp QE_InitVFS conflict: - 1.3 has some changes when creating the files in a new userprefix (ex. ~/.q3a/baseq3/scripts /maps /maps/prefabs etc.) - merged by hand, probably needs to be checked - qe3.cpp OpenDialog SaveAsDialog conflict: - commented out in 1.3, getting rid of it completely - - preferences.cpp conflict: - 1.2 adds CUSTOMSHADEREDITOR_KEY pref - 1.3 uses a completely different syntax for prefs - preferences.cpp conflict: - prefab path pref changes conflict with 1.3 pref syntax - applying changes manually to 1.3 codebase - - pmesh.cpp conflict: - 1.2 adds pref to group / not group patch thickening - 1.3 changes the way we manipulate entities around that code - merged manually, would be worth checking that the thicken pref works - - pluginmanager.cpp conflicts: synapse completely changes that part - on relevant 1.2 thing is the removal of pfnRadiant_Free - - map.cpp Map_ImportEntities conflict - 1.3 has bug 453 map conversion promt that was not backported to 1.2 (caused merge to conflict a bit) - usin 1.3 code and checking 1.2 changes manually - - using radiant.x86 as Linux target (instead of radiant, didn't fit with the setup procedure) - - 06/05/2002 - not merging in .dsw .dsp - an eclass.cpp fixed moved to eclass_def.cpp - mainframe.cpp is always a bitch to merge, sent several mail comments to list about conflicts that arose - MainFrame::OnFileSaveas needed some updates that were not in the diff (correct default prompt) - (same for MainFrame::OnFileSaveregion) - MainFrame::OnFileNewproject conflicts a bit, changes have been made in 1.2 and 1.3 - changes in 1.2 seem more crucial, using the 1.2 version, and patched the 1.3 manually over it - (might need to be checked, bug #506) - - TODO: need to check for parasite g_free that I added back from the file dialog - - propagated ChangeLog from Stable-1_2 - ============================================================================= - 02/5/2002 - Gef - - added filtering on unselect for newly created brushes/entities (bugzilla: #374) - SPoG - - added undo for pasted/cloned brushes - TTimo - - shift+left click to open shader editor no longer selects the texture on the way - (this was unstable, pCurrentShader could become NULL somehow) - - editpad bindings were completely broken - attempts to make it work again failed - taking it out - changed the prefs, on win32 you select between internal shader editor or win32 .shader binding - we have lost the ability to jump to a given line, if someone has a good solution for line jumping, let me know - - one more fix to the MAJOR / MINOR safe checks stuff - - bug #500: oooogly, I removed a line which I should not have :) - - 01/5/2002 - TTimo - - "Save selected.." load/save in fs_game sensitive directory too - - removed a bunch of unused/broken project settings items - removed most of them actually .. project settings are .. ahem - - added an optional 'go to url' button in gtk_MessageBox - - 30/4/2002 - Gef - - fixed lod drawing of selected patches when patches are filtered - - 29/4/2002 - TTimo - - bugzilla #467 - make patch inspector deny space textures - make mapq3 write code drop space textures - - bugzilla #132 - removed remotebasepath and texturepath - rewrote the Textures > Load Directory (which was kinda relying on texturepath) - - bugzilla #355 - uploading editpad zip to qeradiant.com misc/ in files section, replacing the win32 message about editpad - added editpad quote in qer.com totd - - fixing the map load/save dialogs to work correctly with mod settings on win32 (was done on Linux and still broken on win32) - - - 26/4/2002 - Gef - - fixed patches losing their shader if outside region when calling flush/reload - (bugzilla: #492) - - blocked textures with spaces from loading in Texture_ShowDirectory with a warning - (bugzilla: #467) - - fixed a dud shader (liquids.shader -> textures/liquids/ripplewater2_back) didn't have - the textures/liquids prefix - - 25/4/2002 - Gef - - fixed a broken image link in the shader manual (bugzilla: #486) - - changed prtview to use ~/.radiant//prtview.ini instead of - ~/.q3a/radiant/prtview.ini on linux - - fixed prtview loading/saving config (bugzilla: #424) - TTimo - - removed QERApp_RadiantFree from the function table - we can malloc and free across modules configured correctly for the CRT (Common Runtime DLLs) - cleaned up related broken malloc / free strategy in the plugins (vfsLoadFile uglyness) - - added main build date and version to curry / pk3man / prtview - - 23/4/2002 - SmallPileOfGibs - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=229 - flush and reload was affecting texturing of selected brushes - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=489 - File > Check for update menu item, jumps to the website and checks for update - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431 - win32 part, RADIANT_MAJOR RADIANT_MINOR written out by setup - - more stuff on File > New Project and common mod setup issues (not finished yet) - - 22/4/2002 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431 - reworking a bit the installer stuff - wrote the version checking - needs testing on win32 (RADIANT_MAJOR and RADIANT_MINOR are required in the install now) - - 21/4/2002 - TTimo - - trying more seriously to get a new nightly out - updating the ChangeLog for current 1.2.7 from this file - cleanups, browsing through the bugs to close/update/fix - - http://zerowing.idsoftware.com/bugzilla/showattachment.cgi?attach_id=197 - I kinda fixed that myself already, going through the diff and applying the missing stuff - creating the prefabs/ dir in QE_InitVFS - - added a line about the games dialog / auto-select at startup in the dialog frame - - 15/4/2002 - TTimo - - cleaning some old commented out map load code - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=477 - on Linux: - - strHomeMaps was init without taking care of m_strFSGame - - SaveAsDialog was not using strHomeMaps - NOTE: should strHomeMaps be spcific to Linux, or we will do better if we unify - need similar checks on win32 - - 13/4/2002 - TTimo - - kicking the source to generate new doxygen on zerowing - - 09/4/2002 - Gef - - setting the sel_mode accordingly when (i)nverting selection, verts were being drawn when - they shouldn't have been - - 05/4/2002 - Gef - - fix File/New Project for mods so it doesn't fail if the dir exists (bugzilla: #459) - - add Linux-isms for New Projects & read/write permissions... - note: for a total conversion, basepath needs to be manually set - - prevent opening multiple internal shader editor dialogs - - added preference for using a custom shader editor - - set horizontal scrollbar to be automatic instead of never for entity keyval list (bugzilla: #4) - - added a call to Select_Reselect() in XYWnd->OnViewEntity() to make sure its modifying the - current selection (bugzilla: #436) - - fixed entity dialog passing events through to main window (bugzilla: #454) return values - were backwards - - patching in the .pfb extension adding stuff (bugzilla: #259) - - fixed thickened patches not being grouped (bugzilla: #226). this was supposed to be happening - anyway, the entity create code was called before the patches were selected - - 02/4/2002 - EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=457 - add entity #X and brush #X comments back to saved .map files - - 24/3/2002 - Hydra & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=444 - only show empty alpha channel warning if the tga texture is actually 32 bit - (24 bit would always have empty alpha, the warning was useless in this case) - - 19/3/2002 - Gef - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=217 - - Set show value to true for angle and movement velocity sliders in preferences - - Increased the maximum value of angle velocity from 6 to 100 - - 18/3/2002 - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=419 - fixed File->Save with region active acts the same as File->SaveRegion for ents - - - end merge - ============================================================================= - -16/4/2002 - SPoG - - fixed MDC_XYZ_SCALE value - -12/4/2002 - SPoG - - fixed win32 compile error - vc6 being nitpicky - - fixed refcount init on CSynapseAPIManager - - cleaned up md3model win32 project file - -9/4/2002 - Gef - - added nudging for selected brush and patch vertices (bugzilla: #240) - - added selected brush vertex highlighting - - sorted all the ID_'s in HandleCommand alphabetically to make it easier to track things down - - setting the sel_mode accordingly when (i)nverting selection, verts were being drawn when - they shouldn't have been - -5/4/2002 - EvilTypeGuy & djbob - - patched in djbob's grid minor/major color settings for gridsize < 1 - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=24 - -1/4/2002 - TTimo - - configured md3model to have dynamic VFS API too - - cleaned up texwindow.cpp texture extension loop - - updated current HL media with hl's synapse.config - http://zerowing.idsoftware.com/stuff/HL-media-0401.zip - - checking in new synapse.config for Q3/RTCW - - fixed win32 project files, removed hltoggle.h - - bumped version to 1.3.3 - -31/3/2002 - TTimo - - XML runtime configuration of synapse - uses a synapse.config in the gametools path, we can add a line in the .game to specify the file later on - - various cleanups and removal of dead code - - Linux build system: sanitized CFLAGS, libxml, STLPort and glib include path all in the toplevel Construct file - - removed the 'cons -- halflife' option, the binaries are unified again - - cleaned up image loading - - -29/3/2002 - TTimo - - patching in Hydra's code for Half-Life, builds and runs on Linux, need to quickfix on win32 now - - build system on Linux: some things are still hardcoded into the core, you need a different core - for Q3/RTCW or HL for now. do ./cons -- halflife to build HL mode (build trees are seperate) - - there is no media / install procedure yet, but a zip with what you may need for install is available: - http://zerowing.idsoftware.com/stuff/HL-media-0329.zip - - cvs added all the new files - - patched various things from the patches, don't have a precise list - cleaned up the interface requests, isolated HL specific between TMP_HALFLIFE defines - removed 'tga' from imagehl, two modules providing the same API has unexpected results - - TODO: the image loading is the main problem right now. We should not have any place that scans the - extensions, this is done internally to the image load manager? texwindow.cpp does enumeration of the - minors too .. but that may be legal in this case. - - TODO: synapse config at runtime through XML (rather big piece) - - - fixing build on win32 - bad coding practices: 'for (GSList *choicelst = ..' - added a quick hack include/hltoggle.h for easy switch q3/rtcw or hl compile - (remaining hardcoded stuff is temporary) - - -28/3/2002 - Gef - - added linux pthreads support to tools - - removed old terrain.c and lightv.c from q3map2 Conscript - -27/3/2002 - Gef - - updated cons for q3map 2 - - minor q3map2 fixes for linux compile errors/warnings - - minor warning fix in map.cpp - SPoG - - changed entity_addtolist to add entities to end of list instead of beginning - - added eclass_forname to eclassmanager interface - - fixed setting eclass before model-update for entities loaded from map - - fixed setting bounding box for models after model-update - ydnar - q3map2 - - fixed crash on -connect and other gremlins related to argument processing - - removed flag that prevented Castle's maps from compiling - - -27/3/2002 - - Hydra - - Important Changes: - - - Added VFSWAD modules for extracting textures from WAD files. - - Added ImageHL for loading textures contained in WAD files - - Updated shaders source code so that you can produce ShadersHL.dll - (single minor using #ifdefs) - - MapQ3 source updated so that it can load and save q2 format maps - provides a multiple minors. - - Added EClassFGD for loading FGD definition files - (I documented this code quite well, if you're interested...) - - Added support for iconsprite() settings in the FGD loader, we set - eclass_t->skinpath with the name of the sprite - TODO: write a sprite model plugin. - - Fixes: - - - Fixed incorrect line numbers being reported when script files had // comments in them - - Removed EClass_Create from the EClass manager _EClassManagerTable - - Replaced all occurences of "textures/radiant/notex" in shaders.cpp with a define. - - Fixed a crash in shaders.cpp when there was no default texture. - - Fixed a possible issue with g_bCancel_Map_LoadFile - - Added a crash fix for uninitialised patchMesh_t->pSymbiot - - Core Changes Required for HalfLife Support: - - - Set MAX_FLAGS to 16 to support Halflife's extra spawnflags, adjusted - entity inspector to display the new spawnflags, updated FGD loader - to load them correctly (previously it only loaded the ones with values <8) - (Done without breaking the old Q2 code that was commented out) - - Added GetTokenExtra to the _ScripLibTable - - Kludged texwindow.cpp to allow loading extension other than "tga" and "jpg" - TODO: ttimo, we need something in synapse to help with this. - - Plugin manager requests different API's depending on .game file used. - TODO: this needs to be done on a PER GAME basis, not PER .GAME FILE. - - Shaderlist.txt is not parsed on startup if hl.game is used. - TODO: this needs to be done on a PER ENGINE basis, not PER GAME. - - Cosmetic Changes: - - - Changed MAPQ3's minor_name from "map" to "mapq3" (also adds "mapq2" as a minor) - - Changed XMAP's minor_name from "xmap" to "mapxml" - - Changed VFS's minor_name from "quake3" to "pk3", more inline with VFSWAD now. - - Changed file/Load to file/Import on the menus - - When a shader (Q3/HL) is not found a message is displayed in the console - (only once for each shader that is not found). This is so the user can - quickly get a list of missing textures/shaders. - -26/3/2002 - ydnar - - initial q3map 2.0 source import - new tools/quake3/q3map2 directory - common/qfiles.h and common/surfaceflags.h modified - affects q3map 1.x too, bumped MAX_MAP_BRUSHSIDES to 0x40000 - will need to write the build scripts and compile on Linux too - SPoG - - Re-added dialog prompting user to convert/change-mode/abort when map BP mode - conflicts with project settings - - large entity/models update - +++ include/ientity.h 25 Mar 2002 11:37:54 -0000 - entity module - - interface cleanup - - common #defines for easy transition - +++ include/igl.h 25 Mar 2002 11:37:55 -0000 - opengl module - - Vertex Arrays support - +++ include/imodel.h 25 Mar 2002 11:37:57 -0000 - model module - - interface cleanup - +++ libs/mathlib.h 25 Mar 2002 11:37:59 -0000 - vector macros - cleanup - m4x4 - - documentation of matrix layout - - interface for utility functions for axis-angle and quaternion rotations - - interface for new utilities for specifically transforming points/normals - aabb - - interface for faster aabb-ray test without finding intersection point - - interface for utility to calculate an aabb to contain a transformed aabb - +++ libs/mathlib/bbox.c 25 Mar 2002 11:38:01 -0000 - - cleanup of use of qboolean - - implementation of fast aabb-ray-test - - implementation of aabb-for-transformed-aabb - +++ libs/mathlib/m4x4.c 25 Mar 2002 11:38:02 -0000 - - implementation of utility for rotation matrix from axis-angle/quaternion - - cleanup of implementation of matrix multiplication functions (optimise for in-order array traversal) - - implementation of new utilities for specifically transforming points/normals - +++ libs/mathlib/ray.c 25 Mar 2002 11:38:02 -0000 - - replace use of m4x4_transform_vec3 with new point/normal specific utils - +++ plugins/mapq3/plugin.cpp 25 Mar 2002 11:38:06 -0000 - - rename g_EntityTable using #define in ientity.h - +++ plugins/mapq3/plugin.h 25 Mar 2002 11:38:06 -0000 - - rename g_EntityTable using #define in ientity.h - +++ plugins/mapxml/xmlparse.cpp 25 Mar 2002 11:38:06 -0000 - - buffer-safe dtd path construction (without using string class, in case of unknown bugs) - +++ plugins/md3model/Conscript 25 Mar 2002 11:38:06 -0000 - - remove entity-module files from md3model conscript - +++ plugins/md3model/md3model.cpp 25 Mar 2002 11:38:07 -0000 - - implementation of generic quake-style-model class CModel - - implementation of CModel-derived md3/mdc classes - +++ plugins/md3model/md3model.dsp 25 Mar 2002 11:38:08 -0000 - - remove entity-module files from md3model dsp - +++ plugins/md3model/md3model.h 25 Mar 2002 11:38:08 -0000 - - interface for generic quake-style-model class CModel - - interface for CModel-derived md3/mdc classes - +++ plugins/md3model/md3surface.cpp 25 Mar 2002 11:38:09 -0000 - - implementation of generic quake-style-model class CSurface - - implementation of CSurface-derived md3/md2/mdl/mdc classes - +++ plugins/md3model/md3surface.h 25 Mar 2002 11:38:09 -0000 - - interface for generic quake-style-model class CSurface - - interface for CSurface-derived md3/md2/mdl/mdc classes - +++ plugins/md3model/plugin.cpp 25 Mar 2002 11:38:10 -0000 - - provide support to synapse for loading md3/mdc/mdl/md2 models, and mdl images - +++ plugins/md3model/plugin.h 25 Mar 2002 11:38:10 -0000 - - interface for loading md3/mdc/mdl/md2 models, and mdl images - +++ radiant/brush.cpp 25 Mar 2002 11:38:18 -0000 - - #ifdef remove Group/Brush-Patch-Epair related stuff - - const correctness for ValueForKey interface const change - - add bounding-box update for models in Brush_Build - - remove old brush parsing/writing stuff - - remove old eclass-model loading/displaying stuff - - enable vertex arrays on light drawing - - moved brush is-selected? utility to brush.cpp - +++ radiant/brush.h 25 Mar 2002 11:38:18 -0000 - - comment out interface for old brush parse/write stuff - - comment out interface for brush epair stuff - +++ radiant/brush_primit.cpp 25 Mar 2002 11:38:20 -0000 - - remove old brush-primitives parsing/writing stuff - +++ radiant/camwindow.cpp 25 Mar 2002 11:38:23 -0000 - - moved brush-bbox update for models to brush.cpp:Brush_Build - - bugfix for material colour setting when drawing models - +++ radiant/eclass.cpp 25 Mar 2002 11:38:24 -0000 - - removed old eclass-model checking/loading stuff - - added const checking for Eclass_ForName interface - +++ radiant/entity.cpp 25 Mar 2002 11:38:26 -0000 - - REMOVE THIS FILE - +++ radiant/entity.h 25 Mar 2002 11:38:26 -0000 - - REMOVE THIS FILE - +++ radiant/groupdialog.cpp 25 Mar 2002 11:38:29 -0000 - - change entity creation to not use Entity_Create (function was removed) - - commented groups stuff - +++ radiant/gtkdlgs.cpp 25 Mar 2002 11:38:36 -0000 - - const correctness for ValueForKey - +++ radiant/gtkmisc.cpp 25 Mar 2002 11:38:39 -0000 - - added filetype patterns for mdc/mdl/md2 - +++ radiant/main.cpp 25 Mar 2002 11:38:41 -0000 - - const correctness fixes - +++ radiant/mainframe.cpp 25 Mar 2002 11:38:59 -0000 - - change selection -> merge entity and selection -> separate from entity to go through mainframe class - - implementation of mainframe functions for selection -> merge entity and selection -> separate from entity - - made entity grouping and detail/structural settings undoable - - commented out old groups stuff - +++ radiant/mainframe.h 25 Mar 2002 11:39:01 -0000 - - interface for mainframe functions for selection -> merge entity and selection -> separate from entity - +++ radiant/map.cpp 25 Mar 2002 11:39:04 -0000 - - const correctness fixes - +++ radiant/pluginmanager.cpp 25 Mar 2002 11:39:08 -0000 - - removed model table - - stopped requesting model table from synapse - - request undo table from synapse - - commented out support for IEpairs stuff - NOTE: to be integrated with entity module - - fill interface table for opengl vertex array support - - fill interface table for undo - +++ radiant/pmesh.cpp 25 Mar 2002 11:39:18 -0000 - - cleanup patch cap and patch thicken to create entities using entity module interface (without Entity_Create) - - removed old patch parse/write stuff - - #ifdef'd out patch epair/groups stuff - +++ radiant/qe3.cpp 25 Mar 2002 11:39:21 -0000 - - const fixes - - buffer-safe dtd path construction (without using string class, in case of unknown bugs) - +++ radiant/qe3.h 25 Mar 2002 11:39:24 -0000 - - don't include entity.h, include ientity.h and forward-declare entity-table instead - - include imodel.h but don't forward declare model-table - - include iundo.h and forward-declare undo table - - comment out interface to old patch parse/write stuff - - comment out interface to old brush parse/write stuff - - comment out iepairs header include.. NOTE: to be integrated with entity module/interface - - include eclass interface (we don't have an eclass.h) - - declare interface for CreateEntityFromName (generic useful func) - - declare target/targetname utils interface (we don't have a targetname.h) - +++ radiant/select.cpp 25 Mar 2002 11:39:27 -0000 - - cleanup implementation of entity selection-grouping/ungrouping utlities - +++ radiant/select.h 25 Mar 2002 11:39:27 -0000 - - cleanup interface for entity selection-grouping/ungrouping utlities - +++ radiant/undo.cpp 25 Mar 2002 11:39:29 -0000 - - removed workaround for wierd entity_clone behaviour (changed in entity module) - - avoid using Entity_FreeEpairs (not exposed by entity module) - +++ radiant/xywindow.cpp 25 Mar 2002 11:39:35 -0000 - - const fixes - - cleanup implementation of CreateEntityFromName to be a usful generic utiliy function - - enable vertex arrays in XY_Draw - - enable undo for right-click dropping entities in XY window - TTimo - - various fixes to make the above compile on Linux, checkin to cvs - - fixing some win32 build stuff - - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=434 - fixed setSpecialLoad in .def code - -19/3/2002 - Gef - - Modified the fix for LoadImage to be more consistent with other code - - Applied Hydra's fix for empty alpha channel warnings & cleaned up indentations (tabs) in lbmlib.cpp - also added output of the tga type when a tga file fails to load - - Reverted my over complex fix (read; mess) for strtok_r to use strtok instead of manual tokenising - -17/3/2002 - Gef - - Fixed LoadImage API list not being incremented while trying to find image minors, result was - infinite loop when loading images that weren't of the first type (tga) - - Fixed cloning giving dtd errors. mapxml/xmlparse.cpp:ParseXMLStream() was using - g_FuncTable.m_pfnGetQERPath() as the dtds path... disabled validation until spog can check - that my fix is the right solution - - Added simple formatting to xmap file output so that each node has a new line for readability - -13/3/2002 - TTimo - - introduced API List managers - we deal with two types of APIManager now, the ones that matching all minors for a given major - and the ones that require a fixed list of minors - - converted the image loaders to go through a API list manager - - fixed various things in synapse (introduced more bugs?) - - fixed plugins, realized it was still broken - -12/3/2002 - Hydra & TTimo - - EClass_Create in the EClass manager _EClassManagerTable - - removed InitFromText from _EClassTable - -8/3/2002 - TTimo - - some commented out code cleanups - - added eclassfgd/ fgd.so module skeleton - loaded up in radiant core as an optional entity format - added eclass manager code to deal with the new format if present - this still loads .def, the actual .fgd code needs to be written now - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=433 - added a g_strDTDPath global - disabled DTD validation, broken on win32 - - Str copy constructor (const Str &) working correctly with a __strDup - -7/3/2002 - TTimo - - added verbosity in file accesses for CXMLPropertyBag - - more fixes to project lookup - - dropping dtds/ prefix, this is installation dependent - - removed ipluginentities.h, the plugin entities stuff was disabled long time ago already - - cleaned up some old commented out stuff - - proof of concept synapse builtin module: new class CSynapseClientBuiltin allows to have - modules builtin to the application (i.e. statically linked) - adding - include/ieclass.h (eclass loader API) - radiant/eclass_def.cpp (.def class loader, builtin) - radiant/eclass_def.h (.def loade, API public to the core) - - NOTE: radiant/eclass_def.cpp needs to be added to the win32 projects - - quickfix to project file loading ("/scripts/") - - introduced an EClass manager, hooked up the .def builtin module through it - (not yet possible to push new entity format modules, but .def reading is already fully synapsed) - -6/3/2002 - Gef - - Fixed a segfault when getting mUserPathPrefix in CGameDescription::CGameDescription() - - added preferences check for fixing target/name collisions - - fixed a logical error on my part, where setting g_qeglobals.m_strHomeGame in - CGameDescription constructor results in a value from the last file parsed. Moved it - to a more appropriate location, where it gets a value from the selected .game file. - SPoG - - changed g_strGameToolsPath to g_strAppPath in GetQERPath API - - fixed mapq3.dtd - - enabled DTD validation of xmap files - - added mapq3.dtd to setup scripts (not tested) - TTimo - - added OnActivated() to synapse clients, override to put some init code - - fixing default project path lookup and user project increment (again) - - fix to linux setup, no trailing slash in basegame items - (wolf.game and q3.game) - - removed old plugin/modules code, leaving only the synapse implementation - recoded image loading and Map_Import/Map_Export - still some temporary solutions and cleanup work to be done - removed plugin.cpp from the tree / build system - -5/3/2002 - SPoG - - TODO: add default project for wolf to WolfPack CVS module - - changed xml project file load to search for DTD "dtds/project.dtd" under radiant path - - fixed crash in mapq3 on trying to read uninitialised token ptr - - changed .map to be default map format for now - - changed runbsp to not hardcode -fs_basepath - - added -fs_basepath to quake3 default project - - added project.dtd to setup scripts and swapped quakev2.qe4 for default_project.proj (not tested) - -4/3/2002 - TTimo - - merged synapse2 branch back into trunk, checked Linux and win32 builds ok - - updated the .dsp to work with new libxml2 2.4.16 - - fixed broken enginepath guessing, and broken project path rotation / saving - -28/2/2002 - Gef - - Added extra checks for target/targetname collisions - - Find Brush dialog title correction (bugzilla #393) - -26/2/2002 - Gef - - Added Entity_Connect() to entity.cpp to avoid duplicating code - - Fixed target/targetname collisions - entities being cross-linked when copied - Bugzilla #385 : http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=385 - -16/2/2002 - Gef - - cleaned up the kyro gl_point workaround stuff - - taught ClipPoint's (clips & path points) how to draw themselves - -8/2/2002 - Gef - - Added mapxml.so to linux setup - - strip debug symbols option in setup - - removed g_qeglobals.m_strHomeMaps, writing it to project instead - fixes a bunch of re-broken path issues. Also uses fs_game now. - - Minor grid colour in QER Black & Green theme - - Save window's pos/size for all view types in MainFrame::OnDestroy - ---------------------------- on branch synapse2 -4/3/2002 - - modules don't show up in plugins menu, added a dump in console before entering interactive mode - - added compile time def for synapse verbosity - -3/3/2002 - - finished converting all the modules to synapse, disabled old ResolveInterface call - -24/2/2002 - - hooked TexTool into Radiant plugin menu through synapse - - added iplugin.h which I had forgotten earlier - - ported synapse code to compile and run on win32 - -19/2/2002 - - SYN_REQUIRE_ANY / multiple API manager code - can load multiple interfaces based on a matching pattern - converted TexTool to load that way - -18/2/2002 - - added iplugin.h with basic interface for plugins - -13/2/2002 - - synapse on modules currently disabled, - the basics of the code are working fine, need to look at multiple interfaces matches before going further - - started converting shaders, requires conversion of a lot more others - - image converted to synapse - - no longer using GUID in synapse, all done through *_MAJOR strings - HOWTO: convert a module to synapse: - configure it to link against synapse static lib - (+include path to STLPort required) - add #include "synapse.h" to the plugin header - declare the : public CSynapseClient in plugin header - implement it (listing provides and requires, implement the request code) - -12/2/2002 - - vfspk3 converted to synapse - -11/2/2002 - TODO: get rid of all WINAPI crap - - debugged the API dependencies solver to actually work - - added newer cons at the head of the tree - -10/2/2002 - TTimo - - added the basic code for solving API dependencies and requesting the various tables - - more diagnostic printing code fixes - - version checkings - - some more design work (libs/synapse/doc) - -9/2/2002 - TTimo - - some changes to the files layout, cleanup of the diagnostics printing - (stuff's mostly broken right now) - - reworked the complete Sys_Printf stuff to rely on va_list implementation - - include/isynapse.h declared useless and foxed without mercy - - added include/irefcount.h - -8/2/2002 - TTimo - - adding an experimental Anjuta project file to play around with - -7/2/2002 - TTimo - - various fixes to build on linux, listed a bunch of current issues - - fixing terrademo.map to remove broken mapobj~1 -> mapobjects - -- synapse2 branch -- - - propagate the code from old synapse branch to a new branch out of 1.3 tree - (builds and runs on linux, that's about it for now) - ---------------------------- end branch synapse2 - -7/2/2002 - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=354 - moved all the preferences code to XML - -6/2/2002 - SPoG - - checked all paths conform to: unix dir separators + trailing separator - - changed file dialogs for load/save of maps to default to "mapspath" - - removed OpenDialog and SaveAsDialog, use file_dialog instead - - removed FileSystem paths stored in QEGlobals_t.. replaced by CGameDescription - - removed dependence on EnginePath from preferences, replaced by CGameDescription - - removed hardcoded g_get_home_dir calls for file dialogs - - added validation of project settings entry paths before they are set - -5/2/2002 - EvilTypeGuy - - moved filters.cpp related function declarations to filters.h - and added #include "filters.h" to brush.cpp, csg.cpp, main.cpp, - mainframe.cpp, map.cpp, select.cpp as not all files include - qe3.h and qe3.h is a rather monolithic header this seems to be - a cleaner solution per SPoG's suggestion...Fixes compilation. - - Gef - - contrib/plugins BOOL cleanup (uses qboolean now) fixes X header conflict - - cons update for mapxml - - SaveAsDialog() changed to match path's used in OpenDialog() - - removed radiant/xy.h - moved contents to qe3.h (FilterBrush declaration) - -4/2/2002 - SPoG - - changed QE_LoadProject and QE_SaveProject to load/save xml project file format - - changed request dialog for project files to loop until a valid file is found - - fixed memleaks in CGameDescription constructor for xmlGetProp - - added converting gametoolspath unix format when parsed from game file - - - fixed m4x4 lib to use column-major order (more compatible with opengl) - - added divergence parameter to ray-point intersection test - (now easier to select distant points in perspective views) - - cleaned up modelview/projection matrix manipulations in 2d/3d view - - cleaned up map modules / interface source files a bit - - - added ability to specify map module version when importing/exporting map - - cleaned up file dialog code, returned filename is static and in unix format - - save-as dialogs force a file extension depending on filetype selected - - added filetype manager to support registering custom file types - - fixed loading and cleaning engine path from radiant.ini correctly - -3/2/2002 - EvilTypeGuy - - fixed win32 compilation (userpathprefix is Linux specific) - - ETG & Powzer - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=308 - added preference to allow 'paint drag-select' brushes/faces in 3d camera view - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=389 - added preference to strafe camera foward/back in 3d view while freelook is active - - ETG & RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=388 - patch adds ability to strafe up/down/left right while freelook is active - -1/2/2002 - TTimo - - bumped to 1.3.1-nightly - --- 1.2 stable branch branched here - - Gef & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=372 - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=376 - appplied the patch, corrected the mapspath expansion stuff - TTimo - - linux nightly setup code - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=384 - hacked a corrective action in the nightly setup - - SPoG - - fixed creating region brushes that fill the entire grid for Save Region - -31/1/2002 - - Micheal Schlueter - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=375 - syntax fix to q3map path_init.c - - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=279 - patch 185 == 186 - tweaking to config stuff in linux setup - patch 187 - Ensures the games directory exists before trying to create a file there - patch 177 - Adds *.cf files & uses them. I think I have all the files in the right places now... maybe - (some additional fixes on top by me) - - ETG - quick fix to shader prefs load - -29/1/2002 - - EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=345 - more detachable menus fixes - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=334 - fixes 'load shaders at startup' preference - - SPoG - - fixed misc_model "modelscale" and "modelscale_vec" support - - TTimo - - upgraded setup scripts to support nightly build - - last minute fix to the modelscale and modelscale_vec code (md3 module) - - ydnar - q3map 1.2.4-y2 - - New features: - - -nopatchfix argument. This disables lightmap patch fixes and makes a map suitable for lighting with -vlight. - - Degenerate patches are treated like broken brushes. They are ignored, warned about, and selected in Radiant if you ran with the -connect option (or from the BSP menu). This was what was causing the "0 valued axis" error some people were experiencing. - - New entity keys: - - "_lightmapscale" key for brush entities (worldspawn, func_*). This lets a mapper scale the lightmap samplesize per-entity. For large constructions, 2.0 or 3.0 is a fine value, and keeps BSP size down and compile times low. For those areas you want to have high-detail shadows, make a func_group and use a value of 0.25 or so. It will scale the samplesize value for the surface's shader (default 16) or the -samplesize argument. - - "modelscale" and "modelscale_vec" keys for misc_models (1.0 = default). This was for proper RTCW support and is available for Quake 3 maps as well. Lets you scale up map models in the world, getting around the MD3 size limitation. The next build of GtkRadiant has SPoG's code to support this in-editor so you can see what effect a scale has. - - Flare surfaces are now supressed from the BSP. They serve no purpose other than add to the vert & surfacecount in a BSP. These surfaces were created silently when a shader has "light 1" or "q3map_flareshader X." Use the new -flares switch when BSPing your map to have them emitted. - - Changes: - - GtkRadiant 1.2.4-nightly version increment. - - Full WolfSDK style lighting enabled with -game wolf, including lightJuniors. This includes linear lights by default (no angle attenuation) and support for the additional RTCW "fade" and "angle" keys, and spawnflag changes, including q3map_nondynamic on light entities. This may require maps being constructed for RTCW with the current toolset to change their light entities. Sorry. :) Note, Wolf-style lighting only works with -light, and not -vlight. - - Vertex light stitching now uses a near-ambient light check for dark vertexes as opposed to lower-than-average fixups. This preserves some shadow detail better while getting the buried verts lit properly. Comments encouraged. - - Surfaces' samplesize are now stored in the BSP. This change makes BSPs generated from this version incompatible with all other q3maps. The upside is that -samplesize N is no longer necessary on the -light or -vlight stage. This feature is necessary to support the "_lightmapscale" key. - - Additional PVS optimizations in lighting. - - Fixes: - - Will compile for RTCW properly (1.2.1-y12 didn't). - - No more sparklies where fog meets brush faces. They're split properly now. - - Crash bug in vlight fixed. - - Vertex light fixups/stitching is considerably faster. - - Vertex light fixups ONLY stitch faces with lightmaps. For pointlight surfaces you're on your own. - - Better snapping logic when merging nearly-coincident vertexes on complex brush windings. - - Bug where the .prt file had some bogus or nearly-borked portals. They're cleaned up like everything else now. - - A few stupid bugs in path initialization. Should work better. Also includes TTimo's fixes to my code so it would work properly on Linux. - - RR2DO2's PCX loading patch for alphamaps. This bug was manifesting itself in the form of offset or incorrect samples being used on terrain entities. - - A ton of other minor little fixes here and there. - -28/1/2002 - - TTimo - - win32 fixes - - 1.2.4-nightly - - djbob - - EClass_ForName fix if malformed name - ----- 1.2.3 linux released - - TTimo - - fixed BSP version depending on game mode in q3map - (home dir guessing is still fucked, have to fix before release) - - fixed q3map init_path.c home path bug on init - - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=369 - more fixes to texture paths in gensurf - -27/1/2002 - TTimo - - switching to v3 project file, forcing reload of template if non-v3 - need to distribute quakev3.qe4 in setups now (done for linux setup, will have to in win32) - - renamed Main to main in q3map init paths - - fixes the ~/. inits and init order in q3map - - added m_pfnPathForPluginName to the main function table, returns the directory a plugin is running from - used in bobtoolz / curry / pk3man to find various files - see also todo: http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=368 - - some fixes to textures loading paths in curry - - linux setup copying correct content for curry (pk3 in wolf media) and bobtoolz (bt/ in plugins/) - - building 1.2.2 setups - - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=362 - gensurf fix - - djbob - - bobtoolz update - - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=361 - fixes a bug with the texture menu loading, now we see the non-shaderlist directories too - -26/1/2002 - Gef - Michael Schlueter - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=279 - applied several patches (to setup code and to the setup scripts) - modified makesdk.pl to update with more content - added an "enginepath" attribute to the game file, reworked the handling in editor - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=347 - took out the refresh command from the plugin menu - - more linux fixes: - bringing all the plugins to compile again on linux - polishing the setup code (all the right files in the right places) - - for linux release, bumping ver to 1.2.2 - win32 will have a 1.2.3-nightly after that - - added correct init of ~/.q3a or ~/.wolf - *nix systems have a 'prefix' attribute in the .game file to specify - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=359 - identified the mod compiling problems - applying back the old fs_basepath fs_game code to the BSP generation - - ydnar- TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=351 - cleaner path init code - it doesn't init for ~/.q3a and ~/.wolf paths yet - -25/1/2002 - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=352 - using the wrong matrix stack for XY_Draw caused stack overflow error - - texture_mode was set to an invalid enum in wireframe/flatshade mode - - changed plugin API to expect gamedir-relative texturenames - - fixed gensurf to create faces/patches with gamedir-relative textures - -24/1/2002 - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=322 - added modelscale key check to misc_model entity in md3/entity module - added angle key check to eclassmodel class in md3/entity module - fixed bugs in BP writing and reading in map module - TTimo (commited as SPoG) - - fixing permissions on cvsreport and doxygen stuff, upgraded dot - -23/1/2002 - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=336 - plugin API bugfix - fixes textures on stuff created by plugins - ----- 1.2.1 was released here - -22/1/2002 - Gef - - linux build fixes - SCDS_reyalP - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=325 - wrong file packaged in setup - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=327 - fix to PCX loading - SPoG - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=298 - cut & paste bugfix - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=332 - update origin key on entities - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=333 - made fixedsize entities not scalable - -21/1/2002 - TTimo - - scanning in g_strAppPath/modules/ and plugins/ prior to g_strGameToolsPath - using the main path to put general plugins and modules - - fixed bobtoolz bug, init of epairs table was relying on wrong params - - fixed curry to compile again on 1.2 - - fixed pk3man to compile again on 1.2 - - updated IS setup: - installing the plugins with the core - installing the common modules in the core - - Compiling manual, more IS stuff, .xlink etc. - - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=315 - patches for improved multimonitor support (with some associated pref items) - - ydnar - - more q3map: http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=324 - - radiosity fixes (proper handling of ambient light) - - polygonoffset fixes - - lightmaps on patches work better (normal calcs adjusted, planar patches are - box projected like brush sides) - - double vfs init in bsp stage removed (this needs to be tested on Linux) - - lighting is faster again - - a couple crash bugs resolved - - other tasty nibbles - -20/1/2002 - EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=313 - detachable menus set as preference (in layout) - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=255 - path prompt - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=307 - patch dialog names - ETG & RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=306 - fix 'Natural' texturing crash - ETG & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=291 - found out the problem, Wolf SP spawn works now - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=144 - fixed more problems with model loading vfsExtractRelativePath - prolly broke the linux build, just a matter of putting a bunch of #idfdef - - fixed an additionnal .pid lock situation, cleaning the global prefs on game .pid lock - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=301 - fixed md3 tris test selection bug - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=219 - fixed bobtoolz for 1.2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=318 - filter structural - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=305 - filter in viewmenu for lightgrid brushes (ydnar's q3map) - fixes image lib loading bugs - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=298 - copy/clone deselects the copied stuff - added a pref to deselect or not, and to nudge pasted stuff or not - -19/1/2002 - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=311 - IEpair wrapper to access project entity from plugins - RR2DO2 - - missing IncRef in CShaderArray::AddSingle - TTimo - - game.xlink files in gametools path, is scanned to build items in the Help menu - (and the associated code) - -18/1/2002 - Gef / Michael Schlueter / TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=279 - patches 133 and 138 applied, new setup code - -14/1/2002 - TTimo - - adding djbob write access for bobtoolz - -13/1/2002 - ydnar - - q3map code updates 1.2.1-y8 - new lightgrid surface flag feature - lightgrid shader and editor image for Wolf and Q3/TA: in the common .pk3 and in all common.shader - cvs remove setup/data/baseq3/common-q3r.pk3 (unused, we use common-spog.pk3) - TTimo - - updating setup to use mapq3 module instead of map (both Wolf and Q3 game packs) - (also checked the lightgrid option) - - fixed setup.pl bug for template gen from WorkDir/ - - correct spawning between SP and MP mapping mode - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 - .pid check, console logging and prefs cleanup - Wolfen - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=294 - checked in updates to the manual links page and setup instructions - (i.e. new prefs dialog) - -12/1/2002 - Gef & Michael Schlueter - - bugs #295 and #279, new patches applied - EvilTypeGuy & djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=220 - patch selection crash - EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=260 - Dense and Very Dense Cylinders have wrong number of rows - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=292 - latching patch toolbar settings - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=144 - win32 long/short pathname bugs reappearing, switching back to short paths for project settings - - removed obsolete radiant/vfs.cpp radiant/vfs.h - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=291 - using new .qe4 for Wolf, fixed stuff editor side (long path names and engine spawn) - SCDS_reyalP - - http://zerowing.idsoftware.com/bugzilla/showattachment.cgi?attach_id=118 - realloc bug in terrain - -11/1/2002 - SPoG - - unpatched bug #239, unintended duplication of brushes, patch #96 - Note: bug #239 now unresolved - EvilTypeGuy - - bug #295 fixes for compile under Linux - -10/1/2002 - SPoG - - fixed CEntityEclassModel referencing eclass after eclass has been deleted - SPoG - map-module branch - - new map module, provides current functionality, using new map interface - - cleaned up merging/creating of entity array used by map module - - implemented MemStream::printf(const char,...) - can't print strings larger than 1024 currently - - changed copy/paste to use the map module, via abstraction of FileStream/MemStream as DataStream - - fixed Save Region and Save Selected - - new xml map module "mapxml" - - cleaned up map.cpp - -6/1/2002 - TTimo - - removed m_bPak from pref dialogs (it was dead code) - -5/1/2002 - RR2DO2 - - q3map terrain blending fix for >5 layers - EvilTypeGuy - - fs_homepath patch on linux - Gef - - bug #279, linux setup, patch #102 - - bug #239, unintended duplication of brushes, patch #96 - TTimo - - added Wolf specific project settings dialog: - correct fs_game selection and combo names - added multiplayer / single player mapping mode selection - -4/1/2002 - TTimo - - adding -game wolf switch to q3map (-game quake3 works too, but it's the default anyway) - using different bsp version and different fs_basegame on wolf - - updated the setup/win32/setup.pl script to generate from a config file instead of hardcoded - (added corresponding q3.cf wolf.cf and all.cf config files) - - added a default Start Menu shortcut name (RR2DO2 special) - - diffing against Id's internal SOS source and merging in new stuff: - - bumped MAX_SURFACE_INFO to 4096 in shaders.c - - new terrain code (Jim Dose) - ParseTerrain() addition in terrain.c - Creates a mapDrawSurface_t from the terrain text - - VL_SurfaceRadiosity and VL_SurfaceRadiosity - MrElusive's vlight radiosity code - - speedups to vis.c and visflow.c (MrElusive) - -3/1/2002 - TTimo - - merge gameselect branch back into trunk - the IS setup scripts have been updated for the new paths layout - developement environment needs to be updated to copy binaries to the right places for debug - it is recommended to run a 1.2.1 setup on win32 prior to compile and install debug bins - - updated the setup to be more templated for inclusion/non inclusion of game packs on demand - - - propagating recent fixes to Alpha into the trunk - based on diffing between Merge-1_1_1 and Merge-1_1_2: - ===================================================================== - 13/11/2001 - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=244 - reverted again the shader manual and tcMod docs - - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=214 - patched aselib.c, was calling strstr badly (relative path extraction) - - 12/11/2001 - djbob - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=241 - applied patch, will release in next nightly - - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=254 - patch for safe_malloc - - TTimo - - fixing STLPort config checks and XML config (CHAR -> xmlChar) - - added safe_malloc_info and safe_malloc in the common/ dir - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=179 - added XML stream version checking between Radiant and q3map - ======================================================================== - also, manual merge of docs/manual and setup media - this merge work is related to bug #280 too: - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=280 - - ydnar - - new q3map, radiosity and bug fixes, code merged in with the trunk version - (TODO: add more detailed changes log) - - EvilTypeGuy - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=274 - broken auto caulking fix - - EvilTypeGyu & LordHavoc - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=207 - (two new files, project settings updated) - -2/1/2002 - TTimo - branch gameselect - - copying over the linux setup binaries (setup, uninstall, setup.gtk) - from Alpha branch. Those have the ability to prompt destination path - per component. - Gef - branch gameselect - - patch 101 for bug 279 - .game files generation by the setup, makesdk.sh and postinstall.sh fixups - -1/1/2002 - Gef - branch gameselect - - linux source fix http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=279 - (we use PATH_MAX as the cross platform define instead of MAX_PATH which only works on win32) - - TTimo - branch gameselect - - cleanup and homogeneisation of the paths for prefs storage - m_global_rc_path: - win32: g_strAppPath - linux: ~/.radiant// - m_rc_path: - win32: g_strGameToolsPath - linux: ~/.radiant// - so that global.pref goes in ~/.radiant//global.pref - and radiant.ini ~/.radiant///radiant.ini - -27/12/2001 - TTimo - branch gameselect - - global prefs file (global.pref), XML based in core directory - stores game selection setting - stores autoload setting - - dropping 'gameid' from .game file, gonna use a 'gamefile' in global prefs instead - (and the .game file name .. thks Gef) - - TODO: radiant.log stuff in global prefs? - -21/12/2001 - TTimo - branch gameselect - - more Wolf setup tweaking for an experimental build release: - quakev2.qe4 project template file - using a 'gameid' attribute in the game file to select hardcoded features in the editor binary - 'basegame' node for lookup of the default project file - 'engine' node for engine path - - added experimental Wolf game pack to IS - - added setup/win32/HOWTO with extensive information about the procedure to - add new game packs - - reading the 'name' attribute in the game node for game selection dialog - - TODO: pid files to make safe startup? - The .pid stuff should be happening after game selection, since it covers game-specific - preference settings. - - TODO: console logging pref should be a global pref, goes with game autoload? - -17/12/2001 - TTimo - branch gameselect - - updating the setup script for experimental 1.2.0 setup: - - merged some of the docs back into trunk (Radiant manual, some TA docs) - will need to perform a complete diffing between Alpha and trunk about docs/manual at some point - merged bitmaps from Alpha too - - added the Q3 modules (image, map, md3model, shaders, vfspk3) to Q3 game pack in setup - - generating per-game config file q3.game in OnMoved (IS setup) - will need equivalent with linux setup of course - - various other generic fixes to the setup code - - - multiple games support, list of changes, and TODO: - NOTE: this is on a 'gameselect' branch for now - Doxygen documentation should be at http://zerowing.idsoftware.com/doxygen - for this branch too. - - The installation procedure has changed. The win32 installer is partly ready, linux installer - will need to be modified too. The editor binary and the Gtk DLLs are installed in a common - location, i.e. 'C:\Program Files\GtkRadiant' typically. The game specific binaries and modules - go in the same location as usual, for instance 'C:\Program Files\Quake III Arena\GtkRadiant\' - (and also 'C:\Program Files\Quake III Arena\GtkRadiant\modules' 'C:\<..>\plugins') - - The environment variables used by the build system (VC6 project files) have been adapted: - $(QUAKE3RADIANTDIR) is still used - $(CORERADIANTDIR) is used for the main editor location - - When editor starts, it looks for games/*.game under g_strAppPath and prompts the user for a game - Once game is selected, parameters are used for regular startup. - You need to write your own q3.game for now, it will be generated by the setup procedure - my C:\Program Files\GtkRadiant\games\q3.game looks like that: - - - - - - given that, the editor does a complete startup, and the basics are here for multiple games - - - precise changes: - - g_strToolsPath renamed to g_strGameToolsPath - most of former g_strAppPath uses g_strGameToolsPath - the name change was also meant for homogeneity with DIR_GAMETOOLS_* variables we use in the setups - g_strAppPath still used, points to the main installation path - - added the game selection code in CPrefsDlg::Init - using several classes and a dialog box, parsing XML files - - - TODO: - - the console 'Radiant.log' doesn't catch the game selection stuff as it is now - initialize it to the main install, without the game setting - (console logging is a debugging tool anyway, no reason it should go to the proper game folder - each time) - - the 'preferences reset/cleanup' code is probably broken, specially when used with the .pid checking - since we check for .pid even before we know where the GameTools path is - - on linux, we need to sanitize the ~/.q3a dir usage. Switch to ~/.radiant, use the version tag - to maintain things independant, and use the game name to isolate per-game settings? - ~/.radiant/1.2.0-nightly/quake3/radiant.ini (.pid, .log) - ~/.radiant/1.2.0-nightly/wolf/.. - - also, when looking for those files (.ini mostly), win32 stores them in a main installation, and - linux has them in ~/.radiant/.. (which is the read/write area). This should be homogenized? - Maybe by adding a 'Main' to the readonly path and a new variable with 'RW', pointing to 'Main' on - win32 and to ~/.radiant on linux - -11/12/2001 - TTimo - - replaced setup/win32/setup.sh by setup/win32/setup.pl - same functionality level + abiliy to generate back a template from a work version - - major rework on the IS scripts, basics of multiple games support installer - clean seperation between editor core and game pack - design doc and analysis of custom setup generation, setup script UI requierements - see setup/win32/TODO for more details - -10/12/2001 - TTimo - - new generation of InstallShield setup - using a template/ directory instead of a .zip file - requires rewrite of the processing script - allows easier maintenance of the IS script - -23/11/2001 - TTimo - - yet another update to cvsreport script, - catch the branch and forward the info to user commands too - able to build doxygen for several branches selectively now: - http://zerowing.idsoftware.com/doxygen - -22/11/2001 - TTimo - - new cvsreport script, should send explicit diff of the CHANGES file now - -03/12/2001 - TTimo - md3-module branch - - validated the fixes and the build on linux, ready to merge in trunk - SPoG - md3-module branch - - changed function naming conventions in mathlib for m4x4, ray, bbox, to be consistent - - fixed bug in m4x4_invert - -29/11/2001 - TTimo - md3-module branch - - flagged all new mathlib functions that need a name change or an argument order change - also added various \todo to point out inconsistencies - -28/11/2001 - TTimo - md3-module branch - - updated linux build - - fixed CEntityMiscModel and CEntityEclassModel destructors - (any destructor should be virtual) - -27/11/2001 - Spog - md3-module branch - - stopped texturewindow showing shaders without the "textures/" path - - made md3 module functionally identical to current radiant md3 code - -22/11/2001 - TTimo - md3-module branch - - fixes to the core for linux build - - model.so module builds on linux - - added plugins/md3model/doc/md3-design.txt - - several doxy-friendly \todo chunks about the module model - - Spog - md3-module branch - - fixed aabb_add_aabb() algorithm wasn't very reliable - - added VectorMid, VectorNegative and CrossProduct macros to mathlib - - added bbox_intersect_plane() - -21/11/2001 - Spog & TTimo - md3-module branch - - initial code from Spog following a preparatory design work - merging in as new 'md3-module' branch - geomlib code merged into mathlib - some reorganisation of the source layout and cleanup (more stuff in imodel.h, less in qertypes.h) - - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=261 - fix applied - -20/23/11/2001 - TTimo - - yet another update to cvsreport script, - catch the branch and forward the info to user commands too - able to build doxygen for several branches selectively now: - http://zerowing.idsoftware.com/doxygen - -22/11/2001 - TTimo - - new cvsreport script, should send explicit diff of the CHANGES file now - -11/2001 - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=253 - additional fixes - TTimo - - renamed tools/quake3/common/threads.h to qthreads.h - avoids a collision with system headers - -19/11/2001 - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=251 - Fixed "Move into worldspawn" deleting entities with only one brush - Fixed Brush_Move using texture lock on fixedsize entity brushes - Fixed Textures > Texture Lock > Rotations toggle checkbox - -16/11/2001 - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=247 - applied patch 77, using a notebook layout for preferences dialog - also patched in some preferences saving that had been forgotten - (such as invert mouse in freelook) - - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=253 - patch 84 + additional modifs, bug still open - -15/11/2001 - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=252 - rewritten rendering pipeline for cam window - fixes some hacks, improves speed, - makes rendering modes more consistent with each other - -07/11/2001 - TTimo - - more IMAP interface, adding a blind data void *pData to entity_t - more info about it and why it's done is in map.cpp, should be a small base for next additions to the editor - -31/10/2001 - TTimo - - using IDataStream in map module, moved back some of the module code into the trunk - -30/10/2001 - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=245 - applied patch 76 - - TTimo - - renaming istream.h to idatastream.h, this had nasty conflicts with OS includes - already had to IStream -> IDataStream some time ago anyway - -27/10/2001 - TTimo - - updated cvsreport, testing new ver - - added a static version of texdef (no memory alloc on the texture name) - unused for now, was just experimental - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=245 - applied patch 75 - -26/01/2001 - TTimo - - various updates: - new GtkSDK precompiled binaries - updated libxml2 package (to 2.4.3) - updated STLPort (to 4.5) - now compiling with STLPort and threading (since we are using threading throughout the app) - - exposing the data stream API to the modules, renamed some stuff on the way - need to update the map module to use it now - - cleanup on qtexture_t definition - guarding and disabling chunks of the surface plugin code behind DO_SURFACEPLUGIN - (see earlier patch on plugin entities) - -25/01/2001 - Hydra - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=202 - applied patch commenting out plugin entities code - might come back in 1.2 under another implementation - the code is still there, only commented out for now - -17/01/2001 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=93 - checking in doxygen content, setting up generation on zerowing - auto generation on zerowing upon a commit: - http://zerowing.idsoftware.com/doxygen - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=231 - checked in the patch - - switching to a new cvs commit script - -14/10/2001 - TTimo - - libs/mathlib library - unifies mathlib code squattered all over the tree - mainly a merge of tools math code and radiant/mathlib.cpp - C implementation, using an extern "C" construct for use from C++ - need to check on linux, win32 builds ok - extracted qboolean code into libs/bytebool.h on the way - -11/10/2001 - TTimo - merged TmpMerge-1_1_1 branch back in the trunk, the update process from Alpha 1.1.1 is done - - TTimo - branch TmpMerge-1_1_1 - looking through all remaining .rej files and applying the failed patches accordingly - bobtoolz is broken, but it's not due to the merge - the plugin API is different and some things need updated - (disabled bobtoolz build in contrib/Construct for now) - same for gensurf - same for prtview - same for textool - setup: replaced the existing stuff with 1.1.1 code - fixed various things for win32 build, checked correct CRT lib config - -10/10/2001 - TTimo - branch TmpMerge-1_1_1 - building modules, going through all the .rej - merging radiant/missing.h and modules/shaders/missing.h into a single one, moving to libs/ - exposing BuildShaderList PreloadShaders in _QERAppShadersTable - have to review all the remaining .rej to finalize the merge now - -04/10/2001 - TTimo - branch TmpMerge-1_1_1 - using this branch as temporary location for merge process - copied over new binary files. mostly .dsp (prolly broken) - and setup/linux/setup.data stuff - -25/08/2001 - TTimo - map module successfully loaded and saved q3dm1, the saved file was then loaded back into 1.1-TA without problems - rebuilt and checked on win32 - merged IMap back in trunk, fixed some memory conflicts on win32 - Took me a lot more time than I would have liked to, but there's a script tied to the CVS server now, which will post on this list a diff of the docs/developer/CHANGES file whenever it gets updated. This will probably be very handy for me since I'll only have to put update information in the CHANGES file instead of having to post on the list too. - The script is likely to be a bit laggy, or miss some features (for instance I'd like to extract the branch name .. anyone know how I can get the branch name (Alpha/IMap/HEAD) from the version number? - PS: I can email this script to anyone who would like to have a look - -22/08/2001 - TTimo - did more work on map module, one big chunk of work left: the core should broadcast interface requests to plugins - when it doesn't know how to do it by itself.. - Gef - new doxygen patch, generates output from core (libs/ include/ and radiant/) - -21/08/2001 - TTimo - removed Makefile, use cons damnit! - -18/08/2001 - Gef - automated documentation via doxygen, new scripts and content - -18/08/2001 - EvilTypeGuy - patch for CHAR to xmlChar conversion (xml2 consistency) - -09/08/2001 - TTimo - the map module starts to look like something, cleaned up the interface stuff - started moving the actual code out in the module and removing it from the core - lots of issues raised on the way, some structures to export, and the macro scheme to access API functions more easily - it compiles right now, but won't run because it's missing a lot of things .. the process simply happens to be "under way" - -04/08/2001 - TTimo - patched more path code, to look for stuff in "bitmaps/" and "modules/" instead of "tools/bitmaps" and "tools/modules" - modified the Construct files accordingly - merged in radiant/ishaders.cpp diff into plugins/shaders/shaders.cpp (PreloadShaders) - merged in radiant/lbmlib.cpp diff into plugins/images/lbmlib.cpp (Sys_FPrintf) - checked the .rej and patched a few remaining things - NOTE - the diffs are space/tab sensisitive, and we used the "beautify source" a bunch of times, so it's a bit fucked now - next time, generate the diffs not space sensitive.. - TODO - map loading is fucked, "textures/" prefix issue? - -27/07/2001 - TTimo - merging recent changes from Alpha branch into the Trunk - this could not be done with a regular cvs merge because we already did a cvs merge of Alpha into trunk some time ago - manually built a diff between the current Alpha (now tagged Merge-1_1-TA_1-nightly) - and the Alpha we had right after the former cvs merge: -r Alpha -D 2000-05-28 - binary files ignored in the diff, only going for source stuff - built with diff -Nru Reference/ Current/ - then patch -p1 < patchfile - next, started rebuilding: - big manual updates were in vfs.cpp and texwindow.cpp - cleaned up some VFS stuff .. it had an absurd QERAppFileSystem / QERPlugFileSystem scheme - TODO: - the ISSetup has not been copied over from Alpha - OK check the Construct files - OK radiant/ishaders.cpp no longer exists .. apply the patch on the shader module - OK radiant/lbmlib.cpp no longer exists .. in the image code? - OK look at the *.rej files - -03/10/2001 - TTimo - - adding a pref to select patches by BBox, fixes - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=212 - -02/10/2001 - TTimo - - reverting Spog patch 67 to bug #209, starting from scratch - applied again, with HasModel returning NULL safe checks - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=211 - fixed overlays drawing (XY and Cam) - -01/10/2001 - TTimo - - building and distributing q3data (.ase -> .md3 conversion utility) - updated q3data to show main GtkRadiant version information and build date - - generating a new GUID per-setup - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=206 - Gef - - updated credits.html and links.htm, look much better - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=200 - - update Z-checker view on camera up and down - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=199 - Spog - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=209 - Fixed QERApp_ReloadShaders.. PreloadShaders needs a BuildShaderList call - Fixed Flush & Reload Shaders for md3 models - -25/09/2001 - Gef / djbob - - several patches to the key handling code, for linux specific issues and sticky keys - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=191 - TTimo - - fixing q3map bug, not processing the argv correctly - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=192 - - fixed ToggleCubicClip shortcut Ctrl+\ (win32 Gtk source patch) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=15 - -18/09/2001 - RR2DO2 - - discreet movement for camera (prefs setting) - fixes texture window bug - latching view layout changes until restart - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - djbob - - added back "view > show > show angles" in view filters - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=188 - -15/09/2001 - G_Dewan - - fixed problems with q3map when not using -connect - SPoG - - fixed q3map texture projection for brushes belonging to entities with local origin - - added SafeOpenRead() check, terminating map->bsp stage if .map file cannot be read - -13/09/2001 - RR2DO2 - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=181 - fixing key handling bug (key pressed with repetition was not properly catched) - TTimo - - added new Radiant manual elements (GtkRad section) to the win32 full setup - - reverting version to nightly, going back to nightly / RC delayed - - patched linux setup, now prompting for component path only if at least - one of the options is checked. Still need to handle Cancel in dialog though. - -12/09/2001 - TTimo - - more fixes to linux script, copy plugins right now - -10/09/2001 - TTimo - - patched contrib plugins, using seperate build scheme - - fixed textool issues, compiles again - -09/09/2001 - TTimo - - sub-menu cascading - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=178 - - udpated the Q3Radiant manual with some new GtkRadiant stuff - - updated the FAQ with 1.1.1 known issues - Gef - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=174 - applied all the patches - -07/09/2001 - SPoG - - fixed qer_editorimages outside "textures/" being ignored - - stopped q3map_lightimage being used to set shader image dimensions - - changed bsp menu to remove "bsp_", changed menu text in default .qe4 - - fixed patch LOD update - now always occurs on both cam/xy draw - - djbob - - dynamic DEpair class strings in bobtoolz - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=171 - - decrease VESF verbosity - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=169 - - TTimo - - fixed Gtk keyboard bug Ctrl + [ and ] - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=15 - -06/09/2001 - TTimo - - merged FullSetup branch into the trunk, we have basic functionality - for a full linux setup (components prompting for path) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=158 - - Gef - - CapDialog source cleanup patch (got rid of the namespace) - - RR2DO2 - - more camera fixes, wheel mouse and texture drag drop - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - - additionnal patch to optimize camera refreshes - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - - djbob - - remember last key/pair in entity dialog for easy "apply again" - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=18 - - re-enabled texture name edit on PI - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=18 - -04/09/2001 - djbob - - left pane on status bar - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=166 - - RR2DO2 - - cam window cursor fix - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - - TTimo (FullSetup branch) - patched setupdb and setup to allow for path prompt in install - modified the setup script scheme to go towards a solution similar to what - we do under win32 (build a full and nightly build) - the binaries in setup.data/ (setup and setup.gtk) still need to be updated - with proper binaries built from setup and setupdb cvs source - -03/09/2001 - TTimo - - wheel mouse in texture window on win32 (with a pref setting for increment) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=160 - - not saving prefs while exit on sleep - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=157 - - fixed select all of type (changed behaviour to something that makes more sense?) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=79 - - Gef - - final tweaks to wheel mouse scrolling (locks texwin scrolling and scrollbar update) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=160 - - prevent multiple color selection dialog for light entity - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=165 - - djbob & TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=137 - window positions - applied patch to store SI and PI positions - storing entity info and map info positions - reworked the overall position load/save scheme - added an enum for the view style, makes things more readable - -02/09/2001 - TTimo - - added/cleanup ToggleFreeMode to camwindow.cpp .. stopped working on cam stuff since RR2DO2 has another patch in preparation - Gef - - patched Conscript to accept 'cons -- release' on the command line to performa a release build - djbob - - added patch splitting to bobtoolz - - fix to patch control points bug in camera - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=159 - - handling of NWUV errors in q3map - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=147 - RR2DO2 - - new patch for camera control - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - -01/09/2001 - SPoG - - Fixed .wal texture support, searches for .wal extension if .tga and .jpg fail - NOTE: requires a "pics/colormap.pcx" file to obtain a palette from - - Added variable default texture scale in preferences (ini key: TextureDefaultScale) - -01/09/2001 - djbob - - fixed surface inspector "fit" bug - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=161 - - single face deselection on a selected brush - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=153 - -31/08/2001 - TTimo - - Moved *.def files to scripts/ in win32 setup - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=116 - - Applied patch for background position on widgets (win32) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=108 - - Checked C runtime lib configs - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=135 - - updating docs (add to CVS, update setups etc.) - added TA teams manual to the full setup - uploaded on web site - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=97 - - changed versioning to 1.1.1-nightly, next release will be 1.1.1 - (the -TA part was removed, since we now support ALL mods) - - removed AFX_MANAGE_STATE calls, this is old MFC related code for win32 - - moved texdef_t::name to private, added const char * GetName() - (doesn't fix explosion on exit for win32 debug builds though) - - fixed DoTextEdit / EditPad b0rkage (due to recent Q_Exec changes) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=134 - - added targetShaderName documentation to shader manual - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=102 - - added "notta" and "notq3a" documentation to the TA Mapping manual - - fixed entities.def on shootable doors and buttons - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=101 - - djbob - - added MAX_POINT_ON_WINDING error handling - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=129 - - bobtoolz update - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=123 - - RR2DO2 - - noclip-type camera movement - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 - -30/08/2001 - TTimo - - Fixed CHANGES commit script bug - - Fixed -onlyents bug in q3map / origin brushes - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=92 - - added mouse wheel to the texture window - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=81 - SPoG - - Fixed texture rotation not updating correctly on patches - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=136 - - Fixed long delay on toggling cubic clip by removing call to Map_BuildBrushData() - - Added note in entities.def for default worldspawn _color value - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=105 - - Added IncRef and DecRef to Patch_FindReplaceTexture() - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=95 - - Fixed misc_model updating on changing model key or with invalid model - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=138 - -30/08/2001 - SPoG - - Added negative vertical scale on SET and FIT in patch/surface inspector - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=65 - -27/08/2001 - Gef - - running makeversion.sh from Conscript - - a bunch of patches to cleanup compile warnings on linux - - added VectorSnap on float grid - - IWindowListener modified to pass float values for X Y in click messages - TTimo - - fixed crash when adding a misc_model if Gtk dialog is on - djbob - - md3 filtering for misc_model dialog - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=76 - -26/08/2001 - Gef - fixed http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=152 - Kyro II GL drivers bug - fixed http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=150 - using a scrolling textbox for GL extensions in the about list - fixed http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=150 - func_group toggle in cap dialog - - TTimo - fixed running BSP commands on linux - fixed http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=133 - VFS init on linux - -around 15/08/2001 - TTimo - quakecon fixes: switched to long filenames in project and misc_model dialogs, - removed all occurences of win32 conversion to old 8.3 filenames - NOTE: this might raise some bugs and issues, but it's the way to go for the future, - already fixes more issues than it creates - -03/08/2001 - djbob - fixed Radiant hijacks win32 copy/paste - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=36 - ---- merged Alpha into Trunk, see Merge-1_1-TA-nightly tag - -25/07/2001 - TTimo - fixed project dialog to behave right - proper .def scanning - fixed shader loading with VFS and mod stuff - added a local to texwindow.cpp GSList *l_shaderfiles - holds the names of the active .shader files - modified q3map to read "fs_basepath" and "fs_game" - TODO: - .def files in the media need to move to /scripts/ - rename entities-TA.def to entities-ta.def - -24/07/2001 - TTimo - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=116 - updated cmdlib's Q_Exec to be more widely used through Radiant (during watchbsp.cpp cleanup) - patching in MarsMattel's code for mod support, and started fixing: - added m_strFSBasePath m_strFSMain m_strFSGame to g_qeglobals to match Q3's filesystem - reworked the project file dialog - changed the way we load and initialize eclass and shaders to work with mod code - updated VFS initialisation code, cleaner and better console output - the "game" key in the project file is no longer relevant, only "dir" is - (if "dir" is not present, then no mod support, vanilla Q3) - changed the loading of the .def files to scan in scripts/, you might need to move your entites.def to use - TODO: - cleanup .. (search where "basepath" is used for instance) - using fs_game when calling q3map - fixing project dialog to behave right - shader loading using VFS functions (seems to work again but I'm not sure) - win32 ver. might be slightly broken - .def scanning, don't scan ALL .def - -23/07/2001 - TTimo - added version and build info to the log file + current timestamp - -22/07/2001 - SPoG - fixed selection of misc_model when viewed as a bounding box - -20/07/2001 - TTimo - cons script for q3map building - added general GtkRadiant versioning (version.h) to q3map - nightly setup on linux: - using the right install path (with GtkRadiant's version name) - cleaned up options to only the stuff relevant to nightly - fixed Radiant and core binaries path in setup - added some template processing of setup.xml (similar to what is being done on win32) - -19/07/2001 - TTimo - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=112 - applied ^Fishman's path - inclusion of version.h and aboutmsg.h moved to qe3.h - changed base path location process (in most cases it will prompt) - fixed the path construction to initialize according to the new layout - -16/07/2001 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=115 - fixed wake up crash on linux - -12/07/2001 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=117 - fixed - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=120 - fixed installer bug on win98, was a problem with cygwin config - -11/07/2001 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=64 - cleanup and fixed - -06/07/2001 - TTimo - - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=100 - can't locate the "textures: in use" problem, has been fixed already? - now selecting the right entity in the list, had to go around an inifinite recursion problem - (i.e. selection message in the entity class list causes UpdateSel recursion) - -04/07/2001 - TTimo - - added botclip to missionpack/common.shader - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=114 - -01/07/2001 - TTimo - - backported cons scripts to Alpha branch. Type 'cons' at the head to build - regular makefiles should soon be outdated.. - -30/06/2001 - TTimo - - updated the IS script (Gtk changes and and BACK problem) - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=68 - - bunch of fixed to make it build on win32 against new STLPort - http://zerowing.idsoftware.com/STLPort/ - using an STLPort configured locally in GtkRadiant (with stl_config.h, new file) - -29/06/2001 - TTimo - - fixed GDI leak affecting text widgets, specially the console and the entity inspector - -18/06/2001 - TTimo - - more win32 project file cleanup, removing libs/libxml2 from the tree - - importing back "gtkr_list.h" from 1.2, made Alpha branch STLport compliant too - http://www.qeradiant.com/faq/fom-serve/cache/174.html - -30/05/2001 - TTimo - - added libxml2 as an external dependency. libxml2 should be installed as a seperate - directory on win32. dynamic linking now instead of static previously. - - cleaned up q3map win32 project file, removed opengl dependency - (the drawflag command line is inoperant now .. I don't think it was used anyway?) - -26/07/2001 - TTimo - - checking in Gef's doxygen files - -14/06/2001 - TTimo - - added .dsp for map module on win32 - - fixed several issues with module loading, stability of the debug and release builds - http://www.qeradiant.com/faq/index.cgi?file=197 - -12/06/2001 - TTimo - - got rid of of SysMsg thing, using SysPrintf and SysFPrintf now - - got rid of InfoMsg functions (can't remember what it was) - - changed the m_pfnError in the plugin API to match Radiant's (void)(char *, ...) - - changed Warning to Sys_Warning, as #define to Sys_FPrintf(SYS_WRN, - -11/06/2001 - TTimo - - new map module, in plugins/map, required for execution (linux Makefiles written, win32 needs to be) - this is using the imap.h interface - - added Sys_ functions to the main table (Sys_BeginWait Sys_EndWait) - - got rid of AFX_MANAGE_STATE macros .. those are crappy MFC remnants - - reverted Spog's changes to the console logging switches to their original behaviour - - removed m_fVersion from the func table .. we use the size of the table to do the checks - XMLmap merge from 31/11/2000: - - started moving the map loading code into a module - -08/06/2001 - TTimo - - updates to the plugin loading code, verbose a bit more, and more interesting information - -05/06/2001 - TTimo - - some fixes to vfspk3 string code, using the proper str implementation - http://www.qeradiant.com/faq/index.cgi?file=175 - - added and tweaked various cons build files, Radiant 1.2 core and required Q3 modules are building now - - fixes to image module - -04/06/2001 - TTimo - - started using cons for the linux (*NIX) build system - see http://www.dsmit.com/cons/ - - SPoG - - Fixed drawing too much coordinate text in XY window - - Changed grid line drawing in XY window to be more consistent - - Fixed clipper-tool-uses-caulk to only apply common/caulk to solid opaque brushes - (shaders.dll now parses some new surfaceparms) - - Changed shader parsing to pass over layer information in shaders, - rather than parsing and ignoring it all - - Changed misc_model selection to ignore back-facing triangles - - Added axes to show the grid origin in XY window - - Changed misc_model rendering and selection to minimise the number of extra - transformation calculations - - Fixed texture directory listing to allocate and free memory correctly using vfs - - Added qglDeleteTextures() to plugin GL API - fixes crash - - Fixed image.dll to correctly allocate and free memory for jpgs - - Moved modules to /modules from /plugins, updated win32 project files. - (linux/mac makefiles will need to be updated) - - Changed console logging toggle in main() to automatically disable logging after any successful startup - - Changed console logging to only activate when a Release build finds a .pid file - - Changed "found .pid" and "logging console output" messageboxes to give a clearer message - - Added vfsFreeFile - which is kinda redundant if we use g_free and g_malloc for everything - -31/05/2001 - TTimo - - cleanup of the win32 project file and C++ options.\ - Turned off exception handling, changed some code generation options and fixed - some threaded/non-threaded linking problems - - STL in GtkRadiant or a plugin must now use STLPort - a custom configured version of STLPort is available at http://zerowing.idsoftware.com/STLPort - still need to write some guidelines about it - bascially, we are using STL: iostreams disabled, no namespace, no threading, no exceptions - -30/05/2001 - TTimo - - removed libxml2 from tree, use a seperate libxml2/ directory next to GtkRadiant/ for win32 - libxml2 will be distributed seperately as an archive based on official release (same as win32 Gtk SDK) - (check on zerowing for the latest archive) - libxml2 is now used as dynamic shared object on win32, makes sense since many module will rely on it - - cleaned q3map, removed GL dependencies - - updated Debug and Release builds on win32, it compiles and runs now - -28/05/2001 - Spog - - moved vfsExtractRelativePath and vfsGetFullPath to vfs.cpp in vfspk3, - added vfsExtractRelativePath and vfsGetFullPath to IFileSystem. Copied BuildShortPathName() from qe3.cpp to vfs.cpp as a Temp fix. - - Changed Error() calls in bmp.cpp as a Temp fix, they relied on definition of Error in qe3.cpp. Should probably use Error() from cmdlib instead. - - Fixed unresolved external in jpgload.obj - merged bufsize argument into jpeg_stdio_src from Alpha branch... assuming Alpha is the newer version. - - Changed GtkWidget* to void* in image.cpp.. this could be cleaned up more.. i only did enough to make it compile. - - Added jpeg.cpp to msvc project for image.dll.. changed declaraction of LoadJPG() in image.cpp to an extern... is this correct? - - TODO: update vfs.cpp, vfspak.cpp and vfs.h in plugins/vfspak - - fixed unresolved external load_pixmap() - merged load_pixmap declaration from Alpha branch into gtkmisc.cpp - - moved vfsBasePromptPath() to qe3.cpp as a Temp fix - not currently required in vfs module, but it will be in future. - - two calls to free() in texwindow.cpp freeing memory allocated by vfs module, causing debug assert errors - changed them to g_free() - - TODO: Delete vfs.cpp and vfs.h from /radiant - TTimo - - additional fixes after Spog's merge (linux version), removed messaging.cpp messaging.h (name changed to ui.h ui.cpp) - updated linux makefile accordingly - - merge of Alpha version into trunk (massive amount of changes and merges, not detailed) - -25/05/2001 - TTimo (Alpha branch) - - merged the recent MacOS branch back into Alpha - this makes a potential source codebase for a MacOS release - -24/05/2001 - TTimo (Alpha branch) - - patching Spog's recent changes to fix linux build - using DBL_MAX and FLT_MAX from for float and double max - -23/05/2001 - TTimo (Alpha branch) - - testing Spog's write access - - SPoG (Alpha branch) - - Added variable LOD for PatchMeshes based on curvature - - Added LOD-matching to eliminate gaps between patches with mismatched LOD - - Fixed texture shift/scale on LOD'd PatchMeshes - - Added opengl lighting (three infinite light sources) - - Added dynamically calculating vertex normals for PatchMeshes, for gl lighting - - Added decoding/transforming md3 vertex normals for gl lighting - - Changed camera drawing routine to minimise gl state changes - - Removed Patch_InsertDelete() - not functional - - Added CV lattice to selected patches - - Added Per-polygon patch selection - - Added Per-polygon misc_model selection - - Changed default "patch subdivisions" to 4 - - Rewrote camwindow drawing to only change opengl state within the camwnd's member functions - fixes all rendering modes to be more consistent, speeds up rendering - ---------- GtkRadiant 1.1-TA win32 and linux release ---------- - -13/05/2001 - - Spog (patched in TTimo) (Alpha branch) - - Fixed "Fix entity-target/targetname collisions" to use next available tN if tN, else use next available name_N - - Changed patch point selection to pick already-selected points in preference over non-selected - - Changed RemoveCols and RemoveRows to not extrapolate unless a col/row is selected - -11/05/2001 - TTimo (Alpha branch) - - final fix pass to the generated version and about message tags - - improved texture adjustment code (shift+arrows shortcuts) - - texture adjustment commands now affect the texture relatively to their current orientation - they will move along their texture axis, and not along world axis - the texture adjustment commands are now interpreted to be more intuitive: - Radiant will match the up/down/right/left translation messages to the face that is affected - depending on the way the camera is looking at the face, the right move commands will be used - - changes start in Select_ShiftTexture, using new ShiftTextureRelative_Camera - - ShiftTextureRelative_Camera uses several new functions: - - // get the two relative texture axes for the current texturing - BrushPrimit_GetRelativeAxes(f, vecS, vecT); - - MatchViewAxes does the matching between up/down/left/right commands and world directions: - // vec defines a direction in geometric space and P an origin point - // the user is interacting from the camera view - // (for example with texture adjustment shortcuts) - // and intuitively if he hits left / right / up / down - // what happens in geometric space should match the left/right/up/down move in camera space - // axis = 0: vec is along left/right - // axis = 1: vec is along up/down - // sgn = +1: same directions - // sgn = -1: opposite directions - // Implementation: - // typical use case is giving a face center and a normalized vector - // 1) compute start and endpoint, project them in camera view, get the direction - // depending on the situation, we might bump into precision issues with that - // 2) possible to compute the projected direction independently? - // this solution would be better but right now I don't see how to do it.. - void CamWnd::MatchViewAxes(const vec3_t P, const vec3_t vec, int &axis, float &sgn) - - // shift a texture (texture adjustments) along it's current texture axes - // x and y are geometric values, which we must compute as ST increments - // this depends on the texture size and the pixel/texel ratio - void ShiftTextureRelative_BrushPrimit( face_t *f, float x, float y) - - those functions are using various new utility functions: - - // GL matrix product - void GLMatMul(vec_t M[4][4], vec_t A[4], vec_t B[4]); - - // project a 3D point onto the camera space - // we use the GL viewing matrixes - // this is the implementation of a glu function (I realized that afterwards): gluProject - void CamWnd::ProjectCamera(const vec3_t A, vec_t B[2]) - - - UI abstraction layer (interfaces for Gtk MFC and Q3 UI) - -09/05/2001 - Maj (Alpha branch) - - new splash screen - - Spog (patched in by TTimo) (Alpha branch) - - patcing in changes: - - moving void VectorSnap(vec3_t point, int snap); to mathlib - - NOTE: STL dependency removed .. leaving this comment - this will rely on M$ implementation of STL on win32 and the libstdc++ for linux - it should work fine for basic stuff - but M$ implementation doesn't follow the standards when it comes to advanced stuff - it is probably better to leave the STL header in local files and not go towards including it directly from qe3.h - - Spog's Changelog: - - rushing this a bit.. make sure you check it doesn't remove anything you - changed. This only contains changes within /radiant .. i'm pretty sure I didn't - change anything else, but i'll check again. Patch below. - - Fixed ctrl+G SnapToGrid, now never creates degenerate face-planes - Fixed setting an origin for multiple brushes to use origin point of fixedsize - entities - Fixed mirroring and rotation of fixedsize entities including misc_model - Fixed undo/redo on multiple entities to link brushes to entities correctly - Fixed "view > entities as.." menu to display correct default setting - Fixed "view > entities as.." toolbar button to show menu - Changed selection-area of edge/vertex control handles to stay constant when - zoomed - Fixed undo on ctrl+G SnapToGrid - Fixed Selection Invert to set bSelected correctly on patches - Fixed XY-window Z selection origin to be g_MaxWorldCoord - Changed RotateIcon to draw same size at all zoom levels - - Fixed origin drift on saving misc_model with null md3Class - Fixed creation of cap for 'Bevel' type patches - Fixed inverted cap being created for 'Endcap' type patches - Fixed inverting patches on mirror operations - Added snap-selected-to-grid affects only the patch points selected - Cleaned up Select_ApplyMatrix and Select_SnapToGrid - Added drawing of brush planepts in debug build - Fixed texture quality slider adjustment - Removed redundant menu items curve > cap > inverted bevel/inverted endcap - Fixed texture scrolling not working when scrollbar is disabled - Fixed textures with odd dimensions being skewed with texture quality less than - max - Changed Patch Inspector Horizontal/Vertical increment to use pixel values - (default 8) - Changed Patch Inspector Horizontal increment to subtract from S values but not - T values - Changed Patch Inspector Stretch spinner to do something useful - Changed Patch Inspector Stretch default amount to 0.5 - Changed Arbitrary Rotation dialog to reset rotation spinner values to 0 on Apply - !! stops output in console window !! - Added sending q3map output - to /temp/junk.txt to bsp commands, in win32 only - Fixed Patch_Naturalize to calculate T values backwards, correcting texture - vertical flip - Changed patch row/column Insert/Remove to interpolate/extrapolate from existing - curves - Fixed point selection on patches when new points are added - Fixed redundant edge/vertex handles being created for patch brushes and - fixedsize brushes - Fixed refusal to activate brush vertex-drag mode if any patches are selected - Partly fixed Undo picking up patch point drags when no points are selected - Fixed behaviour of vertex selection on patches - Fixed patch point colours in textured mode in cam window - Changed patch point selection to update selection pool on each selection click - -06/05/2001 - TTimo (Alpha branch) - - more setup script changes, will rely on version information - various other fixes in the script file - -02/05/2001 - TTimo (Alpha branch) - - added makeversion.sh to the root, will generate version and date files before compilation - version.h and date.h - - cleanup and fixes to the linux setup scripts - - Spog (CVS add and config by TTimo) (Alpha branch) - - win32 setup script, run setup/setup.sh from cygwin to create a working directory for the setup - -01/05/2001 - TTimo (Alpha branch) - - fixes to linux version from previous set of patches - -19/04/2001 - Hydra (patched in TTimo) (Alpha branch) - http://fenris.lokigames.com/show_bug.cgi?id=3458 : - - *.pfb filter - - SpoG (patched in TTimo) (Alpha branch) - - updated setup data: entities.def common.shader(Q3) and common-spog.pk3 - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=25 : - - Patches: Curve > matrix > redisperse > rows/columns - I changed this function to treat a patch as multiple 3by3 sections when doing - redispersal of control points. The effect is that green patch points are never - moved. I also removed the call to Patch_Naturalize, so the texture coordinates - are not changed (user can hit ctrl+n to naturalize afterwards if desired). - - rewrote the patch_captexture function to be more reliable - - Fixed YZ view drawing and selection being mirrored on plane X=0 - - Fixed X and Z rotation direction to be clockwise as shown on the toolbar button - icons - http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8 : - - Fixed: Removed orientation-switching hack to fix 2pt-clip orientation problems, - originally stemming from ass-backwards representation of grid axes. Fixed - clipper to generate 3rd clip point correctly for each axis instead. - - Fixed: Stopped clipper-caulker from NOT applying caulk if the first face of a - brush was "common/caulk". - - TTimo (Alpha branch) - - removed some unused code in the Gtk file dialog, hopefully stabilizing it - -02/04/2001 - TTimo (Alpha branch) - - changed the regular/BP conversion prompt - -01/04/2001 - Spog (patched in by TTimo) (Alpha branch) - - Fixed view > show coordinates now affects Z window - - Fixed minimum/maximum world coordinates now -65536/65536 - - Fixed view > show blocks now only draws vertical lines if not XY view - - Added variable blocksize (gtkr only displays 1024 < blocksize < 65536) - - Changed XY/Z window grid drawing to use floats internally - - Fixed broken XY window grid drawing for higher zoom levels - - Changed camera and Z-checker icons to stay the same size when zoom level changes - -24/03/2001 - Spog (patched in by TTimo) (Alpha branch) - - added filters.cpp to the VC6 Makefile. Linux build needs updating - - Changed Filter system to use brush-flags updated only on actions that affect filtering - - Changed Filter system to allow further extension and future customisation - - Changed show/hide to use brush filter flags - - Changed Find/Replace textures to only rebuild brushes that changed. - - Changed View > Filter menu shortcuts and behaviour - - Fixed various minor spelling errors - - TTimo (Alpha branch) - - Fixed the 'Clean' command in preferences, used to remove only Radiant.ini and not SavedInfo.bin - -06/03/2001 - TTimo (Alpha branch) - - better parse error information: added the line number of the error in (hopefully) all cases - -30/02/2001 - TTimo (Alpha branch) - - texture locking in BP mode for axis flipping and axis rotation (toolbar buttons) (Id bugfix request) - - fixed undo in BP mode - - MatchToken error message in q3map improved with the script name - -27/02/2001 - TTimo (Alpha branch) - - switched linux makefiles to xml2-config instead of xml-config - latest version of libxml2 is using xml2-config instead of xml-config now - -26/02/2001 - TTimo (Alpha branch) - - fixed a loki_initpath misbehaviour, was overriding the path to the binary with RADIANT_DATA if defined - -21/02/2001 - - Added setup data and a script to build linux setups to the cvs - TTimo (Alpha branch) - - various printf -> Sys_Printf - - added vslick/ directory for Visual Slickedit 6.0 on win32 <- THIS IDE RULES - -20/02/2001 - - Removed "Show Paths" option, already in the filter menu - -19/02/2001 - - Fixed the Enter key handling on the surface inspector (suggested by Spog) - - Fixed skewed textures with lower texture quality - - Changed the order the include directories are searched under Linux - -15/02/2001 - - Moved the Show Cluster Portals option to the Filter menu - - Fixed the rotate and scale toolbar buttons being incorrectly checked - - Fixed arbitrary rotation bug (#3073) - -14/02/2001 - - Fixed CreateFont memory leak on glwidget - -12/02/2001 - TTimo (Alpha branch) - - fixed save as prefab stuff (right dialog name and overwrite prompt) - -10/02/2001 - TTimo (Alpha branch) - - was crashing on win32 boxes where HOME env var was not defined (loading bookmarks) - -09/02/2001 - TTimo (Alpha branch) - - change some code in the file dialog to use g_malloc g_free instead of new - for win32 file dialog and malloc for Gtk file dialog. (all of this trying to get rid of - some of the crashes) - -07/02/2001 - - Fixed Load command initial path - - Fixed some toolbar buttons not being correctly initialized - ------------? - -06/02/2001 - (Alpha branch) - - Fixed pk3man file dialog errors - - New RC uploaded - - Changed conflicting shortcuts: FilterModels = Shift+M, FilterTriggers = Ctrl+Shift+T - TTimo (Alpha branch) - - fix to hide/show, still selecting hidden brushes - -05/02/2001 - (Alpha branch) - - Fixed compile errors (use stat, not _stat) - - Removed --nofonts option - -04/02/2001 - TTimo (Alpha branch) - - fenris #2866, added a pref to turn on/off name conflicts resolution, rewrote the whole algorithm - - fenris #2823, fixed patch and brush dragging in 0.25 0.5 grids (it's an ugly hack btw) - - fixed the black squares at end of line in Gtk text boxes - RR2DO2 (Alpha branch) - - fix to the "entitypath" fixup in QE_CheckProject. might not compile on linux yet (use of _stat?) - -03/02/2001 - TTimo (Alpha branch) - - fenris #2867, limiting the amount of "spawnflags" "0" appearing in entities. This bug has work left to do, - there are some oddities in the entity inspector behavior described. - -02/02/2001 - (Alpha branch) - - Fixed sleep mode not restoring windows correctly - - Fixed some minimize/restore issues on floating views mode - TTimo (Alpha branch) - - fixed more gtkfilesel stuff. pattern filtering works for both Gtk dialogs - and win32 native. Also checked on linux that it compiles. Renamed gtkfilesel.h - to gtkfilesel-linux.h for consistency. - -31/01/2001 - (Alpha branch) - - New file selection widget with filtering, masks and all other shit we need - TTimo (Alpha branch) - - changed some gtkfilesel API and fixed some bugs on pattern filtering, need to reboot on linux and fix some more - -30/01/2001 - (Alpha branch) - - Added an option to keep the Z and XY views on the same window in floating views mode - - Did some cleanup - TTimo (Alpha branch) - - removed the 3 layers in terrain entities limitation, increase version tag to patchlevel 3 - sent for testing to AstroCreep, bug is still there - - fixed one more thing with RC file (get it in the right dir) - - worked on file dialog and pattern filtering, still issues left - -29/01/2001 - Jonas (patched in by TTimo) (Alpha branch) - - Using RC file to tweak the font size on win32, looks much nicer now! - - Fixed fenris #2773: esc key behaviour when group window has focus / dependant on view modes - -28/01/2001 - TTimo (Alpha branch) - - Finished fenris #2810 (Snap T to grid), it was a bitch - - Fixed fenris #2769: raise the brush max size (it was already big, now it's just not sane) - - Fixed fenris #2965: eclass (entities) loading code broken, needs to be checked on linux build before closing - -27/01/2001 - TTimo (Alpha branch) - - Fixed vertex edit prefs broken - - more fixes in Gtk libs - - Fixed clipping + brush primitives bug (#2644) - - Fixed clip caulk related issues (#2912) - - Added Snap T to grid back (#2810) <- still need to test and validate it, I'm too tired tonight - -25/01/2001 - TTimo (Alpha branch) - - New Gtk file selection dialog seems stabilized, built a Gtk SDK for the new Gtk libs. - -24/01/2001 - (Alpha branch) - - Fixed elapsed time displayed by q3map - - Fixed Radiant loading some TGA files upside down - TTimo (Alpha branch) - - more work done on the file selector. Added a win32 pref to select between regular win32 file dialog and Gtk one. - The advanced file selector is still not stabilized on win32. I am thinking about letting go and sticking to the regular one. - -23/01/2001 - (Alpha branch) - - Fixed q3map not finding md3 files under missionpack/ - - Prompt to save changes when choosing a recent file - - Fixed window title when choosing File/Load Map - - Don't show hidden brushes in the Z window - -22/01/2001 - (Alpha branch) - - More File Dialog fixes - -21/01/2001 - TTimo (Alpha branch) - - version first version of the advanced file selector on win32 - seems to work nicely, but crashes when you actually load something .. needs debugging! - - leo (Alpha branch) - - Set correct initial directory for the File/Load command - -17/01/2001 - (Alpha branch) - - Fixed q3map is crash if a .shader file is referenced in shaderlist and not found - - TTimo (Alpha branch) - - fixed some license headers on gtkfilesel.c, started looking into porting gtkfilesel.c to win32 - -16/01/2001 - raistlin - - the tree is opened whoooo! - - TTimo (Alpha branch) - - replaced the old Id header by the newer version (BIG update, to trunk and Alpha) - - switched str.h to BSP - - added LGPL license to the sample dll - -15/01/2001 - (Alpha branch) - - Added camera window toggle option to all views mode - - TTimo - for trunk and Alpha: - - renamed TOOL_SOURCE_EULA to LICENSE_ID - - renamed CONTRIBUTOR to CONTRIBUTOR_AGREEMENT - - added CONTRIBUTORS and LICENSE - -14/01/2001 - (Alpha branch) - - plugin SDK is back in setup/ moved the sample dll to be in plugins/, need to rewrite the SDK scripts - - built a lightweight plugin SDK with cygwin makefile for the sample plugin - -12/01/2001 - (Alpha branch) - - Set map modified flag when deleting a brush - - Minimize all windows when the main window is minimized in floating views mode - -11/01/2001 - (Alpha branch) - - Cleaned up the View/Show submenu - - Fixed texture menu splitting - - Fixed major grid lines on 128 and 256 grids - - Load only a single .def file if specified in the project settings - - Fixed q3map Makefile - - TTimo - (Alpha branch) - - Removed plugins/shaders from Alpha branch - - got rid of common2/ and code, moved qfiles.h and surfaceflags.h into common/ - - put the licensing headers in all source files (forgot some? byte me) - -10/01/2001 - leo (Alpha branch) - - Added new filter system based on FAKK2 Radiant - - TTimo - - fixed whatever could be fixed to make it compile with the new directory layout - (Alpha branch) - - project files update - -09/01/2001 - (Alpha branch) - - Added undo for patch redisperse rows and patch redisperse cols commands - - Fixed Show Z Outline menu item - -30/11/2000 - TTimo - - removed content flags and value from qtexture_t, these have moved to the IShader - (NOTE: qtexture_t != texdef_t, texdef_t still using flags value and content) - - - Rewrote the linux plugins Makefiles - -29/11/2000 - - Improved the way modules are loaded - - Added new parameter to QERPlug_RequestInterface - - finished VC6 project files conversion for new directory structure - - fixed shader blending on terrain maps bug - -08/01/2001 - - Updated Makefiles for the new directory structure - - Fixed View/Show/Entities menu not being checked correctly - - Fixed "Invert Selection" command selecting hidden brushes - - Fixed "Select All of Type" command not working correctly after the Enitity Window is closed - - Fixed grid being drawn even when it's the same color of the background - - Fixed "Toggle Size Paint" not turning off - -05/01/2001 - - Fixed autosave interval being calculated wrong - - Fixed autosave path under Linux - - Fixed q3map crash when trying to load missing pcx files - - Fixed q3map not finding .bmp files for the terrain alpha map - -04/01/2001 - - Fixed GL stack underflow when loading a misc_model - -03/01/2001 - - Fixed patches remaining half-selected after "Region set selected" (#2748) - - Fixed Surface Inspector spin buttons rate (#2776) - - Fixed some shortcuts not appearing on menu items (#2786) - - -================================================================================ - 1.1-TA beta -================================================================================ - -02/01/2001 - - Fixed memory problem if a file without extension is entered in the file save dialog. - - Fixed double slashes "//" on filenames when saving a map - - Fixed pk3man plugin not finding the toolbar bitmaps - - Fixed double clicks being considered 2 mouse clicks - - RR2DO2 (applied by TTimo) - - Clusterportal filtering ('View > Show > Show clusterportal' toggle) - -01/01/2001 - TTimo - - updated Web/ with new stuff, web site ready for release - - fixed a crash with multiple edge dragging on win32 (was caused by compiler optimizations, - this one was a major pain) - -31/12/2000 - - fixed the file open/save dialogs initial directory - - RR2DO2 (applied by TTimo) - - bug fix in the terrain loading speedup - - TTimo - - tried to lookup the Z window minimum width problem, added #define DBG_WINDOWPOS code to investigate - -30/12/2000 - RR2DO2 (applied by TTimo) - - fix to CSG Merge in the menu drop down (menu was there, command not hooked) - - some message formatting fixes - - TTimo - - rudimentary pattern matching in file selection, affects the plugin API too - - fixed silly bug in the "clipper uses caulk" code - - major speedup to the loading code on terrain entities - (in mpterra2, from 113s to 4s for the main terrain entity) - - patched back the file open/save dialogs initial directory to override in TA mode - - fixed Patch output crash in the plugin API - - fixed BP conversion in the brush output of the plugin API - - minkey (applied by TTimo) - - fix to the m_pfnLoadFile code to use VFS - -29/12/2000 - - Remember main window position in floating views mode - - Fixed wake up when running the engine in floating views mode under win32 - - TTimo - - various fixes and debug hooks for PJ bug reports - -28/12/2000 - - Fixed VFS initialization order - - Removed texture menu splitting option from preferences (now it's automatic) - - TTimo - - built an initial setup, updated the changelog file for 1.1-TA-beta - -27/12/2000 - - Fixed Q3Map output window being too wide on some errors - - Added VFS to q3map - - TTimo - - replace a printf in q3map by Sys_Printf (!), which is what should actually be used - - added a set of functions to vfs to help with file dialogs, building relative files etc. - - reworked the file dialogs so they default in the right location (open/save as/md3 loading/sound loading) - - fixed shader editor to work with the right path - -26/12/2000 - TTimo - - put the converted HTML manuals (Radiant, shaders and model) in the tree (and the win32 setup) - - added the new Terrain and Team Arena mapping manuals (added to the setups too) - - leo - - Copy and paste across different instances of Radiant - - Fixed wait cursor when copying - - Print engine command line to the console - - Fix glib warnings when running the engine - - Fixed shader files being loaded twice - - Texture menu now automatically breaks when it reaches the maximum screen height - -24/12/2000 - - Fixed q3map to compile with the new LoadJPGBuf parameter - - TTimo - - added TA paths to the BSP commands and running engine - - fixed a bug if running with monitoring disabled (generating the .bat was borked) - - changed the -moddir implementation to a global switch in q3map (same as -connect) - - moddirparam as a global variable in cmdlib, added a TA_HACK in there - - changed the SetQDirFromPath to stick to "baseq3/" when using -moddir - TODO: check standalone files - -23/12/2000 - TTimo - - fixed some sleep/wake code (crashes and wakeup problems on models) - - vfsInitDirectory for TA directory (needs to be checked on linux) - - changed my mind on entities.def, if TA is enabled, load entities-TA.def on top of regular entities.def - - mickey (applied by TTimo) - - some memory overrun fixes - -22/12/2000 - - Fixed plugin Makefiles to not use private/ - - RR2DO2 (applied by leo) - - Fixed SetTallBrush undo - - Added bug report link to help menu - -21/12/2000 - - Daily Linux compilation fixes - - Fixed q3map to read .pk3 files from the directory set by -moddir - - Fixed vfs not listing all files correctly - - Fixed libjpeg crashing on some jpeg files - - Load .def files depending on the current game - -20/12/2000 - - Applied Mickey's patch to fix win32 window position save/load. - - removed missing _msize call - - TTimo - - cleaned up more g_malloc g_free problems, cleaned a INPUT_BUF_SIZE problem in jpeglib - -19/12/2000 - - More manual updates - - Fixed bugs comparing file extensions - - Added VFS to the Alpha branch - - TTimo - - moved game selection to the project settings - - got leo's vfs fixes, started changing the memory allocation scheme to glib - - moved 'free' calls to g_free with a #define in cmdlib, Radiant seems to run nicely again - - removed calls to _msize .. those were causing heap debug assertion failures - - upped more stuff - -18/12/2000 - - Added popup menus with the list of active textures to the find texture dialog - - Fixed some menu checkbuttons - - Changed max number of shader files parsed by q3map to 128 - - Updated manual images - -17/12/2000 - - Fixed bug with the texture window scrollbar range - - Mickey (patched in by TTimo) - - fix to the floating windows mode, don't send windows to the desktop when raising something else (#2659) - - TTimo - - finalized the merge and move into worldspawn commands by adding the undo stuff - - fixed the clamping problems when flipping or mirroring patches - - added 0.5 and 0.25 grids - - added undo to Select_CompleteTall Select_PartialTall and Select_Inside - - added on-the-fly conversion between regular brush coordinates and brush primitives texturing in the plugin API - -15/12/2000 - - Fixed crash on Shift-A (Select all of type) - - Save the state of the toolbar buttons - - Remember the state of the Show Patch Bounding Box button - - Double clicking on an entity on the Entity View tree selects the entity - - Sort the list columns of the map info dialog - - Fixed a bug that would allow multiple Entity View dialogs - - Mickey (patched in by TTimo) - - saving position and size of the entity window between runs and during usage - - TTimo - - two new commands in the drop down menu: - "move into worldspawn" will move selected brushes to worldspawn and eventually delete entities which end up with no brushes - "merge brushes" will merge brushes into an entity (from worldspawn or from another entity) - - added cleaned HTML version of the editor manual in the tree - -14/12/2000 - - When pressing a letter key in the entity window list, scroll to the entity starting with the key pressed - - Fixed backspace not working on the texture subset entry - - Added version check when loading savedinfo.bin - - TTimo - - started implementing Select_Merge and Select_Seperate for workflow improvement on terrain maps - -13/12/2000 - - Finished GtkGenSurf - - RR2DO2 (merged in by TTimo) - - patch to q3map, added option -custinfoparams for custom surface flags (still need documentation) - - TTimo - - zoom out and grid drawing taylored to the world size - -12/12/2000 - TTimo - - quick win32 update to gensurf - - fixed #2610 (MAX_NETMESSAGE) .. needed a consistent rewrite of the way we parse the stream - -11/12/2000 - - Fixed linux compiler errors from recent changes - Not fixed today but I forgot to add those to the Alpha changelog - - Fixed multiple Map Info dialogs bug - - Fixed texture window not scrolling to the top when a new directory is loaded - - Fixed GL Windows grab pointer bug - - Fixed crash after map compilation if the map leaked - - Fixed q3map crash if MAX_SHADER_FILES is reached - -28/11/2000 - - Fixed sleep mode restoring hidden windows (win32) - - Fixed find/replace textures dialog layout and keep it always on top of the main window - - Replaced malloc/free calls with g_malloc/g_free to avoid the win32 limitation - -27/11/2000 - - Removed glu.h dependencies - - Added new file selection dialog - - Removed g_PrefsDlg.m_bDisableAlphaChannel (always FALSE) - - Added shortcuts for sleep and simple patch mesh - - Fixed crash after sleep mode (no GL context current) - -24/11/2000 - - Rewrote the jpeg functions of the image plugin - - Replaced some MFC classes with glib - - More shader plugin fixes - - Fixed bug with select all entities command - - TTimo - - fixed q3map to handle the new LoadJPGBuff length parameter - -22/11/2000 - - Fixed crash in Error() if there's no current GL context - - Fixes to the shaders plugin - - TTimo - - created VC6 project file for image module - - modified the m_pfnError in qerplugin.h to use (char *, ...) construct - -21/11/2000 - - Ensured that the plugins are loaded in the correct order - - Added Sys_FPrintf and Sys_Printf to the plugin interfaces - - Some VC++ fixes - - TTimo - - more fixes to the world size - - modified moduleentry_t so it compiles on win32. need to update the code in all modules probably - - other minor fixes and updates to get everything building on win32 - -20/11/2000 - - Moved image loading code to a plugin - - Fixed some bugs in the shader plugin - - Now using glGenTextures to set texture ids - -19/11/2000 - TTimo - - shader code removed from Radiant core, relies on shader module - - added ctrl-alt-LBUTTON = multiple brush select without selecting whole entities (from TA update) - - added an XML testing proggy in DevDocs/ - -18/11/2000 - TTimo - - shader module is compiling - - reworked the way we deal with required interfaces, - automated the interface request process and added code to check the required modules have been found - -17/11/2000 - - Q1 VFS plugin - - Changes to the VFS API to detect the format supported by a plugin - - Added checks to PluginManager to load the correct VFS plugin - - TTimo - - made a mess with XML MAX_NETMESSAGE error, still not fixed - - merged q3map 1.0r (TA update from Id) into the tree - important files modified: surfaceflags.h qfiles.h - -08/12/2000 - TTimo (shit I'm 24 now) - - added gtk gensurf, VC6 project files are up to date, linux Makefile not checked - - fix some WINAPI stuff on above code - - add idata.h for raw access to editor data - - new _QERAppShaderTable for shader module -> editor functions - - added new entries in various tables (GL, parser etc.) - - shader module is well under way - -16/11/2000 - - Added a color selection dialog function to the plugin API - - Added profile read/write functions to the plugin API - - TTimo - - MAX_NETMESSAGE bug: patched q3map so it sends in several messages if the problem occurs - still need to update Radiant to recognize XML nodes split into several messages (using an input buffer) - - added a test map for MAX_NETMESSAGE: sput.map - - project file for vfspk3and win32 patching - -15/11/2000 - - More plugin cleanup - - Added IsEqualGUID() to qerplugin.h - - TTimo - - merged Alpha back in (didn't try to merge this CHANGES file) - - backported some stuff from the trunk to here, the Sys_Printf, gtk_MessageBox and profile stuff - - created VC project file for gtk-based gensurf plugin - -14/11/2000 - - Fixed DumpUnreferencedShaders() - - TTimo - - added QE_CheckProjectEntity to check paths are following the right conventions - -13/11/2000 - - Fixed bugs in the vfs plugin - - Added support to vfs plugins in Radiant - - TTimo - - updated project file to libxml2-2.2.8, use libxml2 as the directory name for whatever version.. - NOTE: libxml2-2.2.8 needs some patching to compile right.. - -12/11/2000 - TTimo - - all Radiant functions that might be exported in interfaces need to use the WINAPI calling convention - modified the GTK functions code accordingly - - started writing the shaders module - -10/11/2000 - - Added new GTK functions to the plugin API - - Added 'parent' parameter to MessageBox, file_dialog and dir_dialog - - Fixed Help commands (Linux) - -09/11/2000 - - Fixed bug in the Z wnd code - - Fixed copy text from the console (win32) - - TTimo - - moved the libxml library out of the tree, updated the VC6 project files accordingly - -08/11/2000 - - ZWnd always on top (view #2, win32) - - TTimo - - added Escape key to hide the entity inspector - - S and Shift+S now act as toggles on the inspectors - -07/11/2000 - - Added ungroup command to right click menu - - Fixed message box accelerator bug - - Fixed GL error on win32 startup - - TTimo - - additions to the BSP interface - - fixed DestroyCursor error - - clipper caulks faces (and prefs checkbox) - -06/11/2000 - - Cleaned PrtView and TexTool plugins - - Fixed bug in texture menu names (#2506) - - Added splitters to Entity dialog - - TTimo - - started clipper caulk implementation - - fix to the pointfile not drawing in 2D views - - MAX_BUILD_SIDES in q3map debug stream - -05/11/2000 - - Merged Alpha branch with the trunk - - TTimo - - more plugin interface for Q3Build, and plugin SDK additions - - merged q3map Realloc back into Alpha branch - -04/11/2000 - - Fixed crash during startup if Zwnd was hidden in views #2 and #3 - - Fixed ToggleConsole command - - Fixed ToggleEntity and ToggleTexture commands in view #2 - - Fixed plugin Makefiles - - Removed -rdynamic from Radiant link options (crashes pk3man plugin) - -03/11/2000 - TTimo - - directory reorganisation for the plugin SDK, added an interface/ directory - -02/11/2000 - - Save ZWnd state in views #2 and #3 - - Entity dlg always on top (linux) - - Fixed shortcuts.ini parsing bug - - Fixed editpad crash if editpad not present (win32) - - Fixed bugs in the internal shader editor - - Fixed widget_show if window moved after gtk_widget_set_uposition - -================================================================================ - 1.1 beta -================================================================================ - -31/10/2000 - - Continue loading if glXGetProcAddressARB is not present (Utah-GLX fix) - - Fix BSP commands not working if a map is not in "mapspath" (linux) - -30/10/2000 - - fixed the Region commands, "Region > Set brush" is working - Region uses the camera as spawn point. - - Fixed view/show menu initialization - - Fixed warning when starting view #2 - - Fixed z wnd in view #3 - - Fixed win32 sleep mode crashes on views #2 and #3 - - Added "Restart" message when changing texture quality in the preferences - - Cleanup: removed radbsp.cpp (unused) and unzip.cpp (already in pak.a) - -29/10/2000 - - Fixed SIGCHLD handler - - Built 1.1b setups - -28/10/2000 - - Fixed q3map bug visbytes > MAX_MAP_VISIBILITY - - Fixed clipper display bug - - TTimo - - updated quakev2.qe4 with -vlight options - - added checks in q3map to prevent crashing on allocating a winding too big - will stop with an error now. - - added the corresponding editor support for debug messages if MAX_POINTS_ON_WINDING is exceeded - - G_Dewan - - improved q3map, reducing minimal memory footprint by about 45Mb - -27/10/2000 - - Fixed crash in BSP debug window - - Reorganized the preferences dialog - - Fixed q3map Makefile - - Fixed +/- bug in win32 (Gtk patch) - - Fixed Alt shortcuts bug in win32 (Gtk patch) - - Fixed q3map crash when visbytes > MAX_MAP_VISIBILITY - - TTimo - - improved snapshots behaviour, doesn't snapshot non-modified maps - -26/10/2000 - - Fixed patch inspector not showing after it has been closed - - Added 'Reset' button to entity dialog - -25/10/2000 - - Fixed more grid issues - - Fixed load window position bug (saved pos greater than screen resolution) - - Fixed selection nudge bug - - Improved entity windows layout - - Fixed GL font not being recreated when exiting sleep mode - - TTimo - - cleaned m_nTextureTweak and m_bSnapTToGrid - - improved the CycleCapTexturePatch command, now cycles across the 3 planes only - and works on multiple patches at once - -24/10/2000 - - Added an overwrite prompt when saving files - - Fixed 128 and 256 grid display - - Commented-out grouping code (not functional yet) - -23/10/2000 - - Fixed q3map to load jpgs under Linux - - Fixed wake-up crash when floating windows were closed (#2423) - -21/10/2000 - - More q3map and radiant Makefile fixes - - Remember size/position of the entities dialog - -20/10/2000 - - Redirect Gdk warnings - - Draw border around active XY wnd - - Moved some scripts to the Makefile - - Added shift+rclick to zoom in/out - - Removed minimize/maximize buttons for z wnd in floating mode under win32 - - TTimo - - Two new entries in View > Show: Show Outline and Show Axes - Show Outline turns on/off colored outline of the current view - Show Axes turns on/off display of a small axis base in the 2D view - - fix q3map Makefile to use external libxml2 source - - G_DEWAN - - Fix to bogus noshader error message in q3map - -19/10/2000 - - Added new console functions that support colors - - Revised linux makefile for debug/release builds - - Redirect Gtk warnings to the console - - TTimo - - reorganized the entity inspector window, layout depends on the number of flags to get - more space in the comment window. - -18/10/2000 - - Fixed add/remove bsp items in project settings dialog - - Did some cleanup (removed #define WIN32_CONSOLE) - - Fixed console not working in view #3 - - Fixed warning when exiting in views #2 #3 - - TTimo - - fix to entity inspector comment window for the eclass_t on win32 (removed the white squares) - -17/10/2000 - - Fixed texwindow not scrolling when last texture is large - - Added LOD for patches - - Fixed prefab path & user ini in preferences dialog - -13/10/2000 - TTimo (XML branch) - - basic architecture for XML feedback is functional - see radiant/feedback.cpp radiant/watchbsp.cpp q3tools/common2/inout.c - merging back in alpha - -04/10/2000 - TTimo (XML branch) - - sax interface is in Radiant, need to add a state machine and proper processing - -04/10/2000 - TTimo (XML branch) - - experimental use of SAX interface to parse the stream on the server side, see q3tools/q3map/NetTest - -03/10/2000 - TTimo (XML branch) - - adding libxml2 in the repository, based on libxml2-2.2.4 with project files and stuff to build on win32 - -31/09/2000 - TTimo (XML branch) - - new common2/ dir, output system rewritten through Sys_Printf - - experimental use of libxml - -28/09/2000 - TTimo (Inspector branch) - - shift+arrows matches the increments from the surface inspector - - button 'Match Grid' in the SI to set the increment according to current grid - -25/09/2000 - TTimo (Inspector branch) - - fixed crappy bug in SavedInfo.bin upgrade (when the struct sizes don't match) - - surface inspector has inc step dialog boxes (+saved in prefs) - - face selection is always on (was something weird from the prefs) - - undo works better with the surface inspector - -25/09/2000 - - Added ARB_Multitexture support - -21/09/2000 - - Fixed preferences dialog warning - - Added new grid sizes - -20/09/2000 - - Fixed small bugs reported from Fenris - -17/09/2000 - TTimo - - fixed a bug with template project loading / path to the engine safecheck (a weird hidden one) - G_Dewan & TTimo - - fixes to the process spawning (Q_Exec in cmdlib) + appropriate warning and error messages - Fishman - - antialiased drawing in 2D views - -14/09/2000 - TTimo - - radiant.log commandlist.txt and radiant.pid are create in g_strAppPath on win32 and g_strTempPath on linux - - moved the splash screen after the .pid code - - I suspect a bug in the .pid removal, added a check and message box - - help works again on win32, spawning Word with the Q3Rad_Manual.doc (temporary solution of course) - - surface inspector: removed all Q2 related stuff, fixed horizontal shift, reorganized the widgets layout - hooked the widgets to apply the changes on the fly (the inspectors need a good chunk of work) - - fixed a radiant.pid bug - - added icon to MSVC6 project (with some help) - - G_Dewan - - fix to BSP menu order getting mixed up - - fix to the file dialog - -11/09/2000 - - Added splash screen - -25/08/2000 TTimo - - launch sleep mode before running game - - fixed Map_Snapshot bug - - going to sleep works on view n2, raising is still screwed (contexts) - -24/08/2000 TTimo - - fixed some sleep mode stuff - - fixed map snapshot bug - -21/08/2000 - - fixed stuff to build on linux - - Merged in q3map 1.0p - -18/08/2000 - - Removed "High Color Textures" option (always on) - - Removed "Status Point Size" option - -17/08/2000 - - Fixed win32 console issues - -16/08/2000 - - added g_strTempPath - - restore maximized window state - - fixed logo.bmp - -15/08/2000 TTimo - - fixed keyboard shortcuts - - fixed engine path in prefs (must use the file dialog to change) - - fixed a bug related to engine path and project templates - -15/08/2000 - - Removed QE4 update model option (always on) - - Removed Buggy ICD option (always off) - - Reorganized the preferences dialog to take a bit less space - -14/08/2000 TTimo - - using profile.cpp code to read shortcut keys files - - moved DevDocs/changelog.txt to data/changelog.txt - (data/ should be used for user-side stuff and DevDocs/ for developpers) - - added data/quickstart.txt with a beginning of info about the main differences - between Q3Radiant 202 and GtkRadiant. to be used as a doc later. - -13/08/2000 TTimo - - added DevDocs/WIN32SETUP and DevDocs/changelog.txt - changelog.txt is end user changes - WIN32SETUP the TODO list for install specific stuff - - wrapped a first version of the win32 installers (full and patch) - -11/08/2000 TTimo - - quickfix to put undo/redo back in - - added DevDocs/WIN32SETUP, describes what I'm up to with the setup of win32 version - -10/08/2000 TTimo - - added back the window position saving code that was in earlier tree - NOTE: would have rather have it done in prefs than hooked in mainframe_delete and MainFrame::Create - (would have been cleaner IMO) - NOTE: IT'S STILL BROKEN .. I ADDED THE CODE BUT I MUST BE MISSING SOMETHING - NOTE: it doesn't remember the maximized state. It should. - -08/08/2000 TTimo - - fixed win32 build for GLWidget code, added WINAPI calling convention on all exported stuff - - fixed TexTool to compile under win32 - -07/08/2000 TTimo - - fixed some crash with the new jpeg lib - - fixed console logging behaviour (was always turned on at startup) - - added console logging checkbutton in prefs - -07/08/2000 - - Merged the GLWidget branch - - Merged 202 patches - - Fixed "clean" button in the preferences dialog - - Added pid startup detection - - Updated plugin interface with GLWidget functions - - Updated TexTool plugin - -04/08/2000 - - Added "errno" string to the Error() message box - - More 202 patches - -03/08/2000 - - Merged changes from MFC Radiant 202 - - Fixed the win32 GLWidget stuff - -02/08/2000 - - new OpenGL widget to keep all platform specific code in only one file - -01/08/2000 - - Added code to restore the windows when coming out of sleep mode - - Rewrote the TexTool plugin - -31/07/2000 TTimo - - added vc6 projects for PrtView - - tested PrtView and Radiant against latest binary release of Gtk (works great) - - Leo: - - Updated VC5 projects - - Fixed plugin loading under win32 - - Updated PrtView to compile under win32 - - Radiant is now iconified when going in sleep mode - -30/07/2000 TTimo - - prefs dialog for BSP monitoring - - Added data/ directory with entities.def and quakev2.qe4 - - stabilized syntax of v2 project file, same project file for both platforms - - added DevDocs/WIN32BETA with a list of stuff to do before going on public beta on win32 - - added DevDocs/d2u .. handy script to remove linefeeds from DOS files - - added radiant/radiant.proj, project file for source navigator (SN rules) - - Leo: - - Fixed the logfile crash when ~/.q3a/radiant doesn't exist (fenris #1953) - -28/07/2000 TTimo - - Fix to the win32 console to use window's default font - - Added File > Sleep for experimentation - NOTE: we need to keep Radiant minimized when going into sleep mode - -28/07/2000 - - Finished the win32 console replacement - - Fixed bug 1952 (map loading segfault) - - Added a Makefile to the libs dir - -26/07/2000 - - Added PrtView plugin - - Added qvm target to source/Makefile - - Another release candidate sent to QA - -18/07/2000 - - Fixed the slow updates issue in the win32 version - - Added 3 new variables to fix the paths issue - -17/07/2000 - - Fixed the plugin search directory (broken with the changes to g_strAppPath) - -14/07/2000 - - Increased the timer speed in MainFrame::RoutineProcessing - - Added code to release and recreate the contexts to the win32 version - - Fixed the mouse capture under win32 - -13/07/2000 - - Fixed the new path and bsp problems - - Sent new version to QA for testing/release - -12/07/2000 - - Added "tools/" back to g_strAppPath under linux - -11/07/2000 - - Added code to release and the recreate the GL contexts (linux) - -10/07/2000 - - Changed directory structure - -09/07/2000 - - Added CS_OWNDC for win32 with a GDK hack - -07/07/2000 - - Fixed "white textures" bug (gluBuild2DMipmaps bug) - -03/07/2000 -TTimo: - main.cpp l386, removed tools/ appending to g_strAppPath, g_strAppPath is expected to point to the app.. (hope it doesn't break anything) - -02/07/2000 - - Added precompiled headers for faster win32 builds - -01/07/2000 - - Finally got q3asm/lcc working - -26/06/2000 - - 201 patches - - Added screenshot option - - Added an error message if X is running in 8 bits - -23/06/2000 - - Updated with build 200 source - -13/06/2000 - - Remove --noshare option - - Added --nofonts option to workaround a bug using glXUseXFonts in XFree 4.0 - -04/06/2000 - - Fixed bug with the Ctrl-X accelerator for the File/Exit menu - -02/06/2000 - - Converting the TexTool plugin - -30/05/2000 - - Changes to the plugin loading code - -28/05/2000 - - Files with an underscore character are now correctly parsed in the MRU menu - -25/05/2000 - - Fixed _exit bugs - - Fixed bug in CMapStringToString::SetAt - - Fixed copy/paste/clone bug - -24/05/2000 - - Finished applying the 199 patches - - Fixed a bug in CShaderArray::SortShaders() that was calling the wrong version of InsertAt() - - Added numbers to the MRU menu items - -23/05/2000 - - Fixed the floating point bug in gluBuild2DMipmaps - - Fixed the time display after a bsp command is executed - - Applied several patches from the 199 version - - The console is now visible by default - -21/05/2000 - - Added a replacement for gluBuild2DMipmaps - -20/05/2000 - - Fixed the repeating textures bug when playing a map, "brush_primit" must be set to "1". - - Fixed the bug about no current GL context when exiting in computers with 3dfx cards. - - Textures in the directory pointed by "texturepath" are now loaded correctly in Radiant. - - Fixed bug in q3map where it would require a shaderlist.txt file in ~/.q3a/baseq3/scripts. - -19/05/2000 - - Fixed a bug in the multiple directories hack in libs/pakstuff.cc - - Finished the filter in the texture window - - The wait cursor is now correctly set in the XY window - - Added replacements for gluPerspective and gluLookAt - - Textures can now be stored in 2 places: - * The path pointed by "texturepath" (defaults to ~/.q3a/baseq3/textures, - but can be changed in the project settings) - * The base texture path (/baseq3/textures) - - Radiant and the q3map tool now looks for shaders in ~/.q3a/baseq3/shaderlist.txt - and /baseq3/scripts/shaderlist.txt - -18/05/2000 - - Plugin menu fixes - - Created a simple text editor to edit the shaders (instead of calling an external program) - - Copy and paste now work - - Fixed some bugs with the MRU menu - - Some menu items are now enabled/disabled correctly in MainFrame::RoutineProcessing () - - Added a new command line option (--cdpath) to set the CD-ROM path - - Fixed some bugs in the entity window, now it's possible to add/edit/remove properties - - New directory paths: - * maps now default to ~/.q3a/baseq3/maps - * autosave files are saved in ~/.q3a/baseq3/maps - * .pk3 files can be in ~/.q3a/baseq3, /baseq3 and in the CD-ROM - -17/05/2000 - - Fixed bug deselecting a brush after the surface dialog is open - - hide cursor when right-dragging XYWnd - - files saved to /tmp are now saved in ~/.q3a/radiant - - Disabled undo - - Fixed a bug in FillTextureMenu - - User can now correctly change the accelerators at run-time - - Accelerators are read from ~/.q3a/radiant/radiant.ini - -16/05/2000 - - Finished the patch inspector - - Finished the texture toolbar - - more small bug fixes - -11/05/2000 - - Finished the GroupDlg stuff - - Added support to read pak files from the Quake3 CD-ROM - - moved /tmp/paklog.txt to ~/.q3a/radiant/paklog - - added functions to replace GetKeyState and SetCursorPos - - fixed the command key handlers for the mainwindow diff --git a/CHANGES-MACOS b/CHANGES-MACOS new file mode 100644 index 00000000..1792be8b --- /dev/null +++ b/CHANGES-MACOS @@ -0,0 +1,11 @@ +Changes file for the MacOS port of GtkRadiant 1.1-TA +---------------------------------------------------- +05/24/2001 +TTimo + Patching the MacOS branch to build on linux +04/15/2001 +Pradeep + Changes so that the whole project compiles under MacOSX/XFree. +03/28/2001 +TTimo + added this file and gave write access to pradeep on the tree (testing write access) diff --git a/COMPILING b/COMPILING index 7dd7bd14..b3ec0182 100644 --- a/COMPILING +++ b/COMPILING @@ -1,5 +1,5 @@ -developer documentation for GtkRadiant 1.5.0 -============================================ +developer documentation for GtkRadiant 1.6.0 (Zeroradiant) +========================================================== getting the source ================== @@ -12,10 +12,9 @@ The subversion client can be obtained from the Subversion site. To get a copy of the source using the commandline Subversion client: Change the current directory to the desired location for the source. - svn checkout https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/branches/1.5/ ./GtkRadiant + svn checkout https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk/ ./GtkRadiant svn checkout https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Pack/trunk/ ./GtkRadiant/games/Q3Pack - svn checkout https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/branches/1.5/ ./GtkRadiant/games/UFOAIPack - + svn checkout https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/trunk/ ./GtkRadiant/games/UFOAIPack Linux/OSX(using X-windows) @@ -46,7 +45,6 @@ run: Execute './GtkRadiant/install/radiant.x86' (or './GtkRadiant/install/radiant.ppc' on osx) - Win32 (2000, XP or Vista) ================== diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 664e339d..323dbd0d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,19 +1,7 @@ GtkRadiant CONTRIBUTORS and CREDITS -last update: 28/02/2007 +last update: 01/15/2001 ======================= -GtkRadiant 1.5 development: -------- -Thomas "namespace" Nitschke spam@codecreator.net -Stefan "Shaderman" Greven -"Topsun" -SmallPileofGibs spog@planetquake.com -"Tr3b" - -Small contributions and improvements for 1.5 --------- -Eric "eb" Barth - Loki ---- Leonardo Zide leo@lokigames.com @@ -22,15 +10,15 @@ Bernd Kreimeier (overall coordination) QER.com ------- -TTimo timo@idsoftware.com +TTimo timo@qeradiant.com ^Fishman (Pablo Zurita) fish@gamedesign.net RR2DO2 rr2do2@q3f.com -SmallPileofGibs spog@planetquake.com Curry plugin ------------ Mike "mickey" Jackman Tim "Maj" Rennie +William "SmallPileOfGibs" Joseph PrtView plugin, various bug fixes and q3map guru ------------------------------------------------ @@ -57,19 +45,10 @@ Improvements and bug fixing --------------------------- Jan Paul "MrElusive" van Waveren Robert Duffy -Forest "LordHavoc" Wroncy-Hale -Nurail -AcidDeath -Chronos -Michael Schlueter -Jamie Wilkinson -Robert "Tr3B" Beckebans Web --- -Dave "Bargle" Koenig -Jason "Wolfen" Spencer -Shawn "EvilTypeGuy" Walker +Dave "Bargle" Koenig and Jason "Wolfen" Spencer Thanks to John Hutton, AstroCreep and W2k for web help @@ -77,18 +56,10 @@ FAQ --- Equim and Wex - -Testing/Feedback ---- -Black_Dog, d0nkey, Fjoggis, Jago, jetscreamer, gibbie, Godmil, Gom Jabbar, -Mindlink, mslaf, necros, Promit, Ravo, RPG, scampie, sock, sponge, thiste, -voodoochopsticks, Zwiffle - - Misc ---- Thanks to everyone on the beta mailing list and irc.telefragged.com #qeradiant for testing and feedback. Updated icons by AstroCreep! Bitch-slapping by RaYGunn! -Last minute bugs by SPoG! (SPoG--) +Last minute bugs by SpoG! (SpoG--) diff --git a/setup/data/tools/plugins/bt/bt-el2.txt b/CONTRIBUTOR_AGREEMENT similarity index 100% rename from setup/data/tools/plugins/bt/bt-el2.txt rename to CONTRIBUTOR_AGREEMENT diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..ff51851d --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2 @@ + * converted the project files to VC8 + * default parameters can't be used in function typedefs anymore, removed those and fixed the code accordingly diff --git a/DarwinCompileInfo.rtf b/DarwinCompileInfo.rtf new file mode 100644 index 00000000..ff5cfb16 --- /dev/null +++ b/DarwinCompileInfo.rtf @@ -0,0 +1,55 @@ +{\rtf1\mac\ansicpg10000\cocoartf100 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww9000\viewh9000\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 Install XFree86\ + see\ + http://xfree86.org and http://mrcla.com/XonX \ + on installing X Window System on your OS X\ +\ +Download these:\ +ftp://gnu-darwin.sourceforge.net/pub/gnu-darwin/gtk+-1.2.8.tgz\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 ftp://gnu-darwin.sourceforge.net/pub/gnu-darwin/Mesa-3.4.tgz\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 Untar these with \ + tar xzvf gtk+-1.2.8.tgz\ + tar xzvf Mesa-3.4.tgz\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 \ +change to root , go into these directory and type:\ +make install\ +(This will install gtk and Mesa)\ +\ +download this:\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 http://prdownloads.sourceforge.net/fink/dlcompat-20010123.tar.gz\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 tar xzvf dlcompat*\ +cd dlcompat*\ +make\ +make install # do this as soot\ +\ +cd GtkRadiant/libs/libxml2/\ +./configure\ +make\ +make install\ +\ +cd GtkRadiant/libs/\ +make\ +\ +cd GtrRadiant/tools/\ +make\ +(This will give you a q3map executable )\ +\ +cd GtkRadiant/radiant/\ +make\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 (This will give you a radiant executable )\ +\ +} diff --git a/DoxyConfig b/DoxyConfig index b9c0619d..fc7f6821 100644 --- a/DoxyConfig +++ b/DoxyConfig @@ -1,47 +1,47 @@ -# Included Doxygen Config file -#--------------------------------------------------------------------------- -# Project name & version number -#--------------------------------------------------------------------------- -PROJECT_NAME = -PROJECT_NUMBER = - -#--------------------------------------------------------------------------- -# Where to put the output -# Note: The images dir should be next to the created html dir within the -# output dir. -# eg; -# [Current Dir] -# L__[OUTPUT_DIRECTORY] -# L__[html] -# L__[images] -#--------------------------------------------------------------------------- -OUTPUT_DIRECTORY = ../GtkRadiant-doxygen - -#--------------------------------------------------------------------------- -# Where to read the sources -# you can add more than one source... -# INPUT = radiant/ \ -# tools/quake3/q3map \ -# tools/quake3/q3data -# -# Recursive is set on, so setting it to ./ (current dir) would read source -# files recursively from the current dir down. (which would take a while) -# -# eg: To document just include, if the current directory is ../GtkRadiant/ -# then... -#--------------------------------------------------------------------------- -INPUT = radiant/ - -#--------------------------------------------------------------------------- -# Misc settings -# TAB_SIZE - sets the indenting for the inline source and the source -# browser -# INCLUDE_PATH - will include documentation for included files from other -# packages. You can specify more than one path the same as -# shown in the INPUT example Leave it blank if you don't want -# this. -# PERL_PATH - path to the perl executable -# -#--------------------------------------------------------------------------- -PERL_PATH = /usr/bin/perl - +# Included Doxygen Config file +#--------------------------------------------------------------------------- +# Project name & version number +#--------------------------------------------------------------------------- +PROJECT_NAME = +PROJECT_NUMBER = + +#--------------------------------------------------------------------------- +# Where to put the output +# Note: The images dir should be next to the created html dir within the +# output dir. +# eg; +# [Current Dir] +# L__[OUTPUT_DIRECTORY] +# L__[html] +# L__[images] +#--------------------------------------------------------------------------- +OUTPUT_DIRECTORY = ../GtkRadiant-doxygen + +#--------------------------------------------------------------------------- +# Where to read the sources +# you can add more than one source... +# INPUT = radiant/ \ +# tools/quake3/q3map \ +# tools/quake3/q3data +# +# Recursive is set on, so setting it to ./ (current dir) would read source +# files recursively from the current dir down. (which would take a while) +# +# eg: To document just include, if the current directory is ../GtkRadiant/ +# then... +#--------------------------------------------------------------------------- +INPUT = GtkRadiant/include/ + +#--------------------------------------------------------------------------- +# Misc settings +# TAB_SIZE - sets the indenting for the inline source and the source +# browser +# INCLUDE_PATH - will include documentation for included files from other +# packages. You can specify more than one path the same as +# shown in the INPUT example Leave it blank if you don't want +# this. +# PERL_PATH - path to the perl executable +# +#--------------------------------------------------------------------------- +PERL_PATH = /usr/bin/perl + diff --git a/Doxyfile b/Doxyfile index b87c164f..a992b3d4 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,1117 +1,170 @@ -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = GtkRadiant - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 1.5.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doxygen-out - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = YES - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = radiant/ plugins/ libs/ include/ - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = */.svn/* - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = radiant/ plugins/ libs/ include/ - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = YES - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = doxygen-xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = NO - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO +# Doxyfile 1.2.5-20010304 +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = $(PWD)/ +INTERNAL_DOCS = YES +CLASS_DIAGRAMS = YES +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = +ENABLED_SECTIONS = +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = doxygen.log +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +FILE_PATTERNS = *.h \ + *.cpp \ + *.c +RECURSIVE = YES +EXCLUDE = *.dsp \ + *.dsw \ + *.o \ + *.d \ + *.ico \ + *.bmp \ + *.txt \ + *.rc \ + Entries \ + Entries.Log \ + Repository \ + Root +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 4 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = +HTML_HEADER = Doxygen_extras/doxygen_gtkradiant_head.html +HTML_FOOTER = Doxygen_extras/doxygen_gtkradiant_foot.html +HTML_STYLESHEET = Doxygen_extras/doxygen_gtkradiant.css +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = .3 +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = + +#--------------------------------------------------------------------------- +# Include file, at the bottom to over-ride anything I missed. +#--------------------------------------------------------------------------- +@INCLUDE = DoxyConfig diff --git a/Doxygen_files/Doxyfile b/Doxygen_files/Doxyfile index 51bd498a..912e2b99 100644 --- a/Doxygen_files/Doxyfile +++ b/Doxygen_files/Doxyfile @@ -1,159 +1,159 @@ -# Doxyfile 1.2.5-20010304 -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = -PROJECT_NUMBER = -OUTPUT_DIRECTORY = -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = YES -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = $(PWD)/ -INTERNAL_DOCS = YES -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = YES -INLINE_SOURCES = YES -STRIP_CODE_COMMENTS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 2 -ENABLED_SECTIONS = -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -ALIASES = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = doxygen.log -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = -FILE_PATTERNS = *.h \ - *.cpp \ - *.c -RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 4 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = -HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html -HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html -HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = -MAN_EXTENSION = .3 -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_PATH = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = - -#--------------------------------------------------------------------------- -# Include file, at the bottom to over-ride anything I missed. -#--------------------------------------------------------------------------- +# Doxyfile 1.2.5-20010304 +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = $(PWD)/ +INTERNAL_DOCS = YES +CLASS_DIAGRAMS = YES +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 2 +ENABLED_SECTIONS = +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = doxygen.log +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +FILE_PATTERNS = *.h \ + *.cpp \ + *.c +RECURSIVE = YES +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 4 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = +HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html +HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html +HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = .3 +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = + +#--------------------------------------------------------------------------- +# Include file, at the bottom to over-ride anything I missed. +#--------------------------------------------------------------------------- @INCLUDE = genConf \ No newline at end of file diff --git a/Doxygen_files/doxygen_gtkradiant.css b/Doxygen_files/doxygen_gtkradiant.css index ad85caff..b875556c 100644 --- a/Doxygen_files/doxygen_gtkradiant.css +++ b/Doxygen_files/doxygen_gtkradiant.css @@ -1,34 +1,34 @@ -body { background-color: black; } -IMG { border-color: #222222; border: 0; } -em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; } -H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } -H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } -A { text-decoration: none; color: #6666DD; } -A:HOVER { text-decoration: underline; color: #4444FF; } -A:VISITED { text-decoration: none; color: #8888AA; } -A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; } -A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; } -A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; } -A.qindexRef { font-size: 11px; } -A.el { text-decoration: none; font-weight: bold; } -A.elRef { font-weight: bold; } -A.code { text-decoration: none; font-weight: normal; color: #6666DD; } -A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } -A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } -A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; } -A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } -A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } -DL.el { margin-left: 2cm; width: 99%; } -DIV.fragment { background-color: #FFFFFF; width: 99%; } -DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; } -TD.md { cellpadding: 0; background-color: #DDDDDD; border: 0; width: 99%; color: #222222; } -DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; } -DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; } -FONT.keyword { color: #0080A0; } -FONT.keywordtype { color: #604020; } -FONT.keywordflow { color: #E08000; } -FONT.comment { color: #800000; } -FONT.comment { color: #009900; text-decoration: italic; } -FONT.preprocessor { color: #806020; } -FONT.stringliteral{ color: #002080; } -FONT.charliteral { color: #008080; } +body { background-color: black; } +IMG { border-color: #222222; border: 0; } +em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; } +H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } +H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } +A { text-decoration: none; color: #6666DD; } +A:HOVER { text-decoration: underline; color: #4444FF; } +A:VISITED { text-decoration: none; color: #8888AA; } +A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; } +A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; } +A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; } +A.qindexRef { font-size: 11px; } +A.el { text-decoration: none; font-weight: bold; } +A.elRef { font-weight: bold; } +A.code { text-decoration: none; font-weight: normal; color: #6666DD; } +A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } +A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } +A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; } +A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } +A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } +DL.el { margin-left: 2cm; width: 99%; } +DIV.fragment { background-color: #FFFFFF; width: 99%; } +DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; } +TD.md { cellpadding: 0; background-color: #DDDDDD; border: 0; width: 99%; color: #222222; } +DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; } +DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; } +FONT.keyword { color: #0080A0; } +FONT.keywordtype { color: #604020; } +FONT.keywordflow { color: #E08000; } +FONT.comment { color: #800000; } +FONT.comment { color: #009900; text-decoration: italic; } +FONT.preprocessor { color: #806020; } +FONT.stringliteral{ color: #002080; } +FONT.charliteral { color: #008080; } diff --git a/Doxygen_files/doxygen_gtkradiant_foot.html b/Doxygen_files/doxygen_gtkradiant_foot.html index affcb3c3..46162436 100644 --- a/Doxygen_files/doxygen_gtkradiant_foot.html +++ b/Doxygen_files/doxygen_gtkradiant_foot.html @@ -1,49 +1,49 @@ - - - - - -

-
- - - - - -
- Documentation generated by : Doxygen $doxygenversion - - - ttimo@idsoftware.com - -
-
- -
-
- -   - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +

+
+ + + + + +
+ Documentation generated by : Doxygen $doxygenversion + + + ttimo@idsoftware.com + +
+
+ +
+
+ +   + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Doxygen_files/doxygen_gtkradiant_head.html b/Doxygen_files/doxygen_gtkradiant_head.html index cda29303..5e0a9eaf 100644 --- a/Doxygen_files/doxygen_gtkradiant_head.html +++ b/Doxygen_files/doxygen_gtkradiant_head.html @@ -1,38 +1,38 @@ - - - - $projectname $projectnumber Doxygen Documentation - - - - - -
-
- - - - - - -
- -
idsoftware
-
- - - - - - - - - - + + +
- - -
 
-

-
- + + + + + + + +
+ + + + $projectname $projectnumber Doxygen Documentation + + + + + +
+
+ + + + + + +
+ +
idsoftware
+
+ + + + + + + + + + - - -
+ + +
 
+

+
+ - - - - - - - -
\ No newline at end of file diff --git a/Doxygen_files/doxygen_index.html b/Doxygen_files/doxygen_index.html index a9005b7f..6b24c2fc 100644 --- a/Doxygen_files/doxygen_index.html +++ b/Doxygen_files/doxygen_index.html @@ -1,7 +1,7 @@ - - - - - - Redirecting to Doxygen index - + + + + + + Redirecting to Doxygen index + diff --git a/Doxygen_files/doxygen_reference_foot.html b/Doxygen_files/doxygen_reference_foot.html index 1bc7d704..a7390bc5 100644 --- a/Doxygen_files/doxygen_reference_foot.html +++ b/Doxygen_files/doxygen_reference_foot.html @@ -1,46 +1,46 @@ - -

-
- - - - - -
- - Doxygen is: Copyright © 1997-2001 by Dimitri van Heesch. - - - GtkRadiant Doxygen Maintainer: Gef -
-
- -
-
-
 
- - - - - -
- -
-
-
- -
- - - + +

+
+ + + + + +
+ + Doxygen is: Copyright © 1997-2001 by Dimitri van Heesch. + + + GtkRadiant Doxygen Maintainer: Gef +
+
+ +
+
+
 
+ + + + + +
+ +
+
+
+ +
+ + + diff --git a/Doxygen_files/doxygen_reference_head.html b/Doxygen_files/doxygen_reference_head.html index 4f12e035..e735c9e4 100644 --- a/Doxygen_files/doxygen_reference_head.html +++ b/Doxygen_files/doxygen_reference_head.html @@ -1,38 +1,38 @@ - - - - GtkRadiant - Doxygen Quick Reference - - - - - -
- -
- - - - - - -
- - -
idsoftware
-
- - - - - - - - - - + + +
- - -
&nsbp;
-

+ + + + GtkRadiant - Doxygen Quick Reference + + + + + +
+ +
+ + + + + + +
+ + +
idsoftware
+
+ + + + + + + + + + - - -
+ + +
&nsbp;
+

\ No newline at end of file diff --git a/Doxygen_files/example/annotated.html b/Doxygen_files/example/annotated.html index c827a83c..852a7f00 100644 --- a/Doxygen_files/example/annotated.html +++ b/Doxygen_files/example/annotated.html @@ -1,103 +1,103 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairsClassDocumentationExample Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
    -
  • IEpair (Virtual class to allow plugin operations on entity pairs) -
- - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- -
-
- -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairsClassDocumentationExample Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
    +
  • IEpair (Virtual class to allow plugin operations on entity pairs) +
+ + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ +
+
+ +
+ + + diff --git a/Doxygen_files/example/classIEpair-members.html b/Doxygen_files/example/classIEpair-members.html index b58775ce..ed4d8778 100644 --- a/Doxygen_files/example/classIEpair-members.html +++ b/Doxygen_files/example/classIEpair-members.html @@ -1,110 +1,110 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEpair Member List

This is the complete list of members for IEpair, including all inherited members. - - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEpair Member List

This is the complete list of members for IEpair, including all inherited members. + + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/classIEpair.html b/Doxygen_files/example/classIEpair.html index a64a9e94..cba38de1 100644 --- a/Doxygen_files/example/classIEpair.html +++ b/Doxygen_files/example/classIEpair.html @@ -1,414 +1,414 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEpair Class Reference

Virtual class to allow plugin operations on entity pairs. -More... -

-List of all members. - - - - - - - - - - - - - - - - - -

Public Methods

virtual void IncRef ()=0
 Increment the number of references to this object. More...

virtual void DecRef ()=0
 Decrement the reference count. More...

virtual void GetVectorForKey (char *key, vec3_t vec)=0
 Get a vector from a key. More...

virtual float FloatForKey (char *key)=0
 Get a float from a key. More...

virtual char* ValueForKey (char *key)=0
 Get a string (char *) from a key. More...

virtual void SetKeyValue (char *key, char *value)=0
 Set a key value to char *value. More...

virtual void GetEntityOrigin (vec3_t vec)=0
 Get a vec3_t for the entities origin. More...

virtual void CalculateRotatedBounds (vec3_t mins, vec3_t maxs)=0
 Compute the rotated bounds of the BBox based on "angle" and "angles" keys. More...

-


Detailed Description

-Virtual class to allow plugin operations on entity pairs. -

- -

-

-Todo:
-Write more complete documentation for this class so that it's use is clear
-

-An interface to entity keys and key pairs that allows plugins to; read and write entity keys and key values, get a key value as a vec3_t -

- -

-Definition at line 10 of file iepairs.h.


Member Function Documentation

-

- - - - -
- - - - - - - - - - -
-void IEpair::CalculateRotatedBounds ( - -vec3_t mins, -
-vec3_t maxs ) [pure virtual] -
-
- - - - - -
-   - - -

-Compute the rotated bounds of the BBox based on "angle" and "angles" keys. -

-

-

- - - - -
- - - - - - -
-void IEpair::DecRef ( - -) [pure virtual] -
-
- - - - - -
-   - - -

-Decrement the reference count. -

-

-

- - - - -
- - - - - - -
-float IEpair::FloatForKey ( - -char * key ) [pure virtual] -
-
- - - - - -
-   - - -

-Get a float from a key. -

-

-

- - - - -
- - - - - - -
-void IEpair::GetEntityOrigin ( - -vec3_t vec ) [pure virtual] -
-
- - - - - -
-   - - -

-Get a vec3_t for the entities origin. -

-

-

- - - - -
- - - - - - - - - - -
-void IEpair::GetVectorForKey ( - -char * key, -
-vec3_t vec ) [pure virtual] -
-
- - - - - -
-   - - -

-Get a vector from a key. -

-

-

- - - - -
- - - - - - -
-void IEpair::IncRef ( - -) [pure virtual] -
-
- - - - - -
-   - - -

-Increment the number of references to this object. -

-

-

- - - - -
- - - - - - - - - - -
-void IEpair::SetKeyValue ( - -char * key, -
-char * value ) [pure virtual] -
-
- - - - - -
-   - - -

-Set a key value to char *value. -

-

-Parameters:
- - - -
key -The (char *) containing the keyname
value -The (char *) to set the key value to
-
-

- - - - -
- - - - - - -
-char * IEpair::ValueForKey ( - -char * key ) [pure virtual] -
-
- - - - - -
-   - - -

-Get a string (char *) from a key. -

-

-


The documentation for this class was generated from the following file: - - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEpair Class Reference

Virtual class to allow plugin operations on entity pairs. +More... +

+List of all members. + + + + + + + + + + + + + + + + + +

Public Methods

virtual void IncRef ()=0
 Increment the number of references to this object. More...

virtual void DecRef ()=0
 Decrement the reference count. More...

virtual void GetVectorForKey (char *key, vec3_t vec)=0
 Get a vector from a key. More...

virtual float FloatForKey (char *key)=0
 Get a float from a key. More...

virtual char* ValueForKey (char *key)=0
 Get a string (char *) from a key. More...

virtual void SetKeyValue (char *key, char *value)=0
 Set a key value to char *value. More...

virtual void GetEntityOrigin (vec3_t vec)=0
 Get a vec3_t for the entities origin. More...

virtual void CalculateRotatedBounds (vec3_t mins, vec3_t maxs)=0
 Compute the rotated bounds of the BBox based on "angle" and "angles" keys. More...

+


Detailed Description

+Virtual class to allow plugin operations on entity pairs. +

+ +

+

+Todo:
+Write more complete documentation for this class so that it's use is clear
+

+An interface to entity keys and key pairs that allows plugins to; read and write entity keys and key values, get a key value as a vec3_t +

+ +

+Definition at line 10 of file iepairs.h.


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
+void IEpair::CalculateRotatedBounds ( + +vec3_t mins, +
+vec3_t maxs ) [pure virtual] +
+
+ + + + + +
+   + + +

+Compute the rotated bounds of the BBox based on "angle" and "angles" keys. +

+

+

+ + + + +
+ + + + + + +
+void IEpair::DecRef ( + +) [pure virtual] +
+
+ + + + + +
+   + + +

+Decrement the reference count. +

+

+

+ + + + +
+ + + + + + +
+float IEpair::FloatForKey ( + +char * key ) [pure virtual] +
+
+ + + + + +
+   + + +

+Get a float from a key. +

+

+

+ + + + +
+ + + + + + +
+void IEpair::GetEntityOrigin ( + +vec3_t vec ) [pure virtual] +
+
+ + + + + +
+   + + +

+Get a vec3_t for the entities origin. +

+

+

+ + + + +
+ + + + + + + + + + +
+void IEpair::GetVectorForKey ( + +char * key, +
+vec3_t vec ) [pure virtual] +
+
+ + + + + +
+   + + +

+Get a vector from a key. +

+

+

+ + + + +
+ + + + + + +
+void IEpair::IncRef ( + +) [pure virtual] +
+
+ + + + + +
+   + + +

+Increment the number of references to this object. +

+

+

+ + + + +
+ + + + + + + + + + +
+void IEpair::SetKeyValue ( + +char * key, +
+char * value ) [pure virtual] +
+
+ + + + + +
+   + + +

+Set a key value to char *value. +

+

+Parameters:
+ + + +
key +The (char *) containing the keyname
value +The (char *) to set the key value to
+
+

+ + + + +
+ + + + + + +
+char * IEpair::ValueForKey ( + +char * key ) [pure virtual] +
+
+ + + + + +
+   + + +

+Get a string (char *) from a key. +

+

+


The documentation for this class was generated from the following file: + + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/classes.html b/Doxygen_files/example/classes.html index b79308f9..7e5bd909 100644 --- a/Doxygen_files/example/classes.html +++ b/Doxygen_files/example/classes.html @@ -1,103 +1,103 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairsClassDocumentationExample Compound Index

- -
  I  
IEpair   
- - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairsClassDocumentationExample Compound Index

+ +
  I  
IEpair   
+ + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/doxygen_gtkradiant.css b/Doxygen_files/example/doxygen_gtkradiant.css index 30bf2075..c0ddae2d 100644 --- a/Doxygen_files/example/doxygen_gtkradiant.css +++ b/Doxygen_files/example/doxygen_gtkradiant.css @@ -1,35 +1,35 @@ -body { background-color: black; } -IMG { border-color: #222222; border: 1; } -em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; } -H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } -H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } -A { text-decoration: none; color: #6666DD; } -A:HOVER { text-decoration: underline; color: #4444FF; } -A:VISITED { text-decoration: none; color: #8888AA; } -A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; } -A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; } -A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; } -A.qindexRef { font-size: 11px; } -A.el { text-decoration: none; font-weight: bold; } -A.elRef { font-weight: bold; } -A.code { text-decoration: none; font-weight: normal; color: #6666DD; } -A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } -A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } -A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; } -A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } -A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } -DL.el { margin-left: 2cm; width: 99%; } -DIV.fragment { background-color: #FFFFFF; width: 99%; } -DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; } -TD.md { cellpadding: 2; background-color: #DDDDDD; border: 1; width: 99%; color: #222222; } -DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; } -DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; } -FONT.keyword { color: #0080A0; } -FONT.keywordtype { color: #604020; } -FONT.keywordflow { color: #E08000; } -FONT.comment { color: #800000; } -FONT.comment { color: #009900; text-decoration: italic; } -FONT.preprocessor { color: #806020; } -FONT.stringliteral{ color: #002080; } -FONT.charliteral { color: #008080; } - +body { background-color: black; } +IMG { border-color: #222222; border: 1; } +em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; } +H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } +H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; } +A { text-decoration: none; color: #6666DD; } +A:HOVER { text-decoration: underline; color: #4444FF; } +A:VISITED { text-decoration: none; color: #8888AA; } +A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; } +A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; } +A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; } +A.qindexRef { font-size: 11px; } +A.el { text-decoration: none; font-weight: bold; } +A.elRef { font-weight: bold; } +A.code { text-decoration: none; font-weight: normal; color: #6666DD; } +A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } +A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } +A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; } +A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; } +A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; } +DL.el { margin-left: 2cm; width: 99%; } +DIV.fragment { background-color: #FFFFFF; width: 99%; } +DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; } +TD.md { cellpadding: 2; background-color: #DDDDDD; border: 1; width: 99%; color: #222222; } +DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; } +DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; } +FONT.keyword { color: #0080A0; } +FONT.keywordtype { color: #604020; } +FONT.keywordflow { color: #E08000; } +FONT.comment { color: #800000; } +FONT.comment { color: #009900; text-decoration: italic; } +FONT.preprocessor { color: #806020; } +FONT.stringliteral{ color: #002080; } +FONT.charliteral { color: #008080; } + diff --git a/Doxygen_files/example/files.html b/Doxygen_files/example/files.html index 9911650f..5b00181d 100644 --- a/Doxygen_files/example/files.html +++ b/Doxygen_files/example/files.html @@ -1,102 +1,102 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairsClassDocumentationExample File List

Here is a list of all files with brief descriptions: - - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairsClassDocumentationExample File List

Here is a list of all files with brief descriptions: + + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/functions.html b/Doxygen_files/example/functions.html index 12914931..0c245e22 100644 --- a/Doxygen_files/example/functions.html +++ b/Doxygen_files/example/functions.html @@ -1,110 +1,110 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairsClassDocumentationExample Compound Members

Here is a list of all class members with links to the class documentation for each member: - - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairsClassDocumentationExample Compound Members

Here is a list of all class members with links to the class documentation for each member: + + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/graph_legend.dot b/Doxygen_files/example/graph_legend.dot index 3d8a101e..f4efdeb7 100644 --- a/Doxygen_files/example/graph_legend.dot +++ b/Doxygen_files/example/graph_legend.dot @@ -1,16 +1,16 @@ -digraph inheritance -{ - Node7 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",style="filled" fontcolor="white"]; - Node8 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; - Node8 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_publicbase.html"]; - Node9 -> Node8 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; - Node9 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="red",URL="$class_truncated.html"]; - Node11 -> Node7 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="doxfont"]; - Node11 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_protectedbase.html"]; - Node12 -> Node7 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="doxfont"]; - Node12 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_privatebase.html"]; - Node13 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; - Node13 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="grey75"]; - Node14 -> Node7 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="doxfont"]; - Node14 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_used.html"]; -} +digraph inheritance +{ + Node7 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",style="filled" fontcolor="white"]; + Node8 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; + Node8 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_publicbase.html"]; + Node9 -> Node8 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; + Node9 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="red",URL="$class_truncated.html"]; + Node11 -> Node7 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="doxfont"]; + Node11 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_protectedbase.html"]; + Node12 -> Node7 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="doxfont"]; + Node12 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_privatebase.html"]; + Node13 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"]; + Node13 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="grey75"]; + Node14 -> Node7 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="doxfont"]; + Node14 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_used.html"]; +} diff --git a/Doxygen_files/example/graph_legend.html b/Doxygen_files/example/graph_legend.html index 2283f3eb..29599cb0 100644 --- a/Doxygen_files/example/graph_legend.html +++ b/Doxygen_files/example/graph_legend.html @@ -1,141 +1,141 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen. -

- Consider the following example:

/*! Invisible class because of truncation */
-class Invisible { };
-
-/*! Truncated class, inheritance relation is hidden */
-class Truncated : public Invisible { };
-
-/* Class not documented with doxygen comments */
-class Undocumented { };
-
-/*! Class that is inherited using public inheritance */
-class PublicBase : public Truncated { };
-
-/*! Class that is inherited using protected inheritance */
-class ProtectedBase { };
-
-/*! Class that is inherited using private inheritance */
-class PrivateBase { };
-
-/*! Class that is used by the Inherited class */
-class Used { };
-
-/*! Super class that inherits a number of other classes */
-class Inherited : public PublicBase,
-                  protected ProtectedBase,
-                  private PrivateBase,
-                  public Undocumented
-{
-  private:
-    Used *m_usedClass;
-};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 200 this will result in the following graph: -

-

-
- -

- The boxes in the above graph have the following meaning:

    -
  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class for which not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
- The arrows have the following meaning:
    -
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
- - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen. +

+ Consider the following example:

/*! Invisible class because of truncation */
+class Invisible { };
+
+/*! Truncated class, inheritance relation is hidden */
+class Truncated : public Invisible { };
+
+/* Class not documented with doxygen comments */
+class Undocumented { };
+
+/*! Class that is inherited using public inheritance */
+class PublicBase : public Truncated { };
+
+/*! Class that is inherited using protected inheritance */
+class ProtectedBase { };
+
+/*! Class that is inherited using private inheritance */
+class PrivateBase { };
+
+/*! Class that is used by the Inherited class */
+class Used { };
+
+/*! Super class that inherits a number of other classes */
+class Inherited : public PublicBase,
+                  protected ProtectedBase,
+                  private PrivateBase,
+                  public Undocumented
+{
+  private:
+    Used *m_usedClass;
+};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 200 this will result in the following graph: +

+

+
+ +

+ The boxes in the above graph have the following meaning:

    +
  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class for which not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
+ The arrows have the following meaning:
    +
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
+ + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/index.html b/Doxygen_files/example/index.html index b8466f27..4cfcdd8a 100644 --- a/Doxygen_files/example/index.html +++ b/Doxygen_files/example/index.html @@ -1,102 +1,102 @@ - - - - IEPairs Class Example Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairs Class Example Documentation

-

- - -

-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairs Class Example Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairs Class Example Documentation

+

+ + +

+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/pages.html b/Doxygen_files/example/pages.html index 0f446d98..24287679 100644 --- a/Doxygen_files/example/pages.html +++ b/Doxygen_files/example/pages.html @@ -1,104 +1,104 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

IEPairsClassDocumentationExample Related Pages

Here is a list of all related documentation pages: - - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

IEPairsClassDocumentationExample Related Pages

Here is a list of all related documentation pages: + + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/test_8c-source.html b/Doxygen_files/example/test_8c-source.html index c36f5a32..9b67ae0a 100644 --- a/Doxygen_files/example/test_8c-source.html +++ b/Doxygen_files/example/test_8c-source.html @@ -1,140 +1,140 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

iepairs.h

Go to the documentation of this file.
00001 //! Virtual class to allow plugin operations on entity pairs
-00002 /*!
-00003   \todo Write more complete documentation for this class so that it's use
-00004   is clear
-00005                         
-00006   An interface to entity keys and key pairs that allows plugins to;
-00007   read and write entity keys and key values, get a key value as a
-00008   vec3_t
-00009 */
-00010 class IEpair
-00011 {
-00012   public:
-00013     //! Increment the number of references to this object
-00014     virtual void IncRef () = 0;
-00015                                 
-00016     //! Decrement the reference count
-00017     virtual void DecRef () = 0;
-00018                                 
-00019     //! Get a vector from a key
-00020     virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
-00021                                 
-00022     //! Get a float from a key
-00023     virtual float FloatForKey( char *key ) = 0;
-00024                                 
-00025     //! Get a string (char *) from a key
-00026     virtual char* ValueForKey( char *key ) = 0;
-00027                                 
-00028     //! Set a key value to char *value
-00029     /*!
-00030       \param key The (char *) containing the keyname
-00031       \param value The (char *) to set the key value to
-00032     */
-00033     virtual void SetKeyValue( char *key, char *value ) = 0;
-00034                                 
-00035     //! Get a vec3_t for the entities origin
-00036     virtual void GetEntityOrigin( vec3_t vec ) = 0;
-00037                                 
-00038     //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
-00039     virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
-00040 };
-
- -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

iepairs.h

Go to the documentation of this file.
00001 //! Virtual class to allow plugin operations on entity pairs
+00002 /*!
+00003   \todo Write more complete documentation for this class so that it's use
+00004   is clear
+00005                         
+00006   An interface to entity keys and key pairs that allows plugins to;
+00007   read and write entity keys and key values, get a key value as a
+00008   vec3_t
+00009 */
+00010 class IEpair
+00011 {
+00012   public:
+00013     //! Increment the number of references to this object
+00014     virtual void IncRef () = 0;
+00015                                 
+00016     //! Decrement the reference count
+00017     virtual void DecRef () = 0;
+00018                                 
+00019     //! Get a vector from a key
+00020     virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
+00021                                 
+00022     //! Get a float from a key
+00023     virtual float FloatForKey( char *key ) = 0;
+00024                                 
+00025     //! Get a string (char *) from a key
+00026     virtual char* ValueForKey( char *key ) = 0;
+00027                                 
+00028     //! Set a key value to char *value
+00029     /*!
+00030       \param key The (char *) containing the keyname
+00031       \param value The (char *) to set the key value to
+00032     */
+00033     virtual void SetKeyValue( char *key, char *value ) = 0;
+00034                                 
+00035     //! Get a vec3_t for the entities origin
+00036     virtual void GetEntityOrigin( vec3_t vec ) = 0;
+00037                                 
+00038     //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
+00039     virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
+00040 };
+
+ +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/test_8c.html b/Doxygen_files/example/test_8c.html index 206bda67..2b7d1cd7 100644 --- a/Doxygen_files/example/test_8c.html +++ b/Doxygen_files/example/test_8c.html @@ -1,107 +1,107 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

iepairs.h File Reference

-

-Go to the source code of this file. - - - -

Compounds

class  IEpair
 Virtual class to allow plugin operations on entity pairs. More...

- - -

-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

iepairs.h File Reference

+

+Go to the source code of this file. + + + +

Compounds

class  IEpair
 Virtual class to allow plugin operations on entity pairs. More...

+ + +

+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/example/todo.html b/Doxygen_files/example/todo.html index 769aac56..88b90db9 100644 --- a/Doxygen_files/example/todo.html +++ b/Doxygen_files/example/todo.html @@ -1,105 +1,105 @@ - - - - IEPairsClassDocumentationExample Doxygen Documentation - - - - - -
- - - - - - - -
- - -
idsoftware -
- -
- - - - - - - - - - - - - - - - - -
- - - - - -
 
-

- -
-
- - - - - -
-Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
-

Todo List

- -
-
Class IEpair
Write more complete documentation for this class so that it's use is clear -
- - -
-
- -

-
- - - - - -
- Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 - - - ttimo@idsoftware.com - -
-
- -
-
-
 
- - - - - -
- - - - - - - -
- - - + + + + IEPairsClassDocumentationExample Doxygen Documentation + + + + + +
+ + + + + + + +
+ + +
idsoftware +
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 
+

+ +
+
+ + + + + +
+Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  
+

Todo List

+ +
+
Class IEpair
Write more complete documentation for this class so that it's use is clear +
+ + +
+
+ +

+
+ + + + + +
+ Documentation generated by : Doxygen 1.2.8.1 on 11 Aug 2001 + + + ttimo@idsoftware.com + +
+
+ +
+
+
 
+ + + + + +
+ + + + + + + +
+ + + diff --git a/Doxygen_files/genDoxyfile b/Doxygen_files/genDoxyfile index 330bb570..9421dc18 100644 --- a/Doxygen_files/genDoxyfile +++ b/Doxygen_files/genDoxyfile @@ -1,159 +1,159 @@ -# Doxyfile 1.2.5-20010304 -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = -PROJECT_NUMBER = -OUTPUT_DIRECTORY = -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = YES -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = $(PWD)/ -INTERNAL_DOCS = YES -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = YES -INLINE_SOURCES = YES -STRIP_CODE_COMMENTS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 2 -ENABLED_SECTIONS = -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -ALIASES = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = doxygen.log -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = -FILE_PATTERNS = *.h \ - *.cpp \ - *.c -RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 4 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = -HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html -HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html -HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = -MAN_EXTENSION = .3 -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_PATH = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = - -#--------------------------------------------------------------------------- -# Include file, at the bottom to over-ride anything I missed. -#--------------------------------------------------------------------------- -@INCLUDE = ./Doxygen_files/genConf +# Doxyfile 1.2.5-20010304 +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = $(PWD)/ +INTERNAL_DOCS = YES +CLASS_DIAGRAMS = YES +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 2 +ENABLED_SECTIONS = +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = doxygen.log +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +FILE_PATTERNS = *.h \ + *.cpp \ + *.c +RECURSIVE = YES +EXCLUDE = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 4 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = +HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html +HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html +HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = +MAN_EXTENSION = .3 +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_PATH = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = + +#--------------------------------------------------------------------------- +# Include file, at the bottom to over-ride anything I missed. +#--------------------------------------------------------------------------- +@INCLUDE = ./Doxygen_files/genConf diff --git a/Doxygen_files/gendoxfunctions b/Doxygen_files/gendoxfunctions index b8837be1..fd48dd85 100644 --- a/Doxygen_files/gendoxfunctions +++ b/Doxygen_files/gendoxfunctions @@ -1,421 +1,421 @@ -#!/bin/bash -# Functions for the gendox script -# -# Gef, Aug 2001 - -#------------------------------------------------------------------------ -# Set the doxygen output language from the system locale -#------------------------------------------------------------------------ -get_language() { - if [ -n "$LANG" ] ; then - local LANG=`locale | grep LANG | cut -d= -f2`; - fi - case "$LANG" in - czech) - OUPUTLANGUAGE="Czech"; - ;; - german) - OUPUTLANGUAGE="German"; - ;; - spanish) - OUPUTLANGUAGE="Spanish"; - ;; - finnish) - OUPUTLANGUAGE="Finnish"; - ;; - french) - OUPUTLANGUAGE="French"; - ;; - italian) - OUPUTLANGUAGE="Italian"; - ;; - japanese*) - OUPUTLANGUAGE="Japanese"; - ;; - dutch) - OUPUTLANGUAGE="Dutch"; - ;; - swedish) - OUPUTLANGUAGE="Swedish"; - ;; - *) - OUPUTLANGUAGE="English"; - ;; - esac -} - -#------------------------------------------------------------------------ -# Output usage info & output help -#------------------------------------------------------------------------ -output_usage() { - echo -e "Usage: $0 [] [-o ]"; - return; -} - -output_help() { - output_usage; - echo -e "\nOptions:"; - echo -e " []"; - echo -e " This is an optional parameter that specifies the directory, or multiple"; - echo -e " directories from which to generate the documentation."; - echo -e ""; - echo -e " [-o ]"; - echo -e " An optional parameter that specifies the output directory in which"; - echo -e " to save the generated documentation."; - echo -e ""; - echo -e " -q or --quiet"; - echo -e " Prevents the output of status information" - echo -e "" - echo -e " --help, or -h"; - echo -e " Displays this information"; - echo -e "" - echo -e " -q or --quiet"; - echo -e " Prevents the output of status information" - echo -e "" - echo -e " -k or --kill"; - echo -e " kills running doxygen pids." - echo -e "" - echo -e "* Further information on using this script, can be found in README.doxygen"; - echo -e "* in the current directory."; - -} - -#------------------------------------------------------------------------ -# Set the target to what was passed on the command line -#------------------------------------------------------------------------ -parse_commandline() { - # todo: - # need to add the ability to check for an auto gen'd version - # used for automatically generating new documentation for each commit - # to the cvs server - - # funky bash shell array - declare -a OPTLIST[$#]; - - if [ $OPTCOUNT == 0 ] ; then - # No options on the command line so set the target list to the core - TARGETCOUNT=0; - OUTPUTDIR="../$(basename `pwd`)-doxygen"; - else - # put all the command line options into an array - for f in $COMLINE ; do - OPTLIST[$COUNTER]="$f"; - let COUNTER++; - done - - for (( COUNTER=0 ; $COUNTER < $OPTCOUNT; $[COUNTER++] )) ; do - if [ "${OPTLIST[$COUNTER]}" == "--help" ] ; then - # output usage information - output_help; - RETVAL=1; - return; - elif [ "${OPTLIST[$COUNTER]}" == "-h" ] ; then - # output usage information - output_help; - RETVAL=1; - return; - fi - - case ${OPTLIST[$COUNTER]} in - -q) - QUIETMODE=1; - ;; - --quiet) - QUIETMODE=1; - ;; - -k) - KILLON=1; - ;; - --kill) - KILLON=1; - ;; - -o) - # look for the -o switch, and get the next command line option as the output dir - if [ -z ${OPTLIST[$COUNTER + 1]} ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " ** Output switch used, but no output dir passed..."; - [ $QUIETMODE -gt 0 ] || echo -e " ** Setting default output dir."; - else - let COUNTER++; - OUTPUTDIR=${OPTLIST[$COUNTER]}; - fi - break; - ;; - **) - # If the command line option is anything other that -o then assume it's a target - # Check to make sure the target exists first... - if [ -d ${OPTLIST[$COUNTER]} ] ; then - TARGETLIST[$COUNTER]=${OPTLIST[$COUNTER]}; - else - output_usage; - echo -e " ** Error: Non-existent directory specified as a target.\nExiting."; - RETVAL=1; - return; - fi - let TARGETCOUNT++; - ;; - esac - done - - fi # if [ $OPTCOUNT == 0 ] ; - - if [ $TARGETCOUNT == 0 ] ; then - TARGETCOUNT=4; - TARGETLIST[0]="include"; - TARGETLIST[1]="libs"; - TARGETLIST[2]="radiant"; - TARGETLIST[3]="plugins"; - # Gef: outputdir for default core when no targets are passed on the command line - # TTimo problem still there, if -o used on command line, don't override - if [ -z $OUTPUTDIR ] ; then - OUTPUTDIR="../$(basename `pwd`)-doxygen"; - fi - fi - - # Add trailing slash's to the lines that need them - TARGETSTRING=`echo ${TARGETLIST[*]} | sed -e 's/" "/", "/'` - [ $QUIETMODE -gt 0 ] || echo -ne " -> Set Input to: "; - for (( COUNTER=0; COUNTER < $TARGETCOUNT ; $[COUNTER++] )) ; do - if [ $COUNTER == $[TARGETCOUNT - 1] ] ; then - [ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}\n"; - TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]}"; - else - [ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}, "; - TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]} \\"; - fi - done - [ $QUIETMODE -gt 0 ] || echo -e " -> Set Output Dir to: $OUTPUTDIR"; - return; -} - -#------------------------------------------------------------------------ -# Try to extract the version number -# todo: find a better way to determine the version -#------------------------------------------------------------------------ -get_version() { - VERSION=`grep PROJECT_NUMBER $DOXYCONFIG | grep -v \# | cut -d= -f2`; - if [ -z $VERSION ] ; then - if [ -f "./include/version.default" ] ; then # checks that we are in the right dir - VERSION=`cat ./include/version.default`; - else - VERSION="(Unknown)"; - fi - fi - return; -} - -#------------------------------------------------------------------------ -# Create a projectname from the tree name -#------------------------------------------------------------------------ -get_projectname() { - PROJECTNAME=`grep PROJECT_NAME $DOXYCONFIG | grep -v \# | cut -d= -f2`; - if [ -z $PROJECTNAME ] ; then - # PROJECTNAME=`echo $TARGET | sed -e s/[^A-Za-z0-9]/!/ | cut -d! -f1`; - PROJECTNAME="$(basename `pwd`)"; - fi - return; -} - -#------------------------------------------------------------------------ -# function to determine the path to the perl executable -#------------------------------------------------------------------------ -get_perlpath() { - if [ -f "$DOXYCONFIG" ] ; then - PERLPATH=`grep PERL_PATH $DOXYCONFIG | grep = | cut -d= -f2` - fi - - if [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then - PERLPATH=`which perl 2>/dev/null | sed -e 's/perl//'`; - elif [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then - PERLPATH=""; - fi - return; -} - -#------------------------------------------------------------------------ -# Function to determine the path to the dot executable -#------------------------------------------------------------------------ -get_dotpath() { - if [ -f "$DOXYCONFIG" ] ; then - DOTPATH=`grep DOT_PATH $DOXYCONFIG | grep = | cut -d= -f2` - fi - - if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then - DOTPATH=`which dot 2>/dev/null`; - fi - - if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then - DOTPATH=""; - HAVEDOT="No"; - echo -e "** Warning: dot not found."; - [ $QUIETMODE -gt 0 ] || echo -e "** dot is part of the GraphVis package and is used to generate"; - [ $QUIETMODE -gt 0 ] || echo -e "** dependancy/inheritance/include (etc) diagrams."; - [ $QUIETMODE -gt 0 ] || echo -e "** It's suggested that you install the GraphVis package for those"; - [ $QUIETMODE -gt 0 ] || echo -e "** features."; - [ $QUIETMODE -gt 0 ] || echo -e "** GraphVis can be downloaded from www.graphvis.org"; - else - HAVEDOT="Yes"; - DOTPATH=`echo $DOTPATH | sed -e 's/dot//'`; - fi - - return; -} - -#------------------------------------------------------------------------ -# Function to move stuff around -#------------------------------------------------------------------------ -# eg: move the images into the output directory & the reference doc into the -# html directory. -# called after doxygen has finished generating documentation -move_stuff() { - [ $QUIETMODE -gt 0 ] || echo -ne " -> Move stuff.\n"; - if [ ! -d $OUTPUTDIR ] ; then - mkdir $OUTPUTDIR; - fi - - if [ ! -d "$EXTRAS_PATH/images/" ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " - Looking for images."; - [ $QUIETMODE -gt 0 ] || sleep 2; - [ $QUIETMODE -gt 0 ] || echo -e " - I can't find the images..."; - [ $QUIETMODE -gt 0 ] || sleep 1; - [ $QUIETMODE -gt 0 ] || echo -e " - Where did you put the images!?"; - [ $QUIETMODE -gt 0 ] || sleep 2; - [ $QUIETMODE -gt 0 ] || echo -e " - They have to be here somewhere..."; - [ $QUIETMODE -gt 0 ] || sleep 1; - [ $QUIETMODE -gt 0 ] || echo -e " - Looking in /dev/null"; - [ $QUIETMODE -gt 0 ] || sleep 3; - [ $QUIETMODE -gt 0 ] || echo -e " - YOU FOOL, YOU DELETED THE IMAGES!!!"; - [ $QUIETMODE -gt 0 ] || sleep 1; - [ $QUIETMODE -gt 0 ] || echo -e " - I quit!"; - RETVAL=666; - else - if [ ! -d $OUTPUTDIR/images ] ; then - mkdir $OUTPUTDIR/images ; - fi - cp $EXTRAS_PATH/images/* $OUTPUTDIR/images/ ; - RETVAL=0; - fi - return; -} - -#------------------------------------------------------------------------ -# clean_up() removes old versions of the documentation -#------------------------------------------------------------------------ -clean_up() { - if [ -f $OUTPUTDIR/html/index.html ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " -> Trashing old dox."; - rm -f $OUTPUTDIR/html/* - fi - return; -} - -#------------------------------------------------------------------------ -# Create a new genConf & Doxyfile -#------------------------------------------------------------------------ -gen_doxyconfig() { - [ $QUIETMODE -gt 0 ] || echo -e " -> Generating DoxyConfig."; - RETVAL=0; - # first need to make sure there is a Doxyfile here - if [ ! -f $DOXYFILE ] ; then - # what now? (could generate one with 'doxygen -e Doxyfile') but it would be screwed. - echo -e "No Doxyfile here..."; - RETVAL=3; - return; - else - # Create a new doxyfile with the @INCLUDE statement including the generated stuff - echo "`cat $DOXYFILE | grep -v @INCLUDE`" > $NEWDOXYFILE - echo "@INCLUDE = $CONFIG_OUTPUT" >> $NEWDOXYFILE - fi - - # remove the old config file - rm -f $CONFIG_OUTPUT - - # create a new one - touch $CONFIG_OUTPUT - echo "# Generated configuration - Do Not Edit." >> $CONFIG_OUTPUT; - echo "# If you want to modify options, edit DoxyConfig and re-run genconf." >> $CONFIG_OUTPUT; - echo -e "\n" >> $CONFIG_OUTPUT; - echo -e "PROJECT_NAME=$PROJECTNAME" >> $CONFIG_OUTPUT; - echo -e "PROJECT_NUMBER=$VERSION" >> $CONFIG_OUTPUT; - echo -e "PERL_PATH=$PERLPATH" >> $CONFIG_OUTPUT; - echo -e "HAVE_DOT=$HAVEDOT" >> $CONFIG_OUTPUT; - echo -e "DOT_PATH=$DOTPATH" >> $CONFIG_OUTPUT; - echo -e "OUTPUT_LANGUAGE=$OUTPUTLANGUAGE" >> $CONFIG_OUTPUT; - - echo -n "INPUT=" >> $CONFIG_OUTPUT; - for (( COUNTER=0 ; COUNTER < $TARGETCOUNT; $[COUNTER++] )) ; do - # echo -e "${TARGETLIST[$COUNTER]}"; - echo -e "${TARGETLIST[$COUNTER]}" >> $CONFIG_OUTPUT - done - # echo -e "INPUT=$TARGET" >> $CONFIG_OUTPUT; - - echo -e "OUTPUT_DIRECTORY=$OUTPUTDIR" >> $CONFIG_OUTPUT; - echo -e "\n" >> $CONFIG_OUTPUT; - return; -} - -#------------------------------------------------------------------------ -# Build the reference page & index -#------------------------------------------------------------------------ -build_extra_html() { - # file locations - REF_OUT="$OUTPUTDIR/reference/index.html" - INDEX_OUT="$OUTPUTDIR/index.html" - - # Make the output directory if it doesn't exist - if [ ! -d $OUTPUTDIR/reference/ ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " -> Making reference directory"; - mkdir $OUTPUTDIR/reference - fi - - # cat the files together and output the result to each file - [ $QUIETMODE -gt 0 ] || echo -e " -> Building reference document"; - cat $EXTRAS_PATH/doxygen_reference_head.html $EXTRAS_PATH/reference1.html $EXTRAS_PATH/doxygen_reference_foot.html > $REF_OUT; - - if [ ! -d $OUTPUTDIR/example/ ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " -> Making example dir"; - mkdir $OUTPUTDIR/example - fi - [ $QUIETMODE -gt 0 ] || echo -e " -> Moving example docs"; - cp $EXTRAS_PATH/example/* $OUTPUTDIR/example/ - cp $EXTRAS_PATH/doxygen_gtkradiant.css $OUTPUTDIR/example/ - - # Make a redirecting index.html - cat $EXTRAS_PATH/doxygen_index.html > $INDEX_OUT; - return; -} - -#------------------------------------------------------------------------ -# Execute doxygen -#------------------------------------------------------------------------ -run_doxygen() { - # copy doxy_mainpage.h to the target directory - # pipe it through sed to add generation time/date and username - $machine - TEMPLOCATION=`echo $TARGETSTRING | cut -d' ' -f1`; - if [ X"$USERNAME" == "X" ] ; then - USERNAME=`whoami`; - fi - MACHINE=`uname -n`; # `uname -n` or `hostname` ?? - cp $EXTRAS_PATH/doxy_mainpage.h temp.h - cat temp.h | - sed "s/+project+/$PROJECTNAME/" | - sed "s|+target+|$TARGETSTRING|" | - sed "s/+user+/$USERNAME/" | - sed "s/+machine+/$MACHINE/" | - sed "s/+date+/$(date '+%b %d %Y')/" > $TEMPLOCATION/doxy_mainpage.h ; - - rm -f temp.h - - # Start doxygen with the command "doxygen $DOXYFILE" - [ $QUIETMODE -gt 0 ] || echo -e " -> Executing doxygen."; - [ $QUIETMODE -gt 0 ] || echo -e "> doxygen $NEWDOXYFILE"; - doxygen $NEWDOXYFILE - RETVAL=$? - - # remove doxy_mainpage.h from the target directory - rm -f $TEMPLOCATION/doxy_mainpage.h - return; -} - -#------------------------------------------------------------------------ -# End. - +#!/bin/bash +# Functions for the gendox script +# +# Gef, Aug 2001 + +#------------------------------------------------------------------------ +# Set the doxygen output language from the system locale +#------------------------------------------------------------------------ +get_language() { + if [ -n "$LANG" ] ; then + local LANG=`locale | grep LANG | cut -d= -f2`; + fi + case "$LANG" in + czech) + OUPUTLANGUAGE="Czech"; + ;; + german) + OUPUTLANGUAGE="German"; + ;; + spanish) + OUPUTLANGUAGE="Spanish"; + ;; + finnish) + OUPUTLANGUAGE="Finnish"; + ;; + french) + OUPUTLANGUAGE="French"; + ;; + italian) + OUPUTLANGUAGE="Italian"; + ;; + japanese*) + OUPUTLANGUAGE="Japanese"; + ;; + dutch) + OUPUTLANGUAGE="Dutch"; + ;; + swedish) + OUPUTLANGUAGE="Swedish"; + ;; + *) + OUPUTLANGUAGE="English"; + ;; + esac +} + +#------------------------------------------------------------------------ +# Output usage info & output help +#------------------------------------------------------------------------ +output_usage() { + echo -e "Usage: $0 [] [-o ]"; + return; +} + +output_help() { + output_usage; + echo -e "\nOptions:"; + echo -e " []"; + echo -e " This is an optional parameter that specifies the directory, or multiple"; + echo -e " directories from which to generate the documentation."; + echo -e ""; + echo -e " [-o ]"; + echo -e " An optional parameter that specifies the output directory in which"; + echo -e " to save the generated documentation."; + echo -e ""; + echo -e " -q or --quiet"; + echo -e " Prevents the output of status information" + echo -e "" + echo -e " --help, or -h"; + echo -e " Displays this information"; + echo -e "" + echo -e " -q or --quiet"; + echo -e " Prevents the output of status information" + echo -e "" + echo -e " -k or --kill"; + echo -e " kills running doxygen pids." + echo -e "" + echo -e "* Further information on using this script, can be found in README.doxygen"; + echo -e "* in the current directory."; + +} + +#------------------------------------------------------------------------ +# Set the target to what was passed on the command line +#------------------------------------------------------------------------ +parse_commandline() { + # todo: + # need to add the ability to check for an auto gen'd version + # used for automatically generating new documentation for each commit + # to the cvs server + + # funky bash shell array + declare -a OPTLIST[$#]; + + if [ $OPTCOUNT == 0 ] ; then + # No options on the command line so set the target list to the core + TARGETCOUNT=0; + OUTPUTDIR="../$(basename `pwd`)-doxygen"; + else + # put all the command line options into an array + for f in $COMLINE ; do + OPTLIST[$COUNTER]="$f"; + let COUNTER++; + done + + for (( COUNTER=0 ; $COUNTER < $OPTCOUNT; $[COUNTER++] )) ; do + if [ "${OPTLIST[$COUNTER]}" == "--help" ] ; then + # output usage information + output_help; + RETVAL=1; + return; + elif [ "${OPTLIST[$COUNTER]}" == "-h" ] ; then + # output usage information + output_help; + RETVAL=1; + return; + fi + + case ${OPTLIST[$COUNTER]} in + -q) + QUIETMODE=1; + ;; + --quiet) + QUIETMODE=1; + ;; + -k) + KILLON=1; + ;; + --kill) + KILLON=1; + ;; + -o) + # look for the -o switch, and get the next command line option as the output dir + if [ -z ${OPTLIST[$COUNTER + 1]} ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " ** Output switch used, but no output dir passed..."; + [ $QUIETMODE -gt 0 ] || echo -e " ** Setting default output dir."; + else + let COUNTER++; + OUTPUTDIR=${OPTLIST[$COUNTER]}; + fi + break; + ;; + **) + # If the command line option is anything other that -o then assume it's a target + # Check to make sure the target exists first... + if [ -d ${OPTLIST[$COUNTER]} ] ; then + TARGETLIST[$COUNTER]=${OPTLIST[$COUNTER]}; + else + output_usage; + echo -e " ** Error: Non-existent directory specified as a target.\nExiting."; + RETVAL=1; + return; + fi + let TARGETCOUNT++; + ;; + esac + done + + fi # if [ $OPTCOUNT == 0 ] ; + + if [ $TARGETCOUNT == 0 ] ; then + TARGETCOUNT=4; + TARGETLIST[0]="include"; + TARGETLIST[1]="libs"; + TARGETLIST[2]="radiant"; + TARGETLIST[3]="plugins"; + # Gef: outputdir for default core when no targets are passed on the command line + # TTimo problem still there, if -o used on command line, don't override + if [ -z $OUTPUTDIR ] ; then + OUTPUTDIR="../$(basename `pwd`)-doxygen"; + fi + fi + + # Add trailing slash's to the lines that need them + TARGETSTRING=`echo ${TARGETLIST[*]} | sed -e 's/" "/", "/'` + [ $QUIETMODE -gt 0 ] || echo -ne " -> Set Input to: "; + for (( COUNTER=0; COUNTER < $TARGETCOUNT ; $[COUNTER++] )) ; do + if [ $COUNTER == $[TARGETCOUNT - 1] ] ; then + [ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}\n"; + TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]}"; + else + [ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}, "; + TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]} \\"; + fi + done + [ $QUIETMODE -gt 0 ] || echo -e " -> Set Output Dir to: $OUTPUTDIR"; + return; +} + +#------------------------------------------------------------------------ +# Try to extract the version number +# todo: find a better way to determine the version +#------------------------------------------------------------------------ +get_version() { + VERSION=`grep PROJECT_NUMBER $DOXYCONFIG | grep -v \# | cut -d= -f2`; + if [ -z $VERSION ] ; then + if [ -f "./include/version.default" ] ; then # checks that we are in the right dir + VERSION=`cat ./include/version.default`; + else + VERSION="(Unknown)"; + fi + fi + return; +} + +#------------------------------------------------------------------------ +# Create a projectname from the tree name +#------------------------------------------------------------------------ +get_projectname() { + PROJECTNAME=`grep PROJECT_NAME $DOXYCONFIG | grep -v \# | cut -d= -f2`; + if [ -z $PROJECTNAME ] ; then + # PROJECTNAME=`echo $TARGET | sed -e s/[^A-Za-z0-9]/!/ | cut -d! -f1`; + PROJECTNAME="$(basename `pwd`)"; + fi + return; +} + +#------------------------------------------------------------------------ +# function to determine the path to the perl executable +#------------------------------------------------------------------------ +get_perlpath() { + if [ -f "$DOXYCONFIG" ] ; then + PERLPATH=`grep PERL_PATH $DOXYCONFIG | grep = | cut -d= -f2` + fi + + if [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then + PERLPATH=`which perl 2>/dev/null | sed -e 's/perl//'`; + elif [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then + PERLPATH=""; + fi + return; +} + +#------------------------------------------------------------------------ +# Function to determine the path to the dot executable +#------------------------------------------------------------------------ +get_dotpath() { + if [ -f "$DOXYCONFIG" ] ; then + DOTPATH=`grep DOT_PATH $DOXYCONFIG | grep = | cut -d= -f2` + fi + + if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then + DOTPATH=`which dot 2>/dev/null`; + fi + + if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then + DOTPATH=""; + HAVEDOT="No"; + echo -e "** Warning: dot not found."; + [ $QUIETMODE -gt 0 ] || echo -e "** dot is part of the GraphVis package and is used to generate"; + [ $QUIETMODE -gt 0 ] || echo -e "** dependancy/inheritance/include (etc) diagrams."; + [ $QUIETMODE -gt 0 ] || echo -e "** It's suggested that you install the GraphVis package for those"; + [ $QUIETMODE -gt 0 ] || echo -e "** features."; + [ $QUIETMODE -gt 0 ] || echo -e "** GraphVis can be downloaded from www.graphvis.org"; + else + HAVEDOT="Yes"; + DOTPATH=`echo $DOTPATH | sed -e 's/dot//'`; + fi + + return; +} + +#------------------------------------------------------------------------ +# Function to move stuff around +#------------------------------------------------------------------------ +# eg: move the images into the output directory & the reference doc into the +# html directory. +# called after doxygen has finished generating documentation +move_stuff() { + [ $QUIETMODE -gt 0 ] || echo -ne " -> Move stuff.\n"; + if [ ! -d $OUTPUTDIR ] ; then + mkdir $OUTPUTDIR; + fi + + if [ ! -d "$EXTRAS_PATH/images/" ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " - Looking for images."; + [ $QUIETMODE -gt 0 ] || sleep 2; + [ $QUIETMODE -gt 0 ] || echo -e " - I can't find the images..."; + [ $QUIETMODE -gt 0 ] || sleep 1; + [ $QUIETMODE -gt 0 ] || echo -e " - Where did you put the images!?"; + [ $QUIETMODE -gt 0 ] || sleep 2; + [ $QUIETMODE -gt 0 ] || echo -e " - They have to be here somewhere..."; + [ $QUIETMODE -gt 0 ] || sleep 1; + [ $QUIETMODE -gt 0 ] || echo -e " - Looking in /dev/null"; + [ $QUIETMODE -gt 0 ] || sleep 3; + [ $QUIETMODE -gt 0 ] || echo -e " - YOU FOOL, YOU DELETED THE IMAGES!!!"; + [ $QUIETMODE -gt 0 ] || sleep 1; + [ $QUIETMODE -gt 0 ] || echo -e " - I quit!"; + RETVAL=666; + else + if [ ! -d $OUTPUTDIR/images ] ; then + mkdir $OUTPUTDIR/images ; + fi + cp $EXTRAS_PATH/images/* $OUTPUTDIR/images/ ; + RETVAL=0; + fi + return; +} + +#------------------------------------------------------------------------ +# clean_up() removes old versions of the documentation +#------------------------------------------------------------------------ +clean_up() { + if [ -f $OUTPUTDIR/html/index.html ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " -> Trashing old dox."; + rm -f $OUTPUTDIR/html/* + fi + return; +} + +#------------------------------------------------------------------------ +# Create a new genConf & Doxyfile +#------------------------------------------------------------------------ +gen_doxyconfig() { + [ $QUIETMODE -gt 0 ] || echo -e " -> Generating DoxyConfig."; + RETVAL=0; + # first need to make sure there is a Doxyfile here + if [ ! -f $DOXYFILE ] ; then + # what now? (could generate one with 'doxygen -e Doxyfile') but it would be screwed. + echo -e "No Doxyfile here..."; + RETVAL=3; + return; + else + # Create a new doxyfile with the @INCLUDE statement including the generated stuff + echo "`cat $DOXYFILE | grep -v @INCLUDE`" > $NEWDOXYFILE + echo "@INCLUDE = $CONFIG_OUTPUT" >> $NEWDOXYFILE + fi + + # remove the old config file + rm -f $CONFIG_OUTPUT + + # create a new one + touch $CONFIG_OUTPUT + echo "# Generated configuration - Do Not Edit." >> $CONFIG_OUTPUT; + echo "# If you want to modify options, edit DoxyConfig and re-run genconf." >> $CONFIG_OUTPUT; + echo -e "\n" >> $CONFIG_OUTPUT; + echo -e "PROJECT_NAME=$PROJECTNAME" >> $CONFIG_OUTPUT; + echo -e "PROJECT_NUMBER=$VERSION" >> $CONFIG_OUTPUT; + echo -e "PERL_PATH=$PERLPATH" >> $CONFIG_OUTPUT; + echo -e "HAVE_DOT=$HAVEDOT" >> $CONFIG_OUTPUT; + echo -e "DOT_PATH=$DOTPATH" >> $CONFIG_OUTPUT; + echo -e "OUTPUT_LANGUAGE=$OUTPUTLANGUAGE" >> $CONFIG_OUTPUT; + + echo -n "INPUT=" >> $CONFIG_OUTPUT; + for (( COUNTER=0 ; COUNTER < $TARGETCOUNT; $[COUNTER++] )) ; do + # echo -e "${TARGETLIST[$COUNTER]}"; + echo -e "${TARGETLIST[$COUNTER]}" >> $CONFIG_OUTPUT + done + # echo -e "INPUT=$TARGET" >> $CONFIG_OUTPUT; + + echo -e "OUTPUT_DIRECTORY=$OUTPUTDIR" >> $CONFIG_OUTPUT; + echo -e "\n" >> $CONFIG_OUTPUT; + return; +} + +#------------------------------------------------------------------------ +# Build the reference page & index +#------------------------------------------------------------------------ +build_extra_html() { + # file locations + REF_OUT="$OUTPUTDIR/reference/index.html" + INDEX_OUT="$OUTPUTDIR/index.html" + + # Make the output directory if it doesn't exist + if [ ! -d $OUTPUTDIR/reference/ ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " -> Making reference directory"; + mkdir $OUTPUTDIR/reference + fi + + # cat the files together and output the result to each file + [ $QUIETMODE -gt 0 ] || echo -e " -> Building reference document"; + cat $EXTRAS_PATH/doxygen_reference_head.html $EXTRAS_PATH/reference1.html $EXTRAS_PATH/doxygen_reference_foot.html > $REF_OUT; + + if [ ! -d $OUTPUTDIR/example/ ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " -> Making example dir"; + mkdir $OUTPUTDIR/example + fi + [ $QUIETMODE -gt 0 ] || echo -e " -> Moving example docs"; + cp $EXTRAS_PATH/example/* $OUTPUTDIR/example/ + cp $EXTRAS_PATH/doxygen_gtkradiant.css $OUTPUTDIR/example/ + + # Make a redirecting index.html + cat $EXTRAS_PATH/doxygen_index.html > $INDEX_OUT; + return; +} + +#------------------------------------------------------------------------ +# Execute doxygen +#------------------------------------------------------------------------ +run_doxygen() { + # copy doxy_mainpage.h to the target directory + # pipe it through sed to add generation time/date and username - $machine + TEMPLOCATION=`echo $TARGETSTRING | cut -d' ' -f1`; + if [ X"$USERNAME" == "X" ] ; then + USERNAME=`whoami`; + fi + MACHINE=`uname -n`; # `uname -n` or `hostname` ?? + cp $EXTRAS_PATH/doxy_mainpage.h temp.h + cat temp.h | + sed "s/+project+/$PROJECTNAME/" | + sed "s|+target+|$TARGETSTRING|" | + sed "s/+user+/$USERNAME/" | + sed "s/+machine+/$MACHINE/" | + sed "s/+date+/$(date '+%b %d %Y')/" > $TEMPLOCATION/doxy_mainpage.h ; + + rm -f temp.h + + # Start doxygen with the command "doxygen $DOXYFILE" + [ $QUIETMODE -gt 0 ] || echo -e " -> Executing doxygen."; + [ $QUIETMODE -gt 0 ] || echo -e "> doxygen $NEWDOXYFILE"; + doxygen $NEWDOXYFILE + RETVAL=$? + + # remove doxy_mainpage.h from the target directory + rm -f $TEMPLOCATION/doxy_mainpage.h + return; +} + +#------------------------------------------------------------------------ +# End. + diff --git a/Doxygen_files/reference1.html b/Doxygen_files/reference1.html index bbcf308a..51cff17d 100644 --- a/Doxygen_files/reference1.html +++ b/Doxygen_files/reference1.html @@ -1,333 +1,333 @@ -
- - -
-GtkRadiant Doxygen Documentation - - -

Doxygen Quick Reference

-
-

- -

Index

-
    -
  1. Commenting styles
  2. -
  3. Qt Style C++ Class Example
  4. -
  5. JavaDoc Style C++ Class Example
  6. -
  7. Special Tags
  8. -
  9. Structural Tags
  10. -
-

- -
- -

1. Commenting Styles

-There are two different styles of commenting that doxygen recognises. -

-Qt Style:
- -/*!
- .... text ....
-*/
-
-
-Qt Style Single line
- -//! .... one line of text ....
-
-

- -

-JavaDoc Style:
- -/**
- * .... text ....
- */
-
-
-JavaDoc Style Single line
- -/// .... one line of text ....
-
-

- -

- Doxygen only allows one brief and one detailed description for each declaration/definition. - If there is a brief description before a declaration, and one before the a definition, only - the one before the declaration will be used. If the same situation occurs for a detailed - description the one before the definition is preferred and the one before the declaration will - be ignored.
- A useful method is to have the brief documentation with the declaration in the header file, - and the detailed documentation with the definition in the source file. -

- Note: Standard C/C++ comments are ignored by doxygen, but will be included in the code listing - for that file. -

-

-

top

-
- - -

2. Qt Style C++ Class Example

-

- Here is an example of a C++ class using Qt Style documentation.
- The IEpair class from include/iepairs.h is used here. The html result of using these comments - can be found here.
-

- Note: The resulting html was generated from a single file. If it were generated as part of - the whole documentation, many of the function names and variables would be hyperlinks to - their definitions.
-

-
-//! Virtual class to allow plugin operations on entity pairs
-/*!
-  \todo Write more complete documentation for this class so that it's use
-  is clear
-			
-  An interface to entity keys and key pairs that allows plugins to;
-  read and write entity keys and key values, get a key value as a
-  vec3_t
-*/
-class IEpair
-{
-  public:
-    //! Increment the number of references to this object
-    virtual void IncRef () = 0;
-				
-    //! Decrement the reference count
-    virtual void DecRef () = 0;
-				
-    //! Get a vector from a key
-    virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
-				
-    //! Get a float from a key
-    virtual float FloatForKey( char *key ) = 0;
-				
-    //! Get a string (char *) from a key
-    virtual char* ValueForKey( char *key ) = 0;
-				
-    //! Set a key value to char *value
-    /*!
-      \param key The (char *) containing the keyname
-      \param value The (char *) to set the key value to
-    */
-    virtual void SetKeyValue( char *key, char *value ) = 0;
-				
-    //! Get a vec3_t for the entities origin
-    virtual void GetEntityOrigin( vec3_t vec ) = 0;
-				
-    //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
-    virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
-};
-
-

-

-

top

- -

3. JavaDoc Style C++ Class Example

- - The same class documented using JavaDoc Style comments -
-/// Virtual class to allow plugin operations on entity pairs
-/**
-  * @todo Write more complete documentation for this class so that it's use
-  * is clear
-  *	
-  * An interface to entity keys and key pairs that allows plugins to;
-  * read and write entity keys and key values, get a key value as a
-  * vec3_t
-  */
-class IEpair
-{
-  public:
-    /// Increment the number of references to this object
-    virtual void IncRef () = 0;
-				
-    /// Decrement the reference count
-    virtual void DecRef () = 0;
-				
-    /// Get a vector from a key
-    virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
-				
-    /// Get a float from a key
-    virtual float FloatForKey( char *key ) = 0;
-				
-    /// Get a string (char *) from a key
-    virtual char* ValueForKey( char *key ) = 0;
-				
-    /** Set a key value to char *value
-      * @param key The (char *) containing the keyname
-      * @param value The (char *) to set the key value to
-      */
-    virtual void SetKeyValue( char *key, char *value ) = 0;
-				
-    //! Get a vec3_t for the entities origin
-    virtual void GetEntityOrigin( vec3_t vec ) = 0;
-				
-    //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
-    virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
-};
-
-

-

top

-
- - -

4. Special Tags

-

- Special tags using the Qt style begin with a " \ ", or using JavaDoc style a " @ " (the two should not be mixed).
-
- Common special tags
-

- - - -
- author - - The author or a list of comma separated authors/contributers -
- see - - A reference to another class, class member, function, etc... -
- param - - A description of a specific function argument or parameter -
- return - - A description of the value returned from a function/method -
- bug - - Starts a paragraph where one or more bugs may be listed. -
- note - - Starts a paragraph where a note may be entered. -
- todo - - Starts a paragraph where a TODO item is described.
- Note: All TODO items are collated into a separate todo list, each linking to each other -
- version - - Starts a paragraph where one or more version strings may be entered. -
- warning - - Starts a paragraph where one or more warning messages may be entered. -
- brief - - A single line comment in place of the //! or /// comment. -
-
-
-

top

-
- -

5. Structural Tags

-

-These are used to document a named object, and are not required to be located near that -object definition or declaration. This allows the documentation for an object to be located -anywhere in the doxygen input files. The exception to this rule however, is that these -documentation blocks cannot be within the body of a function or within C style comment blocks. -All structural commands are preceded by either a " \ " or a " @ ", depending on the -documentation style, and require one or more parameters to specify the name of the object -the description is referring to.
-

-

-An example of the \file structural tag: -

-/*! \file iepairs.h
-    \brief One line documentation for this file
-    \author Author(s)
-    Long description of this file
-*/
-
-

- -Common Structural Tags

-
- - - -
- class - - Documents a class
- eg:
- /*! \class IEpair
- \brief Short description of the IEpair class
-
- Detailed description of the IEpair class
- */
-
-
-
- def - - Describes a #define
- eg:
- /*! \def MAX_VALUE The name of the define
- \brief Description of MAX_VALUE
- */
-
-
-
- file - - Describes a file
- eg:
- /*! \file iepairs.h The name of the file
- \brief Description of the file iepairs.h
-
- Details
- */
-
-
-
- struct - - Documents a struct
- eg:
- /*! \struct BTListList_t the name of the struct
- \brief Description of BTListList_t
-
- Details
- */
-
-
-
- var - - Documents a typedef, variable or enum value
- eg:
- /*! \var typedef unsigned int UINT32
- \brief Short description
- */
-
-
-
- fn - - Documents a function - eg:
- /*! \fn virtual void IEpair::DecRef() = 0;
- \brief Short description of this function
-
- Detailed description of this function
- */
-
- -
-
- -
-

top

-
-
-
+
+ + +
+GtkRadiant Doxygen Documentation + + +

Doxygen Quick Reference

+
+

+ +

Index

+
    +
  1. Commenting styles
  2. +
  3. Qt Style C++ Class Example
  4. +
  5. JavaDoc Style C++ Class Example
  6. +
  7. Special Tags
  8. +
  9. Structural Tags
  10. +
+

+ +
+ +

1. Commenting Styles

+There are two different styles of commenting that doxygen recognises. +

+Qt Style:
+ +/*!
+ .... text ....
+*/
+
+
+Qt Style Single line
+ +//! .... one line of text ....
+
+

+ +

+JavaDoc Style:
+ +/**
+ * .... text ....
+ */
+
+
+JavaDoc Style Single line
+ +/// .... one line of text ....
+
+

+ +

+ Doxygen only allows one brief and one detailed description for each declaration/definition. + If there is a brief description before a declaration, and one before the a definition, only + the one before the declaration will be used. If the same situation occurs for a detailed + description the one before the definition is preferred and the one before the declaration will + be ignored.
+ A useful method is to have the brief documentation with the declaration in the header file, + and the detailed documentation with the definition in the source file. +

+ Note: Standard C/C++ comments are ignored by doxygen, but will be included in the code listing + for that file. +

+

+

top

+
+ + +

2. Qt Style C++ Class Example

+

+ Here is an example of a C++ class using Qt Style documentation.
+ The IEpair class from include/iepairs.h is used here. The html result of using these comments + can be found here.
+

+ Note: The resulting html was generated from a single file. If it were generated as part of + the whole documentation, many of the function names and variables would be hyperlinks to + their definitions.
+

+
+//! Virtual class to allow plugin operations on entity pairs
+/*!
+  \todo Write more complete documentation for this class so that it's use
+  is clear
+			
+  An interface to entity keys and key pairs that allows plugins to;
+  read and write entity keys and key values, get a key value as a
+  vec3_t
+*/
+class IEpair
+{
+  public:
+    //! Increment the number of references to this object
+    virtual void IncRef () = 0;
+				
+    //! Decrement the reference count
+    virtual void DecRef () = 0;
+				
+    //! Get a vector from a key
+    virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
+				
+    //! Get a float from a key
+    virtual float FloatForKey( char *key ) = 0;
+				
+    //! Get a string (char *) from a key
+    virtual char* ValueForKey( char *key ) = 0;
+				
+    //! Set a key value to char *value
+    /*!
+      \param key The (char *) containing the keyname
+      \param value The (char *) to set the key value to
+    */
+    virtual void SetKeyValue( char *key, char *value ) = 0;
+				
+    //! Get a vec3_t for the entities origin
+    virtual void GetEntityOrigin( vec3_t vec ) = 0;
+				
+    //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
+    virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
+};
+
+

+

+

top

+ +

3. JavaDoc Style C++ Class Example

+ + The same class documented using JavaDoc Style comments +
+/// Virtual class to allow plugin operations on entity pairs
+/**
+  * @todo Write more complete documentation for this class so that it's use
+  * is clear
+  *	
+  * An interface to entity keys and key pairs that allows plugins to;
+  * read and write entity keys and key values, get a key value as a
+  * vec3_t
+  */
+class IEpair
+{
+  public:
+    /// Increment the number of references to this object
+    virtual void IncRef () = 0;
+				
+    /// Decrement the reference count
+    virtual void DecRef () = 0;
+				
+    /// Get a vector from a key
+    virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
+				
+    /// Get a float from a key
+    virtual float FloatForKey( char *key ) = 0;
+				
+    /// Get a string (char *) from a key
+    virtual char* ValueForKey( char *key ) = 0;
+				
+    /** Set a key value to char *value
+      * @param key The (char *) containing the keyname
+      * @param value The (char *) to set the key value to
+      */
+    virtual void SetKeyValue( char *key, char *value ) = 0;
+				
+    //! Get a vec3_t for the entities origin
+    virtual void GetEntityOrigin( vec3_t vec ) = 0;
+				
+    //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
+    virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
+};
+
+

+

top

+
+ + +

4. Special Tags

+

+ Special tags using the Qt style begin with a " \ ", or using JavaDoc style a " @ " (the two should not be mixed).
+
+ Common special tags
+

+ + + +
+ author + + The author or a list of comma separated authors/contributers +
+ see + + A reference to another class, class member, function, etc... +
+ param + + A description of a specific function argument or parameter +
+ return + + A description of the value returned from a function/method +
+ bug + + Starts a paragraph where one or more bugs may be listed. +
+ note + + Starts a paragraph where a note may be entered. +
+ todo + + Starts a paragraph where a TODO item is described.
+ Note: All TODO items are collated into a separate todo list, each linking to each other +
+ version + + Starts a paragraph where one or more version strings may be entered. +
+ warning + + Starts a paragraph where one or more warning messages may be entered. +
+ brief + + A single line comment in place of the //! or /// comment. +
+
+
+

top

+
+ +

5. Structural Tags

+

+These are used to document a named object, and are not required to be located near that +object definition or declaration. This allows the documentation for an object to be located +anywhere in the doxygen input files. The exception to this rule however, is that these +documentation blocks cannot be within the body of a function or within C style comment blocks. +All structural commands are preceded by either a " \ " or a " @ ", depending on the +documentation style, and require one or more parameters to specify the name of the object +the description is referring to.
+

+

+An example of the \file structural tag: +

+/*! \file iepairs.h
+    \brief One line documentation for this file
+    \author Author(s)
+    Long description of this file
+*/
+
+

+ +Common Structural Tags

+
+ + + +
+ class + + Documents a class
+ eg:
+ /*! \class IEpair
+ \brief Short description of the IEpair class
+
+ Detailed description of the IEpair class
+ */
+
+
+
+ def + + Describes a #define
+ eg:
+ /*! \def MAX_VALUE The name of the define
+ \brief Description of MAX_VALUE
+ */
+
+
+
+ file + + Describes a file
+ eg:
+ /*! \file iepairs.h The name of the file
+ \brief Description of the file iepairs.h
+
+ Details
+ */
+
+
+
+ struct + + Documents a struct
+ eg:
+ /*! \struct BTListList_t the name of the struct
+ \brief Description of BTListList_t
+
+ Details
+ */
+
+
+
+ var + + Documents a typedef, variable or enum value
+ eg:
+ /*! \var typedef unsigned int UINT32
+ \brief Short description
+ */
+
+
+
+ fn + + Documents a function + eg:
+ /*! \fn virtual void IEpair::DecRef() = 0;
+ \brief Short description of this function
+
+ Detailed description of this function
+ */
+
+ +
+
+ +
+

top

+
+
+
diff --git a/GPL b/GPL index 3912109b..960fe746 100644 --- a/GPL +++ b/GPL @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -278,63 +278,3 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/GtkRadiant.prj b/GtkRadiant.prj index 957efee7..c2af2961 100644 --- a/GtkRadiant.prj +++ b/GtkRadiant.prj @@ -1,690 +1,688 @@ -# Anjuta Version 1.0.2 -Compatibility Level: 1 - - -level editor for Id technology games - - - - - - - - - - - - - - - - - - -props.file.type=project - -anjuta.version=1.0.2 -anjuta.compatibility.level=1 - -project.name=GtkRadiant -project.type=GENERIC -project.target.type=EXECUTABLE -project.version=changesallthetime -project.author=qeradiant.com dev team -project.source.target=install/radiant.x86 -project.has.gettext=0 -project.programming.language=C_C++ -project.excluded.modules= intl - -project.config.extra.modules.before= -project.config.extra.modules.after= -project.config.blocked=1 -project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 - -project.menu.entry=GtkRadiant Version changesallthetime -project.menu.group=Application -project.menu.comment=GtkRadiant Version changesallthetime -project.menu.icon= -project.menu.need.terminal=0 - -project.configure.options= -anjuta.program.arguments= -preferences.indent.automatic=1 -preferences.use.tabs=0 -preferences.indent.opening=0 -preferences.indent.closing=0 -preferences.tabsize=2 -preferences.indent.size=2 -preferences.autoformat.style=Style of Kangleipak -preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss -preferences.autoformat.disable=0 - -module.include.name=. -module.include.type= -module.include.expanded=1 -module.include.files=\ - Doxygen_files/doxy_mainpage.h\ - contrib/bobtoolz/CPortals.h\ - contrib/bobtoolz/DBobView.h\ - contrib/bobtoolz/DBrush.h\ - contrib/bobtoolz/DEPair.h\ - contrib/bobtoolz/DEntity.h\ - contrib/bobtoolz/DListener.h\ - contrib/bobtoolz/DMap.h\ - contrib/bobtoolz/DPatch.h\ - contrib/bobtoolz/DPlane.h\ - contrib/bobtoolz/DPoint.h\ - contrib/bobtoolz/DShape.h\ - contrib/bobtoolz/DVisDrawer.h\ - contrib/bobtoolz/DWinding.h\ - contrib/bobtoolz/StdAfx.h\ - contrib/bobtoolz/bobToolz.h\ - contrib/bobtoolz/bsploader.h\ - contrib/bobtoolz/ctfresource_gtk.h\ - contrib/bobtoolz/funchandlers.h\ - contrib/bobtoolz/lists.h\ - contrib/bobtoolz/misc.h\ - contrib/bobtoolz/resource-gtk.h\ - contrib/bobtoolz/resource.h\ - contrib/bobtoolz/shapes.h\ - contrib/bobtoolz/visfind.h\ - contrib/bobtoolz/dialogs/AboutDialog.h\ - contrib/bobtoolz/dialogs/AutoCaulkDialog.h\ - contrib/bobtoolz/dialogs/AutoCaulkStartDialog.h\ - contrib/bobtoolz/dialogs/BrushCheckDialog.h\ - contrib/bobtoolz/dialogs/DoorDialog.h\ - contrib/bobtoolz/dialogs/IntersectDialog.h\ - contrib/bobtoolz/dialogs/IntersectInfoDialog.h\ - contrib/bobtoolz/dialogs/PolygonDialog.h\ - contrib/bobtoolz/dialogs/StairDialog.h\ - contrib/bobtoolz/dialogs/TextureResetDialog.h\ - contrib/bobtoolz/dialogs/dialogs-gtk.h\ - contrib/bobtoolz/dialogs/pathplotterdialog.h\ - contrib/gtkgensurf/gendlgs.h\ - contrib/gtkgensurf/gensurf.h\ - contrib/gtkgensurf/triangle.h\ - contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.h\ - contrib/prtview/AboutDialog.h\ - contrib/prtview/ConfigDialog.h\ - contrib/prtview/LoadPortalFileDialog.h\ - contrib/prtview/gtkdlgs.h\ - contrib/prtview/portals.h\ - contrib/prtview/prtview.h\ - contrib/prtview/resource.h\ - contrib/prtview/stdafx.h\ - docs/developer/XMLPush/StdAfx.h\ - include/gtkr_list.h\ - include/gtkr_vector.h\ - include/ibrush.h\ - include/ibspfrontend.h\ - include/idata.h\ - include/idatastream.h\ - include/ientity.h\ - include/iepairs.h\ - include/ifilesystem.h\ - include/igl.h\ - include/iimage.h\ - include/imap.h\ - include/imodel.h\ - include/ipatch.h\ - include/ipluginentities.h\ - include/irefcount.h\ - include/iscriplib.h\ - include/iselectedface.h\ - include/ishaders.h\ - include/ishadersmanager.h\ - include/isurfaceplugin.h\ - include/iui.h\ - include/iui_gtk.h\ - include/qerplugin.h\ - include/qertypes.h\ - include/qsysprintf.h\ - include/stl_check.h\ - include/stream_version.h\ - libs/bytebool.h\ - libs/cmdlib.h\ - libs/jpeglib.h\ - libs/mathlib.h\ - libs/missing.h\ - libs/multimon.h\ - libs/pakstuff.h\ - libs/str.h\ - libs/synapse.h\ - libs/jpeg6/jchuff.h\ - libs/jpeg6/jconfig.h\ - libs/jpeg6/jdct.h\ - libs/jpeg6/jdhuff.h\ - libs/jpeg6/jerror.h\ - libs/jpeg6/jinclude.h\ - libs/jpeg6/jmemsys.h\ - libs/jpeg6/jmorecfg.h\ - libs/jpeg6/jpegint.h\ - libs/jpeg6/jversion.h\ - libs/l_net/l_net.h\ - libs/l_net/l_net_wins.h\ - libs/pak/unzip.h\ - plugins/image/bmp.h\ - plugins/image/image.h\ - plugins/image/lbmlib.h\ - plugins/mapq3/plugin.h\ - plugins/mapxml/plugin.h\ - plugins/md3model/entitymodel.h\ - plugins/md3model/md3.h\ - plugins/md3model/md3model.h\ - plugins/md3model/md3surface.h\ - plugins/md3model/plugin.h\ - plugins/md3model/surface.h\ - plugins/sample/stdafx.h\ - plugins/sample/str.h\ - plugins/shaders/plugin.h\ - plugins/shaders/shaders.h\ - plugins/surface/plugtexdef.h\ - plugins/surface/surfdlg.h\ - plugins/surface/surfplug.h\ - plugins/textool/2DView.h\ - plugins/textool/ControlPointsManager.h\ - plugins/textool/StdAfx.h\ - plugins/textool/resource.h\ - plugins/vfspak/vfs.h\ - plugins/vfspak/vfspak.h\ - plugins/vfspk3/unzip-vfspk3.h\ - plugins/vfspk3/vfs.h\ - plugins/vfspk3/vfspk3.h\ - radiant/brush.h\ - radiant/camera.h\ - radiant/camwindow.h\ - radiant/dialog.h\ - radiant/entity.h\ - radiant/epairswrapper.h\ - radiant/feedback.h\ - radiant/file.h\ - radiant/filters.h\ - radiant/findtexturedialog.h\ - radiant/glwidget.h\ - radiant/glwindow.h\ - radiant/groupdialog.h\ - radiant/gtkfilesel-darwin.h\ - radiant/gtkfilesel-linux.h\ - radiant/gtkfilesel.h\ - radiant/gtkmisc.h\ - radiant/mainframe.h\ - radiant/map.h\ - radiant/parse.h\ - radiant/patchdialog.h\ - radiant/plugin.h\ - radiant/pluginmanager.h\ - radiant/points.h\ - radiant/preferences.h\ - radiant/qe3.h\ - radiant/qedefs.h\ - radiant/qfiles.h\ - radiant/qgl.h\ - radiant/resource.h\ - radiant/select.h\ - radiant/stdafx.h\ - radiant/surfacedialog.h\ - radiant/texmanip.h\ - radiant/textures.h\ - radiant/texwindow.h\ - radiant/ui.h\ - radiant/undo.h\ - radiant/watchbsp.h\ - radiant/winding.h\ - radiant/xmlstuff.h\ - radiant/xywindow.h\ - radiant/z.h\ - radiant/zwindow.h\ - tools/quake3/common/aselib.h\ - tools/quake3/common/bspfile.h\ - tools/quake3/common/cmdlib.h\ - tools/quake3/common/imagelib.h\ - tools/quake3/common/inout.h\ - tools/quake3/common/l3dslib.h\ - tools/quake3/common/mutex.h\ - tools/quake3/common/polylib.h\ - tools/quake3/common/polyset.h\ - tools/quake3/common/qfiles.h\ - tools/quake3/common/qthreads.h\ - tools/quake3/common/scriplib.h\ - tools/quake3/common/surfaceflags.h\ - tools/quake3/common/trilib.h\ - tools/quake3/common/unzip.h\ - tools/quake3/common/vfs.h\ - tools/quake3/q3data/3dslib.h\ - tools/quake3/q3data/md3lib.h\ - tools/quake3/q3data/p3dlib.h\ - tools/quake3/q3data/q3data.h\ - tools/quake3/q3map/Heapagnt.h\ - tools/quake3/q3map/game_t.h\ - tools/quake3/q3map/light.h\ - tools/quake3/q3map/mesh.h\ - tools/quake3/q3map/qbsp.h\ - tools/quake3/q3map/shaders.h\ - tools/quake3/q3map/vis.h\ - libs/function.h\ - include/iarchive.h\ - libs/filestream.h - -module.source.name=. -module.source.type= -module.source.expanded=1 -module.source.files=\ - contrib/bobtoolz/DBobView.cpp\ - contrib/bobtoolz/DBrush.cpp\ - contrib/bobtoolz/DEPair.cpp\ - contrib/bobtoolz/DEntity.cpp\ - contrib/bobtoolz/DListener.cpp\ - contrib/bobtoolz/DMap.cpp\ - contrib/bobtoolz/DPatch.cpp\ - contrib/bobtoolz/DPlane.cpp\ - contrib/bobtoolz/DPoint.cpp\ - contrib/bobtoolz/DShape.cpp\ - contrib/bobtoolz/DVisDrawer.cpp\ - contrib/bobtoolz/DWinding.cpp\ - contrib/bobtoolz/StdAfx.cpp\ - contrib/bobtoolz/bobToolz-GTK.cpp\ - contrib/bobtoolz/bobToolz.cpp\ - contrib/bobtoolz/bsploader.cpp\ - contrib/bobtoolz/cportals.cpp\ - contrib/bobtoolz/ctfToolz-GTK.cpp\ - contrib/bobtoolz/funchandlers-GTK.cpp\ - contrib/bobtoolz/funchandlers-ctf-GTK.cpp\ - contrib/bobtoolz/funchandlers.cpp\ - contrib/bobtoolz/lists.cpp\ - contrib/bobtoolz/misc.cpp\ - contrib/bobtoolz/shapes.cpp\ - contrib/bobtoolz/visfind.cpp\ - contrib/bobtoolz/dialogs/AboutDialog.cpp\ - contrib/bobtoolz/dialogs/AutoCaulkDialog.cpp\ - contrib/bobtoolz/dialogs/AutoCaulkStartDialog.cpp\ - contrib/bobtoolz/dialogs/DoorDialog.cpp\ - contrib/bobtoolz/dialogs/IntersectDialog.cpp\ - contrib/bobtoolz/dialogs/IntersectInfoDialog.cpp\ - contrib/bobtoolz/dialogs/PolygonDialog.cpp\ - contrib/bobtoolz/dialogs/StairDialog.cpp\ - contrib/bobtoolz/dialogs/TextureResetDialog.cpp\ - contrib/bobtoolz/dialogs/brushcheckdialog.cpp\ - contrib/bobtoolz/dialogs/dialogs-gtk.cpp\ - contrib/bobtoolz/dialogs/pathplotterdialog.cpp\ - 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/heretic.cpp\ - contrib/gtkgensurf/plugin.cpp\ - contrib/gtkgensurf/triangle.c\ - contrib/gtkgensurf/view.cpp\ - contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.c\ - contrib/prtview/AboutDialog.cpp\ - contrib/prtview/ConfigDialog.cpp\ - contrib/prtview/LoadPortalFileDialog.cpp\ - contrib/prtview/gtkdlgs.cpp\ - contrib/prtview/portals.cpp\ - contrib/prtview/prtview.cpp\ - contrib/prtview/stdafx.cpp\ - docs/developer/XMLPush/StdAfx.cpp\ - docs/developer/XMLPush/XMLPush.cpp\ - docs/manual/quake3/Compile_Manual/cfgq3.c\ - libs/cmdlib/cmdlib.cpp\ - libs/jpeg6/jcomapi.cpp\ - libs/jpeg6/jdapimin.cpp\ - libs/jpeg6/jdapistd.cpp\ - libs/jpeg6/jdatasrc.cpp\ - libs/jpeg6/jdcoefct.cpp\ - libs/jpeg6/jdcolor.cpp\ - libs/jpeg6/jddctmgr.cpp\ - libs/jpeg6/jdhuff.cpp\ - libs/jpeg6/jdinput.cpp\ - libs/jpeg6/jdmainct.cpp\ - libs/jpeg6/jdmarker.cpp\ - libs/jpeg6/jdmaster.cpp\ - libs/jpeg6/jdpostct.cpp\ - libs/jpeg6/jdsample.cpp\ - libs/jpeg6/jdtrans.cpp\ - libs/jpeg6/jerror.cpp\ - libs/jpeg6/jfdctflt.cpp\ - libs/jpeg6/jidctflt.cpp\ - libs/jpeg6/jmemmgr.cpp\ - libs/jpeg6/jmemnobs.cpp\ - libs/jpeg6/jpgload.cpp\ - libs/jpeg6/jutils.cpp\ - libs/l_net/l_net.c\ - libs/l_net/l_net_berkley.c\ - libs/l_net/l_net_wins.c\ - libs/mathlib/bbox.c\ - libs/mathlib/linear.c\ - libs/mathlib/m4x4.c\ - libs/mathlib/mathlib.c\ - libs/mathlib/ray.c\ - libs/pak/pakstuff.cpp\ - libs/pak/unzip.cpp\ - libs/synapse/synapse.cpp\ - plugins/image/bmp.cpp\ - plugins/image/image.cpp\ - plugins/image/jpeg.cpp\ - plugins/image/lbmlib.cpp\ - plugins/mapq3/parse.cpp\ - plugins/mapq3/plugin.cpp\ - plugins/mapq3/write.cpp\ - plugins/mapxml/plugin.cpp\ - plugins/mapxml/xmlparse.cpp\ - plugins/mapxml/xmlwrite.cpp\ - plugins/md3model/eclassmodel.cpp\ - plugins/md3model/entitymodel.cpp\ - plugins/md3model/md3model.cpp\ - plugins/md3model/md3surface.cpp\ - plugins/md3model/miscmodel.cpp\ - plugins/md3model/plugin.cpp\ - plugins/sample/sample.cpp\ - plugins/sample/stdafx.cpp\ - plugins/shaders/plugin.cpp\ - plugins/shaders/shaders.cpp\ - plugins/surface/plugtexdef.cpp\ - plugins/surface/surfdlg.cpp\ - plugins/surface/surfplug.cpp\ - plugins/textool/2DView.cpp\ - plugins/textool/ControlPointsManager.cpp\ - plugins/textool/StdAfx.cpp\ - plugins/textool/TexTool.cpp\ - plugins/vfspak/vfs.cpp\ - plugins/vfspak/vfspak.cpp\ - plugins/vfspk3/unzip.cpp\ - plugins/vfspk3/vfs.cpp\ - plugins/vfspk3/vfspk3.cpp\ - radiant/bp_dlg.cpp\ - radiant/brush.cpp\ - radiant/brush_primit.cpp\ - radiant/brushscript.cpp\ - radiant/camwindow.cpp\ - radiant/csg.cpp\ - radiant/dialog.cpp\ - radiant/dialoginfo.cpp\ - radiant/drag.cpp\ - radiant/eclass.cpp\ - radiant/entity.cpp\ - radiant/feedback.cpp\ - radiant/file.cpp\ - radiant/filters.cpp\ - radiant/findtexturedialog.cpp\ - radiant/glinterface.cpp\ - radiant/glwidget.cpp\ - radiant/glwindow.cpp\ - radiant/groupdialog.cpp\ - radiant/gtkdlgs.cpp\ - radiant/gtkfilesel-darwin.c\ - radiant/gtkfilesel-linux.c\ - radiant/gtkfilesel.c\ - radiant/gtkmisc.cpp\ - radiant/iepairs.cpp\ - radiant/main.cpp\ - radiant/mainframe.cpp\ - radiant/map.cpp\ - radiant/missing.cpp\ - radiant/parse.cpp\ - radiant/patchdialog.cpp\ - radiant/plugin.cpp\ - radiant/pluginentities.cpp\ - radiant/pluginmanager.cpp\ - radiant/pmesh.cpp\ - radiant/points.cpp\ - radiant/preferences.cpp\ - radiant/profile.cpp\ - radiant/qe3.cpp\ - radiant/qgl-mac.c\ - radiant/qgl.c\ - radiant/queuedraw.cpp\ - radiant/select.cpp\ - radiant/selectedface.cpp\ - radiant/stdafx.cpp\ - radiant/surfacedialog.cpp\ - radiant/surfaceplugin.cpp\ - radiant/texmanip.cpp\ - radiant/texwindow.cpp\ - radiant/ui.cpp\ - radiant/undo.cpp\ - radiant/vertsel.cpp\ - radiant/watchbsp.cpp\ - radiant/winding.cpp\ - radiant/xywindow.cpp\ - radiant/z.cpp\ - radiant/zwindow.cpp\ - tools/quake3/common/aselib.c\ - tools/quake3/common/bspfile.c\ - tools/quake3/common/cmdlib.c\ - tools/quake3/common/imagelib.c\ - tools/quake3/common/inout.c\ - tools/quake3/common/l3dslib.c\ - tools/quake3/common/md4.c\ - tools/quake3/common/mutex.c\ - tools/quake3/common/polylib.c\ - tools/quake3/common/scriplib.c\ - tools/quake3/common/threads.c\ - tools/quake3/common/trilib.c\ - tools/quake3/common/unzip.c\ - tools/quake3/common/vfs.c\ - tools/quake3/q3data/3dslib.c\ - tools/quake3/q3data/compress.c\ - tools/quake3/q3data/images.c\ - tools/quake3/q3data/md3lib.c\ - tools/quake3/q3data/models.c\ - tools/quake3/q3data/oldstuff.c\ - tools/quake3/q3data/p3dlib.c\ - tools/quake3/q3data/polyset.c\ - tools/quake3/q3data/q3data.c\ - tools/quake3/q3data/stripper.c\ - tools/quake3/q3data/video.c\ - tools/quake3/q3map/NetConnect/main.c\ - tools/quake3/q3map/brush.c\ - tools/quake3/q3map/brush_primit.c\ - tools/quake3/q3map/bsp.c\ - tools/quake3/q3map/facebsp.c\ - tools/quake3/q3map/fog.c\ - tools/quake3/q3map/gldraw.c\ - tools/quake3/q3map/glfile.c\ - tools/quake3/q3map/leakfile.c\ - tools/quake3/q3map/light.c\ - tools/quake3/q3map/light_bounce.c\ - tools/quake3/q3map/light_trace.c\ - tools/quake3/q3map/lightmaps.c\ - tools/quake3/q3map/lightv.c\ - tools/quake3/q3map/map.c\ - tools/quake3/q3map/mesh.c\ - tools/quake3/q3map/misc_model.c\ - tools/quake3/q3map/nodraw.c\ - tools/quake3/q3map/patch.c\ - tools/quake3/q3map/path_init.c\ - tools/quake3/q3map/portals.c\ - tools/quake3/q3map/prtfile.c\ - tools/quake3/q3map/shaders.c\ - tools/quake3/q3map/surface.c\ - tools/quake3/q3map/terrain.c\ - tools/quake3/q3map/tjunction.c\ - tools/quake3/q3map/tree.c\ - tools/quake3/q3map/vis.c\ - tools/quake3/q3map/visflow.c\ - tools/quake3/q3map/writebsp.c\ - tools/quake3/q3map/NetTest/main.c\ - plugins/archivepak/archive.cpp\ - plugins/archivepak/plugin.cpp - -module.pixmap.name=. -module.pixmap.type= -module.pixmap.expanded=0 -module.pixmap.files=\ - Doxygen_files/example/doxygen.gif\ - Doxygen_files/example/graph_legend.gif\ - Doxygen_files/images/body-left-tile.gif\ - Doxygen_files/images/body-lower-left.gif\ - Doxygen_files/images/body-lower-right.gif\ - Doxygen_files/images/body-lower-tile.gif\ - Doxygen_files/images/body-right-tile.gif\ - Doxygen_files/images/body-upper-left.gif\ - Doxygen_files/images/body-upper-right.gif\ - Doxygen_files/images/body-upper-tile.gif\ - Doxygen_files/images/gtkr_splash.jpg\ - Doxygen_files/images/gtkr_splash_sm.jpg\ - Doxygen_files/images/history_id_logo.gif\ - Doxygen_files/images/top-right.gif\ - Doxygen_files/images/top-tile.gif\ - Doxygen_files/images/top-title.gif\ - contrib/patches/Gtk/fileselect/back.xpm\ - contrib/patches/Gtk/fileselect/forward.xpm\ - contrib/patches/Gtk/fileselect/refresh.xpm\ - contrib/patches/Gtk/fileselect/up.xpm\ - docs/developer/Inspector/classdiagram1.gif\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png\ - docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png\ - docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif\ - docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif\ - docs/manual/quake3/Terrain_Manual/pages/Image3.gif\ - docs/manual/quake3/Terrain_Manual/pages/Image4.gif\ - docs/manual/quake3/Terrain_Manual/pages/Image5.gif\ - docs/manual/quake3/Terrain_Manual/pages/Image6.gif\ - docs/manual/quake3/Terrain_Manual/pics/background.jpg\ - docs/manual/quake3/Terrain_Manual/pics/start.gif\ - docs/manual/quake3/Terrain_Manual/pics/terrain.jpg\ - plugins/textool/Doc/Image2.jpg\ - setup/linux/Help/DocsArt/toolback.jpg\ - setup/linux/radiant.xpm\ - setup/linux/setup.data/splash.xpm - -module.data.name=. -module.data.type= -module.data.expanded=0 -module.data.files= - -module.help.name=. -module.help.type= -module.help.expanded=0 -module.help.files= - -module.doc.name=. -module.doc.type= -module.doc.expanded=0 -module.doc.files=\ - INSTALL\ - README\ - Doxygen_files/example/annotated.html\ - Doxygen_files/example/classIEpair-members.html\ - Doxygen_files/example/classIEpair.html\ - Doxygen_files/example/classes.html\ - Doxygen_files/example/files.html\ - Doxygen_files/example/functions.html\ - Doxygen_files/example/graph_legend.html\ - Doxygen_files/example/index.html\ - Doxygen_files/example/pages.html\ - Doxygen_files/example/test_8c-source.html\ - Doxygen_files/example/test_8c.html\ - Doxygen_files/example/todo.html\ - Doxygen_files/doxygen_gtkradiant_foot.html\ - Doxygen_files/doxygen_gtkradiant_head.html\ - Doxygen_files/doxygen_index.html\ - Doxygen_files/doxygen_reference_foot.html\ - Doxygen_files/doxygen_reference_head.html\ - Doxygen_files/reference1.html\ - contrib/patches/Gtk/fileselect/README\ - docs/developer/TODO\ - docs/manual/quake3/Compile_Manual/index.html\ - docs/manual/quake3/Compile_Manual/q3map.html\ - docs/manual/quake3/New_Teams_For_Q3TA/index.html\ - docs/manual/quake3/Q3AShader_Manual/appendix/appA.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html\ - docs/manual/quake3/Team_Arena_Mapping_Help/start.html\ - docs/manual/quake3/Terrain_Manual/pages/adding_bots.html\ - docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html\ - docs/manual/quake3/Terrain_Manual/pages/art_tools.html\ - docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html\ - docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html\ - docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html\ - docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html\ - docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html\ - docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html\ - docs/manual/quake3/Terrain_Manual/pages/glossary.html\ - docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html\ - docs/manual/quake3/Terrain_Manual/pages/height_maps.html\ - docs/manual/quake3/Terrain_Manual/pages/introduction.html\ - docs/manual/quake3/Terrain_Manual/pages/key_changes.html\ - docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html\ - docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html\ - docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html\ - docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html\ - docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html\ - docs/manual/quake3/Terrain_Manual/pages/related_links.html\ - docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html\ - docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html\ - docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html\ - docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html\ - docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html\ - docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html\ - docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html\ - docs/manual/quake3/Terrain_Manual/start.html\ - plugins/textool/Doc/TexTool.html\ - setup/PluginSDK/README.html\ - setup/PluginSDK/TODO\ - setup/data/tools/credits.html\ - setup/linux/Help/Index.html\ - setup/win32/TODO\ - www/coding.html\ - www/files.html\ - www/gtkradiant.html\ - www/hosted.html\ - www/index.html\ - www/reviews.html - -module.po.expanded=0 -module.po.files= - -compiler.options.supports= -compiler.options.include.paths=\ - .\ - .. -compiler.options.library.paths= -compiler.options.libraries= -compiler.options.libraries.selected= -compiler.options.defines=\ - HAVE_CONFIG_H -compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 -compiler.options.optimize.buttons=0 0 1 0 -compiler.options.other.buttons=1 0 -compiler.options.other.c.flags= -compiler.options.other.l.flags= -compiler.options.other.l.libs= -project.source.paths= - +# Anjuta Version 1.1.97 +Compatibility Level: 1 + + +level editor for Id technology games + + + + + + + + + + + + + + + + + + +props.file.type=project + +anjuta.version=1.1.97 +anjuta.compatibility.level=1 + +project.name=GtkRadiant +project.type=GENERIC +project.target.type=EXECUTABLE +project.version=changesallthetime +project.author=qeradiant.com dev team +project.source.target=install/radiant.x86 +project.has.gettext=0 +project.gui.command= +project.programming.language=C_C++ +project.excluded.modules= intl + +project.config.extra.modules.before= +project.config.extra.modules.after= +project.config.blocked=1 +project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 + +project.menu.entry=GtkRadiant Version changesallthetime +project.menu.group=Application +project.menu.comment=GtkRadiant Version changesallthetime +project.menu.icon= +project.menu.need.terminal=0 + +project.configure.options= +anjuta.program.arguments= +cons.linkeddir= + +preferences.build.option.jobs=0 +preferences.build.option.silent=0 +preferences.build.option.autosave=1 +preferences.make=scons +preferences.build.option.keep.going=1 +preferences.build.option.warn.undef=0 +preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss +preferences.autoformat.style=Style of Kangleipak +preferences.indent.opening=0 +preferences.autoformat.disable=0 +preferences.indent.automatic=1 +preferences.use.tabs=0 +preferences.indent.size=2 +preferences.tabsize=2 +preferences.indent.closing=0 + +module.include.name=. +module.include.type= +module.include.files=\ + Doxygen_files/doxy_mainpage.h\ + contrib/bobtoolz/CPortals.h\ + contrib/bobtoolz/DBobView.h\ + contrib/bobtoolz/DBrush.h\ + contrib/bobtoolz/DEPair.h\ + contrib/bobtoolz/DEntity.h\ + contrib/bobtoolz/DListener.h\ + contrib/bobtoolz/DMap.h\ + contrib/bobtoolz/DPatch.h\ + contrib/bobtoolz/DPlane.h\ + contrib/bobtoolz/DPoint.h\ + contrib/bobtoolz/DShape.h\ + contrib/bobtoolz/DVisDrawer.h\ + contrib/bobtoolz/DWinding.h\ + contrib/bobtoolz/StdAfx.h\ + contrib/bobtoolz/bobToolz.h\ + contrib/bobtoolz/bsploader.h\ + contrib/bobtoolz/ctfresource_gtk.h\ + contrib/bobtoolz/funchandlers.h\ + contrib/bobtoolz/lists.h\ + contrib/bobtoolz/misc.h\ + contrib/bobtoolz/resource-gtk.h\ + contrib/bobtoolz/resource.h\ + contrib/bobtoolz/shapes.h\ + contrib/bobtoolz/visfind.h\ + contrib/bobtoolz/dialogs/AboutDialog.h\ + contrib/bobtoolz/dialogs/AutoCaulkDialog.h\ + contrib/bobtoolz/dialogs/AutoCaulkStartDialog.h\ + contrib/bobtoolz/dialogs/BrushCheckDialog.h\ + contrib/bobtoolz/dialogs/DoorDialog.h\ + contrib/bobtoolz/dialogs/IntersectDialog.h\ + contrib/bobtoolz/dialogs/IntersectInfoDialog.h\ + contrib/bobtoolz/dialogs/PolygonDialog.h\ + contrib/bobtoolz/dialogs/StairDialog.h\ + contrib/bobtoolz/dialogs/TextureResetDialog.h\ + contrib/bobtoolz/dialogs/dialogs-gtk.h\ + contrib/bobtoolz/dialogs/pathplotterdialog.h\ + contrib/gtkgensurf/gendlgs.h\ + contrib/gtkgensurf/gensurf.h\ + contrib/gtkgensurf/triangle.h\ + contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.h\ + contrib/prtview/AboutDialog.h\ + contrib/prtview/ConfigDialog.h\ + contrib/prtview/LoadPortalFileDialog.h\ + contrib/prtview/gtkdlgs.h\ + contrib/prtview/portals.h\ + contrib/prtview/prtview.h\ + contrib/prtview/resource.h\ + contrib/prtview/stdafx.h\ + docs/developer/XMLPush/StdAfx.h\ + include/gtkr_list.h\ + include/gtkr_vector.h\ + include/ibrush.h\ + include/ibspfrontend.h\ + include/idata.h\ + include/idatastream.h\ + include/ientity.h\ + include/iepairs.h\ + include/ifilesystem.h\ + include/igl.h\ + include/iimage.h\ + include/imap.h\ + include/imodel.h\ + include/ipatch.h\ + include/ipluginentities.h\ + include/irefcount.h\ + include/iscriplib.h\ + include/iselectedface.h\ + include/ishaders.h\ + include/ishadersmanager.h\ + include/isurfaceplugin.h\ + include/iui.h\ + include/iui_gtk.h\ + include/qerplugin.h\ + include/qertypes.h\ + include/qsysprintf.h\ + include/stl_check.h\ + include/stream_version.h\ + libs/bytebool.h\ + libs/cmdlib.h\ + libs/jpeglib.h\ + libs/mathlib.h\ + libs/missing.h\ + libs/multimon.h\ + libs/pakstuff.h\ + libs/str.h\ + libs/synapse.h\ + libs/jpeg6/jchuff.h\ + libs/jpeg6/jconfig.h\ + libs/jpeg6/jdct.h\ + libs/jpeg6/jdhuff.h\ + libs/jpeg6/jerror.h\ + libs/jpeg6/jinclude.h\ + libs/jpeg6/jmemsys.h\ + libs/jpeg6/jmorecfg.h\ + libs/jpeg6/jpegint.h\ + libs/jpeg6/jversion.h\ + libs/l_net/l_net.h\ + libs/l_net/l_net_wins.h\ + libs/pak/unzip.h\ + plugins/image/bmp.h\ + plugins/image/image.h\ + plugins/image/lbmlib.h\ + plugins/mapq3/plugin.h\ + plugins/mapxml/plugin.h\ + plugins/md3model/entitymodel.h\ + plugins/md3model/md3.h\ + plugins/md3model/md3model.h\ + plugins/md3model/md3surface.h\ + plugins/md3model/plugin.h\ + plugins/md3model/surface.h\ + plugins/sample/stdafx.h\ + plugins/sample/str.h\ + plugins/shaders/plugin.h\ + plugins/shaders/shaders.h\ + plugins/surface/plugtexdef.h\ + plugins/surface/surfdlg.h\ + plugins/surface/surfplug.h\ + plugins/textool/2DView.h\ + plugins/textool/ControlPointsManager.h\ + plugins/textool/StdAfx.h\ + plugins/textool/resource.h\ + plugins/vfspak/vfs.h\ + plugins/vfspak/vfspak.h\ + plugins/vfspk3/unzip-vfspk3.h\ + plugins/vfspk3/vfs.h\ + plugins/vfspk3/vfspk3.h\ + radiant/brush.h\ + radiant/camera.h\ + radiant/camwindow.h\ + radiant/dialog.h\ + radiant/entity.h\ + radiant/epairswrapper.h\ + radiant/feedback.h\ + radiant/file.h\ + radiant/filters.h\ + radiant/findtexturedialog.h\ + radiant/glwidget.h\ + radiant/glwindow.h\ + radiant/groupdialog.h\ + radiant/gtkfilesel-darwin.h\ + radiant/gtkfilesel-linux.h\ + radiant/gtkfilesel.h\ + radiant/gtkmisc.h\ + radiant/mainframe.h\ + radiant/map.h\ + radiant/parse.h\ + radiant/patchdialog.h\ + radiant/plugin.h\ + radiant/pluginmanager.h\ + radiant/points.h\ + radiant/preferences.h\ + radiant/qe3.h\ + radiant/qedefs.h\ + radiant/qfiles.h\ + radiant/qgl.h\ + radiant/resource.h\ + radiant/select.h\ + radiant/stdafx.h\ + radiant/surfacedialog.h\ + radiant/texmanip.h\ + radiant/textures.h\ + radiant/texwindow.h\ + radiant/ui.h\ + radiant/undo.h\ + radiant/watchbsp.h\ + radiant/winding.h\ + radiant/xmlstuff.h\ + radiant/xywindow.h\ + radiant/z.h\ + radiant/zwindow.h\ + tools/quake3/common/aselib.h\ + tools/quake3/common/bspfile.h\ + tools/quake3/common/cmdlib.h\ + tools/quake3/common/imagelib.h\ + tools/quake3/common/inout.h\ + tools/quake3/common/l3dslib.h\ + tools/quake3/common/mutex.h\ + tools/quake3/common/polylib.h\ + tools/quake3/common/polyset.h\ + tools/quake3/common/qfiles.h\ + tools/quake3/common/qthreads.h\ + tools/quake3/common/scriplib.h\ + tools/quake3/common/surfaceflags.h\ + tools/quake3/common/trilib.h\ + tools/quake3/common/unzip.h\ + tools/quake3/common/vfs.h\ + tools/quake3/q3data/3dslib.h\ + tools/quake3/q3data/md3lib.h\ + tools/quake3/q3data/p3dlib.h\ + tools/quake3/q3data/q3data.h\ + tools/quake3/q3map/Heapagnt.h\ + tools/quake3/q3map/game_t.h\ + tools/quake3/q3map/light.h\ + tools/quake3/q3map/mesh.h\ + tools/quake3/q3map/qbsp.h\ + tools/quake3/q3map/shaders.h\ + tools/quake3/q3map/vis.h + +module.source.name=. +module.source.type= +module.source.files=\ + contrib/bobtoolz/DBobView.cpp\ + contrib/bobtoolz/DBrush.cpp\ + contrib/bobtoolz/DEPair.cpp\ + contrib/bobtoolz/DEntity.cpp\ + contrib/bobtoolz/DListener.cpp\ + contrib/bobtoolz/DMap.cpp\ + contrib/bobtoolz/DPatch.cpp\ + contrib/bobtoolz/DPlane.cpp\ + contrib/bobtoolz/DPoint.cpp\ + contrib/bobtoolz/DShape.cpp\ + contrib/bobtoolz/DVisDrawer.cpp\ + contrib/bobtoolz/DWinding.cpp\ + contrib/bobtoolz/StdAfx.cpp\ + contrib/bobtoolz/bobToolz-GTK.cpp\ + contrib/bobtoolz/bobToolz.cpp\ + contrib/bobtoolz/bsploader.cpp\ + contrib/bobtoolz/cportals.cpp\ + contrib/bobtoolz/ctfToolz-GTK.cpp\ + contrib/bobtoolz/funchandlers-GTK.cpp\ + contrib/bobtoolz/funchandlers-ctf-GTK.cpp\ + contrib/bobtoolz/funchandlers.cpp\ + contrib/bobtoolz/lists.cpp\ + contrib/bobtoolz/misc.cpp\ + contrib/bobtoolz/shapes.cpp\ + contrib/bobtoolz/visfind.cpp\ + contrib/bobtoolz/dialogs/AboutDialog.cpp\ + contrib/bobtoolz/dialogs/AutoCaulkDialog.cpp\ + contrib/bobtoolz/dialogs/AutoCaulkStartDialog.cpp\ + contrib/bobtoolz/dialogs/DoorDialog.cpp\ + contrib/bobtoolz/dialogs/IntersectDialog.cpp\ + contrib/bobtoolz/dialogs/IntersectInfoDialog.cpp\ + contrib/bobtoolz/dialogs/PolygonDialog.cpp\ + contrib/bobtoolz/dialogs/StairDialog.cpp\ + contrib/bobtoolz/dialogs/TextureResetDialog.cpp\ + contrib/bobtoolz/dialogs/brushcheckdialog.cpp\ + contrib/bobtoolz/dialogs/dialogs-gtk.cpp\ + contrib/bobtoolz/dialogs/pathplotterdialog.cpp\ + 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/heretic.cpp\ + contrib/gtkgensurf/plugin.cpp\ + contrib/gtkgensurf/triangle.c\ + contrib/gtkgensurf/view.cpp\ + contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.c\ + contrib/prtview/AboutDialog.cpp\ + contrib/prtview/ConfigDialog.cpp\ + contrib/prtview/LoadPortalFileDialog.cpp\ + contrib/prtview/gtkdlgs.cpp\ + contrib/prtview/portals.cpp\ + contrib/prtview/prtview.cpp\ + contrib/prtview/stdafx.cpp\ + docs/developer/XMLPush/StdAfx.cpp\ + docs/developer/XMLPush/XMLPush.cpp\ + docs/manual/quake3/Compile_Manual/cfgq3.c\ + libs/cmdlib/cmdlib.cpp\ + libs/jpeg6/jcomapi.cpp\ + libs/jpeg6/jdapimin.cpp\ + libs/jpeg6/jdapistd.cpp\ + libs/jpeg6/jdatasrc.cpp\ + libs/jpeg6/jdcoefct.cpp\ + libs/jpeg6/jdcolor.cpp\ + libs/jpeg6/jddctmgr.cpp\ + libs/jpeg6/jdhuff.cpp\ + libs/jpeg6/jdinput.cpp\ + libs/jpeg6/jdmainct.cpp\ + libs/jpeg6/jdmarker.cpp\ + libs/jpeg6/jdmaster.cpp\ + libs/jpeg6/jdpostct.cpp\ + libs/jpeg6/jdsample.cpp\ + libs/jpeg6/jdtrans.cpp\ + libs/jpeg6/jerror.cpp\ + libs/jpeg6/jfdctflt.cpp\ + libs/jpeg6/jidctflt.cpp\ + libs/jpeg6/jmemmgr.cpp\ + libs/jpeg6/jmemnobs.cpp\ + libs/jpeg6/jpgload.cpp\ + libs/jpeg6/jutils.cpp\ + libs/l_net/l_net.c\ + libs/l_net/l_net_berkley.c\ + libs/l_net/l_net_wins.c\ + libs/mathlib/bbox.c\ + libs/mathlib/linear.c\ + libs/mathlib/m4x4.c\ + libs/mathlib/mathlib.c\ + libs/mathlib/ray.c\ + libs/pak/pakstuff.cpp\ + libs/pak/unzip.cpp\ + libs/synapse/synapse.cpp\ + plugins/image/bmp.cpp\ + plugins/image/image.cpp\ + plugins/image/jpeg.cpp\ + plugins/image/lbmlib.cpp\ + plugins/mapq3/parse.cpp\ + plugins/mapq3/plugin.cpp\ + plugins/mapq3/write.cpp\ + plugins/mapxml/plugin.cpp\ + plugins/mapxml/xmlparse.cpp\ + plugins/mapxml/xmlwrite.cpp\ + plugins/md3model/eclassmodel.cpp\ + plugins/md3model/entitymodel.cpp\ + plugins/md3model/md3model.cpp\ + plugins/md3model/md3surface.cpp\ + plugins/md3model/miscmodel.cpp\ + plugins/md3model/plugin.cpp\ + plugins/sample/sample.cpp\ + plugins/sample/stdafx.cpp\ + plugins/shaders/plugin.cpp\ + plugins/shaders/shaders.cpp\ + plugins/surface/plugtexdef.cpp\ + plugins/surface/surfdlg.cpp\ + plugins/surface/surfplug.cpp\ + plugins/textool/2DView.cpp\ + plugins/textool/ControlPointsManager.cpp\ + plugins/textool/StdAfx.cpp\ + plugins/textool/TexTool.cpp\ + plugins/vfspak/vfs.cpp\ + plugins/vfspak/vfspak.cpp\ + plugins/vfspk3/unzip.cpp\ + plugins/vfspk3/vfs.cpp\ + plugins/vfspk3/vfspk3.cpp\ + radiant/bp_dlg.cpp\ + radiant/brush.cpp\ + radiant/brush_primit.cpp\ + radiant/brushscript.cpp\ + radiant/camwindow.cpp\ + radiant/csg.cpp\ + radiant/dialog.cpp\ + radiant/dialoginfo.cpp\ + radiant/drag.cpp\ + radiant/eclass.cpp\ + radiant/entity.cpp\ + radiant/feedback.cpp\ + radiant/file.cpp\ + radiant/filters.cpp\ + radiant/findtexturedialog.cpp\ + radiant/glinterface.cpp\ + radiant/glwidget.cpp\ + radiant/glwindow.cpp\ + radiant/groupdialog.cpp\ + radiant/gtkdlgs.cpp\ + radiant/gtkfilesel-darwin.c\ + radiant/gtkfilesel-linux.c\ + radiant/gtkfilesel.c\ + radiant/gtkmisc.cpp\ + radiant/iepairs.cpp\ + radiant/main.cpp\ + radiant/mainframe.cpp\ + radiant/map.cpp\ + radiant/missing.cpp\ + radiant/parse.cpp\ + radiant/patchdialog.cpp\ + radiant/plugin.cpp\ + radiant/pluginentities.cpp\ + radiant/pluginmanager.cpp\ + radiant/pmesh.cpp\ + radiant/points.cpp\ + radiant/preferences.cpp\ + radiant/profile.cpp\ + radiant/qe3.cpp\ + radiant/qgl-mac.c\ + radiant/qgl.c\ + radiant/queuedraw.cpp\ + radiant/select.cpp\ + radiant/selectedface.cpp\ + radiant/stdafx.cpp\ + radiant/surfacedialog.cpp\ + radiant/surfaceplugin.cpp\ + radiant/texmanip.cpp\ + radiant/texwindow.cpp\ + radiant/ui.cpp\ + radiant/undo.cpp\ + radiant/vertsel.cpp\ + radiant/watchbsp.cpp\ + radiant/winding.cpp\ + radiant/xywindow.cpp\ + radiant/z.cpp\ + radiant/zwindow.cpp\ + tools/quake3/common/aselib.c\ + tools/quake3/common/bspfile.c\ + tools/quake3/common/cmdlib.c\ + tools/quake3/common/imagelib.c\ + tools/quake3/common/inout.c\ + tools/quake3/common/l3dslib.c\ + tools/quake3/common/md4.c\ + tools/quake3/common/mutex.c\ + tools/quake3/common/polylib.c\ + tools/quake3/common/scriplib.c\ + tools/quake3/common/threads.c\ + tools/quake3/common/trilib.c\ + tools/quake3/common/unzip.c\ + tools/quake3/common/vfs.c\ + tools/quake3/q3data/3dslib.c\ + tools/quake3/q3data/compress.c\ + tools/quake3/q3data/images.c\ + tools/quake3/q3data/md3lib.c\ + tools/quake3/q3data/models.c\ + tools/quake3/q3data/oldstuff.c\ + tools/quake3/q3data/p3dlib.c\ + tools/quake3/q3data/polyset.c\ + tools/quake3/q3data/q3data.c\ + tools/quake3/q3data/stripper.c\ + tools/quake3/q3data/video.c\ + tools/quake3/q3map/NetConnect/main.c\ + tools/quake3/q3map/brush.c\ + tools/quake3/q3map/brush_primit.c\ + tools/quake3/q3map/bsp.c\ + tools/quake3/q3map/facebsp.c\ + tools/quake3/q3map/fog.c\ + tools/quake3/q3map/gldraw.c\ + tools/quake3/q3map/glfile.c\ + tools/quake3/q3map/leakfile.c\ + tools/quake3/q3map/light.c\ + tools/quake3/q3map/light_bounce.c\ + tools/quake3/q3map/light_trace.c\ + tools/quake3/q3map/lightmaps.c\ + tools/quake3/q3map/lightv.c\ + tools/quake3/q3map/map.c\ + tools/quake3/q3map/mesh.c\ + tools/quake3/q3map/misc_model.c\ + tools/quake3/q3map/nodraw.c\ + tools/quake3/q3map/patch.c\ + tools/quake3/q3map/path_init.c\ + tools/quake3/q3map/portals.c\ + tools/quake3/q3map/prtfile.c\ + tools/quake3/q3map/shaders.c\ + tools/quake3/q3map/surface.c\ + tools/quake3/q3map/terrain.c\ + tools/quake3/q3map/tjunction.c\ + tools/quake3/q3map/tree.c\ + tools/quake3/q3map/vis.c\ + tools/quake3/q3map/visflow.c\ + tools/quake3/q3map/writebsp.c\ + tools/quake3/q3map/NetTest/main.c + +module.pixmap.name=. +module.pixmap.type= +module.pixmap.files=\ + Doxygen_files/example/doxygen.gif\ + Doxygen_files/example/graph_legend.gif\ + Doxygen_files/images/body-left-tile.gif\ + Doxygen_files/images/body-lower-left.gif\ + Doxygen_files/images/body-lower-right.gif\ + Doxygen_files/images/body-lower-tile.gif\ + Doxygen_files/images/body-right-tile.gif\ + Doxygen_files/images/body-upper-left.gif\ + Doxygen_files/images/body-upper-right.gif\ + Doxygen_files/images/body-upper-tile.gif\ + Doxygen_files/images/gtkr_splash.jpg\ + Doxygen_files/images/gtkr_splash_sm.jpg\ + Doxygen_files/images/history_id_logo.gif\ + Doxygen_files/images/top-right.gif\ + Doxygen_files/images/top-tile.gif\ + Doxygen_files/images/top-title.gif\ + contrib/patches/Gtk/fileselect/back.xpm\ + contrib/patches/Gtk/fileselect/forward.xpm\ + contrib/patches/Gtk/fileselect/refresh.xpm\ + contrib/patches/Gtk/fileselect/up.xpm\ + docs/developer/Inspector/classdiagram1.gif\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png\ + docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png\ + docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif\ + docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif\ + docs/manual/quake3/Terrain_Manual/pages/Image3.gif\ + docs/manual/quake3/Terrain_Manual/pages/Image4.gif\ + docs/manual/quake3/Terrain_Manual/pages/Image5.gif\ + docs/manual/quake3/Terrain_Manual/pages/Image6.gif\ + docs/manual/quake3/Terrain_Manual/pics/background.jpg\ + docs/manual/quake3/Terrain_Manual/pics/start.gif\ + docs/manual/quake3/Terrain_Manual/pics/terrain.jpg\ + plugins/textool/Doc/Image2.jpg\ + setup/linux/Help/DocsArt/toolback.jpg\ + setup/linux/radiant.xpm\ + setup/linux/setup.data/splash.xpm + +module.data.name=. +module.data.type= +module.data.files= + +module.help.name=. +module.help.type= +module.help.files= + +module.doc.name=. +module.doc.type= +module.doc.files=\ + INSTALL\ + README\ + Doxygen_files/example/annotated.html\ + Doxygen_files/example/classIEpair-members.html\ + Doxygen_files/example/classIEpair.html\ + Doxygen_files/example/classes.html\ + Doxygen_files/example/files.html\ + Doxygen_files/example/functions.html\ + Doxygen_files/example/graph_legend.html\ + Doxygen_files/example/index.html\ + Doxygen_files/example/pages.html\ + Doxygen_files/example/test_8c-source.html\ + Doxygen_files/example/test_8c.html\ + Doxygen_files/example/todo.html\ + Doxygen_files/doxygen_gtkradiant_foot.html\ + Doxygen_files/doxygen_gtkradiant_head.html\ + Doxygen_files/doxygen_index.html\ + Doxygen_files/doxygen_reference_foot.html\ + Doxygen_files/doxygen_reference_head.html\ + Doxygen_files/reference1.html\ + contrib/patches/Gtk/fileselect/README\ + docs/developer/TODO\ + docs/manual/quake3/Compile_Manual/index.html\ + docs/manual/quake3/Compile_Manual/q3map.html\ + docs/manual/quake3/New_Teams_For_Q3TA/index.html\ + docs/manual/quake3/Q3AShader_Manual/appendix/appA.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html\ + docs/manual/quake3/Team_Arena_Mapping_Help/start.html\ + docs/manual/quake3/Terrain_Manual/pages/adding_bots.html\ + docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html\ + docs/manual/quake3/Terrain_Manual/pages/art_tools.html\ + docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html\ + docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html\ + docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html\ + docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html\ + docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html\ + docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html\ + docs/manual/quake3/Terrain_Manual/pages/glossary.html\ + docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html\ + docs/manual/quake3/Terrain_Manual/pages/height_maps.html\ + docs/manual/quake3/Terrain_Manual/pages/introduction.html\ + docs/manual/quake3/Terrain_Manual/pages/key_changes.html\ + docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html\ + docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html\ + docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html\ + docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html\ + docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html\ + docs/manual/quake3/Terrain_Manual/pages/related_links.html\ + docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html\ + docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html\ + docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html\ + docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html\ + docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html\ + docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html\ + docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html\ + docs/manual/quake3/Terrain_Manual/start.html\ + plugins/textool/Doc/TexTool.html\ + setup/PluginSDK/README.html\ + setup/PluginSDK/TODO\ + setup/data/tools/credits.html\ + setup/linux/Help/Index.html\ + setup/win32/TODO\ + www/coding.html\ + www/files.html\ + www/gtkradiant.html\ + www/hosted.html\ + www/index.html\ + www/reviews.html + +module.po.files= + +compiler.options.supports= +compiler.options.include.paths=\ + .\ + .. +compiler.options.library.paths= +compiler.options.libraries= +compiler.options.libraries.selected= +compiler.options.defines=\ + HAVE_CONFIG_H +compiler.options.defines.selected= +compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 +compiler.options.optimize.buttons=0 0 1 0 +compiler.options.other.buttons=1 0 +compiler.options.other.c.flags= +compiler.options.other.l.flags= +compiler.options.other.l.libs= + +project.src.paths= diff --git a/GtkRadiant.sln b/GtkRadiant.sln deleted file mode 100644 index dfbfdb67..00000000 --- a/GtkRadiant.sln +++ /dev/null @@ -1,272 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "entityq3", "plugins\entity\entityq3.vcproj", "{49C5823A-5E50-4029-ACEE-1627EBB79E47}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GtkRadiant", "radiant\GtkRadiant.vcproj", "{8E70385C-223A-4DD1-9B99-28FF2331A2B5}" - ProjectSection(ProjectDependencies) = postProject - {1C785349-866D-447D-8C55-8A51E5CA0E87} = {1C785349-866D-447D-8C55-8A51E5CA0E87} - {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407} = {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845D5C1-4154-425F-8643-447FADC03449} = {8845D5C1-4154-425F-8643-447FADC03449} - {BED4E2E5-0368-4042-9898-4914B0372468} = {BED4E2E5-0368-4042-9898-4914B0372468} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen", "gen.vcproj", "{BED4E2E5-0368-4042-9898-4914B0372468}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "l_net", "libs\l_net\l_net.vcproj", "{8845D5C1-4154-425F-8643-447FADC03449}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmdlib", "libs\cmdlib\cmdlib.vcproj", "{8845C5C1-4154-425F-8643-447FADC03449}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archivepak", "plugins\archivepak\archivepak.vcproj", "{75160E63-E642-4C71-9D4C-B733E152C418}" - ProjectSection(ProjectDependencies) = postProject - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archivewad", "plugins\archivewad\archivewad.vcproj", "{9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}" - ProjectSection(ProjectDependencies) = postProject - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archivezip", "plugins\archivezip\archivezip.vcproj", "{A7E0FE03-E9BB-4478-9752-250BBD406C2D}" - ProjectSection(ProjectDependencies) = postProject - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imageq3", "plugins\image\imageq3.vcproj", "{0A0D3519-2ADD-4B47-A890-746170B2CCD8}" - ProjectSection(ProjectDependencies) = postProject - {8576EC58-4E54-49C0-879A-F054C92B1D03} = {8576EC58-4E54-49C0-879A-F054C92B1D03} - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741} = {0501A08E-D4D7-42C1-9E2A-BA3F2F320741} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modelmd3", "plugins\md3model\modelmd3.vcproj", "{C2A5530D-C2DB-4503-A651-4B92AEC5FE74}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modelpico", "plugins\model\modelpico.vcproj", "{386DBF35-2F76-4BB1-8B4B-1D69C34F8996}" - ProjectSection(ProjectDependencies) = postProject - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9} = {015EA9D3-85F2-4C4E-BFC3-430AC59093B9} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfsq3", "plugins\vfspk3\vfsq3.vcproj", "{0BB50F1C-E139-48A2-B9D8-1E781275777F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapq3", "plugins\mapq3\mapq3.vcproj", "{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapxml", "plugins\mapxml\mapxml.vcproj", "{B43DBA9D-6EE0-421C-83D9-9776064B66B4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shadersq3", "plugins\shaders\shadersq3.vcproj", "{F79DCF6D-72B1-45F6-A471-5209951C0BDD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "picomodel", "libs\picomodel\picomodel.vcproj", "{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg6", "libs\jpeg6\jpeg6.vcproj", "{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagehl", "plugins\imagehl\imagehl.vcproj", "{15DEA3EA-9386-49C7-80C6-5B090DE1D536}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagepng", "plugins\imagepng\imagepng.vcproj", "{15DEA4EA-9386-49C7-80C6-5B090DE1D536}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "q3map2", "tools\quake3\q3map2\q3map2.vcproj", "{8ED67991-58A6-44AA-9B3A-3217085EF187}" - ProjectSection(ProjectDependencies) = postProject - {BF0FF048-887F-4D43-A455-F8C04FB98F10} = {BF0FF048-887F-4D43-A455-F8C04FB98F10} - {8576EC58-4E54-49C0-879A-F054C92B1D03} = {8576EC58-4E54-49C0-879A-F054C92B1D03} - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741} = {0501A08E-D4D7-42C1-9E2A-BA3F2F320741} - {8845C5C1-4154-425F-8643-447FADC03449} = {8845C5C1-4154-425F-8643-447FADC03449} - {8845D5C1-4154-425F-8643-447FADC03449} = {8845D5C1-4154-425F-8643-447FADC03449} - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9} = {015EA9D3-85F2-4C4E-BFC3-430AC59093B9} - {BED4E2E5-0368-4042-9898-4914B0372468} = {BED4E2E5-0368-4042-9898-4914B0372468} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ddslib", "libs\ddslib\ddslib.vcproj", "{8576EC58-4E54-49C0-879A-F054C92B1D03}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mathlib", "libs\mathlib\mathlib.vcproj", "{BF0FF048-887F-4D43-A455-F8C04FB98F10}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libs", "libs\libs.vcproj", "{1C785349-866D-447D-8C55-8A51E5CA0E87}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "include", "include\include.vcproj", "{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "profile", "libs\profile\profile.vcproj", "{853632F4-6420-40C5-B80B-38B678E472B8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imageq2", "plugins\imageq2\imageq2.vcproj", "{697E77F2-9E9E-4F12-973F-C1214494248C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "plugins\sample\sample.vcproj", "{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "q2map", "tools\quake2\q2map\q2map.vcproj", "{FB80DE6C-51C8-4D56-876D-C7878A4EB10B}" - ProjectSection(ProjectDependencies) = postProject - {8845D5C1-4154-425F-8643-447FADC03449} = {8845D5C1-4154-425F-8643-447FADC03449} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtkutil", "libs\gtkutil\gtkutil.vcproj", "{68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrtView", "contrib\prtview\PrtView.vcproj", "{B20364D1-4329-4D4E-B9CE-C9767618FDD6}" - ProjectSection(ProjectDependencies) = postProject - {853632F4-6420-40C5-B80B-38B678E472B8} = {853632F4-6420-40C5-B80B-38B678E472B8} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bobtoolz", "contrib\bobtoolz\bobtoolz.vcproj", "{439FE12C-77F0-44CD-BC9B-803B3E92C197}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sunplug", "contrib\sunplug\sunplug.vcproj", "{46B36F0C-5E17-458E-AE6F-AECE52F66EDF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "brushexport", "contrib\brushexport\brushexport.vcproj", "{334D54AE-9AF7-43EA-BC64-2E31846B972E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaderplug", "contrib\shaderplug\shaderplug.vcproj", "{0B09566E-63DB-4A28-A555-BBE2747769B6}" - ProjectSection(ProjectDependencies) = postProject - {1C785349-866D-447D-8C55-8A51E5CA0E87} = {1C785349-866D-447D-8C55-8A51E5CA0E87} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ufoai", "contrib\ufoaiplug\ufoai.vcproj", "{623CDF9E-ACC5-43E2-8E8D-B6266235A044}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {49C5823A-5E50-4029-ACEE-1627EBB79E47}.Debug|Win32.ActiveCfg = Debug|Win32 - {49C5823A-5E50-4029-ACEE-1627EBB79E47}.Debug|Win32.Build.0 = Debug|Win32 - {49C5823A-5E50-4029-ACEE-1627EBB79E47}.Release|Win32.ActiveCfg = Release|Win32 - {49C5823A-5E50-4029-ACEE-1627EBB79E47}.Release|Win32.Build.0 = Release|Win32 - {8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Debug|Win32.Build.0 = Debug|Win32 - {8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Release|Win32.ActiveCfg = Release|Win32 - {8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Release|Win32.Build.0 = Release|Win32 - {BED4E2E5-0368-4042-9898-4914B0372468}.Debug|Win32.ActiveCfg = Debug|Win32 - {BED4E2E5-0368-4042-9898-4914B0372468}.Debug|Win32.Build.0 = Debug|Win32 - {BED4E2E5-0368-4042-9898-4914B0372468}.Release|Win32.ActiveCfg = Release|Win32 - {BED4E2E5-0368-4042-9898-4914B0372468}.Release|Win32.Build.0 = Release|Win32 - {8845D5C1-4154-425F-8643-447FADC03449}.Debug|Win32.ActiveCfg = Debug|Win32 - {8845D5C1-4154-425F-8643-447FADC03449}.Debug|Win32.Build.0 = Debug|Win32 - {8845D5C1-4154-425F-8643-447FADC03449}.Release|Win32.ActiveCfg = Release|Win32 - {8845D5C1-4154-425F-8643-447FADC03449}.Release|Win32.Build.0 = Release|Win32 - {8845C5C1-4154-425F-8643-447FADC03449}.Debug|Win32.ActiveCfg = Debug|Win32 - {8845C5C1-4154-425F-8643-447FADC03449}.Debug|Win32.Build.0 = Debug|Win32 - {8845C5C1-4154-425F-8643-447FADC03449}.Release|Win32.ActiveCfg = Release|Win32 - {8845C5C1-4154-425F-8643-447FADC03449}.Release|Win32.Build.0 = Release|Win32 - {75160E63-E642-4C71-9D4C-B733E152C418}.Debug|Win32.ActiveCfg = Debug|Win32 - {75160E63-E642-4C71-9D4C-B733E152C418}.Debug|Win32.Build.0 = Debug|Win32 - {75160E63-E642-4C71-9D4C-B733E152C418}.Release|Win32.ActiveCfg = Release|Win32 - {75160E63-E642-4C71-9D4C-B733E152C418}.Release|Win32.Build.0 = Release|Win32 - {9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Debug|Win32.ActiveCfg = Debug|Win32 - {9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Debug|Win32.Build.0 = Debug|Win32 - {9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Release|Win32.ActiveCfg = Release|Win32 - {9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Release|Win32.Build.0 = Release|Win32 - {A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Debug|Win32.ActiveCfg = Debug|Win32 - {A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Debug|Win32.Build.0 = Debug|Win32 - {A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Release|Win32.ActiveCfg = Release|Win32 - {A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Release|Win32.Build.0 = Release|Win32 - {0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Debug|Win32.ActiveCfg = Debug|Win32 - {0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Debug|Win32.Build.0 = Debug|Win32 - {0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Release|Win32.ActiveCfg = Release|Win32 - {0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Release|Win32.Build.0 = Release|Win32 - {C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Debug|Win32.ActiveCfg = Debug|Win32 - {C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Debug|Win32.Build.0 = Debug|Win32 - {C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Release|Win32.ActiveCfg = Release|Win32 - {C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Release|Win32.Build.0 = Release|Win32 - {386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Debug|Win32.ActiveCfg = Debug|Win32 - {386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Debug|Win32.Build.0 = Debug|Win32 - {386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Release|Win32.ActiveCfg = Release|Win32 - {386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Release|Win32.Build.0 = Release|Win32 - {0BB50F1C-E139-48A2-B9D8-1E781275777F}.Debug|Win32.ActiveCfg = Debug|Win32 - {0BB50F1C-E139-48A2-B9D8-1E781275777F}.Debug|Win32.Build.0 = Debug|Win32 - {0BB50F1C-E139-48A2-B9D8-1E781275777F}.Release|Win32.ActiveCfg = Release|Win32 - {0BB50F1C-E139-48A2-B9D8-1E781275777F}.Release|Win32.Build.0 = Release|Win32 - {D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Debug|Win32.ActiveCfg = Debug|Win32 - {D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Debug|Win32.Build.0 = Debug|Win32 - {D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Release|Win32.ActiveCfg = Release|Win32 - {D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Release|Win32.Build.0 = Release|Win32 - {B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Debug|Win32.ActiveCfg = Debug|Win32 - {B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Debug|Win32.Build.0 = Debug|Win32 - {B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Release|Win32.ActiveCfg = Release|Win32 - {B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Release|Win32.Build.0 = Release|Win32 - {F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Debug|Win32.ActiveCfg = Debug|Win32 - {F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Debug|Win32.Build.0 = Debug|Win32 - {F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Release|Win32.ActiveCfg = Release|Win32 - {F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Release|Win32.Build.0 = Release|Win32 - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Debug|Win32.ActiveCfg = Debug|Win32 - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Debug|Win32.Build.0 = Debug|Win32 - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Release|Win32.ActiveCfg = Release|Win32 - {015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Release|Win32.Build.0 = Release|Win32 - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Debug|Win32.ActiveCfg = Debug|Win32 - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Debug|Win32.Build.0 = Debug|Win32 - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Release|Win32.ActiveCfg = Release|Win32 - {0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Release|Win32.Build.0 = Release|Win32 - {15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Debug|Win32.ActiveCfg = Debug|Win32 - {15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Debug|Win32.Build.0 = Debug|Win32 - {15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Release|Win32.ActiveCfg = Release|Win32 - {15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Release|Win32.Build.0 = Release|Win32 - {15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Debug|Win32.ActiveCfg = Debug|Win32 - {15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Debug|Win32.Build.0 = Debug|Win32 - {15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Release|Win32.ActiveCfg = Release|Win32 - {15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Release|Win32.Build.0 = Release|Win32 - {8ED67991-58A6-44AA-9B3A-3217085EF187}.Debug|Win32.ActiveCfg = Debug|Win32 - {8ED67991-58A6-44AA-9B3A-3217085EF187}.Debug|Win32.Build.0 = Debug|Win32 - {8ED67991-58A6-44AA-9B3A-3217085EF187}.Release|Win32.ActiveCfg = Release|Win32 - {8ED67991-58A6-44AA-9B3A-3217085EF187}.Release|Win32.Build.0 = Release|Win32 - {8576EC58-4E54-49C0-879A-F054C92B1D03}.Debug|Win32.ActiveCfg = Debug|Win32 - {8576EC58-4E54-49C0-879A-F054C92B1D03}.Debug|Win32.Build.0 = Debug|Win32 - {8576EC58-4E54-49C0-879A-F054C92B1D03}.Release|Win32.ActiveCfg = Release|Win32 - {8576EC58-4E54-49C0-879A-F054C92B1D03}.Release|Win32.Build.0 = Release|Win32 - {BF0FF048-887F-4D43-A455-F8C04FB98F10}.Debug|Win32.ActiveCfg = Debug|Win32 - {BF0FF048-887F-4D43-A455-F8C04FB98F10}.Debug|Win32.Build.0 = Debug|Win32 - {BF0FF048-887F-4D43-A455-F8C04FB98F10}.Release|Win32.ActiveCfg = Release|Win32 - {BF0FF048-887F-4D43-A455-F8C04FB98F10}.Release|Win32.Build.0 = Release|Win32 - {1C785349-866D-447D-8C55-8A51E5CA0E87}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C785349-866D-447D-8C55-8A51E5CA0E87}.Debug|Win32.Build.0 = Debug|Win32 - {1C785349-866D-447D-8C55-8A51E5CA0E87}.Release|Win32.ActiveCfg = Release|Win32 - {1C785349-866D-447D-8C55-8A51E5CA0E87}.Release|Win32.Build.0 = Release|Win32 - {04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Debug|Win32.ActiveCfg = Debug|Win32 - {04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Debug|Win32.Build.0 = Debug|Win32 - {04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Release|Win32.ActiveCfg = Release|Win32 - {04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Release|Win32.Build.0 = Release|Win32 - {853632F4-6420-40C5-B80B-38B678E472B8}.Debug|Win32.ActiveCfg = Debug|Win32 - {853632F4-6420-40C5-B80B-38B678E472B8}.Debug|Win32.Build.0 = Debug|Win32 - {853632F4-6420-40C5-B80B-38B678E472B8}.Release|Win32.ActiveCfg = Release|Win32 - {853632F4-6420-40C5-B80B-38B678E472B8}.Release|Win32.Build.0 = Release|Win32 - {697E77F2-9E9E-4F12-973F-C1214494248C}.Debug|Win32.ActiveCfg = Debug|Win32 - {697E77F2-9E9E-4F12-973F-C1214494248C}.Debug|Win32.Build.0 = Debug|Win32 - {697E77F2-9E9E-4F12-973F-C1214494248C}.Release|Win32.ActiveCfg = Release|Win32 - {697E77F2-9E9E-4F12-973F-C1214494248C}.Release|Win32.Build.0 = Release|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Debug|Win32.ActiveCfg = Debug|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Debug|Win32.Build.0 = Debug|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Release|Win32.ActiveCfg = Release|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Release|Win32.Build.0 = Release|Win32 - {FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Debug|Win32.ActiveCfg = Debug|Win32 - {FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Debug|Win32.Build.0 = Debug|Win32 - {FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Release|Win32.ActiveCfg = Release|Win32 - {FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Release|Win32.Build.0 = Release|Win32 - {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Debug|Win32.ActiveCfg = Debug|Win32 - {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Debug|Win32.Build.0 = Debug|Win32 - {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release|Win32.ActiveCfg = Release|Win32 - {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release|Win32.Build.0 = Release|Win32 - {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Debug|Win32.Build.0 = Debug|Win32 - {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Release|Win32.ActiveCfg = Release|Win32 - {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Release|Win32.Build.0 = Release|Win32 - {439FE12C-77F0-44CD-BC9B-803B3E92C197}.Debug|Win32.ActiveCfg = Debug|Win32 - {439FE12C-77F0-44CD-BC9B-803B3E92C197}.Debug|Win32.Build.0 = Debug|Win32 - {439FE12C-77F0-44CD-BC9B-803B3E92C197}.Release|Win32.ActiveCfg = Release|Win32 - {439FE12C-77F0-44CD-BC9B-803B3E92C197}.Release|Win32.Build.0 = Release|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDF}.Debug|Win32.ActiveCfg = Debug|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDF}.Debug|Win32.Build.0 = Debug|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDF}.Release|Win32.ActiveCfg = Release|Win32 - {46B36F0C-5E17-458E-AE6F-AECE52F66EDF}.Release|Win32.Build.0 = Release|Win32 - {334D54AE-9AF7-43EA-BC64-2E31846B972E}.Debug|Win32.ActiveCfg = Debug|Win32 - {334D54AE-9AF7-43EA-BC64-2E31846B972E}.Debug|Win32.Build.0 = Debug|Win32 - {334D54AE-9AF7-43EA-BC64-2E31846B972E}.Release|Win32.ActiveCfg = Release|Win32 - {334D54AE-9AF7-43EA-BC64-2E31846B972E}.Release|Win32.Build.0 = Release|Win32 - {0B09566E-63DB-4A28-A555-BBE2747769B6}.Debug|Win32.ActiveCfg = Debug|Win32 - {0B09566E-63DB-4A28-A555-BBE2747769B6}.Debug|Win32.Build.0 = Debug|Win32 - {0B09566E-63DB-4A28-A555-BBE2747769B6}.Release|Win32.ActiveCfg = Release|Win32 - {0B09566E-63DB-4A28-A555-BBE2747769B6}.Release|Win32.Build.0 = Release|Win32 - {623CDF9E-ACC5-43E2-8E8D-B6266235A044}.Debug|Win32.ActiveCfg = Debug|Win32 - {623CDF9E-ACC5-43E2-8E8D-B6266235A044}.Debug|Win32.Build.0 = Debug|Win32 - {623CDF9E-ACC5-43E2-8E8D-B6266235A044}.Release|Win32.ActiveCfg = Release|Win32 - {623CDF9E-ACC5-43E2-8E8D-B6266235A044}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 00000000..a9e72791 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,7 @@ +Compilation instructions +------------------------ + +See latest information for compiling and installation +on the developer pages: + +http://www.qeradiant.com/wikifaq/index.php?GtkRadiant%20Hacker diff --git a/LICENSE_ID b/LICENSE_ID new file mode 100644 index 00000000..e69de29b diff --git a/README b/README new file mode 100644 index 00000000..f611ded8 --- /dev/null +++ b/README @@ -0,0 +1,49 @@ +Terms and Conditions of Use + + +------- + +GTKRadiant contains software developed by Id Software, Loki Software and third +party contributors. + +All portions of GTKRadiant which are licensed by Id Software are subject to the +terms of its LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included +with GTKRadiant. If you did not receive a LIMITED USE SOFTWARE LICENSE +AGREEMENT, please contact Id Software immediately at info@idsoftware.com. + +All portions of GTKRadiant which have been developed by Loki Software and/or +third party contributors are licensed under the terms set forth below. + +------- + +Copyright (c) 1999-2000, Loki Software, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki Software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. No license is hereby granted to any trademarks, tradenames +or logos. + +THIS SOFTWARE IS PROVIDED BY LOKI AND THE CONTRIBUTORS "AS IS." ANY AND ALL +WARRANTUES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRENGEMENT ARE HEREBY DISCLAIMED. IN NO EVENT SHALL LOKI OR THE +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, WITHOUT LIMITATION, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. + +------- diff --git a/README.doxygen b/README.doxygen index f3847f67..effbf3f4 100644 --- a/README.doxygen +++ b/README.doxygen @@ -1,51 +1,51 @@ - Documentation for generating doxygen documentation ---------------------------------------------------------- - -1. Options for gendox -More up-to-date command line options are available via -the command ./gendox --help - -usage: "sh gendox [ ] [ -o ]" - or "./gendox [ ] [ -o ]" - - - The directory, or directories to generate the - documentation from. - --o - Specifies the output directory which - should follow the -o switch - --q --quiet - Stops the script from outputing status information, - other than errors. - --k --kill - Kills other running doxygen pids. - -eg: ./gendox include/ -o ../Documentation - -* This will produce documentation for the include files, -and output to the directory specified one level above the -current directory. - -The target can be the current directory "./" in which case -doxygen will generate documentation for all subdirectories -of the current directory recursively. - -The default output directory is currently ... -> ../GtkRadiant-doxygen - -* If the script is called without any target directories -it will generate documentation for the core of radiant... -include/ libs/ radiant/ and plugins/ - -If there are specific options that you'd like to customise, -the DoxyConfig file is used to generate the file from which -doxygen gets its settings from. So any changes that need -to be made should be made to this file. - - -Gef :] -(gefdavis@dingoblue.net.au) ---------------------------------------------------------- + Documentation for generating doxygen documentation +--------------------------------------------------------- + +1. Options for gendox +More up-to-date command line options are available via +the command ./gendox --help + +usage: "sh gendox [ ] [ -o ]" + or "./gendox [ ] [ -o ]" + + + The directory, or directories to generate the + documentation from. + +-o + Specifies the output directory which + should follow the -o switch + +-q --quiet + Stops the script from outputing status information, + other than errors. + +-k --kill + Kills other running doxygen pids. + +eg: ./gendox include/ -o ../Documentation + +* This will produce documentation for the include files, +and output to the directory specified one level above the +current directory. + +The target can be the current directory "./" in which case +doxygen will generate documentation for all subdirectories +of the current directory recursively. + +The default output directory is currently ... +> ../GtkRadiant-doxygen + +* If the script is called without any target directories +it will generate documentation for the core of radiant... +include/ libs/ radiant/ and plugins/ + +If there are specific options that you'd like to customise, +the DoxyConfig file is used to generate the file from which +doxygen gets its settings from. So any changes that need +to be made should be made to this file. + + +Gef :] +(gefdavis@dingoblue.net.au) +--------------------------------------------------------- diff --git a/SConscript b/SConscript deleted file mode 100644 index a0509a90..00000000 --- a/SConscript +++ /dev/null @@ -1,633 +0,0 @@ -import os, sys, commands, string -from makeversion import get_version -# OS Detection: -OS = commands.getoutput('uname') - -Import('GLOBALS') -Import(GLOBALS) - -def build_list(s_prefix, s_string): - s_list = Split(s_string) - for i in range(len(s_list)): - s_list[i] = s_prefix + '/' + s_list[i] - return s_list - -# common code ------------------------------------------------------ - -cmdlib_lib = g_env.StaticLibrary(target='libs/cmdlib', source='libs/cmdlib/cmdlib.cpp') - -xml_env = g_env.Copy() -xml_env.Prepend(CPPPATH = 'include') -xml_env.Append(CXXFLAGS='`pkg-config glib-2.0 --cflags` `xml2-config --cflags`') -xml_src = 'ixml.cpp xmlparser.cpp xmlwriter.cpp xmlelement.cpp xmltextags.cpp' -xml_lib = xml_env.StaticLibrary(target='libs/xmllib', source=build_list('libs/xml', xml_src)) - -mathlib_src = 'mathlib.c bbox.c line.c m4x4.c ray.c' -mathlib_lib = g_env.StaticLibrary(target='libs/mathlib', source=build_list('libs/mathlib', mathlib_src)) - -md5lib_lib = g_env.StaticLibrary(target='libs/md5lib', source='libs/md5lib/md5lib.c') - -ddslib_lib = g_env.StaticLibrary(target='libs/ddslib', source='libs/ddslib/ddslib.c') - -jpeg_env = g_env.Copy() -jpeg_env.Prepend(CPPPATH = 'libs/jpeg6') -jpeg_src = 'jcomapi.cpp jdcoefct.cpp jdinput.cpp jdpostct.cpp jfdctflt.cpp jpgload.cpp jdapimin.cpp jdcolor.cpp jdmainct.cpp jdsample.cpp jidctflt.cpp jutils.cpp jdapistd.cpp jddctmgr.cpp jdmarker.cpp jdtrans.cpp jmemmgr.cpp jdatasrc.cpp jdhuff.cpp jdmaster.cpp jerror.cpp jmemnobs.cpp' -jpeg_lib = jpeg_env.StaticLibrary(target='libs/jpeg6', source=build_list('libs/jpeg6', jpeg_src)) - -l_net_lib = g_env.StaticLibrary(target='libs/l_net', source=['libs/l_net/l_net.c', 'libs/l_net/l_net_berkley.c']) - -picomodel_src = 'picointernal.c picomodel.c picomodules.c pm_3ds.c pm_ase.c pm_md3.c pm_obj.c\ - pm_ms3d.c pm_mdc.c pm_fm.c pm_md2.c pm_lwo.c pm_terrain.c lwo/clip.c lwo/envelope.c lwo/list.c lwo/lwio.c\ - lwo/lwo2.c lwo/lwob.c lwo/pntspols.c lwo/surface.c lwo/vecmath.c lwo/vmap.c' -picomodel_lib = g_env.StaticLibrary(target='libs/picomodel', source=build_list('libs/picomodel', picomodel_src)) - -#splines_env = g_env.Copy() -#splines_src = build_list('libs/splines', 'math_angles.cpp math_matrix.cpp math_quaternion.cpp math_vector.cpp q_parse.cpp q_shared.cpp splines.cpp util_str.cpp') -#splines_env['CPPPATH'].append('include') -#splines_lib = splines_env.StaticLibrary(target='libs/splines', source=splines_src) - -profile_env = g_env.Copy(); -profile_env['CPPPATH'].append('include') -profile_src = 'profile.cpp file.cpp' -profile_lib = profile_env.StaticLibrary(target='libs/profile', source=build_list('libs/profile', profile_src)) - -gtkutil_env = g_env.Copy(); -gtkutil_env['CPPPATH'].append('include') -gtkutil_env.useGlib2() -gtkutil_env.useGtk2() -gtkutil_env.useGtkGLExt() - -gtkutil_src = '\ - accelerator.cpp\ - button.cpp\ - clipboard.cpp\ - closure.cpp\ - container.cpp\ - cursor.cpp\ - dialog.cpp\ - entry.cpp\ - frame.cpp\ - filechooser.cpp\ - glfont.cpp\ - glwidget.cpp\ - image.cpp\ - idledraw.cpp\ - menu.cpp\ - messagebox.cpp\ - nonmodal.cpp\ - paned.cpp\ - pointer.cpp\ - toolbar.cpp\ - widget.cpp\ - window.cpp\ - xorrectangle.cpp\ -' - -gtkutil_lib = gtkutil_env.StaticLibrary(target='libs/gtkutil', source=build_list('libs/gtkutil', gtkutil_src)) - -# end static / common libraries --------------------------------------------------- - -# q3map --------------------------------------------------------------------------- - -q3map_env = g_env.Copy() -q3map_env['CPPPATH'].append('include') -q3map_env.useXML2() -q3map_env.useGlib2() -q3map_env.usePNG() -q3map_env.useMHash() -q3map_env.usePThread() -q3map_env.Prepend(CPPPATH='tools/quake3/common') - -q3map_common_src = [ - 'common/cmdlib.c', - 'common/imagelib.c', - 'common/inout.c', - 'common/mutex.c', - 'common/polylib.c', - 'common/scriplib.c', - 'common/threads.c', - 'common/unzip.c', - 'common/vfs.c' ] - -q3map_src = [ - 'q3map2/brush.c', - 'q3map2/brush_primit.c', - 'q3map2/bsp.c', - 'q3map2/facebsp.c', - 'q3map2/fog.c', - 'q3map2/leakfile.c', - 'q3map2/map.c', - 'q3map2/model.c', - 'q3map2/patch.c', - 'q3map2/portals.c', - 'q3map2/prtfile.c', - 'q3map2/surface.c', - 'q3map2/surface_fur.c', - 'q3map2/surface_meta.c', - 'q3map2/tjunction.c', - 'q3map2/tree.c', - 'q3map2/writebsp.c', - 'q3map2/image.c', - 'q3map2/light.c', - 'q3map2/light_bounce.c', - 'q3map2/light_trace.c', - 'q3map2/light_ydnar.c', - 'q3map2/lightmaps_ydnar.c', - 'q3map2/vis.c', - 'q3map2/visflow.c', - 'q3map2/bspfile_abstract.c', - 'q3map2/bspfile_ibsp.c', - 'q3map2/bspfile_rbsp.c', - 'q3map2/decals.c', - 'q3map2/main.c', - 'q3map2/mesh.c', - 'q3map2/path_init.c', - 'q3map2/shaders.c', - 'q3map2/surface_extra.c', - 'q3map2/surface_foliage.c', - 'q3map2/convert_ase.c', - 'q3map2/convert_map.c' ] - -q3map_full_src = [ ] -for i in q3map_common_src + q3map_src: - q3map_full_src.append('tools/quake3/' + i) - -q3map_libs = ['mathlib', 'l_net', 'jpeg6', 'picomodel', 'ddslib'] - -q3map_prog = q3map_env.Program(target='q3map2.' + g_cpu, source=q3map_full_src, LIBS=q3map_libs, LIBPATH='libs') -q3map_env.Depends(q3map_prog, mathlib_lib) -q3map_env.Depends(q3map_prog, l_net_lib) -q3map_env.Depends(q3map_prog, jpeg_lib) -q3map_env.Depends(q3map_prog, picomodel_lib) -q3map_env.Depends(q3map_prog, ddslib_lib) -q3map_env.Install(INSTALL, q3map_prog) - -# end q3map2 ---------------------------------------------------------------------- - -# q3data --------------------------------------------------------------------------- - -q3data_env = q3map_env.Copy() - -q3data_common_src = [ - 'common/aselib.c', - 'common/bspfile.c', - 'common/cmdlib.c', - 'common/imagelib.c', - 'common/inout.c', - 'common/md4.c', - 'common/scriplib.c', - 'common/trilib.c', - 'common/unzip.c', - 'common/vfs.c' - ] - -q3data_src = [ - 'q3data/3dslib.c', - 'q3data/compress.c', - 'q3data/images.c', - 'q3data/md3lib.c', - 'q3data/models.c', - 'q3data/p3dlib.c', - 'q3data/polyset.c', - 'q3data/q3data.c', - 'q3data/stripper.c', - 'q3data/video.c' ] - -q3data_full_src = [ ] -for i in q3data_common_src + q3data_src: - q3data_full_src.append('tools/quake3/' + i) - -q3data_prog = q3data_env.Program( target = 'q3data.' + g_cpu, source = q3data_full_src, LIBS=['mathlib', 'l_net'], LIBPATH='libs' ) -q3data_env.Depends(q3data_prog, mathlib_lib) -q3data_env.Depends(q3data_prog, l_net_lib) -q3data_env.Install( INSTALL, q3data_prog ) - -# end q3data ---------------------------------------------------------------------- - -# q2_tools --------------------------------------------------------------------------- - -q2_tools_env = g_env.Copy() -q2_tools_env['CPPPATH'].append('include') -q2_tools_env.useXML2() -q2_tools_env.usePThread() -q2_tools_env.Prepend(CPPPATH='tools/quake2/common') - -q2_tools_common_src = [ - 'common/bspfile.c', - 'common/cmdlib.c', - 'common/inout.c', - 'common/l3dslib.c', - 'common/lbmlib.c', - 'common/mathlib.c', - 'common/md4.c', - 'common/path_init.c', - 'common/polylib.c', - 'common/scriplib.c', - 'common/threads.c', - 'common/trilib.c' -] - - -q2_tools_q2map_src = [ - 'q2map/brushbsp.c', - 'q2map/csg.c', - 'q2map/faces.c', - 'q2map/flow.c', - 'q2map/glfile.c', - 'q2map/leakfile.c', - 'q2map/lightmap.c', - 'q2map/main.c', - 'q2map/map.c', - 'q2map/nodraw.c', - 'q2map/patches.c', - 'q2map/portals.c', - 'q2map/prtfile.c', - 'q2map/qbsp.c', - 'q2map/qrad.c', - 'q2map/qvis.c', - 'q2map/textures.c', - 'q2map/trace.c', - 'q2map/tree.c', - 'q2map/writebsp.c' -] - -q2_tools_qdata3_common_src = [ - 'common/bspfile.c', - 'common/cmdlib.c', - 'common/inout.c', - 'common/l3dslib.c', - 'common/lbmlib.c', - 'common/mathlib.c', - 'common/md4.c', - 'common/path_init.c', - 'common/scriplib.c', - 'common/threads.c', - 'common/trilib.c' -] - -q2_tools_qdata3_src = [ - 'qdata/images.c', - 'qdata/models.c', - 'qdata/qdata.c', - 'qdata/sprites.c', - 'qdata/tables.c', - 'qdata/video.c' -] - -q2_tools_q2map_full_src = [ ] -for i in q2_tools_common_src + q2_tools_q2map_src: - q2_tools_q2map_full_src.append('tools/quake2/' + i) - -q2_tools_qdata3_full_src = [ ] -for i in q2_tools_common_src + q2_tools_qdata3_src: - q2_tools_qdata3_full_src.append('tools/quake2/' + i) - -if ( OS != 'Darwin' ): - q2_tools_q2map_prog = q2_tools_env.Program(target='quake2_tools/q2map', source=q2_tools_q2map_full_src, LIBS='l_net', LIBPATH='libs') - q2_tools_env.Depends(q2_tools_q2map_prog, l_net_lib) - q2_tools_env.Install(INSTALL, q2_tools_q2map_prog ) - - q2_tools_qdata3_prog = q2_tools_env.Program(target='quake2_tools/qdata3', source=q2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs') - q2_tools_env.Depends(q2_tools_qdata3_prog, l_net_lib) - q2_tools_env.Install(INSTALL, q2_tools_qdata3_prog ) - - -# end q2_tools ---------------------------------------------------------------------- - -# qdata3_heretic2 --------------------------------------------------------------------------- - -heretic2_tools_env = g_env.Copy() -heretic2_tools_env['CPPPATH'].append('include') -heretic2_tools_env.useXML2() -heretic2_tools_env.usePThread() -heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2') -heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/qcommon') -heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/common') - -heretic2_tools_qdata3_common_src = [ - 'qdata_heretic2/common/bspfile.c', - 'qdata_heretic2/common/cmdlib.c', - 'qdata_heretic2/common/inout.c', - 'qdata_heretic2/common/l3dslib.c', - 'qdata_heretic2/common/lbmlib.c', - 'qdata_heretic2/common/mathlib.c', - 'qdata_heretic2/common/md4.c', - 'qdata_heretic2/common/path_init.c', - 'qdata_heretic2/common/qfiles.c', - 'qdata_heretic2/common/scriplib.c', - 'qdata_heretic2/common/threads.c', - 'qdata_heretic2/common/token.c', - 'qdata_heretic2/common/trilib.c' -] - -heretic2_tools_qdata3_qcommon_src = [ - 'qdata_heretic2/qcommon/reference.c', - 'qdata_heretic2/qcommon/resourcemanager.c', - 'qdata_heretic2/qcommon/skeletons.c' -] - -heretic2_tools_qdata3_src = [ - 'qdata_heretic2/animcomp.c', - 'qdata_heretic2/book.c', - 'qdata_heretic2/fmodels.c', - 'qdata_heretic2/images.c', - 'qdata_heretic2/jointed.c', - 'qdata_heretic2/models.c', - 'qdata_heretic2/pics.c', - 'qdata_heretic2/qdata.c', - 'qdata_heretic2/qd_skeletons.c', - 'qdata_heretic2/sprites.c', - 'qdata_heretic2/svdcmp.c', - 'qdata_heretic2/tables.c', - 'qdata_heretic2/tmix.c', - 'qdata_heretic2/video.c' -] - -heretic2_tools_qdata3_full_src = [ ] -for i in heretic2_tools_qdata3_common_src + heretic2_tools_qdata3_qcommon_src + heretic2_tools_qdata3_src: - heretic2_tools_qdata3_full_src.append('tools/quake2/' + i) - - -heretic2_tools_env['CCFLAGS'] += '-D_LINUX ' - -if ( OS != 'Darwin' ): - heretic2_tools_prog = heretic2_tools_env.Program(target='h2data', source=heretic2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs') - heretic2_tools_env.Depends(heretic2_tools_prog, l_net_lib) - heretic2_tools_env.Install(INSTALL + '/heretic2', heretic2_tools_prog ) - -# end heretic2_tools ---------------------------------------------------------------------- - - - -# radiant, modules and plugins ---------------------------------------------------- - -module_env = g_env.Copy() -module_env['CPPPATH'].append('include') -if ( OS == 'Darwin' ): - module_env['LINKFLAGS'] += '-dynamiclib -ldl ' -else: - module_env['LINKFLAGS'] += '-ldl ' -module_env['LIBPREFIX'] = '' - - -vfspk3_env = module_env.Copy() -vfspk3_lst = build_list('plugins/vfspk3', 'vfspk3.cpp vfs.cpp archive.cpp') -vfspk3_env.useGlib2() -vfspk3_lib = vfspk3_env.SharedLibrarySafe(target='vfspk3', source=vfspk3_lst) -vfspk3_env.Install(INSTALL + '/modules', vfspk3_lib) - -archivepak_env = module_env.Copy() -archivepak_lst = build_list('plugins/archivepak', 'plugin.cpp archive.cpp pak.cpp') -archivepak_lib = archivepak_env.SharedLibrarySafe(target='archivepak', source=archivepak_lst, LIBS='cmdlib', LIBPATH='libs') -archivepak_env.Depends(archivepak_lib, cmdlib_lib) -archivepak_env.Install(INSTALL + '/modules', archivepak_lib) - -archivewad_env = module_env.Copy() -archivewad_lst = build_list('plugins/archivewad', 'plugin.cpp archive.cpp wad.cpp') -archivewad_lib = archivewad_env.SharedLibrarySafe(target='archivewad', source=archivewad_lst, LIBS='cmdlib', LIBPATH='libs') -archivewad_env.Depends(archivewad_lib, cmdlib_lib) -archivewad_env.Install(INSTALL + '/modules', archivewad_lib) - -archivezip_env = module_env.Copy() -archivezip_lst = build_list('plugins/archivezip', 'plugin.cpp archive.cpp pkzip.cpp zlibstream.cpp') -archivezip_env.useZLib() -archivezip_lib = archivezip_env.SharedLibrarySafe(target='archivezip', source=archivezip_lst, LIBS='cmdlib', LIBPATH='libs') -archivezip_env.Depends(archivezip_lib, cmdlib_lib) -archivezip_env.Install(INSTALL + '/modules', archivezip_lib) - -shaders_env = module_env.Copy() -shaders_lst = build_list('plugins/shaders', 'shaders.cpp plugin.cpp') -shaders_env.useGlib2() -shaders_lib = shaders_env.SharedLibrarySafe(target='shaders', source=shaders_lst, LIBS='cmdlib', LIBPATH='libs') -shaders_env.Depends(shaders_lib, cmdlib_lib) -shaders_env.Install(INSTALL + '/modules', shaders_lib) - -image_env = module_env.Copy() -image_lst = build_list('plugins/image', 'bmp.cpp jpeg.cpp image.cpp pcx.cpp tga.cpp dds.cpp') -image_lib = image_env.SharedLibrarySafe(target='image', source=image_lst, LIBS=['jpeg6', 'ddslib'], LIBPATH='libs') -image_env.Depends(image_lib, jpeg_lib) -image_env.Depends(image_lib, ddslib_lib) -image_env.Install(INSTALL + '/modules', image_lib) - -imagehl_lst=build_list('plugins/imagehl', 'imagehl.cpp hlw.cpp mip.cpp sprite.cpp') -imagehl_lib = module_env.SharedLibrarySafe(target='imagehl', source=imagehl_lst) -module_env.Install(INSTALL + '/modules', imagehl_lib) - -imageq2_lst = build_list('plugins/imageq2', 'imageq2.cpp wal.cpp wal32.cpp') -imageq2_lib = module_env.SharedLibrarySafe(target='imageq2', source=imageq2_lst) -module_env.Install(INSTALL + '/modules', imageq2_lib) - -mapq3_env = module_env.Copy() -mapq3_lst=build_list('plugins/mapq3', 'plugin.cpp parse.cpp write.cpp') -mapq3_lib = mapq3_env.SharedLibrarySafe(target='mapq3', source=mapq3_lst, LIBS='cmdlib', LIBPATH='libs') -mapq3_env.Depends(mapq3_lib, cmdlib_lib) -mapq3_env.Install(INSTALL + '/modules', mapq3_lib) - -imagepng_env = module_env.Copy() -imagepng_lst = build_list('plugins/imagepng', 'plugin.cpp') -imagepng_env.usePNG() -imagepng_lib = imagepng_env.SharedLibrarySafe(target='imagepng', source=imagepng_lst) -imagepng_env.Install(INSTALL + '/modules', imagepng_lib) - -mapxml_env = module_env.Copy() -mapxml_lst = build_list('plugins/mapxml', 'plugin.cpp xmlparse.cpp xmlwrite.cpp') -mapxml_lib = mapxml_env.SharedLibrarySafe(target='mapxml', source=mapxml_lst) -mapxml_env.useXML2() -mapxml_env.useGlib2() -mapxml_env.Install(INSTALL + '/modules', mapxml_lib) - -model_env = module_env.Copy() -model_lst = build_list('plugins/model', 'plugin.cpp model.cpp') -model_lib = model_env.SharedLibrarySafe(target='model', source=model_lst, LIBS=['mathlib', 'picomodel'], LIBPATH='libs') -model_env.Depends(model_lib, mathlib_lib) -model_env.Depends(model_lib, picomodel_lib) -model_env.Install(INSTALL + '/modules', model_lib) - -md3model_lst=build_list('plugins/md3model', 'plugin.cpp mdl.cpp md3.cpp md2.cpp mdc.cpp mdlimage.cpp md5.cpp') -md3model_lib = module_env.SharedLibrarySafe(target='md3model', source=md3model_lst) -module_env.Install(INSTALL + '/modules', md3model_lib) - -entity_lst = build_list('plugins/entity', 'plugin.cpp entity.cpp eclassmodel.cpp generic.cpp group.cpp light.cpp miscmodel.cpp doom3group.cpp skincache.cpp angle.cpp angles.cpp colour.cpp filters.cpp model.cpp namedentity.cpp origin.cpp scale.cpp targetable.cpp rotation.cpp modelskinkey.cpp') -entity_lib = module_env.SharedLibrarySafe(target='entity', source=entity_lst) -module_env.Install(INSTALL + '/modules', entity_lib) - -bob_env = module_env.Copy() -bob_lst = build_list('contrib/bobtoolz/', -'dialogs/dialogs-gtk.cpp bobToolz-GTK.cpp bsploader.cpp cportals.cpp DBobView.cpp \ -DBrush.cpp DEntity.cpp DEPair.cpp DMap.cpp DPatch.cpp DPlane.cpp DPoint.cpp \ -DShape.cpp DTrainDrawer.cpp DTreePlanter.cpp DVisDrawer.cpp DWinding.cpp funchandlers-GTK.cpp \ -lists.cpp misc.cpp ScriptParser.cpp shapes.cpp visfind.cpp') -bob_lib = bob_env.SharedLibrarySafe(target='bobtoolz', source=bob_lst, LIBS=['mathlib', 'cmdlib', 'profile'], LIBPATH='libs') -bob_env.Depends(bob_lib, mathlib_lib) -bob_env.Depends(bob_lib, cmdlib_lib) -bob_env.Depends(bob_lib, profile_lib) -bob_env.useGlib2() -bob_env.useGtk2() -bob_env.Install(INSTALL + '/plugins', bob_lib) - -#camera_lst = build_list('contrib/camera', -#'camera.cpp dialogs.cpp dialogs_common.cpp funchandlers.cpp listener.cpp misc.cpp renderer.cpp') -#camera_lst.append('libs/libsplines.a') -#bob_env.SharedLibrarySafe(target='camera', source=camera_lst) -#bob_env.Install(INSTALL + '/plugins', 'camera.so') - -prtview_env = module_env.Copy() -prtview_lst = build_list('contrib/prtview', 'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp') -prtview_env.useGlib2() -prtview_env.useGtk2() -prtview_lib = prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst, LIBS='profile', LIBPATH='libs') -prtview_env.Depends(prtview_lib, profile_lib) -prtview_env.Install(INSTALL + '/plugins', prtview_lib) - -brushexport2_env = module_env.Copy() -brushexport2_lst = build_list('contrib/brushexport', ['plugin.cpp','interface.cpp','callbacks.cpp', 'support.cpp', 'export.cpp']) -brushexport2_env.useGlib2() -brushexport2_env.useGtk2() -brushexport2_lib = brushexport2_env.SharedLibrarySafe(target='brushexport', source=brushexport2_lst, LIBPATH='libs') -brushexport2_env.Install(INSTALL + '/plugins', brushexport2_lib) - -sunplug_env = module_env.Copy() -sunplug_lst = build_list('contrib/sunplug', 'sunplug.cpp') -sunplug_env.useGlib2() -sunplug_env.useGtk2() -sunplug_lib = sunplug_env.SharedLibrarySafe(target='sunplug', source=sunplug_lst, LIBPATH='libs') -sunplug_env.Install(INSTALL + '/plugins', sunplug_lib) - -ufoai_env = module_env.Copy() -ufoai_lst = build_list('contrib/ufoaiplug', 'ufoai.cpp ufoai_filters.cpp ufoai_gtk.cpp ufoai_level.cpp') -ufoai_env.useGlib2() -ufoai_env.useGtk2() -ufoai_lib = ufoai_env.SharedLibrarySafe(target='ufoaiplug', source=ufoai_lst, LIBPATH='libs') -ufoai_env.Install(INSTALL + '/plugins', ufoai_lib) - -shaderplug_env = module_env.Copy() -shaderplug_lst = build_list('contrib/shaderplug', 'shaderplug.cpp') -shaderplug_env.useGlib2() -shaderplug_env.useGtk2() -shaderplug_env.useXML2() -shaderplug_lib = shaderplug_env.SharedLibrarySafe(target='shaderplug', source=shaderplug_lst, LIBS='xmllib', LIBPATH='libs') -shaderplug_env.Install(INSTALL + '/plugins', shaderplug_lib) - -#gensurf_lst = build_list('contrib/gtkgensurf', -#'bitmap.cpp dec.cpp face.cpp font.cpp gendlgs.cpp genmap.cpp gensurf.cpp heretic.cpp plugin.cpp view.cpp triangle.c') -#bob_env.SharedLibrarySafe(target='gensurf', source=gensurf_lst) -#bob_env.Install(INSTALL + '/plugins', 'gensurf.so') - -#bkgrnd2d_list = build_list( 'contrib/bkgrnd2d', 'bkgrnd2d.cpp plugin.cpp dialog.cpp' ) -#bkgrnd2d_list.append( 'libs/libsynapse.a' ) -#bkgrnd2d_env = module_env.Copy() -#bkgrnd2d_env.useGtk2() -#bkgrnd2d_env.SharedLibrarySafe( target='bkgrnd2d', source=bkgrnd2d_list ) -#bkgrnd2d_env.Install( INSTALL + '/plugins', 'bkgrnd2d.so' ) - -radiant_env = g_env.Copy() -radiant_env['CPPPATH'].append('include') -radiant_env['LINKFLAGS'] += '-ldl -lGL ' -if ( OS == 'Darwin' ): - radiant_env['CXXFLAGS'] += '-fno-common ' - radiant_env['CCFLAGS'] += '-fno-common ' - radiant_env['LINKFLAGS'] += '-lX11 -lGL -lGLU ' -radiant_env['LIBPREFIX'] = '' -radiant_env.useGlib2() -radiant_env.useXML2() -radiant_env.useGtk2() -radiant_env.useGtkGLExt() - -radiant_src = [ -'autosave.cpp', -'brush.cpp', -'brushmanip.cpp', -'brushmodule.cpp', -'brushnode.cpp', -'brushtokens.cpp', -'brushxml.cpp', -'brush_primit.cpp', -'build.cpp', -'camwindow.cpp', -'clippertool.cpp', -'commands.cpp', -'console.cpp', -'csg.cpp', -'dialog.cpp', -'eclass.cpp', -'eclass_def.cpp', -'eclass_doom3.cpp', -'eclass_fgd.cpp', -'eclass_xml.cpp', -'entity.cpp', -'entityinspector.cpp', -'entitylist.cpp', -'environment.cpp', -'error.cpp', -'feedback.cpp', -'filetypes.cpp', -'filters.cpp', -'findtexturedialog.cpp', -'glwidget.cpp', -'grid.cpp', -'groupdialog.cpp', -'gtkdlgs.cpp', -'gtkmisc.cpp', -'help.cpp', -'image.cpp', -'main.cpp', -'mainframe.cpp', -'map.cpp', -'mru.cpp', -'nullmodel.cpp', -'parse.cpp', -'patch.cpp', -'patchdialog.cpp', -'patchmanip.cpp', -'patchmodule.cpp', -'plugin.cpp', -'pluginapi.cpp', -'pluginmanager.cpp', -'pluginmenu.cpp', -'plugintoolbar.cpp', -'points.cpp', -'preferencedictionary.cpp', -'preferences.cpp', -'qe3.cpp', -'qgl.cpp', -'referencecache.cpp', -'renderer.cpp', -'renderstate.cpp', -'scenegraph.cpp', -'stacktrace.cpp', -'select.cpp', -'selection.cpp', -'server.cpp', -'shaders.cpp', -'sockets.cpp', -'surfacedialog.cpp', -'texmanip.cpp', -'textures.cpp', -'texwindow.cpp', -'timer.cpp', -'treemodel.cpp', -'undo.cpp', -'url.cpp', -'view.cpp', -'watchbsp.cpp', -'winding.cpp', -'windowobservers.cpp', -'xmlstuff.cpp', -'xywindow.cpp', -] - -for i in range(len(radiant_src)): - radiant_src[i] = 'radiant/' + radiant_src[i] - -radiant_libs = ['mathlib', 'cmdlib', 'l_net', 'profile', 'gtkutil', 'xmllib'] -radiant_prog = radiant_env.Program(target='radiant.' + g_cpu, source=radiant_src, LIBS=radiant_libs, LIBPATH='libs') -radiant_env.Depends(radiant_prog, mathlib_lib) -radiant_env.Depends(radiant_prog, cmdlib_lib) -radiant_env.Depends(radiant_prog, l_net_lib) -radiant_env.Depends(radiant_prog, profile_lib) -radiant_env.Depends(radiant_prog, gtkutil_lib) -radiant_env.Depends(radiant_prog, xml_lib) -radiant_env.Install(INSTALL, radiant_prog) - - -# end setup --------------------------------------------------------------------------------------- diff --git a/SConscript.lib b/SConscript.lib new file mode 100644 index 00000000..777fb2c8 --- /dev/null +++ b/SConscript.lib @@ -0,0 +1,34 @@ +# -*- mode: python -*- +# ZeroRadiant build scripts +# TTimo +# http://scons.sourceforge.net + +import os + +Import( [ 'utils', 'config', 'settings', 'project' ] ) + +( libpath, libname ) = os.path.split( project ) +libname = os.path.splitext( libname )[0] + +env = Environment() +settings.SetupEnvironment( env, config['name'] ) +proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) ) + +# some filtering. may need to improve that +add_sources = [] +( drop, files ) = proj.filterSource( r'.*l_net_wins\.c' ) +if ( len( drop ) != 0 ): + add_sources.append( 'l_net_berkeley.c' ) + +emit_func = env.StaticObject +try: + if ( config['shared'] ): + emit_func = env.SharedObject +except: + pass + +objects = [] +for i in files + add_sources: + objects.append( emit_func( os.path.join( libpath, i ) ) ) + +Return( 'objects' ) diff --git a/SConscript.module b/SConscript.module new file mode 100644 index 00000000..a7f25497 --- /dev/null +++ b/SConscript.module @@ -0,0 +1,60 @@ +# -*- mode: python -*- +# ZeroRadiant build scripts +# TTimo +# http://scons.sourceforge.net + +import os + +Import( [ 'utils', 'config', 'settings', 'project', 'shlib_objects' ] ) + +( libpath, libname ) = os.path.split( project ) +libname = os.path.splitext( libname )[0] + +env = Environment() +useJPEG = False +useGtk = False +useZ = False +usePNG = False +if ( libname == 'image' ): + useJPEG = True +if ( libname == 'surface' ): + useGtk = True +if ( libname == 'surface_ufoai' ): + useGtk = True +if ( libname == 'surface_quake2' ): + useGtk = True +if ( libname == 'surface_heretic2' ): + useGtk = True +if ( libname == 'bkgrnd2d' ): + useGtk = True +if ( libname == 'gtkgensurf' ): + useGtk = True +if ( libname == 'bobToolz_gtk' ): + useGtk = True +if ( libname == 'camera' ): + useGtk = True +if ( libname == 'PrtView' ): + useGtk = True +if ( libname == 'spritemodel' ): + useGtk = True +if ( libname == 'model' ): + useGtk = True +if ( libname == 'TexTool' ): + useGtk = True +if ( libname == 'imagepng' ): + usePNG = True + + +settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG, useZ = useZ, usePNG = usePNG ) +proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) ) + +# some filtering. may need to improve that +add_sources = [] +( drop, files ) = proj.filterSource( r'.*l_net_wins\.c' ) +if ( len( drop ) != 0 ): + add_sources.append( 'l_net_berkeley.c' ) + +module_base = env.SharedLibrary( os.path.join( 'modules', libname ), shlib_objects + [ os.path.join( libpath, i ) for i in files ] ) +module = env.AddPostAction( module_base, utils.CheckUnresolved ) + +Return( 'module' ) diff --git a/SConscript.q3map2 b/SConscript.q3map2 new file mode 100644 index 00000000..30ba5cbe --- /dev/null +++ b/SConscript.q3map2 @@ -0,0 +1,19 @@ +# -*- mode: python -*- +# ZeroRadiant build scripts +# TTimo +# http://scons.sourceforge.net + +import os + +Import( [ 'utils', 'config', 'settings', 'lib_objects' ] ) + +env = Environment() +settings.SetupEnvironment( env, config['name'] ) +env.Prepend( CPPPATH = [ '#tools/quake3/common' ] ) +env.Append( LIBS = [ 'pthread', 'png', 'jpeg' ] ) +proj = utils.vcproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3map2/q3map2.vcproj' ) ) +objects = lib_objects +objects += [ os.path.join( 'tools/quake3/q3map2', i ) for i in proj.getSourceFiles() ] +q3map2 = env.Program( 'q3map2', objects ) + +Return( 'q3map2' ) diff --git a/SConscript.radiant b/SConscript.radiant new file mode 100644 index 00000000..f37b0bb7 --- /dev/null +++ b/SConscript.radiant @@ -0,0 +1,18 @@ +# -*- mode: python -*- +# ZeroRadiant build scripts +# TTimo +# http://scons.sourceforge.net + +import os + +Import( [ 'utils', 'config', 'settings', 'lib_objects' ] ) + +env = Environment() +settings.SetupEnvironment( env, config[ 'name' ], useGtk = True, useGtkGL = True ) +proj = utils.vcproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcproj' ) ) + +radiant = env.Program( 'radiant.bin', lib_objects + [ os.path.join( 'radiant', i ) for i in proj.getSourceFiles() ] ) + +Return( 'radiant' ) + + diff --git a/SConstruct b/SConstruct index 15d0e6a8..a8307a6e 100644 --- a/SConstruct +++ b/SConstruct @@ -1,338 +1,59 @@ -# scons build script -# http://scons.sourceforge.net - -import commands, re, sys, os, pickle, string, popen2 -from makeversion import radiant_makeversion, get_version - -# to access some internal stuff -import SCons - -conf_filename='site.conf' -# there is a default hardcoded value, you can override on command line, those are saved between runs -# we only handle strings -serialized=['CC', 'CXX', 'JOBS', 'BUILD'] - -# help ------------------------------------------- - -Help(""" -Usage: scons [OPTIONS] [TARGET] [CONFIG] - -[OPTIONS] and [TARGET] are covered in command line options, use scons -H - -[CONFIG]: KEY="VALUE" [...] -a number of configuration options saved between runs in the """ + conf_filename + """ file -erase """ + conf_filename + """ to start with default settings again - -CC -CXX - Specify C and C++ compilers (defaults gcc and g++) - ex: CC="gcc-3.2" - You can use ccache and distcc, for instance: - CC="ccache distcc gcc" CXX="ccache distcc g++" - -JOBS - Parallel build - ex: JOBS="4" is a good setting on SMP machines - -BUILD - Use debug/release to select build settings - ex: BUILD="debug" - default is debug -""" -) - -# end help --------------------------------------- - -# sanity ----------------------------------------- - -# get a recent python release -# that is broken in current version: -# http://sourceforge.net/tracker/index.php?func=detail&aid=794145&group_id=30337&atid=398971 -#EnsurePythonVersion(2,1) -# above 0.90 -EnsureSConsVersion( 0, 96 ) -print 'SCons ' + SCons.__version__ - -# end sanity ------------------------------------- - -# system detection ------------------------------- - -# TODO: detect Darwin / OSX - -# CPU type -g_cpu = commands.getoutput('uname -m') -exp = re.compile('.*i?86.*') -if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'): - g_cpu = 'ppc' -elif exp.match(g_cpu): - g_cpu = 'x86' -else: - g_cpu = 'cpu' - -# OS -OS = commands.getoutput('uname') -print "OS=\"" + OS + "\"" - -if (OS == 'Linux'): - # libc .. do the little magic! - libc = commands.getoutput('/lib/libc.so.6 |grep "GNU C "|grep version|awk -F "version " \'{ print $2 }\'|cut -b -3') - -# end system detection --------------------------- - -# default settings ------------------------------- - -CC='gcc' -CXX='g++' -JOBS='1' -BUILD='debug' -INSTALL='#install' -g_build_root = 'build' - -# end default settings --------------------------- - -# site settings ---------------------------------- - -site_dict = {} -if (os.path.exists(conf_filename)): - site_file = open(conf_filename, 'r') - p = pickle.Unpickler(site_file) - site_dict = p.load() - print 'Loading build configuration from ' + conf_filename - for k, v in site_dict.items(): - exec_cmd = k + '=\"' + v + '\"' - print exec_cmd - exec(exec_cmd) - -# end site settings ------------------------------ - -# command line settings -------------------------- - -for k in serialized: - if (ARGUMENTS.has_key(k)): - exec_cmd = k + '=\"' + ARGUMENTS[k] + '\"' - print 'Command line: ' + exec_cmd - exec(exec_cmd) - -# end command line settings ---------------------- - -# sanity check ----------------------------------- - - -def GetGCCVersion(name): - ret = commands.getstatusoutput('%s -dumpversion' % name) - if ( ret[0] != 0 ): - return None - vers = string.split(ret[1], '.') - if ( len(vers) == 2 ): - return [ vers[0], vers[1], 0 ] - elif ( len(vers) == 3 ): - return vers - return None - -ver_cc = GetGCCVersion(CC) -ver_cxx = GetGCCVersion(CXX) - -if ( ver_cc is None or ver_cxx is None or ver_cc[0] < '3' or ver_cxx[0] < '3' or ver_cc != ver_cxx ): - print 'Compiler version check failed - need gcc 3.x or later:' - print 'CC: %s %s\nCXX: %s %s' % ( CC, repr(ver_cc), CXX, repr(ver_cxx) ) - Exit(1) - -# end sanity check ------------------------------- - -# save site configuration ---------------------- - -for k in serialized: - exec_cmd = 'site_dict[\'' + k + '\'] = ' + k - exec(exec_cmd) - -site_file = open(conf_filename, 'w') -p = pickle.Pickler(site_file) -p.dump(site_dict) -site_file.close() - -# end save site configuration ------------------ - -# general configuration, target selection -------- - -SConsignFile( "scons.signatures" ) - -g_build = g_build_root + '/' + BUILD - -SetOption('num_jobs', JOBS) - -LINK = CXX -# common flags -warningFlags = '-W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter ' -warningFlagsCXX = '-Wno-non-virtual-dtor -Wreorder ' # -Wold-style-cast -# POSIX macro: platform supports posix IEEE Std 1003.1:2001 -# XWINDOWS macro: platform supports X-Windows API -CCFLAGS = '-DPOSIX -DXWINDOWS ' + warningFlags -CXXFLAGS = '-pipe -DPOSIX -DXWINDOWS ' + warningFlags + warningFlagsCXX -CPPPATH = [] -if (BUILD == 'debug'): - CXXFLAGS += '-g3 -D_DEBUG ' - CCFLAGS += '-g3 -D_DEBUG ' -elif (BUILD == 'release' or BUILD == 'final'): - CXXFLAGS += '-O2 ' - CCFLAGS += '-O2 ' -else: - print 'Unknown build configuration ' + BUILD - sys.exit( 0 ) - -LINKFLAGS = '' -if ( OS == 'Linux' ): - - if ( BUILD == 'final' ): - # static - # 2112833 /opt/gtkradiant/radiant.x86 - # 35282 /opt/gtkradiant/modules/archivezip.so - # 600099 /opt/gtkradiant/modules/entity.so - - # dynamic - # 2237060 /opt/gtkradiant/radiant.x86 - # 110605 /opt/gtkradiant/modules/archivezip.so - # 730222 /opt/gtkradiant/modules/entity.so - - # EVIL HACK - force static-linking for libstdc++ - create a symbolic link to the static libstdc++ in the root - os.system("ln -s `g++ -print-file-name=libstdc++.a`") - - #if not os.path.exists("./install"): - # os.mkdir("./install") - #os.system("cp `g++ -print-file-name=libstdc++.so` ./install") - - # -fPIC might be worth removing when building for 32-bit x86 - CCFLAGS += '-fPIC ' - CXXFLAGS += '-fPIC -fno-exceptions -fno-rtti ' - LINKFLAGS += '-fPIC -Wl,-fini,fini_stub -L. -static-libgcc ' - -if ( OS == 'Darwin' ): - CCFLAGS += '-force_cpusubtype_ALL -fPIC ' - CXXFLAGS += '-force_cpusubtype_ALL -fPIC -fno-exceptions -fno-rtti ' - CPPPATH.append('/sw/include') - CPPPATH.append('/usr/X11R6/include') - LINKFLAGS += '-L/sw/lib -L/usr/lib -L/usr/X11R6/lib ' - -CPPPATH.append('libs') - -# extend the standard Environment a bit -class idEnvironment(Environment): - - def __init__(self): - Environment.__init__(self, - ENV = os.environ, - CC = CC, - CXX = CXX, - LINK = LINK, - CCFLAGS = CCFLAGS, - CXXFLAGS = CXXFLAGS, - CPPPATH = CPPPATH, - LINKFLAGS = LINKFLAGS) - - def useGlib2(self): - self['CXXFLAGS'] += '`pkg-config glib-2.0 --cflags` ' - self['CCFLAGS'] += '`pkg-config glib-2.0 --cflags` ' - if BUILD == 'final': - self['LINKFLAGS'] += '-lglib-2.0 ' - else: - self['LINKFLAGS'] += '`pkg-config glib-2.0 --libs` ' - - - def useXML2(self): - self['CXXFLAGS'] += '`xml2-config --cflags` ' - self['CCFLAGS'] += '`xml2-config --cflags` ' - if BUILD == 'final': - self['LINKFLAGS'] += '-lxml2 ' - else: - self['LINKFLAGS'] += '`xml2-config --libs` ' - - def useGtk2(self): - self['CXXFLAGS'] += '`pkg-config gtk+-2.0 --cflags` ' - self['CCFLAGS'] += '`pkg-config gtk+-2.0 --cflags` ' - if BUILD == 'final': - self['LINKFLAGS'] += '-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 ' - else: - self['LINKFLAGS'] += '`pkg-config gtk+-2.0 --libs-only-L` `pkg-config gtk+-2.0 --libs-only-l` ' - - def useGtkGLExt(self): - self['CXXFLAGS'] += '`pkg-config gtkglext-1.0 --cflags` ' - self['CCFLAGS'] += '`pkg-config gtkglext-1.0 --cflags` ' - #if BUILD == 'final': - self['LINKFLAGS'] += '-lgtkglext-x11-1.0 -lgdkglext-x11-1.0 ' - # apparently pkg-config for gtkglext includes --export-dynamic, which b0rks everything. - #else: - # self['LINKFLAGS'] += 'pkg-config gtkglext-1.0 --libs-only-L` `pkg-config gtkglext-1.0 --libs-only-l` ' - - def usePNG(self): - self['CXXFLAGS'] += '`libpng-config --cflags` ' - self['CCFLAGS'] += '`libpng-config --cflags` ' - self['LINKFLAGS'] += '`libpng-config --ldflags` ' - - def useMHash(self): - self['LINKFLAGS'] += '-lmhash ' - - def useZLib(self): - self['LINKFLAGS'] += '-lz ' - - def usePThread(self): - if ( OS == 'Darwin' ): - self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 ' - else: - self['LINKFLAGS'] += '-lpthread ' - - def CheckLDD(self, target, source, env): - file = target[0] - if (not os.path.isfile(file.abspath)): - print('ERROR: CheckLDD: target %s not found\n' % target[0]) - Exit(1) - # not using os.popen3 as I want to check the return code - ldd = popen2.Popen3('`which ldd` -r %s' % target[0], 1) - stdout_lines = ldd.fromchild.readlines() - stderr_lines = ldd.childerr.readlines() - ldd_ret = ldd.wait() - del ldd - have_undef = 0 - if ( ldd_ret != 0 ): - print "ERROR: ldd command returned with exit code %d" % ldd_ret - os.system('rm %s' % target[0]) - Exit() - for i_line in stderr_lines: - print repr(i_line) - regex = re.compile('undefined symbol: (.*)\t\\((.*)\\)\n') - if ( regex.match(i_line) ): - symbol = regex.sub('\\1', i_line) - try: - env['ALLOWED_SYMBOLS'].index(symbol) - except: - have_undef = 1 - else: - print "ERROR: failed to parse ldd stderr line: %s" % i_line - os.system('rm %s' % target[0]) - Exit(1) - if ( have_undef ): - print "ERROR: undefined symbols" - os.system('rm %s' % target[0]) - Exit(1) - - def SharedLibrarySafe(self, target, source, LIBS=[], LIBPATH='.'): - result = self.SharedLibrary(target, source, LIBS=LIBS, LIBPATH=LIBPATH) - if (OS != 'Darwin'): - AddPostAction(target + '.so', self.CheckLDD) - return result - -g_env = idEnvironment() - -# export the globals -GLOBALS = 'g_env INSTALL g_cpu' - -radiant_makeversion('\\ngcc version: %s.%s.%s' % ( ver_cc[0], ver_cc[1], ver_cc[2] ) ) - -# end general configuration ---------------------- - -# targets ---------------------------------------- - -Default('.') - -Export('GLOBALS ' + GLOBALS) -BuildDir(g_build, '.', duplicate = 0) -SConscript(g_build + '/SConscript') - -# end targets ------------------------------------ +# -*- mode: python -*- +# ZeroRadiant build scripts +# TTimo +# http://scons.sourceforge.net + +import sys, os, platform, cPickle + +import utils, config + +conf_filename = 'site.sconf' + +try: + sys.argv.index( '-h' ) +except: + pass +else: + Help( +""" +====================================================================== +ZeroRadiant build system quick help + +You need scons v0.97.0d20070918.r2446 or newer + +Default build (release), just run scons at the toplevel + +debug build: +$ scons config=debug +====================================================================== +""" ) + Return() + +active_configs = [] + +# load up configurations from the save file +if ( os.path.exists( conf_filename ) ): + f = open( conf_filename ) + print 'reading saved configuration from site.conf' + try: + while ( True ): + c = cPickle.load( f ) + active_configs.append( c ) + except: + pass + +# read the command line and build configs +config_statements = sys.argv[1:] +active_configs = config.ConfigParser().parseStatements( active_configs, config_statements ) +assert( len( active_configs ) >= 1 ) + +# save the config +print 'saving updated configuration' +f = open( conf_filename, 'wb' ) +for c in active_configs: + cPickle.dump( c, f, -1 ) + +print 'emit build rules' +for c in active_configs: + print 'emit configuration: %s' % repr( c ) + c.emit() diff --git a/TODO b/TODO index c0b6aa51..1fffec0c 100644 --- a/TODO +++ b/TODO @@ -1,148 +1,10 @@ - +- add browse buttons to CGameInstall dialog for engine folder +- copy content, only generating the .game atm -BUGS +- delete .game files? should we also delete files that were copied? -MSI: installer bug with new folders? : create custom dir, click New Folder icon, type "FOLDER\" - gets stuck -GTK2: gtk2 crashes when trying to use bitmap fonts such as MS Sans Serif http://bugzilla.gnome.org/show_bug.cgi?id=142579 -GTK2: alt+tab while mouse button is held down: see http://bugzilla.gnome.org/show_bug.cgi?id=145156 -UI: changing resolution in floating-windows mode can screw up window positions. -HalfLife: half-life maps saved in q1 map format are not supported - currently have to convert them to hammer map format using hammer editor. And vice versa. -Entity: creating a new entity with all the brushes of another entity selected results in the latter entity having no brushes. -SConscript: build fails if SETUP=1 -SConscript: svn.py fails if not using C locale - set LC_ALL? -GUI: can't use arrow keys to navigate in camera view when capslock is enabled -GUI: screensaver causes: gdkgc-win32.c: line 905 (gdk_win32_hdc_get): assertion failed: (win32_gc->hdc == NULL) +- when doing Q3 + mod, the mod has to be setup in the preferences +(that's a bit awkward) - -FEATURES - -- paint-select or equivalent (e.g. area-selection with occlusion) -- select-complete-tall or equivalent (e.g. subtract-from-selection modifier key) -- texture pane names are often illegible, becuase 1. they are long and overlap each other and 2. they overlap the outline rectangles around the images themselves. - - -Build: document build-menu xml format. -The build menu in GtkRadiant 1.5 is entirely customisable - you can make it run qbsp3/qvis3/arghrad or any tool you want. Use 'Build > Customize...' to edit the menu. - -Menu commands are the shell commands that Radiant will execute when you choose the menu item. You can add as many commands as you want to a single menu item, and they will be executed in sequence. The commands contain variables, specified using []. The values of variables will be substituted when the command is executed. - -For example: -
[q2map] -bsp "[MapFile]"
-becomes: -
"C:\Program Files\GtkRadiant 1.5.0\q2map" -fs_basepath "c:\quake2" -bsp "c:\quake2\baseq2\maps\blah.map"
-This uses the predefined variable 'MapFile' and the custom variable 'q2map'. 'q2map' is defined in the XML file, and 'MapFile' is the full path to your map. -The 'MapFile' variable is enclosed in quotes, because the path to your map may contain spaces. -At the moment you can only create custom variables by editing the XML file. A custom variable for arghrad would look something like this: -
"[RadiantPath]arghrad"
-This variable could then be used in a command like this: -
[arghrad] "[MapFile]"
- -Entity: option to filter non-world entities (e.g. not func_group or func_static) -Rotate Tool: if more than one object is selected, with different local orientations, use parent-space rotation pivot instead of local-space -Brush: MMB+ctrl to paint texture on whole brush/patch. -Camera: add alternative highlighting styles (used to be J). -Doom3: filter func_splinemovers -Entity: draw arrowheads to show direction of connection-lines. -? MMB to select a texture should also apply that texture to all selected faces. -Mouse: support 2-button mouse. -Grid: background colour should be different when the smallest grid is invisible due to being zoomed out. -Brush: option to disable dots on selected faces when not in face mode. -Entity: draw direction arrow for func_door and func_button angle. -Build Menu: support for editing variables. -Shaders: handle doom3 materials with multiple bumpmaps stage - use first stage, ignore later stages. -Brush: warn when a brush is dragged into a configuration with <0 volume -Textures: add option to give new brushes a specific texture instead of the last selected. -? QE-tool: click anywhere on xy view to drag entity instead of requiring clicking directly on entity. -UserDocs: how to use multi-vertex selection - replaces vertex-edit-splits-faces option: -UserDocs: how to use parent-selection: - Parent-selection works like Maya: it allows you to 'reparent' brushes - onto other entities than the one they're currently part of. To use it, - select some brushes, select an entity, Edit -> Parent. -Textures: add anisotropic filtering. -Preferences: allow preference settings to be shared across games. -Preferences: add colour 'theme' files using prefs format. -Preferences: sensible default size for prefs window. -Doom3: add model browser. -Doom3: s_diversity light key. -HalfLife: enable HL-mode on linux/osx. -Renderer: doom3 'parallel' and 'spot' light support. -Entity: add mouse-editing for doom3 light_center key -Shaders: add support for texture transforms. -Shaders: add support for 'addnormals' keyword - e.g. models/mapobjects/healthgui/healthguidirty -TGA Loader: check that true-colour images with palettes are properly handled. -Module System: reinstate 'refresh' feature. -Surface Inspector: add button for 'axial' projection for doom3. -Build: fix hardcoded engine-launch commands - use similar system to build-menu command description. -Filters: use q2/heretic2 content flags to filter brushes. -? Surface Inspector: allow material names not relative to 'textures/' for doom3 -Module System: add versioning for module-system api. -svn: remove install/ dir, create it during build process on win32 -Editing: add option to choose the default startup tool mode. -Renderer: lighting for doom3 materials without bumpmaps (e.g. mcity/mchangar2) -Renderer: realtime doom3 materials preview -Renderer: realtime doom3 shadows preview -Linux: Provide .tar.gz of example-map data for et/wolf. -Textures Window: add inner dark outline to distinguish 'is-shader' outline from white textures. -HalfLife2: add HL2 map load/save. -Selection: add move-pivot mode to allow rotation/scale around a custom pivot-point. -Selection: add rotate increment for rotate manipulator. -Selection: visibly distinguish between entity and brush selections -Selection: need 'add to selection' and 'subtract from selection' modifiers -Selection: Finish scale manipulator. -FaceCopy/PasteTexture: Make face-copy/paste-texture shortcuts customisable. -Manual: add documentation about search paths for .ent/.def/.fgd, shaders etc for each game. -Halflife: add support for cstrike fgd. -HalfLife: disable patches -HalfLife: add HL .mdl model loader. -HalfLife: add HL .spr support. -HalfLife: support fgd 'flags' attributes. -Model: add support for doom3 md5anim format -Model: support doom3 ragdolls -VFS: add ability to browse VFS from file-open dialogs. -Installer: enable q3 brush-primitives map support. -Installer: add editor manual to linux installer -Map: add conversion between map formats -Map: add conversion between entity definition formats -Build: add build-menu dmap support (doom3) -Entity: optionally draw target connection lines thicker than one pixel. -Entity: add specialised attribute-entry in entity-inspector for integer/real/color attribute types. -Patch: add cap-texture, fit-texture and natural-texture toolbar buttons -Patch: draw patches in wireframe from the back, make patches selectable from the back -Patch: add option for convert-selection-to-new-brush/patch -Patch: fix bobtoolz merge-patches feature -Patch: fix insert/remove rows/cols indicated by current selected patch vertices. -Autosave/Snapshots: Add support for multi-file maps. -Quake2: Q2 hint transparency support -Shortcuts: make shortcut list editable within radiant. -Shortcuts: convert shortcuts.ini to xml. -Shortcuts: warn when duplicate shortcuts are registered -Shortcuts: rename commands in order to group shortcuts list better. -upgrade to new API for SymGetModuleInfo - required for compiling with Visual Studio 8.0 -Doom3: lights should stay in place while resizing - - -LOW priority features - -Selection: Add shear manipulator? -Textures Window: Improve texture-manipulation and texture-browsing tools. -Undo: make selections undoable? -Win32 Installer: Automatically upgrade existing installation. -General: refactor game-specific hacks to be parameterised by .game file -Patch: Overlays, Bend Mode, Thicken. -Brush: Add brush-specific plugin API. -Entity: Draw light style numbers. -... Entity: Show models with model2 key. -Entity: Interpret _remap* key (_MindLink_). -Entity: Support _origin _angles _scale on groups. -Selection: Add Primitive-mode shortcut key/button. -Selection: Customisable manipulator size - +/- to change the size of the translate/rotate tool. -Selection: Add optional screen-relative control for constrained rotations. -Clipper: Change selection/manipulation to be consistent with other component editing. -Filtering: Either deselect filtered nodes, or render filtered nodes that are selected. -Filtering: Add customisable filter presets to set/unset multiple filters at once. -Texdef: Make texdef formats abstract, add conversion between texdef formats (use generic affine-texture-matrix format for conversions). -Textures Window: Precise display of texture size when selecting. (tooltip, possibly) -Status: 'Size of brush' display on status bar. -Colours: maya scheme default? -Quake: add support for adjusting gamma on quake palette? +- the game list reload doesn't work right, the entries in the combo probably need to be initialized again diff --git a/bin/Linux/x64/modules/PrtView.so b/bin/Linux/x64/modules/PrtView.so new file mode 100755 index 00000000..b1183e55 Binary files /dev/null and b/bin/Linux/x64/modules/PrtView.so differ diff --git a/bin/Linux/x64/modules/TexTool.so b/bin/Linux/x64/modules/TexTool.so new file mode 100755 index 00000000..9069b2b1 Binary files /dev/null and b/bin/Linux/x64/modules/TexTool.so differ diff --git a/bin/Linux/x64/modules/bkgrnd2d.so b/bin/Linux/x64/modules/bkgrnd2d.so new file mode 100755 index 00000000..07305e39 Binary files /dev/null and b/bin/Linux/x64/modules/bkgrnd2d.so differ diff --git a/bin/Linux/x64/modules/bobToolz_gtk.so b/bin/Linux/x64/modules/bobToolz_gtk.so new file mode 100755 index 00000000..eb006384 Binary files /dev/null and b/bin/Linux/x64/modules/bobToolz_gtk.so differ diff --git a/bin/Linux/x64/modules/entity.so b/bin/Linux/x64/modules/entity.so new file mode 100755 index 00000000..f2b4a752 Binary files /dev/null and b/bin/Linux/x64/modules/entity.so differ diff --git a/bin/Linux/x64/modules/fgd.so b/bin/Linux/x64/modules/fgd.so new file mode 100755 index 00000000..e94edabd Binary files /dev/null and b/bin/Linux/x64/modules/fgd.so differ diff --git a/bin/Linux/x64/modules/gtkgensurf.so b/bin/Linux/x64/modules/gtkgensurf.so new file mode 100755 index 00000000..4d4ff7cc Binary files /dev/null and b/bin/Linux/x64/modules/gtkgensurf.so differ diff --git a/bin/Linux/x64/modules/hydratoolz.so b/bin/Linux/x64/modules/hydratoolz.so new file mode 100755 index 00000000..b19c92cb Binary files /dev/null and b/bin/Linux/x64/modules/hydratoolz.so differ diff --git a/bin/Linux/x64/modules/image.so b/bin/Linux/x64/modules/image.so new file mode 100755 index 00000000..9b59b322 Binary files /dev/null and b/bin/Linux/x64/modules/image.so differ diff --git a/bin/Linux/x64/modules/imagem8.so b/bin/Linux/x64/modules/imagem8.so new file mode 100755 index 00000000..9104770b Binary files /dev/null and b/bin/Linux/x64/modules/imagem8.so differ diff --git a/bin/Linux/x64/modules/imagepng.so b/bin/Linux/x64/modules/imagepng.so new file mode 100755 index 00000000..288bf348 Binary files /dev/null and b/bin/Linux/x64/modules/imagepng.so differ diff --git a/bin/Linux/x64/modules/imagewal.so b/bin/Linux/x64/modules/imagewal.so new file mode 100755 index 00000000..94430b54 Binary files /dev/null and b/bin/Linux/x64/modules/imagewal.so differ diff --git a/bin/Linux/x64/modules/map.so b/bin/Linux/x64/modules/map.so new file mode 100755 index 00000000..8e38d506 Binary files /dev/null and b/bin/Linux/x64/modules/map.so differ diff --git a/bin/Linux/x64/modules/mapxml.so b/bin/Linux/x64/modules/mapxml.so new file mode 100755 index 00000000..d426f62a Binary files /dev/null and b/bin/Linux/x64/modules/mapxml.so differ diff --git a/bin/Linux/x64/modules/model.so b/bin/Linux/x64/modules/model.so new file mode 100755 index 00000000..ea0e568e Binary files /dev/null and b/bin/Linux/x64/modules/model.so differ diff --git a/bin/Linux/x64/modules/shaders.so b/bin/Linux/x64/modules/shaders.so new file mode 100755 index 00000000..499f566f Binary files /dev/null and b/bin/Linux/x64/modules/shaders.so differ diff --git a/bin/Linux/x64/modules/spritemodel.so b/bin/Linux/x64/modules/spritemodel.so new file mode 100755 index 00000000..e856c4f1 Binary files /dev/null and b/bin/Linux/x64/modules/spritemodel.so differ diff --git a/bin/Linux/x64/modules/surface.so b/bin/Linux/x64/modules/surface.so new file mode 100755 index 00000000..601274a5 Binary files /dev/null and b/bin/Linux/x64/modules/surface.so differ diff --git a/bin/Linux/x64/modules/surface_heretic2.so b/bin/Linux/x64/modules/surface_heretic2.so new file mode 100755 index 00000000..6d15b167 Binary files /dev/null and b/bin/Linux/x64/modules/surface_heretic2.so differ diff --git a/bin/Linux/x64/modules/surface_quake2.so b/bin/Linux/x64/modules/surface_quake2.so new file mode 100755 index 00000000..f80c5948 Binary files /dev/null and b/bin/Linux/x64/modules/surface_quake2.so differ diff --git a/bin/Linux/x64/modules/surface_ufoai.so b/bin/Linux/x64/modules/surface_ufoai.so new file mode 100755 index 00000000..c7524b20 Binary files /dev/null and b/bin/Linux/x64/modules/surface_ufoai.so differ diff --git a/bin/Linux/x64/modules/ufoai.so b/bin/Linux/x64/modules/ufoai.so new file mode 100755 index 00000000..598a71b9 Binary files /dev/null and b/bin/Linux/x64/modules/ufoai.so differ diff --git a/bin/Linux/x64/modules/vfspak.so b/bin/Linux/x64/modules/vfspak.so new file mode 100755 index 00000000..64482d4d Binary files /dev/null and b/bin/Linux/x64/modules/vfspak.so differ diff --git a/bin/Linux/x64/modules/vfspk3.so b/bin/Linux/x64/modules/vfspk3.so new file mode 100755 index 00000000..0a28b68b Binary files /dev/null and b/bin/Linux/x64/modules/vfspk3.so differ diff --git a/bin/Linux/x64/modules/vfswad.so b/bin/Linux/x64/modules/vfswad.so new file mode 100755 index 00000000..09ed1c25 Binary files /dev/null and b/bin/Linux/x64/modules/vfswad.so differ diff --git a/bin/Linux/x64/q3map2 b/bin/Linux/x64/q3map2 new file mode 100755 index 00000000..02c84556 Binary files /dev/null and b/bin/Linux/x64/q3map2 differ diff --git a/bin/Linux/x64/radiant.bin b/bin/Linux/x64/radiant.bin new file mode 100755 index 00000000..d9a516e1 Binary files /dev/null and b/bin/Linux/x64/radiant.bin differ diff --git a/bin/Linux/x86/modules/PrtView.so b/bin/Linux/x86/modules/PrtView.so new file mode 100755 index 00000000..a1450df7 Binary files /dev/null and b/bin/Linux/x86/modules/PrtView.so differ diff --git a/bin/Linux/x86/modules/TexTool.so b/bin/Linux/x86/modules/TexTool.so new file mode 100755 index 00000000..a08bc908 Binary files /dev/null and b/bin/Linux/x86/modules/TexTool.so differ diff --git a/bin/Linux/x86/modules/bkgrnd2d.so b/bin/Linux/x86/modules/bkgrnd2d.so new file mode 100755 index 00000000..35c3cc94 Binary files /dev/null and b/bin/Linux/x86/modules/bkgrnd2d.so differ diff --git a/bin/Linux/x86/modules/bobToolz_gtk.so b/bin/Linux/x86/modules/bobToolz_gtk.so new file mode 100755 index 00000000..7a27b991 Binary files /dev/null and b/bin/Linux/x86/modules/bobToolz_gtk.so differ diff --git a/bin/Linux/x86/modules/entity.so b/bin/Linux/x86/modules/entity.so new file mode 100755 index 00000000..626a7ff7 Binary files /dev/null and b/bin/Linux/x86/modules/entity.so differ diff --git a/bin/Linux/x86/modules/fgd.so b/bin/Linux/x86/modules/fgd.so new file mode 100755 index 00000000..9634368c Binary files /dev/null and b/bin/Linux/x86/modules/fgd.so differ diff --git a/bin/Linux/x86/modules/gtkgensurf.so b/bin/Linux/x86/modules/gtkgensurf.so new file mode 100755 index 00000000..e7d7537f Binary files /dev/null and b/bin/Linux/x86/modules/gtkgensurf.so differ diff --git a/bin/Linux/x86/modules/hydratoolz.so b/bin/Linux/x86/modules/hydratoolz.so new file mode 100755 index 00000000..d885679e Binary files /dev/null and b/bin/Linux/x86/modules/hydratoolz.so differ diff --git a/bin/Linux/x86/modules/image.so b/bin/Linux/x86/modules/image.so new file mode 100755 index 00000000..b52d5a8b Binary files /dev/null and b/bin/Linux/x86/modules/image.so differ diff --git a/bin/Linux/x86/modules/imagem8.so b/bin/Linux/x86/modules/imagem8.so new file mode 100755 index 00000000..eef3a970 Binary files /dev/null and b/bin/Linux/x86/modules/imagem8.so differ diff --git a/bin/Linux/x86/modules/imagepng.so b/bin/Linux/x86/modules/imagepng.so new file mode 100755 index 00000000..3839c987 Binary files /dev/null and b/bin/Linux/x86/modules/imagepng.so differ diff --git a/bin/Linux/x86/modules/imagewal.so b/bin/Linux/x86/modules/imagewal.so new file mode 100755 index 00000000..0d067b94 Binary files /dev/null and b/bin/Linux/x86/modules/imagewal.so differ diff --git a/bin/Linux/x86/modules/map.so b/bin/Linux/x86/modules/map.so new file mode 100755 index 00000000..6ad740a9 Binary files /dev/null and b/bin/Linux/x86/modules/map.so differ diff --git a/bin/Linux/x86/modules/mapxml.so b/bin/Linux/x86/modules/mapxml.so new file mode 100755 index 00000000..16595f66 Binary files /dev/null and b/bin/Linux/x86/modules/mapxml.so differ diff --git a/bin/Linux/x86/modules/model.so b/bin/Linux/x86/modules/model.so new file mode 100755 index 00000000..a311233c Binary files /dev/null and b/bin/Linux/x86/modules/model.so differ diff --git a/bin/Linux/x86/modules/shaders.so b/bin/Linux/x86/modules/shaders.so new file mode 100755 index 00000000..45669f14 Binary files /dev/null and b/bin/Linux/x86/modules/shaders.so differ diff --git a/bin/Linux/x86/modules/spritemodel.so b/bin/Linux/x86/modules/spritemodel.so new file mode 100755 index 00000000..037d2c3a Binary files /dev/null and b/bin/Linux/x86/modules/spritemodel.so differ diff --git a/bin/Linux/x86/modules/surface.so b/bin/Linux/x86/modules/surface.so new file mode 100755 index 00000000..0d65a0c1 Binary files /dev/null and b/bin/Linux/x86/modules/surface.so differ diff --git a/bin/Linux/x86/modules/surface_heretic2.so b/bin/Linux/x86/modules/surface_heretic2.so new file mode 100755 index 00000000..7ef8df9c Binary files /dev/null and b/bin/Linux/x86/modules/surface_heretic2.so differ diff --git a/bin/Linux/x86/modules/surface_quake2.so b/bin/Linux/x86/modules/surface_quake2.so new file mode 100755 index 00000000..c2d9c63a Binary files /dev/null and b/bin/Linux/x86/modules/surface_quake2.so differ diff --git a/bin/Linux/x86/modules/surface_ufoai.so b/bin/Linux/x86/modules/surface_ufoai.so new file mode 100755 index 00000000..4d44e55f Binary files /dev/null and b/bin/Linux/x86/modules/surface_ufoai.so differ diff --git a/bin/Linux/x86/modules/ufoai.so b/bin/Linux/x86/modules/ufoai.so new file mode 100755 index 00000000..eb532e07 Binary files /dev/null and b/bin/Linux/x86/modules/ufoai.so differ diff --git a/bin/Linux/x86/modules/vfspak.so b/bin/Linux/x86/modules/vfspak.so new file mode 100755 index 00000000..624ae394 Binary files /dev/null and b/bin/Linux/x86/modules/vfspak.so differ diff --git a/bin/Linux/x86/modules/vfspk3.so b/bin/Linux/x86/modules/vfspk3.so new file mode 100755 index 00000000..5a874a9b Binary files /dev/null and b/bin/Linux/x86/modules/vfspk3.so differ diff --git a/bin/Linux/x86/modules/vfswad.so b/bin/Linux/x86/modules/vfswad.so new file mode 100755 index 00000000..4da76d86 Binary files /dev/null and b/bin/Linux/x86/modules/vfswad.so differ diff --git a/bin/Linux/x86/q3map2 b/bin/Linux/x86/q3map2 new file mode 100755 index 00000000..ce12d800 Binary files /dev/null and b/bin/Linux/x86/q3map2 differ diff --git a/bin/Linux/x86/radiant.bin b/bin/Linux/x86/radiant.bin new file mode 100755 index 00000000..bae3199a Binary files /dev/null and b/bin/Linux/x86/radiant.bin differ diff --git a/compile_ibuild_win32.bat b/compile_ibuild_win32.bat new file mode 100644 index 00000000..5541e349 --- /dev/null +++ b/compile_ibuild_win32.bat @@ -0,0 +1,5 @@ +rem silly build script for compiling with MSVC using the IncrediBuild console +rem can't figure how to use the buildbot ShellCommand to pass the correct CFG= line +rem because of the configuration name with a | in it (Release|Win32) + +buildconsole.exe radiant.sln /BUILD /CFG="Release|Win32" diff --git a/config.py b/config.py new file mode 100644 index 00000000..f461e02d --- /dev/null +++ b/config.py @@ -0,0 +1,389 @@ +import sys, traceback, platform, re, commands, platform + +if __name__ != '__main__': + from SCons.Script import * + +import utils + +# config = debug release +# aliases are going to be very needed here +# we have dependency situations too +# target = + +class Config: + # not used atm, but useful to keep a list in mind + # may use them eventually for the 'all' and other aliases expansions? + target_choices = utils.Enum( 'radiant', 'q3map2', 'setup' ) + config_choices = utils.Enum( 'debug', 'release' ) + + # aliases + # 'all' -> for each choices + # 'gamecode' for the targets, 'game' 'cgame' 'ui' + + def __init__( self ): + # initialize defaults + self.target_selected = [ 'radiant', 'q3map2' ] + self.config_selected = [ 'release' ] + # those are global to each config + self.platform = platform.system() + self.cc = 'gcc' + self.cxx = 'g++' + self.install_directory = 'install' + + # platforms for which to assemble a setup + self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] + # paks to assemble in the setup + self.setup_packs = [ 'Q3Pack', 'UrTPack', 'UFOAIPack', 'Q2WPack' ] + + def __repr__( self ): + return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) + + def _processTarget( self, ops ): + self.target_selected = ops + + def _processConfig( self, ops ): + self.config_selected = ops + + def _processCC( self, ops ): + self.cc = ops + + def _processCXX( self, ops ): + self.cxx = ops + + def _processInstallDir( self, ops ): + self.install_directory = os.path.normpath( os.path.expanduser( ops[0] ) ) + + def _processSetupPlatforms( self, ops ): + self.setup_platforms = ops + + def _processSetupPacks( self, ops ): + self.setup_packs = ops + + def setupParser( self, operators ): + operators['target'] = self._processTarget + operators['config'] = self._processConfig + operators['cc'] = self._processCC + operators['cxx'] = self._processCXX + operators['install_directory'] = self._processInstallDir + operators['setup_platforms'] = self._processSetupPlatforms + operators['setup_packs'] = self._processSetupPacks + + def emit_radiant( self ): + settings = self + for config_name in self.config_selected: + config = {} + config['name'] = config_name + config['shared'] = False + Export( 'utils', 'settings', 'config' ) + build_dir = os.path.join( 'build', config_name, 'radiant' ) + BuildDir( build_dir, '.', duplicate = 0 ) + # left out jpeg6, splines (FIXME: I think jpeg6 is not used at all, can trash?) + lib_objects = [] + for project in [ 'libs/synapse/synapse.vcproj', 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]: + Export( 'project' ) + lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) + Export( 'lib_objects' ) + radiant = SConscript( os.path.join( build_dir, 'SConscript.radiant' ) ) + Default( InstallAs( os.path.join( self.install_directory, 'radiant.bin' ), radiant ) ) + + # PIC versions of the libs for the modules + shlib_objects_extra = {} + for project in [ 'libs/synapse/synapse.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/cmdlib/cmdlib.vcproj' ]: + ( libpath, libname ) = os.path.split( project ) + libname = os.path.splitext( libname )[0] + config['shared'] = True + Export( 'project', 'config' ) + build_dir = os.path.join( 'build', config_name, 'shobjs' ) + BuildDir( build_dir, '.', duplicate = 0 ) + shlib_objects_extra[libname] = SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) + + for project in [ 'plugins/vfspk3/vfspk3.vcproj', + 'plugins/vfspak/vfspak.vcproj', + 'plugins/vfswad/vfswad.vcproj', + 'plugins/eclassfgd/fgd.vcproj', + 'plugins/entity/entity.vcproj', + 'plugins/image/image.vcproj', + 'plugins/model/model.vcproj', + 'plugins/imagepng/imagepng.vcproj', + 'plugins/imagewal/imagewal.vcproj', + 'plugins/imagem8/imagem8.vcproj', + 'plugins/spritemodel/spritemodel.vcproj', + 'plugins/textool/TexTool.vcproj', + # 'plugins/sample/sample.vcproj', + 'plugins/map/map.vcproj', + 'plugins/mapxml/mapxml.vcproj', + 'plugins/shaders/shaders.vcproj', + 'plugins/surface/surface.vcproj', + 'plugins/surface_ufoai/surface_ufoai.vcproj', + 'plugins/surface_quake2/surface_quake2.vcproj', + 'plugins/surface_heretic2/surface_heretic2.vcproj', + # FIXME Needs splines + # 'contrib/camera/camera.vcproj', + + # FIXME What is this? Empty dir for me - remove me? + # 'contrib/patches/patches.vcproj', + # 'plugins/archivewad/archivewad.vcproj', + + 'contrib/prtview/PrtView.vcproj', + 'contrib/hydratoolz/hydratoolz.vcproj', + 'contrib/bobtoolz/bobToolz_gtk.vcproj', + 'contrib/gtkgensurf/gtkgensurf.vcproj', + 'contrib/ufoai/ufoai.vcproj', + 'contrib/bkgrnd2d/bkgrnd2d.vcproj' + ]: + ( libpath, libname ) = os.path.split( project ) + libname = os.path.splitext( libname )[0] + shlib_objects = shlib_objects_extra['synapse'] + if ( libname == 'entity' ): + shlib_objects += shlib_objects_extra['mathlib'] + elif ( libname == 'model' ): + shlib_objects += shlib_objects_extra['picomodel'] +# elif ( libname == 'spritemodel' ): +# shlib_objects += shlib_objects_extra['mathlib'] +# elif ( libname == 'TexTool' ): +# shlib_objects += shlib_objects_extra['mathlib'] + elif ( libname == 'map' ): + shlib_objects += shlib_objects_extra['cmdlib'] + Export( 'project', 'shlib_objects' ) + module = SConscript( os.path.join( build_dir, 'SConscript.module' ) ) + Default( InstallAs( os.path.join( self.install_directory, 'modules/%s.so' % libname ), module ) ) + + def emit_q3map2( self ): + settings = self + for config_name in self.config_selected: + config = {} + config['name'] = config_name + config['shared'] = False + Export( 'utils', 'settings', 'config' ) + build_dir = os.path.join( 'build', config_name, 'q3map2' ) + BuildDir( build_dir, '.', duplicate = 0 ) + lib_objects = [] + for project in [ 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]: + Export( 'project' ) + lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) ) + Export( 'lib_objects' ) + q3map2 = SConscript( os.path.join( build_dir, 'SConscript.q3map2' ) ) + Default( InstallAs( os.path.join( self.install_directory, 'q3map2' ), q3map2 ) ) + + + def emit( self ): + try: + self.target_selected.index( 'radiant' ) + except: + pass + else: + self.emit_radiant() + try: + self.target_selected.index( 'q3map2' ) + except: + pass + else: + self.emit_q3map2() + + try: + self.target_selected.index( 'setup' ) + except: + pass + else: + self.Setup() + + def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False, useZ = False, usePNG = False ): + env['CC'] = self.cc + env['CXX'] = self.cxx + ( ret, xml2 ) = commands.getstatusoutput( 'xml2-config --cflags' ) + if ( ret != 0 ): + print 'xml2-config failed' + assert( False ) + xml2libs = commands.getoutput( 'xml2-config --libs' ) + env.Append( LINKFLAGS = xml2libs.split( ' ' ) ) + baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ] +# baseflags += [ '-m32' ] + + if ( self.platform == 'Darwin' ): + env.Append( CPPPATH = [ '/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' ] ) + + if ( useGtk ): + ( ret, gtk2 ) = commands.getstatusoutput( 'pkg-config gtk+-2.0 --cflags' ) + if ( ret != 0 ): + print 'pkg-config gtk+-2.0 failed' + assert( False ) + baseflags += gtk2.split( ' ' ) + gtk2libs = commands.getoutput( 'pkg-config gtk+-2.0 --libs' ) + env.Append( LINKFLAGS = gtk2libs.split( ' ' ) ) + else: + # always setup at least glib + ( ret, glib ) = commands.getstatusoutput( 'pkg-config glib-2.0 --cflags' ) + if ( ret != 0 ): + print 'pkg-config glib-2.0 failed' + assert( False ) + baseflags += glib.split( ' ' ) + gliblibs = commands.getoutput( 'pkg-config glib-2.0 --libs' ) + env.Append( LINKFLAGS = gliblibs.split( ' ' ) ) + + if ( useGtkGL ): + ( ret, gtkgl ) = commands.getstatusoutput( 'pkg-config gtkglext-1.0 --cflags' ) + if ( ret != 0 ): + print 'pkg-config gtkglext-1.0 failed' + assert( False ) + baseflags += gtkgl.split( ' ' ) + gtkgllibs = commands.getoutput( 'pkg-config gtkglext-1.0 --libs' ) + env.Append( LINKFLAGS = gtkgllibs.split( ' ' ) ) + if ( useJPEG ): + env.Append( LIBS = 'jpeg' ) + if ( usePNG ): + pnglibs = 'png z' + env.Append( LIBS = pnglibs.split( ' ' ) ) + if ( useZ ): + env.Append( LIBS = 'z' ) + + env.Append( CFLAGS = baseflags ) + env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] ) + env.Append( CPPPATH = [ 'include', 'libs' ] ) + env.Append( CPPDEFINES = [ 'Q_NO_STLPORT' ] ) + if ( config == 'debug' ): + env.Append( CFLAGS = [ '-g' ] ) + env.Append( CXXFLAGS = [ '-g' ] ) + env.Append( CPPDEFINES = [ '_DEBUG' ] ) + else: + env.Append( CFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations', '-fno-strict-aliasing' ] ) + env.Append( CXXFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations','-fno-strict-aliasing' ] ) + + def CheckoutOrUpdate( self, svnurl, path ): + if ( os.path.exists( path ) ): + # NOTE: check the svnurl matches? + cmd = 'svn update "%s"' % path + print cmd + else: + cmd = 'svn checkout %s "%s"' % ( svnurl, path ) + ret = os.system( cmd ) + if ( ret != 0 ): + raise 'checkout or update failed' + + + def FetchGamePaks( self, path ): + for pak in self.setup_packs: + if ( pak == 'Q3Pack' or pak == 'UrTPack' or pak == 'UFOAIPack' or pak == 'Q2WPack' ): + svnurl = 'https://zerowing.idsoftware.com/svn/radiant.gamepacks/%s/trunk' % pak + self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) ) + + def Setup( self ): + for platform in self.setup_platforms: + if ( platform == 'local' ): + # special case, fetch external paks under the local install directory + self.FetchGamePaks( self.install_directory ) + +# parse the config statement line to produce/update an existing config list +# the configs expose a list of keywords and accepted values, which the engine parses out +class ConfigParser: + def __init__( self ): + self.operators = {} + + def _processOp( self, ops ): + assert( len( ops ) == 1 ) + op = ops.pop() + if ( op == 'clear' ): + self.configs = [] + self.current_config = None + elif ( op == 'pop' ): + self.configs.pop() + self.current_config = None + elif ( op == 'push' ): + self.configs.append( self.current_config ) + self.current_config = Config() + self._setupParser( self.current_config ) + + def _setupParser( self, c ): + self.operators = { 'op' : self._processOp } + c.setupParser( self.operators ) + + def _parseStatement( self, s ): + statement_re = re.compile( '(.*)=(.*)' ) + value_list_re = re.compile( '([^,]*),?' ) + if ( not statement_re.match( s ) ): + print 'syntax error (statement match): %s' % repr( s ) + return + statement_split = statement_re.split( s ) + if ( len( statement_split ) != 4 ): + print 'syntax error (statement split): %s' % repr( s ) + return + ( foo, name, value, bar ) = statement_split + value_split = value_list_re.split( value ) + if ( len( value_split ) < 2 or len( value_split ) % 2 != 1 ): + print 'syntax error (value split): %s' % ( repr( value_split ) ) + return + try: + value_array = [] + value_split.reverse() + value_split.pop() + while ( len( value_split ) != 0 ): + value_array.append( value_split.pop() ) + value_split.pop() + except: + print traceback.print_exception( sys.exc_type, sys.exc_value, sys.exc_traceback ) + print 'syntax error (value to array): %s' % ( repr( value_split ) ) + return + + return ( name, value_array ) + + def parseStatements( self, _configs, statements ): + self.current_config = None + self.configs = _configs + if ( self.configs is None ): + self.configs = [] + for s in statements: + + if ( self.current_config is None ): + # use a provided config, or create a default one + if ( len( self.configs ) > 0 ): + self.current_config = self.configs.pop() + else: + self.current_config = Config() + # setup the operator table for this config + # NOTE: have that in self._processOp too + self._setupParser( self.current_config ) + + ret = self._parseStatement( s ) + if ( ret is None ): + print 'stop statement parse at %s' % repr( s ) + break + ( name, value_array ) = ret + try: + processor = self.operators[name] + except: + print 'unknown operator %s - stop statement parse at %s' % ( repr( name ), repr( s ) ) + break + processor( value_array ) + + if ( not self.current_config is None ): + self.configs.append( self.current_config ) + # make sure there is at least one config + if ( len( self.configs ) == 0 ): + print 'pushing a default config' + self.configs.append( Config() ) + return self.configs + +import unittest + +class TestConfigParse( unittest.TestCase ): + + def setUp( self ): + self.parser = ConfigParser() + + def testBasicParse( self ): + # test basic config parsing + # needs to cleanly stop at the first config statement that is not recognized + configs = self.parser.parseStatements( None, [ 'game=missionpack', 'config=qvm', 'foobar' ] ) + print repr( configs ) + + def testMultiParse( self ): + # multiple configs seperated by commas + configs = self.parser.parseStatements( None, [ 'target=server,game,cgame' ] ) + print repr( configs ) + + def testOp( self ): + # test the operator for multiple configs + configs = self.parser.parseStatements( None, [ 'target=core', 'config=release', 'op=push', 'target=game,cgame,ui', 'config=debug' ] ) + print repr( configs ) + +if __name__ == '__main__': + unittest.main() diff --git a/contrib/bkgrnd2d/bkgrnd2d.cpp b/contrib/bkgrnd2d/bkgrnd2d.cpp index 36cf45e2..0789083e 100644 --- a/contrib/bkgrnd2d/bkgrnd2d.cpp +++ b/contrib/bkgrnd2d/bkgrnd2d.cpp @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/bkgrnd2d/bkgrnd2d.def b/contrib/bkgrnd2d/bkgrnd2d.def index 36c4457f..fa90fdb1 100644 --- a/contrib/bkgrnd2d/bkgrnd2d.def +++ b/contrib/bkgrnd2d/bkgrnd2d.def @@ -1,8 +1,8 @@ -; bkgrnd2d.def : Declares the module parameters for the DLL. - -LIBRARY "BKGRND2D" -DESCRIPTION 'BKGRND2D Windows Dynamic Link Library' - -EXPORTS - ; Explicit exports can go here - Synapse_EnumerateInterfaces @1 +; bkgrnd2d.def : Declares the module parameters for the DLL. + +LIBRARY "BKGRND2D" +DESCRIPTION 'BKGRND2D Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/contrib/bkgrnd2d/bkgrnd2d.h b/contrib/bkgrnd2d/bkgrnd2d.h index 3874cb19..bf4771bb 100644 --- a/contrib/bkgrnd2d/bkgrnd2d.h +++ b/contrib/bkgrnd2d/bkgrnd2d.h @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/bkgrnd2d/bkgrnd2d.vcproj b/contrib/bkgrnd2d/bkgrnd2d.vcproj index f2a538a0..8453d9c0 100644 --- a/contrib/bkgrnd2d/bkgrnd2d.vcproj +++ b/contrib/bkgrnd2d/bkgrnd2d.vcproj @@ -1,171 +1,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/bkgrnd2d/dialog.cpp b/contrib/bkgrnd2d/dialog.cpp index 8d9a8455..9f4ec49c 100644 --- a/contrib/bkgrnd2d/dialog.cpp +++ b/contrib/bkgrnd2d/dialog.cpp @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/bkgrnd2d/dialog.h b/contrib/bkgrnd2d/dialog.h index 03af2078..b6d80430 100644 --- a/contrib/bkgrnd2d/dialog.h +++ b/contrib/bkgrnd2d/dialog.h @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/bkgrnd2d/plugin.cpp b/contrib/bkgrnd2d/plugin.cpp index 09e9ed7c..7433c349 100644 --- a/contrib/bkgrnd2d/plugin.cpp +++ b/contrib/bkgrnd2d/plugin.cpp @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -253,8 +254,13 @@ void DoBkgrndToggleYZ() CSynapseServer* g_pSynapseServer = NULL; CSynapseClientBkgrnd2d g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); diff --git a/contrib/bkgrnd2d/plugin.h b/contrib/bkgrnd2d/plugin.h index 30b0ca7d..15fe7d62 100644 --- a/contrib/bkgrnd2d/plugin.h +++ b/contrib/bkgrnd2d/plugin.h @@ -1,5 +1,6 @@ /* -Copyright (C) 2003 Reed Mideke. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/bkgrnd2d/readme_bkgrnd2d-b0.25.txt b/contrib/bkgrnd2d/readme_bkgrnd2d-b0.25.txt index 6184245e..c1e401c7 100644 --- a/contrib/bkgrnd2d/readme_bkgrnd2d-b0.25.txt +++ b/contrib/bkgrnd2d/readme_bkgrnd2d-b0.25.txt @@ -1,131 +1,131 @@ -November 25 2003 -bkgrnd2d v 0.25 beta for radiant 1.3.13 -by SCDS_reyalP (email hellsownpuppy@yahoo.com) - -WARNING: -This is an beta release. It is provided with absolutely NO WARRANTY. -If it turns your data to mush and melts your CPU, don't blame me. - -Overview: -This little plugin allows you to display an image in the the gtkradiant 2d -windows. This is useful for layout sketches, maps made from -existing plans, building geometry based on photgraphs, viewing terrain -alphamaps in relation to your terrain, and so on. - -Installation: -extract the .dll and bitmaps into your gtkradiant/plugins directory, and -restart radiant. Be sure to use directory names, to ensure the bitmaps go -in your plugins/bitmaps directory. - -Uninstallation: -Close radiant, delete the bkgrnd2d.dll from the plugins directory, and -delete the bkgrnd2*.bmp files from the plugins/bitmaps directory. - -User Interface: -- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3 - toggle the display of a background image in the specified view. The fourth - brings up a configuration dialog. The configuration dialog can also be - opened from the plugins menu. - -- If an image has not been loaded, or it's display size and location have - not been set, pushing one of the toggle buttons will bring up the dialog - with the corresponding page selected. - -- The configuration dialog is non-modal, meaning that you can leave it open - while you work in radiant. If it gets lost behind another window, clicking - on the configuration button will bring it to the forground. - -Usage: -- bring up the configuration dialog. - -- Choose the "Browse..." button. This will prompt you for an image file. - The file *MUST* be inside your basegame directory (baseq3, main, etmain or - whatever your chosen game uses). The image must be in a format supported by - the game in use. For q3 based games this is truecolor .jpg, .tga and - sometimes .png. For q2 this is .wal - -- Use one of the following methods to set the size (in game units) that the - file is displayed. - 1) select 1 or more brushes or entities and choose "from selection" - This will use the total dimensions off all selected brushes and entities - to size the image. - 2) For the X/Y view only, choose 'Size to min/max keys' This will look in - the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also - used for ET tracemap generation and command map sizing) and use those - dimensions to size the image. - -- Use the toggle buttons to show or hide the loaded images. The buttons will - press or unpress whenever you click them, but an image will only be - displayed once you have successfully loaded a file and set its size/postion. - -- Set the opacity of the image using the slider in the configuration dialog. - -- If any of these commands do not produce the expected results, there may be - an information in the radiant console. Please include this when reporting - bugs. - - -Notes and limitations: -- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with - later versions. It will *NOT* work with version 1.3.12 and below. If you - build from source (see below) you can build it for other versions. - -- As mentioned above, the image *MUST* be inside your basegame directory, or - another directory in which radiant looks for game files. - -- To prevent the image from being distorted, you should size it to the - original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps - should always be square. - -- If you want a specific pixel to world unit relationship, you must arrange - that yourself. - -- On load, the image is converted to a texture whose dimensions are powers - of 2. If the original image dimensions are not powers of 2, some detail will - be lost due to resampling. If it is too large to fit on a single texture, - resolution is reduced. - -- radiants gamma and mipmap options are applied to the image. - -- If the image has an alpha channel, it will be included in the blending - process. 0 is transparent, 255 is opaque. .tga images are recommended if - you want to have an alpha channel. - -- since the plugin will only use true color files, you cannot use a terrain - indexmap (aka alphamap) or heightmap directly. You can of course, save a - copy of your indexmap in a 32 bit format. - -- There is no unload command. - -- You put the plugin in a game specific plugin directory, rather than the - radiant plugin directory. - -- You cannot set the image size with sub-unit precision. - -- Only win32 binaries are included. The source is available from: - http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip - If you want to use it on another platform you will need a buildable gtkradiant - source tree to build it. For any non-windows platform you will also have to - figure out the compile options. I suggest ripping those off from some other - plugin. - -TODO: -- make file selection paterns match supported filetypes -- large images without downsampling -- bitmap and pcx support for indexmaps -- automatic size from indexmapped entities -- render under the grid instead of blending -- mac/*nix support -- remember/save/restore settings -- texture options independant of radiant prefs -- clean up icky code - -Changes from 0.1 -- all 2d views supported -- new ui -- file selection patterns, default directory improved - -Changes from 0.2 -- tooltips in dialog -- various code cleanup - +November 25 2003 +bkgrnd2d v 0.25 beta for radiant 1.3.13 +by SCDS_reyalP (email hellsownpuppy@yahoo.com) + +WARNING: +This is an beta release. It is provided with absolutely NO WARRANTY. +If it turns your data to mush and melts your CPU, don't blame me. + +Overview: +This little plugin allows you to display an image in the the gtkradiant 2d +windows. This is useful for layout sketches, maps made from +existing plans, building geometry based on photgraphs, viewing terrain +alphamaps in relation to your terrain, and so on. + +Installation: +extract the .dll and bitmaps into your gtkradiant/plugins directory, and +restart radiant. Be sure to use directory names, to ensure the bitmaps go +in your plugins/bitmaps directory. + +Uninstallation: +Close radiant, delete the bkgrnd2d.dll from the plugins directory, and +delete the bkgrnd2*.bmp files from the plugins/bitmaps directory. + +User Interface: +- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3 + toggle the display of a background image in the specified view. The fourth + brings up a configuration dialog. The configuration dialog can also be + opened from the plugins menu. + +- If an image has not been loaded, or it's display size and location have + not been set, pushing one of the toggle buttons will bring up the dialog + with the corresponding page selected. + +- The configuration dialog is non-modal, meaning that you can leave it open + while you work in radiant. If it gets lost behind another window, clicking + on the configuration button will bring it to the forground. + +Usage: +- bring up the configuration dialog. + +- Choose the "Browse..." button. This will prompt you for an image file. + The file *MUST* be inside your basegame directory (baseq3, main, etmain or + whatever your chosen game uses). The image must be in a format supported by + the game in use. For q3 based games this is truecolor .jpg, .tga and + sometimes .png. For q2 this is .wal + +- Use one of the following methods to set the size (in game units) that the + file is displayed. + 1) select 1 or more brushes or entities and choose "from selection" + This will use the total dimensions off all selected brushes and entities + to size the image. + 2) For the X/Y view only, choose 'Size to min/max keys' This will look in + the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also + used for ET tracemap generation and command map sizing) and use those + dimensions to size the image. + +- Use the toggle buttons to show or hide the loaded images. The buttons will + press or unpress whenever you click them, but an image will only be + displayed once you have successfully loaded a file and set its size/postion. + +- Set the opacity of the image using the slider in the configuration dialog. + +- If any of these commands do not produce the expected results, there may be + an information in the radiant console. Please include this when reporting + bugs. + + +Notes and limitations: +- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with + later versions. It will *NOT* work with version 1.3.12 and below. If you + build from source (see below) you can build it for other versions. + +- As mentioned above, the image *MUST* be inside your basegame directory, or + another directory in which radiant looks for game files. + +- To prevent the image from being distorted, you should size it to the + original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps + should always be square. + +- If you want a specific pixel to world unit relationship, you must arrange + that yourself. + +- On load, the image is converted to a texture whose dimensions are powers + of 2. If the original image dimensions are not powers of 2, some detail will + be lost due to resampling. If it is too large to fit on a single texture, + resolution is reduced. + +- radiants gamma and mipmap options are applied to the image. + +- If the image has an alpha channel, it will be included in the blending + process. 0 is transparent, 255 is opaque. .tga images are recommended if + you want to have an alpha channel. + +- since the plugin will only use true color files, you cannot use a terrain + indexmap (aka alphamap) or heightmap directly. You can of course, save a + copy of your indexmap in a 32 bit format. + +- There is no unload command. + +- You put the plugin in a game specific plugin directory, rather than the + radiant plugin directory. + +- You cannot set the image size with sub-unit precision. + +- Only win32 binaries are included. The source is available from: + http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip + If you want to use it on another platform you will need a buildable gtkradiant + source tree to build it. For any non-windows platform you will also have to + figure out the compile options. I suggest ripping those off from some other + plugin. + +TODO: +- make file selection paterns match supported filetypes +- large images without downsampling +- bitmap and pcx support for indexmaps +- automatic size from indexmapped entities +- render under the grid instead of blending +- mac/*nix support +- remember/save/restore settings +- texture options independant of radiant prefs +- clean up icky code + +Changes from 0.1 +- all 2d views supported +- new ui +- file selection patterns, default directory improved + +Changes from 0.2 +- tooltips in dialog +- various code cleanup + diff --git a/contrib/bobtoolz/CPortals.h b/contrib/bobtoolz/CPortals.h index 71f399b7..60506be8 100644 --- a/contrib/bobtoolz/CPortals.h +++ b/contrib/bobtoolz/CPortals.h @@ -17,6 +17,8 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "StdAfx.h" // Added by ClassView + class CBspPoint { public: float p[3]; @@ -45,8 +47,6 @@ public: }; -#define NAME_MAX 255 - class CPortals { public: @@ -56,7 +56,7 @@ public: void Load(); // use filename in fn void Purge(); - char fn[NAME_MAX]; + char fn[PATH_MAX]; CBspNode *node; unsigned int node_count; diff --git a/contrib/bobtoolz/DBobView.cpp b/contrib/bobtoolz/DBobView.cpp index 688dd7e4..47215106 100644 --- a/contrib/bobtoolz/DBobView.cpp +++ b/contrib/bobtoolz/DBobView.cpp @@ -21,21 +21,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DBobView.h" -//#include "misc.h" -#include "funchandlers.h" - -#include - -#include "iglrender.h" -#include "qerplugin.h" -#include "str.h" -#include "math/matrix.h" - -#include "DEntity.h" -#include "DEPair.h" +#include "DListener.h" #include "misc.h" -#include "dialogs/dialogs-gtk.h" +#include "funchandlers.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -44,23 +34,29 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA DBobView::DBobView() { nPathCount = 0; + refCount = 1; + m_bHooked = FALSE; + path = NULL; + eyes = NULL; boundingShow = BOUNDS_APEX; - - constructShaders(); - GlobalShaderCache().attachRenderable(*this); } DBobView::~DBobView() { - GlobalShaderCache().detachRenderable(*this); - destroyShaders(); - - if(path) + if(path) delete[] path; + // oops forgot to remove our eyes, was causing access violation when it tried + // to talk to it's parent + if(eyes) + delete eyes; + + if(m_bHooked) + UnRegister(); + g_PathView = NULL; } @@ -68,77 +64,201 @@ DBobView::~DBobView() // Implementation ////////////////////////////////////////////////////////////////////// -void DBobView::render(RenderStateFlags state) const -{ - glBegin(GL_LINE_STRIP); - - for(int i = 0; i < nPathCount; i++) - glVertex3fv(path[i]); - - 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); -} - -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 +void DBobView::Draw2D(VIEWTYPE vt) { if(!path) return; - renderer.SetState(m_shader_line, Renderer::eWireframeOnly); - renderer.SetState(m_shader_line, Renderer::eFullMaterials); - renderer.addRenderable(*this, g_matrix4_identity); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); + + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH); + + g_QglTable.m_pfn_qglPushMatrix(); + + switch(vt) + { + case XY: + break; + case XZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + break; + case YZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f); + break; + } + + g_QglTable.m_pfn_qglLineWidth(1.0f); + g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f); + + int i; + + g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP); + + for(i = 0; i < nPathCount; i++) + g_QglTable.m_pfn_qglVertex3fv(path[i]); + + g_QglTable.m_pfn_qglEnd(); 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); - } + // +mars + // for the bounding box stuff + g_QglTable.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f); + + g_QglTable.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f ); + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // --------------- + + g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // back to where we were + g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // move to new postion + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // -------------- + + g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // back to where we were + g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // new pos + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // ---------------- + + g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // back to where we were + +/* g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // new pos + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + if ( boundingShow == BOUNDS_ALL ) + { + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + } + else if ( boundingShow == BOUNDS_APEX ) + { + for ( i = (nPathCount/4); i < (nPathCount/4) * 3; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + } + + g_QglTable.m_pfn_qglEnd();*/ // djbob: er, um doesn't really seem to do anyhting + } + + // -mars + + g_QglTable.m_pfn_qglPopMatrix(); + + g_QglTable.m_pfn_qglPopAttrib(); } -void DBobView::renderWireframe(Renderer& renderer, const VolumeTest& volume) const + +void DBobView::Draw3D() { - renderSolid(renderer, volume); + if(!path) + return; + + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); + + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH); + + g_QglTable.m_pfn_qglLineWidth(1.0f); + g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f); + + g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP); + + for(int i = 0; i < nPathCount; i++) + g_QglTable.m_pfn_qglVertex3fv(path[i]); + + g_QglTable.m_pfn_qglEnd(); + + if(m_bShowExtra) + { + // +mars + // ahhh -- a nice C&P job :) + // for the bounding box stuff + g_QglTable.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f); + + g_QglTable.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f ); + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + int i; + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // --------------- + + g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // back to where we were + g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // move to new postion + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // -------------- + + g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // back to where we were + g_QglTable.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // new pos + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + + // ---------------- + + g_QglTable.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // back to where we were + g_QglTable.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // new pos + + g_QglTable.m_pfn_qglBegin( GL_LINE_STRIP ); + + for ( i = 0; i < nPathCount; i++ ) + g_QglTable.m_pfn_qglVertex3fv( path[i] ); + + g_QglTable.m_pfn_qglEnd(); + } + // -mars + + g_QglTable.m_pfn_qglPopAttrib(); +} + +void DBobView::Register() +{ + g_QglTable.m_pfnHookGL2DWindow( this ); + g_QglTable.m_pfnHookGL3DWindow( this ); + m_bHooked = TRUE; +} + +void DBobView::UnRegister() +{ + g_QglTable.m_pfnUnHookGL2DWindow( this ); + g_QglTable.m_pfnUnHookGL3DWindow( this ); + m_bHooked = FALSE; } void DBobView::SetPath(vec3_t *pPath) @@ -156,7 +276,7 @@ bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier, if(apex[2] <= start[2]) { SetPath(NULL); - return false; + return FALSE; } // ----think q3a actually would allow these //scrub that, coz the plugin wont :] @@ -194,7 +314,7 @@ bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier, } SetPath(pPath); - return true; + return TRUE; } void DBobView::Begin(const char* trigger, const char *target, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra) @@ -207,9 +327,20 @@ void DBobView::Begin(const char* trigger, const char *target, float multiplier, nPathCount = points; m_bShowExtra = bShowExtra; - if(!UpdatePath()) + Register(); + + if(UpdatePath()) { - globalErrorStream() << "Initialization Failure in DBobView::Begin"; + if(!bNoUpdate) + { + eyes = new DListener; + eyes->parent = this; + eyes->Register(); + } + } + else + { + Sys_ERROR("Initialization Failure in DBobView::Begin"); delete this; } } @@ -223,55 +354,8 @@ bool DBobView::UpdatePath() if(GetEntityCentre(entTarget, apex)) { CalculateTrajectory(start, apex, fMultiplier, nPathCount, fVarGravity); - return true; + return TRUE; } } - return false; + 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) - { - if(g_PathView) - delete g_PathView; - g_PathView = new DBobView; - - Entity* target = Node_getEntity(entTarget->top()); - if(target != 0) - { - if(!bNoUpdate) - { - g_PathView->trigger = &entity; - entity.attach(*g_PathView); - g_PathView->target = target; - target->attach(*g_PathView); - } - g_PathView->Begin(trigger_ep->value, target_ep->value, multiplier, points, varGravity, bNoUpdate, bShowExtra); - } - } - else - DoMessageBox("trigger_push target could not be found.", "Error", eMB_OK); - } - else - DoMessageBox("trigger_push has no target.", "Error", eMB_OK); - } - else - DoMessageBox("You must select a 'trigger_push' entity.", "Error", eMB_OK); - } - else - DoMessageBox("Entity must have a targetname", "Error", eMB_OK); -} \ No newline at end of file diff --git a/contrib/bobtoolz/DBobView.h b/contrib/bobtoolz/DBobView.h index 6869e6bd..94902607 100644 --- a/contrib/bobtoolz/DBobView.h +++ b/contrib/bobtoolz/DBobView.h @@ -24,13 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_ -#include "ientity.h" -#include "irender.h" -#include "renderable.h" -#include "mathlib.h" - class DListener; -class Shader; #define BOUNDS_ALL 0 #define BOUNDS_APEX 1 @@ -39,26 +33,22 @@ class Shader; #pragma once #endif // _MSC_VER > 1000 -class DBobView : public Renderable, public OpenGLRenderable, public Entity::Observer +class DBobView : + public IGL2DWindow, + public IGL3DWindow { - Shader* m_shader_line; - Shader* m_shader_box; public: DBobView(); virtual ~DBobView(); protected: vec3_t* path; + int refCount; public: bool m_bShowExtra; int boundingShow; DListener* eyes; float fVarGravity; - float fMultiplier; - int nPathCount; - - Entity* trigger; - Entity* target; bool UpdatePath(); char entTarget[256]; @@ -67,40 +57,16 @@ public: bool CalculateTrajectory(vec3_t, vec3_t, float, int, float); void SetPath(vec3_t* pPath); + void UnRegister(); + void Register(); + void Draw3D(); + void Draw2D(VIEWTYPE vt); + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } - void render(RenderStateFlags state) const; - void renderSolid(Renderer& renderer, const VolumeTest& volume) const; - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const; - - void constructShaders(); - void destroyShaders(); - - void valueChanged(const char* value) - { - UpdatePath(); - } - typedef MemberCaller1 ValueChangedCaller; - void insert(const char* key, EntityKeyValue& value) - { - value.attach(ValueChangedCaller(*this)); - } - void erase(const char* key, EntityKeyValue& value) - { - value.detach(ValueChangedCaller(*this)); - } - void clear() - { - if(trigger != 0) - { - trigger->detach(*this); - target->detach(*this); - trigger = 0; - target = 0; - } - } + float fMultiplier; + bool m_bHooked; + int nPathCount; }; -class Entity; -void DBobView_setEntity(Entity& entity, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra); - #endif // !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_) diff --git a/contrib/bobtoolz/DBrush.cpp b/contrib/bobtoolz/DBrush.cpp index 96c884d2..73ad40a8 100644 --- a/contrib/bobtoolz/DBrush.cpp +++ b/contrib/bobtoolz/DBrush.cpp @@ -21,32 +21,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// -#include "DBrush.h" +#include "StdAfx.h" -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4786) #endif -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DEPair.h" -#include "DPatch.h" -#include "DEntity.h" +#include "DBrush.h" #include "DWinding.h" - #include "dialogs/dialogs-gtk.h" #include "misc.h" -#include "iundo.h" - -#include "generic/referencecounted.h" - -#include "scenelib.h" - ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// @@ -54,8 +40,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA DBrush::DBrush(int ID) { m_nBrushID = ID; - bBoundsBuilt = false; - QER_entity = NULL; + bBoundsBuilt = FALSE; QER_brush = NULL; } @@ -69,12 +54,12 @@ DBrush::~DBrush() // Implementation ////////////////////////////////////////////////////////////////////// -DPlane* DBrush::AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData) +DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData) { #ifdef _DEBUG // Sys_Printf("(%f %f %f) (%f %f %f) (%f %f %f)\n", va[0], va[1], va[2], vb[0], vb[1], vb[2], vc[0], vc[1], vc[2]); #endif - bBoundsBuilt = false; + bBoundsBuilt = FALSE; DPlane* newFace = new DPlane(va, vb, vc, texData); faceList.push_back(newFace); @@ -88,12 +73,12 @@ int DBrush::BuildPoints() if(faceList.size() <= 3) // if less than 3 faces, there can be no points return 0; // with only 3 faces u can't have a bounded soild - for(std::list::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++) + for(list::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++) { - std::list::const_iterator p2=p1; + list::const_iterator p2=p1; for(p2++; p2!=faceList.end(); p2++) { - std::list::const_iterator p3=p2; + list::const_iterator p3=p2; for(p3++; p3!=faceList.end(); p3++) { vec3_t pnt; @@ -103,7 +88,7 @@ int DBrush::BuildPoints() if(pos == POINT_IN_BRUSH) { // ???? shouldn't happen here - globalErrorStream() << "ERROR:: Build Brush Points: Point IN brush!!!\n"; + Sys_Printf("ERROR:: Build Brush Points: Point IN brush!!!\n"); } else if(pos == POINT_ON_BRUSH) { // normal point @@ -126,37 +111,35 @@ int DBrush::BuildPoints() // Sys_Printf("%i points on brush\n", pointList.size()); #endif - return static_cast(pointList.size()); + return pointList.size(); } -void DBrush_addFace(DBrush& brush, const _QERFaceData& faceData) -{ - brush.AddFace(vector3_to_array(faceData.m_p0), vector3_to_array(faceData.m_p1), vector3_to_array(faceData.m_p2), 0); -} -typedef ReferenceCaller1 DBrushAddFaceCaller; - -void DBrush_addFaceTextured(DBrush& brush, const _QERFaceData& faceData) -{ - brush.AddFace(vector3_to_array(faceData.m_p0), vector3_to_array(faceData.m_p1), vector3_to_array(faceData.m_p2), &faceData); -} -typedef ReferenceCaller1 DBrushAddFaceTexturedCaller; - -void DBrush::LoadFromBrush(scene::Instance& brush, bool textured) +void DBrush::LoadFromBrush_t(brush_t* brush, bool textured) { ClearFaces(); ClearPoints(); - GlobalBrushCreator().Brush_forEachFace(brush.path().top(), textured ? BrushFaceDataCallback(DBrushAddFaceTexturedCaller(*this)) : BrushFaceDataCallback(DBrushAddFaceCaller(*this))); + for(int i = g_FuncTable.m_pfnGetFaceCount(brush)-1; i >= 0 ; i--) + { // running backwards so i dont have to use the count function each time (OPT) + _QERFaceData* faceData = g_FuncTable.m_pfnGetFaceData(brush, i); - QER_entity = brush.path().parent().get_pointer(); - QER_brush = brush.path().top().get_pointer(); + if(faceData == NULL) + DoMessageBox("Null pointer returned", "WARNING!", MB_OK); + + if(textured) + AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, faceData); + else + AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, NULL); + } + + QER_brush = brush; } int DBrush::PointPosition(vec3_t pnt) { int state = POINT_IN_BRUSH; // if nothing happens point is inside brush - for(std::list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) + for(list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { float dist = (*chkPlane)->DistanceToPoint(pnt); @@ -172,7 +155,7 @@ int DBrush::PointPosition(vec3_t pnt) void DBrush::ClearPoints() { - for(std::list::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) { + for(list::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) { delete *deadPoint; } pointList.clear(); @@ -180,8 +163,8 @@ void DBrush::ClearPoints() void DBrush::ClearFaces() { - bBoundsBuilt = false; - for(std::list::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++) + bBoundsBuilt = FALSE; + for(list::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++) { delete *deadPlane; } @@ -197,32 +180,32 @@ void DBrush::AddPoint(vec3_t pnt) bool DBrush::HasPoint(vec3_t pnt) { - for(std::list::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++) + for(list::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++) { if(**chkPoint == pnt) - return true; + return TRUE; } - return false; + return FALSE; } int DBrush::RemoveRedundantPlanes() { int cnt = 0; - std::list::iterator chkPlane; + list::iterator chkPlane; // find duplicate planes - std::list::iterator p1=faceList.begin(); + list::iterator p1=faceList.begin(); while( p1!=faceList.end() ) { - std::list::iterator p2 = p1; + list::iterator p2 = p1; for(p2++; p2!=faceList.end(); p2++) { if(**p1 == **p2) { - if(!strcmp((*p1)->m_shader.c_str(), "textures/common/caulk")) + if(!strcmp((*p1)->texInfo.m_TextureName, "textures/common/caulk")) { delete *p1; p1 = faceList.erase(p1); // duplicate plane @@ -283,12 +266,12 @@ bool DBrush::GetBounds(vec3_t min, vec3_t max) BuildBounds(); if(!bBoundsBuilt) - return false; + return FALSE; VectorCopy(bbox_min, min); VectorCopy(bbox_max, max); - return true; + return TRUE; } bool DBrush::BBoxCollision(DBrush* chkBrush) @@ -300,25 +283,25 @@ bool DBrush::BBoxCollision(DBrush* chkBrush) chkBrush->GetBounds(min2, max2); if(min1[0] >= max2[0]) - return false; + return FALSE; if(min1[1] >= max2[1]) - return false; + return FALSE; if(min1[2] >= max2[2]) - return false; + return FALSE; if(max1[0] <= min2[0]) - return false; + return FALSE; if(max1[1] <= min2[1]) - return false; + return FALSE; if(max1[2] <= min2[2]) - return false; + return FALSE; - return true; + return TRUE; } DPlane* DBrush::HasPlane(DPlane* chkPlane) { - for(std::list::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) + for(list::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) { if(**brushPlane == *chkPlane) return *brushPlane; @@ -332,21 +315,21 @@ bool DBrush::IsCutByPlane(DPlane *cuttingPlane) if(pointList.size() == 0) if(BuildPoints() == 0) - return false; + return FALSE; - std::list::const_iterator chkPnt = pointList.begin(); + list::const_iterator chkPnt = pointList.begin(); if(chkPnt == pointList.end()) - return false; + return FALSE; float dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt); if(dist > MAX_ROUND_ERROR) - isInFront = false; + isInFront = FALSE; else if(dist < MAX_ROUND_ERROR) - isInFront = true; + isInFront = TRUE; else - return true; + return TRUE; for(chkPnt++=pointList.begin(); chkPnt!=pointList.end(); chkPnt++) { @@ -355,32 +338,31 @@ bool DBrush::IsCutByPlane(DPlane *cuttingPlane) if(dist > MAX_ROUND_ERROR) { if(isInFront) - return true; + return TRUE; } else if(dist < MAX_ROUND_ERROR) { if(!isInFront) - return true; + return TRUE; } else - return true; + return TRUE; } - return false; + return FALSE; } - -scene::Node* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity) +brush_t* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity) { if(allowDestruction) { - bool kill = true; + bool kill = TRUE; - for(std::list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) + for(list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { if((*chkPlane)->m_bChkOk) { - kill = false; + kill = FALSE; break; } } @@ -391,29 +373,28 @@ scene::Node* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, scene //+djbob: fixed bug when brush had no faces "phantom brush" in radiant. if(faceList.size() < 4) { - globalErrorStream() << "Possible Phantom Brush Found, will not rebuild\n"; + Sys_Printf("Possible Phantom Brush Found, will not rebuild\n"); return NULL; } //-djbob - NodeSmartReference node(GlobalBrushCreator().createBrush()); + QER_brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); - for(std::list::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) { - if((*buildPlane)->AddToBrush(node) && changeCnt) { + for(list::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) { + if((*buildPlane)->AddToBrush_t(QER_brush) && changeCnt) { (*changeCnt)++; } } if(entity) { - Node_getTraversable(*entity)->insert(node); + g_FuncTable.m_pfnCommitBrushHandleToEntity(QER_brush, entity); + g_BrushTable.m_pfnBrush_Build(QER_brush, false, false, false, false); + g_BrushTable.m_pfnBrush_AddToList(QER_brush, g_AppDataTable.m_pfnSelectedBrushes()); } else { - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(node); + g_FuncTable.m_pfnCommitBrushHandle(QER_brush); } - QER_entity = entity; - QER_brush = node.get_pointer(); - - return node.get_pointer(); + return QER_brush; } void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2) @@ -428,7 +409,7 @@ void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2 DBrush* b1 = new DBrush; DBrush* b2 = new DBrush; - for(std::list::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++) + for(list::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++) { b1->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL); b2->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL); @@ -448,55 +429,55 @@ bool DBrush::IntersectsWith(DBrush *chkBrush) { if(pointList.size() == 0) if(BuildPoints() == 0) - return false; // invalid brush!!!! + return FALSE; // invalid brush!!!! if(chkBrush->pointList.size() == 0) if(chkBrush->BuildPoints() == 0) - return false; // invalid brush!!!! + return FALSE; // invalid brush!!!! if(!BBoxCollision(chkBrush)) - return false; + return FALSE; - std::list::const_iterator iplPlane; + list::const_iterator iplPlane; for( iplPlane=faceList.begin(); iplPlane!=faceList.end(); iplPlane++) { - bool allInFront = true; - for(std::list::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++) + bool allInFront = TRUE; + for(list::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++) { if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR) { - allInFront = false; + allInFront = FALSE; break; } } if(allInFront) - return false; + return FALSE; } for( iplPlane=chkBrush->faceList.begin(); iplPlane!=chkBrush->faceList.end(); iplPlane++) { - bool allInFront = true; - for(std::list::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++) + bool allInFront = TRUE; + for(list::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++) { if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR) { - allInFront = false; + allInFront = FALSE; break; } } if(allInFront) - return false; + return FALSE; } - return true; + return TRUE; } bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) { vec3_t vDown = { 0, 0, -1 }; - std::list::const_iterator iplPlane; + list::const_iterator iplPlane; for( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++) { DPlane* p = (*iplPlane); @@ -506,12 +487,12 @@ bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) { } if(p->PlaneIntersection(p1, p2, v)) { if(PointPosition( v ) != POINT_OUT_BRUSH) { - return true; + return TRUE; } } } - return false; + return FALSE; } void DBrush::BuildBounds() @@ -522,11 +503,11 @@ void DBrush::BuildBounds() if(BuildPoints() == 0) return; - std::list::const_iterator first = pointList.begin(); + list::const_iterator first = pointList.begin(); VectorCopy((*first)->_pnt, bbox_min); VectorCopy((*first)->_pnt, bbox_max); - std::list::const_iterator point=pointList.begin(); + list::const_iterator point=pointList.begin(); for( point++; point!=pointList.end(); point++) { if((*point)->_pnt[0] > bbox_max[0]) @@ -544,7 +525,7 @@ void DBrush::BuildBounds() bbox_min[2] = (*point)->_pnt[2]; } - bBoundsBuilt = true; + bBoundsBuilt = TRUE; } } @@ -557,18 +538,18 @@ bool DBrush::BBoxTouch(DBrush *chkBrush) chkBrush->GetBounds(min2, max2); if((min1[0] - max2[0]) > MAX_ROUND_ERROR) - return false; + return FALSE; if((min1[1] - max2[1]) > MAX_ROUND_ERROR) - return false; + return FALSE; if((min1[2] - max2[2]) > MAX_ROUND_ERROR) - return false; + return FALSE; if((min2[0] - max1[0]) > MAX_ROUND_ERROR) - return false; + return FALSE; if((min2[1] - max1[1]) > MAX_ROUND_ERROR) - return false; + return FALSE; if((min2[2] - max1[2]) > MAX_ROUND_ERROR) - return false; + return FALSE; int cnt = 0; @@ -591,24 +572,24 @@ bool DBrush::BBoxTouch(DBrush *chkBrush) cnt++; if(cnt > 1) - return false; + return FALSE; - return true; + return TRUE; } -void DBrush::ResetChecks(std::list* exclusionList) +void DBrush::ResetChecks(list* exclusionList) { - for(std::list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) + for(list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) { - bool set = false; + bool set = FALSE; if(exclusionList) { - for(std::list::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++) + for(list::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++) { - if(strstr((*resetPlane)->m_shader.c_str(), eTexture->GetBuffer())) + if(strstr((*resetPlane)->texInfo.m_TextureName, eTexture->GetBuffer())) { - set = true; + set = TRUE; break; } } @@ -620,7 +601,7 @@ void DBrush::ResetChecks(std::list* exclusionList) DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane) { - for(std::list::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) + for(list::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) { if(**brushPlane != *chkPlane) { @@ -633,31 +614,31 @@ DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane) bool DBrush::HasTexture(const char *textureName) { - for(std::list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) + for(list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { - if(strstr((*chkPlane)->m_shader.c_str(), textureName)) - return true; + if(strstr((*chkPlane)->texInfo.m_TextureName, textureName)) + return TRUE; } - return false; + return FALSE; } bool DBrush::IsDetail() { - for(std::list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) + for(list::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { - if((*chkPlane)->texInfo.contents & FACE_DETAIL) - return true; + if((*chkPlane)->texInfo.m_nContents & FACE_DETAIL) + return TRUE; } - return false; + return FALSE; } void DBrush::BuildFromWinding(DWinding *w) { if(w->numpoints < 3) { - globalErrorStream() << "Winding has invalid number of points"; + Sys_ERROR("Winding has invalid number of points"); return; } @@ -684,7 +665,7 @@ void DBrush::SaveToFile(FILE *pFile) { fprintf(pFile, "{\n"); - for(std::list::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++) + for(list::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++) { char buffer[512]; @@ -692,10 +673,10 @@ void DBrush::SaveToFile(FILE *pFile) (*pp)->points[0][0], (*pp)->points[0][1], (*pp)->points[0][2], (*pp)->points[1][0], (*pp)->points[1][1], (*pp)->points[1][2], (*pp)->points[2][0], (*pp)->points[2][1], (*pp)->points[2][2], - (*pp)->m_shader.c_str(), - (*pp)->texInfo.m_texdef.shift[0], (*pp)->texInfo.m_texdef.shift[1], - (*pp)->texInfo.m_texdef.scale[0], (*pp)->texInfo.m_texdef.scale[0], - (*pp)->texInfo.m_texdef.rotate); + (*pp)->texInfo.m_TextureName, + (*pp)->texInfo.m_fShift[0], (*pp)->texInfo.m_fShift[1], + (*pp)->texInfo.m_fScale[0], (*pp)->texInfo.m_fScale[0], + (*pp)->texInfo.m_fRotate); fprintf(pFile, buffer); } @@ -705,7 +686,7 @@ void DBrush::SaveToFile(FILE *pFile) void DBrush::Rotate(vec3_t vOrigin, vec3_t vRotation) { - for(std::list::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++) + for(list::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++) { for(int i = 0; i < 3; i++) VectorRotate((*rotPlane)->points[i], vRotation, vOrigin); @@ -729,78 +710,78 @@ bool DBrush::ResetTextures(const char* textureName, float fScale[2], float fS { if(textureName) { - bool changed = false; - for(std::list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) + bool changed = FALSE; + for(list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) { - if(!strcmp((*resetPlane)->m_shader.c_str(), textureName)) + if(!strcmp((*resetPlane)->texInfo.m_TextureName, textureName)) { if(bResetTextureName) - (*resetPlane)->m_shader = newTextureName; + strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName); if(bResetScale[0]) - (*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0]; + (*resetPlane)->texInfo.m_fScale[0] = fScale[0]; if(bResetScale[1]) - (*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1]; + (*resetPlane)->texInfo.m_fScale[1] = fScale[1]; if(bResetShift[0]) - (*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0]; + (*resetPlane)->texInfo.m_fShift[0] = fShift[0]; if(bResetShift[1]) - (*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1]; + (*resetPlane)->texInfo.m_fShift[1] = fShift[1]; if(bResetRotation) - (*resetPlane)->texInfo.m_texdef.rotate = (float)rotation; + (*resetPlane)->texInfo.m_fRotate = (float)rotation; - changed = true; + changed = TRUE; } } return changed; // no point rebuilding unless we need to, only slows things down } else { - for(std::list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) + for(list::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) { if(bResetTextureName) - (*resetPlane)->m_shader = newTextureName; + strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName); if(bResetScale[0]) - (*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0]; + (*resetPlane)->texInfo.m_fScale[0] = fScale[0]; if(bResetScale[1]) - (*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1]; + (*resetPlane)->texInfo.m_fScale[1] = fScale[1]; if(bResetShift[0]) - (*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0]; + (*resetPlane)->texInfo.m_fShift[0] = fShift[0]; if(bResetShift[1]) - (*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1]; + (*resetPlane)->texInfo.m_fShift[1] = fShift[1]; if(bResetRotation) - (*resetPlane)->texInfo.m_texdef.rotate = (float)rotation; + (*resetPlane)->texInfo.m_fRotate = (float)rotation; } - return true; + return TRUE; } } bool DBrush::operator ==(DBrush* other) { - std::list::const_iterator chkPlane; + list::const_iterator chkPlane; for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { if(!other->HasPlane((*chkPlane))) - return false; + return FALSE; } for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) { if(!HasPlane((*chkPlane))) - return false; + return FALSE; } - return true; + return TRUE; } -DPlane* DBrush::AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const char *textureName, bool bDetail) +DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char *textureName, bool bDetail) { - bBoundsBuilt = false; + bBoundsBuilt = FALSE; DPlane* newFace = new DPlane(va, vb, vc, textureName, bDetail); faceList.push_back(newFace); @@ -810,7 +791,7 @@ DPlane* DBrush::AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const DPlane* DBrush::FindPlaneWithClosestNormal( vec_t* normal ) { vec_t bestDot = -2; DPlane* bestDotPlane = NULL; - std::list::const_iterator chkPlane; + list::const_iterator chkPlane; for( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) { DPlane* pPlane = (*chkPlane); @@ -833,7 +814,7 @@ int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) { BuildPoints(); - for( std::list::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) { + for( list::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) { DPoint* point = (*points); if( fabs(plane->DistanceToPoint( point->_pnt )) < MAX_ROUND_ERROR ) { @@ -851,11 +832,17 @@ int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) { } void DBrush::RemovePlane( DPlane* plane ) { - bBoundsBuilt = false; - for( std::list::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) { + bBoundsBuilt = FALSE; + for( list::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) { if(*deadPlane == plane) { delete *deadPlane; faceList.remove( plane ); } } } + +void DBrush::RemoveFromRadiant( void ) { + if(QER_brush) { + g_FuncTable.m_pfnDeleteBrushHandle(QER_brush); + } +} diff --git a/contrib/bobtoolz/DBrush.h b/contrib/bobtoolz/DBrush.h index 112f2294..65013dcc 100644 --- a/contrib/bobtoolz/DBrush.h +++ b/contrib/bobtoolz/DBrush.h @@ -24,34 +24,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_ -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include -#include -#include "mathlib.h" -#include "str.h" - -class DPlane; -class DWinding; -class DPoint; -class _QERFaceData; - -namespace scene -{ - class Node; - class Instance; -} +#include "DPlane.h" #define POINT_IN_BRUSH 0 #define POINT_ON_BRUSH 1 #define POINT_OUT_BRUSH 2 +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + class DBrush { public: - DPlane* AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* textureName, bool bDetail); + DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail); void SaveToFile(FILE* pFile); void Rotate(vec3_t vOrigin, vec3_t vRotation); @@ -59,7 +45,7 @@ public: DPlane* HasPlaneInverted(DPlane* chkPlane); DPlane* HasPlane(DPlane* chkPlane); - DPlane* AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData); + DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData); bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation); bool IsDetail(); @@ -75,9 +61,9 @@ public: int BuildPoints(); void BuildBounds(); void BuildFromWinding(DWinding* w); - scene::Node* BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity = NULL); + brush_t* BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity = NULL); - void ResetChecks(std::list* exclusionList); + void ResetChecks(list* exclusionList); void ClearFaces(); void ClearPoints(); @@ -85,11 +71,12 @@ public: int RemoveRedundantPlanes( void ); void RemovePlane( DPlane* plane ); int PointPosition(vec3_t pnt); + void RemoveFromRadiant( void ); void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2); - void LoadFromBrush(scene::Instance& brush, bool textured); + void LoadFromBrush_t(brush_t* brush, bool textured); void AddPoint(vec3_t pnt); DPlane* FindPlaneWithClosestNormal( vec_t* normal ); @@ -101,10 +88,9 @@ public: bool operator== (DBrush* other); // members - scene::Node* QER_entity; - scene::Node* QER_brush; - std::list faceList; - std::list pointList; + brush_t* QER_brush; + list faceList; + list pointList; int m_nBrushID; vec3_t bbox_min, bbox_max; bool bBoundsBuilt; diff --git a/contrib/bobtoolz/DEPair.cpp b/contrib/bobtoolz/DEPair.cpp index 72dda4b3..9d5da9d1 100644 --- a/contrib/bobtoolz/DEPair.cpp +++ b/contrib/bobtoolz/DEPair.cpp @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DEPair.h" ////////////////////////////////////////////////////////////////////// @@ -41,7 +42,7 @@ DEPair::~DEPair() // Implementation ////////////////////////////////////////////////////////////////////// -void DEPair::Build(const char *pKey, const char *pValue) +void DEPair::Build(char *pKey, char *pValue) { key = pKey; value = pValue; diff --git a/contrib/bobtoolz/DEPair.h b/contrib/bobtoolz/DEPair.h index fac4c334..11f79045 100644 --- a/contrib/bobtoolz/DEPair.h +++ b/contrib/bobtoolz/DEPair.h @@ -28,15 +28,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once #endif // _MSC_VER > 1000 -#include "str.h" - class DEPair { public: DEPair(); virtual ~DEPair(); - void Build(const char* pKey, const char* pValue); + void Build(char* pKey, char* pValue); Str key; Str value; diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index f03b489e..3719d20e 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -21,39 +21,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// -#include "DEntity.h" +#include "StdAfx.h" -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4786) #endif -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" +#include "DEntity.h" #include "dialogs/dialogs-gtk.h" #include "misc.h" #include "CPortals.h" -#include "iundo.h" -#include "ientity.h" -#include "ieclass.h" - -#include "generic/referencecounted.h" - -#include -#include -#include -#include - -#include "scenelib.h" - - const char* brushEntityList[] = { "worldspawn", "trigger_always", @@ -78,7 +57,7 @@ const char* brushEntityList[] = { // Construction/Destruction ////////////////////////////////////////////////////////////////////// -DEntity::DEntity(const char *classname, int ID) +DEntity::DEntity(char *classname, int ID) { SetClassname(classname); m_nID = ID; @@ -98,7 +77,7 @@ DEntity::~DEntity() void DEntity::ClearBrushes() { - for(std::list::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++) + for(list::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++) { delete *deadBrush; } @@ -107,7 +86,7 @@ void DEntity::ClearBrushes() void DEntity::ClearPatches() { - for(std::list::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++) + for(list::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++) { delete *deadPatch; } @@ -152,7 +131,7 @@ bool DEntity::LoadFromPrt(char *filename) portals.Load(); if(portals.node_count == 0) - return false; + return FALSE; ClearBrushes(); ClearEPairs(); @@ -189,15 +168,15 @@ bool DEntity::LoadFromPrt(char *filename) } if(!build) - brush->AddFace(portals.node[i].portal[j].point[2].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[0].p, "textures/common/caulk", false); + brush->AddFace(portals.node[i].portal[j].point[2].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[0].p, "textures/common/caulk", FALSE); else - brush->AddFace(portals.node[i].portal[j].point[0].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[2].p, "textures/common/caulk", false); + brush->AddFace(portals.node[i].portal[j].point[0].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[2].p, "textures/common/caulk", FALSE); } if(build) - brush->BuildInRadiant(false, NULL); + brush->BuildInRadiant(FALSE, NULL); } - return true; + return TRUE; } DPlane* DEntity::AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID) @@ -211,7 +190,7 @@ DBrush* DEntity::GetBrushForID(int ID) { DBrush* buildBrush = NULL; - for(std::list::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++) + for(list::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++) { if((*chkBrush)->m_nBrushID == ID) { @@ -226,82 +205,43 @@ DBrush* DEntity::GetBrushForID(int ID) return buildBrush; } -template -class BrushSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - BrushSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - if(Node_isBrush(instance.path().top())) - { - m_functor(instance); - } - } -}; - -template -inline const Functor& Scene_forEachSelectedBrush(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(BrushSelectedVisitor(functor)); - return functor; -} - -void DEntity_loadBrush(DEntity& entity, scene::Instance& brush) -{ - DBrush* loadBrush = entity.NewBrush(static_cast(entity.brushList.size())); - loadBrush->LoadFromBrush(brush, true); -} -typedef ReferenceCaller1 DEntityLoadBrushCaller; - void DEntity::LoadSelectedBrushes() { ClearBrushes(); ClearEPairs(); - Scene_forEachSelectedBrush(DEntityLoadBrushCaller(*this)); -} + int count = g_FuncTable.m_pfnAllocateSelectedBrushHandles(); -template -class PatchSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - PatchSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - if(Node_isPatch(instance.path().top())) - { - m_functor(instance); - } - } -}; + for(int i = 0; i < count; i++) { + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i); -template -inline const Functor& Scene_forEachSelectedPatch(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(PatchSelectedVisitor(functor)); - return functor; -} + if(brush->pPatch) + continue; -void DEntity_loadPatch(DEntity& entity, scene::Instance& patch) -{ - DPatch* loadPatch = entity.NewPatch(); - loadPatch->LoadFromPatch(patch); + DBrush* loadBrush = NewBrush(i); + loadBrush->LoadFromBrush_t(brush, TRUE); + } + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } -typedef ReferenceCaller1 DEntityLoadPatchCaller; void DEntity::LoadSelectedPatches() { ClearPatches(); ClearEPairs(); - Scene_forEachSelectedPatch(DEntityLoadPatchCaller(*this)); + int count = g_FuncTable.m_pfnAllocateSelectedPatchHandles(); + + for(int i = 0; i < count; i++) + { + //$ FIXME: m_pfnGetPatchHandle + patchMesh_t *pmesh = (patchMesh_t*)g_FuncTable.m_pfnGetPatchData(i); + + DPatch* loadPatch = NewPatch(); + loadPatch->LoadFromBrush_t(pmesh->pSymbiot); + } + + g_FuncTable.m_pfnReleasePatchHandles(); } bool* DEntity::BuildIntersectList() @@ -313,15 +253,15 @@ bool* DEntity::BuildIntersectList() bool* pbIntList = new bool[max]; memset(pbIntList, 0, sizeof(bool)*(max)); - for(std::list::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) + for(list::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) { - std::list::const_iterator pB2=pB1; + list::const_iterator pB2=pB1; for(pB2++; pB2!=brushList.end(); pB2++) { if((*pB1)->IntersectsWith((*pB2))) { - pbIntList[(*pB1)->m_nBrushID] = true; - pbIntList[(*pB2)->m_nBrushID] = true; + pbIntList[(*pB1)->m_nBrushID] = TRUE; + pbIntList[(*pB2)->m_nBrushID] = TRUE; } } } @@ -338,15 +278,15 @@ bool* DEntity::BuildDuplicateList() bool* pbDupList = new bool[max]; memset(pbDupList, 0, sizeof(bool)*(max)); - for(std::list::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) + for(list::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) { - std::list::const_iterator pB2=pB1; + list::const_iterator pB2=pB1; for(pB2++; pB2!=brushList.end(); pB2++) { if(**pB1 == *pB2) { - pbDupList[(*pB1)->m_nBrushID] = true; - pbDupList[(*pB2)->m_nBrushID] = true; + pbDupList[(*pB1)->m_nBrushID] = TRUE; + pbDupList[(*pB2)->m_nBrushID] = TRUE; } } } @@ -359,87 +299,81 @@ void DEntity::SelectBrushes(bool *selectList) if(selectList == NULL) return; - GlobalSelectionSystem().setSelectedAll(false); + g_FuncTable.m_pfnDeselectAllBrushes(); - scene::Path path(NodeReference(GlobalSceneGraph().root())); - path.push(NodeReference(*QER_Entity)); + g_FuncTable.m_pfnAllocateActiveBrushHandles(); for(std::list::const_iterator pBrush=brushList.begin(); pBrush!=brushList.end(); pBrush++) { if(selectList[(*pBrush)->m_nBrushID]) - { - path.push(NodeReference(*(*pBrush)->QER_brush)); - Instance_getSelectable(*GlobalSceneGraph().find(path))->setSelected(true); - path.pop(); - } + g_FuncTable.m_pfnSelectBrush((*pBrush)->QER_brush); } + g_FuncTable.m_pfnReleaseActiveBrushHandles(); } -bool DEntity::LoadFromEntity(scene::Node& ent, bool bLoadPatches) { +bool DEntity::LoadFromEntity(int id, bool bLoadPatches) { + return LoadFromEntity((entity_t*)g_FuncTable.m_pfnGetEntityHandle(id), bLoadPatches); +} + +bool DEntity::LoadFromEntity(entity_t* ent, bool bLoadPatches) { ClearPatches(); ClearBrushes(); ClearEPairs(); - QER_Entity = &ent; + QER_Entity = ent; - LoadEPairList(Node_getEntity(ent)); + epair_t* epl = *g_EntityTable.m_pfnGetEntityKeyValList(QER_Entity); + LoadEPairList(epl); - bool keep = false; + bool keep = FALSE; int i; for(i = 0; brushEntityList[i]; i++) { - if(string_equal_nocase(brushEntityList[i], m_Classname)) + if(!stricmp(brushEntityList[i], m_Classname)) { - keep = true; + keep = TRUE; break; } } if(!keep) - return false; + return FALSE; - if(Node_getTraversable(ent)) - { - class load_brushes_t : public scene::Traversable::Walker - { - DEntity* m_entity; - mutable int m_count; - public: - load_brushes_t(DEntity* entity) - : m_entity(entity), m_count(0) - { - } - bool pre(scene::Node& node) const - { - scene::Path path(NodeReference(GlobalSceneGraph().root())); - path.push(NodeReference(*m_entity->QER_Entity)); - path.push(NodeReference(node)); - scene::Instance* instance = GlobalSceneGraph().find(path); - ASSERT_MESSAGE(instance != 0, ""); + int count = g_FuncTable.m_pfnAllocateEntityBrushHandles(QER_Entity); - if(Node_isPatch(node)) - { - DPatch* loadPatch = m_entity->NewPatch(); - loadPatch->LoadFromPatch(*instance); - } - else if(Node_isBrush(node)) - { - DBrush* loadBrush = m_entity->NewBrush(m_count++); - loadBrush->LoadFromBrush(*instance, true); - } - return false; - } - } load_brushes(this); + for(i = 0; i < count; i++) + { - Node_getTraversable(ent)->traverse(load_brushes); - } + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetEntityBrushHandle(i); - return true; + if(brush == NULL) { + DoMessageBox("GTKRadiant returned a NULL pointer, NOT a good sign", "WARNING!!!", MB_OK); + continue; + } + + if(brush->pPatch) + { + if(bLoadPatches) + { + DPatch* loadPatch = NewPatch(); + loadPatch->LoadFromBrush_t(brush); + } + } + else + { + DBrush* loadBrush = NewBrush(i); + loadBrush->LoadFromBrush_t(brush, TRUE); + } + } + + g_FuncTable.m_pfnReleaseEntityBrushHandles(); + + return TRUE; } -void DEntity::RemoveNonCheckBrushes(std::list* exclusionList, bool useDetail) +void DEntity::RemoveNonCheckBrushes(list* exclusionList, bool useDetail) { - std::list::iterator chkBrush=brushList.begin(); + list::iterator chkBrush=brushList.begin(); while( chkBrush!=brushList.end() ) { @@ -453,7 +387,7 @@ void DEntity::RemoveNonCheckBrushes(std::list* exclusionList, bool useDetai } } - std::list::iterator eTexture; + list::iterator eTexture; for( eTexture=exclusionList->begin(); eTexture!=exclusionList->end(); eTexture++ ) { @@ -470,24 +404,38 @@ void DEntity::RemoveNonCheckBrushes(std::list* exclusionList, bool useDetai } } -void DEntity::ResetChecks(std::list* exclusionList) +void DEntity::ResetChecks(list* exclusionList) { - for(std::list::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) + for(list::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) { (*resetBrush)->ResetChecks(exclusionList); } } -int DEntity::FixBrushes() +int DEntity::FixBrushes(bool rebuild) { - int count = 0; + g_FuncTable.m_pfnAllocateActiveBrushHandles(); - for(std::list::const_iterator fixBrush=brushList.begin(); fixBrush!=brushList.end(); fixBrush++) + int cnt = 0; + + for(list::const_iterator fixBrush=brushList.begin(); fixBrush!=brushList.end(); fixBrush++) { - count += (*fixBrush)->RemoveRedundantPlanes(); + int count = (*fixBrush)->RemoveRedundantPlanes(); + if(count) + { + cnt += count; + if(rebuild) + { + g_FuncTable.m_pfnDeleteBrushHandle((*fixBrush)->QER_brush); + + (*fixBrush)->BuildInRadiant(FALSE, NULL); + } + } } - return count; + g_FuncTable.m_pfnReleaseActiveBrushHandles(); + + return cnt; } void DEntity::BuildInRadiant(bool allowDestruction) @@ -496,29 +444,35 @@ void DEntity::BuildInRadiant(bool allowDestruction) if(makeEntity) { - NodeSmartReference node(GlobalEntityCreator().createEntity(GlobalEntityClassManager().findOrInsert(m_Classname.GetBuffer(), !brushList.empty() || !patchList.empty()))); + entity_t* pE = (entity_t*)g_FuncTable.m_pfnCreateEntityHandle(); - for(std::list::const_iterator buildEPair=epairList.begin(); buildEPair!=epairList.end(); buildEPair++) + epair_t* pEpS = GetNextChainItem(NULL, "classname", m_Classname); + + epair_t* pEp = pEpS; + + for(list::const_iterator buildEPair=epairList.begin(); buildEPair!=epairList.end(); buildEPair++) { - Node_getEntity(node)->setKeyValue((*buildEPair)->key, (*buildEPair)->value); + pEp = GetNextChainItem(pEp, (*buildEPair)->key, (*buildEPair)->value); } - Node_getTraversable(GlobalSceneGraph().root())->insert(node); + g_EntityTable.m_pfnSetEntityKeyValList(pE, pEpS); - for(std::list::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) - (*buildBrush)->BuildInRadiant(allowDestruction, NULL, node.get_pointer()); + g_FuncTable.m_pfnCommitEntityHandleToMap(pE); - for(std::list::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) - (*buildPatch)->BuildInRadiant(node.get_pointer()); + for(list::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) + (*buildBrush)->BuildInRadiant(allowDestruction, NULL, pE); - QER_Entity = node.get_pointer(); + for(list::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) + (*buildPatch)->BuildInRadiant(pE); + + QER_Entity = pE; } else { - for(std::list::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) + for(list::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) (*buildBrush)->BuildInRadiant(allowDestruction, NULL); - for(std::list::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) + for(list::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) (*buildPatch)->BuildInRadiant(); } } @@ -527,14 +481,14 @@ void DEntity::BuildInRadiant(bool allowDestruction) int DEntity::GetIDMax( void ) { int max = -1; - for(std::list::const_iterator cntBrush=brushList.begin(); cntBrush!=brushList.end(); cntBrush++) { + for(list::const_iterator cntBrush=brushList.begin(); cntBrush!=brushList.end(); cntBrush++) { if((*cntBrush)->m_nBrushID > max) max = (*cntBrush)->m_nBrushID; } return max+1; } -void DEntity::SetClassname( const char *classname ) { +void DEntity::SetClassname( char *classname ) { m_Classname = classname; } @@ -544,12 +498,12 @@ void DEntity::SaveToFile(FILE *pFile) fprintf(pFile, "\"classname\" \"%s\"\n", (const char *)m_Classname); - for(std::list::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) + for(list::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) { fprintf(pFile, "\"%s\" \"%s\"\n", (const char *)(*ep)->key, (const char *)(*ep)->value); } - for(std::list::const_iterator bp=brushList.begin(); bp!=brushList.end(); bp++) + for(list::const_iterator bp=brushList.begin(); bp!=brushList.end(); bp++) { (*bp)->SaveToFile(pFile); } @@ -559,14 +513,14 @@ void DEntity::SaveToFile(FILE *pFile) void DEntity::ClearEPairs() { - for(std::list::const_iterator deadEPair=epairList.begin(); deadEPair!=epairList.end(); deadEPair++) + for(list::const_iterator deadEPair=epairList.begin(); deadEPair!=epairList.end(); deadEPair++) { delete (*deadEPair); } epairList.clear(); } -void DEntity::AddEPair(const char *key, const char *value) { +void DEntity::AddEPair(char *key, char *value) { DEPair* newEPair; newEPair = FindEPairByKey( key ); if(!newEPair) { @@ -578,74 +532,79 @@ void DEntity::AddEPair(const char *key, const char *value) { } } -void DEntity::LoadEPairList(Entity *epl) +void DEntity::LoadEPairList(epair_t *epl) { - class load_epairs_t : public Entity::Visitor - { - DEntity* m_entity; - public: - load_epairs_t(DEntity* entity) - : m_entity(entity) - { - } - void visit(const char* key, const char* value) - { - if(strcmp(key, "classname") == 0) - m_entity->SetClassname(value); - else - m_entity->AddEPair(key, value); - } + epair_t* ep = epl; + while(ep) + { + if(!strcmp(ep->key, "classname")) + SetClassname(ep->value); + else + AddEPair(ep->key, ep->value); - } load_epairs(this); - - epl->forEachKeyValue(load_epairs); + ep = ep->next; + } } bool DEntity::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild) { - bool reset = false; + g_FuncTable.m_pfnDeselectAllBrushes(); - for(std::list::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) + g_FuncTable.m_pfnAllocateActiveBrushHandles(); + + bool reset = FALSE; + + for(list::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) { bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName, bResetTextureName, bResetScale, bResetShift, bResetRotation); if(tmp) { - reset = true; + reset = TRUE; + if(rebuild) { - Node_getTraversable(*(*resetBrush)->QER_entity)->erase(*(*resetBrush)->QER_brush); - (*resetBrush)->BuildInRadiant(false, NULL, (*resetBrush)->QER_entity); + entity_t *pE = (*resetBrush)->QER_brush->owner; + g_FuncTable.m_pfnDeleteBrushHandle((*resetBrush)->QER_brush); + (*resetBrush)->BuildInRadiant(FALSE, NULL, pE->entityId == 0 ? NULL : pE); + + if( pE->entityId == 0 ? NULL : pE ) + { + } } } } if(bResetTextureName) { - for(std::list::const_iterator resetPatch=patchList.begin(); resetPatch!=patchList.end(); resetPatch++) + for(list::const_iterator resetPatch=patchList.begin(); resetPatch!=patchList.end(); resetPatch++) { bool tmp = (*resetPatch)->ResetTextures(textureName, newTextureName); if(tmp) { - reset = true; + reset = TRUE; + if(rebuild) { - Node_getTraversable(*(*resetPatch)->QER_entity)->erase(*(*resetPatch)->QER_brush); - (*resetPatch)->BuildInRadiant((*resetPatch)->QER_entity); + entity_t *pE = (*resetPatch)->QER_brush->owner; + g_FuncTable.m_pfnDeleteBrushHandle((*resetPatch)->QER_brush); + (*resetPatch)->BuildInRadiant(pE->entityId == 0 ? NULL : pE); } } } } + g_FuncTable.m_pfnReleaseActiveBrushHandles(); + return reset; } DEPair* DEntity::FindEPairByKey(const char* keyname) { - for(std::list::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) + for(list::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) { char* c = (*ep)->key; if(!strcmp(c, keyname)) @@ -656,7 +615,7 @@ DEPair* DEntity::FindEPairByKey(const char* keyname) void DEntity::RemoveFromRadiant() { - Node_getTraversable(GlobalSceneGraph().root())->erase(*QER_Entity); + g_EntityTable.m_pfnEntity_Free( (entity_t*)QER_Entity ); QER_Entity = NULL; } @@ -685,9 +644,9 @@ void DEntity::SpawnFloat(const char* key, const char* defaultstring, float* out) { DEPair* pEP = FindEPairByKey(key); if(pEP) { - *out = static_cast(atof(pEP->value)); + *out = static_cast< float >( atof( pEP->value ) ); } else { - *out = static_cast(atof(defaultstring)); + *out = static_cast< float >( atof(defaultstring) ); } } @@ -702,13 +661,13 @@ void DEntity::SpawnVector(const char* key, const char* defaultstring, vec_t* out } int DEntity::GetBrushCount( void ) { - return static_cast(brushList.size()); + return brushList.size(); } -DBrush* DEntity::FindBrushByPointer( scene::Node& brush ) { - for(std::list::const_iterator listBrush = brushList.begin(); listBrush != brushList.end(); listBrush++) { +DBrush* DEntity::FindBrushByPointer( brush_t* brush ) { + for(list::const_iterator listBrush = brushList.begin(); listBrush != brushList.end(); listBrush++) { DBrush* pBrush = (*listBrush); - if(pBrush->QER_brush == &brush) { + if(pBrush->QER_brush == brush) { return pBrush; } } diff --git a/contrib/bobtoolz/DEntity.h b/contrib/bobtoolz/DEntity.h index 5baa3d3d..63837c84 100644 --- a/contrib/bobtoolz/DEntity.h +++ b/contrib/bobtoolz/DEntity.h @@ -24,41 +24,30 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_ +#include "DBrush.h" +#include "DEPair.h" +#include "DPatch.h" +#include "StdAfx.h" // Added by ClassView + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 -#include -#include "str.h" -#include "mathlib.h" - -class DEPair; -class DBrush; -class DPlane; -class DPatch; -class Entity; - -namespace scene -{ - class Node; -} -class _QERFaceData; - class DEntity { public: void RemoveFromRadiant(); - scene::Node* QER_Entity; + entity_t* QER_Entity; int m_nID; // Constrcution/Destruction - DEntity(const char* classname = "worldspawn", int ID = -1); // sets classname + DEntity(char* classname = "worldspawn", int ID = -1); // sets classname virtual ~DEntity(); // --------------------------------------------- // epair functions........ - void LoadEPairList(Entity* epl); - void AddEPair(const char* key, const char* value); + void LoadEPairList(epair_t* epl); + void AddEPair(char* key, char* value); void ClearEPairs(); DEPair* FindEPairByKey(const char* keyname); // --------------------------------------------- @@ -66,16 +55,16 @@ public: // random functions........ bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild); void SaveToFile(FILE* pFile); - void SetClassname(const char* classname); + void SetClassname(char* classname); int GetIDMax(); void BuildInRadiant(bool allowDestruction); - void ResetChecks(std::list* exclusionList); - void RemoveNonCheckBrushes(std::list* exclusionList, bool useDetail); + void ResetChecks(list* exclusionList); + void RemoveNonCheckBrushes(list* exclusionList, bool useDetail); DPlane* AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID); // slow, try not to use much int GetBrushCount( void ); - DBrush* FindBrushByPointer( scene::Node& brush ); + DBrush* FindBrushByPointer( brush_t* brush ); // --------------------------------------------- @@ -100,17 +89,18 @@ public: // --------------------------------------------- // vars - std::list epairList; - std::list brushList; + list epairList; + list brushList; // new patches, wahey!!! - std::list patchList; + list patchList; Str m_Classname; // --------------------------------------------- - int FixBrushes(); + int FixBrushes(bool rebuild); - bool LoadFromEntity(scene::Node& ent, bool bLoadPatches = false); + bool LoadFromEntity(int id, bool bLoadPatches = FALSE); + bool LoadFromEntity(entity_t* ent, bool bLoadPatches = FALSE); void LoadSelectedBrushes(); void LoadSelectedPatches(); diff --git a/contrib/bobtoolz/DListener.cpp b/contrib/bobtoolz/DListener.cpp new file mode 100644 index 00000000..cb7b928a --- /dev/null +++ b/contrib/bobtoolz/DListener.cpp @@ -0,0 +1,93 @@ +/* +BobToolz plugin for GtkRadiant +Copyright (C) 2001 Gordon Biggans + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +// DListener.cpp: implementation of the DListener class. +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" +#include "DListener.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +DListener::DListener() +{ + refCount = 1; + m_bHooked = FALSE; +} + +DListener::~DListener() +{ + UnRegister(); +} + +void DListener::Register() +{ + g_MessageTable.m_pfnHookWindow( this ); + m_bHooked = TRUE; +} + +void DListener::UnRegister() +{ + if(m_bHooked) + { + g_MessageTable.m_pfnUnHookWindow( this ); + m_bHooked = FALSE; + } +} + +bool DListener::OnMouseMove(guint32 nFlags, gdouble x, gdouble y) +{ + if(!parent->UpdatePath()) + delete parent; + + return FALSE; +} + +bool DListener::OnLButtonDown(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} + +bool DListener::OnLButtonUp(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} + +bool DListener::OnRButtonDown(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} + +bool DListener::OnRButtonUp(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} + +bool DListener::OnMButtonDown(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} + +bool DListener::OnMButtonUp(guint32 nFlags, gdouble x, gdouble y) +{ + return FALSE; +} diff --git a/contrib/bobtoolz/DListener.h b/contrib/bobtoolz/DListener.h new file mode 100644 index 00000000..d2166993 --- /dev/null +++ b/contrib/bobtoolz/DListener.h @@ -0,0 +1,62 @@ +/* +BobToolz plugin for GtkRadiant +Copyright (C) 2001 Gordon Biggans + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +// DListener.h: interface for the DListener class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_DLISTENER_H__53EBE342_F0B2_11D4_ACF7_004095A18133__INCLUDED_) +#define AFX_DLISTENER_H__53EBE342_F0B2_11D4_ACF7_004095A18133__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "DBobView.h" + +class DListener : public IWindowListener +{ +public: + DBobView* parent; + + bool OnMouseMove(guint32 nFlags, gdouble x, gdouble y); + bool OnLButtonDown(guint32 nFlags, gdouble x, gdouble y); + bool OnMButtonDown(guint32 nFlags, gdouble x, gdouble y); + bool OnRButtonDown(guint32 nFlags, gdouble x, gdouble y); + bool OnLButtonUp(guint32 nFlags, gdouble x, gdouble y); + bool OnMButtonUp(guint32 nFlags, gdouble x, gdouble y); + bool OnRButtonUp(guint32 nFlags, gdouble x, gdouble y); + bool OnKeyPressed(char *s) { return false; } + bool Paint() { return true; } + void Close() { } + + void UnRegister(); + void Register(); + DListener(); + virtual ~DListener(); + + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + +private: + bool m_bHooked; + int refCount; +}; + +#endif // !defined(AFX_DLISTENER_H__53EBE342_F0B2_11D4_ACF7_004095A18133__INCLUDED_) diff --git a/contrib/bobtoolz/DMap.cpp b/contrib/bobtoolz/DMap.cpp index 18e43188..bc0b0661 100644 --- a/contrib/bobtoolz/DMap.cpp +++ b/contrib/bobtoolz/DMap.cpp @@ -21,29 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DMap.h" -#include "str.h" -#include - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" -#include "DEntity.h" - -#include "iundo.h" - -#include "generic/referencecounted.h" - -#include -#include -#include -#include - -#include "scenelib.h" - ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -77,7 +57,7 @@ void DMap::ClearEntities() { m_nNextEntity = 1; - for(std::list::const_iterator deadEntity=entityList.begin(); deadEntity!=entityList.end(); deadEntity++) + for(list::const_iterator deadEntity=entityList.begin(); deadEntity!=entityList.end(); deadEntity++) delete *deadEntity; entityList.clear(); @@ -87,7 +67,7 @@ DEntity* DMap::GetEntityForID(int ID) { DEntity* findEntity = NULL; - for(std::list::const_iterator chkEntity=entityList.begin(); chkEntity!=entityList.end(); chkEntity++) + for(list::const_iterator chkEntity=entityList.begin(); chkEntity!=entityList.end(); chkEntity++) { if((*chkEntity)->m_nID == ID) { @@ -110,7 +90,7 @@ DEntity* DMap::GetWorldSpawn() void DMap::BuildInRadiant(bool bAllowDestruction) { - for(std::list::const_iterator buildEntity=entityList.begin(); buildEntity!=entityList.end(); buildEntity++) + for(list::const_iterator buildEntity=entityList.begin(); buildEntity!=entityList.end(); buildEntity++) (*buildEntity)->BuildInRadiant(bAllowDestruction); } @@ -118,37 +98,45 @@ void DMap::LoadAll(bool bLoadPatches) { ClearEntities(); - GlobalSelectionSystem().setSelectedAll(false); + g_FuncTable.m_pfnDeselectAllBrushes(); - class load_entities_t : public scene::Traversable::Walker - { - DMap* m_map; - bool m_bLoadPatches; - public: - load_entities_t(DMap* map, bool bLoadPatches) - : m_map(map), m_bLoadPatches(bLoadPatches) - { - } - bool pre(scene::Node& node) const - { - if(Node_isEntity(node)) - { - DEntity* loadEntity = m_map->AddEntity("", 0); - loadEntity->LoadFromEntity(node, m_bLoadPatches); - } - return false; - } - } load_entities(this, bLoadPatches); + int count = g_FuncTable.m_pfnGetEntityCount(); - Node_getTraversable(GlobalSceneGraph().root())->traverse(load_entities); + for(int i = 0; i < count; i++) + { + DEntity* loadEntity; + + if(i == 0) + loadEntity = GetWorldSpawn(); + else + loadEntity = AddEntity("", m_nNextEntity++); + + if(!loadEntity->LoadFromEntity(i, bLoadPatches)) + { + delete loadEntity; + entityList.pop_back(); + } + } } -int DMap::FixBrushes() +int DMap::FixBrushes(bool rebuild) { int count = 0; - for(std::list::const_iterator fixEntity=entityList.begin(); fixEntity!=entityList.end(); fixEntity++) + for(list::const_iterator fixEntity=entityList.begin(); fixEntity!=entityList.end(); fixEntity++) { - count += (*fixEntity)->FixBrushes(); + int cnt; + + if(!stricmp("worldspawn", (*fixEntity)->m_Classname)) + cnt = (*fixEntity)->FixBrushes(rebuild); + else + { + cnt = (*fixEntity)->FixBrushes(FALSE); + + if(cnt && rebuild) + RebuildEntity(*fixEntity); + } + + count += cnt; } return count; @@ -157,15 +145,15 @@ int DMap::FixBrushes() void DMap::ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation) { - for(std::list::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++) + for(list::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++) { - if(string_equal_nocase("worldspawn", (*texEntity)->m_Classname)) + if(!stricmp("worldspawn", (*texEntity)->m_Classname)) (*texEntity)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName, - bResetTextureName, bResetScale, bResetShift, bResetRotation, true); + bResetTextureName, bResetScale, bResetShift, bResetRotation, TRUE); else { if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName, - bResetTextureName, bResetScale, bResetShift, bResetRotation, false)) + bResetTextureName, bResetScale, bResetShift, bResetRotation, FALSE)) RebuildEntity(*texEntity); } } @@ -174,5 +162,5 @@ void DMap::ResetTextures( const char* textureName, float fScale[2], float f void DMap::RebuildEntity(DEntity *ent) { ent->RemoveFromRadiant(); - ent->BuildInRadiant(false); + ent->BuildInRadiant(FALSE); } diff --git a/contrib/bobtoolz/DMap.h b/contrib/bobtoolz/DMap.h index 018dbc0f..2d572114 100644 --- a/contrib/bobtoolz/DMap.h +++ b/contrib/bobtoolz/DMap.h @@ -24,35 +24,33 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_) #define AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_ +#include "DEntity.h" + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 -#include - -class DEntity; - class DMap { public: static void RebuildEntity(DEntity* ent); void ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation); - void LoadAll(bool bLoadPatches = false); + void LoadAll(bool bLoadPatches = FALSE); void BuildInRadiant(bool bAllowDestruction); int m_nNextEntity; DEntity* GetWorldSpawn(); void ClearEntities(); - DEntity* GetEntityForID(int ID); + DEntity* DMap::GetEntityForID(int ID); DEntity* AddEntity(char* classname = "worldspawn", int ID = -1); - std::list entityList; + list entityList; DMap(); virtual ~DMap(); - int FixBrushes(); + int FixBrushes(bool rebuild); }; #endif // !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_) diff --git a/contrib/bobtoolz/DPatch.cpp b/contrib/bobtoolz/DPatch.cpp index 30bb5c60..36968b0a 100644 --- a/contrib/bobtoolz/DPatch.cpp +++ b/contrib/bobtoolz/DPatch.cpp @@ -21,14 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DPatch.h" - -#include -#include "str.h" -#include "scenelib.h" - -#include "ipatch.h" - #include "misc.h" #include "./dialogs/dialogs-gtk.h" @@ -46,7 +40,7 @@ DPatch::DPatch() { width = MIN_PATCH_WIDTH; height = MIN_PATCH_HEIGHT; - QER_entity = NULL; + QER_patch = NULL; QER_brush = NULL; } @@ -70,53 +64,27 @@ void CopyDrawVert(const drawVert_t* in, drawVert_t* out) VectorCopy(in->xyz, out->xyz); } -void DPatch::BuildInRadiant(scene::Node* entity) +void DPatch::BuildInRadiant(void* entity) { - NodeSmartReference patch(GlobalPatchCreator().createPatch()); - - scene::Node& parent = entity != 0 ? *entity : GlobalRadiant().getMapWorldEntity(); - Node_getTraversable(parent)->insert(patch); - - GlobalPatchCreator().Patch_setShader(patch, texture); - GlobalPatchCreator().Patch_resize(patch, height, width); - PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch); - for(int x = 0; x < height; x++) - { - for(int y = 0; y < width; y++) - { - PatchControl& p = matrix(y, x); - p.m_vertex[0] = points[x][y].xyz[0]; - p.m_vertex[1] = points[x][y].xyz[1]; - p.m_vertex[2] = points[x][y].xyz[2]; - p.m_texcoord[0] = points[x][y].st[0]; - p.m_texcoord[1] = points[x][y].st[1]; - } - } - GlobalPatchCreator().Patch_controlPointsChanged(patch); - - QER_entity = entity; - QER_brush = patch.get_pointer(); - - -#if 0 int nIndex = g_FuncTable.m_pfnCreatePatchHandle(); //$ FIXME: m_pfnGetPatchHandle patchMesh_t* pm = g_FuncTable.m_pfnGetPatchData(nIndex); - b->patchBrush = true; - b->pPatch = Patch_Alloc(); - b->pPatch->setDims(width,height); + pm->height = height; + pm->width = width; for(int x = 0; x < width; x++) for(int y = 0; y < height; y++) CopyDrawVert(&points[x][y], &pm->ctrl[x][y]); + QER_patch = pm; + /* if(entity) { // strcpy(pm->d_texture->name, texture); brush_t* brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); - brush->patchBrush = true; + brush->patchBrush = TRUE; brush->pPatch = pm; pm->pSymbiot = brush; @@ -135,52 +103,27 @@ void DPatch::BuildInRadiant(scene::Node* entity) g_FuncTable.m_pfnCommitPatchHandleToMap(nIndex, pm, texture); QER_brush = pm->pSymbiot; -#endif } -void DPatch::LoadFromPatch(scene::Instance& patch) +void DPatch::LoadFromBrush_t(brush_t* brush) { - QER_entity = patch.path().parent().get_pointer(); - QER_brush = patch.path().top().get_pointer(); + QER_brush = brush; + QER_patch = brush->pPatch; - PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch.path().top()); + SetTexture(QER_patch->pShader->getName()); - width = static_cast(matrix.x()); - height = static_cast(matrix.y()); + for(int x = 0; x < QER_patch->width; x++) + for(int y = 0; y < QER_patch->height; y++) + CopyDrawVert(&QER_patch->ctrl[x][y], &points[x][y]); - for(int x = 0; x < height; x++) - { - for(int y = 0; y < width; y++) - { - PatchControl& p = matrix(y, x); - points[x][y].xyz[0] = p.m_vertex[0]; - points[x][y].xyz[1] = p.m_vertex[1]; - points[x][y].xyz[2] = p.m_vertex[2]; - points[x][y].st[0] = p.m_texcoord[0]; - points[x][y].st[1] = p.m_texcoord[1]; - } - } - SetTexture(GlobalPatchCreator().Patch_getShader(patch.path().top())); + width = QER_patch->width; + height = QER_patch->height; +} -#if 0 - SetTexture(brush->pPatch->GetShader()); - - width = brush->pPatch->getWidth(); - height = brush->pPatch->getHeight(); - - for(int x = 0; x < height; x++) - { - for(int y = 0; y < width; y++) - { - float *p = brush->pPatch->ctrlAt(ROW,x,y); - p[0] = points[x][y].xyz[0]; - p[1] = points[x][y].xyz[1]; - p[2] = points[x][y].xyz[2]; - p[3] = points[x][y].st[0]; - p[4] = points[x][y].st[1]; - } - } -#endif +void DPatch::RemoveFromRadiant() +{ + if(QER_brush) + g_FuncTable.m_pfnDeleteBrushHandle(QER_brush); } bool DPatch::ResetTextures(const char *oldTextureName, const char *newTextureName) @@ -188,10 +131,10 @@ bool DPatch::ResetTextures(const char *oldTextureName, const char *newTextureNam if( !oldTextureName || !strcmp(texture, oldTextureName)) { strcpy(texture, newTextureName); - return true; + return TRUE; } - return false; + return FALSE; } void Build1dArray(vec3_t* array, drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT], @@ -218,8 +161,8 @@ void Build1dArray(vec3_t* array, drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HE void Print1dArray(vec3_t* array, int size) { for(int i = 0; i < size; i++) - globalOutputStream() << "(" << array[i][0] << " " << array[i][1] << " " << array[i][2] << ")\t"; - globalOutputStream() << "\n"; + Sys_Printf("(%.0f %.0f %.0f)\t", array[i][0], array[i][1], array[i][2]); + Sys_Printf("\n"); } bool Compare1dArrays(vec3_t* a1, vec3_t* a2, int size) @@ -322,11 +265,11 @@ DPatch* DPatch::MergePatches(patch_merge_t merge_info, DPatch *p1, DPatch *p2) int i; for(i = 0; i < p1->height; i++, y++) for(int x = 0; x < p1->width; x++) - newPatch->points[x][y] = p1->points[x][i]; + memcpy(&newPatch->points[x][y], &p1->points[x][i], sizeof(drawVert_t)); for(i = 1; i < p2->height; i++, y++) for(int x = 0; x < p2->width; x++) - newPatch->points[x][y] = p2->points[x][i]; + memcpy(&newPatch->points[x][y], &p2->points[x][i], sizeof(drawVert_t)); // newPatch->Invert(); @@ -335,13 +278,16 @@ DPatch* DPatch::MergePatches(patch_merge_t merge_info, DPatch *p1, DPatch *p2) void DPatch::Invert() { + drawVert_t vertTemp; int i, j; for(i = 0 ; i < width ; i++ ) { for(j = 0; j < height / 2; j++) { - std::swap(points[i][height - 1- j], points[i][j]); + memcpy(&vertTemp, &points[i][height - 1- j], sizeof (drawVert_t)); + memcpy(&points[i][height - 1 - j], &points[i][j], sizeof(drawVert_t)); + memcpy(&points[i][j], &vertTemp, sizeof(drawVert_t)); } } } @@ -349,6 +295,7 @@ void DPatch::Invert() void DPatch::Transpose() { int i, j, w; + drawVert_t dv; if ( width > height ) { @@ -359,12 +306,14 @@ void DPatch::Transpose() if ( j < height ) { // swap the value - std::swap(points[j][i], points[i][j]); + memcpy(&dv, &points[j][i], sizeof(drawVert_t)); + memcpy(&points[j][i], &points[i][j], sizeof(drawVert_t)); + memcpy(&points[i][j], &dv, sizeof(drawVert_t)); } else { // just copy - points[i][j] = points[j][i]; + memcpy(&points[i][j], &points[j][i], sizeof(drawVert_t)); } } } @@ -378,12 +327,14 @@ void DPatch::Transpose() if ( j < width ) { // swap the value - std::swap(points[i][j], points[j][i]); + memcpy(&dv, &points[i][j], sizeof(drawVert_t)); + memcpy(&points[i][j], &points[j][i], sizeof(drawVert_t)); + memcpy(&points[j][i], &dv, sizeof(drawVert_t)); } else { // just copy - points[j][i] = points[i][j]; + memcpy(&points[j][i], &points[i][j], sizeof(drawVert_t)); } } } @@ -396,9 +347,9 @@ void DPatch::Transpose() Invert(); } -std::list DPatch::Split(bool rows, bool cols) +list DPatch::Split(bool rows, bool cols) { - std::list patchList; + list patchList; int i; int x, y; @@ -416,7 +367,7 @@ std::list DPatch::Split(bool rows, bool cols) { for(x = 0; x < p.width; x++) { - p.points[x][y] = points[x][(i*2)+y]; + memcpy(&p.points[x][y], &points[x][(i*2)+y], sizeof(drawVert_t)); } } patchList.push_back(p); @@ -424,13 +375,13 @@ std::list DPatch::Split(bool rows, bool cols) if(cols && width >= 5) { - std::list patchList2; + list patchList2; - for(std::list::iterator patches = patchList.begin(); patches != patchList.end(); patches++) + for(list::iterator patches = patchList.begin(); patches != patchList.end(); patches++) { - std::list patchList3 = (*patches).Split(false, true); + list patchList3 = (*patches).Split(false, true); - for(std::list::iterator patches2 = patchList3.begin(); patches2 != patchList3.end(); patches2++) + for(list::iterator patches2 = patchList3.begin(); patches2 != patchList3.end(); patches2++) patchList2.push_front(*patches2); } @@ -451,7 +402,7 @@ std::list DPatch::Split(bool rows, bool cols) { for(y = 0; y < p.height; y++) { - p.points[x][y] = points[(i*2)+x][y]; + memcpy(&p.points[x][y], &points[(i*2)+x][y], sizeof(drawVert_t)); } } diff --git a/contrib/bobtoolz/DPatch.h b/contrib/bobtoolz/DPatch.h index 32439189..6bdf8e60 100644 --- a/contrib/bobtoolz/DPatch.h +++ b/contrib/bobtoolz/DPatch.h @@ -24,7 +24,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_) #define AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_ -#include +#include "StdAfx.h" // Added by ClassView +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 typedef struct { @@ -33,37 +36,20 @@ typedef struct int pos2; } patch_merge_t; -typedef struct { - float xyz[3]; - float st[2]; - float normal[3]; - float lightmap[2]; -} drawVert_t; - -namespace scene -{ - class Node; - class Instance; -} - -#define MAX_PATCH_WIDTH 16 -#define MAX_PATCH_HEIGHT 16 -#define MIN_PATCH_WIDTH 3 -#define MIN_PATCH_HEIGHT 3 - class DPatch { public: - std::list Split(bool rows, bool cols); + list Split(bool rows, bool cols); void Transpose(); void Invert(); DPatch* MergePatches(patch_merge_t merge_info, DPatch* p1, DPatch* p2); patch_merge_t IsMergable(DPatch* other); bool ResetTextures(const char *oldTextureName, const char *newTextureName); - scene::Node* QER_entity; - scene::Node* QER_brush; - void LoadFromPatch(scene::Instance& patch); - void BuildInRadiant(scene::Node* entity = NULL); + void RemoveFromRadiant(void); + brush_t* QER_brush; + void LoadFromBrush_t(brush_t* brush); + patchMesh_t* QER_patch; + void BuildInRadiant(void* entity = NULL); void SetTexture(const char* textureName); char texture[256]; int width, height; diff --git a/contrib/bobtoolz/DPlane.cpp b/contrib/bobtoolz/DPlane.cpp index c16db749..f11241ec 100644 --- a/contrib/bobtoolz/DPlane.cpp +++ b/contrib/bobtoolz/DPlane.cpp @@ -21,25 +21,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DPlane.h" - -#include - -#include "DPoint.h" #include "DWinding.h" - -#include "str.h" #include "misc.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -DPlane::DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData) +DPlane::DPlane(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData) { MakeNormal( va, vb, vc, normal ); if(VectorNormalize(normal, normal) == 0) // normalizes and returns length - globalErrorStream() << "DPlane::DPlane: Bad Normal.\n"; + Sys_ERROR("DPlane::DPlane: Bad Normal.\n"); _d = (normal[0]*va[0]) + (normal[1]*va[1]) + (normal[2]*va[2]); @@ -47,7 +42,7 @@ DPlane::DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFace VectorCopy(vb, points[1]); VectorCopy(vc, points[2]); - m_bChkOk = true; + m_bChkOk = TRUE; if(texData) memcpy(&texInfo, texData, sizeof(_QERFaceData)); @@ -84,7 +79,7 @@ bool DPlane::PlaneIntersection(DPlane *pl1, DPlane *pl2, vec3_t out) float d = Determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3); if(d == 0) - return false; + return FALSE; float v1 = _d; float v2 = pl1->_d; @@ -98,23 +93,23 @@ bool DPlane::PlaneIntersection(DPlane *pl1, DPlane *pl2, vec3_t out) out[1] = d2/d; out[2] = d3/d; - return true; + return TRUE; } -bool DPlane::IsRedundant(std::list& pointList) +bool DPlane::IsRedundant(list& pointList) { int cnt = 0; - //std::list::const_iterator point=pointList.begin(); - for(std::list::const_iterator point=pointList.begin(); point!=pointList.end(); point++) + //list::const_iterator point=pointList.begin(); + for(list::const_iterator point=pointList.begin(); point!=pointList.end(); point++) { if(fabs(DistanceToPoint((*point)->_pnt)) < MAX_ROUND_ERROR) cnt++; if(cnt == 3) - return false; + return FALSE; } - return true; + return TRUE; } bool DPlane::operator == (DPlane& other) @@ -122,12 +117,12 @@ bool DPlane::operator == (DPlane& other) vec3_t chk; VectorSubtract(other.normal, normal, chk); if(fabs(VectorLength(chk)) > MAX_ROUND_ERROR) - return false; + return FALSE; if(fabs(other._d - _d) > MAX_ROUND_ERROR) - return false; + return FALSE; - return true; + return TRUE; } bool DPlane::operator != (DPlane& other) @@ -135,9 +130,9 @@ bool DPlane::operator != (DPlane& other) vec3_t chk; VectorAdd(other.normal, normal, chk); if(fabs(VectorLength(chk)) > MAX_ROUND_ERROR) - return false; + return FALSE; - return true; + return TRUE; } DWinding* DPlane::BaseWindingForPlane() @@ -160,7 +155,7 @@ DWinding* DPlane::BaseWindingForPlane() } } if (x==-1) - globalOutputStream() << "BaseWindingForPlane: no axis found"; + Sys_Printf ("BaseWindingForPlane: no axis found"); VectorCopy (vec3_origin, vup); switch (x) @@ -212,39 +207,32 @@ void DPlane::Rebuild() CrossProduct(v1, v2, normal); if(VectorNormalize(normal, normal) == 0) // normalizes and returns length - globalErrorStream() << "DPlane::Rebuild: Bad Normal.\n"; + Sys_ERROR("DPlane::Rebuild: Bad Normal.\n"); _d = (normal[0]*points[0][0]) + (normal[1]*points[0][1]) + (normal[2]*points[0][2]); - VectorCopy(points[0], texInfo.m_p0); - VectorCopy(points[1], texInfo.m_p1); - VectorCopy(points[2], texInfo.m_p2); + VectorCopy(points[0], texInfo.m_v1); + VectorCopy(points[1], texInfo.m_v2); + VectorCopy(points[2], texInfo.m_v3); } -bool DPlane::AddToBrush(scene::Node& brush) +bool DPlane::AddToBrush_t(brush_t *brush) { - bool changed = false; - if(!(m_bChkOk || !strcmp(m_shader.c_str(), "textures/common/caulk"))) - { - m_shader = "textures/common/caulk"; - changed = true; - } + if(m_bChkOk || !strcmp(texInfo.m_TextureName, "textures/common/caulk")) + { + g_FuncTable.m_pfnAddFaceData(brush, &texInfo); + return FALSE; + } - _QERFaceData faceData; - faceData.m_p0 = vector3_from_array(points[0]); - faceData.m_p1 = vector3_from_array(points[1]); - faceData.m_p2 = vector3_from_array(points[2]); - faceData.m_texdef = texInfo.m_texdef; - faceData.m_shader = m_shader.c_str(); - GlobalBrushCreator().Brush_addFace(brush, faceData); - - return changed; + strcpy(texInfo.m_TextureName, "textures/common/caulk"); + g_FuncTable.m_pfnAddFaceData(brush, &texInfo); + return TRUE; } void DPlane::ScaleTexture() { } -DPlane::DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* textureName, bool bDetail) +DPlane::DPlane(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail) { vec3_t v1, v2; VectorSubtract(va, vb, v1); @@ -252,7 +240,7 @@ DPlane::DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* te CrossProduct(v1, v2, normal); if(VectorNormalize(normal, normal) == 0) // normalizes and returns length - globalErrorStream() << "DPlane::DPlane: Bad Normal.\n"; + Sys_ERROR("DPlane::DPlane: Bad Normal.\n"); _d = (normal[0]*va[0]) + (normal[1]*va[1]) + (normal[2]*va[2]); @@ -260,9 +248,9 @@ DPlane::DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* te VectorCopy(vb, points[1]); VectorCopy(vc, points[2]); - m_bChkOk = true; + m_bChkOk = TRUE; FillDefaultTexture(&texInfo, points[0], points[1], points[2], textureName); if(bDetail) - texInfo.contents |= FACE_DETAIL; + texInfo.m_nContents |= FACE_DETAIL; } diff --git a/contrib/bobtoolz/DPlane.h b/contrib/bobtoolz/DPlane.h index 68db6ed9..f1a84319 100644 --- a/contrib/bobtoolz/DPlane.h +++ b/contrib/bobtoolz/DPlane.h @@ -24,13 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DPLANE_H__FC37C021_F0A1_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_DPLANE_H__FC37C021_F0A1_11D4_ACF7_004095A18133__INCLUDED_ -#include -#include "ibrush.h" -#include "string/string.h" -#include "mathlib.h" - -class Brush; -class DPoint; +#include "DPoint.h" #define FACE_DETAIL 0x8000000 @@ -43,28 +37,27 @@ class DWinding; class DPlane { public: - DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* textureName, bool bDetail); + DPlane(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail); void ScaleTexture(); DWinding* BaseWindingForPlane(); void Rebuild(); - bool AddToBrush(scene::Node& brush); + bool AddToBrush_t(brush_t *brush); bool operator != (DPlane& other); bool operator == (DPlane& other); - bool IsRedundant(std::list& pointList); + bool IsRedundant(list& pointList); bool PlaneIntersection(DPlane* pl1, DPlane* pl2, vec3_t out);; vec_t DistanceToPoint(vec3_t pnt); - DPlane(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData); + DPlane(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData); DPlane() { } virtual ~DPlane(); bool m_bChkOk; _QERFaceData texInfo; - CopiedString m_shader; vec3_t points[3]; // djbob:do we really need these any more? vec3_t normal; float _d; diff --git a/contrib/bobtoolz/DPoint.cpp b/contrib/bobtoolz/DPoint.cpp index b0b60153..a56e91f0 100644 --- a/contrib/bobtoolz/DPoint.cpp +++ b/contrib/bobtoolz/DPoint.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DPoint.h" -#include "misc.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -47,6 +47,6 @@ bool DPoint::operator ==(vec3_t other) vec3_t test; VectorSubtract(other, _pnt, test); if(fabs(VectorLength(test)) > MAX_ROUND_ERROR) - return false; - return true; + return FALSE; + return TRUE; } diff --git a/contrib/bobtoolz/DPoint.h b/contrib/bobtoolz/DPoint.h index 12137341..394352cf 100644 --- a/contrib/bobtoolz/DPoint.h +++ b/contrib/bobtoolz/DPoint.h @@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once #endif // _MSC_VER > 1000 -#include "mathlib.h" - class DPoint { public: diff --git a/contrib/bobtoolz/DShape.cpp b/contrib/bobtoolz/DShape.cpp index 9201d29c..9418b73b 100644 --- a/contrib/bobtoolz/DShape.cpp +++ b/contrib/bobtoolz/DShape.cpp @@ -21,19 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DShape.h" -#include -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" -#include "DEntity.h" - //#include "dialogs-gtk.h" #include "misc.h" @@ -43,7 +33,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Construction/Destruction ////////////////////////////////////////////////////////////////////// -bool bFacesAll[6] = {true, true, true, true, true, true}; +bool bFacesAll[6] = {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE}; DShape::DShape() { @@ -73,7 +63,7 @@ void DShape::BuildRegularPrism(vec3_t min, vec3_t max, int nSides, bool bAlignTo if(bAlignTop) { phase = -(Q_PI/nSides); - VectorScale(radius, static_cast(1.0 / cos(phase)), radius); + VectorScale(radius, static_cast< float >( 1/cos(phase) ), radius); } //----- Build Polygon Vertices ----- @@ -104,16 +94,16 @@ void DShape::BuildRegularPrism(vec3_t min, vec3_t max, int nSides, bool bAlignTo DBrush* pB = m_Container.GetWorldSpawn()->NewBrush(m_nNextBrush++); for(i = 1; i <= nSides; i++) - pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), false); + pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), FALSE); - pB->AddFace(vc[2], vc[1], vc[0], "textures/common/caulk", false); - pB->AddFace(vd[0], vd[1], vd[2], "textures/common/caulk", false); + pB->AddFace(vc[2], vc[1], vc[0], "textures/common/caulk", FALSE); + pB->AddFace(vd[0], vd[1], vd[2], "textures/common/caulk", FALSE); } void DShape::Commit() { - m_Container.GetWorldSpawn()->FixBrushes(); - m_Container.BuildInRadiant(true); + m_Container.GetWorldSpawn()->FixBrushes(FALSE); + m_Container.BuildInRadiant(TRUE); } void DShape::BuildInversePrism(vec3_t min, vec3_t max, int nSides, bool bAlignTop) @@ -133,7 +123,7 @@ void DShape::BuildInversePrism(vec3_t min, vec3_t max, int nSides, bool bAlignTo if(bAlignTop) { phase = -(Q_PI/nSides); - VectorScale(radius, static_cast(1.0 / cos(phase)), radius); + VectorScale(radius, static_cast< float >( 1/cos(phase) ), radius); } //----- Build Polygon Vertices ----- @@ -180,11 +170,11 @@ void DShape::BuildInversePrism(vec3_t min, vec3_t max, int nSides, bool bAlignTo if(top[1] != bottom[1]) // internal line is flat already if true { - pB->AddFace(va[i-1], top, vb[i-1], "textures/common/caulk", false); - pB->AddFace(va[i], vb[i], bottom, "textures/common/caulk", false); + pB->AddFace(va[i-1], top, vb[i-1], "textures/common/caulk", FALSE); + pB->AddFace(va[i], vb[i], bottom, "textures/common/caulk", FALSE); } // add cut-off planes - pB->AddFace(va[i-1], vb[i-1], vb[i], GetCurrentTexture(), false); + pB->AddFace(va[i-1], vb[i-1], vb[i], GetCurrentTexture(), FALSE); // add internal polygon plane } } @@ -214,7 +204,7 @@ void DShape::BuildBorderedPrism(vec3_t min, vec3_t max, int nSides, int nBorder, if(bAlignTop) { phase = -(Q_PI/nSides); - VectorScale(radius, static_cast(1.0 / cos(phase)), radius); + VectorScale(radius, static_cast< float >( 1/cos(phase) ), radius); } //----- Build Polygon Vertices ----- @@ -264,11 +254,11 @@ void DShape::BuildBorderedPrism(vec3_t min, vec3_t max, int nSides, int nBorder, { DBrush* pB = GetBoundingCube(min, max, "textures/common/caulk"); - pB->AddFace(origin, vc[i-1], vd[i-1], "textures/common/caulk", false); - pB->AddFace(origin, vd[i], vc[i], "textures/common/caulk", false); + pB->AddFace(origin, vc[i-1], vd[i-1], "textures/common/caulk", FALSE); + pB->AddFace(origin, vd[i], vc[i], "textures/common/caulk", FALSE); - pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), false); - pB->AddFace(vb[i], va[i], va[i-1], GetCurrentTexture(), false); + pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), FALSE); + pB->AddFace(vb[i], va[i], va[i-1], GetCurrentTexture(), FALSE); } } @@ -343,18 +333,18 @@ DBrush* DShape::GetBoundingCube(vec3_t min, vec3_t max, const char *textureName, //----- Add Six Cube Faces --------- if(bUseFaces[0]) - pB->AddFace(v1, v2, v3, textureName, false); + pB->AddFace(v1, v2, v3, textureName, FALSE); if(bUseFaces[1]) - pB->AddFace(v1, v3, v6, textureName, false); + pB->AddFace(v1, v3, v6, textureName, FALSE); if(bUseFaces[2]) - pB->AddFace(v1, v7, v2, textureName, false); + pB->AddFace(v1, v7, v2, textureName, FALSE); if(bUseFaces[3]) - pB->AddFace(v5, v6, v3, textureName, false); + pB->AddFace(v5, v6, v3, textureName, FALSE); if(bUseFaces[4]) - pB->AddFace(v5, v2, v7, textureName, false); + pB->AddFace(v5, v2, v7, textureName, FALSE); if(bUseFaces[5]) - pB->AddFace(v5, v7, v6, textureName, false); + pB->AddFace(v5, v7, v6, textureName, FALSE); //---------------------------------- @@ -364,7 +354,7 @@ DBrush* DShape::GetBoundingCube(vec3_t min, vec3_t max, const char *textureName, bool DShape::BuildPit(vec3_t min, vec3_t max) { if((max[2] - min[2]) < 196) - return false; + return FALSE; srand(time(NULL)); @@ -465,5 +455,5 @@ bool DShape::BuildPit(vec3_t min, vec3_t max) // ****** END NODROP ******** - return true; + return TRUE; } diff --git a/contrib/bobtoolz/DShape.h b/contrib/bobtoolz/DShape.h index 3c4ed75e..4bc4baa8 100644 --- a/contrib/bobtoolz/DShape.h +++ b/contrib/bobtoolz/DShape.h @@ -24,15 +24,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_DSHAPE_H__0B30B302_9D21_4C2D_836A_61F3C8D4244D__INCLUDED_) #define AFX_DSHAPE_H__0B30B302_9D21_4C2D_836A_61F3C8D4244D__INCLUDED_ +#include "DMap.h" // Added by ClassView +#include "StdAfx.h" // Added by ClassView + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 -#include "mathlib.h" -#include "DMap.h" -class DBrush; -class DEntity; - // defines for polygon stuff #define MAX_POLYGON_FACES 128 diff --git a/contrib/bobtoolz/DTrainDrawer.cpp b/contrib/bobtoolz/DTrainDrawer.cpp index 92b2333a..f5796c80 100644 --- a/contrib/bobtoolz/DTrainDrawer.cpp +++ b/contrib/bobtoolz/DTrainDrawer.cpp @@ -17,45 +17,35 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "DTrainDrawer.h" - -#include -#include "str.h" - +#include "StdAfx.h" #include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" + +#include "DTrainDrawer.h" #include "DEPair.h" -#include "DPatch.h" -#include "DEntity.h" #include "misc.h" #include "funchandlers.h" -#include "iglrender.h" -#include "ientity.h" -#include "math/matrix.h" - #include "dialogs/dialogs-gtk.h" DTrainDrawer::DTrainDrawer() { - m_bDisplay = false; + refCount = 1; + m_bHooked = FALSE; + m_bDisplay = FALSE; BuildPaths(); - constructShaders(); - GlobalShaderCache().attachRenderable(*this); } DTrainDrawer::~DTrainDrawer(void) { - GlobalShaderCache().detachRenderable(*this); - destroyShaders(); + if(m_bHooked) + UnRegister(); ClearPoints(); ClearSplines(); } void DTrainDrawer::ClearSplines() { - for(std::list::const_iterator deadSpline = m_splineList.begin(); deadSpline != m_splineList.end(); deadSpline++) { + for(list::const_iterator deadSpline = m_splineList.begin(); deadSpline != m_splineList.end(); deadSpline++) { (*deadSpline)->m_pointList.clear(); (*deadSpline)->m_vertexList.clear(); delete (*deadSpline); @@ -65,13 +55,25 @@ void DTrainDrawer::ClearSplines() { } void DTrainDrawer::ClearPoints() { - for(std::list::const_iterator deadPoint = m_pointList.begin(); deadPoint != m_pointList.end(); deadPoint++) { + for(list::const_iterator deadPoint = m_pointList.begin(); deadPoint != m_pointList.end(); deadPoint++) { delete *deadPoint; } m_pointList.clear(); } +void DTrainDrawer::Register() { + g_QglTable.m_pfnHookGL2DWindow( this ); + g_QglTable.m_pfnHookGL3DWindow( this ); + m_bHooked = TRUE; +} + +void DTrainDrawer::UnRegister() { + g_QglTable.m_pfnUnHookGL2DWindow( this ); + g_QglTable.m_pfnUnHookGL3DWindow( this ); + m_bHooked = FALSE; +} + void CalculateSpline_r(vec3_t* v, int count, vec3_t out, float tension) { vec3_t dist; @@ -97,70 +99,93 @@ void CalculateSpline_r(vec3_t* v, int count, vec3_t out, float tension) { delete[] v2; } -void DTrainDrawer::render(RenderStateFlags state) const -{ - for(std::list::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { - splinePoint_t* pSP = (*sp); +void DTrainDrawer::Draw3D() { - glBegin(GL_LINE_STRIP); - for(std::list::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) { - glVertex3fv((*v)._pnt); - } - glEnd(); - - } -} - -const char* DTrainDrawer_state_wireframe = "$bobtoolz/traindrawer/wireframe"; -const char* DTrainDrawer_state_solid = "$bobtoolz/traindrawer/solid"; - -void DTrainDrawer::constructShaders() -{ - OpenGLState state; - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_BLEND; - state.m_sort = OpenGLState::eSortOverlayFirst; - state.m_linewidth = 1; - state.m_colour[0] = 1; - state.m_colour[1] = 0; - state.m_colour[2] = 0; - state.m_colour[3] = 1; - state.m_linewidth = 1; - GlobalOpenGLStateLibrary().insert(DTrainDrawer_state_wireframe, state); - - state.m_colour[0] = 1; - state.m_colour[1] = 1; - state.m_colour[2] = 1; - state.m_colour[3] = 1; - state.m_linewidth = 2; - GlobalOpenGLStateLibrary().insert(DTrainDrawer_state_solid, state); - - m_shader_wireframe = GlobalShaderCache().capture(DTrainDrawer_state_wireframe); - m_shader_solid = GlobalShaderCache().capture(DTrainDrawer_state_solid); -} - -void DTrainDrawer::destroyShaders() -{ - GlobalOpenGLStateLibrary().erase(DTrainDrawer_state_wireframe); - GlobalOpenGLStateLibrary().erase(DTrainDrawer_state_solid); - GlobalShaderCache().release(DTrainDrawer_state_wireframe); - GlobalShaderCache().release(DTrainDrawer_state_solid); -} - - -void DTrainDrawer::renderSolid(Renderer& renderer, const VolumeTest& volume) const -{ if(!m_bDisplay) { return; } - renderer.SetState(m_shader_wireframe, Renderer::eWireframeOnly); - renderer.SetState(m_shader_solid, Renderer::eFullMaterials); - renderer.addRenderable(*this, g_matrix4_identity); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); + + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); + + g_QglTable.m_pfn_qglPushMatrix(); + + g_QglTable.m_pfn_qglLineWidth(2.0f); + g_QglTable.m_pfn_qglColor4f(1.0f, 1.0f, 1.0f, 1.0f); + + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH); + + g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS); + + for(list::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { + splinePoint_t* pSP = (*sp); + + g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP); + for(list::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) { + g_QglTable.m_pfn_qglVertex3fv((*v)._pnt); + } + g_QglTable.m_pfn_qglEnd(); + + } + + g_QglTable.m_pfn_qglPopMatrix(); + g_QglTable.m_pfn_qglPopAttrib(); } -void DTrainDrawer::renderWireframe(Renderer& renderer, const VolumeTest& volume) const -{ - renderSolid(renderer, volume); + +void DTrainDrawer::Draw2D(VIEWTYPE vt) { + + if(!m_bDisplay) { + return; + } + + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); + + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); + + g_QglTable.m_pfn_qglPushMatrix(); + + switch(vt) + { + case XY: + break; + case XZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + break; + case YZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f); + break; + } + + g_QglTable.m_pfn_qglLineWidth(1.0f); + g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f); + + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH); + + g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS); + + g_QglTable.m_pfn_qglColor4f(1.f, 0.f, 0.f, 1.f); + + for(list::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { + splinePoint_t* pSP = (*sp); + + g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP); + for(list::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) { + g_QglTable.m_pfn_qglVertex3fv((*v)._pnt); + } + g_QglTable.m_pfn_qglEnd(); + + } + + g_QglTable.m_pfn_qglPopMatrix(); + g_QglTable.m_pfn_qglPopAttrib(); } void AddSplineControl(const char* control, splinePoint_t* pSP) { @@ -170,18 +195,15 @@ void AddSplineControl(const char* control, splinePoint_t* pSP) { pSP->m_pointList.push_front(cp); } -class EntityBuildPaths -{ - mutable DEntity e; - DTrainDrawer& drawer; -public: - EntityBuildPaths(DTrainDrawer& drawer) : drawer(drawer) - { - } - void operator()(scene::Instance& instance) const - { +void DTrainDrawer::BuildPaths() { + int count = g_FuncTable.m_pfnGetEntityCount(); + + DEntity e; + + for(int i = 0; i < count; i++) { + entity_s* ent = (entity_s*)g_FuncTable.m_pfnGetEntityHandle(i); e.ClearEPairs(); - e.LoadEPairList(Node_getEntity(instance.path().top())); + e.LoadEPairList(*g_EntityTable.m_pfnGetEntityKeyValList(ent)); const char* classname = e.m_Classname.GetBuffer(); const char* target; @@ -194,16 +216,16 @@ public: if(!strcmp(classname, "info_train_spline_main")) { if(!targetname) { - globalOutputStream() << "info_train_spline_main with no targetname"; + Sys_Printf( "info_train_spline_main with no targetname" ); return; } e.SpawnString("target", NULL, &target); if(!target) { - drawer.AddControlPoint( targetname, vOrigin ); + AddControlPoint( targetname, vOrigin ); } else { - splinePoint_t* pSP = drawer.AddSplinePoint( targetname, target, vOrigin ); + splinePoint_t* pSP = AddSplinePoint( targetname, target, vOrigin ); e.SpawnString("control", NULL, &control); @@ -218,33 +240,29 @@ public: if(!control) { break; } - + AddSplineControl( control, pSP ); } } } } else if(!strcmp(classname, "info_train_spline_control")) { if(!targetname) { - globalOutputStream() << "info_train_spline_control with no targetname"; + Sys_Printf( "info_train_spline_control with no targetname" ); return; } - drawer.AddControlPoint( targetname, vOrigin ); + AddControlPoint( targetname, vOrigin ); } - } -}; + } -void DTrainDrawer::BuildPaths() { - Scene_forEachEntity(EntityBuildPaths(*this)); - - std::list::const_iterator sp; + list::const_iterator sp; for(sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { splinePoint_t* pSP = (*sp); controlPoint_t* pTarget = FindControlPoint( pSP->strTarget ); if(!pTarget) { - globalOutputStream() << "couldn't find target " << pSP->strTarget; + Sys_Printf( "couldn't find target %s", pSP->strTarget ); return; // continue; } @@ -252,10 +270,10 @@ void DTrainDrawer::BuildPaths() { pSP->pTarget = pTarget; - for(std::list::iterator cp = pSP->m_pointList.begin(); cp != pSP->m_pointList.end(); cp++) { + for(list::iterator cp = pSP->m_pointList.begin(); cp != pSP->m_pointList.end(); cp++) { controlPoint_t* pControl = FindControlPoint( (*cp).strName ); if(!pControl) { - globalOutputStream() << "couldn't find control " << (*cp).strName; + Sys_Printf( "couldn't find control %s", (*cp).strName ); return; } @@ -263,7 +281,8 @@ void DTrainDrawer::BuildPaths() { } } - m_bDisplay = true; + m_bDisplay = TRUE; + Register(); for(sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { splinePoint_t* pSP = (*sp); @@ -273,20 +292,20 @@ void DTrainDrawer::BuildPaths() { continue; } - std::size_t count = pSP->m_pointList.size() + 2; + int count = pSP->m_pointList.size() + 2; vec3_t* v = new vec3_t[count]; VectorCopy(pSP->point.vOrigin, v[0]); int i = 1; - for(std::list::reverse_iterator cp = pSP->m_pointList.rbegin(); cp != pSP->m_pointList.rend(); cp++) { + for(list::reverse_iterator cp = pSP->m_pointList.rbegin(); cp != pSP->m_pointList.rend(); cp++) { VectorCopy((*cp).vOrigin, v[i]); i++; } VectorCopy(pSP->pTarget->vOrigin, v[i]); for (float tension = 0.0f; tension <= 1.f; tension += 0.01f) { - CalculateSpline_r(v, static_cast(count), out._pnt, tension); + CalculateSpline_r(v, count, out._pnt, tension); pSP->m_vertexList.push_front(out); } @@ -296,7 +315,7 @@ void DTrainDrawer::BuildPaths() { pSP->m_vertexList.push_front(out); } - SceneChangeNotify(); + } void DTrainDrawer::AddControlPoint(const char* name, vec_t* origin) @@ -323,13 +342,13 @@ splinePoint_t* DTrainDrawer::AddSplinePoint(const char* name, const char* target controlPoint_t* DTrainDrawer::FindControlPoint(const char* name) { - for(std::list::const_iterator cp = m_pointList.begin(); cp != m_pointList.end(); cp++) { + for(list::const_iterator cp = m_pointList.begin(); cp != m_pointList.end(); cp++) { if(!strcmp(name, (*cp)->strName)) { return (*cp); } } - for(std::list::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { + for(list::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) { if(!strcmp(name, (*sp)->point.strName)) { return &((*sp)->point); } diff --git a/contrib/bobtoolz/DTrainDrawer.h b/contrib/bobtoolz/DTrainDrawer.h index 9d8903ee..3c7ac779 100644 --- a/contrib/bobtoolz/DTrainDrawer.h +++ b/contrib/bobtoolz/DTrainDrawer.h @@ -24,20 +24,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_ +#include "DEntity.h" + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 -#include -#include "mathlib.h" - -#include "irender.h" -#include "renderable.h" - -class DPoint; -class Shader; - typedef struct { char strName[64]; @@ -50,33 +43,34 @@ typedef struct { char strControl[64]; char strTarget[64]; - std::list m_pointList; - std::list m_vertexList; + list m_pointList; + list m_vertexList; controlPoint_t* pTarget; } splinePoint_t; -class DTrainDrawer : public Renderable, public OpenGLRenderable +class DTrainDrawer : + public IGL2DWindow, + public IGL3DWindow { private: - std::list m_splineList; - std::list m_pointList; + list m_splineList; + list m_pointList; + int refCount; + bool m_bHooked; bool m_bDisplay; - Shader* m_shader_wireframe; - Shader* m_shader_solid; public: + void UnRegister(); + void Register(); DTrainDrawer(); virtual ~DTrainDrawer(void); - void render(RenderStateFlags state) const; - void renderSolid(Renderer& renderer, const VolumeTest& volume) const; - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const; - - void constructShaders(); - void destroyShaders(); - + void Draw3D(); + void Draw2D(VIEWTYPE vt); + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } void ClearSplines(); void ClearPoints(); void BuildPaths(); diff --git a/contrib/bobtoolz/DTreePlanter.cpp b/contrib/bobtoolz/DTreePlanter.cpp index 958bcf8b..985987df 100644 --- a/contrib/bobtoolz/DTreePlanter.cpp +++ b/contrib/bobtoolz/DTreePlanter.cpp @@ -17,33 +17,16 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "StdAfx.h" #include "DTreePlanter.h" - -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" -#include "DEntity.h" - -#include "ScriptParser.h" -#include "misc.h" -#include "scenelib.h" - - - #include "funchandlers.h" -SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) -{ - if(button != c_buttonLeft) - { - return SIGNAL_CONTINUE_EMISSION; - } - VIEWTYPE vt = GlobalRadiant().XYWindow_getViewType(); +bool DTreePlanter::OnMouseMove(guint32 nFlags, gdouble x, gdouble y) { + return false; +} + +bool DTreePlanter::OnLButtonDown(guint32 nFlags, gdouble x, gdouble y) { + VIEWTYPE vt = m_XYWrapper->GetViewType(); switch(vt) { case XY: @@ -51,14 +34,14 @@ SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, Button case YZ: case XZ: default: - return SIGNAL_CONTINUE_EMISSION; + return false; } - Vector3 pt, vhit; + vec3_t pt, vhit; - pt = vector3_snapped(GlobalRadiant().XYWindow_windowToWorld(position), GlobalRadiant().getGridSize()); + m_XYWrapper->SnapToGrid( static_cast< int >( x ), static_cast< int >( y ), pt ); - if(FindDropPoint(vector3_to_array(pt), vector3_to_array(vhit))) { + if(FindDropPoint(pt, vhit)) { vhit[2] += m_offset; char buffer[128]; @@ -68,17 +51,17 @@ SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, Button e.AddEPair("origin", buffer); if(m_autoLink) { + entity_t* pLastEntity = NULL; + entity_t* pThisEntity = NULL; - const scene::Path* pLastEntity = NULL; - const scene::Path* pThisEntity = NULL; - - int entpos; + int entNum = -1, lastEntNum = -1, entpos; for(int i = 0; i < 256; i++) { sprintf(buffer, m_linkName, i); - pThisEntity = FindEntityFromTargetname( buffer ); + pThisEntity = FindEntityFromTargetname( buffer, &entNum ); if(pThisEntity) { entpos = i; + lastEntNum = entNum; pLastEntity = pThisEntity; } } @@ -93,12 +76,11 @@ SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, Button if(pLastEntity) { DEntity e2; - e2.LoadFromEntity(pLastEntity->top(), true); + e2.LoadFromEntity(lastEntNum, TRUE); e2.AddEPair("target", buffer); e2.RemoveFromRadiant(); - e2.BuildInRadiant(false); + e2.BuildInRadiant(FALSE); } - } if(m_setAngles) { @@ -121,14 +103,34 @@ SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, Button e.AddEPair("modelscale", buffer); } - e.BuildInRadiant( false ); + e.BuildInRadiant( FALSE ); } if(m_autoLink) { DoTrainPathPlot(); } - return SIGNAL_STOP_EMISSION; + return true; +} + +bool DTreePlanter::OnLButtonUp(guint32 nFlags, gdouble x, gdouble y) { + return false; +} + +bool DTreePlanter::OnRButtonDown(guint32 nFlags, gdouble x, gdouble y) { + return false; +} + +bool DTreePlanter::OnRButtonUp(guint32 nFlags, gdouble x, gdouble y) { + return false; +} + +bool DTreePlanter::OnMButtonDown(guint32 nFlags, gdouble x, gdouble y) { + return false; +} + +bool DTreePlanter::OnMButtonUp(guint32 nFlags, gdouble x, gdouble y) { + return false; } bool DTreePlanter::FindDropPoint(vec3_t in, vec3_t out) { @@ -179,42 +181,36 @@ bool DTreePlanter::FindDropPoint(vec3_t in, vec3_t out) { return found; } -class TreePlanterDropEntityIfSelected -{ - mutable DEntity ent; - DTreePlanter& planter; -public: - TreePlanterDropEntityIfSelected(DTreePlanter& planter) : planter(planter) - { - } - void operator()(scene::Instance& instance) const - { - if(!instance.isSelected()) - { - return; - } - ent.LoadFromEntity(instance.path().top()); +void DTreePlanter::DropEntsToGround( void ) { + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + DEntity ent; + + int cnt = g_FuncTable.m_pfnSelectedBrushCount(); + for(int i = 0; i < cnt; i++) { + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i); + + ent.LoadFromEntity(brush->owner, TRUE); DEPair* pEpair = ent.FindEPairByKey("origin"); if(!pEpair) { - return; + continue; } vec3_t vec, out; sscanf( pEpair->value.GetBuffer(), "%f %f %f", &vec[0], &vec[1], &vec[2]); - planter.FindDropPoint( vec, out ); + FindDropPoint( vec, out ); char buffer[256]; sprintf( buffer, "%f %f %f", out[0], out[1], out[2] ); ent.AddEPair( "origin", buffer ); ent.RemoveFromRadiant(); - ent.BuildInRadiant(false); - } -}; + ent.BuildInRadiant(FALSE); + } -void DTreePlanter::DropEntsToGround( void ) { - Scene_forEachEntity(TreePlanterDropEntityIfSelected(*this)); + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DTreePlanter::MakeChain( void ) { @@ -238,7 +234,7 @@ void DTreePlanter::MakeChain( void ) { e.AddEPair( "control", buffer ); } - e.BuildInRadiant( false ); + e.BuildInRadiant( FALSE ); } for(i = 0; i < m_linkNum-1; i++) { @@ -250,7 +246,7 @@ void DTreePlanter::MakeChain( void ) { sprintf( buffer, "0 %i 0", (i * 64) + 32); e.AddEPair( "origin", buffer ); - e.BuildInRadiant( false ); + e.BuildInRadiant( FALSE ); } } @@ -274,7 +270,7 @@ void DTreePlanter::SelectChain( void ) { e.AddEPair( "control", buffer ); } - e.BuildInRadiant( false ); + e.BuildInRadiant( FALSE ); } for(int i = 0; i < m_linkNum-1; i++) { @@ -286,6 +282,6 @@ void DTreePlanter::SelectChain( void ) { sprintf( buffer, "0 %i 0", (i * 64) + 32); e.AddEPair( "origin", buffer ); - e.BuildInRadiant( false ); + e.BuildInRadiant( FALSE ); }*/ } diff --git a/contrib/bobtoolz/DTreePlanter.h b/contrib/bobtoolz/DTreePlanter.h index 10421660..9048e60b 100644 --- a/contrib/bobtoolz/DTreePlanter.h +++ b/contrib/bobtoolz/DTreePlanter.h @@ -20,14 +20,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __DTREE_H__ #define __DTREE_H__ -#include "qerplugin.h" -#include "signal/isignal.h" -#include "string/string.h" - +#include "../include/igl.h" #include "DEntity.h" -#include "ScriptParser.h" -#include "mathlib.h" #include "misc.h" +#include "ScriptParser.h" #define MAX_QPATH 64 @@ -37,20 +33,23 @@ typedef struct treeModel_s { #define MAX_TP_MODELS 256 -class DTreePlanter { - MouseEventHandlerId m_mouseDown; - SignalHandlerId m_destroyed; +class DTreePlanter : public IWindowListener { public: - SignalHandlerResult mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers); - typedef Member3 MouseDownCaller; - void destroyed() - { - m_mouseDown = MouseEventHandlerId(); - m_destroyed = SignalHandlerId(); - } - typedef Member DestroyedCaller; - - DTreePlanter() { + virtual bool OnMouseMove(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnLButtonDown(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnMButtonDown(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnRButtonDown(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnLButtonUp(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnMButtonUp(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnRButtonUp(guint32 nFlags, gdouble x, gdouble y); + virtual bool OnKeyPressed(char *s) { return false; } + virtual bool Paint() { return true; } + virtual void Close() { } + + DTreePlanter() { + m_refCount = 1; + m_hooked = false; + m_XYWrapper = NULL; m_numModels = 0; m_offset = 0; m_maxPitch = 0; @@ -62,6 +61,8 @@ public: m_autoLink = false; m_linkNum = 0; + Register(); + m_world.LoadSelectedBrushes(); char buffer[256]; @@ -88,24 +89,9 @@ public: fclose( file ); } - - m_mouseDown = GlobalRadiant().XYWindowMouseDown_connect(makeSignalHandler3(MouseDownCaller(), *this)); - m_destroyed = GlobalRadiant().XYWindowDestroyed_connect(makeSignalHandler(DestroyedCaller(), *this)); } - virtual ~DTreePlanter() - { - if(!m_mouseDown.isNull()) - { - GlobalRadiant().XYWindowMouseDown_disconnect(m_mouseDown); - } - if(!m_destroyed.isNull()) - { - GlobalRadiant().XYWindowDestroyed_disconnect(m_destroyed); - } - } - -#define MT(t) string_equal_nocase( pToken, t ) +#define MT(t) !stricmp( pToken, t ) #define GT pToken = pScriptParser->GetToken( true ) #define CT if(!*pToken) { return; } @@ -164,11 +150,11 @@ public: } else if(MT("scale")) { GT; CT; - m_minScale = static_cast(atof(pToken)); + m_minScale = static_cast< float >( atof( pToken ) ); GT; CT; - m_maxScale = static_cast(atof(pToken)); + m_maxScale = static_cast< float >( atof( pToken ) ); m_useScale = true; } else if(MT("numlinks")) { @@ -179,16 +165,41 @@ public: } while( true ); } + virtual ~DTreePlanter() { + UnRegister(); + } + + virtual void IncRef() { m_refCount++; } + virtual void DecRef() { m_refCount--; if (m_refCount <= 0) delete this; } + + void Register() { + if(!m_hooked) { + g_MessageTable.m_pfnHookWindow( this ); + m_XYWrapper = g_MessageTable.m_pfnGetXYWndWrapper(); + m_hooked = true; + } + } + + void UnRegister() { + if(m_hooked) { + g_MessageTable.m_pfnUnHookWindow( this ); + m_XYWrapper = NULL; + m_hooked = false; + } + } + bool FindDropPoint(vec3_t in, vec3_t out); void DropEntsToGround( void ); void MakeChain( void ); void SelectChain( void ); private: + IXYWndWrapper* m_XYWrapper; DEntity m_world; treeModel_t m_trees[MAX_TP_MODELS]; + int m_refCount; int m_numModels; int m_offset; int m_maxPitch; @@ -203,6 +214,7 @@ private: float m_minScale; float m_maxScale; + bool m_hooked; bool m_useScale; bool m_setAngles; bool m_autoLink; diff --git a/contrib/bobtoolz/DVisDrawer.cpp b/contrib/bobtoolz/DVisDrawer.cpp index 0a936941..318b7bc8 100644 --- a/contrib/bobtoolz/DVisDrawer.cpp +++ b/contrib/bobtoolz/DVisDrawer.cpp @@ -21,17 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// -#include "DVisDrawer.h" - -#include "iglrender.h" -#include "math/matrix.h" - -#include -#include "str.h" - +#include "StdAfx.h" #include "DPoint.h" -#include "DWinding.h" - +#include "DVisDrawer.h" #include "misc.h" #include "funchandlers.h" @@ -41,16 +33,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA DVisDrawer::DVisDrawer() { + refCount = 1; + m_bHooked = FALSE; m_list = NULL; - - constructShaders(); - GlobalShaderCache().attachRenderable(*this); } DVisDrawer::~DVisDrawer() { - GlobalShaderCache().detachRenderable(*this); - destroyShaders(); + if(m_bHooked) + UnRegister(); g_VisView = NULL; } @@ -58,73 +49,117 @@ DVisDrawer::~DVisDrawer() ////////////////////////////////////////////////////////////////////// // Implementation ////////////////////////////////////////////////////////////////////// -const char* g_state_solid = "$bobtoolz/visdrawer/solid"; -const char* g_state_wireframe = "$bobtoolz/visdrawer/wireframe"; -void DVisDrawer::constructShaders() +void DVisDrawer::Draw2D(VIEWTYPE vt) { - OpenGLState state; - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_COLOURCHANGE; - state.m_linewidth = 1; + if(!m_list) + return; - GlobalOpenGLStateLibrary().insert(g_state_wireframe, state); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_FILL|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_COLOURCHANGE|RENDER_SMOOTH|RENDER_DEPTHWRITE; + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); - GlobalOpenGLStateLibrary().insert(g_state_solid, state); + g_QglTable.m_pfn_qglPushMatrix(); + + switch(vt) + { + case XY: + break; + case XZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + break; + case YZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f); + break; + } - m_shader_solid = GlobalShaderCache().capture(g_state_solid); - m_shader_wireframe = GlobalShaderCache().capture(g_state_wireframe); -} + g_QglTable.m_pfn_qglLineWidth(1.0f); + g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f); -void DVisDrawer::destroyShaders() -{ - GlobalShaderCache().release(g_state_solid); - GlobalShaderCache().release(g_state_wireframe); - GlobalOpenGLStateLibrary().erase(g_state_solid); - GlobalOpenGLStateLibrary().erase(g_state_wireframe); -} + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH); + + g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS); -void DVisDrawer::render(RenderStateFlags state) const -{ //bleh - std::list::const_iterator l=m_list->begin(); + list::const_iterator l=m_list->begin(); for(; l != m_list->end(); l++) { DWinding* w = *l; - glColor4f(w->clr[0], w->clr[1], w->clr[2], 0.5f); + g_QglTable.m_pfn_qglColor4f(w->clr[0], w->clr[1], w->clr[2], 0.5f); - glBegin(GL_POLYGON); + g_QglTable.m_pfn_qglBegin(GL_POLYGON); for(int i = 0; i < w->numpoints; i++) { - glVertex3f((w->p[i])[0], (w->p[i])[1], (w->p[i])[2]); + g_QglTable.m_pfn_qglVertex3f((w->p[i])[0], (w->p[i])[1], (w->p[i])[2]); } - glEnd(); + g_QglTable.m_pfn_qglEnd(); } + + + g_QglTable.m_pfn_qglPopMatrix(); + + g_QglTable.m_pfn_qglPopAttrib(); } -void DVisDrawer::renderWireframe(Renderer& renderer, const VolumeTest& volume) const +void DVisDrawer::Draw3D() { if(!m_list) return; - renderer.SetState(m_shader_wireframe, Renderer::eWireframeOnly); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); - renderer.addRenderable(*this, g_matrix4_identity); + g_QglTable.m_pfn_qglColor4f(1.0, 0.0, 0.0, 0.5f); + +// g_QglTable.m_pfn_qglHint(GL_FOG_HINT, GL_NICEST); + +// g_QglTable.m_pfn_qglDisable(GL_CULL_FACE); + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); + +// g_QglTable.m_pfn_qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +// g_QglTable.m_pfn_qglShadeModel(GL_SMOOTH); + + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH); + + g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS); + + //bleh + list::const_iterator l=m_list->begin(); + + for(; l != m_list->end(); l++) + { + DWinding* w = *l; + + g_QglTable.m_pfn_qglColor4f(w->clr[0], w->clr[1], w->clr[2], 0.5f); + + g_QglTable.m_pfn_qglBegin(GL_POLYGON); + for(int i = 0; i < w->numpoints; i++) { + g_QglTable.m_pfn_qglVertex3f((w->p[i])[0], (w->p[i])[1], (w->p[i])[2]); + } + g_QglTable.m_pfn_qglEnd(); + } + + g_QglTable.m_pfn_qglPopAttrib(); } -void DVisDrawer::renderSolid(Renderer& renderer, const VolumeTest& volume) const +void DVisDrawer::Register() { - if(!m_list) - return; + g_QglTable.m_pfnHookGL2DWindow( this ); + g_QglTable.m_pfnHookGL3DWindow( this ); + m_bHooked = TRUE; +} - renderer.SetState(m_shader_solid, Renderer::eWireframeOnly); - renderer.SetState(m_shader_solid, Renderer::eFullMaterials); - - renderer.addRenderable(*this, g_matrix4_identity); +void DVisDrawer::UnRegister() +{ + g_QglTable.m_pfnUnHookGL2DWindow( this ); + g_QglTable.m_pfnUnHookGL3DWindow( this ); + m_bHooked = FALSE; } void DVisDrawer::SetList(std::list *pointList) @@ -137,7 +172,7 @@ void DVisDrawer::SetList(std::list *pointList) void DVisDrawer::ClearPoints() { - std::list::const_iterator deadPoint=m_list->begin(); + list::const_iterator deadPoint=m_list->begin(); for(; deadPoint!=m_list->end(); deadPoint++) delete *deadPoint; m_list->clear(); diff --git a/contrib/bobtoolz/DVisDrawer.h b/contrib/bobtoolz/DVisDrawer.h index 83a80cb1..2f9ac315 100644 --- a/contrib/bobtoolz/DVisDrawer.h +++ b/contrib/bobtoolz/DVisDrawer.h @@ -24,39 +24,35 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #if !defined(AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_) #define AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_ +#include "DWinding.h" + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 -#include -#include "renderable.h" -#include "irender.h" - -#include "DWinding.h" - -class DVisDrawer : public Renderable, public OpenGLRenderable +class DVisDrawer : + public IGL2DWindow, + public IGL3DWindow { - Shader* m_shader_solid; - Shader* m_shader_wireframe; public: DVisDrawer(); virtual ~DVisDrawer(); protected: - std::list* m_list; + list* m_list; int refCount; public: void ClearPoints(); - void SetList(std::list* pointList); - - void render(RenderStateFlags state) const; - void renderSolid(Renderer& renderer, const VolumeTest& volume) const; - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const; - - void constructShaders(); - void destroyShaders(); + void SetList(list* pointList); + void UnRegister(); + void Register(); + void Draw3D(); + void Draw2D(VIEWTYPE vt); + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + bool m_bHooked; }; #endif // !defined(AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_) diff --git a/contrib/bobtoolz/DWinding.cpp b/contrib/bobtoolz/DWinding.cpp index 2068f3f8..118d6be3 100644 --- a/contrib/bobtoolz/DWinding.cpp +++ b/contrib/bobtoolz/DWinding.cpp @@ -21,12 +21,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" #include "DWinding.h" - -#include - -#include "DPoint.h" #include "DPlane.h" +#include "misc.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -156,8 +154,8 @@ DWinding* DWinding::CopyWinding() int DWinding::WindingOnPlaneSide(vec3_t normal, vec_t dist) { - bool front = false; - bool back = false; + bool front = FALSE; + bool back = FALSE; for (int i = 0; i < numpoints; i++) { @@ -166,14 +164,14 @@ int DWinding::WindingOnPlaneSide(vec3_t normal, vec_t dist) { if (front) return SIDE_CROSS; - back = true; + back = TRUE; continue; } if (d > ON_EPSILON) { if (back) return SIDE_CROSS; - front = true; + front = TRUE; continue; } } @@ -192,11 +190,11 @@ void DWinding::CheckWinding() vec3_t dir, edgenormal; if (numpoints < 3) - globalOutputStream() << "CheckWinding: " << numpoints << " points\n"; + Sys_Printf ("CheckWinding: %i points", numpoints); vec_t area = WindingArea(); if (area < 1) - globalOutputStream() << "CheckWinding: " << area << " area\n"; + Sys_Printf ("CheckWinding: %f area", area); DPlane* wPlane = WindingPlane (); int i; @@ -207,21 +205,21 @@ void DWinding::CheckWinding() int j; for (j = 0; j < 3; j++) if (p1[j] > BOGUS_RANGE || p1[j] < -BOGUS_RANGE) - globalOutputStream() << "CheckFace: BOGUS_RANGE: " << p1[j] << "\n"; + Sys_Printf ("CheckFace: BUGUS_RANGE: %f", p1[j]); j = i + 1 == numpoints ? 0 : i + 1; // check the point is on the face plane vec_t d = DotProduct (p1, wPlane->normal) - wPlane->_d; if (d < -ON_EPSILON || d > ON_EPSILON) - globalOutputStream() << "CheckWinding: point off plane\n"; + Sys_Printf ("CheckWinding: point off plane"); // check the edge isnt degenerate p2 = p[j]; VectorSubtract (p2, p1, dir); if (VectorLength (dir) < ON_EPSILON) - globalOutputStream() << "CheckWinding: degenerate edge\n"; + Sys_Printf ("CheckWinding: degenerate edge"); CrossProduct (wPlane->normal, dir, edgenormal); VectorNormalize (edgenormal, edgenormal); @@ -235,7 +233,7 @@ void DWinding::CheckWinding() d = DotProduct (p[j], edgenormal); if (d > (edgedist + ON_EPSILON)) - globalOutputStream() << "CheckWinding: non-convex\n"; + Sys_Printf ("CheckWinding: non-convex"); } } @@ -286,11 +284,11 @@ bool DWinding::ChopWindingInPlace(DPlane* chopPlane, vec_t epsilon) if (!counts[0]) { delete this; - return false; + return FALSE; } if (!counts[1]) - return true; + return TRUE; int maxpts = numpoints+4; // cant use counts[0]+2 because // of fp grouping errors @@ -338,15 +336,15 @@ bool DWinding::ChopWindingInPlace(DPlane* chopPlane, vec_t epsilon) } if (f->numpoints > maxpts) - globalOutputStream() << "ClipWinding: points exceeded estimate\n"; + Sys_Printf ("ClipWinding: points exceeded estimate"); if (f->numpoints > MAX_POINTS_ON_WINDING) - globalOutputStream() << "ClipWinding: MAX_POINTS_ON_WINDING\n"; + Sys_Printf ("ClipWinding: MAX_POINTS_ON_WINDING"); delete[] p; p = f->p; f->p = NULL; delete f; - return true; + return TRUE; } void DWinding::ClipWindingEpsilon(DPlane* chopPlane, vec_t epsilon, DWinding **front, DWinding **back) @@ -454,9 +452,9 @@ void DWinding::ClipWindingEpsilon(DPlane* chopPlane, vec_t epsilon, DWinding **f } if (f->numpoints > maxpts || b->numpoints > maxpts) - globalOutputStream() << "ClipWinding: points exceeded estimate\n"; + Sys_Printf ("ClipWinding: points exceeded estimate"); if (f->numpoints > MAX_POINTS_ON_WINDING || b->numpoints > MAX_POINTS_ON_WINDING) - globalOutputStream() << "ClipWinding: MAX_POINTS_ON_WINDING\n"; + Sys_Printf ("ClipWinding: MAX_POINTS_ON_WINDING"); } bool DWinding::ChopWinding(DPlane* chopPlane) @@ -472,7 +470,7 @@ bool DWinding::ChopWinding(DPlane* chopPlane) if(!f) { delete this; - return false; + return FALSE; } delete[] p; @@ -481,5 +479,5 @@ bool DWinding::ChopWinding(DPlane* chopPlane) numpoints = f->numpoints; delete f; - return true; + return TRUE; } diff --git a/contrib/bobtoolz/DWinding.h b/contrib/bobtoolz/DWinding.h index 52846aab..6d58e06e 100644 --- a/contrib/bobtoolz/DWinding.h +++ b/contrib/bobtoolz/DWinding.h @@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once #endif // _MSC_VER > 1000 -#include "mathlib.h" - class DPlane; class DWinding diff --git a/contrib/bobtoolz/ScriptParser.cpp b/contrib/bobtoolz/ScriptParser.cpp index 826613e4..012e531a 100644 --- a/contrib/bobtoolz/ScriptParser.cpp +++ b/contrib/bobtoolz/ScriptParser.cpp @@ -1,24 +1,5 @@ -/* -BobToolz plugin for GtkRadiant -Copyright (C) 2001 Gordon Biggans - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - +#include "StdAfx.h" #include "ScriptParser.h" -#include CScriptParser::CScriptParser(void): m_pScript(NULL), diff --git a/contrib/bobtoolz/ScriptParser.h b/contrib/bobtoolz/ScriptParser.h index 27eb6df7..5537401f 100644 --- a/contrib/bobtoolz/ScriptParser.h +++ b/contrib/bobtoolz/ScriptParser.h @@ -1,32 +1,12 @@ -/* -BobToolz plugin for GtkRadiant -Copyright (C) 2001 Gordon Biggans - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - #ifndef _SCRIPTPARSER_H_ #define _SCRIPTPARSER_H_ -//#include "interfaces/IScriptParser.h" +#include "interfaces/IScriptParser.h" #define SP_MAX_BREAKCHARS 16 -class CScriptParser //: public IScriptParser -{ +class CScriptParser: public IScriptParser { public: CScriptParser(void); ~CScriptParser(void); diff --git a/contrib/bobtoolz/StdAfx.h b/contrib/bobtoolz/StdAfx.h index b8897f39..92ffa595 100644 --- a/contrib/bobtoolz/StdAfx.h +++ b/contrib/bobtoolz/StdAfx.h @@ -20,6 +20,137 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __STDAFX_BOBTOOLZ__ #define __STDAFX_BOBTOOLZ__ +#define VC_EXTRALEAN +#ifdef _WIN32 +#pragma warning(disable : 4786) +#endif + +#define BOBTOOLZ_MINOR "bobtoolz" + +#include +#include +#include +#include + +#include "time.h" + +#if defined (__linux__) || defined (__APPLE__) + +// Necessary for proper boolean type declaration +#include "qertypes.h" + +#include + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; +//typedef int bool; + +#define MB_OK 0x00000000L +#define MB_OKCANCEL 0x00000001L +#define MB_ABORTRETRYIGNORE 0x00000002L +#define MB_YESNOCANCEL 0x00000003L +#define MB_YESNO 0x00000004L +#define MB_RETRYCANCEL 0x00000005L + + +#define MB_ICONHAND 0x00000010L +#define MB_ICONQUESTION 0x00000020L +#define MB_ICONEXCLAMATION 0x00000030L +#define MB_ICONASTERISK 0x00000040L + +#define MB_USERICON 0x00000080L +#define MB_ICONWARNING MB_ICONEXCLAMATION +#define MB_ICONERROR MB_ICONHAND +#define MB_ICONINFORMATION MB_ICONASTERISK +#define MB_ICONSTOP MB_ICONHAND + +#define MB_TYPEMASK 0x0000000FL +#define MB_ICONMASK 0x000000F0L +#define MB_DEFMASK 0x00000F00L +#define MB_MODEMASK 0x00003000L +#define MB_MISCMASK 0x0000C000L + +#define IDOK 1 +#define IDCANCEL 2 +#define IDABORT 3 +#define IDRETRY 4 +#define IDIGNORE 5 +#define IDYES 6 +#define IDNO 7 + +#define WINAPI +#ifndef APIENTRY + #define APIENTRY +#endif + +#ifndef GUID_DEFINED +#define GUID_DEFINED +typedef struct _GUID +{ + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; + +#define stricmp strcasecmp + +#endif + +#if defined(__cplusplus) +#ifndef _REFGUID_DEFINED +#define _REFGUID_DEFINED +#define REFGUID const GUID & +#endif // !_REFGUID_DEFINED +#endif + +typedef struct tagRECT +{ + long left; + long top; + long right; + long bottom; +} RECT, *PRECT, *LPRECT; + +typedef uint UINT; + +#endif // __linux__ + +#include "synapse.h" +#include "iplugin.h" +#define USE_QERTABLE_DEFINE + +#include "missing.h" // temporary stuff, needs to be removed + +#include "str.h" +#include "qertypes.h" +#include "qerplugin.h" +#include "idata.h" +#include "ibrush.h" +#include "iselectedface.h" +#include "ishaders.h" +#include "ibspfrontend.h" +#include "iui.h" +#include "igl.h" +#include "itoolbar.h" +#include "ientity.h" + +#include "mathlib.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERAppDataTable g_AppDataTable; +extern _QERBrushTable g_BrushTable; +extern _QERSelectedFaceTable g_SelectedFaceTable; +extern _QERShadersTable g_ShadersTable; +extern _QERQglTable g_QglTable; +extern _QERUITable g_MessageTable; +extern _QEREntityTable g_EntityTable; + + +#define MAX_ROUND_ERROR 0.05 + +#include "gtkr_list.h" #endif diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index be4f7804..e0db8f36 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -17,46 +17,23 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -#include "str.h" -#include "qerplugin.h" -#include "mathlib.h" -#include "string/string.h" -#include "itoolbar.h" +#include "StdAfx.h" #include "funchandlers.h" -#include "DBobView.h" -#include "DVisDrawer.h" -#include "DTrainDrawer.h" -#include "DTreePlanter.h" +#include "misc.h" #include "dialogs/dialogs-gtk.h" #include "../../libs/cmdlib.h" -void BobToolz_construct() -{ -} - -void BobToolz_destroy() -{ - if(g_PathView) { - delete g_PathView; - g_PathView = NULL; - } - if(g_VisView) { - delete g_VisView; - g_VisView = NULL; - } - if(g_TrainView) { - delete g_TrainView; - g_TrainView = NULL; - } - if(g_TreePlanter) { - delete g_TreePlanter; - g_TreePlanter = NULL; - } -} +// Radiant function table +_QERFuncTable_1 g_FuncTable; +_QERAppDataTable g_AppDataTable; +_QERBrushTable g_BrushTable; +_QERShadersTable g_ShadersTable; // vvvvvvvvvvvvvvvvvvvv +_QERSelectedFaceTable g_SelectedFaceTable; // to get texture sizes +_QERQglTable g_QglTable; // for path plotting (hooking to DBobView) +_QERUITable g_MessageTable; // for path plotting (listening for update) +_QEREntityTable g_EntityTable; // plugin name char* PLUGIN_NAME = "bobToolz"; @@ -90,47 +67,56 @@ extern "C" const char* QERPlug_GetCommandList() { extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush) { LoadLists(); - if( string_equal_nocase( p, "brush cleanup" ) ) { + if( !stricmp( p, "brush cleanup" ) ) { DoFixBrushes(); - } else if( string_equal_nocase( p, "polygon builder" ) ) { + } else if( !stricmp( p, "polygon builder" ) ) { DoPolygonsTB(); - } else if( string_equal_nocase( p, "caulk selection" ) ) { + } else if( !stricmp( p, "caulk selection" ) ) { DoCaulkSelection(); - } else if( string_equal_nocase( p, "tree planter" ) ) { + } else if( !stricmp( p, "tree planter" ) ) { DoTreePlanter(); - } else if( string_equal_nocase( p, "plot splines" ) ) { + } else if( !stricmp( p, "plot splines" ) ) { DoTrainPathPlot(); - } else if( string_equal_nocase( p, "drop entity" ) ) { + } else if( !stricmp( p, "drop entity" ) ) { DoDropEnts(); - } else if( string_equal_nocase( p, "merge patches" ) ) { + } else if( !stricmp( p, "merge patches" ) ) { DoMergePatches(); - } else if( string_equal_nocase( p, "split patches" ) ) { + } else if( !stricmp( p, "split patches" ) ) { DoSplitPatch(); - } else if( string_equal_nocase( p, "turn edge" ) ) { + } else if( !stricmp( p, "turn edge" ) ) { DoFlipTerrain(); - } else if( string_equal_nocase(p, "reset textures...") ) { + } else if( !stricmp(p, "reset textures...") ) { DoResetTextures(); - } else if( string_equal_nocase(p, "pitomatic") ) { - DoPitBuilder(); - } else if( string_equal_nocase(p, "vis viewer") ) { + } else if( !stricmp(p, "pitomatic") ) { + DoPitBuilder(vMin, vMax); + } else if( !stricmp(p, "vis viewer") ) { DoVisAnalyse(); - } else if( string_equal_nocase(p, "about...") ) { - DoMessageBox(PLUGIN_ABOUT, "About", eMB_OK); + } else if( !stricmp(p, "about...") ) { + DoMessageBox(PLUGIN_ABOUT, "About", IDOK); } } -const char* QERPlug_GetCommandTitleList() -{ - return ""; -} - - #define NUM_TOOLBARBUTTONS 9 -std::size_t ToolbarButtonCount( void ) { +unsigned int ToolbarButtonCount( void ) { return NUM_TOOLBARBUTTONS; } +// Load a xpm file and return a pixmap widget. +GtkWidget* new_pixmap (char* filename) { + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + GtkWidget *pixmap; + + g_FuncTable.m_pfnLoadBitmap(filename, (void **)&gdkpixmap, (void **)&mask); + pixmap = gtk_pixmap_new (gdkpixmap, mask); + + gdk_pixmap_unref (gdkpixmap); + gdk_pixmap_unref (mask); + + return pixmap; +} + class CBobtoolzToolbarButton : public IToolbarButton { public: @@ -204,125 +190,108 @@ public: } } - std::size_t mIndex; + int mIndex; }; CBobtoolzToolbarButton g_bobtoolzToolbarButtons[NUM_TOOLBARBUTTONS]; -const IToolbarButton* GetToolbarButton(std::size_t index) +const IToolbarButton* GetToolbarButton(unsigned int index) { g_bobtoolzToolbarButtons[index].mIndex = index; return &g_bobtoolzToolbarButtons[index]; } +// ============================================================================= +// SYNAPSE -#include "modulesystem/singletonmodule.h" - -#include "iscenegraph.h" -#include "irender.h" -#include "iundo.h" -#include "ishaders.h" -#include "ipatch.h" -#include "ibrush.h" -#include "ientity.h" -#include "ieclass.h" -#include "iglrender.h" -#include "iplugin.h" - -class BobToolzPluginDependencies : - public GlobalRadiantModuleRef, - public GlobalUndoModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalSelectionModuleRef, - public GlobalEntityModuleRef, - public GlobalEntityClassManagerModuleRef, - public GlobalShadersModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalBrushModuleRef, - public GlobalPatchModuleRef, - public GlobalOpenGLModuleRef, - public GlobalOpenGLStateLibraryModuleRef +class CSynapseClientBobtoolz : public CSynapseClient { public: - BobToolzPluginDependencies() : - GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities")), - GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders")), - GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")), - GlobalPatchModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("patchtypes")), - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")) - { - } + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientBobtoolz() { } + virtual ~CSynapseClientBobtoolz() { } }; -class BobToolzPluginModule : public TypeSystemRef -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "bobtoolz"); - BobToolzPluginModule() +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientBobtoolz g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { - m_plugin.m_pfnQERPlug_Init = QERPlug_Init; - m_plugin.m_pfnQERPlug_GetName = QERPlug_GetName; - m_plugin.m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = QERPlug_GetCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = QERPlug_Dispatch; - - BobToolz_construct(); + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - ~BobToolzPluginModule() - { - BobToolz_destroy(); - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(TOOLBAR_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPlugToolbarTable)); + g_SynapseClient.AddAPI(PLUGIN_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPluginTable)); -typedef SingletonModule SingletonBobToolzPluginModule; + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(g_AppDataTable), SYN_REQUIRE, &g_AppDataTable); + g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(g_BrushTable), SYN_REQUIRE, &g_BrushTable); + g_SynapseClient.AddAPI(SHADERS_MAJOR, "*", sizeof(g_ShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable); + g_SynapseClient.AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(g_SelectedFaceTable), SYN_REQUIRE, &g_SelectedFaceTable); + g_SynapseClient.AddAPI(UI_MAJOR, NULL, sizeof(g_MessageTable), SYN_REQUIRE, &g_MessageTable); + 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); -SingletonBobToolzPluginModule g_BobToolzPluginModule; - - -class BobToolzToolbarDependencies : - public ModuleRef<_QERPluginTable> -{ -public: - BobToolzToolbarDependencies() : - ModuleRef<_QERPluginTable>("bobtoolz") - { - } -}; - -class BobToolzToolbarModule : public TypeSystemRef -{ - _QERPlugToolbarTable m_table; -public: - typedef _QERPlugToolbarTable Type; - STRING_CONSTANT(Name, "bobtoolz"); - - BobToolzToolbarModule() - { - m_table.m_pfnToolbarButtonCount = ToolbarButtonCount; - m_table.m_pfnGetToolbarButton = GetToolbarButton; - } - _QERPlugToolbarTable* getTable() - { - return &m_table; - } -}; - -typedef SingletonModule SingletonBobToolzToolbarModule; - -SingletonBobToolzToolbarModule g_BobToolzToolbarModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_BobToolzPluginModule.selfRegister(); - g_BobToolzToolbarModule.selfRegister(); + return &g_SynapseClient; +} + +bool CSynapseClientBobtoolz::RequestAPI(APIDescriptor_t *pAPI) +{ + if( !strcmp(pAPI->minor_name, BOBTOOLZ_MINOR) ) + { + 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; + } + else 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* CSynapseClientBobtoolz::GetInfo() +{ + return "bobToolz module built " __DATE__ " " RADIANT_VERSION; +} + +char* GetFilename(char* buffer, const char* filename) { + strcpy(buffer, g_pSynapseServer->GetModuleFilename(&g_SynapseClient)); + StripFilename( buffer ); + strcat(buffer, "/"); + strcat(buffer, filename); + buffer = UnixToDosPath(buffer); + return buffer; } diff --git a/contrib/bobtoolz/bobToolz.def b/contrib/bobtoolz/bobToolz.def index 74f9189b..c22c76d3 100644 --- a/contrib/bobtoolz/bobToolz.def +++ b/contrib/bobtoolz/bobToolz.def @@ -5,4 +5,4 @@ LIBRARY "bobToolz" EXPORTS ; Explicit exports can go here - Radiant_RegisterModules @1 + Synapse_EnumerateInterfaces @1 diff --git a/contrib/bobtoolz/bobToolz.rc b/contrib/bobtoolz/bobToolz.rc index 4abed936..1140cdd2 100644 --- a/contrib/bobtoolz/bobToolz.rc +++ b/contrib/bobtoolz/bobToolz.rc @@ -1,533 +1,533 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "resource.h" -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,1,0 - PRODUCTVERSION 2,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "Comments", "by djbob :P and MarsMattel ~:]\0" - VALUE "CompanyName", "bobCo\0" - VALUE "FileDescription", "All your plugins are belong to us\0" - VALUE "FileVersion", "1, 1, 1, 0\0" - VALUE "InternalName", "bobToolz\0" - VALUE "LegalCopyright", "Copyright (C) y2k\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "bobToolz.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "\0" - VALUE "ProductVersion", "2, 0, 0, 0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Neutral (Sys. Default) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUSD) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUT DIALOG DISCARDABLE 0, 0, 361, 118 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,305,100,50,14 - CTEXT "BobToolz - Q3radiant version by djbob &&&& Mars Mattel", - IDC_STATIC,5,5,350,14,SS_CENTERIMAGE - CTEXT "Latest Version Can Be Found At http://djbob.fortefide.com", - IDC_STATIC,5,20,350,15,SS_CENTERIMAGE - LTEXT "Random bobToolz comments:",IDC_STATIC,5,35,355,10 - CTEXT "Texture Alignments Are Irrelevant, You Will Be Caulked\n-QPSiren\nCaulk Me Baby One More Time\n-TTimo\nWe're Up The Creek Without A Penguin\n-Mars Mattel", - IDC_STATIC,5,45,355,50 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 354 - TOPMARGIN, 7 - BOTTOMMARGIN, 111 - END -END -#endif // APSTUDIO_INVOKED - -#endif // Neutral (Sys. Default) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_STAIR_DIALOG DIALOG DISCARDABLE 0, 0, 246, 118 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Stair Designer" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,189,83,50,12 - PUSHBUTTON "Cancel",IDCANCEL,189,99,50,12 - EDITTEXT IDC_EDIT1,5,5,86,12,ES_AUTOHSCROLL - LTEXT "Stair Height",IDC_STATIC,95,5,42,15,SS_CENTERIMAGE - GROUPBOX "Direction",IDC_STATIC,7,26,85,64 - CONTROL "North",IDC_DIR_N_RADIO,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,14,38,33,10 - CONTROL "South",IDC_DIR_S_RADIO,"Button",BS_AUTORADIOBUTTON,14, - 50,35,10 - CONTROL "East",IDC_DIR_E_RADIO,"Button",BS_AUTORADIOBUTTON,14,62, - 30,10 - CONTROL "West",IDC_DIR_W_RADIO,"Button",BS_AUTORADIOBUTTON,14,74, - 33,10 - GROUPBOX "Style",IDC_STATIC,97,26,82,49 - CONTROL "Original",IDC_STYLE_ORIG_RADIO,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,105,35,39,10 - CONTROL "Bob's Style",IDC_STYLE_BOB_RADIO,"Button", - BS_AUTORADIOBUTTON,105,47,51,10 - CONTROL "Corner",IDC_STYLE_CORNER_RADIO,"Button", - BS_AUTORADIOBUTTON | WS_DISABLED,105,59,51,10 - EDITTEXT IDC_RISER_EDIT,7,99,85,12,ES_AUTOHSCROLL - LTEXT "Riser Texture",IDC_STATIC,95,100,60,11,SS_CENTERIMAGE - CONTROL "Use Detail Brushes",IDC_DETAIL_CHK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,100,80,75,10 -END - -IDD_POLYGON_DIALOG DIALOG DISCARDABLE 0, 0, 271, 68 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Polygon Builder" -FONT 8, "Arial" -BEGIN - PUSHBUTTON "OK",IDOK,150,50,50,14 - PUSHBUTTON "Cancel",IDCANCEL,215,50,50,14 - EDITTEXT IDC_EDIT1,7,7,76,13,ES_AUTOHSCROLL - LTEXT "Number Of Sides",IDC_STATIC,85,7,60,13,SS_CENTERIMAGE - CONTROL "Inverse Polygon",IDC_INVERSE_CHK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,149,21,75,10 - CONTROL "Use Border",IDC_BORDER_CHK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,149,7,66,10 - EDITTEXT IDC_BORDER_EDIT,7,28,76,13,ES_AUTOHSCROLL - LTEXT "Border Size",IDC_STATIC,86,28,60,13,SS_CENTERIMAGE - CONTROL "Align Top Edge",IDC_ALIGN_CHK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,149,35,75,10 -END - -IDD_DOOR_DIALOG DIALOG DISCARDABLE 0, 0, 327, 119 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Door Builder" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,270,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,270,24,50,14 - EDITTEXT IDC_FBTEXTURE_EDIT,7,7,125,14,ES_AUTOHSCROLL - LTEXT "Door Front/Back Texture",IDC_STATIC,137,7,86,14, - SS_CENTERIMAGE - EDITTEXT IDC_TRIMTEXTURE_EDIT,7,26,125,14,ES_AUTOHSCROLL - LTEXT "Door Trim Texture",IDC_STATIC,137,26,86,14, - SS_CENTERIMAGE - CONTROL "Scale Main Texture Horizontally",IDC_TEXSCALE1_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,46,115,10 - CONTROL "Scale Main Texture Vertically",IDC_TEXSCALE2_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,60,107,10 - CONTROL "Scale Trim Texture Horizontally",IDC_TEXSCALE3_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,46,113,10 - CONTROL "Scale Trim Texture Vertically",IDC_TEXSCALE4_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,60,105,10 - COMBOBOX IDC_MAINTEX_COMBO,7,76,126,30,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_TRIMTEX_COMBO,7,99,126,30,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Set As Main Texture",IDC_SET_MAINTEX_BTN,139,76,82,14 - PUSHBUTTON "Set As Trim Texture",IDC_SET_TRIMTEX_BTN,139,98,82,14 - GROUPBOX "Orientation",IDC_DIR_GROUP,225,72,95,40 - CONTROL "North - South",IDC_DIR_NS_RADIO,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,230,82,85,10 - CONTROL "East - West",IDC_DIR_EW_RADIO,"Button", - BS_AUTORADIOBUTTON,230,97,85,10 -END - -IDD_INTERSECT_DIALOG DIALOG DISCARDABLE 0, 0, 245, 58 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Intersecting Brush Finder" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,130,40,50,14 - PUSHBUTTON "Cancel",IDCANCEL,185,40,50,14 - CONTROL "Include Detail Brushes",IDC_DETAIL_INCLUDE_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,130,10,111,10 - GROUPBOX "Brush Options",IDC_STATIC,10,5,111,45 - CONTROL "Use Whole Map",IDC_WHOLEMAP_RADIO,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,15,15,95,10 - CONTROL "Use Selected Brushes",IDC_SELECTED_RADIO,"Button", - BS_AUTORADIOBUTTON,15,30,95,10 - CONTROL "Only Select Duplicate Brushes",IDC_DUPLICATEONLY_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,25,113,10 -END - -IDD_INTERSECT_INFO_DIALOG DIALOG DISCARDABLE 0, 0, 187, 33 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, - 5,15,175,10 - CTEXT "Brush Loading",IDC_STATIC,5,5,175,10,SS_CENTERIMAGE -END - -IDD_BRUSHCHECKER_DIALOG DIALOG DISCARDABLE 0, 0, 182, 38 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, - 5,21,172,10 - CTEXT "Checking Brushes",IDC_STATIC,5,5,170,15,SS_CENTERIMAGE -END - -IDD_AUTOCAULK_DIALOG DIALOG DISCARDABLE 0, 0, 187, 52 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, - 5,15,175,10 - CTEXT "Loading Portal Data",IDC_STATIC,5,5,175,10, - SS_CENTERIMAGE - CONTROL "Progress1",IDC_PROGRESS2,"msctls_progress32",PBS_SMOOTH, - 5,35,175,10 - CTEXT "Auto Caulking",IDC_STATIC,5,25,175,10,SS_CENTERIMAGE -END - -IDD_AUTOCAULKSTART_DIALOG DIALOG DISCARDABLE 0, 0, 237, 83 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Auto Caulk" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,125,10,50,14 - PUSHBUTTON "Cancel",IDCANCEL,180,10,50,14 - CONTROL "Destroy Invisible Brushes",IDC_KILLBRUSHES_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,125,50,95,10 - LTEXT "",IDC_WARNING1_STATIC,5,65,223,11,NOT WS_GROUP - GROUPBOX "Static",IDC_STATIC,5,5,115,57 - CONTROL "Autocaulk",IDC_AC_NORMAL_RADIO,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,10,15,48,10 - CONTROL "Build Mini Prt",IDC_AC_BUILD_MINI_PRT_RADIO,"Button", - BS_AUTORADIOBUTTON,10,30,56,10 - CONTROL "Autocaulk+ (Detail Brushes)",IDC_AC_SUPER_RADIO,"Button", - BS_AUTORADIOBUTTON,10,45,106,10 -END - -IDD_TEXTURE_RESET_DIALOG DIALOG DISCARDABLE 0, 0, 272, 107 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Texture Reset" -FONT 8, "Arial" -BEGIN - DEFPUSHBUTTON "OK",IDOK,160,85,50,14 - PUSHBUTTON "Cancel",IDCANCEL,215,85,50,14 - EDITTEXT IDC_RESET_TEXTURE_EDIT,5,5,118,14,ES_AUTOHSCROLL - EDITTEXT IDC_SCL_VERT_EDIT,85,45,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_SCL_HOR_EDIT,85,65,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_ROTATION_EDIT,85,85,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_SHFT_VER_EDIT,225,45,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_SHFT_HOR_EDIT,225,65,40,14,ES_AUTOHSCROLL - RTEXT "Scale::Vertical",IDC_STATIC,5,45,75,15,SS_CENTERIMAGE - RTEXT "Scale::Horizontal",IDC_STATIC,5,65,75,15,SS_CENTERIMAGE - RTEXT "Rotation",IDC_STATIC,5,85,75,15,SS_CENTERIMAGE - RTEXT "Shift::Horizontal",IDC_STATIC,160,65,60,15, - SS_CENTERIMAGE - RTEXT "Shift::Vertical",IDC_STATIC,160,45,60,15,SS_CENTERIMAGE - LTEXT "Texture To Reset",IDC_STATIC,128,5,62,15,SS_CENTERIMAGE - CONTROL "Reset All Textures",IDC_ALLTEXTURES_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,195,5,75,15 - EDITTEXT IDC_RESET_NEW_TEXTURE_EDIT,5,25,118,14,ES_AUTOHSCROLL - LTEXT "New Texture Name",IDC_STATIC,128,25,62,15, - SS_CENTERIMAGE - CONTROL "Reset Texture Only",IDC_ONLYTEXTURE_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,195,25,75,15 -END - -IDD_PATHPLOTTER_DIALOG DIALOG DISCARDABLE 0, 0, 172, 113 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Path Plotter" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Enable",IDYES,5,92,50,14 - PUSHBUTTON "Cancel",IDCANCEL,115,92,50,14 - PUSHBUTTON "Disable",IDNO,60,92,50,14 - EDITTEXT IDC_POINTCOUNT_EDIT,5,5,80,14,ES_AUTOHSCROLL - EDITTEXT IDC_MULTIPLIER_EDIT,5,25,80,14,ES_AUTOHSCROLL - EDITTEXT IDC_GRAVITY_EDIT,5,45,80,14,ES_AUTOHSCROLL - LTEXT "Number Of Points",IDC_STATIC,90,5,60,15,SS_CENTERIMAGE - CONTROL "No Dynamic Update",IDC_NOUPDATE_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,65,80,10 - LTEXT "Multiplier",IDC_STATIC,90,25,60,15,SS_CENTERIMAGE - LTEXT "Gravity",IDC_STATIC,90,45,60,15,SS_CENTERIMAGE - CONTROL "Show Bounding Lines",IDC_SHOWEXTRA_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,79,85,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_STAIR_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 239 - TOPMARGIN, 7 - BOTTOMMARGIN, 111 - END - - IDD_POLYGON_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 264 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_DOOR_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 320 - TOPMARGIN, 7 - BOTTOMMARGIN, 112 - END - - IDD_INTERSECT_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 238 - TOPMARGIN, 7 - BOTTOMMARGIN, 51 - END - - IDD_INTERSECT_INFO_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 180 - TOPMARGIN, 7 - BOTTOMMARGIN, 25 - END - - IDD_BRUSHCHECKER_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 175 - TOPMARGIN, 7 - BOTTOMMARGIN, 31 - END - - IDD_AUTOCAULK_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 180 - TOPMARGIN, 7 - BOTTOMMARGIN, 45 - END - - IDD_AUTOCAULKSTART_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 230 - TOPMARGIN, 7 - BOTTOMMARGIN, 76 - END - - IDD_TEXTURE_RESET_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 100 - END - - IDD_PATHPLOTTER_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 165 - TOPMARGIN, 7 - BOTTOMMARGIN, 106 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_DOOR_DIALOG DLGINIT -BEGIN - IDC_MAINTEX_COMBO, 0x403, 25, 0 -0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, -0x6c61, 0x6f64, 0x726f, "\000" - IDC_MAINTEX_COMBO, 0x403, 33, 0 -0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, -0x6c61, 0x6f64, 0x726f, 0x6f5f, 0x7475, 0x6973, 0x6564, "\000" - IDC_MAINTEX_COMBO, 0x403, 36, 0 -0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, -0x6c61, 0x6f64, 0x726f, 0x6f5f, 0x7475, 0x6973, 0x6564, 0x6133, 0x0032, - - IDC_MAINTEX_COMBO, 0x403, 24, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x625f, 0x6572, 0x0064, - IDC_MAINTEX_COMBO, 0x403, 31, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x625f, 0x6572, 0x3264, 0x735f, 0x6968, 0x796e, "\000" - IDC_MAINTEX_COMBO, 0x403, 32, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x655f, 0x6c62, 0x6575, 0x5f32, 0x6873, 0x6e69, 0x0079, - IDC_MAINTEX_COMBO, 0x403, 33, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x695f, 0x6f5f, 0x6e72, 0x7461, 0x3565, 0x665f, 0x6e69, "\000" - IDC_MAINTEX_COMBO, 0x403, 21, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x6a5f, "\000" - IDC_MAINTEX_COMBO, 0x403, 22, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x6a5f, 0x0033, - IDC_MAINTEX_COMBO, 0x403, 22, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x6a5f, 0x0034, - IDC_MAINTEX_COMBO, 0x403, 23, 0 -0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, -0x6b5f, 0x6232, "\000" - IDC_TRIMTEX_COMBO, 0x403, 26, 0 -0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, -0x7472, 0x7231, 0x7375, 0x0074, - IDC_TRIMTEX_COMBO, 0x403, 27, 0 -0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, -0x7472, 0x7331, 0x6968, 0x796e, "\000" - IDC_TRIMTEX_COMBO, 0x403, 26, 0 -0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, -0x7472, 0x7232, 0x7375, 0x0074, - IDC_TRIMTEX_COMBO, 0x403, 22, 0 -0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x772f, 0x6c70, 0x7461, -0x5f31, 0x0031, - IDC_TRIMTEX_COMBO, 0x403, 22, 0 -0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x702f, 0x616c, 0x6574, -0x5f32, 0x0035, - 0 -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""resource.h""\r\n" - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "resource.h" +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,1,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "Comments", "by djbob :P and MarsMattel ~:]\0" + VALUE "CompanyName", "bobCo\0" + VALUE "FileDescription", "All your plugins are belong to us\0" + VALUE "FileVersion", "1, 1, 1, 0\0" + VALUE "InternalName", "bobToolz\0" + VALUE "LegalCopyright", "Copyright (C) y2k\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "bobToolz.DLL\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + +#endif // !_MAC + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Neutral (Sys. Default) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUSD) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 361, 118 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,305,100,50,14 + CTEXT "BobToolz - Q3radiant version by djbob &&&& Mars Mattel", + IDC_STATIC,5,5,350,14,SS_CENTERIMAGE + CTEXT "Latest Version Can Be Found At http://djbob.fortefide.com", + IDC_STATIC,5,20,350,15,SS_CENTERIMAGE + LTEXT "Random bobToolz comments:",IDC_STATIC,5,35,355,10 + CTEXT "Texture Alignments Are Irrelevant, You Will Be Caulked\n-QPSiren\nCaulk Me Baby One More Time\n-TTimo\nWe're Up The Creek Without A Penguin\n-Mars Mattel", + IDC_STATIC,5,45,355,50 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 354 + TOPMARGIN, 7 + BOTTOMMARGIN, 111 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Neutral (Sys. Default) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_STAIR_DIALOG DIALOG DISCARDABLE 0, 0, 246, 118 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Stair Designer" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,189,83,50,12 + PUSHBUTTON "Cancel",IDCANCEL,189,99,50,12 + EDITTEXT IDC_EDIT1,5,5,86,12,ES_AUTOHSCROLL + LTEXT "Stair Height",IDC_STATIC,95,5,42,15,SS_CENTERIMAGE + GROUPBOX "Direction",IDC_STATIC,7,26,85,64 + CONTROL "North",IDC_DIR_N_RADIO,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,14,38,33,10 + CONTROL "South",IDC_DIR_S_RADIO,"Button",BS_AUTORADIOBUTTON,14, + 50,35,10 + CONTROL "East",IDC_DIR_E_RADIO,"Button",BS_AUTORADIOBUTTON,14,62, + 30,10 + CONTROL "West",IDC_DIR_W_RADIO,"Button",BS_AUTORADIOBUTTON,14,74, + 33,10 + GROUPBOX "Style",IDC_STATIC,97,26,82,49 + CONTROL "Original",IDC_STYLE_ORIG_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,105,35,39,10 + CONTROL "Bob's Style",IDC_STYLE_BOB_RADIO,"Button", + BS_AUTORADIOBUTTON,105,47,51,10 + CONTROL "Corner",IDC_STYLE_CORNER_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED,105,59,51,10 + EDITTEXT IDC_RISER_EDIT,7,99,85,12,ES_AUTOHSCROLL + LTEXT "Riser Texture",IDC_STATIC,95,100,60,11,SS_CENTERIMAGE + CONTROL "Use Detail Brushes",IDC_DETAIL_CHK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,100,80,75,10 +END + +IDD_POLYGON_DIALOG DIALOG DISCARDABLE 0, 0, 271, 68 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Polygon Builder" +FONT 8, "Arial" +BEGIN + PUSHBUTTON "OK",IDOK,150,50,50,14 + PUSHBUTTON "Cancel",IDCANCEL,215,50,50,14 + EDITTEXT IDC_EDIT1,7,7,76,13,ES_AUTOHSCROLL + LTEXT "Number Of Sides",IDC_STATIC,85,7,60,13,SS_CENTERIMAGE + CONTROL "Inverse Polygon",IDC_INVERSE_CHK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,149,21,75,10 + CONTROL "Use Border",IDC_BORDER_CHK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,149,7,66,10 + EDITTEXT IDC_BORDER_EDIT,7,28,76,13,ES_AUTOHSCROLL + LTEXT "Border Size",IDC_STATIC,86,28,60,13,SS_CENTERIMAGE + CONTROL "Align Top Edge",IDC_ALIGN_CHK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,149,35,75,10 +END + +IDD_DOOR_DIALOG DIALOG DISCARDABLE 0, 0, 327, 119 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Door Builder" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,270,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,270,24,50,14 + EDITTEXT IDC_FBTEXTURE_EDIT,7,7,125,14,ES_AUTOHSCROLL + LTEXT "Door Front/Back Texture",IDC_STATIC,137,7,86,14, + SS_CENTERIMAGE + EDITTEXT IDC_TRIMTEXTURE_EDIT,7,26,125,14,ES_AUTOHSCROLL + LTEXT "Door Trim Texture",IDC_STATIC,137,26,86,14, + SS_CENTERIMAGE + CONTROL "Scale Main Texture Horizontally",IDC_TEXSCALE1_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,46,115,10 + CONTROL "Scale Main Texture Vertically",IDC_TEXSCALE2_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,60,107,10 + CONTROL "Scale Trim Texture Horizontally",IDC_TEXSCALE3_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,46,113,10 + CONTROL "Scale Trim Texture Vertically",IDC_TEXSCALE4_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,60,105,10 + COMBOBOX IDC_MAINTEX_COMBO,7,76,126,30,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_TRIMTEX_COMBO,7,99,126,30,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Set As Main Texture",IDC_SET_MAINTEX_BTN,139,76,82,14 + PUSHBUTTON "Set As Trim Texture",IDC_SET_TRIMTEX_BTN,139,98,82,14 + GROUPBOX "Orientation",IDC_DIR_GROUP,225,72,95,40 + CONTROL "North - South",IDC_DIR_NS_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,230,82,85,10 + CONTROL "East - West",IDC_DIR_EW_RADIO,"Button", + BS_AUTORADIOBUTTON,230,97,85,10 +END + +IDD_INTERSECT_DIALOG DIALOG DISCARDABLE 0, 0, 245, 58 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Intersecting Brush Finder" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,130,40,50,14 + PUSHBUTTON "Cancel",IDCANCEL,185,40,50,14 + CONTROL "Include Detail Brushes",IDC_DETAIL_INCLUDE_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,130,10,111,10 + GROUPBOX "Brush Options",IDC_STATIC,10,5,111,45 + CONTROL "Use Whole Map",IDC_WHOLEMAP_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,15,15,95,10 + CONTROL "Use Selected Brushes",IDC_SELECTED_RADIO,"Button", + BS_AUTORADIOBUTTON,15,30,95,10 + CONTROL "Only Select Duplicate Brushes",IDC_DUPLICATEONLY_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,25,113,10 +END + +IDD_INTERSECT_INFO_DIALOG DIALOG DISCARDABLE 0, 0, 187, 33 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, + 5,15,175,10 + CTEXT "Brush Loading",IDC_STATIC,5,5,175,10,SS_CENTERIMAGE +END + +IDD_BRUSHCHECKER_DIALOG DIALOG DISCARDABLE 0, 0, 182, 38 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, + 5,21,172,10 + CTEXT "Checking Brushes",IDC_STATIC,5,5,170,15,SS_CENTERIMAGE +END + +IDD_AUTOCAULK_DIALOG DIALOG DISCARDABLE 0, 0, 187, 52 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH, + 5,15,175,10 + CTEXT "Loading Portal Data",IDC_STATIC,5,5,175,10, + SS_CENTERIMAGE + CONTROL "Progress1",IDC_PROGRESS2,"msctls_progress32",PBS_SMOOTH, + 5,35,175,10 + CTEXT "Auto Caulking",IDC_STATIC,5,25,175,10,SS_CENTERIMAGE +END + +IDD_AUTOCAULKSTART_DIALOG DIALOG DISCARDABLE 0, 0, 237, 83 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Auto Caulk" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,125,10,50,14 + PUSHBUTTON "Cancel",IDCANCEL,180,10,50,14 + CONTROL "Destroy Invisible Brushes",IDC_KILLBRUSHES_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,125,50,95,10 + LTEXT "",IDC_WARNING1_STATIC,5,65,223,11,NOT WS_GROUP + GROUPBOX "Static",IDC_STATIC,5,5,115,57 + CONTROL "Autocaulk",IDC_AC_NORMAL_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,10,15,48,10 + CONTROL "Build Mini Prt",IDC_AC_BUILD_MINI_PRT_RADIO,"Button", + BS_AUTORADIOBUTTON,10,30,56,10 + CONTROL "Autocaulk+ (Detail Brushes)",IDC_AC_SUPER_RADIO,"Button", + BS_AUTORADIOBUTTON,10,45,106,10 +END + +IDD_TEXTURE_RESET_DIALOG DIALOG DISCARDABLE 0, 0, 272, 107 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Texture Reset" +FONT 8, "Arial" +BEGIN + DEFPUSHBUTTON "OK",IDOK,160,85,50,14 + PUSHBUTTON "Cancel",IDCANCEL,215,85,50,14 + EDITTEXT IDC_RESET_TEXTURE_EDIT,5,5,118,14,ES_AUTOHSCROLL + EDITTEXT IDC_SCL_VERT_EDIT,85,45,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_SCL_HOR_EDIT,85,65,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_ROTATION_EDIT,85,85,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_SHFT_VER_EDIT,225,45,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_SHFT_HOR_EDIT,225,65,40,14,ES_AUTOHSCROLL + RTEXT "Scale::Vertical",IDC_STATIC,5,45,75,15,SS_CENTERIMAGE + RTEXT "Scale::Horizontal",IDC_STATIC,5,65,75,15,SS_CENTERIMAGE + RTEXT "Rotation",IDC_STATIC,5,85,75,15,SS_CENTERIMAGE + RTEXT "Shift::Horizontal",IDC_STATIC,160,65,60,15, + SS_CENTERIMAGE + RTEXT "Shift::Vertical",IDC_STATIC,160,45,60,15,SS_CENTERIMAGE + LTEXT "Texture To Reset",IDC_STATIC,128,5,62,15,SS_CENTERIMAGE + CONTROL "Reset All Textures",IDC_ALLTEXTURES_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,195,5,75,15 + EDITTEXT IDC_RESET_NEW_TEXTURE_EDIT,5,25,118,14,ES_AUTOHSCROLL + LTEXT "New Texture Name",IDC_STATIC,128,25,62,15, + SS_CENTERIMAGE + CONTROL "Reset Texture Only",IDC_ONLYTEXTURE_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,195,25,75,15 +END + +IDD_PATHPLOTTER_DIALOG DIALOG DISCARDABLE 0, 0, 172, 113 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Path Plotter" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Enable",IDYES,5,92,50,14 + PUSHBUTTON "Cancel",IDCANCEL,115,92,50,14 + PUSHBUTTON "Disable",IDNO,60,92,50,14 + EDITTEXT IDC_POINTCOUNT_EDIT,5,5,80,14,ES_AUTOHSCROLL + EDITTEXT IDC_MULTIPLIER_EDIT,5,25,80,14,ES_AUTOHSCROLL + EDITTEXT IDC_GRAVITY_EDIT,5,45,80,14,ES_AUTOHSCROLL + LTEXT "Number Of Points",IDC_STATIC,90,5,60,15,SS_CENTERIMAGE + CONTROL "No Dynamic Update",IDC_NOUPDATE_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,65,80,10 + LTEXT "Multiplier",IDC_STATIC,90,25,60,15,SS_CENTERIMAGE + LTEXT "Gravity",IDC_STATIC,90,45,60,15,SS_CENTERIMAGE + CONTROL "Show Bounding Lines",IDC_SHOWEXTRA_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,79,85,10 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_STAIR_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 239 + TOPMARGIN, 7 + BOTTOMMARGIN, 111 + END + + IDD_POLYGON_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 264 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_DOOR_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 320 + TOPMARGIN, 7 + BOTTOMMARGIN, 112 + END + + IDD_INTERSECT_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 238 + TOPMARGIN, 7 + BOTTOMMARGIN, 51 + END + + IDD_INTERSECT_INFO_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 25 + END + + IDD_BRUSHCHECKER_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 175 + TOPMARGIN, 7 + BOTTOMMARGIN, 31 + END + + IDD_AUTOCAULK_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 45 + END + + IDD_AUTOCAULKSTART_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 230 + TOPMARGIN, 7 + BOTTOMMARGIN, 76 + END + + IDD_TEXTURE_RESET_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 100 + END + + IDD_PATHPLOTTER_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 165 + TOPMARGIN, 7 + BOTTOMMARGIN, 106 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog Info +// + +IDD_DOOR_DIALOG DLGINIT +BEGIN + IDC_MAINTEX_COMBO, 0x403, 25, 0 +0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, +0x6c61, 0x6f64, 0x726f, "\000" + IDC_MAINTEX_COMBO, 0x403, 33, 0 +0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, +0x6c61, 0x6f64, 0x726f, 0x6f5f, 0x7475, 0x6973, 0x6564, "\000" + IDC_MAINTEX_COMBO, 0x403, 36, 0 +0x6162, 0x6573, 0x645f, 0x6f6f, 0x2f72, 0x6873, 0x6e69, 0x6d79, 0x7465, +0x6c61, 0x6f64, 0x726f, 0x6f5f, 0x7475, 0x6973, 0x6564, 0x6133, 0x0032, + + IDC_MAINTEX_COMBO, 0x403, 24, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x625f, 0x6572, 0x0064, + IDC_MAINTEX_COMBO, 0x403, 31, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x625f, 0x6572, 0x3264, 0x735f, 0x6968, 0x796e, "\000" + IDC_MAINTEX_COMBO, 0x403, 32, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x655f, 0x6c62, 0x6575, 0x5f32, 0x6873, 0x6e69, 0x0079, + IDC_MAINTEX_COMBO, 0x403, 33, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x695f, 0x6f5f, 0x6e72, 0x7461, 0x3565, 0x665f, 0x6e69, "\000" + IDC_MAINTEX_COMBO, 0x403, 21, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x6a5f, "\000" + IDC_MAINTEX_COMBO, 0x403, 22, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x6a5f, 0x0033, + IDC_MAINTEX_COMBO, 0x403, 22, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x6a5f, 0x0034, + IDC_MAINTEX_COMBO, 0x403, 23, 0 +0x6f67, 0x6874, 0x6369, 0x645f, 0x6f6f, 0x2f72, 0x6f64, 0x726f, 0x3230, +0x6b5f, 0x6232, "\000" + IDC_TRIMTEX_COMBO, 0x403, 26, 0 +0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, +0x7472, 0x7231, 0x7375, 0x0074, + IDC_TRIMTEX_COMBO, 0x403, 27, 0 +0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, +0x7472, 0x7331, 0x6968, 0x796e, "\000" + IDC_TRIMTEX_COMBO, 0x403, 26, 0 +0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x732f, 0x7075, 0x6f70, +0x7472, 0x7232, 0x7375, 0x0074, + IDC_TRIMTEX_COMBO, 0x403, 22, 0 +0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x772f, 0x6c70, 0x7461, +0x5f31, 0x0031, + IDC_TRIMTEX_COMBO, 0x403, 22, 0 +0x6162, 0x6573, 0x735f, 0x7075, 0x6f70, 0x7472, 0x702f, 0x616c, 0x6574, +0x5f32, 0x0035, + 0 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""resource.h""\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/contrib/bobtoolz/bobToolz_gtk.vcproj b/contrib/bobtoolz/bobToolz_gtk.vcproj index 0cb32ece..bcdf2d7a 100644 --- a/contrib/bobtoolz/bobToolz_gtk.vcproj +++ b/contrib/bobtoolz/bobToolz_gtk.vcproj @@ -1,328 +1,177 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/bobtoolz/bobtoolz-gtk.rc b/contrib/bobtoolz/bobtoolz-gtk.rc index 1d401e10..d1ff0d2e 100644 --- a/contrib/bobtoolz/bobtoolz-gtk.rc +++ b/contrib/bobtoolz/bobtoolz-gtk.rc @@ -1,109 +1,109 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource-gtk.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource-gtk.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,1,0 - PRODUCTVERSION 2,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "Comments", "by djbob :P and MarsMattel ~:)\0" - VALUE "CompanyName", "bobCo\0" - VALUE "FileDescription", "All your plugins are belong to us\0" - VALUE "FileVersion", "1, 1, 1, 0\0" - VALUE "InternalName", "bobToolz GTK\0" - VALUE "LegalCopyright", "Copyright © 2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "bobToolz.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "bobCo bobToolz\0" - VALUE "ProductVersion", "2, 0, 0, 0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource-gtk.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource-gtk.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,1,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "Comments", "by djbob :P and MarsMattel ~:)\0" + VALUE "CompanyName", "bobCo\0" + VALUE "FileDescription", "All your plugins are belong to us\0" + VALUE "FileVersion", "1, 1, 1, 0\0" + VALUE "InternalName", "bobToolz GTK\0" + VALUE "LegalCopyright", "Copyright © 2001\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "bobToolz.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "bobCo bobToolz\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + +#endif // !_MAC + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/contrib/bobtoolz/bobtoolz.vcproj b/contrib/bobtoolz/bobtoolz.vcproj deleted file mode 100644 index eec566c3..00000000 --- a/contrib/bobtoolz/bobtoolz.vcproj +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/bobtoolz/bsploader.cpp b/contrib/bobtoolz/bsploader.cpp index 287c5fff..2fc05afd 100644 --- a/contrib/bobtoolz/bsploader.cpp +++ b/contrib/bobtoolz/bsploader.cpp @@ -1,6 +1,7 @@ +#include "StdAfx.h" +#include "./dialogs/dialogs-gtk.h" #include "bsploader.h" -#include "dialogs/dialogs-gtk.h" -#include "cmdlib.h" +#include "../../libs/cmdlib.h" int numnodes; int numplanes; @@ -51,7 +52,7 @@ int FileLength (FILE *f) LoadFile ============== */ -bool LoadFile( const char *filename, byte **bufferptr) +qboolean LoadFile( const char *filename, byte **bufferptr) { FILE *f; int length; @@ -71,21 +72,15 @@ bool LoadFile( const char *filename, byte **bufferptr) return true; } -int LittleLong (int l) +/*int LittleLong (int l) { -#if defined(__BIG_ENDIAN__) - std::reverse(reinterpret_cast(&l), reinterpret_cast(&l) + sizeof(int)); -#endif return l; } float LittleFloat (float l) { -#if defined(__BIG_ENDIAN__) - std::reverse(reinterpret_cast(&l), reinterpret_cast(&l) + sizeof(float)); -#endif return l; -} +}*/ /* ============= @@ -199,7 +194,7 @@ int CopyLump( dheader_t *header, int lump, void **dest, int size ) { LoadBSPFile ============= */ -bool LoadBSPFile( const char *filename ) { +qboolean LoadBSPFile( const char *filename ) { dheader_t *header; // load the file header @@ -210,12 +205,12 @@ bool LoadBSPFile( const char *filename ) { SwapBlock( (int *)header, sizeof(*header) ); if ( header->ident != BSP_IDENT ) { - DoMessageBox( "Cant find a valid IBSP file", "Error", eMB_OK); + DoMessageBox( "Cant find a valid IBSP file", "Error", MB_OK); return false; } if ( (header->version != Q3_BSP_VERSION) && (header->version != WOLF_BSP_VERSION) ) { - DoMessageBox( "File is incorrect version", "Error", eMB_OK); + DoMessageBox( "File is incorrect version", "Error", MB_OK); return false; } diff --git a/contrib/bobtoolz/bsploader.h b/contrib/bobtoolz/bsploader.h index 3cea233b..3b98fc27 100644 --- a/contrib/bobtoolz/bsploader.h +++ b/contrib/bobtoolz/bsploader.h @@ -1,6 +1,3 @@ - -#include "mathlib.h" - #define LUMP_ENTITIES 0 #define LUMP_SHADERS 1 #define LUMP_PLANES 2 @@ -133,5 +130,5 @@ extern dbrush_t *dbrushes; extern dbrushside_t *dbrushsides; extern int *dleafbrushes; -bool LoadBSPFile( const char *filename ); +qboolean LoadBSPFile( const char *filename ); void FreeBSPData(); diff --git a/contrib/bobtoolz/cportals.cpp b/contrib/bobtoolz/cportals.cpp index 5048eef0..d05591c3 100644 --- a/contrib/bobtoolz/cportals.cpp +++ b/contrib/bobtoolz/cportals.cpp @@ -17,11 +17,8 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "StdAfx.h" #include "CPortals.h" - -#include -#include - #include "misc.h" #define LINE_BUF 1000 @@ -49,10 +46,10 @@ void ClampFloat(float* p) return; if(fabs(*p - ceil(*p)) < MAX_ROUND_ERROR) - *p = static_cast(ceil(*p)); + *p = ceilf(*p); if(fabs(*p - floor(*p)) < MAX_ROUND_ERROR) - *p = static_cast(floor(*p)); + *p = floorf(*p); } bool CBspPortal::Build(char *def, unsigned int pointCnt, bool bInverse) @@ -63,7 +60,7 @@ bool CBspPortal::Build(char *def, unsigned int pointCnt, bool bInverse) point_count = pointCnt; if(point_count < 3) - return false; + return FALSE; point = new CBspPoint[point_count]; @@ -72,7 +69,7 @@ bool CBspPortal::Build(char *def, unsigned int pointCnt, bool bInverse) for(; *c != 0 && *c != '('; c++); if(*c == 0) - return false; + return FALSE; c++; @@ -89,7 +86,7 @@ bool CBspPortal::Build(char *def, unsigned int pointCnt, bool bInverse) ClampFloat(&point[x].p[2]); } - return true; + return TRUE; } CPortals::CPortals() @@ -118,7 +115,7 @@ void CPortals::Load() Purge(); - globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n"; + Sys_Printf(MSG_PREFIX "Loading portal file %s.\n", fn); FILE *in; @@ -126,7 +123,7 @@ void CPortals::Load() if(in == NULL) { - globalOutputStream() << " ERROR - could not open file.\n"; + Sys_Printf(" ERROR - could not open file.\n"); return; } @@ -135,7 +132,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -144,7 +141,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File header indicates wrong file type (should be \"PRT1\").\n"; + Sys_Printf(" ERROR - File header indicates wrong file type (should be \"PRT1\").\n"); return; } @@ -153,7 +150,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -166,7 +163,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - Extreme number of nodes, aborting.\n"; + Sys_Printf(" ERROR - Extreme number of nodes, aborting.\n"); return; } @@ -177,7 +174,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -191,7 +188,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -210,7 +207,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -230,7 +227,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -262,7 +259,7 @@ void CPortals::Load() Purge(); - globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; + Sys_Printf(" ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count); return; } @@ -270,24 +267,24 @@ void CPortals::Load() unsigned int pCount, node1, node2; sscanf(buf, "%u %u %u", &pCount, &node1, &node2); - if(!node[node1].AddPortal(buf, pCount, false)) + if(!node[node1].AddPortal(buf, pCount, FALSE)) { fclose(in); Purge(); - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + Sys_Printf(" ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count); return; } - if(!node[node2].AddPortal(buf, pCount, true)) + if(!node[node2].AddPortal(buf, pCount, TRUE)) { fclose(in); Purge(); - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + Sys_Printf(" ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count); return; } @@ -301,7 +298,7 @@ void CPortals::Load() Purge(); - globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; + Sys_Printf(" ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count); return; } @@ -309,13 +306,13 @@ void CPortals::Load() unsigned int pCount, node1; sscanf(buf, "%u %u", &pCount, &node1); - if(!node[node1].AddPortal(buf, pCount, false)) + if(!node[node1].AddPortal(buf, pCount, FALSE)) { fclose(in); Purge(); - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + Sys_Printf(" ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count); return; } diff --git a/contrib/bobtoolz/ctfresource_gtk.rc b/contrib/bobtoolz/ctfresource_gtk.rc index d3dc2f77..c3e9d5d8 100644 --- a/contrib/bobtoolz/ctfresource_gtk.rc +++ b/contrib/bobtoolz/ctfresource_gtk.rc @@ -1,109 +1,109 @@ -//Microsoft Developer Studio generated resource script. -// -#include "ctfresource_gtk.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "ctfresource_gtk.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,0 - PRODUCTVERSION 1,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "bobCo\0" - VALUE "FileDescription", "All your plugins are belong to us\0" - VALUE "FileVersion", "1, 0, 0, 0\0" - VALUE "InternalName", "ctftoolz\0" - VALUE "LegalCopyright", "Copyright © 2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "ctftoolz.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "bobCo ctftoolz\0" - VALUE "ProductVersion", "1, 0, 0, 0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "ctfresource_gtk.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "ctfresource_gtk.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "bobCo\0" + VALUE "FileDescription", "All your plugins are belong to us\0" + VALUE "FileVersion", "1, 0, 0, 0\0" + VALUE "InternalName", "ctftoolz\0" + VALUE "LegalCopyright", "Copyright © 2001\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "ctftoolz.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "bobCo ctftoolz\0" + VALUE "ProductVersion", "1, 0, 0, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + +#endif // !_MAC + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 15d9db67..a51789c4 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -17,18 +17,12 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "../StdAfx.h" #include "dialogs-gtk.h" #include "../funchandlers.h" - -#include "str.h" -#include -#include -#include "gtkutil/pointer.h" - #include "../lists.h" #include "../misc.h" - /*-------------------------------- Callback Functions ---------------------------------*/ @@ -83,15 +77,14 @@ void Update_TextureReseter() static void dialog_button_callback (GtkWidget *widget, gpointer data) { GtkWidget *parent; - int *loop; - EMessageBoxReturn *ret; + int *loop, *ret; parent = gtk_widget_get_toplevel (widget); loop = (int*)g_object_get_data (G_OBJECT (parent), "loop"); - ret = (EMessageBoxReturn*)g_object_get_data (G_OBJECT (parent), "ret"); + ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = (EMessageBoxReturn)gpointer_to_int(data); + *ret = (int)data; } static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) @@ -128,7 +121,7 @@ bool ValidateTextFloat(const char* pData, char* error_title, float* value) if((testNum == 0.0f) && strcmp(pData, "0")) { - DoMessageBox("Please Enter A Floating Point Number", error_title, eMB_OK); + DoMessageBox("Please Enter A Floating Point Number", error_title, MB_OK); return FALSE; } else @@ -138,7 +131,7 @@ bool ValidateTextFloat(const char* pData, char* error_title, float* value) } } - DoMessageBox("Please Enter A Floating Point Number", error_title, eMB_OK); + DoMessageBox("Please Enter A Floating Point Number", error_title, MB_OK); return FALSE; } @@ -153,7 +146,7 @@ bool ValidateTextFloatRange(const char* pData, float min, float max, char* error if((testNum < min) || (testNum > max)) { - DoMessageBox(error_buffer, error_title, eMB_OK); + DoMessageBox(error_buffer, error_title, MB_OK); return FALSE; } else @@ -163,7 +156,7 @@ bool ValidateTextFloatRange(const char* pData, float min, float max, char* error } } - DoMessageBox(error_buffer, error_title, eMB_OK); + DoMessageBox(error_buffer, error_title, MB_OK); return FALSE; } @@ -178,7 +171,7 @@ bool ValidateTextIntRange(const char* pData, int min, int max, char* error_title if((testNum < min) || (testNum > max)) { - DoMessageBox(error_buffer, error_title, eMB_OK); + DoMessageBox(error_buffer, error_title, MB_OK); return FALSE; } else @@ -188,7 +181,7 @@ bool ValidateTextIntRange(const char* pData, int min, int max, char* error_title } } - DoMessageBox(error_buffer, error_title, eMB_OK); + DoMessageBox(error_buffer, error_title, MB_OK); return FALSE; } @@ -200,7 +193,7 @@ bool ValidateTextInt(const char* pData, char* error_title, int* value) if((testNum == 0) && strcmp(pData, "0")) { - DoMessageBox("Please Enter An Integer", error_title, eMB_OK); + DoMessageBox("Please Enter An Integer", error_title, MB_OK); return FALSE; } else @@ -210,7 +203,7 @@ bool ValidateTextInt(const char* pData, char* error_title, int* value) } } - DoMessageBox("Please Enter An Integer", error_title, eMB_OK); + DoMessageBox("Please Enter An Integer", error_title, MB_OK); return FALSE; } @@ -225,11 +218,10 @@ bool ValidateTextInt(const char* pData, char* error_title, int* value) */ -EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMessageBoxType type) +int DoMessageBox (const char* lpText, const char* lpCaption, guint32 uType) { GtkWidget *window, *w, *vbox, *hbox; - EMessageBoxReturn ret; - int loop = 1; + int mode = (uType & MB_TYPEMASK), ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", @@ -259,23 +251,23 @@ EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMess gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); gtk_widget_show (hbox); - if (type == eMB_OK) + if (mode == MB_OK) { w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); gtk_widget_show (w); - ret = eIDOK; + ret = IDOK; } - else if (type == eMB_OKCANCEL) + else if (mode == MB_OKCANCEL) { w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); gtk_widget_show (w); @@ -283,16 +275,16 @@ EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMess w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; } - else if (type == eMB_YESNOCANCEL) + else if (mode == MB_YESNOCANCEL) { w = gtk_button_new_with_label ("Yes"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDYES)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); gtk_widget_show (w); @@ -300,22 +292,22 @@ EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMess w = gtk_button_new_with_label ("No"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDNO)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); gtk_widget_show (w); w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; } else /* if (mode == MB_YESNO) */ { w = gtk_button_new_with_label ("Yes"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDYES)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); gtk_widget_show (w); @@ -323,9 +315,9 @@ EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMess w = gtk_button_new_with_label ("No"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDNO)); + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); gtk_widget_show (w); - ret = eIDNO; + ret = IDNO; } gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); @@ -341,13 +333,12 @@ EMessageBoxReturn DoMessageBox (const char* lpText, const char* lpCaption, EMess return ret; } -EMessageBoxReturn DoIntersectBox (IntersectRS* rs) +int DoIntersectBox (IntersectRS* rs) { GtkWidget *window, *w, *vbox, *hbox; GtkWidget *radio1, *radio2; GtkWidget *check1, *check2; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -398,7 +389,7 @@ EMessageBoxReturn DoIntersectBox (IntersectRS* rs) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); @@ -406,9 +397,9 @@ EMessageBoxReturn DoIntersectBox (IntersectRS* rs) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // ---- /hbox ---- @@ -435,15 +426,14 @@ EMessageBoxReturn DoIntersectBox (IntersectRS* rs) return ret; } -EMessageBoxReturn DoPolygonBox (PolygonRS* rs) +int DoPolygonBox (PolygonRS* rs) { GtkWidget *window, *w, *vbox, *hbox, *vbox2, *hbox2; GtkWidget *check1, *check2, *check3; GtkWidget *text1, *text2; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -551,7 +541,7 @@ EMessageBoxReturn DoPolygonBox (PolygonRS* rs) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); @@ -559,9 +549,9 @@ EMessageBoxReturn DoPolygonBox (PolygonRS* rs) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // ---- /hbox ---- @@ -580,7 +570,7 @@ EMessageBoxReturn DoPolygonBox (PolygonRS* rs) dialogError = FALSE; - if(ret == eIDOK) + if(ret == IDOK) { rs->bUseBorder = gtk_toggle_button_get_active((GtkToggleButton*)check1) ? true : false; rs->bInverse = gtk_toggle_button_get_active((GtkToggleButton*)check2) ? true : false; @@ -606,7 +596,7 @@ EMessageBoxReturn DoPolygonBox (PolygonRS* rs) // mars // for stair builder stuck as close as i could to the MFC version // obviously feel free to change it at will :) -EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs) +int DoBuildStairsBox(BuildStairsRS* rs) { // i made widgets for just about everything ... i think that's what i need to do dunno tho GtkWidget *window, *w, *vbox, *hbox; @@ -615,8 +605,9 @@ EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs) GtkWidget *radioOldStyle, *radioBobStyle, *radioCornerStyle; GtkWidget *checkUseDetail; GSList *radioDirection, *radioStyle; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop; + + loop = 1; char *text = "Please set a value in the boxes below and press 'OK' to build the stairs"; @@ -794,17 +785,17 @@ EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs) w = gtk_button_new_with_label( "OK" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); - ret = eIDCANCEL; + ret = IDCANCEL; // +djbob: need our "little" modal loop mars :P gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); @@ -820,7 +811,7 @@ EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs) dialogError = FALSE; - if(ret == eIDOK) + if(ret == IDOK) { rs->bUseDetail = gtk_toggle_button_get_active((GtkToggleButton*)checkUseDetail) ? true : false; @@ -857,7 +848,7 @@ EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs) // there we go, all done ... on my end at least, not bad for a night's work } -EMessageBoxReturn DoDoorsBox(DoorRS* rs) +int DoDoorsBox(DoorRS* rs) { GtkWidget *window, *hbox, *vbox, *w; GtkWidget *textFrontBackTex, *textTrimTex; @@ -867,8 +858,9 @@ EMessageBoxReturn DoDoorsBox(DoorRS* rs) GtkWidget *radioNS, *radioEW; GSList *radioOrientation; TwinWidget tw1, tw2; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop; + + loop = 1; window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); @@ -1033,16 +1025,16 @@ EMessageBoxReturn DoDoorsBox(DoorRS* rs) w = gtk_button_new_with_label( "OK" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); - ret = eIDCANCEL; + ret = IDCANCEL; // ----------------- // @@ -1074,15 +1066,14 @@ EMessageBoxReturn DoDoorsBox(DoorRS* rs) //-djbob } -EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs) +int DoPathPlotterBox(PathPlotterRS* rs) { GtkWidget *window, *w, *vbox, *hbox; GtkWidget *text1, *text2, *text3; GtkWidget *check1, *check2; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -1193,7 +1184,7 @@ EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs) w = gtk_button_new_with_label( "Enable" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_show( w ); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); @@ -1201,15 +1192,15 @@ EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs) w = gtk_button_new_with_label( "Disable" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Cancel" ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); + gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); - ret = eIDCANCEL; + ret = IDCANCEL; // ----------------- // @@ -1226,7 +1217,7 @@ EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs) dialogError = FALSE; - if(ret == eIDYES) + if(ret == IDYES) { if(!ValidateTextIntRange(gtk_entry_get_text(GTK_ENTRY(text1)), 1, 200, "Number Of Points", &rs->nPoints)) dialogError = TRUE; @@ -1248,11 +1239,10 @@ EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs) return ret; } -EMessageBoxReturn DoCTFColourChangeBox () +int DoCTFColourChangeBox () { GtkWidget *window, *w, *vbox, *hbox; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -1283,7 +1273,7 @@ EMessageBoxReturn DoCTFColourChangeBox () w = gtk_button_new_with_label ("Red->Blue"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); @@ -1291,14 +1281,14 @@ EMessageBoxReturn DoCTFColourChangeBox () w = gtk_button_new_with_label ("Blue->Red"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDYES)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); gtk_widget_show (w); w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // ---- /hbox ---- @@ -1317,15 +1307,14 @@ EMessageBoxReturn DoCTFColourChangeBox () return ret; } -EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) +int DoResetTextureBox (ResetTextureRS* rs) { Str texSelected; GtkWidget *window, *w, *vbox, *hbox, *frame, *table; - EMessageBoxReturn ret; - int loop = 1; - + int ret, loop = 1; + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); @@ -1351,8 +1340,10 @@ EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) // ---- hbox ---- - texSelected = "Currently Selected Texture: "; - texSelected += GetCurrentTexture(); + texSelected = "Currently Selected Face: "; + if(g_SelectedFaceTable.m_pfnGetSelectedFaceCount() == 1) { + texSelected += GetCurrentTexture(); + } w = gtk_label_new (texSelected); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 2); @@ -1563,7 +1554,7 @@ EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) w = gtk_button_new_with_label ("Use Selected Brushes"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); @@ -1571,14 +1562,14 @@ EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) w = gtk_button_new_with_label ("Use All Brushes"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDYES)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); gtk_widget_show (w); w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // ---- /hbox ---- @@ -1599,7 +1590,7 @@ EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) dialogError = FALSE; - if(ret != eIDCANCEL) + if(ret != IDCANCEL) { rs->bResetRotation = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation )); if(rs->bResetRotation) @@ -1641,7 +1632,7 @@ EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs) return ret; } -EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs) +int DoTrainThingBox (TrainThingRS* rs) { Str texSelected; @@ -1652,8 +1643,7 @@ EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs) GtkWidget *heightStart, *heightEnd; GtkWidget *numPoints; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -1843,7 +1833,7 @@ EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); gtk_widget_grab_default (w); @@ -1851,9 +1841,9 @@ EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // ---- /hbox ---- @@ -1872,7 +1862,7 @@ EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs) dialogError = FALSE; - if(ret != eIDCANCEL) + if(ret != IDCANCEL) { if(!ValidateTextFloat(gtk_entry_get_text(GTK_ENTRY(radiusX)), "Radius (X)", &rs->fRadiusX)) dialogError = TRUE; diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.h b/contrib/bobtoolz/dialogs/dialogs-gtk.h index bcafdae8..987f7216 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.h +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.h @@ -17,18 +17,13 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_DIALOGS_GTK_H) -#define INCLUDED_DIALOGS_GTK_H - -#include "qerplugin.h" - struct BuildStairsRS{ char mainTexture[256]; char riserTexture[256]; int direction; int style; int stairHeight; - bool bUseDetail; + qboolean bUseDetail; }; struct ResetTextureRS { @@ -55,14 +50,14 @@ struct TrainThingRS { struct IntersectRS{ int nBrushOptions; - bool bUseDetail; - bool bDuplicateOnly; + qboolean bUseDetail; + qboolean bDuplicateOnly; }; struct PolygonRS{ - bool bUseBorder; - bool bInverse; - bool bAlignTop; + qboolean bUseBorder; + qboolean bInverse; + qboolean bAlignTop; int nSides; int nBorderWidth; }; @@ -70,10 +65,10 @@ struct PolygonRS{ struct DoorRS{ char mainTexture[256]; char trimTexture[256]; - bool bScaleMainH; - bool bScaleMainV; - bool bScaleTrimH; - bool bScaleTrimV; + qboolean bScaleMainH; + qboolean bScaleMainV; + qboolean bScaleTrimH; + qboolean bScaleTrimV; int nOrientation; }; @@ -81,27 +76,23 @@ struct PathPlotterRS{ int nPoints; float fMultiplier; float fGravity; - bool bNoUpdate; - bool bShowExtra; + qboolean bNoUpdate; + qboolean bShowExtra; }; -typedef struct _GtkWidget GtkWidget; - struct TwinWidget{ GtkWidget* one; GtkWidget* two; }; -EMessageBoxReturn DoMessageBox(const char* lpText, const char* lpCaption, EMessageBoxType type); -EMessageBoxReturn DoIntersectBox(IntersectRS* rs); -EMessageBoxReturn DoPolygonBox(PolygonRS* rs); -EMessageBoxReturn DoResetTextureBox (ResetTextureRS* rs); -EMessageBoxReturn DoBuildStairsBox(BuildStairsRS* rs); -EMessageBoxReturn DoDoorsBox(DoorRS* rs); -EMessageBoxReturn DoPathPlotterBox(PathPlotterRS* rs); -EMessageBoxReturn DoCTFColourChangeBox(); -EMessageBoxReturn DoTrainThingBox (TrainThingRS* rs); +int DoMessageBox(const char* lpText, const char* lpCaption, guint32 uType); +int DoIntersectBox(IntersectRS* rs); +int DoPolygonBox(PolygonRS* rs); +int DoResetTextureBox (ResetTextureRS* rs); +int DoBuildStairsBox(BuildStairsRS* rs); +int DoDoorsBox(DoorRS* rs); +int DoPathPlotterBox(PathPlotterRS* rs); +int DoCTFColourChangeBox(); +int DoTrainThingBox (TrainThingRS* rs); //GtkWidget* GetProgressWindow(char* title, GtkProgressBar* feedback); - -#endif diff --git a/contrib/bobtoolz/funchandlers-GTK.cpp b/contrib/bobtoolz/funchandlers-GTK.cpp index 5d1f16a9..6f7ad443 100644 --- a/contrib/bobtoolz/funchandlers-GTK.cpp +++ b/contrib/bobtoolz/funchandlers-GTK.cpp @@ -17,53 +17,32 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "funchandlers.h" +#include "StdAfx.h" -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4786) #endif #include "dialogs/dialogs-gtk.h" -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" #include "DEntity.h" #include "DShape.h" -#include "DBobView.h" -#include "DVisDrawer.h" -#include "DTrainDrawer.h" +#include "DPatch.h" #include "misc.h" -#include "ScriptParser.h" -#include "DTreePlanter.h" - #include "shapes.h" #include "lists.h" +#include "funchandlers.h" #include "visfind.h" -#include "iundo.h" - -#include -#include -#include -#include - -#include "scenelib.h" - // for autocaulk -std::list exclusionList; // whole brush exclusion -std::list exclusionList_Face; // single face exclusion +list exclusionList; // whole brush exclusion +list exclusionList_Face; // single face exclusion -bool el1Loaded = false; -bool el2Loaded = false; -bool clrLst1Loaded = false; -bool clrLst2Loaded = false; +bool el1Loaded = FALSE; +bool el2Loaded = FALSE; +bool clrLst1Loaded = FALSE; +bool clrLst2Loaded = FALSE; DBobView* g_PathView = NULL; DVisDrawer* g_VisView = NULL; @@ -92,17 +71,16 @@ void LoadLists() void DoIntersect() { - UndoableCommand undo("bobToolz.intersect"); IntersectRS rs; - if(DoIntersectBox(&rs) == eIDCANCEL) + if(DoIntersectBox(&rs) == IDCANCEL) return; if(rs.nBrushOptions == BRUSH_OPT_SELECTED) { - if( GlobalSelectionSystem().countSelected() < 2 ) + if( g_FuncTable.m_pfnSelectedBrushCount() < 2 ) { - DoMessageBox("Invalid number of brushes selected, choose at least 2", "Error", eMB_OK); + DoMessageBox("Invalid number of brushes selected, choose at least 2", "Error", MB_OK); return; } } @@ -118,7 +96,7 @@ void DoIntersect() } case BRUSH_OPT_WHOLE_MAP: { - world.LoadFromEntity(GlobalRadiant().getMapWorldEntity(), false); + world.LoadFromEntity(0, FALSE); break; } } @@ -138,36 +116,39 @@ void DoIntersect() void DoPolygonsTB() { - DoPolygons(); + vec3_t vMin, vMax; + + // figure out vMin and vMax + g_FuncTable.m_pfnGetDispatchParams( vMin, vMax, NULL ); + + DoPolygons( vMin, vMax ); } -void DoPolygons() +void DoPolygons(vec3_t vMin, vec3_t vMax) { - UndoableCommand undo("bobToolz.polygons"); // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { - DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); + DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", MB_OK); return; } + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + // get handle to size definition brush + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + // cant release until we delete the brush, if we do... + PolygonRS rs; // ask user for type, size, etc.... - if(DoPolygonBox(&rs) == eIDOK) + if(DoPolygonBox(&rs) == IDOK) { + g_FuncTable.m_pfnDeleteBrushHandle(brush); + DShape poly; - vec3_t vMin, vMax; - - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); - VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); - - Path_deleteTop(instance.path()); - } - if(rs.bInverse) poly.BuildInversePrism(vMin, vMax, rs.nSides, rs.bAlignTop); else @@ -181,26 +162,27 @@ void DoPolygons() poly.Commit(); } + + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DoFixBrushes() { - UndoableCommand undo("bobToolz.fixBrushes"); DMap world; world.LoadAll(); - int count = world.FixBrushes(); + int count = world.FixBrushes(TRUE); - globalOutputStream() << count << " invalid/duplicate planes removed\n"; + Sys_Printf("%i invalid/duplicate planes removed\n", count); } void DoResetTextures() { - UndoableCommand undo("bobToolz.resetTextures"); static ResetTextureRS rs; const char* texName; - if(1/*g_SelectedFaceTable.m_pfnGetSelectedFaceCount() != 1*/) + if(g_SelectedFaceTable.m_pfnGetSelectedFaceCount() != 1) { texName = NULL; } @@ -210,54 +192,53 @@ void DoResetTextures() strcpy(rs.textureName, GetCurrentTexture()); } - EMessageBoxReturn ret; - if((ret = DoResetTextureBox(&rs)) == eIDCANCEL) + int ret; + if((ret = DoResetTextureBox(&rs)) == IDCANCEL) return; if(rs.bResetTextureName) texName = rs.textureName; - if(ret == eIDOK) + if(ret == IDOK) { DEntity world; world.LoadSelectedBrushes(); world.ResetTextures(texName, rs.fScale, rs.fShift, rs.rotation, rs.newTextureName, - rs.bResetTextureName, rs.bResetScale, rs.bResetShift, rs.bResetRotation, true); + rs.bResetTextureName, rs.bResetScale, rs.bResetShift, rs.bResetRotation, TRUE); } else { DMap world; - world.LoadAll(true); + world.LoadAll(TRUE); world.ResetTextures(texName, rs.fScale, rs.fShift, rs.rotation, rs.newTextureName, rs.bResetTextureName, rs.bResetScale, rs.bResetShift, rs.bResetRotation); } } -void DoBuildStairs() +void DoBuildStairs(vec3_t vMin, vec3_t vMax) { - UndoableCommand undo("bobToolz.buildStairs"); BuildStairsRS rs; strcpy(rs.mainTexture, GetCurrentTexture()); // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { - DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); + DoMessageBox("Invalid number of brushes selected, chose 1 only", "Error", MB_OK); return; } + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + // get handle to size definition brush + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + // cant release until we delete the brush, if we do... + + // ask user for type, size, etc.... - if(DoBuildStairsBox(&rs) == eIDOK) + if(DoBuildStairsBox(&rs) == IDOK) { - vec3_t vMin, vMax; - - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); - VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); - } - // calc brush size vec3_t size; VectorSubtract(vMax, vMin, size); @@ -265,14 +246,14 @@ void DoBuildStairs() if(((int)size[2] % rs.stairHeight) != 0) { // stairs must fit evenly into brush - DoMessageBox("Invalid stair height\nHeight of block must be divisable by stair height", "Error", eMB_OK); + DoMessageBox("Invalid stair height\nHeight of block must be divisable by stair height", "Error", MB_OK); } else { - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - Path_deleteTop(instance.path()); - } + + // Remove Size Brush + g_FuncTable.m_pfnDeleteBrushHandle(brush); + // Get Step Count int numSteps = (int)size[2] / rs.stairHeight; @@ -295,7 +276,7 @@ void DoBuildStairs() // Build Base For Stair (bob's style) if(rs.style == STYLE_BOB) - Build_Wedge(rs.direction, vMin, vMax, true); + Build_Wedge(rs.direction, vMin, vMax, TRUE); // Set First Step Starting Position @@ -320,31 +301,32 @@ void DoBuildStairs() } } } + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } -void DoBuildDoors() +void DoBuildDoors(vec3_t vMin, vec3_t vMax) { - UndoableCommand undo("bobToolz.buildDoors"); // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { - DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); + DoMessageBox("Invalid number of brushes selected, chose 1 only", "Error", MB_OK); return; } - DoorRS rs; + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + // get handle to size definition brush + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + // cant release until we delete the brush, if we do... + + DoorRS rs; strcpy(rs.mainTexture, GetCurrentTexture()); - if(DoDoorsBox(&rs) == eIDOK) + if(DoDoorsBox(&rs) == IDOK) { - vec3_t vMin, vMax; - - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); - VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); - Path_deleteTop(instance.path()); - } + g_FuncTable.m_pfnDeleteBrushHandle(brush); BuildDoorsX2(vMin, vMax, rs.bScaleMainH, rs.bScaleMainV, @@ -352,51 +334,86 @@ void DoBuildDoors() rs.mainTexture, rs.trimTexture, rs.nOrientation); // shapes.cpp } + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DoPathPlotter() { - UndoableCommand undo("bobToolz.pathPlotter"); PathPlotterRS rs; - EMessageBoxReturn ret = DoPathPlotterBox(&rs); - if(ret == eIDCANCEL) + int ret = DoPathPlotterBox(&rs); + if(ret == IDCANCEL) return; - if(ret == eIDNO) + if(ret == IDNO) { if(g_PathView) delete g_PathView; return; } - // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1) { - DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); - return; + DoMessageBox("Invalid number of brushes selected, chose 1 only", "Error", MB_OK); + return; } - Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected().path().top()); - if(entity != 0) - { - DBobView_setEntity(*entity, rs.fMultiplier, rs.nPoints, rs.fGravity, rs.bNoUpdate, rs.bShowExtra); - } + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + // should be our trigger brush + + DEntity world; + world.LoadEPairList(*g_EntityTable.m_pfnGetEntityKeyValList(brush->owner)); + + DEPair* trigger_ep = world.FindEPairByKey("targetname"); + + if(trigger_ep) + { + if(!strcmp(world.m_Classname, "trigger_push")) + { + DEPair* target_ep = world.FindEPairByKey("target"); + if(target_ep) + { + entity_s* entTarget = FindEntityFromTargetname(target_ep->value, NULL); + if(entTarget) + { + if(g_PathView) + delete g_PathView; + g_PathView = new DBobView; + + g_PathView->Begin(trigger_ep->value, target_ep->value, rs.fMultiplier, rs.nPoints, rs.fGravity, rs.bNoUpdate, rs.bShowExtra); + } + else + DoMessageBox("trigger_push target could not be found.", "Error", MB_OK); + } + else + DoMessageBox("trigger_push has no target.", "Error", MB_OK); + } + else + DoMessageBox("You must select a 'trigger_push' entity.", "Error", MB_OK); + } + else + DoMessageBox("Entity must have a targetname", "Error", MB_OK); + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } -void DoPitBuilder() +void DoPitBuilder(vec3_t vMin, vec3_t vMax) { - UndoableCommand undo("bobToolz.pitBuilder"); // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { - DoMessageBox("Invalid number of brushes selected, choose 1 only", "Error", eMB_OK); + DoMessageBox("Invalid number of brushes selected, chose 1 only", "Error", MB_OK); return; } - vec3_t vMin, vMax; - - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - VectorSubtract(instance.worldAABB().origin, instance.worldAABB().extents, vMin); - VectorAdd(instance.worldAABB().origin, instance.worldAABB().extents, vMax); + // tell Radiant we want to access the selected brushes + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + // get handle to size definition brush + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + // cant release until we delete the brush, if we do... DShape pit; @@ -404,39 +421,42 @@ void DoPitBuilder() { pit.Commit(); - Path_deleteTop(instance.path()); + g_FuncTable.m_pfnDeleteBrushHandle(brush); } else - DoMessageBox("Failed To Make Pit\nTry Making The Brush Bigger", "Error", eMB_OK); + DoMessageBox("Failed To Make Pit\nTry Making The Brush Bigger", "Error", MB_OK); + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DoMergePatches() { - UndoableCommand undo("bobToolz.mergePatch"); patch_merge_t merge_info; DPatch mrgPatches[2]; int i; - // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 2 ) - { - DoMessageBox("Invalid number of patches selected, choose 2 only", "Error", eMB_OK); - return; - } + // ensure we have something selected + if ( g_FuncTable.m_pfnSelectedBrushCount() != 2 ) + { + DoMessageBox("Invalid number of objects selected, chose 2 only", "Error", MB_OK); + return; + } - scene::Instance* patches[2]; - patches[0] = &GlobalSelectionSystem().ultimateSelected(); - patches[1] = &GlobalSelectionSystem().penultimateSelected(); + + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); for (i = 0; i < 2; i++) { - if (!Node_isPatch(patches[i]->path().top())) + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i); + + if (!brush->pPatch) { - DoMessageBox("You must select ONLY patches", "Error", eMB_OK); + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); + DoMessageBox("You must select ONLY patches", "Error", MB_OK); return; } - mrgPatches[i].LoadFromPatch(*patches[i]); + mrgPatches[i].LoadFromBrush_t(brush); } /* mrgPatches[0].Transpose(); @@ -447,9 +467,9 @@ void DoMergePatches() if (merge_info.mergable) { - globalOutputStream() << merge_info.pos1 << " " << merge_info.pos2; + Sys_Printf("%i %i", merge_info.pos1, merge_info.pos2); - globalOutputStream() << "Patches Mergable\n"; + Sys_Printf("Patches Mergable\n"); DPatch* newPatch = mrgPatches[0].MergePatches(merge_info, &mrgPatches[0], &mrgPatches[1]); /* mrgPatches[0].RemoveFromRadiant(); @@ -465,53 +485,53 @@ void DoMergePatches() { } else { - Path_deleteTop(patches[0]->path()); - Path_deleteTop(patches[1]->path()); + mrgPatches[0].RemoveFromRadiant(); + mrgPatches[1].RemoveFromRadiant(); newPatch->BuildInRadiant(); delete newPatch; } } - else - { - globalOutputStream() << "bobToolz.mergePatch: the selected patches are not mergable\n"; - } + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DoSplitPatch() { - UndoableCommand undo("bobToolz.splitPatch"); - DPatch patch; // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) - { - DoMessageBox("Invalid number of patches selected, choose 1 only", "Error", eMB_OK); + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { + DoMessageBox("Invalid number of objects selected, select 1 patch only", "Error", MB_OK); return; } - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); - if( !Node_isPatch(instance.path().top()) ) { - DoMessageBox("You must select ONLY patches", "Error", eMB_OK); + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); + + if( !brush->pPatch ) { + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); + DoMessageBox("You must select ONLY patches", "Error", MB_OK); return; } - patch.LoadFromPatch(instance); + patch.LoadFromBrush_t(brush); - std::list patchList = patch.Split( true, true ); - for(std::list::iterator patches = patchList.begin(); patches != patchList.end(); patches++) { + list patchList = patch.Split( true, true ); + for(list::iterator patches = patchList.begin(); patches != patchList.end(); patches++) { (*patches).BuildInRadiant(); } - Path_deleteTop(instance.path()); + patch.RemoveFromRadiant(); + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); } void DoVisAnalyse() { char filename[1024]; - if( GlobalSelectionSystem().countSelected() == 0 ) + if( g_FuncTable.m_pfnSelectedBrushCount() == 0 ) { if(g_VisView) { @@ -520,17 +540,20 @@ void DoVisAnalyse() } } - // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 1 ) + if( g_FuncTable.m_pfnSelectedBrushCount() != 1 ) { - DoMessageBox("Invalid number of objects selected, choose 1 only", "Error", eMB_OK); + DoMessageBox("Invalid number of objects selected, select 1 only", "Error", MB_OK); return; } - scene::Instance& brush = GlobalSelectionSystem().ultimateSelected(); + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(0); DBrush orgBrush; - orgBrush.LoadFromBrush(brush, false); + orgBrush.LoadFromBrush_t(brush, false); + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); orgBrush.BuildBounds(); vec3_t origin; @@ -539,10 +562,10 @@ void DoVisAnalyse() origin[2] = (orgBrush.bbox_max[2] + orgBrush.bbox_min[2])/2.f; - const char* rad_filename = GlobalRadiant().getMapName(); + char* rad_filename = g_FuncTable.m_pfnGetMapName(); if(!rad_filename) { - DoMessageBox("An Error Occurred While Trying\n To Get The Map Filename", "Error", eMB_OK); + DoMessageBox("An Error Occurred While Trying\n To Get The Map Filename", "Error", MB_OK); return; } @@ -551,11 +574,12 @@ void DoVisAnalyse() char* ext = strrchr(filename, '.')+1; strcpy(ext, "bsp");// rename the extension - std::list *pointList = BuildTrace(filename, origin); + list *pointList = BuildTrace(filename, origin); if(!g_VisView) { g_VisView = new DVisDrawer; + g_VisView->Register(); } g_VisView->SetList(pointList); @@ -570,8 +594,7 @@ void DoTrainPathPlot() { g_TrainView = new DTrainDrawer(); } -void DoCaulkSelection() { - UndoableCommand undo("bobToolz.caulkSelection"); +void DoCaulkSelection( void ) { DEntity world; float fScale[2] = { 0.5f, 0.5f }; @@ -585,8 +608,7 @@ void DoCaulkSelection() { world.ResetTextures( NULL, fScale, fShift, 0, "textures/common/caulk", true, bResetScale, bResetShift, false, true ); } -void DoTreePlanter() { - UndoableCommand undo("bobToolz.treePlanter"); +void DoTreePlanter( void ) { if(g_TreePlanter) { delete g_TreePlanter; g_TreePlanter = NULL; @@ -596,15 +618,13 @@ void DoTreePlanter() { g_TreePlanter = new DTreePlanter(); } -void DoDropEnts() { - UndoableCommand undo("bobToolz.dropEntities"); +void DoDropEnts( void ) { if(g_TreePlanter) { g_TreePlanter->DropEntsToGround(); } } -void DoMakeChain() { - UndoableCommand undo("bobToolz.makeChain"); +void DoMakeChain( void ) { DTreePlanter pl; pl.MakeChain(); } @@ -613,29 +633,31 @@ typedef DPoint* pntTripple[3]; bool bFacesNoTop[6] = {true, true, true, true, true, false}; -void DoFlipTerrain() { - UndoableCommand undo("bobToolz.flipTerrain"); +void DoFlipTerrain( void ) { vec3_t vUp = { 0.f, 0.f, 1.f }; int i; // ensure we have something selected - if( GlobalSelectionSystem().countSelected() != 2 ) - { - DoMessageBox("Invalid number of objects selected, choose 2 only", "Error", eMB_OK); - return; + if( g_FuncTable.m_pfnSelectedBrushCount() != 2 ) { + DoMessageBox("Invalid number of objects selected, chose 2 only", "Error", MB_OK); + return; } - scene::Instance* brushes[2]; - brushes[0] = &GlobalSelectionSystem().ultimateSelected(); - brushes[1] = &GlobalSelectionSystem().penultimateSelected(); + g_FuncTable.m_pfnAllocateSelectedBrushHandles(); + + brush_t* brushes[2]; + for( i = 0; i < 2; i++ ) { + brushes[i] = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i); + } DBrush Brushes[2]; DPlane* Planes[2]; pntTripple Points[2]; for( i = 0; i < 2; i++ ) { - Brushes[i].LoadFromBrush( *brushes[i], false ); + Brushes[i].LoadFromBrush_t( brushes[i], false ); if(!(Planes[i] = Brushes[i].FindPlaneWithClosestNormal( vUp )) || Brushes[i].FindPointsForPlane( Planes[i], Points[i], 3 ) != 3) { - DoMessageBox("Error", "Error", eMB_OK); + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); + DoMessageBox("Error", "Error", MB_OK); return; } } @@ -644,6 +666,15 @@ void DoFlipTerrain() { Brushes[0].GetBounds( mins1, maxs1 ); Brushes[1].GetBounds( mins2, maxs2 ); + entity_t* ents[2]; + for( i = 0; i < 2; i++ ) { + ents[i] = brushes[i]->owner; + Brushes[i].RemoveFromRadiant(); + } + + g_FuncTable.m_pfnReleaseSelectedBrushHandles(); + + int dontmatch[2] = { -1, -1 }; @@ -662,7 +693,7 @@ void DoFlipTerrain() { found = false; } if(dontmatch[0] == -1) { - DoMessageBox("Error", "Error", eMB_OK); + DoMessageBox("Error", "Error", MB_OK); return; } @@ -680,7 +711,7 @@ void DoFlipTerrain() { found = false; } if(dontmatch[1] == -1) { - DoMessageBox("Error", "Error", eMB_OK); + DoMessageBox("Error", "Error", MB_OK); return; } @@ -762,8 +793,7 @@ void DoFlipTerrain() { for( i = 0; i < 2; i++ ) { newBrushes[i]->RemoveRedundantPlanes(); - newBrushes[i]->BuildInRadiant( false, NULL, brushes[i]->path().parent().get_pointer() ); - Path_deleteTop(brushes[i]->path()); + newBrushes[i]->BuildInRadiant( false, NULL, ents[i] ); delete newBrushes[i]; } diff --git a/contrib/bobtoolz/funchandlers.cpp b/contrib/bobtoolz/funchandlers.cpp index a429b78d..c83d2ae0 100644 --- a/contrib/bobtoolz/funchandlers.cpp +++ b/contrib/bobtoolz/funchandlers.cpp @@ -39,8 +39,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "DShape.h" // for autocaulk -std::list exclusionList; // whole brush exclusion -std::list exclusionList_Face; // single face exclusion +list exclusionList; // whole brush exclusion +list exclusionList_Face; // single face exclusion BOOL el1Loaded; BOOL el2Loaded; @@ -309,8 +309,6 @@ void FixBrushes() void AutoCaulk() { - UndoableCommand undo("bobToolz.autoCaulk"); - if(!el1Loaded) autocaulkDlg.m_Warning1 = "WARNING: Brush exclusion list not found\n, ALL BRUSHES WILL BE USED"; diff --git a/contrib/bobtoolz/funchandlers.h b/contrib/bobtoolz/funchandlers.h index 8be283fd..1e3696cb 100644 --- a/contrib/bobtoolz/funchandlers.h +++ b/contrib/bobtoolz/funchandlers.h @@ -17,10 +17,10 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -class DBobView; -class DVisDrawer; -class DTrainDrawer; -class DTreePlanter; +#include "DBobView.h" +#include "DVisDrawer.h" +#include "DTrainDrawer.h" +#include "DTreePlanter.h" extern DBobView* g_PathView; extern DVisDrawer* g_VisView; @@ -50,23 +50,23 @@ void LoadLists(); // djbob -void DoIntersect(); -void DoPolygonsTB(); -void DoPolygons(); -void DoFixBrushes(); -void DoResetTextures(); -void DoBuildStairs(); -void DoBuildDoors(); -void DoPathPlotter(); -void DoPitBuilder(); -void DoCTFColourChanger(); -void DoMergePatches(); -void DoSplitPatch(); -void DoVisAnalyse(); -void DoTrainThing(); -void DoTrainPathPlot(); -void DoCaulkSelection(); -void DoTreePlanter(); -void DoDropEnts(); -void DoMakeChain(); -void DoFlipTerrain(); +void DoIntersect( void ); +void DoPolygonsTB( void ); +void DoPolygons(vec3_t vMin, vec3_t vMax); +void DoFixBrushes( void ); +void DoResetTextures( void ); +void DoBuildStairs(vec3_t vMin, vec3_t vMax); +void DoBuildDoors(vec3_t vMin, vec3_t vMax); +void DoPathPlotter( void ); +void DoPitBuilder(vec3_t vMin, vec3_t vMax); +void DoCTFColourChanger( void ); +void DoMergePatches( void ); +void DoSplitPatch( void ); +void DoVisAnalyse( void ); +void DoTrainThing( void ); +void DoTrainPathPlot( void ); +void DoCaulkSelection( void ); +void DoTreePlanter( void ); +void DoDropEnts( void ); +void DoMakeChain( void ); +void DoFlipTerrain( void ); diff --git a/contrib/bobtoolz/interfaces/IScriptParser.h b/contrib/bobtoolz/interfaces/IScriptParser.h new file mode 100644 index 00000000..5d0ee5ba --- /dev/null +++ b/contrib/bobtoolz/interfaces/IScriptParser.h @@ -0,0 +1,23 @@ +#ifndef _ISCRIPTPARSER_H_ +#define _ISCRIPTPARSER_H_ + +class IScriptParser { +public: + virtual ~IScriptParser() {}; + + virtual const char* GetToken ( bool ) = 0; + virtual char* GetBufferCopy ( void ) = 0; + virtual int GetTokenOffset ( void ) = 0; + + virtual void SkipBracedSection ( void ) = 0; + virtual void SkipRestOfLine ( void ) = 0; + virtual void UndoGetToken ( void ) = 0; + virtual void ResetParseSession ( void ) = 0; + + virtual void LoadScript ( const char* ) = 0; + virtual void SetScript ( char* ) = 0; + + virtual void AddBreakChar( char ) = 0; +}; + +#endif diff --git a/contrib/bobtoolz/lists.cpp b/contrib/bobtoolz/lists.cpp index 9823b051..51744680 100644 --- a/contrib/bobtoolz/lists.cpp +++ b/contrib/bobtoolz/lists.cpp @@ -17,17 +17,16 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lists.h" +#include "StdAfx.h" -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4786) #endif -#include - +#include "lists.h" #include "misc.h" -bool LoadExclusionList(char* filename, std::list* exclusionList) +bool LoadExclusionList(char* filename, list* exclusionList) { FILE* eFile = fopen(filename, "r"); if(eFile) @@ -50,7 +49,7 @@ bool LoadExclusionList(char* filename, std::list* exclusionList) return TRUE; } - globalErrorStream() << "Failed To Load Exclusion List: " << filename << "\n"; + Sys_ERROR("Failed To Load Exclusion List: %s\n", filename); return FALSE; } @@ -81,6 +80,6 @@ bool LoadGList(char* filename, GList** loadlist) return TRUE; } - globalErrorStream() << "Failed To Load GList: " << filename << "\n"; + Sys_ERROR("Failed To Load GList: %s\n", filename); return FALSE; } diff --git a/contrib/bobtoolz/lists.h b/contrib/bobtoolz/lists.h index c4ccf77e..6f9774f6 100644 --- a/contrib/bobtoolz/lists.h +++ b/contrib/bobtoolz/lists.h @@ -17,9 +17,5 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include "str.h" -typedef struct _GList GList; - -bool LoadExclusionList(char* filename, std::list* exclusionList); +bool LoadExclusionList(char* filename, list* exclusionList); bool LoadGList(char* filename, GList** loadlist); diff --git a/contrib/bobtoolz/misc.cpp b/contrib/bobtoolz/misc.cpp index 5d926986..a061e867 100644 --- a/contrib/bobtoolz/misc.cpp +++ b/contrib/bobtoolz/misc.cpp @@ -17,18 +17,9 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "misc.h" +#include "StdAfx.h" -#include -#include "str.h" - -#include "DPoint.h" -#include "DPlane.h" -#include "DBrush.h" -#include "DEPair.h" -#include "DPatch.h" #include "DEntity.h" - #include "funchandlers.h" #ifdef __linux__ @@ -36,18 +27,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #endif -#include "iundo.h" -#include "ientity.h" -#include "iscenegraph.h" -#include "qerplugin.h" - -#include -#include -#include -#include - -#include "scenelib.h" - /*========================== Global Vars ==========================*/ @@ -60,7 +39,7 @@ char g_CurrentTexture[256] = ""; void ReadCurrentTexture() { - const char* textureName = GlobalRadiant().TextureBrowser_getSelectedShader(); + const char* textureName = g_FuncTable.m_pfnGetCurrentTexture(); strcpy(g_CurrentTexture, textureName); } @@ -70,6 +49,16 @@ const char* GetCurrentTexture() return g_CurrentTexture; } +epair_t* GetNextChainItem(epair_t* lastItem, char* key, char* value) +{ + epair_t* nextEPair = g_FuncTable.m_pfnAllocateEpair(key, value); + + if(lastItem != NULL) + lastItem->next = nextEPair; + + return nextEPair; +} + void MoveBlock(int dir, vec3_t min, vec3_t max, float dist) { switch(dir) @@ -131,10 +120,12 @@ void SetInitialStairPos(int dir, vec3_t min, vec3_t max, float width) char* TranslateString (char *buf) { static char buf2[32768]; + int i, l; + char *out; - std::size_t l = strlen(buf); - char* out = buf2; - for (int i=0 ; i%s", buf); +} + +/*void Sys_Printf (char *text, ...) +{ + va_list argptr; + char buf[32768]; + + va_start (argptr,text); + vsprintf (buf, text,argptr); + va_end (argptr); + + g_FuncTable.m_pfnSysMsg ( buf ); +}*/ char* UnixToDosPath(char* path) { -#ifndef WIN32 +#ifndef _WIN32 return path; #else for(char* p = path; *p; p++) @@ -166,7 +180,7 @@ char* UnixToDosPath(char* path) const char* ExtractFilename(const char* path) { - const char* p = strrchr(path, '/'); + char* p = strrchr(path, '/'); if(!p) { p = strrchr(path, '\\'); @@ -188,7 +202,7 @@ extern char* PLUGIN_NAME; return buffer; }*/ -#if defined (POSIX) +#if defined (__linux__) || defined (__APPLE__) // the bCreateConsole parameter is ignored on linux .. bool Q_Exec( const char *pCmd, bool bCreateConsole ) { @@ -215,10 +229,7 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole ) } #endif -#ifdef WIN32 - -#include - +#ifdef _WIN32 bool Q_Exec( const char *pCmd, bool bCreateConsole ) { // G_DeWan: Don't know if this is needed for linux version @@ -235,7 +246,7 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole ) for(; *pCmd == ' '; pCmd++); - if(!CreateProcess(NULL, (char *)pCmd, NULL, NULL, false, dwCreationFlags, NULL, NULL, &si, &pi)) + if(!CreateProcess(NULL, (char *)pCmd, NULL, NULL, FALSE, dwCreationFlags, NULL, NULL, &si, &pi)) return false; return true; @@ -249,7 +260,7 @@ void StartBSP() UnixToDosPath(exename); // do we want this done in linux version? char mapname[256]; - const char *pn = GlobalRadiant().getMapsPath(); + const char *pn = g_FuncTable.m_pfnReadProjectKey("mapspath"); strcpy( mapname, pn ); strcat( mapname, "/ac_prt.map" ); @@ -258,49 +269,19 @@ void StartBSP() char command[1024]; sprintf(command, "%s -nowater -fulldetail %s", exename, mapname); - Q_Exec( command, true ); + Q_Exec( command, TRUE ); } -class EntityWriteMiniPrt -{ - mutable DEntity world; - FILE* pFile; - std::list* exclusionList; -public: - EntityWriteMiniPrt(FILE* pFile, std::list* exclusionList) - : pFile(pFile), exclusionList(exclusionList) - { - } - void operator()(scene::Instance& instance) const - { - const char* classname = Node_getEntity(instance.path().top())->getKeyValue("classname"); - - if(!strcmp(classname, "worldspawn")) - { - world.LoadFromEntity(instance.path().top(), false); - world.RemoveNonCheckBrushes(exclusionList, true); - world.SaveToFile(pFile); - } - else if(strstr(classname, "info_")) - { - world.ClearBrushes(); - world.ClearEPairs(); - world.LoadEPairList(Node_getEntity(instance.path().top())); - world.SaveToFile(pFile); - } - } -}; - -void BuildMiniPrt(std::list* exclusionList) +void BuildMiniPrt(list* exclusionList) { // yes, we could just use -fulldetail option, but, as SPOG said // it'd be faster without all the hint, donotenter etc textures and // doors, etc - + DEntity world; char buffer[128]; - const char *pn = GlobalRadiant().getMapsPath(); + const char *pn = g_FuncTable.m_pfnReadProjectKey("mapspath"); strcpy( buffer, pn ); strcat( buffer, "/ac_prt.map" ); @@ -310,58 +291,88 @@ void BuildMiniPrt(std::list* exclusionList) if(!pFile) return; - Scene_forEachEntity(EntityWriteMiniPrt(pFile, exclusionList)); + int count = g_FuncTable.m_pfnGetEntityCount(); + for(int i = 0; i < count; i++) + { + entity_t* ent = (entity_t*)g_FuncTable.m_pfnGetEntityHandle(i); + + epair_t* epl = *g_EntityTable.m_pfnGetEntityKeyValList(ent); + + epair_t* ep = epl; + while(ep) + { + if(!strcmp(ep->key, "classname")) + { + if(!strcmp(ep->value, "worldspawn")) + { + world.LoadFromEntity(i, FALSE); + world.RemoveNonCheckBrushes(exclusionList, TRUE); + world.SaveToFile(pFile); + } + else if(strstr(ep->value, "info_")) + { + world.ClearBrushes(); + world.ClearEPairs(); + world.LoadEPairList(epl); + world.SaveToFile(pFile); + } + break; + } + + ep = ep->next; + } + } fclose(pFile); StartBSP(); } -class EntityFindByTargetName +entity_s* FindEntityFromTargetname(const char* targetname, int* entNum) { - const char* targetname; -public: - mutable const scene::Path* result; - EntityFindByTargetName(const char* targetname) - : targetname(targetname), result(0) - { - } - void operator()(scene::Instance& instance) const - { - if(result == 0) - { - const char* value = Node_getEntity(instance.path().top())->getKeyValue("targetname"); + DEntity world; - if(!strcmp(value, targetname)) - { - result = &instance.path(); - } - } - } -}; - -const scene::Path* FindEntityFromTargetname(const char* targetname) -{ - return Scene_forEachEntity(EntityFindByTargetName(targetname)).result; + int count = g_FuncTable.m_pfnGetEntityCount(); + for(int i = 0; i < count; i++) + { + world.ClearEPairs(); + + entity_s* ent = (entity_s*)g_FuncTable.m_pfnGetEntityHandle(i); + + world.LoadEPairList(*g_EntityTable.m_pfnGetEntityKeyValList(ent)); + + DEPair* tn = world.FindEPairByKey("targetname"); + if(tn) + { + if(!stricmp(tn->value, targetname)) { + if(entNum) { + *entNum = i; + } + return ent; + } + } + } + return NULL; } void FillDefaultTexture(_QERFaceData* faceData, vec3_t va, vec3_t vb, vec3_t vc, const char* texture) { - faceData->m_texdef.rotate = 0; - faceData->m_texdef.scale[0] = 0.5; - faceData->m_texdef.scale[1] = 0.5; - faceData->m_texdef.shift[0] = 0; - faceData->m_texdef.shift[1] = 0; - faceData->contents = 0; - faceData->flags = 0; - faceData->value = 0; + faceData->m_bBPrimit = FALSE; + faceData->m_fRotate = 0; + faceData->m_fScale[0] = 0.5; + faceData->m_fScale[1] = 0.5; + faceData->m_fShift[0] = 0; + faceData->m_fShift[1] = 0; + faceData->m_nContents = 0; + faceData->m_nFlags = 0; + faceData->m_nValue = 0; if(*texture) - faceData->m_shader = texture; + strcpy(faceData->m_TextureName, texture); else - faceData->m_shader = "textures/common/caulk"; - VectorCopy(va, faceData->m_p0); - VectorCopy(vb, faceData->m_p1); - VectorCopy(vc, faceData->m_p2); + strcpy(faceData->m_TextureName, "textures/common/caulk"); + VectorCopy(va, faceData->m_v1); + VectorCopy(vb, faceData->m_v2); + VectorCopy(vc, faceData->m_v3); } float Determinant3x3(float a1, float a2, float a3, @@ -373,14 +384,29 @@ float Determinant3x3(float a1, float a2, float a3, bool GetEntityCentre(const char* entity, vec3_t centre) { - const scene::Path* ent = FindEntityFromTargetname(entity); + entity_s* ent = FindEntityFromTargetname(entity, NULL); if(!ent) - return false; + return FALSE; - scene::Instance& instance = *GlobalSceneGraph().find(*ent); - VectorCopy(instance.worldAABB().origin, centre); + int cnt = g_FuncTable.m_pfnAllocateEntityBrushHandles(ent); + if(cnt == 0) + { + g_FuncTable.m_pfnReleaseEntityBrushHandles(); + return FALSE; + } - return true; + brush_t* brush = (brush_t*)g_FuncTable.m_pfnGetEntityBrushHandle(0); + DBrush cBrush; + cBrush.LoadFromBrush_t(brush, FALSE); + + vec3_t min, max; + cBrush.GetBounds(min, max); + + VectorAdd(min, max, centre); + VectorScale(centre, 0.5f, centre); + + g_FuncTable.m_pfnReleaseEntityBrushHandles(); + return TRUE; } vec_t Min(vec_t a, vec_t b) @@ -390,17 +416,9 @@ vec_t Min(vec_t a, vec_t b) return b; } -void MakeNormal( const vec_t* va, const vec_t* vb, const vec_t* vc, vec_t* out ) { +void MakeNormal( vec_t* va, vec_t* vb, vec_t* vc, vec_t* out ) { vec3_t v1, v2; VectorSubtract(va, vb, v1); VectorSubtract(vc, vb, v2); CrossProduct(v1, v2, out); } - -char* GetFilename(char* buffer, const char* filename) { - strcpy(buffer, GlobalRadiant().getAppPath()); - strcat(buffer, "plugins/"); - strcat(buffer, filename); - return buffer; -} - diff --git a/contrib/bobtoolz/misc.h b/contrib/bobtoolz/misc.h index 61faee5d..81b48879 100644 --- a/contrib/bobtoolz/misc.h +++ b/contrib/bobtoolz/misc.h @@ -17,30 +17,23 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_MISC_H) -#define INCLUDED_MISC_H - -#include "mathlib.h" -#include -#include "str.h" -#include "iscenegraph.h" - -#define MAX_ROUND_ERROR 0.05 - vec_t Min(vec_t a, vec_t b); +epair_t* GetNextChainItem(epair_t* lastItem, char* key, char* value); + // reads current texture into global, returns pointer to it const char* GetCurrentTexture(); -class _QERFaceData; void FillDefaultTexture(_QERFaceData* faceData, vec3_t va, vec3_t vb, vec3_t vc, const char* texture); -void BuildMiniPrt(std::list* exclusionList); +void Sys_ERROR (char* text, ...); + +void BuildMiniPrt(list* exclusionList); void MoveBlock(int dir, vec3_t min, vec3_t max, float dist); void SetInitialStairPos(int dir, vec3_t min, vec3_t max, float width); -const scene::Path* FindEntityFromTargetname(const char* targetname); +entity_s* FindEntityFromTargetname(const char* targetname, int* entNum); char* UnixToDosPath(char* path); @@ -52,6 +45,4 @@ float Determinant3x3(float a1, float a2, float a3, float c1, float c2, float c3); bool GetEntityCentre(const char* entity, vec3_t centre); -void MakeNormal( const vec_t* va, const vec_t* vb, const vec_t* vc, vec_t* out ); - -#endif +void MakeNormal( vec_t* va, vec_t* vb, vec_t* vc, vec_t* out ); diff --git a/contrib/bobtoolz/res/plugin.rc2 b/contrib/bobtoolz/res/plugin.rc2 index 2704dbfa..2def5721 100644 --- a/contrib/bobtoolz/res/plugin.rc2 +++ b/contrib/bobtoolz/res/plugin.rc2 @@ -1,13 +1,13 @@ -// -// SOUNDTEST.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// +// +// SOUNDTEST.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/contrib/bobtoolz/shapes.cpp b/contrib/bobtoolz/shapes.cpp index 4713ff5f..035179a7 100644 --- a/contrib/bobtoolz/shapes.cpp +++ b/contrib/bobtoolz/shapes.cpp @@ -18,33 +18,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "StdAfx.h" + #include "shapes.h" -#include - -#include "DPoint.h" #include "DPlane.h" -#include "str.h" #include "misc.h" #include "funchandlers.h" -#include "iundo.h" -#include "ishaders.h" -#include "ientity.h" -#include "ieclass.h" -#include "ipatch.h" -#include "qerplugin.h" - -#include -#include -#include -#include -#include - -#include "scenelib.h" -#include "texturelib.h" - //#include "dialogs-gtk.h" /************************ @@ -83,19 +65,22 @@ float Deg2Rad(float angle) return (float)(angle*Q_PI/180); } -void AddFaceWithTexture(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool detail) +void AddFaceWithTexture(brush_t* brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool detail) { _QERFaceData faceData; FillDefaultTexture(&faceData, va, vb, vc, texture); if(detail) - faceData.contents |= FACE_DETAIL; - GlobalBrushCreator().Brush_addFace(brush, faceData); + faceData.m_nContents |= FACE_DETAIL; + + g_FuncTable.m_pfnAddFaceData(brush, &faceData); } -void AddFaceWithTextureScaled(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t vc, +void AddFaceWithTextureScaled(brush_t* brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool bVertScale, bool bHorScale, float minX, float minY, float maxX, float maxY) { + g_ShadersTable.m_pfnShader_ForName(texture); // need to call frist to load? + qtexture_t* pqtTexInfo; // TTimo: there used to be a call to pfnHasShader here @@ -103,7 +88,7 @@ void AddFaceWithTextureScaled(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t v // If a texture doesn't have a shader script, a default shader object is used. // The IShader object was leaking also // collect texture info: sizes, etc - IShader* i = GlobalShaderSystem().getShaderForName(texture); + IShader* i = g_ShadersTable.m_pfnShader_ForName(texture); pqtTexInfo = i->getTexture(); // shader width/height doesn't come out properly if(pqtTexInfo) @@ -113,35 +98,37 @@ void AddFaceWithTextureScaled(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t v if(bHorScale) { + int texWidth = pqtTexInfo->width; float width = maxX - minX; - scale[0] = width/pqtTexInfo->width; + scale[0] = width/texWidth; shift[0] = -(float)((int)maxX%(int)width)/scale[0]; } if(bVertScale) { + int texHeight = pqtTexInfo->height; float height = maxY - minY; - scale[1] = height/pqtTexInfo->height; + scale[1] = height/texHeight; shift[1] = (float)((int)minY%(int)height)/scale[1]; } _QERFaceData addFace; FillDefaultTexture(&addFace, va, vb, vc, texture); - addFace.m_texdef.scale[0] = scale[0]; - addFace.m_texdef.scale[1] = scale[1]; - addFace.m_texdef.shift[0] = shift[0]; - addFace.m_texdef.shift[1] = shift[1]; + addFace.m_fScale[0] = scale[0]; + addFace.m_fScale[1] = scale[1]; + addFace.m_fShift[0] = shift[0]; + addFace.m_fShift[1] = shift[1]; - GlobalBrushCreator().Brush_addFace(brush, addFace); + g_FuncTable.m_pfnAddFaceData(brush, &addFace); } else { // shouldn't even get here, as default missing texture should be returned if // texture doesn't exist, but just in case - AddFaceWithTexture(brush, va, vb, vc, texture, false); - globalErrorStream() << "BobToolz::Invalid Texture Name-> " << texture; + AddFaceWithTexture(brush, va, vb, vc, texture, FALSE); + Sys_ERROR("BobToolz::Invalid Texture Name-> %s", texture); } // the IShader is not kept referenced, DecRef it i->DecRef(); @@ -153,7 +140,7 @@ void AddFaceWithTextureScaled(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t v void Build_Wedge(int dir, vec3_t min, vec3_t max, bool bUp) { - NodeSmartReference newBrush(GlobalBrushCreator().createBrush()); + brush_t* newBrush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); vec3_t v1, v2, v3, v5, v6, v7, v8; VectorCopy(min, v1); @@ -175,62 +162,62 @@ void Build_Wedge(int dir, vec3_t min, vec3_t max, bool bUp) { if(dir != MOVE_EAST) - AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", FALSE); if(dir != MOVE_WEST) - AddFaceWithTexture(newBrush, v7, v5, v8, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v7, v5, v8, "textures/common/caulk", FALSE); if(dir != MOVE_NORTH) - AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", FALSE); if(dir != MOVE_SOUTH) - AddFaceWithTexture(newBrush, v3, v8, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v3, v8, v6, "textures/common/caulk", FALSE); - AddFaceWithTexture(newBrush, v1, v2, v3, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v2, v3, "textures/common/caulk", FALSE); if(dir == MOVE_EAST) - AddFaceWithTexture(newBrush, v1, v3, v5, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v3, v5, "textures/common/caulk", FALSE); if(dir == MOVE_WEST) - AddFaceWithTexture(newBrush, v2, v6, v8, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v2, v6, v8, "textures/common/caulk", FALSE); if(dir == MOVE_NORTH) - AddFaceWithTexture(newBrush, v1, v6, v5, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v6, v5, "textures/common/caulk", FALSE); if(dir == MOVE_SOUTH) - AddFaceWithTexture(newBrush, v7, v3, v8, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v7, v3, v8, "textures/common/caulk", FALSE); } else { if(dir != MOVE_WEST) - AddFaceWithTexture(newBrush, v7, v5, v8, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v7, v5, v8, "textures/common/caulk", FALSE); if(dir != MOVE_EAST) - AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", FALSE); if(dir != MOVE_NORTH) - AddFaceWithTexture(newBrush, v3, v8, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v3, v8, v6, "textures/common/caulk", FALSE); if(dir != MOVE_SOUTH) - AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", FALSE); - AddFaceWithTexture(newBrush, v6, v5, v7, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v6, v5, v7, "textures/common/caulk", FALSE); if(dir == MOVE_WEST) - AddFaceWithTexture(newBrush, v1, v5, v3, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v5, v3, "textures/common/caulk", FALSE); if(dir == MOVE_EAST) - AddFaceWithTexture(newBrush, v2, v8, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v2, v8, v6, "textures/common/caulk", FALSE); if(dir == MOVE_NORTH) - AddFaceWithTexture(newBrush, v1, v5, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v5, v6, "textures/common/caulk", FALSE); if(dir == MOVE_SOUTH) - AddFaceWithTexture(newBrush, v7, v8, v3, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v7, v8, v3, "textures/common/caulk", FALSE); } - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(newBrush); + g_FuncTable.m_pfnCommitBrushHandle(newBrush); } //----------------------------------------------------------------------------------- @@ -238,7 +225,7 @@ void Build_Wedge(int dir, vec3_t min, vec3_t max, bool bUp) void Build_StairStep_Wedge(int dir, vec3_t min, vec3_t max, const char* mainTexture, const char* riserTexture, bool detail) { - NodeSmartReference newBrush(GlobalBrushCreator().createBrush()); + brush_t* newBrush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); //----- Build Outer Bounds --------- @@ -309,16 +296,16 @@ void Build_StairStep_Wedge(int dir, vec3_t min, vec3_t max, const char* mainText if(dir == MOVE_SOUTH) AddFaceWithTexture(newBrush, v7, v8, v3, "textures/common/caulk", detail); - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(newBrush); + g_FuncTable.m_pfnCommitBrushHandle(newBrush); } //----------------------------------------------------------------------------------- //----------------------------------------------------------------------------------- // internal use only, to get a box without finishing construction -scene::Node& Build_Get_BoundingCube_Selective(vec3_t min, vec3_t max, char* texture, bool* useFaces) +brush_t* Build_Get_BoundingCube_Selective(vec3_t min, vec3_t max, char* texture, bool* useFaces) { - NodeSmartReference newBrush(GlobalBrushCreator().createBrush()); + brush_t* newBrush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); //----- Build Outer Bounds --------- @@ -341,25 +328,25 @@ scene::Node& Build_Get_BoundingCube_Selective(vec3_t min, vec3_t max, char* text //----- Add Six Cube Faces --------- if(useFaces[0]) - AddFaceWithTexture(newBrush, v1, v2, v3, texture, false); + AddFaceWithTexture(newBrush, v1, v2, v3, texture, FALSE); if(useFaces[1]) - AddFaceWithTexture(newBrush, v1, v3, v6, texture, false); + AddFaceWithTexture(newBrush, v1, v3, v6, texture, FALSE); if(useFaces[2]) - AddFaceWithTexture(newBrush, v1, v7, v2, texture, false); + AddFaceWithTexture(newBrush, v1, v7, v2, texture, FALSE); if(useFaces[3]) - AddFaceWithTexture(newBrush, v5, v6, v3, texture, false); + AddFaceWithTexture(newBrush, v5, v6, v3, texture, FALSE); if(useFaces[4]) - AddFaceWithTexture(newBrush, v5, v2, v7, texture, false); + AddFaceWithTexture(newBrush, v5, v2, v7, texture, FALSE); if(useFaces[5]) - AddFaceWithTexture(newBrush, v5, v7, v6, texture, false); + AddFaceWithTexture(newBrush, v5, v7, v6, texture, FALSE); //---------------------------------- return newBrush; } -scene::Node& Build_Get_BoundingCube(vec3_t min, vec3_t max, char* texture) +brush_t* Build_Get_BoundingCube(vec3_t min, vec3_t max, char* texture) { return Build_Get_BoundingCube_Selective(min, max, texture, bFacesAll); } @@ -369,7 +356,7 @@ scene::Node& Build_Get_BoundingCube(vec3_t min, vec3_t max, char* texture) void Build_StairStep(vec3_t min, vec3_t max, const char* mainTexture, const char* riserTexture, int direction) { - NodeSmartReference newBrush(GlobalBrushCreator().createBrush()); + brush_t* newBrush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); //----- Build Outer Bounds --------- @@ -389,37 +376,37 @@ void Build_StairStep(vec3_t min, vec3_t max, const char* mainTexture, const char //---------------------------------- - AddFaceWithTexture(newBrush, v6, v5, v7, mainTexture, false); + AddFaceWithTexture(newBrush, v6, v5, v7, mainTexture, FALSE); // top gets current texture if(direction == MOVE_EAST) - AddFaceWithTexture(newBrush, v1, v3, v6, riserTexture, false); + AddFaceWithTexture(newBrush, v1, v3, v6, riserTexture, FALSE); else - AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v3, v6, "textures/common/caulk", FALSE); // west facing side, etc... if(direction == MOVE_NORTH) - AddFaceWithTexture(newBrush, v1, v7, v2, riserTexture, false); + AddFaceWithTexture(newBrush, v1, v7, v2, riserTexture, FALSE); else - AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v7, v2, "textures/common/caulk", FALSE); if(direction == MOVE_SOUTH) - AddFaceWithTexture(newBrush, v3, v5, v6, riserTexture, false); + AddFaceWithTexture(newBrush, v3, v5, v6, riserTexture, FALSE); else - AddFaceWithTexture(newBrush, v3, v5, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v3, v5, v6, "textures/common/caulk", FALSE); if(direction == MOVE_WEST) - AddFaceWithTexture(newBrush, v7, v5, v2, riserTexture, false); + AddFaceWithTexture(newBrush, v7, v5, v2, riserTexture, FALSE); else - AddFaceWithTexture(newBrush, v7, v5, v2, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v7, v5, v2, "textures/common/caulk", FALSE); - AddFaceWithTexture(newBrush, v1, v2, v3, "textures/common/caulk", false); + AddFaceWithTexture(newBrush, v1, v2, v3, "textures/common/caulk", FALSE); // base is caulked - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(newBrush); + g_FuncTable.m_pfnCommitBrushHandle(newBrush); // finish brush } @@ -475,24 +462,24 @@ void BuildDoorsX2(vec3_t min, vec3_t max, //---------------------------------- - NodeSmartReference newBrush1(GlobalBrushCreator().createBrush()); - NodeSmartReference newBrush2(GlobalBrushCreator().createBrush()); + brush_t* newBrush1 = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); + brush_t* newBrush2 = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); - AddFaceWithTexture(newBrush1, v1, v2, v3, "textures/common/caulk", false); - AddFaceWithTexture(newBrush1, v5, v7, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush1, v1, v2, v3, "textures/common/caulk", FALSE); + AddFaceWithTexture(newBrush1, v5, v7, v6, "textures/common/caulk", FALSE); - AddFaceWithTexture(newBrush2, v1, v2, v3, "textures/common/caulk", false); - AddFaceWithTexture(newBrush2, v5, v7, v6, "textures/common/caulk", false); + AddFaceWithTexture(newBrush2, v1, v2, v3, "textures/common/caulk", FALSE); + AddFaceWithTexture(newBrush2, v5, v7, v6, "textures/common/caulk", FALSE); if(direction == 0) { - AddFaceWithTexture(newBrush1, v1, v3, v6, "textures/common/caulk", false); - AddFaceWithTexture(newBrush2, v5, v2, v7, "textures/common/caulk", false); + AddFaceWithTexture(newBrush1, v1, v3, v6, "textures/common/caulk", FALSE); + AddFaceWithTexture(newBrush2, v5, v2, v7, "textures/common/caulk", FALSE); } else { - AddFaceWithTexture(newBrush1, v1, v7, v2, "textures/common/caulk", false); - AddFaceWithTexture(newBrush2, v5, v6, v3, "textures/common/caulk", false); + AddFaceWithTexture(newBrush1, v1, v7, v2, "textures/common/caulk", FALSE); + AddFaceWithTexture(newBrush2, v5, v6, v3, "textures/common/caulk", FALSE); } if(direction == 0) @@ -540,33 +527,41 @@ void BuildDoorsX2(vec3_t min, vec3_t max, //---------------------------------- - EntityClass* doorClass = GlobalEntityClassManager().findOrInsert("func_door", true); - NodeSmartReference pEDoor1(GlobalEntityCreator().createEntity(doorClass)); - NodeSmartReference pEDoor2(GlobalEntityCreator().createEntity(doorClass)); + entity_t* pEDoor1 = (entity_t*)g_FuncTable.m_pfnCreateEntityHandle(); + entity_t* pEDoor2 = (entity_t*)g_FuncTable.m_pfnCreateEntityHandle(); + + epair_t* epDoor11 = GetNextChainItem(NULL, "classname", "func_door"); + epair_t* epDoor21 = GetNextChainItem(NULL, "classname", "func_door"); + + epair_t* epDoor12; + epair_t* epDoor22; if(direction == 0) { - Node_getEntity(pEDoor1)->setKeyValue("angle", "180"); - Node_getEntity(pEDoor2)->setKeyValue("angle", "360"); + epDoor12 = GetNextChainItem(epDoor11, "angle", "180"); + epDoor22 = GetNextChainItem(epDoor21, "angle", "360"); } else { - Node_getEntity(pEDoor1)->setKeyValue("angle", "270"); - Node_getEntity(pEDoor2)->setKeyValue("angle", "90"); + epDoor12 = GetNextChainItem(epDoor11, "angle", "270"); + epDoor22 = GetNextChainItem(epDoor21, "angle", "90"); } srand((unsigned)time(NULL)); char teamname[256]; sprintf(teamname, "t%i", rand()); - Node_getEntity(pEDoor1)->setKeyValue("team", teamname); - Node_getEntity(pEDoor2)->setKeyValue("team", teamname); + /*epair_t* epDoor13 = */ GetNextChainItem(epDoor12, "team", teamname); + /*epair_t* epDoor23 = */ GetNextChainItem(epDoor22, "team", teamname); - Node_getTraversable(pEDoor1)->insert(newBrush1); - Node_getTraversable(pEDoor2)->insert(newBrush2); + g_FuncTable.m_pfnCommitBrushHandleToEntity(newBrush1, pEDoor1); + g_FuncTable.m_pfnCommitBrushHandleToEntity(newBrush2, pEDoor2); - Node_getTraversable(GlobalSceneGraph().root())->insert(pEDoor1); - Node_getTraversable(GlobalSceneGraph().root())->insert(pEDoor2); + g_EntityTable.m_pfnSetEntityKeyValList(pEDoor1, epDoor11); + g_EntityTable.m_pfnSetEntityKeyValList(pEDoor2, epDoor21); + + g_FuncTable.m_pfnCommitEntityHandleToMap(pEDoor1); + g_FuncTable.m_pfnCommitEntityHandleToMap(pEDoor2); // ResetCurrentTexture(); } @@ -576,12 +571,13 @@ void BuildDoorsX2(vec3_t min, vec3_t max, void MakeBevel(vec3_t vMin, vec3_t vMax) { - NodeSmartReference patch(GlobalPatchCreator().createPatch()); - PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch); + int nIndex = g_FuncTable.m_pfnCreatePatchHandle(); + //$ FIXME: m_pfnGetPatchHandle + patchMesh_t* pm = g_FuncTable.m_pfnGetPatchData(nIndex); + + pm->height = 3; + pm->width = 3; - GlobalPatchCreator().Patch_setShader(patch, "textures/common/caulk"); - GlobalPatchCreator().Patch_resize(patch, 3, 3); - vec3_t x_3, y_3, z_3; x_3[0] = vMin[0]; x_3[1] = vMin[0]; x_3[2] = vMax[0]; y_3[0] = vMin[1]; y_3[1] = vMax[1]; y_3[2] = vMax[1]; @@ -595,13 +591,14 @@ void MakeBevel(vec3_t vMin, vec3_t vMax) { for(int j = 0; j < 3; j++) { - matrix(i, j).m_vertex[0] = x_3[i]; - matrix(i, j).m_vertex[1] = y_3[i]; - matrix(i, j).m_vertex[2] = z_3[j]; + pm->ctrl[i][j].xyz[0] = x_3[i]; + pm->ctrl[i][j].xyz[1] = y_3[i]; + pm->ctrl[i][j].xyz[2] = z_3[j]; } } - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(patch); + + g_FuncTable.m_pfnCommitPatchHandleToMap(nIndex, pm, "textures/common/caulk"); } void BuildCornerStairs(vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTexture, const char* riserTex) @@ -609,7 +606,7 @@ void BuildCornerStairs(vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTex vec3_t* topPoints = new vec3_t[nSteps+1]; vec3_t* botPoints = new vec3_t[nSteps+1]; - bool bFacesUse[6] = {true, true, false, true, false, false}; + bool bFacesUse[6] = {TRUE, TRUE, FALSE, TRUE, FALSE, FALSE}; vec3_t centre; VectorCopy(vMin, centre); @@ -644,17 +641,17 @@ void BuildCornerStairs(vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTex for(i = 0; i < nSteps; i++) { - scene::Node& brush = Build_Get_BoundingCube_Selective(vBot, vTop, "textures/common/caulk", bFacesUse); + brush_t* brush = Build_Get_BoundingCube_Selective(vBot, vTop, "textures/common/caulk", bFacesUse); for(int j = 0; j < 3; j++) tp[j][2] = vTop[2]; - AddFaceWithTexture(brush, tp[2], tp[1], tp[0], mainTexture, false); + AddFaceWithTexture(brush, tp[2], tp[1], tp[0], mainTexture, FALSE); - AddFaceWithTexture(brush, centre, botPoints[i+1], topPoints[i+1], "textures/common/caulk", false); - AddFaceWithTexture(brush, centre, topPoints[i], botPoints[i], riserTex, false); + AddFaceWithTexture(brush, centre, botPoints[i+1], topPoints[i+1], "textures/common/caulk", FALSE); + AddFaceWithTexture(brush, centre, topPoints[i], botPoints[i], riserTex, FALSE); - Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(brush); + g_FuncTable.m_pfnCommitBrushHandle(brush); vTop[2] += height; vBot[2] += height; diff --git a/contrib/bobtoolz/shapes.h b/contrib/bobtoolz/shapes.h index 0fa92659..46eae37a 100644 --- a/contrib/bobtoolz/shapes.h +++ b/contrib/bobtoolz/shapes.h @@ -26,15 +26,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // defines for polygon stuff #define MAX_POLYGON_FACES 128 -namespace scene -{ - class Node; -} - -#include "mathlib.h" - // generic (detail added 12/01/01, for AC+) -void AddFaceWithTexture(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool detail); +void AddFaceWithTexture(brush_t* brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool detail); // ------------- // ---caulked--- diff --git a/contrib/bobtoolz/visfind.cpp b/contrib/bobtoolz/visfind.cpp index e5b890b1..6a54ab44 100644 --- a/contrib/bobtoolz/visfind.cpp +++ b/contrib/bobtoolz/visfind.cpp @@ -2,13 +2,11 @@ // Date: Oct 5, 2001 // Written by: Brad Whitehead (whiteheb@gamerstv.net) -#include "visfind.h" +#include "StdAfx.h" #include "dialogs/dialogs-gtk.h" #include "DWinding.h" #include "bsploader.h" -#include - typedef struct { int portalclusters; int leafbytes; //leafbytes = ((portalclusters+63)&~63)>>3; @@ -122,7 +120,7 @@ int bsp_countclusters_mask(byte *bitvector, byte *maskvector, int length) return(c); } -void AddCluster(std::list *pointlist, dleaf_t *cl, bool* repeatlist, vec3_t clr) +void AddCluster(list *pointlist, dleaf_t *cl, qboolean* repeatlist, vec3_t clr) { DWinding* w; @@ -138,7 +136,7 @@ void AddCluster(std::list *pointlist, dleaf_t *cl, bool* repeatlist, qdrawVert_t* vert = &drawVerts[surf->firstVert]; if(surf->firstVert + surf->numVerts > numDrawVerts) - DoMessageBox("Warning", "Warning", eMB_OK); + DoMessageBox("Warning", "Warning", MB_OK); w = new DWinding(); w->AllocWinding(surf->numVerts); @@ -164,12 +162,12 @@ void AddCluster(std::list *pointlist, dleaf_t *cl, bool* repeatlist, CreateTrace ============= */ -std::list *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *visdata, byte *seen ) +list *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *visdata, byte *seen ) { byte *vis; int i, j, clusterNum; - std::list *pointlist = new std::list; - bool* repeatlist = new bool[numDrawSurfaces]; + list *pointlist = new list; + qboolean* repeatlist = new qboolean[numDrawSurfaces]; dleaf_t *cl; vec3_t clrRnd[5] = { @@ -182,7 +180,7 @@ std::list *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byt vec3_t clrGreen = {0.f, 1.f, 0.f}; - memset(repeatlist, 0, sizeof(bool)*numDrawSurfaces); + memset(repeatlist, 0, sizeof(qboolean)*numDrawSurfaces); vis = visdata + ( c * header->leafbytes ); @@ -214,7 +212,7 @@ TraceCluster setup for CreateTrace ============= */ -std::list *TraceCluster (int leafnum) +list *TraceCluster (int leafnum) { byte seen[(MAX_MAP_LEAFS/8) + 1]; vis_header *vheader; @@ -232,14 +230,14 @@ std::list *TraceCluster (int leafnum) return CreateTrace(leaf, leaf->cluster, vheader, visdata, seen); } -std::list* BuildTrace(char* filename, vec3_t v_origin) +list* BuildTrace(char* filename, vec3_t v_origin) { if(!LoadBSPFile(filename)) return NULL; int leafnum = bsp_leafnumfororigin(v_origin); - std::list *pointlist = TraceCluster(leafnum); + list *pointlist = TraceCluster(leafnum); FreeBSPData(); diff --git a/contrib/bobtoolz/visfind.h b/contrib/bobtoolz/visfind.h index 3476d864..0a4b601e 100644 --- a/contrib/bobtoolz/visfind.h +++ b/contrib/bobtoolz/visfind.h @@ -1,7 +1 @@ - -#include -#include "mathlib.h" - -class DWinding; - -std::list *BuildTrace(char* filename, vec3_t v_origin); +list *BuildTrace(char* filename, vec3_t v_origin); diff --git a/contrib/brushexport/brushexport.def b/contrib/brushexport/brushexport.def deleted file mode 100644 index 44d97f3f..00000000 --- a/contrib/brushexport/brushexport.def +++ /dev/null @@ -1,7 +0,0 @@ -; brushexport.def : Declares the module parameters for the DLL. - -LIBRARY "BRUSHEXPORT" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/contrib/brushexport/brushexport.vcproj b/contrib/brushexport/brushexport.vcproj deleted file mode 100644 index 23e77444..00000000 --- a/contrib/brushexport/brushexport.vcproj +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/brushexport/callbacks.cpp b/contrib/brushexport/callbacks.cpp deleted file mode 100644 index ab6396ee..00000000 --- a/contrib/brushexport/callbacks.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include - -#include "qerplugin.h" -#include "debugging/debugging.h" -#include "support.h" -#include "export.h" - -// stuff from interface.cpp -void DestroyWindow(); - - -namespace callbacks { - -void OnDestroy(GtkWidget* w, gpointer data) -{ - DestroyWindow(); -} - -void OnExportClicked(GtkButton* button, gpointer user_data) -{ - GtkWidget* window = lookup_widget(GTK_WIDGET(button), "w_plugplug2"); - ASSERT_NOTNULL(window); - const char* cpath = GlobalRadiant().m_pfnFileDialog(window, false, "Save as Obj", 0, 0); - if(!cpath) - return; - - std::string path(cpath); - - // get ignore list from ui - std::set ignore; - - GtkTreeView* view = GTK_TREE_VIEW(lookup_widget(GTK_WIDGET(button), "t_materialist")); - GtkListStore* list = GTK_LIST_STORE(gtk_tree_view_get_model(view)); - - GtkTreeIter iter; - gboolean valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list), &iter); - while(valid) - { - gchar* data; - gtk_tree_model_get(GTK_TREE_MODEL(list), &iter, 0, &data, -1); - globalOutputStream() << data << "\n"; - ignore.insert(std::string(data)); - g_free(data); - valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(list), &iter); - } - - for(std::set::iterator it(ignore.begin()); it != ignore.end(); ++it) - globalOutputStream() << it->c_str() << "\n"; - - // collapse mode - collapsemode mode = COLLAPSE_NONE; - - GtkWidget* radio = lookup_widget(GTK_WIDGET(button), "r_collapse"); - ASSERT_NOTNULL(radio); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio))) - mode = COLLAPSE_ALL; - else - { - radio = lookup_widget(GTK_WIDGET(button), "r_collapsebymaterial"); - ASSERT_NOTNULL(radio); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio))) - mode = COLLAPSE_BY_MATERIAL; - else - { - radio = lookup_widget(GTK_WIDGET(button), "r_nocollapse"); - ASSERT_NOTNULL(radio); - ASSERT_NOTNULL(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio))); - mode = COLLAPSE_NONE; - } - } - - // export materials? - GtkWidget* toggle = lookup_widget(GTK_WIDGET(button), "t_exportmaterials"); - ASSERT_NOTNULL(toggle); - - bool exportmat = FALSE; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle))) - exportmat = TRUE; - - // limit material names? - toggle = lookup_widget(GTK_WIDGET(button), "t_limitmatnames"); - ASSERT_NOTNULL(toggle); - - bool limitMatNames = FALSE; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)) && exportmat) - limitMatNames = TRUE; - - // create objects instead of groups? - toggle = lookup_widget(GTK_WIDGET(button), "t_objects"); - ASSERT_NOTNULL(toggle); - - bool objects = FALSE; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)) && exportmat) - objects = TRUE; - - // export - ExportSelection(ignore, mode, exportmat, path, limitMatNames, objects); -} - -void OnAddMaterial(GtkButton* button, gpointer user_data) -{ - GtkEntry* edit = GTK_ENTRY(lookup_widget(GTK_WIDGET(button), "ed_materialname")); - ASSERT_NOTNULL(edit); - - const gchar* name = gtk_entry_get_text(edit); - if(g_utf8_strlen(name, -1) > 0) - { - GtkListStore* list = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(lookup_widget(GTK_WIDGET(button), "t_materialist")))); - GtkTreeIter iter; - gtk_list_store_append(list, &iter); - gtk_list_store_set(list, &iter, 0, name, -1); - gtk_entry_set_text(edit, ""); - } -} - -void OnRemoveMaterial(GtkButton* button, gpointer user_data) -{ - GtkTreeView* view = GTK_TREE_VIEW(lookup_widget(GTK_WIDGET(button), "t_materialist")); - GtkListStore* list = GTK_LIST_STORE(gtk_tree_view_get_model(view)); - GtkTreeSelection* sel = gtk_tree_view_get_selection(view); - - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(sel, 0, &iter)) - gtk_list_store_remove(list, &iter); -} - -void OnExportMatClicked(GtkButton* button, gpointer user_data) -{ - GtkWidget* toggleLimit = lookup_widget(GTK_WIDGET(button), "t_limitmatnames"); - GtkWidget* toggleObject = lookup_widget(GTK_WIDGET(button), "t_objects"); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) - { - gtk_widget_set_sensitive(GTK_WIDGET(toggleLimit), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(toggleObject), TRUE); - } else { - gtk_widget_set_sensitive(GTK_WIDGET(toggleLimit), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(toggleObject), FALSE); - } -} - -}// callbacks diff --git a/contrib/brushexport/callbacks.h b/contrib/brushexport/callbacks.h deleted file mode 100644 index 9bf95684..00000000 --- a/contrib/brushexport/callbacks.h +++ /dev/null @@ -1,12 +0,0 @@ -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkButton GtkButton; - -namespace callbacks { - -void OnDestroy(GtkWidget*, gpointer); -void OnExportClicked(GtkButton*, gpointer); -void OnAddMaterial(GtkButton*, gpointer); -void OnRemoveMaterial(GtkButton*, gpointer); -void OnExportMatClicked(GtkButton* button, gpointer); - -}// callbacks diff --git a/contrib/brushexport/export.cpp b/contrib/brushexport/export.cpp deleted file mode 100644 index a0964fbb..00000000 --- a/contrib/brushexport/export.cpp +++ /dev/null @@ -1,373 +0,0 @@ -#include "export.h" -#include "debugging/debugging.h" -#include "ibrush.h" -#include "iscenegraph.h" -#include "iselection.h" -#include "stream/stringstream.h" -#include "stream/textfilestream.h" - -#include - -// this is very evil, but right now there is no better way -#include "../../radiant/brush.h" - -/* - Abstract baseclass for modelexporters - the class collects all the data which then gets - exported through the WriteToFile method. -*/ -class ExportData -{ -public: - ExportData(const std::set& ignorelist, collapsemode mode, bool limNames, bool objs); - virtual ~ExportData(void); - - virtual void BeginBrush(Brush& b); - virtual void AddBrushFace(Face& f); - virtual void EndBrush(void); - - virtual bool WriteToFile(const std::string& path, collapsemode mode) const = 0; - -protected: - - // a group of faces - class group - { - public: - std::string name; - std::list faces; - }; - - std::list groups; - -private: - - // "textures/common/caulk" -> "caulk" - void GetShaderNameFromShaderPath(const char* path, std::string& name); - - group* current; - collapsemode mode; - const std::set& ignorelist; -}; - -ExportData::ExportData(const std::set& _ignorelist, collapsemode _mode, bool _limNames, bool _objs) - : mode(_mode), - ignorelist(_ignorelist) -{ - current = 0; - - // in this mode, we need just one group - if(mode == COLLAPSE_ALL) - { - groups.push_back(group()); - current = &groups.back(); - current->name = "all"; - } -} - -ExportData::~ExportData(void) -{ - -} - -void ExportData::BeginBrush(Brush& b) -{ - // create a new group for each brush - if(mode == COLLAPSE_NONE) - { - groups.push_back(group()); - current = &groups.back(); - - StringOutputStream str(256); - str << "Brush" << (const unsigned int)groups.size(); - current->name = str.c_str(); - } -} - -void ExportData::EndBrush(void) -{ - // all faces of this brush were on the ignorelist, discard the emptygroup - if(mode == COLLAPSE_NONE) - { - ASSERT_NOTNULL(current); - if(current->faces.empty()) - { - groups.pop_back(); - current = 0; - } - } -} - -void ExportData::AddBrushFace(Face& f) -{ - std::string shadername; - GetShaderNameFromShaderPath(f.GetShader(), shadername); - - // ignore faces from ignore list - if(ignorelist.find(shadername) != ignorelist.end()) - return; - - if(mode == COLLAPSE_BY_MATERIAL) - { - // find a group for this material - current = 0; - const std::list::iterator end(groups.end()); - for(std::list::iterator it(groups.begin()); it != end; ++it) - { - if(it->name == shadername) - current = &(*it); - } - - // no group found, create one - if(!current) - { - groups.push_back(group()); - current = &groups.back(); - current->name = shadername; - } - } - - ASSERT_NOTNULL(current); - - // add face to current group - current->faces.push_back(&f); - -#ifdef _DEBUG - globalOutputStream() << "Added Face to group " << current->name.c_str() << "\n"; -#endif -} - -void ExportData::GetShaderNameFromShaderPath(const char* path, std::string& name) -{ - std::string tmp(path); - - size_t last_slash = tmp.find_last_of("/"); - - if(last_slash != std::string::npos && last_slash == (tmp.length() - 1)) - name = path; - else - name = tmp.substr(last_slash + 1, tmp.length() - last_slash); - -#ifdef _DEBUG - globalOutputStream() << "Last: " << last_slash << " " << "length: " << (const unsigned int)tmp.length() << "Name: " << name.c_str() << "\n"; -#endif -} - -/* - Exporter writing facedata as wavefront object -*/ -class ExportDataAsWavefront : public ExportData -{ -private: - bool expmat; - bool limNames; - bool objs; - -public: - ExportDataAsWavefront(const std::set& _ignorelist, collapsemode _mode, bool _expmat, bool _limNames, bool _objs) - : ExportData(_ignorelist, _mode, _limNames, _objs) - { - expmat = _expmat; - limNames = _limNames; - objs = _objs; - } - - bool WriteToFile(const std::string& path, collapsemode mode) const; -}; - -bool ExportDataAsWavefront::WriteToFile(const std::string& path, collapsemode mode) const -{ - std::string objFile = path.substr(0, path.length() -4) + ".obj"; - std::string mtlFile = path.substr(0, path.length() -4) + ".mtl"; - - std::set materials; - - TextFileOutputStream out(objFile.c_str()); - - if(out.failed()) - { - globalErrorStream() << "Unable to open file\n"; - return false; - } - - out << "# Wavefront Objectfile exported with radiants brushexport plugin 3.0 by Thomas 'namespace' Nitschke, spam@codecreator.net\n\n"; - - if(expmat) - { - size_t last = mtlFile.find_last_of("//"); - std::string mtllib = mtlFile.substr(last + 1, mtlFile.size() - last).c_str(); - out << "mtllib " << mtllib.c_str() << "\n"; - } - - unsigned int vertex_count = 0; - - const std::list::const_iterator gend(groups.end()); - for(std::list::const_iterator git(groups.begin()); git != gend; ++git) - { - typedef std::multimap bm; - bm brushMaterials; - typedef std::pair String_Pair; - - const std::list::const_iterator end(git->faces.end()); - - // submesh starts here - if(objs) - { - out << "\no "; - } else { - out << "\ng "; - } - out << git->name.c_str() << "\n"; - - // material - if(expmat && mode == COLLAPSE_ALL) - { - out << "usemtl material" << "\n\n"; - materials.insert("material"); - } - - for(std::list::const_iterator it(git->faces.begin()); it != end; ++it) - { - const Winding& w((*it)->getWinding()); - - // vertices - for(size_t i = 0; i < w.numpoints; ++i) - out << "v " << FloatFormat(w[i].vertex.x(), 1, 6) << " " << FloatFormat(w[i].vertex.z(), 1, 6) << " " << FloatFormat(w[i].vertex.y(), 1, 6) << "\n"; - } - out << "\n"; - - for(std::list::const_iterator it(git->faces.begin()); it != end; ++it) - { - const Winding& w((*it)->getWinding()); - - // texcoords - for(size_t i = 0; i < w.numpoints; ++i) - out << "vt " << FloatFormat(w[i].texcoord.x(), 1, 6) << " " << FloatFormat(w[i].texcoord.y(), 1, 6) << "\n"; - } - - for(std::list::const_iterator it(git->faces.begin()); it != end; ++it) - { - const Winding& w((*it)->getWinding()); - - // faces - StringOutputStream faceLine(256); - faceLine << "\nf"; - for(size_t i = 0; i < w.numpoints; ++i, ++vertex_count) - { - faceLine << " " << vertex_count+1 << "/" << vertex_count+1; - } - - if(mode != COLLAPSE_ALL) - { - materials.insert((*it)->getShader().getShader()); - brushMaterials.insert(String_Pair((*it)->getShader().getShader(), faceLine.c_str())); - } else { - out << faceLine.c_str(); - } - } - - if(mode != COLLAPSE_ALL) - { - std::string lastMat; - std::string mat; - std::string faces; - - for(bm::iterator iter = brushMaterials.begin(); iter != brushMaterials.end(); iter++) - { - mat = (*iter).first.c_str(); - faces = (*iter).second.c_str(); - - if(mat != lastMat) - { - if(limNames && mat.size() > 20) - { - out << "\nusemtl " << mat.substr(mat.size() - 20, mat.size()).c_str(); - } else { - out << "\nusemtl " << mat.c_str(); - } - } - - out << faces.c_str(); - lastMat = mat; - } - } - - out << "\n"; - } - - if(expmat) - { - TextFileOutputStream outMtl(mtlFile.c_str()); - if(outMtl.failed()) - { - globalErrorStream() << "Unable to open material file\n"; - return false; - } - - outMtl << "# Wavefront material file exported with GtkRadiants brushexport plugin.\n"; - outMtl << "# Material Count: " << (const Unsigned)materials.size() << "\n\n"; - for(std::set::const_iterator it(materials.begin()); it != materials.end(); ++it) - { - if(limNames && it->size() > 20) - { - outMtl << "newmtl " << it->substr(it->size() - 20, it->size()).c_str() << "\n"; - } else { - outMtl << "newmtl " << it->c_str() << "\n"; - } - } - } - - return true; -} - - -class ForEachFace : public BrushVisitor -{ -public: - ForEachFace(ExportData& _exporter) - : exporter(_exporter) - {} - - void visit(Face& face) const - { - exporter.AddBrushFace(face); - } - -private: - ExportData& exporter; -}; - -class ForEachSelected : public SelectionSystem::Visitor -{ -public: - ForEachSelected(ExportData& _exporter) - : exporter(_exporter) - {} - - void visit(scene::Instance& instance) const - { - BrushInstance* bptr = InstanceTypeCast::cast(instance); - if(bptr) - { - Brush& brush(bptr->getBrush()); - - exporter.BeginBrush(brush); - ForEachFace face_vis(exporter); - brush.forEachFace(face_vis); - exporter.EndBrush(); - } - } - -private: - ExportData& exporter; -}; - -bool ExportSelection(const std::set& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limNames, bool objs) -{ - ExportDataAsWavefront exporter(ignorelist, m, exmat, limNames, objs); - - ForEachSelected vis(exporter); - GlobalSelectionSystem().foreachSelected(vis); - - return exporter.WriteToFile(path, m); -} diff --git a/contrib/brushexport/export.h b/contrib/brushexport/export.h deleted file mode 100644 index 3482bbed..00000000 --- a/contrib/brushexport/export.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef EXPORT_H -#define EXPORT_H -#include -#include - -enum collapsemode -{ - COLLAPSE_ALL, - COLLAPSE_BY_MATERIAL, - COLLAPSE_NONE -}; - -bool ExportSelection(const std::set& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limitMatNames, bool objects); - -#endif diff --git a/contrib/brushexport/interface.cpp b/contrib/brushexport/interface.cpp deleted file mode 100644 index 6525e201..00000000 --- a/contrib/brushexport/interface.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include -#include - -#include "debugging/debugging.h" -#include "callbacks.h" -#include "support.h" - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -// created by glade -GtkWidget* -create_w_plugplug2 (void) -{ - GtkWidget *w_plugplug2; - GtkWidget *vbox1; - GtkWidget *hbox2; - GtkWidget *vbox4; - GtkWidget *r_collapse; - GSList *r_collapse_group = NULL; - GtkWidget *r_collapsebymaterial; - GtkWidget *r_nocollapse; - GtkWidget *vbox3; - GtkWidget *b_export; - GtkWidget *b_close; - GtkWidget *vbox2; - GtkWidget *label1; - GtkWidget *scrolledwindow1; - GtkWidget *t_materialist; - GtkWidget *ed_materialname; - GtkWidget *hbox1; - GtkWidget *b_addmaterial; - GtkWidget *b_removematerial; - GtkWidget *t_exportmaterials; - GtkWidget *t_limitmatnames; - GtkWidget *t_objects; - GtkTooltips *tooltips; - - tooltips = gtk_tooltips_new(); - - w_plugplug2 = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (w_plugplug2, "w_plugplug2"); - gtk_window_set_title (GTK_WINDOW (w_plugplug2), "BrushExport-Plugin 3.0 by namespace"); - gtk_window_set_position (GTK_WINDOW (w_plugplug2), GTK_WIN_POS_CENTER); - gtk_window_set_destroy_with_parent (GTK_WINDOW (w_plugplug2), TRUE); - - vbox1 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox1, "vbox1"); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (w_plugplug2), vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5); - - hbox2 = gtk_hbox_new (TRUE, 5); - gtk_widget_set_name (hbox2, "hbox2"); - gtk_widget_show (hbox2); - gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbox2), 5); - - vbox4 = gtk_vbox_new (TRUE, 0); - gtk_widget_set_name (vbox4, "vbox4"); - gtk_widget_show (vbox4); - gtk_box_pack_start (GTK_BOX (hbox2), vbox4, TRUE, FALSE, 0); - - r_collapse = gtk_radio_button_new_with_mnemonic (NULL, "Collapse mesh"); - gtk_widget_set_name (r_collapse, "r_collapse"); - gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), r_collapse, "Collapse all brushes into a single group", "Collapse all brushes into a single group"); - gtk_widget_show (r_collapse); - gtk_box_pack_start (GTK_BOX (vbox4), r_collapse, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (r_collapse), r_collapse_group); - r_collapse_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (r_collapse)); - - r_collapsebymaterial = gtk_radio_button_new_with_mnemonic (NULL, "Collapse by material"); - gtk_widget_set_name (r_collapsebymaterial, "r_collapsebymaterial"); - gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), r_collapsebymaterial, "Collapse into groups by material", "Collapse into groups by material"); - gtk_widget_show (r_collapsebymaterial); - gtk_box_pack_start (GTK_BOX (vbox4), r_collapsebymaterial, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (r_collapsebymaterial), r_collapse_group); - r_collapse_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (r_collapsebymaterial)); - - r_nocollapse = gtk_radio_button_new_with_mnemonic (NULL, "Don't collapse"); - gtk_widget_set_name (r_nocollapse, "r_nocollapse"); - gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), r_nocollapse, "Every brush is stored in its own group", "Every brush is stored in its own group"); - gtk_widget_show (r_nocollapse); - gtk_box_pack_start (GTK_BOX (vbox4), r_nocollapse, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (r_nocollapse), r_collapse_group); - r_collapse_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (r_nocollapse)); - - vbox3 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox3, "vbox3"); - gtk_widget_show (vbox3); - gtk_box_pack_start (GTK_BOX (hbox2), vbox3, FALSE, FALSE, 0); - - b_export = gtk_button_new_from_stock ("gtk-save"); - gtk_widget_set_name (b_export, "b_export"); - gtk_widget_show (b_export); - gtk_box_pack_start (GTK_BOX (vbox3), b_export, TRUE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (b_export), 5); - - b_close = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (b_close, "b_close"); - gtk_widget_show (b_close); - gtk_box_pack_start (GTK_BOX (vbox3), b_close, TRUE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (b_close), 5); - - vbox2 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox2, "vbox2"); - gtk_widget_show (vbox2); - gtk_box_pack_start (GTK_BOX (vbox1), vbox2, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2); - - label1 = gtk_label_new ("Ignored materials:"); - gtk_widget_set_name (label1, "label1"); - gtk_widget_show (label1); - gtk_box_pack_start (GTK_BOX (vbox2), label1, FALSE, FALSE, 0); - - scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); - gtk_widget_show (scrolledwindow1); - gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); - - t_materialist = gtk_tree_view_new (); - gtk_widget_set_name (t_materialist, "t_materialist"); - gtk_widget_show (t_materialist); - gtk_container_add (GTK_CONTAINER (scrolledwindow1), t_materialist); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (t_materialist), FALSE); - gtk_tree_view_set_enable_search (GTK_TREE_VIEW (t_materialist), FALSE); - - ed_materialname = gtk_entry_new (); - gtk_widget_set_name (ed_materialname, "ed_materialname"); - gtk_widget_show (ed_materialname); - gtk_box_pack_start (GTK_BOX (vbox2), ed_materialname, FALSE, FALSE, 0); - - hbox1 = gtk_hbox_new (TRUE, 0); - gtk_widget_set_name (hbox1, "hbox1"); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); - - b_addmaterial = gtk_button_new_from_stock ("gtk-add"); - gtk_widget_set_name (b_addmaterial, "b_addmaterial"); - gtk_widget_show (b_addmaterial); - gtk_box_pack_start (GTK_BOX (hbox1), b_addmaterial, FALSE, FALSE, 0); - - b_removematerial = gtk_button_new_from_stock ("gtk-remove"); - gtk_widget_set_name (b_removematerial, "b_removematerial"); - gtk_widget_show (b_removematerial); - gtk_box_pack_start (GTK_BOX (hbox1), b_removematerial, FALSE, FALSE, 0); - - t_limitmatnames = gtk_check_button_new_with_mnemonic ("Use short material names (max. 20 chars)"); - gtk_widget_set_name (t_limitmatnames, "t_limitmatnames"); - gtk_widget_show (t_limitmatnames); - gtk_box_pack_end (GTK_BOX (vbox2), t_limitmatnames, FALSE, FALSE, 0); - - t_objects = gtk_check_button_new_with_mnemonic ("Create (o)bjects instead of (g)roups"); - gtk_widget_set_name (t_objects, "t_objects"); - gtk_widget_show (t_objects); - gtk_box_pack_end (GTK_BOX (vbox2), t_objects, FALSE, FALSE, 0); - - t_exportmaterials = gtk_check_button_new_with_mnemonic ("Create material information (.mtl file)"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t_exportmaterials), true); - gtk_widget_set_name (t_exportmaterials, "t_exportmaterials"); - gtk_widget_show (t_exportmaterials); - gtk_box_pack_end (GTK_BOX (vbox2), t_exportmaterials, FALSE, FALSE, 10); - - using namespace callbacks; - g_signal_connect(G_OBJECT(w_plugplug2), "destroy", G_CALLBACK(OnDestroy), NULL); - g_signal_connect_swapped(G_OBJECT(b_close), "clicked", G_CALLBACK (OnDestroy), NULL); - - g_signal_connect ((gpointer) b_export, "clicked", G_CALLBACK (OnExportClicked), NULL); - g_signal_connect ((gpointer) b_addmaterial, "clicked", G_CALLBACK (OnAddMaterial), NULL); - g_signal_connect ((gpointer) b_removematerial, "clicked", G_CALLBACK (OnRemoveMaterial), NULL); - g_signal_connect ((gpointer) t_exportmaterials, "clicked", G_CALLBACK (OnExportMatClicked), NULL); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (w_plugplug2, w_plugplug2, "w_plugplug2"); - GLADE_HOOKUP_OBJECT (w_plugplug2, vbox1, "vbox1"); - GLADE_HOOKUP_OBJECT (w_plugplug2, hbox2, "hbox2"); - GLADE_HOOKUP_OBJECT (w_plugplug2, vbox4, "vbox4"); - GLADE_HOOKUP_OBJECT (w_plugplug2, r_collapse, "r_collapse"); - GLADE_HOOKUP_OBJECT (w_plugplug2, r_collapsebymaterial, "r_collapsebymaterial"); - GLADE_HOOKUP_OBJECT (w_plugplug2, r_nocollapse, "r_nocollapse"); - GLADE_HOOKUP_OBJECT (w_plugplug2, vbox3, "vbox3"); - GLADE_HOOKUP_OBJECT (w_plugplug2, b_export, "b_export"); - GLADE_HOOKUP_OBJECT (w_plugplug2, b_close, "b_close"); - GLADE_HOOKUP_OBJECT (w_plugplug2, vbox2, "vbox2"); - GLADE_HOOKUP_OBJECT (w_plugplug2, label1, "label1"); - GLADE_HOOKUP_OBJECT (w_plugplug2, scrolledwindow1, "scrolledwindow1"); - GLADE_HOOKUP_OBJECT (w_plugplug2, t_materialist, "t_materialist"); - GLADE_HOOKUP_OBJECT (w_plugplug2, ed_materialname, "ed_materialname"); - GLADE_HOOKUP_OBJECT (w_plugplug2, hbox1, "hbox1"); - GLADE_HOOKUP_OBJECT (w_plugplug2, b_addmaterial, "b_addmaterial"); - GLADE_HOOKUP_OBJECT (w_plugplug2, b_removematerial, "b_removematerial"); - GLADE_HOOKUP_OBJECT (w_plugplug2, t_exportmaterials, "t_exportmaterials"); - GLADE_HOOKUP_OBJECT (w_plugplug2, t_limitmatnames, "t_limitmatnames"); - GLADE_HOOKUP_OBJECT (w_plugplug2, t_objects, "t_objects"); - - return w_plugplug2; -} - -// global main window, is 0 when not created -GtkWidget* g_brushexp_window = 0; - -// spawn plugin window (and make sure it got destroyed first or never created) -void CreateWindow(void) -{ - ASSERT_NOTNULL(!g_brushexp_window); - - GtkWidget* wnd = create_w_plugplug2(); - - // column & renderer - GtkTreeViewColumn* col = gtk_tree_view_column_new(); - gtk_tree_view_column_set_title(col, "materials"); - gtk_tree_view_append_column(GTK_TREE_VIEW(lookup_widget(wnd, "t_materialist")), col); - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(lookup_widget(wnd, "t_materialist")), -1, "", renderer, "text", 0, NULL); - - // list store - GtkListStore* ignorelist = gtk_list_store_new(1, G_TYPE_STRING); - gtk_tree_view_set_model(GTK_TREE_VIEW(lookup_widget(wnd, "t_materialist")), GTK_TREE_MODEL(ignorelist)); - g_object_unref(ignorelist); - - gtk_widget_show_all(wnd); - g_brushexp_window = wnd; -} - -void DestroyWindow(void) -{ - ASSERT_NOTNULL(g_brushexp_window); - gtk_widget_destroy(g_brushexp_window); - g_brushexp_window = 0; -} - -bool IsWindowOpen(void) -{ - return g_brushexp_window != 0; -} diff --git a/contrib/brushexport/plugin.cpp b/contrib/brushexport/plugin.cpp deleted file mode 100644 index 3b3fab09..00000000 --- a/contrib/brushexport/plugin.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -Copyright (C) 2006, Thomas Nitschke. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "plugin.h" - -#include "iplugin.h" -#include "qerplugin.h" - -#include -#include - -#include "debugging/debugging.h" -#include "string/string.h" -#include "modulesystem/singletonmodule.h" -#include "stream/textfilestream.h" -#include "stream/stringstream.h" -#include "gtkutil/messagebox.h" -#include "gtkutil/filechooser.h" - -#include "ibrush.h" -#include "iscenegraph.h" -#include "iselection.h" -#include "ifilesystem.h" -#include "ifiletypes.h" - -#include "support.h" - -#include "typesystem.h" - -void CreateWindow (void); -void DestroyWindow(void); -bool IsWindowOpen(void); - -namespace BrushExport -{ - GtkWindow* g_mainwnd; - - const char* init(void* hApp, void* pMainWidget) - { - g_mainwnd = (GtkWindow*)pMainWidget; - ASSERT_NOTNULL(g_mainwnd); - return ""; - } - const char* getName() - { - return "Brush export Plugin"; - } - const char* getCommandList() - { - return "Export selected as Wavefront Object;About"; - } - const char* getCommandTitleList() - { - return ""; - } - - void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) - { - if(string_equal(command, "About")) - { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_mainwnd), "Brushexport plugin v 2.0 by namespace (www.codecreator.net)\n" - "Enjoy!\n\nSend feedback to spam@codecreator.net", "About me...", - eMB_OK, - eMB_ICONDEFAULT); - } - else if(string_equal(command, "Export selected as Wavefront Object")) - { - if(IsWindowOpen()) - DestroyWindow(); - CreateWindow(); - } - } -} - -class BrushExportDependencies : - public GlobalRadiantModuleRef, - public GlobalFiletypesModuleRef, - public GlobalBrushModuleRef, - public GlobalFileSystemModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalSelectionModuleRef -{ -public: - BrushExportDependencies(void) - : GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")) - {} -}; - -class BrushExportModule : public TypeSystemRef -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "brushexport2"); - - BrushExportModule() - { - m_plugin.m_pfnQERPlug_Init = &BrushExport::init; - m_plugin.m_pfnQERPlug_GetName = &BrushExport::getName; - m_plugin.m_pfnQERPlug_GetCommandList = &BrushExport::getCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = &BrushExport::getCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = &BrushExport::dispatch; - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; - -typedef SingletonModule SingletonBrushExportModule; -SingletonBrushExportModule g_BrushExportModule; - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - g_BrushExportModule.selfRegister(); -} diff --git a/contrib/brushexport/plugin.h b/contrib/brushexport/plugin.h deleted file mode 100644 index 99396819..00000000 --- a/contrib/brushexport/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2006, Thomas Nitschke. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSH_EXPORT_H) -#define INCLUDED_BRUSH_EXPORT_H - -#endif diff --git a/contrib/brushexport/support.cpp b/contrib/brushexport/support.cpp deleted file mode 100644 index 2835b112..00000000 --- a/contrib/brushexport/support.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include "support.h" - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - - diff --git a/contrib/brushexport/support.h b/contrib/brushexport/support.h deleted file mode 100644 index 628885a5..00000000 --- a/contrib/brushexport/support.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - - diff --git a/contrib/camera/camera.cpp b/contrib/camera/camera.cpp index 48041dc0..dbad8085 100644 --- a/contrib/camera/camera.cpp +++ b/contrib/camera/camera.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -82,7 +82,9 @@ const char* QERPlug_Init(void* hApp, void* pMainWidget) if( g_pCameraInspectorWnd == NULL ) g_pCameraInspectorWnd = CreateCameraInspectorDialog(); - GetFileTypeRegistry()->addType("camera", "", filetype_t("Camera file", "*.camera")); + InitIglToQgl(&g_QglTable); + + GetFileTypeRegistry()->addType("camera", filetype_t("Camera file", "*.camera")); return "Camera for GtkRadiant"; } @@ -112,7 +114,7 @@ void QERPlug_Dispatch (const char* p, float* vMin, float* vMax, bool bSingleBrus else if( !strcmp( p, "Load Camera..." ) ) DoLoadCamera(); else if( !strcmp( p, "About..." ) ) - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, PLUGIN_ABOUT, "About", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, PLUGIN_ABOUT, "About", MB_OK, NULL ); } @@ -182,8 +184,13 @@ public: CSynapseServer* g_pSynapseServer = NULL; CameraSynapseClient g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); diff --git a/contrib/camera/camera.h b/contrib/camera/camera.h index 4416f796..cf1387c2 100644 --- a/contrib/camera/camera.h +++ b/contrib/camera/camera.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -27,31 +27,24 @@ Copyright (C) 2002 Splash Damage Ltd. #ifndef _CAMERA_H_ #define _CAMERA_H_ -typedef unsigned char byte; - -#include "mathlib.h" -#include -#include "qertypes.h" -#include - -#define USE_QERTABLE_DEFINE -#include "iscenegraph.h" -#include "qerplugin.h" - -#define USE_QGLTABLE_DEFINE -#include "igl.h" -extern _QERQglTable __QGLTABLENAME; - -#include "iui.h" -#include "icamera.h" - -#include "bytebool.h" +#ifdef _WIN32 + #pragma warning(disable : 4267) +#else + typedef unsigned char byte; +#endif class CCamera; + #include #include "str.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" + +#include "igl.h" +#include "iui.h" +#include "icamera.h" #include "misc.h" #include "dialogs.h" @@ -71,6 +64,12 @@ extern CListener *Listener; #define CAMERA_PLUGIN #define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]) +extern void ( APIENTRY * qglBegin )(GLenum mode); +extern void ( APIENTRY * qglEnd )(void); +extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v); + +extern "C" void InitIglToQgl( _QERQglTable *g_QglTable ); + #include "splines/splines.h" // this needs to match splines.cpp @@ -79,8 +78,6 @@ extern idCameraDef camera[MAX_CAMERAS]; extern "C" qboolean loadCamera(int camNum, const char *name); -#define PATH_MAX 260 - // // CCamera // diff --git a/contrib/camera/camera.vcproj b/contrib/camera/camera.vcproj index 6b039254..a63cbb7b 100644 --- a/contrib/camera/camera.vcproj +++ b/contrib/camera/camera.vcproj @@ -1,190 +1,89 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 40df284e..866afd17 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -66,8 +66,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ) { GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame; //, *name; GtkWidget *fixed, *interpolated, *spline; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; GSList *targetTypeRadio = NULL; // char buf[128]; @@ -134,7 +133,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); gtk_widget_show (w); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); @@ -142,9 +141,9 @@ static gint ci_new( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // -------------------------- // @@ -160,7 +159,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ) dialogError = FALSE; - if( ret == eIDOK ) { + if( ret == IDOK ) { if( gtk_toggle_button_get_active( (GtkToggleButton*)fixed ) ) DoNewFixedCamera(); else if( gtk_toggle_button_get_active( (GtkToggleButton*)interpolated ) ) @@ -357,8 +356,7 @@ static void RefreshEventList( void ) static gint ci_rename( GtkWidget *widget, gpointer data ) { GtkWidget *window, *w, *vbox, *hbox, *name; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; if( !GetCurrentCam() ) return TRUE; @@ -413,7 +411,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); gtk_widget_show (w); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); @@ -421,9 +419,9 @@ static gint ci_rename( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // -------------------------- // @@ -439,7 +437,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ) dialogError = FALSE; - if( ret == eIDOK ) { + if( ret == IDOK ) { const char *str = gtk_entry_get_text( GTK_ENTRY(name) ); if( str && str[0] ) { @@ -469,8 +467,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ) { GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame, *name; GtkWidget *fixed, *interpolated, *spline; - EMessageBoxReturn ret; - int loop = 1; + int ret, loop = 1; GSList *targetTypeRadio = NULL; char buf[128]; @@ -557,7 +554,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); gtk_widget_show (w); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); @@ -565,9 +562,9 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // -------------------------- // @@ -583,7 +580,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ) dialogError = FALSE; - if( ret == eIDOK ) { + if( ret == IDOK ) { const char *str = gtk_entry_get_text( GTK_ENTRY(name) ); if( str && str[0] ) { @@ -810,8 +807,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ) { GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame, *parameters; GtkWidget *eventWidget[EVENT_COUNT]; - EMessageBoxReturn ret; - int i, loop = 1; + int i, ret, loop = 1; GSList *eventTypeRadio = NULL; // char buf[128]; @@ -889,7 +885,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDOK)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); gtk_widget_show (w); GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT ); @@ -897,9 +893,9 @@ static gint ci_add( GtkWidget *widget, gpointer data ) w = gtk_button_new_with_label ("Cancel"); gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (eIDCANCEL)); + gtk_signal_connect (GTK_OBJECT (w), "clicked", GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); gtk_widget_show (w); - ret = eIDCANCEL; + ret = IDCANCEL; // -------------------------- // @@ -915,7 +911,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ) dialogError = FALSE; - if( ret == eIDOK ) { + if( ret == IDOK ) { const char *str = gtk_entry_get_text( GTK_ENTRY(parameters) ); if( !camEventFlags[i][0] || ( str && str[0] ) ) { diff --git a/contrib/camera/dialogs.h b/contrib/camera/dialogs.h index 4df27eae..93dbce1d 100644 --- a/contrib/camera/dialogs.h +++ b/contrib/camera/dialogs.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/camera/dialogs_common.cpp b/contrib/camera/dialogs_common.cpp index 43a4e70e..ed21f5b4 100644 --- a/contrib/camera/dialogs_common.cpp +++ b/contrib/camera/dialogs_common.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -36,7 +36,7 @@ void dialog_button_callback (GtkWidget *widget, gpointer data) ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = gpointer_to_int (data); + *ret = (int)data; } gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) diff --git a/contrib/camera/funchandlers.cpp b/contrib/camera/funchandlers.cpp index f958ad96..fafae2a6 100644 --- a/contrib/camera/funchandlers.cpp +++ b/contrib/camera/funchandlers.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -30,12 +30,10 @@ extern GtkWidget *g_pEditModeAddRadioButton; char* Q_realpath(const char *path, char *resolved_path, size_t size) { -#if defined(POSIX) +#if defined (__linux__) || defined (__APPLE__) return realpath(path, resolved_path); -#elif defined(WIN32) - return _fullpath(resolved_path, path, size); #else -#error "unsupported platform" + return _fullpath(resolved_path, path, size); #endif } @@ -67,7 +65,7 @@ static void DoNewCamera( idCameraPosition::positionType type ) if( !g_bEditOn ) DoStartEdit( GetCurrentCam() ); } else { - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "No free cameras available.", "Create Camera Error", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "No free cameras available.", "Create Camera Error", MB_OK, NULL ); } } @@ -104,7 +102,7 @@ void DoLoadCamera() char basepath[PATH_MAX]; if( firstCam && firstCam->HasBeenSaved() ) - ExtractFilePath( firstCam->GetFileName(), basepath ); + CAMERA_ExtractFilePath( firstCam->GetFileName(), basepath ); else strcpy( basepath, g_FuncTable.m_pfnGetGamePath() ); @@ -125,7 +123,7 @@ void DoLoadCamera() char error[PATH_MAX+64]; FreeCam( cam ); sprintf( error, "Camera file \'%s\' is already loaded", fullpathtofile ); - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Load error", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Load error", MB_OK, NULL ); //g_free( filename ); return; } @@ -142,12 +140,12 @@ void DoLoadCamera() char error[PATH_MAX+64]; FreeCam( cam ); sprintf( error, "An error occured during the loading of \'%s\'", fullpathtofile ); - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Load error", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Load error", MB_OK, NULL ); } //g_free( filename ); } else { - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "No free camera slots available", "Load error", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "No free camera slots available", "Load error", MB_OK, NULL ); } } } @@ -159,11 +157,11 @@ void DoSaveCamera() { return; if( GetCurrentCam()->GetFileName()[0] ) - ExtractFilePath( GetCurrentCam()->GetFileName(), basepath ); + CAMERA_ExtractFilePath( GetCurrentCam()->GetFileName(), basepath ); else strcpy( basepath, g_FuncTable.m_pfnGetGamePath() ); - const gchar *filename = g_FuncTable.m_pfnFileDialog( g_pRadiantWnd, FALSE, "Save Camera File", basepath, "camera"); + const gchar *filename = g_FuncTable.m_pfnFileDialog( (void *)g_pRadiantWnd, FALSE, "Save Camera File", basepath, "camera"); if( filename ) { char fullpathtofile[PATH_MAX + 8]; @@ -176,8 +174,9 @@ void DoSaveCamera() { strcat( fullpathtofile, ".camera" ); if( FileExists( fullpathtofile ) ) { - if( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "File already exists.\nOverwrite?", "Save Camera File", eMB_YESNO ) == eIDNO ) + if ( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, "File already exists.\nOverwrite?", "Save Camera File", MB_YESNO, NULL ) == IDNO ) { return; + } } } @@ -191,7 +190,7 @@ void DoSaveCamera() { } else if( !strcmp( fullpathtofile, checkCam->GetFileName() ) ) { char error[PATH_MAX+64]; sprintf( error, "Camera file \'%s\' is currently loaded by GtkRadiant.\nPlease select a different filename.", fullpathtofile ); - g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Save error", eMB_OK ); + g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, error, "Save error", MB_OK, NULL ); return; } checkCam = checkCam->GetNext(); @@ -212,13 +211,15 @@ void DoUnloadCamera() { if( !GetCurrentCam()->HasBeenSaved() ) { char buf[PATH_MAX+64]; sprintf( buf, "Do you want to save the changes for camera '%s'?", GetCurrentCam()->GetCam()->getName() ); - if( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, buf, "Warning", eMB_YESNO ) == eIDYES ) + if ( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, buf, "Warning", MB_YESNO, NULL ) == IDYES ) { DoSaveCamera(); + } } else if( GetCurrentCam()->HasBeenSaved() == 2 ) { char buf[PATH_MAX+64]; sprintf( buf, "Do you want to save the changes made to camera file '%s'?", GetCurrentCam()->GetFileName() ); - if( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, buf, "Warning", eMB_YESNO ) == eIDYES ) + if( g_FuncTable.m_pfnMessageBox( (GtkWidget *)g_pRadiantWnd, buf, "Warning", MB_YESNO, NULL ) == IDYES ) { DoSaveCamera(); + } } if( g_pCurrentEditCam ) { diff --git a/contrib/camera/funchandlers.h b/contrib/camera/funchandlers.h index 0c97f610..ee3b9274 100644 --- a/contrib/camera/funchandlers.h +++ b/contrib/camera/funchandlers.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/camera/listener.cpp b/contrib/camera/listener.cpp index f3169b8d..7e3d1b66 100644 --- a/contrib/camera/listener.cpp +++ b/contrib/camera/listener.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -61,7 +61,7 @@ void CListener::UnRegister() } } -bool CListener::OnMouseMove( unsigned int nFlags, double x, double y ) +bool CListener::OnMouseMove( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -100,7 +100,7 @@ bool CListener::OnMouseMove( unsigned int nFlags, double x, double y ) return false; } -bool CListener::OnLButtonDown( unsigned int nFlags, double x, double y ) +bool CListener::OnLButtonDown( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -178,7 +178,7 @@ bool CListener::OnLButtonDown( unsigned int nFlags, double x, double y ) //return false; } -bool CListener::OnLButtonUp( unsigned int nFlags, double x, double y ) +bool CListener::OnLButtonUp( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -197,7 +197,7 @@ bool CListener::OnLButtonUp( unsigned int nFlags, double x, double y ) return false; } -bool CListener::OnRButtonDown( unsigned int nFlags, double x, double y ) +bool CListener::OnRButtonDown( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -206,7 +206,7 @@ bool CListener::OnRButtonDown( unsigned int nFlags, double x, double y ) return false; } -bool CListener::OnRButtonUp( unsigned int nFlags, double x, double y ) +bool CListener::OnRButtonUp( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -215,7 +215,7 @@ bool CListener::OnRButtonUp( unsigned int nFlags, double x, double y ) return false; } -bool CListener::OnMButtonDown( unsigned int nFlags, double x, double y ) +bool CListener::OnMButtonDown( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); @@ -224,7 +224,7 @@ bool CListener::OnMButtonDown( unsigned int nFlags, double x, double y ) return false; } -bool CListener::OnMButtonUp( unsigned int nFlags, double x, double y ) +bool CListener::OnMButtonUp( guint32 nFlags, gdouble x, gdouble y ) { SetViewType( g_pXYWndWrapper->GetViewType() ); diff --git a/contrib/camera/listener.h b/contrib/camera/listener.h index 72bf1fdb..6519508f 100644 --- a/contrib/camera/listener.h +++ b/contrib/camera/listener.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/camera/misc.cpp b/contrib/camera/misc.cpp index 49148248..a279df06 100644 --- a/contrib/camera/misc.cpp +++ b/contrib/camera/misc.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -40,7 +40,7 @@ void Sys_ERROR( char* text, ... ) char* UnixToDosPath( char* path ) { -#ifndef WIN32 +#ifndef _WIN32 return path; #else for(char* p = path; *p; p++) @@ -52,7 +52,7 @@ char* UnixToDosPath( char* path ) #endif } -void ExtractFilePath( const char *path, char *dest ) +void CAMERA_ExtractFilePath( const char *path, char *dest ) { const char *src; @@ -70,10 +70,10 @@ void ExtractFilePath( const char *path, char *dest ) const char* ExtractFilename( const char* path ) { - char* p = strrchr(path, '/'); + char* p = (char *)strrchr(path, '/'); if(!p) { - p = strrchr(path, '\\'); + p = (char *)strrchr(path, '\\'); if(!p) return path; @@ -82,7 +82,7 @@ const char* ExtractFilename( const char* path ) } int Q_stricmp (const char *s1, const char *s2) { - return string_equal_nocase( s1, s2 ); + return stricmp( s1, s2 ); } /* @@ -162,7 +162,7 @@ void Com_Dealloc( void *ptr ) { // Filesystem // -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4311) #pragma warning(disable : 4312) #endif @@ -208,7 +208,7 @@ void FS_FreeFile( void *buffer ) { Com_Dealloc( buffer ); } -int FS_FOpenFileRead( const char *filename, fileHandle_t *file, bool uniqueFILE ) { +int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueFILE ) { FILE *fh; long len; diff --git a/contrib/camera/misc.h b/contrib/camera/misc.h index 913b7c4a..b5c06033 100644 --- a/contrib/camera/misc.h +++ b/contrib/camera/misc.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,13 +26,16 @@ Copyright (C) 2002 Splash Damage Ltd. void Sys_ERROR( char* text, ... ); char* UnixToDosPath( char* path ); -void ExtractFilePath( const char *path, char *dest ); +void CAMERA_ExtractFilePath( const char *path, char *dest ); const char* ExtractFilename( const char* path ); bool FileExists (const char *filename); int Q_stricmp (const char *s1, const char *s2); typedef int fileHandle_t; +#define qfalse false +#define qtrue true + extern "C" { // command buffer void Cbuf_AddText( const char *text ); @@ -40,7 +43,7 @@ void Cbuf_Execute (void); // common #ifndef CDECL -#ifdef WIN32 +#ifdef _WIN32 #define CDECL __cdecl #else #define CDECL @@ -58,12 +61,21 @@ int FS_Read( void *buffer, int len, fileHandle_t f ); int FS_Write( const void *buffer, int len, fileHandle_t h ); int FS_ReadFile( const char *qpath, void **buffer ); void FS_FreeFile( void *buffer ); -int FS_FOpenFileRead( const char *filename, fileHandle_t *file, bool uniqueFILE ); +int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueFILE ); fileHandle_t FS_FOpenFileWrite( const char *filename ); void FS_FCloseFile( fileHandle_t f ); } // vectors +#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]) +#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) +#define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) +#define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) + +#define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s)) +#define VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s)) +#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) + #define DotProduct4(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3]) #define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3]) #define VectorAdd4(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3]) @@ -71,6 +83,9 @@ void FS_FCloseFile( fileHandle_t f ); #define VectorScale4(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s)) #define VectorMA4(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s)) +#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) +#define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) +#define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z)) #define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) #define SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];} diff --git a/contrib/camera/renderer.cpp b/contrib/camera/renderer.cpp index 08e6664e..e4b9e38f 100644 --- a/contrib/camera/renderer.cpp +++ b/contrib/camera/renderer.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -96,7 +96,7 @@ void CRenderer::Draw3D() { if( g_iPreviewRunning ) { if( g_iPreviewRunning == 1 ) { - start = Q_QGetTickCount(); + start = g_FuncTable.m_pfnQGetTickCount(); GetCurrentCam()->GetCam()->startCamera( start ); cycle = GetCurrentCam()->GetCam()->getTotalTime(); msecs = (long)(cycle * 1000); @@ -111,7 +111,7 @@ void CRenderer::Draw3D() { GetCurrentCam()->GetCam()->getCameraInfo( current, &origin[0], &dir[0], &fov ); VectorSet( angles, asin (dir[2])*180/3.14159, atan2 (dir[1], dir[0])*180/3.14159, 0 ); g_CameraTable.m_pfnSetCamera( origin, angles ); - current = Q_QGetTickCount(); + current = g_FuncTable.m_pfnQGetTickCount(); } else { g_iPreviewRunning = 0; GetCurrentCam()->GetCam()->setRunning( false ); diff --git a/contrib/camera/renderer.h b/contrib/camera/renderer.h index c73d84d4..989567a1 100644 --- a/contrib/camera/renderer.h +++ b/contrib/camera/renderer.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/contrib/gtkgensurf/CHANGES b/contrib/gtkgensurf/CHANGES index 51510b6c..3d916c71 100644 --- a/contrib/gtkgensurf/CHANGES +++ b/contrib/gtkgensurf/CHANGES @@ -1,73 +1,73 @@ -05/14/2001 - ^Fishman -=============== -bitmap.cpp -Added Hydra's snap to grid code. -=============== -dec.cpp -Modified to support the new max size for the maps(Q3 1.27). -=============== -face.cpp -Modified to support the new max size for the maps(Q3 1.27). -=============== -font.cpp -Changed the fonts color to green, part of the new theme. -=============== -gendlgs.cpp -Added a label and textbox for the snap to grid feature. -Added a checkbox for adding terrain key to func_group. -Added a checkbox for antialiased lines in the preview window. -Modified a textbox to support the new max size for the maps(Q3 1.27). -Modified the About dialog. -=============== -genmap.cpp -Modified to support the new max size for the maps(Q3 1.27). -Added code for adding terrain key to func_group. -=============== -gensurf.cpp -Added code to save the settings of the antialiasing checkbox status and the terrain key checkbox status. -Modified version number. -=============== -view.cpp -Modified code for the new Green/Black theme. -Added code to antialiase lines in the preview window - -12/18/2000 - MrHyde -=============== -bitmap.cpp -Corrected a substitution error that would prevent code from reading a selected bitmap on the first pass, and possibly leave the bitmap file open. -Checks to ensure that main window has been created before updating the preview (which might be done if a bitmap filename was saved to ini file). Previous failure to do this resulted in Radiant console error messages. -=============== -gendlgs.cpp -One tooltip was goofed up ("preview" instead of "main_preview"), resulting in "invalid cast from (NULL) pointer to GtkObject" in Radiant console. -Tooltips - oops. Use wave_radios[] rather than string constants. -Moved check for game type from SetDlgValues to GenSurfInit in gensurf.cpp. Since the game type presumably won't change while GenSurf is active this only needs to be checked once (and if it IS possible to change the game while GenSurf is active then quite a bit more needs to be changed). -Worked around strange bug in SetDlgValues. In release dll (not debug), the 2nd pass through the set_sensitive loop for game_radios crashed. Since the state of those radio buttons won't ever change during a single session, the state is only set once now. Sure would like to know what's going on there, though. -=============== -view.cpp -Elevation and azimuth labels are right-justified. - -TODO: -Check out Fix Points on Voodoo2 again. Previous attempt caused entire preview to be redrawn when moving mouse (GL_SCISSOR_TEST failed?) - -12/17/2000 - MrHyde -- tooltips -- reformatted the source to use spaces instead of tabs -- fixes to update mechanism in bitmap tab - -12/13/2000 - MrHyde -=============== -gendlgs.cpp -In ReadDlgValues, reads wavelength, amplitude, and roughness text boxes (previously ignored). -In create_main_dialog, set a "focus_out_event" for the above and added a "value_changed" for RandomSeed. -In main_go, added call to WriteIni -=============== -gensurf.cpp -Set gszIni to "plugins/gensurf.ini" to get past assert error -ported WriteIni -=============== -view.cpp -In DrawPreview, changed 2 occurrences of GL_LINE_LOOP to GL_LINE_STRIP for patches +05/14/2001 + ^Fishman +=============== +bitmap.cpp +Added Hydra's snap to grid code. +=============== +dec.cpp +Modified to support the new max size for the maps(Q3 1.27). +=============== +face.cpp +Modified to support the new max size for the maps(Q3 1.27). +=============== +font.cpp +Changed the fonts color to green, part of the new theme. +=============== +gendlgs.cpp +Added a label and textbox for the snap to grid feature. +Added a checkbox for adding terrain key to func_group. +Added a checkbox for antialiased lines in the preview window. +Modified a textbox to support the new max size for the maps(Q3 1.27). +Modified the About dialog. +=============== +genmap.cpp +Modified to support the new max size for the maps(Q3 1.27). +Added code for adding terrain key to func_group. +=============== +gensurf.cpp +Added code to save the settings of the antialiasing checkbox status and the terrain key checkbox status. +Modified version number. +=============== +view.cpp +Modified code for the new Green/Black theme. +Added code to antialiase lines in the preview window + +12/18/2000 + MrHyde +=============== +bitmap.cpp +Corrected a substitution error that would prevent code from reading a selected bitmap on the first pass, and possibly leave the bitmap file open. +Checks to ensure that main window has been created before updating the preview (which might be done if a bitmap filename was saved to ini file). Previous failure to do this resulted in Radiant console error messages. +=============== +gendlgs.cpp +One tooltip was goofed up ("preview" instead of "main_preview"), resulting in "invalid cast from (NULL) pointer to GtkObject" in Radiant console. +Tooltips - oops. Use wave_radios[] rather than string constants. +Moved check for game type from SetDlgValues to GenSurfInit in gensurf.cpp. Since the game type presumably won't change while GenSurf is active this only needs to be checked once (and if it IS possible to change the game while GenSurf is active then quite a bit more needs to be changed). +Worked around strange bug in SetDlgValues. In release dll (not debug), the 2nd pass through the set_sensitive loop for game_radios crashed. Since the state of those radio buttons won't ever change during a single session, the state is only set once now. Sure would like to know what's going on there, though. +=============== +view.cpp +Elevation and azimuth labels are right-justified. + +TODO: +Check out Fix Points on Voodoo2 again. Previous attempt caused entire preview to be redrawn when moving mouse (GL_SCISSOR_TEST failed?) + +12/17/2000 + MrHyde +- tooltips +- reformatted the source to use spaces instead of tabs +- fixes to update mechanism in bitmap tab + +12/13/2000 + MrHyde +=============== +gendlgs.cpp +In ReadDlgValues, reads wavelength, amplitude, and roughness text boxes (previously ignored). +In create_main_dialog, set a "focus_out_event" for the above and added a "value_changed" for RandomSeed. +In main_go, added call to WriteIni +=============== +gensurf.cpp +Set gszIni to "plugins/gensurf.ini" to get past assert error +ported WriteIni +=============== +view.cpp +In DrawPreview, changed 2 occurrences of GL_LINE_LOOP to GL_LINE_STRIP for patches diff --git a/contrib/gtkgensurf/bitmap.cpp b/contrib/gtkgensurf/bitmap.cpp index 044f43c7..4ea9393f 100644 --- a/contrib/gtkgensurf/bitmap.cpp +++ b/contrib/gtkgensurf/bitmap.cpp @@ -161,7 +161,7 @@ static unsigned char* OpenBitmapFile () if (bmBitsPixel != 8) { g_FuncTable.m_pfnMessageBox (g_pWnd, "This is not an 8-bit image. GenSurf can't use it.", - "Bitmap", eMB_OK, eMB_ICONWARNING); + "Bitmap", MB_ICONEXCLAMATION, NULL); fclose(fp); return NULL; } @@ -417,7 +417,7 @@ bool OpenBitmap () char Text[256]; sprintf (Text, "Error opening %s", gbmp.name); - g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "Bitmap", eMB_OK, eMB_ICONWARNING); + g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "Bitmap", MB_ICONEXCLAMATION, NULL); strcpy (gbmp.name, ""); } diff --git a/contrib/gtkgensurf/dec.cpp b/contrib/gtkgensurf/dec.cpp index 5055c033..f2daa816 100644 --- a/contrib/gtkgensurf/dec.cpp +++ b/contrib/gtkgensurf/dec.cpp @@ -150,7 +150,7 @@ void MakeDecimatedMap(int *NumNodes, int *NumTris, NODE **pNode, TRI **pTri) */ g_FuncTable.m_pfnMessageBox(g_pRadiantWnd, "Error: Couldn't find the triangle bounding a point.", - "Decimation Error", eMB_OK, eMB_ICONWARNING); + "Decimation Error",MB_ICONEXCLAMATION, NULL); return; } if(!Tri[Node[i].tri].flag) @@ -249,7 +249,7 @@ void MakeDecimatedMap(int *NumNodes, int *NumTris, NODE **pNode, TRI **pTri) */ g_FuncTable.m_pfnMessageBox(g_pRadiantWnd, "Error: Couldn't find the triangle bounding a point.", - "Decimation Error", eMB_OK, eMB_ICONWARNING); + "Decimation Error",MB_ICONEXCLAMATION, NULL); return; } if(!Tri[Node[i].tri].flag) diff --git a/contrib/gtkgensurf/face.cpp b/contrib/gtkgensurf/face.cpp index b1e6c6e8..3ef44e69 100644 --- a/contrib/gtkgensurf/face.cpp +++ b/contrib/gtkgensurf/face.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define SIDE_BACK 1 #define SIDE_CROSS -2 -//vec3 vec3_origin = {0,0,0}; +vec3 gensurf_vec3_origin; void PlaneFromPoints (float *p0, float *p1, float *p2, PLANE *plane) { @@ -56,7 +56,7 @@ void PlaneFromPoints (float *p0, float *p1, float *p2, PLANE *plane) } plane->dist = DotProduct (p0, plane->normal); } -/* + void VectorMA (vec3 va, vec scale, vec3 vb, vec3 vc) { vc[0] = va[0] + scale*vb[0]; @@ -70,7 +70,7 @@ void CrossProduct (vec3 v1, vec3 v2, vec3 cross) cross[1] = v1[2]*v2[0] - v1[0]*v2[2]; cross[2] = v1[0]*v2[1] - v1[1]*v2[0]; } -*/ + /* ============= AllocWinding @@ -86,7 +86,7 @@ MY_WINDING *AllocWinding (int points) memset (w, 0, s); return w; } -/* + vec VectorNormalize (vec3 in, vec3 out) { vec length, ilength; @@ -105,7 +105,6 @@ vec VectorNormalize (vec3 in, vec3 out) return length; } -*/ /* ================= @@ -134,7 +133,7 @@ MY_WINDING *BaseWindingForPlane (vec3 normal, vec dist) } if (x==-1) x = 2; - VectorCopy(vec3_origin,vup); + VectorCopy(gensurf_vec3_origin,vup); switch (x) { case 0: @@ -298,6 +297,7 @@ void UseFaceBounds() int NumFaces; vec3 SurfNormal; vec3 vmin,vmax; + _QERFaceData *QERFaceData; PLANE plane[MAX_FACES*2]; PLANE pface; MY_WINDING *w; @@ -335,7 +335,6 @@ void UseFaceBounds() SurfNormal[2] = 1.0; } -#if 0 i = g_FuncTable.m_pfnAllocateSelectedBrushHandles(); vp = g_FuncTable.m_pfnGetSelectedBrushHandle(0); NumFaces = g_FuncTable.m_pfnGetFaceCount(vp); @@ -345,7 +344,7 @@ void UseFaceBounds() for(i=0; im_v1[0]; planepts[0][1] = QERFaceData->m_v1[1]; planepts[0][2] = QERFaceData->m_v1[2]; @@ -357,7 +356,7 @@ void UseFaceBounds() planepts[2][2] = QERFaceData->m_v3[2]; PlaneFromPoints (planepts[0], planepts[1], planepts[2], &plane[2*i]); - VectorSubtract (vec3_origin, plane[2*i].normal, plane[2*i+1].normal); + VectorSubtract (gensurf_vec3_origin, plane[2*i].normal, plane[2*i+1].normal); plane[2*i+1].dist = -plane[2*i].dist; Dot = DotProduct(plane[2*i].normal,SurfNormal); @@ -372,7 +371,7 @@ void UseFaceBounds() for(i=0; im_TextureName)) { if(strcmp(Texture[Game][0],QERFaceData->m_TextureName)) @@ -448,5 +447,4 @@ void UseFaceBounds() Z10 = (pface.dist - pface.normal[0]*Hur - pface.normal[1]*Vll)/pface.normal[2]; Z11 = (pface.dist - pface.normal[0]*Hur - pface.normal[1]*Vur)/pface.normal[2]; } -#endif } diff --git a/contrib/gtkgensurf/font.cpp b/contrib/gtkgensurf/font.cpp index dabb72d7..081a83d4 100644 --- a/contrib/gtkgensurf/font.cpp +++ b/contrib/gtkgensurf/font.cpp @@ -232,7 +232,7 @@ void texfont_init () free (buf); } -void texfont_write (const char *text, int l, int t) +void texfont_write (const char *text, float l, float t) { if (texture == 0) return; @@ -253,13 +253,13 @@ void texfont_write (const char *text, int l, int t) continue; g_GLTable.m_pfn_qglTexCoord2f (glyphs[*p-32].left, glyphs[*p-32].top); - g_GLTable.m_pfn_qglVertex2i (l, t); + g_GLTable.m_pfn_qglVertex2f (l, t); g_GLTable.m_pfn_qglTexCoord2f (glyphs[*p-32].left, glyphs[*p-32].bottom); - g_GLTable.m_pfn_qglVertex2i (l, t-16); + g_GLTable.m_pfn_qglVertex2f (l, t-16); g_GLTable.m_pfn_qglTexCoord2f (glyphs[*p-32].right, glyphs[*p-32].bottom); - g_GLTable.m_pfn_qglVertex2i (l + glyphs[*p-32].width, t-16); + g_GLTable.m_pfn_qglVertex2f (l + glyphs[*p-32].width, t-16); g_GLTable.m_pfn_qglTexCoord2f (glyphs[*p-32].right, glyphs[*p-32].top); - g_GLTable.m_pfn_qglVertex2i (l + glyphs[*p-32].width, t); + g_GLTable.m_pfn_qglVertex2f (l + glyphs[*p-32].width, t); l += glyphs[*p-32].width; } g_GLTable.m_pfn_qglEnd (); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index f2df9ea6..6476b5dc 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -98,7 +98,7 @@ void About (GtkWidget *parent) "Enhancements\n" "Pablo Zurita (pablo@qeradiant.com)\n" "Hydra (hydra@hydras-world.com)", - "About GtkGenSurf", eMB_OK); + "About GtkGenSurf", MB_OK, NULL); } // ============================================================================= @@ -270,6 +270,8 @@ static void SetDlgValues (int tab) switch (tab) { case GENERAL_TAB: + // mattn: Deactivated because one wasn't able to switch the gametype or orientation +#if 0 // Hell if I know why, but in the release build the 2nd pass thru the // set_sensitive loop for game_radios crashes. No need to do this more // than once anyhow. @@ -280,6 +282,7 @@ static void SetDlgValues (int tab) for (i = 0; i < 6; i++) gtk_widget_set_sensitive (plane_radios[i], (i == Plane ? TRUE : FALSE)); } +#endif gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (game_radios[Game]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plane_radios[Plane]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wave_radios[WaveType]), TRUE); @@ -717,7 +720,7 @@ static void main_go (GtkWidget *widget, gpointer data) if (NH < 1 || NH > MAX_ROWS) { sprintf (Text, "The number of divisions must be > 0 and no greater than %d.", MAX_ROWS); - g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "GenSurf", eMB_OK, eMB_ICONWARNING); + g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "GenSurf", MB_ICONEXCLAMATION, NULL); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), EXTENTS_TAB); return; } @@ -725,7 +728,7 @@ static void main_go (GtkWidget *widget, gpointer data) if (NV < 1 || NV > MAX_ROWS) { sprintf (Text, "The number of divisions must be > 0 and no greater than %d.", MAX_ROWS); - g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "GenSurf", eMB_OK, eMB_ICONWARNING); + g_FuncTable.m_pfnMessageBox (g_pWnd, Text, "GenSurf", MB_ICONEXCLAMATION, NULL); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), EXTENTS_TAB); return; } @@ -734,7 +737,7 @@ static void main_go (GtkWidget *widget, gpointer data) { g_FuncTable.m_pfnMessageBox (g_pWnd, "The \"lower-left\" values must be less than " "the corresponding \"upper-right\" values in " - "the \"Extent\" box.","GenSurf", eMB_OK, eMB_ICONWARNING); + "the \"Extent\" box.","GenSurf", MB_OK | MB_ICONEXCLAMATION, NULL); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), EXTENTS_TAB); return; } @@ -743,14 +746,14 @@ static void main_go (GtkWidget *widget, gpointer data) { g_FuncTable.m_pfnMessageBox (g_pWnd,"The \"lower-left\" values must be less than " "the corresponding \"upper-right\" values in " - "the \"Extent\" box.","GenSurf", eMB_OK, eMB_ICONWARNING); + "the \"Extent\" box.","GenSurf", MB_OK | MB_ICONEXCLAMATION, NULL); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), EXTENTS_TAB); return; } if (!strlen (Texture[Game][0])) { - g_FuncTable.m_pfnMessageBox (g_pWnd, "You must supply a texture name.", "GenSurf", eMB_OK, eMB_ICONWARNING); + g_FuncTable.m_pfnMessageBox (g_pWnd, "You must supply a texture name.", "GenSurf", MB_ICONEXCLAMATION, NULL); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), EXTENTS_TAB); return; } @@ -760,7 +763,7 @@ static void main_go (GtkWidget *widget, gpointer data) MessageBox(hwnd,"You've elected to use a decimated grid and gimp's non-detail hint brushes. " "This combination usually produces bizarre visual errors in the game, " "so GenSurf has turned off the hint brush option.", - "GenSurf",eMB_ICONWARNING); + "GenSurf",MB_ICONEXCLAMATION); GimpHints = 0; } */ @@ -908,7 +911,7 @@ static void bitmap_browse (GtkWidget *widget, gpointer data) const char *filename; char *ptr; - filename = g_FuncTable.m_pfnFileDialog (g_pWnd, TRUE, "Bitmap File", gbmp.defpath); + filename = g_FuncTable.m_pfnFileDialog (g_pWnd, TRUE, "Bitmap File", gbmp.defpath, "gtkgensurf"); if (filename != NULL) { @@ -950,7 +953,7 @@ static gint fix_value_entryfocusout (GtkWidget* widget, GdkEventFocus *event, gp { gdk_beep (); g_FuncTable.m_pfnMessageBox (g_pWnd, "The value must be between -65536 and 65536, inclusive.", - "GenSurf", eMB_OK, eMB_ICONWARNING); + "GenSurf", MB_OK | MB_ICONEXCLAMATION, NULL); sprintf (Text, "%d", (int)xyz[Vertex[0].i][Vertex[0].j].fixed_value); gtk_entry_set_text (GTK_ENTRY(widget), Text); gtk_window_set_focus (GTK_WINDOW (gtk_widget_get_toplevel (widget)), widget); @@ -2243,7 +2246,7 @@ GtkWidget* create_main_dialog () HWND hwndDisplay = (HWND)NULL; HWND ghwndTab = (HWND)NULL; int iTab=0; -Rect rcTab; +RECT rcTab; FILE *ftex; char GenSurfURL[40] = {"http://tarot.telefragged.com/gensurf"}; @@ -2260,7 +2263,7 @@ qboolean CALLBACK AboutDlgProc( HWND hwnd, unsigned msg, UINT wparam, LONG lpara HDC hdc; HPEN hpen; HWND hwndURL; - Rect rc; + RECT rc; SIZE size; lparam = lparam; /* turn off warning */ @@ -2357,7 +2360,7 @@ void About() { char Text[256]; sprintf(Text,"In About(), GetLastError()=0x%08x",GetLastError()); - MessageBox(ghwnd_main,Text,"GenSurf",eMB_ICONWARNING); + MessageBox(ghwnd_main,Text,"GenSurf",MB_ICONEXCLAMATION); } } diff --git a/contrib/gtkgensurf/genmap.cpp b/contrib/gtkgensurf/genmap.cpp index 6e9c95dc..6c04ef60 100644 --- a/contrib/gtkgensurf/genmap.cpp +++ b/contrib/gtkgensurf/genmap.cpp @@ -29,21 +29,8 @@ FILE *fmap; XYZ xyz[MAX_ROWS+1][MAX_ROWS+1]; int contents; int surface[3]; - -#include "iundo.h" - -#include "refcounted_ptr.h" - -#include -#include -#include -#include - -#include "scenelib.h" - -scene::Node* h_func_group; -scene::Node* h_worldspawn; - +LPVOID h_func_group; +LPVOID terrainkey; // ^Fishman - Add terrain key to func_group. //============================================================= // Hydra : snap-to-grid begin @@ -89,9 +76,11 @@ int MapPatches() int i, j, k1, k2, k3; int i0, j0, ii; char szOops[128]; + patchMesh_t p; dh = (Hur-Hll)/NH; dv = (Vur-Vll)/NV; + memset(&p,0,sizeof(patchMesh_t)); // Generate control points in pp array to give desired values currently // in p array. @@ -183,7 +172,7 @@ int MapPatches() if(NH_remain < 0) { sprintf(szOops,"Oops... screwed up with NH=%d",NH); - g_FuncTable.m_pfnMessageBox(NULL,szOops,"Uh oh"); + g_FuncTable.m_pfnMessageBox(NULL,szOops,"Uh oh", 0, NULL); } NV_remain = NV+1; j0 = 0; @@ -215,12 +204,12 @@ int MapPatches() if(NV_remain < 0) { sprintf(szOops,"Oops... screwed up with NV=%d",NV); - g_FuncTable.m_pfnMessageBox(NULL,szOops,"Uh oh"); + g_FuncTable.m_pfnMessageBox(NULL,szOops,"Uh oh", 0, NULL); } - scene::Node* patch = MakePatch(); -#if 0 - b->pPatch->setDims(NH_patch, NV_patch); + p.width = NH_patch; + p.height = NV_patch; + p.type = PATCH_GENERIC; for(i=0; ipPatch->ctrlAt(COL,i,j)[0] = (float)xyz[ii][j0+j].pp[0]; - b->pPatch->ctrlAt(COL,i,j)[1] = (float)xyz[ii][j0+j].pp[1]; - b->pPatch->ctrlAt(COL,i,j)[2] = (float)xyz[ii][j0+j].pp[2]; - b->pPatch->ctrlAt(COL,i,j)[3] = (float)i; - b->pPatch->ctrlAt(COL,i,j)[4] = (float)j; + p.ctrl[i][j].xyz[0] = (float)xyz[ii][j0+j].pp[0]; + p.ctrl[i][j].xyz[1] = (float)xyz[ii][j0+j].pp[1]; + p.ctrl[i][j].xyz[2] = (float)xyz[ii][j0+j].pp[2]; + p.ctrl[i][j].st[0] = (float)i; + p.ctrl[i][j].st[1] = (float)j; } } - b->pPatch->UpdateCachedData(); -#endif + MakePatch(&p); BrushNum++; j0 += NV_patch-1; } @@ -1069,9 +1057,7 @@ void GenerateMap() ghCursorCurrent = LoadCursor(NULL,IDC_WAIT); SetCursor(ghCursorCurrent); */ -#if 0 if(SingleBrushSelected) g_FuncTable.m_pfnDeleteSelection(); -#endif GenerateXYZ(); ntri = NH*NV*2; @@ -1973,25 +1959,35 @@ void XYZtoV(XYZ *xyz, vec3 *v) } //============================================================= -scene::Node* MakePatch(void) +void MakePatch(patchMesh_t *p) { - scene::Node* patch = Patch_AllocNode(); -#if 0 - patch->m_patch->SetShader(Texture[Game][0]); -#endif - Node_getTraversable(h_worldspawn)->insert(patch); - return patch; + int ret; + char shadername[64+9]; + + ret = g_FuncTable.m_pfnCreatePatchHandle(); + // strcpy(shadername, "textures/"); + // strcpy(shadername+9, Texture[Game][0]); + strcpy(shadername, Texture[Game][0]); + g_FuncTable.m_pfnCommitPatchHandleToMap(ret,p,shadername); + g_FuncTable.m_pfnReleasePatchHandles(); } //============================================================= void MakeBrush(BRUSH *brush) { - NodePtr node(Brush_AllocNode()); + LPVOID vp; + int i; + _QERFaceData QERFaceData; -#if 0 - for(int i=0; iNumFaces; i++) + if(g_FuncTable.m_pfnCreateBrushHandle==NULL) + { + g_FuncTable.m_pfnMessageBox(g_pRadiantWnd,"m_pfnCreateBrushHandle==NULL","Aw damn",0, NULL); + return; + } + vp=(g_FuncTable.m_pfnCreateBrushHandle)(); + if(!vp) return; + for(i=0; iNumFaces; i++) { - _QERFaceData QERFaceData; if(!strncmp(brush->face[i].texture, "textures/", 9)) strcpy(QERFaceData.m_TextureName,brush->face[i].texture); else @@ -2019,22 +2015,42 @@ void MakeBrush(BRUSH *brush) QERFaceData.m_bBPrimit = false; (g_FuncTable.m_pfnAddFaceData)(vp,&QERFaceData); } -#endif - - Node_getTraversable(h_func_group)->insert(node); + if(g_FuncTable.m_pfnCommitBrushHandle!=NULL) + { + if(h_func_group) + g_FuncTable.m_pfnCommitBrushHandleToEntity(vp,h_func_group); + else + g_FuncTable.m_pfnCommitBrushHandle(vp); + } } //============================================================= void OpenFuncGroup() { - h_func_group = GlobalEntityCreator().createEntity("func_group"); - h_func_group->IncRef(); - if(AddTerrainKey) - h_func_group->m_entity->setkeyvalue("terrain", "1"); + if (g_FuncTable.m_pfnAllocateEpair!=NULL) + { + epair_t *ep; + + h_func_group = g_FuncTable.m_pfnCreateEntityHandle(); + ep = g_EntityTable.m_pfnAllocateEpair("classname","func_group"); + g_EntityTable.m_pfnSetEntityKeyValList((entity_t *)h_func_group,ep); + + if (AddTerrainKey) // ^Fishman - Add terrain key to func_group. + { + epair_t *ep2; + terrainkey = g_FuncTable.m_pfnCreateEntityHandle(); + ep2 = g_EntityTable.m_pfnAllocateEpair("terrain","1"); + ep->next = ep2; + g_EntityTable.m_pfnSetEntityKeyValList((entity_t *)h_func_group,ep); + } + } + else + h_func_group = NULL; } //============================================================= void CloseFuncGroup() { - h_func_group->DecRef(); + if (h_func_group) + g_FuncTable.m_pfnCommitEntityHandleToMap (h_func_group); if (g_FuncTable.m_pfnSysUpdateWindows != NULL) g_FuncTable.m_pfnSysUpdateWindows (W_ALL); } diff --git a/contrib/gtkgensurf/gensurf.cpp b/contrib/gtkgensurf/gensurf.cpp index 32b54b55..dd1ceec0 100644 --- a/contrib/gtkgensurf/gensurf.cpp +++ b/contrib/gtkgensurf/gensurf.cpp @@ -397,7 +397,7 @@ void UpdatePreview (bool DataChange) void SaveSetup (GtkWidget *parent) { const char *name = g_FuncTable.m_pfnFileDialog (parent, false, "Save GenSurf Settings", - g_FuncTable.m_pfnProfileGetDirectory ()); + g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf"); if (name != NULL) { @@ -436,7 +436,7 @@ void OpenSetup (GtkWidget *parent, int UseDefaults) name = g_strdup ("plugins/defaults.srf"); // dummy string else name = g_FuncTable.m_pfnFileDialog (parent, true, "Open GenSurf Settings", - g_FuncTable.m_pfnProfileGetDirectory ()); + g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf"); if(name != NULL) { diff --git a/contrib/gtkgensurf/gensurf.h b/contrib/gtkgensurf/gensurf.h index 80172e53..8e42ac0d 100644 --- a/contrib/gtkgensurf/gensurf.h +++ b/contrib/gtkgensurf/gensurf.h @@ -20,64 +20,30 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _GENSURF_H_ #define _GENSURF_H_ -#include -#include "qertypes.h" -#include - -#include "mathlib.h" -#include "iscenegraph.h" -#define USE_QERTABLE_DEFINE -#include "qerplugin.h" -extern _QERFuncTable_1 g_FuncTable; - -#include "irender.h" -#include "iselection.h" - -#define USE_ENTITYTABLE_DEFINE -#include "ientity.h" -extern _QEREntityTable __ENTITYTABLENAME; - -#define USE_PATCHTABLE_DEFINE -#include "ipatch.h" -extern _QERPatchTable __PATCHTABLENAME; - -#define USE_BRUSHTABLE_DEFINE -#include "ibrush.h" -extern _QERBrushTable __BRUSHTABLENAME; - -#include "igl.h" -#include "ientity.h" - #include +#include "qerplugin.h" +//#include "qertypes.h" + +#include "igl.h" #include "iui_gtk.h" +#include "ientity.h" #include "gendlgs.h" - #define PLUGIN #define Q3RADIANT -//#if defined(__linux__) || defined(__APPLE__) -#if 1 -#include -#else +#if defined(__linux__) || defined(__APPLE__) template inline T min (T x, T y) { return (x < y) ? x : y; } template inline T max (T x, T y) { return (x > y) ? x : y; } + +typedef struct { long x, y; } POINT; +typedef struct { long left, top, right, bottom; } RECT; #endif - -typedef struct { long x, y; } Point; -typedef struct { long left, top, right, bottom; } Rect; - -#define NAME_MAX 255 - -typedef void* LPVOID; -typedef char* LPSTR; - -//#endif -inline bool PtInRect (Rect *rc, Point pt) +inline bool PtInRect (RECT *rc, POINT pt) { if (pt.x < rc->left) return false; if (pt.x > rc->right) return false; @@ -100,14 +66,12 @@ inline bool PtInRect (Rect *rc, Point pt) #define DegreesToRadians(a) (a/57.2957795) #define BOGUS_RANGE 65536 -/* #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];} #define VectorClear(x) {x[0] = x[1] = x[2] = 0;} #define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];} #define VectorScale(a,b,c) {c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];} #define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];} -*/ #define XYZVectorSubtract(a,b,c) {c[0]=(float)a[0]-(float)b[0];c[1]=(float)a[1]-(float)b[1];c[2]=(float)a[2]-(float)b[2];} #define side(u1,v1,u2,v2,u3,v3) (v3-v1)*(u2-u1) - (u3-u1)*(v2-v1) @@ -264,12 +228,11 @@ typedef struct //--------------- bitmap.c ----------------------------- bool OpenBitmap (); -double CalculateSnapValue(double value); void GenerateBitmapMapping (); //--------------- face.c ------------------------------- void PlaneFromPoints (float *, float *, float *, PLANE *); -//void CrossProduct (vec3 v1, vec3 v2, vec3 cross); -//vec VectorNormalize (vec3 in, vec3 out); +void CrossProduct (vec3 v1, vec3 v2, vec3 cross); +vec VectorNormalize (vec3 in, vec3 out); //--------------- gendlg.c ----------------------------- GtkWidget* create_main_dialog (); void About (GtkWidget *parent); @@ -291,7 +254,8 @@ int PlayerStartZ(double,double); void SubdividePlasma(int,int,int,int); bool ValidSurface(); void XYZtoV(XYZ *, vec3 *); -scene::Node* MakePatch(void); +void MakePatch(patchMesh_t *); +double CalculateSnapValue(double value); //---------------- gensurf.c --------------------------- bool GenSurfInit (); @@ -303,12 +267,12 @@ void SaveSetup (GtkWidget*); int GetDefSurfaceProps(char *); //---------------- view.c ------------------------------ void CreateViewWindow (); -void DrawGrid(Rect); -void DrawPreview(Rect); +void DrawGrid(RECT); +void DrawPreview(RECT); void evaluate(); -void GetScaleFactor(Rect); +void GetScaleFactor(RECT); void project(XYZ *); -void Scale(Rect,XYZ,Point *); +void Scale(RECT,XYZ,POINT *); void ShowPreview (); void UpdatePreview (bool); @@ -401,7 +365,6 @@ extern int AddTerrainKey; // ^Fishman - Add terrain key to func_group. extern int SnapToGrid; // Hydra : snap to grid extern int SP; // ^Fishman - Snap to grid. - /*extern HCURSOR ghCursorCurrent; extern HCURSOR ghCursorDefault; extern HCURSOR ghCursorVertex; diff --git a/contrib/gtkgensurf/gtkgensurf.vcproj b/contrib/gtkgensurf/gtkgensurf.vcproj index bd20e46e..059d57a1 100644 --- a/contrib/gtkgensurf/gtkgensurf.vcproj +++ b/contrib/gtkgensurf/gtkgensurf.vcproj @@ -1,194 +1,91 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/gtkgensurf/plugin.cpp b/contrib/gtkgensurf/plugin.cpp index 18e12091..ec8e6a3f 100644 --- a/contrib/gtkgensurf/plugin.cpp +++ b/contrib/gtkgensurf/plugin.cpp @@ -23,9 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA _QERFuncTable_1 g_FuncTable; _QERQglTable g_GLTable; _QERUIGtkTable g_UIGtkTable; -_QEREntityTable __ENTITYTABLENAME; -_QERBrushTable __BRUSHTABLENAME; -_QERPatchTable __PATCHTABLENAME; +_QEREntityTable g_EntityTable; bool SingleBrushSelected; bool g_bInitDone; @@ -159,6 +157,11 @@ void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrus } } +extern "C" LPVOID WINAPI QERPlug_GetFuncTable() +{ + return &g_FuncTable; +} + // ============================================================================= // SYNAPSE @@ -178,8 +181,13 @@ public: CSynapseServer* g_pSynapseServer = NULL; GenSurfSynapseClient g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index bf4cbe23..9344a69e 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -36,15 +36,15 @@ int cxChar = 10, cyChar = 16; int X0, Y0; int X0G, Y0G; -static Rect rcCoord; // where X= Y= is drawn -static Rect rcGrid; // rectangle within rcLower that forms the border of the grid, plus +static RECT rcCoord; // where X= Y= is drawn +static RECT rcGrid; // rectangle within rcLower that forms the border of the grid, plus // a 3 pixel slop. -static Rect rcLower; // lower half of window, where plan view is drawn -static Rect rcUpper; // upper half or entire window, where isometric projection is drawn +static RECT rcLower; // lower half of window, where plan view is drawn +static RECT rcUpper; // upper half or entire window, where isometric projection is drawn void vertex_selected (); void texfont_init (); -void texfont_write (const char *text, int l, int t); +void texfont_write (const char *text, float l, float t); #define PEN_GRID { \ g_GLTable.m_pfn_qglLineWidth (1); \ @@ -65,15 +65,15 @@ void texfont_write (const char *text, int l, int t); #define DRAW_QUAD(rc,r,g,b) { \ g_GLTable.m_pfn_qglBegin (GL_QUADS); \ g_GLTable.m_pfn_qglColor3f (0,1,0); \ - g_GLTable.m_pfn_qglVertex2i (rc.left-1, rc.bottom); \ - g_GLTable.m_pfn_qglVertex2i (rc.right, rc.bottom); \ - g_GLTable.m_pfn_qglVertex2i (rc.right, rc.top+1); \ - g_GLTable.m_pfn_qglVertex2i (rc.left-1, rc.top+1); \ + g_GLTable.m_pfn_qglVertex2f (rc.left-1, rc.bottom); \ + g_GLTable.m_pfn_qglVertex2f (rc.right, rc.bottom); \ + g_GLTable.m_pfn_qglVertex2f (rc.right, rc.top+1); \ + g_GLTable.m_pfn_qglVertex2f (rc.left-1, rc.top+1); \ g_GLTable.m_pfn_qglColor3f (r,g,b); \ - g_GLTable.m_pfn_qglVertex2i (rc.left, rc.bottom+1); \ - g_GLTable.m_pfn_qglVertex2i (rc.right-1, rc.bottom+1); \ - g_GLTable.m_pfn_qglVertex2i (rc.right-1, rc.top); \ - g_GLTable.m_pfn_qglVertex2i (rc.left, rc.top); \ + g_GLTable.m_pfn_qglVertex2f (rc.left, rc.bottom+1); \ + g_GLTable.m_pfn_qglVertex2f (rc.right-1, rc.bottom+1); \ + g_GLTable.m_pfn_qglVertex2f (rc.right-1, rc.top); \ + g_GLTable.m_pfn_qglVertex2f (rc.left, rc.top); \ g_GLTable.m_pfn_qglEnd (); } @@ -143,8 +143,8 @@ static void draw_preview () rcUpper.bottom = rcUpper.top/2; DrawPreview (rcUpper); g_GLTable.m_pfn_qglBegin (GL_LINES); - g_GLTable.m_pfn_qglVertex2i (rcUpper.left, rcUpper.bottom); - g_GLTable.m_pfn_qglVertex2i (rcUpper.right, rcUpper.bottom); + g_GLTable.m_pfn_qglVertex2f (rcUpper.left, rcUpper.bottom); + g_GLTable.m_pfn_qglVertex2f (rcUpper.right, rcUpper.bottom); g_GLTable.m_pfn_qglEnd (); rcLower.top = rcUpper.bottom-1; DrawGrid (rcLower); @@ -184,7 +184,7 @@ static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) static void button_press (GtkWidget *widget, GdkEventButton *event, gpointer data) { - Point pt = { (long)event->x, widget->allocation.height - (long)event->y }; + POINT pt = { (long)event->x, widget->allocation.height - (long)event->y }; bool Selected; double x,y; int i, j, k, ks; @@ -296,7 +296,7 @@ static void button_press (GtkWidget *widget, GdkEventButton *event, gpointer dat static void motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) { - Point pt = { (long)event->x, widget->allocation.height - (long)event->y }; + POINT pt = { (long)event->x, widget->allocation.height - (long)event->y }; if (!VertexMode) return; @@ -450,7 +450,7 @@ void CreateViewWindow () //============================================================= /* DrawPreview */ -void DrawPreview (Rect rc) +void DrawPreview (RECT rc) { #define COSXA 0.8660254037844 #define SINXA 0.5 @@ -460,7 +460,7 @@ void DrawPreview (Rect rc) double L; double x,y; int i, j; - Point pt[8]; + POINT pt[8]; XYZ v[8]; char axis[3][2] = {"X","Y","Z"}; @@ -521,10 +521,10 @@ void DrawPreview (Rect rc) Scale(rc,vv[gTri[i].v[j]],&pt[j]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[1].x, pt[1].y); - g_GLTable.m_pfn_qglVertex2i (pt[2].x, pt[2].y); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x, pt[1].y); + g_GLTable.m_pfn_qglVertex2f (pt[2].x, pt[2].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); g_GLTable.m_pfn_qglEnd (); } free(vv); @@ -609,7 +609,7 @@ void DrawPreview (Rect rc) project(&out); Scale(rc,out,&pt[0]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); for(jj=1; jj<=SUBDIVS; jj++) { v = (float)(jj)/(float)(SUBDIVS); @@ -627,7 +627,7 @@ void DrawPreview (Rect rc) } project(&out); Scale(rc,out,&pt[0]); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); } g_GLTable.m_pfn_qglEnd (); } @@ -669,7 +669,7 @@ void DrawPreview (Rect rc) project(&out); Scale(rc,out,&pt[0]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); for(ii=1; ii<=SUBDIVS; ii++) { u = (float)(ii)/(float)(SUBDIVS); @@ -687,7 +687,7 @@ void DrawPreview (Rect rc) } project(&out); Scale(rc,out,&pt[0]); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); } g_GLTable.m_pfn_qglEnd (); } @@ -700,11 +700,11 @@ void DrawPreview (Rect rc) { Scale(rc,xyz[i][0],&pt[0]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); for(j=1; j<=NV; j++) { Scale(rc,xyz[i][j],&pt[0]); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); } g_GLTable.m_pfn_qglEnd (); } @@ -712,11 +712,11 @@ void DrawPreview (Rect rc) { Scale(rc,xyz[0][j],&pt[0]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); for(i=1; i<=NH; i++) { Scale(rc,xyz[i][j],&pt[0]); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); } g_GLTable.m_pfn_qglEnd (); } @@ -749,8 +749,8 @@ void DrawPreview (Rect rc) #endif Scale(rc,v[0],&pt[1]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[1].x, pt[1].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x, pt[1].y); g_GLTable.m_pfn_qglEnd (); } } @@ -785,16 +785,16 @@ void DrawPreview (Rect rc) #endif Scale(rc,v[3],&pt[0]); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); for(i=0; i<3; i++) { #ifndef ISOMETRIC project(&v[i]); #endif Scale(rc,v[i],&pt[1]); - g_GLTable.m_pfn_qglVertex2i (pt[1].x, pt[1].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x, pt[1].y); } - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); g_GLTable.m_pfn_qglEnd (); } @@ -854,8 +854,8 @@ void DrawPreview (Rect rc) for(i=1; i<=3; i++) { g_GLTable.m_pfn_qglBegin (GL_LINES); - g_GLTable.m_pfn_qglVertex2i (pt[0].x, pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[i].x, pt[i].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[i].x, pt[i].y); g_GLTable.m_pfn_qglEnd (); texfont_write (axis[i-1], pt[i].x-cxChar/2,pt[i].y+cyChar/2); } @@ -949,20 +949,20 @@ void DrawPreview (Rect rc) Scale(rc,v[i],&pt[i]); } g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[3].x, pt[3].y); + g_GLTable.m_pfn_qglVertex2f (pt[3].x, pt[3].y); for(i=0; i<=3; i++) - g_GLTable.m_pfn_qglVertex2i (pt[i].x, pt[i].y); + g_GLTable.m_pfn_qglVertex2f (pt[i].x, pt[i].y); g_GLTable.m_pfn_qglEnd (); g_GLTable.m_pfn_qglBegin (GL_LINE_STRIP); - g_GLTable.m_pfn_qglVertex2i (pt[7].x, pt[7].y); + g_GLTable.m_pfn_qglVertex2f (pt[7].x, pt[7].y); for(i=4; i<=7; i++) - g_GLTable.m_pfn_qglVertex2i (pt[i].x, pt[i].y); + g_GLTable.m_pfn_qglVertex2f (pt[i].x, pt[i].y); g_GLTable.m_pfn_qglEnd (); g_GLTable.m_pfn_qglBegin (GL_LINES); for(i=0; i<=3; i++) { - g_GLTable.m_pfn_qglVertex2i (pt[i].x,pt[i].y); - g_GLTable.m_pfn_qglVertex2i (pt[i+4].x,pt[i+4].y); + g_GLTable.m_pfn_qglVertex2f (pt[i].x,pt[i].y); + g_GLTable.m_pfn_qglVertex2f (pt[i+4].x,pt[i+4].y); } g_GLTable.m_pfn_qglEnd (); @@ -971,12 +971,12 @@ void DrawPreview (Rect rc) g_GLTable.m_pfn_qglDisable (GL_LINE_STIPPLE); } //============================================================= -void DrawGrid(Rect rc) +void DrawGrid(RECT rc) { int i, j, k; double h,w,x,y; - Point pt[2]; - Rect rcBox; + POINT pt[2]; + RECT rcBox; w = (double)(rc.right-rc.left+1) - cxChar; h = (double)(rc.top-rc.bottom+1) - cxChar - cyChar; @@ -999,8 +999,8 @@ void DrawGrid(Rect rc) { x = Hll + i * dh; pt[0].x = X0G + (int)(SFG*(x-Hll)); - g_GLTable.m_pfn_qglVertex2i(pt[0].x, pt[0].y); - g_GLTable.m_pfn_qglVertex2i(pt[0].x, pt[1].y); + g_GLTable.m_pfn_qglVertex2f(pt[0].x, pt[0].y); + g_GLTable.m_pfn_qglVertex2f(pt[0].x, pt[1].y); } g_GLTable.m_pfn_qglEnd (); pt[0].x = X0G; @@ -1010,8 +1010,8 @@ void DrawGrid(Rect rc) { y = Vll + i * dv; pt[0].y = Y0G + (int)(SFG*(Vur-y)); - g_GLTable.m_pfn_qglVertex2i (pt[0].x,pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[1].x,pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x,pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x,pt[0].y); } g_GLTable.m_pfn_qglEnd (); @@ -1023,8 +1023,8 @@ void DrawGrid(Rect rc) pt[1].x = pt[0].x + cyChar; pt[1].y = pt[0].y; g_GLTable.m_pfn_qglBegin (GL_LINES); - g_GLTable.m_pfn_qglVertex2i (pt[0].x,pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[1].x,pt[1].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x,pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x,pt[1].y); g_GLTable.m_pfn_qglEnd (); switch(Plane) { @@ -1038,8 +1038,8 @@ void DrawGrid(Rect rc) pt[1].x = pt[0].x; pt[1].y = pt[0].y + cyChar; g_GLTable.m_pfn_qglBegin (GL_LINES); - g_GLTable.m_pfn_qglVertex2i (pt[0].x,pt[0].y); - g_GLTable.m_pfn_qglVertex2i (pt[1].x,pt[1].y); + g_GLTable.m_pfn_qglVertex2f (pt[0].x,pt[0].y); + g_GLTable.m_pfn_qglVertex2f (pt[1].x,pt[1].y); g_GLTable.m_pfn_qglEnd (); switch(Plane) { @@ -1125,7 +1125,7 @@ void DrawGrid(Rect rc) } //============================================================= -void GetScaleFactor(Rect rc) +void GetScaleFactor(RECT rc) { #ifdef ISOMETRIC double h, w; @@ -1153,7 +1153,7 @@ void GetScaleFactor(Rect rc) } //============================================================= -void Scale(Rect rc,XYZ xyz,Point *pt) +void Scale(RECT rc,XYZ xyz,POINT *pt) { #ifdef ISOMETRIC diff --git a/contrib/hydratoolz/hydratoolz.vcproj b/contrib/hydratoolz/hydratoolz.vcproj index 53d20a95..f0d5ecbe 100644 --- a/contrib/hydratoolz/hydratoolz.vcproj +++ b/contrib/hydratoolz/hydratoolz.vcproj @@ -1,156 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/hydratoolz/plugin.cpp b/contrib/hydratoolz/plugin.cpp index abc57fc3..93cd2769 100644 --- a/contrib/hydratoolz/plugin.cpp +++ b/contrib/hydratoolz/plugin.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Overview ======== + This plugin allows the user to rebuild the "wad" key pair in the worldspawn + so that it has a list of all the .wad files in use. Version History =============== @@ -37,11 +39,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA v0.1 - 28/May/2002 - Initial version. + v1.0 - 10/March/2003 + - Added more console output + - Removed some old test code + - Tweaked dialog box. + - Fixed up for Radiant 1.3.5 + ToDo ==== - * Code it ? :) + Nothing... */ @@ -52,151 +60,6 @@ _QERFuncTable_1 g_FuncTable; _QERFileSystemTable g_FileSystemTable; _QEREntityTable g_EntityTable; -// cast to GtkWidget* -void *g_pMainWnd; - -// ============================================================================= -// Ripped from TexTool.cpp - -static void dialog_button_callback (GtkWidget *widget, gpointer data) -{ - GtkWidget *parent; - int *loop, *ret; - - parent = gtk_widget_get_toplevel (widget); - loop = (int*)gtk_object_get_data (GTK_OBJECT (parent), "loop"); - ret = (int*)gtk_object_get_data (GTK_OBJECT (parent), "ret"); - - *loop = 0; - *ret = gpointer_to_int (data); -} - -static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) -{ - int *loop; - - gtk_widget_hide (widget); - loop = (int*)gtk_object_get_data (GTK_OBJECT (widget), "loop"); - *loop = 0; - - return TRUE; -} - -int DoMessageBox (const char* lpText, const char* lpCaption, guint32 uType) -{ - GtkWidget *window, *w, *vbox, *hbox; - int mode = (uType & MB_TYPEMASK), ret, loop = 1; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_signal_connect (GTK_OBJECT (window), "delete_event", - GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); - gtk_window_set_title (GTK_WINDOW (window), lpCaption); - gtk_container_border_width (GTK_CONTAINER (window), 10); - gtk_object_set_data (GTK_OBJECT (window), "loop", &loop); - gtk_object_set_data (GTK_OBJECT (window), "ret", &ret); - gtk_widget_realize (window); - - vbox = gtk_vbox_new (FALSE, 10); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - w = gtk_label_new (lpText); - gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); - gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT); - gtk_widget_show (w); - - w = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); - gtk_widget_show (w); - - hbox = gtk_hbox_new (FALSE, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); - gtk_widget_show (hbox); - - if (mode == MB_OK) - { - w = gtk_button_new_with_label ("Ok"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); - GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); - gtk_widget_grab_default (w); - gtk_widget_show (w); - ret = IDOK; - } - else if (mode == MB_OKCANCEL) - { - w = gtk_button_new_with_label ("Ok"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); - GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); - gtk_widget_grab_default (w); - gtk_widget_show (w); - - w = gtk_button_new_with_label ("Cancel"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); - gtk_widget_show (w); - ret = IDCANCEL; - } - else if (mode == MB_YESNOCANCEL) - { - w = gtk_button_new_with_label ("Yes"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); - GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); - gtk_widget_grab_default (w); - gtk_widget_show (w); - - w = gtk_button_new_with_label ("No"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); - gtk_widget_show (w); - - w = gtk_button_new_with_label ("Cancel"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); - gtk_widget_show (w); - ret = IDCANCEL; - } - else /* if (mode == MB_YESNO) */ - { - w = gtk_button_new_with_label ("Yes"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); - GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); - gtk_widget_grab_default (w); - gtk_widget_show (w); - - w = gtk_button_new_with_label ("No"); - gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (w), "clicked", - GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); - gtk_widget_show (w); - ret = IDNO; - } - - gtk_widget_show (window); - gtk_grab_add (window); - - while (loop) - gtk_main_iteration (); - - gtk_grab_remove (window); - gtk_widget_destroy (window); - - return ret; -} - -// End of rip from TexTool.cpp // ============================================================================= // Ripped from cmdlib.cpp @@ -206,7 +69,7 @@ int DoMessageBox (const char* lpText, const char* lpCaption, guint32 uType) Extract file parts ==================== */ -void ExtractFilePath (const char *path, char *dest) +void HYDRA_ExtractFilePath (const char *path, char *dest) { const char *src; @@ -222,7 +85,7 @@ void ExtractFilePath (const char *path, char *dest) dest[src-path] = 0; } -void ExtractFileName (const char *path, char *dest) +void HYDRA_ExtractFileName (const char *path, char *dest) { const char *src; @@ -242,7 +105,7 @@ void ExtractFileName (const char *path, char *dest) *dest = 0; } -void ConvertDOSToUnixName( char *dst, const char *src ) +void HYDRA_ConvertDOSToUnixName( char *dst, const char *src ) { while ( *src ) { @@ -273,7 +136,7 @@ GSList *AddToWadList(GSList *wadlist, const char *shadername, const char *wad) { if (strcmp(shadername,"color") == 0) return wadlist; - ExtractFilePath(shadername,tmpstr); + HYDRA_ExtractFilePath(shadername,tmpstr); // Sys_Printf("checking: %s\n",shadername); int l = strlen(tmpstr) - 1; @@ -282,11 +145,11 @@ GSList *AddToWadList(GSList *wadlist, const char *shadername, const char *wad) tmpstr[l] = 0; else { - Sys_Printf("WARNING: Unknown wad file for shader %s\n",shadername); + Sys_Printf("HydraToolz: WARNING: Unknown wad file for shader %s\n",shadername); return wadlist; } - ExtractFileName(tmpstr,tmpstr); + HYDRA_ExtractFileName(tmpstr,tmpstr); wadname = (char *)malloc(strlen(tmpstr) + 5); sprintf(wadname,"%s.wad",tmpstr); @@ -298,14 +161,14 @@ GSList *AddToWadList(GSList *wadlist, const char *shadername, const char *wad) for (GSList *l = wadlist; l != NULL ; l = l->next) { - if (string_equal_nocase((char *)l->data,wadname)) + if (!stricmp((char *)l->data,wadname)) { free( wadname ); return wadlist; } } - Sys_Printf("Adding Wad File to WAD list: %s (reason: ",wadname); + Sys_Printf("HydraToolz: Adding Wad File to WAD list: %s (reason: ",wadname); if (shadername) Sys_Printf("see shader \"%s\")\n", shadername); else @@ -318,7 +181,7 @@ void UpdateWadKeyPair( void ) int i,nb; char wads[2048]; // change to CString usage ? - wads[0] = 0; + *wads = 0; char *p1,*p2; entity_t *pEntity; epair_t *pEpair; @@ -326,18 +189,20 @@ void UpdateWadKeyPair( void ) face_t *f; brush_t *b; char cleanwadname[QER_MAX_NAMELEN]; - const char *actualwad; + char *actualwad; pEntity = (entity_t *)g_FuncTable.m_pfnGetEntityHandle(0); // get the worldspawn ent - Sys_Printf("Searching for in-use wad files...\n"); + Sys_Printf("HydraToolz: Searching for in-use wad files...\n"); for(pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next) { - if (string_equal_nocase(pEpair->key,"wad")) + if (stricmp(pEpair->key,"wad") == 0) { strcpy(wads,pEpair->value); - ConvertDOSToUnixName(wads,wads); + HYDRA_ConvertDOSToUnixName(wads,wads); + + Sys_Printf("HydraToolz: Current wad key is \"%s\"!\n",wads); // ok, we got the list of ; delimited wads, now split it into a GSList that contains // just the wad names themselves. @@ -352,7 +217,7 @@ void UpdateWadKeyPair( void ) if (strchr(p1,'/') || strchr(p1,'\\')) { - ExtractFileName(p1,cleanwadname); + HYDRA_ExtractFileName(p1,cleanwadname); wadlist = AddToWadList (wadlist, NULL, cleanwadname); } else @@ -375,6 +240,10 @@ void UpdateWadKeyPair( void ) } } + if (!*wads) + Sys_Printf("HydraToolz: No \"wad\" keypair wound in worldspawn\n"); + + nb = g_FuncTable.m_pfnAllocateActiveBrushHandles(); for( i = 0; i < nb; i++ ) { @@ -409,22 +278,24 @@ void UpdateWadKeyPair( void ) } g_FuncTable.m_pfnReleaseSelectedBrushHandles(); + Sys_Printf("HydraToolz: Rebuilding worldspawn's \"wad\" key-pair...\n"); // Now we have a complete list of wadnames (without paths) so we just have to turn this // back to a ; delimited list. - wads[0] = 0; + *wads = 0; while (wadlist) { - if (string_equal_nocase((char *)wadlist->data,"common-hydra.wad")) + // skip wad files if they start with "common-" + if (strnicmp((char *)wadlist->data,"common-",7) == 0) { - Sys_Printf("Skipping radiant-supplied wad file %s\n",(char *)wadlist->data); + Sys_Printf("HydraToolz: Skipping radiant/user-supplied wad file %s\n",(char *)wadlist->data); } else { if (wads[0]) strcat(wads,";"); - actualwad = vfsGetFullPath((char *)wadlist->data); + actualwad = vfsGetFullPath((char *)wadlist->data, 0, 0); if (actualwad) { @@ -432,7 +303,7 @@ void UpdateWadKeyPair( void ) } else { - Sys_Printf("WARNING: could not locate wad file %s\n",(char *)wadlist->data); + Sys_Printf("HydraToolz: WARNING: could not locate wad file %s\n",(char *)wadlist->data); strcat(wads, (char *)wadlist->data); } } @@ -442,25 +313,29 @@ void UpdateWadKeyPair( void ) } // store the wad list back in the worldspawn. - if (wads[0]) + if (*wads) { //free(pEpair->value); //pEpair->value = strdup(wads); SetKeyValue(pEntity, "wad", wads); + Sys_Printf("HydraToolz: Setting worldspawn \"wad\" key value to \"%s\"\n",wads); + } + Sys_Printf("HydraToolz: Finished rebuilding wad keypair!\n"); + } // ============================================================================= // PLUGIN INTERFACE STUFF // plugin name -const char *PLUGIN_NAME = "Q3 Texture Tools"; +const char *PLUGIN_NAME = "HydraToolz"; // commands in the menu const char *PLUGIN_COMMANDS = "About...;Create/Update WAD keypair"; -const char *PLUGIN_ABOUT = "HydraToolz for GTKRadiant\n\n" +const char *PLUGIN_ABOUT = "HydraToolz v1.0 for GTKRadiant\n\n" "By Hydra!"; extern "C" void* WINAPI QERPlug_GetFuncTable () @@ -470,11 +345,6 @@ extern "C" void* WINAPI QERPlug_GetFuncTable () const char* QERPlug_Init (void* hApp, void *pWidget) { - GtkWidget* pMainWidget = static_cast(pWidget); - - g_pMainWnd = pMainWidget; - memset(&g_FuncTable, 0, sizeof(_QERFuncTable_1)); - g_FuncTable.m_nSize = sizeof(_QERFuncTable_1); return "HydraToolz for GTKRadiant"; // do we need this ? hmmm } @@ -493,7 +363,7 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b if(!strcmp(p, "Create/Update WAD keypair")) UpdateWadKeyPair(); else if(!strcmp(p, "About...")) - g_FuncTable.m_pfnMessageBox((GtkWidget*)NULL, PLUGIN_ABOUT, "About", eMB_OK); + g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); } // ============================================================================= @@ -502,8 +372,13 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b CSynapseServer* g_pSynapseServer = NULL; CSynapseClientHydraToolz g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); diff --git a/contrib/hydratoolz/plugin.h b/contrib/hydratoolz/plugin.h index 70e3ea9b..42b3c20c 100644 --- a/contrib/hydratoolz/plugin.h +++ b/contrib/hydratoolz/plugin.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -22,27 +22,20 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "mathlib.h" -#include -#include "qertypes.h" -#include - -#define USE_QERTABLE_DEFINE -#include "iscenegraph.h" -#include "qerplugin.h" - -#include "ifilesystem.h" -#define USE_ENTITYTABLE_DEFINE -#include "ientity.h" - -#include +//#include +//#include #include #include -#include "iplugin.h" - -#include #include "synapse.h" +#include "iplugin.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "ishaders.h" +#define USE_VFSTABLE_DEFINE +#include "ifilesystem.h" +#define USE_ENTITYTABLE_DEFINE +#include "ientity.h" class CSynapseClientHydraToolz : public CSynapseClient { diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 1c6b735f..1bf0b99e 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -17,14 +17,19 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "AboutDialog.h" -#include -#include -#include "version.h" -#include "gtkutil/pointer.h" +// AboutDialog.cpp : implementation file +// -#include "prtview.h" -#include "ConfigDialog.h" +#include "stdafx.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +//static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CAboutDialog dialog static void dialog_button_callback (GtkWidget *widget, gpointer data) { @@ -36,7 +41,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data) ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = gpointer_to_int(data); + *ret = (int)data; } static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) @@ -100,6 +105,5 @@ void DoAboutDlg () gtk_widget_destroy (dlg); } - ///////////////////////////////////////////////////////////////////////////// // CAboutDialog message handlers diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 8acf47f7..c73cda9c 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -17,15 +17,20 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ConfigDialog.h" +// ConfigDialog.cpp : implementation file +// + +#include "stdafx.h" #include -#include -#include "gtkutil/pointer.h" -#include "iscenegraph.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +//static char THIS_FILE[] = __FILE__; +#endif -#include "prtview.h" -#include "portals.h" +///////////////////////////////////////////////////////////////////////////// +// CConfigDialog dialog static void dialog_button_callback (GtkWidget *widget, gpointer data) { @@ -37,7 +42,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data) ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = gpointer_to_int(data); + *ret = (int)data; } static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) @@ -54,10 +59,10 @@ static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer // ============================================================================= // Color selection dialog -static int DoColor (PackedColour *c) +static int DoColor (COLORREF *c) { GtkWidget* dlg; - double clr[4]; + double clr[3]; int loop = 1, ret = IDCANCEL; clr[0] = ((double)GetRValue (*c)) / 255.0; @@ -134,60 +139,64 @@ static void SetClipText (GtkWidget* label) static void OnScroll2d (GtkAdjustment *adj, gpointer data) { - portals.width_2d = static_cast(adj->value); + portals.width_2d = adj->value; Set2DText (GTK_WIDGET (data)); - Portals_shadersChanged(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); } static void OnScroll3d (GtkAdjustment *adj, gpointer data) { - portals.width_3d = static_cast(adj->value); + portals.width_3d = adj->value; Set3DText (GTK_WIDGET (data)); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnScrollTrans (GtkAdjustment *adj, gpointer data) { - portals.trans_3d = static_cast(adj->value); + portals.trans_3d = adj->value; Set3DTransText (GTK_WIDGET (data)); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnScrollClip (GtkAdjustment *adj, gpointer data) { - portals.clip_range = static_cast(adj->value); + portals.clip_range = adj->value; SetClipText (GTK_WIDGET (data)); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnAntiAlias2d (GtkWidget *widget, gpointer data) { portals.aa_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - Portals_shadersChanged(); - - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); } static void OnConfig2d (GtkWidget *widget, gpointer data) { portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); } static void OnColor2d (GtkWidget *widget, gpointer data) { if (DoColor (&portals.color_2d) == IDOK) { - Portals_shadersChanged(); + portals.FixColors(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); } } @@ -195,7 +204,8 @@ static void OnConfig3d (GtkWidget *widget, gpointer data) { portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } @@ -203,17 +213,18 @@ static void OnAntiAlias3d (GtkWidget *widget, gpointer data) { portals.aa_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - Portals_shadersChanged(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnColor3d (GtkWidget *widget, gpointer data) { if (DoColor (&portals.color_3d) == IDOK) { - Portals_shadersChanged(); + portals.FixColors(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } } @@ -221,9 +232,10 @@ static void OnColorFog (GtkWidget *widget, gpointer data) { if (DoColor (&portals.color_fog) == IDOK) { - Portals_shadersChanged(); + portals.FixColors(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } } @@ -231,37 +243,40 @@ static void OnFog (GtkWidget *widget, gpointer data) { portals.fog = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - Portals_shadersChanged(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnSelchangeZbuffer (GtkWidget *widget, gpointer data) { - portals.zbuffer = gpointer_to_int(data); + portals.zbuffer = GPOINTER_TO_INT (data); - Portals_shadersChanged(); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnPoly (GtkWidget *widget, gpointer data) { portals.polygons = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnLines (GtkWidget *widget, gpointer data) { portals.lines = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } static void OnClip (GtkWidget *widget, gpointer data) { portals.clip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false; - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); } void DoConfigDialog () @@ -523,4 +538,3 @@ void DoConfigDialog () gtk_grab_remove (dlg); gtk_widget_destroy (dlg); } - diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index d9984a0b..8d6b5318 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -20,18 +20,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // LoadPortalFileDialog.cpp : implementation file // -#include "LoadPortalFileDialog.h" +#include "stdafx.h" -#include -#include -#include "stream/stringstream.h" -#include "convert.h" -#include "gtkutil/pointer.h" - -#include "qerplugin.h" - -#include "prtview.h" -#include "portals.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +//static char THIS_FILE[] = __FILE__; +#endif static void dialog_button_callback (GtkWidget *widget, gpointer data) { @@ -43,7 +38,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data) ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = gpointer_to_int(data); + *ret = (int)data; } static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) @@ -68,7 +63,7 @@ static void file_sel_callback (GtkWidget *widget, gpointer data) filename = (char**)g_object_get_data (G_OBJECT (parent), "filename"); *loop = 0; - if (gpointer_to_int(data) == IDOK) + if ((int)data == IDOK) *filename = g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent))); } @@ -168,16 +163,16 @@ int DoLoadPortalFileDialog () GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); gtk_widget_set_usize (button, 60, -2); - strcpy (portals.fn, GlobalRadiant().getMapName()); - char* fn = strrchr (portals.fn, '.'); + char *fn = g_FuncTable.m_pfnGetMapName(); + strcpy (portals.fn, fn); + fn = strrchr (portals.fn, '.'); if (fn != NULL) { - strcpy(fn, ".prt"); + *fn = '\0'; + strcat (portals.fn, ".prt"); } - StringOutputStream value(256); - value << ConvertLocaleToUTF8(portals.fn); - gtk_entry_set_text (GTK_ENTRY (entry), value.c_str()); + gtk_entry_set_text (GTK_ENTRY (entry), portals.fn); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check2d), portals.show_2d); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check3d), portals.show_3d); diff --git a/contrib/prtview/LoadPortalFileDialog.h b/contrib/prtview/LoadPortalFileDialog.h index a4a40c6c..433d5708 100644 --- a/contrib/prtview/LoadPortalFileDialog.h +++ b/contrib/prtview/LoadPortalFileDialog.h @@ -17,10 +17,11 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_LOADPORTALFILEDIALOG_H) -#define INCLUDED_LOADPORTALFILEDIALOG_H +#if !defined(AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_) +#define AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_ -int DoLoadPortalFileDialog (); - -#endif +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +#endif // !defined(AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_) diff --git a/contrib/prtview/PrtView.def b/contrib/prtview/PrtView.def index 7c18cf88..24f945d7 100644 --- a/contrib/prtview/PrtView.def +++ b/contrib/prtview/PrtView.def @@ -1,7 +1,8 @@ ; PrtView.def : Declares the module parameters for the DLL. LIBRARY "PrtView" +; DESCRIPTION 'PrtView Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here - Radiant_RegisterModules @1 + Synapse_EnumerateInterfaces @1 diff --git a/contrib/prtview/PrtView.rc b/contrib/prtview/PrtView.rc new file mode 100644 index 00000000..d876753a --- /dev/null +++ b/contrib/prtview/PrtView.rc @@ -0,0 +1,264 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""res\\PrtView.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 0,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Q3Radiant Portal Viewer\0" + VALUE "FileVersion", "1.000\0" + VALUE "InternalName", "PrtView\0" + VALUE "LegalCopyright", "GNU Copyleft (C) 2000\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "PrtView.DLL\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Q3Radiant Portal Viewer\0" + VALUE "ProductVersion", "1.000\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 186, 52 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Portal Viewer" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,129,16,50,14 + LTEXT "Version 1.000\r\rWritten by Geoffrey DeWan\rgdewan@prairienet.org", + IDC_STATIC,7,7,116,38 +END + +IDD_LOAD DIALOGEX 0, 0, 224, 69 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Load .prt" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,167,48,50,14 + PUSHBUTTON "Change",IDC_LOAD_OTHER,167,22,50,14 + CONTROL "Show 3D",IDC_LOAD_3D,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,23,52,13 + CONTROL "Show 2D",IDC_LOAD_2D,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,67,23,61,13 + PUSHBUTTON "Cancel",IDCANCEL,113,48,50,14 + LTEXT "",IDC_LOAD_FILE_NAME,7,7,209,12,SS_CENTERIMAGE, + WS_EX_CLIENTEDGE +END + +IDD_CONFIG DIALOG DISCARDABLE 0, 0, 262, 260 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Portal Viewer Configuration" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,205,239,50,14 + GROUPBOX "3D View",IDC_STATIC,7,7,248,149 + SCROLLBAR IDC_SCROLL_3D_WIDTH,15,20,144,10 + LTEXT "-",IDC_3D_WIDTH,167,20,82,10,SS_CENTERIMAGE + PUSHBUTTON "Color",IDC_COLOR_3D,15,41,50,14 + CONTROL "Anti-Alias (May not work on some video cards)", + IDC_ANTI_ALIAS_3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 81,38,174,17 + PUSHBUTTON "Depth Color",IDC_COLOR_FOG,15,60,50,14 + CONTROL "Depth Cue",IDC_FOG,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,81,61,57,13 + CONTROL "Lines",IDC_LINES,"Button",BS_AUTO3STATE | WS_TABSTOP, + 140,61,49,13 + CONTROL "Polygons",IDC_POLY,"Button",BS_AUTO3STATE | WS_TABSTOP, + 206,61,49,13 + COMBOBOX IDC_ZBUFFER,15,85,231,109,CBS_DROPDOWNLIST | WS_TABSTOP + SCROLLBAR IDC_SCROLL_3D_TRANS,15,105,128,10 + LTEXT "-",IDC_3D_TRANS,152,105,95,10,SS_CENTERIMAGE + CONTROL "Show",IDC_CONFIG_3D,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,137,52,13 + GROUPBOX "2D View",IDC_STATIC,7,158,248,72 + SCROLLBAR IDC_SCROLL_2D_WIDTH,15,172,144,10 + LTEXT "-",IDC_2D_WIDTH,166,172,82,10,SS_CENTERIMAGE + PUSHBUTTON "Color",IDC_COLOR_2D,15,190,50,14 + CONTROL "Anti-Alias (May not work on some video cards)", + IDC_ANTI_ALIAS_2D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 81,193,174,13 + CONTROL "Show",IDC_CONFIG_2D,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,212,61,13 + SCROLLBAR IDC_SCROLL_CUBIC,15,122,128,10 + LTEXT "-",IDC_CUBIC,152,122,95,10,SS_CENTERIMAGE + CONTROL "Portal cubic clipper",IDC_CLIP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,147,137,52,13 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 45 + END + + IDD_LOAD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 217 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 255 + VERTGUIDE, 15 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 21 + HORZGUIDE, 31 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog Info +// + +IDD_CONFIG DLGINIT +BEGIN + IDC_ZBUFFER, 0x403, 62, 0 +0x2d5a, 0x7542, 0x6666, 0x7265, 0x5420, 0x7365, 0x2074, 0x6e61, 0x2064, +0x7257, 0x7469, 0x2065, 0x7228, 0x6365, 0x6d6f, 0x656d, 0x646e, 0x6620, +0x726f, 0x7320, 0x6c6f, 0x6469, 0x2020, 0x726f, 0x6e20, 0x206f, 0x6f70, +0x796c, 0x6f67, 0x736e, 0x0029, + IDC_ZBUFFER, 0x403, 56, 0 +0x2d5a, 0x7542, 0x6666, 0x7265, 0x5420, 0x7365, 0x2074, 0x6e4f, 0x796c, +0x2820, 0x6572, 0x6f63, 0x6d6d, 0x6e65, 0x2064, 0x6f66, 0x2072, 0x7274, +0x6e61, 0x7073, 0x7261, 0x6e65, 0x2074, 0x6f70, 0x796c, 0x6f67, 0x736e, +0x0029, + IDC_ZBUFFER, 0x403, 13, 0 +0x2d5a, 0x7542, 0x6666, 0x7265, 0x4f20, 0x6666, "\000" + 0 +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "res\PrtView.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/contrib/prtview/PrtView.vcproj b/contrib/prtview/PrtView.vcproj index 0c896bc9..9ecb4e33 100644 --- a/contrib/prtview/PrtView.vcproj +++ b/contrib/prtview/PrtView.vcproj @@ -1,333 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/prtview/gtkdlgs.cpp b/contrib/prtview/gtkdlgs.cpp new file mode 100644 index 00000000..f33c79b2 --- /dev/null +++ b/contrib/prtview/gtkdlgs.cpp @@ -0,0 +1,732 @@ +/* +PrtView plugin for GtkRadiant +Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +// +// PrtView dialogs done with GTK+ +// + +#include +#include "stdafx.h" + +// ============================================================================= +// Static functions + +static void dialog_button_callback (GtkWidget *widget, gpointer data) +{ + GtkWidget *parent; + int *loop, *ret; + + parent = gtk_widget_get_toplevel (widget); + loop = (int*)g_object_get_data (G_OBJECT (parent), "loop"); + ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); + + *loop = 0; + *ret = (int)data; +} + +static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + int *loop; + + gtk_widget_hide (widget); + loop = (int*)g_object_get_data (G_OBJECT (widget), "loop"); + *loop = 0; + + return TRUE; +} + +static void file_sel_callback (GtkWidget *widget, gpointer data) +{ + GtkWidget *parent; + int *loop; + char **filename; + + parent = gtk_widget_get_toplevel (widget); + loop = (int*)g_object_get_data (G_OBJECT (parent), "loop"); + filename = (char**)g_object_get_data (G_OBJECT (parent), "filename"); + + *loop = 0; + if ((int)data == IDOK) + *filename = g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent))); +} + +static void change_clicked (GtkWidget *widget, gpointer data) +{ + GtkWidget* file_sel; + char* filename = NULL; + int loop = 1; + + file_sel = gtk_file_selection_new ("Locate portal (.prt) file"); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->ok_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDOK)); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->cancel_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_signal_connect (GTK_OBJECT (file_sel), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (file_sel)); + + g_object_set_data (G_OBJECT (file_sel), "loop", &loop); + g_object_set_data (G_OBJECT (file_sel), "filename", &filename); + gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_sel), portals.fn); + + gtk_grab_add (file_sel); + gtk_widget_show (file_sel); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (file_sel); + gtk_widget_destroy (file_sel); + + if (filename != NULL) + { + strcpy (portals.fn, filename); + gtk_entry_set_text (GTK_ENTRY (data), filename); + g_free (filename); + } +} + +// ============================================================================= +// LoadPortalFile dialog + +int DoLoadPortalFileDialog () +{ + GtkWidget *dlg, *vbox, *hbox, *button, *entry, *check2d, *check3d; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Load .prt"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_entry_set_editable (GTK_ENTRY (entry), FALSE); + gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + check3d = gtk_check_button_new_with_label ("Show 3D"); + gtk_widget_show (check3d); + gtk_box_pack_start (GTK_BOX (hbox), check3d, FALSE, FALSE, 0); + + check2d = gtk_check_button_new_with_label ("Show 2D"); + gtk_widget_show (check2d); + gtk_box_pack_start (GTK_BOX (hbox), check2d, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Change"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (change_clicked), entry); + gtk_widget_set_usize (button, 60, -2); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + char *fn = g_IBSPTable.m_pfnGetMapName(); + strcpy (portals.fn, fn); + fn = strrchr (portals.fn, '.'); + if (fn != NULL) + { + *fn = '\0'; + strcat (portals.fn, ".prt"); + } + + gtk_entry_set_text (GTK_ENTRY (entry), portals.fn); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check2d), portals.show_2d); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check3d), portals.show_3d); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + portals.Purge(); + + portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check3d)); + portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check2d)); + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return ret; +} + +// ============================================================================= +// About dialog + +void DoAboutDlg () +{ + GtkWidget *dlg, *hbox, *vbox, *button, *label; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "About Portal Viewer"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); + + label = gtk_label_new ("Version 1.000\n\n" + "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n" + "Written by Geoffrey DeWan\ngdewan@prairienet.org"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Config dialog + +static int DoColor (COLORREF *c) +{ + GtkWidget* dlg; + double clr[3]; + int loop = 1, ret = IDCANCEL; + + clr[0] = ((double)GetRValue (*c)) / 255.0; + clr[1] = ((double)GetGValue (*c)) / 255.0; + clr[2] = ((double)GetBValue (*c)) / 255.0; + + dlg = gtk_color_selection_dialog_new ("Choose Color"); + gtk_color_selection_set_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), clr); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->ok_button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->cancel_button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + gtk_widget_show(dlg); + gtk_grab_add(dlg); + + while (loop) + gtk_main_iteration (); + + gtk_color_selection_get_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), clr); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + if (ret == IDOK) + { + *c = RGB (clr[0]*255, clr[1]*255, clr[2]*255); + } + + return ret; +} + +static void Set2DText (GtkWidget* label) +{ + char s[40]; + + sprintf(s, "Line Width = %6.3f", portals.width_2d * 0.5f); + + gtk_label_set_text (GTK_LABEL (label), s); +} + +static void Set3DText (GtkWidget* label) +{ + char s[40]; + + sprintf(s, "Line Width = %6.3f", portals.width_3d * 0.5f); + + gtk_label_set_text (GTK_LABEL (label), s); +} + +static void Set3DTransText (GtkWidget* label) +{ + char s[40]; + + sprintf(s, "Polygon transparency = %d%%", (int)portals.trans_3d); + + gtk_label_set_text (GTK_LABEL (label), s); +} + +static void SetClipText (GtkWidget* label) +{ + char s[40]; + + sprintf(s, "Cubic clip range = %d", (int)portals.clip_range * 64); + + gtk_label_set_text (GTK_LABEL (label), s); +} + +static void OnScroll2d (GtkAdjustment *adj, gpointer data) +{ + portals.width_2d = adj->value; + Set2DText (GTK_WIDGET (data)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); +} + +static void OnScroll3d (GtkAdjustment *adj, gpointer data) +{ + portals.width_3d = adj->value; + Set3DText (GTK_WIDGET (data)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnScrollTrans (GtkAdjustment *adj, gpointer data) +{ + portals.trans_3d = adj->value; + Set3DTransText (GTK_WIDGET (data)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnScrollClip (GtkAdjustment *adj, gpointer data) +{ + portals.clip_range = adj->value; + SetClipText (GTK_WIDGET (data)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnAntiAlias2d (GtkWidget *widget, gpointer data) +{ + portals.aa_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); +} + +static void OnConfig2d (GtkWidget *widget, gpointer data) +{ + portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); +} + +static void OnColor2d (GtkWidget *widget, gpointer data) +{ + if (DoColor (&portals.color_2d) == IDOK) + { + portals.FixColors(); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D); + } +} + +static void OnConfig3d (GtkWidget *widget, gpointer data) +{ + portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + + +static void OnAntiAlias3d (GtkWidget *widget, gpointer data) +{ + portals.aa_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnColor3d (GtkWidget *widget, gpointer data) +{ + if (DoColor (&portals.color_3d) == IDOK) + { + portals.FixColors(); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); + } +} + +static void OnColorFog (GtkWidget *widget, gpointer data) +{ + if (DoColor (&portals.color_fog) == IDOK) + { + portals.FixColors(); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); + } +} + +static void OnFog (GtkWidget *widget, gpointer data) +{ + portals.fog = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnSelchangeZbuffer (GtkWidget *widget, gpointer data) +{ + portals.zbuffer = GPOINTER_TO_INT (data); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnPoly (GtkWidget *widget, gpointer data) +{ + portals.polygons = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnLines (GtkWidget *widget, gpointer data) +{ + portals.lines = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +static void OnClip (GtkWidget *widget, gpointer data) +{ + portals.clip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D); +} + +void DoConfigDialog () +{ + GtkWidget *dlg, *hbox, *vbox, *vbox2, *button, *table, *frame; + GtkWidget *lw3slider, *lw3label, *lw2slider, *lw2label, *zlist, *menu, *item; + GtkWidget *aa2check, *aa3check, *depthcheck, *linescheck, *polyscheck; + GtkWidget *transslider, *translabel, *clipslider, *cliplabel; + GtkWidget *show2check, *show3check, *portalcheck; + int loop = 1, ret = IDCANCEL; + GtkObject *adj; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Portal Viewer Configuration"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + frame = gtk_frame_new ("3D View"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, TRUE, 0); + + adj = gtk_adjustment_new (portals.width_3d, 2, 40, 1, 1, 1); + lw3slider = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (lw3slider); + gtk_box_pack_start (GTK_BOX (hbox), lw3slider, TRUE, TRUE, 0); + gtk_scale_set_draw_value (GTK_SCALE (lw3slider), FALSE); + + lw3label = gtk_label_new (""); + gtk_widget_show (lw3label); + gtk_box_pack_start (GTK_BOX (hbox), lw3label, FALSE, TRUE, 0); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScroll3d), lw3label); + + table = gtk_table_new (2, 4, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + button = gtk_button_new_with_label ("Color"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColor3d), NULL); + + button = gtk_button_new_with_label ("Depth Color"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColorFog), NULL); + + aa3check = gtk_check_button_new_with_label ("Anti-Alias (May not work on some video cards)"); + gtk_widget_show (aa3check); + gtk_table_attach (GTK_TABLE (table), aa3check, 1, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (aa3check), "toggled", GTK_SIGNAL_FUNC (OnAntiAlias3d), NULL); + + depthcheck = gtk_check_button_new_with_label ("Depth Cue"); + gtk_widget_show (depthcheck); + gtk_table_attach (GTK_TABLE (table), depthcheck, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (depthcheck), "toggled", GTK_SIGNAL_FUNC (OnFog), NULL); + + linescheck = gtk_check_button_new_with_label ("Lines"); + gtk_widget_show (linescheck); + gtk_table_attach (GTK_TABLE (table), linescheck, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (linescheck), "toggled", GTK_SIGNAL_FUNC (OnLines), NULL); + + polyscheck = gtk_check_button_new_with_label ("Polygons"); + gtk_widget_show (polyscheck); + gtk_table_attach (GTK_TABLE (table), polyscheck, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (polyscheck), "toggled", GTK_SIGNAL_FUNC (OnPoly), NULL); + + zlist = gtk_option_menu_new (); + gtk_widget_show (zlist); + gtk_box_pack_start (GTK_BOX (vbox2), zlist, TRUE, FALSE, 0); + + menu = gtk_menu_new (); + gtk_widget_show (menu); + gtk_option_menu_set_menu (GTK_OPTION_MENU (zlist), menu); + + item = gtk_menu_item_new_with_label ("Z-Buffer Test and Write (recommended for solid or no polygons)"); + gtk_widget_show (item); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (0)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label ("Z-Buffer Test Only (recommended for transparent polygons)"); + gtk_widget_show (item); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (1)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label ("Z-Buffer Off"); + gtk_widget_show (item); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (2)); + gtk_menu_append (GTK_MENU (menu), item); + + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + adj = gtk_adjustment_new (portals.trans_3d, 0, 100, 1, 1, 1); + transslider = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (transslider); + gtk_table_attach (GTK_TABLE (table), transslider, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_scale_set_draw_value (GTK_SCALE (transslider), FALSE); + + translabel = gtk_label_new (""); + gtk_widget_show (translabel); + gtk_table_attach (GTK_TABLE (table), translabel, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (translabel), 0.0, 0.0); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScrollTrans), translabel); + + adj = gtk_adjustment_new (portals.clip_range, 1, 128, 1, 1, 1); + clipslider = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (clipslider); + gtk_table_attach (GTK_TABLE (table), clipslider, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_scale_set_draw_value (GTK_SCALE (clipslider), FALSE); + + cliplabel = gtk_label_new (""); + gtk_widget_show (cliplabel); + gtk_table_attach (GTK_TABLE (table), cliplabel, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (cliplabel), 0.0, 0.0); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScrollClip), cliplabel); + + hbox = gtk_hbox_new (TRUE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); + + show3check = gtk_check_button_new_with_label ("Show"); + gtk_widget_show (show3check); + gtk_box_pack_start (GTK_BOX (hbox), show3check, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (show3check), "toggled", GTK_SIGNAL_FUNC (OnConfig3d), NULL); + + portalcheck = gtk_check_button_new_with_label ("Portal cubic clipper"); + gtk_widget_show (portalcheck); + gtk_box_pack_start (GTK_BOX (hbox), portalcheck, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (portalcheck), "toggled", GTK_SIGNAL_FUNC (OnClip), NULL); + + frame = gtk_frame_new ("2D View"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); + + adj = gtk_adjustment_new (portals.width_2d, 2, 40, 1, 1, 1); + lw2slider = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (lw2slider); + gtk_box_pack_start (GTK_BOX (hbox), lw2slider, TRUE, TRUE, 0); + gtk_scale_set_draw_value (GTK_SCALE (lw2slider), FALSE); + + lw2label = gtk_label_new (""); + gtk_widget_show (lw2label); + gtk_box_pack_start (GTK_BOX (hbox), lw2label, FALSE, TRUE, 0); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScroll2d), lw2label); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); + + button = gtk_button_new_with_label ("Color"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColor2d), NULL); + gtk_widget_set_usize (button, 60, -2); + + aa2check = gtk_check_button_new_with_label ("Anti-Alias (May not work on some video cards)"); + gtk_widget_show (aa2check); + gtk_box_pack_start (GTK_BOX (hbox), aa2check, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (aa2check), "toggled", GTK_SIGNAL_FUNC (OnAntiAlias2d), NULL); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); + + show2check = gtk_check_button_new_with_label ("Show"); + gtk_widget_show (show2check); + gtk_box_pack_start (GTK_BOX (hbox), show2check, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (show2check), "toggled", GTK_SIGNAL_FUNC (OnConfig2d), NULL); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + // initialize dialog + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show2check), portals.show_2d); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aa2check), portals.aa_2d); + Set2DText (lw2label); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show3check), portals.show_3d); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (depthcheck), portals.fog); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (polyscheck), portals.polygons); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (linescheck), portals.lines); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aa3check), portals.aa_3d); + gtk_option_menu_set_history (GTK_OPTION_MENU (zlist), portals.zbuffer); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (portalcheck), portals.clip); + + Set3DText (lw3label); + Set3DTransText (translabel); + SetClipText (cliplabel); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} diff --git a/contrib/prtview/ConfigDialog.h b/contrib/prtview/gtkdlgs.h similarity index 88% rename from contrib/prtview/ConfigDialog.h rename to contrib/prtview/gtkdlgs.h index ef35db06..37ca5031 100644 --- a/contrib/prtview/ConfigDialog.h +++ b/contrib/prtview/gtkdlgs.h @@ -17,9 +17,11 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_CONFIGDIALOG_H) -#define INCLUDED_CONFIGDIALOG_H +#ifndef _GTKDLGS_H_ +#define _GTKDLGS_H_ +int DoLoadPortalFileDialog (); +void DoAboutDlg (); void DoConfigDialog (); -#endif +#endif // _GTKDLGS_H_ diff --git a/contrib/prtview/portals.cpp b/contrib/prtview/portals.cpp index d3bef1b6..0c57d214 100644 --- a/contrib/prtview/portals.cpp +++ b/contrib/prtview/portals.cpp @@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "portals.h" +#include "stdafx.h" #include #include #ifndef __APPLE__ @@ -25,11 +25,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #endif #include -#include "iglrender.h" -#include "cullable.h" - -#include "prtview.h" - #define LINE_BUF 1000 CPortals portals; @@ -58,7 +53,7 @@ CBspPortal::~CBspPortal() delete[] inner_point; } -bool CBspPortal::Build(char *def) +qboolean CBspPortal::Build(char *def) { char *c = def; unsigned int n; @@ -72,11 +67,11 @@ bool CBspPortal::Build(char *def) else { sscanf(def, "%u", &point_count); - hint = false; + hint = FALSE; } if(point_count < 3 || (portals.hint_flags && res_cnt < 4)) - return false; + return FALSE; point = new CBspPoint[point_count]; inner_point = new CBspPoint[point_count]; @@ -86,7 +81,7 @@ bool CBspPortal::Build(char *def) for(; *c != 0 && *c != '('; c++); if(*c == 0) - return false; + return FALSE; c++; @@ -132,7 +127,7 @@ bool CBspPortal::Build(char *def) fp_color_random[2] = (float)(rand() & 0xff) / 255.0f; fp_color_random[3] = 1.0f; - return true; + return TRUE; } CPortals::CPortals() @@ -168,7 +163,7 @@ void CPortals::Load() Purge(); - globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n"; + Sys_Printf(MSG_PREFIX "Loading portal file %s.\n", fn); FILE *in; @@ -176,7 +171,7 @@ void CPortals::Load() if(in == NULL) { - globalOutputStream() << " ERROR - could not open file.\n"; + Sys_Printf(" ERROR - could not open file.\n"); return; } @@ -185,7 +180,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -194,7 +189,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File header indicates wrong file type (should be \"PRT1\").\n"; + Sys_Printf(" ERROR - File header indicates wrong file type (should be \"PRT1\").\n"); return; } @@ -203,7 +198,7 @@ void CPortals::Load() { fclose(in); - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -216,7 +211,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - Extreme number of nodes, aborting.\n"; + Sys_Printf(" ERROR - Extreme number of nodes, aborting.\n"); return; } @@ -228,7 +223,7 @@ void CPortals::Load() node_count = 0; - globalOutputStream() << " ERROR - File ended prematurely.\n"; + Sys_Printf(" ERROR - File ended prematurely.\n"); return; } @@ -242,19 +237,19 @@ void CPortals::Load() portal_count = 0; node_count = 0; - globalOutputStream() << " ERROR - Extreme number of portals, aborting.\n"; + Sys_Printf(" ERROR - Extreme number of portals, aborting.\n"); return; } - if(portal_count == 0) + if(portal_count < 0) { fclose(in); portal_count = 0; node_count = 0; - globalOutputStream() << " ERROR - number of portals equals 0, aborting.\n"; + Sys_Printf(" ERROR - number of portals equals 0, aborting.\n"); return; } @@ -264,10 +259,10 @@ void CPortals::Load() portal_sort = new int[portal_count]; unsigned int n; - bool first = true; + qboolean first = TRUE; unsigned test_vals_1, test_vals_2; - hint_flags = false; + hint_flags = FALSE; for(n = 0; n < portal_count; ) { @@ -277,7 +272,7 @@ void CPortals::Load() Purge(); - globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << portal_count << ".\n"; + Sys_Printf(" ERROR - Could not find information for portal number %d of %d.\n", n + 1, portal_count); return; } @@ -287,17 +282,17 @@ void CPortals::Load() if(first && sscanf(buf, "%d %d", &test_vals_1, &test_vals_2) == 1) // skip additional counts of later data, not needed { // We can count on hint flags being in the file - hint_flags = true; + hint_flags = TRUE; continue; } - first = false; + first = FALSE; fclose(in); Purge(); - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << portal_count << " is not formatted correctly.\n"; + Sys_Printf(" ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, portal_count); return; } @@ -307,135 +302,7 @@ void CPortals::Load() fclose(in); - globalOutputStream() << " " << node_count << " portals read in.\n"; -} - -#include "math/matrix.h" - -const char* g_state_solid = "$plugins/prtview/solid"; -const char* g_state_solid_outline = "$plugins/prtview/solid_outline"; -const char* g_state_wireframe = "$plugins/prtview/wireframe"; -Shader* g_shader_solid = 0; -Shader* g_shader_solid_outline = 0; -Shader* g_shader_wireframe = 0; - -void Portals_constructShaders() -{ - OpenGLState state; - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortOverlayFirst; - state.m_linewidth = portals.width_2d * 0.5f; - state.m_colour[0] = portals.fp_color_2d[0]; - state.m_colour[1] = portals.fp_color_2d[1]; - state.m_colour[2] = portals.fp_color_2d[2]; - state.m_colour[3] = portals.fp_color_2d[3]; - if(portals.aa_2d) - { - state.m_state |= RENDER_BLEND|RENDER_LINESMOOTH; - } - GlobalOpenGLStateLibrary().insert(g_state_wireframe, state); - - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_FILL|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_COLOURCHANGE|RENDER_SMOOTH; - - if(portals.aa_3d) - { - state.m_state |= RENDER_POLYGONSMOOTH; - } - - switch(portals.zbuffer) - { - case 1: - state.m_state |= RENDER_DEPTHTEST; - break; - case 2: - break; - default: - state.m_state |= RENDER_DEPTHTEST; - state.m_state |= RENDER_DEPTHWRITE; - } - - if(portals.fog) - { - state.m_state |= RENDER_FOG; - - state.m_fog.mode = GL_EXP; - state.m_fog.density = 0.001f; - state.m_fog.start = 10.0f; - state.m_fog.end = 10000.0f; - state.m_fog.index = 0; - state.m_fog.colour[0] = portals.fp_color_fog[0]; - state.m_fog.colour[1] = portals.fp_color_fog[1]; - state.m_fog.colour[2] = portals.fp_color_fog[2]; - state.m_fog.colour[3] = portals.fp_color_fog[3]; - } - - GlobalOpenGLStateLibrary().insert(g_state_solid, state); - - GlobalOpenGLStateLibrary().getDefaultState(state); - state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortOverlayFirst; - state.m_linewidth = portals.width_3d * 0.5f; - state.m_colour[0] = portals.fp_color_3d[0]; - state.m_colour[1] = portals.fp_color_3d[1]; - state.m_colour[2] = portals.fp_color_3d[2]; - state.m_colour[3] = portals.fp_color_3d[3]; - - if(portals.aa_3d) - { - state.m_state |= RENDER_LINESMOOTH; - } - - switch(portals.zbuffer) - { - case 1: - state.m_state |= RENDER_DEPTHTEST; - break; - case 2: - break; - default: - state.m_state |= RENDER_DEPTHTEST; - state.m_state |= RENDER_DEPTHWRITE; - } - - if(portals.fog) - { - state.m_state |= RENDER_FOG; - - state.m_fog.mode = GL_EXP; - state.m_fog.density = 0.001f; - state.m_fog.start = 10.0f; - state.m_fog.end = 10000.0f; - state.m_fog.index = 0; - state.m_fog.colour[0] = portals.fp_color_fog[0]; - state.m_fog.colour[1] = portals.fp_color_fog[1]; - state.m_fog.colour[2] = portals.fp_color_fog[2]; - state.m_fog.colour[3] = portals.fp_color_fog[3]; - } - - GlobalOpenGLStateLibrary().insert(g_state_solid_outline, state); - - g_shader_solid = GlobalShaderCache().capture(g_state_solid); - g_shader_solid_outline = GlobalShaderCache().capture(g_state_solid_outline); - g_shader_wireframe = GlobalShaderCache().capture(g_state_wireframe); -} - -void Portals_destroyShaders() -{ - GlobalShaderCache().release(g_state_solid); - GlobalShaderCache().release(g_state_solid_outline); - GlobalShaderCache().release(g_state_wireframe); - GlobalOpenGLStateLibrary().erase(g_state_solid); - GlobalOpenGLStateLibrary().erase(g_state_solid_outline); - GlobalOpenGLStateLibrary().erase(g_state_wireframe); -} - -void Portals_shadersChanged() -{ - Portals_destroyShaders(); - portals.FixColors(); - Portals_constructShaders(); + Sys_Printf(" %u portals read in.\n", node_count, portal_count); } void CPortals::FixColors() @@ -456,197 +323,480 @@ void CPortals::FixColors() fp_color_fog[3] = 1.0f; } -void CPortalsRender::renderWireframe(Renderer& renderer, const VolumeTest& volume) const +CPortalsRender::CPortalsRender() +{ + refCount = 1; +} + +CPortalsRender::~CPortalsRender() +{ +} + +void CPortalsRender::Register() +{ + g_QglTable.m_pfnHookGL2DWindow( this ); + g_QglTable.m_pfnHookGL3DWindow( this ); +} + +void CPortalsRender::Draw2D( VIEWTYPE vt ) { if(!portals.show_2d || portals.portal_count < 1) return; - renderer.SetState(g_shader_wireframe, Renderer::eWireframeOnly); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); - renderer.addRenderable(m_drawWireframe, g_matrix4_identity); -} + if(portals.aa_2d) + { + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH); + } + else + { + g_QglTable.m_pfn_qglDisable(GL_BLEND); + g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH); + } + + switch(vt) + { + case XY: + break; + case XZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + break; + case YZ: + g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f); + g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f); + break; + } + + g_QglTable.m_pfn_qglLineWidth(portals.width_2d * 0.5f); + + g_QglTable.m_pfn_qglColor4fv(portals.fp_color_2d); -void CPortalsDrawWireframe::render(RenderStateFlags state) const -{ unsigned int n, p; for(n = 0; n < portals.portal_count; n++) { - glBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); for(p = 0; p < portals.portal[n].point_count; p++) - glVertex3fv(portals.portal[n].point[p].p); + g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].point[p].p); - glEnd(); + g_QglTable.m_pfn_qglEnd(); } + + g_QglTable.m_pfn_qglPopAttrib(); } -CubicClipVolume calculateCubicClipVolume(const Matrix4& viewproj) +/* + * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in + * Input: m - the 4x4 matrix + * in - the 4x1 vector + * Output: out - the resulting 4x1 vector. + */ +static void transform_point( GLdouble out[4], const GLdouble m[16], + const GLdouble in[4] ) { - CubicClipVolume clip; - clip.cam = vector4_projected( - matrix4_transformed_vector4( - matrix4_full_inverse(viewproj), - Vector4(0, 0, -1, 1) - ) - ); - clip.min[0] = clip.cam[0] + (portals.clip_range * 64.0f); - clip.min[1] = clip.cam[1] + (portals.clip_range * 64.0f); - clip.min[2] = clip.cam[2] + (portals.clip_range * 64.0f); - clip.max[0] = clip.cam[0] - (portals.clip_range * 64.0f); - clip.max[1] = clip.cam[1] - (portals.clip_range * 64.0f); - clip.max[2] = clip.cam[2] - (portals.clip_range * 64.0f); - return clip; +#define M(row,col) m[col*4+row] + out[0] = M(0,0) * in[0] + M(0,1) * in[1] + M(0,2) * in[2] + M(0,3) * in[3]; + out[1] = M(1,0) * in[0] + M(1,1) * in[1] + M(1,2) * in[2] + M(1,3) * in[3]; + out[2] = M(2,0) * in[0] + M(2,1) * in[1] + M(2,2) * in[2] + M(2,3) * in[3]; + out[3] = M(3,0) * in[0] + M(3,1) * in[1] + M(3,2) * in[2] + M(3,3) * in[3]; +#undef M } -void CPortalsRender::renderSolid(Renderer& renderer, const VolumeTest& volume) const +#include + + +/* + * Perform a 4x4 matrix multiplication (product = a x b). + * Input: a, b - matrices to multiply + * Output: product - product of a and b + */ +static void matmul( GLdouble *product, const GLdouble *a, const GLdouble *b ) +{ + /* This matmul was contributed by Thomas Malik */ + GLdouble temp[16]; + GLint i; + +#define A(row,col) a[(col<<2)+row] +#define B(row,col) b[(col<<2)+row] +#define T(row,col) temp[(col<<2)+row] + + /* i-te Zeile */ + for (i = 0; i < 4; i++) + { + T(i, 0) = A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, 3) * B(3, 0); + T(i, 1) = A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, 3) * B(3, 1); + T(i, 2) = A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, 3) * B(3, 2); + T(i, 3) = A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, 3) * B(3, 3); + } + +#undef A +#undef B +#undef T + memcpy ( product, temp, 16*sizeof(GLdouble) ); +} + + + +/* + * Compute inverse of 4x4 transformation matrix. + * Code contributed by Jacques Leroy jle@star.be + * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) + */ +static GLboolean invert_matrix( const GLdouble *m, GLdouble *out ) +{ +/* NB. OpenGL Matrices are COLUMN major. */ +#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } +#define MAT(m,r,c) (m)[(c)*4+(r)] + + GLdouble wtmp[4][8]; + GLdouble m0, m1, m2, m3, s; + GLdouble *r0, *r1, *r2, *r3; + + r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; + + r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1), + r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3), + r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, + + r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1), + r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3), + r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, + + r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1), + r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3), + r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, + + r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1), + r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3), + r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; + + /* choose pivot - or die */ + if (fabs(r3[0])>fabs(r2[0])) SWAP_ROWS(r3, r2); + if (fabs(r2[0])>fabs(r1[0])) SWAP_ROWS(r2, r1); + if (fabs(r1[0])>fabs(r0[0])) SWAP_ROWS(r1, r0); + if (0.0 == r0[0]) return GL_FALSE; + + /* eliminate first variable */ + m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0]; + s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s; + s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s; + s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s; + s = r0[4]; + if (s != 0.0) { r1[4] -= m1 * s; r2[4] -= m2 * s; r3[4] -= m3 * s; } + s = r0[5]; + if (s != 0.0) { r1[5] -= m1 * s; r2[5] -= m2 * s; r3[5] -= m3 * s; } + s = r0[6]; + if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; } + s = r0[7]; + if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; } + + /* choose pivot - or die */ + if (fabs(r3[1])>fabs(r2[1])) SWAP_ROWS(r3, r2); + if (fabs(r2[1])>fabs(r1[1])) SWAP_ROWS(r2, r1); + if (0.0 == r1[1]) return GL_FALSE; + + /* eliminate second variable */ + m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1]; + r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2]; + r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3]; + s = r1[4]; if (0.0 != s) { r2[4] -= m2 * s; r3[4] -= m3 * s; } + s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; } + s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; } + s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; } + + /* choose pivot - or die */ + if (fabs(r3[2])>fabs(r2[2])) SWAP_ROWS(r3, r2); + if (0.0 == r2[2]) return GL_FALSE; + + /* eliminate third variable */ + m3 = r3[2]/r2[2]; + r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], + r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], + r3[7] -= m3 * r2[7]; + + /* last check */ + if (0.0 == r3[3]) return GL_FALSE; + + s = 1.0/r3[3]; /* now back substitute row 3 */ + r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s; + + m2 = r2[3]; /* now back substitute row 2 */ + s = 1.0/r2[2]; + r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), + r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); + m1 = r1[3]; + r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, + r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; + m0 = r0[3]; + r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, + r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; + + m1 = r1[2]; /* now back substitute row 1 */ + s = 1.0/r1[1]; + r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), + r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); + m0 = r0[2]; + r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, + r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; + + m0 = r0[1]; /* now back substitute row 0 */ + s = 1.0/r0[0]; + r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), + r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); + + MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5], + MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7], + MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5], + MAT(out,1,2) = r1[6]; MAT(out,1,3) = r1[7], + MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5], + MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7], + MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5], + MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; + + return GL_TRUE; + +#undef MAT +#undef SWAP_ROWS +} + +GLint UnProject(GLdouble winx,GLdouble winy,GLdouble winz, + const GLdouble model[16],const GLdouble proj[16], + const GLint viewport[4], + GLdouble *objx,GLdouble *objy,GLdouble *objz) +{ + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4],out[4]; + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0]=(winx-viewport[0])*2/viewport[2] - 1.0; + in[1]=(winy-viewport[1])*2/viewport[3] - 1.0; + in[2]=2*winz - 1.0; + in[3]=1.0; + + /* calcul transformation inverse */ + matmul(A,proj,model); + invert_matrix(A,m); + + /* d'ou les coordonnees objets */ + transform_point(out,m,in); + if (out[3]==0.0) + return GL_FALSE; + *objx=out[0]/out[3]; + *objy=out[1]/out[3]; + *objz=out[2]/out[3]; + return GL_TRUE; +} + +void CPortalsRender::Draw3D() { if(!portals.show_3d || portals.portal_count < 1) return; - CubicClipVolume clip = calculateCubicClipVolume(matrix4_multiplied_by_matrix4(volume.GetProjection(), volume.GetModelview())); + g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS); - if(portals.polygons) - { - renderer.SetState(g_shader_solid, Renderer::eWireframeOnly); - renderer.SetState(g_shader_solid, Renderer::eFullMaterials); - - m_drawSolid.clip = clip; - renderer.addRenderable(m_drawSolid, g_matrix4_identity); - } - - if(portals.lines) - { - renderer.SetState(g_shader_solid_outline, Renderer::eWireframeOnly); - renderer.SetState(g_shader_solid_outline, Renderer::eFullMaterials); - - m_drawSolidOutline.clip = clip; - renderer.addRenderable(m_drawSolidOutline, g_matrix4_identity); - } -} - -void CPortalsDrawSolid::render(RenderStateFlags state) const -{ + double cam[3]; + double proj_m[16]; + double model_m[16]; + float min_check[3]; + float max_check[3]; float trans = (100.0f - portals.trans_3d) / 100.0f; + int view[4]; - unsigned int n, p; + g_QglTable.m_pfn_qglGetDoublev(GL_PROJECTION_MATRIX, proj_m); + g_QglTable.m_pfn_qglGetDoublev(GL_MODELVIEW_MATRIX, model_m); + g_QglTable.m_pfn_qglGetIntegerv(GL_VIEWPORT, view); - if(portals.zbuffer != 0) + UnProject(0.5 * (double)view[2], 0.5 * (double)view[3], 0.0, model_m, proj_m, view, cam, cam+1, cam+2); + + min_check[0] = (float)cam[0] + (portals.clip_range * 64.0f); + min_check[1] = (float)cam[1] + (portals.clip_range * 64.0f); + min_check[2] = (float)cam[2] + (portals.clip_range * 64.0f); + max_check[0] = (float)cam[0] - (portals.clip_range * 64.0f); + max_check[1] = (float)cam[1] - (portals.clip_range * 64.0f); + max_check[2] = (float)cam[2] - (portals.clip_range * 64.0f); + + g_QglTable.m_pfn_qglHint(GL_FOG_HINT, GL_NICEST); + + g_QglTable.m_pfn_qglDisable(GL_CULL_FACE); + + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); + g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH); + + g_QglTable.m_pfn_qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + g_QglTable.m_pfn_qglShadeModel(GL_SMOOTH); + + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + g_QglTable.m_pfn_qglEnable(GL_POLYGON_SMOOTH); + + if(portals.aa_3d) + g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH); + else + g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH); + + if(portals.fog) { - float d; + g_QglTable.m_pfn_qglEnable(GL_FOG); - for(n = 0; n < portals.portal_count; n++) - { - d = (float)clip.cam[0] - portals.portal[n].center.p[0]; - portals.portal[n].dist = d * d; - - d = (float)clip.cam[1] - portals.portal[n].center.p[1]; - portals.portal[n].dist += d * d; - - d = (float)clip.cam[2] - portals.portal[n].center.p[2]; - portals.portal[n].dist += d * d; - - portals.portal_sort[n] = n; - } - - qsort(portals.portal_sort, portals.portal_count, 4, compare); - - for(n = 0; n < portals.portal_count; n++) - { - if(portals.polygons == 2 && !portals.portal[portals.portal_sort[n]].hint) - continue; - - if(portals.clip) - { - if(clip.min[0] < portals.portal[portals.portal_sort[n]].min[0]) - continue; - else if(clip.min[1] < portals.portal[portals.portal_sort[n]].min[1]) - continue; - else if(clip.min[2] < portals.portal[portals.portal_sort[n]].min[2]) - continue; - else if(clip.max[0] > portals.portal[portals.portal_sort[n]].max[0]) - continue; - else if(clip.max[1] > portals.portal[portals.portal_sort[n]].max[1]) - continue; - else if(clip.max[2] > portals.portal[portals.portal_sort[n]].max[2]) - continue; - } - - glColor4f(portals.portal[portals.portal_sort[n]].fp_color_random[0], portals.portal[portals.portal_sort[n]].fp_color_random[1], - portals.portal[portals.portal_sort[n]].fp_color_random[2], trans); - - glBegin(GL_POLYGON); - - for(p = 0; p < portals.portal[portals.portal_sort[n]].point_count; p++) - glVertex3fv(portals.portal[portals.portal_sort[n]].point[p].p); - - glEnd(); - } + g_QglTable.m_pfn_qglFogi(GL_FOG_MODE, GL_EXP); + g_QglTable.m_pfn_qglFogf(GL_FOG_DENSITY, 0.001f); + g_QglTable.m_pfn_qglFogf(GL_FOG_START, 10.0f); + g_QglTable.m_pfn_qglFogf(GL_FOG_END, 10000.0f); + g_QglTable.m_pfn_qglFogi(GL_FOG_INDEX, 0); + g_QglTable.m_pfn_qglFogfv(GL_FOG_COLOR, portals.fp_color_fog); } else { + g_QglTable.m_pfn_qglDisable(GL_FOG); + } + + switch(portals.zbuffer) + { + case 1: + g_QglTable.m_pfn_qglEnable(GL_DEPTH_TEST); + g_QglTable.m_pfn_qglDepthMask(GL_FALSE); + break; + case 2: + g_QglTable.m_pfn_qglDisable(GL_DEPTH_TEST); + break; + default: + g_QglTable.m_pfn_qglEnable(GL_DEPTH_TEST); + g_QglTable.m_pfn_qglDepthMask(GL_TRUE); + } + + g_QglTable.m_pfn_qglLineWidth(portals.width_3d * 0.5f); + + unsigned int n, p; + + if(portals.polygons) + { + if(portals.zbuffer != 0) + { + float d; + + for(n = 0; n < portals.portal_count; n++) + { + d = (float)cam[0] - portals.portal[n].center.p[0]; + portals.portal[n].dist = d * d; + + d = (float)cam[1] - portals.portal[n].center.p[1]; + portals.portal[n].dist += d * d; + + d = (float)cam[2] - portals.portal[n].center.p[2]; + portals.portal[n].dist += d * d; + + portals.portal_sort[n] = n; + } + + qsort(portals.portal_sort, portals.portal_count, 4, compare); + + for(n = 0; n < portals.portal_count; n++) + { + if(portals.polygons == 2 && !portals.portal[portals.portal_sort[n]].hint) + continue; + + if(portals.clip) + { + if(min_check[0] < portals.portal[portals.portal_sort[n]].min[0]) + continue; + else if(min_check[1] < portals.portal[portals.portal_sort[n]].min[1]) + continue; + else if(min_check[2] < portals.portal[portals.portal_sort[n]].min[2]) + continue; + else if(max_check[0] > portals.portal[portals.portal_sort[n]].max[0]) + continue; + else if(max_check[1] > portals.portal[portals.portal_sort[n]].max[1]) + continue; + else if(max_check[2] > portals.portal[portals.portal_sort[n]].max[2]) + continue; + } + + g_QglTable.m_pfn_qglColor4f(portals.portal[portals.portal_sort[n]].fp_color_random[0], portals.portal[portals.portal_sort[n]].fp_color_random[1], + portals.portal[portals.portal_sort[n]].fp_color_random[2], trans); + + g_QglTable.m_pfn_qglBegin(GL_POLYGON); + + for(p = 0; p < portals.portal[portals.portal_sort[n]].point_count; p++) + g_QglTable.m_pfn_qglVertex3fv(portals.portal[portals.portal_sort[n]].point[p].p); + + g_QglTable.m_pfn_qglEnd(); + } + } + else + { + for(n = 0; n < portals.portal_count; n++) + { + if(portals.polygons == 2 && !portals.portal[n].hint) + continue; + + if(portals.clip) + { + if(min_check[0] < portals.portal[n].min[0]) + continue; + else if(min_check[1] < portals.portal[n].min[1]) + continue; + else if(min_check[2] < portals.portal[n].min[2]) + continue; + else if(max_check[0] > portals.portal[n].max[0]) + continue; + else if(max_check[1] > portals.portal[n].max[1]) + continue; + else if(max_check[2] > portals.portal[n].max[2]) + continue; + } + + g_QglTable.m_pfn_qglColor4f(portals.portal[n].fp_color_random[0], portals.portal[n].fp_color_random[1], + portals.portal[n].fp_color_random[2], trans); + + g_QglTable.m_pfn_qglBegin(GL_POLYGON); + + for(p = 0; p < portals.portal[n].point_count; p++) + g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].point[p].p); + + g_QglTable.m_pfn_qglEnd(); + } + } + } + + if(portals.lines) + { + g_QglTable.m_pfn_qglColor4fv(portals.fp_color_3d); + for(n = 0; n < portals.portal_count; n++) { - if(portals.polygons == 2 && !portals.portal[n].hint) + if(portals.lines == 2 && !portals.portal[n].hint) continue; if(portals.clip) { - if(clip.min[0] < portals.portal[n].min[0]) + if(min_check[0] < portals.portal[n].min[0]) continue; - else if(clip.min[1] < portals.portal[n].min[1]) + else if(min_check[1] < portals.portal[n].min[1]) continue; - else if(clip.min[2] < portals.portal[n].min[2]) + else if(min_check[2] < portals.portal[n].min[2]) continue; - else if(clip.max[0] > portals.portal[n].max[0]) + else if(max_check[0] > portals.portal[n].max[0]) continue; - else if(clip.max[1] > portals.portal[n].max[1]) + else if(max_check[1] > portals.portal[n].max[1]) continue; - else if(clip.max[2] > portals.portal[n].max[2]) + else if(max_check[2] > portals.portal[n].max[2]) continue; } - glColor4f(portals.portal[n].fp_color_random[0], portals.portal[n].fp_color_random[1], - portals.portal[n].fp_color_random[2], trans); + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); - glBegin(GL_POLYGON); + for(p = 0; p < portals.portal[n].point_count; p++) + g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].inner_point[p].p); - for(p = 0; p < portals.portal[n].point_count; p++) - glVertex3fv(portals.portal[n].point[p].p); - - glEnd(); + g_QglTable.m_pfn_qglEnd(); } } + + g_QglTable.m_pfn_qglPopAttrib(); } -void CPortalsDrawSolidOutline::render(RenderStateFlags state) const -{ - for(int n = 0; n < portals.portal_count; n++) - { - if(portals.lines == 2 && !portals.portal[n].hint) - continue; - - if(portals.clip) - { - if(clip.min[0] < portals.portal[n].min[0]) - continue; - else if(clip.min[1] < portals.portal[n].min[1]) - continue; - else if(clip.min[2] < portals.portal[n].min[2]) - continue; - else if(clip.max[0] > portals.portal[n].max[0]) - continue; - else if(clip.max[1] > portals.portal[n].max[1]) - continue; - else if(clip.max[2] > portals.portal[n].max[2]) - continue; - } - - glBegin(GL_LINE_LOOP); - - for(int p = 0; p < portals.portal[n].point_count; p++) - glVertex3fv(portals.portal[n].inner_point[p].p); - - glEnd(); - } -} diff --git a/contrib/prtview/portals.h b/contrib/prtview/portals.h index 06f4af4b..13c7b89f 100644 --- a/contrib/prtview/portals.h +++ b/contrib/prtview/portals.h @@ -20,12 +20,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _PORTALS_H_ #define _PORTALS_H_ -#include -#include "irender.h" -#include "renderable.h" -#include "math/vector.h" - - class CBspPoint { public: float p[3]; @@ -47,19 +41,11 @@ public: float min[3]; float max[3]; float dist; - bool hint; + qboolean hint; - bool Build(char *def); + qboolean Build(char *def); }; -#define PRTVIEW_PATH_MAX 260 -typedef guint32 PackedColour; -#define RGB(r, g, b) ((guint32)(((guint8) (r) | ((guint16) (g) << 8))|(((guint32) (guint8) (b)) << 16))) -#define GetRValue(rgb) ((guint8)(rgb)) -#define GetGValue(rgb) ((guint8)(((guint16)(rgb)) >> 8)) -#define GetBValue(rgb) ((guint8)((rgb)>>16)) - - class CPortals { public: @@ -76,82 +62,64 @@ public: void FixColors(); - char fn[PRTVIEW_PATH_MAX]; + char fn[_MAX_PATH]; int zbuffer; int polygons; int lines; - bool show_3d; - bool aa_3d; - bool fog; - PackedColour color_3d; + qboolean show_3d; + qboolean aa_3d; + qboolean fog; + COLORREF color_3d; float width_3d; // in 8'ths float fp_color_3d[4]; - PackedColour color_fog; + COLORREF color_fog; float fp_color_fog[4]; float trans_3d; float clip_range; - bool clip; + qboolean clip; - bool show_2d; - bool aa_2d; - PackedColour color_2d; + qboolean show_2d; + qboolean aa_2d; + COLORREF color_2d; float width_2d; // in 8'ths float fp_color_2d[4]; CBspPortal *portal; int *portal_sort; - bool hint_flags; + qboolean hint_flags; // CBspNode *node; unsigned int node_count; unsigned int portal_count; }; -class CubicClipVolume -{ +class CPortalsRender : public IGL2DWindow, public IGL3DWindow { public: - Vector3 cam, min, max; + + CPortalsRender(); + virtual ~CPortalsRender(); + +protected: + + int refCount; +#ifdef _WIN32 + CRITICAL_SECTION protect; +#endif + +public: + + // IGL2DWindow IGL3DWindow interface + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + void Draw2D( VIEWTYPE vt ); + void Draw3D(); + void Register(); }; -class CPortalsDrawSolid : public OpenGLRenderable -{ -public: - mutable CubicClipVolume clip; - void render(RenderStateFlags state) const; -}; - -class CPortalsDrawSolidOutline : public OpenGLRenderable -{ -public: - mutable CubicClipVolume clip; - void render(RenderStateFlags state) const; -}; - -class CPortalsDrawWireframe : public OpenGLRenderable -{ -public: - void render(RenderStateFlags state) const; -}; - -class CPortalsRender : public Renderable -{ -public: - CPortalsDrawSolid m_drawSolid; - CPortalsDrawSolidOutline m_drawSolidOutline; - CPortalsDrawWireframe m_drawWireframe; - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const; - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const; -}; +// void Sys_Printf (char *text, ...); extern CPortals portals; extern CPortalsRender render; -void Portals_constructShaders(); -void Portals_destroyShaders(); - -void Portals_shadersChanged(); - - #endif // _PORTALS_H_ diff --git a/contrib/prtview/prtview.cpp b/contrib/prtview/prtview.cpp index c5ed86c9..43960970 100644 --- a/contrib/prtview/prtview.cpp +++ b/contrib/prtview/prtview.cpp @@ -17,24 +17,13 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +// PrtView.cpp : Defines the initialization routines for the DLL. +// -#include "prtview.h" +#include "stdafx.h" #include #include -#include "profile/profile.h" - -#include "qerplugin.h" -#include "iscenegraph.h" -#include "iglrender.h" -#include "iplugin.h" -#include "stream/stringstream.h" - -#include "portals.h" -#include "AboutDialog.h" -#include "ConfigDialog.h" -#include "LoadPortalFileDialog.h" - #define Q3R_CMD_SPLITTER "-" #define Q3R_CMD_ABOUT "About Portal Viewer" #define Q3R_CMD_LOAD "Load .prt file" @@ -43,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define Q3R_CMD_SHOW_2D "Toggle portals (2D)" #define Q3R_CMD_OPTIONS "Configure Portal Viewer" -CopiedString INIfn; +static char INIfn[NAME_MAX]; ///////////////////////////////////////////////////////////////////////////// // CPrtViewApp construction @@ -66,17 +55,34 @@ CopiedString INIfn; #define CLIP_RANGE "ClipRange" #define CLIP "Clip" - -void PrtView_construct() +void InitInstance () { - StringOutputStream tmp(64); - tmp << GlobalRadiant().getSettingsPath() << "prtview.ini"; - INIfn = tmp.c_str(); +#ifdef _WIN32 + char fn[_MAX_PATH]; + char fn_drive[_MAX_DRIVE]; + char fn_dir[_MAX_DIR]; + char fn_name[_MAX_FNAME]; + char fn_ext[_MAX_EXT]; + + GetModuleFileName(GetModuleHandle("PrtView.dll"), fn, _MAX_PATH); + + _splitpath(fn, fn_drive, fn_dir, fn_name, fn_ext); + + strcpy(INIfn, fn_drive); + strcat(INIfn, fn_dir); + strcat(INIfn, fn_name); + strcat(INIfn, ".ini"); +#else // if def __linux__ + strcpy (INIfn, g_get_home_dir ()); + strcat (INIfn, "/.radiant/"); + strcat (INIfn, RADIANT_VERSION); + strcat (INIfn, "/prtview.ini"); +#endif portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? true : false; portals.aa_2d = INIGetInt(AA_2D, FALSE) ? true : false; portals.width_2d = (float)INIGetInt(WIDTH_2D, 10); - portals.color_2d = (PackedColour)INIGetInt(COLOR_2D, RGB(0, 0, 255)) & 0xFFFFFF; + portals.color_2d = (COLORREF)INIGetInt(COLOR_2D, RGB(0, 0, 255)) & 0xFFFFFF; if (portals.width_2d > 40.0f) portals.width_2d = 40.0f; @@ -91,8 +97,8 @@ void PrtView_construct() portals.lines = INIGetInt(LINE, TRUE); portals.aa_3d = INIGetInt(AA_3D, FALSE) ? true : false; portals.width_3d = (float)INIGetInt(WIDTH_3D, 4); - portals.color_3d = (PackedColour)INIGetInt(COLOR_3D, RGB(255, 255, 0)) & 0xFFFFFF; - portals.color_fog = (PackedColour)INIGetInt(COLOR_FOG, RGB(127, 127, 127)) & 0xFFFFFF; + portals.color_3d = (COLORREF)INIGetInt(COLOR_3D, RGB(255, 255, 0)) & 0xFFFFFF; + portals.color_fog = (COLORREF)INIGetInt(COLOR_FOG, RGB(127, 127, 127)) & 0xFFFFFF; portals.trans_3d = (float)INIGetInt(TRANS_3D, 50); portals.clip = INIGetInt(CLIP, FALSE) ? true : false; portals.clip_range = (float)INIGetInt(CLIP_RANGE, 16); @@ -120,15 +126,6 @@ void PrtView_construct() SaveConfig(); portals.FixColors(); - - Portals_constructShaders(); - GlobalShaderCache().attachRenderable(render); -} - -void PrtView_destroy() -{ - GlobalShaderCache().detachRenderable(render); - Portals_destroyShaders(); } void SaveConfig () @@ -152,17 +149,180 @@ void SaveConfig () INISetInt(CLIP_RANGE, (int)portals.clip_range, "Portal viewer cubic clip distance (in units of 64)"); } +// Radiant function table +// use to access what Radiant provides +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; #define CONFIG_SECTION "Configuration" +#if defined(__linux__) || defined(__APPLE__) + +static bool read_var (const char *filename, const char *section, const char *key, char *value) +{ + char line[1024], *ptr; + FILE *rc; + + rc = fopen (filename, "rt"); + + if (rc == NULL) + return false; + + while (fgets (line, 1024, rc) != 0) + { + // First we find the section + if (line[0] != '[') + continue; + + ptr = strchr (line, ']'); + *ptr = '\0'; + + if (strcmp (&line[1], section) == 0) + { + while (fgets (line, 1024, rc) != 0) + { + ptr = strchr (line, '='); + + if (ptr == NULL) + { + // reached the end of the section + fclose (rc); + return false; + } + *ptr = '\0'; + + if (strcmp (line, key) == 0) + { + strcpy (value, ptr+1); + fclose (rc); + + while (value[strlen (value)-1] == 10 || + value[strlen (value)-1] == 13 || + value[strlen (value)-1] == 32) + value[strlen (value)-1] = 0; + return true; + } + } + } + } + + fclose (rc); + return false; +} + +static bool save_var (const char *filename, const char *section, const char *key, const char *value) +{ + char line[1024], *ptr; + FILE *old_rc = NULL, *rc; + bool found; + + rc = fopen (filename, "rb"); + + if (rc != NULL) + { + guint32 len; + void *buf; + + char *tmpname = g_strdup_printf ("%s.tmp", filename); + old_rc = fopen (tmpname, "w+b"); + g_free (tmpname); + + fseek (rc, 0, SEEK_END); + len = ftell (rc); + rewind (rc); + buf = g_malloc (len); + fread (buf, len, 1, rc); + fwrite (buf, len, 1, old_rc); + g_free (buf); + fclose (rc); + rewind (old_rc); + } + + rc = fopen (filename, "wb"); + + if (rc == NULL) + return false; + + // First we need to find the section + found = false; + if (old_rc != NULL) + while (fgets (line, 1024, old_rc) != NULL) + { + fputs (line, rc); + + if (line[0] == '[') + { + ptr = strchr (line, ']'); + *ptr = '\0'; + + if (strcmp (&line[1], section) == 0) + { + found = true; + break; + } + } + } + + if (!found) + { + fputs ("\n", rc); + fprintf (rc, "[%s]\n", section); + } + + fprintf (rc, "%s=%s\n", key, value); + + if (old_rc != NULL) + { + while (fgets (line, 1024, old_rc) != NULL) + { + ptr = strchr (line, '='); + + if (ptr != NULL) + { + *ptr = '\0'; + + if (strcmp (line, key) == 0) + break; + + *ptr = '='; + fputs (line, rc); + } + else + { + fputs (line, rc); + break; + } + } + + while (fgets (line, 1024, old_rc) != NULL) + fputs (line, rc); + + fclose (old_rc); + + char *tmpname = g_strdup_printf ("%s.tmp", filename); + remove (tmpname); + g_free (tmpname); + } + + fclose (rc); + + return true; +} + +#endif + int INIGetInt(char *key, int def) { +#if defined(__linux__) || defined(__APPLE__) char value[1024]; - if (read_var (INIfn.c_str(), CONFIG_SECTION, key, value)) + if (read_var (INIfn, CONFIG_SECTION, key, value)) return atoi (value); else return def; +#else + return GetPrivateProfileInt(CONFIG_SECTION, key, def, INIfn); +#endif } void INISetInt(char *key, int val, char *comment /* = NULL */) @@ -173,7 +333,11 @@ void INISetInt(char *key, int val, char *comment /* = NULL */) sprintf(s, "%d ; %s", val, comment); else sprintf(s, "%d", val); - save_var (INIfn.c_str(), CONFIG_SECTION, key, s); +#if defined(__linux__) || defined(__APPLE__) + save_var (INIfn, CONFIG_SECTION, key, s); +#else + WritePrivateProfileString(CONFIG_SECTION, key, s, INIfn); +#endif } @@ -191,33 +355,60 @@ static const char *PLUGIN_COMMANDS = Q3R_CMD_RELEASE ";" Q3R_CMD_LOAD; +extern "C" LPVOID WINAPI QERPlug_GetFuncTable() +{ + return &g_FuncTable; +} -const char* QERPlug_Init (void *hApp, void* pMainWidget) +//extern "C" LPCSTR WINAPI QERPlug_Init (HMODULE hApp, GtkWidget* hwndMain) +extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) { + // Setup defaults & load config + InitInstance(); + return "Portal Viewer for Q3Radiant"; } -const char* QERPlug_GetName() +extern "C" const char* QERPlug_GetName() { - return PLUGIN_NAME; + return (char*)PLUGIN_NAME; } -const char* QERPlug_GetCommandList() +extern "C" const char* QERPlug_GetCommandList() { - return PLUGIN_COMMANDS; + return (char*)PLUGIN_COMMANDS; } - -const char* QERPlug_GetCommandTitleList() +/* +void Sys_Printf (char *text, ...) { - return ""; + va_list argptr; + char buf[32768]; + + va_start (argptr,text); + vsprintf (buf, text, argptr); + va_end (argptr); + + g_FuncTable.m_pfnSysMsg (buf); +} +*/ + +bool interfaces_started = false; + +static void CheckInterfaces() +{ + if (interfaces_started) + return; + + render.Register(); + + interfaces_started = true; } - -void QERPlug_Dispatch(const char* p, float* vMin, float* vMax, bool bSingleBrush) +extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush) { - globalOutputStream() << MSG_PREFIX "Command \"" << p << "\"\n"; + Sys_Printf (MSG_PREFIX "Command \"%s\"\n",p); if (!strcmp(p,Q3R_CMD_ABOUT)) { @@ -225,104 +416,133 @@ void QERPlug_Dispatch(const char* p, float* vMin, float* vMax, bool bSingleBrush } else if (!strcmp(p,Q3R_CMD_LOAD)) { - if (DoLoadPortalFileDialog () == IDOK) + CheckInterfaces(); + + if (interfaces_started) { - portals.Load(); - SceneChangeNotify(); - } - else - { - globalOutputStream() << MSG_PREFIX "Portal file load aborted.\n"; + if (DoLoadPortalFileDialog () == IDOK) + { + portals.Load(); + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL); + } + else + { + Sys_Printf(MSG_PREFIX "Portal file load aborted.\n", portals.fn); + } } } else if (!strcmp(p,Q3R_CMD_RELEASE)) { portals.Purge(); - SceneChangeNotify(); + if (interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL); - globalOutputStream() << MSG_PREFIX "Portals unloaded.\n"; + Sys_Printf(MSG_PREFIX "Portals unloaded.\n"); } else if (!strcmp(p,Q3R_CMD_SHOW_2D)) { portals.show_2d = !portals.show_2d; - SceneChangeNotify(); + if(interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL); SaveConfig(); if(portals.show_2d) - globalOutputStream() << MSG_PREFIX "Portals will be rendered in 2D view.\n"; + Sys_Printf(MSG_PREFIX "Portals will be rendered in 2D view.\n"); else - globalOutputStream() << MSG_PREFIX "Portals will NOT be rendered in 2D view.\n"; + Sys_Printf(MSG_PREFIX "Portals will NOT be rendered in 2D view.\n"); } else if (!strcmp(p,Q3R_CMD_SHOW_3D)) { portals.show_3d = !portals.show_3d; SaveConfig(); - SceneChangeNotify(); + if (interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL); if (portals.show_3d) - globalOutputStream() << MSG_PREFIX "Portals will be rendered in 3D view.\n"; + Sys_Printf(MSG_PREFIX "Portals will be rendered in 3D view.\n"); else - globalOutputStream() << MSG_PREFIX "Portals will NOT be rendered in 3D view.\n"; + Sys_Printf(MSG_PREFIX "Portals will NOT be rendered in 3D view.\n"); } else if (!strcmp(p,Q3R_CMD_OPTIONS)) { DoConfigDialog (); SaveConfig(); - SceneChangeNotify(); + if (interfaces_started) + g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL); } } -#include "modulesystem/singletonmodule.h" -class PrtViewPluginDependencies : - public GlobalSceneGraphModuleRef, - public GlobalRadiantModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalOpenGLModuleRef, - public GlobalOpenGLStateLibraryModuleRef -{ -}; +// ============================================================================= +// SYNAPSE -class PrtViewPluginModule +class CSynapseClientPrtView : public CSynapseClient { - _QERPluginTable m_plugin; public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "prtview"); - - PrtViewPluginModule() - { - m_plugin.m_pfnQERPlug_Init = QERPlug_Init; - m_plugin.m_pfnQERPlug_GetName = QERPlug_GetName; - m_plugin.m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = QERPlug_GetCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = QERPlug_Dispatch; - - PrtView_construct(); - } - ~PrtViewPluginModule() - { - PrtView_destroy(); - } - _QERPluginTable* getTable() - { - return &m_plugin; - } + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientPrtView() { } + virtual ~CSynapseClientPrtView() { } }; -typedef SingletonModule SingletonPrtViewPluginModule; -SingletonPrtViewPluginModule g_PrtViewPluginModule; +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientPrtView g_SynapseClient; +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(PLUGIN_MAJOR, PRTVIEW_MINOR, sizeof(_QERPluginTable)); -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); + 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); - g_PrtViewPluginModule.selfRegister(); + return &g_SynapseClient; +} + +bool CSynapseClientPrtView::RequestAPI(APIDescriptor_t *pAPI) +{ + if( !strcmp(pAPI->major_name, PLUGIN_MAJOR) ) + { + if( !strcmp(pAPI->minor_name, PRTVIEW_MINOR) ) + { + _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; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientPrtView::GetInfo() +{ + return "PrtView module built " __DATE__ " " RADIANT_VERSION; } diff --git a/contrib/prtview/prtview.h b/contrib/prtview/prtview.h index 472b028a..468df3fc 100644 --- a/contrib/prtview/prtview.h +++ b/contrib/prtview/prtview.h @@ -17,19 +17,13 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_PRTVIEW_H) -#define INCLUDED_PRTVIEW_H +// PrtView.h : main header file for the PRTVIEW DLL +// -#define MSG_PREFIX "Portal Viewer plugin: " +#if !defined(AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_) +#define AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_ void InitInstance (); void SaveConfig (); -int INIGetInt(char *key, int def); -void INISetInt(char *key, int val, char *comment = 0); - -#define IDOK 1 -#define IDCANCEL 2 - - -#endif +#endif // !defined(AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_) diff --git a/contrib/prtview/res/PrtView.rc2 b/contrib/prtview/res/PrtView.rc2 index a534b6a2..0422bb19 100644 --- a/contrib/prtview/res/PrtView.rc2 +++ b/contrib/prtview/res/PrtView.rc2 @@ -1,13 +1,13 @@ -// -// PRTVIEW.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// +// +// PRTVIEW.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/contrib/prtview/resource.h b/contrib/prtview/resource.h new file mode 100644 index 00000000..5fdce405 --- /dev/null +++ b/contrib/prtview/resource.h @@ -0,0 +1,42 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by PrtView.rc +// +#define IDD_ABOUT 129 +#define IDD_LOAD 130 +#define IDD_CONFIG 131 +#define IDC_LOAD_2D 1000 +#define IDC_LOAD_3D 1001 +#define IDC_LOAD_FILE_NAME 1002 +#define IDC_LOAD_OTHER 1003 +#define IDC_CONFIG_3D 1004 +#define IDC_CONFIG_2D 1005 +#define IDC_SCROLL_2D_WIDTH 1006 +#define IDC_2D_WIDTH 1007 +#define IDC_ANTI_ALIAS_2D 1008 +#define IDC_COLOR_2D 1009 +#define IDC_ZBUFFER 1010 +#define IDC_SCROLL_3D_WIDTH 1011 +#define IDC_3D_WIDTH 1012 +#define IDC_ANTI_ALIAS_3D 1013 +#define IDC_COLOR_3D 1014 +#define IDC_COLOR_FOG 1015 +#define IDC_FOG 1016 +#define IDC_SCROLL_3D_TRANS 1017 +#define IDC_POLY 1018 +#define IDC_3D_TRANS 1019 +#define IDC_LINES 1020 +#define IDC_SCROLL_CUBIC 1021 +#define IDC_CUBIC 1022 +#define IDC_CLIP 1023 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 133 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1011 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/contrib/prtview/AboutDialog.h b/contrib/prtview/stdafx.cpp similarity index 80% rename from contrib/prtview/AboutDialog.h rename to contrib/prtview/stdafx.cpp index bf72885f..06ae853b 100644 --- a/contrib/prtview/AboutDialog.h +++ b/contrib/prtview/stdafx.cpp @@ -17,9 +17,9 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if !defined(INCLUDED_ABOUTDIALOG_H) -#define INCLUDED_ABOUTDIALOG_H +// stdafx.cpp : source file that includes just the standard includes +// PrtView.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information -void DoAboutDlg (); +#include "stdafx.h" -#endif diff --git a/contrib/prtview/stdafx.h b/contrib/prtview/stdafx.h new file mode 100644 index 00000000..ff28a474 --- /dev/null +++ b/contrib/prtview/stdafx.h @@ -0,0 +1,80 @@ +/* +PrtView plugin for GtkRadiant +Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __PRTVIEW_AFX_H__ +#define __PRTVIEW_AFX_H__ + +#include + +#if defined(__linux__) || defined(__APPLE__) +#include + +// Necessary for proper boolean type declaration +#include "qertypes.h" + +typedef guint32 COLORREF; +typedef void* LPVOID; +typedef char* LPCSTR; +typedef void* HMODULE; +typedef int BOOL; + +#define RGB(r, g, b) ((guint32)(((guint8) (r) | ((guint16) (g) << 8))|(((guint32) (guint8) (b)) << 16))) +#define GetRValue(rgb) ((guint8)(rgb)) +#define GetGValue(rgb) ((guint8)(((guint16)(rgb)) >> 8)) +#define GetBValue(rgb) ((guint8)((rgb)>>16)) + +#define _MAX_PATH PATH_MAX + +#define IDOK 1 +#define IDCANCEL 2 + +#endif // __linux__ + +#include "synapse.h" + +// plugin +#include "iplugin.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "ibspfrontend.h" +#include "igl.h" +#include "version.h" + +// PrtView +#include "gtkdlgs.h" +#include "prtview.h" +#include "portals.h" +#include "resource.h" // main symbols + +#define MSG_PREFIX "Portal Viewer plugin: " +#define PRTVIEW_MINOR "prtview" + +#define UPDATE_2D (W_XY | W_XZ | W_YZ) +#define UPDATE_3D (W_CAMERA) +#define UPDATE_ALL (UPDATE_2D | UPDATE_3D) + +int INIGetInt(char *key, int def); +void INISetInt(char *key, int val, char *comment = NULL); + +extern bool interfaces_started; + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; + +#endif diff --git a/contrib/shaderplug/shaderplug.cpp b/contrib/shaderplug/shaderplug.cpp deleted file mode 100644 index facb3822..00000000 --- a/contrib/shaderplug/shaderplug.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* -Copyright (C) 2006, Stefan Greven. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "shaderplug.h" - -#include "debugging/debugging.h" - -#include -#include -#include "string/string.h" -#include "modulesystem/singletonmodule.h" -#include "stream/stringstream.h" -#include "os/file.h" - -#include - -#include "iplugin.h" -#include "qerplugin.h" -#include "ifilesystem.h" -#include "iarchive.h" -#include "ishaders.h" -#include "iscriplib.h" - -#include "generic/callback.h" - -namespace { -const char SHADERTAG_FILE[] = "shadertags.xml"; -} - -class ShaderPlugPluginDependencies : public GlobalRadiantModuleRef, - public GlobalFileSystemModuleRef, - public GlobalShadersModuleRef -{ -public: - ShaderPlugPluginDependencies() : - GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders")) - { - } -}; - -namespace Shaderplug -{ - GtkWindow* g_window; - - std::vector archives; - std::set shaders; - std::set textures; - - XmlTagBuilder TagBuilder; - void CreateTagFile(); - - const char* init(void* hApp, void* pMainWidget) - { - g_window = GTK_WINDOW(pMainWidget); - return ""; - } - const char* getName() - { - return "ShaderPlug"; - } - const char* getCommandList() - { - return "About;Create tag file"; - } - const char* getCommandTitleList() - { - return ""; - } - void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) - { - if(string_equal(command, "About")) - { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), "Shaderplug (1.0)\n\n" - "by Shaderman (shaderman@gmx.net)", - "About", - eMB_OK, - eMB_ICONDEFAULT); - } - if(string_equal(command, "Create tag file")) - { - CreateTagFile(); - } - } - - void loadArchiveFile(const char* filename) - { - archives.push_back(filename); - } - - typedef FreeCaller1 LoadArchiveFileCaller; - - void LoadTextureFile(const char* filename) - { - std::string s_filename = filename; - - char buffer[256]; - strcpy(buffer, "textures/"); - - // append filename without trailing file extension (.tga or .jpg for example) - strncat(buffer, filename, s_filename.length() - 4); - - std::set::iterator iter; - iter = shaders.find(buffer); - - // a shader with this name already exists - if(iter == shaders.end()) - { - textures.insert(buffer); - } - } - - typedef FreeCaller1 LoadTextureFileCaller; - - void GetTextures(char* extension) - { - GlobalFileSystem().forEachFile("textures/", extension, LoadTextureFileCaller(), 0); - } - - void LoadShaderList(const char* filename) - { - if(string_equal_prefix(filename, "textures/")) - { - shaders.insert(filename); - } - } - - typedef FreeCaller1 LoadShaderListCaller; - - void GetAllShaders() - { - GlobalShaderSystem().foreachShaderName(LoadShaderListCaller()); - } - - void GetArchiveList() - { - GlobalFileSystem().forEachArchive(LoadArchiveFileCaller()); - globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n"; - } - - void CreateTagFile() - { - const char* shader_type = GlobalRadiant().getGameDescriptionKeyValue("shaders"); - - GetAllShaders(); - globalOutputStream() << "Shaderplug: " << (const Unsigned)shaders.size() << " shaders found.\n"; - - if(string_equal(shader_type, "quake3")) - { - GetTextures("jpg"); - GetTextures("tga"); - GetTextures("png"); - - globalOutputStream() << "Shaderplug: " << (const Unsigned)textures.size() << " textures found.\n"; - } - - if(shaders.size() || textures.size() != 0) - { - globalOutputStream() << "Shaderplug: Creating XML tag file.\n"; - - TagBuilder.CreateXmlDocument(); - - std::set::reverse_iterator r_iter; - - for(r_iter = textures.rbegin(); r_iter != textures.rend(); ++r_iter) - { - TagBuilder.AddShaderNode(const_cast((*r_iter).c_str()), STOCK, TEXTURE); - } - - for(r_iter = shaders.rbegin(); r_iter != shaders.rend(); ++r_iter) - { - TagBuilder.AddShaderNode(const_cast((*r_iter).c_str()), STOCK, SHADER); - } - - // Get the tag file - StringOutputStream tagFileStream(256); - tagFileStream << GlobalRadiant().getLocalRcPath() << SHADERTAG_FILE; - char* tagFile = tagFileStream.c_str(); - - char message[256]; - strcpy(message, "Tag file saved to\n"); - strcat(message, tagFile); - strcat(message, "\nPlease restart Radiant now.\n"); - - if(file_exists(tagFile)) - { - EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), - "WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?", - eMB_NOYES, - eMB_ICONWARNING); - - if(result == eIDYES) - { - TagBuilder.SaveXmlDoc(tagFile); - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK); - } - } else { - TagBuilder.SaveXmlDoc(tagFile); - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK); - } - } else { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), - "No shaders or textures found. No XML tag file created!\n" - "", - "ERROR", - eMB_OK, - eMB_ICONERROR); - } - } -} // namespace - -class ShaderPluginModule -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "ShaderPlug"); - - ShaderPluginModule() - { - m_plugin.m_pfnQERPlug_Init = &Shaderplug::init; - m_plugin.m_pfnQERPlug_GetName = &Shaderplug::getName; - m_plugin.m_pfnQERPlug_GetCommandList = &Shaderplug::getCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = &Shaderplug::getCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = &Shaderplug::dispatch; - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; - -typedef SingletonModule SingletonShaderPluginModule; - -SingletonShaderPluginModule g_ShaderPluginModule; - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ShaderPluginModule.selfRegister(); -} - - - - diff --git a/contrib/shaderplug/shaderplug.def b/contrib/shaderplug/shaderplug.def deleted file mode 100644 index be71ca58..00000000 --- a/contrib/shaderplug/shaderplug.def +++ /dev/null @@ -1,7 +0,0 @@ -; shaderplug.def : Declares the module parameters for the DLL. - -LIBRARY "SHADERPLUG" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/contrib/shaderplug/shaderplug.h b/contrib/shaderplug/shaderplug.h deleted file mode 100644 index 4842cc22..00000000 --- a/contrib/shaderplug/shaderplug.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 2006, Stefan Greven. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SHADERPLUG_H) -#define INCLUDED_SHADERPLUG_H - -#include "xml/xmltextags.h" - -#endif diff --git a/contrib/shaderplug/shaderplug.vcproj b/contrib/shaderplug/shaderplug.vcproj deleted file mode 100644 index 7c727b77..00000000 --- a/contrib/shaderplug/shaderplug.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp deleted file mode 100644 index 67103018..00000000 --- a/contrib/sunplug/sunplug.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/* -Sunplug plugin for GtkRadiant -Copyright (C) 2004 Topsun -Thanks to SPoG for help! - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "sunplug.h" - -#include "debugging/debugging.h" - -#include "iplugin.h" - -#include "string/string.h" -#include "modulesystem/singletonmodule.h" - -#include "iundo.h" // declaration of undo system -#include "ientity.h" // declaration of entity system -#include "iscenegraph.h" // declaration of datastructure of the map - -#include "scenelib.h" // declaration of datastructure of the map -#include "qerplugin.h" // declaration to use other interfaces as a plugin - -#include // to display something with gtk (windows, buttons etc.), the whole package might not be necessary - -void about_plugin_window(); -void MapCoordinator(); - -#ifdef __linux__ -// linux itoa implementation -char* itoa( int value, char* result, int base ) -{ - // check that the base if valid - if (base < 2 || base > 16) - { - *result = 0; - return result; - } - - char* out = result; - int quotient = value; - - do - { - *out = "0123456789abcdef"[abs(quotient % base)]; - ++out; - - quotient /= base; - } while (quotient); - - // Only apply negative sign for base 10 - if( value < 0 && base == 10) - *out++ = '-'; - - std::reverse(result, out); - - *out = 0; - return result; -} -#endif - -typedef struct _mapcoord_setting_packet { - GtkSpinButton *spinner1, *spinner2, *spinner3, *spinner4; - Entity* worldspawn; -} mapcoord_setting_packet; - -static int map_minX, map_maxX, map_minY, map_maxY; -static int minX, maxX, minY, maxY; -mapcoord_setting_packet msp; - -// ************************** -// ** find entities by class ** from radiant/map.cpp -// ************************** -class EntityFindByClassname : public scene::Graph::Walker -{ - const char* m_name; - Entity*& m_entity; -public: - EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity) - { - m_entity = 0; - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(m_entity == 0) - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && string_equal(m_name, entity->getKeyValue("classname"))) - { - m_entity = entity; - } - } - return true; - } -}; - -Entity* Scene_FindEntityByClass(const char* name) -{ - Entity* entity; - GlobalSceneGraph().traverse(EntityFindByClassname(name, entity)); - return entity; -} - -// ************************** -// ** GTK callback functions ** -// ************************** - -static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) -{ - /* If you return FALSE in the "delete_event" signal handler, - * GTK will emit the "destroy" signal. Returning TRUE means - * you don't want the window to be destroyed. - * This is useful for popping up 'are you sure you want to quit?' - * type dialogs. */ - - return FALSE; -} - -// destroy widget if destroy signal is passed to widget -static void destroy(GtkWidget *widget, gpointer data) -{ - gtk_widget_destroy(widget); -} - -// function for close button to destroy the toplevel widget -static void close_window(GtkWidget *widget, gpointer data) -{ - gtk_widget_destroy(gtk_widget_get_toplevel(widget)); -} - -// callback function to assign the optimal mapcoords to the spinboxes -static void input_optimal(GtkWidget *widget, gpointer data) -{ - gtk_spin_button_set_value(msp.spinner1, minX); - gtk_spin_button_set_value(msp.spinner2, maxY); - gtk_spin_button_set_value(msp.spinner3, maxX); - gtk_spin_button_set_value(msp.spinner4, minY); -} - -// Spinner return value function -gint grab_int_value(GtkSpinButton *a_spinner, gpointer user_data) { - return gtk_spin_button_get_value_as_int(a_spinner); -} - -// write the values of the Spinner-Boxes to the worldspawn -static void set_coordinates(GtkWidget *widget, gpointer data) -{ - //Str str_min, str_max; - char buffer[10], str_min[20], str_max[20]; - - itoa(gtk_spin_button_get_value_as_int(msp.spinner1), str_min, 10); - itoa(gtk_spin_button_get_value_as_int(msp.spinner2), buffer, 10); - strcat(str_min, " "); - strcat(str_min, buffer); - msp.worldspawn->setKeyValue("mapcoordsmins", str_min); - - itoa(gtk_spin_button_get_value_as_int(msp.spinner3), str_max, 10); - itoa(gtk_spin_button_get_value_as_int(msp.spinner4), buffer, 10); - strcat(str_max, " "); - strcat(str_max, buffer); - UndoableCommand undo("SunPlug.entitySetMapcoords"); - msp.worldspawn->setKeyValue("mapcoordsmaxs", str_max); - - close_window(widget, NULL); -} - -class SunPlugPluginDependencies : - public GlobalRadiantModuleRef, // basic class for all other module refs - public GlobalUndoModuleRef, // used to say radiant that something has changed and to undo that - public GlobalSceneGraphModuleRef, // necessary to handle data in the mapfile (change, retrieve data) - public GlobalEntityModuleRef // to access and modify the entities -{ -public: - SunPlugPluginDependencies() : - GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities"))//, - { - } -}; - -// ************************* -// ** standard plugin stuff ** -// ************************* -namespace SunPlug -{ - GtkWindow* main_window; - char MenuList[100] = ""; - - const char* init(void* hApp, void* pMainWidget) - { - main_window = GTK_WINDOW(pMainWidget); - return "Initializing SunPlug for GTKRadiant"; - } - const char* getName() - { - return "SunPlug"; // name that is shown in the menue - } - const char* getCommandList() - { - const char about[] = "About..."; - const char etMapCoordinator[] = ";ET-MapCoordinator"; - - strcat(MenuList, about); - if (strncmp(GlobalRadiant().getGameName(), "etmain", 6) == 0) strcat(MenuList, etMapCoordinator); - return (const char*)MenuList; - } - const char* getCommandTitleList() - { - return ""; - } - void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) // message processing - { - if(string_equal(command, "About...")) - { - about_plugin_window(); - } - if(string_equal(command, "ET-MapCoordinator")) - { - MapCoordinator(); - } - } -} // namespace - -class SunPlugModule : public TypeSystemRef -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "SunPlug"); - - SunPlugModule() - { - m_plugin.m_pfnQERPlug_Init = &SunPlug::init; - m_plugin.m_pfnQERPlug_GetName = &SunPlug::getName; - m_plugin.m_pfnQERPlug_GetCommandList = &SunPlug::getCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = &SunPlug::getCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = &SunPlug::dispatch; - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; - -typedef SingletonModule SingletonSunPlugModule; - -SingletonSunPlugModule g_SunPlugModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_SunPlugModule.selfRegister(); -} - -// ************ -// ** my stuff ** -// ************ - -// About dialog -void about_plugin_window() -{ - GtkWidget *window, *vbox, *label, *button; - - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create a window - gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window - g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event - g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window - gtk_window_set_title(GTK_WINDOW(window), "About SunPlug"); // set the title of the window for the window - gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window - gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows - gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window - - vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically - gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window - - label = gtk_label_new("SunPlug v1.0 for GtkRadiant 1.5\nby Topsun"); // create a label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box - - button = gtk_button_new_with_label("OK"); // create a button with text - g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK (gtk_widget_destroy), window); // connect the click event to close the window - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box - - gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window on screen - - gtk_widget_show_all(window); // show the window and all subelements -} - -// get the current bounding box and return the optimal coordinates -void GetOptimalCoordinates(AABB *levelBoundingBox) -{ - int half_width, half_heigth, center_x, center_y; - - half_width = levelBoundingBox->extents.x(); - half_heigth = levelBoundingBox->extents.y(); - center_x = levelBoundingBox->origin.x(); - center_y = levelBoundingBox->origin.y(); - - if (half_width > 175 || half_heigth > 175) // the square must be at least 350x350 units - { - // the wider side is the indicator for the square - if (half_width >= half_heigth) - { - minX = center_x - half_width; - maxX = center_x + half_width; - minY = center_y - half_width; - maxY = center_y + half_width; - } else { - minX = center_x - half_heigth; - maxX = center_x + half_heigth; - minY = center_y - half_heigth; - maxY = center_y + half_heigth; - } - } else { - minX = center_x - 175; - maxX = center_x + 175; - minY = center_y - 175; - maxY = center_y + 175; - } -} - -// MapCoordinator dialog window -void MapCoordinator() -{ - GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button; - GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY; - Entity *theWorldspawn = NULL; - const char *buffer; - char line[20]; - - // in any case we need a window to show the user what to do - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create the window - gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window - g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event for the window - g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window - gtk_window_set_title(GTK_WINDOW(window), "ET-MapCoordinator"); // set the title of the window for the window - gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window - gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows - gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window - - vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically - gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window - - scene::Path path = makeReference(GlobalSceneGraph().root()); // get the path to the root element of the graph - scene::Instance* instance = GlobalSceneGraph().find(path); // find the instance to the given path - AABB levelBoundingBox = instance->worldAABB(); // get the bounding box of the level - - theWorldspawn = Scene_FindEntityByClass("worldspawn"); // find the entity worldspawn - if (theWorldspawn != 0) { // need to have a worldspawn otherwise setting a value crashes the radiant - // next two if's: get the current values of the mapcoords - buffer = theWorldspawn->getKeyValue("mapcoordsmins"); // upper left corner - if (strlen(buffer) > 0) { - strncpy(line, buffer, 19); - map_minX = atoi(strtok(line, " ")); // minimum of x value - map_minY = atoi(strtok(NULL, " ")); // maximum of y value - } else { - map_minX = 0; - map_minY = 0; - } - buffer = theWorldspawn->getKeyValue("mapcoordsmaxs"); // lower right corner - if (strlen(buffer) > 0) { - strncpy(line, buffer, 19); - map_maxX = atoi(strtok(line, " ")); // maximum of x value - map_maxY = atoi(strtok(NULL, " ")); // minimum of y value - } else { - map_maxX = 0; - map_maxY = 0; - } - - globalOutputStream() << "SunPlug: calculating optimal coordinates\n"; // write to console that we are calculating the coordinates - GetOptimalCoordinates(&levelBoundingBox); // calculate optimal mapcoords with the dimensions of the level bounding box - globalOutputStream() << "SunPlug: adviced mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins - globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs - - spinner_adj_MinX = (GtkAdjustment *)gtk_adjustment_new(map_minX, -65536.0, 65536.0, 1.0, 5.0, 5.0); // create adjustment for value and range of minimum x value - spinner_adj_MinY = (GtkAdjustment *)gtk_adjustment_new(map_minY, -65536.0, 65536.0, 1.0, 5.0, 5.0); // create adjustment for value and range of minimum y value - spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new(map_maxX, -65536.0, 65536.0, 1.0, 5.0, 5.0); // create adjustment for value and range of maximum x value - spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new(map_maxY, -65536.0, 65536.0, 1.0, 5.0, 5.0); // create adjustment for value and range of maximum y value - - button = gtk_button_new_with_label("Get optimal mapcoords"); // create button with text - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(input_optimal), NULL); // connect button with callback function - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert button into vbox - - gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 2); // insert separator into vbox - - table = gtk_table_new(4, 3, TRUE); // create table - gtk_table_set_row_spacings(GTK_TABLE(table), 8); // set row spacings - gtk_table_set_col_spacings(GTK_TABLE(table), 8); // set column spacings - gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2); // insert table into vbox - - label = gtk_label_new("x"); // create label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side - gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); // insert label into table - - label = gtk_label_new("y"); // create label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side - gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 0, 1); // insert label into table - - label = gtk_label_new("mapcoordsmins"); // create label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); // insert label into table - - spinnerMinX = gtk_spin_button_new(spinner_adj_MinX, 1.0, 0); // create textbox wiht value spin, value and value range - gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinX, 1, 2, 1, 2); // insert spinbox into table - - spinnerMinY = gtk_spin_button_new(spinner_adj_MinY, 1.0, 0); // create textbox wiht value spin, value and value range - gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinY, 2, 3, 1, 2); // insert spinbox into table - - label = gtk_label_new("mapcoordsmaxs"); // create label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); // insert label into table - - spinnerMaxX = gtk_spin_button_new(spinner_adj_MaxX, 1.0, 0); // create textbox wiht value spin, value and value range - gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxX, 1, 2, 2, 3); // insert spinbox into table - - spinnerMaxY = gtk_spin_button_new(spinner_adj_MaxY, 1.0, 0); // create textbox wiht value spin, value and value range - gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxY, 2, 3, 2, 3); // insert spinbox into table - - // put the references to the spinboxes and the worldspawn into the global exchange - msp.spinner1 = GTK_SPIN_BUTTON(spinnerMinX); - msp.spinner2 = GTK_SPIN_BUTTON(spinnerMinY); - msp.spinner3 = GTK_SPIN_BUTTON(spinnerMaxX); - msp.spinner4 = GTK_SPIN_BUTTON(spinnerMaxY); - msp.worldspawn = theWorldspawn; - - button = gtk_button_new_with_label("Set"); // create button with text - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_coordinates), NULL); // connect button with callback function - gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 3, 4); // insert button into table - - button = gtk_button_new_with_label("Cancel"); // create button with text - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect button with callback function - gtk_table_attach_defaults(GTK_TABLE(table), button, 2, 3, 3, 4); // insert button into table - } else { - globalOutputStream() << "SunPlug: no worldspawn found!\n"; // output error to console - - label = gtk_label_new("ERROR: No worldspawn was found in the map!\nIn order to use this tool the map must have at least one brush in the worldspawn. "); // create a label - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box - - button = gtk_button_new_with_label("OK"); // create a button with text - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect the click event to close the window - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box - } - - gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window - gtk_widget_show_all(window); // show the window and all subelements -} \ No newline at end of file diff --git a/contrib/sunplug/sunplug.def b/contrib/sunplug/sunplug.def deleted file mode 100644 index 6d260776..00000000 --- a/contrib/sunplug/sunplug.def +++ /dev/null @@ -1,7 +0,0 @@ -; sunplug.def : Declares the module parameters for the DLL. - -LIBRARY "SUNPLUG" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/contrib/sunplug/sunplug.h b/contrib/sunplug/sunplug.h deleted file mode 100644 index 9649a743..00000000 --- a/contrib/sunplug/sunplug.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Sunplug plugin for GtkRadiant -Copyright (C) 2004 Topsun -Thanks to SPoG for help! - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _PLUGIN_SUNPLUG_ - #define _PLUGIN_SUNPLUG_ - - -#endif // _PLUGIN_SUNPLUG_ diff --git a/contrib/sunplug/sunplug.vcproj b/contrib/sunplug/sunplug.vcproj deleted file mode 100644 index 516a2d74..00000000 --- a/contrib/sunplug/sunplug.vcproj +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/ufoai/plugin.cpp b/contrib/ufoai/plugin.cpp new file mode 100644 index 00000000..b2b9409e --- /dev/null +++ b/contrib/ufoai/plugin.cpp @@ -0,0 +1,285 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "plugin.h" +#include "ufoai_filters.h" + +#define CMD_SEP "-" +#define CMD_ABOUT "About..." +// ============================================================================= +// Globals + +// function tables +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; +_QERFileSystemTable g_FileSystemTable; +_QEREntityTable g_EntityTable; +_QERAppDataTable g_DataTable; + +// the gtk widget +void *g_pMainWidget; + +// ============================================================================= +// plugin implementation + +#define PLUGIN_NAME "UFO:AI plugin" +#define PLUGIN_VERSION "0.1" + +//backwards for some reason +static const char *PLUGIN_COMMANDS = CMD_ABOUT ";" CMD_SEP; +static const char *PLUGIN_ABOUT = "UFO: Alien Invasion plugin " PLUGIN_VERSION "\nby Martin Gerhardy"; + +#define NUM_TOOLBAR_BUTTONS FILTER_MAX +typedef struct toolbar_button_info_s +{ + char *image; + char *text; + char *tip; + void (*func)(); + IToolbarButton::EType type; +} toolbar_button_info_t; + +static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] = +{ + { + "ufoai_actorclip.bmp", + "Filter actorclip", + "Actorclip", + DoActorClipFiltering, + IToolbarButton::eToggleButton + }, + { + "ufoai_weaponclip.bmp", + "Filter weaponclip", + "Weaponclip", + DoWeaponClipFiltering, + IToolbarButton::eToggleButton + }, + { + "ufoai_nodraw.bmp", + "Filter nodraw", + "NoDraw", + DoNoDrawFiltering, + IToolbarButton::eToggleButton + }, + { + "ufoai_stepon.bmp", + "Filter stepon", + "Stepon", + DoSteponFiltering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level1.bmp", + "Filter level1", + "Level 1", + DoLevel1Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level2.bmp", + "Filter level2", + "Level 2", + DoLevel2Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level3.bmp", + "Filter level3", + "Level 3", + DoLevel3Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level4.bmp", + "Filter level4", + "Level 4", + DoLevel4Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level5.bmp", + "Filter level5", + "Level 5", + DoLevel5Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level6.bmp", + "Filter level6", + "Level 6", + DoLevel6Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level7.bmp", + "Filter level7", + "Level 7", + DoLevel7Filtering, + IToolbarButton::eToggleButton + }, + { + "ufoai_level8.bmp", + "Filter level8", + "Level 8", + DoLevel8Filtering, + IToolbarButton::eToggleButton + }, +}; + +class UFOAIButton : 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; + } +}; + +UFOAIButton g_ufoaibuttons[NUM_TOOLBAR_BUTTONS]; + +unsigned int ToolbarButtonCount (void) +{ + return NUM_TOOLBAR_BUTTONS; +} + +const IToolbarButton* GetToolbarButton (unsigned int index) +{ + g_ufoaibuttons[index].bi = &toolbar_buttons[index]; + return &g_ufoaibuttons[index]; +} + +extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) +{ + g_pMainWidget = pMainWidget; + + UFOAIFilterInit(); + + return PLUGIN_NAME; +} + +extern "C" const char* QERPlug_GetName (void) +{ + return (char *) PLUGIN_NAME; +} + +extern "C" const char* QERPlug_GetCommandList (void) +{ + return (char *) PLUGIN_COMMANDS; +} + +extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush) +{ + if (!strcmp(p, CMD_ABOUT)) { + g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); + } else { + Sys_Printf("Message: %s\n", p); + } +} + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientUFOAI g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) +{ +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(TOOLBAR_MAJOR, UFOAI_MINOR, sizeof(_QERPlugToolbarTable)); + g_SynapseClient.AddAPI(PLUGIN_MAJOR, UFOAI_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); + 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); + // selected brushes + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(g_DataTable), SYN_REQUIRE, &g_DataTable); + + return &g_SynapseClient; +} + +bool CSynapseClientUFOAI::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; + } else 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* CSynapseClientUFOAI::GetInfo() +{ + return PLUGIN_NAME " plugin built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientUFOAI::GetName() +{ + return PLUGIN_NAME; +} + diff --git a/contrib/ufoai/plugin.h b/contrib/ufoai/plugin.h new file mode 100644 index 00000000..09c84b98 --- /dev/null +++ b/contrib/ufoai/plugin.h @@ -0,0 +1,67 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +#include +// for CPtrArray for idata.h +#include "missing.h" + +#include "synapse.h" +#include "iplugin.h" +#include "itoolbar.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "igl.h" +#include "ifilesystem.h" +#include "ientity.h" +#include "idata.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERFileSystemTable g_FileSystemTable; +extern _QEREntityTable g_EntityTable; +extern _QERAppDataTable g_DataTable; +extern void *g_pMainWidget; + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientUFOAI : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientUFOAI() { } + virtual ~CSynapseClientUFOAI() { } +}; + +#define UFOAI_MINOR "ufo:ai" + +#endif // _PLUGIN_H_ diff --git a/contrib/ufoai/ufoai.def b/contrib/ufoai/ufoai.def new file mode 100644 index 00000000..764cbb4f --- /dev/null +++ b/contrib/ufoai/ufoai.def @@ -0,0 +1,8 @@ +; ufoai.def : Declares the module parameters for the DLL. + +LIBRARY "UFOAI" +DESCRIPTION 'UFOAI Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/contrib/ufoai/ufoai.vcproj b/contrib/ufoai/ufoai.vcproj new file mode 100644 index 00000000..438c657a --- /dev/null +++ b/contrib/ufoai/ufoai.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/ufoai/ufoai_filters.cpp b/contrib/ufoai/ufoai_filters.cpp new file mode 100644 index 00000000..cd68f246 --- /dev/null +++ b/contrib/ufoai/ufoai_filters.cpp @@ -0,0 +1,108 @@ + +#include "plugin.h" +#include "ufoai_filters.h" +#include "ifilters.h" + +#define FilterAdd g_FuncTable.m_pfnFilterAdd +#define FiltersActivate g_FuncTable.m_pfnFiltersActivate + +static bfilter_t* filters[FILTER_MAX]; + +void UFOAIFilterInit (void) +{ + // texture name filters + filters[FILTER_ACTORCLIP] = FilterAdd(1, 0, "actorclip", 0); + filters[FILTER_WEAPONCLIP] = FilterAdd(1, 0, "weaponclip", 0); + filters[FILTER_NODRAW] = FilterAdd(1, 0, "nodraw", 0); + filters[FILTER_STEPON] = FilterAdd(1, 0, "stepon", 0); + + // content flag filters + filters[FILTER_LEVEL1] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_1, "level1", 0); + filters[FILTER_LEVEL2] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_2, "level2", 0); + filters[FILTER_LEVEL3] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_3, "level3", 0); + filters[FILTER_LEVEL4] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_4, "level4", 0); + filters[FILTER_LEVEL5] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_5, "level5", 0); + filters[FILTER_LEVEL6] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_6, "level6", 0); + filters[FILTER_LEVEL7] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_7, "level7", 0); + filters[FILTER_LEVEL8] = FilterAdd(7, UFOAI_CONTENTS_LEVEL_8, "level8", 0); + + Sys_Printf("UFO:AI Filters initialized\n"); +} + +void PerformFiltering (int type) +{ + if (!filters[type]) { + Sys_Printf("filters are not yet initialized\n"); + return; + } + + if (filters[type]->active) { + filters[type]->active = false; + //Sys_Printf("filter %i deactivated (mask %i 0x%x)\n", type, filters[type]->mask, filters[type]->mask); + } else { + filters[type]->active = true; + //Sys_Printf("filter %i activated (mask %i 0x%x)\n", type, filters[type]->mask, filters[type]->mask); + } + + FiltersActivate(); +} + +void DoSteponFiltering(void) +{ + PerformFiltering(FILTER_STEPON); +} + +void DoWeaponClipFiltering(void) +{ + PerformFiltering(FILTER_WEAPONCLIP); +} + +void DoActorClipFiltering(void) +{ + PerformFiltering(FILTER_ACTORCLIP); +} + +void DoNoDrawFiltering(void) +{ + PerformFiltering(FILTER_NODRAW); +} + +void DoLevel1Filtering(void) +{ + PerformFiltering(FILTER_LEVEL1); +} + +void DoLevel2Filtering(void) +{ + PerformFiltering(FILTER_LEVEL2); +} + +void DoLevel3Filtering(void) +{ + PerformFiltering(FILTER_LEVEL3); +} + +void DoLevel4Filtering(void) +{ + PerformFiltering(FILTER_LEVEL4); +} + +void DoLevel5Filtering(void) +{ + PerformFiltering(FILTER_LEVEL5); +} + +void DoLevel6Filtering(void) +{ + PerformFiltering(FILTER_LEVEL6); +} + +void DoLevel7Filtering(void) +{ + PerformFiltering(FILTER_LEVEL7); +} + +void DoLevel8Filtering(void) +{ + PerformFiltering(FILTER_LEVEL8); +} diff --git a/contrib/ufoai/ufoai_filters.h b/contrib/ufoai/ufoai_filters.h new file mode 100644 index 00000000..c9e87237 --- /dev/null +++ b/contrib/ufoai/ufoai_filters.h @@ -0,0 +1,49 @@ + +enum FILTERS { + FILTER_ACTORCLIP, + FILTER_WEAPONCLIP, + FILTER_NODRAW, + FILTER_STEPON, + FILTER_LEVEL1, + FILTER_LEVEL2, + FILTER_LEVEL3, + FILTER_LEVEL4, + FILTER_LEVEL5, + FILTER_LEVEL6, + FILTER_LEVEL7, + FILTER_LEVEL8, + + FILTER_MAX +}; + +#define UFOAI_CONTENTS_LEVEL_1 0x0100 +#define UFOAI_CONTENTS_LEVEL_2 0x0200 +#define UFOAI_CONTENTS_LEVEL_3 0x0400 +#define UFOAI_CONTENTS_LEVEL_4 0x0800 +#define UFOAI_CONTENTS_LEVEL_5 0x1000 +#define UFOAI_CONTENTS_LEVEL_6 0x2000 +#define UFOAI_CONTENTS_LEVEL_7 0x4000 +#define UFOAI_CONTENTS_LEVEL_8 0x8000 + +#define UFOAI_CONTENTS_ACTORCLIP 0x00010000 +#define UFOAI_CONTENTS_WEAPONCLIP 0x02000000 +#define UFOAI_CONTENTS_STEPON 0x40000000 + +#define UFOAI_SURF_NODRAW 0x00000080 + + +void DoSteponFiltering(void); +void DoWeaponClipFiltering(void); +void DoActorClipFiltering(void); +void DoNoDrawFiltering(void); +void DoLevel1Filtering(void); +void DoLevel2Filtering(void); +void DoLevel3Filtering(void); +void DoLevel4Filtering(void); +void DoLevel5Filtering(void); +void DoLevel6Filtering(void); +void DoLevel7Filtering(void); +void DoLevel8Filtering(void); + +// add the ufoai filters +void UFOAIFilterInit(void); diff --git a/contrib/ufoaiplug/bitmaps/ufoai_actorclip.bmp b/contrib/ufoaiplug/bitmaps/ufoai_actorclip.bmp deleted file mode 100644 index 43bdf933..00000000 Binary files a/contrib/ufoaiplug/bitmaps/ufoai_actorclip.bmp and /dev/null differ diff --git a/contrib/ufoaiplug/bitmaps/ufoai_nodraw.bmp b/contrib/ufoaiplug/bitmaps/ufoai_nodraw.bmp deleted file mode 100644 index b9948562..00000000 Binary files a/contrib/ufoaiplug/bitmaps/ufoai_nodraw.bmp and /dev/null differ diff --git a/contrib/ufoaiplug/bitmaps/ufoai_stepon.bmp b/contrib/ufoaiplug/bitmaps/ufoai_stepon.bmp deleted file mode 100644 index 828449ef..00000000 Binary files a/contrib/ufoaiplug/bitmaps/ufoai_stepon.bmp and /dev/null differ diff --git a/contrib/ufoaiplug/bitmaps/ufoai_weaponclip.bmp b/contrib/ufoaiplug/bitmaps/ufoai_weaponclip.bmp deleted file mode 100644 index fe6b3485..00000000 Binary files a/contrib/ufoaiplug/bitmaps/ufoai_weaponclip.bmp and /dev/null differ diff --git a/contrib/ufoaiplug/ufoai.cpp b/contrib/ufoaiplug/ufoai.cpp deleted file mode 100644 index e371e833..00000000 --- a/contrib/ufoaiplug/ufoai.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ufoai.h" -#include "ufoai_level.h" -#include "ufoai_gtk.h" -#include "ufoai_filters.h" - -#include "debugging/debugging.h" - -#include "iplugin.h" - -#include "version.h" - -#include "string/string.h" -#include "modulesystem/singletonmodule.h" - -#include - -#define PLUGIN_VERSION "0.4" - -#include "ifilter.h" -#include "ibrush.h" -#include "iundo.h" // declaration of undo system -#include "ientity.h" // declaration of entity system -#include "iscenegraph.h" // declaration of datastructure of the map -#include "scenelib.h" // declaration of datastructure of the map -#include "qerplugin.h" // declaration to use other interfaces as a plugin -#include "ieclass.h" - -class UFOAIPluginDependencies : - public GlobalRadiantModuleRef, // basic class for all other module refs - public GlobalUndoModuleRef, // used to say radiant that something has changed and to undo that - public GlobalSceneGraphModuleRef, // necessary to handle data in the mapfile (change, retrieve data) - public GlobalEntityModuleRef, // to access and modify the entities - public GlobalEntityClassManagerModuleRef -{ -public: - UFOAIPluginDependencies(void) : - GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities")), - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")) - { - } -}; - -namespace UFOAI -{ - GtkWindow* g_mainwnd; - - const char* init(void* hApp, void* pMainWidget) - { - g_mainwnd = GTK_WINDOW(pMainWidget); - return "Initializing GTKRadiant UFOAI plugin"; - } - const char* getName() - { - return "UFO:AI"; - } - const char* getCommandList() - { - /*GlobalRadiant().getGameName()*/ - return "About;-;Worldspawn reset;Worldspawn;Perform check;-;Level 1;Level 2;Level 3;Level 4;Level 5;Level 6;Level 7;Level 8;-;StepOn;ActorClip;WeaponClip;Nodraw"; - } - const char* getCommandTitleList() - { - return ""; - } - void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) - { - char *message = NULL; - if(string_equal(command, "About")) - { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_mainwnd), - "UFO:AI Plugin (http://ufoai.sf.net)\nBuild: " __DATE__ "\nRadiant version: " RADIANT_VERSION "\nPlugin version: " PLUGIN_VERSION "\nAuthor: Martin Gerhardy (tlh2000/mattn)\n", "About", - eMB_OK, eMB_ICONDEFAULT); - } - else if(string_equal(command, "Level 1")) - { - filter_level(CONTENTS_LEVEL1); - } - else if(string_equal(command, "Level 2")) - { - filter_level(CONTENTS_LEVEL2); - } - else if(string_equal(command, "Level 3")) - { - filter_level(CONTENTS_LEVEL3); - } - else if(string_equal(command, "Worldspawn")) - { - assign_default_values_to_worldspawn(false, &message); - } - else if(string_equal(command, "Worldspawn reset")) - { - assign_default_values_to_worldspawn(true, &message); - } - else if(string_equal(command, "Perform check")) - { - check_map_values(&message); - } - else if(string_equal(command, "Level 4")) - { - filter_level(CONTENTS_LEVEL4); - } - else if(string_equal(command, "Level 5")) - { - filter_level(CONTENTS_LEVEL5); - } - else if(string_equal(command, "Level 6")) - { - filter_level(CONTENTS_LEVEL6); - } - else if(string_equal(command, "Level 7")) - { - filter_level(CONTENTS_LEVEL7); - } - else if(string_equal(command, "Level 8")) - { - filter_level(CONTENTS_LEVEL8); - } - else if(string_equal(command, "StepOn")) - { - filter_stepon(); - } - else if(string_equal(command, "ActorClip")) - { - filter_actorclip(); - } - else if(string_equal(command, "WeaponClip")) - { - filter_weaponclip(); - } - else if(string_equal(command, "NoDraw")) - { - filter_nodraw(); - } - - if (message != NULL) - { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_mainwnd), - message, "Note", - eMB_OK, eMB_ICONDEFAULT); - } - SceneChangeNotify(); - } -} // namespace - - -class UFOAIModule : public TypeSystemRef -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "UFO:AI"); - - UFOAIModule() - { - m_plugin.m_pfnQERPlug_Init = &UFOAI::init; - m_plugin.m_pfnQERPlug_GetName = &UFOAI::getName; - m_plugin.m_pfnQERPlug_GetCommandList = &UFOAI::getCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = &UFOAI::getCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = &UFOAI::dispatch; - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; - -typedef SingletonModule SingletonUFOAIModule; - -SingletonUFOAIModule g_UFOAIModule; - - -class UFOAIToolbarDependencies : public ModuleRef<_QERPluginTable> -{ -public: - UFOAIToolbarDependencies() : ModuleRef<_QERPluginTable>("UFO:AI") - { - } -}; - -class UFOAIToolbarModule : public TypeSystemRef -{ - _QERPlugToolbarTable m_table; -public: - typedef _QERPlugToolbarTable Type; - STRING_CONSTANT(Name, "UFO:AI"); - - UFOAIToolbarModule() - { - if (!strcmp(GlobalRadiant().getGameDescriptionKeyValue("name"), "UFO:Alien Invasion")) { - m_table.m_pfnToolbarButtonCount = ToolbarButtonCount; - m_table.m_pfnGetToolbarButton = GetToolbarButton; - } - else - { - m_table.m_pfnToolbarButtonCount = ToolbarNoButtons; - m_table.m_pfnGetToolbarButton = GetToolbarNoButton; - } - } - _QERPlugToolbarTable* getTable() - { - return &m_table; - } -}; - -typedef SingletonModule SingletonUFOAIToolbarModule; - -SingletonUFOAIToolbarModule g_UFOAIToolbarModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_UFOAIModule.selfRegister(); - g_UFOAIToolbarModule.selfRegister(); -} diff --git a/contrib/ufoaiplug/ufoai.def b/contrib/ufoaiplug/ufoai.def deleted file mode 100644 index 03e07507..00000000 --- a/contrib/ufoaiplug/ufoai.def +++ /dev/null @@ -1,7 +0,0 @@ -; sample.def : Declares the module parameters for the DLL. - -LIBRARY "UFOAI" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/contrib/ufoaiplug/ufoai.h b/contrib/ufoaiplug/ufoai.h deleted file mode 100644 index 7193fa0c..00000000 --- a/contrib/ufoaiplug/ufoai.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_UFOAI_H) -#define INCLUDED_UFOAI_H - -#endif diff --git a/contrib/ufoaiplug/ufoai.vcproj b/contrib/ufoaiplug/ufoai.vcproj deleted file mode 100644 index 7f63b261..00000000 --- a/contrib/ufoaiplug/ufoai.vcproj +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/ufoaiplug/ufoai_filters.cpp b/contrib/ufoaiplug/ufoai_filters.cpp deleted file mode 100644 index 869c4eb8..00000000 --- a/contrib/ufoaiplug/ufoai_filters.cpp +++ /dev/null @@ -1,342 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ufoai_filters.h" - -#include "ibrush.h" -#include "ientity.h" -#include "iscenegraph.h" - -// believe me, i'm sorry -#include "../../radiant/brush.h" - -#include "generic/callback.h" - -#include - -bool actorclip_active = false; -bool stepon_active = false; -bool nodraw_active = false; -bool weaponclip_active = false; -int level_active = 0; - -// TODO: This should be added to ibrush.h -// like already done for Node_getEntity in ientity.h -// FIXME: Doesn't belong here -inline Brush* Node_getBrush(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -void hide_node(scene::Node& node, bool hide) -{ - hide - ? node.enable(scene::Node::eHidden) - : node.disable(scene::Node::eHidden); -} - -typedef std::list entitylist_t; - -class EntityFindByName : public scene::Graph::Walker -{ - const char* m_name; - entitylist_t& m_entitylist; - /* this starts at 1 << level */ - int m_flag; - int m_hide; -public: - EntityFindByName(const char* name, entitylist_t& entitylist, int flag, bool hide) - : m_name(name), m_entitylist(entitylist), m_flag(flag), m_hide(hide) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - int spawnflagsInt; - Entity* entity = Node_getEntity(path.top()); - if (entity != 0) - { - if (string_equal(m_name, entity->getKeyValue("classname"))) - { - const char *spawnflags = entity->getKeyValue("spawnflags"); - globalOutputStream() << "spawnflags for " << m_name << ": " << spawnflags << ".\n"; - - if (!string_empty(spawnflags)) { - spawnflagsInt = atoi(spawnflags); - if (!(spawnflagsInt & m_flag)) - { - hide_node(path.top(), m_hide); // hide/unhide - m_entitylist.push_back(entity); - } - } - else - { - globalOutputStream() << "UFO:AI: Warning: no spawnflags for " << m_name << ".\n"; - } - } - } - return true; - } -}; - -class ForEachFace : public BrushVisitor -{ - Brush &m_brush; -public: - mutable int m_contentFlagsVis; - mutable int m_surfaceFlagsVis; - - ForEachFace(Brush& brush) - : m_brush(brush) - { - m_contentFlagsVis = -1; - m_surfaceFlagsVis = -1; - } - - void visit(Face& face) const - { -#if _DEBUG - if (m_surfaceFlagsVis < 0) - m_surfaceFlagsVis = face.getShader().m_flags.m_surfaceFlags; - else if (m_surfaceFlagsVis >= 0 && m_surfaceFlagsVis != face.getShader().m_flags.m_surfaceFlags) - globalOutputStream() << "Faces with different surfaceflags at brush\n"; - if (m_contentFlagsVis < 0) - m_contentFlagsVis = face.getShader().m_flags.m_contentFlags; - else if (m_contentFlagsVis >= 0 && m_contentFlagsVis != face.getShader().m_flags.m_contentFlags) - globalOutputStream() << "Faces with different contentflags at brush\n"; -#else - m_surfaceFlagsVis = face.getShader().m_flags.m_surfaceFlags; - m_contentFlagsVis = face.getShader().m_flags.m_contentFlags; -#endif - } -}; - -typedef std::list brushlist_t; - -class BrushGetLevel : public scene::Graph::Walker -{ - brushlist_t& m_brushlist; - int m_flag; - bool m_content; // if true - use m_contentFlags - otherwise m_surfaceFlags - mutable bool m_notset; - mutable bool m_hide; -public: - BrushGetLevel(brushlist_t& brushlist, int flag, bool content, bool notset, bool hide) - : m_brushlist(brushlist), m_flag(flag), m_content(content), m_notset(notset), m_hide(hide) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Brush* brush = Node_getBrush(path.top()); - if (brush != 0) - { - ForEachFace faces(*brush); - brush->forEachFace(faces); - // contentflags? - if (m_content) - { - // are any flags set? - if (faces.m_contentFlagsVis > 0) - { - // flag should not be set - if (m_notset && (!(faces.m_contentFlagsVis & m_flag))) - { - hide_node(path.top(), m_hide); - m_brushlist.push_back(brush); - } - // check whether flag is set - else if (!m_notset && ((faces.m_contentFlagsVis & m_flag))) - { - hide_node(path.top(), m_hide); - m_brushlist.push_back(brush); - } - } - } - // surfaceflags? - else - { - // are any flags set? - if (faces.m_surfaceFlagsVis > 0) - { - // flag should not be set - if (m_notset && (!(faces.m_surfaceFlagsVis & m_flag))) - { - hide_node(path.top(), m_hide); - m_brushlist.push_back(brush); - } - // check whether flag is set - else if (!m_notset && ((faces.m_surfaceFlagsVis & m_flag))) - { - hide_node(path.top(), m_hide); - m_brushlist.push_back(brush); - } - } - } - - } - return true; - } -}; - -/** - * @brief Activates the level filter for the given level - * @param[in] level Which level to show? - * @todo Entities - */ -void filter_level(int flag) -{ - int level; - brushlist_t brushes; - entitylist_t entities; - - level = (flag >> 8); - - if (level_active) - { - GlobalSceneGraph().traverse(BrushGetLevel(brushes, (level_active << 8), true, true, false)); - GlobalSceneGraph().traverse(EntityFindByName("func_door", entities, level_active, false)); - GlobalSceneGraph().traverse(EntityFindByName("func_breakable", entities, level_active, false)); - GlobalSceneGraph().traverse(EntityFindByName("misc_model", entities, level_active, false)); - GlobalSceneGraph().traverse(EntityFindByName("misc_particle", entities, level_active, false)); - entities.erase(entities.begin(), entities.end()); - brushes.erase(brushes.begin(), brushes.end()); - if (level_active == level) - { - level_active = 0; - // just disabĺe level filter - return; - } - } - level_active = level; - globalOutputStream() << "UFO:AI: level_active: " << level_active << ", flag: " << flag << ".\n"; - - // first all brushes - GlobalSceneGraph().traverse(BrushGetLevel(brushes, flag, true, true, true)); - - // now all entities - GlobalSceneGraph().traverse(EntityFindByName("func_door", entities, level, true)); - GlobalSceneGraph().traverse(EntityFindByName("func_breakable", entities, level, true)); - GlobalSceneGraph().traverse(EntityFindByName("misc_model", entities, level, true)); - GlobalSceneGraph().traverse(EntityFindByName("misc_particle", entities, level, true)); - -#ifdef _DEBUG - if (brushes.empty()) - { - globalOutputStream() << "UFO:AI: No brushes.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Found " << Unsigned(brushes.size()) << " brushes.\n"; - } - - // now let's filter all entities like misc_model, func_breakable and func_door that have the spawnflags set - if (entities.empty()) - { - globalOutputStream() << "UFO:AI: No entities.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Found " << Unsigned(entities.size()) << " entities.\n"; - } -#endif -} - -void filter_stepon (void) -{ - if (stepon_active) { - stepon_active = false; - } else { - stepon_active = true; - } - brushlist_t brushes; - GlobalSceneGraph().traverse(BrushGetLevel(brushes, CONTENTS_STEPON, true, false, stepon_active)); - - if (brushes.empty()) - { - globalOutputStream() << "UFO:AI: No brushes.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Hiding " << Unsigned(brushes.size()) << " stepon brushes.\n"; - } -} - -void filter_nodraw (void) -{ - if (nodraw_active) { - nodraw_active = false; - } else { - nodraw_active = true; - } - brushlist_t brushes; - GlobalSceneGraph().traverse(BrushGetLevel(brushes, SURF_NODRAW, false, false, nodraw_active)); - -#ifdef _DEBUG - if (brushes.empty()) - { - globalOutputStream() << "UFO:AI: No brushes.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Hiding " << Unsigned(brushes.size()) << " nodraw brushes.\n"; - } -#endif -} - -void filter_actorclip (void) -{ - if (actorclip_active) { - actorclip_active = false; - } else { - actorclip_active = true; - } - brushlist_t brushes; - GlobalSceneGraph().traverse(BrushGetLevel(brushes, CONTENTS_ACTORCLIP, true, false, actorclip_active)); - -#ifdef _DEBUG - if (brushes.empty()) - { - globalOutputStream() << "UFO:AI: No brushes.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Hiding " << Unsigned(brushes.size()) << " actorclip brushes.\n"; - } -#endif -} - -void filter_weaponclip (void) -{ - if (weaponclip_active) { - weaponclip_active = false; - } else { - weaponclip_active = true; - } - brushlist_t brushes; - GlobalSceneGraph().traverse(BrushGetLevel(brushes, CONTENTS_WEAPONCLIP, true, false, weaponclip_active)); - -#ifdef _DEBUG - if (brushes.empty()) - { - globalOutputStream() << "UFO:AI: No brushes.\n"; - } - else - { - globalOutputStream() << "UFO:AI: Hiding " << Unsigned(brushes.size()) << " weaponclip brushes.\n"; - } -#endif -} diff --git a/contrib/ufoaiplug/ufoai_filters.h b/contrib/ufoaiplug/ufoai_filters.h deleted file mode 100644 index 7d581140..00000000 --- a/contrib/ufoaiplug/ufoai_filters.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_FILTERS_H) -#define INCLUDED_FILTERS_H - -void filter_level(int flag); -void filter_stepon(void); -void filter_actorclip(void); -void filter_weaponclip(void); -void filter_nodraw(void); - -#define SURF_NODRAW 0x80 - -#define CONTENTS_LEVEL8 0x8000 -#define CONTENTS_LEVEL7 0x4000 -#define CONTENTS_LEVEL6 0x2000 -#define CONTENTS_LEVEL5 0x1000 -#define CONTENTS_LEVEL4 0x0800 -#define CONTENTS_LEVEL3 0x0400 -#define CONTENTS_LEVEL2 0x0200 -#define CONTENTS_LEVEL1 0x0100 -#define CONTENTS_ACTORCLIP 0x10000 -#define CONTENTS_WEAPONCLIP 0x2000000 -#define CONTENTS_STEPON 0x40000000 - -#endif diff --git a/contrib/ufoaiplug/ufoai_gtk.cpp b/contrib/ufoaiplug/ufoai_gtk.cpp deleted file mode 100644 index afadc7ad..00000000 --- a/contrib/ufoaiplug/ufoai_gtk.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ufoai_gtk.h" -#include "ufoai_filters.h" - -#include "itoolbar.h" -#include "iscenegraph.h" - -#include - -/** - * GTK callback functions - */ - -class UFOAIGtk -{ - GtkWindow* m_gtk_window; -public: - UFOAIGtk(void* gtk_window) : m_gtk_window((GtkWindow*)gtk_window) - { - } -}; - -/** - * @brief If you return FALSE in the "delete_event" signal handler, - * GTK will emit the "destroy" signal. Returning TRUE means - * you don't want the window to be destroyed. - * This is useful for popping up 'are you sure you want to quit?' - * type dialogs. - */ -static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) -{ - return FALSE; -} - -/** - * @brief destroy widget if destroy signal is passed to widget - */ -static void destroy(GtkWidget *widget, gpointer data) -{ - gtk_widget_destroy(widget); -} - -/** - * @brief function for close button to destroy the toplevel widget - */ -static void close_window(GtkWidget *widget, gpointer data) -{ - gtk_widget_destroy(gtk_widget_get_toplevel(widget)); -} - -/* =============================== */ - -#define NUM_TOOLBARBUTTONS 12 - -/** - * @brief - */ -std::size_t ToolbarButtonCount(void) -{ - return NUM_TOOLBARBUTTONS; -} - -/** - * @brief Used if the ufo plugin should not be visible (at least the toolbar stuff) - */ -std::size_t ToolbarNoButtons (void) -{ - return 0; -} - -/** - * @brief - */ -class CUFOAIToolbarButton : public IToolbarButton -{ -public: - virtual const char* getImage() const - { - switch( mIndex ) - { - case 0: return "ufoai_level1.bmp"; - case 1: return "ufoai_level2.bmp"; - case 2: return "ufoai_level3.bmp"; - case 3: return "ufoai_level4.bmp"; - case 4: return "ufoai_level5.bmp"; - case 5: return "ufoai_level6.bmp"; - case 6: return "ufoai_level7.bmp"; - case 7: return "ufoai_level8.bmp"; - case 8: return "ufoai_stepon.bmp"; - case 9: return "ufoai_actorclip.bmp"; - case 10: return "ufoai_weaponclip.bmp"; - case 11: return "ufoai_nodraw.bmp"; - } - return NULL; - } - virtual EType getType() const - { - switch( mIndex ) - { -/* case 3: return eButton;*/ - case 8: return eToggleButton; - case 9: return eToggleButton; - case 10: return eToggleButton; - case 11: return eToggleButton; - default: return eButton; - } - } - virtual const char* getText() const - { - switch( mIndex ) - { - case 0: return "Level 1"; - case 1: return "Level 2"; - case 2: return "Level 3"; - case 3: return "Level 4"; - case 4: return "Level 5"; - case 5: return "Level 6"; - case 6: return "Level 7"; - case 7: return "Level 8"; - case 8: return "Stepon"; - case 9: return "Actorclip"; - case 10: return "Weaponclip"; - case 11: return "Nodraw"; - } - return NULL; - } - virtual const char* getTooltip() const - { - switch( mIndex ) - { - case 0: return "Show only level 1"; - case 1: return "Show only level 2"; - case 2: return "Show only level 3"; - case 3: return "Show only level 4"; - case 4: return "Show only level 5"; - case 5: return "Show only level 6"; - case 6: return "Show only level 7"; - case 7: return "Show only level 8"; - case 8: return "Hide stepon brushes"; - case 9: return "Hide actorclip brushes"; - case 10: return "Hide weaponclip brushes"; - case 11: return "Hide nodraw brushes"; - } - return NULL; - } - - virtual void activate() const - { - switch( mIndex ) - { - case 0: filter_level(CONTENTS_LEVEL1); break; - case 1: filter_level(CONTENTS_LEVEL2); break; - case 2: filter_level(CONTENTS_LEVEL3); break; - case 3: filter_level(CONTENTS_LEVEL4); break; - case 4: filter_level(CONTENTS_LEVEL5); break; - case 5: filter_level(CONTENTS_LEVEL6); break; - case 6: filter_level(CONTENTS_LEVEL7); break; - case 7: filter_level(CONTENTS_LEVEL8); break; - case 8: filter_stepon(); break; - case 9: filter_actorclip(); break; - case 10: filter_weaponclip(); break; - case 11: filter_nodraw(); break; - } - SceneChangeNotify(); - } - - std::size_t mIndex; -}; - -/** - * @brief - */ -CUFOAIToolbarButton g_ufoaiToolbarButtons[NUM_TOOLBARBUTTONS]; - -/** - * @brief - */ -const IToolbarButton* GetToolbarButton(std::size_t index) -{ - g_ufoaiToolbarButtons[index].mIndex = index; - return &g_ufoaiToolbarButtons[index]; -} - -/** - * @brief - */ -const IToolbarButton* GetToolbarNoButton(std::size_t index) -{ - return NULL; -} diff --git a/contrib/ufoaiplug/ufoai_gtk.h b/contrib/ufoaiplug/ufoai_gtk.h deleted file mode 100644 index ef2ae3c3..00000000 --- a/contrib/ufoaiplug/ufoai_gtk.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_UFOAI_GTK_H) -#define INCLUDED_UFOAI_GTK_H - -#include "itoolbar.h" -#include - -const IToolbarButton* GetToolbarButton(std::size_t index); -const IToolbarButton* GetToolbarNoButton(std::size_t index); -std::size_t ToolbarButtonCount(void); -std::size_t ToolbarNoButtons(void); - -#endif diff --git a/contrib/ufoaiplug/ufoai_level.cpp b/contrib/ufoaiplug/ufoai_level.cpp deleted file mode 100644 index 3a36b258..00000000 --- a/contrib/ufoaiplug/ufoai_level.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ufoai_level.h" -#include "ufoai_filters.h" - -#include "ibrush.h" -#include "ientity.h" -#include "iscenegraph.h" - -#include "string/string.h" -#include - -class Level; - -/** - * @brief find entities by class - * @note from radiant/map.cpp - */ -class EntityFindByClassname : public scene::Graph::Walker -{ - const char* m_name; - Entity*& m_entity; -public: - EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity) - { - m_entity = 0; - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(m_entity == 0) - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 && string_equal(m_name, entity->getKeyValue("classname"))) - { - m_entity = entity; - } - } - return true; - } -}; - -/** - * @brief - */ -Entity* Scene_FindEntityByClass(const char* name) -{ - Entity* entity = NULL; - GlobalSceneGraph().traverse(EntityFindByClassname(name, entity)); - return entity; -} - -/** - * @brief finds start positions - */ -class EntityFindFlags : public scene::Graph::Walker -{ - const char *m_classname; - const char *m_flag; - int *m_count; - - public: - EntityFindFlags(const char *classname, const char *flag, int *count) : m_classname(classname), m_flag(flag), m_count(count) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - const char *str; - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 && string_equal(m_classname, entity->getKeyValue("classname"))) - { - str = entity->getKeyValue(m_flag); - if (string_empty(str)) - { - (*m_count)++; - } - } - return true; - } -}; - - -/** - * @brief finds start positions - */ -class EntityFindTeams : public scene::Graph::Walker -{ - const char *m_classname; - int *m_count; - int *m_team; - -public: - EntityFindTeams(const char *classname, int *count, int *team) : m_classname(classname), m_count(count), m_team(team) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - const char *str; - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 && string_equal(m_classname, entity->getKeyValue("classname"))) - { - if (m_count) - (*m_count)++; - // now get the highest teamnum - if (m_team) - { - str = entity->getKeyValue("team"); - if (!string_empty(str)) - { - if (atoi(str) > *m_team) - (*m_team) = atoi(str); - } - } - } - return true; - } -}; - -/** - * @brief - */ -void get_team_count (const char *classname, int *count, int *team) -{ - GlobalSceneGraph().traverse(EntityFindTeams(classname, count, team)); - globalOutputStream() << "UFO:AI: classname: " << classname << ": #" << (*count) << "\n"; -} - -/** - * @brief Some default values to worldspawn like maxlevel and so on - */ -void assign_default_values_to_worldspawn (bool override, char **returnMsg) -{ - static char message[1024]; - Entity* worldspawn; - int teams = 0; - int count = 0; - char str[64]; - - worldspawn = Scene_FindEntityByClass("worldspawn"); - if (!worldspawn) - { - globalOutputStream() << "UFO:AI: Could not find worldspawn.\n"; - *returnMsg = "Could not find worldspawn"; - return; - } - - *message = '\0'; - *str = '\0'; - - if (override || string_empty(worldspawn->getKeyValue("maxlevel"))) - { - // TODO: Get highest brush - a level has 64 units - worldspawn->setKeyValue("maxlevel", "5"); - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Set maxlevel to: %s", worldspawn->getKeyValue("maxlevel")); - } - - if (override || string_empty(worldspawn->getKeyValue("maxteams"))) - { - get_team_count("info_player_start", &count, &teams); - if (teams) - { - snprintf(str, sizeof(str) - 1, "%i", teams); - worldspawn->setKeyValue("maxteams", str); - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Set maxteams to: %s", worldspawn->getKeyValue("maxteams")); - } - if (count < 16) - { - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "You should at least place 16 info_player_start"); - } - } - - // no errors - no warnings - if (!strlen(message)) - return; - - *returnMsg = message; -} - -/** - * @brief - */ -int check_entity_flags (const char *classname, const char *flag) -{ - int count; - - /* init this with 0 every time we browse the tree */ - count = 0; - - GlobalSceneGraph().traverse(EntityFindFlags(classname, flag, &count)); - return count; -} - -/** - * @brief Will check e.g. the map entities for valid values - * @todo: check for maxlevel - */ -void check_map_values (char **returnMsg) -{ - static char message[1024]; - int count = 0; - int teams = 0; - int ent_flags; - Entity* worldspawn; - char str[64]; - - worldspawn = Scene_FindEntityByClass("worldspawn"); - if (!worldspawn) - { - globalOutputStream() << "UFO:AI: Could not find worldspawn.\n"; - *returnMsg = "Could not find worldspawn"; - return; - } - - *message = '\0'; - *str = '\0'; - - // multiplayer start positions - get_team_count("info_player_start", &count, &teams); - if (!count) - strncat(message, "No multiplayer start positions (info_player_start)\n", sizeof(message) - 1); - - // singleplayer map? - count = 0; - get_team_count("info_human_start", &count, NULL); - if (!count) - strncat(message, "No singleplayer start positions (info_human_start)\n", sizeof(message) - 1); - - // singleplayer map? - count = 0; - get_team_count("info_2x2_start", &count, NULL); - if (!count) - strncat(message, "No singleplayer start positions for 2x2 units (info_2x2_start)\n", sizeof(message) - 1); - - // search for civilians - count = 0; - get_team_count("info_civilian_start", &count, NULL); - if (!count) - strncat(message, "No civilian start positions (info_civilian_start)\n", sizeof(message) - 1); - - // check maxlevel - if (string_empty(worldspawn->getKeyValue("maxlevel"))) - strncat(message, "Worldspawn: No maxlevel defined\n", sizeof(message) - 1); - else if (atoi(worldspawn->getKeyValue("maxlevel")) > 8) - { - strncat(message, "Worldspawn: Highest maxlevel is 8\n", sizeof(message) - 1); - worldspawn->setKeyValue("maxlevel", "8"); - } - - ent_flags = check_entity_flags("func_door", "spawnflags"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i func_door with no spawnflags\n", ent_flags); - ent_flags = check_entity_flags("func_breakable", "spawnflags"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i func_breakable with no spawnflags\n", ent_flags); - ent_flags = check_entity_flags("misc_sound", "spawnflags"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i misc_sound with no spawnflags\n", ent_flags); - ent_flags = check_entity_flags("misc_model", "spawnflags"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i misc_model with no spawnflags\n", ent_flags); - ent_flags = check_entity_flags("misc_particle", "spawnflags"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i misc_particle with no spawnflags\n", ent_flags); - ent_flags = check_entity_flags("info_player_start", "team"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i info_player_start with no team assigned\n!!Teamcount may change after you've fixed this\n", ent_flags); - ent_flags = check_entity_flags("light", "color"); - ent_flags = check_entity_flags("light", "_color"); - if (ent_flags) - snprintf(&message[strlen(message)], sizeof(message) - 1 - strlen(message), "Found %i lights with no color value\n", ent_flags); - - // no errors found - if (!strlen(message)) { - snprintf(message, sizeof(message) - 1, "No errors found - you are ready to compile the map now\n"); - } - - *returnMsg = message; -} diff --git a/contrib/ufoaiplug/ufoai_level.h b/contrib/ufoaiplug/ufoai_level.h deleted file mode 100644 index ba75bd45..00000000 --- a/contrib/ufoaiplug/ufoai_level.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_UFOAI_LEVEL_H) -#define INCLUDED_UFOAI_LEVEL_H - -void assign_default_values_to_worldspawn (bool override, char **returnMsg); -void check_map_values (char **returnMsg); -void get_team_count (const char *classname, int *count, int *team); - -#endif diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png new file mode 100644 index 00000000..faf0c04d Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png new file mode 100644 index 00000000..e47ad7d6 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png new file mode 100644 index 00000000..71383952 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png new file mode 100644 index 00000000..f69042e3 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png new file mode 100644 index 00000000..b0b7fd32 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png new file mode 100644 index 00000000..2c2f6749 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png new file mode 100644 index 00000000..84015aee Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png new file mode 100644 index 00000000..fd5292fa Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png new file mode 100644 index 00000000..28110bfa Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png new file mode 100644 index 00000000..8761cf55 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png new file mode 100644 index 00000000..d0e53bf1 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png new file mode 100644 index 00000000..4b70c81a Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png new file mode 100644 index 00000000..d4a10aca Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png new file mode 100644 index 00000000..8542c9e2 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png new file mode 100644 index 00000000..db8801f1 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png new file mode 100644 index 00000000..90681bb4 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png new file mode 100644 index 00000000..303e9663 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png new file mode 100644 index 00000000..816422e7 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png new file mode 100644 index 00000000..fa01de36 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png new file mode 100644 index 00000000..60f4bc1d Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png differ diff --git a/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png new file mode 100644 index 00000000..16d81ad2 Binary files /dev/null and b/docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png differ diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_a.htm b/docs/manual/Q3Rad_Manual/appndx/appn_a.htm new file mode 100644 index 00000000..af9a048f --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_a.htm @@ -0,0 +1,56 @@ + + +Q3Radiant Editor Manual: Appendix A + + + +

Q3Radiant Editor Manual

+
+

Appendix A: Glossary of Terms

+ +Alpha Channel: This is a fourth 8-bit grayscale channel that is used by the shaders to further manipulate the art. It is often used to create transparency and translucency. +
Arena: A confined space in which Quake III Arena game play occurs. This is also called a "map" or a "level". +
B_Model: An entity, such as a lift, train, door, or rotating object, made of geometry brushes. These models can also contain curve patches and md3 models as components. +
Brush: A single piece of map geometry defined by four or more vertices that define a solid, convex volume. +
Bot: A computer-controlled player. To the server, a bot is treated as if it were a player. Some entities can make a distinction between interaction with, or use by "live" players and/or bots. +
Bsp: An abbreviation for Binary Space Partitioning. This is used as a name for the compiling process. +
BSPC: The utility, which creates a bot navigation .aas file for a map. Currently, it is run from outside the editor. +
Compile: A number crunching process that turns editor code into game code. This is also referred to as "bsp". +
CTF: (g_gametype 4) Abbreviation for the team game type "Capture the Flag." +
Delay:  A keyword for the amount of time, expressed in seconds (value), between the moment when activation occurs and the moment when the event it triggers occurs. +
DM: Abbreviation for "Death Match." +
Editor: Usually refers to the tool, in this case, Q3Radiant, used to make game maps. +
Entity: One of several classes of objects that are placed into game maps. Entities include miscellaneous models, ammo, weapons, point lights, doors, moving objects and so on. +
Event: Something that happens during game play. Activating a trigger is an event. +
FFA: (g_gametype 0) Abbreviation for "Free for All" a style of play in which every player is pitted against all other players. +
FPS: This is Frames per Second, sometimes call frame rate. This number shows approximately how many times the screen is being redrawn each second. This number depends on many factors, including the complexity of the map, the number of players in the map (bots are worse than humans), the processing power of the computer and the processing power of the video accelerator card in that computer. It is not the best measure for determining the playability of a map. +
FOV: Field of View how much of the game world can be see at one time, either in the game or the camera window of the editor. +
Game Unit: The basic unit of measure in a game map. Eight game units are approximately equal to one foot (30.48 cm) in the "real" world. This measure is also referred to as simply a "unit." +
Grid: In the Map Windows, this is a measuring tool, much like graph paper. +
Key: A key is a property possessed by an entity in the game. Light entities have a default value of 300. See the Entity description appendix for details Entering in the key "light" with a "value" of 150 reduces that by half. +
Map: Also called an arena or a game level. It is a self-contained game play area created by an editing tool like +Q3Radiant. It can refer to both the map file and the final playable product. +
Map Component: This is anything placed in the editor to create the map. It includes geometry brushes, curve patches, lights, entities, and models. +
Md3: Shorthand for a mesh model created and textured outside of Q3Radiant. The acronym refers to the custom file format used for the models in Quake III Arena. +
Patch: Any map component built from bezier curves. This includes bevels, caps, patches, and cylinders. +
Pathname: The sequence of file folders/directories from a starting point to a game asset or executable. +
Pixel: The smallest definable graphic component. This literally means, "Picture element". A game unit typically consists of a square cluster of 4 pixels (two pixels by two pixels). +
POV: Point of View. This is essentially, where the eye sits in relation to the game world. +
Project: A text file that contains the path designations for the various editor functions of Q3Radiant. +
PVS: Potential Viewable Set. Refers to those world triangles that might be seen from a position in the game world. +
R_Speeds: This is a set of numbers used to debug maps for visual complexity They show the number of triangles that are being drawn in a given point of view. Lower numbers are better. +
Region: A subset of the map. Selecting one or more map components and using a menu command to set them off temporarily from the rest of the map create regions. +
Script: A text file that contains instructions for the game. Examples: arena.txt, base_floor.shader, debug.cfg. +
Shader: A short script of program commands that define the way the graphic engine processes a texture. +
Team DM: (g_gametype 3) A team of players takes on another team to get the most frags. +
Texture: A graphic file designed to suggest a physical surface or a component for a graphic special effect. +
T-Junction Cracks: A visual artifact resulting from patch vertices that are not properly matched to world geometry. This is characterized by 'sparkles' running along the edge of the patch. +
Tournament: (g_gametype 1) This is a mode of game play characterized by a one on one match with other players watching as spectators while waiting their turns. The winner of the match plays the next opponent. +
Trigger: A map component that activates events in the game world under the right conditions. +
Unit: (See "Game Unit") +
Value: A setting for a key possessed by an entity. Depending on the key, values can be numbers, pathnames, word +strings, or word commands. See individual Entity descriptions for details. +
Z-fighting: A visual artifact caused when two z-buffered surfaces share the same plane, resulting in the engine trying to draw both simultaneously. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_1.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_1.htm new file mode 100644 index 00000000..c9fb166b --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_1.htm @@ -0,0 +1,228 @@ + + +Q3Radiant Editor Manual: Appendix B1 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+This Section owes much of the background and testing research to three dedicated Quake Engine editing supporters, Suicide20, inolen, and EuteTic. It is based on version 1.1 (12/22/99) of a document that they created and gave us permission to include with the official id editor documents. + +

"Keys" are keywords that represent the in-game properties of an +entity. Some are flags that determine whether an entity will +appear in a particular game play mode. Others define extents or +rates for entity movement. Others establish how much of some game +effect will occur (example: damage) or how long to wait until an +event occurs or can reoccur. + + + +

With the exception of properties that can be set by checkboxes, +the map maker will need to type in keys (names for game function +properties) and their values (numbers or strings) into fields +within the entities window. + + + +

Keys that are set by checkboxes in the editor are called +"Spawnflags" and will be shown in All Caps. The rest are shown in +lowercase, as they should be typed into the editor field. + + + +

Basic Key information

+Angle: This is the direction of facing or direction of +movement for an entity. Set this value with the Angle buttons on +the entity window. The angle value can be typed in as any positive +value between 1 and 360. + + + +

Color: This key only affects md3 models that are built +into func_entities. The color is the color of light used to +illuminate the model. It is expressed as a normalized three +digit RGB formula. + + + +

Entity Dimensions: The minimum and maximum coordinate +dimensions of the entity box. + + + +

Light: This key only affects md3 models that are built +into func_entities. + + + +

Map Entity Color: This is the color of the generic entity +box used to represent the entity in the map editor. + + + +

Ammo_* Entities

+The properties for ammo entities are all very similar. + +

Map Entity Color: Blue +
Entity Dimensions: (-16 -16 -16) (16 16 16) + +

These are ammunition boxes for weapons in the game. They can be +represented by either a blue entity box, or the ammo box model +itself. With the exception of the type and amount of ammo given to +the player upon pick up, all ammo entities have the same +properties. + +

ammo_bfg
+Game Function: BFG ammo. Gives the player 15 shots by +default. + + + +

Custom Keys + +
count: sets the amount of ammo given to the player when +picked up (default 15). + +

ammo_bullets
+ +Game Function: Machine Gun ammo. Gives the player 50 +shots by default. + +

Custom Keys + +
count: sets the amount of ammo given to the player when +picked up (default 50). + +

ammo_cells
+ +Game Functions: Plasma Gun ammo. Gives the player 30 +shots by default. + + + +

Custom Keys + +
count: sets the amount of ammo given to the player when +picked up (default 30). + +

ammo_grenades
+ +Game Function: Grenade Launcher ammo. Gives the player 5 +shots by default. + + + +

Custom Keys + +
count: sets the amount of ammo given to the player when +picked up (default 5). + +

ammo_lightning
+ +Game Function: Lightning Gun ammo. Gives the player 60 +shots by default. + +

Custom Keys + +
count: sets the amount of ammo given to the player when +picked up (default 60). + +

ammo_rockets
+Game Function: Rocket Launcher ammo. Gives the player 5 +shots by default. + + + +

Custom Keys +
count: sets the amount of ammo given to the player when +picked up (default 5). + +

ammo_shells
+ +Game Function: Shotgun ammo. Gives the player 10 shots by +default. + + + +

Custom Keys +
count: sets the amount of ammo given to the player when +picked up (default 10). + +

ammo_slugs
+Game Function: Railgun ammo. Gives the player 10 shots by +default. + + + +

Custom Keys +
count: sets the amount of ammo given to the player when +picked up (default 10). + + + +

Common Keys +
wait: time in seconds before the item respawns after +being picked up (default 40, -1 = never respawn). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
team: set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + +
target: picking up the item will trigger the entity this +points to. + +
targetname: a target_give entity can point to this for +respawn freebies. + +
notbot: when set to 1, a bot will never seek out this +item + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags +
SUSPENDED: item will spawn where it was placed in map and won't +drop to the floor. Set by Checkbox. Bots will only be attracted to +suspended entities if they are reachable by way of a jump pad or +launch pad (trigger_push). + + + +

Notes + +
The amount of time it takes for an item in the team to respawn +is determined by the "wait" value of the item that was picked up +previously. So if one of the items in the team has it's "wait" key +set to -1 (never respawn), the random respawning cycle of the +teamed items will stop after that item is picked up. + + + +

When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + + + +

Design Notes + +
An ammo item can be given a negative "count" value. Taking away +ammo in combat would be a bad idea but in combination with a +target_give entity, it can be used to set up games mods like Rocket +Arena by removing the machinegun ammunition from a player when he +spawns into the map.
+

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_2.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_2.htm new file mode 100644 index 00000000..dd9a5104 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_2.htm @@ -0,0 +1,651 @@ + + +Q3Radiant Editor Manual: Appendix B2 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Func_* Entities

+Func_Entities include a wider variety of game purposes than +other entity classes. They are sometimes represented by simple +function boxes. But many are built out of brushes, patches and +models. These constructions are sometimes called "b_models", though +for many of them the word "mover" works as well, since they are +made to be moving objects in the game world. + +

func_bobbing
+ +Map Entity Color: N/A + +
Dimensions: size of map components used + +
Game Function: Solid entity that oscillates back and +forth in a linear motion. By default, it will have an amount of +displacement in either direction equal to the dimension of the +brush in the axis in which it's bobbing. Entity bobs on the Z axis +(up-down) by default. It can also emit sound if the "noise" key is +set. Will crush the player when blocked. + + + +

Keys + +
speed: amount of time in seconds for one complete +oscillation cycle (default 4). + +
height: sets the amount of travel of the oscillation +movement (default 32). + +
phase: sets the start offset of the oscillation cycle. +Values must be 0 < phase < 1. Any integer phase value is the +same as no offset (default 0). + +
noise: path/name of .wav file to play. Use looping sounds +only (eg. sound/world/drone6.wav - See Notes). + +
model2: path/name of model to include (eg: +models/mapobjects/jets/jets01.md3). + +
origin: alternate method of setting XYZ origin of sound +and .md3 model included with entity (See Notes). + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags +
X_AXIS : entity will bob along the X axis. +
Y_AXIS : entity will bob along the Y axis. + + + +

Notes +
In order for the sound to be emitted from the location of the +entity, it is recommended to include a brush with an origin shader +at its center, otherwise the sound will not follow the entity as it +moves. Setting the origin key is simply an alternate method to +using an origin brush. When using the model2 key, the origin point +of the model will correspond to the origin point defined by either +the origin brush or the origin coordinate value. The movement of +the func_bobbing follows a sinoid wave pattern. + + + +

func_button
+Map Entity Color: N/A + +
Dimensions: size of map components used + +
Game Function: When a button is touched by a player, it +moves in the direction set by the "angle" key, triggers all its +targets, stays pressed by an amount of time set by the "wait" key, +then returns to its original position where it can be operated +again. + + + +

Keys +
angle: determines the direction in which the button will +move (up = -1, down = -2). + +
target: all entities with a matching targetname will be +triggered. + +
speed: speed of button's displacement (default 40). Speed +is in game units per second. + +
wait: number of seconds button stays pressed (default 1, +-1 = return immediately). + +
lip: lip remaining at end of move (default 4 units). + +
health: if set to a non-zero value, the button must be +damaged by "health" amount of points to operate. + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
model2: path/name of model to include (eg: +models/mapobjects/pipe/pipe02.md3). + +
origin: alternate method of setting XYZ origin of .md3 +model included with entity (See Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes +
Setting the origin key is simply an alternate method to using an +origin brush. When using the model2 key, the origin point of the +model will correspond to the origin point defined by either the +origin brush or the origin coordinate value. + + + +

func_door
+ +Map Entity Color: N/A + +
Dimensions: size of map components used + +
Game Function: Normal sliding door entity. By default, +the door will activate when player walks close to it or when damage +is inflicted on it. Doors move a distance equal to their dimension +along the selected angle of  travel, minus the "lip" key +value. + + + +

Keys + +
angle: determines the opening direction of door  (up += -1, down = -2). + +
speed: determines how fast the door moves (default 100). +Speed is in game units per second. + +
wait: number of seconds before door returns (default 2, +-1 = return immediately - see Notes). + +
lip: lip remaining at end of move (default 8). + +
targetname: if set, a func_button or trigger is required +to activate the door. + +
health: if set to a non-zero value, the door must be +damaged by "health" amount of points to activate (default 0). + +
dmg: damage to inflict on player when he blocks operation +of door (default 4). Door will reverse direction when blocked +unless CRUSHER spawnflag is set. + +
team: assign the same team name to multiple doors that +should operate together (see Notes). + +
light: constantLight radius of .md3 model included with entity. +Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes. (default 1 1 1). + +
model2: path/name of model to include (eg: +models/mapobjects/pipe/pipe02.md3). + +
origin: alternate method of setting XYZ origin of .md3 +model included with entity (See Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
START_OPEN: the door will spawn in the open state and +operate in reverse. + +
CRUSHER: door will not reverse direction when blocked and +will keep damaging player until he dies or gets out of the way. + + + +

Notes + +
Unlike in Quake 2, doors that touch are NOT automatically +teamed. If you want doors to operate together, you have to team +them manually by assigning the same team name to all of them. +Setting wait =-1 for normal touch doors makes them work +erratically. Use this only for damage-only ("health" key set to +non-zero value) or targeted doors. Setting the origin key is simply +an alternate method to using an origin brush. When using the model2 +key, the origin point of the model will correspond to the origin +point defined by either the origin brush or the origin coordinate +value. + + + +

func_group
+ +Map Entity Color:  Light blue + +
Dimensions: Determined by dimensions of map +components. + +
Game Function: This is not an entity. It is strictly an +editor utility to group world brushes and patches together for +convenience (selecting, moving, copying, etc). You cannot group +entities with this. + + + +

Notes + +
The TAB key can be used to flip through the component pieces of +a selected func_group entity, isolating individual components. + + + +

func_pendulum
+ +Map Entity Color: Light blue + +
Dimensions: Determined by dimensions of map +components. + +
Game Function: Solid entity that describes a pendulum +back and forth rotation movement. Rotates on the X axis by default. +Pendulum frequency is a physical constant based on the length of +the beam and gravity. Contact with the pendulum instantly kills a +player. + + + +

Keys + +
angle: angle offset of axis of rotation from default X +axis (default 0/360). + +
speed: angle of swing arc in either direction from +initial vertical position (default 30). + +
phase: sets the start offset of the swinging cycle. +Values must be 0 < phase < 1. Any integer phase value is the +same as no offset (default 0). + +
noise: path/name of .wav file to play. Use looping sounds +only (eg. sound/world/drone6.wav). + +
model2: path/name of model to include (eg: +models/mapobjects/jets/jets01.md3). + +
origin: alternate method of setting XYZ origin of +entity's rotation axis and .md3 model included with entity (default +"0 0 0" - See Notes). + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
You need to have an origin brush as part of this entity. The +center of that brush will be the point through which the rotation +axis passes. Setting the origin key is simply an alternate method +to using an origin brush. Pendulum will rotate along the X axis by +default. Pendulum cannot rotate along Z axis. The speed of swing +(frequency) is not adjustable, and the "dmg" key (although set in +the Q3A maps) has no effect whatsoever. When using the model2 key, +the origin point of the model will correspond to the origin point +defined by either the origin brush or the origin coordinate +value. + +

func_plat
+ +Map Entity Color: Light blue + +
Dimensions: Determined by dimensions of map +components. + +
Game Function: This is a rising platform that a player +can ride to reach higher places. Plats must always be drawn in the +raised position, so they will operate and be lighted correctly but +they spawn in the lowered position. The plat will stay in the +raised position until the player steps off. There are no proper +sounds for this entity, only beep noises, so sound call paths must +be adjusted (see Notes). + + + +

Keys + +
speed: determines how fast the plat moves (default 150) +in game units per second. + +
lip: lip remaining at end of move (default 16). Has no +effect if "height" is set. + +
height: if set, this will determine the total amount of +vertical travel of the plat (see Design Notes). + +
dmg: damage to inflict on a player when he blocks +operation of plat (default 4). Plat will reverse direction when +blocked. + +
targetname: if set, the trigger that points to this will +raise the plat each time it fires. The plat raises and comes back +down a second later if no player is on it. + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
model2: path/name of model to include (eg: +models/mapobjects/pipe/pipe02.md3). + +
origin: alternate method of setting XYZ origin of .md3 +model included with entity (See Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
By default, the total amount of vertical travel of a platform is +implicitly determined by the overall vertical size of the brushes +of which it's made minus the lip value. But if the "height" key is +used, then the total amount of vertical travel of the plat will be +exactly that value regardless of the shape and size of the plat and +regardless of the value of the "lip" key. Using the "height" key is +the best method for any kind of platforms and the only possible one +for thin plats which need to travel vertical distances many times +their own thickness. Setting the origin key is simply an alternate +method to using an origin brush. When using the model2 key, the +origin point of the model will correspond to the origin point +defined by either the origin brush or the origin coordinate +value. + + + +

Design Notes: + +
     Clip brushes can be used to create the +additional size for "thin" plats. Func_plats were pulled from all +maps in the final build of Quake 3 Arena due to some problems in +their operation, particularly as it related to bot function.  +The id designers recommend using plats with care and that plats be +built as "solid" pillar-like lifts (more like those in Doom). + +
     There is a way to make plats play +proper sounds. Just create a sound\movers\plats folder under baseq3 +and put 2 sounds named pt1_start.wav and pt1_end.wav in it. Those +can be the renamed sounds from the Q2 plats or renamed copies of +the sound\movers\doors sounds you can extract from your pak0.pk3 +file or new custom sounds if you're up to it. Thanks to Fragzilla +for the tip.
+ + + +

func_rotating
+ +Map Entity Color: Light blue + +
Dimensions: Determined by dimensions of map +components. + +
Game Function: Solid entity that rotates continuously. +Rotates on the Z axis by default and requires an origin brush. It +will always start on in the game and is not targetable. + + + +

Keys + +
speed: determines how fast entity rotates (default +100). + +
noise: path/name of .wav file to play. Use looping sounds +only (eg. sound/world/drone6.wav). + +
model2: path/name of model to include (eg: +models/mapobjects/bitch/fembotbig.md3). + +
origin: alternate method of setting XYZ origin of +entity's rotation axis and .md3 model included with entity (default +"0 0 0" - See Notes). + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
X_AXIS: entity will rotate along the X axis. + +
Y_AXIS: entity will rotate along the Y axis. + + + +

Notes + +
You need to have an origin brush as part of this entity. The +center of that brush will be the point through which the rotation +axis passes. Setting the origin key is simply an alternate method +to using an origin brush. It will rotate along the Z axis by +default. You can check either the X_AXIS or Y_AXIS box to change +that + + + +

func_static
+ +Map Entity Color: N/A + +
Dimensions: Determined by components + +
Game Function: Static solid bspmodel. Can be used for +conditional walls and models for different game types. + + + +

Keys + +
model2: path/name of model to include (eg: +models/mapobjects/bitch/fembotbig.md3). + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
When using the model2 key, the origin point of the model will +correspond to the origin point defined by either the origin brush +or the origin coordinate value. Because the map has only a single +bot navigation file, Func_Statics cannot be used to make +significant changes in game play flow between differing game +types. + + + +

func_timer
+ +Map Entity Color: Dark blue (0.3 0.1 0.6) + +
Dimensions: (-8 -8 -8) (8 8 +8) + +
Game Function: Time delay trigger that will continuously +fire its targets after a preset time delay. The time delay can also +be randomized. When triggered, the timer will toggle on/off. + + + +

Keys + +
wait: delay in seconds between each triggering of its +targets (default 1). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
target: this points to the entities to trigger. + +
targetname: a func_button or trigger that points to this +will toggle the timer on/off when activated. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
START_ON: timer will start on in the game and +continuously fire its targets. + + + +

Notes + +
When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + + + +

func_train
+ +Map Entity Color: (0 .5 .8) + +
Dimensions: Determined by +components + +
Game Function: Trains are moving solids that follow a +string of path_corner entities. Trains in Q3A are very basic, they +also require an origin brush (see Notes). + + + +

Keys + +
speed: speed of displacement of train (default 100 or +overridden by speed value of path). + +
target: this points to the first path_corner of the path +which is also the spawn location of the train's origin. + +
model2: path/name of model to include (eg: +models/mapobjects/pipe/pipe02.md3). + +
origin: alternate method of setting XYZ origin of the +train's brush(es) and .md3 model included with entity (See +Notes). + +
light: constantLight radius of .md3 model included with +entity. Has no effect on the entity's brushes (default 0). + +
color: constantLight color of .md3 model included with +entity. Has no effect on the entity's brushes (default 1 1 1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
1. Trains always start on in the game. + +
2. Trains do not damage the player when blocked. + +
3. Trains cannot emit sound. + +
4. Trains are not triggerable or toggle-able. + +
5. Trains cannot be block-stopped just by getting in their way, +the player must be wedged between the train and another obstacle to +block it. + + + +

Setting the origin key is simply an alternate method to using an +origin brush. When using the model2 key, the origin point of the +model will correspond to the origin point defined by either the +origin brush or the origin coordinate value. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_3.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_3.htm new file mode 100644 index 00000000..b9ff8fff --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_3.htm @@ -0,0 +1,150 @@ + + +Q3Radiant Editor Manual: Appendix B3 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Holdable_* Entities

+ +

holdable_medkit
+ +Map Entity Color: blue (.7 0 1) + +
Dimensions:  (-16 -16 -16) (16 16 16) + +
Game Function:  This is a Medkit that can be picked +up and used (once) later. Brings the player's health back to 100 +when used. Player can only carry one holdable item at a time. + + + +

Keys + +
wait: time in seconds before item respawns after being +picked up (default 60, -1 = never respawn). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
team: set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + +
target: picking up the item will trigger the entity this +points to. + +
targetname: a target_give entity can point to this for +respawn freebies. + +
notbot: when set to 1, a bot will never seek out this +item + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
SUSPENDED: item will spawn where it was placed in map and +won't drop to the floor.  Bots will only be attracted to +suspended entities if they are reachable by way of a jump pad or +launch pad (trigger_push). + + + +

Notes + +
The amount of time it takes for an item in the team to respawn +is determined by the "wait" value of the item that was picked up +previously. So if one of the items in the team has it's "wait" key +set to -1 (never respawn), the random respawning cycle of the +teamed items will stop after that item is picked up. + + + +

When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random).*/ + + + +

holdable_teleporter
+ +Map Entity Color: blue (.7 0 1) + +
  Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Teleporter item that can be picked up and +used (once) later. Teleports the player to a random player spawn +point when used. Player can only carry one holdable item at a +time. + + + +

Keys + +
wait: time in seconds before item respawns after being +picked up (default 60, -1 = never respawn). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
team: set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + +
target: picking up the item will trigger the entity this +points to. + +
targetname: a target_give entity can point to this for +respawn freebies. + +
notbot: when set to 1, a bot will never seek out this +item + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
SUSPENDED: item will spawn where it was placed in map and won't +drop to the floor. Bots will only be attracted to suspended +entities if they are reachable by way of a jump pad or launch pad +(trigger_push). + + + +

Notes + +
The amount of time it takes for an item in the team to respawn +is determined by the "wait" value of the item that was picked up +previously. So if one of the items in the team has its "wait" key +set to -1 (never respawn), the random respawning cycle of the +teamed items will stop after that item is picked up. + + + +

When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_4.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_4.htm new file mode 100644 index 00000000..7d60e126 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_4.htm @@ -0,0 +1,209 @@ + + +Q3Radiant Editor Manual: Appendix B4 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Info_* Entities

+ +

info_camp
+ +Map Entity Color: Dark green (0 0.5 0) + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This atttracts bots which have a camping +preference in their A.I. characteristics. It should be placed at +least 32 units away from any brush surface. + + + +

Keys +
range: number of units that the bot can move away from +camp entity while camping on it. + +
weight: number that is compared against the weight +assigned to all the other camp spots in the map to determine if a +bot chooses to camp there. The value is normalized against all +other weight values. + + + +

Notes + +
Examples of Q3A bots which have a high camping preference are: +Razor, Tank Jr., Grunt, Patriot and Doom. Examples of Q3A bots +which have a low camping preference are: Klesk, Mynx, Sarge, Keel +and Xaero. Info_Camp entities should be reachable by "normal" +means, including relatively non-complex rocket jumps. + +

info_notnull
+ +Map Entity Color: Dark green (0 0.5 0) + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Used as a positional target for entities +that can use directional pointing. A target_position can be used +instead of this but was kept in Q3A for legacy purposes. + + + +

Keys + +
targetname: must match the target key of entity that uses +this for pointing. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

info_null
+ +Map Entity Color: Dark green (0 0.5 0) + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Used as a positional target for light +entities to create a spotlight effect. A target_position can be +used instead of this but was kept in Q3A for legacy purposes. + + + +

Keys + +
targetname: must match the target key of entity that uses +this for pointing. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode).*/ + + + +

info_player_deathmatch
+ +Map Entity Color: Pink (1 0 0) + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Normal player spawning location for Q3A +levels. + + + +

Keys + +
angle: direction in which player will look when spawning +in the game. Does not apply to bots. + +
target: this can point at a target_give entity for +respawn freebies. + +
nobots: when set to 1, bots will never use this spawn +point to respawn in the game. + +
nohumans: when set to 1, human players will never use +this spawn point to respawn in the game. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
INITIAL: makes the spawnpoint the initial place for the player +to spawn at the beginning of the game. This is also where the +player spawns as a spectator. + + + +

Design Tip: If you include an +info_player_deathmatch entity in a CTF map, players from both teams +can respawn at that location. Great for placing respawn spots in +contested central battleground areas.
+ +

info_player_intermission
+ +Map Entity Color: Pink (1 0 1) + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Camera for intermission screen between +matches. This also automatically generates the podium for bot arena +matches (see Notes). Can be aimed by setting the "angles" key or +targeting an pointing to an aiming entity. Use only one per +level. + + + +

Keys + +
angles: alternate "pitch, yaw, roll" angles method of +aiming intermission camera (default 0 0 0). + +
target: point this to an info_notnull or target_position +entity to set the camera's pointing angles. + + + +

Notes + +
In Single Player bot arena matches, the podium for the 1st, 2nd +and 3rd place players at the end of the match is generated by this +entity. The podium's origin will automatically be located 128 units +in the direction of the camera's view and 84 units down from the y +height of the view line at that point. It will also always be +generated on a level plane regardless of the pointing angle of the +camera so if that angle is too steep, part of the podium model +might not be visible. If the origin point of the podium model is +inside brush geometry, the podium will not draw. Make sure you +leave at least 106 units of free space in front of where the camera +points to otherwise the podium model won't be visible at all. + + + +

info_player_start
+ +Map Entity Color: Red (1 0 0) + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Player spawn location. It works in Quake +III Arena, but is not used in the id maps. Use +info_player_deathmatch instead. + + + +

Keys + +
angle: direction in which player will look when spawning +in the game. + +
target: this can point at a target_give entity for +respawn freebies. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_5.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_5.htm new file mode 100644 index 00000000..29bd4fb6 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_5.htm @@ -0,0 +1,487 @@ + + +Q3Radiant Editor Manual: Appendix B5 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Item_* Entities

+ +Most of the properties for item entities are the same and are +listed immediately below. Properties that are unique to specific +entities follow those entries. + + + +

Shared Keys (for all item entities) + +
All the entities in this grouping can have the following +keys. + +

team: set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + +
target: picking up the item will trigger the entity this +points to. + +
targetname: a target_give entity can point to this for +respawn freebies. + +
notbot: when set to 1, a bot will never seek out this +item. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Two other keys, wait and count, do not apply to all entities and +are described as they apply to individual entity types. + + + +

Check Boxes/Spawnflags + +
SUSPENDED: item will spawn where it was placed in map and won't +drop to the floor. Bots will only be attracted to suspended +entities if they are reachable by way of a jump pad or launch pad +(trigger_push). + + + +

Notes + +
Team: Just as you would set doors to work together with +the "team" key, you can do the same for item, weapon and ammo +entities. Give each entity in the team the same key value (example: +"team" "powerups"). The game randomly selects which team member +respawns next. You can set your own wait times. You can skew the +weighting towards a particular item by including multiple copies of +it. Example: 1 quad and 2 hastes in a team mean a greater chance +that a haste entity will appear next. + +

The amount of time it takes for an item in the team to respawn +is determined by the "wait" value of the item that was picked up +previously. So if one of the items in the team has it's "wait" key +set to -1 (never respawn), the random respawning cycle of the +teamed items will stop after that item is picked up. + + + +

When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + + + +

item_armor_body
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Red Armor - 100 points of protection. All +armor can be cumulated up to a maximum of 200 points and slowly +decays back to 100 points. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 25, -1 = never respawn). + + + +

item_armor_combat
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Yellow Armor - 50 points of protectiong. +All armor can be cumulated up to a maximum of 200 points and slowly +decays back to 100 points. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 25, -1 = never respawn). + +

item_armor_shard
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Green Armor Shard - 5 points of +protection. All armor can be cumulated up to a maximum of 200 +points and slowly decays back to 100 points. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 25, -1 = never respawn). + + + +

Item_botroam
+ +Map Entity Color: orange + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: An invisible entity that attracts a bot to +it. Used to move bots to parts of a map that might otherwise not be +used. + + + +

Custom Keys + +
Weight: non-zero floating point value, most often in the +range 0 to 400. Very low values are unlikely to attract a bot to +that area, since most bots have "desires" that attract them to +other game entities. (Higher values are allowed but keep in mind +that the bot should also be attracted to normal items. Don't +make the weight value too high. + + + +

Notes + +
The item_botroam entity can be used when a bot does not roam the +whole level or prefers to go to only specific areas. But don't +confuse these items with "way points". They are more like magnets. +This (invisible) item can be placed in a map just like regular +items. Nobody can actually pick up the item it's only used to +attract bots to certain places of the map. The value is the weight +of the roam_item is relative to the weight assigned other items in +the map (each bot has its own weights). The bot character specific +item weights are stored with the bot characters in the +botfiles/bots/ sub-folder in the .pk3 file. + +

When a bot should never go for a specific item the key "notbot" +with value "1" can be used for that item. This key with value can +be used for every available item in Quake III Arena. + +

Design Tip: Wait to place these items until you've done a +significant amount of live play testing on the final map against +bots. Observe a bot-only match. See which parts of the map they +DON'T use frequently. Use bot_roam entities to encourage the +bots to follow more paths through the map. Example: In one of id's +CTF maps, it was eventually observed that bots were most likely to +use only one entrance when assaulting the base. Placement of +item_botroam entities along the other entrance paths might have +solved this.
+ + + +

item_enviro
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Battle Suit power-up. Lasts 30 seconds. +Battle suit provides full protection against explosion radius +damage, slime, and lava damage. It gives partial protection against +falling, and direct rocket hits. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds that power-up will last when +picked up (default 30). + + + +

item_flight
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Flight power-up. Lasts 60 seconds. Will +not appear in single player games. Bots do not understand its +use. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds power-up will last when picked up +(default 60). + + + +

item_haste
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Speed power-up. Makes player run at double +speed for 30 seconds. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds power-up will last when picked up +(default 30). + + + +

item_health
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Yellow cross bubble - 25 Health. Cannot be +picked up over 100 health. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 35, -1 = never respawn). + +
count: sets the amount of health points given to the +player when item is picked up (default 25). + + + +

item_health_large
+Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Gold cross bubble - 50 Health. Cannot be +picked up over 100 health. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 35, -1 = never respawn). + +
count: sets the amount of health points given to the +player when item is picked up (default 50). + + + +

item_health_mega
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Blue M bubble - 100 Health. Adds 100 +health points to current health up to a maximum of 200. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 40, -1 = never respawn). + +
count: sets the amount of health points given to the +player when item is picked up (default 100). + + + +

item_health_small
+ +
Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Green cross bubble - 5 Health. Can be +picked up to give over 100 health but slowly decays back to +100. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 35, -1 = never respawn). + +
count: sets the amount of health points given to the +player when item is picked up (default 5). + +

item_invis
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Invisibility power-up. Lasts 30 +seconds. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds power-up will last when picked up +(default 30). + +
team : set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + + + +

item_quad
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Quad Damage power-up (3 times damage). +Lasts 30 seconds. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds power-up will last when picked up +(default 30). + + + +

item_regen
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Health Regeneration power-up. This will +boost your current health by 5 points every second up to a maximum +of 200. The boost continues for a period of 30 seconds. Aftewards, +any health points over 100 slowly decay back to 100. + + + +

Custom Keys + +
wait: time in seconds before item respawns after being +picked up (default 120, -1 = never respawn). + +
count: time in seconds power-up will last when picked up +(default 30). + +

Light Entity

+ +

light
+ +Map Entity Color: bright green  (see Notes) + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Non-displayed light entity. The default +condition emits white light in all directions at a value of 300. +The apparent brightness of the light is modeled on "real world" +physics, so the falloff in brightness willl be an inverse square of +distance from the source. It can be colored. It can be targeted on +an info_null entity to make a spotlight. + + + +

Keys + +
light: value of light intensity (default 300). + +
_color: weighted RGB value of light color (default white +- 1 1 1). + +
target: point this to an target_position, info_null or +info_notnull to create a spotlight effect. + +
radius: sets radius of light cone for spotlights (default +64) in game units. Radius measurement is made at the targeted +entity. Light must target an info_null entity (info_nulls are only +used by the compiler and need not be "remembered" by the game +engine during play). + + + +

Check Boxes/Spawnflags + +
LINEAR: light falloff will be linear instead of inverse square +of distance from source. + + + +

Notes + +

  • Linear fall off will not make much difference on low value +lights. Useful on high value lights where the light travels long +distances. + +
  • If the "Light drawing" preference is selected (under +Preferences), the editor shows the light entities as diamond shaped +pieces the color of the light they cast. If not, they are light +yellow green cubes.
+ + +

Coloring Lights + +
To quickly change the color of a light entity, use on of the +following methods. + +

  1. CTRL + k:  With the entity +window open, select a light entity in either the map or camera +window. Press CTRL + k. This brings up the windows color selector. +Select a color and choose "OK".  The editor automatically +normalizes the light colors. + +
  2. Sample Texture: Select the light +entity. Select a texture in either the texture window or the camera +window.  Hit SHIFT + middle mouse button. + +
  3. Manual Entry: Type in the value +for the key _color as a 3 numbers between 0 and 1 (inclusive). + +
  4. Copy Existing: Select another +light entity whose color value the user would like to duplicate. In +the editor window, lef click on the key "_color". Now select the +light entity to be colored. Hit ENTER.
+ + +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_6.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_6.htm new file mode 100644 index 00000000..e1dfcb06 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_6.htm @@ -0,0 +1,332 @@ + + +Q3Radiant Editor Manual: Appendix B6 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Misc_* Entities

+
misc_model
+ +Map Entity Color: red + +
Dimensions: (-16 -16 -16) (16 16 16) + +
Game Function: Generic, one-size-fits-all placeholder for +inserting .md3 models in game. Requires compilation of map geometry +to be added to level. + +

Keys + +
angle: direction in which model will be oriented. + +
model : path/name of model to use (eg: +models/mapobjects/teleporter/teleporter.md3).*/ + + + +

Notes + +
This is a premade mesh model, created in a program like +Kinetix's 3d Studio Max. It is a static (non-animating) +model.  Shaders can give it the appearance of motion, but no +animation.  The models should be stored in a directory with +the pathname: models/mapobjects. The process by which models are +made is not a part of this document. Currently, models only have +rotation on the Z axis. + +

Models do not "clip" against players or weapon +hits. They are entirely non-solid. If clipping is important, The +user will need to build clip brushes that are roughly the size and +shape of the models. + +

Do not use the flip or rotate tools on models. Only use the +entity facing buttons or manually change the angle value. The +purple "3d crosshair" is the origin point of the model. + +

Make it: Right mouse press on a map window to bring up +the floating entity selector.  Select misc_model. A selection +dialogue box will open giving access to available .md3 files.  +Select the one you want and it will load into the map.  Now, +hit "n" to open the entity window. Click on the "model" key in the +key list box. Now edit the value field to remove part of the +line. + +

Example: "c://program files/quake III +arena/baseq3/models/mapobjects/storch.md3" + +

… should be edited to read: + +

"models/mapobjects/storch.md3" + + + +

misc_portal_camera
+ +Map Entity Color: light orange + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Portal camera. This camera is used to +project its view onto a portal surface in the level through the +intermediary of a misc_portal_surface entity. Use the "angles" key +or target a target_position or info_notnull entity to set the +camera's pointing direction. + + + +

Keys + +
angles: this sets the pitch and yaw aiming angles of the +portal camera (default 0 0). Use "roll" key to set roll angle. + +
target: point this to a target_position entity to set the +camera's pointing direction. + +
targetname: a misc_portal_surface portal surface +indicator must point to this. + +
roll: roll angle of camera. A value of 0 is upside down +and 180 is the same as the player's view. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
SLOWROTATE : makes the portal camera rotate slowly along the +axis of camera to target or (selected direction). + +
FASTROTATE : makes the portal camera rotate faster along the +axis of camera to target or (selected direction).. + + + +

Notes +

  • Both the setting "angles" key or "targeting a target_position" +methods can be used to aim the camera. However, the target_position +method is simpler. In both cases, the "roll" key must be used to +set the roll angle. Generally, this is adjusted after compiling the +map at least once. + +
  • If either the SLOWROTATE or FASTROTATE spawnflag is set, then +the "roll" value is irrelevant.
+ + + +

misc_portal_surface
+ +Map Entity Color: light orange + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Portal surface indicator. This will "lock +on" the brush face closest to it and identify as a portal. The view +displayed on the portal surface is the view of the +misc_portal_camera that this entity targets. Also used for mirrors +(see Notes). + + + +

Keys + +
target: point this to a misc_portal_camera that "sees" +the view you want to display on the portal. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • The entity must be no farther than 64 units away from the portal +surface to lock onto it. + +
  • To make a mirror, apply the common/mirror shader to the surface, +place this entity near it but don't target a +misc_portal_camera. + +
  • When used as a mirror, the mirror surface will display what the +entity can "see."
+ + + +

misc_teleporter_dest
+ +Map Entity Color: red + +
Dimensions: (-32 -32 -24) (32 32 -16) + +
Game Function: Teleport destination location point for +trigger_teleporter entities. A "target_position" can also be used +for this. + + + +

Keys + +
angle: direction in which player will look when +teleported. + +
targetname: make the trigger_teleporter point to +this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
In most cases, this is replaced by the "target_position" +entity. + +

Path_* Entities

+ +

path_corner
+ +Map Entity Color: brown + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Path corner entity that define the routes +that func_trains can be made to follow. + + + +

Keys + +
target: point to next path_corner in the path. + +
targetname: the train following the path or the previous +path_corner in the path points to this. + +
speed: speed of func_train (in game units per second) +while moving to the next path corner. This will override the speed +value of the train. + +
wait: number of seconds func_train will pause on path +corner before moving to next path corner (default 0 - see +Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • Setting the wait key to -1 will not make the train stop on the +path corner, it will simply default to 0. + +
  • The center of the origin brush in the func_train follows the +path.
+ + + +

Shooter_* Entities

+ +
shooter_grenade
+ +Map Entity Color: red-violet + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This will shoot a grenade each time it's +triggered. Aiming is done by setting the "angles" key or by +targeting an info_notnull or target_position entity. + + + +

shooter_plasma
+ +Map Entity Color: red-violet + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This will shoot a plasma ball each time +it's triggered. Aiming is done by setting the "angles" key or by +targeting an info_notnull or target_position entity. + + + +

shooter_rocket
+ +Map Entity Color: red-violet + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This will shoot a rocket each time it's +triggered. Aiming is done by setting the "angles" key or by +targeting an info_notnull or target_position entity. + + + +

Keys + +
angles: this sets the pitch and yaw aiming angles of +shooter (default 0 0). The roll angle does not apply. + +
targetname: activating trigger points to this. + +
target: this points to a target_position entity for +aiming the grenades. + +
random: random aiming variance in degrees from the +straight line to the targeted entity (default 0 - see Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in "Teamplay" and +"CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single Player +mode (bot play mode). + + + +

Notes + +

  • When the random key is set, its value is used to calculate a +maximum angle deviation from the normal trajectory formed by a +straight line between the shooter and the aiming entity it targets. +The final trajectory will be a random value anywhere between no +deviation at all (0) to maximum deviation (value of the random +key). + +
  • Both the setting "angles" key or "targeting a target_position" +methods can be used to aim the shooter. However, the +target_position method is simpler.*/
+

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_7.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_7.htm new file mode 100644 index 00000000..55d28b31 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_7.htm @@ -0,0 +1,637 @@ + + +Q3Radiant Editor Manual: Appendix B7 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Target_* Entities

+ + + +
target_delay
+ +Map Entity Color: aqua + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: The target_delay trigger is an +intermediary time delay trigger. Like a target_relay (see below), +this can only be fired by other triggers which will, in turn, cause +it to fire its own targets + + + +

Keys + +
targetname: activating trigger points to this. + +
target: this points to entities to activate when this +entity is triggered. + +
wait: delay in seconds from when this gets triggered to +when it fires its own targets (default approx. 1). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + + + +

target_give
+ +Map Entity Color: red + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This is used to give ammo, weapons, health +or items to the player who activates it. + + + +

Keys + +
target: this points to the item(s) to give when +activated. + +
targetname: activating trigger or spawn entity points to +this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • There are 2 ways to use this entity. + +
    1. To automatically give items to players when they spawn +in the game: make a spawn location entity like +info_player_deathmatch or CTF respawn points target this entity, +then make it target the item(s) to give to the player upon +respawn. + +
    2. To give items to players during the game: make a +trigger_multiple target this entity, then make it target the +item(s) to give to the player when the trigger is touched. This is +how the column of health and armor in Q3DM10 works.
    + +
  • Items targeted to be given are not seen in the map.
+ + + +

target_kill
+ +Map Entity Color: gray + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This will kill the player who activates +the trigger that fires this target. + + + +

Keys + +
targetname: the activating trigger points to this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode).*/ + + + +

target_laser
+ +
Map Entity Color: red + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Generates a red laser beam. I think this +can somehow spawn in the game, I saw it once but it's too +inconsistent to be usable. Commented out. + + + +

Keys + +
angles: alternate "pitch, yaw, roll" angles method of +aiming laser (default 0 0 0). + +
target: point this to a target_position entity to set the +laser's aiming direction. + +
targetname: the activating trigger points to this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
START_ON: when set, the laser will start on in the game. + + + +

Notes + +
Since none of the game maps in Quake III Arena used this +function, it is not likely to be a functioning entity. + + + +

target_location
+ +Map Entity Color: Dark Green + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Location marker used by bots and players +for team orders and team chat in the course of Teamplay games. The +closest target_location in sight is used for the location. If none +is in sight, the closest in distance is used. + + + +

Keys + +
Message: name of the location (text string). +Displayed in parentheses in front of all team chat and order +messages. Shorter is better. + +
count: color of the location text displayed in +parentheses during team chat. Set to 0-7 for color. + +

    0 : white (default) + +
    1 : red + +
    2 : green + +
    3 : yellow + +
    4 : blue + +
    5 : cyan + +
    6 : magenta + +
    7 : white
+ +notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Design Tips: The target locations are "line-of-sight." If +a player can "see" it, and that target is the closest to the +player, then that location message is displayed. Be +conservative in placing location markers. Because of the way the +location code is implemented, it causes a large amount of data to +be transmitted regularly. It has been explained that the game +serrver has to constantly keep track of, and update to the clients, +a data table equal to all the location markers multiplied by all +the players. Not only that, but it must calculate line of sight +from players to location markers and calculate the distance from +the location marker. + +
   Place the target locations in such a way that the entity can be +"seen" from most, if not all, the positions that a player can stand +in when it is inside that area. Fewer are better, even if it +means that occasionally, a team mate is in an unknown location.
+ +

target_position
+ +Map Entity Color: Dark Green + +
Dimensions: (-4 -4 -4) (4 4 4) + +
Game Function: This is an aiming target for entities like +light, misc_portal_camera, and trigger_push (jump pads and launch +pads) in particular. + + + +

Keys + +
Targetname: the entity that requires an aiming direction +points to this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
Use this as the target for any entity that must be actively +targeted during the game (do not use it as a target for +spotlights). + +
See Tips, Tricks and Tutorials for the method used to make jump +pads. + + + +

target_print
+ +
Map Entity Color: dark green + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This will print a message on the center of +the screen when triggered. By default, all the clients will see the +message. + + + +

Keys + +
message: text string to print on screen. + +
targetname: the activating trigger points to this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
REDTEAM : only the red team players will see the message. + +
BLUETEAM : only the blue team players will see the message. + +
PRIVATE : only the player that activates the target will see the +message. + + + +

target_push
+ +Map Entity Color: gray + +
Dimensions: (-8 -8 -8) (8 8 8) + + + + + +
Game Function: This is not recommended for creating jump +pads and launch ramps. The direction of push can be set by the +"angles" key or pointing to a target_position or info_notnull +entity. Unlike trigger_push, this is NOT client side predicted and +must be activated by a trigger. + + + +

Keys + +
angles: this sets the pitch and yaw aiming angles of push +entity (default 0 0). The roll angle does not apply. + +
speed: speed of push (default 1000 game units per +second). Has no effect if entity targets an aiming entity. + +
targetname: the activating trigger points to this. Push +originates from the location of the trigger. + +
target: this points to the aiming entity to which the +player will jump. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
BOUNCEPAD : if set, trigger will play bounce noise instead of +beep noise when activated (see notes). + + + +

Notes + +

  • The player will first move from the trigger to the target_push +and then on towards the target_position. + +
  • To make a jump pad or launch ramp, create a trigger_multiple +where the jump must originate. Place the target_push directly above +the trigger_multiple and place the target_position entity at the +highest point of the jump. Target the trigger_multiple to the +target_push and target the target_push to the +target_position/info_notnull (or set the target_push's "angles" +key). + +
  • Note that the "angle" key also +works. + +
  • A target_push can be used to make a wind tunnel push effect (as +opposed to the jump pad effect of a trigger_push). It pushes the +activator in the direction of the angle value or towards its apex, +a targeted target_position entity. + +
  • The default speed is 1000. + +
  • If bouncepad is checked, it will play the bouncepad sound +instead of windfly.
+ + +

Design Tip: + +
There is a way to make the target push play proper sounds. Just +create a sound\movers\plats folder under baseq3 and put a sounds +windfly.wav in it. It can be the sound from the Q2 or your own +custom looping if you're up to it.
+ +

target_relay
+ +Map Entity Color: aqua + +
Map Entity Color: (-8 -8 -8) (8 8 8) + +
Game Function: This can only be activated by other +triggers, which will, in turn, cause it to activate its own +targets. + + + +

Keys + +
targetname: activating trigger points to this. + +
target: this points to entities to activate when this +entity is triggered. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
RED_ONLY : only red team players can activate trigger. + +
BLUE_ONLY : only red team players can activate trigger. + +
RANDOM: one of the targeted entities will be triggered at +random. + + + +

Notes + +
Use this when you need to split off targeting functions along +separate paths. + + + +

target_remove_powerups
+ +
Map Entity Color: blue + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This takes away all item_* type powerups +from player except health and armor (holdable_* items are not taken +away either). This must be activated by a button or +trigger_multiple entity. The player that activates the trigger will +lose any powerup(s) currently in his possession. + + + +

Keys + +
targetname: activating trigger points to this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode).*/ + + + +

target_score
+ +Map Entity Color: bright green + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: This is used to automatically give frag +points to the player who activates this. A spawn location entity +like info_player_* or CTF respawn points can target this entity to +give points to the player when he spawns in the game. Or a trigger +can also be used to activate this. The activator of the trigger +will get the points. + + + +

Keys + +
targetname: activating entity points to this. + +
count: number of frag points to give to player (default +1). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode).*/ + + + +

target_speaker
+ +
Map Entity Color: bright green + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Sound generating entity that plays .wav +files. Normal non-looping sounds play each time the target_speaker +is triggered. Looping sounds can be set to play by themselves (no +activating trigger) or be toggled on/off by a trigger. + + + +

Keys + +
noise: path/name of .wav file to play (eg. +sound/world/growl1.wav - see Notes). + +
wait: delay in seconds between each time the sound is +played ("random" key must be set - see Notes). + +
Random: random time variance in seconds added or +subtracted from "wait" delay ("wait" key must be set - see +Notes). + +
targetname: the activating button or trigger points to +this. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
LOOPED_ON: sound will loop and initially start on in level (will +toggle on/off when triggered). + +
LOOPED_OFF: sound will loop and initially start off in level +(will toggle on/off when triggered). + +
GLOBAL: sound will play full volume throughout the level. + +
ACTIVATOR: sound will play only for the player that activated +the target. + + + +

Notes + +

  • The path portion value of the "noise" key can be replaced by the +implicit folder character "*" for triggered sounds that belong to a +particular player model. For example, if you want to create a +"bottomless pit" in which the player screams and dies when he falls +into, you would place a trigger_multiple over the floor of the pit +and target a target_speaker with it. Then, you would set the +"noise" key to "*falling1.wav". The * character means the current +player model's sound folder. So if your current player model is +Visor, * = sound/player/visor, if your current player model is +Sarge, * = sound/player/sarge, etc. This cool feature provides an +excellent way to create "player-specific" triggered sounds in your +levels. + +
  • The combination of the "wait" and "random" keys can be used to +play non-looping sounds without requiring an activating trigger but +both keys must be used together. The value of the "random" key is +used to calculate a minimum and a maximum delay. The final time +delay will be a random value anywhere between the minimum and +maximum values: (min delay = wait - random) (max delay = wait + +random).
+ + + +

target_teleporter
+ +Map Entity Color: red + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Activating this will teleport players to +the location of the targeted misc_teleporter_dest entity +(target_position can also be used). Unlike trigger_teleport, this +entity must be activated by a trigger and does NOT allow client +prediction of events. + + + +

Keys + +
targetname: activating trigger points to this. + +
target: this must point to a misc_teleporter_dest +entity. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
When you give multiple targets the same target name, the +teleporter will randomly select from one each time it is used. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_8.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_8.htm new file mode 100644 index 00000000..ec4d957a --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_8.htm @@ -0,0 +1,352 @@ + + +Q3Radiant Editor Manual: Appendix B8 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Team_* Entities

+ +These entities only function when a team style game is being +played. Most are for Capture the Flag. They do not need to be +marked with notfree, since that is part of their nature. + + + +

team_CTF_blueflag
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Blue team flag for CTF games. + + + +

Notes + +
This cannot be suspended (or the bots won't find it). It must be +reachable by players of both teams, since it is where a player must +return an opponent's flag. + + + +

team_CTF_blueplayer
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Initial Blue team spawning position for +CTF games. This is where players spawn when they join the Blue team +(at the start of a game or upon entering a game in progress). + + + +

Keys + +
target: this can point at a target_give entity for +respawn freebies. + + + +

team_CTF_bluespawn
+ +Map Entity Color: blue + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Blue team respawning position for CTF +games. This is where Blue team players respawn after they get +fragged. + + + +

Keys + +
target: this can point at a target_give entity for +respawn freebies. + + + +

team_CTF_redflag
+ +Map Entity Color: red + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Blue team flag for CTF games. + + + +

Notes + +
This cannot be suspended (or the bots won't find it). It must be +reachable by players of both teams, since it is where a player must +return an opponent's flag. + + + +

team_CTF_redplayer
+ +Map Entity Color: red + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Initial Red team spawning position for CTF +games. This is where players spawn when they join the red team (at +the start of a game or upon entering a game in progress). + + + +

Keys + +
target: this can point at a target_give entity for +respawn freebies. + + + +

team_CTF_redspawn
+ +Map Entity Color: red + +
Dimensions: (-16 -16 -24) (16 16 32) + +
Game Function: Red team respawning position for CTF +games. This is where red team players respawn after they get +fragged. + + + +

Keys + +
target: this can point at a target_give entity for +respawn freebies. + + + +

Trigger_* Entities

+ +
trigger_always
+ +Map Entity Color: gray + +
Dimensions: (-8 -8 -8) (8 8 8) + +
Game Function: Automatic trigger. It will fire the +entities it targets as soon as it spawns in the game. + + + +

Keys + +
target: this points to the entity to activate. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +
For reliable internet play, make any trigger which can be passed +through at least 32 game units deep. + + + +

trigger_hurt
+ +Map Entity Color: gray + +
Dimensions: size of brush used + +
Game Function: Any player that touches this will be hurt +by "dmg" points of damage once per server frame (very fast). A +sizzling sound is also played while the player is being hurt. + + + +

Keys + +
dmg: number of points of damage inflicted to player per +server frame (default 5 - integer values only). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + +

Check Boxes/Spawnflags + +
START_OFF: if set, the trigger will initially start off in the +game. + +
SILENT: supresses the sizzling sound while player is being +hurt. + +
NO_PROTECTION: player will be hurt regardless of protection (see +Notes). + +
SLOW: changes the damage rate to once per second. + + + +

Notes + +

  • The invulnerability power-up (item_enviro) does not protect the +player from damage caused by this entity regardless of whether the +NO_PROTECTION spawnflag is set or not. + +
  • A trigger_hurt always starts on in the game. + +
  • For reliable Internet play, make any trigger which can be passed +through at least 32 game units deep. +
+ + +

trigger_multiple
+ +Map Entity Color: gray + +
Dimensions: size of brush used + +
Game Function: Variable size repeatable trigger. It will +fire the entities it targets when touched by player. Can be made to +operate like a trigger_once entity by setting the "wait" key to -1. +It can also be activated by another trigger that targets it. + + + +

Keys + +
target: this points to the entity to activate. + +
targetname: activating trigger points to this. + +
wait: time in seconds until trigger becomes +re-triggerable after it's been touched (default 0.2, -1 = trigger +once). + +
random: random time variance in seconds added or subtracted from +"wait" delay (default 0 - see Notes). + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + +
  • For reliable Internet play, make any trigger which can be passed +through at least 32 game units deep. +
+ + +

trigger_push
+ +Map Entity Color: gray + +
Dimensions: size of brush used + +
Game Function: This is used to create jump pads and +launch ramps. It MUST point to a target_position or info_notnull +entity to work. Unlike target_push, this is client side +predicted. + + + +

Keys + +
target: this points to the target_position to which the +player will jump. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • To make a jump pad or launch ramp, place the +target_position/info_notnull entity at the highest point of the +jump and target it with this entity. + +
  • This trigger automatically makes the bouncepad sound. + +
  • Speed of travel is determined by the distance needed to reach +the target entity. Longer = faster. + +
  • For reliable Internet play, make any trigger which can be passed +through at least 32 game units deep. +
+ + +

trigger_teleport
+ +Map Entity Color: gray + +
Dimensions: size of brush used + +
Game Function: Touching this will teleport players to the +location of the targeted misc_teleporter_dest or target_position +entities. This entity allows client prediction of events. It is the +preferred method. + + + +

Keys + +
target: this must point to a misc_teleporter_dest entity +or a target_position entity. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Notes + +

  • For reliable Internet play, make any trigger which can be passed +through at least 32 game units deep. + +
  • When you give multiple targets the same target name, the +teleporter will randomly select from one each time it is used. +
+

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_b_9.htm b/docs/manual/Q3Rad_Manual/appndx/appn_b_9.htm new file mode 100644 index 00000000..5a723bfd --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_b_9.htm @@ -0,0 +1,224 @@ + + +Q3Radiant Editor Manual: Appendix B9 + + + +

Q3Radiant Editor Manual

+
+

Appendix B: Entity Descriptions

+

Weapon Entities

+ +

weapon_bfg
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Big Freaking Gun. Default ammo load +is 20. + + + +

weapon_gauntlet
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Melee weapon. No ammo. There is no +reason to place this entity in a map. + + + +

weapon_ grapplinghook
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Grappling Hook. Spawns in the game and +works but is unskinned. Does not use ammo. + + + +

weapon_grenadelauncher
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Lobs bouncing grenades. Comes with 10 +grenades. + + + +

weapon_lightning
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Also called the "shaft" by some. Comes +with 100 "shocks" + + + +

weapon_machinegun
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Player automatically starts with this. +Comes with a default load of 100 "shots." + +

Design Tip: For a "Rocket Arena" type game, the designer +may wish to use the target_give entity to "give" the player an +ammo_bullets entity with a count of -100 to remove the +machinegun from play.
+ + + +

weapon_plasmagun
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Comes with 50 shots. + + + +

weapon_railgun
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Comes with 10 slugs. + + + +

weapon_rocketlauncher
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Comes with 10 rockets. + + + +

weapon_shotgun
+ +Map Entity Color: blue + +
Dimensions: 32x32 + +
Game Function: Also called the "shaft" by some. Comes +with 10 rockets. + + + +

Keys + +
wait: time in seconds before item respawns after being +picked up (default 5, -1 = never respawn). + +
random: random time variance in seconds added or +subtracted from "wait" delay (default 0 - see Notes). + +
count: sets the amount of ammo given to the player when +weapon is picked up. + +
team: set this to team items. Teamed items will respawn +randomly after team master is picked up (see Notes). + +
target: picking up the item will trigger the entity this +points to. + +
targetname: a target_give entity can point to this for +respawn freebies. + +
notfree: when set to 1, entity will not spawn in "Free +for all" and "Tournament" modes. + +
notteam: when set to 1, entity will not spawn in +"Teamplay" and "CTF" modes. + +
notsingle: when set to 1, entity will not spawn in Single +Player mode (bot play mode). + + + +

Check Boxes/Spawnflags + +
SUSPENDED : item will spawn where it was placed in map and won't +drop to the floor. Bots will only be attracted to suspended +entities if they are reachable by way of a jump pad or launch pad +(trigger_push). + + + +

Notes + +
The amount of time it takes for an item in the team to respawn +is determined by the "wait" value of the item that was picked up +previously. So if one of the items in the team has it's "wait" key +set to -1 (never respawn), the random respawning cycle of the +teamed items will stop after that item is picked up. + + + +

When the random key is set, its value is used to calculate a +minimum and a maximum delay. The final time delay will be a random +value anywhere between the minimum and maximum values: (min delay = +wait - random) (max delay = wait + random). + + + + + +

Worldspawn Entity

+ +
Worldspawn
+ +Only used for the world. You access the worldspawn entity by +selecting any non-entity brush in your map. + + + +

Keys + +
message: text to print at user logon. Used for name of +level. + +
music: path/name of looping .wav file used for level's +music (eg. music/sonic5.wav). This is for a piece of music +with only one part. To make a song play with both an intro and a +looping portion, the following is the correct form for the music +value: + + + +

    music/intro.wav music/loop.wav
+ + + +

ambient: Adds a constant value to overall lighting. Use +not recommended. Ambient light will have a tendency to flatten out +variations in light and shade. + +
_color: This is the normalized formula for RGB +values for ambient light. A value is considered normalized +when it fits in a range between 0 and 1. If you are using a +tool like the Windows color picker, divide the value for each +component of the RGB values by 255. The result will be a +normalized value. + +
gravity: gravity of level (default is normal gravity: +800). +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_c.htm b/docs/manual/Q3Rad_Manual/appndx/appn_c.htm new file mode 100644 index 00000000..eb881f59 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_c.htm @@ -0,0 +1,654 @@ + + +Q3Radiant Editor Manual: Appendix C + + + +

Q3Radiant Editor Manual

+
+

Appendix C: Bot Navigation Files

+ +(Original Document Title: BSP Converter) +
+ + + + + + + + + + + + +
Version:= 1.8
Date:= 2000-01-11
Author:= Mr. Elusive
+ +

Introduction

+ +This appendix is based on documentation that has been released +and updated by Mr. Elusive. It deals with the Navigation file that +must be created in order for the Quake III Arena bots to be +able to navigate and play in game maps. It is not a manual for the +creation of bots. + +

Description

+ +The BSPC tool is used to create AAS files from BSP files. An AAS +file is a file with areas used by the Quake III Arena bot in order +to navigate and understand a map. + +

Installation

+ +Place the BSPC program in your Quake III Arena folder. + +

Usage

+ +Unless you are using a front-end utility, which gives you +check-button access to compiler functions, you will need to run +this program from the command line of your DOS Command Prompt +program. If the command line is not already pointing the Quake +III Arena directory, change directories (cd\quake III +arena). + +

The command line should be formatted as follows: + +

    bspc [-<switch> [-<switch> ...]]
+ +

Example 1: bspc -bsp2aas d:\quake3\baseq3\maps\mymap?.bsp + +
Example 2: bspc -bsp2aas +d:\quake3\baseq3\pak0.pk3\maps/q3dm*.bsp + +

In the first example a "?" is used as a metacharacter variable +to indicate any single keyboard character. This allows you to +compile the latest version of a map ("mymap1" or "mymapb"). + +

In the second example a "*" is used as a metacharacter variable +to indicate any string of keyboard characters. This allows you to +compile the latest version of a map ("mymap1" or "mymapb"). + +

The bot navigation compile process can be further modified by +the use of "switches" that change some of the parmeters used in +compilation. Some of these can be used to compile only +certain features, such as reachability. Others allow the compiler +to use more than a single processor, as is the case with +"threads." + +

Switches: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bsp2aas <[pakfilter/]filter.bsp>= convert BSP to AAS
reach <filter.bsp>= compute reachability & clusters
cluster <filter.aas>= compute clusters
aasopt <filter.aas> = optimize aas file
output <output path> = set output path
threads <X> = set number of threads to X
cfg <filename> = use this cfg file
optimize = enable optimization
noverbose = disable verbose output
breathfirst = breath first bsp building
nobrushmerge = don't merge brushes
freetree = free the bsp tree
nocsg = disables brush chopping
forcesidesvisible = force all sides to be visible
grapplereach = calculate grapple reachabilities
+ +

Several metacharacters may be used in the filter and +pakfilter. + +

+ + + + + + + + + + + + +
*Match any string of zero or more characters
?Match any single character
[abc...]Match any of the enclosed characters; a hyphen can be used to specify a range (e.g. a-z, A-Z, 0-9)
+ +

.pk3 files are accessed as if they are normal folders (whether +they are compressed or not). + +

For instance, use "d:\quake3\baseq3\pak0.pk3\maps/q3dm1.bsp" to +access the map q3dm1.bsp from the pak0.pk3 file. + +

Multiple files may be listed after the switches bsp2map, +bsp2aas, reach, cluster and aasopt. + +

If a BSP file is being converted to an AAS file and no output +path is entered on the command line then the AAS file will +automatically be stored in the same folder as the BSP file. However +if the BSP file was stored in a .pk3 file then the AAS file will be +stored in a folder with the name 'maps' outside the .pk3 file. + +

Updating the Entity Lump

+ +If an AAS file is already available for a BSP file and you ONLY +change the entities inside this BSP file then you only have to +recalculate the reachabilities. This way you can move items, +platforms etc. around without the need to recalculate the whole AAS +file -- which can save quite some compile time. You can recalculate +the reachabilities as follows: + +
    bspc -reach mymap.bsp
+ +

Where mymap.bsp is the BSP file. The mymap.aas file has to be in +the same folder as mymap.bsp or should be in the output folder +specified with the -output option. + +

Keep in mind that as soon as ANY geometry in the map changes +(including b_models and trigger brushes) the whole AAS file HAS to +be recalculated in order to play with bots. + +

Leaks

+ +Just like there can be vis "leaks" in a map there can also be +clipping leaks. Two things can be wrong when the BSPC tool outputs +that a map leaks. + +
  1. + +There are no entities in the map at all, or all entities that are +actually in the map are placed in solid locations (see Test Solid +below). In this case the BSPC tool outputs: "WARNING: no entities +inside." The map must contain at least one player start entity to +load in the game. + +
  2. + +There is a spot in the map where players can go outside the map +into the void. This is bad, players should never be able to fall +out of a level. In this case the BSPC tool outputs: "WARNING: +entity reached from outside." The BSPC tool also writes a mymap.lin +file that can be loaded in the Q3Radiant editor to show lines that +go through the actual leak.
+ +

Make sure the .lin file is stored in the same folder as where +q3radiant stores the .bsp file. Load the map in q3radiant and use +the menu > File > Pointfile... to load the .lin file. +A thick red line will be shown in the map. Follow this line to find +the leak. + +

Useful Map Information

+ +The following information is given as a reference for bot +capabilities. The area file information is used by bots. It tells +them when and where they can make jumps. Human players don't have +this information readily available to them, so you may want to be +more forgiving when designing tricky jumps. + +

Map Boundaries
+ +Currently all the contained area of a Quake III Arena map +should fall within the bounds (8192, 8192, 8192) - (-8192, -8192, +-8192) for the bspc tool to compile. These are the same bounds as +the Q3Map compilers. + +

Game Physics
+ +Player Dimensions + +
Model size: The player model's actual size is a bounding +box 30 units by 30 units square with a height of 56 units. In the +game world, eight units roughly equal one foot (30.5 cm). From +this, we deduce that the characters are a heroic 7 feet tall (2.13 +meters). + +

Step Heights + +
For scale purposes, "normal" steps should be no higher than 8 +units. However, the maximum value that a player may step up is 18 +units (just keep steps 16 units or lower). + +

Normal Jumps + +
The maximum height for barriers the bots will jump on is 32 +units. + +

Water Jump Heights (or "Everyone, out of the pool!") + +
The maximum distance that a bot may jump to exit water is 18 +units. This is the height difference between the water surface and +the adjacent floor that the bot is jumping onto. If the water jump +height is made higher, human players will have a hard time getting +out of the water. + +

Rocket Jumps + +
With normal gravity and without the quad, the maximum rocket +jump height is around 280 units (you can sometimes jump a few units +higher but this is a safe value for reference). In practice, except +for especially tricky jumps, this value should be substantially +lower. Test rocket jumps repeatedly before settling on a +final height. + +

Math for Map Makers + +
Here's some math to calculate some other values of interest: + +

Gravity = 800; + +
Jump velocity = 270; + +
Max vertical rocketjump velocity = 670; + +
Max run velocity = 320; + +
Max step height = 18; + +
Max jump height = 0.5 * gravity * +(jumpvelocity/gravity)*(jumpvelocity/gravity); + +
Max normal jump height = 45 units + +
NOTE: even +though this is the mathematical maximum jump height always keep the +the 32 units maximum barrier height for bots in mind when building +maps. + +
Maximum horizontal jump distance over a gap from one spot +to another when both are at the same height: + +

    t = sqrt((maxjumpheight + maxstep) / (0.5 * gravity)); + +
    t = 0.3986 seconds; + +
    dist = maxrunvelocity * (t + jumpvelocity / gravity); + +
    dist = 235 units;
+ +

Because players use a bounding box we can jump a full bounding +box width further in the ideal case. (15 units at the jump starting +position and 15 at the landing place). + +

    235 + 15 + 15 = 265 units.
+ +

Again, remember that this is the mathematical maximum which +players can only reach under ideal circumstances. + +

Optimizing a Map for bspc Compiling

+ +The area file is the tool that the bots use to understand the +map. If it is overly complex, it can cause navigation problems. +With careful attention to detail, many of these problems can be +eliminated, or avoided altogether. + +

First, understand that hint brushes, which are of great use to +the bsp compiler, have no effect on the bspc tool that creates area +files. Only solid, clip and liquid brushes and curve patches are +used by the bspc tool. Using these mapcomponents, the bspc tool +outputs how many "areas" will be created for a map. Having fewer +areas in a map is better than having more. + +

Quite often, map trim and detail create many of these small +areas. For the most part, these small areas are too small to enter +and are thus useless to the bots. Brushes that project out into the +map's floor cut it up and create additional areas. Often the number +of areas can be greatly reduced by adding additional clip brushes. +Take a look at Q3DM7 in the map editor, and you will see the walls +are literally covered with clip brushes. This not only +smooths out passage for human players, but also has the added +benefit of eliminating unnecesary navigation areas. This is +also why, as many "camping style" players have found, many areas +above door and window trim have also been clipped off. + +

Another way to reduce complexity is to use clip brushes to +simplify the collision area around complex objects. For exmple, the +map maker can add clip brushes with simple shapes (axial or +"square" brushes are prefered) around (small) detail brushes. +Simple shaped clip brushes can also be added around curves to +reduce the collision complexity (for instance, place an axial clip +brush around a small cylinder). It is better to place the clip +brushes around the whole curve (not just part of the curve). The +map maker should also use shader scripts to make the textures on +brushes or curve patches non-solid (surfaceparm nonsolid) when they +are enclosed by (full) clip brushes. This will also speed up bspc +calculations. + +

Always try to align your geometry to the grids. Always use the +largest grid possible for alignment of your geometry. Also try to +align the backsides of brushes which may not be visible. The more +brush sides are aligned the better. This will also speed up bspc +calculations. + +

Align adjacent brushes as much as possible. Make sure that badly +aligned brushes create no tiny faces. + +

Quite often there are also places in a map that are visible to +players but where players can never go (even determined, +rocket-jumping players). If a player could reach that area, they +would be able to walk around upon it. If the mapmaker decides not +to allow that, he or she should use large clip brushes to enclose +the entire unreachable space. This will also speed up bspc +calculations and reduce the number of areas created by the bspc +tool. + +

Note: the number of areas relative to the map size tells +something about the navigation complexity for players in general +(also human players). Reducing the collision complexity for bots +also makes the map easier to navigate for human players + +

Entities & the Navigation File

+ +There are specific rules and guidelines for using a number of +entities and entity-like textures with the bspc tool. + +

Func_plat and Func_bobbing
+ +When func_plat or func_bobbing entities are placed in a map, the +bots will use them if possible. The bots assume they can stand on +top of the bounding box (xy extents of all components used to +create the entity) of the model used for the func_plat or +func_bobbing entity. As a result, creating complex-shaped func_plat +or func_bobbing models is mostly a bad idea. You have to make sure +the bots (and players) can actually stand everywhere on top of the +bounding box of the model. The basic rule: If a bot is going to use +a func_plat or a func_bobbing, make sure the top surface is a +solid, rectilinear rectangle or square. + +

Cluster Portals
+ +Cluster portals are one of the several "texture entities" used +by the game engine. These are textures, which as used by the game +engine, function like entities. The bspc tool divides the map into +many, much smaller areas, which are essentially the surfaces a bot +can move upon during play. Several of these areas can be grouped +together to create a cluster. The clusters are seperated by cluster +portals, which are also areas themselves. One of the things the bot +uses these clusters for is to create a multi-level routing +algorithm. When a map is efficiently divided up into clusters bot +calculations (in run time) will be faster. + +

Guidelines to Consider When Placing Cluster Portals: + +

  • The BSPC tool creates cluster portals automatically, but placing +"clusterportal" brushes can create additional cluster portals. + +
  • Placing "clusterportal" brushes inside the map manually creates +cluster portals. + +
  • The "clusterportal" brushes should not be used outside the world +hull. + +
  • The cluster portals do not have any effect on map vis. + +
  • If a door is already sealed with an areaportal brush, a +clusterportal is not necessary there. (areaportals are used by the +bspc tool as if they were cluster portals). + +
  • Just like the areaportals, the cluster portals must seal a space +off entirely from other areas. + +
  • The cluster portal areas should seal off a cluster in a way that +the only path towards another cluster is through a cluster portal +area. + +
  • Only create cluster portals where people can walk or swim +through. + +
  • Don't create cluster portals in gaps in the floor. (people would +fall through) + +
  • Cluster portals must separate no more and no less than two (2) +clusters. + +
  • Try to create clusters with all the same number of +"reachability" areas. For instance if the map has 5,400 areas try +to create 10 clusters with 540 areas each, or 12 clusters with 450 +areas each, etc. The BSPC tool lists the number of reachability +areas in each cluster. + +
  • Avoid creating clusters with only a few (less than 10) +areas. + +
  • When adding "cluster portal" brushes, try to place them in +places with minimal geometric complexity. For instance place them +inside convex door openings or small hallways (not in front of door +openings). Ideally, the shape of the face through which a player +walks or swims into the cluster portal is the same as the shape of +the face through which a player leaves the cluster portal. Also +ideally, the open space inside the cluster portal brush is +convex. + +
  • Make cluster portals about 16 or 32 units thick.
+ +

"Do Not Enter" Areas
+The Do Not Enter texture is another one of the "texture +entities" that the game engine uses as if they were entities. In +some regards, it is like a clip brush, intended to prevent a bot +from moving into or through it. However, this works more as a +"strong suggestion" and is, in reality, not a physical barrier to +the bot. A simple example of how a bot may enter a "Do Not Enter" +area is knockback. If an explosion tosses a bot about, it may end +up inside a prohibited area. Bots may pass out of such areas, but +they will not actively try to enter them. + +

When bot navigation problems show up or you want to make sure a +bot never tries to go to a certain place use a "do not enter" +brush. + +

Guidelines to consider when placing "Do Not Enter" +brushes: + +

  • The "do not enter" brushes should not be used outside the world +hull. + +
  • The "do not enter" brush is Not a clip brush for the bot. + +
  • The "do not enter" brush is a tool of last resort. Do not use it +unless there are serious navigation problems. + +
  • The number of "do not enter" brushes should be minimized because +these brushes create additional areas for the bots. + +
  • The "do not enter" brush will create a new area that the bot +will try to avoid. However if the bot somehow ends up inside a "do +not enter" area or there is a valid goal (game entity or +item_botroam entity) inside the "do not enter" area then the bot is +allowed to go into and out of that area. So if the bot somehow gets +in a "do not enter" area the bot will be able to get out.
+ +

Bot Control Entities
+ +These entities encourage a bot to move about and use more parts +of the map. + +

Item_botroam +
The item_botroam entity can be used when a bot does not roam the +whole level or prefers to go to only specific areas. This +(invisible) item can be placed in a map just like regular items. +Nobody can actually pick up the item. It's only used to attract +bots to certain places of the map. + +

The item_botroam has a key "origin" that is set by Q3Radiant +automatically. + +

The item_botroam also has a key "weight." The value is the +weight of the roam item and is relative to the weight of other +items in the map, which are individual to each bot. The bot +character-specific item weights are stored with the bot characters +in the botfiles/bots/ sub-folder in the .pk3 file. The value of the +weight is a non-zero floating-point value, most often in the range +0 to 400. Higher values are allowed but keep in mind that the bot +should also still go for normal items, so don't make the +item_botroam weight too high. + +

"Notbot" Means "Don't Touch" + +
When a bot should never go for a specific item, the key +"notbot" with a value of "1" can be used for that item. This +notbot key and its value can be used for every available item in +Quake III Arena. + +

Info_Camp + +
This entity suggests locations where the bot can wait for +enemies to come into view. + + +

Suspended + +
The suspended checkbox flag can be used on all items +(item_botroam included). However keep in mind that when a suspended +item is not anywhere near the ground the bot will ONLY try to go +for this suspended item using jump pads. + +

Testing .AAS files

+ +
Solid Areas
+ +A solid area in the map is an area that looks empty to the human +player, but is solid, like a wall, to a bot player. One of the +easiest ways to test the AAS file for solid areas is to load the +map in Quake III Arena in teamplay mode (type /set +g_gametype 3 on the console before loading the map). Enter a team +and add a bot to your team. Use the team order menu (by default +bound to the F3 key) to command the bot to follow you. Walk around +the map and see if the bot is able to follow you everywhere. If a +bot stops at any point, it may have encountered an area of the map +that appears to be unblocked to you, but to the bot, it is like it +has encountered a solid wall. + +

Test Solid + +
In most cases, solid areas are the result of careless design. +But, if you insist on making maps that are not axial in layout +(say, your average cave), they can result from brushes meeting at +non-axial angles. These "map bugs" can sometimes cause certain +places in the map to show up solid in the AAS file. To test for +these solid places set the cvar bot_testsolid to "1" on the +console. (type /set bot_testsolid 1) + +

As you walk through the map, either "empty area" or "SOLID area" +will be printed on the screen while traveling through a map. + +

The Culprits: What May Cause Map Bugs + +
Several map bugs can cause these solid places in the AAS +file. + +

  • Sometimes microscopic brushes are created by CSG subtraction on +one or more brushes. Search for such brushes in the problem area +and delete them. + +
  • Tiny brush faces (not curves) can also cause problems. Due to +vertex snapping in the q3map tool, those tiny brush faces can be +snapped out of existence. Such faces will not show up in Quake +III Arena and you'll see tiny peek holes or slits where you can +view through the geometry (often into other rooms). Align vertexes +of adjacent brushes to remove and avoid such tiny faces. Placing a +clip brush in front of the face that is snapped out of existence +will also remove the "solid area" but of course it's preferred to +remove the peek hole or slit. Another cause could be a brush with a +collapsed side. Check how many sides a brush has and how many sides +actually have a surface. Rebuild brushes with collapsed sides. + +
  • Lava creates a solid area. All faces contained within liquid +brushes using a shader without "surfaceparm trans" set will be +removed (this includes some lava textures). Those contained +surfaces will not be visible and can cause the liquid to appear +"solid" in the aas file.
+ +

Hacking Away the Problem + +
If you insist creating an .AAS file for a map with bugs, then +the BSPC compile option -forcesidesvisible can be used. This +should fix all the problems with areas showing up solid in the .AAS +file. However creating an .AAS file with this option takes a lot +longer (often more than twice the normal compile time). This is not +recommended as a default option for compiling. + +

Testing Jump and Launch Pads + +
Jumppads can also be tested. Type the following on the Quake +III Arena console, before loading your map: + +

/set bot_maxdebugpolys 1024 + +
/set bot_visualizejumppads 1 + +
/set bot_forcereachability 1 + +

Now load the map. A counter will be shown and goes from 0% to +100%. When the counter has reached 100% type /set r_debugSurface 2 +on the console. For every jumppad the default arc of travel +(without using air control) will be visualized. + +

Version Changes

+ +1.8 (2000-01-08) + +
- increased max points on winding + +
- made "HashVec: point x y z outside valid range" non-fatal + +
- fixed rocket jump reachabilities + +
- added force sides visible option + +
- increased simulated stack size for area traces + +

1.7 (1999-12-22) + +
- fixed ducked bounding box size + +
- fixed sv_maxsteepness being zero in aas configuration + +
- AAS files are now automatically stored in BSP file folder + +
- fixed crash bug caused by overflow of a simulated stack + +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_d.htm b/docs/manual/Q3Rad_Manual/appndx/appn_d.htm new file mode 100644 index 00000000..a4650ca3 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_d.htm @@ -0,0 +1,243 @@ + + +Q3Radiant Editor Manual: Appendix D + + + +

Q3Radiant Editor Manual

+
+

Appendix D: Tricks, Tips, and Tutorials

+ +

Making the death fall sound…

+ +The death yell that occurs when a player or bot falls into the +void or fog of death is triggered by the falling character passing +through a trigger multiple (should be no less than 32 units thick) +that is targeted on a target_speaker. If you look at q3DM17 +and find a target speaker, you will see that it plays the falling +to death sound of the player who activates the trigger. Put +that sound in your own target_speaker. + +

Making a Mirror …

+ +Apply a mirror texture to brush (it will only work on brushes, +not curve patches). Next, place a misc_portal_surface entity within +64 units of the mirror and at roughly eye level for the character. +Because a mirror shows all that it can "see" the mapmaker needs to +take special care that his mirror doesn't see so much of the map +that it affects game performance. + +
    Rules: A mirror should not be able to see another +mirror or portal surface. This means no mirror mazes or +mirror facing each other to produce infinite reflections.
+ +

Making a Jump Pad

+ +
  1. Make the brush that contains your pulsing pad texture. It can be +set in the floor or raised up on separate brush. + +
  2. Make a trigger_push brush entity that is smaller than the pad +(the id triggers are usually octagonal). + +
  3. Create a target_position entity and move it to the height and +location you want. The target position is both the aiming point for +the trigger_push and the highest point (apex) of the assisted +jump. + +
  4. Hi-light the trigger first, then the target_position (order is +important). + +
  5. Press CTRL + k to connect the two entities (pointing the first +at the second). + +
  6. Compile and test it. The first compile needs to be a full or +fast vis. If you need to make adjustments to the target_position, +you only need to use an entities compile.
+ +

Lining Up the Pad Texture
+ +The combination of shader keys that make the jump pad pulsing +texture work can be tricky to line up. Try the following methods if +your own attempts bring no joy. + +
  1. Make the brush that will be your pad (128x128 units). + +
  2. Apply the pad texture. If it doesn't line up, turn off the lock +texture feature and move the pad until it lines up perfectly. + +
  3. Lock the texture and move the brush into position.
+ +

If that doesn't work: + +

  1. Build your brush in place. + +
  2. Apply the pad texture so that several corners of the pad circle +are visible. + +
  3. Compile a regioned area with the jump pad in it. + +
  4. At least one of the pad circles should have a pulsing circle in +it. + +
  5. Back in the editor, slide the pad circle with the active pulse +so it fills the pad. + +
  6. Recompile. It should work now.
+ +

Making a Launch Pad

+ +Target the trigger_push that you put above the pad at a +target_position. The player will accelerate until he reaches the +target. Physics does the rest. + +

Note: The center point of the target must be +higher than the center point of the trigger_push. + +

Making a "Rocket Arena" style map

+ +
  1. Create all the entities you want the player to spawn with when +he enters the arena, and make sure they are somewhere within the +enclosed space of the map. + +
  2. Add a "target_give" entity somewhere in the world. + +
  3. Create all the spawn spots you want to be in your map. + +
  4. Select the "target_give" entity. + +
  5. Select one of the "give on spawn in" entities. + +
  6. Hit Ctrl-K in the editor to link the two items together. + +
  7. Repeat steps 4 through 6 until the target_give is linked to +all +the entities you wish the player to spawn into the world with. + +
  8. Select a spawn spot + +
  9. Select the target_give entity + +
  10. Hit Ctrl-K in the editor to link the two entities together. + +
  11. Repeat steps 8 through 10 until all the spawn spots are linked +to +the target_give entity. + +
  12. Compile the map + +
  13. Set g_gametype to tournament mode and set fraglimit of 1. + +
  14. Get a bunch of your friends to connect into your server and +have +fun playing a "Rocket Arena" style game =)
+ +

An alternate use of target_give is how I used it in q3dm10 to +create the +"power tube" that gives you health and armour. The tube has a +trigger_multiple with a wait of 0.5, linked to a target_give which +is linked +to a small health and an armour shard. + +

Making an Environment Box …

+ +This is the shader script taken from the sky.shader that I used +to make a test sky box months and months ago. + + + +

In baseq3, make an 'env' folder. + +

Put your skybox art in here and use this naming +convention: + +

[skyname]_lf.tga + +
[skyname]_rt.tga + +
[skyname]_ft.tga + +
[skyname]_bk.tga + +
[skyname]_up.tga + +
[skyname]_dn.tga + +

  • Make a directory in your quake3 folder with the following path: + +
      quake3/baseq3/textures/[mymapname]
    + +
  • Make a directory in your quake3 folder with the following path: + +
      quake3/baseq3/scripts
    + +
  • Make a script document called [mymapname].shader + +
  • Make a script document called shaderlist.txt
+ +

In shaderlist.txt put [mymapname] on the first line and close +the document. + + + +

+//*******************************************************
+//*	    Sample environment box shader
+//*******************************************************
+
+textures/[mymapname]/[skyname]01
+
+{
+	qer_editorimage textures/[mymapname]/[skyname]
+
+	surfaceparm noimpact
+	surfaceparm nolightmap
+	surfaceparm sky
+	q3map_sun 0.933333 0.541176 03.13725 60 160 11
+	q3map_surfacelight 100 //lots of diffuse light
+	skyparms - 512 -
+	sky env/[skyname]
+
+// the following stuff lays clouds over the skybox map which you may not want with a city skyline
+	//{
+	// map textures/skies/dimclouds.tga
+	//
+	// tcMod turb 0 0.001 0.5 0.001
+	// tcMod scale 3 3
+	// tcMod scroll 0.01 0.01
+	// blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+	// depthWrite
+	//}
+	//{
+	// map textures/skies/pjbasesky.tga
+	// blendfunc GL_ONE GL_ONE
+	// tcMod scroll -0.01 -0.01
+	// tcMod scale 5 5
+	//}
+//}
+ +

Making a Shooter

+The shooters; shooter_rocket, shooter_grenade, and +shooter_plasma all fire a single projectile when they are triggered +by an event. + +
  • Make a shooter entity (rocket, grenade or plasma) + +
  • Give it a facing (1 to 360 degrees), or, + +
  • Target it at a target_position. + +
  • Give it a random value (potential degrees off target) + +
  • Create an Activator. Make a trigger multiple or target an entity +at the shooter. When the trigger is entered or the entity is taken, +the, shooter is activated. + +
  • If you want a shooter to fire multiple times, target the +activator on two or more target_delays. Set the delay time to a +different value for each (if using a trigger multiple, the WAIT +value on the trigger should be greater than the longest delay on +the target_delay). Target each target_delay on the shooter.
+ +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_e.htm b/docs/manual/Q3Rad_Manual/appndx/appn_e.htm new file mode 100644 index 00000000..d243d327 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_e.htm @@ -0,0 +1,225 @@ + + +Q3Radiant Editor Manual: Appendix D + + + +

Q3Radiant Editor Manual

+
+

Appendix E: Online Resources

+ +The Internet is an excellent source for information about Quake +engine editing.  The sites listed here provide a variety of +useful editing resources. + +

Disclaimer: Most of these sites are established, heavily +trafficked web pages with a history of stability. But, because +these sites are not maintained by id Software, we make no claims +that they will be there when you go looking for them or that they +will still have the information of the type you are seeking.
+ +

News about the Editor

+ +
QERadiant.com
+ +Qeradiant.com is the official site for the id editing tool that +was the predecessor of Q3Radiant. + +
http://www.qeradiant.com/ + +

MapCenter
+ +A great online forum based resource for models, skinning, textures, and mapping in many different games. + +
http://www.map-center.com + + +

Quake3World.com
+ +Looking for a heavily trafficked message board where questions +often get answered by the id designers? Look no further than the +community section of Mplayer's Quake3World.com. + + +http://www.quake3world.com/ + +

Editing Tutorials

+ +These tutorials are located at several sites that have been +around for a while, and may continue to be around. + +

Tram Design
+ http://www.planetwolfenstein.com/tramdesign/index.html + +
Tutorials and files for Return To Castle Wolfenstein editing. + +

Claudec's Lair of Shaders
+ + +http://www.claudec.com/lair_of_shaders/ + +
Numerous tutorials on editing subjects. + +

RiceBug.Com
+ + +http://ricebug.qeradiant.com/ + +
Some good tutorials on Q3Radiant (the Quake 3 editor) and QERadiant (the Quake 2 +editor). + +

RUST - Game Design.net
+ + +http://www.gamedesign.net/ + +
RUST has been a prime source for Quake engine editing for some +time. + +

Editing Tools

+ +

GenSurf
+ + +http://tarot.telefragged.com/gensurf/index.shtml + +
GenSurf is a "natural" terrain creation tool that converts a +grayscale bitmap into a web of triangular brushes or curve patches. +Used with care, it can make some very interesting irregular +surfaces. + +

Milkshape 3D
+ + +http://www.swissquake.ch/chumbalum-soft/home.html + +
This is a shareware editor for 3D models. Support for Quake +III Arena's native md3 format is forthcoming. + +

Quake 3 Arena Shader Editor
+ + +http://www.larian.com/rat/q3ase.html + +
This is a tool for editing shaders. It allows you to construct +the shader in realtime, seeing what works you build it. + +

Prefab Sources

+ +
Gamedesign.net Prefabs
+ +http://prefabs.gamedesign.net/game.php3?game_id=13&num=0 + +
This Rust's source for prefabricated map plug-ins. These here +are in the form of .map files instead of Quake III Arena's +native .pfb format. + +

Quake Prefab Park 2
+ + +http://www.planetquake.com/qpp/qpp2/ + +
These are prefabs designed for use with Quake and +Quake 2, which means the ones with movement or action gimmicks +most likely will not work. And of course, you'll need to +retexture anything you find here if it's not a Quake III +Arena prefab. + +

Texture Sources

+ +The following sites include shader documents, downloadable +textures, tutorials or links to tutorials on making your own. + +

Shaderlab - Robot Life
+http://www.shaderlab.com + +
This site has a nice selection of textures and shaders to go with them. + +

[h f x]
+http://www.planetquake.com/hfx/ + +
This is a fantastic source for textures and shaders as well. + +

Mean Arena
+ + +http://www.planetquake.com/meanarena/Q3_textures.html + +
This site has a few texture sets to choose from. + +

Quake III Arena Shader Manual
+ + +http://www.planetquake.com/polycount/resources/quake3/tutorials.shtml + +
+http://www.quake3world.com/files/Q3Ashader_manual.doc + +
This is the official id documentation of Quake III Arena +shaders. The second source is a download. + +

Texture Forest
+ + +http://www.planetunreal.com/forest/main1.html + +
It is possible to learn some tricks from artists who work for +that "other" game engine. + +

Map Object Model Sources

+ +
F.P.S.
+http://fps.brainerd.net/ +
Tons of Quake 3 stuff. The best part though is the map models section. A whole lot of them at this site. + +

Polycount
+ + +http://www.planetquake.com/polycount/resources/quake3/index.shtml + +
This link takes you to the resource page for Quake III Arena +modeling. + +

Frequently Asked Questions (FAQ)

+ +
Developer's FAQ (Quake3mods)
+ + +http://www.q3seek.com/edit.php3 + +
This site answers a lot of questions about map making, model +making, texturing and skinning. Mod makers appear to have +submitted much of the information. + +

Official Quake III Arena FAQ (Quake3world.com)
+ + +http://www.quake3arena.com/faq/ + +
This is the official FAQ, created and maintained by id Software. +Most of the information pertains to general problems players +encounter with Quake III Arena, and doesn't have a lot to do with +map making. + +

RUST - Game Design.net
+ + +http://www.gamedesign.net/quake3/faq/ + +
This development-oriented site has a Quake III Arena FAQ though at the moment it's not particularly helpful. + +

Map Reviews, General Information

+ +
LVL - Q3A Edition
+ + +http://www.planetquake.com/lvl/ + +
A great level review site. It also has a great beta section for people to beta test your maps before you release and get you some feedback to make it one of the best levels out there. + +

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/appndx/appn_f.htm b/docs/manual/Q3Rad_Manual/appndx/appn_f.htm new file mode 100644 index 00000000..0458dd6b --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/appn_f.htm @@ -0,0 +1,144 @@ + + +Q3Radiant Editor Manual: Appendix F + + + +

Q3Radiant Editor Manual

+
+

Appendix F: Default Key Shortcuts

+ +On the odd chance that you (like the author of this manual) might seriously mess up your default key bindings when making an .ini file, here are the default assignments to correct your mistake. Copy these below the [commands] line of your .ini file. + +

HideSelected			H
+ShowHidden			Shift + H
+BendMode			B
+FitFace				Control + B
+FitBrush			Shift + B
+FreezePatchVertices		F
+UnFreezePatchVertices		Control + F
+UnFreezeAllPatchVertices	Shift + Control + F
+ViewTextures			T
+ThickenPatch			Control + T
+MakeOverlayPatch		Y
+ClearPatchOverlays		Control + Y
+SurfaceInspector		S
+PatchInspector			Shift + S
+ToggleShowPatches		Shift + Control + P
+ToggleShowPatches		Control + P
+RedisperseRows			Control + E
+RedisperseCols			Shift + Control + E
+InvertCurveTextureX		Shift + Control + I
+InvertCurveTextureY		Shift + I
+InvertCurve			Control + I
+IncPatchColumn			Shift + Control + PLUS
+IncPatchRow			Control + PLUS
+DecPatchColumn			Shift + Control + SUBTRACT
+DecPatchRow			Control + SUBTRACT
+Patch TAB			TAB
+Patch TAB			Shift + TAB
+SelectNudgeDown			Alt + DOWN
+EntityColor			K
+CameraForward			UP
+CameraBack			DOWN
+CameraLeft			LEFT
+CameraRight			RIGHT
+CameraUp			D
+CameraDown			C
+CameraAngleUp			A
+CameraAngleDown			Z
+CameraStrafeRight		PERIOD
+CameraStrafeLeft		COMMA
+ToggleGrid			0
+SetGrid1			1
+SetGrid2			2
+SetGrid4			3
+SetGrid8			4
+SetGrid16			5
+SetGrid32			6
+SetGrid64			7
+DragEdges			E
+DragVertices			V
+ViewEntityInfo			N
+ViewConsole			O
+CloneSelection			SPACE
+DeleteSelection			BACKSPACE
+UnSelectSelection		ESCAPE
+CenterView			END
+ZoomOut				INSERT
+ZoomIn				DELETE
+UpFloor				PAGEUP
+DownFloor			PAGEDOWN
+ToggleClipper			X
+ToggleCrosshairs		Shift + X
+TogTexLock			Shift + T
+TogTexRotLock			Shift + R
+ToggleRealtime			Control + R
+EntityList			L
+Preferences			P
+ToggleCamera			Shift + Control + C
+ToggleConsole			O
+ToggleView			Shift + Control + V
+ToggleZ				Shift + Control + Z
+ConnectSelection		Control + K
+Brush3Sided			Control + 3
+Brush4Sided			Control + 4
+Brush5Sided			Control + 5
+Brush6Sided			Control + 6
+Brush7Sided			Control + 7
+Brush8Sided			Control + 8
+Brush9Sided			Control + 9
+ShowDetail			Control + D
+MakeDetail			Shift + Control + M
+MakeDetail			Control + M
+MapInfo				M
+NextLeakSpot			Shift + Control + K
+PrevLeakSpot			Shift + Control + L
+FileOpen			Control + O
+FileSave			Control + S
+Exit				Control + X
+NextView			Control + TAB
+ClipSelected			RETURN
+SplitSelected			Shift + RETURN
+FlipClip			Control + RETURN
+MouseRotate			R
+Copy				Control + C
+Paste				Control + V
+Undo				Control + Z
+ZZoomOut			Control + INSERT
+ZZoomIn				Control + DELETE
+TexDecrement			Shift + SUBTRACT
+TexIncrement			Shift + PLUS
+TextureFit			Shift + 5
+TexRotateClock			Shift + PAGEDOWN
+TexRotateCounter		Shift + PAGEUP
+TexScaleUp			Control + UP
+TexScaleDown			Control + DOWN
+TexShiftLeft			Shift + LEFT
+TexShiftRight			Shift + RIGHT
+TexShiftUp			Shift + UP
+TexShiftDown			Shift + DOWN
+GridDown			[
+GridUp				]
+TexScaleLeft			Control + LEFT
+TexScaleRight			Control + RIGHT
+CubicClipZoomOut		Control + [
+CubicClipZoomIn			Control + ]
+ToggleCubicClip			Control + \
+MoveSelectionDOWN		SUBTRACT
+MoveSelectionUP			PLUS
+DumpSelectedBrush		Shift + D
+ToggleSizePaint			Q
+SelectNudgeLeft			Alt + LEFT
+SelectNudgeRight		Alt + RIGHT
+SelectNudgeUp			Alt + UP
+CycleCapTexturePatch		Shift + Control + N
+NaturalizePatch			Control + N
+SnapPatchToGrid			Control + G
+ShowAllTextures			Control + A
+SelectAllOfType			Shift + A
+CapCurrentCurve			Shift + C
+
+

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/appndx/sskey_dl.htm b/docs/manual/Q3Rad_Manual/appndx/sskey_dl.htm new file mode 100644 index 00000000..22e31c02 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/appndx/sskey_dl.htm @@ -0,0 +1,977 @@ + + + Shortcut keys and Mouse functions in QeRadiant & Q3Radiant + + + + +

Q3Radiant Editor Manual

+
+

Appendix G: Shortcut keys and Mouse functions
in QeRadiant/Q3Radiant

+ +

By Eutectic

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

1. Introduction

+

This is a list of all the command shortcut keys and key-mouse functions in QeRadiant and Q3Radiant. Please note that there are some commands that work in QeRadiant and not in Q3Radiant and vice versa. This is mainly because those are actually 2 different map editors for 2 very different game engines (Quake II and Quake III Arena) even though they share a common interface. But unless otherwise specified, the commands in this list work for both editors. Also note that in QeRadiant, there are some functions that work when selected from the menus but for which the shortcut key doesn't work. Whenever this is the case, this is clearly indicated with a color coded table cell.

+This revised version of this list reflects all the changes and additions in Q3Radiant Build 189.

+ +

2. Shortcut key list

+

The commands are sorted by category and color coding was implemented in the table boxes: + +

    +
  • Red background:

    +This denotes shortcut keys which are listed in the Help command list but don't work.


  • +
  • Green background:

    +This denotes shortcut keys or mouse functions which apply only to QeRadiant.


  • +
  • Orange background:

    +This denotes shortcut keys or mouse functions which apply only to Q3Radiant.


  • +
  • Purple background:

    +This denotes shortcut keys which are assigned to different features in QeRadiant and Q3Radiant.
  • +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ActionDescriptionShortcut Key
2D view and Z view navigation & control keys
Toggle ViewOnly used in free window mode. Toggles the 2D view on/off.CTRL+SHIFT+V
Next ViewCycles the 2D view through all 3 views (top, front, side). Not used in 4 view mode.CTRL+TAB
Zoom InZooms 2D view in.DELETE
Zoom OutZooms 2D view out.INSERT
Center On CameraCenters the 2D view on the camera's current location.G
Toggle ZOnly used in free window mode. Toggles the Z view on/off.CTRL+SHIFT+Z
Z Zoom InZooms Z checker window in.CTRL+DELETE
Z Zoom OutZooms Z checker window out.CTRL+INSERT
3D view navigation & control keys
Camera BackMakes the POV in the 3D view move backwards.DOWN ARROW
Camera ForwardMakes the POV in the 3D view move forward.UP ARROW
Camera LeftMakes the POV in the 3D view look left.LEFT ARROW
Camera RightMakes the POV in the 3D view look right.RIGHT ARROW
Camera Strafe LeftMakes the POV in the 3D view move left.COMMA ( , )
Camera Strafe RightMakes the POV in the 3D view move right.PERIOD ( . )
Camera DownMakes the POV in the 3D view move down.C
Camera UpMakes the POV in the 3D view move up.D
Camera Angle DownMakes the POV in the 3D view look down.Z
Camera Angle UpMakes the POV in the 3D view look up.A
Center ViewCenters the POV in the 3D view.END
Down FloorMoves the POV in the 3D view down by one floor.PAGE DOWN
Up FloorMoves the POV in the 3D view up by one floor.PAGE UP
Toggle CameraOnly used in free window mode. Toggles the 3D view on/off.CTRL+SHIFT+C
Toggle Cubic ClipToggles 3D view clipping on/off. This feature works in both editors but shortcut key only works in Q3Radiant.CTRL+\
Cubic Clip Zoom InMakes the cubic clipping plane come in closer. Best used for speed optimizations.CTRL+ ]
Cubic Clip Zoom OutMakes the cubic clipping plane move further out. CTRL+ [
Toggle RealtimeToggles on/off real time 3D view camera updates.
+Feature doesn't work.
CTRL+R
Grid + control keys
Toggle GridTurns grid view on/off.0
Set Grid 1Sets the grid to 1 unit.1
Set Grid 2Sets the grid to 2 units.2
Set Grid 4Sets the grid to 4 units.3
Set Grid 8Sets the grid to 8 units.4
Set Grid 16Sets the grid to 16 units.5
Set Grid 32Sets the grid to 32 units.6
Set Grid 64Sets the grid to 64 units.7
Grid DownDecreases the size of the grid.[
Grid UpIncreases the size of the grid.]
Brush & entity creation and manipulation keys
Brush (3 sided)Creates a 3 sided brush.CTRL+3
Brush (4 sided)Creates a 4 sided brush.CTRL+4
Brush (5 sided)Creates a 5 sided brush.CTRL+5
Brush (6 sided)Creates a 6 sided brush.CTRL+6
Brush (7 sided)Creates a 7 sided brushCTRL+7
Brush (8 sided)Creates a 8 sided brush.CTRL+8
Brush (9 sided)Creates a 9 sided brush.CTRL+9
Unselect SelectionDeselects all currently selected objects.ESC
Delete SelectionDeletes all currently selected objects.BACKSPACE
Clone SelectionCreates a duplicate of the currently selected objects.SPACEBAR
Drag Edges ModeToggles edge manipulation mode on/off. Edges are represented by blue dots on the brush.E
Drag Vertex ModeToggles vertex manipulation mode on/off. Vertices are represented by green dots on the brush.V
Brush Clip modeToggles brush clipping mode on/off.X
Flip ClipSwitches which part of the brush is going to be clipped away on the set clip plane points while in clipping mode.CTRL+ENTER
Clip SelectedClips the selected brush/brushs on the set clip plane points while in clipping mode.ENTER
Split SelectedSplits the selected brush/brushs on the set clip plane points while in clipping mode.SHIFT+ENTER
Move Selection DownMoves the selected object down in Z axis by units equal to the grid size (independent of current 2D view).KEYPAD MINUS
Move Selection UpMoves the selected object up in Z axis by units equal to the grid size (independent of current 2D view).KEYPAD PLUS
Select Nudge DownMoves the selected object down in current 2D view by units equal to the grid size.ALT+DOWN ARROW
Select Nudge UpMoves the selected object up in current 2D view by units equal to the grid size.ALT+UP ARROW
Select Nudge LeftMoves the selected object left in current 2D view by units equal to the grid size.ALT+LEFT ARROW
Select Nudge RightMoves the selected object right in current 2D view by units equal to the grid size.ALT+RIGHT ARROW
Snap Selection To GridSnaps the vertices of the currently selected brush or patch mesh to the grid.CTRL+G
Make DetailTurns selected structural brush into a detail brush.CTRL+M
Make StructuralTurns selected detail brush into a structural brush.CTRL+SHIFT+S
Dump Selected BrushDumps a list of the plane point coordinates of all the faces of the currently selected brush to the console view.SHIFT+D
View Entity InfoBrings up the entity dialog window.N
Select Whole EntitiesQeRadiant only: Toggles feature on/off. When feature is on, selecting any single brush of a multiple brush entity automatically selects all the brushes that belong to that entity (This shortcut key does a Redisperse Rows in Q3Radiant).CTRL+E
Cycle Group SelectionCycle selects each individual brush of currently selected bsp-model entity (Select Whole Entities must not be on in QeRadiant). This command was renamed Patch Tab in Q3Radiant but it's function is unchanged.TAB
Connect SelectionConnect entities target to targetname.CTRL+K
Entity ColorUse this to set the "_color" key of a entity by bringing up the standard Windows RGB color selector. Used for choosing the color of lights for example.K
Texture manipulation keys
View TexturesOnly used in 4 view and free window modes. Brings up the texture selection window (toggle in 4 view mode).T
Surface InspectorBrings up the surface properties dialog (only used to align textures in Q3Radiant).S
Texture Shift DownMoves texture on currently selected brush face(s) downwards. Also works for patches but might sometimes give unexpected results.SHIFT+DOWN ARROW
Texture Shift UpMoves texture on currently selected brush face(s) upwards. Also works for patches but might sometimes give unexpected results.SHIFT+UP ARROW
Texture Shift LeftMoves texture on currently selected brush face(s) to the left. Also works for patches but might sometimes give unexpected results.SHIFT+LEFT ARROW
Texture Shift RightMoves texture on currently selected brush face(s) to the right. Also works for patches but might sometimes give unexpected results.SHIFT+RIGHT ARROW
Texture Rotate ClockwiseRotates texture clockwise on currently selected brush face(s). Also works for patches but might sometimes give unexpected results.SHIFT+PAGE DOWN
Texture Rotate Counter-ClockwiseRotates texture counter-clockwise on currently selected brush face(s). Also works for patches but might sometimes give unexpected results.SHIFT+PAGE UP
Texture Scale DownDecreases vertical scale of texture on currently selected brush
face(s). Also works for patches but might sometimes give unexpected results.
CTRL+DOWN ARROW
Texture Scale UpIncreases vertical scale of texture on currently selected brush face(s). Also works for patches but might sometimes give unexpected results.CTRL+UP ARROW
Texture Scale LeftDecreases horizontal scale of texture on currently selected brush face(s). Also works for patches but might sometimes give unexpected results.CTRL+LEFT ARROW
Texture Scale RightIncreases horizontal scale of texture on currently selected brush
face(s). Also works for patches but might sometimes give unexpected results.
CTRL+RIGHT ARROW
Texture FitAutomatically fits the texture to the size of the currently selected brush face by scaling it vertically and horizontally. This shortcut only works in QeRadiant.SHIFT+5
Texture Fit To FaceSame as Texture Fit. This shortcut only works in QeRadiant.CTRL+F
Toggle Texture LockToggles brush move texture alignment locking on/off. This feature works in both editors but shortcut key only works in Q3Radiant.SHIFT+T
Toggle Texture Rotate LockToggles brush rotation texture alignment locking on/off. This feature works in both editors but shortcut key only works in Q3Radiant.SHIFT+R
Dialogs and special features keys
View ConsoleOnly used in 4 view and free window modes. Brings up the console (this is a toggle function in 4 view mode).O
PreferencesBrings up the user preferences dialog.P
Entity ListBrings up the entity list "tree view" window. This feature works in both editors but shortcut key only works in Q3Radiant.L
Map InfoBrings up the map info status window. This feature works in both editors but shortcut key only works in Q3Radiant.M
Filter SettingsBrings up the filters dialog window. This feature only works in QeRadiant.F
Show DetailToggles display of detail brushes on/off.CTRL+D
Animate Selected EntitiesToggles animation of selected mover entities (doors, buttons, etc.) on/off. This feature only works in QeRadiant.CTRL+A
Previous Leak SpotTakes POV in the 3D view to the previous leak spot (pointfile must be loaded).CTRL+SHIFT+L
Next Leak SpotTakes POV in the 3D view to the next leak spot (pointfile must be loaded). This feature works in both editors but shortcut key only works in Q3Radiant.CTRL+SHIFT+K
Misc utility keys
File OpenOpens a file.CTRL+O
File SaveSaves a file.CTRL+S
ExitCloses the editor.CTRL+X
CopyCopies whatever is currently selected.CTRL+C
PastePastes what ever is in the clip board. Only works with text and Radiant's stuff.CTRL+V
UndoUndo. Doesn't work in all cases.CTRL+Z
RedoRedo. Doesn't work in all cases.CTRL+Y
Q3Radiant miscellaneous features keys
View GroupsBrings up the groups dialog window.G
Toggle Size PaintMomentarily displays the position + dimensions of currently selected brush(es) in the 2D view.Q
Mouse RotateToggles mouse free rotation mode on/off for currently selected objects.R
Select Type AllSelects all "identical" based on type of "currently selected". If type is a surface, all solids with the same texture are selected. If type is an entity, all the other entities of its classname are selected.SHIFT+A
CSG MergeWill merge all currently selected brushes into a single brush. If the shape and size of any one of the selected brushes would cause the merge to produce a concave solid, the merge operation is not performed.SHIFT+M
Toggle CrosshairsToggles between the regular mouse pointer and a large crosshair style pointer in the 2D view.CTRL+SHIFT+X
Fit TextureThis will automatically scale the texture on the currently selected faces so one texture tile will fit exactly on the faces by default. It also brings up Surface Inspector so the texture can be fit to the faces by a different number of texture tiles than 1.SHIFT+B
Hide SelectedHides all currently selected objects from the 2D/3D views.H
Show HiddenUn-hides all objects currently hidden from the 2D/3D views.SHIFT+H
Show All TexturesShows all the textures currently loaded in Q3radiant's texture window. Use this to un-set Show In Use in the textures menu.CTRL+A
Patch TabCycle selects each individual brush or patch of currently selected bsp-model entity. This command was called Cycle Group Selection in QeRadiant but it's function is unchanged.TAB or SHIFT+TAB
Q3Radiant patch manipulation keys
Bend ModeToggles bend mode on/off. This is used to bend patch meshes. Follow the instructions that come up in the dialog box when you use this. Best used for making arches and such.B
Cap Current CurveAutomatically creates cap patches for the currently selected patch if it's a cylinder. For bevels and endcaps, it will bring up the cap dialog instead. The patch and its caps will then automatically be grouped in a func_group.SHIFT+C
Cycle Cap Texture PatchThis cycles the cap texturing type on the currently selected patch.CTRL+SHIFT+N
Cycle Cap Texture AxisThis cycles the cap texturing axis on the currently selected patch.CTRL+SHIFT+P
Naturalize PatchMakes the texture natural on the patch mesh (sometimes the textures are stretched to fit the patch, this will make the texture fit normal instead of streching it).CTRL+N
Increase Patch RowAdds 3 rows to currently selected patch.CTRL+KEYPAD PLUS
Decrease Patch Row Removes 3 rows from currently selected patch (assuming patch currently has more than 3 rows).CTRL+KEYPAD MINUS
Increase Patch ColumnAdds 3 columns to currently selected patch.CTRL+SHIFT+KEYPAD PLUS
Decrease Patch ColumnRemoves 3 columns from currently selected patch (assuming patch currently has more than 3 columns).CTRL+SHIFT+KEYPAD MINUS
Redisperse ColumnsEvenly re-disperses all the columns of the currently selected patch. Useful after adding new columns.CTRL+SHIFT+E
Redisperse RowsEvenly re-disperses all the rows of the currently selected patch. Useful after adding new rows (this shortcut key does a Select Whole Entities in QeRadiant).CTRL+E
Invert CurveThis inverts the patch mesh's matrix. IOW, it changes which side of the patch the texture is applied to.CTRL+I
Invert Curve Texture XInverts the X value of the texture on the matrix. Use this to mirror the texture vertically on a patch.SHIFT+I
Invert Curve Texture YInverts the Y value of the texture on the matrix. Use this to mirror the texture horizontally on a patch.CTRL+SHIFT+I
Matrix TransposeSwaps the rows and columns on a patch. There is no physical change on the patch as such: rows become columns and vice versa. Use this to change the natural texture orientation axis on patches.CTRL+SHIFT+M
Make Overlay PatchTurns on display of the currently selected patches control points. The display of the patches control points will remain on until turned off by Clear Patch Overlays.Y
Clear Patch OverlaysTurns off display of the currently displayed patches control points previously turned on by Make Overlay Patch.CTRL+L
Patch InspectorBrings up the patch inspector dialog.SHIFT+S
Thicken PatchCreates a copy of current patch and spaces it by X amount of units (as per value entered in dialog box) then caps off the mesh.CTRL+T
Toggle Show PatchesToggles display of patch meshes from 2D/3D views on/off.CTRL+P
+


+

3. Mouse Function list

+

This is the list of all the Mouse Functions in QeRadiant and Q3Radiant. Note that these are not shortcuts. The tasks accomplished by the mouse cannot be found in the menus. They provide much of the essential functionality in QeRadiant/Q3Radiant when designing maps.

+ +

Radiant's user interface includes many productivity features and is a very powerful tool. It's no wonder that it's the editor of choice for professional and amateur map designers alike. But it's true power is unleashed when you use a 3-Button mouse. Several extremely useful power features, especially when it comes to texturing, are only accessible if you use a 3-Button mouse. Many people own one nowadays and if you use QeRadiant regularly, I strongly recommend you get one.

+ +

The commands were sorted by category and abbreviations were used to make it easier for me to fit the shortcut names in the table boxes: + +

    +
  • LEFT-SIDE BUTTON or LEFT-CLICK = LEFTBUT


  • +
  • MIDDLE BUTTON or MIDDLE-CLICK = MIDBUT


  • +
  • RIGHT-SIDE BUTTON or RIGHT-CLICK = RIGHTBUT

    The action of these 3 abbreviations mean: click once



  • +
  • LEFT-CLICK & DRAG = LEFTBUT+DRAG


  • +
  • MIDDLE-CLICK & DRAG = MIDBUT+DRAG


  • +
  • RIGHT-CLICK & DRAG = RIGHTBUT+DRAG

    +The action of these last 3 abbreviations mean: click once, hold down button and drag mouse.


  • +
+ +

Also, as with most applications, the action of the mouse is context-sensitive meaning that the same Mouse shortcut might do a different thing depending in what view you click. This is why the categories below are sorted more by context than type.

+


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ActionDescriptionMouse Function
2D view mouse functions
Scroll ViewScroll or pan the 2D view. Also works in the Z view.RIGHTBUT+DRAG
Move Z CheckerMoves the location of the Z Checker box icon in the 2D view to where you click. Dragging the mouse makes it follow around.SHIFT+MIDBUT
SHIFT+MIDBUT+DRAG
Move CameraMoves the location of the Camera eye icon in the 2D view to where you click. Dragging the mouse makes it follow around. Also works in the Z view.CTRL+MIDBUT
CTRL+MIDBUT+DRAG
Point CameraPoints the Camera eye icon in the 2D view to where you click. Dragging the mouse makes it follow around.MIDBUT
MIDBUT+DRAG
Create/Modify BrushThis will create a new brush if no object is currently selected. If one or more brushes are selected, this will:

+1. Resize the brush when click-dragging outside.

+2. Move the brush when click-dragging inside.

+If one or more point entities are currently selected, this will just move them. Also works in the Z view but for brushes, only move and vertical resize are possible. In the 3D view, only move and resize work.
LEFTBUT+DRAG
Select ObjectSelects/Deselects brush or entity under cursor. Entities have priority over brushes. This also works in the Z and 3D views.SHIFT+LEFTBUT
Cycle Select ObjectCycle selects all brushes or entities under cursor in order of depth. This only works in the 2D view in QeRadiant but works in all views in Q3Radiant.SHIFT+ALT+LEFTBUT
Drag Brush FaceDrags the face of the currently selected brush. The face nearest to the cursor is dragged. Brushes can also be sheared by using this. This also works in the 3D view.CTRL+LEFTBUT+DRAG
Entity MenuBrings up the entity pop-up menu. You can then select the entity to create. For solid entities (doors, buttons, triggers, etc.), at least one brush must be selected beforehand.RIGHTBUT
3D view mouse navigation functions
Drive CameraMakes the POV in the 3D view move forward/backwards and turn left/right when mouse is dragged.RIGHTBUT+DRAG
Strafe CameraMakes the POV in the 3D view strafe up/down and sideways when mouse is dragged.CTRL+RIGHTBUT+DRAG
3D view mouse texturing functions
Select Brush FaceSelects brush face under cursor. Only one face at a time can be selected. Will automatically deselect any currently selected objects. Also grabs the face's current texture + alignment + flags into Surf Inspector.CTRL+SHIFT+LEFTBUT
Select Multiple Brush FacesSelects brush faces under cursor. Any number of faces at a time can be selected. Will automatically deselect any currently selected objects. Also grabs the face's current texture + alignment + flags into Surf Inspector. This feature only works in Q3Radiant.CTRL+SHIFT+ALT
+LEFTBUT
Grab TextureGrabs the texture + alignment + flags of the brush face under the cursor into Surf Inspector. Any currently selected face or brushes will automatically be assigned the grabbed values.MIDBUT
Apply Texture To BrushApplies the current texture + alignment + flags in Surf Inspector to the whole brush under the cursor.CTRL+MIDBUT
Apply Texture To FaceApplies the current texture + alignment + flags in Surf Inspector to the single brush face under the cursor. +CTRL+SHIFT+MIDBUT
Apply Texture Only To FaceApplies the current texture in Surf Inspector to the single brush face under the cursor but face retains its current alignment + flags.SHIFT+MIDBUT
Shift TextureShifts the texture's vertical and horizontal alignment on the currently selected face or brushes. This feature only works in QeRadiant.ALT+RIGHTBUT+DRAG
Scale TextureStretches up/down the texture's vertical and horizontal scale on the currently selected face or brushes. This feature only works in QeRadiant.SHIFT+ALT+RIGHTBUT
+DRAG
Rotate TextureRotates the texture on the currently selected face or brushes. This feature only works in QeRadiant.CTRL+ALT+RIGHTBUT
+DRAG
Set Light To Average Texture ColorGrabs the average color of the current texture in Surf Inspector and sets the "_color" key of the light entity under the cursor to that RGB color value. This feature only works in Q3Radiant.SHIFT+MIDBUT
Texture window mouse functions
Select TextureSelects the texture under the cursor and pastes the texture + default flags into Surf Inspector. All currently selected brushes or face will automatically be assigned the selected texture.LEFTBUT
Select Texture + Surf InspectorSame as above but also automatically brings up the Surf Inspector window. This feature only works in QeRadiant but shortcut key does a Apply Texture Angled in Q3Radiant.CTRL+LEFTBUT
Scroll Texture WindowScrolls up/down through the texture window (same as scrollbar or mouse wheel).RIGHTBUT+DRAG
Scroll Texture Window FastSame as above but will scroll much faster. Useful for browsing through very large texture folders.SHIFT+RIGHTBUT+DRAG
Edit ShaderShader window function. Shift-click on a shader opens the proper shader file in EditPad and automatically places the cursor at the beginning of the shader. This feature only works in Q3Radiant.SHIFT+LEFTBUT
Apply Texture AngledAutomatically applies and scales the texture under the cursor on currently selected angled faces so it will fit on those faces by exactly one texture tile. This feature only works in Q3Radiant but shortcut key does a Select Texture + Surf Inspector in QeRadiant.CTRL+LEFTBUT
Entity dialog mouse functions
Create EntityDouble-clicking on an entity name in the dialog's list will create an entity at the location of the currently selected brush (mandatory).

+1. If a point entity is chosen from the list, it will automatically replace the selected brush(es).

+2. If a solid entity is chosen from the list, the selected brush(es) will belong to the entity.

+3. If an entity or nothing is selected beforehand, you will get an error dialog: "Failed to create entity".
DOUBLE-LEFTBUT
+
+
+

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/ch01/pg1_1.htm b/docs/manual/Q3Rad_Manual/ch01/pg1_1.htm new file mode 100644 index 00000000..0a452022 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch01/pg1_1.htm @@ -0,0 +1,179 @@ + + +Q3Radiant Editor Manual: Page 1.1 + + + +

Q3Radiant Editor Manual

+
+

Preface

+ +The authors would like to thank the many supporters of Quake Engine +editing who made this work possible. Several sections in the manual +are based on material written by dedicated fans. Others were +"corrected" by fans who found undiscovered bugs in both the editor +and game code. Where possible, we have noted the contributors in +the sections they helped produce. + +

Paul Jaquays
+Robert A. Duffy + +

GtkRadiant note: This version of the manual is meant to be distributed with +GtkRadiant. Being for Q3Radiant 192, some parts are very outdated, specially all +the ones dealing with configuration. But the core features (curves and brush +manipulation, texturing) are still very relevant. If you are willing to help +maintaining this version more up to date get in touch with us (http://www.qeradiant.com) +

Note: Chapter 1 has been updated to follow the GTKRadiant 1.2.1. Mainly the preferences menu and some information on this page and appendix E (links and resources). + +

Introduction

+ +Part of the fun of games like Quake III Arena is the ability to add +to your own ideas to a favorite game and then have others play and +enjoy them. While the technical skills needed to create a 3D +graphic engine is beyond many game fans, the skills and equipment +necessary to make modifications to the game are not. It has become +the custom of many game developers to share their development tools +with the public. This allows fans make their own game content. The +Q3Radiant editor is the software used by the designers at id to +create the arenas in Quake III Arena. In fact, it's an +improvement on that editor, since it contains features that have +been added since the game was completed. If you are familiar with +Q3Radiant's immediate ancestor, the QeRadiant editor for +Quake 2, then a good share of what's in this manual will be +old hat to you. Whether you are a veteran mapmaker or new to the +art of making game arenas, we think you will find some +indispensible information in this manual. + +

Now comes the caveat. + +

This manual will tell you how to use the tools, but not +necessarily, how to make what you have in mind. Many fine on-line +tutorial and resource sites will be listed at the end of the +document. + +

Minimum System Requirements

+ +The designers at id used Q3Radiant on some heavy-duty computing +equipment to make their game maps. Despite the fact that Quake III +Arena runs under several different operating systems, not every +computer that can run Quake III Arena will be able to run the +Q3Radiant editor. Q3Radiant only runs under MS Windows 95, MS +Windows 98, MS Windows NT, or MS Windows 2000 operating systems. +There are currently no plans for Mac or Linux versions. The editor +requires an Open GL compliant 3D graphics acceleration card (it is +expected that all cards capable of running Quake III Arena will be +able to handle editor functions … although some may handle +it better). A 3-button mouse gives the best performance. + +

Minimum System

+ +The minimum system requirements generally require that preferences +such as texture quality and screen resolution be set to absolute +minimums. The editor will run on the systems described, but speed +of operation and visual quality will probably be less than +satisfactory. It should also be noted that you would be limited to +working on relatively small maps with limited texture and model +usage. + +

+ + + + + + + + + + + + + + + + + + + + + + + + +
Processor:P233mmx
RAM:64 meg
Video Card:4 Meg, software Open GL-compliant
Screen Resolution:1024 x 768
Pointing Device:Two-button mouse*
+ +

Recommended System

+ +The more powerful the machine, the better and usually faster the +development experience. This will become especially true when you +get to the point of compiling your maps (turning them from editor +code into game code). It should come as no surprise that, more +powerful machines will crunch the numbers faster when compiling a +map. + +

+ + + + + + + + + + + + + + + + + + + + + + + + +
Processor:P2450 (or better)
RAM:128 meg**
Video Card:Open GL accelerated video card
Screen Resolution:1280 x 1024
Pointing Device:Two-button mouse*
+ +

* This will work, but not well. A three-button mouse, even on a +minimal system is highly preferred.
+** id designers often found it convenient to work with several maps +open at once. The recommended 128 Meg of RAM may not be enough to +accommodate this. + +

What Doesn't Work (well) - and How to +fix it

+ +The key to a satisfactory editing experience is whether your video +card supports the demands of the editor. The original id editor was +designed for a workstation card called the Realizm, which ran on +Intergraph workstations in a WinNT environment. Robert Duffy +expanded this to include the Win9x operating systems and a number +of other video cards. But not all video cards support the editor +equally well. + +
    +
  • The G200 and G400 require updated drivers from Matrox
  • + +
  • The 3fx Voodoo 3000 chipset requires a driver upgrade in order +for the map grids to show.
  • + +
  • If the map grids don't appear when using some ATI chip +sets, try turning the settings on you desktop up to 32 bit (true +color).
  • + +
  • Nvidia TNT and GeFORCE have slowdown issues when the user +selects curve patches. While this is a driver issue, it can be +addressed by checking the "Solid selection boxes" +feature under preferences.
  • +
+ +

Back | Home | Next + + + diff --git a/docs/manual/Q3Rad_Manual/ch01/pg1_2.htm b/docs/manual/Q3Rad_Manual/ch01/pg1_2.htm new file mode 100644 index 00000000..95c7bb9a --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch01/pg1_2.htm @@ -0,0 +1,391 @@ + + +Q3Radiant Editor Manual: Page 1.2 + + + +

Q3Radiant Editor Manual

+
+

Installation & Set Up

+Instalation of the editor has changed in the latest build. It is much more simple then before. + +

Installing the editor

+Run the setup file you downloaded of the latest GTKradiant program. You know longer have to install GTKRadiant to the Quake3 directory. It can reside in any directory you would like to have it. + +

Setting up Paths

+During installation you will be asked where your Quake3 game is located. Browse to the folder and select Ok. Then you will be prompted for a directory name for the Quake3 game pak. Setup will create this directory in the Quake3 game directory. +

+You will then be prompted for your Return To Castle Wolfenstein folder. Repeat the same process as you did for Quake3, only this time pointing to your RTCW directory. + +

Improving Performance

+If you find that the editor is sluggish on your system, try some or all of the following tweaks: + +
    +
  • On the View menu, check Cubic Clipping to be ON. This reduces the number of game components in view, by shortening the distance that the editor can "see." Use CTRL + to set the distance to 13 (a good number in this case). +
  • On the Textures menu, open the Render Quality option and select an option higher on the list than your current setting. We recommend not going below Nearest MipMap first. This reduces the amount of blending and filtering in the textures as they are seen in the Camera window, but still lets you see what the textures look like in a relatively undistorted manner. The Nearest setting will further improve performance, but textures may be distorted when seen in perspective. +
  • On View Menu, open the Entities as… option and select an option higher on the list than your current setting. +
  • Select Preferences … from the Edit Menu. Under “Display / 3D View”, deselect (uncheck) “Update XY views during mouse drags.” This will stop the 2D-map window(s) from being repeatedly redrawn during Camera window mouse drags. +
  • Select Preferences … from the Edit Menu. Under “Display / Texturing Settings”, move the slider bar under "Texture Quality" one or more settings to the left, reducing overall texture quality. +
  • Select Preferences - from the Edit Menu. Under “Interface / Editing”, lower the number of “Patch Subdivisions” to a lower number. +
  • Further performance can be gained by turning off curves (CTRL + p) or reducing curve displays to wireframe only. +
+ +

Setting up Preferences

+To set up your editing preferences, open the Edit menu and select Preferences. Use preferences to set a variety of options and editor behavior based on your personal preferences. + + +

Globals +
+Game Settings / Select The Game +
+
+GTKRadiant now stores preferences on a per game basis. For instance: Any settings you set up for Quake3 are stored for that game mode only. Switching to Return To Castle Wolfenstein mode, will use the preferences you setup when that Game mode was set up. + +

Display +
+2D Display +

    +
  • OpenGl Display Lists - Uncheck this option if you encounter any graphic errors. This can some times cuase problems with bad opengl drivers. +
  • OpenGL Antialliased Points and Lines - This will render all points and lines in the 2D view using antialiasing. This can slow down the 2d view if your video card can not handle antialiasing very well. +
  • Solid Selection Boxes - This will make anything selected draw with solid lines rather then the old style of dashed boxes. This can slow down the 2D view as well. +
  • Display Size Info - If this is checked on, it will display the size information of any object selected. +
  • Alternate Vertex Edge Handles - This changes the shape (a little bit) of the vertex and edge points when in either vertex or edge manipulation mode. +
+ +

3D View +
Thanks to some new code. Radiants 3D View is Ultra fast. +

    +
  • Movement Velocity - This will increase or decrease the movement of forward, back, and strafing speed in the 3d view. +
  • Rotational Velocity - This will increase or decrease the turning speed in the 3D View. +
  • Freelook in Camera View - With this checked, you will be able to use free look in the 3D View. Just Right Click in the 3d view to turn on free look, and Shift + Right Click again to turn it off. +
  • Invert Mouse In Freelook - This will reverse the mouse controls in freelook mode. +
  • Discrete Movement - If checked, this cuases the view in the 3d view to move one step at a time. If unchecked the movement is smoother. +
  • Update XY Views On Camera Move - When interacting with the camera (which you will do a lot), turning this off will NOT update the camera icon location in the Map windows automatically. This can help with speed but prevents you from seeing exactly where the camera icon is positioned. +
+ +

Texture Settings +

    +
  • Texture Quality - This will increase or decrease the texture quality displayed in the texture window and 3D View. +
  • Texture Subsets - This provides a texture edit window within the texture window. It is still buggy as of build 188. It puts a text field at the top of the Texture window. Type in the first few letters of a texture name and the window will only display the textures beginning with that letter or letters. +
  • Texture Scrollbar - If checked, this will add a scroll bar to the texture window. +
  • Tex Increment Matches Grid - If checked, this will cuase Radiant to use the grid spacing when moving and aligning textures with the shift + arrow keys. +
  • Default Scale - The default scaling of textures on load up of the editor. +
  • Startup Shaders - You can choose to have certain shaders load upong startup of the editor or to not have any load on startup. +
+ +

Interface +
+Layout +

    +
  • Layout - Choose 1 of 4 layouts. +
      +
    • Split Window View - This is the QeRadiant default view. The Camera, XY Map, Z-axis Scale, Texture, and Console windows are constantly displayed. While the arrangement of the windows cannot be changed, their size is adjustable by pulling the window border splitters. The Entity and Group windows share a common pop-up window. This arrangement is one that may work particularly well for mappers using smaller monitors and slower computers.

      +
    • Floating Window View - This is the view used by id designers. The position, arrangement, and size of the windows are all adjustable. The windows initially come up on top of one another (a known bug), but once positioned, this view offers the greatest flexibility. The Camera, XY Map, Z-axis Scale, and a shared Entity/Texture/Console/Group window are all displayed simultaneously. Changing the size of one window does not automatically affect the others (it can lay atop the others). Additional map layout views can be cycled from menu commands or bound keys. This view only works well if you have a 20+-inch monitor. +

      Make it Big! In floating windows mode (ONLY), you can double-click on any window’s Title Bar to enlarge the contents of the window to fill the screen. Double clicking on it again reduces it back to normal size.

      +

    • Quad View - The display window is split into four equal-sized windows: Camera, XY Map, YZ Map, and XZ Map. This is similar to other editors and offers four-way viewing. You see the map components in three views simultaneously. The size of the windows (relative to each other) can be adjusted, by pulling the splitters. The combined Entity/Texture/Console/Group window is brought into view as a single, floating window that lays over the others. The Z-axis window is not used in this view. This is a popular editing configuration, but it has significant performance issues. The editor is drawing all the 2D map components three times (plus maintaining a camera view). Some mappers have notice significant performance slow-downs when working with curves. Using the Quad view is only recommended for mappers with more powerful computers.

      +
    • Reverse Split Window View - Essentially the same as the Split Window view, except that the windows are all flopped left to right.

      +
    +
  • Floating Z Window - This will make the Z-Window float in the Floating Window View mode. +
  • Patch Toolbar - Seems to have been disabled. +
  • Use Win32 File Load Dialog - If checked, this will use the common windows style file browser. Unchecked it will have the unique GTK / Linux X-Windows file browser. +
+ +Mouse +
    +
  • 2 Button / 3 Button - Use 2 button mode or 3 button mode. Each mode is different in some ways. The hot keys and key combinations are generally different for each mode. +
  • Right Click To Drop Entities - If checked, this will create a menu where ever you click in the 2D View with a list of the entities you can select and place. +
  • Mouse Chaser - Turning this on causes the view to chase the mouse if you drag something off the edge. +
  • Alt + Multi-Drag - If this option is checked, you must hold down the ALT key to drag multiple brush edges. This lets you resize more than one brush at a time. +
  • Wheel Mouse Inc - This number will adjust the amount the texture window scrolls in the texture window when using the mouse wheel. The higher the number, the faster it scroll basically. +
+ +Editing +
    +
  • Vertex Editing Splits Face - This will cuase face splits in brushes when in moving vertex points around and the brush becomes a concave shape. +
  • Fix Target/Targetname Collisions - This prevents duplicate target/targetnames from happening if you load a map into your current map. For instance: if you load q3dm7 into q3dm7, it adds _1 to duplicate target/targetname pairs. +
  • Cliiper Tool Uses Caulk - When using the clipper tool, the faces that are created from the clip will add a cualk texture to the brush. +
  • Dont Clamp Plane Points - This turns off clamping of plane points. This allows for very precise brush/vertex manipulation but can make it difficult to get things properly aligned and can also cause the bsp process to take a LOT longer. In general, this should be unchecked. +
  • Select Patches by Bounding Boxes - If checked, you will be able to select patches by there bounding boxes. Note: Bounding boxes for patches must be turned on. +
  • Rotation Increment - This allows you to choose the increments in pixels a texture is rotated when rotating a texture with the shift + pgup or pgdn keys. +
  • Undo Levels - Set how many undos you can do. This does require memmory so do not set it to high if you do not have alot of memmory. +
  • Patch Subdivisions - Select how many subdivisions are drawn on the patches in all views. If set to high it can slow down the editor. If set very low it will look blocky. Essentially it works like the games r_subdivisions option. +
+ +

Other +
+Startup/Autosave +

    +
  • Snapshots - If checked, this will create snapshots every 5 minutes of your level. They are saved into your maps directory and have a numbered order (eg. .001 .002) for the file extension. +
  • Load Last Project On Open - If checked, GTKRadiant will automatically load the project settings you last used. +
  • Load Last Map On Open - If checked, GTKRadiant will load the last map you had open during your last session. +
  • Auto-Save Every - Here you can choose to use auto saving, and how many minutes between each auto-save. +
+ +Paths +
    +
  • Prefab Path - Here you can choose the directory of where you will have your prefabs ( .pfb ) stored. +
  • Game Path - This is now controlled by GTKRadiant. It displays the path of your game executable for which game mode you are in. +
  • User Ini Path - This will allow you to choose a user .ini file and its path. +
+ +Misc +
    +
  • Light Drawing - This draws lights as shaded triangle things (octahedrons) instead of standard square entities. When enabled, the light entities also show their emitted light color. +
  • Log The Console To radiant.log - This will cuase GTKRadiant to create a log file of all output from the GTKRadiant console. This can cuase the editor to slow down, and is normally used for debugging purposes. +
  • Use Pak/PK3 Files - This will force GTKRadiant to read from .pak or .pk3 files before searching in the game directories like baseq3. +
+ +BSP Monitoring +
    +
  • Enable BSP Process Monitoring - This will have a ms-dos window open when you compile a map from the BSP menu. +
  • Stop Compilation On Leak - This will cuase the bsp compile process to halt when a leak is found in a map during the BSP process. +
  • Run Engine After Compile - This will cuase the game to launch after the compile process is complete. +
  • Activate Sleep Mode When Running The Engine - This is automatic now. GTKRadiant will go into sleep mode when you load the engine after a compile.

    Warning. With some video drivers, it is a bad idea to run Quake 2 or Quake III Arena and the Q3Radiant editor. The drivers just will not sustain two demanding OpenGL applications simultaneously. This feature is best left turned off. + +

+ + + +

The Project File

+The project file contains the paths for the various GTKRadiant file-processing functions. Using the installer to set up the editor should write these for you. + +

New Project +

+
This creates a new folder (which you must name) in your Quake III Arena or RTCW directory. +
This is a good function for mods. You can use a different directory other then baseq3 if you plan to have alot of new resources and dont want to clutter it into the baseq3 folder. + +

Load Project +

+
This opens up a browse directory pointed at the scripts directory. It is looking for a text file with a .qe4 file extension. + +

Changing the Project File +

+
You can edit the project file by changing the pathnames to various functions in field of the dialogue window that pops up. HOWEVER, before doing this, you should make a backup copy of your Quake project file and give it a new name. Make your changes to this new file. If you mess things up, you can always reload the original. This is a good thing to do if you are making maps for a mod that uses a separate set of definitions for entities or directories for textures and want to easily change between types of projects. + +

Project Settings +

    Basepath: This traces a path, beginning in your root directory to the baseq3 where the editor expects to find resources. +

    Mapspath: This traces a path, beginning in your root directory, to the location where maps are saved and from which they are loaded. The default is the maps directory. + + + +

    Rshcmd: This means "remote shell command." Use it only if you are directing a remote processing device (not your editing computer) to compile maps. The syntax for the field is: "rsh [processor name]" + + + +

    Remotebasepath: If you are running your compile from your editing computer, this should be the same as your basepath. If you are working off a remote compling device, this should trace the full path to the to the baseq3 folder where the compiler will find the resources it requires. + + + +

    Entitypath: This traces a path to the definition file for your game entities. This can either be a .c file which contains the game code, or a .def file which contains more instructive information about the entities. +

    Note: As of GTKRadiant 1.2.1 the default path for this is "Radiant", also known as the new game packs style it uses which allows for the remote installation of GTKRadiant anywhere on your computer. + + +

    Texturepath: This traces a path, beginning in your root directory, to the location from which textures are loaded. The default is the textures directory. +

+ + +

Menu commands +
These commands are your map compile commands. You can CHANGE these commands or ADD your own. Each new command must start with “bsp_” The following is the compile command string for “bsp_Fullvis” taken off one of our project files. + +

    ! q3map $ && ! q3map -vis -threads 8 $ && ! q3map -light -threads 8 $
+ +

Command parameters: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
!The exclamation mark is replaced by the contents of the rshcmd field. It is the path to the processor.
$The dollar sign is replaced by the Mapspath.
&&The double ampersand is the command terminator (end of command)
q3mapThis is the process command. Without a switch after it, it performs the .bsp compile phase.
-visThis is a switch to select the vis compile phase.
-lightThis is a switch to select the lighting compile phase.
-threadsThis is a switch to break the compile up into a number of different processor threads. The number of processors follows the switch parameter.
+ + +

Other parameters +

+ + + + + + + + + + + + + + + + + + + + +
-onlyentsProcess only the entities in the map.
-fastA quicker process. However, it treats the map as if it were all one vis area.
-extraAs in -light -extra. This is a second lighting pass that more finely subdivides the map into areas of light and shadow.
-nowaterCompiled without liquids in the map. Used in the first compile phase only.
-nocurvesCompiles without curves in the map. Used in the first compile phase only.
+ + +

Misc settings +
Use brush primitives in MAP files. +
Once this is set for a map, the program converts the texture mapping to this format. Once chosen, there is no going back to the old format. Brush primitives are described in detail under the Working with Textures section. + +

Setting up the Windows

+There are six configurable windows in Q3Radiant. + +

The Camera Window (CAM) +
The Camera window initially shows a gray field. This is where the 3D in-progress view of your map appears. You can SHIFT + click mouse button 1 to select objects in this window. If the images in this window appear overly dark, you can adjust the gamma value. Open the Misc menu and select Gamma. Enter a value between 0 and 1 for the light value. Close the program. Reopen the program. Check the darkness. Repeat this until you have a value you like. + +

Entity/Texture/Console/Group Window +
Depending on the Windows layout view that you’ve chosen, one or more of the following sub-windows share this window. They are selectable by the tab at the bottom of the window, or by shortcut keys. + +

Entity Window +

+The Entity window is one of four windows that share the same window space: Console, Entity and Texture and Group. The entity window is used to create and modify the properties of game entities. The uppermost box in this window contains the entity names. Use the scroll bar to find the one you want or for speed, type in the first letter of the class of entity you desire (“w” for weapon, “I” for item and so on). Refer to the Working with Entities section for more details on this. + +

Texture Window +

+The Texture window displays textures that have been loaded from the texture directories for easy use. The texture subset tool (set in preferences) allows you to quickly jump to a texture if you know the first few letters of its name. The scrollbar tool adds normal Windows functionality to the window. The most common method of navigating the window is to right-mouse click and drag through the window contents. SHIFT + right-mouse click and drag speeds up the rate of movement through the window’s contents. A thin green outline around a texture indicates a non-shadered texture in use in the map. A thin white outline indicates a shadered texture. A bold red outline indicates a selected texture. + +

Console Window +

+The console tracks the editor’s processes, like loading, saving, and compiling. When you compile (selecting an option from the bsp menu), the contents of the console are dumped into the junk.txt file in your Temp file folder on your root drive. In the Split Window view layout, the Console window is always in view. + +

Groups Window +

+This window will deal with the future grouping functions that will soon be a part of the editor. At this time, it is only a non-functioning window. + +

Z-axis Scale Window +
This window is used by three of the four views to show the Z-axis position (height) of the Point of View and any selected map components. + +

Map Window(s) +

The Grid +
Think of the Map window as a piece of graph paper, neatly divided into squares. However, unlike graph paper, you can change the size of the grid to fit your needs of the moment. You can change grid size from the Grid menu, but it’s faster to learn the key shortcuts listed below. + +

Setting Grid Size + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Grid sizeKey
1 unit grid(1)
2 unit grid(2)
4 unit grid(3)
8 unit grid(4)
16 unit grid(5)
32 unit grid(6)
64 unit grid(7)
Grid DownDecreases the size of the grid. [ key
Grid UpIncreases the size of the grid. ] key
+ + +

Grid and Window Layouts +
There are four distinct ways of laying out the work windows for Q3Radiant. + +

Design Notes: +
Try not to build architecture with a grid smaller than 8 units. +
Use a smaller grid if you need to build small details. +
Use a large grid (32 or 64) for roughing in a level. +
Use a large grid for moving large chunks of architecture around.
+ +

Snap to Grid +
When this is checked, the edges and vertices of brushes and patches will “snap” to grid coordinates. Unless you are attempting some very fussy maneuvering of a map component, Snap to Grid makes life much easier. In fact, if you are building objects out of curve patches, it is crucial that you be able to line up patch control points with the vertices of surrounding solid geometry brushes. + +

Colors +
Q3Radiant allows you to select the colors of your grids and tools. Because the manual refers to the colors of some features, you may wish to wait until you are more comfortable using the editor before changing too many things. You can always revert to the Q3Radiant defaults, should you choose change too much. + +

To change Map window and Texture window colors, select the “Misc” menu and choose colors. The pop-up lists a number of options. + +

Themes +
Brings up three options: + +

    QE4 Original: The settings for id’s original Quake 2 editor +
    Q3Radiant Original: The default setting. +
    Black & Green: a black background with a green grid major. +
+ +

Each of the following options opens the Windows color selector. + +

Grid Background… +
The background color for the map window. + +

Texture Background… +
The background color behind the textures in the texture window. This is probably best left a neutral color. + +

Grid Major… +
These bolder grid lines mark 64 unit increments in the map window. These never change. + +

Grid Minor… +
The finer grid lines in the map window. + +

Grid Text… +
The color of the scale numbers along the left and top of the map window. + +

Grid Blocks… +
These lines mark the 1024 x 1024 unit grids on the map. + +

Default Brush… +
This is the color of unselected brushes in the map. + +

Selected Brush… +
The color of selected brushes in the map. + +

Active View Name… +
This is the text that says “XY Top” or “YZ Side” or “XZ Front” in the map view window(s). + + + +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch02/pg2_1.htm b/docs/manual/Q3Rad_Manual/ch02/pg2_1.htm new file mode 100644 index 00000000..758469fd --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch02/pg2_1.htm @@ -0,0 +1,213 @@ + + +Q3Radiant Editor Manual: Page 2.1 + + + +

Q3Radiant Editor Manual

+
+

Entities and Assets

+

What are Entities?

+Quake III Arena divides map components into two classes: World Geometry and Entities. World Geometry represents the brushes (the Q3A term for the blocks of geometry used to build the physical game world) and patches (anything built with calculated curves). Entities are a broad category that not only includes simplistic editor representations of game play objects like weapons and ammo, but also includes diverse things like player start spots, and lights. Typically, they are displayed as brightly colored cubes (for those entities not constructed of brushes). The following are the general category of entity types. The actual entities and the rules and tips for their use are listed in Appendix B. + +

Brush entities. The “brush” is the basic building block of Quake engine games (including Quake, Quake 2, Quake III Arena, and a host of games using the engine licenses). In its most basic form, it’s a block, a solid rectangular volume defined by the coordinates of its corner vertices. A single brush or a linked grouping of brushes can be turned into a brush entity. Brush entities include the movers (see below), triggers, and func_statics. + +

Movers. Most moving objects or "Movers" are built from brushes. These include doors, lifts or “plats”, rotating objects, buttons, pendulums and trains (objects following pre-defined paths), and bobbers (platforms that are constantly in motion, up and down or side to side). + +

Triggers. Triggers are brush entities that cause an event to occur when a player’s bounding box moves inside the volume of the trigger. Triggers can be targeted on many other entities, including most movers and targets. Some triggers also have more specialized functions. There are triggers that cause injury, activate other entities, and push or teleport the players. + +

Targets. Targets are the entities that are activated to cause events to happen in Q3A, or to redirect activations, insert time delays, mark locations for team play, or act as destination points for teleportation or pushing. + +

Lights. These are point lights, disembodied (read as no visible source) sources of illumination. They ca n be targeted at info_nulls to create spotlights. They can be turned into colored lights. Usually, they are used to create unfocused fill light in a large area or placed near glowing surface textures to create an effect. + +

Info. This category includes non-team player spawn spots, targets for lights, and camera locators for intermission shots. + +

Items. With the exception of ammo and weapons, these are things in the map that the players grab to use during play. Included are armor, power ups like the quad, and one-use items like the personal teleporter. + +

Ammo. Locations for ammo boxes. Each weapon type in Q3A has its own unique ammo entity. + +

Weapons. Each of the weapons that can be picked up has an entity that can be placed. + +

Miscellaneous. This is another catchall category. It includes things like the misc_model which links into the models directory when placed, func_timers which are automated repeating triggers, shooters which fire one of three different weapon fire types, camera and portal surfaces, and path corners. + +

What are Assets?

+Assets are the textures, sounds, and models that are used to flesh out the appearance and ambience of a game map. The editor is designed to use the assets stored in the pak0.pk3 file in your quake3 directory. Using Q3Radiant, the mapmaker can work with the assets in the Quake III Arena pak0.pk3 file or create new ones. + +

What are Textures? +
The art appearing on the walls of maps are generally referred to as “textures.” Textures are created and stored as true color targa (.tga) or jpeg (.jpg) graphic files. The textures do not use a pre-defined color palette (as was the case with both Quake and Quake 2). Shader scripts can further combine textures and/or modify them in numerous ways. This document will briefly touch on shaders. For an in-depth treatment of shaders, refer to the accompanying Shader Manual. + +

What are Sounds? +
Quake III Arena world sounds are played by target_speaker entities in the maps. They are stored as 22 khz, 16-bit, mono format .wav files. + +

What are Models? +
The statues and lights in Q3A are models, just like the player characters. They are placed with the misc_model entity. + +

Creating New Assets

+If you are familiar with the required tools, creating new assets for use in Quake III Arena is not particularly difficult. As a rule, you should create new directories for each map with names different from the names used by id. If you are making a map that will be called “H4x0r_D00M”, every directory containing new assets for that map should be titled H4x0r_D00M. This is to try and avoid asset directories overwriting each other as the editor and the game load in assets. + +

Creating Textures +
Any combination of graphic programs and plug-ins that can output a 24 bit MS windows compatible Targa (.tga) or JPEG (.jpg) graphic file. If you plan to make textures that will have an alpha channel component (see glossary for definition), you must have a program that can create 32-bit art with that fourth channel. + +

Adobe PhotoShop has the ability to easily create alpha channels. Paint Shop Pro from JASC (v5.0+) can also make an alpha channel by creating a mask and naming it “alpha”. + +

Generally speaking, regardless of the program used, we found it best to do most of the art manipulation of the alpha channel in a separate layer or file and then paste it into the alpha channel before saving. + +

Setting up Files +
The editor and the game program look for assets to be located along the paths set up in your project file. Start by creating a directory for you new textures by creating file folders to make a directory path as follows: quake3\baseq3\textures\[mymapname] + +

The installation of Q3Radiant will create a text document called “shaderlist.txt” in the following path: + +

    Quake3\baseq3\scripts\shaderlist.txt
+ +

Q3Radiant will use the contents of this script to grab your new textures for inclusion in the game. The contents of shaderlist.txt document will contain a listing of all the shader documents that were used by id Software to create Quake III Arena. + +

Since you will obviously want to create your own shaders, you need to put them in separate folders and create a new shader script for them. + +

If you plan to work on several maps at once and want to distinguish between textures used in each map, simply add additional map names here. For map and mod makers, we STRONGLY recommend that any new shader scripts created use the name of the map or mod in the shader file name. We know we can’t avoid every incident of files overwriting each other, but we certainly can advise you how to try. + +

Now, create another text file within the scripts directory and call it: + +

    [mymapname].shader
+ + + +

This file will contain the shader scripts you write to modify a particular texture. + + + +

Rules +
Follow these rules when creating textures for the Quake III Arena engine: +

    +
  • Save your textures into your new [map name] directories. +
  • Don’t use the same names that id used for textures. It will cause problems. +
  • For best quality, save textures without an alpha channel as 24 bit TARGA files. Using JPEG files can save memory space, but at the risk of losing detail and depth in the texture. JPEG files cannot be used for textures requiring an alpha channel. +
  • Textures containing an alpha channel must be saved as 32 bit TARGA files. +
  • If a new texture requires no further manipulation, it does not need a shader script. +
  • Size textures in powers of 2. Example: 8x8, 16x16, 32x32, 64x64 pixels and so on. +
  • Textures don’t need to be square. A 32x256-pixel texture is perfectly acceptable. +
+ +

Guidelines +
The following are some things the id designers learned about textures. +

    +
  • Create textures in “suites” built around one or two large textures with a number of much smaller supporting detail or accent textures. +
  • Very large textures are possible, but some video cards compress textures larger than 256x256 pixels. +
  • Textures are grouped alphabetically by name in the texture display window, so you may want to give suites of textures similar names. +
  • Use the shader function qe3_editorimage to conserve memory when making multiple versions of a single texture (as in the case of a glowing texture with several light values). +
  • Unless you are creating special effects or textures designed to draw the player’s eye to a specific spot, muted, middle value colors work best with the game engine. +
  • Extremely busy (a lot of fussy detail) textures can break up or form visually unpleasant patterns when seen at distances. +
+ +

Creating Sounds +
Tools needed: Any sound editing program that can create and save out sound files as 22 khz, 16-bit, mono format .wav files. + +

Set up: The editor and the game program look for assets to be located along the paths set up in your project file. Start by creating a directory for you new textures by creating file folders to make a directory path as follows: quake3\baseq3\sounds\world\[map name] + +

Place your completed .wav files in the [map name] folder. You can access (and play) this file from within the editor (see instructions for Target_Speaker). + +

Creating Models +
Map models need to be converted from their native file format into Quake III Arena’s native md3 file format. The modeling program, Milkshape 3D supports the file format needed to create map models for Quake III Arena (a link for this program is in the On-line Resources appendix). The compiling process merges the models into the bsp file. If you want other mappers to be able to use your models, you will need to include the md3 and supporting texture files within your pk3. + +

Making the .pk3 File

+When you go to distribute your creation to the gaming world, you need to put your newly created map, textures, bot area files, and shader documents into an archive format called a “pk3” file. You do not need to include the shaderlist.txt file, since only the Q3Radiant editor uses that. Start by creating folders/directories in your root drive (C: for most of us). The game assumes that these folders are placed in the baseq3 directory, so you need to write your path names accordingly. You will need to keep the paths to the various assets the same as they are for the rest of the assets in the game. So your paths should be something like this: + +
    Textures: textures/[mymapnamefolder] + +
    New Models: models/mapobjects/[mymodelnamefolder] + +
    Map, bsp & aas: maps/mymapname.bsp , mymapname.aas + +
    Shader scripts: scripts/mymapname.shader + +
    Server scripts: scripts/mymapname.arena +
+ + +

Move or copy all your new game assets in their folders. + + + +

We used an archiving program call Winzip to make the pk3 file. Get Winzip from WinZip.com + +

NOTE: Do not include or redistribute any game assets that are not your own (at least without permission). This specifically refers to id-copyrighted material that came with the original game or subsequent id released patches. + +

Make a zip archive called “map-mymapname.zip” + + + +

If you plan on distributing other resources separately, we strongly recommend the following naming conventions: + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
md3-xxx.pk3User Model with original associated skin files and sound files
bot-xxx.pk3User bot files. May contain additional model or skin and texture files
skin-xxx.pk3User skin with associated skin and texture files
map-xxx.pk3User created map(s) and supporting files (arena, texture, sound, music)
tex-xxx.pk3User texture and shader files
snd-xxx.pk3Sounds only
mus-xxx.pk3Music only
pfb-xxx.pk3Map prefabs
+ + +

(special thanks to Rogue13 of http://www.polycount.com for this naming convention) + + + +

When you go to add a resource to the archive, click on options to “Recurse Folders” and “Save Extra Folder Info” + + + +

Zip all the required assets into a zip archive file (Quake III Arena DOES support compressed pk3 files). + + + +

Rename the zip archive to mymapname.pk3 + + + +

Put it where the Quake III Arena community can find it. + + + +

My .pk3 File is Huge! No One is downloading it! +
Large pak files are daunting as downloads. And as specified by the Quake III Arena End User License Agreement, that is the only way those new game assets may be distributed. Be kind and remember that not everyone has access to DSL, ADSL, ISDN, Satellite, Cable Modem or other high speed internet connections. Before packing up your resources, you may want to look into some dieting tricks to make it smaller. + + + +

    +
  • First, resave all your new non-alpha channel textures in JPG format. That will give you some significant art size savings. +
  • Streamline your map’s art package. Id designers had to go on a rip ‘n strip rampage through their levels to cut down on unique texture usage. Do you really need all that additional art? Can you substitute more of the original Q3A art, or get more duty out of some of your new work? +
  • Recompile your area files with the optomize switch. That will reduce their size. That's why it's in there as a command. This is also one of the biggest savings that you can make. +
  • Turn up the level of compression when archiving into the pk3 file. +
  • Compress again when zipping up the files. +
  • Take a SERIOUS look at any new sound resources you've created. Sounds, especially long sounds can be HUGE! Can short sounds be cleverly used to replace longer sounds in your map? The id designers did a bunch of that for Q3A. Very short sounds, played off sync against each other were made to sound like longer, more expensive sound files. +
+ +

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/ch03/pg3_1.htm b/docs/manual/Q3Rad_Manual/ch03/pg3_1.htm new file mode 100644 index 00000000..91bbb4c5 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch03/pg3_1.htm @@ -0,0 +1,265 @@ + + +Q3Radiant Editor Manual: Page 3.1 + + + +

Q3Radiant Editor Manual

+
+

Map Building Basics

+Once you have the editor installed and the preferences set, open the map and let’s get started. + +

Moving Around

+There are a number of ways to move your point of view around in the map and camera windows. Some are easy to master. Others are a bit trickier. Find one that works for you and master it. + + +

Moving in All Directions +
All movement directions are given relative to directions in the XY map. When other map views are shown, movement is still calculated in terms of the XY view. Key press movement occurs in discrete increments. + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Forward (in facing direction)(Up Arrow Key) or (Keypad 8)
Turn left(Left Arrow Key) or (Keypad 4)
Turn right(Right Arrow Key) or (Keypad 6)
Backward(Down Arrow Key) or (Keypad 2)
Move up(D)
Move down(C)
Look up(A)
Look down(Z)
Level View(END)
+ +

Flying … through the Map (and other 3D commands) +
Some mappers prefer using mouse-fly to move around their map. Mousefly works by clicking and pressing with the Mouse button 2 (Right mouse button) on the Camera window. This takes a lot of practice to master. Clicking farther away from the window center increases the speed of movement. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Forward (in facing direction)(Right Mouse click above of window center)
Turn left(Right Mouse click left of window center)
Turn right(Right Mouse click right window center)
Backward(Right Mouse click below window center)
Move up(D)
Move down(C)
Look up(A)
Look down(Z)
Level View(END)
+ +

Zoom with a View +
The zoom keys increase or decrease the visual scale of the map, letting you move in close to work with small details or move away to see the entire map at once. Currently, there are 24 steps of zoom, from most distant to closest. If Quad view is used (XY, YZ, and XZ views simultaneously), all three windows may zoomed at different scales. The Z-axis scale window is also zoomed separately + + + +

Zoom in +
(DELETE) + + + +

Zoom out +
(INSERT) + + + +

Z-axis Zoom in +
(CTRL + DELETE) + + + +

Z-axis Zoom out +
(CTRL + INSERT) + + + +

Jump to Location +
(CTRL + Middle Mouse Button) + +
Click on a 2D map or the Z-axis window and your point of view immediately moves to that location. In the 2D map windows, neither the facing, nor the “height” of the point of view changes. + + + +

Moving the Maps Around +
A right-mouse-button click and drag on a 2D Map window will cause the map to be dragged, allowing you to easily reposition what is being viewed. + + + +

Basic Construction Tutorial

+ + +This is a simple, step-by-step guide to making your first room. Before attempting it, you may want to familiarize yourself with some of the Brush selecting and handling tools. A Quake III Arena aficionado who goes by the handle “The Dog!” posted this simple tutorial on a Quake III Arena on-line message board. It appears here with his permission. It will walk you through creating a new map file, making your first “brush,” adding a start spot and a light and then compiling the map. + +

The Dog!’s Ten Quick-n-Dirty steps to a SIMPLE room: + + +

  1. Create new map: + + +
    1. Click file, new map
    + + + +

  2. Create a small hollow room (make a box and hollow it out): + + +
    1. Make a box. In the XY Top window, click/hold your left mouse button at coordinates 256,-256 (upper left) - then drag your mouse to the -256,256 (lower right) [you should see a red square appear in grid]. + + + +

    2. Make the box taller. In the Z Window (this is also called the height bar): This brush appears as a red box. Click/hold your left mouse button above the upper edge of the box and drag that bar up to about 256. [you have just raised the height of the box] + + + +

    3. Make it hollow. On your Toolbar below the Menu bar, locate the 'Make Hollow' Button (should be a red box with a dotted box inside of it )located under the M in Misc). Press that button. This breaks the box up into six pieces: four walls, a ceiling and a floor. [you should now see a hollow room in the texture view window] +
    + + +

  3. Press Escape to deselect the box (you are finished with room/box for now). + + + +

  4. Add a player starting point: + + + +
    1. Bring up the Easy Entity Menu. With your pointer over the room in the XY Top window, right mouse click INSIDE the newly created room box to open up the easy entity menu. + + + +

    2. Place a Start Spot. Select info, then select info_player_deathmatch. [you should see a small pink box appear - this is where you will start in this map anytime its loaded] + + + +

    3. Is it in there? Make sure that your new starting point is 'really inside' the room that you have created. + + + +
      1. Click the xyz button on your toolbar so that you can toggle through each 'view' of that coordinate (XY top, XZ front, or YZ side). + + + +

      2. Watch the red box (info_player_deathmatch) as you toggle through each view to make sure the red box is inside room + + + +

      3. If there is a view it is not located inside - simply stop and drag it inside the box. (You can learn how to put it in optimal places later), until it is totally inside the room. +
      +
    + +

  5. Press Escape to deselect the info_player_deathmatch item. + +
    The box now turns into a solid pink, box outline. + + + +

  6. Now add some textures: + + + +
    1. Load up Textures. Click on the texture menu and drag down to select the gothic_wall texture directory. + +
    2. Open Texture window. Press “T” to open the texture window. It should be full of wall textures. + +
    3. That wall will do just fine. Then decide what wall surface you want to apply the texture to. Hold the left-CTRL and the left-SHIFT key down and then left click on a wall. The wall will turn red. + +
    4. Pick a Texture, any Texture. in the 'texture view' window, left mouse click on any wall texture. A red border will now surround this texture. And presto, the wall becomes that texture too. + +
    5. Repeat this step for all the walls that you want to apply textures to. +
    + + + +

  7. Save your map. +
    The editor doesn’t like to work with “unnamed” map files. From the menu, select File > Save. Name the map “test1”. Always use lower case for your map names. + + + +

  8. Add a light. + +
    1. Bring up the Easy Entity Menu Again. With your pointer over the room in the XY Top window, right-mouse-click INSIDE the newly created room box to open up the easy entity menu. + + + +
    2. Place a Light. Select info, and then select light. [You should see a small red box appear (smaller than the player start).] + +
    3. Move it into place. Do the same procedure you did for the player start spot, making sure that this light is inside the room. + +
    4. Deselect the light. It will become a green box. +
    + + + +

  9. Compile it. +
    In the BSP menu, select “bsp_fastvis”. Wait patiently for the program to finish three phases of compile: bsp, vis, light. + + + +

  10. Start ‘er up. +
    Start your Quake III Arena game. When the menu appears, hit the tilda key (~). On most American keyboards, this is in the upper left corner of the keyboard, below ESC. + +
      +
    1. Set your game to run the map. In the console, type "/sv_pure 0" +
    2. Enter the Devmap. In the console, type “\devmap test1” and then ENTER. +
    3. Play it for all it’s worth. The map should start and you will be standing in the center of your first room. +
    +
+ + + +

Now go make something more complicated on your own! + +

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch04/pg4_1.htm b/docs/manual/Q3Rad_Manual/ch04/pg4_1.htm new file mode 100644 index 00000000..94575ba3 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch04/pg4_1.htm @@ -0,0 +1,174 @@ + + +Q3Radiant Editor Manual: Page 4.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 1: Selecting and deselecting

+The most basic interaction with the editor is selecting and deselecting the map components. Everything else builds off from these commands. + + + +

The Component Handling Tools

+
Escape (ESC)
+This is the all-purpose deselect key. Use it to back out of operations you don’t want to complete or to stop working on a map component or group of components. + + + +

Select single component
+ + +In the XY Window (or XZ or YZ), this selects a single map component that is “closest” to the top of all components beneath the pointer. The following is an exception: If an entity is directly beneath the pointer, it will be chosen in preference to a non-entity, even if the non-entity is “between” it and the pointer. + + + +

Select single face on brush
+ + +This selects a single face on one brush, not the brush itself. + + + +

Select multiple faces on one or more brushes
+ +Use this to select several brush faces on one or more brushes. + +

Cycle through stacked components
+ +Beginning with the component that has the greatest Z value, the user can cycle through vertically stacked components that are directly beneath the mouse pointer. + + + +

Deselect single component
+ +In the XY Window (or XZ or YZ), SHIFT clicking on a selected component deselects it. The following is an exception: If a selected entity is directly beneath the pointer, it will be chosen and deselected in preference to a non-entity, even if the non-entity is “between” it and the pointer. + + +

Deselect all selected components
+ + +All selected components are deselected. + + + +

Group Component Selections

+There are four commands for selecting large groups of components. These involve creating a brush that encloses or touches numerous other components. In most cases, the brush used to create the grouping is deleted by the operation. These operations can be selected by menu commands or by buttons on the toolbar. The toolbar buttons are in the third grouping (as counted from the left). The command buttons on the toolbar are given as they relate to the Selection sub-grouping on the toolbar. + + + +

Design Note: These grouping commands are particularly useful when you want to region off a small area of the map.
+ +

Select Complete Tall
+ +All brushes from the top to the bottom of the map that are totally enclosed within the XY dimensions of the grouping brush will be selected. The grouping brush is discarded. + + + +

WARNING: Undo will restore selected components but will delete the selection brush. + + + +

Select Touching
+ +All brushes that are in contact with the grouping brush will be selected. The grouping brush is NOT discarded. + + + +

Design Tip: Need to work an area around a particular brush? Use this tool to select the brush and then use the selected brushes to create a regioned area.
+ + + +

Select Partial Tall
+ +All brushes from the top to the bottom of the map that are touched by the XY dimensions of the grouping brush will be selected. The grouping brush is discarded. + + + +

Select Inside
+ +All brushes from the top to the bottom of the map that are totally enclosed by the XY and Z dimensions of the grouping brush will be selected. The grouping brush is discarded. + +

Copying, Pasting, Cloning, Deleting and Prefabs

+
Save Selected
+(Menu: File) +
The selected brushes are saved as a map file. Not a true prefab, but a way to duplicate pieces of a map for later insertion. + +

Copy brush
+(Menu: Edit) +
(CTRL+C) +
This function copies all hi-lighted brushes, patches, and entities onto clipboard. Contents of clipboard may be pasted into the current open map file or into another open map file. + +

Paste brush
+(Menu: Edit) +
(CTRL+V) +
The map information previously copied into the clipboard is pasted at the same XYZ coordinates as the original. UNDO will delete the paste + +

Clone
+(Menu: Selection > Clone) +
(Shortcut: SPACE) +
Selected map components are immediately duplicated. The clone appears +1x and -1y units (current map grid) away from the original (down and to the right). The clone remains hi-lighted until deselected. + +

Save Selection as Prefab
+(Menu: EditèSave Selection as Prefab) +
(Shortcut: none) +
The user is prompted to save the selected map components as a prefab file (*.pfb) in the directory set by Preferences. + + +

Load Prefab
+(Menu: EditèLoad Prefab) +
(Shortcut: none) +
Opens a file selection window into the directory set in Preferences. Select from that directory or browse for another. The selected prefab is pasted into the map at the same XYZ coordinates as the original. + +

Delete
+(Menu: Selection > Delete) +
(Shortcut: BACKSPACE) +
All selected map components are removed from the map. + +

Undo
+(Menu: Edit > Undo) +
(Shortcut: none) +
Undo will undo recent command actions affecting brush geometry, curve patches, and in-map comands that affect entities (move, rotate, delete, etc.). Undo has no effect on texture operations. + +

The number of levels or layers of Undo can be set in Preferences. The maximum number is 64. Unless your computer memory is extremely low, there is no real reason to use less than all 64 levels of Undo. + +

Working with Regions

+Regions are an important tool to learn and use early on. Whether you isolate off a single brush, or half a map, you’ll wonder how you ever got along without this tool in other editing programs. The selections on the Region Menu allow the mapper to isolate, and work on, a subset of the map. There are innumerable benefits to working in a “regioned” area of the map. However, the following are the most important: +
    +
  • It allows you to work with a few map components at a time, without the distraction of the rest of the map pieces. +
  • When you want to perform CSG operations, regioning lets you isolate the pieces from the rest of the map, reducing risk of making unwanted cuts or splits. +
  • Map regions can be compiled without having to compile the rest of the map. This can be an incredible timesaver. Instead of spending hours to compile an entire map just to check for leaks in new construction, or check the appearance of a room, or test a lighting effect, minutes can be spent processing just the room itself. +
+ +

There are several ways to select a region, by a group selection, by XY map window dimensions (or the corresponding view in YZ and XZ), or by a few selected map components. + +

The commands for selecting regioned areas are found under the Region Menu heading. + +

Region Menu
+Off + +This returns you back to the full map. Brushes that were selected while in the regioned mode remain selected until ESC is pressed to unselect them. + +

Set XY +

+Any map components that are inside, or that are touched by the bounds of the XY Map window are converted into a region. The size or shape of the window does not matter. Nor does the degree of Zoom matter. This is an excellent way to select are larger subset of your map, such as a complex room or group of rooms. Any brushes selected before regioning the map remain selected. + +

Set Tall Brush +

+This functions in a similar manner to the group selection command, Select Partial Tall. Any map components contained within the XY bounds, or touching the XY bounds of the brush will be regioned off. The selecting brush itself is discarded. + +

Set Brush +

+This functions in a similar manner to the group selection command, Select Touching. Any map components contained within the XYZ bounds of the brush, or touching the XYZ bounds of the brush will be regioned off. The selecting brush itself is discarded. + +

Set Selected Brushes +

+If you need to work with just a few brushes, this is the option to choose. Hi-light the brushes to be worked upon then select this option. Only those brushes are moved to the region. The selected brushes are unselected when the region is created. + +

Compiling Notes: Sometimes, when compiling a regioned area, md3 map object models near the edge of the region can cause a “false leak” situation to occur. This can usually be corrected by adjusting the region size to include more of the map near the md3 map object model. + +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch05/pg5_1.htm b/docs/manual/Q3Rad_Manual/ch05/pg5_1.htm new file mode 100644 index 00000000..ec02e30a --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch05/pg5_1.htm @@ -0,0 +1,784 @@ + + +Q3Radiant Editor Manual: Page 5.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 2: Working with Brushes

+ +

The geometry brushes are the basic building block of the Quake +III Arena engine. These are the tools to make them work for +you. + +

Geometry Brush Handling Tools

+
Escape (ESC)
+This is the all-purpose deselect key. Use it to back out of +operations you don't want to complete or to stop working on a brush +or group of brushes. + +

Create New Brush
+ + + +While mouse1 clicking over the main map window (or any open map +window) drag the mouse pointer across the grid. A brush will be +created that has the height of the current map grid size. If you +have the "snap to grid" function set in your preferences, the brush +will start and stop on gridlines. The texture will be either the +default texture (if none has been selected) or the most recently +used texture. For all these functions, you will first need to +select a brush in either the Map or Camera windows. + +

Move Geometry Brush
+ + + +The Undo command will return the brush to its original size (if +the brush is still selected). If the brush has been deselected, the +resized version will remain and another brush will be created at +full size. + +
    In the Map Window. In the map window, select the +brush. Click on the selected brush. With the mouse 1 button +depressed move the brush around the map to the position you +desire. + +
    In the Z (height) Window. In the map window, select the +brush. Next, click on the selected brush in the Z window. With the +mouse 1 button depressed move the brush around the map to the +position you desire. + +
    In the Camera Window. Select a brush in the camera +window (see select single component above). +Mouse button 1 click on the brush and drag it in the desired +direction. You may need to adjust your camera view to make dragging +easier.
+ +

Stretching the Brush
+ + + +Think of this as stretching the brush. The Undo command will +return the brush to its original size (if the brush is still +selected). If the brush has been deselected, the resized version +will remain and another brush will be created at full size. + +
    In the Map Window. In the map window, click next to the +selected brush on the side you want to pull. With the mouse 1 +button depressed pull in a direction away from the nearest edge. +The brush will grow larger in that direction. + +
    In the Z (height) Window. Use this to make the +brush taller. In the Map or Camera window, select the brush. +Next, click above or below the selected brush in the Z window. With +the mouse 1 button depressed pull away from the select brush. The +brush will grow in that direction. + +
    In the Camera Window. Select a brush in the camera +window (see select single component above). +Mouse1 click near the edge of the selected brush. With the mouse 1 +button depressed pull in a direction away from the nearest edge. +The brush will grow larger in that direction. You may need to +adjust your camera view to make dragging easier.
+ +

Shrinking the Brush
+ +Think of this as crunching the brush smaller. + +
    In the Map Window: In the map window, select the +brush. Click next to the selected brush on the side you want +to pull. With the mouse 1 button depressed pull in a direction +toward the nearest edge. The brush will shrink in that +direction. + +
    In the Z (height) Window: Use this to make the brush +shorter. In the Map or Camera window, select the brush. Next, +click above or below the selected brush in the Z window. With the +mouse button 1 depressed, push towards the select brush. The brush +will shrink in that direction. + +
    In the Camera Window: Select a brush in the camera window +(see select single component above). Mouse1 +click near the edge of the selected brush. With the mouse 1 button +depressed push in a direction towards the nearest edge. The brush +will grow larger in that direction. You may need to adjust your +camera view to make dragging easier.
+ +

Flip Brush
+ + + +There are three separate actions here. They flip a brush +along either X, Y, or Z-axes. A menu command and toolbar button +controls each. The six flip and rotate toolbar commands are the +second grouping (from the left) on the toolbar. The rotate +command for the same axis is always next to the flip command. +Flipping will not change the facing on non-model entities. + +
    Flip X (Menu: Selection) (Toolbar: Leftmost button) + +
    + +Flips brush along x-axis. + +
    + +Flip Y (Menu: Selection) (Toolbar: left of center +button) + +
    + +Flips brush along y-axis. + +
    Flip Z (Menu: Selection) (Toolbar: second button from the +right) + +
    + +Flips brush along z-axis.
+ +

Rotate Brush
+ + +There are three separate actions here. They rotate a brush +in 90 degree increments around a brush's X, Y, or Z axes. Both a +menu command and toolbar button controls each action. The six flip +and rotate toolbar commands are the second grouping (from the left) +on the toolbar. The flip command for the same axis is always next +to the rotate command for the same axis. The rotation will not +change the facing on non-model entities. + +
    + +Rotate X + + +Rotates brush around the x-axis. + +
    + +Rotate Y + + + +Rotates brush around the y-axis. + +
    Rotate Z + + +Rotates brush around the Z-axis.
+ +

Arbitrary Rotation
+ +The Rotate commands accessed from the toolbar all rotate +affected map components 90 degrees; no more, no less. Arbitrary +Rotation allows the user to set angles individually for the X, Y, +and/or Z-axes. Enter a number value for each axis you want to +rotate. Value can be positive or negative. After the values are +entered, select OK. This rotates the object and closes the pop-up +window. If you don't like the rotation, you can use Undo, so long +as the brush is still selected, and the brush will return to its +un-manipulated facing. + +

Free Rotate in Map Window
+ +Press the "R" key. The selected map component(s) turns lavender. +The purple square at the center is the center of the selection and +the axis around which it will rotate. Left Mouse clicking on or +near the selected component (in the map or camera window) and +dragging will cause it to rotate. If the user does a SHIFT + middle +mouse button click on the 2D map window, the axis square will +relocate to the coordinates of the click. Deselecting and +reselecting the component returns the axis to its original +center. + +

Drag
+ +There are two "drag" functions that involve control points or +"handles" on the brush. + +
    Drag Edges + + + +This highlights the edges of a geometry brush, marking those +edges with a blue "handle" box at the center of each side. Press +again and the feature will toggle off. Pull on a handle to resize +part of a brush. If Snap-to-Grid is active (Menu: Grid), the +handle will snap to the nearest grid coordinate as it is pulled. +Undo functions with this effect. + +
    Drag Vertices + + + +This highlights the corner vertices of a geometry brush, marking +those corners with a green "handle" box where the sides of each +brush face connect. Press again and the feature will toggle off. +Pull on a handle to resize part of a brush. If Snap-to-Grid +is active (Menu: Grid), the handle will usually snap to the nearest +grid coordinate as it is pulled. Undo does NOT function with this +effect.
+ +

Design Note: Drag Vertices is a balky tool at best. It +works well if the user is manipulating a triangular brush face, +raising or lowering corners of the triangle. Work with care, it is +quite easy to pull a brush out of useable (or recoverable) +shape.
+ +

Scale
+ + + +With Scale you can enlarge or reduce a brush, patch, or group of +brushes and patches. You choose the axes to scale (X, Y, or Z) and +the factor of the scale. The scaling factor can be different for +each axis. Selecting this option brings up a tool window. The size +of the brush or group of brushes is multiplied by the numbers in +the boxes adjacent to the X, Y, or Z axes. Leave the value as 1 and +no change occurs. If the value is a decimal less than one, the size +of that axis shrinks. If the value is greater than 1, it grows. Hit +OK to activate the scaling function with you chosen values. Undo +functions with this effect. + +

CSG Operations
+ +CSG stands for "Constructive Solid Geometry". The two +functions here, CSG Subtract and Make +Hollow, calculate the removing of sections from that +geometry and breaking solid brushes (not curve patches) into +smaller pieces. Although they are convenient to use for some +operations, they often do things that the user may not care for. +These "side effects" can include breaking brushes into inconvenient +parts, cutting up adjacent brushes, and creating hard to find and +remove micro brushes. + +

Subtract +

+When you select this, the selected brush or brushes subtract its +volume from all the geometry that contacts it. The cutting brush is +not removed. Undo does not fix this action. + +

Design Note: Region off together the brushes that will be +cut and the brushes which will be used for cutting. This keeps +other brushes in the map from being affected by the action. It's +also a good idea to save just before doing the action, so the user +can "back up" to an earlier version.
+ +

Hollow + +

+ +When the user selects this, the sides of the highlighted brush +are turned into separate brushes. The thickness of these brushes is +equal to the grid size. Undo functions with this action. + +

Design Note: This works best with rectangular +brushes. The edges of the created brushes overlap each +other.
+ +

Merge +

+When the user selects this, the highlighted brushes are turned +into a single, convex brush. If the result of the merge would not +create a convex brush, the following message appears in the editor +console: " Cannot add a set of brushes with a concave hull." + +

Examples: Example "A" shows two brushes can be +merged together. Example "B" shows two brushes that cannot +merge. + +

image028.png + +

Clipper
+ + + +If you think of this tool as being near the same as the miter +box that a carpenter uses to cut wood or moldings, then you are not +far from the truth. + +

Placing Clip Points + +
Clip points are placed in the map views by two methods: + +

+ +

The figure below shows a square brush that has been "clipped" +from the lower left (point 1) to the upper right (point 2). The +editor creates a line between the first point and the second point. +The piece to be kept when the brush is cut is always created in a +clockwise direction from the line (assuming that the first point is +the center of the "clock") + +

In a two-point clip (shown here), the cut occurs perpendicular +(at a 90 degree angle) from the plane of the map view. Adding a +third point, and adjusting its position in a different map view can +change the angle of the cutting plane. This will take practice to +master. + +

    Toggle Clipper + + + +This toggles the Clipper function on and off. After completing a +cut, the tool remains active and must be toggled off before another +brush is selected. + +
    Clip Selection + + + +If the "clip selection" action is completed the red portion of +the brush will be discarded and only the yellow will remain. The +brush is unselected. Undo currently returns the original brush and +keeps the clipped off piece. + +
    Split Selection + + + +If the "split selection" action is completed the red and yellow +portions of the brush will remain, split into two triangular +brushes. The brush is unselected. + +
    Flip Clip Orientation + + +The yellow and red hi-lights toggle so what was red is now +yellow and what was yellow is now red.
+ +

Make Detail
+ + + +In Quake 2, this was a surface flag. In Quake III +Arena, it is used on the brush itself. Detail makes a brush +non-structural. This means that it cannot be used to seal the hull +of the map world. Don't use it for wall, floors, or ceilings. If it +is used as a hull, the map will "leak" when compiled. But it can be +used on things that jut out away from the walls (as long as there +is a structural brush behind it). + +

Detail has two beneficial effects: + +

1. Detail brushes are less likely to cause additional cuts to +occur in non-detail brushes that they touch ... thus reducing +triangle counts. This can help reduce frame rate. + +

2. When the compiler does Vis, it breaks the world up into many +small volumes. Any break in the surface of the box that forms a +room creates additional volumes that must be. Detail brushes don't +create these breaks. Therefore, using them speeds up compiling. + +

Make Structural
+ + + +Structural is the Default State for brushes. Textures that are +not manipulated by shader scripts to be transparent or non-solid) +do not change this. Essentially, this is a change-it-back +command for Make Detail. It removes the detail flag from the brush. +This surface WILL block Vis when the map is compiled (so long as +there isn't shader content that says otherwise). + +

Func_Group
+ + + +Technically, this is a b_model (brush model) entity. However, +it's a great way to manage and handle related groups of map +components for ease of selection. To use, select the brushes +and patches you want to group and then open the Entity window +(press "N"). Click on the entity list sub-window and type in "F" to +move to the top of the "funcs". Double-click on Func_Group and all +the brushes and patches selected are bound together into a group. +Select one and you select them all. + +

Thumb through Components + +
(Shortcut: TAB) + +When you have a Func_Group b_model entity selected, press the +TAB key to "thumb" through the component pieces, hi-lighting them +individually, one at a time. This allows you to work on part of a +multi-piece group without having to work on all pieces + +

Find Brush
+ + + +Find brush allows you to locate a brush in the map by its +identifying number. As the map is built, the editor assigns +identification numbers to each map component. For brushes (and +patches) these include an Entity number and a brush number. For any +brush that is not part of a brush model (b_model), the entity +number is zero (0). Each b_model will have it's own number. + +

When the compiler outputs error messages in the console and +junk.text file, an identification number will call out brushes with +problems. Be prepared for them. Even when you do things right, you +will get error messages. + +

Selecting Find brush pops up a dialogue window with two fields. +The first field is the entity number. For most brushes, this will +be zero. The second number is the brush's individual number. +Selecting "OK," jumps the 2D map window(s) to the selected +component and hi-lights it. + +

Brush scripts…
+ + + +The command allows you to perform multiple step operations that +manipulate a single brush. Currently, only two of the list scripts +function. + +

+ + + + + + + + +
BuildSpiralThis walks you through the steps of building a spiral staircase. +Select a brush, then click on the map to locate the spiral origin. +Click again to bring up a dialogue window that prompts you to enter +the number of steps, the angle of rotation, and the height of each +step.
+ BuildStepThis clones the selected brush and moves it +X 16 units and +Z 8 +units.
+ +

Brush Menu Commands

+ +The Brush menu lets the mapmaker convert a selected brush into a +brush of a different shape. Most of the commands change the number +of sides that the brush possesses. It will also change the brush to +a single color. There are individual commands for three through +nine sides. The brush will be given the number of sides indicated +by the command (Plus top and bottom). The "top" facing is always +relative to the view in which it is created. The sides are always +at right angles to the view facing. + +

Poly-Sided Brushes
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Arbitrary sided…
+ + + +This command opens a dialogue window. You can enter a number of +sides in the field from 3 to 64. Select OK to execute the +command. + +

Primitives
+ + + +Primitives are pre-made shapes other than squares or the +polygonal multisided boxes made by the "number" sided brush +commands. + +

Cone… + +

+ +This opens a pop-up dialogue window that lets you enter an +arbitrary number of sides. The height of the cone is equal to the Z +height of the brush. The cone is always made with its axis along +the Z-axis. At first, the radius of the base of the cone appears to +be unrelated, or at least unevenly related to the XY dimensions of +the brush from which it is transformed. However, if you make a four +sided brush, the point to point "diameter" of the resulting pyramid +is equal to the longest XY dimension of the brush. Starting the +same size brush as you used for the four-side cone, an eight-sided +cone fits neatly within the volume of the four-sided cone, four of +its sides congruent with the side planes of the four-sided cone. Do +the same for a 16 sided cone, and the same again for both a 32 +sided cone. However, the number of sides seems to max out at +56. + +

Sphere… + +

+ +This opens a pop-up dialogue window that lets you enter an +arbitrary number of sides. The maximum number of sides, which the +editor seems willing to handle is 32.The diameter of the sphere, is +roughly equal to the length of the longest XY side of the brush +from which it is transformed. Attempts to create spheres with more +faces than 32 may result in the brush disappearing and becoming +infinitely tall. Use Undo to back up from this or hit backspace to +discard the brush. + +

Torus… + +
Non functioniong command. No donuts for you! + +

Moving +Selected Brushes

+ +
Moving the Brush
+ +These keys move the brush around the map in discrete map grid +increments. + +
    Move Selection Down + + +Each press moves the selected map component down along the +Z-axis by one grid position (at current grid setting). Not affected +by current 2D-map view. + +

    Move Selection Up + +

    +Each press moves the selected map component up along the Z-axis +by one grid position (at current grid setting). Not affected by +current 2D-map view.
+ +

Nudging the Brush
+ +These keys move the brush around the map in discrete map grid +increments. The movement is in terms of the selected window, not in +terms of XYZ coordinates. + +
    Nudge Down + + + +Each press moves the selected map component "down" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + + + +

    Nudge Up + +

    + +Each press moves the selected map component "up" the map view by +one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Left + +

    + +Each press moves the selected map component "left" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Right + +

    + +Each press moves the selected map component "right" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates.
+ +

Snap Selection To Grid
+ + + +If you are using the map grid to keep brushes in alignment, this +is a great tool. Rotated brushes and brushes that have had their +vertices tweaked can have vertices that no longer lie on map grid +intersections. This snaps the vertices to align with the +grid. Be warned that snapping to large grids may be hazardous +to the health of your brush (Snap and it's gone! But that's what +UNDO is for). + +

Efficient Brush Building +Techniques

+ +

Developed from a Quake 3 World online posting by +Astrocreep + +

Compiling a map is a necessary evil. It takes time, it ties up +your processor, and in the early phases of map construction, comes +up with construction errors as often as not. Nothing you can do +about that … except the time thing. It is possible, +through more careful construction (or perhaps reconstruction) to +significantly reduce both map and bot compile times, and reduce map +and .bsp file sizes (the latter being important for downloads). The +following is based on reports written by Astrocreep that documents +his extensive work to streamline the compile on one of the id +sample maps. + +

Brush Construction
+ +It cannot be overstressed. If you want shorter compile times and +small file sizes, efficient brush construction is "critical" in +building your map. There is one rule that stands above all: + +

+DO NOT OVERLAP BRUSHES AT ANYTIME. + +

No matter what you have to do to build your map, do not overlap +brushes. Overlapping means that all or parts of two or more +brushes share the same physical space. If brushes overlap, you can +expect to add time to your compiling, and add size to your .map, +.bsp and, .aas file sizes. + +

Efficient map construction means that all brushes butt up +against each other, but never intersect. + +

Brush Counts
+ +The sample map to be reworked on had 1,100 brushes in it. +Without changing the layout or appearance of the map, Astrocreep +was able to remove 110, or 10% of the total brush count. + +

Learn how to do more with a single brush than with multiple +brushes. Evaluate your map after you complete initial construction +phases on all or part of it. Pick a part of the map, look at +the layout and ask yourself if you could do that with fewer +brushes. In all likelihood, nine times out of 10, the answer will +be yes. + +

If you make a structure out of three brushes (or whatever) and +have the same floor height and ceiling height (in some cases +heights can be different), look at it in the "top view". Can you +draw a line from each vertex and not cross out side of those three +brushes? If you can, then that grouping of three can become one +brush instead of three. + +

Example: here's how the engine might look at this. + +

Using 3 square brushes, you have 18 faces (with a texture mapped +on each side) to be calculated. This doesn't take into +consideration the number of in-game triangle faces that those +brushes may generate. Even if two-thirds of those faces are not +being drawn, they are still being calculated by both the compile +process and the bot navigation compile process. + +

As compared to: + +

Using one brush (filling the same area), you have only 6 faces +to be calculated. Here, you are compiling only a third of the total +geometry. It should go faster. + + +

Efficient map construction means using fewer brushes to build +the world. + +

+Caulking
+ +It is possible to even further reduce the number of brush faces +being calculated by applying a special non-drawing, but "solid" +texture called "caulk" (common/caulk) to surfaces that cannot be +seen in the game. When seen in the editor, this texture is a bright +garish pink. In the game, it does not draw at all. Apply caulk to +any brush face that either doesn't form the "shell" of the world or +can't be seen by a player during play. Doing this may not improve +your map's frame rate, but since your are telling the compiler that +as many as five of the six faces on a square brush don't have to be +calculated, it should have some significant effects on compile +times. As long as you do not have any brushes that "share" the same +space, caulking brushes should help reduce compile times. However, +if you use caulk on a brush that "shares" the space of another, +your compile time and all file sizes will actually increase. + + +

Astrocreep compiled the test level nearly 200 times, many of +those times were when he moved just a single brush, just to see +what would change. Caulking seems to help the -light phase +of compiling the most. + +

+Efficient map construction means caulking all unseen brush +faces. + +

Miscellaneous Tips
+ +Lights: You can further improve compile times by careful +use of lights. Entity lights, especially LOTS of entity lights can +reduce compile time. If you need to reduce compiling time even more +look to this. + +

Clip brushes: Clip brushes that have more than two sides +not touching another brush appear to increase compile times. + +

Hint brushes: Use these only if you need to resolve a vis +problem. Using them can significantly add to compile times. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch06/pg6_1.htm b/docs/manual/Q3Rad_Manual/ch06/pg6_1.htm new file mode 100644 index 00000000..e9133e04 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch06/pg6_1.htm @@ -0,0 +1,624 @@ + + +Q3Radiant Editor Manual: Page 5.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 3: Working with Curve Patches

+ +
Escape (ESC)
+ +This is the all-purpose deselect key. Use it to back out of +operations you don't want to complete or to stop working on a patch +or group of patches. + +

Curve Menu Commands

+ +The next set of commands comes from the Curve Menu. Some are +duplicated on the Patch Tool Bar. + +

Cylinder
+ + +This creates the simplest cylinder. Cylinders are always drawn +with their open ends facing up and down. It does not matter which +map view is open when the cylinder is created. + +

More Cylinders: + +

+ +
    Dense Cylinder + +
    This is a cylinder with a set of extra rows. It allows a +180-degree bend into a half donut (half torus). + +

    Very Dense Cylinder + +
    This is a cylinder with two extra sets of rows. This allows a +bend into a full donut (torus). + +

    Square Cylinder + +
    This is a cylinder whose columns have been adjusted so that a +square, with flat sides, is formed. +

+ +

End Cap
+ + +This is a half cylinder. + +

Bevel
+ + +This is a quarter cylinder + +

More End caps, Bevels: + +

+ +

Square Endcap + +
This is an endcap without the backside removed. + +

Square Bevel + +
This is a bevel with squared off back faces + +

Cone
+ + + +A cone is a cylinder with control points drawn together and +welded at one end to form a point. + +

Sphere
+ + + +
Design Note: A curve patch sphere can be constructed from +a cone. Start with a cubic brush. Convert into a cone. Go into edit +vertexes mode and grab the control point at the peak of the +cone. Pull it downward to half the height of the cone. Clone +the resulting piece and flip it upside down.
+ +

Simple Patch Mesh…
+ + + +The patch mesh is the basic building block use to create all +curves. All the curve primitives are deformations of this +item. For this to work, you must first create a brush of the +dimension desired for the patch. Selecting this opens a Patch +dialogue window. This lets you select the vertical (rows) and +horizontal (columns) complexity of the patch. The more complexity +means being able to perform more deformations on the patch. It also +means adding a greater number of triangles that must be +rendered. + +

Insert
+ + +Adding control points increases the complexity of a mesh. This +action does not increase the physical size of a mesh. Additions are +usually done before manipulating the patch mesh. + +
    Insert (2) Columns +
    This adds two columns of control points to the left edge of a +patch. + +
    Add (2) Columns + +
    This adds two columns of control points to the right edge of a +patch. + +
    Insert (2) Rows + +
    This adds two rows of control points to the lower edge of a +patch. + +
    Add (2) Rows +
    This adds two rows of control points to the upper edge of a +patch. +
+ +

Delete
+ + + +Deleting control points reduces the complexity of a patch mesh. +Be warned that the features created by the removed points are also +removed. It does not make the mesh a less complex version of the +former design. Deletions also change the dimensions of the mesh, +removing the area created by the deleted control points. A mesh +cannot be reduced smaller than a 3 column by 3 row complexity. + +
    First (2) Columns + +
    This removes two columns of control points from the left edge of +a patch. + +
    Last (2) Columns + +
    This removes two columns of control points from the right edge +of a patch. + +
    First (2) Rows + +
    This removes two rows of control points from the lower edge of a +patch. + +
    Last (2) Rows + +
    This removes two rows of control points from the upper edge of a +patch. +
+ +

Matrix
+ + + +This has nothing to do with Neo and Trinity. It's the patch mesh +taken as a whole. + +

Invert + +

+ +This command inverts the normals of the patch mesh. The normals +control the direction of facing for the texture skin and the +clipping surfaces. + +

Re-disperse + +

+This is used on a selected patch. When rows or columns are +inserted or added to a patch, the dimensions of the patch are not +changed. The distances between the new additions and the old points +are not the same. This command averages out the distance between +the points. It does not change the size of the patch. +WARNING! Only apply this BEFORE adjusting the patch. Otherwise, +you may lose your work on it. With some patches, selecting this +command will destroy the patch itself. + + +
    Cols + + + +The distance between columns is averaged and evened out. + +

    Rows + +

    +The distance between rows is averaged and evened out.
+ +

Transpose + +

+ +(Function undetermined) + +

Cap
+ + + +This command adds "cap" patches to the ends of the patch. The +original brush and the caps are linked together as a func_group +entity. A Patch Tool Bar button duplicates this command. The type +of cap depends on the selected patch: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +CylinderThe ends of the cylinder are sealed with circular patches.
Square +CylinderThe ends of the cylinder are sealed with square patches.
+ConeBoth ends are capped (open and point). You will want to discard the +cap on the point end.
+BevelIf you select to cap a bevel, a dialogue window pops up. +A normal bevel cap covers the space between the curve and the +center.
Inverted +BevelAn inverted bevel covers the space between the curve and the outer +corner.
+EndcapIf you select to cap an endcap, the same dialogue window pops +up.
Patch +MeshThe bevel/endcap window will pop up. Results will vary depending on +the manipulations done to the mesh.
Square +BevelCapped in the same manner as a cylinder
Square End CapCapped +in the same manner as a cylinder
+ +

Cycle Cap Texture + +

+ +Press this repeatedly until the texture on the cap patch looks +correct. + +

Overlay
+ + + +Overlay turns the grid of control points on for the selected +patches and leaves them on until the Clear command is selected. By +having the control points on a curve patch be visible, it is easier +for the designer to align the vertices of adjacent solid geometry +brushes. + +
    Set + + + +This is the command to turn on the control points in a selected +patch. + +

    Clear + +

    + +This is the command to turn off all control points in all +patches.
+ +

Thicken
+ + + +If you think about it conceptually, Thicken transforms a curve +patch into a three-dimensional object. It does this by duplicating +the selected curve and moving it a distance away from the copied +curve, and, if the "seams" checkbox is checked, it will cover the +space between the original and the copy with patches. The distance +between original and copy is selected in a pop-up dialogue window. +The direction is determined by the facing of the curve's normals +(the textured side). The duplicated curve appears on the opposite +side of the textured face. The resulting object depends on the +nature of the curve primitive being thickened. The following +are some examples: + +

+ + + + + + + + + + + + + + + + +
+CylinderA pipe is created. Checking "seams" caps the ends.
BevelA matching bevel is created. Checking "seams" creates a bent square +tube.
EndcapA matching endcap is created. Checking "seams" creates an +arch.*
Patch +MeshA mesh that echoes the shape of the selected patch is created, but +with XY dimensions smaller or larger by the measure of the +thickness (smaller if the normals are on the concave side; larger +if on the convex side).
+ +

* Thickening an Endcap is not the best way to create this shape. +Bending a square cylinder will produce better results. + + + +

Patch Tool Bar

+ +
The patch tool part is turned on in the Preferences. Each +of these buttons enables or disables a curve editing feature, or +initiates a process on a selected curve patch. + +

Don't Select Curved Brushes
+ +This button toggles the ability to select or not select curve +patches in the map. If turned on (depressed), the user will not be +able to individually select curve patches. Group selections +will still include any curve patches within their boundaries. + + + +

Show Patch Bounding Box
+ +This button toggles the display of the bounding box that defines +the limits of the patch. On (button depressed) shows the bounding +box. + + + +

Show Patches as Wireframe
+ +This button toggles the display of patches between a fully +textured mesh (off) and a wireframe-only mode (on). The wireframe +mode makes it easier to see the deformations of the mesh and allows +the user to see some control points that may be hidden by the +texture when it is mapped on the mesh. It can also be a +performance-enhancer for the editor (by setting the view to +wireframe until you need to see the brush textured). + + + +

Design Tip: When manipulating the control points on a +patch mesh, using wire frame allows you to best see both the +control points and the deformations.
+ + + +

Patch Bend Mode
+ +If a curve patch is selected, this button initiates a multi-step +bending procedure. There are tutorials available on several +sites that address the fine points of bending a patch, whether it +is a cylinder or a simple flat mesh. The ESC key will exit the +procedure at any point. The following are just the steps: + + + +
  • Select the patch (and only the patch). + +
  • Press the Patch Bend Mode button. This brings up an instruction +window that says: +
+ + + + + + +

This highlights (turns pink) a row or column of patch control +points. One of these control points will likely be the axis for +your bend. Pressing ENTER locks in your choice and advances to the +next step. + + + +

  • A second instruction window message appears:
+ + + + + + + +

This highlights the specific control point around which the +patch will bend. Pressing ENTER locks in your choice and advances +to the next step. You can also choose the control point by +SHIFT + middle mouse button clicking on the map window. The +click need not be within the bounds of the patch. + + + +

  • A third instruction window message appears:
+ + + + + + + +

This highlights the side or end of the patch (relative to the +bend point) around which the patch will bend. Pressing ENTER +locks in your choice and advances to the next step. + + + +

  • A fourth instruction window message appears:
+ + + + + + + +

Clicking and holding the Left mouse button on the map window and +dragging it around will cause the patch to bend. Pressing ENTER or +ESC at this point will accept any changes that you have made. + + + +

Redisperse Patch Points
+ +This is used on a selected patch. When rows or columns are +inserted or added to a patch, the dimensions of the whole patch are +not automatically adjusted. The distances between the new additions +and the old points are not the same. This command averages out the +distance between the points. + + + +

WARNING: Only apply this BEFORE making adjustments to the +patch, otherwise you may lose your work on it. With some +patches, the patch itself will be destroyed. + + + +

CAP (put caps on the current patch)
+This is used on a selected patch. + + + +

Design Notes: + +
    Endcaps: Don't cap endcaps with this tool. Make a +pair of opposing bevel caps that match the arch of the endcap + +
    Messed Up Texturing: If an inverted bevel endcap covers +something other than an arc of a perfect circle, it is likely that +the texture won't appear right when you apply the CAP function to +the texture. Press SHIFT + CTRL + P a few times until it looks +right.
+
+ +

Weld Equal Patch Points (welds equal patch points during +moves) + +
(Patch Control Bar only) This feature, when selected (button +pressed in) causes control points to weld together if they are +moved to the same coordinates. Undo will undo the move and the +weld. + + + +

Drill Down (selects drill down rows and columns) + +
When this is toggled on (depressed), clicking on a control point +in a 2D Map view selects all the control points in the row or +column beneath it. + + + + + +

Moving Patches

+ +
Moving Selected Curve Patch
+ +These keys move the curve patch around the map in discrete map +grid increments. + +
    Move Selection Down + + + +Each press moves the selected map component down along the +Z-axis by one grid position (at current grid setting). Not affected +by current 2D-map view. + +

    Move Selection Up + +

    + +Each press moves the selected map component up along the Z-axis +by one grid position (at current grid setting). Not affected by +current 2D-map view.
+ +

Nudging the Curve Patch
+ +These keys move the curve patch around the map in discrete map +grid increments. The movement is in terms of the selected window, +not in terms of XYZ coordinates. + +
    Nudge Down + + +Each press moves the selected map component "down" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + + + +

    Nudge Up + +

    + +Each press moves the selected map component "up" the map view by +one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Left + +

    + +Each press moves the selected map component "left" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Right + +

    + +Each press moves the selected map component "right" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates.
+ +

Snap Selection To Grid
+ + + +If you are using the map grid to keep curve patches in +alignment, this is a great tool. Rotated curve patches and curve +patches that have had their vertices tweaked can have vertices that +no longer lie on map grid intersections. This snaps the vertices to +align with the grid. Be warned that snapping to large grids +may be hazardous to the health of your curve patch (Snap and it's +gone! But that's what UNDO is for). +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch07/pg7_1.htm b/docs/manual/Q3Rad_Manual/ch07/pg7_1.htm new file mode 100644 index 00000000..ec331a7d --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch07/pg7_1.htm @@ -0,0 +1,945 @@ + + +Q3Radiant Editor Manual: Page 7.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 4: Working with Textures

+ +There are three skill and knowledge components to working with +textures as they regard Quake III Arena. They are Texture +creation, Texture Manipulation, and Texture Application. Only the +third, Texture Application, is absolutely necessary for making +maps. You need not master all three. + +

Brush Primitives: A New Format

+ +With the release of version 192, the Q3Radiant editor takes a +new direction in the way textures are mapped to the surfaces of +brushes. The texturing format will roughly be the same as the way +textures are handled on curve patches. While there are no changes +to the user interface within the editor, you should see a change in +the way textures behave on brushes during transformation operations +like move and rotate. Because textures are mapped to the S +and T coordinates of a brush (as they are with curve patches), +locked textures will now maintain their positions on brushes when +they are moved or located. Even complex rotations should now be +possible without the textures going askew. + +

Checking the Brush Primitives checkbox turns on this feature. +(Menu: Project Settings… > Use brush primitives in map +files). Once you change a map to Brush Primitives, you cannot go +back to the earlier method of texture mapping with that map. The +prudent mapper makes backups before making major changes to +projects. + +

Texture Creation: Making new Assets

+ +This is covered earlier in the manual. + +

Texture Manipulation: Shader Overview

+ +Technically, each texture already has a default shader that +passes it through the pipeline to appear much as it does in the +graphic program that made it. A shader is a short script, +separate from the texture file, that the game engine uses to make +further adjustments to the texture's appearance or function. The +shader is to Q3A what the surface properties flags were to +Q2, only ever so much more powerful. If you plan on creating +your own textures, you should get to know and understand how +shaders work. The Q3A Shader Manual contains the information you +need. + +

Shaders and Multi-Pass Texture Effects
+ +(Drawn from an original essay by Small Pile of Gibs) + +

Shaders give the mapper control over special graphics effects +that require multiple redrawing passes before they are finally +displayed on the game screen. Every shader that changes the visual +component of a texture uses these "Multitexture" effects. +Multitexture is ON by default in Quake III Arena. It is +turned off with the cvar, "set r_ext_multitexture 0 (entered in the +console or bound to a key) - see the Debugging section in this +document for more details. + +

To understand how multitexture works, you need to understand how +the Quake III Arena graphic engine renders a scene. All the +faces you see in Quake III Arena are made up of triangles - +you can see this by using the cvar command "r_showtris 1." +Initially, each triangle adds one to the "tris" number in r_speeds +(the numbers that are used to estimate whether a scene is too +complex). With every frame that Q3A "paints", it draws +triangles onto the scene in layers, starting at the back of the +scene and drawing every triangle visible until it reaches the +front. It takes time to draw each triangle. If a triangle is +painted with a texture that is "see through" in some way (either +transluscent, transparent, or containing cut-outs), any triangles +seen through that triangle must be redrawn one additional time for +each stage in the the shader. If a single transparent triangle +takes up the whole screen, for example, a glass window - The whole +area of the screen has to be redrawn. Each triangle of glass takes +an entire screen worth of "overdraw" and each extra stage on the +glass adds another screenful, which is why glass can be such a big +framerate hit. + +

The simplest form of multitexture is a Lightmap. In most cases, +the Q3A engine first draws the lightmap (precalculated light and +shadow information). Then, on top of that, it adds in the +information from the texture art specified for that triangle using +a special effect (blendfunc filter) - which blends the lightmap +with the texture to make areas of the texture look light or dark. +Using the cvar command "r_vertexlight 1" (Vertex Lighting +instead of Lightmaps) stops Q3 from drawing the lightmap triangles +(which is why many gamers use vertex lighting to gain additional +playing speed). + +

Every extra stage in a shader is an extra triangle drawn over +and blended with the first triangle in a special way. Like the +lightmap example above, each additional stage requires an extra +triangle to be drawn for each frame. On certain 3D accelerator +cards (like the TNT - TwiN Texture), the multitexture effect +cancels out the real cost of the first pass of blending. The +blending for the first additional stage is done before the triangle +is drawn. However, if the shader takes 3 stages (like all the shiny +metal effects) it costs an extra triangle for every triangle it is +used on. Every extra triangle used adds a triangle to the r_speeds +triangle count. Because there are cards that don't automatically +handle this first blending pass, the map maker needs to +occasionally check his r_speeds with the multitexture turned +off. + +

Texture Application: Texture Handling +Tools

+ +These tools manipulate textures within the editor. They do not +create textures or shader scripts. + +

Escape (ESC)
+ +This is the all-purpose deselect key. Use it to back out of +operations you don't want to complete or to stop working on a brush +face, a brush, a patch, or a group of brushes or patches. + +

View Textures
+ + + +This is only used in the four-view and floating windows modes +(as set in Preferences). It brings up the Texture selection window +(also accessible from a folder tab). If the Entity window is open, +you may need to click on a map view window first for the "T" +command shortcut to work. + +

Show in Use
+ + + +This command affects the content of the Textures window. It +filters the contents so that only those textures currently in use +in the map are displayed in the window. + +

Show All
+ + + +This command affects the content of the Textures window. It +"un"-filters the contents so that all the texture directories +previously loaded during the mapping session are re-displayed. + +

Surface Inspector
+ + + +

+ +

This brings up a pop-up dialogue box. This is one of the more +complicated interfaces used during map development and may take +some getting used to. + +

Texture + +
This is the path/name (beginning in Textures directory) for the +texture. You can copy from this field or paste into it. If you know +the pathname of a texture, you can enter it here. It will load +without having to first load the entire directory that contains +it. + +

The next five commands work on both patches and brushes. +However, the results of applying a Horizontal Shift to a brush and +to a patch may be substantially different. When working with +patches, the numbers in the fields do not change … although +the texture on the map component may be changing. + +

Design Note: When a curve patch butts flush up against a +piece of solid geometry, as if it were an extension of that +geometry, it may be difficult to align the textures exactly. In +fact is often extremely difficult to align a texture on a +patch with the texture on an adjacent geometry brush. It works best +when the dimensions of the patch are an exact multiple of the +dimensions of the texture being used. Otherwise, you may want to +consider designing your architecture in such a way that it is +logical for a new texture to begin at that point. Use your +judgement.
+ +

Horizontal Shift + +
This allows you to change the Horizontal texture offset +(position of texture on a surface). You can type an offset value +into field or use the scroll buttons on the right to shift the +texture. If "Snap T to Grid" is set in Preferences, the scroll +increments will move a number of pixels equal to the grid size. + +

Vertical Shift + +This allows you to change the Vertical texture offset (position +of texture on a surface). You can type an offset value into field +or use the scroll buttons on the right to shift the texture. If +"Snap T to Grid" is set in Preferences, the scroll increments will +move a number of pixels equal to the grid size. + +

Horizontal Stretch + +This allows you to change the dimensions of textures as they are +mapped into the world. You can type a size value into field or use +the scroll buttons on the right to enlarge or reduce the texture. +The default value is 0.5. This gives a presentation in the game +world of two pixels for each game unit. A Horizontal Stretch value +of 1.0 would double the amount of area covered by a single repeat +of the texture. Of course, doing that also reduces the apparent +resolution of the texture by half (can you say blurry?)! Making the +stretch value a negative number horizontally flops the texture's +normals (i.e.; flops the texture left to right). + +

Design note: Textures are "projected" onto brush +surfaces. This means that if a surface is angled, the texture +stretches to fit the space upon which it is projected. To make the +texture look "unstretched" you need to change the dimension so that +it looks correct when stretched. Example: If you want to map a +texture on a 45-degree angle, it should be scaled to 0.35 along the +direction perpendicular to the axis of the angle.
+ +

Vertical Stretch + +This is the same as for the Horizontal Stretch, but along the +vertical axis. Making the stretch value a negative number +vertically flops the texture's normals (i.e.; flops the texture up +and down). + +

Rotate + +This rotates the texture around the center point of the brush +(or patch). If the texture is not centered on the map component, +the rotation will not necessarily look correct. The increment of +rotation is set by the value given for the Rotation Inc field on +the Preferences window. The default value is 45 (degrees), roughly +1/8 rotation around the axis. + +

Value + +(This Quake 2 function is not used by Quake III +Arena) + +

Texturing + +

This next grouping of commands in the lower left corner of the +window provides two separate sets of buttons. The top set deal with +texturing geometry brushes. The lower set is for texturing curve +patches. + +

    Axial (Brush) + +
    Realigns texture to the X and Y axes (removing the effects of +rotation) + +

    Fit (Brush) + +
    The texture is stretched to fit the dimensions of the brush. The +width and height fields to the right are the number of repetitions +to be used in the S and T dimensions (S corresponds to X on +the actual texture and T corresponds to Y on the actual texture). +The default value for the height and width fields is 1. You can +type a size value into field or use the scroll buttons on the right +to enlarge or reduce the texture. Only integer values can be +entered (meaning that you can't enlarge a texture 1.5 times). + +

    CAP (Patch) + +
    This function is most often applied to patches used to fill in +the gaps between curves and solid geometry. It can also be applied +to flat patches so that the texture doesn't appear to follow the +arc of the patch. You may need to use the SHIFT + CTRL + N command +to normalize the texture on the patch. + +

    Set… (Patch) + +
    This command functions almost like the "Fit" command above for +brushes. The texture will be fit across the patch based on the X +and Y values given. However, there is a notable difference. The X +and Y fields will accept non-integer values (e.g. 6.4 x 3.8). It +may take some experimentation to determine which dimension of your +patch is considered to be "X" and which is thought to be "Y". If a +value of 1x1 is given, the texture will be "fit" to the +patch. + +

    Natural (Patch) + +
    The engine does its best to map the texture onto the patch in a +"natural" appearing manner. This means that the texture will curve +and flow with the curves and bends in the patch. Unless you are +texturing a cap, this should be your first choice when applying a +texture. + +

    Fit + +
    The texture's coordinates are mapped to fit the patch +(with no repeats). +

+

Find / Replace
+ + + +This feature allows the user to replace a texture within a +single brush, a set of selected brushes or globally throughout the +entire map. Selecting the command from the menu opens up a dialogue +window. The top line is for the texture path and name of the +texture to be replaced. The second line is for the texture to be +used for replacement. Several checkboxes allow fine control over +what, exactly, is to be changed. This command does not respond to +UNDO. If you accidentally mistype a texture name in the replace +line, you will need to enter it again (as mistyped) on the find +line and then enter the correct texture on the replace line. + +

Texture replacement is global (throughout the map) unless the +selected checkboxes state otherwise. + +

    Replace within selected brushes only. Only the hi-lighted +brushes that contain the texture to be replaced will be +affected. + +

    Force replacement (ignore current texture name). +All textures in the map will be replaced. Best if used with +Replace within selected brushes only. Be very careful +with this one. + +

    Live Updates from Texture/Camera windows. Using +Live Update the user can find and replace textures with a fully +point and click interface. + +

    Texture Replacement using Live Updates + +
    Click on the Find box, then click on any texture in either the +Camera window or the Texture window. The texture path/name for that +texture appears in the box. Next click on the Replace box and click +on the replacement texture. That texture's path/name appear in the +Replace box. Select "OK" and the replacement will occur.

+ +

Step-by-step for replacing a texture on a brush face +(if live update is not used). + +

  • In the Camera window, hi-light (CTRL+SHIFT+mouse1) the texture +to be replaced. + +
  • Open Surface Inspector. If the name of the texture is not +hi-lighted, then hi-light it. + +
  • Press CTRL+C to copy the texture name. + +
  • Open the Find/Replace window. + +
  • Paste (CTRL+V) the name into the find window. + +
  • Hit ESC to deselect the texture in the CAM winow. + +
  • Open the Textures Window. Find the texture you want to replace +with and select it. + +
  • Open Surface Inspector again. + +
  • Copy the texture name there. + +
  • Open Find/Replace again and paste the new texture into the +Replace box. + +
  • Select OK. Replacement occurs and the dialogue window +closes.
+ +

Texture Lock
+ + + +Opens Pop-up window with two options for "locking" texture +shifting during brush or patch movement. NOTE: If you have +selected the BRUSH PRIMITIVES option under Project Settings… +then Texture lock will always be on. + +
    Moves + + +When this option is checked, textures stay locked in position on +the brush as brushes are moved around the map. If unchecked, the +texture appears to shift across the brush, because they are fixed +to the world, not the individual brush. On small brushes and small +textures (such as the small square lights), some "creepage" may +occur, with textures shifting 1 or 2 units off their locked +position. + +

    Rotation + +

    + +When this option is checked, textures stay locked in position on +the brush or brushes as they are rotated around the map. If +unchecked, the texture appears to shift across the brush, because +they are fixed to the world, not the individual brush. On small +brushes and small textures (such as the small square lights), some +"creepage" may occur, with textures shifting 1 or 2 units off their +locked position.
+ +

Load from List…
+ + + +Opens a dialogue box listing all texture directories currently +recognized by the editor. Hi-light a directory title then +click on the "Load" button. The textures in the selected +directory will be loaded into the Textures window. + +

Shaders
+ + + +This command pops up a Pop-up window with two shader-related +commands. + +
    Load All (Reload) + + + +This command loads or reloads all the .shader scripts recognized +by your shaderlist.txt file. When you change and save a shader +script, execute this command, then reload the affected texture +directory to see any changes. + +

    Show + +

    + +When checked, this command surrounds all shader-manipulated +textures in the Texture window with a thin white border.
+ +

Flush
+ + + +The flush command frees up texture memory and should improve +editor performance. Exactly how much is flushed depends on your +choice of commands. + +
    Flush All + + + +This command flushes all the texture memory, restarts OpenGL and +reloads the map from the last saved copy. + +

    Flush Unused + +

    + +This command flushes all UNUSED textures from memory.
+ +

Texture Window Scale-
+ + + +This affects the size of the texture images displayed in the +Textures window. Clicking on the menu entry opens up a pop-up +window with the following size selections: 200%, 100%, 50%, 25%, +and 10%. Adjust it to suit your liking. If seeing the detail in the +textures is important to you, set the size to 100% or larger. If +you know your way around the textures without having to see each +pixel, set it for smaller. + +

Texture Directories
+ + + +This is not a command. The entries on the Textures Menu below +"Texture Window Scale" are the names of the available texture +directories (all whose filenames are listed in the shaderlist.txt +script). Clicking on one loads the contents of the directory into +the Texture window. + +

Texture Shift Key Shortcuts
+ +A brush, brush surface, or curve patch must already be selected +before using these shortcuts. This feature closely copies the +function of the Texture Shift fields and scroll bars on Surface +Inspector pop-up window. If Snap to T is selected in preferences, +then the texture shifts in pixel increments equal to the current +grid setting. Shifting textures on curve patches may produce +unexpected results. + +

+ + + + + + + + + + + + + + + + + + +

Texture Rotate Key Shortcuts
+ +A brush, brush surface, or curve patch must already be selected +before using these shortcuts. This feature closely copies the +function of the Texture Rotate field and scroll bar on Surface +Inspector pop-up window. The texture rotates in degree increments +set in Preferences. Rotating textures on curve patches may produce +unexpected results. + +

+ + + + + + + + + + +

Texture Scaling Shortcuts
+ +A brush, brush surface, or curve patch must already be selected +before using these shortcuts. This feature changes the scale of the +texture (the amount of area that a single instance of the texture +covers). The texture scale seems inconsistent, except that opposite +directions appear to cancel each other out. The amount of increase +delivered by the first use appears to be about a ratio of 1:15. + +

+ + + + + + + + + + + + + + + + + + +

Using Interactive Textures

+ +Interactive textures are the shader-manipulated textures that +have an effect on game play, not just the appearance of the map. +There are two classes of Interactive Textures: Special Content +Textures and Texture Entities. For more detail and +instructions regarding shader manipulation of textures, refer to +the Q3A Shader Manual. + +

Special Content Textures + +Special content textures are textures where the "surface" +parameters of the texture actually change the physical nature of +the geometry brush and in so doing, affects the play of the +game. + +

Water + +
Water is a content parameter that allows a player to "swim" +inside a geometry brush, causes a pulsing visual distortion of the +underwater geometry, and prompts the game engine to draw bubbles as +projectiles pass through it. A player can only remain under water +for a short time (without a battlesuit) and then begins to +drown. + +

Water usage rules: + +

    +
  • A water texture is defined by the presence of surfaceparm water +in the shader that creates it. + +
  • Because water is typically a "transparent" surface, the shader +passes used to create surface effects on water are added to the +shader passes of textures seen through the water surface. This can +significantly increase the number of redraw passes necessary to +draw the game world and may negatively affect performance. + +
  • If you place water brushes side by side, the touching sides must +be marked with the common/nodraw texture. + +
  • Both the top and the bottom surfaces of a water brush must be +water texture. + +
  • Water brushes cannot be stacked so they touch another water +brush vertically, only set side by side. + +
  • If you want to be able to exit water easily, keep the +distance from the top of the water brush to the adjacent "shore" or +pool edge at no more than 16 game units. Somewhat less is actually +better. + +
  • If fog is to be used as a part of a water volume, the water +surface should not deform.
+ +

Fog + +Fog content is used to block or diminish player vision and +provide "atmosphere" for a level. Like water, fog can affect game +performance, especially if one can see additional shader effects +within it. The following information is taken from the Q3A +Shader Manual regarding fog creation and usage. + +

fogparms <red value> <green value> <blue +value> <distance to Opaque> + +
This surface parameter (or "surfaceparm") defines the contents +of the fog. + +
Note: you must also specify "surfaceparm fog" to cause +q3map to identify the surfaces inside the volume. Fogparms +only describes how to render the fog on the surfaces. + +

<red value> <green value> <blue value> +These are normalized values (number range from 0 to 1). A good +computer art program should give you the RGB values for a color. To +obtain the values that define fog color for Quake III Arena, +divide the desired color's Red, Green and Blue values by 255 to +obtain three normalized numbers within the 0.0 to 1.0 +range. + +

<distance to opaque> This is the distance, in +game units, until the fog becomes totally opaque, as measured from +the point of view of the observer. By making the height of the fog +brush shorter than the distance to opaque, the apparent density of +the fog can be reduced (because it never reaches the depth at which +full opacity occurs). + +

Fog usage rules: + +

    +
  • If a room (or rooms) is to be filled completely with a fog +volume, it can only be entered through one surface (and still have +the fog function correctly). + +
  • The fog volume can only have one surface visible (from outside +the fog). + +
  • Fog must be made of one brush. It cannot be made of adjacent +brushes. + +
  • Fog brushes must be axial. This means that only square or +rectangular brushes may contain fog, and those must have their +edges drawn along the axes of the map grid (all 90 degree +angles). + +
  • If a water texture contains a fog parameter, it must be treated +as if it were a fog texture when in use. + +
  • Additional shader passes may be placed on a fog brush, as with +other brushes. + +
  • If a light-emitting fog brush is placed beneath normal brush +geometry, the light may cause light artifacting on the solid brush +surface. Use with care. + +
  • Brush models (trains, doors, rotating objects, etc.) within, or +partially within fog volumes will have drawing priority problems +against the fog. It is best not to place these entities in +fog volumes. + +
  • There are unconfirmed reports of moving entities being made with +fog shaders.
+ +

Lava + +
Lava content, for most practical purposes, is a variation of +water content. The damage that it does to players in contact with +it is defined by game code and cannot be directly affected by the +map designer. + +

Slime + +
Slime content, for most practical purposes, is a variation of +water content. The damage that it does to players in contact with +it is defined by game code and cannot be directly affected by the +map designer. + +

Texture Entities
+ +There are a number of shader-manipulated textures that are used +in an entity-like fashion. The shader files that manipulate the +textures are what give them their game properties. These are +the ones that id used and their relevant properties. + +

Areaportal + +
Color: Opaque Red Orange + +
Location: (textures/common/areaportal) + +
The bsp tool uses areaportals to create hard, visual breaks +between areas in the map. Until triggered, the areaportal blocks +geometry behind it from being drawn or seen. The area portal brush +should be a thin (2 to 4 units thick) brush. It should touch all +the brushes that form the hull of the opening being portalled. It +must be placed inside a door. The opening of the door triggers the +portal function. The closing of the door returns it to its former +state. The areaportal texture must completely seal off a volume +from another volume (although this can be in conjunction with other +areaportals). If a door is being used to block off an area from +view, consider placing an areaportal brush inside the door. Example +in Quake III Arena: All the doors out of the central courtyard in +Q3DM12, The Dredwerkz, are areaportalled. + +

Caulk + +
Location: (common/caulk) + +
Color: Opaque Pink + +
Game Function: Caulk, the miracle texture. It blocks vis. +It seals the world off from the void. It doesn't draw (so it +doesn't add to triangle counts). It keeps curves from competing +with textures behind them. It looks like hell if you see it in your +world. From the View menu (View > Show > Caulk), you can +toggle on and off the display of caulk brush sides. + +

Design Tips: When you build a brush entity (a.k.a. +b_model), mark all the brush sides that you will never see with +caulk. Otherwise, the game draws every one of them. Even if you're +only making a one-piece door, mark all the non-viewed sides with +caulk. The same holds true for detail brushes. If you can't +(or won't ever) see a brush face on a brush that's been marked as +detail, paint it with caulk. Next, whenever you build a curve, try +to build the brush geometry immediately behind it out of caulk. +Finally, look around your map for brush faces that you suspect are +being drawn, but are never seen: door pockets, bars, underneath +bridges or very low railings and so on. It may sound like work, but +attention to detail like this buys you both the appearance of +greater geometric detail in the map AND faster game running +speed. + +

More Design Tips: Finally, and this should be used with +great care, a caulk brush can be used to create an invisible +support for entities. If you place a very thin caulk brush floating +above a surface that would otherwise not support an entity +(example: a grate made of clip brush), the brush will not draw in +the world, but will support the entity. The reason for this is that +SUSPENDED entities are not "seen" by bots unless they can be +reached by a jump pad.

+ +

Clip + +
Location: (textures/common/clip) + +
Color: Transparent Red + +
Game Function: If you look at a professionally made map, +quite often you'll see that nearly every bit of wall surface is +covered in a transparent red texture called "common/clip." Clip is +a nondrawing texture that blocks player movement. Clip does not +block weapon fire. Entities, such as ammo or weapons, are not +supported by clip brushes. If placed or dropped on a clip brush, +they will pass through them. + +

Design Tips: Place clip brushes to smooth the passage of +players through the world. This could mean creating a slope that +allows the player to slip past a piece of architectural trim, or +filling a window to keep players from getting into it. It can be +used to create an artificial ceiling that prevents players from +flying or jumping too high.
+ +

Cluster Portal + +
Location: (textures/common/clip) + +
Color: Translucent lavender + +
Game Function: Works like an area portal, but for the bot +navigation file only. Cluster portal is used by the bspc utility to +subdivide the map into smaller areas for calculating bot +navigation. Appendix C: Bot Navigation Files contains the specific +details for using cluster portal texture entities. + +

Cushion + +
Location: (textures/common/clusterportal) + +
Color: Translucent pale aqua + +
Game Function: A player falling on this does not take +damage. They also don't make a "landing" sound, so use with +caution. + +

Do Not Enter + +
Location: (textures/common/donotenter) + +
Color: Transparent Pale Orange + +
Game Function: It is a tool used to solve bot navigation +problems. Use it like a clip brush, but sparingly. When you observe +bots doing stupid things in your map, try to block off the area +with this texture. The Bot Navigation Files appendix contains the +specific details for using the Do Not Enter texture entity. + +

Hint + +
Location: (textures/common/clusterportal) + +
Color: Transparent Yellow Green + +
Game Function: Helps determine the vis portals. It is +used as a suggestion to the compiler during the vis phase, when the +world is subdivided. Generally speaking, they are used to correct +vis problems, whose chief symptom is the "hall of mirrors" effect +seen during game play. These can often be corrected by careful +placement of a hint brush. If you fill the volume where the +error is seen or the volume adjacent to it, the problem may be +corrected in the next compile. This is really more art than +science. + +

Invisible + +
Location: (textures/common/noimpact) + +
Color: + +
Game Function: This was used to create a surface that +would be marked by weapon fire, but would not be drawn in the +world. This was created specifically to resolve a problem where +func_static brushes were being used to replace floor textures that +marked the location of weapons in Q3DM8. Because the rocket +launcher was located in different places between the team and the +deathmatch games, the designer wanted to make floor markers that +would not only change between game types, but would be marked like +adjacent floor pieces. + +

Nodrawnonsolid + +
Location: (textures/common/trigger) + +
Color: Opaque light yellow + +
Game Function: This is the same as nodraw. + +

Noimpact + +
Location: (textures/common/noimpact) + +
Color: black + +
Game Function: Used to create a surface which does not +block weapon fire. + +
Weapon fire will pass through this. This usually used as a +shader key on other textures. + +

Origin + +
Location: (textures/common/origin) + +
Color: Opaque Orange + +
Game Function: Used to create origin point in moving +b_models, such as trains, plats, and rotating objects. This +texture, applied to a square or rectangular brush, is used to +create the point of origin for moving b_models, such as trains, +plats, and rotating objects. It is used by func_trains as the point +that passes through path entities and the source for sound +attachment + +

Skip + +
Location: (textures/common/skip) + +
Color: Transparent yellow + +
Game Function: Do not use in Q3A. This texture was used +in Quake 2 maps to discard sides of hint brushes. It is +nonfunctional in Q3A. + +

Slick + +
Location: (textures/common/trigger) + +
Color: Translucent Pale Blue + +
Game Function: Not stick coating for map surfaces. +Reduces friction. Use like a very thin clip brush over surfaces you +want to be low friction. + +

Trigger + +
Location: (textures/common/trigger) + +
Color: Transparent Dark Yellow + +
Game Function: Used to make trigger brushes. + +

Weapon Clip + +
Location: (textures/common/weap_clip) + +
Color: Transparent Red + +
Game Function: This version of the clip brush only stops +weapon projectiles from passing through it. No marks are left on +the surface. + +
Design Tip: Use to create clip surfaces for map object +models. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch08/pg8_1.htm b/docs/manual/Q3Rad_Manual/ch08/pg8_1.htm new file mode 100644 index 00000000..328e35d8 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch08/pg8_1.htm @@ -0,0 +1,347 @@ + + +Q3Radiant Editor Manual: Page 8.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 5: Working with Entities

+ +The entities in Quake III Arena are limited to those +defined by the game code. The editor can draws entity information +from the game code, or from special definition (.def) files. +Version 192 of the editor comes with a .def file developed from an +original supplied by EutecTic. Mods made to Quake III Arena +can add to and/or subtract from the entities used by a game. If you +plan to work on mods, you should create multiple project files +(copy and rename your project file) with the changes required for +the mod. + +

The Entity Window

+ +You make game design decisions about entities and modify their +features within the Entity Window. The definition file that you +select on the Project Settings… window determines what +entities will be shown in the Entity List and what, if any, +property descriptions appear in the Key Descriptions and Check box +Spawn Flags. + + + +

Entity List
+ +The Entity List is the field on the Entity Window. It +contains the "classnames" of all the entities defined by the +definition file in alphabetical order. + + + +

You can use the scroll bar to scroll through the entities or, +after clicking on the field, type in the first letter of the class +you want to use (e.g.; type in "T" to select "target", or "A" for +ammo, "W" for weapon). + + + +

Double-click on the classname to select it and enter it on the +first line of the Active Properties field. + + + +

The Entities appendices of this document contain a complete listing of all the entities used in Quake III Arena. + + + +

Key Descriptions
+ +The entries in the Key Description field are the "rules of use" +for the hi-lighted classname in the Entity List field. You can use +the scroll bar to scroll up and down through the lines, but +the entries are not interactive. If you are using the .def file +accompanying release version 192 of the editor (or Eutectic's +original), all the key commands are described and their acceptable +values (or value ranges) are listed. If you are using the +descriptions in the .c game code file, they may be substantially +less descriptive. + + + +

Check box Spawn Flags
+ +Spawn flags are properties assigned to entities by use of check +boxes. Check the box to set the feature for the selected entity. +Many entities have only a single spawn flag property, while others +have numerous ones. Note that the check boxes to the right are only +relevant for Quake 2 single player games and will not work for Quake III Arena. + +

Active Properties
+ +This field shows all the properties currently assigned to the +selected (or newly-created) entity. Each property has two parts: +key and value. Once created or assigned, they appear on the same +line together. Only properties that are valid for an entity (that +is, ones that appear in the Key Descriptions field) will function +in game. Adding others may create error messages. You cannot +directly affect the properties in this field. + + + +

Clicking on an active property hi-lights it and fills in the key +and value fields below. You can edit both the key and the +value in those fields, or use the Del Key/Pair button to delete it +altogether. + + + +

Key & Value Fields
+ +Keys (and their values) are assigned to entities by typing them +into the fields. There is no spell check or auto-correction, so +make sure that your typing is accurate. Start by typing in +the name of the key. Then hit TAB or ENTER to change to the value +field. This also clears the contents of the value field. Now type +in the value for the key (the Key Descriptions list the acceptable +value ranges for the keys). If you hit ENTER, the key and value +appear in the Active Properties field. If you hit TAB, the +cursor moves up to the key field. You can also click directly on a +field to edit it. The cursor will appear after the last character +in the field. Use arrow keys to position the cursor within the +field. + + + +

Angle Buttons
+ +The Angle Buttons (below the value field) are used to assign a +facing direction (as is the case with player start spots or +misc_models) or movement direction to entities (such as doors and +buttons). Click on a button to create an Angle key with that +button's value in the Active Properties field. Clicking on +another key changes the angle value. + + + +

There are two clusters of angle buttons. The first cluster +represents rotation around the Z-axis for entities like player +start or spawn spots or misc_models. The entity will face in the +selected direction. The buttons represent angle directions in +45 degree increments. There is a direct correspondance between the +angle that the entity will face (or move) and the position of the +button in the cluster. If you select the 90-degree button at the +top center of the cluster, the entity will face "up" on the XY 2D +Map. If you select the 180-degree button on the left side of +the cluster, the entity will face left on the XY 2D Map. + + + +

For entities like doors or buttons, it represents the direction +that entity will move when activated. + + + +

The second angle button cluster assigns an up (-1) or down +(-2) direction to the entity. Note that an entity can only have one +facing direction. It cannot face up and 45 degrees. It can only +affect one or the other. + + + +

It is also possible to directly edit the angle value in the +value field. This allows for a much more precise angle +selection. + + + +

The Other Buttons
+ +

A third cluster of buttons sits to the right of the Angle +buttons. Each has a unique function. + + + +

Reset + +
Clicking on this button will reset all properties from the entity to the default values. + + +

Del Key/Pair + +
If you have selected an active property, clicking on this button +will delete the property. + + + +

Sound… + +
This opens a Windows directory browser in the directory that +contains the map sounds. Double clicking on a sound file name +in the browser window creates an active property with the +appropriate key and the value as the path/name for that sound. + + + +

Model… +
This opens a Windows directory browser in the models/mapobjects +directory. Double clicking on an .md3 file name in the +browser window creates classname misc_model active property with +the value as the path/name for that model. + + + +

Entity Handling Tools

+ +These tools manipulate the in game entities. The map component +handling tools that are described in the Working with Brushes +section also work with entities. + +

Escape (ESC)
+ +This is the all-purpose deselect key. Use it to back out of +operations you don't want to complete or to stop working on an +entity. + +

Connect Entities
+ + + +This targets one entity, typically an activating trigger, at +another entity, usually a target of some kind. Some entities +may be linked in multi-part chains, where each entity has some +effect on the one(s) that follow it. To use, do the following: + +
    +
  1. Hi-light the acting entity (usually a trigger, or a button). + +
  2. Hi-light the targeted entity (examples: target_position, +target_relay, a door). + +
  3. Select Connect Entities (or press CTRL + k). + +
  4. A path is drawn between the two entities. The first entity +selected always targets on the second.
+ +Troubleshooting: If the connection is not made check the +following: + +
  • Are both objects already entities? Sometimes it's easy to forget +to make a trigger brush into a trigger. + +
  • Did you select ONLY two objects? If you accidentally click +on something you don't intend to link, you have to start the +linkage over. + +
  • Did you select the objects in the correct order? + +
  • Is the second object something that can be triggered +remotely?
+ +

Ungroup Entity
+ +
(Menu: Selection > Ungroup Entity) + +
(Shortcut: none)
+ +This unbinds an entity made of brushes, and/or patches, and md2 +models back into separate map components. Once ungrouped, the +entity is no longer an entity and loses any and all key value +properties it may have had. + +

Design Note: If you intend to rebuild an entity after +ungrouping it, write down its key properties and values first.
+ +

Moving Selected Entity
+ +These keys move the Entity around the map in discrete map grid +increments. + +
    Move Selection Down + + + +Each press moves the selected map component down along the +Z-axis by one grid position (at current grid setting). Not affected +by current 2D-map view. + +

    Move Selection Up + +

    + +Each press moves the selected map component up along the Z-axis +by one grid position (at current grid setting). Not affected by +current 2D-map view.
+ +

Nudging the Entity
+ +These keys move the Entity around the map in discrete map grid +increments. The movement is in terms of the selected window, not in +terms of XYZ coordinates. + +
    Nudge Down + + + +Each press moves the selected map component "down" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + + + +

    Nudge Up + +

    + +Each press moves the selected map component "up" the map view by +one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Left + +

    + +Each press moves the selected map component "left" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates. + +

    Nudge Right + +

    + +Each press moves the selected map component "right" the map view +by one grid position (at the current grid setting). The movement is +relative to the selected map view, not XYZ coordinates.
+ +

Rotating Entities = BAD!
+ +All the commands that rotate brushes and patches will work on +entities. Unfortunately, what they do to some entities is BAD! +Don't use free rotate or menu rotation commands to rotate +Misc_models or any entity model represented by a wireframe model in +your map. The movement will separate the model wireframe from its +bounding box and will not actually change the facing of the +entity. + +

Changing Facing = GOOD!
+ +To change the direction that a misc_model or entity with a +facing (such as a player start or spawn spot) faces, use Angle keys +and values. You should "rotate" (change facing) entities with +either the Angle buttons on the Entity Window or by entering an +Angle key and giving it a rotation value between 1 and 360 +(inclusive). + +

Mass Rotations
+ +If you are building a Capture the Flag map, or other map where +you only build one portion and rotate it to make the others, +consider doing the following. Change the display of all +non-misc_model entities to bounding boxes only. Select the +entities to be moved and clone them. Then rotate them using the +menu rotating commands. Position them in the new map +section. Next, move misc_models individually. Change +their facing and set them in place. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch09/pg9_1.htm b/docs/manual/Q3Rad_Manual/ch09/pg9_1.htm new file mode 100644 index 00000000..f79b44bc --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch09/pg9_1.htm @@ -0,0 +1,87 @@ + + +Q3Radiant Editor Manual: Page 9.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 6: Lights & Lighting

+ +Lighting a map is both an art and a science. For Quake III +Arena, the id designers worked to create instances of dramatic +lighting, while attempting to maintain a relatively consistent +intensity of light throughout the maps. Other designers worked to +create dark realms, full of shadows in which lurking assassins +could hide. + +

Whatever style of lighting you strive for, remember one key +rule: The bots don't use light information. In a pitch-black room, +they would still see an opponent. Keep that in mind when designing +your maps. + +

Entity Lights
+ +There are several ways to create light emitting objects.  +The simplest is to place a light entity into your map.  If you +do nothing, it has a default value of 300 and emits white light. If +you think of the light value as the wattage for an incandescent +light bulb, you are not far off target. The section on the Light +entity in the Entities Description Appendix contains specific +information on using light entities. + +

Texture Lights
+ +Textures can be made to emit light. The amount of light that +they give off is determined by two factors: the size of the texture +and the value given for its q3map_surfacelight parameter. + +

If you only plan on using id textures in your maps, simply use +the textures surrounded by a white box in the texture window. Many +of them have their light values as part of their names: Example: +ceil22a_5k.  This would be a small, square light with a light +value of 5000.  There is not a direct correspondence between +the light value of a texture light and an entity light. + +

If you want to make your own lights, either with new, custom +textures, or changing the light and/or color values of the emitted +light in existing id textures, plan on learning your way around the +shader files.  The Shader Manual explains the light commands. +Place the new lights in unique directories. Example: +Mymapname_light\skull_light_2k.  Use the q3map_editorimage key +to make multiple light intensity versions of your new lights. + +

Generally speaking, very small lights need to have very large +values to look right (a 32x32 pixel light could easily have a +surfacelight value of 10,000 or more).  As the surface area of +the light becomes larger, the amount of light needs to be +substantially reduced for it to look right in the world.  A +word of warning, though. Very large glowing surfaces (other than +skies) can look odd in the game world, especially if they are made +from a repeating texture.  The light source will appear to be +generated from the center of the brush with the glowing +texture. + +

"Sky" Lights
+ +Quake III Arena was designed so that sky textures could +appear to emit light in a natural way. The q3map_sun parameter +creates a single light source in the sky. The mapper can control +the brightness, color, and position in the sky of this light +source.  Furthermore, the designer can add a +q3map_surfacelight value to the sky, giving it an overall lighting +value. + +

Ambient Light
+ +Ambient light is a property of the map's worldspawn entity. By +assigning a number value to the ambient key, the overall lighting +level of the map is raised. This has the tendency to flatten the +difference between light and shadow. The color of the light can +also be modified. This technique is considered a "hack." It does +not come recommended. You will find instructions that are more +complete later in this manual under the worldspawn entity heading +in the Entities Appendix. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch10/pg10_1.htm b/docs/manual/Q3Rad_Manual/ch10/pg10_1.htm new file mode 100644 index 00000000..07bdc11b --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch10/pg10_1.htm @@ -0,0 +1,858 @@ + + +Q3Radiant Editor Manual: Page 10.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 7: Miscellaneous Commands

+ +

Feedback & Read-outs

+ +The bottom border of the map window holds four clusters of +feedback information. + +

Z-Axis Layers
+ + + +If you are using any window layout that includes the Z-axis +scale, you can see the vertical relationships between components +with this function. + +

Cursor Coordinates
+ +These three coordinates, found to the left of center, report the +xyz position of the cursor in the 2D map window. + +
+ +

Brush & Entity Counter
+ +This readout is located at roughly center position. It reports +the number of brushes (including brushes forming brush entities) +and the number of non-brush entities (items, spawn spots, lights, +etc.) + +
+ +

Pushing the Limits + +This is a good place (as any) to talk about limits. +Quake III Arena has an upper limit of 2048 entities (including +entity lights!!) and while it's not an upper limit, staying under +8000 brushes is a pretty good idea. + +

Selection
+ +This readout temporarily replaces the Brush & Entity counter +when a map component is selected. The numbers represent the +dimensions of the selection. + +
+ +

Origin
+ +This readout temporarily replaces the Brush & Entity counter +when a select map component is moved. The numbers represent the +origin point of the selection (and track it as it moves). + +
+ +

Cursor Travel Distance
+ +These three coordinates, found to the right of the brush and +entity counter, report the distance that cursor has traveled from +the point where the user has clicked on the 2D map window. + +
+ +

Control Settings
+ +In the lower right corner of the editor window, you will see a +string of letters and numbers that might look something like +this: + +
+ +Each of these letter/number combinations represents the setting +for one of the commonly used tools. + +

+ + + + + + + + + + + + + + + + + + + + +
GGrid. Here, it's set to 8 units.
TTexture Tweak. This the increment in pixels that a texture will +shift. Here, it's set to 16 pixels.
RRotation. This is the amount of increment, in degrees that a +texture or brush will rotate.
CCubic Clip depth of field. When cubic clip is set, this is how far, +in terms of 64 unit blocks that you can see into the map. Here, the +setting of 10 would allow you to see 640 units into the map.
LTexture Lock. If M is showing, then it is locked for moves. +If R is showing, then it is locked for rotations.
+ +

Viewing, Seeing, Not seeing, and Hiding

+ +This group of commands all relates to what you see in the map and how you see it. Some are designed to reduce map clutter. Others are designed to improve editor performance. + +

Toggle…
+ +
    Camera View + +Toggles (hides or shows) the Camera View (CAM) window. + +

    Console View + +

    +Toggles (hides or shows) the Console window. + +

    + +Entity View + +

    + +Toggles (hides or shows) the Entity window. + +

    + +XY (Top) + +

    + +Toggles (hides or shows) the XY map window. + +

    + +YZ (Side) + +

    + +Toggles (hides or shows) the YZ map window. + +

    + +XZ (Front) + +

    + +Toggles (hides or shows) the XZ map window. + +

    + +Z View + +

    + +Toggles (hides or shows) the Z (height) window.
+ +

Center
+ + + +Centers the pitch (up and down) angle of the user view. + +

Up Floor
+ + + +This is a shortcut for moving up between "floors" in map. It +changes the user's Z height in the camera and map views. The view +moves to a point where it appears that the user is "standing" on a +"floor" (a brush with "air" space directly above it) directly above +the user's current position in the map. + +

Down Floor
+ + + +This is a shortcut for moving down between "floors" in map. It +changes the user's Z height in the camera and map views. The view +changes to a point where it appears the user is "standing" on a +"floor" (a brush with "air" space directly above it) directly below +the user's current position in the map. + +

Next (XY, YZ, XZ)
+ + + +Cycles the content of the XY map window with the other views +(side and front). + +

Layout
+ + + +
    + +XY (Top) + + + +This returns the main map view to XY Top view. + +

    + +YZ + +

    + +Changes main (XY) map view to YZ Side view + +

    + +XZ + +

    + +Changes main (XY) map view to XZ Side view
+ +

Zoom
+ + + +If the XY Top window is changed to display either +XZ front or YZ side the XY commands +below function the same way relative to the window, zooming in and +out as commanded. + +
    + +XY 100% + + + +Changes zoom on main map view to full size. + +

    + +XY Zoom In + +

    + +Zooms closer to main map. Working in smaller grid scale becomes +easier. + +

    + +XY Zoom Out + +

    + +Zooms out away from the main map. Working in larger grid scale +becomes easier. + +

    Z 100% + +

    + +Changes zoom on the z (height) scale to full size. + +

    Z Zoom In + +

    + +Zooms in closer on the z (height) scale. + +

    + +Z Zoom Out + +

    + +Zooms out and away from the z (height) scale. + +

    Cubic Clip Zoom In + +

    + +This requires that the Cubic Clipping function be toggled on. It +decreases the Depth of Field (distance in which map components are +seen) in the Camera window. Less map components are seen at one +time. Decreasing the distance seen in the Camera window can +significantly improve editor performance when viewing large numbers +of map components. See Cubic Clipping. + +

    Cubic Clip Zoom Out + +

    + +This requires that the Cubic Clipping function be toggled on. It +Increases the Depth of Field (distance in which map components are +seen) in the Camera Window. Increasing the distance seen in the +Camera window can significantly slow down speed at which your point +of view moves in the camera window. Increase the zoom to maximum +distance only if you have a relatively powerful editing system. See +Cubic Clipping.
+ +

Show
+ + + +This is a pop-up menu with checked toggle functions for each of +the features on the list. If a feature is checked, all map +components of that type will show in both the Camera window and the +Map windows. If the feature is not checked, all map components of +that type will be hidden. + +
    Names + + + +Shows names of entities. + +

    Blocks + +

    + +Shows an additional grid over the Map window with subdivisions +every 1024 units. + +

    Coordinates + +

    + +Shows the Map window coordinates along the left and top edges of +the Map window. + +

    Entities + +

    + +Shows entities, including brush entities, lights, and +models. + +

    Paths + +

    + +Shows the linkage connections between entities. This includes +triggers targeted at entities and path lines. + +

    Lights + +

    + +Shows Light entities. + +

    Water + +

    + +Currently non-functional. Look for future fix. Shows brushes +with water, lava, or slime content. + + + +

    Clip Brush + +

    + +This shows brushes with the common/clip content, including +common/clip and common/weapon_clip. The entire brush is +affected, not just clip brush texture sides. + +

    Hint Brush + +

    + +Shows brushes made with the hint texture. + +

    World + +

    + +Shows all non-entity brushes. + +

    Detail + +

    + +Shows all brushes marked with a Detail setting. + +

    Curves + +

    + +Shows all curve patches. + +

    Caulk + +

    + +Shows brush sides containing the common/caulk texture (does not +affect entire brush). + +

    Design Tip: When you optimize detail brushes by caulking +unseen brush faces, isolate the detail brushes in a region then +turn off Caulk. Brush faces that need caulking will show up clearly +as you move around the brushes.
    + +

    Angles + +

    + +Shows facing angle of player start spots by way of a white +arrow.
+ +

Hide/Show
+ + + +This is an immensely powerful and useful tool. It lets the user +temporarily hide map components that may be in the way of working +on other brushes. Hidden components are not affected by CSG +actions. + +
    + +Hide Selected + + +Selected map components are hidden from view (and CSG cutting +operations) until the Show Hidden command is executed. + +

    Show Hidden + +

    + +Previously hidden map components are returned to view.
+ +

Entities as…
+ + + +The editor can show model entities (referring at this point only +to Misc_Model entities) in several formats. Note: More +detail in a model shown in the Camera and map views will affect the +ability of the editor to display the map. If the editor responds +sluggishly, try reducing the level and/or type of detail shown for +models. + +
    Bounding Box + + +This is the simplest form of display. A box defines the outer +dimensions of the model. This is the least costly manner of +display. + +

    Wireframe + +

    + +Non-functioning. + +

    Selected Wireframe + +

    + +The Model is displayed as a bounding box until selected, at +which point the wireframe mesh for the model appears. + + + +

    Selected Skinned + +

    +The Model is displayed as a bounding box until selected, at +which point the skinned mesh for the model appears. + +

    Skinned + +

    +Only the skinned mesh for the model appears in the map and +Camera views. + +

    Skinned and boxed + +

    +The skinned mesh for the model appears inside a wire frame of +the bounding box in both the map and Camera views.
+ +

+ + + +This command toggles on (checked) or off when selected. Cubic +Clipping may be the most effective way to improve editor +performance. When turned on, only those map components near +the player are displayed in the Camera window. Any map components +beyond a certain depth of field will not be displayed in the camera +window (it has no effect on map windows). As the user moves +through the map in camera view, map components will pop into being +as the point-of-view (POV) draws closer and disappear as the POV +moves farther away. The shorter the distance "seen" in the +camera view, the better will be the editor performance when moving +through the map. Use the Cubic Clip Zoom commands +(see above) to modify the depth of field seen in the camera +view. + +

Open GL Lighting
+ + + +This feature is not fully implemented yet. It toggles on +(checked) or off when selected. When it is finished, all planes +facing a particular direction will shade the same way (curves will +shade like brushes) and the overall quality of the camera view will +be better. It will be slower however. + +
    + +Tip: As it currently is implemented, this lighting can be +useful when working with irregular surfaces all covered with the +same texture.
+ +

Show Brush/Patch Dimensions
+ + + +When you select a brush, the hi-lighted image in the map window +shows its dimensions, in game units. If multiple patches or brushes +are selected, the size will be the dimensions of the grouping. If +any kind of non-brush model entity is included in the grouping, the +dimensions are not shown. + +

File Management Commands

+ +
New Map
+ + + +This creates a new map file. If the current map file contains +any unsaved changes, the editor will offer the option to +cancel. + +

Open…
+ + + +This opens up the Maps folder as defined in the preferences. It +will show all valid map files in that directory. User may browse to +other directories from here. Double clicking on a map file +icon or hi-lighting that map and selecting Open will open +the map. The user may also type in a map file name. Be sure to add +the ".map" or ".reg" extensions or the editor will not find the +file. + +

Save…
+ + + +Saves a new map file to the default Maps directory. A reopened +map file will be saved to its source directory. Note, that it is +usually a good idea to save the map into the directory used by the +compiler as the source of its map data. Remember to give the file a +name. The compiler doesn't like to work with files called Unnamed +Map. + +

Save As…
+ + + +Opens the default directory for maps and prompts the user to +give the map a filename. + +

Save Selected…
+ + + +The selected brushes are saved as a map file. This is not the +way to make prefabs, though. + +

Save Region
+ + + +If the user has "regioned off" a subset of the map, this command +will save it as a separate file. It is grayed out unless the user +has created a regioned area. The editor prompts the user to enter a +file name before saving. + + + +

Reopening Maps
+ + + +(ALT+1 to 6 when File menu is held open) + +
OK, There isn't actually a command called this. When you open +the File Menu, you will see (after you've done some work on maps), +the path/file names for the last six maps that you worked on. They +are listed here for easy opening access). + +

Projects and Preferences

+ +

New project…
+ + + +Make a new project file. This allows you to set up different +preferences. + +

Load project…
+ + + +Make a new project file. This allows you to set up different +preferences. + +

Project Settings…
+ + + +Change pathnames and add, remove or modify commands. + +

Miscellaneous Commands

+ +
Map info…
+ + + +This gives a readout of brushes (including curve patches) and +entities in the map, including the total number of brushes that are +not part of entities. There is also a breakdown, by type, showing +the number of entities in the map. + + + +

Entity info…
+ + + +This gives a read-out of the entities in a map by their +type. It allows you to select an entity, which +hi-lights it in the XY Map. Good for locating lost entities. + +

Preferences
+ + + +This opens the window for setting or modifying the parameters, +paths and features of the editor. Preferences are discussed in the +Installation & Set Up section earlier in this document. + +

Opening Menus from the Keyboard

+ +These are the keyboard shortcuts that open up the menus. If you +continue to hold down the ALT key, many of the commands in that +menu may be activated with an ALT+ keystroke command. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
File(ALT + F)
Edit(ALT + E)
View(ALT + V)
Selection(ALT + S)
Bsp(ALT + B)Note: Toggles between BSP & Brush. Hit enter to open selected.
Grid(ALT + G)
Textures(ALT + T)
Misc(ALT + M)
Region(ALT + R)
Brush(ALT + B)
Curve(ALT + C)
Plugins(ALT + P)
Help(ALT + H)
+

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch11/pg11_1.htm b/docs/manual/Q3Rad_Manual/ch11/pg11_1.htm new file mode 100644 index 00000000..e495ca6c --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch11/pg11_1.htm @@ -0,0 +1,116 @@ + + +Q3Radiant Editor Manual: Page 11.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 8: Compiling Maps

+ +To turn a map file from editor code into game code, it must be +processed or "compiled". In Quake engine gaming, this is often +referred to by the name "BSP", as in "I need to BSP my map before +you can play it." The word "BSP" is actually an abbreviation +for "binary space partition", the type of data organization +procedure John Carmack used when creating the graphic engine for +"DOOM". + +

The primary BSP process builds the game spaces, +establishes the position of entities, and builds a lighting map of +the arena. Altogether, there are four distinct processes that +can be run together or separately. The first, the bsp process +establishes the data organization of the map. The second phase, the +vis process, builds the walls and internal spaces. The third +process lights the map, calculating brightness and shadow and the +color of the light that falls on every map surface. The fourth and +final process is the Bot bsp, which creates the area (.aas) file +that the bots use to navigate the map. + +

The size and complexity of a map and the computer's raw +processing speed determine how long it will take a map to compile. +Tiny one-room maps that lack detail or numerous lights will compile +rapidly. As maps become larger, are broken up into more +spaces and have more complex lighting, the speed of compile +drops. + +

Generally speaking, if you have an older, slower processor, you +may want to make very small maps. + +

The BSP Menu
+ +The bsp menu contains a number of compile options. The process +you choose will depend on what you are doing with the map at the +time you choose to compile. + +

novis - Only the bsp function is performed. Checks +for map leaks. No light information is created, so the map is seen +at "fullbright". Because there are no shadows to get in the +way, this mode is also good for looking for overlapping brushes, +and texture misalignment. + + + +
fastvis - Performs a bsp and a quick version of the vis +process. The entire world is made into a single bsp partition. It's +fast, but when you look in a particular direction, you see every +single detail in that direction. Nothing is blocked. A light map is +created. This mode was used for space maps. + + + +
fullvis - the world is subdivided and broken up +into smaller chunks so you can see only what is logically in your +view. A light map is created. This is what is used to check +polygon-in-view counts. Combined with light extra, it is the final +compile for all maps. + + + +
entities only - When you add or subtract non-brush model +entities from a map, use this compiler. It's very quick. If you +change the brush components of a brush model entity (like a trigger +or a door), you must do a compile that includes a vis stage (fast +or full). If you are only changing the properties, an entities-only +will do. However,, if a brush model entity also has a md3 model +component, the map must be at least fastvis'd for that entity to +appear in the map. + + + +
relight - Use only if no geometry (or light emitting +textures) have been changed. It will rebuild the light map with the +new information. + + + +
(nocurves) - This function is always a modifier to +another bsp command. It does (or doesn't do) what it says. The map +is compiled without curves. + + + +
(nowater) - This function is always a modifier to another +bsp command. The map is compiled without water, lava, or slime. + + + +
(no light) - This function is always a modifier to +another bsp command. No light map is generated. A fast way to check +polycounts. Most often used in conjunction with the novis bsp +command. + + + +
(-light extra) - This function is always a modifier to +another bsp command. A finer degree of subdivision is used to +create a more detailed light map. This is generally only done when +the lighting is going through a final fine-tuning because it takes +a long time. Instead of being calculated in 16 unit increments, the +light is calculated in 8 unit increments. This has no effect on +final map size, only on the time needed to compile. + +

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/ch12/pg12_1.htm b/docs/manual/Q3Rad_Manual/ch12/pg12_1.htm new file mode 100644 index 00000000..2b79b319 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/ch12/pg12_1.htm @@ -0,0 +1,285 @@ + + +Q3Radiant Editor Manual: Page 12.1 + + + +

Q3Radiant Editor Manual

+
+

Tools 9: Debugging Maps

+ +Regardless of your skills, you can almost guarantee that you are going to make mistakes building your maps. You need tools to help you find and correct those mistakes. There are two classes of map debugging tools usable with Quake III Arena. The first are those that the editor gives you. The second are commands usable in the game. + +

The Editor's Debug Tools

+ +The Q3Radiant editor has some built in debugging tools + +

The Pointfile
+ +One of the most useful tools in the box, this is the "red flag" that warns you about problems with the "hull" or "shell" of the map. When you compile a map, the bsp process checks the integrity of the map hull. If a map has a hole in it's hull or if an entity's origin point is placed outside the map hull, the map will "leak". Quake III Arena maps must be totally contained volumes. They cannot have "leaks" in them. Leaks are openings in the hull between the contained space (or "breathable" as one mapper has described it) and the outer void where nothing can abide. + +

The pointfile appears as a series of points, connected by red line segments, that traces a connecting path between an entity inside the hull and a point in the outside world.. Follow the pointfile through the map and note where it passes out of the enclosed space and into the void. In the case of an entity outside the world, it may just draw a line near the entity. You may need to turn off the display of clip and hint brushes, and curves to find the leaks. Adjust your solid map geometry to close up the leaks. + +

When you save the map (or an auto-save occurs), the pointfile disappears. You can bring the pointfile back by toggling this command. + +

Note: If you use a front-end program for compiling, such as Q3Build, you will need to reload the map file and select the "pointfile" command under the File menu. + +

Next leak spot
+ + +If you have a pointfile displayed in your map, use this command to move from point to point along the file. It's an easy way to move along the path to the point where the red line passes out of the contained space of the map. + +

Previous leak spot
+ +A feature just like "Next leak spot", except that you move backwards along the pointfile. + +

Junk.txt
+The Q3MAP compiler outputs this log file. It logs what the compiler is doing during the process; displays error messages and +gives final compile times for each phase. Because the compiler works in three discrete phases, you can also use this +output to gauge how far along the compile has gone. Edit the project file to change the path to the destination for this +output. + +

Error Messages
+When you compile a map, you are likely to get error messages. Most of these are not serious and the game engine either corrects them or ignores them. This is a sampling of common messages and what you should do about them. + +

Mixed faces: One or more faces on a brush has a surface parameter that conflicts with the other surface parameters. This is not a problem. Putting nodraw or clip on a brush that has a face that draws will cause this. That includes most all "flame" brushes, many water brushes, and just about every instance where alpha-channel textures are used to create see-through brush faces. + +

Bad point to polygon form factor: A curve patch is larger than 512 units in at least one dimension. This is not fatal, but may result in some unusual light artifacts on the curve. + +

Unknown surfaceparm: "nomipmaps" Some shaders contain old or incorrectly spelled parameters. This is not a problem. + +

Too many portals. Your map is broken into too many separate hulls by areaportal brushes. Try to keep the number of +discrete portalled areas under 16. + +

Duplicate plane. During the course of manipulating brushes, you may have moved edges in such a manner that two +adjacent sides of a brush now form a single brush side. Use Find brush to locate the problem brush. Use the old brush as a template or pattern, but build the new one with a single side in the place of the duplicate plane sides. One way to solve the problem is to use the Clipper tool cut off a corner instead of collapsing two faces into one. While this is not a serious problem for multiplayer play, it can create "solid" areas in the bot navigation (.aas) file. This makes the bots think there are walls in places where there appear to be none. You can check for solid areas with the "bot_testsolid 1" inside the game (after creating an .aas file). See the Bot Navigation appendix for more details. + +

******* Leaked *******. There is a hole between the contained space of your map and the outer void. Use the pointfile to locate the problem. + +

Couldn't load baseq3/pics/colormap.pcx trying tools/colormap.pcx...failed! This is not a compile error, +but a loading error. Correct it by checking the hi-color textures setting in Preferences. + +

Loading base_light/light_flare...failed, using default shader. Just ignore this. + +

match token ("{") failed at line [line number]. You broke a shader while editing it. Go closely look at the shader you most recently edited. Chances are you'll find a bracket error in the syntax. + +

In-game Debug tools

+One of the best places to look for errors in your map is within the Quake III Arena game itself. After the map has compiled, +execute your Debug Config and load your map. The commands here will help you discover the errors in your map. + +

General Cheats
+The following are the general Quake III Arena cheat codes (they're actually developer's tools). You can enter them from the console, or bind them to whatever keys you prefer using the syntax bind [key] [command]. If the command is a string with spaces, then the string should be enclosed with quotation marks. + +

give [weapon/item/ammo/health] [amount] // Give selected weapon/item/ammo/health + +

give all // Gives all weapons, ammo, armor, and items + +

god // Godmode + +

noclip // Pass through anything. Use in conjunction with r_fastsky 1 or r_clear 1, or you will have hall of mirror problems when you pass out of the bounds of the map. + +

notarget // Bots think you're a pal viewpos // Outputs player coordinate position and facing angle. + +

General Toggle Binds
+(Thanks to original authors GrandMaMa and Eutectic) +
The following are some binds that you might like handy. Note that some of these will alter saved settings, so make sure that your preferred settings are loaded on startup, like in your autoexec.cfg file. + +

bind "your key" toggle r_speeds // polycount report +
bind "your key" toggle r_showtris // tris triangles +
bind "your key" toggle cg_drawfps // framerate counter +
bind "your key" toggle com_speeds // shows all stats +
bind "your key" toggle r_drawentities // ents won't be drawn +
+ +

Debug Mode: Logfile Creation
+One method that can be used for troubleshooting maps where curious errors occur (usually when simply too much is going on at +once) is to resort to poring over the developer output. The console buffer is limited, and error-producing maps may crash, so printing the output to a logfile is desired. This script allows the toggling of these functions. + +

bind "your key" vstr dbg set dbg vstr debug_1 + +

set developer 0 set logfile 0 set debug_1 "set dbg vstr debug_0;echo DEBUGMODE ON;developer 1;logfile 2" set debug_0 "set +dbg vstr debug_1;echo DEBUGMODE OFF;developer 0;logfile 0"

+ +

GL_Showtris/R_Speeds/FrameCounter Toggle
+(Based in part on an article by orginal author MD) +

The "gl_showtris" and "r_speeds" commands allow you to see the number and location of polygons (surface triangles) in your view. The " + +

Show me the Triangles +Showtris draws a white line around each triangle used to create the world when it is a part of a map's potential viewable set (PVS). This is especially effective tool, since it shows the triangle outlines of map areas that are being "seen" by the engine, which are not always just the ones that the player sees. + +

Depending on your video card, this may work well, or it may not. For some (like the Matrox cards, it comes with a huge performance hit). + +

The Need for (R_) Speeds +This output is one of the more valuable reports you can get on a map. The numbers show you the numbers that can tell you what kind of real visual costs you are encounter. Combined with other commands that turn features like entities, curves, and multi-pass texturing on and off, you can get a realistic idea of where you're having problems. + +

Here's what those cryptic numbers mean. +When r_speeds = 1, the numbers read as follows (where the # sign equals a number) + +

# / # shaders/surfs is the number of shaders in view, followec by the number of surfaces in view. + +

# leafs is how many leaf nodes are potentially visible. + +

# verts is how many vertexes are in view + +

# / # tris is the number of trangles drawn by the renderer in a single pass single pass followed by the number of +triangles drawn by the renderer with all passes. These are the numbers that are most often implied when someone talks about +"r_speeds." If the r_ext_multitexture variable is off, the numbers will reflect a more accurate accounting of the real triangle count (see multi-pass texturing section below). + +

# .## mtex #.## dc [definition under construction] + +

Frame Rate +There is a tendency for rate of frame display to become a sort of god (or at least a "greatest good") for some players. Their quality of play, whether real or psychological, revolves around how fast their computer is flipping through screen updates. Everything else, to them, is throw away. While the design and complexity of a map can affect this, so can many features that are outside of the designer's control. For that reason, frame rate is not a particularly good way to judge the quality of your map. + +

The "cg_drawfps 1" command gives you instantaneous frame rate readout. + +

Use this command string to toggle the three at once. Include the following lines in your Debug Config script: + +

set r_showtris 0 +
set r_speeds 0 +
set cg_drawfps 0

+
bind "your key" "toggle r_showtris;toggle r_speeds;toggle cg_drawfps"
+ +

Lock the PVS Table
+(Author: MD) +
"PVS" means "potential viewable set." The PVS includes all the polygons that can be seen from a particular location in the map (i.e., where you are standing now). The game engine updates what is visible and what is not as you move through the map. You can stop this updating process, and see just how far the engine can see by moving until you find an area of the world that's not being drawn. Use this to debug views where the frame rate drops below an acceptable level. Go to a place where you get a bad "fps" reading. Execute this command. When the PVS Table is locked, you can walk through the map and see exactly how far your view extends. Surfaces in view will be drawn as normal. Non-seen surfaces will show up as the Hall of Mirrors effect (unless the fast sky or r_clear options are also set). Use the information as a guide for changing what can be seen in a view. + +

This command string script toggles the use of the PVS table to let you do this. It also toggles on the r_clear option, so +instead of Hall of Mirrors the void beyond the world is seen in fashion doll pink. + +

set r_lockpvs 0 set r_clear 0 +
bind "your key" vstr lockview set lockview vstr lockview1 +
set lockview1 "set lockview vstr lockview0;echo PVS Locked;r_lockpvs 1;r_clear 1" +
set lockview0 "set lockview vstr lockview1;echo PVS Unlocked;r_lockpvs 0;r_clear 0"
+ +

MultiPass Texturing Toggle
+(Based on an article by original author: MD<) +
The number of triangles that must be drawn before a frame can be displayed affects the speed at which the game is played. More triangles means lower speed. When a texture on a triangle requires additional drawing passes, it is the same as drawing an additional triangle again for each pass of redraw. The ideal video card for the Quake III Arena game is one that has a multi-pass texturing feature. What this means is that the second rendering pass on a texture is essentially free. Its triangle cost is not calculated into the r-speeds. Unfortunately, the map designer cannot plan on every user having such a card and must instead design for worst case scenarios. If you are working on machine that has a multi-pass texturing feature, you will need to find out how the other half plays. You need to toggle the feature off for this. + +

This feature toggles between multi-pass texturing and single-pass texturing. When multi-pass texturing is enabled, the +additional triangles are masked. They won't appear in the r_speeds report. + +

For this feature to work, the video must be restarted. That command is included in the binding. For best results, refrain from pressing the bound key again until the video has re-initialized and the map has re-loaded. Your normal setting for r_ext_multitexture should appear also. In the key binding below, it's been set to a value of 1, which is the most common. This way it will be properly set on startup, since this toggle can hose that setting. + +

set r_ext_multitexture 1 +
bind "your key" "toggle r_ext_multitexture;vid_restart"
+ +

Turning Off Curves and Entities
+How much of the r_speed cost in your map can be attributed to entities. How much to curves? These two commands turn off the +drawing of those entities. The set commands start by setting the features to their "on" condition. + +

bind "your key" toggle r_drawentities // entities won't be drawn +
bind "your key" toggle r_nocurves // curves won't be drawn
+ +

Curves, Caulk, T-Junctions and Cracks

+(From an article on the same by Martin Ka'ai Cluney) + +

During the course of Quake III Arena development, a number of solutions were created to deal with the idiosyncrasies of the compiling process. None of these problems is a game killer, but the presence of these little flaws tends to reduce the professional appearance of game maps. + +

An Explanation of "Z-Fighting"
+"Z-fighting" is caused when the engine tries to simultaneously draw two surfaces that share the same plane. "Z-fighting" +commonly occurs when two brushes with different textures are in the same place (see fig. X-1,) but it can also occur on some video cards when a patch is placed over a textured brush (see fig. X-2.) + +

An Explanation of T-Junction Cracks
+"T-junction cracks" are a little more complicated than 'Z-fighting', and can be more difficult to track down and fix. They +are caused when the vertices (control points) of a curve patch don't match up with surrounding world geometry. They can be caused when a patch extends into the world on one or more sides (see fig. X-3,) or when there is a split in the faces that make up one or more edges of a patch (fig. X-4.) + +

Avoiding T-Junction Cracks and Z-fighting
+The best way to keep maps free of "T-junction cracks" and "Z-fighting" is to keep these problems in mind while adding patches and supporting geometry. There are a few simple methods for adding patches. Initially, they may seem like more work that they're worth, but they will save hours of hunting down and fixing problems that can arise through careless construction. + +
  1. Avoid spanning more than one brush with one edge of a patch. For example, if an inverted bevel is 128 units tall, back it with 128 unit tall caulk brushes. Likewise, if the wall is made up of two vertically stacked brushes; use two +vertically stacked patches of matching heights. + +
  2. Avoid patches that extend into world brushes, unless all of the edges extend into world brushes. When +adding patches, if one edge of the patch extends into the world, while the other edges line up with other brushes, there will most likely be cracking. Sometimes, particularly in the case of 'flesh' elements, it is necessary to extend parts of a patch into the world. In these cases, extend all edges into the world, or into surrounding patches. + +
  3. Be Careful with vertices. Use Snap to Grid. Without it, your curves will create far more problems than they will otherwise might. Sometimes, especially after resizing patches, vertices can get "knocked off" the grid. Always make sure vertices are where they're supposed to be. If needed, patch vertices can always be snapped back to the grid using CTRL+ G. It's always a good idea to be completely aware of where things are in relation to the grid. + +
  4. Caulk, caulk and more caulk. Get into the habit early of building the space behind curve patches with caulk brushes. You will eliminate Z-fighting, seal up the area behind the curves, and unless you are building a map in fashion doll pink, edges that aren't aligned with the curves have a better chance of showing up.
+ +

Here are a few examples of common elements from the maps in Quake III Arena, and how they should (and should not) be built to avoid Cracks and "Z-Fighting": + +

Jump Pads +
Jump pads are probably the most common occurrence of T-junction cracks in Quake III Arena Maps. They usually extend upwards +through at least two 'levels' (layers) of textures, so they're a perfect illustration of proper caulking. They are also a +perfect illustration of 'binding' curves within structural brushes. + +

Flat arches +
Flat Arches are another good example of 'binding' curves with structural brushes. This is a handy technique when incorporating a curve into a complex map element seamlessly. + +

Rounded Wall Edges (endcapped) +
This is a simple example of terminating a wall in a rounded edge. The most important thing to keep in mind here is where +the vertices are placed. If the patch is extended into the ceiling or floor, there will almost certainly be cracks. + +

Inverted Wall Bevels +
Filleting a wall seems like it would be a simple thing, but there are many cases that could cause cracks. It's important +to make sure heights are consistent, especially in the case of layered texturing, as is the case in this example. + +

Finding and Fixing T-Junction Cracks and Z-Fighting
+There will usually be cases where, despite careful building, cracks appear. When looking for cracks that may have been missed, there are three console commands that will be a great help: + +

\r_clear 1: This will clear the frame buffer on each frame, eliminating the Hall of Mirrors effect. + +

\r_fastsky 1: This will draw the sky as a single, solid color, making it easier to see the void behind curves. This makes cracks stand out. Be aware that fastsky also disables the function of portal screens and mirrors. + +

\r_showtris 1: This will draw white lines around all of the triangles in the world, showing exactly how the geometry in the map is affecting the patches. + +

NOTE: Another good way to use these commands is to set them to toggle on a key. The Debug Config below contains these commands as toggles. + +

Turn on r_clear, and r_fastsky, and run through the map, looking at the patches from all possible angles. If there is a crack, turn on r_showtris, and make sure that the patch does not extend into the world, unless it was intended to. Next, look at the surrounding brushes. Make sure that no splits meet the edge of the patch. If neither case is true (it happens these case… 'mystery cracks'), then try a different approach to building the area; perhaps splitting one patch into two, or rearranging the brushes surrounding the patch. When none of the above seems to work, experiment with as many different ways as possible. If something works, keep it in mind for the next time. + +

A Debug Config

+The following script should be copied and pasted into a text file. Save the text file as "debug.cfg". When you want to use +these commands while playing a map, you need to load the map using the console. First type in "/devmap [mymapname] to load the map. Next type in "/debug.cfg". This executes your development configuration. Note that this changes the key assignments of some keys (you define which one is used for each assignment of "yourkey". These debugging tools are considered "cheats." They will not function during normal game play. + +

//+++++++++++++++++++++ +
//toggle on/off frames per second, polygon wireframes, and polygon in view counts with one keypress +
set r_showtris 0 //sets triangle display to off +
set r_speeds 0 //sets triangle counter display to off +
set cg_drawfps 0 //sets frame display counter to off +
bind "your key" "toggle r_showtris;toggle r_speeds;toggle cg_drawfps" + +

//The following are some individual binds for a few debug tools +
set r_drawentities 1 +
set toggle r_nocurves 0 +
bind "your key" "toggle r_speeds" // polycount report +
bind "your key" "toggle r_showtris" // Shows the actual triangles that form the world +
bind "your key" "toggle cg_drawfps" // framerate counter +
bind "your key" "toggle com_speeds" // shows all stats +
bind "your key" "toggle r_fastsky" //turns off detailed sky and turns void to sky color +
bind "your key" "toggle r_clear 1" // This will clear the frame buffer on each frame. + +

//Show coordinates that can be related to map coordinates. +
bind "your key" "viewpos" // Outputs player coordinate position and facing angle. + +

//Turn off Entities and Curves +
bind "your key" "toggle r_drawentities" // entities won't be drawn +
bind "your key" "toggle r_nocurves" // curves won't be drawn + +

//Toggle off the multi-pass texturing feature +
set r_ext_multitexture 1 +
bind "your key" "toggle r_ext_multitexture;vid_restart" + +

//Output console messages to a log file +
bind "your key" vstr dbg set dbg vstr debug_1 +
set developer 0 set logfile 0 set debug_1 "set dbg vstr debug_0;echo DEBUGMODE ON;developer 1;logfile 2" set debug_0 "set dbg vstr debug_1;echo DEBUGMODE OFF;developer 0;logfile 0" + +

//Lock the PVS Table +
set r_lockpvs 0 //turns off any existing PVS lock +
set r_clear 0 //turns "void" bright pink +
bind "your key" vstr lockview set lockview vstr lockview1 //binds three vstr scripts to a key +
set lockview 1 "set lockview vstr lockview 0;echo PVS Locked;r_lockpvs 1;r_clear 1" +
set lockview 0 "set lockview vstr lockview 1;echo PVS Unlocked;r_lockpvs 0;r_clear 0" + +

//Game Cheats (for debugging purposes) +
bind "your key" "give all" // Gives all weapons, ammo, armor, and items +
bind "your key" "god" //toggles god mode //makes player invulnerable to everything but kill triggers +
bind "your key" "toggle noclip; toggle r_clear 1"//toggles ability to pass through walls and clear function +
bind "your key" "notarget" // Bots think you're a pal (until you shoot them) +

+

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/Q3Rad_Manual/gtkrad/pg1_1.htm b/docs/manual/Q3Rad_Manual/gtkrad/pg1_1.htm new file mode 100644 index 00000000..182f2f2a --- /dev/null +++ b/docs/manual/Q3Rad_Manual/gtkrad/pg1_1.htm @@ -0,0 +1,69 @@ + + +Q3Radiant Editor Manual: New functionality in GtkRadiant + + + + + +Better movement in camera window + +

Q3Radiant Editor Manual

+
+

Better movement in camera window

+ +

+By enabling "Freelook in 3D window" in the preferences screen you can use a +noclip style of movement in the camera window. Rightclick in your camera window +(or shift+rightclick if you are in 2 mouse button mode) to start freelook mode. +The mouse can be used to look around, up arrow is forward, down arrow is +backwards, left and right are strafing. You can control the sensitivity of the +camera controls in the preferences screen, directional velocity is for movement +(forward/back/strafe) and angular velocity is mouse sensitivity. Also you can +enable inversed mouse mode here. +

+ +

+Another way of moving backward and forward in the camera window is by using +your mousewheel, scroll up is forward, scroll down is backwards. This works in +all camera modes, classic as well as freelook. +

+ +

Mod support

+ +

+1.1-TA was the first version to add builting support for mod directories, +bringing easy editing capabilities for Quake III: Team Arena. This has been +extended to support any mod developement. Simply open the project settings +dialog to set the mod directory (among several builtins, +Quake III Arena, Quake III: Team Arena and custom mods). +

+ +

Misc functionalities

+ +

+The mousewheel has gotten another new option for the 2D windows. Scroll up is +zoom in, scroll down is zoom out. +

+ +

+It is possible to texture faces simply by selecting a texture in the +texturewindow and dragging it into the 3D (Cam) window onto the face you want +to texture with it. +

+ +

+More GtkRadiant tips and tricks have been gathered on the +qeradiant.com FAQ. +

+ +

Known issues

+ +

+Current known issues for GtkRadiant releases are listed in the +qeradiant.com FAQ. +

+ +

Back | Home | Next + + diff --git a/docs/manual/Q3Rad_Manual/index.htm b/docs/manual/Q3Rad_Manual/index.htm new file mode 100644 index 00000000..45e06e96 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/index.htm @@ -0,0 +1,180 @@ + + +Q3Radiant Editor Manual: Contents + + + + +

+

Q3Radiant Editor Manual

+ +
Based on Version 192 - partly updated to GtkRadiant
+ +

By Paul Jaquays + +

With additional contributions by Astrocreep, Christian Antkow, +
EutecTic, Inolen, Mr. Elusive, Maddog, Martin Ka’ai Cluney, +
Robert A. Duffy, Small Pile of Gibs, Suicide20, and The Dog! + +

Special thanks go out to the members of the Quake3world Editing forum. + +

Your questions prompted many of the sections in this manual. + +

QERadiant.com thanks John Hutton for re-formating this manual into a more +web friendly version. +

+ +

Table of Contents

+Preface +
Introduction +
Minimum System Requirements + + +Installation & set-up + + +Entities and assets + + +New Functionalities in GtkRadiant + + +Map-building basics + + +Tools 1: Selecting and deselecting + + +Tools 2: Working with brushes + + +Tools 3: Working with curve patches + + +Tools 4: Working with textures + + +Tools 5: Working with entities + + +Tools 6: Lights & lighting + +
Tools 7: Miscellaneous commands + + +Tools 8: Compilings maps +
Tools 9: Debugging maps + + +Appendix A: Glossary of Terms +
Appendix B: Entity descriptions + + +Appendix C: Bot navigation files + + +Appendix D: Tips, tricks, and tutorials + + +Appendix E: Online resources + + +Appendix F: Default key shortcuts +
Appendix G: Shortcut keys and mouse functions + + + diff --git a/docs/manual/Q3Rad_Manual/styles/q3rad.css b/docs/manual/Q3Rad_Manual/styles/q3rad.css new file mode 100644 index 00000000..b4daab91 --- /dev/null +++ b/docs/manual/Q3Rad_Manual/styles/q3rad.css @@ -0,0 +1,23 @@ +body { font: 12pt "Times New Roman"; + margin-left: 5mm; + margin-right: 5mm; + text-align: justify; + background: #ffffff; + color: #000000 } +h1 { font: bold 24pt Arial, Helvetica } +h2 { font: bold italic 18pt Arial, Helvetica } +.subheading { font: bold 16pt Arial, Helvetica } +:link {color: blue; + text-decoration: none; } +:visited {color: purple; + text-decoration: none; } +h6 { font: 10pt "Times New Roman" } +.MsoToc2 { font: bold small-caps 12pt "Times New Roman" } +.MsoTitle { text-align:center; + font: bold 24pt "BankGothic Md BT"; + letter-spacing:2.5pt } +.heading { font: italic 10pt "Times New Roman" } +.subcontents { font: 10pt "Times New Roman" } +.tip { font: 10pt "Comic Sans MS" } +.type { font: 10pt "Courier New" } +.menu { font: 10pt Arial, Helvetica } \ No newline at end of file diff --git a/docs/manual/quake3/Compile_Manual/bspc.txt b/docs/manual/quake3/Compile_Manual/bspc.txt new file mode 100644 index 00000000..0547b97b --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/bspc.txt @@ -0,0 +1,565 @@ + + +Title: BSP Converter +Version: 2.1h +Date: 2001-03-28 +Author: Mr. Elusive + + +Description +----------- + +The BSPC tool is used to create AAS files from BSP files. +An AAS file is a file with areas used by the Quake III Arena bot in order +to navigate and understand a map. The Quake III Arena maps are stored in +BSP files. + + +Usage +----- + +bspc [- [- ...]] + +Example 1: bspc -bsp2aas d:\quake3\baseq3\maps\mymap?.bsp +Example 2: bspc -bsp2aas d:\quake3\baseq3\pak0.pk3\maps/q3dm*.bsp + +Switches: + bsp2aas <[pakfilter/]filter.bsp> = convert BSP to AAS + reach = compute reachability & clusters + cluster = compute clusters + aasopt = optimize aas file + output = set output path + threads = set number of threads to X + cfg = use this cfg file + optimize = enable optimization + noverbose = disable verbose output + breadthfirst = breadth first bsp building + nobrushmerge = don't merge brushes + freetree = free the bsp tree + nocsg = disables brush chopping + forcesidesvisible = force all sides to be visible + grapplereach = calculate grapple reachabilities + + +Several metacharacter may be used in the filter and pakfilter. + +* match any string of zero or more characters +? match any single character +[abc...] match any of the enclosed characters; a hyphen can + be used to specify a range (e.g. a-z, A-Z, 0-9) + +.pk3 files are accessed as if they are normal folders. For instance +use "d:\quake3\baseq3\pak0.pk3\maps/q3dm1.bsp" to access the +map q3dm1.bsp from the pak0.pk3 file. + +Multiple files may be listed after the switches bsp2map, bsp2aas, reach, +cluster and aasopt. + +If a BSP file is being converted to an AAS file and no output path +is entered on the command-line then the AAS file will automatically +be stored in the same folder as the BSP file. However if the BSP file +was stored in a .pk3 file then the AAS file will be stored in a folder +with the name 'maps' outside the .pk3 file. + + +Updating entity lump +-------------------- + +If an AAS file is already available for a BSP file and you ONLY change +the entities inside this BSP file then you only have to recalculate the +reachabilities. This way you can move items, platforms etc. around +without the need to recalculate the whole AAS file which can save quite +some compile time. You can recalculate the reachabilities as follows: + +bspc -reach mymap.bsp + +Where mymap.bsp is the BSP file. The mymap.aas file has to be in the +same folder as mymap.bsp or should be in the output folder specified +with the -output option. + +Keep in mind that as soon as ANY geometry in the map changes the whole +AAS file HAS to be recalculated in order to play with bots. + +NOTE: -reach does not work on optimized .AAS files! +NOTE: don't use -reach when moving the position of doors. + + +Leaks +----- + +Just like there can be vis leaks in a map there can also be clipping +leaks. Two things can be wrong when the BSPC tool outputs that a map +leaks. + +1. There are no entities in the map at all, or all entities that are +actually in the map are placed in solid. In this case the BSPC tool +outputs "WARNING: no entities inside". (At least a player start entity +is needed to load a map.) + +2. There is a spot in the map where players can go outside the map +into the void. This is bad, players should never be able to fall out +of a level. In this case the BSPC tool outputs "WARNING: entity +reached from outside". The BSPC tool also writes a mymap.lin file +that can be loaded in the Q3Radiant editor to show lines that go +through the actual leak. + +Make sure the .lin file is stored in the same folder as where q3radiant +stores the .bsp file. Load the map in q3radiant and use the +menu -> File -> Pointfile... to load the .lin file. A thick red line +will be shown in the map. Follow this line to find the leak. + + +Map bounds +---------- + +Currently a map should be within the bounds (-65536, -65536, -65536) - +(65536, 65536, 65536) for the bspc tool to compile. These are the same +limits the q3map tool has. + + +Physics +------- + +The player bounding box is a 30 units by 30 units square with a height +of 56 units. If we assume 1.75 meters being the average height of a human +and a player in Quake III Arena being 56 units high we get 32 units = 1 meter. + +Maximum step height of a player is 18 units (just keep steps 16 units or +lower). + +The maximum water jump height for bots has been set to 18 units. (height +difference between water surface and the floor jumping onto). If the +waterjump height is made higher human players will have a hard time getting +out of the water. + +With normal gravity and without the quad the maximum rocket jump height is +around 280 units (you can sometimes jump a few units higher but this is a +safe value for reference). + +The maximum height for barriers the bots will jump on is 32 units. + +Some math to calculate some other values of interest: + +gravity = 800; +jump velocity = 270; +max vertical rocketjump velocity = 670; +max run velocity = 320; +max step height = 18; + +max jump height = 0.5 * gravity * (jumpvelocity/gravity)*(jumpvelocity/gravity); +max jump height = 45 units; +NOTE: even though this is the mathematical maximum jump height always keep +the the 32 units maximum barrier height for bots in mind when building maps. + +maximum horizontal jump distance over a gap from one spot to another both +at the same height: + +t = sqrt((maxjumpheight + maxstep) / (0.5 * gravity)); +t = 0.3986 seconds; +dist = maxrunvelocity * (t + jumpvelocity / gravity); +dist = 235 units; +Because players use a bounding box we can jump a full bounding box width +furter in the ideal case. (15 units at the jump start and 15 at the +landing place). +235 + 15 + 15 = 265 units. +Again this is the mathematical maximum which players can only reach under +ideal circumstances. + + +Optimizing a map for bspc +------------------------- + +Hint brushes have no effect on the bspc tool. Only solid, clip, liquid, +cluster portal and do not enter brushes are used by the bspc tool. + +The bspc tool outputs how many areas are created for a map. Less areas +is better. Often the number of areas can be reduced by adding additional +clip brushes. By adding these additional clip brushes the complexity +of the geometry used for collision can be reduced. Do not add clip +brushes in front of the complex geometry but get the complex shaped +geometry contained within these clip brushes. Things that should be +contained within clip brushes are small or complex shaped (often detail) +brushes and complex and twisted curves, but also more regular curves +can be placed within a clip brush. When containing a curve within a +clip brush it's preferred to place the whole curve within the clip +brush (not just part of the curve). +Note: you can make brushes or curves non-solid when they are contained +within *full* clip or *weap* clip brushes to speed up bspc calculations. + +Always try to align your geometry to the grids. Always use the largest +grid possible for alignment of your geometry. Also try to align the +back sides of brushes which may not be visible. The more brush sides +are aligned the better. This will also speed up bspc calculations. + +Align adjacent brushes as much as possible. Make sure no tiny faces are +created due to badly aligned brushes. + +Quite often there are places in a map that are visible to players +but that players can never get to. Players would be able to walk around there +but since players can never reach such places they will never actually +move around there. If players are never able to get to such places +it's better to put a large clip brush which encloses that whole space. +This will also speed up bspc calculations and reduce the number of areas +created by the bspc tool. + +Note: the number of areas relative to the map size tells something about +the navigation complexity for players in general (also human players). +Reducing the collision complexity for bots also makes the map easier to +navigate for human players + + +func_plat and func_bobbing +-------------------------- + +When func_plat or func_bobbing entities are placed in a map the bots will +use them if possible. The bots assume they can stand on top of the bounding +box of the model used for the func_plat or func_bobbing entity. As a result +creating complex shaped func_plat or func_bobbing models is mostly a bad +idea. You have to make sure the bots (and players) can actually stand +everywhere ontop of the bounding box of the model. + + +Cluster Portals +--------------- + +A map is divided into areas. Several of these areas can be grouped together +to create a cluster. The clusters are seperated by cluster portals which are +areas themselves. One of the things the bot uses these clusters for is a +multi-level routing algorithm. When a map is efficiently divided up into +clusters bot calculations will be faster. + +several things to take into account: + +- The BSPC tool tries to create cluster portals automatically but additional + cluster portals can be created by placing "clusterportal" brushes. +- Cluster portals are manually created by placing "clusterportal" brushes + inside the map. +- Cluster portal brushes are a tool to optimize a map for CPU usage by the + bots. They are not needed for the bots to operate correctly. +- The "clusterportal" brushes should not be used outside the world hull. +- The cluster portals do not have any effect on vis. +- If a door is already sealed with an areaportal brush, a clusterportal is + not necessary there. (area portals are also used as cluster portals). +- Just like the area portals, the cluster portals must seal a space off + entirely from other areas. +- The cluster portal areas should seal off a cluster in a way that the only + path towards another cluster is through a cluster portal area. +- Only create cluster portals where people can walk or swim through. +- Don't create cluster portals in gaps in the floor. (people would fall through) +- If you have two sealed off clusters and you add a teleporter between them + then the two clusters will be merged again because of the teleporter. +- Cluster portals must seperate no more and no less than two (2) clusters. +- Try to create clusters with all the same number of 'reachability' areas. + for instance if the map has 5400 areas try to create 10 clusters with 540 + areas each, or 12 clusters with 450 areas each, etc. The BSPC tool lists + the number of reachability areas in each cluster. + With Q3A version 1.25 and up you can use /set bot_testclusters 1 on the + console and the area number and cluster number you're in will be printed + on the screen. These cluster number correspond to the cluster numbers + the BSPC tool prints. +- Minimize the number of clusters with only a few (less than 10) areas. +- When adding "cluster portal" brushes try to place them in places with + minimal geometric complexity. For instance place them inside convex door + openings or small hallways (not infront of door openings). Ideally the shape + of the face through which a player walks or swims into the cluster portal + is the same as the shape of the face through which a player leaves the + cluster portal. Also ideally the open space inside the cluster portal + brush is convex. +- Make cluster portals about 16 or 32 units thick or align them with + adjacent geometry. Don't make them too thick though. +- Minimize the total number of cluster portal areas at all times. The more + cluster portal areas you have the more CPU the bots need. +- Items have no effect at all on the creation of areas or clusters. + The same goes for item_botroam. + + +Do Not Enter areas +------------------ + +When bot navigation problems show up or you want to make sure a bot never tries +to go to a certain place "do not enter" brushes can be used. + +several things to take into account: + +- The "do not enter" brushes should not be used outside the world hull. +- The "do not enter" brush is Not a clip brush for the bot. +- The "do not enter" brush is a tool of last resort. Do not use it unless + there are serious navigation problems. +- The number of "do not enter" brushes should be minimized because these + brushes create additional areas for the bots. +- The "do not enter" brush will create a New area that the bot will try to + avoid. However if the bot somehow ends up in a "do not enter" area or there + is a valid goal inside the "do not enter" area then the bot is allowed to + go into and out of that area. So if the bot somehow gets in a "do not enter" + area the bot will be able to get out. + + +Bot roaming +----------- + +The item_botroam entity can be used when a bot does not roam the whole level +or prefers to go to only specific areas. This (invisible) item can be placed +in a map just like regular items. Nobody can actually pick up the item it's +only used to attract bots to certain places of the map. The item_botroam has +a key "origin". The value is set by Q3Radiant automatically. The item_botroam +also has a key "weight". The value is the weight of the roam item and is +relative to the weight of other items in the map. The bot character specific +item weights are stored with the bot characters in the botfiles/bots/ sub-folder +in the .pk3 file. The value of the weight is a non-zero floating point value, +most often in the range 0 to 400. (Higher values are allowed but keep in mind +that the bot should also still go for normal items, so don't make the +item_botroam weight to high.) + +When a bot should never go for a specific item the key "notbot" with value "1" +can be used for that item. This key with value can be used for every available +item in Quake III Arena. + +The suspended flag can be used on all items (item_botroam included). +However keep in mind that when a suspended item is not anywhere near the +ground the bot will ONLY try to go for this suspended item using jump pads. + + +Team based entities +------------------- + +You can use the "bot_notteam" entity key with value "1" or "2" on teleporters +(trigger_teleport or trigger_multiple pointing at a target_teleporter), +elevators (func_plat), cyclic movers (func_bobbing), jumppads (trigger_push) +and areas that hurt the player (trigger_hurt). +When "notteam" is set to "1" only bots using the travel flag TFL_NOTTEAM1 will +use the entity or move through the area. When "bot_notteam" is set to "2" only +bots using the travel flag TFL_NOTTEAM2 will use the entity or move through the +area. These travel flags can be used in the game source code. Using this entity +key also only has effect if the mod the map is being made for supports team based +navigation for bots. + + +Testing AAS files +----------------- + +One of the easiest ways to test the AAS file is to load the map in +Quake3 in teamplay mode (type /set g_gametype 3 on the console before +loading the map). Enter a team and add a bot to your team. Use the +team order menu (by default bound to the key F3) to command the bot +to follow you. Walk around the map and see if the bot is able to +follow you everywhere. + +Map bugs can sometimes cause certain places in the map to show up +'solid' in the AAS file. The bots cannot travel through these 'solid' +areas. To test for these 'solid' places set the cvar bot_testsolid +to 1 on the console. (type /set bot_testsolid 1) The map has to be +started with devmap instead of map before the cvar bot_testsolid can +be set. When the cvar is set to 1 then either "empty area" or +"SOLID area" will be printed on the screen while traveling through a map. +Several map bugs can cause these 'solid' places in the AAS file. +- Sometimes microscopic brushes are left over after a brush CSG. Search + for such brushes in the problem area and delete them. +- Tiny brush faces (not curves) can also cause problems. Due to vertex + snapping in the q3map tool those tiny brush faces can be snapped out + of existence. Such faces will not show up in Quake3 and you'll see + tiny peek holes or slits where you can view through the geometry. + Allign vertexes of and edges of adjacent brushes to remove and avoid + such tiny faces. Placing a clip brush in front of the face that is + snapped out of existence will also remove the 'solid' area but ofcourse + it's much better to remove the peek holes and slits. +- Another cause could be a brush with a collapsed side. Check how many + sides a brush has and how many sides actually have a surface. Rebuild + brushes with collapsed sides. +- All faces contained within liquid brushes using a shader without + "surfaceparm trans" set will be removed. Those contained surfaces will + not be visible and can cause the liquid to appear "solid" in the AAS file. + +If you insist creating an AAS file for a map with bugs then the option +-forcesidesvisible can be used. This should fix all the problems with areas +showing up solid in the AAS file. However creating an AAS file with this +option takes a lot longer (often more than twice the normal compile time). + +Clusters can be tested with the cvar bot_testclusters. +(type "/set bot_testclusters 1" on the console) + +Jumppads can also be tested. Type the following on the Quake3 console +before loading your map: + +/set bot_maxdebugpolys 1024 +/set bot_visualizejumppads 1 +/set bot_forcereachability 1 + +Now load the map. A counter will be shown and goes from 0% to 100%. +When the counter has reached 100% type /set bot_debug 1 and +/set r_debugSurface 2 on the console. For every jumppad the +default arch of travel (without using air control) will be visualized. +This only works if your .aas file is not optimized. + + +Error messages +-------------- + +Level designers should not worry too much about the following messages and/or warnings. The things reported are non fatal and won't cause any major problems. Some of the messages are just debug left overs. + +"AAS_CheckArea: area %d face %d is flipped\n" +"AAS_CheckArea: area %d center is %f %f %f\n" +"AAS_CheckFaceWindingPlane: face %d winding plane unequal to face plane\r\n" +"AAS_CheckFaceWindingPlane: face %d winding reversed\r\n" +"area %d face %d flipped: front area %d, back area %d\n" +"area %d face %d is tiny\r\n" +"face %d and %d, same front and back area but flipped planes\r\n" +"AAS_SplitFace: tiny back face\r\n" +"AAS_SplitFace: tiny back face\r\n" +"AAS_SplitArea: front area without faces\n" +"AAS_SplitArea: back area without faces\n" +"gsubdiv: area %d has a tiny winding\r\n" +"AAS_TestSplitPlane: tried face plane as splitter\n" +"found %d epsilon faces trying to split area %d\r\n" +"AAS_SplitArea: front area without faces\n" +"AAS_GetFace: face %d had degenerate edge %d-%d\r\n" +"AAS_GetFace: face %d was tiny\r\n" +"WARNING: huge winding\n" +"bogus brush after clip" +"split removed brush" +"split not on both sides" +"two tiny brushes\r\n" +"possible portal: %d\r\n" +"portal %d: area %d\r\n" +"WARNING: CM_GridPlane unresolvable\n" +"WARNING: CM_AddFacetBevels... invalid bevel\n" +"WARNING: CM_SetBorderInward: mixed plane sides\n" +"WARNING: bevel plane already used\n" +"trigger_multiple model = \"%s\"\n" +"trigger_teleport model = \"%s\"\n" +"found a trigger_push with velocity %f %f %f\n" +"AAS_TraceBoundingBox: stack overflow\n" +"AAS_TraceAreas: stack overflow\n" +"AAS_LinkEntity: stack overflow\n" +"MergeWindings: degenerate edge on winding %f %f %f\n" +"Warning: MergeWindings: front to back found twice\n" +"FindPlaneSeperatingWindings: winding1 non-convex\r\n" +"FindPlaneSeperatingWindings: winding2 non-convex\r\n" + + +When one of the following messages, errors or warnings is found then there is often something to be fixed. + +"WARNING! HashVec: point %f %f %f outside valid range\n" +"This should never happen!\n" + While storing the AAS file some vertex was found outside the valid map bounds. When this happens some part of the map is likely to have badly aligned brushes or weird shaped curves. Clipping off or rebuilding complex shapes often helps. +"trigger_push start solid\n" + The trigger_push start point is in solid. Try making the trigger_push brush a bit larger or move it around a bit. +"trigger_push without target entity %s\n" + Could not find the target entity of the trigger_push with the target field %s. +"trigger_push without time\n" + trigger_push entity found without "time" field. +"trigger_multiple not in any jump pad area\n" +"trigger_push not in any jump pad area\n" + A trigger_push entity was found not to be in any valid jumppad area. (the message states trigger_multiple but it should have been trigger_push) Try making the trigger_push brush a bit larger or move it around a bit. +"trigger_multiple at %1.0f %1.0f %1.0f without target\n" + A trigger multiple was found at the given coordinates without a "target" field. +"target_teleporter without target\n" + A target_teleporter entity was found without target field. +"trigger_teleport at %1.0f %1.0f %1.0f without target\n" + A trigger_teleport entity was found at the given coordinates without "target" field. +"teleporter without misc_teleporter_dest (%s)\n" + The destination of a teleporter with target field %s could not be found. +"teleporter destination (%s) without origin\n" + A teleporter destination with the target name %s was found without origin field. +"teleporter destination (%s) in solid\n" + A teleporter destination with the targetname %s was found to be in solid. +"teleported into slime or lava at dest %s\n" + A player would be pushed into slime or lave at the teleporter destination with the targetname %s. +"trigger_multiple not in any area\n" + A teleporter trigger was found not to be in any valid area. Try moving the trigger around a bit. +"func_plat without model\n" + A func_plat entity was found without model field. +"func_plat with invalid model number\n" + A func_plat entity was found with the model field set to some invalid number. +"func_bobbing without model\n" + A func_bobbing entity was found without model field. +"func_bobbing with invalid model number\n" + A func_bobbing entity was found with the model field set to some invalid number. +"%s in solid at (%1.1f %1.1f %1.1f)\n" + An item with classname %s was found to be in solid at the given coordinates. +"empty aas link heap\n" + Some part of the map has some rather complex clipping. Reduce the geometric complexity or use clip brushes to reduce the clipping complexity. +"too many entities in BSP file\n" + There are too many entities in the bsp file. +"error opening %s\n" + Could not create a new AAS file. Hard disk might be full. +"error writing lump %s\n" + Could not write an AAS lump to file. Hard disk might be full. + + + +Version Changes +--------------- + +2.1h (2001-03-28) + +- fixed crash bug + +2.1g (2001-02-18) + +- added bot_notteam support on trigger_hurt entities + + +2.1f (2001-02-06) + +- added some AAS statistics +- don't flood through faces when creating clusters + + +2.1e (2001-01-10) + +- fix map size limitation + + +2.1d (2000-12-17) + +- renamed "notteam" to "bot_notteam" + + +2.1c (2000-11-02) + +- added fs_maxfallheight +- compiled with larger map size bounds + + +2.1b (2000-09-15) + +- fixed cfg file loading + + +2.1 (2000-06-28) + +- added model numbers for AREACONTENTS_MOVER +- added team based func_plat, func_bobbing, trigger_teleport and trigger_push reachabilities + + +2.0 (2000-06-21) + +- fixed swim reachabilities +- fixed some reachabilities through cluster portals +- fixed jump reachabilities +- changed some start travel times +- added travel time settings to cfg + + +1.9 (2000-03-27) + +- fixed func_bobbing entities with origin brush + + +1.8 (2000-01-14) + +- fixed trigger_teleport bug. +- increased max map bounds to (-8192, -8192, -8192)-(8192, 8192, 8192) +- increased max points on winding +- made "HashVec: point x y z outside valid range" non-fatal +- fixed rocket jump reachabilities +- added force sides visible option +- increased simulated stack size for area traces + + +1.7 (1999-12-22) + +- fixed ducked bounding box size +- fixed sv_maxsteepness being zero in aas configuration +- AAS files are now automatically stored in BSP file folder +- fixed crash bug caused by overflow of a simulated stack diff --git a/docs/manual/quake3/Compile_Manual/cfgq3.c b/docs/manual/quake3/Compile_Manual/cfgq3.c new file mode 100644 index 00000000..47e43c80 --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/cfgq3.c @@ -0,0 +1,78 @@ +//=========================================================================== +// BSPC configuration file +// Quake3 +//=========================================================================== + +#define PRESENCE_NONE 1 +#define PRESENCE_NORMAL 2 +#define PRESENCE_CROUCH 4 + +// more bounding boxes can be added if required +// always minimize the number of bounding boxes listed here to reduce AAS file size +// for instance if players cannot crouch then it's good to remove the bbox definition for it + +//bounding box when running/walking +bbox //30x30x56 +{ + presencetype PRESENCE_NORMAL + flags 0x0000 + mins {-15, -15, -24} + maxs {15, 15, 32} +} + +// bounding box when crouched +bbox //30x30x40 +{ + presencetype PRESENCE_CROUCH + flags 0x0001 + mins {-15, -15, -24} + maxs {15, 15, 16} +} + +// do not forget settings as they might not be defaulted correctly when this cfg is used +settings +{ + // physics settings + phys_gravitydirection {0, 0, -1} // direction of gravity + phys_friction 6 // friction + phys_stopspeed 100 // stop speed + phys_gravity 800 // gravity + phys_waterfriction 1 // friction in water + phys_watergravity 400 // gravity in water + phys_maxvelocity 320 // maximum run speed + phys_maxwalkvelocity 320 // maximum walk speed (set for running) + phys_maxcrouchvelocity 100 // maximum crouch speed + phys_maxswimvelocity 150 // maximum swim speed + phys_walkaccelerate 100 // acceleration for walking + phys_airaccelerate 0 // acceleration flying through the air + phys_swimaccelerate 0 // acceleration for swimming + phys_maxstep 18 // maximum step height + phys_maxsteepness 0.7 // maximum floor steepness a player can walk on + phys_maxwaterjump 19 // maximum height for an out of water jump + phys_maxbarrier 33 // maximum barrier a player can jump onto + phys_jumpvel 270 // jump velocity + phys_falldelta5 40 // falling delta for 5 damage ( see PM_CrashLand in game/bg_pmove.c ) + phys_falldelta10 60 // falling delta for 5 damage ( see PM_CrashLand in game/bg_pmove.c ) + // reachability settings + // the following are all additional travel times added + // for certain reachabilities in 1/100th of a second + rs_waterjump 400 + rs_teleport 50 + rs_barrierjump 100 + rs_startcrouch 300 + rs_startgrapple 500 + rs_startwalkoffledge 70 + rs_startjump 300 + rs_rocketjump 500 + rs_bfgjump 500 + rs_jumppad 250 + rs_aircontrolledjumppad 300 + rs_funcbob 300 + rs_startelevator 50 + rs_falldamage5 300 // avoid getting 5 damage + rs_falldamage10 500 // avoid getting 10 damage + // if != 0 then this is the maximum fall height a reachability can be created for + rs_maxfallheight 0 + // maximum height a bot may fall down when jumping to some location + rs_maxjumpfallheight 450 +} diff --git a/docs/manual/quake3/Compile_Manual/headskins.txt b/docs/manual/quake3/Compile_Manual/headskins.txt new file mode 100644 index 00000000..bf45f9f5 --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/headskins.txt @@ -0,0 +1,75 @@ +search orders with different settings + + +===================== +NON-TEAMPLAY +===================== + +------------------------------------------------- +headmodel = *callisto/lily + +models/players/heads/callisto/lily/head_default.skin +models/players/heads/callisto/head_lily.skin + + +------------------------------------------------- +headmodel = callisto/lily + +models/players/callisto/lily/head_default.skin +models/players/callisto/head_lily.skin +models/players/heads/callisto/lily/head_default.skin +models/players/heads/callisto/head_lily.skin + + + +===================== +Q3 TEAMPLAY +===================== + +------------------------------------------------- +team_headmodel = *callisto/lily +team = red + +models/players/heads/callisto/lily/head_red.skin +models/players/heads/callisto/head_red.skin + + +------------------------------------------------- +team_headmodel = callisto/lily +team = red + +models/players/callisto/lily/head_red.skin +models/players/callisto/head_red.skin +models/players/heads/callisto/lily/head_red.skin +models/players/heads/callisto/head_red.skin + + + +===================== +TA TEAMPLAY +===================== + +------------------------------------------------- +team_headmodel = *callisto/lily +team = red +teamName = Stroggs + +models/players/heads/callisto/lily/Stroggs/head_red.skin +models/players/heads/callisto/Stroggs/head_red.skin +models/players/heads/callisto/lily/head_red.skin +models/players/heads/callisto/head_red.skin + + +------------------------------------------------- +team_headmodel = callisto/lily +team = red +teamName = Stroggs + +models/players/callisto/lily/Stroggs/head_red.skin +models/players/callisto/Stroggs/head_red.skin +models/players/callisto/lily/head_red.skin +models/players/callisto/head_red.skin +models/players/heads/callisto/lily/Stroggs/head_red.skin +models/players/heads/callisto/Stroggs/head_red.skin +models/players/heads/callisto/lily/head_red.skin +models/players/heads/callisto/head_red.skin diff --git a/docs/manual/quake3/Compile_Manual/index.html b/docs/manual/quake3/Compile_Manual/index.html new file mode 100644 index 00000000..aabf7b16 --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/index.html @@ -0,0 +1,65 @@ + + + + + Compiling Manual + + + + + + + +
+
+
+ + +
+

Compiling Manual, q3map & bspc help

+
+
+ +

+ Table of Contents +

    + · + Q3Map Documentation + +
    · + BSPC Documentation + +
    . + BSPC Configuration file + +
    . + modelskins: Q3 and TA search order for model skins + +
    . + headskins: Q3 and TA search order for head skins + +
+

+ +
+ + +
+ Last updated: Jan 21, 2002   +
+
+ +
+
+ + + diff --git a/docs/manual/quake3/Compile_Manual/modelskins.txt b/docs/manual/quake3/Compile_Manual/modelskins.txt new file mode 100644 index 00000000..b0f4a011 --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/modelskins.txt @@ -0,0 +1,73 @@ +search orders with different settings + + +===================== +NON-TEAMPLAY +===================== + +------------------------------------------------- +model = hunter/harpy + + +legs: + models/players/hunter/lower_harpy_default.skin + models/players/hunter/lower_harpy.skin + models/players/characters/james/lower_harpy_default.skin + models/players/characters/james/lower_harpy.skin +torso: + models/players/hunter/upper_harpy_default.skin + models/players/hunter/upper_harpy.skin + models/players/characters/hunter/upper_harpy_default.skin + models/players/characters/hunter/upper_harpy.skin + + +===================== +Q3 TEAMPLAY +===================== + +------------------------------------------------- +team_model = hunter/harpy +team = red + +legs: + models/players/hunter/lower_harpy_red.skin + models/players/hunter/lower_red.skin + models/players/characters/hunter/lower_harpy_red.skin + models/players/characters/hunter/lower_red.skin +torso: + models/players/hunter/upper_harpy_red.skin + models/players/hunter/upper_red.skin + models/players/characters/hunter/upper_harpy_red.skin + models/players/characters/hunter/upper_red.skin + + +===================== +TA TEAMPLAY +===================== + +------------------------------------------------- +team_model = james/badass +team = red +teamName = Stroggs + +legs: + models/players/james/Stroggs/lower_badass_red.skin + models/players/james/Stroggs/lower_red.skin + models/players/james/lower_badass_red.skin + models/players/james/lower_red.skin + models/players/characters/james/Stroggs/lower_badass_red.skin + models/players/characters/james/Stroggs/lower_red.skin + models/players/characters/james/lower_badass_red.skin + models/players/characters/james/lower_red.skin +torso: + models/players/james/Stroggs/upper_badass_red.skin + models/players/james/Stroggs/upper_red.skin + models/players/james/upper_badass_red.skin + models/players/james/upper_red.skin + models/players/characters/james/Stroggs/upper_badass_red.skin + models/players/characters/james/Stroggs/upper_red.skin + models/players/characters/james/upper_badass_red.skin + models/players/characters/james/upper_red.skin + + + diff --git a/docs/manual/quake3/Compile_Manual/q3map.html b/docs/manual/quake3/Compile_Manual/q3map.html new file mode 100644 index 00000000..b1aaba23 --- /dev/null +++ b/docs/manual/quake3/Compile_Manual/q3map.html @@ -0,0 +1,410 @@ + + + + + Q3Map Manual + + + + + +

Q3map Manual

+ +
+ + + + +
+

q3map command line switches:

+
+q3map
+-----
+
+-threads <number>
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-glview
+	Write a .gl file of the bsp tree for debugging.
+-v
+	Output verbose information.
+-draw
+	Enable realtime debug drawing output.
+-nowater
+	Water, slime and lava brushes are not compiled and won't show up when running the map in Quake.
+-noopt
+	unused.
+-nofill
+	unused.
+-nodetail
+	Detail brushes are not compiled and won't show up when running the map in Quake.
+-fulldetail
+	Detail brushes will be treated as normal brushes.
+-onlyents
+	Only change the entities in a .bsp using a .ent file.
+-onlytextures
+	Only change the textures in a .bsp file.
+-micro
+	unused.
+-nofog
+	Visible surfaces that cross fog boundaries will not be split along the bound.
+	This can cause visually incorrect fog in the map.
+-nosubdivide
+	Visible surfaces are not subdivided as required by shader tesselation.
+	The shader parameter "tesssize" sets the tesselation of a surface.
+-leaktest
+	Only test the map for leaks. If a leak is found the compilation is stopped.
+-verboseentities
+	Output verbose information about entity sub-models.
+-nocurves
+	Curves are not compiled and won't show up when running the map in Quake.
+-notjunc
+	T-junctions are not fixed. This can cause tiny slits where a surface meets halfway another surface.
+-expand
+	Expands all the brush planes and saves a new map out to allow visual inspection of the clipping bevels
+-tmpout
+	Output files to a folder called "tmp".
+-fakemap
+	Write out a fakemap.map This map will contain a worldspawn entity with all the world brushes.
+-samplesize <N>
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-custinfoparms
+	Will enable custom surface flags (see below)
+
+q3map -vis
+----------
+
+-threads <number>
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-fast
+	Only calculate a very loose visiblity list. It doesn't take much time to
+	calculate but a lot more polygons will be drawn by the Q3 engine than necesary.
+-merge
+	Merge bsp leaves before calculating the visibility list. This will speed up
+	the vis calculations but mostly more polygons will be drawn by the Q3 engine
+	than necesary.
+-nopassage
+	Disable the passage visibility algorithm. The passage vis is faster and a bit more
+	tight than the old algorithm.
+-level
+	unused.
+-v
+	Output verbose information.
+-nosort
+	Don't sort the portals on complexity. Sorting mostly speeds up visibility calculations
+	because more complex portals can use information from less complex portals.
+-saveprt
+	Don't delete the .prt file after creating the visibility list.
+-tmpin <path>
+	Input files will be read from a folder called "tmp".
+-tmpout <path>
+	Output files will be written to a folder called "tmp".
+
+
+q3map -light
+------------
+
+-threads <number>
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-bounce <N> [NEW]
+	Enable radiosity calculation. Rediffuses the light emitted onto surfaces N
+	times. Will write out the BSP after every pass, so it can be cancelled.
+	Light reflected is the lightmap/vertex * texture color, subsampled to a certain
+	granularity across every lit surface. Use q3map_lightimage in a shader
+	to override the reflected color.
+-bouncegrid [NEW]
+	Radiosity affects lightgrid (entity lighting).
+-fast [NEW]
+	Enables light envelopes for area lights, speeding light up by 50x or more on
+	some maps. Has the side effect of dimmer maps with large numbers of dim surface
+	lights.
+-fastgrid [NEW]
+	Same as fast, but only for lightgrid calculation.
+-fastbounce [NEW]
+	Enables fast for radiosity passes only.
+-cheap [NEW]
+	Stop calculating light at a sample when it exceeds (255, 255, 255). This may
+	produce odd artifacts on maps with lots of saturated colored lighting. Also,
+	do not use -cheap with radiosity if you wish to preserve all light emitted.
+-cheapgrid [NEW]
+	Same as cheap, but only for lightgrid calculation.
+-area <scale>
+	This scales the light intensity of area lights.
+-point <scale>
+	This scales the light intensity of point lights.
+-notrace
+	No light tracing is performed. As a result no shadows will be casted.
+-patchshadows
+	Enable patches casting shadows.
+-novertex
+	Don't calculate vertex lighting.
+-nogrid
+	Don't calculate light grid for dynamic model lighting.
+-smooth [NEW]
+	Smart version of -extra. Only subsamples lightmap pixels that are shadowed.
+	Produces results comparable to -extra in roughly 1/3 the time. Can also be
+	used with -extra or -extrawide for 16- or 48-tap sampling respectively
+	(smoother shadows).
+-extra
+	Take four samples per lightmap pixel and store the average light value of these
+	four samples for the actual lightmap pixel.
+	This super sampling is used for anti-aliasing.
+-extrawide
+	Just like -extra four samples per lightmap pixel are calculated. However the
+	average of 12 samples is stored per lightmap pixel.
+-samplesize <N>
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-border
+	Create a debugging border around the lightmap.
+-v
+	Output verbose information.
+-nosurf
+	Disables surface tracing (detail brushes and patches) for shadow calculation.
+-dump
+	Dumps prefab files when used with radiosity for each bounce.
+
+
+q3map -vlight
+-------------
+
+-threads <number>
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-area <scale>
+	This scales the light intensity of area lights.
+-point <scale>
+	This scales the light intensity of point lights.
+-novertex
+	Don't calculate vertex lighting.
+-nogrid
+	Don't calculate light grid for dynamic model lighting.
+-nostitching
+	No polygon stitching before lighting.
+-noalphashading
+	Don't use alpha shading at all.
+-nocolorshading
+	Don't use colored alpha shading. The alpha channel will be used as if it were binary.
+	The light goes through or not and does not change color.
+-tracelight
+	Use the "-light" light algorithm for all surface unless a surface
+	uses a shader with the shader option "q3map_vlight".
+-samplesize <N>
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-v
+	Output verbose information.
+
+ + + +

The q3map options are a subset of the shader instructions that require +recompiling of the map.

+ +

q3map_bounce <fraction>

+

      [NEW] +Specify a number between 0 and 1.0 (or higher) to scale the amount of light reflected in radiosity passes. +Default: 1.0

+ +

q3map_nofast

+

      [NEW] +Surfaces that emit light with this shader parameter will disable -fast optimisation. Useful for +large areas of dim sky where you want all the dim light to reach all surfaces.

+ +

q3map_tracelight

+

      [NEW] Surfaces using a shader with this option will always be lit with the +original "-light" light algorithm. Patches will not cast shadows on +this surface unless the shader option q3map_patchshadows is used.

+

q3map_patchshadows

+

      [NEW] When this option is used in conjunction with the original (-light) +lighting algorithm, surfaces with textures modified by this option will will +show shadows cast by curve patches (under normal circumstances, curve patches do +not cast shadows).

+

q3map_vertexshadows

+

      [NEW] By default, no shadows are cast on vertex-only lit surfaces (see +surfaceparm pointlight). Also when running Quake III Arena in vertex  lighting +mode, no shadows are cast upon any surfaces (shadows are part of the light map). +When using this shader option shadows *will* be cast on the surface when vertex +lit. However sharp shadow edges won't be seen on the surface because light +values are only calculated at the vertexes.

+

q3map_novertexshadows

+

      [NEW] Shaders used for misc_models and terrain can now use +q3map_novertexshadows to disable shadows to be cast at the vertex lit surfaces. +Shadows being cast at small misc_model objects often makes sense. However +shadows on large vertex lit terrain surfaces often look bad. By default no +shadows are cast at forced vertex list surfaces ( shaders with "pointlight" +).

+

q3map_forcesunlight

+

      [NEW] No sunlight is cast at vertex lit md3 models and terrain by default. +Using this option sunlight (overbright bits created by q3map_sun option) will be +cast on these surfaces.

+

q3map_vertexscale <scale>

+

      [NEW] The light value at the vertexes of a surface using a shader with this +option is multiplied by the scale value. This is a way to lighten or darken a +vertex light only surface in comparison to other, light-map lit surfaces around +it.

+

q3map_notjunc

+

      [NEW] Surfaces modified by a shader with this option are not used for +tjunction fixing.

+

q3map_vlight

+

      [NEW] Surfaces modified by a shader with this option will always be lit with +the "-vlight" algorithm when q3map is used with the options "-vlight +-tracelight".

+

q3map_lightmapsamplesize <S>

+

      [NEW] Surfaces using a shader with this shader option will use lightmaps with +pixel size SxS. This option can be used to produce high resolution shadows on +certain surfaces or can be used to reduce the size of lightmap data where high +resolution shadows are not required.

+

q3map_lightimage <image>

+

      Image to use for the light color of a surface light instead of the image(s) +used by the shader. Color is averaged from the texture. Texture must be the same +size as the base image map.

+

q3map_surfacelight <value>

+

Sets the amount of light this surface emits.

+

q3map_lightsubdivide <value>

+

      A surface light is subdivided into a bunch of point lights for the actual +lighting of the world. This parameter controls the space between those point +lights. Default value is 120.

+

q3map_backsplash <percent> <distance>

+

      A surface light is also lit by itself using back splash point lights with a +lower intensity. The <percent> parameter specifies the intensity +percentage they use from the q3map_surfacelight <value> parameter. The +<distance> parameter controls the distance of these back splash lights +from the surface. You can set the <percent> to zero or a negative value to +disable the back splash lights.

+

      q3map_globaltexture

+

When this option is set the texture is not aligned to the world.

+

      q3map_backshader <shader>

+

<shader> is the path/name of the shader or texture to be used at the +back side of the surface.

+

      q3map_flare <shader>

+

Creates a flare using the specified <shader> at the center of the +surface using a shader with this option.

+

      light <value>

+

Old style flare specification always using the shader "flareshader". +The <value> parameter is unused.

+

      q3map_sun <red> <green> <blue> <intensity> +<degrees> <elevation>

+

Color will be normalized, so it doesn't matter what range you use. The +intensity falls off with angle but not distance. A value of 100 is a fairly +bright sun.

+

      degree of 0 = from the east, 90 = north, etc.

+

      elevation of 0 = sunrise/set, 90 = noon

+

      surfaceparm pointlight

+

Surfaces using a shader with this parameter will always be vertex lit

+

This option can be used to reduce the lightmap data. Often used on surfaces

+

that don't need any shadows.

+ + +

Surfaceparm dust

+

If a player lands (jumps onto) on a surfaces using a shader with this +parameter, a put of dust will appear at the player’s feet. Note that the +worldspawn entity of that map must have an enableDust key set to a value of 1. +Note: This surfaceflag has been replaced by "surfaceparm woodsteps" in +Return to Castle Wolfenstien.

+ + +

Custom surfaceparms

+
+

With the new q3map tool you can add custom surface parameters for mods +without the need to recompile the q3map tool. These custom surfaceparms are +stored in a file called ‘custinfoparms.txt’ in the folder scripts/. An +example of this file with the new surfaceparm treacle and surfaceparm grass is +shown below.

+

// Custom Infoparms File
+// Custom Contentsflags
+{
+treacle 0x4000
+}
+// Custom Surfaceflags
+{
+grass 0x80000
+}

+

 

+ +

NOTE: For linux users, when using the -custinfoparms parameter q3map +first looks in your homedir, and only if it doesn't find a custinfoparms.txt +there, it uses the one stored in the

+

quake3 install dir (usually /usr/local/games).

+

 

+
+

Content Flags

+
+

Contents flags are flags similar to CONTENTS_FOG in the original Q3A. These +flags define the contents of volumes inside the game (for instance lava, fog, +water, etc.).

+

If you look in the source file game/surfaceflags.h, it has defines for all +contents flags. The define is split into a name and a hexadecimal value, for +instance CONTENTS_PLAYERCLIP 0x10000. These hexadecimal values are powers of 2 +and can be ored together (binary) to form a bit mask. Up to 32 contents flags +can be ored together this way.

+ +

Example: creating a volume with treacle.

+

The following outlines how a custom contents flag can be added and used in a +mod. First open the ‘custinfoparms.txt’ file and add ‘treacle 0x4000’ +to the Custom Contentsflags section as shown in the example file above (0x4000 +is one of the unused values available for custom use). Next write a shader +script which uses ‘surfaceparm treacle’. Apply this new shader to all sides +of a brush in a test map. When you compile the map, add the -custinfoparms +parameter to the command line following q3map.

+

Next, add CONTENTS_TREACLE 0x4000 to the source file game/surfaceflags.h in +your mod. Now you can call the point contents function. If the point is inside +the brush with the shader using the ‘surfaceparm treacle’ then the point +contents call will return a bit mask with CONTENTS_TREACLE set. This can for +instance be used to slow down player movement when a player is inside such a +brush.

+

 

+
+

Surface Flags

+
+

The surface flags are texture properties that often affect entities in +contact with surfaces using such flags. The ‘surfaceparm metalsteps’ +parameter from Q3A is a good example.

+

If you look in the source file game/surfaceflags.h, it has defines for all +surface flags. The define is split into a name and a hexadecimal value, for +instance SURF_NODAMAGE 0x1. These hexadecimal values are powers of 2 and can be +ored together (binary) to form a bit mask. Up to 32 surface flags can be ored +together this way.

+ +

Example: Making ‘footsteps on grass’ sounds

+

The following outlines how a custom surface flag can be added and used in a +mod. First open up the ‘custinfoparms.txt’ file and add 'grass 0x80000' to +the Custom Surfaceflags section as shown in the example file above (0x80000 is +the first available unused value in surfaceflags.h for surface flags). Next +write a shader script which uses a grass image and has 'surfaceparm grass’. +Create a test map with the grass shader covering the ground surface. When you +compile the map, add the -custinfoparms parameter to the command line following +q3map.

+

Next, add SURF_GRASS 0x80000 to the source file game/surfaceflags.h in your +mod. Now you'll be able to execute a trace and the trace information will be +returned in the trace_t structure. If the trace hits a surface with the grass +surfaceparm then the SURF_GRASS flag will be set in trace_t->surfaceFlags. +Such a trace can be used to trigger playing a sound of a person stepping on +grass. For a reference example, see the existing metal steps in the game code.

+

 

+
+

 

+ +
+ + + +

 

+
+ +

 

+

 

+

-27-

+ + + + diff --git a/docs/manual/quake3/Model_Manual/model_manual.htm b/docs/manual/quake3/Model_Manual/model_manual.htm new file mode 100644 index 00000000..3af5ebd5 --- /dev/null +++ b/docs/manual/quake3/Model_Manual/model_manual.htm @@ -0,0 +1,217 @@ + + + +Q3A Player Characters: Putting them in the Game + + + +
+

Putting New Models in Quake III Arena

+ +Based on original notes by Paul Steed + +

Edited by Paul Jaquays
+

Edited 12/22/99 by ps
+

QERadiant.com thanks John Hutton for re-formating this manual into a more web friendly version
+

+
+The purpose of this document is to explain how to set up a model for Quake 3 Arena, create the necessary animation and conversion files, and then export it into the MD3 format required by the game. It is intended to be informative only and not a tutorial on building or animating models. + +

The player models for Quake III Arena were built using the commercial modeling software, 3D Studio Max R2.5 (3ds Max) by +Kinetix. These models were then animated using Physique and Biped, components of a plugin for 3dsMax called Character Studio +(also by Kinetix). The following instructions assume that you will model and animate with 3dsMax and Character Studio. + +

1. Setting up the Files

+Begin in your Quake3 directory. If you don't have one already, create a baseq3 directory. Inside the baseq3 directory, create a models directory. Inside the models directory, create a players directory. Inside the players directory, create a directory with the name of your model (we will use [character] in this document to represent information requiring the name of the model). It is generally a good idea to create a 'work' directory under [character] so that the [character] directory itself remains uncluttered. Place all versions of your model and temp textures here, saving the [character] directory purely for the finished model files. + +

2. Building and Naming the Mesh

+The mesh should be built keeping in mind the game engine needs three distinct body part grouping: the head, the upper body, and the lower body. These groupings can consist of different parts or sub-objects, but keep in mind too many sub-objects does impact performance and game play speed. A good rule of thumb is to consolidate your objects (i.e. attach them to each other) as long as they remain a part of a major group. For example, you decide to create a character that has its arms as separate objects for easier animation. Unless the arms or torso has different textures assigned to them go ahead and attach the arms to the torso. It may be more difficult to assign the vertices to the biped skeleton later on, but the efficiency of the model is much better. However, if you must keep the limbs detached for unique shader assignment then keep the following naming conventions in mind: + +

2.1 Head Geometry

+All head geometry needs to begin with lower case 'H_' (h_head, h_glasses, h_hat, etc...). Keep in mind that the head has no +animations itself other than to respond to player mouse-look input. + +

2.2 Upper Body Geometry

+All upper body geometry needs to begin with lower case 'U_' (u_torso, u_arms, u_abdomen, etc.) This is your model's torso and arms. The individual animations for the upper body are listed below. + +

2.3 Lower Body Geometry

+All lower body geometry begins with lower case 'L_' (l_hips, l_legs, l_lfoot, l_rfoot, etc...). This is your model's buttocks, legs and feet. The individual animations for the upper body are listed below. + +

2.4 Tags

+Tags are connection points for other model parts and represent the limited hierarchical system of the game. They include links between the three character body parts and the weapons. Keep in mind that these tags are representations of geometry so they can be animated to represent that geometry. For example, tag_head represents the head, tag_torso represents the torso and tag_weapon represents the weapon. This is important to understand since for example, any time the character is performing a locomotive animation, the upper body can and will animate independently of the lower body, using the relative position of the tag as a base or 'home' position. The tags for the body parts and weapons are named tag_weapon, tag_torso and tag_head. + +

3. Texturing

+Once you finish building your character go ahead and attach it to your biped and do some basic test animations to make certain the mesh doesn't deform in weird ways. Turn edges, ad faces, whatever you need to do to make sure that while animating, the character retains its mesh integrity. Handing the mesh over to another artist to assign UVW's or assigning and texturing yourself without testing the animation integrity of the mesh is very risky. Major modifications after UV assignment can cost you valuable time resulting in re-assigning not just the UV's, but re-attaching the mesh to your biped as well. Once your model is ready, go ahead and apply the texture to it. Typically the textures used in Q3A consist of one 256 x 256 texture for the body and one 128 x 128 texture for the head. Keep in mind that it's best to consolidate your texture on a single page rather than break it up into smaller pages. Also some video cards cannot process a texture size larger than 256, so making a high-rez 1024 x 512 texture just won't be seen since the card will knock it down to +256 x 128 to digest it. + +

4. Set Up for Animation

+Once the character is textured or skinned, bring the mesh back into 3dsMax (2.5) and attach it to an adjusted Biped using the Character Studio plug-in. As a rule of thumb, it's always better to just assign the mesh to the biped using the default +settings and then manually assign vertices to appropriate skeletal 'limbs'. + +

5. Animation

+When animating the character, keep all animations in one file. It's crucial that the animations adhere to a specific order that pertains to the separate body parts as this supports our current tag system. + +

Basically the order of animations goes: full body (animations that combine both upper and lower), upper body, and lower body. Each character file has the following animations in them and for now that's all the modeler is allowed. The division is basically death (all body parts), extraneous upper body, and dedicated locomotive animations. That way all the upper body animations can be performed at any time, separate from whatever it is that that lower body animations may be doing. There is a set number of animation types which are (in order): + +

  • death1 (approx. 30 frames) +
  • death2 (approx. 30 frames) +
  • death3 (approx. 30 frames) + +

  • taunt (approx. 45 frames) +
  • weapon attack (exactly 6 frames) +
  • melee attack (exactly 6 frames) +
  • change weapon (exactly 9 frames) +
  • weapon idle (exactly 1 frame) +
  • melee idle (exactly 1 frame) + +

  • crouched walk (approx. 10 frames) +
  • walk (approx. 15 frames) +
  • run (approx. 12 frames) +
  • backpedal (approx. 10 frames) +
  • swim (approx. 10 frames) +
  • jump forward (approx. 10 frames) +
  • jump forward-land (approx. 6 frames) +
  • jump backward (approx. 10 frames) +
  • jump backward-land (approx. 6 frames) +
  • standing idle (approx. 10 frames) +
  • crouched idle (approx. 10 frames) +
  • turn in place (approx. 8 frames)
+ +

A good rule of thumb is to create an idle pose at the frame right after the final death frame. Keep this pose for the +entire lower body and center of mass of the biped up through melee idle frame since any animation by the lower body during these frames will not register during the grab process. Similarly, once the animations for the lower body start, copy the pose for the upper body at the weapon idle frame to the first frame of the crouched walk animation and don't animate the upper body at all after that frame. This allows you to more closely approximate what happens during the game where the upper body is basically just along for the ride as the lower body carries it along via the tag_torso. + +

Keep in mind that an animation.cfg has to be generated for each character that is a direct reflection of your animation file above. + +

6. Setting up Tags

+After the modeler is satisfied with the animations for the character, it's time to bring in the tags that up until now, have +kept in a separate file. This is milestone mark that lets the modeler know that the character is nearly complete. 'Merge' +the tags into your scene. Turn off 'inherit scale' for the tags under the hierarchy/link command panel in Max. Then, +assign a Physique modifier (Character Studio), linking them to specific areas in the biped: + +

tag_torso is linked to the Biped 'pelvis' +
tag_head is linked to the Biped 'head'. +
tag_weapon is linked to the right 'hand'. + +

6.1 Animate Body Tags

+Now, go in and actually animate the tag_torso so that it matches the default position (established previously at +approximately the standing idle frame- from the top view it looks like a perfect 90 degree triangle with the base half as wide as the length, pointing forward) when appropriate. "Appropriate" means that as the character goes through the lower body animations, if the triangle is pointing anywhere else but forward, the upper body will point that way as well since to the code the upper body IS the tag. This works out to the modeler's advantage, though because even if the upper body LOOKS crazy in the animation you simply rely on the tag representation to compensate for it. + +

6.2 Handling Weapon Tags

+Tag_weapon is a bit different. Basically there is no difference between view model weapons (the weapon as seen by the player when it is in use by his or another player) and the world model weapons (weapons as they are found rotating in the maps) in Quake III Arena. However, for visually clarity and identification, they are doubled in scale when they become seen as world models. They are the same object. This reduces the number of models needed the game and creates an overall more efficient system. Unfortunately a drawback to the system is that there can be only one firing animation for the character. Thusly all weapons need to fit within the grip of the character regardless of size or geometry. This also makes it impossible to see hands on your weapons or otherwise perform vertex animation on the weapons other than barrel rotations vis the tag system (tag_barrel). +

Since the placement is always the same for the character's hands on the weapons , create the animations to the point where it begins the weapon attack sequence. Then merge one of the weapon models into the character file as a guide. The weapons have a nested triangle of same dimensions as the tag_head and tag_torso triangles (each weapon in the game has this triangle saved with it. Move the weapon into a horizontal firing position (using the side view) to about where the character would be holding the weapon correctly. Then move the character's hands into the appropriate position and link the weapon to the character's right hand. + +

When you get to the point where you bring in the tags, make a snapshot of the weapon, hide the original and simply delete all the vertices and faces of the copy of the weapon object except for the nested triangle. Rename it tag_weapon, turn off the 'inherit scale' attributes (very important), and assign Physique to it (linking it to the 'right hand' of the biped) and voila. Ready to export. + +

Level of Detail

+Each of the Quake III Arena player characters have a base model and two lower polygon versions of the model (to help with speed issues). For use in the game, the three levels of detail are file formatted as follows: + +

+ + + + + + + + + + + + +
[character].[file extension]This is the highest detail model for close up viewing
[character]_1.[file extension]This is a slightly lower polygon model for mid distance viewing
[character]_2.[file extension]This is the lowest polygon model for long distance viewing.
+ +

Level of detail means you need to make three versions of your model to get the best performance during gameplay. Each +version needs to have the same textures assigned and same animations assigned to them in order to work in the game. The +numbers you need to shoot for are 800 faces for the highest level, 500 faces for next level and 300 for the lowest level. This works out roughly to be a 60% drop in each LOD, but your numbers will vary in order to maintain mesh integrity. Most LOD's created in Q3A were done with the plugin called MRM (multiple resolution mesh) by Intel. The stock Optimize modifier or manual optimization techniques can be applied. + +

8. Exporting

+Once the tags are in place (also with the Physique modifier attached to them) the model is ready to export to an ase(ascii) +file. To make the models available for use in Quake III Arena, the model was exported to a native 3dsMax ASCII format +file called an '.ase' file. This export option in Max has several check boxes to tweak and then just exports the character +with its animation data (via Character Studio) to a huge ase/ascii file. Under 'Output Options' make sure the 'Mesh Definition', 'Materials', 'Transform Animation Keys', and 'Animated Mesh' boxes are checked. Under 'Mesh Options' and 'Object Types' make sure 'Mapping Coordinates' and 'Geometric' are the only boxes checked, respectively and let it run. Your 'Time Configuration' must reflect a '0' starting point up through the last frame of your animation. The native Max exporter will rely on the time configuration as a guide on which frames to actually grab during the conversion process. Of course there will be better exporters available in the future…this is just how it was done for the characters in Q3A. + +

9. Animation Config File

+The character's animations are controlled by an 'animation.cfg' file where the model maker specifies reference frames and frame rates. The animation.cfg file is a text file (originally created with MS Excel) which contains the frame and animation sequence data. Place this in the model's directory. Note, when the modeler is testing the model in Quake III Arena, changes to the animation.cfg can be made without having to re-grab the model…just do a 'vid_restart' at the cvar command line +prompt. + +

Edit an animation.cfg file which matches the frame/animation sequences and place it in the character's directory. Each animation can have different frame rates that the modeler can tweak, save out in the animation.cfg, hit 'vid_restart' to see the change right away in the game (no need to re-grab the model). The file for visor is shown here below in it's entirety. You may clip this portion of the file out and use it as the basis for your own animation files. + +

+////////////////////////////////////////////////////////////////////////////////
+
+// animation config file
+
+sex		m
+
+headoffset	0 0 0
+footsteps	normal
+
+// first frame, num frames, looping frames, frames per second
+
+0	30	0	25	// BOTH_DEATH1
+29	1	0	25	// BOTH_DEAD1
+30	30	0	25	// BOTH_DEATH2
+59	1	0	25	// BOTH_DEAD2
+60	30	0	25	// BOTH_DEATH3
+89	1	0	25	// BOTH_DEAD3
+90	40	0	20	// TORSO_GESTURE
+130	6	0	15	// TORSO_ATTACK (MUST NOT CHANGE -- hand animation is synced to this)
+136	6	0	15	// TORSO_ATTACK2 (MUST NOT CHANGE -- hand animation is synced to this)
+142	5	0	20	// TORSO_DROP (MUST NOT CHANGE -- hand animation is synced to this)
+147	4	0	20	// TORSO_RAISE (MUST NOT CHANGE -- hand animation is synced to this)
+151	1	0	15	// TORSO_STAND
+152	1	0	15	// TORSO_STAND2
+153	8	8	20	// LEGS_WALKCR
+161	12	12	20	// LEGS_WALK
+173	9	9	18	// LEGS_RUN
+182	10	10	20	// LEGS_BACK
+192	10	10	15	// LEGS_SWIM
+202	8	0	15	// LEGS_JUMP
+210	1	0	15	// LEGS_LAND
+211	8	0	15	// LEGS_JUMPB
+219	1	0	15	// LEGS_LANDB
+220	10	10	15	// LEGS_IDLE
+230	10	10	15	// LEGS_IDLECR
+240	7	7	15	// LEGS_TURN
+
+//////////////////////////////////////////////////////////////////
+ +

10. The Conversion Process

+ +The models need to be run through id's custom md3 conversion/'grabber' program. The program uses the information in the Quake Data text file ([filename].qdt) to grab and convert the 3dsMax files. + +

10.1 The Conversion File

+ +Create a "Quake Data" text file for the model with the extension ".qdt". The contents for our [character].qdt file would read something like: + +

$asecanimconvert models/players/[character]/[character].ase -playerparms 92 155 +
$asecanimconvert models/players/[character]/[character]_1.ase -lod 1 -playerparms 92 155 +
$asecanimconvert models/players/[character]/[character]_2.ase -lod 2 -playerparms 92 155 + +

+This is the grabber program executable. + +

+ +This is the path to the model's .ase file. The program looks for files starting in your Quake3\baseq3 directory. + +

+This tells the converter that this is the first level of reduced detail for the model. The value "-lod 2" is for the second, +or lowest level of detail for the model. + +

+This tells the converter which frame the upper body anims only start (first value) and which frame the lower body only anims start (second value). The numbers here are only used as examples + +

10.2 Run the Conversion

+When the qdt file is set up correctly, run the grabber by opening MSDOS command prompt, going to the quake3 directory +containing the model files and typing in 'q3data [character].qdt' + +

11. Review the Model

+Load up Quake 3 Arena. Go to map Q3DM0 (or any map containing a mirror). Bring down the console and type "\model +[character name]". Hit your Show Score key (default is TAB). You should see your new model here. Tweak the frame rates in +your animation.cfg file and save them. Type in "\vid_restart" on the console and hit enter to see the changes. + + + + + diff --git a/docs/manual/quake3/Model_Manual/styles/q3rad.css b/docs/manual/quake3/Model_Manual/styles/q3rad.css new file mode 100644 index 00000000..b4daab91 --- /dev/null +++ b/docs/manual/quake3/Model_Manual/styles/q3rad.css @@ -0,0 +1,23 @@ +body { font: 12pt "Times New Roman"; + margin-left: 5mm; + margin-right: 5mm; + text-align: justify; + background: #ffffff; + color: #000000 } +h1 { font: bold 24pt Arial, Helvetica } +h2 { font: bold italic 18pt Arial, Helvetica } +.subheading { font: bold 16pt Arial, Helvetica } +:link {color: blue; + text-decoration: none; } +:visited {color: purple; + text-decoration: none; } +h6 { font: 10pt "Times New Roman" } +.MsoToc2 { font: bold small-caps 12pt "Times New Roman" } +.MsoTitle { text-align:center; + font: bold 24pt "BankGothic Md BT"; + letter-spacing:2.5pt } +.heading { font: italic 10pt "Times New Roman" } +.subcontents { font: 10pt "Times New Roman" } +.tip { font: 10pt "Comic Sans MS" } +.type { font: 10pt "Courier New" } +.menu { font: 10pt Arial, Helvetica } \ No newline at end of file diff --git a/docs/manual/quake3/New_Teams_For_Q3TA/index.html b/docs/manual/quake3/New_Teams_For_Q3TA/index.html new file mode 100644 index 00000000..75046c9c --- /dev/null +++ b/docs/manual/quake3/New_Teams_For_Q3TA/index.html @@ -0,0 +1,2258 @@ + + + + + + + + +New Teams For Q3TA + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+

 

+
+

New + Teams for Team Arena (and other stories)
+ By Paul Jaquays Script files by various id design team members Bot Search Material by Jan Paul “MrElusive” + van Waveren

+
+

 

+
+

 

+
+

Table + of Contents
+ Introduction
+ The Team Pak
+ Scripts
+ User Interface Assets
+ In Game Team Logo Icons
+ New Models for Team Skins
+ Appendix A: The .Bot File
+ Appendix B: The .Team File
+ Appendix C: The Voice List
+ Appendix D: Model Sound List
+ Appendix E: .VC File Sample
+ Appendix F: Sample Team Arena Animation.Cfg + File and New Animation Commands
+ Appendix G: Teamname.shader
+ Appendix H: Search Order for Model and Head model Assets
+ Appendix I: Expanded Team Skin Functionality for Q3A
+ Appendix J: Contents of the tm_kreechurs.pk3
+ Appendix K: A Minimal Team
+ Appendix L: Contents of the TAhead_lily.pk3

+
+

 

+
+

 

+
+

Introduction
+ The original intent for Teams in Quake III: Team Arena was to allow the use + and creation of new Teams. However, it was not until community modelers attempted + to build new teams that we discovered that the hooks that we put in place for + team creation did not work as intended. This point release contains the fixes + and additions necessary to make new teams work.

+

This document presupposes + that the person wanting to create a new team already knows the basics of + creating, animating, and skinning new character models for Quake III Arena. + There are numerous good tutorials on-line covering both the basics and the + more in-depth skills needed to make models that work inside the game.

+

Special Thanks
+ The content used to test and debug the team creation code is based on a test + model provided and made “Team Arena compatible” by Bill and Mike Jukes, + a.k.a. “The Brothers Grimm” and a re-skinning of the original Team Arena Callisto head model provided by artist Camilla “milla” Bennett. Also thanks to milla + for providing the .html version of this document. Names of some of the files + used in examples have been changed. Furthermore, thanks go to Graeme Devine, + Robert Duffy, and MrElusive for putting up with + semi-constant harassment to get the team content working for the point + release.

+

Notices: QUAKE III ARENA and QUAKE III: Team + Arena are trademarks of id Software, Inc. This + document is copyright 2000, 2001 by id Software, Inc. Id Software grants + permission to redistribute and or redisplay this document in electronic form + only. It may not be included as a part of any permanent media without first + obtaining permission from id Software, inc. Permission is granted to use the + contents of the scripts embedded in this document as a base for creating + additional teams for Team Arena.
+

+

TOP

+

The Team Pak File
+ It takes a surprisingly large amount of new content to create an entirely new + team. Our test file contained 186 separate files (model included only one + head). An additional head added another 16 files (we tested with only one + extra head model). The content required covers every discipline of game + creation … skin painting, scripting, modeling, and sound production. In fact, + if the new team is to have new voice taunt sounds, it can easily exceed 10 + megabytes in compressed form inside the pak file. + Each of the files necessary to create a team is listed below in outline and + will be discussed later in detail. The paths for these files begin in the missionpack directory. Appendix J + contains the file list for the test team, Appendix K + shows a team with the bare minimum of files needed to create a new team with + a male and female uniform, and Appendix L contains the + file list for the Callisto/Lily test head.

+

Naming Conventions
+ When naming a pak file that contains the assets for + a new team, preface the team name with the letters + “tm_”. This usage is for organizational purposes only. It is done to identify + the pak as a team file. Example: tm_kreechurs.pk

+

Including What id Didn’t Make
+ You don’t need to include any of the game content + that id put in the original pak0.pk3 that shipped with Team Arena. The game + should have no problem finding those assets if they are called for by the new + team. Any new assets created for the team need to be in the pak file. Any assets created by other artists or authors + for use with Team Arena need to be in the pak file. + The team creator cannot assume that players will have those assets in their + possession. When including assets created by others, including modified id + game content, be sure to give notice of original + authorship in the readme that accompanies the pakfile.

+

Teamname_readme.txt
+ This text file tells all about the contents of your new team, including who + made it, how they can reach the author, who else contributed to the project, + what tools were used, how long it took, when it was released (copyright data + goes here), where the ideas came from, and so on. Essentially, it should + contain whatever the team creator wants to reveal about himself + or herself and the process of making the team. Any resources that were + created by others should be acknowledged here. If the team creator agrees to + let others use the original contents of the pak + file in other projects, it should be noted here also, along with any special + terms or contact information.

+

NOTE: The scripts used to create the + various aspects of the new team are included throughout this document. Team + creators have permission to copy the scripts in this document and paste them + into new scripts for use in original teams. Details such as team name, + character names, and bot names should be changed to + fit the new team.

+

TOP

+

Scripts
+ Priority: Unless otherwise noted, all of the scripts listed below are + required to be in the team pak file (see Appendix K: A Minimal Team, for a detailed list of the + contents required for a basic team using existing models).

+

These are the various + scripts used to define the team and model characteristics.

+

Teamname.team (in root directory) : A text file that defines the components of the team. This file + corresponds to the original team.txt file in pak0.pk3. It is required for all + new teams. See Appendix B for details.

+

Teamname.bot (scripts\) : This file defines the resources + used by the five bots that are used by the team in single player (model, head_model, and bot a.i.). It is required for all new teams. See Appendix A for details.

+

Teamname.shader (scripts\) : Shader + scripts for all shaders used to create the new_model and the five new_headmodels. + This is required for the team icons to work properly in game. Other shader-modified textures may be included. See Appendix G for the sample version of this shader.

+

Animation.cfg (models\players\newmodel\) : The animation configuration file. + Team Arena models have a few a few more animation sequences than their Q3A + counterparts, but the basics are the same. The contents of a sample Q3:TA animation.cfg are included + at the end of this document. It’s a script, but not + one that’s resident in the scripts file. This is + only required if a new model is included in the pak. +

+

New_model.voice (scripts\) : This is the script that assigns + individual voice wav files to specific message or status commands. See + Appendix C for a sample script and discussion of its use. Voice files are + optional and only required if an entirely new set of voice wav files is to be + included in the pak. Sound files are large and can + add significantly to the size of the pakfile. If + creating a human-based team, consider using the 8 voices that came with Team + Arena to save file space.

+

New_headmodel_1.vc + (scripts\) : This file selects which .voice file is linked to a head + file. Each head model in the pak needs one of + these. A separate version of this file is required for each new headmodel included with the team. The name of the file is + the same as the name of the bot that uses the headmodel. A sample .vc file is + included in Appendix E.

+

TOP

+

User Interface + Assets
+
Priority: The tga files are required. The roq + file is optional. The User Interface menus use these files to show the team + logo icons and movies of the characters in actions.

+

Teamname, of course, refers to the name of + the new team.

+

Teamname_name_alt.tga (ui\assets\) : This is a 256 x 128 pixel, 32 bit .tga file + (with alpha channel) depicting the name of the team as a black and white + (grayscale) art file. Teamname is the name of the + new team, the rest of the filename is part of its format. The alpha channel should + be the same as the image (not reversed).

+

Teamname_name.tga (ui\assets\) : This is a 256 x 128 pixel, 32 bit .tga file + (with alpha channel) depicting the name of the team with a glow around it. It + is a black and white art file (grayscale). The alpha channel should be the + same as the image (not reversed).

+

Teamname.tga (ui\assets\) : This is a 128 x 128 pixel, 32 bit .tga file + (with alpha channel) that depicts a black and white version of the team logo + or symbol. The alpha channel should be the same as the image (not reversed).

+

Teamname_metal.tga (ui\assets\) : This is a 128 x 128 pixel, 32 bit .tga file + (with alpha channel). If the team creator wants to keep the same style as the + original game, this version of the team’s logo is + rendered to look like brushed metal, perhaps with a bluish cast. But in + reality, it can be anything, any color. The alpha channel should be the same + as the alpha channel in the Teamlogo.tga art.

+

Teamname.roq (ui\assets\) : The .roq movie displays in the center area + of the player set up screen when the player selects one of the teams. Movie + file sizes can be large, so the team creator may wish to take the overall + size of the team pakfile into consideration before + including a movie. Uncompressed, the team movies in Team Arena were over a + megabyte each … and being compressed format files already; they don’t get much smaller in the pakfile. + The good news is that if no movie file is present, the game displays the teamname_metal.tga in the center area instead. It must be + noted that team movie files will not be offered for viewing in the Cinematics menu option unless the teamname.roq + file is also present in the video\ directory.

+

TOP

+

In Game Team Logo + Icons
+ Priority: Required

+

The team style game maps + for Team Arena are usually set up to display the icons of the competing + teams. The game uses a separate set of art files located in the team_icon directory off the root missionpack + directory for the team icons displayed in game. For Team Arena, these art + files were a single color, red or blue. But that need not be the case. If a + game clan wanted to use a full color version of their clan symbol, it would + work in game - though the team creator may want to consider tinting the art + either bluish or reddish to better suit the color used in play (most team + maps are likely to use the blue/red color theme as was done in the original + game).

+

Also, take into + consideration that the art will be transparent, with background textures + (floors, walls, colored banners) showing through behind it. Simple, graphic + treatments of logos will probably work the best in all cases.

+

Art files can be larger or + smaller than those shown here. However, while having smaller files will save + memory, image quality will suffer. If using larger art files, image quality + may improve substantially but the memory usage will be substantial also. + Whether increasing or reducing file size, remember to keep the file dimension + proportional to the original.

+

The Teamname.shader + references this art. Make sure that the file names in the shader + match those of the artwork.

+

Teamname.tga (team_icon\): + This is a 128 x + 128 pixel art file, the exact same file as used in ui\assets\teamname.tga. + It is a black and white 32 bit version of the team logo with the same art in + the alpha channel.

+

Teamname_blue.tga (team_icon\): + For Team Arena, we + created solid color logos, but that need not be the case. This 32 bit 128 x + 128 pixel art file can be full color. The alpha channel should be the same as + the teamname.tga file. If you choose to make it + solid blue, consider using the same color value as the original TA logos. The + RGB formula for that blue is: 0 148 255.

+

Teamname_red.tga (team_icon\): + Even though id + chose to make our logo’s single, solid colors, this + 32 bit 128 x 128 pixel art file can be whatever color the team creator + wishes. The alpha channel should be the same as the teamname.tga + file. If you choose to make it solid red, consider using the same color value + as the original TA logos. The RGB formula for that red is: 255 0 0.

+

TOP

+

New Models and Skins + for Teams
+ The process by which body models are created is outside the scope of this + document. While body model has a few more animations than the corresponding + Quake III Arena model, the process of creation is quite similar … except for + one very key element. The Team Arena model has no head. Head models for Team + Arena teams are created and stored separately from the body. Where the + pathname to a body model might be models\players\BoB, + the path to the head models is different:

+

Example: models\players\heads\Kreecha.

+

New Team Arena Models + based on Q3A models +
+ For the Team Arena test model, the Brothers Grimm converted a character model + that they had previously made for Quake III Arena. In order to keep the game + from confusing two models with the same file name, the search code for models + and skins was changed to allow extended search paths for models. In this + case, we placed the Team Arena model in a “characters” directory nested + within the “players” directory. The path to the new model read: + models\players\characters\BoB\. The model directory + contains the torso and legs models only, which are Upper.md3 and Lower.md3 + respectively. There are no head models in that directory. Furthermore, + include any art and skin files used for the default version of the model + along with the animation.cfg.

+

NOTE: When creating your models for + export as .ASE files for use with the Q3data.exe, you must have a head on the + model (e.g.; an h_head in the max file) for the + converter to work. The converter looks for and expects to see an h_head for of the model. If the converter does not find + the head during the conversion, the process will halt. After the conversion + is complete just use the Upper and lower Md3 files for that character’s directory. Place the head model in its own + separate directory.

+

Icons for new models
+ The Loading Screen for Team Arena uses the icons associated with a team member’s body model, not the member’s + head model. Be certain to include an icon_default.tga + file in new model’s directory. This icon will be + used on the map loading screen. It represents the Body model in use by a + player … not the Head model.

+

New Team Skins
+ When creating a team, make a red and a blue version + of the skin. Name the skins as noted below. Do not use the team or character + name in the skin. That information is taken from the name of the directory in + which it resides.

+

The team skins (red and + blue) for a Team Arena model reside in a directory within the model directory + (which contains the model md3 pieces).

+

Example: models\players\characters\BoB\Kreechurs\.

+

The teamname + directory (Kreechurs in this case) would contain + the art files for the skin, and the .skin files that link art to model.

+

In simple form, the skin + assets required to be in the teamname file are as + follows:

+

TGA file names
+ Blue.tga //the body skin for the blue team version
+ Red.tga //the body skin for the red team version

+

Skin File Names
+ Lower_blue.skin //blue version of legs skin file
+ Upper_blue.skin //blue version of torso skin file
+ Lower_red.skin //red version of legs skin file
+ Upper_red.skin //red version of torso skin file
+ Lower_default.skin //default legs skin file (used + by U.I.). Usually, this is the red skin.
+ Upper_default.skin //default torso skin file (used + by U.I.). Usually, this is the red skin.

+

New Heads
+ Each new player on a new team should either have a new head model or have a + new skin for an existing Team Arena model. Each new head model and all its + assets go into a directory named for it. In the case of new skins for + pre-existing models, the new skin assets reside in a directory nested within + the model’s directory.

+

Example: models\players\heads\callisto\lily is a new skin for the Callisto + head.

+

Note that other assets, + such as the .vc file for this head will also need + to be nested in directories a layer deeper in their normal files.

+

Example: scripts\callisto\lily.vc. +

+

New head models need to + have all the assets specific to the model (md3 files, skin files and art + files) in the directory named for the model head.

+

No MD3 Models Required + for New Skins on id Models
+ New skins created for existing head models (id created or community created) + do not require that the md3 models be in their directories. The assets + specific to the new skin (skin art, skin file, icons) are placed in a + directory. You do not need to redistribute md3 models for the heads that are + a part of the original id game.

+

Using the Work of + Others
+ If you are reskinning or simply using a head model + previously created and distributed by a member of the community, make sure + that the original creator has authorized such use (and remember to give + credit where credit is due). When using community-created models, the team + creator must plan to include that model and all its assets in the pakfile.

+

TOP

+

Appendix A: The .Bot File
+ Five Heads, Five Bots, Five Team Members

+ Priority: Required for each new team

+

A Team Arena team consists + of five players. In the original game, the five players were drawn from a mix + of 11 new player heads sitting atop two body models. New teams should also + have five players each. However, five players on the new team should each have + a unique head/skin combination. These can either be new models or new skins + using the original Q3:TA models.

+

The .bot + file (whose file name is the same as the name of the new team, e.g.; Kreechurs.bot or Scumsukkers.bot) + is a text script whose “.txt” file extension has been renamed to “.bot.” This file corresponds to the bots.txt file used in + the original Team Arena game. Appendix A shows a + sample bot file.

+

Name = the name of the bot as it appears on the Start Server Menu.

+

Model = the body model used by this bot. A team can use more than one body model. However, + adding multiple body models can and will add significantly to the size of the + team pak file and to memory usage in game. Limiting + the number of body models used by a team is a good design practice. No more + than two models per team should be the limit.

+

Headmodel = *modelname. + The headmodel is what makes the bot + unique. It has links to the voice files and is used when creating name + aliases for the bots to use in the single player game. The asterisk is a + necessary part of the file name here.

+

The headmodel + called Callisto/Lily is a new skin on the Callisto model mesh. The pathname is required for the + model to work.

+

Aifile = the bot + ai used by the team member. The computer-controlled + opponents in Team Arena used three individual ai + files that define their general role in the game: defense (tad_c.c), offense (tao_c.c) and + all-arounder (taa_c.c). + New bots can use these same a.i. files or, if + desired the team creator can make new ai files + based on the Team Arena ai files.

+

Filename: Teamname.bot

+
//bot file begins here
{
name           Kreecha
model          BoB
headmodel      *Kreecha
aifile  bots/taa_c.c
}
 
{
name           Callisto/Lily
model          BoB
headmodel      *Callisto/Lily
aifile  bots/tad_c.c
}
 
{
name           Infinite
model          BoB
headmodel      *Infinite
aifile  bots/tad_c.c
}
 
{
name           Prime
model          BoB
headmodel      *Prime
aifile  bots/tao_c.c
}
 
{
name           Vlad
model          BoB
headmodel      *Vlad
aifile  bots/tao_c.c
}
//bot file ends here
+

TOP

+

Appendix B: The + .TEAM File
+ Priority: Required for each new team.

+

The team file is a text + file that has had the file extension renamed from .txt to .team.

+

Kreechurs is a test Team Arena team created + to test the team and head model code for point release v1.28. It uses the + hypothetical “BoB” model to create a new team.

+

The team definition + appears on a single line in the file:

+

“Team name” “asset + path/name” “bot 1” “bot + 2” “bot 3” “bot 4” “bot 5”

+

//Teams define the assets + used by the team: team name, path to U.I. assets, player names
+ // Character definitions act as a link between head models used by a team and + models that have the proper team skin assets. The Player Set Up User + Interface primarily uses the character definitions. The first entry is the + head model as defined in the .bot file. The second + entry is body model used by that character. For everything to work out for + the best, each character should have a unique model/skin combination that + defines it.

+

Filename: Teamname.team

+
// .team file begins here
teams {
  { "Kreechurs" "ui/assets/kreechurs"  "BoB" "Lily" "Vlad" "Infinite" "Prime"}
}
 
characters {
{ "Callisto/Lily" " BoB " }
{ "Kreecha"  " BoB " }
{ "Infinite"  " BoB " }
{ "Prime"  " BoB " }
{ "Vlad" " BoB " }
}
 
// Aliases are the link between character name, headmodel, and bot A.I.
 
aliases {
        { "Kreecha"           "BoB"              "a"  }
        { "Lily"        "Callisto/Lily" "d"   }
            { "Vlad"           "Vlad"              "o"       }
            { "Infinite"       "Infinite"           "d"      }
            { "Prime"          "Prime"             "o"       }              
}
 
//.team file ends here
+

TOP

+

Appendix C: The + Voice List
+ Priority: Optional.

+

The voice file is a text + file that has had the file extension renamed from .txt to .voice. Each unique + set of voice recordings requires its own voice file. This file contains the + code script that defines the voice and corresponding text messages used by + the player models in game. Like the text chat messages that appeared in + original Q3A, these messages are triggered by game conditions and statuses.

+

The file directory name + for the voice does not have to be the same as a head or body model, though + giving it a unique name that identifies it with the team is always a good + idea. The specific file names for each voice message ARE VERY IMPORTANT, as + the voice script that corresponds to the file directory for the voice calls + them. Example: If the new voice is called “monster”, then the directory would + be called “monster” and the voice file would be called monster.voice. +

+

If you create a new set of + recorded voices for your team or for a new model, be certain to include at + least one voice message for each category (defined by a name like “getflag” and follow by opening and closing brackets) on + this list. It is not necessary to provide as many different messages as shown + below. Example: Your character may not need more than one way to say “yes” or + have as many kill insults. You can also rewrite the scripts. Your team need + not say the same thing as the id teams said or use the same style of + speaking. Just remember that the text portion of the message will display on + screen, so having it match the audio is always a good thing. And remember + that in game, shorter speeches are better and cheaper.

+

The file path is as + follows: sound\voices\newmodel\soundname.wav

+

You may include additional + voices but these are the ones currently the phrases accessed by the game.

+

As with any script, these + are lines of game code. Take care to maintain the proper syntax, otherwise, + you are likely to either disable the file or even crash the game.

+

To create new voice + recordings use a sound editing program that can produce a .wav format file + that conforms to the following: Mono 22k 16bit

+

(This is taken from the + male5 voice file. Substitute the name of your model for male5 in the file + pathnames).

+

Filename: Voicename.voice

+
//voice file starts here
 
getflag
{
        sound/voices/male5/or_01.wav   "Get the flag"
        sound/voices/male5/or_02.wav   "Secure the flag"
}
 
offense
{
        sound/voices/male5/or_03.wav   "You're on offense"
}
 
defend
{
        sound/voices/male5/or_04.wav   "Stay Home"
        sound/voices/male5/or_05.wav   "Guard the base"
        sound/voices/male5/or_07.wav   "You're on defense"
}
 
defendflag
{
        sound/voices/male5/or_06.wav   "Guard our flag"
}
 
patrol
{
        sound/voices/male5/or_08.wav   "Patrol"
        sound/voices/male5/or_09.wav   "Take point"
        sound/voices/male5/or_10.wav   "Go on patrol"
}
 
followme
{
        sound/voices/male5/or_11.wav   "Follow me"
        sound/voices/male5/or_12.wav   "Cover me"
        sound/voices/male5/or_13.wav   "Watch my back"
}
 
yes
{
        sound/voices/male5/re_01.wav   "Yessir"
        sound/voices/male5/re_02.wav   "Yes ma'am"
        sound/voices/male5/re_03.wav   "Aye, aye, sir"
        sound/voices/male5/re_04.wav   "Aye, aye, ma'am"
        sound/voices/male5/re_05.wav   "Affirmative"
        sound/voices/male5/re_06.wav   "Copy"
        sound/voices/male5/re_07.wav   "Roger"
}
 
no
{
        sound/voices/male5/re_08.wav   "No sir"
        sound/voices/male5/re_09.wav   "No ma'am"
        sound/voices/male5/re_10.wav   "Negative"
        sound/voices/male5/re_11.wav   "I'm busy"
}
 
ihaveflag
{
        sound/voices/male5/gs_01.wav   "I'm coming in hot!"
        sound/voices/male5/gs_02.wav   "I've secured the flag!"
        sound/voices/male5/gs_03.wav   "I've got the flag!"
        sound/voices/male5/gs_04.wav   "Bringing home the bacon!"
}
 
baseattack
{
        sound/voices/male5/gs_05.wav   "We're taking enemy fire!"
        sound/voices/male5/gs_06.wav   "Security breach!"
        sound/voices/male5/gs_07.wav   "Our base is under attack."
}
 
enemyhasflag
{
        sound/voices/male5/gs_08.wav   "Our flag is gone!"
        sound/voices/male5/gs_09.wav   "They've got our flag!"
        sound/voices/male5/gs_10.wav   "Enemy has secured our flag!"
}
 
ongetflag
{
        sound/voices/male5/ps_03.wav   "Getting the flag..."
}
 
onoffense
{
        sound/voices/male5/ps_01.wav   "I'm taking offense"
        sound/voices/male5/ps_02.wav   "I'm going in..."
}
 
ondefense
{
        sound/voices/male5/ps_04.wav   "I'll stay home"
        sound/voices/male5/ps_05.wav   "Securing base"
        sound/voices/male5/ps_06.wav   "Guarding the base now"
}
 
onpatrol
{
        sound/voices/male5/ps_07.wav   "On patrol..."
        sound/voices/male5/ps_08.wav   "Patroling..."
        sound/voices/male5/ps_09.wav   "I'll take point"
}
 
startleader
{
        sound/voices/male5/ps_10.wav   "I'm the leader"
        sound/voices/male5/ps_11.wav   "I'm in charge"
}
 
stopleader
{
        sound/voices/male5/ps_12.wav   "I don't want to lead"
        sound/voices/male5/ps_13.wav   "Someone else lead"
        sound/voices/male5/ps_14.wav   "I resign"
}
 
kill_insult
{
        sound/voices/male5/tt_06.wav   "Next time don't get up"
        sound/voices/male5/tt_05.wav   "You're just a waste of space"
        sound/voices/male2/tt_07.wav   "Are you blind?"
        sound/voices/male5/tt_13.wav   "Duck next time"
        sound/voices/male5/tt_19.wav   "Suh-weeet!"
        sound/voices/male5/tt_20.wav   "Woo-Hoo!"
        sound/voices/male5/tt_22.wav   "You just got schooled!"
//      sound/voices/male5/tt_16.wav   "You talkin' ta ME?"
}
 
taunt {
        sound/voices/male5/tt_18.wav   "How about some competition here?"
        sound/voices/male5/tt_01.wav   "FRAGbait!"    
        sound/voices/male5/tt_11.wav   "My momma shoots better!"
        sound/voices/male5/tt_14.wav   "Try hitting that barn over there!"
        sound/voices/male5/tt_17.wav   "Wanna BUY a shot?"
//      sound/voices/male5/tt_03.wav   "Get a clue moron!"
//      sound/voices/male5/tt_09.wav   "MORON!"
//      sound/voices/male5/tt_02.wav   "You're such a Loser!"
//      sound/voices/male5/tt_08.wav   "LOSER!"
//      sound/voices/male5/tt_10.wav   "No-skill idiot!"
//      sound/voices/male5/tt_12.wav   "Watched that all the way..."
}
 
death_insult {
        sound/voices/male5/tt_15.wav   "Thank you sir.. may I have another!"
        sound/voices/male5/tt_23.wav   "Bite me!"
        sound/voices/male5/tt_25.wav   "Cheap shot!"
        sound/voices/male5/tt_26.wav   "DOH"
        sound/voices/male5/tt_28.wav   "Lucky shot!"
        sound/voices/male5/tt_29.wav   "That's it!"
        sound/voices/male5/tt_30.wav   "Ooh! That's it!"
//      sound/voices/male5/tt_35.wav   "Hey, dumbass"
//      sound/voices/male5/tt_04.wav   "What an ass!"
//      sound/voices/male5/tt_24.wav   "Screw you!"
}
 
kill_gauntlet {
        sound/voices/male5/tt_21.wav   "Eat gauntlet baby!"
}
 
praise {
        sound/voices/male5/tt_27.wav   "Nice!"
}
 
camp                   // command someone to camp
{
        sound/voices/male5/voc_01.wav  "Camp this position."
        sound/voices/male5/voc_02.wav  "Camp here."
 
}
 
returnflag                     // return our flag  (CTF only)
{
        sound/voices/male5/voc_03.wav  "Get our flag!"
        sound/voices/male5/voc_04.wav  "Return our flag!"
        sound/voices/male5/voc_05.wav  "Recover our flag!"
}
 
whoisleader                    // who is the team leader
{
        sound/voices/male5/voc_06.wav  "Who's our leader?"
        sound/voices/male5/voc_07.wav  "Who's in charge?"
        sound/voices/male5/voc_08.wav  "Who leads this team?"
}
 
followflagcarrier              // follow the flag/skull carrier (CTF, Oneflag, Harvester)
{
        sound/voices/male5/voc_09.wav  "Follow our carrier."
        sound/voices/male5/voc_10.wav  "Stay with the carrier."
        sound/voices/male5/voc_11.wav  "Protect the carrier."
        sound/voices/male5/voc_12.wav  "Cover the carrier."
}
 
inposition                     // I'm in position
{
        sound/voices/male5/voc_13.wav  "I'm in place."
        sound/voices/male5/voc_14.wav  "I'm at my post."
        sound/voices/male5/voc_15.wav  "I am in position."
        sound/voices/male5/voc_15a.wav "I am in position"
}
 
wantondefense          // I want to be on defense
{
        sound/voices/male5/voc_16.wav  "Let me defend."
        sound/voices/male5/voc_17.wav  "I'd rather defend."
}
 
wantonoffense          // I want to be on offense
{
        sound/voices/male5/voc_18.wav  "Let me go on offense."
        sound/voices/male5/voc_19.wav  "I'd rather go on offense."
}
 
wantonpatrol           // I want to go on patrol
{
        sound/voices/male5/voc_20.wav  "Let me patrol."
        sound/voices/male5/voc_21.wav  "I'd rather patrol."
}
 
oncamp  //I'm Camping (status)
{
        sound/voices/male5/voc_22.wav  "I'm camping here."
}
 
onfollow
{
        sound/voices/male5/voc_23.wav  "I'm following."
        sound/voices/male5/voc_24.wav  "Following!"
}
 
onfollowcarrier
{
        sound/voices/male5/voc_27.wav  "Guarding the carrier."
}
 
onreturnflag
{
        sound/voices/male5/voc_28.wav  "Getting our flag."
}
 
harvest //harvester game type only
{
        sound/voices/male5/voc_25.wav  "Go collect skulls."
        sound/voices/male5/voc_26.wav  "Harvest some skulls."
}
// voice file ends here
+

TOP
+
+
Appendix D: + Model Sound List
+ Priority: Only required if a new body model is included in the team pak file.

+

The following game sounds + are associated with the team model. Each of the sounds listed below is a + separate file. They need to be located in a directory having the same name as + the body model and be nested within the sounds directory.

+

Example: sounds/newmodel/Death1.wav.

+

If new sound files are to + be created, make sure that they conform to the following wav file format: + Mono 22k 16bit.

+

Death1.wav
+ Death2.wav
+ Death3.wav
+ Drown.wav
+ Fall1.wav
+ Falling1.wav
+ Gasp.wav
+ Jump1.wav
+ Pain100_1.wav
+ Pain25_1.wav
+ Pain50_1.wav
+ Pain75_1.wav
+ Taunt.wav

+

TOP

+

Appendix E: .VC + File Sample
+ Priority: Required for each head model

+

The vc + file is a text file script that has had the file extension renamed from .txt + to .vc. The script is linked to a bot name. Bot names are defined + in the .bot file included in the pak file. Each bot needs to + have a .vc file. It’s + best, if at all possible, to have the model name (or model/skin combination) + and the bot name be the same. The very brief + contents are simply a path to a voice file. The selected voice file can be + either one of the original Team Arena voices or an original voice included + with the team. When creating the voice file for a re-skinned head model, be + sure to include the head name in the path to the voice script. That script + must also be nested a layer deeper in the directory, such as: scripts/callisto/lily.vc.

+

The contents of a sample .vc file are shown below.

+
        //VC script begins here
scripts/newcharacter.voice
           //VC script ends here
+

TOP

+

Appendix F: Sample + Team Arena Animation.Cfg File and New Animation + Commands
+ Priority: Required only if a new model is included.

+

The animation.cfg + file is a text file that has had the file extension renamed from .txt to .cfg. This file goes in the directory with the body model + components (model\players \new_model\ -- or -- + model\players\characters\new_model\). The specifics + of using or modifying the contents of this file are a part of the model + making process and are mostly outside the focus of this document.

+

It is included in this + document because the Team Arena animation configuration is different from the + Quake 3 Arena Configuration. Furthermore it contains the “sex” key that + determines the gender/sex of a character (as does the Q3A animation.cfg). + This key/value pair determines which pronouns (masculine, feminine, or + neuter) are used when the game generates messages about the player.

+

Additionally, two new + animation commands (for both Q3A and Q3:TA) are + shown here. These were done at the request of modelers doing non-traditional + biped models. When put in the animation.cfg file, + they literally stop the model from responding to the programmatic animations + for those body parts. If you freeze the legs, the hips don't tilt during + running animation. If the model’s legs were too + much outside of bipedal norms (as is the case for quadrupeds), the front or + back legs would disappear into the ground as the leg models programmatically + tilted around the model’s pelvis. If you freeze the + torso, you don't get waist twists or bends. Depending on what you are making, + you may want to use one, but not the other.

+

Fixedlegs : put in the animation .cfg this command freezes programmatic rotation of the + legs

+

Fixedtorso : when put in the animation .cfg this command freezes programmatic rotation of the + torso

+

These commands are + commented out in the sample below.

+
// animation.config file begins here
sex     m      // THIS VALUE  (m, f, n) DETERMINES GENDER OF MODEL
//fixedlegs  // PREVENTS PROGRAMMATIC ROTATION OF LEGS
//fixedtorso // PREVENTS PROGRAMMATIC ROTATION OF TORSO
headoffset -3 0 0
footsteps boot
 
 
 
// first frame, num frames, looping frames, frames per second
0       30      0       20             // BOTH_DEATH1
29      1       0       20             // BOTH_DEAD1
30      30      0       20             // BOTH_DEATH2
59      1       0       20             // BOTH_DEAD2
60      30      0       20             // BOTH_DEATH3
89      1       0       20             // BOTH_DEAD3
 
90      26      0       20             // TORSO_GESTURE
 
116     6       0       15             // TORSO_ATTACK        (MUST NOT CHANGE -- hand animation is synced to this)
122     6       0       15             // TORSO_ATTACK2       (MUST NOT CHANGE -- hand animation is synced to this)
 
128     5       0       20             // TORSO_DROP          (MUST NOT CHANGE -- hand animation is synced to this)
133     4       0       20             // TORSO_RAISE         (MUST NOT CHANGE -- hand animation is synced to this)
 
137     1       0       15             // TORSO_STAND
138     1       0       15             // TORSO_STAND2
 
199     8       8       20             // LEGS_WALKCR
207     12      12      20             // LEGS_WALK
219     10      10      20             // LEGS_RUN
229     10      10      20             // LEGS_BACK
239     10      10      15             // LEGS_SWIM
 
249     7       0       15             // LEGS_JUMP
256     9       0       15             // LEGS_LAND
265     9       0       15             // LEGS_JUMPB
274     6       0       15             // LEGS_LANDB
280     15      15      15             // LEGS_IDLE
295     11      11      15             // LEGS_IDLECR
307     9       9       15             // LEGS_TURN
 
139     10      0       15             // TORSO_GETFLAG    //TA Gesture
149     10      0       15             // TORSO_GUARDBASE   //TA Gesture
159     10      0       15             // TORSO_PATROL   //TA Gesture
169     10      0       15             // TORSO_FOLLOWME   //TA Gesture
179     10      0       15             // TORSO_AFFIRMATIVE   //TA Gesture
189     10      0       15             // TORSO_NEGATIVE   //TA Gesture
 
// animation.config file ends here
+

TOP

+

Appendix G: Teamname.shader
+ Priority: Required for team icons to work in the game

+

This is a text file script + with the file extension renamed from .txt to ..shader.

+
//Teamname.shader begins here
team_icon/Kreechurs_red
{              
        cull none
        surfaceparm nolightmap
        surfaceparm trans
        surfaceparm nomarks
        {
               map team_icon/Kreechurs_red.tga
               blendFunc Add
               rgbgen wave triangle 0.2 0.5 0 0.2           
        }
}
 
team_icon/Kreechurs_blue
{              
        cull none
        surfaceparm nolightmap
        surfaceparm trans
        surfaceparm nomarks
        {
               map team_icon/Kreechurs_blue.tga
               blendFunc Add
               rgbgen wave triangle 0.2 0.5 0 0.2       
        }
}
//Teamname.shader ends here
+

TOP

+

Appendix H: Search + Order for Model and Head model Assets

+

The means by which headmodels are used and selected was unified as much as + possible between Q3A and Q3:TA code. The byproduct + of this change allows players some more choices when selecting head models. + The following documents the new procedures.

+

Searching for Head + skins
+ The game uses the following paths and order of search when looking for headmodel assets. The asterisk (*) is only used for head + models. When the asterisk is used, the game will try to load the head model + from the models/players/heads folder first. After that, it looks deeper into + the directories.

+

More Variety of Head + Skins
+ If the team creator so chooses, different skins can be created for each team + (note that id chose to use the same head skins for each team … but that doesn’t have to be the case).

+
===================================
Q3A/TA NON-TEAMPLAY SEARCH ORDER
===================================
 
-------------------------------------------------
headmodel = *callisto/lily
 
models/players/heads/callisto/lily/head_default.skin
models/players/heads/callisto/head_lily.skin
 
-------------------------------------------------
headmodel = callisto/lily
 
models/players/callisto/lily/head_default.skin
models/players/callisto/head_lily.skin
models/players/heads/callisto/lily/head_default.skin
models/players/heads/callisto/head_lily.skin
 
============================
Q3A TEAMPLAY SEARCH ORDER
============================
-------------------------------------------------
Example:
team_headmodel = *callisto/lily
team = red
models/players/heads/callisto/lily/head_red.skin
models/players/heads/callisto/head_red.skin
 
-------------------------------------------------
Example:
team_headmodel = callisto/lily
team = red
 
models/players/callisto/lily/head_red.skin
models/players/callisto/head_red.skin
models/players/heads/callisto/lily/head_red.skin
models/players/heads/callisto/head_red.skin
 
===========================
TA TEAMPLAY SEARCH ORDER
===========================
Example:
team_headmodel = *callisto/lily
team = red
teamName = Stroggs
 
models/players/heads/callisto/lily/Stroggs/head_red.skin
models/players/heads/callisto/Stroggs/head_red.skin
models/players/heads/callisto/lily/head_red.skin
models/players/heads/callisto/head_red.skin
 
Example:
team_headmodel = callisto/lily
team = red
teamName = Stroggs
 
models/players/callisto/lily/Stroggs/head_red.skin
models/players/callisto/Stroggs/head_red.skin
models/players/callisto/lily/head_red.skin
models/players/callisto/head_red.skin
models/players/heads/callisto/lily/Stroggs/head_red.skin
models/players/heads/callisto/Stroggs/head_red.skin
models/players/heads/callisto/lily/head_red.skin
models/players/heads/callisto/head_red.skin
+

Searching for Model + Skins
+ The following list shows the order in which the game searches for model + skins. When creating new skins for Team Arena or Quake 3 Arena (or related mods of either), use the following directory arrangement. +

+
===================================
Q3A/TA NON-TEAMPLAY SEARCH ORDER
===================================
-------------------------------------------------
Example:
model = hunter/harpy
 
 
legs:
        models/players/hunter/lower_harpy_default.skin
        models/players/hunter/lower_harpy.skin
        models/players/characters/james/lower_harpy_default.skin
        models/players/characters/james/lower_harpy.skin
torso:
        models/players/hunter/upper_harpy_default.skin
        models/players/hunter/upper_harpy.skin
        models/players/characters/hunter/upper_harpy_default.skin
        models/players/characters/hunter/upper_harpy.skin
 
============================
Q3A TEAMPLAY SEARCH ORDER
============================
 
-------------------------------------------------
Example:
team_model = hunter/harpy
team = red
 
legs:
        models/players/hunter/lower_harpy_red.skin
        models/players/hunter/lower_red.skin
        models/players/characters/hunter/lower_harpy_red.skin
        models/players/characters/hunter/lower_red.skin
torso:
        models/players/hunter/upper_harpy_red.skin
        models/players/hunter/upper_red.skin
        models/players/characters/hunter/upper_harpy_red.skin
        models/players/characters/hunter/upper_red.skin
 
 
===========================
TA TEAMPLAY SEARCH ORDER
===========================
 
-------------------------------------------------
Example:
team_model = james/badass
team = red
teamName = Stroggs
 
legs:
        models/players/james/Stroggs/lower_badass_red.skin
        models/players/james/Stroggs/lower_red.skin
        models/players/james/lower_badass_red.skin
        models/players/james/lower_red.skin
        models/players/characters/james/Stroggs/lower_badass_red.skin
        models/players/characters/james/Stroggs/lower_red.skin
        models/players/characters/james/lower_badass_red.skin
        models/players/characters/james/lower_red.skin
torso:
        models/players/james/Stroggs/upper_badass_red.skin
        models/players/james/Stroggs/upper_red.skin
        models/players/james/upper_badass_red.skin
        models/players/james/upper_red.skin
        models/players/characters/james/Stroggs/upper_badass_red.skin
        models/players/characters/james/Stroggs/upper_red.skin
        models/players/characters/james/upper_badass_red.skin
        models/players/characters/james/upper_red.skin
+

TOP

+

Appendix I: + Expanded Team Skin Functionality for Q3A

+

Technically speaking, the + following information has nothing to do with Team Arena teams, but this + document is just as good a place for this information to reside as any.

+

At the request of several + modelers who worked with the modeling and skin making forums and archives at Polycount, + we changed the way that Quake III Arena (not just Team Arena) handles skin + replacement in team games. Originally, if a skinner made a new skin for a Q3A + model AND made team color versions of that skin, the game would not + automatically use the team version. Instead, it would display the id default + red or blue skin. To see a new team skin in the game, the skinner literally + had to remove the default skins and replace them with the new versions.

+

With version 1.28 of the + game code, we’ve been able to get that changed. The + file format that we used is the one requested by the skinners themselves. + However, because of the way searches for head skins now work, pre-existing + Q3A files are not going to work correctly. They need to have one, renamed + skin file added for the proper head skins to appear in the game.

+

When a properly set-up + user-created skin for a model is accompanied by matching team color skins, + the game will now use them instead of the default team skin for that model.

+

The example below shows + the assets that must be in the pakfile for the Blue + version of a skin named Hellion that uses the id-created Crash model.

+
 Hellion_blue.tga                          models\players\crash\
 Hellion_blue_f.tga                       models\players\crash\
 Hellion_blue_t.tga                       models\players\crash\
 Head_Hellion_blue.skin              models\players\crash\
 Icon_Hellion_blue.tga                 models\players\crash\
 Lower_Hellion_blue.skin            models\players\crash\
 Upper_Hellion_blue.skin            models\players\crash\
 Head_blue.skin                            models\players\crash\Hellion\
+

The last file is the key + to making it work … a skin file with the same contents as Head_Hellion_blue.skin, + only renamed Head_blue.skin and placed one layer + deeper in the Hellion directory. Note that BOTH head_hellion_blue.skin + in the crash directory and head_blue.skin in the + crash/Hellion directory are necessary for the model to work properly.

+

To see a working example + of a properly set up Q3A skin, look for Hades Orphan, the revised version + (h20.pk3), by Camilla “milla” Bennett for the Crash + model.

+

TOP

+

Appendix J: + Contents of the tm_kreechurs.pk3

+

The following list is + taken directly from the contents of the pak file contain + the BoB model and the Kreechurs + team information. Use this as a reference when creating your own team pak files.

+
tm_kreechurs.pk3
Name    Modified       Size    Ratio   Packed  Path
kreechurs.team  5/9/2001 12:01 PM      1,968   61%     770
kreechurs_readme.txt   5/9/2001       3,162   59%     1,286   
animation.cfg  5/161/2001 4:32 PM     1,173   59%     478         models\players\characters\BoB\
default_flame1.jpg     513/2000 7:19 PM       5,972   10%     5,385        models\players\characters\BoB\
default_flame2.jpg     51312000 7:19 PM       5,984   10%     5,359        models\players\characters\BoB\
default_flame3.jpg     5/3/2000 7:20 PM       5,623   11%     5,014        models\players\characters\BoB\
default_flame4.jpg     51312000 7:20 PM       5,284   12%     4,658        models\players\characters\BoB\
default_flame5.jpg     513/2000 7:21 PM       5,231   10%     4,691         models\players\characters\BoB\
default_flame6.jpg     5/3/2000 7:21 PM       5,318   11%     4,735         models\players\characters\BoB\
qefault_flame7.jpg     5/3/2000 7:21 PM       5,807   11%     5,197         models\players\characters\BoB\
default_flame8.jpg     5/3/2000 7:22 PM       6,114   10%     5,510         models\players\characters\BoB\
default_flameball.jpg  5/3/2000 7:22 PM       3,010   26%     2,216         models\players\characters\BoB\
defaultjets.tga        611412000 2:55 AM      49,196  37%     31,075         models\players\characters\BoB\
icon_blue.tga  6/13/2000 8:15 PM      16,402  58%     6,845         models\players\characters\BoB\
icon_red.tga   6/13/2000 8:15 PM      16,402  61%     6,327         models\players\characters\BoB\
lower.md3      3/3/2001 12:11 PM      593,972        33%     398,956         models\players\characters\BoB\
lower_1.md3    3/3/2001 12:11 PM      593,972 33%     398,956         models\players\characters\BoB\
lower_2.md3    3/3/2001 12.11 PM      593,972        33%     398,956         models\players\characters\BoB\
upper.md3      3/3/2001 12:11 PM      721,388        33%     483,599         models\players\characters\BoB\
upper_1.md3    3/3/2001 12:11 PM      721,388        33%     483,599         models\players\characters\BoB\
upper_2.md3    3/3/2001 12:11 PM      721,388        33%     483,599         models\players\characters\BoB\
icon_default.tga       6/13/2000 8:15 PM      16,402  61%     6,328         models\players\ characters\BoB\
blue.tga       10/23/2000 7: 17 PM    196,626        41%     115,756         models\players\characters\BoB\kreechurs\
lower_blue.skin        4/6/2001 11 :20 AM     203     52%     98         models\players\characters\BoB\kreechurs\
lower_default.skin     4/6/200 111:25AM       204     50%     102         models\players\characters\BoB\kreechurs\
lower_red.skin  4/6/2001 11:20AM       204     50%     102         models\players\characters\BoB\kreechurs\
red.tga        10/23/2000 7:17 PM     196,626        43%     111,607         models\players\characters\BoB\kreechurs\
upper_blue.skin        41612001 11:20AM       281     58%     118         models\players\characters\BoB\kreechurs\
upper_default.skin     416/2001 11:25AM       282     58%     119         models\players\characters\BoB\kreechurs\
upper_red.skin  4/6/2001 11 :20 AM     282     58%     119         models\players\characters\BoB\kreechurs\
blue_h.tga     6/14/2000 10:26 AM     196,652        56%     86,873         models\players\heads\Kreecha\
default_fc.tga  5/29/2000 10:07 AM     3,090   90%     323         models\players\heads\Kreecha\
default_visor.tga      10/23/2000 7:57 PM     196,626        96%     7,656         models\players\heads\Kreecha\
Kreecha.md3    3/3/2001 12:12 PM      5,868   46%     3,171         models\players\heads\Kreecha\
Kreecha_1.md3  3/3/2001 12:12 PM      5,868   46%     3,171         models\players\heads\Kreecha\
Kreecha_2.md3  3/3/2001 12:12 PM      5,868   46%     3,171         models\players\heads\Kreecha\
head_blue.skin  3/12/2001 4:58 PM      56      7%      52         models\players\heads\Kreecha\
head_default.skin      3/1212001 4:57 PM      53      8%      49         models\players\heads\Kreecha\
head_red.skin  3/12/2001 4:58 PM      55      7%      51         models\players\heads\Kreecha\
icon_blue.tga  6/13/2000 8:15 PM      16,402  58%     6,846        models\players\heads\Kreecha\
icon_default.tga       6/13/2000 8:15 PM      16,402  61%     6,328         models\players\heads\Kreecha\
icon_red.tga   6/1312000 8.15 PM      16,402  61%     6,328         models\players\heads\Kreecha\
red_h.tga      3112/2001 6:06 PM      196,626        66%     66,666         models\players\heads\Kreecha\
BoB.shader     3/12/2001 5:49 PM      2,912   89%     308     scripts\
kreechurs.bot  5/9/2001 11 :43 AM     405     70%     123     scripts\
kreechurs.shader       4/6/2001 3:05 PM       500     67%     163     scripts\
Kreecha.vc     5/2/2001 5:53 PM       21      0%      21      scripts\
Infinite.vc    4/9/2001 11: 18 AM     24      0%      24      scripts\
Prime.vc       4/9/2001 11: 18 AM     24      0%      24      scripts\
Vader.vc       4/9/2001 11: 18 AM     24      0%      24      scripts\
death1.wav     2/23/2000 9:20 AM      16,720  47%     8,900   sound\player\BoB\
death2.wav     5/7/2000 5:46 PM       18,496  17%     15,356  sound\player\BoB\
death3.wav     5/7/2000 5:46 PM       18,496  17%     15,356  sound\player\BoB\
fall1.wav      5/9/2000 6:40 AM       13,944  62%     5,327   sound\player\BoB\
falling1.wav   5/7/2000 5:22 PM       40,722  26%     30,585  sound\player\BoB\
gasp.wav       5/7/2000 5:15 PM       55,230  4%      53,293  sound\player\BoB\
jump1.wav      5/7/20009:26 PM 47,778   8%     44,070  sound\player\BoB\
pain100_1.wav  5/7/20005:33PM 6,894    29%    4,880   sound\player\BoB\
pain25_1.wav   5/7/20005:34 PM 9,832    26%    7,248   sound\player\BoB\
pain50_1.wav   5/7/20005:33 PM 6,444    22%    5,007   sound\player\BoB\
pain75_1.wav   5/7/20005:33 PM 9,512    26%    6,997   sound\player\BoB\
taunt.wav      3/3/2001 12:17 PM      163,874  11%    146,434 sound\player\BoB\
gs_01.wav      10/20/20005:05 PM      51,304   10%    46,296  sound\voices\BoB\
gs_02.wav      10/20/20005:05 PM      69,704   10%    62,811  sound\voices\BoB\
gs_03.wav      10/20/20005:05 PM      53,394   8%     49,195  sound\voices\BoB\
gs_04.wav      10/20/20005:05 PM      48,802   3%     47,157  sound\voices\BoB\
gs_05.wav      10/20/20005:05 PM      62,170   4%     59,614  sound\voices\BoB\
gs_06.wav      10/20/2000 5:05 PM     53,622   5%     51,075  sound\voices\BoB\
gs_07 .wav     10/20/2000 5:05 PM     67,756   10%    60,889  sound\voices\BoB\
gs_08.wav      10/20/2000 5:05 PM     61,458   4%     59,265  sound\voices\BoB\
gs_09.wav      10/20/2000 5:05 PM     60,042   6%     56,640  sound\voices\BoB\
gs_10.wav      10/20/2000 5:05 PM     82,526   4%     79,337  sound\voices\BoB\
or_01.wav      10/20/2000 5.05 PM     46,892   8%     42,990  sound\voices\BoB\
or_02.wav      10/20/2000 5:05 PM     63,152   10%    56,946  sound\voices\BoB\
or_03.wav      10/20/2000 5:05 PM     54,714   6%     51,246  sound\voices\BoB\
or_04.wav      10/20/2000 5:05 PM     43,640   4%     41,815  sound\voices\BoB\
or_05.wav      10/20/2000 5:05 PM     56,694   6%     53,172  sound\voices\BoB\
or_06.wav      10/20/2000 5:05 PM     44,248   6%     41,468  sound\voices\BoB\
or_07.wav      10/20/2000 5:05 PM     57,616   4%     55,043  sound\voices\BoB\
or_08.wav      10/20/2000 5:05 PM     22,626   5%     21,538  sound\voices\BoB\
or_09.wav      10/20/2000 5:05 PM     36,260   30%    25,528  sound\voices\BoB\
or_10.wav      10/20/2000 5:05 PM     43,396   7%     40,432  sound\voices\BoB\
or_11.wav      10/20/2000 5:05 PM     37,070   4%     35,592  sound\voices\BoB\
or_12.wav      10/20/2000 5:05 PM     25,714   4%     24,796  sound\voices\BoB\
ps_01.wav      10/20/2000 5:05 PM     58,040   4%     55,538  sound\voices\BoB\
ps_02.wav      10/20/2000 5:05 PM     40,686   4%     39,161  sound\voices\BoB\
ps_03.wav      10/20/2000 5:05 PM     44,870   5%     42,695  sound\voices\BoB\
ps_04.wav      10/20/2000 5:05 PM     50,550   4%     48,465  sound\voices\BoB\
ps_05.wav      10/20/2000 5:05 PM     64,256   9%     58,718  sound\voices\BoB\
ps_06.wav      10/20/2000 5:05 PM     60,770   4%     58,385  sound\voices\BoB\
ps_07.wav      10/20/2000 5:05 PM     41,604   3%     40,372  sound\voices\BoB\
ps_08.wav      10/20/2000 5:05 PM     33,102   4%     31,860  sound\voices\BoB\
ps_09.wav      10/20/2000 5:05 PM     43,578   14%    37,279  sound\voices\BoB\
ps_1 0.wav     10/20/2000 5:05 PM     48,126   3%     46,467  sound\voices\BoB\
ps_11.wav      10/20/2000 5:05 PM     52,114   7%     48,442  sound\voices\BoB\
ps_12.wav      10/20/2000 5:05 PM     46,054   3%     44,632  sound\voices\BoB\
ps_13.wav      10/20/2000 5:05 PM     52,026   4%     49,921  sound\voices\BoB\
ps_14.wav      10/20/2000 5:05 PM     38,428   3%     37,165  sound\voices\BoB\
re_01.wav      10/20/2000 5:05 PM     42,970   5%     40,707  sound\voices\BoB\
re_02.wav      10/20/2000 5:05 PM     42,010   16%    35,118  sound\voices\BoB\
re_03.wav      10/20/2000 5:05 PM     44,994   4%     43,387  sound\voices\BoB\
re_04.wav      10/20/2000 5:05 PM     26,620   3%     25,824  sound\voices\BoB\
re_05.wav      10/20/2000 5:05 PM     31,732   4%     30,549  sound\voices\BoB\
re_06.wav      10/20/2000 5:05 PM     20,342   5%     19,287  sound\voices\BoB\
re_07.wav      10/20/2000 5:05 PM     23,544   4%     22,526  sound\voices\BoB\
re_08.wav      10/20/2000 5:05 PM     38,070   3%     36,822  sound\voices\BoB\
re_09.wav      10/20/2000 5:05 PM     33,436   4%     32,041  sound\voices\BoB\
re_10.wav      10/20/2000 5:05 PM     29,016   7%     26,898  sound\voices\BoB\
re_11.wav      10/20/2000 5:05 PM     31,998   3%     30,885  sound\voices\BoB\
tt_01.wav      10/20/2000 5:05 PM     56,240   7%     52,038  sound\voices\BoB\
tt_02.wav      10/20/2000 5:05 PM     57,144   5%     54,206  sound\voices\BoB\
tt_03.wav      10/20/2000 5:05 PM     68,484   9%     62,426  sound\voices\BoB\
tt_04.wav      10/20/2000 5:05 PM     55,838   5%     52,785  sound\voices\BoB\
tt_05.wav      10/20/2000 5:05 PM     75,106   6%     70,367  sound\voices\BoB\
tt_06.wav      10/20/2000 5:05 PM     81,630   10%    73,342  sound\voices\BoB\
tt_07.wav      10/20/2000 5:05 PM     60,354   5%     57,333  sound\voices\BoB\
tt_08.wav      10/20/2000 5:05 PM     56,642   5%     53,981  sound\voices\BoB\
tt_09.wav      10/20/2000 5:05 PM     49,216   3%     47,675  sound\voices\BoB\
tt_10.wav      10/20/2000 5:05 PM     60,656   5%     57,563  sound\voices\BoB\
tt_11.wav      10/20/2000 5:05 PM     75,106   5%     71,690  sound\voices\BoB\
tt_12.wav      10/20/2000 5:05 PM     90,760   6%     84,879  sound\voices\BoB\
tt_13.wav      10/20/2000 5:05 PM     52,628   8%     48,347  sound\voices\BoB\
tt_14.wav      10/20/2000 5:05 PM     72,848   4%     70,004  sound\voices\BoB\
tt_15.wav      10/20/2000 5:05 PM     109 184  12%    96,020  sound\voices\BoB\
tt_16.wav      10/20/2000 5:05 PM     48,812   3%     47,245  sound\voices\BoB\
tt_17.wav      10/20/2000 5:05 PM     64,506   10%    57,951  sound\voices\BoB\
tt_18.wav      10/20/2000 5:05 PM     85,018   6%     79,532  sound\voices\BoB\
tt_19.wav      10/20/2000 5:05 PM     72,978   17%    60,260  sound\voices\BoB\
tt_20.wav      10/20/2000 5:05 PM     73,328   6%     68,967  sound\voices\BoB\
tt_21.wav      10/20/2000 5:05 PM     79,434   7%     74, 101 sound\voices\BoB\
tt_22.wav      10/20/2000 5:05 PM     74,636   4%     71,397  sound\voices\BoB\
tt_23.wav      10/20/2000 5:05 PM     37,034   18%    30,448  sound\voices\BoB\
tt_24.wav      10/20/2000 5:05 PM     43,316   5%     41,087  sound\voices\BoB\
tt_25.wav      10/20/2000 5:05 PM     48,376   13%    42,005  sound\voices\BoB\
tt_26.wav      10/20/2000 5:05 PM     35,464   8%     32,716  sound\voices\BoB\
tt_27.wav      10/20/2000 5:05 PM     38,430   6%     35,995  sound\voices\BoB\
tt_28.wav      10/20/2000 5:05 PM     40,698   13%    35,580  sound\voices\BoB\
tt_29.wav      10/20/2000 5:05 PM     36,074   17%    29,767  sound\voices\BoB\
tt_30.wav      10/20/2000 5:05 PM     83,012   5%     79,167  sound\voices\BoB\
tt_31.wav      10/20/2000 5:05PM      55,530   14%    47,706  sound\voices\BoB\
tt_32.wav      10/20/2000 5:05 PM     52,040   15%    44,369  sound\vojces\BoB\
tt_33.wav      10/20/2000 5:05 PM     96,360   10%    86,316  sound\voices\BoB\
tt_34.wav      10/20/2000 5:05 PM     100,896  5%     96,263  sound\voices\BoB\
tt_35.wav      10/20/2000 5:05 PM     104,038  10%    93,172  sound\voices\BoB\
tt_36.wav      10/20/2000 5:05 PM     34,940   4%     33,701  sound\voices\BoB\
tt_37.wav      10/20/2000 5:05 PM     81,704   12%    71,904  sound\voices\BoB\
tt_38.wav      10/20/2000 5:05 PM     58,670   19%    47,593  sound\voices\BoB\
tt_39.wav      10/20/2000 5:05 PM     57,012   4%     54,683  sound\voices\BoB\
tt_40.wav      10/20/2000 5:05 PM     94,790   5%     90,171  sound\voices\BoB\
tt_41.wav      10/20/2000 5:05 PM     89,030   7%     82,981  sound\voices\BoB\
tt_42.wav      10/20/2000 5:05 PM     76,556   14%    65,952  sound\voices\BoB\
tt_43.wav      10/20/2000 5:05 PM     67,744   10%    60,694  sound\voices\BoB\
tt_44.wav      10/20/2000 5:05 PM     44,188   20%    35,183  sound\voices\BoB\
voc_01.wav     10/20/2000 5:05 PM     51,640   12%    45,423  sound\voices\BoB\
voc_02.wav     10/20/2000 5:05 PM     37,916   12%    33,258  sound\voices\BoB\
voc_03.wav     10/20/2000 5:05 PM     40,364   9%     36,548  sound\voices\BoB\
voc_04.wav     10/20/2000 5:05 PM     60,412   4%     57,815  sound\voices\BoB\
voc_05.wav     10/20/2000 5:05 PM     56,172   6%     52,986  sound\voices\BoB\
voc_06.wav     10/20/2000 5:05 PM     41,284   3%     39,918  sound\voices\BoB\
voc_07.wav     10/20/2000 5:05 PM     49,442   9%     45,003  sound\voices\BoB\
voc_08.wav     10/20/2000 5:05 PM     61,656   5%     58,449  sound\voices\BoB\
voc_09.wav     10/20/2000 5:05 PM     44,306   7%     41,295  sound\voices\BoB\
voc_10.wav     10/20/2000 5:05 PM     58,298   9%     52,997  sound\voices\BoB\
voc_11.wav     10/20/2000 5:05 PM     55,050   18%    45,254  sound\voices\BoB\
voc_12.wav     10/20/2000 5:05 PM     40,614   9%     37,135  sound\voices\BoB\
voc_13.wav     10/20/2000 5:05 PM     43,068   4%     41,307  sound\voices\BoB\
voc_14.wav     10/20/2000 5:05 PM     45,512   9%     41,619  sound\voices\BoB\
voc_15.wav     10/20/2000 5:05 PM     47,532   3%     45,886  sound\voices\BoB\
voc_16.wav     10/20/2000 5:05 PM     40,756   3%     39,412  sound\voices\BoB\
yoc_17.wav     10/20/2000 5:05 PM     52,070   7%     48,546  sound\voices\BoB\
voc_18.wav     10/20/2000 5:05 PM     55,394   6%     51,854  sound\voices\BoB\
voc_19.wav     10/20/2000 5:05 PM     74,718   8%     68,688  sound\voices\BoB\
voc_20.wav     10/20/2000 5:05 PM     47,504   10%    42,821  sound\voices\BoB\
voc_21.wav     10/20/2000 5:05 PM     52,034   7%     48,188  sound\voices\BoB\
voc_22.wav     10/20/2000 5:05 PM     36,558   10%    32,925  sound\voices\BoB\
voc_23.wav     10/20/2000 5:05 PM     35,880   4%     34,606  sound\voices\BoB\
voc_24.wav     10/20/2000 5:05 PM     28,234   4%     27,227  sound\voices\BoB\
voc_25.wav     10/20/2000 5:05 PM     50,004   14%    42,898  sound\voices\BoB\
voc_26.wav     10/20/2000 5:05 PM     62,516   10%    56,117  sound\voices\BoB\
voc_27.wav     10/23/2000 3:01 PM     49,444   5%     46,934  sound\voices\BoB\
voc_28.wav     10/23/2000 3:05 PM     54,600   6%     51,556  sound\voices\BoB\
Kreechurs.tga  4/6/2001 1 :08 PM      65,580   99%    873     team_icon\
Kreechurs_blue.tga     4/6/2001 1 :09 PM      65,580   98%    1,030   team_icon\
Kreechurs_red.tga      4/6/2001 1 :09 PM      65,580   98%    1,016   team_icon\
Kreechurs.roq  5/09/2001 5:45 PM      1,078,120      9%      976,146 ui\assets\
Kreechurs.tga  3/2/2001 11 :57 AM     65,580   99%    873     ui\assets\
Kreechurs_metal.tga    3/2/2001 10:58 AM      65,580   74%    16,883  ui\assets\
Kreechurs_name.tga     3/2/200111:16AM 131,116  91%    11,640  ui\assets\
Kreechurs_name_alt.tga         3/2/200111:05AM 131,116  97%    3,870   ui\assets\
 
188 file(s)            12,590,550      25%    9,496,872
+

TOP

+

Appendix K: A + Minimal Team

+

The following list is the + minimum number of files needed to make a new team and assumes that the team + creator is using both the Janet and James models (the models shipped with Quake + III: Team Arena) and the pre-existing heads that work with those models. Note + that no sound or voice files are necessary. No head files are necessary. When + adding new heads, refer to the Kreecha head in + Appendix J. When reskinning previously created heads, + refer to the Callisto/Lily head in Appendix J. Use + this list as a reference when creating your own team pak + files.

+
tm_kreechurs.pk3
Name    Modified       Size    Ratio   Packed  Path
kreechurs.team  5/9/2001 12:01 PM      1,968   61%     770
kreechurs_readme.txt   5/9/2001       3,162   59%     1,286   
blue.tga       10/23/2000 7: 17 PM    196,626        41%     115,756         models\players\James\kreechurs\
lower_blue.skin        4/6/2001 11 :20 AM     203     52%     98         models\players\James\kreechurs\
lower_default.skin     4/6/200 111:25AM       204     50%     102         models\players\James\kreechurs\
lower_red.skin  4/6/2001 11:20AM       204     50%     102         models\players\James\kreechurs\
red.tga        10/23/2000 7:17 PM     196,626        43%     111,607         models\players\James\kreechurs\
upper_blue.skin        41612001 11:20AM       281     58%     118         models\players\James\kreechurs\
upper_default.skin     416/2001 11:25AM       282     58%     119         models\players\James\kreechurs\
upper_red.skin  4/6/2001 11 :20 AM     282     58%     119         models\players\James\kreechurs\
blue.tga       10/23/2000 7: 17 PM    196,626        41%     115,756         models\players\Janet\kreechurs\
lower_blue.skin        4/6/2001 11 :20 AM     203     52%     98         models\players\Janet\kreechurs\
lower_default.skin     4/6/200 111:25AM       204     50%     102         models\players\Janet\kreechurs\
lower_red.skin  4/6/2001 11:20AM       204     50%     102         models\players\Janet\kreechurs\
red.tga        10/23/2000 7:17 PM     196,626        43%     111,607         models\players\Janet\kreechurs\
upper_blue.skin        41612001 11:20AM       281     58%     118         models\players\Janet\kreechurs\
upper_default.skin     416/2001 11:25AM       282     58%     119         models\players\Janet\kreechurs\
upper_red.skin  4/6/2001 11 :20 AM     282     58%     119         models\players\Janet\kreechurs\
kreechurs.bot  5/9/2001 11 :43 AM     405     70%     123     scripts\
kreechurs.shader       4/6/2001 3:05 PM       500     67%     163     scripts\
kreechurs.tga  4/6/2001 1 :08 PM      65,580   99%    873     team_icon\
kreechurs_blue.tga     4/6/2001 1 :09 PM      65,580   98%    1,030   team_icon\
kreechurs_red.tga      4/6/2001 1 :09 PM      65,580   98%    1,016   team_icon\
kreechurs.tga  3/2/2001 11 :57 AM     65,580   99%    873     ui\assets\
kreechurs_metal.tga    3/2/2001 10:58 AM      65,580   74%    16,883  ui\assets\
kreechurs_name.tga     3/2/200111:16AM 131,116  91%    11,640  ui\assets\
kreechurs_name_alt.tga         3/2/200111:05AM 131,116  97%    3,870   ui\assets\
 
27 file(s)             1,354,162              271,112 
+

TOP

+

Appendix L: + Contents of the TAhead_lily.pk3

+

The following list is + taken directly from the contents of the pak file + that contains the Lily head model that is a part of the Kreechurs + team. Lily is based on the Callisto head model from + the original TA game (blinking female head with red or blue hair cut in a + pageboy style). Use this as a reference when creating your own pak files for new character heads.

+
TAhead_lily.pk3
 
Name    Modified       Size    Ratio   Packed  Path
Lily.vc        5/112001 6:56 PM       23      0%      23      scripts\Callisto\
red_Iily.shader        4/9/20011:18 PM        557     79%     117     scripts\
lily .shader   4/9/2001 1: 19 PM      528     78%     114      scripts\
blue_lily.shader       5/1/20015:50 PM        566     79%     119     scripts\
Lily_redface2.tga      4/3/200111:41 PM       16,428  32%     11,092         models\players\heads\Callisto\Lily\
Lily_redface.tga       4/3/2001 11 :40 PM     16,428  33%     11,062         models\players\heads\Callisto\Lily\
Lily_red.tga   4/2/2001 2:14 PM       65,580  79%     13,873         models\players\heads\Callisto\Lily\
Lily_blueface2.tga     4/3/2001 11 :42 PM     16,428  32%     11, 182         models\players\heads\Callisto\Lily\
Lily_blueface.tga      4/3/200111:41 PM       16,428  32%     11,174         models\players\heads\Callisto\Lily\
LJily_blu.tga  4/10/2001 12:55 AM     65,580  33%     43,929         models\players\heads\Callisto\Lily\
icon_red.tga   3/27/20016:15 AM       12,306  30%     8,581         models\players\heads\Callisto\Lily\
icon_default.tga       3/27/20016:15 AM       12,306  30%     8,595         models\players\heads\Callisto\Lily\
icon_blue.tga  3/29/2001 10:20 PM     16,428  41%     9,707         models\players\heads\Callisto\Lily\
head_red.skin  4/17/20014:35 PM       125     44%     70         models\players\heads\Callisto\Lily\
head_default.skin      4/17/20014:35 PM       126     41%     74         models\players\heads\Callisto\Lily\
head_blue.skin  4/17/20014:33 PM       126     44%     71         models\players\heads\Callisto\Lily\
 
16 file(s)             239,963        46%     129,783
 
+

TOP

+
+

 

+
+ +

 

+ +
+ + + + diff --git a/docs/manual/quake3/Q3AShader_Manual/appendix/appA.html b/docs/manual/quake3/Q3AShader_Manual/appendix/appA.html new file mode 100644 index 00000000..907f7f38 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/appendix/appA.html @@ -0,0 +1,60 @@ + + +Quake III Arena Shader Manual: Appendix A + + + +

Q3Radiant Shader Manual

+ +TTimo
+2001.31.08
+
+
+

Appendix A: usage of targetShaderName and targetShaderNewName

+ +

+The targetShaderName and targetShaderNewName keys can be used with any entity +that supports the target key (the entity instance does not actually have to use +the target key for these new keys to work). If both are defined, then when the +entity decides to activate its targets, all shaders/textures in the map that +were originally the same name as the targetShaderName value, will be changed to +the targetShaderNewName value. +

+ +

+For example this would make it look like the red light shader is "turning on": +

+ +

+"targetShaderName" "textures/proto2/redlight_off"
+"targetShaderNewName" "textures/proto2/redlight_on" +

+ +

+And this would turn it back off: +

+ +

+"targetShaderName" "textures/proto2/redlight_off"
+"targetShaderNewName" "textures/proto2/redlight_off" +

+ +

+Note that the ORIGINAL shader name is used in both instances, not whatever it +happens to be currently. Also, of course, this will happen globally. If the +mapper wanted to affect only a certain set of red lights, he/she would need to +make a unique shader name to be used with that set. +

+ +

+The code that supports these keys is in G_UseTargets in g_utils.c. +

+ +

+For more information, see this thread:
+ +http://www.quake3world.com/ubb/Forum6/HTML/014812.html#9 + +

+ + diff --git a/docs/manual/quake3/Q3AShader_Manual/ch01/pg1_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch01/pg1_1.htm new file mode 100644 index 00000000..4edf8735 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch01/pg1_1.htm @@ -0,0 +1,126 @@ + + +Quake III Arena Shader Manual: Introduction + + + +

Q3Radiant Shader Manual

+
+

1 Preface: Making Your Own Shaders

+ +The Manual for the Q3Radiant editor program contains a section called Creating New Assets that has the necessary information for setting up the files to create your own custom Quake III Arena shaders. It is recommended that you study the scripts in this document and in the individual shader scripts. Pay careful attention to syntax and punctuation. This is where you are most likely to make mistakes. + +

2 Introduction

+ +The graphic engine for QuakeIII Arena has taken a step forward by putting much more direct control over the surface +qualities of textures into the hands of designers and artists. In writing this manual, we have tried to define the +concepts and tools that are used to modify textures in a way that, it is hoped, will be graspable by users who already have basic knowledge ofcomputer graphics but are not necessarily computer programmers. It is not a tutorial, nor was it intended to be one. + +

2.1 What is a Shader?

+ +Shaders are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; base, hell, castle, etc,). Several specific script documents have also been created to handle special cases, like liquids, sky and special effects. + +

For Quake III Arena,Shader scripts are located in quake3/baseq3/scripts. + +

A Quake III Arena shader file consists of a series of surface attribute and rendering instructions formatted +within braces ("{" and "}"). Below you can see a simple example of syntaxand format for a single process, including the +Q3MAP keywords or "SurfaceParameters", which follow the first bracket and a single bracketed "stage": + +

textures/liquids/lava
+	{
+	deformVertexes wave sin 0 3 0 0.1
+	tessSize 64
+	{
+	map textures/common/lava.tga
+	}
+}
+
+ +

2.2 Shader Name & File Conventions

+The first line is the shader name. Shader names can be up to 63 characters long. The names are often a mirror of +a pathname to a .tga file without the extension or base dir (/quake3/baseq3 in ourcase), but they do not need to be. + +

Shaders that are only going to be referenced by the gamecode, not modeling tools, often are just a single world, +like"projectionShadow" or "viewBlood". + +

Shaders that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game. + +

Shaders that are placed on surfaces in the map editor commonly mirror a .tga file, but the "qer_editorimage" shader parameter canforce the editor to use an arbitrary image for display. + +

Shader pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes "/" for directory separators. + +

2.3 Shader Types

+The keywords that affect shaders are divided into two classes. The first class of keywords are global parameters. Some global parameters ("surfaceparms." And all "q3map_" keywords) are processed by Q3MAP, and change physical attributes of the surface that uses the shader. These attributes can affect the player. To see changes in these +parameters one must re-bsp the map. + +

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes +only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game console). + +

Shader keywords are notcase sensitive. + +

IMPORTANT NOTE: some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end (see various examples). + +

2.4 Key Concepts

+ +Ideally, a designer or artist who is manipulating textures with shader files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a +grasp on to make shaders work for you. + +

2.4.1 Surface Effects vs. Content Effects vs. Deformation Effects
+Shaders not only modify the visible aspect of textures on a geometry brush, curve, patch or mesh model, but they can also have an effect on both the content, "shape," and apparent movement of those things. A surface effect does nothing to modify +the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value +changes. Content shaders affect the way the brush operates in the game world. Examples include water, fog, nonsolid, and +structural. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move. + +

2.4.2 Power Has a Price
+The shader script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of +and potential special effects that may be applied to surfaces in the gameworld. But it is power that comes with a price tag +attached, and the cost is measured in performance speed. Each shader phase that affects the appearance of a texture causes the Q3:Aengine to make another processing pass and redraw the world. Think of it as if you were adding all +the shader-affected triangles to the total r_speed count for each stage in the shader script. A shader-manipulated texture that is seen through another shader-manipulated texture (e.g. a light in fog) has the effect of adding the total number of passes together for the affected triangles. A light that required two passes seen through a fog that requires one pass will be treated as having to redraw that part of the world three times. + +

2.4.3 RGB Color
+ +RGB means "Red, Green, Blue."Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Quake III Arena and most higher-end computer art programs (and the color selector in Windows), the intensities ofthe individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbers. The value for complete black is 0 0 0. The value for complete white is 255 255 255. However, the QuakeIII Arena graphics engine requires that the color range be "normalized" into a range between 0.0 and 1.0. + +

2.4.4 Normalization: a Scale of 0 to 1
+The mathematics in Quake III Arena use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the artprogram's values for the component colors by 255. The resulting three values are your Quake III Arena formula for that color component. The same holds true for texture coordinates. + +

2.4.5 Texture Sizes
+TGA texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16. + +

2.4.6 Color Math
+ +In Quake III Arena , colors are changed by mathematical equations worked on the textures by way ofthe scripts or +"programlets" in the shader file. An equation that adds to or multiplies the number values in atexture causes it to become +darker. Equations that subtract from or modulate number values in a texture cause it to become lighter. Either equation can change the hue and saturation of a color. + +

2.4.7 Measurements
+ +The measurements used in the shaders are in either game units, color units, or texture units. + +

· Game unit: A game unit is used by deformations to specify sizes relative to the world. Game units are the same scale we have had since way back in the Wolfensteindays - 8 units equals one foot. The default texture scale used by the Q3Radiant map editor results in two texels for each game unit, but that can be freely changed. + +

· Color units: Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green,and blue channels, or sometimes as separate values for each channel. + +

· Texture units: This is the normalized (see above) dimensions of the original texture image (or a previously modified texture at a given stage in the shader pipeline). A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or +modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime. + +

2.4.8 Waveform Functions
+Many of the shader functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in Q3A shaders: + +

Sin: Sin standsfor sine wave, a regular smoothly flowing wave ranging from -1 to 1. +
Triangle: Triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1.It will make a choppy looking wave forms. +
Square: A squarewave simply switches from -1 to 1 with no in-between. +
Sawtooth: In the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0. +
Inversesawtooth: This is the reverse of the sawtooth… instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly usefulfor additive cross-fades. + +

Waveforms all have thefollowing properties: +
<base> Where the wave form begins. Amplitude is measured from this base value. +
<amplitude> This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys. +
<phase> This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phaseof 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in a shader, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single shader, but with the phases shifted can be used to create interesting visual effects. Example: using rgbGen in two stages with different colors and a 0.5 difference in phase would cause the manipulated texture to modulate between two distinct colors. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate shader for each, changing only the phase value. +
<freq>Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 +would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 +seconds. +

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/quake3/Q3AShader_Manual/ch02/pg2_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch02/pg2_1.htm new file mode 100644 index 00000000..9bdf0c35 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch02/pg2_1.htm @@ -0,0 +1,222 @@ + + +Quake III Arena Shader Manual: General Shader Keywords + + + +

Q3Radiant Shader Manual

+
+

3 General Shader Keywords

+IMPORTANT NOTE: Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined inthis section) at the very beginning of the shader and to place shader stages at the end (see various examples). + +

These Keywords are global to a shader and affect all stages. They are also ignored by Q3MAP. + +

3.1 skyParms <farbox> <cloudheight> <nearbox>

+ +Specifies how to use the surface as a sky, including an optional far box (stars, moon, etc), optional cloud layers with any shader attributes, and an optional near box (mountains in front of the clouds, etc). + +

<farbox> Specifies a set of files to use as an environment box behind all cloudlayers. Specify "-" for no +farbox, or a file base name. A base name of "env/test" would look for files "env/test_rt.tga", "env/test_lf.tga", +"env/test_ft.tga", "env/test_bk.tga", "env/test_up.tga", "env/test_dn.tga" to use as the right / left / front / back / up / +down sides. + +
<cloudheight> controls apparent curvature of the cloud layers - lower numbers mean more curvature (and thus more distortion at the horizons). Higher height values create "flatter" skies with less horizon distortion. Think of height +as the radius of a sphere on which the clouds are mapped. Good ranges are 64 to 256. The default value is 128. + +
<nearbox> Specified as farbox, to be alpha blended ontop of the clouds. This has not be tested in a long time, so it probably doesn't actually work. Set to "-" to ignore. + +

Design Notes: + +
  • If you are making a map where the sky is seen by looking up most of the time, use a lower cloudheight value. Under those circumstances the tighter curve looks more dynamic. If you are making a map where the sky is seen by looking out windows most of the time or has a map area that is open to the sky on one or more sides, use a higher height to make the clouds seem more natural. + +
  • It is possible to create a sky with up to 8 cloudlayers, but that also means 8 processing passes and a potentially large processing hit. + +
  • Be aware that the skybox does not wrap around the entire world. The "floor" or bottom face of the skybox is not drawn by the game. If a player in the game can see that face, they will see the "hall of mirrors" effect.
+ +

Example: Sky script + +

textures/skies/xtoxicsky_dm9
+{
+	qer_editorimage textures/skies/toxicsky.tga
+	surfaceparm noimpact
+	surfaceparm nolightmap
+q3map_globaltexture
+q3map_lightsubdivide 256
+	q3map_surfacelight 400
+	surfaceparm sky
+	q3map_sun 1 1 0.5 150 30 60
+	skyparms full 512 -
+	{
+		map textures/skies/inteldimclouds.tga
+		tcMod scroll 0.1 0.1
+		tcMod scale 3 2
+	}
+	{
+		map textures/skies/intelredclouds.tga
+		blendFunc add
+		tcMod scroll 0.05 0.05
+		tcMod scale 3 3
+	}
+}
+
+ +

3.2 cull <side>

+Every surface of a polygon has two sides, a front and a back. Typically, we only see the front or "out" side. For +example, a solid block you only show the front side. In many applications we see both. For example, in water, you can see both front and a back. The same is true for things like grates and screens. + +

To "cull" means to remove. The value parameter determines the type of face culling to apply. The default value is cull front if this keyword is not specified. However for items that should be inverted then the value back should be used. To disable culling, the value disable ornone should be used. Only one cull instruction can be set +for the shader. + +

3.2.1 cull front
+ +The front or "outside" of the polygon is not drawn in the world. This is the default value. It is used if the keyword "cull " appears in the content instructions without a <side>value or if the keyword cull does not appear at all in the shader. + +

3.2.2 cull back
+ +Cull back removes the back or "inside" of a polygon from being drawn in the world. + +

3.2.3 cull disable, cull none
+Neither side of the polygon is removed. Both sides are drawn in the game. Very useful for making panels or barriers that +have no depth, such as grates, screens, metal wire fences and so on and for liquid volumes that the player can see from within. Also used for energy fields, sprites, and weapon effects (e.g. plasma). + +

Design Notes: For things like grates and screens, put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.
+ +

3.3 deformVertexes

+ +This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the shader passes. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance. + +

3.3.1 +deformVertexes wave <div> <func> +<base><amplitude> <phase> <freq>
+ +Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions of the type sin,triangle, square, sawtooth orinversesawtooth . The "div" parameter is used to +control the wave "spread" - a value equal to the tessSizeof the surface is a good default value (tessSize is subdivision size, in game units, used for the shader when seen in the game world). + +

3.3.2 +deformVertexes normal <div> <func> +<base><amplitude ~0.1-~0.5> <frequency +~1.0-~4.0>
+ +This deformation affects the normals of a vertex without actually moving it, which will effect later shader options like +lighting and especially environment mapping. If the shader stages don't use normals in any of their calculations, there will +be novisible effect. + +

Design Notes: Putting values of 0.1 to 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results. Some things that have been done with it: A small fluttering bat, falling leaves, rain, flags.
+ +

3.3.3 +deformVertexes bulge <bulgeWidth> +<bulgeHeight><bulgeSpeed>
+ +This forces a bulge to move along the given s and t directions. Designed for use on curved pipes. + +

Specific parameter definitions for deform keywords: + +
<div> This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller +values create agreater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things tolook "wavelike"). + +
<func> This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing +wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square +wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this. + +
<base> This is the distance, in game units that the apparent surface of the texture is displaced from the +actual surface of the brush as placed in the editor. Apositive value appears above the brush surface. A negative value appears below the brush surface. An example of thisis the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude. + +
<amplitude> The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude. + +
<phase> SeeWave Forms in the introduction for a description of phase) +
<frequency> See Wave Forms in the introduction for a description of frequency) + +

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.
+ +

3.3.4 +deformVertexes move<x> <y> <z> <func> +<base> <amplitude> <phase> <freq>
+ +This keyword is used to make a brush, curve patch or md3model appear to move together as a unit. The <x> <y> +and <z> values are the distance and direction in game units the object appears to move relative to it's point of origin in the map. + +

The <func> <base> <amplitude><phase> and <freq> values are the same as found in other wave +form manipulations. + +

The product of the function modifies the values x, y, and z.Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base. + +

It must be noted that an object made with this shader does not actually change position, it only appears to. + +

Design Note: If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.
+ +

3.3.5 +DeformVertexes autosprite
+ +This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a sprite without having to make it a separate entity. This means that the "sprite" on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must besquare. + +

Design Note :This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.
+ +

3.3.6 +DeformVertexes autosprite2
+ +Is a slightly modified "sprite" that only rotates around the middle of its longest axis. This allows you to make a +pillar of fire that you can walk around, or an energy beam stretched across the room. + +

3.4 fogparms <red +value> <green value> <bluevalue> <distance to +Opaque>

+ +

Note: you must also specify "surfaceparm fog" to cause q3map to identify the surfaces inside the volume. Fogparms only +describes how to render the fog on the surfaces. + +

<red value> <green value> <blue value> These are normalized values. A good computer art program should give you the RGB values for a color. To obtain the values that define fog color for Quake III Arena, divide the desired color's Red, Green and Blue values by 255 to obtain three normalized numbers within the 0.0 to 1.0 range. + +
<distance toopaque> This is the distance, in game units, until the fog becomes totally opaque, as measured from the point of view of the observer. By making the height of the fog brush shorter than the distance to opaque, the apparent density of the fog can be reduced (because it never reaches the depth at which full opacity occurs). + +

  • The fog volume can only have one surface visible (from outside the fog). +
  • Fog must be made of one brush. It cannot be made of adjacent brushes. +
  • Fog brushes must be axial. This means that only square or rectangular brushes may contain fog, and those must have their edges drawn along the axes of the map grid (all 90 degree angles). +
+ +

Design Notes: + +
  • If a water texture contains a fog parameter, it must be treated as if it were a fog texture when in use. +
  • If a room is to be filled completely with a fog volume,it can only be entered through one surface (and still have the fog function correctly). +
  • Additional shader passes may be placed on a fog brush, as with other brushes.
+ +

3.5 nopicmip

+This causes the texture to ignore user-set values for the r_picmip cvar command. The image will always be high +resolution. Example: Used to keep images and text in the heads up display from blurring when user optimizes the game graphics. + +

3.6 nomipmaps

+This implies nopicmip, but also prevents the generation of any lower resolution mipmaps for use by the 3d card. This will +cause the texture to alias when it gets smaller, but there are some cases where you would rather have this than a blurry image. Sometimes thin slivers of triangles force things to very low mipmap levels, which leave a few constant pixels on otherwise scrolling special effects. + +

3.7 polygonOffset

+Surfaces rendered with the polygonOffset keyword are rendered slightly off the polygon's surface. This is typically +used for wall markings and "decals." The distance between the offset and the polygon is fixed. It is not a variable in QuakeIII Arena. + +

3.8 portal

+Specifies that this texture is the surface for a portal or mirror. In the game map, a portal entity must be placed directly in front of the texture (within 64 game units). All this does is set "sortportal", so it isn't needed if you specify +that explicitly. + +

3.9 sort <value>

+Use this keyword to fine-tune the depth sorting of shaders as they are compared against other shaders in the game world. The +basic concept is that if there is a question or a problem with shaders drawing in the wrong order against each other, this allows the designer to create a hierarchy ofwhich shader draws in what order. + +

The default behavior is to put all blended shaders in sort "additive" and all other shaders in sort "opaque", so you only +need to specify this when you are trying to work around a sorting problem with multiple transparent surfaces in a scene. + +

The value here can be either a numerical value or one of the keywords in the following list (listed in order of ascending priority): + +

    portal (1): This surface is a portal, it draws over every other shader seen inside the portal, but before anything in the main view. + +
    Sky (2): Typically, the sky is the farthest surface in the game world. Drawing this after other opaque surfaces can be an optimization on some cards. This currently has the wrong value for this purpose, so it doesn't do much of anything. + +
    Opaque (3):This surface is opaque (rarely needed since this is the default with noblendfunc) + +
    Banner (6) :Transparent, but very close to walls. + +
    Underwater (8): Draw behind normal transparent surfaces. + +
    Additive (9): normal transparent surface (default for shaders with blendfuncs) +
    nearest (16):this shader should always sort closest to the viewer, e.g. muzzle flashes and blend blobs
+

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/quake3/Q3AShader_Manual/ch03/pg3_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch03/pg3_1.htm new file mode 100644 index 00000000..00a4ed66 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch03/pg3_1.htm @@ -0,0 +1,197 @@ + + +Quake III Arena Shader Manual: Specific Shader Keywords + + + +

Q3Radiant Shader Manual

+
+

4 Q3MAP Specific Shader Keywords

+These keywords change the physical nature of the textures and the brushes that are marked with them. Changing any of these values will require the map to be re-compiled. These are global and affect the entire shader. + +

4.1 tessSize <amount>

+For consistency's sake, this really should have been called q3map_tessSize. But it wasn't. The tessSize shader controls +the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only +applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. Abuse of this can create a huge number of triangles. This happens during q3map processing, so maps must be reprocessed for changes to take effect. + +

Design Note: It can also be used on tesselating surfaces to make sure that tesselations arelarge, and thus, less costly in terms of triangles created.
+ +

4.2 q3map_backshader <shadername>

+This allows a brush to use a different shader when you are inside it looking out. By way of example, this would allow a water brush (or other) surfaces to have a different sort order (see sort above) or appearance when seen from the inside. + +

4.3 q3map_globaltexture

+Use this shader in the global keyword commands whenever the tcMod scale function is used in one of the later render stages. Many problems with getting shader effects to work across multiple adjacent brushes are a result of the way q3map optimizes texture precision. This option resolves that, but at the expense of some precision of the textures when they are far away from the origin of the map. + +

4.4 q3map_sun <red> <green> <blue> <intensity> <degrees> <elevation>

+This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of q3map. + +

<red><green> <blue> Color is described by three normalized rgbvalues. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use. + +
<intensity> is the brightness of the generated light. A value of 100 is a fairly bright sun. The +intensity of the light falls off with angle but not distance. + +
<degrees> is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 +isnorth, 180 is west and 270 is south. + +
<elevation> is the distance, measured in degrees from the horizon (z value of zero in the map file). An +elevation of 0 is sunrise/sunset. An elevation of 90 is noon. + +

DESIGN NOTE: Sky shaders should probably still have aq3map_surfacelight value. The "sun" gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sunvalue and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. Insuch cases, the "sun" or "moon" will cast stronger, shadows that have a greater degree of contrast. + +

Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

+ +

4.5 q3map_surfaceLight <light value>

+ +The texture gives off light equal to the <light value> set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount +of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture. + +

4.6 q3map_lightimage <texturepath/texturename>

+The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the +q3map_lightimage. + +

The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows: + +

  1. q3map_lightimage ; (the texture providing the light and the color of the light) +
  2. qer_editorimage ; (the editor-only image used to select the source map for the texture) +
  3. the average color of the light emitted from the shader is calculated from the lightimage.)
+ +

The reason q3map_lightimageis specified for the light in the example below, is because the blend map is predominantly yellow, and the designer wanted more yellow light to be emitted from the light. + +

Example: Taking light from another source texture + +

+textures/eerie/ironcrosslt2_10000
+{
+q3map_lightimagetextures/gothic_light/ironcrosslt2.blend.tga
+// this TGA is the source for the color of the blended light
+
+qer_editorimagetextures/gothic_light/ironcrosslt2.tga
+//base TGA (used because the shader is used with several
+// different light values
+
+q3map_surfacelight 10000
+//emitted light value of10,000
+
+{
+map $lightmap
+//source texture is affected by the lightmap
+rgbGen identity
+// this command handles the overbright bits created by "sunlight"
+// in the game
+}
+{
+maptextures/gothic_light/ironcrosslt2.tga
+blendFunc filter
+rgbGen identity
+}
+{
+maptextures/gothic_light/ironcrosslt2.blend.tga
+blendFunc add
+}
+}
+
+ +

4.7 q3map_lightsubdivide <value>

+This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting. + +

4.8 surfaceparm <parm>

+ +

All surfaceparm keywords are preceded by the word surfaceparm as follows: surfaceparm fogor surfaceparm noimpact. + +

4.8.1 alphashadow
+This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map process to use the texture's alpha channel as a mask for casting static shadows in the game world. + +

Design Note: Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.
+ +

4.8.2 areaportal
+A brush marked with this keyword functions as an area portal, a break in the Q3MAP tree. It is typically placed on a very thin brush placed inside a door entity (but is not a part of that entity). The intent is to block the game from processing +surface triangles located behind it when the door is closed. It is also used by the BSPC (bot area file creation compiler) in the same manner as a clusterportal. The brush must touch all the structural brushes surrounding the +areaportal. + +

4.8.3 clusterportal
+A brush marked with this keyword function creates a subdivision of the area file (.aas) used by the bots for navigation. It +is typically placed in locations that are natural breaks in a map, such a sentrances to halls, doors, tunnels, etc. The intent is keep the bot from having to process the entire map at once. As with the the areaportal parameter, the affected brush must touch all the structural brushes surrounding the areaportal. + +

4.8.4 donotenter
+Read as "do not enter." Like clusterportal, this is a bot-only property. A brush marked with donotenter will not affect +non-bot players, but bots will not enter it. It should be used only when bots appear to have difficulty navigating around some map features. + +

4.8.5 flesh
+This will cue different sounds (in a similar manner to metalsteps) and cause blood to appear instead of bullet impact flashes. + +

4.8.6 fog
+Fog defines the brush as being a "fog" brush. This is a Q3MAP function that chops and identifies all geometry inside the +brush. The General shader keyword fogparms must also be specified to tell how to draw the fog. + +

4.8.7 lava
+ +

Assigns to the texture the game properties set for lava. This affects both the surface and the content of a brush. + +

4.8.8 metalsteps
+The player sounds as if he is walking on clanging metal steps or gratings. Other than specifiying flesh, metalsteps, nosteps, or default (i.e. specify nothing) it is currently not possible for a designer to create or assign a specific sound routine to a texture. Note: If no sound is set for a texture, then the default footsteps sound routines are heard. + +

4.8.9 nodamage
+The player takes no damage if he falls onto a texture with this surfaceparm + +

4.8.10 nodlight
+Read as "No DeeLight". A texture containing this parameter will not be affected or lit by dynamic lights, such as +weapon effects. And example in Quake III Arena would be solid lava. + +

4.8.11 nodraw
+A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin +brushes, and so on. + +

4.8.12 nodrop
+When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use isfor "Pits of Death." Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits. + +

4.8.13 noimpact
+World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks +will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave +marks. + +

4.8.14 nomarks
+Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. +This is useful to keep lights from being temporarily obscured by battle damage. + +

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.
+ +

4.8.15 nolightmap
+This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not +require the addition of an rgbGen identity keyword in that stage. + +

4.8.16 nosteps
+The player makes no sound when walking on this texture. + +

4.8.17 nonsolid
+This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to +triggers, hint brushes and similar brushes. This affects the content of a brush. + +

4.8.18 origin
+Used on the "origin" texture. Rotating entities need to contain an origin brush in their construction. The brush must be +rectangular (or square). The origin point is the exact center of the origin brush. + +

4.8.19 playerclip
+Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked +playerclip. The intended use for this is to block the player but not block projectiles like rockets. + +

4.8.20 slick
+This surfaceparm included in a texture should give it significantly reduced friction. + +

4.8.21 slime
+Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush. + +

4.8.22 structural
+This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used +as a part of the shader for the "hint" texture. Generally speaking, any opaque texture not marked as "detail" is, by +default, structural, so you shouldn't need to specify this. + +

4.8.23 trans
+Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs +should be marked as surfaceparm trans. + +

4.8.24 water
+Assigns to the texture the game properties for water. +

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/quake3/Q3AShader_Manual/ch04/pg4_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch04/pg4_1.htm new file mode 100644 index 00000000..d014d2e1 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch04/pg4_1.htm @@ -0,0 +1,64 @@ + + +Quake III Arena Shader Manual: Editor Specific Shader Instructions + + + +

Q3Radiant Shader Manual

+
+

5 Editor specific shader instructions

+These instructions only affect the texture when it is seen in the Q3Radiant editor. They should be grouped with the surface +parameters but ahead of them in sequence. + +

5.1 qer_editorimage <texture path/texturename>

+This keyword creates a shader name in memory, but in the editor, it displays the TGA art image specified in qer_editorimage (in the example below this is textures/eerie/lavahell.tga). + +

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit. Be sure to check this on bouncy, acceleration, and power-uppads placed on surfaces other than 256 x 256. Use tcMod scale to change the size of the stretched +texture. Rememberthat tcMod scale 0.5 0.5 will double your image, while tcMod scale 2 2will halve it. + +

Design Notes: The base_light and gothic_light shaders contain numerous uses of this. It can be very useful for making different light styles (mostly to change the light brightnesses) without having to create a new piece of TGA art for each new shader.
+ + +

textures/liquids/lavahell2//path and name of new texture
+{
+qer_editorimagetextures/eerie/lavahell.tga
+//based on this
+qer_nocarve
+//cannot be cut by CSG subtract
+surfaceparm noimpact
+//projectiles do not hitit
+surfaceparm lava
+//has the game properties of lava
+surfaceparm nolightmap
+//environment lighting does not affect
+q3map_surfacelight 3000
+//light is emitted
+tessSize 256
+//relatively large triangles
+cull disable
+//no sides are removed
+deformVertexes wave 100sin 5 5 .5 0.02
+fogparms 0.85191420.309723 0.0 128 128
+{
+maptextures/eerie/lavahell.tga
+//base texture artwork
+tcMod turb .25 0.2 1 0.02
+//texture is subjected to turbulence
+tcMod scroll 0.1 0.1
+//the turbulence is scrolled
+}
+}
+
+ +

5.2 qer_nocarve

+A brush marked with this instruction will not be affected by CSG subtract functions. It is especially useful for water and fog textures. + +

5.3 qer_trans <value>

+This parameter defines the percentage of transparency that a brush will have when seen in the editor (no effect on game +rendering a tall). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. +Example: qer_trans 0.2 means the brush is 20% opaque and nearly invisible. + +

Back | Home | Next + + + \ No newline at end of file diff --git a/docs/manual/quake3/Q3AShader_Manual/ch05/pg5_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch05/pg5_1.htm new file mode 100644 index 00000000..d3506d69 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch05/pg5_1.htm @@ -0,0 +1,483 @@ + + +Quake III Arena Shader Manual: Stage Specific Keywords + + + +

Q3Radiant Shader Manual

+
+

6 Stage Specific Keywords

+Stage specifications only affect rendering. Changing any keywords or values within a stage will usually take effect as soon +as a vid_restart is executed. Q3MAP ignores stage specific keywords entirely. + +

A stage can specify a texture map, a color function, an alpha function, a texture coordinate function, a blend function, and a few other rasterization options. + +

6.1 Texture map specification

+
6.1.1 map <texturepath/texturename>
+Specifies the source texture map (a 24 or 32-bit TGA file) used for this stage. The texture may or may not contain alpha +channel information. The special keywords $lightmap and $whiteimage may be substituted in lieu of an actual +texture map name. In those cases, the texture named in the first line of the shader becomes the texture that supplies the light mapping data for the process. + +

$lightmap
+This is the overall lightmap for the game world. It is calculated during the Q3MAP process. It is the initial color +data found in the framebuffer. Note: due to the use of overbright bits in light calculation, the keyword rgbGen +identity must accompany all $lightmap instructions. + +

$whiteimage
+This is used for specular lighting on MD3 models. This is a white image generated internally by the game. This image can +be used in lieu of $lightmap or an actual texture map if, for example, you wish for the vertex colors to come +through unaltered. + +

6.1.2 Clampmap <texturepath>
+Dictates that this stage should clamp texture coordinates instead of wrapping them. During a stretch function, the area, +which the texture must cover during a wave cycle, enlarges and decreases. Instead of repeating a texture multiple times +during enlargement (or seeing only a portion of the texture during shrinking) the texture dimensions increase or contract accordingly. This is only relevant when using something like deformTexCoordParms to stretch/compress texture coordinates for a specific special effect. Remember that the Quake III Arena engine normalizes all texture coordinates (regardless of actual texture size) into a scale of 0.0 to1.0. + +

Proper Alignment: When using clampTexCoords make sure the texture is properly aligned on the brush. The +clampTexCoords function keeps the image from tiling. However, the editor doesn't represent this properly and shows a tiled image. Therefore, what appears to be the correct position may be offset. This is very apparent onanything with a tcMod rotate and clampTexCoords function. + +

AvoidingDistortion: When seen at a given distance (which can vary, depending onhardware and the size of the texture), the compression phase of a stretchfunction will cause a "cross"-like visual artifact to form on the modified texture due to the way that textures are reduced. This occurs because the texture undergoing modification lacks sufficient "empty space" around the displayed (non-black) part of the texture (see figure 2a). To compensate for this, make the non-zero portion of the texture substantially smaller (50% of maximum stretched size -- see figure 2b)than the dimensions of the texture. Then, write a scaling function (tcScale) into the appropriate shader phase, to enlarge the image to the desired proportion. + +

The shaders for the bouncy pads (in the sfx.shader file) show the stretch function in use, including the scaling of the +stretched texture: + +

Example: UsingclampTexCoords to control a stretching texture + +

+textures/sfx/metalbridge06_bounce
+{
+	//q3map_surfacelight 2000
+	surfaceparm nodamage
+	q3map_lightimage textures/sfx/jumppadsmall.tga
+	q3map_surfacelight 400
+	{
+		map textures/sfx/metalbridge06_bounce.tga
+		rgbGen identity
+	}
+	{
+		map $lightmap
+		rgbGen identity
+		blendfunc gl_dst_color gl_zero
+	}
+	{
+		map textures/sfx/bouncepad01b_layer1.tga
+		blendfunc gl_one gl_one
+		rgbGen wave sin .5 .5 0 1.5
+	}
+	{
+		clampmap textures/sfx/jumppadsmall.tga
+		blendfunc gl_one gl_one
+		tcMod stretch sin 1.2 .8 0 1.5
+		rgbGen wave square .5 .5 .25 1.5
+	}
+	// END
+}
+
+ +

+ +

6.1.3 AnimMap <frequency> <texture1> … <texture8>
+The surfaces in the game can be animated by displaying asequence of 1 to 8 frames (separate texture maps). These animations +are affected by other keyword effects in the same and later shader stages. + +

<Frequency>: the number of times that the animation cycle will repeat within a one second time period. The +larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values. + +
<texture1> …<texture8>: the texture path/texture name for each animation frame must be +explicitly listed. Up to eight frames (eight separate .tga files) can be used to make an animated sequence. Each frame is +displayed for an equal subdivision of the frequency value. + +

Example: AnimMap 0.25 animMap 10textures/sfx/b_flame1.tga textures/sfx/b_flame2.tga textures/sfx/b_flame3.tgatextures/sfx/b_flame4.tga would be a 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds. Each frame would be displayed for 1 second before the next one is displayed. The cycle repeats after the last frame in sequence is shown. + +

Design Notes: To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.
+ +

textures/sfx/flameanim_blue
+{
+
+	//	*************************************************
+	//	*	Blue Flame				*
+	//	*	July 20, 1999 Surface Light 1800 	*
+	//	*	Please Comment Changes			*
+	//	*************************************************
+	qer_editorimage textures/sfx/b_flame7.tga
+	q3map_lightimage textures/sfx/b_flame7.tga
+	surfaceparm trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	q3map_surfacelight 1800
+	// texture changed to blue flame.... PAJ
+	{
+		animMap 10 textures/sfx/b_flame1.tgatextures/sfx/b_flame2.tga
+textures/sfx/b_flame3.tga textures/sfx/b_flame4.tgatextures/sfx/b_flame5.tga
+textures/sfx/b_flame6.tga textures/sfx/b_flame7.tgatextures/sfx/b_flame8.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen wave inverseSawtooth 0 1 0 10
+
+	}
+	{
+		animMap 10 textures/sfx/b_flame2.tgatextures/sfx/b_flame3.tga
+textures/sfx/b_flame4.tga textures/sfx/b_flame5.tgatextures/sfx/b_flame6.tga
+textures/sfx/b_flame7.tga textures/sfx/b_flame8.tgatextures/sfx/b_flame1.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen wave sawtooth 0 1 0 10
+	}
+	{
+		map textures/sfx/b_flameball.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen wave sin .6 .2 0 .6
+	}
+}
+
+ +

6.2 Blend Functions

+Blend functions are the keyword commands that tell the Quake III Arena graphic engine's renderer how graphic layers are to be mixed together. + +

6.2.1 Simplified blend functions:
+The most common blend functions are set up here as simple commands, and should be used unless you really know what you are +doing. + +

6.2.1.1 blendfunc add +
This is a shorthand command for blendfunc gl_one gl_one. Effects like fire and energy are additive. + +

6.2.1.2 blendfunc filter +
This is a shorthand command that can be substituted for either blendfunc gl_dst_color gl_zero or blendfunc gl_zero gl_src_color. A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. + +

6.2.1.3 blendfunc blend +
Shorthand for blendfunc gl_src_alphagl_one_minus_src_alpha. This is conventional transparency, where part of the background is mixed with part of the texture. + +

6.2.2 Explicit blend functions:
+Getting a handle on this concept is absolutely key to understanding all shader manipulation of graphics. + +

BlendFunc or "Blend Function" is the equation at the core of processing shader graphics. The formula reads as follows: + +

[Source *<srcBlend>] + [Destination * +<dstBlend>] + +

Source is usually the RGB color data in a texture TGA file (remember it's all numbers) modified by any rgbgen and alphagen. In the shader, the source is generally identified by command MAP, followed by the name of the image. + +

Destination is the color data currently existing in the frame buffer. + +

Rather than think of the entire texture as a whole, it maybe easier to think of the number values that correspond to a single pixel, because that is essentially what the computer is processing … one pixel of the bit map at a time. + +

The process for calculating the final look of a texture in place in the game world begins with the precalculated lightmap for the area where the texture will be located. This data is in the frame buffer. That is to say, it is the initial data in the Destination. In an unmanipulated texture (i.e. one without a special shader script), color information from the texture is combined with the lightmap. In a shader-modified texture, the $lightmap stage must be present for the lightmap to be included in the calculation of the final texture appearance. + +

Each pass or "stage" of blending is combined (in a cumulative manner) with the color data passed onto it by the +previous stage. How that data combines together depends on the values chosen for the Source Blends and Destination Blends at each stage. Remember it's numbers that are being mathematically combined together that are ultimately interpreted as colors. + +

A general rule is that any Source Blend other than GL_ONE (or GL_SRC_ALPHA where the alpha channel is entirely white) will cause the Source to become darker. + +

6.2.3 Source Blend <srcBlend>
+The following values are valid for the Source Blend part of the equation. + +

GL_ONE This is the value 1. When multiplied by the Source, the value stays the same the value of the color information does not change. + +
GL_ZERO This is the value 0. When multiplied by the Source, all RGB data in the Source becomes Zero (essentially black). + +
GL_DST_COLOR This is the value of color data currently in the Destination (frame buffer). The value of that information depends on the information supplied by previous stages. + +
GL_ONE_MINUS_DST_COLOR This is nearly the same as GL_DST_COLOR except that the value for each component color +is inverted by subtracting it from one. (,i.e. R = 1.0 - DST.R, G = 1.0 - DST.G, B = 1.0 - DST.B, etc.) + +
GL_SRC_ALPHA The TGA file being used for the Source data must have an alpha channel in addition to its RGB channels (for a total of four channels). The alpha channel is an 8-bit black and white only channel. An entirely white alpha channel will not darken the Source. + +
GL_ONE_MINUS_SRC_ALPHA This is the same as GL_SRC_ALPHA except that the value in the alpha channel is inverted by subtracting it from one.(i.e. A=1.0 - SRC.A) + +

6.2.4 Destination Blend <dstBlend>
+The following values are valid for the Destination Blend part of the equation. + +

GL_ONE This is the value 1. When multiplied by the Destination, the value stays the same the value of the color information does not change. + +
GL_ZERO This is the value 0. When multiplied by the Destination,all RGB data in the Destinationbecomes Zero (essentially black). + +
GL_SRC_COLOR This is the value of color data currently in the Source (which is the texture being manipulated here). + +
GL_ONE_MINUS_SRC_COLOR This is the value of color data currently in Source, but subtracted from one(i.e. +inverted). + +
GL_SRC_ALPHA The TGA file being used for the Source data must have an alpha channel in addition to its RGB channels (four a total of four channels). The alpha channel is an 8-bit black and white only channel. An entirely white alpha channel will not darken the Source. + +
GL_ONE_MINUS_SRC_ALPHA This is the same as GL_SRC_ALPHA except that the value in the alpha channel is inverted by subtracting it from one. (i.e. A=1.0 - SRC.A). + +

Doing the Math: The Final Result + +
The product of the Source side of the equation is added to the product of the Destination side of the equation. The sum is then placed into the frame buffer to become the Destination information for the next stage. Ultimately, the equation creates a modified color value that is used by other functions to define what happens in the texture when it is displayed in the game world. + +

6.2.5 Default Blend Function
+If no blendFunc is specified then no blending will take place. A warning is generated if any stage after the first stage does not have a blendFunc specified. + +

6.2.6 Technical Information/Limitations Regarding Blend Modes:
+The Riva 128 graphics card supports ONLY the following blendmodes: + +

GL_ONE, GL_ONE +
GL_DST_COLOR, GL_ZERO + +
GL_ZERO, GL_SRC_COLOR + +
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA + +
GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA + +

Cards running in 16 bit color cannot use any GL_DST_ALPHA blends. + +

6.3 rgbGen <func>

+There are two color sources for any given shader, the texture file and the vertex colors. Output at any given time will be equal to TEXTURE multiplied by VERTEXCOLOR. Most of the time VERTEXCOLORwill default to white (which is a normalized value of 1.0), so output will be TEXTURE (this usually lands in the Sourceside of the shader equation). Sometimes you do the opposite and use TEXTURE = WHITE, but this is only commonly used when doing specular lighting on entities (i.e. shaders that level designers will probably never create + +

The most common reason to use rgbGen is to pulsate something. This means that the VERTEXCOLOR will oscillate between two +values, and that value will be multiplied (darkening) the texture. + +

If no rgbGen is specified, either "identityLighting" or"identity" will be selected, depending on which blend modes are +used. + +

Valid <func> parameters are wave, identity, identityLighting, entity, oneMinusEntity, fromVertex, and +lightingDiffuse. + +

6.3.1 RgbGen identityLighting
+Colors will be (1.0,1.0,1.0) if running without overbright bits (NT, linux, windowed modes), or (0.5, 0.5, 0.5) if running +with overbright. Overbright allows a greater color range at the expense of a loss of precision. Additive and blended stages +will get this by default. + +

6.3.2 rgbGen identity
+Colors are assumed to be all white (1.0,1.0,1.0). All filters stages (lightmaps, etc) will get this by default. + +

6.3.3 rgbGen wave <func> <base> <amp><phase> <freq>
+Colors are generated using the specified waveform. An affected texture with become darker and lighter, but will not change +hue. Hue stays constant. Note that the rgb values for color will not go below 0 (black) orabove 1 (white). Valid waveforms are sin, triangle, square, sawtooth and inversesawtooth. + +

<func> Waveforms and their effects: + +
Sin: color flows smoothly through changes. + +
Triangle: color changes at a constant rate and spends noappreciable time at peaks and valleys. + +
Square: color alternates instantly between its peak and valley values. + +
Sawtooth: With a positive frequency value, the color changes at aconstant rate to the peak then instantly drops to its valley value. + +
Inversesawtooth: An inverse sawtooth wave will reverse this, making the ascent immediate (like a square wave) and the decay fall off like a triangle wave. + +
<base> Baseline value. The initial RGB formula of a color (normalilzed). + +
<amp> Amplitude. This is the degree of change from the baseline value. In some cases you will want +values outside the 0.0 to 1.0 range, but it will induce clamping (holding at the maximum or minimum value for a time period) +instead of continuous change. + +
<phase> See the explanation for phase under the waveforms heading of Key Concepts. + +
<freq> Frequency. This is a value (NOT normalized) that indicates peaks per second. + +

6.3.4 RgbGen entity
+Colors are grabbed from the entity's modulate field. This isused for things like explosions. + +

Design Note: This keyword would probably not be used by a level designer.
+ +

6.3.5 rgbGen oneMinusEntity
+Colors are grabbed from 1.0 minus the entity's modulate field. + +

Design Note: This keyword would probably not be used by a level designer.
+ +

6.3.6 rgbGen Vertex
+Colors are filled in directly by the data from the map or model files. + +

Design Note: rgbGen vertex should be used when you want the RGB values to be computed for a static model (i.e. mapobject) in the world using precomputed static lighting from Q3BSP. This would be used on things like +the gargoyles, the portal frame, skulls, and other decorative MD3s put into the Quake III Arena world.
+ +

6.3.7 rgbGen oneMinusVertex
+As rgbGen vertex, but inverted. + +

Design Note: This keyword would probably not be used by a level designer
+ +

6.3.8 rgbGen lightingDiffuse
+Colors are computed using a standard diffuse lighting equation. It uses the vertex normals to illuminate the object correctly. + +

Design Note: -rgbGen lightingDiffuse is used when you want the RGB values to be computed for a dynamic model (i.e. non-map object) in the world using regular in-game lighting. For example, you would specify on shaders for items, characters, weapons, etc.
+ +

6.4 AlphaGen <func>

+The alpha channel can be specified like the rgbchannels. If not specified, it defaults to 1.0. + +

6.4.1 AlphaGen portal
+This rendering stage keyword is used in conjunction with the surface parameter keyword portal. The function +accomplishes the "fade" that causes the scene in the portal to fade from view. Specifically, it means "Generate alpha values +based on the distance from the viewer to the portal." Use alphaGen portal on the last rendering pass. + +

6.5 tcGen <coordinate source>

+Specifies how texture coordinates are generated and where they come from. Valid functions are base,lightmap and environment. + +

<base> = base texture coordinates from the original art. +
<lightmap> = lightmap texture coordinates +
<environment> = Make this object environment mapped. + +

6.5.1 tcGen vector (<sx> <sy> <sz>) +(<tx><ty> <tz>)
+New texcoord generation by world projection. This allows you to project a texture onto a surface in a fixed way, regardless of its orientation. + +

S coordinates correspond to the "x" coordinates on the texture itself. + +
T coordinates correspond to the "y" coordinates on the texture itself. + +

The measurements are in game units. + +

+ +

Example: tcGen vector (0.01 0 0) (0 0.01 0) +
This would project a texture with a repeat every 100 units across the X/Y plane. + +

6.6 tcMod <func> <…>

+Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are rotate, +scale,scroll, stretch and transform. Transform is a function generally reserved for use by programmers who suggest that designers leave it alone. When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified. In otherwords, if you see: + +

tcMod scale 0.5 0.5 +
tcMod scroll 1 1 + +

Then the texture coordinates will be scaled then scrolled. + +

6.6.1 tcMod rotate <degrees per per second>
+This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example "tcMod rotate 5" would +rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center +point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired). + +

6.6.2 tcMod scale <sScale> <tScale>
+Resizes (enlarges or shrinks) the texture coordinates bymultiplying them against the given factors of <sScale> +and <tScale). The values "s" and "t"conform to the "x" and "y" values (respectively) as they are found in the original texture TGA. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of thetexture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture (Note: see clampTexCoords for ways to control this).; + +

Example: tcMod scale 0.5 2 would cause the texture to repeat twice along its width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original) + +

6.6.3 tcMod scroll <sSpeed> <tSpeed>
+Scrolls the texture coordinates with the given speeds. The values "s" and "t" conform to the "x" and "y" values +(respectively) as they are found in the original textureTGA. The scroll speed is measured in "textures" per second. A "texture" is the dimension of the texture being modified and includes any previous shader modifications to the original TGA). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down. + +

Example: tcMod scroll 0.5 -0.5 moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel. + +

This should be the LAST tcMod in a stage. Otherwise there maybe popping or snapping visual effects in some shaders. + +

6.6.4 tcMod stretch <func> <base> +<amplitude><phase> <frequency>
+ +Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. + +

<base>: A base value of one is the original dimension of the texture when it reaches the stretch stage. +Inserting other values positive or negative in this variable will produce unknown effects. + +
<amplitude>: This is the measurement of distance the texture will stretch from the base size. It is +measured, like scroll, in textures. A value of 1 here will double the size of the texture at its peak. + +
<phase>: See the explanation for phase under the deform vertexes keyword. + +
<frequency>: this is wave peaks per second. + +
Wave Functions <func> + +
Sin wave: the texture expands smoothly to its peak dimension and then shrinks smoothly to its valley dimension in a flowing manner. + +
Triangle wave: The textures stretch at a constant rate and spend no appreciable time at the peak or valley points. + +
Square wave: The texture is shown at its peak for the duration of the frequency and then at its valley for the +duration of the frequency. + +
Sawtooth: the texture stretches like a triangle wave until it reaches a peak, then instantly drops to the valley, as in a square wave. + +
Inversesawtooth: this is the reverse of the sawtooth wave. + +

6.6.5 tcMod <transform> <m00> <m01> <m10><m11> <t0> <t1>
+Transforms each texture coordinate as follows: + +

S' = s * m00 + t * m10 + t0 + +
T' = s * m01 + t * m11 + t1 + +

This is for use by programmers. + +

6.6.6 tcMod turb <base> <amplitude> +<phase><freq>
+ +

Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture. + +

The parameters for this shader are defined as follows: + + +

<base> Currently undefined. + +
<amplitude> This is essentially the intensity of the disturbance or twisting and squiggling of the texture. + +
<phase> See the explanation for phase under the deformvertexes keyword. + +
<freq> Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one +would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 +seconds. + +

6.7 depthFunc <func>

+This controls the depth comparison function used while rendering. The default is "lequal" (Less than or equal to) +where any surface that is at the same depth or closer of an existing surface is drawn. This is used for textures with +transparency or translucency. Under some circumstances you may wish to use "equal", e.g. for light-mapped grates that are alpha tested (it is also used for mirrors). + +

6.8 depthWrite

+By default, writes to the depth buffer when depthFunc passes will happen for opaque surfaces and not for translucent surfaces. Blended surfaces can have the depth writes forced with this function. + +

6.9 Detail

+This feature was not used in Quake III Arena maps, but should still function. +Designates this stage as a detail texture stage, which means that if the c_var, r_detailtextures, is set to 0 then this stage will be ignored (detail will not be displayed). This keyword, by itself, does not affect rendering at all. If you do put in a detail texture, it has to conform to very specific rules. Specifically, the blendFunc: + +

blendFuncGL_DST_COLOR GL_SRC_COLOR + +

This is also the simple blend function: blendfuncfilter + +

And the average intensity of the detail texture itself must be around 127. + +

Detail is used to blend fine pixel detail back into a base texture whose scale has been increased significantly. When detail iswritten into a set of stage instructions, it allows the stage to be disabled by the c_var console command setting "r_detailtextures 0". + +

A texture whose scale has been increased beyond a 1:1 ratio tends not to have very high frequency content. In other words, one texel can cover a lot of real estate. Frequency is also known as "detail." Lack of detail can appear acceptable if the player never has the opportunity to see the texture at close range. But seen close up, such textures look glaringly wrong within the sharp detail of the Quake III Arena environment. A detail texture solves this problem by taking a noisy "detail" pattern (a tiling texture that appears to have a great deal of surface roughness) and applying it to the base texture at a very densely packed scale (that is, reduced from its normal size). This is done programmatically in the +shader, and does not require modification of the base texture. Note that if the detail texture is the same size and scale as the base texture that you may as well just add the detail directly to the base texture. The theory is that the detail texture's scale will be so high compared to the base texture (e.g.; 9 detail texels fitting into 1 base texel) that it is literally impossible to fit that detail into the base texture directly. + +

For this to work, the rules are as follows: + +

    + +
  1. the lightmap must be rendered first. This is because the subsequent detail texture will be modifying the lightmap in the framebuffer directly; +
  2. the detail texture must be rendered next since it modifies the lightmap in the framebuffer; +
  3. the base texture must be rendered last; +
  4. the detail texture MUST have a mean intensity around 127-129. If it does not then it will modify the displayed texture's perceived brightness in the world; +
  5. the detail shader stage MUSThave the "detail" keyword or it will not be disabled if the user uses the "r_detailtextures 0" setting; +
  6. the detail stage MUST use "blendFunc GL_DST_COLOR GL_SRC_COLOR". Any other BlendFunc will cause mismatches in brightness between detail and non-detail views.; +
  7. the detail stage should scale its textures by some amount (usually between 3 and 12) using "tcMod" to control density. This roughly corresponds to coarseness. A very large number, such as 12, will give very fine detail, however that detail will disappear VERY quickly as the viewer moves away fromthe wall since it will be MIP mapped away. A very small number, e.g. 3, gives diminishing returns since not enough is brought in when the user gets very close. I'm currently using values between 6 and 9.5. You should use non-integral numbers as much as possible to avoid seeing repeating patterns. +
  8. detail textures add one pass of overdraw, so there is a definite performance hit . +
  9. detail textures can be shared, so designers may wish to define only a very small handful of detail textures for common surfaces such as rocks, etc.
+ +

An example (non-existent) detailshader is as follows: +

Example: Texture with Detail + +

+textures/bwhtest/foo
+{
+// draw the lightmap first
+{
+map $lightmap
+rgbGen identity
+}
+// modify the lightmap in the framebuffer by
+// a highly compressed detail texture
+{
+map textures/details/detail01.tga
+blendFunc GL_DST_COLOR GL_SRC_COLOR
+// YOU MUST USE THIS!!
+detail
+// for the detail to be disabled, this must be present
+tcMod scale 9.1 9.2
+}
+// now slap on the base texture
+{
+map textures/castle/blocks11b.tga
+blendFunc filter
+}
+}
+
+ +

6.10 alphaFunc <func>

+Determines the alpha test function used when rendering this map. Valid values are GT0, LT128, and GE128. These +correspond to "GREATER THAN 0", "LESS THAN 128", and "GREATER THAN OR EQUAL TO 128". This function is used when determining if a pixel should be written to the framebuffer. For example, if GT0 is specified, the only the portions of the texture map with corresponding alpha values greater than zero will be written to the framebuffer. By default alpha testing is disabled. + +

Both alpha testing and normal alpha blending can be used to get textures that have see-through parts. The difference is that alphaFunc is an all-or-nothing test, while blending smoothly blends between opaque and translucent at pixel edges. Alpha test can also be used with depthwrite, allowing other effects to be conditionally layered on top of just the opaque pixels by setting depthFunc to equal. + +

Back | Home | Next + + + diff --git a/docs/manual/quake3/Q3AShader_Manual/ch06/pg6_1.htm b/docs/manual/quake3/Q3AShader_Manual/ch06/pg6_1.htm new file mode 100644 index 00000000..c5a6b87d --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/ch06/pg6_1.htm @@ -0,0 +1,145 @@ + + +Quake III Arena Shader Manual: Notes on Alpha Channels + + + +

Q3Radiant Shader Manual

+
+

7 Notes on Alpha Channels

+To use some blend modes of alphaFunc, you must add an alpha channel to your texture files. Photoshop can do this. +Paintshop Pro has the ability to make an alpha channel but cannot work directly in to it. In Photoshop you want to set the type to Mask. Black has a value of 255. White has a value of 0. The darkness of a pixel's alpha value determines the +transparency of the corresponding RGB value in the game world. Darker = more transparent. + +

Care must be taken when reworking textures with alpha channels. Textures without alpha channels are saved as 24 bit images while textures with alpha channels are saved as 32 bit. If you save them out as 24 bit, the alpha channel is erased. Note: Adobe Photoshop will prompt you to save as 32, 24 or 16 bit. Choose wisely. If you save a texture as 32 bit and you don't actually have anything in the alpha channel, Quake III Arena may still be forced to use a lower quality texture format (when in 16 bit rendering) than if you had saved it as 24 bit. + +

To create a texture that has "open" areas, make those areas black in the alpha channel and make white the areas that are to be opaque. Using gray shades can create varying degrees of opacity/transparency. + +

Example: An opaque texture with see-through holes knocked in it. + +

+textures/base_floor/pjgrate1
+{
+	surfaceparm metalsteps
+	cull none
+
+	// A GRATE OR GRILL THAT CAN BE SEEN FROM BOTH SIDES
+	{
+		map textures/base_floor/pjgrate1.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GT0
+		depthWrite
+		rgbGen identity
+	}
+	{
+		map $lightmap
+		rgbGen identity
+		blendFunc GL_DST_COLOR GL_ZERO
+		depthFunc equal
+	}
+	}
+
+ +

The alpha channel can also be used to merge a texture (including one that contains black) into another image so that the merged art appears to be and opaque decal on a solid surface (unaffected by the surface it appears to sit on), without actually using an alpha function. The following is a very simple example: + +

+ +
Figure 1 + +

Start with a TGA file image. In this case, a pentagram on a plain white field (figure 1A). The color of the field surrrounding the image to be merged is not relevant to this process (although having a hard-edged break between the image to be isolated and the field makes the mask making process easier). Make an alpha channel. The area of the image to be merged with another image is masked off in white. The area to be masked out (notused) is pure black (figure 1B). The image to be merged into is greenfloor.tga (figure 1C). + +

Make a qer_editorimage of greenfloor.tga. This is placed inthe frame buffer as the map image for the texture. By +using GL_SRC_ALPHA as the source part of the blend equation, the shader adds in only the non-black parts of the pentagram. +Using GL_MINUS_ONE_SRC_ALPHA, the shader inverts the pentagram's alpha channel and adds in only the non-black parts of the green floor. + +

In a like manner, the alpha channel can be used to blend the textures more evenly. A simple experiment involves using a +linear gradiant in the alpha channel (white to black) and merging two textures so they appear to cross fade into each other. + +

A more complicated experiment would be to take the pentagram in the first example and give it an aliased edge so that the pentagram appeared to fade or blend into the floor. + +

8 Troubleshooting Shaders

+If a shader is not working, look first for syntax errors. +
  • Are the brackets correctly set? +
  • Do you have too many parameter values on a line? +
  • Are you using a word in a parameter that wants a numerical value? +
  • Are you using a numerical value in a parameter that wants a word? +
  • Are the path names to your textures correct? +
  • Are your texture names correct? There is a chance that the texture name is too long or too complex. Try renaming a +texture with a shorter, simpler name.
+ +

9 Creating New Textures

+If you are familiar with the required tools, creating new assets for use in Quake III Arena is not particularly difficult. As a general rule, you should create new directories for each map with names different from the names used by id. If you are making a map that will be called "H4x0r_D00M", every directory containing new assets for that map should be titled H4x0r_D00M. This is to try and avoid asset directories overwriting each other as the editor and the gameload in assets. + +

9.1 Tools Needed

+Any combination of graphic programs and plug-ins that canout put a 24 bit MS windows compatible Targa (.tga) or JPEG (.jpg) graphic file.If you plan to make textures that will have an alpha channel component (a 4th 8-bit greyscale channel that is used by the shaders to further manipulate the art), you must have a program that can create 32-bit art with that fourth channel. + +

Adobe Photoshop has the ability to easily create alpha channels. PaintShop Pro from JASC (v5.0+) can also make an +alpha channel by creating a mask and naming it "alpha". + +

Generally speaking, regardless of the program used, we found it best to do most of the art manipulation of the alpha channel in a separate layer or file and then paste it into the alpha channel before saving. + +

9.2 Setting up Files

+The editor and the game program look for assets to be located along the paths set up in your project file. Start by creating +a directory for you new textures by creating file folders to make a directory path as follows: + +

quake3\baseq3\textures\[mymapname]
+ +

The installation of Q3Radiant will create a text document called "shaderlist.txt" in the following path: + +

quake3\baseq3\scripts\shaderlist.txt
+ +

Q3Radiant will use the contents of this script to grab your new textures for inclusion in the game. The contents of shaderlist.txt document will contain a listing of all the shader documents that were used by id Software to create Quake III Arena. + +

Since you will obviously want to create your own shaders, you need to put them in separate folders and create a new shader script for them. + +

If you plan to work on several maps at once and want to distinguish between textures used in each map, simply add additional map names here. For map and mod makers, we STRONGLY recommend that any new shader scripts created use the name of the map or mod in the shader file name. We know we can't avoid every incident of files overwriting each other, but we certainly can advise you how to try. + +

Now, in the scripts directory that you just created, create another text file and call it: + +

[mymapname].shader
+ +

This file will contain the shader scripts you write to modify a particular texture. + +

9.3 Rules and Guidelines

+
9.3.1 Rules
+Follow these rules when creating textures for the Quake III Arena engine: + +
  • Save your textures into your new [map name] directories. +
  • Don't use the same names that id used for textures. It will cause problems. +
  • For best quality, save textures without an alpha channel as 24 bit TARGA files. Using JPEG files can save memory space, but at the risk of losing detail and depth in the texture. JPEG files cannot be used for textures requiring an alpha channel. +
  • Textures containing an alpha channel must be saved as32 bit TARGA files. +
  • If a new texture requires no further manipulation, it does not need a shader script. +
  • Size textures in powers of 2. Example: 8x8, 16x16,32x32, 64x64 pixels and so on. +
  • Textures don't need to be square. A 32x256 pixel texture is perfectly acceptable.
+ +

9.3.2 Guidelines
+The following are some things the id designers learned about textures. + +
  • Create textures in "suites" built around one or two large textures with a number of much smaller supporting detail or accent textures. +
  • Very large textures are possible, but some video cards compress textures larger than 256x256 pixels. +
  • Textures are grouped alphabetically by name in the texture display window, so you may want to give suites of textures +similar names. +
  • Use the shader function qe3_editorimage to conserve memory when making multiple versions of a single texture (as in the case of a glowing texture with several light values). +
  • Unless you are creating special effects or textures designed to draw the player's eye to a specific spot, muted, middle value colors work best with the game engine. +
  • Extremely busy (a lot of fussy detail) textures can break up or form visually unpleasant patterns when seen at distances.
+ +

9.4 Making the .pk3 File>

+When you go to distribute your creation to the gaming world, you need to put your newly created map, textures, bot area files, and shader documents into an archive format called a "pk3" file. You do not need to include the shaderlist.txt file, since that is only used by the editor. You will need to keep the paths to the various assets the same. So your paths should be something like this: + +

Textures: baseq3/textures/[mymapnamefolder] +
Bsp & aas: baseq3/maps/mymapname.bsp, mymapname.aas +
Shader scripts: baseq3/scripts/mymapname.shader + +

You need to use an archiving program call Winzip to make the pk3 file. Get Winzip from http://www.winzip.com/winzip/winzip.htm + +
Make a zip archive called mymapname.zip + +
Zip all the required assets into a zip archive file (Quake III Arena DOES support compressed pk3 files). + +
Rename the zip archive to mymapname.pk3 + +
Put it where the Quake III Arena community can find it. +

Back | Home | Next + + \ No newline at end of file diff --git a/docs/manual/quake3/Q3AShader_Manual/index.htm b/docs/manual/quake3/Q3AShader_Manual/index.htm new file mode 100644 index 00000000..5e80b29a --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/index.htm @@ -0,0 +1,76 @@ + + +Quake III Arena Shader Manual: Table of Contents + + + +

+

Q3Radiant Shader Manual

+ +

Revision #12

+ +

By Paul Jaquays and Brian Hook + +

(with additional material by John Carmack, Christian Antkow, Kevin Cloud, & Adrian Carmack) +

QERadiant.com thanks John Hutton for re-formating this manual into a more web friendly version

+
+

Table of Contents

+1 Preface: Making Your Own Shaders +
2 Introduction + + +3 General Shader Keywords + + +4 Q3MAP Specific Shader Keywords + + +5 Editor specific shader instructions + + +6 Stage Specific Keywords + + +7 Notes on Alpha Channels +
8 Troubleshooting Shaders +
9 Creating New Textures + +
Appendix A: targetShaderName and targetNewShaderName + + diff --git a/docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg b/docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg new file mode 100644 index 00000000..9cc0ffc7 Binary files /dev/null and b/docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg differ diff --git a/docs/manual/quake3/Q3AShader_Manual/styles/q3rad.css b/docs/manual/quake3/Q3AShader_Manual/styles/q3rad.css new file mode 100644 index 00000000..b4daab91 --- /dev/null +++ b/docs/manual/quake3/Q3AShader_Manual/styles/q3rad.css @@ -0,0 +1,23 @@ +body { font: 12pt "Times New Roman"; + margin-left: 5mm; + margin-right: 5mm; + text-align: justify; + background: #ffffff; + color: #000000 } +h1 { font: bold 24pt Arial, Helvetica } +h2 { font: bold italic 18pt Arial, Helvetica } +.subheading { font: bold 16pt Arial, Helvetica } +:link {color: blue; + text-decoration: none; } +:visited {color: purple; + text-decoration: none; } +h6 { font: 10pt "Times New Roman" } +.MsoToc2 { font: bold small-caps 12pt "Times New Roman" } +.MsoTitle { text-align:center; + font: bold 24pt "BankGothic Md BT"; + letter-spacing:2.5pt } +.heading { font: italic 10pt "Times New Roman" } +.subcontents { font: 10pt "Times New Roman" } +.tip { font: 10pt "Comic Sans MS" } +.type { font: 10pt "Courier New" } +.menu { font: 10pt Arial, Helvetica } \ No newline at end of file diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html new file mode 100644 index 00000000..0d72ce1f --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html @@ -0,0 +1,113 @@ + + + + + + +Design Tips and Suggestions + + + + + +

Design Tips and Suggestions

+
+
+ + + + +
  +
+
+

· The skull + generator in Harvester tosses skulls about it to a maximum distance + of 96 units. The id map designers usually allowed for a drop radius + of 104 to 128 units as a minimum. As a rule, the generator should + drop skulls only in a places accessible to the players. Skulls + should not drop out into death fog or the void.

+

· Where you place + the persistent team power-ups is really more a matter of personal + style than a fixed requirement. Generally speaking, we found having + all or most of them in easy view of the initial start positions was + a good thing. In some cases, we found that placing the scout in a + contested area made for interesting game challenges.

+

· It is not + necessary to put every team power-up on every map. If a team + power-up would be overpowering on a map, leave it out. If you study + the id team maps, you’ll note that not every map has every power + up. In a small map, the scout can be unreasonable. In a map where + the base is easily attacked and overwhelmed, the guard can unbalance + things. In a map where the base is easily defended by snipers, the + doubler is powerful.

+

· For One Flag CTF, + the flag should be placed in an area that is roughly equidistant + from both bases and can be easily reached by players from either + team.

+

· The same (as + above) is true for Harvester.

+

· You don’t have + to place the white flag and the Harvester skull generator in the + same place in the map.

+

· Don’t feel + obligated to put the CTF flag bases, the skull receptacles, and the + Overload skull obelisk in the exact same location in the bases. Just + remember to mark gametypes correctly.

+

· Don’t include a + kamikaze in a map where players are unlikely to ever see the full + effect of the explosion.

+

· The personal + teleporter entity takes the player to a deathmatch spawn. That’s + how we restricted where the player teleported to in some maps.

+

· When converting + Q3A CTF maps with small base areas around their flags will probably + need to have their bases enlarged to accommodate the Overload skull + obelisk.

+

· OVERLOAD: When + designing the base for the placement of the skull obelisk, don’t + make it easy for attackers to shoot the obelisk from protected + locations.

+

· FLOOR ARROWS: The + graphic arrows were added to map floors to help the players find + their ways through potentially confusing arenas and to give the + player a sense of how close to the flag room he or she might be. The + rule of thumb was that the greater the distance to the flag, the + more stripes or bars would follow the arrow. Exact style of arrow + use varied from mapper to mapper. Study the individual maps to + determine which works best for your own map. The floor arrows act + like decals (if you ever built plastic model kits, these are the + little graphic things that you soaked in water and then stuck on the + surfaces of the model). The images will appear to be a part of the + surface upon which they rest. For the arrows, you will want to build + them as nodraw brushes of the proper dimension with a surface raised + about 2 units above the floor or wall. For the arrow, use + missionpack/proto2/bluea_dcl for the blue arrows and missionpack/proto2/reda_dcl + for the red. You may have to scale and rotate the texture to get + what you want. For more than three trailing bars, add additional + decals and arrange to suit.

+
+
+
+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ + Map Converter's Checklist
+
+ -9-

+
+
+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html new file mode 100644 index 00000000..03ed5879 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html @@ -0,0 +1,101 @@ + + + + + + +Design Tips and Suggestions + + + + + +

Map Converter’s Checklist

+
+
+ + + + +
  +

The following is a list of things to look for, do, or + be aware of when converting a pre-existing CTF map to Q3:TA game types.

+
+
+

· New file name. Don’t + overwrite your old CTF map.

+

· If you want to + convert an existing Q3A CTF map to the team arena game types, it + would be good to make a clean break from Q3A. Give it a new file + name and even a new map name. We did the same for our original CTF + maps.

+

· If you don’t + already have one, build a central “neutral” area in keeping with + the style of the rest of the map. This is an important play area, + perhaps even more so than the bases. Make the opportunities for + gameplay here just as exciting as the flag bases.

+

· Fix-up Time. This is + your opportunity to fix all those things that players have been + telling you are wrong with your map (sticky spots, bad hallway + connections, misaligned textures, poor item placement). The id guys + did it, so can you. It’s also a good time to read or re-read the + Q3Radiant section on optimizing maps for bots (you may want to look + for the recent updates that accompany the bspc tool). Pay particular + attention to placement of clip brushes and cluster portals. If + players can’t reach an area of the map (such as sky above ceiling + grills, or beyond window bars, fill the unreachable space with clip + brush - just walling it off is often worse than doing nothing.

+

· Add Team Power-ups + in or near bases.

+

· Place .md3 powerup + pad bases beneath Power-ups

+

· Remove “ow” + marks from floors that were used as weapon locators. Replace them + with the base floor for that texture. You may also be able to + simplify the geometry.

+

· Place Weapon pad + markers (use the pfbs) beneath weapon spawns.

+

· Consider adding new + weapon types or replacing existing ones with the new weapons. Don’t + just do it because they are new, though. Make sure the weapon is + appropriate to the map. If you don’t like a weapon or it’s + effect on play, don’t add it to your map.

+

· Replace old Q3A CTF + banners with new Q3: TA banners. Use the banner prefabs (pfbs) for + ease of placement.

+

· Consider adding team + logos as decals (see FLOOR ARROWS above) to other parts of the map, + like walls and floors.

+

· Make sure that the + team logos on banners and floors; walls, etc. have the proper + facing. You should be able to properly read the word “red” or + “blue” on the placeholder logo.

+

· Add in the flag + bases and obelisks. Follow directions noted above (page 9) to mark them for + gameplay types.

+
+
+
+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ + Related Links
+
+ -10-

+
+
+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html new file mode 100644 index 00000000..cae26324 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html @@ -0,0 +1,40 @@ + + + + + + +If you are already familiar with the tools and processes for making your +own + + + + +

 

+

 

+

If you are already familiar with the tools +and processes for making your own

+

Quake III Arena game maps, then this +document and the other files in this directory

+

are what you need to create Quake III: Team +Arena maps. If you have previously

+

created team play style maps (for Capture +the Flag or other game “mods”),

+

it will not be difficult to add the new game +entities and models.

+

If you think you might be interested in +making game maps, consider

+

stopping by the Level Editing forum at Quake3World

+

registering as a forum user and asking what +you need to do to

+

get started. From the Quake3World home page, +click

+

on the “Community” button, and then

+

select the “Level Editing” button.

+

 

+

Back - Table of Contents

+

-2-

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html new file mode 100644 index 00000000..44c6ec1e --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html @@ -0,0 +1,51 @@ + + + + + + +Related Links + + + + + +

Related Links

+
+ +
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ -11-

+
+
+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html new file mode 100644 index 00000000..89a7d629 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html @@ -0,0 +1,199 @@ + + + + + + +Design for all Team Arena Game Types + + + + + +

Design for All Team Arena Game Types

+
+
+ + + + +
      We + encourage designers to make their maps compatible with all “team” + style games. Team DM and Tournament are the exceptions here. Experience + shows that balanced CTF style maps do not make great (or even good) Team + DM maps. To do this, you will need to mark some of the team game + entities for multiple game types. An example is the obelisk used in + Overload. The entity is also used to mark the location of the + skull-receiving base in Harvester. If your Overload obelisk and your + Harvester base are to be in the same location give the entity a + key/value of “gametype/obelisk, harvester”. If you choose to place + the entities in different locations in each game type, you will need to + place separate entities and mark them appropriately. +

 

+
+

Placing Common Entities for all Game types

+
+

     Typically, the player + start, respawn, power-ups, ammo and weapon placement are the same for + each game type. It helps players if they don’t have to remember a lot + of placement locations from game to game. But this doesn’t have to be + the case. Use the gametype key to control placement if you want them + different between game types.

+

      Place + team_CTF_blueplayer entities in the locations where you want blue team + members to join the game and team_CTF_redplayer entities in the + locations where you want red team members to join the game. You should + place enough of these to accommodate the maximum number of players that + will be on a side (though usually no more than 8 to a side in a “normal” + map and as many as 32 in an extremely large terrain map). If you place + too few, teammates are likely to telefrag each other as they join the + game.

+

      Place + team_CTF_bluespawn entities in the locations where you want blue team + members to respawn when they die in the game. Place team_CTF_redspawn + entities in the locations where you want red team members to respawn + when they die in the game. You should place enough of these to + accommodate the maximum number of players that will be on a side (though + usually no more than 8 to a side).

+

      Place the four + persistent power-ups (guard, doubler, scout, and ammo_regen) in or near + the bases of each team. On the blue side, check the BLUETEAM spawn flag + box for each entity. On the red side, check the REDTEAM spawn flag box + for each entity. Place (and center) the appropriate spawn spot model + beneath each power-up (spawn.md3 on the blue side, spawn_red.md3 on the + red side).

+ +

 

+
+

Placing Game-type Specific Entities

+
+

      Each of the four + team-style game types has a set of associated entities that go with it, + whether it’s the flags and bases in Capture the Flag, or the obelisk + in Overload.

+ +

Capture the Flag (required entities)

+
+

      This corresponds + to the cvar: “/g_gametype 4” when entered in the console.

+

      Entities in this game + must have a value/key setting of “gametype/ctf”

+

      Place a + team_CTF_blueflag in the blue base.

+

      Place a + team_CTF_redflag in the red base.

+

      Place a + team_blueobelisk in the blue base where the goal should be. Give it a + facing angle. This forms the flag base. Do not mark any gametype.

+

      Place a team_redobelisk + in the red base where the goal should be. Give it a facing angle. This + forms the flag base. Do not mark any gametype.

+ +

 

+ +

One Flag CTF (required entities)

+
+

      This corresponds + to the cvar: “/g_gametype 5” when entered in the console.

+

      Entities in this game + must have a value/key setting of “gametype/oneflag”

+

      Place a + team_CTF_blueflag in the blue base.

+

      Place a + team_CTF_redflag in the red base.

+

      Place a + team_blueobelisk in the blue base where the goal should be. Give it a + facing angle. This forms the flag base. Do not mark any gametype.

+

      Place a team_redobelisk + in the red base where the goal should be. Give it a facing angle. This + forms the flag base. Do not mark any gametype.

+

      Place a + team_neutralflag some place in the neutral area of the map, preferably + equidistant from both bases.

+ +

 

+ +

Overload (required entities)

+
+

     This corresponds to + the cvar: “/g_gametype 6” when entered in the console.

+

      Entities in this game + must have a value/key setting of “gametype/obelisk”

+

      Place a + team_blueobelisk in the blue base where the goal should be. Give it a + facing angle. Do not mark any gametype.

+

      Place a team_redobelisk + in the red base where the goal should be. Give it a facing angle. Do not + mark any gametype.

+ +

 

+ +

Harvester (required entities)

+
+

      This corresponds + to the cvar: “/g_gametype 7” when entered in the console.

+

      Entities in this game + must have a value/key setting of “gametype/harvester”

+

      Place a + team_blueobelisk in the blue base. Do not mark any gametype.

+

      Place a team_redobelisk + in the red base. Do not mark any gametype.

+

      Place a + team_neutralobelisk some place in the neutral area of the map, + preferably equidistant from both bases.

+ +

 

+ +

Using Entities for All Gametypes

+
+

      This assumes + that the designer will use the same entities, in the same locations for + all gametypes. Mark the gametypes on each entity as noted:

+

      Place a + team_CTF_blueflag in the blue base.

+

      Gametype: ctf, oneflag

+

      Place a + team_CTF_redflag in the red base.

+

      Gametype: ctf, oneflag

+

      Place a + team_blueobelisk in the blue base where the goal should be. Give it a + facing angle. This forms the flag base.

+

      Gametype: Do not mark + any gametype.

+

      Place a team_redobelisk + in the red base where the goal should be. Give it a facing angle. This + forms the flag base.

+

      Gametype: Do not mark + any gametype.

+

      Place a + team_neutralobelisk some place in the neutral area of the map, + preferably equidistant from both bases.

+

      Gametype: harvester

+

      Place a + team_neutralflag some place in the neutral area of the map, preferably + equidistant from both bases.

+

      Gametype: oneflag

+

 

+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ + Design Tips
+
+ -8-

+
+
+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/table_of_contents.htm b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/table_of_contents.htm new file mode 100644 index 00000000..536bfc7a --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/table_of_contents.htm @@ -0,0 +1,77 @@ + + + + + + + +Table of Contents + + + + +

Table of Contents
+
(HTML Conversion by AstroCreep)

+
+ + + + + +
+

Title..........................1
+
+ +Preface..........................2
+
+ +Table of Contents..........................3
+
+ +Team Arena Entity Definitions..........................4
+
+ +Team Arena Prefabs..........................5
+
+ +Team Power-Up Bases..........................6
+
+ +Using the New Game Entities..........................7
+
+ +Design for All Team Arena Game Types...........................8
+
+ +Design Tips and Suggestions...........................9
+
+ +Map Converter’s Checklist.........................10
+
+Related Links.........................11
+

+
+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ + T A Entity Definitions
+
+ -3-

+
+
+

 

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html new file mode 100644 index 00000000..23682fa3 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html @@ -0,0 +1,66 @@ + + + + + + +Team Arena Entity Definitions + + + + + +

Team Arena Entity +Definitions

+
+ + + + +
The enclosed tadef_ptch.def + file a bare bones list of entity descriptions for use in the Q3Radiant + editor. You can paste it onto the end of your current def file (or better + yet, into a copy of that file). +

This is the Quake III: Team Arena entities definition + file patch (note that it is not the entire definition file). The Q3Radiant + editing tool uses this data to place game entities (ammo, weapons, + power-ups, etc.) in the game map and the game. It contains the definitions + for all the power-ups, game-specific items (like the Obelisks from + Harvester and Overload). To use these definitions, open the text file and + copy it. Now open the definitions file that you are currently using + (probably in Baseq3/Scripts) and paste the contents of your clipboard at + the end of the file. Now save this modified document as “teamarena.def” + in a folder in your Quake III Arena folder called Missionpack/scripts. + Open the Q3Radiant editor. Click on the File menu, and then select the “Project + Settings” entry. This brings up the Project Settings pop-up window. + Change the entitypath field so the pathname leads to the new definitions + file.

+

Example: If the field currently reads c:/quake3 or + g:/quake3/missionpack/scripts/*.def, change it to + c:/quake3/baseq3/scripts/teamarena.def

+ +

 

+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ +  Team Arena Prefabs
+
+ -4-

+
+
+

 

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html new file mode 100644 index 00000000..8aa53d50 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html @@ -0,0 +1,96 @@ + + + + + + +Team Arena Entity Definitions + + + + + +

Team Arena Prefabs

+
+ + + + +
There are eight prefabricated brush groups + in this folder. They are pre-built game components (using brushes and/or + curve patches) for some of the objects frequently used in Quake III: + Team Arena. The shader scripts and textures for these prefabs are + already a part of the Team Arena Mission Pack pak file and need not be + added separately. +

      The pads act like + decals (if you ever built plastic model kits, these are the little + graphic things that you soaked in water and then stuck on the surfaces + of the model). The images will appear to be a part of the surface upon + which they rest. For the pads, you will want to place them in such a way + that they are centered under the entity boxes above them. The surface of + the pad should be one to two units above the surface beneath them.

+

When positioning the banners, the banner brush should + not touch the surface behind it.

+ +

     armorpad_blue.pfb + Place this prefab beneath yellow and/or red armor on the blue team’s + side.

+ +

     armorpad_red.pfb Place + this prefab beneath yellow and/or red armor on the red team’s side

+ +

     armorpad_neutral.pfb + Place this prefab beneath yellow and/or red armor in neutral areas.

+ +

     weaponpad_blue.pfb + Place this prefab beneath weapons and (non persistent) power-ups on the + blue team’s side.

+ +

     weaponpad_red.pfb + Place this prefab beneath weapons and (non-persistent) power-ups on the + red team’s side.

+ +

     weaponpad_neutral.pfb + Place this prefab beneath weapons and (non-persistent) power-ups in the + map’s neutral areas (in between bases).

+ +

TA_banner_blue.pfb This + prefab is a smallish blue team flag with the placeholder blue team logo + placed over the flag surface as a decal. During game play, this logo + will change to show the logo selected by the blue team. Designers may + wish to scale the size or proportions of this banner to suit their + needs. Always make sure that the word “blue” on the logo reads + correctly. Otherwise, non-symmetrical team logos will appear backwards + on the banner.

+ +

TA_banner_red.pfb This + prefab is a red team flag with the placeholder red team logo placed over + the flag surface as a decal. During game play, this logo will change to + show the logo selected by the red team. Designers may wish to scale the + size or proportions of this banner to suit their needs. Always make sure + that the word “red” on the logo reads correctly. Otherwise, + non-symmetrical team logos will appear backwards on the banner.

+

 

+
+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+  Team Power-up Bases +

-5-

+
+
+

 

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html new file mode 100644 index 00000000..349ad089 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html @@ -0,0 +1,62 @@ + + + + + + +Team Arena Entity Definitions + + + + + +

Team Power-up Bases

+
+
+ + + + +
In Quake III: Team Arena, a base model + marks the location of each of the four persistent Team Power-Ups (Ammo + Regen, Guard, Doubler, and Scout). These models are not generated + programmatically (as is the case with the obelisks and flag bases) and + must be placed in the game maps by the mapmaker. Position the model such + that the center of its origin sits on top of the floor and so that it is + centered beneath the Team Power-Up. There are separate models for the + blue and red team sides. If you choose to place a powerup in neutral + territory (as in MPTERRA3), place a weaponpad_neutral.pfb under the + powerup. +

Copy the spawn folder into the models/mapobjects + directory in your missionpack directory (if necessary, create all three + directories now). Do not create a new directory for them. Shader scripts + and textures for these models are already a part of the Mission Pack pak + file and need not be added separately.

+

spawn.md3  This model is the location marker for the + blue side.

+

spawn_red.md3  This model is the location marker for + the red side.

+ +

 

+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+  New Game Entities +

-6-

+
+
+

 

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html new file mode 100644 index 00000000..6d4ae40d --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html @@ -0,0 +1,115 @@ + + + + + + +Team Arena Entity Definitions + + + + + +

Using New Game Entities

+
+
+ + + + + +
The best way to get a feeling for how the + new game entities should be used is to play Team Arena for a while. Here + are the id team’s rules and suggestions for using the new entities. +

 

+
+

Game Types

+
+

There are eight game types (including those from + original Quake III Arena). Unless marked with a gametype key, entities + will appear in every game type. The game types are:

+ +

Gametype Type of play corresponds to cvar …

+
+

FFA (multiplayer Free for All deathmatch) corresponds + to g_gametype 0

+

Tournament (1 on 1 deathmatch) corresponds to + g_gametype 1

+

Single (Single Player Free for All) corresponds to + g_gametype 2

+

Team (Team deathmatch) corresponds to g_gametype 3

+

CTF (Capture the Flag … traditional rules) + corresponds to g_gametype 4

+

Oneflag (single flag CTF) corresponds to g_gametype 5

+

Overload (destroy the opponent’s obelisk) + corresponds to g_gametype 6

+

Harvester (collect skulls, take to opponent’s base) + corresponds to g_gametype 7

+ +

 

+
+

The “notfree”, “notteam”, and “notsingle” + Keys

+
+

These are still checked by the game engine. They are + checked AFTER the gametype keys are checked. Because they complicate the + design (simple is usually best), we recommend not using them in Quake 3 + Team Arena maps.

+ +

 

+
+

Enable/Disabled entities for TA / Vanilla Q3

+
+

+ Entities can now have one of the following epairs: +

+ +

+ "notta" "1" +

+ +

+ for when the entity is not supposed to show up in Team Arena, and: +

+ +

+ "notq3a" "1" +

+ +

+ for when the entity is not supposed to show up in Quake III Arena. +

+ +

+ An entity may have both epairs, meaning it will only show up in mods. +

+ +

+ The epairs only work on "gameplay" type entities such as weapons, + powerups, items, ammo, etc. They will not affect entities that are + compiled into maps, such as models. +

+ +

 

+
+
+
+ + + + +
+

Back
+
+ + Table of Contents
+
+ T.A. Game Types +

-7-

+
+
+

 

+ + + + diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif new file mode 100644 index 00000000..002d850c Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif new file mode 100644 index 00000000..34a52f0e Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif new file mode 100644 index 00000000..cdd9c029 Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif new file mode 100644 index 00000000..ec299c78 Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif new file mode 100644 index 00000000..9eb6c4e5 Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif new file mode 100644 index 00000000..d0b595e4 Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif new file mode 100644 index 00000000..a360a0be Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif new file mode 100644 index 00000000..3dfbdca5 Binary files /dev/null and b/docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif differ diff --git a/docs/manual/quake3/Team_Arena_Mapping_Help/start.html b/docs/manual/quake3/Team_Arena_Mapping_Help/start.html new file mode 100644 index 00000000..412d5057 --- /dev/null +++ b/docs/manual/quake3/Team_Arena_Mapping_Help/start.html @@ -0,0 +1,30 @@ + + + + + + + +MAPPING HELP + + + + +

 

+

+

MAPPING +HELP

+

by +Paul Jaquays
+
Copyright © 2000 id software, inc.

+

      +    +    +    +

+

 

+

START

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/Image3.gif b/docs/manual/quake3/Terrain_Manual/pages/Image3.gif new file mode 100644 index 00000000..fdb98d27 Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pages/Image3.gif differ diff --git a/docs/manual/quake3/Terrain_Manual/pages/Image4.gif b/docs/manual/quake3/Terrain_Manual/pages/Image4.gif new file mode 100644 index 00000000..46d39abd Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pages/Image4.gif differ diff --git a/docs/manual/quake3/Terrain_Manual/pages/Image5.gif b/docs/manual/quake3/Terrain_Manual/pages/Image5.gif new file mode 100644 index 00000000..f240add8 Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pages/Image5.gif differ diff --git a/docs/manual/quake3/Terrain_Manual/pages/Image6.gif b/docs/manual/quake3/Terrain_Manual/pages/Image6.gif new file mode 100644 index 00000000..fdb98d27 Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pages/Image6.gif differ diff --git a/docs/manual/quake3/Terrain_Manual/pages/adding_bots.html b/docs/manual/quake3/Terrain_Manual/pages/adding_bots.html new file mode 100644 index 00000000..c6e951f2 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/adding_bots.html @@ -0,0 +1,40 @@ + + + + + + +Adding Bots + + + + + +

Adding Bots

+
+ + + + +
+

      Despite their massive size, terrain maps can support enjoyable bot play. The +key is careful placement of cluster portals, which is true of any map. Study the +bspc documentation for details. The documents accompanying the tools are more up +to date than those in the Q3Radiant manual. Your goal should be to keep the +number of areas in each cluster roughly equal and reasonably low (hundreds, not +thousands).

+
+ +

Back - Table +of Contents - Glossary

+ +
+
+
+

 

+

 

+

-25-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html b/docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html new file mode 100644 index 00000000..9e40b467 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html @@ -0,0 +1,85 @@ + + + + + + +Adding Buildings to Terrain + + + + + +

Adding Buildings to Terrain

+
+ + + + +
+

This is really best addressed as a number of semi-related building tips:

+ +

      Plan Ahead. If you know you want buildings +in your map, plan their locations from the first. Very complicated buildings +(lots of geometry and surface detail) should be isolated away from long views. +One reason for this is to control in view polygon counts. The second (and really +obscure one) is to reduce the amount of z-compression that will affect the +structures.

+ +

      Build to Support Game play. Each of the +structures in the Q3:TA terrain maps was built to support a game play need. +Quite often, less is better than more.

+ +

      Build Simply. Simple, uncomplicated +architecture may be best. The more complicated you make your buildings, the less +complicated the terrain around them can be. Depends on what you want to play up. +The busy look of many Q3A maps doesn’t translate well to large terrain. +Details are lost at great distances and only add to the triangle complexity of +maps containing them.

+ +

      Detail Content. With few exceptions ALL +the geometry inside the terrain map is detail content, not just the terrain +entity. The walls forming the corridor in mpterra2 may be the only non-detail +structures in that map. Making geometry into detail makes a map far easier and +faster to compile. If you want to block vis inside your structures, create +simple caulk structures … much the same way as described for vis blocking the +terrain.

+ +

      Z-Compression Problems. Review the the map +in 16 bit mode during development. This brings out z-fighting issues that occur +at long distances. This z-fighting is created by detail brushes being compressed +into each other (The Q3A engine does a significant amount of “z compression” +as geometry becomes farther away from the viewer). This z-compression is far +less apparent in 32 bit modes, but we have to remember that many people turn +down graphic features in order to simply play Q3A on their systems (not just to +get ridiculously high frame rates).

+ +

      Fit Structures to the Terrain. Don’t +just set structures on terrain and expect them to look right. Make your +buildings look like they belong where you put them. Accommodate the rise and +fall of terrain in your floor plans … or “dig” into the terrain brushes to +create basements, tunnels and whatever you need. You can also adjust the height +map to better arrange the geometry around structures, or manually tweak the +triangles once the structures are in place. History is full of examples of +really interesting buildings that have been built to accommodate difficult +terrain like hills, cliffs and mountains.

+

 

+
+
+ +
+
+ +

Back - Table +of Contents - Adding Bots

+ +

 

+
+
+

 

+

 

+

-24-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/art_tools.html b/docs/manual/quake3/Terrain_Manual/pages/art_tools.html new file mode 100644 index 00000000..ce54961d --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/art_tools.html @@ -0,0 +1,39 @@ + + + + + + +Art Tools Required + + + + + +

Art Tools Required

+
+ + + + +
+

      The creation of terrain maps requires that the mapmaker have, or have access +to a computer art program. Both JASC’s Paint Shop Pro and + Adobe’s Photoshop +were tested and will do the job. Any art program that can output an 8-bit BMP +format file with indexed color should work also.

+
+

Back - Table + of Contents- The Terrain Entity

+ +
+
+
+

 

+

 

+

 

+

-5-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html b/docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html new file mode 100644 index 00000000..369cf083 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html @@ -0,0 +1,101 @@ + + + + + + +Blocking Vis + + + + + +

Blocking Vis

+
+ + + + +
+

      Terrain maps still have to follow the rules that apply to all Q3A engine +maps. There’s only so much that you can allow to be seen at one time, or the +game starts slowing down. The good news is that the engine will only draw the +terrain triangles that are in the player’s PVS (potential visible set). It +doesn’t have to draw all the triangles in the terrain entity just because part +of the entity is in view.

+

      At first, most of the usual bag of tricks that mappers use to create vis +blocking structures in architectural maps don’t seem to apply to terrain. But +that is not the case. If anything, you NEED to think of terrain in much the same +way as you think of buildings. You are still dealing with open spaces that could +be considered corridors and large rooms … even though they look like large +valleys.

+

      In fact, it would be best to plan out the layout of your terrain + BEFORE +creating your height map. If you know you want to block vis, you can design your +terrain to work with vis blocking techniques and avoid the agony of having to go +all the way back to the start when you discover that your killer terrain map +lets you see too much at once.

+

      If you want the player, even in spectator mode, to be able to fly everywhere +and see the whole world laid out below him … an unrestricted vista, so to +speak, you’re going to be much more limited. Every single triangle in the map +will essentially be viewable at any moment in time. However, if you’re willing +to place restrictions on your players - limit how high they can fly or climb, +you suddenly have more options for blocking player visibility.

+

      First, the terrain entity is entirely detail content, so it doesn’t block +vis. That’s a key part of how this whole process works. Otherwise, vis time +would be measured in eras (not minutes or hours) and visdata size would be very, +very large.

+

      To block vis in the terrain, start by creating simple +vis-blocking structures +out of caulk texture inside the forms of the terrain (they are not part of the +terrain entity). You can try to match the silhouette of the terrain, but in the +end, you may only end up complicating the visdata without gaining any real +benefit.

+

      Next, and this is going to sound strange, build thin walls of caulk that +follow the divide line (where the terrain falls away on both sides) of the +highest mountains, buttes or hills. Only do this where you know that you will +not allow the player to move over or see over that +part of the terrain (we’ll talk about clipping real soon).

+

 

+
+

Other Tips:

+
+
+ +

· Sky Texture in Place of Caulk: +You sometimes want to apply the sky texture to some of the surfaces of the thin +walls used as vis blockers. This can remove some HOM effects. The caulk brushes +that block the vis around the bases in mpterra2 have sky texture painted on the +surfaces facing the base.

+ +

· Hint Brushes: +Use these extremely sparingly and only after trying to solve the problem in +other ways. Hint brushes can add hours to vis compile times. Even so, they can +make a difference. One trick you can try is to put a horizontal hint brush at a +point about midway up the slopes of your terrain. It can add some additional vis +break points.

+ +

· Adjusting Terrain: +Vis times totally depend on the placement of your vis blockers. Vis times are +not affected by modifying the terrain surfaces (terrain entities are detail +content, remember?). With that being said, you may want to modify the terrain to +allow you to more effectively position the vis-blockers. + + +

+
+
+ +

Back - Table +of Contents - Clipping the Terrain

+ +

 

+
+
+

 

+

 

+

-18-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html b/docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html new file mode 100644 index 00000000..d04314a3 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html @@ -0,0 +1,48 @@ + + + + + + +Boxing in the World + + + + + +

Boxing in the World

+
+ + + + +
+

      It may not need mentioning here, but … the terrain entity needs to be +contained inside a sealed world. For the terrain maps in Q3:TA, we built huge +boxes. Any portion of the box that could be seen while playing the game, or +flying around in spectator mode was covered in sky texture. Any portion of the +box that could not be seen was made out of common/caulk. If mountains or canyon +walls surround your map, plan to bring the caulk portion of the wall up as high +as you can. This can reduce the number of triangles seen in the map. Generally +speaking, you will see ALL the sky triangles inside the map at all times.

+

      Finally, and this is a part of vis blocking, but it should also be noted +here. Don’t forget to place large caulk structures that rise up from the +bottom of the world box to near the ground surfaces of terrain entity. If the +ground level rises and falls substantially, these can be a part of the vis +blocking process. Otherwise they serve to reduce the size of the map’s total +volume (generally speaking … a good thing).

+
+ +

Back - Table +of Contents - Entity Keys and Values

+ +

 

+
+
+

 

+

 

+

-14-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html b/docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html new file mode 100644 index 00000000..bb35889d --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html @@ -0,0 +1,58 @@ + + + + + + +Clipping the Terrain + + + + + +

Clipping the Terrain

+
+ + + + +
+

      The terrain entity uses its triangle surfaces as clipping planes. No +additional clipping is required to allow characters to run on the terrain’s +surface. As the initial terrain maps developed in house, we discovered that to +control and guide play flow, we needed to clip many of our mountain and canyon +slopes with vertical walls. Done right (as the slopes start becoming too steep +to climb), players don’t notice (as much).

+

      Next, decide how far up in the sky you are willing to let your player’s +fly. If the map is entirely open you might want to keep it that way. If you’ve +placed caulk barriers as described above, then the low point on the ridgeline +(or lower) will likely be your ceiling height.

+ +

Clipping Tips

+
+
+ +

· Make sure your “ceiling” clip +brushes extend all the way up the sky brush.

+ +

· Keep your clip brushes simple.

+ +

· Right angles are rarely found in +nature. Use the clipper tool to take the corners off your vertical clips.

+
+
+ + +

Back - Table +of Contents - Mapping the Textures

+ +

 

+
+
+

 

+

 

+

-19-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html b/docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html new file mode 100644 index 00000000..0ccad7d7 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html @@ -0,0 +1,194 @@ + + + + + + +Creating the Alphamap + + + + + +

Creating the Alphamap

+
+ + + + +
+

      The alphamap referenced by the alphamap key/value pair is an art file created +specifically for the map. For non-digital artists, it may be one of the more +technically and conceptually challenging things that need to be created to make +the terrain map work.

+

      Simply put, the alpha map is the template that the compiler uses to assign +textures to the terrain surface.

+

      To make the alphamap, you must have, or have access to, an art program that +can save a file as an 8-bit BMP file with indexed color. I’ll discuss other +file types later on, but the BMP file is probably the simplest solution, both +technically and conceptually.

+

 

+
+

Terms

+
+

      First, you need to understand a couple vocabulary words … jargon, if you +will:

+ +

Indexed Color: In essence, each color used in a piece of art is +remembered by its location on the color table or palette (see below). There are +256 colors available, numbered from 0 to 255. Each position on the palette has +its own number. This number has nothing to do with the RGB values of a color in +that position. If you change the actual color located at a particular location +on the palette (say from red to blue), all the pixels that were formerly that +shade of red (if painted using a color with that index number), will change to +the new color of blue.

+ +

Color Table: This is what Photoshop calls the indexed color layout of 256 +colors. In Paint Shop Pro it’s a palette. This is a pop-up window that shows +the colors in the palette and their arrangement. For making an alphamap for a +terrain map, the colors you choose are not important, but their position on the +palette is.

+ +

Palette: This is what Paint Shop Pro calls a Color Table.

+

 

+
+

Making the Palette

+
+

      The best way to start is to make a set of colors to use when painting +alphamaps. If you want, you can do this once and save it out. In PSP edit the +palette (in Photoshop, open the Color Table). Make sure the colors are sorted by +index number (there may be a pull down menu that allows this). In PSP, the +colors are indexed from the upper left (color 0 in the upper leftmost position +and increasing in value to the right). In Photoshop, the positions are reversed. +The color with value 0 is in the lower rightmost position and the index numbers +increase to the right.

+

      Because there is a direct one-to-one relationship between colors in the +palette and individual shaders that make of the metashader, you should select +clearly distinct colors to represent each shader. You should have one color for +each layer you intend to include in the map (see keys above), which means one +color to represent each root shader. You may find it convenient to create more, +so they are available for later use (if you save the palette).

+

      This method worked for me to make a 16-color palette in Paint Shop Pro. +First, I reduced my palette size to 16 colors. I clicked on each palette +position and created a color for it (don’t use black). Then, I increased my +palette size back up to 256 colors, filling the rest with black. In Photoshop, +it’s easier to select all the colors you don’t intend to use and make them +black. Then, I save the palette out as a file for later use.

+

      Another thing you might try is to make a grayscale palette, then use only the +first few positions for your color and leave the rest for grayscale (this allows +you to import bmp height maps and use them as guidelines).

+

 

+
+

Alphamap File Data

+
+

File type: The alphamap is a BMP format file or a TGA file (see other +file formats below). With BMP format, each color in your palette corresponds +directly to a root shader used to create the smooth texture blends on the +terrain.

+ +

File size: The size of the alphamap should be one-to-one with the number +of vertexes in the map. If you have 64 divisions x 32 divisions in your terrain +mesh (65x33 vertexes), you should use a 65 by 33 alphamap. You can use an +alphamap with a size that is not a one-to-one map with the number of map +vertexes, but you can then expect a less precise interpretation of your texture +assignments.

+ +

Colors linked to Shaders: If an 8-bit texture is used (BMP), q3map links +a color’s position on the palette to an identifying number in the name of a +shader. The color in position 0 would reference a root shader named <metashadername>_0. +The color in position 1 would reference a root shader named <metashadername>_1. +<metashadername> refers to the value of the Shader key (see Key: Shader +below). In theory, you could probably have 256 different root shaders assigned +to the terrain entity. In practice, you’d probably want to bite your arm off +at the elbow before doing something as complicated as that.

+
+

Other File Formats

+
+

      It is possible to use a TGA file (a RGB color format) for an +alphamap. TGA +files are handled differently than indexed color files like BMP. Instead of +looking for a position on the palette, q3map interprets the RGB value of actual +color. With a 32-bit TGA file, only the color values in the red channel are +used. The program assumes that a gray scale of equal values is being used. The +program divides the colors by the number of levels into equal-sized ranges. When +assigning textures, q3map looks at what range the color falls in and chooses the +appropriate shader to place or blend.

+
+

Controlling Texture Blends

+
+

      Each triangle on the mesh can only have two root shaders blending across it. +Another way to say this is that there should be only two different colors on the +three vertexes that form any given triangle in the mesh. Any more, and a sharp, +unblended edge appears on the terrain surface. This can take some trial and +error to correct. A bsp -switch command called -showseams can help the mapmaker +find these errors. Create a new bsp command in your project file that includes +this option. We recommend doing it with a novis only operation.

+
+

              +

+
+

Figure 3

+

      In figure 3, the blue and white image on the left is a scaled up (4X) version +of the alphamap used on Distant Screams. It shows three different root shaders +in use. Compare that to the gray scale height map on the right and you can see +how the artist chose to assign textures to the various heights and depths of the +map. As long as the guidelines for texture placement are followed, a mapmaker +should be able to work with more different root shaders than shown here.

+
+

Alphamap Creation Tips:

+
+
+ +

· The alphamaps for the team arena maps +are included with this document, both as reference and as files that you can +modify to work with your own maps. You may want to compare the alphamaps against +the heightmaps for the same maps, just to see how id resolved mapping issues.

+ +

· You can create a quick (though not +necessarily good) alphamap by saving your height map as a new file. Then use the +“posterize” filter that can be found in some art tools. Reduce the number of +colors in the art to equal the layers (number of unique root shaders) in the +terrain.

+ +

· If you are creating a new alphamap +from scratch, use colors that are easily distinguished from each other.

+ +

· If you are making an alphamap for a +team style map where both sides of the map are identical (mirrored or rotated), +you only need to design the map for one side. Copy and position it as described +above for the heightmap.

+ +

· The id maps used simple color schemes +that were homogenous throughout the maps. That is not the only way of doing +things. It would be quite reasonable to use many more terrain textures +(particularly if you weren’t going to build complicated, multi-texture +architecture on top of them). Consider a map where one part of the terrain used +red-themed textures and the other side blue themed textures. Have them blend +into a few simple neutral colors near the map center.

+ +

· Try doing terrain style texture +mapping on non-terrain geometry. Results will definitely vary, but some could be +interesting.

+
+
+ +

Samples: The last height map and the alphamap used to create each of the +terrain maps in Team Arena is included in the Mapping Support folder. Note that +the designers made vertex manipulations to the final terrain meshes that are not +reflected in these height maps. Also, the alphamaps are in PCX format, not BMP +format.

+
+ +

Back - Table +of Contents - The Terrain Texture

+ +

 

+
+
+

 

+

 

+

-16-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html b/docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html new file mode 100644 index 00000000..7cc5b281 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html @@ -0,0 +1,63 @@ + + + + + + +Creating the Terrain + + + + +

Creating the Terrain “Mesh”

+ + +
+ + + + +
+

      Although it’s not necessarily the only way to develop a piece of terrain, +thinking of it and creating it as “mesh” of triangular brushes may be the +easiest way to work initially. The terrain sections for Quake III: Team Arena +were built in this manner, though each designer went about it in slightly +different ways.

+

      Our primary tool was a plugin for Q3Radiant , created by David Hyde, called +GenSurf. The tool was originally created for Quake 2 (and may have been around +longer) and has been adapted for use with many of the game engines using Quake, +Quake2 and Quake3 technology. The basic concept behind GenSurf is that it can +create and export a group of brushes (or curve patches) to Q3Radiant that have +the look of “natural” terrain about them. Within the plug-in, the mapmaker +has control over the horizontal dimensions of the terrain entity, the steepness +of the slopes it creates, and the number of columns and rows of triangles that +it subdivides into.

+

      The terrain can be generated from within the tool by using simple waveforms, +more complex mathematical expressions, fractal calculations, or height maps. The +last item, height maps, is in our opinion, the route to take for creating +complex, visually interesting terrain layouts. A height map is a piece of art +(we rendered them in grayscale) that GenSurf uses as a template for establishing +the height of vertexes (the points where the corners of the terrain triangles +meet). GenSurf interprets the color of the pixel (or more correctly the +numerical color value of the pixel) that corresponds to the location of the +vertex. Generally, the darker the gray value, the lower in height the vertex +(256 unique height values corresponding to 256 pixel colors). GenSurf then uses +the vertexes to define the extents of triangles and suddenly, one has a terrain +surface. Of course, there are a few details of construction between start and +finish …

+
+ +

Back - Table +of Contents - Height Maps

+ +

 

+
+
+ +

 

+

 

+

-7-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html b/docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html new file mode 100644 index 00000000..1548da49 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html @@ -0,0 +1,102 @@ + + + + + + +Entity Keys and Values + + + + + +

Entity Keys and Values

+
+ + + + +
+

      Once you’ve created the func_group that will become the terrain entity, you +need to add the various keys and key values that make it a terrain entity.

+ +

      +A word to the wise: WRITE YOUR KEYS AND VALUES ON SOMETHING YOU CAN +EASILY REFER TO DURING DEVELOPMENT!! During the creation, testing and tweaking +of the heightmap, you will have to reenter these key/value pairs for the terrain +entity every time you recreate it. One thing that can make things easier is +before replacing the terrain entity with a new mesh, open the entity window and +click on the most complicated of the key/value pairs (usually the alphamap). +When the new terrain func_group is in place, click on the value line and hit +return. That’s one less thing to retype.

+
+

Key: Alphamap

+
+

      Value: The value should be the +pathname to the art file use to assign textures to the terrain. Example: +maps/alpha/pj_terra1.bmp. The pathname begins in the game (baseq3 or missionpack) +directory, which includes the name of the art file.

+

      The q3map compiler applies and blends the textures +(shaders) on the terrain +entity using a “metashader” (see Texturing the Terrain below) that +references the art file named by the alphamap value. See the Creating the +Alphamap section below for details.

+
+

Key: Layers

+
+

      Value: A positive integer, equal to +the number of unique or root textures to be blended on the map. Each color on +the alphamap’s palette corresponds to a “layer.” If you plan to blend 4 +textures, you need a layer value of 4.

+ +

Key: Shader

+
+

      Value: A pathname, beginning in the + missionpack/scripts directory, which includes the name of the filename and the +name of the metashader. Example: The shader value for mpterra2 is “terrain/mpterra2”. +“terrain” is the name of the script and mpterra2 is the name of the +metashader used to apply texture to this terrain.

+ +

Key: Terrain

+
+

      Value: Set this to 1 to indicate that +the func_group is a terrain entity. It’s essentially a yes/no flag.

+ +

Key: Min

+
+

      Value: Map coordinates of the minimum +XY extents (lowest left extent) of a component piece of a multi-part terrain +entity. This is optional, only used if you are texturing a subset of the total +terrain area.

+

The Min and Max extents (both must be in the entity) establish where a +subsection of terrain fits into the overall terrain map. It lets q3map assign a +subset of the alphamap to the entity, instead of referencing the entire alphamap. +It could also be used on a separate terrain entity to use the same alphamap, but +reference a different shader.

+
+

Key: Max

+
+

      Value: Map coordinates of the maximum +XY extents (uppermost right extent) of a component piece of a multi-part terrain +entity. This is optional, only used if you are texturing a subset of the total +terrain area.

+

      The Min and Max extents (both must be in the entity) establish where a +subsection of terrain fits into the overall terrain map. It lets q3map assign a +subset of the alphamap to the entity, instead of referencing the entire alphamap. +It could also be used on a separate terrain entity to use the same alphamap, but +reference a different shader.

+
+ +

Back - Table +of Contents - Creating the Alphamap

+ +

 

+
+
+

 

+

 

+

-15-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/glossary.html b/docs/manual/quake3/Terrain_Manual/pages/glossary.html new file mode 100644 index 00000000..b2311675 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/glossary.html @@ -0,0 +1,52 @@ + + + + + + +Glossary + + + + + +

Glossary

+
+ + + + +
+ + +

Root Shader: a shader that is part of +a family of related shaders used to texture a terrain entity. It represents a +terrain texture in its unblended state. The naming convention for a root shader +is <metashadername>_#.

+ +

Blend Shader: a shader that is part of a family of related shaders used +to texture a terrain entity. It represents a terrain texture in its blended +state, two textures that crossfade across each other. The naming convention for +a blend shader is <metashadername>_#to#.

+ +

Metashader: the identifying name of a group of related shaders used to +texture a terrain entity. By way of example, the metashader name used to texture +mpterra2 was … mpterra2. Its root shaders had names like mpterra2_0, +mpterra2_1, and mpterra2_2. Its blend shaders were named mpterra2_0to1, +mpterra2_1to2, and mpterra2_0to2.

+
+ +

Back - Table +of Contents - Q3Map Shader +Commands

+ +

 

+
+
+

 

+

 

+

-26-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html b/docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html new file mode 100644 index 00000000..78875d5c --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html @@ -0,0 +1,41 @@ + + + + + + +Height Map into Terrain Mesh + + + + + +

Height Map into Terrain Mesh

+
+ + + + +
+

      This is not intended to be a tutorial on using GenSurf, but it will include +some pointers on getting the most out of the tool. You can download the +standalone tool and find tutorials for GenSurf at this site

+

      This page, in particular, contains tips for using GenSurf, most of which to +apply to Q3A terrain creation. 

+

      When starting the GenSurf plug-in: You will probably want to “Select Ground +Surface” as the option for making your terrain surface.

+
+ +

Back - Table +of Contents - Gensurf Settings

+ +

 

+
+
+

 

+

 

+

-10-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/height_maps.html b/docs/manual/quake3/Terrain_Manual/pages/height_maps.html new file mode 100644 index 00000000..878f04d7 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/height_maps.html @@ -0,0 +1,174 @@ + + + + + + +Height Maps + + + + + +

Height Maps

+
+ + + + +
+

      The terrain maps in Quake III: Team Arena began as grayscale bitmap art files +imported into David Hyde’s “GenSurf” tool, a Q3Radiant plug-in. As +mentioned before, the height map is a template that the utility uses to define +the vertex heights of the triangles forming the terrain surface. We used Adobe +Photoshop and JASC’s Paint Shop Pro to create and adjust our height maps … +but any art program that can output a .bmp format file can be used to create the +height map.

+
+

+
+

figure 1.

+

      By way of example, the piece of artwork in figure 1 is a greatly scaled up +(4X) version of the height map used to create the initial terrain geometry for +mpterra2. The very dark, horizontal area near the center is the big “lake” +near the center of the map. The dark curves to the upper right and lower left +are the “fjord” water areas. The dark areas in the upper left and lower +right are the locations of the bases. The white and very light gray areas +represent the peaks of hills and mountains.

+

      The key to understanding how the height map works is that the shades of gray +in the art (call them “color values”) represent the height of mesh vertexes +(triangle corners) and not the triangle quads (squares created by two +triangles). When you work on a piece of art where each individual pixel +corresponds to a vertex, it is easy to imagine the pixels (usually large square +blocks) as squares of terrain. But that’s not how it works.

+

      Start by giving some thought to the eventual size and proportions of the +final terrain area in your map. How many rows and columns of triangles do you +want in the map? The finer you subdivide the map (making more rows and columns), +the more triangles will appear in any given view, but the terrain can be made +less blocky by including more.

+

      GenSurf can generate a terrain mesh of up to 64 triangles on a side (of the X +and Y dimensions of the entire mesh). If you don’t decimate the GenSurf output +(an option that optimizes and reduces the number of triangles used to create the +mesh … and we really recommend that you don’t), it generates a mesh of +triangles in arranged in quads in neat rows and columns. By way of reference, +mpterra2 (the largest Team Arena map) is “only” 48x64 columns and rows of +triangles. Since Q3Radiant and q3map tend to like things that end up in neat +powers of 2 or units of 64 subdivisions, consider having your map extents (lower +left and upper right map corners) fall onto neat units, power of 2 units. In +mpterra2, the extents were set up to make the mesh triangles have sides of 256 +units.

+
+

+
+

Figure 2.

+

      Figure 2 shows an example of a top view of a terrain mesh that is 8 x 8 rows +and colums of triangles (on a side).

+

      Just as you would plan out a game map, give thought to the layout and flow of +your terrain map. Will it be all-open in one view? Can you use natural terrain +features to block vis? How complicated will your buildings (if any) be? Do you +want to include trees, water, weather effects or other items that could add to +the visual cost of your map?

+

      Begin the creation of your height map by making a new grayscale file. If your +program doesn’t allow you to easily modify a .bmp format file, work in another +format and then convert it when you save. You can make the dimensions of your +height map art whatever you want. The extents you set in GenSurf for the map +dimensions are what determine the final size of the terrain piece. Some may find +it easier to work with a large file initially, using their favorite painting +tools to lay in the shades of gray.

+

      However, when you get down to making final and precise changes in your height +map you should (and this is STRONGLY recommended), change the size of the art +file such that the pixel dimensions of the map are 1 pixel larger than the +number of divisions (rows and columns) in the terrain mesh you want to create. +If you are making a 64 x 64 division map, then you want to create a 65 x 65 +pixel height map.

+

      If there is not a one-to-one match between the number of vertexes in the mesh +(one more than the number of divisions) and the number of pixels in the height +map, then GenSurf interpolates the number values (0 to 255 range) of the pixels +to get an averaged value instead of an exact value for the height of the vertex +at that point.

+

      When you save out the height map art file, you must save it in 8-bit .BMP +format. Currently, this is the only the file format that GenSurf recognizes.

+ +

Tips and things to consider for making Height Maps

+
+
+ +

· Read through the section on blocking +vis later in the document. Plan your vis blocking terrain structures in advance +instead of having to start over when you discover that too much of your world is +in view.

+ +

· Consider what type of geometry will +form the edges of your map. The terrain maps in Q3:TA resolve the issue by +creating canyon-like settings … valleys bordered by high canyon or mountain +walls.

+ +

· Start by filling your map with a +neutral gray (value 127 or 128). Paint the high areas lighter and the low areas +darker.

+ +

· Keep your terrain shapes simple when +you start. You can add greater complexity as your map develops.

+ +

· You will probably want to keep the “playable” +area of your map within a fairly close or “narrow” range of gray values +close to the middle range of values. This allows you to use very dark shades of +gray to create deep chasms and very light shades of gray to create high +mountains, canyon walls or visual barriers.

+ +

· Extreme jumps between the gray values +in adjacent areas means steep slopes.

+ +

· Avoid making vertical or near vertical +terrain surfaces … unless you don’t mind the resulting textured surface +looking like barcode. Q3Map planar projects the textures onto the terrain entity’s +surface (Normal brushes are box mapped). The pixels will stretch and stretch to +fill the space. The farther the surface is from horizontal, the greater the +stretching.

+ +

· Use the roughness feature of GenSurf +to add a little, um … roughness to your map … so flat areas aren’t +completely flat. If you are using a 1 to 1 scale height map, adding “noise” +to the file will also accomplish this.

+ +

· If you want an area, such as a path, +to be flat, you need to make the gray value affecting two adjacent vertexes the +same value.

+ +

· You can create gentle slopes by +changing the gray values between adjacent areas by very small amounts.

+ +

· Slopes greater than 45 degrees are +close to becoming unplayable barriers.

+

 

+
+
+

If you are building a symmetrical team style map, only create one side of the +terrain. Create a new piece of art that has the dimensions of the final piece. +Paste the map half into the new file and move it into position. If the map will +have an even number of vertexes, paste the map again and then rotate or mirror +(as you choose) the selection and move it into position. If the number of +vertexes is odd, after you paste the first half of the map, select all but the +row or column of pixels along which the two halves of the map will face and copy +it. Paste it, rotate or mirror it, then position it. Now, select and copy half +the row or column of pixels you didn’t copy in the last operation. Paste it, +transform it as you did in the last operation, and then position it so that it +is in the same row or column, but on the opposite side of the piece you copied.

+

When you make significant changes to a height map, consider saving it as +version rather than over-writing the older file. Always nice to have a back up +when you realize that you’ve messed up more than you’ve fixed.

+
+ +

Back - Table +of Contents - Other Height +Map Tools

+ +

 

+
+
+

 

+

-8-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/introduction.html b/docs/manual/quake3/Terrain_Manual/pages/introduction.html new file mode 100644 index 00000000..23b6085f --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/introduction.html @@ -0,0 +1,49 @@ + + + + + + +Introduction + + + + + +

Introduction

+
+
+ + + + +
+

      Creating workable terrain style maps for the Q3A engine takes some +reorganizing of thought, but in many ways is not substantially different from +making a halls-and-rooms type of map. The designer still has to be concerned +about how much can be seen at one time and give thought to map flow and play. +The rules and restrictions that guide conventional map design are still there +… it just occurs on a much grander scale. You still have to think about poly +counts, that hasn’t changed; but generally speaking, the polys that you will +use to make your game terrain are VERY large and less are likely to be seen all +at once during a game.

+

      +The “terrain” style maps in Quake III: Team Arena do not represent any +changes to the Quake 3 Engine. The power to make them work has always been there, +unrealized and untapped. What has changed is the way map files are created and +processed. These construction techniques rely on changes in the Q3Radiant editor +and the q3map program that processes the map files into game files.

+
+

Back - Table +of Contents - Key Changes

+ +
+
+
+

 

+

 

+

-3-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/key_changes.html b/docs/manual/quake3/Terrain_Manual/pages/key_changes.html new file mode 100644 index 00000000..e1ce97d5 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/key_changes.html @@ -0,0 +1,64 @@ + + + + + + +Key changes that have been made include + + + + + +

Key changes that have been made include:

+ +
+ + + + +
+
+

 

+
+ +

· A variant of the func_group entity + has been added to the game. When a func_group of brushes (only) is given a + terrain key and a numerical value (an ID number for that terrain) and several + other key attributes, it becomes a terrain entity and is treated differently + than other brushes during the compile.

+ +

· The map area has been expanded to + 128,000 units in all extents (256,000 units on any edge of the map volume). + While this does not mean that a map that large could actually run on current + game hardware, it does give the designer room to explore what the actual + limits may be. As a point of reference, mpterra2.bsp is roughly 12K x 16K x 3K + units in size … the largest map in the game by far.

+ +

· A terrain texture mapping system + plots textures across the terrain entity using a specially created .pcx or .tga + art file as a map for planar projecting and blending shaders on terrain + surfaces.

+ +

· A “meta-shader” is used to + organize and calculate blends between the shaders that are mapped onto the + terrain.

+ +

· Textures designed for use under + vertex lighting can be substituted at map load time for more complex shader-manipulated + textures that may not look correct in a vertex light only situation.

+
+
+ +

Back - Table +of Contents - Art Tools

+ +

 

+
+
+

 

+

-4-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html b/docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html new file mode 100644 index 00000000..e77ec51c --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html @@ -0,0 +1,135 @@ + + + + + + +Lighting the Terrain + + + + + +

Lighting the Terrain

+
+ + + + +
+

      Terrain maps also require some rethinking about the way you light maps.

+
+

Vertex Only

+
+

      If you are making a large terrain map, you should plan on making your terrain +textures be lit by vertex lighting only. Lightmaps can quickly become far too +large for the game to handle.

+

Make sure your large terrain textures contain the following parameters:

+ +

Surfaceparm nolightmap //signifies vertex lighting only.

+ +

Q3map_novertexshadows //this is what keeps those caulk vis blockers from +causing ugly shadows to form on your terrain.

+

      If you are using q3map_sun in your sky …

+ +

Q3map_forcesunlight //this makes the light emitted by a q3map_sun +parameter affect the vertex lit surface.

+
+

Light Sources

+
+

      For outdoor maps, the obvious source of lighting ought to be the sky. The +skies in the mpterra maps began with skies used in more conventional Team Arena +maps, but were modified to better suit the needs of the terrain worlds.

+
+
+ +

· Slow Down Those Clouds. + One thing to consider is slowing down the rate of cloud movement. What looks + OK in smaller maps looks wrong in vast panoramas.

+ +

· Strong Sunlight is + Good. For team maps, + you want to try and keep the light relatively the same in both base areas, so + if you have mountains or large base structures, having the light come in at a + nearly vertical angle is good, but less dramatic. +

+ +

· Ambient Light is Not + So Bad. Since the + beginning of Q3A map development we’ve said things like “Ambient Lighting + is bad”. Well, the problems caused by ambient lighting are still there + (flattening of shadows and colors), but with the distance of the play areas + from the sky surface (in some maps), adding an ambient really helps bring up + the overall light value in the map. Start low, maybe around an ambient value + of 5 and creep upwards until the map looks right. It is VERY IMPORTANT that + you give your ambient light a color. If you leave it white, you get ugly pink + light instead of white. Even specifying white makes it look wrong. Best + suggestion is to sample the sky texture color and translate that into an rgb + formula for your ambient. One warning + though … if you include “interior spaces” in your maps, the ambient + light will affect those areas too. You will not get the deep dark shadows you + may want in there. +

+ +

· Sky Shader Trick #1: Lose the + Backsplash. The attributes of the sky + shader can have a significant effect on the amount of time it takes to perform + a light compile on a map. You have to think of the sky as a huge area light. + However, unlike light emitting textures (like your average light fixture), the + sky doesn’t need to be illuminated itself. Therefore, you can eliminate the + backsplash light feature which is the default status of the q3map_surfacelight + parameter. Your sky shader should have the parameter q3map_backsplash with a + value of -1. Removing backsplash light doesn’t affect the appearance of the + sky, but does remove a significant amount of compiling overhead when the + -light algorithm is used (the normal way you light things).

+ +

· Sky Shader Trick#2: Big + Subdivisions. Q3Map automatically + subdivides the sky into triangle quads. The more triangle quads, the more + light emitting surfaces you have on your sky (if q3map_surfacelight is used). + The light compile calculates for every one of these light emitting surfaces. + Increase the size of the subdivision and you get less light emitters and a + faster compile.

+ +

· Sky Shader Trick #3: -V-light. + This is a fast lighting algorithm. It’s especially fast for calculating sky + lighting. It loses a little precision, but it can greatly speed up the time it + takes to light a map. Even if you decide to use a normal light operation for + your final map, using -vlight for interim compiles can mean a lot less time + spent waiting on the compiler to see your results.

+ +

 

+
+
+ +

The Light Grid

+
+

      This is discussed in detail under terrain-related Worldspawn features. One of +the things that can add enough memory complexity to a large terrain map, enough +to make it unplayable (read crash the game), is the light grid. Think of the +light grid as a map for determining how to light entities in the world. It’s +what makes player models appear to move in and out of shadows as they move +through the world. It’s a nice effect, but costly in memory terms. For the +largest maps in Q3:TA, we “traded down” to a less detailed light grid. +Increasing the size of grid subdivisions from 32 units to 256 units did this. We +experimented with smaller and larger grids and settled on 256 x 256 x 256 as the +best size. Smaller and the grid became large and unwieldy. Larger (especially on +the z dimension) and not enough light reached some of the entities.

+

      The details of this feature are noted below under Terrain-Related WorldSpawn +Features.

+
+ +

Back - Table +of Contents - Terrain +Worldspawn Features

+ +

 

+
+
+

 

+

 

+

-22-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html b/docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html new file mode 100644 index 00000000..2d154ca7 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html @@ -0,0 +1,42 @@ + + + + + + +Manipulating the Terrain Mesh + + + + + +

Manipulating the Terrain Mesh

+
+ + + + +
+

      Once the terrain mesh has been generated, it’s very likely that you will +want to fine-tune the triangles inside the editor. Do this by pulling vertexes +up and down along the Z axis. Once you start fine-tuning in this manner, the +height map no longer exactly represents the map.

+ +

WARNING: If you revise and convert the height map, your manipulations +here are lost.

+
+ +

Back - Table +of Contents - Terrain Mesh +into Terrain Entity

+ +

 

+
+
+

 

+

 

+

-12-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html b/docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html new file mode 100644 index 00000000..d44b8e61 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html @@ -0,0 +1,71 @@ + + + + + + +Mapping the Textures + + + + + +

Mapping the Textures

+
+ + + + +
+

      The key to making this stuff look good is the q3map routine that works with +alphamap and the metashader (see below) to smoothly blends textures across the +terrain entity.

+
+

Texturing Overview

+
+

      As noted earlier, Q3Map assigns textures, or more correctly, shader +manipulated textures, to each triangle used to create the terrain map. The +shaders used are part of a group of shaders called a metashader. The metashader +is the family name for the shader. Individidual shaders within it are identified +by a suffix, either an underline character followed by a number, or an underline +character followed by a string indicating a blend between two other shaders.

+

      Within the body of the metashader, there are two types of shaders used. The +first, is the root shader. A root shader represents a terrain texture in +its unblended state. The naming convention for a root shader is <metashader>_#. +The second type is the blended shader. The blended shader creates a +crossfade between two root shaders across the face of a single geometry +triangle. The naming convention for a blended shader is <metashader>_#to#. +The map maker does not need to make a blend between each root shader, but for a +blend to occur, there must be a blend shader for the two root shaders.

+

      Q3map will map a shader (root or blended) once and only once across the face +of the triangle. The shaders will not tile or repeat across the triangle face.

+

      As noted earlier, the textures are planar mapped or projected on the surface +of terrain texture. The angle of any individual triangle does not affect the +angle or direction at which the texture lies on the brush surface. The angle, +however, does affect the apparent stretching of the texture on the surface. The +steeper the angle of the brush surface, the greater will be the stretch of the +shader on that surface.

+

      Q3map looks at the pixel on the alphamap that corresponds to a given vertex. +It uses the color of that pixel (or more correctly the identification number of +the position that color occupies in the palette) to determine which root shader +will be applied. That root shader is applied to triangles that have one vertex +located at the given vertex. It then examines the alphamap color of the vertexes +adjacent to the given vertex. If an adjacent vertex has the same color as the +given vertex, the root shader is applied to the surface. If an adjacent vertex +has a different alphamap color, the blended shader that crossfades between the +two.

+
+ +

Back - Table +of Contents - The Meta-Shader

+ +

 

+
+
+

 

+

 

+

-20-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html b/docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html new file mode 100644 index 00000000..48fe65a2 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html @@ -0,0 +1,361 @@ + + + + + + +New or Revised Q3map Shader Commands + + + + + +

New or Revised Q3map Shader Commands

+
+
+ + + + +
+

q3map command line switches:

+
+q3map
+-----
+
+-threads 
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-glview
+	Write a .gl file of the bsp tree for debugging.
+-v
+	Output verbose information.
+-draw
+	Enable realtime debug drawing output.
+-nowater
+	Water, slime and lava brushes are not compiled and won't show up when running the map in Quake.
+-noopt
+	unused.
+-nofill
+	unused.
+-nodetail
+	Detail brushes are not compiled and won't show up when running the map in Quake.
+-fulldetail
+	Detail brushes will be treated as normal brushes.
+-onlyents
+	Only change the entities in a .bsp using a .ent file.
+-onlytextures
+	Only change the textures in a .bsp file.
+-micro
+	unused.
+-nofog
+	Visible surfaces that cross fog boundaries will not be split along the bound.
+	This can cause visually incorrect fog in the map.
+-nosubdivide
+	Visible surfaces are not subdivided as required by shader tesselation.
+	The shader parameter "tesssize" sets the tesselation of a surface.
+-leaktest
+	Only test the map for leaks. If a leak is found the compilation is stopped.
+-verboseentities
+	Output verbose information about entity sub-models.
+-nocurves
+	Curves are not compiled and won't show up when running the map in Quake.
+-notjunc
+	T-junctions are not fixed. This can cause tiny slits where a surface meets halfway another surface.
+-expand
+	Expands all the brush planes and saves a new map out to allow visual inspection of the clipping bevels
+-tmpout
+	Output files to a folder called "tmp".
+-fakemap
+	Write out a fakemap.map This map will contain a worldspawn entity with all the world brushes.
+-samplesize 
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-custinfoparms
+	Will enable custom surface flags (see below)
+
+q3map -vis
+----------
+
+-threads 
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-fast
+	Only calculate a very loose visiblity list. It doesn't take much time to
+	calculate but a lot more polygons will be drawn by the Q3 engine than necesary.
+-merge
+	Merge bsp leaves before calculating the visibility list. This will speed up
+	the vis calculations but mostly more polygons will be drawn by the Q3 engine
+	than necesary.
+-nopassage
+	Disable the passage visibility algorithm. The passage vis is faster and a bit more
+	tight than the old algorithm.
+-level
+	unused.
+-v
+	Output verbose information.
+-nosort
+	Don't sort the portals on complexity. Sorting mostly speeds up visibility calculations
+	because more complex portals can use information from less complex portals.
+-saveprt
+	Don't delete the .prt file after creating the visibility list.
+-tmpin 
+	Input files will be read from a folder called "tmp".
+-tmpout 
+	Output files will be written to a folder called "tmp".
+
+
+q3map -light
+------------
+
+-threads 
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-area 
+	This scales the light intensity of area lights.
+-point 
+	This scales the light intensity of point lights.
+-notrace
+	No light tracing is performed. As a result no shadows will be casted.
+-patchshadows
+	Enable patches casting shadows.
+-novertex
+	Don't calculate vertex lighting.
+-nogrid
+	Don't calculate light grid for dynamic model lighting.
+-extra
+	Take four samples per lightmap pixel and store the average light value of these
+	four samples for the actual lightmap pixel.
+	This super sampling is used for anti-aliasing.
+-extrawide
+	Just like -extra four samples per lightmap pixel are calculated. However the
+	average of 12 samples is stored per lightmap pixel.
+-samplesize 
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-border
+	Create a debugging border around the lightmap.
+-v
+	Output verbose information.
+-nosurf
+	unused.
+-dump
+	unused.
+
+
+q3map -vlight
+-------------
+
+-threads 
+	Number of threads used to compile the map. For the fastest compile
+	times the number of threads is set to the number of system processors.
+-area 
+	This scales the light intensity of area lights.
+-point 
+	This scales the light intensity of point lights.
+-novertex
+	Don't calculate vertex lighting.
+-nogrid
+	Don't calculate light grid for dynamic model lighting.
+-nostitching
+	No polygon stitching before lighting.
+-noalphashading
+	Don't use alpha shading at all.
+-nocolorshading
+	Don't use colored alpha shading. The alpha channel will be used as if it were binary.
+	The light goes through or not and does not change color.
+-tracelight
+	Use the "-light" light algorithm for all surface unless a surface
+	uses a shader with the shader option "q3map_vlight".
+-samplesize 
+	Set the lightmap pixel size to NxN units. Default 16x16.
+-v
+	Output verbose information.
+
+

The q3map options are a subset of the shader instructions that require +recompiling of the map.

+

q3map_tracelight

+

      [NEW] Surfaces using a shader with this option will always be lit with the +original "-light" light algorithm. Patches will not cast shadows on +this surface unless the shader option q3map_patchshadows is used.

+

q3map_patchshadows

+

      [NEW] When this option is used in conjunction with the original (-light) +lighting algorithm, surfaces with textures modified by this option will will +show shadows cast by curve patches (under normal circumstances, curve patches do +not cast shadows).

+

q3map_vertexshadows

+

      [NEW] By default, no shadows are cast on vertex-only lit surfaces (see +surfaceparm pointlight). Also when running Quake III Arena in vertex  lighting +mode, no shadows are cast upon any surfaces (shadows are part of the light map). +When using this shader option shadows *will* be cast on the surface when vertex +lit. However sharp shadow edges won't be seen on the surface because light +values are only calculated at the vertexes.

+

q3map_novertexshadows

+

      [NEW] Shaders used for misc_models and terrain can now use +q3map_novertexshadows to disable shadows to be cast at the vertex lit surfaces. +Shadows being cast at small misc_model objects often makes sense. However +shadows on large vertex lit terrain surfaces often look bad. By default no +shadows are cast at forced vertex list surfaces ( shaders with "pointlight" +).

+

q3map_forcesunlight

+

      [NEW] No sunlight is cast at vertex lit md3 models and terrain by default. +Using this option sunlight (overbright bits created by q3map_sun option) will be +cast on these surfaces.

+

q3map_vertexscale <scale>

+

      [NEW] The light value at the vertexes of a surface using a shader with this +option is multiplied by the scale value. This is a way to lighten or darken a +vertex light only surface in comparison to other, light-map lit surfaces around +it.

+

q3map_notjunc

+

      [NEW] Surfaces modified by a shader with this option are not used for +tjunction fixing.

+

q3map_vlight

+

      [NEW] Surfaces modified by a shader with this option will always be lit with +the "-vlight" algorithm when q3map is used with the options "-vlight +-tracelight".

+

q3map_lightmapsamplesize <S>

+

      [NEW] Surfaces using a shader with this shader option will use lightmaps with +pixel size SxS. This option can be used to produce high resolution shadows on +certain surfaces or can be used to reduce the size of lightmap data where high +resolution shadows are not required.

+

q3map_lightimage <image>

+

      Image to use for the light color of a surface light instead of the image(s) +used by the shader. Color is averaged from the texture. Texture must be the same +size as the base image map.

+

q3map_surfacelight <value>

+

Sets the amount of light this surface emits.

+

q3map_lightsubdivide <value>

+

      A surface light is subdivided into a bunch of point lights for the actual +lighting of the world. This parameter controls the space between those point +lights. Default value is 120.

+

q3map_backsplash <percent> <distance>

+

      A surface light is also lit by itself using back splash point lights with a +lower intensity. The <percent> parameter specifies the intensity +percentage they use from the q3map_surfacelight <value> parameter. The +<distance> parameter controls the distance of these back splash lights +from the surface. You can set the <percent> to zero or a negative value to +disable the back splash lights.

+

      q3map_globaltexture

+

When this option is set the texture is not aligned to the world.

+

      q3map_backshader <shader>

+

<shader> is the path/name of the shader or texture to be used at the +back side of the surface.

+

      q3map_flare <shader>

+

Creates a flare using the specified <shader> at the center of the +surface using a shader with this option.

+

      light <value>

+

Old style flare specification always using the shader "flareshader". +The <value> parameter is unused.

+

      q3map_sun <red> <green> <blue> <intensity> +<degrees> <elevation>

+

Color will be normalized, so it doesn't matter what range you use. The +intensity falls off with angle but not distance. A value of 100 is a fairly +bright sun.

+

      degree of 0 = from the east, 90 = north, etc.

+

      elevation of 0 = sunrise/set, 90 = noon

+

      surfaceparm pointlight

+

Surfaces using a shader with this parameter will always be vertex lit

+

This option can be used to reduce the lightmap data. Often used on surfaces

+

that don't need any shadows.

+

Surfaceparm dust

+

If a player lands (jumps onto) on a surfaces using a shader with this +parameter, a put of dust will appear at the player’s feet. Note that the +worldspawn entity of that map must have an enableDust key set to a value of 1.

+ + +

Custom surfaceparms

+
+

With the new q3map tool you can add custom surface parameters for mods +without the need to recompile the q3map tool. These custom surfaceparms are +stored in a file called ‘custinfoparms.txt’ in the folder scripts/. An +example of this file with the new surfaceparm treacle and surfaceparm grass is +shown below.

+

// Custom Infoparms File
+// Custom Contentsflags
+{
+treacle 0x4000
+}
+// Custom Surfaceflags
+{
+grass 0x80000
+}

+

 

+ +

NOTE: For linux users, when using the -custinfoparms parameter q3map +first looks in your homedir, and only if it doesn't find a custinfoparms.txt +there, it uses the one stored in the

+

quake3 install dir (usually /usr/local/games).

+

 

+
+

Content Flags

+
+

Contents flags are flags similar to CONTENTS_FOG in the original Q3A. These +flags define the contents of volumes inside the game (for instance lava, fog, +water, etc.).

+

If you look in the source file game/surfaceflags.h, it has defines for all +contents flags. The define is split into a name and a hexadecimal value, for +instance CONTENTS_PLAYERCLIP 0x10000. These hexadecimal values are powers of 2 +and can be ored together (binary) to form a bit mask. Up to 32 contents flags +can be ored together this way.

+ +

Example: creating a volume with treacle.

+

The following outlines how a custom contents flag can be added and used in a +mod. First open the ‘custinfoparms.txt’ file and add ‘treacle 0x4000’ +to the Custom Contentsflags section as shown in the example file above (0x4000 +is one of the unused values available for custom use). Next write a shader +script which uses ‘surfaceparm treacle’. Apply this new shader to all sides +of a brush in a test map. When you compile the map, add the -custinfoparms +parameter to the command line following q3map.

+

Next, add CONTENTS_TREACLE 0x4000 to the source file game/surfaceflags.h in +your mod. Now you can call the point contents function. If the point is inside +the brush with the shader using the ‘surfaceparm treacle’ then the point +contents call will return a bit mask with CONTENTS_TREACLE set. This can for +instance be used to slow down player movement when a player is inside such a +brush.

+

 

+
+

Surface Flags

+
+

The surface flags are texture properties that often affect entities in +contact with surfaces using such flags. The ‘surfaceparm metalsteps’ +parameter from Q3A is a good example.

+

If you look in the source file game/surfaceflags.h, it has defines for all +surface flags. The define is split into a name and a hexadecimal value, for +instance SURF_NODAMAGE 0x1. These hexadecimal values are powers of 2 and can be +ored together (binary) to form a bit mask. Up to 32 surface flags can be ored +together this way.

+ +

Example: Making ‘footsteps on grass’ sounds

+

The following outlines how a custom surface flag can be added and used in a +mod. First open up the ‘custinfoparms.txt’ file and add 'grass 0x80000' to +the Custom Surfaceflags section as shown in the example file above (0x80000 is +the first available unused value in surfaceflags.h for surface flags). Next +write a shader script which uses a grass image and has 'surfaceparm grass’. +Create a test map with the grass shader covering the ground surface. When you +compile the map, add the -custinfoparms parameter to the command line following +q3map.

+

Next, add SURF_GRASS 0x80000 to the source file game/surfaceflags.h in your +mod. Now you'll be able to execute a trace and the trace information will be +returned in the trace_t structure. If the trace hits a surface with the grass +surfaceparm then the SURF_GRASS flag will be set in trace_t->surfaceFlags. +Such a trace can be used to trigger playing a sound of a person stepping on +grass. For a reference example, see the existing metal steps in the game code.

+

 

+
+

 

+ +
+ +

Back - Table +of Contents - Links

+ + + +

 

+
+
+

 

+

 

+

-27-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html b/docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html new file mode 100644 index 00000000..3265cd71 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html @@ -0,0 +1,62 @@ + + + + + + +Other Possible Height Map Tools + + + + + +

Other Possible Height Map Tools

+
+ + + + +
+

      There are even some editors for other (non-fps) games that can be used to +manipulate a surface in 3D and then output a .bmp format file. It is worth +noting that we found it particularly challenging to use them … possibly more +challenging than the benefits of working in 3D.

+ +

SC3K Map Editor

+
+

      The first of these programs was a terrain editor for SimCity3000 called the +SC3K Map Editor from Tenermerx. It is a free download available here: sc3maped

+ +

Loathing

+
+

      The other editor we tried was the “Loathing” terrain editor that comes +with Bungie’s Myth II game. If you’ve a copy of Myth II, this is something +you could play around with. Both of these programs could output a .bmp format +file. If you’ve used it to make some Myth II maps you may have some idea of +how it works already. It is my opinion that if you use an editor for either of +these two games to create your height map, you may still want to or need to +manipulate it in an art program. If you can visualize the relationship between +shades of gray and relative heights and slopes, the art program is probably the +easier way to go.

+ +

Pencils, paintbrushes and a scanner

+
+

      You can also make your heightmap by painting it by traditional methods and +then scanning in the file and saving it as a .bmp. Though at some point you’ll +probably want to switch over to digital manipulation.

+
+ +

 

+

Back - Table +of Contents - Height Map into +Terrain

+ +

 

+
+
+

 

+

-9-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/related_links.html b/docs/manual/quake3/Terrain_Manual/pages/related_links.html new file mode 100644 index 00000000..8a23b51d --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/related_links.html @@ -0,0 +1,40 @@ + + + + + + + +Related Links + + + + +

Related Links

+ +

 

+

 

+

-28-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html b/docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html new file mode 100644 index 00000000..9c81114c --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html @@ -0,0 +1,135 @@ + + + + + + +Suggested GenSurf settings + + + + + +

Suggested GenSurf settings (by Tab)

+
+ + + + +
+ + +

The General TAB:

+
+
+
+ +

· Select Quake 3 Arena under Game.

+ +

· Select From Bitmap under Waveform. Of course, you may want to + play around with some of the other wave forms. But bitmaps give you the + greatest degree of control.

+ +

· Orientation: as appropriate

+ +

· If you don’t want GenSurf to add any “noise” or + randomization to the height of the mesh, set the Roughness to zero. The + preview window gives you a good representation of what roughness does to + your surface. The random seed changes the distribution of the noise. Adjust + both fields accordingly.

+
+
+ +

The Extents TAB:

+

Extents: The extents of a map are the points on a map that define its +lowermost t and leftmost corner and its uppermost and rightmost corner. They are +given in terms of  X, Y coordinates.

+
+
+ +

· Under Extents, you should chose number values that are even + multiples of your number of Divisions so that the grid rectangles are all + the same size (this produces better texturing results). It also makes extra + work for the compiler. Furthermore, use the Extents to position the terrain + entity on the map (XY only). You will want to make sure that the terrain + locates exactly where you want it each time you revise it. Repositioning a + terrain file can be time consuming.

+ +

· Set your X and Y divisions to equal the number of rows and + columns of triangles you want. You may want to strongly consider playing + with the numbers so that your triangle sides end up be large powers of two + (64, 128, 256 units etc.).

+ +

· Do not check Use Bezier Patches.

+ +

· Do not Decimate (keep it set to 0%). The process that applies + textures to the surfaces and blends textures between vertexes works best if + the size of the triangles is consistent and constant.

+
+
+ +

The Bitmap TAB:

+
+
+ +

· Filename should point to the .bmp file you are using as a height + map. Reload will bring in any changes you have made to the art file without + having to restart the program.

+ +

· GenSurf assigns an integer value to each of 256 shades of gray. + The value is based on the position of the color in the palette. In a grayscale + palette, the values typically range from 0 (black) to 255 (white). Map Color 0 + corresponds (usually) to the lowest point on the height map and Map Color 255 + to the highest. If you set Map Color 0 to 0 and Map Color 255 to 2048, each + increase in color value adds 8 units to the height of the vertex. When you + increase the difference between to the two values, the height changes are + steeper. Decrease the difference and the height changes are more global. You + can control the “Z” location at which the terrain draws by adding any + extra height above (or below) zero to the height values for both numbers.

+
+
+ +

The Fix Points TAB:

+
+

The general recommendation for this TAB is to leave it alone. You should +either modify the height map or directly manipulate vertexes inside the +Q3Radiant editor.

+ +

Texture TAB:

+
+
+ +

· Set the main texture to common/terrain. The “Steep” angle is + irrelevant for terrain texture mapping.

+ +

· Make sure that the Use detail brushes setting is checked.

+
+
+

Once you’ve tweaked all your settings, do a Save as. If you make changes to +the settings, consider saving again as a new file. It’s nice to have a back up +if you screw things up.

+ +

GenSurf Tips

+
+
+ +

· Setting extents to correspond exactly with the desired map + location is important. You want to be able to drop revised terrain into a map + without a lot of repositioning.

+
+
+ +

Back - Table +of Contents - Manipulating the +Terrain Mesh

+ +

 

+
+
+ +

 

+

-11-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html b/docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html new file mode 100644 index 00000000..82d36038 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html @@ -0,0 +1,88 @@ + + + + + + + +Table of Contents + + + + +

Table of Contents
+
(HTML Conversion by AstroCreep)
+

+
+ + + + + +
+

Title Page............1
+Table of Contents............2

+
+
Introduction + ...........3
+Key Changes that have been made............4
+Art Tools Required
............5
+ +The Terrain Entity............6
+ +Creating the Terrain “Mesh”............7
+ +Height Maps............8
+ +Other Possible Height Map Tools............9
+ +Height Map into Terrain Mesh..........10
+ +Suggested GenSurf settings (by Tab)..........11
+ +Manipulating the Terrain Mesh..........12
+ +Terrain Mesh into Terrain Entity..........13
+ +Boxing in the World..........14
+ +Entity Keys and Values..........15
+ +Creating the Alphamap..........16
+ +The Terrain Texture..........17
+ +Blocking Vis..........18
+ +Clipping the terrain..........19
+ +Mapping the Textures..........20
+ +The Meta-Shader..........21
+ +Lighting the Terrain..........22
+ +Terrain Related Worldspawn Features..........23
+ +Adding Buildings to Terrai
n..........24
+ +Adding Bots..........25
+Glossary..........26
+ +New or Revised Q3Map Shader Commands..........27
+
+ +Related Links..........28

+
+

+
+ +

 

+

Back - Table +of Contents- Introduction

+ +

-2-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html b/docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html new file mode 100644 index 00000000..b5e87f9c --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html @@ -0,0 +1,50 @@ + + + + + + +The Terrain Entity + + + + + +

The Terrain Entity

+
+ + + + +
+

      The process of building a piece of terrain focuses on a new thing called the +“Terrain Entity.” Technically speaking, the terrain in Team Arena is nothing +more than a func_group entity (brushes only) with a number of key/value pair +combinations that are unique to it. These key/value pairs define it as terrain (terrain), establish the piece of art that will be used to locate textures on it +the terrain (alphamap), define the group of shaders used to blend textures +across its surface (shader), and tell how many different unique shaders will be +used. The bsp-making utility, Q3Map compiles and textures the terrain entity +based on the parameters specified in those key/value pairs.

+

      It is possible to have multiple terrain entities in a map (see Terrain +Entities below). Once you learn the method and the techniques, terrain is +relatively easy to create. One warning though … easy to create does not mean +easy to compile. Large maps take a much longer time to compile, and huge maps +are likely to take what seems like forever. However, there are some +construction, lighting, and shader options that can significantly cut down on +compile time - as will be noted later.

+
+ +

Back - Table +of Contents - Creating the terrain +"Mesh"

+ +

 

+
+
+

 

+

 

+

-6-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html b/docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html new file mode 100644 index 00000000..70c0e139 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html @@ -0,0 +1,44 @@ + + + + + + +Terrain Mesh into Terrain Entity + + + + + +

Terrain Mesh into Terrain Entity

+
+ + + + +
+

      GenSurf outputs its terrain as a func_group entity. If you create a terrain +mesh by any other means, you need to group it as a func_group entity.

+

      Make certain that all the non-visible surfaces of the func_group brushes are +textured with common/caulk.

+

      Texture the visible surfaces with common/terrain or common/terrain2.

+

      Select the func_group and turn it to detail content (CTRL M) or use the +Selection menu.

+

      It is possible to map terrain onto something that is not a “terrain” +mesh. Keep in mind that textures will be planar projected onto all surfaces in +the terrain entity and that brush vertexes will be used to determine where +blends start and end.

+
+ +

Back - Table +of Contents - Boxing in the World

+ +

 

+
+
+

 

+

-13-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html b/docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html new file mode 100644 index 00000000..3140ea3c --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html @@ -0,0 +1,222 @@ + + + + + + +Terrain + + + + + +

Terrain-related WorldSpawn Features

+
+ + + + +
+

A number of worldspawn key/value pairs were created to deal with issues +arising out of terrain creation.

+
+

Cold Breath and Hot Dust

+
+

+The following two features need not be directly related to terrain, although +they first appear in the Q3:TA maps. Each key/value pair needs to be the +worldspawn for that particular feature to work.

+ +

+Key/value pairs:

+

+Key: + enableBreath

+ +

+Value: + 1

+

+When written into the worldspawn, this enables the appearance of “frosty +breath” in the air in front of players. The frosty break does not appear in a +player’s first person view, but will be seen in front of other players and in +3rd person view.

+ +

+Key/value pair:

+

+Key: + enableDust

+ +

+Value: + 1

+

+When written into the worldspawn, this enables the appearance of dust puffs +at the player’s feet when he lands on or run on a “dusty” surface. Adding +the surface parameter “surfaceparm dust” to the shader for that surface +creates a dusty surface. The common/terrain2 texture already contains the +enableDust parameter.

+ +

Texture Remapping: Shaders for vertex light mode in Q3A

+
+

+One thing we quickly discovered when mapping the metatexture onto the terrain +world was that it didn’t work if a player chose to run in the game’s vertex +lighting only mode. That mode compresses shaders into a single pass. Usually, +the engine makes a reasonable choice for which pass is mapped, but with the +metashaders, that wasn’t the case. The solution: allow the mapper to choose a +substitute texture that only is used in the game’s vertex lighting mode. +

+

+For each shader that will be remapped a key/value pair must be entered in the +map’s worldspawn. +

+ +

+Key: vertexremapshader

+ +

+Value: + + normal_shader;vertexlighting_shader +

+

+The normal_shader is the shader normally used on the terrain. The +vertexlighting_shader is the shader to be used when people run the map in Q3 in +vertex lit mode. The normal_shader and the vertexlighting_shader are seperated +by a semi-colon ; +

+

+As many shaders can be remapped as needed by using the key. However, if more +than one shader is remapped in a map, each one must have a unique identifier … +either a number or a letter after the Key word, as shown by “vertexremapshaderX”, +where X is a number or any character set. Examples, vertexremapshader01, +vertexremapshader02, vertexremapshaderA, vertexremapshaderB, +vertexremapshadermpterra2_1, etc. +

+

+In mpterra2, the key/value pair for one of the replaced shaders looked like +this: +

+ +

+Key: + + vertexremapshader1 +

+ +

+Value: + + textures/terrain/mpterra2_0to1;textures/terrain/vxmpterra2 +

+

+Each of the three root shaders and the two blend shaders had to replaced in +this manner. +

+

+The following is a sample of the shader used to replace ALL the terrain +shaders in mpterra2: +

+ +

// *************************************************

+

// *

+

// * Vertex Lighting Replacement Shaders

+

// *

+

// *************************************************

+

textures/terrain/vxmpterra2

+

{

+

surfaceparm nolightmap

+

q3map_novertexshadows

+

q3map_forcesunlight

+

{

+

map textures/stone/pjrock10b_2.tga

+

rgbGen vertex

+

tcmod scale 0.125 0.125

+

}

+

}

+
+ + +

GridSize

+
+
+
+ +
+ + +

+The Light Grid Size (as noted earlier) is the map that the Q3A engine uses to +light entities. It’s what gives the illusion of players moving in and out of +shadowed areas on the game levels. We decided, that for large terrain maps, it +should not be as detailed (and therefore nowhere near as large) as we had done +for smaller, interior maps. After experimenting with placing controls for the +grid size on the bsp command line, we finally settled on putting the command +information in the map’s world spawn. In that way, the grid size could be +easily tailored to the individual map.

+ + + + +

+Key/value pair: +

+

+Key: + + gridsize +

+ +

+Value: + + X Y Z +

+
+ +
+
+ +
+

+Note that the values are the dimensions of those coordinates. It’s best to +keep them to power of 2 values. The default value for the gridsize (if left +unchanged) is 64 64 128. Setting higher x y and z values reduces the size of the +light grid data in both the .bsp file and in the Q3A game, but it also creates +less accurate dynamic model lighting.

+ +

+Errors

+
+

+Definitely set the x y and z values higher if you get:

+

+************ ERROR ************

+

+MAX_MAP_LIGHTGRID

+

+when compiling your map with q3map.

+ +

Back - Table +of Contents - Adding Buildings

+ + + + + +

 

+ +
+ +
+
+
+

 

+

 

+

-23-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html b/docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html new file mode 100644 index 00000000..bb2e81a1 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html @@ -0,0 +1,65 @@ + + + + + + +The Terrain Texture + + + + + +

The Terrain Texture

+
+ + + + +
+

In Q3:TA, there are two “terrain” textures in the common shader script. +One handles all the uses of terrain where the designer does not want “dust” +to rise up as the player jumps onto the terrain (common/terrain). The second +(common/terrain2) has an enable_dust surface parameter. The terrain texture +should be applied to all visible (in game) surfaces of the terrain entity.

+

Q3map looks for the word “terrain” in the name of the shader when +texturing terrain entities. If a shader is used without the word +"terrain" in it, and it’s not marked as nodraw, q3map will still do +a planar projection, but using that texture. It will not blend between textures, +however. This can be used to create hard edge texture transitions, or in cases +where you want to apply textures manually, and aren’t concerned about +blending.

+

If the terrain texture is applied to a non-terrain entity brush, the surface +will not draw. The projected terrain surface textures only work on surfaces that +are a part of entities with the proper terrain entity keys and values.

+

Their scripts for terrain are as follows:

+
+

textures/common/terrain
+{
+surfaceparm nodraw
+surfaceparm nomarks
+surfaceparm nolightmap
+}
+textures/common/terrain2
+{
+qer_editorimage textures/common/terrain.tga
+surfaceparm dust
+surfaceparm nodraw
+surfaceparm nomarks
+surfaceparm nolightmap
+}

+
+ +

Back - Table +of Contents - Blocking Vis

+ +

 

+
+
+

 

+

 

+

-17-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html b/docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html new file mode 100644 index 00000000..b24d7ff9 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html @@ -0,0 +1,192 @@ + + + + + + +The Meta + + + + + +

The Meta-Shader

+
+ + + + +
+

      The shader is the group or family of related shaders used to texture a +terrain entity. The shader key/value pair in the entity identifies the +metashader to be used. The suffix (either “_#” for a root shader or “#to#” +for a blended shader.

+

      For each root shader that you want to blend, you need a blend shader. Note +that you only need to make the blend once. If you have mpterra2_0to2, you don’t +need mpterra2_2to0.

+

 

+
+

Example Terrain Shader

+
+

      This was the shader used to map textures on mpterra2 (hence the metashader +name)

+
+

//****************************************************
+// *************************************************
+// *
+// * MPTerra2 terrain shaders
+// *
+// *************************************************
+textures/terrain/mpterra2_0
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock9b_2.tga
+rgbGen vertex
+tcmod scale 0.125 0.125
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}
+textures/terrain/mpterra2_1
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock12b_2.tga
+rgbGen vertex
+tcmod scale 0.1 0.1
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}
+textures/terrain/mpterra2_2
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock10b_2.tga
+tcmod scale 0.05 0.05
+rgbGen vertex
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}
+textures/terrain/mpterra2_0to1
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock9b_2.tga
+rgbGen vertex
+alphaGen vertex
+tcmod scale 0.125 0.125
+}
+{
+map textures/stone/pjrock12b_2.tga
+tcmod scale 0.1 0.1
+rgbGen vertex
+alphaGen vertex
+blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}
+textures/terrain/mpterra2_0to2
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock9b_2.tga
+rgbGen vertex
+alphaGen vertex
+tcmod scale 0.125 0.125
+}
+{
+map textures/stone/pjrock10b_2.tga
+rgbGen vertex
+alphaGen vertex
+tcmod scale 0.05 0.05
+blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}
+textures/terrain/mpterra2_1to2
+{
+surfaceparm nolightmap
+q3map_novertexshadows
+q3map_forcesunlight
+{
+map textures/stone/pjrock12b_2.tga
+rgbGen vertex
+alphaGen vertex
+tcmod scale 0.1 0.1
+}
+{
+map textures/stone/pjrock10b_2.tga
+tcmod scale 0.05 0.05
+rgbGen vertex
+alphaGen vertex
+blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+}
+{
+map textures/skies2/clouds.tga
+blendfunc filter
+detail
+tcmod scale 0.01 0.01
+tcMod scroll -0.05 0.05
+tcmod transform 1 0 1 1 1 1
+}
+}

+
+ +

Back - Table +of Contents - Lighting the Terrain

+ +

 

+
+
+

 

+

 

+

-21-

+ + + + diff --git a/docs/manual/quake3/Terrain_Manual/pics/background.jpg b/docs/manual/quake3/Terrain_Manual/pics/background.jpg new file mode 100644 index 00000000..1f1d8d48 Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pics/background.jpg differ diff --git a/docs/manual/quake3/Terrain_Manual/pics/start.gif b/docs/manual/quake3/Terrain_Manual/pics/start.gif new file mode 100644 index 00000000..f84e2ffc Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pics/start.gif differ diff --git a/docs/manual/quake3/Terrain_Manual/pics/terrain.jpg b/docs/manual/quake3/Terrain_Manual/pics/terrain.jpg new file mode 100644 index 00000000..c550f682 Binary files /dev/null and b/docs/manual/quake3/Terrain_Manual/pics/terrain.jpg differ diff --git a/docs/manual/quake3/Terrain_Manual/start.html b/docs/manual/quake3/Terrain_Manual/start.html new file mode 100644 index 00000000..677bcd35 --- /dev/null +++ b/docs/manual/quake3/Terrain_Manual/start.html @@ -0,0 +1,30 @@ + + + + + + +Terrain Construction for Quake 3 Engine Games + + + + + +

+

  + +Special Thanks to Jim Dosé and Jan Paul van Waveren +for their assistance and review (and making this all work in the first place) +and the same gratitude to Astrocreep for his review and suggestions for making +it into something people could understand.

+

The material here is for use in conjunction with the Q3Radiant manual for the +Quake 3 Engine and presumes familiarity with that tool and game engine. Although +compiling switches and shader commands are included here, this is not intended +to be a general update or revision to the Q3Radiant manual

+

Table of Contents

+ +

-1-

+ + + + diff --git a/gen.readme b/gen.readme index 4b735df4..a12941c5 100644 --- a/gen.readme +++ b/gen.readme @@ -1,4 +1,4 @@ -Dummy file for gen.dsp - -gen.dsp is used with MSVC to generate include/version.h and include/aboutmsg.h -you need python installed and configured to make this work +Dummy file for gen.dsp + +gen.dsp is used with MSVC to generate include/version.h and include/aboutmsg.h +you need python installed and configured to make this work diff --git a/gen.vcproj b/gen.vcproj index 75af13f4..b7d426ae 100644 --- a/gen.vcproj +++ b/gen.vcproj @@ -1,227 +1,71 @@ - - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/gendox b/gendox index c25663fb..935e052b 100644 --- a/gendox +++ b/gendox @@ -1,150 +1,150 @@ -#!/bin/bash -# -# Shell script to make doxygen documentation by specifying a target directory -# on the command line -# -# Gef (gefdavis@dingoblue.net.au) -- August 2001 - -# TODO: -# - Dynamic ChangeLog (page gets updated with each commit) -# - Have the ability to specify server dox or local dox, which will then -# change the content on the main page -# - Incorporate a scaled gtkradiant splash image into the pages - -#------------------------------------------------------------------------ -# Set some variables -#------------------------------------------------------------------------ -# WORKINGDIR=`pwd`; -RETVAL=0; -TARGETSTRING=''; -EXTRAS_PATH="./Doxygen_files"; -CONFIG_OUTPUT="$EXTRAS_PATH/genConf"; -DOXYCONFIG="./DoxyConfig"; -DOXYFILE="$EXTRAS_PATH/Doxyfile"; -NEWDOXYFILE="$EXTRAS_PATH/genDoxyfile"; -declare -a TARGETLIST[$#]; -COUNTER=0; -TARGETCOUNT=0; -QUIETMODE=0; -# added -k command line option to kill running doxygen procs -KILLON=0 - -#------------------------------------------------------------------------ -# load the functions -#------------------------------------------------------------------------ -if [ -f "$EXTRAS_PATH/gendoxfunctions" ] ; then - . $EXTRAS_PATH/gendoxfunctions -else - echo -e "Missing critical files...\n"; - exit 1; -fi - -#------------------------------------------------------------------------ -# parse the command line options -#------------------------------------------------------------------------ -COMLINE="$*"; -OPTCOUNT="$#"; -parse_commandline; -if [ $RETVAL -gt 0 ] ; then - echo -e "Exiting."; - exit $RETVAL; -fi - - -if [ $KILLON -gt 0 ] ; then - PIDOF_DOXYGEN=`pidof -x doxygen` - MYPID=$$ - - if [ -z "$PIDOF_DOXYGEN" ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids"; - killall -q -9 doxygen - else - [ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids"; - kill -9 $PIDOF_DOXYGEN &> /dev/null - fi - - [ $QUIETMODE -gt 0 ] || echo -e " * Cleaning up gendox pids"; - killall -q -9 `pidof -x gendox | sed -e s/$MYPID//` &> /dev/null - -fi - -# If the output dir hasn't been set yet... -#if [ -z "$OUTPUTDIR" ] ; then -# OUTPUTDIR="../$(basename `pwd`)-doxygen"; -#fi - -#------------------------------------------------------------------------ -# execute some functions to determine stuff(c) -# Get the perl path (either from the config file, or find it) -#------------------------------------------------------------------------ -get_perlpath; -if [ X"$PERLPATH" == "X" ] ; then - echo -e "\nError: A working install of perl is needed to use doxygen"; - exit 2; -fi -[ $QUIETMODE -gt 0 ] || echo -e " -> Set PERL_PATH to: $PERLPATH"; - -get_dotpath; -[ $QUIETMODE -gt 0 ] || echo -e " -> Set HAVE_DOT to: $HAVEDOT"; -if [ X"$HAVEDOT" == "XYes" ] ; then - [ $QUIETMODE -gt 0 ] || echo -e " -> Set DOT_PATH to: $DOTPATH"; -fi - -get_language; -[ $QUIETMODE -gt 0 ] || echo -e " -> Set OUTPUT_LANGUAGE to: $OUPUTLANGUAGE"; - -get_projectname; -[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NAME to: $PROJECTNAME"; - -get_version; -[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NUMBER to: $VERSION"; -#------------------------------------------------------------------------ -# Got everything we need, now write the DoxyConfig file and run doxygen -#------------------------------------------------------------------------ - -# Clean up first -clean_up; - -# Put the images & reference pages in the right place -move_stuff; -if [ $RETVAL -ge 666 ] ; then - exit 666; -fi - -# Generate the config file -gen_doxyconfig; -if [ $RETVAL -gt 0 ] ; then - echo -e "Error: You are missing critical files." - exit RETVAL; -fi - -# build the reference page and the index -build_extra_html; - -# Generate documentation -RETVAL=0; -run_doxygen; -if [ $RETVAL -gt 0 ] ; then - echo -e "Doxygen error: returned $RETVAL"; - echo -e " Check doxygen.log for details"; -elif [ $RETVAL -lt 0 ] ; then - echo -e "Doxygen error: Doxygen returned $RETVAL"; -fi - -# if the log file is empty, remove it -if [ ! -s ./doxygen.log ] ; then - rm -f ./doxygen.log -fi - -#------------------------------------------------------------------------ -# Done. -#------------------------------------------------------------------------ -[ $QUIETMODE -gt 0 ] || echo -e "Finished..."; -[ $QUIETMODE -gt 0 ] || echo -e "Duration: $SECONDS seconds\n"; - -# echo -e "** Removing output while in debug mode **"; -# echo -e "** Output dir: $OUTPUTDIR **\n"; -# rm -rf $OUTPUTDIR - -exit 0; - +#!/bin/bash +# +# Shell script to make doxygen documentation by specifying a target directory +# on the command line +# +# Gef (gefdavis@dingoblue.net.au) -- August 2001 + +# TODO: +# - Dynamic ChangeLog (page gets updated with each commit) +# - Have the ability to specify server dox or local dox, which will then +# change the content on the main page +# - Incorporate a scaled gtkradiant splash image into the pages + +#------------------------------------------------------------------------ +# Set some variables +#------------------------------------------------------------------------ +# WORKINGDIR=`pwd`; +RETVAL=0; +TARGETSTRING=''; +EXTRAS_PATH="./Doxygen_files"; +CONFIG_OUTPUT="$EXTRAS_PATH/genConf"; +DOXYCONFIG="./DoxyConfig"; +DOXYFILE="$EXTRAS_PATH/Doxyfile"; +NEWDOXYFILE="$EXTRAS_PATH/genDoxyfile"; +declare -a TARGETLIST[$#]; +COUNTER=0; +TARGETCOUNT=0; +QUIETMODE=0; +# added -k command line option to kill running doxygen procs +KILLON=0 + +#------------------------------------------------------------------------ +# load the functions +#------------------------------------------------------------------------ +if [ -f "$EXTRAS_PATH/gendoxfunctions" ] ; then + . $EXTRAS_PATH/gendoxfunctions +else + echo -e "Missing critical files...\n"; + exit 1; +fi + +#------------------------------------------------------------------------ +# parse the command line options +#------------------------------------------------------------------------ +COMLINE="$*"; +OPTCOUNT="$#"; +parse_commandline; +if [ $RETVAL -gt 0 ] ; then + echo -e "Exiting."; + exit $RETVAL; +fi + + +if [ $KILLON -gt 0 ] ; then + PIDOF_DOXYGEN=`pidof -x doxygen` + MYPID=$$ + + if [ -z "$PIDOF_DOXYGEN" ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids"; + killall -q -9 doxygen + else + [ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids"; + kill -9 $PIDOF_DOXYGEN &> /dev/null + fi + + [ $QUIETMODE -gt 0 ] || echo -e " * Cleaning up gendox pids"; + killall -q -9 `pidof -x gendox | sed -e s/$MYPID//` &> /dev/null + +fi + +# If the output dir hasn't been set yet... +#if [ -z "$OUTPUTDIR" ] ; then +# OUTPUTDIR="../$(basename `pwd`)-doxygen"; +#fi + +#------------------------------------------------------------------------ +# execute some functions to determine stuff(c) +# Get the perl path (either from the config file, or find it) +#------------------------------------------------------------------------ +get_perlpath; +if [ X"$PERLPATH" == "X" ] ; then + echo -e "\nError: A working install of perl is needed to use doxygen"; + exit 2; +fi +[ $QUIETMODE -gt 0 ] || echo -e " -> Set PERL_PATH to: $PERLPATH"; + +get_dotpath; +[ $QUIETMODE -gt 0 ] || echo -e " -> Set HAVE_DOT to: $HAVEDOT"; +if [ X"$HAVEDOT" == "XYes" ] ; then + [ $QUIETMODE -gt 0 ] || echo -e " -> Set DOT_PATH to: $DOTPATH"; +fi + +get_language; +[ $QUIETMODE -gt 0 ] || echo -e " -> Set OUTPUT_LANGUAGE to: $OUPUTLANGUAGE"; + +get_projectname; +[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NAME to: $PROJECTNAME"; + +get_version; +[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NUMBER to: $VERSION"; +#------------------------------------------------------------------------ +# Got everything we need, now write the DoxyConfig file and run doxygen +#------------------------------------------------------------------------ + +# Clean up first +clean_up; + +# Put the images & reference pages in the right place +move_stuff; +if [ $RETVAL -ge 666 ] ; then + exit 666; +fi + +# Generate the config file +gen_doxyconfig; +if [ $RETVAL -gt 0 ] ; then + echo -e "Error: You are missing critical files." + exit RETVAL; +fi + +# build the reference page and the index +build_extra_html; + +# Generate documentation +RETVAL=0; +run_doxygen; +if [ $RETVAL -gt 0 ] ; then + echo -e "Doxygen error: returned $RETVAL"; + echo -e " Check doxygen.log for details"; +elif [ $RETVAL -lt 0 ] ; then + echo -e "Doxygen error: Doxygen returned $RETVAL"; +fi + +# if the log file is empty, remove it +if [ ! -s ./doxygen.log ] ; then + rm -f ./doxygen.log +fi + +#------------------------------------------------------------------------ +# Done. +#------------------------------------------------------------------------ +[ $QUIETMODE -gt 0 ] || echo -e "Finished..."; +[ $QUIETMODE -gt 0 ] || echo -e "Duration: $SECONDS seconds\n"; + +# echo -e "** Removing output while in debug mode **"; +# echo -e "** Output dir: $OUTPUTDIR **\n"; +# rm -rf $OUTPUTDIR + +exit 0; + diff --git a/generic_cpp.py b/generic_cpp.py deleted file mode 100644 index 44c78d31..00000000 --- a/generic_cpp.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createCPPTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#include \"" + name + ".h\"\n") - file.write("\n") - file.close() - -if __name__ == "__main__": - name = sys.argv[1] - location = sys.argv[2] - filename = os.path.join(location, name + ".cpp") - createCPPTemplate(filename, name) - svnAddText(filename) diff --git a/generic_h.py b/generic_h.py deleted file mode 100644 index 337f3b03..00000000 --- a/generic_h.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createHeaderTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n") - file.write("#define _INCLUDED_" + name.upper() + "_H_\n") - file.write("\n") - file.write("#endif\n") - -if __name__ == "__main__": - name = sys.argv[1] - location = sys.argv[2] - filename = os.path.join(location, name + ".h") - createHeaderTemplate(filename, name) - svnAddText(filename) diff --git a/generic_module.py b/generic_module.py deleted file mode 100644 index e055e8fa..00000000 --- a/generic_module.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createHeaderTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#if !defined(INCLUDED_" + name.upper() + "_H)\n") - file.write("#define INCLUDED_" + name.upper() + "_H\n") - file.write("\n") - file.write("#endif\n") - -def createCPPTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#include \"" + name + ".h\"\n") - file.write("\n") - file.close() - -if __name__ == "__main__": - if not len(sys.argv) == 2: - print "usage: " + sys.argv[0] + " " - - path = sys.argv[1] - name = os.path.split(path)[1]; - - h = os.path.normpath(path + ".h") - print "writing " + h; - createHeaderTemplate(h, name) - svnAddText(h) - - cpp = os.path.normpath(path + ".cpp") - print "writing " + cpp; - createCPPTemplate(cpp, name) - svnAddText(cpp) - diff --git a/include/aboutmsg.default b/include/aboutmsg.default index 0f536453..2f135e2e 100644 --- a/include/aboutmsg.default +++ b/include/aboutmsg.default @@ -1 +1 @@ -Custom build based on trunk \ No newline at end of file +Custom build by Average Joe diff --git a/include/aboutmsg.h b/include/aboutmsg.h new file mode 100644 index 00000000..33748496 --- /dev/null +++ b/include/aboutmsg.h @@ -0,0 +1,2 @@ +// generated header, see makeversion.py +#define RADIANT_ABOUTMSG "ZeroRadiant build" diff --git a/include/cullable.cpp b/include/cullable.cpp deleted file mode 100644 index 352ea5d6..00000000 --- a/include/cullable.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "cullable.h" - diff --git a/include/cullable.h b/include/cullable.h deleted file mode 100644 index 8e3c71bc..00000000 --- a/include/cullable.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CULLABLE_H) -#define INCLUDED_CULLABLE_H - -#include "generic/constant.h" - -template class BasicVector3; -typedef BasicVector3 Vector3; -class Plane3; -class Matrix4; -class AABB; -class Segment; - -template class EnumeratedValue; -struct VolumeIntersection; -typedef EnumeratedValue VolumeIntersectionValue; - -class VolumeTest -{ -public: - - /// \brief Returns true if \p point intersects volume. - virtual bool TestPoint(const Vector3& point) const = 0; - /// \brief Returns true if \p segment intersects volume. - virtual bool TestLine(const Segment& segment) const = 0; - /// \brief Returns true if \p plane faces towards volume. - virtual bool TestPlane(const Plane3& plane) const = 0; - /// \brief Returns true if \p plane transformed by \p localToWorld faces the viewer. - virtual bool TestPlane(const Plane3& plane, const Matrix4& localToWorld) const = 0; - /// \brief Returns the intersection of \p aabb and volume. - virtual VolumeIntersectionValue TestAABB(const AABB& aabb) const = 0; - /// \brief Returns the intersection of \p aabb transformed by \p localToWorld and volume. - virtual VolumeIntersectionValue TestAABB(const AABB& aabb, const Matrix4& localToWorld) const = 0; - - virtual bool fill() const = 0; - - virtual const Matrix4& GetViewport() const = 0; - virtual const Matrix4& GetProjection() const = 0; - virtual const Matrix4& GetModelview() const = 0; -}; - -class Cullable -{ -public: - STRING_CONSTANT(Name, "Cullable"); - - virtual VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const = 0; -}; - - -#endif diff --git a/include/editable.cpp b/include/editable.cpp deleted file mode 100644 index bcd04d8a..00000000 --- a/include/editable.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "editable.h" - diff --git a/include/editable.h b/include/editable.h deleted file mode 100644 index 9e9bac04..00000000 --- a/include/editable.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_EDITABLE_H) -#define INCLUDED_EDITABLE_H - -template class BasicVector3; -typedef BasicVector3 Vector3; -template class BasicVector4; -typedef BasicVector4 Vector4; -class Matrix4; -typedef Vector4 Quaternion; - -#include "scenelib.h" - -class Editable -{ -public: - STRING_CONSTANT(Name, "Editable"); - - virtual const Matrix4& getLocalPivot() const = 0; -}; - -inline Editable* Node_getEditable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -class Snappable -{ -public: - STRING_CONSTANT(Name, "Snappable"); - - virtual void snapto(float snap) = 0; -}; - -inline Snappable* Node_getSnappable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -#endif diff --git a/include/icamera.cpp b/include/gtkr_list.h similarity index 88% rename from include/icamera.cpp rename to include/gtkr_list.h index 436e93a9..760f09f7 100644 --- a/include/icamera.cpp +++ b/include/gtkr_list.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,5 +19,5 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "icamera.h" - +#include +#include "stl_check.h" diff --git a/include/ieclass.cpp b/include/gtkr_vector.h similarity index 88% rename from include/ieclass.cpp rename to include/gtkr_vector.h index 461edd53..a070cf46 100644 --- a/include/ieclass.cpp +++ b/include/gtkr_vector.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,5 +19,5 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ieclass.h" - +#include +#include "stl_check.h" diff --git a/include/iarchive.cpp b/include/iarchive.cpp deleted file mode 100644 index b975bf05..00000000 --- a/include/iarchive.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iarchive.h" - diff --git a/include/iarchive.h b/include/iarchive.h deleted file mode 100644 index b3f21016..00000000 --- a/include/iarchive.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IARCHIVE_H) -#define INCLUDED_IARCHIVE_H - -#include -#include "generic/constant.h" - -class InputStream; - -/// \brief A file opened in binary mode. -class ArchiveFile -{ -public: - /// \brief Destroys the file object. - virtual void release() = 0; - /// \brief Returns the size of the file data in bytes. - virtual std::size_t size() const = 0; - /// \brief Returns the path to this file (relative to the filesystem root) - virtual const char* getName() const = 0; - /// \brief Returns the stream associated with this file. - /// Subsequent calls return the same stream. - /// The stream may be read forwards until it is exhausted. - /// The stream remains valid for the lifetime of the file. - virtual InputStream& getInputStream() = 0; -}; - -class TextInputStream; - -/// \brief A file opened in text mode. -class ArchiveTextFile -{ -public: - /// \brief Destroys the file object. - virtual void release() = 0; - /// \brief Returns the stream associated with this file. - /// Subsequent calls return the same stream. - /// The stream may be read forwards until it is exhausted. - /// The stream remains valid for the lifetime of the file. - virtual TextInputStream& getInputStream() = 0; -}; - -class ScopedArchiveFile -{ - ArchiveFile& m_file; -public: - ScopedArchiveFile(ArchiveFile& file) : m_file(file) - { - } - ~ScopedArchiveFile() - { - m_file.release(); - } -}; - -class CustomArchiveVisitor; - -class Archive -{ -public: - - class Visitor - { - public: - virtual void visit(const char* name) = 0; - }; - - typedef CustomArchiveVisitor VisitorFunc; - - enum EMode - { - eFiles = 0x01, - eDirectories = 0x02, - eFilesAndDirectories = 0x03, - }; - - /// \brief Destroys the archive object. - /// Any unreleased file object associated with the archive remains valid. */ - virtual void release() = 0; - /// \brief Returns a new object associated with the file identified by \p name, or 0 if the file cannot be opened. - /// Name comparisons are case-insensitive. - virtual ArchiveFile* openFile(const char* name) = 0; - /// \brief Returns a new object associated with the file identified by \p name, or 0 if the file cannot be opened. - /// Name comparisons are case-insensitive. - virtual ArchiveTextFile* openTextFile(const char* name) = 0; - /// Returns true if the file identified by \p name can be opened. - /// Name comparisons are case-insensitive. - virtual bool containsFile(const char* name) = 0; - /// \brief Performs a depth-first traversal of the archive tree starting at \p root. - /// Traverses the entire tree if \p root is "". - /// When a file is encountered, calls \c visitor.file passing the file name. - /// When a directory is encountered, calls \c visitor.directory passing the directory name. - /// Skips the directory if \c visitor.directory returned true. - /// Root comparisons are case-insensitive. - /// Names are mixed-case. - virtual void forEachFile(VisitorFunc visitor, const char* root) = 0; -}; - -class CustomArchiveVisitor -{ - Archive::Visitor* m_visitor; - Archive::EMode m_mode; - std::size_t m_depth; -public: - CustomArchiveVisitor(Archive::Visitor& visitor, Archive::EMode mode, std::size_t depth) - : m_visitor(&visitor), m_mode(mode), m_depth(depth) - { - } - void file(const char* name) - { - if((m_mode & Archive::eFiles) != 0) - m_visitor->visit(name); - } - bool directory(const char* name, std::size_t depth) - { - if((m_mode & Archive::eDirectories) != 0) - m_visitor->visit(name); - if(depth == m_depth) - return true; - return false; - } -}; - -typedef Archive* (*PFN_OPENARCHIVE) (const char* name); - -class _QERArchiveTable -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "archive"); - - PFN_OPENARCHIVE m_pfnOpenArchive; -}; - -template -class Modules; -typedef Modules<_QERArchiveTable> ArchiveModules; - -template -class ModulesRef; -typedef ModulesRef<_QERArchiveTable> ArchiveModulesRef; - -#endif diff --git a/include/ibrush.cpp b/include/ibrush.cpp deleted file mode 100644 index 05dc91ef..00000000 --- a/include/ibrush.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ibrush.h" - diff --git a/include/ibrush.h b/include/ibrush.h index ddc82559..e191ac26 100644 --- a/include/ibrush.h +++ b/include/ibrush.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,109 +19,55 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IBRUSH_H) -#define INCLUDED_IBRUSH_H +#ifndef _IBRUSH_H_ +#define _IBRUSH_H_ -#include "generic/constant.h" -#include "generic/callback.h" -#include "generic/vector.h" -#include "itexdef.h" +// +// API for brush stuff +// -namespace scene +#define BRUSH_MAJOR "brush" +// {c1c3f567-2541-4aa3-9d5b-031fbe2a013b} +static const GUID QERBrushTable_GUID = +{ 0xc1c3f567, 0x2541, 0x4aa3, { 0x9d, 0x5b, 0x03, 0x1f, 0xbe, 0x2a, 0x01, 0x3b } }; + +typedef void (* PFN_BRUSHADDTOLIST) (brush_t *b, brush_t *lst); +typedef void (* PFN_BRUSHBUILD) (brush_t *b, bool bSnap, bool bMarkMap, bool bConvert, bool bFilterTest); +typedef brush_t* (* PFN_BRUSHCREATE) (vec3_t mins, vec3_t maxs, texdef_t *texdef); +typedef void (* PFN_BRUSHFREE) (brush_t *b, bool bRemoveNode); +typedef void (* PFN_BRUSHROTATE) (brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild); +typedef brush_t* (* PFN_BRUSHALLOC) (); +typedef int (* PFN_BPMESSAGEBOX) (int); +typedef face_t* (* PFN_FACEALLOC) (void); +typedef eclass_t* (* PFN_HASMODEL) (brush_t *b); + +struct _QERBrushTable { - class Node; -} - -#if 0 -class IBrushFace -{ -public: - virtual const char* GetShader() const = 0; - virtual void SetShader(const char* name) = 0; - virtual const TextureProjection& GetTexdef() const = 0; - virtual void GetTexdef(TextureProjection& projection) const = 0; - virtual void SetTexdef(const TextureProjection& projection) = 0; - virtual void GetFlags(ContentsFlagsValue& flags) const = 0; - virtual void SetFlags(const ContentsFlagsValue& flags) = 0; - virtual void ShiftTexdef(float s, float t) = 0; - virtual void ScaleTexdef(float s, float t) = 0; - virtual void RotateTexdef(float angle) = 0; - virtual void FitTexture(float s_repeat, float t_repeat) = 0; - virtual bool isDetail() const = 0; - virtual void setDetail(bool detail) = 0; + int m_nSize; + PFN_BRUSHADDTOLIST m_pfnBrush_AddToList; + PFN_BRUSHBUILD m_pfnBrush_Build; + PFN_BRUSHCREATE m_pfnBrush_Create; + PFN_BRUSHFREE m_pfnBrush_Free; + PFN_BRUSHROTATE m_pfnBrush_Rotate; + PFN_BRUSHALLOC m_pfnBrushAlloc; + PFN_BPMESSAGEBOX m_pfnBP_MessageBox; + PFN_FACEALLOC m_pfnFace_Alloc; + PFN_HASMODEL m_pfnHasModel; }; -class IBrush -{ -public: - STRING_CONSTANT(Name, "IBrush"); - virtual void reserve(std::size_t count) = 0; - virtual void clear() = 0; - virtual void copy(const IBrush& other) = 0; - virtual IBrushFace* addPlane(const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection) = 0; - virtual const AABB& localAABB() const = 0; - virtual void removeEmptyFaces() = 0; -}; - -class IBrushFaceInstance -{ -public: - virtual IBrushFace& getFace() = 0; - virtual const IBrushFace& getFace() const = 0; - virtual bool isSelected() const = 0; - virtual void setSelected(SelectionSystem::EComponentMode mode, bool select) const = 0; -}; - -class IBrushInstance -{ -public: - STRING_CONSTANT(Name, "IBrushInstance"); - virtual void forEachFaceInstance(const BrushInstanceVisitor& visitor) = 0; -}; +#ifdef USE_BRUSHTABLE_DEFINE +#ifndef __BRUSHTABLENAME +#define __BRUSHTABLENAME g_BrushTable +#endif +#define Brush_AddToList __BRUSHTABLENAME.m_pfnBrush_AddToList +#define Brush_Build __BRUSHTABLENAME.m_pfnBrush_Build +#define Brush_Create __BRUSHTABLENAME.m_pfnBrush_Create +#define Brush_Free __BRUSHTABLENAME.m_pfnBrush_Free +#define Brush_Rotate __BRUSHTABLENAME.m_pfnBrush_Rotate +#define Brush_Alloc __BRUSHTABLENAME.m_pfnBrushAlloc +#define BP_MessageBox __BRUSHTABLENAME.m_pfnBP_MessageBox +#define Face_Alloc __BRUSHTABLENAME.m_pfnFace_Alloc +#define HasModel __BRUSHTABLENAME.m_pfnHasModel #endif -class _QERFaceData -{ -public: - _QERFaceData() : m_shader(""), contents(0), flags(0), value(0) - { - } - Vector3 m_p0; - Vector3 m_p1; - Vector3 m_p2; - texdef_t m_texdef; - const char* m_shader; - int contents; - int flags; - int value; -}; - -typedef Callback1 BrushFaceDataCallback; - -class BrushCreator -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "brush"); - virtual scene::Node& createBrush() = 0; - virtual bool useAlternativeTextureProjection() const = 0; - virtual void Brush_forEachFace(scene::Node& brush, const BrushFaceDataCallback& callback) = 0; - virtual bool Brush_addFace(scene::Node& brush, const _QERFaceData& faceData) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalBrushModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalBrushModuleRef; - -inline BrushCreator& GlobalBrushCreator() -{ - return GlobalBrushModule::getTable(); -} - #endif diff --git a/include/ibspfrontend.h b/include/ibspfrontend.h new file mode 100644 index 00000000..973f0633 --- /dev/null +++ b/include/ibspfrontend.h @@ -0,0 +1,77 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// interface for BSP frontends plugins +// + +// DONE: - change BSP menu to Q3Build menu ? +// DONE: - detect when Q3Build dies ? +// DELAYED: - hotkeys ! +// SUCCESS: - try again getting feedback from Q3Build + +#ifndef __IBSPFRONTEND_H_ +#define __IBSPFRONTEND_H_ + +// define a GUID for this interface so plugins can access and reference it +// {8ED6A480-BA5E-11d3-A3E3-0004AC96D4C3} +static const GUID QERPlugBSPFrontendTable_GUID = +{ 0x8ed6a480, 0xba5e, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } }; + +// ask the plugin about the items to show up in the BSP menu +typedef char * (WINAPI* PFN_GETBSPMENU) (); +// dispatch a BSP menu command +typedef void (WINAPI* PFN_DISPATCHBSPCOMMAND) (char *); +// this one gets called after a monitoring loop ends +// 0: all good +// 1: timed out / Radiant didn't get the connection +// 2: got a connection, compilation ended with an error +typedef void (WINAPI* PFN_ENDLISTEN) (int status); + +struct _QERPlugBSPFrontendTable +{ + int m_nSize; + PFN_GETBSPMENU m_pfnGetBSPMenu; + PFN_DISPATCHBSPCOMMAND m_pfnDispatchBSPCommand; + PFN_ENDLISTEN m_pfnEndListen; +}; + +// interface provided by Radiant to the plugin +// {A2CCF366-BA60-11d3-A3E3-0004AC96D4C3} +static const GUID QERAppBSPFrontendTable_GUID = +{ 0xa2ccf366, 0xba60, 0x11d3, { 0xa3, 0xe3, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } }; + +typedef char * (WINAPI* PFN_GETMAPNAME) (); +typedef void (WINAPI* PFN_LISTEN) (); +typedef void (WINAPI* PFN_SLEEP) (); + +struct _QERAppBSPFrontendTable +{ + int m_nSize; + PFN_GETMAPNAME m_pfnGetMapName; + PFN_LISTEN m_pfnListen; + PFN_SLEEP m_pfnSleep; + //++timo TODO: needs a hook to reset the debug window (in regular mode it's done at startup of the BSP operation) +}; + +#endif diff --git a/include/icamera.h b/include/icamera.h index c98fdc06..07425ec4 100644 --- a/include/icamera.h +++ b/include/icamera.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,40 +25,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // camera interface // -#if !defined(INCLUDED_ICAMERA_H) -#define INCLUDED_ICAMERA_H +#ifndef __ICAMERA_H_ +#define __ICAMERA_H_ -#include "generic/constant.h" -#include "generic/callbackfwd.h" +#define CAMERA_MAJOR "camera" -class Matrix4; - -class CameraView -{ -public: - virtual void setModelview(const Matrix4& modelview) = 0; - virtual void setFieldOfView(float fieldOfView) = 0; -}; - -class CameraModel -{ -public: - STRING_CONSTANT(Name, "CameraModel"); - virtual void setCameraView(CameraView* view, const Callback& disconnect) = 0; -}; - -template class BasicVector3; -typedef BasicVector3 Vector3; - -typedef void (* PFN_GETCAMERA) ( Vector3& origin, Vector3& angles ); -typedef void (* PFN_SETCAMERA) ( const Vector3& origin, const Vector3& angles ); +typedef void (* PFN_GETCAMERA) ( vec3_t origin, vec3_t angles ); +typedef void (* PFN_SETCAMERA) ( vec3_t origin, vec3_t angles ); typedef void (* PFN_GETCAMWINDOWEXTENTS) ( int *x, int *y, int *width, int *height ); struct _QERCameraTable { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "camera"); - + int m_nSize; PFN_GETCAMERA m_pfnGetCamera; PFN_SETCAMERA m_pfnSetCamera; PFN_GETCAMWINDOWEXTENTS m_pfnGetCamWindowExtents; diff --git a/include/idata.h b/include/idata.h new file mode 100644 index 00000000..fe453366 --- /dev/null +++ b/include/idata.h @@ -0,0 +1,57 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// interface table to access low-level data inside Radiant (brushes, patches and generic editing primitives) + +#ifndef __IDATA_H_ +#define __IDATA_H_ + +// FIXME TTimo this should probably go away and be replaced by a more flat structure +// having to write access functions for every single var is a big annoyance +// see IMapData_t, generalize it? + +#define DATA_MAJOR "data" +// FIXME: remove +// define a GUID for this interface so plugins can access and reference it +// {608A9870-BCE7-11d4-A454-0004AC96D4C3} +static const GUID QERAppDataTable_GUID = +{ 0x608a9870, 0xbce7, 0x11d4, { 0xa4, 0x54, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } }; + + +// pointers to active_brushes, selected_brushes and filtered_brushes +typedef brush_t* (WINAPI* PFN_ACTIVEBRUSHES) (); +typedef brush_t* (WINAPI* PFN_SELECTEDBRUSHES) (); +typedef brush_t* (WINAPI* PFN_FILTEREDBRUSHES) (); +typedef CPtrArray* (WINAPI* PFN_LSTSKINCACHE) (); + +struct _QERAppDataTable +{ + int m_nSize; + PFN_ACTIVEBRUSHES m_pfnActiveBrushes; + PFN_SELECTEDBRUSHES m_pfnSelectedBrushes; + PFN_FILTEREDBRUSHES m_pfnFilteredBrushes; + PFN_LSTSKINCACHE m_pfnLstSkinCache; +}; + +#endif diff --git a/include/idatastream.cpp b/include/idatastream.cpp deleted file mode 100644 index fff02b57..00000000 --- a/include/idatastream.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "idatastream.h" - diff --git a/include/idatastream.h b/include/idatastream.h index c5a28a25..19534aa4 100644 --- a/include/idatastream.h +++ b/include/idatastream.h @@ -1,83 +1,71 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +modifications (c) 2001, Id software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_IDATASTREAM_H) -#define INCLUDED_IDATASTREAM_H +#ifndef _ISTREAM_H_ +#define _ISTREAM_H_ -#include +/*! +API for data streams -class StreamBase +Based on an initial implementation by Loki software +modified to be abstracted and shared across modules + +NOTE: why IDataStream and not IStream? because IStream is defined in windows IDL headers +*/ + +class IDataStream { -public: - typedef std::size_t size_type; - typedef unsigned char byte_type; +public: + IDataStream(); + virtual ~IDataStream(); + + virtual void IncRef () = 0; ///< Increment the number of references to this object + virtual void DecRef () = 0; ///< Decrement the reference count + + virtual unsigned long GetPosition() const = 0; + virtual unsigned long Seek(long lOff, int nFrom) = 0; + virtual void SetLength(unsigned long nNewLen) = 0; + virtual unsigned long GetLength() const = 0; + + virtual char* ReadString(char* pBuf, unsigned long nMax)=0; + virtual unsigned long Read(void* pBuf, unsigned long nCount)=0; + virtual unsigned long Write(const void* pBuf, unsigned long nCount)=0; + virtual int GetChar()=0; + virtual int PutChar(int c)=0; + + virtual void printf(const char*, ...) = 0; ///< completely matches the usual printf behaviour + + virtual void Abort()=0; + virtual void Flush()=0; + virtual void Close()=0; }; -/// \brief A read-only byte-stream. -class InputStream : public StreamBase -{ -public: - /// \brief Attempts to read the next \p length bytes from the stream to \p buffer. - /// Returns the number of bytes actually stored in \p buffer. - virtual size_type read(byte_type* buffer, size_type length) = 0; -}; - -/// \brief A write-only byte-stream. -class OutputStream : public StreamBase -{ -public: - /// \brief Attempts to write \p length bytes to the stream from \p buffer. - /// Returns the number of bytes actually read from \p buffer. - virtual size_type write(const byte_type* buffer, size_type length) = 0; -}; - -class SeekableStream -{ -public: - typedef int offset_type; - typedef std::size_t position_type; - - enum seekdir - { - beg, - cur, - end, - }; - - /// \brief Sets the current \p position of the stream relative to the start. - virtual position_type seek(position_type position) = 0; - /// \brief Sets the current \p position of the stream relative to either the start, end or current position. - virtual position_type seek(offset_type offset, seekdir direction) = 0; - /// \brief Returns the current position of the stream. - virtual position_type tell() const = 0; -}; - -/// \brief A seekable read-only byte-stream. -class SeekableInputStream : public InputStream, public SeekableStream -{ -}; - -/// \brief A seekable write-only byte-stream. -class SeekableOutputStream : public OutputStream, public SeekableStream -{ -}; - -#endif +#endif // _ISTREAM_H_ diff --git a/include/ieclass.h b/include/ieclass.h index 89b86ca9..cb32647c 100644 --- a/include/ieclass.h +++ b/include/ieclass.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,100 +19,66 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/// \file ieclass.h -/// \brief Entity Class definition loader API. +/*! \file ieclass.h + \brief entity files loader API + this describes the APIs involved when loading entity description files + (initially, .def and .fgd) +*/ +#ifndef _IECLASS_H_ +#define _IECLASS_H_ -#if !defined(INCLUDED_IECLASS_H) -#define INCLUDED_IECLASS_H +#define ECLASS_MAJOR "eclass" -#include "generic/constant.h" +typedef void (* PFN_ECLASS_SCANFILE) (char *filename); +typedef const char* (* PFN_ECLASS_GETEXTENSION) (); -#define MAX_FLAGS 16 - -// eclass show flags - -#define ECLASS_LIGHT 0x00000001 -#define ECLASS_ANGLE 0x00000002 -#define ECLASS_PATH 0x00000004 -#define ECLASS_MISCMODEL 0x00000008 - -class Shader; - -class EntityClass; -class ListAttributeType; - -class EntityClassCollector +struct _EClassTable { -public: - virtual void insert(EntityClass* eclass) = 0; - virtual void insert(const char* name, const ListAttributeType& list) - { - } + int m_nSize; + PFN_ECLASS_SCANFILE m_pfnScanFile; + PFN_ECLASS_GETEXTENSION m_pfnGetExtension; }; -struct EntityClassScanner -{ - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "eclass"); +#ifdef USE_ECLASSTABLE_DEFINE +#ifndef __ECLASSTABLENAME +#define __ECLASSTABLENAME g_EClassTable +#endif +#define EClass_ScanFile __ECLASSTABLENAME.m_pfnEClass_ScanFile +#define EClass_GetExtension __ECLASSTABLENAME.m_pfnEClass_GetExtension +#endif - void (*scanFile)(EntityClassCollector& collector, const char* filename); - const char* (*getExtension)(); +#define ECLASSMANAGER_MAJOR "eclassmanager" + +typedef void (* PFN_ECLASS_INSERTALPHABETIZED) (eclass_t *e); +typedef eclass_t** (* PFN_GET_ECLASS_E) (); +typedef void (* PFN_SET_ECLASS_FOUND) (qboolean); +typedef qboolean (* PFN_GET_PARSING_SINGLE) (); +typedef eclass_t* (* PFN_ECLASS_CREATE) (const char *name, float col1, float col2, float col3, const vec3_t *mins, const vec3_t *maxs, const char *comments); +typedef eclass_t* (* PFN_ECLASS_FORNAME) (const char* name, qboolean has_brushes); + +struct _EClassManagerTable +{ + int m_nSize; + PFN_ECLASS_INSERTALPHABETIZED m_pfnEclass_InsertAlphabetized; + PFN_GET_ECLASS_E m_pfnGet_Eclass_E; + PFN_SET_ECLASS_FOUND m_pfnSet_Eclass_Found; + PFN_GET_PARSING_SINGLE m_pfnGet_Parsing_Single; + PFN_ECLASS_CREATE m_pfnEClass_Create; + PFN_ECLASS_FORNAME m_pfnEclass_ForName; }; -#include "modulesystem.h" - -template -class ModuleRef; -typedef ModuleRef EClassModuleRef; - -template -class Modules; -typedef Modules EClassModules; - -template -class ModulesRef; -typedef ModulesRef EClassModulesRef; - - - - - - -class EntityClassVisitor -{ -public: - virtual void visit(EntityClass* eclass) = 0; -}; - -class ModuleObserver; - - -struct EntityClassManager -{ - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "eclassmanager"); - - EntityClass* (*findOrInsert)(const char* name, bool has_brushes); - const ListAttributeType* (*findListType)(const char* name); - void (*forEach)(EntityClassVisitor& visitor); - void (*attach)(ModuleObserver& observer); - void (*detach)(ModuleObserver& observer); - void (*realise)(); - void (*unrealise)(); -}; - -template -class GlobalModule; -typedef GlobalModule GlobalEntityClassManagerModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalEntityClassManagerModuleRef; - -inline EntityClassManager& GlobalEntityClassManager() -{ - return GlobalEntityClassManagerModule::getTable(); -} +#ifdef USE_ECLASSMANAGER_DEFINE +#ifndef __ECLASSMANAGERTABLENAME +#define __ECLASSMANAGERTABLENAME g_EClassManagerTable +#endif +#define Eclass_InsertAlphabetized __ECLASSMANAGERTABLENAME.m_pfnEclass_InsertAlphabetized +#define Get_Eclass_E __ECLASSMANAGERTABLENAME.m_pfnGet_Eclass_E +#define Set_Eclass_Found __ECLASSMANAGERTABLENAME.m_pfnSet_Eclass_Found +#define Get_Parsing_Single __ECLASSMANAGERTABLENAME.m_pfnGet_Parsing_Single +#define EClass_Create __ECLASSMANAGERTABLENAME.m_pfnEClass_Create +#define Eclass_ForName __ECLASSMANAGERTABLENAME.m_pfnEclass_ForName +#endif #endif + diff --git a/include/ientity.cpp b/include/ientity.cpp deleted file mode 100644 index 0a2eef32..00000000 --- a/include/ientity.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ientity.h" - diff --git a/include/ientity.h b/include/ientity.h index 444e377d..015cf1ec 100644 --- a/include/ientity.h +++ b/include/ientity.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,136 +19,98 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IENTITY_H) -#define INCLUDED_IENTITY_H +#ifndef _IENTITY_H_ +#define _IENTITY_H_ -#include "generic/constant.h" +// +// API for entity manip stuff +// -#include "string/string.h" -#include "scenelib.h" +// FIXME TTimo this prolly needs to merge with iepairs.h? -class EntityClass; +/*! +SPoG +generic "entity" module... +at first, there will only be one implementation for all entities, +perhaps later there will be one for each entity type? +it would probably make more sense to have a single implementation, +a generic one that is very flexible and can adapt the visualisation of +itself depending on an xml config specified in the entity definitions file +*/ +#define ENTITY_MAJOR "entity" +// {A1C9F9FD-75D5-4e4d-9D65-235D6D3F254C} +static const GUID QEREntityTable_GUID = +{ 0xa1c9f9fd, 0x75d5, 0x4e4d, { 0x9d, 0x65, 0x23, 0x5d, 0x6d, 0x3f, 0x25, 0x4c } }; -typedef Callback1 KeyObserver; +typedef entity_t* (* PFN_ENTITYALLOC) (); +typedef void (* PFN_ENTITYFREE) (entity_t *e); +typedef entity_t* (* PFN_ENTITYCREATE) (eclass_t *c); +typedef entity_t* (* PFN_ENTITYCLONE) (entity_t *e); +typedef void (* PFN_ENTITYSETKEYVALUE) (entity_t *ent, const char *key, const char *value); +typedef void (* PFN_ENTITYDELETEKEY) (entity_t *ent, const char *key); +typedef const char* (* PFN_ENTITYVALUEFORKEY) (entity_t *ent, const char *key); +typedef float (* PFN_ENTITYFLOATFORKEY) (entity_t *ent, const char *key); +typedef int (* PFN_ENTITYINTFORKEY) (entity_t *ent, const char *key); +typedef void (* PFN_ENTITYVECTORFORKEY) (entity_t *ent, const char *key, vec3_t vec); +typedef void (* PFN_ENTITYADDTOLIST) (entity_t *e, entity_t *lst); +typedef void (* PFN_ENTITYREMOVEFROMLIST) (entity_t *e); +typedef void (* PFN_ENTITYLINKBRUSH) (entity_t *e, brush_t *b); +typedef void (* PFN_ENTITYUNLINKBRUSH) (brush_t *b); +typedef void (* PFN_ENTITYDRAWLIGHT) (entity_t* e, int nGLState, int pref, int nViewType); +typedef int (* PFN_ENTITYMEMORYSIZE) (entity_t *e); +typedef void (* PFN_ENTITYUPDATEMODEL) (entity_t *e); +typedef epair_t* (* PFN_ALLOCATEEPAIR) (const char *key, const char *value); +typedef epair_t** (* PFN_GETENTITYKEYVALLIST) (entity_t *e); +typedef void (* PFN_SETENTITYKEYVALLIST) (entity_t *e, epair_t* ep); -class EntityKeyValue + +struct _QEREntityTable { -public: - virtual const char* c_str() const = 0; - virtual void assign(const char* other) = 0; - virtual void attach(const KeyObserver& observer) = 0; - virtual void detach(const KeyObserver& observer) = 0; + int m_nSize; + PFN_ENTITYALLOC m_pfnEntity_Alloc; + PFN_ENTITYFREE m_pfnEntity_Free; + PFN_ENTITYCREATE m_pfnEntity_Create; + PFN_ENTITYCLONE m_pfnEntity_Clone; + PFN_ENTITYSETKEYVALUE m_pfnSetKeyValue; + PFN_ENTITYDELETEKEY m_pfnDeleteKey; + PFN_ENTITYVALUEFORKEY m_pfnValueForKey; + PFN_ENTITYFLOATFORKEY m_pfnFloatForKey; + PFN_ENTITYINTFORKEY m_pfnIntForKey; + PFN_ENTITYVECTORFORKEY m_pfnGetVectorForKey; + PFN_ENTITYADDTOLIST m_pfnEntity_AddToList; + PFN_ENTITYREMOVEFROMLIST m_pfnEntity_RemoveFromList; + PFN_ENTITYLINKBRUSH m_pfnEntity_LinkBrush; + PFN_ENTITYUNLINKBRUSH m_pfnEntity_UnlinkBrush; + PFN_ENTITYDRAWLIGHT m_pfnDrawLight; + PFN_ENTITYMEMORYSIZE m_pfnEntity_MemorySize; + PFN_ALLOCATEEPAIR m_pfnAllocateEpair; + PFN_GETENTITYKEYVALLIST m_pfnGetEntityKeyValList; + PFN_SETENTITYKEYVALLIST m_pfnSetEntityKeyValList; }; -class Entity -{ -public: - STRING_CONSTANT(Name, "Entity"); - - class Observer - { - public: - virtual void insert(const char* key, EntityKeyValue& value) = 0; - virtual void erase(const char* key, EntityKeyValue& value) = 0; - virtual void clear() { }; - }; - - class Visitor - { - public: - virtual void visit(const char* key, const char* value) = 0; - }; - - virtual const EntityClass& getEntityClass() const = 0; - virtual void forEachKeyValue(Visitor& visitor) const = 0; - virtual void setKeyValue(const char* key, const char* value) = 0; - virtual const char* getKeyValue(const char* key) const = 0; - virtual bool isContainer() const = 0; - virtual void attach(Observer& observer) = 0; - virtual void detach(Observer& observer) = 0; -}; - -class EntityCopyingVisitor : public Entity::Visitor -{ - Entity& m_entity; -public: - EntityCopyingVisitor(Entity& entity) - : m_entity(entity) - { - } - - void visit(const char* key, const char* value) - { - if(!string_equal(key, "classname")) - { - m_entity.setKeyValue(key, value); - } - } -}; - -inline Entity* Node_getEntity(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - - -template -class Stack; -template -class Reference; - -namespace scene -{ - class Node; -} - -typedef Reference NodeReference; - -namespace scene -{ - typedef Stack Path; -} - -class Counter; - -class EntityCreator -{ -public: - INTEGER_CONSTANT(Version, 2); - STRING_CONSTANT(Name, "entity"); - - virtual scene::Node& createEntity(EntityClass* eclass) = 0; - - typedef void (*KeyValueChangedFunc)(); - virtual void setKeyValueChangedFunc(KeyValueChangedFunc func) = 0; - - virtual void setCounter(Counter* counter) = 0; - - virtual void connectEntities(const scene::Path& e1, const scene::Path& e2) = 0; - - virtual void setLightRadii(bool lightRadii) = 0; - virtual bool getLightRadii() = 0; - virtual void setShowNames(bool showNames) = 0; - virtual bool getShowNames() = 0; - virtual void setShowAngles(bool showAngles) = 0; - virtual bool getShowAngles() = 0; - - virtual void printStatistics() const = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalEntityModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalEntityModuleRef; - -inline EntityCreator& GlobalEntityCreator() -{ - return GlobalEntityModule::getTable(); -} +#ifdef USE_ENTITYTABLE_DEFINE +#ifndef __ENTITYTABLENAME +#define __ENTITYTABLENAME g_EntityTable +#endif +#define Entity_Alloc __ENTITYTABLENAME.m_pfnEntity_Alloc +#define Entity_Free __ENTITYTABLENAME.m_pfnEntity_Free +#define Entity_Clone __ENTITYTABLENAME.m_pfnEntity_Clone +#define SetKeyValue __ENTITYTABLENAME.m_pfnSetKeyValue +#define DeleteKey __ENTITYTABLENAME.m_pfnDeleteKey +#define ValueForKey __ENTITYTABLENAME.m_pfnValueForKey +#define FloatForKey __ENTITYTABLENAME.m_pfnFloatForKey +#define IntForKey __ENTITYTABLENAME.m_pfnIntForKey +#define GetVectorForKey __ENTITYTABLENAME.m_pfnGetVectorForKey +#define Entity_AddToList __ENTITYTABLENAME.m_pfnEntity_AddToList +#define Entity_RemoveFromList __ENTITYTABLENAME.m_pfnEntity_RemoveFromList +#define Entity_LinkBrush __ENTITYTABLENAME.m_pfnEntity_LinkBrush +#define Entity_UnlinkBrush __ENTITYTABLENAME.m_pfnEntity_UnlinkBrush +#define DrawLight __ENTITYTABLENAME.m_pfnDrawLight +#define Entity_MemorySize __ENTITYTABLENAME.m_pfnEntity_MemorySize +#define Entity_AllocateEpair __ENTITYTABLENAME.m_pfnAllocateEpair +#define Entity_GetKeyValList __ENTITYTABLENAME.m_pfnGetEntityKeyValList +#define Entity_SetKeyValList __ENTITYTABLENAME.m_pfnSetEntityKeyValList +#endif #endif + diff --git a/include/ifilesystem.cpp b/include/ifilesystem.cpp deleted file mode 100644 index d941113c..00000000 --- a/include/ifilesystem.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ifilesystem.h" - diff --git a/include/ifilesystem.h b/include/ifilesystem.h index 339c82f1..e9c3e725 100644 --- a/include/ifilesystem.h +++ b/include/ifilesystem.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,115 +19,122 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IFILESYSTEM_H) -#define INCLUDED_IFILESYSTEM_H +#ifndef _IFILESYSTEM_H_ +#define _IFILESYSTEM_H_ -#include -#include "generic/constant.h" -#include "generic/callbackfwd.h" +// +// Plugin interface for the virtual filesystem used by Radiant +// -typedef Callback1 ArchiveNameCallback; -typedef Callback1 FileNameCallback; - -class ArchiveFile; -class ArchiveTextFile; -class Archive; - -class ModuleObserver; - -typedef struct _GSList GSList; - -/// The Virtual File System. -class VirtualFileSystem -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "VFS"); - - /// \brief Adds a root search \p path. - /// Called before \c initialise. - virtual void initDirectory(const char *path) = 0; - /// \brief Initialises the filesystem. - /// Called after all root search paths have been added. - virtual void initialise() = 0; - /// \brief Shuts down the filesystem. - virtual void shutdown() = 0; - - /// \brief Returns the file identified by \p filename opened in binary mode, or 0 if not found. - /// The caller must \c release() the file returned if it is not 0. - virtual ArchiveFile* openFile(const char* filename) = 0; - /// \brief Returns the file identified by \p filename opened in text mode, or 0 if not found. - /// The caller must \c release() the file returned if it is not 0. - virtual ArchiveTextFile* openTextFile(const char* filename) = 0; - - /// \brief Opens the file identified by \p filename and reads it into \p buffer, or sets *\p buffer to 0 if not found. - /// Returns the size of the buffer allocated, or undefined value if *\p buffer is 0; - /// The caller must free the allocated buffer by calling \c freeFile - /// \deprecated Deprecated - use \c openFile. - virtual std::size_t loadFile(const char *filename, void **buffer) = 0; - /// \brief Frees the buffer returned by \c loadFile. - /// \deprecated Deprecated. - virtual void freeFile(void *p) = 0; - - /// \brief Calls \p callback for each directory under \p basedir. - virtual void forEachDirectory(const char* basedir, const FileNameCallback& callback, std::size_t depth = 1) = 0; - /// \brief Calls \p callback for each file under \p basedir matching \p extension. - /// Use "*" as \p extension to match all file extensions. - virtual void forEachFile(const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth = 1) = 0; - - /// \brief Returns a list containing the relative names of all the directories under \p basedir. - /// The caller must free the returned list by calling \c clearFileDirList; - /// \deprecated Deprecated - use \c forEachDirectory. - virtual GSList* getDirList(const char *basedir) = 0; - /// \brief Returns a list containing the relative names of the files under \p basedir (\p extension can be "*" for all files). - /// The caller must free the returned list by calling \c clearFileDirList. - /// \deprecated Deprecated - use \c forEachFile. - virtual GSList* getFileList(const char *basedir, const char *extension) = 0; - /// \brief Frees the \p list returned from \c getDirList or \c getFileList. - /// \deprecated Deprecated. - virtual void clearFileDirList(GSList **list) = 0; - - /// \brief Returns the absolute filename for a relative \p name, or "" if not found. - virtual const char* findFile(const char* name) = 0; - /// \brief Returns the filesystem root for an absolute \p name, or "" if not found. - /// This can be used to convert an absolute name to a relative name. - virtual const char* findRoot(const char* name) = 0; - - /// \brief Attach an \p observer whose realise() and unrealise() methods will be called when the filesystem is initialised or shut down. - virtual void attach(ModuleObserver& observer) = 0; - /// \brief Detach an \p observer previously-attached by calling \c attach. - virtual void detach(ModuleObserver& observer) = 0; - - virtual Archive* getArchive(const char* archiveName) = 0; - virtual void forEachArchive(const ArchiveNameCallback& callback) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalFileSystemModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalFileSystemModuleRef; - -inline VirtualFileSystem& GlobalFileSystem() -{ - return GlobalFileSystemModule::getTable(); -} - - -/// \deprecated Use \c openFile. -inline int vfsLoadFile(const char* filename, void** buffer, int index = 0) -{ - return static_cast(GlobalFileSystem().loadFile(filename, buffer)); -}; - -/// \deprecated Deprecated. -inline void vfsFreeFile(void* p) -{ - GlobalFileSystem().freeFile(p); -} +// NOTE: If you want to write a VFS plugin then you must export +// "QERPlug_ListInterfaces" and "QERPlug_RequestInterface" +// (see qerplugin.h for more information) +#ifdef _WIN32 +#define VFS_NATIVESEPARATOR '\\' +#else +#define VFS_NATIVESEPARATOR '/' #endif + +#define VFS_MAJOR "VFS" + +// return the file system supported by the plugin, for example: "quake1" or "quake3" +//typedef const char* (WINAPI* PFN_VFSGETFORMAT) (); +// add all files from a directory to the vfs +typedef void (* PFN_VFSINITDIRECTORY) (const char *path); +// free all resources used by the plugin +typedef void (* PFN_VFSSHUTDOWN) (); +// free memory allocated by VFS for this pointer +typedef void (* PFN_VFSFREEFILE) (void *p); +// return a GSList with all the directories under basedir +typedef GSList* (* PFN_VFSGETDIRLIST) (const char *basedir); +// return a GSList with all the files under basedir (extension can be NULL) +typedef GSList* (* PFN_VFSGETFILELIST) (const char *basedir, const char *extension); +// free a dirlist or filelist returned from one of the above functions +typedef void (* PFN_VFSCLEARFILEDIRLIST) (GSList **lst); +#define VFS_SEARCH_PAK 0x1 +#define VFS_SEARCH_DIR 0x2 +/*! +\brief return the number of files with the exact name described in filename +there can be several hits for a given file, or this can be used to check for existence +\param flags is optional and can be used with VFS_SEARCH_* bits, if flag is 0, everything is searched, else only the specified bits +paks are searched first, then search directories +*/ +typedef int (* PFN_VFSGETFILECOUNT) (const char *filename, int flags); +/*! +\brief load file, allocate buffer +\return -1 if fails or the size of the buffer allocated +\param index is used to load the i-th file in the search directories (see vfsGetFileCount) +this will scan in the search directories first, then it will search in the pak files +WARNING: the allocated buffer must be freed with a g_free call +NOTE TTimo: the g_free release is utter horror + see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=491 +*/ +typedef int (* PFN_VFSLOADFILE) (const char *filename, void **buffer, int index); +// load a file from it's full path into the buffer, returns the file size or -1 +// the allocated buffer must be freed with a g_free call +typedef int (* PFN_VFSLOADFULLPATHFILE) (const char *filename, void **buffer); +// takes an absolute file path, returns a shortened relative file path if the absolute path matches a valid basedir or NULL if an error occured +typedef char* (* PFN_VFSEXTRACTRELATIVEPATH) (const char *in); +/*! +\return the full path (in a static buff) to a file given it's relative path (NULL if not found) +\param index if several files are matching (as returned in a call to vfsGetFileCount), get the index-th file +\param flag 0 or a combination of VFS_SEARCH_PAK or VFS_SEARCH_DIR +HYDRA: + this now searches VFS/PAK files in addition to the filesystem + if FLAG is 0 then ONLY dirs are searched. + PAK's are searched before DIRs to mimic engine behaviour + index is ignored when searching PAK files. + when searching VFS, files are searched case insensitive. + +WARNING: if you use index from vfsGetFileCount, it works only with a vfsGetFileCount for the search directories only (not the pak files) +FIXME TTimo our VFS names are case insensitive. + this function is not able to build the full path from case-insensitive name + ( this is http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 ) +*/ +typedef char* (* PFN_VFSGETFULLPATH) (const char *in, int index, int flag); +/*! +these return a static char*, doesn't need to be freed or anything +get the base path to use when raising file dialogs +we manually add "maps/" or "sounds/" or "mapobjects/models/" etc. +FIXME: I'm not sure this is used / relevant anymore +*/ +typedef const char* (* PFN_VFSBASEPROMPTPATH) (); + +// VFS API +struct _QERFileSystemTable +{ + int m_nSize; + PFN_VFSINITDIRECTORY m_pfnInitDirectory; + PFN_VFSSHUTDOWN m_pfnShutdown; + PFN_VFSFREEFILE m_pfnFreeFile; + PFN_VFSGETDIRLIST m_pfnGetDirList; + PFN_VFSGETFILELIST m_pfnGetFileList; + PFN_VFSCLEARFILEDIRLIST m_pfnClearFileDirList; + PFN_VFSGETFILECOUNT m_pfnGetFileCount; + PFN_VFSLOADFILE m_pfnLoadFile; + PFN_VFSLOADFULLPATHFILE m_pfnLoadFullPathFile; + PFN_VFSEXTRACTRELATIVEPATH m_pfnExtractRelativePath; + PFN_VFSGETFULLPATH m_pfnGetFullPath; + PFN_VFSBASEPROMPTPATH m_pfnBasePromptPath; +}; + +#ifdef USE_VFSTABLE_DEFINE +#ifndef __VFSTABLENAME +#define __VFSTABLENAME g_FileSystemTable +#endif +#define vfsInitDirectory __VFSTABLENAME.m_pfnInitDirectory +#define vfsShutdown __VFSTABLENAME.m_pfnShutdown +#define vfsFreeFile __VFSTABLENAME.m_pfnFreeFile +#define vfsGetDirList __VFSTABLENAME.m_pfnGetDirList +#define vfsGetFileList __VFSTABLENAME.m_pfnGetFileList +#define vfsClearFileDirList __VFSTABLENAME.m_pfnClearFileDirList +#define vfsGetFileCount __VFSTABLENAME.m_pfnGetFileCount +#define vfsLoadFile __VFSTABLENAME.m_pfnLoadFile +#define vfsLoadFullPathFile __VFSTABLENAME.m_pfnLoadFullPathFile +#define vfsExtractRelativePath __VFSTABLENAME.m_pfnExtractRelativePath +#define vfsGetFullPath __VFSTABLENAME.m_pfnGetFullPath +#define vfsBasePromptPath __VFSTABLENAME.m_pfnBasePromptPath +#endif + +#endif // _IFILESYSTEM_H_ diff --git a/include/ifiletypes.cpp b/include/ifiletypes.cpp deleted file mode 100644 index 1d151586..00000000 --- a/include/ifiletypes.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ifiletypes.h" - diff --git a/include/ifiletypes.h b/include/ifiletypes.h deleted file mode 100644 index e2851be2..00000000 --- a/include/ifiletypes.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IFILETYPES_H) -#define INCLUDED_IFILETYPES_H - -#include "generic/constant.h" - -class filetype_t -{ -public: - filetype_t() - : name(""), pattern("") - { - } - filetype_t(const char* _name, const char* _pattern) - : name(_name), pattern(_pattern) - { - } - const char* name; - const char* pattern; -}; - - -class IFileTypeList -{ -public: - virtual void addType(const char* moduleName, filetype_t type) = 0; -}; - -class IFileTypeRegistry -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "filetypes"); - - virtual void addType(const char* moduleType, const char* moduleName, filetype_t type) = 0; - virtual void getTypeList(const char* moduleType, IFileTypeList* typelist) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalFiletypesModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalFiletypesModuleRef; - -inline IFileTypeRegistry& GlobalFiletypes() -{ - return GlobalFiletypesModule::getTable(); -} - - - -#endif diff --git a/include/ifilter.cpp b/include/ifilter.cpp deleted file mode 100644 index 1472a935..00000000 --- a/include/ifilter.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ifilter.h" - diff --git a/include/ifilter.h b/include/ifilter.h deleted file mode 100644 index 90619673..00000000 --- a/include/ifilter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IFILTER_H) -#define INCLUDED_IFILTER_H - -#include "generic/constant.h" - -enum -{ - EXCLUDE_WORLD = 0x00000001, - EXCLUDE_ENT = 0x00000002, - EXCLUDE_CURVES = 0x00000004, - EXCLUDE_TRANSLUCENT = 0x00000008, - EXCLUDE_LIQUIDS = 0x00000010, - EXCLUDE_CAULK = 0x00000020, - EXCLUDE_CLIP = 0x00000040, - EXCLUDE_PATHS = 0x00000080, - EXCLUDE_LIGHTS = 0x00000100, - EXCLUDE_DETAILS = 0x00000200, - EXCLUDE_HINTSSKIPS = 0x00000400, - EXCLUDE_MODELS = 0x00000800, - EXCLUDE_AREAPORTALS = 0x00001000, - EXCLUDE_TRIGGERS = 0x00002000, - EXCLUDE_CLUSTERPORTALS = 0x00004000, - EXCLUDE_TERRAIN = 0x00008000, - EXCLUDE_LIGHTGRID = 0x00010000, - EXCLUDE_STRUCTURAL = 0x00020000, - EXCLUDE_BOTCLIP = 0x00040000, - EXCLUDE_VISPORTALS = 0x00080000, -}; - -class Filter -{ -public: - virtual void setActive(bool active) = 0; -}; - -class Filterable -{ -public: - virtual void updateFiltered() = 0; -}; - -class FilterSystem -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "filters"); - virtual void addFilter(Filter& filter, int mask) = 0; - virtual void registerFilterable(Filterable& filterable) = 0; - virtual void unregisterFilterable(Filterable& filterable) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalFilterModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalFilterModuleRef; - -inline FilterSystem& GlobalFilterSystem() -{ - return GlobalFilterModule::getTable(); -} - -#endif diff --git a/plugins/md3model/md3normals.h b/include/ifilters.h similarity index 60% rename from plugins/md3model/md3normals.h rename to include/ifilters.h index ed8c5b04..7b4d90f9 100644 --- a/plugins/md3model/md3normals.h +++ b/include/ifilters.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,27 +19,27 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_MD3NORMALS_H) -#define INCLUDED_MD3NORMALS_H -#include "render.h" +// +// Plugin interface for handling filters +// -typedef unsigned char byte; +#ifndef _IFILTER_H_ +#define _IFILTER_H_ -// latitude-longditude to normal conversion -inline Normal3f DecodeNormal(const byte bytes[2]) +#define FILTER_MAJOR "filter" + +// adds a new filter +typedef bfilter_t* (* PFN_QERPLUG_FILTERADD) (int type, int bmask, char *str, int exclude); + +// performs the filtering +typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void); + +struct _QERPlugFilterTable { - double lat = bytes[0] * (c_pi/128.0); - double lng = bytes[1] * (c_pi/128.0); - - return Normal3f( - static_cast(cos(lat) * sin(lng)), - static_cast(sin(lat) * sin(lng)), - static_cast(cos(lng)) - ); -} - -#endif - - + int m_nSize; + PFN_QERPLUG_FILTERADD m_pfnFilterAdd; + PFN_QERPLUG_FILTERACTIVATE m_pfnFiltersActivate; +}; +#endif // _IFILTER_H_ diff --git a/include/igl.cpp b/include/igl.cpp deleted file mode 100644 index 170022ee..00000000 --- a/include/igl.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "igl.h" - diff --git a/include/igl.h b/include/igl.h index 8cd81f86..e657241f 100644 --- a/include/igl.h +++ b/include/igl.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,2814 +19,250 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IGL_H) -#define INCLUDED_IGL_H +//----------------------------------------------------------------------------- +// +// +// DESCRIPTION: +// all purpose OpenGL interface for Q3Radiant plugins +// -#include -#include -#include "generic/constant.h" +#ifndef __IGL_H__ +#define __IGL_H__ -#if defined(WIN32) -#define QGL_DLLEXPORT __stdcall -#else -#define QGL_DLLEXPORT +#if defined (__linux__) || defined (__APPLE__) +#include #endif -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef signed char GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void GLvoid; - -#if !defined(GL_VERSION_1_1) -#define GL_VERSION_1_1 1 - -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_TRUE 1 -#define GL_FALSE 0 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 -#define GL_ACCUM 0x0100 -#define GL_LOAD 0x0101 -#define GL_RETURN 0x0102 -#define GL_MULT 0x0103 -#define GL_ADD 0x0104 -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A -#define GL_NONE 0 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LIST_MODE 0x0B30 -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_SHADE_MODEL 0x0B54 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_FOG 0x0B60 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_COLOR 0x0B66 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_MATRIX_MODE 0x0BA0 -#define GL_NORMALIZE 0x0BA1 -#define GL_VIEWPORT 0x0BA2 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_FUNC 0x0BC1 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_INDEX_MODE 0x0C30 -#define GL_RGBA_MODE 0x0C31 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_RENDER_MODE 0x0C40 -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_INDEX_BITS 0x0D51 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_EMISSION 0x1600 -#define GL_SHININESS 0x1601 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_COLOR_INDEX 0x1900 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_BITMAP 0x1A00 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_RENDER 0x1C00 -#define GL_FEEDBACK 0x1C01 -#define GL_SELECT 0x1C02 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_S 0x2000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 -#define GL_MODULATE 0x2100 -#define GL_DECAL 0x2101 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_ENV 0x2300 -#define GL_EYE_LINEAR 0x2400 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_SPHERE_MAP 0x2402 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_PLANE 0x2502 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_CLAMP 0x2900 -#define GL_REPEAT 0x2901 -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000fffff -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D - -#define glAccum GlobalOpenGL().m_glAccum -#define glAlphaFunc GlobalOpenGL().m_glAlphaFunc -#define glAreTexturesResident GlobalOpenGL().m_glAreTexturesResident -#define glArrayElement GlobalOpenGL().m_glArrayElement -#define glBegin GlobalOpenGL().m_glBegin -#define glBindTexture GlobalOpenGL().m_glBindTexture -#define glBitmap GlobalOpenGL().m_glBitmap -#define glBlendFunc GlobalOpenGL().m_glBlendFunc -#define glCallList GlobalOpenGL().m_glCallList -#define glCallLists GlobalOpenGL().m_glCallLists -#define glClear GlobalOpenGL().m_glClear -#define glClearAccum GlobalOpenGL().m_glClearAccum -#define glClearColor GlobalOpenGL().m_glClearColor -#define glClearDepth GlobalOpenGL().m_glClearDepth -#define glClearIndex GlobalOpenGL().m_glClearIndex -#define glClearStencil GlobalOpenGL().m_glClearStencil -#define glClipPlane GlobalOpenGL().m_glClipPlane -#define glColor3b GlobalOpenGL().m_glColor3b -#define glColor3bv GlobalOpenGL().m_glColor3bv -#define glColor3d GlobalOpenGL().m_glColor3d -#define glColor3dv GlobalOpenGL().m_glColor3dv -#define glColor3f GlobalOpenGL().m_glColor3f -#define glColor3fv GlobalOpenGL().m_glColor3fv -#define glColor3i GlobalOpenGL().m_glColor3i -#define glColor3iv GlobalOpenGL().m_glColor3iv -#define glColor3s GlobalOpenGL().m_glColor3s -#define glColor3sv GlobalOpenGL().m_glColor3sv -#define glColor3ub GlobalOpenGL().m_glColor3ub -#define glColor3ubv GlobalOpenGL().m_glColor3ubv -#define glColor3ui GlobalOpenGL().m_glColor3ui -#define glColor3uiv GlobalOpenGL().m_glColor3uiv -#define glColor3us GlobalOpenGL().m_glColor3us -#define glColor3usv GlobalOpenGL().m_glColor3usv -#define glColor4b GlobalOpenGL().m_glColor4b -#define glColor4bv GlobalOpenGL().m_glColor4bv -#define glColor4d GlobalOpenGL().m_glColor4d -#define glColor4dv GlobalOpenGL().m_glColor4dv -#define glColor4f GlobalOpenGL().m_glColor4f -#define glColor4fv GlobalOpenGL().m_glColor4fv -#define glColor4i GlobalOpenGL().m_glColor4i -#define glColor4iv GlobalOpenGL().m_glColor4iv -#define glColor4s GlobalOpenGL().m_glColor4s -#define glColor4sv GlobalOpenGL().m_glColor4sv -#define glColor4ub GlobalOpenGL().m_glColor4ub -#define glColor4ubv GlobalOpenGL().m_glColor4ubv -#define glColor4ui GlobalOpenGL().m_glColor4ui -#define glColor4uiv GlobalOpenGL().m_glColor4uiv -#define glColor4us GlobalOpenGL().m_glColor4us -#define glColor4usv GlobalOpenGL().m_glColor4usv -#define glColorMask GlobalOpenGL().m_glColorMask -#define glColorMaterial GlobalOpenGL().m_glColorMaterial -#define glColorPointer GlobalOpenGL().m_glColorPointer -#define glCopyPixels GlobalOpenGL().m_glCopyPixels -#define glCopyTexImage1D GlobalOpenGL().m_glCopyTexImage1D -#define glCopyTexImage2D GlobalOpenGL().m_glCopyTexImage2D -#define glCopyTexSubImage1D GlobalOpenGL().m_glCopyTexSubImage1D -#define glCopyTexSubImage2D GlobalOpenGL().m_glCopyTexSubImage2D -#define glCullFace GlobalOpenGL().m_glCullFace -#define glDeleteLists GlobalOpenGL().m_glDeleteLists -#define glDeleteTextures GlobalOpenGL().m_glDeleteTextures -#define glDepthFunc GlobalOpenGL().m_glDepthFunc -#define glDepthMask GlobalOpenGL().m_glDepthMask -#define glDepthRange GlobalOpenGL().m_glDepthRange -#define glDisable GlobalOpenGL().m_glDisable -#define glDisableClientState GlobalOpenGL().m_glDisableClientState -#define glDrawArrays GlobalOpenGL().m_glDrawArrays -#define glDrawBuffer GlobalOpenGL().m_glDrawBuffer -#define glDrawElements GlobalOpenGL().m_glDrawElements -#define glDrawPixels GlobalOpenGL().m_glDrawPixels -#define glEdgeFlag GlobalOpenGL().m_glEdgeFlag -#define glEdgeFlagPointer GlobalOpenGL().m_glEdgeFlagPointer -#define glEdgeFlagv GlobalOpenGL().m_glEdgeFlagv -#define glEnable GlobalOpenGL().m_glEnable -#define glEnableClientState GlobalOpenGL().m_glEnableClientState -#define glEnd GlobalOpenGL().m_glEnd -#define glEndList GlobalOpenGL().m_glEndList -#define glEvalCoord1d GlobalOpenGL().m_glEvalCoord1d -#define glEvalCoord1dv GlobalOpenGL().m_glEvalCoord1dv -#define glEvalCoord1f GlobalOpenGL().m_glEvalCoord1f -#define glEvalCoord1fv GlobalOpenGL().m_glEvalCoord1fv -#define glEvalCoord2d GlobalOpenGL().m_glEvalCoord2d -#define glEvalCoord2dv GlobalOpenGL().m_glEvalCoord2dv -#define glEvalCoord2f GlobalOpenGL().m_glEvalCoord2f -#define glEvalCoord2fv GlobalOpenGL().m_glEvalCoord2fv -#define glEvalMesh1 GlobalOpenGL().m_glEvalMesh1 -#define glEvalMesh2 GlobalOpenGL().m_glEvalMesh2 -#define glEvalPoint1 GlobalOpenGL().m_glEvalPoint1 -#define glEvalPoint2 GlobalOpenGL().m_glEvalPoint2 -#define glFeedbackBuffer GlobalOpenGL().m_glFeedbackBuffer -#define glFinish GlobalOpenGL().m_glFinish -#define glFlush GlobalOpenGL().m_glFlush -#define glFogf GlobalOpenGL().m_glFogf -#define glFogfv GlobalOpenGL().m_glFogfv -#define glFogi GlobalOpenGL().m_glFogi -#define glFogiv GlobalOpenGL().m_glFogiv -#define glFrontFace GlobalOpenGL().m_glFrontFace -#define glFrustum GlobalOpenGL().m_glFrustum -#define glGenLists GlobalOpenGL().m_glGenLists -#define glGenTextures GlobalOpenGL().m_glGenTextures -#define glGetBooleanv GlobalOpenGL().m_glGetBooleanv -#define glGetClipPlane GlobalOpenGL().m_glGetClipPlane -#define glGetDoublev GlobalOpenGL().m_glGetDoublev -#define glGetError GlobalOpenGL().m_glGetError -#define glGetFloatv GlobalOpenGL().m_glGetFloatv -#define glGetIntegerv GlobalOpenGL().m_glGetIntegerv -#define glGetLightfv GlobalOpenGL().m_glGetLightfv -#define glGetLightiv GlobalOpenGL().m_glGetLightiv -#define glGetMapdv GlobalOpenGL().m_glGetMapdv -#define glGetMapfv GlobalOpenGL().m_glGetMapfv -#define glGetMapiv GlobalOpenGL().m_glGetMapiv -#define glGetMaterialfv GlobalOpenGL().m_glGetMaterialfv -#define glGetMaterialiv GlobalOpenGL().m_glGetMaterialiv -#define glGetPixelMapfv GlobalOpenGL().m_glGetPixelMapfv -#define glGetPixelMapuiv GlobalOpenGL().m_glGetPixelMapuiv -#define glGetPixelMapusv GlobalOpenGL().m_glGetPixelMapusv -#define glGetPointerv GlobalOpenGL().m_glGetPointerv -#define glGetPolygonStipple GlobalOpenGL().m_glGetPolygonStipple -#define glGetString GlobalOpenGL().m_glGetString -#define glGetTexEnvfv GlobalOpenGL().m_glGetTexEnvfv -#define glGetTexEnviv GlobalOpenGL().m_glGetTexEnviv -#define glGetTexGendv GlobalOpenGL().m_glGetTexGendv -#define glGetTexGenfv GlobalOpenGL().m_glGetTexGenfv -#define glGetTexGeniv GlobalOpenGL().m_glGetTexGeniv -#define glGetTexImage GlobalOpenGL().m_glGetTexImage -#define glGetTexLevelParameterfv GlobalOpenGL().m_glGetTexLevelParameter -#define glGetTexLevelParameteriv GlobalOpenGL().m_glGetTexLevelParameteriv -#define glGetTexParameterfv GlobalOpenGL().m_glGetTexParameterfv -#define glGetTexParameteriv GlobalOpenGL().m_glGetTexParameteriv -#define glHint GlobalOpenGL().m_glHint -#define glIndexMask GlobalOpenGL().m_glIndexMask -#define glIndexPointer GlobalOpenGL().m_glIndexPointer -#define glIndexd GlobalOpenGL().m_glIndexd -#define glIndexdv GlobalOpenGL().m_glIndexdv -#define glIndexf GlobalOpenGL().m_glIndexf -#define glIndexfv GlobalOpenGL().m_glIndexfv -#define glIndexi GlobalOpenGL().m_glIndexi -#define glIndexiv GlobalOpenGL().m_glIndexiv -#define glIndexs GlobalOpenGL().m_glIndexs -#define glIndexsv GlobalOpenGL().m_glIndexsv -#define glIndexub GlobalOpenGL().m_glIndexub -#define glIndexubv GlobalOpenGL().m_glIndexubv -#define glInitNames GlobalOpenGL().m_glInitNames -#define glInterleavedArrays GlobalOpenGL().m_glInterleavedArrays -#define glIsEnabled GlobalOpenGL().m_glIsEnabled -#define glIsList GlobalOpenGL().m_glIsList -#define glIsTexture GlobalOpenGL().m_glIsTexture -#define glLightModelf GlobalOpenGL().m_glLightModelf -#define glLightModelfv GlobalOpenGL().m_glLightModelfv -#define glLightModeli GlobalOpenGL().m_glLightModeli -#define glLightModeliv GlobalOpenGL().m_glLightModeliv -#define glLightf GlobalOpenGL().m_glLightf -#define glLightfv GlobalOpenGL().m_glLightfv -#define glLighti GlobalOpenGL().m_glLighti -#define glLightiv GlobalOpenGL().m_glLightiv -#define glLineStipple GlobalOpenGL().m_glLineStipple -#define glLineWidth GlobalOpenGL().m_glLineWidth -#define glListBase GlobalOpenGL().m_glListBase -#define glLoadIdentity GlobalOpenGL().m_glLoadIdentity -#define glLoadMatrixd GlobalOpenGL().m_glLoadMatrixd -#define glLoadMatrixf GlobalOpenGL().m_glLoadMatrixf -#define glLoadName GlobalOpenGL().m_glLoadName -#define glLogicOp GlobalOpenGL().m_glLogicOp -#define glMap1d GlobalOpenGL().m_glMap1d -#define glMap1f GlobalOpenGL().m_glMap1f -#define glMap2d GlobalOpenGL().m_glMap2d -#define glMap2f GlobalOpenGL().m_glMap2f -#define glMapGrid1d GlobalOpenGL().m_glMapGrid1d -#define glMapGrid1f GlobalOpenGL().m_glMapGrid1f -#define glMapGrid2d GlobalOpenGL().m_glMapGrid2d -#define glMapGrid2f GlobalOpenGL().m_glMapGrid2f -#define glMaterialf GlobalOpenGL().m_glMaterialf -#define glMaterialfv GlobalOpenGL().m_glMaterialfv -#define glMateriali GlobalOpenGL().m_glMateriali -#define glMaterialiv GlobalOpenGL().m_glMaterialiv -#define glMatrixMode GlobalOpenGL().m_glMatrixMode -#define glMultMatrixd GlobalOpenGL().m_glMultMatrixd -#define glMultMatrixf GlobalOpenGL().m_glMultMatrixf -#define glNewList GlobalOpenGL().m_glNewList -#define glNormal3b GlobalOpenGL().m_glNormal3b -#define glNormal3bv GlobalOpenGL().m_glNormal3bv -#define glNormal3d GlobalOpenGL().m_glNormal3d -#define glNormal3dv GlobalOpenGL().m_glNormal3dv -#define glNormal3f GlobalOpenGL().m_glNormal3f -#define glNormal3fv GlobalOpenGL().m_glNormal3fv -#define glNormal3i GlobalOpenGL().m_glNormal3i -#define glNormal3iv GlobalOpenGL().m_glNormal3iv -#define glNormal3s GlobalOpenGL().m_glNormal3s -#define glNormal3sv GlobalOpenGL().m_glNormal3sv -#define glNormalPointer GlobalOpenGL().m_glNormalPointer -#define glOrtho GlobalOpenGL().m_glOrtho -#define glPassThrough GlobalOpenGL().m_glPassThrough -#define glPixelMapfv GlobalOpenGL().m_glPixelMapfv -#define glPixelMapuiv GlobalOpenGL().m_glPixelMapuiv -#define glPixelMapusv GlobalOpenGL().m_glPixelMapusv -#define glPixelStoref GlobalOpenGL().m_glPixelStoref -#define glPixelStorei GlobalOpenGL().m_glPixelStorei -#define glPixelTransferf GlobalOpenGL().m_glPixelTransferf -#define glPixelTransferi GlobalOpenGL().m_glPixelTransferi -#define glPixelZoom GlobalOpenGL().m_glPixelZoom -#define glPointSize GlobalOpenGL().m_glPointSize -#define glPolygonMode GlobalOpenGL().m_glPolygonMode -#define glPolygonOffset GlobalOpenGL().m_glPolygonOffset -#define glPolygonStipple GlobalOpenGL().m_glPolygonStipple -#define glPopAttrib GlobalOpenGL().m_glPopAttrib -#define glPopClientAttrib GlobalOpenGL().m_glPopClientAttrib -#define glPopMatrix GlobalOpenGL().m_glPopMatrix -#define glPopName GlobalOpenGL().m_glPopName -#define glPrioritizeTextures GlobalOpenGL().m_glPrioritizeTextures -#define glPushAttrib GlobalOpenGL().m_glPushAttrib -#define glPushClientAttrib GlobalOpenGL().m_glPushClientAttrib -#define glPushMatrix GlobalOpenGL().m_glPushMatrix -#define glPushName GlobalOpenGL().m_glPushName -#define glRasterPos2d GlobalOpenGL().m_glRasterPos2d -#define glRasterPos2dv GlobalOpenGL().m_glRasterPos2dv -#define glRasterPos2f GlobalOpenGL().m_glRasterPos2f -#define glRasterPos2fv GlobalOpenGL().m_glRasterPos2fv -#define glRasterPos2i GlobalOpenGL().m_glRasterPos2i -#define glRasterPos2iv GlobalOpenGL().m_glRasterPos2iv -#define glRasterPos2s GlobalOpenGL().m_glRasterPos2s -#define glRasterPos2sv GlobalOpenGL().m_glRasterPos2sv -#define glRasterPos3d GlobalOpenGL().m_glRasterPos3d -#define glRasterPos3dv GlobalOpenGL().m_glRasterPos3dv -#define glRasterPos3f GlobalOpenGL().m_glRasterPos3f -#define glRasterPos3fv GlobalOpenGL().m_glRasterPos3fv -#define glRasterPos3i GlobalOpenGL().m_glRasterPos3i -#define glRasterPos3iv GlobalOpenGL().m_glRasterPos3iv -#define glRasterPos3s GlobalOpenGL().m_glRasterPos3s -#define glRasterPos3sv GlobalOpenGL().m_glRasterPos3sv -#define glRasterPos4d GlobalOpenGL().m_glRasterPos4d -#define glRasterPos4dv GlobalOpenGL().m_glRasterPos4dv -#define glRasterPos4f GlobalOpenGL().m_glRasterPos4f -#define glRasterPos4fv GlobalOpenGL().m_glRasterPos4fv -#define glRasterPos4i GlobalOpenGL().m_glRasterPos4i -#define glRasterPos4iv GlobalOpenGL().m_glRasterPos4iv -#define glRasterPos4s GlobalOpenGL().m_glRasterPos4s -#define glRasterPos4sv GlobalOpenGL().m_glRasterPos4sv -#define glReadBuffer GlobalOpenGL().m_glReadBuffer -#define glReadPixels GlobalOpenGL().m_glReadPixels -#define glRectd GlobalOpenGL().m_glRectd -#define glRectdv GlobalOpenGL().m_glRectdv -#define glRectf GlobalOpenGL().m_glRectf -#define glRectfv GlobalOpenGL().m_glRectfv -#define glRecti GlobalOpenGL().m_glRecti -#define glRectiv GlobalOpenGL().m_glRectiv -#define glRects GlobalOpenGL().m_glRects -#define glRectsv GlobalOpenGL().m_glRectsv -#define glRenderMode GlobalOpenGL().m_glRenderMode -#define glRotated GlobalOpenGL().m_glRotated -#define glRotatef GlobalOpenGL().m_glRotatef -#define glScaled GlobalOpenGL().m_glScaled -#define glScalef GlobalOpenGL().m_glScalef -#define glScissor GlobalOpenGL().m_glScissor -#define glSelectBuffer GlobalOpenGL().m_glSelectBuffer -#define glShadeModel GlobalOpenGL().m_glShadeModel -#define glStencilFunc GlobalOpenGL().m_glStencilFunc -#define glStencilMask GlobalOpenGL().m_glStencilMask -#define glStencilOp GlobalOpenGL().m_glStencilOp -#define glTexCoord1d GlobalOpenGL().m_glTexCoord1d -#define glTexCoord1dv GlobalOpenGL().m_glTexCoord1dv -#define glTexCoord1f GlobalOpenGL().m_glTexCoord1f -#define glTexCoord1fv GlobalOpenGL().m_glTexCoord1fv -#define glTexCoord1i GlobalOpenGL().m_glTexCoord1i -#define glTexCoord1iv GlobalOpenGL().m_glTexCoord1iv -#define glTexCoord1s GlobalOpenGL().m_glTexCoord1s -#define glTexCoord1sv GlobalOpenGL().m_glTexCoord1sv -#define glTexCoord2d GlobalOpenGL().m_glTexCoord2d -#define glTexCoord2dv GlobalOpenGL().m_glTexCoord2dv -#define glTexCoord2f GlobalOpenGL().m_glTexCoord2f -#define glTexCoord2fv GlobalOpenGL().m_glTexCoord2fv -#define glTexCoord2i GlobalOpenGL().m_glTexCoord2i -#define glTexCoord2iv GlobalOpenGL().m_glTexCoord2iv -#define glTexCoord2s GlobalOpenGL().m_glTexCoord2s -#define glTexCoord2sv GlobalOpenGL().m_glTexCoord2sv -#define glTexCoord3d GlobalOpenGL().m_glTexCoord3d -#define glTexCoord3dv GlobalOpenGL().m_glTexCoord3dv -#define glTexCoord3f GlobalOpenGL().m_glTexCoord3f -#define glTexCoord3fv GlobalOpenGL().m_glTexCoord3fv -#define glTexCoord3i GlobalOpenGL().m_glTexCoord3i -#define glTexCoord3iv GlobalOpenGL().m_glTexCoord3iv -#define glTexCoord3s GlobalOpenGL().m_glTexCoord3s -#define glTexCoord3sv GlobalOpenGL().m_glTexCoord3sv -#define glTexCoord4d GlobalOpenGL().m_glTexCoord4d -#define glTexCoord4dv GlobalOpenGL().m_glTexCoord4dv -#define glTexCoord4f GlobalOpenGL().m_glTexCoord4f -#define glTexCoord4fv GlobalOpenGL().m_glTexCoord4fv -#define glTexCoord4i GlobalOpenGL().m_glTexCoord4i -#define glTexCoord4iv GlobalOpenGL().m_glTexCoord4iv -#define glTexCoord4s GlobalOpenGL().m_glTexCoord4s -#define glTexCoord4sv GlobalOpenGL().m_glTexCoord4sv -#define glTexCoordPointer GlobalOpenGL().m_glTexCoordPointer -#define glTexEnvf GlobalOpenGL().m_glTexEnvf -#define glTexEnvfv GlobalOpenGL().m_glTexEnvfv -#define glTexEnvi GlobalOpenGL().m_glTexEnvi -#define glTexEnviv GlobalOpenGL().m_glTexEnviv -#define glTexGend GlobalOpenGL().m_glTexGend -#define glTexGendv GlobalOpenGL().m_glTexGendv -#define glTexGenf GlobalOpenGL().m_glTexGenf -#define glTexGenfv GlobalOpenGL().m_glTexGenfv -#define glTexGeni GlobalOpenGL().m_glTexGeni -#define glTexGeniv GlobalOpenGL().m_glTexGeniv -#define glTexImage1D GlobalOpenGL().m_glTexImage1D -#define glTexImage2D GlobalOpenGL().m_glTexImage2D -#define glTexParameterf GlobalOpenGL().m_glTexParameterf -#define glTexParameterfv GlobalOpenGL().m_glTexParameterfv -#define glTexParameteri GlobalOpenGL().m_glTexParameteri -#define glTexParameteriv GlobalOpenGL().m_glTexParameteriv -#define glTexSubImage1D GlobalOpenGL().m_glTexSubImage1D -#define glTexSubImage2D GlobalOpenGL().m_glTexSubImage2D -#define glTranslated GlobalOpenGL().m_glTranslated -#define glTranslatef GlobalOpenGL().m_glTranslatef -#define glVertex2d GlobalOpenGL().m_glVertex2d -#define glVertex2dv GlobalOpenGL().m_glVertex2dv -#define glVertex2f GlobalOpenGL().m_glVertex2f -#define glVertex2fv GlobalOpenGL().m_glVertex2fv -#define glVertex2i GlobalOpenGL().m_glVertex2i -#define glVertex2iv GlobalOpenGL().m_glVertex2iv -#define glVertex2s GlobalOpenGL().m_glVertex2s -#define glVertex2sv GlobalOpenGL().m_glVertex2sv -#define glVertex3d GlobalOpenGL().m_glVertex3d -#define glVertex3dv GlobalOpenGL().m_glVertex3dv -#define glVertex3f GlobalOpenGL().m_glVertex3f -#define glVertex3fv GlobalOpenGL().m_glVertex3fv -#define glVertex3i GlobalOpenGL().m_glVertex3i -#define glVertex3iv GlobalOpenGL().m_glVertex3iv -#define glVertex3s GlobalOpenGL().m_glVertex3s -#define glVertex3sv GlobalOpenGL().m_glVertex3sv -#define glVertex4d GlobalOpenGL().m_glVertex4d -#define glVertex4dv GlobalOpenGL().m_glVertex4dv -#define glVertex4f GlobalOpenGL().m_glVertex4f -#define glVertex4fv GlobalOpenGL().m_glVertex4fv -#define glVertex4i GlobalOpenGL().m_glVertex4i -#define glVertex4iv GlobalOpenGL().m_glVertex4iv -#define glVertex4s GlobalOpenGL().m_glVertex4s -#define glVertex4sv GlobalOpenGL().m_glVertex4sv -#define glVertexPointer GlobalOpenGL().m_glVertexPointer -#define glViewport GlobalOpenGL().m_glViewport - -#endif - - -#if !defined(GL_EXT_vertex_array) -#define GL_EXT_vertex_array 1 - -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#define GL_DOUBLE_EXT GL_DOUBLE - -#endif - - -#if !defined(GL_EXT_bgra) -#define GL_EXT_bgra 1 - -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 - -#endif - - -#if !defined(GL_EXT_paletted_texture) -#define GL_EXT_paletted_texture 1 - -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF - -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 - -#define GL_LOGIC_OP GL_INDEX_LOGIC_OP -#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT - -#endif - -#if !defined(GL_ARB_multitexture) -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -#define glActiveTextureARB GlobalOpenGL().m_glActiveTextureARB -#define glClientActiveTextureARB GlobalOpenGL().m_glClientActiveTextureARB -#define glMultiTexCoord1dARB GlobalOpenGL().m_glMultiTexCoord1dARB -#define glMultiTexCoord1dvARB GlobalOpenGL().m_glMultiTexCoord1dvARB -#define glMultiTexCoord1fARB GlobalOpenGL().m_glMultiTexCoord1fARB -#define glMultiTexCoord1fvARB GlobalOpenGL().m_glMultiTexCoord1fvARB -#define glMultiTexCoord1iARB GlobalOpenGL().m_glMultiTexCoord1iARB -#define glMultiTexCoord1ivARB GlobalOpenGL().m_glMultiTexCoord1ivARB -#define glMultiTexCoord1sARB GlobalOpenGL().m_glMultiTexCoord1sARB -#define glMultiTexCoord1svARB GlobalOpenGL().m_glMultiTexCoord1svARB -#define glMultiTexCoord2dARB GlobalOpenGL().m_glMultiTexCoord2dARB -#define glMultiTexCoord2dvARB GlobalOpenGL().m_glMultiTexCoord2dvARB -#define glMultiTexCoord2fARB GlobalOpenGL().m_glMultiTexCoord2fARB -#define glMultiTexCoord2fvARB GlobalOpenGL().m_glMultiTexCoord2fvARB -#define glMultiTexCoord2iARB GlobalOpenGL().m_glMultiTexCoord2iARB -#define glMultiTexCoord2ivARB GlobalOpenGL().m_glMultiTexCoord2ivARB -#define glMultiTexCoord2sARB GlobalOpenGL().m_glMultiTexCoord2sARB -#define glMultiTexCoord2svARB GlobalOpenGL().m_glMultiTexCoord2svARB -#define glMultiTexCoord3dARB GlobalOpenGL().m_glMultiTexCoord3dARB -#define glMultiTexCoord3dvARB GlobalOpenGL().m_glMultiTexCoord3dvARB -#define glMultiTexCoord3fARB GlobalOpenGL().m_glMultiTexCoord3fARB -#define glMultiTexCoord3fvARB GlobalOpenGL().m_glMultiTexCoord3fvARB -#define glMultiTexCoord3iARB GlobalOpenGL().m_glMultiTexCoord3iARB -#define glMultiTexCoord3ivARB GlobalOpenGL().m_glMultiTexCoord3ivARB -#define glMultiTexCoord3sARB GlobalOpenGL().m_glMultiTexCoord3sARB -#define glMultiTexCoord3svARB GlobalOpenGL().m_glMultiTexCoord3svARB -#define glMultiTexCoord4dARB GlobalOpenGL().m_glMultiTexCoord4dARB -#define glMultiTexCoord4dvARB GlobalOpenGL().m_glMultiTexCoord4dvARB -#define glMultiTexCoord4fARB GlobalOpenGL().m_glMultiTexCoord4fARB -#define glMultiTexCoord4fvARB GlobalOpenGL().m_glMultiTexCoord4fvARB -#define glMultiTexCoord4iARB GlobalOpenGL().m_glMultiTexCoord4iARB -#define glMultiTexCoord4ivARB GlobalOpenGL().m_glMultiTexCoord4ivARB -#define glMultiTexCoord4sARB GlobalOpenGL().m_glMultiTexCoord4sARB -#define glMultiTexCoord4svARB GlobalOpenGL().m_glMultiTexCoord4svARB - -#endif - - -// EXT_texture_compression_s3tc -#if !defined(GL_EXT_texture_compression_s3tc) -#define GL_EXT_texture_compression_s3tc 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 - -#endif - - -// ARB_texture_compression -#if !defined(GL_ARB_texture_compression) -#define GL_ARB_texture_compression 1 - -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 - -#define glCompressedTexImage3DARB GlobalOpenGL().m_glCompressedTexImage3DARB -#define glCompressedTexImage2DARB GlobalOpenGL().m_glCompressedTexImage2DARB -#define glCompressedTexImage1DARB GlobalOpenGL().m_glCompressedTexImage1DARB -#define glCompressedTexSubImage3DARB GlobalOpenGL().m_glCompressedTexSubImage3DARB -#define glCompressedTexSubImage2DARB GlobalOpenGL().m_glCompressedTexSubImage2DARB -#define glCompressedTexSubImage1DARB GlobalOpenGL().m_glCompressedTexSubImage1DARB -#define glGetCompressedTexImageARB GlobalOpenGL().m_glGetCompressedTexImageARB - -#endif - - -// GL 1.2 - -#if !defined(GL_VERSION_1_2) - -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E - -#define glCopyTexSubImage3D GlobalOpenGL().m_glCopyTexSubImage3D -#define glDrawRangeElements GlobalOpenGL().m_glDrawRangeElements -#define glTexImage3D GlobalOpenGL().m_glTexImage3D -#define glTexSubImage3D GlobalOpenGL().m_glTexSubImage3D - -#endif - - -// GL 1.3 - -#if !defined(GL_VERSION_1_3) -#define GL_VERSION_1_3 1 - -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_SUBTRACT 0x84E7 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#define GL_MULTISAMPLE_BIT 0x20000000 - -#define glActiveTexture GlobalOpenGL().m_glActiveTexture -#define glClientActiveTexture GlobalOpenGL().m_glClientActiveTexture -#define glCompressedTexImage1D GlobalOpenGL().m_glCompressedTexImage1D -#define glCompressedTexImage2D GlobalOpenGL().m_glCompressedTexImage2D -#define glCompressedTexImage3D GlobalOpenGL().m_glCompressedTexImage3D -#define glCompressedTexSubImage1D GlobalOpenGL().m_glCompressedTexSubImage1D -#define glCompressedTexSubImage2D GlobalOpenGL().m_glCompressedTexSubImage2D -#define glCompressedTexSubImage3D GlobalOpenGL().m_glCompressedTexSubImage3D -#define glGetCompressedTexImage GlobalOpenGL().m_glGetCompressedTexImage -#define glLoadTransposeMatrixd GlobalOpenGL().m_glLoadTransposeMatrixd -#define glLoadTransposeMatrixf GlobalOpenGL().m_glLoadTransposeMatrixf -#define glMultTransposeMatrixd GlobalOpenGL().m_glMultTransposeMatrixd -#define glMultTransposeMatrixf GlobalOpenGL().m_glMultTransposeMatrixf -#define glMultiTexCoord1d GlobalOpenGL().m_glMultiTexCoord1d -#define glMultiTexCoord1dv GlobalOpenGL().m_glMultiTexCoord1dv -#define glMultiTexCoord1f GlobalOpenGL().m_glMultiTexCoord1f -#define glMultiTexCoord1fv GlobalOpenGL().m_glMultiTexCoord1fv -#define glMultiTexCoord1i GlobalOpenGL().m_glMultiTexCoord1i -#define glMultiTexCoord1iv GlobalOpenGL().m_glMultiTexCoord1iv -#define glMultiTexCoord1s GlobalOpenGL().m_glMultiTexCoord1s -#define glMultiTexCoord1sv GlobalOpenGL().m_glMultiTexCoord1sv -#define glMultiTexCoord2d GlobalOpenGL().m_glMultiTexCoord2d -#define glMultiTexCoord2dv GlobalOpenGL().m_glMultiTexCoord2dv -#define glMultiTexCoord2f GlobalOpenGL().m_glMultiTexCoord2f -#define glMultiTexCoord2fv GlobalOpenGL().m_glMultiTexCoord2fv -#define glMultiTexCoord2i GlobalOpenGL().m_glMultiTexCoord2i -#define glMultiTexCoord2iv GlobalOpenGL().m_glMultiTexCoord2iv -#define glMultiTexCoord2s GlobalOpenGL().m_glMultiTexCoord2s -#define glMultiTexCoord2sv GlobalOpenGL().m_glMultiTexCoord2sv -#define glMultiTexCoord3d GlobalOpenGL().m_glMultiTexCoord3d -#define glMultiTexCoord3dv GlobalOpenGL().m_glMultiTexCoord3dv -#define glMultiTexCoord3f GlobalOpenGL().m_glMultiTexCoord3f -#define glMultiTexCoord3fv GlobalOpenGL().m_glMultiTexCoord3fv -#define glMultiTexCoord3i GlobalOpenGL().m_glMultiTexCoord3i -#define glMultiTexCoord3iv GlobalOpenGL().m_glMultiTexCoord3iv -#define glMultiTexCoord3s GlobalOpenGL().m_glMultiTexCoord3s -#define glMultiTexCoord3sv GlobalOpenGL().m_glMultiTexCoord3sv -#define glMultiTexCoord4d GlobalOpenGL().m_glMultiTexCoord4d -#define glMultiTexCoord4dv GlobalOpenGL().m_glMultiTexCoord4dv -#define glMultiTexCoord4f GlobalOpenGL().m_glMultiTexCoord4f -#define glMultiTexCoord4fv GlobalOpenGL().m_glMultiTexCoord4fv -#define glMultiTexCoord4i GlobalOpenGL().m_glMultiTexCoord4i -#define glMultiTexCoord4iv GlobalOpenGL().m_glMultiTexCoord4iv -#define glMultiTexCoord4s GlobalOpenGL().m_glMultiTexCoord4s -#define glMultiTexCoord4sv GlobalOpenGL().m_glMultiTexCoord4sv -#define glSampleCoverage GlobalOpenGL().m_glSampleCoverage - -#endif - - -// GL 1.4 -#if !defined(GL_VERSION_1_4) -#define GL_VERSION_1_4 1 - -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E - -#define glBlendColor GlobalOpenGL().m_glBlendColor -#define glBlendEquation GlobalOpenGL().m_glBlendEquation -#define glBlendFuncSeparate GlobalOpenGL().m_glBlendFuncSeparate -#define glFogCoordPointer GlobalOpenGL().m_glFogCoordPointer -#define glFogCoordd GlobalOpenGL().m_glFogCoordd -#define glFogCoorddv GlobalOpenGL().m_glFogCoorddv -#define glFogCoordf GlobalOpenGL().m_glFogCoordf -#define glFogCoordfv GlobalOpenGL().m_glFogCoordfv -#define glMultiDrawArrays GlobalOpenGL().m_glMultiDrawArrays -#define glMultiDrawElements GlobalOpenGL().m_glMultiDrawElements -#define glPointParameterf GlobalOpenGL().m_glPointParameterf -#define glPointParameterfv GlobalOpenGL().m_glPointParameterfv -#define glSecondaryColor3b GlobalOpenGL().m_glSecondaryColor3b -#define glSecondaryColor3bv GlobalOpenGL().m_glSecondaryColor3bv -#define glSecondaryColor3d GlobalOpenGL().m_glSecondaryColor3d -#define glSecondaryColor3dv GlobalOpenGL().m_glSecondaryColor3dv -#define glSecondaryColor3f GlobalOpenGL().m_glSecondaryColor3f -#define glSecondaryColor3fv GlobalOpenGL().m_glSecondaryColor3fv -#define glSecondaryColor3i GlobalOpenGL().m_glSecondaryColor3i -#define glSecondaryColor3iv GlobalOpenGL().m_glSecondaryColor3iv -#define glSecondaryColor3s GlobalOpenGL().m_glSecondaryColor3s -#define glSecondaryColor3sv GlobalOpenGL().m_glSecondaryColor3sv -#define glSecondaryColor3ub GlobalOpenGL().m_glSecondaryColor3ub -#define glSecondaryColor3ubv GlobalOpenGL().m_glSecondaryColor3ubv -#define glSecondaryColor3ui GlobalOpenGL().m_glSecondaryColor3ui -#define glSecondaryColor3uiv GlobalOpenGL().m_glSecondaryColor3uiv -#define glSecondaryColor3us GlobalOpenGL().m_glSecondaryColor3us -#define glSecondaryColor3usv GlobalOpenGL().m_glSecondaryColor3usv -#define glSecondaryColorPointer GlobalOpenGL().m_glSecondaryColorPointer -#define glWindowPos2d GlobalOpenGL().m_glWindowPos2d -#define glWindowPos2dv GlobalOpenGL().m_glWindowPos2dv -#define glWindowPos2f GlobalOpenGL().m_glWindowPos2f -#define glWindowPos2fv GlobalOpenGL().m_glWindowPos2fv -#define glWindowPos2i GlobalOpenGL().m_glWindowPos2i -#define glWindowPos2iv GlobalOpenGL().m_glWindowPos2iv -#define glWindowPos2s GlobalOpenGL().m_glWindowPos2s -#define glWindowPos2sv GlobalOpenGL().m_glWindowPos2sv -#define glWindowPos3d GlobalOpenGL().m_glWindowPos3d -#define glWindowPos3dv GlobalOpenGL().m_glWindowPos3dv -#define glWindowPos3f GlobalOpenGL().m_glWindowPos3f -#define glWindowPos3fv GlobalOpenGL().m_glWindowPos3fv -#define glWindowPos3i GlobalOpenGL().m_glWindowPos3i -#define glWindowPos3iv GlobalOpenGL().m_glWindowPos3iv -#define glWindowPos3s GlobalOpenGL().m_glWindowPos3s -#define glWindowPos3sv GlobalOpenGL().m_glWindowPos3sv - -#endif - - -// GL 1.5 -#if !defined(GL_VERSION_1_5) -#define GL_VERSION_1_5 1 - -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_SOURCE GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 - -typedef std::ptrdiff_t GLsizeiptr; -typedef std::ptrdiff_t GLintptr; - -#define glBeginQuery GlobalOpenGL().m_glBeginQuery -#define glBindBuffer GlobalOpenGL().m_glBindBuffer -#define glBufferData GlobalOpenGL().m_glBufferData -#define glBufferSubData GlobalOpenGL().m_glBufferSubData -#define glDeleteBuffers GlobalOpenGL().m_glDeleteBuffers -#define glDeleteQueries GlobalOpenGL().m_glDeleteQueries -#define glEndQuery GlobalOpenGL().m_glEndQuery -#define glGenBuffers GlobalOpenGL().m_glGenBuffers -#define glGenQueries GlobalOpenGL().m_glGenQueries -#define glGetBufferParameteriv GlobalOpenGL().m_glGetBufferParameteriv -#define glGetBufferPointerv GlobalOpenGL().m_glGetBufferPointerv -#define glGetBufferSubData GlobalOpenGL().m_glGetBufferSubData -#define glGetQueryObjectiv GlobalOpenGL().m_glGetQueryObjectiv -#define glGetQueryObjectuiv GlobalOpenGL().m_glGetQueryObjectuiv -#define glGetQueryiv GlobalOpenGL().m_glGetQueryiv -#define glIsBuffer GlobalOpenGL().m_glIsBuffer -#define glIsQuery GlobalOpenGL().m_glIsQuery -#define glMapBuffer GlobalOpenGL().m_glMapBuffer -#define glUnmapBuffer GlobalOpenGL().m_glUnmapBuffer - -#endif - - -// GL_ARB_vertex_program -#if !defined(GL_ARB_vertex_program) -#define GL_ARB_vertex_program - -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF - -#define glVertexAttrib1sARB GlobalOpenGL().m_glVertexAttrib1sARB -#define glVertexAttrib1fARB GlobalOpenGL().m_glVertexAttrib1fARB -#define glVertexAttrib1dARB GlobalOpenGL().m_glVertexAttrib1dARB -#define glVertexAttrib2sARB GlobalOpenGL().m_glVertexAttrib2sARB -#define glVertexAttrib2fARB GlobalOpenGL().m_glVertexAttrib2fARB -#define glVertexAttrib2dARB GlobalOpenGL().m_glVertexAttrib2dARB -#define glVertexAttrib3sARB GlobalOpenGL().m_glVertexAttrib3sARB -#define glVertexAttrib3fARB GlobalOpenGL().m_glVertexAttrib3fARB -#define glVertexAttrib3dARB GlobalOpenGL().m_glVertexAttrib3dARB -#define glVertexAttrib4sARB GlobalOpenGL().m_glVertexAttrib4sARB -#define glVertexAttrib4fARB GlobalOpenGL().m_glVertexAttrib4fARB -#define glVertexAttrib4dARB GlobalOpenGL().m_glVertexAttrib4dARB -#define glVertexAttrib4NubARB GlobalOpenGL().m_glVertexAttrib4NubARB -#define glVertexAttrib1svARB GlobalOpenGL().m_glVertexAttrib1svARB -#define glVertexAttrib1fvARB GlobalOpenGL().m_glVertexAttrib1fvARB -#define glVertexAttrib1dvARB GlobalOpenGL().m_glVertexAttrib1dvARB -#define glVertexAttrib2svARB GlobalOpenGL().m_glVertexAttrib2svARB -#define glVertexAttrib2fvARB GlobalOpenGL().m_glVertexAttrib2fvARB -#define glVertexAttrib2dvARB GlobalOpenGL().m_glVertexAttrib2dvARB -#define glVertexAttrib3svARB GlobalOpenGL().m_glVertexAttrib3svARB -#define glVertexAttrib3fvARB GlobalOpenGL().m_glVertexAttrib3fvARB -#define glVertexAttrib3dvARB GlobalOpenGL().m_glVertexAttrib3dvARB -#define glVertexAttrib4bvARB GlobalOpenGL().m_glVertexAttrib4bvARB -#define glVertexAttrib4svARB GlobalOpenGL().m_glVertexAttrib4svARB -#define glVertexAttrib4ivARB GlobalOpenGL().m_glVertexAttrib4ivARB -#define glVertexAttrib4ubvARB GlobalOpenGL().m_glVertexAttrib4ubvARB -#define glVertexAttrib4usvARB GlobalOpenGL().m_glVertexAttrib4usvARB -#define glVertexAttrib4uivARB GlobalOpenGL().m_glVertexAttrib4uivARB -#define glVertexAttrib4fvARB GlobalOpenGL().m_glVertexAttrib4fvARB -#define glVertexAttrib4dvARB GlobalOpenGL().m_glVertexAttrib4dvARB -#define glVertexAttrib4NbvARB GlobalOpenGL().m_glVertexAttrib4NbvARB -#define glVertexAttrib4NsvARB GlobalOpenGL().m_glVertexAttrib4NsvARB -#define glVertexAttrib4NivARB GlobalOpenGL().m_glVertexAttrib4NivARB -#define glVertexAttrib4NubvARB GlobalOpenGL().m_glVertexAttrib4NubvARB -#define glVertexAttrib4NusvARB GlobalOpenGL().m_glVertexAttrib4NusvARB -#define glVertexAttrib4NuivARB GlobalOpenGL().m_glVertexAttrib4NuivARB -#define glVertexAttribPointerARB GlobalOpenGL().m_glVertexAttribPointerARB -#define glEnableVertexAttribArrayARB GlobalOpenGL().m_glEnableVertexAttribArrayARB -#define glDisableVertexAttribArrayARB GlobalOpenGL().m_glDisableVertexAttribArrayARB -#define glProgramStringARB GlobalOpenGL().m_glProgramStringARB -#define glBindProgramARB GlobalOpenGL().m_glBindProgramARB -#define glDeleteProgramsARB GlobalOpenGL().m_glDeleteProgramsARB -#define glGenProgramsARB GlobalOpenGL().m_glGenProgramsARB -#define glProgramEnvParameter4dARB GlobalOpenGL().m_glProgramEnvParameter4dARB -#define glProgramEnvParameter4dvARB GlobalOpenGL().m_glProgramEnvParameter4dvARB -#define glProgramEnvParameter4fARB GlobalOpenGL().m_glProgramEnvParameter4fARB -#define glProgramEnvParameter4fvARB GlobalOpenGL().m_glProgramEnvParameter4fvARB -#define glProgramLocalParameter4dARB GlobalOpenGL().m_glProgramLocalParameter4dARB -#define glProgramLocalParameter4dvARB GlobalOpenGL().m_glProgramLocalParameter4dvARB -#define glProgramLocalParameter4fARB GlobalOpenGL().m_glProgramLocalParameter4fARB -#define glProgramLocalParameter4fvARB GlobalOpenGL().m_glProgramLocalParameter4fvARB -#define glGetProgramEnvParameterdvARB GlobalOpenGL().m_glGetProgramEnvParameterdvARB -#define glGetProgramEnvParameterfvARB GlobalOpenGL().m_glGetProgramEnvParameterfvARB -#define glGetProgramLocalParameterdvARB GlobalOpenGL().m_glGetProgramLocalParameterdvARB -#define glGetProgramLocalParameterfvARB GlobalOpenGL().m_glGetProgramLocalParameterfvARB -#define glGetProgramivARB GlobalOpenGL().m_glGetProgramivARB -#define glGetProgramStringARB GlobalOpenGL().m_glGetProgramStringARB -#define glGetVertexAttribdvARB GlobalOpenGL().m_glGetVertexAttribdvARB -#define glGetVertexAttribfvARB GlobalOpenGL().m_glGetVertexAttribfvARB -#define glGetVertexAttribivARB GlobalOpenGL().m_glGetVertexAttribivARB -#define glGetVertexAttribPointervARB GlobalOpenGL().m_glGetVertexAttribPointervARB -#define glIsProgramARB GlobalOpenGL().m_glIsProgramARB - -#endif - - -// GL_ARB_fragment_program -#if !defined(GL_ARB_fragment_program) -#define GL_ARB_fragment_program 1 - -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 - -#endif - - -// GL_ARB_shader_objects -#if !defined(GL_ARB_shader_objects) -#define GL_ARB_shader_objects 1 - -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 - -#define glDeleteObjectARB GlobalOpenGL().m_glDeleteObjectARB -#define glGetHandleARB GlobalOpenGL().m_glGetHandleARB -#define glDetachObjectARB GlobalOpenGL().m_glDetachObjectARB -#define glCreateShaderObjectARB GlobalOpenGL().m_glCreateShaderObjectARB -#define glShaderSourceARB GlobalOpenGL().m_glShaderSourceARB -#define glCompileShaderARB GlobalOpenGL().m_glCompileShaderARB -#define glCreateProgramObjectARB GlobalOpenGL().m_glCreateProgramObjectARB -#define glAttachObjectARB GlobalOpenGL().m_glAttachObjectARB -#define glLinkProgramARB GlobalOpenGL().m_glLinkProgramARB -#define glUseProgramObjectARB GlobalOpenGL().m_glUseProgramObjectARB -#define glValidateProgramARB GlobalOpenGL().m_glValidateProgramARB -#define glUniform1fARB GlobalOpenGL().m_glUniform1fARB -#define glUniform2fARB GlobalOpenGL().m_glUniform2fARB -#define glUniform3fARB GlobalOpenGL().m_glUniform3fARB -#define glUniform4fARB GlobalOpenGL().m_glUniform4fARB -#define glUniform1iARB GlobalOpenGL().m_glUniform1iARB -#define glUniform2iARB GlobalOpenGL().m_glUniform2iARB -#define glUniform3iARB GlobalOpenGL().m_glUniform3iARB -#define glUniform4iARB GlobalOpenGL().m_glUniform4iARB -#define glUniform1fvARB GlobalOpenGL().m_glUniform1fvARB -#define glUniform2fvARB GlobalOpenGL().m_glUniform2fvARB -#define glUniform3fvARB GlobalOpenGL().m_glUniform3fvARB -#define glUniform4fvARB GlobalOpenGL().m_glUniform4fvARB -#define glUniform1ivARB GlobalOpenGL().m_glUniform1ivARB -#define glUniform2ivARB GlobalOpenGL().m_glUniform2ivARB -#define glUniform3ivARB GlobalOpenGL().m_glUniform3ivARB -#define glUniform4ivARB GlobalOpenGL().m_glUniform4ivARB -#define glUniformMatrix2fvARB GlobalOpenGL().m_glUniformMatrix2fvARB -#define glUniformMatrix3fvARB GlobalOpenGL().m_glUniformMatrix3fvARB -#define glUniformMatrix4fvARB GlobalOpenGL().m_glUniformMatrix4fvARB -#define glGetObjectParameterfvARB GlobalOpenGL().m_glGetObjectParameterfvARB -#define glGetObjectParameterivARB GlobalOpenGL().m_glGetObjectParameterivARB -#define glGetInfoLogARB GlobalOpenGL().m_glGetInfoLogARB -#define glGetAttachedObjectsARB GlobalOpenGL().m_glGetAttachedObjectsARB -#define glGetUniformLocationARB GlobalOpenGL().m_glGetUniformLocationARB -#define glGetActiveUniformARB GlobalOpenGL().m_glGetActiveUniformARB -#define glGetUniformfvARB GlobalOpenGL().m_glGetUniformfvARB -#define glGetUniformivARB GlobalOpenGL().m_glGetUniformivARB -#define glGetShaderSourceARB GlobalOpenGL().m_glGetShaderSourceARB - -typedef char GLcharARB; -typedef unsigned int GLhandleARB; - -#endif - -// GL_ARB_vertex_shader -#if !defined(GL_ARB_vertex_shader) -#define GL_ARB_vertex_shader 1 - -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A - -#if 0 -#define glVertexAttrib1fARB GlobalOpenGL().m_glVertexAttrib1fARB -#define glVertexAttrib1sARB GlobalOpenGL().m_glVertexAttrib1sARB -#define glVertexAttrib1dARB GlobalOpenGL().m_glVertexAttrib1dARB -#define glVertexAttrib2fARB GlobalOpenGL().m_glVertexAttrib2fARB -#define glVertexAttrib2sARB GlobalOpenGL().m_glVertexAttrib2sARB -#define glVertexAttrib2dARB GlobalOpenGL().m_glVertexAttrib2dARB -#define glVertexAttrib3fARB GlobalOpenGL().m_glVertexAttrib3fARB -#define glVertexAttrib3sARB GlobalOpenGL().m_glVertexAttrib3sARB -#define glVertexAttrib3dARB GlobalOpenGL().m_glVertexAttrib3dARB -#define glVertexAttrib4fARB GlobalOpenGL().m_glVertexAttrib4fARB -#define glVertexAttrib4sARB GlobalOpenGL().m_glVertexAttrib4sARB -#define glVertexAttrib4dARB GlobalOpenGL().m_glVertexAttrib4dARB -#define glVertexAttrib4NubARB GlobalOpenGL().m_glVertexAttrib4NubARB -#define glVertexAttrib1fvARB GlobalOpenGL().m_glVertexAttrib1fvARB -#define glVertexAttrib1svARB GlobalOpenGL().m_glVertexAttrib1svARB -#define glVertexAttrib1dvARB GlobalOpenGL().m_glVertexAttrib1dvARB -#define glVertexAttrib2fvARB GlobalOpenGL().m_glVertexAttrib2fvARB -#define glVertexAttrib2svARB GlobalOpenGL().m_glVertexAttrib2svARB -#define glVertexAttrib2dvARB GlobalOpenGL().m_glVertexAttrib2dvARB -#define glVertexAttrib3fvARB GlobalOpenGL().m_glVertexAttrib3fvARB -#define glVertexAttrib3svARB GlobalOpenGL().m_glVertexAttrib3svARB -#define glVertexAttrib3dvARB GlobalOpenGL().m_glVertexAttrib3dvARB -#define glVertexAttrib4fvARB GlobalOpenGL().m_glVertexAttrib4fvARB -#define glVertexAttrib4svARB GlobalOpenGL().m_glVertexAttrib4svARB -#define glVertexAttrib4dvARB GlobalOpenGL().m_glVertexAttrib4dvARB -#define glVertexAttrib4ivARB GlobalOpenGL().m_glVertexAttrib4ivARB -#define glVertexAttrib4bvARB GlobalOpenGL().m_glVertexAttrib4bvARB -#define glVertexAttrib4ubvARB GlobalOpenGL().m_glVertexAttrib4ubvARB -#define glVertexAttrib4usvARB GlobalOpenGL().m_glVertexAttrib4usvARB -#define glVertexAttrib4uivARB GlobalOpenGL().m_glVertexAttrib4uivARB -#define glVertexAttrib4NbvARB GlobalOpenGL().m_glVertexAttrib4NbvARB -#define glVertexAttrib4NsvARB GlobalOpenGL().m_glVertexAttrib4NsvARB -#define glVertexAttrib4NivARB GlobalOpenGL().m_glVertexAttrib4NivARB -#define glVertexAttrib4NubvARB GlobalOpenGL().m_glVertexAttrib4NubvARB -#define glVertexAttrib4NusvARB GlobalOpenGL().m_glVertexAttrib4NusvARB -#define glVertexAttrib4NuivARB GlobalOpenGL().m_glVertexAttrib4NuivARB -#define glVertexAttribPointerARB GlobalOpenGL().m_glVertexAttribPointerARB -#define glEnableVertexAttribArrayARB GlobalOpenGL().m_glEnableVertexAttribArrayARB -#define glDisableVertexAttribArrayARB GlobalOpenGL().m_glDisableVertexAttribArrayARB -#endif -#define glBindAttribLocationARB GlobalOpenGL().m_glBindAttribLocationARB -#define glGetActiveAttribARB GlobalOpenGL().m_glGetActiveAttribARB -#define glGetAttribLocationARB GlobalOpenGL().m_glGetAttribLocationARB -#if 0 -#define glGetVertexAttribdvARB GlobalOpenGL().m_glGetVertexAttribdvARB -#define glGetVertexAttribfvARB GlobalOpenGL().m_glGetVertexAttribfvARB -#define glGetVertexAttribivARB GlobalOpenGL().m_glGetVertexAttribivARB -#define glGetVertexAttribPointervARB GlobalOpenGL().m_glGetVertexAttribPointervARB -#endif -#endif - - - -// GL_ARB_fragment_shader -#if !defined(GL_ARB_fragment_shader) -#define GL_ARB_fragment_shader 1 - -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B - -#endif - - -// GL_ARB_shading_language_100 -#if !defined(GL_ARB_shading_language_100) -#define GL_ARB_shading_language_100 1 - -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C - -#endif - - -// GL_NV_vertex_program2 -#if !defined(GL_NV_vertex_program) -#define GL_NV_vertex_program 1 - -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F - -#define glAreProgramsResidentNV GlobalOpenGL().m_glAreProgramsResidentNV -#define glBindProgramNV GlobalOpenGL().m_glBindProgramNV -#define glDeleteProgramsNV GlobalOpenGL().m_glDeleteProgramsNV -#define glExecuteProgramNV GlobalOpenGL().m_glExecuteProgramNV -#define glGenProgramsNV GlobalOpenGL().m_glGenProgramsNV -#define glGetProgramParameterdvNV GlobalOpenGL().m_glGetProgramParameterdvNV -#define glGetProgramParameterfvNV GlobalOpenGL().m_glGetProgramParameterfvNV -#define glGetProgramivNV GlobalOpenGL().m_glGetProgramivNV -#define glGetProgramStringNV GlobalOpenGL().m_glGetProgramStringNV -#define glGetTrackMatrixivNV GlobalOpenGL().m_glGetTrackMatrixivNV -#define glGetVertexAttribdvNV GlobalOpenGL().m_glGetVertexAttribdvNV -#define glGetVertexAttribfvNV GlobalOpenGL().m_glGetVertexAttribfvNV -#define glGetVertexAttribivNV GlobalOpenGL().m_glGetVertexAttribivNV -#define glGetVertexAttribPointervNV GlobalOpenGL().m_glGetVertexAttribPointervNV -#define glIsProgramNV GlobalOpenGL().m_glIsProgramNV -#define glLoadProgramNV GlobalOpenGL().m_glLoadProgramNV -#define glProgramParameter4fNV GlobalOpenGL().m_glProgramParameter4fNV -#define glProgramParameter4fvNV GlobalOpenGL().m_glProgramParameter4fvNV -#define glProgramParameters4fvNV GlobalOpenGL().m_glProgramParameters4fvNV -#define glRequestResidentProgramsNV GlobalOpenGL().m_glRequestResidentProgramsNV -#define glTrackMatrixNV GlobalOpenGL().m_glTrackMatrixNV -#define glVertexAttribPointerNV GlobalOpenGL().m_glVertexAttribPointerNV -#define glVertexAttrib1fNV GlobalOpenGL().m_glVertexAttrib1fNV -#define glVertexAttrib1fvNV GlobalOpenGL().m_glVertexAttrib1fvNV -#define glVertexAttrib2fNV GlobalOpenGL().m_glVertexAttrib2fNV -#define glVertexAttrib2fvNV GlobalOpenGL().m_glVertexAttrib2fvNV -#define glVertexAttrib3fNV GlobalOpenGL().m_glVertexAttrib3fNV -#define glVertexAttrib3fvNV GlobalOpenGL().m_glVertexAttrib3fvNV -#define glVertexAttrib4fNV GlobalOpenGL().m_glVertexAttrib4fNV -#define glVertexAttrib4fvNV GlobalOpenGL().m_glVertexAttrib4fvNV -#define glVertexAttribs1fvNV GlobalOpenGL().m_glVertexAttribs1fvNV -#define glVertexAttribs2fvNV GlobalOpenGL().m_glVertexAttribs2fvNV -#define glVertexAttribs3fvNV GlobalOpenGL().m_glVertexAttribs3fvNV -#define glVertexAttribs4fvNV GlobalOpenGL().m_glVertexAttribs4fvNV - -#endif - - -// GL_NV_fragment_program -#if !defined(GL_NV_fragment_program) - -#define GL_NV_fragment_program 1 - -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 - -#define glProgramNamedParameter4fNV GlobalOpenGL().m_glProgramNamedParameter4fNV -#define glProgramNamedParameter4fvNV GlobalOpenGL().m_glProgramNamedParameter4fvNV -#define glGetProgramNamedParameterfvNV GlobalOpenGL().m_glGetProgramNamedParameterfvNV - -#endif - - -/// \brief A module which wraps a runtime-binding of the standard OpenGL functions. -/// Provides convenience functions for querying availabiliy of extensions, rendering text and error-checking. -struct OpenGLBinding +// we use these classes to let plugins draw inside the Radiant windows +// 2D window like YZ XZ XY +class IGL2DWindow { - INTEGER_CONSTANT(Version, 2); - STRING_CONSTANT(Name, "qgl"); - - /// \brief OpenGL version, extracted from the GL_VERSION string. - int major_version, minor_version; - - /// \brief Is true if the global shared OpenGL context is valid. - bool contextValid; - - OpenGLBinding() : contextValid(false) - { - } - - /// \brief Asserts that there no OpenGL errors have occurred since the last call to glGetError. - void (*assertNoErrors)(); - - GLuint m_font; - int m_fontHeight; - - /// \brief Renders \p string at the current raster-position of the current context. - void drawString(const char* string) const - { - m_glListBase(m_font); - m_glCallLists(GLsizei(strlen(string)), GL_UNSIGNED_BYTE, reinterpret_cast(string)); - } - - /// \brief Renders \p character at the current raster-position of the current context. - void drawChar(char character) const - { - m_glListBase(m_font); - m_glCallLists(1, GL_UNSIGNED_BYTE, reinterpret_cast(&character)); - } - - - // GL 1.1 - void (QGL_DLLEXPORT *m_glAccum)(GLenum op, GLfloat value); - void (QGL_DLLEXPORT *m_glAlphaFunc)(GLenum func, GLclampf ref); - GLboolean (QGL_DLLEXPORT *m_glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences); - void (QGL_DLLEXPORT *m_glArrayElement)(GLint i); - void (QGL_DLLEXPORT *m_glBegin)(GLenum mode); - void (QGL_DLLEXPORT *m_glBindTexture)(GLenum target, GLuint texture); - void (QGL_DLLEXPORT *m_glBitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); - void (QGL_DLLEXPORT *m_glBlendFunc)(GLenum sfactor, GLenum dfactor); - void (QGL_DLLEXPORT *m_glCallList)(GLuint list); - void (QGL_DLLEXPORT *m_glCallLists)(GLsizei n, GLenum type, const GLvoid *lists); - void (QGL_DLLEXPORT *m_glClear)(GLbitfield mask); - void (QGL_DLLEXPORT *m_glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); - void (QGL_DLLEXPORT *m_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - void (QGL_DLLEXPORT *m_glClearDepth)(GLclampd depth); - void (QGL_DLLEXPORT *m_glClearIndex)(GLfloat c); - void (QGL_DLLEXPORT *m_glClearStencil)(GLint s); - void (QGL_DLLEXPORT *m_glClipPlane)(GLenum plane, const GLdouble *equation); - void (QGL_DLLEXPORT *m_glColor3b)(GLbyte red, GLbyte green, GLbyte blue); - void (QGL_DLLEXPORT *m_glColor3bv)(const GLbyte *v); - void (QGL_DLLEXPORT *m_glColor3d)(GLdouble red, GLdouble green, GLdouble blue); - void (QGL_DLLEXPORT *m_glColor3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glColor3f)(GLfloat red, GLfloat green, GLfloat blue); - void (QGL_DLLEXPORT *m_glColor3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glColor3i)(GLint red, GLint green, GLint blue); - void (QGL_DLLEXPORT *m_glColor3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glColor3s)(GLshort red, GLshort green, GLshort blue); - void (QGL_DLLEXPORT *m_glColor3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glColor3ub)(GLubyte red, GLubyte green, GLubyte blue); - void (QGL_DLLEXPORT *m_glColor3ubv)(const GLubyte *v); - void (QGL_DLLEXPORT *m_glColor3ui)(GLuint red, GLuint green, GLuint blue); - void (QGL_DLLEXPORT *m_glColor3uiv)(const GLuint *v); - void (QGL_DLLEXPORT *m_glColor3us)(GLushort red, GLushort green, GLushort blue); - void (QGL_DLLEXPORT *m_glColor3usv)(const GLushort *v); - void (QGL_DLLEXPORT *m_glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); - void (QGL_DLLEXPORT *m_glColor4bv)(const GLbyte *v); - void (QGL_DLLEXPORT *m_glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); - void (QGL_DLLEXPORT *m_glColor4dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); - void (QGL_DLLEXPORT *m_glColor4fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glColor4i)(GLint red, GLint green, GLint blue, GLint alpha); - void (QGL_DLLEXPORT *m_glColor4iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); - void (QGL_DLLEXPORT *m_glColor4sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); - void (QGL_DLLEXPORT *m_glColor4ubv)(const GLubyte *v); - void (QGL_DLLEXPORT *m_glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); - void (QGL_DLLEXPORT *m_glColor4uiv)(const GLuint *v); - void (QGL_DLLEXPORT *m_glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); - void (QGL_DLLEXPORT *m_glColor4usv)(const GLushort *v); - void (QGL_DLLEXPORT *m_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - void (QGL_DLLEXPORT *m_glColorMaterial)(GLenum face, GLenum mode); - void (QGL_DLLEXPORT *m_glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); - void (QGL_DLLEXPORT *m_glCopyTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); - void (QGL_DLLEXPORT *m_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); - void (QGL_DLLEXPORT *m_glCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); - void (QGL_DLLEXPORT *m_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); - void (QGL_DLLEXPORT *m_glCullFace)(GLenum mode); - void (QGL_DLLEXPORT *m_glDeleteLists)(GLuint list, GLsizei range); - void (QGL_DLLEXPORT *m_glDeleteTextures)(GLsizei n, const GLuint *textures); - void (QGL_DLLEXPORT *m_glDepthFunc)(GLenum func); - void (QGL_DLLEXPORT *m_glDepthMask)(GLboolean flag); - void (QGL_DLLEXPORT *m_glDepthRange)(GLclampd zNear, GLclampd zFar); - void (QGL_DLLEXPORT *m_glDisable)(GLenum cap); - void (QGL_DLLEXPORT *m_glDisableClientState)(GLenum array); - void (QGL_DLLEXPORT *m_glDrawArrays)(GLenum mode, GLint first, GLsizei count); - void (QGL_DLLEXPORT *m_glDrawBuffer)(GLenum mode); - void (QGL_DLLEXPORT *m_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); - void (QGL_DLLEXPORT *m_glDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glEdgeFlag)(GLboolean flag); - void (QGL_DLLEXPORT *m_glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glEdgeFlagv)(const GLboolean *flag); - void (QGL_DLLEXPORT *m_glEnable)(GLenum cap); - void (QGL_DLLEXPORT *m_glEnableClientState)(GLenum array); - void (QGL_DLLEXPORT *m_glEnd)(void); - void (QGL_DLLEXPORT *m_glEndList)(void); - void (QGL_DLLEXPORT *m_glEvalCoord1d)(GLdouble u); - void (QGL_DLLEXPORT *m_glEvalCoord1dv)(const GLdouble *u); - void (QGL_DLLEXPORT *m_glEvalCoord1f)(GLfloat u); - void (QGL_DLLEXPORT *m_glEvalCoord1fv)(const GLfloat *u); - void (QGL_DLLEXPORT *m_glEvalCoord2d)(GLdouble u, GLdouble v); - void (QGL_DLLEXPORT *m_glEvalCoord2dv)(const GLdouble *u); - void (QGL_DLLEXPORT *m_glEvalCoord2f)(GLfloat u, GLfloat v); - void (QGL_DLLEXPORT *m_glEvalCoord2fv)(const GLfloat *u); - void (QGL_DLLEXPORT *m_glEvalMesh1)(GLenum mode, GLint i1, GLint i2); - void (QGL_DLLEXPORT *m_glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); - void (QGL_DLLEXPORT *m_glEvalPoint1)(GLint i); - void (QGL_DLLEXPORT *m_glEvalPoint2)(GLint i, GLint j); - void (QGL_DLLEXPORT *m_glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer); - void (QGL_DLLEXPORT *m_glFinish)(void); - void (QGL_DLLEXPORT *m_glFlush)(void); - void (QGL_DLLEXPORT *m_glFogf)(GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glFogfv)(GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glFogi)(GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glFogiv)(GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glFrontFace)(GLenum mode); - void (QGL_DLLEXPORT *m_glFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); - GLuint (QGL_DLLEXPORT *m_glGenLists)(GLsizei range); - void (QGL_DLLEXPORT *m_glGenTextures)(GLsizei n, GLuint *textures); - void (QGL_DLLEXPORT *m_glGetBooleanv)(GLenum pname, GLboolean *params); - void (QGL_DLLEXPORT *m_glGetClipPlane)(GLenum plane, GLdouble *equation); - void (QGL_DLLEXPORT *m_glGetDoublev)(GLenum pname, GLdouble *params); - GLenum (QGL_DLLEXPORT *m_glGetError)(void); - void (QGL_DLLEXPORT *m_glGetFloatv)(GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetIntegerv)(GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetLightfv)(GLenum light, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetLightiv)(GLenum light, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetMapdv)(GLenum target, GLenum query, GLdouble *v); - void (QGL_DLLEXPORT *m_glGetMapfv)(GLenum target, GLenum query, GLfloat *v); - void (QGL_DLLEXPORT *m_glGetMapiv)(GLenum target, GLenum query, GLint *v); - void (QGL_DLLEXPORT *m_glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetMaterialiv)(GLenum face, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetPixelMapfv)(GLenum map, GLfloat *values); - void (QGL_DLLEXPORT *m_glGetPixelMapuiv)(GLenum map, GLuint *values); - void (QGL_DLLEXPORT *m_glGetPixelMapusv)(GLenum map, GLushort *values); - void (QGL_DLLEXPORT *m_glGetPointerv)(GLenum pname, GLvoid* *params); - void (QGL_DLLEXPORT *m_glGetPolygonStipple)(GLubyte *mask); - const GLubyte * (QGL_DLLEXPORT *m_glGetString)(GLenum name); - void (QGL_DLLEXPORT *m_glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetTexEnviv)(GLenum target, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params); - void (QGL_DLLEXPORT *m_glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); - void (QGL_DLLEXPORT *m_glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glHint)(GLenum target, GLenum mode); - void (QGL_DLLEXPORT *m_glIndexMask)(GLuint mask); - void (QGL_DLLEXPORT *m_glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glIndexd)(GLdouble c); - void (QGL_DLLEXPORT *m_glIndexdv)(const GLdouble *c); - void (QGL_DLLEXPORT *m_glIndexf)(GLfloat c); - void (QGL_DLLEXPORT *m_glIndexfv)(const GLfloat *c); - void (QGL_DLLEXPORT *m_glIndexi)(GLint c); - void (QGL_DLLEXPORT *m_glIndexiv)(const GLint *c); - void (QGL_DLLEXPORT *m_glIndexs)(GLshort c); - void (QGL_DLLEXPORT *m_glIndexsv)(const GLshort *c); - void (QGL_DLLEXPORT *m_glIndexub)(GLubyte c); - void (QGL_DLLEXPORT *m_glIndexubv)(const GLubyte *c); - void (QGL_DLLEXPORT *m_glInitNames)(void); - void (QGL_DLLEXPORT *m_glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer); - GLboolean (QGL_DLLEXPORT *m_glIsEnabled)(GLenum cap); - GLboolean (QGL_DLLEXPORT *m_glIsList)(GLuint list); - GLboolean (QGL_DLLEXPORT *m_glIsTexture)(GLuint texture); - void (QGL_DLLEXPORT *m_glLightModelf)(GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glLightModelfv)(GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glLightModeli)(GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glLightModeliv)(GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glLightf)(GLenum light, GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glLightfv)(GLenum light, GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glLighti)(GLenum light, GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glLightiv)(GLenum light, GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glLineStipple)(GLint factor, GLushort pattern); - void (QGL_DLLEXPORT *m_glLineWidth)(GLfloat width); - void (QGL_DLLEXPORT *m_glListBase)(GLuint base); - void (QGL_DLLEXPORT *m_glLoadIdentity)(void); - void (QGL_DLLEXPORT *m_glLoadMatrixd)(const GLdouble *m); - void (QGL_DLLEXPORT *m_glLoadMatrixf)(const GLfloat *m); - void (QGL_DLLEXPORT *m_glLoadName)(GLuint name); - void (QGL_DLLEXPORT *m_glLogicOp)(GLenum opcode); - void (QGL_DLLEXPORT *m_glMap1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); - void (QGL_DLLEXPORT *m_glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); - void (QGL_DLLEXPORT *m_glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); - void (QGL_DLLEXPORT *m_glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); - void (QGL_DLLEXPORT *m_glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2); - void (QGL_DLLEXPORT *m_glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2); - void (QGL_DLLEXPORT *m_glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); - void (QGL_DLLEXPORT *m_glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); - void (QGL_DLLEXPORT *m_glMaterialf)(GLenum face, GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glMateriali)(GLenum face, GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glMaterialiv)(GLenum face, GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glMatrixMode)(GLenum mode); - void (QGL_DLLEXPORT *m_glMultMatrixd)(const GLdouble *m); - void (QGL_DLLEXPORT *m_glMultMatrixf)(const GLfloat *m); - void (QGL_DLLEXPORT *m_glNewList)(GLuint list, GLenum mode); - void (QGL_DLLEXPORT *m_glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz); - void (QGL_DLLEXPORT *m_glNormal3bv)(const GLbyte *v); - void (QGL_DLLEXPORT *m_glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz); - void (QGL_DLLEXPORT *m_glNormal3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz); - void (QGL_DLLEXPORT *m_glNormal3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glNormal3i)(GLint nx, GLint ny, GLint nz); - void (QGL_DLLEXPORT *m_glNormal3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glNormal3s)(GLshort nx, GLshort ny, GLshort nz); - void (QGL_DLLEXPORT *m_glNormal3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); - void (QGL_DLLEXPORT *m_glPassThrough)(GLfloat token); - void (QGL_DLLEXPORT *m_glPixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values); - void (QGL_DLLEXPORT *m_glPixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values); - void (QGL_DLLEXPORT *m_glPixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values); - void (QGL_DLLEXPORT *m_glPixelStoref)(GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glPixelStorei)(GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glPixelTransferf)(GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glPixelTransferi)(GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glPixelZoom)(GLfloat xfactor, GLfloat yfactor); - void (QGL_DLLEXPORT *m_glPointSize)(GLfloat size); - void (QGL_DLLEXPORT *m_glPolygonMode)(GLenum face, GLenum mode); - void (QGL_DLLEXPORT *m_glPolygonOffset)(GLfloat factor, GLfloat units); - void (QGL_DLLEXPORT *m_glPolygonStipple)(const GLubyte *mask); - void (QGL_DLLEXPORT *m_glPopAttrib)(void); - void (QGL_DLLEXPORT *m_glPopClientAttrib)(void); - void (QGL_DLLEXPORT *m_glPopMatrix)(void); - void (QGL_DLLEXPORT *m_glPopName)(void); - void (QGL_DLLEXPORT *m_glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities); - void (QGL_DLLEXPORT *m_glPushAttrib)(GLbitfield mask); - void (QGL_DLLEXPORT *m_glPushClientAttrib)(GLbitfield mask); - void (QGL_DLLEXPORT *m_glPushMatrix)(void); - void (QGL_DLLEXPORT *m_glPushName)(GLuint name); - void (QGL_DLLEXPORT *m_glRasterPos2d)(GLdouble x, GLdouble y); - void (QGL_DLLEXPORT *m_glRasterPos2dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glRasterPos2f)(GLfloat x, GLfloat y); - void (QGL_DLLEXPORT *m_glRasterPos2fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glRasterPos2i)(GLint x, GLint y); - void (QGL_DLLEXPORT *m_glRasterPos2iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glRasterPos2s)(GLshort x, GLshort y); - void (QGL_DLLEXPORT *m_glRasterPos2sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glRasterPos3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glRasterPos3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glRasterPos3i)(GLint x, GLint y, GLint z); - void (QGL_DLLEXPORT *m_glRasterPos3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glRasterPos3s)(GLshort x, GLshort y, GLshort z); - void (QGL_DLLEXPORT *m_glRasterPos3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QGL_DLLEXPORT *m_glRasterPos4dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QGL_DLLEXPORT *m_glRasterPos4fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glRasterPos4i)(GLint x, GLint y, GLint z, GLint w); - void (QGL_DLLEXPORT *m_glRasterPos4iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); - void (QGL_DLLEXPORT *m_glRasterPos4sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glReadBuffer)(GLenum mode); - void (QGL_DLLEXPORT *m_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); - void (QGL_DLLEXPORT *m_glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); - void (QGL_DLLEXPORT *m_glRectdv)(const GLdouble *v1, const GLdouble *v2); - void (QGL_DLLEXPORT *m_glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); - void (QGL_DLLEXPORT *m_glRectfv)(const GLfloat *v1, const GLfloat *v2); - void (QGL_DLLEXPORT *m_glRecti)(GLint x1, GLint y1, GLint x2, GLint y2); - void (QGL_DLLEXPORT *m_glRectiv)(const GLint *v1, const GLint *v2); - void (QGL_DLLEXPORT *m_glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); - void (QGL_DLLEXPORT *m_glRectsv)(const GLshort *v1, const GLshort *v2); - GLint (QGL_DLLEXPORT *m_glRenderMode)(GLenum mode); - void (QGL_DLLEXPORT *m_glRotated)(GLdouble anm_gle, GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glRotatef)(GLfloat anm_gle, GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glScaled)(GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glScalef)(GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height); - void (QGL_DLLEXPORT *m_glSelectBuffer)(GLsizei size, GLuint *buffer); - void (QGL_DLLEXPORT *m_glShadeModel)(GLenum mode); - void (QGL_DLLEXPORT *m_glStencilFunc)(GLenum func, GLint ref, GLuint mask); - void (QGL_DLLEXPORT *m_glStencilMask)(GLuint mask); - void (QGL_DLLEXPORT *m_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass); - void (QGL_DLLEXPORT *m_glTexCoord1d)(GLdouble s); - void (QGL_DLLEXPORT *m_glTexCoord1dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glTexCoord1f)(GLfloat s); - void (QGL_DLLEXPORT *m_glTexCoord1fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glTexCoord1i)(GLint s); - void (QGL_DLLEXPORT *m_glTexCoord1iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glTexCoord1s)(GLshort s); - void (QGL_DLLEXPORT *m_glTexCoord1sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glTexCoord2d)(GLdouble s, GLdouble t); - void (QGL_DLLEXPORT *m_glTexCoord2dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glTexCoord2f)(GLfloat s, GLfloat t); - void (QGL_DLLEXPORT *m_glTexCoord2fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glTexCoord2i)(GLint s, GLint t); - void (QGL_DLLEXPORT *m_glTexCoord2iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glTexCoord2s)(GLshort s, GLshort t); - void (QGL_DLLEXPORT *m_glTexCoord2sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r); - void (QGL_DLLEXPORT *m_glTexCoord3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r); - void (QGL_DLLEXPORT *m_glTexCoord3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glTexCoord3i)(GLint s, GLint t, GLint r); - void (QGL_DLLEXPORT *m_glTexCoord3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glTexCoord3s)(GLshort s, GLshort t, GLshort r); - void (QGL_DLLEXPORT *m_glTexCoord3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); - void (QGL_DLLEXPORT *m_glTexCoord4dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); - void (QGL_DLLEXPORT *m_glTexCoord4fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glTexCoord4i)(GLint s, GLint t, GLint r, GLint q); - void (QGL_DLLEXPORT *m_glTexCoord4iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); - void (QGL_DLLEXPORT *m_glTexCoord4sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glTexEnvf)(GLenum target, GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glTexEnvi)(GLenum target, GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glTexEnviv)(GLenum target, GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glTexGend)(GLenum coord, GLenum pname, GLdouble param); - void (QGL_DLLEXPORT *m_glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params); - void (QGL_DLLEXPORT *m_glTexGenf)(GLenum coord, GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glTexGeni)(GLenum coord, GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glTexGeniv)(GLenum coord, GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTexParameterf)(GLenum target, GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); - void (QGL_DLLEXPORT *m_glTexParameteri)(GLenum target, GLenum pname, GLint param); - void (QGL_DLLEXPORT *m_glTexParameteriv)(GLenum target, GLenum pname, const GLint *params); - void (QGL_DLLEXPORT *m_glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTranslated)(GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glTranslatef)(GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glVertex2d)(GLdouble x, GLdouble y); - void (QGL_DLLEXPORT *m_glVertex2dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertex2f)(GLfloat x, GLfloat y); - void (QGL_DLLEXPORT *m_glVertex2fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertex2i)(GLint x, GLint y); - void (QGL_DLLEXPORT *m_glVertex2iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glVertex2s)(GLshort x, GLshort y); - void (QGL_DLLEXPORT *m_glVertex2sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glVertex3d)(GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glVertex3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertex3f)(GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glVertex3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertex3i)(GLint x, GLint y, GLint z); - void (QGL_DLLEXPORT *m_glVertex3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glVertex3s)(GLshort x, GLshort y, GLshort z); - void (QGL_DLLEXPORT *m_glVertex3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QGL_DLLEXPORT *m_glVertex4dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QGL_DLLEXPORT *m_glVertex4fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertex4i)(GLint x, GLint y, GLint z, GLint w); - void (QGL_DLLEXPORT *m_glVertex4iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); - void (QGL_DLLEXPORT *m_glVertex4sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height); - - // GL_ARB_multitexture - bool support_ARB_multitexture; - bool ARB_multitexture() - { - return support_ARB_multitexture; - } - void (QGL_DLLEXPORT *m_glActiveTextureARB)(GLenum texture); - void (QGL_DLLEXPORT *m_glClientActiveTextureARB)(GLenum texture); - void (QGL_DLLEXPORT *m_glMultiTexCoord1dARB)(GLenum target, GLdouble s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1dvARB)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1fARB)(GLenum target, GLfloat s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1fvARB)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1iARB)(GLenum target, GLint s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1ivARB)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1sARB)(GLenum target, GLshort s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1svARB)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2dARB)(GLenum target, GLdouble s); - void (QGL_DLLEXPORT *m_glMultiTexCoord2dvARB)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2fARB)(GLenum target, GLfloat s); - void (QGL_DLLEXPORT *m_glMultiTexCoord2fvARB)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2iARB)(GLenum target, GLint s); - void (QGL_DLLEXPORT *m_glMultiTexCoord2ivARB)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2sARB)(GLenum target, GLshort s); - void (QGL_DLLEXPORT *m_glMultiTexCoord2svARB)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3dARB)(GLenum target, GLdouble s); - void (QGL_DLLEXPORT *m_glMultiTexCoord3dvARB)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3fARB)(GLenum target, GLfloat s); - void (QGL_DLLEXPORT *m_glMultiTexCoord3fvARB)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3iARB)(GLenum target, GLint s); - void (QGL_DLLEXPORT *m_glMultiTexCoord3ivARB)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3sARB)(GLenum target, GLshort s); - void (QGL_DLLEXPORT *m_glMultiTexCoord3svARB)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4dARB)(GLenum target, GLdouble s); - void (QGL_DLLEXPORT *m_glMultiTexCoord4dvARB)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4fARB)(GLenum target, GLfloat s); - void (QGL_DLLEXPORT *m_glMultiTexCoord4fvARB)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4iARB)(GLenum target, GLint s); - void (QGL_DLLEXPORT *m_glMultiTexCoord4ivARB)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4sARB)(GLenum target, GLshort s); - void (QGL_DLLEXPORT *m_glMultiTexCoord4svARB)(GLenum target, const GLshort *v); - - // ARB_texture_compression - bool support_ARB_texture_compression; - bool ARB_texture_compression() - { - return support_ARB_texture_compression; - } - void (QGL_DLLEXPORT *m_glCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid* data); - void (QGL_DLLEXPORT *m_glGetCompressedTexImageARB)(GLenum target, GLint lod, GLvoid* img); - - // EXT_texture_compression_s3tc - bool support_EXT_texture_compression_s3tc; - bool EXT_texture_compression_s3tc() - { - return support_EXT_texture_compression_s3tc; - } - - // GL 1.2 - bool support_GL_1_2; - bool GL_1_2() - { - return support_GL_1_2; - } - void (QGL_DLLEXPORT *m_glCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - void (QGL_DLLEXPORT *m_glDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); - void (QGL_DLLEXPORT *m_glTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - void (QGL_DLLEXPORT *m_glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - - // GL 1.3 - bool support_GL_1_3; - bool GL_1_3() - { - return support_GL_1_3; - } - void (QGL_DLLEXPORT *m_glActiveTexture)(GLenum texture); - void (QGL_DLLEXPORT *m_glClientActiveTexture)(GLenum texture); - void (QGL_DLLEXPORT *m_glCompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); - void (QGL_DLLEXPORT *m_glGetCompressedTexImage)(GLenum target, GLint lod, GLvoid *img); - void (QGL_DLLEXPORT *m_glLoadTransposeMatrixd)(const GLdouble m[16]); - void (QGL_DLLEXPORT *m_glLoadTransposeMatrixf)(const GLfloat m[16]); - void (QGL_DLLEXPORT *m_glMultTransposeMatrixd)(const GLdouble m[16]); - void (QGL_DLLEXPORT *m_glMultTransposeMatrixf)(const GLfloat m[16]); - void (QGL_DLLEXPORT *m_glMultiTexCoord1d)(GLenum target, GLdouble s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1dv)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1f)(GLenum target, GLfloat s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1fv)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1i)(GLenum target, GLint s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1iv)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord1s)(GLenum target, GLshort s); - void (QGL_DLLEXPORT *m_glMultiTexCoord1sv)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t); - void (QGL_DLLEXPORT *m_glMultiTexCoord2dv)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t); - void (QGL_DLLEXPORT *m_glMultiTexCoord2fv)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2i)(GLenum target, GLint s, GLint t); - void (QGL_DLLEXPORT *m_glMultiTexCoord2iv)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord2s)(GLenum target, GLshort s, GLshort t); - void (QGL_DLLEXPORT *m_glMultiTexCoord2sv)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r); - void (QGL_DLLEXPORT *m_glMultiTexCoord3dv)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r); - void (QGL_DLLEXPORT *m_glMultiTexCoord3fv)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r); - void (QGL_DLLEXPORT *m_glMultiTexCoord3iv)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r); - void (QGL_DLLEXPORT *m_glMultiTexCoord3sv)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); - void (QGL_DLLEXPORT *m_glMultiTexCoord4dv)(GLenum target, const GLdouble *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); - void (QGL_DLLEXPORT *m_glMultiTexCoord4fv)(GLenum target, const GLfloat *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q); - void (QGL_DLLEXPORT *m_glMultiTexCoord4iv)(GLenum target, const GLint *v); - void (QGL_DLLEXPORT *m_glMultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); - void (QGL_DLLEXPORT *m_glMultiTexCoord4sv)(GLenum target, const GLshort *v); - void (QGL_DLLEXPORT *m_glSampleCoverage)(GLclampf value, GLboolean invert); - - // GL 1.4 - bool support_GL_1_4; - bool GL_1_4() - { - return support_GL_1_4; - } - void (QGL_DLLEXPORT *m_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - void (QGL_DLLEXPORT *m_glBlendEquation)(GLenum mode); - void (QGL_DLLEXPORT *m_glBlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - void (QGL_DLLEXPORT *m_glFogCoordPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glFogCoordd)(GLdouble coord); - void (QGL_DLLEXPORT *m_glFogCoorddv)(const GLdouble *coord); - void (QGL_DLLEXPORT *m_glFogCoordf)(GLfloat coord); - void (QGL_DLLEXPORT *m_glFogCoordfv)(const GLfloat *coord); - void (QGL_DLLEXPORT *m_glMultiDrawArrays)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); - void (QGL_DLLEXPORT *m_glMultiDrawElements)(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); - void (QGL_DLLEXPORT *m_glPointParameterf)(GLenum pname, GLfloat param); - void (QGL_DLLEXPORT *m_glPointParameterfv)(GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glSecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3bv)(const GLbyte *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3dv)(const GLdouble *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3fv)(const GLfloat *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3i)(GLint red, GLint green, GLint blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3iv)(const GLint *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3s)(GLshort red, GLshort green, GLshort blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3sv)(const GLshort *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3ubv)(const GLubyte *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3ui)(GLuint red, GLuint green, GLuint blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3uiv)(const GLuint *v); - void (QGL_DLLEXPORT *m_glSecondaryColor3us)(GLushort red, GLushort green, GLushort blue); - void (QGL_DLLEXPORT *m_glSecondaryColor3usv)(const GLushort *v); - void (QGL_DLLEXPORT *m_glSecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, GLvoid *pointer); - void (QGL_DLLEXPORT *m_glWindowPos2d)(GLdouble x, GLdouble y); - void (QGL_DLLEXPORT *m_glWindowPos2dv)(const GLdouble *p); - void (QGL_DLLEXPORT *m_glWindowPos2f)(GLfloat x, GLfloat y); - void (QGL_DLLEXPORT *m_glWindowPos2fv)(const GLfloat *p); - void (QGL_DLLEXPORT *m_glWindowPos2i)(GLint x, GLint y); - void (QGL_DLLEXPORT *m_glWindowPos2iv)(const GLint *p); - void (QGL_DLLEXPORT *m_glWindowPos2s)(GLshort x, GLshort y); - void (QGL_DLLEXPORT *m_glWindowPos2sv)(const GLshort *p); - void (QGL_DLLEXPORT *m_glWindowPos3d)(GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glWindowPos3dv)(const GLdouble *p); - void (QGL_DLLEXPORT *m_glWindowPos3f)(GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glWindowPos3fv)(const GLfloat *p); - void (QGL_DLLEXPORT *m_glWindowPos3i)(GLint x, GLint y, GLint z); - void (QGL_DLLEXPORT *m_glWindowPos3iv)(const GLint *p); - void (QGL_DLLEXPORT *m_glWindowPos3s)(GLshort x, GLshort y, GLshort z); - void (QGL_DLLEXPORT *m_glWindowPos3sv)(const GLshort *p); - - // GL 1.5 - bool support_GL_1_5; - bool GL_1_5() - { - return support_GL_1_5; - } - void (QGL_DLLEXPORT *m_glBeginQuery)(GLenum target, GLuint id); - void (QGL_DLLEXPORT *m_glBindBuffer)(GLenum target, GLuint buffer); - void (QGL_DLLEXPORT *m_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); - void (QGL_DLLEXPORT *m_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); - void (QGL_DLLEXPORT *m_glDeleteBuffers)(GLsizei n, const GLuint* buffers); - void (QGL_DLLEXPORT *m_glDeleteQueries)(GLsizei n, const GLuint* ids); - void (QGL_DLLEXPORT *m_glEndQuery)(GLenum target); - void (QGL_DLLEXPORT *m_glGenBuffers)(GLsizei n, GLuint* buffers); - void (QGL_DLLEXPORT *m_glGenQueries)(GLsizei n, GLuint* ids); - void (QGL_DLLEXPORT *m_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params); - void (QGL_DLLEXPORT *m_glGetBufferPointerv)(GLenum target, GLenum pname, GLvoid** params); - void (QGL_DLLEXPORT *m_glGetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); - void (QGL_DLLEXPORT *m_glGetQueryObjectiv)(GLuint id, GLenum pname, GLint* params); - void (QGL_DLLEXPORT *m_glGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint* params); - void (QGL_DLLEXPORT *m_glGetQueryiv)(GLenum target, GLenum pname, GLint params); - GLboolean (QGL_DLLEXPORT *m_glIsBuffer)(GLuint buffer); - GLboolean (QGL_DLLEXPORT *m_glIsQuery)(GLuint id); - GLvoid* (QGL_DLLEXPORT *m_glMapBuffer)(GLenum target, GLenum access); - GLboolean (QGL_DLLEXPORT *m_glUnmapBuffer)(GLenum target); - - // GL_ARB_vertex_program - bool support_ARB_vertex_program; - bool ARB_vertex_program() - { - return support_ARB_vertex_program; - } - void (QGL_DLLEXPORT *m_glVertexAttrib1sARB)(GLuint index, GLshort x); - void (QGL_DLLEXPORT *m_glVertexAttrib1fARB)(GLuint index, GLfloat x); - void (QGL_DLLEXPORT *m_glVertexAttrib1dARB)(GLuint index, GLdouble x); - void (QGL_DLLEXPORT *m_glVertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); - void (QGL_DLLEXPORT *m_glVertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); - void (QGL_DLLEXPORT *m_glVertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); - void (QGL_DLLEXPORT *m_glVertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); - void (QGL_DLLEXPORT *m_glVertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); - void (QGL_DLLEXPORT *m_glVertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); - void (QGL_DLLEXPORT *m_glVertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); - void (QGL_DLLEXPORT *m_glVertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QGL_DLLEXPORT *m_glVertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QGL_DLLEXPORT *m_glVertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); - void (QGL_DLLEXPORT *m_glVertexAttrib1svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib1fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib1dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4bvARB)(GLuint index, const GLbyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4ivARB)(GLuint index, const GLint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4ubvARB)(GLuint index, const GLubyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4usvARB)(GLuint index, const GLushort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4uivARB)(GLuint index, const GLuint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NbvARB)(GLuint index, const GLbyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NsvARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NivARB)(GLuint index, const GLint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NubvARB)(GLuint index, const GLubyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NusvARB)(GLuint index, const GLushort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NuivARB)(GLuint index, const GLuint *v); - void (QGL_DLLEXPORT *m_glVertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glEnableVertexAttribArrayARB)(GLuint index); - void (QGL_DLLEXPORT *m_glDisableVertexAttribArrayARB)(GLuint index); - void (QGL_DLLEXPORT *m_glProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid *string); - void (QGL_DLLEXPORT *m_glBindProgramARB)(GLenum target, GLuint program); - void (QGL_DLLEXPORT *m_glDeleteProgramsARB)(GLsizei n, const GLuint *programs); - void (QGL_DLLEXPORT *m_glGenProgramsARB)(GLsizei n, GLuint *programs); - void (QGL_DLLEXPORT *m_glProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QGL_DLLEXPORT *m_glProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params); - void (QGL_DLLEXPORT *m_glProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QGL_DLLEXPORT *m_glProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params); - void (QGL_DLLEXPORT *m_glProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QGL_DLLEXPORT *m_glProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params); - void (QGL_DLLEXPORT *m_glProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QGL_DLLEXPORT *m_glProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params); - void (QGL_DLLEXPORT *m_glGetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble *params); - void (QGL_DLLEXPORT *m_glGetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble *params); - void (QGL_DLLEXPORT *m_glGetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetProgramivARB)(GLenum target, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetProgramStringARB)(GLenum target, GLenum pname, GLvoid *string); - void (QGL_DLLEXPORT *m_glGetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer); - GLboolean (QGL_DLLEXPORT *m_glIsProgramARB)(GLuint program); - - // GL_ARB_fragment_program - bool support_ARB_fragment_program; - bool ARB_fragment_program() - { - return support_ARB_fragment_program; - } - - // GL_ARB_shader_objects - bool support_ARB_shader_objects; - bool ARB_shader_objects() - { - return support_ARB_shader_objects; - } - void (QGL_DLLEXPORT *m_glDeleteObjectARB)(GLhandleARB obj); - GLhandleARB (QGL_DLLEXPORT *m_glGetHandleARB)(GLenum pname); - void (QGL_DLLEXPORT *m_glDetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); - GLhandleARB (QGL_DLLEXPORT *m_glCreateShaderObjectARB)(GLenum shaderType); - void (QGL_DLLEXPORT *m_glShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); - void (QGL_DLLEXPORT *m_glCompileShaderARB)(GLhandleARB shaderObj); - GLhandleARB (QGL_DLLEXPORT *m_glCreateProgramObjectARB)(void); - void (QGL_DLLEXPORT *m_glAttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); - void (QGL_DLLEXPORT *m_glLinkProgramARB)(GLhandleARB programObj); - void (QGL_DLLEXPORT *m_glUseProgramObjectARB)(GLhandleARB programObj); - void (QGL_DLLEXPORT *m_glValidateProgramARB)(GLhandleARB programObj); - void (QGL_DLLEXPORT *m_glUniform1fARB)(GLint location, GLfloat v0); - void (QGL_DLLEXPORT *m_glUniform2fARB)(GLint location, GLfloat v0, GLfloat v1); - void (QGL_DLLEXPORT *m_glUniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); - void (QGL_DLLEXPORT *m_glUniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); - void (QGL_DLLEXPORT *m_glUniform1iARB)(GLint location, GLint v0); - void (QGL_DLLEXPORT *m_glUniform2iARB)(GLint location, GLint v0, GLint v1); - void (QGL_DLLEXPORT *m_glUniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); - void (QGL_DLLEXPORT *m_glUniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); - void (QGL_DLLEXPORT *m_glUniform1fvARB)(GLint location, GLsizei count, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniform2fvARB)(GLint location, GLsizei count, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniform3fvARB)(GLint location, GLsizei count, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniform4fvARB)(GLint location, GLsizei count, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniform1ivARB)(GLint location, GLsizei count, const GLint *value); - void (QGL_DLLEXPORT *m_glUniform2ivARB)(GLint location, GLsizei count, const GLint *value); - void (QGL_DLLEXPORT *m_glUniform3ivARB)(GLint location, GLsizei count, const GLint *value); - void (QGL_DLLEXPORT *m_glUniform4ivARB)(GLint location, GLsizei count, const GLint *value); - void (QGL_DLLEXPORT *m_glUniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (QGL_DLLEXPORT *m_glUniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (QGL_DLLEXPORT *m_glGetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); - void (QGL_DLLEXPORT *m_glGetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); - GLint (QGL_DLLEXPORT *m_glGetUniformLocationARB)(GLhandleARB programObj, const GLcharARB *name); - void (QGL_DLLEXPORT *m_glGetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); - void (QGL_DLLEXPORT *m_glGetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetUniformivARB)(GLhandleARB programObj, GLint location, GLint *params); - void (QGL_DLLEXPORT *m_glGetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); - - // GL_ARB_vertex_shader - bool support_ARB_vertex_shader; - bool ARB_vertex_shader() - { - return support_ARB_vertex_shader; - } -#if 0 - void (QGL_DLLEXPORT *m_glVertexAttrib1fARB)(GLuint index, GLfloat v0); - void (QGL_DLLEXPORT *m_glVertexAttrib1sARB)(GLuint index, GLshort v0); - void (QGL_DLLEXPORT *m_glVertexAttrib1dARB)(GLuint index, GLdouble v0); - void (QGL_DLLEXPORT *m_glVertexAttrib2fARB)(GLuint index, GLfloat v0, GLfloat v1); - void (QGL_DLLEXPORT *m_glVertexAttrib2sARB)(GLuint index, GLshort v0, GLshort v1); - void (QGL_DLLEXPORT *m_glVertexAttrib2dARB)(GLuint index, GLdouble v0, GLdouble v1); - void (QGL_DLLEXPORT *m_glVertexAttrib3fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2); - void (QGL_DLLEXPORT *m_glVertexAttrib3sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2); - void (QGL_DLLEXPORT *m_glVertexAttrib3dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2); - void (QGL_DLLEXPORT *m_glVertexAttrib4fARB)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); - void (QGL_DLLEXPORT *m_glVertexAttrib4sARB)(GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3); - void (QGL_DLLEXPORT *m_glVertexAttrib4dARB)(GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); - void (QGL_DLLEXPORT *m_glVertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); - void (QGL_DLLEXPORT *m_glVertexAttrib1fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib1svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib1dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib2dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib3dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4fvARB)(GLuint index, const GLfloat *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4svARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4dvARB)(GLuint index, const GLdouble *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4ivARB)(GLuint index, const GLint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4bvARB)(GLuint index, const GLbyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4ubvARB)(GLuint index, const GLubyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4usvARB)(GLuint index, const GLushort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4uivARB)(GLuint index, const GLuint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NbvARB)(GLuint index, const GLbyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NsvARB)(GLuint index, const GLshort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NivARB)(GLuint index, const GLint *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NubvARB)(GLuint index, const GLubyte *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NusvARB)(GLuint index, const GLushort *v); - void (QGL_DLLEXPORT *m_glVertexAttrib4NuivARB)(GLuint index, const GLuint *v); - void (QGL_DLLEXPORT *m_glVertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - void (QGL_DLLEXPORT *m_glEnableVertexAttribArrayARB)(GLuint index); - void (QGL_DLLEXPORT *m_glDisableVertexAttribArrayARB)(GLuint index); -#endif - void (QGL_DLLEXPORT *m_glBindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB *name); - void (QGL_DLLEXPORT *m_glGetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); - GLint (QGL_DLLEXPORT *m_glGetAttribLocationARB)(GLhandleARB programObj, const GLcharARB *name); -#if 0 - void (QGL_DLLEXPORT *m_glGetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params); - void (QGL_DLLEXPORT *m_glGetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer); -#endif - - // ARB_fragment_shader - bool support_ARB_fragment_shader; - bool ARB_fragment_shader() - { - return support_ARB_fragment_shader; - } - - // ARB_shading_language_100 - bool support_ARB_shading_language_100; - bool ARB_shading_language_100() - { - return support_ARB_shading_language_100; - } - - // GL_NV_vertex_program2 - bool support_NV_vertex_program2; - bool NV_vertex_program2() - { - return support_NV_vertex_program2; - } - GLboolean (QGL_DLLEXPORT* m_glAreProgramsResidentNV)(GLsizei, const GLuint *, GLboolean *); - void (QGL_DLLEXPORT* m_glBindProgramNV)(GLenum, GLuint); - void (QGL_DLLEXPORT* m_glDeleteProgramsNV)(GLsizei, const GLuint *); - void (QGL_DLLEXPORT* m_glExecuteProgramNV)(GLenum, GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glGenProgramsNV)(GLsizei, GLuint *); - void (QGL_DLLEXPORT* m_glGetProgramParameterdvNV)(GLenum, GLuint, GLenum, GLdouble *); - void (QGL_DLLEXPORT* m_glGetProgramParameterfvNV)(GLenum, GLuint, GLenum, GLfloat *); - void (QGL_DLLEXPORT* m_glGetProgramivNV)(GLuint, GLenum, GLint *); - void (QGL_DLLEXPORT* m_glGetProgramStringNV)(GLuint, GLenum, GLubyte *); - void (QGL_DLLEXPORT* m_glGetTrackMatrixivNV)(GLenum, GLuint, GLenum, GLint *); - void (QGL_DLLEXPORT* m_glGetVertexAttribdvNV)(GLuint, GLenum, GLdouble *); - void (QGL_DLLEXPORT* m_glGetVertexAttribfvNV)(GLuint, GLenum, GLfloat *); - void (QGL_DLLEXPORT* m_glGetVertexAttribivNV)(GLuint, GLenum, GLint *); - void (QGL_DLLEXPORT* m_glGetVertexAttribPointervNV)(GLuint, GLenum, GLvoid* *); - GLboolean (QGL_DLLEXPORT* m_glIsProgramNV)(GLuint); - void (QGL_DLLEXPORT* m_glLoadProgramNV)(GLenum, GLuint, GLsizei, const GLubyte *); - void (QGL_DLLEXPORT* m_glProgramParameter4fNV)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); - void (QGL_DLLEXPORT* m_glProgramParameter4fvNV)(GLenum, GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glProgramParameters4fvNV)(GLenum, GLuint, GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glRequestResidentProgramsNV)(GLsizei, const GLuint *); - void (QGL_DLLEXPORT* m_glTrackMatrixNV)(GLenum, GLuint, GLenum, GLenum); - void (QGL_DLLEXPORT* m_glVertexAttribPointerNV)(GLuint, GLint, GLenum, GLsizei, const GLvoid *); - void (QGL_DLLEXPORT* m_glVertexAttrib1fNV)(GLuint, GLfloat); - void (QGL_DLLEXPORT* m_glVertexAttrib1fvNV)(GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttrib2fNV)(GLuint, GLfloat, GLfloat); - void (QGL_DLLEXPORT* m_glVertexAttrib2fvNV)(GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttrib3fNV)(GLuint, GLfloat, GLfloat, GLfloat); - void (QGL_DLLEXPORT* m_glVertexAttrib3fvNV)(GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttrib4fNV)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); - void (QGL_DLLEXPORT* m_glVertexAttrib4fvNV)(GLuint, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttribs1fvNV)(GLuint, GLsizei, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttribs2fvNV)(GLuint, GLsizei, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttribs3fvNV)(GLuint, GLsizei, const GLfloat *); - void (QGL_DLLEXPORT* m_glVertexAttribs4fvNV)(GLuint, GLsizei, const GLfloat *); - - // GL_NV_fragment_program - bool support_NV_fragment_program; - bool NV_fragment_program() - { - return support_NV_fragment_program; - } - void (QGL_DLLEXPORT* m_glProgramNamedParameter4fNV)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); - void (QGL_DLLEXPORT* m_glProgramNamedParameter4fvNV)(GLuint, GLsizei, const GLubyte *, const GLfloat *); - void (QGL_DLLEXPORT* m_glGetProgramNamedParameterfvNV)(GLuint, GLsizei, const GLubyte *, GLfloat *); +public: + virtual ~IGL2DWindow() { } + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + virtual void Draw2D( VIEWTYPE vt ) = 0; }; -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalOpenGLModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalOpenGLModuleRef; - -inline OpenGLBinding& GlobalOpenGL() +// 3D window +class IGL3DWindow { - return GlobalOpenGLModule::getTable(); -} +public: + virtual ~IGL3DWindow() { } + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + virtual void Draw3D() = 0; +}; -#if defined(_DEBUG) -inline void GlobalOpenGL_debugAssertNoErrors() -{ - GlobalOpenGL().assertNoErrors(); -} -#else -inline void GlobalOpenGL_debugAssertNoErrors() -{ -} -#endif +#define QGL_MAJOR "qgl" +#include + +typedef void (APIENTRY* PFN_QGLALPHAFUNC) (GLenum func, GLclampf ref); +typedef void (APIENTRY* PFN_QGLBEGIN) (GLenum); +typedef void (APIENTRY* PFN_QGLBINDTEXTURE) (GLenum target, GLuint texture); +typedef void (APIENTRY* PFN_QGLBLENDFUNC) (GLenum sfactor, GLenum dfactor); +typedef void (APIENTRY* PFN_QGLCALLLIST) (GLuint list); +typedef void (APIENTRY* PFN_QGLCALLLISTS) (GLsizei n, GLenum type, const GLvoid *lists); +typedef void (APIENTRY* PFN_QGLCLEAR) (GLbitfield mask); +typedef void (APIENTRY* PFN_QGLCLEARCOLOR) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY* PFN_QGLCLEARDEPTH) (GLclampd depth); +typedef void (APIENTRY* PFN_QGLCOLOR3F) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY* PFN_QGLCOLOR3FV) (const GLfloat *v); +typedef void (APIENTRY* PFN_QGLCOLOR4F) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRY* PFN_QGLCOLOR4FV) (const GLfloat *v); +typedef void (APIENTRY* PFN_QGLCOLOR4UBV) (const GLubyte *v); +typedef void (APIENTRY* PFN_QGLCOLORPOINTER) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY* PFN_QGLCULLFACE) (GLenum mode); +typedef void (APIENTRY* PFN_QGLDELETELISTS) (GLuint list, GLsizei range); +typedef void (APIENTRY* PFN_QGLDELETETEXTURES) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY* PFN_QGLDEPTHFUNC) (GLenum func); +typedef void (APIENTRY* PFN_QGLDEPTHMASK) (GLboolean flag); +typedef void (APIENTRY* PFN_QGLDISABLE) (GLenum cap); +typedef void (APIENTRY* PFN_QGLDISABLECLIENTSTATE) (GLenum array); +typedef void (APIENTRY* PFN_QGLDRAWELEMENTS) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY* PFN_QGLENABLE) (GLenum cap); +typedef void (APIENTRY* PFN_QGLENABLECLIENTSTATE) (GLenum array); +typedef void (APIENTRY* PFN_QGLEND) (); +typedef void (APIENTRY* PFN_QGLENDLIST) (); +typedef void (APIENTRY* PFN_QGLFOGF) (GLenum pname, GLfloat param); +typedef void (APIENTRY* PFN_QGLFOGFV) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY* PFN_QGLFOGFI) (GLenum pname, GLint param); +typedef GLuint (APIENTRY* PFN_QGLGENLISTS) (GLsizei range); +typedef void (APIENTRY *PFN_QGLGENTEXTURES) (GLsizei n, GLuint *textures); +typedef void (APIENTRY* PFN_QGLGETDOUBLEV) (GLenum pname, GLdouble *params); +typedef void (APIENTRY* PFN_QGLHINT) (GLenum target, GLenum mode); +typedef void (APIENTRY* PFN_QGLGETINTEGERV) (GLenum pname, GLint *params); +typedef void (APIENTRY* PFN_QGLLIGHTFV) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRY* PFN_QGLLINEWIDTH) (GLfloat size); +typedef void (APIENTRY* PFN_QGLLINESTIPPLE) (GLint factor, GLushort pattern); +typedef void (APIENTRY* PFN_QGLLINEWIDTH) (GLfloat size); +typedef void (APIENTRY* PFN_QGLLISTBASE) (GLuint base); +typedef void (APIENTRY* PFN_QGLLOADIDENTITY) (); +typedef void (APIENTRY* PFN_QGLMATERIALF) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY* PFN_QGLMATERIALFV) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRY* PFN_QGLMATRIXMODE) (GLenum mode); +typedef void (APIENTRY* PFN_QGLMULTMATRIXF) (const GLfloat *m); +typedef void (APIENTRY* PFN_QGLNEWLIST) (GLuint list, GLenum mode); +typedef void (APIENTRY* PFN_QGLNORMAL3F) (GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRY* PFN_QGLNORMAL3FV) (const GLfloat *n); +typedef void (APIENTRY* PFN_QGLNORMALPOINTER) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY* PFN_QGLORTHO) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRY* PFN_QGLPOINTSIZE) (GLfloat size); +typedef void (APIENTRY* PFN_QGLPOLYGONMODE) (GLenum face, GLenum mode); +typedef void (APIENTRY* PFN_QGLPOPATTRIB) (); +typedef void (APIENTRY* PFN_QGLPOPMATRIX) (); +typedef void (APIENTRY* PFN_QGLPUSHATTRIB) (GLbitfield mask); +typedef void (APIENTRY* PFN_QGLPUSHMATRIX) (); +typedef void (APIENTRY* PFN_QGLRASTERPOS3FV) (const GLfloat *v); +typedef void (APIENTRY* PFN_QGLROTATED) (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY* PFN_QGLROTATEF) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY* PFN_QGLSCALEF) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY* PFN_QGLSCISSOR) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY* PFN_QGLSCALEF) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY* PFN_QGLSHADEMODEL) (GLenum mode); +typedef void (APIENTRY* PFN_QGLTEXCOORD2F) (GLfloat s, GLfloat t); +typedef void (APIENTRY* PFN_QGLTEXCOORD2FV) (const GLfloat *v); +typedef void (APIENTRY* PFN_QGLTEXCOORDPOINTER) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY* PFN_QGLTEXENVF) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY* PFN_QGLTEXGENF) (GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRY* PFN_QGLTEXIMAGE1D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY* PFN_QGLTEXIMAGE2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY* PFN_QGLTEXPARAMETERF) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY* PFN_QGLTEXPARAMETERFV) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY* PFN_QGLTEXPARAMETERI) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY* PFN_QGLTEXPARAMETERIV) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY* PFN_QGLTEXSUBIMAGE1D) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY* PFN_QGLTEXSUBIMAGE2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY* PFN_QGLTRANSLATED) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY* PFN_QGLTRANSLATEF) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY* PFN_QGLVERTEX2F) (GLfloat x, GLfloat y); +typedef void (APIENTRY* PFN_QGLVERTEX3F) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY* PFN_QGLVERTEX3FV) (const GLfloat *v); +typedef void (APIENTRY* PFN_QGLVERTEXPOINTER) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY* PFN_QGLVIEWPORT) (GLint x, GLint y, GLsizei width, GLsizei height); + +typedef void (WINAPI* PFN_QE_CHECKOPENGLFORERRORS) (); + +// glu stuff +// TTimo: NOTE: relying on glu might not be such a good idea. On many systems, the GLU lib is outdated, misversioned etc. +typedef void (APIENTRY * PFN_QGLUPERSPECTIVE) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRY * PFN_QGLULOOKAT) (GLdouble eyex, GLdouble eyey, GLdouble eyez, + GLdouble centerx, GLdouble centery, GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz); +//++timo gluErrorString is defined but not exposed in the IGL interface + + +// plugins drawing inside the GL windows +//++timo TODO: add hooking into other windows (Z and .. texture??) +//+timo NOTE: this could be moved to the messaging system instead of having a dedicated interface <- yet I don't know how +typedef void (WINAPI* PFN_QERAPP_HOOKGL2DWINDOW) (IGL2DWindow *); +typedef void (WINAPI* PFN_QERAPP_UNHOOKGL2DWINDOW) (IGL2DWindow *); +typedef void (WINAPI* PFN_QERAPP_HOOKGL3DWINDOW) (IGL3DWindow *); +typedef void (WINAPI* PFN_QERAPP_UNHOOKGL3DWINDOW) (IGL3DWindow *); + +struct _QERQglTable +{ + //++timo do we really wanna play with versions ? + // float m_fVersion; + int m_nSize; + PFN_QGLALPHAFUNC m_pfn_qglAlphaFunc; + PFN_QGLBEGIN m_pfn_qglBegin; + PFN_QGLBINDTEXTURE m_pfn_qglBindTexture; + PFN_QGLBLENDFUNC m_pfn_qglBlendFunc; + PFN_QGLCALLLIST m_pfn_qglCallList; + PFN_QGLCLEAR m_pfn_qglClear; + PFN_QGLCLEARCOLOR m_pfn_qglClearColor; + PFN_QGLCALLLISTS m_pfn_qglCallLists; + PFN_QGLCLEARDEPTH m_pfn_qglClearDepth; + PFN_QGLCOLOR3F m_pfn_qglColor3f; + PFN_QGLCOLOR3FV m_pfn_qglColor3fv; + PFN_QGLCOLOR4F m_pfn_qglColor4f; + PFN_QGLCOLOR4FV m_pfn_qglColor4fv; + PFN_QGLCOLOR4UBV m_pfn_qglColor4ubv; // ydnar + PFN_QGLCOLORPOINTER m_pfn_qglColorPointer; + PFN_QGLCULLFACE m_pfn_qglCullFace; + PFN_QGLDELETELISTS m_pfn_qglDeleteLists; + PFN_QGLDELETETEXTURES m_pfn_qglDeleteTextures; + PFN_QGLDEPTHFUNC m_pfn_qglDepthFunc; + PFN_QGLDEPTHMASK m_pfn_qglDepthMask; + PFN_QGLDISABLE m_pfn_qglDisable; + PFN_QGLDISABLECLIENTSTATE m_pfn_qglDisableClientState; + PFN_QGLDRAWELEMENTS m_pfn_qglDrawElements; + PFN_QGLENABLE m_pfn_qglEnable; + PFN_QGLENABLECLIENTSTATE m_pfn_qglEnableClientState; + PFN_QGLEND m_pfn_qglEnd; + PFN_QGLENDLIST m_pfn_qglEndList; + PFN_QGLFOGF m_pfn_qglFogf; + PFN_QGLFOGFV m_pfn_qglFogfv; + PFN_QGLFOGFI m_pfn_qglFogi; + PFN_QGLGENLISTS m_pfn_qglGenLists; + PFN_QGLGENTEXTURES m_pfn_qglGenTextures; + PFN_QGLGETDOUBLEV m_pfn_qglGetDoublev; + PFN_QGLGETINTEGERV m_pfn_qglGetIntegerv; + PFN_QGLHINT m_pfn_qglHint; + PFN_QGLLIGHTFV m_pfn_qglLightfv; + PFN_QGLLINESTIPPLE m_pfn_qglLineStipple; + PFN_QGLLINEWIDTH m_pfn_qglLineWidth; + PFN_QGLLISTBASE m_pfn_qglListBase; + PFN_QGLLOADIDENTITY m_pfn_qglLoadIdentity; + PFN_QGLMATERIALF m_pfn_qglMaterialf; + PFN_QGLMATERIALFV m_pfn_qglMaterialfv; + PFN_QGLMATRIXMODE m_pfn_qglMatrixMode; + PFN_QGLMULTMATRIXF m_pfn_qglMultMatrixf; + PFN_QGLNEWLIST m_pfn_qglNewList; + PFN_QGLNORMAL3F m_pfn_qglNormal3f; + PFN_QGLNORMAL3FV m_pfn_qglNormal3fv; + PFN_QGLNORMALPOINTER m_pfn_qglNormalPointer; + PFN_QGLORTHO m_pfn_qglOrtho; + PFN_QGLPOINTSIZE m_pfn_qglPointSize; + PFN_QGLPOLYGONMODE m_pfn_qglPolygonMode; + PFN_QGLPOPATTRIB m_pfn_qglPopAttrib; + PFN_QGLPOPMATRIX m_pfn_qglPopMatrix; + PFN_QGLPUSHATTRIB m_pfn_qglPushAttrib; + PFN_QGLPUSHMATRIX m_pfn_qglPushMatrix; + PFN_QGLRASTERPOS3FV m_pfn_qglRasterPos3fv; + PFN_QGLROTATED m_pfn_qglRotated; + PFN_QGLROTATEF m_pfn_qglRotatef; + PFN_QGLSCALEF m_pfn_qglScalef; + PFN_QGLSCISSOR m_pfn_qglScissor; + PFN_QGLSHADEMODEL m_pfn_qglShadeModel; + PFN_QGLTEXCOORD2F m_pfn_qglTexCoord2f; + PFN_QGLTEXCOORD2FV m_pfn_qglTexCoord2fv; + PFN_QGLTEXCOORDPOINTER m_pfn_qglTexCoordPointer; + PFN_QGLTEXENVF m_pfn_qglTexEnvf; + PFN_QGLTEXGENF m_pfn_qglTexGenf; + PFN_QGLTEXIMAGE1D m_pfn_qglTexImage1D; + PFN_QGLTEXIMAGE2D m_pfn_qglTexImage2D; + PFN_QGLTEXPARAMETERF m_pfn_qglTexParameterf; + PFN_QGLTEXPARAMETERFV m_pfn_qglTexParameterfv; + PFN_QGLTEXPARAMETERI m_pfn_qglTexParameteri; + PFN_QGLTEXPARAMETERIV m_pfn_qglTexParameteriv; + PFN_QGLTEXSUBIMAGE1D m_pfn_qglTexSubImage1D; + PFN_QGLTEXSUBIMAGE2D m_pfn_qglTexSubImage2D; + PFN_QGLTRANSLATED m_pfn_qglTranslated; + PFN_QGLTRANSLATEF m_pfn_qglTranslatef; + PFN_QGLVERTEX2F m_pfn_qglVertex2f; + PFN_QGLVERTEX3F m_pfn_qglVertex3f; + PFN_QGLVERTEX3FV m_pfn_qglVertex3fv; + PFN_QGLVERTEXPOINTER m_pfn_qglVertexPointer; + PFN_QGLVIEWPORT m_pfn_qglViewport; + + PFN_QE_CHECKOPENGLFORERRORS m_pfn_QE_CheckOpenGLForErrors; + + // glu stuff + PFN_QGLUPERSPECTIVE m_pfn_qgluPerspective; + PFN_QGLULOOKAT m_pfn_qgluLookAt; + + // plugin entities drawing inside Radiant windows + PFN_QERAPP_HOOKGL2DWINDOW m_pfnHookGL2DWindow; + PFN_QERAPP_UNHOOKGL2DWINDOW m_pfnUnHookGL2DWindow; + PFN_QERAPP_HOOKGL3DWINDOW m_pfnHookGL3DWindow; + PFN_QERAPP_UNHOOKGL3DWINDOW m_pfnUnHookGL3DWindow; +}; #endif diff --git a/include/iglrender.cpp b/include/iglrender.cpp deleted file mode 100644 index 26d66ae0..00000000 --- a/include/iglrender.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "iglrender.h" - diff --git a/include/iglrender.h b/include/iglrender.h deleted file mode 100644 index 76216026..00000000 --- a/include/iglrender.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IGLRENDER_H) -#define INCLUDED_IGLRENDER_H - -#include "igl.h" -#include "generic/vector.h" -class AABB; -class Matrix4; - - -class GLProgram -{ -public: - virtual void enable() = 0; - virtual void disable() = 0; - virtual void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) = 0; -}; - -class OpenGLFogState -{ -public: - OpenGLFogState() : mode(GL_EXP), density(0), start(0), end(0), index(0), colour(1, 1, 1, 1) - { - } - GLenum mode; - GLfloat density; - GLfloat start; - GLfloat end; - GLint index; - Vector4 colour; -}; - -//! A collection of opengl state information. -class OpenGLState -{ -public: - enum ESort - { - eSortFirst = 0, - eSortOpaque = 1, - eSortMultiFirst = 2, - eSortMultiLast = 1023, - eSortOverbrighten = 1024, - eSortFullbright = 1025, - eSortHighlight = 1026, - eSortTranslucent = 1027, - eSortOverlayFirst = 1028, - eSortOverlayLast = 2047, - eSortControlFirst = 2048, - eSortControlLast = 3071, - eSortGUI0 = 3072, - eSortGUI1 = 3073, - eSortLast = 4096, - }; - - unsigned int m_state; - std::size_t m_sort; - GLint m_texture; - GLint m_texture1; - GLint m_texture2; - GLint m_texture3; - GLint m_texture4; - GLint m_texture5; - GLint m_texture6; - GLint m_texture7; - Vector4 m_colour; - GLenum m_blend_src, m_blend_dst; - GLenum m_depthfunc; - GLenum m_alphafunc; - GLfloat m_alpharef; - GLfloat m_linewidth; - GLfloat m_pointsize; - GLint m_linestipple_factor; - GLushort m_linestipple_pattern; - OpenGLFogState m_fog; - GLProgram* m_program; - - OpenGLState() : m_program(0) - { - } -}; - -class OpenGLStateLibrary -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "openglshaderlibrary"); - - virtual void getDefaultState(OpenGLState& state) const = 0; - - virtual void insert(const char* name, const OpenGLState& state) = 0; - virtual void erase(const char* name) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalOpenGLStateLibraryModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalOpenGLStateLibraryModuleRef; - -inline OpenGLStateLibrary& GlobalOpenGLStateLibrary() -{ - return GlobalOpenGLStateLibraryModule::getTable(); -} - -#endif diff --git a/include/igtkgl.cpp b/include/igtkgl.cpp deleted file mode 100644 index 1180d547..00000000 --- a/include/igtkgl.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "igtkgl.h" - diff --git a/include/igtkgl.h b/include/igtkgl.h deleted file mode 100644 index 6a0a631f..00000000 --- a/include/igtkgl.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IGTKGL_H) -#define INCLUDED_IGTKGL_H - -#include "generic/constant.h" - -typedef struct _GtkWidget GtkWidget; -typedef int gint; -typedef gint gboolean; - -struct _QERGtkGLTable -{ - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "gtkgl"); - - GtkWidget* (*glwidget_new)(gboolean zbufffer); - void (*glwidget_swap_buffers)(GtkWidget* widget); - gboolean(*glwidget_make_current)(GtkWidget* widget); - void (*glwidget_destroy_context)(GtkWidget* widget); - void (*glwidget_create_context)(GtkWidget* widget); -}; - -#endif diff --git a/include/iimage.cpp b/include/iimage.cpp deleted file mode 100644 index a95ab6d3..00000000 --- a/include/iimage.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iimage.h" - diff --git a/include/iimage.h b/include/iimage.h index f6020bd8..6335082b 100644 --- a/include/iimage.h +++ b/include/iimage.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,57 +19,22 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IIMAGE_H) -#define INCLUDED_IIMAGE_H +// +// Plugin interface for loading image files +// -#include "generic/constant.h" +#ifndef _IIMAGE_H_ +#define _IIMAGE_H_ -typedef unsigned char byte; +#define IMAGE_MAJOR "image" -class Image -{ -public: - virtual void release() = 0; - virtual byte* getRGBAPixels() const = 0; - virtual unsigned int getWidth() const = 0; - virtual unsigned int getHeight() const = 0; - - virtual int getSurfaceFlags() const - { - return 0; - } - virtual int getContentFlags() const - { - return 0; - } - virtual int getValue() const - { - return 0; - } -}; - -class ArchiveFile; +// Load an image file +typedef void (* PFN_QERPLUG_LOADIMAGE) (const char *name, unsigned char **pic, int *width, int *height); struct _QERPlugImageTable { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "image"); - - /// Read an image from the file. - /// Returns 0 if the image could not be read. - Image* (*loadImage)(ArchiveFile& file); + int m_nSize; + PFN_QERPLUG_LOADIMAGE m_pfnLoadImage; }; -template -class ModuleRef; -typedef ModuleRef<_QERPlugImageTable> ImageModuleRef; - -template -class Modules; -typedef Modules<_QERPlugImageTable> ImageModules; - -template -class ModulesRef; -typedef ModulesRef<_QERPlugImageTable> ImageModulesRef; - -#endif // _IIMAGE_H +#endif // _IIMAGE_H_ diff --git a/include/imap.cpp b/include/imap.cpp deleted file mode 100644 index 0b363b5e..00000000 --- a/include/imap.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "imap.h" - diff --git a/include/imap.h b/include/imap.h index 53c804e4..cddbadf7 100644 --- a/include/imap.h +++ b/include/imap.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,63 +19,64 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IMAP_H) -#define INCLUDED_IMAP_H +//---------------------------------------------------------------------------- +// +// DESCRIPTION: +// map format interface (.map and .xmap, Q3 and other games) +// -#include "generic/constant.h" +#ifndef __IMAP_H__ +#define __IMAP_H__ -class Tokeniser; -class TokenWriter; +/*! IMap depends on IDataStream, including the header there for now */ +#include "idatastream.h" -/// \brief A node whose state can be imported from a token stream. -class MapImporter +/*! header for CPtrArray */ +#include "missing.h" + +#define MAP_MAJOR "map" +/*! +define a GUID for this interface so everyone can acces and reference it +{75076973-3414-49c9-be5b-2378ec5601af} +*/ +static const GUID QERPlugMapTable_GUID = +{ 0x75076973, 0x3414, 0x49c9, { 0xbe, 0x5b, 0x23, 0x78, 0xec, 0x56, 0x01, 0xaf } }; + +/*! +read from a stream into a list of entities +\param in the input stream. For regular map file parsing it's possible to copy the content in a text buffer +and use the old school parser +\param ents the list of entities read from the stream. They are not linked to the world, and their brushes +are not either. +*/ +typedef void (* PFN_MAP_READ) (IDataStream *in, CPtrArray *ents); ///< read from a stream into a list of entities +typedef void (* PFN_MAP_WRITE) (CPtrArray *ents, IDataStream *out); ///< save a list of entities into a stream + +struct _QERPlugMapTable { -public: - STRING_CONSTANT(Name, "MapImporter"); - - virtual bool importTokens(Tokeniser& tokeniser) = 0; + int m_nSize; + PFN_MAP_READ m_pfnMap_Read; + PFN_MAP_WRITE m_pfnMap_Write; }; -/// \brief A node whose state can be exported to a token stream. -class MapExporter -{ -public: - STRING_CONSTANT(Name, "MapExporter"); - - virtual void exportTokens(TokenWriter& writer) const = 0; -}; - -#include "iscenegraph.h" - -class EntityCreator; - -class TextInputStream; -class TextOutputStream; - - -typedef void(*GraphTraversalFunc)(scene::Node& root, const scene::Traversable::Walker& walker); - -/// \brief A module that reads and writes a map in a specific format. -class MapFormat -{ -public: - INTEGER_CONSTANT(Version, 2); - STRING_CONSTANT(Name, "map"); - - /// \brief Read a map graph into \p root from \p outputStream, using \p entityTable to create entities. - virtual void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const = 0; - /// \brief Write the map graph obtained by applying \p traverse to \p root into \p outputStream. - virtual void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const = 0; -}; - - -template -class Modules; -typedef Modules MapModules; - -template -class ModulesRef; -typedef ModulesRef MapModulesRef; - +/*! +this set of macros will define the functions to map on a given table + it should be used in the headers (see modules source, plugin.h) +we don't want those defines in the part where WE implement the Map_LoadFile + so we're using a define to disable .. should find a standard define name + (for instance QCOM_CLIENT / QCOM_SERVER ?) + or the name should be specific to any interface .. it's not a client/server thing here anyway +*/ +#ifdef USE_MAPTABLE_DEFINE +#ifndef __MAPTABLENAME +/*! +TTimo NOTE: this is the default table name we map to + if you are using a different table name, just define __MAPTABLENAME before you include the imap.h header +*/ +#define __MAPTABLENAME g_MapTable +#endif +#define Map_Read __MAPTABLENAME.m_pfnMap_Read +#define Map_Write __MAPTABLENAME.m_pfnMap_Write +#endif #endif diff --git a/include/imodel.cpp b/include/imodel.cpp deleted file mode 100644 index 081dccac..00000000 --- a/include/imodel.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "imodel.h" - diff --git a/include/imodel.h b/include/imodel.h index aa040d63..3dead05e 100644 --- a/include/imodel.h +++ b/include/imodel.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,32 +19,88 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IMODEL_H) -#define INCLUDED_IMODEL_H +#ifndef _IMODEL_H_ +#define _IMODEL_H_ -#include "generic/constant.h" +#define MODEL_MAJOR "model" -namespace scene +/*! +loads model from model file name specified, +fills model struct with pointers to model interfaces + +name is a relative path, we'll use VFS to extract a basepath to add to get the absolute path. +*/ +typedef void (* PFN_LOADMODEL) (entity_interfaces_t *model, const char *name); + +struct _QERPlugModelTable { - class Node; -} - -class ArchiveFile; - -class ModelLoader -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "model"); - virtual scene::Node& loadModel(ArchiveFile& file) = 0; + int m_nSize; + PFN_LOADMODEL m_pfnLoadModel; }; -template -class Modules; -typedef Modules ModelModules; -template -class ModulesRef; -typedef ModulesRef ModelModulesRef; +//forward declare entity_t +struct entity_s; +typedef struct entity_s entity_t; + +// any module relying on imodel will need to link against the mathlib +#include "mathlib.h" + +// state flags +#define DRAW_GL_FILL 0x0001 +#define DRAW_GL_LIGHTING 0x0010 +#define DRAW_GL_TEXTURE_2D 0x0100 +#define DRAW_GL_BLEND 0x1000 + +// predefined state combinations +#define DRAW_GL_WIRE 0x0000 +#define DRAW_GL_FLAT 0x0001 +#define DRAW_GL_SOLID 0x0011 +#define DRAW_GL_TEXTURED 0x0111 + +// mode +#define DRAW_WIRE 0 +#define DRAW_SOLID 1 +#define DRAW_TEXTURED 2 + +// render flags +#define DRAW_RF_NONE 0x0000 +#define DRAW_RF_SEL_OUTLINE 0x0001 +#define DRAW_RF_SEL_FILL 0x0010 +#define DRAW_RF_XY 0x0011 +#define DRAW_RF_CAM 0x0100 + +class IRender +{ +public: + virtual ~IRender() { } + virtual void IncRef() = 0; // increments the reference counter for this object + virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero + virtual void Draw(int state, int rflags) const = 0; // render the object - state = the opengl state + virtual const aabb_t *GetAABB() const = 0; +}; + +class ISelect +{ +public: + virtual ~ISelect() { } + virtual void IncRef() = 0; // increments the reference counter for this object + virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero + virtual bool TestRay(const ray_t *ray, vec_t *dist) const = 0; // test ray intersection, return bool true if intersects, and store distance to closest point of intersection + //virtual bool TestBox(const aabb_t *aabb) const = 0; // test aabb intersection, return bool true if touching or intersecting +}; + +class IEdit +{ +public: + virtual ~IEdit() { } + virtual void IncRef() = 0; // increments the reference counter for this object + virtual void DecRef() = 0; // decrements the reference counter for this object, deletes the object if reference count is zero + virtual void Translate(const vec3_t translation) = 0; + virtual void Rotate(const vec3_t pivot, const vec3_t rotation) = 0; + virtual const vec_t *GetTranslation() const = 0; + virtual const vec_t *GetRotation() const = 0; + virtual void OnKeyValueChanged(entity_t *e, const char *key, const char* value) = 0; +}; #endif /* _IMODEL_H_ */ diff --git a/include/include.vcproj b/include/include.vcproj deleted file mode 100644 index a374cc2c..00000000 --- a/include/include.vcproj +++ /dev/null @@ -1,500 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/ipatch.cpp b/include/ipatch.cpp deleted file mode 100644 index 940a1bed..00000000 --- a/include/ipatch.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ipatch.h" - diff --git a/include/ipatch.h b/include/ipatch.h index 48ce39b5..300a0a75 100644 --- a/include/ipatch.h +++ b/include/ipatch.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,274 +19,35 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IPATCH_H) -#define INCLUDED_IPATCH_H +#ifndef _IPATCH_H_ +#define _IPATCH_H_ -#include "generic/constant.h" -#include "generic/vector.h" +// +// API for patch stuff +// -namespace scene +#define PATCH_MAJOR "patch" +// {4715565b-ab3a-49fa-841f-ee965b6d88a5} +static const GUID QERPatchTable_GUID = +{ 0x4715565b, 0xab3a, 0x49fa, { 0x84, 0x1f, 0xee, 0x96, 0x5b, 0x6d, 0x88, 0xa5 } }; + +typedef patchMesh_t* (* PFN_PATCHALLOC) (); +typedef patchMesh_t* (* PFN_MAKENEWPATCH) (); +typedef brush_t* (* PFN_ADDBRUSHFORPATCH) (patchMesh_t *pm, bool bLinkToWorld ); + +struct _QERPatchTable { - class Node; -} - -template -class ArrayReference -{ - std::size_t m_size; - Element* m_data; -public: - typedef Element value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; - - ArrayReference() - : m_size(0), m_data(0) - { - } - ArrayReference(std::size_t size, Element* data) - : m_size(size), m_data(data) - { - } - - iterator begin() - { - return m_data; - } - const_iterator begin() const - { - return m_data; - } - iterator end() - { - return m_data + m_size; - } - const_iterator end() const - { - return m_data + m_size; - } - - value_type& operator[](std::size_t index) - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - const value_type& operator[](std::size_t index) const - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - value_type* data() - { - return m_data; - } - const value_type* data() const - { - return m_data; - } - std::size_t size() const - { - return m_size; - } - bool empty() const - { - return m_size == 0; - } + int m_nSize; + PFN_PATCHALLOC m_pfnPatch_Alloc; + PFN_MAKENEWPATCH m_pfnMakeNewPatch; + PFN_ADDBRUSHFORPATCH m_pfnAddBrushForPatch; }; -#if 0 -template -class MatrixIterator -{ - Element* m_position; - - void increment() - { - ++m_position; - } - -public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; - typedef difference_type distance_type; - typedef KeyValue value_type; - typedef value_type* pointer; - typedef value_type& reference; - - MatrixIterator(Element* position) : m_position(position) - { - } - - Element* position() - { - return m_position; - } - - bool operator==(const MatrixIterator& other) const - { - return m_position == other.m_position; - } - bool operator!=(const MatrixIterator& other) const - { - return !operator==(other); - } - MatrixIterator& operator++() - { - increment(); - return *this; - } - MatrixIterator operator++(int) - { - MatrixIterator tmp = *this; - increment(); - return tmp; - } - value_type& operator*() const - { - return m_position->m_value; - } - value_type* operator->() const - { - return &(operator*()); - } -}; +#ifdef USE_PATCHTABLE_DEFINE +#define __PATCHTABLENAME g_PatchTable +#define Patch_Alloc __PATCHTABLENAME.m_pfnPatch_Alloc +#define MakeNewPatch __PATCHTABLENAME.m_pfnMakeNewPatch +#define AddBrushForPatch __PATCHTABLENAME.m_pfnAddBrushForPatch #endif -template -class Matrix -{ - std::size_t m_x, m_y; - Element* m_data; -public: - typedef Element value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; - - Matrix() - : m_x(0), m_y(0), m_data(0) - { - } - Matrix(std::size_t x, std::size_t y, Element* data) - : m_x(x), m_y(y), m_data(data) - { - } - - iterator begin() - { - return m_data; - } - const_iterator begin() const - { - return m_data; - } - iterator end() - { - return m_data + size(); - } - const_iterator end() const - { - return m_data + size(); - } - - value_type& operator[](std::size_t index) - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - const value_type& operator[](std::size_t index) const - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - value_type& operator()(std::size_t x, std::size_t y) - { -#if defined(_DEBUG) - ASSERT_MESSAGE(x < m_x && y < m_y, "array index out of bounds"); -#endif - return m_data[x * m_y + y]; - } - const value_type& operator()(std::size_t x, std::size_t y) const - { -#if defined(_DEBUG) - ASSERT_MESSAGE(x < m_x && y < m_y, "array index out of bounds"); -#endif - return m_data[x * m_y + y]; - } - value_type* data() - { - return m_data; - } - const value_type* data() const - { - return m_data; - } - std::size_t x() const - { - return m_x; - } - std::size_t y() const - { - return m_y; - } - std::size_t size() const - { - return m_x * m_y; - } - bool empty() const - { - return m_x == 0; - } -}; - -class PatchControl -{ -public: - Vector3 m_vertex; - Vector2 m_texcoord; -}; - -typedef Matrix PatchControlMatrix; - - -class PatchCreator -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "patch"); - virtual scene::Node& createPatch() = 0; - virtual void Patch_undoSave(scene::Node& patch) const = 0; - virtual void Patch_resize(scene::Node& patch, std::size_t width, std::size_t height) const = 0; - virtual PatchControlMatrix Patch_getControlPoints(scene::Node& patch) const = 0; - virtual void Patch_controlPointsChanged(scene::Node& patch) const = 0; - virtual const char* Patch_getShader(scene::Node& patch) const = 0; - virtual void Patch_setShader(scene::Node& patch, const char* shader) const = 0; -}; - -#include "modulesystem.h" - -template -class ModuleRef; -typedef ModuleRef PatchModuleRef; - -template -class GlobalModule; -typedef GlobalModule GlobalPatchModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalPatchModuleRef; - -inline PatchCreator& GlobalPatchCreator() -{ - return GlobalPatchModule::getTable(); -} - #endif diff --git a/include/iplugin.h b/include/iplugin.h index af713a7d..3f21bfef 100644 --- a/include/iplugin.h +++ b/include/iplugin.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,35 +19,23 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IPLUGIN_H) -#define INCLUDED_IPLUGIN_H +#ifndef _IPLUGIN_H_ +#define _IPLUGIN_H_ -#include "generic/constant.h" +#define PLUGIN_MAJOR "plugin" typedef const char* (* PFN_QERPLUG_INIT) (void* hApp, void* pMainWidget); -typedef const char* (* PFN_QERPLUG_GETNAME)(); -typedef const char* (* PFN_QERPLUG_GETCOMMANDLIST)(); -typedef const char* (* PFN_QERPLUG_GETCOMMANDTITLELIST)(); +typedef const char* (* PFN_QERPLUG_GETNAME) (); +typedef const char* (* PFN_QERPLUG_GETCOMMANDLIST) (); typedef void (* PFN_QERPLUG_DISPATCH) (const char* p, float* vMin, float* vMax, bool bSingleBrush); struct _QERPluginTable { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "plugin"); - + int m_nSize; PFN_QERPLUG_INIT m_pfnQERPlug_Init; PFN_QERPLUG_GETNAME m_pfnQERPlug_GetName; PFN_QERPLUG_GETCOMMANDLIST m_pfnQERPlug_GetCommandList; - PFN_QERPLUG_GETCOMMANDTITLELIST m_pfnQERPlug_GetCommandTitleList; PFN_QERPLUG_DISPATCH m_pfnQERPlug_Dispatch; }; -template -class Modules; -typedef Modules<_QERPluginTable> PluginModules; - -template -class ModulesRef; -typedef ModulesRef<_QERPluginTable> PluginModulesRef; - #endif diff --git a/include/irefcount.h b/include/irefcount.h new file mode 100644 index 00000000..e49e80d7 --- /dev/null +++ b/include/irefcount.h @@ -0,0 +1,62 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __IREFCOUNT_H__ +#define __IREFCOUNT_H__ + +/*! +\class IRefCounted +\brief reference counted objects + +general hints: how to use ref count properly + we consider ref counting as an extension of new and delete operators + the main issue is 'when to incref' 'when to decref' + in most cases connected to function calls + the general thinking about that: + - if you get a pointer to a refcounted object through a call to a function, assume that this object has been 'reserved' for you + already (i.e. allocated if you think this the new/delete way). so if you keep the object, you don't need to incref it, and if + you don't keep it you need to decref it. + - if you are called in a function and a refcounted object passed as parameter, then you should assume that this is an optional + object given to you FYI, which you don't need to decref if you don't keep / need to incref if you keep + + refcount is initialized to 1 in constructor. that serves for static objects and memory allocator + when you allocate in memory a ref counted object, it's default ref count will be 1, you should never delete it but just call DecRef on it + +define an interface and an implementation macro to make things easier +NOTE: we may have to provide a static library to go with that + in case we would move irecount.h out of here into libs/ + +\todo functionality needed: +mostly enable/disable some features with compile time flags (independently from each other as much as possible) +- log the destructor calls with != 0 ref count +- log all incref/decref (with module info, and maybe even file/line number etc.?) +*/ +class IRefCounted +{ + int refCount; +public: + IRefCounted() { refCount = 1; } + virtual ~IRefCounted() { } + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } +}; + +#endif // __ISYNAPSE_H__ diff --git a/include/ireference.cpp b/include/ireference.cpp deleted file mode 100644 index 844e95be..00000000 --- a/include/ireference.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ireference.h" - diff --git a/include/ireference.h b/include/ireference.h deleted file mode 100644 index e97df794..00000000 --- a/include/ireference.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IREFERENCE_H) -#define INCLUDED_IREFERENCE_H - -#include "generic/constant.h" - -namespace scene -{ - class Node; -} - -class ModuleObserver; - -class Resource -{ -public: - virtual bool load() = 0; - virtual bool save() = 0; - virtual void flush() = 0; - virtual void refresh() = 0; - virtual scene::Node* getNode() = 0; - virtual void setNode(scene::Node* node) = 0; - virtual void attach(ModuleObserver& observer) = 0; - virtual void detach(ModuleObserver& observer) = 0; - virtual void realise() = 0; - virtual void unrealise() = 0; -}; - -class EntityCreator; - -class ReferenceCache -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "reference"); - - virtual Resource* capture(const char* path) = 0; - virtual void release(const char* path) = 0; - - virtual void setEntityCreator(EntityCreator& entityCreator) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalReferenceModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalReferenceModuleRef; - -inline ReferenceCache& GlobalReferenceCache() -{ - return GlobalReferenceModule::getTable(); -} - -#endif diff --git a/include/irender.cpp b/include/irender.cpp deleted file mode 100644 index c0fec667..00000000 --- a/include/irender.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "irender.h" - diff --git a/include/irender.h b/include/irender.h deleted file mode 100644 index d9c40b6f..00000000 --- a/include/irender.h +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IRENDER_H) -#define INCLUDED_IRENDER_H - -#include "generic/constant.h" -#include "generic/callbackfwd.h" - - -// Rendering states to sort by. -// Higher bits have the most effect - slowest state changes should be highest. - -const unsigned int RENDER_DEFAULT = 0; -const unsigned int RENDER_LINESTIPPLE = 1 << 0; // glEnable(GL_LINE_STIPPLE) -const unsigned int RENDER_LINESMOOTH = 1 << 1; // glEnable(GL_LINE_SMOOTH) -const unsigned int RENDER_POLYGONSTIPPLE = 1 << 2; // glEnable(GL_POLYGON_STIPPLE) -const unsigned int RENDER_POLYGONSMOOTH = 1 << 3; // glEnable(GL_POLYGON_SMOOTH) -const unsigned int RENDER_ALPHATEST = 1 << 4; // glEnable(GL_ALPHA_TEST) -const unsigned int RENDER_DEPTHTEST = 1 << 5; // glEnable(GL_DEPTH_TEST) -const unsigned int RENDER_DEPTHWRITE = 1 << 6; // glDepthMask(GL_TRUE) -const unsigned int RENDER_COLOURWRITE = 1 << 7; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE) -const unsigned int RENDER_CULLFACE = 1 << 8; // glglEnable(GL_CULL_FACE) -const unsigned int RENDER_SCALED = 1 << 9; // glEnable(GL_NORMALIZE) -const unsigned int RENDER_SMOOTH = 1 << 10; // glShadeModel -const unsigned int RENDER_FOG = 1 << 11; // glEnable(GL_FOG) -const unsigned int RENDER_LIGHTING = 1 << 12; // glEnable(GL_LIGHTING) -const unsigned int RENDER_BLEND = 1 << 13; // glEnable(GL_BLEND) -const unsigned int RENDER_OFFSETLINE = 1 << 14; // glEnable(GL_POLYGON_OFFSET_LINE) -const unsigned int RENDER_FILL = 1 << 15; // glPolygonMode -const unsigned int RENDER_COLOURARRAY = 1 << 16; // glEnableClientState(GL_COLOR_ARRAY) -const unsigned int RENDER_COLOURCHANGE = 1 << 17; // render() is allowed to call glColor*() -const unsigned int RENDER_TEXTURE = 1 << 18; // glEnable(GL_TEXTURE_2D) -const unsigned int RENDER_BUMP = 1 << 19; -const unsigned int RENDER_PROGRAM = 1 << 20; -const unsigned int RENDER_SCREEN = 1 << 21; -const unsigned int RENDER_OVERRIDE = 1 << 22; -typedef unsigned int RenderStateFlags; - - -class AABB; -class Matrix4; - -template class BasicVector3; -typedef BasicVector3 Vector3; - -class Shader; - -class RendererLight -{ -public: - virtual Shader* getShader() const = 0; - virtual const AABB& aabb() const = 0; - virtual bool testAABB(const AABB& other) const = 0; - virtual const Matrix4& rotation() const = 0; - virtual const Vector3& offset() const = 0; - virtual const Vector3& colour() const = 0; - virtual bool isProjected() const = 0; - virtual const Matrix4& projection() const = 0; -}; - -class LightCullable -{ -public: - virtual bool testLight(const RendererLight& light) const = 0; - virtual void insertLight(const RendererLight& light) - { - } - virtual void clearLights() - { - } -}; - -class Renderable; -typedef Callback1 RenderableCallback; - -typedef Callback1 RendererLightCallback; - -class LightList -{ -public: - virtual void evaluateLights() const = 0; - virtual void lightsChanged() const = 0; - virtual void forEachLight(const RendererLightCallback& callback) const = 0; -}; - -const int c_attr_TexCoord0 = 1; -const int c_attr_Tangent = 3; -const int c_attr_Binormal = 4; - -class OpenGLRenderable -{ -public: - virtual void render(RenderStateFlags state) const = 0; -}; - -class Matrix4; -struct qtexture_t; -class ModuleObserver; - -#include "generic/vector.h" - -class Shader -{ -public: - virtual void addRenderable(const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights = 0) = 0; - virtual void incrementUsed() = 0; - virtual void decrementUsed() = 0; - virtual void attach(ModuleObserver& observer) = 0; - virtual void detach(ModuleObserver& observer) = 0; - virtual qtexture_t& getTexture() const = 0; - virtual unsigned int getFlags() const = 0; -}; - -class ShaderCache -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "renderstate"); - - virtual Shader* capture(const char* name) = 0; - virtual void release(const char* name) = 0; - /*! Render all Shader objects. */ - virtual void render(RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer = Vector3(0, 0, 0)) = 0; - - virtual void realise() = 0; - virtual void unrealise() = 0; - - virtual bool lightingSupported() const = 0; - virtual bool useShaderLanguage() const = 0; - - virtual const LightList& attach(LightCullable& cullable) = 0; - virtual void detach(LightCullable& cullable) = 0; - virtual void changed(LightCullable& cullable) = 0; - virtual void attach(RendererLight& light) = 0; - virtual void detach(RendererLight& light) = 0; - virtual void changed(RendererLight& light) = 0; - - virtual void attachRenderable(const Renderable& renderable) = 0; - virtual void detachRenderable(const Renderable& renderable) = 0; - virtual void forEachRenderable(const RenderableCallback& callback) const = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalShaderCacheModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalShaderCacheModuleRef; - -inline ShaderCache& GlobalShaderCache() -{ - return GlobalShaderCacheModule::getTable(); -} - -#endif diff --git a/include/iscenegraph.cpp b/include/iscenegraph.cpp deleted file mode 100644 index 6b7b450e..00000000 --- a/include/iscenegraph.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iscenegraph.h" - diff --git a/include/iscenegraph.h b/include/iscenegraph.h deleted file mode 100644 index 18e50f77..00000000 --- a/include/iscenegraph.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_ISCENEGRAPH_H) -#define INCLUDED_ISCENEGRAPH_H - -#include -#include "generic/constant.h" -#include "signal/signalfwd.h" - -template -class Stack; -template -class Reference; - -namespace scene -{ - class Instance; - const Instance* const nullInstancePointer = 0; - inline const Instance& nullInstance() - { - return *nullInstancePointer; - } - - class Node; - const Node* const nullNodePointer = 0; - inline const Node& nullNode() - { - return *nullNodePointer; - } -} - -typedef Reference NodeReference; - -typedef std::size_t TypeId; - -const TypeId NODETYPEID_MAX = 64; -const TypeId NODETYPEID_NONE = NODETYPEID_MAX; - -const TypeId INSTANCETYPEID_MAX = 64; -const TypeId INSTANCETYPEID_NONE = INSTANCETYPEID_MAX; - -namespace scene -{ - /// \brief A unique key to an instance of a node in the scene-graph. - typedef Stack Path; - - /// \brief A scene-graph - a Directed Acyclic Graph (DAG). - /// - /// - Each node may refer to zero or more 'child' nodes (directed). - /// - A node may never have itself as one of its ancestors (acyclic). - /// - Each node may have more than one 'parent', thus having more than one 'instance' in the graph. - /// - Each instance is uniquely identified by the list of its ancestors plus itself, known as a 'path'. - class Graph - { - public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "scenegraph"); - - class Walker - { - public: - /// \brief Called before traversing the first child-instance of 'instance'. If the return value is false, the children of the current instance are not traversed. - virtual bool pre(const Path& path, Instance& instance) const = 0; - /// \brief Called after traversing the last child-instance of 'instance'. - virtual void post(const Path& path, Instance& instance) const - { - } - }; - - /// \brief Returns the root-node of the graph. - virtual Node& root() = 0; - /// \brief Sets the root-node of the graph to be 'node'. - virtual void insert_root(Node& root) = 0; - /// \brief Clears the root-node of the graph. - virtual void erase_root() = 0; - /// \brief Traverses all nodes in the graph depth-first, starting from the root node. - virtual void traverse(const Walker& walker) = 0; - /// \brief Traverses all nodes in the graph depth-first, starting from 'start'. - virtual void traverse_subgraph(const Walker& walker, const Path& start) = 0; - /// \brief Returns the instance at the location identified by 'path', or 0 if it does not exist. - virtual scene::Instance* find(const Path& path) = 0; - - /// \brief Invokes all scene-changed callbacks. Called when any part of the scene changes the way it will appear when the scene is rendered. - /// \todo Move to a separate class. - virtual void sceneChanged() = 0; - /// \brief Add a \p callback to be invoked when the scene changes. - /// \todo Move to a separate class. - virtual void addSceneChangedCallback(const SignalHandler& handler) = 0; - - /// \brief Invokes all bounds-changed callbacks. Called when the bounds of any instance in the scene change. - /// \todo Move to a separate class. - virtual void boundsChanged() = 0; - /// \brief Add a \p callback to be invoked when the bounds of any instance in the scene change. - virtual SignalHandlerId addBoundsChangedCallback(const SignalHandler& boundsChanged) = 0; - /// \brief Remove a \p callback to be invoked when the bounds of any instance in the scene change. - virtual void removeBoundsChangedCallback(SignalHandlerId id) = 0; - - virtual TypeId getNodeTypeId(const char* name) = 0; - virtual TypeId getInstanceTypeId(const char* name) = 0; - }; - - class Traversable - { - public: - STRING_CONSTANT(Name, "scene::Traversable"); - - class Observer - { - public: - /// \brief Called when a node is added to the container. - virtual void insert(Node& node) = 0; - /// \brief Called when a node is removed from the container. - virtual void erase(Node& node) = 0; - }; - - class Walker - { - public: - /// \brief Called before traversing the first child-node of 'node'. If the return value is false, the children of the current node are not traversed. - virtual bool pre(Node& node) const = 0; - /// \brief Called after traversing the last child-node of 'node'. - virtual void post(Node& node) const - { - } - }; - /// \brief Adds a node to the container. - virtual void insert(Node& node) = 0; - /// \brief Removes a node from the container. - virtual void erase(Node& node) = 0; - /// \brief Traverses the subgraphs rooted at each node in the container, depth-first. - virtual void traverse(const Walker& walker) = 0; - /// \brief Returns true if the container contains no nodes. - virtual bool empty() const = 0; - }; - - class Instantiable - { - public: - STRING_CONSTANT(Name, "scene::Instantiable"); - - class Observer - { - public: - /// \brief Called when an instance is added to the container. - virtual void insert(scene::Instance* instance) = 0; - /// \brief Called when an instance is removed from the container. - virtual void erase(scene::Instance* instance) = 0; - }; - - class Visitor - { - public: - virtual void visit(Instance& instance) const = 0; - }; - - /// \brief Returns a new instance uniquely identified by 'path'. - virtual scene::Instance* create(const scene::Path& path, scene::Instance* parent) = 0; - /// \brief Calls Visitor::visit(instance) for each instance in the container. - virtual void forEachInstance(const Visitor& visitor) = 0; - /// \brief Adds an instance to the container. - virtual void insert(Observer* observer, const Path& path, scene::Instance* instance) = 0; - /// \brief Returns an instance removed from the container. - virtual scene::Instance* erase(Observer* observer, const Path& path) = 0; - }; - - class Cloneable - { - public: - STRING_CONSTANT(Name, "scene::Cloneable"); - - /// \brief Returns a copy of itself. - virtual scene::Node& clone() const = 0; - }; -} - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalSceneGraphModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalSceneGraphModuleRef; - -inline scene::Graph& GlobalSceneGraph() -{ - return GlobalSceneGraphModule::getTable(); -} - -inline void AddSceneChangeCallback(const SignalHandler& handler) -{ - GlobalSceneGraph().addSceneChangedCallback(handler); -} -inline void SceneChangeNotify() -{ - GlobalSceneGraph().sceneChanged(); -} - - - -#endif diff --git a/include/iscriplib.cpp b/include/iscriplib.cpp deleted file mode 100644 index 4de7c3f9..00000000 --- a/include/iscriplib.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iscriplib.h" - diff --git a/include/iscriplib.h b/include/iscriplib.h index 98d85c27..30b9bd8a 100644 --- a/include/iscriplib.h +++ b/include/iscriplib.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,67 +19,68 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_ISCRIPLIB_H) -#define INCLUDED_ISCRIPLIB_H +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// all purpose scriplib interface for Q3Radiant plugins (cf. parse.h) +// -/// \file iscriplib.h -/// \brief Token input/output stream module. +#ifndef __ISCRIPLIB_H_ +#define __ISCRIPLIB_H_ -#include -#include "generic/constant.h" +/*! \file iscriplib.h + \brief function tables for Radiant core's text parsing functions + two token based parsers cohexist in Radiant + the primary one (GetToken UnGetToken etc.) is used on the .map parsing etc. + COM_Parse is another parser, used on .def parse for instance + + NOTE: I hope we can totally get rid of this part when we have XML support +*/ -#define MAXTOKEN 1024 +#define SCRIPLIB_MAJOR "scriptlib" -class Tokeniser -{ -public: - virtual void release() = 0; - virtual void nextLine() = 0; - virtual const char* getToken() = 0; - virtual void ungetToken() = 0; - virtual std::size_t getLine() const = 0; - virtual std::size_t getColumn() const = 0; -}; - -class TextInputStream; - -class TokenWriter -{ -public: - virtual void release() = 0; - virtual void nextLine() = 0; - virtual void writeToken(const char* token) = 0; - virtual void writeString(const char* string) = 0; - virtual void writeInteger(int i) = 0; - virtual void writeUnsigned(std::size_t i) = 0; - virtual void writeFloat(double f) = 0; -}; - -class TextOutputStream; +typedef qboolean (* PFN_GETTOKEN) (qboolean crossline); +typedef void (* PFN_UNGETTOKEN) (); +// only used to retrieve &token +typedef char* (* PFN_TOKEN) (); +typedef void (* PFN_STARTTOKENPARSING) (char *); +// script line +typedef int (* PFN_SCRIPTLINE) (); +typedef qboolean (* PFN_TOKENAVAILABLE) (); +// COM_Parse +typedef char* (* PFN_COM_PARSE) (char *data); +typedef char* (* PFN_GET_COM_TOKEN) (); +// Hydra: added support for GetTokenExtra() +typedef qboolean (* PFN_GETTOKENEXTRA) (qboolean crossline,char *delimiters,qboolean keepdelimiter); struct _QERScripLibTable { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "scriptlib"); - - Tokeniser& (* m_pfnNewScriptTokeniser)(TextInputStream& istream); - Tokeniser& (* m_pfnNewSimpleTokeniser)(TextInputStream& istream); - TokenWriter& (* m_pfnNewSimpleTokenWriter)(TextOutputStream& ostream); + float m_fVersion; + int m_nSize; + PFN_GETTOKEN m_pfnGetToken; + PFN_GETTOKENEXTRA m_pfnGetTokenExtra; // Hydra: added support for GetTokenExtra() + PFN_UNGETTOKEN m_pfnUnGetToken; + PFN_TOKEN m_pfnToken; + PFN_STARTTOKENPARSING m_pfnStartTokenParsing; + PFN_SCRIPTLINE m_pfnScriptLine; + PFN_TOKENAVAILABLE m_pfnTokenAvailable; + PFN_COM_PARSE m_pfnCOM_Parse; + PFN_GET_COM_TOKEN m_pfnGet_COM_Token; }; -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule<_QERScripLibTable> GlobalScripLibModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef<_QERScripLibTable> GlobalScripLibModuleRef; - -inline _QERScripLibTable& GlobalScriptLibrary() -{ - return GlobalScripLibModule::getTable(); -} +#ifdef USE_SCRIPLIBTABLE_DEFINE +#ifndef __SCRIPLIBTABLENAME +#define __SCRIPLIBTABLENAME g_ScripLibTable +#endif +#define GetToken __SCRIPLIBTABLENAME.m_pfnGetToken +#define Token __SCRIPLIBTABLENAME.m_pfnToken +#define UnGetToken __SCRIPLIBTABLENAME.m_pfnUnGetToken +#define StartTokenParsing __SCRIPLIBTABLENAME.m_pfnStartTokenParsing +#define ScriptLine __SCRIPLIBTABLENAME.m_pfnScriptLine +#define TokenAvailable __SCRIPLIBTABLENAME.m_pfnTokenAvailable +#define COM_Parse __SCRIPLIBTABLENAME.m_pfnCOM_Parse +#define Get_COM_Token __SCRIPLIBTABLENAME.m_pfnGet_COM_Token +#define GetTokenExtra __SCRIPLIBTABLENAME.m_pfnGetTokenExtra // Hydra: added support for GetTokenExtra() +#endif #endif diff --git a/include/iselectedface.h b/include/iselectedface.h new file mode 100644 index 00000000..61bc70d4 --- /dev/null +++ b/include/iselectedface.h @@ -0,0 +1,88 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// Quick interface hack for selected face interface +// this one really needs more work, but I'm in a hurry with TexTool + +#ifndef __ISELECTEDFACE_H_ +#define __ISELECTEDFACE_H_ + +#define SELECTEDFACE_MAJOR "selectedface" +// v2.0 +// support for multiple faces selection (first use in textool v2) +// using the g_ptrSelectedFaces indexes, get the face_t* with GETFACE +// still relies on the _QERFaceData*, unless you cast the face_t* to do your own stuff +// removed PFN_TEXTUREFORNAME, it's in the IShaders API now + +//++timo TODO: this interface needs some cleanup with the new texture / shaders interface + +// number of selected textures +typedef int (WINAPI* PFN_GETSELECTEDFACECOUNT) (); +// retrieve the corresponding brush_t* (we need it when we need to explicitely rebuild stuff) +typedef brush_t* (WINAPI* PFN_GETFACEBRUSH) (int iface); +// retrieve a given face_t* +typedef face_t* (WINAPI* PFN_GETFACE) (int iface); +// winding_t is assumed to have MAX_POINTS_ON_WINDING allocated and waiting +typedef int (WINAPI* PFN_GETFACEINFO) (int iface, _QERFaceData*, winding_t* ); +// tell editor to update the selected face data +typedef int (WINAPI* PFN_SETFACEINFO) (int iface, _QERFaceData*); +// retrieve the texture number to bind to +typedef int (WINAPI* PFN_GETTEXTURENUMBER) (int iface); +// retrieving some texture information +typedef void (WINAPI* PFN_GETTEXTURESIZE) (int iface, int Size[2] ); +// straight func pointer to Select_SetTexture +// last parameter must be casted to an IPluginTexdef +typedef void (WINAPI* PFN_SELECT_SETTEXTURE) (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef); + +// NOTE: some things in there are not really related to the selected face +// having some stuff moved into a textures-dedicated part ? +struct _QERSelectedFaceTable +{ + int m_nSize; + PFN_GETSELECTEDFACECOUNT m_pfnGetSelectedFaceCount; + PFN_GETFACEBRUSH m_pfnGetFaceBrush; + PFN_GETFACE m_pfnGetFace; + PFN_GETFACEINFO m_pfnGetFaceInfo; + PFN_SETFACEINFO m_pfnSetFaceInfo; + PFN_GETTEXTURENUMBER m_pfnGetTextureNumber; + PFN_GETTEXTURESIZE m_pfnGetTextureSize; + PFN_SELECT_SETTEXTURE m_pfnSelect_SetTexture; +}; + +#ifdef USE_SELECTEDFACETABLE_DEFINE + #ifndef __SELECTEDFACETABLENAME + #define __SELECTEDFACETABLENAME g_SelectedFaceTable + #endif + + #define GetSelectedFaceCount __SELECTEDFACETABLENAME.m_pfnGetSelectedFaceCount + #define GetFaceBrush __SELECTEDFACETABLENAME.m_pfnGetFaceBrush + #define GetFace __SELECTEDFACETABLENAME.m_pfnGetFace + #define GetFaceInfo __SELECTEDFACETABLENAME.m_pfnGetFaceInfo + #define SetFaceInfo __SELECTEDFACETABLENAME.m_pfnSetFaceInfo + #define GetTextureNumber __SELECTEDFACETABLENAME.m_pfnGetTextureNumber + #define GetTextureSize __SELECTEDFACETABLENAME.m_pfnGetTextureSize + #define Select_SetTexture __SELECTEDFACETABLENAME.m_pfnSelect_SetTexture +#endif + +#endif diff --git a/include/iselection.cpp b/include/iselection.cpp deleted file mode 100644 index 2438d313..00000000 --- a/include/iselection.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iselection.h" - diff --git a/include/iselection.h b/include/iselection.h deleted file mode 100644 index ec32561e..00000000 --- a/include/iselection.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ISELECTION_H) -#define INCLUDED_ISELECTION_H - -#include -#include "generic/constant.h" -#include "generic/callbackfwd.h" -#include "signal/signalfwd.h" - -class Renderer; -class View; - -class Selectable -{ -public: - STRING_CONSTANT(Name, "Selectable"); - - virtual void setSelected(bool select) = 0; - virtual bool isSelected() const = 0; -}; - -namespace scene -{ - class Instance; -}; - -class InstanceSelectionObserver -{ -public: - virtual void onSelectedChanged(scene::Instance& instance) = 0; -}; - -template class BasicVector3; -typedef BasicVector3 Vector3; -template class BasicVector4; -typedef BasicVector4 Vector4; -class Matrix4; -typedef Vector4 Quaternion; - -typedef Callback1 SelectionChangeCallback; -typedef SignalHandler1 SelectionChangeHandler; - -class SelectionSystem -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "selection"); - - enum EMode - { - eEntity, - ePrimitive, - eComponent, - }; - - enum EComponentMode - { - eDefault, - eVertex, - eEdge, - eFace, - }; - - enum EManipulatorMode - { - eTranslate, - eRotate, - eScale, - eDrag, - eClip, - }; - - virtual void SetMode(EMode mode) = 0; - virtual EMode Mode() const = 0; - virtual void SetComponentMode(EComponentMode mode) = 0; - virtual EComponentMode ComponentMode() const = 0; - virtual void SetManipulatorMode(EManipulatorMode mode) = 0; - virtual EManipulatorMode ManipulatorMode() const = 0; - - virtual SelectionChangeCallback getObserver(EMode mode) = 0; - virtual std::size_t countSelected() const = 0; - virtual std::size_t countSelectedComponents() const = 0; - virtual void onSelectedChanged(scene::Instance& instance, const Selectable& selectable) = 0; - virtual void onComponentSelection(scene::Instance& instance, const Selectable& selectable) = 0; - virtual scene::Instance& ultimateSelected() const = 0; - virtual scene::Instance& penultimateSelected() const = 0; - virtual void setSelectedAll(bool selected) = 0; - virtual void setSelectedAllComponents(bool selected) = 0; - - class Visitor - { - public: - virtual void visit(scene::Instance& instance) const = 0; - }; - virtual void foreachSelected(const Visitor& visitor) const = 0; - virtual void foreachSelectedComponent(const Visitor& visitor) const = 0; - - virtual void addSelectionChangeCallback(const SelectionChangeHandler& handler) = 0; - - virtual void NudgeManipulator(const Vector3& nudge, const Vector3& view) = 0; - - virtual void translateSelected(const Vector3& translation) = 0; - virtual void rotateSelected(const Quaternion& rotation) = 0; - virtual void scaleSelected(const Vector3& scaling) = 0; - - virtual void pivotChanged() const = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalSelectionModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalSelectionModuleRef; - -inline SelectionSystem& GlobalSelectionSystem() -{ - return GlobalSelectionModule::getTable(); -} - - -#endif diff --git a/include/ishaders.cpp b/include/ishaders.cpp deleted file mode 100644 index bf380198..00000000 --- a/include/ishaders.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ishaders.h" - diff --git a/include/ishaders.h b/include/ishaders.h index 928dd1de..b04d8679 100644 --- a/include/ishaders.h +++ b/include/ishaders.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,177 +19,267 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_ISHADERS_H) -#define INCLUDED_ISHADERS_H +//----------------------------------------------------------------------------- +// +// +// DESCRIPTION: +// a set of functions to manipulate textures in Radiant +// -#include "generic/constant.h" -#include "generic/callbackfwd.h" +#ifndef __ISHADERS_H_ +#define __ISHADERS_H_ -enum -{ - QER_TRANS = 1 << 0, - QER_NOCARVE = 1 << 1, - QER_NODRAW = 1 << 2, - QER_NONSOLID = 1 << 3, - QER_WATER = 1 << 4, - QER_LAVA = 1 << 5, - QER_FOG = 1 << 6, - QER_ALPHATEST = 1 << 7, - QER_CULL = 1 << 8, - QER_AREAPORTAL = 1 << 9, - QER_CLIP = 1 << 10, - QER_BOTCLIP = 1 << 11, -}; +#define SHADERS_MAJOR "shaders" +// define a GUID for this interface so plugins can access and reference it +// {D42F798A-DF57-11d3-A3EE-0004AC96D4C3} +static const GUID QERShadersTable_GUID = +{ 0xd42f798a, 0xdf57, 0x11d3, { 0xa3, 0xee, 0x0, 0x4, 0xac, 0x96, 0xd4, 0xc3 } }; -struct qtexture_t; - -template class BasicVector3; -typedef BasicVector3 Vector3; -typedef Vector3 Colour3; - -typedef unsigned char BlendFactor; -const BlendFactor BLEND_ZERO = 0; -const BlendFactor BLEND_ONE = 1; -const BlendFactor BLEND_SRC_COLOUR = 2; -const BlendFactor BLEND_ONE_MINUS_SRC_COLOUR = 3; -const BlendFactor BLEND_SRC_ALPHA = 4; -const BlendFactor BLEND_ONE_MINUS_SRC_ALPHA = 5; -const BlendFactor BLEND_DST_COLOUR = 6; -const BlendFactor BLEND_ONE_MINUS_DST_COLOUR = 7; -const BlendFactor BLEND_DST_ALPHA = 8; -const BlendFactor BLEND_ONE_MINUS_DST_ALPHA = 9; -const BlendFactor BLEND_SRC_ALPHA_SATURATE = 10; - -class BlendFunc -{ -public: - BlendFunc(BlendFactor src, BlendFactor dst) : m_src(src), m_dst(dst) - { - } - BlendFactor m_src; - BlendFactor m_dst; -}; - -class ShaderLayer -{ -public: - virtual qtexture_t* texture() const = 0; - virtual BlendFunc blendFunc() const = 0; - virtual bool clampToBorder() const = 0; - virtual float alphaTest() const = 0; -}; - -typedef Callback1 ShaderLayerCallback; +// NOTES ABOUT SYNTAX: +// if a function starts by 'Try' it means that if the requested thing could not be found / loaded it will return nothing / NULL +// otherwise a default object will be created +// the _QERShadersTable is also used by shader code inside Radiant. but for speed and "keep it simple" consideration you +// can get the static equivalent of the func pointers by adding 'QERApp_' (access to _QERShadersTable is better thought .. +// see the note to move all the shader language out of Radiant below) +/*! +\todo FIXME TTimo +fix the reference count strategy +- define the policy. It seems the initial policy of doing an inc ref when you create the shader is not good +(it doesn't work, and it's not being used right) +so, when you request an IShader and store it, incref it yourself +as a debugging safe check: push the created increfed objects into a list, and scan them at next idle loop +to make sure they have been decref'ed ? (sounds easy, may not be that much). +*/ class IShader { public: - enum EAlphaFunc - { - eAlways, - eEqual, - eLess, - eGreater, - eLEqual, - eGEqual, - }; - enum ECull - { - eCullNone, - eCullBack, - }; + virtual ~IShader() { } // Increment the number of references to this object - virtual void IncRef() = 0; + virtual void IncRef () = 0; // Decrement the reference count - virtual void DecRef() = 0; + virtual void DecRef () = 0; // get/set the qtexture_t* Radiant uses to represent this shader object virtual qtexture_t* getTexture() const = 0; - virtual qtexture_t* getDiffuse() const = 0; - virtual qtexture_t* getBump() const = 0; - virtual qtexture_t* getSpecular() const = 0; + virtual void setTexture(qtexture_t *pTex) = 0; // get shader name virtual const char* getName() const = 0; + // is this shader in use? + // NOTE: this flag can mean this shader has been in use at least once since the last rescan of in-use stuff + // (rescan of in-use happens in several cases, user command or during a texture directory load) + // NOTE: this is used to draw the green outline in the texture window + // NOTE: when does Radiant set the InUse flag? Whenever Select_SetTexture is called (well that doesn't necessarily means the texture actually gets in use, but that's close enough) virtual bool IsInUse() const = 0; - virtual void SetInUse(bool bInUse) = 0; + virtual void SetInUse(bool) = 0; + // is this shader displayed in the texture browser? + // NOTE: if IsInUse() == true, the shader will always be displayed in the texture window and this flag ingored + virtual bool IsDisplayed() const = 0; + virtual void SetDisplayed(bool) = 0; // get the editor flags (QER_NOCARVE QER_TRANS) - virtual int getFlags() const = 0; + virtual int getFlags() = 0; // get the transparency value - virtual float getTrans() const = 0; + virtual float getTrans() = 0; // test if it's a true shader, or a default shader created to wrap around a texture - virtual bool IsDefault() const = 0; + virtual bool IsDefault() = 0; + // test if it's a plain color shader, i.e. a shader we use on plain color stuff (like info_playerstart) + virtual bool IsColor() = 0; + // get the related color then! + virtual void getColor(vec3_t v) = 0; // get the alphaFunc - virtual void getAlphaFunc(EAlphaFunc *func, float *ref) = 0; - virtual BlendFunc getBlendFunc() const = 0; + virtual void getAlphaFunc(int *func, float *ref) = 0; // get the cull type - virtual ECull getCull() = 0; + virtual int getCull() = 0; // get shader file name (ie the file where this one is defined) virtual const char* getShaderFileName() const = 0; - - virtual const ShaderLayer* firstLayer() const = 0; - virtual void forEachLayer(const ShaderLayerCallback& layer) const = 0; - - virtual qtexture_t* lightFalloffImage() const = 0; }; -typedef struct _GSList GSList; -typedef Callback1 ShaderNameCallback; +// NOTE: how to move all the shader language out of Radiant in a plugin? +// -> change this _QERShadersTable into an IShadersManager +// -> let the plugin create an instance of IShadersManager +// -> make sure Radiant uses this IShadersManager to load / query the shaders -class ModuleObserver; +// NOTE: shader and texture names used must be full path, ie. most often with "textures/" prefix +// (since shaders are defined in .shader files with textures/) -class ShaderSystem +// free all shaders +// free the shaders, will not free the qtexture_t* +typedef void (WINAPI* PFN_FREESHADERS) (); +// reload all the shaders +// this will free everything (shaders and their textures), then reload all in use stuff +typedef void (WINAPI* PFN_RELOADSHADERS) (); +// load all shaders in a given directory +// this will scan the list of in-memory shaders, and load the related qtexture_t if needed +typedef int (WINAPI* PFN_LOADSHADERSFROMDIR)(const char* path); +// load a shader file (ie a set of shaders) +// after LoadShaderFile shaders will be in memory, next step is to load the qtexture_t Radiant uses to represent them +// if a shader with the same name exists, new one will not be loaded - don't use this to refresh the shaders! +typedef void (WINAPI* PFN_LOADSHADERFILE) (const char* filename); +// tell if a given shader exists in our shader table +// NOTE: this doesn't tell wether it's corresponding qtexture is loaded +typedef int (WINAPI* PFN_HASSHADER) (const char* name); +// return the shader for a given name +// if the qtexture is not already in memory, will try loading it +// if the qtexture could not be found, will use default +// will return NULL on shader not found +typedef IShader* (WINAPI* PFN_TRYSHADERFORNAME) (const char* name); +// return the shader for a given name +// if the qtexture is not already in memory, will try loading it +// will create a default shader if not found (will use a default texture) +typedef IShader* (WINAPI* PFN_SHADERFORNAME) (const char* name); +// query / load a texture +// will not try loading a shader, will look for the actual image file .. +// returns NULL on file not found +// NOTE: strategy for file lookup: +// paths must be relative, ie. textures/me/myfile +// if a 3-letters filename extension (such as .jpg or .tga) is provided, it will get loaded first +// if not found or no extension, will try loading after adding .tga and .jpg (in this order) +typedef qtexture_t* (WINAPI* PFN_TRYTEXTUREFORNAME) (const char* filename); +// query / load a texture +// will not try loading a shader, will look for the actual image file .. +// on file not found will use the "texture not found" +typedef qtexture_t* (WINAPI* PFN_TEXTUREFORNAME) (const char* filename); +// get the number of active shaders +// these are the shaders currently loaded, that have an associated qtexture_t* +typedef int (WINAPI* PFN_GETACTIVESHADERCOUNT) (); +// for stuff that needs to be represented by a plain texture +// the shader will get a "color" name, use GetColor to get the actual color +typedef IShader* (WINAPI* PFN_COLORSHADERFORNAME) (const char* name); +// reload a shaderfile - update shaders and their display properties/qtexture_t if needed +// will not reload the texture files +// will switch to "show in use" atfer use +// filename must be reletive path of the shader, ex. scripts/gothic_wall.shader +typedef void (WINAPI* PFN_RELOADSHADERFILE)(const char* filename); +// retrieve a shader if exists, without loading the textures for it etc. +// use this function if you want special info on a shader +typedef IShader* (WINAPI* PFN_SHADERFORNAMENOLOAD) (const char* name); +// force the "in use" flag on all active shaders +typedef void (WINAPI* PFN_ACTIVESHADERSSETINUSE) (bool b); +// sort the shaders in alphabetical order, we use the order in the texture inspector +typedef void (WINAPI* PFN_SORTACTIVESHADERS) (); +// check if there exists an active shader with the given texture name (loaded or not, doesn't matter) +// (used to detect the textures we need to create a default shader for .. while scanning a directory) +typedef IShader* (WINAPI* PFN_ACTIVESHADERFORTEXTURENAME) (char *); +// create a shader to wrap around a texture name, we use this when loading a texture directory and some textures +// are not present as shaders +typedef IShader* (WINAPI* PFN_CREATESHADERFORTEXTURENAME) (const char* name); +// switch the IsDisplayed flag on all the active shaders +typedef void (WINAPI* PFN_ACTIVESHADERSSETDISPLAYED) (bool b); +// retrieve an active shader based on index +typedef IShader* (WINAPI* PFN_ACTIVESHADERFORINDEX) (int i); +// will cleanup a texture name and force it to the right format +// the debug version is painfully slow, but will detect more problems +// the idea being to avoid loading the same file several time because of uppercase/lowercase etc. +typedef const char* (WINAPI* PFN_CLEANTEXTURENAME) (const char* name, bool bAddTexture); + +struct _QERShadersTable { -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "shaders"); - // NOTE: shader and texture names used must be full path. - // Shaders usable as textures have prefix equal to getTexturePrefix() - - virtual void realise() = 0; - virtual void unrealise() = 0; - virtual void refresh() = 0; - // activate the shader for a given name and return it - // will return the default shader if name is not found - virtual IShader* getShaderForName(const char* name) = 0; - - virtual void foreachShaderName(const ShaderNameCallback& callback) = 0; - - // iterate over the list of active shaders - virtual void beginActiveShadersIterator() = 0; - virtual bool endActiveShadersIterator() = 0; - virtual IShader* dereferenceActiveShadersIterator() = 0; - virtual void incrementActiveShadersIterator() = 0; - - virtual void setActiveShadersChangedNotify(const Callback& notify) = 0; - - virtual void attach(ModuleObserver& observer) = 0; - virtual void detach(ModuleObserver& observer) = 0; - - virtual void setLightingEnabled(bool enabled) = 0; - - virtual const char* getTexturePrefix() const = 0; + int m_nSize; + PFN_FREESHADERS m_pfnFreeShaders; + PFN_RELOADSHADERS m_pfnReloadShaders; + PFN_LOADSHADERSFROMDIR m_pfnLoadShadersFromDir; + PFN_LOADSHADERFILE m_pfnLoadShaderFile; + PFN_RELOADSHADERFILE m_pfnReloadShaderFile; + PFN_HASSHADER m_pfnHasShader; + PFN_TRYSHADERFORNAME m_pfnTry_Shader_ForName; + PFN_SHADERFORNAME m_pfnShader_ForName; + PFN_TRYTEXTUREFORNAME m_pfnTry_Texture_ForName; + PFN_TEXTUREFORNAME m_pfnTexture_ForName; + PFN_GETACTIVESHADERCOUNT m_pfnGetActiveShaderCount; + PFN_COLORSHADERFORNAME m_pfnColorShader_ForName; + PFN_SHADERFORNAMENOLOAD m_pfnShader_ForName_NoLoad; + PFN_ACTIVESHADERSSETINUSE m_pfnActiveShaders_SetInUse; + PFN_SORTACTIVESHADERS m_pfnSortActiveShaders; + PFN_ACTIVESHADERFORTEXTURENAME m_pfnActiveShader_ForTextureName; + PFN_CREATESHADERFORTEXTURENAME m_pfnCreateShader_ForTextureName; + PFN_ACTIVESHADERSSETDISPLAYED m_pfnActiveShaders_SetDisplayed; + PFN_ACTIVESHADERFORINDEX m_pfnActiveShader_ForIndex; + PFN_CLEANTEXTURENAME m_pfnCleanTextureName; }; -#include "modulesystem.h" +/*! +\todo FIXME fix the QERApp_ prototyping on shaders module +make it homogeneous with other modules, should be straight calls +*/ -template -class GlobalModule; -typedef GlobalModule GlobalShadersModule; +#ifdef USE_SHADERSTABLE_DEFINE + #ifndef __SHADERSTABLENAME + #define __SHADERSTABLENAME g_ShadersTable + #endif +#define QERApp_Shader_ForName __SHADERSTABLENAME.m_pfnShader_ForName +#define QERApp_Texture_ForName2 __SHADERSTABLENAME.m_pfnTexture_ForName +#define QERApp_FreeShaders __SHADERSTABLENAME.m_pfnFreeShaders +#define QERApp_ReloadShaders __SHADERSTABLENAME.m_pfnReloadShaders +#define QERApp_SortActiveShaders __SHADERSTABLENAME.m_pfnSortActiveShaders +#define QERApp_ReloadShaderFile __SHADERSTABLENAME.m_pfnReloadShaderFile +#define QERApp_LoadShaderFile __SHADERSTABLENAME.m_pfnLoadShaderFile +#define QERApp_HasShader __SHADERSTABLENAME.m_pfnHasShader +#define QERApp_Try_Shader_ForName __SHADERSTABLENAME.m_pfnTry_Shader_ForName +#define QERApp_Try_Texture_ForName __SHADERSTABLENAME.m_pfnTry_Texture_ForName +#define QERApp_ColorShader_ForName __SHADERSTABLENAME.m_pfnColorShader_ForName +#define QERApp_Shader_ForName_NoLoad __SHADERSTABLENAME.m_pfnShader_ForName_NoLoad +#define QERApp_LoadShadersFromDir __SHADERSTABLENAME.m_pfnLoadShadersFromDir +#define QERApp_LoadShadersFromDir __SHADERSTABLENAME.m_pfnLoadShadersFromDir +#define QERApp_CreateShader_ForTextureName __SHADERSTABLENAME.m_pfnCreateShader_ForTextureName +#define QERApp_GetActiveShaderCount __SHADERSTABLENAME.m_pfnGetActiveShaderCount +#define QERApp_ActiveShaders_SetDisplayed __SHADERSTABLENAME.m_pfnActiveShaders_SetDisplayed +#define QERApp_ActiveShader_ForIndex __SHADERSTABLENAME.m_pfnActiveShader_ForIndex +#define QERApp_ActiveShaders_SetInUse __SHADERSTABLENAME.m_pfnActiveShaders_SetInUse +#define QERApp_ActiveShader_ForTextureName __SHADERSTABLENAME.m_pfnActiveShader_ForTextureName +#define QERApp_ActiveShader_ForIndex __SHADERSTABLENAME.m_pfnActiveShader_ForIndex +#define QERApp_CleanTextureName __SHADERSTABLENAME.m_pfnCleanTextureName +#endif -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalShadersModuleRef; +#define APPSHADERS_MAJOR "appshaders" +// FIXME: remove +static const GUID QERAppShadersTable_GUID = +{ 0xec3008a8, 0xbd0b, 0x11d4, { 0x82, 0x51, 0x20, 0x4c, 0x4f, 0x4f, 0x50, 0x20 } }; -inline ShaderSystem& GlobalShaderSystem() +// g_qeglobals.d_qtextures is used internally by the editor for actual camera drawing +typedef qtexture_t** (WINAPI* PFN_QTEXTURES)(); +// g_qeglobals.d_qtexmap is a map for fast access +typedef GHashTable* (WINAPI* PFN_QTEXMAP)(); +// d_texturewin +//++timo NOTE: this same function is also in isurface.h table, we would eventually have to merge some stuff +typedef texturewin_t* (* PFN_QEGLOBALSTEXTUREWIN)(); +// Texture_SetTexture +//++timo NOTE: this one may have to be reorganized too .. putting it here is a bit clumsy +// NOTE: the C++ function used internally has a lot of default values +typedef void (WINAPI* PFN_TEXTURESETTEXTURE)(texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef); +// Texture_ShowInuse +typedef void (WINAPI* PFN_TEXTURESHOWINUSE)(); +// BuildShaderList +typedef void (* PFN_BUILDSHADERLIST)(); +// PreloadShaders +typedef void (* PFN_PRELOADSHADERS)(); + +// a table that Radiant makes available to the shader module in return +struct _QERAppShadersTable { - return GlobalShadersModule::getTable(); -} + int m_nSize; + PFN_QTEXTURES m_pfnQTextures; + PFN_QTEXMAP m_pfnQTexmap; + PFN_QEGLOBALSTEXTUREWIN m_pfnQeglobalsTexturewin; + PFN_TEXTURESETTEXTURE m_pfnTexture_SetTexture; + PFN_TEXTURESHOWINUSE m_pfnTexture_ShowInuse; + PFN_BUILDSHADERLIST m_pfnBuildShaderList; + PFN_PRELOADSHADERS m_pfnPreloadShaders; +}; +#ifdef USE_APPSHADERSTABLE_DEFINE + #ifndef __APPSHADERTABLENAME + #define __APPSHADERTABLENAME g_AppShadersTable + #endif +#define Texture_ShowInuse __APPSHADERTABLENAME.m_pfnTexture_ShowInuse +#endif -#define QERApp_Shader_ForName GlobalShaderSystem().getShaderForName -#define QERApp_ActiveShaders_IteratorBegin GlobalShaderSystem().beginActiveShadersIterator -#define QERApp_ActiveShaders_IteratorAtEnd GlobalShaderSystem().endActiveShadersIterator -#define QERApp_ActiveShaders_IteratorCurrent GlobalShaderSystem().dereferenceActiveShadersIterator -#define QERApp_ActiveShaders_IteratorIncrement GlobalShaderSystem().incrementActiveShadersIterator +/*! +NOTE TTimo: there is an important distinction between SHADER_NOT_FOUND and SHADER_NOTEX: +SHADER_NOT_FOUND means we didn't find the raw texture or the shader for this +SHADER_NOTEX means we recognize this as a shader script, but we are missing the texture to represent it +this was in the initial design of the shader code since early GtkRadiant alpha, and got sort of foxed in 1.2 and put back in +*/ +#define SHADER_NOT_FOUND "textures/radiant/notex" +#define SHADER_NOTEX "textures/radiant/shadernotex" ///< Q3 tech specific #endif diff --git a/include/ishadersmanager.h b/include/ishadersmanager.h new file mode 100644 index 00000000..06ac9d32 --- /dev/null +++ b/include/ishadersmanager.h @@ -0,0 +1,102 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _ISHADERSMANAGER_H_ +#define _ISHADERSMANAGER_H_ + +class IShadersManager +{ + public: + IShadersManager (); + virtual ~IShadersManager (); + + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + + // free all shaders + // free the shaders, will not free the qtexture_t* + virtual void FreeShaders () = 0; + + // reload all the shaders + // this will free everything (shaders and their textures), then reload all in use stuff + virtual void ReloadShaders () = 0; + + // load all shaders in a given directory + // this will scan the list of in-memory shaders, and load the related qtexture_t if needed + virtual void LoadShadersFromDir (const char* path) = 0; + + // load a shader file (ie a set of shaders) + // after LoadShaderFile shaders will be in memory, next step is to load the qtexture_t Radiant uses + // to represent them if a shader with the same name exists, new one will not be loaded + // don't use this to refresh the shaders! + virtual void LoadShaderFile (const char* filename) = 0; + + // tell if a given shader exists in our shader table + // NOTE: this doesn't tell wether it's corresponding qtexture is loaded + virtual int HasShader (const char* name) = 0; + + // return the shader for a given name + // if the qtexture is not already in memory, will try loading it + // if the qtexture could not be found, will use default + // will return NULL on shader not found + virtual IShader* Try_Shader_ForName (const char* name) = 0; + + // return the shader for a given name + // if the qtexture is not already in memory, will try loading it + // will create a default shader if not found (will use a default texture) + virtual IShader* Shader_ForName (const char* name) = 0; + + // query / load a texture + // will not try loading a shader, will look for the actual image file .. + // returns NULL on file not found + // NOTE: strategy for file lookup: + // paths must be relative, ie. textures/me/myfile + // if a 3-letters filename extension (such as .jpg or .tga) is provided, it will get loaded first + // if not found or no extension, will try loading after adding .tga and .jpg (in this order) + virtual qtexture_t* Try_Texture_ForName (const char* filename) = 0; + + // query / load a texture + // will not try loading a shader, will look for the actual image file .. + // on file not found will use the "texture not found" + virtual qtexture_t* Texture_ForName (const char* filename) = 0; + + // get the number of active shaders + // these are the shaders currently loaded, that have an associated qtexture_t* + virtual int GetActiveShaderCount () = 0; + + // for stuff that needs to be represented by a plain texture + // the shader will get a "color" name, use GetColor to get the actual color + virtual IShader* ColorShader_ForName (const char* name) = 0; + + // reload a shaderfile - update shaders and their display properties/qtexture_t if needed + // will not reload the texture files + // will switch to "show in use" atfer use + // filename must be reletive path of the shader, ex. scripts/gothic_wall.shader + virtual void ReloadShaderFile (const char* filename) = 0; + + // retrieve a shader if exists, without loading the textures for it etc. + // use this function if you want special info on a shader + virtual IShader* Shader_ForName_NoLoad (const char* name) = 0; +}; + +#endif // _ISHADERSMANAGER_H_ diff --git a/include/isurfaceplugin.h b/include/isurfaceplugin.h new file mode 100644 index 00000000..61e2fdba --- /dev/null +++ b/include/isurfaceplugin.h @@ -0,0 +1,159 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// +// + +#ifndef __ISURFACEPLUGIN_H_ +#define __ISURFACEPLUGIN_H_ + +typedef struct _GtkWidget GtkWidget; +typedef struct _GtkWindow GtkWindow; + +#define SURFACEDIALOG_MAJOR "surfdialog" + +// there's a void* in each qtexture_t, must be casted to a IPluginTexdef* +// there's a void* in each face_t, must be casted to a IPluginTexdef* +// NOTE: IPluginTexdef stores a pointer to the qtexture_t or face_t it's stored in +// members of IPluginTexdef often access the qtexture_t or face_t they are connected to + +// Write texdef needs a function pointer, because Radiant either writes into a FILE or a CMemFile +typedef void (* PFN_QERAPP_MAPPRINTF) ( char *text, ... ); + +class IPluginTexdef +{ +public: + virtual ~IPluginTexdef() { } + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; +}; + + + +// Nurail: For SI module +class texdef_to_face_t +{ +public: + texdef_to_face_t* next; + brush_t *brush; // Brush faces belong to (for Undo) + face_t *face; // Face of Texdef + texdef_t texdef; // Working texdef + texdef_t orig_texdef; // Original, for baselining changes +}; + + +typedef void (* PFN_QERPLUG_DOSURFACE) (); +typedef void (* PFN_QERPLUG_TOGGLESURFACE) (); +typedef void (* PFN_QERPLUG_UPDATESURFACEDIALOG) (); +typedef void (* PFN_QERPLUG_SURFACEDLGFITALL) (); +typedef GtkWidget* (* PFN_GET_SI_MODULE_WIDGET) (); + +struct _QERPlugSurfaceTable +{ + int m_nSize; + PFN_QERPLUG_TOGGLESURFACE m_pfnToggleSurface; + PFN_QERPLUG_DOSURFACE m_pfnDoSurface; + PFN_QERPLUG_UPDATESURFACEDIALOG m_pfnUpdateSurfaceDialog; + PFN_QERPLUG_SURFACEDLGFITALL m_pfnSurfaceDlgFitAll; + PFN_GET_SI_MODULE_WIDGET m_pfnGet_SI_Module_Widget; +}; + +// this one is used by the plugin to access some Radiant stuff + +#define APPSURFACEDIALOG_MAJOR "appsurfdialog" + +// {42BAE4C0-9787-11d3-8EF3-0000E8E8657B} +static const GUID QERAppSurfaceTable_GUID = +{ 0x42bae4c0, 0x9787, 0x11d3, { 0x8e, 0xf3, 0x0, 0x0, 0xe8, 0xe8, 0x65, 0x7b } }; + +typedef bool (* PFN_PATCHESSELECTED) (); +// retrieve g_qeglobals.texturewin_t +//++timo FIXME: this should move in a dedicated table for all g_qeglobals stuff +typedef texturewin_t* (* PFN_QEGLOBALSTEXTUREWIN) (); +// look for the first selected patch mesh +//++timo FIXME: this is a convenient func since there's no way to scan patches ( yet ) +typedef patchMesh_t* (* PFN_GETSELECTEDPATCH) (); +//++timo FIXME: this one in particular is a hack +typedef void (* PFN_GETTWOSELECTEDPATCH) (patchMesh_t **p1, patchMesh_t **p2); + + +// leo FIXME: hacks uglier than the ones above +typedef void (* PFN_TEXMATTOFAKETEXCOORDS) (vec_t texMat[2][3], float shift[2], float *rot, float scale[2]); +typedef void (* PFN_CONVERTTEXMATWITHQTEXTURE) (brushprimit_texdef_t *texMat1, qtexture_t *qtex1, brushprimit_texdef_t *texMat2, qtexture_t *qtex2); +typedef void (* PFN_FAKETEXCOORDSTOTEXMAT) (float shift[2], float rot, float scale[2], vec_t texMat[2][3]); +typedef void (* PFN_PATCH_RESETTEXTURING) (float fx, float fy); +typedef void (* PFN_PATCH_FITTEXTURING) (); +typedef void (* PFN_PATCH_NATURALIZESELECTED) (bool bCap); +typedef const char* (* PFN_PATCH_GETTEXTURENAME) (); +typedef qboolean (* PFN_QE_SINGLEBRUSH) (bool bQuiet); +typedef qboolean (* PFN_ISBRUSHPRIMITMODE) (); +typedef void (* PFN_SELECT_FITTEXTURE)(int nHeight, int nWidth); +typedef void (*PFN_COMPUTEAXISBASE)(vec3_t normal,vec3_t texS,vec3_t texT ); +typedef void (*PFN_BPMATMUL)(vec_t A[2][3], vec_t B[2][3], vec_t C[2][3]); +typedef void (*PFN_EMITBRUSHPRIMITTEXCOORDS)(face_t * f, winding_t * w); +typedef texdef_t* (*PFN_QEGLOBALSSAVEDINFO_SIINC) (); +typedef float (* PFN_QEGLOBALSGETGRIDSIZE) (); +typedef void (* PFN_FACELIST_FITTEXTURE) (texdef_to_face_t* texdef_face_list, int nHeight, int nWidth); +typedef GtkWindow* (* PFN_GETMAINWINDOW)(); +typedef void (* PFN_SETWINPOS_FROM_PREFS) (GtkWidget *win); +typedef int (* PFN_GETSELECTEDFACECOUNT_BRUSH) (); +typedef void (* PFN_GETSELFACESTEXDEF) (texdef_to_face_t *); +typedef void (* PFN_SETTEXDEF_FACELIST) (texdef_to_face_t* texdef_face_list, bool b_SetUndoPoint, bool bFit_to_Scale); +typedef void (* PFN_SETACTIVEINRADIANT) (); + + +struct _QERAppSurfaceTable +{ + int m_nSize; + PFN_PATCHESSELECTED m_pfnOnlyPatchesSelected; + PFN_PATCHESSELECTED m_pfnAnyPatchesSelected; + PFN_GETSELECTEDPATCH m_pfnGetSelectedPatch; + PFN_GETTWOSELECTEDPATCH m_pfnGetTwoSelectedPatch; + PFN_TEXMATTOFAKETEXCOORDS m_pfnTexMatToFakeTexCoords; + PFN_CONVERTTEXMATWITHQTEXTURE m_pfnConvertTexMatWithQTexture; + PFN_FAKETEXCOORDSTOTEXMAT m_pfnFakeTexCoordsToTexMat; + PFN_PATCH_RESETTEXTURING m_pfnPatch_ResetTexturing; + PFN_PATCH_FITTEXTURING m_pfnPatch_FitTexturing; + PFN_PATCH_NATURALIZESELECTED m_pfnPatch_NaturalizeSelected; + PFN_PATCH_GETTEXTURENAME m_pfnPatch_GetTextureName; + PFN_QE_SINGLEBRUSH m_pfnQE_SingleBrush; + PFN_ISBRUSHPRIMITMODE m_pfnIsBrushPrimitMode; + PFN_COMPUTEAXISBASE m_pfnComputeAxisBase; + PFN_BPMATMUL m_pfnBPMatMul; + PFN_EMITBRUSHPRIMITTEXCOORDS m_pfnEmitBrushPrimitTextureCoordinates; + PFN_QEGLOBALSTEXTUREWIN m_pfnQeglobalsTexturewin; + PFN_SELECT_FITTEXTURE m_pfnSelect_FitTexture; + PFN_QEGLOBALSSAVEDINFO_SIINC m_pfnQERApp_QeglobalsSavedinfo_SIInc; + PFN_QEGLOBALSGETGRIDSIZE m_pfnQeglobalsGetGridSize; + PFN_FACELIST_FITTEXTURE m_pfnFaceList_FitTexture; + PFN_GETMAINWINDOW m_pfnGetMainWindow; + PFN_SETWINPOS_FROM_PREFS m_pfnSetWinPos_From_Prefs; + PFN_GETSELECTEDFACECOUNT_BRUSH m_pfnGetSelectedFaceCountfromBrushes; + PFN_GETSELFACESTEXDEF m_pfnGetSelFacesTexdef; + PFN_SETTEXDEF_FACELIST m_pfnSetTexdef_FaceList; +}; + +#endif diff --git a/include/itexdef.cpp b/include/itexdef.cpp deleted file mode 100644 index 1973c960..00000000 --- a/include/itexdef.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "itexdef.h" - diff --git a/include/itexdef.h b/include/itexdef.h deleted file mode 100644 index a299843b..00000000 --- a/include/itexdef.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_ITEXDEF_H) -#define INCLUDED_ITEXDEF_H - -class texdef_t -{ -public: - float shift[2]; - float rotate; - float scale[2]; - - texdef_t() - { - shift[0] = 0; - shift[1] = 0; - rotate = 0; - scale[0] = 1; - scale[1] = 1; - } -}; - -#endif diff --git a/include/itextstream.cpp b/include/itextstream.cpp deleted file mode 100644 index c93ae35a..00000000 --- a/include/itextstream.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "itextstream.h" - diff --git a/include/itextstream.h b/include/itextstream.h deleted file mode 100644 index 891336e7..00000000 --- a/include/itextstream.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ITEXTSTREAM_H) -#define INCLUDED_ITEXTSTREAM_H - -/// \file -/// \brief Text-stream interfaces. - -#include -#include "generic/static.h" - -/// \brief A read-only character-stream. -class TextInputStream -{ -public: - /// \brief Attempts to read the next \p length characters from the stream to \p buffer. - /// Returns the number of characters actually stored in \p buffer. - virtual std::size_t read(char* buffer, std::size_t length) = 0; -}; - -/// \brief A write-only character-stream. -class TextOutputStream -{ -public: - /// \brief Attempts to write \p length characters to the stream from \p buffer. - /// Returns the number of characters actually read from \p buffer. - virtual std::size_t write(const char* buffer, std::size_t length) = 0; -}; - -/// \brief Calls the overloaded function ostream_write() to perform text formatting specific to the type being written. -/*! Note that ostream_write() is not globally defined - it must be defined once for each type supported.\n -To support writing a custom type MyClass to any kind of text-output-stream with operator<<: -\code -template -TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const MyClass& myClass) -{ - return ostream << myClass.getName() << ' ' << myClass.getText(); -} -\endcode -Expressing this as a template allows it to be used directly with any concrete text-output-stream type, not just the abstract TextOutputStream\n -\n -This overload writes a single character to any text-output-stream - ostream_write(TextOutputStreamType& ostream, char c). -*/ -template -inline TextOutputStream& operator<<(TextOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - -class NullOutputStream : public TextOutputStream -{ -public: - std::size_t write(const char*, std::size_t length) - { - return length; - } -}; - -class OutputStreamHolder -{ - NullOutputStream m_nullOutputStream; - TextOutputStream* m_outputStream; -public: - OutputStreamHolder() - : m_outputStream(&m_nullOutputStream) - { - } - void setOutputStream(TextOutputStream& outputStream) - { - m_outputStream = &outputStream; - } - TextOutputStream& getOutputStream() - { - return *m_outputStream; - } -}; - -typedef Static GlobalOutputStream; - -/// \brief Returns the global output stream. Used to display messages to the user. -inline TextOutputStream& globalOutputStream() -{ - return GlobalOutputStream::instance().getOutputStream(); -} - -class ErrorStreamHolder : public OutputStreamHolder {}; -typedef Static GlobalErrorStream; - -/// \brief Returns the global error stream. Used to display error messages to the user. -inline TextOutputStream& globalErrorStream() -{ - return GlobalErrorStream::instance().getOutputStream(); -} - -#endif diff --git a/include/itextures.cpp b/include/itextures.cpp deleted file mode 100644 index 26e2bf6d..00000000 --- a/include/itextures.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "itextures.h" - diff --git a/include/itextures.h b/include/itextures.h deleted file mode 100644 index 368e7b76..00000000 --- a/include/itextures.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ITEXTURES_H) -#define INCLUDED_ITEXTURES_H - -#include "iimage.h" -#include "generic/constant.h" - -struct qtexture_t; - -class LoadImageCallback -{ - typedef Image* (*LoadFunc)(void* environment, const char* name); -public: - void* m_environment; - LoadFunc m_func; - - LoadImageCallback(void* environment, LoadFunc func) : m_environment(environment), m_func(func) - { - } - Image* loadImage(const char* name) const - { - return m_func(m_environment, name); - } -}; - -inline bool operator==(const LoadImageCallback& self, const LoadImageCallback& other) -{ - return self.m_environment == other.m_environment && self.m_func == other.m_func; -} -inline bool operator<(const LoadImageCallback& self, const LoadImageCallback& other) -{ - return self.m_environment < other.m_environment || - (!(other.m_environment < self.m_environment) && self.m_func < other.m_func); -} - -class TexturesCacheObserver -{ -public: - virtual void unrealise() = 0; - virtual void realise() = 0; -}; - -class TexturesCache -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "textures"); - virtual LoadImageCallback defaultLoader() const = 0; - virtual Image* loadImage(const char* name) = 0; - virtual qtexture_t* capture(const char* name) = 0; - virtual qtexture_t* capture(const LoadImageCallback& load, const char* name) = 0; - virtual void release(qtexture_t* texture) = 0; - virtual void attach(TexturesCacheObserver& observer) = 0; - virtual void detach(TexturesCacheObserver& observer) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalTexturesModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalTexturesModuleRef; - -inline TexturesCache& GlobalTexturesCache() -{ - return GlobalTexturesModule::getTable(); -} - -#endif diff --git a/include/itoolbar.cpp b/include/itoolbar.cpp deleted file mode 100644 index 2c989b6a..00000000 --- a/include/itoolbar.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "itoolbar.h" - diff --git a/include/itoolbar.h b/include/itoolbar.h index 350e5a5f..75b7bfdb 100644 --- a/include/itoolbar.h +++ b/include/itoolbar.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,11 +19,16 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IPLUGTOOLBAR_H) -#define INCLUDED_IPLUGTOOLBAR_H +#ifndef __IPLUGTOOLBAR_H_ +#define __IPLUGTOOLBAR_H_ -#include -#include "generic/constant.h" +/* +NOTE: this API requires Gtk +it's a good practice to avoid putting #include here +in some cases, the compiler will get confused because of 'list' identifiers between Gtk and STL headers +*/ + +#define TOOLBAR_MAJOR "toolbar" class IToolbarButton { @@ -36,6 +41,7 @@ public: eRadioButton, }; + virtual ~IToolbarButton() { } virtual const char* getImage() const = 0; virtual const char* getText() const = 0; virtual const char* getTooltip() const = 0; @@ -43,24 +49,14 @@ public: virtual void activate() const = 0; }; -typedef std::size_t (* PFN_TOOLBARBUTTONCOUNT)(); -typedef const IToolbarButton* (* PFN_GETTOOLBARBUTTON)(std::size_t index); +typedef unsigned int (* PFN_TOOLBARBUTTONCOUNT)(); +typedef const IToolbarButton* (* PFN_GETTOOLBARBUTTON)(unsigned int index); struct _QERPlugToolbarTable { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "toolbar"); - + int m_nSize; PFN_TOOLBARBUTTONCOUNT m_pfnToolbarButtonCount; PFN_GETTOOLBARBUTTON m_pfnGetToolbarButton; }; -template -class Modules; -typedef Modules<_QERPlugToolbarTable> ToolbarModules; - -template -class ModulesRef; -typedef ModulesRef<_QERPlugToolbarTable> ToolbarModulesRef; - #endif diff --git a/include/iui.h b/include/iui.h new file mode 100644 index 00000000..19e93d88 --- /dev/null +++ b/include/iui.h @@ -0,0 +1,162 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// interface for all-purpose messaging and UI +// window class for MFC, Gtk or Q3 UI +// each version of Radiant implements the API, using the native code that it needs + +#ifndef __IUI_H_ +#define __IUI_H_ + +// this one can be hooked in the GL window procs for customizing GUI through plugins +// the class is implemented by the plugin module, and given to Radiant who calls into it +class IWindowListener +{ +public: + virtual ~IWindowListener() { } + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + // since Radiant is MFC we don't use a WNDPROC, we wrap the MFC handlers + // the handler is called first, if returns false Radiant continues processing + //++timo maybe add more later ? OnKeyUp and OnKeyDown for instance + //++timo TODO: add handlers everywhere + // Gef: Changed 2nd & 3rd params to gdouble's for sub-integer grid sizes + virtual bool OnLButtonDown(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnMButtonDown(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnRButtonDown(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnLButtonUp(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnMButtonUp(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnRButtonUp(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnMouseMove(guint32 nFlags, gdouble x, gdouble y) = 0; + virtual bool OnKeyPressed(char *s) = 0; + + // paint message, the caller makes the GL context current, calls Paint, then swaps GL buffers + // return value might be false if something failed and closure is requested .. then the buffer swap will be cancelled + virtual bool Paint() = 0; + // window is closing (nothing you can do, just telling) + virtual void Close() = 0; +}; + +// IWindowListener with additional properties +// NOTE: for now it is both a window and the GL widget +// in the case of Gtk, there are two widgets, the window widget (a container) and the GL widget +class IWindow +{ +public: + virtual ~IWindow() {} + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + // misc data ------------------------------------------------ + // get pixel size + virtual int getHeight() = 0; + virtual int getWidth() = 0; + // initialisation stuff ------------------------------------- + // set pixel size and other parameters before showing it + virtual void setSizeParm(int width, int height) = 0; + // set the IWindowListener (implemented by the plugin using this window) + virtual void setListener(IWindowListener *) = 0; + // set the window name + virtual void setName(char *) = 0; + // will actually create the GL and the window based on the parameters + virtual bool Show() = 0; + // commands ------------------------------------------------- + // call this to ask for a Redraw + virtual void Redraw() = 0; +}; + +// various Radiant messages -------- +// this one holds the total number of supported messages (this is used to allocate structs) +#define RADIANT_MSGCOUNT 5 +// they start with a 0, can be indexed in an array +// something was selected / deselected +#define RADIANT_SELECTION 0 +// a brush face was selected / deselected +#define RADIANT_SFACE 1 +// current texture / shader changed +#define RADIANT_TEXTURE 2 +// Radiant is going to enter "sleep mode" (all GL contexts will be destroyed) +#define RADIANT_SLEEP 3 +// Radiant has left "sleep mode" (GL contexts are recreated) +#define RADIANT_WAKEUP 4 + + +// this one can be used to listen for Radiant-specific events, not related to a window +class IListener +{ +public: + virtual ~IListener() {} + // Increment the number of references to this object + virtual void IncRef () = 0; + // Decrement the reference count + virtual void DecRef () = 0; + // message is one of the RADIANT_* consts + virtual void DispatchRadiantMsg( int Msg ) = 0; +}; + +// this one is provided by Radiant, it's a wrapper for some usefull functions +class IXYWndWrapper +{ +public: + virtual ~IXYWndWrapper() {} + virtual void SnapToGrid( int x1, int y1, vec3_t pt ) = 0; + virtual VIEWTYPE GetViewType( void ) = 0; +}; + +#define UI_MAJOR "ui" + +// create an IWindow with GL context +typedef IWindow* (WINAPI* PFN_QERAPP_CREATEGLWINDOW) (); + +// will hook the given IWindowListener to the XY window and increment the ref count +//++timo TODO: add hooking in the CAM view and Z view +typedef void (WINAPI* PFN_QERAPP_HOOKWINDOW) (IWindowListener *); +// will unhook the given IWindowListener +typedef void (WINAPI* PFN_QERAPP_UNHOOKWINDOW) (IWindowListener *); +// to retrieve the IXYWndWrapper +typedef IXYWndWrapper* (WINAPI* PFN_QERAPP_GETXYWNDWRAPPER) (); + +// will hook a given listener into Radiant listening for the given message and increment ref count +// call several times to listen for several messages +typedef void (WINAPI* PFN_QERAPP_HOOKLISTENER) (IListener *, int Msg); +// will unhook the listener and return the number of messages the given listener was removed from +typedef int (WINAPI* PFN_QERAPP_UNHOOKLISTENER)(IListener *); + +// TODO: create GL widget, destroy it + +struct _QERUITable +{ + int m_nSize; + PFN_QERAPP_CREATEGLWINDOW m_pfnCreateGLWindow; + PFN_QERAPP_HOOKWINDOW m_pfnHookWindow; + PFN_QERAPP_UNHOOKWINDOW m_pfnUnHookWindow; + PFN_QERAPP_GETXYWNDWRAPPER m_pfnGetXYWndWrapper; + PFN_QERAPP_HOOKLISTENER m_pfnHookListener; + PFN_QERAPP_UNHOOKLISTENER m_pfnUnHookListener; +}; + +#endif diff --git a/include/iui_gtk.h b/include/iui_gtk.h new file mode 100644 index 00000000..93973672 --- /dev/null +++ b/include/iui_gtk.h @@ -0,0 +1,59 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION +// This contains functions specific to the UI toolkit +// it is best to avoid using them, but they are provided for backward compatibility with the older interfaces +// the abstracted UI layer in iUI.h is not sufficient for some tasks .. no other choice than to rely on UI specific code + +#ifndef __IGL_GTK_H__ +#define __IGL_GTK_H__ + +#define UIGTK_MAJOR "uigtk" + +// All OpenGL stuff is handled by GLWidget to ensure portability +typedef GtkWidget* (WINAPI* PFN_QERAPP_GETQEGLOBALSGLWIDGET) (); +typedef GtkWidget* (WINAPI* PFN_GLWIDGET_NEW) (gboolean zbufffer, GtkWidget* share); +typedef void (WINAPI* PFN_GLWIDGET_SWAPBUFFERS) (GtkWidget* widget); +typedef gboolean (WINAPI* PFN_GLWIDGET_MAKECURRENT) (GtkWidget* widget); +typedef void (WINAPI* PFN_GLWIDGET_DESTROYCONTEXT) (GtkWidget* widget); +typedef void (WINAPI* PFN_GLWIDGET_CREATECONTEXT) (GtkWidget* widget); +#if 0 +typedef gpointer (WINAPI* PFN_GLWIDGET_GETCONTEXT) (GtkWidget* widget); +#endif + +struct _QERUIGtkTable +{ + int m_nSize; + PFN_QERAPP_GETQEGLOBALSGLWIDGET m_pfn_GetQeglobalsGLWidget; + PFN_GLWIDGET_NEW m_pfn_glwidget_new; + PFN_GLWIDGET_SWAPBUFFERS m_pfn_glwidget_swap_buffers; + PFN_GLWIDGET_MAKECURRENT m_pfn_glwidget_make_current; + PFN_GLWIDGET_DESTROYCONTEXT m_pfn_glwidget_destroy_context; + PFN_GLWIDGET_CREATECONTEXT m_pfn_glwidget_create_context; +#if 0 + PFN_GLWIDGET_GETCONTEXT m_pfn_glwidget_get_context; +#endif +}; + +#endif diff --git a/include/iundo.cpp b/include/iundo.cpp deleted file mode 100644 index 49b96b03..00000000 --- a/include/iundo.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "iundo.h" - diff --git a/include/iundo.h b/include/iundo.h index 4dcbad85..b4fffeec 100644 --- a/include/iundo.h +++ b/include/iundo.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,92 +19,69 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_IUNDO_H) -#define INCLUDED_IUNDO_H +#ifndef _IUNDO_H_ +#define _IUNDO_H_ -/// \file -/// \brief The undo-system interface. Uses the 'memento' pattern. +#define UNDO_MAJOR "undo" -#include -#include "generic/constant.h" -#include "generic/callbackfwd.h" +//start operation +typedef void (*PFN_UNDOSTART) (char *operation); +//end operation +typedef void (*PFN_UNDOEND) (void); +//add brush to the undo +typedef void (*PFN_UNDOADDBRUSH) (brush_t *pBrush); +//end a brush after the operation is performed +typedef void (*PFN_UNDOENDBRUSH) (brush_t *pBrush); +//add a list with brushes to the undo +typedef void (*PFN_UNDOADDBRUSHLIST) (brush_t *brushlist); +//end a list with brushes after the operation is performed +typedef void (*PFN_UNDOENDBRUSHLIST) (brush_t *brushlist); +//add entity to undo +typedef void (*PFN_UNDOADDENTITY) (entity_t *entity); +//end an entity after the operation is performed +typedef void (*PFN_UNDOENDENTITY) (entity_t *entity); +//undo last operation (bSilent == true -> will not print the "undone blah blah message") +typedef void (*PFN_UNDO) (unsigned char bSilent); +//redo last undone operation +typedef void (*PFN_REDO) (void); +//get the undo Id of the next undo (0 if none available) +typedef int (*PFN_GETUNDOID) (void); +//returns true if there is something to be undone available +typedef int (*PFN_UNDOAVAILABLE) (void); +//returns true if there is something to redo available +typedef int (*PFN_REDOAVAILABLE) (void); -class UndoMemento +struct _QERUndoTable { -public: - virtual void release() = 0; + int m_nSize; + PFN_UNDOSTART m_pfnUndo_Start; + PFN_UNDOEND m_pfnUndo_End; + PFN_UNDOADDBRUSH m_pfnUndo_AddBrush; + PFN_UNDOENDBRUSH m_pfnUndo_EndBrush; + PFN_UNDOADDBRUSHLIST m_pfnUndo_AddBrushList; + PFN_UNDOENDBRUSHLIST m_pfnUndo_EndBrushList; + PFN_UNDOADDENTITY m_pfnUndo_AddEntity; + PFN_UNDOENDENTITY m_pfnUndo_EndEntity; + PFN_UNDO m_pfnUndo_Undo; + PFN_REDO m_pfnUndo_Redo; + PFN_GETUNDOID m_pfnUndo_GetUndoId; + PFN_UNDOAVAILABLE m_pfnUndo_UndoAvailable; + PFN_REDOAVAILABLE m_pfnUndo_RedoAvailable; }; -class Undoable -{ -public: - virtual UndoMemento* exportState() const = 0; - virtual void importState(const UndoMemento* state) = 0; -}; - -class UndoObserver -{ -public: - virtual void save(Undoable* undoable) = 0; -}; - -class UndoTracker -{ -public: - virtual void clear() = 0; - virtual void begin() = 0; - virtual void undo() = 0; - virtual void redo() = 0; -}; - -class UndoSystem -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "undo"); - - virtual UndoObserver* observer(Undoable* undoable) = 0; - virtual void release(Undoable* undoable) = 0; - - virtual std::size_t size() const = 0; - virtual void start() = 0; - virtual void finish(const char* command) = 0; - virtual void undo() = 0; - virtual void redo() = 0; - virtual void clear() = 0; - - virtual void trackerAttach(UndoTracker& tracker) = 0; - virtual void trackerDetach(UndoTracker& tracker) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalUndoModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalUndoModuleRef; - -inline UndoSystem& GlobalUndoSystem() -{ - return GlobalUndoModule::getTable(); -} - -class UndoableCommand -{ - const char* m_command; -public: - UndoableCommand(const char* command) : m_command(command) - { - GlobalUndoSystem().start(); - } - ~UndoableCommand() - { - GlobalUndoSystem().finish(m_command); - } -}; - - +#ifdef USE_UNDOTABLE_DEFINE +#ifndef __UNDOTABLENAME +#define __UNDOTABLENAME g_UndoTable #endif +#define Undo_Start __UNDOTABLENAME.m_pfnUndo_Start +#define Undo_End __UNDOTABLENAME.m_pfnUndo_End +#define Undo_AddBrush __UNDOTABLENAME.m_pfnUndo_AddBrush +#define Undo_EndBrush __UNDOTABLENAME.m_pfnUndo_EndBrush +#define Undo_AddBrushList __UNDOTABLENAME.m_pfnUndo_AddBrushList +#define Undo_EndBrushList __UNDOTABLENAME.m_pfnUndo_EndBrushList +#define Undo_AddEntity __UNDOTABLENAME.m_pfnUndo_AddEntity +#define Undo_EndEntity __UNDOTABLENAME.m_pfnUndo_EndEntity +#endif + +#endif // _IUNDO_H_ + diff --git a/include/mapfile.cpp b/include/mapfile.cpp deleted file mode 100644 index 1065f591..00000000 --- a/include/mapfile.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mapfile.h" - diff --git a/include/mapfile.h b/include/mapfile.h deleted file mode 100644 index e53d79c1..00000000 --- a/include/mapfile.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MAPFILE_H) -#define INCLUDED_MAPFILE_H - -#include - -#include "iscenegraph.h" -#include "generic/callbackfwd.h" - -const std::size_t MAPFILE_MAX_CHANGES = std::numeric_limits::max(); - -class MapFile -{ -public: - STRING_CONSTANT(Name, "MapFile"); - - virtual void save() = 0; - virtual bool saved() const = 0; - virtual void changed() = 0; - virtual void setChangedCallback(const Callback& changed) = 0; - virtual std::size_t changes() const = 0; -}; - -#include "scenelib.h" - -inline MapFile* Node_getMapFile(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -template -inline MapFile* path_find_mapfile(Iterator first, Iterator last) -{ - Iterator i = last; - for(;;) - { - --i; - - MapFile* map = Node_getMapFile(*i); - if(map != 0) - { - return map; - } - - if(i == first) - { - break; - } - } - ERROR_MESSAGE("failed to find parent mapfile for path"); - return 0; -} - - - -#endif diff --git a/include/misc_def.h b/include/misc_def.h new file mode 100644 index 00000000..526dd6c9 --- /dev/null +++ b/include/misc_def.h @@ -0,0 +1,66 @@ +#ifndef _WIN32 + +#define WINAPI +#ifndef APIENTRY + #define APIENTRY +#endif + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; +typedef char* LPSTR; + +#define IsEqualGUID(a,b) (memcmp(&a,&b,sizeof(a)) == 0) + +#ifndef GUID_DEFINED +#define GUID_DEFINED +typedef struct _GUID +{ + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; +#endif + +#if defined(__cplusplus) +#ifndef _REFGUID_DEFINED +#define _REFGUID_DEFINED +#define REFGUID const GUID & +#endif // !_REFGUID_DEFINED +#endif + +// Message box constants +#define MB_OK 0x00000000L +#define MB_OKCANCEL 0x00000001L +#define MB_ABORTRETRYIGNORE 0x00000002L +#define MB_YESNOCANCEL 0x00000003L +#define MB_YESNO 0x00000004L +#define MB_RETRYCANCEL 0x00000005L + +#define MB_ICONHAND 0x00000010L +#define MB_ICONQUESTION 0x00000020L +#define MB_ICONEXCLAMATION 0x00000030L +#define MB_ICONASTERISK 0x00000040L + +#define MB_USERICON 0x00000080L +#define MB_ICONWARNING MB_ICONEXCLAMATION +#define MB_ICONERROR MB_ICONHAND +#define MB_ICONINFORMATION MB_ICONASTERISK +#define MB_ICONSTOP MB_ICONHAND + +#define MB_TYPEMASK 0x0000000FL +#define MB_ICONMASK 0x000000F0L +#define MB_DEFMASK 0x00000F00L +#define MB_MODEMASK 0x00003000L +#define MB_MISCMASK 0x0000C000L + +#define IDOK 1 +#define IDCANCEL 2 +#define IDABORT 3 +#define IDRETRY 4 +#define IDIGNORE 5 +#define IDYES 6 +#define IDNO 7 + +#endif diff --git a/include/modelskin.cpp b/include/modelskin.cpp deleted file mode 100644 index 6d34f272..00000000 --- a/include/modelskin.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "modelskin.h" - diff --git a/include/modelskin.h b/include/modelskin.h deleted file mode 100644 index c01b5f30..00000000 --- a/include/modelskin.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODELSKIN_H) -#define INCLUDED_MODELSKIN_H - -#include "generic/constant.h" -#include "generic/callbackfwd.h" - -class SkinRemap -{ -public: - const char* m_from; - const char* m_to; - SkinRemap(const char* from, const char* to) : m_from(from), m_to(to) - { - } -}; - -typedef Callback1 SkinRemapCallback; -class ModuleObserver; - -class ModelSkin -{ -public: - STRING_CONSTANT(Name, "ModelSkin"); - /// \brief Attach an \p observer whose realise() and unrealise() methods will be called when the skin is loaded or unloaded. - virtual void attach(ModuleObserver& observer) = 0; - /// \brief Detach an \p observer previously-attached by calling \c attach. - virtual void detach(ModuleObserver& observer) = 0; - /// \brief Returns true if this skin is currently loaded. - virtual bool realised() const = 0; - /// \brief Returns the shader identifier that \p name remaps to, or "" if not found or not realised. - virtual const char* getRemap(const char* name) const = 0; - /// \brief Calls \p callback for each remap pair. Has no effect if not realised. - virtual void forEachRemap(const SkinRemapCallback& callback) const = 0; -}; - -class SkinnedModel -{ -public: - STRING_CONSTANT(Name, "SkinnedModel"); - /// \brief Instructs the skinned model to update its skin. - virtual void skinChanged() = 0; -}; - -class ModelSkinCache -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "modelskin"); - /// \brief Increments the reference count of and returns a reference to the skin uniquely identified by 'name'. - virtual ModelSkin& capture(const char* name) = 0; - /// \brief Decrements the reference-count of the skin uniquely identified by 'name'. - virtual void release(const char* name) = 0; -}; - - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalModelSkinCacheModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalModelSkinCacheModuleRef; - -inline ModelSkinCache& GlobalModelSkinCache() -{ - return GlobalModelSkinCacheModule::getTable(); -} - -#endif diff --git a/include/moduleobserver.cpp b/include/moduleobserver.cpp deleted file mode 100644 index fa26f8d9..00000000 --- a/include/moduleobserver.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "moduleobserver.h" - diff --git a/include/moduleobserver.h b/include/moduleobserver.h deleted file mode 100644 index e218b4aa..00000000 --- a/include/moduleobserver.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULEOBSERVER_H) -#define INCLUDED_MODULEOBSERVER_H - -class ModuleObserver -{ -public: - virtual void unrealise() = 0; - virtual void realise() = 0; -}; - -#endif diff --git a/include/modulesystem.cpp b/include/modulesystem.cpp deleted file mode 100644 index 6b7a27c9..00000000 --- a/include/modulesystem.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "modulesystem.h" - diff --git a/include/modulesystem.h b/include/modulesystem.h deleted file mode 100644 index dd7c59ad..00000000 --- a/include/modulesystem.h +++ /dev/null @@ -1,258 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULESYSTEM_H) -#define INCLUDED_MODULESYSTEM_H - -#include "generic/static.h" -#include "debugging/debugging.h" - -#if defined(WIN32) -#define RADIANT_DLLEXPORT __stdcall -#else -#define RADIANT_DLLEXPORT -#endif - - -class Module -{ -public: - virtual void capture() = 0; - virtual void release() = 0; - virtual void* getTable() = 0; -}; - -inline void* Module_getTable(Module& module) -{ - return module.getTable(); -} - -class TextOutputStream; -class DebugMessageHandler; - -class ModuleServer -{ -public: - class Visitor - { - public: - virtual void visit(const char* name, Module& module) const = 0; - }; - - virtual void setError(bool error) = 0; - virtual bool getError() const = 0; - - virtual TextOutputStream& getOutputStream() = 0; - virtual TextOutputStream& getErrorStream() = 0; - virtual DebugMessageHandler& getDebugMessageHandler() = 0; - - virtual void registerModule(const char* type, int version, const char* name, Module& module) = 0; - virtual Module* findModule(const char* type, int version, const char* name) const = 0; - virtual void foreachModule(const char* type, int version, const Visitor& visitor) = 0; -}; - -class ModuleServerHolder -{ - ModuleServer* m_server; -public: - ModuleServerHolder() - : m_server(0) - { - } - void set(ModuleServer& server) - { - m_server = &server; - } - ModuleServer& get() - { - return *m_server; - } -}; - -typedef Static GlobalModuleServer; - -inline ModuleServer& globalModuleServer() -{ - return GlobalModuleServer::instance().get(); -} - - -inline void initialiseModule(ModuleServer& server) -{ - GlobalErrorStream::instance().setOutputStream(server.getErrorStream()); - GlobalOutputStream::instance().setOutputStream(server.getOutputStream()); - GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler()); - GlobalModuleServer::instance().set(server); -} - - - -template -class Modules -{ -public: - class Visitor - { - public: - virtual void visit(const char* name, const Type& table) const = 0; - }; - - virtual Type* findModule(const char* name) = 0; - virtual void foreachModule(const Visitor& visitor) = 0; -}; - -#include "debugging/debugging.h" - -template -class ModuleRef -{ - Module* m_module; - Type* m_table; -public: - ModuleRef(const char* name) : m_table(0) - { - if(!globalModuleServer().getError()) - { - m_module = globalModuleServer().findModule(typename Type::Name(), typename Type::Version(), name); - if(m_module == 0) - { - globalModuleServer().setError(true); - globalErrorStream() << "ModuleRef::initialise: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " name=" << makeQuoted(name) << " - not found\n"; - } - else - { - m_module->capture(); - if(!globalModuleServer().getError()) - { - m_table = static_cast(m_module->getTable()); - } - } - } - } - ~ModuleRef() - { - if(m_module != 0) - { - m_module->release(); - } - } - Type* getTable() - { -#if defined(_DEBUG) - ASSERT_MESSAGE(m_table != 0, "ModuleRef::getTable: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " - module-reference used without being initialised"); -#endif - return m_table; - } -}; - -template -class SingletonModuleRef -{ - Module* m_module; - Type* m_table; -public: - - SingletonModuleRef() - : m_module(0), m_table(0) - { - } - - bool initialised() const - { - return m_module != 0; - } - - void initialise(const char* name) - { - m_module = globalModuleServer().findModule(typename Type::Name(), typename Type::Version(), name); - if(m_module == 0) - { - globalModuleServer().setError(true); - globalErrorStream() << "SingletonModuleRef::initialise: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " name=" << makeQuoted(name) << " - not found\n"; - } - } - - Type* getTable() - { -#if defined(_DEBUG) - ASSERT_MESSAGE(m_table != 0, "SingletonModuleRef::getTable: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " - module-reference used without being initialised"); -#endif - return m_table; - } - void capture() - { - if(initialised()) - { - m_module->capture(); - m_table = static_cast(m_module->getTable()); - } - } - void release() - { - if(initialised()) - { - m_module->release(); - } - } -}; - -template -class GlobalModule -{ - static SingletonModuleRef m_instance; -public: - static SingletonModuleRef& instance() - { - return m_instance; - } - static Type& getTable() - { - return *m_instance.getTable(); - } -}; - -template -SingletonModuleRef GlobalModule::m_instance; - - -template -class GlobalModuleRef -{ -public: - GlobalModuleRef(const char* name = "*") - { - if(!globalModuleServer().getError()) - { - GlobalModule::instance().initialise(name); - } - GlobalModule::instance().capture(); - } - ~GlobalModuleRef() - { - GlobalModule::instance().release(); - } - Type& getTable() - { - return GlobalModule::getTable(); - } -}; - -#endif diff --git a/include/nameable.cpp b/include/nameable.cpp deleted file mode 100644 index f401626c..00000000 --- a/include/nameable.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "nameable.h" - diff --git a/include/nameable.h b/include/nameable.h deleted file mode 100644 index 8e1357a4..00000000 --- a/include/nameable.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_NAMEABLE_H) -#define INCLUDED_NAMEABLE_H - -#include "generic/constant.h" -#include "generic/callbackfwd.h" - -typedef Callback1 NameCallback; - -class Nameable -{ -public: - STRING_CONSTANT(Name, "Nameable"); - - virtual const char* name() const = 0; - virtual void attach(const NameCallback& callback) = 0; - virtual void detach(const NameCallback& callback) = 0; -}; - - -#endif diff --git a/include/namespace.cpp b/include/namespace.cpp deleted file mode 100644 index 2f322fda..00000000 --- a/include/namespace.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "namespace.h" - diff --git a/include/namespace.h b/include/namespace.h deleted file mode 100644 index 30367bfd..00000000 --- a/include/namespace.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_NAMESPACE_H) -#define INCLUDED_NAMESPACE_H - -#include "generic/constant.h" -#include "generic/callbackfwd.h" - -typedef Callback1 NameCallback; -typedef Callback1 NameCallbackCallback; - -class Namespace -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "namespace"); - virtual void attach(const NameCallback& setName, const NameCallbackCallback& attachObserver) = 0; - virtual void detach(const NameCallback& setName, const NameCallbackCallback& detachObserver) = 0; - virtual void makeUnique(const char* name, const NameCallback& setName) const = 0; -}; - -class Namespaced -{ -public: - STRING_CONSTANT(Name, "Namespaced"); - - virtual void setNamespace(Namespace& space) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalNamespaceModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalNamespaceModuleRef; - -inline Namespace& GlobalNamespace() -{ - return GlobalNamespaceModule::getTable(); -} -#endif diff --git a/include/preferencesystem.cpp b/include/preferencesystem.cpp deleted file mode 100644 index a5fecd4d..00000000 --- a/include/preferencesystem.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if 0 - -#include "preferencesystem.h" -#include "preferencedictionary.h" - -#include "xml/xmlparser.h" -#include "xml/xmlwriter.h" - - -void LoadPrefs(PreferenceDictionary& preferences, const char* filename) -{ - TextFileInputStream file(filename); - if(!file.failed()) - { - XMLStreamParser parser(file); - XMLPreferenceDictionaryImporter importer(preferences); - parser.exportXML(importer); - } - else - { - // error - } -} - -void SavePrefs(PreferenceDictionary& preferences, const char* filename) -{ - TextFileOutputStream file(filename); - if(!file.failed()) - { - XMLStreamWriter writer(file); - XMLPreferenceDictionaryExporter exporter(preferences, "1"); - exporter.exportXML(writer); - } - else - { - // error - } -} - - -class StringPreference -{ -public: - class Observer - { - public: - virtual void onChanged() = 0; - }; - -private: - CopiedString m_string; - Observer& m_observer; -public: - StringPreference(Observer& observer) - : m_observer(observer) - { - } - void importString(const char* value) - { - m_string = value; - m_observer.onChanged(); - } - typedef MemberCaller1 ImportStringCaller; - void exportString(StringImportCallback& importer) - { - importer(m_string.c_str()); - } - typedef MemberCaller1 ExportStringCaller; -}; - -inline void int_export(int i, StringImportCallback& importer) -{ - char buffer[16]; - sprintf(buffer, "%d", i); - importer(buffer); -} - -inline int int_import(const char* value) -{ - return atoi(value); -} - -class IntPreference -{ -public: - class Observer - { - public: - virtual void onChanged() = 0; - }; - -private: - int m_int; - Observer& m_observer; -public: - - IntPreference(Observer& observer) - : m_observer(observer) - { - } - void importString(const char* value) - { - m_int = int_import(value); - m_observer.onChanged(); - } - typedef MemberCaller1 ImportStringCaller; - void exportString(StringImportCallback& importer) - { - int_export(m_int, importer); - } - typedef MemberCaller1 ExportStringCaller; -}; - -class IntPreferenceImporter -{ - int& m_i; -public: - - IntPreferenceImporter(int& i) - : m_i(i) - { - } - void importString(const char* value) - { - m_i = int_import(value); - } -}; - - -class TestPrefs -{ -public: - TestPrefs() - { - PreferenceDictionary preferences; - - class StringObserver : public StringPreference::Observer - { - public: - void onChanged() - { - int bleh = 0; - } - } string_observer; - StringPreference string1(string_observer); - string1.importString("twenty-three"); - - class IntObserver : public IntPreference::Observer - { - public: - void onChanged() - { - int bleh = 0; - } - - } int_observer; - IntPreference int1(int_observer); - int1.importString("23"); - - preferences.registerPreference("string1", StringPreference::ImportStringCaller(string1), StringPreference::ExportStringCaller(string1)); - preferences.registerPreference("int1", IntPreference::ImportStringCaller(int1), IntPreference::ExportStringCaller(int1)); - - LoadPrefs(preferences, "test.pref"); - SavePrefs(preferences, "test.pref"); - - } -}; - -#if 0 -TestPrefs g_TestPrefs; -#endif - -void readpref(PreferenceDictionary& preferences, int& int_variable) -{ - PreferenceDictionary::iterator i = preferences.find("int_variable"); - IntPreferenceImporter importer(int_variable); - (*i).second.exporter().exportString(importer); -} - -void writepref(PreferenceDictionary& preferences, int& int_variable) -{ - PreferenceDictionary::iterator i = preferences.find("int_variable"); - int_export(int_variable, (*i).second.importer()); -} -#endif diff --git a/include/preferencesystem.h b/include/preferencesystem.h deleted file mode 100644 index f5ebae1d..00000000 --- a/include/preferencesystem.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PREFERENCESYSTEM_H) -#define INCLUDED_PREFERENCESYSTEM_H - -#include "generic/constant.h" -#include "generic/callbackfwd.h" - -typedef Callback1 StringImportCallback; -typedef Callback1 StringExportCallback; - -class PreferenceSystem -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "preferences"); - - virtual void registerPreference(const char* name, const StringImportCallback& importer, const StringExportCallback& exporter) = 0; -}; - -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule GlobalPreferenceSystemModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef GlobalPreferenceSystemModuleRef; - -inline PreferenceSystem& GlobalPreferenceSystem() -{ - return GlobalPreferenceSystemModule::getTable(); -} - - -#endif diff --git a/include/qerplugin.h b/include/qerplugin.h index ea7be9e4..e7a9cd65 100644 --- a/include/qerplugin.h +++ b/include/qerplugin.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,153 +26,772 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef __QERPLUGIN_H__ #define __QERPLUGIN_H__ -#include "generic/constant.h" +/*! +\todo this header is intended to be turned into a header for the core editor functionality +some portability related code should be moved to synapse (such as the GUID stuff) +*/ +#include +#include +// TTimo +// ideally the plugin API would be UI toolkit independent, but removing the dependency with GLib seems tricky right now.. +#include +#include "qertypes.h" + +// FIXME TTimo: +// GUID declaration here should be trashed, it is in synapse.h +#ifdef _WIN32 +#include +#endif + +#define QER_MAX_NAMELEN 1024 + +#ifndef _WIN32 +#include "misc_def.h" +#endif + +// the editor will look for plugins in two places, the plugins path +// under the application path, and the path under the basepath as defined +// in the project (.qe4) file. +// +// you can drop any number of new texture, model format DLL's in the standard plugin path +// but only one plugin that overrides map loading/saving, surface dialog, surface flags, etc.. +// should be used at one time.. if multiples are loaded then the last one loaded will be the +// active one +// +// type of services the plugin supplies, pass any combo of these flags +// it is assumed the plugin will have a matching function as defined below +// to correlate to the implied functionality +// + +#define RADIANT_MAJOR "radiant" + +// basics +#define QERPLUG_INIT "QERPlug_Init" +#define QERPLUG_GETNAME "QERPlug_GetName" +#define QERPLUG_GETCOMMANDLIST "QERPlug_GetCommandList" +#define QERPLUG_DISPATCH "QERPlug_Dispatch" +#define QERPLUG_GETFUNCTABLE "QERPlug_GetFuncTable" + +// game stuff +#define QERPLUG_GETTEXTUREINFO "QERPlug_GetTextureInfo" // gets a texture info structure +#define QERPLUG_LOADTEXTURE "QERPlug_LoadTexture" // loads a texture, will return an RGBA structure + // and any surface flags/contents for it +#define QERPLUG_GETSURFACEFLAGS "QERPlug_GetSurfaceFlags" // gets a list of surface/content flag names from a plugin + +struct _QERTextureInfo +{ + char m_TextureExtension[QER_MAX_NAMELEN]; // the extension these textures have + qboolean m_bHiColor; // if textures are NOT high color, the default + // palette (as described inthe qe4 file will be used for gamma correction) + // if they are high color, gamma and shading are computed on the fly + // based on the rgba data + //--bool m_bIsShader; // will probably do q3 shaders this way when i merge + qboolean m_bWadStyle; // if this is true, the plugin will be presented with the texture path + // defined in the .qe4 file and is expected to preload all the textures + qboolean m_bHalfLife; // causes brushes to be saved/parsed without the surface contents/flags/value +}; + +struct _QERTextureLoad // returned by a plugin +{ + _QERTextureLoad() + { + memset(reinterpret_cast(this), 0, sizeof(_QERTextureLoad)); + }; + + ~_QERTextureLoad() + { + delete []m_pRGBA; + delete []m_pName; + }; + + void makeSpace(int nSize) + { + m_pRGBA = new unsigned char[nSize+1]; + }; + + void setName(const char* p) + { + m_pName = new char[strlen(p)+1]; + strcpy(m_pName, p); + }; + + + unsigned char *m_pRGBA; // rgba data (alpha channel is supported and drawn appropriately) + int m_nWidth; // width + int m_nHeight; // height + int m_nContents; // default contents + int m_nFlags; // "" flags + int m_nValue; // "" value + char *m_pName; // name to be referenced in map, build tools, etc. +}; + +struct _QERModelInfo +{ + char m_ModelExtension[QER_MAX_NAMELEN]; + bool m_bSkinned; + bool m_bMultipart; +}; + +struct _QERModelLoad +{ + // vertex and skin data +}; + + +//========================================= +// plugin functions +#if 0 +// NOTE TTimo: hack to make old plugin tech and new plugin tech live together +#ifndef _IPLUGIN_H_ +// toolkit-independant interface, cast hwndMain to GtkWidget* +typedef const char* (WINAPI *PFN_QERPLUG_INIT)(void* hApp, void* hwndMain); +typedef const char* (WINAPI *PFN_QERPLUG_GETNAME)(); +typedef const char* (WINAPI *PFN_QERPLUG_GETCOMMANDLIST)(); +typedef void (WINAPI *PFN_QERPLUG_DISPATCH)(const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush); +#endif +#endif + +typedef char* (WINAPI *PFN_QERPLUG_GETFUNCTABLE)(); + +// v1.5 +// +// Texture loading +// returns a ptr to _QERTextureInfo +typedef void* (WINAPI *PFN_QERPLUG_GETTEXTUREINFO)(); +// +// loads a texture by calling the texture load func in the editor (defined below) +// transparency (for water, fog, lava, etc.. ) can be emulated in the editor +// by passing in appropriate alpha data or by setting the appropriate surface flags +// expected by q2 (which the editor will use.. ) +typedef void (WINAPI *PFN_QERPLUG_LOADTEXTURE)(const char* pFilename); + +// v1.6 +typedef void* (WINAPI *PFN_QERPLUG_GETSURFACEFLAGS)(); + +// v1.7 +// if exists in plugin, gets called between INIT and GETCOMMANDLIST +// the plugin can register the EClasses he wants to handle +//++timo TODO: this has got to move into the table, and be requested by QERPlug_RequestInterface +//++timo FIXME: the LPVOID parameter must be casted to an IEpair interface +#define QERPLUG_REGISTERPLUGINENTITIES "QERPlug_RegisterPluginEntities" +typedef void (WINAPI * PFN_QERPLUG_REGISTERPLUGINENTITIES)( void* ); + +// if exists in plugin, gets called between INIT and GETCOMMANDLIST +// the plugin can Init all it needs for surface properties +#define QERPLUG_INITSURFACEPROPERTIES "QERPlug_InitSurfaceProperties" +typedef void (WINAPI * PFN_QERPLUG_INITSURFACEPROPERTIES)(); + +// if Radiant needs to use a particular set of commands, it can request the plugin to fill a func table +// this is similar to PFN_QERAPP_REQUESTINTERFACE +#define QERPLUG_REQUESTINTERFACE "QERPlug_RequestInterface" +typedef int (WINAPI * PFN_QERPLUG_REQUESTINTERFACE) (REFGUID refGUID, void* pInterface, const char *version_name); + +// Load an image file +typedef void (* PFN_QERAPP_LOADIMAGE) (const char *name, unsigned char **pic, int *width, int *height); + +// TTimo FIXME: the logic for this is in synapse now + +// MODULES specific: +// if it exports this entry point, will be considered as a module +// a module is a plugin that provides some REQUIRED interfaces to Radiant, such as the shader module +// Radiant will call QERPLUG_LISTINTERFACES to get a list of the interfaces a given plugin implements +// then it will call PFN_QERPLUG_REQUESTINTERFACE to actually get them + +// following leo's code .. looks ok to use a string to identify the various versions of a same interface +// obviously it would be handy to have the same string naming for the interfaces. +// best way would be to have the names come in when you list the interfaces +// NOTE: we might have a problem with the order in which the interfaces are filled in +// there's some kind of dependency graph, the shader module expects to find the VFS ready etc. +typedef struct moduleentry_s { + const GUID *interface_GUID; + const char* interface_name; + const char* version_name; +} moduleentry_t; + +#define QERPLUG_LISTINTERFACES "QERPlug_ListInterfaces" +#define MAX_QERPLUG_INTERFACES 10 +typedef int (WINAPI* PFN_QERPLUG_LISTINTERFACES) (moduleentry_t table[MAX_QERPLUG_INTERFACES]); // ======================================== // GTK+ helper functions -// NOTE: parent can be 0 in all functions but it's best to set them - -// this API does not depend on gtk+ or glib -typedef struct _GtkWidget GtkWidget; - -enum EMessageBoxType -{ - eMB_OK, - eMB_OKCANCEL, - eMB_YESNO, - eMB_YESNOCANCEL, - eMB_NOYES, -}; - -enum EMessageBoxIcon -{ - eMB_ICONDEFAULT, - eMB_ICONERROR, - eMB_ICONWARNING, - eMB_ICONQUESTION, - eMB_ICONASTERISK, -}; - -enum EMessageBoxReturn -{ - eIDOK, - eIDCANCEL, - eIDYES, - eIDNO, -}; +// NOTE: parent can be NULL in all functions but it's best to set them // simple Message Box, see above for the 'type' flags +// toolkit-independent, cast parent ot a GtkWidget* +typedef gint (WINAPI* PFN_QERAPP_MESSAGEBOX) (void *parent, const char* text, + const char* caption, guint32 type, const char *URL); -typedef EMessageBoxReturn (* PFN_QERAPP_MESSAGEBOX) (GtkWidget *parent, const char* text, const char* caption/* = "GtkRadiant"*/, EMessageBoxType type/* = eMB_OK*/, EMessageBoxIcon icon/* = eMB_ICONDEFAULT*/); - -// file and directory selection functions return null if the user hits cancel -// - 'title' is the dialog title (can be null) -// - 'path' is used to set the initial directory (can be null) +// file and directory selection functions return NULL if the user hits cancel +// or a gchar* string that must be g_free'd by the user +// - 'title' is the dialog title (can be NULL) +// - 'path' is used to set the initial directory (can be NULL) // - 'pattern': the first pattern is for the win32 mode, then comes the Gtk pattern list, see Radiant source for samples -typedef const char* (* PFN_QERAPP_FILEDIALOG) (GtkWidget *parent, bool open, const char* title, const char* path/* = 0*/, const char* pattern/* = 0*/); - -// returns a gchar* string that must be g_free'd by the user -typedef char* (* PFN_QERAPP_DIRDIALOG) (GtkWidget *parent, const char* title/* = "Choose Directory"*/, const char* path/* = 0*/); +// TTimo 04/01/2001 toolkit-independant, cast parent to a GtkWidget* +typedef const gchar* (* PFN_QERAPP_FILEDIALOG) (void *parent, gboolean open, const char* title, + const char* path, const char* pattern); +typedef gchar* (WINAPI* PFN_QERAPP_DIRDIALOG) (void *parent, const char* title, + const char* path); // return true if the user closed the dialog with 'Ok' // 'color' is used to set the initial value and store the selected value -template class BasicVector3; -typedef BasicVector3 Vector3; -typedef bool (* PFN_QERAPP_COLORDIALOG) (GtkWidget *parent, Vector3& color, - const char* title/* = "Choose Color"*/); +typedef bool (WINAPI* PFN_QERAPP_COLORDIALOG) (void *parent, float *color, + const char* title); -// load a .bmp file and create a GtkImage widget from it +// load a .bmp file and store the results in 'gdkpixmap' and 'mask' +// returns TRUE on success but even if it fails, it creates an empty pixmap // NOTE: 'filename' is relative to /plugins/bitmaps/ -typedef struct _GtkImage GtkImage; -typedef GtkImage* (* PFN_QERAPP_NEWIMAGE) (const char* filename); +// TTimo 04/01/2001 toolkit-independant, cast gkpixmap to GdkPixmap and mask to GdkBitmap +typedef bool (WINAPI* PFN_QERAPP_LOADBITMAP) (const char* filename, void **gdkpixmap, void **mask); // ======================================== +// read/write preferences file -namespace scene +// use this function to get the directory where the preferences file are stored +typedef const char* (WINAPI* PFN_QERAPP_PROFILE_GETDIR) (); + +// 'filename' is the absolute path +typedef bool (WINAPI* PFN_QERAPP_PROFILE_SAVEINT) (const char *filename, const char *section, + const char *key, int value); +typedef bool (WINAPI* PFN_QERAPP_PROFILE_SAVESTR) (const char *filename, const char *section, + const char *key, const char *value); +typedef int (WINAPI* PFN_QERAPP_PROFILE_LOADINT) (const char *filename, const char *section, + const char *key, int default_value); +typedef char* (WINAPI* PFN_QERAPP_PROFILE_LOADSTR) (const char *filename, const char *section, + const char *key, const char *default_value); + +//========================================= +// editor functions + +// There are 3 potential brush handle lists +// 1. the list that contains brushes a plugin creates using CreateBrushHandle +// 2. the selected brush list (brushes the user has selected) +// 3. the active brush list (brushes in the map that are not selected) +// +// In general, the same things can be done to brush handles (face manip, delete brushhandle, etc.. ) in each +// list. There are a few exceptions. +// 1. You cannot commit a selected or active brush handle to the map. This is because it is already in the map. +// 2. You cannot bind brush handles from the selected or active brush list to an entity. As of v1.0 of the plugins +// the only way for a plugin to create entities is to create a brush handles (or a list of handles) and then bind +// them to an entity. This will commit the brush(s) and/or the entities to the map as well. +// +// To use the active or selected brush lists, you must first allocate them (which returns a count) and then +// release them when you are finish manipulating brushes in one of those lists. + +//++timo NOTE : the #defines here are never used, but can help finding where things are done in the editor +#if 0 +// brush manipulation routines +#define QERAPP_CREATEBRUSH "QERApp_CreateBrush" +#define QERAPP_CREATEBRUSHHANDLE "QERApp_CreateBrushHandle" +#define QERAPP_DELETEBRUSHHANDLE "QERApp_DeleteBrushHandle" +#define QERAPP_COMMITBRUSHHANDLETOMAP "QERApp_CommitBrushHandleToMap" +//++timo not implemented .. remove +// #define QERAPP_BINDHANDLESTOENTITY "QERApp_BindHandlesToEntity" +#define QERAPP_ADDFACE "QERApp_AddFace" +#define QERAPP_ADDFACEDATA "QERApp_AddFaceData" +#define QERAPP_GETFACECOUNT "QERApp_GetFaceCount" +#define QERAPP_GETFACEDATA "QERApp_GetFaceData" +#define QERAPP_SETFACEDATA "QERApp_SetFaceData" +#define QERAPP_DELETEFACE "QERApp_DeleteFace" +#define QERAPP_TEXTUREBRUSH "QERApp_TextureBrush" +#define QERAPP_BUILDBRUSH "QERApp_BuildBrush" // PGM +#define QERAPP_SELECTEDBRUSHCOUNT "QERApp_SelectedBrushCount" +#define QERAPP_ALLOCATESELECTEDBRUSHHANDLES "QERApp_AllocateSelectedBrushHandles" +#define QERAPP_RELEASESELECTEDBRUSHHANDLES "QERApp_ReleaseSelectedBrushHandles" +#define QERAPP_GETSELECTEDBRUSHHANDLE "QERApp_GetSelectedBrushHandle" +#define QERAPP_ACTIVEBRUSHCOUNT "QERApp_ActiveBrushCount" +#define QERAPP_ALLOCATEACTIVEBRUSHHANDLES "QERApp_AllocateActiveBrushHandles" +#define QERAPP_RELEASEACTIVEBRUSHHANDLES "QERApp_ReleaseActiveBrushHandles" +#define QERAPP_GETACTIVEBRUSHHANDLE "QERApp_GetActiveBrushHandle" + +// texture stuff +#define QERAPP_TEXTURECOUNT "QERApp_TextureCount" +#define QERAPP_GETTEXTURE "QERApp_GetTexture" +#define QERAPP_GETCURRENTTEXTURE "QERApp_GetCurrentTexture" +#define QERAPP_SETCURRENTTEXTURE "QERApp_SetCurrentTexture" + +// selection +#define QERAPP_DELETESELECTION "QERApp_DeleteSelection" +#define QERAPP_SELECTBRUSH "QERApp_SelectBrush" // PGM +#define QERAPP_DESELECTBRUSH "QERApp_DeselectBrush" // PGM +#define QERAPP_DESELECTALLBRUSHES "QERApp_DeselectAllBrushes" // PGM + +// data gathering +#define QERAPP_GETPOINTS "QERApp_GetPoints" +#define QERAPP_SELECTBRUSHES "QERApp_GetBrushes" + +// entity class stuff +// the entity handling is very basic for 1.0 +#define QERAPP_GETECLASSCOUNT "QERApp_GetEClassCount" +#define QERAPP_GETECLASS "QERApp_GetEClass" + +// misc +#define QERAPP_SYSMSG "QERApp_SysMsg" +#define QERAPP_INFOMSG "QERApp_InfoMsg" +#define QERAPP_HIDEINFOMSG "QERApp_HideInfoMsg" +#define QERAPP_RESET_PLUGINS "QERApp_ResetPlugins" + +// texture loading +#define QERAPP_LOADTEXTURERGBA "QERApp_LoadTextureRGBA" + +// FIXME: the following are not implemented yet +// hook registrations +#define QERAPP_REGISTER_MAPLOADFUNC "QERApp_Register_MapLoadFunc" +#define QERAPP_REGISTER_MAPSAVEFUNC "QERApp_Register_MapSaveFunc" + +// FIXME: the following are not implemented yet +#define QERAPP_REGISTER_PROJECTLOADFUNC "QERApp_Register_ProjectLoadFunc" +#define QERAPP_REGISTER_MOUSEHANDLER "QERApp_Register_MouseHandler" +#define QERAPP_REGISTER_KEYHANDLER "QERApp_Register_KeyHandler" + +// FIXME: new primtives do not work in v1.00 +// primitives are new types of things in the map +// for instance, the Q3 curves could have been done as +// primitives instead of being built in +// it will be a plugins responsibility to hook the map load and save funcs to load +// and/or save any additional data (like new primitives of some type) +// the editor will call each registered renderer during the rendering process to repaint +// any primitives the plugin owns +// each primitive object has a temporary sibling brush that lives in the map +// FIXME: go backwards on this a bit.. orient it more towards the temp brush mode as it will be cleaner +// basically a plugin will hook the map load and save and will add the primitives to the map.. this will +// produce a temporary 'primitive' brush and the appropriate renderer will be called as well as the +// edit handler (for edge drags, sizes, rotates, etc.. ) and the vertex maker will be called when vertex +// mode is attemped on the brush.. there will need to be a GetPrimitiveBounds callback in the edit handler +// so the brush can resize appropriately as needed.. this might be the plugins responsibility to set the +// sibling brushes size.. it will then be the plugins responsibility to hook map save to save the primitives +// as the editor will discard any temp primitive brushes.. (there probably needs to be some kind of sanity check +// here as far as keeping the brushes and the plugin in sync.. i suppose the edit handler can deal with all of that +// crap but it looks like a nice place for a mess) +#define QERAPP_REGISTER_PRIMITIVE "QERApp_Register_Primitive" +#define QERAPP_REGISTER_RENDERER "QERApp_Register_Renderer" +#define QERAPP_REGISTER_EDITHANDLER "QERApp_Register_EditHandler" +#define QERAPP_REGISTER_VERTEXMAKER "QERApp_Register_VertexMaker" +#define QERAPP_ADDPRIMITIVE "QERApp_AddPrimitive" + +// v1.70 +#define QERAPP_GETENTITYCOUNT "QERApp_GetEntityCount" +#define QERAPP_GETENTITYHANDLE "QERApp_GetEntityHandle" +//++timo not implemented for the moment +// #define QERAPP_GETENTITYINFO "QERApp_GetEntityInfo" +//++timo does the keyval need some more funcs to add/remove ? +// get the pointer and do the changes yourself +#define QERAPP_ALLOCATEEPAIR "QERApp_AllocateEpair" +#define QERAPP_ALLOCATEENTITYBRUSHHANDLES "QERApp_AllocateEntityBrushHandles" +#define QERAPP_RELEASEENTITYBRUSHHANDLES "QERApp_ReleaseEntityBrushHandles" +#define QERAPP_GETENTITYBRUSHHANDLE "QERApp_GetEntityBrushHandle" +#define QERAPP_CREATEENTITYHANDLE "QERApp_CreateEntityHandle" +#define QERAPP_COMMITBRUSHHANDLETOENTITY "QERApp_CommitBrushHandleToEntity" +#define QERAPP_COMMITENTITYHANDLETOMAP "QERApp_CommitEntityHandleToMap" +#define QERAPP_SETSCREENUPDATE "QERApp_SetScreenUpdate" +#define QERAPP_BUILDBRUSH2 "QERApp_BuildBrush2" +#endif + +// v1.80 +#define QERAPP_GETDISPATCHPARAMS "QERApp_GetDispatchParams" + +struct _QERPointData { - class Node; -} - -class ModuleObserver; - -#include "signal/signalfwd.h" -#include "windowobserver.h" -#include "generic/vector.h" - -typedef SignalHandler3 MouseEventHandler; -typedef SignalFwd::handler_id_type MouseEventHandlerId; - -enum VIEWTYPE -{ - YZ = 0, - XZ = 1, - XY = 2 + int m_nCount; + vec3_t *m_pVectors; }; -// the radiant core API +struct _QERFaceData +{ + char m_TextureName[QER_MAX_NAMELEN]; + int m_nContents; + int m_nFlags; + int m_nValue; + float m_fShift[2]; + float m_fRotate; + float m_fScale[2]; + vec3_t m_v1, m_v2, m_v3; + // brush primitive additions + qboolean m_bBPrimit; + brushprimit_texdef_t brushprimit_texdef; +}; + +typedef void (WINAPI * PFN_QERAPP_CREATEBRUSH)(vec3_t vMin, vec3_t vMax); + +typedef void* (WINAPI * PFN_QERAPP_CREATEBRUSHHANDLE)(); +typedef void (WINAPI * PFN_QERAPP_DELETEBRUSHHANDLE)(void* pv); +typedef void (WINAPI * PFN_QERAPP_COMMITBRUSHHANDLETOMAP)(void* pv); +typedef void (WINAPI * PFN_QERAPP_ADDFACE)(void* pv, vec3_t v1, vec3_t v2, vec3_t v3); + +typedef void (WINAPI * PFN_QERAPP_ADDFACEDATA)(void* pv, _QERFaceData *pData); +typedef int (WINAPI * PFN_QERAPP_GETFACECOUNT)(void* pv); +typedef _QERFaceData* (WINAPI * PFN_QERAPP_GETFACEDATA)(void* pv, int nFaceIndex); +typedef void (WINAPI * PFN_QERAPP_SETFACEDATA)(void* pv, int nFaceIndex, _QERFaceData *pData); +typedef void (WINAPI * PFN_QERAPP_DELETEFACE)(void* pv, int nFaceIndex); +typedef void (WINAPI * PFN_QERAPP_TEXTUREBRUSH)(void* pv, char* pName); +typedef void (WINAPI * PFN_QERAPP_BUILDBRUSH)(void* pv); // PGM +typedef void (WINAPI * PFN_QERAPP_SELECTBRUSH)(void* pv); // PGM +typedef void (WINAPI * PFN_QERAPP_DESELECTBRUSH)(void* pv); // PGM +typedef void (WINAPI * PFN_QERAPP_DESELECTALLBRUSHES)(); // PGM + +typedef void (WINAPI * PFN_QERAPP_DELETESELECTION)(); +typedef void (WINAPI * PFN_QERAPP_GETPOINTS)(int nMax, _QERPointData *pData, char* pMsg); + +typedef int (WINAPI * PFN_QERAPP_SELECTEDBRUSHCOUNT)(); +typedef int (WINAPI * PFN_QERAPP_ALLOCATESELECTEDBRUSHHANDLES)(); +typedef void (WINAPI * PFN_QERAPP_RELEASESELECTEDBRUSHHANDLES)(); +typedef void* (WINAPI * PFN_QERAPP_GETSELECTEDBRUSHHANDLE)(int nIndex); + +typedef int (WINAPI * PFN_QERAPP_ACTIVEBRUSHCOUNT)(); +typedef int (WINAPI * PFN_QERAPP_ALLOCATEACTIVEBRUSHHANDLES)(); +typedef void (WINAPI * PFN_QERAPP_RELEASEACTIVEBRUSHHANDLES)(); +typedef void* (WINAPI * PFN_QERAPP_GETACTIVEBRUSHHANDLE)(int nIndex); + +typedef int (WINAPI * PFN_QERAPP_TEXTURECOUNT)(); +typedef char* (WINAPI * PFN_QERAPP_GETTEXTURE)(int nIndex); +typedef char* (WINAPI * PFN_QERAPP_GETCURRENTTEXTURE)(); +typedef void (WINAPI * PFN_QERAPP_SETCURRENTTEXTURE)(char* pName); + +typedef void (WINAPI * PFN_QERAPP_REGISTERMAPLOAD)(void* vp); +typedef void (WINAPI * PFN_QERAPP_REGISTERMAPSAVE)(void* vp); + +typedef int (WINAPI * PFN_QERAPP_GETECLASSCOUNT)(); +typedef char* (WINAPI * PFN_QERAPP_GETECLASS)(int nIndex); + +typedef void (WINAPI * PFN_QERAPP_RESETPLUGINS)(); +//--typedef int (WINAPI* PFN_QERAPP_GETENTITYCOUNT)(); + +/*! +\fn LoadTextureRGBA +\param pPixels is the raw RGBA pixel data (24bits, 8 bit depth) +\param nWidth image width +\param nHeight image height +this will work from the RGBA data and create a GL texture (accessed through a GL bind number) +it takes care of creating the mipmapping levels too +see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=575 for some related issues +*/ +typedef qtexture_t* (* PFN_QERAPP_LOADTEXTURERGBA)(unsigned char* pPixels, int nWidth, int nHeight); + +//--typedef LPCSTR (WINAPI* PFN_QERAPP_GETENTITY)(int nIndex); + +// v1.70 +typedef int (WINAPI * PFN_QERAPP_GETENTITYCOUNT)(); +typedef void* (WINAPI * PFN_QERAPP_GETENTITYHANDLE)(int nIndex); +// FIXME: those two are fairly outdated, you get the epairs +// but you don't have a clean epair read/write query +// and you rely on the C structs directly, which might go away soon +// ok now, stop using, it's bad for your karma (see iepairs.h instead) +typedef epair_t* (WINAPI * PFN_QERAPP_ALLOCATEEPAIR)( char*, char* ); +typedef int (WINAPI * PFN_QERAPP_ALLOCATEENTITYBRUSHHANDLES)(void* vp); +typedef void (WINAPI * PFN_QERAPP_RELEASEENTITYBRUSHHANDLES)(); +typedef void* (WINAPI * PFN_QERAPP_GETENTITYBRUSHHANDLE)(int nIndex); +typedef void* (WINAPI * PFN_QERAPP_CREATEENTITYHANDLE)(); +typedef void (WINAPI * PFN_QERAPP_COMMITBRUSHHANDLETOENTITY)( void* vpBrush, void* vpEntity); +typedef void (WINAPI * PFN_QERAPP_COMMITENTITYHANDLETOMAP)(void* vp); +typedef void (WINAPI * PFN_QERAPP_SETSCREENUPDATE)(int bScreenUpdate); +// this one uses window flags defined in qertypes.h +typedef void (WINAPI * PFN_QERAPP_SYSUPDATEWINDOWS)(int bits); +//++timo remove this one +typedef void (WINAPI * PFN_QERAPP_BUILDBRUSH2)(void* vp, int bConvert); + +// v1.80 +typedef void (WINAPI * PFN_QERAPP_GETDISPATCHPARAMS)(vec3_t vMin, vec3_t vMax, bool *bSingleBrush); + +typedef int (WINAPI * PFN_QERAPP_REQUESTINTERFACE)( REFGUID, void* ); +// use this one for errors, Radiant will stop after the "edit preferences" dialog +typedef void (WINAPI * PFN_QERAPP_ERROR)(char* pMsg, ...); +// use to gain read access to the project epairs +// FIXME: removed, accessed through QERPlug_RegisterPluginEntities with the IEpair interface +// typedef void (WINAPI* PFN_QERAPP_GETPROJECTEPAIR)(epair_t **); +// used to allocate and read a buffer +//++timo NOTE: perhaps this would need moving to some kind of dedicated interface +typedef int (WINAPI * PFN_QERAPP_LOADFILE)(const char *pLocation, void ** buffer); +typedef char* (WINAPI * PFN_QERAPP_EXPANDRELETIVEPATH)(char *); +typedef void (WINAPI * PFN_QERAPP_QECONVERTDOSTOUNIXNAME)( char *dst, const char *src ); +typedef int (WINAPI * PFN_QERAPP_HASSHADER)(const char *); +typedef int (WINAPI * PFN_QERAPP_TEXTURELOADSKIN)(char *pName, int *pnWidth, int *pnHeight); +// retrieves the path to the engine from the preferences dialog box +typedef const char* (WINAPI * PFN_QERAPP_GETGAMEPATH)(); +// retrieves full Radiant path +typedef const char* (WINAPI * PFN_QERAPP_GETQERPATH)(); +// retieves .game name of current active game +typedef const char* (WINAPI * PFN_QERAPP_GETGAMEFILE)(); + +// patches in/out +// NOTE: this is a bit different from the brushes in/out, no LPVOID handles this time +// use int indexes instead +// if you call AllocateActivePatchHandles, you'll be playing with active patches +// AllocateSelectedPatcheHandles for selected stuff +// a call to CreatePatchHandle will move you to a seperate index table +typedef int (WINAPI * PFN_QERAPP_ALLOCATEACTIVEPATCHHANDLES) (); +typedef int (WINAPI * PFN_QERAPP_ALLOCATESELECTEDPATCHHANDLES) (); +typedef void (WINAPI * PFN_QERAPP_RELEASEPATCHHANDLES) (); +typedef patchMesh_t* (WINAPI * PFN_QERAPP_GETPATCHDATA) (int); +typedef patchMesh_t* (WINAPI * PFN_QERAPP_GETPATCHHANDLE) (int); +typedef void (WINAPI * PFN_QERAPP_DELETEPATCH) (int); +typedef int (WINAPI * PFN_QERAPP_CREATEPATCHHANDLE) (); +// when commiting, only a few patchMesh_t members are relevant: +// int width, height; // in control points, not patches +// int contents, flags, value, type; +// drawVert_t ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT]; +// once you have commited the index is still available, if the patch handle was allocated by you +// then you can re-use the index to commit other patches .. otherwise you can change existing patches +// NOTE: the handle thing for plugin-allocated patches is a bit silly (nobody's perfect) +// TODO: change current behaviour to an index = 0 to tell Radiant to allocate, other indexes to existing patches +// patch is selected after a commit +// you can add an optional texture / shader name .. if NULL will use the current texture +typedef void (WINAPI * PFN_QERAPP_COMMITPATCHHANDLETOMAP) (int, patchMesh_t* pMesh, char *texName); +typedef void (WINAPI * PFN_QERAPP_COMMITPATCHHANDLETOENTITY) (int, patchMesh_t* pMesh, char *texName, void* vpEntity); + +// console output +#define SYS_VRB 0 ///< verbose support (on/off) +#define SYS_STD 1 ///< standard print level - this is the default +#define SYS_WRN 2 ///< warnings +#define SYS_ERR 3 ///< error +#define SYS_NOCON 4 ///< no console, only print to the file (useful whenever Sys_Printf and output IS the problem) +typedef void (WINAPI* PFN_QERAPP_SYSPRINTF) (const char *text, ...); +typedef void (WINAPI* PFN_QERAPP_SYSFPRINTF) (int flag, const char *text, ...); + +typedef void (WINAPI* PFN_QERAPP_SYSBEGINWAIT) (); +typedef void (WINAPI* PFN_QERAPP_SYSENDWAIT) (); + +typedef void (* PFN_QERAPP_SYSBEEP) (); + +typedef void (* PFN_QERAPP_SYSSTATUS) (const char *psz, int part ); + +// core map functionality +typedef void (* PFN_QERAPP_MAPNEW) (); +typedef void (* PFN_QERAPP_MAPFREE) (); +typedef void (* PFN_QERAPP_MAPBUILDBRUSHDATA) (); +typedef qboolean (* PFN_QERAPP_MAPISBRUSHFILTERED) (brush_t *); +typedef void (* PFN_QERAPP_MAPSTARTPOSITION) (); +typedef void (* PFN_QERAPP_MAPREGIONOFF) (); +//typedef void (* PFN_QERAPP_SAVEASDIALOG) (bool bRegion); +typedef void (* PFN_QERAPP_SETBUILDWINDINGSNOTEXBUILD) (bool); +typedef void (* PFN_QERAPP_POINTFILECLEAR) (); + +typedef void (* PFN_QERAPP_SYSSETTITLE) (const char *text); + +typedef void (* PFN_QERAPP_CSGMAKEHOLLOW) (); + +typedef void (* PFN_QERAPP_REGIONSPAWNPOINT) (FILE *f); + +/*! +access to a portable GetTickCount +*/ +typedef unsigned long (* PFN_QERAPP_GETTICKCOUNT) (); + +class IModelCache +{ +public: + virtual ~IModelCache() { } + virtual entity_interfaces_t *GetByID(const char *id, const char* version) = 0; + virtual void DeleteByID(const char *id, const char* version) = 0; + virtual void RefreshAll() = 0; +}; + +typedef IModelCache* (* PFN_GETMODELCACHE)(); + +class IFileTypeList +{ +public: + virtual ~IFileTypeList() { } + virtual void addType(filetype_t type) = 0; +}; + +class IFileTypeRegistry +{ +public: + virtual ~IFileTypeRegistry() { } + virtual void addType(const char* key, filetype_t type) = 0; + virtual void getTypeList(const char* key, IFileTypeList* typelist) = 0; +private: +}; + +typedef IFileTypeRegistry* (* PFN_GETFILETYPEREGISTRY)(); + +typedef const char* (* PFN_QERAPP_READPROJECTKEY)(const char* key); + +typedef char* (* PFN_GETMAPFILENAME)(); + +typedef bfilter_t* (* PFN_QERPLUG_FILTERADD)(int type, int bmask, char *str, int exclude); + +typedef void (* PFN_QERPLUG_FILTERACTIVATE) (void); + + // FIXME: +// add map format extensions +// add texture format handlers +// add surface dialog handler +// add model handler/displayer + +// v1 func table +// Plugins need to declare one of these and implement the getfunctable as described above struct _QERFuncTable_1 { - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "radiant"); + int m_nSize; + PFN_QERAPP_CREATEBRUSH m_pfnCreateBrush; + PFN_QERAPP_CREATEBRUSHHANDLE m_pfnCreateBrushHandle; + PFN_QERAPP_DELETEBRUSHHANDLE m_pfnDeleteBrushHandle; + PFN_QERAPP_COMMITBRUSHHANDLETOMAP m_pfnCommitBrushHandle; + PFN_QERAPP_ADDFACE m_pfnAddFace; + PFN_QERAPP_ADDFACEDATA m_pfnAddFaceData; + PFN_QERAPP_GETFACEDATA m_pfnGetFaceData; + PFN_QERAPP_GETFACECOUNT m_pfnGetFaceCount; + PFN_QERAPP_SETFACEDATA m_pfnSetFaceData; + PFN_QERAPP_DELETEFACE m_pfnDeleteFace; + PFN_QERAPP_TEXTUREBRUSH m_pfnTextureBrush; + PFN_QERAPP_BUILDBRUSH m_pfnBuildBrush; // PGM + PFN_QERAPP_SELECTBRUSH m_pfnSelectBrush; // PGM + PFN_QERAPP_DESELECTBRUSH m_pfnDeselectBrush; // PGM + PFN_QERAPP_DESELECTALLBRUSHES m_pfnDeselectAllBrushes; // PGM - const char* (*getEnginePath)(); - const char* (*getLocalRcPath)(); - const char* (*getGameToolsPath)(); - const char* (*getAppPath)(); - const char* (*getSettingsPath)(); - const char* (*getMapsPath)(); + PFN_QERAPP_DELETESELECTION m_pfnDeleteSelection; + PFN_QERAPP_GETPOINTS m_pfnGetPoints; - const char* (*getGameName)(); - const char* (*getGameMode)(); + PFN_QERAPP_SELECTEDBRUSHCOUNT m_pfnSelectedBrushCount; + PFN_QERAPP_ALLOCATESELECTEDBRUSHHANDLES m_pfnAllocateSelectedBrushHandles; + PFN_QERAPP_RELEASESELECTEDBRUSHHANDLES m_pfnReleaseSelectedBrushHandles; + PFN_QERAPP_GETSELECTEDBRUSHHANDLE m_pfnGetSelectedBrushHandle; - const char* (*getMapName)(); - scene::Node& (*getMapWorldEntity)(); - float (*getGridSize)(); + PFN_QERAPP_ACTIVEBRUSHCOUNT m_pfnActiveBrushCount; + PFN_QERAPP_ALLOCATEACTIVEBRUSHHANDLES m_pfnAllocateActiveBrushHandles; + PFN_QERAPP_RELEASEACTIVEBRUSHHANDLES m_pfnReleaseActiveBrushHandles; + PFN_QERAPP_GETACTIVEBRUSHHANDLE m_pfnGetActiveBrushHandle; - const char* (*getGameDescriptionKeyValue)(const char* key); - const char* (*getRequiredGameDescriptionKeyValue)(const char* key); + //++timo this would need to be removed and replaced by the IShaders interface + PFN_QERAPP_TEXTURECOUNT m_pfnTextureCount; + PFN_QERAPP_GETTEXTURE m_pfnGetTexture; + PFN_QERAPP_GETCURRENTTEXTURE m_pfnGetCurrentTexture; + PFN_QERAPP_SETCURRENTTEXTURE m_pfnSetCurrentTexture; - void (*attachGameToolsPathObserver)(ModuleObserver& observer); - void (*detachGameToolsPathObserver)(ModuleObserver& observer); - void (*attachEnginePathObserver)(ModuleObserver& observer); - void (*detachEnginePathObserver)(ModuleObserver& observer); - void (*attachGameNameObserver)(ModuleObserver& observer); - void (*detachGameNameObserver)(ModuleObserver& observer); - void (*attachGameModeObserver)(ModuleObserver& observer); - void (*detachGameModeObserver)(ModuleObserver& observer); + PFN_QERAPP_GETECLASSCOUNT m_pfnGetEClassCount; + PFN_QERAPP_GETECLASS m_pfnGetEClass; + PFN_QERAPP_RESETPLUGINS m_pfnResetPlugins; + // v1.00 ends here + // v1.50 starts here + PFN_QERAPP_LOADTEXTURERGBA m_pfnLoadTextureRGBA; + // v1.50 ends here + // v1.70 starts here + PFN_QERAPP_GETENTITYCOUNT m_pfnGetEntityCount; + PFN_QERAPP_GETENTITYHANDLE m_pfnGetEntityHandle; + PFN_QERAPP_ALLOCATEENTITYBRUSHHANDLES m_pfnAllocateEntityBrushHandles; + PFN_QERAPP_RELEASEENTITYBRUSHHANDLES m_pfnReleaseEntityBrushHandles; + PFN_QERAPP_GETENTITYBRUSHHANDLE m_pfnGetEntityBrushHandle; + PFN_QERAPP_CREATEENTITYHANDLE m_pfnCreateEntityHandle; + PFN_QERAPP_COMMITBRUSHHANDLETOENTITY m_pfnCommitBrushHandleToEntity; + PFN_QERAPP_COMMITENTITYHANDLETOMAP m_pfnCommitEntityHandleToMap; + PFN_QERAPP_ALLOCATEEPAIR m_pfnAllocateEpair; + PFN_QERAPP_SETSCREENUPDATE m_pfnSetScreenUpdate; + PFN_QERAPP_BUILDBRUSH2 m_pfnBuildBrush2; + // v1.70 ends here + // v1.80 starts here + PFN_QERAPP_GETDISPATCHPARAMS m_pfnGetDispatchParams; - SignalHandlerId (*XYWindowDestroyed_connect)(const SignalHandler& handler); - void (*XYWindowDestroyed_disconnect)(SignalHandlerId id); - MouseEventHandlerId (*XYWindowMouseDown_connect)(const MouseEventHandler& handler); - void (*XYWindowMouseDown_disconnect)(MouseEventHandlerId id); - VIEWTYPE (*XYWindow_getViewType)(); - Vector3 (*XYWindow_windowToWorld)(const WindowVector& position); - const char* (*TextureBrowser_getSelectedShader)(); + // plugins can request additional interfaces + PFN_QERAPP_REQUESTINTERFACE m_pfnRequestInterface; + PFN_QERAPP_ERROR m_pfnError; + // loading a file into a buffer + PFN_QERAPP_LOADFILE m_pfnLoadFile; + PFN_QERAPP_EXPANDRELETIVEPATH m_pfnExpandReletivePath; + PFN_QERAPP_QECONVERTDOSTOUNIXNAME m_pfnQE_ConvertDOSToUnixName; + PFN_QERAPP_HASSHADER m_pfnHasShader; + PFN_QERAPP_TEXTURELOADSKIN m_pfnTexture_LoadSkin; + PFN_QERAPP_GETGAMEPATH m_pfnGetGamePath; + PFN_QERAPP_GETQERPATH m_pfnGetQERPath; + PFN_QERAPP_GETGAMEFILE m_pfnGetGameFile; + // patches in / out + PFN_QERAPP_ALLOCATEACTIVEPATCHHANDLES m_pfnAllocateActivePatchHandles; + PFN_QERAPP_ALLOCATESELECTEDPATCHHANDLES m_pfnAllocateSelectedPatchHandles; + PFN_QERAPP_RELEASEPATCHHANDLES m_pfnReleasePatchHandles; + PFN_QERAPP_GETPATCHDATA m_pfnGetPatchData; + PFN_QERAPP_GETPATCHHANDLE m_pfnGetPatchHandle; + PFN_QERAPP_DELETEPATCH m_pfnDeletePatch; + PFN_QERAPP_CREATEPATCHHANDLE m_pfnCreatePatchHandle; + PFN_QERAPP_COMMITPATCHHANDLETOMAP m_pfnCommitPatchHandleToMap; + PFN_QERAPP_COMMITPATCHHANDLETOENTITY m_pfnCommitPatchHandleToEntity; + + PFN_QERAPP_LOADIMAGE m_pfnLoadImage; // GTK+ functions PFN_QERAPP_MESSAGEBOX m_pfnMessageBox; PFN_QERAPP_FILEDIALOG m_pfnFileDialog; PFN_QERAPP_DIRDIALOG m_pfnDirDialog; PFN_QERAPP_COLORDIALOG m_pfnColorDialog; - PFN_QERAPP_NEWIMAGE m_pfnNewImage; + PFN_QERAPP_LOADBITMAP m_pfnLoadBitmap; + // Profile functions + PFN_QERAPP_PROFILE_GETDIR m_pfnProfileGetDirectory; + PFN_QERAPP_PROFILE_SAVEINT m_pfnProfileSaveInt; + PFN_QERAPP_PROFILE_SAVESTR m_pfnProfileSaveString; + PFN_QERAPP_PROFILE_LOADINT m_pfnProfileLoadInt; + PFN_QERAPP_PROFILE_LOADSTR m_pfnProfileLoadString; + + // Sys_ functions + PFN_QERAPP_SYSUPDATEWINDOWS m_pfnSysUpdateWindows; + PFN_QERAPP_SYSBEEP m_pfnSysBeep; + PFN_QERAPP_SYSPRINTF m_pfnSysPrintf; + PFN_QERAPP_SYSFPRINTF m_pfnSysFPrintf; + PFN_QERAPP_SYSBEGINWAIT m_pfnSysBeginWait; + PFN_QERAPP_SYSENDWAIT m_pfnSysEndWait; + PFN_QERAPP_SYSSETTITLE m_pfnSys_SetTitle; + PFN_QERAPP_SYSSTATUS m_pfnSys_Status; + + // some core functionality on the map + PFN_QERAPP_MAPNEW m_pfnMapNew; + PFN_QERAPP_MAPFREE m_pfnMapFree; + PFN_QERAPP_MAPBUILDBRUSHDATA m_pfnMapBuildBrushData; + PFN_QERAPP_MAPISBRUSHFILTERED m_pfnMap_IsBrushFiltered; + PFN_QERAPP_MAPSTARTPOSITION m_pfnMapStartPosition; + PFN_QERAPP_MAPREGIONOFF m_pfnMapRegionOff; + PFN_QERAPP_SETBUILDWINDINGSNOTEXBUILD m_pfnSetBuildWindingsNoTexBuild; +// PFN_QERAPP_SAVEASDIALOG m_pfnSaveAsDialog; + PFN_QERAPP_POINTFILECLEAR m_pfnPointFileClear; + + // FIXME TTimo prolly want to move that somewhere else + PFN_QERAPP_CSGMAKEHOLLOW m_pfnCSG_MakeHollow; + + PFN_QERAPP_REGIONSPAWNPOINT m_pfnRegionSpawnPoint; + PFN_QERAPP_GETTICKCOUNT m_pfnQGetTickCount; + PFN_GETMODELCACHE m_pfnGetModelCache; + PFN_GETFILETYPEREGISTRY m_pfnGetFileTypeRegistry; + + PFN_QERAPP_READPROJECTKEY m_pfnReadProjectKey; + + PFN_QERPLUG_FILTERACTIVATE m_pfnFiltersActivate; + PFN_QERPLUG_FILTERADD m_pfnFilterAdd; + + // digibob from the old _QERAppBSPFrontendTable table + PFN_GETMAPFILENAME m_pfnGetMapName; }; -#include "modulesystem.h" - -template -class GlobalModule; -typedef GlobalModule<_QERFuncTable_1> GlobalRadiantModule; - -template -class GlobalModuleRef; -typedef GlobalModuleRef<_QERFuncTable_1> GlobalRadiantModuleRef; - -inline _QERFuncTable_1& GlobalRadiant() -{ - return GlobalRadiantModule::getTable(); -} +// macros to access those faster in plugins +#ifdef USE_QERTABLE_DEFINE +#ifndef __QERTABLENAME +#define __QERTABLENAME g_FuncTable +#endif +#define CSG_MakeHollow __QERTABLENAME.m_pfnCSG_MakeHollow +#define Sys_Beep __QERTABLENAME.m_pfnSysBeep +#define Sys_Printf __QERTABLENAME.m_pfnSysPrintf +#define Sys_FPrintf __QERTABLENAME.m_pfnSysFPrintf +#define Sys_BeginWait __QERTABLENAME.m_pfnSysBeginWait +#define Sys_EndWait __QERTABLENAME.m_pfnSysEndWait +#define Sys_UpdateWindows __QERTABLENAME.m_pfnSysUpdateWindows +#define Sys_SetTitle __QERTABLENAME.m_pfnSys_SetTitle +#define Sys_Status __QERTABLENAME.m_pfnSys_Status +#define Select_Deselect __QERTABLENAME.m_pfnDeselectAllBrushes +#define Map_New __QERTABLENAME.m_pfnMapNew +#define Map_Free __QERTABLENAME.m_pfnMapFree +#define Map_IsBrushFiltered __QERTABLENAME.m_pfnMap_IsBrushFiltered +#define Map_BuildBrushData __QERTABLENAME.m_pfnMapBuildBrushData +#define Map_StartPosition __QERTABLENAME.m_pfnMapStartPosition +#define Map_RegionOff __QERTABLENAME.m_pfnMapRegionOff +#define QE_ConvertDOSToUnixName __QERTABLENAME.m_pfnQE_ConvertDOSToUnixName +#define SetBuildWindingsNoTexBuild __QERTABLENAME.m_pfnSetBuildWindingsNoTexBuild +//#define SaveAsDialog __QERTABLENAME.m_pfnSaveAsDialog +#define Pointfile_Clear __QERTABLENAME.m_pfnPointFileClear +#define SetScreenUpdate __QERTABLENAME.m_pfnSetScreenUpdate +#define Region_SpawnPoint __QERTABLENAME.m_pfnRegionSpawnPoint +#define QGetTickCount __QERTABLENAME.m_pfnGetTickCount +#define GetModelCache __QERTABLENAME.m_pfnGetModelCache +#define GetFileTypeRegistry __QERTABLENAME.m_pfnGetFileTypeRegistry +#else +IFileTypeRegistry* GetFileTypeRegistry(); +#endif #endif diff --git a/include/qertypes.h b/include/qertypes.h new file mode 100644 index 00000000..a3b8caac --- /dev/null +++ b/include/qertypes.h @@ -0,0 +1,913 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// qertypes.h +// +// common types +// merged from brush.h, etc. for plugin support +// +#ifndef _QERTYPES_H_ +#define _QERTYPES_H_ + +#ifdef _WIN32 +#include +#endif + +#include + +#include "str.h" + +#ifdef _WIN32 +#define PATH_MAX 260 +#endif + +// HACK glib-2.0 +#define NAME_MAX 255 + +typedef bool qboolean; + +#define MAXPOINTS 16 + +// merged from qedefs.h ------ + +#define MAX_EDGES 512 +#define MAX_POINTS 1024 + +#define COLOR_TEXTUREBACK 0 +#define COLOR_GRIDBACK 1 +#define COLOR_GRIDMINOR 2 +#define COLOR_GRIDMAJOR 3 +#define COLOR_CAMERABACK 4 +#define COLOR_ENTITY 5 +#define COLOR_GRIDBLOCK 6 +#define COLOR_GRIDTEXT 7 +#define COLOR_BRUSHES 8 +#define COLOR_SELBRUSHES 9 +#define COLOR_CLIPPER 10 +#define COLOR_VIEWNAME 11 +#define COLOR_SELBRUSHES3D 12 + +#define COLOR_GRIDMINOR_ALT 13 +#define COLOR_GRIDMAJOR_ALT 14 + +#define COLOR_LAST 15 + +// ---------------------------- + +typedef float vec_t; +typedef vec_t vec3_t[3]; + +// turn this on/off to use a static texdef or a memory one +// THIS MUST BE CONSISTENT throughout a whole build of Radiant / modules / plugins +// DO_TEXDEF_ALLOC is more memory efficient, but I suspect it to be wacky on win32 / C runtime etc. +#define DO_TEXDEF_ALLOC 1 +#if DO_TEXDEF_ALLOC + +class texdef_t +{ +private: + char *name; +public: + texdef_t() + { + name = new char[1]; + name[0] = '\0'; + shift[0] = 0.0f; + shift[1] = 0.0f; + rotate = 0.0f; + scale[0] = 1.0f; + scale[1] = 1.0f; + contents = 0; + flags = 0; + value = 0; + } + texdef_t(const texdef_t& other) + { + name = NULL; + SetName(other.name); + shift[0] = other.shift[0]; + shift[1] = other.shift[1]; + rotate = other.rotate; + scale[0] = other.scale[0]; + scale[1] = other.scale[1]; + contents = other.contents; + flags = other.flags; + value = other.value; + } + ~texdef_t() + { + if (name) + { + delete []name; + name = (char*)NULL; + } + } + + void SetName(const char *p) + { + if (name) + { + delete []name; + name = NULL; + } + if (p) + { + name = strcpy(new char[strlen(p)+1], p); + } + else + { + name = new char[1]; + name[0] = '\0'; + } + } + + const char * GetName() const + { + return name; + } + + // NOTE TTimo when loading prefs as binary, we load a bogus value in texdef.. + void DropName() + { + name = NULL; + SetName(NULL); + } + + texdef_t& operator =(const texdef_t& rhs) + { + if (&rhs != this) + { + SetName(rhs.name); + shift[0] = rhs.shift[0]; + shift[1] = rhs.shift[1]; + rotate = rhs.rotate; + scale[0] = rhs.scale[0]; + scale[1] = rhs.scale[1]; + contents = rhs.contents; + flags = rhs.flags; + value = rhs.value; + } + return *this; + } + float shift[2]; + float rotate; + float scale[2]; + int contents; + int flags; + int value; +}; + +#else + +// max length of a vfs texture path +#define QPATH 64 +class texdef_t +{ +private: + char name[QPATH]; +public: + texdef_t() { name[0] = '\0'; } + ~texdef_t() { } + + void SetName(const char *p) + { + strncpy(name, p, QPATH); + } + + const char * GetName() const + { + return name; + } + + // NOTE TTimo when loading prefs as binary, we load a bogus value in texdef.. + void DropName() + { + name[0] = '\0'; + } + + texdef_t& operator =(const texdef_t& rhs) + { + if (&rhs != this) + { + SetName(rhs.name); + shift[0] = rhs.shift[0]; + shift[1] = rhs.shift[1]; + rotate = rhs.rotate; + scale[0] = rhs.scale[0]; + scale[1] = rhs.scale[1]; + contents = rhs.contents; + flags = rhs.flags; + value = rhs.value; + } + return *this; + } + float shift[2]; + float rotate; + float scale[2]; + int contents; + int flags; + int value; +}; + +#endif + +// forward declare +class IShader; + +// Timo +// new brush primitive texdef +typedef struct brushprimit_texdef_s +{ + vec_t coords[2][3]; +} brushprimit_texdef_t; + +// this structure is used in Radiant to reflect the state of the texture window +// it gives information on current shader and various flags +class texturewin_t +{ +public: + texturewin_t() + { + } + ~texturewin_t() + { + } + int width, height; + int originy; + // add brushprimit_texdef_t for brush primitive coordinates storage + brushprimit_texdef_t brushprimit_texdef; + int m_nTotalHeight; + // surface plugin, must be casted to a IPluginTexdef* + void* pTexdef; + texdef_t texdef; + // shader + // NOTE: never NULL, initialized in Texture_Init + // NOTE: the reference name of the shader is texdef.name (see QERApp_ReloadShaders for an example) + IShader *pShader; +}; + +#define QER_TRANS 0x00000001 +#define QER_NOCARVE 0x00000002 +#define QER_NODRAW 0x00000004 +#define QER_NONSOLID 0x00000008 +#define QER_WATER 0x00000010 +#define QER_LAVA 0x00000020 +#define QER_FOG 0x00000040 +#define QER_ALPHAFUNC 0x00000080 +#define QER_CULL 0x00000100 + + +// describes a GL texture that Radiant uses to represent a shader +// NOTE: all qtexture_t are stored in a main list at g_qeglobals.d_qtextures +// shaders have reference couting, but qtexture_t don't (they're way too deep into Radiant) +typedef struct qtexture_s +{ + struct qtexture_s *next; + // name of the texture file (the physical image file we are using) + // NOTE: used for lookup, must be unique .. vfs path of the texture, lowercase, NO FILE EXTENSION + // ex textures/gothic_wall/iron + // NOTE: the "textures/" prefix might seem unnecessary .. but it's better to stick to the vfs name + char name[64]; + int width, height; + GLuint texture_number; // gl bind number (the qtexture_t are usually loaded and binded by the shaders module) + vec3_t color; // for flat shade mode + qboolean inuse; // true = is present on the level (for the texture browser interface) +} qtexture_t; + +// NOTE: don't trust this definition! +// you should read float points[..][5] +// see NewWinding definition +// WARNING: don't touch anything to this struct unless you looked into winding.cpp and WINDING_SIZE(pt) +#define MAX_POINTS_ON_WINDING 64 +typedef struct +{ + int numpoints; + int maxpoints; + float points[8][5]; // variable sized +} winding_t; + +typedef struct +{ + vec3_t normal; + double dist; + int type; +} plane_t; + +// pShader is a shortcut to the shader +// it's only up-to-date after a Brush_Build call +// to initialize the pShader, use QERApp_Shader_ForName(texdef.name) +typedef struct face_s +{ + struct face_s *next; + struct face_s *prev; + struct face_s *original; //used for vertex movement + vec3_t planepts[3]; + texdef_t texdef; + plane_t plane; + + // Nurail: Face Undo + int undoId; + int redoId; + + winding_t *face_winding; + + vec3_t d_color; + vec_t d_shade; + // calls through here have indirections (pure virtual) + // it would be good if the rendering loop would avoid scanning there (for the GL binding number for example) + IShader *pShader; + //++timo FIXME: remove! + qtexture_t *d_texture; + + // Timo new brush primit texdef + brushprimit_texdef_t brushprimit_texdef; + + // cast this one to an IPluginTexdef if you are using it + // NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h + // TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ? + void *pData; +} face_t; + +typedef struct { + vec3_t xyz; + float sideST[2]; + float capST[2]; +} curveVertex_t; + +typedef struct { + curveVertex_t v[2]; +} sideVertex_t; + + +#define MIN_PATCH_WIDTH 3 +#define MIN_PATCH_HEIGHT 3 + +#define MAX_PATCH_WIDTH 16 +#define MAX_PATCH_HEIGHT 16 + +// patch type info +// type in lower 16 bits, flags in upper +// endcaps directly follow this patch in the list + +// types +#define PATCH_GENERIC 0x00000000 // generic flat patch +#define PATCH_CYLINDER 0x00000001 // cylinder +#define PATCH_BEVEL 0x00000002 // bevel +#define PATCH_ENDCAP 0x00000004 // endcap +#define PATCH_HEMISPHERE 0x00000008 // hemisphere +#define PATCH_CONE 0x00000010 // cone +#define PATCH_TRIANGLE 0x00000020 // simple tri, assumes 3x3 patch + +// behaviour styles +#define PATCH_CAP 0x00001000 // flat patch applied as a cap +#define PATCH_SEAM 0x00002000 // flat patch applied as a seam +#define PATCH_THICK 0x00004000 // patch applied as a thick portion + +// styles +#define PATCH_BEZIER 0x00000000 // default bezier +#define PATCH_BSPLINE 0x10000000 // bspline + +#define PATCH_TYPEMASK 0x00000fff // +#define PATCH_BTYPEMASK 0x0000f000 // +#define PATCH_STYLEMASK 0xffff0000 // + +typedef struct { + vec3_t xyz; + float st[2]; + float lightmap[2]; + vec3_t normal; +} drawVert_t; + +// spog - used for patch LOD trees + +struct BTNode_t +{ + BTNode_t *left, *right; + drawVert_t info; + drawVert_t vMid; +}; + +struct BTreeList_t +{ + BTreeList_t *next; + BTNode_t *pBT; + drawVert_t vLeft, vRight; +}; + +struct BTListList_t +{ + BTListList_t *next; + BTreeList_t *list; +}; + +// used in brush primitive AND entities +typedef struct epair_s +{ + struct epair_s *next; + char *key; + char *value; +} epair_t; + +struct brush_s; +typedef struct brush_s brush_t; + +typedef struct { + int width, height; // in control points, not patches + int contents, flags, value, type; + qtexture_t *d_texture; + IShader *pShader; + drawVert_t ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT]; + brush_t *pSymbiot; + qboolean bSelected; + qboolean bOverlay; + qboolean bDirty; + int nListID; + epair_t *epairs; + // cast this one to an IPluginTexdef if you are using it + // NOTE: casting can be done with a GETPLUGINTEXDEF defined in isurfaceplugin.h + // TODO: if the __ISURFACEPLUGIN_H_ header is used, use a union { void *pData; IPluginTexdef *pPluginTexdef } kind of thing ? + void *pData; + // spog - curve LOD binary trees and lists + BTNode_t *rowLOD[((MAX_PATCH_WIDTH-1)/2) * MAX_PATCH_HEIGHT]; // = ((MAX_PATCH_WIDTH-1)/2) * MAX_PATCH_HEIGHT + BTNode_t *colLOD[((MAX_PATCH_HEIGHT-1)/2) * MAX_PATCH_WIDTH]; // = ((MAX_PATCH_HEIGHT-1)/2) * MAX_PATCH_WIDTH + bool rowDirty[((MAX_PATCH_WIDTH-1)-1)/2]; + bool colDirty[((MAX_PATCH_HEIGHT-1)-1)/2]; + bool LODUpdated; + void *drawLists; // pointer to std::list +} patchMesh_t; + +typedef struct brush_s +{ + struct brush_s *prev, *next; // links in active/selected + struct brush_s *oprev, *onext; // links in entity + struct entity_s *owner; + vec3_t mins, maxs; + face_t *brush_faces; + + qboolean bModelFailed; + // + // curve brush extensions + // all are derived from brush_faces + qboolean patchBrush; + qboolean hiddenBrush; + + //int nPatchID; + + patchMesh_t *pPatch; + struct entity_s *pUndoOwner; + + int undoId; //undo ID + int redoId; //redo ID + int ownerId; //entityId of the owner entity for undo + + // TTimo: this is not legal, we are not supposed to put UI toolkit dependant stuff in the interfaces + // NOTE: the grouping stuff never worked, there is embryonary code everywhere though + int numberId; + void* itemOwner; // GtkCTreeNode* ? + + // brush primitive only + epair_t *epairs; + + // brush filtered toggle + bool bFiltered; + bool bCamCulled; + bool bBrushDef; +} brush_t; + +#define MAX_FLAGS 16 + +typedef struct vertmodel_t +{ + float v[3]; + float st[2]; + float normal[3]; +} vertmodel; + +typedef struct triindex_t +{ + int indexes[3]; +} triindex; + +// TTimo: NOTE: we don't have dedicated stuff to copy/allocate/delete this structure like we do for entity_t and brush_t +// could be necessary, I'm adding GString *strSkin that needs to be copied around +// TTimo 04/01/2001 removing the GString* for toolkit-independent interfaces .. cast it .. +typedef struct entitymodel_t +{ + struct entitymodel_t *pNext; + int nTriCount; + //trimodel *pTriList; + //md3Triangle_t *pTriList; + triindex *pTriList; + vertmodel *pVertList; + int numVerts; + int nTextureBind; + void *strSkin; // toolkit-independent .. cast to a GString* + int nSkinWidth; + int nSkinHeight; + int nModelPosition; +} entitymodel; + +// eclass show flags + +#define ECLASS_LIGHT 0x00000001 +#define ECLASS_ANGLE 0x00000002 +#define ECLASS_PATH 0x00000004 +#define ECLASS_MISCMODEL 0x00000008 + +#ifdef USEPLUGINENTITIES +#define ECLASS_PLUGINENTITY 0x00000010 +#endif // USEPLUGINENTITIES + +typedef struct eclass_s +{ + struct eclass_s *next; + char *name; + qboolean fixedsize; + qboolean unknown; // wasn't found in source + vec3_t mins, maxs; + vec3_t color; + texdef_t texdef; + char *comments; + char flagnames[MAX_FLAGS][32]; + + entitymodel *model; + char *modelpath; + //++timo NOTE: I don't know what this is used for exactly. But don't trust it for the real skin paths on models (screws up with long/short path names) + //++hydra NOTE: this, hopefully, will be used to use specific shaders on the bounding boxes of the eclass instead of a color. + char *skinpath; + int nFrame; + unsigned int nShowFlags; + + void* hPlug; +} eclass_t; + +extern eclass_t *eclass; + +/* +** window bits +*/ +#define W_CAMERA 0x0001 +#define W_XY 0x0002 +#define W_XY_OVERLAY 0x0004 +#define W_Z 0x0008 +#define W_TEXTURE 0x0010 +#define W_Z_OVERLAY 0x0020 +#define W_CONSOLE 0x0040 +#define W_ENTITY 0x0080 +#define W_CAMERA_IFON 0x0100 +#define W_XZ 0x0200 //--| only used for patch vertex manip stuff +#define W_YZ 0x0400 //--| +#define W_GROUP 0x0800 +#define W_MEDIA 0x1000 +#define W_ALL 0xFFFFFFFF + +// used in some Drawing routines +enum VIEWTYPE {YZ, XZ, XY}; +const char g_AxisName[3] = { 'X', 'Y', 'Z' }; + +// dynamically allocated string +class string_t +{ +public: + inline string_t() + { + copy(""); + } + inline string_t(const string_t& other) + { + copy(other.m_string); + } + inline string_t(const char* string) + { + copy(string); + } + inline ~string_t() + { + destroy(); + } + inline const string_t& operator=(const string_t& other) + { + destroy(); + copy(other.m_string); + return *this; + } + inline const string_t& operator=(const char* string) + { + destroy(); + copy(string); + return *this; + } + inline bool operator<(const string_t& other) const + { + return compare(other) < 0; + } + inline bool operator>(const string_t& other) const + { + return compare(other) > 0; + } + inline bool operator==(const string_t& other) const + { + return compare(other) == 0; + } + inline bool operator!=(const string_t& other) const + { + return compare(other) != 0; + } + inline const char* c_str() const + { + return m_string; + } +private: + inline void copy(const char* string) + { + m_string = new char[strlen(string)+1]; + strcpy(m_string, string); + } + inline void destroy() + { + delete[] m_string; + } + inline int compare(const string_t& other) const + { + return strcmp(m_string, other.m_string); + } + + char* m_string; +}; + +class filetype_t +{ +public: + filetype_t() + : name(""), pattern("") + {} + filetype_t(const char* _name, const char* _pattern) + : name(_name), pattern(_pattern) + {} + const char* name; + const char* pattern; +}; + + +/* +** Outline bits +*/ +#define OUTLINE_ZBUF 0x01 // zbuffered outline +#define OUTLINE_BSEL 0x02 // selection overlay + +#ifdef USEPLUGINENTITIES +// forward declare this one +class IPluginEntity; +#endif // USEPLUGINENTITIES + +// MODEL + +class IRender; +class ISelect; +class IEdit; + +// NOTE TTimo about ~entity_interfaces_t +// using constructors / destructors on C structs is bad practice +struct entity_interfaces_t +{ + IRender *pRender; + ISelect *pSelect; + IEdit *pEdit; +}; +// MODEL END + +typedef struct entity_s +{ + struct entity_s *prev, *next; + + /*! + \todo can use a brushes list, or the blind data below + for now, blind data should be interpreted as CPtrArray*, only use in the IMAP API + */ + brush_t brushes; // head/tail of list + void *pData; + + int undoId, redoId, entityId; // used for undo/redo + vec3_t origin; + eclass_t *eclass; + epair_t *epairs; + entity_interfaces_t model; +#ifdef USEPLUGINENTITIES + IPluginEntity *pPlugEnt; +#endif // USEPLUGINENTITIES + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=252 + // this is cam code addition? + vec3_t color; + + // Arnout: HACK-ish and change for 1.3 (in 1.3 we have a blind data pointer according to TTimo) + float fLightEnvelope1[3]; + float fLightEnvelope2[2]; +} entity_t; + +typedef struct +{ + int p1, p2; + face_t *f1, *f2; +} pedge_t; + +// window system independent camera view code +// NOTE TTimo taken from xy.h +typedef struct +{ + int width, height; + + qboolean timing; + + vec3_t origin; // at center of window + float scale; + + float topclip, bottomclip; + + qboolean d_dirty; +} xy_t; + +// spog - struct used for nodes in filters list +struct bfilter_t //c++ style +{ + bfilter_t *next; + int attribute; // 1=brush->face->pShader->getName() + // 2=brush->pPatch->pShader->getFlags() + // 3=brush->owner->eclass->name + // 4=brush->owner->eclass->nShowFlags + // 5=brush->face->texdef.flags (q2) + // 6=brush->face->texdef.contents (q2) + int mask; + char *string; + bool active; +}; + +// djbob: no longer any need to add only to end, versioning removed, it is no longer saved as binary +// IMPORTANT: whenever you update this struct, you need to add the relevant load/save code +// preferences.cpp LoadPref / SavePref +typedef struct +{ + int iTexMenu; // nearest, linear, etc + float fGamma; // gamma for textures + vec3_t colors[COLOR_LAST]; + int exclude; + int include; + texdef_t m_SIIncrement; // increments for the surface inspector + texdef_t m_PIIncrement; // increments for the patch inspector + vec3_t AxisColors[3]; // colors used for X, Y Z axis + // these are in the View > Show menu with Show coordinates + qboolean show_names; + qboolean show_coordinates; + qboolean show_angles; + qboolean show_outline; + qboolean show_axis; + qboolean bNoSelectedOutlines; + bfilter_t *filters; // FIXME spog - might be better in another location? + int iSelectedOutlinesStyle; +} SavedInfo_t; + +typedef enum +{ + sel_brush, + sel_brush_on, + sel_brush_off, + // sel_sticky_brush, + // sel_face, + sel_vertex, + sel_edge, + sel_singlevertex, + sel_curvepoint, + sel_area, + sel_areatall, + sel_facets_on, + sel_facets_off, +} select_t; + +// most of the QE globals are stored in this structure +typedef struct +{ + qboolean d_showgrid; + float d_gridsize; + qboolean d_bSmallGrid; // we use this flag to hack our way into editing of <1 grids + + int d_num_entities; + + entity_t *d_project_entity; + + // defines the boundaries of the current work area + // is used to guess brushes and drop points third coordinate when creating from 2D view + vec3_t d_work_min,d_work_max; + // not stored in registry, default is off + qboolean d_show_work; + + vec3_t d_points[MAX_POINTS]; + int d_numpoints; + pedge_t d_edges[MAX_EDGES]; + int d_numedges; + + int d_num_move_points; + float *d_move_points[4096]; + + qtexture_t *d_qtextures; + // used to speedup access, specially in QERApp_Try_Texture_ForName + // must always be kept up-to-date with d_qtextures* + //++timo FIXME at some point in the future it would even be better to remove d_qtextures and use this instead + GHashTable *d_qtexmap; + + texturewin_t d_texturewin; + + int d_pointfile_display_list; + + xy_t d_xyOld; + + SavedInfo_t d_savedinfo; + + int d_workcount; + + // connect entities uses the last two brushes selected + int d_select_count; + brush_t *d_select_order[2]; + vec3_t d_select_translate; // for dragging w/o making new display lists + select_t d_select_mode; + + int d_parsed_brushes; + + qboolean show_blocks; + int blockSize; + + // NOTE TTimo + // a lot of this data should be in a property bag and available to the other modules through an API + // this is generated from game configuration and the project settings, and should be still be part of it + + // tells if we are internally using brush primitive (texture coordinates and map format) + // this is a shortcut for IntForKey( g_qeglobals.d_project_entity, "brush_primit" ) + // NOTE: must keep the two ones in sync + bool m_bBrushPrimitMode; + + /*! + win32: engine full path. + unix: user home full path + engine dir. + */ + Str m_strHomeGame; + /*! + cache for m_strHomeGame + mod subdirectory. + */ + Str m_strHomeMaps; + + // used while importing brush data from file or memory buffer + // tells if conversion between map format and internal preferences ( m_bBrushPrimitMode ) is needed + qboolean bNeedConvert; + qboolean bOldBrushes; + qboolean bPrimitBrushes; + + vec3_t d_vAreaTL; + vec3_t d_vAreaBR; + + // tells if we are using .INI files for prefs instead of registry + qboolean use_ini; + // even in .INI mode we use the registry for all void* prefs + char use_ini_registry[64]; + // disabled all INI / registry read write .. used when shutting down after registry cleanup + qboolean disable_ini; + + // tells we are using a BSP frontend plugin + qboolean bBSPFrontendPlugin; + + // handle to the console log file + // we use low level I/O to get rid of buffering and have everything on file if we crash + int hLogFile; + + qboolean bTextureCompressionSupported; // is texture compression supported by hardware? + GLint texture_components; + + // temporary values that should be initialised only once at run-time + // there are too many uneccessary calls to Sys_QGL_ExtensionSupported + // NOTE TTimo: those are unused atm (set right, but not used) + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=623 + bool m_bOpenGLCompressionSupported; + bool m_bS3CompressionSupported; + + // set to true after OpenGL has been initialized and extensions have been tested + bool m_bOpenGLReady; + +} QEGlobals_t; + +#endif // _QERTYPES_H_ diff --git a/include/qsysprintf.h b/include/qsysprintf.h new file mode 100644 index 00000000..a8d2874a --- /dev/null +++ b/include/qsysprintf.h @@ -0,0 +1,67 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __QSYSPRINTF_H__ +#define __QSYSPRINTF_H__ + +/*! +this header is provided in libs/ in an attempt to provide a common API +for all the diagnostic printing / fatal error situations + +this is oriented at synapse server targets ONLY +synapse clients should not include this, as they are supposed to go +through the function tables to report print diagnostics +(or use Syn_Printf for situations where the func table may not be available) + +each server target implements that in it's own way. Radiant logs to +a file and sends to the console, q3map prints to stdout and to the +XML network stream, etc. +*/ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +// NOTE: might want to switch to bits if needed +#define SYS_VRB 0 ///< verbose support (on/off) +#define SYS_STD 1 ///< standard print level - this is the default +#define SYS_WRN 2 ///< warnings +#define SYS_ERR 3 ///< error +#define SYS_NOCON 4 ///< no console, only print to the file (useful whenever Sys_Printf and output IS the problem) + +/*! +those are the real implementation +*/ +void Sys_Printf_VA (const char *text, va_list args); ///< matches PFN_SYN_PRINTF_VA prototype +void Sys_FPrintf_VA (int level, const char *text, va_list args); + +/*! +this is easy to call, wrappers around va_list version +*/ +void Sys_Printf (const char *text, ...); +void Sys_FPrintf (int flag, const char *text, ...); + +#if defined(__cplusplus) +}; +#endif + +#endif diff --git a/include/renderable.cpp b/include/renderable.cpp deleted file mode 100644 index 9ca3673f..00000000 --- a/include/renderable.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "renderable.h" - diff --git a/include/renderable.h b/include/renderable.h deleted file mode 100644 index de573910..00000000 --- a/include/renderable.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_RENDERABLE_H) -#define INCLUDED_RENDERABLE_H - -#include "generic/constant.h" - -class Shader; -class OpenGLRenderable; -class LightList; -class Matrix4; - -class Renderer -{ -public: - enum EHighlightMode - { - eFace = 1 << 0, - /*! Full highlighting. */ - ePrimitive = 1 << 1, - }; - - enum EStyle - { - eWireframeOnly, - eFullMaterials, - }; - - virtual void PushState() = 0; - virtual void PopState() = 0; - virtual void SetState(Shader* state, EStyle mode) = 0; - virtual const EStyle getStyle() const = 0; - virtual void Highlight(EHighlightMode mode, bool bEnable = true) = 0; - virtual void setLights(const LightList& lights) - { - } - virtual void addRenderable(const OpenGLRenderable& renderable, const Matrix4& world) = 0; -}; - -class VolumeTest; - -class Renderable -{ -public: - STRING_CONSTANT(Name, "Renderable"); - - virtual void renderSolid(Renderer& renderer, const VolumeTest& volume) const = 0; - virtual void renderWireframe(Renderer& renderer, const VolumeTest& volume) const = 0; - virtual void renderComponents(Renderer&, const VolumeTest&) const - { - } - virtual void viewChanged() const - { - } -}; - -#endif diff --git a/include/selectable.cpp b/include/selectable.cpp deleted file mode 100644 index 206bebe4..00000000 --- a/include/selectable.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "selectable.h" - diff --git a/include/selectable.h b/include/selectable.h deleted file mode 100644 index fffcfe29..00000000 --- a/include/selectable.h +++ /dev/null @@ -1,305 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SELECTABLE_H) -#define INCLUDED_SELECTABLE_H - -#include - -#include "generic/vector.h" -#include "scenelib.h" -#include "generic/callbackfwd.h" - -class SelectionIntersection -{ - float m_depth; - float m_distance; -public: - SelectionIntersection() : m_depth(1), m_distance(2) - { - } - SelectionIntersection(float depth, float distance) : m_depth(depth), m_distance(distance) - { - } - bool operator<(const SelectionIntersection& other) const - { - if(m_distance != other.m_distance) - { - return m_distance < other.m_distance; - } - if(m_depth != other.m_depth) - { - return m_depth < other.m_depth; - } - return false; - } - bool equalEpsilon(const SelectionIntersection& other, float distanceEpsilon, float depthEpsilon) const - { - return float_equal_epsilon(m_distance, other.m_distance, distanceEpsilon) - && float_equal_epsilon(m_depth, other.m_depth, depthEpsilon); - } - float depth() const - { - return m_depth; - } - bool valid() const - { - return depth() < 1; - } -}; - -// returns true if self is closer than other -inline bool SelectionIntersection_closer(const SelectionIntersection& self, const SelectionIntersection& other) -{ - return self < other; -} - -// assigns other to best if other is closer than best -inline void assign_if_closer(SelectionIntersection& best, const SelectionIntersection& other) -{ - if(SelectionIntersection_closer(other, best)) - { - best = other; - } -} - - - - -class VertexPointer -{ - typedef const unsigned char* byte_pointer; -public: - typedef float elem_type; - typedef const elem_type* pointer; - typedef const elem_type& reference; - - class iterator - { - public: - iterator() {} - iterator(byte_pointer vertices, std::size_t stride) - : m_iter(vertices), m_stride(stride) {} - - bool operator==(const iterator& other) const - { - return m_iter == other.m_iter; - } - bool operator!=(const iterator& other) const - { - return !operator==(other); - } - - iterator operator+(std::size_t i) - { - return iterator(m_iter + i * m_stride, m_stride); - } - iterator operator+=(std::size_t i) - { - m_iter += i * m_stride; - return *this; - } - iterator& operator++() - { - m_iter += m_stride; - return *this; - } - iterator operator++(int) - { - iterator tmp = *this; - m_iter += m_stride; - return tmp; - } - reference operator*() const - { - return *reinterpret_cast(m_iter); - } - private: - byte_pointer m_iter; - std::size_t m_stride; - }; - - VertexPointer(pointer vertices, std::size_t stride) - : m_vertices(reinterpret_cast(vertices)), m_stride(stride) {} - - iterator begin() const - { - return iterator(m_vertices, m_stride); - } - - reference operator[](std::size_t i) const - { - return *reinterpret_cast(m_vertices + m_stride*i); - } - -private: - byte_pointer m_vertices; - std::size_t m_stride; -}; - -class IndexPointer -{ -public: - typedef unsigned int index_type; - typedef const index_type* pointer; - - class iterator - { - public: - iterator(pointer iter) : m_iter(iter) {} - - bool operator==(const iterator& other) const - { - return m_iter == other.m_iter; - } - bool operator!=(const iterator& other) const - { - return !operator==(other); - } - - iterator operator+(std::size_t i) - { - return m_iter + i; - } - iterator operator+=(std::size_t i) - { - return m_iter += i; - } - iterator operator++() - { - return ++m_iter; - } - iterator operator++(int) - { - return m_iter++; - } - const index_type& operator*() const - { - return *m_iter; - } - private: - void increment() - { - ++m_iter; - } - pointer m_iter; - }; - - IndexPointer(pointer indices, std::size_t count) - : m_indices(indices), m_finish(indices + count) {} - - iterator begin() const - { - return m_indices; - } - iterator end() const - { - return m_finish; - } - -private: - pointer m_indices; - pointer m_finish; -}; - -template class BasicVector3; -typedef BasicVector3 Vector3; -class Matrix4; -class VolumeTest; - -class SelectionTest -{ -public: - virtual void BeginMesh(const Matrix4& localToWorld, bool twoSided = false) = 0; - virtual const VolumeTest& getVolume() const = 0; - virtual const Vector3& getNear() const = 0; - virtual const Vector3& getFar() const = 0; - virtual void TestPoint(const Vector3& point, SelectionIntersection& best) = 0; - virtual void TestPolygon(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0; - virtual void TestLineLoop(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0; - virtual void TestLineStrip(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0; - virtual void TestLines(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) = 0; - virtual void TestTriangles(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) = 0; - virtual void TestQuads(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) = 0; - virtual void TestQuadStrip(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) = 0; -}; - -class Selectable; - -class Selector -{ -public: - virtual void pushSelectable(Selectable& selectable) = 0; - virtual void popSelectable() = 0; - virtual void addIntersection(const SelectionIntersection& intersection) = 0; -}; - -inline void Selector_add(Selector& selector, Selectable& selectable) -{ - selector.pushSelectable(selectable); - selector.addIntersection(SelectionIntersection(0, 0)); - selector.popSelectable(); -} - -inline void Selector_add(Selector& selector, Selectable& selectable, const SelectionIntersection& intersection) -{ - selector.pushSelectable(selectable); - selector.addIntersection(intersection); - selector.popSelectable(); -} - - -class VolumeTest; -class SelectionTestable -{ -public: - STRING_CONSTANT(Name, "SelectionTestable"); - - virtual void testSelect(Selector& selector, SelectionTest& test) = 0; -}; - -inline SelectionTestable* Instance_getSelectionTestable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - - -class Plane3; -typedef Callback1 PlaneCallback; - -class SelectedPlanes -{ -public: - virtual bool contains(const Plane3& plane) const = 0; -}; - -class PlaneSelectable -{ -public: - STRING_CONSTANT(Name, "PlaneSelectable"); - - virtual void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) = 0; - virtual void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) = 0; -}; - - - -#endif diff --git a/include/stl_check.h b/include/stl_check.h new file mode 100644 index 00000000..b6def1db --- /dev/null +++ b/include/stl_check.h @@ -0,0 +1,60 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/*! +This header is used to make sure the STL we are using is what we expect +this allows to catch some weird errors early at compile time +*/ + +#ifdef Q_NO_STLPORT + +// not using STLPort (gcc 3.x build) +using namespace std; + +#else + +#ifndef _STLPORT_VERSION +#error "Can't find _STLPORT_VERSION, check you are compiling against STLPort" +#endif + +#if !defined(_STLP_DONT_USE_EXCEPTIONS) +#error exc +#endif + +#if !defined(_STLP_NO_NAMESPACES) +#error namespace +#endif + +#if !defined(_STLP_NO_IOSTREAMS) +#error io +#endif + +// now check a few more things (paranoid) +// if you use our custom STLPort distribution it should be alright though +#if !defined(_STLP_DONT_USE_EXCEPTIONS) || !defined(_STLP_NO_NAMESPACES) || !defined(_STLP_NO_IOSTREAMS) +#error "There is something broken in your STLPort config" +#endif + +#ifdef _WIN32 +#pragma warning(disable : 4786) +#endif + +#endif diff --git a/include/version.default b/include/version.default index bc80560f..7455fe00 100644 --- a/include/version.default +++ b/include/version.default @@ -1 +1 @@ -1.5.0 +1.4.0 diff --git a/include/version.h b/include/version.h new file mode 100644 index 00000000..91f5e433 --- /dev/null +++ b/include/version.h @@ -0,0 +1,4 @@ +// generated header, see makeversion.py +#define RADIANT_VERSION "1.6.0" +#define RADIANT_MINOR_VERSION "0" +#define RADIANT_MAJOR_VERSION "6" diff --git a/include/warnings.h b/include/warnings.h deleted file mode 100644 index 66415614..00000000 --- a/include/warnings.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_WARNINGS_H) -#define INCLUDED_WARNINGS_H - -#if _MSC_VER > 1000 && defined(WIN32) -#pragma warning(disable:4355) // 'this' : used in base member initializer list -#pragma warning(disable:4503) // '[symbol]' : decorated name length exceeded, name was truncated -#endif - -#endif - diff --git a/include/windowobserver.cpp b/include/windowobserver.cpp deleted file mode 100644 index 2e59b8c0..00000000 --- a/include/windowobserver.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "windowobserver.h" - diff --git a/include/windowobserver.h b/include/windowobserver.h deleted file mode 100644 index 99fc03da..00000000 --- a/include/windowobserver.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_WINDOWOBSERVER_H) -#define INCLUDED_WINDOWOBSERVER_H - -template class BitFieldValue; -struct ModifierEnumeration; -typedef BitFieldValue ModifierFlags; - -template class EnumeratedValue; -struct ButtonEnumeration; -typedef EnumeratedValue ButtonIdentifier; - - -#include "generic/bitfield.h" - -struct ModifierEnumeration -{ - enum Value - { - SHIFT = 0, - CONTROL = 1, - ALT = 2 - }; -}; - -typedef BitFieldValue ModifierFlags; - -const ModifierFlags c_modifierNone; -const ModifierFlags c_modifierShift(ModifierEnumeration::SHIFT); -const ModifierFlags c_modifierControl(ModifierEnumeration::CONTROL); -const ModifierFlags c_modifierAlt(ModifierEnumeration::ALT); - -#include "generic/enumeration.h" - -struct ButtonEnumeration -{ - enum Value - { - INVALID = 0, - LEFT = 1, - MIDDLE = 3, - RIGHT = 2 - }; -}; - -typedef EnumeratedValue ButtonIdentifier; - -const ButtonIdentifier c_buttonInvalid(ButtonEnumeration::INVALID); -const ButtonIdentifier c_buttonLeft(ButtonEnumeration::LEFT); -const ButtonIdentifier c_buttonMiddle(ButtonEnumeration::MIDDLE); -const ButtonIdentifier c_buttonRight(ButtonEnumeration::RIGHT); - - -template -class BasicVector2; -typedef BasicVector2 Vector2; -typedef Vector2 WindowVector; - -class WindowObserver -{ -public: - virtual void release() = 0; - virtual void onSizeChanged(int width, int height) = 0; - virtual void onMouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) = 0; - virtual void onMouseUp(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) = 0; - virtual void onMouseMotion(const WindowVector& position, ModifierFlags modifiers) = 0; - virtual void onModifierDown(ModifierFlags modifier) = 0; - virtual void onModifierUp(ModifierFlags modifier) = 0; -}; - -#endif diff --git a/install.py b/install.py index 0d44ceb9..cf0a74ba 100644 --- a/install.py +++ b/install.py @@ -1,125 +1,48 @@ -# Copyright (C) 2001-2006 William Joseph. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#!/usr/bin/env python -""" -Builds the ./install directory. +import os.path, sys, shutil -Copies files from various locations: -./setup/data/tools/ -./games// -./include/version.default is used to generate RADIANT_MAJOR and RADIANT_MINOR -""" +def install_file( path, src_path, f ): + src = os.path.join( src_path, f ) + dst = os.path.join( path, f ) + print '%s -> %s' % ( src, dst ) + shutil.copyfile( src, dst ) -import os -import sys -import shutil +def install( path, src_path ): + for f in [ 'radiant.exe', 'radiant.pdb' ]: + install_file( path, src_path, f ) + + modules_path = os.path.join( path, 'modules' ) + try: + os.makedirs( modules_path ) + except: + pass + assert( os.path.exists( modules_path ) ) -def assertMessage(condition, message): - if not condition: - raise Exception(message) + modules_src = os.path.join( src_path, 'modules' ) + assert( os.path.exists( modules_src ) ) -def copyFile(source, target): - assertMessage(os.path.isfile(source), "failed to find file: " + source) - print source, "->", target - shutil.copy2(source, target) + for e in os.listdir( modules_src ): + if ( e[-4:] == '.dll' or e[-4:] == '.pdb' ): + install_file( modules_path, modules_src, e ) + + plugins_path = os.path.join( path, 'plugins' ) + try: + os.makedirs( plugins_path ) + except: + pass + assert( os.path.exists( plugins_path ) ) + + plugins_src = os.path.join( src_path, 'plugins' ) + assert( os.path.exists( plugins_src ) ) -def copyFileIfExists(source, target): - if os.path.exists(source): - copyFile(source, target) + for e in os.listdir( plugins_src ): + if ( e[-4:] == '.dll' or e[-4:] == '.pdb' ): + install_file( plugins_path, plugins_src, e ) -def copySvn(source, target): - assertMessage(os.path.isdir(source), "failed to find directory: " + source) - if not os.path.exists(target): - os.mkdir(target) - for name in os.listdir(source): - absolute = os.path.join(source, name) - absTarget = os.path.join(target, name) - if os.path.isdir(absolute): - if name != ".svn": - copySvn(absolute, absTarget) - else: - copyFile(absolute, absTarget) - -def copyGame(source, game, target): - assertMessage(os.path.isdir(source), "failed to find directory: " + source) - assertMessage(os.path.isdir(target), "failed to find directory: " + target) - root = os.path.join(source, os.path.normpath(game[0])) - if os.path.exists(root): - gamename = game[1] + ".game" - copySvn(os.path.join(root, gamename), os.path.join(target, gamename)) - gamesDir = os.path.join(target, "games") - if not os.path.exists(gamesDir): - os.mkdir(gamesDir) - copyFile(os.path.join(root, "games", gamename), os.path.join(gamesDir, gamename)) - -thisDir = os.path.dirname(__file__) -gamesRoot = os.path.join(thisDir, "games") -installRoot = os.path.join(thisDir, "install") - -if not os.path.exists(installRoot): - os.mkdir(installRoot) - -# copy generic data -copySvn(os.path.join(thisDir, os.path.normpath("setup/data/tools")), installRoot) - -# root, gamename -games = [ - ("Doom3Pack/tools", "doom3"), - ("ETPack", "et"), - ("HalfLifePack", "hl"), - ("Her2Pack", "heretic2"), - ("JAPack/Tools", "ja"), - ("JK2Pack", "jk2"), - ("Q1Pack", "q1"), - ("Q2Pack", "q2"), - ("Q3Pack/tools", "q3"), - ("Q4Pack/tools", "q4"), - ("Sof2Pack", "sof2"), - ("STVEFPack", "stvef"), - ("WolfPack/bin", "wolf"), - ("NexuizPack", "nexuiz"), - ("DarkPlacesPack", "darkplaces"), - ("WarsowPack/tools", "warsow"), - ("TremulousPack/tools", "trem") -] - -# copy games -for game in games: - copyGame(gamesRoot, game, installRoot) - -# copy win32 dlls -gtk2Root = os.path.normpath(os.path.join(thisDir, "../gtk2-2.10/install")) -if os.path.exists(gtk2Root): - copySvn(gtk2Root, installRoot) - -libxml2 = os.path.normpath(os.path.join(thisDir, "../libxml2-2.6/bin/libxml2.dll")) -copyFileIfExists(libxml2, installRoot) - -libmhash = os.path.normpath(os.path.join(thisDir, "../mhash-0.9/win32/libmhash/Release/libmhash.dll")) -copyFileIfExists(libmhash, installRoot) - -if sys.platform[:3] == "win" : - copySvn("../msvc_redist", installRoot) - dbghelp = os.path.normpath(os.path.join(thisDir, "../msvc_redist/dbghelp.dll")) - copyFileIfExists(dbghelp, installRoot) - -# create version files -version = open(os.path.join(thisDir, "include/version.default"), "rt").readline().split(".") -assertMessage(len(version) == 3, "failed to parse include/version.default") -open(os.path.join(thisDir, "install/RADIANT_MAJOR"), "wt").write(str(version[1])) -open(os.path.join(thisDir, "install/RADIANT_MINOR"), "wt").write(str(version[2])) +if __name__ == '__main__': + if ( len( sys.argv ) <= 2 or not os.path.exists( sys.argv[1] ) or not os.path.exists( sys.argv[2] ) ): + print 'usage: install [target directory] [source directory]' + sys.exit(1) + print 'Install %s into %s' % ( sys.argv[2], sys.argv[1] ) + install( sys.argv[1], sys.argv[2] ) diff --git a/setup/data/tools/bitmaps/brush_flipx.bmp b/install/bitmaps/brush_flipx.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_flipx.bmp rename to install/bitmaps/brush_flipx.bmp diff --git a/setup/data/tools/bitmaps/brush_flipy.bmp b/install/bitmaps/brush_flipy.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_flipy.bmp rename to install/bitmaps/brush_flipy.bmp diff --git a/setup/data/tools/bitmaps/brush_flipz.bmp b/install/bitmaps/brush_flipz.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_flipz.bmp rename to install/bitmaps/brush_flipz.bmp diff --git a/setup/data/tools/bitmaps/brush_rotatex.bmp b/install/bitmaps/brush_rotatex.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_rotatex.bmp rename to install/bitmaps/brush_rotatex.bmp diff --git a/setup/data/tools/bitmaps/brush_rotatey.bmp b/install/bitmaps/brush_rotatey.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_rotatey.bmp rename to install/bitmaps/brush_rotatey.bmp diff --git a/setup/data/tools/bitmaps/brush_rotatez.bmp b/install/bitmaps/brush_rotatez.bmp similarity index 100% rename from setup/data/tools/bitmaps/brush_rotatez.bmp rename to install/bitmaps/brush_rotatez.bmp diff --git a/setup/data/tools/bitmaps/cap_bevel.bmp b/install/bitmaps/cap_bevel.bmp similarity index 100% rename from setup/data/tools/bitmaps/cap_bevel.bmp rename to install/bitmaps/cap_bevel.bmp diff --git a/setup/data/tools/bitmaps/cap_endcap.bmp b/install/bitmaps/cap_endcap.bmp similarity index 100% rename from setup/data/tools/bitmaps/cap_endcap.bmp rename to install/bitmaps/cap_endcap.bmp diff --git a/setup/data/tools/bitmaps/cap_ibevel.bmp b/install/bitmaps/cap_ibevel.bmp similarity index 100% rename from setup/data/tools/bitmaps/cap_ibevel.bmp rename to install/bitmaps/cap_ibevel.bmp diff --git a/setup/data/tools/bitmaps/cap_iendcap.bmp b/install/bitmaps/cap_iendcap.bmp similarity index 100% rename from setup/data/tools/bitmaps/cap_iendcap.bmp rename to install/bitmaps/cap_iendcap.bmp diff --git a/setup/data/tools/bitmaps/curve_cap.bmp b/install/bitmaps/curve_cap.bmp similarity index 100% rename from setup/data/tools/bitmaps/curve_cap.bmp rename to install/bitmaps/curve_cap.bmp diff --git a/setup/data/tools/bitmaps/dontselectcurve.bmp b/install/bitmaps/dontselectcurve.bmp similarity index 100% rename from setup/data/tools/bitmaps/dontselectcurve.bmp rename to install/bitmaps/dontselectcurve.bmp diff --git a/setup/data/tools/bitmaps/dontselectmodel.bmp b/install/bitmaps/dontselectmodel.bmp similarity index 100% rename from setup/data/tools/bitmaps/dontselectmodel.bmp rename to install/bitmaps/dontselectmodel.bmp diff --git a/setup/data/tools/bitmaps/file_open.bmp b/install/bitmaps/file_open.bmp similarity index 100% rename from setup/data/tools/bitmaps/file_open.bmp rename to install/bitmaps/file_open.bmp diff --git a/setup/data/tools/bitmaps/file_save.bmp b/install/bitmaps/file_save.bmp similarity index 100% rename from setup/data/tools/bitmaps/file_save.bmp rename to install/bitmaps/file_save.bmp diff --git a/install/bitmaps/icon.bmp b/install/bitmaps/icon.bmp new file mode 100644 index 00000000..4224da83 Binary files /dev/null and b/install/bitmaps/icon.bmp differ diff --git a/setup/data/tools/bitmaps/logo.bmp b/install/bitmaps/logo.bmp similarity index 100% rename from setup/data/tools/bitmaps/logo.bmp rename to install/bitmaps/logo.bmp diff --git a/setup/data/tools/bitmaps/patch_bend.bmp b/install/bitmaps/patch_bend.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_bend.bmp rename to install/bitmaps/patch_bend.bmp diff --git a/setup/data/tools/bitmaps/patch_drilldown.bmp b/install/bitmaps/patch_drilldown.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_drilldown.bmp rename to install/bitmaps/patch_drilldown.bmp diff --git a/setup/data/tools/bitmaps/patch_insdel.bmp b/install/bitmaps/patch_insdel.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_insdel.bmp rename to install/bitmaps/patch_insdel.bmp diff --git a/setup/data/tools/bitmaps/patch_showboundingbox.bmp b/install/bitmaps/patch_showboundingbox.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_showboundingbox.bmp rename to install/bitmaps/patch_showboundingbox.bmp diff --git a/setup/data/tools/bitmaps/patch_weld.bmp b/install/bitmaps/patch_weld.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_weld.bmp rename to install/bitmaps/patch_weld.bmp diff --git a/setup/data/tools/bitmaps/patch_wireframe.bmp b/install/bitmaps/patch_wireframe.bmp similarity index 100% rename from setup/data/tools/bitmaps/patch_wireframe.bmp rename to install/bitmaps/patch_wireframe.bmp diff --git a/setup/data/tools/bitmaps/popup_selection.bmp b/install/bitmaps/popup_selection.bmp similarity index 100% rename from setup/data/tools/bitmaps/popup_selection.bmp rename to install/bitmaps/popup_selection.bmp diff --git a/setup/data/tools/bitmaps/scalelockx.bmp b/install/bitmaps/scalelockx.bmp similarity index 100% rename from setup/data/tools/bitmaps/scalelockx.bmp rename to install/bitmaps/scalelockx.bmp diff --git a/setup/data/tools/bitmaps/scalelocky.bmp b/install/bitmaps/scalelocky.bmp similarity index 100% rename from setup/data/tools/bitmaps/scalelocky.bmp rename to install/bitmaps/scalelocky.bmp diff --git a/setup/data/tools/bitmaps/scalelockz.bmp b/install/bitmaps/scalelockz.bmp similarity index 100% rename from setup/data/tools/bitmaps/scalelockz.bmp rename to install/bitmaps/scalelockz.bmp diff --git a/setup/data/tools/bitmaps/select_mouserotate.bmp b/install/bitmaps/select_mouserotate.bmp similarity index 100% rename from setup/data/tools/bitmaps/select_mouserotate.bmp rename to install/bitmaps/select_mouserotate.bmp diff --git a/setup/data/tools/bitmaps/select_mousescale.bmp b/install/bitmaps/select_mousescale.bmp similarity index 100% rename from setup/data/tools/bitmaps/select_mousescale.bmp rename to install/bitmaps/select_mousescale.bmp diff --git a/setup/data/tools/bitmaps/selection_csgmerge.bmp b/install/bitmaps/selection_csgmerge.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_csgmerge.bmp rename to install/bitmaps/selection_csgmerge.bmp diff --git a/setup/data/tools/bitmaps/selection_csgsubtract.bmp b/install/bitmaps/selection_csgsubtract.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_csgsubtract.bmp rename to install/bitmaps/selection_csgsubtract.bmp diff --git a/setup/data/tools/bitmaps/selection_makehollow.bmp b/install/bitmaps/selection_makehollow.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_makehollow.bmp rename to install/bitmaps/selection_makehollow.bmp diff --git a/setup/data/tools/bitmaps/selection_selectcompletetall.bmp b/install/bitmaps/selection_selectcompletetall.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_selectcompletetall.bmp rename to install/bitmaps/selection_selectcompletetall.bmp diff --git a/setup/data/tools/bitmaps/selection_selectinside.bmp b/install/bitmaps/selection_selectinside.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_selectinside.bmp rename to install/bitmaps/selection_selectinside.bmp diff --git a/setup/data/tools/bitmaps/selection_selectpartialtall.bmp b/install/bitmaps/selection_selectpartialtall.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_selectpartialtall.bmp rename to install/bitmaps/selection_selectpartialtall.bmp diff --git a/setup/data/tools/bitmaps/selection_selecttouching.bmp b/install/bitmaps/selection_selecttouching.bmp similarity index 100% rename from setup/data/tools/bitmaps/selection_selecttouching.bmp rename to install/bitmaps/selection_selecttouching.bmp diff --git a/setup/data/tools/bitmaps/show_entities.bmp b/install/bitmaps/show_entities.bmp similarity index 100% rename from setup/data/tools/bitmaps/show_entities.bmp rename to install/bitmaps/show_entities.bmp diff --git a/setup/data/tools/bitmaps/splash.bmp b/install/bitmaps/splash.bmp similarity index 100% rename from setup/data/tools/bitmaps/splash.bmp rename to install/bitmaps/splash.bmp diff --git a/setup/data/tools/bitmaps/textures_popup.bmp b/install/bitmaps/textures_popup.bmp similarity index 100% rename from setup/data/tools/bitmaps/textures_popup.bmp rename to install/bitmaps/textures_popup.bmp diff --git a/setup/data/tools/bitmaps/view_cameratoggle.bmp b/install/bitmaps/view_cameratoggle.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_cameratoggle.bmp rename to install/bitmaps/view_cameratoggle.bmp diff --git a/setup/data/tools/bitmaps/view_cameraupdate.bmp b/install/bitmaps/view_cameraupdate.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_cameraupdate.bmp rename to install/bitmaps/view_cameraupdate.bmp diff --git a/setup/data/tools/bitmaps/view_change.bmp b/install/bitmaps/view_change.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_change.bmp rename to install/bitmaps/view_change.bmp diff --git a/setup/data/tools/bitmaps/view_clipper.bmp b/install/bitmaps/view_clipper.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_clipper.bmp rename to install/bitmaps/view_clipper.bmp diff --git a/setup/data/tools/bitmaps/view_cubicclipping.bmp b/install/bitmaps/view_cubicclipping.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_cubicclipping.bmp rename to install/bitmaps/view_cubicclipping.bmp diff --git a/setup/data/tools/bitmaps/view_entity.bmp b/install/bitmaps/view_entity.bmp similarity index 100% rename from setup/data/tools/bitmaps/view_entity.bmp rename to install/bitmaps/view_entity.bmp diff --git a/install/bitmaps/window1.bmp b/install/bitmaps/window1.bmp new file mode 100644 index 00000000..f308f6ef Binary files /dev/null and b/install/bitmaps/window1.bmp differ diff --git a/install/bitmaps/window2.bmp b/install/bitmaps/window2.bmp new file mode 100644 index 00000000..b98b8691 Binary files /dev/null and b/install/bitmaps/window2.bmp differ diff --git a/install/bitmaps/window3.bmp b/install/bitmaps/window3.bmp new file mode 100644 index 00000000..2ea6feb8 Binary files /dev/null and b/install/bitmaps/window3.bmp differ diff --git a/install/bitmaps/window4.bmp b/install/bitmaps/window4.bmp new file mode 100644 index 00000000..5b9df336 Binary files /dev/null and b/install/bitmaps/window4.bmp differ diff --git a/contrib/bkgrnd2d/bitmaps/bkgrnd2d_conf.bmp b/install/modules/bitmaps/bkgrnd2d_conf.bmp similarity index 100% rename from contrib/bkgrnd2d/bitmaps/bkgrnd2d_conf.bmp rename to install/modules/bitmaps/bkgrnd2d_conf.bmp diff --git a/contrib/bkgrnd2d/bitmaps/bkgrnd2d_xy_toggle.bmp b/install/modules/bitmaps/bkgrnd2d_xy_toggle.bmp similarity index 100% rename from contrib/bkgrnd2d/bitmaps/bkgrnd2d_xy_toggle.bmp rename to install/modules/bitmaps/bkgrnd2d_xy_toggle.bmp diff --git a/contrib/bkgrnd2d/bitmaps/bkgrnd2d_xz_toggle.bmp b/install/modules/bitmaps/bkgrnd2d_xz_toggle.bmp similarity index 100% rename from contrib/bkgrnd2d/bitmaps/bkgrnd2d_xz_toggle.bmp rename to install/modules/bitmaps/bkgrnd2d_xz_toggle.bmp diff --git a/contrib/bkgrnd2d/bitmaps/bkgrnd2d_yz_toggle.bmp b/install/modules/bitmaps/bkgrnd2d_yz_toggle.bmp similarity index 100% rename from contrib/bkgrnd2d/bitmaps/bkgrnd2d_yz_toggle.bmp rename to install/modules/bitmaps/bkgrnd2d_yz_toggle.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_caulk.bmp b/install/modules/bitmaps/bobtoolz_caulk.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_caulk.bmp rename to install/modules/bitmaps/bobtoolz_caulk.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_cleanup.bmp b/install/modules/bitmaps/bobtoolz_cleanup.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_cleanup.bmp rename to install/modules/bitmaps/bobtoolz_cleanup.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_dropent.bmp b/install/modules/bitmaps/bobtoolz_dropent.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_dropent.bmp rename to install/modules/bitmaps/bobtoolz_dropent.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_merge.bmp b/install/modules/bitmaps/bobtoolz_merge.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_merge.bmp rename to install/modules/bitmaps/bobtoolz_merge.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_poly.bmp b/install/modules/bitmaps/bobtoolz_poly.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_poly.bmp rename to install/modules/bitmaps/bobtoolz_poly.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_split.bmp b/install/modules/bitmaps/bobtoolz_split.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_split.bmp rename to install/modules/bitmaps/bobtoolz_split.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_trainpathplot.bmp b/install/modules/bitmaps/bobtoolz_trainpathplot.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_trainpathplot.bmp rename to install/modules/bitmaps/bobtoolz_trainpathplot.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_treeplanter.bmp b/install/modules/bitmaps/bobtoolz_treeplanter.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_treeplanter.bmp rename to install/modules/bitmaps/bobtoolz_treeplanter.bmp diff --git a/contrib/bobtoolz/bitmaps/bobtoolz_turnedge.bmp b/install/modules/bitmaps/bobtoolz_turnedge.bmp similarity index 100% rename from contrib/bobtoolz/bitmaps/bobtoolz_turnedge.bmp rename to install/modules/bitmaps/bobtoolz_turnedge.bmp diff --git a/contrib/camera/bitmaps/camera_insp.bmp b/install/modules/bitmaps/camera_insp.bmp similarity index 100% rename from contrib/camera/bitmaps/camera_insp.bmp rename to install/modules/bitmaps/camera_insp.bmp diff --git a/plugins/model/bitmaps/model_reload_entity.bmp b/install/modules/bitmaps/model_reload_entity.bmp similarity index 100% rename from plugins/model/bitmaps/model_reload_entity.bmp rename to install/modules/bitmaps/model_reload_entity.bmp diff --git a/plugins/model/bitmaps/picomodel.bmp b/install/modules/bitmaps/picomodel.bmp similarity index 100% rename from plugins/model/bitmaps/picomodel.bmp rename to install/modules/bitmaps/picomodel.bmp diff --git a/install/modules/bitmaps/sample.bmp b/install/modules/bitmaps/sample.bmp new file mode 100644 index 00000000..05e34c8c Binary files /dev/null and b/install/modules/bitmaps/sample.bmp differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_actorclip.bmp b/install/modules/bitmaps/ufoai_actorclip.bmp similarity index 100% rename from setup/data/tools/plugins/bitmaps/ufoai_actorclip.bmp rename to install/modules/bitmaps/ufoai_actorclip.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level1.bmp b/install/modules/bitmaps/ufoai_level1.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level1.bmp rename to install/modules/bitmaps/ufoai_level1.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level2.bmp b/install/modules/bitmaps/ufoai_level2.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level2.bmp rename to install/modules/bitmaps/ufoai_level2.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level3.bmp b/install/modules/bitmaps/ufoai_level3.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level3.bmp rename to install/modules/bitmaps/ufoai_level3.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level4.bmp b/install/modules/bitmaps/ufoai_level4.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level4.bmp rename to install/modules/bitmaps/ufoai_level4.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level5.bmp b/install/modules/bitmaps/ufoai_level5.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level5.bmp rename to install/modules/bitmaps/ufoai_level5.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level6.bmp b/install/modules/bitmaps/ufoai_level6.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level6.bmp rename to install/modules/bitmaps/ufoai_level6.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level7.bmp b/install/modules/bitmaps/ufoai_level7.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level7.bmp rename to install/modules/bitmaps/ufoai_level7.bmp diff --git a/contrib/ufoaiplug/bitmaps/ufoai_level8.bmp b/install/modules/bitmaps/ufoai_level8.bmp similarity index 100% rename from contrib/ufoaiplug/bitmaps/ufoai_level8.bmp rename to install/modules/bitmaps/ufoai_level8.bmp diff --git a/setup/data/tools/plugins/bitmaps/ufoai_nodraw.bmp b/install/modules/bitmaps/ufoai_nodraw.bmp similarity index 100% rename from setup/data/tools/plugins/bitmaps/ufoai_nodraw.bmp rename to install/modules/bitmaps/ufoai_nodraw.bmp diff --git a/setup/data/tools/plugins/bitmaps/ufoai_stepon.bmp b/install/modules/bitmaps/ufoai_stepon.bmp similarity index 100% rename from setup/data/tools/plugins/bitmaps/ufoai_stepon.bmp rename to install/modules/bitmaps/ufoai_stepon.bmp diff --git a/setup/data/tools/plugins/bitmaps/ufoai_weaponclip.bmp b/install/modules/bitmaps/ufoai_weaponclip.bmp similarity index 100% rename from setup/data/tools/plugins/bitmaps/ufoai_weaponclip.bmp rename to install/modules/bitmaps/ufoai_weaponclip.bmp diff --git a/libs/archivelib.cpp b/libs/archivelib.cpp deleted file mode 100644 index 795f7c88..00000000 --- a/libs/archivelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "archivelib.h" diff --git a/libs/archivelib.h b/libs/archivelib.h deleted file mode 100644 index 710d2e8a..00000000 --- a/libs/archivelib.h +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_ARCHIVELIB_H) -#define INCLUDED_ARCHIVELIB_H - -#include "debugging/debugging.h" -#include "iarchive.h" -#include "stream/filestream.h" -#include "stream/textfilestream.h" -#include "memory/allocator.h" -#include "string/string.h" - -/// \brief A single-byte-reader wrapper around an InputStream. -/// Optimised for reading one byte at a time. -/// Uses a buffer to reduce the number of times the wrapped stream must be read. -template -class SingleByteInputStream -{ - typedef typename InputStreamType::byte_type byte_type; - - InputStreamType& m_inputStream; - byte_type m_buffer[SIZE]; - byte_type* m_cur; - byte_type* m_end; - -public: - - SingleByteInputStream(InputStreamType& inputStream) : m_inputStream(inputStream), m_cur(m_buffer + SIZE), m_end(m_cur) - { - } - bool readByte(byte_type& b) - { - if(m_cur == m_end) - { - if(m_end != m_buffer + SIZE) - { - return false; - } - - m_end = m_buffer + m_inputStream.read(m_buffer, SIZE); - m_cur = m_buffer; - - if(m_end == m_buffer) - { - return false; - } - } - - b = *m_cur++; - - return true; - } -}; - -/// \brief A binary-to-text wrapper around an InputStream. -/// Converts CRLF or LFCR line-endings to LF line-endings. -template -class BinaryToTextInputStream : public TextInputStream -{ - SingleByteInputStream m_inputStream; -public: - BinaryToTextInputStream(BinaryInputStreamType& inputStream) : m_inputStream(inputStream) - { - } - std::size_t read(char* buffer, std::size_t length) - { - char* p = buffer; - for(;;) - { - if(length != 0 && m_inputStream.readByte(*reinterpret_cast(p))) - { - if(*p != '\r') - { - ++p; - --length; - } - } - else - { - return p - buffer; - } - } - } -}; - -/// \brief An ArchiveFile which is stored uncompressed as part of a larger archive file. -class StoredArchiveFile : public ArchiveFile -{ - CopiedString m_name; - FileInputStream m_filestream; - SubFileInputStream m_substream; - FileInputStream::size_type m_size; -public: - typedef FileInputStream::size_type size_type; - typedef FileInputStream::position_type position_type; - - StoredArchiveFile(const char* name, const char* archiveName, position_type position, size_type stream_size, size_type file_size) - : m_name(name), m_filestream(archiveName), m_substream(m_filestream, position, stream_size), m_size(file_size) - { - } - - static StoredArchiveFile* create(const char* name, const char* archiveName, position_type position, size_type stream_size, size_type file_size) - { - return New().scalar(name, archiveName, position, stream_size, file_size); - } - - void release() - { - Delete().scalar(this); - } - size_type size() const - { - return m_size; - } - const char* getName() const - { - return m_name.c_str(); - } - InputStream& getInputStream() - { - return m_substream; - } -}; - -/// \brief An ArchiveTextFile which is stored uncompressed as part of a larger archive file. -class StoredArchiveTextFile : public ArchiveTextFile -{ - CopiedString m_name; - FileInputStream m_filestream; - SubFileInputStream m_substream; - BinaryToTextInputStream m_textStream; -public: - typedef FileInputStream::size_type size_type; - typedef FileInputStream::position_type position_type; - - StoredArchiveTextFile(const char* name, const char* archiveName, position_type position, size_type stream_size) - : m_name(name), m_filestream(archiveName), m_substream(m_filestream, position, stream_size), m_textStream(m_substream) - { - } - - static StoredArchiveTextFile* create(const char* name, const char* archiveName, position_type position, size_type stream_size) - { - return New().scalar(name, archiveName, position, stream_size); - } - - void release() - { - Delete().scalar(this); - } - const char* getName() const - { - return m_name.c_str(); - } - TextInputStream& getInputStream() - { - return m_textStream; - } -}; - -/// \brief An ArchiveFile which is stored as a single file on disk. -class DirectoryArchiveFile : public ArchiveFile -{ - CopiedString m_name; - FileInputStream m_istream; - FileInputStream::size_type m_size; -public: - typedef FileInputStream::size_type size_type; - - DirectoryArchiveFile(const char* name, const char* filename) - : m_name(name), m_istream(filename) - { - if(!failed()) - { - m_istream.seek(0, FileInputStream::end); - m_size = m_istream.tell(); - m_istream.seek(0); - } - else - { - m_size = 0; - } - } - bool failed() const - { - return m_istream.failed(); - } - - void release() - { - delete this; - } - size_type size() const - { - return m_size; - } - const char* getName() const - { - return m_name.c_str(); - } - InputStream& getInputStream() - { - return m_istream; - } -}; - -/// \brief An ArchiveTextFile which is stored as a single file on disk. -class DirectoryArchiveTextFile : public ArchiveTextFile -{ - CopiedString m_name; - TextFileInputStream m_inputStream; -public: - - DirectoryArchiveTextFile(const char* name, const char* filename) - : m_name(name), m_inputStream(filename) - { - } - bool failed() const - { - return m_inputStream.failed(); - } - - void release() - { - delete this; - } - const char* getName() const - { - return m_name.c_str(); - } - TextInputStream& getInputStream() - { - return m_inputStream; - } -}; - - -#endif diff --git a/libs/bytebool.cpp b/libs/bytebool.cpp deleted file mode 100644 index 036061fe..00000000 --- a/libs/bytebool.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "bytebool.h" diff --git a/libs/bytebool.h b/libs/bytebool.h index 4009c2dd..e0617893 100644 --- a/libs/bytebool.h +++ b/libs/bytebool.h @@ -1,32 +1,20 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #ifndef __BYTEBOOL__ #define __BYTEBOOL__ -// defines boolean and byte types usable in both c and c++ code +// bool is a C++ type +// if we are compiling for C, use an enum + // this header is not really meant for direct inclusion, // it is used by mathlib and cmdlib +#ifdef __cplusplus +typedef bool qboolean; +#define qtrue true +#define qfalse false +#else typedef enum { qfalse, qtrue } qboolean; +#endif + typedef unsigned char byte; #endif diff --git a/libs/bytestreamutils.cpp b/libs/bytestreamutils.cpp deleted file mode 100644 index f9b8ddca..00000000 --- a/libs/bytestreamutils.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "bytestreamutils.h" diff --git a/libs/bytestreamutils.h b/libs/bytestreamutils.h deleted file mode 100644 index aad7d7e4..00000000 --- a/libs/bytestreamutils.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BYTESTREAMUTILS_H) -#define INCLUDED_BYTESTREAMUTILS_H - -#if defined(__GNUC__) - -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 - -#define __USE_ISOC9X 1 -#define __USE_ISOC99 1 - -#include - -#endif - -#include - -// if C99 is unavailable, fall back to the types most likely to be the right sizes -#if !defined(int16_t) -typedef signed short int16_t; -#endif -#if !defined(uint16_t) -typedef unsigned short uint16_t; -#endif -#if !defined(int32_t) -typedef signed int int32_t; -#endif -#if !defined(uint32_t) -typedef unsigned int uint32_t; -#endif - - - - -template -inline void istream_read_little_endian(InputStreamType& istream, Type& value) -{ - istream.read(reinterpret_cast(&value), sizeof(Type)); -#if defined(__BIG_ENDIAN__) - std::reverse(reinterpret_cast(&value), reinterpret_cast(&value) + sizeof(Type)); -#endif -} - -template -inline void istream_read_big_endian(InputStreamType& istream, Type& value) -{ - istream.read(reinterpret_cast(&value), sizeof(Type)); -#if !defined(__BIG_ENDIAN__) - std::reverse(reinterpret_cast(&value), reinterpret_cast(&value) + sizeof(Type)); -#endif -} - -template -inline void istream_read_byte(InputStreamType& istream, typename InputStreamType::byte_type& b) -{ - istream.read(&b, 1); -} - - -template -inline int16_t istream_read_int16_le(InputStreamType& istream) -{ - int16_t value; - istream_read_little_endian(istream, value); - return value; -} - -template -inline uint16_t istream_read_uint16_le(InputStreamType& istream) -{ - uint16_t value; - istream_read_little_endian(istream, value); - return value; -} - -template -inline int32_t istream_read_int32_le(InputStreamType& istream) -{ - int32_t value; - istream_read_little_endian(istream, value); - return value; -} - -template -inline uint32_t istream_read_uint32_le(InputStreamType& istream) -{ - uint32_t value; - istream_read_little_endian(istream, value); - return value; -} - -template -inline float istream_read_float32_le(InputStreamType& istream) -{ - float value; - istream_read_little_endian(istream, value); - return value; -} - -template -inline typename InputStreamType::byte_type istream_read_byte(InputStreamType& istream) -{ - typename InputStreamType::byte_type b; - istream.read(&b, sizeof(typename InputStreamType::byte_type)); - return b; -} - -#endif diff --git a/libs/character.cpp b/libs/character.cpp deleted file mode 100644 index ab8969b6..00000000 --- a/libs/character.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "character.h" - diff --git a/libs/character.h b/libs/character.h deleted file mode 100644 index 1e6d3b16..00000000 --- a/libs/character.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CHARACTER_H) -#define INCLUDED_CHARACTER_H - -/// \file -/// \brief Character encoding. - -/// \brief Returns true if \p c is an ASCII character that can be represented with 7 bits. -inline bool char_is_ascii(char c) -{ - return (c & 0x80) == 0; -} - -/// \brief Returns true if \p string consists entirely of ASCII characters. -inline bool string_is_ascii(const char* string) -{ - while(*string != '\0') - { - if(!char_is_ascii(*string++)) - { - return false; - } - } - return true; -} - -#endif diff --git a/libs/cmdlib.h b/libs/cmdlib.h index ffeb4271..92d985ae 100644 --- a/libs/cmdlib.h +++ b/libs/cmdlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,8 +26,72 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef __CMDLIB__ #define __CMDLIB__ +#include +#include +#include +#include +#include #include +#include +#include +#ifdef _WIN32 + #define PATH_MAX 260 +#endif +// some easy portability crap +#ifdef _WIN32 + #include + #define Q_mkdir(a,b) _mkdir(a) +#else + #include + #define Q_mkdir(a,b) mkdir(a,b) +#endif + +#ifdef __cplusplus + typedef bool qboolean; +#endif + +// NOTE TTimo: is this worth anything? +#ifndef __BYTEBOOL__ +#define __BYTEBOOL__ + +#ifndef __cplusplus + typedef enum {false, true} boolean; +#else + typedef unsigned char boolean; +#endif + +typedef unsigned char byte; + +#endif // __BYTEBOOL__ + +void DefaultExtension( char *path, char *extension ); +void DefaultPath( char *path, char *basepath ); +void StripFilename( char *path ); +void StripExtension( char *path ); +void ExtractFilePath( const char *path, char *dest ); +void ExtractFileName( const char *path, char *dest ); +void ExtractFileBase( const char *path, char *dest ); +void ExtractFileExtension( const char *path, char *dest ); +/*! +\brief create all directories leading to a file path. if you pass a directory, terminate it with a '/' +*/ +void CreateDirectoryPath (const char *path); + +short BigShort (short l); +short LittleShort (short l); +int BigLong (int l); +int LittleLong (int l); +float BigFloat (float l); +float LittleFloat (float l); +void *qmalloc (size_t size); +void* qblockmalloc(size_t nSize); + +void ConvertDOSToUnixName( char *dst, const char *src ); +#ifdef __cplusplus + char* StrDup(char* pStr); +#endif +char* StrDup(const char* pStr); // TTimo started adding portability code: // return true if spawning was successful, false otherwise @@ -42,62 +106,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // return values; // if the spawn was fine // TODO TTimo add functionality to track the process until it dies - bool Q_Exec(const char *cmd, char *cmdline, const char *execdir, bool bCreateConsole); -// some easy portability crap - - -#define access_owner_read 0400 -#define access_owner_write 0200 -#define access_owner_execute 0100 -#define access_owner_rw_ 0600 -#define access_owner_r_x 0500 -#define access_owner__wx 0300 -#define access_owner_rwx 0700 - -#define access_group_read 0040 -#define access_group_write 0020 -#define access_group_execute 0010 -#define access_group_rw_ 0060 -#define access_group_r_x 0050 -#define access_group__wx 0030 -#define access_group_rwx 0070 - -#define access_others_read 0004 -#define access_others_write 0002 -#define access_others_execute 0001 -#define access_others_rw_ 0006 -#define access_others_r_x 0005 -#define access_others__wx 0003 -#define access_others_rwx 0007 - - -#define access_rwxrwxr_x (access_owner_rwx | access_group_rwx | access_others_r_x) -#define access_rwxrwxrwx (access_owner_rwx | access_group_rwx | access_others_rwx) - -// Q_mkdir -// returns true if succeeded in creating directory -#ifdef WIN32 -#include -inline bool Q_mkdir(const char* name) -{ - return _mkdir(name) != -1; -} -#else -#include -inline bool Q_mkdir(const char* name) -{ - return mkdir(name, access_rwxrwxr_x) != -1; -} -#endif - - -inline double Sys_DoubleTime(void) -{ - return clock()/ 1000.0; -} - - - #endif diff --git a/libs/cmdlib/cmdlib.cpp b/libs/cmdlib/cmdlib.cpp index a09ed9ea..8e904fa7 100644 --- a/libs/cmdlib/cmdlib.cpp +++ b/libs/cmdlib/cmdlib.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,19 +25,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "cmdlib.h" -#include -#include +#ifdef _WIN32 + #include +#endif +#if defined (__linux__) || defined (__APPLE__) + #include +#endif -#include "string/string.h" -#include "os/path.h" -#include "container/array.h" +// FIXME TTimo this should be cleaned up .. +// NOTE: we don't use this crap .. with the total mess of mixing win32/unix paths we need to recognize both '/' and '\\' +#define PATHSEPERATOR '/' - -#if defined (POSIX) - -#include - -bool Q_Exec(const char *cmd, char *cmdline, const char *, bool) +#if defined (__linux__) || defined (__APPLE__) +bool Q_Exec(const char *cmd, char *cmdline, const char *execdir, bool bCreateConsole) { char fullcmd[2048]; char *pCmd; @@ -78,11 +78,9 @@ bool Q_Exec(const char *cmd, char *cmdline, const char *, bool) } return true; } +#endif -#elif defined(WIN32) - -#include - +#ifdef _WIN32 // NOTE TTimo windows is VERY nitpicky about the syntax in CreateProcess bool Q_Exec(const char *cmd, char *cmdline, const char *execdir, bool bCreateConsole) { @@ -108,7 +106,6 @@ bool Q_Exec(const char *cmd, char *cmdline, const char *execdir, bool bCreateCon while (*pCmdline == ' ') pCmdline++; } - if (CreateProcess( pCmd, pCmdline, @@ -124,6 +121,376 @@ bool Q_Exec(const char *cmd, char *cmdline, const char *execdir, bool bCreateCon return true; return false; } - #endif +#define MEM_BLOCKSIZE 4096 +void* qblockmalloc(size_t nSize) +{ + void *b; + // round up to threshold + int nAllocSize = nSize % MEM_BLOCKSIZE; + if ( nAllocSize > 0) + { + nSize += MEM_BLOCKSIZE - nAllocSize; + } + b = malloc(nSize + 1); + memset (b, 0, nSize); + return b; +} + +//++timo NOTE: can be replaced by g_malloc0(nSize+1) when moving to glib memory handling +void* qmalloc (size_t nSize) +{ + void *b; + b = malloc(nSize + 1); + memset (b, 0, nSize); + return b; +} + +/* +================ +Q_filelength +================ +*/ +int Q_filelength (FILE *f) +{ + int pos; + int end; + + pos = ftell (f); + fseek (f, 0, SEEK_END); + end = ftell (f); + fseek (f, pos, SEEK_SET); + + return end; +} + +void DefaultExtension (char *path, char *extension) +{ + char *src; +// +// if path doesn't have a .EXT, append extension +// (extension should include the .) +// + src = path + strlen(path) - 1; + + while (*src != PATHSEPERATOR && src != path) + { + if (*src == '.') + return; // it has an extension + src--; + } + + strcat (path, extension); +} + +void DefaultPath (char *path, char *basepath) +{ + char temp[128]; + + if (path[0] == PATHSEPERATOR) + return; // absolute path location + strcpy (temp,path); + strcpy (path,basepath); + strcat (path,temp); +} + + +void StripFilename (char *path) +{ + int length; + + length = strlen(path)-1; + while (length > 0 && path[length] != PATHSEPERATOR) + length--; + path[length] = 0; +} + +void StripExtension (char *path) +{ + int length; + + length = strlen(path)-1; + while (length > 0 && path[length] != '.') + { + length--; + if (path[length] == '/') + return; // no extension + } + if (length) + path[length] = 0; +} + + +/* +==================== +Extract file parts +==================== +*/ +void ExtractFilePath (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a \ or the start +// + while (src != path && *(src-1) != '/' && *(src-1) != '\\') + src--; + + memcpy (dest, path, src-path); + dest[src-path] = 0; +} + +void ExtractFileName (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a \ or the start +// + while (src != path && *(src-1) != '/' + && *(src-1) != '\\' ) + src--; + + while (*src) + { + *dest++ = *src++; + } + *dest = 0; +} + +inline const char* path_get_filename_start(const char* path) +{ + { + const char* last_forward_slash = strrchr(path, '/'); + if(last_forward_slash != NULL) + return last_forward_slash + 1; + } + + { + const char* last_backward_slash = strrchr(path, '\\'); + if(last_backward_slash != NULL) + return last_backward_slash + 1; + } + + return path; +} + +inline unsigned int filename_get_base_length(const char* filename) +{ + const char* last_period = strrchr(filename, '.'); + return (last_period != NULL) ? last_period - filename : strlen(filename); +} + +void ExtractFileBase (const char *path, char *dest) +{ + const char* filename = path_get_filename_start(path); + unsigned int length = filename_get_base_length(filename); + strncpy(dest, filename, length); + dest[length] = '\0'; +} + +void ExtractFileExtension (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a . or the start +// + while (src != path && *(src-1) != '.') + src--; + if (src == path) + { + *dest = 0; // no extension + return; + } + + strcpy (dest,src); +} + + +void ConvertDOSToUnixName( char *dst, const char *src ) +{ + while ( *src ) + { + if ( *src == '\\' ) + *dst = '/'; + else + *dst = *src; + dst++; src++; + } + *dst = 0; +} + + +char* StrDup(char* pStr) +{ + if (pStr) + { + return strcpy(new char[strlen(pStr)+1], pStr); + } + return NULL; +} + +char* StrDup(const char* pStr) +{ + if (pStr) + { + return strcpy(new char[strlen(pStr)+1], pStr); + } + return NULL; +} + +void CreateDirectoryPath (const char *path) { + char base[PATH_MAX]; + char *src; + char back; + + ExtractFilePath(path, base); + + src = base+1; + while (1) { + while (*src != '\0' && *src != '/' && *src != '\\') { + src++; + } + if (*src == '\0') { + break; + } + back = *src; *src = '\0'; + Q_mkdir(base, 0755); + *src = back; src++; + } +} + +/* +============================================================================ + + BYTE ORDER FUNCTIONS + +============================================================================ +*/ + +#ifdef _SGI_SOURCE + #define __BIG_ENDIAN__ +#endif + +#ifdef __BIG_ENDIAN__ + +short LittleShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return(b1<<8) + b2; +} + +short BigShort (short l) +{ + return l; +} + + +int LittleLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int BigLong (int l) +{ + return l; +} + + +float LittleFloat (float l) +{ + union + { + byte b[4]; float f; + } in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float BigFloat (float l) +{ + return l; +} + +#else + +short BigShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return(b1<<8) + b2; +} + +short LittleShort (short l) +{ + return l; +} + + +int BigLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int LittleLong (int l) +{ + return l; +} + +float BigFloat (float l) +{ + union + { + byte b[4]; float f; + } in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float LittleFloat (float l) +{ + return l; +} + +#endif diff --git a/libs/cmdlib/cmdlib.vcproj b/libs/cmdlib/cmdlib.vcproj index 97f34755..2b390a09 100644 --- a/libs/cmdlib/cmdlib.vcproj +++ b/libs/cmdlib/cmdlib.vcproj @@ -1,172 +1,52 @@ - - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + diff --git a/libs/container/array.cpp b/libs/container/array.cpp deleted file mode 100644 index 378a2e76..00000000 --- a/libs/container/array.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "array.h" - -namespace -{ - class Bleh - { - Array m_array; - public: - Bleh() : m_array(16) - { - } - }; - - void testAutoArray() - { - Array array(32); - } -} \ No newline at end of file diff --git a/libs/container/array.h b/libs/container/array.h deleted file mode 100644 index de444fd8..00000000 --- a/libs/container/array.h +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_ARRAY_H) -#define INCLUDED_CONTAINER_ARRAY_H - -#include -#include - -#include "memory/allocator.h" - -/// \brief An array whose size is variable at run-time. -/// -/// - Resizing the array destroys all the existing elements and invalidates all iterators. -/// - Default-Constructible, Copyable, Assignable. -/// - Compatible with the containers and algorithms in the Standard Template Library (STL) - http://www.sgi.com/tech/stl/ -/// -/// \param Element The type to be stored in the array. Must provide a default-constructor and a copy-constructor. -/// \param Allocator A custom memory-allocator, conforming to the std::allocator interface. -template > -class Array : public Allocator -{ - std::size_t m_size; - Element* m_data; - - Element* construct(std::size_t size) - { -#if 1 - return New(*this).vector(size); -#else - return new Element[size]; -#endif - } - template - Element* construct(std::size_t size, const T1& value) - { - return New(*this).vector(size, value); - } - void destroy(Element* data, std::size_t size) - { -#if 1 - Delete(*this).vector(data, size); -#else - delete[] data; -#endif - } - -public: - typedef Element value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; - - Array() - : m_size(0), m_data(0) - { - } - Array(std::size_t size) - : m_size(size), m_data(construct(size)) - { - } - template - Array(std::size_t size, const T1& value) - : m_size(size), m_data(construct(size, value)) - { - } - Array(const Array& other) - : Allocator(other), m_size(other.size()), m_data(construct(m_size)) - { - std::copy(other.begin(), other.end(), begin()); - } - template - Array(Iterator start, Iterator finish) - : m_size(std::distance(start, finish)), m_data(construct(m_size)) - { - std::copy(start, finish, begin()); - } - ~Array() - { - destroy(m_data, m_size); - } - - Array& operator=(const Array& other) - { - if(other.size() == size()) - { - std::copy(other.begin(), other.end(), begin()); - } - else - { - Array temp(other); - temp.swap(*this); - } - return *this; - } - - void swap(Array& other) - { - std::swap(m_size, other.m_size); - std::swap(m_data, other.m_data); - } - - iterator begin() - { - return m_data; - } - const_iterator begin() const - { - return m_data; - } - iterator end() - { - return m_data + m_size; - } - const_iterator end() const - { - return m_data + m_size; - } - - value_type& operator[](std::size_t index) - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - const value_type& operator[](std::size_t index) const - { -#if defined(_DEBUG) - ASSERT_MESSAGE(index < size(), "array index out of bounds"); -#endif - return m_data[index]; - } - value_type* data() - { - return m_data; - } - const value_type* data() const - { - return m_data; - } - std::size_t size() const - { - return m_size; - } - bool empty() const - { - return m_size == 0; - } - - void resize(std::size_t count) - { - if(count != size()) - { - Array temp(count); - temp.swap(*this); - } - } - void resize(std::size_t count, const value_type& value) - { - if(count != size()) - { - Array temp(count, value); - temp.swap(*this); - } - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - template - inline void swap(Array& self, Array& other) - { - self.swap(other); - } -} - -#endif diff --git a/libs/container/cache.cpp b/libs/container/cache.cpp deleted file mode 100644 index a704287e..00000000 --- a/libs/container/cache.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "cache.h" diff --git a/libs/container/cache.h b/libs/container/cache.h deleted file mode 100644 index 8c594b88..00000000 --- a/libs/container/cache.h +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_CACHE_H) -#define INCLUDED_CONTAINER_CACHE_H - -#include -#include "container/hashtable.h" -#include "memory/allocator.h" - -template -class DefaultCreationPolicy -{ -public: - Type* construct(const Parameter& parameter) - { - return New().scalar(parameter); - } - void destroy(Type* p) - { - Delete().scalar(p); - } -}; - -template -class SharedValue -{ - typedef Type value_type; - typedef value_type* pointer; - typedef value_type& reference; - - std::size_t m_count; - pointer m_value; - -public: - SharedValue() - : m_count(0), m_value(0) - { - } - ~SharedValue() - { - ASSERT_MESSAGE(m_count == 0 , "destroying a referenced object\n"); - } - void set(pointer value) - { - m_value = value; - } - pointer get() - { - return m_value; - } - std::size_t increment() - { - return ++m_count; - } - std::size_t decrement() - { - ASSERT_MESSAGE(!empty(), "destroying a non-existent object\n"); - return --m_count; - } - std::size_t count() - { - return m_count; - } - bool empty() - { - return m_count == 0; - } - reference operator*() const - { - ASSERT_NOTNULL(m_value); - return *m_value; - } - pointer operator->() const - { - return &(operator*()); - } -}; - - - -/// \brief Caches values that are uniquely identified by a key. -/// -/// - Automatically removes objects that are no longer referenced. -/// -/// \param Key Uniquely identifies each element. -/// \param Cached The type to be cached. Must define a constructor that accepts \c Key. -/// \param CreationPolicy Must define 'Cached* construct(const Key&)' and 'void destroy(Cached*)'. The lifetime of the \c Key passed to 'construct' is guaranteed to be longer than the subsequent matched call to 'destroy'. -template, typename CreationPolicy = DefaultCreationPolicy > -class HashedCache : public CreationPolicy -{ - typedef SharedValue Element; - typedef HashTable map_type; - - map_type m_map; - -public: - explicit HashedCache(const CreationPolicy& creation = CreationPolicy()) - : CreationPolicy(creation), m_map(256) - { - } - ~HashedCache() - { - ASSERT_MESSAGE(empty(), "HashedCache::~HashedCache: not empty"); - } - - typedef typename map_type::iterator iterator; - typedef typename map_type::value_type value_type; - - iterator begin() - { - return m_map.begin(); - } - iterator end() - { - return m_map.end(); - } - - bool empty() const - { - return m_map.empty(); - } - - iterator find(const Key& key) - { - return m_map.find(key); - } - - void capture(iterator i) - { - (*i).value.increment(); - } - void release(iterator i) - { - if((*i).value.decrement() == 0) - { - CreationPolicy::destroy((*i).value.get()); - m_map.erase(i); - } - } - -#if 1 - Element& capture(const Key& key) - { -#if 0 - Element& elem = m_map[key]; - if(elem.increment() == 1) - { - elem.set(CreationPolicy::construct(key)); - } - return elem; -#else - iterator i = m_map.insert(key, Element()); - if((*i).value.increment() == 1) - { - (*i).value.set(CreationPolicy::construct((*i).key)); - } - return (*i).value; -#endif - } -#else - value_type& capture(const Key& key) - { - iterator i = m_map.find(key); - if(i == m_map.end()) - { - i = m_map.insert(key, Element()); - (*i).value.set(CreationPolicy::construct((*i).key)); - } - (*i).value.increment(); - return (*i); - } -#endif - void release(const Key& key) - { - iterator i = m_map.find(key); - ASSERT_MESSAGE(i != m_map.end(), "releasing a non-existent object\n"); - release(i); - } - - void clear() - { - m_map.clear(); - } -}; - - -#endif diff --git a/libs/container/container.cpp b/libs/container/container.cpp deleted file mode 100644 index 627e0c88..00000000 --- a/libs/container/container.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "container.h" - diff --git a/libs/container/container.h b/libs/container/container.h deleted file mode 100644 index b6d75841..00000000 --- a/libs/container/container.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_CONTAINER_H) -#define INCLUDED_CONTAINER_CONTAINER_H - -#include -#include - -#include "generic/static.h" - -/// \brief A single-value container, which can either be empty or full. -template -class Single -{ - Type* m_value; -public: - Single() : m_value(0) - { - } - bool empty() - { - return m_value == 0; - } - Type* insert(const Type& other) - { - m_value = new Type(other); - return m_value; - } - void clear() - { - delete m_value; - m_value = 0; - } - Type& get() - { - //ASSERT_MESSAGE(!empty(), "Single: must be initialised before being accessed"); - return *m_value; - } - const Type& get() const - { - //ASSERT_MESSAGE(!empty(), "Single: must be initialised before being accessed"); - return *m_value; - } -}; - - -/// \brief An adaptor to make std::list into a Unique Sequence - which cannot contain the same value more than once. -/// \param Value Uniquely identifies itself. Must provide a copy-constructor and an equality operator. -template -class UnsortedSet -{ - typedef typename std::list Values; - Values m_values; -public: - typedef typename Values::iterator iterator; - typedef typename Values::const_iterator const_iterator; - typedef typename Values::reverse_iterator reverse_iterator; - typedef typename Values::const_reverse_iterator const_reverse_iterator; - - iterator begin() - { - return m_values.begin(); - } - const_iterator begin() const - { - return m_values.begin(); - } - iterator end() - { - return m_values.end(); - } - const_iterator end() const - { - return m_values.end(); - } - reverse_iterator rbegin() - { - return m_values.rbegin(); - } - const_reverse_iterator rbegin() const - { - return m_values.rbegin(); - } - reverse_iterator rend() - { - return m_values.rend(); - } - const_reverse_iterator rend() const - { - return m_values.rend(); - } - - bool empty() const - { - return m_values.empty(); - } - std::size_t size() const - { - return m_values.size(); - } - void clear() - { - m_values.clear(); - } - - void swap(UnsortedSet& other) - { - std::swap(m_values, other.m_values); - } - iterator insert(const Value& value) - { - ASSERT_MESSAGE(find(value) == end(), "UnsortedSet::insert: already added"); - m_values.push_back(value); - return --end(); - } - void erase(const Value& value) - { - iterator i = find(value); - ASSERT_MESSAGE(i != end(), "UnsortedSet::erase: not found"); - m_values.erase(i); - } - iterator find(const Value& value) - { - return std::find(begin(), end(), value); - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - template - inline void swap(UnsortedSet& self, UnsortedSet& other) - { - self.swap(other); - } -} - -/// An adaptor to make std::list into a Unique Associative Sequence - which cannot contain the same value more than once. -/// Key: Uniquely identifies a value. Must provide a copy-constructor and an equality operator. -/// Value: Must provide a copy-constructor. -template -class UnsortedMap -{ - typedef typename std::list< std::pair > Values; - Values m_values; -public: - typedef typename Values::value_type value_type; - typedef typename Values::iterator iterator; - typedef typename Values::const_iterator const_iterator; - - iterator begin() - { - return m_values.begin(); - } - const_iterator begin() const - { - return m_values.begin(); - } - iterator end() - { - return m_values.end(); - } - const_iterator end() const - { - return m_values.end(); - } - - bool empty() const - { - return m_values.empty(); - } - std::size_t size() const - { - return m_values.size(); - } - void clear() - { - m_values.clear(); - } - - iterator insert(const value_type& value) - { - ASSERT_MESSAGE(find(value.first) == end(), "UnsortedMap::insert: already added"); - m_values.push_back(value); - return --m_values.end(); - } - void erase(const Key& key) - { - iterator i = find(key); - ASSERT_MESSAGE(i != end(), "UnsortedMap::erase: not found"); - erase(i); - } - void erase(iterator i) - { - m_values.erase(i); - } - iterator find(const Key& key) - { - for(iterator i = m_values.begin(); i != m_values.end(); ++i) - { - if((*i).first == key) - { - return i; - } - } - return m_values.end(); - } - const_iterator find(const Key& key) const - { - for(const_iterator i = m_values.begin(); i != m_values.end(); ++i) - { - if((*i).first == key) - { - return i; - } - } - return m_values.end(); - } - - Value& operator[](const Key& key) - { - iterator i = find(key); - if(i != end()) - { - return (*i).second; - } - - m_values.push_back(Values::value_type(key, Value())); - return m_values.back().second; - } -}; - -/// An adaptor to assert when duplicate values are added, or non-existent values removed from a std::set. -template -class UniqueSet -{ - typedef std::set Values; - Values m_values; -public: - typedef typename Values::iterator iterator; - typedef typename Values::const_iterator const_iterator; - typedef typename Values::reverse_iterator reverse_iterator; - typedef typename Values::const_reverse_iterator const_reverse_iterator; - - - iterator begin() - { - return m_values.begin(); - } - const_iterator begin() const - { - return m_values.begin(); - } - iterator end() - { - return m_values.end(); - } - const_iterator end() const - { - return m_values.end(); - } - reverse_iterator rbegin() - { - return m_values.rbegin(); - } - const_reverse_iterator rbegin() const - { - return m_values.rbegin(); - } - reverse_iterator rend() - { - return m_values.rend(); - } - const_reverse_iterator rend() const - { - return m_values.rend(); - } - - bool empty() const - { - return m_values.empty(); - } - std::size_t size() const - { - return m_values.size(); - } - void clear() - { - m_values.clear(); - } - - void swap(UniqueSet& other) - { - std::swap(m_values, other.m_values); - } - iterator insert(const Value& value) - { - std::pair result = m_values.insert(value); - ASSERT_MESSAGE(result.second, "UniqueSet::insert: already added"); - return result.first; - } - void erase(const Value& value) - { - iterator i = find(value); - ASSERT_MESSAGE(i != end(), "UniqueSet::erase: not found"); - m_values.erase(i); - } - iterator find(const Value& value) - { - return std::find(begin(), end(), value); - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - template - inline void swap(UniqueSet& self, UniqueSet& other) - { - self.swap(other); - } -} - -template -class ReferencePair -{ - Type* m_first; - Type* m_second; -public: - ReferencePair() : m_first(0), m_second(0) - { - } - void attach(Type& t) - { - ASSERT_MESSAGE(m_first == 0 || m_second == 0, "ReferencePair::insert: pointer already exists"); - if(m_first == 0) - { - m_first = &t; - } - else if(m_second == 0) - { - m_second = &t; - } - } - void detach(Type& t) - { - ASSERT_MESSAGE(m_first == &t || m_second == &t, "ReferencePair::erase: pointer not found"); - if(m_first == &t) - { - m_first = 0; - } - else if(m_second == &t) - { - m_second = 0; - } - } - template - void forEach(const Functor& functor) - { - if(m_second != 0) - { - functor(*m_second); - } - if(m_first != 0) - { - functor(*m_first); - } - } -}; - - -#endif diff --git a/libs/container/hashfunc.cpp b/libs/container/hashfunc.cpp deleted file mode 100644 index 20569cd1..00000000 --- a/libs/container/hashfunc.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "hashfunc.h" diff --git a/libs/container/hashfunc.h b/libs/container/hashfunc.h deleted file mode 100644 index a4ec5fee..00000000 --- a/libs/container/hashfunc.h +++ /dev/null @@ -1,434 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_HASHFUNC_H) -#define INCLUDED_CONTAINER_HASHFUNC_H - -#include -#include "string/string.h" -#include "container/array.h" -typedef unsigned long int ub4; /* unsigned 4-byte quantities */ -typedef unsigned char ub1; - -inline ub1 ub1_as_ub1_nocase(ub1 byte) -{ - return std::tolower(byte); -} - -inline ub4 ub1x4_as_ub4_nocase(const ub1 bytes[4]) -{ - ub4 result; - reinterpret_cast(&result)[0] = ub1_as_ub1_nocase(bytes[0]); - reinterpret_cast(&result)[1] = ub1_as_ub1_nocase(bytes[1]); - reinterpret_cast(&result)[2] = ub1_as_ub1_nocase(bytes[2]); - reinterpret_cast(&result)[3] = ub1_as_ub1_nocase(bytes[3]); - return result; -} - -class ub1_default_traits -{ -public: - static ub1 as_ub1(ub1 byte) - { - return byte; - } -}; - -class ub1_nocase_traits -{ -public: - static ub1 as_ub1(ub1 byte) - { - return ub1_as_ub1_nocase(byte); - } -}; - -class ub1x4_default_traits -{ -public: - static ub4 as_ub4(const ub1 bytes[4]) - { - return *reinterpret_cast(bytes); - } -}; - -class ub1x4_nocase_traits -{ -public: - static ub4 as_ub4(const ub1 bytes[4]) - { - return ub1x4_as_ub4_nocase(bytes); - } -}; - -class ub4_default_traits -{ -public: - static ub4 as_ub4(ub4 i) - { - return i; - } -}; - -class ub4_nocase_traits -{ -public: - static ub4 as_ub4(ub4 i) - { - return ub1x4_as_ub4_nocase(reinterpret_cast(&i)); - } -}; - -// lookup2.c -// By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this -// code any way you wish, private, educational, or commercial. It's free. - -#define hashsize(n) ((ub4)1<<(n)) -#define hashmask(n) (hashsize(n)-1) - -/* --------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. -For every delta with one or two bit set, and the deltas of all three - high bits or all three low bits, whether the original value of a,b,c - is almost all zero or is uniformly distributed, -* If mix() is run forward or backward, at least 32 bits in a,b,c - have at least 1/4 probability of changing. -* If mix() is run forward, every bit of c will change between 1/3 and - 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.) -mix() was built out of 36 single-cycle latency instructions in a - structure that could supported 2x parallelism, like so: - a -= b; - a -= c; x = (c>>13); - b -= c; a ^= x; - b -= a; x = (a<<8); - c -= a; b ^= x; - c -= b; x = (b>>13); - ... - Unfortunately, superscalar Pentiums and Sparcs can't take advantage - of that parallelism. They've also turned some of those single-cycle - latency instructions into multi-cycle latency instructions. Still, - this is the fastest good hash I could find. There were about 2^^68 - to choose from. I only looked at a billion or so. --------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= b; a -= c; a ^= (c>>13); \ - b -= c; b -= a; b ^= (a<<8); \ - c -= a; c -= b; c ^= (b>>13); \ - a -= b; a -= c; a ^= (c>>12); \ - b -= c; b -= a; b ^= (a<<16); \ - c -= a; c -= b; c ^= (b>>5); \ - a -= b; a -= c; a ^= (c>>3); \ - b -= c; b -= a; b ^= (a<<10); \ - c -= a; c -= b; c ^= (b>>15); \ -} - -/* same, but slower, works on systems that might have 8 byte ub4's */ -#define mix2(a,b,c) \ -{ \ - a -= b; a -= c; a ^= (c>>13); \ - b -= c; b -= a; b ^= (a<< 8); \ - c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \ - a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \ - b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \ - c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \ - a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \ - b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \ - c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \ -} - -/* --------------------------------------------------------------------- -hash() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - len : the length of the key, counting by bytes - level : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Every 1-bit and 2-bit delta achieves avalanche. -About 36+6len instructions. - -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (ub1 **)k, do it like this: - for (i=0, h=0; i -inline ub4 hash( -const ub1 *k, /* the key */ -ub4 length, /* the length of the key */ -ub4 initval, /* the previous hash, or an arbitrary value */ -const UB1Traits& ub1traits, -const UB4x1Traits& ub4x1traits -) -{ - register ub4 a,b,c,len; - - /* Set up the internal state */ - len = length; - a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ - c = initval; /* the previous hash value */ - - /*---------------------------------------- handle most of the key */ - while (len >= 12) - { - a += (k[0] +((ub4)UB1Traits::as_ub1(k[1])<<8) +((ub4)UB1Traits::as_ub1(k[2])<<16) +((ub4)UB1Traits::as_ub1(k[3])<<24)); - b += (k[4] +((ub4)UB1Traits::as_ub1(k[5])<<8) +((ub4)UB1Traits::as_ub1(k[6])<<16) +((ub4)UB1Traits::as_ub1(k[7])<<24)); - c += (k[8] +((ub4)UB1Traits::as_ub1(k[9])<<8) +((ub4)UB1Traits::as_ub1(k[10])<<16)+((ub4)UB1Traits::as_ub1(k[11])<<24)); - mix(a,b,c); - k += 12; len -= 12; - } - - /*------------------------------------- handle the last 11 bytes */ - c += length; - switch(len) /* all the case statements fall through */ - { - case 11: c += ((ub4)UB1Traits::as_ub1(k[10]) << 24); - case 10: c += ((ub4)UB1Traits::as_ub1(k[9]) << 16); - case 9 : c += ((ub4)UB1Traits::as_ub1(k[8]) << 8); - /* the first byte of c is reserved for the length */ - case 8 : b += ((ub4)UB1Traits::as_ub1(k[7]) << 24); - case 7 : b += ((ub4)UB1Traits::as_ub1(k[6]) << 16); - case 6 : b += ((ub4)UB1Traits::as_ub1(k[5]) << 8); - case 5 : b += UB1Traits::as_ub1(k[4]); - case 4 : a += ((ub4)UB1Traits::as_ub1(k[3]) << 24); - case 3 : a += ((ub4)UB1Traits::as_ub1(k[2]) << 16); - case 2 : a += ((ub4)UB1Traits::as_ub1(k[1]) << 8); - case 1 : a += UB1Traits::as_ub1(k[0]); - /* case 0: nothing left to add */ - } - mix(a,b,c); - /*-------------------------------------------- report the result */ - return c; -} - -/* --------------------------------------------------------------------- - This works on all machines. hash2() is identical to hash() on - little-endian machines, except that the length has to be measured - in ub4s instead of bytes. It is much faster than hash(). It - requires - -- that the key be an array of ub4's, and - -- that all your machines have the same endianness, and - -- that the length be the number of ub4's in the key --------------------------------------------------------------------- -*/ -template -inline ub4 hash2( -const ub4 *k, /* the key */ -ub4 length, /* the length of the key, in ub4s */ -ub4 initval, /* the previous hash, or an arbitrary value */ -const UB4Traits& ub4traits -) -{ - register ub4 a,b,c,len; - - /* Set up the internal state */ - len = length; - a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ - c = initval; /* the previous hash value */ - - /*---------------------------------------- handle most of the key */ - while (len >= 3) - { - a += UB4Traits::as_ub4(k[0]); - b += UB4Traits::as_ub4(k[1]); - c += UB4Traits::as_ub4(k[2]); - mix(a,b,c); - k += 3; len -= 3; - } - - /*-------------------------------------- handle the last 2 ub4's */ - c += length; - switch(len) /* all the case statements fall through */ - { - /* c is reserved for the length */ - case 2 : b += UB4Traits::as_ub4(k[1]); - case 1 : a += UB4Traits::as_ub4(k[0]); - /* case 0: nothing left to add */ - } - mix(a,b,c); - /*-------------------------------------------- report the result */ - return c; -} - -typedef ub4 hash_t; - -inline hash_t hash_ub1(const ub1* key, std::size_t len, hash_t previous = 0) -{ - return hash(key, ub4(len), previous, ub1_default_traits(), ub1x4_default_traits()); -} - -inline hash_t hash_ub1_nocase(const ub1* key, std::size_t len, hash_t previous = 0) -{ - return hash(key, ub4(len), previous, ub1_nocase_traits(), ub1x4_nocase_traits()); -} - -template -inline hash_t hash_ub4(const ub4* key, std::size_t len, const UB4Traits& traits, hash_t previous = 0) -{ - return hash2(key,ub4(len), previous, traits); -} - -inline ub4 hash_combine(ub4 left, ub4 right) -{ - return hash_ub1(reinterpret_cast(&left), 4, right); -} - -template -inline hash_t pod_hash(const POD& pod) -{ - return hash_ub1(reinterpret_cast(&pod), sizeof(POD)); -} - -inline hash_t string_hash(const char* string, hash_t previous = 0) -{ - return hash_ub1(reinterpret_cast(string), string_length(string), previous); -} - -inline hash_t string_hash_nocase(const char* string, hash_t previous = 0) -{ - return hash_ub1_nocase(reinterpret_cast(string), string_length(string), previous); -} - -struct RawStringHash -{ - typedef hash_t hash_type; - hash_type operator()(const char* string) const - { - return string_hash(string); - } -}; - -struct HashString -{ - typedef hash_t hash_type; - hash_type operator()(const CopiedString& string) const - { - return string_hash(string.c_str()); - } -}; - -struct HashStringNoCase -{ - typedef hash_t hash_type; - hash_type operator()(const CopiedString& string) const - { - return string_hash_nocase(string.c_str()); - } -}; - -/// \brief Length of a string in ub4. -/// "wibble" (6) gives 2, -/// "and" (3) gives 1, -/// "bleh" (4) gives 2 -inline std::size_t string_length_ub4(const char* string) -{ - return ((string_length(string)>>2)+1)<<2; -} - -/// \brief Hashable key type that stores a string as an array of ub4 - making hashing faster. -/// Also caches the 32-bit result of the hash to speed up comparison of keys. -template -class HashKey -{ - Array m_key; - hash_t m_hash; - - void copy(const HashKey& other) - { - std::copy(other.m_key.begin(), other.m_key.end(), m_key.begin()); - m_hash = other.m_hash; - } - void copy(const char* string) - { - strncpy(reinterpret_cast(m_key.data()), string, m_key.size()); - for(Array::iterator i = m_key.begin(); i != m_key.end(); ++i) - { - *i = UB4Traits::as_ub4(*i); - } - m_hash = hash_ub4(m_key.data(), m_key.size(), ub4_default_traits()); - } - bool equal(const HashKey& other) const - { - return m_hash == other.m_hash && m_key.size() == other.m_key.size() - && std::equal(m_key.begin(), m_key.end(), other.m_key.begin()); - } - -public: - HashKey(const HashKey& other) : m_key(other.m_key.size()) - { - copy(other); - } - HashKey(const char* string) : m_key(string_length_ub4(string)) - { - copy(string); - } - HashKey& operator=(const char* string) - { - m_key.resize(string_length_ub4(string)); - copy(string); - return *this; - } - bool operator==(const HashKey& other) const - { - return equal(other); - } - bool operator!=(const HashKey& other) const - { - return !equal(other); - } - hash_t hash() const - { - return m_hash; - } -#if 0 - const char* c_str() const - { - return reinterpret_cast(m_key.data()); - } -#endif -}; - -/// \brief Hash function to use with HashKey. -struct HashKeyHasher -{ - typedef hash_t hash_type; - hash_type operator()(const HashKey& key) const - { - return key.hash(); - } -}; - - - -#endif diff --git a/libs/container/hashtable.cpp b/libs/container/hashtable.cpp deleted file mode 100644 index e4d02c93..00000000 --- a/libs/container/hashtable.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "hashtable.h" - -#if defined(_DEBUG) || defined(DOXYGEN) - -#include "hashfunc.h" - -namespace ExampleHashTable -{ - void testStuff() - { - // HashTable example - typedef HashTable MyHashTable; - MyHashTable hashtable; - hashtable["bleh"] = 5; - hashtable.insert("blah", 17); - hashtable["foo"] = 99; - hashtable.insert("bar", 23); - - int bleh = (*hashtable.find("bleh")).value; // 5 - int blah = hashtable["blah"]; // 17 - hashtable.erase("foo"); - MyHashTable::iterator barIter = hashtable.find("bar"); - hashtable.erase(barIter); - - for(MyHashTable::iterator i = hashtable.begin(); i != hashtable.end(); ++i) - { - if((*i).key != "bleh") - { - ++hashtable["count"]; // insertion does not invalidate iterators - } - } - // end example - } - - struct Always - { - Always() - { - testStuff(); - } - } always; -} - -#endif diff --git a/libs/container/hashtable.h b/libs/container/hashtable.h deleted file mode 100644 index 88d672cf..00000000 --- a/libs/container/hashtable.h +++ /dev/null @@ -1,474 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_HASHTABLE_H) -#define INCLUDED_CONTAINER_HASHTABLE_H - -#include -#include -#include -#include "debugging/debugging.h" - - -namespace HashTableDetail -{ - inline std::size_t next_power_of_two(std::size_t size) - { - std::size_t result = 1; - while(result < size) - { - result <<= 1; - } - return result; - } - - struct BucketNodeBase - { - BucketNodeBase* next; - BucketNodeBase* prev; - }; - - inline void list_initialise(BucketNodeBase& self) - { - self.next = self.prev = &self; - } - - inline void list_swap(BucketNodeBase& self, BucketNodeBase& other) - { - BucketNodeBase tmp(self); - if(other.next == &other) - { - list_initialise(self); - } - else - { - self = other; - self.next->prev = self.prev->next = &self; - } - if(tmp.next == &self) - { - list_initialise(other); - } - else - { - other = tmp; - other.next->prev = other.prev->next = &other; - } - } - - inline void node_link(BucketNodeBase* node, BucketNodeBase* next) - { - node->next = next; - node->prev = next->prev; - next->prev = node; - node->prev->next = node; - } - inline void node_unlink(BucketNodeBase* node) - { - node->prev->next = node->next; - node->next->prev = node->prev; - } - - template - struct KeyValue - { - const Key key; - Value value; - - KeyValue(const Key& key_, const Value& value_) - : key(key_), value(value_) - { - } - }; - - template - struct BucketNode : public BucketNodeBase - { - Hash m_hash; - KeyValue m_value; - - BucketNode(Hash hash, const Key& key, const Value& value) - : m_hash(hash), m_value(key, value) - { - } - BucketNode* getNext() const - { - return static_cast(next); - } - BucketNode* getPrev() const - { - return static_cast(prev); - } - }; - - template - class BucketIterator - { - typedef BucketNode Node; - Node* m_node; - - void increment() - { - m_node = m_node->getNext(); - } - - public: - typedef std::forward_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; - typedef difference_type distance_type; - typedef KeyValue value_type; - typedef value_type* pointer; - typedef value_type& reference; - - BucketIterator(Node* node) : m_node(node) - { - } - - Node* node() - { - return m_node; - } - - bool operator==(const BucketIterator& other) const - { - return m_node == other.m_node; - } - bool operator!=(const BucketIterator& other) const - { - return !operator==(other); - } - BucketIterator& operator++() - { - increment(); - return *this; - } - BucketIterator operator++(int) - { - BucketIterator tmp = *this; - increment(); - return tmp; - } - value_type& operator*() const - { - return m_node->m_value; - } - value_type* operator->() const - { - return &(operator*()); - } - }; -} - - -/// A hash-table container which maps keys to values. -/// -/// - Inserting or removing elements does not invalidate iterators. -/// - Inserting or retrieving an element for a given key takes O(1) time on average. -/// - Elements are stored in no particular order. -/// -/// \param Key Uniquely identifies a value. Must provide a copy-constructor. -/// \param Value The value to be stored . Must provide a default-constructor and a copy-constructor. -/// \param Hasher Must provide 'std::size_t operator()(const Key&) const' which always returns the same result if the same argument is given. -/// \param KeyEqual Must provide 'bool operator==(const Key&, const Key&) const' which returns true only if both arguments are equal. -/// -/// \dontinclude container/hashtable.cpp -/// \skipline HashTable example -/// \until end example -template > -class HashTable : private KeyEqual, private Hasher -{ - typedef typename Hasher::hash_type hash_type; - typedef HashTableDetail::KeyValue KeyValue; - typedef HashTableDetail::BucketNode BucketNode; - - inline BucketNode* node_create(hash_type hash, const Key& key, const Value& value) - { - return new BucketNode(hash, key, value); - } - inline void node_destroy(BucketNode* node) - { - delete node; - } - - typedef BucketNode* Bucket; - - static Bucket* buckets_new(std::size_t count) - { - Bucket* buckets = new Bucket[count]; - std::uninitialized_fill(buckets, buckets + count, Bucket(0)); - return buckets; - } - static void buckets_delete(Bucket* buckets) - { - delete[] buckets; - } - - std::size_t m_bucketCount; - Bucket* m_buckets; - std::size_t m_size; - HashTableDetail::BucketNodeBase m_list; - - BucketNode* getFirst() - { - return static_cast(m_list.next); - } - BucketNode* getLast() - { - return static_cast(&m_list); - } - -public: - - typedef KeyValue value_type; - typedef HashTableDetail::BucketIterator iterator; - -private: - - void initialise() - { - list_initialise(m_list); - } - hash_type hashKey(const Key& key) - { - return Hasher::operator()(key); - } - - std::size_t getBucketId(hash_type hash) const - { - return hash & (m_bucketCount - 1); - } - Bucket& getBucket(hash_type hash) - { - return m_buckets[getBucketId(hash)]; - } - BucketNode* bucket_find(Bucket bucket, hash_type hash, const Key& key) - { - std::size_t bucketId = getBucketId(hash); - for(iterator i(bucket); i != end(); ++i) - { - hash_type nodeHash = i.node()->m_hash; - - if(getBucketId(nodeHash) != bucketId) - { - return 0; - } - - if(nodeHash == hash && KeyEqual::operator()((*i).key, key)) - { - return i.node(); - } - } - return 0; - } - BucketNode* bucket_insert(Bucket& bucket, BucketNode* node) - { - // link node into list - node_link(node, bucket_next(bucket)); - bucket = node; - return node; - } - BucketNode* bucket_next(Bucket& bucket) - { - Bucket* end = m_buckets + m_bucketCount; - for(Bucket* i = &bucket; i != end; ++i) - { - if(*i != 0) - { - return *i; - } - } - return getLast(); - } - - void buckets_resize(std::size_t count) - { - BucketNode* first = getFirst(); - BucketNode* last = getLast(); - - buckets_delete(m_buckets); - - m_bucketCount = count; - - m_buckets = buckets_new(m_bucketCount); - initialise(); - - for(BucketNode* i = first; i != last;) - { - BucketNode* node = i; - i = i->getNext(); - bucket_insert(getBucket((*node).m_hash), node); - } - } - void size_increment() - { - if(m_size == m_bucketCount) - { - buckets_resize(m_bucketCount == 0 ? 8 : m_bucketCount << 1); - } - ++m_size; - } - void size_decrement() - { - --m_size; - } - - HashTable(const HashTable& other); - HashTable& operator=(const HashTable& other); -public: - HashTable() : m_bucketCount(0), m_buckets(0), m_size(0) - { - initialise(); - } - HashTable(std::size_t bucketCount) : m_bucketCount(HashTableDetail::next_power_of_two(bucketCount)), m_buckets(buckets_new(m_bucketCount)), m_size(0) - { - initialise(); - } - ~HashTable() - { - for(BucketNode* i = getFirst(); i != getLast();) - { - BucketNode* node = i; - i = i->getNext(); - node_destroy(node); - } - buckets_delete(m_buckets); - } - - iterator begin() - { - return iterator(getFirst()); - } - iterator end() - { - return iterator(getLast()); - } - - bool empty() const - { - return m_size == 0; - } - std::size_t size() const - { - return m_size; - } - - /// \brief Returns an iterator pointing to the value associated with \p key if it is contained by the hash-table, else \c end(). - iterator find(const Key& key) - { - hash_type hash = hashKey(key); - if(m_bucketCount != 0) - { - Bucket bucket = getBucket(hash); - if(bucket != 0) - { - BucketNode* node = bucket_find(bucket, hash, key); - if(node != 0) - { - return iterator(node); - } - } - } - - return end(); - } - /// \brief Adds \p value to the hash-table associated with \p key if it does not exist. - iterator insert(const Key& key, const Value& value) - { - hash_type hash = hashKey(key); - if(m_bucketCount != 0) - { - Bucket& bucket = getBucket(hash); - if(bucket != 0) - { - BucketNode* node = bucket_find(bucket, hash, key); - if(node != 0) - { - return iterator(node); - } - } - } - - size_increment(); - return iterator(bucket_insert(getBucket(hash), node_create(hash, key, value))); - } - - /// \brief Removes the value pointed to by \p i from the hash-table. - /// - /// \p i must be a deferenceable iterator into the hash-table. - void erase(iterator i) - { - Bucket& bucket = getBucket(i.node()->m_hash); - BucketNode* node = i.node(); - - // if this was the last node in the bucket - if(bucket == node) - { - bucket = (node->getNext() == getLast() || &getBucket(node->getNext()->m_hash) != &bucket) ? 0 : node->getNext(); - } - - node_unlink(node); - ASSERT_MESSAGE(node != 0, "tried to erase a non-existent key/value"); - node_destroy(node); - - size_decrement(); - } - - /// \brief Returns the value identified by \p key if it is contained by the hash-table, else inserts and returns a new default-constructed value associated with \p key. - Value& operator[](const Key& key) - { - hash_type hash = hashKey(key); - if(m_bucketCount != 0) - { - Bucket& bucket = getBucket(hash); - if(bucket != 0) - { - BucketNode* node = bucket_find(bucket, hash, key); - if(node != 0) - { - return node->m_value.value; - } - } - } - size_increment(); - return bucket_insert(getBucket(hash), node_create(hash, key, Value()))->m_value.value; - } - /// \brief Removes the value associated with \p key from the hash-table. - void erase(const Key& key) - { - erase(find(key)); - } - /// \brief Swaps the contents of the hash-table with \p other. - void swap(HashTable& other) - { - std::swap(m_buckets, other.m_buckets); - std::swap(m_bucketCount, other.m_bucketCount); - std::swap(m_size, other.m_size); - HashTableDetail::list_swap(m_list, other.m_list); - } - /// \brief Removes all values from the hash-table. - void clear() - { - HashTable tmp; - tmp.swap(*this); - } -}; - -#endif diff --git a/libs/container/stack.cpp b/libs/container/stack.cpp deleted file mode 100644 index 3a7c7ce2..00000000 --- a/libs/container/stack.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "stack.h" - diff --git a/libs/container/stack.h b/libs/container/stack.h deleted file mode 100644 index d83674c3..00000000 --- a/libs/container/stack.h +++ /dev/null @@ -1,239 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONTAINER_STACK_H) -#define INCLUDED_CONTAINER_STACK_H - -#include "memory/allocator.h" -#include - -/// \brief A stack whose storage capacity is variable at run-time. Similar to std::vector. -/// -/// - Pushing or popping elements is a constant-time operation (on average). -/// - The storage capacity of the stack will grow when a new element is added beyond the current capacity. Iterators are invalidated when the storage capacity grows. -/// - DefaultConstructible, Copyable, Assignable. -/// - Compatible with the containers and algorithms in the Standard Template Library (STL) - http://www.sgi.com/tech/stl/ -/// -/// \param Type: The type to be stored in the stack. Must provide a copy-constructor. -template -class Stack : public DefaultAllocator -{ - typedef DefaultAllocator Allocator; - - enum - { - DEFAULT_CAPACITY = 4, - }; - - typedef Type* pointer; - typedef const Type* const_pointer; - -public: - typedef const_pointer const_iterator; -private: - - pointer m_data; - pointer m_end; - std::size_t m_capacity; - - - void insert(const Type& value) - { - Allocator::construct(m_end++, value); - } - void insert_overflow(const Type& value) - { - const std::size_t new_capacity = (m_capacity) ? m_capacity + m_capacity : std::size_t(DEFAULT_CAPACITY); - const pointer new_data = Allocator::allocate(new_capacity); - const pointer new_end = std::copy(m_data, m_end, new_data); - - destroy(); - Allocator::deallocate(m_data, m_capacity); - - m_capacity = new_capacity; - m_data = new_data; - m_end = new_end; - insert(value); - } - void destroy() - { - for(pointer p = m_data; p != m_end; ++p) - { - Allocator::destroy(p); - } - } - void construct(const Stack& other) - { - pointer p = m_data; - for(const_iterator i = other.begin(); i != other.end(); ++i) - { - Allocator::construct(p++, *i); - } - } - -public: - - Stack() : - m_data(0), - m_end(0), - m_capacity(0) - { - } - Stack(const Type& value) : - m_data(0), - m_end(0), - m_capacity(0) - { - push(value); - } - Stack(const Stack& other) : - DefaultAllocator(other) - { - m_capacity = other.m_capacity; - m_data = Allocator::allocate(m_capacity); - construct(other); - m_end = m_data + other.size(); - } - ~Stack() - { - destroy(); - Allocator::deallocate(m_data, m_capacity); - } - - const_iterator begin() const - { - return m_data; - } - const_iterator end() const - { - return m_end; - } - - bool empty() const - { - return end() == begin(); - } - void clear() - { - destroy(); - m_end = m_data; - } - - std::size_t size() const - { - return m_end - m_data; - } - Type operator[](const std::size_t i) const - { - return m_data[i]; - } - /// \brief Pushes \p value onto the stack at the top element. If reserved storage is insufficient for the new element, this will invalidate all iterators. - void push(const Type& value) - { - if(size() == m_capacity) - { - insert_overflow(value); - } - else - { - insert(value); - } - } - /// \brief Removes the top element of the stack. - void pop() - { - Allocator::destroy(--m_end); - } - /// \brief Returns the top element of the mutable stack. - Type& top() - { - return *(m_end-1); - } - /// \brief Returns the top element of the non-mutable stack. - const Type& top() const - { - return *(m_end-1); - } - /// \brief Returns the element below the top element of the mutable stack. - Type& parent() - { - return *(m_end-2); - } - /// \brief Returns the element below the top element of the non-mutable stack. - const Type& parent() const - { - return *(m_end-2); - } - /// \brief Swaps the values of this stack and \p other. - void swap(Stack& other) - { - std::swap(m_data, other.m_data); - std::swap(m_end, other.m_end); - std::swap(m_capacity, other.m_capacity); - } -#if 1 // use copy-swap technique - Stack& operator=(const Stack& other) - { - Stack temp(other); - temp.swap(*this); - return *this; - } -#else // avoids memory allocation if capacity is already sufficient. - Stack& operator=(const Stack& other) - { - if(&other != this) - { - destroy(); - - if(other.size() > m_capacity) - { - Allocator::deallocate(m_data, m_capacity); - m_capacity = other.m_capacity; - m_data = Allocator::allocate(m_capacity); - } - m_end = m_data + other.size(); - - construct(other); - } - return *this; - } -#endif -}; - -/// \brief Returns true if \p self is lexicographically less than \p other. -template -inline bool operator<(const Stack& self, const Stack& other) -{ - return std::lexicographical_compare(self.begin(), self.end(), other.begin(), other.end()); -} - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap(). - template - inline void swap(Stack& self, Stack& other) - { - self.swap(other); - } -} - -#endif diff --git a/libs/convert.cpp b/libs/convert.cpp deleted file mode 100644 index 0e73aef7..00000000 --- a/libs/convert.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "convert.h" - diff --git a/libs/convert.h b/libs/convert.h deleted file mode 100644 index f7f4f992..00000000 --- a/libs/convert.h +++ /dev/null @@ -1,305 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONVERT_H) -#define INCLUDED_CONVERT_H - -/// \file -/// \brief Character encoding conversion. - -#include "debugging/debugging.h" -#include -#include -#include - -#include "character.h" - -/// \brief Returns the number of bytes required to represent \p character in UTF-8 encoding. -inline std::size_t utf8_character_length(const char* character) -{ - if((*character & 0xE0) == 0xC0) // 110xxxxx - { - return 2; - } - else if((*character & 0xF0) == 0xE0) // 1110xxxx - { - return 3; - } - else if((*character & 0xF8) == 0xF0) // 11110xxx - { - return 4; - } - else if((*character & 0xFC) == 0xF8) // 111110xx - { - return 5; - } - else if((*character & 0xFE) == 0xFC) // 1111110x - { - return 6; - } - ERROR_MESSAGE(""); - return 0; -} - -struct UTF8Character -{ - const char* buffer; - std::size_t length; - UTF8Character() : buffer(0), length(0) - { - } - UTF8Character(const char* bytes) : buffer(bytes), length(utf8_character_length(bytes)) - { - } -}; - -inline bool operator<(const UTF8Character& self, const UTF8Character& other) -{ - return std::lexicographical_compare(self.buffer, self.buffer + self.length, other.buffer, other.buffer + other.length); -} - -/// \brief Writes \p c to \p ostream in Hex form. Useful for debugging. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const UTF8Character& c) -{ - for(const char* p = c.buffer; p != c.buffer + c.length; ++p) - { - ostream << HexChar(*p); - } - return ostream; -} - - - -/// \brief The character-set encoding for the current C locale. -/// -/// Obtain the global instance with globalCharacterSet(). -class CharacterSet -{ - const char* m_charSet; -public: - CharacterSet() - { - if(g_get_charset(&m_charSet) != FALSE) - { - m_charSet = 0; - } - } - bool isUTF8() const - { - return m_charSet == 0; - } - const char* get() const - { - return m_charSet; - } -}; - -typedef LazyStatic GlobalCharacterSet; - -/// \brief Returns the global instance of CharacterSet. -inline CharacterSet& globalCharacterSet() -{ - return GlobalCharacterSet::instance(); -} - - -class UTF8CharacterToExtendedASCII -{ -public: - UTF8Character m_utf8; - char m_c; - UTF8CharacterToExtendedASCII() : m_c('\0') - { - } - UTF8CharacterToExtendedASCII(const UTF8Character& utf8, char c) : m_utf8(utf8), m_c(c) - { - } -}; - -inline bool operator<(const UTF8CharacterToExtendedASCII& self, const UTF8CharacterToExtendedASCII& other) -{ - return self.m_utf8 < other.m_utf8; -} - -inline std::size_t extended_ascii_to_index(char c) -{ - return static_cast(c & 0x7F); -} - -inline char extended_ascii_for_index(std::size_t i) -{ - return static_cast(i | 0x80); -} - -/// \brief The active extended-ascii character set encoding. -/// Performs UTF-8 encoding and decoding of extended-ascii characters. -/// -/// Obtain the global instance with globalExtendedASCIICharacterSet(). -class ExtendedASCIICharacterSet -{ - typedef char UTF8CharBuffer[6]; - UTF8CharBuffer m_converted[128]; - UTF8Character m_decodeMap[128]; - UTF8CharacterToExtendedASCII m_encodeMap[128]; -public: - ExtendedASCIICharacterSet() - { - if(!globalCharacterSet().isUTF8()) - { - GIConv descriptor = g_iconv_open("UTF-8", globalCharacterSet().get()); - for(std::size_t i = 1; i < 128; ++i) - { - char c = extended_ascii_for_index(i); - char* inbuf = &c; - std::size_t inbytesleft = 1; - char* outbuf = m_converted[i]; - std::size_t outbytesleft = 6; - if(g_iconv(descriptor, &inbuf, &inbytesleft, &outbuf, &outbytesleft) != (size_t)(-1)) - { - UTF8Character utf8(m_converted[i]); - m_decodeMap[i] = utf8; - m_encodeMap[i] = UTF8CharacterToExtendedASCII(utf8, c); - } - } - g_iconv_close(descriptor); - std::sort(m_encodeMap, m_encodeMap + 128); - } - } - /// \brief Prints the (up to) 128 characters in the current extended-ascii character set. - /// Useful for debugging. - void print() const - { - globalOutputStream() << "UTF-8 conversion required from charset: " << globalCharacterSet().get() << "\n"; - for(std::size_t i = 1; i < 128; ++i) - { - if(m_decodeMap[i].buffer != 0) - { - globalOutputStream() << extended_ascii_for_index(i) << " = " << m_decodeMap[i] << "\n"; - } - } - } - /// \brief Returns \p c decoded from extended-ascii to UTF-8. - /// \p c must be an extended-ascii character. - const UTF8Character& decode(char c) const - { - ASSERT_MESSAGE(!globalCharacterSet().isUTF8(), "locale is utf8, no conversion required"); - ASSERT_MESSAGE(!char_is_ascii(c), "decode: ascii character"); - ASSERT_MESSAGE(m_decodeMap[extended_ascii_to_index(c)].buffer != 0, "decode: invalid character: " << HexChar(c)); - return m_decodeMap[extended_ascii_to_index(c)]; - } - /// \brief Returns \p c encoded to extended-ascii from UTF-8. - /// \p c must map to an extended-ascii character. - char encode(const UTF8Character& c) const - { - ASSERT_MESSAGE(!globalCharacterSet().isUTF8(), "locale is utf8, no conversion required"); - ASSERT_MESSAGE(!char_is_ascii(*c.buffer), "encode: ascii character"); - std::pair range - = std::equal_range(m_encodeMap, m_encodeMap + 128, UTF8CharacterToExtendedASCII(c, 0)); - ASSERT_MESSAGE(range.first != range.second, "encode: invalid character: " << c); - return (*range.first).m_c; - } -}; - -typedef LazyStatic GlobalExtendedASCIICharacterSet; - -/// \brief Returns the global instance of ExtendedASCIICharacterSet. -inline ExtendedASCIICharacterSet& globalExtendedASCIICharacterSet() -{ - return GlobalExtendedASCIICharacterSet::instance(); -} - -class ConvertUTF8ToLocale -{ -public: - StringRange m_range; - ConvertUTF8ToLocale(const char* string) : m_range(StringRange(string, string + strlen(string))) - { - } - ConvertUTF8ToLocale(const StringRange& range) : m_range(range) - { - } -}; - -/// \brief Writes \p convert to \p ostream after encoding each character to extended-ascii from UTF-8. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const ConvertUTF8ToLocale& convert) -{ - if(globalCharacterSet().isUTF8()) - { - return ostream << convert.m_range; - } - - for(const char* p = convert.m_range.first; p != convert.m_range.last;) - { - if(!char_is_ascii(*p)) - { - UTF8Character c(p); - ostream << globalExtendedASCIICharacterSet().encode(c); - p += c.length; - } - else - { - ostream << *p++; - } - } - return ostream; -} - - -class ConvertLocaleToUTF8 -{ -public: - StringRange m_range; - ConvertLocaleToUTF8(const char* string) : m_range(StringRange(string, string + strlen(string))) - { - } - ConvertLocaleToUTF8(const StringRange& range) : m_range(range) - { - } -}; - -/// \brief Writes \p convert to \p ostream after decoding each character from extended-ascii to UTF-8. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const ConvertLocaleToUTF8& convert) -{ - if(globalCharacterSet().isUTF8()) - { - return ostream << convert.m_range; - } - - for(const char* p = convert.m_range.first; p != convert.m_range.last; ++p) - { - if(!char_is_ascii(*p)) - { - UTF8Character c(globalExtendedASCIICharacterSet().decode(*p)); - ostream.write(c.buffer, c.length); - } - else - { - ostream << *p; - } - } - return ostream; -} - - -#endif diff --git a/libs/ddslib/ddslib.vcproj b/libs/ddslib/ddslib.vcproj index c692367a..e79f997a 100644 --- a/libs/ddslib/ddslib.vcproj +++ b/libs/ddslib/ddslib.vcproj @@ -1,213 +1,57 @@ - - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + - + + + - + \ No newline at end of file diff --git a/libs/debugging/debugging.cpp b/libs/debugging/debugging.cpp deleted file mode 100644 index 23784950..00000000 --- a/libs/debugging/debugging.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "debugging.h" - -void TEST_ASSERT() -{ - ERROR_MESSAGE("test"); - ASSERT_NOTNULL(0); -} diff --git a/libs/debugging/debugging.h b/libs/debugging/debugging.h deleted file mode 100644 index 4c03e9d7..00000000 --- a/libs/debugging/debugging.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_DEBUGGING_DEBUGGING_H) -#define INCLUDED_DEBUGGING_DEBUGGING_H - -/// \file -/// \brief Debugging macros for fatal error/assert messages. - -#include "stream/textstream.h" -#include "warnings.h" -#include "generic/static.h" - -#if defined(_MSC_VER) && defined(_M_IX86) -#define DEBUGGER_BREAKPOINT() __asm { int 3 } -#elif defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2 -#define DEBUGGER_BREAKPOINT() __asm__ __volatile__ ("int $03") -#else -#include - -#define DEBUGGER_BREAKPOINT() raise(SIGTRAP); -#endif - -#define STR(x) #x -#define STR2(x) STR(x) -#define FILE_LINE __FILE__ ":" STR2(__LINE__) - -#if defined(_DEBUG) || 1 -#define DEBUG_ASSERTS -#endif - -class DebugMessageHandler -{ -public: - virtual TextOutputStream& getOutputStream() = 0; - virtual bool handleMessage() = 0; -}; - -class NullDebugMessageHandler : public NullOutputStream, public DebugMessageHandler -{ -public: - virtual TextOutputStream& getOutputStream() - { - return *this; - } - virtual bool handleMessage() - { - return false; - } -}; - -class DefaultDebugMessageHandler : public DebugMessageHandler -{ -public: - virtual TextOutputStream& getOutputStream() - { - return globalErrorStream(); - } - virtual bool handleMessage() - { -#if defined(_DEBUG) - return false; // send debug-break -#else - return true; -#endif - } -}; - -class DebugMessageHandlerRef : public DefaultDebugMessageHandler -{ - DebugMessageHandler* m_handler; -public: - DebugMessageHandlerRef() - : m_handler(this) - { - } - void setHandler(DebugMessageHandler& handler) - { - m_handler = &handler; - } - DebugMessageHandler& getHandler() - { - return *m_handler; - } -}; - -typedef Static GlobalDebugMessageHandler; - -inline DebugMessageHandler& globalDebugMessageHandler() -{ - return GlobalDebugMessageHandler::instance().getHandler(); -} - -#if defined(DEBUG_ASSERTS) - -/// \brief Sends a \p message to the current debug-message-handler text-output-stream if \p condition evaluates to false. -#define ASSERT_MESSAGE(condition, message) do{\ -if(!(condition))\ -{\ - globalDebugMessageHandler().getOutputStream() << FILE_LINE "\nassertion failure: " << message << "\n";\ - if(!globalDebugMessageHandler().handleMessage()) { DEBUGGER_BREAKPOINT(); }\ -}} while(0) - -/// \brief Sends a \p message to the current debug-message-handler text-output-stream. -#define ERROR_MESSAGE(message) do{\ -globalDebugMessageHandler().getOutputStream() << FILE_LINE "\nruntime error: " << message << "\n";\ -if(!globalDebugMessageHandler().handleMessage()) { DEBUGGER_BREAKPOINT(); }} while(0) - -#define ASSERT_NOTNULL(ptr) ASSERT_MESSAGE(ptr != 0, "pointer \"" #ptr "\" is null") - -#else - -#define ASSERT_MESSAGE(condition, message) -#define ERROR_MESSAGE(message) -#define ASSERT_NOTNULL(ptr) - -#endif - -#endif diff --git a/libs/dragplanes.cpp b/libs/dragplanes.cpp deleted file mode 100644 index 9c7e18f8..00000000 --- a/libs/dragplanes.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "dragplanes.h" - diff --git a/libs/dragplanes.h b/libs/dragplanes.h deleted file mode 100644 index a8b54dc1..00000000 --- a/libs/dragplanes.h +++ /dev/null @@ -1,259 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_DRAGPLANES_H) -#define INCLUDED_DRAGPLANES_H - -#include "selectable.h" -#include "selectionlib.h" -#include "math/aabb.h" -#include "math/line.h" - -// local must be a pure rotation -inline Vector3 translation_to_local(const Vector3& translation, const Matrix4& local) -{ - return matrix4_get_translation_vec3( - matrix4_multiplied_by_matrix4( - matrix4_translated_by_vec3(matrix4_transposed(local), translation), - local - ) - ); -} - -// local must be a pure rotation -inline Vector3 translation_from_local(const Vector3& translation, const Matrix4& local) -{ - return matrix4_get_translation_vec3( - matrix4_multiplied_by_matrix4( - matrix4_translated_by_vec3(local, translation), - matrix4_transposed(local) - ) - ); -} - -class DragPlanes -{ -public: - ObservedSelectable m_selectable_right; // +x - ObservedSelectable m_selectable_left; // -x - ObservedSelectable m_selectable_front; // +y - ObservedSelectable m_selectable_back; // -y - ObservedSelectable m_selectable_top; // +z - ObservedSelectable m_selectable_bottom; // -z - AABB m_bounds; - - DragPlanes(const SelectionChangeCallback& onchanged) : - m_selectable_right(onchanged), - m_selectable_left(onchanged), - m_selectable_front(onchanged), - m_selectable_back(onchanged), - m_selectable_top(onchanged), - m_selectable_bottom(onchanged) - { - } - bool isSelected() const - { - return m_selectable_right.isSelected() - || m_selectable_left.isSelected() - || m_selectable_front.isSelected() - || m_selectable_back.isSelected() - || m_selectable_top.isSelected() - || m_selectable_bottom.isSelected(); - } - void setSelected(bool selected) - { - m_selectable_right.setSelected(selected); - m_selectable_left.setSelected(selected); - m_selectable_front.setSelected(selected); - m_selectable_back.setSelected(selected); - m_selectable_top.setSelected(selected); - m_selectable_bottom.setSelected(selected); - } - void selectPlanes(const AABB& aabb, Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback, const Matrix4& rotation = g_matrix4_identity) - { - Line line(test.getNear(), test.getFar()); - Vector3 corners[8]; - aabb_corners_oriented(aabb, rotation, corners); - - Plane3 planes[6]; - aabb_planes_oriented(aabb, rotation, planes); - - for(Vector3* i = corners; i != corners + 8; ++i) - { - *i = vector3_subtracted(line_closest_point(line, *i), *i); - } - - if(vector3_dot(planes[0].normal(), corners[1]) > 0 - && vector3_dot(planes[0].normal(), corners[2]) > 0 - && vector3_dot(planes[0].normal(), corners[5]) > 0 - && vector3_dot(planes[0].normal(), corners[6]) > 0) - { - Selector_add(selector, m_selectable_right); - selectedPlaneCallback(planes[0]); - //globalOutputStream() << "right\n"; - } - if(vector3_dot(planes[1].normal(), corners[0]) > 0 - && vector3_dot(planes[1].normal(), corners[3]) > 0 - && vector3_dot(planes[1].normal(), corners[4]) > 0 - && vector3_dot(planes[1].normal(), corners[7]) > 0) - { - Selector_add(selector, m_selectable_left); - selectedPlaneCallback(planes[1]); - //globalOutputStream() << "left\n"; - } - if(vector3_dot(planes[2].normal(), corners[0]) > 0 - && vector3_dot(planes[2].normal(), corners[1]) > 0 - && vector3_dot(planes[2].normal(), corners[4]) > 0 - && vector3_dot(planes[2].normal(), corners[5]) > 0) - { - Selector_add(selector, m_selectable_front); - selectedPlaneCallback(planes[2]); - //globalOutputStream() << "front\n"; - } - if(vector3_dot(planes[3].normal(), corners[2]) > 0 - && vector3_dot(planes[3].normal(), corners[3]) > 0 - && vector3_dot(planes[3].normal(), corners[6]) > 0 - && vector3_dot(planes[3].normal(), corners[7]) > 0) - { - Selector_add(selector, m_selectable_back); - selectedPlaneCallback(planes[3]); - //globalOutputStream() << "back\n"; - } - if(vector3_dot(planes[4].normal(), corners[0]) > 0 - && vector3_dot(planes[4].normal(), corners[1]) > 0 - && vector3_dot(planes[4].normal(), corners[2]) > 0 - && vector3_dot(planes[4].normal(), corners[3]) > 0) - { - Selector_add(selector, m_selectable_top); - selectedPlaneCallback(planes[4]); - //globalOutputStream() << "top\n"; - } - if(vector3_dot(planes[5].normal(), corners[4]) > 0 - && vector3_dot(planes[5].normal(), corners[5]) > 0 - && vector3_dot(planes[5].normal(), corners[6]) > 0 - && vector3_dot(planes[5].normal(), corners[7]) > 0) - { - Selector_add(selector, m_selectable_bottom); - selectedPlaneCallback(planes[5]); - //globalOutputStream() << "bottom\n"; - } - - m_bounds = aabb; - } - void selectReversedPlanes(const AABB& aabb, Selector& selector, const SelectedPlanes& selectedPlanes, const Matrix4& rotation = g_matrix4_identity) - { - Plane3 planes[6]; - aabb_planes_oriented(aabb, rotation, planes); - - if(selectedPlanes.contains(plane3_flipped(planes[0]))) - { - Selector_add(selector, m_selectable_right); - } - if(selectedPlanes.contains(plane3_flipped(planes[1]))) - { - Selector_add(selector, m_selectable_left); - } - if(selectedPlanes.contains(plane3_flipped(planes[2]))) - { - Selector_add(selector, m_selectable_front); - } - if(selectedPlanes.contains(plane3_flipped(planes[3]))) - { - Selector_add(selector, m_selectable_back); - } - if(selectedPlanes.contains(plane3_flipped(planes[4]))) - { - Selector_add(selector, m_selectable_top); - } - if(selectedPlanes.contains(plane3_flipped(planes[5]))) - { - Selector_add(selector, m_selectable_bottom); - } - } - AABB evaluateResize(const Vector3& translation) const - { - Vector3 min = m_bounds.origin - m_bounds.extents; - Vector3 max = m_bounds.origin + m_bounds.extents; - if(m_bounds.extents[0] != 0) - { - if(m_selectable_right.isSelected()) - { - max[0] += translation[0]; - //globalOutputStream() << "moving right\n"; - } - if(m_selectable_left.isSelected()) - { - min[0] += translation[0]; - //globalOutputStream() << "moving left\n"; - } - } - if(m_bounds.extents[1] != 0) - { - if(m_selectable_front.isSelected()) - { - max[1] += translation[1]; - //globalOutputStream() << "moving front\n"; - } - if(m_selectable_back.isSelected()) - { - min[1] += translation[1]; - //globalOutputStream() << "moving back\n"; - } - } - if(m_bounds.extents[2] != 0) - { - if(m_selectable_top.isSelected()) - { - max[2] += translation[2]; - //globalOutputStream() << "moving top\n"; - } - if(m_selectable_bottom.isSelected()) - { - min[2] += translation[2]; - //globalOutputStream() << "moving bottom\n"; - } - } - - return AABB(vector3_mid(min, max), vector3_scaled(vector3_subtracted(max, min), 0.5)); - } - AABB evaluateResize(const Vector3& translation, const Matrix4& rotation) const - { - AABB aabb(evaluateResize(translation_to_local(translation, rotation))); - aabb.origin = m_bounds.origin + translation_from_local(aabb.origin - m_bounds.origin, rotation); - return aabb; - } - Matrix4 evaluateTransform(const Vector3& translation) const - { - AABB aabb(evaluateResize(translation)); - Vector3 scale( - m_bounds.extents[0] != 0 ? aabb.extents[0] / m_bounds.extents[0] : 1, - m_bounds.extents[1] != 0 ? aabb.extents[1] / m_bounds.extents[1] : 1, - m_bounds.extents[2] != 0 ? aabb.extents[2] / m_bounds.extents[2] : 1 - ); - - Matrix4 matrix(matrix4_translation_for_vec3(aabb.origin - m_bounds.origin)); - matrix4_pivoted_scale_by_vec3(matrix, scale, m_bounds.origin); - - return matrix; - } -}; - -#endif diff --git a/libs/eclasslib.cpp b/libs/eclasslib.cpp deleted file mode 100644 index a320bc26..00000000 --- a/libs/eclasslib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "eclasslib.h" diff --git a/libs/eclasslib.h b/libs/eclasslib.h deleted file mode 100644 index 7bee547b..00000000 --- a/libs/eclasslib.h +++ /dev/null @@ -1,341 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_ECLASSLIB_H) -#define INCLUDED_ECLASSLIB_H - -#include -#include -#include -#include -#include - -#include "ieclass.h" -#include "irender.h" - -#include "math/vector.h" -#include "string/string.h" - -typedef Vector3 Colour3; - -class ListAttributeType -{ - typedef std::pair ListItem; - typedef std::vector ListItems; - ListItems m_items; -public: - - typedef ListItems::const_iterator const_iterator; - const_iterator begin() const - { - return m_items.begin(); - } - const_iterator end() const - { - return m_items.end(); - } - - const ListItem& operator[](std::size_t i) const - { - return m_items[i]; - } - const_iterator findValue(const char* value) const - { - for(ListItems::const_iterator i = m_items.begin(); i != m_items.end(); ++i) - { - if(string_equal(value, (*i).second.c_str())) - { - return i; - } - } - return m_items.end(); - } - - void push_back(const char* name, const char* value) - { - m_items.push_back(ListItems::value_type(name, value)); - } -}; - -class EntityClassAttribute -{ -public: - CopiedString m_type; - CopiedString m_name; - CopiedString m_value; - CopiedString m_description; - EntityClassAttribute() - { - } - EntityClassAttribute(const char* type, const char* name, const char* value = "", const char* description = "") : m_type(type), m_name(name), m_value(value), m_description(description) - { - } -}; - -typedef std::pair EntityClassAttributePair; -typedef std::list EntityClassAttributes; -typedef std::list StringList; - -inline const char* EntityClassAttributePair_getName(const EntityClassAttributePair& attributePair) -{ - if(!string_empty(attributePair.second.m_name.c_str())) - { - return attributePair.second.m_name.c_str(); - } - return attributePair.first.c_str(); -} - -inline const char* EntityClassAttributePair_getDescription(const EntityClassAttributePair& attributePair) -{ - if(!string_empty(attributePair.second.m_description.c_str())) - { - return attributePair.second.m_description.c_str(); - } - return EntityClassAttributePair_getName(attributePair); -} - -class EntityClass -{ -public: - CopiedString m_name; - StringList m_parent; - bool fixedsize; - bool unknown; // wasn't found in source - Vector3 mins; - Vector3 maxs; - - Colour3 color; - Shader* m_state_fill; - Shader* m_state_wire; - Shader* m_state_blend; - - CopiedString m_comments; - char flagnames[MAX_FLAGS][32]; - - CopiedString m_modelpath; - CopiedString m_skin; - - void (*free)(EntityClass*); - - EntityClassAttributes m_attributes; - - bool inheritanceResolved; - bool sizeSpecified; - bool colorSpecified; - - const char* name() const - { - return m_name.c_str(); - } - const char* comments() const - { - return m_comments.c_str(); - } - const char* modelpath() const - { - return m_modelpath.c_str(); - } - const char* skin() const - { - return m_skin.c_str(); - } -}; - -inline const char* EntityClass_valueForKey(const EntityClass& entityClass, const char* key) -{ - for(EntityClassAttributes::const_iterator i = entityClass.m_attributes.begin(); i != entityClass.m_attributes.end(); ++i) - { - if(string_equal(key, (*i).first.c_str())) - { - return (*i).second.m_value.c_str(); - } - } - return ""; -} - -inline EntityClassAttributePair& EntityClass_insertAttribute(EntityClass& entityClass, const char* key, const EntityClassAttribute& attribute = EntityClassAttribute()) -{ - entityClass.m_attributes.push_back(EntityClassAttributePair(key, attribute)); - return entityClass.m_attributes.back(); -} - - -inline void buffer_write_colour_fill(char buffer[128], const Colour3& colour) -{ - sprintf(buffer, "(%g %g %g)", colour[0], colour[1], colour[2]); -} - -inline void buffer_write_colour_wire(char buffer[128], const Colour3& colour) -{ - sprintf(buffer, "<%g %g %g>", colour[0], colour[1], colour[2]); -} - -inline void buffer_write_colour_blend(char buffer[128], const Colour3& colour) -{ - sprintf(buffer, "[%g %g %g]", colour[0], colour[1], colour[2]); -} - -inline Shader* colour_capture_state_fill(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_fill(buffer, colour); - return GlobalShaderCache().capture(buffer); -} - -inline void colour_release_state_fill(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_fill(buffer, colour); - GlobalShaderCache().release(buffer); -} - -inline Shader* colour_capture_state_wire(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_wire(buffer, colour); - return GlobalShaderCache().capture(buffer); -} - -inline void colour_release_state_wire(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_wire(buffer, colour); - GlobalShaderCache().release(buffer); -} - -inline Shader* colour_capture_state_blend(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_blend(buffer, colour); - return GlobalShaderCache().capture(buffer); -} - -inline void colour_release_state_blend(const Colour3& colour) -{ - char buffer[128]; - buffer_write_colour_blend(buffer, colour); - GlobalShaderCache().release(buffer); -} - -inline void eclass_capture_state(EntityClass* eclass) -{ - eclass->m_state_fill = colour_capture_state_fill(eclass->color); - eclass->m_state_wire = colour_capture_state_wire(eclass->color); - eclass->m_state_blend = colour_capture_state_blend(eclass->color); -} - -inline void eclass_release_state(EntityClass* eclass) -{ - colour_release_state_fill(eclass->color); - colour_release_state_wire(eclass->color); - colour_release_state_blend(eclass->color); -} - -// eclass constructor -inline EntityClass* Eclass_Alloc() -{ - EntityClass* e = new EntityClass; - - e->fixedsize = false; - e->unknown = false; - memset(e->flagnames, 0, MAX_FLAGS*32); - - e->maxs = Vector3(-1,-1,-1); - e->mins = Vector3(1, 1, 1); - - e->free = 0; - - e->inheritanceResolved = true; - e->sizeSpecified = false; - e->colorSpecified = false; - - return e; -} - -// eclass destructor -inline void Eclass_Free(EntityClass* e) -{ - eclass_release_state(e); - - delete e; -} - -inline bool classname_equal(const char* classname, const char* other) -{ - return string_equal(classname, other); -} - -inline EntityClass* EClass_Create(const char* name, const Vector3& colour, const char* comments) -{ - EntityClass *e = Eclass_Alloc(); - e->free = &Eclass_Free; - - e->m_name = name; - - e->color = colour; - eclass_capture_state(e); - - if (comments) - e->m_comments = comments; - - return e; -} - -inline EntityClass* EClass_Create_FixedSize(const char* name, const Vector3& colour, const Vector3& mins, const Vector3& maxs, const char* comments) -{ - EntityClass *e = Eclass_Alloc(); - e->free = &Eclass_Free; - - e->m_name = name; - - e->color = colour; - eclass_capture_state(e); - - e->fixedsize = true; - - e->mins = mins; - e->maxs = maxs; - - if (comments) - e->m_comments = comments; - - return e; -} - -const Vector3 smallbox[2] = { - Vector3(-8,-8,-8), - Vector3( 8, 8, 8), -}; - -inline EntityClass *EntityClass_Create_Default(const char *name, bool has_brushes) -{ - // create a new class for it - if (has_brushes) - { - return EClass_Create(name, Vector3(0.0f, 0.5f, 0.0f), "Not found in source."); - } - else - { - return EClass_Create_FixedSize(name, Vector3(0.0f, 0.5f, 0.0f), smallbox[0], smallbox[1], "Not found in source."); - } -} - -#endif diff --git a/libs/entitylib.cpp b/libs/entitylib.cpp deleted file mode 100644 index 385d0f2e..00000000 --- a/libs/entitylib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entitylib.h" diff --git a/libs/entitylib.h b/libs/entitylib.h deleted file mode 100644 index 4a34f0a5..00000000 --- a/libs/entitylib.h +++ /dev/null @@ -1,758 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_ENTITYLIB_H) -#define INCLUDED_ENTITYLIB_H - -#include "ireference.h" -#include "debugging/debugging.h" - -#include "ientity.h" -#include "irender.h" -#include "igl.h" -#include "selectable.h" - -#include "generic/callback.h" -#include "math/vector.h" -#include "math/aabb.h" -#include "undolib.h" -#include "string/pooledstring.h" -#include "generic/referencecounted.h" -#include "scenelib.h" -#include "container/container.h" -#include "eclasslib.h" - -#include -#include - -inline void arrow_draw(const Vector3& origin, const Vector3& direction) -{ - Vector3 up(0, 0, 1); - Vector3 left(-direction[1], direction[0], 0); - - Vector3 endpoint(vector3_added(origin, vector3_scaled(direction, 32.0))); - - Vector3 tip1(vector3_added(vector3_added(endpoint, vector3_scaled(direction, -8.0)), vector3_scaled(up, -4.0))); - Vector3 tip2(vector3_added(tip1, vector3_scaled(up, 8.0))); - Vector3 tip3(vector3_added(vector3_added(endpoint, vector3_scaled(direction, -8.0)), vector3_scaled(left, -4.0))); - Vector3 tip4(vector3_added(tip3, vector3_scaled(left, 8.0))); - - glBegin (GL_LINES); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(endpoint)); - - glVertex3fv(vector3_to_array(endpoint)); - glVertex3fv(vector3_to_array(tip1)); - - glVertex3fv(vector3_to_array(endpoint)); - glVertex3fv(vector3_to_array(tip2)); - - glVertex3fv(vector3_to_array(endpoint)); - glVertex3fv(vector3_to_array(tip3)); - - glVertex3fv(vector3_to_array(endpoint)); - glVertex3fv(vector3_to_array(tip4)); - - glVertex3fv(vector3_to_array(tip1)); - glVertex3fv(vector3_to_array(tip3)); - - glVertex3fv(vector3_to_array(tip3)); - glVertex3fv(vector3_to_array(tip2)); - - glVertex3fv(vector3_to_array(tip2)); - glVertex3fv(vector3_to_array(tip4)); - - glVertex3fv(vector3_to_array(tip4)); - glVertex3fv(vector3_to_array(tip1)); - - glEnd(); -} - -class SelectionIntersection; - -inline void aabb_testselect(const AABB& aabb, SelectionTest& test, SelectionIntersection& best) -{ - const IndexPointer::index_type indices[24] = { - 2, 1, 5, 6, - 1, 0, 4, 5, - 0, 1, 2, 3, - 3, 7, 4, 0, - 3, 2, 6, 7, - 7, 6, 5, 4, - }; - - Vector3 points[8]; - aabb_corners(aabb, points); - test.TestQuads(VertexPointer(reinterpret_cast(points), sizeof(Vector3)), IndexPointer(indices, 24), best); -} - -inline void aabb_draw_wire(const Vector3 points[8]) -{ - typedef std::size_t index_t; - index_t indices[24] = { - 0, 1, 1, 2, 2, 3, 3, 0, - 4, 5, 5, 6, 6, 7, 7, 4, - 0, 4, 1, 5, 2, 6, 3, 7, - }; -#if 1 - glVertexPointer(3, GL_FLOAT, 0, points); - glDrawElements(GL_LINES, sizeof(indices)/sizeof(index_t), GL_UNSIGNED_INT, indices); -#else - glBegin(GL_LINES); - for(std::size_t i = 0; i < sizeof(indices)/sizeof(index_t); ++i) - { - glVertex3fv(points[indices[i]]); - } - glEnd(); -#endif -} - -inline void aabb_draw_flatshade(const Vector3 points[8]) -{ - glBegin(GL_QUADS); - - glNormal3fv(vector3_to_array(aabb_normals[0])); - glVertex3fv(vector3_to_array(points[2])); - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[5])); - glVertex3fv(vector3_to_array(points[6])); - - glNormal3fv(vector3_to_array(aabb_normals[1])); - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[4])); - glVertex3fv(vector3_to_array(points[5])); - - glNormal3fv(vector3_to_array(aabb_normals[2])); - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[2])); - glVertex3fv(vector3_to_array(points[3])); - - glNormal3fv(vector3_to_array(aabb_normals[3])); - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[3])); - glVertex3fv(vector3_to_array(points[7])); - glVertex3fv(vector3_to_array(points[4])); - - glNormal3fv(vector3_to_array(aabb_normals[4])); - glVertex3fv(vector3_to_array(points[3])); - glVertex3fv(vector3_to_array(points[2])); - glVertex3fv(vector3_to_array(points[6])); - glVertex3fv(vector3_to_array(points[7])); - - glNormal3fv(vector3_to_array(aabb_normals[5])); - glVertex3fv(vector3_to_array(points[7])); - glVertex3fv(vector3_to_array(points[6])); - glVertex3fv(vector3_to_array(points[5])); - glVertex3fv(vector3_to_array(points[4])); - - glEnd(); -} - -inline void aabb_draw_wire(const AABB& aabb) -{ - Vector3 points[8]; - aabb_corners(aabb, points); - aabb_draw_wire(points); -} - -inline void aabb_draw_flatshade(const AABB& aabb) -{ - Vector3 points[8]; - aabb_corners(aabb, points); - aabb_draw_flatshade(points); -} - -inline void aabb_draw_textured(const AABB& aabb) -{ - Vector3 points[8]; - aabb_corners(aabb, points); - - glBegin(GL_QUADS); - - glNormal3fv(vector3_to_array(aabb_normals[0])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[2])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[1])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[5])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[6])); - - glNormal3fv(vector3_to_array(aabb_normals[1])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[1])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[0])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[4])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[5])); - - glNormal3fv(vector3_to_array(aabb_normals[2])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[0])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[1])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[2])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[3])); - - glNormal3fv(vector3_to_array(aabb_normals[3])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[0])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[3])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[7])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[4])); - - glNormal3fv(vector3_to_array(aabb_normals[4])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[3])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[2])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[6])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[7])); - - glNormal3fv(vector3_to_array(aabb_normals[5])); - glTexCoord2fv(aabb_texcoord_topleft); - glVertex3fv(vector3_to_array(points[7])); - glTexCoord2fv(aabb_texcoord_topright); - glVertex3fv(vector3_to_array(points[6])); - glTexCoord2fv(aabb_texcoord_botright); - glVertex3fv(vector3_to_array(points[5])); - glTexCoord2fv(aabb_texcoord_botleft); - glVertex3fv(vector3_to_array(points[4])); - - glEnd(); -} - -inline void aabb_draw_solid(const AABB& aabb, RenderStateFlags state) -{ - if(state & RENDER_TEXTURE) - { - aabb_draw_textured(aabb); - } - else - { - aabb_draw_flatshade(aabb); - } -} - -inline void aabb_draw(const AABB& aabb, RenderStateFlags state) -{ - if(state & RENDER_FILL) - { - aabb_draw_solid(aabb, state); - } - else - { - aabb_draw_wire(aabb); - } -} - -class RenderableSolidAABB : public OpenGLRenderable -{ - const AABB& m_aabb; -public: - RenderableSolidAABB(const AABB& aabb) : m_aabb(aabb) - { - } - void render(RenderStateFlags state) const - { - aabb_draw_solid(m_aabb, state); - } -}; - -class RenderableWireframeAABB : public OpenGLRenderable -{ - const AABB& m_aabb; -public: - RenderableWireframeAABB(const AABB& aabb) : m_aabb(aabb) - { - } - void render(RenderStateFlags state) const - { - aabb_draw_wire(m_aabb); - } -}; - - -/// \brief A key/value pair of strings. -/// -/// - Notifies observers when value changes - value changes to "" on destruction. -/// - Provides undo support through the global undo system. -class KeyValue : public EntityKeyValue -{ - typedef UnsortedSet KeyObservers; - - std::size_t m_refcount; - KeyObservers m_observers; - CopiedString m_string; - const char* m_empty; - ObservedUndoableObject m_undo; - static EntityCreator::KeyValueChangedFunc m_entityKeyValueChanged; -public: - - KeyValue(const char* string, const char* empty) - : m_refcount(0), m_string(string), m_empty(empty), m_undo(m_string, UndoImportCaller(*this)) - { - notify(); - } - ~KeyValue() - { - ASSERT_MESSAGE(m_observers.empty(), "KeyValue::~KeyValue: observers still attached"); - } - - static void setKeyValueChangedFunc(EntityCreator::KeyValueChangedFunc func) - { - m_entityKeyValueChanged = func; - } - - void IncRef() - { - ++m_refcount; - } - void DecRef() - { - if(--m_refcount == 0) - { - delete this; - } - } - - void instanceAttach(MapFile* map) - { - m_undo.instanceAttach(map); - } - void instanceDetach(MapFile* map) - { - m_undo.instanceDetach(map); - } - - void attach(const KeyObserver& observer) - { - (*m_observers.insert(observer))(c_str()); - } - void detach(const KeyObserver& observer) - { - observer(m_empty); - m_observers.erase(observer); - } - const char* c_str() const - { - if(string_empty(m_string.c_str())) - { - return m_empty; - } - return m_string.c_str(); - } - void assign(const char* other) - { - if(!string_equal(m_string.c_str(), other)) - { - m_undo.save(); - m_string = other; - notify(); - } - } - - void notify() - { - m_entityKeyValueChanged(); - KeyObservers::reverse_iterator i = m_observers.rbegin(); - while(i != m_observers.rend()) - { - (*i++)(c_str()); - } - } - - void importState(const CopiedString& string) - { - m_string = string; - - notify(); - } - typedef MemberCaller1 UndoImportCaller; -}; - -/// \brief An unsorted list of key/value pairs. -/// -/// - Notifies observers when a pair is inserted or removed. -/// - Provides undo support through the global undo system. -/// - New keys are appended to the end of the list. -class EntityKeyValues : public Entity -{ -public: - typedef KeyValue Value; - - static StringPool& getPool() - { - return Static::instance(); - } -private: - static EntityCreator::KeyValueChangedFunc m_entityKeyValueChanged; - static Counter* m_counter; - - EntityClass* m_eclass; - - class KeyContext{}; - typedef Static KeyPool; - typedef PooledString Key; - typedef SmartPointer KeyValuePtr; - typedef UnsortedMap KeyValues; - KeyValues m_keyValues; - - typedef UnsortedSet Observers; - Observers m_observers; - - ObservedUndoableObject m_undo; - bool m_instanced; - - bool m_observerMutex; - - void notifyInsert(const char* key, Value& value) - { - m_observerMutex = true; - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->insert(key, value); - } - m_observerMutex = false; - } - void notifyErase(const char* key, Value& value) - { - m_observerMutex = true; - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->erase(key, value); - } - m_observerMutex = false; - } - void forEachKeyValue_notifyInsert() - { - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - notifyInsert((*i).first.c_str(), *(*i).second); - } - } - void forEachKeyValue_notifyErase() - { - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - notifyErase((*i).first.c_str(), *(*i).second); - } - } - - void insert(const char* key, const KeyValuePtr& keyValue) - { - KeyValues::iterator i = m_keyValues.insert(KeyValues::value_type(key, keyValue)); - notifyInsert(key, *(*i).second); - - if(m_instanced) - { - (*i).second->instanceAttach(m_undo.map()); - } - } - - void insert(const char* key, const char* value) - { - KeyValues::iterator i = m_keyValues.find(key); - if(i != m_keyValues.end()) - { - (*i).second->assign(value); - } - else - { - m_undo.save(); - insert(key, KeyValuePtr(new KeyValue(value, EntityClass_valueForKey(*m_eclass, key)))); - } - } - - void erase(KeyValues::iterator i) - { - if(m_instanced) - { - (*i).second->instanceDetach(m_undo.map()); - } - - Key key((*i).first); - KeyValuePtr value((*i).second); - m_keyValues.erase(i); - notifyErase(key.c_str(), *value); - } - - void erase(const char* key) - { - KeyValues::iterator i = m_keyValues.find(key); - if(i != m_keyValues.end()) - { - m_undo.save(); - erase(i); - } - } - -public: - bool m_isContainer; - - EntityKeyValues(EntityClass* eclass) : - m_eclass(eclass), - m_undo(m_keyValues, UndoImportCaller(*this)), - m_instanced(false), - m_observerMutex(false), - m_isContainer(!eclass->fixedsize) - { - } - EntityKeyValues(const EntityKeyValues& other) : - Entity(other), - m_eclass(&other.getEntityClass()), - m_undo(m_keyValues, UndoImportCaller(*this)), - m_instanced(false), - m_observerMutex(false), - m_isContainer(other.m_isContainer) - { - for(KeyValues::const_iterator i = other.m_keyValues.begin(); i != other.m_keyValues.end(); ++i) - { - insert((*i).first.c_str(), (*i).second->c_str()); - } - } - ~EntityKeyValues() - { - for(Observers::iterator i = m_observers.begin(); i != m_observers.end();) - { - // post-increment to allow current element to be removed safely - (*i++)->clear(); - } - ASSERT_MESSAGE(m_observers.empty(), "EntityKeyValues::~EntityKeyValues: observers still attached"); - } - - static void setKeyValueChangedFunc(EntityCreator::KeyValueChangedFunc func) - { - m_entityKeyValueChanged = func; - KeyValue::setKeyValueChangedFunc(func); - } - static void setCounter(Counter* counter) - { - m_counter = counter; - } - - void importState(const KeyValues& keyValues) - { - for(KeyValues::iterator i = m_keyValues.begin(); i != m_keyValues.end();) - { - erase(i++); - } - - for(KeyValues::const_iterator i = keyValues.begin(); i != keyValues.end(); ++i) - { - insert((*i).first.c_str(), (*i).second); - } - - m_entityKeyValueChanged(); - } - typedef MemberCaller1 UndoImportCaller; - - void attach(Observer& observer) - { - ASSERT_MESSAGE(!m_observerMutex, "observer cannot be attached during iteration"); - m_observers.insert(&observer); - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - observer.insert((*i).first.c_str(), *(*i).second); - } - } - void detach(Observer& observer) - { - ASSERT_MESSAGE(!m_observerMutex, "observer cannot be detached during iteration"); - m_observers.erase(&observer); - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - observer.erase((*i).first.c_str(), *(*i).second); - } - } - - void forEachKeyValue_instanceAttach(MapFile* map) - { - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - (*i).second->instanceAttach(map); - } - } - void forEachKeyValue_instanceDetach(MapFile* map) - { - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - (*i).second->instanceDetach(map); - } - } - - void instanceAttach(MapFile* map) - { - if(m_counter != 0) - { - m_counter->increment(); - } - - m_instanced = true; - forEachKeyValue_instanceAttach(map); - m_undo.instanceAttach(map); - } - void instanceDetach(MapFile* map) - { - if(m_counter != 0) - { - m_counter->decrement(); - } - - m_undo.instanceDetach(map); - forEachKeyValue_instanceDetach(map); - m_instanced = false; - } - - // entity - EntityClass& getEntityClass() const - { - return *m_eclass; - } - void forEachKeyValue(Visitor& visitor) const - { - for(KeyValues::const_iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - visitor.visit((*i).first.c_str(), (*i).second->c_str()); - } - } - void setKeyValue(const char* key, const char* value) - { - if(value[0] == '\0' - /*|| string_equal(EntityClass_valueForKey(*m_eclass, key), value)*/) // don't delete values equal to default - { - erase(key); - } - else - { - insert(key, value); - } - m_entityKeyValueChanged(); - } - const char* getKeyValue(const char* key) const - { - KeyValues::const_iterator i = m_keyValues.find(key); - if(i != m_keyValues.end()) - { - return (*i).second->c_str(); - } - - return EntityClass_valueForKey(*m_eclass, key); - } - - bool isContainer() const - { - return m_isContainer; - } -}; - -/// \brief A Resource reference with a controlled lifetime. -/// \brief The resource is released when the ResourceReference is destroyed. -class ResourceReference -{ - CopiedString m_name; - Resource* m_resource; -public: - ResourceReference(const char* name) - : m_name(name) - { - capture(); - } - ResourceReference(const ResourceReference& other) - : m_name(other.m_name) - { - capture(); - } - ResourceReference& operator=(const ResourceReference& other) - { - ResourceReference tmp(other); - tmp.swap(*this); - return *this; - } - ~ResourceReference() - { - release(); - } - - void capture() - { - m_resource = GlobalReferenceCache().capture(m_name.c_str()); - } - void release() - { - GlobalReferenceCache().release(m_name.c_str()); - } - - const char* getName() const - { - return m_name.c_str(); - } - void setName(const char* name) - { - ResourceReference tmp(name); - tmp.swap(*this); - } - - void swap(ResourceReference& other) - { - std::swap(m_resource, other.m_resource); - std::swap(m_name, other.m_name); - } - - void attach(ModuleObserver& observer) - { - m_resource->attach(observer); - } - void detach(ModuleObserver& observer) - { - m_resource->detach(observer); - } - - Resource* get() - { - return m_resource; - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - inline void swap(ResourceReference& self, ResourceReference& other) - { - self.swap(other); - } -} - -#endif diff --git a/libs/entityxml.cpp b/libs/entityxml.cpp deleted file mode 100644 index 175c4818..00000000 --- a/libs/entityxml.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entityxml.h" diff --git a/libs/entityxml.h b/libs/entityxml.h deleted file mode 100644 index 50df739b..00000000 --- a/libs/entityxml.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ENTITYXML_H) -#define INCLUDED_ENTITYXML_H - -#include "ientity.h" -#include "xml/ixml.h" -#include "xml/xmlelement.h" - -class entity_import : public XMLImporter -{ - Entity& m_entity; -public: - entity_import(Entity& entity) - : m_entity(entity) - { - } - void pushElement(const XMLElement& element) - { - if(strcmp(element.name(), "epair") == 0) - m_entity.setKeyValue(element.attribute("key"), element.attribute("value")); - } - void popElement(const char* name) - { - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -class entity_export : public XMLExporter -{ - class ExportXMLVisitor : public Entity::Visitor - { - XMLImporter& m_importer; - public: - ExportXMLVisitor(XMLImporter& importer) : m_importer(importer) - { - } - void visit(const char* key, const char* value) - { - StaticElement element("epair"); - element.insertAttribute("key", key); - element.insertAttribute("value", value); - m_importer.pushElement(element); - m_importer.popElement(element.name()); - } - }; - - const Entity& m_entity; - -public: - entity_export(const Entity& entity) : m_entity(entity) - { - } - void exportXML(XMLImporter& observer) - { - ExportXMLVisitor visitor(observer); - - m_entity.forEachKeyValue(visitor); - } -}; - -inline void entity_copy(Entity& entity, const Entity& other) -{ - entity_export exporter(other); - entity_import importer(entity); - exporter.exportXML(importer); -} - -template -class EntityConstruction -{ -public: - typedef EntityClass* type; - static type get(const EntityType& entity) - { - return &entity.getEntity().getEntityClass(); - } - static void copy(EntityType& entity, const EntityType& other) - { - entity_copy(entity.getEntity(), other.getEntity()); - } -}; - - - -#endif diff --git a/libs/fs_filesystem.cpp b/libs/fs_filesystem.cpp deleted file mode 100644 index f0820982..00000000 --- a/libs/fs_filesystem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "fs_filesystem.h" diff --git a/libs/fs_filesystem.h b/libs/fs_filesystem.h deleted file mode 100644 index 0c22a4b3..00000000 --- a/libs/fs_filesystem.h +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_FS_FILESYSTEM_H) -#define INCLUDED_FS_FILESYSTEM_H - -#include "string/string.h" -#include "os/path.h" - -#include - -inline unsigned int path_get_depth(const char* path) -{ - unsigned int depth = 0; - while(path != 0 && path[0] != '\0') - { - path = strchr(path, '/'); - if(path != 0) - { - ++path; - } - ++depth; - } - return depth; -} - -/// \brief A generic unix-style file-system which maps paths to files and directories. -/// Provides average O(log n) find and insert methods. -/// \param file_type The data type which represents a file. -template -class GenericFileSystem -{ - class Path - { - CopiedString m_path; - unsigned int m_depth; - public: - Path(const char* path) - : m_path(path), m_depth(path_get_depth(c_str())) - { - } - Path(StringRange range) - : m_path(range), m_depth(path_get_depth(c_str())) - { - } - bool operator<(const Path& other) const - { - return string_less_nocase(c_str(), other.c_str()); - } - unsigned int depth() const - { - return m_depth; - } - const char* c_str() const - { - return m_path.c_str(); - } - }; - - class Entry - { - file_type* m_file; - public: - Entry() : m_file(0) - { - } - Entry(file_type* file) : m_file(file) - { - } - file_type* file() const - { - return m_file; - } - bool is_directory() const - { - return file() == 0; - } - }; - - typedef std::map Entries; - Entries m_entries; - -public: - typedef typename Entries::iterator iterator; - typedef typename Entries::value_type value_type; - typedef Entry entry_type; - - iterator begin() - { - return m_entries.begin(); - } - iterator end() - { - return m_entries.end(); - } - - /// \brief Returns the file at \p path. - /// Creates all directories below \p path if they do not exist. - /// O(log n) on average. - entry_type& operator[](const Path& path) - { - { - const char* end = path_remove_directory(path.c_str()); - while(end[0] != '\0') - { - Path dir(StringRange(path.c_str(), end)); - m_entries.insert(value_type(dir, Entry(0))); - end = path_remove_directory(end); - } - } - - return m_entries[path]; - } - - /// \brief Returns the file at \p path or end() if not found. - iterator find(const Path& path) - { - return m_entries.find(path); - } - - iterator begin(const char* root) - { - if(root[0] == '\0') - { - return m_entries.begin(); - } - iterator i = m_entries.find(root); - if(i == m_entries.end()) - { - return i; - } - return ++i; - } - - /// \brief Performs a depth-first traversal of the file-system subtree rooted at \p root. - /// Traverses the entire tree if \p root is "". - /// Calls \p visitor.file() with the path to each file relative to the filesystem root. - /// Calls \p visitor.directory() with the path to each directory relative to the filesystem root. - template - void traverse(visitor_type visitor, const char* root) - { - unsigned int start_depth = path_get_depth(root); - unsigned int skip_depth = 0; - for(iterator i = begin(root); i != end() && i->first.depth() > start_depth; ++i) - { - if(i->first.depth() == skip_depth) - { - skip_depth = 0; - } - if(skip_depth == 0) - { - if(!i->second.is_directory()) - { - visitor.file(i->first.c_str()); - } - else if(visitor.directory(i->first.c_str(), i->first.depth() - start_depth)) - { - skip_depth = i->first.depth(); - } - } - } - } -}; - -#endif diff --git a/libs/fs_path.cpp b/libs/fs_path.cpp deleted file mode 100644 index 5cd36406..00000000 --- a/libs/fs_path.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "fs_path.h" diff --git a/libs/fs_path.h b/libs/fs_path.h deleted file mode 100644 index df409ef0..00000000 --- a/libs/fs_path.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_FS_PATH_H) -#define INCLUDED_FS_PATH_H - -#include "stream/stringstream.h" - -/// \brief A unix-style path string which can be modified at runtime. -/// -/// - Maintains a path ending in a path-separator. -/// - Provides a limited STL-style interface to push and pop file or directory names at the end of the path. -class UnixPath -{ - StringBuffer m_string; - - void check_separator() - { - if(!empty() && m_string.back() != '/') - { - m_string.push_back('/'); - } - } - -public: - /// \brief Constructs with the directory \p root. - UnixPath(const char* root) - : m_string(root) - { - check_separator(); - } - - bool empty() const - { - return m_string.empty(); - } - - const char* c_str() const - { - return m_string.c_str(); - } - - /// \brief Appends the directory \p name. - void push(const char* name) - { - m_string.push_string(name); - check_separator(); - } - /// \brief Appends the directory [\p first, \p last). - void push(const char* first, const char* last) - { - m_string.push_range(first, last); - check_separator(); - } - /// \brief Appends the filename \p name. - void push_filename(const char* name) - { - m_string.push_string(name); - } - /// \brief Removes the last directory or filename appended. - void pop() - { - if(m_string.back() == '/') - { - m_string.pop_back(); - } - while(!empty() && m_string.back() != '/') - { - m_string.pop_back(); - } - } -}; - -#endif diff --git a/libs/generic/arrayrange.cpp b/libs/generic/arrayrange.cpp deleted file mode 100644 index b04ba068..00000000 --- a/libs/generic/arrayrange.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "arrayrange.h" - diff --git a/libs/generic/arrayrange.h b/libs/generic/arrayrange.h deleted file mode 100644 index a05489a1..00000000 --- a/libs/generic/arrayrange.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_ARRAYRANGE_H) -#define INCLUDED_GENERIC_ARRAYRANGE_H - -/// \file -/// \brief Macros for automatically converting a compile-time-sized array to a range. - -template -struct ArrayRange -{ - typedef Element* Iterator; - ArrayRange(Iterator first, Iterator last) - : first(first), last(last) - { - } - Iterator first; - Iterator last; -}; - -template -inline ArrayRange makeArrayRange(Element* first, Element* last) -{ - return ArrayRange(first, last); -} - -template -struct ArrayConstRange -{ - typedef const Element* Iterator; - ArrayConstRange(Iterator first, Iterator last) - : first(first), last(last) - { - } - Iterator first; - Iterator last; -}; - -template -inline ArrayConstRange makeArrayRange(const Element* first, const Element* last) -{ - return ArrayConstRange(first, last); -} - -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(*array)) -#define ARRAY_END(array) (array + ARRAY_SIZE(array)) -#define ARRAY_RANGE(array) (makeArrayRange(array, ARRAY_END(array))) - - -typedef ArrayConstRange StringArrayRange; -#define STRING_ARRAY_RANGE(array) (StringArrayRange(array, ARRAY_END(array))) - -typedef ArrayRange StringRange; - -#endif diff --git a/libs/generic/bitfield.cpp b/libs/generic/bitfield.cpp deleted file mode 100644 index 96d15c9c..00000000 --- a/libs/generic/bitfield.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "bitfield.h" - diff --git a/libs/generic/bitfield.h b/libs/generic/bitfield.h deleted file mode 100644 index 652f0539..00000000 --- a/libs/generic/bitfield.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_BITFIELD_H) -#define INCLUDED_GENERIC_BITFIELD_H - -/// \file -/// \brief Type safe bitfield. - -/// \brief A bit-field value. -/// -/// - Can be forward-declared when the definition of Enumeration is unknown. -/// - Can only be constructed from valid enumerated values. -/// - Can only be compared and combined with others of the same type. -/// -/// \param Enumeration A type that contains an enum \c Value of the bits that can be set in this field. -template -class BitFieldValue : public Enumeration -{ - unsigned m_value; -protected: - explicit BitFieldValue(unsigned value) : m_value(value) - { - } -public: - BitFieldValue() : m_value(0) - { - } - explicit BitFieldValue(typename Enumeration::Value value) : m_value(1 << value) - { - } - unsigned get() const - { - return m_value; - } -}; - -template -class BitFieldValueUnsafe : public BitFieldValue -{ -public: - explicit BitFieldValueUnsafe(unsigned value) : BitFieldValue(value) - { - } -}; - -template -inline bool operator==(BitFieldValue self, BitFieldValue other) -{ - return self.get() == other.get(); -} -template -inline bool operator!=(BitFieldValue self, BitFieldValue other) -{ - return !operator==(self, other); -} - -template -inline BitFieldValue operator|(BitFieldValue self, BitFieldValue other) -{ - return BitFieldValueUnsafe(self.get() | other.get()); -} -template -inline BitFieldValue& operator|=(BitFieldValue& self, BitFieldValue other) -{ - return self = self | other; -} -template -inline BitFieldValue operator&(BitFieldValue self, BitFieldValue other) -{ - return BitFieldValueUnsafe(self.get() & other.get()); -} -template -inline BitFieldValue& operator&=(BitFieldValue& self, BitFieldValue other) -{ - return self = self & other; -} -template -inline BitFieldValue operator~(BitFieldValue self) -{ - return BitFieldValueUnsafe(~self.get()); -} - - - -inline unsigned int bitfield_enable(unsigned int bitfield, unsigned int mask) -{ - return bitfield | mask; -} -inline unsigned int bitfield_disable(unsigned int bitfield, unsigned int mask) -{ - return bitfield & ~mask; -} -inline bool bitfield_enabled(unsigned int bitfield, unsigned int mask) -{ - return (bitfield & mask) != 0; -} - -template -inline BitFieldValue bitfield_enable(BitFieldValue bitfield, BitFieldValue mask) -{ - return bitfield | mask; -} -template -inline BitFieldValue bitfield_disable(BitFieldValue bitfield, BitFieldValue mask) -{ - return bitfield & ~mask; -} -template -inline bool bitfield_enabled(BitFieldValue bitfield, BitFieldValue mask) -{ - return (bitfield & mask).get() != 0; -} - -#endif diff --git a/libs/generic/callback.cpp b/libs/generic/callback.cpp deleted file mode 100644 index 2344830a..00000000 --- a/libs/generic/callback.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "callback.h" - -#if defined(_DEBUG) || defined(DOXYGEN) - -namespace ExampleMemberCaller -{ - // MemberCaller example - class Integer - { - public: - int value; - - void printValue() const - { - // print this->value here; - } - - void setValue() - { - value = 3; - } - // a typedef to make things more readable - typedef MemberCaller SetValueCaller; - }; - - void example() - { - Integer foo = { 0 }; - - { - Callback bar = ConstMemberCaller(foo); - - // invoke the callback - bar(); // foo.printValue() - } - - - { - // use the typedef to improve readability - Callback bar = Integer::SetValueCaller(foo); - - // invoke the callback - bar(); // foo.setValue() - } - } - // end example -} - -namespace ExampleReferenceCaller -{ - // ReferenceCaller example - void Int_printValue(const int& value) - { - // print value here; - } - - void Int_setValue(int& value) - { - value = 3; - } - - // a typedef to make things more readable - typedef ReferenceCaller IntSetValueCaller; - - void example() - { - int foo = 0; - - { - Callback bar = ConstReferenceCaller(foo); - - // invoke the callback - bar(); // Int_printValue(foo) - } - - - { - // use the typedef to improve readability - Callback bar = IntSetValueCaller(foo); - - // invoke the callback - bar(); // Int_setValue(foo) - } - } - // end example -} - -#endif - -namespace -{ - class A1 - { - }; - class A2 - { - }; - class A3 - { - }; - class A4 - { - }; - - class Test - { - public: - void test0() - { - } - typedef Member Test0; - typedef MemberCaller Test0Caller; - void test0const() const - { - } - typedef ConstMember Test0Const; - typedef ConstMemberCaller Test0ConstCaller; - void test1(A1) - { - } - typedef Member1 Test1; - typedef MemberCaller1 Test1Caller; - void test1const(A1) const - { - } - typedef ConstMember1 Test1Const; - typedef ConstMemberCaller1 Test1ConstCaller; - void test2(A1, A2) - { - } - typedef Member2 Test2; - void test2const(A1, A2) const - { - } - typedef ConstMember2 Test2Const; - void test3(A1, A2, A3) - { - } - typedef Member3 Test3; - void test3const(A1, A2, A3) const - { - } - typedef ConstMember3 Test3Const; - }; - - void test0free() - { - } - typedef FreeCaller<&test0free> Test0FreeCaller; - void test1free(A1) - { - } - typedef FreeCaller1 Test1FreeCaller; - void test2free(A1, A2) - { - } - typedef Function2 Test2Free; - void test3free(A1, A2, A3) - { - } - typedef Function3 Test3Free; - - - void test0(Test& test) - { - } - typedef ReferenceCaller Test0Caller; - - void test0const(const Test& test) - { - } - typedef ConstReferenceCaller Test0ConstCaller; - - void test0p(Test* test) - { - } - typedef PointerCaller Test0PCaller; - - void test0constp(const Test* test) - { - } - typedef ConstPointerCaller Test0ConstPCaller; - - void test1(Test& test, A1) - { - } - typedef ReferenceCaller1 Test1Caller; - - void test1const(const Test& test, A1) - { - } - typedef ConstReferenceCaller1 Test1ConstCaller; - - void test1p(Test* test, A1) - { - } - typedef PointerCaller1 Test1PCaller; - - void test1constp(const Test* test, A1) - { - } - typedef ConstPointerCaller1 Test1ConstPCaller; - - void test2(Test& test, A1, A2) - { - } - typedef Function3 Test2; - - void test3(Test& test, A1, A2, A3) - { - } - typedef Function4 Test3; - - void instantiate() - { - Test test; - const Test& testconst = test; - { - Callback a = Test0FreeCaller(); - Callback b = Test::Test0Caller(test); - b = makeCallback0(Test::Test0(), test); - Callback c = Test::Test0ConstCaller(testconst); - c = makeCallback0(Test::Test0Const(), test); - Callback d = Test0Caller(test); - Callback e = Test0ConstCaller(testconst); - Callback f = Test0PCaller(&test); - Callback g = Test0ConstPCaller(&testconst); - a(); - bool u = a != b; - } - { - typedef Callback1 TestCallback1; - TestCallback1 a = Test1FreeCaller(); - TestCallback1 b = Test::Test1Caller(test); - b = makeCallback1(Test::Test1(), test); - TestCallback1 c = Test::Test1ConstCaller(testconst); - c = makeCallback1(Test::Test1Const(), test); - TestCallback1 d = Test1Caller(test); - TestCallback1 e = Test1ConstCaller(testconst); - TestCallback1 f = Test1PCaller(&test); - TestCallback1 g = Test1ConstPCaller(&testconst); - a(A1()); - bool u = a != b; - } - { - typedef Callback2 TestCallback2; - TestCallback2 a = makeStatelessCallback2(Test2Free()); - TestCallback2 b = makeCallback2(Test2(), test); - TestCallback2 c = makeCallback2(Test::Test2(), test); - TestCallback2 d = makeCallback2(Test::Test2Const(), test); - a(A1(), A2()); - bool u = a != b; - } - { - typedef Callback3 TestCallback3; - TestCallback3 a = makeStatelessCallback3(Test3Free()); - TestCallback3 b = makeCallback3(Test3(), test); - TestCallback3 c = makeCallback3(Test::Test3(), test); - TestCallback3 d = makeCallback3(Test::Test3Const(), test); - a(A1(), A2(), A3()); - bool u = a != b; - } - } -} diff --git a/libs/generic/callback.h b/libs/generic/callback.h deleted file mode 100644 index 7141da4a..00000000 --- a/libs/generic/callback.h +++ /dev/null @@ -1,670 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_CLOSURE_H) -#define INCLUDED_GENERIC_CLOSURE_H - -/// \file -/// \brief Type-safe techniques for binding the first argument of an opaque callback. - -#include -#include "functional.h" -#include "callbackfwd.h" - -template -inline void* convertToOpaque(Type* t) -{ - return t; -} -template -inline void* convertToOpaque(const Type* t) -{ - return const_cast(t); -} -template -inline void* convertToOpaque(Type& t) -{ - return &t; -} -template -inline void* convertToOpaque(const Type& t) -{ - return const_cast(&t); -} - - -template -class ConvertFromOpaque -{ -}; - -template -class ConvertFromOpaque -{ -public: - static Type& apply(void* p) - { - return *static_cast(p); - } -}; - -template -class ConvertFromOpaque -{ -public: - static const Type& apply(void* p) - { - return *static_cast(p); - } -}; - - -template -class ConvertFromOpaque -{ -public: - static Type* apply(void* p) - { - return static_cast(p); - } -}; - -template -class ConvertFromOpaque -{ -public: - static const Type* apply(void* p) - { - return static_cast(p); - } -}; - -template -class BindFirstOpaque -{ - typedef typename Caller::first_argument_type FirstBound; - FirstBound firstBound; -public: - typedef typename Caller::result_type result_type; - explicit BindFirstOpaque(FirstBound firstBound) : firstBound(firstBound) - { - } - result_type operator()() const - { - return Caller::call(firstBound); - } - FirstBound getBound() const - { - return firstBound; - } - static result_type thunk(void* environment) - { - return Caller::call(ConvertFromOpaque::apply(environment)); - } - void* getEnvironment() const - { - return convertToOpaque(firstBound); - } -}; - -template -class BindFirstOpaque1 -{ - typedef typename Caller::first_argument_type FirstBound; - FirstBound firstBound; -public: - typedef typename Caller::second_argument_type first_argument_type; - typedef typename Caller::result_type result_type; - explicit BindFirstOpaque1(FirstBound firstBound) : firstBound(firstBound) - { - } - result_type operator()(first_argument_type a1) const - { - return Caller::call(firstBound, a1); - } - FirstBound getBound() const - { - return firstBound; - } - static result_type thunk(void* environment, first_argument_type a1) - { - return Caller::call(ConvertFromOpaque::apply(environment), a1); - } - void* getEnvironment() const - { - return convertToOpaque(firstBound); - } -}; - -template -class BindFirstOpaque2 -{ - typedef typename Caller::first_argument_type FirstBound; - FirstBound firstBound; -public: - typedef typename Caller::second_argument_type first_argument_type; - typedef typename Caller::third_argument_type second_argument_type; - typedef typename Caller::result_type result_type; - explicit BindFirstOpaque2(FirstBound firstBound) : firstBound(firstBound) - { - } - result_type operator()(first_argument_type a1, second_argument_type a2) const - { - return Caller::call(firstBound, a1, a2); - } - FirstBound getBound() const - { - return firstBound; - } - static result_type thunk(void* environment, first_argument_type a1, second_argument_type a2) - { - return Caller::call(ConvertFromOpaque::apply(environment), a1, a2); - } - void* getEnvironment() const - { - return convertToOpaque(firstBound); - } -}; - -template -class BindFirstOpaque3 -{ - typedef typename Caller::first_argument_type FirstBound; - FirstBound firstBound; -public: - typedef typename Caller::second_argument_type first_argument_type; - typedef typename Caller::third_argument_type second_argument_type; - typedef typename Caller::fourth_argument_type third_argument_type; - typedef typename Caller::result_type result_type; - explicit BindFirstOpaque3(FirstBound firstBound) : firstBound(firstBound) - { - } - result_type operator()(first_argument_type a1, second_argument_type a2, third_argument_type a3) const - { - return Caller::call(firstBound, a1, a2, a3); - } - FirstBound getBound() const - { - return firstBound; - } - static result_type thunk(void* environment, first_argument_type a1, second_argument_type a2, third_argument_type a3) - { - return Caller::call(ConvertFromOpaque::apply(environment), a1, a2, a3); - } - void* getEnvironment() const - { - return convertToOpaque(firstBound); - } -}; - -template -class CallbackBase -{ - void* m_environment; - Thunk_ m_thunk; -public: - typedef Thunk_ Thunk; - CallbackBase(void* environment, Thunk function) : m_environment(environment), m_thunk(function) - { - } - void* getEnvironment() const - { - return m_environment; - } - Thunk getThunk() const - { - return m_thunk; - } -}; - -template -inline bool operator==(const CallbackBase& self, const CallbackBase& other) -{ - return self.getEnvironment() == other.getEnvironment() && self.getThunk() == other.getThunk(); -} -template -inline bool operator!=(const CallbackBase& self, const CallbackBase& other) -{ - return !(self == other); -} -template -inline bool operator<(const CallbackBase& self, const CallbackBase& other) -{ - return self.getEnvironment() < other.getEnvironment() || - (!(other.getEnvironment() < self.getEnvironment()) && self.getThunk() < other.getThunk()); -} - - -/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer. -/// -/// Use with the callback constructors MemberCaller, ConstMemberCaller, ReferenceCaller, ConstReferenceCaller, PointerCaller, ConstPointerCaller and FreeCaller. -template -class Callback0 : public CallbackBase -{ - typedef CallbackBase Base; - static Result nullThunk(void*) - { - } - -public: - typedef Result result_type; - - Callback0() : Base(0, nullThunk) - { - } - template - Callback0(const BindFirstOpaque& caller) : Base(caller.getEnvironment(), BindFirstOpaque::thunk) - { - } - Callback0(void* environment, typename Base::Thunk function) : Base(environment, function) - { - } - result_type operator()() const - { - return Base::getThunk()(Base::getEnvironment()); - } -}; - -template -inline Callback0 makeCallback0(const Caller& caller, typename Caller::first_argument_type callee) -{ - return Callback0(BindFirstOpaque(callee)); -} -template -inline Callback0 makeStatelessCallback0(const Caller& caller) -{ - return makeCallback0(Caller0To1(), 0); -} - -typedef Callback0 Callback; - - - -/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer and one other argument. -/// -/// Use with the callback constructors MemberCaller1, ConstMemberCaller1, ReferenceCaller1, ConstReferenceCaller1, PointerCaller1, ConstPointerCaller1 and FreeCaller1. -template -class Callback1 : public CallbackBase -{ - typedef CallbackBase Base; - static Result nullThunk(void*, FirstArgument) - { - } - -public: - typedef FirstArgument first_argument_type; - typedef Result result_type; - - Callback1() : Base(0, nullThunk) - { - } - template - Callback1(const BindFirstOpaque1& caller) : Base(caller.getEnvironment(), BindFirstOpaque1::thunk) - { - } - Callback1(void* environment, typename Base::Thunk function) : Base(environment, function) - { - } - result_type operator()(FirstArgument firstArgument) const - { - return Base::getThunk()(Base::getEnvironment(), firstArgument); - } -}; - -template -inline Callback1 makeCallback1(const Caller& caller, typename Caller::first_argument_type callee) -{ - return Callback1(BindFirstOpaque1(callee)); -} -template -inline Callback1 makeStatelessCallback1(const Caller& caller) -{ - return makeCallback1(Caller1To2(), 0); -} - - -/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer and two other arguments. -/// -template -class Callback2 : public CallbackBase -{ - typedef CallbackBase Base; - static Result nullThunk(void*, FirstArgument, SecondArgument) - { - } - -public: - typedef FirstArgument first_argument_type; - typedef SecondArgument second_argument_type; - typedef Result result_type; - - Callback2() : Base(0, nullThunk) - { - } - template - Callback2(const BindFirstOpaque2& caller) : Base(caller.getEnvironment(), BindFirstOpaque2::thunk) - { - } - Callback2(void* environment, typename Base::Thunk function) : Base(environment, function) - { - } - result_type operator()(FirstArgument firstArgument, SecondArgument secondArgument) const - { - return Base::getThunk()(Base::getEnvironment(), firstArgument, secondArgument); - } -}; - -template -inline Callback2< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::result_type -> makeCallback2(const Caller& caller, typename Caller::first_argument_type callee) -{ - return Callback2< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::result_type - >(BindFirstOpaque2(callee)); -} -template -inline Callback2< - typename Caller::first_argument_type, - typename Caller::second_argument_type, - typename Caller::result_type -> makeStatelessCallback2(const Caller& caller) -{ - return makeCallback2(Caller2To3(), 0); -} - - -/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer and three other arguments. -/// -template -class Callback3 : public CallbackBase -{ - typedef CallbackBase Base; - static Result nullThunk(void*, FirstArgument, SecondArgument, ThirdArgument) - { - } - -public: - typedef FirstArgument first_argument_type; - typedef SecondArgument second_argument_type; - typedef ThirdArgument third_argument_type; - typedef Result result_type; - - Callback3() : Base(0, nullThunk) - { - } - template - Callback3(const BindFirstOpaque3& caller) : Base(caller.getEnvironment(), BindFirstOpaque3::thunk) - { - } - Callback3(void* environment, typename Base::Thunk function) : Base(environment, function) - { - } - result_type operator()(FirstArgument firstArgument, SecondArgument secondArgument, ThirdArgument thirdArgument) const - { - return Base::getThunk()(Base::getEnvironment(), firstArgument, secondArgument, thirdArgument); - } -}; - -template -inline Callback3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type, - typename Caller::result_type -> makeCallback3(const Caller& caller, typename Caller::first_argument_type callee) -{ - return Callback3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type, - typename Caller::result_type - >(BindFirstOpaque3(callee)); -} -template -inline Callback3< - typename Caller::first_argument_type, - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::result_type -> makeStatelessCallback3(const Caller& caller) -{ - return makeCallback3(Caller3To4(), 0); -} - - -/// \brief Forms a Callback from a non-const Environment reference and a non-const Environment member-function. -/// -/// \dontinclude generic/callback.cpp -/// \skipline MemberCaller example -/// \until end example -template -class MemberCaller : public BindFirstOpaque< Member > -{ -public: - MemberCaller(Environment& environment) : BindFirstOpaque< Member >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment reference and a const Environment member-function. -/// -/// \dontinclude generic/callback.cpp -/// \skipline MemberCaller example -/// \until end example -template -class ConstMemberCaller : public BindFirstOpaque< ConstMember > -{ -public: - ConstMemberCaller(const Environment& environment) : BindFirstOpaque< ConstMember >(environment) - { - } -}; - -/// \brief Forms a Callback from a non-const Environment reference and a const Environment member-function which takes one argument. -template -class MemberCaller1 : public BindFirstOpaque1< Member1 > -{ -public: - MemberCaller1(Environment& environment) : BindFirstOpaque1< Member1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment reference and a const Environment member-function which takes one argument. -template -class ConstMemberCaller1 : public BindFirstOpaque1< ConstMember1 > -{ -public: - ConstMemberCaller1(const Environment& environment) : BindFirstOpaque1< ConstMember1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference. -/// -/// \dontinclude generic/callback.cpp -/// \skipline ReferenceCaller example -/// \until end example -template -class ReferenceCaller : public BindFirstOpaque< Function1 > -{ -public: - ReferenceCaller(Environment& environment) : BindFirstOpaque< Function1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment reference and a free function which operates on a const Environment reference. -/// -/// \dontinclude generic/callback.cpp -/// \skipline ReferenceCaller example -/// \until end example -template -class ConstReferenceCaller : public BindFirstOpaque< Function1 > -{ -public: - ConstReferenceCaller(const Environment& environment) : BindFirstOpaque< Function1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference and one other argument. -template -class ReferenceCaller1 : public BindFirstOpaque1< Function2 > -{ -public: - ReferenceCaller1(Environment& environment) : BindFirstOpaque1< Function2 >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment reference and a free function which operates on a const Environment reference and one other argument. -template -class ConstReferenceCaller1 : public BindFirstOpaque1< Function2 > -{ -public: - ConstReferenceCaller1(const Environment& environment) : BindFirstOpaque1< Function2 >(environment) - { - } -}; - -/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer. -template -class PointerCaller : public BindFirstOpaque< Function1 > -{ -public: - PointerCaller(Environment* environment) : BindFirstOpaque< Function1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer. -template -class ConstPointerCaller : public BindFirstOpaque< Function1 > -{ -public: - ConstPointerCaller(const Environment* environment) : BindFirstOpaque< Function1 >(environment) - { - } -}; - -/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer and one other argument. -template -class PointerCaller1 : public BindFirstOpaque1< Function2 > -{ -public: - PointerCaller1(Environment* environment) : BindFirstOpaque1< Function2 >(environment) - { - } -}; - -/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer and one other argument. -template -class ConstPointerCaller1 : public BindFirstOpaque1< Function2 > -{ -public: - ConstPointerCaller1(const Environment* environment) : BindFirstOpaque1< Function2 >(environment) - { - } -}; - -/// \brief Forms a Callback from a free function which takes no arguments. -template -class FreeCaller : public BindFirstOpaque< Caller0To1< Function0 > > -{ -public: - FreeCaller() : BindFirstOpaque< Caller0To1< Function0 > >(0) - { - } -}; - -/// \brief Forms a Callback from a free function which takes a single argument. -template -class FreeCaller1 : public BindFirstOpaque1< Caller1To2< Function1 > > -{ -public: - FreeCaller1() : BindFirstOpaque1< Caller1To2< Function1 > >(0) - { - } -}; - - -/// \brief Constructs a Callback from a non-const \p functor with zero arguments. -/// -/// \param Functor Must define \c operator()(). -template -inline Callback makeCallback(Functor& functor) -{ - return Callback(MemberCaller(functor)); -} - -/// \brief Constructs a Callback from a const \p functor with zero arguments. -/// -/// \param Functor Must define const \c operator()(). -template -inline Callback makeCallback(const Functor& functor) -{ - return Callback(ConstMemberCaller(functor)); -} - -/// \brief Constructs a Callback1 from a non-const \p functor with one argument. -/// -/// \param Functor Must define \c first_argument_type and \c operator()(first_argument_type). -template -inline Callback1 makeCallback1(Functor& functor) -{ - typedef typename Functor::first_argument_type FirstArgument; - return Callback1(MemberCaller1(functor)); -} - -/// \brief Constructs a Callback1 from a const \p functor with one argument. -/// -/// \param Functor Must define \c first_argument_type and const \c operator()(first_argument_type). -template -inline Callback1 makeCallback1(const Functor& functor) -{ - typedef typename Functor::first_argument_type FirstArgument; - return Callback1(ConstMemberCaller1(functor)); -} - - -typedef Callback1 BoolImportCallback; -typedef Callback1 BoolExportCallback; - -typedef Callback1 IntImportCallback; -typedef Callback1 IntExportCallback; - -typedef Callback1 FloatImportCallback; -typedef Callback1 FloatExportCallback; - -typedef Callback1 StringImportCallback; -typedef Callback1 StringExportCallback; - -typedef Callback1 SizeImportCallback; -typedef Callback1 SizeExportCallback; - - -#endif diff --git a/libs/generic/callbackfwd.cpp b/libs/generic/callbackfwd.cpp deleted file mode 100644 index a2faa664..00000000 --- a/libs/generic/callbackfwd.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "callbackfwd.h" - diff --git a/libs/generic/callbackfwd.h b/libs/generic/callbackfwd.h deleted file mode 100644 index f89f9090..00000000 --- a/libs/generic/callbackfwd.h +++ /dev/null @@ -1,18 +0,0 @@ - -#if !defined(INCLUDED_CALLBACKFWD_H) -#define INCLUDED_CALLBACKFWD_H - -template -class Callback0; -typedef Callback0 Callback; - -template -class Callback1; - -template -class Callback2; - -template -class Callback3; - -#endif diff --git a/libs/generic/constant.cpp b/libs/generic/constant.cpp deleted file mode 100644 index ff54c9cc..00000000 --- a/libs/generic/constant.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "constant.h" - -#if defined(_DEBUG) || defined(DOXYGEN) - -namespace ExampleConstant -{ - class Bleh - { - public: - - STRING_CONSTANT(Name, "Bleh"); - INTEGER_CONSTANT(Version, 1); - }; - - int version = Bleh::Version(); - const char* name = Bleh::Name(); -} - -#endif diff --git a/libs/generic/constant.h b/libs/generic/constant.h deleted file mode 100644 index 42b2fa5d..00000000 --- a/libs/generic/constant.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_CONSTANT_H) -#define INCLUDED_GENERIC_CONSTANT_H - -/// \file -/// \brief Language extensions for constants that are guaranteed to be evaluated at compile-time. - -/// \brief A compile-time-constant as a type. -template -struct ConstantWrapper -{ - typedef typename Type::Value Value; - operator Value() const - { - return Type::evaluate(); - } -}; -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const ConstantWrapper& c) -{ - return ostream_write(ostream, typename Type::Value(c)); -} - -#define TYPE_CONSTANT(name, value, type) struct name##_CONSTANT_ { typedef type Value; static Value evaluate() { return value; } }; typedef ConstantWrapper name -#define STRING_CONSTANT(name, value) TYPE_CONSTANT(name, value, const char*) -#define INTEGER_CONSTANT(name, value) TYPE_CONSTANT(name, value, int) - -STRING_CONSTANT(EmptyString, ""); - -#endif diff --git a/libs/generic/enumeration.cpp b/libs/generic/enumeration.cpp deleted file mode 100644 index 4591fda9..00000000 --- a/libs/generic/enumeration.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "enumeration.h" - diff --git a/libs/generic/enumeration.h b/libs/generic/enumeration.h deleted file mode 100644 index 31e43052..00000000 --- a/libs/generic/enumeration.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_ENUMERATION_H) -#define INCLUDED_GENERIC_ENUMERATION_H - -/// \file -/// \brief Type safe enumeration. - -/// \brief An enumerated value. -/// -/// - Can be forward-declared when the definition of Enumeration is unknown. -/// - Can only be constructed from valid enumerated values. -/// - Can only be compared with others of the same type. -/// -/// \param Enumeration A type that contains an enum \c Value of the allowed values of the enumeration. -template -class EnumeratedValue : public Enumeration -{ - typename Enumeration::Value m_value; -public: - explicit EnumeratedValue(typename Enumeration::Value value) : m_value(value) - { - } - typename Enumeration::Value get() const - { - return m_value; - } -}; - -template -inline bool operator==(EnumeratedValue self, EnumeratedValue other) -{ - return self.get() == other.get(); -} -template -inline bool operator!=(EnumeratedValue self, EnumeratedValue other) -{ - return !operator==(self, other); -} - -#endif diff --git a/libs/generic/functional.cpp b/libs/generic/functional.cpp deleted file mode 100644 index 4717c8e2..00000000 --- a/libs/generic/functional.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "functional.h" - diff --git a/libs/generic/functional.h b/libs/generic/functional.h deleted file mode 100644 index bd253486..00000000 --- a/libs/generic/functional.h +++ /dev/null @@ -1,313 +0,0 @@ - -#if !defined(INCLUDED_FUNCTIONAL_H) -#define INCLUDED_FUNCTIONAL_H - -template -class Member -{ -public: - typedef Object& first_argument_type; - typedef R result_type; - static result_type call(first_argument_type object) - { - return (object.*member)(); - } -}; - -template -class ConstMember -{ -public: - typedef const Object& first_argument_type; - typedef R result_type; - static result_type call(first_argument_type object) - { - return (object.*member)(); - } -}; - -template -class Member1 -{ -public: - typedef Object& first_argument_type; - typedef A1 second_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a1) - { - return (object.*member)(a1); - } -}; - -template -class ConstMember1 -{ -public: - typedef const Object& first_argument_type; - typedef A1 second_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a1) - { - return (object.*member)(a1); - } -}; - -template -class Member2 -{ -public: - typedef Object& first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a2, third_argument_type a3) - { - return (object.*member)(a2, a3); - } -}; - -template -class ConstMember2 -{ -public: - typedef const Object& first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a2, third_argument_type a3) - { - return (object.*member)(a2, a3); - } -}; - -template -class Member3 -{ -public: - typedef Object& first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef A4 fourth_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a2, third_argument_type a3, fourth_argument_type a4) - { - return (object.*member)(a2, a3, a4); - } -}; - -template -class ConstMember3 -{ -public: - typedef const Object& first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef A4 fourth_argument_type; - typedef R result_type; - static result_type call(first_argument_type object, second_argument_type a2, third_argument_type a3, fourth_argument_type a4) - { - return (object.*member)(a2, a3, a4); - } -}; - -template -class Function0 -{ -public: - typedef R result_type; - static result_type call() - { - return (func)(); - } -}; - -template -class Function1 -{ -public: - typedef A1 first_argument_type; - typedef R result_type; - static result_type call(first_argument_type a1) - { - return (func)(a1); - } -}; - -template -class Function2 -{ -public: - typedef A1 first_argument_type; - typedef A2 second_argument_type; - typedef R result_type; - static result_type call(first_argument_type a1, second_argument_type a2) - { - return (func)(a1, a2); - } -}; - -template -class Function3 -{ -public: - typedef A1 first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef R result_type; - static result_type call(first_argument_type a1, second_argument_type a2, third_argument_type a3) - { - return (func)(a1, a2, a3); - } -}; - -template -class Function4 -{ -public: - typedef A1 first_argument_type; - typedef A2 second_argument_type; - typedef A3 third_argument_type; - typedef A4 fourth_argument_type; - typedef R result_type; - static result_type call(first_argument_type a1, second_argument_type a2, third_argument_type a3, fourth_argument_type a4) - { - return (func)(a1, a2, a3, a4); - } -}; - -template -class Caller0To1 -{ -public: - typedef FirstArgument first_argument_type; - typedef typename Caller::result_type result_type; - static result_type call(first_argument_type) - { - return Caller::call(); - } -}; - -template -class Caller1To2 -{ -public: - typedef FirstArgument first_argument_type; - typedef typename Caller::first_argument_type second_argument_type; - typedef typename Caller::result_type result_type; - static result_type call(first_argument_type, second_argument_type a2) - { - return Caller::call(a2); - } -}; - -template -class Caller2To3 -{ -public: - typedef FirstArgument first_argument_type; - typedef typename Caller::first_argument_type second_argument_type; - typedef typename Caller::second_argument_type third_argument_type; - typedef typename Caller::result_type result_type; - static result_type call(first_argument_type, second_argument_type a2, third_argument_type a3) - { - return Caller::call(a2, a3); - } -}; - -template -class Caller3To4 -{ -public: - typedef FirstArgument first_argument_type; - typedef typename Caller::first_argument_type second_argument_type; - typedef typename Caller::second_argument_type third_argument_type; - typedef typename Caller::third_argument_type fourth_argument_type; - typedef typename Caller::result_type result_type; - static result_type call(first_argument_type, second_argument_type a2, third_argument_type a3, fourth_argument_type a4) - { - return Caller::call(a2, a3, a4); - } -}; - -template -class FunctorInvoke -{ -public: - typedef typename Functor::result_type result_type; - inline result_type operator()(Functor functor) - { - return functor(); - } -}; - -template -class Functor1Invoke -{ - typename Functor::first_argument_type a1; -public: - typedef typename Functor::first_argument_type first_argument_type; - typedef typename Functor::result_type result_type; - Functor1Invoke(first_argument_type a1) : a1(a1) - { - } - inline result_type operator()(Functor functor) - { - return functor(a1); - } -}; - -template -class Functor2Invoke -{ - typename Functor::first_argument_type a1; - typename Functor::second_argument_type a2; -public: - typedef typename Functor::first_argument_type first_argument_type; - typedef typename Functor::second_argument_type second_argument_type; - typedef typename Functor::result_type result_type; - Functor2Invoke(first_argument_type a1, second_argument_type a2) - : a1(a1), a2(a2) - { - } - inline result_type operator()(Functor functor) - { - return functor(a1, a2); - } -}; - -template -class Functor3Invoke -{ - typename Functor::first_argument_type a1; - typename Functor::second_argument_type a2; - typename Functor::third_argument_type a3; -public: - typedef typename Functor::first_argument_type first_argument_type; - typedef typename Functor::second_argument_type second_argument_type; - typedef typename Functor::third_argument_type third_argument_type; - typedef typename Functor::result_type result_type; - Functor3Invoke(first_argument_type a1, second_argument_type a2, third_argument_type a3) - : a1(a1), a2(a2), a3(a3) - { - } - inline result_type operator()(Functor functor) - { - return functor(a1, a2, a3); - } -}; - -template -class TypeEqual -{ -public: - typedef False type; -}; -template -class TypeEqual -{ -public: - typedef True type; -}; - - -#endif diff --git a/libs/generic/object.cpp b/libs/generic/object.cpp deleted file mode 100644 index a6ed31c0..00000000 --- a/libs/generic/object.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "object.h" - -namespace -{ - class Blah - { - int i; - public: - Blah() - { - i = 3; - } - }; - - void Test() - { - char storage[sizeof(Blah)]; - constructor(*reinterpret_cast(storage)); - } -} \ No newline at end of file diff --git a/libs/generic/object.h b/libs/generic/object.h deleted file mode 100644 index ec8e7262..00000000 --- a/libs/generic/object.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_OBJECT_H) -#define INCLUDED_GENERIC_OBJECT_H - -/// \file -/// \brief Convenience functions (syntactic sugar) to wrap explicit constructor (aka in-place 'new') and destructor calls. -/// -/// Use makeReference() to wrap non-const-reference constructor parameters. - -#if _MSC_VER > 1000 && defined(WIN32) -#pragma warning(disable:4345) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized -#endif - -#include - -template -inline void constructor(Type& object) -{ - new(&object) Type(); -} - -template -inline void constructor(Type& object, const T1& t1) -{ - new(&object) Type(t1); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2) -{ - new(&object) Type(t1, t2); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3) -{ - new(&object) Type(t1, t2, t3); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4) -{ - new(&object) Type(t1, t2, t3, t4); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) -{ - new(&object) Type(t1, t2, t3, t4, t5); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) -{ - new(&object) Type(t1, t2, t3, t4, t5, t6); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) -{ - new(&object) Type(t1, t2, t3, t4, t5, t6, t7); -} - -template -inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) -{ - new(&object) Type(t1, t2, t3, t4, t5, t6, t7, t8); -} - -template -inline void destructor(Type& object) -{ - object.~Type(); -} - - - -#endif diff --git a/libs/generic/reference.cpp b/libs/generic/reference.cpp deleted file mode 100644 index c09cad82..00000000 --- a/libs/generic/reference.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "reference.h" diff --git a/libs/generic/reference.h b/libs/generic/reference.h deleted file mode 100644 index 62e2c238..00000000 --- a/libs/generic/reference.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_REFERENCE_H) -#define INCLUDED_GENERIC_REFERENCE_H - -/// \file -/// \brief Wrappers to allow storing objects in templated containers using 'reference' semantics. - -/// \brief A reference to a mutable object. -/// Has 'reference' semantics, except for \c 'operator==' and \c 'operator.'. -/// \param Type The type of the referenced object. -template -class Reference -{ - Type* m_contained; -public: - explicit Reference(Type& contained) : m_contained(&contained) - { - } - operator Type&() const - { - return *m_contained; - } - Type& get() const - { - return *m_contained; - } - Type* get_pointer() const - { - return m_contained; - } -}; - -template -bool operator<(const Reference& self, const Reference& other) -{ - return self.get() < other.get(); -} -template -bool operator==(const Reference& self, const Reference& other) -{ - return self.get() == other.get(); -} - -/// \brief construct a reference to a mutable object. -template -inline Reference makeReference(Type& value) -{ - return Reference(value); -} - -/// \brief A reference to a non-mutable object. -/// Has 'reference' semantics, except for \c 'operator==' and \c 'operator.'. -/// \param Type The type of the referenced object. -template -class ConstReference -{ - const Type* m_contained; -public: - explicit ConstReference(const Type& contained) : m_contained(&contained) - { - } - operator const Type&() const - { - return *m_contained; - } - const Type& get() const - { - return *m_contained; - } - const Type* get_pointer() const - { - return m_contained; - } -}; - -template -bool operator<(const ConstReference& self, const ConstReference& other) -{ - return self.get() < other.get(); -} -template -bool operator==(const ConstReference& self, const ConstReference& other) -{ - return self.get() == other.get(); -} - -/// \brief construct a reference to a non-mutable object. -template -inline ConstReference makeReference(const Type& value) -{ - return ConstReference(value); -} - - -#endif diff --git a/libs/generic/referencecounted.cpp b/libs/generic/referencecounted.cpp deleted file mode 100644 index 757e08d8..00000000 --- a/libs/generic/referencecounted.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "referencecounted.h" diff --git a/libs/generic/referencecounted.h b/libs/generic/referencecounted.h deleted file mode 100644 index e761cccc..00000000 --- a/libs/generic/referencecounted.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_REFERENCECOUNTED_H) -#define INCLUDED_GENERIC_REFERENCECOUNTED_H - -/// \file -/// \brief 'smart' pointers and references. - -#include - -template -class IncRefDecRefCounter -{ -public: - void increment(Type& value) - { - value.IncRef(); - } - void decrement(Type& value) - { - value.DecRef(); - } -}; - -/// \brief A smart-pointer that uses a counter stored in the object pointed-to. -template > -class SmartPointer : public Counter -{ - Type* m_value; -public: - - SmartPointer(const SmartPointer& other) - : m_value(other.m_value) - { - Counter::increment(*m_value); - } - explicit SmartPointer(Type* value) - : m_value(value) - { - Counter::increment(*m_value); - } - ~SmartPointer() - { - Counter::decrement(*m_value); - } - SmartPointer& operator=(const SmartPointer& other) - { - SmartPointer temp(other); - temp.swap(*this); - return *this; - } - SmartPointer& operator=(Type* value) - { - SmartPointer temp(value); - temp.swap(*this); - return *this; - } - void swap(SmartPointer& other) - { - std::swap(m_value, other.m_value); - } - - operator Type*() const - { - return m_value; - } - Type& operator*() const - { - return *m_value; - } - Type* operator->() const - { - return m_value; - } - Type* get() const - { - return m_value; - } -}; - -template -inline bool operator<(const SmartPointer& self, const SmartPointer& other) -{ - return self.get() < other.get(); -} -template -inline bool operator==(const SmartPointer& self, const SmartPointer& other) -{ - return self.get() == other.get(); -} -template -inline bool operator!=(const SmartPointer& self, const SmartPointer& other) -{ - return !::operator==(self, other); -} - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap(). - template - inline void swap(SmartPointer& self, SmartPointer& other) - { - self.swap(other); - } -} - - -/// \brief A smart-reference that uses a counter stored in the object pointed-to. -template > -class SmartReference : public Counter -{ - Type* m_value; -public: - - SmartReference(const SmartReference& other) - : m_value(other.m_value) - { - Counter::increment(*m_value); - } - explicit SmartReference(Type& value) - : m_value(&value) - { - Counter::increment(*m_value); - } - ~SmartReference() - { - Counter::decrement(*m_value); - } - SmartReference& operator=(const SmartReference& other) - { - SmartReference temp(other); - temp.swap(*this); - return *this; - } - SmartReference& operator=(Type& value) - { - SmartReference temp(value); - temp.swap(*this); - return *this; - } - void swap(SmartReference& other) - { - std::swap(m_value, other.m_value); - } - - operator Type&() const - { - return *m_value; - } - Type& get() const - { - return *m_value; - } - Type* get_pointer() const - { - return m_value; - } -}; - -template -inline bool operator<(const SmartReference& self, const SmartReference& other) -{ - return self.get() < other.get(); -} -template -inline bool operator==(const SmartReference& self, const SmartReference& other) -{ - return self.get() == other.get(); -} -template -inline bool operator!=(const SmartReference& self, const SmartReference& other) -{ - return !::operator==(self, other); -} - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap(). - template - inline void swap(SmartReference& self, SmartReference& other) - { - self.swap(other); - } -} - -#endif diff --git a/libs/generic/static.cpp b/libs/generic/static.cpp deleted file mode 100644 index ecd539f3..00000000 --- a/libs/generic/static.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "static.h" - -#if defined(_DEBUG) || defined(DOXYGEN) - -namespace ExampleStatic -{ - // Static example - // ---- myclass.h - class MyClass - { - public: - int value; - MyClass() : value(3) - { - } - }; - - typedef Static StaticMyClass; - - // ---- main.cpp - class DynamicInitialisation - { - public: - DynamicInitialisation() - { - // StaticMyClass::instance() may be invalid here because construction order is undefined - } - }; - - DynamicInitialisation g_dynamicInitialisation; - - void duringMain() - { - int bar = StaticMyClass::instance().value; - } - // end example -} - -namespace ExampleLazyStatic -{ - // LazyStatic example - // ---- myclass.h - class MyClass - { - public: - int value; - MyClass() : value(3) - { - } - // destructor will never be called - }; - - typedef LazyStatic StaticMyClass; - - // ---- main.cpp - class DynamicInitialisation - { - public: - DynamicInitialisation() - { - int bar = StaticMyClass::instance().value; - } - }; - - DynamicInitialisation g_dynamicInitialisation; - - void duringMain() - { - int bar = StaticMyClass::instance().value; - } - // end example -} - -namespace ExampleSmartStatic -{ - // SmartStatic example - // ---- myclass.h - class MyClass - { - public: - int value; - MyClass() : value(3) - { - } - }; - - typedef CountedStatic StaticMyClass; - - // ---- main.cpp - class DynamicInitialisation - { - public: - DynamicInitialisation() - { - // StaticMyClass::instance() is invalid before the ref is constructed - SmartStatic ref; - int bar = ref.instance().value; - - SmartStatic ref2; // any number of instances are allowed. - } - }; - - DynamicInitialisation g_dynamicInitialisation; - - void duringMain() - { - int bar = SmartStatic().instance().value; // an instance can be a temporary - } - // end example -} - -#endif diff --git a/libs/generic/static.h b/libs/generic/static.h deleted file mode 100644 index 81691827..00000000 --- a/libs/generic/static.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_STATIC_H) -#define INCLUDED_GENERIC_STATIC_H - -/// \file -/// \brief Template techniques for instantiating singletons. - -#include - -class Null -{ -}; - -/// \brief A singleton which is statically initialised. -/// -/// \param Type The singleton object type. -/// \param Type The type distinguishing this instance from others of the same type. -/// -/// \dontinclude generic/static.cpp -/// \skipline Static example -/// \until end example -template -class Static -{ - static Type m_instance; -public: - static Type& instance() - { - return m_instance; - } -}; - -template -Type Static::m_instance; - - -/// \brief A singleton which is lazily initialised. -/// The instance is constructed the first time it is referenced, and is never destroyed. -/// -/// \param Type The singleton object type. -/// \param Type The type distinguishing this instance from others of the same type. -/// -/// \dontinclude generic/static.cpp -/// \skipline LazyStatic example -/// \until end example -template -class LazyStatic -{ - static Type* m_instance; // this will be initialised to 0 by the CRT, according to the c++ standard -public: - static Type& instance() - { - if(m_instance == 0) - { - m_instance = new Type; // allocate using 'new' to get the correct alignment - } - return *m_instance; - } -}; - -template -Type* LazyStatic::m_instance; - - -/// \brief A singleton which keeps a count of the number of times it is referenced. -/// -/// The instance is constructed when its reference count changes from 0 to 1 and destroyed when its reference count changes from 1 to 0. -/// Use with SmartStatic. -/// -/// \param Type The singleton object type. -/// \param Type The type distinguishing this instance from others of the same type. -template -class CountedStatic -{ - static std::size_t m_refcount; // this will be initialised to 0 by the CRT, according to the c++ standard - static Type* m_instance; -public: - static Type& instance() - { - return *m_instance; - } - static void capture() - { - if(++m_refcount == 1) - { - m_instance = new Type; // allocate using 'new' to get the correct alignment - } - } - static void release() - { - if(--m_refcount == 0) - { - delete m_instance; - } - } -}; - -template -std::size_t CountedStatic::m_refcount; // this will be initialised to 0 by the CRT, according to the c++ standard -template -Type* CountedStatic::m_instance; - -/// \brief A reference to a CountedStatic. -/// Guarantees that CountedStatic will be constructed for the lifetime of this object. -/// -/// \param Type The type parameter of the CountedStatic to reference. -/// \param Type The type distinguishing this instance from others of the same type. -/// -/// \dontinclude generic/static.cpp -/// \skipline SmartStatic example -/// \until end example -template -class SmartStatic -{ -public: - SmartStatic() - { - CountedStatic::capture(); - } - ~SmartStatic() - { - CountedStatic::release(); - } - Type& instance() - { - return CountedStatic::instance(); - } -}; - - -#endif diff --git a/libs/generic/vector.cpp b/libs/generic/vector.cpp deleted file mode 100644 index 83765dcb..00000000 --- a/libs/generic/vector.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "vector.h" - diff --git a/libs/generic/vector.h b/libs/generic/vector.h deleted file mode 100644 index 6e6f74e2..00000000 --- a/libs/generic/vector.h +++ /dev/null @@ -1,259 +0,0 @@ - -#if !defined(INCLUDED_VECTOR_H) -#define INCLUDED_VECTOR_H - -#include - -template -class BasicVector2 -{ - Element m_elements[2]; -public: - BasicVector2() - { - } - BasicVector2(const Element& x_, const Element& y_) - { - x() = x_; - y() = y_; - } - - Element& x() - { - return m_elements[0]; - } - const Element& x() const - { - return m_elements[0]; - } - Element& y() - { - return m_elements[1]; - } - const Element& y() const - { - return m_elements[1]; - } - - const Element& operator[](std::size_t i) const - { - return m_elements[i]; - } - Element& operator[](std::size_t i) - { - return m_elements[i]; - } - - Element* data() - { - return m_elements; - } - const Element* data() const - { - return m_elements; - } -}; - -/// \brief A 3-element vector. -template -class BasicVector3 -{ - Element m_elements[3]; -public: - - BasicVector3() - { - } - template - BasicVector3(const BasicVector3& other) - { - x() = static_cast(other.x()); - y() = static_cast(other.y()); - z() = static_cast(other.z()); - } - BasicVector3(const Element& x_, const Element& y_, const Element& z_) - { - x() = x_; - y() = y_; - z() = z_; - } - - Element& x() - { - return m_elements[0]; - } - const Element& x() const - { - return m_elements[0]; - } - Element& y() - { - return m_elements[1]; - } - const Element& y() const - { - return m_elements[1]; - } - Element& z() - { - return m_elements[2]; - } - const Element& z() const - { - return m_elements[2]; - } - - const Element& operator[](std::size_t i) const - { - return m_elements[i]; - } - Element& operator[](std::size_t i) - { - return m_elements[i]; - } - - Element* data() - { - return m_elements; - } - const Element* data() const - { - return m_elements; - } -}; - -/// \brief A 4-element vector. -template -class BasicVector4 -{ - Element m_elements[4]; -public: - - BasicVector4() - { - } - BasicVector4(Element x_, Element y_, Element z_, Element w_) - { - x() = x_; - y() = y_; - z() = z_; - w() = w_; - } - BasicVector4(const BasicVector3& self, Element w_) - { - x() = self.x(); - y() = self.y(); - z() = self.z(); - w() = w_; - } - - Element& x() - { - return m_elements[0]; - } - const Element& x() const - { - return m_elements[0]; - } - Element& y() - { - return m_elements[1]; - } - const Element& y() const - { - return m_elements[1]; - } - Element& z() - { - return m_elements[2]; - } - const Element& z() const - { - return m_elements[2]; - } - Element& w() - { - return m_elements[3]; - } - const Element& w() const - { - return m_elements[3]; - } - - Element index(std::size_t i) const - { - return m_elements[i]; - } - Element& index(std::size_t i) - { - return m_elements[i]; - } - Element operator[](std::size_t i) const - { - return m_elements[i]; - } - Element& operator[](std::size_t i) - { - return m_elements[i]; - } - - Element* data() - { - return m_elements; - } - const Element* data() const - { - return m_elements; - } -}; - -template -inline BasicVector3 vector3_from_array(const Element* array) -{ - return BasicVector3(array[0], array[1], array[2]); -} - -template -inline Element* vector3_to_array(BasicVector3& self) -{ - return self.data(); -} -template -inline const Element* vector3_to_array(const BasicVector3& self) -{ - return self.data(); -} - -template -inline Element* vector4_to_array(BasicVector4& self) -{ - return self.data(); -} -template -inline const Element* vector4_to_array(const BasicVector4& self) -{ - return self.data(); -} - -template -inline BasicVector3& vector4_to_vector3(BasicVector4& self) -{ - return *reinterpret_cast*>(vector4_to_array(self)); -} -template -inline const BasicVector3& vector4_to_vector3(const BasicVector4& self) -{ - return *reinterpret_cast*>(vector4_to_array(self)); -} - -/// \brief A 2-element vector stored in single-precision floating-point. -typedef BasicVector2 Vector2; - -/// \brief A 3-element vector stored in single-precision floating-point. -typedef BasicVector3 Vector3; - -/// \brief A 4-element vector stored in single-precision floating-point. -typedef BasicVector4 Vector4; - - -#endif diff --git a/libs/gtkutil/accelerator.cpp b/libs/gtkutil/accelerator.cpp deleted file mode 100644 index af3eec17..00000000 --- a/libs/gtkutil/accelerator.cpp +++ /dev/null @@ -1,718 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "accelerator.h" - -#include "debugging/debugging.h" - -#include -#include -#include -#include - -#include "generic/callback.h" -#include "generic/bitfield.h" -#include "string/string.h" - -#include "pointer.h" -#include "closure.h" - -#include - - - -struct SKeyInfo -{ - const char* m_strName; - unsigned int m_nVKKey; -}; - -SKeyInfo g_Keys[] = -{ - {"Space", GDK_space}, - {"Backspace", GDK_BackSpace}, - {"Escape", GDK_Escape}, - {"End", GDK_End}, - {"Insert", GDK_Insert}, - {"Delete", GDK_Delete}, - {"PageUp", GDK_Prior}, - {"PageDown", GDK_Next}, - {"Up", GDK_Up}, - {"Down", GDK_Down}, - {"Left", GDK_Left}, - {"Right", GDK_Right}, - {"F1", GDK_F1}, - {"F2", GDK_F2}, - {"F3", GDK_F3}, - {"F4", GDK_F4}, - {"F5", GDK_F5}, - {"F6", GDK_F6}, - {"F7", GDK_F7}, - {"F8", GDK_F8}, - {"F9", GDK_F9}, - {"F10", GDK_F10}, - {"F11", GDK_F11}, - {"F12", GDK_F12}, - {"Tab", GDK_Tab}, - {"Return", GDK_Return}, - {"Comma", GDK_comma}, - {"Period", GDK_period}, - {"Plus", GDK_KP_Add}, - {"Multiply", GDK_multiply}, - {"Minus", GDK_KP_Subtract}, - {"NumPad0", GDK_KP_0}, - {"NumPad1", GDK_KP_1}, - {"NumPad2", GDK_KP_2}, - {"NumPad3", GDK_KP_3}, - {"NumPad4", GDK_KP_4}, - {"NumPad5", GDK_KP_5}, - {"NumPad6", GDK_KP_6}, - {"NumPad7", GDK_KP_7}, - {"NumPad8", GDK_KP_8}, - {"NumPad9", GDK_KP_9}, - {"[", 219}, - {"]", 221}, - {"\\", 220}, - {"Home", GDK_Home} -}; - -int g_nKeyCount = sizeof(g_Keys) / sizeof(SKeyInfo); - -const char* global_keys_find(unsigned int key) -{ - for(int i = 0; i < g_nKeyCount; ++i) - { - if(g_Keys[i].m_nVKKey == key) - { - return g_Keys[i].m_strName; - } - } - return ""; -} - -unsigned int global_keys_find(const char* name) -{ - for(int i = 0; i < g_nKeyCount; ++i) - { - if(string_equal_nocase(g_Keys[i].m_strName, name)) - { - return g_Keys[i].m_nVKKey; - } - } - return 0; -} - -void accelerator_write(const Accelerator& accelerator, TextOutputStream& ostream) -{ - if(accelerator.modifiers & GDK_SHIFT_MASK) - { - ostream << "Shift + "; - } - if(accelerator.modifiers & GDK_MOD1_MASK) - { - ostream << "Alt + "; - } - if(accelerator.modifiers & GDK_CONTROL_MASK) - { - ostream << "Control + "; - } - - const char* keyName = global_keys_find(accelerator.key); - if(!string_empty(keyName)) - { - ostream << keyName; - } - else - { - ostream << static_cast(accelerator.key); - } -} - -typedef std::map AcceleratorMap; -typedef std::set AcceleratorSet; - -bool accelerator_map_insert(AcceleratorMap& acceleratorMap, Accelerator accelerator, const Callback& callback) -{ - if(accelerator.key != 0) - { - return acceleratorMap.insert(AcceleratorMap::value_type(accelerator, callback)).second; - } - return true; -} - -bool accelerator_map_erase(AcceleratorMap& acceleratorMap, Accelerator accelerator) -{ - if(accelerator.key != 0) - { - AcceleratorMap::iterator i = acceleratorMap.find(accelerator); - if(i == acceleratorMap.end()) - { - return false; - } - acceleratorMap.erase(i); - } - return true; -} - -Accelerator accelerator_for_event_key(guint keyval, guint state) -{ - keyval = gdk_keyval_to_upper(keyval); - if(keyval == GDK_ISO_Left_Tab) - keyval = GDK_Tab; - return Accelerator(keyval, (GdkModifierType)(state & gtk_accelerator_get_default_mod_mask())); -} - -bool AcceleratorMap_activate(const AcceleratorMap& acceleratorMap, const Accelerator& accelerator) -{ - AcceleratorMap::const_iterator i = acceleratorMap.find(accelerator); - if(i != acceleratorMap.end()) - { - (*i).second(); - return true; - } - - return false; -} - -static gboolean accelerator_key_event(GtkWindow* window, GdkEventKey* event, AcceleratorMap* acceleratorMap) -{ - return AcceleratorMap_activate(*acceleratorMap, accelerator_for_event_key(event->keyval, event->state)); -} - - -AcceleratorMap g_special_accelerators; - - -namespace MouseButton -{ - enum - { - Left = 1 << 0, - Right = 1 << 1, - Middle = 1 << 2, - }; -} - -typedef unsigned int ButtonMask; - -void print_buttons(ButtonMask mask) -{ - globalOutputStream() << "button state: "; - if((mask & MouseButton::Left) != 0) - { - globalOutputStream() << "Left "; - } - if((mask & MouseButton::Right) != 0) - { - globalOutputStream() << "Right "; - } - if((mask & MouseButton::Middle) != 0) - { - globalOutputStream() << "Middle "; - } - globalOutputStream() << "\n"; -} - -ButtonMask ButtonMask_for_event_button(guint button) -{ - switch(button) - { - case 1: - return MouseButton::Left; - case 2: - return MouseButton::Middle; - case 3: - return MouseButton::Right; - } - return 0; -} - -bool window_has_accel(GtkWindow* toplevel) -{ - return g_slist_length(gtk_accel_groups_from_object(G_OBJECT(toplevel))) != 0; -} - -namespace -{ - bool g_accel_enabled = true; -} - -bool global_accel_enabled() -{ - return g_accel_enabled; -} - - -GClosure* accel_group_add_accelerator(GtkAccelGroup* group, Accelerator accelerator, const Callback& callback); -void accel_group_remove_accelerator(GtkAccelGroup* group, Accelerator accelerator); - -AcceleratorMap g_queuedAcceleratorsAdd; -AcceleratorSet g_queuedAcceleratorsRemove; - -void globalQueuedAccelerators_add(Accelerator accelerator, const Callback& callback) -{ - if(!g_queuedAcceleratorsAdd.insert(AcceleratorMap::value_type(accelerator, callback)).second) - { - globalErrorStream() << "globalQueuedAccelerators_add: accelerator already queued: " << accelerator << "\n"; - } -} - -void globalQueuedAccelerators_remove(Accelerator accelerator) -{ - if(g_queuedAcceleratorsAdd.erase(accelerator) == 0) - { - if(!g_queuedAcceleratorsRemove.insert(accelerator).second) - { - globalErrorStream() << "globalQueuedAccelerators_remove: accelerator already queued: " << accelerator << "\n"; - } - } -} - -void globalQueuedAccelerators_commit() -{ - for(AcceleratorSet::const_iterator i = g_queuedAcceleratorsRemove.begin(); i != g_queuedAcceleratorsRemove.end(); ++i) - { - //globalOutputStream() << "removing: " << (*i).first << "\n"; - accel_group_remove_accelerator(global_accel, *i); - } - g_queuedAcceleratorsRemove.clear(); - for(AcceleratorMap::const_iterator i = g_queuedAcceleratorsAdd.begin(); i != g_queuedAcceleratorsAdd.end(); ++i) - { - //globalOutputStream() << "adding: " << (*i).first << "\n"; - accel_group_add_accelerator(global_accel, (*i).first, (*i).second); - } - g_queuedAcceleratorsAdd.clear(); -} - -void accel_group_test(GtkWindow* toplevel, GtkAccelGroup* accel) -{ - guint n_entries; - gtk_accel_group_query(accel, '4', (GdkModifierType)0, &n_entries); - globalOutputStream() << "grid4: " << n_entries << "\n"; - globalOutputStream() << "toplevel accelgroups: " << g_slist_length(gtk_accel_groups_from_object(G_OBJECT(toplevel))) << "\n"; -} - -typedef std::set WindowSet; -WindowSet g_accel_windows; - -bool Buttons_press(ButtonMask& buttons, guint button, guint state) -{ - if(buttons == 0 && bitfield_enable(buttons, ButtonMask_for_event_button(button)) != 0) - { - ASSERT_MESSAGE(g_accel_enabled, "Buttons_press: accelerators not enabled"); - g_accel_enabled = false; - for(WindowSet::iterator i = g_accel_windows.begin(); i != g_accel_windows.end(); ++i) - { - GtkWindow* toplevel = *i; - ASSERT_MESSAGE(window_has_accel(toplevel), "ERROR"); - ASSERT_MESSAGE(GTK_WIDGET_TOPLEVEL(toplevel), "disabling accel for non-toplevel window"); - gtk_window_remove_accel_group(toplevel, global_accel); -#if 0 - globalOutputStream() << reinterpret_cast(toplevel) << ": disabled global accelerators\n"; -#endif -#if 0 - accel_group_test(toplevel, global_accel); -#endif - } - } - buttons = bitfield_enable(buttons, ButtonMask_for_event_button(button)); -#if 0 - globalOutputStream() << "Buttons_press: "; - print_buttons(buttons); -#endif - return false; -} - -bool Buttons_release(ButtonMask& buttons, guint button, guint state) -{ - if(buttons != 0 && bitfield_disable(buttons, ButtonMask_for_event_button(button)) == 0) - { - ASSERT_MESSAGE(!g_accel_enabled, "Buttons_release: accelerators are enabled"); - g_accel_enabled = true; - for(WindowSet::iterator i = g_accel_windows.begin(); i != g_accel_windows.end(); ++i) - { - GtkWindow* toplevel = *i; - ASSERT_MESSAGE(!window_has_accel(toplevel), "ERROR"); - ASSERT_MESSAGE(GTK_WIDGET_TOPLEVEL(toplevel), "enabling accel for non-toplevel window"); - gtk_window_add_accel_group(toplevel, global_accel); -#if 0 - globalOutputStream() << reinterpret_cast(toplevel) << ": enabled global accelerators\n"; -#endif -#if 0 - accel_group_test(toplevel, global_accel); -#endif - } - globalQueuedAccelerators_commit(); - } - buttons = bitfield_disable(buttons, ButtonMask_for_event_button(button)); -#if 0 - globalOutputStream() << "Buttons_release: "; - print_buttons(buttons); -#endif - return false; -} - -bool Buttons_releaseAll(ButtonMask& buttons) -{ - Buttons_release(buttons, MouseButton::Left | MouseButton::Middle | MouseButton::Right, 0); - return false; -} - -struct PressedButtons -{ - ButtonMask buttons; - - PressedButtons() : buttons(0) - { - } -}; - -gboolean PressedButtons_button_press(GtkWidget* widget, GdkEventButton* event, PressedButtons* pressed) -{ - if(event->type == GDK_BUTTON_PRESS) - { - return Buttons_press(pressed->buttons, event->button, event->state); - } - return FALSE; -} - -gboolean PressedButtons_button_release(GtkWidget* widget, GdkEventButton* event, PressedButtons* pressed) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - return Buttons_release(pressed->buttons, event->button, event->state); - } - return FALSE; -} - -gboolean PressedButtons_focus_out(GtkWidget* widget, GdkEventFocus* event, PressedButtons* pressed) -{ - Buttons_releaseAll(pressed->buttons); - return FALSE; -} - -void PressedButtons_connect(PressedButtons& pressedButtons, GtkWidget* widget) -{ - g_signal_connect(G_OBJECT(widget), "button_press_event", G_CALLBACK(PressedButtons_button_press), &pressedButtons); - g_signal_connect(G_OBJECT(widget), "button_release_event", G_CALLBACK(PressedButtons_button_release), &pressedButtons); - g_signal_connect(G_OBJECT(widget), "focus_out_event", G_CALLBACK(PressedButtons_focus_out), &pressedButtons); -} - -PressedButtons g_pressedButtons; - - -#include - -struct PressedKeys -{ - typedef std::set Keys; - Keys keys; - std::size_t refcount; - - PressedKeys() : refcount(0) - { - } -}; - -AcceleratorMap g_keydown_accelerators; -AcceleratorMap g_keyup_accelerators; - -bool Keys_press(PressedKeys::Keys& keys, guint keyval) -{ - if(keys.insert(keyval).second) - { - return AcceleratorMap_activate(g_keydown_accelerators, accelerator_for_event_key(keyval, 0)); - } - return g_keydown_accelerators.find(accelerator_for_event_key(keyval, 0)) != g_keydown_accelerators.end(); -} - -bool Keys_release(PressedKeys::Keys& keys, guint keyval) -{ - if(keys.erase(keyval) != 0) - { - return AcceleratorMap_activate(g_keyup_accelerators, accelerator_for_event_key(keyval, 0)); - } - return g_keyup_accelerators.find(accelerator_for_event_key(keyval, 0)) != g_keyup_accelerators.end(); -} - -void Keys_releaseAll(PressedKeys::Keys& keys, guint state) -{ - for(PressedKeys::Keys::iterator i = keys.begin(); i != keys.end(); ++i) - { - AcceleratorMap_activate(g_keyup_accelerators, accelerator_for_event_key(*i, state)); - } - keys.clear(); -} - -gboolean PressedKeys_key_press(GtkWidget* widget, GdkEventKey* event, PressedKeys* pressedKeys) -{ - //globalOutputStream() << "pressed: " << event->keyval << "\n"; - return event->state == 0 && Keys_press(pressedKeys->keys, event->keyval); -} - -gboolean PressedKeys_key_release(GtkWidget* widget, GdkEventKey* event, PressedKeys* pressedKeys) -{ - //globalOutputStream() << "released: " << event->keyval << "\n"; - return Keys_release(pressedKeys->keys, event->keyval); -} - -gboolean PressedKeys_focus_in(GtkWidget* widget, GdkEventFocus* event, PressedKeys* pressedKeys) -{ - ++pressedKeys->refcount; - return FALSE; -} - -gboolean PressedKeys_focus_out(GtkWidget* widget, GdkEventFocus* event, PressedKeys* pressedKeys) -{ - if(--pressedKeys->refcount == 0) - { - Keys_releaseAll(pressedKeys->keys, 0); - } - return FALSE; -} - -PressedKeys g_pressedKeys; - -void GlobalPressedKeys_releaseAll() -{ - Keys_releaseAll(g_pressedKeys.keys, 0); -} - -void GlobalPressedKeys_connect(GtkWindow* window) -{ - unsigned int key_press_handler = g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(PressedKeys_key_press), &g_pressedKeys); - unsigned int key_release_handler = g_signal_connect(G_OBJECT(window), "key_release_event", G_CALLBACK(PressedKeys_key_release), &g_pressedKeys); - g_object_set_data(G_OBJECT(window), "key_press_handler", gint_to_pointer(key_press_handler)); - g_object_set_data(G_OBJECT(window), "key_release_handler", gint_to_pointer(key_release_handler)); - unsigned int focus_in_handler = g_signal_connect(G_OBJECT(window), "focus_in_event", G_CALLBACK(PressedKeys_focus_in), &g_pressedKeys); - unsigned int focus_out_handler = g_signal_connect(G_OBJECT(window), "focus_out_event", G_CALLBACK(PressedKeys_focus_out), &g_pressedKeys); - g_object_set_data(G_OBJECT(window), "focus_in_handler", gint_to_pointer(focus_in_handler)); - g_object_set_data(G_OBJECT(window), "focus_out_handler", gint_to_pointer(focus_out_handler)); -} - -void GlobalPressedKeys_disconnect(GtkWindow* window) -{ - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_press_handler"))); - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_release_handler"))); - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "focus_in_handler"))); - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "focus_out_handler"))); -} - - - -void special_accelerators_add(Accelerator accelerator, const Callback& callback) -{ - //globalOutputStream() << "special_accelerators_add: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_insert(g_special_accelerators, accelerator, callback)) - { - globalErrorStream() << "special_accelerators_add: already exists: " << makeQuoted(accelerator) << "\n"; - } -} -void special_accelerators_remove(Accelerator accelerator) -{ - //globalOutputStream() << "special_accelerators_remove: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_erase(g_special_accelerators, accelerator)) - { - globalErrorStream() << "special_accelerators_remove: not found: " << makeQuoted(accelerator) << "\n"; - } -} - -void keydown_accelerators_add(Accelerator accelerator, const Callback& callback) -{ - //globalOutputStream() << "keydown_accelerators_add: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_insert(g_keydown_accelerators, accelerator, callback)) - { - globalErrorStream() << "keydown_accelerators_add: already exists: " << makeQuoted(accelerator) << "\n"; - } -} -void keydown_accelerators_remove(Accelerator accelerator) -{ - //globalOutputStream() << "keydown_accelerators_remove: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_erase(g_keydown_accelerators, accelerator)) - { - globalErrorStream() << "keydown_accelerators_remove: not found: " << makeQuoted(accelerator) << "\n"; - } -} - -void keyup_accelerators_add(Accelerator accelerator, const Callback& callback) -{ - //globalOutputStream() << "keyup_accelerators_add: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_insert(g_keyup_accelerators, accelerator, callback)) - { - globalErrorStream() << "keyup_accelerators_add: already exists: " << makeQuoted(accelerator) << "\n"; - } -} -void keyup_accelerators_remove(Accelerator accelerator) -{ - //globalOutputStream() << "keyup_accelerators_remove: " << makeQuoted(accelerator) << "\n"; - if(!accelerator_map_erase(g_keyup_accelerators, accelerator)) - { - globalErrorStream() << "keyup_accelerators_remove: not found: " << makeQuoted(accelerator) << "\n"; - } -} - - -gboolean accel_closure_callback(GtkAccelGroup* group, GtkWidget* widget, guint key, GdkModifierType modifiers, gpointer data) -{ - (*reinterpret_cast(data))(); - return TRUE; -} - -GClosure* accel_group_add_accelerator(GtkAccelGroup* group, Accelerator accelerator, const Callback& callback) -{ - if(accelerator.key != 0 && gtk_accelerator_valid(accelerator.key, accelerator.modifiers)) - { - //globalOutputStream() << "global_accel_connect: " << makeQuoted(accelerator) << "\n"; - GClosure* closure = create_cclosure(G_CALLBACK(accel_closure_callback), callback); - gtk_accel_group_connect(group, accelerator.key, accelerator.modifiers, GTK_ACCEL_VISIBLE, closure); - return closure; - } - else - { - special_accelerators_add(accelerator, callback); - return 0; - } -} - -void accel_group_remove_accelerator(GtkAccelGroup* group, Accelerator accelerator) -{ - if(accelerator.key != 0 && gtk_accelerator_valid(accelerator.key, accelerator.modifiers)) - { - //globalOutputStream() << "global_accel_disconnect: " << makeQuoted(accelerator) << "\n"; - gtk_accel_group_disconnect_key(group, accelerator.key, accelerator.modifiers); - } - else - { - special_accelerators_remove(accelerator); - } -} - -GtkAccelGroup* global_accel = 0; - -void global_accel_init() -{ - global_accel = gtk_accel_group_new(); -} - -void global_accel_destroy() -{ - g_object_unref(global_accel); -} - -GClosure* global_accel_group_add_accelerator(Accelerator accelerator, const Callback& callback) -{ - if(!global_accel_enabled()) - { - // workaround: cannot add to GtkAccelGroup while it is disabled - //globalOutputStream() << "queued for add: " << accelerator << "\n"; - globalQueuedAccelerators_add(accelerator, callback); - return 0; - } - return accel_group_add_accelerator(global_accel, accelerator, callback); -} -void global_accel_group_remove_accelerator(Accelerator accelerator) -{ - if(!global_accel_enabled()) - { - //globalOutputStream() << "queued for remove: " << accelerator << "\n"; - globalQueuedAccelerators_remove(accelerator); - return; - } - accel_group_remove_accelerator(global_accel, accelerator); -} - -/// \brief Propagates key events to the focus-widget, overriding global accelerators. -static gboolean override_global_accelerators(GtkWindow* window, GdkEventKey* event, gpointer data) -{ - gboolean b = gtk_window_propagate_key_event(window, event); - return b; -} - -void global_accel_connect_window(GtkWindow* window) -{ -#if 1 - unsigned int override_handler = g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(override_global_accelerators), 0); - g_object_set_data(G_OBJECT(window), "override_handler", gint_to_pointer(override_handler)); - - unsigned int special_key_press_handler = g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(accelerator_key_event), &g_special_accelerators); - g_object_set_data(G_OBJECT(window), "special_key_press_handler", gint_to_pointer(special_key_press_handler)); - - GlobalPressedKeys_connect(window); -#else - unsigned int key_press_handler = g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(accelerator_key_event), &g_keydown_accelerators); - unsigned int key_release_handler = g_signal_connect(G_OBJECT(window), "key_release_event", G_CALLBACK(accelerator_key_event), &g_keyup_accelerators); - g_object_set_data(G_OBJECT(window), "key_press_handler", gint_to_pointer(key_press_handler)); - g_object_set_data(G_OBJECT(window), "key_release_handler", gint_to_pointer(key_release_handler)); -#endif - g_accel_windows.insert(window); - gtk_window_add_accel_group(window, global_accel); -} -void global_accel_disconnect_window(GtkWindow* window) -{ -#if 1 - GlobalPressedKeys_disconnect(window); - - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "override_handler"))); - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "special_key_press_handler"))); -#else - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_press_handler"))); - g_signal_handler_disconnect(G_OBJECT(window), gpointer_to_int(g_object_get_data(G_OBJECT(window), "key_release_handler"))); -#endif - gtk_window_remove_accel_group(window, global_accel); - std::size_t count = g_accel_windows.erase(window); - ASSERT_MESSAGE(count == 1, "failed to remove accel group\n"); -} - - -GClosure* global_accel_group_find(Accelerator accelerator) -{ - guint numEntries = 0; - GtkAccelGroupEntry* entry = gtk_accel_group_query(global_accel, accelerator.key, accelerator.modifiers, &numEntries); - if(numEntries != 0) - { - if(numEntries != 1) - { - char* name = gtk_accelerator_name(accelerator.key, accelerator.modifiers); - globalErrorStream() << "accelerator already in-use: " << name << "\n"; - g_free(name); - } - return entry->closure; - } - return 0; -} - -void global_accel_group_connect(const Accelerator& accelerator, const Callback& callback) -{ - if(accelerator.key != 0) - { - global_accel_group_add_accelerator(accelerator, callback); - } -} - -void global_accel_group_disconnect(const Accelerator& accelerator, const Callback& callback) -{ - if(accelerator.key != 0) - { - global_accel_group_remove_accelerator(accelerator); - } -} - - diff --git a/libs/gtkutil/accelerator.h b/libs/gtkutil/accelerator.h deleted file mode 100644 index 4f7085a7..00000000 --- a/libs/gtkutil/accelerator.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_ACCELERATOR_H) -#define INCLUDED_GTKUTIL_ACCELERATOR_H - -#include -#include - -#include "generic/callback.h" - -struct Accelerator -{ - Accelerator(guint _key) - : key(_key), modifiers((GdkModifierType)0) - { - } - Accelerator(guint _key, GdkModifierType _modifiers) - : key(_key), modifiers(_modifiers) - { - } - bool operator<(const Accelerator& other) const - { - return key < other.key || (!(other.key < key) && modifiers < other.modifiers); - } - guint key; - GdkModifierType modifiers; -}; - -inline Accelerator accelerator_null() -{ - return Accelerator(0, (GdkModifierType)0); -} - -const char* global_keys_find(unsigned int key); -unsigned int global_keys_find(const char* name); - -class TextOutputStream; -void accelerator_write(const Accelerator& accelerator, TextOutputStream& ostream); - -template -TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Accelerator& accelerator) -{ - accelerator_write(accelerator, ostream); - return ostream; -} - -void keydown_accelerators_add(Accelerator accelerator, const Callback& callback); -void keydown_accelerators_remove(Accelerator accelerator); -void keyup_accelerators_add(Accelerator accelerator, const Callback& callback); -void keyup_accelerators_remove(Accelerator accelerator); - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -void global_accel_connect_window(GtkWindow* window); -void global_accel_disconnect_window(GtkWindow* window); - -void GlobalPressedKeys_releaseAll(); - -typedef struct _GtkAccelGroup GtkAccelGroup; -extern GtkAccelGroup* global_accel; -void global_accel_init(); -void global_accel_destroy(); - -GClosure* global_accel_group_find(Accelerator accelerator); - -void global_accel_group_connect(const Accelerator& accelerator, const Callback& callback); -void global_accel_group_disconnect(const Accelerator& accelerator, const Callback& callback); - - -class Command -{ -public: - Callback m_callback; - const Accelerator& m_accelerator; - Command(const Callback& callback, const Accelerator& accelerator) : m_callback(callback), m_accelerator(accelerator) - { - } -}; - -class Toggle -{ -public: - Command m_command; - BoolExportCallback m_exportCallback; - Toggle(const Callback& callback, const Accelerator& accelerator, const BoolExportCallback& exportCallback) : m_command(callback, accelerator), m_exportCallback(exportCallback) - { - } -}; - -class KeyEvent -{ -public: - const Accelerator& m_accelerator; - Callback m_keyDown; - Callback m_keyUp; - KeyEvent(const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp) : m_accelerator(accelerator), m_keyDown(keyDown), m_keyUp(keyUp) - { - } -}; - - - -struct PressedButtons; -typedef struct _GtkWidget GtkWidget; -void PressedButtons_connect(PressedButtons& pressedButtons, GtkWidget* widget); - -extern PressedButtons g_pressedButtons; - -#endif diff --git a/libs/gtkutil/button.cpp b/libs/gtkutil/button.cpp deleted file mode 100644 index 0356ba39..00000000 --- a/libs/gtkutil/button.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "button.h" - -#include - -#include "stream/textstream.h" -#include "stream/stringstream.h" -#include "generic/callback.h" - -#include "image.h" -#include "pointer.h" - -void clicked_closure_callback(GtkWidget* widget, gpointer data) -{ - (*reinterpret_cast(data))(); -} - -void button_connect_callback(GtkButton* button, const Callback& callback) -{ -#if 1 - g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(callback.getThunk()), callback.getEnvironment()); -#else - g_signal_connect_closure(G_OBJECT(button), "clicked", create_cclosure(G_CALLBACK(clicked_closure_callback), callback), FALSE); -#endif -} - -guint toggle_button_connect_callback(GtkToggleButton* button, const Callback& callback) -{ -#if 1 - guint handler = g_signal_connect_swapped(G_OBJECT(button), "toggled", G_CALLBACK(callback.getThunk()), callback.getEnvironment()); -#else - guint handler = g_signal_connect_closure(G_OBJECT(button), "toggled", create_cclosure(G_CALLBACK(clicked_closure_callback), callback), TRUE); -#endif - g_object_set_data(G_OBJECT(button), "handler", gint_to_pointer(handler)); - return handler; -} - -void button_set_icon(GtkButton* button, const char* icon) -{ - GtkImage* image = new_local_image(icon); - gtk_widget_show(GTK_WIDGET(image)); - gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(image)); -} - -void toggle_button_set_active_no_signal(GtkToggleButton* button, gboolean active) -{ - //globalOutputStream() << "set active: " << active << "\n"; - guint handler_id = gpointer_to_int(g_object_get_data(G_OBJECT(button), "handler")); - //guint signal_id = g_signal_lookup("toggled", G_OBJECT_TYPE (button)); - //globalOutputStream() << "signal_id: " << signal_id << "\n"; - //guint found = g_signal_handler_find(G_OBJECT(button), G_SIGNAL_MATCH_ID, signal_id, 0, 0, 0, 0); - //globalOutputStream() << " handler found: " << found << "\n"; - g_signal_handler_block(G_OBJECT(button), handler_id); - gtk_toggle_button_set_active(button, active); - g_signal_handler_unblock(G_OBJECT(button), handler_id); -} - - -void radio_button_print_state(GtkRadioButton* button) -{ - globalOutputStream() << "toggle button: "; - for(GSList* radio = gtk_radio_button_group(button); radio != 0; radio = g_slist_next(radio)) - { - globalOutputStream() << gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio->data)); - } - globalOutputStream() << "\n"; -} - -GtkToggleButton* radio_button_get_nth(GtkRadioButton* radio, int index) -{ - GSList *group = gtk_radio_button_group(radio); - return GTK_TOGGLE_BUTTON(g_slist_nth_data(group, g_slist_length(group) - index - 1)); -} - -void radio_button_set_active(GtkRadioButton* radio, int index) -{ - //radio_button_print_state(radio); - gtk_toggle_button_set_active(radio_button_get_nth(radio, index), TRUE); - //radio_button_print_state(radio); -} - -void radio_button_set_active_no_signal(GtkRadioButton* radio, int index) -{ - { - for(GSList* l = gtk_radio_button_get_group(radio); l != 0; l = g_slist_next(l)) - { - g_signal_handler_block(G_OBJECT(l->data), gpointer_to_int(g_object_get_data(G_OBJECT(l->data), "handler"))); - } - } - radio_button_set_active(radio, index); - { - for(GSList* l = gtk_radio_button_get_group(radio); l != 0; l = g_slist_next(l)) - { - g_signal_handler_unblock(G_OBJECT(l->data), gpointer_to_int(g_object_get_data(G_OBJECT(l->data), "handler"))); - } - } -} - -int radio_button_get_active(GtkRadioButton* radio) -{ - //radio_button_print_state(radio); - GSList *group = gtk_radio_button_group(radio); - int index = g_slist_length(group) - 1; - for (; group != 0; group = g_slist_next(group)) - { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group->data))) - { - break; - } - else - { - index--; - } - } - return index; -} - diff --git a/libs/gtkutil/button.h b/libs/gtkutil/button.h deleted file mode 100644 index 69ddac4b..00000000 --- a/libs/gtkutil/button.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_BUTTON_H) -#define INCLUDED_GTKUTIL_BUTTON_H - -#include "generic/callbackfwd.h" - -typedef struct _GtkButton GtkButton; -typedef struct _GtkToggleButton GtkToggleButton; -typedef struct _GtkRadioButton GtkRadioButton; -typedef int gint; -typedef gint gboolean; -typedef unsigned int guint; - -void button_connect_callback(GtkButton* button, const Callback& callback); -guint toggle_button_connect_callback(GtkToggleButton* button, const Callback& callback); - -void button_set_icon(GtkButton* button, const char* icon); -void toggle_button_set_active_no_signal(GtkToggleButton* item, gboolean active); - -void radio_button_set_active(GtkRadioButton* radio, int index); -void radio_button_set_active_no_signal(GtkRadioButton* radio, int index); -int radio_button_get_active(GtkRadioButton* radio); - -#endif diff --git a/libs/gtkutil/clipboard.cpp b/libs/gtkutil/clipboard.cpp deleted file mode 100644 index f7b9466a..00000000 --- a/libs/gtkutil/clipboard.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "clipboard.h" - -#include "stream/memstream.h" -#include "stream/textstream.h" - - -/// \file -/// \brief Platform-independent GTK clipboard support. -/// \todo Using GDK_SELECTION_CLIPBOARD fails on win32, so we use the win32 API directly for now. -#if defined(WIN32) - -const char* c_clipboard_format = "RadiantClippings"; - -#include - -void clipboard_copy(ClipboardCopyFunc copy) -{ - BufferOutputStream ostream; - copy(ostream); - - bool bClipped = false; - UINT nClipboard = ::RegisterClipboardFormat(c_clipboard_format); - if (nClipboard > 0) - { - if (::OpenClipboard(0)) - { - EmptyClipboard(); - std::size_t length = ostream.size(); - HANDLE h = ::GlobalAlloc(GMEM_ZEROINIT | GMEM_MOVEABLE | GMEM_DDESHARE, length + sizeof(std::size_t)); - if (h != 0) - { - char *buffer = reinterpret_cast(::GlobalLock(h)); - *reinterpret_cast(buffer) = length; - buffer += sizeof(std::size_t); - memcpy(buffer, ostream.data(), length); - ::GlobalUnlock(h); - ::SetClipboardData(nClipboard, h); - ::CloseClipboard(); - bClipped = true; - } - } - } - - if (!bClipped) - { - globalOutputStream() << "Unable to register Windows clipboard formats, copy/paste between editors will not be possible\n"; - } -} - -void clipboard_paste(ClipboardPasteFunc paste) -{ - UINT nClipboard = ::RegisterClipboardFormat(c_clipboard_format); - if (nClipboard > 0 && ::OpenClipboard(0)) - { - if(IsClipboardFormatAvailable(nClipboard)) - { - HANDLE h = ::GetClipboardData(nClipboard); - if(h) - { - const char *buffer = reinterpret_cast(::GlobalLock(h)); - std::size_t length = *reinterpret_cast(buffer); - buffer += sizeof(std::size_t); - BufferInputStream istream(buffer, length); - paste(istream); - ::GlobalUnlock(h); - } - } - ::CloseClipboard(); - } -} - -#else - -#include - -enum -{ - RADIANT_CLIPPINGS = 23, -}; - -static const GtkTargetEntry clipboard_targets[] = { - { "RADIANT_CLIPPINGS", 0, RADIANT_CLIPPINGS, }, -}; - -static void clipboard_get (GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer data) -{ - std::size_t len = *reinterpret_cast(data); - const char* buffer = (len != 0) ? reinterpret_cast(data) + sizeof(std::size_t) : 0; - - GdkAtom type = GDK_NONE; - if(info == clipboard_targets[0].info) - { - type = gdk_atom_intern(clipboard_targets[0].target, FALSE); - } - - gtk_selection_data_set (selection_data, type, 8, reinterpret_cast(buffer), static_cast(len)); -} - -static void clipboard_clear (GtkClipboard *clipboard, gpointer data) -{ - delete [] reinterpret_cast(data); -} - -static void clipboard_received (GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data) -{ - if (data->length < 0) - { - globalErrorStream() << "Error retrieving selection\n"; - } - else if(strcmp(gdk_atom_name(data->type), clipboard_targets[0].target) == 0) - { - BufferInputStream istream(reinterpret_cast(data->data), data->length); - (*reinterpret_cast(user_data))(istream); - } -} - -void clipboard_copy(ClipboardCopyFunc copy) -{ - GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - - BufferOutputStream ostream; - copy(ostream); - std::size_t length = ostream.size(); - char* data = new char[length + sizeof(std::size_t)]; - *reinterpret_cast(data) = length; - memcpy(data + sizeof(std::size_t), ostream.data(), length); - - gtk_clipboard_set_with_data (clipboard, clipboard_targets, 1, clipboard_get, clipboard_clear, data); -} - -ClipboardPasteFunc g_clipboardPasteFunc = 0; -void clipboard_paste(ClipboardPasteFunc paste) -{ - GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - - g_clipboardPasteFunc = paste; - gtk_clipboard_request_contents (clipboard, gdk_atom_intern(clipboard_targets[0].target, FALSE), clipboard_received, &g_clipboardPasteFunc); -} - - -#endif diff --git a/libs/gtkutil/clipboard.h b/libs/gtkutil/clipboard.h deleted file mode 100644 index 1589a66a..00000000 --- a/libs/gtkutil/clipboard.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_CLIPBOARD_H) -#define INCLUDED_GTKUTIL_CLIPBOARD_H - -class TextOutputStream; -typedef void(*ClipboardCopyFunc)(TextOutputStream&); -void clipboard_copy(ClipboardCopyFunc copy); - -class TextInputStream; -typedef void(*ClipboardPasteFunc)(TextInputStream&); -void clipboard_paste(ClipboardPasteFunc paste); - -#endif diff --git a/libs/gtkutil/closure.cpp b/libs/gtkutil/closure.cpp deleted file mode 100644 index 4926d994..00000000 --- a/libs/gtkutil/closure.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "closure.h" - diff --git a/libs/gtkutil/closure.h b/libs/gtkutil/closure.h deleted file mode 100644 index 9a74b95e..00000000 --- a/libs/gtkutil/closure.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_CLOSURE_H) -#define INCLUDED_GTKUTIL_CLOSURE_H - -#include -#include "generic/callback.h" - -inline void closure_destroy(gpointer data, GClosure* closure) -{ - delete reinterpret_cast(data); -} - -inline GClosure* create_cclosure(GCallback func, const Callback& callback) -{ - return g_cclosure_new(func, new Callback(callback), closure_destroy); -} - -inline GValue GValue_default() -{ - GValue value; - value.g_type = 0; - return value; -} - -inline gint object_get_int_property(GObject* object, const char* property) -{ - GValue gvalue = GValue_default(); - g_value_init(&gvalue, G_TYPE_INT); - g_object_get_property(object, property, &gvalue); - return g_value_get_int(&gvalue); -} - -inline void object_set_int_property(GObject* object, const char* property, gint value) -{ - GValue gvalue = GValue_default(); - g_value_init(&gvalue, G_TYPE_INT); - g_value_set_int(&gvalue, value); - g_object_set_property(object, property, &gvalue); -} - -inline gboolean object_get_boolean_property(GObject* object, const char* property) -{ - GValue gvalue = GValue_default(); - g_value_init(&gvalue, G_TYPE_BOOLEAN); - g_object_get_property(object, property, &gvalue); - return g_value_get_boolean(&gvalue); -} - -inline void object_set_boolean_property(GObject* object, const char* property, gboolean value) -{ - GValue gvalue = GValue_default(); - g_value_init(&gvalue, G_TYPE_BOOLEAN); - g_value_set_boolean(&gvalue, value); - g_object_set_property(object, property, &gvalue); -} - -#endif diff --git a/libs/gtkutil/container.cpp b/libs/gtkutil/container.cpp deleted file mode 100644 index 627e0c88..00000000 --- a/libs/gtkutil/container.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "container.h" - diff --git a/libs/gtkutil/container.h b/libs/gtkutil/container.h deleted file mode 100644 index c41478ba..00000000 --- a/libs/gtkutil/container.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_CONTAINER_H) -#define INCLUDED_GTKUTIL_CONTAINER_H - -#include - -inline GtkWidget* container_add_widget(GtkContainer* container, GtkWidget* widget) -{ - gtk_container_add(container, widget); - return widget; -} - -inline void container_remove(GtkWidget* item, gpointer data) -{ - gtk_container_remove(GTK_CONTAINER(data), item); -} - -inline void container_remove_all(GtkContainer* container) -{ - gtk_container_foreach(container, container_remove, container); -} - -#endif diff --git a/libs/gtkutil/cursor.cpp b/libs/gtkutil/cursor.cpp deleted file mode 100644 index 2c4225a2..00000000 --- a/libs/gtkutil/cursor.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "cursor.h" - -#include "stream/textstream.h" - -#include -#include -#include - - -GdkCursor* create_blank_cursor() -{ - GdkPixmap *pixmap; - GdkBitmap *mask; - char buffer [(32 * 32)/8]; - memset (buffer, 0, (32 * 32)/8); - GdkColor white = {0, 0xffff, 0xffff, 0xffff}; - GdkColor black = {0, 0x0000, 0x0000, 0x0000}; - pixmap = gdk_bitmap_create_from_data(0, buffer, 32, 32); - mask = gdk_bitmap_create_from_data(0, buffer, 32, 32); - GdkCursor *cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &white, &black, 1, 1); - gdk_drawable_unref(pixmap); - gdk_drawable_unref(mask); - - return cursor; -} - -void blank_cursor(GtkWidget* widget) -{ - GdkCursor* cursor = create_blank_cursor(); - gdk_window_set_cursor (widget->window, cursor); - gdk_cursor_unref(cursor); -} - -void default_cursor(GtkWidget* widget) -{ - gdk_window_set_cursor(widget->window, 0); -} - - -#if defined(WIN32) - -#include - -void Sys_GetCursorPos(GtkWindow* window, int *x, int *y) -{ - POINT pos; - GetCursorPos(&pos); - ScreenToClient((HWND)GDK_WINDOW_HWND(GTK_WIDGET(window)->window), &pos); - *x = pos.x; - *y = pos.y; -} - -void Sys_SetCursorPos(GtkWindow* window, int x, int y) -{ - POINT pos; - pos.x = x; - pos.y = y; - ClientToScreen((HWND)GDK_WINDOW_HWND(GTK_WIDGET(window)->window), &pos); - SetCursorPos(pos.x, pos.y); -} - -#else - -#include - -void Sys_GetCursorPos(GtkWindow* window, int *x, int *y) -{ - gdk_display_get_pointer(gdk_display_get_default(), 0, x, y, 0); -} - -void Sys_SetCursorPos(GtkWindow* window, int x, int y) -{ - XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, x, y); -} - -#endif diff --git a/libs/gtkutil/cursor.h b/libs/gtkutil/cursor.h deleted file mode 100644 index eadae085..00000000 --- a/libs/gtkutil/cursor.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_CURSOR_H) -#define INCLUDED_GTKUTIL_CURSOR_H - -#include -#include -#include -#include - -#include "debugging/debugging.h" - -typedef struct _GdkCursor GdkCursor; -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; - -GdkCursor* create_blank_cursor(); -void blank_cursor(GtkWidget* widget); -void default_cursor(GtkWidget* widget); -void Sys_GetCursorPos(GtkWindow* window, int *x, int *y); -void Sys_SetCursorPos(GtkWindow* window, int x, int y); - - - -class DeferredMotion -{ - guint m_handler; - typedef void(*MotionFunction)(gdouble x, gdouble y, guint state, void* data); - MotionFunction m_function; - void* m_data; - gdouble m_x; - gdouble m_y; - guint m_state; - - static gboolean deferred(DeferredMotion* self) - { - self->m_handler = 0; - self->m_function(self->m_x, self->m_y, self->m_state, self->m_data); - return FALSE; - } -public: - DeferredMotion(MotionFunction function, void* data) : m_handler(0), m_function(function), m_data(data) - { - } - void motion(gdouble x, gdouble y, guint state) - { - m_x = x; - m_y = y; - m_state = state; - if(m_handler == 0) - { - m_handler = g_idle_add((GSourceFunc)deferred, this); - } - } - static gboolean gtk_motion(GtkWidget *widget, GdkEventMotion *event, DeferredMotion* self) - { - self->motion(event->x, event->y, event->state); - return FALSE; - } -}; - -class DeferredMotionDelta -{ - int m_delta_x; - int m_delta_y; - guint m_motion_handler; - typedef void (*MotionDeltaFunction)(int x, int y, void* data); - MotionDeltaFunction m_function; - void* m_data; - - static gboolean deferred_motion(gpointer data) - { - reinterpret_cast(data)->m_function( - reinterpret_cast(data)->m_delta_x, - reinterpret_cast(data)->m_delta_y, - reinterpret_cast(data)->m_data - ); - reinterpret_cast(data)->m_motion_handler = 0; - reinterpret_cast(data)->m_delta_x = 0; - reinterpret_cast(data)->m_delta_y = 0; - return FALSE; - } -public: - DeferredMotionDelta(MotionDeltaFunction function, void* data) : m_delta_x(0), m_delta_y(0), m_motion_handler(0), m_function(function), m_data(data) - { - } - void flush() - { - if(m_motion_handler != 0) - { - g_source_remove(m_motion_handler); - deferred_motion(this); - } - } - void motion_delta(int x, int y, unsigned int state) - { - m_delta_x += x; - m_delta_y += y; - if(m_motion_handler == 0) - { - m_motion_handler = g_idle_add(deferred_motion, this); - } - } -}; - -class FreezePointer -{ - unsigned int handle_motion; - int recorded_x, recorded_y; - typedef void (*MotionDeltaFunction)(int x, int y, unsigned int state, void* data); - MotionDeltaFunction m_function; - void* m_data; -public: - FreezePointer() : handle_motion(0), m_function(0), m_data(0) - { - } - static gboolean motion_delta(GtkWidget *widget, GdkEventMotion *event, FreezePointer* self) - { - int current_x, current_y; - Sys_GetCursorPos(GTK_WINDOW(widget), ¤t_x, ¤t_y); - int dx = current_x - self->recorded_x; - int dy = current_y - self->recorded_y; - if(dx != 0 || dy != 0) - { - //globalOutputStream() << "motion x: " << dx << ", y: " << dy << "\n"; - Sys_SetCursorPos(GTK_WINDOW(widget), self->recorded_x, self->recorded_y); - self->m_function(dx, dy, event->state, self->m_data); - } - return FALSE; - } - - void freeze_pointer(GtkWindow* window, MotionDeltaFunction function, void* data) - { - ASSERT_MESSAGE(m_function == 0, "can't freeze pointer"); - - const GdkEventMask mask = static_cast(GDK_POINTER_MOTION_MASK - | GDK_POINTER_MOTION_HINT_MASK - | GDK_BUTTON_MOTION_MASK - | GDK_BUTTON1_MOTION_MASK - | GDK_BUTTON2_MOTION_MASK - | GDK_BUTTON3_MOTION_MASK - | GDK_BUTTON_PRESS_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_VISIBILITY_NOTIFY_MASK); - - GdkCursor* cursor = create_blank_cursor(); - //GdkGrabStatus status = - gdk_pointer_grab(GTK_WIDGET(window)->window, TRUE, mask, 0, cursor, GDK_CURRENT_TIME); - gdk_cursor_unref(cursor); - - Sys_GetCursorPos(window, &recorded_x, &recorded_y); - - Sys_SetCursorPos(window, recorded_x, recorded_y); - - m_function = function; - m_data = data; - - handle_motion = g_signal_connect(G_OBJECT(window), "motion_notify_event", G_CALLBACK(motion_delta), this); - } - - void unfreeze_pointer(GtkWindow* window) - { - g_signal_handler_disconnect(G_OBJECT(window), handle_motion); - - m_function = 0; - m_data = 0; - - Sys_SetCursorPos(window, recorded_x, recorded_y); - - gdk_pointer_ungrab(GDK_CURRENT_TIME); - } -}; - -#endif diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp deleted file mode 100644 index 0f95e9ae..00000000 --- a/libs/gtkutil/dialog.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "dialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "button.h" -#include "window.h" - -GtkVBox* create_dialog_vbox(int spacing, int border) -{ - GtkVBox* vbox = GTK_VBOX(gtk_vbox_new(FALSE, spacing)); - gtk_widget_show(GTK_WIDGET(vbox)); - gtk_container_set_border_width(GTK_CONTAINER(vbox), border); - return vbox; -} - -GtkHBox* create_dialog_hbox(int spacing, int border) -{ - GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(FALSE, spacing)); - gtk_widget_show(GTK_WIDGET(hbox)); - gtk_container_set_border_width(GTK_CONTAINER(hbox), border); - return hbox; -} - -GtkFrame* create_dialog_frame(const char* label, GtkShadowType shadow) -{ - GtkFrame* frame = GTK_FRAME(gtk_frame_new(label)); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_frame_set_shadow_type(frame, shadow); - return frame; -} - -GtkTable* create_dialog_table(unsigned int rows, unsigned int columns, unsigned int row_spacing, unsigned int col_spacing, int border) -{ - GtkTable* table = GTK_TABLE(gtk_table_new(rows, columns, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_table_set_row_spacings(table, row_spacing); - gtk_table_set_col_spacings(table, col_spacing); - gtk_container_set_border_width(GTK_CONTAINER(table), border); - return table; -} - -GtkButton* create_dialog_button(const char* label, GCallback func, gpointer data) -{ - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label(label)); - gtk_widget_set_size_request(GTK_WIDGET(button), 64, -1); - gtk_widget_show(GTK_WIDGET(button)); - g_signal_connect(G_OBJECT(button), "clicked", func, data); - return button; -} - -GtkWindow* create_dialog_window(GtkWindow* parent, const char* title, GCallback func, gpointer data, int default_w, int default_h) -{ - GtkWindow* window = create_floating_window(title, parent); - gtk_window_set_default_size(window, default_w, default_h); - gtk_window_set_position(window, GTK_WIN_POS_CENTER_ON_PARENT); - g_signal_connect(G_OBJECT(window), "delete_event", func, data); - - return window; -} - -gboolean modal_dialog_button_clicked(GtkWidget *widget, ModalDialogButton* button) -{ - button->m_dialog.loop = false; - button->m_dialog.ret = button->m_value; - return TRUE; -} - -gboolean modal_dialog_delete(GtkWidget *widget, GdkEvent* event, ModalDialog* dialog) -{ - dialog->loop = 0; - dialog->ret = eIDCANCEL; - return TRUE; -} - -EMessageBoxReturn modal_dialog_show(GtkWindow* window, ModalDialog& dialog) -{ - gtk_grab_add(GTK_WIDGET(window)); - gtk_widget_show(GTK_WIDGET(window)); - - dialog.loop = true; - while(dialog.loop) - { - gtk_main_iteration(); - } - - gtk_widget_hide(GTK_WIDGET(window)); - gtk_grab_remove(GTK_WIDGET(window)); - - return dialog.ret; -} - -GtkButton* create_modal_dialog_button(const char* label, ModalDialogButton& button) -{ - return create_dialog_button(label, G_CALLBACK(modal_dialog_button_clicked), &button); -} - -GtkWindow* create_modal_dialog_window(GtkWindow* parent, const char* title, ModalDialog& dialog, int default_w, int default_h) -{ - return create_dialog_window(parent, title, G_CALLBACK(modal_dialog_delete), &dialog, default_w, default_h); -} - -GtkWindow* create_fixedsize_modal_dialog_window(GtkWindow* parent, const char* title, ModalDialog& dialog, int width, int height) -{ - GtkWindow* window = create_modal_dialog_window(parent, title, dialog, width, height); - - gtk_window_set_resizable(window, FALSE); - gtk_window_set_modal(window, TRUE); - gtk_window_set_position(window, GTK_WIN_POS_CENTER); - - window_remove_minmax(window); - - //gtk_widget_set_size_request(GTK_WIDGET(window), width, height); - //gtk_window_set_default_size(window, width, height); - //gtk_window_resize(window, width, height); - //GdkGeometry geometry = { width, height, -1, -1, width, height, -1, -1, -1, -1, GDK_GRAVITY_STATIC, }; - //gtk_window_set_geometry_hints(window, GTK_WIDGET(window), &geometry, (GdkWindowHints)(GDK_HINT_POS|GDK_HINT_MIN_SIZE|GDK_HINT_BASE_SIZE)); - - return window; -} - -gboolean dialog_button_ok(GtkWidget *widget, ModalDialog* data) -{ - data->loop = false; - data->ret = eIDOK; - return TRUE; -} - -gboolean dialog_button_cancel(GtkWidget *widget, ModalDialog* data) -{ - data->loop = false; - data->ret = eIDCANCEL; - return TRUE; -} - -gboolean dialog_button_yes(GtkWidget *widget, ModalDialog* data) -{ - data->loop = false; - data->ret = eIDYES; - return TRUE; -} - -gboolean dialog_button_no(GtkWidget *widget, ModalDialog* data) -{ - data->loop = false; - data->ret = eIDNO; - return TRUE; -} - -gboolean dialog_delete_callback(GtkWidget *widget, GdkEventAny* event, ModalDialog* data) -{ - gtk_widget_hide(widget); - data->loop = false; - return TRUE; -} - -GtkWindow* create_simple_modal_dialog_window(const char* title, ModalDialog& dialog, GtkWidget* contents) -{ - GtkWindow* window = create_fixedsize_modal_dialog_window(0, title, dialog); - - GtkVBox* vbox1 = create_dialog_vbox(8, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox1)); - - gtk_container_add(GTK_CONTAINER(vbox1), contents); - - GtkAlignment* alignment = GTK_ALIGNMENT(gtk_alignment_new(0.5, 0.0, 0.0, 0.0)); - gtk_widget_show(GTK_WIDGET(alignment)); - gtk_box_pack_start(GTK_BOX(vbox1), GTK_WIDGET(alignment), FALSE, FALSE, 0); - - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog); - gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(button)); - - return window; -} - -RadioHBox RadioHBox_new(StringArrayRange names) -{ - GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(TRUE, 4)); - gtk_widget_show(GTK_WIDGET(hbox)); - - GSList* group = 0; - GtkRadioButton* radio = 0; - for(StringArrayRange::Iterator i = names.first; i != names.last; ++i) - { - radio = GTK_RADIO_BUTTON(gtk_radio_button_new_with_label(group, *i)); - gtk_widget_show(GTK_WIDGET(radio)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(radio), FALSE, FALSE, 0); - - group = gtk_radio_button_get_group(radio); - } - - return RadioHBox(hbox, radio); -} - - -PathEntry PathEntry_new() -{ - GtkFrame* frame = GTK_FRAME(gtk_frame_new(NULL)); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_frame_set_shadow_type(frame, GTK_SHADOW_IN); - - // path entry - GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0)); - gtk_widget_show(GTK_WIDGET(hbox)); - - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_entry_set_has_frame(entry, FALSE); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry), TRUE, TRUE, 0); - - // browse button - GtkButton* button = GTK_BUTTON(gtk_button_new()); - button_set_icon(button, "ellipsis.bmp"); - gtk_widget_show(GTK_WIDGET(button)); - gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(hbox)); - - return PathEntry(frame, entry, button); -} - -void PathEntry_setPath(PathEntry& self, const char* path) -{ - gtk_entry_set_text(self.m_entry, path); -} -typedef ReferenceCaller1 PathEntrySetPathCaller; - -void BrowsedPathEntry_clicked(GtkWidget* widget, BrowsedPathEntry* self) -{ - self->m_browse(PathEntrySetPathCaller(self->m_entry)); -} - -BrowsedPathEntry::BrowsedPathEntry(const BrowseCallback& browse) : - m_entry(PathEntry_new()), - m_browse(browse) -{ - g_signal_connect(G_OBJECT(m_entry.m_button), "clicked", G_CALLBACK(BrowsedPathEntry_clicked), this); -} - - -GtkLabel* DialogLabel_new(const char* name) -{ - GtkLabel* label = GTK_LABEL(gtk_label_new(name)); - gtk_widget_show(GTK_WIDGET(label)); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); - - return label; -} - -GtkTable* DialogRow_new(const char* name, GtkWidget* widget) -{ - GtkTable* table = GTK_TABLE(gtk_table_new(1, 3, TRUE)); - gtk_widget_show(GTK_WIDGET(table)); - - gtk_table_set_col_spacings(table, 4); - gtk_table_set_row_spacings(table, 0); - - gtk_table_attach(table, GTK_WIDGET(DialogLabel_new(name)), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - gtk_table_attach(table, widget, 1, 3, 0, 1, - (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - return table; -} - -void DialogVBox_packRow(GtkVBox* vbox, GtkWidget* row) -{ - gtk_box_pack_start(GTK_BOX(vbox), row, FALSE, FALSE, 0); -} - diff --git a/libs/gtkutil/dialog.h b/libs/gtkutil/dialog.h deleted file mode 100644 index 150404a2..00000000 --- a/libs/gtkutil/dialog.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_DIALOG_H) -#define INCLUDED_GTKUTIL_DIALOG_H - -#include "generic/callback.h" -#include "generic/arrayrange.h" -#include "qerplugin.h" -#include - -typedef int gint; -typedef gint gboolean; -typedef struct _GdkEventAny GdkEventAny; -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkHBox GtkHBox; -typedef struct _GtkVBox GtkVBox; -typedef struct _GtkRadioButton GtkRadioButton; -typedef struct _GtkFrame GtkFrame; -typedef struct _GtkEntry GtkEntry; -typedef struct _GtkButton GtkButton; -typedef struct _GtkLabel GtkLabel; -typedef struct _GtkTable GtkTable; - - -struct ModalDialog -{ - ModalDialog() - : loop(true), ret(eIDCANCEL) - { - } - bool loop; - EMessageBoxReturn ret; -}; - -struct ModalDialogButton -{ - ModalDialogButton(ModalDialog& dialog, EMessageBoxReturn value) - : m_dialog(dialog), m_value(value) - { - } - ModalDialog& m_dialog; - EMessageBoxReturn m_value; -}; - -typedef void (*GCallback)(void); -typedef void* gpointer; -typedef struct _GtkWindow GtkWindow; -typedef struct _GtkTable GtkTable; -typedef struct _GtkButton GtkButton; -typedef struct _GtkVBox GtkVBox; -typedef struct _GtkHBox GtkHBox; -typedef struct _GtkFrame GtkFrame; - -GtkWindow* create_fixedsize_modal_window(GtkWindow* parent, const char* title, int width, int height); - -GtkWindow* create_dialog_window(GtkWindow* parent, const char* title, GCallback func, gpointer data, int default_w = -1, int default_h = -1); -GtkTable* create_dialog_table(unsigned int rows, unsigned int columns, unsigned int row_spacing, unsigned int col_spacing, int border = 0); -GtkButton* create_dialog_button(const char* label, GCallback func, gpointer data); -GtkVBox* create_dialog_vbox(int spacing, int border = 0); -GtkHBox* create_dialog_hbox(int spacing, int border = 0); -GtkFrame* create_dialog_frame(const char* label, GtkShadowType shadow = GTK_SHADOW_ETCHED_IN); - -GtkButton* create_modal_dialog_button(const char* label, ModalDialogButton& button); -GtkWindow* create_modal_dialog_window(GtkWindow* parent, const char* title, ModalDialog& dialog, int default_w = -1, int default_h = -1); -GtkWindow* create_fixedsize_modal_dialog_window(GtkWindow* parent, const char* title, ModalDialog& dialog, int width = -1, int height = -1); -EMessageBoxReturn modal_dialog_show(GtkWindow* window, ModalDialog& dialog); - - -gboolean dialog_button_ok(GtkWidget *widget, ModalDialog* data); -gboolean dialog_button_cancel(GtkWidget *widget, ModalDialog* data); -gboolean dialog_button_yes(GtkWidget *widget, ModalDialog* data); -gboolean dialog_button_no(GtkWidget *widget, ModalDialog* data); -gboolean dialog_delete_callback(GtkWidget *widget, GdkEventAny* event, ModalDialog* data); - -GtkWindow* create_simple_modal_dialog_window(const char* title, ModalDialog& dialog, GtkWidget* contents); - -class RadioHBox -{ -public: - GtkHBox* m_hbox; - GtkRadioButton* m_radio; - RadioHBox(GtkHBox* hbox, GtkRadioButton* radio) : - m_hbox(hbox), - m_radio(radio) - { - } -}; - -RadioHBox RadioHBox_new(StringArrayRange names); - - -class PathEntry -{ -public: - GtkFrame* m_frame; - GtkEntry* m_entry; - GtkButton* m_button; - PathEntry(GtkFrame* frame, GtkEntry* entry, GtkButton* button) : - m_frame(frame), - m_entry(entry), - m_button(button) - { - } -}; - -PathEntry PathEntry_new(); - -class BrowsedPathEntry -{ -public: - typedef Callback1 SetPathCallback; - typedef Callback1 BrowseCallback; - - PathEntry m_entry; - BrowseCallback m_browse; - - BrowsedPathEntry(const BrowseCallback& browse); -}; - -GtkLabel* DialogLabel_new(const char* name); -GtkTable* DialogRow_new(const char* name, GtkWidget* widget); -typedef struct _GtkVBox GtkVBox; -void DialogVBox_packRow(GtkVBox* vbox, GtkWidget* row); - - -#endif diff --git a/libs/gtkutil/entry.cpp b/libs/gtkutil/entry.cpp deleted file mode 100644 index 9c3c1553..00000000 --- a/libs/gtkutil/entry.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entry.h" - diff --git a/libs/gtkutil/entry.h b/libs/gtkutil/entry.h deleted file mode 100644 index 82957d29..00000000 --- a/libs/gtkutil/entry.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_ENTRY_H) -#define INCLUDED_GTKUTIL_ENTRY_H - -#include -#include -#include - -inline void entry_set_string(GtkEntry* entry, const char* string) -{ - gtk_entry_set_text(entry, string); -} - -inline void entry_set_int(GtkEntry* entry, int i) -{ - char buf[32]; - sprintf(buf, "%d", i); - entry_set_string(entry, buf); -} - -inline void entry_set_float(GtkEntry* entry, float f) -{ - char buf[32]; - sprintf(buf, "%g", f); - entry_set_string(entry, buf); -} - -inline const char* entry_get_string(GtkEntry* entry) -{ - return gtk_entry_get_text(entry); -} - -inline int entry_get_int(GtkEntry* entry) -{ - return atoi(entry_get_string(entry)); -} - -inline double entry_get_float(GtkEntry* entry) -{ - return atof(entry_get_string(entry)); -} - -#endif diff --git a/libs/gtkutil/filechooser.cpp b/libs/gtkutil/filechooser.cpp deleted file mode 100644 index f164d220..00000000 --- a/libs/gtkutil/filechooser.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "filechooser.h" - -#include "ifiletypes.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "string/string.h" -#include "stream/stringstream.h" -#include "container/array.h" -#include "os/path.h" -#include "os/file.h" - -#include "messagebox.h" - - -struct filetype_pair_t -{ - filetype_pair_t() - : m_moduleName("") - { - } - filetype_pair_t(const char* moduleName, filetype_t type) - : m_moduleName(moduleName), m_type(type) - { - } - const char* m_moduleName; - filetype_t m_type; -}; - -class FileTypeList : public IFileTypeList -{ - struct filetype_copy_t - { - filetype_copy_t(const filetype_pair_t& other) - : m_moduleName(other.m_moduleName), m_name(other.m_type.name), m_pattern(other.m_type.pattern) - { - } - CopiedString m_moduleName; - CopiedString m_name; - CopiedString m_pattern; - }; - - typedef std::list Types; - Types m_types; -public: - - typedef Types::const_iterator const_iterator; - const_iterator begin() const - { - return m_types.begin(); - } - const_iterator end() const - { - return m_types.end(); - } - - std::size_t size() const - { - return m_types.size(); - } - - void addType(const char* moduleName, filetype_t type) - { - m_types.push_back(filetype_pair_t(moduleName, type)); - } -}; - - -class GTKMasks -{ - const FileTypeList& m_types; -public: - std::vector m_filters; - std::vector m_masks; - - GTKMasks(const FileTypeList& types) : m_types(types) - { - m_masks.reserve(m_types.size()); - for(FileTypeList::const_iterator i = m_types.begin(); i != m_types.end(); ++i) - { - std::size_t len = strlen((*i).m_name.c_str()) + strlen((*i).m_pattern.c_str()) + 3; - StringOutputStream buffer(len + 1); // length + null char - - buffer << (*i).m_name.c_str() << " <" << (*i).m_pattern.c_str() << ">"; - - m_masks.push_back(buffer.c_str()); - } - - m_filters.reserve(m_types.size()); - for(FileTypeList::const_iterator i = m_types.begin(); i != m_types.end(); ++i) - { - m_filters.push_back((*i).m_pattern); - } - } - - filetype_pair_t GetTypeForGTKMask(const char *mask) const - { - std::vector::const_iterator j = m_masks.begin(); - for(FileTypeList::const_iterator i = m_types.begin(); i != m_types.end(); ++i, ++j) - { - if(string_equal((*j).c_str(), mask)) - { - return filetype_pair_t((*i).m_moduleName.c_str(), filetype_t((*i).m_name.c_str(), (*i).m_pattern.c_str())); - } - } - return filetype_pair_t(); - } - -}; - -static char g_file_dialog_file[1024]; - -const char* file_dialog_show(GtkWidget* parent, bool open, const char* title, const char* path, const char* pattern) -{ - filetype_t type; - - if(pattern == 0) - { - pattern = "*"; - } - - FileTypeList typelist; - GlobalFiletypes().getTypeList(pattern, &typelist); - - GTKMasks masks(typelist); - - if (title == 0) - title = open ? "Open File" : "Save File"; - - GtkWidget* dialog; - if (open) - { - dialog = gtk_file_chooser_dialog_new(title, - GTK_WINDOW(parent), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - } - else - { - dialog = gtk_file_chooser_dialog_new(title, - GTK_WINDOW(parent), - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, - NULL); - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "unnamed"); - } - - gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - - // we expect an actual path below, if the path is 0 we might crash - if (path != 0 && !string_empty(path)) - { - ASSERT_MESSAGE(path_is_absolute(path), "file_dialog_show: path not absolute: " << makeQuoted(path)); - - Array new_path(strlen(path)+1); - - // copy path, replacing dir separators as appropriate - Array::iterator w = new_path.begin(); - for(const char* r = path; *r != '\0'; ++r) - { - *w++ = (*r == '/') ? G_DIR_SEPARATOR : *r; - } - // remove separator from end of path if required - if(*(w-1) == G_DIR_SEPARATOR) - { - --w; - } - // terminate string - *w = '\0'; - - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), new_path.data()); - } - - // we should add all important paths as shortcut folder... - // gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), "/tmp/", NULL); - - - for(std::size_t i = 0; i < masks.m_filters.size(); ++i) - { - GtkFileFilter* filter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(filter, masks.m_filters[i].c_str()); - gtk_file_filter_set_name(filter, masks.m_masks[i].c_str()); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); - } - - if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) - { - strcpy(g_file_dialog_file, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); - - if(!string_equal(pattern, "*")) - { - GtkFileFilter* filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog)); - if(filter != 0) // no filter set? some file-chooser implementations may allow the user to set no filter, which we treat as 'all files' - { - type = masks.GetTypeForGTKMask(gtk_file_filter_get_name(filter)).m_type; - // last ext separator - const char* extension = path_get_extension(g_file_dialog_file); - // no extension - if(string_empty(extension)) - { - strcat(g_file_dialog_file, type.pattern+1); - } - else - { - strcpy(g_file_dialog_file + (extension - g_file_dialog_file), type.pattern+2); - } - } - } - - // convert back to unix format - for(char* w = g_file_dialog_file; *w!='\0'; w++) - { - if(*w=='\\') - { - *w = '/'; - } - } - } - else - { - g_file_dialog_file[0] = '\0'; - } - - gtk_widget_destroy(dialog); - - // don't return an empty filename - if(g_file_dialog_file[0] == '\0') return NULL; - - return g_file_dialog_file; -} - -char* dir_dialog(GtkWidget* parent, const char* title, const char* path) -{ - GtkWidget* dialog = gtk_file_chooser_dialog_new(title, - GTK_WINDOW(parent), - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - - if(!string_empty(path)) - { - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), path); - } - - char* filename = 0; - if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) - { - filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - } - - gtk_widget_destroy(dialog); - - return filename; -} - -const char* file_dialog(GtkWidget* parent, bool open, const char* title, const char* path, const char* pattern) -{ - for(;;) - { - const char* file = file_dialog_show(parent, open, title, path, pattern); - - if(open - || file == 0 - || !file_exists(file) - || gtk_MessageBox(parent, "The file specified already exists.\nDo you want to replace it?", title, eMB_NOYES, eMB_ICONQUESTION) == eIDYES) - { - return file; - } - } -} diff --git a/libs/gtkutil/filechooser.h b/libs/gtkutil/filechooser.h deleted file mode 100644 index d23beb5d..00000000 --- a/libs/gtkutil/filechooser.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_FILECHOOSER_H) -#define INCLUDED_GTKUTIL_FILECHOOSER_H - -/// \file -/// GTK+ file-chooser dialogs. - -typedef struct _GtkWidget GtkWidget; -const char* file_dialog(GtkWidget *parent, bool open, const char* title, const char* path = 0, const char* pattern = 0); - - -/// \brief Prompts the user to browse for a directory. -/// The prompt window will be transient to \p parent. -/// The directory will initially default to \p path, which must be an absolute path. -/// The returned string is allocated with \c g_malloc and must be freed with \c g_free. -char* dir_dialog(GtkWidget *parent, const char* title = "Choose Directory", const char* path = ""); - -#endif diff --git a/libs/gtkutil/frame.cpp b/libs/gtkutil/frame.cpp deleted file mode 100644 index 026de650..00000000 --- a/libs/gtkutil/frame.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "frame.h" - -#include - -GtkFrame* create_framed_widget(GtkWidget* widget) -{ - GtkFrame* frame = GTK_FRAME(gtk_frame_new(0)); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_frame_set_shadow_type(frame, GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER(frame), widget); - gtk_widget_show(GTK_WIDGET(widget)); - return frame; -} - diff --git a/libs/gtkutil/frame.h b/libs/gtkutil/frame.h deleted file mode 100644 index 12305db2..00000000 --- a/libs/gtkutil/frame.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_FRAME_H) -#define INCLUDED_GTKUTIL_FRAME_H - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkFrame GtkFrame; -GtkFrame* create_framed_widget(GtkWidget* widget); - -#endif diff --git a/libs/gtkutil/glfont.cpp b/libs/gtkutil/glfont.cpp deleted file mode 100644 index e46236d3..00000000 --- a/libs/gtkutil/glfont.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "glfont.h" -#ifdef _WIN32 - #include -#endif -#include -#include "debugging/debugging.h" - -// LordHavoc: this is code for direct Xlib bitmap character fetching, as an -// alternative to requiring gtkglarea, it was created due to a lack of this -// package on SuSE 9.x but this package is now commonly shipping in Linux -// distributions so this code may be unnecessary, feel free however to enable -// it when building packages for distros that do not ship with that package, -// or if you just prefer less dependencies... -#if 0 - -#include -#include -#include - -GLFont glfont_create(const char* font_string) -{ - GLuint font_list_base; - XFontStruct *fontInfo; - Display *dpy = GDK_DISPLAY (); - unsigned int i, first, last, firstrow, lastrow; - int maxchars; - int firstbitmap; - - fontInfo = XLoadQueryFont (dpy, "-*-fixed-*-*-*-*-8-*-*-*-*-*-*-*"); - if (fontInfo == NULL) - { - // try to load other fonts - fontInfo = XLoadQueryFont (dpy, "-*-fixed-*-*-*-*-*-*-*-*-*-*-*-*"); - - // any font will do ! - if (fontInfo == NULL) - fontInfo = XLoadQueryFont(dpy, "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"); - - if (fontInfo == NULL) - ERROR_MESSAGE("couldn't create font"); - } - - first = (int)fontInfo->min_char_or_byte2; - last = (int)fontInfo->max_char_or_byte2; - firstrow = (int)fontInfo->min_byte1; - lastrow = (int)fontInfo->max_byte1; - /* - * How many chars in the charset - */ - maxchars = 256 * lastrow + last; - font_list_base = glGenLists(maxchars+1); - if (font_list_base == 0) - { - ERROR_MESSAGE( "couldn't create font" ); - } - - /* - * Get offset to first char in the charset - */ - firstbitmap = 256 * firstrow + first; - /* - * for each row of chars, call glXUseXFont to build the bitmaps. - */ - - for(i=firstrow; i<=lastrow; i++) - { - glXUseXFont(fontInfo->fid, firstbitmap, last-first+1, font_list_base+firstbitmap); - firstbitmap += 256; - } - -/* *height = fontInfo->ascent + fontInfo->descent; - *width = fontInfo->max_bounds.width; */ - return GLFont(font_list_base, fontInfo->ascent + fontInfo->descent); -} - -void glfont_release(GLFont& font) -{ - glDeleteLists(font.getDisplayList(), 256); - font = GLFont(0, 0); -} - -#else - -#include - -GLFont glfont_create(const char* font_string) -{ - GLuint font_list_base = glGenLists (256); - gint font_height = 0; - - PangoFontDescription* font_desc = pango_font_description_from_string (font_string); - - PangoFont* font = gdk_gl_font_use_pango_font (font_desc, 0, 256, font_list_base); - - if(font != 0) - { - PangoFontMetrics* font_metrics = pango_font_get_metrics (font, 0); - - font_height = pango_font_metrics_get_ascent (font_metrics) + - pango_font_metrics_get_descent (font_metrics); - font_height = PANGO_PIXELS (font_height); - - pango_font_metrics_unref (font_metrics); - } - - pango_font_description_free (font_desc); - - // fix for pango/gtkglext metrix bug - if(font_height > 16) - font_height = 16; - - return GLFont(font_list_base, font_height); -} - -void glfont_release(GLFont& font) -{ - glDeleteLists(font.getDisplayList(), 256); - font = GLFont(0, 0); -} -#endif diff --git a/libs/gtkutil/glfont.h b/libs/gtkutil/glfont.h deleted file mode 100644 index 8c18afad..00000000 --- a/libs/gtkutil/glfont.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_GLFONT_H) -#define INCLUDED_GTKUTIL_GLFONT_H - -typedef unsigned int GLuint; - -class GLFont -{ - GLuint m_displayList; - int m_pixelHeight; -public: - GLFont(GLuint displayList, int pixelHeight) : m_displayList(displayList), m_pixelHeight(pixelHeight) - { - } - GLuint getDisplayList() const - { - return m_displayList; - } - int getPixelHeight() const - { - return m_pixelHeight; - } -}; - -GLFont glfont_create(const char* font_string); -void glfont_release(GLFont& font); - -#endif diff --git a/libs/gtkutil/glwidget.cpp b/libs/gtkutil/glwidget.cpp deleted file mode 100644 index cda5366a..00000000 --- a/libs/gtkutil/glwidget.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -// OpenGL widget based on GtkGLExt - -#include "glwidget.h" - -#include "debugging/debugging.h" - -#include "igl.h" - -#include -#include - -#include "pointer.h" - -void (*GLWidget_sharedContextCreated)() = 0; -void (*GLWidget_sharedContextDestroyed)() = 0; - - -typedef int* attribs_t; -struct config_t -{ - const char* name; - attribs_t attribs; -}; -typedef const config_t* configs_iterator; - -int config_rgba32[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 24, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 16, - GDK_GL_ATTRIB_LIST_NONE, -}; - -const config_t configs[] = { - { - "colour-buffer = 32bpp, depth-buffer = none", - config_rgba32, - }, - { - "colour-buffer = 16bpp, depth-buffer = none", - config_rgba, - } -}; - -GdkGLConfig* glconfig_new() -{ - GdkGLConfig* glconfig = 0; - - for(configs_iterator i = configs, end = configs + 2; i != end; ++i) - { - glconfig = gdk_gl_config_new((*i).attribs); - if(glconfig != 0) - { - globalOutputStream() << "OpenGL window configuration: " << (*i).name << "\n"; - return glconfig; - } - } - - globalOutputStream() << "OpenGL window configuration: colour-buffer = auto, depth-buffer = none\n"; - return gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGBA | GDK_GL_MODE_DOUBLE)); -} - -int config_rgba32_depth32[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 24, - GDK_GL_DEPTH_SIZE, 32, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba32_depth24[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 24, - GDK_GL_DEPTH_SIZE, 24, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba32_depth16[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 24, - GDK_GL_DEPTH_SIZE, 16, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba32_depth[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 24, - GDK_GL_DEPTH_SIZE, 1, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba_depth16[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 16, - GDK_GL_DEPTH_SIZE, 16, - GDK_GL_ATTRIB_LIST_NONE, -}; - -int config_rgba_depth[] = { - GDK_GL_RGBA, - GDK_GL_DOUBLEBUFFER, - GDK_GL_BUFFER_SIZE, 16, - GDK_GL_DEPTH_SIZE, 1, - GDK_GL_ATTRIB_LIST_NONE, -}; - -const config_t configs_with_depth[] = -{ - { - "colour-buffer = 32bpp, depth-buffer = 32bpp", - config_rgba32_depth32, - }, - { - "colour-buffer = 32bpp, depth-buffer = 24bpp", - config_rgba32_depth24, - }, - { - "colour-buffer = 32bpp, depth-buffer = 16bpp", - config_rgba32_depth16, - }, - { - "colour-buffer = 32bpp, depth-buffer = auto", - config_rgba32_depth, - }, - { - "colour-buffer = 16bpp, depth-buffer = 16bpp", - config_rgba_depth16, - }, - { - "colour-buffer = auto, depth-buffer = auto", - config_rgba_depth, - }, -}; - -GdkGLConfig* glconfig_new_with_depth() -{ - GdkGLConfig* glconfig = 0; - - for(configs_iterator i = configs_with_depth, end = configs_with_depth + 6; i != end; ++i) - { - glconfig = gdk_gl_config_new((*i).attribs); - if(glconfig != 0) - { - globalOutputStream() << "OpenGL window configuration: " << (*i).name << "\n"; - return glconfig; - } - } - - globalOutputStream() << "OpenGL window configuration: colour-buffer = auto, depth-buffer = auto (fallback)\n"; - return gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGBA | GDK_GL_MODE_DOUBLE | GDK_GL_MODE_DEPTH)); -} - -unsigned int g_context_count = 0; - -namespace -{ - GtkWidget* g_shared = 0; -} - -gint glwidget_context_created(GtkWidget* widget, gpointer data) -{ - if(++g_context_count == 1) - { - g_shared = widget; - gtk_widget_ref(g_shared); - - glwidget_make_current(g_shared); - GlobalOpenGL().contextValid = true; - - GLWidget_sharedContextCreated(); - } - return FALSE; -} - -gint glwidget_context_destroyed(GtkWidget* widget, gpointer data) -{ - if(--g_context_count == 0) - { - GlobalOpenGL().contextValid = false; - - GLWidget_sharedContextDestroyed(); - - gtk_widget_unref(g_shared); - g_shared = 0; - } - return FALSE; -} - -gboolean glwidget_enable_gl(GtkWidget* widget, GtkWidget* widget2, gpointer data) -{ - if(widget2 == 0 && !gtk_widget_is_gl_capable(widget)) - { - GdkGLConfig* glconfig = (g_object_get_data(G_OBJECT(widget), "zbuffer")) ? glconfig_new_with_depth() : glconfig_new(); - ASSERT_MESSAGE(glconfig != 0, "failed to create OpenGL config"); - - gtk_widget_set_gl_capability(widget, glconfig, g_shared != 0 ? gtk_widget_get_gl_context(g_shared) : 0, TRUE, GDK_GL_RGBA_TYPE); - - gtk_widget_realize(widget); - if(g_shared == 0) - { - g_shared = widget; - } - - // free glconfig? - } - return FALSE; -} - -GtkWidget* glwidget_new(gboolean zbuffer) -{ - GtkWidget* widget = gtk_drawing_area_new(); - - g_object_set_data(G_OBJECT(widget), "zbuffer", gint_to_pointer(zbuffer)); - - g_signal_connect(G_OBJECT(widget), "hierarchy-changed", G_CALLBACK(glwidget_enable_gl), 0); - - g_signal_connect(G_OBJECT(widget), "realize", G_CALLBACK(glwidget_context_created), 0); - g_signal_connect(G_OBJECT(widget), "unrealize", G_CALLBACK(glwidget_context_destroyed), 0); - - return widget; -} - -void glwidget_destroy_context (GtkWidget *widget) -{ -} - -void glwidget_create_context (GtkWidget *widget) -{ -} - -void glwidget_swap_buffers (GtkWidget *widget) -{ - GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget); - gdk_gl_drawable_swap_buffers (gldrawable); -} - -gboolean glwidget_make_current (GtkWidget *widget) -{ - GdkGLContext *glcontext = gtk_widget_get_gl_context (widget); - GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget); - return gdk_gl_drawable_gl_begin (gldrawable, glcontext); -} - diff --git a/libs/gtkutil/glwidget.h b/libs/gtkutil/glwidget.h deleted file mode 100644 index 235b0908..00000000 --- a/libs/gtkutil/glwidget.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_GLWIDGET_H) -#define INCLUDED_GTKUTIL_GLWIDGET_H - -typedef struct _GtkWidget GtkWidget; -typedef int gint; -typedef gint gboolean; - -GtkWidget* glwidget_new(gboolean zbuffer); -void glwidget_swap_buffers(GtkWidget* widget); -gboolean glwidget_make_current(GtkWidget* widget); -void glwidget_destroy_context(GtkWidget* widget); -void glwidget_create_context(GtkWidget* widget); - -extern void (*GLWidget_sharedContextCreated)(); -extern void (*GLWidget_sharedContextDestroyed)(); - - -#endif diff --git a/libs/gtkutil/gtkutil.vcproj b/libs/gtkutil/gtkutil.vcproj deleted file mode 100644 index 9197cd15..00000000 --- a/libs/gtkutil/gtkutil.vcproj +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/gtkutil/idledraw.cpp b/libs/gtkutil/idledraw.cpp deleted file mode 100644 index 47d432ca..00000000 --- a/libs/gtkutil/idledraw.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "idledraw.h" - diff --git a/libs/gtkutil/idledraw.h b/libs/gtkutil/idledraw.h deleted file mode 100644 index 48081237..00000000 --- a/libs/gtkutil/idledraw.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_IDLEDRAW_H) -#define INCLUDED_GTKUTIL_IDLEDRAW_H - -#include - -#include "generic/callback.h" - -class IdleDraw -{ - Callback m_draw; - unsigned int m_handler; - static gboolean draw(gpointer data) - { - reinterpret_cast(data)->m_draw(); - reinterpret_cast(data)->m_handler = 0; - return FALSE; - } -public: - IdleDraw(const Callback& draw) : m_draw(draw), m_handler(0) - { - } - ~IdleDraw() - { - if(m_handler != 0) - { - g_source_remove(m_handler); - } - } - void queueDraw() - { - if(m_handler == 0) - { - m_handler = g_idle_add(&draw, this); - } - } - typedef MemberCaller QueueDrawCaller; - - void flush() - { - if(m_handler != 0) - { - draw(this); - } - } -}; - - -#endif diff --git a/libs/gtkutil/image.cpp b/libs/gtkutil/image.cpp deleted file mode 100644 index 66e61d1e..00000000 --- a/libs/gtkutil/image.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "image.h" - -#include -#include - -#include "string/string.h" -#include "stream/stringstream.h" -#include "stream/textstream.h" - - -namespace -{ - CopiedString g_bitmapsPath; -} - -void BitmapsPath_set(const char* path) -{ - g_bitmapsPath = path; -} - -GdkPixbuf* pixbuf_new_from_file_with_mask(const char* filename) -{ - GdkPixbuf* rgb = gdk_pixbuf_new_from_file(filename, 0); - if(rgb == 0) - { - return 0; - } - else - { - GdkPixbuf* rgba = gdk_pixbuf_add_alpha(rgb, TRUE, 255, 0, 255); - gdk_pixbuf_unref(rgb); - return rgba; - } -} - -GtkImage* image_new_from_file_with_mask(const char* filename) -{ - GdkPixbuf* rgba = pixbuf_new_from_file_with_mask(filename); - if(rgba == 0) - { - return 0; - } - else - { - GtkImage* image = GTK_IMAGE(gtk_image_new_from_pixbuf(rgba)); - gdk_pixbuf_unref(rgba); - return image; - } -} - -GtkImage* image_new_missing() -{ - return GTK_IMAGE(gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_SMALL_TOOLBAR)); -} - -GtkImage* new_image(const char* filename) -{ - { - GtkImage* image = image_new_from_file_with_mask(filename); - if(image != 0) - { - return image; - } - } - - return image_new_missing(); -} - -GtkImage* new_local_image(const char* filename) -{ - StringOutputStream fullPath(256); - fullPath << g_bitmapsPath.c_str() << filename; - return new_image(fullPath.c_str()); -} - diff --git a/libs/gtkutil/image.h b/libs/gtkutil/image.h deleted file mode 100644 index bd865142..00000000 --- a/libs/gtkutil/image.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_IMAGE_H) -#define INCLUDED_GTKUTIL_IMAGE_H - -void BitmapsPath_set(const char* path); - -typedef struct _GtkImage GtkImage; -typedef struct _GdkPixbuf GdkPixbuf; - -GdkPixbuf* pixbuf_new_from_file_with_mask(const char* filename); -GtkImage* image_new_from_file_with_mask(const char* filename); -GtkImage* image_new_missing(); -GtkImage* new_image(const char* filename); // filename is full path to image file -GtkImage* new_local_image(const char* filename); // filename is relative to local bitmaps path - -#endif diff --git a/libs/gtkutil/menu.cpp b/libs/gtkutil/menu.cpp deleted file mode 100644 index 86be24e7..00000000 --- a/libs/gtkutil/menu.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "menu.h" - -#include -#include -#include -#include -#include -#include - -#include "generic/callback.h" - -#include "accelerator.h" -#include "closure.h" -#include "container.h" -#include "pointer.h" - -void menu_add_item(GtkMenu* menu, GtkMenuItem* item) -{ - gtk_container_add(GTK_CONTAINER(menu), GTK_WIDGET(item)); -} - -GtkMenuItem* menu_separator(GtkMenu* menu) -{ - GtkMenuItem* menu_item = GTK_MENU_ITEM(gtk_menu_item_new()); - container_add_widget(GTK_CONTAINER(menu), GTK_WIDGET(menu_item)); - gtk_widget_set_sensitive(GTK_WIDGET(menu_item), FALSE); - gtk_widget_show(GTK_WIDGET(menu_item)); - return menu_item; -} - -GtkTearoffMenuItem* menu_tearoff(GtkMenu* menu) -{ - GtkTearoffMenuItem* menu_item = GTK_TEAROFF_MENU_ITEM(gtk_tearoff_menu_item_new()); - container_add_widget(GTK_CONTAINER(menu), GTK_WIDGET(menu_item)); -// gtk_widget_set_sensitive(GTK_WIDGET(menu_item), FALSE); -- controls whether menu is detachable - gtk_widget_show(GTK_WIDGET(menu_item)); - return menu_item; -} - -GtkMenuItem* new_sub_menu_item_with_mnemonic(const char* mnemonic) -{ - GtkMenuItem* item = GTK_MENU_ITEM(gtk_menu_item_new_with_mnemonic(mnemonic)); - gtk_widget_show(GTK_WIDGET(item)); - - GtkWidget* sub_menu = gtk_menu_new(); - gtk_menu_item_set_submenu(item, sub_menu); - - return item; -} - -GtkMenu* create_sub_menu_with_mnemonic(GtkMenuShell* parent, const char* mnemonic) -{ - GtkMenuItem* item = new_sub_menu_item_with_mnemonic(mnemonic); - container_add_widget(GTK_CONTAINER(parent), GTK_WIDGET(item)); - return GTK_MENU(gtk_menu_item_get_submenu(item)); -} - -GtkMenu* create_sub_menu_with_mnemonic(GtkMenuBar* bar, const char* mnemonic) -{ - return create_sub_menu_with_mnemonic(GTK_MENU_SHELL(bar), mnemonic); -} - -GtkMenu* create_sub_menu_with_mnemonic(GtkMenu* parent, const char* mnemonic) -{ - return create_sub_menu_with_mnemonic(GTK_MENU_SHELL(parent), mnemonic); -} - -void activate_closure_callback(GtkWidget* widget, gpointer data) -{ - (*reinterpret_cast(data))(); -} - -guint menu_item_connect_callback(GtkMenuItem* item, const Callback& callback) -{ -#if 1 - return g_signal_connect_swapped(G_OBJECT(item), "activate", G_CALLBACK(callback.getThunk()), callback.getEnvironment()); -#else - return g_signal_connect_closure(G_OBJECT(item), "activate", create_cclosure(G_CALLBACK(activate_closure_callback), callback), FALSE); -#endif -} - -guint check_menu_item_connect_callback(GtkCheckMenuItem* item, const Callback& callback) -{ -#if 1 - guint handler = g_signal_connect_swapped(G_OBJECT(item), "toggled", G_CALLBACK(callback.getThunk()), callback.getEnvironment()); -#else - guint handler = g_signal_connect_closure(G_OBJECT(item), "toggled", create_cclosure(G_CALLBACK(activate_closure_callback), callback), TRUE); -#endif - g_object_set_data(G_OBJECT(item), "handler", gint_to_pointer(handler)); - return handler; -} - -GtkMenuItem* new_menu_item_with_mnemonic(const char *mnemonic, const Callback& callback) -{ - GtkMenuItem* item = GTK_MENU_ITEM(gtk_menu_item_new_with_mnemonic(mnemonic)); - gtk_widget_show(GTK_WIDGET(item)); - menu_item_connect_callback(item, callback); - return item; -} - -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char *mnemonic, const Callback& callback) -{ - GtkMenuItem* item = new_menu_item_with_mnemonic(mnemonic, callback); - container_add_widget(GTK_CONTAINER(menu), GTK_WIDGET(item)); - return item; -} - -GtkCheckMenuItem* new_check_menu_item_with_mnemonic(const char* mnemonic, const Callback& callback) -{ - GtkCheckMenuItem* item = GTK_CHECK_MENU_ITEM(gtk_check_menu_item_new_with_mnemonic(mnemonic)); - gtk_widget_show(GTK_WIDGET(item)); - check_menu_item_connect_callback(item, callback); - return item; -} - -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Callback& callback) -{ - GtkCheckMenuItem* item = new_check_menu_item_with_mnemonic(mnemonic, callback); - container_add_widget(GTK_CONTAINER(menu), GTK_WIDGET(item)); - return item; -} - -GtkRadioMenuItem* new_radio_menu_item_with_mnemonic(GSList** group, const char* mnemonic, const Callback& callback) -{ - GtkRadioMenuItem* item = GTK_RADIO_MENU_ITEM(gtk_radio_menu_item_new_with_mnemonic(*group, mnemonic)); - if(*group == 0) - { - gtk_check_menu_item_set_state(GTK_CHECK_MENU_ITEM(item), TRUE); - } - *group = gtk_radio_menu_item_group(item); - gtk_widget_show(GTK_WIDGET(item)); - check_menu_item_connect_callback(GTK_CHECK_MENU_ITEM(item), callback); - return item; -} - -GtkRadioMenuItem* create_radio_menu_item_with_mnemonic(GtkMenu* menu, GSList** group, const char* mnemonic, const Callback& callback) -{ - GtkRadioMenuItem* item = new_radio_menu_item_with_mnemonic(group, mnemonic, callback); - container_add_widget(GTK_CONTAINER(menu), GTK_WIDGET(item)); - return item; -} - -void check_menu_item_set_active_no_signal(GtkCheckMenuItem* item, gboolean active) -{ - guint handler_id = gpointer_to_int(g_object_get_data(G_OBJECT(item), "handler")); - g_signal_handler_block(G_OBJECT(item), handler_id); - gtk_check_menu_item_set_active(item, active); - g_signal_handler_unblock(G_OBJECT(item), handler_id); -} - - - -void radio_menu_item_set_active_no_signal(GtkRadioMenuItem* item, gboolean active) -{ - { - for(GSList* l = gtk_radio_menu_item_get_group(item); l != 0; l = g_slist_next(l)) - { - g_signal_handler_block(G_OBJECT(l->data), gpointer_to_int(g_object_get_data(G_OBJECT(l->data), "handler"))); - } - } - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), active); - { - for(GSList* l = gtk_radio_menu_item_get_group(item); l != 0; l = g_slist_next(l)) - { - g_signal_handler_unblock(G_OBJECT(l->data), gpointer_to_int(g_object_get_data(G_OBJECT(l->data), "handler"))); - } - } -} - - -void menu_item_set_accelerator(GtkMenuItem* item, GClosure* closure) -{ - GtkAccelLabel* accel_label = GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(item))); - gtk_accel_label_set_accel_closure(accel_label, closure); -} - -void accelerator_name(const Accelerator& accelerator, GString* gstring) -{ - gboolean had_mod = FALSE; - if (accelerator.modifiers & GDK_SHIFT_MASK) - { - g_string_append (gstring, "Shift"); - had_mod = TRUE; - } - if (accelerator.modifiers & GDK_CONTROL_MASK) - { - if (had_mod) - g_string_append (gstring, "+"); - g_string_append (gstring, "Ctrl"); - had_mod = TRUE; - } - if (accelerator.modifiers & GDK_MOD1_MASK) - { - if (had_mod) - g_string_append (gstring, "+"); - g_string_append (gstring, "Alt"); - had_mod = TRUE; - } - - if (had_mod) - g_string_append (gstring, "+"); - if (accelerator.key < 0x80 || (accelerator.key > 0x80 && accelerator.key <= 0xff)) - { - switch (accelerator.key) - { - case ' ': - g_string_append (gstring, "Space"); - break; - case '\\': - g_string_append (gstring, "Backslash"); - break; - default: - g_string_append_c (gstring, gchar(toupper(accelerator.key))); - break; - } - } - else - { - gchar *tmp; - - tmp = gtk_accelerator_name (accelerator.key, (GdkModifierType)0); - if (tmp[0] != 0 && tmp[1] == 0) - tmp[0] = gchar(toupper(tmp[0])); - g_string_append (gstring, tmp); - g_free (tmp); - } -} - -void menu_item_set_accelerator(GtkMenuItem* item, Accelerator accelerator) -{ - GtkAccelLabel* accel_label = GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(item))); - - g_free (accel_label->accel_string); - accel_label->accel_string = 0; - - GString* gstring = g_string_new (accel_label->accel_string); - g_string_append (gstring, " "); - - accelerator_name(accelerator, gstring); - - g_free (accel_label->accel_string); - accel_label->accel_string = gstring->str; - g_string_free (gstring, FALSE); - - if (!accel_label->accel_string) - accel_label->accel_string = g_strdup (""); - - gtk_widget_queue_resize (GTK_WIDGET (accel_label)); -} - -void menu_item_add_accelerator(GtkMenuItem* item, Accelerator accelerator) -{ - if(accelerator.key != 0) - { - GClosure* closure = global_accel_group_find(accelerator); - if(closure != 0) - { - menu_item_set_accelerator(item, closure); - } - else - { - menu_item_set_accelerator(item, accelerator); - } - } -} - -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Command& command) -{ - GtkMenuItem* item = create_menu_item_with_mnemonic(menu, mnemonic, command.m_callback); - menu_item_add_accelerator(item, command.m_accelerator); - return item; -} - -void check_menu_item_set_active_callback(GtkCheckMenuItem& item, bool enabled) -{ - check_menu_item_set_active_no_signal(&item, enabled); -} -typedef ReferenceCaller1 CheckMenuItemSetActiveCaller; - -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Toggle& toggle) -{ - GtkCheckMenuItem* item = create_check_menu_item_with_mnemonic(menu, mnemonic, toggle.m_command.m_callback); - menu_item_add_accelerator(GTK_MENU_ITEM(item), toggle.m_command.m_accelerator); - toggle.m_exportCallback(CheckMenuItemSetActiveCaller(*item)); - return item; -} - - - - diff --git a/libs/gtkutil/menu.h b/libs/gtkutil/menu.h deleted file mode 100644 index a394d823..00000000 --- a/libs/gtkutil/menu.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_MENU_H) -#define INCLUDED_GTKUTIL_MENU_H - -#include "generic/callbackfwd.h" - -typedef int gint; -typedef gint gboolean; -typedef struct _GSList GSList; -typedef struct _GtkMenu GtkMenu; -typedef struct _GtkMenuBar GtkMenuBar; -typedef struct _GtkMenuItem GtkMenuItem; -typedef struct _GtkCheckMenuItem GtkCheckMenuItem; -typedef struct _GtkRadioMenuItem GtkRadioMenuItem; -typedef struct _GtkTearoffMenuItem GtkTearoffMenuItem; - -void menu_add_item(GtkMenu* menu, GtkMenuItem* item); -GtkMenuItem* menu_separator(GtkMenu* menu); -GtkTearoffMenuItem* menu_tearoff(GtkMenu* menu); -GtkMenuItem* new_sub_menu_item_with_mnemonic(const char* mnemonic); -GtkMenu* create_sub_menu_with_mnemonic(GtkMenuBar* bar, const char* mnemonic); -GtkMenu* create_sub_menu_with_mnemonic(GtkMenu* parent, const char* mnemonic); -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Callback& callback); -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Callback& callback); -GtkRadioMenuItem* create_radio_menu_item_with_mnemonic(GtkMenu* menu, GSList** group, const char* mnemonic, const Callback& callback); - -class Command; -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Command& command); -class Toggle; -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const Toggle& toggle); - - -typedef struct _GtkCheckMenuItem GtkCheckMenuItem; -void check_menu_item_set_active_no_signal(GtkCheckMenuItem* item, gboolean active); -typedef struct _GtkRadioMenuItem GtkRadioMenuItem; -void radio_menu_item_set_active_no_signal(GtkRadioMenuItem* item, gboolean active); - -#endif diff --git a/libs/gtkutil/messagebox.cpp b/libs/gtkutil/messagebox.cpp deleted file mode 100644 index 4c430ed3..00000000 --- a/libs/gtkutil/messagebox.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "messagebox.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dialog.h" -#include "widget.h" - -GtkWidget* create_padding(int width, int height) -{ - GtkWidget* widget = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); - gtk_widget_show(widget); - gtk_widget_set_size_request(widget, width, height); - return widget; -} - -const char* messagebox_stock_icon(EMessageBoxIcon type) -{ - switch(type) - { - default: - case eMB_ICONDEFAULT: - return GTK_STOCK_DIALOG_INFO; - case eMB_ICONERROR: - return GTK_STOCK_DIALOG_ERROR; - case eMB_ICONWARNING: - return GTK_STOCK_DIALOG_WARNING; - case eMB_ICONQUESTION: - return GTK_STOCK_DIALOG_QUESTION; - case eMB_ICONASTERISK: - return GTK_STOCK_DIALOG_INFO; - } -} - -EMessageBoxReturn gtk_MessageBox (GtkWidget *parent, const char* text, const char* title, EMessageBoxType type, EMessageBoxIcon icon) -{ - ModalDialog dialog; - ModalDialogButton ok_button(dialog, eIDOK); - ModalDialogButton cancel_button(dialog, eIDCANCEL); - ModalDialogButton yes_button(dialog, eIDYES); - ModalDialogButton no_button(dialog, eIDNO); - - GtkWindow* parentWindow = parent != 0 ? GTK_WINDOW(parent) : 0; - - GtkWindow* window = create_fixedsize_modal_dialog_window(parentWindow, title, dialog, 400, 100); - - if(parentWindow != 0) - { - //g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(floating_window_delete_present), parent); - gtk_window_deiconify(parentWindow); - } - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - GtkVBox* vbox = create_dialog_vbox(8, 8); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - - - GtkHBox* hboxDummy = create_dialog_hbox(0, 0); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hboxDummy), FALSE, FALSE, 0); - - gtk_box_pack_start(GTK_BOX(hboxDummy), create_padding(0, 50), FALSE, FALSE, 0); // HACK to force minimum height - - GtkHBox* iconBox = create_dialog_hbox(16, 0); - gtk_box_pack_start(GTK_BOX(hboxDummy), GTK_WIDGET(iconBox), FALSE, FALSE, 0); - - GtkImage* image = GTK_IMAGE(gtk_image_new_from_stock(messagebox_stock_icon(icon), GTK_ICON_SIZE_DIALOG)); - gtk_widget_show(GTK_WIDGET(image)); - gtk_box_pack_start(GTK_BOX(iconBox), GTK_WIDGET(image), FALSE, FALSE, 0); - - GtkLabel* label = GTK_LABEL(gtk_label_new(text)); - gtk_widget_show(GTK_WIDGET(label)); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); - gtk_label_set_line_wrap(label, TRUE); - gtk_box_pack_start(GTK_BOX(iconBox), GTK_WIDGET(label), TRUE, TRUE, 0); - - - GtkVBox* vboxDummy = create_dialog_vbox(0, 0); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(vboxDummy), FALSE, FALSE, 0); - - GtkAlignment* alignment = GTK_ALIGNMENT(gtk_alignment_new(0.5, 0.0, 0.0, 0.0)); - gtk_widget_show(GTK_WIDGET(alignment)); - gtk_box_pack_start(GTK_BOX(vboxDummy), GTK_WIDGET(alignment), FALSE, FALSE, 0); - - GtkHBox* hbox = create_dialog_hbox(8, 0); - gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(hbox)); - - gtk_box_pack_start(GTK_BOX(vboxDummy), create_padding(400, 0), FALSE, FALSE, 0); // HACK to force minimum width - - - if (type == eMB_OK) - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_show(GTK_WIDGET(button)); - - dialog.ret = eIDOK; - } - else if (type == eMB_OKCANCEL) - { - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_show(GTK_WIDGET(button)); - } - - { - GtkButton* button = create_modal_dialog_button("OK", cancel_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - gtk_widget_show(GTK_WIDGET(button)); - } - - dialog.ret = eIDCANCEL; - } - else if (type == eMB_YESNOCANCEL) - { - { - GtkButton* button = create_modal_dialog_button("Yes", yes_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_show(GTK_WIDGET(button)); - } - - { - GtkButton* button = create_modal_dialog_button("No", no_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_show(GTK_WIDGET(button)); - } - { - GtkButton* button = create_modal_dialog_button("Cancel", cancel_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_show(GTK_WIDGET(button)); - } - - dialog.ret = eIDCANCEL; - } - else if (type == eMB_NOYES) - { - { - GtkButton* button = create_modal_dialog_button("No", no_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_show(GTK_WIDGET(button)); - } - { - GtkButton* button = create_modal_dialog_button("Yes", yes_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_show(GTK_WIDGET(button)); - } - - dialog.ret = eIDNO; - } - else /* if (type == eMB_YESNO) */ - { - { - GtkButton* button = create_modal_dialog_button("Yes", yes_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_show(GTK_WIDGET(button)); - } - - { - GtkButton* button = create_modal_dialog_button("No", no_button); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), TRUE, FALSE, 0); - gtk_widget_show(GTK_WIDGET(button)); - } - dialog.ret = eIDNO; - } - - modal_dialog_show(window, dialog); - - gtk_widget_destroy(GTK_WIDGET(window)); - - return dialog.ret; -} - diff --git a/libs/gtkutil/messagebox.h b/libs/gtkutil/messagebox.h deleted file mode 100644 index c374aafe..00000000 --- a/libs/gtkutil/messagebox.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_MESSAGEBOX_H) -#define INCLUDED_GTKUTIL_MESSAGEBOX_H - -#include "qerplugin.h" - -typedef struct _GtkWidget GtkWidget; -/// \brief Shows a modal message-box. -EMessageBoxReturn gtk_MessageBox(GtkWidget *parent, const char* text, const char* title = "GtkRadiant", EMessageBoxType type = eMB_OK, EMessageBoxIcon icon = eMB_ICONDEFAULT); - -#endif diff --git a/libs/gtkutil/nonmodal.cpp b/libs/gtkutil/nonmodal.cpp deleted file mode 100644 index 6252e2dd..00000000 --- a/libs/gtkutil/nonmodal.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "nonmodal.h" - diff --git a/libs/gtkutil/nonmodal.h b/libs/gtkutil/nonmodal.h deleted file mode 100644 index eed4be37..00000000 --- a/libs/gtkutil/nonmodal.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_NONMODAL_H) -#define INCLUDED_GTKUTIL_NONMODAL_H - -#include -#include -#include -#include - -#include "generic/callback.h" - -#include "pointer.h" -#include "button.h" - -typedef struct _GtkEntry GtkEntry; - - -inline gboolean escape_clear_focus_widget(GtkWidget* widget, GdkEventKey* event, gpointer data) -{ - if(event->keyval == GDK_Escape) - { - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), NULL); - return TRUE; - } - return FALSE; -} - -inline void widget_connect_escape_clear_focus_widget(GtkWidget* widget) -{ - g_signal_connect(G_OBJECT(widget), "key_press_event", G_CALLBACK(escape_clear_focus_widget), 0); -} - - -class NonModalEntry -{ - bool m_editing; - Callback m_apply; - Callback m_cancel; - - static gboolean focus_in(GtkEntry* entry, GdkEventFocus *event, NonModalEntry* self) - { - self->m_editing = false; - return FALSE; - } - - static gboolean focus_out(GtkEntry* entry, GdkEventFocus *event, NonModalEntry* self) - { - if(self->m_editing && GTK_WIDGET_VISIBLE(entry)) - { - self->m_apply(); - } - self->m_editing = false; - return FALSE; - } - - static gboolean changed(GtkEntry* entry, NonModalEntry* self) - { - self->m_editing = true; - return FALSE; - } - - static gboolean enter(GtkEntry* entry, GdkEventKey* event, NonModalEntry* self) - { - if(event->keyval == GDK_Return) - { - self->m_apply(); - self->m_editing = false; - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL); - return TRUE; - } - return FALSE; - } - - static gboolean escape(GtkEntry* entry, GdkEventKey* event, NonModalEntry* self) - { - if(event->keyval == GDK_Escape) - { - self->m_cancel(); - self->m_editing = false; - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL); - return TRUE; - } - return FALSE; - } - -public: - NonModalEntry(const Callback& apply, const Callback& cancel) : m_editing(false), m_apply(apply), m_cancel(cancel) - { - } - void connect(GtkEntry* entry) - { - g_signal_connect(G_OBJECT(entry), "focus_in_event", G_CALLBACK(focus_in), this); - g_signal_connect(G_OBJECT(entry), "focus_out_event", G_CALLBACK(focus_out), this); - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(enter), this); - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(escape), this); - g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(changed), this); - } -}; - - -class NonModalSpinner -{ - Callback m_apply; - Callback m_cancel; - - static gboolean changed(GtkSpinButton* spin, NonModalSpinner* self) - { - self->m_apply(); - return FALSE; - } - - static gboolean enter(GtkSpinButton* spin, GdkEventKey* event, NonModalSpinner* self) - { - if(event->keyval == GDK_Return) - { - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL); - return TRUE; - } - return FALSE; - } - - static gboolean escape(GtkSpinButton* spin, GdkEventKey* event, NonModalSpinner* self) - { - if(event->keyval == GDK_Escape) - { - self->m_cancel(); - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL); - return TRUE; - } - return FALSE; - } - -public: - NonModalSpinner(const Callback& apply, const Callback& cancel) : m_apply(apply), m_cancel(cancel) - { - } - void connect(GtkSpinButton* spin) - { - guint handler = g_signal_connect(G_OBJECT(gtk_spin_button_get_adjustment(spin)), "value_changed", G_CALLBACK(changed), this); - g_object_set_data(G_OBJECT(spin), "handler", gint_to_pointer(handler)); - g_signal_connect(G_OBJECT(spin), "key_press_event", G_CALLBACK(enter), this); - g_signal_connect(G_OBJECT(spin), "key_press_event", G_CALLBACK(escape), this); - } -}; - - -class NonModalRadio -{ - Callback m_changed; - -public: - NonModalRadio(const Callback& changed) : m_changed(changed) - { - } - void connect(GtkRadioButton* radio) - { - GSList* group = gtk_radio_button_group(radio); - for(; group != 0; group = g_slist_next(group)) - { - toggle_button_connect_callback(GTK_TOGGLE_BUTTON(group->data), m_changed); - } - } -}; - - -#endif diff --git a/libs/gtkutil/paned.cpp b/libs/gtkutil/paned.cpp deleted file mode 100644 index db0c308b..00000000 --- a/libs/gtkutil/paned.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "paned.h" - -#include -#include - -#include "frame.h" - - -class PanedState -{ -public: - float position; - int size; -}; - -gboolean hpaned_allocate(GtkWidget* widget, GtkAllocation* allocation, PanedState* paned) -{ - if(paned->size != allocation->width) - { - paned->size = allocation->width; - gtk_paned_set_position (GTK_PANED (widget), static_cast(paned->size * paned->position)); - } - return FALSE; -} - -gboolean vpaned_allocate(GtkWidget* widget, GtkAllocation* allocation, PanedState* paned) -{ - if(paned->size != allocation->height) - { - paned->size = allocation->height; - gtk_paned_set_position (GTK_PANED (widget), static_cast(paned->size * paned->position)); - } - return FALSE; -} - -gboolean paned_position(GtkWidget* widget, gpointer dummy, PanedState* paned) -{ - if(paned->size != -1) - paned->position = gtk_paned_get_position (GTK_PANED (widget)) / static_cast(paned->size); - return FALSE; -} - -PanedState g_hpaned = { 0.5f, -1, }; -PanedState g_vpaned1 = { 0.5f, -1, }; -PanedState g_vpaned2 = { 0.5f, -1, }; - -GtkHPaned* create_split_views(GtkWidget* topleft, GtkWidget* topright, GtkWidget* botleft, GtkWidget* botright) -{ - GtkHPaned* hsplit = GTK_HPANED(gtk_hpaned_new()); - gtk_widget_show(GTK_WIDGET(hsplit)); - - g_signal_connect(G_OBJECT(hsplit), "size_allocate", G_CALLBACK(hpaned_allocate), &g_hpaned); - g_signal_connect(G_OBJECT(hsplit), "notify::position", G_CALLBACK(paned_position), &g_hpaned); - - { - GtkVPaned* vsplit = GTK_VPANED(gtk_vpaned_new()); - gtk_paned_add1(GTK_PANED(hsplit), GTK_WIDGET(vsplit)); - gtk_widget_show(GTK_WIDGET(vsplit)); - - g_signal_connect(G_OBJECT(vsplit), "size_allocate", G_CALLBACK(vpaned_allocate), &g_vpaned1); - g_signal_connect(G_OBJECT(vsplit), "notify::position", G_CALLBACK(paned_position), &g_vpaned1); - - gtk_paned_add1(GTK_PANED(vsplit), GTK_WIDGET(create_framed_widget(topleft))); - gtk_paned_add2(GTK_PANED(vsplit), GTK_WIDGET(create_framed_widget(topright))); - } - { - GtkVPaned* vsplit = GTK_VPANED(gtk_vpaned_new()); - gtk_paned_add2(GTK_PANED(hsplit), GTK_WIDGET(vsplit)); - gtk_widget_show(GTK_WIDGET(vsplit)); - - g_signal_connect(G_OBJECT(vsplit), "size_allocate", G_CALLBACK(vpaned_allocate), &g_vpaned2); - g_signal_connect(G_OBJECT(vsplit), "notify::position", G_CALLBACK(paned_position), &g_vpaned2); - - gtk_paned_add1(GTK_PANED(vsplit), GTK_WIDGET(create_framed_widget(botleft))); - gtk_paned_add2(GTK_PANED(vsplit), GTK_WIDGET(create_framed_widget(botright))); - } - return hsplit; -} - diff --git a/libs/gtkutil/paned.h b/libs/gtkutil/paned.h deleted file mode 100644 index 578a3c5d..00000000 --- a/libs/gtkutil/paned.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_PANED_H) -#define INCLUDED_GTKUTIL_PANED_H - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkHPaned GtkHPaned; -GtkHPaned* create_split_views(GtkWidget* topleft, GtkWidget* topright, GtkWidget* botleft, GtkWidget* botright); - -#endif diff --git a/libs/gtkutil/pointer.cpp b/libs/gtkutil/pointer.cpp deleted file mode 100644 index 2c36d2d7..00000000 --- a/libs/gtkutil/pointer.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pointer.h" - diff --git a/libs/gtkutil/pointer.h b/libs/gtkutil/pointer.h deleted file mode 100644 index c8294467..00000000 --- a/libs/gtkutil/pointer.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_POINTER_H) -#define INCLUDED_GTKUTIL_POINTER_H - -typedef int gint; -typedef void* gpointer; - -#include - -inline gint gpointer_to_int(gpointer p) -{ - return gint(std::size_t(p)); -} - -inline gpointer gint_to_pointer(gint i) -{ - return gpointer(std::size_t(i)); -} - -#endif diff --git a/libs/gtkutil/toolbar.cpp b/libs/gtkutil/toolbar.cpp deleted file mode 100644 index 194aff2d..00000000 --- a/libs/gtkutil/toolbar.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "toolbar.h" - -#include -#include - -#include "generic/callback.h" - -#include "accelerator.h" -#include "button.h" -#include "closure.h" -#include "pointer.h" - - -void toolbar_append(GtkToolbar* toolbar, GtkButton* button, const char* description) -{ - gtk_widget_show(GTK_WIDGET(button)); - gtk_button_set_relief(button, GTK_RELIEF_NONE); - GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_CAN_DEFAULT); - gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET(button), "", description, "", 0, 0, 0); -} - -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback) -{ - GtkButton* button = GTK_BUTTON(gtk_button_new()); - button_set_icon(button, icon); - button_connect_callback(button, callback); - toolbar_append(toolbar, button, description); - return button; -} - -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback) -{ - GtkToggleButton* button = GTK_TOGGLE_BUTTON(gtk_toggle_button_new()); - button_set_icon(GTK_BUTTON(button), icon); - toggle_button_connect_callback(button, callback); - toolbar_append(toolbar, GTK_BUTTON(button), description); - return button; -} - -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const Command& command) -{ - return toolbar_append_button(toolbar, description, icon, command.m_callback); -} - -void toggle_button_set_active_callback(GtkToggleButton& button, bool active) -{ - toggle_button_set_active_no_signal(&button, active); -} -typedef ReferenceCaller1 ToggleButtonSetActiveCaller; - -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle) -{ - GtkToggleButton* button = toolbar_append_toggle_button(toolbar, description, icon, toggle.m_command.m_callback); - toggle.m_exportCallback(ToggleButtonSetActiveCaller(*button)); - return button; -} diff --git a/libs/gtkutil/toolbar.h b/libs/gtkutil/toolbar.h deleted file mode 100644 index 9bf847d2..00000000 --- a/libs/gtkutil/toolbar.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_TOOLBAR_H) -#define INCLUDED_GTKUTIL_TOOLBAR_H - -#include "generic/callbackfwd.h" - -typedef struct _GtkButton GtkButton; -typedef struct _GtkToggleButton GtkToggleButton; -typedef struct _GtkToolbar GtkToolbar; -class Command; -class Toggle; - -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback); -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const Command& command); -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback); -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle); - -#endif diff --git a/libs/gtkutil/widget.cpp b/libs/gtkutil/widget.cpp deleted file mode 100644 index 62a1b6ca..00000000 --- a/libs/gtkutil/widget.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "widget.h" - diff --git a/libs/gtkutil/widget.h b/libs/gtkutil/widget.h deleted file mode 100644 index 225fccf4..00000000 --- a/libs/gtkutil/widget.h +++ /dev/null @@ -1,190 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_WIDGET_H) -#define INCLUDED_GTKUTIL_WIDGET_H - -#include -#include -#include "generic/callback.h" -#include "warnings.h" -#include "debugging/debugging.h" - -inline void widget_set_visible(GtkWidget* widget, bool shown) -{ - if(shown) - { - gtk_widget_show(widget); - } - else - { - gtk_widget_hide(widget); - } -} - -inline bool widget_is_visible(GtkWidget* widget) -{ - return GTK_WIDGET_VISIBLE(widget) != FALSE; -} - -inline void widget_toggle_visible(GtkWidget* widget) -{ - widget_set_visible(widget, !widget_is_visible(widget)); -} - -class ToggleItem -{ - BoolExportCallback m_exportCallback; - typedef std::list ImportCallbacks; - ImportCallbacks m_importCallbacks; -public: - ToggleItem(const BoolExportCallback& exportCallback) : m_exportCallback(exportCallback) - { - } - - void update() - { - for(ImportCallbacks::iterator i = m_importCallbacks.begin(); i != m_importCallbacks.end(); ++i) - { - m_exportCallback(*i); - } - } - - void addCallback(const BoolImportCallback& callback) - { - m_importCallbacks.push_back(callback); - m_exportCallback(callback); - } - typedef MemberCaller1 AddCallbackCaller; -}; - -class ToggleShown -{ - bool m_shownDeferred; - - ToggleShown(const ToggleShown& other); // NOT COPYABLE - ToggleShown& operator=(const ToggleShown& other); // NOT ASSIGNABLE - - static gboolean notify_visible(GtkWidget* widget, gpointer dummy, ToggleShown* self) - { - self->update(); - return FALSE; - } - static gboolean destroy(GtkWidget* widget, ToggleShown* self) - { - self->m_shownDeferred = GTK_WIDGET_VISIBLE(self->m_widget) != FALSE; - self->m_widget = 0; - return FALSE; - } -public: - GtkWidget* m_widget; - ToggleItem m_item; - - ToggleShown(bool shown) - : m_shownDeferred(shown), m_widget(0), m_item(ActiveCaller(*this)) - { - } - void update() - { - m_item.update(); - } - bool active() const - { - if(m_widget == 0) - { - return m_shownDeferred; - } - else - { - return GTK_WIDGET_VISIBLE(m_widget) != FALSE; - } - } - void exportActive(const BoolImportCallback& importCallback) - { - importCallback(active()); - } - typedef MemberCaller1 ActiveCaller; - void set(bool shown) - { - if(m_widget == 0) - { - m_shownDeferred = shown; - } - else - { - widget_set_visible(m_widget, shown); - } - } - void toggle() - { - widget_toggle_visible(m_widget); - } - typedef MemberCaller ToggleCaller; - void connect(GtkWidget* widget) - { - m_widget = widget; - widget_set_visible(m_widget, m_shownDeferred); - g_signal_connect(G_OBJECT(m_widget), "notify::visible", G_CALLBACK(notify_visible), this); - g_signal_connect(G_OBJECT(m_widget), "destroy", G_CALLBACK(destroy), this); - update(); - } -}; - - -inline void widget_queue_draw(GtkWidget& widget) -{ - gtk_widget_queue_draw(&widget); -} -typedef ReferenceCaller WidgetQueueDrawCaller; - - -inline void widget_make_default(GtkWidget* widget) -{ - GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); - gtk_widget_grab_default(widget); -} - -class WidgetFocusPrinter -{ - const char* m_name; - - static gboolean focus_in(GtkWidget *widget, GdkEventFocus *event, WidgetFocusPrinter* self) - { - globalOutputStream() << self->m_name << " takes focus\n"; - return FALSE; - } - static gboolean focus_out(GtkWidget *widget, GdkEventFocus *event, WidgetFocusPrinter* self) - { - globalOutputStream() << self->m_name << " loses focus\n"; - return FALSE; - } -public: - WidgetFocusPrinter(const char* name) : m_name(name) - { - } - void connect(GtkWidget* widget) - { - g_signal_connect(G_OBJECT(widget), "focus_in_event", G_CALLBACK(focus_in), this); - g_signal_connect(G_OBJECT(widget), "focus_out_event", G_CALLBACK(focus_out), this); - } -}; - -#endif diff --git a/libs/gtkutil/window.cpp b/libs/gtkutil/window.cpp deleted file mode 100644 index 5d465531..00000000 --- a/libs/gtkutil/window.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "window.h" - -#include - -#include "pointer.h" -#include "accelerator.h" - -inline void CHECK_RESTORE(GtkWidget* w) -{ - if(gpointer_to_int(g_object_get_data(G_OBJECT(w), "was_mapped")) != 0) - { - gtk_widget_show(w); - } -} - -inline void CHECK_MINIMIZE(GtkWidget* w) -{ - g_object_set_data(G_OBJECT(w), "was_mapped", gint_to_pointer(GTK_WIDGET_VISIBLE(w))); - gtk_widget_hide(w); -} - -static gboolean main_window_iconified(GtkWidget* widget, GdkEventWindowState* event, gpointer data) -{ - if((event->changed_mask & (GDK_WINDOW_STATE_ICONIFIED|GDK_WINDOW_STATE_WITHDRAWN)) != 0) - { - if((event->new_window_state & (GDK_WINDOW_STATE_ICONIFIED|GDK_WINDOW_STATE_WITHDRAWN)) != 0) - { - CHECK_MINIMIZE(GTK_WIDGET(data)); - } - else - { - CHECK_RESTORE(GTK_WIDGET(data)); - } - } - return FALSE; -} - -unsigned int connect_floating(GtkWindow* main_window, GtkWindow* floating) -{ - return g_signal_connect(G_OBJECT(main_window), "window_state_event", G_CALLBACK(main_window_iconified), floating); -} - -gboolean destroy_disconnect_floating(GtkWindow* widget, gpointer data) -{ - g_signal_handler_disconnect(G_OBJECT(data), gpointer_to_int(g_object_get_data(G_OBJECT(widget), "floating_handler"))); - return FALSE; -} - -gboolean floating_window_delete_present(GtkWindow* floating, GdkEventFocus *event, GtkWindow* main_window) -{ - if(gtk_window_is_active(floating) || gtk_window_is_active(main_window)) - { - gtk_window_present(main_window); - } - return FALSE; -} - -guint connect_floating_window_delete_present(GtkWindow* floating, GtkWindow* main_window) -{ - return g_signal_connect(G_OBJECT(floating), "delete_event", G_CALLBACK(floating_window_delete_present), main_window); -} - -gboolean floating_window_destroy_present(GtkWindow* floating, GtkWindow* main_window) -{ - if(gtk_window_is_active(floating) || gtk_window_is_active(main_window)) - { - gtk_window_present(main_window); - } - return FALSE; -} - -guint connect_floating_window_destroy_present(GtkWindow* floating, GtkWindow* main_window) -{ - return g_signal_connect(G_OBJECT(floating), "destroy", G_CALLBACK(floating_window_destroy_present), main_window); -} - -GtkWindow* create_floating_window(const char* title, GtkWindow* parent) -{ - GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); - gtk_window_set_title(window, title); - - if(parent != 0) - { - gtk_window_set_transient_for(window, parent); - connect_floating_window_destroy_present(window, parent); - g_object_set_data(G_OBJECT(window), "floating_handler", gint_to_pointer(connect_floating(parent, window))); - g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy_disconnect_floating), parent); - } - - return window; -} - -void destroy_floating_window(GtkWindow* window) -{ - gtk_widget_destroy(GTK_WIDGET(window)); -} - -gint window_realize_remove_sysmenu(GtkWidget* widget, gpointer data) -{ - gdk_window_set_decorations(widget->window, (GdkWMDecoration)(GDK_DECOR_ALL|GDK_DECOR_MENU)); - return FALSE; -} - -gboolean persistent_floating_window_delete(GtkWindow* floating, GdkEvent *event, GtkWindow* main_window) -{ - gtk_widget_hide(GTK_WIDGET(floating)); - return TRUE; -} - -GtkWindow* create_persistent_floating_window(const char* title, GtkWindow* main_window) -{ - GtkWindow* window = GTK_WINDOW(create_floating_window(title, main_window)); - - gtk_widget_set_events(GTK_WIDGET(window), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); - - connect_floating_window_delete_present(window, main_window); - g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(persistent_floating_window_delete), 0); - -#if 0 - if(g_multimon_globals.m_bStartOnPrimMon && g_multimon_globals.m_bNoSysMenuPopups) - g_signal_connect(G_OBJECT(window), "realize", G_CALLBACK(window_realize_remove_sysmenu), 0); -#endif - - return window; -} - -gint window_realize_remove_minmax(GtkWidget* widget, gpointer data) -{ - gdk_window_set_decorations(widget->window, (GdkWMDecoration)(GDK_DECOR_ALL|GDK_DECOR_MINIMIZE|GDK_DECOR_MAXIMIZE)); - return FALSE; -} - -void window_remove_minmax(GtkWindow* window) -{ - g_signal_connect(G_OBJECT(window), "realize", G_CALLBACK(window_realize_remove_minmax), 0); -} - - -GtkScrolledWindow* create_scrolled_window(GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, int border) -{ - GtkScrolledWindow* scr = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(0, 0)); - gtk_widget_show(GTK_WIDGET(scr)); - gtk_scrolled_window_set_policy(scr, hscrollbar_policy, vscrollbar_policy); - gtk_scrolled_window_set_shadow_type(scr, GTK_SHADOW_IN); - gtk_container_set_border_width(GTK_CONTAINER(scr), border); - return scr; -} - - diff --git a/libs/gtkutil/window.h b/libs/gtkutil/window.h deleted file mode 100644 index 5ab1e500..00000000 --- a/libs/gtkutil/window.h +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GTKUTIL_WINDOW_H) -#define INCLUDED_GTKUTIL_WINDOW_H - -#include - -#include "debugging/debugging.h" -#include "generic/callback.h" -#include "widget.h" - -inline gboolean window_focus_in_clear_focus_widget(GtkWidget* widget, GdkEventKey* event, gpointer data) -{ - gtk_window_set_focus(GTK_WINDOW(widget), NULL); - return FALSE; -} - -inline guint window_connect_focus_in_clear_focus_widget(GtkWindow* window) -{ - return g_signal_connect(G_OBJECT(window), "focus_in_event", G_CALLBACK(window_focus_in_clear_focus_widget), NULL); -} - - -unsigned int connect_floating(GtkWindow* main_window, GtkWindow* floating); -GtkWindow* create_floating_window(const char* title, GtkWindow* parent); -void destroy_floating_window(GtkWindow* window); - -GtkWindow* create_persistent_floating_window(const char* title, GtkWindow* main_window); -gboolean persistent_floating_window_delete(GtkWindow* floating, GdkEvent *event, GtkWindow* main_window); - -void window_remove_minmax(GtkWindow* window); - -typedef struct _GtkScrolledWindow GtkScrolledWindow; -GtkScrolledWindow* create_scrolled_window(GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, int border = 0); - - -struct WindowPosition -{ - int x, y, w, h; - - WindowPosition() - { - } - WindowPosition(int _x, int _y, int _w, int _h) - : x(_x), y(_y), w(_w), h(_h) - { - } -}; - -const WindowPosition c_default_window_pos(50, 25, 400, 300); - -inline void window_get_position(GtkWindow* window, WindowPosition& position) -{ - ASSERT_MESSAGE(window != 0, "error saving window position"); - - gtk_window_get_position(window, &position.x, &position.y); - gtk_window_get_size(window, &position.w, &position.h); -} - -inline void window_set_position(GtkWindow* window, const WindowPosition& position) -{ - gtk_window_set_gravity(window, GDK_GRAVITY_STATIC); - - GdkScreen* screen = gdk_screen_get_default(); - if(position.x < 0 - || position.y < 0 - || position.x > gdk_screen_get_width(screen) - || position.y > gdk_screen_get_height(screen)) - { - gtk_window_set_position(window, GTK_WIN_POS_CENTER_ON_PARENT); - } - else - { - gtk_window_move(window, position.x, position.y); - } - - gtk_window_set_default_size(window, position.w, position.h); -} - -inline void WindowPosition_Parse(WindowPosition& position, const char* value) -{ - if(sscanf(value, "%d %d %d %d", &position.x, &position.y, &position.w, &position.h) != 4) - { - position = WindowPosition(c_default_window_pos); // ensure sane default value for window position - } -} -typedef ReferenceCaller1 WindowPositionImportStringCaller; - -inline void WindowPosition_Write(const WindowPosition& position, const StringImportCallback& importCallback) -{ - char buffer[64]; - sprintf(buffer, "%d %d %d %d", position.x, position.y, position.w, position.h); - importCallback(buffer); -} -typedef ConstReferenceCaller1 WindowPositionExportStringCaller; - - - -class WindowPositionTracker -{ - WindowPosition m_position; - - static gboolean configure(GtkWidget* widget, GdkEventConfigure *event, WindowPositionTracker* self) - { - self->m_position = WindowPosition(event->x, event->y, event->width, event->height); - return FALSE; - } - -public: - WindowPositionTracker() - : m_position(c_default_window_pos) - { - } - - void sync(GtkWindow* window) - { - window_set_position(window, m_position); - } - - void connect(GtkWindow* window) - { - sync(window); - g_signal_connect(G_OBJECT(window), "configure_event", G_CALLBACK(configure), this); - } - - const WindowPosition& getPosition() const - { - return m_position; - } - - //hack - void setPosition(const WindowPosition& position) - { - m_position = position; - } -}; - - -inline void WindowPositionTracker_importString(WindowPositionTracker& self, const char* value) -{ - WindowPosition position; - WindowPosition_Parse(position, value); - self.setPosition(position); -} -typedef ReferenceCaller1 WindowPositionTrackerImportStringCaller; - -inline void WindowPositionTracker_exportString(const WindowPositionTracker& self, const StringImportCallback& importer) -{ - WindowPosition_Write(self.getPosition(), importer); -} -typedef ConstReferenceCaller1 WindowPositionTrackerExportStringCaller; - - - -#endif diff --git a/libs/gtkutil/xorrectangle.cpp b/libs/gtkutil/xorrectangle.cpp deleted file mode 100644 index d968337d..00000000 --- a/libs/gtkutil/xorrectangle.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xorrectangle.h" - diff --git a/libs/gtkutil/xorrectangle.h b/libs/gtkutil/xorrectangle.h deleted file mode 100644 index 0d89203e..00000000 --- a/libs/gtkutil/xorrectangle.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_XORRECTANGLE_H) -#define INCLUDED_XORRECTANGLE_H - -#include -#include "math/vector.h" - -class rectangle_t -{ -public: - rectangle_t() - : x(0), y(0), w(0), h(0) - {} - rectangle_t(float _x, float _y, float _w, float _h) - : x(_x), y(_y), w(_w), h(_h) - {} - float x; - float y; - float w; - float h; -}; - -struct Coord2D -{ - float x, y; - Coord2D(float _x, float _y) - : x(_x), y(_y) - { - } -}; - -inline Coord2D coord2d_device2screen(const Coord2D& coord, unsigned int width, unsigned int height) -{ - return Coord2D(((coord.x + 1.0f) * 0.5f) * width, ((coord.y + 1.0f) * 0.5f) * height); -} - -inline rectangle_t rectangle_from_area(const float min[2], const float max[2], unsigned int width, unsigned int height) -{ - Coord2D botleft(coord2d_device2screen(Coord2D(min[0], min[1]), width, height)); - Coord2D topright(coord2d_device2screen(Coord2D(max[0], max[1]), width, height)); - return rectangle_t(botleft.x, botleft.y, topright.x - botleft.x, topright.y - botleft.y); -} - -class XORRectangle -{ - - rectangle_t m_rectangle; - - GtkWidget* m_widget; - GdkGC* m_gc; - - bool initialised() const - { - return m_gc != 0; - } - void lazy_init() - { - if(!initialised()) - { - m_gc = gdk_gc_new(m_widget->window); - - GdkColor color = { 0, 0xffff, 0xffff, 0xffff, }; - GdkColormap* colormap = gdk_window_get_colormap(m_widget->window); - gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE); - gdk_gc_copy(m_gc, m_widget->style->white_gc); - gdk_gc_set_foreground(m_gc, &color); - gdk_gc_set_background(m_gc, &color); - - gdk_gc_set_function(m_gc, GDK_INVERT); - } - } - void draw() const - { - const int x = float_to_integer(m_rectangle.x); - const int y = float_to_integer(m_rectangle.y); - const int w = float_to_integer(m_rectangle.w); - const int h = float_to_integer(m_rectangle.h); - gdk_draw_rectangle(m_widget->window, m_gc, FALSE, x, -(h) - (y - m_widget->allocation.height), w, h); - } - -public: - XORRectangle(GtkWidget* widget) : m_widget(widget), m_gc(0) - { - } - ~XORRectangle() - { - if(initialised()) - { - gdk_gc_unref(m_gc); - } - } - void set(rectangle_t rectangle) - { - if(GTK_WIDGET_REALIZED(m_widget)) - { - lazy_init(); - draw(); - m_rectangle = rectangle; - draw(); - } - } -}; - - -#endif diff --git a/libs/igl_to_qgl.h b/libs/igl_to_qgl.h new file mode 100644 index 00000000..633cf478 --- /dev/null +++ b/libs/igl_to_qgl.h @@ -0,0 +1,806 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* +IGL tp QGL mapping header +Copyright (C) 2002 Splash Damage Ltd. +*/ + +#ifndef _IGL_TO_QGL_H_ +#define _IGL_TO_QGL_H_ + +#ifdef _WIN32 +#include +#endif + +enum VIEWTYPE {YZ, XZ, XY}; + +#include "igl.h" + +#ifndef APIENTRY + #define APIENTRY +#endif + +void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); +void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); +GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences); +void ( APIENTRY * qglArrayElement )(GLint i); +void ( APIENTRY * qglBegin )(GLenum mode); +void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture); +void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor); +void ( APIENTRY * qglCallList )(GLuint list); +void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists); +void ( APIENTRY * qglClear )(GLbitfield mask); +void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +void ( APIENTRY * qglClearDepth )(GLclampd depth); +void ( APIENTRY * qglClearIndex )(GLfloat c); +void ( APIENTRY * qglClearStencil )(GLint s); +void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation); +void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue); +void ( APIENTRY * qglColor3bv )(const GLbyte *v); +void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue); +void ( APIENTRY * qglColor3dv )(const GLdouble *v); +void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue); +void ( APIENTRY * qglColor3fv )(const GLfloat *v); +void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue); +void ( APIENTRY * qglColor3iv )(const GLint *v); +void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue); +void ( APIENTRY * qglColor3sv )(const GLshort *v); +void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue); +void ( APIENTRY * qglColor3ubv )(const GLubyte *v); +void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue); +void ( APIENTRY * qglColor3uiv )(const GLuint *v); +void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue); +void ( APIENTRY * qglColor3usv )(const GLushort *v); +void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +void ( APIENTRY * qglColor4bv )(const GLbyte *v); +void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +void ( APIENTRY * qglColor4dv )(const GLdouble *v); +void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglColor4fv )(const GLfloat *v); +void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha); +void ( APIENTRY * qglColor4iv )(const GLint *v); +void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha); +void ( APIENTRY * qglColor4sv )(const GLshort *v); +void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +void ( APIENTRY * qglColor4ubv )(const GLubyte *v); +void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha); +void ( APIENTRY * qglColor4uiv )(const GLuint *v); +void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha); +void ( APIENTRY * qglColor4usv )(const GLushort *v); +void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode); +void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglCullFace )(GLenum mode); +void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range); +void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures); +void ( APIENTRY * qglDepthFunc )(GLenum func); +void ( APIENTRY * qglDepthMask )(GLboolean flag); +void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar); +void ( APIENTRY * qglDisable )(GLenum cap); +void ( APIENTRY * qglDisableClientState )(GLenum array); +void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count); +void ( APIENTRY * qglDrawBuffer )(GLenum mode); +void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglEdgeFlag )(GLboolean flag); +void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag); +void ( APIENTRY * qglEnable )(GLenum cap); +void ( APIENTRY * qglEnableClientState )(GLenum array); +void ( APIENTRY * qglEnd )(void); +void ( APIENTRY * qglEndList )(void); +void ( APIENTRY * qglEvalCoord1d )(GLdouble u); +void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord1f )(GLfloat u); +void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u); +void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v); +void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v); +void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u); +void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2); +void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +void ( APIENTRY * qglEvalPoint1 )(GLint i); +void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j); +void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer); +void ( APIENTRY * qglFinish )(void); +void ( APIENTRY * qglFlush )(void); +void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglFogi )(GLenum pname, GLint param); +void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglFrontFace )(GLenum mode); +void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLuint ( APIENTRY * qglGenLists )(GLsizei range); +void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures); +void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params); +void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation); +void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params); +GLenum ( APIENTRY * qglGetError )(void); +void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params); +void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params); +void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v); +void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v); +void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v); +void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params); +void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values); +void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values); +void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values); +void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params); +void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask); +const GLubyte * ( APIENTRY * qglGetString )(GLenum name); +void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params); +void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglHint )(GLenum target, GLenum mode); +void ( APIENTRY * qglIndexMask )(GLuint mask); +void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglIndexd )(GLdouble c); +void ( APIENTRY * qglIndexdv )(const GLdouble *c); +void ( APIENTRY * qglIndexf )(GLfloat c); +void ( APIENTRY * qglIndexfv )(const GLfloat *c); +void ( APIENTRY * qglIndexi )(GLint c); +void ( APIENTRY * qglIndexiv )(const GLint *c); +void ( APIENTRY * qglIndexs )(GLshort c); +void ( APIENTRY * qglIndexsv )(const GLshort *c); +void ( APIENTRY * qglIndexub )(GLubyte c); +void ( APIENTRY * qglIndexubv )(const GLubyte *c); +void ( APIENTRY * qglInitNames )(void); +void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer); +GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap); +GLboolean ( APIENTRY * qglIsList )(GLuint list); +GLboolean ( APIENTRY * qglIsTexture )(GLuint texture); +void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param); +void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param); +void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param); +void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params); +void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern); +void ( APIENTRY * qglLineWidth )(GLfloat width); +void ( APIENTRY * qglListBase )(GLuint base); +void ( APIENTRY * qglLoadIdentity )(void); +void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m); +void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m); +void ( APIENTRY * qglLoadName )(GLuint name); +void ( APIENTRY * qglLogicOp )(GLenum opcode); +void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2); +void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2); +void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param); +void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param); +void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params); +void ( APIENTRY * qglMatrixMode )(GLenum mode); +void ( APIENTRY * qglMultMatrixd )(const GLdouble *m); +void ( APIENTRY * qglMultMatrixf )(const GLfloat *m); +void ( APIENTRY * qglNewList )(GLuint list, GLenum mode); +void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz); +void ( APIENTRY * qglNormal3bv )(const GLbyte *v); +void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz); +void ( APIENTRY * qglNormal3dv )(const GLdouble *v); +void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz); +void ( APIENTRY * qglNormal3fv )(const GLfloat *v); +void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz); +void ( APIENTRY * qglNormal3iv )(const GLint *v); +void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz); +void ( APIENTRY * qglNormal3sv )(const GLshort *v); +void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +void ( APIENTRY * qglPassThrough )(GLfloat token); +void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values); +void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values); +void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values); +void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor); +void ( APIENTRY * qglPointSize )(GLfloat size); +void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode); +void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units); +void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask); +void ( APIENTRY * qglPopAttrib )(void); +void ( APIENTRY * qglPopClientAttrib )(void); +void ( APIENTRY * qglPopMatrix )(void); +void ( APIENTRY * qglPopName )(void); +void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities); +void ( APIENTRY * qglPushAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushMatrix )(void); +void ( APIENTRY * qglPushName )(GLuint name); +void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y); +void ( APIENTRY * qglRasterPos2iv )(const GLint *v); +void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y); +void ( APIENTRY * qglRasterPos2sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglRasterPos3iv )(const GLint *v); +void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglRasterPos3sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglRasterPos4iv )(const GLint *v); +void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglRasterPos4sv )(const GLshort *v); +void ( APIENTRY * qglReadBuffer )(GLenum mode); +void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2); +void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2); +void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2); +void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2); +void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2); +GLint ( APIENTRY * qglRenderMode )(GLenum mode); +void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer); +void ( APIENTRY * qglShadeModel )(GLenum mode); +void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask); +void ( APIENTRY * qglStencilMask )(GLuint mask); +void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass); +void ( APIENTRY * qglTexCoord1d )(GLdouble s); +void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord1f )(GLfloat s); +void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord1i )(GLint s); +void ( APIENTRY * qglTexCoord1iv )(const GLint *v); +void ( APIENTRY * qglTexCoord1s )(GLshort s); +void ( APIENTRY * qglTexCoord1sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t); +void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t); +void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t); +void ( APIENTRY * qglTexCoord2iv )(const GLint *v); +void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t); +void ( APIENTRY * qglTexCoord2sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r); +void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r); +void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r); +void ( APIENTRY * qglTexCoord3iv )(const GLint *v); +void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r); +void ( APIENTRY * qglTexCoord3sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q); +void ( APIENTRY * qglTexCoord4iv )(const GLint *v); +void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q); +void ( APIENTRY * qglTexCoord4sv )(const GLshort *v); +void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param); +void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params); +void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param); +void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglVertex2dv )(const GLdouble *v); +void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglVertex2fv )(const GLfloat *v); +void ( APIENTRY * qglVertex2i )(GLint x, GLint y); +void ( APIENTRY * qglVertex2iv )(const GLint *v); +void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y); +void ( APIENTRY * qglVertex2sv )(const GLshort *v); +void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglVertex3dv )(const GLdouble *v); +void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex3fv )(const GLfloat *v); +void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglVertex3iv )(const GLint *v); +void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglVertex3sv )(const GLshort *v); +void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglVertex4dv )(const GLdouble *v); +void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglVertex4fv )(const GLfloat *v); +void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglVertex4iv )(const GLint *v); +void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglVertex4sv )(const GLshort *v); +void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height); + +void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value ); +void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); +void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); + +void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); +void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); + +void ( APIENTRY * qglActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglClientActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglMultiTexCoord1dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord1dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord1fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord1fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord1iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord1ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord1sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord1svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord2dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord2dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord2fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord2fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord2iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord2ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord2sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord2svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord3dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord3dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord3fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord3fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord3iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord3ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord3sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord3svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord4dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord4dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord4fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord4fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord4iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord4ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord4sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord4svARB) (GLenum target, const GLshort *v); + +extern "C" void InitIglToQgl( _QERQglTable *g_QglTable ) +{ +/* + // initialze the qgl functions + qglAccum = NULL; + qglAlphaFunc = g_QglTable->m_pfn_qglAlphaFunc; + qglAreTexturesResident = NULL; + qglArrayElement = NULL; + qglBegin = g_QglTable->m_pfn_qglBegin; + qglBindTexture = g_QglTable->m_pfn_qglBindTexture; + qglBitmap = NULL; + qglBlendFunc = g_QglTable->m_pfn_qglBlendFunc; + qglCallList = g_QglTable->m_pfn_qglCallList; + qglCallLists = g_QglTable->m_pfn_qglCallLists; + qglClear = g_QglTable->m_pfn_qglClear; + qglClearAccum = NULL; + qglClearColor = g_QglTable->m_pfn_qglClearColor; + qglClearDepth = g_QglTable->m_pfn_qglClearDepth; + qglClearIndex = NULL; + qglClearStencil = NULL; + qglClipPlane = NULL; + qglColor3b = NULL; + qglColor3bv = NULL; + qglColor3d = NULL; + qglColor3dv = NULL; + qglColor3f = g_QglTable->m_pfn_qglColor3f; + qglColor3fv = g_QglTable->m_pfn_qglColor3fv; + qglColor3i = NULL; + qglColor3iv = NULL; + qglColor3s = NULL; + qglColor3sv = NULL; + qglColor3ub = NULL; + qglColor3ubv = NULL; + qglColor3ui = NULL; + qglColor3uiv = NULL; + qglColor3us = NULL; + qglColor3usv = NULL; + qglColor4b = NULL; + qglColor4bv = NULL; + qglColor4d = NULL; + qglColor4dv = NULL; + qglColor4f = g_QglTable->m_pfn_qglColor4f; + qglColor4fv = g_QglTable->m_pfn_qglColor4fv; + qglColor4i = NULL; + qglColor4iv = NULL; + qglColor4s = NULL; + qglColor4sv = NULL; + qglColor4ub = NULL; + qglColor4ubv = NULL; + qglColor4ui = NULL; + qglColor4uiv = NULL; + qglColor4us = NULL; + qglColor4usv = NULL; + qglColorMask = NULL; + qglColorMaterial = NULL; + qglColorPointer = NULL; + qglCopyPixels = NULL; + qglCopyTexImage1D = NULL; + qglCopyTexImage2D = NULL; + qglCopyTexSubImage1D = NULL; + qglCopyTexSubImage2D = NULL; + qglCullFace = g_QglTable->m_pfn_qglCullFace; + qglDeleteLists = g_QglTable->m_pfn_qglDeleteLists; + qglDeleteTextures = g_QglTable->m_pfn_qglDeleteTextures; + qglDepthFunc = g_QglTable->m_pfn_qglDepthFunc; + qglDepthMask = g_QglTable->m_pfn_qglDepthMask; + qglDepthRange = NULL; + qglDisable = g_QglTable->m_pfn_qglDisable; + qglDisableClientState = NULL; + qglDrawArrays = NULL; + qglDrawBuffer = NULL; + qglDrawElements = NULL; + qglDrawPixels = NULL; + qglEdgeFlag = NULL; + qglEdgeFlagPointer = NULL; + qglEdgeFlagv = NULL; + qglEnable = g_QglTable->m_pfn_qglEnable; + qglEnableClientState = NULL; + qglEnd = g_QglTable->m_pfn_qglEnd; + qglEndList = g_QglTable->m_pfn_qglEndList; + qglEvalCoord1d = NULL; + qglEvalCoord1dv = NULL; + qglEvalCoord1f = NULL; + qglEvalCoord1fv = NULL; + qglEvalCoord2d = NULL; + qglEvalCoord2dv = NULL; + qglEvalCoord2f= NULL; + qglEvalCoord2fv = NULL; + qglEvalMesh1 = NULL; + qglEvalMesh2 = NULL; + qglEvalPoint1 = NULL; + qglEvalPoint2 = NULL; + qglFeedbackBuffer = NULL; + qglFinish = NULL; + qglFlush = NULL; + qglFogf = g_QglTable->m_pfn_qglFogf; + qglFogfv = g_QglTable->m_pfn_qglFogfv; + qglFogi = g_QglTable->m_pfn_qglFogi; + qglFogiv = NULL; + qglFrontFace = NULL; + qglFrustum = NULL; + qglGenLists = g_QglTable->m_pfn_qglGenLists; + qglGenTextures = g_QglTable->m_pfn_qglGenTextures; + qglGetBooleanv = NULL; + qglGetClipPlane = NULL; + qglGetDoublev = NULL; + qglGetError = NULL; + qglGetFloatv = NULL; + qglGetIntegerv = NULL; + qglGetLightfv = NULL; + qglGetLightiv = NULL; + qglGetMapdv = NULL; + qglGetMapfv = NULL; + qglGetMapiv = NULL; + qglGetMaterialfv = NULL; + qglGetMaterialiv = NULL; + qglGetPixelMapfv = NULL; + qglGetPixelMapuiv = NULL; + qglGetPixelMapusv = NULL; + qglGetPointerv = NULL; + qglGetPolygonStipple = NULL; + qglGetString = NULL; + qglGetTexEnvfv = NULL; + qglGetTexEnviv = NULL; + qglGetTexGendv = NULL; + qglGetTexGenfv = NULL; + qglGetTexGeniv = NULL; + qglGetTexImage = NULL; + qglGetTexLevelParameterfv = NULL; + qglGetTexLevelParameteriv = NULL; + qglGetTexParameterfv = NULL; + qglGetTexParameteriv = NULL; + qglHint = g_QglTable->m_pfn_qglHint; + qglIndexMask = NULL; + qglIndexPointer = NULL; + qglIndexd = NULL; + qglIndexdv = NULL; + qglIndexf = NULL; + qglIndexfv = NULL; + qglIndexi = NULL; + qglIndexiv = NULL; + qglIndexs = NULL; + qglIndexsv = NULL; + qglIndexub = NULL; + qglIndexubv = NULL; + qglInitNames = NULL; + qglInterleavedArrays = NULL; + qglIsEnabled = NULL; + qglIsList = NULL; + qglIsTexture = NULL; + qglLightModelf = NULL; + qglLightModelfv = NULL; + qglLightModeli = NULL; + qglLightModeliv = NULL; + qglLightf = NULL; + qglLightfv = g_QglTable->m_pfn_qglLightfv; + qglLighti = NULL; + qglLightiv = NULL; + qglLineStipple = g_QglTable->m_pfn_qglLineStipple; + qglLineWidth = g_QglTable->m_pfn_qglLineWidth; + qglListBase = g_QglTable->m_pfn_qglListBase; + qglLoadIdentity = g_QglTable->m_pfn_qglLoadIdentity; + qglLoadMatrixd = NULL; + qglLoadMatrixf = NULL; + qglLoadName = NULL; + qglLogicOp = NULL; + qglMap1d = NULL; + qglMap1f = NULL; + qglMap2d = NULL; + qglMap2f = NULL; + qglMapGrid1d = NULL; + qglMapGrid1f = NULL; + qglMapGrid2d = NULL; + qglMapGrid2f = NULL; + qglMaterialf = g_QglTable->m_pfn_qglMaterialf; + qglMaterialfv = g_QglTable->m_pfn_qglMaterialfv; + qglMateriali = NULL; + qglMaterialiv = NULL; + qglMatrixMode = g_QglTable->m_pfn_qglMatrixMode; + qglMultMatrixd = NULL; + qglMultMatrixf = g_QglTable->m_pfn_qglMultMatrixf; + qglNewList = g_QglTable->m_pfn_qglNewList; + qglNormal3b = NULL; + qglNormal3bv = NULL; + qglNormal3d = NULL; + qglNormal3dv = NULL; + qglNormal3f = g_QglTable->m_pfn_qglNormal3f; + qglNormal3fv = g_QglTable->m_pfn_qglNormal3fv; + qglNormal3i = NULL; + qglNormal3iv = NULL; + qglNormal3s = NULL; + qglNormal3sv = NULL; + qglNormalPointer = NULL; + qglOrtho = g_QglTable->m_pfn_qglOrtho; + qglPassThrough = NULL; + qglPixelMapfv = NULL; + qglPixelMapuiv = NULL; + qglPixelMapusv = NULL; + qglPixelStoref = NULL; + qglPixelStorei = NULL; + qglPixelTransferf = NULL; + qglPixelTransferi = NULL; + qglPixelZoom = NULL; + qglPointSize = g_QglTable->m_pfn_qglPointSize; + qglPolygonMode = g_QglTable->m_pfn_qglPolygonMode; + qglPolygonOffset = NULL; + qglPolygonStipple = NULL; + qglPopAttrib = g_QglTable->m_pfn_qglPopAttrib; + qglPopClientAttrib = NULL; + qglPopMatrix = g_QglTable->m_pfn_qglPopMatrix; + qglPopName = NULL; + qglPrioritizeTextures = NULL; + qglPushAttrib = g_QglTable->m_pfn_qglPushAttrib; + qglPushClientAttrib = NULL; + qglPushMatrix = g_QglTable->m_pfn_qglPushMatrix; + qglPushName = NULL; + qglRasterPos2d = NULL; + qglRasterPos2dv = NULL; + qglRasterPos2f = NULL; + qglRasterPos2fv = NULL; + qglRasterPos2i = NULL; + qglRasterPos2iv = NULL; + qglRasterPos2s = NULL; + qglRasterPos2sv = NULL; + qglRasterPos3d = NULL; + qglRasterPos3dv = NULL; + qglRasterPos3f = NULL; + qglRasterPos3fv = g_QglTable->m_pfn_qglRasterPos3fv; + qglRasterPos3i = NULL; + qglRasterPos3iv = NULL; + qglRasterPos3s = NULL; + qglRasterPos3sv = NULL; + qglRasterPos4d = NULL; + qglRasterPos4dv = NULL; + qglRasterPos4f = NULL; + qglRasterPos4fv = NULL; + qglRasterPos4i = NULL; + qglRasterPos4iv = NULL; + qglRasterPos4s = NULL; + qglRasterPos4sv = NULL; + qglReadBuffer = NULL; + qglReadPixels = NULL; + qglRectd = NULL; + qglRectdv = NULL; + qglRectf = NULL; + qglRectfv = NULL; + qglRecti = NULL; + qglRectiv = NULL; + qglRects = NULL; + qglRectsv = NULL; + qglRenderMode = NULL; + qglRotated = g_QglTable->m_pfn_qglRotated; + qglRotatef = g_QglTable->m_pfn_qglRotatef; + qglScaled = NULL; + qglScalef = g_QglTable->m_pfn_qglScalef; + qglScissor = g_QglTable->m_pfn_qglScissor; + qglSelectBuffer = NULL; + qglShadeModel = g_QglTable->m_pfn_qglShadeModel; + qglStencilFunc = NULL; + qglStencilMask = NULL; + qglStencilOp = NULL; + qglTexCoord1d = NULL; + qglTexCoord1dv = NULL; + qglTexCoord1f = NULL; + qglTexCoord1fv = NULL; + qglTexCoord1i = NULL; + qglTexCoord1iv = NULL; + qglTexCoord1s = NULL; + qglTexCoord1sv = NULL; + qglTexCoord2d = NULL; + qglTexCoord2dv = NULL; + qglTexCoord2f = g_QglTable->m_pfn_qglTexCoord2f; + qglTexCoord2fv = g_QglTable->m_pfn_qglTexCoord2fv; + qglTexCoord2i = NULL; + qglTexCoord2iv = NULL; + qglTexCoord2s = NULL; + qglTexCoord2sv = NULL; + qglTexCoord3d = NULL; + qglTexCoord3dv = NULL; + qglTexCoord3f = NULL; + qglTexCoord3fv = NULL; + qglTexCoord3i = NULL; + qglTexCoord3iv = NULL; + qglTexCoord3s = NULL; + qglTexCoord3sv = NULL; + qglTexCoord4d = NULL; + qglTexCoord4dv = NULL; + qglTexCoord4f = NULL; + qglTexCoord4fv = NULL; + qglTexCoord4i = NULL; + qglTexCoord4iv = NULL; + qglTexCoord4s = NULL; + qglTexCoord4sv = NULL; + qglTexCoordPointer = NULL; + qglTexEnvf = g_QglTable->m_pfn_qglTexEnvf; + qglTexEnvfv = NULL; + qglTexEnvi = NULL; + qglTexEnviv = NULL; + qglTexGend = NULL; + qglTexGendv = NULL; + qglTexGenf = g_QglTable->m_pfn_qglTexGenf; + qglTexGenfv = NULL; + qglTexGeni = NULL; + qglTexGeniv = NULL; + qglTexImage1D = g_QglTable->m_pfn_qglTexImage1D; + qglTexImage2D = g_QglTable->m_pfn_qglTexImage2D; + qglTexParameterf = g_QglTable->m_pfn_qglTexParameterf; + qglTexParameterfv = g_QglTable->m_pfn_qglTexParameterfv; + qglTexParameteri = g_QglTable->m_pfn_qglTexParameteri; + qglTexParameteriv = g_QglTable->m_pfn_qglTexParameteriv; + qglTexSubImage1D = g_QglTable->m_pfn_qglTexSubImage1D; + qglTexSubImage2D = g_QglTable->m_pfn_qglTexSubImage2D; + qglTranslated = g_QglTable->m_pfn_qglTranslated; + qglTranslatef = g_QglTable->m_pfn_qglTranslatef; + qglVertex2d = NULL; + qglVertex2dv = NULL; + qglVertex2f = g_QglTable->m_pfn_qglVertex2f; + qglVertex2fv = NULL; + qglVertex2i = NULL; + qglVertex2iv = NULL; + qglVertex2s = NULL; + qglVertex2sv = NULL; + qglVertex3d = NULL; + qglVertex3dv = NULL; + qglVertex3f = g_QglTable->m_pfn_qglVertex3f; + qglVertex3fv = g_QglTable->m_pfn_qglVertex3fv; + qglVertex3i = NULL; + qglVertex3iv = NULL; + qglVertex3s = NULL; + qglVertex3sv = NULL; + qglVertex4d = NULL; + qglVertex4dv = NULL; + qglVertex4f = NULL; + qglVertex4fv = NULL; + qglVertex4i = NULL; + qglVertex4iv = NULL; + qglVertex4s = NULL; + qglVertex4sv = NULL; + qglVertexPointer = NULL; + qglViewport = g_QglTable->m_pfn_qglViewport; + + qglPointParameterfEXT = NULL; + qglPointParameterfvEXT = NULL; + qglColorTableEXT = NULL; + + qglMTexCoord2fSGIS = NULL; + qglSelectTextureSGIS = NULL; + + qglActiveTextureARB = NULL; + qglClientActiveTextureARB = NULL; + qglMultiTexCoord1dARB = NULL; + qglMultiTexCoord1dvARB = NULL; + qglMultiTexCoord1fARB = NULL; + qglMultiTexCoord1fvARB = NULL; + qglMultiTexCoord1iARB = NULL; + qglMultiTexCoord1ivARB = NULL; + qglMultiTexCoord1sARB = NULL; + qglMultiTexCoord1svARB = NULL; + qglMultiTexCoord2dARB = NULL; + qglMultiTexCoord2dvARB = NULL; + qglMultiTexCoord2fARB = NULL; + qglMultiTexCoord2fvARB = NULL; + qglMultiTexCoord2iARB = NULL; + qglMultiTexCoord2ivARB = NULL; + qglMultiTexCoord2sARB = NULL; + qglMultiTexCoord2svARB = NULL; + qglMultiTexCoord3dARB = NULL; + qglMultiTexCoord3dvARB = NULL; + qglMultiTexCoord3fARB = NULL; + qglMultiTexCoord3fvARB = NULL; + qglMultiTexCoord3iARB = NULL; + qglMultiTexCoord3ivARB = NULL; + qglMultiTexCoord3sARB = NULL; + qglMultiTexCoord3svARB = NULL; + qglMultiTexCoord4dARB = NULL; + qglMultiTexCoord4dvARB = NULL; + qglMultiTexCoord4fARB = NULL; + qglMultiTexCoord4fvARB = NULL; + qglMultiTexCoord4iARB = NULL; + qglMultiTexCoord4ivARB = NULL; + qglMultiTexCoord4sARB = NULL; + qglMultiTexCoord4svARB = NULL; +*/ +} + +#endif // _IGL_TO_QGL_H_ diff --git a/libs/imagelib.cpp b/libs/imagelib.cpp deleted file mode 100644 index 5c205f63..00000000 --- a/libs/imagelib.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "imagelib.h" - diff --git a/libs/imagelib.h b/libs/imagelib.h deleted file mode 100644 index b5f95b7d..00000000 --- a/libs/imagelib.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IMAGELIB_H) -#define INCLUDED_IMAGELIB_H - -#include "iimage.h" -#include "iarchive.h" -#include "idatastream.h" -#include - -struct RGBAPixel -{ - unsigned char red, green, blue, alpha; -}; - -class RGBAImage : public Image -{ - RGBAImage(const RGBAImage& other); - RGBAImage& operator=(const RGBAImage& other); -public: - RGBAPixel* pixels; - unsigned int width, height; - - RGBAImage(unsigned int _width, unsigned int _height) - : pixels(new RGBAPixel[_width * _height]), width(_width), height(_height) - { - } - ~RGBAImage() - { - delete pixels; - } - - void release() - { - delete this; - } - byte* getRGBAPixels() const - { - return reinterpret_cast(pixels); - } - unsigned int getWidth() const - { - return width; - } - unsigned int getHeight() const - { - return height; - } -}; - -class RGBAImageFlags : public RGBAImage -{ -public: - int m_surfaceFlags; - int m_contentFlags; - int m_value; - RGBAImageFlags(unsigned short _width, unsigned short _height, int surfaceFlags, int contentFlags, int value) : - RGBAImage(_width, _height), m_surfaceFlags(surfaceFlags), m_contentFlags(contentFlags), m_value(value) - { - } - - int getSurfaceFlags() const - { - return m_surfaceFlags; - } - int getContentFlags() const - { - return m_contentFlags; - } - int getValue() const - { - return m_value; - } -}; - - -inline InputStream::byte_type* ArchiveFile_loadBuffer(ArchiveFile& file, std::size_t& length) -{ - InputStream::byte_type* buffer = (InputStream::byte_type*)malloc(file.size() + 1); - length = file.getInputStream().read(buffer, file.size()); - buffer[file.size()] = 0; - return buffer; -} - -inline void ArchiveFile_freeBuffer(InputStream::byte_type* buffer) -{ - free(buffer); -} - -class ScopedArchiveBuffer -{ -public: - std::size_t length; - InputStream::byte_type* buffer; - - ScopedArchiveBuffer(ArchiveFile& file) - { - buffer = ArchiveFile_loadBuffer(file, length); - } - ~ScopedArchiveBuffer() - { - ArchiveFile_freeBuffer(buffer); - } -}; - -class PointerInputStream : public InputStream -{ - const byte* m_read; -public: - PointerInputStream(const byte* pointer) - : m_read(pointer) - { - } - std::size_t read(byte* buffer, std::size_t length) - { - const byte* end = m_read + length; - while(m_read != end) - { - *buffer++ = *m_read++; - } - return length; - } - void seek(std::size_t offset) - { - m_read += offset; - } - const byte* get() - { - return m_read; - } -}; - -#endif diff --git a/libs/instancelib.cpp b/libs/instancelib.cpp deleted file mode 100644 index 053ac73b..00000000 --- a/libs/instancelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "instancelib.h" diff --git a/libs/instancelib.h b/libs/instancelib.h deleted file mode 100644 index 9ff32e6d..00000000 --- a/libs/instancelib.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_INSTANCELIB_H) -#define INCLUDED_INSTANCELIB_H - -#include "debugging/debugging.h" - -#include "iscenegraph.h" - -#include "scenelib.h" -#include "generic/reference.h" -#include "generic/callback.h" -#include - -class InstanceSubgraphWalker : public scene::Traversable::Walker -{ - scene::Instantiable::Observer* m_observer; - mutable scene::Path m_path; - mutable Stack m_parent; -public: - InstanceSubgraphWalker(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* parent) - : m_observer(observer), m_path(path), m_parent(parent) - { - } - bool pre(scene::Node& node) const - { - m_path.push(makeReference(node)); - scene::Instance* instance = Node_getInstantiable(node)->create(m_path, m_parent.top()); - m_observer->insert(instance); - Node_getInstantiable(node)->insert(m_observer, m_path, instance); - m_parent.push(instance); - return true; - } - void post(scene::Node& node) const - { - m_path.pop(); - m_parent.pop(); - } -}; - -class UninstanceSubgraphWalker : public scene::Traversable::Walker -{ - scene::Instantiable::Observer* m_observer; - mutable scene::Path m_path; -public: - UninstanceSubgraphWalker(scene::Instantiable::Observer* observer, const scene::Path& parent) - : m_observer(observer), m_path(parent) - { - } - bool pre(scene::Node& node) const - { - m_path.push(makeReference(node)); - return true; - } - void post(scene::Node& node) const - { - scene::Instance* instance = Node_getInstantiable(node)->erase(m_observer, m_path); - m_observer->erase(instance); - delete instance; - m_path.pop(); - } -}; - -class InstanceSet : public scene::Traversable::Observer -{ - typedef std::pair CachePath; - - typedef CachePath key_type; - - typedef std::map InstanceMap; - InstanceMap m_instances; -public: - - typedef InstanceMap::iterator iterator; - - iterator begin() - { - return m_instances.begin(); - } - iterator end() - { - return m_instances.end(); - } - - // traverse observer - void insert(scene::Node& child) - { - for(iterator i = begin(); i != end(); ++i) - { - Node_traverseSubgraph(child, InstanceSubgraphWalker((*i).first.first, (*i).first.second, (*i).second)); - (*i).second->boundsChanged(); - } - } - void erase(scene::Node& child) - { - for(iterator i = begin(); i != end(); ++i) - { - Node_traverseSubgraph(child, UninstanceSubgraphWalker((*i).first.first, (*i).first.second)); - (*i).second->boundsChanged(); - } - } - - // instance - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - for(iterator i = begin(); i != end(); ++i) - { - visitor.visit(*(*i).second); - } - } - - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - ASSERT_MESSAGE(m_instances.find(key_type(observer, PathConstReference(instance->path()))) == m_instances.end(), "InstanceSet::insert - element already exists"); - m_instances.insert(InstanceMap::value_type(key_type(observer, PathConstReference(instance->path())), instance)); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - ASSERT_MESSAGE(m_instances.find(key_type(observer, PathConstReference(path))) != m_instances.end(), "InstanceSet::erase - failed to find element"); - InstanceMap::iterator i = m_instances.find(key_type(observer, PathConstReference(path))); - scene::Instance* instance = i->second; - m_instances.erase(i); - return instance; - } - - void transformChanged() - { - for(InstanceMap::iterator i = m_instances.begin(); i != m_instances.end(); ++i) - { - (*i).second->transformChanged(); - } - } - typedef MemberCaller TransformChangedCaller; - void boundsChanged() - { - for(InstanceMap::iterator i = m_instances.begin(); i != m_instances.end(); ++i) - { - (*i).second->boundsChanged(); - } - } - typedef MemberCaller BoundsChangedCaller; -}; - -template -inline void InstanceSet_forEach(InstanceSet& instances, const Functor& functor) -{ - for(InstanceSet::iterator i = instances.begin(), end = instances.end(); i != end; ++i) - { - functor(*(*i).second); - } -} - -template -class InstanceEvaluateTransform -{ -public: - inline void operator()(scene::Instance& instance) const - { - InstanceTypeCast::cast(instance)->evaluateTransform(); - } -}; - -template -class InstanceSetEvaluateTransform -{ -public: - static void apply(InstanceSet& instances) - { - InstanceSet_forEach(instances, InstanceEvaluateTransform()); - } - typedef ReferenceCaller::apply> Caller; -}; - -#endif diff --git a/libs/jpeg6/README b/libs/jpeg6/README deleted file mode 100644 index 86cc2066..00000000 --- a/libs/jpeg6/README +++ /dev/null @@ -1,385 +0,0 @@ -The Independent JPEG Group's JPEG software -========================================== - -README for release 6b of 27-Mar-1998 -==================================== - -This distribution contains the sixth public release of the Independent JPEG -Group's free JPEG software. You are welcome to redistribute this software and -to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. - -Serious users of this software (particularly those incorporating it into -larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to -our electronic mailing list. Mailing list members are notified of updates -and have a chance to participate in technical discussions, etc. - -This software is the work of Tom Lane, Philip Gladstone, Jim Boucher, -Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, -Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG -Group. - -IJG is not affiliated with the official ISO JPEG standards committee. - - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -RELATED SOFTWARE Other stuff you should get. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - install.doc How to configure and install the IJG software. - usage.doc Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.doc). - wizard.doc Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.doc How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.doc Overview of the JPEG library's internal structure. - filelist.doc Road map of IJG files. - coderules.doc Coding style rules --- please read if you contribute code. - -Please read at least the files install.doc and usage.doc. Useful information -can also be found in the JPEG FAQ (Frequently Asked Questions) article. See -ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - - -OVERVIEW -======== - -This package contains C software to implement JPEG image compression and -decompression. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and gray-scale images. JPEG is intended for compressing -"real-world" scenes; line drawings, cartoons and other non-realistic images -are not its strong suit. JPEG is lossy, meaning that the output image is not -exactly identical to the input image. Hence you must not use JPEG if you -have to have identical output bits. However, on typical photographic images, -very good compression levels can be obtained with no visible change, and -remarkably high compression levels are possible if you can tolerate a -low-quality image. For more details, see the references, or just experiment -with various compression settings. - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -For legal reasons, we are not distributing code for the arithmetic-coding -variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting -the hierarchical or lossless processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. We have also included -"jpegtran", a utility for lossless transcoding between different JPEG -processes, and "rdjpgcom" and "wrjpgcom", two simple applications for -inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-1998, Thomas G. Lane. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - - -ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, -sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. -ansi2knr.c is NOT covered by the above copyright and conditions, but instead -by the usual distribution terms of the Free Software Foundation; principally, -that you must include source code if you redistribute it. (See the file -ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part -of any program generated from the IJG code, this does not limit you more than -the foregoing paragraphs do. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltconfig, ltmain.sh). Another support script, install-sh, is copyright -by M.I.T. but is also freely distributable. - -It appears that the arithmetic coding option of the JPEG spec is covered by -patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot -legally be used without obtaining one or more licenses. For this reason, -support for arithmetic coding has been removed from the free JPEG software. -(Since arithmetic coding provides only a marginal gain over the unpatented -Huffman mode, it is unlikely that very many implementations will support it.) -So far as we are aware, there are no patent restrictions on the remaining -code. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent, GIF reading support has -been removed altogether, and the GIF writer has been simplified to produce -"uncompressed GIFs". This technique does not use the LZW algorithm; the -resulting GIF files are larger than usual, but are readable by all standard -GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - - -REFERENCES -========== - -We highly recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PostScript file containing a revised version of Wallace's article is -available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best full description of JPEG is the textbook "JPEG Still Image Data -Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published -by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp. -The book includes the complete text of the ISO JPEG standards (DIS 10918-1 -and draft DIS 10918-2). This is by far the most complete exposition of JPEG -in existence, and we highly recommend it. - -The JPEG standard itself is not available electronically; you must order a -paper copy through ISO or ITU. (Unless you feel a need to own a certified -official copy, we recommend buying the Pennebaker and Mitchell book instead; -it's much cheaper and includes a great deal of useful explanatory material.) -In the USA, copies of the standard may be ordered from ANSI Sales at (212) -642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI -doesn't take credit card orders, but Global does.) It's not cheap: as of -1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7% -shipping/handling. The standard is divided into two parts, Part 1 being the -actual specification, while Part 2 covers compliance testing methods. Part 1 -is titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. - -Some extensions to the original JPEG standard are defined in JPEG Part 3, -a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG -currently does not support any Part 3 extensions. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. A copy of the JFIF spec is available from: - Literature Department - C-Cube Microsystems, Inc. - 1778 McCarthy Blvd. - Milpitas, CA 95035 - phone (408) 944-6300, fax (408) 944-6314 -A PostScript version of this document is available by FTP at -ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text -version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing -the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or -from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. libtiff is available -from ftp://ftp.sgi.com/graphics/tiff/. - - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is ftp.uu.net (Internet -address 192.48.96.9). The most recent released version can always be found -there in directory graphics/jpeg. This particular version will be archived -as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have -direct Internet access, UUNET's archives are also available via UUCP; contact -help@uunet.uu.net for information on retrieving files that way. - -Numerous Internet sites maintain copies of the UUNET files. However, only -ftp.uu.net is guaranteed to have the latest official version. - -You can also obtain this software in DOS-compatible "zip" archive format from -the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or -on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12 -"JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net -release. - -The JPEG FAQ (Frequently Asked Questions) article is a useful source of -general information about JPEG. It is updated constantly and therefore is -not included in this distribution. The FAQ is posted every two weeks to -Usenet newsgroups comp.graphics.misc, news.answers, and other groups. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - - -RELATED SOFTWARE -================ - -Numerous viewing and image manipulation programs now support JPEG. (Quite a -few of them use this library to do so.) The JPEG FAQ described above lists -some of the more popular free and shareware viewers, and tells where to -obtain them on Internet. - -If you are on a Unix machine, we highly recommend Jef Poskanzer's free -PBMPLUS software, which provides many useful operations on PPM-format image -files. In particular, it can convert PPM images to and from a wide range of -other formats, thus making cjpeg/djpeg considerably more useful. The latest -version is distributed by the NetPBM group, and is available from numerous -sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/. -Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is; -you are likely to have difficulty making it work on any non-Unix machine. - -A different free JPEG implementation, written by the PVRG group at Stanford, -is available from ftp://havefun.stanford.edu/pub/jpeg/. This program -is designed for research and experimentation rather than production use; -it is slower, harder to use, and less portable than the IJG code, but it -is easier to read and modify. Also, the PVRG code supports lossless JPEG, -which we do not. (On the other hand, it doesn't do progressive JPEG.) - - -FILE FORMAT WARS -================ - -Some JPEG programs produce files that are not compatible with our library. -The root of the problem is that the ISO JPEG committee failed to specify a -concrete file format. Some vendors "filled in the blanks" on their own, -creating proprietary formats that no one else could read. (For example, none -of the early commercial JPEG implementations for the Macintosh were able to -exchange compressed files.) - -The file format we have adopted is called JFIF (see REFERENCES). This format -has been agreed to by a number of major commercial JPEG vendors, and it has -become the de facto standard. JFIF is a minimal or "low end" representation. -We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF -Technical Note #2) for "high end" applications that need to record a lot of -additional data about an image. TIFF/JPEG is fairly new and not yet widely -supported, unfortunately. - -The upcoming JPEG Part 3 standard defines a file format called SPIFF. -SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should -be able to read the most common variant of SPIFF. SPIFF has some technical -advantages over JFIF, but its major claim to fame is simply that it is an -official standard rather than an informal one. At this point it is unclear -whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto -standard. IJG intends to support SPIFF once the standard is frozen, but we -have not decided whether it should become our default output format or not. -(In any case, our decoder will remain capable of reading JFIF indefinitely.) - -Various proprietary file formats incorporating JPEG compression also exist. -We have little or no sympathy for the existence of these formats. Indeed, -one of the original reasons for developing this free software was to help -force convergence on common, open format standards for JPEG files. Don't -use a proprietary file format! - - -TO DO -===== - -The major thrust for v7 will probably be improvement of visual quality. -The current method for scaling the quantization tables is known not to be -very good at low Q values. We also intend to investigate block boundary -smoothing, "poor man's variable quantization", and other means of improving -quality-vs-file-size performance without sacrificing compatibility. - -In future versions, we are considering supporting some of the upcoming JPEG -Part 3 extensions --- principally, variable quantization and the SPIFF file -format. - -As always, speeding things up is of great interest. - -Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net. diff --git a/libs/jpeg6/jchuff.h b/libs/jpeg6/jchuff.h deleted file mode 100644 index f43d571d..00000000 --- a/libs/jpeg6/jchuff.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * jchuff.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for Huffman entropy encoding routines - * that are shared between the sequential encoder (jchuff.c) and the - * progressive encoder (jcphuff.c). No other modules need to see these. - */ - -/* Derived data constructed for each Huffman table */ - -typedef struct { - unsigned int ehufco[256]; /* code for each symbol */ - char ehufsi[256]; /* length of code for each symbol */ - /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ -} c_derived_tbl; - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_make_c_derived_tbl jMkCDerived -#define jpeg_gen_optimal_table jGenOptTbl -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Expand a Huffman table definition into the derived format */ -EXTERN void jpeg_make_c_derived_tbl JPP((j_compress_ptr cinfo, - JHUFF_TBL * htbl, c_derived_tbl ** pdtbl)); - -/* Generate an optimal table definition given the specified counts */ -EXTERN void jpeg_gen_optimal_table JPP((j_compress_ptr cinfo, - JHUFF_TBL * htbl, long freq[])); diff --git a/libs/jpeg6/jcomapi.cpp b/libs/jpeg6/jcomapi.cpp deleted file mode 100644 index df3302cb..00000000 --- a/libs/jpeg6/jcomapi.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * jcomapi.c - * - * Copyright (C) 1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface routines that are used for both - * compression and decompression. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* - * Abort processing of a JPEG compression or decompression operation, - * but don't destroy the object itself. - * - * For this, we merely clean up all the nonpermanent memory pools. - * Note that temp files (virtual arrays) are not allowed to belong to - * the permanent pool, so we will be able to close all temp files here. - * Closing a data source or destination, if necessary, is the application's - * responsibility. - */ - -GLOBAL void -jpeg_abort (j_common_ptr cinfo) -{ - int pool; - - /* Releasing pools in reverse order might help avoid fragmentation - * with some (brain-damaged) malloc libraries. - */ - for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { - (*cinfo->mem->free_pool) (cinfo, pool); - } - - /* Reset overall state for possible reuse of object */ - cinfo->global_state = (cinfo->is_decompressor ? DSTATE_START : CSTATE_START); -} - - -/* - * Destruction of a JPEG object. - * - * Everything gets deallocated except the master jpeg_compress_struct itself - * and the error manager struct. Both of these are supplied by the application - * and must be freed, if necessary, by the application. (Often they are on - * the stack and so don't need to be freed anyway.) - * Closing a data source or destination, if necessary, is the application's - * responsibility. - */ - -GLOBAL void -jpeg_destroy (j_common_ptr cinfo) -{ - /* We need only tell the memory manager to release everything. */ - /* NB: mem pointer is NULL if memory mgr failed to initialize. */ - if (cinfo->mem != NULL) - (*cinfo->mem->self_destruct) (cinfo); - cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ - cinfo->global_state = 0; /* mark it destroyed */ -} - - -/* - * Convenience routines for allocating quantization and Huffman tables. - * (Would jutils.c be a more reasonable place to put these?) - */ - -GLOBAL JQUANT_TBL * -jpeg_alloc_quant_table (j_common_ptr cinfo) -{ - JQUANT_TBL *tbl; - - tbl = (JQUANT_TBL *) - (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); - tbl->sent_table = FALSE; /* make sure this is false in any new table */ - return tbl; -} - - -GLOBAL JHUFF_TBL * -jpeg_alloc_huff_table (j_common_ptr cinfo) -{ - JHUFF_TBL *tbl; - - tbl = (JHUFF_TBL *) - (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); - tbl->sent_table = FALSE; /* make sure this is false in any new table */ - return tbl; -} diff --git a/libs/jpeg6/jconfig.h b/libs/jpeg6/jconfig.h deleted file mode 100644 index 7d2f733b..00000000 --- a/libs/jpeg6/jconfig.h +++ /dev/null @@ -1,41 +0,0 @@ -/* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */ -/* see jconfig.doc for explanations */ - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -/* #define void char */ -/* #define const */ -#define CHAR_IS_UNSIGNED -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H -#undef NEED_BSD_STRINGS -#undef NEED_SYS_TYPES_H -#undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */ -#undef NEED_SHORT_EXTERNAL_NAMES -#undef INCOMPLETE_TYPES_BROKEN - -#define JDCT_DEFAULT JDCT_FLOAT -#define JDCT_FASTEST JDCT_FLOAT - -#ifdef JPEG_INTERNALS - -#undef RIGHT_SHIFT_IS_UNSIGNED - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -#undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ - -#undef TWO_FILE_COMMANDLINE /* optional */ -#define USE_SETMODE /* Needed to make one-file style work in Watcom */ -#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ -#undef DONT_USE_B_MODE -#undef PROGRESS_REPORT /* optional */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/libs/jpeg6/jdapimin.cpp b/libs/jpeg6/jdapimin.cpp deleted file mode 100644 index c5c3be32..00000000 --- a/libs/jpeg6/jdapimin.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* - * jdapimin.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the decompression half - * of the JPEG library. These are the "minimum" API routines that may be - * needed in either the normal full-decompression case or the - * transcoding-only case. - * - * Most of the routines intended to be called directly by an application - * are in this file or in jdapistd.c. But also see jcomapi.c for routines - * shared by compression and decompression, and jdtrans.c for the transcoding - * case. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* - * Initialization of a JPEG decompression object. - * The error manager must already be set up (in case memory manager fails). - */ - -GLOBAL void -jpeg_create_decompress (j_decompress_ptr cinfo) -{ - int i; - - /* For debugging purposes, zero the whole master structure. - * But error manager pointer is already there, so save and restore it. - */ - { - struct jpeg_error_mgr * err = cinfo->err; - i = sizeof(struct jpeg_decompress_struct); - i = SIZEOF(struct jpeg_decompress_struct); - MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); - cinfo->err = err; - } - cinfo->is_decompressor = TRUE; - - /* Initialize a memory manager instance for this object */ - jinit_memory_mgr((j_common_ptr) cinfo); - - /* Zero out pointers to permanent structures. */ - cinfo->progress = NULL; - cinfo->src = NULL; - - for (i = 0; i < NUM_QUANT_TBLS; i++) - cinfo->quant_tbl_ptrs[i] = NULL; - - for (i = 0; i < NUM_HUFF_TBLS; i++) { - cinfo->dc_huff_tbl_ptrs[i] = NULL; - cinfo->ac_huff_tbl_ptrs[i] = NULL; - } - - /* Initialize marker processor so application can override methods - * for COM, APPn markers before calling jpeg_read_header. - */ - jinit_marker_reader(cinfo); - - /* And initialize the overall input controller. */ - jinit_input_controller(cinfo); - - /* OK, I'm ready */ - cinfo->global_state = DSTATE_START; -} - - -/* - * Destruction of a JPEG decompression object - */ - -GLOBAL void -jpeg_destroy_decompress (j_decompress_ptr cinfo) -{ - jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Abort processing of a JPEG decompression operation, - * but don't destroy the object itself. - */ - -GLOBAL void -jpeg_abort_decompress (j_decompress_ptr cinfo) -{ - jpeg_abort((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Install a special processing method for COM or APPn markers. - */ - -GLOBAL void -jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine) -{ - if (marker_code == JPEG_COM) - cinfo->marker->process_COM = routine; - else if (marker_code >= JPEG_APP0 && marker_code <= JPEG_APP0+15) - cinfo->marker->process_APPn[marker_code-JPEG_APP0] = routine; - else - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); -} - - -/* - * Set default decompression parameters. - */ - -LOCAL void -default_decompress_parms (j_decompress_ptr cinfo) -{ - /* Guess the input colorspace, and set output colorspace accordingly. */ - /* (Wish JPEG committee had provided a real way to specify this...) */ - /* Note application may override our guesses. */ - switch (cinfo->num_components) { - case 1: - cinfo->jpeg_color_space = JCS_GRAYSCALE; - cinfo->out_color_space = JCS_GRAYSCALE; - break; - - case 3: - if (cinfo->saw_JFIF_marker) { - cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ - } else if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_RGB; - break; - case 1: - cinfo->jpeg_color_space = JCS_YCbCr; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - break; - } - } else { - /* Saw no special markers, try to guess from the component IDs */ - int cid0 = cinfo->comp_info[0].component_id; - int cid1 = cinfo->comp_info[1].component_id; - int cid2 = cinfo->comp_info[2].component_id; - - if (cid0 == 1 && cid1 == 2 && cid2 == 3) - cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ - else if (cid0 == 82 && cid1 == 71 && cid2 == 66) - cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ - else { - TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - } - } - /* Always guess RGB is proper output colorspace. */ - cinfo->out_color_space = JCS_RGB; - break; - - case 4: - if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_CMYK; - break; - case 2: - cinfo->jpeg_color_space = JCS_YCCK; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ - break; - } - } else { - /* No special markers, assume straight CMYK. */ - cinfo->jpeg_color_space = JCS_CMYK; - } - cinfo->out_color_space = JCS_CMYK; - break; - - default: - cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->out_color_space = JCS_UNKNOWN; - break; - } - - /* Set defaults for other decompression parameters. */ - cinfo->scale_num = 1; /* 1:1 scaling */ - cinfo->scale_denom = 1; - cinfo->output_gamma = 1.0; - cinfo->buffered_image = FALSE; - cinfo->raw_data_out = FALSE; - cinfo->dct_method = JDCT_DEFAULT; - cinfo->do_fancy_upsampling = TRUE; - cinfo->do_block_smoothing = TRUE; - cinfo->quantize_colors = FALSE; - /* We set these in case application only sets quantize_colors. */ - cinfo->dither_mode = JDITHER_FS; -#ifdef QUANT_2PASS_SUPPORTED - cinfo->two_pass_quantize = TRUE; -#else - cinfo->two_pass_quantize = FALSE; -#endif - cinfo->desired_number_of_colors = 256; - cinfo->colormap = NULL; - /* Initialize for no mode change in buffered-image mode. */ - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; -} - - -/* - * Decompression startup: read start of JPEG datastream to see what's there. - * Need only initialize JPEG object and supply a data source before calling. - * - * This routine will read as far as the first SOS marker (ie, actual start of - * compressed data), and will save all tables and parameters in the JPEG - * object. It will also initialize the decompression parameters to default - * values, and finally return JPEG_HEADER_OK. On return, the application may - * adjust the decompression parameters and then call jpeg_start_decompress. - * (Or, if the application only wanted to determine the image parameters, - * the data need not be decompressed. In that case, call jpeg_abort or - * jpeg_destroy to release any temporary space.) - * If an abbreviated (tables only) datastream is presented, the routine will - * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then - * re-use the JPEG object to read the abbreviated image datastream(s). - * It is unnecessary (but OK) to call jpeg_abort in this case. - * The JPEG_SUSPENDED return code only occurs if the data source module - * requests suspension of the decompressor. In this case the application - * should load more source data and then re-call jpeg_read_header to resume - * processing. - * If a non-suspending data source is used and require_image is TRUE, then the - * return code need not be inspected since only JPEG_HEADER_OK is possible. - * - * This routine is now just a front end to jpeg_consume_input, with some - * extra error checking. - */ - -GLOBAL int -jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) -{ - int retcode; - - if (cinfo->global_state != DSTATE_START && - cinfo->global_state != DSTATE_INHEADER) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - retcode = jpeg_consume_input(cinfo); - - switch (retcode) { - case JPEG_REACHED_SOS: - retcode = JPEG_HEADER_OK; - break; - case JPEG_REACHED_EOI: - if (require_image) /* Complain if application wanted an image */ - ERREXIT(cinfo, JERR_NO_IMAGE); - /* Reset to start state; it would be safer to require the application to - * call jpeg_abort, but we can't change it now for compatibility reasons. - * A side effect is to free any temporary memory (there shouldn't be any). - */ - jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ - retcode = JPEG_HEADER_TABLES_ONLY; - break; - case JPEG_SUSPENDED: - /* no work */ - break; - } - - return retcode; -} - - -/* - * Consume data in advance of what the decompressor requires. - * This can be called at any time once the decompressor object has - * been created and a data source has been set up. - * - * This routine is essentially a state machine that handles a couple - * of critical state-transition actions, namely initial setup and - * transition from header scanning to ready-for-start_decompress. - * All the actual input is done via the input controller's consume_input - * method. - */ - -GLOBAL int -jpeg_consume_input (j_decompress_ptr cinfo) -{ - int retcode = JPEG_SUSPENDED; - - /* NB: every possible DSTATE value should be listed in this switch */ - switch (cinfo->global_state) { - case DSTATE_START: - /* Start-of-datastream actions: reset appropriate modules */ - (*cinfo->inputctl->reset_input_controller) (cinfo); - /* Initialize application's data source module */ - (*cinfo->src->init_source) (cinfo); - cinfo->global_state = DSTATE_INHEADER; - /*FALLTHROUGH*/ - case DSTATE_INHEADER: - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ - /* Set up default parameters based on header data */ - default_decompress_parms(cinfo); - /* Set global state: ready for start_decompress */ - cinfo->global_state = DSTATE_READY; - } - break; - case DSTATE_READY: - /* Can't advance past first SOS until start_decompress is called */ - retcode = JPEG_REACHED_SOS; - break; - case DSTATE_PRELOAD: - case DSTATE_PRESCAN: - case DSTATE_SCANNING: - case DSTATE_RAW_OK: - case DSTATE_BUFIMAGE: - case DSTATE_BUFPOST: - case DSTATE_STOPPING: - retcode = (*cinfo->inputctl->consume_input) (cinfo); - break; - default: - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - return retcode; -} - - -/* - * Have we finished reading the input file? - */ - -GLOBAL boolean -jpeg_input_complete (j_decompress_ptr cinfo) -{ - /* Check for valid jpeg object */ - if (cinfo->global_state < DSTATE_START || - cinfo->global_state > DSTATE_STOPPING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - return cinfo->inputctl->eoi_reached; -} - - -/* - * Is there more than one scan? - */ - -GLOBAL boolean -jpeg_has_multiple_scans (j_decompress_ptr cinfo) -{ - /* Only valid after jpeg_read_header completes */ - if (cinfo->global_state < DSTATE_READY || - cinfo->global_state > DSTATE_STOPPING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - return cinfo->inputctl->has_multiple_scans; -} - - -/* - * Finish JPEG decompression. - * - * This will normally just verify the file trailer and release temp storage. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL boolean -jpeg_finish_decompress (j_decompress_ptr cinfo) -{ - if ((cinfo->global_state == DSTATE_SCANNING || - cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { - /* Terminate final pass of non-buffered mode */ - if (cinfo->output_scanline < cinfo->output_height) - ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); - (*cinfo->master->finish_output_pass) (cinfo); - cinfo->global_state = DSTATE_STOPPING; - } else if (cinfo->global_state == DSTATE_BUFIMAGE) { - /* Finishing after a buffered-image operation */ - cinfo->global_state = DSTATE_STOPPING; - } else if (cinfo->global_state != DSTATE_STOPPING) { - /* STOPPING = repeat call after a suspension, anything else is error */ - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - /* Read until EOI */ - while (! cinfo->inputctl->eoi_reached) { - if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ - } - /* Do final cleanup */ - (*cinfo->src->term_source) (cinfo); - /* We can use jpeg_abort to release memory and reset global_state */ - jpeg_abort((j_common_ptr) cinfo); - return TRUE; -} diff --git a/libs/jpeg6/jdapistd.cpp b/libs/jpeg6/jdapistd.cpp deleted file mode 100644 index 22da01b3..00000000 --- a/libs/jpeg6/jdapistd.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* - * jdapistd.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the decompression half - * of the JPEG library. These are the "standard" API routines that are - * used in the normal full-decompression case. They are not used by a - * transcoding-only application. Note that if an application links in - * jpeg_start_decompress, it will end up linking in the entire decompressor. - * We thus must separate this file from jdapimin.c to avoid linking the - * whole decompression library into a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Forward declarations */ -LOCAL boolean output_pass_setup JPP((j_decompress_ptr cinfo)); - - -/* - * Decompression initialization. - * jpeg_read_header must be completed before calling this. - * - * If a multipass operating mode was selected, this will do all but the - * last pass, and thus may take a great deal of time. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL boolean -jpeg_start_decompress (j_decompress_ptr cinfo) -{ - if (cinfo->global_state == DSTATE_READY) { - /* First call: initialize master control, select active modules */ - jinit_master_decompress(cinfo); - if (cinfo->buffered_image) { - /* No more work here; expecting jpeg_start_output next */ - cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; - } - cinfo->global_state = DSTATE_PRELOAD; - } - if (cinfo->global_state == DSTATE_PRELOAD) { - /* If file has multiple scans, absorb them all into the coef buffer */ - if (cinfo->inputctl->has_multiple_scans) { -#ifdef D_MULTISCAN_FILES_SUPPORTED - for (;;) { - int retcode; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - /* Absorb some more input */ - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_SUSPENDED) - return FALSE; - if (retcode == JPEG_REACHED_EOI) - break; - /* Advance progress counter if appropriate */ - if (cinfo->progress != NULL && - (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { - if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { - /* jdmaster underestimated number of scans; ratchet up one scan */ - cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; - } - } - } -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - } - cinfo->output_scan_number = cinfo->input_scan_number; - } else if (cinfo->global_state != DSTATE_PRESCAN) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Perform any dummy output passes, and set up for the final pass */ - return output_pass_setup(cinfo); -} - - -/* - * Set up for an output pass, and perform any dummy pass(es) needed. - * Common subroutine for jpeg_start_decompress and jpeg_start_output. - * Entry: global_state = DSTATE_PRESCAN only if previously suspended. - * Exit: If done, returns TRUE and sets global_state for proper output mode. - * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. - */ - -LOCAL boolean -output_pass_setup (j_decompress_ptr cinfo) -{ - if (cinfo->global_state != DSTATE_PRESCAN) { - /* First call: do pass setup */ - (*cinfo->master->prepare_for_output_pass) (cinfo); - cinfo->output_scanline = 0; - cinfo->global_state = DSTATE_PRESCAN; - } - /* Loop over any required dummy passes */ - while (cinfo->master->is_dummy_pass) { -#ifdef QUANT_2PASS_SUPPORTED - /* Crank through the dummy pass */ - while (cinfo->output_scanline < cinfo->output_height) { - JDIMENSION last_scanline; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - /* Process some data */ - last_scanline = cinfo->output_scanline; - (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, - &cinfo->output_scanline, (JDIMENSION) 0); - if (cinfo->output_scanline == last_scanline) - return FALSE; /* No progress made, must suspend */ - } - /* Finish up dummy pass, and set up for another one */ - (*cinfo->master->finish_output_pass) (cinfo); - (*cinfo->master->prepare_for_output_pass) (cinfo); - cinfo->output_scanline = 0; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* QUANT_2PASS_SUPPORTED */ - } - /* Ready for application to drive output pass through - * jpeg_read_scanlines or jpeg_read_raw_data. - */ - cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; - return TRUE; -} - - -/* - * Read some scanlines of data from the JPEG decompressor. - * - * The return value will be the number of lines actually read. - * This may be less than the number requested in several cases, - * including bottom of image, data source suspension, and operating - * modes that emit multiple scanlines at a time. - * - * Note: we warn about excess calls to jpeg_read_scanlines() since - * this likely signals an application programmer error. However, - * an oversize buffer (max_lines > scanlines remaining) is not an error. - */ - -GLOBAL JDIMENSION -jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, - JDIMENSION max_lines) -{ - JDIMENSION row_ctr; - - if (cinfo->global_state != DSTATE_SCANNING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->output_scanline >= cinfo->output_height) { - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - return 0; - } - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Process some data */ - row_ctr = 0; - (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); - cinfo->output_scanline += row_ctr; - return row_ctr; -} - - -/* - * Alternate entry point to read raw data. - * Processes exactly one iMCU row per call, unless suspended. - */ - -GLOBAL JDIMENSION -jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, - JDIMENSION max_lines) -{ - JDIMENSION lines_per_iMCU_row; - - if (cinfo->global_state != DSTATE_RAW_OK) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->output_scanline >= cinfo->output_height) { - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - return 0; - } - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Verify that at least one iMCU row can be returned. */ - lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size; - if (max_lines < lines_per_iMCU_row) - ERREXIT(cinfo, JERR_BUFFER_SIZE); - - /* Decompress directly into user's buffer. */ - if (! (*cinfo->coef->decompress_data) (cinfo, data)) - return 0; /* suspension forced, can do nothing more */ - - /* OK, we processed one iMCU row. */ - cinfo->output_scanline += lines_per_iMCU_row; - return lines_per_iMCU_row; -} - - -/* Additional entry points for buffered-image mode. */ - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Initialize for an output pass in buffered-image mode. - */ - -GLOBAL boolean -jpeg_start_output (j_decompress_ptr cinfo, int scan_number) -{ - if (cinfo->global_state != DSTATE_BUFIMAGE && - cinfo->global_state != DSTATE_PRESCAN) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Limit scan number to valid range */ - if (scan_number <= 0) - scan_number = 1; - if (cinfo->inputctl->eoi_reached && - scan_number > cinfo->input_scan_number) - scan_number = cinfo->input_scan_number; - cinfo->output_scan_number = scan_number; - /* Perform any dummy output passes, and set up for the real pass */ - return output_pass_setup(cinfo); -} - - -/* - * Finish up after an output pass in buffered-image mode. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL boolean -jpeg_finish_output (j_decompress_ptr cinfo) -{ - if ((cinfo->global_state == DSTATE_SCANNING || - cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { - /* Terminate this pass. */ - /* We do not require the whole pass to have been completed. */ - (*cinfo->master->finish_output_pass) (cinfo); - cinfo->global_state = DSTATE_BUFPOST; - } else if (cinfo->global_state != DSTATE_BUFPOST) { - /* BUFPOST = repeat call after a suspension, anything else is error */ - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - /* Read markers looking for SOS or EOI */ - while (cinfo->input_scan_number <= cinfo->output_scan_number && - ! cinfo->inputctl->eoi_reached) { - if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ - } - cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/libs/jpeg6/jdatasrc.cpp b/libs/jpeg6/jdatasrc.cpp deleted file mode 100644 index 9bb30dbe..00000000 --- a/libs/jpeg6/jdatasrc.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * jdatasrc.c - * - * Copyright (C) 1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains decompression data source routines for the case of - * reading JPEG data from a file (or any stdio stream). While these routines - * are sufficient for most applications, some will want to use a different - * source manager. - * IMPORTANT: we assume that fread() will correctly transcribe an array of - * JOCTETs from 8-bit-wide elements on external storage. If char is wider - * than 8 bits on your machine, you may need to do some tweaking. - */ - -/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jerror.h" -//extern int leo_buf_size; // FIXME ? merged in from Alpha - replaced by my_source_mgr->src_size -/* Expanded data source object for stdio input */ -typedef struct { - struct jpeg_source_mgr pub; /* public fields */ - int src_size; // FIXME ? merged from Alpha - unsigned char *infile; /* source stream */ - JOCTET * buffer; /* start of buffer */ - boolean start_of_file; /* have we gotten any data yet? */ -} my_source_mgr; -typedef my_source_mgr * my_src_ptr; -#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ - -/* - * Initialize source --- called by jpeg_read_header - * before any data is actually read. - */ -METHODDEF void -init_source (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - /* We reset the empty-input-file flag for each image, - * but we don't clear the input buffer. - * This is correct behavior for reading a series of images from one source. - */ - src->start_of_file = TRUE; -} - -/* - * Fill the input buffer --- called whenever buffer is emptied. - * - * In typical applications, this should read fresh data into the buffer - * (ignoring the current state of next_input_byte & bytes_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been reloaded. It is not necessary to - * fill the buffer entirely, only to obtain at least one more byte. - * - * There is no such thing as an EOF return. If the end of the file has been - * reached, the routine has a choice of ERREXIT() or inserting fake data into - * the buffer. In most cases, generating a warning message and inserting a - * fake EOI marker is the best course of action --- this will allow the - * decompressor to output however much of the image is there. However, - * the resulting error message is misleading if the real problem is an empty - * input file, so we handle that case specially. - * - * In applications that need to be able to suspend compression due to input - * not being available yet, a FALSE return indicates that no more data can be - * obtained right now, but more may be forthcoming later. In this situation, - * the decompressor will return to its caller (with an indication of the - * number of scanlines it has read, if any). The application should resume - * decompression after it has loaded more data into the input buffer. Note - * that there are substantial restrictions on the use of suspension --- see - * the documentation. - * - * When suspending, the decompressor will back up to a convenient restart point - * (typically the start of the current MCU). next_input_byte & bytes_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point must be rescanned after resumption, so move it to - * the front of the buffer rather than discarding it. - */ -METHODDEF boolean -// FIXME ? merged in from Alpha -fill_input_buffer (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - size_t nbytes; - - if (src->src_size > INPUT_BUF_SIZE) - nbytes = INPUT_BUF_SIZE; - else - nbytes = src->src_size; - memcpy (src->buffer, src->infile, nbytes); - src->infile += nbytes; - src->src_size -= nbytes; - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; - return TRUE; -} - -/* - * Skip data --- used to skip over a potentially large amount of - * uninteresting data (such as an APPn marker). - * - * Writers of suspendable-input applications must note that skip_input_data - * is not granted the right to give a suspension return. If the skip extends - * beyond the data currently in the buffer, the buffer can be marked empty so - * that the next read will cause a fill_input_buffer call that can suspend. - * Arranging for additional bytes to be discarded before reloading the input - * buffer is the application writer's problem. - */ -METHODDEF void -skip_input_data (j_decompress_ptr cinfo, long num_bytes) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - /* Just a dumb implementation for now. Could use fseek() except - * it doesn't work on pipes. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. - */ - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - (void) fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, - * so suspension need not be handled. - */ - } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - -/* - * An additional method that can be provided by data source modules is the - * resync_to_restart method for error recovery in the presence of RST markers. - * For the moment, this source module just uses the default resync method - * provided by the JPEG library. That method assumes that no backtracking - * is possible. - */ - -/* - * Terminate source --- called by jpeg_finish_decompress - * after all data has been read. Often a no-op. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ -METHODDEF void -term_source (j_decompress_ptr cinfo) -{ - /* no work necessary here */ -} - -/* - * Prepare for input from a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing decompression. - */ -GLOBAL void -jpeg_stdio_src (j_decompress_ptr cinfo, unsigned char *infile, int bufsize) -{ - my_src_ptr src; - /* The source object and input buffer are made permanent so that a series - * of JPEG images can be read from the same file by calling jpeg_stdio_src - * only before the first one. (If we discarded the buffer at the end of - * one image, we'd likely lose the start of the next one.) - * This makes it unsafe to use this manager and a different source - * manager serially with the same JPEG object. Caveat programmer. - */ - if (cinfo->src == NULL) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_source_mgr)); - src = (my_src_ptr) cinfo->src; - src->buffer = (JOCTET *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - INPUT_BUF_SIZE * SIZEOF(JOCTET)); - } - src = (my_src_ptr) cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = term_source; - src->infile = infile; - src->src_size = bufsize; // FIXME ? merged from Alpha - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->pub.next_input_byte = NULL; /* until buffer loaded */ -} diff --git a/libs/jpeg6/jdcoefct.cpp b/libs/jpeg6/jdcoefct.cpp deleted file mode 100644 index 4b371313..00000000 --- a/libs/jpeg6/jdcoefct.cpp +++ /dev/null @@ -1,725 +0,0 @@ -/* - * jdcoefct.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the coefficient buffer controller for decompression. - * This controller is the top level of the JPEG decompressor proper. - * The coefficient buffer lies between entropy decoding and inverse-DCT steps. - * - * In buffered-image mode, this controller is the interface between - * input-oriented processing and output-oriented processing. - * Also, the input side (only) is used when reading a file for transcoding. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - -/* Block smoothing is only applicable for progressive JPEG, so: */ -#ifndef D_PROGRESSIVE_SUPPORTED -#undef BLOCK_SMOOTHING_SUPPORTED -#endif - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_coef_controller pub; /* public fields */ - - /* These variables keep track of the current location of the input side. */ - /* cinfo->input_iMCU_row is also used for this. */ - JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ - - /* The output side's location is represented by cinfo->output_iMCU_row. */ - - /* In single-pass modes, it's sufficient to buffer just one MCU. - * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, - * and let the entropy decoder write into that workspace each time. - * (On 80x86, the workspace is FAR even though it's not really very big; - * this is to keep the module interfaces unchanged when a large coefficient - * buffer is necessary.) - * In multi-pass modes, this array points to the current MCU's blocks - * within the virtual arrays; it is used only by the input side. - */ - JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; - -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* In multi-pass modes, we need a virtual block array for each component. */ - jvirt_barray_ptr whole_image[MAX_COMPONENTS]; -#endif - -#ifdef BLOCK_SMOOTHING_SUPPORTED - /* When doing block smoothing, we latch coefficient Al values here */ - int * coef_bits_latch; -#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ -#endif -} my_coef_controller; - -typedef my_coef_controller * my_coef_ptr; - -/* Forward declarations */ -METHODDEF int decompress_onepass - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#ifdef D_MULTISCAN_FILES_SUPPORTED -METHODDEF int decompress_data - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#endif -#ifdef BLOCK_SMOOTHING_SUPPORTED -LOCAL boolean smoothing_ok JPP((j_decompress_ptr cinfo)); -METHODDEF int decompress_smooth_data - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#endif - - -LOCAL void -start_iMCU_row (j_decompress_ptr cinfo) -/* Reset within-iMCU-row counters for a new row (input side) */ -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* In an interleaved scan, an MCU row is the same as an iMCU row. - * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. - * But at the bottom of the image, process only what's left. - */ - if (cinfo->comps_in_scan > 1) { - coef->MCU_rows_per_iMCU_row = 1; - } else { - if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; - else - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; - } - - coef->MCU_ctr = 0; - coef->MCU_vert_offset = 0; -} - - -/* - * Initialize for an input processing pass. - */ - -METHODDEF void -start_input_pass (j_decompress_ptr cinfo) -{ - cinfo->input_iMCU_row = 0; - start_iMCU_row(cinfo); -} - - -/* - * Initialize for an output processing pass. - */ - -METHODDEF void -start_output_pass (j_decompress_ptr cinfo) -{ -#ifdef BLOCK_SMOOTHING_SUPPORTED - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* If multipass, check to see whether to use block smoothing on this pass */ - if (coef->pub.coef_arrays != NULL) { - if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) - coef->pub.decompress_data = decompress_smooth_data; - else - coef->pub.decompress_data = decompress_data; - } -#endif - cinfo->output_iMCU_row = 0; -} - - -/* - * Decompress and return some data in the single-pass case. - * Always attempts to emit one fully interleaved MCU row ("iMCU" row). - * Input and output must run in lockstep since we have only a one-MCU buffer. - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - * - * NB: output_buf contains a plane for each component in image. - * For single pass, this is the same as the components in the scan. - */ - -METHODDEF int -decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - int blkn, ci, xindex, yindex, yoffset, useful_width; - JSAMPARRAY output_ptr; - JDIMENSION start_col, output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - - /* Loop to process as much as one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; - MCU_col_num++) { - /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ - jzero_far((void FAR *) coef->MCU_buffer[0], - (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK))); - if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->MCU_ctr = MCU_col_num; - return JPEG_SUSPENDED; - } - /* Determine where data should go in output_buf and do the IDCT thing. - * We skip dummy blocks at the right and bottom edges (but blkn gets - * incremented past them!). Note the inner loop relies on having - * allocated the MCU_buffer[] blocks sequentially. - */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) { - blkn += compptr->MCU_blocks; - continue; - } - inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index]; - useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; - output_ptr = output_buf[ci] + yoffset * compptr->DCT_scaled_size; - start_col = MCU_col_num * compptr->MCU_sample_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (cinfo->input_iMCU_row < last_iMCU_row || - yoffset+yindex < compptr->last_row_height) { - output_col = start_col; - for (xindex = 0; xindex < useful_width; xindex++) { - (*inverse_DCT) (cinfo, compptr, - (JCOEFPTR) coef->MCU_buffer[blkn+xindex], - output_ptr, output_col); - output_col += compptr->DCT_scaled_size; - } - } - blkn += compptr->MCU_width; - output_ptr += compptr->DCT_scaled_size; - } - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->MCU_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - cinfo->output_iMCU_row++; - if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { - start_iMCU_row(cinfo); - return JPEG_ROW_COMPLETED; - } - /* Completed the scan */ - (*cinfo->inputctl->finish_input_pass) (cinfo); - return JPEG_SCAN_COMPLETED; -} - - -/* - * Dummy consume-input routine for single-pass operation. - */ - -METHODDEF int -dummy_consume_data (j_decompress_ptr cinfo) -{ - return JPEG_SUSPENDED; /* Always indicate nothing was done */ -} - - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Consume input data and store it in the full-image coefficient buffer. - * We read as much as one fully interleaved MCU row ("iMCU" row) per call, - * ie, v_samp_factor block rows for each component in the scan. - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - */ - -METHODDEF int -consume_data (j_decompress_ptr cinfo) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - int blkn, ci, xindex, yindex, yoffset; - JDIMENSION start_col; - JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; - JBLOCKROW buffer_ptr; - jpeg_component_info *compptr; - - /* Align the virtual buffers for the components used in this scan. */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - buffer[ci] = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], - cinfo->input_iMCU_row * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, TRUE); - /* Note: entropy decoder expects buffer to be zeroed, - * but this is handled automatically by the memory manager - * because we requested a pre-zeroed array. - */ - } - - /* Loop to process one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; - MCU_col_num++) { - /* Construct list of pointers to DCT blocks belonging to this MCU */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - start_col = MCU_col_num * compptr->MCU_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - buffer_ptr = buffer[ci][yindex+yoffset] + start_col; - for (xindex = 0; xindex < compptr->MCU_width; xindex++) { - coef->MCU_buffer[blkn++] = buffer_ptr++; - } - } - } - /* Try to fetch the MCU. */ - if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->MCU_ctr = MCU_col_num; - return JPEG_SUSPENDED; - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->MCU_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { - start_iMCU_row(cinfo); - return JPEG_ROW_COMPLETED; - } - /* Completed the scan */ - (*cinfo->inputctl->finish_input_pass) (cinfo); - return JPEG_SCAN_COMPLETED; -} - - -/* - * Decompress and return some data in the multi-pass case. - * Always attempts to emit one fully interleaved MCU row ("iMCU" row). - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - * - * NB: output_buf contains a plane for each component in image. - */ - -METHODDEF int -decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - JDIMENSION block_num; - int ci, block_row, block_rows; - JBLOCKARRAY buffer; - JBLOCKROW buffer_ptr; - JSAMPARRAY output_ptr; - JDIMENSION output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - - /* Force some input to be done if we are getting ahead of the input. */ - while (cinfo->input_scan_number < cinfo->output_scan_number || - (cinfo->input_scan_number == cinfo->output_scan_number && - cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { - if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) - return JPEG_SUSPENDED; - } - - /* OK, output from the virtual arrays. */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) - continue; - /* Align the virtual buffer for this component. */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - cinfo->output_iMCU_row * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, FALSE); - /* Count non-dummy DCT block rows in this iMCU row. */ - if (cinfo->output_iMCU_row < last_iMCU_row) - block_rows = compptr->v_samp_factor; - else { - /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; - } - inverse_DCT = cinfo->idct->inverse_DCT[ci]; - output_ptr = output_buf[ci]; - /* Loop over all DCT blocks to be processed. */ - for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; - output_col = 0; - for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) { - (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, - output_ptr, output_col); - buffer_ptr++; - output_col += compptr->DCT_scaled_size; - } - output_ptr += compptr->DCT_scaled_size; - } - } - - if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) - return JPEG_ROW_COMPLETED; - return JPEG_SCAN_COMPLETED; -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - - -#ifdef BLOCK_SMOOTHING_SUPPORTED - -/* - * This code applies interblock smoothing as described by section K.8 - * of the JPEG standard: the first 5 AC coefficients are estimated from - * the DC values of a DCT block and its 8 neighboring blocks. - * We apply smoothing only for progressive JPEG decoding, and only if - * the coefficients it can estimate are not yet known to full precision. - */ - -/* - * Determine whether block smoothing is applicable and safe. - * We also latch the current states of the coef_bits[] entries for the - * AC coefficients; otherwise, if the input side of the decompressor - * advances into a new scan, we might think the coefficients are known - * more accurately than they really are. - */ - -LOCAL boolean -smoothing_ok (j_decompress_ptr cinfo) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - boolean smoothing_useful = FALSE; - int ci, coefi; - jpeg_component_info *compptr; - JQUANT_TBL * qtable; - int * coef_bits; - int * coef_bits_latch; - - if (! cinfo->progressive_mode || cinfo->coef_bits == NULL) - return FALSE; - - /* Allocate latch area if not already done */ - if (coef->coef_bits_latch == NULL) - coef->coef_bits_latch = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * - (SAVED_COEFS * SIZEOF(int))); - coef_bits_latch = coef->coef_bits_latch; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* All components' quantization values must already be latched. */ - if ((qtable = compptr->quant_table) == NULL) - return FALSE; - /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ - for (coefi = 0; coefi <= 5; coefi++) { - if (qtable->quantval[coefi] == 0) - return FALSE; - } - /* DC values must be at least partly known for all components. */ - coef_bits = cinfo->coef_bits[ci]; - if (coef_bits[0] < 0) - return FALSE; - /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ - for (coefi = 1; coefi <= 5; coefi++) { - coef_bits_latch[coefi] = coef_bits[coefi]; - if (coef_bits[coefi] != 0) - smoothing_useful = TRUE; - } - coef_bits_latch += SAVED_COEFS; - } - - return smoothing_useful; -} - - -/* - * Variant of decompress_data for use when doing block smoothing. - */ - -METHODDEF int -decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - JDIMENSION block_num, last_block_column; - int ci, block_row, block_rows, access_rows; - JBLOCKARRAY buffer; - JBLOCKROW buffer_ptr, prev_block_row, next_block_row; - JSAMPARRAY output_ptr; - JDIMENSION output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - boolean first_row, last_row; - JBLOCK workspace; - int *coef_bits; - JQUANT_TBL *quanttbl; - INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; - int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; - int Al, pred; - - /* Force some input to be done if we are getting ahead of the input. */ - while (cinfo->input_scan_number <= cinfo->output_scan_number && - ! cinfo->inputctl->eoi_reached) { - if (cinfo->input_scan_number == cinfo->output_scan_number) { - /* If input is working on current scan, we ordinarily want it to - * have completed the current row. But if input scan is DC, - * we want it to keep one row ahead so that next block row's DC - * values are up to date. - */ - JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; - if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) - break; - } - if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) - return JPEG_SUSPENDED; - } - - /* OK, output from the virtual arrays. */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) - continue; - /* Count non-dummy DCT block rows in this iMCU row. */ - if (cinfo->output_iMCU_row < last_iMCU_row) { - block_rows = compptr->v_samp_factor; - access_rows = block_rows * 2; /* this and next iMCU row */ - last_row = FALSE; - } else { - /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; - access_rows = block_rows; /* this iMCU row only */ - last_row = TRUE; - } - /* Align the virtual buffer for this component. */ - if (cinfo->output_iMCU_row > 0) { - access_rows += compptr->v_samp_factor; /* prior iMCU row too */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor, - (JDIMENSION) access_rows, FALSE); - buffer += compptr->v_samp_factor; /* point to current iMCU row */ - first_row = FALSE; - } else { - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); - first_row = TRUE; - } - /* Fetch component-dependent info */ - coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); - quanttbl = compptr->quant_table; - Q00 = quanttbl->quantval[0]; - Q01 = quanttbl->quantval[1]; - Q10 = quanttbl->quantval[2]; - Q20 = quanttbl->quantval[3]; - Q11 = quanttbl->quantval[4]; - Q02 = quanttbl->quantval[5]; - inverse_DCT = cinfo->idct->inverse_DCT[ci]; - output_ptr = output_buf[ci]; - /* Loop over all DCT blocks to be processed. */ - for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; - if (first_row && block_row == 0) - prev_block_row = buffer_ptr; - else - prev_block_row = buffer[block_row-1]; - if (last_row && block_row == block_rows-1) - next_block_row = buffer_ptr; - else - next_block_row = buffer[block_row+1]; - /* We fetch the surrounding DC values using a sliding-register approach. - * Initialize all nine here so as to do the right thing on narrow pics. - */ - DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; - DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; - DC7 = DC8 = DC9 = (int) next_block_row[0][0]; - output_col = 0; - last_block_column = compptr->width_in_blocks - 1; - for (block_num = 0; block_num <= last_block_column; block_num++) { - /* Fetch current DCT block into workspace so we can modify it. */ - jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); - /* Update DC values */ - if (block_num < last_block_column) { - DC3 = (int) prev_block_row[1][0]; - DC6 = (int) buffer_ptr[1][0]; - DC9 = (int) next_block_row[1][0]; - } - /* Compute coefficient estimates per K.8. - * An estimate is applied only if coefficient is still zero, - * and is not known to be fully accurate. - */ - /* AC01 */ - if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { - num = 36 * Q00 * (DC4 - DC6); - if (num >= 0) { - pred = (int) (((Q01<<7) + num) / (Q01<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q10<<7) + num) / (Q10<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q20<<7) + num) / (Q20<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q11<<7) + num) / (Q11<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q02<<7) + num) / (Q02<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<DCT_scaled_size; - } - output_ptr += compptr->DCT_scaled_size; - } - } - - if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) - return JPEG_ROW_COMPLETED; - return JPEG_SCAN_COMPLETED; -} - -#endif /* BLOCK_SMOOTHING_SUPPORTED */ - - -/* - * Initialize coefficient buffer controller. - */ - -GLOBAL void -jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) -{ - my_coef_ptr coef; - - coef = (my_coef_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_d_coef_controller *) coef; - coef->pub.start_input_pass = start_input_pass; - coef->pub.start_output_pass = start_output_pass; -#ifdef BLOCK_SMOOTHING_SUPPORTED - coef->coef_bits_latch = NULL; -#endif - - /* Create the coefficient buffer. */ - if (need_full_buffer) { -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* Allocate a full-image virtual array for each component, */ - /* padded to a multiple of samp_factor DCT blocks in each direction. */ - /* Note we ask for a pre-zeroed array. */ - int ci, access_rows; - jpeg_component_info *compptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - access_rows = compptr->v_samp_factor; -#ifdef BLOCK_SMOOTHING_SUPPORTED - /* If block smoothing could be used, need a bigger window */ - if (cinfo->progressive_mode) - access_rows *= 3; -#endif - coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, - (JDIMENSION) jround_up((long) compptr->width_in_blocks, - (long) compptr->h_samp_factor), - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor), - (JDIMENSION) access_rows); - } - coef->pub.consume_data = consume_data; - coef->pub.decompress_data = decompress_data; - coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */ -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - /* We only need a single-MCU buffer. */ - JBLOCKROW buffer; - int i; - - buffer = (JBLOCKROW) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) { - coef->MCU_buffer[i] = buffer + i; - } - coef->pub.consume_data = dummy_consume_data; - coef->pub.decompress_data = decompress_onepass; - coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */ - } -} diff --git a/libs/jpeg6/jdcolor.cpp b/libs/jpeg6/jdcolor.cpp deleted file mode 100644 index 50e66f26..00000000 --- a/libs/jpeg6/jdcolor.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - * jdcolor.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains output colorspace conversion routines. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Private subobject */ - -typedef struct { - struct jpeg_color_deconverter pub; /* public fields */ - - /* Private state for YCC->RGB conversion */ - int * Cr_r_tab; /* => table for Cr to R conversion */ - int * Cb_b_tab; /* => table for Cb to B conversion */ - INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - INT32 * Cb_g_tab; /* => table for Cb to G conversion */ -} my_color_deconverter; - -typedef my_color_deconverter * my_cconvert_ptr; - - -/**************** YCbCr -> RGB conversion: most common case **************/ - -/* - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore - * R = Y + 1.40200 * Cr - * G = Y - 0.34414 * Cb - 0.71414 * Cr - * B = Y + 1.77200 * Cb - * where Cb and Cr represent the incoming values less CENTERJSAMPLE. - * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) - * - * To avoid floating-point arithmetic, we represent the fractional constants - * as integers scaled up by 2^16 (about 4 digits precision); we have to divide - * the products by 2^16, with appropriate rounding, to get the correct answer. - * Notice that Y, being an integral input, does not contribute any fraction - * so it need not participate in the rounding. - * - * For even more speed, we avoid doing any multiplications in the inner loop - * by precalculating the constants times Cb and Cr for all possible values. - * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); - * for 12-bit samples it is still acceptable. It's not very reasonable for - * 16-bit samples, but if you want lossless storage you shouldn't be changing - * colorspace anyway. - * The Cr=>R and Cb=>B values can be rounded to integers in advance; the - * values for the G calculation are left scaled up, since we must add them - * together before rounding. - */ - -#define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((INT32) ((x) * (1L<RGB colorspace conversion. - */ - -LOCAL void -build_ycc_rgb_table (j_decompress_ptr cinfo) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - int i; - INT32 x; - SHIFT_TEMPS - - cconvert->Cr_r_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - cconvert->Cb_b_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - cconvert->Cr_g_tab = (INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(INT32)); - cconvert->Cb_g_tab = (INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(INT32)); - - for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { - /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ - /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ - /* Cr=>R value is nearest int to 1.40200 * x */ - cconvert->Cr_r_tab[i] = (int) - RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); - /* Cb=>B value is nearest int to 1.77200 * x */ - cconvert->Cb_b_tab[i] = (int) - RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); - /* Cr=>G value is scaled-up -0.71414 * x */ - cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; - /* Cb=>G value is scaled-up -0.34414 * x */ - /* We also add in ONE_HALF so that need not do it in inner loop */ - cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; - } -} - - -/* - * Convert some rows of samples to the output colorspace. - * - * Note that we change from noninterleaved, one-plane-per-component format - * to interleaved-pixel format. The output buffer is therefore three times - * as wide as the input buffer. - * A starting row offset is provided only for the input buffer. The caller - * can easily adjust the passed output_buf value to accommodate any row - * offset required on that side. - */ - -METHODDEF void -ycc_rgb_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int y, cb, cr; - register JSAMPROW outptr; - register JSAMPROW inptr0, inptr1, inptr2; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->output_width; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - register int * Crrtab = cconvert->Cr_r_tab; - register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; - SHIFT_TEMPS - - while (--num_rows >= 0) { - inptr0 = input_buf[0][input_row]; - inptr1 = input_buf[1][input_row]; - inptr2 = input_buf[2][input_row]; - input_row++; - outptr = *output_buf++; - for (col = 0; col < num_cols; col++) { - y = GETJSAMPLE(inptr0[col]); - cb = GETJSAMPLE(inptr1[col]); - cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ - outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; - outptr[RGB_GREEN] = range_limit[y + - ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], - SCALEBITS))]; - outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; - outptr += RGB_PIXELSIZE; - } - } -} - - -/**************** Cases other than YCbCr -> RGB **************/ - - -/* - * Color conversion for no colorspace change: just copy the data, - * converting from separate-planes to interleaved representation. - */ - -METHODDEF void -null_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - register JSAMPROW inptr, outptr; - register JDIMENSION count; - register int num_components = cinfo->num_components; - JDIMENSION num_cols = cinfo->output_width; - int ci; - - while (--num_rows >= 0) { - for (ci = 0; ci < num_components; ci++) { - inptr = input_buf[ci][input_row]; - outptr = output_buf[0] + ci; - for (count = num_cols; count > 0; count--) { - *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ - outptr += num_components; - } - } - input_row++; - output_buf++; - } -} - - -/* - * Color conversion for grayscale: just copy the data. - * This also works for YCbCr -> grayscale conversion, in which - * we just copy the Y (luminance) component and ignore chrominance. - */ - -METHODDEF void -grayscale_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, - num_rows, cinfo->output_width); -} - - -/* - * Adobe-style YCCK->CMYK conversion. - * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same - * conversion as above, while passing K (black) unchanged. - * We assume build_ycc_rgb_table has been called. - */ - -METHODDEF void -ycck_cmyk_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int y, cb, cr; - register JSAMPROW outptr; - register JSAMPROW inptr0, inptr1, inptr2, inptr3; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->output_width; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - register int * Crrtab = cconvert->Cr_r_tab; - register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; - SHIFT_TEMPS - - while (--num_rows >= 0) { - inptr0 = input_buf[0][input_row]; - inptr1 = input_buf[1][input_row]; - inptr2 = input_buf[2][input_row]; - inptr3 = input_buf[3][input_row]; - input_row++; - outptr = *output_buf++; - for (col = 0; col < num_cols; col++) { - y = GETJSAMPLE(inptr0[col]); - cb = GETJSAMPLE(inptr1[col]); - cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ - outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ - outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ - ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], - SCALEBITS)))]; - outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ - /* K passes through unchanged */ - outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ - outptr += 4; - } - } -} - - -/* - * Empty method for start_pass. - */ - -METHODDEF void -start_pass_dcolor (j_decompress_ptr cinfo) -{ - /* no work needed */ -} - - -/* - * Module initialization routine for output colorspace conversion. - */ - -GLOBAL void -jinit_color_deconverter (j_decompress_ptr cinfo) -{ - my_cconvert_ptr cconvert; - int ci; - - cconvert = (my_cconvert_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_color_deconverter)); - cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; - cconvert->pub.start_pass = start_pass_dcolor; - - /* Make sure num_components agrees with jpeg_color_space */ - switch (cinfo->jpeg_color_space) { - case JCS_GRAYSCALE: - if (cinfo->num_components != 1) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - case JCS_RGB: - case JCS_YCbCr: - if (cinfo->num_components != 3) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - case JCS_CMYK: - case JCS_YCCK: - if (cinfo->num_components != 4) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - default: /* JCS_UNKNOWN can be anything */ - if (cinfo->num_components < 1) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - } - - /* Set out_color_components and conversion method based on requested space. - * Also clear the component_needed flags for any unused components, - * so that earlier pipeline stages can avoid useless computation. - */ - - switch (cinfo->out_color_space) { - case JCS_GRAYSCALE: - cinfo->out_color_components = 1; - if (cinfo->jpeg_color_space == JCS_GRAYSCALE || - cinfo->jpeg_color_space == JCS_YCbCr) { - cconvert->pub.color_convert = grayscale_convert; - /* For color->grayscale conversion, only the Y (0) component is needed */ - for (ci = 1; ci < cinfo->num_components; ci++) - cinfo->comp_info[ci].component_needed = FALSE; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_RGB: - cinfo->out_color_components = RGB_PIXELSIZE; - if (cinfo->jpeg_color_space == JCS_YCbCr) { - cconvert->pub.color_convert = ycc_rgb_convert; - build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { - cconvert->pub.color_convert = null_convert; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_CMYK: - cinfo->out_color_components = 4; - if (cinfo->jpeg_color_space == JCS_YCCK) { - cconvert->pub.color_convert = ycck_cmyk_convert; - build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_CMYK) { - cconvert->pub.color_convert = null_convert; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - default: - /* Permit null conversion to same output space */ - if (cinfo->out_color_space == cinfo->jpeg_color_space) { - cinfo->out_color_components = cinfo->num_components; - cconvert->pub.color_convert = null_convert; - } else /* unsupported non-null conversion */ - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - } - - if (cinfo->quantize_colors) - cinfo->output_components = 1; /* single colormapped output component */ - else - cinfo->output_components = cinfo->out_color_components; -} diff --git a/libs/jpeg6/jdct.h b/libs/jpeg6/jdct.h deleted file mode 100644 index 3ce790bc..00000000 --- a/libs/jpeg6/jdct.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * jdct.h - * - * Copyright (C) 1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file contains common declarations for the forward and - * inverse DCT modules. These declarations are private to the DCT managers - * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. - * The individual DCT algorithms are kept in separate files to ease - * machine-dependent tuning (e.g., assembly coding). - */ - - -/* - * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; - * the DCT is to be performed in-place in that buffer. Type DCTELEM is int - * for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT - * implementations use an array of type FAST_FLOAT, instead.) - * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). - * The DCT outputs are returned scaled up by a factor of 8; they therefore - * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This - * convention improves accuracy in integer implementations and saves some - * work in floating-point ones. - * Quantization of the output coefficients is done by jcdctmgr.c. - */ - -#if BITS_IN_JSAMPLE == 8 -typedef int DCTELEM; /* 16 or 32 bits is fine */ -#else -typedef INT32 DCTELEM; /* must have 32 bits */ -#endif - -typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data)); -typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data)); - - -/* - * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer - * to an output sample array. The routine must dequantize the input data as - * well as perform the IDCT; for dequantization, it uses the multiplier table - * pointed to by compptr->dct_table. The output data is to be placed into the - * sample array starting at a specified column. (Any row offset needed will - * be applied to the array pointer before it is passed to the IDCT code.) - * Note that the number of samples emitted by the IDCT routine is - * DCT_scaled_size * DCT_scaled_size. - */ - -/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ - -/* - * Each IDCT routine has its own ideas about the best dct_table element type. - */ - -typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ -#if BITS_IN_JSAMPLE == 8 -typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ -#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ -#else -typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ -#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ -#endif -typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ - - -/* - * Each IDCT routine is responsible for range-limiting its results and - * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could - * be quite far out of range if the input data is corrupt, so a bulletproof - * range-limiting step is required. We use a mask-and-table-lookup method - * to do the combined operations quickly. See the comments with - * prepare_range_limit_table (in jdmaster.c) for more info. - */ - -#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) - -#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_fdct_islow jFDislow -#define jpeg_fdct_ifast jFDifast -#define jpeg_fdct_float jFDfloat -#define jpeg_idct_islow jRDislow -#define jpeg_idct_ifast jRDifast -#define jpeg_idct_float jRDfloat -#define jpeg_idct_4x4 jRD4x4 -#define jpeg_idct_2x2 jRD2x2 -#define jpeg_idct_1x1 jRD1x1 -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Extern declarations for the forward and inverse DCT routines. */ - -EXTERN void jpeg_fdct_islow JPP((DCTELEM * data)); -EXTERN void jpeg_fdct_ifast JPP((DCTELEM * data)); -EXTERN void jpeg_fdct_float JPP((FAST_FLOAT * data)); - -EXTERN void jpeg_idct_islow - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN void jpeg_idct_ifast - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN void jpeg_idct_float - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN void jpeg_idct_4x4 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN void jpeg_idct_2x2 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN void jpeg_idct_1x1 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); - - -/* - * Macros for handling fixed-point arithmetic; these are used by many - * but not all of the DCT/IDCT modules. - * - * All values are expected to be of type INT32. - * Fractional constants are scaled left by CONST_BITS bits. - * CONST_BITS is defined within each module using these macros, - * and may differ from one module to the next. - */ - -#define ONE ((INT32) 1) -#define CONST_SCALE (ONE << CONST_BITS) - -/* Convert a positive real constant to an integer scaled by CONST_SCALE. - * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, - * thus causing a lot of useless floating-point operations at run time. - */ - -#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) - -/* Descale and correctly round an INT32 value that's scaled by N bits. - * We assume RIGHT_SHIFT rounds towards minus infinity, so adding - * the fudge factor is correct for either sign of X. - */ - -#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * This macro is used only when the two inputs will actually be no more than - * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a - * full 32x32 multiply. This provides a useful speedup on many machines. - * Unfortunately there is no way to specify a 16x16->32 multiply portably - * in C, but some C compilers will do the right thing if you provide the - * correct combination of casts. - */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) -#endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const))) -#endif - -#ifndef MULTIPLY16C16 /* default definition */ -#define MULTIPLY16C16(var,const) ((var) * (const)) -#endif - -/* Same except both inputs are variables. */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) -#endif - -#ifndef MULTIPLY16V16 /* default definition */ -#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) -#endif diff --git a/libs/jpeg6/jddctmgr.cpp b/libs/jpeg6/jddctmgr.cpp deleted file mode 100644 index 5267ade9..00000000 --- a/libs/jpeg6/jddctmgr.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/* - * jddctmgr.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the inverse-DCT management logic. - * This code selects a particular IDCT implementation to be used, - * and it performs related housekeeping chores. No code in this file - * is executed per IDCT step, only during output pass setup. - * - * Note that the IDCT routines are responsible for performing coefficient - * dequantization as well as the IDCT proper. This module sets up the - * dequantization multiplier table needed by the IDCT routine. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - - -/* - * The decompressor input side (jdinput.c) saves away the appropriate - * quantization table for each component at the start of the first scan - * involving that component. (This is necessary in order to correctly - * decode files that reuse Q-table slots.) - * When we are ready to make an output pass, the saved Q-table is converted - * to a multiplier table that will actually be used by the IDCT routine. - * The multiplier table contents are IDCT-method-dependent. To support - * application changes in IDCT method between scans, we can remake the - * multiplier tables if necessary. - * In buffered-image mode, the first output pass may occur before any data - * has been seen for some components, and thus before their Q-tables have - * been saved away. To handle this case, multiplier tables are preset - * to zeroes; the result of the IDCT will be a neutral gray level. - */ - - -/* Private subobject for this module */ - -typedef struct { - struct jpeg_inverse_dct pub; /* public fields */ - - /* This array contains the IDCT method code that each multiplier table - * is currently set up for, or -1 if it's not yet set up. - * The actual multiplier tables are pointed to by dct_table in the - * per-component comp_info structures. - */ - int cur_method[MAX_COMPONENTS]; -} my_idct_controller; - -typedef my_idct_controller * my_idct_ptr; - - -/* Allocated multiplier tables: big enough for any supported variant */ - -typedef union { - ISLOW_MULT_TYPE islow_array[DCTSIZE2]; -#ifdef DCT_IFAST_SUPPORTED - IFAST_MULT_TYPE ifast_array[DCTSIZE2]; -#endif -#ifdef DCT_FLOAT_SUPPORTED - FLOAT_MULT_TYPE float_array[DCTSIZE2]; -#endif -} multiplier_table; - - -/* The current scaled-IDCT routines require ISLOW-style multiplier tables, - * so be sure to compile that code if either ISLOW or SCALING is requested. - */ -#ifdef DCT_ISLOW_SUPPORTED -#define PROVIDE_ISLOW_TABLES -#else -#ifdef IDCT_SCALING_SUPPORTED -#define PROVIDE_ISLOW_TABLES -#endif -#endif - - -/* - * Prepare for an output pass. - * Here we select the proper IDCT routine for each component and build - * a matching multiplier table. - */ - -METHODDEF void -start_pass (j_decompress_ptr cinfo) -{ - my_idct_ptr idct = (my_idct_ptr) cinfo->idct; - int ci, i; - jpeg_component_info *compptr; - int method = 0; - inverse_DCT_method_ptr method_ptr = NULL; - JQUANT_TBL * qtbl; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Select the proper IDCT routine for this component's scaling */ - switch (compptr->DCT_scaled_size) { -#ifdef IDCT_SCALING_SUPPORTED - case 1: - method_ptr = jpeg_idct_1x1; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; - case 2: - method_ptr = jpeg_idct_2x2; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; - case 4: - method_ptr = jpeg_idct_4x4; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; -#endif - case DCTSIZE: - switch (cinfo->dct_method) { -#ifdef DCT_ISLOW_SUPPORTED - case JDCT_ISLOW: - method_ptr = jpeg_idct_islow; - method = JDCT_ISLOW; - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - method_ptr = jpeg_idct_ifast; - method = JDCT_IFAST; - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - method_ptr = jpeg_idct_float; - method = JDCT_FLOAT; - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - break; - default: - ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size); - break; - } - idct->pub.inverse_DCT[ci] = method_ptr; - /* Create multiplier table from quant table. - * However, we can skip this if the component is uninteresting - * or if we already built the table. Also, if no quant table - * has yet been saved for the component, we leave the - * multiplier table all-zero; we'll be reading zeroes from the - * coefficient controller's buffer anyway. - */ - if (! compptr->component_needed || idct->cur_method[ci] == method) - continue; - qtbl = compptr->quant_table; - if (qtbl == NULL) /* happens if no data yet for component */ - continue; - idct->cur_method[ci] = method; - switch (method) { -#ifdef PROVIDE_ISLOW_TABLES - case JDCT_ISLOW: - { - /* For LL&M IDCT method, multipliers are equal to raw quantization - * coefficients, but are stored in natural order as ints. - */ - ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; - for (i = 0; i < DCTSIZE2; i++) { - ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[jpeg_zigzag_order[i]]; - } - } - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - { - /* For AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * For integer operation, the multiplier table is to be scaled by - * IFAST_SCALE_BITS. The multipliers are stored in natural order. - */ - IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; -#define CONST_BITS 14 - static const INT16 aanscales[DCTSIZE2] = { - /* precomputed values scaled up by 14 bits */ - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, - 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, - 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, - 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, - 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 - }; - SHIFT_TEMPS - - for (i = 0; i < DCTSIZE2; i++) { - ifmtbl[i] = (IFAST_MULT_TYPE) - DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[jpeg_zigzag_order[i]], - (INT32) aanscales[i]), - CONST_BITS-IFAST_SCALE_BITS); - } - } - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - { - /* For float AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * The multipliers are stored in natural order. - */ - FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; - int row, col; - static const double aanscalefactor[DCTSIZE] = { - 1.0, 1.387039845, 1.306562965, 1.175875602, - 1.0, 0.785694958, 0.541196100, 0.275899379 - }; - - i = 0; - for (row = 0; row < DCTSIZE; row++) { - for (col = 0; col < DCTSIZE; col++) { - fmtbl[i] = (FLOAT_MULT_TYPE) - ((double) qtbl->quantval[jpeg_zigzag_order[i]] * - aanscalefactor[row] * aanscalefactor[col]); - i++; - } - } - } - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - } -} - - -/* - * Initialize IDCT manager. - */ - -GLOBAL void -jinit_inverse_dct (j_decompress_ptr cinfo) -{ - my_idct_ptr idct; - int ci; - jpeg_component_info *compptr; - - idct = (my_idct_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_idct_controller)); - cinfo->idct = (struct jpeg_inverse_dct *) idct; - idct->pub.start_pass = start_pass; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Allocate and pre-zero a multiplier table for each component */ - compptr->dct_table = - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(multiplier_table)); - MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); - /* Mark multiplier table not yet set up for any method */ - idct->cur_method[ci] = -1; - } -} diff --git a/libs/jpeg6/jdhuff.cpp b/libs/jpeg6/jdhuff.cpp deleted file mode 100644 index 025d5187..00000000 --- a/libs/jpeg6/jdhuff.cpp +++ /dev/null @@ -1,574 +0,0 @@ -/* - * jdhuff.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy decoding routines. - * - * Much of the complexity here has to do with supporting input suspension. - * If the data source module demands suspension, we want to be able to back - * up to the start of the current MCU. To do this, we copy state variables - * into local working storage, and update them back to the permanent - * storage only upon successful completion of an MCU. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jdhuff.h" /* Declarations shared with jdphuff.c */ - - -/* - * Expanded entropy decoder object for Huffman decoding. - * - * The savable_state subrecord contains fields that change within an MCU, - * but must not be updated permanently until we complete the MCU. - */ - -typedef struct { - int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ -} savable_state; - -/* This macro is to work around compilers with missing or broken - * structure assignment. You'll need to fix this code if you have - * such a compiler and you change MAX_COMPS_IN_SCAN. - */ - -#ifndef NO_STRUCT_ASSIGN -#define ASSIGN_STATE(dest,src) ((dest) = (src)) -#else -#if MAX_COMPS_IN_SCAN == 4 -#define ASSIGN_STATE(dest,src) \ - ((dest).last_dc_val[0] = (src).last_dc_val[0], \ - (dest).last_dc_val[1] = (src).last_dc_val[1], \ - (dest).last_dc_val[2] = (src).last_dc_val[2], \ - (dest).last_dc_val[3] = (src).last_dc_val[3]) -#endif -#endif - - -typedef struct { - struct jpeg_entropy_decoder pub; /* public fields */ - - /* These fields are loaded into local variables at start of each MCU. - * In case of suspension, we exit WITHOUT updating them. - */ - bitread_perm_state bitstate; /* Bit buffer at start of MCU */ - savable_state saved; /* Other state at start of MCU */ - - /* These fields are NOT loaded into local working state. */ - unsigned int restarts_to_go; /* MCUs left in this restart interval */ - - /* Pointers to derived tables (these workspaces have image lifespan) */ - d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; - d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; -} huff_entropy_decoder; - -typedef huff_entropy_decoder * huff_entropy_ptr; - - -/* - * Initialize for a Huffman-compressed scan. - */ - -METHODDEF void -start_pass_huff_decoder (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci, dctbl, actbl; - jpeg_component_info * compptr; - - /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. - * This ought to be an error condition, but we make it a warning because - * there are some baseline files out there with all zeroes in these bytes. - */ - if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 || - cinfo->Ah != 0 || cinfo->Al != 0) - WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - dctbl = compptr->dc_tbl_no; - actbl = compptr->ac_tbl_no; - /* Make sure requested tables are present */ - if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS || - cinfo->dc_huff_tbl_ptrs[dctbl] == NULL) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); - if (actbl < 0 || actbl >= NUM_HUFF_TBLS || - cinfo->ac_huff_tbl_ptrs[actbl] == NULL) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl); - /* Compute derived values for Huffman tables */ - /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_d_derived_tbl(cinfo, cinfo->dc_huff_tbl_ptrs[dctbl], - & entropy->dc_derived_tbls[dctbl]); - jpeg_make_d_derived_tbl(cinfo, cinfo->ac_huff_tbl_ptrs[actbl], - & entropy->ac_derived_tbls[actbl]); - /* Initialize DC predictions to 0 */ - entropy->saved.last_dc_val[ci] = 0; - } - - /* Initialize bitread state variables */ - entropy->bitstate.bits_left = 0; - entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ - entropy->bitstate.printed_eod = FALSE; - - /* Initialize restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; -} - - -/* - * Compute the derived values for a Huffman table. - * Note this is also used by jdphuff.c. - */ - -GLOBAL void -jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, JHUFF_TBL * htbl, - d_derived_tbl ** pdtbl) -{ - d_derived_tbl *dtbl; - int p, i, l, si; - int lookbits, ctr; - char huffsize[257]; - unsigned int huffcode[257]; - unsigned int code; - - /* Allocate a workspace if we haven't already done so. */ - if (*pdtbl == NULL) - *pdtbl = (d_derived_tbl *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(d_derived_tbl)); - dtbl = *pdtbl; - dtbl->pub = htbl; /* fill in back link */ - - /* Figure C.1: make table of Huffman code length for each symbol */ - /* Note that this is in code-length order. */ - - p = 0; - for (l = 1; l <= 16; l++) { - for (i = 1; i <= (int) htbl->bits[l]; i++) - huffsize[p++] = (char) l; - } - huffsize[p] = 0; - - /* Figure C.2: generate the codes themselves */ - /* Note that this is in code-length order. */ - - code = 0; - si = huffsize[0]; - p = 0; - while (huffsize[p]) { - while (((int) huffsize[p]) == si) { - huffcode[p++] = code; - code++; - } - code <<= 1; - si++; - } - - /* Figure F.15: generate decoding tables for bit-sequential decoding */ - - p = 0; - for (l = 1; l <= 16; l++) { - if (htbl->bits[l]) { - dtbl->valptr[l] = p; /* huffval[] index of 1st symbol of code length l */ - dtbl->mincode[l] = huffcode[p]; /* minimum code of length l */ - p += htbl->bits[l]; - dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */ - } else { - dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ - } - } - dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ - - /* Compute lookahead tables to speed up decoding. - * First we set all the table entries to 0, indicating "too long"; - * then we iterate through the Huffman codes that are short enough and - * fill in all the entries that correspond to bit sequences starting - * with that code. - */ - - MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); - - p = 0; - for (l = 1; l <= HUFF_LOOKAHEAD; l++) { - for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { - /* l = current code's length, p = its index in huffcode[] & huffval[]. */ - /* Generate left-justified code followed by all possible bit sequences */ - lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l); - for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { - dtbl->look_nbits[lookbits] = l; - dtbl->look_sym[lookbits] = htbl->huffval[p]; - lookbits++; - } - } - } -} - - -/* - * Out-of-line code for bit fetching (shared with jdphuff.c). - * See jdhuff.h for info about usage. - * Note: current values of get_buffer and bits_left are passed as parameters, - * but are returned in the corresponding fields of the state struct. - * - * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width - * of get_buffer to be used. (On machines with wider words, an even larger - * buffer could be used.) However, on some machines 32-bit shifts are - * quite slow and take time proportional to the number of places shifted. - * (This is true with most PC compilers, for instance.) In this case it may - * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the - * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. - */ - -#ifdef SLOW_SHIFT_32 -#define MIN_GET_BITS 15 /* minimum allowable value */ -#else -#define MIN_GET_BITS (BIT_BUF_SIZE-7) -#endif - - -GLOBAL boolean -jpeg_fill_bit_buffer (bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - int nbits) -/* Load up the bit buffer to a depth of at least nbits */ -{ - /* Copy heavily used state fields into locals (hopefully registers) */ - register const JOCTET * next_input_byte = state->next_input_byte; - register size_t bytes_in_buffer = state->bytes_in_buffer; - register int c; - - /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ - /* (It is assumed that no request will be for more than that many bits.) */ - - while (bits_left < MIN_GET_BITS) { - /* Attempt to read a byte */ - if (state->unread_marker != 0) - goto no_more_data; /* can't advance past a marker */ - - if (bytes_in_buffer == 0) { - if (! (*state->cinfo->src->fill_input_buffer) (state->cinfo)) - return FALSE; - next_input_byte = state->cinfo->src->next_input_byte; - bytes_in_buffer = state->cinfo->src->bytes_in_buffer; - } - bytes_in_buffer--; - c = GETJOCTET(*next_input_byte++); - - /* If it's 0xFF, check and discard stuffed zero byte */ - if (c == 0xFF) { - do { - if (bytes_in_buffer == 0) { - if (! (*state->cinfo->src->fill_input_buffer) (state->cinfo)) - return FALSE; - next_input_byte = state->cinfo->src->next_input_byte; - bytes_in_buffer = state->cinfo->src->bytes_in_buffer; - } - bytes_in_buffer--; - c = GETJOCTET(*next_input_byte++); - } while (c == 0xFF); - - if (c == 0) { - /* Found FF/00, which represents an FF data byte */ - c = 0xFF; - } else { - /* Oops, it's actually a marker indicating end of compressed data. */ - /* Better put it back for use later */ - state->unread_marker = c; - - no_more_data: - /* There should be enough bits still left in the data segment; */ - /* if so, just break out of the outer while loop. */ - if (bits_left >= nbits) - break; - /* Uh-oh. Report corrupted data to user and stuff zeroes into - * the data stream, so that we can produce some kind of image. - * Note that this code will be repeated for each byte demanded - * for the rest of the segment. We use a nonvolatile flag to ensure - * that only one warning message appears. - */ - if (! *(state->printed_eod_ptr)) { - WARNMS(state->cinfo, JWRN_HIT_MARKER); - *(state->printed_eod_ptr) = TRUE; - } - c = 0; /* insert a zero byte into bit buffer */ - } - } - - /* OK, load c into get_buffer */ - get_buffer = (get_buffer << 8) | c; - bits_left += 8; - } - - /* Unload the local registers */ - state->next_input_byte = next_input_byte; - state->bytes_in_buffer = bytes_in_buffer; - state->get_buffer = get_buffer; - state->bits_left = bits_left; - - return TRUE; -} - - -/* - * Out-of-line code for Huffman code decoding. - * See jdhuff.h for info about usage. - */ - -GLOBAL int -jpeg_huff_decode (bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - d_derived_tbl * htbl, int min_bits) -{ - register int l = min_bits; - register INT32 code; - - /* HUFF_DECODE has determined that the code is at least min_bits */ - /* bits long, so fetch that many bits in one swoop. */ - - CHECK_BIT_BUFFER(*state, l, return -1); - code = GET_BITS(l); - - /* Collect the rest of the Huffman code one bit at a time. */ - /* This is per Figure F.16 in the JPEG spec. */ - - while (code > htbl->maxcode[l]) { - code <<= 1; - CHECK_BIT_BUFFER(*state, 1, return -1); - code |= GET_BITS(1); - l++; - } - - /* Unload the local registers */ - state->get_buffer = get_buffer; - state->bits_left = bits_left; - - /* With garbage input we may reach the sentinel value l = 17. */ - - if (l > 16) { - WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); - return 0; /* fake a zero as the safest result */ - } - - return htbl->pub->huffval[ htbl->valptr[l] + - ((int) (code - htbl->mincode[l])) ]; -} - - -/* - * Figure F.12: extend sign bit. - * On some machines, a shift and add will be faster than a table lookup. - */ - -#ifdef AVOID_TABLES - -#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) - -#else - -#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) - -static const int extend_test[16] = /* entry n is 2**(n-1) */ - { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, - 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; - -static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; - -#endif /* AVOID_TABLES */ - - -/* - * Check for a restart marker & resynchronize decoder. - * Returns FALSE if must suspend. - */ - -LOCAL boolean -process_restart (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci; - - /* Throw away any unused bits remaining in bit buffer; */ - /* include any full bytes in next_marker's count of discarded bytes */ - cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; - entropy->bitstate.bits_left = 0; - - /* Advance past the RSTn marker */ - if (! (*cinfo->marker->read_restart_marker) (cinfo)) - return FALSE; - - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - entropy->saved.last_dc_val[ci] = 0; - - /* Reset restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; - - /* Next segment can get another out-of-data warning */ - entropy->bitstate.printed_eod = FALSE; - - return TRUE; -} - - -/* - * Decode and return one MCU's worth of Huffman-compressed coefficients. - * The coefficients are reordered from zigzag order into natural array order, - * but are not dequantized. - * - * The i'th block of the MCU is stored into the block pointed to by - * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. - * (Wholesale zeroing is usually a little faster than retail...) - * - * Returns FALSE if data source requested suspension. In that case no - * changes have been made to permanent state. (Exception: some output - * coefficients may already have been assigned. This is harmless for - * this module, since we'll just re-assign them on the next call.) - */ - -METHODDEF boolean -decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - register int s, k, r; - int blkn, ci; - JBLOCKROW block; - BITREAD_STATE_VARS; - savable_state state; - d_derived_tbl * dctbl; - d_derived_tbl * actbl; - jpeg_component_info * compptr; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* Load up working state */ - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(state, entropy->saved); - - /* Outer loop handles each block in the MCU */ - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - dctbl = entropy->dc_derived_tbls[compptr->dc_tbl_no]; - actbl = entropy->ac_derived_tbls[compptr->ac_tbl_no]; - - /* Decode a single block's worth of coefficients */ - - /* Section F.2.2.1: decode the DC coefficient difference */ - HUFF_DECODE(s, br_state, dctbl, return FALSE, label1); - if (s) { - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - } - - /* Shortcut if component's values are not interesting */ - if (! compptr->component_needed) - goto skip_ACs; - - /* Convert DC difference to actual value, update last_dc_val */ - s += state.last_dc_val[ci]; - state.last_dc_val[ci] = s; - /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ - (*block)[0] = (JCOEF) s; - - /* Do we need to decode the AC coefficients for this component? */ - if (compptr->DCT_scaled_size > 1) { - - /* Section F.2.2.2: decode the AC coefficients */ - /* Since zeroes are skipped, output area must be cleared beforehand */ - for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label2); - - r = s >> 4; - s &= 15; - - if (s) { - k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - /* Output coefficient in natural (dezigzagged) order. - * Note: the extra entries in jpeg_natural_order[] will save us - * if k >= DCTSIZE2, which could happen if the data is corrupted. - */ - (*block)[jpeg_natural_order[k]] = (JCOEF) s; - } else { - if (r != 15) - break; - k += 15; - } - } - - } else { -skip_ACs: - - /* Section F.2.2.2: decode the AC coefficients */ - /* In this path we just discard the values */ - for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label3); - - r = s >> 4; - s &= 15; - - if (s) { - k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); - DROP_BITS(s); - } else { - if (r != 15) - break; - k += 15; - } - } - - } - } - - /* Completed MCU, so update state */ - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(entropy->saved, state); - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; -} - - -/* - * Module initialization routine for Huffman entropy decoding. - */ - -GLOBAL void -jinit_huff_decoder (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy; - int i; - - entropy = (huff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(huff_entropy_decoder)); - cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; - entropy->pub.start_pass = start_pass_huff_decoder; - entropy->pub.decode_mcu = decode_mcu; - - /* Mark tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; - } -} diff --git a/libs/jpeg6/jdhuff.h b/libs/jpeg6/jdhuff.h deleted file mode 100644 index d375c781..00000000 --- a/libs/jpeg6/jdhuff.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * jdhuff.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for Huffman entropy decoding routines - * that are shared between the sequential decoder (jdhuff.c) and the - * progressive decoder (jdphuff.c). No other modules need to see these. - */ - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_make_d_derived_tbl jMkDDerived -#define jpeg_fill_bit_buffer jFilBitBuf -#define jpeg_huff_decode jHufDecode -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Derived data constructed for each Huffman table */ - -#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ - -typedef struct { - /* Basic tables: (element [0] of each array is unused) */ - INT32 mincode[17]; /* smallest code of length k */ - INT32 maxcode[18]; /* largest code of length k (-1 if none) */ - /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ - int valptr[17]; /* huffval[] index of 1st symbol of length k */ - - /* Link to public Huffman table (needed only in jpeg_huff_decode) */ - JHUFF_TBL *pub; - - /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of - * the input data stream. If the next Huffman code is no more - * than HUFF_LOOKAHEAD bits long, we can obtain its length and - * the corresponding symbol directly from these tables. - */ - int look_nbits[1< 32 bits on your machine, and shifting/masking longs is - * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE - * appropriately should be a win. Unfortunately we can't do this with - * something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) - * because not all machines measure sizeof in 8-bit bytes. - */ - -typedef struct { /* Bitreading state saved across MCUs */ - bit_buf_type get_buffer; /* current bit-extraction buffer */ - int bits_left; /* # of unused bits in it */ - boolean printed_eod; /* flag to suppress multiple warning msgs */ -} bitread_perm_state; - -typedef struct { /* Bitreading working state within an MCU */ - /* current data source state */ - const JOCTET * next_input_byte; /* => next byte to read from source */ - size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ - int unread_marker; /* nonzero if we have hit a marker */ - /* bit input buffer --- note these values are kept in register variables, - * not in this struct, inside the inner loops. - */ - bit_buf_type get_buffer; /* current bit-extraction buffer */ - int bits_left; /* # of unused bits in it */ - /* pointers needed by jpeg_fill_bit_buffer */ - j_decompress_ptr cinfo; /* back link to decompress master record */ - boolean * printed_eod_ptr; /* => flag in permanent state */ -} bitread_working_state; - -/* Macros to declare and load/save bitread local variables. */ -#define BITREAD_STATE_VARS \ - register bit_buf_type get_buffer; \ - register int bits_left; \ - bitread_working_state br_state - -#define BITREAD_LOAD_STATE(cinfop,permstate) \ - br_state.cinfo = cinfop; \ - br_state.next_input_byte = cinfop->src->next_input_byte; \ - br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ - br_state.unread_marker = cinfop->unread_marker; \ - get_buffer = permstate.get_buffer; \ - bits_left = permstate.bits_left; \ - br_state.printed_eod_ptr = & permstate.printed_eod - -#define BITREAD_SAVE_STATE(cinfop,permstate) \ - cinfop->src->next_input_byte = br_state.next_input_byte; \ - cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ - cinfop->unread_marker = br_state.unread_marker; \ - permstate.get_buffer = get_buffer; \ - permstate.bits_left = bits_left - -/* - * These macros provide the in-line portion of bit fetching. - * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer - * before using GET_BITS, PEEK_BITS, or DROP_BITS. - * The variables get_buffer and bits_left are assumed to be locals, - * but the state struct might not be (jpeg_huff_decode needs this). - * CHECK_BIT_BUFFER(state,n,action); - * Ensure there are N bits in get_buffer; if suspend, take action. - * val = GET_BITS(n); - * Fetch next N bits. - * val = PEEK_BITS(n); - * Fetch next N bits without removing them from the buffer. - * DROP_BITS(n); - * Discard next N bits. - * The value N should be a simple variable, not an expression, because it - * is evaluated multiple times. - */ - -#define CHECK_BIT_BUFFER(state,nbits,action) \ - { if (bits_left < (nbits)) { \ - if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ - { action; } \ - get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } - -#define GET_BITS(nbits) \ - (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) - -#define PEEK_BITS(nbits) \ - (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) - -#define DROP_BITS(nbits) \ - (bits_left -= (nbits)) - -/* Load up the bit buffer to a depth of at least nbits */ -EXTERN boolean jpeg_fill_bit_buffer JPP((bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - int nbits)); - - -/* - * Code for extracting next Huffman-coded symbol from input bit stream. - * Again, this is time-critical and we make the main paths be macros. - * - * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits - * without looping. Usually, more than 95% of the Huffman codes will be 8 - * or fewer bits long. The few overlength codes are handled with a loop, - * which need not be inline code. - * - * Notes about the HUFF_DECODE macro: - * 1. Near the end of the data segment, we may fail to get enough bits - * for a lookahead. In that case, we do it the hard way. - * 2. If the lookahead table contains no entry, the next code must be - * more than HUFF_LOOKAHEAD bits long. - * 3. jpeg_huff_decode returns -1 if forced to suspend. - */ - -#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ -{ register int nb, look; \ - if (bits_left < HUFF_LOOKAHEAD) { \ - if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ - get_buffer = state.get_buffer; bits_left = state.bits_left; \ - if (bits_left < HUFF_LOOKAHEAD) { \ - nb = 1; goto slowlabel; \ - } \ - } \ - look = PEEK_BITS(HUFF_LOOKAHEAD); \ - if ((nb = htbl->look_nbits[look]) != 0) { \ - DROP_BITS(nb); \ - result = htbl->look_sym[look]; \ - } else { \ - nb = HUFF_LOOKAHEAD+1; \ -slowlabel: \ - if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ - { failaction; } \ - get_buffer = state.get_buffer; bits_left = state.bits_left; \ - } \ -} - -/* Out-of-line case for Huffman code fetching */ -EXTERN int jpeg_huff_decode JPP((bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - d_derived_tbl * htbl, int min_bits)); diff --git a/libs/jpeg6/jdinput.cpp b/libs/jpeg6/jdinput.cpp deleted file mode 100644 index f48307d0..00000000 --- a/libs/jpeg6/jdinput.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/* - * jdinput.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains input control logic for the JPEG decompressor. - * These routines are concerned with controlling the decompressor's input - * processing (marker reading and coefficient decoding). The actual input - * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Private state */ - -typedef struct { - struct jpeg_input_controller pub; /* public fields */ - - boolean inheaders; /* TRUE until first SOS is reached */ -} my_input_controller; - -typedef my_input_controller * my_inputctl_ptr; - - -/* Forward declarations */ -METHODDEF int consume_markers JPP((j_decompress_ptr cinfo)); - - -/* - * Routines to calculate various quantities related to the size of the image. - */ - -LOCAL void -initial_setup (j_decompress_ptr cinfo) -/* Called once, when first SOS marker is reached */ -{ - int ci; - jpeg_component_info *compptr; - - /* Make sure image isn't bigger than I can handle */ - if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || - (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) - ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); - - /* For now, precision must match compiled-in value... */ - if (cinfo->data_precision != BITS_IN_JSAMPLE) - ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); - - /* Check that number of components won't exceed internal array sizes */ - if (cinfo->num_components > MAX_COMPONENTS) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPONENTS); - - /* Compute maximum sampling factors; check factor validity */ - cinfo->max_h_samp_factor = 1; - cinfo->max_v_samp_factor = 1; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || - compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) - ERREXIT(cinfo, JERR_BAD_SAMPLING); - cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, - compptr->h_samp_factor); - cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, - compptr->v_samp_factor); - } - - /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE. - * In the full decompressor, this will be overridden by jdmaster.c; - * but in the transcoder, jdmaster.c is not used, so we must do it here. - */ - cinfo->min_DCT_scaled_size = DCTSIZE; - - /* Compute dimensions of components */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - compptr->DCT_scaled_size = DCTSIZE; - /* Size in DCT blocks */ - compptr->width_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - compptr->height_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) (cinfo->max_v_samp_factor * DCTSIZE)); - /* downsampled_width and downsampled_height will also be overridden by - * jdmaster.c if we are doing full decompression. The transcoder library - * doesn't use these values, but the calling application might. - */ - /* Size in samples */ - compptr->downsampled_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) cinfo->max_h_samp_factor); - compptr->downsampled_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) cinfo->max_v_samp_factor); - /* Mark component needed, until color conversion says otherwise */ - compptr->component_needed = TRUE; - /* Mark no quantization table yet saved for component */ - compptr->quant_table = NULL; - } - - /* Compute number of fully interleaved MCU rows. */ - cinfo->total_iMCU_rows = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); - - /* Decide whether file contains multiple scans */ - if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode) - cinfo->inputctl->has_multiple_scans = TRUE; - else - cinfo->inputctl->has_multiple_scans = FALSE; -} - - -LOCAL void -per_scan_setup (j_decompress_ptr cinfo) -/* Do computations that are needed before processing a JPEG scan */ -/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ -{ - int ci, mcublks, tmp; - jpeg_component_info *compptr; - - if (cinfo->comps_in_scan == 1) { - - /* Noninterleaved (single-component) scan */ - compptr = cinfo->cur_comp_info[0]; - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = compptr->width_in_blocks; - cinfo->MCU_rows_in_scan = compptr->height_in_blocks; - - /* For noninterleaved scan, always one block per MCU */ - compptr->MCU_width = 1; - compptr->MCU_height = 1; - compptr->MCU_blocks = 1; - compptr->MCU_sample_width = compptr->DCT_scaled_size; - compptr->last_col_width = 1; - /* For noninterleaved scans, it is convenient to define last_row_height - * as the number of block rows present in the last iMCU row. - */ - tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (tmp == 0) tmp = compptr->v_samp_factor; - compptr->last_row_height = tmp; - - /* Prepare array describing MCU composition */ - cinfo->blocks_in_MCU = 1; - cinfo->MCU_membership[0] = 0; - - } else { - - /* Interleaved (multi-component) scan */ - if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, - MAX_COMPS_IN_SCAN); - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, - (long) (cinfo->max_h_samp_factor*DCTSIZE)); - cinfo->MCU_rows_in_scan = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); - - cinfo->blocks_in_MCU = 0; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Sampling factors give # of blocks of component in each MCU */ - compptr->MCU_width = compptr->h_samp_factor; - compptr->MCU_height = compptr->v_samp_factor; - compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; - compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size; - /* Figure number of non-dummy blocks in last MCU column & row */ - tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); - if (tmp == 0) tmp = compptr->MCU_width; - compptr->last_col_width = tmp; - tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); - if (tmp == 0) tmp = compptr->MCU_height; - compptr->last_row_height = tmp; - /* Prepare array describing MCU composition */ - mcublks = compptr->MCU_blocks; - if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU) - ERREXIT(cinfo, JERR_BAD_MCU_SIZE); - while (mcublks-- > 0) { - cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; - } - } - - } -} - - -/* - * Save away a copy of the Q-table referenced by each component present - * in the current scan, unless already saved during a prior scan. - * - * In a multiple-scan JPEG file, the encoder could assign different components - * the same Q-table slot number, but change table definitions between scans - * so that each component uses a different Q-table. (The IJG encoder is not - * currently capable of doing this, but other encoders might.) Since we want - * to be able to dequantize all the components at the end of the file, this - * means that we have to save away the table actually used for each component. - * We do this by copying the table at the start of the first scan containing - * the component. - * The JPEG spec prohibits the encoder from changing the contents of a Q-table - * slot between scans of a component using that slot. If the encoder does so - * anyway, this decoder will simply use the Q-table values that were current - * at the start of the first scan for the component. - * - * The decompressor output side looks only at the saved quant tables, - * not at the current Q-table slots. - */ - -LOCAL void -latch_quant_tables (j_decompress_ptr cinfo) -{ - int ci, qtblno; - jpeg_component_info *compptr; - JQUANT_TBL * qtbl; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* No work if we already saved Q-table for this component */ - if (compptr->quant_table != NULL) - continue; - /* Make sure specified quantization table is present */ - qtblno = compptr->quant_tbl_no; - if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || - cinfo->quant_tbl_ptrs[qtblno] == NULL) - ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); - /* OK, save away the quantization table */ - qtbl = (JQUANT_TBL *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(JQUANT_TBL)); - MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); - compptr->quant_table = qtbl; - } -} - - -/* - * Initialize the input modules to read a scan of compressed data. - * The first call to this is done by jdmaster.c after initializing - * the entire decompressor (during jpeg_start_decompress). - * Subsequent calls come from consume_markers, below. - */ - -METHODDEF void -start_input_pass (j_decompress_ptr cinfo) -{ - per_scan_setup(cinfo); - latch_quant_tables(cinfo); - (*cinfo->entropy->start_pass) (cinfo); - (*cinfo->coef->start_input_pass) (cinfo); - cinfo->inputctl->consume_input = cinfo->coef->consume_data; -} - - -/* - * Finish up after inputting a compressed-data scan. - * This is called by the coefficient controller after it's read all - * the expected data of the scan. - */ - -METHODDEF void -finish_input_pass (j_decompress_ptr cinfo) -{ - cinfo->inputctl->consume_input = consume_markers; -} - - -/* - * Read JPEG markers before, between, or after compressed-data scans. - * Change state as necessary when a new scan is reached. - * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - * - * The consume_input method pointer points either here or to the - * coefficient controller's consume_data routine, depending on whether - * we are reading a compressed data segment or inter-segment markers. - */ - -METHODDEF int -consume_markers (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; - int val; - - if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ - return JPEG_REACHED_EOI; - - val = (*cinfo->marker->read_markers) (cinfo); - - switch (val) { - case JPEG_REACHED_SOS: /* Found SOS */ - if (inputctl->inheaders) { /* 1st SOS */ - initial_setup(cinfo); - inputctl->inheaders = FALSE; - /* Note: start_input_pass must be called by jdmaster.c - * before any more input can be consumed. jdapi.c is - * responsible for enforcing this sequencing. - */ - } else { /* 2nd or later SOS marker */ - if (! inputctl->pub.has_multiple_scans) - ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ - start_input_pass(cinfo); - } - break; - case JPEG_REACHED_EOI: /* Found EOI */ - inputctl->pub.eoi_reached = TRUE; - if (inputctl->inheaders) { /* Tables-only datastream, apparently */ - if (cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOF_NO_SOS); - } else { - /* Prevent infinite loop in coef ctlr's decompress_data routine - * if user set output_scan_number larger than number of scans. - */ - if (cinfo->output_scan_number > cinfo->input_scan_number) - cinfo->output_scan_number = cinfo->input_scan_number; - } - break; - case JPEG_SUSPENDED: - break; - } - - return val; -} - - -/* - * Reset state to begin a fresh datastream. - */ - -METHODDEF void -reset_input_controller (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; - - inputctl->pub.consume_input = consume_markers; - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; - /* Reset other modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); - (*cinfo->marker->reset_marker_reader) (cinfo); - /* Reset progression state -- would be cleaner if entropy decoder did this */ - cinfo->coef_bits = NULL; -} - - -/* - * Initialize the input controller module. - * This is called only once, when the decompression object is created. - */ - -GLOBAL void -jinit_input_controller (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl; - - /* Create subobject in permanent pool */ - inputctl = (my_inputctl_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_input_controller)); - cinfo->inputctl = (struct jpeg_input_controller *) inputctl; - /* Initialize method pointers */ - inputctl->pub.consume_input = consume_markers; - inputctl->pub.reset_input_controller = reset_input_controller; - inputctl->pub.start_input_pass = start_input_pass; - inputctl->pub.finish_input_pass = finish_input_pass; - /* Initialize state: can't use reset_input_controller since we don't - * want to try to reset other modules yet. - */ - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; -} diff --git a/libs/jpeg6/jdmainct.cpp b/libs/jpeg6/jdmainct.cpp deleted file mode 100644 index d445649f..00000000 --- a/libs/jpeg6/jdmainct.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - * jdmainct.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the main buffer controller for decompression. - * The main buffer lies between the JPEG decompressor proper and the - * post-processor; it holds downsampled data in the JPEG colorspace. - * - * Note that this code is bypassed in raw-data mode, since the application - * supplies the equivalent of the main buffer in that case. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* - * In the current system design, the main buffer need never be a full-image - * buffer; any full-height buffers will be found inside the coefficient or - * postprocessing controllers. Nonetheless, the main controller is not - * trivial. Its responsibility is to provide context rows for upsampling/ - * rescaling, and doing this in an efficient fashion is a bit tricky. - * - * Postprocessor input data is counted in "row groups". A row group - * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) - * sample rows of each component. (We require DCT_scaled_size values to be - * chosen such that these numbers are integers. In practice DCT_scaled_size - * values will likely be powers of two, so we actually have the stronger - * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.) - * Upsampling will typically produce max_v_samp_factor pixel rows from each - * row group (times any additional scale factor that the upsampler is - * applying). - * - * The coefficient controller will deliver data to us one iMCU row at a time; - * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or - * exactly min_DCT_scaled_size row groups. (This amount of data corresponds - * to one row of MCUs when the image is fully interleaved.) Note that the - * number of sample rows varies across components, but the number of row - * groups does not. Some garbage sample rows may be included in the last iMCU - * row at the bottom of the image. - * - * Depending on the vertical scaling algorithm used, the upsampler may need - * access to the sample row(s) above and below its current input row group. - * The upsampler is required to set need_context_rows TRUE at global selection - * time if so. When need_context_rows is FALSE, this controller can simply - * obtain one iMCU row at a time from the coefficient controller and dole it - * out as row groups to the postprocessor. - * - * When need_context_rows is TRUE, this controller guarantees that the buffer - * passed to postprocessing contains at least one row group's worth of samples - * above and below the row group(s) being processed. Note that the context - * rows "above" the first passed row group appear at negative row offsets in - * the passed buffer. At the top and bottom of the image, the required - * context rows are manufactured by duplicating the first or last real sample - * row; this avoids having special cases in the upsampling inner loops. - * - * The amount of context is fixed at one row group just because that's a - * convenient number for this controller to work with. The existing - * upsamplers really only need one sample row of context. An upsampler - * supporting arbitrary output rescaling might wish for more than one row - * group of context when shrinking the image; tough, we don't handle that. - * (This is justified by the assumption that downsizing will be handled mostly - * by adjusting the DCT_scaled_size values, so that the actual scale factor at - * the upsample step needn't be much less than one.) - * - * To provide the desired context, we have to retain the last two row groups - * of one iMCU row while reading in the next iMCU row. (The last row group - * can't be processed until we have another row group for its below-context, - * and so we have to save the next-to-last group too for its above-context.) - * We could do this most simply by copying data around in our buffer, but - * that'd be very slow. We can avoid copying any data by creating a rather - * strange pointer structure. Here's how it works. We allocate a workspace - * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number - * of row groups per iMCU row). We create two sets of redundant pointers to - * the workspace. Labeling the physical row groups 0 to M+1, the synthesized - * pointer lists look like this: - * M+1 M-1 - * master pointer --> 0 master pointer --> 0 - * 1 1 - * ... ... - * M-3 M-3 - * M-2 M - * M-1 M+1 - * M M-2 - * M+1 M-1 - * 0 0 - * We read alternate iMCU rows using each master pointer; thus the last two - * row groups of the previous iMCU row remain un-overwritten in the workspace. - * The pointer lists are set up so that the required context rows appear to - * be adjacent to the proper places when we pass the pointer lists to the - * upsampler. - * - * The above pictures describe the normal state of the pointer lists. - * At top and bottom of the image, we diddle the pointer lists to duplicate - * the first or last sample row as necessary (this is cheaper than copying - * sample rows around). - * - * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that - * situation each iMCU row provides only one row group so the buffering logic - * must be different (eg, we must read two iMCU rows before we can emit the - * first row group). For now, we simply do not support providing context - * rows when min_DCT_scaled_size is 1. That combination seems unlikely to - * be worth providing --- if someone wants a 1/8th-size preview, they probably - * want it quick and dirty, so a context-free upsampler is sufficient. - */ - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_main_controller pub; /* public fields */ - - /* Pointer to allocated workspace (M or M+2 row groups). */ - JSAMPARRAY buffer[MAX_COMPONENTS]; - - boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ - JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ - - /* Remaining fields are only used in the context case. */ - - /* These are the master pointers to the funny-order pointer lists. */ - JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ - - int whichptr; /* indicates which pointer set is now in use */ - int context_state; /* process_data state machine status */ - JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ - JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ -} my_main_controller; - -typedef my_main_controller * my_main_ptr; - -/* context_state values: */ -#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ -#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ -#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ - - -/* Forward declarations */ -METHODDEF void process_data_simple_main - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -METHODDEF void process_data_context_main - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -#ifdef QUANT_2PASS_SUPPORTED -METHODDEF void process_data_crank_post - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -#endif - - -LOCAL void -alloc_funny_pointers (j_decompress_ptr cinfo) -/* Allocate space for the funny pointer lists. - * This is done only once, not once per pass. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY xbuf; - - /* Get top-level space for component array pointers. - * We alloc both arrays with one call to save a few cycles. - */ - main->xbuffer[0] = (JSAMPIMAGE) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); - main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - /* Get space for pointer lists --- M+4 row groups in each list. - * We alloc both pointer lists with one call to save a few cycles. - */ - xbuf = (JSAMPARRAY) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW)); - xbuf += rgroup; /* want one row group at negative offsets */ - main->xbuffer[0][ci] = xbuf; - xbuf += rgroup * (M + 4); - main->xbuffer[1][ci] = xbuf; - } -} - - -LOCAL void -make_funny_pointers (j_decompress_ptr cinfo) -/* Create the funny pointer lists discussed in the comments above. - * The actual workspace is already allocated (in main->buffer), - * and the space for the pointer lists is allocated too. - * This routine just fills in the curiously ordered lists. - * This will be repeated at the beginning of each pass. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY buf, xbuf0, xbuf1; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; - /* First copy the workspace pointers as-is */ - buf = main->buffer[ci]; - for (i = 0; i < rgroup * (M + 2); i++) { - xbuf0[i] = xbuf1[i] = buf[i]; - } - /* In the second list, put the last four row groups in swapped order */ - for (i = 0; i < rgroup * 2; i++) { - xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; - xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; - } - /* The wraparound pointers at top and bottom will be filled later - * (see set_wraparound_pointers, below). Initially we want the "above" - * pointers to duplicate the first actual data line. This only needs - * to happen in xbuffer[0]. - */ - for (i = 0; i < rgroup; i++) { - xbuf0[i - rgroup] = xbuf0[0]; - } - } -} - - -LOCAL void -set_wraparound_pointers (j_decompress_ptr cinfo) -/* Set up the "wraparound" pointers at top and bottom of the pointer lists. - * This changes the pointer list state from top-of-image to the normal state. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY xbuf0, xbuf1; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; - for (i = 0; i < rgroup; i++) { - xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; - xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; - xbuf0[rgroup*(M+2) + i] = xbuf0[i]; - xbuf1[rgroup*(M+2) + i] = xbuf1[i]; - } - } -} - - -LOCAL void -set_bottom_pointers (j_decompress_ptr cinfo) -/* Change the pointer lists to duplicate the last sample row at the bottom - * of the image. whichptr indicates which xbuffer holds the final iMCU row. - * Also sets rowgroups_avail to indicate number of nondummy row groups in row. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup, iMCUheight, rows_left; - jpeg_component_info *compptr; - JSAMPARRAY xbuf; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Count sample rows in one iMCU row and in one row group */ - iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size; - rgroup = iMCUheight / cinfo->min_DCT_scaled_size; - /* Count nondummy sample rows remaining for this component */ - rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); - if (rows_left == 0) rows_left = iMCUheight; - /* Count nondummy row groups. Should get same answer for each component, - * so we need only do it once. - */ - if (ci == 0) { - main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); - } - /* Duplicate the last real sample row rgroup*2 times; this pads out the - * last partial rowgroup and ensures at least one full rowgroup of context. - */ - xbuf = main->xbuffer[main->whichptr][ci]; - for (i = 0; i < rgroup * 2; i++) { - xbuf[rows_left + i] = xbuf[rows_left-1]; - } - } -} - - -/* - * Initialize for a processing pass. - */ - -METHODDEF void -start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - - switch (pass_mode) { - case JBUF_PASS_THRU: - if (cinfo->upsample->need_context_rows) { - main->pub.process_data = process_data_context_main; - make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ - main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ - main->context_state = CTX_PREPARE_FOR_IMCU; - main->iMCU_row_ctr = 0; - } else { - /* Simple case with no context needed */ - main->pub.process_data = process_data_simple_main; - } - main->buffer_full = FALSE; /* Mark buffer empty */ - main->rowgroup_ctr = 0; - break; -#ifdef QUANT_2PASS_SUPPORTED - case JBUF_CRANK_DEST: - /* For last pass of 2-pass quantization, just crank the postprocessor */ - main->pub.process_data = process_data_crank_post; - break; -#endif - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } -} - - -/* - * Process some data. - * This handles the simple case where no context is required. - */ - -METHODDEF void -process_data_simple_main (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - JDIMENSION rowgroups_avail; - - /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { - if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer)) - return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ - } - - /* There are always min_DCT_scaled_size row groups in an iMCU row. */ - rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size; - /* Note: at the bottom of the image, we may pass extra garbage row groups - * to the postprocessor. The postprocessor has to check for bottom - * of image anyway (at row resolution), so no point in us doing it too. - */ - - /* Feed the postprocessor */ - (*cinfo->post->post_process_data) (cinfo, main->buffer, - &main->rowgroup_ctr, rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - - /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ - if (main->rowgroup_ctr >= rowgroups_avail) { - main->buffer_full = FALSE; - main->rowgroup_ctr = 0; - } -} - - -/* - * Process some data. - * This handles the case where context rows must be provided. - */ - -METHODDEF void -process_data_context_main (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - - /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { - if (! (*cinfo->coef->decompress_data) (cinfo, - main->xbuffer[main->whichptr])) - return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ - main->iMCU_row_ctr++; /* count rows received */ - } - - /* Postprocessor typically will not swallow all the input data it is handed - * in one call (due to filling the output buffer first). Must be prepared - * to exit and restart. This switch lets us keep track of how far we got. - * Note that each case falls through to the next on successful completion. - */ - switch (main->context_state) { - case CTX_POSTPONED_ROW: - /* Call postprocessor using previously set pointers for postponed row */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) - return; /* Need to suspend */ - main->context_state = CTX_PREPARE_FOR_IMCU; - if (*out_row_ctr >= out_rows_avail) - return; /* Postprocessor exactly filled output buf */ - /*FALLTHROUGH*/ - case CTX_PREPARE_FOR_IMCU: - /* Prepare to process first M-1 row groups of this iMCU row */ - main->rowgroup_ctr = 0; - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1); - /* Check for bottom of image: if so, tweak pointers to "duplicate" - * the last sample row, and adjust rowgroups_avail to ignore padding rows. - */ - if (main->iMCU_row_ctr == cinfo->total_iMCU_rows) - set_bottom_pointers(cinfo); - main->context_state = CTX_PROCESS_IMCU; - /*FALLTHROUGH*/ - case CTX_PROCESS_IMCU: - /* Call postprocessor using previously set pointers */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) - return; /* Need to suspend */ - /* After the first iMCU, change wraparound pointers to normal state */ - if (main->iMCU_row_ctr == 1) - set_wraparound_pointers(cinfo); - /* Prepare to load new iMCU row using other xbuffer list */ - main->whichptr ^= 1; /* 0=>1 or 1=>0 */ - main->buffer_full = FALSE; - /* Still need to process last row group of this iMCU row, */ - /* which is saved at index M+1 of the other xbuffer */ - main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1); - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2); - main->context_state = CTX_POSTPONED_ROW; - } -} - - -/* - * Process some data. - * Final pass of two-pass quantization: just call the postprocessor. - * Source data will be the postprocessor controller's internal buffer. - */ - -#ifdef QUANT_2PASS_SUPPORTED - -METHODDEF void -process_data_crank_post (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, - (JDIMENSION *) NULL, (JDIMENSION) 0, - output_buf, out_row_ctr, out_rows_avail); -} - -#endif /* QUANT_2PASS_SUPPORTED */ - - -/* - * Initialize main buffer controller. - */ - -GLOBAL void -jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) -{ - my_main_ptr main; - int ci, rgroup, ngroups; - jpeg_component_info *compptr; - - main = (my_main_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_main_controller)); - cinfo->main = (struct jpeg_d_main_controller *) main; - main->pub.start_pass = start_pass_main; - - if (need_full_buffer) /* shouldn't happen */ - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - - /* Allocate the workspace. - * ngroups is the number of row groups we need. - */ - if (cinfo->upsample->need_context_rows) { - if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */ - ERREXIT(cinfo, JERR_NOTIMPL); - alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ - ngroups = cinfo->min_DCT_scaled_size + 2; - } else { - ngroups = cinfo->min_DCT_scaled_size; - } - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - main->buffer[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * compptr->DCT_scaled_size, - (JDIMENSION) (rgroup * ngroups)); - } -} diff --git a/libs/jpeg6/jdmarker.cpp b/libs/jpeg6/jdmarker.cpp deleted file mode 100644 index b897b507..00000000 --- a/libs/jpeg6/jdmarker.cpp +++ /dev/null @@ -1,1052 +0,0 @@ -/* - * jdmarker.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains routines to decode JPEG datastream markers. - * Most of the complexity arises from our desire to support input - * suspension: if not all of the data for a marker is available, - * we must exit back to the application. On resumption, we reprocess - * the marker. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -typedef enum { /* JPEG marker codes */ - M_SOF0 = 0xc0, - M_SOF1 = 0xc1, - M_SOF2 = 0xc2, - M_SOF3 = 0xc3, - - M_SOF5 = 0xc5, - M_SOF6 = 0xc6, - M_SOF7 = 0xc7, - - M_JPG = 0xc8, - M_SOF9 = 0xc9, - M_SOF10 = 0xca, - M_SOF11 = 0xcb, - - M_SOF13 = 0xcd, - M_SOF14 = 0xce, - M_SOF15 = 0xcf, - - M_DHT = 0xc4, - - M_DAC = 0xcc, - - M_RST0 = 0xd0, - M_RST1 = 0xd1, - M_RST2 = 0xd2, - M_RST3 = 0xd3, - M_RST4 = 0xd4, - M_RST5 = 0xd5, - M_RST6 = 0xd6, - M_RST7 = 0xd7, - - M_SOI = 0xd8, - M_EOI = 0xd9, - M_SOS = 0xda, - M_DQT = 0xdb, - M_DNL = 0xdc, - M_DRI = 0xdd, - M_DHP = 0xde, - M_EXP = 0xdf, - - M_APP0 = 0xe0, - M_APP1 = 0xe1, - M_APP2 = 0xe2, - M_APP3 = 0xe3, - M_APP4 = 0xe4, - M_APP5 = 0xe5, - M_APP6 = 0xe6, - M_APP7 = 0xe7, - M_APP8 = 0xe8, - M_APP9 = 0xe9, - M_APP10 = 0xea, - M_APP11 = 0xeb, - M_APP12 = 0xec, - M_APP13 = 0xed, - M_APP14 = 0xee, - M_APP15 = 0xef, - - M_JPG0 = 0xf0, - M_JPG13 = 0xfd, - M_COM = 0xfe, - - M_TEM = 0x01, - - M_ERROR = 0x100 -} JPEG_MARKER; - - -/* - * Macros for fetching data from the data source module. - * - * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect - * the current restart point; we update them only when we have reached a - * suitable place to restart if a suspension occurs. - */ - -/* Declare and initialize local copies of input pointer/count */ -#define INPUT_VARS(cinfo) \ - struct jpeg_source_mgr * datasrc = (cinfo)->src; \ - const JOCTET * next_input_byte = datasrc->next_input_byte; \ - size_t bytes_in_buffer = datasrc->bytes_in_buffer - -/* Unload the local copies --- do this only at a restart boundary */ -#define INPUT_SYNC(cinfo) \ - ( datasrc->next_input_byte = next_input_byte, \ - datasrc->bytes_in_buffer = bytes_in_buffer ) - -/* Reload the local copies --- seldom used except in MAKE_BYTE_AVAIL */ -#define INPUT_RELOAD(cinfo) \ - ( next_input_byte = datasrc->next_input_byte, \ - bytes_in_buffer = datasrc->bytes_in_buffer ) - -/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. - * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, - * but we must reload the local copies after a successful fill. - */ -#define MAKE_BYTE_AVAIL(cinfo,action) \ - if (bytes_in_buffer == 0) { \ - if (! (*datasrc->fill_input_buffer) (cinfo)) \ - { action; } \ - INPUT_RELOAD(cinfo); \ - } \ - bytes_in_buffer-- - -/* Read a byte into variable V. - * If must suspend, take the specified action (typically "return FALSE"). - */ -#define INPUT_BYTE(cinfo,V,action) \ - MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ - V = GETJOCTET(*next_input_byte++); ) - -/* As above, but read two bytes interpreted as an unsigned 16-bit integer. - * V should be declared unsigned int or perhaps INT32. - */ -#define INPUT_2BYTES(cinfo,V,action) \ - MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ - V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ - MAKE_BYTE_AVAIL(cinfo,action); \ - V += GETJOCTET(*next_input_byte++); ) - - -/* - * Routines to process JPEG markers. - * - * Entry condition: JPEG marker itself has been read and its code saved - * in cinfo->unread_marker; input restart point is just after the marker. - * - * Exit: if return TRUE, have read and processed any parameters, and have - * updated the restart point to point after the parameters. - * If return FALSE, was forced to suspend before reaching end of - * marker parameters; restart point has not been moved. Same routine - * will be called again after application supplies more input data. - * - * This approach to suspension assumes that all of a marker's parameters can - * fit into a single input bufferload. This should hold for "normal" - * markers. Some COM/APPn markers might have large parameter segments, - * but we use skip_input_data to get past those, and thereby put the problem - * on the source manager's shoulders. - * - * Note that we don't bother to avoid duplicate trace messages if a - * suspension occurs within marker parameters. Other side effects - * require more care. - */ - - -LOCAL boolean -get_soi (j_decompress_ptr cinfo) -/* Process an SOI marker */ -{ - int i; - - TRACEMS(cinfo, 1, JTRC_SOI); - - if (cinfo->marker->saw_SOI) - ERREXIT(cinfo, JERR_SOI_DUPLICATE); - - /* Reset all parameters that are defined to be reset by SOI */ - - for (i = 0; i < NUM_ARITH_TBLS; i++) { - cinfo->arith_dc_L[i] = 0; - cinfo->arith_dc_U[i] = 1; - cinfo->arith_ac_K[i] = 5; - } - cinfo->restart_interval = 0; - - /* Set initial assumptions for colorspace etc */ - - cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ - - cinfo->saw_JFIF_marker = FALSE; - cinfo->density_unit = 0; /* set default JFIF APP0 values */ - cinfo->X_density = 1; - cinfo->Y_density = 1; - cinfo->saw_Adobe_marker = FALSE; - cinfo->Adobe_transform = 0; - - cinfo->marker->saw_SOI = TRUE; - - return TRUE; -} - - -LOCAL boolean -get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) -/* Process a SOFn marker */ -{ - INT32 length; - int c, ci; - jpeg_component_info * compptr; - INPUT_VARS(cinfo); - - cinfo->progressive_mode = is_prog; - cinfo->arith_code = is_arith; - - INPUT_2BYTES(cinfo, length, return FALSE); - - INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); - INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); - - length -= 8; - - TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, - (int) cinfo->image_width, (int) cinfo->image_height, - cinfo->num_components); - - if (cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOF_DUPLICATE); - - /* We don't support files in which the image height is initially specified */ - /* as 0 and is later redefined by DNL. As long as we have to check that, */ - /* might as well have a general sanity check. */ - if (cinfo->image_height <= 0 || cinfo->image_width <= 0 - || cinfo->num_components <= 0) - ERREXIT(cinfo, JERR_EMPTY_IMAGE); - - if (length != (cinfo->num_components * 3)) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - if (cinfo->comp_info == NULL) /* do only once, even if suspend */ - cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * SIZEOF(jpeg_component_info)); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - compptr->component_index = ci; - INPUT_BYTE(cinfo, compptr->component_id, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); - compptr->h_samp_factor = (c >> 4) & 15; - compptr->v_samp_factor = (c ) & 15; - INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); - - TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, - compptr->component_id, compptr->h_samp_factor, - compptr->v_samp_factor, compptr->quant_tbl_no); - } - - cinfo->marker->saw_SOF = TRUE; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL boolean -get_sos (j_decompress_ptr cinfo) -/* Process a SOS marker */ -{ - INT32 length; - int i, ci, n, c, cc; - jpeg_component_info * compptr; - INPUT_VARS(cinfo); - - if (! cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOS_NO_SOF); - - INPUT_2BYTES(cinfo, length, return FALSE); - - INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ - - if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - TRACEMS1(cinfo, 1, JTRC_SOS, n); - - cinfo->comps_in_scan = n; - - /* Collect the component-spec parameters */ - - for (i = 0; i < n; i++) { - INPUT_BYTE(cinfo, cc, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (cc == compptr->component_id) - goto id_found; - } - - ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); - - id_found: - - cinfo->cur_comp_info[i] = compptr; - compptr->dc_tbl_no = (c >> 4) & 15; - compptr->ac_tbl_no = (c ) & 15; - - TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, - compptr->dc_tbl_no, compptr->ac_tbl_no); - } - - /* Collect the additional scan parameters Ss, Se, Ah/Al. */ - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Ss = c; - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Se = c; - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Ah = (c >> 4) & 15; - cinfo->Al = (c ) & 15; - - TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, - cinfo->Ah, cinfo->Al); - - /* Prepare to scan data & restart markers */ - cinfo->marker->next_restart_num = 0; - - /* Count another SOS marker */ - cinfo->input_scan_number++; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -METHODDEF boolean -get_app0 (j_decompress_ptr cinfo) -/* Process an APP0 marker */ -{ -#define JFIF_LEN 14 - INT32 length; - UINT8 b[JFIF_LEN]; - int buffp; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - /* See if a JFIF APP0 marker is present */ - - if (length >= JFIF_LEN) { - for (buffp = 0; buffp < JFIF_LEN; buffp++) - INPUT_BYTE(cinfo, b[buffp], return FALSE); - length -= JFIF_LEN; - - if (b[0]==0x4A && b[1]==0x46 && b[2]==0x49 && b[3]==0x46 && b[4]==0) { - /* Found JFIF APP0 marker: check version */ - /* Major version must be 1, anything else signals an incompatible change. - * We used to treat this as an error, but now it's a nonfatal warning, - * because some bozo at Hijaak couldn't read the spec. - * Minor version should be 0..2, but process anyway if newer. - */ - if (b[5] != 1) - WARNMS2(cinfo, JWRN_JFIF_MAJOR, b[5], b[6]); - else if (b[6] > 2) - TRACEMS2(cinfo, 1, JTRC_JFIF_MINOR, b[5], b[6]); - /* Save info */ - cinfo->saw_JFIF_marker = TRUE; - cinfo->density_unit = b[7]; - cinfo->X_density = (b[8] << 8) + b[9]; - cinfo->Y_density = (b[10] << 8) + b[11]; - TRACEMS3(cinfo, 1, JTRC_JFIF, - cinfo->X_density, cinfo->Y_density, cinfo->density_unit); - if (b[12] | b[13]) - TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, b[12], b[13]); - if (length != ((INT32) b[12] * (INT32) b[13] * (INT32) 3)) - TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) length); - } else { - /* Start of APP0 does not match "JFIF" */ - TRACEMS1(cinfo, 1, JTRC_APP0, (int) length + JFIF_LEN); - } - } else { - /* Too short to be JFIF marker */ - TRACEMS1(cinfo, 1, JTRC_APP0, (int) length); - } - - INPUT_SYNC(cinfo); - if (length > 0) /* skip any remaining data -- could be lots */ - (*cinfo->src->skip_input_data) (cinfo, (long) length); - - return TRUE; -} - - -METHODDEF boolean -get_app14 (j_decompress_ptr cinfo) -/* Process an APP14 marker */ -{ -#define ADOBE_LEN 12 - INT32 length; - UINT8 b[ADOBE_LEN]; - int buffp; - unsigned int version, flags0, flags1, transform; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - /* See if an Adobe APP14 marker is present */ - - if (length >= ADOBE_LEN) { - for (buffp = 0; buffp < ADOBE_LEN; buffp++) - INPUT_BYTE(cinfo, b[buffp], return FALSE); - length -= ADOBE_LEN; - - if (b[0]==0x41 && b[1]==0x64 && b[2]==0x6F && b[3]==0x62 && b[4]==0x65) { - /* Found Adobe APP14 marker */ - version = (b[5] << 8) + b[6]; - flags0 = (b[7] << 8) + b[8]; - flags1 = (b[9] << 8) + b[10]; - transform = b[11]; - TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform); - cinfo->saw_Adobe_marker = TRUE; - cinfo->Adobe_transform = (UINT8) transform; - } else { - /* Start of APP14 does not match "Adobe" */ - TRACEMS1(cinfo, 1, JTRC_APP14, (int) length + ADOBE_LEN); - } - } else { - /* Too short to be Adobe marker */ - TRACEMS1(cinfo, 1, JTRC_APP14, (int) length); - } - - INPUT_SYNC(cinfo); - if (length > 0) /* skip any remaining data -- could be lots */ - (*cinfo->src->skip_input_data) (cinfo, (long) length); - - return TRUE; -} - - -LOCAL boolean -get_dac (j_decompress_ptr cinfo) -/* Process a DAC marker */ -{ - INT32 length; - int index, val; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 0) { - INPUT_BYTE(cinfo, index, return FALSE); - INPUT_BYTE(cinfo, val, return FALSE); - - length -= 2; - - TRACEMS2(cinfo, 1, JTRC_DAC, index, val); - - if (index < 0 || index >= (2*NUM_ARITH_TBLS)) - ERREXIT1(cinfo, JERR_DAC_INDEX, index); - - if (index >= NUM_ARITH_TBLS) { /* define AC table */ - cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val; - } else { /* define DC table */ - cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F); - cinfo->arith_dc_U[index] = (UINT8) (val >> 4); - if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index]) - ERREXIT1(cinfo, JERR_DAC_VALUE, val); - } - } - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL boolean -get_dht (j_decompress_ptr cinfo) -/* Process a DHT marker */ -{ - INT32 length; - UINT8 bits[17]; - UINT8 huffval[256]; - int i, index, count; - JHUFF_TBL **htblptr; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 0) { - INPUT_BYTE(cinfo, index, return FALSE); - - TRACEMS1(cinfo, 1, JTRC_DHT, index); - - bits[0] = 0; - count = 0; - for (i = 1; i <= 16; i++) { - INPUT_BYTE(cinfo, bits[i], return FALSE); - count += bits[i]; - } - - length -= 1 + 16; - - TRACEMS8(cinfo, 2, JTRC_HUFFBITS, - bits[1], bits[2], bits[3], bits[4], - bits[5], bits[6], bits[7], bits[8]); - TRACEMS8(cinfo, 2, JTRC_HUFFBITS, - bits[9], bits[10], bits[11], bits[12], - bits[13], bits[14], bits[15], bits[16]); - - if (count > 256 || ((INT32) count) > length) - ERREXIT(cinfo, JERR_DHT_COUNTS); - - for (i = 0; i < count; i++) - INPUT_BYTE(cinfo, huffval[i], return FALSE); - - length -= count; - - if (index & 0x10) { /* AC table definition */ - index -= 0x10; - htblptr = &cinfo->ac_huff_tbl_ptrs[index]; - } else { /* DC table definition */ - htblptr = &cinfo->dc_huff_tbl_ptrs[index]; - } - - if (index < 0 || index >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_DHT_INDEX, index); - - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - - MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); - MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); - } - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL boolean -get_dqt (j_decompress_ptr cinfo) -/* Process a DQT marker */ -{ - INT32 length; - int n, i, prec; - unsigned int tmp; - JQUANT_TBL *quant_ptr; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 0) { - INPUT_BYTE(cinfo, n, return FALSE); - prec = n >> 4; - n &= 0x0F; - - TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); - - if (n >= NUM_QUANT_TBLS) - ERREXIT1(cinfo, JERR_DQT_INDEX, n); - - if (cinfo->quant_tbl_ptrs[n] == NULL) - cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); - quant_ptr = cinfo->quant_tbl_ptrs[n]; - - for (i = 0; i < DCTSIZE2; i++) { - if (prec) - INPUT_2BYTES(cinfo, tmp, return FALSE); - else - INPUT_BYTE(cinfo, tmp, return FALSE); - quant_ptr->quantval[i] = (UINT16) tmp; - } - - for (i = 0; i < DCTSIZE2; i += 8) { - TRACEMS8(cinfo, 2, JTRC_QUANTVALS, - quant_ptr->quantval[i ], quant_ptr->quantval[i+1], - quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], - quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], - quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); - } - - length -= DCTSIZE2+1; - if (prec) length -= DCTSIZE2; - } - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL boolean -get_dri (j_decompress_ptr cinfo) -/* Process a DRI marker */ -{ - INT32 length; - unsigned int tmp; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - - if (length != 4) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - INPUT_2BYTES(cinfo, tmp, return FALSE); - - TRACEMS1(cinfo, 1, JTRC_DRI, tmp); - - cinfo->restart_interval = tmp; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -METHODDEF boolean -skip_variable (j_decompress_ptr cinfo) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - INT32 length; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - - TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); - - INPUT_SYNC(cinfo); /* do before skip_input_data */ - (*cinfo->src->skip_input_data) (cinfo, (long) length - 2L); - - return TRUE; -} - - -/* - * Find the next JPEG marker, save it in cinfo->unread_marker. - * Returns FALSE if had to suspend before reaching a marker; - * in that case cinfo->unread_marker is unchanged. - * - * Note that the result might not be a valid marker code, - * but it will never be 0 or FF. - */ - -LOCAL boolean -next_marker (j_decompress_ptr cinfo) -{ - int c; - INPUT_VARS(cinfo); - - for (;;) { - INPUT_BYTE(cinfo, c, return FALSE); - /* Skip any non-FF bytes. - * This may look a bit inefficient, but it will not occur in a valid file. - * We sync after each discarded byte so that a suspending data source - * can discard the byte from its buffer. - */ - while (c != 0xFF) { - cinfo->marker->discarded_bytes++; - INPUT_SYNC(cinfo); - INPUT_BYTE(cinfo, c, return FALSE); - } - /* This loop swallows any duplicate FF bytes. Extra FFs are legal as - * pad bytes, so don't count them in discarded_bytes. We assume there - * will not be so many consecutive FF bytes as to overflow a suspending - * data source's input buffer. - */ - do { - INPUT_BYTE(cinfo, c, return FALSE); - } while (c == 0xFF); - if (c != 0) - break; /* found a valid marker, exit loop */ - /* Reach here if we found a stuffed-zero data sequence (FF/00). - * Discard it and loop back to try again. - */ - cinfo->marker->discarded_bytes += 2; - INPUT_SYNC(cinfo); - } - - if (cinfo->marker->discarded_bytes != 0) { - WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c); - cinfo->marker->discarded_bytes = 0; - } - - cinfo->unread_marker = c; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL boolean -first_marker (j_decompress_ptr cinfo) -/* Like next_marker, but used to obtain the initial SOI marker. */ -/* For this marker, we do not allow preceding garbage or fill; otherwise, - * we might well scan an entire input file before realizing it ain't JPEG. - * If an application wants to process non-JFIF files, it must seek to the - * SOI before calling the JPEG library. - */ -{ - int c, c2; - INPUT_VARS(cinfo); - - INPUT_BYTE(cinfo, c, return FALSE); - INPUT_BYTE(cinfo, c2, return FALSE); - if (c != 0xFF || c2 != (int) M_SOI) - ERREXIT2(cinfo, JERR_NO_SOI, c, c2); - - cinfo->unread_marker = c2; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -/* - * Read markers until SOS or EOI. - * - * Returns same codes as are defined for jpeg_consume_input: - * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - */ - -METHODDEF int -read_markers (j_decompress_ptr cinfo) -{ - /* Outer loop repeats once for each marker. */ - for (;;) { - /* Collect the marker proper, unless we already did. */ - /* NB: first_marker() enforces the requirement that SOI appear first. */ - if (cinfo->unread_marker == 0) { - if (! cinfo->marker->saw_SOI) { - if (! first_marker(cinfo)) - return JPEG_SUSPENDED; - } else { - if (! next_marker(cinfo)) - return JPEG_SUSPENDED; - } - } - /* At this point cinfo->unread_marker contains the marker code and the - * input point is just past the marker proper, but before any parameters. - * A suspension will cause us to return with this state still true. - */ - switch (cinfo->unread_marker) { - case M_SOI: - if (! get_soi(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - if (! get_sof(cinfo, FALSE, FALSE)) - return JPEG_SUSPENDED; - break; - - case M_SOF2: /* Progressive, Huffman */ - if (! get_sof(cinfo, TRUE, FALSE)) - return JPEG_SUSPENDED; - break; - - case M_SOF9: /* Extended sequential, arithmetic */ - if (! get_sof(cinfo, FALSE, TRUE)) - return JPEG_SUSPENDED; - break; - - case M_SOF10: /* Progressive, arithmetic */ - if (! get_sof(cinfo, TRUE, TRUE)) - return JPEG_SUSPENDED; - break; - - /* Currently unsupported SOFn types */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_JPG: /* Reserved for JPEG extensions */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); - break; - - case M_SOS: - if (! get_sos(cinfo)) - return JPEG_SUSPENDED; - cinfo->unread_marker = 0; /* processed the marker */ - return JPEG_REACHED_SOS; - - case M_EOI: - TRACEMS(cinfo, 1, JTRC_EOI); - cinfo->unread_marker = 0; /* processed the marker */ - return JPEG_REACHED_EOI; - - case M_DAC: - if (! get_dac(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DHT: - if (! get_dht(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DQT: - if (! get_dqt(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DRI: - if (! get_dri(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_APP0: - case M_APP1: - case M_APP2: - case M_APP3: - case M_APP4: - case M_APP5: - case M_APP6: - case M_APP7: - case M_APP8: - case M_APP9: - case M_APP10: - case M_APP11: - case M_APP12: - case M_APP13: - case M_APP14: - case M_APP15: - if (! (*cinfo->marker->process_APPn[cinfo->unread_marker - (int) M_APP0]) (cinfo)) - return JPEG_SUSPENDED; - break; - - case M_COM: - if (! (*cinfo->marker->process_COM) (cinfo)) - return JPEG_SUSPENDED; - break; - - case M_RST0: /* these are all parameterless */ - case M_RST1: - case M_RST2: - case M_RST3: - case M_RST4: - case M_RST5: - case M_RST6: - case M_RST7: - case M_TEM: - TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); - break; - - case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ - if (! skip_variable(cinfo)) - return JPEG_SUSPENDED; - break; - - default: /* must be DHP, EXP, JPGn, or RESn */ - /* For now, we treat the reserved markers as fatal errors since they are - * likely to be used to signal incompatible JPEG Part 3 extensions. - * Once the JPEG 3 version-number marker is well defined, this code - * ought to change! - */ - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); - break; - } - /* Successfully processed marker, so reset state variable */ - cinfo->unread_marker = 0; - } /* end loop */ -} - - -/* - * Read a restart marker, which is expected to appear next in the datastream; - * if the marker is not there, take appropriate recovery action. - * Returns FALSE if suspension is required. - * - * This is called by the entropy decoder after it has read an appropriate - * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder - * has already read a marker from the data source. Under normal conditions - * cinfo->unread_marker will be reset to 0 before returning; if not reset, - * it holds a marker which the decoder will be unable to read past. - */ - -METHODDEF boolean -read_restart_marker (j_decompress_ptr cinfo) -{ - /* Obtain a marker unless we already did. */ - /* Note that next_marker will complain if it skips any data. */ - if (cinfo->unread_marker == 0) { - if (! next_marker(cinfo)) - return FALSE; - } - - if (cinfo->unread_marker == - ((int) M_RST0 + cinfo->marker->next_restart_num)) { - /* Normal case --- swallow the marker and let entropy decoder continue */ - TRACEMS1(cinfo, 2, JTRC_RST, cinfo->marker->next_restart_num); - cinfo->unread_marker = 0; - } else { - /* Uh-oh, the restart markers have been messed up. */ - /* Let the data source manager determine how to resync. */ - if (! (*cinfo->src->resync_to_restart) (cinfo, - cinfo->marker->next_restart_num)) - return FALSE; - } - - /* Update next-restart state */ - cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; - - return TRUE; -} - - -/* - * This is the default resync_to_restart method for data source managers - * to use if they don't have any better approach. Some data source managers - * may be able to back up, or may have additional knowledge about the data - * which permits a more intelligent recovery strategy; such managers would - * presumably supply their own resync method. - * - * read_restart_marker calls resync_to_restart if it finds a marker other than - * the restart marker it was expecting. (This code is *not* used unless - * a nonzero restart interval has been declared.) cinfo->unread_marker is - * the marker code actually found (might be anything, except 0 or FF). - * The desired restart marker number (0..7) is passed as a parameter. - * This routine is supposed to apply whatever error recovery strategy seems - * appropriate in order to position the input stream to the next data segment. - * Note that cinfo->unread_marker is treated as a marker appearing before - * the current data-source input point; usually it should be reset to zero - * before returning. - * Returns FALSE if suspension is required. - * - * This implementation is substantially constrained by wanting to treat the - * input as a data stream; this means we can't back up. Therefore, we have - * only the following actions to work with: - * 1. Simply discard the marker and let the entropy decoder resume at next - * byte of file. - * 2. Read forward until we find another marker, discarding intervening - * data. (In theory we could look ahead within the current bufferload, - * without having to discard data if we don't find the desired marker. - * This idea is not implemented here, in part because it makes behavior - * dependent on buffer size and chance buffer-boundary positions.) - * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). - * This will cause the entropy decoder to process an empty data segment, - * inserting dummy zeroes, and then we will reprocess the marker. - * - * #2 is appropriate if we think the desired marker lies ahead, while #3 is - * appropriate if the found marker is a future restart marker (indicating - * that we have missed the desired restart marker, probably because it got - * corrupted). - * We apply #2 or #3 if the found marker is a restart marker no more than - * two counts behind or ahead of the expected one. We also apply #2 if the - * found marker is not a legal JPEG marker code (it's certainly bogus data). - * If the found marker is a restart marker more than 2 counts away, we do #1 - * (too much risk that the marker is erroneous; with luck we will be able to - * resync at some future point). - * For any valid non-restart JPEG marker, we apply #3. This keeps us from - * overrunning the end of a scan. An implementation limited to single-scan - * files might find it better to apply #2 for markers other than EOI, since - * any other marker would have to be bogus data in that case. - */ - -GLOBAL boolean -jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) -{ - int marker = cinfo->unread_marker; - int action = 1; - - /* Always put up a warning. */ - WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); - - /* Outer loop handles repeated decision after scanning forward. */ - for (;;) { - if (marker < (int) M_SOF0) - action = 2; /* invalid marker */ - else if (marker < (int) M_RST0 || marker > (int) M_RST7) - action = 3; /* valid non-restart marker */ - else { - if (marker == ((int) M_RST0 + ((desired+1) & 7)) || - marker == ((int) M_RST0 + ((desired+2) & 7))) - action = 3; /* one of the next two expected restarts */ - else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || - marker == ((int) M_RST0 + ((desired-2) & 7))) - action = 2; /* a prior restart, so advance */ - else - action = 1; /* desired restart or too far away */ - } - TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); - switch (action) { - case 1: - /* Discard marker and let entropy decoder resume processing. */ - cinfo->unread_marker = 0; - return TRUE; - case 2: - /* Scan to the next marker, and repeat the decision loop. */ - if (! next_marker(cinfo)) - return FALSE; - marker = cinfo->unread_marker; - break; - case 3: - /* Return without advancing past this marker. */ - /* Entropy decoder will be forced to process an empty segment. */ - return TRUE; - } - } /* end loop */ -} - - -/* - * Reset marker processing state to begin a fresh datastream. - */ - -METHODDEF void -reset_marker_reader (j_decompress_ptr cinfo) -{ - cinfo->comp_info = NULL; /* until allocated by get_sof */ - cinfo->input_scan_number = 0; /* no SOS seen yet */ - cinfo->unread_marker = 0; /* no pending marker */ - cinfo->marker->saw_SOI = FALSE; /* set internal state too */ - cinfo->marker->saw_SOF = FALSE; - cinfo->marker->discarded_bytes = 0; -} - - -/* - * Initialize the marker reader module. - * This is called only once, when the decompression object is created. - */ - -GLOBAL void -jinit_marker_reader (j_decompress_ptr cinfo) -{ - int i; - - /* Create subobject in permanent pool */ - cinfo->marker = (struct jpeg_marker_reader *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(struct jpeg_marker_reader)); - /* Initialize method pointers */ - cinfo->marker->reset_marker_reader = reset_marker_reader; - cinfo->marker->read_markers = read_markers; - cinfo->marker->read_restart_marker = read_restart_marker; - cinfo->marker->process_COM = skip_variable; - for (i = 0; i < 16; i++) - cinfo->marker->process_APPn[i] = skip_variable; - cinfo->marker->process_APPn[0] = get_app0; - cinfo->marker->process_APPn[14] = get_app14; - /* Reset marker processing state */ - reset_marker_reader(cinfo); -} diff --git a/libs/jpeg6/jdmaster.cpp b/libs/jpeg6/jdmaster.cpp deleted file mode 100644 index 6d38f604..00000000 --- a/libs/jpeg6/jdmaster.cpp +++ /dev/null @@ -1,558 +0,0 @@ -/* - * jdmaster.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains master control logic for the JPEG decompressor. - * These routines are concerned with selecting the modules to be executed - * and with determining the number of passes and the work to be done in each - * pass. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Private state */ - -typedef struct { - struct jpeg_decomp_master pub; /* public fields */ - - int pass_number; /* # of passes completed */ - - boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ - - /* Saved references to initialized quantizer modules, - * in case we need to switch modes. - */ - struct jpeg_color_quantizer * quantizer_1pass; - struct jpeg_color_quantizer * quantizer_2pass; -} my_decomp_master; - -typedef my_decomp_master * my_master_ptr; - - -/* - * Determine whether merged upsample/color conversion should be used. - * CRUCIAL: this must match the actual capabilities of jdmerge.c! - */ - -LOCAL boolean -use_merged_upsample (j_decompress_ptr cinfo) -{ -#ifdef UPSAMPLE_MERGING_SUPPORTED - /* Merging is the equivalent of plain box-filter upsampling */ - if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) - return FALSE; - /* jdmerge.c only supports YCC=>RGB color conversion */ - if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || - cinfo->out_color_space != JCS_RGB || - cinfo->out_color_components != RGB_PIXELSIZE) - return FALSE; - /* and it only handles 2h1v or 2h2v sampling ratios */ - if (cinfo->comp_info[0].h_samp_factor != 2 || - cinfo->comp_info[1].h_samp_factor != 1 || - cinfo->comp_info[2].h_samp_factor != 1 || - cinfo->comp_info[0].v_samp_factor > 2 || - cinfo->comp_info[1].v_samp_factor != 1 || - cinfo->comp_info[2].v_samp_factor != 1) - return FALSE; - /* furthermore, it doesn't work if we've scaled the IDCTs differently */ - if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size || - cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size || - cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size) - return FALSE; - /* ??? also need to test for upsample-time rescaling, when & if supported */ - return TRUE; /* by golly, it'll work... */ -#else - return FALSE; -#endif -} - - -/* - * Compute output image dimensions and related values. - * NOTE: this is exported for possible use by application. - * Hence it mustn't do anything that can't be done twice. - * Also note that it may be called before the master module is initialized! - */ - -GLOBAL void -jpeg_calc_output_dimensions (j_decompress_ptr cinfo) -/* Do computations that are needed before master selection phase */ -{ -#if 0 // JDC: commented out to remove warning - int ci; - jpeg_component_info *compptr; -#endif - - /* Prevent application from calling me at wrong times */ - if (cinfo->global_state != DSTATE_READY) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - -#ifdef IDCT_SCALING_SUPPORTED - - /* Compute actual output image dimensions and DCT scaling choices. */ - if (cinfo->scale_num * 8 <= cinfo->scale_denom) { - /* Provide 1/8 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 8L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 8L); - cinfo->min_DCT_scaled_size = 1; - } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) { - /* Provide 1/4 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 4L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 4L); - cinfo->min_DCT_scaled_size = 2; - } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) { - /* Provide 1/2 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 2L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 2L); - cinfo->min_DCT_scaled_size = 4; - } else { - /* Provide 1/1 scaling */ - cinfo->output_width = cinfo->image_width; - cinfo->output_height = cinfo->image_height; - cinfo->min_DCT_scaled_size = DCTSIZE; - } - /* In selecting the actual DCT scaling for each component, we try to - * scale up the chroma components via IDCT scaling rather than upsampling. - * This saves time if the upsampler gets to use 1:1 scaling. - * Note this code assumes that the supported DCT scalings are powers of 2. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - int ssize = cinfo->min_DCT_scaled_size; - while (ssize < DCTSIZE && - (compptr->h_samp_factor * ssize * 2 <= - cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) && - (compptr->v_samp_factor * ssize * 2 <= - cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) { - ssize = ssize * 2; - } - compptr->DCT_scaled_size = ssize; - } - - /* Recompute downsampled dimensions of components; - * application needs to know these if using raw downsampled data. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Size in samples, after IDCT scaling */ - compptr->downsampled_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * - (long) (compptr->h_samp_factor * compptr->DCT_scaled_size), - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - compptr->downsampled_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * - (long) (compptr->v_samp_factor * compptr->DCT_scaled_size), - (long) (cinfo->max_v_samp_factor * DCTSIZE)); - } - -#else /* !IDCT_SCALING_SUPPORTED */ - - /* Hardwire it to "no scaling" */ - cinfo->output_width = cinfo->image_width; - cinfo->output_height = cinfo->image_height; - /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE, - * and has computed unscaled downsampled_width and downsampled_height. - */ - -#endif /* IDCT_SCALING_SUPPORTED */ - - /* Report number of components in selected colorspace. */ - /* Probably this should be in the color conversion module... */ - switch (cinfo->out_color_space) { - case JCS_GRAYSCALE: - cinfo->out_color_components = 1; - break; - case JCS_RGB: -#if RGB_PIXELSIZE != 3 - cinfo->out_color_components = RGB_PIXELSIZE; - break; -#endif /* else share code with YCbCr */ - case JCS_YCbCr: - cinfo->out_color_components = 3; - break; - case JCS_CMYK: - case JCS_YCCK: - cinfo->out_color_components = 4; - break; - default: /* else must be same colorspace as in file */ - cinfo->out_color_components = cinfo->num_components; - break; - } - cinfo->output_components = (cinfo->quantize_colors ? 1 : - cinfo->out_color_components); - - /* See if upsampler will want to emit more than one row at a time */ - if (use_merged_upsample(cinfo)) - cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; - else - cinfo->rec_outbuf_height = 1; -} - - -/* - * Several decompression processes need to range-limit values to the range - * 0..MAXJSAMPLE; the input value may fall somewhat outside this range - * due to noise introduced by quantization, roundoff error, etc. These - * processes are inner loops and need to be as fast as possible. On most - * machines, particularly CPUs with pipelines or instruction prefetch, - * a (subscript-check-less) C table lookup - * x = sample_range_limit[x]; - * is faster than explicit tests - * if (x < 0) x = 0; - * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; - * These processes all use a common table prepared by the routine below. - * - * For most steps we can mathematically guarantee that the initial value - * of x is within MAXJSAMPLE+1 of the legal range, so a table running from - * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial - * limiting step (just after the IDCT), a wildly out-of-range value is - * possible if the input data is corrupt. To avoid any chance of indexing - * off the end of memory and getting a bad-pointer trap, we perform the - * post-IDCT limiting thus: - * x = range_limit[x & MASK]; - * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit - * samples. Under normal circumstances this is more than enough range and - * a correct output will be generated; with bogus input data the mask will - * cause wraparound, and we will safely generate a bogus-but-in-range output. - * For the post-IDCT step, we want to convert the data from signed to unsigned - * representation by adding CENTERJSAMPLE at the same time that we limit it. - * So the post-IDCT limiting table ends up looking like this: - * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, - * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0,1,...,CENTERJSAMPLE-1 - * Negative inputs select values from the upper half of the table after - * masking. - * - * We can save some space by overlapping the start of the post-IDCT table - * with the simpler range limiting table. The post-IDCT table begins at - * sample_range_limit + CENTERJSAMPLE. - * - * Note that the table is allocated in near data space on PCs; it's small - * enough and used often enough to justify this. - */ - -LOCAL void -prepare_range_limit_table (j_decompress_ptr cinfo) -/* Allocate and fill in the sample_range_limit table */ -{ - JSAMPLE * table; - int i; - - table = (JSAMPLE *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ - cinfo->sample_range_limit = table; - /* First segment of "simple" table: limit[x] = 0 for x < 0 */ - MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); - /* Main part of "simple" table: limit[x] = x */ - for (i = 0; i <= MAXJSAMPLE; i++) - table[i] = (JSAMPLE) i; - table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ - /* End of simple table, rest of first half of post-IDCT table */ - for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) - table[i] = MAXJSAMPLE; - /* Second half of post-IDCT table */ - MEMZERO(table + (2 * (MAXJSAMPLE+1)), - (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), - cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); -} - - -/* - * Master selection of decompression modules. - * This is done once at jpeg_start_decompress time. We determine - * which modules will be used and give them appropriate initialization calls. - * We also initialize the decompressor input side to begin consuming data. - * - * Since jpeg_read_header has finished, we know what is in the SOF - * and (first) SOS markers. We also have all the application parameter - * settings. - */ - -LOCAL void -master_selection (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - boolean use_c_buffer; - long samplesperrow; - JDIMENSION jd_samplesperrow; - - /* Initialize dimensions and other stuff */ - jpeg_calc_output_dimensions(cinfo); - prepare_range_limit_table(cinfo); - - /* Width of an output scanline must be representable as JDIMENSION. */ - samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; - jd_samplesperrow = (JDIMENSION) samplesperrow; - if ((long) jd_samplesperrow != samplesperrow) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - - /* Initialize my private state */ - master->pass_number = 0; - master->using_merged_upsample = use_merged_upsample(cinfo); - - /* Color quantizer selection */ - master->quantizer_1pass = NULL; - master->quantizer_2pass = NULL; - /* No mode changes if not using buffered-image mode. */ - if (! cinfo->quantize_colors || ! cinfo->buffered_image) { - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; - } - if (cinfo->quantize_colors) { - if (cinfo->raw_data_out) - ERREXIT(cinfo, JERR_NOTIMPL); - /* 2-pass quantizer only works in 3-component color space. */ - if (cinfo->out_color_components != 3) { - cinfo->enable_1pass_quant = TRUE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; - cinfo->colormap = NULL; - } else if (cinfo->colormap != NULL) { - cinfo->enable_external_quant = TRUE; - } else if (cinfo->two_pass_quantize) { - cinfo->enable_2pass_quant = TRUE; - } else { - cinfo->enable_1pass_quant = TRUE; - } - - if (cinfo->enable_1pass_quant) { -#ifdef QUANT_1PASS_SUPPORTED - jinit_1pass_quantizer(cinfo); - master->quantizer_1pass = cinfo->cquantize; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } - - /* We use the 2-pass code to map to external colormaps. */ - if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { -#ifdef QUANT_2PASS_SUPPORTED - jinit_2pass_quantizer(cinfo); - master->quantizer_2pass = cinfo->cquantize; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } - /* If both quantizers are initialized, the 2-pass one is left active; - * this is necessary for starting with quantization to an external map. - */ - } - - /* Post-processing: in particular, color conversion first */ - if (! cinfo->raw_data_out) { - if (master->using_merged_upsample) { -#ifdef UPSAMPLE_MERGING_SUPPORTED - jinit_merged_upsampler(cinfo); /* does color conversion too */ -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - jinit_color_deconverter(cinfo); - jinit_upsampler(cinfo); - } - jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); - } - /* Inverse DCT */ - jinit_inverse_dct(cinfo); - /* Entropy decoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef D_PROGRESSIVE_SUPPORTED - jinit_phuff_decoder(cinfo); -#else - ERREXIT(cinfo, JERR_NO_PROGRESSIVE); -#endif - } else - jinit_huff_decoder(cinfo); - } - - /* Initialize principal buffer controllers. */ - use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; - jinit_d_coef_controller(cinfo, use_c_buffer); - - if (! cinfo->raw_data_out) - jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Initialize input side of decompressor to consume first scan. */ - (*cinfo->inputctl->start_input_pass) (cinfo); - -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* If jpeg_start_decompress will read the whole file, initialize - * progress monitoring appropriately. The input step is counted - * as one pass. - */ - if (cinfo->progress != NULL && ! cinfo->buffered_image && - cinfo->inputctl->has_multiple_scans) { - int nscans; - /* Estimate number of scans to set pass_limit. */ - if (cinfo->progressive_mode) { - /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ - nscans = 2 + 3 * cinfo->num_components; - } else { - /* For a nonprogressive multiscan file, estimate 1 scan per component. */ - nscans = cinfo->num_components; - } - cinfo->progress->pass_counter = 0L; - cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; - cinfo->progress->completed_passes = 0; - cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); - /* Count the input pass as done */ - master->pass_number++; - } -#endif /* D_MULTISCAN_FILES_SUPPORTED */ -} - - -/* - * Per-pass setup. - * This is called at the beginning of each output pass. We determine which - * modules will be active during this pass and give them appropriate - * start_pass calls. We also set is_dummy_pass to indicate whether this - * is a "real" output pass or a dummy pass for color quantization. - * (In the latter case, jdapi.c will crank the pass to completion.) - */ - -METHODDEF void -prepare_for_output_pass (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - if (master->pub.is_dummy_pass) { -#ifdef QUANT_2PASS_SUPPORTED - /* Final pass of 2-pass quantization */ - master->pub.is_dummy_pass = FALSE; - (*cinfo->cquantize->start_pass) (cinfo, FALSE); - (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); - (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* QUANT_2PASS_SUPPORTED */ - } else { - if (cinfo->quantize_colors && cinfo->colormap == NULL) { - /* Select new quantization method */ - if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { - cinfo->cquantize = master->quantizer_2pass; - master->pub.is_dummy_pass = TRUE; - } else if (cinfo->enable_1pass_quant) { - cinfo->cquantize = master->quantizer_1pass; - } else { - ERREXIT(cinfo, JERR_MODE_CHANGE); - } - } - (*cinfo->idct->start_pass) (cinfo); - (*cinfo->coef->start_output_pass) (cinfo); - if (! cinfo->raw_data_out) { - if (! master->using_merged_upsample) - (*cinfo->cconvert->start_pass) (cinfo); - (*cinfo->upsample->start_pass) (cinfo); - if (cinfo->quantize_colors) - (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); - (*cinfo->post->start_pass) (cinfo, - (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); - (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); - } - } - - /* Set up progress monitor's pass info if present */ - if (cinfo->progress != NULL) { - cinfo->progress->completed_passes = master->pass_number; - cinfo->progress->total_passes = master->pass_number + - (master->pub.is_dummy_pass ? 2 : 1); - /* In buffered-image mode, we assume one more output pass if EOI not - * yet reached, but no more passes if EOI has been reached. - */ - if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { - cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); - } - } -} - - -/* - * Finish up at end of an output pass. - */ - -METHODDEF void -finish_output_pass (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - if (cinfo->quantize_colors) - (*cinfo->cquantize->finish_pass) (cinfo); - master->pass_number++; -} - - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Switch to a new external colormap between output passes. - */ - -GLOBAL void -jpeg_new_colormap (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - /* Prevent application from calling me at wrong times */ - if (cinfo->global_state != DSTATE_BUFIMAGE) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - if (cinfo->quantize_colors && cinfo->enable_external_quant && - cinfo->colormap != NULL) { - /* Select 2-pass quantizer for external colormap use */ - cinfo->cquantize = master->quantizer_2pass; - /* Notify quantizer of colormap change */ - (*cinfo->cquantize->new_color_map) (cinfo); - master->pub.is_dummy_pass = FALSE; /* just in case */ - } else - ERREXIT(cinfo, JERR_MODE_CHANGE); -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - - -/* - * Initialize master decompression control and select active modules. - * This is performed at the start of jpeg_start_decompress. - */ - -GLOBAL void -jinit_master_decompress (j_decompress_ptr cinfo) -{ - my_master_ptr master; - - master = (my_master_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_decomp_master)); - cinfo->master = (struct jpeg_decomp_master *) master; - master->pub.prepare_for_output_pass = prepare_for_output_pass; - master->pub.finish_output_pass = finish_output_pass; - - master->pub.is_dummy_pass = FALSE; - - master_selection(cinfo); -} - diff --git a/libs/jpeg6/jdpostct.cpp b/libs/jpeg6/jdpostct.cpp deleted file mode 100644 index e8b934cc..00000000 --- a/libs/jpeg6/jdpostct.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* - * jdpostct.c - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the decompression postprocessing controller. - * This controller manages the upsampling, color conversion, and color - * quantization/reduction steps; specifically, it controls the buffering - * between upsample/color conversion and color quantization/reduction. - * - * If no color quantization/reduction is required, then this module has no - * work to do, and it just hands off to the upsample/color conversion code. - * An integrated upsample/convert/quantize process would replace this module - * entirely. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_post_controller pub; /* public fields */ - - /* Color quantization source buffer: this holds output data from - * the upsample/color conversion step to be passed to the quantizer. - * For two-pass color quantization, we need a full-image buffer; - * for one-pass operation, a strip buffer is sufficient. - */ - jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ - JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ - JDIMENSION strip_height; /* buffer size in rows */ - /* for two-pass mode only: */ - JDIMENSION starting_row; /* row # of first row in current strip */ - JDIMENSION next_row; /* index of next row to fill/empty in strip */ -} my_post_controller; - -typedef my_post_controller * my_post_ptr; - - -/* Forward declarations */ -METHODDEF void post_process_1pass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -#ifdef QUANT_2PASS_SUPPORTED -METHODDEF void post_process_prepass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -METHODDEF void post_process_2pass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -#endif - - -/* - * Initialize for a processing pass. - */ - -METHODDEF void -start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - - switch (pass_mode) { - case JBUF_PASS_THRU: - if (cinfo->quantize_colors) { - /* Single-pass processing with color quantization. */ - post->pub.post_process_data = post_process_1pass; - /* We could be doing buffered-image output before starting a 2-pass - * color quantization; in that case, jinit_d_post_controller did not - * allocate a strip buffer. Use the virtual-array buffer as workspace. - */ - if (post->buffer == NULL) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - (JDIMENSION) 0, post->strip_height, TRUE); - } - } else { - /* For single-pass processing without color quantization, - * I have no work to do; just call the upsampler directly. - */ - post->pub.post_process_data = cinfo->upsample->upsample; - } - break; -#ifdef QUANT_2PASS_SUPPORTED - case JBUF_SAVE_AND_PASS: - /* First pass of 2-pass quantization */ - if (post->whole_image == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - post->pub.post_process_data = post_process_prepass; - break; - case JBUF_CRANK_DEST: - /* Second pass of 2-pass quantization */ - if (post->whole_image == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - post->pub.post_process_data = post_process_2pass; - break; -#endif /* QUANT_2PASS_SUPPORTED */ - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } - post->starting_row = post->next_row = 0; -} - - -/* - * Process some data in the one-pass (strip buffer) case. - * This is used for color precision reduction as well as one-pass quantization. - */ - -METHODDEF void -post_process_1pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION num_rows, max_rows; - - /* Fill the buffer, but not more than what we can dump out in one go. */ - /* Note we rely on the upsampler to detect bottom of image. */ - max_rows = out_rows_avail - *out_row_ctr; - if (max_rows > post->strip_height) - max_rows = post->strip_height; - num_rows = 0; - (*cinfo->upsample->upsample) (cinfo, - input_buf, in_row_group_ctr, in_row_groups_avail, - post->buffer, &num_rows, max_rows); - /* Quantize and emit data. */ - (*cinfo->cquantize->color_quantize) (cinfo, - post->buffer, output_buf + *out_row_ctr, (int) num_rows); - *out_row_ctr += num_rows; -} - - -#ifdef QUANT_2PASS_SUPPORTED - -/* - * Process some data in the first pass of 2-pass quantization. - */ - -METHODDEF void -post_process_prepass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION old_next_row, num_rows; - - /* Reposition virtual buffer if at start of strip. */ - if (post->next_row == 0) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - post->starting_row, post->strip_height, TRUE); - } - - /* Upsample some data (up to a strip height's worth). */ - old_next_row = post->next_row; - (*cinfo->upsample->upsample) (cinfo, - input_buf, in_row_group_ctr, in_row_groups_avail, - post->buffer, &post->next_row, post->strip_height); - - /* Allow quantizer to scan new data. No data is emitted, */ - /* but we advance out_row_ctr so outer loop can tell when we're done. */ - if (post->next_row > old_next_row) { - num_rows = post->next_row - old_next_row; - (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, - (JSAMPARRAY) NULL, (int) num_rows); - *out_row_ctr += num_rows; - } - - /* Advance if we filled the strip. */ - if (post->next_row >= post->strip_height) { - post->starting_row += post->strip_height; - post->next_row = 0; - } -} - - -/* - * Process some data in the second pass of 2-pass quantization. - */ - -METHODDEF void -post_process_2pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION num_rows, max_rows; - - /* Reposition virtual buffer if at start of strip. */ - if (post->next_row == 0) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - post->starting_row, post->strip_height, FALSE); - } - - /* Determine number of rows to emit. */ - num_rows = post->strip_height - post->next_row; /* available in strip */ - max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ - if (num_rows > max_rows) - num_rows = max_rows; - /* We have to check bottom of image here, can't depend on upsampler. */ - max_rows = cinfo->output_height - post->starting_row; - if (num_rows > max_rows) - num_rows = max_rows; - - /* Quantize and emit data. */ - (*cinfo->cquantize->color_quantize) (cinfo, - post->buffer + post->next_row, output_buf + *out_row_ctr, - (int) num_rows); - *out_row_ctr += num_rows; - - /* Advance if we filled the strip. */ - post->next_row += num_rows; - if (post->next_row >= post->strip_height) { - post->starting_row += post->strip_height; - post->next_row = 0; - } -} - -#endif /* QUANT_2PASS_SUPPORTED */ - - -/* - * Initialize postprocessing controller. - */ - -GLOBAL void -jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) -{ - my_post_ptr post; - - post = (my_post_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_post_controller)); - cinfo->post = (struct jpeg_d_post_controller *) post; - post->pub.start_pass = start_pass_dpost; - post->whole_image = NULL; /* flag for no virtual arrays */ - post->buffer = NULL; /* flag for no strip buffer */ - - /* Create the quantization buffer, if needed */ - if (cinfo->quantize_colors) { - /* The buffer strip height is max_v_samp_factor, which is typically - * an efficient number of rows for upsampling to return. - * (In the presence of output rescaling, we might want to be smarter?) - */ - post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; - if (need_full_buffer) { - /* Two-pass color quantization: need full-image storage. */ - /* We round up the number of rows to a multiple of the strip height. */ -#ifdef QUANT_2PASS_SUPPORTED - post->whole_image = (*cinfo->mem->request_virt_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - cinfo->output_width * cinfo->out_color_components, - (JDIMENSION) jround_up((long) cinfo->output_height, - (long) post->strip_height), - post->strip_height); -#else - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); -#endif /* QUANT_2PASS_SUPPORTED */ - } else { - /* One-pass color quantization: just make a strip buffer. */ - post->buffer = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->output_width * cinfo->out_color_components, - post->strip_height); - } - } -} diff --git a/libs/jpeg6/jdsample.cpp b/libs/jpeg6/jdsample.cpp deleted file mode 100644 index f53ceaf3..00000000 --- a/libs/jpeg6/jdsample.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/* - * jdsample.c - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains upsampling routines. - * - * Upsampling input data is counted in "row groups". A row group - * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) - * sample rows of each component. Upsampling will normally produce - * max_v_samp_factor pixel rows from each row group (but this could vary - * if the upsampler is applying a scale factor of its own). - * - * An excellent reference for image resampling is - * Digital Image Warping, George Wolberg, 1990. - * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Pointer to routine to upsample a single component */ -typedef JMETHOD(void, upsample1_ptr, - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); - -/* Private subobject */ - -typedef struct { - struct jpeg_upsampler pub; /* public fields */ - - /* Color conversion buffer. When using separate upsampling and color - * conversion steps, this buffer holds one upsampled row group until it - * has been color converted and output. - * Note: we do not allocate any storage for component(s) which are full-size, - * ie do not need rescaling. The corresponding entry of color_buf[] is - * simply set to point to the input data array, thereby avoiding copying. - */ - JSAMPARRAY color_buf[MAX_COMPONENTS]; - - /* Per-component upsampling method pointers */ - upsample1_ptr methods[MAX_COMPONENTS]; - - int next_row_out; /* counts rows emitted from color_buf */ - JDIMENSION rows_to_go; /* counts rows remaining in image */ - - /* Height of an input row group for each component. */ - int rowgroup_height[MAX_COMPONENTS]; - - /* These arrays save pixel expansion factors so that int_expand need not - * recompute them each time. They are unused for other upsampling methods. - */ - UINT8 h_expand[MAX_COMPONENTS]; - UINT8 v_expand[MAX_COMPONENTS]; -} my_upsampler; - -typedef my_upsampler * my_upsample_ptr; - - -/* - * Initialize for an upsampling pass. - */ - -METHODDEF void -start_pass_upsample (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - - /* Mark the conversion buffer empty */ - upsample->next_row_out = cinfo->max_v_samp_factor; - /* Initialize total-height counter for detecting bottom of image */ - upsample->rows_to_go = cinfo->output_height; -} - - -/* - * Control routine to do upsampling (and color conversion). - * - * In this version we upsample each component independently. - * We upsample one row group into the conversion buffer, then apply - * color conversion a row at a time. - */ - -METHODDEF void -sep_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - int ci; - jpeg_component_info * compptr; - JDIMENSION num_rows; - - /* Fill the conversion buffer, if it's empty */ - if (upsample->next_row_out >= cinfo->max_v_samp_factor) { - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Invoke per-component upsample method. Notice we pass a POINTER - * to color_buf[ci], so that fullsize_upsample can change it. - */ - (*upsample->methods[ci]) (cinfo, compptr, - input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]), - upsample->color_buf + ci); - } - upsample->next_row_out = 0; - } - - /* Color-convert and emit rows */ - - /* How many we have in the buffer: */ - num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); - /* Not more than the distance to the end of the image. Need this test - * in case the image height is not a multiple of max_v_samp_factor: - */ - if (num_rows > upsample->rows_to_go) - num_rows = upsample->rows_to_go; - /* And not more than what the client can accept: */ - out_rows_avail -= *out_row_ctr; - if (num_rows > out_rows_avail) - num_rows = out_rows_avail; - - (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, - (JDIMENSION) upsample->next_row_out, - output_buf + *out_row_ctr, - (int) num_rows); - - /* Adjust counts */ - *out_row_ctr += num_rows; - upsample->rows_to_go -= num_rows; - upsample->next_row_out += num_rows; - /* When the buffer is emptied, declare this input row group consumed */ - if (upsample->next_row_out >= cinfo->max_v_samp_factor) - (*in_row_group_ctr)++; -} - - -/* - * These are the routines invoked by sep_upsample to upsample pixel values - * of a single component. One row group is processed per call. - */ - - -/* - * For full-size components, we just make color_buf[ci] point at the - * input buffer, and thus avoid copying any data. Note that this is - * safe only because sep_upsample doesn't declare the input row group - * "consumed" until we are done color converting and emitting it. - */ - -METHODDEF void -fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - *output_data_ptr = input_data; -} - - -/* - * This is a no-op version used for "uninteresting" components. - * These components will not be referenced by color conversion. - */ - -METHODDEF void -noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - *output_data_ptr = NULL; /* safety check */ -} - - -/* - * This version handles any integral sampling ratios. - * This is not used for typical JPEG files, so it need not be fast. - * Nor, for that matter, is it particularly accurate: the algorithm is - * simple replication of the input pixel onto the corresponding output - * pixels. The hi-falutin sampling literature refers to this as a - * "box filter". A box filter tends to introduce visible artifacts, - * so if you are actually going to use 3:1 or 4:1 sampling ratios - * you would be well advised to improve this code. - */ - -METHODDEF void -int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - register int h; - JSAMPROW outend; - int h_expand, v_expand; - int inrow, outrow; - - h_expand = upsample->h_expand[compptr->component_index]; - v_expand = upsample->v_expand[compptr->component_index]; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - /* Generate one output row with proper horizontal expansion */ - inptr = input_data[inrow]; - outptr = output_data[outrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - for (h = h_expand; h > 0; h--) { - *outptr++ = invalue; - } - } - /* Generate any additional output rows by duplicating the first one */ - if (v_expand > 1) { - jcopy_sample_rows(output_data, outrow, output_data, outrow+1, - v_expand-1, cinfo->output_width); - } - inrow++; - outrow += v_expand; - } -} - - -/* - * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. - * It's still a box filter. - */ - -METHODDEF void -h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - JSAMPROW outend; - int inrow; - - for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { - inptr = input_data[inrow]; - outptr = output_data[inrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - *outptr++ = invalue; - *outptr++ = invalue; - } - } -} - - -/* - * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. - * It's still a box filter. - */ - -METHODDEF void -h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - JSAMPROW outend; - int inrow, outrow; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - inptr = input_data[inrow]; - outptr = output_data[outrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - *outptr++ = invalue; - *outptr++ = invalue; - } - jcopy_sample_rows(output_data, outrow, output_data, outrow+1, - 1, cinfo->output_width); - inrow++; - outrow += 2; - } -} - - -/* - * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. - * - * The upsampling algorithm is linear interpolation between pixel centers, - * also known as a "triangle filter". This is a good compromise between - * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 - * of the way between input pixel centers. - * - * A note about the "bias" calculations: when rounding fractional values to - * integer, we do not want to always round 0.5 up to the next integer. - * If we did that, we'd introduce a noticeable bias towards larger values. - * Instead, this code is arranged so that 0.5 will be rounded up or down at - * alternate pixel locations (a simple ordered dither pattern). - */ - -METHODDEF void -h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register int invalue; - register JDIMENSION colctr; - int inrow; - - for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { - inptr = input_data[inrow]; - outptr = output_data[inrow]; - /* Special case for first column */ - invalue = GETJSAMPLE(*inptr++); - *outptr++ = (JSAMPLE) invalue; - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); - - for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ - invalue = GETJSAMPLE(*inptr++) * 3; - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); - } - - /* Special case for last column */ - invalue = GETJSAMPLE(*inptr); - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); - *outptr++ = (JSAMPLE) invalue; - } -} - - -/* - * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. - * Again a triangle filter; see comments for h2v1 case, above. - * - * It is OK for us to reference the adjacent input rows because we demanded - * context from the main buffer controller (see initialization code). - */ - -METHODDEF void -h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr0, inptr1, outptr; -#if BITS_IN_JSAMPLE == 8 - register int thiscolsum, lastcolsum, nextcolsum; -#else - register INT32 thiscolsum, lastcolsum, nextcolsum; -#endif - register JDIMENSION colctr; - int inrow, outrow, v; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - for (v = 0; v < 2; v++) { - /* inptr0 points to nearest input row, inptr1 points to next nearest */ - inptr0 = input_data[inrow]; - if (v == 0) /* next nearest is row above */ - inptr1 = input_data[inrow-1]; - else /* next nearest is row below */ - inptr1 = input_data[inrow+1]; - outptr = output_data[outrow++]; - - /* Special case for first column */ - thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - - for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ - /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - } - - /* Special case for last column */ - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); - } - inrow++; - } -} - - -/* - * Module initialization routine for upsampling. - */ - -GLOBAL void -jinit_upsampler (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample; - int ci; - jpeg_component_info * compptr; - boolean need_buffer, do_fancy; - int h_in_group, v_in_group, h_out_group, v_out_group; - - upsample = (my_upsample_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; - upsample->pub.start_pass = start_pass_upsample; - upsample->pub.upsample = sep_upsample; - upsample->pub.need_context_rows = FALSE; /* until we find out differently */ - - if (cinfo->CCIR601_sampling) /* this isn't supported */ - ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); - - /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1, - * so don't ask for it. - */ - do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1; - - /* Verify we can handle the sampling factors, select per-component methods, - * and create storage as needed. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Compute size of an "input group" after IDCT scaling. This many samples - * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. - */ - h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; - v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; - h_out_group = cinfo->max_h_samp_factor; - v_out_group = cinfo->max_v_samp_factor; - upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ - need_buffer = TRUE; - if (! compptr->component_needed) { - /* Don't bother to upsample an uninteresting component. */ - upsample->methods[ci] = noop_upsample; - need_buffer = FALSE; - } else if (h_in_group == h_out_group && v_in_group == v_out_group) { - /* Fullsize components can be processed without any work. */ - upsample->methods[ci] = fullsize_upsample; - need_buffer = FALSE; - } else if (h_in_group * 2 == h_out_group && - v_in_group == v_out_group) { - /* Special cases for 2h1v upsampling */ - if (do_fancy && compptr->downsampled_width > 2) - upsample->methods[ci] = h2v1_fancy_upsample; - else - upsample->methods[ci] = h2v1_upsample; - } else if (h_in_group * 2 == h_out_group && - v_in_group * 2 == v_out_group) { - /* Special cases for 2h2v upsampling */ - if (do_fancy && compptr->downsampled_width > 2) { - upsample->methods[ci] = h2v2_fancy_upsample; - upsample->pub.need_context_rows = TRUE; - } else - upsample->methods[ci] = h2v2_upsample; - } else if ((h_out_group % h_in_group) == 0 && - (v_out_group % v_in_group) == 0) { - /* Generic integral-factors upsampling method */ - upsample->methods[ci] = int_upsample; - upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); - upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); - } else - ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); - if (need_buffer) { - upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) jround_up((long) cinfo->output_width, - (long) cinfo->max_h_samp_factor), - (JDIMENSION) cinfo->max_v_samp_factor); - } - } -} diff --git a/libs/jpeg6/jdtrans.cpp b/libs/jpeg6/jdtrans.cpp deleted file mode 100644 index 3f05ae37..00000000 --- a/libs/jpeg6/jdtrans.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * jdtrans.c - * - * Copyright (C) 1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains library routines for transcoding decompression, - * that is, reading raw DCT coefficient arrays from an input JPEG file. - * The routines in jdapimin.c will also be needed by a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* Forward declarations */ -LOCAL void transdecode_master_selection JPP((j_decompress_ptr cinfo)); - - -/* - * Read the coefficient arrays from a JPEG file. - * jpeg_read_header must be completed before calling this. - * - * The entire image is read into a set of virtual coefficient-block arrays, - * one per component. The return value is a pointer to the array of - * virtual-array descriptors. These can be manipulated directly via the - * JPEG memory manager, or handed off to jpeg_write_coefficients(). - * To release the memory occupied by the virtual arrays, call - * jpeg_finish_decompress() when done with the data. - * - * Returns NULL if suspended. This case need be checked only if - * a suspending data source is used. - */ - -GLOBAL jvirt_barray_ptr * -jpeg_read_coefficients (j_decompress_ptr cinfo) -{ - if (cinfo->global_state == DSTATE_READY) { - /* First call: initialize active modules */ - transdecode_master_selection(cinfo); - cinfo->global_state = DSTATE_RDCOEFS; - } else if (cinfo->global_state != DSTATE_RDCOEFS) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Absorb whole file into the coef buffer */ - for (;;) { - int retcode; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - /* Absorb some more input */ - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_SUSPENDED) - return NULL; - if (retcode == JPEG_REACHED_EOI) - break; - /* Advance progress counter if appropriate */ - if (cinfo->progress != NULL && - (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { - if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { - /* startup underestimated number of scans; ratchet up one scan */ - cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; - } - } - } - /* Set state so that jpeg_finish_decompress does the right thing */ - cinfo->global_state = DSTATE_STOPPING; - return cinfo->coef->coef_arrays; -} - - -/* - * Master selection of decompression modules for transcoding. - * This substitutes for jdmaster.c's initialization of the full decompressor. - */ - -LOCAL void -transdecode_master_selection (j_decompress_ptr cinfo) -{ - /* Entropy decoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef D_PROGRESSIVE_SUPPORTED - jinit_phuff_decoder(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else - jinit_huff_decoder(cinfo); - } - - /* Always get a full-image coefficient buffer. */ - jinit_d_coef_controller(cinfo, TRUE); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Initialize input side of decompressor to consume first scan. */ - (*cinfo->inputctl->start_input_pass) (cinfo); - - /* Initialize progress monitoring. */ - if (cinfo->progress != NULL) { - int nscans; - /* Estimate number of scans to set pass_limit. */ - if (cinfo->progressive_mode) { - /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ - nscans = 2 + 3 * cinfo->num_components; - } else if (cinfo->inputctl->has_multiple_scans) { - /* For a nonprogressive multiscan file, estimate 1 scan per component. */ - nscans = cinfo->num_components; - } else { - nscans = 1; - } - cinfo->progress->pass_counter = 0L; - cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; - cinfo->progress->completed_passes = 0; - cinfo->progress->total_passes = 1; - } -} diff --git a/libs/jpeg6/jerror.cpp b/libs/jpeg6/jerror.cpp deleted file mode 100644 index dda71a56..00000000 --- a/libs/jpeg6/jerror.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/* - * jerror.c - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains simple error-reporting and trace-message routines. - * These are suitable for Unix-like systems and others where writing to - * stderr is the right thing to do. Many applications will want to replace - * some or all of these routines. - * - * These routines are used by both the compression and decompression code. - */ - -/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jversion.h" -#include "jerror.h" - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif - - -/* - * Create the message string table. - * We do this from the master message list in jerror.h by re-reading - * jerror.h with a suitable definition for macro JMESSAGE. - * The message table is made an external symbol just in case any applications - * want to refer to it directly. - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_message_table jMsgTable -#endif - -#define JMESSAGE(code,string) string , - -const char * const jpeg_std_message_table[] = { -#include "jerror.h" - NULL -}; - -// Rad additions, longjmp out of the LoadJPGBuff -GLOBAL jmp_buf rad_loadfailed; -GLOBAL char rad_errormsg[JMSG_LENGTH_MAX]; - -/* - * Error exit handler: must not return to caller. - * - * Applications may override this if they want to get control back after - * an error. Typically one would longjmp somewhere instead of exiting. - * The setjmp buffer can be made a private field within an expanded error - * handler object. Note that the info needed to generate an error message - * is stored in the error object, so you can generate the message now or - * later, at your convenience. - * You should make sure that the JPEG object is cleaned up (with jpeg_abort - * or jpeg_destroy) at some point. - */ - -METHODDEF void -error_exit (j_common_ptr cinfo) -{ -// char buffer[JMSG_LENGTH_MAX]; - - /* Create the message */ - (*cinfo->err->format_message) (cinfo,rad_errormsg); - - /* Let the memory manager delete any temp files before we die */ - jpeg_destroy(cinfo); - - longjmp( rad_loadfailed, -1 ); -} - - -/* - * Actual output of an error or trace message. - * Applications may override this method to send JPEG messages somewhere - * other than stderr. - */ - -METHODDEF void -output_message (j_common_ptr cinfo) -{ - char buffer[JMSG_LENGTH_MAX]; - - /* Create the message */ - (*cinfo->err->format_message) (cinfo, buffer); - - /* Send it to stderr, adding a newline */ - printf("%s\n", buffer); -} - - -/* - * Decide whether to emit a trace or warning message. - * msg_level is one of: - * -1: recoverable corrupt-data warning, may want to abort. - * 0: important advisory messages (always display to user). - * 1: first level of tracing detail. - * 2,3,...: successively more detailed tracing messages. - * An application might override this method if it wanted to abort on warnings - * or change the policy about which messages to display. - */ - -METHODDEF void -emit_message (j_common_ptr cinfo, int msg_level) -{ - struct jpeg_error_mgr * err = cinfo->err; - - if (msg_level < 0) { - /* It's a warning message. Since corrupt files may generate many warnings, - * the policy implemented here is to show only the first warning, - * unless trace_level >= 3. - */ - if (err->num_warnings == 0 || err->trace_level >= 3) - (*err->output_message) (cinfo); - /* Always count warnings in num_warnings. */ - err->num_warnings++; - } else { - /* It's a trace message. Show it if trace_level >= msg_level. */ - if (err->trace_level >= msg_level) - (*err->output_message) (cinfo); - } -} - - -/* - * Format a message string for the most recent JPEG error or message. - * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX - * characters. Note that no '\n' character is added to the string. - * Few applications should need to override this method. - */ - -METHODDEF void -format_message (j_common_ptr cinfo, char * buffer) -{ - struct jpeg_error_mgr * err = cinfo->err; - int msg_code = err->msg_code; - const char * msgtext = NULL; - const char * msgptr; - char ch; - boolean isstring; - - /* Look up message string in proper table */ - if (msg_code > 0 && msg_code <= err->last_jpeg_message) { - msgtext = err->jpeg_message_table[msg_code]; - } else if (err->addon_message_table != NULL && - msg_code >= err->first_addon_message && - msg_code <= err->last_addon_message) { - msgtext = err->addon_message_table[msg_code - err->first_addon_message]; - } - - /* Defend against bogus message number */ - if (msgtext == NULL) { - err->msg_parm.i[0] = msg_code; - msgtext = err->jpeg_message_table[0]; - } - - /* Check for string parameter, as indicated by %s in the message text */ - isstring = FALSE; - msgptr = msgtext; - while ((ch = *msgptr++) != '\0') { - if (ch == '%') { - if (*msgptr == 's') isstring = TRUE; - break; - } - } - - /* Format the message into the passed buffer */ - if (isstring) - sprintf(buffer, msgtext, err->msg_parm.s); - else - sprintf(buffer, msgtext, - err->msg_parm.i[0], err->msg_parm.i[1], - err->msg_parm.i[2], err->msg_parm.i[3], - err->msg_parm.i[4], err->msg_parm.i[5], - err->msg_parm.i[6], err->msg_parm.i[7]); -} - - -/* - * Reset error state variables at start of a new image. - * This is called during compression startup to reset trace/error - * processing to default state, without losing any application-specific - * method pointers. An application might possibly want to override - * this method if it has additional error processing state. - */ - -METHODDEF void -reset_error_mgr (j_common_ptr cinfo) -{ - cinfo->err->num_warnings = 0; - /* trace_level is not reset since it is an application-supplied parameter */ - cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ -} - - -/* - * Fill in the standard error-handling methods in a jpeg_error_mgr object. - * Typical call is: - * struct jpeg_compress_struct cinfo; - * struct jpeg_error_mgr err; - * - * cinfo.err = jpeg_std_error(&err); - * after which the application may override some of the methods. - */ - -GLOBAL struct jpeg_error_mgr * -jpeg_std_error (struct jpeg_error_mgr * err) -{ - err->error_exit = error_exit; - err->emit_message = emit_message; - err->output_message = output_message; - err->format_message = format_message; - err->reset_error_mgr = reset_error_mgr; - - err->trace_level = 0; /* default = no tracing */ - err->num_warnings = 0; /* no warnings emitted yet */ - err->msg_code = 0; /* may be useful as a flag for "no error" */ - - /* Initialize message table pointers */ - err->jpeg_message_table = jpeg_std_message_table; - err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; - - err->addon_message_table = NULL; - err->first_addon_message = 0; /* for safety */ - err->last_addon_message = 0; - - return err; -} diff --git a/libs/jpeg6/jerror.h b/libs/jpeg6/jerror.h deleted file mode 100644 index 86a36c70..00000000 --- a/libs/jpeg6/jerror.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -JMESSAGE(JERR_ARITH_NOTIMPL, - "Sorry, there are legal restrictions on arithmetic coding") -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_COUNTS, "Bogus DHT counts") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -JMESSAGE(JERR_NO_PROGRESSIVE, "Progressive JPEGs not supported, use regular JPEG instead") -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_MINOR, "Unknown JFIF minor revision number %d.%02d") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Skipping marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - -#ifndef JERROR_H -#define JERROR_H - -// Rad additions, using longjmp to recover from errors -#include -EXTERN jmp_buf rad_loadfailed; -EXTERN char rad_errormsg[JMSG_LENGTH_MAX]; - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/libs/jpeg6/jfdctflt.cpp b/libs/jpeg6/jfdctflt.cpp deleted file mode 100644 index 785e93ef..00000000 --- a/libs/jpeg6/jfdctflt.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * jfdctflt.c - * - * Copyright (C) 1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a floating-point implementation of the - * forward DCT (Discrete Cosine Transform). - * - * This implementation should be more accurate than either of the integer - * DCT implementations. However, it may not give the same results on all - * machines because of differences in roundoff behavior. Speed will depend - * on the hardware's floating point capacity. - * - * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with a fixed-point - * implementation, accuracy is lost due to imprecise representation of the - * scaled quantization values. However, that problem does not arise if - * we use floating point arithmetic. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_FLOAT_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * Perform the forward DCT on one block of samples. - */ - -GLOBAL void -jpeg_fdct_float (FAST_FLOAT * data) -{ - FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - FAST_FLOAT tmp10, tmp11, tmp12, tmp13; - FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; - FAST_FLOAT *dataptr; - int ctr; - - /* Pass 1: process rows. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[0] + dataptr[7]; - tmp7 = dataptr[0] - dataptr[7]; - tmp1 = dataptr[1] + dataptr[6]; - tmp6 = dataptr[1] - dataptr[6]; - tmp2 = dataptr[2] + dataptr[5]; - tmp5 = dataptr[2] - dataptr[5]; - tmp3 = dataptr[3] + dataptr[4]; - tmp4 = dataptr[3] - dataptr[4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[0] = tmp10 + tmp11; /* phase 3 */ - dataptr[4] = tmp10 - tmp11; - - z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ - dataptr[2] = tmp13 + z1; /* phase 5 */ - dataptr[6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ - z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ - z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ - z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[5] = z13 + z2; /* phase 6 */ - dataptr[3] = z13 - z2; - dataptr[1] = z11 + z4; - dataptr[7] = z11 - z4; - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; - tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; - tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; - tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; - tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; - tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; - tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; - tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ - dataptr[DCTSIZE*4] = tmp10 - tmp11; - - z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ - dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ - dataptr[DCTSIZE*6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ - z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ - z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ - z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ - dataptr[DCTSIZE*3] = z13 - z2; - dataptr[DCTSIZE*1] = z11 + z4; - dataptr[DCTSIZE*7] = z11 - z4; - - dataptr++; /* advance pointer to next column */ - } -} - -#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/libs/jpeg6/jidctflt.cpp b/libs/jpeg6/jidctflt.cpp deleted file mode 100644 index 82d1e61d..00000000 --- a/libs/jpeg6/jidctflt.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* - * jidctflt.c - * - * Copyright (C) 1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a floating-point implementation of the - * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine - * must also perform dequantization of the input coefficients. - * - * This implementation should be more accurate than either of the integer - * IDCT implementations. However, it may not give the same results on all - * machines because of differences in roundoff behavior. Speed will depend - * on the hardware's floating point capacity. - * - * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT - * on each row (or vice versa, but it's more convenient to emit a row at - * a time). Direct algorithms are also available, but they are much more - * complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with a fixed-point - * implementation, accuracy is lost due to imprecise representation of the - * scaled quantization values. However, that problem does not arise if - * we use floating point arithmetic. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_FLOAT_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* Dequantize a coefficient by multiplying it by the multiplier-table - * entry; produce a float result. - */ - -#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) - - -/* - * Perform dequantization and inverse DCT on one block of coefficients. - */ - -GLOBAL void -jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - FAST_FLOAT tmp10, tmp11, tmp12, tmp13; - FAST_FLOAT z5, z10, z11, z12, z13; - JCOEFPTR inptr; - FLOAT_MULT_TYPE * quantptr; - FAST_FLOAT * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ - SHIFT_TEMPS - - /* Pass 1: process columns from input, store into work array. */ - - inptr = coef_block; - quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; ctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any column in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * column DCT calculations can be simplified this way. - */ - - if ((inptr[DCTSIZE*1] | inptr[DCTSIZE*2] | inptr[DCTSIZE*3] | - inptr[DCTSIZE*4] | inptr[DCTSIZE*5] | inptr[DCTSIZE*6] | - inptr[DCTSIZE*7]) == 0) { - /* AC terms all zero */ - FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - wsptr[DCTSIZE*4] = dcval; - wsptr[DCTSIZE*5] = dcval; - wsptr[DCTSIZE*6] = dcval; - wsptr[DCTSIZE*7] = dcval; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - continue; - } - - /* Even part */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); - tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - tmp10 = tmp0 + tmp2; /* phase 3 */ - tmp11 = tmp0 - tmp2; - - tmp13 = tmp1 + tmp3; /* phases 5-3 */ - tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ - - tmp0 = tmp10 + tmp13; /* phase 2 */ - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - - z13 = tmp6 + tmp5; /* phase 6 */ - z10 = tmp6 - tmp5; - z11 = tmp4 + tmp7; - z12 = tmp4 - tmp7; - - tmp7 = z11 + z13; /* phase 5 */ - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; /* phase 2 */ - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - wsptr[DCTSIZE*0] = tmp0 + tmp7; - wsptr[DCTSIZE*7] = tmp0 - tmp7; - wsptr[DCTSIZE*1] = tmp1 + tmp6; - wsptr[DCTSIZE*6] = tmp1 - tmp6; - wsptr[DCTSIZE*2] = tmp2 + tmp5; - wsptr[DCTSIZE*5] = tmp2 - tmp5; - wsptr[DCTSIZE*4] = tmp3 + tmp4; - wsptr[DCTSIZE*3] = tmp3 - tmp4; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3. */ - - wsptr = workspace; - for (ctr = 0; ctr < DCTSIZE; ctr++) { - outptr = output_buf[ctr] + output_col; - /* Rows of zeroes can be exploited in the same way as we did with columns. - * However, the column calculation has created many nonzero AC terms, so - * the simplification applies less often (typically 5% to 10% of the time). - * And testing floats for zero is relatively expensive, so we don't bother. - */ - - /* Even part */ - - tmp10 = wsptr[0] + wsptr[4]; - tmp11 = wsptr[0] - wsptr[4]; - - tmp13 = wsptr[2] + wsptr[6]; - tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - z13 = wsptr[5] + wsptr[3]; - z10 = wsptr[5] - wsptr[3]; - z11 = wsptr[1] + wsptr[7]; - z12 = wsptr[1] - wsptr[7]; - - tmp7 = z11 + z13; - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - /* Final output stage: scale down by a factor of 8 and range-limit */ - - outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3) - & RANGE_MASK]; - outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3) - & RANGE_MASK]; - outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3) - & RANGE_MASK]; - outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3) - & RANGE_MASK]; - outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3) - & RANGE_MASK]; - outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3) - & RANGE_MASK]; - outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3) - & RANGE_MASK]; - outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - -#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/libs/jpeg6/jinclude.h b/libs/jpeg6/jinclude.h deleted file mode 100644 index 0a4f1514..00000000 --- a/libs/jpeg6/jinclude.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jinclude.h - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file exists to provide a single place to fix any problems with - * including the wrong system include files. (Common problems are taken - * care of by the standard jconfig symbols, but on really weird systems - * you may have to edit this file.) - * - * NOTE: this file is NOT intended to be included by applications using the - * JPEG library. Most applications need only include jpeglib.h. - */ - - -/* Include auto-config file to find out which system include files we need. */ - -#include "jconfig.h" /* auto configuration options */ -#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ - -/* - * We need the NULL macro and size_t typedef. - * On an ANSI-conforming system it is sufficient to include . - * Otherwise, we get them from or ; we may have to - * pull in as well. - * Note that the core JPEG library does not require ; - * only the default error handler and data source/destination modules do. - * But we must pull it in because of the references to FILE in jpeglib.h. - * You can remove those references if you want to compile without . - */ - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef NEED_SYS_TYPES_H -#include -#endif - -#include - -/* - * We need memory copying and zeroing functions, plus strncpy(). - * ANSI and System V implementations declare these in . - * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). - * Some systems may declare memset and memcpy in . - * - * NOTE: we assume the size parameters to these functions are of type size_t. - * Change the casts in these macros if not! - */ - -#ifdef NEED_BSD_STRINGS - -#include -#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) -#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) - -#else /* not BSD, assume ANSI/SysV string lib */ - -#include -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) - -#endif - -/* - * In ANSI C, and indeed any rational implementation, size_t is also the - * type returned by sizeof(). However, it seems there are some irrational - * implementations out there, in which sizeof() returns an int even though - * size_t is defined as long or unsigned long. To ensure consistent results - * we always use this SIZEOF() macro in place of using sizeof() directly. - */ - -#define SIZEOF(object) ((size_t) sizeof(object)) - -/* - * The modules that use fread() and fwrite() always invoke them through - * these macros. On some systems you may need to twiddle the argument casts. - * CAUTION: argument order is different from underlying functions! - */ - -#define JFREAD(file,buf,sizeofbuf) \ - ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/libs/jpeg6/jmemmgr.cpp b/libs/jpeg6/jmemmgr.cpp deleted file mode 100644 index 9862e2f8..00000000 --- a/libs/jpeg6/jmemmgr.cpp +++ /dev/null @@ -1,1115 +0,0 @@ -/* - * jmemmgr.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the JPEG system-independent memory management - * routines. This code is usable across a wide variety of machines; most - * of the system dependencies have been isolated in a separate file. - * The major functions provided here are: - * * pool-based allocation and freeing of memory; - * * policy decisions about how to divide available memory among the - * virtual arrays; - * * control logic for swapping virtual arrays between main memory and - * backing storage. - * The separate system-dependent file provides the actual backing-storage - * access code, and it contains the policy decision about how much total - * main memory to use. - * This file is system-dependent in the sense that some of its functions - * are unnecessary in some systems. For example, if there is enough virtual - * memory so that backing storage will never be used, much of the virtual - * array control logic could be removed. (Of course, if you have that much - * memory then you shouldn't care about a little bit of unused code...) - */ - -#define JPEG_INTERNALS -#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef NO_GETENV -#ifndef HAVE_STDLIB_H /* should declare getenv() */ -extern char * getenv JPP((const char * name)); -#endif -#endif - - -/* - * Some important notes: - * The allocation routines provided here must never return NULL. - * They should exit to error_exit if unsuccessful. - * - * It's not a good idea to try to merge the sarray and barray routines, - * even though they are textually almost the same, because samples are - * usually stored as bytes while coefficients are shorts or ints. Thus, - * in machines where byte pointers have a different representation from - * word pointers, the resulting machine code could not be the same. - */ - - -/* - * Many machines require storage alignment: longs must start on 4-byte - * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() - * always returns pointers that are multiples of the worst-case alignment - * requirement, and we had better do so too. - * There isn't any really portable way to determine the worst-case alignment - * requirement. This module assumes that the alignment requirement is - * multiples of sizeof(ALIGN_TYPE). - * By default, we define ALIGN_TYPE as double. This is necessary on some - * workstations (where doubles really do need 8-byte alignment) and will work - * fine on nearly everything. If your machine has lesser alignment needs, - * you can save a few bytes by making ALIGN_TYPE smaller. - * The only place I know of where this will NOT work is certain Macintosh - * 680x0 compilers that define double as a 10-byte IEEE extended float. - * Doing 10-byte alignment is counterproductive because longwords won't be - * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have - * such a compiler. - */ - -#ifndef ALIGN_TYPE /* so can override from jconfig.h */ -#define ALIGN_TYPE double -#endif - - -/* - * We allocate objects from "pools", where each pool is gotten with a single - * request to jpeg_get_small() or jpeg_get_large(). There is no per-object - * overhead within a pool, except for alignment padding. Each pool has a - * header with a link to the next pool of the same class. - * Small and large pool headers are identical except that the latter's - * link pointer must be FAR on 80x86 machines. - * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE - * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple - * of the alignment requirement of ALIGN_TYPE. - */ - -typedef union small_pool_struct * small_pool_ptr; - -typedef union small_pool_struct { - struct { - small_pool_ptr next; /* next in list of pools */ - size_t bytes_used; /* how many bytes already used within pool */ - size_t bytes_left; /* bytes still available in this pool */ - } hdr; - ALIGN_TYPE dummy; /* included in union to ensure alignment */ -} small_pool_hdr; - -typedef union large_pool_struct FAR * large_pool_ptr; - -typedef union large_pool_struct { - struct { - large_pool_ptr next; /* next in list of pools */ - size_t bytes_used; /* how many bytes already used within pool */ - size_t bytes_left; /* bytes still available in this pool */ - } hdr; - ALIGN_TYPE dummy; /* included in union to ensure alignment */ -} large_pool_hdr; - - -/* - * Here is the full definition of a memory manager object. - */ - -typedef struct { - struct jpeg_memory_mgr pub; /* public fields */ - - /* Each pool identifier (lifetime class) names a linked list of pools. */ - small_pool_ptr small_list[JPOOL_NUMPOOLS]; - large_pool_ptr large_list[JPOOL_NUMPOOLS]; - - /* Since we only have one lifetime class of virtual arrays, only one - * linked list is necessary (for each datatype). Note that the virtual - * array control blocks being linked together are actually stored somewhere - * in the small-pool list. - */ - jvirt_sarray_ptr virt_sarray_list; - jvirt_barray_ptr virt_barray_list; - - /* This counts total space obtained from jpeg_get_small/large */ - long total_space_allocated; - - /* alloc_sarray and alloc_barray set this value for use by virtual - * array routines. - */ - JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ -} my_memory_mgr; - -typedef my_memory_mgr * my_mem_ptr; - - -/* - * The control blocks for virtual arrays. - * Note that these blocks are allocated in the "small" pool area. - * System-dependent info for the associated backing store (if any) is hidden - * inside the backing_store_info struct. - */ - -struct jvirt_sarray_control { - JSAMPARRAY mem_buffer; /* => the in-memory buffer */ - JDIMENSION rows_in_array; /* total virtual array height */ - JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ - JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ - JDIMENSION rows_in_mem; /* height of memory buffer */ - JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ - JDIMENSION cur_start_row; /* first logical row # in the buffer */ - JDIMENSION first_undef_row; /* row # of first uninitialized row */ - boolean pre_zero; /* pre-zero mode requested? */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ - jvirt_sarray_ptr next; /* link to next virtual sarray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - -struct jvirt_barray_control { - JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ - JDIMENSION rows_in_array; /* total virtual array height */ - JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ - JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ - JDIMENSION rows_in_mem; /* height of memory buffer */ - JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ - JDIMENSION cur_start_row; /* first logical row # in the buffer */ - JDIMENSION first_undef_row; /* row # of first uninitialized row */ - boolean pre_zero; /* pre-zero mode requested? */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ - jvirt_barray_ptr next; /* link to next virtual barray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - - -#ifdef MEM_STATS /* optional extra stuff for statistics */ - -LOCAL void -print_mem_stats (j_common_ptr cinfo, int pool_id) -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr shdr_ptr; - large_pool_ptr lhdr_ptr; - - /* Since this is only a debugging stub, we can cheat a little by using - * fprintf directly rather than going through the trace message code. - * This is helpful because message parm array can't handle longs. - */ - fprintf(stderr, "Freeing pool %d, total space = %ld\n", - pool_id, mem->total_space_allocated); - - for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; - lhdr_ptr = lhdr_ptr->hdr.next) { - fprintf(stderr, " Large chunk used %ld\n", - (long) lhdr_ptr->hdr.bytes_used); - } - - for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; - shdr_ptr = shdr_ptr->hdr.next) { - fprintf(stderr, " Small chunk used %ld free %ld\n", - (long) shdr_ptr->hdr.bytes_used, - (long) shdr_ptr->hdr.bytes_left); - } -} - -#endif /* MEM_STATS */ - - -LOCAL void -out_of_memory (j_common_ptr cinfo, int which) -/* Report an out-of-memory error and stop execution */ -/* If we compiled MEM_STATS support, report alloc requests before dying */ -{ -#ifdef MEM_STATS - cinfo->err->trace_level = 2; /* force self_destruct to report stats */ -#endif - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); -} - - -/* - * Allocation of "small" objects. - * - * For these, we use pooled storage. When a new pool must be created, - * we try to get enough space for the current request plus a "slop" factor, - * where the slop will be the amount of leftover space in the new pool. - * The speed vs. space tradeoff is largely determined by the slop values. - * A different slop value is provided for each pool class (lifetime), - * and we also distinguish the first pool of a class from later ones. - * NOTE: the values given work fairly well on both 16- and 32-bit-int - * machines, but may be too small if longs are 64 bits or more. - */ - -static const size_t first_pool_slop[JPOOL_NUMPOOLS] = -{ - 1600, /* first PERMANENT pool */ - 16000 /* first IMAGE pool */ -}; - -static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = -{ - 0, /* additional PERMANENT pools */ - 5000 /* additional IMAGE pools */ -}; - -#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ - - -METHODDEF void * -alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) -/* Allocate a "small" object */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr hdr_ptr, prev_hdr_ptr; - char * data_ptr; - size_t odd_bytes, min_request, slop; - - /* Check for unsatisfiable request (do now to ensure no overflow below) */ - if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) - out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ - - /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ - odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); - if (odd_bytes > 0) - sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; - - /* See if space is available in any existing pool */ - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - prev_hdr_ptr = NULL; - hdr_ptr = mem->small_list[pool_id]; - while (hdr_ptr != NULL) { - if (hdr_ptr->hdr.bytes_left >= sizeofobject) - break; /* found pool with enough space */ - prev_hdr_ptr = hdr_ptr; - hdr_ptr = hdr_ptr->hdr.next; - } - - /* Time to make a new pool? */ - if (hdr_ptr == NULL) { - /* min_request is what we need now, slop is what will be leftover */ - min_request = sizeofobject + SIZEOF(small_pool_hdr); - if (prev_hdr_ptr == NULL) /* first pool in class? */ - slop = first_pool_slop[pool_id]; - else - slop = extra_pool_slop[pool_id]; - /* Don't ask for more than MAX_ALLOC_CHUNK */ - if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) - slop = (size_t) (MAX_ALLOC_CHUNK-min_request); - /* Try to get space, if fail reduce slop and try again */ - for (;;) { - hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); - if (hdr_ptr != NULL) - break; - slop /= 2; - if (slop < MIN_SLOP) /* give up when it gets real small */ - out_of_memory(cinfo, 2); /* jpeg_get_small failed */ - } - mem->total_space_allocated += min_request + slop; - /* Success, initialize the new pool header and add to end of list */ - hdr_ptr->hdr.next = NULL; - hdr_ptr->hdr.bytes_used = 0; - hdr_ptr->hdr.bytes_left = sizeofobject + slop; - if (prev_hdr_ptr == NULL) /* first pool in class? */ - mem->small_list[pool_id] = hdr_ptr; - else - prev_hdr_ptr->hdr.next = hdr_ptr; - } - - /* OK, allocate the object from the current pool */ - data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ - data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ - hdr_ptr->hdr.bytes_used += sizeofobject; - hdr_ptr->hdr.bytes_left -= sizeofobject; - - return (void *) data_ptr; -} - - -/* - * Allocation of "large" objects. - * - * The external semantics of these are the same as "small" objects, - * except that FAR pointers are used on 80x86. However the pool - * management heuristics are quite different. We assume that each - * request is large enough that it may as well be passed directly to - * jpeg_get_large; the pool management just links everything together - * so that we can free it all on demand. - * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY - * structures. The routines that create these structures (see below) - * deliberately bunch rows together to ensure a large request size. - */ - -METHODDEF void FAR * -alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) -/* Allocate a "large" object */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - large_pool_ptr hdr_ptr; - size_t odd_bytes; - - /* Check for unsatisfiable request (do now to ensure no overflow below) */ - if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) - out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ - - /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ - odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); - if (odd_bytes > 0) - sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; - - /* Always make a new pool */ - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + - SIZEOF(large_pool_hdr)); - if (hdr_ptr == NULL) - out_of_memory(cinfo, 4); /* jpeg_get_large failed */ - mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr); - - /* Success, initialize the new pool header and add to list */ - hdr_ptr->hdr.next = mem->large_list[pool_id]; - /* We maintain space counts in each pool header for statistical purposes, - * even though they are not needed for allocation. - */ - hdr_ptr->hdr.bytes_used = sizeofobject; - hdr_ptr->hdr.bytes_left = 0; - mem->large_list[pool_id] = hdr_ptr; - - return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ -} - - -/* - * Creation of 2-D sample arrays. - * The pointers are in near heap, the samples themselves in FAR heap. - * - * To minimize allocation overhead and to allow I/O of large contiguous - * blocks, we allocate the sample rows in groups of as many rows as possible - * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. - * NB: the virtual array control routines, later in this file, know about - * this chunking of rows. The rowsperchunk value is left in the mem manager - * object so that it can be saved away if this sarray is the workspace for - * a virtual array. - */ - -METHODDEF JSAMPARRAY -alloc_sarray (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, JDIMENSION numrows) -/* Allocate a 2-D sample array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - JSAMPARRAY result; - JSAMPROW workspace; - JDIMENSION rowsperchunk, currow, i; - long ltemp; - - /* Calculate max # of rows allowed in one allocation chunk */ - ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / - ((long) samplesperrow * SIZEOF(JSAMPLE)); - if (ltemp <= 0) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - if (ltemp < (long) numrows) - rowsperchunk = (JDIMENSION) ltemp; - else - rowsperchunk = numrows; - mem->last_rowsperchunk = rowsperchunk; - - /* Get space for row pointers (small object) */ - result = (JSAMPARRAY) alloc_small(cinfo, pool_id, - (size_t) (numrows * SIZEOF(JSAMPROW))); - - /* Get the rows themselves (large objects) */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JSAMPROW) alloc_large(cinfo, pool_id, - (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow - * SIZEOF(JSAMPLE))); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += samplesperrow; - } - } - - return result; -} - - -/* - * Creation of 2-D coefficient-block arrays. - * This is essentially the same as the code for sample arrays, above. - */ - -METHODDEF JBLOCKARRAY -alloc_barray (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, JDIMENSION numrows) -/* Allocate a 2-D coefficient-block array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - JBLOCKARRAY result; - JBLOCKROW workspace; - JDIMENSION rowsperchunk, currow, i; - long ltemp; - - /* Calculate max # of rows allowed in one allocation chunk */ - ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / - ((long) blocksperrow * SIZEOF(JBLOCK)); - if (ltemp <= 0) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - if (ltemp < (long) numrows) - rowsperchunk = (JDIMENSION) ltemp; - else - rowsperchunk = numrows; - mem->last_rowsperchunk = rowsperchunk; - - /* Get space for row pointers (small object) */ - result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, - (size_t) (numrows * SIZEOF(JBLOCKROW))); - - /* Get the rows themselves (large objects) */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, - (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow - * SIZEOF(JBLOCK))); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += blocksperrow; - } - } - - return result; -} - - -/* - * About virtual array management: - * - * The above "normal" array routines are only used to allocate strip buffers - * (as wide as the image, but just a few rows high). Full-image-sized buffers - * are handled as "virtual" arrays. The array is still accessed a strip at a - * time, but the memory manager must save the whole array for repeated - * accesses. The intended implementation is that there is a strip buffer in - * memory (as high as is possible given the desired memory limit), plus a - * backing file that holds the rest of the array. - * - * The request_virt_array routines are told the total size of the image and - * the maximum number of rows that will be accessed at once. The in-memory - * buffer must be at least as large as the maxaccess value. - * - * The request routines create control blocks but not the in-memory buffers. - * That is postponed until realize_virt_arrays is called. At that time the - * total amount of space needed is known (approximately, anyway), so free - * memory can be divided up fairly. - * - * The access_virt_array routines are responsible for making a specific strip - * area accessible (after reading or writing the backing file, if necessary). - * Note that the access routines are told whether the caller intends to modify - * the accessed strip; during a read-only pass this saves having to rewrite - * data to disk. The access routines are also responsible for pre-zeroing - * any newly accessed rows, if pre-zeroing was requested. - * - * In current usage, the access requests are usually for nonoverlapping - * strips; that is, successive access start_row numbers differ by exactly - * num_rows = maxaccess. This means we can get good performance with simple - * buffer dump/reload logic, by making the in-memory buffer be a multiple - * of the access height; then there will never be accesses across bufferload - * boundaries. The code will still work with overlapping access requests, - * but it doesn't handle bufferload overlaps very efficiently. - */ - - -METHODDEF jvirt_sarray_ptr -request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, - JDIMENSION samplesperrow, JDIMENSION numrows, - JDIMENSION maxaccess) -/* Request a virtual 2-D sample array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - jvirt_sarray_ptr result; - - /* Only IMAGE-lifetime virtual arrays are currently supported */ - if (pool_id != JPOOL_IMAGE) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - /* get control block */ - result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, - SIZEOF(struct jvirt_sarray_control)); - - result->mem_buffer = NULL; /* marks array not yet realized */ - result->rows_in_array = numrows; - result->samplesperrow = samplesperrow; - result->maxaccess = maxaccess; - result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ - mem->virt_sarray_list = result; - - return result; -} - - -METHODDEF jvirt_barray_ptr -request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, - JDIMENSION blocksperrow, JDIMENSION numrows, - JDIMENSION maxaccess) -/* Request a virtual 2-D coefficient-block array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - jvirt_barray_ptr result; - - /* Only IMAGE-lifetime virtual arrays are currently supported */ - if (pool_id != JPOOL_IMAGE) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - /* get control block */ - result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, - SIZEOF(struct jvirt_barray_control)); - - result->mem_buffer = NULL; /* marks array not yet realized */ - result->rows_in_array = numrows; - result->blocksperrow = blocksperrow; - result->maxaccess = maxaccess; - result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = mem->virt_barray_list; /* add to list of virtual arrays */ - mem->virt_barray_list = result; - - return result; -} - - -METHODDEF void -realize_virt_arrays (j_common_ptr cinfo) -/* Allocate the in-memory buffers for any unrealized virtual arrays */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - long space_per_minheight, maximum_space, avail_mem; - long minheights, max_minheights; - jvirt_sarray_ptr sptr; - jvirt_barray_ptr bptr; - - /* Compute the minimum space needed (maxaccess rows in each buffer) - * and the maximum space needed (full image height in each buffer). - * These may be of use to the system-dependent jpeg_mem_available routine. - */ - space_per_minheight = 0; - maximum_space = 0; - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_minheight += (long) sptr->maxaccess * - (long) sptr->samplesperrow * SIZEOF(JSAMPLE); - maximum_space += (long) sptr->rows_in_array * - (long) sptr->samplesperrow * SIZEOF(JSAMPLE); - } - } - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_minheight += (long) bptr->maxaccess * - (long) bptr->blocksperrow * SIZEOF(JBLOCK); - maximum_space += (long) bptr->rows_in_array * - (long) bptr->blocksperrow * SIZEOF(JBLOCK); - } - } - - if (space_per_minheight <= 0) - return; /* no unrealized arrays, no work */ - - /* Determine amount of memory to actually use; this is system-dependent. */ - avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space, - mem->total_space_allocated); - - /* If the maximum space needed is available, make all the buffers full - * height; otherwise parcel it out with the same number of minheights - * in each buffer. - */ - if (avail_mem >= maximum_space) - max_minheights = 1000000000L; - else { - max_minheights = avail_mem / space_per_minheight; - /* If there doesn't seem to be enough space, try to get the minimum - * anyway. This allows a "stub" implementation of jpeg_mem_available(). - */ - if (max_minheights <= 0) - max_minheights = 1; - } - - /* Allocate the in-memory buffers and initialize backing store as needed. */ - - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L; - if (minheights <= max_minheights) { - /* This buffer fits in memory */ - sptr->rows_in_mem = sptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess); - jpeg_open_backing_store(cinfo, & sptr->b_s_info, - (long) sptr->rows_in_array * - (long) sptr->samplesperrow * - (long) SIZEOF(JSAMPLE)); - sptr->b_s_open = TRUE; - } - sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, - sptr->samplesperrow, sptr->rows_in_mem); - sptr->rowsperchunk = mem->last_rowsperchunk; - sptr->cur_start_row = 0; - sptr->first_undef_row = 0; - sptr->dirty = FALSE; - } - } - - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L; - if (minheights <= max_minheights) { - /* This buffer fits in memory */ - bptr->rows_in_mem = bptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess); - jpeg_open_backing_store(cinfo, & bptr->b_s_info, - (long) bptr->rows_in_array * - (long) bptr->blocksperrow * - (long) SIZEOF(JBLOCK)); - bptr->b_s_open = TRUE; - } - bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, - bptr->blocksperrow, bptr->rows_in_mem); - bptr->rowsperchunk = mem->last_rowsperchunk; - bptr->cur_start_row = 0; - bptr->first_undef_row = 0; - bptr->dirty = FALSE; - } - } -} - - -LOCAL void -do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) -/* Do backing store read or write of a virtual sample array */ -{ - long bytesperrow, file_offset, byte_count, rows, thisrow, i; - - bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); - /* Transfer no more than is currently defined */ - thisrow = (long) ptr->cur_start_row + i; - rows = MIN(rows, (long) ptr->first_undef_row - thisrow); - /* Transfer no more than fits in file */ - rows = MIN(rows, (long) ptr->rows_in_array - thisrow); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -LOCAL void -do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) -/* Do backing store read or write of a virtual coefficient-block array */ -{ - long bytesperrow, file_offset, byte_count, rows, thisrow, i; - - bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); - /* Transfer no more than is currently defined */ - thisrow = (long) ptr->cur_start_row + i; - rows = MIN(rows, (long) ptr->first_undef_row - thisrow); - /* Transfer no more than fits in file */ - rows = MIN(rows, (long) ptr->rows_in_array - thisrow); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -METHODDEF JSAMPARRAY -access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, - JDIMENSION start_row, JDIMENSION num_rows, - boolean writable) -/* Access the part of a virtual sample array starting at start_row */ -/* and extending for num_rows rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - JDIMENSION end_row = start_row + num_rows; - JDIMENSION undef_row; - - /* debugging check */ - if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || - ptr->mem_buffer == NULL) - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - end_row > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(cinfo, JERR_VIRTUAL_BUG); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_sarray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target area is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - /* use long arithmetic here to avoid overflow & unsigned problems */ - long ltemp; - - ltemp = (long) end_row - (long) ptr->rows_in_mem; - if (ltemp < 0) - ltemp = 0; /* don't fall off front end of file */ - ptr->cur_start_row = (JDIMENSION) ltemp; - } - /* Read in the selected part of the array. - * During the initial write pass, we will do no actual read - * because the selected part is all undefined. - */ - do_sarray_io(cinfo, ptr, FALSE); - } - /* Ensure the accessed part of the array is defined; prezero if needed. - * To improve locality of access, we only prezero the part of the array - * that the caller is about to access, not the entire in-memory array. - */ - if (ptr->first_undef_row < end_row) { - if (ptr->first_undef_row < start_row) { - if (writable) /* writer skipped over a section of array */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - undef_row = start_row; /* but reader is allowed to read ahead */ - } else { - undef_row = ptr->first_undef_row; - } - if (writable) - ptr->first_undef_row = end_row; - if (ptr->pre_zero) { - size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); - undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ - end_row -= ptr->cur_start_row; - while (undef_row < end_row) { - jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); - undef_row++; - } - } else { - if (! writable) /* reader looking at undefined data */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -METHODDEF JBLOCKARRAY -access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, - JDIMENSION start_row, JDIMENSION num_rows, - boolean writable) -/* Access the part of a virtual block array starting at start_row */ -/* and extending for num_rows rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - JDIMENSION end_row = start_row + num_rows; - JDIMENSION undef_row; - - /* debugging check */ - if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || - ptr->mem_buffer == NULL) - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - end_row > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(cinfo, JERR_VIRTUAL_BUG); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_barray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target area is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - /* use long arithmetic here to avoid overflow & unsigned problems */ - long ltemp; - - ltemp = (long) end_row - (long) ptr->rows_in_mem; - if (ltemp < 0) - ltemp = 0; /* don't fall off front end of file */ - ptr->cur_start_row = (JDIMENSION) ltemp; - } - /* Read in the selected part of the array. - * During the initial write pass, we will do no actual read - * because the selected part is all undefined. - */ - do_barray_io(cinfo, ptr, FALSE); - } - /* Ensure the accessed part of the array is defined; prezero if needed. - * To improve locality of access, we only prezero the part of the array - * that the caller is about to access, not the entire in-memory array. - */ - if (ptr->first_undef_row < end_row) { - if (ptr->first_undef_row < start_row) { - if (writable) /* writer skipped over a section of array */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - undef_row = start_row; /* but reader is allowed to read ahead */ - } else { - undef_row = ptr->first_undef_row; - } - if (writable) - ptr->first_undef_row = end_row; - if (ptr->pre_zero) { - size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); - undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ - end_row -= ptr->cur_start_row; - while (undef_row < end_row) { - jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); - undef_row++; - } - } else { - if (! writable) /* reader looking at undefined data */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -/* - * Release all objects belonging to a specified pool. - */ - -METHODDEF void -free_pool (j_common_ptr cinfo, int pool_id) -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr shdr_ptr; - large_pool_ptr lhdr_ptr; - size_t space_freed; - - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - -#ifdef MEM_STATS - if (cinfo->err->trace_level > 1) - print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ -#endif - - /* If freeing IMAGE pool, close any virtual arrays first */ - if (pool_id == JPOOL_IMAGE) { - jvirt_sarray_ptr sptr; - jvirt_barray_ptr bptr; - - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->b_s_open) { /* there may be no backing store */ - sptr->b_s_open = FALSE; /* prevent recursive close if error */ - (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); - } - } - mem->virt_sarray_list = NULL; - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->b_s_open) { /* there may be no backing store */ - bptr->b_s_open = FALSE; /* prevent recursive close if error */ - (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); - } - } - mem->virt_barray_list = NULL; - } - - /* Release large objects */ - lhdr_ptr = mem->large_list[pool_id]; - mem->large_list[pool_id] = NULL; - - while (lhdr_ptr != NULL) { - large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; - space_freed = lhdr_ptr->hdr.bytes_used + - lhdr_ptr->hdr.bytes_left + - SIZEOF(large_pool_hdr); - jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); - mem->total_space_allocated -= space_freed; - lhdr_ptr = next_lhdr_ptr; - } - - /* Release small objects */ - shdr_ptr = mem->small_list[pool_id]; - mem->small_list[pool_id] = NULL; - - while (shdr_ptr != NULL) { - small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; - space_freed = shdr_ptr->hdr.bytes_used + - shdr_ptr->hdr.bytes_left + - SIZEOF(small_pool_hdr); - jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); - mem->total_space_allocated -= space_freed; - shdr_ptr = next_shdr_ptr; - } -} - - -/* - * Close up shop entirely. - * Note that this cannot be called unless cinfo->mem is non-NULL. - */ - -METHODDEF void -self_destruct (j_common_ptr cinfo) -{ - int pool; - - /* Close all backing store, release all memory. - * Releasing pools in reverse order might help avoid fragmentation - * with some (brain-damaged) malloc libraries. - */ - for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { - free_pool(cinfo, pool); - } - - /* Release the memory manager control block too. */ - jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); - cinfo->mem = NULL; /* ensures I will be called only once */ - - jpeg_mem_term(cinfo); /* system-dependent cleanup */ -} - - -/* - * Memory manager initialization. - * When this is called, only the error manager pointer is valid in cinfo! - */ - -GLOBAL void -jinit_memory_mgr (j_common_ptr cinfo) -{ - my_mem_ptr mem; - long max_to_use; - int pool; - size_t test_mac; - - cinfo->mem = NULL; /* for safety if init fails */ - - /* Check for configuration errors. - * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably - * doesn't reflect any real hardware alignment requirement. - * The test is a little tricky: for X>0, X and X-1 have no one-bits - * in common if and only if X is a power of 2, ie has only one one-bit. - * Some compilers may give an "unreachable code" warning here; ignore it. - */ - if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) - ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); - /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be - * a multiple of SIZEOF(ALIGN_TYPE). - * Again, an "unreachable code" warning may be ignored here. - * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. - */ - test_mac = (size_t) MAX_ALLOC_CHUNK; - if ((long) test_mac != MAX_ALLOC_CHUNK || - (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) - ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); - - max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ - - /* Attempt to allocate memory manager's control block */ - mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); - - if (mem == NULL) { - jpeg_mem_term(cinfo); /* system-dependent cleanup */ - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); - } - - /* OK, fill in the method pointers */ - mem->pub.alloc_small = alloc_small; - mem->pub.alloc_large = alloc_large; - mem->pub.alloc_sarray = alloc_sarray; - mem->pub.alloc_barray = alloc_barray; - mem->pub.request_virt_sarray = request_virt_sarray; - mem->pub.request_virt_barray = request_virt_barray; - mem->pub.realize_virt_arrays = realize_virt_arrays; - mem->pub.access_virt_sarray = access_virt_sarray; - mem->pub.access_virt_barray = access_virt_barray; - mem->pub.free_pool = free_pool; - mem->pub.self_destruct = self_destruct; - - /* Initialize working state */ - mem->pub.max_memory_to_use = max_to_use; - - for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { - mem->small_list[pool] = NULL; - mem->large_list[pool] = NULL; - } - mem->virt_sarray_list = NULL; - mem->virt_barray_list = NULL; - - mem->total_space_allocated = SIZEOF(my_memory_mgr); - - /* Declare ourselves open for business */ - cinfo->mem = & mem->pub; - - /* Check for an environment variable JPEGMEM; if found, override the - * default max_memory setting from jpeg_mem_init. Note that the - * surrounding application may again override this value. - * If your system doesn't support getenv(), define NO_GETENV to disable - * this feature. - */ -#ifndef NO_GETENV - { char * memenv; - - if ((memenv = getenv("JPEGMEM")) != NULL) { - char ch = 'x'; - - if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { - if (ch == 'm' || ch == 'M') - max_to_use *= 1000L; - mem->pub.max_memory_to_use = max_to_use * 1000L; - } - } - } -#endif - -} diff --git a/libs/jpeg6/jmemnobs.cpp b/libs/jpeg6/jmemnobs.cpp deleted file mode 100644 index df0abb0c..00000000 --- a/libs/jpeg6/jmemnobs.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * jmemnobs.c - * - * Copyright (C) 1992-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides a really simple implementation of the system- - * dependent portion of the JPEG memory manager. This implementation - * assumes that no backing-store files are needed: all required space - * can be obtained from ri.Malloc(). - * This is very portable in the sense that it'll compile on almost anything, - * but you'd better have lots of main memory (or virtual memory) if you want - * to process big images. - * Note that the max_memory_to_use option is ignored by this implementation. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -/* - * Memory allocation and ri.Freeing are controlled by the regular library - * routines ri.Malloc() and ri.Free(). - */ - -GLOBAL void * -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) malloc(sizeofobject); -} - -GLOBAL void -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * "Large" objects are treated the same as "small" ones. - * NB: although we include FAR keywords in the routine declarations, - * this file won't actually work in 80x86 small/medium model; at least, - * you probably won't be able to process useful-size images in only 64KB. - */ - -GLOBAL void FAR * -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) malloc(sizeofobject); -} - -GLOBAL void -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * This routine computes the total memory space available for allocation. - * Here we always say, "we got all you want bud!" - */ - -GLOBAL long -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - return max_bytes_needed; -} - - -/* - * Backing store (temporary file) management. - * Since jpeg_mem_available always promised the moon, - * this should never be called and we can just error out. - */ - -GLOBAL void -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - ERREXIT(cinfo, JERR_NO_BACKING_STORE); -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. Here, there isn't any. - */ - -GLOBAL long -jpeg_mem_init (j_common_ptr cinfo) -{ - return 0; /* just set max_memory_to_use to 0 */ -} - -GLOBAL void -jpeg_mem_term (j_common_ptr cinfo) -{ - /* no work */ -} diff --git a/libs/jpeg6/jmemsys.h b/libs/jpeg6/jmemsys.h deleted file mode 100644 index 033d29a7..00000000 --- a/libs/jpeg6/jmemsys.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * jmemsys.h - * - * Copyright (C) 1992-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file defines the interface between the system-independent - * and system-dependent portions of the JPEG memory manager. No other - * modules need include it. (The system-independent portion is jmemmgr.c; - * there are several different versions of the system-dependent portion.) - * - * This file works as-is for the system-dependent memory managers supplied - * in the IJG distribution. You may need to modify it if you write a - * custom memory manager. If system-dependent changes are needed in - * this file, the best method is to #ifdef them based on a configuration - * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR. - */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_get_small jGetSmall -#define jpeg_free_small jFreeSmall -#define jpeg_get_large jGetLarge -#define jpeg_free_large jFreeLarge -#define jpeg_mem_available jMemAvail -#define jpeg_open_backing_store jOpenBackStore -#define jpeg_mem_init jMemInit -#define jpeg_mem_term jMemTerm -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* - * These two functions are used to allocate and release small chunks of - * memory. (Typically the total amount requested through jpeg_get_small is - * no more than 20K or so; this will be requested in chunks of a few K each.) - * Behavior should be the same as for the standard library functions malloc - * and free; in particular, jpeg_get_small must return NULL on failure. - * On most systems, these ARE malloc and free. jpeg_free_small is passed the - * size of the object being freed, just in case it's needed. - * On an 80x86 machine using small-data memory model, these manage near heap. - */ - -EXTERN void * jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); -EXTERN void jpeg_free_small JPP((j_common_ptr cinfo, void * object, - size_t sizeofobject)); - -/* - * These two functions are used to allocate and release large chunks of - * memory (up to the total free space designated by jpeg_mem_available). - * The interface is the same as above, except that on an 80x86 machine, - * far pointers are used. On most other machines these are identical to - * the jpeg_get/free_small routines; but we keep them separate anyway, - * in case a different allocation strategy is desirable for large chunks. - */ - -EXTERN void FAR * jpeg_get_large JPP((j_common_ptr cinfo,size_t sizeofobject)); -EXTERN void jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, - size_t sizeofobject)); - -/* - * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may - * be requested in a single call to jpeg_get_large (and jpeg_get_small for that - * matter, but that case should never come into play). This macro is needed - * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. - * On those machines, we expect that jconfig.h will provide a proper value. - * On machines with 32-bit flat address spaces, any large constant may be used. - * - * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type - * size_t and will be a multiple of sizeof(align_type). - */ - -#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ -#define MAX_ALLOC_CHUNK 1000000000L -#endif - -/* - * This routine computes the total space still available for allocation by - * jpeg_get_large. If more space than this is needed, backing store will be - * used. NOTE: any memory already allocated must not be counted. - * - * There is a minimum space requirement, corresponding to the minimum - * feasible buffer sizes; jmemmgr.c will request that much space even if - * jpeg_mem_available returns zero. The maximum space needed, enough to hold - * all working storage in memory, is also passed in case it is useful. - * Finally, the total space already allocated is passed. If no better - * method is available, cinfo->mem->max_memory_to_use - already_allocated - * is often a suitable calculation. - * - * It is OK for jpeg_mem_available to underestimate the space available - * (that'll just lead to more backing-store access than is really necessary). - * However, an overestimate will lead to failure. Hence it's wise to subtract - * a slop factor from the true available space. 5% should be enough. - * - * On machines with lots of virtual memory, any large constant may be returned. - * Conversely, zero may be returned to always use the minimum amount of memory. - */ - -EXTERN long jpeg_mem_available JPP((j_common_ptr cinfo, - long min_bytes_needed, - long max_bytes_needed, - long already_allocated)); - - -/* - * This structure holds whatever state is needed to access a single - * backing-store object. The read/write/close method pointers are called - * by jmemmgr.c to manipulate the backing-store object; all other fields - * are private to the system-dependent backing store routines. - */ - -#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ - -#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ - -typedef unsigned short XMSH; /* type of extended-memory handles */ -typedef unsigned short EMSH; /* type of expanded-memory handles */ - -typedef union { - short file_handle; /* DOS file handle if it's a temp file */ - XMSH xms_handle; /* handle if it's a chunk of XMS */ - EMSH ems_handle; /* handle if it's a chunk of EMS */ -} handle_union; - -#endif /* USE_MSDOS_MEMMGR */ - -typedef struct backing_store_struct * backing_store_ptr; - -typedef struct backing_store_struct { - /* Methods for reading/writing/closing this backing-store object */ - JMETHOD(void, read_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, write_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, close_backing_store, (j_common_ptr cinfo, - backing_store_ptr info)); - - /* Private fields for system-dependent backing-store management */ -#ifdef USE_MSDOS_MEMMGR - /* For the MS-DOS manager (jmemdos.c), we need: */ - handle_union handle; /* reference to backing-store storage object */ - char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ -#else - /* For a typical implementation with temp files, we need: */ - FILE * temp_file; /* stdio reference to temp file */ - char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ -#endif -} backing_store_info; - -/* - * Initial opening of a backing-store object. This must fill in the - * read/write/close pointers in the object. The read/write routines - * may take an error exit if the specified maximum file size is exceeded. - * (If jpeg_mem_available always returns a large value, this routine can - * just take an error exit.) - */ - -EXTERN void jpeg_open_backing_store JPP((j_common_ptr cinfo, - backing_store_ptr info, - long total_bytes_needed)); - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. jpeg_mem_init will be called before anything is - * allocated (and, therefore, nothing in cinfo is of use except the error - * manager pointer). It should return a suitable default value for - * max_memory_to_use; this may subsequently be overridden by the surrounding - * application. (Note that max_memory_to_use is only important if - * jpeg_mem_available chooses to consult it ... no one else will.) - * jpeg_mem_term may assume that all requested memory has been freed and that - * all opened backing-store objects have been closed. - */ - -EXTERN long jpeg_mem_init JPP((j_common_ptr cinfo)); -EXTERN void jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/libs/jpeg6/jmorecfg.h b/libs/jpeg6/jmorecfg.h deleted file mode 100644 index e14f31bd..00000000 --- a/libs/jpeg6/jmorecfg.h +++ /dev/null @@ -1,348 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef CHAR_IS_UNSIGNED -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef CHAR_IS_UNSIGNED -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -/* INT32 must hold at least signed 32-bit values. */ - -//#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -//typedef long INT32; -//#endif - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These defines are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -#define METHODDEF static /* a function called through method pointers */ -#define LOCAL static /* a function used only in its module */ -#define GLOBAL /* a function referenced thru EXTERNs */ -#define EXTERN extern /* a reference to a GLOBAL function */ - - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifdef NEED_FAR_POINTERS -#undef FAR -#define FAR far -#else -#undef FAR -#define FAR -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -//#ifndef HAVE_BOOLEAN -//typedef int boolean; -//#endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ - -/* Capability options common to encoder and decoder: */ - -#undef DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#undef DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#undef D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#undef D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#undef BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#undef IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#undef UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not - * useful if you are using JPEG color spaces other than YCbCr or grayscale. - * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 2 /* Offset of Blue */ -// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=900 -// ydnar: setting this fucks jpeg loading in q3map2, disabling "fix" (3) -#define RGB_PIXELSIZE 4 /* JSAMPLEs per RGB scanline element */ - - -/* Definitions for speed-related optimizations. */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifndef INLINE -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE -#define INLINE /* default is to define it as empty */ -#endif -#endif - - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#define MULTIPLIER int /* type for fastest integer multiply */ -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/libs/jpeg6/jpeg6.vcproj b/libs/jpeg6/jpeg6.vcproj deleted file mode 100644 index 9e002501..00000000 --- a/libs/jpeg6/jpeg6.vcproj +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/jpeg6/jpegint.h b/libs/jpeg6/jpegint.h deleted file mode 100644 index ab5bee2c..00000000 --- a/libs/jpeg6/jpegint.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * jpegint.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides common declarations for the various JPEG modules. - * These declarations are considered internal to the JPEG library; most - * applications using the library shouldn't need to include this file. - */ - - -/* Declarations for both compression & decompression */ - -typedef enum { /* Operating modes for buffer controllers */ - JBUF_PASS_THRU, /* Plain stripwise operation */ - /* Remaining modes require a full-image buffer to have been created */ - JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ - JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ - JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ -} J_BUF_MODE; - -/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ -#define CSTATE_START 100 /* after create_compress */ -#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ -#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ -#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ -#define DSTATE_START 200 /* after create_decompress */ -#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ -#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ -#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ -#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ -#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ -#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ -#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ -#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ -#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ -#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ - - -/* Declarations for compression modules */ - -/* Master control module */ -struct jpeg_comp_master { - JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); - JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean call_pass_startup; /* True if pass_startup must be called */ - boolean is_last_pass; /* True during last pass */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_c_main_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail)); -}; - -/* Compression preprocessing (downsampling input buffer control) */ -struct jpeg_c_prep_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, - JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, - JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_c_coef_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf)); -}; - -/* Colorspace conversion */ -struct jpeg_color_converter { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, color_convert, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows)); -}; - -/* Downsampling */ -struct jpeg_downsampler { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, downsample, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_index, - JSAMPIMAGE output_buf, - JDIMENSION out_row_group_index)); - - boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Forward DCT (also controls coefficient quantization) */ -struct jpeg_forward_dct { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - /* perhaps this should be an array??? */ - JMETHOD(void, forward_DCT, (j_compress_ptr cinfo, - jpeg_component_info * compptr, - JSAMPARRAY sample_data, JBLOCKROW coef_blocks, - JDIMENSION start_row, JDIMENSION start_col, - JDIMENSION num_blocks)); -}; - -/* Entropy encoding */ -struct jpeg_entropy_encoder { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); - JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); -}; - -/* Marker writing */ -struct jpeg_marker_writer { - /* write_any_marker is exported for use by applications */ - /* Probably only COM and APPn markers should be written */ - JMETHOD(void, write_any_marker, (j_compress_ptr cinfo, int marker, - const JOCTET *dataptr, unsigned int datalen)); - JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); - JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); -}; - - -/* Declarations for decompression modules */ - -/* Master control module */ -struct jpeg_decomp_master { - JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ -}; - -/* Input control module */ -struct jpeg_input_controller { - JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); - JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - boolean has_multiple_scans; /* True if file has multiple scans */ - boolean eoi_reached; /* True when EOI has been consumed */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_d_main_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_d_coef_controller { - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); - JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); - JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, - JSAMPIMAGE output_buf)); - /* Pointer to array of coefficient virtual arrays, or NULL if none */ - jvirt_barray_ptr *coef_arrays; -}; - -/* Decompression postprocessing (color quantization buffer control) */ -struct jpeg_d_post_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Marker reading & parsing */ -struct jpeg_marker_reader { - JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); - /* Read markers until SOS or EOI. - * Returns same codes as are defined for jpeg_consume_input: - * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - */ - JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); - /* Read a restart marker --- exported for use by entropy decoder only */ - jpeg_marker_parser_method read_restart_marker; - /* Application-overridable marker processing methods */ - jpeg_marker_parser_method process_COM; - jpeg_marker_parser_method process_APPn[16]; - - /* State of marker reader --- nominally internal, but applications - * supplying COM or APPn handlers might like to know the state. - */ - boolean saw_SOI; /* found SOI? */ - boolean saw_SOF; /* found SOF? */ - int next_restart_num; /* next restart number expected (0-7) */ - unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ -}; - -/* Entropy decoding */ -struct jpeg_entropy_decoder { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); -}; - -/* Inverse DCT (also performs dequantization) */ -typedef JMETHOD(void, inverse_DCT_method_ptr, - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col)); - -struct jpeg_inverse_dct { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - /* It is useful to allow each component to have a separate IDCT method. */ - inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; -}; - -/* Upsampling (note that upsampler must also call color converter) */ -struct jpeg_upsampler { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, upsample, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); - - boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Colorspace conversion */ -struct jpeg_color_deconverter { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, color_convert, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows)); -}; - -/* Color quantization or color precision reduction */ -struct jpeg_color_quantizer { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); - JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, - int num_rows)); - JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); -}; - - -/* Miscellaneous useful macros */ - -#undef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#undef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - - -/* We assume that right shift corresponds to signed division by 2 with - * rounding towards minus infinity. This is correct for typical "arithmetic - * shift" instructions that shift in copies of the sign bit. But some - * C compilers implement >> with an unsigned shift. For these machines you - * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. - * It is only applied with constant shift counts. SHIFT_TEMPS must be - * included in the variables of any routine using RIGHT_SHIFT. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS INT32 shift_temp; -#define RIGHT_SHIFT(x,shft) \ - ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ - (shift_temp >> (shft))) -#else -#define SHIFT_TEMPS -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jinit_compress_master jICompress -#define jinit_c_master_control jICMaster -#define jinit_c_main_controller jICMainC -#define jinit_c_prep_controller jICPrepC -#define jinit_c_coef_controller jICCoefC -#define jinit_color_converter jICColor -#define jinit_downsampler jIDownsampler -#define jinit_forward_dct jIFDCT -#define jinit_huff_encoder jIHEncoder -#define jinit_phuff_encoder jIPHEncoder -#define jinit_marker_writer jIMWriter -#define jinit_master_decompress jIDMaster -#define jinit_d_main_controller jIDMainC -#define jinit_d_coef_controller jIDCoefC -#define jinit_d_post_controller jIDPostC -#define jinit_input_controller jIInCtlr -#define jinit_marker_reader jIMReader -#define jinit_huff_decoder jIHDecoder -#define jinit_phuff_decoder jIPHDecoder -#define jinit_inverse_dct jIIDCT -#define jinit_upsampler jIUpsampler -#define jinit_color_deconverter jIDColor -#define jinit_1pass_quantizer jI1Quant -#define jinit_2pass_quantizer jI2Quant -#define jinit_merged_upsampler jIMUpsampler -#define jinit_memory_mgr jIMemMgr -#define jdiv_round_up jDivRound -#define jround_up jRound -#define jcopy_sample_rows jCopySamples -#define jcopy_block_row jCopyBlocks -#define jzero_far jZeroFar -#define jpeg_zigzag_order jZIGTable -#define jpeg_natural_order jZAGTable -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Compression module initialization routines */ -EXTERN void jinit_compress_master JPP((j_compress_ptr cinfo)); -EXTERN void jinit_c_master_control JPP((j_compress_ptr cinfo, - boolean transcode_only)); -EXTERN void jinit_c_main_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_c_prep_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_c_coef_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_color_converter JPP((j_compress_ptr cinfo)); -EXTERN void jinit_downsampler JPP((j_compress_ptr cinfo)); -EXTERN void jinit_forward_dct JPP((j_compress_ptr cinfo)); -EXTERN void jinit_huff_encoder JPP((j_compress_ptr cinfo)); -EXTERN void jinit_phuff_encoder JPP((j_compress_ptr cinfo)); -EXTERN void jinit_marker_writer JPP((j_compress_ptr cinfo)); -/* Decompression module initialization routines */ -EXTERN void jinit_master_decompress JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_d_main_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_d_coef_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_d_post_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); -EXTERN void jinit_input_controller JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_marker_reader JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_huff_decoder JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_inverse_dct JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_upsampler JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_color_deconverter JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN void jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); -/* Memory manager initialization */ -EXTERN void jinit_memory_mgr JPP((j_common_ptr cinfo)); - -/* Utility routines in jutils.c */ -EXTERN long jdiv_round_up JPP((long a, long b)); -EXTERN long jround_up JPP((long a, long b)); -EXTERN void jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, JDIMENSION num_cols)); -EXTERN void jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, - JDIMENSION num_blocks)); -EXTERN void jzero_far JPP((void FAR * target, size_t bytestozero)); -/* Constant tables in jutils.c */ -extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ -extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ - -/* Suppress undefined-structure complaints if necessary. */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -#endif -#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/libs/jpeg6/jpgload.cpp b/libs/jpeg6/jpgload.cpp deleted file mode 100644 index 323b073a..00000000 --- a/libs/jpeg6/jpgload.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "radiant_jpeglib.h" -#include "jerror.h" -#include - -GLOBAL int LoadJPGBuff(unsigned char *fbuffer, int bufsize, unsigned char **pic, int *width, int *height ) -{ - - /* This struct contains the JPEG decompression parameters and pointers to - * working space (which is allocated as needed by the JPEG library). - */ - struct jpeg_decompress_struct cinfo; - /* We use our private extension JPEG error handler. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ - /* This struct represents a JPEG error handler. It is declared separately - * because applications often want to supply a specialized error handler - * (see the second half of this file for an example). But here we just - * take the easy way out and use the standard error handler, which will - * print a message on stderr and call exit() if compression fails. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ - - struct jpeg_error_mgr jerr; - /* More stuff */ - JSAMPARRAY buffer; /* Output row buffer */ - int row_stride; /* physical row width in output buffer */ - unsigned char *out, *bbuf; - int nSize; - int jmpret; - - // Rad additions: initialize the longjmp buffer - jmpret = setjmp( rad_loadfailed ); - if (jmpret != 0) - { - *pic = (unsigned char *)rad_errormsg; - return -1; - } - - /* Step 1: allocate and initialize JPEG decompression object */ - - /* We have to set up the error handler first, in case the initialization - * step fails. (Unlikely, but it could happen if you are out of memory.) - * This routine fills in the contents of struct jerr, and returns jerr's - * address which we place into the link field in cinfo. - */ - cinfo.err = jpeg_std_error(&jerr); - - /* Now we can initialize the JPEG decompression object. */ - jpeg_create_decompress(&cinfo); - - /* Step 2: specify data source (eg, a file) */ - - jpeg_stdio_src(&cinfo, fbuffer, bufsize); - - /* Step 3: read file parameters with jpeg_read_header() */ - - (void) jpeg_read_header(&cinfo, TRUE); - /* We can ignore the return value from jpeg_read_header since - * (a) suspension is not possible with the stdio data source, and - * (b) we passed TRUE to reject a tables-only JPEG file as an error. - * See libjpeg.doc for more info. - */ - - /* Step 4: set parameters for decompression */ - - /* In this example, we don't need to change any of the defaults set by - * jpeg_read_header(), so we do nothing here. - */ - - /* Step 5: Start decompressor */ - - (void) jpeg_start_decompress(&cinfo); - /* We can ignore the return value since suspension is not possible - * with the stdio data source. - */ - - /* ydnar: radiant only handles RGB, non-progressive format jpegs */ - if( cinfo.output_components != 4 ) - { - *pic = const_cast(reinterpret_cast("Non-RGB JPEG encountered (unsupported)")); - return -1; - } - if( cinfo.progressive_mode ) - { - *pic = const_cast(reinterpret_cast("Progressive JPEG encountered (unsupported)")); - return -1; - } - - /* We may need to do some setup of our own at this point before reading - * the data. After jpeg_start_decompress() we have the correct scaled - * output image dimensions available, as well as the output colormap - * if we asked for color quantization. - * In this example, we need to make an output work buffer of the right size. - */ - - /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; - nSize = cinfo.output_width*cinfo.output_height*cinfo.output_components; - - out = reinterpret_cast( malloc( nSize+ 1 ) ); - memset( out, 255, nSize + 1 ); - - *pic = out; - *width = cinfo.output_width; - *height = cinfo.output_height; - - /* Step 6: while (scan lines remain to be read) */ - /* jpeg_read_scanlines(...); */ - - /* Here we use the library's state variable cinfo.output_scanline as the - * loop counter, so that we don't have to keep track ourselves. - */ - while (cinfo.output_scanline < cinfo.output_height) - { - /* jpeg_read_scanlines expects an array of pointers to scanlines. - * Here the array is only one element long, but you could ask for - * more than one scanline at a time if that's more convenient. - */ - bbuf = out + row_stride * cinfo.output_scanline; - buffer = &bbuf; - (void) jpeg_read_scanlines( &cinfo, buffer, 1 ); - } - - // clear all the alphas to 255 - { - int i, j; - unsigned char *buf; - - buf = *pic; - - j = cinfo.output_width * cinfo.output_height * 4; - for ( i = 3 ; i < j ; i+=4 ) { - buf[i] = 255; - } - } - - /* Step 7: Finish decompression */ - - (void) jpeg_finish_decompress(&cinfo); - /* We can ignore the return value since suspension is not possible - * with the stdio data source. - */ - - /* Step 8: Release JPEG decompression object */ - - /* This is an important step since it will release a good deal of memory. */ - jpeg_destroy_decompress(&cinfo); - - /* After finish_decompress, we can close the input file. - * Here we postpone it until after no more JPEG errors are possible, - * so as to simplify the setjmp error logic above. (Actually, I don't - * think that jpeg_destroy can do an error exit, but why assume anything...) - */ - //free (fbuffer); - - /* At this point you may want to check to see whether any corrupt-data - * warnings occurred (test whether jerr.pub.num_warnings is nonzero). - */ - - /* And we're done! */ - return 0; -} diff --git a/libs/jpeg6/jutils.cpp b/libs/jpeg6/jutils.cpp deleted file mode 100644 index 549648de..00000000 --- a/libs/jpeg6/jutils.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* - * jutils.c - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains tables and miscellaneous utility routines needed - * for both compression and decompression. - * Note we prefix all global names with "j" to minimize conflicts with - * a surrounding application. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "radiant_jpeglib.h" - - -/* - * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element - * of a DCT block read in natural order (left to right, top to bottom). - */ - -const int jpeg_zigzag_order[DCTSIZE2] = { - 0, 1, 5, 6, 14, 15, 27, 28, - 2, 4, 7, 13, 16, 26, 29, 42, - 3, 8, 12, 17, 25, 30, 41, 43, - 9, 11, 18, 24, 31, 40, 44, 53, - 10, 19, 23, 32, 39, 45, 52, 54, - 20, 22, 33, 38, 46, 51, 55, 60, - 21, 34, 37, 47, 50, 56, 59, 61, - 35, 36, 48, 49, 57, 58, 62, 63 -}; - -/* - * jpeg_natural_order[i] is the natural-order position of the i'th element - * of zigzag order. - * - * When reading corrupted data, the Huffman decoders could attempt - * to reference an entry beyond the end of this array (if the decoded - * zero run length reaches past the end of the block). To prevent - * wild stores without adding an inner-loop test, we put some extra - * "63"s after the real entries. This will cause the extra coefficient - * to be stored in location 63 of the block, not somewhere random. - * The worst case would be a run-length of 15, which means we need 16 - * fake entries. - */ - -const int jpeg_natural_order[DCTSIZE2+16] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ - 63, 63, 63, 63, 63, 63, 63, 63 -}; - - -/* - * Arithmetic utilities - */ - -GLOBAL long -jdiv_round_up (long a, long b) -/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ -/* Assumes a >= 0, b > 0 */ -{ - return (a + b - 1L) / b; -} - - -GLOBAL long -jround_up (long a, long b) -/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ -/* Assumes a >= 0, b > 0 */ -{ - a += b - 1L; - return a - (a % b); -} - - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines below do it the hard way. (The performance cost - * is not all that great, because these routines aren't very heavily used.) - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ -#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case, define if we can */ -#ifdef USE_FMEM -#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) -#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) -#endif -#endif - - -GLOBAL void -jcopy_sample_rows (JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, JDIMENSION num_cols) -/* Copy some rows of samples from one place to another. - * num_rows rows are copied from input_array[source_row++] - * to output_array[dest_row++]; these areas may overlap for duplication. - * The source and destination arrays must be at least as wide as num_cols. - */ -{ - register JSAMPROW inptr, outptr; -#ifdef FMEMCOPY - register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#else - register JDIMENSION count; -#endif - register int row; - - input_array += source_row; - output_array += dest_row; - - for (row = num_rows; row > 0; row--) { - inptr = *input_array++; - outptr = *output_array++; -#ifdef FMEMCOPY - FMEMCOPY(outptr, inptr, count); -#else - for (count = num_cols; count > 0; count--) - *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ -#endif - } -} - - -GLOBAL void -jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, - JDIMENSION num_blocks) -/* Copy a row of coefficient blocks from one place to another. */ -{ -#ifdef FMEMCOPY - FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); -#else - register JCOEFPTR inptr, outptr; - register long count; - - inptr = (JCOEFPTR) input_row; - outptr = (JCOEFPTR) output_row; - for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { - *outptr++ = *inptr++; - } -#endif -} - - -GLOBAL void -jzero_far (void FAR * target, size_t bytestozero) -/* Zero out a chunk of FAR memory. */ -/* This might be sample-array data, block-array data, or alloc_large data. */ -{ -#ifdef FMEMZERO - FMEMZERO(target, bytestozero); -#else - register char FAR * ptr = (char FAR *) target; - register size_t count; - - for (count = bytestozero; count > 0; count--) { - *ptr++ = 0; - } -#endif -} diff --git a/libs/jpeg6/jversion.h b/libs/jpeg6/jversion.h deleted file mode 100644 index f2f1b8da..00000000 --- a/libs/jpeg6/jversion.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * jversion.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains software version identification. - */ - - -#define JVERSION "6 2-Aug-95" - -#define JCOPYRIGHT "Copyright (C) 1995, Thomas G. Lane" diff --git a/libs/jpeglib.h b/libs/jpeglib.h deleted file mode 100644 index f5b59010..00000000 --- a/libs/jpeglib.h +++ /dev/null @@ -1,1123 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* - * jpeglib.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// LZ: linux stuff -#if !defined (WIN32) - -#include -#include - -#ifndef boolean -#ifdef __cplusplus -#define boolean bool -#else -typedef int boolean; -#endif -#endif - -#endif - -#ifdef __MACOS__ - -// JDC: stuff to make mac version compile -#define boolean qboolean -#define register -#define INT32 int - -#endif - -// rad additions -// 11.29.99 - -//#include "cmdlib.h" -#ifdef _WIN32 -#include "windows.h" -#include "stdio.h" -#endif - -#ifndef INT32 -#define INT32 int -#endif - -// TTimo: if LoadJPGBuff returns -1, *pic is the error message -extern int LoadJPGBuff(unsigned char *fbuffer, int bufsize, unsigned char **pic, int *width, int *height ); -// rad end - - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jpeg6/jconfig.h" /* widely used configuration options */ -#endif -#include "jpeg6/jmorecfg.h" /* seldom changed options */ - - -/* Version ID for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". - */ - -#define JPEG_LIB_VERSION 60 /* Version 6 */ - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This field directly represents the contents of a JPEG DQT marker. - * Note: the values are always given in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples. Always DCTSIZE for compression. - * For decompression this is the size of the output from one DCT block, - * reflecting any scaling we choose to apply during the IDCT step. - * Values of 1,2,4,8 are likely to be supported. Note that different - * components may receive different IDCT scalings. - */ - int DCT_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface), thus - * downsampled_width = ceil(image_width * Hi/Hmax) - * and similarly for height. For decompression, IDCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is not currently used by the compressor. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - boolean is_decompressor; /* so common code can tell which is which */\ - int global_state /* for checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker: */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_create_compress jCreaCompress -#define jpeg_create_decompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN struct jpeg_error_mgr *jpeg_std_error JPP((struct jpeg_error_mgr *err)); - -/* Initialization and destruction of JPEG compression objects */ -/* NB: you must set up the error-manager BEFORE calling jpeg_create_xxx */ -EXTERN void jpeg_create_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_create_decompress JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN void jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN void jpeg_stdio_src JPP((j_decompress_ptr cinfo, unsigned char *infile, int bufsize)); - -/* Default parameter setup for compression */ -EXTERN void jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN void jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN void jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN void jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -EXTERN void jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN int jpeg_quality_scaling JPP((int quality)); -EXTERN void jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN JQUANT_TBL * jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN JHUFF_TBL * jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN void jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN JDIMENSION jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN void jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN JDIMENSION jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.doc concerning safe usage. */ -EXTERN void jpeg_write_marker JPP((j_compress_ptr cinfo, int marker, - const JOCTET *dataptr, unsigned int datalen)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN void jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN int jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN boolean jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN JDIMENSION jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN boolean jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN JDIMENSION jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN boolean jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN boolean jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN boolean jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN boolean jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN int jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN void jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN void jpeg_set_marker_processor JPP((j_decompress_ptr cinfo, - int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN jvirt_barray_ptr * jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN void jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN void jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN void jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN void jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN boolean jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* JPEGLIB_H */ diff --git a/libs/l_net/l_net.c b/libs/l_net/l_net.c index 558ec211..a8a59571 100644 --- a/libs/l_net/l_net.c +++ b/libs/l_net/l_net.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -82,10 +82,11 @@ void Net_SetAddressPort(address_t *address, int port) //=========================================================================== int Net_AddressCompare(address_t *addr1, address_t *addr2) { -#ifdef WIN32 - return _stricmp(addr1->ip, addr2->ip); -#else - return strcasecmp(addr1->ip, addr2->ip); +#ifdef _WIN32 + return stricmp(addr1->ip, addr2->ip); +#endif +#ifdef __linux__ + return strcasecmp(addr1->ip, addr2->ip); #endif } //end of the function Net_AddressCompare //=========================================================================== @@ -345,7 +346,9 @@ void Net_MyAddress(address_t *address) //=========================================================================== int Net_Setup(void) { - WINS_Init(); + if( !WINS_Init() ) + return qfalse; + // WinPrint("my address is %s\n", WINS_MyAddress()); // diff --git a/libs/l_net/l_net.h b/libs/l_net/l_net.h index 00096013..167a5a36 100644 --- a/libs/l_net/l_net.h +++ b/libs/l_net/l_net.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/l_net/l_net.vcproj b/libs/l_net/l_net.vcproj index ed866197..b9ff7052 100644 --- a/libs/l_net/l_net.vcproj +++ b/libs/l_net/l_net.vcproj @@ -1,177 +1,61 @@ - - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - + - + + + - + - + \ No newline at end of file diff --git a/libs/l_net/l_net_berkley.c b/libs/l_net/l_net_berkeley.c similarity index 98% rename from libs/l_net/l_net_berkley.c rename to libs/l_net/l_net_berkeley.c index 19d670b3..e7d0b961 100644 --- a/libs/l_net/l_net_berkley.c +++ b/libs/l_net/l_net_berkeley.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -30,12 +30,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //=========================================================================== //#include +#include #include #include #include #include "l_net.h" #include "l_net_wins.h" +#include #include #include #include @@ -46,6 +48,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define SOCKET_ERROR -1 #define INVALID_SOCKET -1 +extern void WinPrint(char *str, ...); + #define WinError WinPrint #define qtrue 1 @@ -171,6 +175,14 @@ int WINS_Init(void) // determine my name & address gethostname(buff, MAXHOSTNAMELEN); local = gethostbyname(buff); + + // When hostname can not be resolved, return gracefully + if( local == 0 ) + { + WinError("WINS_Init: Unable to resolve hostname\n"); + return 0; + } + myAddr = *(int *)local->h_addr_list[0]; // if the quake hostname isn't set, set it to the machine name @@ -230,7 +242,7 @@ void WINS_Shutdown(void) WINS_CloseSocket(net_controlsocket); // WSACleanup(); // - //WinPrint("Winsock Shutdown\n"); + WinPrint("Winsock Shutdown\n"); } //end of the function WINS_Shutdown //=========================================================================== // diff --git a/libs/l_net/l_net_wins.c b/libs/l_net/l_net_wins.c index faf7d88c..8a73f996 100644 --- a/libs/l_net/l_net_wins.c +++ b/libs/l_net/l_net_wins.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -260,7 +260,7 @@ void WINS_Shutdown(void) WINS_CloseSocket(net_controlsocket); WSACleanup(); // - //WinPrint("Winsock Shutdown\n"); + WinPrint("Winsock Shutdown\n"); } //end of the function WINS_Shutdown //=========================================================================== // diff --git a/libs/l_net/l_net_wins.h b/libs/l_net/l_net_wins.h index ad1b41fb..73598795 100644 --- a/libs/l_net/l_net_wins.h +++ b/libs/l_net/l_net_wins.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/libs.vcproj b/libs/libs.vcproj deleted file mode 100644 index c644478d..00000000 --- a/libs/libs.vcproj +++ /dev/null @@ -1,876 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/maplib.cpp b/libs/maplib.cpp deleted file mode 100644 index 80504f1d..00000000 --- a/libs/maplib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "maplib.h" diff --git a/libs/maplib.h b/libs/maplib.h deleted file mode 100644 index 6a2d5cea..00000000 --- a/libs/maplib.h +++ /dev/null @@ -1,282 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_MAPLIB_H) -#define INCLUDED_MAPLIB_H - -#include "nameable.h" -#include "mapfile.h" - -#include "traverselib.h" -#include "transformlib.h" -#include "scenelib.h" -#include "string/string.h" -#include "instancelib.h" -#include "selectionlib.h" -#include "generic/callback.h" - - -class NameableString : public Nameable -{ - CopiedString m_name; -public: - NameableString(const char* name) - : m_name(name) - { - } - - const char* name() const - { - return m_name.c_str(); - } - void attach(const NameCallback& callback) - { - } - void detach(const NameCallback& callback) - { - } -}; - - -class UndoFileChangeTracker : public UndoTracker, public MapFile -{ - std::size_t m_size; - std::size_t m_saved; - typedef void (UndoFileChangeTracker::*Pending)(); - Pending m_pending; - Callback m_changed; - -public: - UndoFileChangeTracker() : m_size(0), m_saved(MAPFILE_MAX_CHANGES), m_pending(0) - { - } - void print() - { - globalOutputStream() << "saved: " << Unsigned(m_saved) << " size: " << Unsigned(m_size) << "\n"; - } - - void push() - { - ++m_size; - m_changed(); - //print(); - } - void pop() - { - --m_size; - m_changed(); - //print(); - } - void pushOperation() - { - if(m_size < m_saved) - { - // redo queue has been flushed.. it is now impossible to get back to the saved state via undo/redo - m_saved = MAPFILE_MAX_CHANGES; - } - push(); - } - void clear() - { - m_size = 0; - m_changed(); - //print(); - } - void begin() - { - m_pending = Pending(&UndoFileChangeTracker::pushOperation); - } - void undo() - { - m_pending = Pending(&UndoFileChangeTracker::pop); - } - void redo() - { - m_pending = Pending(&UndoFileChangeTracker::push); - } - - void changed() - { - if(m_pending != 0) - { - ((*this).*m_pending)(); - m_pending = 0; - } - } - - void save() - { - m_saved = m_size; - m_changed(); - } - bool saved() const - { - return m_saved == m_size; - } - - void setChangedCallback(const Callback& changed) - { - m_changed = changed; - m_changed(); - } - - std::size_t changes() const - { - return m_size; - } -}; - - -class MapRoot : public scene::Node::Symbiot, public scene::Instantiable, public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - scene::Node m_node; - IdentityTransform m_transform; - TraversableNodeSet m_traverse; - InstanceSet m_instances; - typedef SelectableInstance Instance; - NameableString m_name; - UndoFileChangeTracker m_changeTracker; -public: - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_traverse; - } - TransformNode& get(NullType) - { - return m_transform; - } - Nameable& get(NullType) - { - return m_name; - } - MapFile& get(NullType) - { - return m_changeTracker; - } - - MapRoot(const char* name) : m_node(this, this, StaticTypeCasts::instance().get()), m_name(name) - { - m_node.m_isRoot = true; - - m_traverse.attach(this); - - GlobalUndoSystem().trackerAttach(m_changeTracker); - } - ~MapRoot() - { - } - void release() - { - GlobalUndoSystem().trackerDetach(m_changeTracker); - - m_traverse.detach(this); - delete this; - } - scene::Node& node() - { - return m_node; - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_traverse.instanceAttach(path_find_mapfile(path.begin(), path.end())); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_traverse.instanceDetach(path_find_mapfile(path.begin(), path.end())); - } - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Node& clone() const - { - return (new MapRoot(*this))->node(); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new Instance(path, parent); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - instanceAttach(path); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - instanceDetach(path); - return m_instances.erase(observer, path); - } -}; - -inline void MapRoot_construct() -{ -} - -inline void MapRoot_destroy() -{ -} - -inline NodeSmartReference NewMapRoot(const char* name) -{ - return NodeSmartReference((new MapRoot(name))->node()); -} - - -#endif diff --git a/libs/math/aabb.cpp b/libs/math/aabb.cpp deleted file mode 100644 index 8bed2209..00000000 --- a/libs/math/aabb.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "aabb.h" - diff --git a/libs/math/aabb.h b/libs/math/aabb.h deleted file mode 100644 index 1341a340..00000000 --- a/libs/math/aabb.h +++ /dev/null @@ -1,331 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_AABB_H) -#define INCLUDED_MATH_AABB_H - -/// \file -/// \brief Axis-aligned bounding-box data types and related operations. - -#include "math/matrix.h" -#include "math/plane.h" - -class AABB -{ -public: - Vector3 origin, extents; - - AABB() : origin(0, 0, 0), extents(-1,-1,-1) - { - } - AABB(const Vector3& origin_, const Vector3& extents_) : - origin(origin_), extents(extents_) - { - } -}; - -const float c_aabb_max = FLT_MAX; - -inline bool extents_valid(float f) -{ - return f >= 0.0f && f <= c_aabb_max; -} - -inline bool origin_valid(float f) -{ - return f >= -c_aabb_max && f <= c_aabb_max; -} - -inline bool aabb_valid(const AABB& aabb) -{ - return origin_valid(aabb.origin[0]) - && origin_valid(aabb.origin[1]) - && origin_valid(aabb.origin[2]) - && extents_valid(aabb.extents[0]) - && extents_valid(aabb.extents[1]) - && extents_valid(aabb.extents[2]); -} - -inline AABB aabb_for_minmax(const Vector3& min, const Vector3& max) -{ - AABB aabb; - aabb.origin = vector3_mid(min, max); - aabb.extents = vector3_subtracted(max, aabb.origin); - return aabb; -} - -template -class AABBExtend -{ -public: - static void apply(AABB& aabb, const Vector3& point) - { - float displacement = point[Index::VALUE] - aabb.origin[Index::VALUE]; - float half_difference = static_cast(0.5 * (fabs(displacement) - aabb.extents[Index::VALUE])); - if(half_difference > 0.0f) - { - aabb.origin[Index::VALUE] += (displacement >= 0.0f) ? half_difference : -half_difference; - aabb.extents[Index::VALUE] += half_difference; - } - } - static void apply(AABB& aabb, const AABB& other) - { - float displacement = other.origin[Index::VALUE] - aabb.origin[Index::VALUE]; - float difference = other.extents[Index::VALUE] - aabb.extents[Index::VALUE]; - if(fabs(displacement) > fabs(difference)) - { - float half_difference = static_cast(0.5 * (fabs(displacement) + difference)); - if(half_difference > 0.0f) - { - aabb.origin[Index::VALUE] += (displacement >= 0.0f) ? half_difference : -half_difference; - aabb.extents[Index::VALUE] += half_difference; - } - } - else if(difference > 0.0f) - { - aabb.origin[Index::VALUE] = other.origin[Index::VALUE]; - aabb.extents[Index::VALUE] = other.extents[Index::VALUE]; - } - } -}; - -inline void aabb_extend_by_point(AABB& aabb, const Vector3& point) -{ - AABBExtend< IntegralConstant<0> >::apply(aabb, point); - AABBExtend< IntegralConstant<1> >::apply(aabb, point); - AABBExtend< IntegralConstant<2> >::apply(aabb, point); -} - -inline void aabb_extend_by_point_safe(AABB& aabb, const Vector3& point) -{ - if(aabb_valid(aabb)) - { - aabb_extend_by_point(aabb, point); - } - else - { - aabb.origin = point; - aabb.extents = Vector3(0, 0, 0); - } -} - -class AABBExtendByPoint -{ - AABB& m_aabb; -public: - AABBExtendByPoint(AABB& aabb) : m_aabb(aabb) - { - } - void operator()(const Vector3& point) const - { - aabb_extend_by_point_safe(m_aabb, point); - } -}; - -inline void aabb_extend_by_aabb(AABB& aabb, const AABB& other) -{ - AABBExtend< IntegralConstant<0> >::apply(aabb, other); - AABBExtend< IntegralConstant<1> >::apply(aabb, other); - AABBExtend< IntegralConstant<2> >::apply(aabb, other); -} - -inline void aabb_extend_by_aabb_safe(AABB& aabb, const AABB& other) -{ - if(aabb_valid(aabb) && aabb_valid(other)) - { - aabb_extend_by_aabb(aabb, other); - } - else if(aabb_valid(other)) - { - aabb = other; - } -} - -inline void aabb_extend_by_vec3(AABB& aabb, const Vector3& extension) -{ - vector3_add(aabb.extents, extension); -} - - - - -template -inline bool aabb_intersects_point_dimension(const AABB& aabb, const Vector3& point) -{ - return fabs(point[Index::VALUE] - aabb.origin[Index::VALUE]) < aabb.extents[Index::VALUE]; -} - -inline bool aabb_intersects_point(const AABB& aabb, const Vector3& point) -{ - return aabb_intersects_point_dimension< IntegralConstant<0> >(aabb, point) - && aabb_intersects_point_dimension< IntegralConstant<1> >(aabb, point) - && aabb_intersects_point_dimension< IntegralConstant<2> >(aabb, point); -} - -template -inline bool aabb_intersects_aabb_dimension(const AABB& aabb, const AABB& other) -{ - return fabs(other.origin[Index::VALUE] - aabb.origin[Index::VALUE]) < (aabb.extents[Index::VALUE] + other.extents[Index::VALUE]); -} - -inline bool aabb_intersects_aabb(const AABB& aabb, const AABB& other) -{ - return aabb_intersects_aabb_dimension< IntegralConstant<0> >(aabb, other) - && aabb_intersects_aabb_dimension< IntegralConstant<1> >(aabb, other) - && aabb_intersects_aabb_dimension< IntegralConstant<2> >(aabb, other); -} - -inline unsigned int aabb_classify_plane(const AABB& aabb, const Plane3& plane) -{ - double distance_origin = vector3_dot(plane.normal(), aabb.origin) + plane.dist(); - - if(fabs(distance_origin) < (fabs(plane.a * aabb.extents[0]) - + fabs(plane.b * aabb.extents[1]) - + fabs(plane.c * aabb.extents[2]))) - { - return 1; // partially inside - } - else if (distance_origin < 0) - { - return 2; // totally inside - } - return 0; // totally outside -} - -inline unsigned int aabb_oriented_classify_plane(const AABB& aabb, const Matrix4& transform, const Plane3& plane) -{ - double distance_origin = vector3_dot(plane.normal(), aabb.origin) + plane.dist(); - - if(fabs(distance_origin) < (fabs(aabb.extents[0] * vector3_dot(plane.normal(), vector4_to_vector3(transform.x()))) - + fabs(aabb.extents[1] * vector3_dot(plane.normal(), vector4_to_vector3(transform.y()))) - + fabs(aabb.extents[2] * vector3_dot(plane.normal(), vector4_to_vector3(transform.z()))))) - { - return 1; // partially inside - } - else if (distance_origin < 0) - { - return 2; // totally inside - } - return 0; // totally outside -} - -inline void aabb_corners(const AABB& aabb, Vector3 corners[8]) -{ - Vector3 min(vector3_subtracted(aabb.origin, aabb.extents)); - Vector3 max(vector3_added(aabb.origin, aabb.extents)); - corners[0] = Vector3(min[0], max[1], max[2]); - corners[1] = Vector3(max[0], max[1], max[2]); - corners[2] = Vector3(max[0], min[1], max[2]); - corners[3] = Vector3(min[0], min[1], max[2]); - corners[4] = Vector3(min[0], max[1], min[2]); - corners[5] = Vector3(max[0], max[1], min[2]); - corners[6] = Vector3(max[0], min[1], min[2]); - corners[7] = Vector3(min[0], min[1], min[2]); -} - -inline void aabb_corners_oriented(const AABB& aabb, const Matrix4& rotation, Vector3 corners[8]) -{ - Vector3 x = vector4_to_vector3(rotation.x()) * aabb.extents.x(); - Vector3 y = vector4_to_vector3(rotation.y()) * aabb.extents.y(); - Vector3 z = vector4_to_vector3(rotation.z()) * aabb.extents.z(); - - corners[0] = aabb.origin + -x + y + z; - corners[1] = aabb.origin + x + y + z; - corners[2] = aabb.origin + x + -y + z; - corners[3] = aabb.origin + -x + -y + z; - corners[4] = aabb.origin + -x + y + -z; - corners[5] = aabb.origin + x + y + -z; - corners[6] = aabb.origin + x + -y + -z; - corners[7] = aabb.origin + -x + -y + -z; -} - -inline void aabb_planes(const AABB& aabb, Plane3 planes[6]) -{ - planes[0] = Plane3(g_vector3_axes[0], aabb.origin[0] + aabb.extents[0]); - planes[1] = Plane3(vector3_negated(g_vector3_axes[0]), -(aabb.origin[0] - aabb.extents[0])); - planes[2] = Plane3(g_vector3_axes[1], aabb.origin[1] + aabb.extents[1]); - planes[3] = Plane3(vector3_negated(g_vector3_axes[1]), -(aabb.origin[1] - aabb.extents[1])); - planes[4] = Plane3(g_vector3_axes[2], aabb.origin[2] + aabb.extents[2]); - planes[5] = Plane3(vector3_negated(g_vector3_axes[2]), -(aabb.origin[2] - aabb.extents[2])); -} - -inline void aabb_planes_oriented(const AABB& aabb, const Matrix4& rotation, Plane3 planes[6]) -{ - double x = vector3_dot(vector4_to_vector3(rotation.x()), aabb.origin); - double y = vector3_dot(vector4_to_vector3(rotation.y()), aabb.origin); - double z = vector3_dot(vector4_to_vector3(rotation.z()), aabb.origin); - - planes[0] = Plane3(vector4_to_vector3(rotation.x()), x + aabb.extents[0]); - planes[1] = Plane3(-vector4_to_vector3(rotation.x()), -(x - aabb.extents[0])); - planes[2] = Plane3(vector4_to_vector3(rotation.y()), y + aabb.extents[1]); - planes[3] = Plane3(-vector4_to_vector3(rotation.y()), -(y - aabb.extents[1])); - planes[4] = Plane3(vector4_to_vector3(rotation.z()), z + aabb.extents[2]); - planes[5] = Plane3(-vector4_to_vector3(rotation.z()), -(z - aabb.extents[2])); -} - -const Vector3 aabb_normals[6] = { - Vector3( 1, 0, 0 ), - Vector3( 0, 1, 0 ), - Vector3( 0, 0, 1 ), - Vector3(-1, 0, 0 ), - Vector3( 0,-1, 0 ), - Vector3( 0, 0,-1 ), -}; - -const float aabb_texcoord_topleft[2] = { 0, 0 }; -const float aabb_texcoord_topright[2] = { 1, 0 }; -const float aabb_texcoord_botleft[2] = { 0, 1 }; -const float aabb_texcoord_botright[2] = { 1, 1 }; - - -inline AABB aabb_for_oriented_aabb(const AABB& aabb, const Matrix4& transform) -{ - return AABB( - matrix4_transformed_point(transform, aabb.origin), - Vector3( - static_cast(fabs(transform[0] * aabb.extents[0]) - + fabs(transform[4] * aabb.extents[1]) - + fabs(transform[8] * aabb.extents[2])), - static_cast(fabs(transform[1] * aabb.extents[0]) - + fabs(transform[5] * aabb.extents[1]) - + fabs(transform[9] * aabb.extents[2])), - static_cast(fabs(transform[2] * aabb.extents[0]) - + fabs(transform[6] * aabb.extents[1]) - + fabs(transform[10] * aabb.extents[2])) - ) - ); -} - -inline AABB aabb_for_oriented_aabb_safe(const AABB& aabb, const Matrix4& transform) -{ - if(aabb_valid(aabb)) - { - return aabb_for_oriented_aabb(aabb, transform); - } - return aabb; -} - -inline AABB aabb_infinite() -{ - return AABB(Vector3(0, 0, 0), Vector3(c_aabb_max, c_aabb_max, c_aabb_max)); -} - -#endif diff --git a/libs/math/curve.cpp b/libs/math/curve.cpp deleted file mode 100644 index dd2bc0e3..00000000 --- a/libs/math/curve.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "curve.h" - diff --git a/libs/math/curve.h b/libs/math/curve.h deleted file mode 100644 index 9000734c..00000000 --- a/libs/math/curve.h +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_CURVE_H) -#define INCLUDED_MATH_CURVE_H - -/// \file -/// \brief Curve data types and related operations. - -#include "debugging/debugging.h" -#include "container/array.h" -#include - - -template -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 1; // general case not implemented - } -}; - -typedef IntegralConstant<0> Zero; -typedef IntegralConstant<1> One; -typedef IntegralConstant<2> Two; -typedef IntegralConstant<3> Three; -typedef IntegralConstant<4> Four; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 1; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 1 - t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return (1 - t) * (1 - t); - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 2 * (1 - t) * t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return t * t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return (1 - t) * (1 - t) * (1 - t); - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 3 * (1 - t) * (1 - t) * t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return 3 * (1 - t) * t * t; - } -}; - -template<> -struct BernsteinPolynomial -{ - static double apply(double t) - { - return t * t * t; - } -}; - -typedef Array ControlPoints; - -inline Vector3 CubicBezier_evaluate(const Vector3* firstPoint, double t) -{ - Vector3 result(0, 0, 0); - double denominator = 0; - - { - double weight = BernsteinPolynomial::apply(t); - result += vector3_scaled(*firstPoint++, weight); - denominator += weight; - } - { - double weight = BernsteinPolynomial::apply(t); - result += vector3_scaled(*firstPoint++, weight); - denominator += weight; - } - { - double weight = BernsteinPolynomial::apply(t); - result += vector3_scaled(*firstPoint++, weight); - denominator += weight; - } - { - double weight = BernsteinPolynomial::apply(t); - result += vector3_scaled(*firstPoint++, weight); - denominator += weight; - } - - return result / denominator; -} - -inline Vector3 CubicBezier_evaluateMid(const Vector3* firstPoint) -{ - return vector3_scaled(firstPoint[0], 0.125) - + vector3_scaled(firstPoint[1], 0.375) - + vector3_scaled(firstPoint[2], 0.375) - + vector3_scaled(firstPoint[3], 0.125); -} - -inline Vector3 CatmullRom_evaluate(const ControlPoints& controlPoints, double t) -{ - // scale t to be segment-relative - t *= double(controlPoints.size() - 1); - - // subtract segment index; - std::size_t segment = 0; - for(std::size_t i = 0; i < controlPoints.size() - 1; ++i) - { - if(t <= double(i+1)) - { - segment = i; - break; - } - } - t -= segment; - - const double reciprocal_alpha = 1.0 / 3.0; - - Vector3 bezierPoints[4]; - bezierPoints[0] = controlPoints[segment]; - bezierPoints[1] = (segment > 0) - ? controlPoints[segment] + vector3_scaled(controlPoints[segment + 1] - controlPoints[segment - 1], reciprocal_alpha * 0.5) - : controlPoints[segment] + vector3_scaled(controlPoints[segment + 1] - controlPoints[segment], reciprocal_alpha); - bezierPoints[2] = (segment < controlPoints.size() - 2) - ? controlPoints[segment + 1] + vector3_scaled(controlPoints[segment] - controlPoints[segment + 2], reciprocal_alpha * 0.5) - : controlPoints[segment + 1] + vector3_scaled(controlPoints[segment] - controlPoints[segment + 1], reciprocal_alpha); - bezierPoints[3] = controlPoints[segment + 1]; - return CubicBezier_evaluate(bezierPoints, t); -} - -typedef Array Knots; - -inline double BSpline_basis(const Knots& knots, std::size_t i, std::size_t degree, double t) -{ - if(degree == 0) - { - if(knots[i] <= t - && t < knots[i + 1] - && knots[i] < knots[i + 1]) - { - return 1; - } - return 0; - } - double leftDenom = knots[i + degree] - knots[i]; - double left = (leftDenom == 0) ? 0 : ((t - knots[i]) / leftDenom) * BSpline_basis(knots, i, degree - 1, t); - double rightDenom = knots[i + degree + 1] - knots[i + 1]; - double right = (rightDenom == 0) ? 0 : ((knots[i + degree + 1] - t) / rightDenom) * BSpline_basis(knots, i + 1, degree - 1, t); - return left + right; -} - -inline Vector3 BSpline_evaluate(const ControlPoints& controlPoints, const Knots& knots, std::size_t degree, double t) -{ - Vector3 result(0, 0, 0); - for(std::size_t i = 0; i < controlPoints.size(); ++i) - { - result += vector3_scaled(controlPoints[i], BSpline_basis(knots, i, degree, t)); - } - return result; -} - -typedef Array NURBSWeights; - -inline Vector3 NURBS_evaluate(const ControlPoints& controlPoints, const NURBSWeights& weights, const Knots& knots, std::size_t degree, double t) -{ - Vector3 result(0, 0, 0); - double denominator = 0; - for(std::size_t i = 0; i < controlPoints.size(); ++i) - { - double weight = weights[i] * BSpline_basis(knots, i, degree, t); - result += vector3_scaled(controlPoints[i], weight); - denominator += weight; - } - return result / denominator; -} - -inline void KnotVector_openUniform(Knots& knots, std::size_t count, std::size_t degree) -{ - knots.resize(count + degree + 1); - - std::size_t equalKnots = 1; - - for(std::size_t i = 0; i < equalKnots; ++i) - { - knots[i] = 0; - knots[knots.size() - (i + 1)] = 1; - } - - std::size_t difference = knots.size() - 2 * (equalKnots); - for(std::size_t i = 0; i < difference; ++i) - { - knots[i + equalKnots] = Knots::value_type(double(i + 1) * 1.0 / double(difference + 1)); - } -} - -#endif diff --git a/libs/math/expression.cpp b/libs/math/expression.cpp deleted file mode 100644 index 5fc8d051..00000000 --- a/libs/math/expression.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "expression.h" - -Vector3 testAdded1(const Vector3& a, const Vector3& b) -{ - return vector3_added(a, vector3_added(a, b)); -} - -Vector3 testAdded2(const Vector3& a, const Vector3& b) -{ - return vector3_for_expression( vector_added( vector3_identity(a), vector_added( vector3_identity(a), vector3_identity(b) ) ) ); -} - -Vector3 testMultiplied1(const Vector3& a, const Vector3& b) -{ - return vector3_scaled(a, b); -} - -Vector3 testMultiplied2(const Vector3& a, const Vector3& b) -{ - return vector3_for_expression( vector_multiplied( vector3_identity(a), vector3_identity(b) ) ); -} - -Vector3 testCross1(const Vector3& a, const Vector3& b) -{ - return vector3_cross(a, b); -} - -Vector3 testCross2(const Vector3& a, const Vector3& b) -{ - return vector3_for_expression( vector_cross( vector3_identity(a), vector3_identity(b) ) ); -} - -double testDot1(const Vector3& a, const Vector3& b) -{ - return vector3_dot(a, b); -} - -double testDot2(const Vector3& a, const Vector3& b) -{ - return float_for_expression( vector_dot( vector3_identity(a), vector3_identity(b) ) ); -} - -double testLength1(const Vector3& a) -{ - return vector3_length(a); -} - -double testLength2(const Vector3& a) -{ - return float_for_expression( vector_length( vector3_identity(a) ) ); -} - -Vector3 testNormalised1(const Vector3& a) -{ - return vector3_normalised(a); -} - -Vector3 testNormalised2(const Vector3& a) -{ - return vector3_for_expression( vector_normalised( vector3_identity(a) ) ); -} - -Vector3 testNegated1(const Vector3& a) -{ - return vector3_negated(a); -} - -Vector3 testNegated2(const Vector3& a) -{ - return vector3_for_expression( vector_negated( vector3_identity(a) ) ); -} - -Vector3 testScaled1(const Vector3& a, const double& b) -{ - return vector3_scaled(a, b); -} - -Vector3 testScaled2(const Vector3& a, const double& b) -{ - return vector3_for_expression( vector_scaled( vector3_identity(a), float_literal(b) ) ); -} - -Vector3 testMatrixMultiplied1(const Vector3& a, const Matrix4& b) -{ - return matrix4_transformed_point(b, vector3_added(a, Vector3(1, 0, 0))); -} - -Vector3 testMatrixMultiplied2(const Vector3& a, const Matrix4& b) -{ - return vector3_for_expression( - point_multiplied( - vector_added( - vector3_identity(a), - vector3_literal(Vector3(1, 0, 0)) - ), - matrix4_identity(b) - ) - ); -} - -Matrix4 testMatrix4Multiplied1(const Matrix4& a, const Matrix4& b) -{ - return matrix4_multiplied_by_matrix4(a, matrix4_multiplied_by_matrix4(a, b)); -} - -Matrix4 testMatrix4Multiplied2(const Matrix4& a, const Matrix4& b) -{ - return matrix4_for_expression( - matrix4_multiplied( - matrix4_identity(a), - matrix4_identity(b) - ) - ); -} - -Matrix4 testMatrix4AffineMultiplied1(const Matrix4& a, const Matrix4& b) -{ - return matrix4_affine_multiplied_by_matrix4(a, b); -} - -Matrix4 testMatrix4AffineMultiplied2(const Matrix4& a, const Matrix4& b) -{ - return matrix4_affine_for_expression( - matrix4_multiplied( - matrix4_identity(a), - matrix4_identity(b) - ) - ); -} - -Matrix4 testMatrix4MultipliedConstant1(const Matrix4& a) -{ - return matrix4_multiplied_by_matrix4(a, g_matrix4_identity); -} - -Matrix4 testMatrix4MultipliedConstant2(const Matrix4& a) -{ - return matrix4_for_expression( - matrix4_multiplied( - matrix4_identity(a), - matrix4_identity(g_matrix4_identity) - ) - ); -} -Matrix4 testMatrix4Transposed1(const Matrix4& a) -{ - return matrix4_transposed(a); -} - -Matrix4 testMatrix4Transposed2(const Matrix4& a) -{ - return matrix4_for_expression( matrix_transposed( matrix4_identity(a) ) ); -} - -Vector3 testMulti1(const Matrix4& a, const Vector3& b, const Vector3& c) -{ - return vector3_added(matrix4_transformed_point(matrix4_transposed(a), b), c); -} - -Vector3 testMulti2(const Matrix4& a, const Vector3& b, const Vector3& c) -{ - return vector3_for_expression( - vector_added( - point_multiplied( - vector3_identity(b), - matrix_transposed(matrix4_identity(a)) - ), - vector3_identity(c) - ) - ); -} - -template -class TestBinaryFunction -{ - typedef Value(*Function)(const First&, const Second&); - Function m_function; -public: - - TestBinaryFunction(Function function) : m_function(function) - { - } - Value run(const First& first, const Second& second) const - { - return m_function(first, second); - } -}; - -template -class TestUnaryFunction -{ - typedef Value(*Function)(const First&); - Function m_function; -public: - - TestUnaryFunction(Function function) : m_function(function) - { - } - Value run(const First& first) const - { - return m_function(first); - } -}; - -class TestAll -{ -public: - TestAll() - { - Vector3 result1 = TestBinaryFunction(testAdded1).run(Vector3(0, 0, 0), Vector3(1, 1, 1)); - Vector3 result2 = TestBinaryFunction(testAdded2).run(Vector3(0, 0, 0), Vector3(1, 1, 1)); - Vector3 result3 = TestBinaryFunction(testMultiplied1).run(Vector3(1, 2, 3), Vector3(2, 1, 0.5f)); - Vector3 result4 = TestBinaryFunction(testMultiplied2).run(Vector3(1, 2, 3), Vector3(2, 1, 0.5f)); - Vector3 result5 = TestBinaryFunction(testScaled1).run(Vector3(1, 2, 3), 2.0); - Vector3 result6 = TestBinaryFunction(testScaled2).run(Vector3(1, 2, 3), 2.0); - Vector3 result7 = TestBinaryFunction(testMatrixMultiplied1).run(Vector3(1, 2, 3), matrix4_rotation_for_x_degrees(90)); - Vector3 result8 = TestBinaryFunction(testMatrixMultiplied2).run(Vector3(1, 2, 3), matrix4_rotation_for_x_degrees(90)); - Vector3 result9 = TestUnaryFunction(testNormalised1).run(Vector3(1, 2, 3)); - Vector3 result10 = TestUnaryFunction(testNormalised2).run(Vector3(1, 2, 3)); - } -} g_testAll; - diff --git a/libs/math/expression.h b/libs/math/expression.h deleted file mode 100644 index c609bb16..00000000 --- a/libs/math/expression.h +++ /dev/null @@ -1,617 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_EXPRESSION_H) -#define INCLUDED_EXPRESSION_H - -#include - -template -class Literal -{ - Value m_value; -public: - typedef Value value_type; - - Literal(const Value& value) - : m_value(value) - { - } - const value_type& eval() const - { - return m_value; - } -}; - -template -inline Literal float_literal(const Value& value) -{ - return Literal(value); -} - -template -inline float float_for_expression(const Expression& expression) -{ - return expression.eval(); -} - - -template -class ScalarDivided -{ - First first; - Second second; -public: - typedef typename First::value_type value_type; - - ScalarDivided(const First& first_, const Second& second_) : first(first_), second(second_) - { - } - value_type eval() const - { - return static_cast(first.eval() / second.eval()); - } -}; - -template -inline ScalarDivided float_divided(const First& first, const Second& second) -{ - return ScalarDivided(first, second); -} - -template -inline ScalarDivided, First> float_reciprocal(const First& first) -{ - typedef typename First::value_type first_value_type; - return ScalarDivided, First>(float_literal(first_value_type(1.0)), first); -} - -template -class SquareRoot -{ - First first; -public: - typedef typename First::value_type value_type; - - SquareRoot(const First& first_) : first(first_) - { - } - value_type eval() const - { - return static_cast(sqrt(first.eval())); - } -}; - -template -inline SquareRoot float_square_root(const First& first) -{ - return SquareRoot(first); -} - - -template -class BasicVector3Literal -{ - const BasicVector3 m_value; -public: - typedef Element value_type; - typedef IntegralConstant<3> dimension; - - BasicVector3Literal(const BasicVector3& value) - : m_value(value) - { - } - const value_type& eval(unsigned int i) const - { - return m_value[i]; - } -}; - -template -inline BasicVector3Literal vector3_literal(const BasicVector3& value) -{ - return BasicVector3Literal(value); -} - -typedef BasicVector3Literal Vector3Literal; - -template -class BasicVector3Identity -{ - const BasicVector3& m_value; -public: - typedef Element value_type; - typedef IntegralConstant<3> dimension; - - BasicVector3Identity(const BasicVector3& value) - : m_value(value) - { - } - const value_type& eval(unsigned int i) const - { - return m_value[i]; - } -}; - -template -inline BasicVector3Identity vector3_identity(const BasicVector3& value) -{ - return BasicVector3Identity(value); -} - -typedef BasicVector3Identity Vector3Identity; - -template -inline BasicVector3 vector3_for_expression(const Expression& expression) -{ - return Vector3(expression.eval(0), expression.eval(1), expression.eval(2)); -} - - -template -class VectorScalar -{ - First first; - Literal second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorScalar(const First& first_, const Second& second_) - : first(first_), second(second_.eval()) - { - } - value_type eval(unsigned int i) const - { - return Operation::apply( first.eval(i), second.eval() ); - } -}; - - - -template -class VectorVector -{ - First first; - Second second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorVector(const First& first_, const Second& second_) - : first(first_), second(second_) - { - } - value_type eval(unsigned int i) const - { - return Operation::apply(first.eval(i), second.eval(i)); - } -}; - -template -class Added -{ -public: - typedef First value_type; - - static value_type apply(const First& first, const Second& second) - { - return static_cast(first + second); - } -}; - -template -inline VectorVector, First, Second> -vector_added(const First& first, const Second& second) -{ - typedef typename First::value_type first_value_type; - typedef typename Second::value_type second_value_type; - return VectorVector, First, Second>(first, second); -} - -template -class Multiplied -{ -public: - typedef First value_type; - - static value_type apply(const First& first, const Second& second) - { - return static_cast(first * second); - } -}; - -template -inline VectorVector, First, Second> -vector_multiplied(const First& first, const Second& second) -{ - typedef typename First::value_type first_value_type; - typedef typename Second::value_type second_value_type; - return VectorVector, First, Second>(first, second); -} - -template -inline VectorScalar, First, Second> -vector_scaled(const First& first, const Second& second) -{ - typedef typename First::value_type first_value_type; - typedef typename Second::value_type second_value_type; - return VectorScalar, First, Second>(first, second); -} - -template -class Negated -{ -public: - typedef First value_type; - - static value_type apply(const First& first) - { - return -first; - } -}; - -template -class VectorUnary -{ - First first; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorUnary(const First& first_) : first(first_) - { - } - value_type eval(unsigned int i) const - { - return Operation::apply(first.eval(i)); - } -}; - -template -inline VectorUnary > -vector_negated(const First& first) -{ - typedef typename First::value_type first_value_type; - return VectorUnary >(first); -} - -template -class VectorCross -{ - First first; - Second second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorCross(const First& first_, const Second& second_) - : first(first_), second(second_) - { - } - value_type eval(unsigned int i) const - { - return first.eval((i+1)%3) * second.eval((i+2)%3) - first.eval((i+2)%3) * second.eval((i+1)%3); - } -}; - -template -inline VectorCross -vector_cross(const First& first, const Second& second) -{ - return VectorCross(first, second); -} - - -template -class VectorDot -{ - First first; - Second second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorDot(const First& first_, const Second& second_) - : first(first_), second(second_) - { - } - - template - struct eval_dot - { - static value_type apply(const First& first, const Second& second) - { - return static_cast( - first.eval(Index::VALUE) * second.eval(Index::VALUE) - + eval_dot< IntegralConstant >::apply(first, second) - ); - } - }; - - template<> - struct eval_dot< IntegralConstant<0> > - { - static value_type apply(const First& first, const Second& second) - { - return first.eval(0) * second.eval(0); - } - }; - - value_type eval() const - { - return eval_dot< IntegralConstant >::apply(first, second); - } -}; - - -template -inline VectorDot vector_dot(const First& first, const Second& second) -{ - return VectorDot(first, second); -} - -template -class VectorLengthSquared -{ - First first; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - VectorLengthSquared(const First& first_) - : first(first_) - { - } - - static value_type squared(const value_type& value) - { - return value * value; - } - - template - struct eval_squared - { - static value_type apply(const First& first) - { - return static_cast( - squared(first.eval(Index::VALUE)) - + eval_squared< IntegralConstant >::apply(first) - ); - } - }; - - template<> - struct eval_squared< IntegralConstant<0> > - { - static value_type apply(const First& first) - { - return squared(first.eval(0)); - } - }; - - value_type eval() const - { - return eval_squared< IntegralConstant >::apply(first); - } -}; - -template -inline VectorLengthSquared vector_length_squared(const First& first) -{ - return VectorLengthSquared(first); -} - -template -inline SquareRoot< VectorLengthSquared > vector_length(const First& first) -{ - return float_square_root(vector_length_squared(first)); -} - -#if 1 -template -inline VectorScalar< - Multiplied, - First, - // multiple evaulations of subexpression - ScalarDivided< - Literal, - SquareRoot< - VectorLengthSquared - > - > -> vector_normalised(const First& first) -{ - typedef typename First::value_type first_value_type; - return vector_scaled(first, float_reciprocal(vector_length(first))); -} -#else -template -inline VectorScalar< - Multiplied, - First, - // single evaluation of subexpression - Literal -> -vector_normalised(const First& first) -{ - typedef typename First::value_type first_value_type; - return vector_scaled(first, float_literal(static_cast(first_value_type(1.0) / vector_length(first).eval()))); -} -#endif - - -class Matrix4Literal -{ - const Matrix4 m_value; -public: - typedef float value_type; - typedef IntegralConstant<4> dimension0; - typedef IntegralConstant<4> dimension1; - - Matrix4Literal(const Matrix4& value) - : m_value(value) - { - } - const value_type& eval(unsigned int r, unsigned int c) const - { - return m_value[r*4+c]; - } -}; - -inline Matrix4Literal matrix4_literal(const Matrix4& value) -{ - return Matrix4Literal(value); -} - -class Matrix4Identity -{ - const Matrix4& m_value; -public: - typedef float value_type; - typedef IntegralConstant<4> dimension0; - typedef IntegralConstant<4> dimension1; - - Matrix4Identity(const Matrix4& value) - : m_value(value) - { - } - const value_type& eval(unsigned int r, unsigned int c) const - { - return m_value[r*4+c]; - } -}; - -inline Matrix4Identity matrix4_identity(const Matrix4& value) -{ - return Matrix4Identity(value); -} - -template -inline Matrix4 matrix4_for_expression(const Expression& expression) -{ - return Matrix4( - expression.eval(0, 0), expression.eval(0, 1), expression.eval(0, 2), expression.eval(0, 3), - expression.eval(1, 0), expression.eval(1, 1), expression.eval(1, 2), expression.eval(1, 3), - expression.eval(2, 0), expression.eval(2, 1), expression.eval(2, 2), expression.eval(2, 3), - expression.eval(3, 0), expression.eval(3, 1), expression.eval(3, 2), expression.eval(3, 3) - ); -} - -template -inline Matrix4 matrix4_affine_for_expression(const Expression& expression) -{ - return Matrix4( - expression.eval(0, 0), expression.eval(0, 1), expression.eval(0, 2), 0, - expression.eval(1, 0), expression.eval(1, 1), expression.eval(1, 2), 0, - expression.eval(2, 0), expression.eval(2, 1), expression.eval(2, 2), 0, - expression.eval(3, 0), expression.eval(3, 1), expression.eval(3, 2), 1 - ); -} - - -template -class PointMultiplied -{ - const First& first; - const Second& second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension dimension; - - PointMultiplied(const First& first_, const Second& second_) - : first(first_), second(second_) - { - } - value_type eval(unsigned int i) const - { - return static_cast(second.eval(0, i) * first.eval(0) - + second.eval(1, i) * first.eval(1) - + second.eval(2, i) * first.eval(2) - + second.eval(3, i)); - } -}; - -template -inline PointMultiplied point_multiplied(const First& point, const Second& matrix) -{ - return PointMultiplied(point, matrix); -} - -template -class Matrix4Multiplied -{ - const First& first; - const Second& second; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension0 dimension0; - typedef typename First::dimension1 dimension1; - - Matrix4Multiplied(const First& first_, const Second& second_) - : first(first_), second(second_) - { - } - - value_type eval(unsigned int r, unsigned int c) const - { - return static_cast( - second.eval(r, 0) * first.eval(0, c) - + second.eval(r, 1) * first.eval(1, c) - + second.eval(r, 2) * first.eval(2, c) - + second.eval(r, 3) * first.eval(3, c) - ); - } -}; - -template -inline Matrix4Multiplied matrix4_multiplied(const First& first, const Second& second) -{ - return Matrix4Multiplied(first, second); -} - -template -class MatrixTransposed -{ - const First& first; -public: - typedef typename First::value_type value_type; - typedef typename First::dimension0 dimension0; - typedef typename First::dimension1 dimension1; - - MatrixTransposed(const First& first_) - : first(first_) - { - } - - value_type eval(unsigned int r, unsigned int c) const - { - return first.eval(c, r); - } -}; - -template -inline MatrixTransposed matrix_transposed(const First& first) -{ - return MatrixTransposed(first); -} - -#endif diff --git a/libs/math/frustum.cpp b/libs/math/frustum.cpp deleted file mode 100644 index 84481e20..00000000 --- a/libs/math/frustum.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "frustum.h" - diff --git a/libs/math/frustum.h b/libs/math/frustum.h deleted file mode 100644 index fe98db20..00000000 --- a/libs/math/frustum.h +++ /dev/null @@ -1,629 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_FRUSTUM_H) -#define INCLUDED_MATH_FRUSTUM_H - -/// \file -/// \brief View-frustum data types and related operations. - -#include "generic/enumeration.h" -#include "math/matrix.h" -#include "math/plane.h" -#include "math/aabb.h" -#include "math/line.h" - -inline Matrix4 matrix4_frustum(float left, float right, float bottom, float top, float nearval, float farval) -{ - return Matrix4( - static_cast( (2*nearval) / (right-left) ), - 0, - 0, - 0, - 0, - static_cast( (2*nearval) / (top-bottom) ), - 0, - 0, - static_cast( (right+left) / (right-left) ), - static_cast( (top+bottom) / (top-bottom) ), - static_cast( -(farval+nearval) / (farval-nearval) ), - -1, - 0, - 0, - static_cast( -(2*farval*nearval) / (farval-nearval) ), - 0 - ); -} - - - -typedef unsigned char ClipResult; -const ClipResult c_CLIP_PASS = 0x00; // 000000 -const ClipResult c_CLIP_LT_X = 0x01; // 000001 -const ClipResult c_CLIP_GT_X = 0x02; // 000010 -const ClipResult c_CLIP_LT_Y = 0x04; // 000100 -const ClipResult c_CLIP_GT_Y = 0x08; // 001000 -const ClipResult c_CLIP_LT_Z = 0x10; // 010000 -const ClipResult c_CLIP_GT_Z = 0x20; // 100000 -const ClipResult c_CLIP_FAIL = 0x3F; // 111111 - -template -class Vector4ClipLT -{ -public: - static bool compare(const Vector4& self) - { - return self[Index::VALUE] < self[3]; - } - static double scale(const Vector4& self, const Vector4& other) - { - return (self[Index::VALUE] - self[3]) / (other[3] - other[Index::VALUE]); - } -}; - -template -class Vector4ClipGT -{ -public: - static bool compare(const Vector4& self) - { - return self[Index::VALUE] > -self[3]; - } - static double scale(const Vector4& self, const Vector4& other) - { - return (self[Index::VALUE] + self[3]) / (-other[3] - other[Index::VALUE]); - } -}; - -template -class Vector4ClipPolygon -{ -public: - typedef Vector4* iterator; - typedef const Vector4* const_iterator; - - static std::size_t apply(const_iterator first, const_iterator last, iterator out) - { - const_iterator next = first, i = last - 1; - iterator tmp(out); - bool b0 = ClipPlane::compare(*i); - while(next != last) - { - bool b1 = ClipPlane::compare(*next); - if(b0 ^ b1) - { - *out = vector4_subtracted(*next, *i); - - double scale = ClipPlane::scale(*i, *out); - - (*out)[0] = static_cast((*i)[0] + scale*((*out)[0])); - (*out)[1] = static_cast((*i)[1] + scale*((*out)[1])); - (*out)[2] = static_cast((*i)[2] + scale*((*out)[2])); - (*out)[3] = static_cast((*i)[3] + scale*((*out)[3])); - - ++out; - } - - if(b1) - { - *out = *next; - ++out; - } - - i = next; - ++next; - b0 = b1; - } - - return out - tmp; - } -}; - -#define CLIP_X_LT_W(p) (Vector4ClipLT< IntegralConstant<0> >::compare(p)) -#define CLIP_X_GT_W(p) (Vector4ClipGT< IntegralConstant<0> >::compare(p)) -#define CLIP_Y_LT_W(p) (Vector4ClipLT< IntegralConstant<1> >::compare(p)) -#define CLIP_Y_GT_W(p) (Vector4ClipGT< IntegralConstant<1> >::compare(p)) -#define CLIP_Z_LT_W(p) (Vector4ClipLT< IntegralConstant<2> >::compare(p)) -#define CLIP_Z_GT_W(p) (Vector4ClipGT< IntegralConstant<2> >::compare(p)) - -inline ClipResult homogenous_clip_point(const Vector4& clipped) -{ - ClipResult result = c_CLIP_FAIL; - if(CLIP_X_LT_W(clipped)) result &= ~c_CLIP_LT_X; // X < W - if(CLIP_X_GT_W(clipped)) result &= ~c_CLIP_GT_X; // X > -W - if(CLIP_Y_LT_W(clipped)) result &= ~c_CLIP_LT_Y; // Y < W - if(CLIP_Y_GT_W(clipped)) result &= ~c_CLIP_GT_Y; // Y > -W - if(CLIP_Z_LT_W(clipped)) result &= ~c_CLIP_LT_Z; // Z < W - if(CLIP_Z_GT_W(clipped)) result &= ~c_CLIP_GT_Z; // Z > -W - return result; -} - -/// \brief Clips \p point by canonical matrix \p self. -/// Stores the result in \p clipped. -/// Returns a bitmask indicating which clip-planes the point was outside. -inline ClipResult matrix4_clip_point(const Matrix4& self, const Vector3& point, Vector4& clipped) -{ - clipped[0] = point[0]; - clipped[1] = point[1]; - clipped[2] = point[2]; - clipped[3] = 1; - matrix4_transform_vector4(self, clipped); - return homogenous_clip_point(clipped); -} - - -inline std::size_t homogenous_clip_triangle(Vector4 clipped[9]) -{ - Vector4 buffer[9]; - std::size_t count = 3; - count = Vector4ClipPolygon< Vector4ClipLT< IntegralConstant<0> > >::apply(clipped, clipped + count, buffer); - count = Vector4ClipPolygon< Vector4ClipGT< IntegralConstant<0> > >::apply(buffer, buffer + count, clipped); - count = Vector4ClipPolygon< Vector4ClipLT< IntegralConstant<1> > >::apply(clipped, clipped + count, buffer); - count = Vector4ClipPolygon< Vector4ClipGT< IntegralConstant<1> > >::apply(buffer, buffer + count, clipped); - count = Vector4ClipPolygon< Vector4ClipLT< IntegralConstant<2> > >::apply(clipped, clipped + count, buffer); - return Vector4ClipPolygon< Vector4ClipGT< IntegralConstant<2> > >::apply(buffer, buffer + count, clipped); -} - -/// \brief Transforms and clips the triangle formed by \p p0, \p p1, \p p2 by the canonical matrix \p self. -/// Stores the resulting polygon in \p clipped. -/// Returns the number of points in the resulting polygon. -inline std::size_t matrix4_clip_triangle(const Matrix4& self, const Vector3& p0, const Vector3& p1, const Vector3& p2, Vector4 clipped[9]) -{ - clipped[0][0] = p0[0]; - clipped[0][1] = p0[1]; - clipped[0][2] = p0[2]; - clipped[0][3] = 1; - clipped[1][0] = p1[0]; - clipped[1][1] = p1[1]; - clipped[1][2] = p1[2]; - clipped[1][3] = 1; - clipped[2][0] = p2[0]; - clipped[2][1] = p2[1]; - clipped[2][2] = p2[2]; - clipped[2][3] = 1; - - matrix4_transform_vector4(self, clipped[0]); - matrix4_transform_vector4(self, clipped[1]); - matrix4_transform_vector4(self, clipped[2]); - - return homogenous_clip_triangle(clipped); -} - -inline std::size_t homogenous_clip_line(Vector4 clipped[2]) -{ - const Vector4& p0 = clipped[0]; - const Vector4& p1 = clipped[1]; - - // early out - { - ClipResult mask0 = homogenous_clip_point(clipped[0]); - ClipResult mask1 = homogenous_clip_point(clipped[1]); - - if((mask0 | mask1) == c_CLIP_PASS) // both points passed all planes - return 2; - - if(mask0 & mask1) // both points failed any one plane - return 0; - } - - { - const bool index = CLIP_X_LT_W(p0); - if(index ^ CLIP_X_LT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[0] - p0[3]) / (clip[3] - clip[0]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - { - const bool index = CLIP_X_GT_W(p0); - if(index ^ CLIP_X_GT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[0] + p0[3]) / (-clip[3] - clip[0]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - { - const bool index = CLIP_Y_LT_W(p0); - if(index ^ CLIP_Y_LT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[1] - p0[3]) / (clip[3] - clip[1]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - { - const bool index = CLIP_Y_GT_W(p0); - if(index ^ CLIP_Y_GT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[1] + p0[3]) / (-clip[3] - clip[1]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - { - const bool index = CLIP_Z_LT_W(p0); - if(index ^ CLIP_Z_LT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[2] - p0[3]) / (clip[3] - clip[2]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - { - const bool index = CLIP_Z_GT_W(p0); - if(index ^ CLIP_Z_GT_W(p1)) - { - Vector4 clip(vector4_subtracted(p1, p0)); - - double scale = (p0[2] + p0[3]) / (-clip[3] - clip[2]); - - clip[0] = static_cast(p0[0] + scale * clip[0]); - clip[1] = static_cast(p0[1] + scale * clip[1]); - clip[2] = static_cast(p0[2] + scale * clip[2]); - clip[3] = static_cast(p0[3] + scale * clip[3]); - - clipped[index] = clip; - } - else if(index == 0) - return 0; - } - - return 2; -} - -/// \brief Transforms and clips the line formed by \p p0, \p p1 by the canonical matrix \p self. -/// Stores the resulting line in \p clipped. -/// Returns the number of points in the resulting line. -inline std::size_t matrix4_clip_line(const Matrix4& self, const Vector3& p0, const Vector3& p1, Vector4 clipped[2]) -{ - clipped[0][0] = p0[0]; - clipped[0][1] = p0[1]; - clipped[0][2] = p0[2]; - clipped[0][3] = 1; - clipped[1][0] = p1[0]; - clipped[1][1] = p1[1]; - clipped[1][2] = p1[2]; - clipped[1][3] = 1; - - matrix4_transform_vector4(self, clipped[0]); - matrix4_transform_vector4(self, clipped[1]); - - return homogenous_clip_line(clipped); -} - - - - -struct Frustum -{ - Plane3 right, left, bottom, top, back, front; - - Frustum() - { - } - Frustum(const Plane3& _right, - const Plane3& _left, - const Plane3& _bottom, - const Plane3& _top, - const Plane3& _back, - const Plane3& _front) - : right(_right), left(_left), bottom(_bottom), top(_top), back(_back), front(_front) - { - } -}; - -inline Frustum frustum_transformed(const Frustum& frustum, const Matrix4& transform) -{ - return Frustum( - plane3_transformed(frustum.right, transform), - plane3_transformed(frustum.left, transform), - plane3_transformed(frustum.bottom, transform), - plane3_transformed(frustum.top, transform), - plane3_transformed(frustum.back, transform), - plane3_transformed(frustum.front, transform) - ); -} - -inline Frustum frustum_inverse_transformed(const Frustum& frustum, const Matrix4& transform) -{ - return Frustum( - plane3_inverse_transformed(frustum.right, transform), - plane3_inverse_transformed(frustum.left, transform), - plane3_inverse_transformed(frustum.bottom, transform), - plane3_inverse_transformed(frustum.top, transform), - plane3_inverse_transformed(frustum.back, transform), - plane3_inverse_transformed(frustum.front, transform) - ); -} - -inline bool viewproj_test_point(const Matrix4& viewproj, const Vector3& point) -{ - Vector4 hpoint(matrix4_transformed_vector4(viewproj, Vector4(point, 1.0f))); - if(fabs(hpoint[0]) < fabs(hpoint[3]) - && fabs(hpoint[1]) < fabs(hpoint[3]) - && fabs(hpoint[2]) < fabs(hpoint[3])) - return true; - return false; -} - -inline bool viewproj_test_transformed_point(const Matrix4& viewproj, const Vector3& point, const Matrix4& localToWorld) -{ - return viewproj_test_point(viewproj, matrix4_transformed_point(localToWorld, point)); -} - -inline Frustum frustum_from_viewproj(const Matrix4& viewproj) -{ - return Frustum - ( - plane3_normalised(Plane3(viewproj[ 3] - viewproj[ 0], viewproj[ 7] - viewproj[ 4], viewproj[11] - viewproj[ 8], viewproj[15] - viewproj[12])), - plane3_normalised(Plane3(viewproj[ 3] + viewproj[ 0], viewproj[ 7] + viewproj[ 4], viewproj[11] + viewproj[ 8], viewproj[15] + viewproj[12])), - plane3_normalised(Plane3(viewproj[ 3] + viewproj[ 1], viewproj[ 7] + viewproj[ 5], viewproj[11] + viewproj[ 9], viewproj[15] + viewproj[13])), - plane3_normalised(Plane3(viewproj[ 3] - viewproj[ 1], viewproj[ 7] - viewproj[ 5], viewproj[11] - viewproj[ 9], viewproj[15] - viewproj[13])), - plane3_normalised(Plane3(viewproj[ 3] - viewproj[ 2], viewproj[ 7] - viewproj[ 6], viewproj[11] - viewproj[10], viewproj[15] - viewproj[14])), - plane3_normalised(Plane3(viewproj[ 3] + viewproj[ 2], viewproj[ 7] + viewproj[ 6], viewproj[11] + viewproj[10], viewproj[15] + viewproj[14])) - ); -} - -struct VolumeIntersection -{ - enum Value - { - OUTSIDE, - INSIDE, - PARTIAL - }; -}; - -typedef EnumeratedValue VolumeIntersectionValue; - -const VolumeIntersectionValue c_volumeOutside(VolumeIntersectionValue::OUTSIDE); -const VolumeIntersectionValue c_volumeInside(VolumeIntersectionValue::INSIDE); -const VolumeIntersectionValue c_volumePartial(VolumeIntersectionValue::PARTIAL); - -inline VolumeIntersectionValue frustum_test_aabb(const Frustum& frustum, const AABB& aabb) -{ - VolumeIntersectionValue result = c_volumeInside; - - switch(aabb_classify_plane(aabb, frustum.right)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - switch(aabb_classify_plane(aabb, frustum.left)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - switch(aabb_classify_plane(aabb, frustum.bottom)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - switch(aabb_classify_plane(aabb, frustum.top)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - switch(aabb_classify_plane(aabb, frustum.back)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - switch(aabb_classify_plane(aabb, frustum.front)) - { - case 2: - return c_volumeOutside; - case 1: - result = c_volumePartial; - } - - return result; -} - -inline double plane_distance_to_point(const Plane3& plane, const Vector3& point) -{ - return vector3_dot(plane.normal(), point) + plane.d; -} - -inline double plane_distance_to_oriented_extents(const Plane3& plane, const Vector3& extents, const Matrix4& orientation) -{ - return fabs(extents[0] * vector3_dot(plane.normal(), vector4_to_vector3(orientation.x()))) - + fabs(extents[1] * vector3_dot(plane.normal(), vector4_to_vector3(orientation.y()))) - + fabs(extents[2] * vector3_dot(plane.normal(), vector4_to_vector3(orientation.z()))); -} - -/// \brief Return false if \p aabb with \p orientation is partially or completely outside \p plane. -inline bool plane_contains_oriented_aabb(const Plane3& plane, const AABB& aabb, const Matrix4& orientation) -{ - double dot = plane_distance_to_point(plane, aabb.origin); - return !(dot > 0 || -dot < plane_distance_to_oriented_extents(plane, aabb.extents, orientation)); -} - -inline VolumeIntersectionValue frustum_intersects_transformed_aabb(const Frustum& frustum, const AABB& aabb, const Matrix4& localToWorld) -{ - AABB aabb_world(aabb); - matrix4_transform_point(localToWorld, aabb_world.origin); - - if(plane_contains_oriented_aabb(frustum.right, aabb_world, localToWorld) - || plane_contains_oriented_aabb(frustum.left, aabb_world, localToWorld) - || plane_contains_oriented_aabb(frustum.bottom, aabb_world, localToWorld) - || plane_contains_oriented_aabb(frustum.top, aabb_world, localToWorld) - || plane_contains_oriented_aabb(frustum.back, aabb_world, localToWorld) - || plane_contains_oriented_aabb(frustum.front, aabb_world, localToWorld)) - return c_volumeOutside; - return c_volumeInside; -} - -inline bool plane3_test_point(const Plane3& plane, const Vector3& point) -{ - return vector3_dot(point, plane.normal()) + plane.dist() <= 0; -} - -inline bool plane3_test_line(const Plane3& plane, const Segment& segment) -{ - return segment_classify_plane(segment, plane) == 2; -} - -inline bool frustum_test_point(const Frustum& frustum, const Vector3& point) -{ - return !plane3_test_point(frustum.right, point) - && !plane3_test_point(frustum.left, point) - && !plane3_test_point(frustum.bottom, point) - && !plane3_test_point(frustum.top, point) - && !plane3_test_point(frustum.back, point) - && !plane3_test_point(frustum.front, point); -} - -inline bool frustum_test_line(const Frustum& frustum, const Segment& segment) -{ - return !plane3_test_line(frustum.right, segment) - && !plane3_test_line(frustum.left, segment) - && !plane3_test_line(frustum.bottom, segment) - && !plane3_test_line(frustum.top, segment) - && !plane3_test_line(frustum.back, segment) - && !plane3_test_line(frustum.front, segment); -} - -inline bool viewer_test_plane(const Vector4& viewer, const Plane3& plane) -{ - return ((plane.a * viewer[0]) - + (plane.b * viewer[1]) - + (plane.c * viewer[2]) - + (plane.d * viewer[3])) > 0; -} - -inline Vector3 triangle_cross(const Vector3& p0, const Vector3& p1, const Vector3& p2) -{ - return vector3_cross(vector3_subtracted(p1, p0), vector3_subtracted(p1, p2)); -} - -inline bool viewer_test_triangle(const Vector4& viewer, const Vector3& p0, const Vector3& p1, const Vector3& p2) -{ - Vector3 cross(triangle_cross(p0, p1, p2)); - return ((viewer[0] * cross[0]) - + (viewer[1] * cross[1]) - + (viewer[2] * cross[2]) - + (viewer[3] * 0)) > 0; -} - -inline Vector4 viewer_from_transformed_viewer(const Vector4& viewer, const Matrix4& transform) -{ - if(viewer[3] == 0) - { - return Vector4(matrix4_transformed_direction(transform, vector4_to_vector3(viewer)), 0); - } - else - { - return Vector4(matrix4_transformed_point(transform, vector4_to_vector3(viewer)), viewer[3]); - } -} - -inline bool viewer_test_transformed_plane(const Vector4& viewer, const Plane3& plane, const Matrix4& localToWorld) -{ -#if 0 - return viewer_test_plane(viewer_from_transformed_viewer(viewer, matrix4_affine_inverse(localToWorld)), plane); -#else - return viewer_test_plane(viewer, plane3_transformed(plane, localToWorld)); -#endif -} - -inline Vector4 viewer_from_viewproj(const Matrix4& viewproj) -{ - // get viewer pos in object coords - Vector4 viewer(matrix4_transformed_vector4(matrix4_full_inverse(viewproj), Vector4(0, 0, -1, 0))); - if(viewer[3] != 0) // non-affine matrix - { - viewer[0] /= viewer[3]; - viewer[1] /= viewer[3]; - viewer[2] /= viewer[3]; - viewer[3] /= viewer[3]; - } - return viewer; -} - -#endif diff --git a/libs/math/line.cpp b/libs/math/line.cpp deleted file mode 100644 index a0bdea1a..00000000 --- a/libs/math/line.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "line.h" - diff --git a/libs/math/line.h b/libs/math/line.h deleted file mode 100644 index 26d58369..00000000 --- a/libs/math/line.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_LINE_H) -#define INCLUDED_MATH_LINE_H - -/// \file -/// \brief Line data types and related operations. - -#include "math/vector.h" -#include "math/plane.h" - -/// \brief A line segment defined by a start point and and end point. -class Line -{ -public: - Vector3 start, end; - - Line() - { - } - Line(const Vector3& start_, const Vector3& end_) : start(start_), end(end_) - { - } -}; - -inline Vector3 line_closest_point(const Line& line, const Vector3& point) -{ - Vector3 v = line.end - line.start; - Vector3 w = point - line.start; - - double c1 = vector3_dot(w,v); - if ( c1 <= 0 ) - return line.start; - - double c2 = vector3_dot(v,v); - if ( c2 <= c1 ) - return line.end; - - return Vector3(line.start + v * (c1 / c2)); -} - - -class Segment -{ -public: - Vector3 origin, extents; - - Segment() - { - } - Segment(const Vector3& origin_, const Vector3& extents_) : - origin(origin_), extents(extents_) - { - } -}; - - -inline Segment segment_for_startend(const Vector3& start, const Vector3& end) -{ - Segment segment; - segment.origin = vector3_mid(start, end); - segment.extents = vector3_subtracted(end, segment.origin); - return segment; -} - -inline unsigned int segment_classify_plane(const Segment& segment, const Plane3& plane) -{ - double distance_origin = vector3_dot(plane.normal(), segment.origin) + plane.dist(); - - if (fabs(distance_origin) < fabs(vector3_dot(plane.normal(), segment.extents))) - { - return 1; // partially inside - } - else if (distance_origin < 0) - { - return 2; // totally inside - } - return 0; // totally outside -} - - -class Ray -{ -public: - Vector3 origin, direction; - - Ray() - { - } - Ray(const Vector3& origin_, const Vector3& direction_) : - origin(origin_), direction(direction_) - { - } -}; - -inline Ray ray_for_points(const Vector3& origin, const Vector3& p2) -{ - return Ray(origin, vector3_normalised(vector3_subtracted(p2, origin))); -} - -inline void ray_transform(Ray& ray, const Matrix4& matrix) -{ - matrix4_transform_point(matrix, ray.origin); - matrix4_transform_direction(matrix, ray.direction); -} - -// closest-point-on-line -inline double ray_squared_distance_to_point(const Ray& ray, const Vector3& point) -{ - return vector3_length_squared( - vector3_subtracted( - point, - vector3_added( - ray.origin, - vector3_scaled( - ray.direction, - vector3_dot( - vector3_subtracted(point, ray.origin), - ray.direction - ) - ) - ) - ) - ); -} - -inline double ray_distance_to_plane(const Ray& ray, const Plane3& plane) -{ - return -(vector3_dot(plane.normal(), ray.origin) - plane.dist()) / vector3_dot(ray.direction, plane.normal()); -} - -#endif diff --git a/libs/math/matrix.cpp b/libs/math/matrix.cpp deleted file mode 100644 index e3831647..00000000 --- a/libs/math/matrix.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "matrix.h" - diff --git a/libs/math/matrix.h b/libs/math/matrix.h deleted file mode 100644 index b28c2688..00000000 --- a/libs/math/matrix.h +++ /dev/null @@ -1,1322 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_MATRIX_H) -#define INCLUDED_MATH_MATRIX_H - -/// \file -/// \brief Matrix data types and related operations. - -#include "math/vector.h" - -/// \brief A 4x4 matrix stored in single-precision floating-point. -class Matrix4 -{ - float m_elements[16]; -public: - - Matrix4() - { - } - Matrix4(float xx_, float xy_, float xz_, float xw_, - float yx_, float yy_, float yz_, float yw_, - float zx_, float zy_, float zz_, float zw_, - float tx_, float ty_, float tz_, float tw_) - { - xx() = xx_; - xy() = xy_; - xz() = xz_; - xw() = xw_; - yx() = yx_; - yy() = yy_; - yz() = yz_; - yw() = yw_; - zx() = zx_; - zy() = zy_; - zz() = zz_; - zw() = zw_; - tx() = tx_; - ty() = ty_; - tz() = tz_; - tw() = tw_; - } - - float& xx() - { - return m_elements[0]; - } - const float& xx() const - { - return m_elements[0]; - } - float& xy() - { - return m_elements[1]; - } - const float& xy() const - { - return m_elements[1]; - } - float& xz() - { - return m_elements[2]; - } - const float& xz() const - { - return m_elements[2]; - } - float& xw() - { - return m_elements[3]; - } - const float& xw() const - { - return m_elements[3]; - } - float& yx() - { - return m_elements[4]; - } - const float& yx() const - { - return m_elements[4]; - } - float& yy() - { - return m_elements[5]; - } - const float& yy() const - { - return m_elements[5]; - } - float& yz() - { - return m_elements[6]; - } - const float& yz() const - { - return m_elements[6]; - } - float& yw() - { - return m_elements[7]; - } - const float& yw() const - { - return m_elements[7]; - } - float& zx() - { - return m_elements[8]; - } - const float& zx() const - { - return m_elements[8]; - } - float& zy() - { - return m_elements[9]; - } - const float& zy() const - { - return m_elements[9]; - } - float& zz() - { - return m_elements[10]; - } - const float& zz() const - { - return m_elements[10]; - } - float& zw() - { - return m_elements[11]; - } - const float& zw() const - { - return m_elements[11]; - } - float& tx() - { - return m_elements[12]; - } - const float& tx() const - { - return m_elements[12]; - } - float& ty() - { - return m_elements[13]; - } - const float& ty() const - { - return m_elements[13]; - } - float& tz() - { - return m_elements[14]; - } - const float& tz() const - { - return m_elements[14]; - } - float& tw() - { - return m_elements[15]; - } - const float& tw() const - { - return m_elements[15]; - } - - Vector4& x() - { - return reinterpret_cast(xx()); - } - const Vector4& x() const - { - return reinterpret_cast(xx()); - } - Vector4& y() - { - return reinterpret_cast(yx()); - } - const Vector4& y() const - { - return reinterpret_cast(yx()); - } - Vector4& z() - { - return reinterpret_cast(zx()); - } - const Vector4& z() const - { - return reinterpret_cast(zx()); - } - Vector4& t() - { - return reinterpret_cast(tx()); - } - const Vector4& t() const - { - return reinterpret_cast(tx()); - } - - const float& index(std::size_t i) const - { - return m_elements[i]; - } - float& index(std::size_t i) - { - return m_elements[i]; - } - const float& operator[](std::size_t i) const - { - return m_elements[i]; - } - float& operator[](std::size_t i) - { - return m_elements[i]; - } - const float& index(std::size_t r, std::size_t c) const - { - return m_elements[(r << 2) + c]; - } - float& index(std::size_t r, std::size_t c) - { - return m_elements[(r << 2) + c]; - } -}; - -/// \brief The 4x4 identity matrix. -const Matrix4 g_matrix4_identity( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 -); - - -/// \brief Returns true if \p self and \p other are exactly element-wise equal. -inline bool operator==(const Matrix4& self, const Matrix4& other) -{ - return self.xx() == other.xx() && self.xy() == other.xy() && self.xz() == other.xz() && self.xw() == other.xw() - && self.yx() == other.yx() && self.yy() == other.yy() && self.yz() == other.yz() && self.yw() == other.yw() - && self.zx() == other.zx() && self.zy() == other.zy() && self.zz() == other.zz() && self.zw() == other.zw() - && self.tx() == other.tx() && self.ty() == other.ty() && self.tz() == other.tz() && self.tw() == other.tw(); -} - -/// \brief Returns true if \p self and \p other are exactly element-wise equal. -inline bool matrix4_equal(const Matrix4& self, const Matrix4& other) -{ - return self == other; -} - -/// \brief Returns true if \p self and \p other are element-wise equal within \p epsilon. -inline bool matrix4_equal_epsilon(const Matrix4& self, const Matrix4& other, float epsilon) -{ - return float_equal_epsilon(self.xx(), other.xx(), epsilon) - && float_equal_epsilon(self.xy(), other.xy(), epsilon) - && float_equal_epsilon(self.xz(), other.xz(), epsilon) - && float_equal_epsilon(self.xw(), other.xw(), epsilon) - && float_equal_epsilon(self.yx(), other.yx(), epsilon) - && float_equal_epsilon(self.yy(), other.yy(), epsilon) - && float_equal_epsilon(self.yz(), other.yz(), epsilon) - && float_equal_epsilon(self.yw(), other.yw(), epsilon) - && float_equal_epsilon(self.zx(), other.zx(), epsilon) - && float_equal_epsilon(self.zy(), other.zy(), epsilon) - && float_equal_epsilon(self.zz(), other.zz(), epsilon) - && float_equal_epsilon(self.zw(), other.zw(), epsilon) - && float_equal_epsilon(self.tx(), other.tx(), epsilon) - && float_equal_epsilon(self.ty(), other.ty(), epsilon) - && float_equal_epsilon(self.tz(), other.tz(), epsilon) - && float_equal_epsilon(self.tw(), other.tw(), epsilon); -} - -/// \brief Returns true if \p self and \p other are exactly element-wise equal. -/// \p self and \p other must be affine. -inline bool matrix4_affine_equal(const Matrix4& self, const Matrix4& other) -{ - return self[0] == other[0] - && self[1] == other[1] - && self[2] == other[2] - && self[4] == other[4] - && self[5] == other[5] - && self[6] == other[6] - && self[8] == other[8] - && self[9] == other[9] - && self[10] == other[10] - && self[12] == other[12] - && self[13] == other[13] - && self[14] == other[14]; -} - -enum Matrix4Handedness -{ - MATRIX4_RIGHTHANDED = 0, - MATRIX4_LEFTHANDED = 1, -}; - -/// \brief Returns MATRIX4_RIGHTHANDED if \p self is right-handed, else returns MATRIX4_LEFTHANDED. -inline Matrix4Handedness matrix4_handedness(const Matrix4& self) -{ - return ( - vector3_dot( - vector3_cross(vector4_to_vector3(self.x()), vector4_to_vector3(self.y())), - vector4_to_vector3(self.z()) - ) - < 0.0 - ) ? MATRIX4_LEFTHANDED : MATRIX4_RIGHTHANDED; -} - - - - - -/// \brief Returns \p self post-multiplied by \p other. -inline Matrix4 matrix4_multiplied_by_matrix4(const Matrix4& self, const Matrix4& other) -{ - return Matrix4( - other[0] * self[0] + other[1] * self[4] + other[2] * self[8] + other[3] * self[12], - other[0] * self[1] + other[1] * self[5] + other[2] * self[9] + other[3] * self[13], - other[0] * self[2] + other[1] * self[6] + other[2] * self[10]+ other[3] * self[14], - other[0] * self[3] + other[1] * self[7] + other[2] * self[11]+ other[3] * self[15], - other[4] * self[0] + other[5] * self[4] + other[6] * self[8] + other[7] * self[12], - other[4] * self[1] + other[5] * self[5] + other[6] * self[9] + other[7] * self[13], - other[4] * self[2] + other[5] * self[6] + other[6] * self[10]+ other[7] * self[14], - other[4] * self[3] + other[5] * self[7] + other[6] * self[11]+ other[7] * self[15], - other[8] * self[0] + other[9] * self[4] + other[10]* self[8] + other[11]* self[12], - other[8] * self[1] + other[9] * self[5] + other[10]* self[9] + other[11]* self[13], - other[8] * self[2] + other[9] * self[6] + other[10]* self[10]+ other[11]* self[14], - other[8] * self[3] + other[9] * self[7] + other[10]* self[11]+ other[11]* self[15], - other[12]* self[0] + other[13]* self[4] + other[14]* self[8] + other[15]* self[12], - other[12]* self[1] + other[13]* self[5] + other[14]* self[9] + other[15]* self[13], - other[12]* self[2] + other[13]* self[6] + other[14]* self[10]+ other[15]* self[14], - other[12]* self[3] + other[13]* self[7] + other[14]* self[11]+ other[15]* self[15] - ); -} - -/// \brief Post-multiplies \p self by \p other in-place. -inline void matrix4_multiply_by_matrix4(Matrix4& self, const Matrix4& other) -{ - self = matrix4_multiplied_by_matrix4(self, other); -} - - -/// \brief Returns \p self pre-multiplied by \p other. -inline Matrix4 matrix4_premultiplied_by_matrix4(const Matrix4& self, const Matrix4& other) -{ -#if 1 - return matrix4_multiplied_by_matrix4(other, self); -#else - return Matrix4( - self[0] * other[0] + self[1] * other[4] + self[2] * other[8] + self[3] * other[12], - self[0] * other[1] + self[1] * other[5] + self[2] * other[9] + self[3] * other[13], - self[0] * other[2] + self[1] * other[6] + self[2] * other[10]+ self[3] * other[14], - self[0] * other[3] + self[1] * other[7] + self[2] * other[11]+ self[3] * other[15], - self[4] * other[0] + self[5] * other[4] + self[6] * other[8] + self[7] * other[12], - self[4] * other[1] + self[5] * other[5] + self[6] * other[9] + self[7] * other[13], - self[4] * other[2] + self[5] * other[6] + self[6] * other[10]+ self[7] * other[14], - self[4] * other[3] + self[5] * other[7] + self[6] * other[11]+ self[7] * other[15], - self[8] * other[0] + self[9] * other[4] + self[10]* other[8] + self[11]* other[12], - self[8] * other[1] + self[9] * other[5] + self[10]* other[9] + self[11]* other[13], - self[8] * other[2] + self[9] * other[6] + self[10]* other[10]+ self[11]* other[14], - self[8] * other[3] + self[9] * other[7] + self[10]* other[11]+ self[11]* other[15], - self[12]* other[0] + self[13]* other[4] + self[14]* other[8] + self[15]* other[12], - self[12]* other[1] + self[13]* other[5] + self[14]* other[9] + self[15]* other[13], - self[12]* other[2] + self[13]* other[6] + self[14]* other[10]+ self[15]* other[14], - self[12]* other[3] + self[13]* other[7] + self[14]* other[11]+ self[15]* other[15] - ); -#endif -} - -/// \brief Pre-multiplies \p self by \p other in-place. -inline void matrix4_premultiply_by_matrix4(Matrix4& self, const Matrix4& other) -{ - self = matrix4_premultiplied_by_matrix4(self, other); -} - -/// \brief returns true if \p transform is affine. -inline bool matrix4_is_affine(const Matrix4& transform) -{ - return transform[3] == 0 && transform[7] == 0 && transform[11] == 0 && transform[15] == 1; -} - -/// \brief Returns \p self post-multiplied by \p other. -/// \p self and \p other must be affine. -inline Matrix4 matrix4_affine_multiplied_by_matrix4(const Matrix4& self, const Matrix4& other) -{ - return Matrix4( - other[0] * self[0] + other[1] * self[4] + other[2] * self[8], - other[0] * self[1] + other[1] * self[5] + other[2] * self[9], - other[0] * self[2] + other[1] * self[6] + other[2] * self[10], - 0, - other[4] * self[0] + other[5] * self[4] + other[6] * self[8], - other[4] * self[1] + other[5] * self[5] + other[6] * self[9], - other[4] * self[2] + other[5] * self[6] + other[6] * self[10], - 0, - other[8] * self[0] + other[9] * self[4] + other[10]* self[8], - other[8] * self[1] + other[9] * self[5] + other[10]* self[9], - other[8] * self[2] + other[9] * self[6] + other[10]* self[10], - 0, - other[12]* self[0] + other[13]* self[4] + other[14]* self[8] + self[12], - other[12]* self[1] + other[13]* self[5] + other[14]* self[9] + self[13], - other[12]* self[2] + other[13]* self[6] + other[14]* self[10]+ self[14], - 1 - ); -} - -/// \brief Post-multiplies \p self by \p other in-place. -/// \p self and \p other must be affine. -inline void matrix4_affine_multiply_by_matrix4(Matrix4& self, const Matrix4& other) -{ - self = matrix4_affine_multiplied_by_matrix4(self, other); -} - -/// \brief Returns \p self pre-multiplied by \p other. -/// \p self and \p other must be affine. -inline Matrix4 matrix4_affine_premultiplied_by_matrix4(const Matrix4& self, const Matrix4& other) -{ -#if 1 - return matrix4_affine_multiplied_by_matrix4(other, self); -#else - return Matrix4( - self[0] * other[0] + self[1] * other[4] + self[2] * other[8], - self[0] * other[1] + self[1] * other[5] + self[2] * other[9], - self[0] * other[2] + self[1] * other[6] + self[2] * other[10], - 0, - self[4] * other[0] + self[5] * other[4] + self[6] * other[8], - self[4] * other[1] + self[5] * other[5] + self[6] * other[9], - self[4] * other[2] + self[5] * other[6] + self[6] * other[10], - 0, - self[8] * other[0] + self[9] * other[4] + self[10]* other[8], - self[8] * other[1] + self[9] * other[5] + self[10]* other[9], - self[8] * other[2] + self[9] * other[6] + self[10]* other[10], - 0, - self[12]* other[0] + self[13]* other[4] + self[14]* other[8] + other[12], - self[12]* other[1] + self[13]* other[5] + self[14]* other[9] + other[13], - self[12]* other[2] + self[13]* other[6] + self[14]* other[10]+ other[14], - 1 - ) - ); -#endif -} - -/// \brief Pre-multiplies \p self by \p other in-place. -/// \p self and \p other must be affine. -inline void matrix4_affine_premultiply_by_matrix4(Matrix4& self, const Matrix4& other) -{ - self = matrix4_affine_premultiplied_by_matrix4(self, other); -} - -/// \brief Returns \p point transformed by \p self. -template -inline BasicVector3 matrix4_transformed_point(const Matrix4& self, const BasicVector3& point) -{ - return BasicVector3( - static_cast(self[0] * point[0] + self[4] * point[1] + self[8] * point[2] + self[12]), - static_cast(self[1] * point[0] + self[5] * point[1] + self[9] * point[2] + self[13]), - static_cast(self[2] * point[0] + self[6] * point[1] + self[10] * point[2] + self[14]) - ); -} - -/// \brief Transforms \p point by \p self in-place. -template -inline void matrix4_transform_point(const Matrix4& self, BasicVector3& point) -{ - point = matrix4_transformed_point(self, point); -} - -/// \brief Returns \p direction transformed by \p self. -template -inline BasicVector3 matrix4_transformed_direction(const Matrix4& self, const BasicVector3& direction) -{ - return BasicVector3( - static_cast(self[0] * direction[0] + self[4] * direction[1] + self[8] * direction[2]), - static_cast(self[1] * direction[0] + self[5] * direction[1] + self[9] * direction[2]), - static_cast(self[2] * direction[0] + self[6] * direction[1] + self[10] * direction[2]) - ); -} - -/// \brief Transforms \p direction by \p self in-place. -template -inline void matrix4_transform_direction(const Matrix4& self, BasicVector3& normal) -{ - normal = matrix4_transformed_direction(self, normal); -} - -/// \brief Returns \p vector4 transformed by \p self. -inline Vector4 matrix4_transformed_vector4(const Matrix4& self, const Vector4& vector4) -{ - return Vector4( - self[0] * vector4[0] + self[4] * vector4[1] + self[8] * vector4[2] + self[12] * vector4[3], - self[1] * vector4[0] + self[5] * vector4[1] + self[9] * vector4[2] + self[13] * vector4[3], - self[2] * vector4[0] + self[6] * vector4[1] + self[10] * vector4[2] + self[14] * vector4[3], - self[3] * vector4[0] + self[7] * vector4[1] + self[11] * vector4[2] + self[15] * vector4[3] - ); -} - -/// \brief Transforms \p vector4 by \p self in-place. -inline void matrix4_transform_vector4(const Matrix4& self, Vector4& vector4) -{ - vector4 = matrix4_transformed_vector4(self, vector4); -} - - -/// \brief Transposes \p self in-place. -inline void matrix4_transpose(Matrix4& self) -{ - std::swap(self.xy(), self.yx()); - std::swap(self.xz(), self.zx()); - std::swap(self.xw(), self.tx()); - std::swap(self.yz(), self.zy()); - std::swap(self.yw(), self.ty()); - std::swap(self.zw(), self.tz()); -} - -/// \brief Returns \p self transposed. -inline Matrix4 matrix4_transposed(const Matrix4& self) -{ - return Matrix4( - self.xx(), - self.yx(), - self.zx(), - self.tx(), - self.xy(), - self.yy(), - self.zy(), - self.ty(), - self.xz(), - self.yz(), - self.zz(), - self.tz(), - self.xw(), - self.yw(), - self.zw(), - self.tw() - ); -} - - -/// \brief Inverts an affine transform in-place. -/// Adapted from Graphics Gems 2. -inline Matrix4 matrix4_affine_inverse(const Matrix4& self) -{ - Matrix4 result; - - // determinant of rotation submatrix - double det - = self[0] * ( self[5]*self[10] - self[9]*self[6] ) - - self[1] * ( self[4]*self[10] - self[8]*self[6] ) - + self[2] * ( self[4]*self[9] - self[8]*self[5] ); - - // throw exception here if (det*det < 1e-25) - - // invert rotation submatrix - det = 1.0 / det; - - result[0] = static_cast( (self[5]*self[10]- self[6]*self[9] )*det); - result[1] = static_cast(- (self[1]*self[10]- self[2]*self[9] )*det); - result[2] = static_cast( (self[1]*self[6] - self[2]*self[5] )*det); - result[3] = 0; - result[4] = static_cast(- (self[4]*self[10]- self[6]*self[8] )*det); - result[5] = static_cast( (self[0]*self[10]- self[2]*self[8] )*det); - result[6] = static_cast(- (self[0]*self[6] - self[2]*self[4] )*det); - result[7] = 0; - result[8] = static_cast( (self[4]*self[9] - self[5]*self[8] )*det); - result[9] = static_cast(- (self[0]*self[9] - self[1]*self[8] )*det); - result[10]= static_cast( (self[0]*self[5] - self[1]*self[4] )*det); - result[11] = 0; - - // multiply translation part by rotation - result[12] = - (self[12] * result[0] + - self[13] * result[4] + - self[14] * result[8]); - result[13] = - (self[12] * result[1] + - self[13] * result[5] + - self[14] * result[9]); - result[14] = - (self[12] * result[2] + - self[13] * result[6] + - self[14] * result[10]); - result[15] = 1; - - return result; -} - -inline void matrix4_affine_invert(Matrix4& self) -{ - self = matrix4_affine_inverse(self); -} - -/// \brief A compile-time-constant integer. -template -struct IntegralConstant -{ - enum unnamed_{ VALUE = VALUE_ }; -}; - -/// \brief A compile-time-constant row/column index into a 4x4 matrix. -template -class Matrix4Index -{ -public: - typedef IntegralConstant r; - typedef IntegralConstant c; - typedef IntegralConstant<(r::VALUE * 4) + c::VALUE> i; -}; - -/// \brief A functor which returns the cofactor of a 3x3 submatrix obtained by ignoring a given row and column of a 4x4 matrix. -/// \param Row Defines the compile-time-constant integers x, y and z with values corresponding to the indices of the three rows to use. -/// \param Col Defines the compile-time-constant integers x, y and z with values corresponding to the indices of the three columns to use. -template -class Matrix4Cofactor -{ -public: - typedef typename Matrix4Index::i xx; - typedef typename Matrix4Index::i xy; - typedef typename Matrix4Index::i xz; - typedef typename Matrix4Index::i yx; - typedef typename Matrix4Index::i yy; - typedef typename Matrix4Index::i yz; - typedef typename Matrix4Index::i zx; - typedef typename Matrix4Index::i zy; - typedef typename Matrix4Index::i zz; - static double apply(const Matrix4& self) - { - return self[xx::VALUE] * ( self[yy::VALUE]*self[zz::VALUE] - self[zy::VALUE]*self[yz::VALUE] ) - - self[xy::VALUE] * ( self[yx::VALUE]*self[zz::VALUE] - self[zx::VALUE]*self[yz::VALUE] ) - + self[xz::VALUE] * ( self[yx::VALUE]*self[zy::VALUE] - self[zx::VALUE]*self[yy::VALUE] ); - } -}; - -/// \brief The cofactor element indices for a 4x4 matrix row or column. -/// \param Element The index of the element to ignore. -template -class Cofactor4 -{ -public: - typedef IntegralConstant<(Element <= 0) ? 1 : 0> x; - typedef IntegralConstant<(Element <= 1) ? 2 : 1> y; - typedef IntegralConstant<(Element <= 2) ? 3 : 2> z; -}; - -/// \brief Returns the determinant of \p self. -inline double matrix4_determinant(const Matrix4& self) -{ - return self.xx() * Matrix4Cofactor< Cofactor4<0>, Cofactor4<0> >::apply(self) - - self.xy() * Matrix4Cofactor< Cofactor4<0>, Cofactor4<1> >::apply(self) - + self.xz() * Matrix4Cofactor< Cofactor4<0>, Cofactor4<2> >::apply(self) - - self.xw() * Matrix4Cofactor< Cofactor4<0>, Cofactor4<3> >::apply(self); -} - -/// \brief Returns the inverse of \p self using the Adjoint method. -/// \todo Throw an exception if the determinant is zero. -inline Matrix4 matrix4_full_inverse(const Matrix4& self) -{ - double determinant = 1.0 / matrix4_determinant(self); - - return Matrix4( - static_cast( Matrix4Cofactor< Cofactor4<0>, Cofactor4<0> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<1>, Cofactor4<0> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<2>, Cofactor4<0> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<3>, Cofactor4<0> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<0>, Cofactor4<1> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<1>, Cofactor4<1> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<2>, Cofactor4<1> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<3>, Cofactor4<1> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<0>, Cofactor4<2> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<1>, Cofactor4<2> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<2>, Cofactor4<2> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<3>, Cofactor4<2> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<0>, Cofactor4<3> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<1>, Cofactor4<3> >::apply(self) * determinant), - static_cast(-Matrix4Cofactor< Cofactor4<2>, Cofactor4<3> >::apply(self) * determinant), - static_cast( Matrix4Cofactor< Cofactor4<3>, Cofactor4<3> >::apply(self) * determinant) - ); -} - -/// \brief Inverts \p self in-place using the Adjoint method. -inline void matrix4_full_invert(Matrix4& self) -{ - self = matrix4_full_inverse(self); -} - - -/// \brief Constructs a pure-translation matrix from \p translation. -inline Matrix4 matrix4_translation_for_vec3(const Vector3& translation) -{ - return Matrix4( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - translation[0], translation[1], translation[2], 1 - ); -} - -/// \brief Returns the translation part of \p self. -inline Vector3 matrix4_get_translation_vec3(const Matrix4& self) -{ - return vector4_to_vector3(self.t()); -} - -/// \brief Concatenates \p self with \p translation. -/// The concatenated \p translation occurs before \p self. -inline void matrix4_translate_by_vec3(Matrix4& self, const Vector3& translation) -{ - matrix4_multiply_by_matrix4(self, matrix4_translation_for_vec3(translation)); -} - -/// \brief Returns \p self Concatenated with \p translation. -/// The concatenated translation occurs before \p self. -inline Matrix4 matrix4_translated_by_vec3(const Matrix4& self, const Vector3& translation) -{ - return matrix4_multiplied_by_matrix4(self, matrix4_translation_for_vec3(translation)); -} - - -#include "math/pi.h" - -/// \brief Returns \p angle modulated by the range [0, 360). -/// \p angle must be in the range [-360, 360). -inline float angle_modulate_degrees_range(float angle) -{ - return static_cast(float_mod_range(angle, 360.0)); -} - -/// \brief Returns \p euler angles converted from radians to degrees. -inline Vector3 euler_radians_to_degrees(const Vector3& euler) -{ - return Vector3( - static_cast(radians_to_degrees(euler.x())), - static_cast(radians_to_degrees(euler.y())), - static_cast(radians_to_degrees(euler.z())) - ); -} - -/// \brief Returns \p euler angles converted from degrees to radians. -inline Vector3 euler_degrees_to_radians(const Vector3& euler) -{ - return Vector3( - static_cast(degrees_to_radians(euler.x())), - static_cast(degrees_to_radians(euler.y())), - static_cast(degrees_to_radians(euler.z())) - ); -} - - - -/// \brief Constructs a pure-rotation matrix about the x axis from sin \p s and cosine \p c of an angle. -inline Matrix4 matrix4_rotation_for_sincos_x(float s, float c) -{ - return Matrix4( - 1, 0, 0, 0, - 0, c, s, 0, - 0,-s, c, 0, - 0, 0, 0, 1 - ); -} - -/// \brief Constructs a pure-rotation matrix about the x axis from an angle in radians. -inline Matrix4 matrix4_rotation_for_x(double x) -{ - return matrix4_rotation_for_sincos_x(static_cast(sin(x)), static_cast(cos(x))); -} - -/// \brief Constructs a pure-rotation matrix about the x axis from an angle in degrees. -inline Matrix4 matrix4_rotation_for_x_degrees(float x) -{ - return matrix4_rotation_for_x(degrees_to_radians(x)); -} - -/// \brief Constructs a pure-rotation matrix about the y axis from sin \p s and cosine \p c of an angle. -inline Matrix4 matrix4_rotation_for_sincos_y(float s, float c) -{ - return Matrix4( - c, 0,-s, 0, - 0, 1, 0, 0, - s, 0, c, 0, - 0, 0, 0, 1 - ); -} - -/// \brief Constructs a pure-rotation matrix about the y axis from an angle in radians. -inline Matrix4 matrix4_rotation_for_y(double y) -{ - return matrix4_rotation_for_sincos_y(static_cast(sin(y)), static_cast(cos(y))); -} - -/// \brief Constructs a pure-rotation matrix about the y axis from an angle in degrees. -inline Matrix4 matrix4_rotation_for_y_degrees(float y) -{ - return matrix4_rotation_for_y(degrees_to_radians(y)); -} - -/// \brief Constructs a pure-rotation matrix about the z axis from sin \p s and cosine \p c of an angle. -inline Matrix4 matrix4_rotation_for_sincos_z(float s, float c) -{ - return Matrix4( - c, s, 0, 0, - -s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ); -} - -/// \brief Constructs a pure-rotation matrix about the z axis from an angle in radians. -inline Matrix4 matrix4_rotation_for_z(double z) -{ - return matrix4_rotation_for_sincos_z(static_cast(sin(z)), static_cast(cos(z))); -} - -/// \brief Constructs a pure-rotation matrix about the z axis from an angle in degrees. -inline Matrix4 matrix4_rotation_for_z_degrees(float z) -{ - return matrix4_rotation_for_z(degrees_to_radians(z)); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (x, y, z). -/*! \verbatim -clockwise rotation around X, Y, Z, facing along axis - 1 0 0 cy 0 -sy cz sz 0 - 0 cx sx 0 1 0 -sz cz 0 - 0 -sx cx sy 0 cy 0 0 1 - -rows of Z by cols of Y - cy*cz -sy*cz+sz -sy*sz+cz --sz*cy -sz*sy+cz - - .. or something like that.. - -final rotation is Z * Y * X - cy*cz -sx*-sy*cz+cx*sz cx*-sy*sz+sx*cz --cy*sz sx*sy*sz+cx*cz -cx*-sy*sz+sx*cz - sy -sx*cy cx*cy - -transposed -cy.cz + 0.sz + sy.0 cy.-sz + 0 .cz + sy.0 cy.0 + 0 .0 + sy.1 | -sx.sy.cz + cx.sz + -sx.cy.0 sx.sy.-sz + cx.cz + -sx.cy.0 sx.sy.0 + cx.0 + -sx.cy.1 | --cx.sy.cz + sx.sz + cx.cy.0 -cx.sy.-sz + sx.cz + cx.cy.0 -cx.sy.0 + 0 .0 + cx.cy.1 | -\endverbatim */ -inline Matrix4 matrix4_rotation_for_euler_xyz(const Vector3& euler) -{ -#if 1 - - double cx = cos(euler[0]); - double sx = sin(euler[0]); - double cy = cos(euler[1]); - double sy = sin(euler[1]); - double cz = cos(euler[2]); - double sz = sin(euler[2]); - - return Matrix4( - static_cast(cy*cz), - static_cast(cy*sz), - static_cast(-sy), - 0, - static_cast(sx*sy*cz + cx*-sz), - static_cast(sx*sy*sz + cx*cz), - static_cast(sx*cy), - 0, - static_cast(cx*sy*cz + sx*sz), - static_cast(cx*sy*sz + -sx*cz), - static_cast(cx*cy), - 0, - 0, - 0, - 0, - 1 - ); - -#else - - return matrix4_premultiply_by_matrix4( - matrix4_premultiply_by_matrix4( - matrix4_rotation_for_x(euler[0]), - matrix4_rotation_for_y(euler[1]) - ), - matrix4_rotation_for_z(euler[2]) - ); - -#endif -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degrees) in the order (x, y, z). -inline Matrix4 matrix4_rotation_for_euler_xyz_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_xyz(euler_degrees_to_radians(euler)); -} - -/// \brief Concatenates \p self with the rotation transform produced by \p euler angles (degrees) in the order (x, y, z). -/// The concatenated rotation occurs before \p self. -inline void matrix4_rotate_by_euler_xyz_degrees(Matrix4& self, const Vector3& euler) -{ - matrix4_multiply_by_matrix4(self, matrix4_rotation_for_euler_xyz_degrees(euler)); -} - - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (y, z, x). -inline Matrix4 matrix4_rotation_for_euler_yzx(const Vector3& euler) -{ - return matrix4_premultiplied_by_matrix4( - matrix4_premultiplied_by_matrix4( - matrix4_rotation_for_y(euler[1]), - matrix4_rotation_for_z(euler[2]) - ), - matrix4_rotation_for_x(euler[0]) - ); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degrees) in the order (y, z, x). -inline Matrix4 matrix4_rotation_for_euler_yzx_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_yzx(euler_degrees_to_radians(euler)); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (x, z, y). -inline Matrix4 matrix4_rotation_for_euler_xzy(const Vector3& euler) -{ - return matrix4_premultiplied_by_matrix4( - matrix4_premultiplied_by_matrix4( - matrix4_rotation_for_x(euler[0]), - matrix4_rotation_for_z(euler[2]) - ), - matrix4_rotation_for_y(euler[1]) - ); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degrees) in the order (x, z, y). -inline Matrix4 matrix4_rotation_for_euler_xzy_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_xzy(euler_degrees_to_radians(euler)); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (y, x, z). -/*! \verbatim -| cy.cz + sx.sy.-sz + -cx.sy.0 0.cz + cx.-sz + sx.0 sy.cz + -sx.cy.-sz + cx.cy.0 | -| cy.sz + sx.sy.cz + -cx.sy.0 0.sz + cx.cz + sx.0 sy.sz + -sx.cy.cz + cx.cy.0 | -| cy.0 + sx.sy.0 + -cx.sy.1 0.0 + cx.0 + sx.1 sy.0 + -sx.cy.0 + cx.cy.1 | -\endverbatim */ -inline Matrix4 matrix4_rotation_for_euler_yxz(const Vector3& euler) -{ -#if 1 - - double cx = cos(euler[0]); - double sx = sin(euler[0]); - double cy = cos(euler[1]); - double sy = sin(euler[1]); - double cz = cos(euler[2]); - double sz = sin(euler[2]); - - return Matrix4( - static_cast(cy*cz + sx*sy*-sz), - static_cast(cy*sz + sx*sy*cz), - static_cast(-cx*sy), - 0, - static_cast(cx*-sz), - static_cast(cx*cz), - static_cast(sx), - 0, - static_cast(sy*cz + -sx*cy*-sz), - static_cast(sy*sz + -sx*cy*cz), - static_cast(cx*cy), - 0, - 0, - 0, - 0, - 1 - ); - -#else - - return matrix4_premultiply_by_matrix4( - matrix4_premultiply_by_matrix4( - matrix4_rotation_for_y(euler[1]), - matrix4_rotation_for_x(euler[0]) - ), - matrix4_rotation_for_z(euler[2]) - ); - -#endif -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degrees) in the order (y, x, z). -inline Matrix4 matrix4_rotation_for_euler_yxz_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_yxz(euler_degrees_to_radians(euler)); -} - -/// \brief Returns \p self concatenated with the rotation transform produced by \p euler angles (degrees) in the order (y, x, z). -/// The concatenated rotation occurs before \p self. -inline Matrix4 matrix4_rotated_by_euler_yxz_degrees(const Matrix4& self, const Vector3& euler) -{ - return matrix4_multiplied_by_matrix4(self, matrix4_rotation_for_euler_yxz_degrees(euler)); -} - -/// \brief Concatenates \p self with the rotation transform produced by \p euler angles (degrees) in the order (y, x, z). -/// The concatenated rotation occurs before \p self. -inline void matrix4_rotate_by_euler_yxz_degrees(Matrix4& self, const Vector3& euler) -{ - self = matrix4_rotated_by_euler_yxz_degrees(self, euler); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (z, x, y). -inline Matrix4 matrix4_rotation_for_euler_zxy(const Vector3& euler) -{ -#if 1 - return matrix4_premultiplied_by_matrix4( - matrix4_premultiplied_by_matrix4( - matrix4_rotation_for_z(euler[2]), - matrix4_rotation_for_x(euler[0]) - ), - matrix4_rotation_for_y(euler[1]) - ); -#else - double cx = cos(euler[0]); - double sx = sin(euler[0]); - double cy = cos(euler[1]); - double sy = sin(euler[1]); - double cz = cos(euler[2]); - double sz = sin(euler[2]); - - return Matrix4( - static_cast(cz * cy + sz * sx * sy), - static_cast(sz * cx), - static_cast(cz * -sy + sz * sx * cy), - 0, - static_cast(-sz * cy + cz * sx * sy), - static_cast(cz * cx), - static_cast(-sz * -sy + cz * cx * cy), - 0, - static_cast(cx* sy), - static_cast(-sx), - static_cast(cx* cy), - 0, - 0, - 0, - 0, - 1 - ); -#endif -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degres=es) in the order (z, x, y). -inline Matrix4 matrix4_rotation_for_euler_zxy_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_zxy(euler_degrees_to_radians(euler)); -} - -/// \brief Returns \p self concatenated with the rotation transform produced by \p euler angles (degrees) in the order (z, x, y). -/// The concatenated rotation occurs before \p self. -inline Matrix4 matrix4_rotated_by_euler_zxy_degrees(const Matrix4& self, const Vector3& euler) -{ - return matrix4_multiplied_by_matrix4(self, matrix4_rotation_for_euler_zxy_degrees(euler)); -} - -/// \brief Concatenates \p self with the rotation transform produced by \p euler angles (degrees) in the order (z, x, y). -/// The concatenated rotation occurs before \p self. -inline void matrix4_rotate_by_euler_zxy_degrees(Matrix4& self, const Vector3& euler) -{ - self = matrix4_rotated_by_euler_zxy_degrees(self, euler); -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (radians) in the order (z, y, x). -inline Matrix4 matrix4_rotation_for_euler_zyx(const Vector3& euler) -{ -#if 1 - - double cx = cos(euler[0]); - double sx = sin(euler[0]); - double cy = cos(euler[1]); - double sy = sin(euler[1]); - double cz = cos(euler[2]); - double sz = sin(euler[2]); - - return Matrix4( - static_cast(cy*cz), - static_cast(sx*sy*cz + cx*sz), - static_cast(cx*-sy*cz + sx*sz), - 0, - static_cast(cy*-sz), - static_cast(sx*sy*-sz + cx*cz), - static_cast(cx*-sy*-sz + sx*cz), - 0, - static_cast(sy), - static_cast(-sx*cy), - static_cast(cx*cy), - 0, - 0, - 0, - 0, - 1 - ); - -#else - - return matrix4_premultiply_by_matrix4( - matrix4_premultiply_by_matrix4( - matrix4_rotation_for_z(euler[2]), - matrix4_rotation_for_y(euler[1]) - ), - matrix4_rotation_for_x(euler[0]) - ); - -#endif -} - -/// \brief Constructs a pure-rotation matrix from a set of euler angles (degrees) in the order (z, y, x). -inline Matrix4 matrix4_rotation_for_euler_zyx_degrees(const Vector3& euler) -{ - return matrix4_rotation_for_euler_zyx(euler_degrees_to_radians(euler)); -} - - -/// \brief Calculates and returns a set of euler angles that produce the rotation component of \p self when applied in the order (x, y, z). -/// \p self must be affine and orthonormal (unscaled) to produce a meaningful result. -inline Vector3 matrix4_get_rotation_euler_xyz(const Matrix4& self) -{ - double a = asin(-self[2]); - double ca = cos(a); - - if (fabs(ca) > 0.005) // Gimbal lock? - { - return Vector3( - static_cast(atan2(self[6] / ca, self[10] / ca)), - static_cast(a), - static_cast(atan2(self[1] / ca, self[0]/ ca)) - ); - } - else // Gimbal lock has occurred - { - return Vector3( - static_cast(atan2(-self[9], self[5])), - static_cast(a), - 0 - ); - } -} - -/// \brief \copydoc matrix4_get_rotation_euler_xyz(const Matrix4&) -inline Vector3 matrix4_get_rotation_euler_xyz_degrees(const Matrix4& self) -{ - return euler_radians_to_degrees(matrix4_get_rotation_euler_xyz(self)); -} - -/// \brief Calculates and returns a set of euler angles that produce the rotation component of \p self when applied in the order (y, x, z). -/// \p self must be affine and orthonormal (unscaled) to produce a meaningful result. -inline Vector3 matrix4_get_rotation_euler_yxz(const Matrix4& self) -{ - double a = asin(self[6]); - double ca = cos(a); - - if (fabs(ca) > 0.005) // Gimbal lock? - { - return Vector3( - static_cast(a), - static_cast(atan2(-self[2] / ca, self[10]/ ca)), - static_cast(atan2(-self[4] / ca, self[5] / ca)) - ); - } - else // Gimbal lock has occurred - { - return Vector3( - static_cast(a), - static_cast(atan2(self[8], self[0])), - 0 - ); - } -} - -/// \brief \copydoc matrix4_get_rotation_euler_yxz(const Matrix4&) -inline Vector3 matrix4_get_rotation_euler_yxz_degrees(const Matrix4& self) -{ - return euler_radians_to_degrees(matrix4_get_rotation_euler_yxz(self)); -} - -/// \brief Calculates and returns a set of euler angles that produce the rotation component of \p self when applied in the order (z, x, y). -/// \p self must be affine and orthonormal (unscaled) to produce a meaningful result. -inline Vector3 matrix4_get_rotation_euler_zxy(const Matrix4& self) -{ - double a = asin(-self[9]); - double ca = cos(a); - - if (fabs(ca) > 0.005) // Gimbal lock? - { - return Vector3( - static_cast(a), - static_cast(atan2(self[8] / ca, self[10] / ca)), - static_cast(atan2(self[1] / ca, self[5]/ ca)) - ); - } - else // Gimbal lock has occurred - { - return Vector3( - static_cast(a), - 0, - static_cast(atan2(-self[4], self[0])) - ); - } -} - -/// \brief \copydoc matrix4_get_rotation_euler_zxy(const Matrix4&) -inline Vector3 matrix4_get_rotation_euler_zxy_degrees(const Matrix4& self) -{ - return euler_radians_to_degrees(matrix4_get_rotation_euler_zxy(self)); -} - -/// \brief Calculates and returns a set of euler angles that produce the rotation component of \p self when applied in the order (z, y, x). -/// \p self must be affine and orthonormal (unscaled) to produce a meaningful result. -inline Vector3 matrix4_get_rotation_euler_zyx(const Matrix4& self) -{ - double a = asin(self[8]); - double ca = cos(a); - - if (fabs(ca) > 0.005) // Gimbal lock? - { - return Vector3( - static_cast(atan2(-self[9] / ca, self[10]/ ca)), - static_cast(a), - static_cast(atan2(-self[4] / ca, self[0] / ca)) - ); - } - else // Gimbal lock has occurred - { - return Vector3( - 0, - static_cast(a), - static_cast(atan2(self[1], self[5])) - ); - } -} - -/// \brief \copydoc matrix4_get_rotation_euler_zyx(const Matrix4&) -inline Vector3 matrix4_get_rotation_euler_zyx_degrees(const Matrix4& self) -{ - return euler_radians_to_degrees(matrix4_get_rotation_euler_zyx(self)); -} - - -/// \brief Rotate \p self by \p euler angles (degrees) applied in the order (x, y, z), using \p pivotpoint. -inline void matrix4_pivoted_rotate_by_euler_xyz_degrees(Matrix4& self, const Vector3& euler, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(self, pivotpoint); - matrix4_rotate_by_euler_xyz_degrees(self, euler); - matrix4_translate_by_vec3(self, vector3_negated(pivotpoint)); -} - - -/// \brief Constructs a pure-scale matrix from \p scale. -inline Matrix4 matrix4_scale_for_vec3(const Vector3& scale) -{ - return Matrix4( - scale[0], 0, 0, 0, - 0, scale[1], 0, 0, - 0, 0, scale[2], 0, - 0, 0, 0, 1 - ); -} - -/// \brief Calculates and returns the (x, y, z) scale values that produce the scale component of \p self. -/// \p self must be affine and orthogonal to produce a meaningful result. -inline Vector3 matrix4_get_scale_vec3(const Matrix4& self) -{ - return Vector3( - static_cast(vector3_length(vector4_to_vector3(self.x()))), - static_cast(vector3_length(vector4_to_vector3(self.y()))), - static_cast(vector3_length(vector4_to_vector3(self.z()))) - ); -} - -/// \brief Scales \p self by \p scale. -inline void matrix4_scale_by_vec3(Matrix4& self, const Vector3& scale) -{ - matrix4_multiply_by_matrix4(self, matrix4_scale_for_vec3(scale)); -} - -/// \brief Scales \p self by \p scale, using \p pivotpoint. -inline void matrix4_pivoted_scale_by_vec3(Matrix4& self, const Vector3& scale, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(self, pivotpoint); - matrix4_scale_by_vec3(self, scale); - matrix4_translate_by_vec3(self, vector3_negated(pivotpoint)); -} - - -/// \brief Transforms \p self by \p translation, \p euler and \p scale. -/// The transforms are combined in the order: scale, rotate-z, rotate-y, rotate-x, translate. -inline void matrix4_transform_by_euler_xyz_degrees(Matrix4& self, const Vector3& translation, const Vector3& euler, const Vector3& scale) -{ - matrix4_translate_by_vec3(self, translation); - matrix4_rotate_by_euler_xyz_degrees(self, euler); - matrix4_scale_by_vec3(self, scale); -} - -/// \brief Transforms \p self by \p translation, \p euler and \p scale, using \p pivotpoint. -inline void matrix4_pivoted_transform_by_euler_xyz_degrees(Matrix4& self, const Vector3& translation, const Vector3& euler, const Vector3& scale, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(self, pivotpoint + translation); - matrix4_rotate_by_euler_xyz_degrees(self, euler); - matrix4_scale_by_vec3(self, scale); - matrix4_translate_by_vec3(self, vector3_negated(pivotpoint)); -} - - -#endif diff --git a/libs/math/pi.cpp b/libs/math/pi.cpp deleted file mode 100644 index 34930192..00000000 --- a/libs/math/pi.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pi.h" - diff --git a/libs/math/pi.h b/libs/math/pi.h deleted file mode 100644 index 9cc74c1b..00000000 --- a/libs/math/pi.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_PI_H) -#define INCLUDED_MATH_PI_H - -/// \file -/// \brief Pi constants and degrees/radians conversion. - -const double c_pi = 3.1415926535897932384626433832795; -const double c_half_pi = c_pi / 2; -const double c_2pi = 2 * c_pi; -const double c_inv_2pi = 1 / c_2pi; - -const double c_DEG2RADMULT = c_pi / 180.0; -const double c_RAD2DEGMULT = 180.0 / c_pi; - -inline double radians_to_degrees(double radians) -{ - return radians * c_RAD2DEGMULT; -} -inline double degrees_to_radians(double degrees) -{ - return degrees * c_DEG2RADMULT; -} - -#endif diff --git a/libs/math/plane.cpp b/libs/math/plane.cpp deleted file mode 100644 index 4182a175..00000000 --- a/libs/math/plane.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plane.h" - diff --git a/libs/math/plane.h b/libs/math/plane.h deleted file mode 100644 index af05db74..00000000 --- a/libs/math/plane.h +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_PLANE_H) -#define INCLUDED_MATH_PLANE_H - -/// \file -/// \brief Plane data types and related operations. - -#include "math/matrix.h" - -/// \brief A plane equation stored in double-precision floating-point. -class Plane3 -{ -public: - double a, b, c, d; - - Plane3() - { - } - Plane3(double _a, double _b, double _c, double _d) - : a(_a), b(_b), c(_c), d(_d) - { - } - template - Plane3(const BasicVector3& normal, double dist) - : a(normal.x()), b(normal.y()), c(normal.z()), d(dist) - { - } - - BasicVector3& normal() - { - return reinterpret_cast&>(*this); - } - const BasicVector3& normal() const - { - return reinterpret_cast&>(*this); - } - double& dist() - { - return d; - } - const double& dist() const - { - return d; - } -}; - -inline Plane3 plane3_normalised(const Plane3& plane) -{ - double rmagnitude = 1.0 / sqrt(plane.a * plane.a + plane.b * plane.b + plane.c * plane.c); - return Plane3( - plane.a * rmagnitude, - plane.b * rmagnitude, - plane.c * rmagnitude, - plane.d * rmagnitude - ); -} - -inline Plane3 plane3_translated(const Plane3& plane, const Vector3& translation) -{ - Plane3 transformed; - transformed.a = plane.a; - transformed.b = plane.b; - transformed.c = plane.c; - transformed.d = -((-plane.d * transformed.a + translation.x()) * transformed.a + - (-plane.d * transformed.b + translation.y()) * transformed.b + - (-plane.d * transformed.c + translation.z()) * transformed.c); - return transformed; -} - -inline Plane3 plane3_transformed(const Plane3& plane, const Matrix4& transform) -{ - Plane3 transformed; - transformed.a = transform[0] * plane.a + transform[4] * plane.b + transform[8] * plane.c; - transformed.b = transform[1] * plane.a + transform[5] * plane.b + transform[9] * plane.c; - transformed.c = transform[2] * plane.a + transform[6] * plane.b + transform[10] * plane.c; - transformed.d = -((-plane.d * transformed.a + transform[12]) * transformed.a + - (-plane.d * transformed.b + transform[13]) * transformed.b + - (-plane.d * transformed.c + transform[14]) * transformed.c); - return transformed; -} - -inline Plane3 plane3_inverse_transformed(const Plane3& plane, const Matrix4& transform) -{ - return Plane3 - ( - transform[ 0] * plane.a + transform[ 1] * plane.b + transform[ 2] * plane.c + transform[ 3] * plane.d, - transform[ 4] * plane.a + transform[ 5] * plane.b + transform[ 6] * plane.c + transform[ 7] * plane.d, - transform[ 8] * plane.a + transform[ 9] * plane.b + transform[10] * plane.c + transform[11] * plane.d, - transform[12] * plane.a + transform[13] * plane.b + transform[14] * plane.c + transform[15] * plane.d - ); -} - -inline Plane3 plane3_flipped(const Plane3& plane) -{ - return Plane3(vector3_negated(plane.normal()), -plane.dist()); -} - -const double c_PLANE_NORMAL_EPSILON = 0.0001f; -const double c_PLANE_DIST_EPSILON = 0.02; - -inline bool plane3_equal(const Plane3& self, const Plane3& other) -{ - return vector3_equal_epsilon(self.normal(), other.normal(), c_PLANE_NORMAL_EPSILON) - && float_equal_epsilon(self.dist(), other.dist(), c_PLANE_DIST_EPSILON); -} - -inline bool plane3_opposing(const Plane3& self, const Plane3& other) -{ - return plane3_equal(self, plane3_flipped(other)); -} - -inline bool plane3_valid(const Plane3& self) -{ - return float_equal_epsilon(vector3_dot(self.normal(), self.normal()), 1.0, 0.01); -} - -template -inline Plane3 plane3_for_points(const BasicVector3& p0, const BasicVector3& p1, const BasicVector3& p2) -{ - Plane3 self; - self.normal() = vector3_normalised(vector3_cross(vector3_subtracted(p1, p0), vector3_subtracted(p2, p0))); - self.dist() = vector3_dot(p0, self.normal()); - return self; -} - -template -inline Plane3 plane3_for_points(const BasicVector3 planepts[3]) -{ - return plane3_for_points(planepts[2], planepts[1], planepts[0]); -} - - -#endif diff --git a/libs/math/quaternion.cpp b/libs/math/quaternion.cpp deleted file mode 100644 index 6688368e..00000000 --- a/libs/math/quaternion.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "quaternion.h" - diff --git a/libs/math/quaternion.h b/libs/math/quaternion.h deleted file mode 100644 index d91ad62a..00000000 --- a/libs/math/quaternion.h +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_QUATERNION_H) -#define INCLUDED_MATH_QUATERNION_H - -/// \file -/// \brief Quaternion data types and related operations. - -#include "math/matrix.h" - -/// \brief A quaternion stored in single-precision floating-point. -typedef Vector4 Quaternion; - -const Quaternion c_quaternion_identity(0, 0, 0, 1); - -inline Quaternion quaternion_multiplied_by_quaternion(const Quaternion& quaternion, const Quaternion& other) -{ - return Quaternion( - quaternion[3]*other[0] + quaternion[0]*other[3] + quaternion[1]*other[2] - quaternion[2]*other[1], - quaternion[3]*other[1] + quaternion[1]*other[3] + quaternion[2]*other[0] - quaternion[0]*other[2], - quaternion[3]*other[2] + quaternion[2]*other[3] + quaternion[0]*other[1] - quaternion[1]*other[0], - quaternion[3]*other[3] - quaternion[0]*other[0] - quaternion[1]*other[1] - quaternion[2]*other[2] - ); -} - -inline void quaternion_multiply_by_quaternion(Quaternion& quaternion, const Quaternion& other) -{ - quaternion = quaternion_multiplied_by_quaternion(quaternion, other); -} - -/// \brief Constructs a quaternion which rotates between two points on the unit-sphere, \p from and \p to. -inline Quaternion quaternion_for_unit_vectors(const Vector3& from, const Vector3& to) -{ - return Quaternion(vector3_cross(from, to), static_cast(vector3_dot(from, to))); -} - -inline Quaternion quaternion_for_axisangle(const Vector3& axis, double angle) -{ - angle *= 0.5; - float sa = static_cast(sin(angle)); - return Quaternion(axis[0] * sa, axis[1] * sa, axis[2] * sa, static_cast(cos(angle))); -} - -inline Quaternion quaternion_for_x(double angle) -{ - angle *= 0.5; - return Quaternion(static_cast(sin(angle)), 0, 0, static_cast(cos(angle))); -} - -inline Quaternion quaternion_for_y(double angle) -{ - angle *= 0.5; - return Quaternion(0, static_cast(sin(angle)), 0, static_cast(cos(angle))); -} - -inline Quaternion quaternion_for_z(double angle) -{ - angle *= 0.5; - return Quaternion(0, 0, static_cast(sin(angle)), static_cast(cos(angle))); -} - -inline Quaternion quaternion_inverse(const Quaternion& quaternion) -{ - return Quaternion(vector3_negated(vector4_to_vector3(quaternion)), quaternion[3]); -} - -inline void quaternion_conjugate(Quaternion& quaternion) -{ - quaternion = quaternion_inverse(quaternion); -} - -inline Quaternion quaternion_normalised(const Quaternion& quaternion) -{ - const double n = (1.0 / (quaternion[0] * quaternion[0] + quaternion[1] * quaternion[1] + quaternion[2] * quaternion[2] + quaternion[3] * quaternion[3])); - return Quaternion( - static_cast(quaternion[0] * n), - static_cast(quaternion[1] * n), - static_cast(quaternion[2] * n), - static_cast(quaternion[3] * n) - ); -} - -inline void quaternion_normalise(Quaternion& quaternion) -{ - quaternion = quaternion_normalised(quaternion); -} - -/// \brief Constructs a pure-rotation matrix from \p quaternion. -inline Matrix4 matrix4_rotation_for_quaternion(const Quaternion& quaternion) -{ -#if 0 - const double xx = quaternion[0] * quaternion[0]; - const double xy = quaternion[0] * quaternion[1]; - const double xz = quaternion[0] * quaternion[2]; - const double xw = quaternion[0] * quaternion[3]; - - const double yy = quaternion[1] * quaternion[1]; - const double yz = quaternion[1] * quaternion[2]; - const double yw = quaternion[1] * quaternion[3]; - - const double zz = quaternion[2] * quaternion[2]; - const double zw = quaternion[2] * quaternion[3]; - - return Matrix4( - static_cast( 1 - 2 * ( yy + zz ) ), - static_cast( 2 * ( xy + zw ) ), - static_cast( 2 * ( xz - yw ) ), - 0, - static_cast( 2 * ( xy - zw ) ), - static_cast( 1 - 2 * ( xx + zz ) ), - static_cast( 2 * ( yz + xw ) ), - 0, - static_cast( 2 * ( xz + yw ) ), - static_cast( 2 * ( yz - xw ) ), - static_cast( 1 - 2 * ( xx + yy ) ), - 0, - 0, - 0, - 0, - 1 - ); - -#else - const double x2 = quaternion[0] + quaternion[0]; - const double y2 = quaternion[1] + quaternion[1]; - const double z2 = quaternion[2] + quaternion[2]; - const double xx = quaternion[0] * x2; - const double xy = quaternion[0] * y2; - const double xz = quaternion[0] * z2; - const double yy = quaternion[1] * y2; - const double yz = quaternion[1] * z2; - const double zz = quaternion[2] * z2; - const double wx = quaternion[3] * x2; - const double wy = quaternion[3] * y2; - const double wz = quaternion[3] * z2; - - return Matrix4( - static_cast( 1.0 - (yy + zz) ), - static_cast(xy + wz), - static_cast(xz - wy), - 0, - static_cast(xy - wz), - static_cast( 1.0 - (xx + zz) ), - static_cast(yz + wx), - 0, - static_cast(xz + wy), - static_cast(yz - wx), - static_cast( 1.0 - (xx + yy) ), - 0, - 0, - 0, - 0, - 1 - ); - -#endif -} - -const double c_half_sqrt2 = 0.70710678118654752440084436210485; -const float c_half_sqrt2f = static_cast(c_half_sqrt2); - -inline bool quaternion_component_is_90(float component) -{ - return (fabs(component) - c_half_sqrt2) < 0.001; -} - -inline Matrix4 matrix4_rotation_for_quaternion_quantised(const Quaternion& quaternion) -{ - if(quaternion.y() == 0 - && quaternion.z() == 0 - && quaternion_component_is_90(quaternion.x()) - && quaternion_component_is_90(quaternion.w())) - { - return matrix4_rotation_for_sincos_x((quaternion.x() > 0) ? 1.f : -1.f, 0); - } - - if(quaternion.x() == 0 - && quaternion.z() == 0 - && quaternion_component_is_90(quaternion.y()) - && quaternion_component_is_90(quaternion.w())) - { - return matrix4_rotation_for_sincos_y((quaternion.y() > 0) ? 1.f : -1.f, 0); - } - - if(quaternion.x() == 0 - && quaternion.y() == 0 - && quaternion_component_is_90(quaternion.z()) - && quaternion_component_is_90(quaternion.w())) - { - return matrix4_rotation_for_sincos_z((quaternion.z() > 0) ? 1.f : -1.f, 0); - } - - return matrix4_rotation_for_quaternion(quaternion); -} - -inline Quaternion quaternion_for_matrix4_rotation(const Matrix4& matrix4) -{ - Matrix4 transposed = matrix4_transposed(matrix4); - - double trace = transposed[0] + transposed[5] + transposed[10] + 1.0; - - if(trace > 0.0001) - { - double S = 0.5 / sqrt(trace); - return Quaternion( - static_cast((transposed[9] - transposed[6]) * S), - static_cast((transposed[2] - transposed[8]) * S), - static_cast((transposed[4] - transposed[1]) * S), - static_cast(0.25 / S) - ); - } - - if(transposed[0] >= transposed[5] && transposed[0] >= transposed[10]) - { - double S = 2.0 * sqrt(1.0 + transposed[0] - transposed[5] - transposed[10]); - return Quaternion( - static_cast(0.25 / S), - static_cast((transposed[1] + transposed[4]) / S), - static_cast((transposed[2] + transposed[8]) / S), - static_cast((transposed[6] + transposed[9]) / S) - ); - } - - if(transposed[5] >= transposed[0] && transposed[5] >= transposed[10]) - { - double S = 2.0 * sqrt(1.0 + transposed[5] - transposed[0] - transposed[10]); - return Quaternion( - static_cast((transposed[1] + transposed[4]) / S), - static_cast(0.25 / S), - static_cast((transposed[6] + transposed[9]) / S), - static_cast((transposed[2] + transposed[8]) / S) - ); - } - - double S = 2.0 * sqrt(1.0 + transposed[10] - transposed[0] - transposed[5]); - return Quaternion( - static_cast((transposed[2] + transposed[8]) / S), - static_cast((transposed[6] + transposed[9]) / S), - static_cast(0.25 / S), - static_cast((transposed[1] + transposed[4]) / S) - ); -} - -/// \brief Returns \p self concatenated with the rotation transform produced by \p rotation. -/// The concatenated rotation occurs before \p self. -inline Matrix4 matrix4_rotated_by_quaternion(const Matrix4& self, const Quaternion& rotation) -{ - return matrix4_multiplied_by_matrix4(self, matrix4_rotation_for_quaternion(rotation)); -} - -/// \brief Concatenates \p self with the rotation transform produced by \p rotation. -/// The concatenated rotation occurs before \p self. -inline void matrix4_rotate_by_quaternion(Matrix4& self, const Quaternion& rotation) -{ - self = matrix4_rotated_by_quaternion(self, rotation); -} - -/// \brief Rotates \p self by \p rotation, using \p pivotpoint. -inline void matrix4_pivoted_rotate_by_quaternion(Matrix4& self, const Quaternion& rotation, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(self, pivotpoint); - matrix4_rotate_by_quaternion(self, rotation); - matrix4_translate_by_vec3(self, vector3_negated(pivotpoint)); -} - -inline Vector3 quaternion_transformed_point(const Quaternion& quaternion, const Vector3& point) -{ - double xx = quaternion.x() * quaternion.x(); - double yy = quaternion.y() * quaternion.y(); - double zz = quaternion.z() * quaternion.z(); - double ww = quaternion.w() * quaternion.w(); - - double xy2 = quaternion.x() * quaternion.y() * 2; - double xz2 = quaternion.x() * quaternion.z() * 2; - double xw2 = quaternion.x() * quaternion.w() * 2; - double yz2 = quaternion.y() * quaternion.z() * 2; - double yw2 = quaternion.y() * quaternion.w() * 2; - double zw2 = quaternion.z() * quaternion.w() * 2; - - return Vector3( - static_cast(ww * point.x() + yw2 * point.z() - zw2 * point.y() + xx * point.x() + xy2 * point.y() + xz2 * point.z() - zz * point.x() - yy * point.x()), - static_cast(xy2 * point.x() + yy * point.y() + yz2 * point.z() + zw2 * point.x() - zz * point.y() + ww * point.y() - xw2 * point.z() - xx * point.y()), - static_cast(xz2 * point.x() + yz2 * point.y() + zz * point.z() - yw2 * point.x() - yy * point.z() + xw2 * point.y() - xx * point.z() + ww * point.z()) - ); -} - -/// \brief Constructs a pure-rotation transform from \p axis and \p angle (radians). -inline Matrix4 matrix4_rotation_for_axisangle(const Vector3& axis, double angle) -{ - return matrix4_rotation_for_quaternion(quaternion_for_axisangle(axis, angle)); -} - -/// \brief Rotates \p self about \p axis by \p angle. -inline void matrix4_rotate_by_axisangle(Matrix4& self, const Vector3& axis, double angle) -{ - matrix4_multiply_by_matrix4(self, matrix4_rotation_for_axisangle(axis, angle)); -} - -/// \brief Rotates \p self about \p axis by \p angle using \p pivotpoint. -inline void matrix4_pivoted_rotate_by_axisangle(Matrix4& self, const Vector3& axis, double angle, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(self, pivotpoint); - matrix4_rotate_by_axisangle(self, axis, angle); - matrix4_translate_by_vec3(self, vector3_negated(pivotpoint)); -} - - -#endif diff --git a/libs/math/vector.cpp b/libs/math/vector.cpp deleted file mode 100644 index d72bd9e4..00000000 --- a/libs/math/vector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "vector.h" - diff --git a/libs/math/vector.h b/libs/math/vector.h deleted file mode 100644 index 19fdd755..00000000 --- a/libs/math/vector.h +++ /dev/null @@ -1,800 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MATH_VECTOR_H) -#define INCLUDED_MATH_VECTOR_H - -/// \file -/// \brief Vector data types and related operations. - -#include "generic/vector.h" - -#if defined (_MSC_VER) - -inline int lrint (double flt) -{ - int i; - - _asm - { - fld flt - fistp i - }; - - return i; -} - -#elif defined(__FreeBSD__) - -inline int lrint(double f) -{ - return static_cast(f + 0.5); -} - -#elif defined(__GNUC__) - - // lrint is part of ISO C99 -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 - -#define __USE_ISOC9X 1 -#define __USE_ISOC99 1 - -#else -#error "unsupported platform" -#endif - -#include -#include -#include - - -//#include "debugging/debugging.h" - -/// \brief Returns true if \p self is equal to other \p other within \p epsilon. -template -inline bool float_equal_epsilon(const Element& self, const OtherElement& other, const Element& epsilon) -{ - return fabs(other - self) < epsilon; -} - -/// \brief Returns the value midway between \p self and \p other. -template -inline Element float_mid(const Element& self, const Element& other) -{ - return Element((self + other) * 0.5); -} - -/// \brief Returns \p f rounded to the nearest integer. Note that this is not the same behaviour as casting from float to int. -template -inline int float_to_integer(const Element& f) -{ - return lrint(f); -} - -/// \brief Returns \p f rounded to the nearest multiple of \p snap. -template -inline Element float_snapped(const Element& f, const OtherElement& snap) -{ - return Element(float_to_integer(f / snap) * snap); -} - -/// \brief Returns true if \p f has no decimal fraction part. -template -inline bool float_is_integer(const Element& f) -{ - return f == Element(float_to_integer(f)); -} - -/// \brief Returns \p self modulated by the range [0, \p modulus) -/// \p self must be in the range [\p -modulus, \p modulus) -template -inline Element float_mod_range(const Element& self, const ModulusElement& modulus) -{ - return Element((self < 0.0) ? self + modulus : self); -} - -/// \brief Returns \p self modulated by the range [0, \p modulus) -template -inline Element float_mod(const Element& self, const ModulusElement& modulus) -{ - return float_mod_range(Element(fmod(static_cast(self), static_cast(modulus))), modulus); -} - - -template -inline BasicVector2 vector2_added(const BasicVector2& self, const BasicVector2& other) -{ - return BasicVector2( - Element(self.x() + other.x()), - Element(self.y() + other.y()) - ); -} -template -inline BasicVector2 operator+(const BasicVector2& self, const BasicVector2& other) -{ - return vector2_added(self, other); -} -template -inline void vector2_add(BasicVector2& self, const BasicVector2& other) -{ - self.x() += Element(other.x()); - self.y() += Element(other.y()); -} -template -inline void operator+=(BasicVector2& self, const BasicVector2& other) -{ - vector2_add(self, other); -} - - -template -inline BasicVector2 vector2_subtracted(const BasicVector2& self, const BasicVector2& other) -{ - return BasicVector2( - Element(self.x() - other.x()), - Element(self.y() - other.y()) - ); -} -template -inline BasicVector2 operator-(const BasicVector2& self, const BasicVector2& other) -{ - return vector2_subtracted(self, other); -} -template -inline void vector2_subtract(BasicVector2& self, const BasicVector2& other) -{ - self.x() -= Element(other.x()); - self.y() -= lement(other.y()); -} -template -inline void operator-=(BasicVector2& self, const BasicVector2& other) -{ - vector2_subtract(self, other); -} - - -template -inline BasicVector2 vector2_scaled(const BasicVector2& self, OtherElement other) -{ - return BasicVector2( - Element(self.x() * other), - Element(self.y() * other) - ); -} -template -inline BasicVector2 operator*(const BasicVector2& self, OtherElement other) -{ - return vector2_scaled(self, other); -} -template -inline void vector2_scale(BasicVector2& self, OtherElement other) -{ - self.x() *= Element(other); - self.y() *= Element(other); -} -template -inline void operator*=(BasicVector2& self, OtherElement other) -{ - vector2_scale(self, other); -} - - -template -inline BasicVector2 vector2_scaled(const BasicVector2& self, const BasicVector2& other) -{ - return BasicVector2( - Element(self.x() * other.x()), - Element(self.y() * other.y()) - ); -} -template -inline BasicVector2 operator*(const BasicVector2& self, const BasicVector2& other) -{ - return vector2_scaled(self, other); -} -template -inline void vector2_scale(BasicVector2& self, const BasicVector2& other) -{ - self.x() *= Element(other.x()); - self.y() *= Element(other.y()); -} -template -inline void operator*=(BasicVector2& self, const BasicVector2& other) -{ - vector2_scale(self, other); -} - -template -inline BasicVector2 vector2_divided(const BasicVector2& self, const BasicVector2& other) -{ - return BasicVector2( - Element(self.x() / other.x()), - Element(self.y() / other.y()) - ); -} -template -inline BasicVector2 operator/(const BasicVector2& self, const BasicVector2& other) -{ - return vector2_divided(self, other); -} -template -inline void vector2_divide(BasicVector2& self, const BasicVector2& other) -{ - self.x() /= Element(other.x()); - self.y() /= Element(other.y()); -} -template -inline void operator/=(BasicVector2& self, const BasicVector2& other) -{ - vector2_divide(self, other); -} - - -template -inline BasicVector2 vector2_divided(const BasicVector2& self, OtherElement other) -{ - return BasicVector2( - Element(self.x() / other), - Element(self.y() / other) - ); -} -template -inline BasicVector2 operator/(const BasicVector2& self, OtherElement other) -{ - return vector2_divided(self, other); -} -template -inline void vector2_divide(BasicVector2& self, OtherElement other) -{ - self.x() /= Element(other); - self.y() /= Element(other); -} -template -inline void operator/=(BasicVector2& self, OtherElement other) -{ - vector2_divide(self, other); -} - -template -inline double vector2_dot(const BasicVector2& self, const BasicVector2& other) -{ - return self.x() * other.x() + self.y() * other.y(); -} - -template -inline double vector2_length_squared(const BasicVector2& self) -{ - return vector2_dot(self, self); -} - -template -inline double vector2_length(const BasicVector2& self) -{ - return sqrt(vector2_length_squared(self)); -} - -template -inline double vector2_cross(const BasicVector2& self, const BasicVector2& other) -{ - return self.x() * other.y() - self.y() * other.x(); -} - -const Vector3 g_vector3_identity(0, 0, 0); -const Vector3 g_vector3_max = Vector3(FLT_MAX, FLT_MAX, FLT_MAX); -const Vector3 g_vector3_axis_x(1, 0, 0); -const Vector3 g_vector3_axis_y(0, 1, 0); -const Vector3 g_vector3_axis_z(0, 0, 1); - -const Vector3 g_vector3_axes[3] = { g_vector3_axis_x, g_vector3_axis_y, g_vector3_axis_z }; - -template -inline void vector3_swap(BasicVector3& self, BasicVector3& other) -{ - std::swap(self.x(), other.x()); - std::swap(self.y(), other.y()); - std::swap(self.z(), other.z()); -} - -template -inline bool vector3_equal(const BasicVector3& self, const BasicVector3& other) -{ - return self.x() == other.x() && self.y() == other.y() && self.z() == other.z(); -} -template -inline bool operator==(const BasicVector3& self, const BasicVector3& other) -{ - return vector3_equal(self, other); -} -template -inline bool operator!=(const BasicVector3& self, const BasicVector3& other) -{ - return !vector3_equal(self, other); -} - - -template -inline bool vector3_equal_epsilon(const BasicVector3& self, const BasicVector3& other, Epsilon epsilon) -{ - return float_equal_epsilon(self.x(), other.x(), epsilon) - && float_equal_epsilon(self.y(), other.y(), epsilon) - && float_equal_epsilon(self.z(), other.z(), epsilon); -} - - - -template -inline BasicVector3 vector3_added(const BasicVector3& self, const BasicVector3& other) -{ - return BasicVector3( - Element(self.x() + other.x()), - Element(self.y() + other.y()), - Element(self.z() + other.z()) - ); -} -template -inline BasicVector3 operator+(const BasicVector3& self, const BasicVector3& other) -{ - return vector3_added(self, other); -} -template -inline void vector3_add(BasicVector3& self, const BasicVector3& other) -{ - self.x() += static_cast(other.x()); - self.y() += static_cast(other.y()); - self.z() += static_cast(other.z()); -} -template -inline void operator+=(BasicVector3& self, const BasicVector3& other) -{ - vector3_add(self, other); -} - -template -inline BasicVector3 vector3_subtracted(const BasicVector3& self, const BasicVector3& other) -{ - return BasicVector3( - Element(self.x() - other.x()), - Element(self.y() - other.y()), - Element(self.z() - other.z()) - ); -} -template -inline BasicVector3 operator-(const BasicVector3& self, const BasicVector3& other) -{ - return vector3_subtracted(self, other); -} -template -inline void vector3_subtract(BasicVector3& self, const BasicVector3& other) -{ - self.x() -= static_cast(other.x()); - self.y() -= static_cast(other.y()); - self.z() -= static_cast(other.z()); -} -template -inline void operator-=(BasicVector3& self, const BasicVector3& other) -{ - vector3_subtract(self, other); -} - -template -inline BasicVector3 vector3_scaled(const BasicVector3& self, const BasicVector3& other) -{ - return BasicVector3( - Element(self.x() * other.x()), - Element(self.y() * other.y()), - Element(self.z() * other.z()) - ); -} -template -inline BasicVector3 operator*(const BasicVector3& self, const BasicVector3& other) -{ - return vector3_scaled(self, other); -} -template -inline void vector3_scale(BasicVector3& self, const BasicVector3& other) -{ - self.x() *= static_cast(other.x()); - self.y() *= static_cast(other.y()); - self.z() *= static_cast(other.z()); -} -template -inline void operator*=(BasicVector3& self, const BasicVector3& other) -{ - vector3_scale(self, other); -} - -template -inline BasicVector3 vector3_scaled(const BasicVector3& self, const OtherElement& scale) -{ - return BasicVector3( - Element(self.x() * scale), - Element(self.y() * scale), - Element(self.z() * scale) - ); -} -template -inline BasicVector3 operator*(const BasicVector3& self, const OtherElement& scale) -{ - return vector3_scaled(self, scale); -} -template -inline void vector3_scale(BasicVector3& self, const OtherElement& scale) -{ - self.x() *= static_cast(scale); - self.y() *= static_cast(scale); - self.z() *= static_cast(scale); -} -template -inline void operator*=(BasicVector3& self, const OtherElement& scale) -{ - vector3_scale(self, scale); -} - -template -inline BasicVector3 vector3_divided(const BasicVector3& self, const BasicVector3& other) -{ - return BasicVector3( - Element(self.x() / other.x()), - Element(self.y() / other.y()), - Element(self.z() / other.z()) - ); -} -template -inline BasicVector3 operator/(const BasicVector3& self, const BasicVector3& other) -{ - return vector3_divided(self, other); -} -template -inline void vector3_divide(BasicVector3& self, const BasicVector3& other) -{ - self.x() /= static_cast(other.x()); - self.y() /= static_cast(other.y()); - self.z() /= static_cast(other.z()); -} -template -inline void operator/=(BasicVector3& self, const BasicVector3& other) -{ - vector3_divide(self, other); -} - -template -inline BasicVector3 vector3_divided(const BasicVector3& self, const OtherElement& divisor) -{ - return BasicVector3( - Element(self.x() / divisor), - Element(self.y() / divisor), - Element(self.z() / divisor) - ); -} -template -inline BasicVector3 operator/(const BasicVector3& self, const OtherElement& divisor) -{ - return vector3_divided(self, divisor); -} -template -inline void vector3_divide(BasicVector3& self, const OtherElement& divisor) -{ - self.x() /= static_cast(divisor); - self.y() /= static_cast(divisor); - self.z() /= static_cast(divisor); -} -template -inline void operator/=(BasicVector3& self, const OtherElement& divisor) -{ - vector3_divide(self, divisor); -} - -template -inline double vector3_dot(const BasicVector3& self, const BasicVector3& other) -{ - return self.x() * other.x() + self.y() * other.y() + self.z() * other.z(); -} - -template -inline BasicVector3 vector3_mid(const BasicVector3& begin, const BasicVector3& end) -{ - return vector3_scaled(vector3_added(begin, end), 0.5); -} - -template -inline BasicVector3 vector3_cross(const BasicVector3& self, const BasicVector3& other) -{ - return BasicVector3( - Element(self.y() * other.z() - self.z() * other.y()), - Element(self.z() * other.x() - self.x() * other.z()), - Element(self.x() * other.y() - self.y() * other.x()) - ); -} - -template -inline BasicVector3 vector3_negated(const BasicVector3& self) -{ - return BasicVector3(-self.x(), -self.y(), -self.z()); -} -template -inline BasicVector3 operator-(const BasicVector3& self) -{ - return vector3_negated(self); -} - -template -inline void vector3_negate(BasicVector3& self) -{ - self = vector3_negated(self); -} - -template -inline double vector3_length_squared(const BasicVector3& self) -{ - return vector3_dot(self, self); -} - -template -inline double vector3_length(const BasicVector3& self) -{ - return sqrt(vector3_length_squared(self)); -} - -template -inline Element float_divided(Element f, Element other) -{ - //ASSERT_MESSAGE(other != 0, "float_divided: invalid divisor"); - return f / other; -} - -template -inline BasicVector3 vector3_normalised(const BasicVector3& self) -{ - return vector3_scaled(self, float_divided(1.0, vector3_length(self))); -} - -template -inline void vector3_normalise(BasicVector3& self) -{ - self = vector3_normalised(self); -} - - -template -inline BasicVector3 vector3_snapped(const BasicVector3& self) -{ - return BasicVector3( - Element(float_to_integer(self.x())), - Element(float_to_integer(self.y())), - Element(float_to_integer(self.z())) - ); -} -template -inline void vector3_snap(BasicVector3& self) -{ - self = vector3_snapped(self); -} -template -inline BasicVector3 vector3_snapped(const BasicVector3& self, const OtherElement& snap) -{ - return BasicVector3( - Element(float_snapped(self.x(), snap)), - Element(float_snapped(self.y(), snap)), - Element(float_snapped(self.z(), snap)) - ); -} -template -inline void vector3_snap(BasicVector3& self, const OtherElement& snap) -{ - self = vector3_snapped(self, snap); -} - -inline Vector3 vector3_for_spherical(double theta, double phi) -{ - return Vector3( - static_cast(cos(theta) * cos(phi)), - static_cast(sin(theta) * cos(phi)), - static_cast(sin(phi)) - ); -} - - - - -template -inline bool vector4_equal(const BasicVector4& self, const BasicVector4& other) -{ - return self.x() == other.x() && self.y() == other.y() && self.z() == other.z() && self.w() == other.w(); -} -template -inline bool operator==(const BasicVector4& self, const BasicVector4& other) -{ - return vector4_equal(self, other); -} -template -inline bool operator!=(const BasicVector4& self, const BasicVector4& other) -{ - return !vector4_equal(self, other); -} - -template -inline bool vector4_equal_epsilon(const BasicVector4& self, const BasicVector4& other, Element epsilon) -{ - return float_equal_epsilon(self.x(), other.x(), epsilon) - && float_equal_epsilon(self.y(), other.y(), epsilon) - && float_equal_epsilon(self.z(), other.z(), epsilon) - && float_equal_epsilon(self.w(), other.w(), epsilon); -} - -template -inline BasicVector4 vector4_added(const BasicVector4& self, const BasicVector4& other) -{ - return BasicVector4( - float(self.x() + other.x()), - float(self.y() + other.y()), - float(self.z() + other.z()), - float(self.w() + other.w()) - ); -} -template -inline BasicVector4 operator+(const BasicVector4& self, const BasicVector4& other) -{ - return vector4_added(self, other); -} -template -inline void vector4_add(BasicVector4& self, const BasicVector4& other) -{ - self.x() += static_cast(other.x()); - self.y() += static_cast(other.y()); - self.z() += static_cast(other.z()); - self.w() += static_cast(other.w()); -} -template -inline void operator+=(BasicVector4& self, const BasicVector4& other) -{ - vector4_add(self, other); -} - -template -inline BasicVector4 vector4_subtracted(const BasicVector4& self, const BasicVector4& other) -{ - return BasicVector4( - float(self.x() - other.x()), - float(self.y() - other.y()), - float(self.z() - other.z()), - float(self.w() - other.w()) - ); -} -template -inline BasicVector4 operator-(const BasicVector4& self, const BasicVector4& other) -{ - return vector4_subtracted(self, other); -} -template -inline void vector4_subtract(BasicVector4& self, const BasicVector4& other) -{ - self.x() -= static_cast(other.x()); - self.y() -= static_cast(other.y()); - self.z() -= static_cast(other.z()); - self.w() -= static_cast(other.w()); -} -template -inline void operator-=(BasicVector4& self, const BasicVector4& other) -{ - vector4_subtract(self, other); -} - -template -inline BasicVector4 vector4_scaled(const BasicVector4& self, const BasicVector4& other) -{ - return BasicVector4( - float(self.x() * other.x()), - float(self.y() * other.y()), - float(self.z() * other.z()), - float(self.w() * other.w()) - ); -} -template -inline BasicVector4 operator*(const BasicVector4& self, const BasicVector4& other) -{ - return vector4_scaled(self, other); -} -template -inline void vector4_scale(BasicVector4& self, const BasicVector4& other) -{ - self.x() *= static_cast(other.x()); - self.y() *= static_cast(other.y()); - self.z() *= static_cast(other.z()); - self.w() *= static_cast(other.w()); -} -template -inline void operator*=(BasicVector4& self, const BasicVector4& other) -{ - vector4_scale(self, other); -} - -template -inline BasicVector4 vector4_scaled(const BasicVector4& self, OtherElement scale) -{ - return BasicVector4( - float(self.x() * scale), - float(self.y() * scale), - float(self.z() * scale), - float(self.w() * scale) - ); -} -template -inline BasicVector4 operator*(const BasicVector4& self, OtherElement scale) -{ - return vector4_scaled(self, scale); -} -template -inline void vector4_scale(BasicVector4& self, OtherElement scale) -{ - self.x() *= static_cast(scale); - self.y() *= static_cast(scale); - self.z() *= static_cast(scale); - self.w() *= static_cast(scale); -} -template -inline void operator*=(BasicVector4& self, OtherElement scale) -{ - vector4_scale(self, scale); -} - -template -inline BasicVector4 vector4_divided(const BasicVector4& self, OtherElement divisor) -{ - return BasicVector4( - float(self.x() / divisor), - float(self.y() / divisor), - float(self.z() / divisor), - float(self.w() / divisor) - ); -} -template -inline BasicVector4 operator/(const BasicVector4& self, OtherElement divisor) -{ - return vector4_divided(self, divisor); -} -template -inline void vector4_divide(BasicVector4& self, OtherElement divisor) -{ - self.x() /= divisor; - self.y() /= divisor; - self.z() /= divisor; - self.w() /= divisor; -} -template -inline void operator/=(BasicVector4& self, OtherElement divisor) -{ - vector4_divide(self, divisor); -} - -template -inline double vector4_dot(const BasicVector4& self, const BasicVector4& other) -{ - return self.x() * other.x() + self.y() * other.y() + self.z() * other.z() + self.w() * other.w(); -} - -template -inline BasicVector3 vector4_projected(const BasicVector4& self) -{ - return vector3_scaled(vector4_to_vector3(self), 1.0 / self[3]); -} - -#endif diff --git a/libs/mathlib.h b/libs/mathlib.h index 04fbc0f0..44bf01c9 100644 --- a/libs/mathlib.h +++ b/libs/mathlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,16 +25,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // mathlib.h #include -#ifdef __cplusplus +#include "bytebool.h" -// start declarations of functions defined in C library. +#ifdef __cplusplus extern "C" { - #endif -#include "bytebool.h" - typedef float vec_t; typedef vec_t vec3_t[3]; typedef vec_t vec5_t[5]; @@ -54,14 +51,16 @@ typedef vec_t vec4_t[4]; #define Q_PI 3.14159265358979323846f -extern const vec3_t vec3_origin; - -extern const vec3_t g_vec3_axis_x; -extern const vec3_t g_vec3_axis_y; -extern const vec3_t g_vec3_axis_z; +extern vec3_t vec3_origin; #define EQUAL_EPSILON 0.001 +#ifndef VEC_MAX +#define VEC_MAX 3.402823466e+38F +#endif + +qboolean VectorCompare (vec3_t v1, vec3_t v2); + #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) #define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) #define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) @@ -70,18 +69,13 @@ extern const vec3_t g_vec3_axis_z; #define VectorSet(v, a, b, c) ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c)) #define VectorScale(a,b,c) ((c)[0]=(b)*(a)[0],(c)[1]=(b)*(a)[1],(c)[2]=(b)*(a)[2]) #define VectorMid(a,b,c) ((c)[0]=((a)[0]+(b)[0])*0.5f,(c)[1]=((a)[1]+(b)[1])*0.5f,(c)[2]=((a)[2]+(b)[2])*0.5f) -#define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) +#define VectorNegative(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) #define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) #define VectorClear(x) ((x)[0]=(x)[1]=(x)[2]=0) -#define FLOAT_SNAP(f,snap) ( (float)( floor( (f) / (snap) + 0.5 ) * (snap) ) ) -#define FLOAT_TO_INTEGER(f) ( (float)( floor( (f) + 0.5 ) ) ) - #define Q_rint(in) ((vec_t)floor(in+0.5)) -qboolean VectorCompare (const vec3_t v1, const vec3_t v2); - -vec_t VectorLength(const vec3_t v); +vec_t VectorLength(vec3_t v); void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc ); @@ -107,11 +101,6 @@ void VectorFSnap(vec3_t point, float snap); void ClearBounds (vec3_t mins, vec3_t maxs); void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs); - -#define PITCH 0 // up / down -#define YAW 1 // left / right -#define ROLL 2 // fall over - void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); void VectorToAngles( vec3_t vec, vec3_t angles ); @@ -131,6 +120,8 @@ void NormalToLatLong( const vec3_t normal, byte bytes[2] ); int PlaneTypeForNormal (vec3_t normal); void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ); +// Spog +// code imported from geomlib /*! \todo @@ -152,50 +143,10 @@ typedef vec_t m4x4_t[16]; #define M4X4_INDEX(m,row,col) (m[(col<<2)+row]) +typedef enum { TRANSLATE, SCALE, ROTATE } transformtype; // legacy, used only in pmesh.cpp + typedef enum { eXYZ, eYZX, eZXY, eXZY, eYXZ, eZYX } eulerOrder_t; -#define CLIP_PASS 0x00 // 000000 -#define CLIP_LT_X 0x01 // 000001 -#define CLIP_GT_X 0x02 // 000010 -#define CLIP_LT_Y 0x04 // 000100 -#define CLIP_GT_Y 0x08 // 001000 -#define CLIP_LT_Z 0x10 // 010000 -#define CLIP_GT_Z 0x20 // 100000 -#define CLIP_FAIL 0x3F // 111111 -typedef unsigned char clipmask_t; - -extern const m4x4_t g_m4x4_identity; - -#define M4X4_COPY(dst,src) (\ -(dst)[0]=(src)[0],\ -(dst)[1]=(src)[1],\ -(dst)[2]=(src)[2],\ -(dst)[3]=(src)[3],\ -(dst)[4]=(src)[4],\ -(dst)[5]=(src)[5],\ -(dst)[6]=(src)[6],\ -(dst)[7]=(src)[7],\ -(dst)[8]=(src)[8],\ -(dst)[9]=(src)[9],\ -(dst)[10]=(src)[10],\ -(dst)[11]=(src)[11],\ -(dst)[12]=(src)[12],\ -(dst)[13]=(src)[13],\ -(dst)[14]=(src)[14],\ -(dst)[15]=(src)[15]) - -typedef enum -{ - eRightHanded = 0, - eLeftHanded = 1, -} -m4x4Handedness_t; - -m4x4Handedness_t m4x4_handedness(const m4x4_t matrix); - -/*! assign other m4x4 to this m4x4 */ -void m4x4_assign(m4x4_t matrix, const m4x4_t other); - // constructors /*! create m4x4 as identity matrix */ void m4x4_identity(m4x4_t matrix); @@ -208,19 +159,7 @@ void m4x4_scale_for_vec3(m4x4_t matrix, const vec3_t scale); /*! create m4x4 as a rotation matrix, for a quaternion vec4 */ void m4x4_rotation_for_quat(m4x4_t matrix, const vec4_t rotation); /*! create m4x4 as a rotation matrix, for an axis vec3 and an angle (radians) */ -void m4x4_rotation_for_axisangle(m4x4_t matrix, const vec3_t axis, double angle); -/*! generate a perspective matrix by specifying the view frustum */ -void m4x4_frustum(m4x4_t matrix, vec_t left, vec_t right, vec_t bottom, vec_t top, vec_t nearval, vec_t farval); - -// a valid m4x4 to access is always first argument -/*! extract translation vec3 from matrix */ -void m4x4_get_translation_vec3(const m4x4_t matrix, vec3_t translation); -/*! extract euler rotation angles from a rotation-only matrix */ -void m4x4_get_rotation_vec3(const m4x4_t matrix, vec3_t euler, eulerOrder_t order); -/*! extract scale vec3 from matrix */ -void m4x4_get_scale_vec3(const m4x4_t matrix, vec3_t scale); -/*! extract translation/euler/scale from an orthogonal matrix. NOTE: requires right-handed axis-base */ -void m4x4_get_transform_vec3(const m4x4_t matrix, vec3_t translation, vec3_t euler, eulerOrder_t order, vec3_t scale); +void m4x4_rotation_for_axisangle(m4x4_t matrix, const vec3_t axis, vec_t angle); // a valid m4x4 to be modified is always first argument /*! translate m4x4 by a translation vec3 */ @@ -232,30 +171,23 @@ void m4x4_scale_by_vec3(m4x4_t matrix, const vec3_t scale); /*! rotate m4x4 by a quaternion vec4 */ void m4x4_rotate_by_quat(m4x4_t matrix, const vec4_t rotation); /*! rotate m4x4 by an axis vec3 and an angle (radians) */ -void m4x4_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, double angle); -/*! transform m4x4 by translation/eulerZYX/scaling vec3 (transform = scale * eulerZ * eulerY * eulerX * translation) */ +void m4x4_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, vec_t angle); +/*! transform m4x4 by translation/euler/scaling vec3 (transform = translation.euler.scale) */ void m4x4_transform_by_vec3(m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale); -/*! rotate m4x4 around a pivot point by eulerZYX vec3 */ +/*! rotate m4x4 around a pivot point by euler(degrees) vec3 */ void m4x4_pivoted_rotate_by_vec3(m4x4_t matrix, const vec3_t euler, eulerOrder_t order, const vec3_t pivotpoint); /*! scale m4x4 around a pivot point by scaling vec3 */ void m4x4_pivoted_scale_by_vec3(m4x4_t matrix, const vec3_t scale, const vec3_t pivotpoint); -/*! transform m4x4 around a pivot point by translation/eulerZYX/scaling vec3 */ +/*! transform m4x4 around a pivot point by translation/euler/scaling vec3 */ void m4x4_pivoted_transform_by_vec3(m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale, const vec3_t pivotpoint); -/*! transform m4x4 around a pivot point by translation/rotation/scaling vec3 */ -void m4x4_pivoted_transform_by_rotation(m4x4_t matrix, const vec3_t translation, const m4x4_t rotation, const vec3_t scale, const vec3_t pivotpoint); /*! rotate m4x4 around a pivot point by quaternion vec4 */ -void m4x4_pivoted_rotate_by_quat(m4x4_t matrix, const vec4_t quat, const vec3_t pivotpoint); +void m4x4_pivoted_rotate_by_quat(m4x4_t matrix, const vec4_t rotation, const vec3_t pivotpoint); /*! rotate m4x4 around a pivot point by axis vec3 and angle (radians) */ -void m4x4_pivoted_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, double angle, const vec3_t pivotpoint); - -/*! postmultiply m4x4 by another m4x4 */ -void m4x4_multiply_by_m4x4(m4x4_t matrix, const m4x4_t matrix_src); -/*! premultiply m4x4 by another m4x4 */ -void m4x4_premultiply_by_m4x4(m4x4_t matrix, const m4x4_t matrix_src); -/*! postmultiply orthogonal m4x4 by another orthogonal m4x4 */ -void m4x4_orthogonal_multiply_by_m4x4(m4x4_t matrix, const m4x4_t matrix_src); -/*! premultiply orthogonal m4x4 by another orthogonal m4x4 */ -void m4x4_orthogonal_premultiply_by_m4x4(m4x4_t matrix, const m4x4_t matrix_src); +void m4x4_pivoted_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, vec_t angle, const vec3_t pivotpoint); +/*! post-multiply m4x4 by another m4x4 */ +void m4x4_multiply_by_m4x4(m4x4_t matrix, const m4x4_t other); +/*! pre-multiply m4x4 by another m4x4 */ +void m4x4_premultiply_by_m4x4(m4x4_t matrix, const m4x4_t other); /*! multiply a point (x,y,z,1) by matrix */ void m4x4_transform_point(const m4x4_t matrix, vec3_t point); @@ -272,33 +204,10 @@ void m4x4_transform_normal(const m4x4_t matrix, vec3_t normal); /*! transpose a m4x4 */ void m4x4_transpose(m4x4_t matrix); /*! invert an orthogonal 4x3 subset of a 4x4 matrix */ -int m4x4_orthogonal_invert(m4x4_t matrix); +void m4x4_orthogonal_invert(m4x4_t matrix); /*! invert any m4x4 using Kramer's rule.. return 1 if matrix is singular, else return 0 */ int m4x4_invert(m4x4_t matrix); -/*! clip a point (x,y,z,1) by canonical matrix */ -clipmask_t m4x4_clip_point(const m4x4_t matrix, const vec3_t point, vec4_t clipped); -/*! device-space polygon for clipped triangle */ -unsigned int m4x4_clip_triangle(const m4x4_t matrix, const vec3_t p0, const vec3_t p1, const vec3_t p2, vec4_t clipped[9]); -/*! device-space line for clipped line */ -unsigned int m4x4_clip_line(const m4x4_t matrix, const vec3_t p0, const vec3_t p1, vec4_t clipped[2]); - - -//! quaternion identity -void quat_identity(vec4_t quat); -//! quaternion from two unit vectors -void quat_for_unit_vectors(vec4_t quat, const vec3_t from, const vec3_t to); -//! quaternion from axis and angle (radians) -void quat_for_axisangle(vec4_t quat, const vec3_t axis, double angle); -//! concatenates two rotations.. equivalent to m4x4_multiply_by_m4x4 .. postmultiply.. the right-hand side is the first rotation performed -void quat_multiply_by_quat(vec4_t quat, const vec4_t other); -//! negate a quaternion -void quat_conjugate(vec4_t quat); -//! normalise a quaternion -void quat_normalise(vec4_t quat); - - - /*! \todo object/ray intersection functions should maybe return a point rather than a distance? */ @@ -307,15 +216,15 @@ void quat_normalise(vec4_t quat); aabb_t - "axis-aligned" bounding box... origin: centre of bounding box... extents: +/- extents of box from origin... + radius: cached length of extents vector... */ typedef struct aabb_s { vec3_t origin; vec3_t extents; + vec_t radius; } aabb_t; -extern const aabb_t g_aabb_null; - /*! bbox_t - oriented bounding box... aabb: axis-aligned bounding box... @@ -325,7 +234,6 @@ typedef struct bbox_s { aabb_t aabb; vec3_t axes[3]; - vec_t radius; } bbox_t; /*! @@ -337,83 +245,58 @@ typedef struct ray_s vec3_t direction; } ray_t; -/*! -line_t - centre point and displacement of end point from centre -*/ -typedef struct line_s -{ - vec3_t origin; - vec3_t extents; -} line_t; - - -/*! Generate line from start/end points. */ -void line_construct_for_vec3(line_t* line, const vec3_t start, const vec3_t end); -/*! Return 2 if line is behind plane, else return 1 if line intersects plane, else return 0. */ -int line_test_plane(const line_t* line, const vec4_t plane); /*! Generate AABB from min/max. */ -void aabb_construct_for_vec3(aabb_t* aabb, const vec3_t min, const vec3_t max); +void aabb_construct_for_vec3(aabb_t *aabb, const vec3_t min, const vec3_t max); +/*! Update bounding-sphere radius. */ +void aabb_update_radius(aabb_t *aabb); /*! Initialise AABB to negative size. */ -void aabb_clear(aabb_t* aabb); +void aabb_clear(aabb_t *aabb); /*! Extend AABB to include point. */ -void aabb_extend_by_point(aabb_t* aabb, const vec3_t point); +void aabb_extend_by_point(aabb_t *aabb, const vec3_t point); /*! Extend AABB to include aabb_src. */ -void aabb_extend_by_aabb(aabb_t* aabb, const aabb_t* aabb_src); +void aabb_extend_by_aabb(aabb_t *aabb, const aabb_t *aabb_src); /*! Extend AABB by +/- extension vector. */ -void aabb_extend_by_vec3(aabb_t* aabb, vec3_t extension); +void aabb_extend_by_vec3(aabb_t *aabb, vec3_t extension); /*! Return 2 if point is inside, else 1 if point is on surface, else 0. */ -int aabb_test_point(const aabb_t* aabb, const vec3_t point); +int aabb_intersect_point(const aabb_t *aabb, const vec3_t point); /*! Return 2 if aabb_src intersects, else 1 if aabb_src touches exactly, else 0. */ -int aabb_test_aabb(const aabb_t* aabb, const aabb_t* aabb_src); +int aabb_intersect_aabb(const aabb_t *aabb, const aabb_t *aabb_src); /*! Return 2 if aabb is behind plane, else 1 if aabb intersects plane, else 0. */ -int aabb_test_plane(const aabb_t* aabb, const float* plane); +int aabb_intersect_plane(const aabb_t *aabb, const float *plane); /*! Return 1 if aabb intersects ray, else 0... dist = closest intersection. */ -int aabb_intersect_ray(const aabb_t* aabb, const ray_t* ray, vec3_t intersection); +int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec_t *dist); /*! Return 1 if aabb intersects ray, else 0. Faster, but does not provide point of intersection */ int aabb_test_ray(const aabb_t* aabb, const ray_t* ray); -/*! Return 2 if oriented aabb is behind plane, else 1 if aabb intersects plane, else 0. */ -int aabb_oriented_intersect_plane(const aabb_t* aabb, const m4x4_t transform, const vec_t* plane); - -/*! Calculate the corners of the aabb. */ -void aabb_corners(const aabb_t* aabb, vec3_t corners[8]); - -/*! (deprecated) Generate AABB from oriented bounding box. */ -void aabb_for_bbox(aabb_t* aabb, const bbox_t* bbox); -/*! (deprecated) Generate AABB from 2-dimensions of min/max, specified by axis. */ -void aabb_for_area(aabb_t* aabb, vec3_t area_tl, vec3_t area_br, int axis); -/*! Generate AABB to contain src* transform. NOTE: transform must be orthogonal */ +/*! Generate AABB from oriented bounding box. */ +void aabb_for_bbox(aabb_t *aabb, const bbox_t *bbox); +/*! Generate AABB from 2-dimensions of min/max, specified by axis. */ +void aabb_for_area(aabb_t *aabb, vec3_t area_tl, vec3_t area_br, int axis); +/*! Generate AABB to contain src * transform. NOTE: transform must be orthogonal */ void aabb_for_transformed_aabb(aabb_t* dst, const aabb_t* src, const m4x4_t transform); -/*! Update bounding-sphere radius. */ -void bbox_update_radius(bbox_t* bbox); + /*! Generate oriented bounding box from AABB and transformation matrix. */ -/*!\todo Remove need to specify eulerZYX/scale. */ -void bbox_for_oriented_aabb(bbox_t* bbox, const aabb_t* aabb, - const m4x4_t matrix, const vec3_t eulerZYX, const vec3_t scale); -/*! Return 2 if bbox is behind plane, else return 1 if bbox intersects plane, else return 0. */ -int bbox_intersect_plane(const bbox_t* bbox, const vec_t* plane); +/*!\todo Remove need to specify euler/scale. */ +void bbox_for_oriented_aabb(bbox_t *bbox, const aabb_t *aabb, + const m4x4_t matrix, const vec3_t euler, const vec3_t scale); +/*! Return 2 is bbox is behind plane, else return 1 if bbox intersects plane, else return 0. */ +int bbox_intersect_plane(const bbox_t *bbox, const vec_t* plane); /*! Generate a ray from an origin point and a direction unit-vector */ -void ray_construct_for_vec3(ray_t* ray, const vec3_t origin, const vec3_t direction); +void ray_construct_for_vec3(ray_t *ray, const vec3_t origin, const vec3_t direction); /*! Transform a ray */ -void ray_transform(ray_t* ray, const m4x4_t matrix); - -/*! distance from ray origin in ray direction to point. FLT_MAX if no intersection. */ -vec_t ray_intersect_point(const ray_t* ray, const vec3_t point, vec_t epsilon, vec_t divergence); -/*! distance from ray origin in ray direction to triangle. FLT_MAX if no intersection. */ -vec_t ray_intersect_triangle(const ray_t* ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2); -/*! distance from ray origin in ray direction to plane. */ -vec_t ray_intersect_plane(const ray_t* ray, const vec3_t normal, vec_t dist); - - -int plane_intersect_planes(const vec4_t plane1, const vec4_t plane2, const vec4_t plane3, vec3_t intersection); +void ray_transform(ray_t *ray, const m4x4_t matrix); +/*! return true if point intersects cone formed by ray, divergence and epsilon */ +vec_t ray_intersect_point(const ray_t *ray, const vec3_t point, vec_t epsilon, vec_t divergence); +/*! return true if triangle intersects ray... dist = dist from intersection point to ray-origin */ +vec_t ray_intersect_triangle(const ray_t *ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2); #ifdef __cplusplus } diff --git a/libs/mathlib/bbox.c b/libs/mathlib/bbox.c index e8dc8657..f421f917 100644 --- a/libs/mathlib/bbox.c +++ b/libs/mathlib/bbox.c @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -23,26 +23,25 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "mathlib.h" -const aabb_t g_aabb_null = { - { 0, 0, 0, }, - { -FLT_MAX, -FLT_MAX, -FLT_MAX, }, -}; - void aabb_construct_for_vec3(aabb_t *aabb, const vec3_t min, const vec3_t max) { VectorMid(min, max, aabb->origin); VectorSubtract(max, aabb->origin, aabb->extents); } +void aabb_update_radius(aabb_t *aabb) +{ + aabb->radius = VectorLength(aabb->extents); +} + void aabb_clear(aabb_t *aabb) { - VectorCopy(g_aabb_null.origin, aabb->origin); - VectorCopy(g_aabb_null.extents, aabb->extents); + aabb->origin[0] = aabb->origin[1] = aabb->origin[2] = 0; + aabb->extents[0] = aabb->extents[1] = aabb->extents[2] = -FLT_MAX; } void aabb_extend_by_point(aabb_t *aabb, const vec3_t point) { -#if 1 int i; vec_t min, max, displacement; for(i=0; i<3; i++) @@ -68,28 +67,6 @@ void aabb_extend_by_point(aabb_t *aabb, const vec3_t point) aabb->extents[i] = max - aabb->origin[i]; } } -#else - unsigned int i; - for(i=0; i<3; ++i) - { - if(aabb->extents[i] < 0) // degenerate - { - aabb->origin[i] = point[i]; - aabb->extents[i] = 0; - } - else - { - vec_t displacement = point[i] - aabb->origin[i]; - vec_t increment = (vec_t)fabs(displacement) - aabb->extents[i]; - if(increment > 0) - { - increment *= (vec_t)((displacement > 0) ? 0.5 : -0.5); - aabb->extents[i] += increment; - aabb->origin[i] += increment; - } - } - } -#endif } void aabb_extend_by_aabb(aabb_t *aabb, const aabb_t *aabb_src) @@ -137,7 +114,7 @@ void aabb_extend_by_vec3(aabb_t *aabb, vec3_t extension) VectorAdd(aabb->extents, extension, aabb->extents); } -int aabb_test_point(const aabb_t *aabb, const vec3_t point) +int aabb_intersect_point(const aabb_t *aabb, const vec3_t point) { int i; for(i=0; i<3; i++) @@ -146,7 +123,7 @@ int aabb_test_point(const aabb_t *aabb, const vec3_t point) return 1; } -int aabb_test_aabb(const aabb_t *aabb, const aabb_t *aabb_src) +int aabb_intersect_aabb(const aabb_t *aabb, const aabb_t *aabb_src) { int i; for (i=0; i<3; i++) @@ -155,14 +132,23 @@ int aabb_test_aabb(const aabb_t *aabb, const aabb_t *aabb_src) return 1; } -int aabb_test_plane(const aabb_t *aabb, const float *plane) +int aabb_intersect_plane(const aabb_t *aabb, const float *plane) { float fDist, fIntersect; // calc distance of origin from plane fDist = DotProduct(plane, aabb->origin) + plane[3]; - // calc extents distance relative to plane normal + // trivial accept/reject using bounding sphere + if (fabs(fDist) > aabb->radius) + { + if (fDist < 0) + return 2; // totally inside + else + return 0; // totally outside + } + + // calc extents distance relative to plane normal fIntersect = (vec_t)(fabs(plane[0] * aabb->extents[0]) + fabs(plane[1] * aabb->extents[1]) + fabs(plane[2] * aabb->extents[2])); // accept if origin is less than or equal to this distance if (fabs(fDist) < fIntersect) return 1; // partially inside @@ -181,7 +167,7 @@ from "Graphics Gems", Academic Press, 1990 #define LEFT 1 #define MIDDLE 2 -int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec3_t intersection) +int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec_t *dist) { int inside = 1; char quadrant[NUMDIM]; @@ -189,6 +175,7 @@ int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec3_t intersection int whichPlane; double maxT[NUMDIM]; double candidatePlane[NUMDIM]; + vec3_t coord, segment; const float *origin = ray->origin; const float *direction = ray->direction; @@ -218,7 +205,7 @@ int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec3_t intersection /* Ray origin inside bounding box */ if(inside == 1) { - VectorCopy(ray->origin, intersection); + *dist = 0.0f; return 1; } @@ -245,16 +232,19 @@ int aabb_intersect_ray(const aabb_t *aabb, const ray_t *ray, vec3_t intersection { if (whichPlane != i) { - intersection[i] = (vec_t)(origin[i] + maxT[whichPlane] * direction[i]); - if (fabs(intersection[i] - aabb->origin[i]) > aabb->extents[i]) + coord[i] = (vec_t)(origin[i] + maxT[whichPlane] * direction[i]); + if (fabs(coord[i] - aabb->origin[i]) > aabb->extents[i]) return 0; } else { - intersection[i] = (vec_t)candidatePlane[i]; + coord[i] = (vec_t)candidatePlane[i]; } } + VectorSubtract(coord, origin, segment); + *dist = DotProduct(segment, direction); + return 1; /* ray hits box */ } @@ -294,22 +284,6 @@ int aabb_test_ray(const aabb_t* aabb, const ray_t* ray) return 1; } -void aabb_orthogonal_transform(aabb_t* dst, const aabb_t* src, const m4x4_t transform) -{ - VectorCopy(src->origin, dst->origin); - m4x4_transform_point(transform, dst->origin); - - dst->extents[0] = (vec_t)(fabs(transform[0] * src->extents[0]) - + fabs(transform[4] * src->extents[1]) - + fabs(transform[8] * src->extents[2])); - dst->extents[1] = (vec_t)(fabs(transform[1] * src->extents[0]) - + fabs(transform[5] * src->extents[1]) - + fabs(transform[9] * src->extents[2])); - dst->extents[2] = (vec_t)(fabs(transform[2] * src->extents[0]) - + fabs(transform[6] * src->extents[1]) - + fabs(transform[10] * src->extents[2])); -} - void aabb_for_bbox(aabb_t *aabb, const bbox_t *bbox) { int i; @@ -332,54 +306,8 @@ void aabb_for_area(aabb_t *aabb, vec3_t area_tl, vec3_t area_br, int axis) aabb_extend_by_point(aabb, area_br); } -int aabb_oriented_intersect_plane(const aabb_t *aabb, const m4x4_t transform, const vec_t* plane) -{ - vec_t fDist, fIntersect; - - // calc distance of origin from plane - fDist = DotProduct(plane, aabb->origin) + plane[3]; - - // calc extents distance relative to plane normal - fIntersect = (vec_t)(fabs(aabb->extents[0] * DotProduct(plane, transform)) - + fabs(aabb->extents[1] * DotProduct(plane, transform+4)) - + fabs(aabb->extents[2] * DotProduct(plane, transform+8))); - // accept if origin is less than this distance - if (fabs(fDist) < fIntersect) return 1; // partially inside - else if (fDist < 0) return 2; // totally inside - return 0; // totally outside -} - -void aabb_corners(const aabb_t* aabb, vec3_t corners[8]) -{ - vec3_t min, max; - VectorSubtract(aabb->origin, aabb->extents, min); - VectorAdd(aabb->origin, aabb->extents, max); - VectorSet(corners[0], min[0], max[1], max[2]); - VectorSet(corners[1], max[0], max[1], max[2]); - VectorSet(corners[2], max[0], min[1], max[2]); - VectorSet(corners[3], min[0], min[1], max[2]); - VectorSet(corners[4], min[0], max[1], min[2]); - VectorSet(corners[5], max[0], max[1], min[2]); - VectorSet(corners[6], max[0], min[1], min[2]); - VectorSet(corners[7], min[0], min[1], min[2]); -} - - -void bbox_update_radius(bbox_t *bbox) -{ - bbox->radius = VectorLength(bbox->aabb.extents); -} - void aabb_for_transformed_aabb(aabb_t* dst, const aabb_t* src, const m4x4_t transform) { - if(src->extents[0] < 0 - || src->extents[1] < 0 - || src->extents[2] < 0) - { - aabb_clear(dst); - return; - } - VectorCopy(src->origin, dst->origin); m4x4_transform_point(transform, dst->origin); @@ -394,6 +322,7 @@ void aabb_for_transformed_aabb(aabb_t* dst, const aabb_t* src, const m4x4_t tran + fabs(transform[10] * src->extents[2])); } + void bbox_for_oriented_aabb(bbox_t *bbox, const aabb_t *aabb, const m4x4_t matrix, const vec3_t euler, const vec3_t scale) { double rad[3]; @@ -432,7 +361,7 @@ void bbox_for_oriented_aabb(bbox_t *bbox, const aabb_t *aabb, const m4x4_t matri bbox->axes[2][1] = (vec_t)(-B*C); bbox->axes[2][2] = (vec_t)(A*C); - bbox_update_radius(bbox); + aabb_update_radius(&bbox->aabb); } int bbox_intersect_plane(const bbox_t *bbox, const vec_t* plane) @@ -443,7 +372,7 @@ int bbox_intersect_plane(const bbox_t *bbox, const vec_t* plane) fDist = DotProduct(plane, bbox->aabb.origin) + plane[3]; // trivial accept/reject using bounding sphere - if (fabs(fDist) > bbox->radius) + if (fabs(fDist) > bbox->aabb.radius) { if (fDist < 0) return 2; // totally inside diff --git a/libs/mathlib/line.c b/libs/mathlib/line.c deleted file mode 100644 index 41b868fb..00000000 --- a/libs/mathlib/line.c +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mathlib.h" - -void line_construct_for_vec3(line_t *line, const vec3_t start, const vec3_t end) -{ - VectorMid(start, end, line->origin); - VectorSubtract(end, line->origin, line->extents); -} - -int line_test_plane(const line_t* line, const vec4_t plane) -{ - float fDist; - - // calc distance of origin from plane - fDist = DotProduct(plane, line->origin) + plane[3]; - - // accept if origin is less than or equal to this distance - if (fabs(fDist) < fabs(DotProduct(plane, line->extents))) return 1; // partially inside - else if (fDist < 0) return 2; // totally inside - return 0; // totally outside -} diff --git a/libs/mathlib/linear.c b/libs/mathlib/linear.c new file mode 100644 index 00000000..7414c135 --- /dev/null +++ b/libs/mathlib/linear.c @@ -0,0 +1,100 @@ +#ifndef __APPLE__ +#include +#else +#include +#endif +#include +#include + +#include "mathlib.h" + +#define TINY FLT_MIN + +void lubksb(float **a, int n, int *indx, float b[]) +// Solves the set of n linear equations A.X=B. Here a[n][n] is input, not as the matrix +// A but rather as its LU decomposition determined by the routine ludcmp. indx[n] is input +// as the permutation vector returned by ludcmp. b[n] is input as the right-hand side vector +// B, and returns with the solution vector X. a, n and indx are not modified by this routine +// and can be left in place for successive calls with different right-hand sides b. This routine takes +// into account the possibility that b will begin with many zero elements, so it is efficient for use +// in matrix inversion +{ + int i,ii=-1,ip,j; + float sum; + + for (i=0;i=0) + for (j=ii;j=0;i--) { + sum=b[i]; + for (j=i+1;j big) big=temp; + if (big == 0.0) return 1; + vv[i]=1.0f/big; + } + for (j=0;j= big) { + big=dum; + imax=i; + } + } + if (j != imax) { + for (k=0;k 0.005) /* Gimbal lock? */ - { - /* No, so get Z-axis angle */ - euler[2] = (vec_t)RAD2DEG(atan2(matrix[1] / ca, matrix[0]/ ca)); - - /* Get X-axis angle */ - euler[0] = (vec_t)RAD2DEG(atan2(matrix[6] / ca, matrix[10] / ca)); - } - else /* Gimbal lock has occurred */ - { - /* Set Z-axis angle to zero */ - euler[2] = 0; - - /* And calculate X-axis angle */ - euler[0] = (vec_t)RAD2DEG(atan2(-matrix[9], matrix[5])); - } - break; - case eYZX: - /* NOT IMPLEMENTED */ - break; - case eZXY: - /* NOT IMPLEMENTED */ - break; - case eXZY: - /* NOT IMPLEMENTED */ - break; - case eYXZ: - a = asin(matrix[6]); - ca = cos(a); - euler[0] = (vec_t)RAD2DEG(a); /* Calculate X-axis angle */ - - if (fabs(ca) > 0.005) /* Gimbal lock? */ - { - /* No, so get Y-axis angle */ - euler[1] = (vec_t)RAD2DEG(atan2(-matrix[2] / ca, matrix[10]/ ca)); - - /* Get Z-axis angle */ - euler[2] = (vec_t)RAD2DEG(atan2(-matrix[4] / ca, matrix[5] / ca)); - } - else /* Gimbal lock has occurred */ - { - /* Set Z-axis angle to zero */ - euler[2] = 0; - - /* And calculate Y-axis angle */ - euler[1] = (vec_t)RAD2DEG(atan2(matrix[8], matrix[0])); - } - break; - case eZYX: - a = asin(matrix[8]); - ca = cos(a); - euler[1] = (vec_t)RAD2DEG(a); /* Calculate Y-axis angle */ - - if (fabs(ca) > 0.005) /* Gimbal lock? */ - { - /* No, so get X-axis angle */ - euler[0] = (vec_t)RAD2DEG(atan2(-matrix[9] / ca, matrix[10]/ ca)); - - /* Get Z-axis angle */ - euler[2] = (vec_t)RAD2DEG(atan2(-matrix[4] / ca, matrix[0] / ca)); - } - else /* Gimbal lock has occurred */ - { - /* Set X-axis angle to zero */ - euler[0] = 0; - - /* And calculate Z-axis angle */ - euler[2] = (vec_t)RAD2DEG(atan2(matrix[1], matrix[5])); - } - break; - } - - /* return only positive angles in [0,360] */ - if (euler[0] < 0) euler[0] += 360; - if (euler[1] < 0) euler[1] += 360; - if (euler[2] < 0) euler[2] += 360; -} - -void m4x4_get_scale_vec3(const m4x4_t matrix, vec3_t scale) -{ - scale[0] = VectorLength(matrix+0); - scale[1] = VectorLength(matrix+4); - scale[2] = VectorLength(matrix+8); -} - -void m4x4_get_transform_vec3(const m4x4_t matrix, vec3_t translation, vec3_t euler, eulerOrder_t order, vec3_t scale) -{ - m4x4_t normalised; - m4x4_assign(normalised, matrix); - scale[0] = VectorNormalize(normalised+0, normalised+0); - scale[1] = VectorNormalize(normalised+4, normalised+4); - scale[2] = VectorNormalize(normalised+8, normalised+8); - if(m4x4_handedness(normalised) == eLeftHanded) - { - VectorNegate(normalised+0, normalised+0); - VectorNegate(normalised+4, normalised+4); - VectorNegate(normalised+8, normalised+8); - scale[0] = -scale[0]; - scale[1] = -scale[1]; - scale[2] = -scale[2]; - } - m4x4_get_rotation_vec3(normalised, euler, order); - m4x4_get_translation_vec3(matrix, translation); + m4x4_rotation_for_quat(matrix, rotation); } void m4x4_translate_by_vec3(m4x4_t matrix, const vec3_t translation) @@ -535,7 +328,7 @@ void m4x4_rotate_by_quat(m4x4_t matrix, const vec4_t rotation) m4x4_multiply_by_m4x4(matrix, temp); } -void m4x4_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, double angle) +void m4x4_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, vec_t angle) { m4x4_t temp; m4x4_rotation_for_axisangle(temp, axis, angle); @@ -552,7 +345,7 @@ void m4x4_transform_by_vec3(m4x4_t matrix, const vec3_t translation, const vec3_ void m4x4_pivoted_rotate_by_vec3(m4x4_t matrix, const vec3_t euler, eulerOrder_t order, const vec3_t pivotpoint) { vec3_t vec3_temp; - VectorNegate(pivotpoint, vec3_temp); + VectorNegative(pivotpoint, vec3_temp); m4x4_translate_by_vec3(matrix, pivotpoint); m4x4_rotate_by_vec3(matrix, euler, order); @@ -562,7 +355,7 @@ void m4x4_pivoted_rotate_by_vec3(m4x4_t matrix, const vec3_t euler, eulerOrder_t void m4x4_pivoted_scale_by_vec3(m4x4_t matrix, const vec3_t scale, const vec3_t pivotpoint) { vec3_t vec3_temp; - VectorNegate(pivotpoint, vec3_temp); + VectorNegative(pivotpoint, vec3_temp); m4x4_translate_by_vec3(matrix, pivotpoint); m4x4_scale_by_vec3(matrix, scale); @@ -577,42 +370,31 @@ void m4x4_pivoted_transform_by_vec3(m4x4_t matrix, const vec3_t translation, con m4x4_translate_by_vec3(matrix, vec3_temp); m4x4_rotate_by_vec3(matrix, euler, order); m4x4_scale_by_vec3(matrix, scale); - VectorNegate(pivotpoint, vec3_temp); - m4x4_translate_by_vec3(matrix, vec3_temp); -} - -void m4x4_pivoted_transform_by_rotation(m4x4_t matrix, const vec3_t translation, const m4x4_t rotation, const vec3_t scale, const vec3_t pivotpoint) -{ - vec3_t vec3_temp; - - VectorAdd(pivotpoint, translation, vec3_temp); - m4x4_translate_by_vec3(matrix, vec3_temp); - m4x4_multiply_by_m4x4(matrix, rotation); - m4x4_scale_by_vec3(matrix, scale); - VectorNegate(pivotpoint, vec3_temp); + VectorNegative(pivotpoint, vec3_temp); m4x4_translate_by_vec3(matrix, vec3_temp); } void m4x4_pivoted_rotate_by_quat(m4x4_t matrix, const vec4_t rotation, const vec3_t pivotpoint) { vec3_t vec3_temp; - VectorNegate(pivotpoint, vec3_temp); + VectorNegative(pivotpoint, vec3_temp); m4x4_translate_by_vec3(matrix, pivotpoint); m4x4_rotate_by_quat(matrix, rotation); m4x4_translate_by_vec3(matrix, vec3_temp); } -void m4x4_pivoted_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, double angle, const vec3_t pivotpoint) +void m4x4_pivoted_rotate_by_axisangle(m4x4_t matrix, const vec3_t axis, vec_t angle, const vec3_t pivotpoint) { vec3_t vec3_temp; - VectorNegate(pivotpoint, vec3_temp); + VectorNegative(pivotpoint, vec3_temp); m4x4_translate_by_vec3(matrix, pivotpoint); m4x4_rotate_by_axisangle(matrix, axis, angle); m4x4_translate_by_vec3(matrix, vec3_temp); } + /* A = A.B @@ -784,61 +566,22 @@ void m4x4_premultiply_by_m4x4(m4x4_t dst, const m4x4_t src) #endif } -void m4x4_orthogonal_multiply_by_m4x4(m4x4_t dst, const m4x4_t src) -{ - vec_t dst0, dst1, dst2, dst3; - - dst0 = src[0] * dst[0] + src[1] * dst[4] + src[2] * dst[8]; - dst1 = src[4] * dst[0] + src[5] * dst[4] + src[6] * dst[8]; - dst2 = src[8] * dst[0] + src[9] * dst[4] + src[10]* dst[8]; - dst3 = src[12]* dst[0] + src[13]* dst[4] + src[14]* dst[8] + dst[12]; - dst[0] = dst0; dst[4] = dst1; dst[8] = dst2; dst[12]= dst3; - - dst0 = src[0] * dst[1] + src[1] * dst[5] + src[2] * dst[9]; - dst1 = src[4] * dst[1] + src[5] * dst[5] + src[6] * dst[9]; - dst2 = src[8] * dst[1] + src[9] * dst[5] + src[10]* dst[9]; - dst3 = src[12]* dst[1] + src[13]* dst[5] + src[14]* dst[9] + dst[13]; - dst[1] = dst0; dst[5] = dst1; dst[9] = dst2; dst[13]= dst3; - - dst0 = src[0] * dst[2] + src[1] * dst[6] + src[2] * dst[10]; - dst1 = src[4] * dst[2] + src[5] * dst[6] + src[6] * dst[10]; - dst2 = src[8] * dst[2] + src[9] * dst[6] + src[10]* dst[10]; - dst3 = src[12]* dst[2] + src[13]* dst[6] + src[14]* dst[10]+ dst[14]; - dst[2] = dst0; dst[6] = dst1; dst[10]= dst2; dst[14]= dst3; -} - -void m4x4_orthogonal_premultiply_by_m4x4(m4x4_t dst, const m4x4_t src) -{ - vec_t dst0, dst1, dst2; - - dst0 = dst[0] * src[0] + dst[1] * src[4] + dst[2] * src[8]; - dst1 = dst[0] * src[1] + dst[1] * src[5] + dst[2] * src[9]; - dst2 = dst[0] * src[2] + dst[1] * src[6] + dst[2] * src[10]; - dst[0] = dst0; dst[1] = dst1; dst[2] = dst2; - - dst0 = dst[4] * src[0] + dst[5] * src[4] + dst[6] * src[8]; - dst1 = dst[4] * src[1] + dst[5] * src[5] + dst[6] * src[9]; - dst2 = dst[4] * src[2] + dst[5] * src[6] + dst[6] * src[10]; - dst[4] = dst0; dst[5] = dst1; dst[6] = dst2; - - dst0 = dst[8] * src[0] + dst[9] * src[4] + dst[10]* src[8]; - dst1 = dst[8] * src[1] + dst[9] * src[5] + dst[10]* src[9]; - dst2 = dst[8] * src[2] + dst[9] * src[6] + dst[10]* src[10]; - dst[8] = dst0; dst[9] = dst1; dst[10] = dst2; - - dst0 = dst[12]* src[0] + dst[13]* src[4] + dst[14]* src[8] + dst[15]* src[12]; - dst1 = dst[12]* src[1] + dst[13]* src[5] + dst[14]* src[9] + dst[15]* src[13]; - dst2 = dst[12]* src[2] + dst[13]* src[6] + dst[14]* src[10]+ dst[15]* src[14]; - dst[12] = dst0; dst[13] = dst1; dst[14] = dst2; -} - void m4x4_transform_point(const m4x4_t matrix, vec3_t point) { float out1, out2, out3; - out1 = matrix[0] * point[0] + matrix[4] * point[1] + matrix[8] * point[2] + matrix[12]; - out2 = matrix[1] * point[0] + matrix[5] * point[1] + matrix[9] * point[2] + matrix[13]; - out3 = matrix[2] * point[0] + matrix[6] * point[1] + matrix[10] * point[2] + matrix[14]; + out1 = matrix[0] * point[0]; + out2 = matrix[1] * point[0]; + out3 = matrix[2] * point[0]; + out1 += matrix[4] * point[1]; + out2 += matrix[5] * point[1]; + out3 += matrix[6] * point[1]; + out1 += matrix[8] * point[2]; + out2 += matrix[9] * point[2]; + out3 += matrix[10] * point[2]; + out1 += matrix[12]; + out2 += matrix[13]; + out3 += matrix[14]; point[0] = out1; point[1] = out2; @@ -849,9 +592,15 @@ void m4x4_transform_normal(const m4x4_t matrix, vec3_t normal) { float out1, out2, out3; - out1 = matrix[0] * normal[0] + matrix[4] * normal[1] + matrix[8] * normal[2]; - out2 = matrix[1] * normal[0] + matrix[5] * normal[1] + matrix[9] * normal[2]; - out3 = matrix[2] * normal[0] + matrix[6] * normal[1] + matrix[10] * normal[2]; + out1 = matrix[0] * normal[0]; + out2 = matrix[1] * normal[0]; + out3 = matrix[2] * normal[0]; + out1 += matrix[4] * normal[1]; + out2 += matrix[5] * normal[1]; + out3 += matrix[6] * normal[1]; + out1 += matrix[8] * normal[2]; + out2 += matrix[9] * normal[2]; + out3 += matrix[10] * normal[2]; normal[0] = out1; normal[1] = out2; @@ -862,10 +611,22 @@ void m4x4_transform_vec4(const m4x4_t matrix, vec4_t vector) { float out1, out2, out3, out4; - out1 = matrix[0] * vector[0] + matrix[4] * vector[1] + matrix[8] * vector[2] + matrix[12] * vector[3]; - out2 = matrix[1] * vector[0] + matrix[5] * vector[1] + matrix[9] * vector[2] + matrix[13] * vector[3]; - out3 = matrix[2] * vector[0] + matrix[6] * vector[1] + matrix[10] * vector[2] + matrix[14] * vector[3]; - out4 = matrix[3] * vector[0] + matrix[7] * vector[1] + matrix[11] * vector[2] + matrix[15] * vector[3]; + out1 = matrix[0] * vector[0]; + out2 = matrix[1] * vector[0]; + out3 = matrix[2] * vector[0]; + out4 = matrix[3] * vector[0]; + out1 += matrix[4] * vector[1]; + out2 += matrix[5] * vector[1]; + out3 += matrix[6] * vector[1]; + out4 += matrix[7] * vector[1]; + out1 += matrix[8] * vector[2]; + out2 += matrix[9] * vector[2]; + out3 += matrix[10] * vector[2]; + out4 += matrix[11] * vector[2]; + out1 += matrix[12] * vector[3]; + out2 += matrix[13] * vector[3]; + out3 += matrix[14] * vector[3]; + out4 += matrix[15] * vector[3]; vector[0] = out1; vector[1] = out2; @@ -873,523 +634,6 @@ void m4x4_transform_vec4(const m4x4_t matrix, vec4_t vector) vector[3] = out4; } -#define CLIP_X_LT_W(p) ((p)[0] < (p)[3]) -#define CLIP_X_GT_W(p) ((p)[0] > -(p)[3]) -#define CLIP_Y_LT_W(p) ((p)[1] < (p)[3]) -#define CLIP_Y_GT_W(p) ((p)[1] > -(p)[3]) -#define CLIP_Z_LT_W(p) ((p)[2] < (p)[3]) -#define CLIP_Z_GT_W(p) ((p)[2] > -(p)[3]) - -clipmask_t homogenous_clip_point(const vec4_t clipped) -{ - clipmask_t result = CLIP_FAIL; - if(CLIP_X_LT_W(clipped)) result &= ~CLIP_LT_X; // X < W - if(CLIP_X_GT_W(clipped)) result &= ~CLIP_GT_X; // X > -W - if(CLIP_Y_LT_W(clipped)) result &= ~CLIP_LT_Y; // Y < W - if(CLIP_Y_GT_W(clipped)) result &= ~CLIP_GT_Y; // Y > -W - if(CLIP_Z_LT_W(clipped)) result &= ~CLIP_LT_Z; // Z < W - if(CLIP_Z_GT_W(clipped)) result &= ~CLIP_GT_Z; // Z > -W - return result; -} - -clipmask_t m4x4_clip_point(const m4x4_t matrix, const vec3_t point, vec4_t clipped) -{ - clipped[0] = point[0]; - clipped[1] = point[1]; - clipped[2] = point[2]; - clipped[3] = 1; - m4x4_transform_vec4(matrix, clipped); - return homogenous_clip_point(clipped); -} - - -unsigned int homogenous_clip_triangle(vec4_t clipped[9]) -{ - vec4_t buffer[9]; - unsigned int rcount = 3; - unsigned int wcount = 0; - vec_t const* rptr = clipped[0]; - vec_t* wptr = buffer[0]; - const vec_t* p0; - const vec_t* p1; - unsigned char b0, b1; - - unsigned int i; - double scale; - - p0 = rptr; - b0 = CLIP_X_LT_W(p0); - for(i=0; i= 0.0) pos += det; else neg += det; - - det = src[1] * src[6] * src[8]; - if (det >= 0.0) pos += det; else neg += det; - - det = src[2] * src[4] * src[9]; - if (det >= 0.0) pos += det; else neg += det; - - det = -src[2] * src[5] * src[8]; - if (det >= 0.0) pos += det; else neg += det; - - det = -src[1] * src[4] * src[10]; - if (det >= 0.0) pos += det; else neg += det; - - det = -src[0] * src[6] * src[9]; - if (det >= 0.0) pos += det; else neg += det; - - det = pos + neg; -#elif 0 - float det - = (src[0] * src[5] * src[10]) - + (src[1] * src[6] * src[8]) - + (src[2] * src[4] * src[9]) - - (src[2] * src[5] * src[8]) - - (src[1] * src[4] * src[10]) - - (src[0] * src[6] * src[9]); -#else - float det - = src[0] * ( src[5]*src[10] - src[9]*src[6] ) - - src[1] * ( src[4]*src[10] - src[8]*src[6] ) - + src[2] * ( src[4]*src[9] - src[8]*src[5] ); - -#endif - - if (det*det < 1e-25) - return 1; - - det = 1.0f / det; - matrix[0] = ( (src[5]*src[10]- src[6]*src[9] )*det); - matrix[1] = (- (src[1]*src[10]- src[2]*src[9] )*det); - matrix[2] = ( (src[1]*src[6] - src[2]*src[5] )*det); - matrix[4] = (- (src[4]*src[10]- src[6]*src[8] )*det); - matrix[5] = ( (src[0]*src[10]- src[2]*src[8] )*det); - matrix[6] = (- (src[0]*src[6] - src[2]*src[4] )*det); - matrix[8] = ( (src[4]*src[9] - src[5]*src[8] )*det); - matrix[9] = (- (src[0]*src[9] - src[1]*src[8] )*det); - matrix[10]= ( (src[0]*src[5] - src[1]*src[4] )*det); - } - - /* Do the translation part */ - matrix[12] = - (src[12] * matrix[0] + - src[13] * matrix[4] + - src[14] * matrix[8]); - matrix[13] = - (src[12] * matrix[1] + - src[13] * matrix[5] + - src[14] * matrix[9]); - matrix[14] = - (src[12] * matrix[2] + - src[13] * matrix[6] + - src[14] * matrix[10]); - - return 0; -} - -void quat_identity(vec4_t quat) -{ - quat[0] = quat[1] = quat[2] = 0; - quat[3] = 1; -} - -void quat_multiply_by_quat(vec4_t quat, const vec4_t other) -{ - const vec_t x = quat[3]*other[0] + quat[0]*other[3] + quat[1]*other[2] - quat[2]*other[1]; - const vec_t y = quat[3]*other[1] + quat[1]*other[3] + quat[2]*other[0] - quat[0]*other[2]; - const vec_t z = quat[3]*other[2] + quat[2]*other[3] + quat[0]*other[1] - quat[1]*other[0]; - const vec_t w = quat[3]*other[3] - quat[0]*other[0] - quat[1]*other[1] - quat[2]*other[2]; - quat[0] = x; - quat[1] = y; - quat[2] = z; - quat[3] = w; -} - -void quat_conjugate(vec4_t quat) -{ - VectorNegate(quat, quat); -} - -//! quaternion from two unit vectors -void quat_for_unit_vectors(vec4_t quat, const vec3_t from, const vec3_t to) -{ - CrossProduct(from, to, quat); - quat[3] = DotProduct(from, to); -} - -void quat_normalise(vec4_t quat) -{ - const vec_t n = 1 / ( quat[0] * quat[0] + quat[1] * quat[1] + quat[2] * quat[2] + quat[3] * quat[3] ); - quat[0] *= n; - quat[1] *= n; - quat[2] *= n; - quat[3] *= n; -} - -void quat_for_axisangle(vec4_t quat, const vec3_t axis, double angle) -{ - angle *= 0.5; - - quat[3] = (float)sin(angle); - - quat[0] = axis[0] * quat[3]; - quat[1] = axis[1] * quat[3]; - quat[2] = axis[2] * quat[3]; - quat[3] = (float)cos(angle); -} - -void m3x3_multiply_by_m3x3(m3x3_t matrix, const m3x3_t matrix_src) -{ - float *pDest = matrix; - float out1, out2, out3; - int i; - - for(i=0;i<3;i++) - { - out1 = matrix_src[0] * pDest[0]; - out1 += matrix_src[1] * pDest[3]; - out1 += matrix_src[2] * pDest[6]; - out2 = matrix_src[3] * pDest[0]; - out2 += matrix_src[4] * pDest[3]; - out2 += matrix_src[5] * pDest[6]; - out3 = matrix_src[6] * pDest[0]; - out3 += matrix_src[7] * pDest[3]; - out3 += matrix_src[8] * pDest[6]; - - pDest[0] = out1; - pDest[3] = out2; - pDest[6] = out3; - - pDest++; - } -} - -void m3x3_transform_vec3(const m3x3_t matrix, vec3_t vector) -{ - float out1, out2, out3; - - out1 = matrix[0] * vector[0]; - out1 += matrix[3] * vector[1]; - out1 += matrix[6] * vector[2]; - out2 = matrix[1] * vector[0]; - out2 += matrix[4] * vector[1]; - out2 += matrix[7] * vector[2]; - out3 = matrix[2] * vector[0]; - out3 += matrix[5] * vector[1]; - out3 += matrix[8] * vector[2]; - - vector[0] = out1; - vector[1] = out2; - vector[2] = out3; } float m3_det( m3x3_t mat ) @@ -1593,15 +696,16 @@ float m3_det( m3x3_t mat ) return( det ); } -int m3_inverse( m3x3_t mr, m3x3_t ma ) +/* +void m3_inverse( m3x3_t mr, m3x3_t ma ) { float det = m3_det( ma ); - - if (det == 0 ) + + if ( fabs( det ) < 0.0005 ) { - return 1; + m3_identity( ma ); + return; } - mr[0] = ma[4]*ma[8] - ma[5]*ma[7] / det; mr[1] = -( ma[1]*ma[8] - ma[7]*ma[2] ) / det; @@ -1614,9 +718,8 @@ int m3_inverse( m3x3_t mr, m3x3_t ma ) mr[6] = ma[3]*ma[7] - ma[6]*ma[4] / det; mr[7] = -( ma[0]*ma[7] - ma[6]*ma[1] ) / det; mr[8] = ma[0]*ma[4] - ma[1]*ma[3] / det; - - return 0; } +*/ void m4_submat( m4x4_t mr, m3x3_t mb, int i, int j ) { @@ -1668,12 +771,10 @@ int m4x4_invert(m4x4_t matrix) int i, j, sign; m4x4_t m4x4_temp; -#if 0 - if ( fabs( mdet ) < 0.0000000001 ) + if ( fabs( mdet ) < 0.0000000001 ) //% 0.0005 return 1; -#endif - m4x4_assign(m4x4_temp, matrix); + memcpy(m4x4_temp, matrix, sizeof(m4x4_t)); for ( i = 0; i < 4; i++ ) for ( j = 0; j < 4; j++ ) @@ -1682,196 +783,8 @@ int m4x4_invert(m4x4_t matrix) m4_submat( m4x4_temp, mtemp, i, j ); - matrix[i+j*4] = ( m3_det( mtemp ) * sign ) / mdet; /* FIXME: try using * inverse det and see if speed/accuracy are good enough */ + matrix[i+j*4] = ( m3_det( mtemp ) * sign ) / mdet; } return 0; } -#if 0 -void m4x4_solve_ge(m4x4_t matrix, vec4_t x) -{ - int indx[4]; - int c,r; - int i; - int best; - float scale[4]; - float f, pivot; - float aug[4]; - float recip, ratio; - float* p; - - for(r=0; r<4; r++) - { - aug[r] = 0; - indx[r] = r; - } - - for (r=0; r<4; r++) - { - scale[r] = 0; - for (c=0; c<4; c++, p++) - { - if (fabs(*p) > scale[r]) - { - scale[r] = (float)fabs(*p); - } - } - } - - for (c=0; c<3; c++) - { - pivot = 0; - for (r=c; r<4; r++) - { - f = (float)fabs(matrix[(indx[r]<<2)+c]) / scale[indx[r]]; - if (f > pivot) - { - pivot = f; - best = r; - } - } - - i = indx[c]; - indx[c] = indx[best]; - indx[best] = i; - - recip = 1 / matrix[(indx[c]<<2)+c]; - - for (r=c+1; r<4; r++) - { - p = matrix + (indx[r]<<2); - ratio = p[c] * recip; - - for (i=c+1; i<4; i++) - p[i] -= ratio * matrix[(indx[c]<<2)+i]; - aug[indx[r]] -= ratio * aug[indx[c]]; - } - } - - x[indx[3]] = aug[indx[3]] / matrix[(indx[3]<<2)+3]; - for(r=2; r>=0; r--) - { - f = aug[indx[r]]; - p = matrix + (indx[r]<<2); - recip = 1 / p[r]; - for(c=(r+1); c<4; c++) - { - f -= (p[c] * x[indx[c]]); - } - x[indx[r]] = f * recip; - } -} -#endif - -#define N 3 - -int matrix_solve_ge(vec_t* matrix, vec_t* aug, vec3_t x) -{ - int indx[N]; - int c,r; - int i; - int best; - float scale[N]; - float f, pivot; - float ratio; - float* p; - - for(r=0; r scale[r]) - { - scale[r] = (float)fabs(*p); - } - } - } - - for (c=0; c pivot) - { - pivot = f; - best = r; - } - } - - if(best == -1) return 1; - - i = indx[c]; - indx[c] = indx[best]; - indx[best] = i; - - for (r=c+1; r=0; r--) - { - f = aug[indx[r]]; - p = matrix + (indx[r]*N); - for(c=(r+1); c=0;i--) - { - temp = b[i]; - for(j=(i+1);j -const vec3_t vec3_origin = {0.0f,0.0f,0.0f}; - -const vec3_t g_vec3_axis_x = { 1, 0, 0, }; -const vec3_t g_vec3_axis_y = { 0, 1, 0, }; -const vec3_t g_vec3_axis_z = { 0, 0, 1, }; +vec3_t vec3_origin = {0.0f,0.0f,0.0f}; /* ================ @@ -54,7 +50,7 @@ void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up) CrossProduct (right, forward, up); } -vec_t VectorLength(const vec3_t v) +vec_t VectorLength(vec3_t v) { int i; float length; @@ -67,7 +63,7 @@ vec_t VectorLength(const vec3_t v) return length; } -qboolean VectorCompare (const vec3_t v1, const vec3_t v2) +qboolean VectorCompare (vec3_t v1, vec3_t v2) { int i; @@ -78,6 +74,18 @@ qboolean VectorCompare (const vec3_t v1, const vec3_t v2) return qtrue; } +/* +// FIXME TTimo this implementation has to be particular to radiant +// through another name I'd say +vec_t Q_rint (vec_t in) +{ + if (g_PrefsDlg.m_bNoClamp) + return in; + else + return (float)floor (in + 0.5); +} +*/ + void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc ) { vc[0] = va[0] + scale*vb[0]; @@ -221,7 +229,7 @@ void VectorSnap(vec3_t v) int i; for (i = 0; i < 3; i++) { - v[i] = (vec_t)FLOAT_TO_INTEGER(v[i]); + v[i] = (vec_t)floor (v[i] + 0.5); } } @@ -230,7 +238,7 @@ void VectorISnap(vec3_t point, int snap) int i; for (i = 0 ;i < 3 ; i++) { - point[i] = (vec_t)FLOAT_SNAP(point[i], snap); + point[i] = (vec_t)floor (point[i] / snap + 0.5) * snap; } } @@ -239,7 +247,7 @@ void VectorFSnap(vec3_t point, float snap) int i; for (i = 0 ;i < 3 ; i++) { - point[i] = (vec_t)FLOAT_SNAP(point[i], snap); + point[i] = (vec_t)floor (point[i] / snap + 0.5) * snap; } } @@ -290,19 +298,26 @@ void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs) } } +#define PITCH 0 // up / down +#define YAW 1 // left / right +#define ROLL 2 // fall over +#ifndef M_PI +#define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h +#endif + void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) { float angle; static float sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs - angle = angles[YAW] * (Q_PI*2.0f / 360.0f); + angle = angles[YAW] * (M_PI*2.0f / 360.0f); sy = (vec_t)sin(angle); cy = (vec_t)cos(angle); - angle = angles[PITCH] * (Q_PI*2.0f / 360.0f); + angle = angles[PITCH] * (M_PI*2.0f / 360.0f); sp = (vec_t)sin(angle); cp = (vec_t)cos(angle); - angle = angles[ROLL] * (Q_PI*2.0f / 360.0f); + angle = angles[ROLL] * (M_PI*2.0f / 360.0f); sr = (vec_t)sin(angle); cr = (vec_t)cos(angle); @@ -345,14 +360,14 @@ void VectorToAngles( vec3_t vec, vec3_t angles ) } else { - yaw = (vec_t)atan2( vec[ 1 ], vec[ 0 ] ) * 180 / Q_PI; + yaw = (vec_t)atan2( vec[ 1 ], vec[ 0 ] ) * 180 / M_PI; if ( yaw < 0 ) { yaw += 360; } forward = ( float )sqrt( vec[ 0 ] * vec[ 0 ] + vec[ 1 ] * vec[ 1 ] ); - pitch = (vec_t)atan2( vec[ 2 ], forward ) * 180 / Q_PI; + pitch = (vec_t)atan2( vec[ 2 ], forward ) * 180 / M_PI; if ( pitch < 0 ) { pitch += 360; @@ -563,7 +578,7 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, memset( zrot, 0, sizeof( zrot ) ); zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F; - rad = (float)DEG2RAD( degrees ); + rad = DEG2RAD( degrees ); zrot[0][0] = (vec_t)cos( rad ); zrot[0][1] = (vec_t)sin( rad ); zrot[1][0] = (vec_t)-sin( rad ); diff --git a/libs/mathlib/mathlib.vcproj b/libs/mathlib/mathlib.vcproj index 71b708dd..4dfa2c0e 100644 --- a/libs/mathlib/mathlib.vcproj +++ b/libs/mathlib/mathlib.vcproj @@ -1,320 +1,65 @@ - - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + - - + + - + \ No newline at end of file diff --git a/libs/mathlib/ray.c b/libs/mathlib/ray.c index bea7c5c5..cfe4bfd4 100644 --- a/libs/mathlib/ray.c +++ b/libs/mathlib/ray.c @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -20,7 +20,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mathlib.h" -#include +/*! for memcpy */ +#include vec3_t identity = { 0,0,0 }; @@ -45,13 +46,13 @@ vec_t ray_intersect_point(const ray_t *ray, const vec3_t point, vec_t epsilon, v VectorSubtract(point, ray->origin, displacement); // calc length of displacement vector along ray direction depth = DotProduct(displacement, ray->direction); - if(depth < 0.0f) return (vec_t)FLT_MAX; + if(depth < 0.0f) return (vec_t)VEC_MAX; // calc position of closest point on ray to test point VectorMA (ray->origin, depth, ray->direction, displacement); // calc displacement of test point from closest point VectorSubtract(point, displacement, displacement); // calc length of displacement, subtract depth-dependant epsilon - if (VectorLength(displacement) - (epsilon + (depth * divergence)) > 0.0f) return (vec_t)FLT_MAX; + if (VectorLength(displacement) - (epsilon + (depth * divergence)) > 0.0f) return (vec_t)VEC_MAX; return depth; } @@ -64,7 +65,7 @@ vec_t ray_intersect_triangle(const ray_t *ray, qboolean bCullBack, const vec3_t float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; float det,inv_det; float u, v; - vec_t depth = (vec_t)FLT_MAX; + vec_t depth = (vec_t)VEC_MAX; /* find vectors for two edges sharing vert0 */ VectorSubtract(vert1, vert0, edge1); @@ -132,9 +133,3 @@ vec_t ray_intersect_triangle(const ray_t *ray, qboolean bCullBack, const vec3_t } return depth; } - -vec_t ray_intersect_plane(const ray_t* ray, const vec3_t normal, vec_t dist) -{ - return -(DotProduct(normal, ray->origin) - dist) / DotProduct(ray->direction, normal); -} - diff --git a/libs/md5lib.h b/libs/md5lib.h index f0aca115..d56f0263 100644 --- a/libs/md5lib.h +++ b/libs/md5lib.h @@ -21,7 +21,7 @@ ghost@aladdin.com */ -/* $Id: md5lib.h,v 1.1.2.1 2003/07/19 23:25:50 spog Exp $ */ +/* $Id: md5lib.h,v 1.1 2003/07/18 04:24:39 ydnar Exp $ */ /* Independent implementation of MD5 (RFC 1321). diff --git a/libs/md5lib/Conscript b/libs/md5lib/Conscript new file mode 100644 index 00000000..63db5316 --- /dev/null +++ b/libs/md5lib/Conscript @@ -0,0 +1,11 @@ +Import qw( BASE_CFLAGS CC ); + +$env = new cons +( + ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, + CC => $CC, + CPPPATH => "#libs", + CFLAGS => $BASE_CFLAGS +); +Library $env 'md5lib', 'md5lib.c'; +Install $env '..', 'md5lib.a'; diff --git a/libs/md5lib/md5lib.vcproj b/libs/md5lib/md5lib.vcproj index e7b6e474..e1e603f4 100644 --- a/libs/md5lib/md5lib.vcproj +++ b/libs/md5lib/md5lib.vcproj @@ -1,140 +1,57 @@ - - + - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - + + - + \ No newline at end of file diff --git a/libs/memory/allocator.cpp b/libs/memory/allocator.cpp deleted file mode 100644 index 17fbdaca..00000000 --- a/libs/memory/allocator.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "memory/allocator.h" - -#include - -template -struct Vector -{ - typedef std::vector > Type; -}; - -namespace -{ - class Bleh - { - int* m_blah; - public: - Bleh(int* blah) : m_blah(blah) - { - } - ~Bleh() - { - *m_blah = 15; - } - }; - - void TestAllocator() - { - Vector::Type test; - - int i = 0; - test.push_back(Bleh(&i)); - } - - void TestNewDelete() - { - { - NamedAllocator allocator("test"); - int* p = NamedNew::type(allocator).scalar(); - //new int(); - NamedDelete::type(allocator).scalar(p); - } - - { - int* p = New().scalar(3); - Delete().scalar(p); - } - - { - int* p = New().scalar(int(15.9)); - Delete().scalar(p); - } - - { - int* p = New().vector(15); - // new int[15] - Delete().vector(p, 15); - } - } -} \ No newline at end of file diff --git a/libs/memory/allocator.h b/libs/memory/allocator.h deleted file mode 100644 index c513d708..00000000 --- a/libs/memory/allocator.h +++ /dev/null @@ -1,336 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MEMORY_ALLOCATOR_H) -#define INCLUDED_MEMORY_ALLOCATOR_H - -#include - -#if 0 - -#define DefaultAllocator std::allocator - -#else - -/// \brief An allocator that uses c++ new/delete. -/// Compliant with the std::allocator interface. -template -class DefaultAllocator -{ -public: - - typedef Type value_type; - typedef value_type* pointer; - typedef const Type* const_pointer; - typedef Type& reference; - typedef const Type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - - template - struct rebind - { - typedef DefaultAllocator other; - }; - - DefaultAllocator() - { - } - DefaultAllocator(const DefaultAllocator&) - { - } - template DefaultAllocator(const DefaultAllocator&) - { - } - ~DefaultAllocator() - { - } - - pointer address(reference instance) const - { - return &instance; - } - const_pointer address(const_reference instance) const - { - return &instance; - } - Type* allocate(size_type size, const void* = 0) - { - return static_cast(::operator new(size * sizeof(Type))); - } - void deallocate(pointer p, size_type) - { - ::operator delete(p); - } - size_type max_size() const - { - return std::size_t(-1) / sizeof (Type); - } - void construct(pointer p, const Type& value) - { - new(p) Type(value); - } - void destroy(pointer p) - { - p->~Type(); - } -}; - -template -inline bool operator==(const DefaultAllocator&, const DefaultAllocator&) -{ - return true; -} -template -inline bool operator==(const DefaultAllocator&, const OtherAllocator&) -{ - return false; -} - -#endif - - -template -class NamedAllocator : public DefaultAllocator -{ - typedef DefaultAllocator allocator_type; - - const char* m_name; -public: - - typedef Type value_type; - typedef value_type* pointer; - typedef const Type* const_pointer; - typedef Type& reference; - typedef const Type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - - template - struct rebind - { - typedef NamedAllocator other; - }; - - explicit NamedAllocator(const char* name) : m_name(name) - { - } - NamedAllocator(const NamedAllocator& other) : m_name(other.m_name) - { - } - template NamedAllocator(const NamedAllocator& other) : m_name(other.m_name) - { - } - ~NamedAllocator() - { - } - - pointer address(reference instance) const - { - return allocator_type::address(instance); - } - const_pointer address(const_reference instance) const - { - return allocator_type::address(instance); - } - Type* allocate(size_type size, const void* = 0) - { - return allocator_type::allocate(size); - } - void deallocate(pointer p, size_type size) - { - allocator_type::deallocate(p, size); - } - size_type max_size() const - { - return allocator_type::max_size(); - } - void construct(pointer p, const Type& value) - { - allocator_type::construct(p, value); - } - void destroy(pointer p) - { - allocator_type::destroy(p); - } - - template - bool operator==(const NamedAllocator& other) - { - return true; - } - - // returns true if the allocators are not interchangeable - template - bool operator!=(const NamedAllocator& other) - { - return false; - } -}; - - - -#include -#include "generic/object.h" - - - -template -class DefaultConstruct -{ -public: - void operator()(Type& t) - { - constructor(t); - } -}; - -template -class Construct -{ - const T1& other; -public: - Construct(const T1& other_) : other(other_) - { - } - void operator()(Type& t) - { - constructor(t, other); - } -}; - -template -class Destroy -{ -public: - void operator()(Type& t) - { - destructor(t); - } -}; - -template > -class New : public Allocator -{ -public: - New() - { - } - explicit New(const Allocator& allocator) : Allocator(allocator) - { - } - - Type* scalar() - { - return new(Allocator::allocate(1)) Type(); - } - template - Type* scalar(const T1& t1) - { - return new(Allocator::allocate(1)) Type(t1); - } - template - Type* scalar(const T1& t1, const T2& t2) - { - return new(Allocator::allocate(1)) Type(t1, t2); - } - template - Type* scalar(const T1& t1, const T2& t2, const T3& t3) - { - return new(Allocator::allocate(1)) Type(t1, t2, t3); - } - template - Type* scalar(const T1& t1, const T2& t2, const T3& t3, const T4& t4) - { - return new(Allocator::allocate(1)) Type(t1, t2, t3, t4); - } - template - Type* scalar(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) - { - return new(Allocator::allocate(1)) Type(t1, t2, t3, t4, t5); - } - Type* vector(std::size_t size) - { -#if 1 - Type* p = Allocator::allocate(size); - std::for_each(p, p + size, DefaultConstruct()); - return p; -#else - // this does not work with msvc71 runtime - return new(Allocator::allocate(size)) Type[size]; -#endif - } - template - Type* vector(std::size_t size, const T1& t1) - { - Type* p = Allocator::allocate(size); - std::for_each(p, p + size, Construct(t1)); - return p; - } -}; - -template > -class Delete : public Allocator -{ -public: - Delete() - { - } - explicit Delete(const Allocator& allocator) : Allocator(allocator) - { - } - - void scalar(Type* p) - { - if(p != 0) - { - p->~Type(); - Allocator::deallocate(p, 1); - } - } - void vector(Type* p, std::size_t size) - { - // '::operator delete' handles null - // 'std::allocator::deallocate' requires non-null - if(p != 0) - { - std::for_each(p, p + size, Destroy()); - Allocator::deallocate(p, size); - } - } -}; - - -template -class NamedNew -{ -public: - typedef New > type; -}; - -template -class NamedDelete -{ -public: - typedef Delete > type; -}; - -#endif diff --git a/libs/missing.h b/libs/missing.h new file mode 100644 index 00000000..135f4d32 --- /dev/null +++ b/libs/missing.h @@ -0,0 +1,237 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _MISSING_H_ +#define _MISSING_H_ + +// NOTE TTimo +// this goes along with str.h and provides various utility classes +// and portability defines +// the file name (missing.h) is a legacy issue, it would be better to clean that up +// in a central 'portability' lib + +#include +#include + +#ifdef _WIN32 + +#include +#include +#include +#include +#include + +#define R_OK 04 + +#else // !_WIN32 + +// LZ: very ugly hacks +inline int GetLastError() { return 0; }; + +// temp stuff +inline int GetPrivateProfileInt(char* a, char* b, int i, char* c) { return i; }; +#define VERIFY(a) a; +int GetFullPathName(const char *lpFileName, int nBufferLength, char *lpBuffer, char **lpFilePart); + +#ifndef APIENTRY +#define APIENTRY +#endif + +int MemorySize(void *ptr); +#define _msize MemorySize + +#define MK_LBUTTON 0x0001 +#define MK_RBUTTON 0x0002 +#define MK_SHIFT 0x0004 +#define MK_CONTROL 0x0008 +#define MK_MBUTTON 0x0010 + +#include +#include + +#endif + +#define CString Str +#include "str.h" + +class CPtrArray +{ +public: + CPtrArray () + { m_ptrs = g_ptr_array_new (); }; + virtual ~CPtrArray () + { g_ptr_array_free (m_ptrs, TRUE); }; + + void* operator[](int i) const + { return g_ptr_array_index (m_ptrs,i); }; + void* GetAt(int i) const + { return g_ptr_array_index (m_ptrs,i); }; + int GetSize () const + { return m_ptrs->len; }; + void Add (void* ptr) + { g_ptr_array_add (m_ptrs, ptr); }; + void RemoveAll () + { g_ptr_array_set_size (m_ptrs, 0); }; + void RemoveAt(int index, int count = 1) + { + if ((index < 0) || (count < 0) || (count + index > (int)m_ptrs->len)) + return; + for (; count > 0; count--) + g_ptr_array_remove_index (m_ptrs, index); + } + void InsertAt(int nStartIndex, CPtrArray* pNewArray) + { + for (int i = 0; i < pNewArray->GetSize(); i++) + InsertAt(nStartIndex+i, pNewArray->GetAt(i)); + } + void InsertAt(int nIndex, void* newElement, int nCount = 1) + { + if ((guint32)nIndex >= m_ptrs->len) + { + g_ptr_array_set_size (m_ptrs, nIndex + nCount); // grow so nIndex is valid + } + else + { + // inserting in the middle of the array + int nOldSize = m_ptrs->len; + g_ptr_array_set_size (m_ptrs, m_ptrs->len + nCount); + // shift old data up to fill gap + memmove(&m_ptrs->pdata[nIndex+nCount], &m_ptrs->pdata[nIndex], + (nOldSize-nIndex) * sizeof(gpointer)); + + memset(&m_ptrs->pdata[nIndex], 0, nCount * sizeof(gpointer)); + } + + // insert new value in the gap + while (nCount--) + m_ptrs->pdata[nIndex++] = newElement; + } + void Copy(const CPtrArray& src) + { + g_ptr_array_set_size (m_ptrs, src.m_ptrs->len); + memcpy (m_ptrs->pdata, src.m_ptrs->pdata, m_ptrs->len*sizeof(gpointer)); + } + +protected: + GPtrArray* m_ptrs; +}; + +typedef struct stringmap_s +{ + char* key; + char* value; +} stringmap_t; + +class CMapStringToString +{ +public: + CMapStringToString () + { m_map = g_ptr_array_new (); }; + ~CMapStringToString () + { + for (guint32 i = 0; i < m_map->len; i++) + FreeElement ((stringmap_t*)g_ptr_array_index (m_map,i)); + g_ptr_array_set_size (m_map, 0); + g_ptr_array_free (m_map, TRUE); + }; + void SetAt(char* key, char* newValue) + { + for (guint32 i = 0; i < m_map->len; i++) + { + stringmap_t* entry = (stringmap_t*)g_ptr_array_index (m_map,i); + if (strcmp (entry->key, key) == 0) + { + g_free (entry->value); + entry->value = g_strdup (newValue); + return; + } + } + stringmap_t* entry = (stringmap_t*)g_malloc (sizeof (stringmap_t)); + entry->key = g_strdup (key); + entry->value = g_strdup (newValue); + g_ptr_array_add (m_map, entry); + } + + bool Lookup(const char* key, CString& rValue) const + { + for (guint32 i = 0; i < m_map->len; i++) + { + stringmap_t* entry = (stringmap_t*)g_ptr_array_index (m_map,i); + if (strcmp (entry->key, key) == 0) + { + rValue = entry->value; + return true; + } + } + return false; + } + +protected: + GPtrArray* m_map; + + void FreeElement(stringmap_t* elem) + { + g_free (elem->key); + g_free (elem->value); + g_free (elem); + }; +}; + +class FindFiles { +public: + FindFiles( const char *directory ); + ~FindFiles(); + + const char* NextFile(); +private: +#ifdef _WIN32 + Str directory; + HANDLE findHandle; + WIN32_FIND_DATA findFileData; +#else + DIR *findHandle; +#endif +}; + +bool CopyTree( const char* source, const char* dest ); + +typedef enum { + PATH_FAIL, // stat call failed (does not exist is likely) + PATH_DIRECTORY, + PATH_FILE +} EPathCheck; + +// check a path for existence, return directory / file +EPathCheck CheckFile( const char *path ); + +bool radCreateDirectory( const char *directory ); +bool radCopyFile( const char *lpExistingFileName, const char *lpNewFileName ); + +#endif // _MISSING_H_ diff --git a/libs/moduleobservers.cpp b/libs/moduleobservers.cpp deleted file mode 100644 index a2d51f7d..00000000 --- a/libs/moduleobservers.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "moduleobservers.h" - diff --git a/libs/moduleobservers.h b/libs/moduleobservers.h deleted file mode 100644 index cd3bb1ef..00000000 --- a/libs/moduleobservers.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULEOBSERVERS_H) -#define INCLUDED_MODULEOBSERVERS_H - -#include "debugging/debugging.h" -#include -#include "moduleobserver.h" - -class ModuleObservers -{ - typedef std::set Observers; - Observers m_observers; -public: - ~ModuleObservers() - { - ASSERT_MESSAGE(m_observers.empty(), "ModuleObservers::~ModuleObservers: observers still attached"); - } - void attach(ModuleObserver& observer) - { - ASSERT_MESSAGE(m_observers.find(&observer) == m_observers.end(), "ModuleObservers::attach: cannot attach observer"); - m_observers.insert(&observer); - } - void detach(ModuleObserver& observer) - { - ASSERT_MESSAGE(m_observers.find(&observer) != m_observers.end(), "ModuleObservers::detach: cannot detach observer"); - m_observers.erase(&observer); - } - void realise() - { - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->realise(); - } - } - void unrealise() - { - for(Observers::reverse_iterator i = m_observers.rbegin(); i != m_observers.rend(); ++i) - { - (*i)->unrealise(); - } - } -}; - -#endif diff --git a/libs/modulesystem/moduleregistry.cpp b/libs/modulesystem/moduleregistry.cpp deleted file mode 100644 index 9841f797..00000000 --- a/libs/modulesystem/moduleregistry.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "moduleregistry.h" - diff --git a/libs/modulesystem/moduleregistry.h b/libs/modulesystem/moduleregistry.h deleted file mode 100644 index bd39cb06..00000000 --- a/libs/modulesystem/moduleregistry.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULESYSTEM_MODULEREGISTRY_H) -#define INCLUDED_MODULESYSTEM_MODULEREGISTRY_H - -#include "generic/static.h" -#include - -class ModuleRegisterable -{ -public: - virtual void selfRegister() = 0; -}; - -class ModuleRegistryList -{ - typedef std::list RegisterableModules; - RegisterableModules m_modules; -public: - void addModule(ModuleRegisterable& module) - { - m_modules.push_back(&module); - } - void registerModules() const - { - for(RegisterableModules::const_iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - (*i)->selfRegister(); - } - } -}; - -typedef SmartStatic StaticModuleRegistryList; - - -class StaticRegisterModule : public StaticModuleRegistryList -{ -public: - StaticRegisterModule(ModuleRegisterable& module) - { - StaticModuleRegistryList::instance().addModule(module); - } -}; - - -#endif diff --git a/libs/modulesystem/modulesmap.cpp b/libs/modulesystem/modulesmap.cpp deleted file mode 100644 index 4edfc701..00000000 --- a/libs/modulesystem/modulesmap.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "modulesmap.h" diff --git a/libs/modulesystem/modulesmap.h b/libs/modulesystem/modulesmap.h deleted file mode 100644 index dfc2ea45..00000000 --- a/libs/modulesystem/modulesmap.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULESYSTEM_MODULESMAP_H) -#define INCLUDED_MODULESYSTEM_MODULESMAP_H - -#include "modulesystem.h" -#include "string/string.h" -#include -#include - -template -class ModulesMap : public Modules -{ - typedef std::map modules_t; - modules_t m_modules; -public: - ~ModulesMap() - { - for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - (*i).second->release(); - } - } - - typedef modules_t::const_iterator iterator; - - iterator begin() const - { - return m_modules.begin(); - } - iterator end() const - { - return m_modules.end(); - } - - void insert(const char* name, Module& module) - { - module.capture(); - if(globalModuleServer().getError()) - { - module.release(); - globalModuleServer().setError(false); - } - else - { - m_modules.insert(modules_t::value_type(name, &module)); - } - } - - Type* find(const char* name) - { - modules_t::iterator i = m_modules.find(name); - if(i != m_modules.end()) - { - return static_cast(Module_getTable(*(*i).second)); - } - return 0; - } - - Type* findModule(const char* name) - { - return find(name); - } - void foreachModule(const typename Modules::Visitor& visitor) - { - for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - visitor.visit((*i).first.c_str(), *static_cast(Module_getTable(*(*i).second))); - } - } -}; - -template -class InsertModules : public ModuleServer::Visitor -{ - ModulesMap& m_modules; -public: - InsertModules(ModulesMap& modules) - : m_modules(modules) - { - } - void visit(const char* name, Module& module) const - { - m_modules.insert(name, module); - } -}; - -template -class ModulesRef -{ - ModulesMap m_modules; -public: - ModulesRef(const char* names) - { - if(!globalModuleServer().getError()) - { - if(string_equal(names, "*")) - { - InsertModules visitor(m_modules); - globalModuleServer().foreachModule(typename Type::Name(), typename Type::Version(), visitor); - } - else - { - StringTokeniser tokeniser(names); - for(;;) - { - const char* name = tokeniser.getToken(); - if(string_empty(name)) - { - break; - } - Module* module = globalModuleServer().findModule(typename Type::Name(), typename Type::Version(), name); - if(module == 0) - { - globalModuleServer().setError(true); - globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " name=" << makeQuoted(name) << " - not found\n"; - break; - } - else - { - m_modules.insert(name, *module); - } - } - } - } - } - ModulesMap& get() - { - return m_modules; - } -}; - -#endif diff --git a/libs/modulesystem/singletonmodule.cpp b/libs/modulesystem/singletonmodule.cpp deleted file mode 100644 index 866c24fa..00000000 --- a/libs/modulesystem/singletonmodule.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "singletonmodule.h" -#include "generic/constant.h" - -class NullType -{ -public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, ""); -}; - -class NullModule -{ -public: - typedef NullType Type; - STRING_CONSTANT(Name, ""); - void* getTable() - { - return NULL; - } -}; - -void TEST_SINGLETONMODULE() -{ - SingletonModule null; - null.capture(); - null.release(); -} diff --git a/libs/modulesystem/singletonmodule.h b/libs/modulesystem/singletonmodule.h deleted file mode 100644 index f68587b7..00000000 --- a/libs/modulesystem/singletonmodule.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODULESYSTEM_SINGLETONMODULE_H) -#define INCLUDED_MODULESYSTEM_SINGLETONMODULE_H - -#include "modulesystem.h" -#include -#include "debugging/debugging.h" -#include "modulesystem/moduleregistry.h" -#include "generic/reference.h" - -template -class DefaultAPIConstructor -{ -public: - const char* getName() - { - return typename API::Name(); - } - - API* constructAPI(Dependencies& dependencies) - { - return new API; - } - void destroyAPI(API* api) - { - delete api; - } -}; - -template -class DependenciesAPIConstructor -{ -public: - const char* getName() - { - return typename API::Name(); - } - - API* constructAPI(Dependencies& dependencies) - { - return new API(dependencies); - } - void destroyAPI(API* api) - { - delete api; - } -}; - -class NullDependencies -{ -}; - - -template > -class SingletonModule : public APIConstructor, public Module, public ModuleRegisterable -{ - Dependencies* m_dependencies; - API* m_api; - std::size_t m_refcount; - bool m_dependencyCheck; - bool m_cycleCheck; -public: - typedef typename API::Type Type; - - SingletonModule() - : m_dependencies(0), m_api(0), m_refcount(0), m_dependencyCheck(false), m_cycleCheck(false) - { - } - explicit SingletonModule(const APIConstructor& constructor) - : APIConstructor(constructor), m_dependencies(0), m_api(0), m_refcount(0), m_dependencyCheck(false), m_cycleCheck(false) - { - } - ~SingletonModule() - { - ASSERT_MESSAGE(m_refcount == 0, "module still referenced at shutdown"); - } - - void selfRegister() - { - globalModuleServer().registerModule(typename Type::Name(), typename Type::Version(), APIConstructor::getName(), *this); - } - - Dependencies& getDependencies() - { - return *m_dependencies; - } - void* getTable() - { - if(m_api != 0) - { - return m_api->getTable(); - } - return 0; - } - void capture() - { - if(++m_refcount == 1) - { - globalOutputStream() << "Module Initialising: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n"; - m_dependencies = new Dependencies(); - m_dependencyCheck = !globalModuleServer().getError(); - if(m_dependencyCheck) - { - m_api = APIConstructor::constructAPI(*m_dependencies); - globalOutputStream() << "Module Ready: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n"; - } - else - { - globalOutputStream() << "Module Dependencies Failed: '" << typename Type::Name() << "' '" << APIConstructor::getName() << "'\n"; - } - m_cycleCheck = true; - } - - ASSERT_MESSAGE(m_cycleCheck, "cyclic dependency detected"); - } - void release() - { - if(--m_refcount == 0) - { - if(m_dependencyCheck) - { - APIConstructor::destroyAPI(m_api); - } - delete m_dependencies; - } - } -}; - - -#endif diff --git a/libs/multimon.h b/libs/multimon.h new file mode 100644 index 00000000..638e353a --- /dev/null +++ b/libs/multimon.h @@ -0,0 +1,381 @@ +#ifndef __MULTIMON_H +#define __MULTIMON_H + +#ifdef _WIN32 + +//============================================================================= +// +// MULTIMON +// stub module that "stubs" multiple monitor APIs on pre-Memphis Win32 OSes +// +// By using this header your code will work unchanged on Win95, +// you will get back correct values from GetSystemMetrics() for new metrics +// and the new APIs will act like only one display is present. +// +// exactly one source must include this with COMPILE_MULTIMON_STUBS defined +// +//============================================================================= + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + +// +// if we are building on Win95/NT4 headers we need to declare this stuff ourselves +// +#ifndef SM_CMONITORS + +#define SM_XVIRTUALSCREEN 76 +#define SM_YVIRTUALSCREEN 77 +#define SM_CXVIRTUALSCREEN 78 +#define SM_CYVIRTUALSCREEN 79 +#define SM_CMONITORS 80 +#define SM_SAMEDISPLAYFORMAT 81 + +DECLARE_HANDLE(HMONITOR); + +#define MONITOR_DEFAULTTONULL 0x00000000 +#define MONITOR_DEFAULTTOPRIMARY 0x00000001 +#define MONITOR_DEFAULTTONEAREST 0x00000002 + +#define MONITORINFOF_PRIMARY 0x00000001 + +typedef struct tagMONITORINFO +{ + DWORD cbSize; + RECT rcMonitor; + RECT rcWork; + DWORD dwFlags; +} MONITORINFO, *LPMONITORINFO; + +#define CCHDEVICENAME 32 + +#ifdef __cplusplus +typedef struct tagMONITORINFOEX : public tagMONITORINFO +{ + TCHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEX, *LPMONITORINFOEX; +#else +typedef struct +{ + MONITORINFO; + TCHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEX, *LPMONITORINFOEX; +#endif + +typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); + +#endif // SM_CMONITORS + +#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP + +typedef struct { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD StateFlags; +} DISPLAY_DEVICE; + +#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 +#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002 +#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 +#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 + +#endif +#define DISPLAY_DEVICE_VGA 0x00000010 + +#ifndef ENUM_CURRENT_SETTINGS +#define ENUM_CURRENT_SETTINGS ((DWORD)-1) +#define ENUM_REGISTRY_SETTINGS ((DWORD)-2) +#endif + +#undef GetMonitorInfo +#undef GetSystemMetrics +#undef MonitorFromWindow +#undef MonitorFromRect +#undef MonitorFromPoint +#undef EnumDisplayMonitors +#undef EnumDisplayDevices + +// +// define this to compile the stubs +// otherwise you get the declarations +// +#ifdef COMPILE_MULTIMON_STUBS + + //--------------------------------------------------------------------------- + // + // Implement the API stubs. + // + //--------------------------------------------------------------------------- + + int (WINAPI* g_pfnGetSystemMetrics)(int); + HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, BOOL); + HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, BOOL); + HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, BOOL); + BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO); + BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM); + BOOL (WINAPI *g_pfnEnumDisplayDevices)(LPVOID, int, DISPLAY_DEVICE *, DWORD); + + BOOL InitMultipleMonitorStubs(void) + { + HMODULE hUser32; + static BOOL fInitDone; + + if (fInitDone) + { + return g_pfnGetMonitorInfo != NULL; + } + + if ((hUser32 = GetModuleHandle(TEXT("USER32"))) && + (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) && + (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) && + (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) && + (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) && + (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) && + #ifdef UNICODE + (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoW")) && + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) && + #else + (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) && + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) && + #endif + (GetSystemMetrics(SM_CXVIRTUALSCREEN) >= GetSystemMetrics(SM_CXSCREEN)) && + (GetSystemMetrics(SM_CYVIRTUALSCREEN) >= GetSystemMetrics(SM_CYSCREEN)) ) + { + fInitDone = TRUE; + return TRUE; + } + else + { + g_pfnGetSystemMetrics = NULL; + g_pfnMonitorFromWindow = NULL; + g_pfnMonitorFromRect = NULL; + g_pfnMonitorFromPoint = NULL; + g_pfnGetMonitorInfo = NULL; + g_pfnEnumDisplayMonitors = NULL; + g_pfnEnumDisplayDevices = NULL; + + fInitDone = TRUE; + return FALSE; + } + } + + //--------------------------------------------------------------------------- + // + // "stubbed" implementations of Monitor APIs that work with the primary // display + // + //--------------------------------------------------------------------------- + + int WINAPI + xGetSystemMetrics(int nIndex) + { + if (InitMultipleMonitorStubs()) + return g_pfnGetSystemMetrics(nIndex); + + switch (nIndex) + { + case SM_CMONITORS: + case SM_SAMEDISPLAYFORMAT: + return 1; + + case SM_XVIRTUALSCREEN: + case SM_YVIRTUALSCREEN: + return 0; + + case SM_CXVIRTUALSCREEN: + nIndex = SM_CXSCREEN; + break; + + case SM_CYVIRTUALSCREEN: + nIndex = SM_CYSCREEN; + break; + } + + return GetSystemMetrics(nIndex); + } + + #define xPRIMARY_MONITOR ((HMONITOR)0x42) + + HMONITOR WINAPI + xMonitorFromRect(LPCRECT lprcScreenCoords, + UINT uFlags) + { + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromRect(lprcScreenCoords, uFlags); + + if ((uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || + ((lprcScreenCoords->right > 0) && + (lprcScreenCoords->bottom > 0) && + (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) && + (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN)))) + { + return xPRIMARY_MONITOR; + } + + return NULL; + } + + HMONITOR WINAPI + xMonitorFromWindow(HWND hWnd, + UINT uFlags) + { + RECT rc; + + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromWindow(hWnd, uFlags); + + if (uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) + return xPRIMARY_MONITOR; + + if (GetWindowRect(hWnd, &rc)) + return xMonitorFromRect(&rc, uFlags); + + return NULL; + } + + HMONITOR WINAPI + xMonitorFromPoint(POINT ptScreenCoords, + UINT uFlags) + { + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromPoint(ptScreenCoords, uFlags); + + if ((uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || + ((ptScreenCoords.x >= 0) && + (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) && + (ptScreenCoords.y >= 0) && + (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN)))) + { + return xPRIMARY_MONITOR; + } + + return NULL; + } + + BOOL WINAPI + xGetMonitorInfo(HMONITOR hMonitor, + LPMONITORINFO lpMonitorInfo) + { + RECT rcWork; + + if (InitMultipleMonitorStubs()) + return g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo); + + if ((hMonitor == xPRIMARY_MONITOR) && lpMonitorInfo && + (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWork, 0)) + { + lpMonitorInfo->rcMonitor.left = 0; + lpMonitorInfo->rcMonitor.top = 0; + lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN); + lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN); + lpMonitorInfo->rcWork = rcWork; + lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; + + if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)) + lstrcpy(((MONITORINFOEX*)lpMonitorInfo)->szDevice, + TEXT("DISPLAY")); + + return TRUE; + } + + return FALSE; + } + + BOOL WINAPI + xEnumDisplayMonitors(HDC hdc, + LPCRECT lprcIntersect, + MONITORENUMPROC lpfnEnumProc, + LPARAM lData) + { + RECT rcCallback, rcLimit; + + if (InitMultipleMonitorStubs()) + return g_pfnEnumDisplayMonitors(hdc, lprcIntersect, lpfnEnumProc, lData); + + if (!lpfnEnumProc) + return FALSE; + + rcLimit.left = 0; + rcLimit.top = 0; + rcLimit.right = GetSystemMetrics(SM_CXSCREEN); + rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN); + + if (hdc) + { + RECT rcClip; + HWND hWnd; + + if ((hWnd = WindowFromDC(hdc)) == NULL) + return FALSE; + + switch (GetClipBox(hdc, &rcClip)) + { + default: + MapWindowPoints(NULL, hWnd, (LPPOINT)&rcLimit, 2); + if (IntersectRect(&rcCallback, &rcClip, &rcLimit)) + break; + //fall thru + case NULLREGION: + return TRUE; + case ERROR: + return FALSE; + } + + rcLimit = rcCallback; + } + + if (!lprcIntersect || IntersectRect(&rcCallback, lprcIntersect, &rcLimit)) + { + lpfnEnumProc(xPRIMARY_MONITOR, hdc, &rcCallback, lData); + } + + return TRUE; + } + + BOOL WINAPI + xEnumDisplayDevices(LPVOID lpReserved, + int iDeviceNum, + DISPLAY_DEVICE * pDisplayDevice, + DWORD dwFlags) + { + if (InitMultipleMonitorStubs()) + return g_pfnEnumDisplayDevices(lpReserved, iDeviceNum, pDisplayDevice, dwFlags); + + return FALSE; + } + + #undef xPRIMARY_MONITOR + #undef COMPILE_MULTIMON_STUBS + +#else // COMPILE_MULTIMON_STUBS + + extern int WINAPI xGetSystemMetrics(int); + extern HMONITOR WINAPI xMonitorFromWindow(HWND, UINT); + extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, UINT); + extern HMONITOR WINAPI xMonitorFromPoint(POINT, UINT); + extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO); + extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM); + extern BOOL WINAPI xEnumDisplayDevices(LPVOID, int, DISPLAY_DEVICE *, DWORD); + +#endif // COMPILE_MULTIMON_STUBS + +// +// build defines that replace the regular APIs with our versions +// +#define GetSystemMetrics xGetSystemMetrics +#define MonitorFromWindow xMonitorFromWindow +#define MonitorFromRect xMonitorFromRect +#define MonitorFromPoint xMonitorFromPoint +#define GetMonitorInfo xGetMonitorInfo +#define EnumDisplayMonitors xEnumDisplayMonitors +#define EnumDisplayDevices xEnumDisplayDevices + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // WIN32 + +#endif // __MULTIMON_H \ No newline at end of file diff --git a/libs/os/dir.cpp b/libs/os/dir.cpp deleted file mode 100644 index a775e5bd..00000000 --- a/libs/os/dir.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "dir.h" - diff --git a/libs/os/dir.h b/libs/os/dir.h deleted file mode 100644 index bdb385e1..00000000 --- a/libs/os/dir.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_OS_DIR_H) -#define INCLUDED_OS_DIR_H - -/// \file -/// \brief OS directory-listing object. - -#include - -typedef GDir Directory; - -inline bool directory_good(Directory* directory) -{ - return directory != 0; -} - -inline Directory* directory_open(const char* name) -{ - return g_dir_open(name, 0, 0); -} - -inline void directory_close(Directory* directory) -{ - g_dir_close(directory); -} - -inline const char* directory_read_and_increment(Directory* directory) -{ - return g_dir_read_name(directory); -} - -template -void Directory_forEach(const char* path, const Functor& functor) -{ - Directory* dir = directory_open(path); - - if(directory_good(dir)) - { - for(;;) - { - const char* name = directory_read_and_increment(dir); - if(name == 0) - { - break; - } - - functor(name); - } - - directory_close(dir); - } -} - - -#endif diff --git a/libs/os/file.cpp b/libs/os/file.cpp deleted file mode 100644 index 766638f9..00000000 --- a/libs/os/file.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "file.h" - diff --git a/libs/os/file.h b/libs/os/file.h deleted file mode 100644 index b1290760..00000000 --- a/libs/os/file.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_OS_FILE_H) -#define INCLUDED_OS_FILE_H - -/// \file -/// \brief OS file-system querying and manipulation. - -#if defined( WIN32 ) -#define S_ISDIR(mode) (mode & _S_IFDIR) -#include // _access() -#define F_OK 0x00 -#define W_OK 0x02 -#define R_OK 0x04 -#define access(path, mode) _access(path, mode) -#else -#include // access() -#endif - -#include // rename(), remove() -#include // stat() -#include // this is included by stat.h on win32 -#include -#include - -#include "debugging/debugging.h" - -/// \brief Attempts to move the file identified by \p from to \p to and returns true if the operation was successful. -/// -/// The operation will fail unless: -/// - The path \p from identifies an existing file which is accessible for writing. -/// - The directory component of \p from identifies an existing directory which is accessible for writing. -/// - The path \p to does not identify an existing file or directory. -/// - The directory component of \p to identifies an existing directory which is accessible for writing. -inline bool file_move(const char* from, const char* to) -{ - ASSERT_MESSAGE(from != 0 && to != 0, "file_move: invalid path"); - return rename(from, to) == 0; -} - -/// \brief Attempts to remove the file identified by \p path and returns true if the operation was successful. -/// -/// The operation will fail unless: -/// - The \p path identifies an existing file. -/// - The parent-directory component of \p path identifies an existing directory which is accessible for writing. -inline bool file_remove(const char* path) -{ - ASSERT_MESSAGE(path != 0, "file_remove: invalid path"); - return remove(path) == 0; -} - -namespace FileAccess -{ - enum Mode - { - Read = R_OK, - Write = W_OK, - ReadWrite = Read | Write, - Exists = F_OK - }; -} - -/// \brief Returns true if the file or directory identified by \p path exists and/or may be accessed for reading, writing or both, depending on the value of \p mode. -inline bool file_accessible(const char* path, FileAccess::Mode mode) -{ - ASSERT_MESSAGE(path != 0, "file_accessible: invalid path"); - return access(path, static_cast(mode)) == 0; -} - -/// \brief Returns true if the file or directory identified by \p path exists and may be opened for reading. -inline bool file_readable(const char* path) -{ - return file_accessible(path, FileAccess::Read); -} - -/// \brief Returns true if the file or directory identified by \p path exists and may be opened for writing. -inline bool file_writeable(const char* path) -{ - return file_accessible(path, FileAccess::Write); -} - -/// \brief Returns true if the file or directory identified by \p path exists. -inline bool file_exists(const char* path) -{ - return file_accessible(path, FileAccess::Exists); -} - -/// \brief Returns true if the file or directory identified by \p path exists and is a directory. -inline bool file_is_directory(const char* path) -{ - ASSERT_MESSAGE(path != 0, "file_is_directory: invalid path"); - struct stat st; - if(stat(path, &st) == -1) - { - return false; - } - return S_ISDIR (st.st_mode) != 0; -} - -typedef std::size_t FileSize; - -/// \brief Returns the size in bytes of the file identified by \p path, or 0 if the file was not found. -inline FileSize file_size(const char* path) -{ - ASSERT_MESSAGE(path != 0, "file_size: invalid path"); - struct stat st; - if(stat(path, &st) == -1) - { - return 0; - } - return st.st_size; -} - -/// Seconds elapsed since Jan 1, 1970 -typedef std::time_t FileTime; -/// No file can have been modified earlier than this time. -const FileTime c_invalidFileTime = -1; - -/// \brief Returns the time that the file identified by \p path was last modified, or c_invalidFileTime if the file was not found. -inline FileTime file_modified(const char* path) -{ - ASSERT_MESSAGE(path != 0, "file_modified: invalid path"); - struct stat st; - if(stat(path, &st) == -1) - { - return c_invalidFileTime; - } - return st.st_mtime; -} - - - -#endif diff --git a/libs/os/path.cpp b/libs/os/path.cpp deleted file mode 100644 index ab03e1d2..00000000 --- a/libs/os/path.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "path.h" diff --git a/libs/os/path.h b/libs/os/path.h deleted file mode 100644 index 082b56fa..00000000 --- a/libs/os/path.h +++ /dev/null @@ -1,283 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_OS_PATH_H) -#define INCLUDED_OS_PATH_H - -/// \file -/// \brief OS file-system path comparison, decomposition and manipulation. -/// -/// - Paths are c-style null-terminated-character-arrays. -/// - Path separators must be forward slashes (unix style). -/// - Directory paths must end in a separator. -/// - Paths must not contain the ascii characters \\ : * ? " < > or |. -/// - Paths may be encoded in UTF-8 or any extended-ascii character set. - -#include "string/string.h" - -#if defined(WIN32) -#define OS_CASE_INSENSITIVE -#endif - -/// \brief Returns true if \p path is lexicographically sorted before \p other. -/// If both \p path and \p other refer to the same file, neither will be sorted before the other. -/// O(n) -inline bool path_less(const char* path, const char* other) -{ -#if defined(OS_CASE_INSENSITIVE) - return string_less_nocase(path, other); -#else - return string_less(path, other); -#endif -} - -/// \brief Returns <0 if \p path is lexicographically less than \p other. -/// Returns >0 if \p path is lexicographically greater than \p other. -/// Returns 0 if both \p path and \p other refer to the same file. -/// O(n) -inline int path_compare(const char* path, const char* other) -{ -#if defined(OS_CASE_INSENSITIVE) - return string_compare_nocase(path, other); -#else - return string_compare(path, other); -#endif -} - -/// \brief Returns true if \p path and \p other refer to the same file or directory. -/// O(n) -inline bool path_equal(const char* path, const char* other) -{ -#if defined(OS_CASE_INSENSITIVE) - return string_equal_nocase(path, other); -#else - return string_equal(path, other); -#endif -} - -/// \brief Returns true if the first \p n bytes of \p path and \p other form paths that refer to the same file or directory. -/// If the paths are UTF-8 encoded, [\p path, \p path + \p n) must be a complete path. -/// O(n) -inline bool path_equal_n(const char* path, const char* other, std::size_t n) -{ -#if defined(OS_CASE_INSENSITIVE) - return string_equal_nocase_n(path, other, n); -#else - return string_equal_n(path, other, n); -#endif -} - - -/// \brief Returns true if \p path is a fully qualified file-system path. -/// O(1) -inline bool path_is_absolute(const char* path) -{ -#if defined(WIN32) - return path[0] == '/' - || (path[0] != '\0' && path[1] == ':'); // local drive -#elif defined(POSIX) - return path[0] == '/'; -#endif -} - -/// \brief Returns true if \p path is a directory. -/// O(n) -inline bool path_is_directory(const char* path) -{ - std::size_t length = strlen(path); - if(length > 0) - { - return path[length-1] == '/'; - } - return false; -} - -/// \brief Returns a pointer to the first character of the component of \p path following the first directory component. -/// O(n) -inline const char* path_remove_directory(const char* path) -{ - const char* first_separator = strchr(path, '/'); - if(first_separator != 0) - { - return ++first_separator; - } - return ""; -} - -/// \brief Returns a pointer to the first character of the filename component of \p path. -/// O(n) -inline const char* path_get_filename_start(const char* path) -{ - { - const char* last_forward_slash = strrchr(path, '/'); - if(last_forward_slash != 0) - { - return last_forward_slash + 1; - } - } - - // not strictly necessary,since paths should not contain '\' - { - const char* last_backward_slash = strrchr(path, '\\'); - if(last_backward_slash != 0) - { - return last_backward_slash + 1; - } - } - - return path; -} - -/// \brief Returns a pointer to the character after the end of the filename component of \p path - either the extension separator or the terminating null character. -/// O(n) -inline const char* path_get_filename_base_end(const char* path) -{ - const char* last_period = strrchr(path_get_filename_start(path), '.'); - return (last_period != 0) ? last_period : path + string_length(path); -} - -/// \brief Returns the length of the filename component (not including extension) of \p path. -/// O(n) -inline std::size_t path_get_filename_base_length(const char* path) -{ - return path_get_filename_base_end(path) - path; -} - -/// \brief If \p path is a child of \p base, returns the subpath relative to \p base, else returns \p path. -/// O(n) -inline const char* path_make_relative(const char* path, const char* base) -{ - const std::size_t length = string_length(base); - if(path_equal_n(path, base, length)) - { - return path + length; - } - return path; -} - -/// \brief Returns a pointer to the first character of the file extension of \p path, or "" if not found. -/// O(n) -inline const char* path_get_extension(const char* path) -{ - const char* last_period = strrchr(path_get_filename_start(path), '.'); - if(last_period != 0) - { - return ++last_period; - } - return ""; -} - -/// \brief Returns true if \p extension is of the same type as \p other. -/// O(n) -inline bool extension_equal(const char* extension, const char* other) -{ - return path_equal(extension, other); -} - -template -class MatchFileExtension -{ - const char* m_extension; - const Functor& m_functor; -public: - MatchFileExtension(const char* extension, const Functor& functor) : m_extension(extension), m_functor(functor) - { - } - void operator()(const char* name) const - { - const char* extension = path_get_extension(name); - if(extension_equal(extension, m_extension)) - { - m_functor(name); - } - } -}; - -/// \brief A functor which invokes its contained \p functor if the \p name argument matches its \p extension. -template -inline MatchFileExtension matchFileExtension(const char* extension, const Functor& functor) -{ - return MatchFileExtension(extension, functor); -} - -class PathCleaned -{ -public: - const char* m_path; - PathCleaned(const char* path) : m_path(path) - { - } -}; - -/// \brief Writes \p path to \p ostream with dos-style separators replaced by unix-style separators. -template -TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const PathCleaned& path) -{ - const char* i = path.m_path; - for(; *i != '\0'; ++i) - { - if(*i == '\\') - { - ostream << '/'; - } - else - { - ostream << *i; - } - } - return ostream; -} - -class DirectoryCleaned -{ -public: - const char* m_path; - DirectoryCleaned(const char* path) : m_path(path) - { - } -}; - -/// \brief Writes \p path to \p ostream with dos-style separators replaced by unix-style separators, and appends a separator if necessary. -template -TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const DirectoryCleaned& path) -{ - const char* i = path.m_path; - for(; *i != '\0'; ++i) - { - if(*i == '\\') - { - ostream << '/'; - } - else - { - ostream << *i; - } - } - char c = *(i - 1); - if(c != '/' && c != '\\') - { - ostream << '/'; - } - return ostream; -} - - -#endif diff --git a/libs/pak/.cvsignore b/libs/pak/.cvsignore new file mode 100644 index 00000000..b5ee5ae1 --- /dev/null +++ b/libs/pak/.cvsignore @@ -0,0 +1 @@ +Debug Release *.ncb *.opt *.plg *.001 *.BAK \ No newline at end of file diff --git a/libs/jpeg6/.cvswrappers b/libs/pak/.cvswrappers similarity index 100% rename from libs/jpeg6/.cvswrappers rename to libs/pak/.cvswrappers diff --git a/libs/pak/pakstuff.cpp b/libs/pak/pakstuff.cpp new file mode 100644 index 00000000..b6028cc7 --- /dev/null +++ b/libs/pak/pakstuff.cpp @@ -0,0 +1,979 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#if defined (__linux__) || defined (__APPLE__) +#include +#endif +#ifdef _WIN32 +#include +#endif +#include "pakstuff.h" +#include "unzip.h" +#include "str.h" + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +int m_nPAKIndex; +FILE* pakfile[16]; +struct PACKDirectory pakdir; +PACKDirPtr pakdirptr = &pakdir; +UInt16 dirsize; +bool pakopen = false; +int f_type; +DIRECTORY *paktextures = NULL; +UInt32 PakColormapOffset; +UInt32 PakColormapSize; +DIRECTORY *dirhead = NULL; +bool g_bPK3 = false; +char g_strBasePaths[16][1024]; +int g_numBasePaths = 0; + +struct PK3FileInfo +{ + unzFile m_zFile; + char *m_pName; + unz_s m_zInfo; + long m_lSize; + ~PK3FileInfo() + { + delete []m_pName; + } + bool operator ==(const PK3FileInfo& rhs) const { return strcmp(m_pName, rhs.m_pName) == 0; } +}; + +#define __PATHSEPERATOR '/' + +//#define LOG_PAKFAIL + +#ifdef LOG_PAKFAIL + +#if defined (__linux__) || defined (__APPLE__) +#include +#include +#endif +#include + +class LogFile +{ +public: + FILE *m_pFile; + LogFile(const char* pName) + { +#if defined (__linux__) || defined (__APPLE__) + // leo: use ~/.q3a/radiant/paklog instead of /tmp/paklog.txt + char *home = NULL; + + home = getenv("HOME"); + if ( home == NULL ) + { + uid_t id = getuid(); + struct passwd *pwd; + + setpwent(); + while( (pwd = getpwent()) != NULL ) + if( pwd->pw_uid == id ) + { + home = pwd->pw_dir; + break; + } + endpwent(); + } + + if (home != NULL) + { + char path[PATH_MAX]; + strcpy (path, home); + if (path[strlen(path)-1] != '/') + strcat (path, "/"); + strcat (path, ".q3a/radiant/paklog"); + m_pFile = fopen(path, "w"); + } + else +#endif + m_pFile = fopen(pName, "w"); + } + ~LogFile() + { + if (m_pFile) + { + fclose(m_pFile); + } + } + void Log(const char *pFormat, ...) + { + if (m_pFile == NULL) + return; + + va_list arg_ptr; + va_start(arg_ptr, pFormat); + fprintf(m_pFile, pFormat, arg_ptr); + va_end(arg_ptr); + } +}; + +LogFile g_LogFile("/tmp/paklog.txt"); +#endif + +template class StrPtr : public Str +{ +protected: + T* m_pPtr; + StrPtr() + { + m_pPtr = NULL; + } + + StrPtr(const char *pStr, T *p) : Str(pStr) + { + m_pPtr = p; + } + + T* Ptr() + { + return m_pPtr; + } + + T& Ref() + { + return *m_pPtr; + } + + +}; +// PtrList +// a list of ptrs +// +template class PtrList +{ +protected: + T *m_pPtr; + PtrList *m_pNext; + +public: + + PtrList() + { + m_pNext = NULL; + m_pPtr = NULL; + } + + PtrList(T *ip) + { + m_pNext = NULL; + m_pPtr = ip; + } + + virtual ~PtrList() + { + delete m_pPtr; + } + + PtrList* Next() + { + return m_pNext; + } + + void Add(T *ip) + { + PtrList *pl = this; + while (pl && pl->m_pNext) + { + pl = pl->Next(); + } + pl->m_pNext = new PtrList(ip); + } + + void Remove() + { + PtrList *p = m_pNext; + if (p) + { + while (p->m_pNext != this && p->m_pNext != NULL) + { + p = p->m_pNext; + } + if (p->m_pNext == this) + { + p->m_pNext = m_pNext; + } + } + } + + virtual PtrList* Find(T *ip) + { + PtrList *p = m_pNext; + while (p) + { + if (*p->m_pPtr == *ip) + { + return p; + } + p = p->m_pNext; + } + return NULL; + } + + // remove vp from the list + void Remove(T *ip) + { + PtrList *p = Find(ip); + if (p) + { + p->Remove(); + } + } + + T* Ptr() + { + return m_pPtr; + } + + T& Ref() + { + return *m_pPtr; + } + + void RemoveAll() + { + PtrList *p = m_pNext; + while (p) + { + PtrList *p2 = p; + p = p->m_pNext; + delete p2; + } + } +}; + + +typedef PtrList ZFileList; +typedef PtrList StrList; +typedef PtrList PK3List; + + +StrList g_PK3TexturePaths; +PK3List g_PK3Files; +ZFileList g_zFiles; +#define WORK_LEN 1024 +#define TEXTURE_PATH "textures" +#define PATH_SEPERATORS "/\\:\0" + +/* +char* __StrDup(char* pStr) +{ + if (pStr == NULL) + pStr = ""; + + return strcpy(new char[strlen(pStr)+1], pStr); +} + +char* __StrDup(const char* pStr) +{ + if (pStr == NULL) + pStr = ""; + + return strcpy(new char[strlen(pStr)+1], pStr); +} +*/ + +#define MEM_BLOCKSIZE 4096 +void* __qblockmalloc(size_t nSize) +{ + void *b; + // round up to threshold + int nAllocSize = nSize % MEM_BLOCKSIZE; + if ( nAllocSize > 0) + { + nSize += MEM_BLOCKSIZE - nAllocSize; + } + b = malloc(nSize + 1); + memset (b, 0, nSize); + return b; +} + +void* __qmalloc (size_t nSize) +{ + void *b; + b = malloc(nSize + 1); + memset (b, 0, nSize); + return b; +} + + +/* +==================== +Extract file parts +==================== +*/ +void __ExtractFilePath (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a \ or the start +// + while (src != path && *(src-1) != __PATHSEPERATOR) + src--; + + memcpy (dest, path, src-path); + dest[src-path] = 0; +} + +void __ExtractFileName (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a \ or the start +// + while (src != path && *(src-1) != '/' + && *(src-1) != '\\' ) + src--; + + while (*src) + { + *dest++ = *src++; + } + *dest = 0; +} + +void __ExtractFileBase (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a \ or the start +// + while (src != path && *(src-1) != '/' + && *(src-1) != '\\' ) + src--; + + while (*src && *src != '.') + { + *dest++ = *src++; + } + *dest = 0; +} + +void __ExtractFileExtension (const char *path, char *dest) +{ + const char *src; + + src = path + strlen(path) - 1; + +// +// back up until a . or the start +// + while (src != path && *(src-1) != '.') + src--; + if (src == path) + { + *dest = 0; // no extension + return; + } + + strcpy (dest,src); +} + + +void __ConvertDOSToUnixName( char *dst, const char *src ) +{ + while ( *src ) + { + if ( *src == '\\' ) + *dst = '/'; + else + *dst = *src; + dst++; src++; + } + *dst = 0; +} + + + + + +static void AddSlash(Str& str) +{ + int nLen = str.GetLength(); + if (nLen > 0) + { + if (str[nLen-1] != '\\' && str[nLen-1] != '/') + str += '\\'; + } +} + +static void FindReplace(Str& strContents, const char* pTag, const char* pValue) +{ + if (strcmp(pTag, pValue) == 0) + return; + for (int nPos = strContents.Find(pTag); nPos >= 0; nPos = strContents.Find(pTag)) + { + int nRightLen = strContents.GetLength() - strlen(pTag) - nPos; + Str strLeft(strContents.Left(nPos)); + Str strRight(strContents.Right(nRightLen)); + strLeft += pValue; + strLeft += strRight; + strContents = strLeft; + } +} + + + + + +void ClearFileList(FILELIST **list) +{ + FILELIST *temp; + + while(*list) + { + temp = *list; + *list = (*list)->next; + free(temp); + } +} + +void ClearDirList(DIRLIST **list) +{ + DIRLIST *temp; + + while(*list) + { + temp = *list; + *list = (*list)->next; + free(temp); + } +} + +DIRECTORY *FindPakDir(DIRECTORY *dir, char *name) +{ + DIRECTORY *currentPtr; + + for(currentPtr = dir; currentPtr; currentPtr = currentPtr->next) + { + if(!stricmp(name, currentPtr->name)) + { + return currentPtr; + } + } + return NULL; +} + + +// LoadPK3FileList +// --------------- +// +// This gets passed a file mask which we want to remove as +// we are only interested in the directory name and any given +// extension. Only handles explicit filenames or *.something +// +bool LoadPK3FileList(FILELIST **filelist, const char *pattern) +{ + char cSearch[WORK_LEN]; + __ConvertDOSToUnixName( cSearch, pattern ); + char cPath[WORK_LEN]; + char cExt[WORK_LEN]; + char cFile[WORK_LEN]; + char cWork[WORK_LEN]; + __ExtractFilePath(pattern, cPath); + __ExtractFileName(pattern, cFile); + __ExtractFileExtension(pattern, cExt); + const char *pCompare = (strnicmp(cFile, "*.", 2) == 0) ? cExt : cFile; + + PK3List *p = g_PK3Files.Next(); + while (p != NULL) + { + // qualify the path + PK3FileInfo *pKey = p->Ptr(); + if (strstr(pKey->m_pName, cPath) && strstr(pKey->m_pName, pCompare)) + { + __ExtractFileName(pKey->m_pName, cWork); + AddToFileListAlphabetized(filelist, cWork, 0, 0, false); + } + p = p->Next(); + } + return (*filelist) != NULL; +} + +bool GetPackFileList(FILELIST **filelist, char *pattern) +{ + char *str1, *str2; + int i; + DIRECTORY *dummy = paktextures; + FILELIST *temp; + + if (!pakopen) + return false; + + if (g_bPK3) + { + return LoadPK3FileList(filelist, pattern); + } + + str1 = pattern; + + for(i = 0; pattern[i] != '\0'; i++) + { + if(pattern[i] == '\\') + pattern[i] = '/'; + } + + while(strchr(str1, '/')) + { + str2 = strchr(str1, '/'); + *str2++ = '\0'; + dummy = FindPakDir(dummy, str1); + if(!dummy) + return false; + str1 = str2; + } + for(temp = dummy->files; temp; temp=temp->next) + { + AddToFileListAlphabetized(filelist, temp->filename, temp->offset, 0, false); + } + return true; +} + +bool GetPackTextureDirs(DIRLIST **dirlist) +{ + UInt16 i; + char buf[57]; + + if (!pakopen) + return 1; + + if (g_bPK3) + { + StrList *pl = g_PK3TexturePaths.Next(); + while (pl != NULL) + { + AddToDirListAlphabetized(dirlist, pl->Ref(), 0); + pl = pl->Next(); + } + return true; + } + + for (i = 0; i < dirsize; i++) + { + if(!strnicmp(pakdirptr[i].name, "textures", 8)) + { + strncpy(buf, &(pakdirptr[i].name[9]), 46); + if(strchr(buf, '\\')) + *strchr(buf, '\\') = '\0'; + else if(strchr(buf, '/')) + *strchr(buf, '/') = '\0'; + else + buf[56] = '\0'; + + if(strchr(buf, '.')) + continue; + + AddToDirListAlphabetized(dirlist, buf, 0); + } + } + return true; +} + +bool AddToDirListAlphabetized(DIRLIST **list, char *dirname, int from) +{ + DIRLIST *currentPtr, *previousPtr, *newPtr; + + strlwr(dirname); + for(currentPtr = *list; currentPtr; currentPtr = currentPtr->next) + { + if(!stricmp(dirname, currentPtr->dirname)) + { + return false; + } + } + previousPtr = NULL; + currentPtr = *list; + + if((newPtr = (DIRLIST *)__qmalloc(sizeof(DIRLIST))) == NULL) + return false; + + strcpy(newPtr->dirname, dirname); + newPtr->from = from; + + while(currentPtr != NULL && stricmp(dirname, currentPtr->dirname) > 0) + { + previousPtr = currentPtr; + currentPtr = currentPtr->next; + } //End while + if(previousPtr == NULL) + { + newPtr->next = *list; + *list = newPtr; + } //End if + else + { + previousPtr->next = newPtr; + newPtr->next = currentPtr; + } //End else + return true; +} + +bool AddToFileListAlphabetized(FILELIST **list, char *filename, UInt32 offset, UInt32 size, bool dirs) +{ + FILELIST *currentPtr, *previousPtr, *newPtr; + + for(currentPtr = *list; currentPtr; currentPtr = currentPtr->next) + { + if(!stricmp(filename, currentPtr->filename)) + { + return false; + } + } + previousPtr = NULL; + currentPtr = *list; + + if((newPtr = (FILELIST *)__qmalloc(sizeof(FILELIST))) == NULL) + return false; + + strcpy(newPtr->filename, filename); + newPtr->offset = offset; + newPtr->size = size; + + while(currentPtr != NULL && stricmp(filename, currentPtr->filename) > 0) + { + previousPtr = currentPtr; + currentPtr = currentPtr->next; + } //End while + if(previousPtr == NULL) + { + newPtr->next = *list; + *list = newPtr; + } //End if + else + { + previousPtr->next = newPtr; + newPtr->next = currentPtr; + } //End else + return true; +} + +int PakLoadAnyFile(const char *filename, void **bufferptr) +{ + char cWork[WORK_LEN]; + if (g_bPK3) + { + // leo: hack to be able to use pak files from multiple directories + for (int i = 0; i < g_numBasePaths; i++) + { + PK3FileInfo *pInfo; + Str strKey; + // need to lookup the file without the base/texture path on it + Str strBase(g_strBasePaths[i]); + AddSlash(strBase); + __ConvertDOSToUnixName(cWork, strBase); + Str strFile(filename); + __ConvertDOSToUnixName(strFile, strFile); + strFile.MakeLower(); + strlwr(cWork); + FindReplace(strFile, cWork, ""); + + PK3FileInfo infoFind; + infoFind.m_pName = __StrDup(strFile.GetBuffer()); + PK3List *pList = g_PK3Files.Find(&infoFind); + if (pList) + { + pInfo = pList->Ptr(); + memcpy(pInfo->m_zFile, &pInfo->m_zInfo, sizeof(unz_s)); + if (unzOpenCurrentFile(pInfo->m_zFile) == UNZ_OK) + { + void *buffer = __qblockmalloc(pInfo->m_lSize+1); + int n = unzReadCurrentFile(pInfo->m_zFile , buffer, pInfo->m_lSize); + *bufferptr = buffer; + unzCloseCurrentFile(pInfo->m_zFile); + return n; + } + } + } + +#ifdef LOG_PAKFAIL + sprintf(cWork, "PAK failed on %s\n", filename); + g_LogFile.Log(cWork); +#endif + return -1; + } + + for (int i = 0; i < dirsize; i++) + { + if(!stricmp(filename, pakdirptr[i].name)) + { + if (fseek(pakfile[m_nPAKIndex], pakdirptr[i].offset, SEEK_SET) >= 0) + { + void *buffer = __qmalloc (pakdirptr[i].size+1); + ((char *)buffer)[pakdirptr[i].size] = 0; + if (fread(buffer, 1, pakdirptr[i].size, pakfile[m_nPAKIndex]) == pakdirptr[i].size) + { + *bufferptr = buffer; + return pakdirptr[i].size; + } + } + } + } +#ifdef LOG_PAKFAIL + sprintf(cWork, "PAK failed on %s\n", filename); + g_LogFile.Log(cWork); +#endif + return -1; +} + + + +DIRECTORY *AddPakDir(DIRECTORY **dir, char *name) +{ + DIRECTORY *currentPtr, *previousPtr, *newPtr; + + for(currentPtr = *dir; currentPtr; currentPtr = currentPtr->next) + { + if(!stricmp(name, currentPtr->name)) + { + return currentPtr; + } + } + previousPtr = NULL; + currentPtr = *dir; + + if((newPtr = (DIRECTORY *)__qmalloc(sizeof(DIRECTORY))) == NULL) + return NULL; + + strcpy(newPtr->name, name); + newPtr->files = NULL; + + while(currentPtr != NULL && stricmp(name, currentPtr->name) > 0) + { + previousPtr = currentPtr; + currentPtr = currentPtr->next; + } + if(previousPtr == NULL) + { + newPtr->next = *dir; + *dir = newPtr; + } + else + { + previousPtr->next = newPtr; + newPtr->next = currentPtr; + } + return newPtr; +} + + +// OpenPK3 +// ------- +// Opens a PK3 ( or zip ) file and creates a list of filenames +// and zip info structures +// +bool OpenPK3(const char *filename) +{ + char cFilename[WORK_LEN]; + char cName[WORK_LEN]; + char cWork[WORK_LEN]; + unz_file_info zInfo; + unzFile *zFile = new unzFile(unzOpen(filename)); + g_zFiles.Add(zFile); + if (zFile != NULL) + { + int nStatus = unzGoToFirstFile(*zFile); + while (nStatus == UNZ_OK) + { + cFilename[0] = '\0'; + unzGetCurrentFileInfo(*zFile, &zInfo, cFilename, WORK_LEN, NULL, 0, NULL, 0); + strlwr(cFilename); + __ConvertDOSToUnixName( cWork, cFilename); + if (strstr(cWork, ".") != NULL) + { + PK3FileInfo *pInfo = new PK3FileInfo(); + pInfo->m_pName = __StrDup(cWork); + memcpy(&pInfo->m_zInfo, (unz_s*)*zFile, sizeof(unz_s)); + pInfo->m_lSize = zInfo.uncompressed_size; + pInfo->m_zFile = *zFile; + g_PK3Files.Add(pInfo); + } + char *p = strstr(cFilename, TEXTURE_PATH); + if (p != NULL) + { + // FIXME: path differences per os ? + // catch solo directory entry + if (strlen(p) > strlen(TEXTURE_PATH) + 1) + { + // skip textures + path seperator + p += strlen(TEXTURE_PATH) + 1; + int nEnd = strcspn(p, PATH_SEPERATORS); + strncpy(cName, p, nEnd); + cName[nEnd] = '\0'; + + bool bFound = false; + StrList *pl = g_PK3TexturePaths.Next(); + while (pl != NULL) + { + if (strcmpi(pl->Ref(), cName) == 0) + { + // already have this, continue + bFound = true; + break; + } + pl = pl->Next(); + } + if (!bFound) + { + g_PK3TexturePaths.Add(new Str(cName)); + } + } + } + nStatus = unzGoToNextFile(*zFile); + } + } + return (zFile != NULL); +} + +void closePK3(unzFile zf) +{ + unzClose(zf); +} + +void OpenPakFile(const char *filename) +{ + if(!pakopen) + paktextures = NULL; + + pakopen = g_bPK3 = OpenPK3(filename); +} + +void ClearPaKDir(DIRECTORY **dir) +{ + DIRECTORY *d1 = *dir, *d2; + + while(d1) + { + ClearFileList(&(d1->files)); + d2 = d1; + d1 = d1->next; + free(d2); + } +} + +void CleanUpPakDirs() +{ + ClearPaKDir(&paktextures); + paktextures = NULL; + dirhead = NULL; + g_PK3TexturePaths.RemoveAll(); + g_PK3Files.RemoveAll(); +} + +void ClosePakFile(void) +{ + if(pakopen) + { + if (g_bPK3) + { + ZFileList *p = g_zFiles.Next(); + while (p != NULL) + { + unzFile uz = p->Ref(); + closePK3(uz); + p = p->Next(); + } + } + else + { + fclose(pakfile[m_nPAKIndex]); + } + } + pakopen = false; + CleanUpPakDirs(); +} + + +void WINAPI InitPakFile(const char * pBasePath, const char *pName) +{ + if (g_numBasePaths == 0) + { + m_nPAKIndex = 0; + pakopen = false; + paktextures = NULL; + } + strcpy(g_strBasePaths[g_numBasePaths], pBasePath); + g_numBasePaths++; + + if (pName == NULL) + { + //++timo FIXME: use some kind of compatibility lib here! +#if defined (__linux__) || defined (__APPLE__) + char cWork[WORK_LEN]; + struct dirent *dirlist; + DIR *dir; + + dir = opendir (pBasePath); + if (dir != NULL) + { + while ((dirlist = readdir (dir)) != NULL) + { + if (strstr (dirlist->d_name, ".pk3") == NULL) + continue; + sprintf(cWork, "%s/%s", pBasePath, dirlist->d_name); + OpenPakFile(cWork); + } + closedir (dir); + } +#endif +#ifdef _WIN32 + char cWork[WORK_LEN]; + Str strPath(pBasePath); + AddSlash(strPath); + strPath += "*.pk3"; + bool bGo = true; + struct _finddata_t fileinfo; + int handle = _findfirst (strPath, &fileinfo); + if (handle != -1) + { + do + { + sprintf(cWork, "%s/%s", pBasePath, fileinfo.name); + OpenPakFile(cWork); + } while (_findnext( handle, &fileinfo ) != -1); + _findclose (handle); + } +#endif + } + else + { + OpenPakFile(pName); + } +} + diff --git a/libs/pak/unzip.cpp b/libs/pak/unzip.cpp new file mode 100644 index 00000000..5cf24528 --- /dev/null +++ b/libs/pak/unzip.cpp @@ -0,0 +1,4534 @@ +/***************************************************************************** + * name: unzip.c + * + * desc: IO on .zip files using portions of zlib + * + * + *****************************************************************************/ + +#include +#include +#include +#include "unzip.h" + +typedef unsigned char byte; + +/* unzip.h -- IO for uncompress .zip files using zlib + Version 0.15 beta, Mar 19th, 1998, + + Copyright (C) 1998 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Encryption and multi volume ZipFile (span) are not supported. + Old compressions used by old PKZip 1.x are not supported + + THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE + CAN CHANGE IN FUTURE VERSION !! + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ +/* for more info about .ZIP format, see + ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip */ + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.3, July 9th, 1998 + + Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-1998 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +#define OF(args) args +#endif + +typedef unsigned char Byte; /* 8 bits */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ +typedef Byte *voidp; + +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#endif /* _ZCONF_H */ + +#define ZLIB_VERSION "1.1.3" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +const char * zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +int deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +int deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +int deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +int inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +int inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +int inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +int deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +int deflateSetDictionary OF((z_streamp strm, + const Byte *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +int deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +int deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +int deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +int inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +int inflateSetDictionary OF((z_streamp strm, + const Byte *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +int inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +int inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +int compress OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +int compress2 OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +int uncompress OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +gzFile gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +gzFile gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +int gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +int gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +int gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +int gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +int gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +char * gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +int gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +int gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +int gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +long gzseek OF((gzFile file, + long offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +int gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +long gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +int gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +int gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +const char * gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +uLong adler32 OF((uLong adler, const Byte *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +uLong crc32 OF((uLong crc, const Byte *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +// private stuff to not include cmdlib.h +/* +============================================================================ + + BYTE ORDER FUNCTIONS + +============================================================================ +*/ + +#ifdef _SGI_SOURCE +#define __BIG_ENDIAN__ +#endif + +#ifdef __BIG_ENDIAN__ + +short __LittleShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return (b1<<8) + b2; +} + +short __BigShort (short l) +{ + return l; +} + + +int __LittleLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int __BigLong (int l) +{ + return l; +} + + +float __LittleFloat (float l) +{ + union {byte b[4]; float f;} in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float __BigFloat (float l) +{ + return l; +} + + +#else + + +short __BigShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return (b1<<8) + b2; +} + +short __LittleShort (short l) +{ + return l; +} + + +int __BigLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int __LittleLong (int l) +{ + return l; +} + +float __BigFloat (float l) +{ + union {byte b[4]; float f;} in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float __LittleFloat (float l) +{ + return l; +} + + + +#endif + + + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +int deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +int inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +int deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +int inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +const char * zError OF((int err)); +int inflateSyncPoint OF((z_streamp z)); +const uLong * get_crc_table OF((void)); + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#define zmemcpy memcpy +#define zmemcmp memcmp +#define zmemzero(dest, len) memset(dest, 0, len) + +/* Diagnostic functions */ +#ifdef _ZIP_DEBUG_ + int z_verbose = 0; +# define Assert(cond,msg) assert(cond); + //{if(!(cond)) Sys_Error(msg);} +# define Trace(x) {if (z_verbose>=0) Sys_Error x ;} +# define Tracev(x) {if (z_verbose>0) Sys_Error x ;} +# define Tracevv(x) {if (z_verbose>1) Sys_Error x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) Sys_Error x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) Sys_Error x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (*check_func) OF((uLong check, const Byte *buf, uInt len)); +voidp zcalloc OF((voidp opaque, unsigned items, unsigned size)); +void zcfree OF((voidp opaque, voidp ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidp)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + + +#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \ + !defined(CASESENSITIVITYDEFAULT_NO) +#define CASESENSITIVITYDEFAULT_NO +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (65536) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + +/* +static int unzlocal_getByte(FILE *fin,int *pi) +{ + unsigned char c; + int err = fread(&c, 1, 1, fin); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ferror(fin)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} +*/ + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +static int unzlocal_getShort (FILE* fin, uLong *pX) +{ + short v; + + fread( &v, sizeof(v), 1, fin ); + + *pX = __LittleShort( v); + return UNZ_OK; + +/* + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +*/ +} + +static int unzlocal_getLong (FILE *fin, uLong *pX) +{ + int v; + + fread( &v, sizeof(v), 1, fin ); + + *pX = __LittleLong( v); + return UNZ_OK; + +/* + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +*/ +} + + +/* My own strcmpi / strcasecmp */ +static int strcmpcasenosensitive_internal (const char* fileName1,const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int unzStringFileNameCompare (const char* fileName1,const char* fileName2,int iCaseSensitivity) +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#define BUFREADCOMMENT (0x400) + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +static uLong unzlocal_SearchCentralDir(FILE *fin) +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (fseek(fin,0,SEEK_END) != 0) + return 0; + + + uSizeFile = ftell( fin ); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)malloc(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (fseek(fin,uReadPos,SEEK_SET)!=0) + break; + + if (fread(buf,(uInt)uReadSize,1,fin)!=1) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + free(buf); + return uPosFound; +} + +extern unzFile unzReOpen (const char* path, unzFile file) +{ + unz_s *s; + FILE * fin; + + fin=fopen(path,"rb"); + if (fin==NULL) + return NULL; + + s=(unz_s*)malloc(sizeof(unz_s)); + memcpy(s, (unz_s*)file, sizeof(unz_s)); + + s->file = fin; + return (unzFile)s; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer + "zlib/zlib109.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile unzOpen (const char* path) +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + FILE * fin ; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + fin=fopen(path,"rb"); + if (fin==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(fin); + if (central_pos==0) + err=UNZ_ERRNO; + + if (fseek(fin,central_pos,SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(fin,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + fclose(s->file); + free(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int unzGetGlobalInfo (unzFile file,unz_global_info *pglobal_info) +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +static void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm) +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +static int unzlocal_GetCurrentFileInfoInternal (unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extrafile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek += file_info.size_file_extra - uSizeRead; + } + else + lSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentfile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int unzGetCurrentFileInfo ( unzFile file, unz_file_info *pfile_info, + char *szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char *szComment, uLong commentBufferSize) +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int unzGoToFirstFile (unzFile file) +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int unzGoToNextFile (unzFile file) +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz_s* s; + int err; + + + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + return err; +} + + +/* + Read the static header of the current zipfile + Check the coherency of the static header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in static header + (filename and size of extra field data) +*/ +static int unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uInt* piSizeVar, + uLong *poffset_local_extrafield, + uInt *psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (fseek(s->file,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int unzOpenCurrentFile (unzFile file) +{ + int err=UNZ_OK; + int Store; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the static extra field */ + uInt size_local_extrafield; /* size of the static extra field */ + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + malloc(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)malloc(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + free(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + Store = s->cur_file_info.compression_method==0; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->file=s->file; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if (!Store) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidp)0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + + s->pfile_in_zip_read = pfile_in_zip_read_info; + return UNZ_OK; +} + + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int unzReadCurrentFile (unzFile file, void *buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Byte*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if (len>pfile_in_zip_read_info->rest_read_uncompressed) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (s->cur_file_info.compressed_size == pfile_in_zip_read_info->rest_read_compressed) + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1, + pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Byte*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if (pfile_in_zip_read_info->compression_method==0) + { + uInt uDoCopy,i ; + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Byte *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern long unztell (unzFile file) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (long)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int unzeof (unzFile file) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the static-header version of the extra field (sometimes, there is + more info in the static-header version than in the central-header) + + if buf==NULL, it return the size of the static extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int unzGetLocalExtrafield (unzFile file,void *buf,unsigned len) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + free(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + free(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf) +{ + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (fread(szComment,(uInt)uReadThis,1,s->file)!=1) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#ifdef DYNAMIC_CRC_TABLE + +static int crc_table_empty = 1; +static uLong crc_table[256]; +static void make_crc_table OF((void)); + +/* + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all + the information needed to generate CRC's on data a byte at a time for all + combinations of CRC register values and incoming bytes. +*/ +static void make_crc_table() +{ + uLong c; + int n, k; + uLong poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + + for (n = 0; n < 256; n++) + { + c = (uLong)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[n] = c; + } + crc_table_empty = 0; +} +#else +/* ======================================================================== + * Table of CRC-32's of all single-byte values (made by make_crc_table) + */ +static const uLong crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const uLong * get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) make_crc_table(); +#endif + return (const uLong *)crc_table; +} + +/* ========================================================================= */ +#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); +#define DO2(buf) DO1(buf); DO1(buf); +#define DO4(buf) DO2(buf); DO2(buf); +#define DO8(buf) DO4(buf); DO4(buf); + +/* ========================================================================= */ +uLong crc32(uLong crc, const Byte *buf, uInt len) +{ + if (buf == Z_NULL) return 0L; +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif + crc = crc ^ 0xffffffffL; + while (len >= 8) + { + DO8(buf); + len -= 8; + } + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; +} + +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_blocks_state; +typedef struct inflate_blocks_state inflate_blocks_statef; + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLong *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Byte *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* Table for deflate from PKZIP's appnote.txt. */ +static const uInt border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +typedef struct inflate_huft_s inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +extern int inflate_trees_bits OF(( + uInt *, /* 19 code lengths */ + uInt *, /* bits tree desired/actual depth */ + inflate_huft * *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uInt *, /* that many (total) code lengths */ + uInt *, /* literal desired/actual bit depth */ + uInt *, /* distance desired/actual bit depth */ + inflate_huft * *, /* literal/length tree result */ + inflate_huft * *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_fixed OF(( + uInt *, /* literal desired/actual bit depth */ + uInt *, /* distance desired/actual bit depth */ + inflate_huft * *, /* literal/length tree result */ + inflate_huft * *, /* distance tree result */ + z_streamp)); /* for memory allocation */ + + +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_codes_state; +typedef struct inflate_codes_state inflate_codes_statef; + +extern inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +extern int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +extern void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uInt *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Byte *window; /* sliding window */ + Byte *end; /* one byte after sliding window */ + Byte *read; /* window read pointer */ + Byte *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load static pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +extern uInt inflate_mask[17]; + +/* copy as much as possible from the sliding window to the output area */ +extern int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +#endif + + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + + +void inflate_blocks_reset(inflate_blocks_statef *s, z_streamp z, uLong *c) +{ + if (c != Z_NULL) + *c = s->check; + if (s->mode == BTREE || s->mode == DTREE) + ZFREE(z, s->sub.trees.blens); + if (s->mode == CODES) + inflate_codes_free(s->sub.decode.codes, z); + s->mode = TYPE; + s->bitk = 0; + s->bitb = 0; + s->read = s->write = s->window; + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0); + Tracev(("inflate: blocks reset\n")); +} + + +inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w) +{ + inflate_blocks_statef *s; + + if ((s = (inflate_blocks_statef *)ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + return s; + if ((s->hufts = + (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + { + ZFREE(z, s); + return Z_NULL; + } + if ((s->window = (Byte *)ZALLOC(z, 1, w)) == Z_NULL) + { + ZFREE(z, s->hufts); + ZFREE(z, s); + return Z_NULL; + } + s->end = s->window + w; + s->checkfn = c; + s->mode = TYPE; + Tracev(("inflate: blocks allocated\n")); + inflate_blocks_reset(s, z, Z_NULL); + return s; +} + + +int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input based on current state */ + while (1) switch (s->mode) + { + case TYPE: + NEEDBITS(3) + t = (uInt)b & 7; + s->last = t & 1; + switch (t >> 1) + { + case 0: /* stored */ + Tracev(("inflate: stored block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + t = k & 7; /* go to byte boundary */ + DUMPBITS(t) + s->mode = LENS; /* get length of stored block */ + break; + case 1: /* fixed */ + Tracev(("inflate: fixed codes block%s\n", + s->last ? " (last)" : "")); + { + uInt bl, bd; + inflate_huft *tl, *td; + + inflate_trees_fixed(&bl, &bd, &tl, &td, z); + s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + if (s->sub.decode.codes == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + } + DUMPBITS(3) + s->mode = CODES; + break; + case 2: /* dynamic */ + Tracev(("inflate: dynamic codes block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + s->mode = TABLE; + break; + case 3: /* illegal */ + DUMPBITS(3) + s->mode = BAD; + z->msg = (char*)"invalid block type"; + r = Z_DATA_ERROR; + LEAVE + } + break; + case LENS: + NEEDBITS(32) + if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) + { + s->mode = BAD; + z->msg = (char*)"invalid stored block lengths"; + r = Z_DATA_ERROR; + LEAVE + } + s->sub.left = (uInt)b & 0xffff; + b = k = 0; /* dump bits */ + Tracev(("inflate: stored length %u\n", s->sub.left)); + s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); + break; + case STORED: + if (n == 0) + LEAVE + NEEDOUT + t = s->sub.left; + if (t > n) t = n; + if (t > m) t = m; + zmemcpy(q, p, t); + p += t; n -= t; + q += t; m -= t; + if ((s->sub.left -= t) != 0) + break; + Tracev(("inflate: stored end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + s->mode = s->last ? DRY : TYPE; + break; + case TABLE: + NEEDBITS(14) + s->sub.trees.table = t = (uInt)b & 0x3fff; +#ifndef PKZIP_BUG_WORKAROUND + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + s->mode = BAD; + z->msg = (char*)"too many length or distance symbols"; + r = Z_DATA_ERROR; + LEAVE + } +#endif + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if ((s->sub.trees.blens = (uInt*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + DUMPBITS(14) + s->sub.trees.index = 0; + Tracev(("inflate: table sizes ok\n")); + s->mode = BTREE; + case BTREE: + while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) + { + NEEDBITS(3) + s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; + DUMPBITS(3) + } + while (s->sub.trees.index < 19) + s->sub.trees.blens[border[s->sub.trees.index++]] = 0; + s->sub.trees.bb = 7; + t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + &s->sub.trees.tb, s->hufts, z); + if (t != Z_OK) + { + ZFREE(z, s->sub.trees.blens); + r = t; + if (r == Z_DATA_ERROR) + s->mode = BAD; + LEAVE + } + s->sub.trees.index = 0; + Tracev(("inflate: bits tree ok\n")); + s->mode = DTREE; + case DTREE: + while (t = s->sub.trees.table, + s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) + { + inflate_huft *h; + uInt i, j, c; + + t = s->sub.trees.bb; + NEEDBITS(t) + h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + t = h->bits; + c = h->base; + if (c < 16) + { + DUMPBITS(t) + s->sub.trees.blens[s->sub.trees.index++] = c; + } + else /* c == 16..18 */ + { + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + NEEDBITS(t + i) + DUMPBITS(t) + j += (uInt)b & inflate_mask[i]; + DUMPBITS(i) + i = s->sub.trees.index; + t = s->sub.trees.table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + z->msg = (char*)"invalid bit length repeat"; + r = Z_DATA_ERROR; + LEAVE + } + c = c == 16 ? s->sub.trees.blens[i - 1] : 0; + do { + s->sub.trees.blens[i++] = c; + } while (--j); + s->sub.trees.index = i; + } + } + s->sub.trees.tb = Z_NULL; + { + uInt bl, bd; + inflate_huft *tl, *td; + inflate_codes_statef *c; + + bl = 9; /* must be <= 9 for lookahead assumptions */ + bd = 6; /* must be <= 9 for lookahead assumptions */ + t = s->sub.trees.table; + t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + s->sub.trees.blens, &bl, &bd, &tl, &td, + s->hufts, z); + ZFREE(z, s->sub.trees.blens); + if (t != Z_OK) + { + if (t == (uInt)Z_DATA_ERROR) + s->mode = BAD; + r = t; + LEAVE + } + Tracev(("inflate: trees ok\n")); + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + s->sub.decode.codes = c; + } + s->mode = CODES; + case CODES: + UPDATE + if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + return inflate_flush(s, z, r); + r = Z_OK; + inflate_codes_free(s->sub.decode.codes, z); + LOAD + Tracev(("inflate: codes end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + if (!s->last) + { + s->mode = TYPE; + break; + } + s->mode = DRY; + case DRY: + FLUSH + if (s->read != s->write) + LEAVE + s->mode = DONE; + case DONE: + r = Z_STREAM_END; + LEAVE + case BAD: + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +} + + +int inflate_blocks_free(inflate_blocks_statef *s, z_streamp z) +{ + inflate_blocks_reset(s, z, Z_NULL); + ZFREE(z, s->window); + ZFREE(z, s->hufts); + ZFREE(z, s); + Tracev(("inflate: blocks freed\n")); + return Z_OK; +} + + +void inflate_set_dictionary(inflate_blocks_statef *s, const Byte *d, uInt n) +{ + zmemcpy(s->window, d, n); + s->read = s->write = s->window + n; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. + * IN assertion: s != Z_NULL + */ +int inflate_blocks_sync_point(inflate_blocks_statef *s) +{ + return s->mode == LENS; +} + +/* And'ing with mask[n] masks the lower n bits */ +uInt inflate_mask[17] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +/* copy as much as possible from the sliding window to the output area */ +int inflate_flush(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt n; + Byte *p; + Byte *q; + + /* static copies of source and destination pointers */ + p = z->next_out; + q = s->read; + + /* compute number of bytes to copy as as end of window */ + n = (uInt)((q <= s->write ? s->write : s->end) - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy as as end of window */ + zmemcpy(p, q, n); + p += n; + q += n; + + /* see if more to copy at beginning of window */ + if (q == s->end) + { + /* wrap pointers */ + q = s->window; + if (s->write == s->end) + s->write = s->window; + + /* compute bytes to copy */ + n = (uInt)(s->write - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy */ + zmemcpy(p, q, n); + p += n; + q += n; + } + + /* update pointers */ + z->next_out = p; + s->read = q; + + /* done */ + return r; +} + +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +const char inflate_copyright[] = + " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + + +static int huft_build OF(( + uInt *, /* code lengths in bits */ + uInt, /* number of codes */ + uInt, /* number of "simple" codes */ + const uInt *, /* list of base values for non-simple codes */ + const uInt *, /* list of extra bits for non-simple codes */ + inflate_huft **, /* result: starting table */ + uInt *, /* maximum lookup bits (returns actual) */ + inflate_huft *, /* space for trees */ + uInt *, /* hufts used in space */ + uInt * )); /* space for values */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +static const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* see note #13 above about 258 */ +static const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ +static const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +static const uInt cpdext[30] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ +#define BMAX 15 /* maximum bit length of any code */ + +static int huft_build(uInt *b, uInt n, uInt s, const uInt *d, const uInt *e, inflate_huft ** t, uInt *m, inflate_huft *hp, uInt *hn, uInt *v) +//uInt *b; /* code lengths in bits (all assumed <= BMAX) */ +//uInt n; /* number of codes (assumed <= 288) */ +//uInt s; /* number of simple-valued codes (0..s-1) */ +//const uInt *d; /* list of base values for non-simple codes */ +//const uInt *e; /* list of extra bits for non-simple codes */ +//inflate_huft ** t; /* result: starting table */ +//uInt *m; /* maximum lookup bits, returns actual */ +//inflate_huft *hp; /* space for trees */ +//uInt *hn; /* hufts used in space */ +//uInt *v; /* working area: values in order of bit length */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + if the given code set is incomplete (the tables are still built in this + case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + lengths), or Z_MEM_ERROR if not enough memory. */ +{ + + uInt a; /* counter for codes of length k */ + uInt c[BMAX+1]; /* bit length count table */ + uInt f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register uInt i; /* counter, current code */ + register uInt j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ + register uInt *p; /* pointer into c[], b[], or v[] */ + inflate_huft *q; /* points to current table */ + struct inflate_huft_s r; /* table entry for structure assignment */ + inflate_huft *u[BMAX]; /* table stack */ + register int w; /* bits before this table == (l * h) */ + uInt x[BMAX+1]; /* bit offsets, then code stack */ + uInt *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + uInt z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + p = c; +#define C0 *p++ = 0; +#define C2 C0 C0 C0 C0 +#define C4 C2 C2 C2 C2 + C4 /* clear c[]--assume BMAX+1 is 16 */ + p = b; i = n; + do { + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (inflate_huft *)Z_NULL; + *m = 0; + return Z_OK; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((uInt)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((uInt)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return Z_DATA_ERROR; + if ((y -= c[i]) < 0) + return Z_DATA_ERROR; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)Z_NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = g - w; + z = z > (uInt)l ? l : z; /* table size upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate new table */ + if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ + return Z_MEM_ERROR; /* not enough memory */ + u[h] = q = hp + *hn; + *hn += z; + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.bits = (Byte)l; /* bits to dump before this table */ + r.exop = (Byte)j; /* bits in this table */ + j = i >> (w - l); + r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ + u[h-1][j] = r; /* connect to last table */ + } + else + *t = q; /* first table is returned result */ + } + + /* set up table entry in r */ + r.bits = (Byte)(k - w); + if (p >= v + n) + r.exop = 128 + 64; /* out of values--invalid code */ + else if (*p < s) + { + r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ + r.base = *p++; /* simple code is just the value */ + } + else + { + r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ + r.base = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + mask = (1 << w) - 1; /* needed on HP, cc -O bug */ + while ((i & mask) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + mask = (1 << w) - 1; + } + } + } + + + /* Return Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; +} + + +int inflate_trees_bits(uInt *c, uInt *bb, inflate_huft * *tb, inflate_huft *hp, z_streamp z) +//uInt *c; /* 19 code lengths */ +//uInt *bb; /* bits tree desired/actual depth */ +//inflate_huft * *tb; /* bits tree result */ +//inflate_huft *hp; /* space for trees */ +//z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uInt *v; /* work area for huft_build */ + + if ((v = (uInt*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uInt*)Z_NULL, (uInt*)Z_NULL, + tb, bb, hp, &hn, v); + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed dynamic bit lengths tree"; + else if (r == Z_BUF_ERROR || *bb == 0) + { + z->msg = (char*)"incomplete dynamic bit lengths tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +} + + +int inflate_trees_dynamic(uInt nl, uInt nd, uInt *c, uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, inflate_huft *hp, z_streamp z) +//uInt nl; /* number of literal/length codes */ +//uInt nd; /* number of distance codes */ +//uInt *c; /* that many (total) code lengths */ +//uInt *bl; /* literal desired/actual bit depth */ +//uInt *bd; /* distance desired/actual bit depth */ +//inflate_huft * *tl; /* literal/length tree result */ +//inflate_huft * *td; /* distance tree result */ +//inflate_huft *hp; /* space for trees */ +//z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uInt *v; /* work area for huft_build */ + + /* allocate work area */ + if ((v = (uInt*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + + /* build literal/length tree */ + r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); + if (r != Z_OK || *bl == 0) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed literal/length tree"; + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"incomplete literal/length tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; + } + + /* build distance tree */ + r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); + if (r != Z_OK || (*bd == 0 && nl > 257)) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed distance tree"; + else if (r == Z_BUF_ERROR) { +#ifdef PKZIP_BUG_WORKAROUND + r = Z_OK; + } +#else + z->msg = (char*)"incomplete distance tree"; + r = Z_DATA_ERROR; + } + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"empty distance tree with lengths"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +#endif + } + + /* done */ + ZFREE(z, v); + return Z_OK; +} + +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +static uInt fixed_bl = 9; +static uInt fixed_bd = 5; +static inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +static inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; + +int inflate_trees_fixed(uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, z_streamp z) +//uInt *bl; /* literal desired/actual bit depth */ +//uInt *bd; /* distance desired/actual bit depth */ +//inflate_huft * *tl; /* literal/length tree result */ +//inflate_huft * *td; /* distance tree result */ +//z_streamp z; /* for memory allocation */ +{ + *bl = fixed_bl; + *bd = fixed_bd; + *tl = fixed_tl; + *td = fixed_td; + return Z_OK; +} + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* macros for bit input with no checking and for returning unused bytes */ +#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;} + +/* Called with number of bytes left to write in window at least 258 + (the maximum string length) and number of input bytes available + at least ten. The ten bytes are six bytes for the longest length/ + distance pair plus four bytes for overloading the bit buffer. */ + +int inflate_fast(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, inflate_blocks_statef *s, z_streamp z) +{ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + uInt ml; /* mask for literal/length tree */ + uInt md; /* mask for distance tree */ + uInt c; /* bytes to copy */ + uInt d; /* distance back to copy from */ + Byte *r; /* copy source pointer */ + + /* load input, output, bit values */ + LOAD + + /* initialize masks */ + ml = inflate_mask[bl]; + md = inflate_mask[bd]; + + /* do until not enough input or output space for fast loop */ + do { /* assume called with m >= 258 && n >= 10 */ + /* get literal/length code */ + GRABBITS(20) /* max bits for literal/length code */ + if ((e = (t = tl + ((uInt)b & ml))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + continue; + } + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits for length */ + e &= 15; + c = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv(("inflate: * length %u\n", c)); + + /* decode distance base of block to copy */ + GRABBITS(15); /* max bits for distance code */ + e = (t = td + ((uInt)b & md))->exop; + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits to add to distance base */ + e &= 15; + GRABBITS(e) /* get extra bits (up to 13) */ + d = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv(("inflate: * distance %u\n", d)); + + /* do the copy */ + m -= c; + if ((uInt)(q - s->window) >= d) /* offset before dest */ + { /* just copy */ + r = q - d; + *q++ = *r++; c--; /* minimum count is three, */ + *q++ = *r++; c--; /* so unroll loop a little */ + } + else /* else offset after destination */ + { + e = d - (uInt)(q - s->window); /* bytes from offset to end */ + r = s->end - e; /* pointer to offset */ + if (c > e) /* if source crosses, */ + { + c -= e; /* copy to end of window */ + do { + *q++ = *r++; + } while (--e); + r = s->window; /* copy rest from start of window */ + } + } + do { /* copy all or what's left */ + *q++ = *r++; + } while (--c); + break; + } + else if ((e & 64) == 0) + { + t += t->base; + e = (t += ((uInt)b & inflate_mask[e]))->exop; + } + else + { + z->msg = (char*)"invalid distance code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + break; + } + if ((e & 64) == 0) + { + t += t->base; + if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + break; + } + } + else if (e & 32) + { + Tracevv(("inflate: * end of block\n")); + UNGRAB + UPDATE + return Z_STREAM_END; + } + else + { + z->msg = (char*)"invalid literal/length code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + } while (m >= 258 && n >= 10); + + /* not enough input or output--restore pointers and return */ + UNGRAB + UPDATE + return Z_OK; +} + +/* infcodes.c -- process literals and length/distance pairs + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + START, /* x: set up for LEN */ + LEN, /* i: get length/literal/eob next */ + LENEXT, /* i: getting length extra (have base) */ + DIST, /* i: get distance next */ + DISTEXT, /* i: getting distance extra */ + COPY, /* o: copying bytes in window, waiting for space */ + LIT, /* o: got literal, waiting for output space */ + WASH, /* o: got eob, possibly still output waiting */ + END, /* x: got eob and all data flushed */ + BADCODE} /* x: got error */ +inflate_codes_mode; + +/* inflate codes private state */ +struct inflate_codes_state { + + /* mode */ + inflate_codes_mode mode; /* current inflate_codes mode */ + + /* mode dependent information */ + uInt len; + union { + struct { + inflate_huft *tree; /* pointer into tree */ + uInt need; /* bits needed */ + } code; /* if LEN or DIST, where in tree */ + uInt lit; /* if LIT, literal */ + struct { + uInt get; /* bits to get for extra */ + uInt dist; /* distance back to copy from */ + } copy; /* if EXT or COPY, where and how much */ + } sub; /* submode */ + + /* mode independent information */ + Byte lbits; /* ltree bits decoded per branch */ + Byte dbits; /* dtree bits decoder per branch */ + inflate_huft *ltree; /* literal/length/eob tree */ + inflate_huft *dtree; /* distance tree */ + +}; + + +inflate_codes_statef *inflate_codes_new(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, z_streamp z) +{ + inflate_codes_statef *c; + + if ((c = (inflate_codes_statef *) + ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + { + c->mode = START; + c->lbits = (Byte)bl; + c->dbits = (Byte)bd; + c->ltree = tl; + c->dtree = td; + Tracev(("inflate: codes new\n")); + } + return c; +} + + +int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt j; /* temporary storage */ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + Byte *f; /* pointer to copy strings from */ + inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input and output based on current state */ + while (1) switch (c->mode) + { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + case START: /* x: set up for LEN */ +#ifndef SLOW + if (m >= 258 && n >= 10) + { + UPDATE + r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + LOAD + if (r != Z_OK) + { + c->mode = r == Z_STREAM_END ? WASH : BADCODE; + break; + } + } +#endif /* !SLOW */ + c->sub.code.need = c->lbits; + c->sub.code.tree = c->ltree; + c->mode = LEN; + case LEN: /* i: get length/literal/eob next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e == 0) /* literal */ + { + c->sub.lit = t->base; + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", t->base)); + c->mode = LIT; + break; + } + if (e & 16) /* length */ + { + c->sub.copy.get = e & 15; + c->len = t->base; + c->mode = LENEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + if (e & 32) /* end of block */ + { + Tracevv(("inflate: end of block\n")); + c->mode = WASH; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid literal/length code"; + r = Z_DATA_ERROR; + LEAVE + case LENEXT: /* i: getting length extra (have base) */ + j = c->sub.copy.get; + NEEDBITS(j) + c->len += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + c->sub.code.need = c->dbits; + c->sub.code.tree = c->dtree; + Tracevv(("inflate: length %u\n", c->len)); + c->mode = DIST; + case DIST: /* i: get distance next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e & 16) /* distance */ + { + c->sub.copy.get = e & 15; + c->sub.copy.dist = t->base; + c->mode = DISTEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid distance code"; + r = Z_DATA_ERROR; + LEAVE + case DISTEXT: /* i: getting distance extra */ + j = c->sub.copy.get; + NEEDBITS(j) + c->sub.copy.dist += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + Tracevv(("inflate: distance %u\n", c->sub.copy.dist)); + c->mode = COPY; + case COPY: /* o: copying bytes in window, waiting for space */ +#ifndef __TURBOC__ /* Turbo C bug for following expression */ + f = (uInt)(q - s->window) < c->sub.copy.dist ? + s->end - (c->sub.copy.dist - (q - s->window)) : + q - c->sub.copy.dist; +#else + f = q - c->sub.copy.dist; + if ((uInt)(q - s->window) < c->sub.copy.dist) + f = s->end - (c->sub.copy.dist - (uInt)(q - s->window)); +#endif + while (c->len) + { + NEEDOUT + OUTBYTE(*f++) + if (f == s->end) + f = s->window; + c->len--; + } + c->mode = START; + break; + case LIT: /* o: got literal, waiting for output space */ + NEEDOUT + OUTBYTE(c->sub.lit) + c->mode = START; + break; + case WASH: /* o: got eob, possibly more output */ + if (k > 7) /* return unused byte, if any */ + { + Assert(k < 16, "inflate_codes grabbed too many bytes") + k -= 8; + n++; + p--; /* can always return one */ + } + FLUSH + if (s->read != s->write) + LEAVE + c->mode = END; + case END: + r = Z_STREAM_END; + LEAVE + case BADCODE: /* x: got error */ + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +void inflate_codes_free(inflate_codes_statef *c, z_streamp z) +{ + ZFREE(z, c); + Tracev(("inflate: codes free\n")); +} + +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#undef DO1 +#undef DO2 +#undef DO4 +#undef DO8 + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +uLong adler32(uLong adler, const Byte *buf, uInt len) +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} + +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLong *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Byte *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); + +typedef enum { + imMETHOD, /* waiting for method byte */ + imFLAG, /* waiting for flag byte */ + imDICT4, /* four dictionary check bytes to go */ + imDICT3, /* three dictionary check bytes to go */ + imDICT2, /* two dictionary check bytes to go */ + imDICT1, /* one dictionary check byte to go */ + imDICT0, /* waiting for inflateSetDictionary */ + imBLOCKS, /* decompressing blocks */ + imCHECK4, /* four check bytes to go */ + imCHECK3, /* three check bytes to go */ + imCHECK2, /* two check bytes to go */ + imCHECK1, /* one check byte to go */ + imDONE, /* finished check, done */ + imBAD} /* got an error--stay here */ +inflate_mode; + +/* inflate private state */ +struct internal_state { + + /* mode */ + inflate_mode mode; /* current inflate mode */ + + /* mode dependent information */ + union { + uInt method; /* if FLAGS, method byte */ + struct { + uLong was; /* computed check value */ + uLong need; /* stream check value */ + } check; /* if CHECK, check values to compare */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ + } sub; /* submode */ + + /* mode independent information */ + int nowrap; /* flag for no wrapper */ + uInt wbits; /* log2(window size) (8..15, defaults to 15) */ + inflate_blocks_statef + *blocks; /* current inflate_blocks state */ + +}; + + +int inflateReset(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + z->total_in = z->total_out = 0; + z->msg = Z_NULL; + z->state->mode = z->state->nowrap ? imBLOCKS : imMETHOD; + inflate_blocks_reset(z->state->blocks, z, Z_NULL); + Tracev(("inflate: reset\n")); + return Z_OK; +} + + +int inflateEnd(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->blocks != Z_NULL) + inflate_blocks_free(z->state->blocks, z); + ZFREE(z, z->state); + z->state = Z_NULL; + Tracev(("inflate: end\n")); + return Z_OK; +} + + + +int inflateInit2_(z_streamp z, int w, const char *version, int stream_size) +{ + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != sizeof(z_stream)) + return Z_VERSION_ERROR; + + /* initialize state */ + if (z == Z_NULL) + return Z_STREAM_ERROR; + z->msg = Z_NULL; + if (z->zalloc == Z_NULL) + { + z->zalloc = (void *(*)(void *, unsigned, unsigned))zcalloc; + z->opaque = (voidp)0; + } + if (z->zfree == Z_NULL) z->zfree = (void (*)(void *, void *))zcfree; + if ((z->state = (struct internal_state *) + ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) + return Z_MEM_ERROR; + z->state->blocks = Z_NULL; + + /* handle undocumented nowrap option (no zlib header or check) */ + z->state->nowrap = 0; + if (w < 0) + { + w = - w; + z->state->nowrap = 1; + } + + /* set window size */ + if (w < 8 || w > 15) + { + inflateEnd(z); + return Z_STREAM_ERROR; + } + z->state->wbits = (uInt)w; + + /* create inflate_blocks state */ + if ((z->state->blocks = + inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + == Z_NULL) + { + inflateEnd(z); + return Z_MEM_ERROR; + } + Tracev(("inflate: allocated\n")); + + /* reset state */ + inflateReset(z); + return Z_OK; +} + + +int inflateInit_(z_streamp z, const char *version, int stream_size) +{ + return inflateInit2_(z, DEF_WBITS, version, stream_size); +} + + +#define iNEEDBYTE {if(z->avail_in==0)return r;r=f;} +#define iNEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) + +int inflate(z_streamp z, int f) +{ + int r; + uInt b; + + if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) + return Z_STREAM_ERROR; + f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; + r = Z_BUF_ERROR; + while (1) switch (z->state->mode) + { + case imMETHOD: + iNEEDBYTE + if (((z->state->sub.method = iNEXTBYTE) & 0xf) != Z_DEFLATED) + { + z->state->mode = imBAD; + z->msg = (char*)"unknown compression method"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + if ((z->state->sub.method >> 4) + 8 > z->state->wbits) + { + z->state->mode = imBAD; + z->msg = (char*)"invalid window size"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + z->state->mode = imFLAG; + case imFLAG: + iNEEDBYTE + b = iNEXTBYTE; + if (((z->state->sub.method << 8) + b) % 31) + { + z->state->mode = imBAD; + z->msg = (char*)"incorrect header check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev(("inflate: zlib header ok\n")); + if (!(b & PRESET_DICT)) + { + z->state->mode = imBLOCKS; + break; + } + z->state->mode = imDICT4; + case imDICT4: + iNEEDBYTE + z->state->sub.check.need = (uLong)iNEXTBYTE << 24; + z->state->mode = imDICT3; + case imDICT3: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 16; + z->state->mode = imDICT2; + case imDICT2: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 8; + z->state->mode = imDICT1; + case imDICT1: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE; + z->adler = z->state->sub.check.need; + z->state->mode = imDICT0; + return Z_NEED_DICT; + case imDICT0: + z->state->mode = imBAD; + z->msg = (char*)"need dictionary"; + z->state->sub.marker = 0; /* can try inflateSync */ + return Z_STREAM_ERROR; + case imBLOCKS: + r = inflate_blocks(z->state->blocks, z, r); + if (r == Z_DATA_ERROR) + { + z->state->mode = imBAD; + z->state->sub.marker = 0; /* can try inflateSync */ + break; + } + if (r == Z_OK) + r = f; + if (r != Z_STREAM_END) + return r; + r = f; + inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + if (z->state->nowrap) + { + z->state->mode = imDONE; + break; + } + z->state->mode = imCHECK4; + case imCHECK4: + iNEEDBYTE + z->state->sub.check.need = (uLong)iNEXTBYTE << 24; + z->state->mode = imCHECK3; + case imCHECK3: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 16; + z->state->mode = imCHECK2; + case imCHECK2: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 8; + z->state->mode = imCHECK1; + case imCHECK1: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE; + + if (z->state->sub.check.was != z->state->sub.check.need) + { + z->state->mode = imBAD; + z->msg = (char*)"incorrect data check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev(("inflate: zlib check ok\n")); + z->state->mode = imDONE; + case imDONE: + return Z_STREAM_END; + case imBAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +int inflateSetDictionary(z_streamp z, const Byte *dictionary, uInt dictLength) +{ + uInt length = dictLength; + + if (z == Z_NULL || z->state == Z_NULL || z->state->mode != imDICT0) + return Z_STREAM_ERROR; + + if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; + z->adler = 1L; + + if (length >= ((uInt)1<state->wbits)) + { + length = (1<state->wbits)-1; + dictionary += dictLength - length; + } + inflate_set_dictionary(z->state->blocks, dictionary, length); + z->state->mode = imBLOCKS; + return Z_OK; +} + + +int inflateSync(z_streamp z) +{ + uInt n; /* number of bytes to look at */ + Byte *p; /* pointer to bytes */ + uInt m; /* number of marker bytes found in a row */ + uLong r, w; /* temporaries to save total_in and total_out */ + + /* set up */ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->mode != imBAD) + { + z->state->mode = imBAD; + z->state->sub.marker = 0; + } + if ((n = z->avail_in) == 0) + return Z_BUF_ERROR; + p = z->next_in; + m = z->state->sub.marker; + + /* search */ + while (n && m < 4) + { + static const Byte mark[4] = {0, 0, 0xff, 0xff}; + if (*p == mark[m]) + m++; + else if (*p) + m = 0; + else + m = 4 - m; + p++, n--; + } + + /* restore */ + z->total_in += p - z->next_in; + z->next_in = p; + z->avail_in = n; + z->state->sub.marker = m; + + /* return no joy or set up to restart on a new block */ + if (m != 4) + return Z_DATA_ERROR; + r = z->total_in; w = z->total_out; + inflateReset(z); + z->total_in = r; z->total_out = w; + z->state->mode = imBLOCKS; + return Z_OK; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + * but removes the length bytes of the resulting empty stored block. When + * decompressing, PPP checks that at the end of input packet, inflate is + * waiting for these length bytes. + */ +int inflateSyncPoint(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL) + return Z_STREAM_ERROR; + return inflate_blocks_sync_point(z->state->blocks); +} + +voidp zcalloc (voidp opaque, unsigned items, unsigned size) +{ + if (opaque) items += size - size; /* make compiler happy */ + return (voidp)malloc(items*size); +} + +void zcfree (voidp opaque, voidp ptr) +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + diff --git a/libs/pak/unzip.h b/libs/pak/unzip.h new file mode 100644 index 00000000..79a487e3 --- /dev/null +++ b/libs/pak/unzip.h @@ -0,0 +1,300 @@ + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef void* unzFile; +#endif + + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + unsigned int tm_sec; /* seconds after the minute - [0,59] */ + unsigned int tm_min; /* minutes after the hour - [0,59] */ + unsigned int tm_hour; /* hours since midnight - [0,23] */ + unsigned int tm_mday; /* day of the month - [1,31] */ + unsigned int tm_mon; /* months since January - [0,11] */ + unsigned int tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + unsigned long number_entry; /* total number of entries in the central dir on this disk */ + unsigned long size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + unsigned long version; /* version made by 2 unsigned chars */ + unsigned long version_needed; /* version needed to extract 2 unsigned chars */ + unsigned long flag; /* general purpose bit flag 2 unsigned chars */ + unsigned long compression_method; /* compression method 2 unsigned chars */ + unsigned long dosDate; /* last mod file date in Dos fmt 4 unsigned chars */ + unsigned long crc; /* crc-32 4 unsigned chars */ + unsigned long compressed_size; /* compressed size 4 unsigned chars */ + unsigned long uncompressed_size; /* uncompressed size 4 unsigned chars */ + unsigned long size_filename; /* filename length 2 unsigned chars */ + unsigned long size_file_extra; /* extra field length 2 unsigned chars */ + unsigned long size_file_comment; /* file comment length 2 unsigned chars */ + + unsigned long disk_num_start; /* disk number start 2 unsigned chars */ + unsigned long internal_fa; /* internal file attributes 2 unsigned chars */ + unsigned long external_fa; /* external file attributes 4 unsigned chars */ + + tm_unz tmu_date; +} unz_file_info; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + unsigned long offset_curfile;/* relative offset of static header 4 unsigned chars */ +} unz_file_info_internal; + +typedef void* (*alloc_func) (void* opaque, unsigned int items, unsigned int size); +typedef void (*free_func) (void* opaque, void* address); + +struct internal_state; + +typedef struct z_stream_s { + unsigned char *next_in; /* next input unsigned char */ + unsigned int avail_in; /* number of unsigned chars available at next_in */ + unsigned long total_in; /* total nb of input unsigned chars read so */ + + unsigned char *next_out; /* next output unsigned char should be put there */ + unsigned int avail_out; /* remaining free space at next_out */ + unsigned long total_out; /* total nb of unsigned chars output so */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + unsigned char* opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + unsigned long adler; /* adler32 value of the uncompressed data */ + unsigned long reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream *z_streamp; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + unsigned long pos_in_zipfile; /* position in unsigned char on the zipfile, for fseek*/ + unsigned long stream_initialised; /* flag set if stream structure is initialised*/ + + unsigned long offset_local_extrafield;/* offset of the static extra field */ + unsigned int size_local_extrafield;/* size of the static extra field */ + unsigned long pos_local_extrafield; /* position in the static extra field in read*/ + + unsigned long crc32; /* crc32 of all data uncompressed */ + unsigned long crc32_wait; /* crc32 we must obtain after decompress all */ + unsigned long rest_read_compressed; /* number of unsigned char to be decompressed */ + unsigned long rest_read_uncompressed;/*number of unsigned char to be obtained after decomp*/ + FILE* file; /* io structore of the zipfile */ + unsigned long compression_method; /* compression method (0==store) */ + unsigned long byte_before_the_zipfile;/* unsigned char before the zipfile, (>0 for sfx)*/ +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + FILE* file; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + unsigned long byte_before_the_zipfile;/* unsigned char before the zipfile, (>0 for sfx)*/ + unsigned long num_file; /* number of the current file in the zipfile*/ + unsigned long pos_in_central_dir; /* pos of the current file in the central dir*/ + unsigned long current_file_ok; /* flag about the usability of the current file*/ + unsigned long central_pos; /* position of the beginning of the central dir*/ + + unsigned long size_central_dir; /* size of the central directory */ + unsigned long offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ +} unz_s; + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +#define UNZ_CASESENSITIVE 1 +#define UNZ_NOTCASESENSITIVE 2 +#define UNZ_OSDEFAULTCASE 0 + +extern int unzStringFileNameCompare (const char* fileName1, const char* fileName2, int iCaseSensitivity); + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + +extern unzFile unzOpen (const char *path); +extern unzFile unzReOpen (const char* path, unzFile file); + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer + "zlib/zlib111.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern int unzClose (unzFile file); + +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info); + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int unzGetGlobalComment (unzFile file, char *szComment, unsigned long uSizeBuf); + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of unsigned char copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int unzGoToFirstFile (unzFile file); + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int unzGoToNextFile (unzFile file); + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity); + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +extern int unzGetCurrentFileInfo (unzFile file, unz_file_info *pfile_info, char *szFileName, unsigned long fileNameBufferSize, void *extraField, unsigned long extraFieldBufferSize, char *szComment, unsigned long commentBufferSize); + +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int unzOpenCurrentFile (unzFile file); + +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int unzCloseCurrentFile (unzFile file); + +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + + +extern int unzReadCurrentFile (unzFile file, void* buf, unsigned len); + +/* + Read unsigned chars from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of unsigned char copied if somes unsigned chars are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern long unztell(unzFile file); + +/* + Give the current position in uncompressed data +*/ + +extern int unzeof (unzFile file); + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int unzGetLocalExtrafield (unzFile file, void* buf, unsigned len); + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of unsigned chars copied in buf, or (if <0) + the error code +*/ diff --git a/libs/pakstuff.h b/libs/pakstuff.h new file mode 100644 index 00000000..340e8798 --- /dev/null +++ b/libs/pakstuff.h @@ -0,0 +1,150 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _PAKSTUFF_H_ +#define _PAKSTUFF_H_ + +#ifndef _WIN32 +#define WINAPI +#else +#include +#endif + +#ifndef __cplusplus +typedef int bool; // leo +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef char Int8; +typedef short Int16; +typedef long Int32; +typedef unsigned char UInt8; +typedef unsigned short UInt16; +typedef unsigned long UInt32; +typedef float Float32; +typedef double Float64; +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define RANDOM(x) (random() % (x)) +#define RANDOMIZE() srand((int) time(NULL)) + +#define FTYPE_UNKNOWN 0 +#define FTYPE_IWAD 1 /* .wad "IWAD" */ +#define FTYPE_PWAD 2 /* .wad "PWAD" */ +#define FTYPE_PACK 3 /* .pak "PACK" */ +#define FTYPE_WAD2 4 /* .wad "WAD2" */ +#define FTYPE_BSP 10 /* .bsp (0x17 0x00 0x00 0x00) */ +#define FTYPE_MODEL 11 /* .mdl "IDPO" */ +#define FTYPE_SPRITE 12 /* .spr "IDSP" */ +#define FTYPE_WAV 20 /* .wav "RIFF" */ +#define FTYPE_AU 21 /* .au ".snd" */ +#define FTYPE_VOC 22 /* .voc ? */ +#define FTYPE_PBM_ASC 30 /* .pbm "P1" */ +#define FTYPE_PGM_ASC 31 /* .pgm "P2" */ +#define FTYPE_PPM_ASC 32 /* .ppm "P3" */ +#define FTYPE_PBM_RAW 33 /* .pbm "P4" */ +#define FTYPE_PGM_RAW 34 /* .pgm "P5" */ +#define FTYPE_PPM_RAW 35 /* .ppm "P6" */ +#define FTYPE_BMP 36 /* .bmp "BM" */ +#define FTYPE_GIF 37 /* .gif "GIF8" */ +#define FTYPE_PCX 38 /* .pcx (0x0a 0x05 0x01 0x08) */ +#define FTYPE_ERROR -1 + +#ifdef FAT_ENDIAN +Bool ReadInt16 (FILE *file, UInt16 huge *x); +Bool ReadInt32 (FILE *file, UInt32 huge *x); +Bool ReadFloat32 (FILE *file, Float32 huge *x); +Bool WriteInt16 (FILE *file, UInt16 huge *x); +Bool WriteInt32 (FILE *file, UInt32 huge *x); +Bool WriteFloat32 (FILE *file, Float32 huge *x); +UInt16 SwapInt16 (UInt16 x); +UInt32 SwapInt32 (UInt32 x); +Float32 SwapFloat32 (Float32 x); +#else +#define ReadInt16(f, p) ReadBytes((f), (p), 2L) +#define ReadInt32(f, p) ReadBytes((f), (p), 4L) +#define ReadFloat32(f, p) ReadBytes((f), (p), 4L) +#define WriteInt16(f, p) WriteBytes((f), (p), 2L) +#define WriteInt32(f, p) WriteBytes((f), (p), 4L) +#define WriteFloat32(f, p) WriteBytes((f), (p), 4L) +#define SwapInt16(x) (x) +#define SwapInt32(x) (x) +#define SwapFloat32(x) (x) +#endif /* FAT_ENDIAN */ + +#define FROMDISK -1 +struct PACKDirectory +{ + char name[56]; /* name of file */ + UInt32 offset; /* offset to start of data */ + UInt32 size; /* byte size of data */ +}; +typedef struct PACKDirectory *PACKDirPtr; + +typedef struct DirListStruct +{ + char dirname[1024]; + int from; + struct DirListStruct *next; +} DIRLIST; + +typedef struct FileListStruct +{ + char filename[1024]; + UInt32 offset; + UInt32 size; + struct FileListStruct *next; +} FILELIST; + +typedef struct DirStruct +{ + char name[1024]; + FILELIST *files; + struct DirStruct *next; +} DIRECTORY; + + +extern int m_nPAKIndex; +extern FILE* pakfile[16]; +extern bool pakopen; +extern DIRECTORY *paktextures; + +void ClearFileList (FILELIST **); +void ClearDirList (DIRLIST **); +bool GetPackFileList (FILELIST **, char *); +bool GetPackTextureDirs (DIRLIST **); +bool AddToDirListAlphabetized (DIRLIST **, char *, int); +bool AddToFileListAlphabetized (FILELIST **t, char *, UInt32, UInt32, bool); +bool PakLoadFile (const char *, void **); +void OpenPakFile (const char *); +void ClosePakFile (void); +int PakLoadAnyFile(const char *filename, void **bufferptr); +void WINAPI InitPakFile(const char * pBasePath, const char *pName); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/picomodel.h b/libs/picomodel.h index f7ac8a3a..1912b4cb 100644 --- a/libs/picomodel.h +++ b/libs/picomodel.h @@ -43,8 +43,6 @@ extern "C" { #endif -#include - /* version */ @@ -107,7 +105,6 @@ struct picoSurface_s int numVertexes, maxVertexes; picoVec3_t *xyz; picoVec3_t *normal; - picoIndex_t *smoothingGroup; int numSTArrays, maxSTArrays; picoVec2_t **st; @@ -219,8 +216,6 @@ const picoModule_t **PicoModuleList( int *numModules ); picoModel_t *PicoLoadModel( char *name, int frameNum ); -typedef size_t (*PicoInputStreamReadFunc)(void* inputStream, unsigned char* buffer, size_t length); -picoModel_t* PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum ); /* model functions */ picoModel_t *PicoNewModel( void ); @@ -268,7 +263,6 @@ void PicoSetSurfaceIndex( picoSurface_t *surface, int num, picoIndex_t inde void PicoSetSurfaceIndexes( picoSurface_t *surface, int num, picoIndex_t *index, int count ); void PicoSetFaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ); void PicoSetSurfaceSpecial( picoSurface_t *surface, int num, int special ); -void PicoSetSurfaceSmoothingGroup( picoSurface_t *surface, int num, picoIndex_t smoothingGroup ); /* getter functions */ @@ -336,12 +330,12 @@ picoVertexCombinationHash_t *PicoFindVertexCombinationInHashTable( picoVertexCom picoVertexCombinationHash_t *PicoAddVertexCombinationToHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color, picoIndex_t index ); /* specialized functions */ -int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color, picoIndex_t smoothingGroup ); +int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color ); void PicoFixSurfaceNormals( picoSurface_t *surface ); int PicoRemapModel( picoModel_t *model, char *remapFile ); -void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, picoShader_t* shader, picoIndex_t* smoothingGroup); +void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, picoShader_t* shader ); /* end marker */ #ifdef __cplusplus diff --git a/libs/picomodel/lwo/clip.c b/libs/picomodel/lwo/clip.c index d83ea61f..8999f409 100644 --- a/libs/picomodel/lwo/clip.c +++ b/libs/picomodel/lwo/clip.c @@ -21,37 +21,8 @@ Free memory used by an lwClip. void lwFreeClip( lwClip *clip ) { if ( clip ) { - lwListFree( clip->ifilter, (void *) lwFreePlugin ); - lwListFree( clip->pfilter, (void *) lwFreePlugin ); - - switch ( clip->type ) { - case ID_STIL: - _pico_free( clip->source.still.name); - break; - - case ID_ISEQ: - _pico_free( clip->source.seq.prefix ); - _pico_free( clip->source.seq.suffix ); - break; - - case ID_ANIM: - _pico_free( clip->source.anim.name ); - _pico_free( clip->source.anim.server ); - _pico_free( clip->source.anim.data ); - break; - - case ID_XREF: - _pico_free( clip->source.xref.string ); - break; - - case ID_STCC: - _pico_free( clip->source.cycle.name ); - break; - - default: - break; - } - + lwListFree( (void*) clip->ifilter, lwFreePlugin ); + lwListFree( (void*) clip->pfilter, lwFreePlugin ); _pico_free( clip ); } } @@ -213,11 +184,11 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize ) filt->data = getbytes( fp, sz - rlen ); if ( id == ID_IFLT ) { - lwListAdd( (void *) &clip->ifilter, filt ); + lwListAdd( &clip->ifilter, filt ); clip->nifilters++; } else { - lwListAdd( (void *) &clip->pfilter, filt ); + lwListAdd( &clip->pfilter, filt ); clip->npfilters++; } break; diff --git a/libs/picomodel/lwo/envelope.c b/libs/picomodel/lwo/envelope.c index 0b8ef4ea..e3e281ff 100644 --- a/libs/picomodel/lwo/envelope.c +++ b/libs/picomodel/lwo/envelope.c @@ -22,7 +22,7 @@ void lwFreeEnvelope( lwEnvelope *env ) if ( env ) { if ( env->name ) _pico_free( env->name ); lwListFree( env->key, _pico_free ); - lwListFree( env->cfilter, (void *) lwFreePlugin ); + lwListFree( env->cfilter, lwFreePlugin ); _pico_free( env ); } } @@ -100,7 +100,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ) if ( !key ) goto Fail; key->time = getF4( fp ); key->value = getF4( fp ); - lwListInsert( (void **) &env->key, key, (void *) compare_keys ); + lwListInsert( &env->key, key, compare_keys ); env->nkeys++; break; @@ -137,7 +137,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ) plug->flags = getU2( fp ); plug->data = getbytes( fp, sz - get_flen() ); - lwListAdd( (void *) &env->cfilter, plug ); + lwListAdd( &env->cfilter, plug ); env->ncfilters++; break; diff --git a/libs/picomodel/lwo/lwio.c b/libs/picomodel/lwo/lwio.c index 9853c55a..ec74932f 100644 --- a/libs/picomodel/lwo/lwio.c +++ b/libs/picomodel/lwo/lwio.c @@ -32,7 +32,7 @@ void set_flen( int i ) { flen = i; } int get_flen( void ) { return flen; } -#ifndef __BIG_ENDIAN__ +#ifdef _WIN32 /* ===================================================================== revbytes() diff --git a/libs/picomodel/lwo/lwo2.c b/libs/picomodel/lwo/lwo2.c index ff83d5c2..f4c72443 100644 --- a/libs/picomodel/lwo/lwo2.c +++ b/libs/picomodel/lwo/lwo2.c @@ -11,7 +11,7 @@ Ernie Wright 17 Sep 00 #include "lwo2.h" /* disable warnings */ -#ifdef WIN32 +#ifdef _WIN32 #pragma warning( disable:4018 ) /* signed/unsigned mismatch */ #endif @@ -29,7 +29,7 @@ void lwFreeLayer( lwLayer *layer ) if ( layer->name ) _pico_free( layer->name ); lwFreePoints( &layer->point ); lwFreePolygons( &layer->polygon ); - lwListFree( layer->vmap, (void *) lwFreeVMap ); + lwListFree( layer->vmap, lwFreeVMap ); _pico_free( layer ); } } @@ -45,10 +45,10 @@ Free memory used by an lwObject. void lwFreeObject( lwObject *object ) { if ( object ) { - lwListFree( object->layer, (void *) lwFreeLayer ); - lwListFree( object->env, (void *) lwFreeEnvelope ); - lwListFree( object->clip, (void *) lwFreeClip ); - lwListFree( object->surf, (void *) lwFreeSurface ); + lwListFree( object->layer, lwFreeLayer ); + lwListFree( object->env, lwFreeEnvelope ); + lwListFree( object->clip, lwFreeClip ); + lwListFree( object->surf, lwFreeSurface ); lwFreeTags( &object->taglist ); _pico_free( object ); } @@ -140,7 +140,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID if ( object->nlayers > 0 ) { layer = _pico_calloc( 1, sizeof( lwLayer )); if ( !layer ) goto Fail; - lwListAdd( (void **) &object->layer, layer ); + lwListAdd( &object->layer, layer ); } object->nlayers++; @@ -177,7 +177,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID node = ( lwNode * ) lwGetVMap( fp, cksize, layer->point.offset, layer->polygon.offset, id == ID_VMAD ); if ( !node ) goto Fail; - lwListAdd( (void **) &layer->vmap, node ); + lwListAdd( &layer->vmap, node ); layer->nvmaps++; break; @@ -205,21 +205,21 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID case ID_ENVL: node = ( lwNode * ) lwGetEnvelope( fp, cksize ); if ( !node ) goto Fail; - lwListAdd( (void **) &object->env, node ); + lwListAdd( &object->env, node ); object->nenvs++; break; case ID_CLIP: node = ( lwNode * ) lwGetClip( fp, cksize ); if ( !node ) goto Fail; - lwListAdd( (void **) &object->clip, node ); + lwListAdd( &object->clip, node ); object->nclips++; break; case ID_SURF: node = ( lwNode * ) lwGetSurface( fp, cksize ); if ( !node ) goto Fail; - lwListAdd( (void **) &object->surf, node ); + lwListAdd( &object->surf, node ); object->nsurfs++; break; diff --git a/libs/picomodel/lwo/lwo2.h b/libs/picomodel/lwo/lwo2.h index 29724cce..1d55ba46 100644 --- a/libs/picomodel/lwo/lwo2.h +++ b/libs/picomodel/lwo/lwo2.h @@ -642,7 +642,7 @@ int sgetVX( unsigned char **bp ); float sgetF4( unsigned char **bp ); char *sgetS0( unsigned char **bp ); -#ifndef __BIG_ENDIAN__ +#ifdef _WIN32 void revbytes( void *bp, int elsize, int elcount ); #else #define revbytes( b, s, c ) diff --git a/libs/picomodel/lwo/lwob.c b/libs/picomodel/lwo/lwob.c index 0b7c372d..edf42cff 100644 --- a/libs/picomodel/lwo/lwob.c +++ b/libs/picomodel/lwo/lwob.c @@ -12,7 +12,7 @@ Ernie Wright 17 Sep 00 #include "lwo2.h" /* disable warnings */ -#ifdef WIN32 +#ifdef _WIN32 #pragma warning( disable:4018 ) /* signed/unsigned mismatch */ #endif @@ -84,7 +84,7 @@ static int add_clip( char *s, lwClip **clist, int *nclips ) *nclips++; clip->index = *nclips; - lwListAdd( (void *) clist, clip ); + lwListAdd( clist, clip ); return clip->index; } @@ -130,7 +130,7 @@ static int add_tvel( float pos[], float vel[], lwEnvelope **elist, int *nenvs ) env->behavior[ 0 ] = BEH_LINEAR; env->behavior[ 1 ] = BEH_LINEAR; - lwListAdd( (void *) elist, env ); + lwListAdd( elist, env ); } *nenvs += 3; @@ -312,43 +312,43 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ) case ID_BTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->bump.tex, tex ); + lwListAdd( &surf->bump.tex, tex ); break; case ID_CTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->color.tex, tex ); + lwListAdd( &surf->color.tex, tex ); break; case ID_DTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->diffuse.tex, tex ); + lwListAdd( &surf->diffuse.tex, tex ); break; case ID_LTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->luminosity.tex, tex ); + lwListAdd( &surf->luminosity.tex, tex ); break; case ID_RTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->reflection.val.tex, tex ); + lwListAdd( &surf->reflection.val.tex, tex ); break; case ID_STEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->specularity.tex, tex ); + lwListAdd( &surf->specularity.tex, tex ); break; case ID_TTEX: s = getbytes( fp, sz ); tex = get_texture( s ); - lwListAdd( (void *) &surf->transparency.val.tex, tex ); + lwListAdd( &surf->transparency.val.tex, tex ); break; case ID_TFLG: @@ -441,7 +441,7 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ) shdr = _pico_calloc( 1, sizeof( lwPlugin )); if ( !shdr ) goto Fail; shdr->name = getbytes( fp, sz ); - lwListAdd( (void *) &surf->shader, shdr ); + lwListAdd( &surf->shader, shdr ); surf->nshaders++; break; @@ -654,7 +654,7 @@ lwObject *lwGetObject5( char *filename, picoMemStream_t *fp, unsigned int *failI case ID_SURF: node = ( lwNode * ) lwGetSurface5( fp, cksize, object ); if ( !node ) goto Fail; - lwListAdd( (void *) &object->surf, node ); + lwListAdd( &object->surf, node ); object->nsurfs++; break; diff --git a/libs/picomodel/lwo/pntspols.c b/libs/picomodel/lwo/pntspols.c index a7f54d25..5cef01e6 100644 --- a/libs/picomodel/lwo/pntspols.c +++ b/libs/picomodel/lwo/pntspols.c @@ -361,7 +361,7 @@ int lwResolvePolySurfaces( lwPolygonList *polygon, lwTagList *tlist, s[ index ]->name = _pico_alloc( strlen( tlist->tag[ index ] ) + 1 ); if ( !s[ index ]->name ) return 0; strcpy( s[ index ]->name, tlist->tag[ index ] ); - lwListAdd( (void *) surf, s[ index ] ); + lwListAdd( surf, s[ index ] ); *nsurfs = *nsurfs + 1; } polygon->pol[ i ].surf = s[ index ]; @@ -486,7 +486,7 @@ int lwGetTags( picoMemStream_t *fp, int cksize, lwTagList *tlist ) bp = buf; for ( i = 0; i < ntags; i++ ) - tlist->tag[ i + tlist->offset ] = sgetS0( (unsigned char **) &bp ); + tlist->tag[ i + tlist->offset ] = sgetS0( &bp ); _pico_free( buf ); return 1; diff --git a/libs/picomodel/lwo/surface.c b/libs/picomodel/lwo/surface.c index 6b2bbe62..6c205df2 100644 --- a/libs/picomodel/lwo/surface.c +++ b/libs/picomodel/lwo/surface.c @@ -43,7 +43,6 @@ void lwFreeTexture( lwTexture *t ) switch ( t->type ) { case ID_IMAP: if ( t->param.imap.vmap_name ) _pico_free( t->param.imap.vmap_name ); - if ( t->tmap.ref_object ) _pico_free( t->tmap.ref_object ); break; case ID_PROC: if ( t->param.proc.name ) _pico_free( t->param.proc.name ); @@ -72,18 +71,18 @@ void lwFreeSurface( lwSurface *surf ) if ( surf->name ) _pico_free( surf->name ); if ( surf->srcname ) _pico_free( surf->srcname ); - lwListFree( surf->shader, (void *) lwFreePlugin ); + lwListFree( surf->shader, lwFreePlugin ); - lwListFree( surf->color.tex, (void *) lwFreeTexture ); - lwListFree( surf->luminosity.tex, (void *) lwFreeTexture ); - lwListFree( surf->diffuse.tex, (void *) lwFreeTexture ); - lwListFree( surf->specularity.tex, (void *) lwFreeTexture ); - lwListFree( surf->glossiness.tex, (void *) lwFreeTexture ); - lwListFree( surf->reflection.val.tex, (void *) lwFreeTexture ); - lwListFree( surf->transparency.val.tex, (void *) lwFreeTexture ); - lwListFree( surf->eta.tex, (void *) lwFreeTexture ); - lwListFree( surf->translucency.tex, (void *) lwFreeTexture ); - lwListFree( surf->bump.tex, (void *) lwFreeTexture ); + lwListFree( surf->color.tex, lwFreeTexture ); + lwListFree( surf->luminosity.tex, lwFreeTexture ); + lwListFree( surf->diffuse.tex, lwFreeTexture ); + lwListFree( surf->specularity.tex, lwFreeTexture ); + lwListFree( surf->glossiness.tex, lwFreeTexture ); + lwListFree( surf->reflection.val.tex, lwFreeTexture ); + lwListFree( surf->transparency.val.tex, lwFreeTexture ); + lwListFree( surf->eta.tex, lwFreeTexture ); + lwListFree( surf->translucency.tex, lwFreeTexture ); + lwListFree( surf->bump.tex, lwFreeTexture ); _pico_free( surf ); } @@ -738,7 +737,7 @@ static int add_texture( lwSurface *surf, lwTexture *tex ) default: return 0; } - lwListInsert( (void **) list, tex, ( void *) compare_textures ); + lwListInsert( list, tex, compare_textures ); return 1; } @@ -963,7 +962,7 @@ lwSurface *lwGetSurface( picoMemStream_t *fp, int cksize ) case ID_SHDR: shdr = lwGetShader( fp, sz - 4 ); if ( !shdr ) goto Fail; - lwListInsert( (void **) &surf->shader, shdr, (void *) compare_shaders ); + lwListInsert( &surf->shader, shdr, compare_shaders ); ++surf->nshaders; set_flen( 4 + get_flen() ); break; diff --git a/libs/picomodel/picointernal.c b/libs/picomodel/picointernal.c index 22214923..3e32dd08 100644 --- a/libs/picomodel/picointernal.c +++ b/libs/picomodel/picointernal.c @@ -155,22 +155,32 @@ void *_pico_realloc( void **ptr, size_t oldSize, size_t newSize ) * as custom clone size (the string is cropped to fit into mem * if needed). -sea */ -char *_pico_clone_alloc( const char *str ) +char *_pico_clone_alloc( char *str, int size ) { - char* cloned; + char *cloned; + size_t cloneSize; /* sanity check */ - if (str == NULL) - return NULL; + if (str == NULL) return NULL; + + /* set real size of cloned string */ + cloneSize = (size < 0) ? strlen(str) : size; /* allocate memory */ - cloned = _pico_alloc( strlen(str) + 1 ); + cloned = _pico_alloc( cloneSize+1 ); /* bugfix! */ if (cloned == NULL) return NULL; - /* copy input string to cloned string */ - strcpy( cloned, str ); + /* zero out memory allocated by cloned string */ + memset( cloned,0,cloneSize ); + /* copy input string to cloned string */ + if (cloneSize < strlen( str )) { + memcpy( cloned,str,cloneSize ); + cloned[ cloneSize ] = '\0'; + } else { + strcpy( cloned,str ); + } /* return ptr to cloned string */ return cloned; } @@ -257,21 +267,8 @@ void _pico_printf( int level, const char *format, ...) _pico_ptr_print( level,str ); } -/* _pico_first_token: - * trims everything after the first whitespace-delimited token - */ - -void _pico_first_token( char *str ) -{ - if( !str || !*str ) - return; - while( *str && !isspace( *str ) ) - *str++; - *str = '\0'; -} - /* _pico_strltrim: - * left trims the given string -sea + * left trims the given string -sea */ char *_pico_strltrim( char *str ) { @@ -285,7 +282,7 @@ char *_pico_strltrim( char *str ) } /* _pico_strrtrim: - * right trims the given string -sea + * right trims the given string -sea */ char *_pico_strrtrim( char *str ) { @@ -557,7 +554,7 @@ float _pico_big_float( float src ) */ char *_pico_stristr( char *str, const char *substr ) { - const size_t sublen = strlen(substr); + const int sublen = strlen(substr); while (*str) { if (!_pico_strnicmp(str,substr,sublen)) break; @@ -617,21 +614,21 @@ int _pico_nofname( const char *path, char *dest, int destSize ) * returns ptr to filename portion in given path or an empty * string otherwise. given 'path' is not altered. -sea */ -const char *_pico_nopath( const char *path ) +char *_pico_nopath( const char *path ) { - const char *src; - src = path + (strlen(path) - 1); + char *src; + src = (char *)path + (strlen(path) - 1); - if (path == NULL) return ""; - if (!strchr(path,'/') && !strchr(path,'\\')) - return (path); + if (path == NULL) return (char *)""; + if (!strchr((char *)path,'/') && !strchr((char *)path,'\\')) + return ((char *)path); while ((src--) != path) { if (*src == '/' || *src == '\\') return (++src); } - return ""; + return (char *)""; } /* _pico_setfext: diff --git a/libs/picomodel/picointernal.h b/libs/picomodel/picointernal.h index 6ede9f60..8a3ee68d 100644 --- a/libs/picomodel/picointernal.h +++ b/libs/picomodel/picointernal.h @@ -55,7 +55,7 @@ extern "C" #include "picomodel.h" -/* os dependent replacements */ +/* os dependant replacements */ #if WIN32 || _WIN32 #define _pico_stricmp stricmp #define _pico_strnicmp strnicmp @@ -116,7 +116,7 @@ extern void (*_pico_ptr_print)( int, const char* ); void *_pico_alloc( size_t size ); void *_pico_calloc( size_t num, size_t size ); void *_pico_realloc( void **ptr, size_t oldSize, size_t newSize ); -char *_pico_clone_alloc( const char *str ); +char *_pico_clone_alloc( char *str, int size ); void _pico_free( void *ptr ); /* files */ @@ -124,7 +124,6 @@ void _pico_load_file( char *name, unsigned char **buffer, int *bufSize ); void _pico_free_file( void *buffer ); /* strings */ -void _pico_first_token( char *str ); char *_pico_strltrim( char *str ); char *_pico_strrtrim( char *str ); int _pico_strchcount( char *str, int ch ); @@ -132,7 +131,7 @@ void _pico_printf( int level, const char *format, ... ); char *_pico_stristr( char *str, const char *substr ); void _pico_unixify( char *path ); int _pico_nofname( const char *path, char *dest, int destSize ); -const char *_pico_nopath( const char *path ); +char *_pico_nopath( const char *path ); char *_pico_setfext( char *path, const char *ext ); int _pico_getline( char *buf, int bufsize, char *dest, int destsize ); char *_pico_strlwr( char *str ); diff --git a/libs/picomodel/picomodel.c b/libs/picomodel/picomodel.c index 240d729b..d7790c37 100644 --- a/libs/picomodel/picomodel.c +++ b/libs/picomodel/picomodel.c @@ -148,52 +148,6 @@ void PicoSetPrintFunc( void (*func)( int, const char* ) ) -picoModel_t *PicoModuleLoadModel( const picoModule_t* pm, char* fileName, picoByte_t* buffer, int bufSize, int frameNum ) -{ - char *modelFileName, *remapFileName; - - /* see whether this module can load the model file or not */ - if( pm->canload( fileName, buffer, bufSize ) == PICO_PMV_OK ) - { - /* use loader provided by module to read the model data */ - picoModel_t* model = pm->load( fileName, frameNum, buffer, bufSize ); - if( model == NULL ) - { - _pico_free_file( buffer ); - return NULL; - } - - /* assign pointer to file format module */ - model->module = pm; - - /* get model file name */ - modelFileName = PicoGetModelFileName( model ); - - /* apply model remappings from .remap */ - if( strlen( modelFileName ) ) - { - /* alloc copy of model file name */ - remapFileName = _pico_alloc( strlen( modelFileName ) + 20 ); - if( remapFileName != NULL ) - { - /* copy model file name and change extension */ - strcpy( remapFileName, modelFileName ); - _pico_setfext( remapFileName, "remap" ); - - /* try to remap model; we don't handle the result */ - PicoRemapModel( model, remapFileName ); - - /* free the remap file name string */ - _pico_free( remapFileName ); - } - } - - return model; - } - - return NULL; -} - /* PicoLoadModel() the meat and potatoes function @@ -205,6 +159,7 @@ picoModel_t *PicoLoadModel( char *fileName, int frameNum ) picoModel_t *model; picoByte_t *buffer; int bufSize; + char *modelFileName, *remapFileName; /* init */ @@ -242,10 +197,43 @@ picoModel_t *PicoLoadModel( char *fileName, int frameNum ) /* module must be able to load */ if( pm->canload == NULL || pm->load == NULL ) continue; - - model = PicoModuleLoadModel(pm, fileName, buffer, bufSize, frameNum); - if(model != NULL) + + /* see whether this module can load the model file or not */ + if( pm->canload( fileName, buffer, bufSize ) == PICO_PMV_OK ) { + /* use loader provided by module to read the model data */ + model = pm->load( fileName, frameNum, buffer, bufSize ); + if( model == NULL ) + { + _pico_free_file( buffer ); + return NULL; + } + + /* assign pointer to file format module */ + model->module = pm; + + /* get model file name */ + modelFileName = PicoGetModelFileName( model ); + + /* apply model remappings from .remap */ + if( strlen( modelFileName ) ) + { + /* alloc copy of model file name */ + remapFileName = _pico_alloc( strlen( modelFileName ) + 20 ); + if( remapFileName != NULL ) + { + /* copy model file name and change extension */ + strcpy( remapFileName, modelFileName ); + _pico_setfext( remapFileName, "remap" ); + + /* try to remap model; we don't handle the result */ + PicoRemapModel( model, remapFileName ); + + /* free the remap file name string */ + _pico_free( remapFileName ); + } + } + /* model was loaded, so break out of loop */ break; } @@ -259,50 +247,6 @@ picoModel_t *PicoLoadModel( char *fileName, int frameNum ) return model; } -picoModel_t *PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum ) -{ - picoModel_t *model; - picoByte_t *buffer; - int bufSize; - - - /* init */ - model = NULL; - - if( inputStream == NULL ) - { - _pico_printf( PICO_ERROR, "PicoLoadModel: invalid input stream (inputStream == NULL)" ); - return NULL; - } - - if( inputStreamRead == NULL ) - { - _pico_printf( PICO_ERROR, "PicoLoadModel: invalid input stream (inputStreamRead == NULL)" ); - return NULL; - } - - buffer = _pico_alloc(streamLength + 1); - - bufSize = (int)inputStreamRead(inputStream, buffer, streamLength); - buffer[bufSize] = '\0'; - - { - // dummy filename - char fileName[128]; - fileName[0] = '.'; - strncpy(fileName + 1, module->defaultExts[0], 126); - fileName[127] = '\0'; - model = PicoModuleLoadModel(module, fileName, buffer, bufSize, frameNum); - } - - if(model != 0) - { - _pico_free(buffer); - } - - /* return */ - return model; -} /* ---------------------------------------------------------------------------- @@ -356,9 +300,6 @@ void PicoFreeModel( picoModel_t *model ) if( model->name ) _pico_free( model->name ); - if( model->fileName ) - _pico_free( model->fileName ); - /* free shaders */ for( i = 0; i < model->numShaders; i++ ) PicoFreeShader( model->shader[ i ] ); @@ -437,7 +378,7 @@ picoShader_t *PicoNewShader( picoModel_t *model ) { picoShader_t *shader; - + /* allocate and clear */ shader = _pico_alloc( sizeof(picoShader_t) ); if( shader == NULL ) @@ -453,21 +394,19 @@ picoShader_t *PicoNewShader( picoModel_t *model ) _pico_free( shader ); return NULL; } - /* attach */ model->shader[ model->numShaders - 1 ] = shader; shader->model = model; } - /* setup default shader colors */ _pico_set_color( shader->ambientColor,0,0,0,0 ); _pico_set_color( shader->diffuseColor,255,255,255,1 ); _pico_set_color( shader->specularColor,0,0,0,0 ); - + /* no need to do this, but i do it anyway */ shader->transparency = 0; shader->shininess = 0; - + /* return the newly created shader */ return shader; } @@ -596,12 +535,8 @@ void PicoFreeSurface( picoSurface_t *surface ) /* free bits */ _pico_free( surface->xyz ); _pico_free( surface->normal ); - _pico_free( surface->smoothingGroup ); _pico_free( surface->index ); _pico_free( surface->faceNormal ); - - if( surface->name ) - _pico_free( surface->name ); /* free arrays */ for( i = 0; i < surface->numSTArrays; i++ ) @@ -650,8 +585,6 @@ int PicoAdjustSurface( picoSurface_t *surface, int numVertexes, int numSTArrays, return 0; if( !_pico_realloc( (void *) &surface->normal, surface->numVertexes * sizeof( *surface->normal ), surface->maxVertexes * sizeof( *surface->normal ) ) ) return 0; - if( !_pico_realloc( (void *) &surface->smoothingGroup, surface->numVertexes * sizeof( *surface->smoothingGroup ), surface->maxVertexes * sizeof( *surface->smoothingGroup ) ) ) - return 0; for( i = 0; i < surface->numSTArrays; i++ ) if( !_pico_realloc( (void*) &surface->st[ i ], surface->numVertexes * sizeof( *surface->st[ i ] ), surface->maxVertexes * sizeof( *surface->st[ i ] ) ) ) return 0; @@ -767,7 +700,7 @@ void PicoSetModelName( picoModel_t *model, char *name ) if( model->name != NULL ) _pico_free( model->name ); - model->name = _pico_clone_alloc( name ); + model->name = _pico_clone_alloc( name,-1 ); } @@ -779,7 +712,7 @@ void PicoSetModelFileName( picoModel_t *model, char *fileName ) if( model->fileName != NULL ) _pico_free( model->fileName ); - model->fileName = _pico_clone_alloc( fileName ); + model->fileName = _pico_clone_alloc( fileName,-1 ); } @@ -818,7 +751,7 @@ void PicoSetShaderName( picoShader_t *shader, char *name ) if( shader->name != NULL ) _pico_free( shader->name ); - shader->name = _pico_clone_alloc( name ); + shader->name = _pico_clone_alloc( name,-1 ); } @@ -830,7 +763,7 @@ void PicoSetShaderMapName( picoShader_t *shader, char *mapName ) if( shader->mapName != NULL ) _pico_free( shader->mapName ); - shader->mapName = _pico_clone_alloc( mapName ); + shader->mapName = _pico_clone_alloc( mapName,-1 ); } @@ -926,7 +859,7 @@ void PicoSetSurfaceName( picoSurface_t *surface, char *name ) if( surface->name != NULL ) _pico_free( surface->name ); - surface->name = _pico_clone_alloc( name ); + surface->name = _pico_clone_alloc( name,-1 ); } @@ -1022,16 +955,6 @@ void PicoSetFaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ) } -void PicoSetSurfaceSmoothingGroup( picoSurface_t *surface, int num, picoIndex_t smoothingGroup ) -{ - if( num < 0 ) - return; - if( !PicoAdjustSurface( surface, num + 1, 0, 0, 0, 0 ) ) - return; - surface->smoothingGroup[ num ] = smoothingGroup; -} - - void PicoSetSurfaceSpecial( picoSurface_t *surface, int num, int special ) { if( surface == NULL || num < 0 || num >= PICO_MAX_SPECIAL ) @@ -1365,13 +1288,6 @@ picoVec_t *PicoGetFaceNormal( picoSurface_t *surface, int num ) return surface->faceNormal[ num ]; } -picoIndex_t PicoGetSurfaceSmoothingGroup( picoSurface_t *surface, int num ) -{ - if( surface == NULL || num < 0 || num > surface->numVertexes ) - return -1; - return surface->smoothingGroup[ num ]; -} - int PicoGetSurfaceSpecial( picoSurface_t *surface, int num ) { @@ -1569,7 +1485,7 @@ finds a vertex matching the set parameters fixme: needs non-naive algorithm */ -int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color, picoIndex_t smoothingGroup) +int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color ) { int i, j; @@ -1589,11 +1505,7 @@ int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t if( normal != NULL && (surface->normal[ i ][ 0 ] != normal[ 0 ] || surface->normal[ i ][ 1 ] != normal[ 1 ] || surface->normal[ i ][ 2 ] != normal[ 2 ]) ) continue; - /* check normal */ - if( surface->smoothingGroup[ i ] != smoothingGroup ) - continue; - - /* check st */ + /* check st */ if( numSTs > 0 && st != NULL ) { for( j = 0; j < numSTs; j++ ) @@ -1627,342 +1539,135 @@ int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t +/* +PicoFixSurfaceNormals() +fixes broken normals (certain formats bork normals) +*/ -typedef struct _IndexArray IndexArray; -struct _IndexArray +#define MAX_NORMAL_VOTES 128 +#define EQUAL_NORMAL_EPSILON 0.01 +#define BAD_NORMAL_EPSILON 0.5 + +void PicoFixSurfaceNormals( picoSurface_t *surface ) { - picoIndex_t* data; - picoIndex_t* last; -}; - -void indexarray_push_back(IndexArray* self, picoIndex_t value) -{ - *self->last++ = value; -} - -size_t indexarray_size(IndexArray* self) -{ - return self->last - self->data; -} - -void indexarray_reserve(IndexArray* self, size_t size) -{ - self->data = self->last = _pico_calloc(size, sizeof(picoIndex_t)); -} - -void indexarray_clear(IndexArray* self) -{ - _pico_free(self->data); -} - -typedef struct _BinaryTreeNode BinaryTreeNode; -struct _BinaryTreeNode -{ - picoIndex_t left; - picoIndex_t right; -}; - -typedef struct _BinaryTree BinaryTree; -struct _BinaryTree -{ - BinaryTreeNode* data; - BinaryTreeNode* last; -}; - -void binarytree_extend(BinaryTree* self) -{ - self->last->left = 0; - self->last->right = 0; - ++self->last; -} - -size_t binarytree_size(BinaryTree* self) -{ - return self->last - self->data; -} - -void binarytree_reserve(BinaryTree* self, size_t size) -{ - self->data = self->last = _pico_calloc(size, sizeof(BinaryTreeNode)); -} - -void binarytree_clear(BinaryTree* self) -{ - _pico_free(self->data); -} - -typedef int (*LessFunc)(void*, picoIndex_t, picoIndex_t); - -typedef struct _UniqueIndices UniqueIndices; -struct _UniqueIndices -{ - BinaryTree tree; - IndexArray indices; - LessFunc lessFunc; - void* lessData; -}; - -size_t UniqueIndices_size(UniqueIndices* self) -{ - return binarytree_size(&self->tree); -} - -void UniqueIndices_reserve(UniqueIndices* self, size_t size) -{ - binarytree_reserve(&self->tree, size); - indexarray_reserve(&self->indices, size); -} - -void UniqueIndices_init(UniqueIndices* self, LessFunc lessFunc, void* lessData) -{ - self->lessFunc = lessFunc; - self->lessData = lessData; -} - -void UniqueIndices_destroy(UniqueIndices* self) -{ - binarytree_clear(&self->tree); - indexarray_clear(&self->indices); -} - - -picoIndex_t UniqueIndices_find_or_insert(UniqueIndices* self, picoIndex_t value) -{ - picoIndex_t index = 0; - - for(;;) - { - if(self->lessFunc(self->lessData, value, self->indices.data[index])) - { - BinaryTreeNode* node = self->tree.data + index; - if(node->left != 0) - { - index = node->left; - continue; - } - else - { - node->left = (picoIndex_t)binarytree_size(&self->tree); - binarytree_extend(&self->tree); - indexarray_push_back(&self->indices, value); - return node->left; - } - } - if(self->lessFunc(self->lessData, self->indices.data[index], value)) - { - BinaryTreeNode* node = self->tree.data + index; - if(node->right != 0) - { - index = node->right; - continue; - } - else - { - node->right = (picoIndex_t)binarytree_size(&self->tree); - binarytree_extend(&self->tree); - indexarray_push_back(&self->indices, value); - return node->right; - } - } - - return index; - } -} - -picoIndex_t UniqueIndices_insert(UniqueIndices* self, picoIndex_t value) -{ - if(self->tree.data == self->tree.last) - { - binarytree_extend(&self->tree); - indexarray_push_back(&self->indices, value); - return 0; - } - else - { - return UniqueIndices_find_or_insert(self, value); - } -} - -typedef struct picoSmoothVertices_s picoSmoothVertices_t; -struct picoSmoothVertices_s -{ - picoVec3_t* xyz; - picoIndex_t* smoothingGroups; -}; - -int lessSmoothVertex(void* data, picoIndex_t first, picoIndex_t second) -{ - picoSmoothVertices_t* smoothVertices = data; + int i, j, k, a, b, c, numVotes, faceIndex; + picoVec3_t votes[ MAX_NORMAL_VOTES ]; + picoVec3_t *normals, diff; + picoVec4_t plane; - if(smoothVertices->xyz[first][0] != smoothVertices->xyz[second][0]) + + /* dummy check */ + if( surface == NULL || surface->numVertexes == 0 ) + return; + + /* fixme: handle other surface types */ + if( surface->type != PICO_TRIANGLES ) + return; + + /* allocate normal storage */ + normals = _pico_alloc( surface->numVertexes * sizeof( *normals ) ); + if( normals == NULL ) { - return smoothVertices->xyz[first][0] < smoothVertices->xyz[second][0]; + _pico_printf( PICO_ERROR, "PicoFixSurfaceNormals: Unable to allocate memory for temporary normal storage" ); + return; } - if(smoothVertices->xyz[first][1] != smoothVertices->xyz[second][1]) + + /* zero it out */ + memset( normals, 0, surface->numVertexes * sizeof( *normals ) ); + + /* walk vertex list */ + for( i = 0; i < surface->numVertexes; i++ ) { - return smoothVertices->xyz[first][1] < smoothVertices->xyz[second][1]; - } - if(smoothVertices->xyz[first][2] != smoothVertices->xyz[second][2]) - { - return smoothVertices->xyz[first][2] < smoothVertices->xyz[second][2]; - } - if(smoothVertices->smoothingGroups[first] != smoothVertices->smoothingGroups[second]) - { - return smoothVertices->smoothingGroups[first] < smoothVertices->smoothingGroups[second]; - } - return 0; -} - -void _pico_vertices_combine_shared_normals(picoVec3_t* xyz, picoIndex_t* smoothingGroups, picoVec3_t* normals, picoIndex_t numVertices) -{ - UniqueIndices vertices; - IndexArray indices; - picoSmoothVertices_t smoothVertices = { xyz, smoothingGroups }; - UniqueIndices_init(&vertices, lessSmoothVertex, &smoothVertices); - UniqueIndices_reserve(&vertices, numVertices); - indexarray_reserve(&indices, numVertices); - - - { - picoIndex_t i = 0; - for(; i < numVertices; ++i) + /* zero out votes */ + numVotes = 0; + + /* find all the triangles that reference this vertex */ + for( j = 0, faceIndex = 0; j < surface->numIndexes; j += 3, faceIndex++ ) { - size_t size = UniqueIndices_size(&vertices); - picoIndex_t index = UniqueIndices_insert(&vertices, i); - if((size_t)index != size) + /* get triangle */ + a = surface->index[ j ]; + b = surface->index[ j + 1 ]; + c = surface->index[ j + 2 ]; + + /* ignore degenerate triangles */ + if( a == b || b == c || c == a ) + continue; + + /* ignore indexes out of range */ + if( a < 0 || a >= surface->numVertexes || + b < 0 || b >= surface->numVertexes || + c < 0 || c >= surface->numVertexes ) + continue; + + /* test triangle */ + if( a == i || b == i || c == i ) { - float* normal = normals[vertices.indices.data[index]]; - _pico_add_vec(normal, normals[i], normal); - } - indexarray_push_back(&indices, index); - } - } - - { - picoIndex_t maxIndex = 0; - picoIndex_t* i = indices.data; - for(; i != indices.last; ++i) - { - if(*i <= maxIndex) - { - _pico_copy_vec(normals[vertices.indices.data[*i]], normals[i - indices.data]); - } - else - { - maxIndex = *i; - } - } - } - - UniqueIndices_destroy(&vertices); - indexarray_clear(&indices); -} - -typedef picoVec3_t* picoNormalIter_t; -typedef picoIndex_t* picoIndexIter_t; - -#define THE_CROSSPRODUCTS_OF_ANY_PAIR_OF_EDGES_OF_A_GIVEN_TRIANGLE_ARE_EQUAL 1 - -void _pico_triangles_generate_weighted_normals(picoIndexIter_t first, picoIndexIter_t end, picoVec3_t* xyz, picoVec3_t* normals) -{ - for(; first != end; first += 3) - { -#if (THE_CROSSPRODUCTS_OF_ANY_PAIR_OF_EDGES_OF_A_GIVEN_TRIANGLE_ARE_EQUAL) - picoVec3_t weightedNormal; - { - float* a = xyz[*(first + 0)]; - float* b = xyz[*(first + 1)]; - float* c = xyz[*(first + 2)]; - picoVec3_t ba, ca; - _pico_subtract_vec( b, a, ba ); - _pico_subtract_vec( c, a, ca ); - _pico_cross_vec( ca, ba, weightedNormal ); - } -#endif - { - int j = 0; - for(; j < 3; ++j) - { - float* normal = normals[*(first + j)]; -#if (!THE_CROSSPRODUCTS_OF_ANY_PAIR_OF_EDGES_OF_A_GIVEN_TRIANGLE_ARE_EQUAL) - picoVec3_t weightedNormal; + /* if this surface has face normals */ + if( surface->numFaceNormals && faceIndex < surface->numFaceNormals ) { - float* a = xyz[*(first + ((j + 0) % 3))]; - float* b = xyz[*(first + ((j + 1) % 3))]; - float* c = xyz[*(first + ((j + 2) % 3))]; - picoVec3_t ba, ca; - _pico_subtract_vec( b, a, ba ); - _pico_subtract_vec( c, a, ca ); - _pico_cross_vec( ca, ba, weightedNormal ); + _pico_copy_vec( surface->faceNormal[ faceIndex ], plane ); + if( plane[ 0 ] == 0.f && plane[ 1 ] == 0.f && plane[ 2 ] == 0.f ) + { + /* if null normal, make plane from the 3 points */ + if( _pico_calc_plane( plane, surface->xyz[ a ], surface->xyz[ b ], surface->xyz[ c ] ) == 0 ) + { + continue; + } + } + } + /* make a plane from the 3 points */ + else if( _pico_calc_plane( plane, surface->xyz[ a ], surface->xyz[ b ], surface->xyz[ c ] ) == 0 ) + { + continue; + } + + /* see if this normal has already been voted */ + for( k = 0; k < numVotes; k++ ) + { + _pico_subtract_vec( plane, votes[ k ], diff ); + if( fabs( diff[ 0 ] ) < EQUAL_NORMAL_EPSILON && + fabs( diff[ 1 ] ) < EQUAL_NORMAL_EPSILON && + fabs( diff[ 2 ] ) < EQUAL_NORMAL_EPSILON ) + break; + } + + /* add a new vote? */ + if( k == numVotes && numVotes < MAX_NORMAL_VOTES ) + { + _pico_copy_vec( plane, votes[ numVotes ] ); + numVotes++; + } + } + } + + /* tally votes */ + if( numVotes > 0 ) + { + /* create average normal */ + _pico_zero_vec( normals[ i ] ); + for( k = 0; k < numVotes; k++ ) + _pico_add_vec( normals[ i ], votes[ k ], normals[ i ] ); + + /* normalize it */ + if( _pico_normalize_vec( normals[ i ] ) ) + { + /* test against actual normal */ + if( fabs( _pico_dot_vec( normals[ i ], surface->normal[ i ] ) - 1 ) > BAD_NORMAL_EPSILON ) + { + //% printf( "Normal %8d: (%f %f %f) -> (%f %f %f)\n", i, + //% surface->normal[ i ][ 0 ], surface->normal[ i ][ 1 ], surface->normal[ i ][ 2 ], + //% normals[ i ][ 0 ], normals[ i ][ 1 ], normals[ i ][ 2 ] ); + _pico_copy_vec( normals[ i ], surface->normal[ i ] ); } -#endif - _pico_add_vec(weightedNormal, normal, normal); } } } -} - -void _pico_normals_zero(picoNormalIter_t first, picoNormalIter_t last) -{ - for(; first != last; ++first) - { - _pico_zero_vec(*first); - } -} - -void _pico_normals_normalize(picoNormalIter_t first, picoNormalIter_t last) -{ - for(; first != last; ++first) - { - _pico_normalize_vec(*first); - } -} - -double _pico_length_vec( picoVec3_t vec ) -{ - return sqrt( vec[ 0 ] * vec[ 0 ] + vec[ 1 ] * vec[ 1 ] + vec[ 2 ] * vec[ 2 ] ); -} - -#define NORMAL_UNIT_LENGTH_EPSILON 0.01 -#define FLOAT_EQUAL_EPSILON(f, other, epsilon) (fabs(f - other) < epsilon) - -int _pico_normal_is_unit_length(picoVec3_t normal) -{ - return FLOAT_EQUAL_EPSILON(_pico_length_vec(normal), 1.0, NORMAL_UNIT_LENGTH_EPSILON); -} - -int _pico_normal_within_tolerance(picoVec3_t normal, picoVec3_t other) -{ - return _pico_dot_vec(normal, other) > 0.0f; + + /* free normal storage */ + _pico_free( normals ); } -void _pico_normals_assign_generated_normals(picoNormalIter_t first, picoNormalIter_t last, picoNormalIter_t generated) -{ - for(; first != last; ++first, ++generated) - { - if(!_pico_normal_is_unit_length(*first) || !_pico_normal_within_tolerance(*first, *generated)) - { - _pico_copy_vec(*generated, *first); - } - } -} - -void PicoFixSurfaceNormals(picoSurface_t* surface) -{ - picoVec3_t* normals = (picoVec3_t*)_pico_calloc(surface->numVertexes, sizeof(picoVec3_t)); - - _pico_normals_zero(normals, normals + surface->numVertexes); - - _pico_triangles_generate_weighted_normals(surface->index, surface->index + surface->numIndexes, surface->xyz, normals); - _pico_vertices_combine_shared_normals(surface->xyz, surface->smoothingGroup, normals, surface->numVertexes); - - _pico_normals_normalize(normals, normals + surface->numVertexes); - - _pico_normals_assign_generated_normals(surface->normal, surface->normal + surface->numVertexes, normals); - - _pico_free(normals); -} /* @@ -2041,7 +1746,7 @@ int PicoRemapModel( picoModel_t *model, char *remapFile ) /* get material name */ if (_pico_parse( p,1 ) == NULL) break; if (!strlen(p->token)) continue; - materialName = _pico_clone_alloc( p->token ); + materialName = _pico_clone_alloc( p->token,-1 ); if (materialName == NULL) _prm_error_return; @@ -2096,7 +1801,7 @@ int PicoRemapModel( picoModel_t *model, char *remapFile ) _prm_error_return; /* temporary copy of material name */ - tempMaterialName = _pico_clone_alloc( p->token ); + tempMaterialName = _pico_clone_alloc( p->token,-1 ); if (tempMaterialName == NULL) _prm_error_return; @@ -2221,7 +1926,7 @@ Chooses an appropriate surface based on the shader, or adds a new surface if nec void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, - picoShader_t* shader, picoIndex_t* smoothingGroup ) + picoShader_t* shader ) { int i,j; int vertDataIndex; @@ -2261,7 +1966,7 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** int newVertIndex = PicoGetSurfaceNumIndexes ( workSurface ); /* get the index of the vertex that we're going to store at newVertIndex */ - vertDataIndex = PicoFindSurfaceVertexNum ( workSurface , *xyz[i] , *normals[i] , numSTs , st[i] , numColors , colors[i], smoothingGroup[i]); + vertDataIndex = PicoFindSurfaceVertexNum ( workSurface , *xyz[i] , *normals[i] , numSTs , st[i] , numColors , colors[i]); /* the vertex wasn't found, so create a new vertex in the pool from the data we have */ if ( vertDataIndex == -1 ) @@ -2282,11 +1987,9 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** { PicoSetSurfaceST ( workSurface , j , vertDataIndex , st[i][j] ); } - - PicoSetSurfaceSmoothingGroup ( workSurface , vertDataIndex , smoothingGroup[i] ); } /* add this vertex to the triangle */ PicoSetSurfaceIndex ( workSurface , newVertIndex , vertDataIndex ); - } + } } diff --git a/libs/picomodel/picomodel.vcproj b/libs/picomodel/picomodel.vcproj index de1f22b1..bd3edb07 100644 --- a/libs/picomodel/picomodel.vcproj +++ b/libs/picomodel/picomodel.vcproj @@ -1,285 +1,107 @@ - - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - + - + - + - + - + - + - + - + - - - + - - + + - + - + + + - + \ No newline at end of file diff --git a/libs/picomodel/picomodules.c b/libs/picomodel/picomodules.c index 59a6a9ee..add477b5 100644 --- a/libs/picomodel/picomodules.c +++ b/libs/picomodel/picomodules.c @@ -54,7 +54,6 @@ extern const picoModule_t picoModuleMDC; extern const picoModule_t picoModuleMD2; extern const picoModule_t picoModuleFM; extern const picoModule_t picoModuleLWO; -extern const picoModule_t picoModuleTerrain; @@ -68,9 +67,8 @@ const picoModule_t *picoModules[] = &picoModuleMDC, /* return to castle wolfenstein mdc */ &picoModuleMD2, /* quake2 md2 */ &picoModuleFM, /* heretic2 fm */ - &picoModuleLWO, /* lightwave object */ - &picoModuleTerrain, /* picoterrain object */ &picoModuleOBJ, /* wavefront object */ + &picoModuleLWO, /* lightwave object */ NULL /* arnold */ }; diff --git a/libs/picomodel/pm_3ds.c b/libs/picomodel/pm_3ds.c index 49a05f13..0f2b41f7 100644 --- a/libs/picomodel/pm_3ds.c +++ b/libs/picomodel/pm_3ds.c @@ -390,10 +390,7 @@ static int GetMeshShader (T3dsLoaderPers *pers) /* get in the shader name */ if (!GetASCIIZ(pers,shaderName,sizeof(shaderName))) return 0; - - /* ydnar: trim to first whitespace */ - _pico_first_token( shaderName ); - + /* now that we have the shader name we need to go through all of */ /* the shaders and check the name against each shader. when we */ /* find a shader in our shader list that matches this name we */ @@ -417,7 +414,7 @@ static int GetMeshShader (T3dsLoaderPers *pers) if (mapNamePtr != NULL) { char temp[128]; - const char *name; + char *name; /* copy map name to local buffer */ strcpy( mapName,mapNamePtr ); @@ -603,14 +600,11 @@ static int DoNextEditorDataChunk (T3dsLoaderPers *pers, long endofs) /* but for now we skip the new material's name ... */ if (pers->shader) { - char *name = (char*) (pers->bufptr + pers->cofs); - char *cleanedName = _pico_clone_alloc( name ); - _pico_first_token( cleanedName ); - PicoSetShaderName( pers->shader, cleanedName ); + char *name = (char *)(pers->bufptr + pers->cofs); + PicoSetShaderName( pers->shader,name ); #ifdef DEBUG_PM_3DS - printf( "NewShader: '%s'\n", cleanedName ); + printf("NewShader: '%s'\n",name); #endif - _pico_free( cleanedName ); } } if (chunk->id == CHUNK_MATDIFFUSE) diff --git a/libs/picomodel/pm_ase.c b/libs/picomodel/pm_ase.c index 985ea8a0..ae5698df 100644 --- a/libs/picomodel/pm_ase.c +++ b/libs/picomodel/pm_ase.c @@ -110,28 +110,6 @@ static aseSubMaterial_t* _ase_get_submaterial ( aseMaterial_t* list, int mtlIdP return subMtl; } -aseSubMaterial_t* _ase_get_submaterial_or_default ( aseMaterial_t* materials, int mtlIdParent , int subMtlId ) -{ - aseSubMaterial_t* subMtl = _ase_get_submaterial( materials, mtlIdParent, subMtlId ); - if(subMtl != NULL) - { - return subMtl; - } - - /* ydnar: trying default submaterial */ - subMtl = _ase_get_submaterial( materials, mtlIdParent, 0 ); - if( subMtl != NULL ) - { - return subMtl; - } - - _pico_printf( PICO_ERROR, "Could not find material/submaterial for id %d/%d\n", mtlIdParent, subMtlId ); - return NULL; -} - - - - static aseMaterial_t* _ase_add_material( aseMaterial_t **list, int mtlIdParent ) { aseMaterial_t *mtl = _pico_calloc( 1, sizeof( aseMaterial_t ) ); @@ -205,6 +183,71 @@ static void _ase_print_materials( aseMaterial_t *list ) } #endif //DEBUG_PM_ASE +/* ASE Face management */ +/* These are used to keep an association between a submaterial and a face definition */ +/* They are kept in parallel with the current picoSurface, */ +/* and are used by _ase_submit_triangles to lookup the proper material/submaterial IDs */ +typedef struct aseFace_s +{ + struct aseFace_s* next; + int mtlId; + int subMtlId; + int index[9]; +} aseFace_t; + +/* ASE Face management functions */ +void _ase_add_face( aseFace_t **list, aseFace_t **tail, aseFace_t *newFace ) +{ + aseFace_t* face = *list; + aseFace_t* tempFace = NULL; + + /* insert as head of list */ + if ( !(*list) ) + { + *list = newFace; + } + else + { + (*tail)->next = newFace; + } + + *tail = newFace; + newFace->next = NULL; + + //tag the color indices so we can detect them and apply the default color to them + newFace->index[6] = -1; + newFace->index[7] = -1; + newFace->index[8] = -1; +} + +aseFace_t* _ase_get_face_for_index( aseFace_t *list, int index ) +{ + int counter = 0; + aseFace_t* face = list; + + while ( counter < index ) + { + face = face->next; + counter++; + } + return face; +} +static void _ase_free_faces (aseFace_t** list, aseFace_t** tail ) +{ + aseFace_t* face = *list; + aseFace_t* tempFace = NULL; + + while ( face ) + { + tempFace = face->next; + _pico_free ( face ); + face = tempFace; + } + + (*list) = NULL; + (*tail) = NULL; +} + /* todo: * - apply material specific uv offsets to uv coordinates */ @@ -249,68 +292,7 @@ static int _ase_canload( PM_PARAMS_CANLOAD ) return PICO_PMV_OK; } -typedef struct aseVertex_s aseVertex_t; -struct aseVertex_s -{ - picoVec3_t xyz; - picoVec3_t normal; - picoIndex_t id; -}; -typedef struct aseTexCoord_s aseTexCoord_t; -struct aseTexCoord_s -{ - picoVec2_t texcoord; -}; - -typedef struct aseColor_s aseColor_t; -struct aseColor_s -{ - picoColor_t color; -}; - -typedef struct aseFace_s aseFace_t; -struct aseFace_s -{ - picoIndex_t indices[9]; - picoIndex_t smoothingGroup; - picoIndex_t materialId; - picoIndex_t subMaterialId; -}; -typedef aseFace_t* aseFacesIter_t; - -picoSurface_t* PicoModelFindOrAddSurface( picoModel_t *model, picoShader_t* shader ) -{ - /* see if a surface already has the shader */ - int i = 0; - for ( ; i < model->numSurfaces ; i++ ) - { - picoSurface_t* workSurface = model->surface[i]; - if ( workSurface->shader == shader ) - { - return workSurface; - } - } - - /* no surface uses this shader yet, so create a new surface */ - - { - /* create a new surface in the model for the unique shader */ - picoSurface_t* workSurface = PicoNewSurface(model); - if ( !workSurface ) - { - _pico_printf ( PICO_ERROR , "Could not allocate a new surface!\n" ); - return 0; - } - - /* do surface setup */ - PicoSetSurfaceType( workSurface, PICO_TRIANGLES ); - PicoSetSurfaceName( workSurface, shader->name ); - PicoSetSurfaceShader( workSurface, shader ); - - return workSurface; - } -} /* _ase_submit_triangles - jhefty use the surface and the current face list to look up material/submaterial IDs @@ -322,197 +304,57 @@ The following still holds from ydnar's _ase_make_surface: indexes 6 7 8 = color indexes (new) */ -#if 0 -typedef picoIndex_t* picoIndexIter_t; - -typedef struct aseUniqueIndices_s aseUniqueIndices_t; -struct aseUniqueIndices_s +static void _ase_submit_triangles ( picoSurface_t* surface , picoModel_t* model , aseMaterial_t* materials , aseFace_t* faces ) { - picoIndex_t* data; - picoIndex_t* last; + aseFace_t* face; + aseSubMaterial_t* subMtl; + picoVec3_t* xyz[3]; + picoVec3_t* normal[3]; + picoVec2_t* st[3]; + picoColor_t* color[3]; + int i; - aseFace_t* faces; -}; - -size_t aseUniqueIndices_size(aseUniqueIndices_t* self) -{ - return self->last - self->data; -} - -void aseUniqueIndices_reserve(aseUniqueIndices_t* self, picoIndex_t size) -{ - self->data = self->last = (picoIndex_t*)_pico_calloc(size, sizeof(picoIndex_t)); -} - -void aseUniqueIndices_clear(aseUniqueIndices_t* self) -{ - _pico_free(self->data); -} - -void aseUniqueIndices_pushBack(aseUniqueIndices_t* self, picoIndex_t index) -{ - *self->last++ = index; -} - -picoIndex_t aseFaces_getVertexIndex(aseFace_t* faces, picoIndex_t index) -{ - return faces[index / 3].indices[index % 3]; -} - -picoIndex_t aseFaces_getTexCoordIndex(aseFace_t* faces, picoIndex_t index) -{ - return faces[index / 3].indices[(index % 3) + 3]; -} - -picoIndex_t aseFaces_getColorIndex(aseFace_t* faces, picoIndex_t index) -{ - return faces[index / 3].indices[(index % 3) + 6]; -} - -int aseUniqueIndex_equal(aseFace_t* faces, picoIndex_t index, picoIndex_t other) -{ - return aseFaces_getVertexIndex(faces, index) == aseFaces_getVertexIndex(faces, other) - && aseFaces_getTexCoordIndex(faces, index) == aseFaces_getTexCoordIndex(faces, other) - && aseFaces_getColorIndex(faces, index) == aseFaces_getColorIndex(faces, other); -} - -picoIndex_t aseUniqueIndices_insertUniqueVertex(aseUniqueIndices_t* self, picoIndex_t index) -{ - picoIndexIter_t i = self->data; - for(; i != self->last; ++i) - { - picoIndex_t other = (picoIndex_t)(i - self->data); - if(aseUniqueIndex_equal(self->faces, index, other)) - { - return other; - } - } - - aseUniqueIndices_pushBack(self, index); - return (picoIndex_t)(aseUniqueIndices_size(self) - 1); -} - -static void _ase_submit_triangles_unshared ( picoModel_t* model , aseMaterial_t* materials , aseVertex_t* vertices, aseTexCoord_t* texcoords, aseColor_t* colors, aseFace_t* faces, int numFaces, int meshHasNormals ) -{ - aseFacesIter_t i = faces, end = faces + numFaces; - - aseUniqueIndices_t indices; - aseUniqueIndices_t remap; - aseUniqueIndices_reserve(&indices, numFaces * 3); - aseUniqueIndices_reserve(&remap, numFaces * 3); - indices.faces = faces; - - for(; i != end; ++i) + face = faces; + while ( face != NULL ) { /* look up the shader for the material/submaterial pair */ - aseSubMaterial_t* subMtl = _ase_get_submaterial_or_default( materials, (*i).materialId, (*i).subMaterialId ); + subMtl = _ase_get_submaterial( materials, face->mtlId, face->subMtlId ); if( subMtl == NULL ) { - return; - } - - { - picoSurface_t* surface = PicoModelFindOrAddSurface(model, subMtl->shader); - int j; - /* we pull the data from the vertex, color and texcoord arrays using the face index data */ - for ( j = 0 ; j < 3 ; j ++ ) + /* ydnar: trying default submaterial */ + subMtl = _ase_get_submaterial( materials, face->mtlId, 0 ); + if( subMtl == NULL ) { - picoIndex_t index = (picoIndex_t)(((i - faces) * 3) + j); - picoIndex_t size = (picoIndex_t)aseUniqueIndices_size(&indices); - picoIndex_t unique = aseUniqueIndices_insertUniqueVertex(&indices, index); - - picoIndex_t numVertexes = PicoGetSurfaceNumVertexes(surface); - picoIndex_t numIndexes = PicoGetSurfaceNumIndexes(surface); - - aseUniqueIndices_pushBack(&remap, numIndexes); - - PicoSetSurfaceIndex(surface, numIndexes, remap.data[unique]); - - if(unique == size) - { - PicoSetSurfaceXYZ(surface, numVertexes, vertices[(*i).indices[j]].xyz); - PicoSetSurfaceNormal(surface, numVertexes, vertices[(*i).indices[j]].normal); - PicoSetSurfaceST(surface, 0, numVertexes, texcoords[(*i).indices[j + 3]].texcoord); - - if ( (*i).indices[j + 6] >= 0 ) - { - PicoSetSurfaceColor(surface, 0, numVertexes, colors[(*i).indices[j + 6]].color); - } - else - { - PicoSetSurfaceColor(surface, 0, numVertexes, white); - } - - PicoSetSurfaceSmoothingGroup(surface, numVertexes, (vertices[(*i).indices[j]].id * (1 << 16)) + (*i).smoothingGroup); - } + _pico_printf( PICO_ERROR, "Could not find material/submaterial for id %d/%d\n", face->mtlId, face->subMtlId ); + return; } } - } - - aseUniqueIndices_clear(&indices); - aseUniqueIndices_clear(&remap); -} - -#endif - -static void _ase_submit_triangles( picoModel_t* model , aseMaterial_t* materials , aseVertex_t* vertices, aseTexCoord_t* texcoords, aseColor_t* colors, aseFace_t* faces, int numFaces ) -{ - aseFacesIter_t i = faces, end = faces + numFaces; - for(; i != end; ++i) - { - /* look up the shader for the material/submaterial pair */ - aseSubMaterial_t* subMtl = _ase_get_submaterial_or_default( materials, (*i).materialId, (*i).subMaterialId ); - if( subMtl == NULL ) + + /* we pull the data from the surface using the facelist data */ + for ( i = 0 ; i < 3 ; i ++ ) { - return; - } - - { - picoVec3_t* xyz[3]; - picoVec3_t* normal[3]; - picoVec2_t* st[3]; - picoColor_t* color[3]; - picoIndex_t smooth[3]; - int j; - /* we pull the data from the vertex, color and texcoord arrays using the face index data */ - for ( j = 0 ; j < 3 ; j ++ ) + xyz[i] = (picoVec3_t*) PicoGetSurfaceXYZ ( surface, face->index[ i ] ); + normal[i] = (picoVec3_t*) PicoGetSurfaceNormal( surface, face->index[ i ] ); + st[i] = (picoVec2_t*) PicoGetSurfaceST ( surface, 0, face->index[ i + 3 ] ); + + if ( face->index [ i + 6] >= 0 ) { - xyz[j] = &vertices[(*i).indices[j]].xyz; - normal[j] = &vertices[(*i).indices[j]].normal; - st[j] = &texcoords[(*i).indices[j + 3]].texcoord; - - if( colors != NULL && (*i).indices[j + 6] >= 0 ) - { - color[j] = &colors[(*i).indices[j + 6]].color; - } - else - { - color[j] = &white; - } - - smooth[j] = (vertices[(*i).indices[j]].id * (1 << 16)) + (*i).smoothingGroup; /* don't merge vertices */ - + color[i] = (picoColor_t*)PicoGetSurfaceColor ( surface, 0, face->index[ i + 6 ] ); } - - /* submit the triangle to the model */ - PicoAddTriangleToModel ( model , xyz , normal , 1 , st , 1 , color , subMtl->shader, smooth ); + else + { + color[i] = &white; + } + } - } -} -static void shadername_convert(char* shaderName) -{ - /* unix-style path separators */ - char* s = shaderName; - for(; *s != '\0'; ++s) - { - if(*s == '\\') - { - *s = '/'; - } - } -} + /* submit the triangle to the model */ + PicoAddTriangleToModel ( model , xyz , normal , 1 , st , 1 , color , subMtl->shader ); + /* advance to the next face */ + face = face->next; + } +} /* _ase_load: * loads a 3dsmax ase model file. @@ -520,21 +362,12 @@ static void shadername_convert(char* shaderName) static picoModel_t *_ase_load( PM_PARAMS_LOAD ) { picoModel_t *model; + picoSurface_t *surface = NULL; picoParser_t *p; char lastNodeName[ 1024 ]; - aseVertex_t* vertices = NULL; - aseTexCoord_t* texcoords = NULL; - aseColor_t* colors = NULL; aseFace_t* faces = NULL; - int numVertices = 0; - int numFaces = 0; - int numTextureVertices = 0; - int numTextureVertexFaces = 0; - int numColorVertices = 0; - int numColorVertexFaces = 0; - int vertexId = 0; - + aseFace_t* facesTail = NULL; aseMaterial_t* materials = NULL; #ifdef DEBUG_PM_ASE @@ -602,50 +435,17 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) else if (!_pico_stricmp(p->token,"*mesh")) { /* finish existing surface */ - _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces); - _pico_free(faces); - _pico_free(vertices); - _pico_free(texcoords); - _pico_free(colors); - } - else if (!_pico_stricmp(p->token,"*mesh_numvertex")) - { - if (!_pico_parse_int( p, &numVertices) ) - _ase_error_return("Missing MESH_NUMVERTEX value"); - - vertices = _pico_calloc(numVertices, sizeof(aseVertex_t)); - } - else if (!_pico_stricmp(p->token,"*mesh_numfaces")) - { - if (!_pico_parse_int( p, &numFaces) ) - _ase_error_return("Missing MESH_NUMFACES value"); - - faces = _pico_calloc(numFaces, sizeof(aseFace_t)); - } - else if (!_pico_stricmp(p->token,"*mesh_numtvertex")) - { - if (!_pico_parse_int( p, &numTextureVertices) ) - _ase_error_return("Missing MESH_NUMTVERTEX value"); - - texcoords = _pico_calloc(numTextureVertices, sizeof(aseTexCoord_t)); - } - else if (!_pico_stricmp(p->token,"*mesh_numtvfaces")) - { - if (!_pico_parse_int( p, &numTextureVertexFaces) ) - _ase_error_return("Missing MESH_NUMTVFACES value"); - } - else if (!_pico_stricmp(p->token,"*mesh_numcvertex")) - { - if (!_pico_parse_int( p, &numColorVertices) ) - _ase_error_return("Missing MESH_NUMCVERTEX value"); - - colors = _pico_calloc(numColorVertices, sizeof(aseColor_t)); - memset( colors, 255, numColorVertices * sizeof( aseColor_t ) ); /* ydnar: force colors to white initially */ - } - else if (!_pico_stricmp(p->token,"*mesh_numcvfaces")) - { - if (!_pico_parse_int( p, &numColorVertexFaces) ) - _ase_error_return("Missing MESH_NUMCVFACES value"); + //_ase_make_surface( model, &surface ); + _ase_submit_triangles (surface, model ,materials,faces); + _ase_free_faces (&faces,&facesTail); + + /* allocate new pico surface */ + surface = PicoNewSurface( NULL ); + if (surface == NULL) + { + PicoFreeModel( model ); + return NULL; + } } /* mesh material reference. this usually comes at the end of */ /* geomobjects after the mesh blocks. we must assume that the */ @@ -654,59 +454,72 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) else if (!_pico_stricmp(p->token,"*material_ref")) { int mtlId; + aseFace_t* face; + + /* we must have a valid surface */ + if( surface == NULL ) + _ase_error_return("Missing mesh for material reference"); /* get the material ref (0..n) */ if (!_pico_parse_int( p,&mtlId) ) _ase_error_return("Missing material reference ID"); + /* fix up all of the aseFaceList in the surface to point to the parent material */ + /* we've already saved off their subMtl */ + face = faces; + while ( face != NULL ) { - int i = 0; - /* fix up all of the aseFaceList in the surface to point to the parent material */ - /* we've already saved off their subMtl */ - for(; i < numFaces; ++i) - { - faces[i].materialId = mtlId; - } + face->mtlId = mtlId; + face = face->next; } } /* model mesh vertex */ else if (!_pico_stricmp(p->token,"*mesh_vertex")) { + picoVec3_t v; int index; - if( numVertices == 0 ) - _ase_error_return("Vertex parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get vertex data (orig: index +y -x +z) */ if (!_pico_parse_int( p,&index )) _ase_error_return("Vertex parse error"); - if (!_pico_parse_vec( p,vertices[index].xyz )) + if (!_pico_parse_vec( p,v )) _ase_error_return("Vertex parse error"); - vertices[index].id = vertexId++; + /* set vertex */ + PicoSetSurfaceXYZ( surface,index,v ); } /* model mesh vertex normal */ else if (!_pico_stricmp(p->token,"*mesh_vertexnormal")) { + picoVec3_t v; int index; - if( numVertices == 0 ) - _ase_error_return("Vertex parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get vertex data (orig: index +y -x +z) */ if (!_pico_parse_int( p,&index )) _ase_error_return("Vertex parse error"); - if (!_pico_parse_vec( p,vertices[index].normal )) + if (!_pico_parse_vec( p,v )) _ase_error_return("Vertex parse error"); + + /* set vertex */ + PicoSetSurfaceNormal( surface,index,v ); } /* model mesh face */ else if (!_pico_stricmp(p->token,"*mesh_face")) { picoIndex_t indexes[3]; - int index; - - if( numFaces == 0 ) - _ase_error_return("Face parse error"); + int index; + + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get face index */ if (!_pico_parse_int( p,&index )) @@ -726,60 +539,75 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) _pico_parse( p,0 ); if (!_pico_parse_int( p,&indexes[2] )) _ase_error_return("Face parse error"); + + /* set face indexes (note interleaved offset!) */ + PicoSetSurfaceIndex( surface, (index * 9 + 0), indexes[2] ); + PicoSetSurfaceIndex( surface, (index * 9 + 1), indexes[1] ); + PicoSetSurfaceIndex( surface, (index * 9 + 2), indexes[0] ); /* parse to the subMaterial ID */ while ( 1 ) { - if (!_pico_parse (p,0)) /* EOL */ - { - break; - } - if (!_pico_stricmp (p->token,"*MESH_SMOOTHING" )) - { - _pico_parse_int ( p , &faces[index].smoothingGroup ); - } + _pico_parse (p,0); if (!_pico_stricmp (p->token,"*MESH_MTLID" )) { - _pico_parse_int ( p , &faces[index].subMaterialId ); + aseFace_t* newFace; + int subMtlId; + + _pico_parse_int ( p , &subMtlId ); + newFace = _pico_calloc ( 1 , sizeof ( aseFace_t )); + + /* we fix up the mtlId later when we parse the material_ref */ + newFace->mtlId = 0; + newFace->subMtlId = subMtlId; + newFace->index[0] = indexes[2]; + newFace->index[1] = indexes[1]; + newFace->index[2] = indexes[0]; + + _ase_add_face ( &faces,&facesTail,newFace ); + break; } } - faces[index].materialId = 0; - faces[index].indices[0] = indexes[2]; - faces[index].indices[1] = indexes[1]; - faces[index].indices[2] = indexes[0]; } /* model texture vertex */ else if (!_pico_stricmp(p->token,"*mesh_tvert")) { + picoVec2_t uv; int index; - if( numVertices == 0 ) - _ase_error_return("Texture Vertex parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get uv vertex index */ - if (!_pico_parse_int( p,&index ) || index >= numTextureVertices) - _ase_error_return("Texture vertex parse error"); + if (!_pico_parse_int( p,&index )) + _ase_error_return("UV vertex parse error"); /* get uv vertex s */ - if (!_pico_parse_float( p,&texcoords[index].texcoord[0] )) - _ase_error_return("Texture vertex parse error"); + if (!_pico_parse_float( p,&uv[0] )) + _ase_error_return("UV vertex parse error"); /* get uv vertex t */ - if (!_pico_parse_float( p,&texcoords[index].texcoord[1] )) - _ase_error_return("Texture vertex parse error"); + if (!_pico_parse_float( p,&uv[1] )) + _ase_error_return("UV vertex parse error"); /* ydnar: invert t */ - texcoords[index].texcoord[ 1 ] = 1.0f - texcoords[index].texcoord[ 1 ]; + uv[ 1 ] = 1.0f - uv[ 1 ]; + + /* set texture vertex */ + PicoSetSurfaceST( surface,0,index,uv ); } /* ydnar: model mesh texture face */ else if( !_pico_stricmp( p->token, "*mesh_tface" ) ) { picoIndex_t indexes[3]; int index; + aseFace_t* face; - if( numFaces == 0 ) - _ase_error_return("Texture face parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get face index */ if (!_pico_parse_int( p,&index )) @@ -796,50 +624,63 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) /* get 3rd vertex index */ if (!_pico_parse_int( p,&indexes[2] )) _ase_error_return("Texture face parse error"); + + /* set face indexes (note interleaved offset!) */ + PicoSetSurfaceIndex( surface, (index * 9 + 3), indexes[2] ); + PicoSetSurfaceIndex( surface, (index * 9 + 4), indexes[1] ); + PicoSetSurfaceIndex( surface, (index * 9 + 5), indexes[0] ); - faces[index].indices[3] = indexes[2]; - faces[index].indices[4] = indexes[1]; - faces[index].indices[5] = indexes[0]; + face = _ase_get_face_for_index(faces,index); + face->index[3] = indexes[2]; + face->index[4] = indexes[1]; + face->index[5] = indexes[0]; } /* model color vertex */ else if (!_pico_stricmp(p->token,"*mesh_vertcol")) { + picoColor_t color; int index; float colorInput; - if( numVertices == 0 ) - _ase_error_return("Color Vertex parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get color vertex index */ if (!_pico_parse_int( p,&index )) - _ase_error_return("Color vertex parse error"); + _ase_error_return("UV vertex parse error"); /* get R component */ if (!_pico_parse_float( p,&colorInput )) - _ase_error_return("Color vertex parse error"); - colors[index].color[0] = (picoByte_t)(colorInput * 255); + _ase_error_return("color vertex parse error"); + color[0] = (picoByte_t)(colorInput * 255); /* get G component */ if (!_pico_parse_float( p,&colorInput )) - _ase_error_return("Color vertex parse error"); - colors[index].color[1] = (picoByte_t)(colorInput * 255); + _ase_error_return("color vertex parse error"); + color[1] = (picoByte_t)(colorInput * 255); /* get B component */ if (!_pico_parse_float( p,&colorInput )) - _ase_error_return("Color vertex parse error"); - colors[index].color[2] = (picoByte_t)(colorInput * 255); + _ase_error_return("color vertex parse error"); + color[2] = (picoByte_t)(colorInput * 255); /* leave alpha alone since we don't get any data from the ASE format */ - colors[index].color[3] = 255; + color[3] = 255; + + /* set texture vertex */ + PicoSetSurfaceColor( surface,0,index,color ); } /* model color face */ else if (!_pico_stricmp(p->token,"*mesh_cface")) { picoIndex_t indexes[3]; int index; + aseFace_t* face; - if( numFaces == 0 ) - _ase_error_return("Face parse error"); + /* we must have a valid surface */ + if( surface == NULL ) + continue; /* get face index */ if (!_pico_parse_int( p,&index )) @@ -860,9 +701,15 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) if (!_pico_parse_int( p,&indexes[2] )) _ase_error_return("Face parse error"); - faces[index].indices[6] = indexes[2]; - faces[index].indices[7] = indexes[1]; - faces[index].indices[8] = indexes[0]; + /* set face indexes (note interleaved offset!) */ + PicoSetSurfaceIndex( surface, (index * 9 + 6), indexes[2] ); + PicoSetSurfaceIndex( surface, (index * 9 + 7), indexes[1] ); + PicoSetSurfaceIndex( surface, (index * 9 + 8), indexes[0] ); + + face = _ase_get_face_for_index(faces,index); + face->index[6] = indexes[2]; + face->index[7] = indexes[1]; + face->index[8] = indexes[0]; } /* model material */ else if( !_pico_stricmp( p->token, "*material" ) ) @@ -899,8 +746,6 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) if( level == subMaterialLevel ) { /* set material name */ - _pico_first_token( materialName ); - shadername_convert(materialName); PicoSetShaderName( shader, materialName); /* set shader's transparency */ @@ -1085,7 +930,6 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) } /* set material name */ - shadername_convert(materialName); PicoSetShaderName( shader,materialName ); /* set shader's transparency */ @@ -1109,39 +953,7 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) /* set material map name */ PicoSetShaderMapName( shader, mapname ); - /* extract shadername from bitmap path */ - if(mapname != NULL) - { - char* p = mapname; - - /* convert to shader-name format */ - shadername_convert(mapname); - { - /* remove extension */ - char* last_period = strrchr(p, '.'); - if(last_period != NULL) - { - *last_period = '\0'; - } - } - - /* find shader path */ - for(; *p != '\0'; ++p) - { - if(_pico_strnicmp(p, "models/", 7) == 0 || _pico_strnicmp(p, "textures/", 9) == 0) - { - break; - } - } - - if(*p != '\0') - { - /* set material name */ - PicoSetShaderName( shader,p ); - } - } - - /* this is just a material with 1 submaterial */ + /* this is just a material with 1 submaterial */ subMaterial = _ase_add_submaterial( &materials, index, 0, shader ); } @@ -1155,11 +967,9 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) } /* ydnar: finish existing surface */ - _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces); - _pico_free(faces); - _pico_free(vertices); - _pico_free(texcoords); - _pico_free(colors); +// _ase_make_surface( model, &surface ); + _ase_submit_triangles (surface, model ,materials,faces); + _ase_free_faces (&faces,&facesTail); #ifdef DEBUG_PM_ASE _ase_print_materials(materials); @@ -1170,8 +980,6 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ) _ase_free_materials(&materials); - _pico_free_parser( p ); - /* return allocated pico model */ return model; } diff --git a/libs/picomodel/pm_fm.c b/libs/picomodel/pm_fm.c index 4e64fe6d..bb3216c3 100644 --- a/libs/picomodel/pm_fm.c +++ b/libs/picomodel/pm_fm.c @@ -220,6 +220,9 @@ static picoModel_t *_fm_load( PM_PARAMS_LOAD ) picoColor_t color; + // fm loading + _pico_printf( PICO_NORMAL, "Loading \"%s\"", fileName ); + bb = (picoByte_t*) buffer; // Header Header diff --git a/libs/picomodel/pm_lwo.c b/libs/picomodel/pm_lwo.c index e36bb6f2..d7b3bc8a 100644 --- a/libs/picomodel/pm_lwo.c +++ b/libs/picomodel/pm_lwo.c @@ -108,7 +108,7 @@ static picoModel_t *_lwo_load( PM_PARAMS_LOAD ) lwPolygon *pol; lwPolVert *v; lwVMapPt *vm; - char name[ 256 ]; + char name[ 64 ]; int i, j, k, numverts; picoModel_t *picoModel; @@ -248,7 +248,6 @@ static picoModel_t *_lwo_load( PM_PARAMS_LOAD ) /* detox and set shader name */ strncpy( name, surface->name, sizeof(name) ); - _pico_first_token( name ); _pico_setfext( name, "" ); _pico_unixify( name ); PicoSetShaderName( picoShader, name ); @@ -298,23 +297,9 @@ static picoModel_t *_lwo_load( PM_PARAMS_LOAD ) xyz[ 1 ] = pt->pos[ 2 ]; xyz[ 2 ] = pt->pos[ 1 ]; -/* doom3 lwo data doesn't seem to have smoothing-angle information */ -#if 0 - if(surface->smooth <= 0) - { - /* use face normals */ - normal[ 0 ] = v->norm[ 0 ]; - normal[ 1 ] = v->norm[ 2 ]; - normal[ 2 ] = v->norm[ 1 ]; - } - else -#endif - { - /* smooth normals later */ - normal[ 0 ] = 0; - normal[ 1 ] = 0; - normal[ 2 ] = 0; - } + normal[ 0 ] = v->norm[ 0 ]; + normal[ 1 ] = v->norm[ 2 ]; + normal[ 2 ] = v->norm[ 1 ]; st[ 0 ] = xyz[ defaultSTAxis[ 0 ] ] * defaultXYZtoSTScale[ 0 ]; st[ 1 ] = xyz[ defaultSTAxis[ 1 ] ] * defaultXYZtoSTScale[ 1 ]; diff --git a/libs/picomodel/pm_md2.c b/libs/picomodel/pm_md2.c index bf78a99b..b0ff40ca 100644 --- a/libs/picomodel/pm_md2.c +++ b/libs/picomodel/pm_md2.c @@ -337,9 +337,10 @@ static picoModel_t *_md2_load( PM_PARAMS_LOAD ) index_DUP_LUT_t *p_index_LUT_DUPS; md2Triangle_t *p_md2Triangle; + char path[ MD2_MAX_SKINNAME ]; char skinname[ MD2_MAX_SKINNAME ]; - md2_t *md2; - md2St_t *texCoord; + md2_t *md2; + md2St_t *texCoord; md2Frame_t *frame; md2Triangle_t *triangle; md2XyzNormal_t *vertex; @@ -353,6 +354,9 @@ static picoModel_t *_md2_load( PM_PARAMS_LOAD ) picoColor_t color; + // md2 loading + _pico_printf( PICO_NORMAL, "Loading \"%s\"", fileName ); + /* set as md2 */ bb = (picoByte_t*) buffer; md2 = (md2_t*) buffer; @@ -432,8 +436,25 @@ static picoModel_t *_md2_load( PM_PARAMS_LOAD ) strncpy(skinname, (bb + md2->ofsSkins), MD2_MAX_SKINNAME ); // Print out md2 values - _pico_printf(PICO_VERBOSE,"Skins: %d Verts: %d STs: %d Triangles: %d Frames: %d\nSkin Name \"%s\"\n", md2->numSkins, md2->numXYZ, md2->numST, md2->numTris, md2->numFrames, &skinname ); + _pico_printf(PICO_VERBOSE,"Skins: %d Verts: %d STs: %d Triangles: %d Frames: %d\nSkin Name \"%s\"\n", md2->numSkins, md2->numXYZ, md2->numST, md2->numTris, md2->numFrames, skinname ); + // relative texture path - allows moving of models in game dir structure without changing the skinpath + // e.g. used in ufo:ai + if (skinname[0] == '.') { + strncpy(path, fileName, MD2_MAX_SKINNAME); + for (i = MD2_MAX_SKINNAME; i--;) { + // skip filename + if (path[i] == '/' || path[i] == '\\') + break; + path[i] = '\0'; + } + strncat(path, &skinname[1], MD2_MAX_SKINNAME); + strncpy(skinname, path, MD2_MAX_SKINNAME); + + // Print out md2 values + _pico_printf(PICO_VERBOSE,"Relative skin path converted to: \"%s\" (%s)\n", skinname, fileName ); + } + // detox Skin name _pico_setfext( skinname, "" ); _pico_unixify( skinname ); diff --git a/libs/picomodel/pm_ms3d.c b/libs/picomodel/pm_ms3d.c index cf411eed..27147bc0 100644 --- a/libs/picomodel/pm_ms3d.c +++ b/libs/picomodel/pm_ms3d.c @@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "picointernal.h" /* disable warnings */ -#ifdef WIN32 +#ifdef _WIN32 #pragma warning( disable:4100 ) /* unref param */ #endif diff --git a/libs/picomodel/pm_obj.c b/libs/picomodel/pm_obj.c index 3dc94867..6cb40668 100644 --- a/libs/picomodel/pm_obj.c +++ b/libs/picomodel/pm_obj.c @@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "picointernal.h" /* disable warnings */ -#ifdef WIN32 +#ifdef _WIN32 #pragma warning( disable:4100 ) /* unref param */ #endif @@ -240,7 +240,7 @@ static int _obj_mtl_load( picoModel_t *model ) return 0; \ } /* alloc copy of model file name */ - fileName = _pico_clone_alloc( model->fileName ); + fileName = _pico_clone_alloc( model->fileName,-1 ); if (fileName == NULL) return 0; diff --git a/libs/picomodel/pm_terrain.c b/libs/picomodel/pm_terrain.c deleted file mode 100644 index a54a8348..00000000 --- a/libs/picomodel/pm_terrain.c +++ /dev/null @@ -1,610 +0,0 @@ -/* ----------------------------------------------------------------------------- - -PicoModel Library - -Copyright (c) 2003, Randy Reddig & seaw0lf -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -Neither the names of the copyright holders nor the names of its contributors may -be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------ */ - - - -/* marker */ -#define PM_TERRAIN_C - - - -/* dependencies */ -#include "picointernal.h" - - - -typedef struct tga_s -{ - unsigned char id_length, colormap_type, image_type; - unsigned short colormap_index, colormap_length; - unsigned char colormap_size; - unsigned short x_origin, y_origin, width, height; - unsigned char pixel_size, attributes; -} -tga_t; - - - -/* -_terrain_load_tga_buffer() -loads a tga image into a newly allocated image buffer -fixme: replace/clean this function -*/ - -void _terrain_load_tga_buffer( unsigned char *buffer, unsigned char **pic, int *width, int *height ) -{ - int row, column; - int columns, rows, numPixels; - unsigned char *pixbuf; - unsigned char *buf_p; - tga_t targa_header; - unsigned char *targa_rgba; - - - *pic = NULL; - - if( buffer == NULL ) - return; - - buf_p = buffer; - - targa_header.id_length = *buf_p++; - targa_header.colormap_type = *buf_p++; - targa_header.image_type = *buf_p++; - - targa_header.colormap_index = _pico_little_short ( *(short*)buf_p ); - buf_p += 2; - targa_header.colormap_length = _pico_little_short ( *(short*) buf_p ); - buf_p += 2; - targa_header.colormap_size = *buf_p++; - targa_header.x_origin = _pico_little_short ( *(short*) buf_p ); - buf_p += 2; - targa_header.y_origin = _pico_little_short ( *(short*) buf_p ); - buf_p += 2; - targa_header.width = _pico_little_short ( *(short*) buf_p ); - buf_p += 2; - targa_header.height = _pico_little_short ( *(short*) buf_p ); - buf_p += 2; - targa_header.pixel_size = *buf_p++; - targa_header.attributes = *buf_p++; - - if( targa_header.image_type != 2 && targa_header.image_type != 10 && targa_header.image_type != 3 ) - { - _pico_printf( PICO_ERROR, "Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n"); - pic = NULL; - return; - } - - if( targa_header.colormap_type != 0 ) - { - _pico_printf( PICO_ERROR, "Indexed color TGA images not supported\n" ); - return; - } - - if( targa_header.pixel_size != 32 && targa_header.pixel_size != 24 && targa_header.image_type != 3 ) - { - _pico_printf( PICO_ERROR, "Only 32 or 24 bit TGA images supported (not indexed color)\n"); - pic = NULL; - return; - } - - columns = targa_header.width; - rows = targa_header.height; - numPixels = columns * rows; - - if (width) - *width = columns; - if (height) - *height = rows; - - targa_rgba = _pico_alloc( numPixels * 4 ); - *pic = targa_rgba; - - if (targa_header.id_length != 0) - buf_p += targa_header.id_length; // skip TARGA image comment - - if ( targa_header.image_type==2 || targa_header.image_type == 3 ) - { - // Uncompressed RGB or gray scale image - for(row=rows-1; row>=0; row--) - { - pixbuf = targa_rgba + row*columns*4; - for(column=0; column=0; row--) { - pixbuf = targa_rgba + row*columns*4; - for(column=0; column0) - row--; - else - goto breakOut; - pixbuf = targa_rgba + row*columns*4; - } - } - } - else { // non run-length packet - for(j=0;j0) - row--; - else - goto breakOut; - pixbuf = targa_rgba + row*columns*4; - } - } - } - } - breakOut:; - } - } - - /* fix vertically flipped image */ - if( (targa_header.attributes & (1<<5)) ) - { - int flip; - for (row = 0; row < .5f * rows; row++) - { - for (column = 0; column < columns; column++) - { - flip = *( (int*)targa_rgba + row * columns + column); - *( (int*)targa_rgba + row * columns + column) = *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ); - *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ) = flip; - } - } - } -} - - - -/* -_terrain_canload() -validates a picoterrain file -*/ - -static int _terrain_canload( PM_PARAMS_CANLOAD ) -{ - picoParser_t *p; - - - /* keep the friggin compiler happy */ - *fileName = *fileName; - - /* create pico parser */ - p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); - if( p == NULL ) - return PICO_PMV_ERROR_MEMORY; - - /* get first token */ - if( _pico_parse_first( p ) == NULL) - return PICO_PMV_ERROR_IDENT; - - /* check first token */ - if( _pico_stricmp( p->token, "picoterrain" ) ) - { - _pico_free_parser( p ); - return PICO_PMV_ERROR_IDENT; - } - - /* free the pico parser object */ - _pico_free_parser( p ); - - /* file seems to be a valid picoterrain file */ - return PICO_PMV_OK; -} - - - -/* -_terrain_load() -loads a picoterrain file -*/ - -static picoModel_t *_terrain_load( PM_PARAMS_LOAD ) -{ - int i, j, v, pw[ 5 ], r; - picoParser_t *p; - - char *shader, *heightmapFile, *colormapFile; - picoVec3_t scale, origin; - - unsigned char *imageBuffer; - int imageBufSize, w, h, cw, ch; - unsigned char *heightmap, *colormap, *heightPixel, *colorPixel; - - picoModel_t *picoModel; - picoSurface_t *picoSurface; - picoShader_t *picoShader; - picoVec3_t xyz, normal; - picoVec2_t st; - picoColor_t color; - - - /* keep the friggin compiler happy */ - *fileName = *fileName; - - /* create pico parser */ - p = _pico_new_parser( (picoByte_t*) buffer, bufSize ); - if( p == NULL ) - return NULL; - - /* get first token */ - if( _pico_parse_first( p ) == NULL) - return NULL; - - /* check first token */ - if( _pico_stricmp( p->token, "picoterrain" ) ) - { - _pico_printf( PICO_ERROR, "Invalid PicoTerrain model" ); - _pico_free_parser( p ); - return NULL; - } - - /* setup */ - shader = heightmapFile = colormapFile = NULL; - _pico_set_vec( scale, 512, 512, 32 ); - - /* parse ase model file */ - while( 1 ) - { - /* get first token on line */ - if( !_pico_parse_first( p ) ) - break; - - /* skip empty lines */ - if( !p->token || !p->token[ 0 ] ) - continue; - - /* shader */ - if( !_pico_stricmp( p->token, "shader" ) ) - { - if( _pico_parse( p, 0 ) && p->token[ 0 ] ) - { - if( shader != NULL ) - _pico_free( shader ); - shader = _pico_clone_alloc( p->token ); - } - } - - /* heightmap */ - else if( !_pico_stricmp( p->token, "heightmap" ) ) - { - if( _pico_parse( p, 0 ) && p->token[ 0 ] ) - { - if( heightmapFile != NULL ) - _pico_free( heightmapFile ); - heightmapFile = _pico_clone_alloc( p->token ); - } - } - - /* colormap */ - else if( !_pico_stricmp( p->token, "colormap" ) ) - { - if( _pico_parse( p, 0 ) && p->token[ 0 ] ) - { - if( colormapFile != NULL ) - _pico_free( colormapFile ); - colormapFile = _pico_clone_alloc( p->token ); - } - } - - /* scale */ - else if( !_pico_stricmp( p->token, "scale" ) ) - { - _pico_parse_vec( p, scale ); - } - - /* skip unparsed rest of line and continue */ - _pico_parse_skip_rest( p ); - } - - /* ----------------------------------------------------------------- */ - - /* load heightmap */ - heightmap = imageBuffer = NULL; - _pico_load_file( heightmapFile, &imageBuffer, &imageBufSize ); - _terrain_load_tga_buffer( imageBuffer, &heightmap, &w, &h ); - _pico_free( heightmapFile ); - _pico_free_file( imageBuffer ); - - if( heightmap == NULL || w < 2 || h < 2 ) - { - _pico_printf( PICO_ERROR, "PicoTerrain model with invalid heightmap" ); - if( shader != NULL ) - _pico_free( shader ); - if( colormapFile != NULL ) - _pico_free( colormapFile ); - _pico_free_parser( p ); - return NULL; - } - - /* set origin (bottom lowest corner of terrain mesh) */ - _pico_set_vec( origin, (w / -2) * scale[ 0 ], (h / -2) * scale[ 1 ], -128 * scale[ 2 ] ); - - /* load colormap */ - colormap = imageBuffer = NULL; - _pico_load_file( colormapFile, &imageBuffer, &imageBufSize ); - _terrain_load_tga_buffer( imageBuffer, &colormap, &cw, &ch ); - _pico_free( colormapFile ); - _pico_free_file( imageBuffer ); - - if( cw != w || ch != h ) - { - _pico_printf( PICO_WARNING, "PicoTerrain colormap/heightmap size mismatch" ); - _pico_free( colormap ); - colormap = NULL; - } - - /* ----------------------------------------------------------------- */ - - /* create new pico model */ - picoModel = PicoNewModel(); - if( picoModel == NULL ) - { - _pico_printf( PICO_ERROR, "Unable to allocate a new model" ); - return NULL; - } - - /* do model setup */ - PicoSetModelFrameNum( picoModel, frameNum ); - PicoSetModelNumFrames( picoModel, 1 ); /* sea */ - PicoSetModelName( picoModel, fileName ); - PicoSetModelFileName( picoModel, fileName ); - - /* allocate new pico surface */ - picoSurface = PicoNewSurface( picoModel ); - if( picoSurface == NULL ) - { - _pico_printf( PICO_ERROR, "Unable to allocate a new model surface" ); - PicoFreeModel( picoModel ); /* sea */ - return NULL; - } - - /* terrain surfaces are triangle meshes */ - PicoSetSurfaceType( picoSurface, PICO_TRIANGLES ); - - /* set surface name */ - PicoSetSurfaceName( picoSurface, "picoterrain" ); - - /* create new pico shader */ - picoShader = PicoNewShader( picoModel ); - if( picoShader == NULL ) - { - _pico_printf( PICO_ERROR, "Unable to allocate a new model shader" ); - PicoFreeModel( picoModel ); - _pico_free( shader ); - return NULL; - } - - /* detox and set shader name */ - _pico_setfext( shader, "" ); - _pico_unixify( shader ); - PicoSetShaderName( picoShader, shader ); - _pico_free( shader ); - - /* associate current surface with newly created shader */ - PicoSetSurfaceShader( picoSurface, picoShader ); - - /* make bogus normal */ - _pico_set_vec( normal, 0.0f, 0.0f, 0.0f ); - - /* create mesh */ - for( j = 0; j < h; j++ ) - { - for( i = 0; i < w; i++ ) - { - /* get pointers */ - v = i + (j * w); - heightPixel = heightmap + v * 4; - colorPixel = colormap - ? colormap + v * 4 - : NULL; - - /* set xyz */ - _pico_set_vec( xyz, origin[ 0 ] + scale[ 0 ] * i, - origin[ 1 ] + scale[ 1 ] * j, - origin[ 2 ] + scale[ 2 ] * heightPixel[ 0 ] ); - PicoSetSurfaceXYZ( picoSurface, v, xyz ); - - /* set normal */ - PicoSetSurfaceNormal( picoSurface, v, normal ); - - /* set st */ - st[ 0 ] = (float) i; - st[ 1 ] = (float) j; - PicoSetSurfaceST( picoSurface, 0, v, st ); - - /* set color */ - if( colorPixel != NULL ) - _pico_set_color( color, colorPixel[ 0 ], colorPixel[ 1 ], colorPixel[ 2 ], colorPixel[ 3 ] ); - else - _pico_set_color( color, 255, 255, 255, 255 ); - PicoSetSurfaceColor( picoSurface, 0, v, color ); - - /* set triangles (zero alpha in heightmap suppresses this quad) */ - if( i < (w - 1) && j < (h - 1) && heightPixel[ 3 ] >= 128 ) - { - /* set indexes */ - pw[ 0 ] = i + (j * w); - pw[ 1 ] = i + ((j + 1) * w); - pw[ 2 ] = i + 1 + ((j + 1) * w); - pw[ 3 ] = i + 1 + (j * w); - pw[ 4 ] = i + (j * w); /* same as pw[ 0 ] */ - - /* set radix */ - r = (i + j) & 1; - - /* make first triangle */ - PicoSetSurfaceIndex( picoSurface, (v * 6 + 0), (picoIndex_t) pw[ r + 0 ] ); - PicoSetSurfaceIndex( picoSurface, (v * 6 + 1), (picoIndex_t) pw[ r + 1 ] ); - PicoSetSurfaceIndex( picoSurface, (v * 6 + 2), (picoIndex_t) pw[ r + 2 ] ); - - /* make second triangle */ - PicoSetSurfaceIndex( picoSurface, (v * 6 + 3), (picoIndex_t) pw[ r + 0 ] ); - PicoSetSurfaceIndex( picoSurface, (v * 6 + 4), (picoIndex_t) pw[ r + 2 ] ); - PicoSetSurfaceIndex( picoSurface, (v * 6 + 5), (picoIndex_t) pw[ r + 3 ] ); - } - } - } - - /* free stuff */ - _pico_free_parser( p ); - _pico_free( heightmap ); - _pico_free( colormap ); - - /* return the new pico model */ - return picoModel; -} - - - -/* pico file format module definition */ -const picoModule_t picoModuleTerrain = -{ - "1.3", /* module version string */ - "PicoTerrain", /* module display name */ - "Randy Reddig", /* author's name */ - "2003 Randy Reddig", /* module copyright */ - { - "picoterrain", NULL, NULL, NULL /* default extensions to use */ - }, - _terrain_canload, /* validation routine */ - _terrain_load, /* load routine */ - NULL, /* save validation routine */ - NULL /* save routine */ -}; diff --git a/libs/pivot.cpp b/libs/pivot.cpp deleted file mode 100644 index e2a7a59e..00000000 --- a/libs/pivot.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pivot.h" - diff --git a/libs/pivot.h b/libs/pivot.h deleted file mode 100644 index 9e9c137c..00000000 --- a/libs/pivot.h +++ /dev/null @@ -1,295 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PIVOT_H) -#define INCLUDED_PIVOT_H - -#include "math/matrix.h" - - -inline void billboard_viewplaneOriented(Matrix4& rotation, const Matrix4& world2screen) -{ -#if 1 - rotation = g_matrix4_identity; - Vector3 x(vector3_normalised(vector4_to_vector3(world2screen.x()))); - Vector3 y(vector3_normalised(vector4_to_vector3(world2screen.y()))); - Vector3 z(vector3_normalised(vector4_to_vector3(world2screen.z()))); - vector4_to_vector3(rotation.y()) = Vector3(x.y(), y.y(), z.y()); - vector4_to_vector3(rotation.z()) = vector3_negated(Vector3(x.z(), y.z(), z.z())); - vector4_to_vector3(rotation.x()) = vector3_normalised(vector3_cross(vector4_to_vector3(rotation.y()), vector4_to_vector3(rotation.z()))); - vector4_to_vector3(rotation.y()) = vector3_cross(vector4_to_vector3(rotation.z()), vector4_to_vector3(rotation.x())); -#else - Matrix4 screen2world(matrix4_full_inverse(world2screen)); - - Vector3 near_( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(0, 0, -1, 1) - ) - ) - ); - - Vector3 far_( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(0, 0, 1, 1) - ) - ) - ); - - Vector3 up( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(0, 1, -1, 1) - ) - ) - ); - - rotation = g_matrix4_identity; - vector4_to_vector3(rotation.y()) = vector3_normalised(vector3_subtracted(up, near_)); - vector4_to_vector3(rotation.z()) = vector3_normalised(vector3_subtracted(near_, far_)); - vector4_to_vector3(rotation.x()) = vector3_normalised(vector3_cross(vector4_to_vector3(rotation.y()), vector4_to_vector3(rotation.z()))); - vector4_to_vector3(rotation.y()) = vector3_cross(vector4_to_vector3(rotation.z()), vector4_to_vector3(rotation.x())); -#endif -} - -inline void billboard_viewpointOriented(Matrix4& rotation, const Matrix4& world2screen) -{ - Matrix4 screen2world(matrix4_full_inverse(world2screen)); - -#if 1 - rotation = g_matrix4_identity; - vector4_to_vector3(rotation.y()) = vector3_normalised(vector4_to_vector3(screen2world.y())); - vector4_to_vector3(rotation.z()) = vector3_negated(vector3_normalised(vector4_to_vector3(screen2world.z()))); - vector4_to_vector3(rotation.x()) = vector3_normalised(vector3_cross(vector4_to_vector3(rotation.y()), vector4_to_vector3(rotation.z()))); - vector4_to_vector3(rotation.y()) = vector3_cross(vector4_to_vector3(rotation.z()), vector4_to_vector3(rotation.x())); -#else - Vector3 near_( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(world2screen[12] / world2screen[15], world2screen[13] / world2screen[15], -1, 1) - ) - ) - ); - - Vector3 far_( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(world2screen[12] / world2screen[15], world2screen[13] / world2screen[15], 1, 1) - ) - ) - ); - - Vector3 up( - vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(world2screen[12] / world2screen[15], world2screen[13] / world2screen[15] + 1, -1, 1) - ) - ) - ); - - rotation = g_matrix4_identity; - vector4_to_vector3(rotation.y()) = vector3_normalised(vector3_subtracted(up, near_)); - vector4_to_vector3(rotation.z()) = vector3_normalised(vector3_subtracted(near_, far_)); - vector4_to_vector3(rotation.x()) = vector3_normalised(vector3_cross(vector4_to_vector3(rotation.y()), vector4_to_vector3(rotation.z()))); - vector4_to_vector3(rotation.y()) = vector3_cross(vector4_to_vector3(rotation.z()), vector4_to_vector3(rotation.x())); -#endif -} - - -inline void ConstructObject2Screen(Matrix4& object2screen, const Matrix4& object2world, const Matrix4& world2view, const Matrix4& view2device, const Matrix4& device2screen) -{ - object2screen = device2screen; - matrix4_multiply_by_matrix4(object2screen, view2device); - matrix4_multiply_by_matrix4(object2screen, world2view); - matrix4_multiply_by_matrix4(object2screen, object2world); -} - -inline void ConstructObject2Device(Matrix4& object2screen, const Matrix4& object2world, const Matrix4& world2view, const Matrix4& view2device) -{ - object2screen = view2device; - matrix4_multiply_by_matrix4(object2screen, world2view); - matrix4_multiply_by_matrix4(object2screen, object2world); -} - -inline void ConstructDevice2Object(Matrix4& device2object, const Matrix4& object2world, const Matrix4& world2view, const Matrix4& view2device) -{ - ConstructObject2Device(device2object, object2world, world2view, view2device); - matrix4_full_invert(device2object); -} - -//! S = ( Inverse(Object2Screen *post ScaleOf(Object2Screen) ) *post Object2Screen -inline void pivot_scale(Matrix4& scale, const Matrix4& pivot2screen) -{ - Matrix4 pre_scale(g_matrix4_identity); - pre_scale[0] = static_cast(vector3_length(vector4_to_vector3(pivot2screen.x()))); - pre_scale[5] = static_cast(vector3_length(vector4_to_vector3(pivot2screen.y()))); - pre_scale[10] = static_cast(vector3_length(vector4_to_vector3(pivot2screen.z()))); - - scale = pivot2screen; - matrix4_multiply_by_matrix4(scale, pre_scale); - matrix4_full_invert(scale); - matrix4_multiply_by_matrix4(scale, pivot2screen); -} - -// scale by (inverse) W -inline void pivot_perspective(Matrix4& scale, const Matrix4& pivot2screen) -{ - scale = g_matrix4_identity; - scale[0] = scale[5] = scale[10] = pivot2screen[15]; -} - -inline void ConstructDevice2Manip(Matrix4& device2manip, const Matrix4& object2world, const Matrix4& world2view, const Matrix4& view2device, const Matrix4& device2screen) -{ - Matrix4 pivot2screen; - ConstructObject2Screen(pivot2screen, object2world, world2view, view2device, device2screen); - - ConstructObject2Device(device2manip, object2world, world2view, view2device); - - Matrix4 scale; - pivot_scale(scale, pivot2screen); - matrix4_multiply_by_matrix4(device2manip, scale); - pivot_perspective(scale, pivot2screen); - matrix4_multiply_by_matrix4(device2manip, scale); - - matrix4_full_invert(device2manip); -} - -inline void Pivot2World_worldSpace(Matrix4& manip2world, const Matrix4& pivot2world, const Matrix4& modelview, const Matrix4& projection, const Matrix4& viewport) -{ - manip2world = pivot2world; - - Matrix4 pivot2screen; - ConstructObject2Screen(pivot2screen, pivot2world, modelview, projection, viewport); - - Matrix4 scale; - pivot_scale(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); - pivot_perspective(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); -} - -inline void Pivot2World_viewpointSpace(Matrix4& manip2world, Vector3& axis, const Matrix4& pivot2world, const Matrix4& modelview, const Matrix4& projection, const Matrix4& viewport) -{ - manip2world = pivot2world; - - Matrix4 pivot2screen; - ConstructObject2Screen(pivot2screen, pivot2world, modelview, projection, viewport); - - Matrix4 scale; - pivot_scale(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); - - billboard_viewpointOriented(scale, pivot2screen); - axis = vector4_to_vector3(scale.z()); - matrix4_multiply_by_matrix4(manip2world, scale); - - pivot_perspective(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); -} - -inline void Pivot2World_viewplaneSpace(Matrix4& manip2world, const Matrix4& pivot2world, const Matrix4& modelview, const Matrix4& projection, const Matrix4& viewport) -{ - manip2world = pivot2world; - - Matrix4 pivot2screen; - ConstructObject2Screen(pivot2screen, pivot2world, modelview, projection, viewport); - - Matrix4 scale; - pivot_scale(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); - - billboard_viewplaneOriented(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); - - pivot_perspective(scale, pivot2screen); - matrix4_multiply_by_matrix4(manip2world, scale); -} - - -#include "renderable.h" -#include "cullable.h" -#include "render.h" - -const Colour4b g_colour_x(255, 0, 0, 255); -const Colour4b g_colour_y(0, 255, 0, 255); -const Colour4b g_colour_z(0, 0, 255, 255); - -class Shader; - -class RenderablePivot : public OpenGLRenderable -{ - VertexBuffer m_vertices; -public: - mutable Matrix4 m_localToWorld; - typedef Static StaticShader; - static Shader* getShader() - { - return StaticShader::instance(); - } - - RenderablePivot() - { - m_vertices.reserve(6); - - m_vertices.push_back(PointVertex(Vertex3f(0, 0, 0), g_colour_x)); - m_vertices.push_back(PointVertex(Vertex3f(16, 0, 0), g_colour_x)); - - m_vertices.push_back(PointVertex(Vertex3f(0, 0, 0), g_colour_y)); - m_vertices.push_back(PointVertex(Vertex3f(0, 16, 0), g_colour_y)); - - m_vertices.push_back(PointVertex(Vertex3f(0, 0, 0), g_colour_z)); - m_vertices.push_back(PointVertex(Vertex3f(0, 0, 16), g_colour_z)); - } - - void render(RenderStateFlags state) const - { - if(m_vertices.size() == 0) return; - if(m_vertices.data() == 0) return; - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices.data()->vertex); - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices.data()->colour); - glDrawArrays(GL_LINES, 0, m_vertices.size()); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.PushState(); - - Pivot2World_worldSpace(m_localToWorld, localToWorld, volume.GetModelview(), volume.GetProjection(), volume.GetViewport()); - - renderer.Highlight(Renderer::ePrimitive, false); - renderer.SetState(getShader(), Renderer::eWireframeOnly); - renderer.SetState(getShader(), Renderer::eFullMaterials); - renderer.addRenderable(*this, m_localToWorld); - - renderer.PopState(); - } -}; - - - -#endif diff --git a/libs/profile/file.h b/libs/profile/file.h deleted file mode 100644 index 3ec5f082..00000000 --- a/libs/profile/file.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright (c) 2001, Loki software, inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -Neither the name of Loki software nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// -// file.h -//////////////////////////////////////////////////// - -#if !defined(INCLUDED_PROFILE_FILE_H) -#define INCLUDED_PROFILE_FILE_H - -#include "idatastream.h" - -/*! -API for data streams - -Based on an initial implementation by Loki software -modified to be abstracted and shared across modules - -NOTE: why IDataStream and not IStream? because IStream is defined in windows IDL headers -*/ - -class IDataStream : public InputStream, public OutputStream -{ -public: - typedef int offset_type; - typedef std::size_t position_type; - - virtual void IncRef() = 0; ///< Increment the number of references to this object - virtual void DecRef() = 0; ///< Decrement the reference count - - virtual position_type GetPosition() const = 0; - virtual int Seek(offset_type lOff, int nFrom) = 0; - - virtual void SetLength(size_type nNewLen) = 0; - virtual size_type GetLength() const = 0; - - virtual char* ReadString(char* pBuf, size_type nMax) = 0; - virtual int GetChar()=0; - - virtual int PutChar(int c)=0; - virtual void printf(const char*, ...) = 0; ///< completely matches the usual printf behaviour - - virtual void Abort() = 0; - virtual void Flush() = 0; - virtual void Close() = 0; -}; - -#include - -class MemStream : public IDataStream -{ -public: - MemStream(); - MemStream(size_type nLen); - virtual ~MemStream(); - - int refCount; - void IncRef() { refCount++; } - void DecRef() { refCount--; if (refCount <= 0) delete this; } - -protected: - // MemFile specific: - size_type m_nGrowBytes; - size_type m_nPosition; - size_type m_nBufferSize; - size_type m_nFileSize; - unsigned char* m_pBuffer; - bool m_bAutoDelete; - void GrowFile(size_type nNewLen); - -public: - position_type GetPosition() const; - int Seek(offset_type lOff, int nFrom); - void SetLength(size_type nNewLen); - size_type GetLength() const; - - unsigned char* GetBuffer() const - { return m_pBuffer; } - - size_type read(byte_type* buffer, size_type length); - size_type write(const byte_type* buffer, size_type length); - - char* ReadString(char* pBuf, size_type nMax); - int GetChar(); - - int PutChar(int c); - void printf(const char*, ...); ///< \todo implement on MemStream - - void Abort(); - void Flush(); - void Close(); - bool Open(const char *filename, const char *mode); -}; - -class FileStream : public IDataStream -{ -public: - FileStream(); - virtual ~FileStream(); - - int refCount; - void IncRef() { refCount++; } - void DecRef() { refCount--; if (refCount <= 0) delete this; } - -protected: - // DiscFile specific: - FILE* m_hFile; - bool m_bCloseOnDelete; - -public: - position_type GetPosition() const; - int Seek(offset_type lOff, int nFrom); - void SetLength(size_type nNewLen); - size_type GetLength() const; - - size_type read(byte_type* buffer, size_type length); - size_type write(const byte_type* buffer, size_type length); - - char* ReadString(char* pBuf, size_type nMax); - int GetChar(); - - int PutChar(int c); - void printf(const char*, ...); ///< completely matches the usual printf behaviour - - void Abort(); - void Flush(); - void Close(); - bool Open(const char *filename, const char *mode); -}; - -#endif diff --git a/libs/profile/profile.h b/libs/profile/profile.h deleted file mode 100644 index 1974d04e..00000000 --- a/libs/profile/profile.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright (c) 2001, Loki software, inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -Neither the name of Loki software nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#if !defined(INCLUDED_PROFILE_PROFILE_H) -#define INCLUDED_PROFILE_PROFILE_H - -// profile functions - kind of utility lib -// they are kind of dumb, they expect to get the path to the .ini file or to the prefs directory when called -// load_buffer and save_buffer expect the path only, theyll build a $(pszName).bin file -bool profile_save_int (const char *filename, const char *section, const char *key, int value); -bool profile_save_float (const char *filename, const char *section, const char *key, float value); -bool profile_save_string (const char *filename, const char *section, const char *key, const char *value); -bool profile_save_buffer (const char *rc_path, const char *pszName, void *pvBuf, unsigned int lSize); -bool profile_load_buffer (const char *rc_path, const char *pszName, void *pvBuf, unsigned int *plSize); -int profile_load_int (const char *filename, const char *section, const char *key, int default_value); -float profile_load_float (const char *filename, const char *section, const char *key, float default_value); -char* profile_load_string (const char *filename, const char *section, const char *key, const char *default_value); -// used in the command map code -bool read_var (const char *filename, const char *section, const char *key, char *value); -bool save_var (const char *filename, const char *section, const char *key, const char *value); - -#endif diff --git a/libs/profile/profile.vcproj b/libs/profile/profile.vcproj deleted file mode 100644 index 3509e0ca..00000000 --- a/libs/profile/profile.vcproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/radiant_jpeglib.h b/libs/radiant_jpeglib.h deleted file mode 100644 index b54792fe..00000000 --- a/libs/radiant_jpeglib.h +++ /dev/null @@ -1,1103 +0,0 @@ - -/* - * jpeglib.h - * - * Copyright (C) 1991-1995, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// LZ: linux stuff -#if !defined (WIN32) - -#include -#include - -#ifndef boolean -#ifdef __cplusplus -#define boolean bool -#else -typedef int boolean; -#endif -#endif - -#endif - -#ifdef __MACOS__ - -// JDC: stuff to make mac version compile -#define boolean qboolean -#define register -#define INT32 int - -#endif - -// rad additions -// 11.29.99 - -//#include "cmdlib.h" -#ifdef _WIN32 -#include "windows.h" -#include "stdio.h" -#endif - -#ifndef INT32 -#define INT32 int -#endif - -// TTimo: if LoadJPGBuff returns -1, *pic is the error message -extern int LoadJPGBuff(unsigned char *fbuffer, int bufsize, unsigned char **pic, int *width, int *height ); -// rad end - - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "jpeg6/jconfig.h" /* widely used configuration options */ -#endif -#include "jpeg6/jmorecfg.h" /* seldom changed options */ - - -/* Version ID for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". - */ - -#define JPEG_LIB_VERSION 60 /* Version 6 */ - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - */ - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname)() -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This field directly represents the contents of a JPEG DQT marker. - * Note: the values are always given in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples. Always DCTSIZE for compression. - * For decompression this is the size of the output from one DCT block, - * reflecting any scaling we choose to apply during the IDCT step. - * Values of 1,2,4,8 are likely to be supported. Note that different - * components may receive different IDCT scalings. - */ - int DCT_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface), thus - * downsampled_width = ceil(image_width * Hi/Hmax) - * and similarly for height. For decompression, IDCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is not currently used by the compressor. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - boolean is_decompressor; /* so common code can tell which is which */\ - int global_state /* for checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - boolean write_JFIF_header; /* should a JFIF marker be written? */ - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - double output_gamma; /* image gamma wanted in output */ - - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker: */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_create_compress jCreaCompress -#define jpeg_create_decompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN struct jpeg_error_mgr *jpeg_std_error JPP((struct jpeg_error_mgr *err)); - -/* Initialization and destruction of JPEG compression objects */ -/* NB: you must set up the error-manager BEFORE calling jpeg_create_xxx */ -EXTERN void jpeg_create_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_create_decompress JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN void jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN void jpeg_stdio_src JPP((j_decompress_ptr cinfo, unsigned char *infile, int bufsize)); - -/* Default parameter setup for compression */ -EXTERN void jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN void jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN void jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); -EXTERN void jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - boolean force_baseline)); -EXTERN void jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - boolean force_baseline)); -EXTERN int jpeg_quality_scaling JPP((int quality)); -EXTERN void jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); -EXTERN JQUANT_TBL * jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN JHUFF_TBL * jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN void jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); -EXTERN JDIMENSION jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN void jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN JDIMENSION jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.doc concerning safe usage. */ -EXTERN void jpeg_write_marker JPP((j_compress_ptr cinfo, int marker, - const JOCTET *dataptr, unsigned int datalen)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN void jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN int jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN boolean jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN JDIMENSION jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN boolean jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN JDIMENSION jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN boolean jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN boolean jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN boolean jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN boolean jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN int jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN void jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN void jpeg_set_marker_processor JPP((j_decompress_ptr cinfo, - int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN jvirt_barray_ptr * jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN void jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN void jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN void jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN void jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN void jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN void jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN boolean jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* JPEGLIB_H */ diff --git a/libs/render.cpp b/libs/render.cpp deleted file mode 100644 index 866dc127..00000000 --- a/libs/render.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "render.h" diff --git a/libs/render.h b/libs/render.h deleted file mode 100644 index fb243650..00000000 --- a/libs/render.h +++ /dev/null @@ -1,1372 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_RENDER_H) -#define INCLUDED_RENDER_H - -/// \file -/// \brief High-level constructs for efficient OpenGL rendering. - -#include "irender.h" -#include "igl.h" - -#include "container/array.h" -#include "math/vector.h" -#include "math/pi.h" - -#include - -typedef unsigned int RenderIndex; -const GLenum RenderIndexTypeID = GL_UNSIGNED_INT; - -/// \brief A resizable buffer of indices. -class IndexBuffer -{ - typedef std::vector Indices; - Indices m_data; -public: - typedef Indices::iterator iterator; - typedef Indices::const_iterator const_iterator; - - iterator begin() - { - return m_data.begin(); - } - const_iterator begin() const - { - return m_data.begin(); - } - iterator end() - { - return m_data.end(); - } - const_iterator end() const - { - return m_data.end(); - } - - bool empty() const - { - return m_data.empty(); - } - std::size_t size() const - { - return m_data.size(); - } - const RenderIndex* data() const - { - return &(*m_data.begin()); - } - RenderIndex& operator[](std::size_t index) - { - return m_data[index]; - } - const RenderIndex& operator[](std::size_t index) const - { - return m_data[index]; - } - void clear() - { - m_data.clear(); - } - void reserve(std::size_t max_indices) - { - m_data.reserve(max_indices); - } - void insert(RenderIndex index) - { - m_data.push_back(index); - } - void swap(IndexBuffer& other) - { - std::swap(m_data, m_data); - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - inline void swap(IndexBuffer& self, IndexBuffer& other) - { - self.swap(other); - } -} - -/// \brief A resizable buffer of vertices. -/// \param Vertex The vertex data type. -template -class VertexBuffer -{ - typedef typename std::vector Vertices; - Vertices m_data; -public: - typedef typename Vertices::iterator iterator; - typedef typename Vertices::const_iterator const_iterator; - - iterator begin() - { - return m_data.begin(); - } - iterator end() - { - return m_data.end(); - } - const_iterator begin() const - { - return m_data.begin(); - } - const_iterator end() const - { - return m_data.end(); - } - - bool empty() const - { - return m_data.empty(); - } - RenderIndex size() const - { - return RenderIndex(m_data.size()); - } - const Vertex* data() const - { - return &(*m_data.begin()); - } - Vertex& operator[](std::size_t index) - { - return m_data[index]; - } - const Vertex& operator[](std::size_t index) const - { - return m_data[index]; - } - - void clear() - { - m_data.clear(); - } - void reserve(std::size_t max_vertices) - { - m_data.reserve(max_vertices); - } - void push_back(const Vertex& vertex) - { - m_data.push_back(vertex); - } -}; - -/// \brief A wrapper around a VertexBuffer which inserts only vertices which have not already been inserted. -/// \param Vertex The vertex data type. Must support operator<, operator== and operator!=. -/// For best performance, quantise vertices before inserting them. -template -class UniqueVertexBuffer -{ - typedef VertexBuffer Vertices; - Vertices& m_data; - - struct bnode - { - bnode() - : m_left(0), m_right(0) - { - } - RenderIndex m_left; - RenderIndex m_right; - }; - - std::vector m_btree; - RenderIndex m_prev0; - RenderIndex m_prev1; - RenderIndex m_prev2; - - const RenderIndex find_or_insert(const Vertex& vertex) - { - RenderIndex index = 0; - - while(1) - { - if(vertex < m_data[index]) - { - bnode& node = m_btree[index]; - if(node.m_left != 0) - { - index = node.m_left; - continue; - } - else - { - node.m_left = RenderIndex(m_btree.size()); - m_btree.push_back(bnode()); - m_data.push_back(vertex); - return RenderIndex(m_btree.size()-1); - } - } - if(m_data[index] < vertex) - { - bnode& node = m_btree[index]; - if(node.m_right != 0) - { - index = node.m_right; - continue; - } - else - { - node.m_right = RenderIndex(m_btree.size()); - m_btree.push_back(bnode()); - m_data.push_back(vertex); - return RenderIndex(m_btree.size()-1); - } - } - - return index; - } - } -public: - UniqueVertexBuffer(Vertices& data) - : m_data(data), m_prev0(0), m_prev1(0), m_prev2(0) - { - } - - typedef typename Vertices::const_iterator iterator; - - iterator begin() const - { - return m_data.begin(); - } - iterator end() const - { - return m_data.end(); - } - - std::size_t size() const - { - return m_data.size(); - } - const Vertex* data() const - { - return &(*m_data.begin()); - } - Vertex& operator[](std::size_t index) - { - return m_data[index]; - } - const Vertex& operator[](std::size_t index) const - { - return m_data[index]; - } - - void clear() - { - m_prev0 = 0; - m_prev1 = 0; - m_prev2 = 0; - m_data.clear(); - m_btree.clear(); - } - void reserve(std::size_t max_vertices) - { - m_data.reserve(max_vertices); - m_btree.reserve(max_vertices); - } - /// \brief Returns the index of the element equal to \p vertex. - RenderIndex insert(const Vertex& vertex) - { - if(m_data.empty()) - { - m_data.push_back(vertex); - m_btree.push_back(bnode()); - return 0; - } - - if(m_data[m_prev0] == vertex) - return m_prev0; - if(m_prev1 != m_prev0 && m_data[m_prev1] == vertex) - return m_prev1; - if(m_prev2 != m_prev0 && m_prev2 != m_prev1 && m_data[m_prev2] == vertex) - return m_prev2; - - m_prev2 = m_prev1; - m_prev1 = m_prev0; - m_prev0 = find_or_insert(vertex); - - return m_prev0; - } -}; - - -/// \brief A 4-byte colour. -struct Colour4b -{ - unsigned char r, g, b, a; - - Colour4b() - { - } - - Colour4b(unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a) - : r(_r), g(_g), b(_b), a(_a) - { - } -}; - -const Colour4b colour_vertex(0, 255, 0, 255); -const Colour4b colour_selected(0, 0, 255, 255); - -inline bool operator<(const Colour4b& self, const Colour4b& other) -{ - if(self.r != other.r) - { - return self.r < other.r; - } - if(self.g != other.g) - { - return self.g < other.g; - } - if(self.b != other.b) - { - return self.b < other.b; - } - if(self.a != other.a) - { - return self.a < other.a; - } - return false; -} - -inline bool operator==(const Colour4b& self, const Colour4b& other) -{ - return self.r == other.r && self.g == other.g && self.b == other.b && self.a == other.a; -} - -inline bool operator!=(const Colour4b& self, const Colour4b& other) -{ - return !operator==(self, other); -} - -/// \brief A 3-float vertex. -struct Vertex3f : public Vector3 -{ - Vertex3f() - { - } - - Vertex3f(float _x, float _y, float _z) - : Vector3(_x, _y, _z) - { - } -}; - -inline bool operator<(const Vertex3f& self, const Vertex3f& other) -{ - if(self.x() != other.x()) - { - return self.x() < other.x(); - } - if(self.y() != other.y()) - { - return self.y() < other.y(); - } - if(self.z() != other.z()) - { - return self.z() < other.z(); - } - return false; -} - -inline bool operator==(const Vertex3f& self, const Vertex3f& other) -{ - return self.x() == other.x() && self.y() == other.y() && self.z() == other.z(); -} - -inline bool operator!=(const Vertex3f& self, const Vertex3f& other) -{ - return !operator==(self, other); -} - - -inline Vertex3f vertex3f_from_array(const float* array) -{ - return Vertex3f(array[0], array[1], array[2]); -} - -inline float* vertex3f_to_array(Vertex3f& vertex) -{ - return reinterpret_cast(&vertex); -} - -inline const float* vertex3f_to_array(const Vertex3f& vertex) -{ - return reinterpret_cast(&vertex); -} - -const Vertex3f vertex3f_identity(0, 0, 0); - -inline Vertex3f vertex3f_for_vector3(const Vector3& vector3) -{ - return Vertex3f(vector3.x(), vector3.y(), vector3.z()); -} - -inline const Vector3& vertex3f_to_vector3(const Vertex3f& vertex) -{ - return vertex; -} - -inline Vector3& vertex3f_to_vector3(Vertex3f& vertex) -{ - return vertex; -} - - -/// \brief A 3-float normal. -struct Normal3f : public Vector3 -{ - Normal3f() - { - } - - Normal3f(float _x, float _y, float _z) - : Vector3(_x, _y, _z) - { - } -}; - -inline bool operator<(const Normal3f& self, const Normal3f& other) -{ - if(self.x() != other.x()) - { - return self.x() < other.x(); - } - if(self.y() != other.y()) - { - return self.y() < other.y(); - } - if(self.z() != other.z()) - { - return self.z() < other.z(); - } - return false; -} - -inline bool operator==(const Normal3f& self, const Normal3f& other) -{ - return self.x() == other.x() && self.y() == other.y() && self.z() == other.z(); -} - -inline bool operator!=(const Normal3f& self, const Normal3f& other) -{ - return !operator==(self, other); -} - - -inline Normal3f normal3f_from_array(const float* array) -{ - return Normal3f(array[0], array[1], array[2]); -} - -inline float* normal3f_to_array(Normal3f& normal) -{ - return reinterpret_cast(&normal); -} - -inline const float* normal3f_to_array(const Normal3f& normal) -{ - return reinterpret_cast(&normal); -} - -inline Normal3f normal3f_for_vector3(const Vector3& vector3) -{ - return Normal3f(vector3.x(), vector3.y(), vector3.z()); -} - -inline const Vector3& normal3f_to_vector3(const Normal3f& normal) -{ - return normal; -} - -inline Vector3& normal3f_to_vector3(Normal3f& normal) -{ - return normal; -} - - -/// \brief A 2-float texture-coordinate set. -struct TexCoord2f : public Vector2 -{ - TexCoord2f() - { - } - - TexCoord2f(float _s, float _t) - : Vector2(_s, _t) - { - } - - float& s() - { - return x(); - } - const float& s() const - { - return x(); - } - float& t() - { - return y(); - } - const float& t() const - { - return y(); - } -}; - -inline bool operator<(const TexCoord2f& self, const TexCoord2f& other) -{ - if(self.s() != other.s()) - { - return self.s() < other.s(); - } - if(self.t() != other.t()) - { - return self.t() < other.t(); - } - return false; -} - -inline bool operator==(const TexCoord2f& self, const TexCoord2f& other) -{ - return self.s() == other.s() && self.t() == other.t(); -} - -inline bool operator!=(const TexCoord2f& self, const TexCoord2f& other) -{ - return !operator==(self, other); -} - - -inline float* texcoord2f_to_array(TexCoord2f& texcoord) -{ - return reinterpret_cast(&texcoord); -} - -inline const float* texcoord2f_to_array(const TexCoord2f& texcoord) -{ - return reinterpret_cast(&texcoord); -} - -inline const TexCoord2f& texcoord2f_from_array(const float* array) -{ - return *reinterpret_cast(array); -} - -inline TexCoord2f texcoord2f_for_vector2(const Vector2& vector2) -{ - return TexCoord2f(vector2.x(), vector2.y()); -} - -inline const Vector2& texcoord2f_to_vector2(const TexCoord2f& vertex) -{ - return vertex; -} - -inline Vector2& texcoord2f_to_vector2(TexCoord2f& vertex) -{ - return vertex; -} - -/// \brief Returns \p normal rescaled to be unit-length. -inline Normal3f normal3f_normalised(const Normal3f& normal) -{ - return normal3f_for_vector3(vector3_normalised(normal3f_to_vector3(normal))); -} - -enum UnitSphereOctant -{ - UNITSPHEREOCTANT_000 = 0 << 0 | 0 << 1 | 0 << 2, - UNITSPHEREOCTANT_001 = 0 << 0 | 0 << 1 | 1 << 2, - UNITSPHEREOCTANT_010 = 0 << 0 | 1 << 1 | 0 << 2, - UNITSPHEREOCTANT_011 = 0 << 0 | 1 << 1 | 1 << 2, - UNITSPHEREOCTANT_100 = 1 << 0 | 0 << 1 | 0 << 2, - UNITSPHEREOCTANT_101 = 1 << 0 | 0 << 1 | 1 << 2, - UNITSPHEREOCTANT_110 = 1 << 0 | 1 << 1 | 0 << 2, - UNITSPHEREOCTANT_111 = 1 << 0 | 1 << 1 | 1 << 2, -}; - -/// \brief Returns the octant for \p normal indicating the sign of the region of unit-sphere space it lies within. -inline UnitSphereOctant normal3f_classify_octant(const Normal3f& normal) -{ - return static_cast( - ((normal.x() > 0) << 0) | ((normal.y() > 0) << 1) | ((normal.z() > 0) << 2) - ); -} - -/// \brief Returns \p normal with its components signs made positive based on \p octant. -inline Normal3f normal3f_fold_octant(const Normal3f& normal, UnitSphereOctant octant) -{ - switch(octant) - { - case UNITSPHEREOCTANT_000: - return Normal3f(-normal.x(), -normal.y(), -normal.z()); - case UNITSPHEREOCTANT_001: - return Normal3f(normal.x(), -normal.y(), -normal.z()); - case UNITSPHEREOCTANT_010: - return Normal3f(-normal.x(), normal.y(), -normal.z()); - case UNITSPHEREOCTANT_011: - return Normal3f(normal.x(), normal.y(), -normal.z()); - case UNITSPHEREOCTANT_100: - return Normal3f(-normal.x(), -normal.y(), normal.z()); - case UNITSPHEREOCTANT_101: - return Normal3f(normal.x(), -normal.y(), normal.z()); - case UNITSPHEREOCTANT_110: - return Normal3f(-normal.x(), normal.y(), normal.z()); - case UNITSPHEREOCTANT_111: - return Normal3f(normal.x(), normal.y(), normal.z()); - } - return Normal3f(); -} - -/// \brief Reverses the effect of normal3f_fold_octant() on \p normal with \p octant. -/// \p normal must have been obtained with normal3f_fold_octant(). -/// \p octant must have been obtained with normal3f_classify_octant(). -inline Normal3f normal3f_unfold_octant(const Normal3f& normal, UnitSphereOctant octant) -{ - return normal3f_fold_octant(normal, octant); -} - -enum UnitSphereSextant -{ - UNITSPHERESEXTANT_XYZ = 0, - UNITSPHERESEXTANT_XZY = 1, - UNITSPHERESEXTANT_YXZ = 2, - UNITSPHERESEXTANT_YZX = 3, - UNITSPHERESEXTANT_ZXY = 4, - UNITSPHERESEXTANT_ZYX = 5, -}; - -/// \brief Returns the sextant for \p normal indicating how to sort its components so that x > y > z. -/// All components of \p normal must be positive. -/// \p normal must be normalised. -inline UnitSphereSextant normal3f_classify_sextant(const Normal3f& normal) -{ - return - normal.x() >= normal.y() - ? normal.x() >= normal.z() - ? normal.y() >= normal.z() - ? UNITSPHERESEXTANT_XYZ - : UNITSPHERESEXTANT_XZY - : UNITSPHERESEXTANT_ZXY - : normal.y() >= normal.z() - ? normal.x() >= normal.z() - ? UNITSPHERESEXTANT_YXZ - : UNITSPHERESEXTANT_YZX - : UNITSPHERESEXTANT_ZYX; -} - -/// \brief Returns \p normal with its components sorted so that x > y > z based on \p sextant. -/// All components of \p normal must be positive. -/// \p normal must be normalised. -inline Normal3f normal3f_fold_sextant(const Normal3f& normal, UnitSphereSextant sextant) -{ - switch(sextant) - { - case UNITSPHERESEXTANT_XYZ: - return Normal3f(normal.x(), normal.y(), normal.z()); - case UNITSPHERESEXTANT_XZY: - return Normal3f(normal.x(), normal.z(), normal.y()); - case UNITSPHERESEXTANT_YXZ: - return Normal3f(normal.y(), normal.x(), normal.z()); - case UNITSPHERESEXTANT_YZX: - return Normal3f(normal.y(), normal.z(), normal.x()); - case UNITSPHERESEXTANT_ZXY: - return Normal3f(normal.z(), normal.x(), normal.y()); - case UNITSPHERESEXTANT_ZYX: - return Normal3f(normal.z(), normal.y(), normal.x()); - } - return Normal3f(); -} - -/// \brief Reverses the effect of normal3f_fold_sextant() on \p normal with \p sextant. -/// \p normal must have been obtained with normal3f_fold_sextant(). -/// \p sextant must have been obtained with normal3f_classify_sextant(). -inline Normal3f normal3f_unfold_sextant(const Normal3f& normal, UnitSphereSextant sextant) -{ - return normal3f_fold_sextant(normal, sextant); -} - -const std::size_t c_quantise_normal = 1 << 6; - -/// \brief All the components of \p folded must be positive and sorted so that x > y > z. -inline Normal3f normal3f_folded_quantised(const Normal3f& folded) -{ - // compress - double scale = static_cast(c_quantise_normal) / (folded.x() + folded.y() + folded.z()); - unsigned int zbits = static_cast(folded.z() * scale); - unsigned int ybits = static_cast(folded.y() * scale); - - // decompress - return normal3f_normalised(Normal3f( - static_cast(c_quantise_normal - zbits - ybits), - static_cast(ybits), - static_cast(zbits) - )); -} - -/// \brief Returns \p normal quantised by compressing and then decompressing its representation. -inline Normal3f normal3f_quantised_custom(const Normal3f& normal) -{ - UnitSphereOctant octant = normal3f_classify_octant(normal); - Normal3f folded = normal3f_fold_octant(normal, octant); - UnitSphereSextant sextant = normal3f_classify_sextant(folded); - folded = normal3f_fold_sextant(folded, sextant); - return normal3f_unfold_octant(normal3f_unfold_sextant(normal3f_folded_quantised(folded), sextant), octant); -} - - - -struct spherical_t -{ - double longditude, latitude; - - spherical_t(double _longditude, double _latitude) - : longditude(_longditude), latitude(_latitude) - { - } -}; - -/* -{ - theta = 2pi * U; - phi = acos((2 * V) - 1); - - U = theta / 2pi; - V = (cos(phi) + 1) / 2; -} - -longitude = atan(y / x); -latitude = acos(z); -*/ -struct uniformspherical_t -{ - double U, V; - - uniformspherical_t(double U_, double V_) - : U(U_), V(V_) - { - } -}; - - -inline spherical_t spherical_from_normal3f(const Normal3f& normal) -{ - return spherical_t(normal.x() == 0 ? c_pi / 2 : normal.x() > 0 ? atan(normal.y() / normal.x()) : atan(normal.y() / normal.x()) + c_pi, acos(normal.z())); -} - -inline Normal3f normal3f_from_spherical(const spherical_t& spherical) -{ - return Normal3f( - static_cast(cos(spherical.longditude) * sin(spherical.latitude)), - static_cast(sin(spherical.longditude) * sin(spherical.latitude)), - static_cast(cos(spherical.latitude)) - ); -} - -inline uniformspherical_t uniformspherical_from_spherical(const spherical_t& spherical) -{ - return uniformspherical_t(spherical.longditude * c_inv_2pi, (cos(spherical.latitude) + 1) * 0.5); -} - -inline spherical_t spherical_from_uniformspherical(const uniformspherical_t& uniformspherical) -{ - return spherical_t(c_2pi * uniformspherical.U, acos((2 * uniformspherical.V) - 1)); -} - -inline uniformspherical_t uniformspherical_from_normal3f(const Normal3f& normal) -{ - return uniformspherical_from_spherical(spherical_from_normal3f(normal)); - //return uniformspherical_t(atan2(normal.y / normal.x) * c_inv_2pi, (normal.z + 1) * 0.5); -} - -inline Normal3f normal3f_from_uniformspherical(const uniformspherical_t& uniformspherical) -{ - return normal3f_from_spherical(spherical_from_uniformspherical(uniformspherical)); -} - -/// \brief Returns a single-precision \p component quantised to \p precision. -inline float float_quantise(float component, float precision) -{ - return float_snapped(component, precision); -} - -/// \brief Returns a double-precision \p component quantised to \p precision. -inline double double_quantise(double component, double precision) -{ - return float_snapped(component, precision); -} - -inline spherical_t spherical_quantised(const spherical_t& spherical, float snap) -{ - return spherical_t(double_quantise(spherical.longditude, snap), double_quantise(spherical.latitude, snap)); -} - -inline uniformspherical_t uniformspherical_quantised(const uniformspherical_t& uniformspherical, float snap) -{ - return uniformspherical_t(double_quantise(uniformspherical.U, snap), double_quantise(uniformspherical.V, snap)); -} - -/// \brief Returns a \p vertex quantised to \p precision. -inline Vertex3f vertex3f_quantised(const Vertex3f& vertex, float precision) -{ - return Vertex3f(float_quantise(vertex.x(), precision), float_quantise(vertex.y(), precision), float_quantise(vertex.z(), precision)); -} - -/// \brief Returns a \p normal quantised to a fixed precision. -inline Normal3f normal3f_quantised(const Normal3f& normal) -{ - return normal3f_quantised_custom(normal); - //return normal3f_from_spherical(spherical_quantised(spherical_from_normal3f(normal), snap)); - //return normal3f_from_uniformspherical(uniformspherical_quantised(uniformspherical_from_normal3f(normal), snap)); - // float_quantise(normal.x, snap), float_quantise(normal.y, snap), float_quantise(normal.y, snap)); -} - -/// \brief Returns a \p texcoord quantised to \p precision. -inline TexCoord2f texcoord2f_quantised(const TexCoord2f& texcoord, float precision) -{ - return TexCoord2f(float_quantise(texcoord.s(), precision), float_quantise(texcoord.t(), precision)); -} - -/// \brief Standard vertex type for lines and points. -struct PointVertex -{ - Colour4b colour; - Vertex3f vertex; - - PointVertex() - { - } - PointVertex(Vertex3f _vertex) - : colour(Colour4b(255, 255, 255, 255)), vertex(_vertex) - { - } - PointVertex(Vertex3f _vertex, Colour4b _colour) - : colour(_colour), vertex(_vertex) - { - } -}; - -inline bool operator<(const PointVertex& self, const PointVertex& other) -{ - if(self.vertex != other.vertex) - { - return self.vertex < other.vertex; - } - if(self.colour != other.colour) - { - return self.colour < other.colour; - } - return false; -} - -inline bool operator==(const PointVertex& self, const PointVertex& other) -{ - return self.colour == other.colour && self.vertex == other.vertex; -} - -inline bool operator!=(const PointVertex& self, const PointVertex& other) -{ - return !operator==(self, other); -} - -/// \brief Standard vertex type for lit/textured meshes. -struct ArbitraryMeshVertex -{ - TexCoord2f texcoord; - Normal3f normal; - Vertex3f vertex; - Normal3f tangent; - Normal3f bitangent; - - ArbitraryMeshVertex() : tangent(0, 0, 0), bitangent(0, 0, 0) - { - } - ArbitraryMeshVertex(Vertex3f _vertex, Normal3f _normal, TexCoord2f _texcoord) - : texcoord(_texcoord), normal(_normal), vertex(_vertex), tangent(0, 0, 0), bitangent(0, 0, 0) - { - } -}; - -inline bool operator<(const ArbitraryMeshVertex& self, const ArbitraryMeshVertex& other) -{ - if(self.texcoord != other.texcoord) - { - return self.texcoord < other.texcoord; - } - if(self.normal != other.normal) - { - return self.normal < other.normal; - } - if(self.vertex != other.vertex) - { - return self.vertex < other.vertex; - } - return false; -} - -inline bool operator==(const ArbitraryMeshVertex& self, const ArbitraryMeshVertex& other) -{ - return self.texcoord == other.texcoord && self.normal == other.normal && self.vertex == other.vertex; -} - -inline bool operator!=(const ArbitraryMeshVertex& self, const ArbitraryMeshVertex& other) -{ - return !operator==(self, other); -} - -const float c_quantise_vertex = 1.f / static_cast(1 << 3); - -/// \brief Returns \p v with vertex quantised to a fixed precision. -inline PointVertex pointvertex_quantised(const PointVertex& v) -{ - return PointVertex(vertex3f_quantised(v.vertex, c_quantise_vertex), v.colour); -} - -const float c_quantise_texcoord = 1.f / static_cast(1 << 8); - -/// \brief Returns \p v with vertex, normal and texcoord quantised to a fixed precision. -inline ArbitraryMeshVertex arbitrarymeshvertex_quantised(const ArbitraryMeshVertex& v) -{ - return ArbitraryMeshVertex(vertex3f_quantised(v.vertex, c_quantise_vertex), normal3f_quantised(v.normal), texcoord2f_quantised(v.texcoord, c_quantise_texcoord)); -} - - -/// \brief Sets up the OpenGL colour and vertex arrays for \p array. -inline void pointvertex_gl_array(const PointVertex* array) -{ - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &array->colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &array->vertex); -} - -class RenderablePointArray : public OpenGLRenderable -{ - const Array& m_array; - const GLenum m_mode; -public: - RenderablePointArray(const Array& array, GLenum mode) - : m_array(array), m_mode(mode) - { - } - void render(RenderStateFlags state) const - { -#define NV_DRIVER_BUG 1 -#if NV_DRIVER_BUG - glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0); - glVertexPointer(3, GL_FLOAT, 0, 0); - glDrawArrays(GL_TRIANGLE_FAN, 0, 0); -#endif - pointvertex_gl_array(m_array.data()); - glDrawArrays(m_mode, 0, GLsizei(m_array.size())); - } -}; - -class RenderablePointVector : public OpenGLRenderable -{ - std::vector m_vector; - const GLenum m_mode; -public: - RenderablePointVector(GLenum mode) - : m_mode(mode) - { - } - - void render(RenderStateFlags state) const - { - pointvertex_gl_array(&m_vector.front()); - glDrawArrays(m_mode, 0, GLsizei(m_vector.size())); - } - - std::size_t size() const - { - return m_vector.size(); - } - bool empty() const - { - return m_vector.empty(); - } - void clear() - { - m_vector.clear(); - } - void reserve(std::size_t size) - { - m_vector.reserve(size); - } - void push_back(const PointVertex& point) - { - m_vector.push_back(point); - } -}; - - -class RenderableVertexBuffer : public OpenGLRenderable -{ - const GLenum m_mode; - const VertexBuffer& m_vertices; -public: - RenderableVertexBuffer(GLenum mode, const VertexBuffer& vertices) - : m_mode(mode), m_vertices(vertices) - { - } - - void render(RenderStateFlags state) const - { - pointvertex_gl_array(m_vertices.data()); - glDrawArrays(m_mode, 0, m_vertices.size()); - } -}; - -class RenderableIndexBuffer : public OpenGLRenderable -{ - const GLenum m_mode; - const IndexBuffer& m_indices; - const VertexBuffer& m_vertices; -public: - RenderableIndexBuffer(GLenum mode, const IndexBuffer& indices, const VertexBuffer& vertices) - : m_mode(mode), m_indices(indices), m_vertices(vertices) - { - } - - void render(RenderStateFlags state) const - { -#if 1 - pointvertex_gl_array(m_vertices.data()); - glDrawElements(m_mode, GLsizei(m_indices.size()), RenderIndexTypeID, m_indices.data()); -#else - glBegin(m_mode); - if(state & RENDER_COLOURARRAY != 0) - { - for(std::size_t i = 0; i < m_indices.size(); ++i) - { - glColor4ubv(&m_vertices[m_indices[i]].colour.r); - glVertex3fv(&m_vertices[m_indices[i]].vertex.x); - } - } - else - { - for(std::size_t i = 0; i < m_indices.size(); ++i) - { - glVertex3fv(&m_vertices[m_indices[i]].vertex.x); - } - } - glEnd(); -#endif - } -}; - - -class RemapXYZ -{ -public: - static void set(Vertex3f& vertex, float x, float y, float z) - { - vertex.x() = x; - vertex.y() = y; - vertex.z() = z; - } -}; - -class RemapYZX -{ -public: - static void set(Vertex3f& vertex, float x, float y, float z) - { - vertex.x() = z; - vertex.y() = x; - vertex.z() = y; - } -}; - -class RemapZXY -{ -public: - static void set(Vertex3f& vertex, float x, float y, float z) - { - vertex.x() = y; - vertex.y() = z; - vertex.z() = x; - } -}; - -template -inline void draw_circle(const std::size_t segments, const float radius, PointVertex* vertices, remap_policy remap) -{ - const double increment = c_pi / double(segments << 2); - - std::size_t count = 0; - float x = radius; - float y = 0; - while(count < segments) - { - PointVertex* i = vertices + count; - PointVertex* j = vertices + ((segments << 1) - (count + 1)); - - PointVertex* k = i + (segments << 1); - PointVertex* l = j + (segments << 1); - - PointVertex* m = i + (segments << 2); - PointVertex* n = j + (segments << 2); - PointVertex* o = k + (segments << 2); - PointVertex* p = l + (segments << 2); - - remap_policy::set(i->vertex, x,-y, 0); - remap_policy::set(k->vertex,-y,-x, 0); - remap_policy::set(m->vertex,-x, y, 0); - remap_policy::set(o->vertex, y, x, 0); - - ++count; - - { - const double theta = increment * count; - x = static_cast(radius * cos(theta)); - y = static_cast(radius * sin(theta)); - } - - remap_policy::set(j->vertex, y,-x, 0); - remap_policy::set(l->vertex,-x,-y, 0); - remap_policy::set(n->vertex,-y, x, 0); - remap_policy::set(p->vertex, x, y, 0); - } -} - -#if 0 -class PointVertexArrayIterator -{ - PointVertex* m_point; -public: - PointVertexArrayIterator(PointVertex* point) - : m_point(point) - { - } - PointVertexArrayIterator& operator++() - { - ++m_point; - return *this; - } - PointVertexArrayIterator operator++(int) - { - PointVertexArrayIterator tmp(*this); - ++m_point; - return tmp; - } - Vertex3f& operator*() - { - return m_point.vertex; - } - Vertex3f* operator->() - { - return &(operator*()); - } -} - -template 0.000001f) - { - s.x() = -cross.y() / cross.x(); - } - - if(fabs(cross.x()) > 0.000001f) - { - t.x() = -cross.z() / cross.x(); - } - } - - { - Vector3 cross( - vector3_cross( - vector3_subtracted( - Vector3(b.vertex.y(), b.texcoord.s(), b.texcoord.t()), - Vector3(a.vertex.y(), a.texcoord.s(), a.texcoord.t()) - ), - vector3_subtracted( - Vector3(c.vertex.y(), c.texcoord.s(), c.texcoord.t()), - Vector3(a.vertex.y(), a.texcoord.s(), a.texcoord.t()) - ) - ) - ); - - if(fabs(cross.x()) > 0.000001f) - { - s.y() = -cross.y() / cross.x(); - } - - if(fabs(cross.x()) > 0.000001f) - { - t.y() = -cross.z() / cross.x(); - } - } - - { - Vector3 cross( - vector3_cross( - vector3_subtracted( - Vector3(b.vertex.z(), b.texcoord.s(), b.texcoord.t()), - Vector3(a.vertex.z(), a.texcoord.s(), a.texcoord.t()) - ), - vector3_subtracted( - Vector3(c.vertex.z(), c.texcoord.s(), c.texcoord.t()), - Vector3(a.vertex.z(), a.texcoord.s(), a.texcoord.t()) - ) - ) - ); - - if(fabs(cross.x()) > 0.000001f) - { - s.z() = -cross.y() / cross.x(); - } - - if(fabs(cross.x()) > 0.000001f) - { - t.z() = -cross.z() / cross.x(); - } - } -} - -inline void ArbitraryMeshTriangle_sumTangents(ArbitraryMeshVertex& a, ArbitraryMeshVertex& b, ArbitraryMeshVertex& c) -{ - Vector3 s, t; - - ArbitraryMeshTriangle_calcTangents(a, b, c, s, t); - - reinterpret_cast(a.tangent) += s; - reinterpret_cast(b.tangent) += s; - reinterpret_cast(c.tangent) += s; - - reinterpret_cast(a.bitangent) += t; - reinterpret_cast(b.bitangent) += t; - reinterpret_cast(c.bitangent) += t; -} - - -#endif diff --git a/libs/scenelib.cpp b/libs/scenelib.cpp deleted file mode 100644 index ff38214c..00000000 --- a/libs/scenelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "scenelib.h" diff --git a/libs/scenelib.h b/libs/scenelib.h deleted file mode 100644 index 9a5c0559..00000000 --- a/libs/scenelib.h +++ /dev/null @@ -1,1103 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_SCENELIB_H) -#define INCLUDED_SCENELIB_H - -#include "iscenegraph.h" -#include "iselection.h" - -#include "warnings.h" -#include -#include - -#include "math/aabb.h" -#include "transformlib.h" -#include "generic/callback.h" -#include "generic/reference.h" -#include "container/stack.h" -#include "typesystem.h" - -class Selector; -class SelectionTest; -class VolumeTest; -template class BasicVector3; -typedef BasicVector3 Vector3; -template class BasicVector4; -typedef BasicVector4 Vector4; -class Matrix4; -typedef Vector4 Quaternion; -class AABB; - -class ComponentSelectionTestable -{ -public: - STRING_CONSTANT(Name, "ComponentSelectionTestable"); - - virtual bool isSelectedComponents() const = 0; - virtual void setSelectedComponents(bool select, SelectionSystem::EComponentMode mode) = 0; - virtual void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) = 0; -}; - -class ComponentEditable -{ -public: - STRING_CONSTANT(Name, "ComponentEditable"); - - virtual const AABB& getSelectedComponentsBounds() const = 0; -}; - -class ComponentSnappable -{ -public: - STRING_CONSTANT(Name, "ComponentSnappable"); - - virtual void snapComponents(float snap) = 0; -}; - -class Bounded -{ -public: - STRING_CONSTANT(Name, "Bounded"); - - virtual const AABB& localAABB() const = 0; -}; - -class BrushDoom3 -{ -public: - STRING_CONSTANT(Name, "BrushDoom3"); - - virtual void setDoom3GroupOrigin(const Vector3& origin) = 0; -}; - - - - -typedef TypeCastTable NodeTypeCastTable; - -template -class NodeType : public StaticTypeSystemInitialiser -{ - TypeId m_typeId; -public: - typedef typename Type::Name Name; - NodeType() : m_typeId(NODETYPEID_NONE) - { - StaticTypeSystemInitialiser::instance().addInitialiser(InitialiseCaller(*this)); - } - void initialise() - { - m_typeId = GlobalSceneGraph().getNodeTypeId(Name()); - } - typedef MemberCaller, &NodeType::initialise> InitialiseCaller; - TypeId getTypeId() - { -#if defined(_DEBUG) - ASSERT_MESSAGE(m_typeId != NODETYPEID_NONE, "node-type " << makeQuoted(Name()) << " used before being initialised"); -#endif - return m_typeId; - } -}; - -template -class StaticNodeType -{ -public: - enum unnamed0 { SIZE = NODETYPEID_MAX }; - static TypeId getTypeId() - { - return Static< NodeType >::instance().getTypeId(); - } -}; - -template -class NodeStaticCast : - public CastInstaller< - StaticNodeType, - StaticCast - > -{ -}; - -template -class NodeContainedCast : - public CastInstaller< - StaticNodeType, - ContainedCast - > -{ -}; - -template -class NodeIdentityCast : - public CastInstaller< - StaticNodeType, - IdentityCast - > -{ -}; - -namespace scene -{ - class Node - { - public: - enum unnamed0 { eVisible = 0 }; - enum unnamed1 { eHidden = 1 << 0 }; - enum unnamed2 { eFiltered = 1 << 1 }; - enum unnamed3 { eExcluded = 1 << 2 }; - - class Symbiot - { - public: - virtual void release() = 0; - }; - - private: - unsigned int m_state; - std::size_t m_refcount; - Symbiot* m_symbiot; - void* m_node; - NodeTypeCastTable& m_casts; - - public: - bool m_isRoot; - - bool isRoot() - { - return m_isRoot; - } - - Node(Symbiot* symbiot, void* node, NodeTypeCastTable& casts) : - m_state(eVisible), - m_refcount(0), - m_symbiot(symbiot), - m_node(node), - m_casts(casts), - m_isRoot(false) - { - } - ~Node() - { - } - - void IncRef() - { - ASSERT_MESSAGE(m_refcount < (1 << 24), "Node::decref: uninitialised refcount"); - ++m_refcount; - } - void DecRef() - { - ASSERT_MESSAGE(m_refcount < (1 << 24), "Node::decref: uninitialised refcount"); - if(--m_refcount == 0) - { - m_symbiot->release(); - } - } - std::size_t getReferenceCount() const - { - return m_refcount; - } - - void* cast(TypeId typeId) const - { - return m_casts.cast(typeId, m_node); - } - - void enable(unsigned int state) - { - m_state |= state; - } - void disable(unsigned int state) - { - m_state &= ~state; - } - bool visible() - { - return m_state == eVisible; - } - bool excluded() - { - return (m_state & eExcluded) != 0; - } - }; - - class NullNode : public Node::Symbiot - { - NodeTypeCastTable m_casts; - Node m_node; - public: - NullNode() : m_node(this, 0, m_casts) - { - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - }; -} - -template -class NodeTypeCast -{ -public: - static Type* cast(scene::Node& node) - { - return static_cast(node.cast(StaticNodeType::getTypeId())); - } - static const Type* cast(const scene::Node& node) - { - return static_cast(node.cast(StaticNodeType::getTypeId())); - } -}; - - -inline scene::Instantiable* Node_getInstantiable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline scene::Traversable* Node_getTraversable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline void Node_traverseSubgraph(scene::Node& node, const scene::Traversable::Walker& walker) -{ - if(walker.pre(node)) - { - scene::Traversable* traversable = Node_getTraversable(node); - if(traversable != 0) - { - traversable->traverse(walker); - } - } - walker.post(node); -} - -inline TransformNode* Node_getTransformNode(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline bool operator<(scene::Node& node, scene::Node& other) -{ - return &node < &other; -} -inline bool operator==(scene::Node& node, scene::Node& other) -{ - return &node == &other; -} -inline bool operator!=(scene::Node& node, scene::Node& other) -{ - return !::operator==(node, other); -} - - -inline scene::Node& NewNullNode() -{ - return (new scene::NullNode)->node(); -} - -inline void Path_deleteTop(const scene::Path& path) -{ - Node_getTraversable(path.parent())->erase(path.top()); -} - - - - - -class delete_all : public scene::Traversable::Walker -{ - scene::Node& m_parent; -public: - delete_all(scene::Node& parent) : m_parent(parent) - { - } - bool pre(scene::Node& node) const - { - return false; - } - void post(scene::Node& node) const - { - Node_getTraversable(m_parent)->erase(node); - } -}; - -inline void DeleteSubgraph(scene::Node& subgraph) -{ - Node_getTraversable(subgraph)->traverse(delete_all(subgraph)); -} - - -class EntityUndefined -{ -public: - STRING_CONSTANT(Name, "Entity"); -}; - -inline bool Node_isEntity(scene::Node& node) -{ - return NodeTypeCast::cast(node) != 0; -} - -template -class EntityWalker : public scene::Graph::Walker -{ - const Functor& functor; -public: - EntityWalker(const Functor& functor) : functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(Node_isEntity(path.top())) - { - functor(instance); - return false; - } - return true; - } -}; - -template -inline const Functor& Scene_forEachEntity(const Functor& functor) -{ - GlobalSceneGraph().traverse(EntityWalker(functor)); - return functor; -} - -class BrushUndefined -{ -public: - STRING_CONSTANT(Name, "Brush"); -}; - -inline bool Node_isBrush(scene::Node& node) -{ - return NodeTypeCast::cast(node) != 0; -} - -class PatchUndefined -{ -public: - STRING_CONSTANT(Name, "Patch"); -}; - -inline bool Node_isPatch(scene::Node& node) -{ - return NodeTypeCast::cast(node) != 0; -} - -inline bool Node_isPrimitive(scene::Node& node) -{ -#if 1 - return Node_isBrush(node) || Node_isPatch(node); -#else - return !node.isRoot(); -#endif -} - -class ParentBrushes : public scene::Traversable::Walker -{ - scene::Node& m_parent; -public: - ParentBrushes(scene::Node& parent) - : m_parent(parent) - { - } - bool pre(scene::Node& node) const - { - return false; - } - void post(scene::Node& node) const - { - if(Node_isPrimitive(node)) - { - Node_getTraversable(m_parent)->insert(node); - } - } -}; - -inline void parentBrushes(scene::Node& subgraph, scene::Node& parent) -{ - Node_getTraversable(subgraph)->traverse(ParentBrushes(parent)); -} - -class HasBrushes : public scene::Traversable::Walker -{ - bool& m_hasBrushes; -public: - HasBrushes(bool& hasBrushes) - : m_hasBrushes(hasBrushes) - { - m_hasBrushes = true; - } - bool pre(scene::Node& node) const - { - if(!Node_isPrimitive(node)) - { - m_hasBrushes = false; - } - return false; - } -}; - -inline bool node_is_group(scene::Node& node) -{ - scene::Traversable* traversable = Node_getTraversable(node); - if(traversable != 0) - { - bool hasBrushes = false; - traversable->traverse(HasBrushes(hasBrushes)); - return hasBrushes; - } - return false; -} - -typedef TypeCastTable InstanceTypeCastTable; - -template -class InstanceType : public StaticTypeSystemInitialiser -{ - TypeId m_typeId; -public: - typedef typename Type::Name Name; - InstanceType() : m_typeId(INSTANCETYPEID_NONE) - { - StaticTypeSystemInitialiser::instance().addInitialiser(InitialiseCaller(*this)); - } - void initialise() - { - m_typeId = GlobalSceneGraph().getInstanceTypeId(Name()); - } - typedef MemberCaller, &InstanceType::initialise> InitialiseCaller; - TypeId getTypeId() - { -#if defined(_DEBUG) - ASSERT_MESSAGE(m_typeId != INSTANCETYPEID_NONE, "instance-type " << makeQuoted(Name()) << " used before being initialised"); -#endif - return m_typeId; - } -}; - -template -class StaticInstanceType -{ -public: - enum unnamed0 { SIZE = INSTANCETYPEID_MAX }; - static TypeId getTypeId() - { - return Static< InstanceType >::instance().getTypeId(); - } -}; - -template -class InstanceStaticCast : - public CastInstaller< - StaticInstanceType, - StaticCast - > -{ -}; - -template -class InstanceContainedCast : - public CastInstaller< - StaticInstanceType, - ContainedCast - > -{ -}; - -template -class InstanceIdentityCast : - public CastInstaller< - StaticInstanceType, - IdentityCast - > -{ -}; - - -inline Selectable* Instance_getSelectable(scene::Instance& instance); -inline const Selectable* Instance_getSelectable(const scene::Instance& instance); - -inline Bounded* Instance_getBounded(scene::Instance& instance); -inline const Bounded* Instance_getBounded(const scene::Instance& instance); - -namespace scene -{ - class Instance - { - class AABBAccumulateWalker : public scene::Graph::Walker - { - AABB& m_aabb; - mutable std::size_t m_depth; - public: - AABBAccumulateWalker(AABB& aabb) : m_aabb(aabb), m_depth(0) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(m_depth == 1) - { - aabb_extend_by_aabb_safe(m_aabb, instance.worldAABB()); - } - return ++m_depth != 2; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - --m_depth; - } - }; - - - class TransformChangedWalker : public scene::Graph::Walker - { - public: - bool pre(const scene::Path& path, scene::Instance& instance) const - { - instance.transformChangedLocal(); - return true; - } - }; - - class ParentSelectedChangedWalker : public scene::Graph::Walker - { - public: - bool pre(const scene::Path& path, scene::Instance& instance) const - { - instance.parentSelectedChanged(); - return true; - } - }; - - class ChildSelectedWalker : public scene::Graph::Walker - { - bool& m_childSelected; - mutable std::size_t m_depth; - public: - ChildSelectedWalker(bool& childSelected) : m_childSelected(childSelected), m_depth(0) - { - m_childSelected = false; - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(m_depth == 1 && !m_childSelected) - { - m_childSelected = instance.isSelected() || instance.childSelected(); - } - return ++m_depth != 2; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - --m_depth; - } - }; - - Path m_path; - Instance* m_parent; - void* m_instance; - InstanceTypeCastTable& m_casts; - - mutable Matrix4 m_local2world; - mutable AABB m_bounds; - mutable AABB m_childBounds; - mutable bool m_transformChanged; - mutable bool m_transformMutex; - mutable bool m_boundsChanged; - mutable bool m_boundsMutex; - mutable bool m_childBoundsChanged; - mutable bool m_childBoundsMutex; - mutable bool m_isSelected; - mutable bool m_isSelectedChanged; - mutable bool m_childSelected; - mutable bool m_childSelectedChanged; - mutable bool m_parentSelected; - mutable bool m_parentSelectedChanged; - Callback m_childSelectedChangedCallback; - Callback m_transformChangedCallback; - - - void evaluateTransform() const - { - if(m_transformChanged) - { - ASSERT_MESSAGE(!m_transformMutex, "re-entering transform evaluation"); - m_transformMutex = true; - - m_local2world = (m_parent != 0) ? m_parent->localToWorld() : g_matrix4_identity; - TransformNode* transformNode = Node_getTransformNode(m_path.top()); - if(transformNode != 0) - { - matrix4_multiply_by_matrix4(m_local2world, transformNode->localToParent()); - } - - m_transformMutex = false; - m_transformChanged = false; - } - } - void evaluateChildBounds() const - { - if(m_childBoundsChanged) - { - ASSERT_MESSAGE(!m_childBoundsMutex, "re-entering bounds evaluation"); - m_childBoundsMutex = true; - - m_childBounds = AABB(); - - GlobalSceneGraph().traverse_subgraph(AABBAccumulateWalker(m_childBounds), m_path); - - m_childBoundsMutex = false; - m_childBoundsChanged = false; - } - } - void evaluateBounds() const - { - if(m_boundsChanged) - { - ASSERT_MESSAGE(!m_boundsMutex, "re-entering bounds evaluation"); - m_boundsMutex = true; - - m_bounds = childBounds(); - - const Bounded* bounded = Instance_getBounded(*this); - if(bounded != 0) - { - aabb_extend_by_aabb_safe( - m_bounds, - aabb_for_oriented_aabb_safe(bounded->localAABB(), localToWorld()) - ); - } - - m_boundsMutex = false; - m_boundsChanged = false; - } - } - - Instance(const scene::Instance& other); - Instance& operator=(const scene::Instance& other); - public: - - Instance(const scene::Path& path, Instance* parent, void* instance, InstanceTypeCastTable& casts) : - m_path(path), - m_parent(parent), - m_instance(instance), - m_casts(casts), - m_local2world(g_matrix4_identity), - m_transformChanged(true), - m_transformMutex(false), - m_boundsChanged(true), - m_boundsMutex(false), - m_childBoundsChanged(true), - m_childBoundsMutex(false), - m_isSelectedChanged(true), - m_childSelectedChanged(true), - m_parentSelectedChanged(true) - { - ASSERT_MESSAGE((parent == 0) == (path.size() == 1), "instance has invalid parent"); - } - virtual ~Instance() - { - } - - const scene::Path& path() const - { - return m_path; - } - - void* cast(TypeId typeId) const - { - return m_casts.cast(typeId, m_instance); - } - - const Matrix4& localToWorld() const - { - evaluateTransform(); - return m_local2world; - } - void transformChangedLocal() - { - ASSERT_NOTNULL(m_parent); - m_transformChanged = true; - m_boundsChanged = true; - m_childBoundsChanged = true; - m_transformChangedCallback(); - } - void transformChanged() - { - GlobalSceneGraph().traverse_subgraph(TransformChangedWalker(), m_path); - boundsChanged(); - } - void setTransformChangedCallback(const Callback& callback) - { - m_transformChangedCallback = callback; - } - - - const AABB& worldAABB() const - { - evaluateBounds(); - return m_bounds; - } - const AABB& childBounds() const - { - evaluateChildBounds(); - return m_childBounds; - } - void boundsChanged() - { - m_boundsChanged = true; - m_childBoundsChanged = true; - if(m_parent != 0) - { - m_parent->boundsChanged(); - } - GlobalSceneGraph().boundsChanged(); - } - - void childSelectedChanged() - { - m_childSelectedChanged = true; - m_childSelectedChangedCallback(); - if(m_parent != 0) - { - m_parent->childSelectedChanged(); - } - } - bool childSelected() const - { - if(m_childSelectedChanged) - { - m_childSelectedChanged = false; - GlobalSceneGraph().traverse_subgraph(ChildSelectedWalker(m_childSelected), m_path); - } - return m_childSelected; - } - - void setChildSelectedChangedCallback(const Callback& callback) - { - m_childSelectedChangedCallback = callback; - } - void selectedChanged() - { - m_isSelectedChanged = true; - if(m_parent != 0) - { - m_parent->childSelectedChanged(); - } - GlobalSceneGraph().traverse_subgraph(ParentSelectedChangedWalker(), m_path); - } - bool isSelected() const - { - if(m_isSelectedChanged) - { - m_isSelectedChanged = false; - const Selectable* selectable = Instance_getSelectable(*this); - m_isSelected = selectable != 0 && selectable->isSelected(); - } - return m_isSelected; - } - - void parentSelectedChanged() - { - m_parentSelectedChanged = true; - } - bool parentSelected() const - { - if(m_parentSelectedChanged) - { - m_parentSelectedChanged = false; - m_parentSelected = m_parent != 0 && (m_parent->isSelected() || m_parent->parentSelected()); - } - return m_parentSelected; - } - }; -} - -template -class InstanceTypeCast -{ -public: - static Type* cast(scene::Instance& instance) - { - return static_cast(instance.cast(StaticInstanceType::getTypeId())); - } - static const Type* cast(const scene::Instance& instance) - { - return static_cast(instance.cast(StaticInstanceType::getTypeId())); - } -}; - -template -class InstanceWalker : public scene::Graph::Walker -{ - const Functor& m_functor; -public: - InstanceWalker(const Functor& functor) : m_functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - m_functor(instance); - return true; - } -}; - -template -class ChildInstanceWalker : public scene::Graph::Walker -{ - const Functor& m_functor; - mutable std::size_t m_depth; -public: - ChildInstanceWalker(const Functor& functor) : m_functor(functor), m_depth(0) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(m_depth == 1) - { - m_functor(instance); - } - return ++m_depth != 2; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - --m_depth; - } -}; - -template -class InstanceApply : public Functor -{ -public: - InstanceApply(const Functor& functor) : Functor(functor) - { - } - void operator()(scene::Instance& instance) const - { - Type* result = InstanceTypeCast::cast(instance); - if(result != 0) - { - Functor::operator()(*result); - } - } -}; - -inline Selectable* Instance_getSelectable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} -inline const Selectable* Instance_getSelectable(const scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -template -inline void Scene_forEachChildSelectable(const Functor& functor, const scene::Path& path) -{ - GlobalSceneGraph().traverse_subgraph(ChildInstanceWalker< InstanceApply >(functor), path); -} - -class SelectableSetSelected -{ - bool m_selected; -public: - SelectableSetSelected(bool selected) : m_selected(selected) - { - } - void operator()(Selectable& selectable) const - { - selectable.setSelected(m_selected); - } -}; - -inline Bounded* Instance_getBounded(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} -inline const Bounded* Instance_getBounded(const scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -inline Transformable* Instance_getTransformable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} -inline const Transformable* Instance_getTransformable(const scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - - -inline ComponentSelectionTestable* Instance_getComponentSelectionTestable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -inline ComponentEditable* Instance_getComponentEditable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -inline ComponentSnappable* Instance_getComponentSnappable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - - -inline void Instance_setSelected(scene::Instance& instance, bool selected) -{ - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0) - { - selectable->setSelected(selected); - } -} - -inline bool Instance_isSelected(scene::Instance& instance) -{ - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0) - { - return selectable->isSelected(); - } - return false; -} - -inline scene::Instance& findInstance(const scene::Path& path) -{ - scene::Instance* instance = GlobalSceneGraph().find(path); - ASSERT_MESSAGE(instance != 0, "findInstance: path not found in scene-graph"); - return *instance; -} - -inline void selectPath(const scene::Path& path, bool selected) -{ - Instance_setSelected(findInstance(path), selected); -} - -class SelectChildren : public scene::Traversable::Walker -{ - mutable scene::Path m_path; -public: - SelectChildren(const scene::Path& root) - : m_path(root) - { - } - bool pre(scene::Node& node) const - { - m_path.push(makeReference(node)); - selectPath(m_path, true); - return false; - } - void post(scene::Node& node) const - { - m_path.pop(); - } -}; - -inline void Entity_setSelected(scene::Instance& entity, bool selected) -{ - scene::Node& node = entity.path().top(); - if(node_is_group(node)) - { - Node_getTraversable(node)->traverse(SelectChildren(entity.path())); - } - else - { - Instance_setSelected(entity, selected); - } -} - -inline bool Entity_isSelected(scene::Instance& entity) -{ - if(node_is_group(entity.path().top())) - { - return entity.childSelected(); - } - return Instance_isSelected(entity); -} - - - -class InstanceCounter -{ -public: - unsigned int m_count; - InstanceCounter() : m_count(0) - { - } -}; - - -class Counter -{ -public: - virtual void increment() = 0; - virtual void decrement() = 0; -}; - -#include "generic/callback.h" - -class SimpleCounter : public Counter -{ - Callback m_countChanged; - std::size_t m_count; -public: - void setCountChangedCallback(const Callback& countChanged) - { - m_countChanged = countChanged; - } - void increment() - { - ++m_count; - m_countChanged(); - } - void decrement() - { - --m_count; - m_countChanged(); - } - std::size_t get() const - { - return m_count; - } -}; - - -template -class ConstReference; -typedef ConstReference PathConstReference; - -#include "generic/referencecounted.h" -typedef SmartReference > NodeSmartReference; - - -#endif diff --git a/libs/script/scripttokeniser.cpp b/libs/script/scripttokeniser.cpp deleted file mode 100644 index 04f7de5e..00000000 --- a/libs/script/scripttokeniser.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "scripttokeniser.h" - diff --git a/libs/script/scripttokeniser.h b/libs/script/scripttokeniser.h deleted file mode 100644 index ba4a0787..00000000 --- a/libs/script/scripttokeniser.h +++ /dev/null @@ -1,383 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SCRIPT_SCRIPTTOKENISER_H) -#define INCLUDED_SCRIPT_SCRIPTTOKENISER_H - -#include "iscriplib.h" - -class ScriptTokeniser : public Tokeniser -{ - enum CharType - { - eWhitespace, - eCharToken, - eNewline, - eCharQuote, - eCharSolidus, - eCharStar, - eCharSpecial, - }; - - typedef bool (ScriptTokeniser::*Tokenise)(char c); - - Tokenise m_stack[3]; - Tokenise* m_state; - SingleCharacterInputStream m_istream; - std::size_t m_scriptline; - std::size_t m_scriptcolumn; - - char m_token[MAXTOKEN]; - char* m_write; - - char m_current; - bool m_eof; - bool m_crossline; - bool m_unget; - bool m_emit; - - bool m_special; - - CharType charType(const char c) - { - switch(c) - { - case '\n': return eNewline; - case '"': return eCharQuote; - case '/': return eCharSolidus; - case '*': return eCharStar; - case '{': case '(': case '}': case ')': case '[': case ']': case ',': case ':': return (m_special) ? eCharSpecial : eCharToken; - } - - if(c > 32) - { - return eCharToken; - } - return eWhitespace; - } - - Tokenise state() - { - return *m_state; - } - void push(Tokenise state) - { - ASSERT_MESSAGE(m_state != m_stack + 2, "token parser: illegal stack push"); - *(++m_state) = state; - } - void pop() - { - ASSERT_MESSAGE(m_state != m_stack, "token parser: illegal stack pop"); - --m_state; - } - void add(const char c) - { - if(m_write < m_token + MAXTOKEN - 1) - { - *m_write++ = c; - } - } - void remove() - { - ASSERT_MESSAGE(m_write > m_token, "no char to remove"); - --m_write; - } - - bool tokeniseDefault(char c) - { - switch(charType(c)) - { - case eNewline: - if(!m_crossline) - { - globalErrorStream() << Unsigned(getLine()) << ":" << Unsigned(getColumn()) << ": unexpected end-of-line before token\n"; - return false; - } - break; - case eCharToken: - case eCharStar: - push(Tokenise(&ScriptTokeniser::tokeniseToken)); - add(c); - break; - case eCharSpecial: - push(Tokenise(&ScriptTokeniser::tokeniseSpecial)); - add(c); - break; - case eCharQuote: - push(Tokenise(&ScriptTokeniser::tokeniseQuotedToken)); - break; - case eCharSolidus: - push(Tokenise(&ScriptTokeniser::tokeniseSolidus)); - break; - default: - break; - } - return true; - } - bool tokeniseToken(char c) - { - switch(charType(c)) - { - case eNewline: - case eWhitespace: - case eCharQuote: - case eCharSpecial: - pop(); - m_emit = true; // emit token - break; - case eCharSolidus: -#if 0 //SPoG: ignore comments in the middle of tokens. - push(Tokenise(&ScriptTokeniser::tokeniseSolidus)); - break; -#endif - case eCharToken: - case eCharStar: - add(c); - break; - default: - break; - } - return true; - } - bool tokeniseQuotedToken(char c) - { - switch(charType(c)) - { - case eNewline: - if(m_crossline) - { - globalErrorStream() << Unsigned(getLine()) << ":" << Unsigned(getColumn()) << ": unexpected end-of-line in quoted token\n"; - return false; - } - break; - case eWhitespace: - case eCharToken: - case eCharSolidus: - case eCharStar: - case eCharSpecial: - add(c); - break; - case eCharQuote: - pop(); - push(Tokenise(&ScriptTokeniser::tokeniseEndQuote)); - break; - default: - break; - } - return true; - } - bool tokeniseSolidus(char c) - { - switch(charType(c)) - { - case eNewline: - case eWhitespace: - case eCharQuote: - case eCharSpecial: - pop(); - add('/'); - m_emit = true; // emit single slash - break; - case eCharToken: - pop(); - add('/'); - add(c); - break; - case eCharSolidus: - pop(); - push(Tokenise(&ScriptTokeniser::tokeniseComment)); - break; // dont emit single slash - case eCharStar: - pop(); - push(Tokenise(&ScriptTokeniser::tokeniseBlockComment)); - break; // dont emit single slash - default: - break; - } - return true; - } - bool tokeniseComment(char c) - { - if(c == '\n') - { - pop(); - if(state() == Tokenise(&ScriptTokeniser::tokeniseToken)) - { - pop(); - m_emit = true; // emit token immediatly preceding comment - } - } - return true; - } - bool tokeniseBlockComment(char c) - { - if(c == '*') - { - pop(); - push(Tokenise(&ScriptTokeniser::tokeniseEndBlockComment)); - } - return true; - } - bool tokeniseEndBlockComment(char c) - { - switch(c) - { - case '/': - pop(); - if(state() == Tokenise(&ScriptTokeniser::tokeniseToken)) - { - pop(); - m_emit = true; // emit token immediatly preceding comment - } - break; // dont emit comment - case '*': - break; // no state change - default: - pop(); - push(Tokenise(&ScriptTokeniser::tokeniseBlockComment)); - break; - } - return true; - } - bool tokeniseEndQuote(char c) - { - pop(); - m_emit = true; // emit quoted token - return true; - } - bool tokeniseSpecial(char c) - { - pop(); - m_emit = true; // emit single-character token - return true; - } - - /// Returns true if a token was successfully parsed. - bool tokenise() - { - m_write = m_token; - while(!eof()) - { - char c = m_current; - - if(!((*this).*state())(c)) - { - // parse error - m_eof = true; - return false; - } - if(m_emit) - { - m_emit = false; - return true; - } - - if(c == '\n') - { - ++m_scriptline; - m_scriptcolumn = 1; - } - else - { - ++m_scriptcolumn; - } - - m_eof = !m_istream.readChar(m_current); - } - return m_write != m_token; - } - - const char* fillToken() - { - if(!tokenise()) - { - return 0; - } - - add('\0'); - return m_token; - } - - bool eof() - { - return m_eof; - } - -public: - ScriptTokeniser(TextInputStream& istream, bool special) - : m_state(m_stack), - m_istream(istream), - m_scriptline(1), - m_scriptcolumn(1), - m_crossline(false), - m_unget(false), - m_emit(false), - m_special(special) - { - m_stack[0] = Tokenise(&ScriptTokeniser::tokeniseDefault); - m_eof = !m_istream.readChar(m_current); - m_token[MAXTOKEN - 1] = '\0'; - } - void release() - { - delete this; - } - void nextLine() - { - m_crossline = true; - } - const char* getToken() - { - if(m_unget) - { - m_unget = false; - return m_token; - } - - return fillToken(); - } - void ungetToken() - { - ASSERT_MESSAGE(!m_unget, "can't unget more than one token"); - m_unget = true; - } - std::size_t getLine() const - { - return m_scriptline; - } - std::size_t getColumn() const - { - return m_scriptcolumn; - } -}; - - -inline Tokeniser& NewScriptTokeniser(TextInputStream& istream) -{ - return *(new ScriptTokeniser(istream, true)); -} - -inline Tokeniser& NewSimpleTokeniser(TextInputStream& istream) -{ - return *(new ScriptTokeniser(istream, false)); -} - -#endif diff --git a/libs/script/scripttokenwriter.cpp b/libs/script/scripttokenwriter.cpp deleted file mode 100644 index c63bf699..00000000 --- a/libs/script/scripttokenwriter.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "scripttokenwriter.h" - diff --git a/libs/script/scripttokenwriter.h b/libs/script/scripttokenwriter.h deleted file mode 100644 index 04935862..00000000 --- a/libs/script/scripttokenwriter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SCRIPT_SCRIPTTOKENWRITER_H) -#define INCLUDED_SCRIPT_SCRIPTTOKENWRITER_H - -#include "iscriplib.h" - -class SimpleTokenWriter : public TokenWriter -{ -public: - SimpleTokenWriter(TextOutputStream& ostream) - : m_ostream(ostream), m_separator('\n') - { - } - ~SimpleTokenWriter() - { - writeSeparator(); - } - void release() - { - delete this; - } - void nextLine() - { - m_separator = '\n'; - } - void writeToken(const char* token) - { - ASSERT_MESSAGE(strchr(token, ' ') == 0, "token contains whitespace: "); - writeSeparator(); - m_ostream << token; - } - void writeString(const char* string) - { - writeSeparator(); - m_ostream << '"' << string << '"'; - } - void writeInteger(int i) - { - writeSeparator(); - m_ostream << i; - } - void writeUnsigned(std::size_t i) - { - writeSeparator(); - m_ostream << Unsigned(i); - } - void writeFloat(double f) - { - writeSeparator(); - m_ostream << Decimal(f); - } - -private: - void writeSeparator() - { - m_ostream << m_separator; - m_separator = ' '; - } - TextOutputStream& m_ostream; - char m_separator; -}; - -inline TokenWriter& NewSimpleTokenWriter(TextOutputStream& ostream) -{ - return *(new SimpleTokenWriter(ostream)); -} - -#endif diff --git a/libs/selectionlib.cpp b/libs/selectionlib.cpp deleted file mode 100644 index 4ac6c18c..00000000 --- a/libs/selectionlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "selectionlib.h" diff --git a/libs/selectionlib.h b/libs/selectionlib.h deleted file mode 100644 index b842616e..00000000 --- a/libs/selectionlib.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_SELECTIONLIB_H) -#define INCLUDED_SELECTIONLIB_H - -#include "iselection.h" -#include "generic/callback.h" -#include "scenelib.h" -#include - -class SelectableBool : public Selectable -{ - bool m_selected; -public: - SelectableBool() - : m_selected(false) - {} - - void setSelected(bool select = true) - { - m_selected = select; - } - bool isSelected() const - { - return m_selected; - } -}; - -class ObservedSelectable : public Selectable -{ - SelectionChangeCallback m_onchanged; - bool m_selected; -public: - ObservedSelectable(const SelectionChangeCallback& onchanged) : m_onchanged(onchanged), m_selected(false) - { - } - ObservedSelectable(const ObservedSelectable& other) : Selectable(other), m_onchanged(other.m_onchanged), m_selected(false) - { - setSelected(other.isSelected()); - } - ObservedSelectable& operator=(const ObservedSelectable& other) - { - setSelected(other.isSelected()); - return *this; - } - ~ObservedSelectable() - { - setSelected(false); - } - - void setSelected(bool select) - { - if(select ^ m_selected) - { - m_selected = select; - - m_onchanged(*this); - } - } - bool isSelected() const - { - return m_selected; - } -}; - -class SelectableInstance : public scene::Instance -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceContainedCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - ObservedSelectable m_selectable; -public: - - typedef LazyStatic StaticTypeCasts; - - SelectableInstance(const scene::Path& path, scene::Instance* parent, void* instance = 0, InstanceTypeCastTable& casts = StaticTypeCasts::instance().get()) : - Instance(path, parent, instance != 0 ? instance : this, casts), - m_selectable(SelectedChangedCaller(*this)) - { - } - - Selectable& get(NullType) - { - return m_selectable; - } - - Selectable& getSelectable() - { - return m_selectable; - } - const Selectable& getSelectable() const - { - return m_selectable; - } - - void selectedChanged(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::ePrimitive)(selectable); - GlobalSelectionSystem().onSelectedChanged(*this, selectable); - - Instance::selectedChanged(); - } - typedef MemberCaller1 SelectedChangedCaller; -}; - - -template -inline bool range_check(Iterator start, Iterator finish, Iterator iter) -{ - for(;start != finish; ++start) - { - if(start == iter) - { - return true; - } - } - return false; -} - -#include - -template -class SelectionList -{ - typedef std::list List; - List m_selection; -public: - typedef typename List::iterator iterator; - typedef typename List::const_iterator const_iterator; - - iterator begin() - { - return m_selection.begin(); - } - const_iterator begin() const - { - return m_selection.begin(); - } - iterator end() - { - return m_selection.end(); - } - const_iterator end() const - { - return m_selection.end(); - } - bool empty() const - { - return m_selection.empty(); - } - std::size_t size() const - { - return m_selection.size(); - } - Selected& back() - { - return *m_selection.back(); - } - Selected& back() const - { - return *m_selection.back(); - } - void append(Selected& selected) - { - m_selection.push_back(&selected); - } - void erase(Selected& selected) - { - typename List::reverse_iterator i = std::find(m_selection.rbegin(), m_selection.rend(), &selected); - ASSERT_MESSAGE(i != m_selection.rend(), "selection-tracking error"); - ASSERT_MESSAGE(range_check(m_selection.begin(), m_selection.end(), --i.base()), "selection-tracking error"); - m_selection.erase(--i.base()); - } -}; - - -#endif diff --git a/libs/shaderlib.cpp b/libs/shaderlib.cpp deleted file mode 100644 index 75230dba..00000000 --- a/libs/shaderlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "shaderlib.h" diff --git a/libs/shaderlib.h b/libs/shaderlib.h deleted file mode 100644 index 56e0592f..00000000 --- a/libs/shaderlib.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_SHADERLIB_H) -#define INCLUDED_SHADERLIB_H - -#include "string/string.h" -#include "character.h" -#include "ishaders.h" - -inline bool shader_equal(const char* shader, const char* other) -{ - return string_equal_nocase(shader, other); -} - -inline bool shader_equal_n(const char* shader, const char* other, std::size_t n) -{ - return string_equal_nocase_n(shader, other, n); -} - -inline bool shader_less(const char* shader, const char* other) -{ - return string_less_nocase(shader, other); -} - -inline bool shader_equal_prefix(const char* string, const char* prefix) -{ - return shader_equal_n(string, prefix, string_length(prefix)); -} - -class shader_less_t -{ -public: - bool operator()(const CopiedString& shader, const CopiedString& other) const - { - return shader_less(shader.c_str(), other.c_str()); - } -}; - -inline bool shader_valid(const char* shader) -{ - return string_is_ascii(shader) - && strchr(shader, ' ') == 0 - && strchr(shader, '\n') == 0 - && strchr(shader, '\r') == 0 - && strchr(shader, '\t') == 0 - && strchr(shader, '\v') == 0 - && strchr(shader, '\\') == 0; -} - -inline const char* GlobalTexturePrefix_get() -{ - return GlobalShaderSystem().getTexturePrefix(); -} - -inline bool shader_is_texture(const char* name) -{ - return shader_equal_prefix(name, GlobalTexturePrefix_get()); -} - -inline const char* shader_get_textureName(const char* name) -{ - return name + string_length(GlobalTexturePrefix_get()); -} - -inline bool texdef_name_valid(const char* name) -{ - return shader_valid(name) && shader_is_texture(name); -} - -inline const char* texdef_name_default() -{ - return GlobalTexturePrefix_get(); -} - - -#endif diff --git a/libs/signal/isignal.cpp b/libs/signal/isignal.cpp deleted file mode 100644 index ee7e4cb7..00000000 --- a/libs/signal/isignal.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "isignal.h" - diff --git a/libs/signal/isignal.h b/libs/signal/isignal.h deleted file mode 100644 index 4fe27471..00000000 --- a/libs/signal/isignal.h +++ /dev/null @@ -1,224 +0,0 @@ - -#if !defined(INCLUDED_ISIGNAL_H) -#define INCLUDED_ISIGNAL_H - -#include "generic/callback.h" -#include "signal/signalfwd.h" - -class SignalHandlerResult -{ - bool value; -public: - explicit SignalHandlerResult(bool value) : value(value) - { - } - bool operator==(SignalHandlerResult other) const - { - return value == other.value; - } - bool operator!=(SignalHandlerResult other) const - { - return !operator==(other); - } -}; - -const SignalHandlerResult SIGNAL_CONTINUE_EMISSION = SignalHandlerResult(false); -const SignalHandlerResult SIGNAL_STOP_EMISSION = SignalHandlerResult(true); - -template -class SignalHandlerCaller1 -{ -public: - typedef typename Caller::first_argument_type first_argument_type; - typedef SignalHandlerResult result_type; - static result_type call(first_argument_type a1) - { - Caller::call(a1); - return SIGNAL_CONTINUE_EMISSION; - } -}; - -template -class SignalHandlerCaller2 -{ -public: - typedef typename Caller::first_argument_type first_argument_type; - typedef typename Caller::second_argument_type second_argument_type; - typedef SignalHandlerResult result_type; - static result_type call(first_argument_type a1, second_argument_type a2) - { - Caller::call(a1, a2); - return SIGNAL_CONTINUE_EMISSION; - } -}; - -template -class SignalHandlerCaller3 -{ -public: - typedef typename Caller::first_argument_type first_argument_type; - typedef typename Caller::second_argument_type second_argument_type; - typedef typename Caller::third_argument_type third_argument_type; - typedef SignalHandlerResult result_type; - static result_type call(first_argument_type a1, second_argument_type a2, third_argument_type a3) - { - Caller::call(a1, a2, a3); - return SIGNAL_CONTINUE_EMISSION; - } -}; - -template -class SignalHandlerCaller4 -{ -public: - typedef typename Caller::first_argument_type first_argument_type; - typedef typename Caller::second_argument_type second_argument_type; - typedef typename Caller::third_argument_type third_argument_type; - typedef typename Caller::fourth_argument_type fourth_argument_type; - typedef SignalHandlerResult result_type; - static result_type call(first_argument_type a1, second_argument_type a2, third_argument_type a3, fourth_argument_type a4) - { - Caller::call(a1, a2, a3, a4); - return SIGNAL_CONTINUE_EMISSION; - } -}; - -class SignalHandler : public Callback0 -{ -public: - template - SignalHandler(const BindFirstOpaque& caller) - : Callback0(BindFirstOpaque, - typename Caller::result_type - >::type>(caller.getBound())) - { - } -}; - -template -inline SignalHandler makeSignalHandler(const BindFirstOpaque& caller) -{ - return SignalHandler(caller); -} -template -inline SignalHandler makeSignalHandler(const Caller& caller, typename Caller::first_argument_type callee) -{ - return SignalHandler(BindFirstOpaque(callee)); -} - - -template -class SignalHandler1 : public Callback1 -{ -public: - template - SignalHandler1(const BindFirstOpaque1& caller) - : Callback1(BindFirstOpaque1, - typename Caller::result_type - >::type>(caller.getBound())) - { - } -}; - -template -inline SignalHandler1 makeSignalHandler1(const BindFirstOpaque1& caller) -{ - return SignalHandler1(caller); -} -template -inline SignalHandler1 makeSignalHandler1(const Caller& caller, typename Caller::first_argument_type callee) -{ - return SignalHandler1(BindFirstOpaque1(callee)); -} - - -template -class SignalHandler2 : public Callback2 -{ -public: - template - SignalHandler2(const BindFirstOpaque2& caller) - : Callback2(BindFirstOpaque2, - typename Caller::result_type - >::type>(caller.getBound())) - { - } -}; - -template -inline SignalHandler2< - typename Caller::second_argument_type, - typename Caller::third_argument_type -> makeSignalHandler2(const BindFirstOpaque2& caller) -{ - return SignalHandler2< - typename Caller::second_argument_type, - typename Caller::third_argument_type - >(caller); -} -template -inline SignalHandler2< - typename Caller::second_argument_type, - typename Caller::third_argument_type -> makeSignalHandler2(const Caller& caller, typename Caller::first_argument_type callee) -{ - return SignalHandler2< - typename Caller::second_argument_type, - typename Caller::third_argument_type - >(BindFirstOpaque2(callee)); -} - - -template -class SignalHandler3 : public Callback3 -{ -public: - template - SignalHandler3(const BindFirstOpaque3& caller) - : Callback3(BindFirstOpaque3, - typename Caller::result_type - >::type>(caller.getBound())) - { - } -}; - -template -inline SignalHandler3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type -> makeSignalHandler3(const BindFirstOpaque3& caller) -{ - return SignalHandler3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type - >(caller); -} -template -inline SignalHandler3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type -> makeSignalHandler3(const Caller& caller, typename Caller::first_argument_type callee) -{ - return SignalHandler3< - typename Caller::second_argument_type, - typename Caller::third_argument_type, - typename Caller::fourth_argument_type - >(BindFirstOpaque3(callee)); -} - -#endif diff --git a/libs/signal/signal.cpp b/libs/signal/signal.cpp deleted file mode 100644 index 617a3a4e..00000000 --- a/libs/signal/signal.cpp +++ /dev/null @@ -1,105 +0,0 @@ - -#include "signal.h" - - - -namespace -{ - class Test - { - }; - class A1 - { - }; - class A2 - { - }; - class A3 - { - }; - - SignalHandlerResult handler0(Test&) - { - return SIGNAL_CONTINUE_EMISSION; - } - typedef Function1 TestHandler0; - - int function0(Test&) - { - return 7; - } - typedef Function1 TestFunction0; - - SignalHandlerResult handler1(Test&, A1) - { - return SIGNAL_CONTINUE_EMISSION; - } - typedef Function2 TestHandler1; - - void function1(Test&, A1) - { - } - typedef ReferenceCaller1 TestFunction1; - - SignalHandlerResult handler2(Test&, A1, A2) - { - return SIGNAL_CONTINUE_EMISSION; - } - typedef Function3 TestHandler2; - - void function2(Test&, A1, A2) - { - } - typedef Function3 TestFunction2; - - SignalHandlerResult handler3(Test&, A1, A2, A3) - { - return SIGNAL_CONTINUE_EMISSION; - } - typedef Function4 TestHandler3; - - void function3(Test&, A1, A2, A3) - { - } - typedef Function4 TestFunction3; - - void testSignals() - { - Test test; - { - Signal0 e0; - Signal0::handler_id_type a = e0.connectLast(makeSignalHandler(TestHandler0(), test)); // signal handler from direct caller returning result - Signal0::handler_id_type b = e0.connectFirst(makeSignalHandler(TestFunction0(), test)); // signal handler from direct caller returning int - e0(); - e0.disconnect(a); - e0.disconnect(b); - } - { - typedef Signal1 Signal1Test; - Signal1Test e1; - Signal1Test::handler_id_type a = e1.connectLast(makeSignalHandler1(TestHandler1(), test)); // signal handler from direct caller with one argument, returning result - Signal1Test::handler_id_type b = e1.connectFirst(makeSignalHandler1(TestFunction1(test))); // signal handler from opaque caller with one argument, returning void - e1(A1()); - e1.disconnect(a); - e1.disconnect(b); - } - { - typedef Signal2 Signal2Test; - Signal2Test e2; - Signal2Test::handler_id_type a = e2.connectLast(makeSignalHandler2(TestHandler2(), test)); // signal handler from direct caller with two arguments, returning result - Signal2Test::handler_id_type b = e2.connectLast(makeSignalHandler2(TestFunction2(), test)); // signal handler from direct caller with two arguments, returning void - e2(A1(), A2()); - e2.disconnect(a); - e2.disconnect(b); - } - { - typedef Signal3 Signal3Test; - Signal3Test e3; - Signal3Test::handler_id_type a = e3.connectLast(makeSignalHandler3(TestHandler3(), test)); // signal handler from direct caller with three arguments, returning result - Signal3Test::handler_id_type b = e3.connectLast(makeSignalHandler3(TestFunction3(), test)); // signal handler from direct caller with three arguments, returning void - e3(A1(), A2(), A3()); - e3.disconnect(a); - e3.disconnect(b); - } - } -} diff --git a/libs/signal/signal.h b/libs/signal/signal.h deleted file mode 100644 index a4fecd9d..00000000 --- a/libs/signal/signal.h +++ /dev/null @@ -1,396 +0,0 @@ - -#if !defined(INCLUDED_SIGNAL_H) -#define INCLUDED_SIGNAL_H - -#include "isignal.h" -#include "memory/allocator.h" -#include "debugging/debugging.h" -#include - -namespace ListDetail -{ - struct ListNodeBase - { - ListNodeBase* next; - ListNodeBase* prev; - }; - - inline void list_initialise(ListNodeBase& self) - { - self.next = self.prev = &self; - } - - inline void list_swap(ListNodeBase& self, ListNodeBase& other) - { - ListNodeBase tmp(self); - if(other.next == &other) - { - list_initialise(self); - } - else - { - self = other; - self.next->prev = self.prev->next = &self; - } - if(tmp.next == &self) - { - list_initialise(other); - } - else - { - other = tmp; - other.next->prev = other.prev->next = &other; - } - } - - inline void node_link(ListNodeBase* node, ListNodeBase* next) - { - node->next = next; - node->prev = next->prev; - next->prev = node; - node->prev->next = node; - } - inline void node_unlink(ListNodeBase* node) - { - node->prev->next = node->next; - node->next->prev = node->prev; - } - - template - struct ListNode : public ListNodeBase - { - Value value; - - ListNode(const Value& value) : value(value) - { - } - ListNode* getNext() const - { - return static_cast(next); - } - ListNode* getPrev() const - { - return static_cast(prev); - } - }; - - template - class NonConstTraits - { - public: - typedef Type value_type; - typedef value_type* pointer; - typedef value_type& reference; - - template - struct rebind - { - typedef NonConstTraits other; - }; - }; - - template - class ConstTraits - { - public: - typedef Type value_type; - typedef const value_type* pointer; - typedef const value_type& reference; - - template - struct rebind - { - typedef ConstTraits other; - }; - }; - - template - class ListIterator - { - public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; - typedef difference_type distance_type; - typedef typename Traits::value_type value_type; - typedef typename Traits::pointer pointer; - typedef typename Traits::reference reference; - - private: - typedef ListNode Node; - typedef typename Traits::template rebind::other NodeTraits; - typedef typename NodeTraits::pointer NodePointer; - typedef typename Traits::template rebind< Opaque >::other OpaqueTraits; - typedef typename OpaqueTraits::pointer OpaquePointer; - NodePointer m_node; - - void increment() - { - m_node = m_node->getNext(); - } - void decrement() - { - m_node = m_node->getPrev(); - } - - - public: - explicit ListIterator(NodePointer node) : m_node(node) - { - } - explicit ListIterator(OpaquePointer p) : m_node(reinterpret_cast(p)) - { - } - - NodePointer node() - { - return m_node; - } - OpaquePointer opaque() const - { - return reinterpret_cast(m_node); - } - - bool operator==(const ListIterator& other) const - { - return m_node == other.m_node; - } - bool operator!=(const ListIterator& other) const - { - return !operator==(other); - } - ListIterator& operator++() - { - increment(); - return *this; - } - ListIterator operator++(int) - { - ListIterator tmp = *this; - increment(); - return tmp; - } - ListIterator& operator--() - { - decrement(); - return *this; - } - ListIterator operator--(int) - { - ListIterator tmp = *this; - decrement(); - return tmp; - } - reference operator*() const - { - return m_node->value; - } - pointer operator->() const - { - return &(operator*()); - } - }; -} - -template > -class List : private Allocator -{ - typedef ListDetail::ListNode Node; - ListDetail::ListNodeBase list; - typedef typename Allocator::template rebind::other NodeAllocator; - - Node* newNode(const Value& value) - { - return new (NodeAllocator(*this).allocate(1)) Node(value); - } - void deleteNode(Node* node) - { - node->~Node(); - NodeAllocator(*this).deallocate(node, 1); - } -public: - typedef Value value_type; - typedef ListDetail::ListIterator< ListDetail::NonConstTraits > iterator; - typedef ListDetail::ListIterator< ListDetail::ConstTraits > const_iterator; - - List() - { - list_initialise(list); - } - explicit List(const Allocator& allocator) : Allocator(allocator) - { - list_initialise(list); - } - ~List() - { - for(; list.next != &list;) - { - Node* node = static_cast(list.next); - list.next = list.next->next; - deleteNode(node); - } - } - iterator begin() - { - return iterator(static_cast(list.next)); - } - iterator end() - { - return iterator(static_cast(&list)); - } - const_iterator begin() const - { - return const_iterator(static_cast(list.next)); - } - const_iterator end() const - { - return const_iterator(static_cast(&list)); - } - void push_back(const Value& value) - { - insert(end(), value); - } - void pop_back(const Value& value) - { - erase(--end(), value); - } - void push_front(const Value& value) - { - insert(begin(), value); - } - void pop_front(const Value& value) - { - erase(begin(), value); - } - iterator insert(iterator pos, const Value& value) - { - Node* node = newNode(value); - node_link(node, pos.node()); - return iterator(node); - } - iterator erase(iterator pos) - { - Node* node = pos.node(); - Node* next = node->getNext(); - node_unlink(node); - deleteNode(node); - return iterator(next); - } -}; - -template -class SignalBase -{ - typedef List SignalList; - SignalList events; - -public: - - typedef Functor handler_type; - typedef Handle< Opaque > handler_id_type; - typedef typename SignalList::iterator iterator; - typedef typename SignalList::const_iterator const_iterator; - iterator begin() - { - return events.begin(); - } - iterator end() - { - return events.end(); - } - const_iterator begin() const - { - return events.begin(); - } - const_iterator end() const - { - return events.end(); - } - handler_id_type connectFirst(const Functor& event) - { - events.push_front(event); - return handler_id_type(begin().opaque()); - } - handler_id_type connectLast(const Functor& event) - { - events.push_back(event); - return handler_id_type((--end()).opaque()); - } - bool isConnected(handler_id_type id) - { - for(iterator i = begin(); i != end(); ++i) - { - if(id.get() == i.opaque()) - { - return true; - } - } - return false; - } - handler_id_type connectBefore(handler_id_type id, const Functor& event) - { - ASSERT_MESSAGE(isConnected(id), "SignalBase::connectBefore: invalid id"); - return events.insert(iterator(id.get()), event).opaque(); - } - handler_id_type connectAfter(handler_id_type id, const Functor& event) - { - ASSERT_MESSAGE(isConnected(id), "SignalBase::connectAfter: invalid id"); - return events.insert(++iterator(id.get()), event).opaque(); - } - void disconnect(handler_id_type id) - { - ASSERT_MESSAGE(isConnected(id), "SignalBase::disconnect: invalid id"); - events.erase(iterator(id.get())); - } -}; - -///\brief -// It is safe to disconnect the signal handler currently being invoked. -template -inline void invokeSignalHandlers(InputIterator first, InputIterator last, SignalHandlerInvoke invoke) -{ - while(first != last && invoke(*first++) != SIGNAL_STOP_EMISSION); -} - -class Signal0 : public SignalBase -{ -public: - void operator()() const - { - invokeSignalHandlers(begin(), end(), FunctorInvoke()); - } -}; - -template -class Signal1 : public SignalBase< SignalHandler1 > -{ - typedef SignalBase< SignalHandler1 > Base; -public: - void operator()(FirstArgument a1) const - { - invokeSignalHandlers(Base::begin(), Base::end(), Functor1Invoke(a1)); - } -}; - -template -class Signal2 : public SignalBase< SignalHandler2 > -{ - typedef SignalBase< SignalHandler2 > Base; -public: - void operator()(FirstArgument a1, SecondArgument a2) const - { - invokeSignalHandlers(Base::begin(), Base::end(), Functor2Invoke(a1, a2)); - } -}; - -template -class Signal3 : public SignalBase< SignalHandler3 > -{ - typedef SignalBase< SignalHandler3 > Base; -public: - void operator()(FirstArgument a1, SecondArgument a2, ThirdArgument a3) const - { - invokeSignalHandlers(Base::begin(), Base::end(), Functor3Invoke(a1, a2, a3)); - } -}; - -#endif diff --git a/libs/signal/signalfwd.cpp b/libs/signal/signalfwd.cpp deleted file mode 100644 index c274b06c..00000000 --- a/libs/signal/signalfwd.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "signalfwd.h" - diff --git a/libs/signal/signalfwd.h b/libs/signal/signalfwd.h deleted file mode 100644 index 79597e21..00000000 --- a/libs/signal/signalfwd.h +++ /dev/null @@ -1,48 +0,0 @@ - -#if !defined(INCLUDED_SIGNALFWD_H) -#define INCLUDED_SIGNALFWD_H - -class SignalHandler; -template -class SignalHandler1; -template -class SignalHandler2; -template -class SignalHandler3; - -template -class Opaque; - -///\brief A pointer that always has a well-defined value. -/// If no value is specified, the appropriate null value is used. -template -class Handle -{ - Type* p; -public: - Handle() : p(0) - { - } - explicit Handle(Type* p) : p(p) - { - } - Type* get() const - { - return p; - } - bool isNull() const - { - return p == 0; - } -}; - -template -class SignalFwd -{ -public: - typedef Handle< Opaque > handler_id_type; -}; - -typedef SignalFwd::handler_id_type SignalHandlerId; - -#endif diff --git a/libs/splines/Splines.vcproj b/libs/splines/Splines.vcproj index 2cb43323..d3589168 100644 --- a/libs/splines/Splines.vcproj +++ b/libs/splines/Splines.vcproj @@ -1,163 +1,85 @@ - - + - + + + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/libs/splines/math_angles.cpp b/libs/splines/math_angles.cpp index e19dc0fb..153f5436 100644 --- a/libs/splines/math_angles.cpp +++ b/libs/splines/math_angles.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_angles.h b/libs/splines/math_angles.h index 43e1cbb9..b095fae3 100644 --- a/libs/splines/math_angles.h +++ b/libs/splines/math_angles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_matrix.cpp b/libs/splines/math_matrix.cpp index bca25f83..f725fcf1 100644 --- a/libs/splines/math_matrix.cpp +++ b/libs/splines/math_matrix.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_matrix.h b/libs/splines/math_matrix.h index d189cf1a..a039945c 100644 --- a/libs/splines/math_matrix.h +++ b/libs/splines/math_matrix.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_quaternion.cpp b/libs/splines/math_quaternion.cpp index 71aea55e..5eab53b8 100644 --- a/libs/splines/math_quaternion.cpp +++ b/libs/splines/math_quaternion.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_quaternion.h b/libs/splines/math_quaternion.h index b7445953..1d2e2907 100644 --- a/libs/splines/math_quaternion.h +++ b/libs/splines/math_quaternion.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_vector.cpp b/libs/splines/math_vector.cpp index cc789fbb..dfbcfc6b 100644 --- a/libs/splines/math_vector.cpp +++ b/libs/splines/math_vector.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/math_vector.h b/libs/splines/math_vector.h index faea5eb9..60e86a5f 100644 --- a/libs/splines/math_vector.h +++ b/libs/splines/math_vector.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef __MATH_VECTOR_H__ #define __MATH_VECTOR_H__ -#ifdef WIN32 +#ifdef _WIN32 #pragma warning(disable : 4244) #endif diff --git a/libs/splines/q_parse.cpp b/libs/splines/q_parse.cpp index ae301309..17fd12ed 100644 --- a/libs/splines/q_parse.cpp +++ b/libs/splines/q_parse.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/q_shared.cpp b/libs/splines/q_shared.cpp index 56832efe..57a899b9 100644 --- a/libs/splines/q_shared.cpp +++ b/libs/splines/q_shared.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/q_shared.h b/libs/splines/q_shared.h index 74fd0d52..60261cb4 100644 --- a/libs/splines/q_shared.h +++ b/libs/splines/q_shared.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -65,7 +65,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include -#ifdef WIN32 // mac doesn't have malloc.h +#ifdef _WIN32 // mac doesn't have malloc.h #include // for _alloca() #endif #ifdef _WIN32 @@ -88,7 +88,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //======================= WIN32 DEFINES ================================= -#ifdef WIN32 +#ifdef _WIN32 #define MAC_STATIC diff --git a/libs/splines/splines.cpp b/libs/splines/splines.cpp index 43548ca2..885dbc10 100644 --- a/libs/splines/splines.cpp +++ b/libs/splines/splines.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -93,17 +93,17 @@ idCameraDef *g_splineList = &splineList; idVec3 idSplineList::zero(0,0,0); void glLabeledPoint(idVec3 &color, idVec3 &point, float size, const char *label) { - glColor3fv(color); - glPointSize(size); - glBegin(GL_POINTS); - glVertex3fv(point); - glEnd(); + qglColor3fv(color); + qglPointSize(size); + qglBegin(GL_POINTS); + qglVertex3fv(point); + qglEnd(); idVec3 v = point; v.x += 1; v.y += 1; v.z += 1; - glRasterPos3fv (v); - glCallLists (strlen(label), GL_UNSIGNED_BYTE, label); + qglRasterPos3fv (v); + qglCallLists (strlen(label), GL_UNSIGNED_BYTE, label); } @@ -116,30 +116,30 @@ void glBox(idVec3 &color, idVec3 &point, float size) { maxs[0] += size; maxs[1] -= size; maxs[2] += size; - glColor3fv(color); - glBegin(GL_LINE_LOOP); - glVertex3f(mins[0],mins[1],mins[2]); - glVertex3f(maxs[0],mins[1],mins[2]); - glVertex3f(maxs[0],maxs[1],mins[2]); - glVertex3f(mins[0],maxs[1],mins[2]); - glEnd(); - glBegin(GL_LINE_LOOP); - glVertex3f(mins[0],mins[1],maxs[2]); - glVertex3f(maxs[0],mins[1],maxs[2]); - glVertex3f(maxs[0],maxs[1],maxs[2]); - glVertex3f(mins[0],maxs[1],maxs[2]); - glEnd(); + qglColor3fv(color); + qglBegin(GL_LINE_LOOP); + qglVertex3f(mins[0],mins[1],mins[2]); + qglVertex3f(maxs[0],mins[1],mins[2]); + qglVertex3f(maxs[0],maxs[1],mins[2]); + qglVertex3f(mins[0],maxs[1],mins[2]); + qglEnd(); + qglBegin(GL_LINE_LOOP); + qglVertex3f(mins[0],mins[1],maxs[2]); + qglVertex3f(maxs[0],mins[1],maxs[2]); + qglVertex3f(maxs[0],maxs[1],maxs[2]); + qglVertex3f(mins[0],maxs[1],maxs[2]); + qglEnd(); - glBegin(GL_LINES); - glVertex3f(mins[0],mins[1],mins[2]); - glVertex3f(mins[0],mins[1],maxs[2]); - glVertex3f(mins[0],maxs[1],maxs[2]); - glVertex3f(mins[0],maxs[1],mins[2]); - glVertex3f(maxs[0],mins[1],mins[2]); - glVertex3f(maxs[0],mins[1],maxs[2]); - glVertex3f(maxs[0],maxs[1],maxs[2]); - glVertex3f(maxs[0],maxs[1],mins[2]); - glEnd(); + qglBegin(GL_LINES); + qglVertex3f(mins[0],mins[1],mins[2]); + qglVertex3f(mins[0],mins[1],maxs[2]); + qglVertex3f(mins[0],maxs[1],maxs[2]); + qglVertex3f(mins[0],maxs[1],mins[2]); + qglVertex3f(maxs[0],mins[1],mins[2]); + qglVertex3f(maxs[0],mins[1],maxs[2]); + qglVertex3f(maxs[0],maxs[1],maxs[2]); + qglVertex3f(maxs[0],maxs[1],mins[2]); + qglEnd(); } @@ -252,14 +252,14 @@ void idSplineList::draw(bool editMode) { } - glColor3fv(controlColor); - glPointSize(5); + qglColor3fv(controlColor); + qglPointSize(5); - glBegin(GL_POINTS); + qglBegin(GL_POINTS); for (i = 0; i < controlPoints.Num(); i++) { - glVertex3fv(*controlPoints[i]); + qglVertex3fv(*controlPoints[i]); } - glEnd(); + qglEnd(); if (editMode) { for(i = 0; i < controlPoints.Num(); i++) { @@ -268,22 +268,22 @@ void idSplineList::draw(bool editMode) { } //Draw the curve - glColor3fv(pathColor); - glBegin(GL_LINE_STRIP); + qglColor3fv(pathColor); + qglBegin(GL_LINE_STRIP); int count = splinePoints.Num(); for (i = 0; i < count; i++) { - glVertex3fv(*splinePoints[i]); + qglVertex3fv(*splinePoints[i]); } - glEnd(); + qglEnd(); if (editMode) { - glColor3fv(segmentColor); - glPointSize(3); - glBegin(GL_POINTS); + qglColor3fv(segmentColor); + qglPointSize(3); + qglBegin(GL_POINTS); for (i = 0; i < count; i++) { - glVertex3fv(*splinePoints[i]); + qglVertex3fv(*splinePoints[i]); } - glEnd(); + qglEnd(); } if (count > 0) { //assert(activeSegment >=0 && activeSegment < count); diff --git a/libs/splines/splines.h b/libs/splines/splines.h index e442d8bb..54808492 100644 --- a/libs/splines/splines.h +++ b/libs/splines/splines.h @@ -1,31 +1,13 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #ifndef __SPLINES_H #define __SPLINES_H #define GTKRADIANT +#ifndef CAMERA_PLUGIN #ifdef GTKRADIANT -#include "igl.h" +#include "misc_def.h" +#include "igl_to_qgl.h" +#endif #endif #include "util_list.h" @@ -602,10 +584,10 @@ public: virtual void draw(bool editMode) { glLabeledPoint(blue, startPos, (editMode) ? 5 : 3, "Start interpolated"); glLabeledPoint(blue, endPos, (editMode) ? 5 : 3, "End interpolated"); - glBegin(GL_LINES); - glVertex3fv(startPos); - glVertex3fv(endPos); - glEnd(); + qglBegin(GL_LINES); + qglVertex3fv(startPos); + qglVertex3fv(endPos); + qglEnd(); } virtual void start(long t) { diff --git a/libs/splines/util_list.h b/libs/splines/util_list.h index 3fccb37f..7776e87c 100644 --- a/libs/splines/util_list.h +++ b/libs/splines/util_list.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/util_str.cpp b/libs/splines/util_str.cpp index 21036628..ecacc766 100644 --- a/libs/splines/util_str.cpp +++ b/libs/splines/util_str.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/splines/util_str.h b/libs/splines/util_str.h index f66bb667..0ce1ecb4 100644 --- a/libs/splines/util_str.h +++ b/libs/splines/util_str.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/libs/str.h b/libs/str.h index eacac3d6..bf0cd589 100644 --- a/libs/str.h +++ b/libs/str.h @@ -38,19 +38,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - -#include #include -#include - -#ifdef WIN32 -#define strcasecmp strcmpi -#if _MSC_VER < 1400 -#define vsnprintf std::vsnprintf +#ifdef __APPLE__ + #ifdef NULL + #undef NULL + #define NULL 0 + #endif #endif -#else -#include + + +#ifdef _WIN32 +#define strcasecmp strcmpi #endif // NOTE TTimo __StrDup was initially implemented in pakstuff.cpp @@ -59,15 +58,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define __StrDup Q_StrDup -inline char* Q_StrDup(const char* pStr) -{ - if (pStr == 0) - pStr = ""; +inline char* Q_StrDup( char* _pStr ) { + const char* pStr = _pStr; + if ( pStr == NULL ) { + pStr = ""; + } - return strcpy(new char[strlen(pStr)+1], pStr); + return strcpy( new char[ strlen( pStr ) + 1 ], pStr ); } -#if !defined(WIN32) +inline char* Q_StrDup( const char* pStr ) { + if ( pStr == NULL ) { + pStr = ""; + } + + return strcpy( new char[strlen(pStr)+1], pStr ); +} + +#if defined (__linux__) || defined (__APPLE__) #define strcmpi strcasecmp #define stricmp strcasecmp #define strnicmp strncasecmp @@ -97,7 +105,7 @@ inline char* strupr(char* string) } #endif -static char *g_pStrWork = 0; +static char *g_pStrWork = NULL; class Str { @@ -128,7 +136,7 @@ public: Str(const unsigned char *p) { m_bIgnoreCase = true; - m_pStr = __StrDup(reinterpret_cast(p)); + m_pStr = __StrDup((const char *)p); } Str(const char c) @@ -144,11 +152,6 @@ public: return m_pStr; } - char* GetBuffer() - { - return m_pStr; - } - Str(const Str &s) { m_bIgnoreCase = true; @@ -158,10 +161,10 @@ public: void Deallocate() { delete []m_pStr; - m_pStr = 0; + m_pStr = NULL; } - void Allocate(std::size_t n) + void Allocate(int n) { Deallocate(); m_pStr = new char[n]; @@ -173,13 +176,13 @@ public: m_pStr = __StrDup(""); } - ~Str() + virtual ~Str() { Deallocate(); // NOTE TTimo: someone explain this g_pStrWork to me? if (g_pStrWork) delete []g_pStrWork; - g_pStrWork = 0; + g_pStrWork = NULL; } void MakeLower() @@ -201,20 +204,20 @@ public: void TrimRight() { char* lpsz = m_pStr; - char* lpszLast = 0; + char* lpszLast = NULL; while (*lpsz != '\0') { if (isspace(*lpsz)) { - if (lpszLast == 0) + if (lpszLast == NULL) lpszLast = lpsz; } else - lpszLast = 0; + lpszLast = NULL; lpsz++; } - if (lpszLast != 0) + if (lpszLast != NULL) { // truncate at trailing space start *lpszLast = '\0'; @@ -229,29 +232,33 @@ public: lpsz++; // fix up data and length - std::size_t nDataLength = GetLength() - (lpsz - m_pStr); + int nDataLength = GetLength() - (lpsz - m_pStr); memmove(m_pStr, lpsz, (nDataLength+1)); } - char* Find(const char *p) + int Find(const char *p) { - return strstr(m_pStr, p); + char *pf = strstr(m_pStr, p); + return (pf) ? (pf - m_pStr) : -1; } // search starting at a given offset - char* Find(const char *p, std::size_t offset) + int Find(const char *p, int offset) { - return strstr(m_pStr+offset, p); + char *pf = strstr(m_pStr+offset, p); + return (pf) ? (pf - m_pStr) : -1; } - char* Find(const char ch) + int Find(const char ch) { - return strchr (m_pStr, ch); + char *pf = strchr (m_pStr, ch); + return (pf) ? (pf - m_pStr) : -1; } - char* ReverseFind(const char ch) + int ReverseFind(const char ch) { - return strrchr(m_pStr, ch); + char *pf = strrchr(m_pStr, ch); + return (pf) ? (pf - m_pStr) : -1; } int Compare (const char* str) const @@ -264,12 +271,12 @@ public: return strcasecmp (m_pStr, str); } - std::size_t GetLength() + int GetLength() { return (m_pStr) ? strlen(m_pStr) : 0; } - const char* Left(std::size_t n) + const char* Left(int n) { delete []g_pStrWork; if (n > 0) @@ -280,20 +287,19 @@ public: } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; } return g_pStrWork; } - const char* Right(std::size_t n) + const char* Right(int n) { delete []g_pStrWork; if (n > 0) { g_pStrWork = new char[n+1]; - std::size_t nStart = GetLength() - n; + int nStart = GetLength() - n; strncpy(g_pStrWork, &m_pStr[nStart], n); g_pStrWork[n] = '\0'; } @@ -305,12 +311,12 @@ public: return g_pStrWork; } - const char* Mid(std::size_t nFirst) const - { - return Mid(nFirst, strlen (m_pStr) - nFirst); - } + const char* Mid(int nFirst) const + { + return Mid(nFirst, strlen (m_pStr) - nFirst); + } - const char* Mid(std::size_t first, std::size_t n) const + const char* Mid(int first, int n) const { delete []g_pStrWork; if (n > 0) @@ -321,14 +327,13 @@ public: } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; } return g_pStrWork; } -#if 0 // defined(__G_LIB_H__) +#ifdef __G_LIB_H__ void Format(const char* fmt, ...) { va_list args; @@ -345,41 +350,38 @@ public: #else void Format(const char* fmt, ...) { - char buffer[1024]; + va_list args; + m_pStr = new char[1024]; - { - va_list args; - va_start (args, fmt); - vsnprintf(buffer, 1023, fmt, args); - va_end (args); - } - - delete[] m_pStr; - m_pStr = __StrDup(buffer); + va_start (args, fmt); + vsprintf (m_pStr, fmt, args); + va_end (args); } #endif - void SetAt(std::size_t n, char ch) + void SetAt(int n, char ch) { - if (n < GetLength()) + if (n >= 0 && n < GetLength ()) m_pStr[n] = ch; } // NOTE: unlike CString, this looses the pointer - void ReleaseBuffer(std::size_t n) + void ReleaseBuffer(int n = -1) { + if (n == -1) + n = GetLength (); + char* tmp = m_pStr; tmp[n] = '\0'; m_pStr = __StrDup(tmp); delete []tmp; } - void ReleaseBuffer() - { - ReleaseBuffer(GetLength()); - } - char* GetBufferSetLength(std::size_t n) + char* GetBufferSetLength(int n) { + if (n < 0) + n = 0; + char *p = new char[n+1]; strncpy (p, m_pStr, n); p[n] = '\0'; @@ -392,9 +394,9 @@ public: // char& operator *() const { return *const_cast(this)->m_pStr; } operator void*() { return m_pStr; } operator char*() { return m_pStr; } - operator const char*() const{ return reinterpret_cast(m_pStr); } + operator const char*(){ return reinterpret_cast(m_pStr); } operator unsigned char*() { return reinterpret_cast(m_pStr); } - operator const unsigned char*() const { return reinterpret_cast(m_pStr); } + operator const unsigned char*() { return reinterpret_cast(m_pStr); } Str& operator =(const Str& rhs) { if (&rhs != this) @@ -417,7 +419,7 @@ public: Str& operator +=(const char ch) { - std::size_t len = GetLength(); + int len = GetLength (); char *p = new char[len + 1 + 1]; if (m_pStr) @@ -466,48 +468,11 @@ public: bool operator >(const Str& rhs) const { return (m_bIgnoreCase) ? stricmp(m_pStr, rhs.m_pStr) > 0 : strcmp(m_pStr, rhs.m_pStr) > 0; } bool operator >(char* pStr) const { return (m_bIgnoreCase) ? stricmp(m_pStr, pStr) > 0 : strcmp(m_pStr, pStr) > 0; } bool operator >(const char* pStr) const { return (m_bIgnoreCase) ? stricmp(m_pStr, pStr) > 0 : strcmp(m_pStr, pStr) > 0; } - char& operator [](std::size_t nIndex) { return m_pStr[nIndex]; } - const char& operator [](std::size_t nIndex) const { return m_pStr[nIndex]; } - const char GetAt (std::size_t nIndex) { return m_pStr[nIndex]; } + char& operator [](int nIndex) { return m_pStr[nIndex]; } + char& operator [](int nIndex) const { return m_pStr[nIndex]; } + const char GetAt (int nIndex) { return m_pStr[nIndex]; } }; -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Str& str) -{ - return ostream << str.GetBuffer(); -} - - -inline void AddSlash(Str& strPath) -{ - if (strPath.GetLength() > 0) - { - if ((strPath.GetAt(strPath.GetLength()-1) != '/') && - (strPath.GetAt(strPath.GetLength()-1) != '\\')) - strPath += '/'; - } -} - -inline bool ExtractPath_and_Filename(const char* pPath, Str& strPath, Str& strFilename) -{ - Str strPathName; - strPathName = pPath; - const char* substr = strPathName.ReverseFind('\\'); - if (substr == 0) - // TTimo: try forward slash, some are using forward - substr = strPathName.ReverseFind('/'); - if (substr != 0) - { - std::size_t nSlash = substr - strPathName.GetBuffer(); - strPath = strPathName.Left(nSlash+1); - strFilename = strPathName.Right(strPathName.GetLength() - nSlash - 1); - } - else - strFilename = pPath; - return true; -} - - #endif diff --git a/libs/stream/filestream.cpp b/libs/stream/filestream.cpp deleted file mode 100644 index 0a1c7f98..00000000 --- a/libs/stream/filestream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "filestream.h" diff --git a/libs/stream/filestream.h b/libs/stream/filestream.h deleted file mode 100644 index ee4c4561..00000000 --- a/libs/stream/filestream.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STREAM_FILESTREAM_H) -#define INCLUDED_STREAM_FILESTREAM_H - -#include "idatastream.h" -#include -#include - -namespace FileStreamDetail -{ - inline int whence_for_seekdir(SeekableStream::seekdir direction) - { - switch(direction) - { - case SeekableStream::cur: - return SEEK_CUR; - case SeekableStream::end: - return SEEK_END; - default: - break; - } - return SEEK_SET; - } -} - - -/// \brief A wrapper around a file input stream opened for reading in binary mode. Similar to std::ifstream. -/// -/// - Maintains a valid file handle associated with a name passed to the constructor. -/// - Implements SeekableInputStream. -class FileInputStream : public SeekableInputStream -{ - std::FILE* m_file; -public: - FileInputStream(const char* name) - { - m_file = name[0] == '\0' ? 0 : fopen(name, "rb"); - } - ~FileInputStream() - { - if(!failed()) - fclose(m_file); - } - - bool failed() const - { - return m_file == 0; - } - - size_type read(byte_type* buffer, size_type length) - { - return fread(buffer, 1, length, m_file); - } - - size_type seek(size_type position) - { - return fseek(m_file, static_cast(position), SEEK_SET); - } - size_type seek(offset_type offset, seekdir direction) - { - return fseek(m_file, offset, FileStreamDetail::whence_for_seekdir(direction)); - } - size_type tell() const - { - return ftell(m_file); - } - - std::FILE* file() - { - return m_file; - } -}; - -/// \brief A wrapper around a FileInputStream limiting access. -/// -/// - Maintains an input stream. -/// - Provides input starting at an offset in the file for a limited range. -class SubFileInputStream : public InputStream -{ - FileInputStream& m_istream; - size_type m_remaining; -public: - typedef FileInputStream::position_type position_type; - - SubFileInputStream(FileInputStream& istream, position_type offset, size_type size) - : m_istream(istream), m_remaining(size) - { - m_istream.seek(offset); - } - - size_type read(byte_type* buffer, size_type length) - { - size_type result = m_istream.read(buffer, std::min(length, m_remaining)); - m_remaining -= result; - return result; - } -}; - - -/// \brief A wrapper around a stdc file stream opened for writing in binary mode. Similar to std::ofstream.. -/// -/// - Maintains a valid file handle associated with a name passed to the constructor. -/// - Implements SeekableInputStream. -class FileOutputStream : public SeekableOutputStream -{ - std::FILE* m_file; -public: - FileOutputStream(const char* name) - { - m_file = name[0] == '\0' ? 0 : fopen(name, "wb"); - } - ~FileOutputStream() - { - if(!failed()) - fclose(m_file); - } - - bool failed() const - { - return m_file == 0; - } - - size_type write(const byte_type* buffer, size_type length) - { - return fwrite(buffer, 1, length, m_file); - } - - size_type seek(size_type position) - { - return fseek(m_file, static_cast(position), SEEK_SET); - } - size_type seek(offset_type offset, seekdir direction) - { - return fseek(m_file, offset, FileStreamDetail::whence_for_seekdir(direction)); - } - size_type tell() const - { - return ftell(m_file); - } -}; - -inline bool file_copy(const char* source, const char* target) -{ - const std::size_t buffer_size = 1024; - unsigned char buffer[buffer_size]; - - FileInputStream sourceFile(source); - if(sourceFile.failed()) - { - return false; - } - FileOutputStream targetFile(target); - if(targetFile.failed()) - { - return false; - } - - for(;;) - { - std::size_t size = sourceFile.read(buffer, buffer_size); - if(size == 0) - { - break; - } - if(targetFile.write(buffer, size) != size) - { - return false; - } - } - return true; -} - - -#endif diff --git a/libs/stream/memstream.cpp b/libs/stream/memstream.cpp deleted file mode 100644 index fd14c70e..00000000 --- a/libs/stream/memstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "memstream.h" diff --git a/libs/stream/memstream.h b/libs/stream/memstream.h deleted file mode 100644 index 3719eef8..00000000 --- a/libs/stream/memstream.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STREAM_MEMSTREAM_H) -#define INCLUDED_STREAM_MEMSTREAM_H - -#include "itextstream.h" -#include -#include - -class BufferOutputStream : public TextOutputStream -{ - std::vector m_buffer; -public: - std::size_t write(const char* buffer, std::size_t length) - { - m_buffer.insert(m_buffer.end(), buffer, buffer+length); - return length; - } - const char* data() const - { - return &(*m_buffer.begin()); - } - std::size_t size() const - { - return m_buffer.size(); - } - void clear() - { - std::vector empty; - std::swap(empty, m_buffer); - } -}; - -template -inline BufferOutputStream& operator<<(BufferOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -class BufferInputStream : public TextInputStream -{ - const char* m_read; - const char* m_end; -public: - BufferInputStream(const char* buffer, std::size_t length) - : m_read(buffer), m_end(buffer + length) - { - } - std::size_t read(char* buffer, std::size_t length) - { - std::size_t count = std::min(std::size_t(m_end - m_read), length); - const char* end = m_read + count; - while(m_read != end) - { - *buffer++ = *m_read++; - } - return count; - } -}; - -#endif diff --git a/libs/stream/stringstream.cpp b/libs/stream/stringstream.cpp deleted file mode 100644 index ffd56a6f..00000000 --- a/libs/stream/stringstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "stringstream.h" diff --git a/libs/stream/stringstream.h b/libs/stream/stringstream.h deleted file mode 100644 index 5248b3cf..00000000 --- a/libs/stream/stringstream.h +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STREAM_STRINGSTREAM_H) -#define INCLUDED_STREAM_STRINGSTREAM_H - -#include "itextstream.h" -#include "string/string.h" -#include - - -/// \brief A wrapper around a STL vector of char. -/// Maintains a null-terminated array of char. -/// Provides a limited STL-style interface to push and pop characters at the end of the string. -class StringBuffer -{ - std::vector m_string; -public: - StringBuffer() - { - m_string.push_back('\0'); - } - explicit StringBuffer(std::size_t capacity) - { - m_string.reserve(capacity); - m_string.push_back('\0'); - } - explicit StringBuffer(const char* string) : m_string(string, string + string_length(string) + 1) - { - } - - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; - - iterator begin() - { - return m_string.begin(); - } - const_iterator begin() const - { - return m_string.begin(); - } - iterator end() - { - return m_string.end() - 1; - } - const_iterator end() const - { - return m_string.end() - 1; - } - - void push_back(char c) - { - m_string.insert(end(), c); - } - void pop_back() - { - m_string.erase(end() - 1); - } - void push_range(const char* first, const char* last) - { - m_string.insert(end(), first, last); - } - void push_string(const char* string) - { - push_range(string, string + string_length(string)); - } - char* c_str() - { - return &(*m_string.begin()); - } - const char* c_str() const - { - return &(*m_string.begin()); - } - - char& back() - { - return *(end() - 1); - } - const char& back() const - { - return *(end() - 1); - } - bool empty() const - { - return m_string.size() == 1; - } - void clear() - { - m_string.clear(); - m_string.push_back('\0'); - } -}; - -/// \brief A TextOutputStream which writes to a StringBuffer. -/// Similar to std::stringstream. -class StringOutputStream : public TextOutputStream -{ - StringBuffer m_string; -public: - typedef StringBuffer::iterator iterator; - typedef StringBuffer::const_iterator const_iterator; - - StringOutputStream() - { - } - StringOutputStream(std::size_t capacity) : m_string(capacity) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - m_string.push_range(buffer, buffer + length); - return length; - } - - iterator begin() - { - return m_string.begin(); - } - const_iterator begin() const - { - return m_string.begin(); - } - iterator end() - { - return m_string.end(); - } - const_iterator end() const - { - return m_string.end(); - } - - bool empty() const - { - return m_string.empty(); - } - char* c_str() - { - return m_string.c_str(); - } - const char* c_str() const - { - return m_string.c_str(); - } - void clear() - { - m_string.clear(); - } -}; - -template -inline StringOutputStream& operator<<(StringOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -#endif diff --git a/libs/stream/textfilestream.cpp b/libs/stream/textfilestream.cpp deleted file mode 100644 index f81566cf..00000000 --- a/libs/stream/textfilestream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "textfilestream.h" diff --git a/libs/stream/textfilestream.h b/libs/stream/textfilestream.h deleted file mode 100644 index d31cf1bd..00000000 --- a/libs/stream/textfilestream.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STREAM_TEXTFILESTREAM_H) -#define INCLUDED_STREAM_TEXTFILESTREAM_H - -#include "itextstream.h" -#include - -/// \brief A wrapper around a file input stream opened for reading in text mode. Similar to std::ifstream. -class TextFileInputStream : public TextInputStream -{ - FILE* m_file; -public: - TextFileInputStream(const char* name) - { - m_file = name[0] == '\0' ? 0 : fopen(name, "rt"); - } - ~TextFileInputStream() - { - if(!failed()) - fclose(m_file); - } - - bool failed() const - { - return m_file == 0; - } - - std::size_t read(char* buffer, std::size_t length) - { - return fread(buffer, 1, length, m_file); - } -}; - -/// \brief A wrapper around a file input stream opened for writing in text mode. Similar to std::ofstream. -class TextFileOutputStream : public TextOutputStream -{ - FILE* m_file; -public: - TextFileOutputStream(const char* name) - { - m_file = name[0] == '\0' ? 0 : fopen(name, "wt"); - } - ~TextFileOutputStream() - { - if(!failed()) - fclose(m_file); - } - - bool failed() const - { - return m_file == 0; - } - - std::size_t write(const char* buffer, std::size_t length) - { - return fwrite(buffer, 1, length, m_file); - } -}; - -template -inline TextFileOutputStream& operator<<(TextFileOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -#endif diff --git a/libs/stream/textstream.cpp b/libs/stream/textstream.cpp deleted file mode 100644 index b3a64625..00000000 --- a/libs/stream/textstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "textstream.h" diff --git a/libs/stream/textstream.h b/libs/stream/textstream.h deleted file mode 100644 index fff8a457..00000000 --- a/libs/stream/textstream.h +++ /dev/null @@ -1,533 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STREAM_TEXTSTREAM_H) -#define INCLUDED_STREAM_TEXTSTREAM_H - -/// \file -/// \brief Text-output-formatting. - -#include "itextstream.h" - -#include -#include -#include -#include -#include -#include - -#include "generic/arrayrange.h" - -namespace TextOutputDetail -{ - inline char* write_unsigned_nonzero_decimal_backward(char* ptr, unsigned int decimal) - { - for (; decimal != 0; decimal /= 10) - { - *--ptr = char('0' + int(decimal % 10)); - } - return ptr; - } - - #if defined (_WIN64) || defined (__LP64__) - inline char* write_size_t_nonzero_decimal_backward(char* ptr, size_t decimal) - { - for (; decimal != 0; decimal /= 10) - { - *--ptr = char('0' + (size_t)(decimal % 10)); - } - return ptr; - } - #endif - - inline char* write_signed_nonzero_decimal_backward(char* ptr, int decimal, bool show_positive) - { - const bool negative = decimal < 0 ; - ptr = write_unsigned_nonzero_decimal_backward(ptr, negative ? -decimal : decimal); - if(negative) - { - *--ptr = '-'; - } - else if(show_positive) - { - *--ptr = '+'; - } - return ptr; - } - - inline char* write_unsigned_nonzero_decimal_backward(char* ptr, unsigned int decimal, bool show_positive) - { - ptr = write_unsigned_nonzero_decimal_backward(ptr, decimal); - if(show_positive) - { - *--ptr = '+'; - } - return ptr; - } - - #if defined (_WIN64) || defined (__LP64__) - inline char* write_size_t_nonzero_decimal_backward(char* ptr, size_t decimal, bool show_positive) - { - ptr = write_size_t_nonzero_decimal_backward(ptr, decimal); - if(show_positive) - { - *--ptr = '+'; - } - return ptr; - } - #endif - - inline char* write_signed_decimal_backward(char* ptr, int decimal, bool show_positive) - { - if(decimal == 0) - { - *--ptr = '0'; - } - else - { - ptr = write_signed_nonzero_decimal_backward(ptr, decimal, show_positive); - } - return ptr; - } - - inline char* write_unsigned_decimal_backward(char* ptr, unsigned int decimal, bool show_positive) - { - if(decimal == 0) - { - *--ptr = '0'; - } - else - { - ptr = write_unsigned_nonzero_decimal_backward(ptr, decimal, show_positive); - } - return ptr; - } - - #if defined (_WIN64) || defined (__LP64__) - inline char* write_size_t_decimal_backward(char* ptr, size_t decimal, bool show_positive) - { - if(decimal == 0) - { - *--ptr = '0'; - } - else - { - ptr = write_size_t_nonzero_decimal_backward(ptr, decimal, show_positive); - } - return ptr; - } - #endif -} - - -#ifdef WIN32 -#define snprintf _snprintf -#endif - -/// \brief Writes a single character \p c to \p ostream. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, char c) -{ - ostream.write(&c, 1); - return ostream; -} - -/// \brief Writes a double-precision floating point value \p d to \p ostream. -/// The value will be formatted either as decimal with trailing zeros removed, or with scientific 'e' notation, whichever is shorter. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const double d) -{ - const std::size_t bufferSize = 16; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%g", d)); - return ostream; -} - -/// \brief Writes a single-precision floating point value \p f to \p ostream. -/// The value will be formatted either as decimal with trailing zeros removed, or with scientific 'e' notation, whichever is shorter. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const float f) -{ - return ostream_write(ostream, static_cast(f)); -} - -/// \brief Writes a signed integer \p i to \p ostream in decimal form. -/// A '-' sign will be added if the value is negative. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const int i) -{ - const std::size_t bufferSize = 16; -#if 1 - char buf[bufferSize]; - char* begin = TextOutputDetail::write_signed_decimal_backward(buf + bufferSize, i, false); - ostream.write(begin, (buf + bufferSize) - begin); -#else - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%i", i)); -#endif - return ostream; -} - -typedef unsigned int Unsigned; - -/// \brief Writes an unsigned integer \p i to \p ostream in decimal form. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Unsigned i) -{ - const std::size_t bufferSize = 16; -#if 1 - char buf[bufferSize]; - char* begin = TextOutputDetail::write_unsigned_decimal_backward(buf + bufferSize, i, false); - ostream.write(begin, (buf + bufferSize) - begin); -#else - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%u", i)); -#endif - return ostream; -} - -#if defined (_WIN64) || defined (__LP64__) - -/// \brief Writes a size_t \p i to \p ostream in decimal form. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const size_t i) -{ - // max is 18446744073709551615, buffer of 32 chars should always be enough - const std::size_t bufferSize = 32; -#if 1 - char buf[bufferSize]; - char* begin = TextOutputDetail::write_size_t_decimal_backward(buf + bufferSize, i, false); - ostream.write(begin, (buf + bufferSize) - begin); -#else - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%u", i)); -#endif - return ostream; -} - -#endif - -/// \brief Writes a null-terminated \p string to \p ostream. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const char* string) -{ - ostream.write(string, strlen(string)); - return ostream; -} - -class HexChar -{ -public: - char m_value; - HexChar(char value) : m_value(value) - { - } -}; - -/// \brief Writes a single character \p c to \p ostream in hexadecimal form. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const HexChar& c) -{ - const std::size_t bufferSize = 16; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%X", c.m_value & 0xFF)); - return ostream; -} - -template -class LeftJustified -{ -public: - const T& m_t; - std::size_t m_size; - LeftJustified(const T& t, std::size_t size) : m_t(t), m_size(size) - { - } -}; - -template -LeftJustified makeLeftJustified(const T& t, std::size_t size) -{ - return LeftJustified(t, size); -} - -template -class CountingOutputStream -{ - TextOutputStreamType& m_ostream; -public: - std::size_t m_count; - CountingOutputStream(TextOutputStreamType& ostream) : m_ostream(ostream) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - m_count += length; - return m_ostream.write(buffer, length); - } -}; - -template -inline CountingOutputStream& operator<<(CountingOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -/// \brief Writes any type to \p ostream padded with spaces afterwards. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const LeftJustified& justified) -{ - CountingOutputStream count(ostream); - count << justified.m_t; - while(justified.m_size > count.m_count) - { - count << ' '; - } - return ostream; -} - -class FloatFormat -{ -public: - double m_f; - int m_width; - int m_precision; - FloatFormat(double f, int width, int precision) - : m_f(f), m_width(width), m_precision(precision) - { - } -}; - -/// \brief Writes a floating point value to \p ostream with a specific width and precision. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const FloatFormat& formatted) -{ - const std::size_t bufferSize = 32; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%*.*lf", formatted.m_width, formatted.m_precision, formatted.m_f)); - return ostream; -} - -// never displays exponent, prints up to 10 decimal places -class Decimal -{ -public: - double m_f; - Decimal(double f) : m_f(f) - { - } -}; - -/// \brief Writes a floating point value to \p ostream in decimal form with trailing zeros removed. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Decimal& decimal) -{ - const int bufferSize = 22; - char buf[bufferSize]; - std::size_t length = snprintf(buf, bufferSize, "%10.10lf", decimal.m_f); - const char* first = buf; - for(; *first == ' '; ++first) - { - } - const char* last = buf + length - 1; - for(; *last == '0'; --last) - { - } - if(*last == '.') - { - --last; - } - ostream.write(first, last - first + 1); - return ostream; -} - - -/// \brief Writes a \p range of characters to \p ostream. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const StringRange& range) -{ - ostream.write(range.first, range.last - range.first); - return ostream; -} - -template -class Quoted -{ -public: - const Type& m_type; - Quoted(const Type& type) - : m_type(type) - { - } -}; - -template -inline Quoted makeQuoted(const Type& type) -{ - return Quoted(type); -} - -/// \brief Writes any type to \p ostream with a quotation mark character before and after it. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Quoted& quoted) -{ - return ostream << '"' << quoted.m_type << '"'; -} - - -class LowerCase -{ -public: - const char* m_string; - LowerCase(const char* string) : m_string(string) - { - } -}; - -/// \brief Writes a string to \p ostream converted to lower-case. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const LowerCase& lower) -{ - for(const char* p = lower.m_string; *p != '\0'; ++p) - { - ostream << static_cast(std::tolower(*p)); - } - return ostream; -} - - -/// \brief A wrapper for a TextInputStream optimised for reading a single character at a time. -template -class SingleCharacterInputStream -{ - TextInputStreamType& m_inputStream; - char m_buffer[SIZE]; - char* m_cur; - char* m_end; - - bool fillBuffer() - { - m_end = m_buffer + m_inputStream.read(m_buffer, SIZE); - m_cur = m_buffer; - return m_cur != m_end; - } -public: - - SingleCharacterInputStream(TextInputStreamType& inputStream) : m_inputStream(inputStream), m_cur(m_buffer), m_end(m_buffer) - { - } - bool readChar(char& c) - { - if(m_cur == m_end && !fillBuffer()) - { - return false; - } - - c = *m_cur++; - return true; - } -}; - -/// \brief A wrapper for a TextOutputStream, optimised for writing a single character at a time. -class SingleCharacterOutputStream : public TextOutputStream -{ - enum unnamed0 { m_bufsize = 1024 }; - TextOutputStream& m_ostream; - char m_buffer[m_bufsize]; - char* m_pos; - const char* m_end; - - const char* end() const - { - return m_end; - } - void reset() - { - m_pos = m_buffer; - } - void flush() - { - m_ostream.write(m_buffer, m_pos - m_buffer); - reset(); - } -public: - SingleCharacterOutputStream(TextOutputStream& ostream) : m_ostream(ostream), m_pos(m_buffer), m_end(m_buffer+m_bufsize) - { - } - ~SingleCharacterOutputStream() - { - flush(); - } - void write(const char c) - { - if(m_pos == end()) - { - flush(); - } - *m_pos++ = c; - } - std::size_t write(const char* buffer, std::size_t length) - { - const char*const end = buffer + length; - for(const char* p = buffer; p != end; ++p) - { - write(*p); - } - return length; - } -}; - -/// \brief A wrapper for a TextOutputStream, optimised for writing a few characters at a time. -template -class BufferedTextOutputStream : public TextOutputStream -{ - TextOutputStreamType outputStream; - char m_buffer[SIZE]; - char* m_cur; - -public: - BufferedTextOutputStream(TextOutputStreamType& outputStream) : outputStream(outputStream), m_cur(m_buffer) - { - } - ~BufferedTextOutputStream() - { - outputStream.write(m_buffer, m_cur - m_buffer); - } - std::size_t write(const char* buffer, std::size_t length) - { - std::size_t remaining = length; - for(;;) - { - std::size_t n = std::min(remaining, std::size_t((m_buffer + SIZE) - m_cur)); - m_cur = std::copy(buffer, buffer + n, m_cur); - remaining -= n; - if(remaining == 0) - { - return 0; - } - outputStream.write(m_buffer, SIZE); - m_cur = m_buffer; - } - } -}; - -#endif diff --git a/libs/string/pooledstring.cpp b/libs/string/pooledstring.cpp deleted file mode 100644 index 1eb8d514..00000000 --- a/libs/string/pooledstring.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "pooledstring.h" -#include "generic/static.h" - -#if defined(_DEBUG) - -namespace ExamplePooledString -{ - void testStuff() - { - PooledString< LazyStatic > a, b; - a = "monkey"; - b = "monkey"; - a = ""; - } - - struct Always - { - Always() - { - testStuff(); - } - } always; -} - -#endif \ No newline at end of file diff --git a/libs/string/pooledstring.h b/libs/string/pooledstring.h deleted file mode 100644 index 4ff2d61f..00000000 --- a/libs/string/pooledstring.h +++ /dev/null @@ -1,108 +0,0 @@ - -#if !defined(INCLUDED_POOLEDSTRING_H) -#define INCLUDED_POOLEDSTRING_H - -#include -#include "generic/static.h" -#include "string/string.h" -#include "container/hashtable.h" -#include "container/hashfunc.h" - -/// \brief The string pool class. -class StringPool : public HashTable -{ -}; - -inline void StringPool_analyse(StringPool& pool) -{ - typedef std::multimap Ordered; - Ordered ordered; - std::size_t total = 0; - std::size_t pooled = 0; - for(StringPool::iterator i = pool.begin(); i != pool.end(); ++i) - { - std::size_t size = string_length((*i).key) + 1; - total += size * (*i).value; - pooled += size + 20; - ordered.insert(Ordered::value_type((*i).value, (*i).key)); - } - globalOutputStream() << "total: " << Unsigned(total) << " pooled:" << Unsigned(pooled) << "\n"; - for(Ordered::iterator i = ordered.begin(); i != ordered.end(); ++i) - { - globalOutputStream() << (*i).second << " " << Unsigned((*i).first) << "\n"; - } -} - - -/// \brief A string which can be copied with zero memory cost and minimal runtime cost. -/// -/// \param PoolContext The string pool context to use. -template -class PooledString -{ - StringPool::iterator m_i; - static StringPool::iterator increment(StringPool::iterator i) - { - ++(*i).value; - return i; - } - static StringPool::iterator insert(const char* string) - { - StringPool::iterator i = PoolContext::instance().find(const_cast(string)); - if(i == PoolContext::instance().end()) - { - return PoolContext::instance().insert(string_clone(string), 1); - } - return increment(i); - } - static void erase(StringPool::iterator i) - { - if(--(*i).value == 0) - { - char* string = (*i).key; - PoolContext::instance().erase(i); - string_release(string, string_length(string)); - } - } -public: - PooledString() : m_i(insert("")) - { - } - PooledString(const PooledString& other) : m_i(increment(other.m_i)) - { - } - PooledString(const char* string) : m_i(insert(string)) - { - } - ~PooledString() - { - erase(m_i); - } - PooledString& operator=(const PooledString& other) - { - PooledString tmp(other); - tmp.swap(*this); - return *this; - } - PooledString& operator=(const char* string) - { - PooledString tmp(string); - tmp.swap(*this); - return *this; - } - void swap(PooledString& other) - { - std::swap(m_i, other.m_i); - } - bool operator==(const PooledString& other) const - { - return m_i == other.m_i; - } - const char* c_str() const - { - return (*m_i).key; - } -}; - - -#endif diff --git a/libs/string/string.cpp b/libs/string/string.cpp deleted file mode 100644 index b6ad1678..00000000 --- a/libs/string/string.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "string.h" - -void TestString() -{ - CopiedString bleh("bleh"); - SmartString blah("blah"); -} \ No newline at end of file diff --git a/libs/string/string.h b/libs/string/string.h deleted file mode 100644 index c1050f49..00000000 --- a/libs/string/string.h +++ /dev/null @@ -1,610 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STRING_STRING_H) -#define INCLUDED_STRING_STRING_H - -/// \file -/// C-style null-terminated-character-array string library. - -#include -#include -#include - -#include "memory/allocator.h" -#include "generic/arrayrange.h" - -/// \brief Returns true if \p string length is zero. -/// O(1) -inline bool string_empty(const char* string) -{ - return *string == '\0'; -} - -/// \brief Returns true if \p string length is not zero. -/// O(1) -inline bool string_not_empty(const char* string) -{ - return !string_empty(string); -} - -/// \brief Returns <0 if \p string is lexicographically less than \p other. -/// Returns >0 if \p string is lexicographically greater than \p other. -/// Returns 0 if \p string is lexicographically equal to \p other. -/// O(n) -inline int string_compare(const char* string, const char* other) -{ - return std::strcmp(string, other); -} - -/// \brief Returns true if \p string is lexicographically equal to \p other. -/// O(n) -inline bool string_equal(const char* string, const char* other) -{ - return string_compare(string, other) == 0; -} - -/// \brief Returns true if [\p string, \p string + \p n) is lexicographically equal to [\p other, \p other + \p n). -/// O(n) -inline bool string_equal_n(const char* string, const char* other, std::size_t n) -{ - return std::strncmp(string, other, n) == 0; -} - -/// \brief Returns true if \p string is lexicographically less than \p other. -/// O(n) -inline bool string_less(const char* string, const char* other) -{ - return string_compare(string, other) < 0; -} - -/// \brief Returns true if \p string is lexicographically greater than \p other. -/// O(n) -inline bool string_greater(const char* string, const char* other) -{ - return string_compare(string, other) > 0; -} - -/// \brief Returns <0 if \p string is lexicographically less than \p other after converting both to lower-case. -/// Returns >0 if \p string is lexicographically greater than \p other after converting both to lower-case. -/// Returns 0 if \p string is lexicographically equal to \p other after converting both to lower-case. -/// O(n) -inline int string_compare_nocase(const char* string, const char* other) -{ -#ifdef WIN32 - return _stricmp(string, other); -#else - return strcasecmp(string, other); -#endif -} - -/// \brief Returns <0 if [\p string, \p string + \p n) is lexicographically less than [\p other, \p other + \p n). -/// Returns >0 if [\p string, \p string + \p n) is lexicographically greater than [\p other, \p other + \p n). -/// Returns 0 if [\p string, \p string + \p n) is lexicographically equal to [\p other, \p other + \p n). -/// Treats all ascii characters as lower-case during comparisons. -/// O(n) -inline int string_compare_nocase_n(const char* string, const char* other, std::size_t n) -{ -#ifdef WIN32 - return _strnicmp(string, other, n); -#else - return strncasecmp(string, other, n); -#endif -} - -/// \brief Returns true if \p string is lexicographically equal to \p other. -/// Treats all ascii characters as lower-case during comparisons. -/// O(n) -inline bool string_equal_nocase(const char* string, const char* other) -{ - return string_compare_nocase(string, other) == 0; -} - -/// \brief Returns true if [\p string, \p string + \p n) is lexicographically equal to [\p other, \p other + \p n). -/// Treats all ascii characters as lower-case during comparisons. -/// O(n) -inline bool string_equal_nocase_n(const char* string, const char* other, std::size_t n) -{ - return string_compare_nocase_n(string, other, n) == 0; -} - -/// \brief Returns true if \p string is lexicographically less than \p other. -/// Treats all ascii characters as lower-case during comparisons. -/// O(n) -inline bool string_less_nocase(const char* string, const char* other) -{ - return string_compare_nocase(string, other) < 0; -} - -/// \brief Returns true if \p string is lexicographically greater than \p other. -/// Treats all ascii characters as lower-case during comparisons. -/// O(n) -inline bool string_greater_nocase(const char* string, const char* other) -{ - return string_compare_nocase(string, other) > 0; -} - -/// \brief Returns the number of non-null characters in \p string. -/// O(n) -inline std::size_t string_length(const char* string) -{ - return std::strlen(string); -} - -/// \brief Returns true if the beginning of \p string is equal to \p prefix. -/// O(n) -inline bool string_equal_prefix(const char* string, const char* prefix) -{ - return string_equal_n(string, prefix, string_length(prefix)); -} - -/// \brief Copies \p other into \p string and returns \p string. -/// Assumes that the space allocated for \p string is at least string_length(other) + 1. -/// O(n) -inline char* string_copy(char* string, const char* other) -{ - return std::strcpy(string, other); -} - -/// \brief Allocates a string buffer large enough to hold \p length characters, using \p allocator. -/// The returned buffer must be released with \c string_release using a matching \p allocator. -template -inline char* string_new(std::size_t length, Allocator& allocator) -{ - return allocator.allocate(length + 1); -} - -/// \brief Deallocates the \p buffer large enough to hold \p length characters, using \p allocator. -template -inline void string_release(char* buffer, std::size_t length, Allocator& allocator) -{ - allocator.deallocate(buffer, length + 1); -} - -/// \brief Returns a newly-allocated string which is a clone of \p other, using \p allocator. -/// The returned buffer must be released with \c string_release using a matching \p allocator. -template -inline char* string_clone(const char* other, Allocator& allocator) -{ - char* copied = string_new(string_length(other), allocator); - std::strcpy(copied, other); - return copied; -} - -/// \brief Returns a newly-allocated string which is a clone of [\p first, \p last), using \p allocator. -/// The returned buffer must be released with \c string_release using a matching \p allocator. -template -inline char* string_clone_range(StringRange range, Allocator& allocator) -{ - std::size_t length = range.last - range.first; - char* copied = strncpy(string_new(length, allocator), range.first, length); - copied[length] = '\0'; - return copied; -} - -/// \brief Allocates a string buffer large enough to hold \p length characters. -/// The returned buffer must be released with \c string_release. -inline char* string_new(std::size_t length) -{ - DefaultAllocator allocator; - return string_new(length, allocator); -} - -/// \brief Deallocates the \p buffer large enough to hold \p length characters. -inline void string_release(char* string, std::size_t length) -{ - DefaultAllocator allocator; - string_release(string, length, allocator); -} - -/// \brief Returns a newly-allocated string which is a clone of \p other. -/// The returned buffer must be released with \c string_release. -inline char* string_clone(const char* other) -{ - DefaultAllocator allocator; - return string_clone(other, allocator); -} - -/// \brief Returns a newly-allocated string which is a clone of [\p first, \p last). -/// The returned buffer must be released with \c string_release. -inline char* string_clone_range(StringRange range) -{ - DefaultAllocator allocator; - return string_clone_range(range, allocator); -} - -typedef char* char_pointer; -/// \brief Swaps the values of \p string and \p other. -inline void string_swap(char_pointer& string, char_pointer& other) -{ - std::swap(string, other); -} - -typedef const char* char_const_pointer; -/// \brief Swaps the values of \p string and \p other. -inline void string_swap(char_const_pointer& string, char_const_pointer& other) -{ - std::swap(string, other); -} - -/// \brief Converts each character of \p string to lower-case and returns \p string. -/// O(n) -inline char* string_to_lowercase(char* string) -{ - for(char* p = string; *p != '\0'; ++p) - { - *p = (char)std::tolower(*p); - } - return string; -} - -/// \brief Converts each character of \p string to upper-case and returns \p string. -/// O(n) -inline char* string_to_uppercase(char* string) -{ - for(char* p = string; *p != '\0'; ++p) - { - *p = (char)std::toupper(*p); - } - return string; -} - -/// \brief A re-entrant string tokeniser similar to strchr. -class StringTokeniser -{ - bool istoken(char c) const - { - if(strchr(m_delimiters, c) != 0) - { - return false; - } - return true; - } - const char* advance() - { - const char* token = m_pos; - bool intoken = true; - while(!string_empty(m_pos)) - { - if(!istoken(*m_pos)) - { - *m_pos = '\0'; - intoken = false; - } - else if(!intoken) - { - return token; - } - ++m_pos; - } - return token; - } - std::size_t m_length; - char* m_string; - char* m_pos; - const char* m_delimiters; -public: - StringTokeniser(const char* string, const char* delimiters = " \n\r\t\v") : - m_length(string_length(string)), - m_string(string_copy(string_new(m_length), string)), - m_pos(m_string), - m_delimiters(delimiters) - { - while(!string_empty(m_pos) && !istoken(*m_pos)) - { - ++m_pos; - } - } - ~StringTokeniser() - { - string_release(m_string, m_length); - } - /// \brief Returns the next token or "" if there are no more tokens available. - const char* getToken() - { - return advance(); - } -}; - -/// \brief A non-mutable c-style string. -/// -/// \param Buffer The string storage implementation. Must be DefaultConstructible, CopyConstructible and Assignable. Must implement: -/// \li Buffer(const char* string) - constructor which copies a c-style \p string. -/// \li Buffer(const char* first, const char*) - constructor which copies a c-style string range [\p first, \p last). -/// \li void swap(Buffer& other) - swaps contents with \p other. -/// \li const char* c_str() - returns the stored non-mutable c-style string. -template -class String : public Buffer -{ -public: - - String() - : Buffer() - { - } - String(const char* string) - : Buffer(string) - { - } - String(StringRange range) - : Buffer(range) - { - } - - String& operator=(const String& other) - { - String temp(other); - temp.swap(*this); - return *this; - } - String& operator=(const char* string) - { - String temp(string); - temp.swap(*this); - return *this; - } - String& operator=(StringRange range) - { - String temp(range); - temp.swap(*this); - return *this; - } - - void swap(String& other) - { - Buffer::swap(other); - } - - bool empty() const - { - return string_empty(Buffer::c_str()); - } -}; - -template -inline bool operator<(const String& self, const String& other) -{ - return string_less(self.c_str(), other.c_str()); -} - -template -inline bool operator>(const String& self, const String& other) -{ - return string_greater(self.c_str(), other.c_str()); -} - -template -inline bool operator==(const String& self, const String& other) -{ - return string_equal(self.c_str(), other.c_str()); -} - -template -inline bool operator!=(const String& self, const String& other) -{ - return !string_equal(self.c_str(), other.c_str()); -} - -template -inline bool operator==(const String& self, const char* other) -{ - return string_equal(self.c_str(), other); -} - -template -inline bool operator!=(const String& self, const char* other) -{ - return !string_equal(self.c_str(), other); -} - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - template - inline void swap(String& self, String& other) - { - self.swap(other); - } -} - - -/// \brief A non-mutable string buffer which manages memory allocation. -template -class CopiedBuffer : private Allocator -{ - char* m_string; - - char* copy_range(StringRange range) - { - return string_clone_range(range, static_cast(*this)); - } - char* copy(const char* other) - { - return string_clone(other, static_cast(*this)); - } - void destroy(char* string) - { - string_release(string, string_length(string), static_cast(*this)); - } - -protected: - ~CopiedBuffer() - { - destroy(m_string); - } -public: - CopiedBuffer() - : m_string(copy("")) - { - } - explicit CopiedBuffer(const Allocator& allocator) - : Allocator(allocator), m_string(copy("")) - { - } - CopiedBuffer(const CopiedBuffer& other) - : Allocator(other), m_string(copy(other.m_string)) - { - } - CopiedBuffer(const char* string, const Allocator& allocator = Allocator()) - : Allocator(allocator), m_string(copy(string)) - { - } - CopiedBuffer(StringRange range, const Allocator& allocator = Allocator()) - : Allocator(allocator), m_string(copy_range(range)) - { - } - const char* c_str() const - { - return m_string; - } - void swap(CopiedBuffer& other) - { - string_swap(m_string, other.m_string); - } -}; - -/// \brief A non-mutable string which uses copy-by-value for assignment. -typedef String< CopiedBuffer< DefaultAllocator > > CopiedString; - - -/// \brief A non-mutable string buffer which uses reference-counting to avoid unnecessary allocations. -template -class SmartBuffer : private Allocator -{ - char* m_buffer; - - char* copy_range(StringRange range) - { - char* buffer = Allocator::allocate(sizeof(std::size_t) + (range.last - range.first) + 1); - strncpy(buffer + sizeof(std::size_t), range.first, range.last - range.first); - buffer[sizeof(std::size_t) + (range.last - range.first)] = '\0'; - *reinterpret_cast(buffer) = 0; - return buffer; - } - char* copy(const char* string) - { - char* buffer = Allocator::allocate(sizeof(std::size_t) + string_length(string) + 1); - strcpy(buffer + sizeof(std::size_t), string); - *reinterpret_cast(buffer) = 0; - return buffer; - } - void destroy(char* buffer) - { - Allocator::deallocate(buffer, sizeof(std::size_t) + string_length(c_str()) + 1); - } - - void incref(char* buffer) - { - ++(*reinterpret_cast(buffer)); - } - void decref(char* buffer) - { - if(--(*reinterpret_cast(buffer)) == 0) - destroy(buffer); - } - -protected: - ~SmartBuffer() - { - decref(m_buffer); - } -public: - SmartBuffer() - : m_buffer(copy("")) - { - incref(m_buffer); - } - explicit SmartBuffer(const Allocator& allocator) - : Allocator(allocator), m_buffer(copy("")) - { - incref(m_buffer); - } - SmartBuffer(const SmartBuffer& other) - : Allocator(other), m_buffer(other.m_buffer) - { - incref(m_buffer); - } - SmartBuffer(const char* string, const Allocator& allocator = Allocator()) - : Allocator(allocator), m_buffer(copy(string)) - { - incref(m_buffer); - } - SmartBuffer(StringRange range, const Allocator& allocator = Allocator()) - : Allocator(allocator), m_buffer(copy_range(range)) - { - incref(m_buffer); - } - const char* c_str() const - { - return m_buffer + sizeof(std::size_t); - } - void swap(SmartBuffer& other) - { - string_swap(m_buffer, other.m_buffer); - } -}; - -/// \brief A non-mutable string which uses copy-by-reference for assignment of SmartString. -typedef String< SmartBuffer< DefaultAllocator > > SmartString; - -class StringEqualNoCase -{ -public: - bool operator()(const CopiedString& key, const CopiedString& other) const - { - return string_equal_nocase(key.c_str(), other.c_str()); - } -}; - -struct StringLessNoCase -{ - bool operator()(const CopiedString& x, const CopiedString& y) const - { - return string_less_nocase(x.c_str(), y.c_str()); - } -}; - -struct RawStringEqual -{ - bool operator()(const char* x, const char* y) const - { - return string_equal(x, y); - } -}; - -struct RawStringLess -{ - bool operator()(const char* x, const char* y) const - { - return string_less(x, y); - } -}; - -struct RawStringLessNoCase -{ - bool operator()(const char* x, const char* y) const - { - return string_less_nocase(x, y); - } -}; - -#endif diff --git a/libs/string/stringfwd.cpp b/libs/string/stringfwd.cpp deleted file mode 100644 index 90294dc4..00000000 --- a/libs/string/stringfwd.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "stringfwd.h" - diff --git a/libs/string/stringfwd.h b/libs/string/stringfwd.h deleted file mode 100644 index 54e886c3..00000000 --- a/libs/string/stringfwd.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STRING_STRINGFWD_H) -#define INCLUDED_STRING_STRINGFWD_H - -// forward-declaration of CopiedString - -template -class DefaultAllocator; -template -class CopiedBuffer; -template -class String; -typedef String< CopiedBuffer< DefaultAllocator > > CopiedString; - -#endif diff --git a/libs/stringio.cpp b/libs/stringio.cpp deleted file mode 100644 index c5fb61a3..00000000 --- a/libs/stringio.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "stringio.h" diff --git a/libs/stringio.h b/libs/stringio.h deleted file mode 100644 index 8a8bd9b9..00000000 --- a/libs/stringio.h +++ /dev/null @@ -1,553 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_STRINGIO_H) -#define INCLUDED_STRINGIO_H - -#include -#include - -#include "generic/vector.h" -#include "iscriplib.h" -#include "string/string.h" -#include "generic/callback.h" - -inline float string_read_float(const char* string) -{ - return static_cast(atof(string)); -} - -inline int string_read_int(const char* string) -{ - return atoi(string); -} - -inline bool char_is_whitespace(char c) -{ - return c == ' ' || c == '\t'; -} - -inline const char* string_remove_whitespace(const char* string) -{ - for(;;) - { - if(!char_is_whitespace(*string)) - { - break; - } - ++string; - } - return string; -} - -inline const char* string_remove_zeros(const char* string) -{ - for(;;) - { - char c = *string; - if(c != '0') - { - break; - } - ++string; - } - return string; -} - -inline const char* string_remove_sign(const char* string) -{ - if(*string == '-' || *string == '+') // signed zero - acceptable - { - return ++string; - } - return string; -} - -inline bool string_is_unsigned_zero(const char* string) -{ - for(;*string != '\0'; ++string) - { - if(*string != '0') - { - return false; - } - } - return true; -} - -inline bool string_is_signed_zero(const char* string) -{ - return string_is_unsigned_zero(string_remove_sign(string)); -} - -//[whitespaces][+|-][nnnnn][.nnnnn][e|E[+|-]nnnn] -//(where whitespaces are any tab or space character and nnnnn may be any number of digits) -inline bool string_is_float_zero(const char* string) -{ - string = string_remove_whitespace(string); - if(string_empty(string)) - { - return false; - } - - string = string_remove_sign(string); - if(string_empty(string)) - { - // no whole number or fraction part - return false; - } - - // whole-number part - string = string_remove_zeros(string); - if(string_empty(string)) - { - // no fraction or exponent - return true; - } - if(*string == '.') - { - // fraction part - if(*string++ != '0') - { - // invalid fraction - return false; - } - string = string_remove_zeros(++string); - if(string_empty(string)) - { - // no exponent - return true; - } - } - if(*string == 'e' || *string == 'E') - { - // exponent part - string = string_remove_sign(++string); - if(*string++ != '0') - { - // invalid exponent - return false; - } - string = string_remove_zeros(++string); - if(string_empty(string)) - { - // no trailing whitespace - return true; - } - } - string = string_remove_whitespace(string); - return string_empty(string); -} - -inline double buffer_parse_floating_literal(const char*& buffer) -{ - return strtod(buffer, const_cast(&buffer)); -} - -inline int buffer_parse_signed_decimal_integer_literal(const char*& buffer) -{ - return strtol(buffer, const_cast(&buffer), 10); -} - -inline int buffer_parse_unsigned_decimal_integer_literal(const char*& buffer) -{ - return strtoul(buffer, const_cast(&buffer), 10); -} - -// [+|-][nnnnn][.nnnnn][e|E[+|-]nnnnn] -inline bool string_parse_float(const char* string, float& f) -{ - if(string_empty(string)) - { - return false; - } - f = float(buffer_parse_floating_literal(string)); - return string_empty(string); -} - -// format same as float -inline bool string_parse_double(const char* string, double& f) -{ - if(string_empty(string)) - { - return false; - } - f = buffer_parse_floating_literal(string); - return string_empty(string); -} - -// -template -inline bool string_parse_vector3(const char* string, BasicVector3& v) -{ - if(string_empty(string) || *string == ' ') - { - return false; - } - v[0] = float(buffer_parse_floating_literal(string)); - if(*string++ != ' ') - { - return false; - } - v[1] = float(buffer_parse_floating_literal(string)); - if(*string++ != ' ') - { - return false; - } - v[2] = float(buffer_parse_floating_literal(string)); - return string_empty(string); -} - -template -inline bool string_parse_vector(const char* string, Float* first, Float* last) -{ - if(first != last && (string_empty(string) || *string == ' ')) - { - return false; - } - for(;;) - { - *first = float(buffer_parse_floating_literal(string)); - if(++first == last) - { - return string_empty(string); - } - if(*string++ != ' ') - { - return false; - } - } -} - -// decimal signed integer -inline bool string_parse_int(const char* string, int& i) -{ - if(string_empty(string)) - { - return false; - } - i = buffer_parse_signed_decimal_integer_literal(string); - return string_empty(string); -} - -// decimal unsigned integer -inline bool string_parse_size(const char* string, std::size_t& i) -{ - if(string_empty(string)) - { - return false; - } - i = buffer_parse_unsigned_decimal_integer_literal(string); - return string_empty(string); -} - - -#define RETURN_FALSE_IF_FAIL(expression) if(!expression) return false; else - -inline void Tokeniser_unexpectedError(Tokeniser& tokeniser, const char* token, const char* expected) -{ - globalErrorStream() << Unsigned(tokeniser.getLine()) << ":" << Unsigned(tokeniser.getColumn()) << ": parse error at '" << (token != 0 ? token : "#EOF") << "': expected '" << expected << "'\n"; -} - - -inline bool Tokeniser_getFloat(Tokeniser& tokeniser, float& f) -{ - const char* token = tokeniser.getToken(); - if(token != 0 && string_parse_float(token, f)) - { - return true; - } - Tokeniser_unexpectedError(tokeniser, token, "#number"); - return false; -} - -inline bool Tokeniser_getDouble(Tokeniser& tokeniser, double& f) -{ - const char* token = tokeniser.getToken(); - if(token != 0 && string_parse_double(token, f)) - { - return true; - } - Tokeniser_unexpectedError(tokeniser, token, "#number"); - return false; -} - -inline bool Tokeniser_getInteger(Tokeniser& tokeniser, int& i) -{ - const char* token = tokeniser.getToken(); - if(token != 0 && string_parse_int(token, i)) - { - return true; - } - Tokeniser_unexpectedError(tokeniser, token, "#integer"); - return false; -} - -inline bool Tokeniser_getSize(Tokeniser& tokeniser, std::size_t& i) -{ - const char* token = tokeniser.getToken(); - if(token != 0 && string_parse_size(token, i)) - { - return true; - } - Tokeniser_unexpectedError(tokeniser, token, "#unsigned-integer"); - return false; -} - -inline bool Tokeniser_parseToken(Tokeniser& tokeniser, const char* expected) -{ - const char* token = tokeniser.getToken(); - if(token != 0 && string_equal(token, expected)) - { - return true; - } - Tokeniser_unexpectedError(tokeniser, token, expected); - return false; -} - -inline bool Tokeniser_nextTokenIsDigit(Tokeniser& tokeniser) -{ - const char* token = tokeniser.getToken(); - if(token == 0) - { - return false; - } - char c = *token; - tokeniser.ungetToken(); - return std::isdigit(c) != 0; -} - -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& outputStream, const Vector3& v) -{ - return outputStream << '(' << v.x() << ' ' << v.y() << ' ' << v.z() << ')'; -} - - - - -inline void CopiedString_importString(CopiedString& self, const char* string) -{ - self = string; -} -typedef ReferenceCaller1 CopiedStringImportStringCaller; -inline void CopiedString_exportString(const CopiedString& self, const StringImportCallback& importer) -{ - importer(self.c_str()); -} -typedef ConstReferenceCaller1 CopiedStringExportStringCaller; - -inline void Bool_importString(bool& self, const char* string) -{ - self = string_equal(string, "true"); -} -typedef ReferenceCaller1 BoolImportStringCaller; -inline void Bool_exportString(const bool& self, const StringImportCallback& importer) -{ - importer(self ? "true" : "false"); -} -typedef ConstReferenceCaller1 BoolExportStringCaller; - -inline void Int_importString(int& self, const char* string) -{ - if(!string_parse_int(string, self)) - { - self = 0; - } -} -typedef ReferenceCaller1 IntImportStringCaller; -inline void Int_exportString(const int& self, const StringImportCallback& importer) -{ - char buffer[16]; - sprintf(buffer, "%d", self); - importer(buffer); -} -typedef ConstReferenceCaller1 IntExportStringCaller; - -inline void Size_importString(std::size_t& self, const char* string) -{ - int i; - if(string_parse_int(string, i) && i >= 0) - { - self = i; - } - else - { - self = 0; - } -} -typedef ReferenceCaller1 SizeImportStringCaller; -inline void Size_exportString(const std::size_t& self, const StringImportCallback& importer) -{ - char buffer[16]; - sprintf(buffer, "%u", Unsigned(self)); - importer(buffer); -} -typedef ConstReferenceCaller1 SizeExportStringCaller; - -inline void Float_importString(float& self, const char* string) -{ - if(!string_parse_float(string, self)) - { - self = 0; - } -} -typedef ReferenceCaller1 FloatImportStringCaller; -inline void Float_exportString(const float& self, const StringImportCallback& importer) -{ - char buffer[16]; - sprintf(buffer, "%g", self); - importer(buffer); -} -typedef ConstReferenceCaller1 FloatExportStringCaller; - -inline void Vector3_importString(Vector3& self, const char* string) -{ - if(!string_parse_vector3(string, self)) - { - self = Vector3(0, 0, 0); - } -} -typedef ReferenceCaller1 Vector3ImportStringCaller; -inline void Vector3_exportString(const Vector3& self, const StringImportCallback& importer) -{ - char buffer[64]; - sprintf(buffer, "%g %g %g", self[0], self[1], self[2]); - importer(buffer); -} -typedef ConstReferenceCaller1 Vector3ExportStringCaller; - - - -template -class ImportConvert1 -{ -public: - static void thunk(void* environment, FirstArgument firstArgument) - { - Caller::thunk(environment, FirstConversion(firstArgument)); - } -}; - - -class BoolFromString -{ - bool m_value; -public: - BoolFromString(const char* string) - { - Bool_importString(m_value, string); - } - operator bool() const - { - return m_value; - } -}; - -inline void Bool_toString(const StringImportCallback& self, bool value) -{ - Bool_exportString(value, self); -} -typedef ConstReferenceCaller1 BoolToString; - - -template -inline StringImportCallback makeBoolStringImportCallback(const Caller& caller) -{ - return StringImportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - -template -inline StringExportCallback makeBoolStringExportCallback(const Caller& caller) -{ - return StringExportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - - -class IntFromString -{ - int m_value; -public: - IntFromString(const char* string) - { - Int_importString(m_value, string); - } - operator int() const - { - return m_value; - } -}; - -inline void Int_toString(const StringImportCallback& self, int value) -{ - Int_exportString(value, self); -} -typedef ConstReferenceCaller1 IntToString; - - -template -inline StringImportCallback makeIntStringImportCallback(const Caller& caller) -{ - return StringImportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - -template -inline StringExportCallback makeIntStringExportCallback(const Caller& caller) -{ - return StringExportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - - - -class SizeFromString -{ - std::size_t m_value; -public: - SizeFromString(const char* string) - { - Size_importString(m_value, string); - } - operator std::size_t() const - { - return m_value; - } -}; - -inline void Size_toString(const StringImportCallback& self, std::size_t value) -{ - Size_exportString(value, self); -} -typedef ConstReferenceCaller1 SizeToString; - - -template -inline StringImportCallback makeSizeStringImportCallback(const Caller& caller) -{ - return StringImportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - -template -inline StringExportCallback makeSizeStringExportCallback(const Caller& caller) -{ - return StringExportCallback(caller.getEnvironment(), ImportConvert1::thunk); -} - -#endif diff --git a/libs/synapse.h b/libs/synapse.h new file mode 100644 index 00000000..673f5b2c --- /dev/null +++ b/libs/synapse.h @@ -0,0 +1,660 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __SYNAPSE_H__ +#define __SYNAPSE_H__ + +/*! +synapse library +code and utilities to deal with dynamic components programming + +"the point at which a nervous impulse passes from one neuron to another" + +dependencies: + libxml for parsing + STL for some algorithms and data structures + glib for Str.h (Str class) + +this is a utility library, it provides typical synapse client and server +could be split into two independant libraries actually, the server part and the client part +(that's just a matter of reducing binary size) +*/ + +// compile time settings +#ifdef _DEBUG + #define SYNAPSE_VERBOSE // be verbosive about the loading process +#endif + +// ydnar: required for os x +#if defined (__APPLE__) + #include +#endif + +#if defined (__linux__) || defined (__APPLE__) + #include + #include +#endif + +#if defined(_WIN32) + #include +#endif + +#if defined(_WIN32) + #define SYNAPSE_DLL_EXPORT WINAPI +#elif defined(__linux__) || defined(__APPLE__) /* ydnar */ + #define SYNAPSE_DLL_EXPORT +#else + #error unknown architecture +#endif + +// NOTE TTimo: VC6 crap, gets confused when some variable names in function declarations +// are 'allocator' or 'list' +// if you #include glib *after* STL, you get those errors .. better be safe then +#include + +#include "libxml/parser.h" + +#include "irefcount.h" +#include "gtkr_list.h" +#include "gtkr_vector.h" + +#include "str.h" + +/*! +use when API change make things incompatible at synapse level +i.e. entry point and classes API changes +*/ +#define SYNAPSE_VERSION "3" + +/*! +======================================================================= +diagnostic printing facility +independently from any API negociation stuff, +we need a diagnostic facility that's available at all times +======================================================================= +*/ +extern "C" +{ +/*! +prototype to provide to synapse to redirect the output appropriately +*/ +typedef void (* PFN_SYN_PRINTF_VA) (const char *text, va_list args); +void Set_Syn_Printf(PFN_SYN_PRINTF_VA pf); ///< change the handler, set back to NULL for default +/*! +use this for synapse code diagnostics, it will be piped through the handler if necessary +*/ +void Syn_Printf (const char *text, ...); +}; + +/* +======================================================================= +client +======================================================================= +*/ + +/*! +description of an API: +a module requires and provides several APIs +the basic rule is that we will avoid asking an API from a module if the APIs it requires are not filled in yet +the exception being the 'resolve' operation of a given client, which we 'activate' +(that is we make the interfaces it provides available, leave the ones it requires unsolved, and try to get back to a stable situation) +*/ + +typedef enum { SYN_UNKNOWN = 0, SYN_PROVIDE, SYN_REQUIRE, SYN_REQUIRE_ANY } EAPIType; + +#define MAX_APINAME 128 +typedef struct APIDescriptor_s +{ + /*! + major version, this must be UNIQUE for each API + NOTE: we used to rely on GUID for this, that was a good solution to make sure we never get conflicts + but it was a bit overkill, so we dropped and use a string now + */ + char major_name[MAX_APINAME]; + /*! + what kind of interface + for instance for "image" API, "tga" "jpg" etc. + */ + char minor_name[MAX_APINAME]; + EAPIType mType; ///< is this an API we provide or an API we require + /*! + pointer to the table to be filled in + this is valid for SYN_REQUIRE APIs only + */ + void *mpTable; + bool mbTableInitDone; ///< turned to true by the server after the function table has been filled in + /*! + gives the size of the expected function table + */ + int mSize; + /*! + refcounts how many times this API is being used through the app + this is valid for SYN_PROVIDE APIs only + */ + int mRefCount; +} APIDescriptor_t; + +typedef struct XMLConfigEntry_s { + const char *api; + EAPIType type; + int size; + void *pTable; +} XMLConfigEntry_t; + +/*! +\class CSynapseAPIManager +derive from this class if you want to manage several APIs through the same object +(typically, loading plugins, or an unknown number of APIs that match some criterions) +this class has some pure virtual members that need to be implemented by the childs + +we deal with two types of API managers: +- the 'loose' ones have a matching pattern and load everything that matches criterions + typically used for plugins +- the 'list' ones have a fixed list of things they require. They are used to provide + easy access to multiple interfaces + +those two types of managers are not stored in the same structs, and not handled the +same way. For instance the 'list' manager will require ALL it's APIs to be loaded, or +the init will fail. They also play a role in the client activation. + +apart from the multiple API management facility, the main difference with static tables +and individual calls to CSynapseClient::AddAPI is the fact that the APIDescriptor_t are +allocated on demand +*/ + +/* we do some matching, or store minors list, the strings need to be bigger */ +#define MAX_PATTERN_STRING 512 + +/*! \enum EAPIManagerType + \brief type of this manager, loosely matching with "*", or a fixed list of required interfaces +*/ +typedef enum { API_MATCH = 0, API_LIST } EAPIManagerType; + +class CSynapseAPIManager : public IRefCounted +{ + EAPIManagerType mType; + + // the list of APIs we have obtained (SYN_REQUIRE_ANY) + vector< APIDescriptor_t * > mAPIs; + /*! + pattern for matching the major version + NOTE: only supported for now: exact match + */ + char major_pattern[MAX_PATTERN_STRING]; + /*! + pattern for matching the minor + */ + char minor_pattern[MAX_PATTERN_STRING]; + +public: + CSynapseAPIManager() { mType = API_MATCH; } + virtual ~CSynapseAPIManager(); + + EAPIManagerType GetType() { return mType; } + void SetType(EAPIManagerType type) { mType = type; } + + /*! + set the API matching pattern + supported syntax: + any minor for a given major, for instance: PLUGIN_MAJOR, "*" + a space seperated list of minors for a given major: IMAGE_MAJOR, "tga jpg" + */ + void SetMatchAPI(const char *major, const char *minor); + + /*! + utility function + start building a SYN_REQUIRE_ANY descriptor from a SYN_PROVIDE interface that we found matching + */ + static APIDescriptor_t* PrepareRequireAPI(APIDescriptor_t *pAPI); + + /*! + for managers that require a fixed list of things, we are not active until everything has been loaded up + managers that work on a loose pattern like "*" are always active (since they don't know what they want for sure) + */ + bool CheckSetActive(); + + /*! + the manager answers wether it wants to load this or not + we provide a default implementation, but this can be completely overriden if needed + see SetMatchAPI for the documentation of the default implementation + NOTE: this should only be called on API_MATCH type of managers + */ + virtual bool MatchAPI(const char *major, const char *minor); + + /*! + build an APIDescriptor_t configured as SYN_REQUIRE_ANY from the SYN_PROVIDE API we found + used when we scan the available interfaces for a match that would be interesting to this manager + NOTE: only for API_MATCH managers + */ + virtual APIDescriptor_t *BuildRequireAPI(APIDescriptor_t *pAPI) { return NULL; } + + /*! + below is relevant to API_LIST only --------------------------------------------------------------------- + */ + + /*! + fill in the table info to this descriptor, store it as a new slot + NOTE: only for API_LIST + */ + virtual void FillAPITable(APIDescriptor_t *pAPI) { } + + /*! + initialize the list of APIDescriptor_t* with all the stuff we expect + */ + void InitializeAPIList(); + + /*! + access the API descriptors + */ + int GetAPICount(); + APIDescriptor_t *GetAPI(int); +}; + +/*! +\class CSynapseClient +*/ +class CSynapseServer; // forward declare +class CSynapseClient : public IRefCounted +{ + /*! + this flag indicates wether this client is active + i.e. wether you can ask it for interfaces + this is either a client for which all required interfaces have been filled in + or a client we are trying to resolve (i.e. load with all it's stuff) + */ + bool mbActive; + + /*! + we store APIDescriptor_t*, the module fills that in at startup + */ + vector mAPIDescriptors; + + /*! + managers for multiple APIs management + mManagersMatch are managers with loose matching / undefined number of APIs + mManagersList are managers with a fixed list of required interfaces + */ + vector mManagersMatch; + vector mManagersList; + +protected: + friend class CSynapseServer; + /*! + use of this is restricted to the server, expecting it knows what it is doing + will make the client we are trying to resolve able to provide interfaces even though all interfaces it requires have not been filled in yet. + */ + void ForceSetActive() { mbActive = true; } + +public: + CSynapseClient(); + virtual ~CSynapseClient(); + + int GetAPICount(); ///< returns the number of APIs that this module provides + APIDescriptor_t* GetAPIDescriptor(int); ///< retrieve specific information about on of the APIs + + /*! + Add the API to the CSynapseClient information + + \param minor + minor can be NULL, some APIs don't need to have a 'minor' description + + \param type + SYN_PROVIDE: means this is an API we provide if anyone needs it + SYN_REQUIRE: means this is an API we will require for operation + SYN_REQUIRE_ANY: means this is an API we want to load *any* minor found + (for instance a list of image fornats, or the plugins) + + \param pTable + the function table + only valid for SYN_REQUIRE APIs + + \param size + the size of the function table + if SYN_REQUIRE, you should set the size in pTable and AddAPI will work it out + if SYN_PROVIDE, you need to provide this parameter + + returns a bool: + operation may fail, since we have a few safe checks + */ + bool AddAPI(const char *major, const char *minor = NULL, int size = 0, EAPIType type = SYN_PROVIDE, void *pTable = NULL); + + /*! + Add an API manager to the client + this class is designed to handle multiple APIs + is not memory managed by CSynapseClient (should it? or ref counted maybe?) + writing it with support for multiple managers, that may be a bit overkill right now + */ + void AddManager(CSynapseAPIManager *pManager); + + int GetManagerMatchCount(); ///< how many API managers + CSynapseAPIManager* GetManagerMatch(int); ///< get corresponding API manager + + int GetManagerListCount(); ///< how many API managers + CSynapseAPIManager* GetManagerList(int); ///< get corresponding API manager + + /*! + each client has to implement this function itself + it will fill in the function table + and increment the ref counting in it's own SYN_PROVIDE descriptor + returns a bool, false if you ask for an API that's not available + */ + virtual bool RequestAPI(APIDescriptor_t *pAPI) = 0; + + /*! + return the build date, can be overriden by client module + */ + virtual const char* GetInfo(); + + /*! + \brief a shirt name to identify the client + we use this string to identify individual clients, for instance when some XML configuration nodes are required + should be unique, the synapse server should't accept multiple occurences? + */ + virtual const char* GetName() { return ""; } + + bool IsActive() { return mbActive; } + /*! + check wether all interfaces have been filled in + in which case we will switch to 'activated' state, that is this client can provide interfaces to others now + */ + bool CheckSetActive(); + + /*! + \brief called when the client is being shutdown, before the dlclose happens + this is the last call before the dlclose, there's no turning back + just do what you have to do before you die.. decref and stuff + */ + void Shutdown(); + + /*! + override this one in clients that need to proceed through some init steps when activated + if returning false, the init will abort + */ + virtual bool OnActivate() { return true; } + + /*! + \brief walk the XML config and initialize from structures + when you use this function, OnActivate will also make sure all the interfaces listed were properly initialized + two tables, one for the regular single interface, one for the listings + need to store for later and check in OnActivate + + \param pServer, pass the server to talk to + NOTE: might want to store it in the class if that's needed too often + + \param client_name, the name of the client node to look for. If NULL, use GetName() + + \return wether all APIs given were successfully found in the config + */ + bool ConfigXML( CSynapseServer *pServer, const char *client_name, const XMLConfigEntry_t entries[] ); +}; + +/*! +prototype for the only exported function needed in a synapse client +*/ +#define NAME_SYNAPSE_ENUMERATEINTERFACES "Synapse_EnumerateInterfaces" + +class CSynapseServer; // forward declare +typedef CSynapseClient* (SYNAPSE_DLL_EXPORT *PFN_SYNAPSE_ENUMERATEINTERFACES)(const char *version, CSynapseServer *server); + +/*! +a derived version of CSynapseClient that can be used to provide builtin module without having to go through DLLs +this is useful for things we want to isolate behind an abstract API, but that we feel better about having present at all times (such as .def class loader) +*/ +class CSynapseBuiltinClient : public CSynapseClient +{ + public: + CSynapseBuiltinClient() {} + virtual ~CSynapseBuiltinClient() {} + + virtual void EnumerateInterfaces(CSynapseServer *server) = 0; + +}; + +/* +======================================================================= +server +======================================================================= +*/ + +/*! + \enum EClientType + \brief we can have clients that are builtin to a server +*/ +typedef enum { SYN_SO, SYN_BUILTIN } EClientType; + +/*! +server side slot for a synapse client +is OS dependant, except for the ISynapseClient part +*/ +class CSynapseClientSlot +{ +public: + /*! + \todo cleanup, make that private with accessors + */ +#if defined(__linux__) || defined(__APPLE__) + void *mpDLL; ///< handle to the shared object (invalid if SYN_BUILTIN) +#elif defined(_WIN32) + HMODULE mpDLL; ///< handle to the shared object (invalid if SYN_BUILTIN) +#endif + PFN_SYNAPSE_ENUMERATEINTERFACES mpEnumerate; ///< function pointer to the enumeration entry point (invalid if SYN_BUILTIN) + + CSynapseClient *mpClient; ///< the full client API + Str mFileName; ///< path to the file + + EClientType mType; + + /*! + \brief release the shared object. NOTE: OS dependent + */ + void ReleaseSO(); + + CSynapseClientSlot() { mpDLL = NULL; mpEnumerate = NULL; mpClient = NULL; mType = SYN_SO; } + /*! + NOTE: the slot is stored as static object, and copy constructors used + */ + virtual ~CSynapseClientSlot() { } + +}; + +/*! +\class CSynapseServer +dynamic modules manager class +this class provides the server functionality: +initialize, get a list of modules, load them, link them together.. +*/ +class CSynapseServer : public IRefCounted +{ + list mSearchPaths; + list mClients; + + /*! + used for resolve operations + */ + list mStack; + /*! + set this when mStack is modified with new stuff to resolve + NOTE: if this hack becomes too tricky to use we could just encapsulate mStack + */ + bool mbStackChanged; + + xmlDocPtr mpDoc; + xmlNodePtr mpFocusedNode; ///< currently focused node while we are scanning the config (strictly for GetNextConfig usage) + xmlNodePtr mpCurrentClientConfig; + /*! + stores the allocated strings for each call to GetNextConfig + need to be freed if != NULL + */ + xmlChar *m_api_name; + gchar *m_content; + + /*! + push required interfaces for this client into the stack of things to be resolved + it is possible that several mathing interfaces be in the stack at the same time + (for instance several modules that want to get the VFS) + but we should never have the same APIDescriptor_t twice + NOTE: as this function is called repeatedly during the resolve (because the list of required things is refining), + we often have to drop APIDescriptor_t requests that are already there. + NOTE CSynapseAPIManager: if there are CSynapseAPIManager objects in the CSynapseClient, + we will scan and push all the matching APIs too + */ + void PushRequired(CSynapseClient *pClient); + + /*! + work on resolving this particular APIDescriptor_t + returns true if we were able to resolve the interface + returns false otherwise + if the API was found, but not requested because of more required APIs, we push them in mStack + */ + bool ResolveAPI(APIDescriptor_t* pAPI); + + /*! + push an APIDescriptor_t* into the stack of things to be resolved + will check that this is not already present first + will update the mbStackChanged flag + */ + void TryPushStack(APIDescriptor_t *); + + /*! + \brief 'client shutdown' (see libs/synapse/docs/unload.txt) + performs a 'client shutdown' + will free the DLL module + before calling here, the client must be in a 'non active' state + (i.e. it was not used at all during startup, or we have properly done a 'release' already) + we scan the mStack for the SYN_REQUIRE that this client owns, and remove them + \param iSlot is an mClients iterator, invalid when the function returns as the item will have been removed from the list + \return the iterator afer erase call so that the caller iteration can continue + */ + list::iterator ShutdownClient(list::iterator iSlot); + + /*! + \brief actual implementation of the Resolve function + */ + bool DoResolve(CSynapseClient *pClient); + +public: + CSynapseServer(); + virtual ~CSynapseServer(); + + void AddSearchPath(char*); ///< add a new directory to the module search path + /*! + do the big thing, scan for modules, scan their APIs, load up everything + providing pf is optional, will set the diagnostics printing + \param conf_file is the XML configuration file for the intialization (see docs/runtime.txt) + \return false if the init failed (for instance not found/invalid conf file + */ + bool Initialize(const char* conf_file = NULL, PFN_SYN_PRINTF_VA pf = NULL); + + /*! + enumerate the interfaces for a given module + this will load it, query it's entry point, and request the APIs + */ + void EnumerateInterfaces(Str &); + + /*! + enumerate the interfaces for a module that is builtin to the server + */ + void EnumerateBuiltinModule(CSynapseBuiltinClient *); + + /*! + \brief resolve the function table loading for this client + if the client is not listed in the known slots yet, it will be added + wraps around internal DoResolve implementation to unload the unused modules + \return wether the resolution has been successful + */ + bool Resolve(CSynapseClient *pClient); + + /*! + \brief shutdown all the clients. Should only be called when the core is about to exit + this will force all clients to shutdown. it may destroy refcounted APIs and stuff + \todo hafta use the release/refresh code before doing actual shutdown + (i.e. when that code is written later on) + we need to 'broadcast' to all the clients .. that all the modules are going to be reloaded sorta + should clear up as many interfaces as possible to avoid unexpected crashes in the final stages of app exit + */ + void Shutdown(); + + /*! + diagnostic print function + NOTE: + it is essential that those functions should be virtual, + otherwise when accessing the g_pPrintf global we could mismatch + (happens because the same library is linked into server and client) + */ + virtual PFN_SYN_PRINTF_VA Get_Syn_Printf(); + + /*! + \return true if those APIs are matching + we provide two APIs for convenience, actual implementation is MatchAPI + the minors have to be both NULL, or equal, or one the minors be '*' + NOTE: the '*' minor should ONLY be used on an API that will be unique. It is hackish and kinda dangerous + */ + static bool MatchAPI( APIDescriptor_t *p1, APIDescriptor_t *p2 ); + static bool MatchAPI( const char* major1, const char* minor1, const char* major2, const char* minor2 ); + +#if defined(_WIN32) + /*! + utility function to retrieve formatted GetLastError message + ANSI text, static string + */ + static const char* FormatGetLastError(); +#endif + + /*! + dump the stack of interfaces to be solved + this is used when synapse initialization failed to quickly identify the missing/broken pieces + */ + void DumpStack(); + + /*! + general purpose information, list what modules are loaded up + */ + void DumpActiveClients(); + + /*! + \brief select the config node that has this name + call this to locate the right node in XML config + this will focus and get ready to walk through the api nodes + \return wether the config node was correctly selected + */ + bool SelectClientConfig(const char *client_name); + + /*! + \brief walk through the apis + the pointers don't need to be freed + you need to copy them over as they are invalidated between each call to GetNextConfig + \return false when all apis have been parsed + */ + bool GetNextConfig(char **api_name, char **minor); + + /*! + \brief read the minor for a given api in the current config + \return false if this node doesn't exist + */ + bool GetConfigForAPI( const char *api, char **minor ); + + /*! + returns the filename of the module that the passed on client exists in + */ + const char *GetModuleFilename(CSynapseClient *pClient); +}; + +#endif diff --git a/libs/synapse/doc/design.txt b/libs/synapse/doc/design.txt new file mode 100644 index 00000000..e3da4dc3 --- /dev/null +++ b/libs/synapse/doc/design.txt @@ -0,0 +1,190 @@ +synapse code design documentation +================================= + +Objective: +---------- + +Provide a simple cross platform layer to use dynamically loaded code +inside a core application. Portability intended to win32 / linux / MacOS (?) + +Main features are: + +- designed for single process only, no remote clients, no asynchronous processes +- a client/server architecture, based on configuration files: a main binary, + loading a set of shared objects + +Constraints: +------------ + +- large existing plugin code in Radiant! + must be compatible with minimal changes, specially for plugins (i.e. clients) + +- make things as much transparent as possible + (ideally, no real difference between a static linkage and dynamic linkage, + cf usage of #define macros to wrap a function call onto a code pointer) + +Features: +--------- + +Gather as much generic code as possible in a static .lib with minimal dependencies +(only dependency should be configuration files parser) + +NOTE: current effective dependency is STL / glib / xml + +Main executable implemented as a server, all others as clients. What has to +be done for a server / what has to be done for a client needs to be documented. +Provide as much scripts and tools and guidelines as needed (scripted generation of +some .h files?) + +Proposed implementation: +------------------------ + +- have linux/ and win32/ subdirectories with OS-specific implementations +(such as dynamically loading shared objects, and doing the initial query?) + +- reduce the API of a client to the minimum: one exported function? +provide a squeleton to make new clients easily? + +Server use case: +1) build information about location of the modules (from code and config files) +2) load all modules and query information about their APIs +NOTE: could read the APIs from some XML description files instead of +querying it from the modules? +3) build information about the required function tables +i.e.: setup a list with the function tables to be filled in, and what they +need to be filled in with. +4) resolve the function table +NOTE: is this iterative? will some plugins request more APIs as they get filled +up? +NOTE: do we have optional tables? +5) unload unreferences modules +NOTE: we don't expect to be unloading a LOT of modules, otherwise we would +setup a solution that allows exploring of the APIs a given module provides +from a file description. Or you could 'cache' that (md5-checksum the file, and +maintain an XML list). + +Client use case: +1) dynamically loaded +2) prompted for the interfaces it provides +2) prompted for the interfaces it requires +3) either unloaded, or told what interfaces have been filled in + +The client module exports an Synapse_EnumerateInterfaces entry point +This returns an ISynapseClient, which lists what the plugin provides, and what it requires + +The APIs: + +An interface is a function table, GUID / major string / minor string +GUID is a shortcut to reference a major string (i.e. the human readable thing) +the GUID / major string is unique for a given interface +minor string is used to reference a particular version of an API + (for instance when talking about image loading functionality, tga and jpg etc.) + +The GUID scheme is handy because it provides easy tests. They are not strictly +necessary but we will probably want to keep them. Should we extend to GUIDs +for minor too? + +Roadmap: +-------- + +Need to convert the core (as server) and the required modules. Will have +clearer view of what's to be done along the way. + +Implementation design: +---------------------- + +There is a client and server side to synapse. Typically server is in Radiant or q3map, +client is in any module. For implementation, we have one server class and one client class. +It would be possible to have two seperate libraries, synapse-client and synapse-server. But +that only brings down the statically linked stuff to make things more complicated build-sysem +wise. + +Initial implementation has been using isynapse.h and synapse.h, to provide a pure virtual +base class for server and client. But that doesn't bring any major functionality, it's easier +if both sides see the full API of the client and server classes. + +A side problem is the diagnostic printing functionality. For easy debugging we require that +the synapse code can have access to a Sys_Printf or similar function at all times (that is for +client and server implementation). On client we will pipe through the main API to the server +as soon as we can in most cases. Using Sys_Printf would bring us to a dead end situation, since +when synapse is used as the server, the main code implements it's own Sys_Printf stuff. +Instead we introduce a local Syn_Printf implementation, which can be overriden in the server +to point to the appropriate print functions. + +Runtime config: +--------------- + +Something that has not been looked upon a lot yet, runtime configuration. What interfaces +are loaded etc. Ideally, from an XML config file. A client explicitely requests the +server to load all the interfaces it requires (in this case, the client is radiant or +q3map). + +Plugins are somewhat out of the 'required interfaces' frame, since they are loaded +whenever they are found. It is possible however that some plugins would not want to be +loaded in if the game doesn't match etc. in case they would need to access the global +config? + +In most cases a given API is only required once for editor functionality. (VFS for +instance), so our #define strategy for easy mapping of the functions should still work. + +Version checks, reference counting: +------------------------------------ + +Need version checking at several levels. A version string (major/minor) on the main API +entry point (straight in the exported function to save as much as possible for +compatibility). For individual APIs, we have been feeding the struct size into the first +int of the struct so far, and it has worked very well. + +Reference counting: we introduced class based APIs to solve the ref counting issues, +which are not easy to solve on C function tables. That problem would arise in plugin +situations where we might want to 'reload' or 'unload' some plugins. The server could +keep track of the ref count. + +Caching? +-------- + +We are going to load every shared object we find and query it for it's interfaces. Then +we will unload the stuff we don't want. This is going to slow down the startup process. +We could extract the API information in a cache to avoid the loading step. + +Interfaces with multiple minors against I* objects? +--------------------------------------------------- + +Looking at the iimage.h API, why not having instead something that enumerates C++ objects +directly? Mainly because we want to be able to spread several minors accross multiple modules +and still use them together. And straight laid out function tables in C structs are only +one indirection when the table is static. + +This raises a broader topic, instead of requesting APIs, we could request objects directly. +Would that be of any use? + +Loading interfaces / resolving interdependencies strategy +--------------------------------------------------------- + +Some notes about how we load the modules and resolve interdependencies: + +We want to avoid requesting a module for an API it provides before all the APIs it requires +have been filled in (mostly stability concerns, a module may be doing whatever internally +when we request something from it). The exception being the module we are trying to resolve +for (since we need a start point for resolution). But in all likelyness we resolve for radiant +or q3map for instance. + +With this approach, it is possible that some situations could not be resolved, for instance: +Radiant + requires A + provides B +module 1 + requires C + provides A +module 2 + requires A + provides C +if we start by resolving Radiant, we will get stuck +if we are ready to ask module to provide the API even though the required is not meant, it would work +but that kind of situation is very unlikely, so sticking to safer strategy + +Configuration +------------- + +the config info needs to go down to the clients too +for instance, mapxml loaded for q3map or radiant, doesn't rely on the same major? \ No newline at end of file diff --git a/libs/synapse/doc/runtime.txt b/libs/synapse/doc/runtime.txt new file mode 100644 index 00000000..fd376d5c --- /dev/null +++ b/libs/synapse/doc/runtime.txt @@ -0,0 +1,59 @@ +XML config files for customized synapse initialization at runtime +----------------------------------------------------------------- + +Objective: +---------- + +We have to assign the minors of the APIs to function tables +(and possibly to the API managers) at runtime from some config files. + +For instance in Q3 or RTCW mode, we will want to fill in +g_FileSystemTable and g_ShadersTable with the "quake3" minor. Whereas +those tables will be filled in with a different minor for HL mode. + +This affects SYN_REQUIRE for all the clients of the system, so that +config will need to be global and passed around to the clients. + +Implementation: +--------------- + +an XML hierarchy to describe the APIs: + + + quake3 + + + quake3 + + .. + + + + + +Each client will have to be identified by a specific name, if a name in the +config is not found in the client list, the init should fail. A client can +still be hardcoded and not appear in this list though. +(a GetName() function to synapse client) + +SYN_REQUIRE_ANY support will work for strict API lists. Just the same way +we do the simple SYN_REQUIRE + +Discussion: +----------- + +We only deal with SYN_REQUIRE. It is possible that at some point we will want +to customize the SYN_PROVIDE too. For instance depending on the game mode, a +same module could provide two different minors. Couldn't provide the two minors +at the same time though, only one. + +Implementation: +--------------- + +Default config file will be synapse.config in the gametools path. We can override +this later with a custom line in the .game file. Should Synapse be able to operate +without this config file though, as it is looked up by the main program and handed +over to synapse before init? Possibly .. we'll just pass a NULL config node ptr + +Add the config file path to CSynpaseServer::Initialize, pass the loaded XML file to +the clients. Do we need to wrap in an object with some convenience functions? \ No newline at end of file diff --git a/libs/synapse/doc/unload.txt b/libs/synapse/doc/unload.txt new file mode 100644 index 00000000..aa51dce8 --- /dev/null +++ b/libs/synapse/doc/unload.txt @@ -0,0 +1,85 @@ +Release / Reload of modules +--------------------------- + +The 'not active' modules are unloaded after startup +Plugins should be allowed to be unloaded and reloaded on the fly +Modules too, when possible? + +Don't want to 'force' all plugins to have unload capabilities +Just has to be something specified at compile time wether or not they can unload 'cleanly' + +Dependency implications. When you release a module, you need to remove a number of interfaces. +If those interfaces are being used, can you explicitely ask for them to be unloaded? + +Also, problem with plugins breaking the startup process: +http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=441 + +The most important is to provide a clean shutdown method +What's the != between unload and shutdown? + +Means that the server proceeds to the shutdown, and nothing else is supposed to be making +calls through APIs post shutdown. + +Should be done in 3 steps: +#1 prepare shutdown, all APIs are active, just release and save all the stuff you want +#2 tell the modules to shutdown, i.e. release the APIs they point to? (at this point they can't call through anymore) +#3 force all things to be unloaded, warn about reference count problems + +What is different when we unload a module, and we want to keep the editor up? +All the interfaces obtained from this plugin need to be released +If some pure virtual classes have been obtained from this plugin, we need a mecanism to have them removed +Do we need a first path to check if the unload procedure is going to be allowed? + +For instance, a plugin that provides custom entities rendering etc. +Need to unload first, then need to reload (scan the map again, rebuild) + +Summing up, when doing a reload we need to keep track of the modules and let them know after the +module has been reloaded, so that the links can be rebuilt. When doing unload we need to do a +'check' pass prior to anything to know if the release is possible. Because it does not depend +on the module we unload, it depends on the other clients that use it. + +Objectives: +----------- + +- 'release check' of a module + walk through the interfaces this module has provided, and make sure the release will be possible +- 'release' of a module + actually drop all the interfaces. this should be done only after a 'release check' + if something fails here, we are in an unstable state and need to abort +- 'client shutdown' unused modules after initial startup + actual DLL unload / complete shutdown of the client interface + this comes after 'release check' and 'release' +- 'refresh' modules + 'release check', 'release', 'shutdown' and then, reload and build the links again +- 'core shutdown' + 'release' and force 'shutdown' of all clients + even if we encounter some interfaces that we are not able to release cleanly + force things and shutdown all clients + then the core process is ready to exit.. + +Constraints: +------------ + +- refresh and shutdown are sharing some code +- the 'release' part of a module refresh may not be always possible (that's what 'release check' is there for) +- 'core shutdown' has to be forced to happen, in the safest way possible obviously + +Implementation: +--------------- + +- 'client shutdown' comes first + this is used after initial startup, since we don't have to do a prior 'release' on those + this will be used in the 'core shutdown' and 'refresh' too +- then 'core shutdown' procedure? + that's the most urgent thing we need + but 'release check' and 'release' have to be written in and used during 'core shutdown' +- 'refresh' takes an essential part of the design, but that's not something we need to have written right now? + (it mostly relies on 'release check' 'release' 'client shutdown', and then reload and rebuild the links) + +'client shutdown': +this is server side code though, you tell the server 'shutdown this client' +we don't have to exchange anything with the client while we do that +(written initially for unload of unused modules after startup) + +'core shutdown': +is a shutdown of all clients diff --git a/libs/synapse/synapse.cpp b/libs/synapse/synapse.cpp new file mode 100644 index 00000000..432a02c6 --- /dev/null +++ b/libs/synapse/synapse.cpp @@ -0,0 +1,1101 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +// seems to be required for str.h +#include +#include + +#include "synapse.h" +#if defined (__linux__) || defined (__APPLE__) + #include +#endif + +/* +=================================================== +diagnostic stuff +=================================================== +*/ + +extern "C" +{ + +static PFN_SYN_PRINTF_VA g_pPrintf = NULL; + +void Set_Syn_Printf(PFN_SYN_PRINTF_VA pf) +{ + g_pPrintf = pf; +} + +#define BUFFER_SIZE 4096 + +void Syn_Printf (const char *text, ...) +{ + char buf[BUFFER_SIZE]; + va_list args; + + if (!text) + return; + + if (g_pPrintf) + { + va_start (args, text); + (*g_pPrintf)(text, args); + va_end (args); + } + else + { + va_start (args, text); + vsnprintf (buf, BUFFER_SIZE, text, args); + buf[BUFFER_SIZE-1] = 0; + printf(buf); + va_end (args); + } +} + +} + +/* +======================================================================= +server +======================================================================= +*/ + +// this must be kept in sync with EAPIType +static const char* APITypeName[4] = +{ + "SYN_UNKNOWN", + "SYN_PROVIDE", + "SYN_REQUIRE", + "SYN_REQUIRE_ANY" +}; + +CSynapseServer::CSynapseServer() +{ + mpDoc = NULL; + m_api_name = NULL; + m_content = NULL; + mpFocusedNode = NULL; +} + +CSynapseServer::~CSynapseServer() +{ + if (m_api_name) + xmlFree(m_api_name); + if (m_content) + g_free(m_content); + Syn_Printf("TODO: free API managers\n"); +} + +void CSynapseServer::AddSearchPath(char* path) +{ + char *pLocalPath = new char[strlen(path)+1]; + strcpy(pLocalPath, path); + mSearchPaths.push_front(pLocalPath); +} + +bool CSynapseServer::Initialize(const char* conf_file, PFN_SYN_PRINTF_VA pf) +{ + // browse the paths to locate all potential modules + + Set_Syn_Printf(pf); + + if (conf_file) + { + // if a config file is specified and we fail to load it, we fail + Syn_Printf("loading synapse XML config file '%s'\n", conf_file); + mpDoc = xmlParseFile(conf_file); + if (!mpDoc) + { + Syn_Printf("'%s' invalid/not found\n", conf_file); + return false; + } + } + + for (list::iterator iPath=mSearchPaths.begin(); iPath!=mSearchPaths.end(); iPath++) + { + const char* path = *iPath; + + Syn_Printf("Synapse Scanning modules path: %s\n", path); + + GDir* dir = g_dir_open (path, 0, NULL); + + if (dir != NULL) + { + while (1) + { + const gchar* name = g_dir_read_name(dir); + if(name == NULL) + break; + + // too small to be isolated in win32/ and linux/ directories.. +#if defined(_WIN32) + const char* ext_so = ".dll"; +#elif defined (__linux__) || defined (__APPLE__) + const char* ext_so = ".so"; +#endif + const char* ext = strrchr (name, '.'); + if ((ext == NULL) || (stricmp (ext, ext_so) != 0)) + continue; + + Str newModule; + newModule.Format("%s%s", path, name); + Syn_Printf("Found '%s'\n", newModule.GetBuffer()); + EnumerateInterfaces(newModule); + } + + g_dir_close(dir); + } + } + return true; +} + +#if defined(_WIN32) +#define FORMAT_BUFSIZE 2048 +const char* CSynapseServer::FormatGetLastError() +{ + static char buf[FORMAT_BUFSIZE]; + FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + buf, + FORMAT_BUFSIZE, + NULL + ); + return buf; +} + +void CSynapseServer::EnumerateInterfaces(Str &soname) +{ + CSynapseClientSlot slot; + slot.mpDLL = LoadLibrary(soname.GetBuffer()); + if (!slot.mpDLL) + { + Syn_Printf("LoadLibrary '%s' failed\n", soname.GetBuffer()); + Syn_Printf(" GetLastError: %s", FormatGetLastError()); + return; + } + slot.mpEnumerate = (PFN_SYNAPSE_ENUMERATEINTERFACES)GetProcAddress(slot.mpDLL, NAME_SYNAPSE_ENUMERATEINTERFACES); + if (!slot.mpEnumerate) + { + Syn_Printf("GetProcAddress('%s') failed\n", NAME_SYNAPSE_ENUMERATEINTERFACES); + Syn_Printf(" GetLastError: %s", FormatGetLastError()); + return; + } + Syn_Printf("Enumerate interfaces on '%s'\n", soname.GetBuffer()); + slot.mpClient = slot.mpEnumerate(SYNAPSE_VERSION, this); + if (!slot.mpClient) + { + Syn_Printf("Enumerate interfaces on '%s' returned NULL, unloading.\n", soname.GetBuffer()); + if (!FreeLibrary(slot.mpDLL)) + { + Syn_Printf(" FreeLibrary failed: GetLastError: '%s'\n", CSynapseServer::FormatGetLastError()); + } + return; + } + slot.mFileName = soname; + mClients.push_front(slot); +} + +void CSynapseClientSlot::ReleaseSO() +{ + if (!mpDLL) + { + Syn_Printf("ERROR: no shared object handle for client '%s' in CSynapseClientSlot::ReleaseSO\n", mpClient->GetInfo()); + return; + } + Syn_Printf("FreeLibrary '%s'\n", mpClient->GetInfo()); + if (!FreeLibrary(mpDLL)) + { + Syn_Printf(" FreeLibrary failed: GetLastError: '%s'\n", CSynapseServer::FormatGetLastError()); + } + mpDLL = NULL; +} + +#elif defined(__linux__) || defined (__APPLE__) +void CSynapseServer::EnumerateInterfaces(Str &soname) +{ + CSynapseClientSlot slot; + slot.mpDLL = dlopen (soname.GetBuffer(), RTLD_NOW); + PFN_SYNAPSE_ENUMERATEINTERFACES *pEnumerate; + if (!slot.mpDLL) + { + char* error; + if ((error = (char *)dlerror()) == NULL) + error = "Unknown"; + Syn_Printf("dlopen '%s' failed\n dlerror: '%s'\n", soname.GetBuffer(), error); + return; + } + slot.mpEnumerate = (PFN_SYNAPSE_ENUMERATEINTERFACES)dlsym(slot.mpDLL, NAME_SYNAPSE_ENUMERATEINTERFACES); + if (!slot.mpEnumerate) + { + char* error; + if ((error = (char *)dlerror()) == NULL) + error = "Unknown"; + Syn_Printf("dlsym '%s' failed on shared object '%s'\n dlerror: '%s'\n", NAME_SYNAPSE_ENUMERATEINTERFACES, soname.GetBuffer(), error); + return; + } + Syn_Printf("Enumerate interfaces on '%s'\n", soname.GetBuffer()); + slot.mpClient = slot.mpEnumerate(SYNAPSE_VERSION, this); + if (!slot.mpClient) + { + Syn_Printf("Enumerate interfaces on '%s' returned NULL, unloading.\n", soname.GetBuffer()); + if (dlclose(slot.mpDLL)) + { + char* error; + if ((error = (char *)dlerror()) == NULL) + error = "Unknown"; + Syn_Printf(" dlclose failed: dlerror: '%s'\n", error); + } + return; + } + slot.mFileName = soname; + mClients.push_front(slot); +} + +void CSynapseClientSlot::ReleaseSO() +{ + if (!mpDLL) + { + Syn_Printf("ERROR: no shared object handle for client '%s' in CSynapseClientSlot::ReleaseSO\n", mpClient->GetInfo()); + return; + } + Syn_Printf("dlclose '%s'\n", mpClient->GetInfo()); + if (dlclose(mpDLL)) + { + char* error; + if ((error = (char *)dlerror()) == NULL) + error = "Unknown"; + Syn_Printf(" dlclose failed: dlerror: '%s'\n", error); + } + mpDLL = NULL; +} + +#endif + +void CSynapseServer::EnumerateBuiltinModule(CSynapseBuiltinClient *pClient) +{ + CSynapseClientSlot slot; + pClient->EnumerateInterfaces(this); + slot.mpClient = pClient; + slot.mType = SYN_BUILTIN; + mClients.push_front(slot); +} + +PFN_SYN_PRINTF_VA CSynapseServer::Get_Syn_Printf() +{ + return g_pPrintf; +} + +void CSynapseServer::TryPushStack(APIDescriptor_t *pAPI) +{ + list::iterator iAPI; + for(iAPI=mStack.begin(); iAPI!=mStack.end(); iAPI++) + { + if ((*iAPI) == pAPI) + { + return; + } + } + mStack.push_front(pAPI); + mbStackChanged = true; +} + +list::iterator CSynapseServer::ShutdownClient(list::iterator iSlot) +{ + CSynapseClientSlot *pClientSlot = &(*iSlot); + if (pClientSlot->mpClient->IsActive()) + { + // this should not happen except during core shutdown (i.e. editor is shutting down) + Syn_Printf("WARNING: ShutdownClient attempted on an active module '%s'\n", pClientSlot->mpClient->GetInfo()); + } + // cleanup mStack + int i,api_count; + api_count = pClientSlot->mpClient->GetAPICount(); + for(i=0; impClient->GetAPIDescriptor(i); + // search this API in mStack + list< APIDescriptor_t *>::iterator iStack = mStack.begin(); + while(iStack != mStack.end()) + { + if (*iStack == pAPI) + break; + iStack++; + } + if (iStack != mStack.end()) + { + if (pAPI->mType == SYN_REQUIRE) + { + if (pAPI->mbTableInitDone) + { + // even if non active, some SYN_REQUIRE may have been filled up + // look for the corresponding SYN_PROVIDE and decref + list< APIDescriptor_t *>::iterator iStackRequire = mStack.begin(); + APIDescriptor_t *pMatchAPI; + while (iStackRequire != mStack.end()) + { + pMatchAPI = *iStackRequire; + if ( pMatchAPI->mType == SYN_PROVIDE && MatchAPI( pMatchAPI, pAPI ) ) + break; + iStackRequire++; + } + if (iStackRequire != mStack.end()) + { + // we have found the corresponding SYN_PROVIDE + pMatchAPI->mRefCount--; + } + else + { + // this is not supposed to happen at all + Syn_Printf("ERROR: couldn't find the SYN_PROVIDE for an initialized SYN_REQUIRE API '%s' '%s' '%s'\n", pAPI->major_name, pAPI->minor_name, pClientSlot->mpClient->GetInfo()); + } + } + } + else if (pAPI->mType == SYN_PROVIDE) + { + // this should never happen on non active clients, it may happen during a core shutdown though + // if the mRefCount is != 0, that means there is at least a function table out there that will segfault things + Syn_Printf("WARNING: found a SYN_PROVIDE API '%s' '%s' with refcount %d in CSynapseServer::ShutdownClient for '%s'\n", pAPI->major_name, pAPI->minor_name, pAPI->mRefCount, pClientSlot->mpClient->GetInfo()); + } + // mostly safe to remove it now + mStack.erase(iStack); + } + } + // we can actually release the module now + // NOTE: do we want to have a 'final shutdown' call to the client? (not as long as we don't have a use for it) + if (pClientSlot->mType == SYN_SO) + { + pClientSlot->ReleaseSO(); + } + return mClients.erase(iSlot); +} + +void CSynapseServer::PushRequired(CSynapseClient *pClient) +{ + /* walk through the standard APIs and push them in */ + int i,max = pClient->GetAPICount(); + for(i=0; iGetAPIDescriptor(i); + if (pAPI->mType == SYN_REQUIRE && !pAPI->mbTableInitDone) + { + TryPushStack(pAPI); + } + } + + /* if this client has 'List' API Manager types, walk through them for addition too */ + max = pClient->GetManagerListCount(); + for(i=0; iGetManagerList(i); + assert(pManager->GetType() == API_LIST); + pManager->InitializeAPIList(); + int j; + for(j=0; jGetAPICount(); j++) + { + TryPushStack(pManager->GetAPI(j)); + } + } + + /* if there are loose match managers, prompt them against the current list of SYN_PROVIDE interfaces + * and let them decide which ones they might want + */ + + max = pClient->GetManagerMatchCount(); + + for(i=0; iGetManagerMatch(i); + // start matching all known SYN_PROVIDE APIs against this manager + list::iterator iClientSlot; + for(iClientSlot=mClients.begin(); iClientSlot!=mClients.end(); iClientSlot++) + { + CSynapseClient *pScanClient = (*iClientSlot). + mpClient; + int j,jmax = pScanClient->GetAPICount(); + for(j=0; jGetAPIDescriptor(j); + if (pAPI->mType == SYN_PROVIDE) + { + if (pManager->MatchAPI(pAPI->major_name, pAPI->minor_name)) + { + /*! we are going to want to load this one + * NOTE TTimo: what if this can not be resolved in the end? + * if this happens, then the whole startup will fail instead + * or we can use SYN_REQUIRE_ANY and drop it without consequences + */ + APIDescriptor_t *pPushAPI = pManager->BuildRequireAPI(pAPI); + TryPushStack(pPushAPI); + } + } + } + } + } +} + +bool CSynapseServer::MatchAPI(APIDescriptor_t *p1, APIDescriptor_t *p2) +{ + return MatchAPI( p1->major_name, p1->minor_name, p2->major_name, p2->minor_name ); +} + +bool CSynapseServer::MatchAPI(const char* major1, const char* minor1, const char* major2, const char* minor2) +{ + if ( strcmp( major1, major2 ) ) { + return false; + } + // either no minor at all for this API, or matching + if ( ( minor1 && minor2 ) && !strcmp( minor1, minor2 ) ) { + return true; + } + // or one of the minors says "*" (knowing that the majors match already) + if ( ( minor1 && !strcmp( minor1, "*" ) ) || ( minor2 && !strcmp( minor2, "*" ) ) ) { + return true; + } + return false; +} + +bool CSynapseServer::ResolveAPI(APIDescriptor_t* pAPI) +{ + //Syn_Printf("In ResolveAPI %s %p '%s' '%s'\n", APITypeName[pAPI->mType], pAPI, pAPI->major_name, pAPI->minor_name); + // loop through active clients, search for a client providing what we are looking for + list::iterator iClient; + for(iClient=mClients.begin(); iClient!=mClients.end(); iClient++) + { + // walk through interfaces on this client for a match + CSynapseClient *pScanClient = (*iClient).mpClient; + int i,max = pScanClient->GetAPICount(); + for(i=0; iGetAPIDescriptor(i); + if (pScanClientAPI->mType == SYN_PROVIDE) + { + if (MatchAPI(pAPI, pScanClientAPI)) + { + // can this client provide APIs yet + // it is possible that all of it's APIs have been filled and it's not been activated yet + pScanClient->CheckSetActive(); + if (pScanClient->IsActive()) + { + // make sure this interface has correct size (this is our version check) + if (pAPI->mSize != pScanClientAPI->mSize) + { + Syn_Printf("ERROR: version mismatch for API '%s' '%s' found in '%s' (size %d != %d)\n", pAPI->major_name, pAPI->minor_name, pScanClient->GetInfo(), pAPI->mSize, pScanClientAPI->mSize); + Syn_Printf(" the module and the server are incompatible\n"); + // keep going to other APIs + continue; + } + // this is an active client, we can request + #ifdef SYNAPSE_VERBOSE + Syn_Printf("RequestAPI '%s' '%s' from '%s' for API %p\n", pAPI->major_name, pAPI->minor_name, pScanClient->GetInfo(), pAPI); + #endif + if (!pScanClient->RequestAPI(pAPI)) + { + // this should never happen, means we think this module provides the API, but it answers that it doesn't + Syn_Printf("ERROR: RequestAPI failed\n"); + return false; + } + pScanClientAPI->mRefCount++; + pAPI->mbTableInitDone = true; + return true; // job done + } + else + { + // this client is not active yet, some of it's required interfaces are not filled in + PushRequired(pScanClient); + // we will exit the scan through the APIDescriptor of this client and look at other clients + break; + } + } + } + } + } + return false; +} + +bool CSynapseServer::DoResolve(CSynapseClient *pClient) +{ + list::iterator iSlot; + for(iSlot=mClients.begin(); iSlot != mClients.end(); iSlot++) + { + if ((*iSlot).mpClient == pClient) + break; + } + if (iSlot == mClients.end()) + { + Syn_Printf("CSynapserServer::Resolve adding new client slot '%s'\n", pClient->GetInfo()); + CSynapseClientSlot slot; + slot.mpClient = pClient; + slot.mFileName = "local client"; + // make it active so we can request the interfaces already + pClient->ForceSetActive(); + mClients.push_front(slot); + } + else + { + // make it active so we can request the interfaces already + (*iSlot).mpClient->ForceSetActive(); + } + + // push the interfaces that need to be resolved for this client + // NOTE: this doesn't take care of the SYN_REQUIRE_ANY interfaces + PushRequired(pClient); + // start resolving now + // working till the stack is emptied or till we reach a dead end situation + // we do a depth first traversal, we will grow the interface stack to be resolved till we start finding solutions + list::iterator iCurrent; + mbStackChanged = true; // init to true so we try the first elem + while (!mStack.empty()) + { + //DumpStack(); + if (!mbStackChanged) + { + // the stack didn't change last loop + iCurrent++; + if (iCurrent==mStack.end()) + { + Syn_Printf("ERROR: CSynapseServer::Resolve, failed to resolve\n"); + DumpStack(); + return false; + } + if (ResolveAPI(*iCurrent)) + { + iCurrent = mStack.erase(iCurrent); + mbStackChanged = true; + } + } + else + { + // the stack changed at last loop + mbStackChanged = false; + iCurrent = mStack.begin(); + if (ResolveAPI(*iCurrent)) + { + iCurrent = mStack.erase(iCurrent); + mbStackChanged = true; + } + } + } + return true; +} + +bool CSynapseServer::Resolve(CSynapseClient *pClient) +{ + bool ret = DoResolve(pClient); + list::iterator iClient; + iClient = mClients.begin(); + while(iClient != mClients.end()) + { + CSynapseClient *pClient = (*iClient).mpClient; + if (!pClient->IsActive()) + { + Syn_Printf("Unloading an unused module: '%s'\n", pClient->GetInfo()); + iClient = ShutdownClient(iClient); + } + else + iClient++; + } + return ret; +} + +void CSynapseServer::Shutdown() +{ + Syn_Printf("Synapse server core is shutting down\n"); + // do a first pass to shutdown the clients nicely (i.e. decref, release memory and drop everything) + // we seperate the client shutdown calls from the dlclose cause that part is a clean decref / free situation whereas dlclose will break links without advice + list::iterator iClient; + iClient = mClients.begin(); + for(iClient = mClients.begin(); iClient != mClients.end(); iClient++) + { + (*iClient).mpClient->Shutdown(); + } + // now release them from the server's point of view + iClient = mClients.begin(); + while(iClient != mClients.end()) + { + iClient = ShutdownClient(iClient); + } +} + +void CSynapseServer::DumpStack() +{ + list::iterator iCurrent; + for(iCurrent=mStack.begin(); iCurrent != mStack.end(); iCurrent++) + { + APIDescriptor_t*pAPI = *iCurrent; + Syn_Printf("interface %s %p '%s' '%s'\n", APITypeName[pAPI->mType], pAPI, pAPI->major_name, pAPI->minor_name); + } +} + +void CSynapseServer::DumpActiveClients() +{ + list::iterator iClient; + for(iClient=mClients.begin(); iClient!=mClients.end(); iClient++) + { + CSynapseClient *pClient = (*iClient).mpClient; + Syn_Printf("%s", pClient->GetInfo()); + if (pClient->IsActive()) + Syn_Printf("\n"); + else + Syn_Printf(" (not active)\n"); + } +} + +bool CSynapseServer::SelectClientConfig(const char *client_name) +{ + if (!mpDoc) + return false; + xmlNodePtr pNode = xmlDocGetRootElement(mpDoc); + if (!pNode) + return false; + // look for the client + pNode=pNode->children; + while(pNode) + { + if (pNode->type == XML_ELEMENT_NODE) + { + xmlChar *prop = xmlGetProp(pNode, (const xmlChar *)"name"); + if (!strcmp((const char *)prop, client_name)) + { + xmlFree(prop); + break; + } + xmlFree(prop); + } + pNode = pNode->next; + } + if (!pNode) + return false; // config you asked for isn't there + // focus + mpFocusedNode = pNode->children; + mpCurrentClientConfig = pNode; + return true; +} + +bool CSynapseServer::GetNextConfig(char **api_name, char **minor) +{ + while(mpFocusedNode && mpFocusedNode->name) + { + if (mpFocusedNode->type == XML_ELEMENT_NODE && !strcmp((const char *)mpFocusedNode->name, "api")) + { + if (m_api_name) + xmlFree(m_api_name); + m_api_name = xmlGetProp(mpFocusedNode, (const xmlChar *)"name"); + *api_name = (char *)m_api_name; + if (m_content) + g_free(m_content); + m_content = g_strdup((const gchar *)mpFocusedNode->children->content); + g_strstrip(m_content); + *minor = m_content; + mpFocusedNode = mpFocusedNode->next; + return true; + } + mpFocusedNode = mpFocusedNode->next; + } + return false; +} + +bool CSynapseServer::GetConfigForAPI( const char *api, char **minor ) { + xmlNodePtr pNode = mpCurrentClientConfig->children; + while ( pNode && pNode->name ) { + if ( pNode->type == XML_ELEMENT_NODE && !strcmp( (const char *)pNode->name, "api" ) ) { + if ( m_api_name ) { + xmlFree( m_api_name ); + } + m_api_name = xmlGetProp( pNode, (const xmlChar *)"name" ); + if ( !strcmp( (const char *)m_api_name, api ) ) { + if ( m_content ) { + g_free( m_content ); + } + m_content = g_strdup( (const gchar *)pNode->children->content ); + g_strstrip( m_content ); + *minor = m_content; + return true; + } + } + pNode = pNode->next; + } + return false; +} + +const char *CSynapseServer::GetModuleFilename(CSynapseClient *pClient) +{ + list::iterator iSlot; + for(iSlot=mClients.begin(); iSlot != mClients.end(); iSlot++) + { + if ((*iSlot).mpClient == pClient) + { + if ((*iSlot).mType == SYN_BUILTIN) + { + return ""; // FIXME + } + else + { + return (*iSlot).mFileName; + } + } + } + return NULL; +} + +/* +======================================================================= +client +======================================================================= +*/ + +CSynapseClient::CSynapseClient() +{ +} + +void CSynapseClient::Shutdown() +{ + vector::iterator iAPI; + for(iAPI=mAPIDescriptors.begin(); iAPI!=mAPIDescriptors.end(); iAPI++) + { + APIDescriptor_t *pAPI = *iAPI; + if (pAPI->mRefCount != 0) + Syn_Printf("WARNING: ~CSynapseClient '%s' has non-zero ref count for interface '%s' '%s'\n", GetInfo(), pAPI->major_name, pAPI->minor_name); + else + delete pAPI; + *iAPI=NULL; + } + mAPIDescriptors.clear(); + vector::iterator iManager; + for(iManager=mManagersList.begin(); iManager!=mManagersList.end(); iManager++) + { + CSynapseAPIManager *pManager = *iManager; + pManager->DecRef(); + *iManager = NULL; + } + mManagersList.clear(); + for(iManager=mManagersMatch.begin(); iManager!=mManagersMatch.end(); iManager++) + { + CSynapseAPIManager *pManager = *iManager; + pManager->DecRef(); + *iManager = NULL; + } + mManagersMatch.clear(); +} + +CSynapseClient::~CSynapseClient() +{ + // this should not be doing anything when called from here if everything went right + // otherwise it's likely to crash .. at least that's the sign we missed something + Shutdown(); +} + +int CSynapseClient::GetAPICount() +{ + return mAPIDescriptors.size(); +} + +APIDescriptor_t* CSynapseClient::GetAPIDescriptor(int i) +{ + return mAPIDescriptors[i]; +} + +int CSynapseClient::GetManagerMatchCount() +{ + return mManagersMatch.size(); +} + +CSynapseAPIManager* CSynapseClient::GetManagerMatch(int i) +{ + return mManagersMatch[i]; +} + +int CSynapseClient::GetManagerListCount() +{ + return mManagersList.size(); +} + +CSynapseAPIManager* CSynapseClient::GetManagerList(int i) +{ + return mManagersList[i]; +} + +bool CSynapseClient::AddAPI(const char *major, const char *minor, int size, EAPIType type, void *pTable) +{ + // do some safe checks before actual addition + if (type == SYN_REQUIRE && !pTable) + { + Syn_Printf("ERROR: interface '%s' '%s' from '%s' is SYN_REQUIRE and doesn't provide a function table pointer\n", major, minor, GetInfo()); + return false; + } + if (pTable) + { + int *pi = (int *)pTable; + if (pi == 0) + { + Syn_Printf("ERROR: forgot to init function table size for interface '%s' '%s' from '%s'?\n", major, minor, GetInfo()); + return false; + } + } + APIDescriptor_t *pAPI = new APIDescriptor_t; + memset(pAPI, 0, sizeof(APIDescriptor_t)); + strncpy(pAPI->major_name, major, MAX_APINAME); + if (minor) + strncpy(pAPI->minor_name, minor, MAX_APINAME); + pAPI->mType = type; + pAPI->mpTable = pTable; + // store the interface size + if (type == SYN_PROVIDE) + { + if (size == 0) + { + Syn_Printf("ERROR: size of the interface required for a SYN_PROVIDE ('%s' '%s' from '%s')\n", major, minor, GetInfo()); + delete pAPI; + return false; + } + pAPI->mSize = size; + } + else if (type == SYN_REQUIRE) + { + if (size != 0) + { + // if a non-zero value is given in function call, use this instead of the val in table + *((int *)pAPI->mpTable) = size; + pAPI->mSize = size; + } + else + { + pAPI->mSize = *((int *)pAPI->mpTable); + if (pAPI->mSize == 0) + { + Syn_Printf("ERROR: didn't get an interface size ('%s' '%s' from '%s')\n", major, minor, GetInfo()); + delete pAPI; + return false; + } + } + } + else + { + Syn_Printf("ERROR: AddAPI type '%d' not supported\n", type); + return false; + } + mAPIDescriptors.push_back(pAPI); + #ifdef SYNAPSE_VERBOSE + Syn_Printf("AddAPI: %s %p '%s' '%s' from '%s', size %d\n", APITypeName[pAPI->mType], pAPI, major, minor, GetInfo(), pAPI->mSize); + #endif + return true; +} + +#include "version.h" + +const char* CSynapseClient::GetInfo() +{ + return "CSynapseClient built " __DATE__ " " RADIANT_VERSION; +} + +bool CSynapseClient::CheckSetActive() +{ + if (mbActive) + return true; + int i,max=GetAPICount(); + for(i=0; imType == SYN_REQUIRE && !pAPI->mbTableInitDone) + return false; + } + // if we have managers with fixed list, those need to be completely filled in too + vector::iterator iManager; + for(iManager=mManagersList.begin(); iManager!=mManagersList.end(); iManager++) + { + if (!(*iManager)->CheckSetActive()) + return false; // one of the managers doesn't have all it needs yet + } + // call OnActivate to let the client perform last minute checks + // NOTE: this should be fatal instead of letting the engine try other combinations + if (!OnActivate()) { + return false; + } + // yes, all required interfaces have been initialized + Syn_Printf("'%s' activated\n", GetInfo()); + mbActive = true; + return true; +} + +bool CSynapseClient::ConfigXML( CSynapseServer *pServer, const char *client_name, const XMLConfigEntry_t entries[] ) { + + if ( !client_name ) { + client_name = GetName(); + } + + Syn_Printf("Dynamic APIs for client '%s'\n", GetInfo()); + if ( !pServer->SelectClientConfig( client_name ) ) + { + Syn_Printf( "Failed to select synapse client config '%s'\n", client_name ); + return false; + } + + int i = 0; + while ( entries[i].type != SYN_UNKNOWN ) { // don't test pTable, for a SYN_PROVIDE it will be empty + char *minor; + if ( !pServer->GetConfigForAPI( entries[i].api, &minor ) ) { + Syn_Printf( "GetConfigForAPI '%s' failed - invalid XML config file?\n", entries[i].api ); + return false; + } + AddAPI( entries[i].api, minor, entries[i].size, entries[i].type, entries[i].pTable ); + i++; + } + Syn_Printf( "%d dynamic interfaces parsed for '%s'\n", i, client_name ); + return true; +} + +void CSynapseClient::AddManager(CSynapseAPIManager *pManager) +{ + pManager->IncRef(); + if (pManager->GetType() == API_LIST) + mManagersList.push_back(pManager); + else + mManagersMatch.push_back(pManager); +} + +CSynapseAPIManager::~CSynapseAPIManager() +{ + vector::iterator iAPI; + for(iAPI=mAPIs.begin(); iAPI!=mAPIs.end(); iAPI++) + { + APIDescriptor_t *pAPI = *iAPI; + if (pAPI->mRefCount != 0) + { + Syn_Printf("WARNING: ~CSynapseAPIManager has non-zero ref count for interface '%s' '%s'\n", pAPI->major_name, pAPI->minor_name); + } + delete pAPI; + *iAPI = NULL; + } +} + +APIDescriptor_t* CSynapseAPIManager::PrepareRequireAPI(APIDescriptor_t *pAPI) +{ +#ifdef _DEBUG + if (pAPI->mType != SYN_PROVIDE) + { + Syn_Printf("ERROR: unexpected pAPI->mType != SYN_PROVIDE in CSynapseAPIManager::PrepareRequireAPI\n"); + return NULL; + } +#endif + APIDescriptor_t *pRequireAPI = new APIDescriptor_t; + memcpy(pRequireAPI, pAPI, sizeof(APIDescriptor_t)); + pRequireAPI->mType = SYN_REQUIRE_ANY; + pRequireAPI->mpTable = NULL; + pRequireAPI->mbTableInitDone = false; + pRequireAPI->mSize = 0; // this will have to be set correctly by the child for version checking + pRequireAPI->mRefCount = 0; + return pRequireAPI; +} + +void CSynapseAPIManager::SetMatchAPI(const char *major, const char *minor) +{ + if (strlen(minor)>MAX_PATTERN_STRING) + { + Syn_Printf("ERROR: MAX_TOKEN_STRING exceeded in CSynapseAPIManager::SetMatchAPI: '%s'\n", minor); + return; + } + strcpy(major_pattern, major); + strcpy(minor_pattern, minor); + if (strcmp(minor, "*")) + { + mType = API_LIST; + } +} + +bool CSynapseAPIManager::MatchAPI(const char *major, const char *minor) +{ + assert(mType == API_MATCH); + + /*! + if this interface has been allocated already, avoid requesting it again.. + */ + vector::iterator iAPI; + for(iAPI=mAPIs.begin(); iAPI!=mAPIs.end(); iAPI++) + { + if (CSynapseServer::MatchAPI((*iAPI)->major_name, (*iAPI)->minor_name, major, minor)) + return false; + } + + if (!strcmp(major, major_pattern)) + return true; + return false; +} + +bool CSynapseAPIManager::CheckSetActive() +{ + if (mType == API_MATCH) + return false; + // mType == API_LIST + int i,max = GetAPICount(); + for(i=0; imbTableInitDone) + return false; + } + return true; +} + +void CSynapseAPIManager::InitializeAPIList() +{ + char minor_tok[MAX_PATTERN_STRING]; + char *token; + + if (mAPIs.size()) + { + Syn_Printf("WARNING: CSynapseAPIManager::InitializeAPIList on an already initialized APIManager\n"); + return; + } + + strncpy(minor_tok, minor_pattern, MAX_PATTERN_STRING); + token = strtok(minor_tok, " "); + while (token) + { + /* ask the child to build from scratch */ + APIDescriptor_t *pAPI = new APIDescriptor_t; + memset(pAPI, 0, sizeof(APIDescriptor_t)); + strncpy(pAPI->major_name, major_pattern, MAX_APINAME); + strncpy(pAPI->minor_name, token, MAX_APINAME); + pAPI->mType = SYN_REQUIRE_ANY; + FillAPITable(pAPI); + mAPIs.push_back(pAPI); + token = strtok(NULL, " "); + } +} + +int CSynapseAPIManager::GetAPICount() +{ + return mAPIs.size(); +} + +APIDescriptor_t* CSynapseAPIManager::GetAPI(int i) +{ + return mAPIs[i]; +} + +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=879 +void fini_stub() { + printf( "fini_stub\n" ); +} diff --git a/libs/synapse/synapse.vcproj b/libs/synapse/synapse.vcproj new file mode 100644 index 00000000..a4b5a526 --- /dev/null +++ b/libs/synapse/synapse.vcproj @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/texturelib.cpp b/libs/texturelib.cpp deleted file mode 100644 index b501c1d1..00000000 --- a/libs/texturelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "texturelib.h" diff --git a/libs/texturelib.h b/libs/texturelib.h deleted file mode 100644 index 8b44597e..00000000 --- a/libs/texturelib.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_TEXTURELIB_H) -#define INCLUDED_TEXTURELIB_H - -#include "generic/vector.h" -typedef Vector3 Colour3; -typedef unsigned int GLuint; -class LoadImageCallback; - -// describes a GL texture -struct qtexture_t -{ - qtexture_t(const LoadImageCallback& load, const char* name) : load(load), name(name) - { - } - const LoadImageCallback& load; - const char* name; - std::size_t width, height; - GLuint texture_number; // gl bind number - Colour3 color; // for flat shade mode - int surfaceFlags, contentFlags, value; -}; - -#endif diff --git a/libs/transformlib.cpp b/libs/transformlib.cpp deleted file mode 100644 index 753a8b52..00000000 --- a/libs/transformlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "transformlib.h" diff --git a/libs/transformlib.h b/libs/transformlib.h deleted file mode 100644 index ea68dc95..00000000 --- a/libs/transformlib.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_TRANSFORMLIB_H) -#define INCLUDED_TRANSFORMLIB_H - -#include "generic/constant.h" -#include "math/matrix.h" -#include "math/quaternion.h" - - -/// \brief A transform node. -class TransformNode -{ -public: - STRING_CONSTANT(Name, "TransformNode"); - /// \brief Returns the transform which maps the node's local-space into the local-space of its parent node. - virtual const Matrix4& localToParent() const = 0; -}; - -/// \brief A transform node which has no effect. -class IdentityTransform : public TransformNode -{ -public: - /// \brief Returns the identity matrix. - const Matrix4& localToParent() const - { - return g_matrix4_identity; - } -}; - -/// \brief A transform node which stores a generic transformation matrix. -class MatrixTransform : public TransformNode -{ - Matrix4 m_localToParent; -public: - MatrixTransform() : m_localToParent(g_matrix4_identity) - { - } - - Matrix4& localToParent() - { - return m_localToParent; - } - /// \brief Returns the stored local->parent transform. - const Matrix4& localToParent() const - { - return m_localToParent; - } -}; - - -#include "generic/callback.h" - -typedef Vector3 Translation; -typedef Quaternion Rotation; -typedef Vector3 Scale; - -inline Matrix4 matrix4_transform_for_components(const Translation& translation, const Rotation& rotation, const Scale& scale) -{ - Matrix4 result(matrix4_rotation_for_quaternion_quantised(rotation)); - vector4_to_vector3(result.x()) *= scale.x(); - vector4_to_vector3(result.y()) *= scale.y(); - vector4_to_vector3(result.z()) *= scale.z(); - result.tx() = translation.x(); - result.ty() = translation.y(); - result.tz() = translation.z(); - return result; -} - -typedef bool TransformModifierType; -const TransformModifierType TRANSFORM_PRIMITIVE = false; -const TransformModifierType TRANSFORM_COMPONENT = true; - -/// \brief A transformable scene-graph instance. -/// -/// A transformable instance may be translated, rotated or scaled. -/// The state of the instanced node's geometrical representation -/// will be the product of its geometry and the transforms of each -/// of its instances, applied in the order they appear in a graph -/// traversal. -/// Freezing the transform on an instance will cause its transform -/// to be permanently applied to the geometry of the node. -class Transformable -{ -public: - STRING_CONSTANT(Name, "Transformable"); - - virtual void setType(TransformModifierType type) = 0; - virtual void setTranslation(const Translation& value) = 0; - virtual void setRotation(const Rotation& value) = 0; - virtual void setScale(const Scale& value) = 0; - virtual void freezeTransform() = 0; -}; - -const Translation c_translation_identity = Translation(0, 0, 0); -const Rotation c_rotation_identity = c_quaternion_identity; -const Scale c_scale_identity = Scale(1, 1, 1); - - -class TransformModifier : public Transformable -{ - Translation m_translation; - Rotation m_rotation; - Scale m_scale; - Callback m_changed; - Callback m_apply; - TransformModifierType m_type; -public: - - TransformModifier(const Callback& changed, const Callback& apply) : - m_translation(c_translation_identity), - m_rotation(c_quaternion_identity), - m_scale(c_scale_identity), - m_changed(changed), - m_apply(apply), - m_type(TRANSFORM_PRIMITIVE) - { - } - void setType(TransformModifierType type) - { - m_type = type; - } - TransformModifierType getType() const - { - return m_type; - } - void setTranslation(const Translation& value) - { - m_translation = value; - m_changed(); - } - void setRotation(const Rotation& value) - { - m_rotation = value; - m_changed(); - } - void setScale(const Scale& value) - { - m_scale = value; - m_changed(); - } - void freezeTransform() - { - if(m_translation != c_translation_identity - || m_rotation != c_rotation_identity - || m_scale != c_scale_identity) - { - m_apply(); - m_translation = c_translation_identity; - m_rotation = c_rotation_identity; - m_scale = c_scale_identity; - m_changed(); - } - } - const Translation& getTranslation() const - { - return m_translation; - } - const Rotation& getRotation() const - { - return m_rotation; - } - const Scale& getScale() const - { - return m_scale; - } - Matrix4 calculateTransform() const - { - return matrix4_transform_for_components(getTranslation(), getRotation(), getScale()); - } -}; - - -#endif diff --git a/libs/traverselib.cpp b/libs/traverselib.cpp deleted file mode 100644 index 0008bf15..00000000 --- a/libs/traverselib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "traverselib.h" diff --git a/libs/traverselib.h b/libs/traverselib.h deleted file mode 100644 index 183113b8..00000000 --- a/libs/traverselib.h +++ /dev/null @@ -1,405 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_TRAVERSELIB_H) -#define INCLUDED_TRAVERSELIB_H - -#include "debugging/debugging.h" - -#include "scenelib.h" -#include "undolib.h" -#include "container/container.h" - -#include -#include -#include - -class TraversableObserverInsertOutputIterator -{ -protected: - scene::Traversable::Observer* m_observer; -public: - typedef std::output_iterator_tag iterator_category; - typedef void difference_type; - typedef void value_type; - typedef void pointer; - typedef void reference; - - TraversableObserverInsertOutputIterator(scene::Traversable::Observer* observer) - : m_observer(observer) - { - } - TraversableObserverInsertOutputIterator& operator=(const NodeReference& node) - { - m_observer->insert(node); - return *this; - } - TraversableObserverInsertOutputIterator& operator=(const NodeSmartReference& node) - { - m_observer->insert(node); - return *this; - } - TraversableObserverInsertOutputIterator& operator*() { return *this; } - TraversableObserverInsertOutputIterator& operator++() { return *this; } - TraversableObserverInsertOutputIterator& operator++(int) { return *this; } -}; - -class TraversableObserverEraseOutputIterator -{ -protected: - scene::Traversable::Observer* m_observer; -public: - typedef std::output_iterator_tag iterator_category; - typedef void difference_type; - typedef void value_type; - typedef void pointer; - typedef void reference; - - TraversableObserverEraseOutputIterator(scene::Traversable::Observer* observer) - : m_observer(observer) - { - } - TraversableObserverEraseOutputIterator& operator=(const NodeReference& node) - { - m_observer->erase(node); - return *this; - } - TraversableObserverEraseOutputIterator& operator=(const NodeSmartReference& node) - { - m_observer->erase(node); - return *this; - } - TraversableObserverEraseOutputIterator& operator*() { return *this; } - TraversableObserverEraseOutputIterator& operator++() { return *this; } - TraversableObserverEraseOutputIterator& operator++(int) { return *this; } -}; -typedef UnsortedSet UnsortedNodeSet; - -/// \brief Calls \p observer->\c insert for each node that exists only in \p other and \p observer->\c erase for each node that exists only in \p self -inline void nodeset_diff(const UnsortedNodeSet& self, const UnsortedNodeSet& other, scene::Traversable::Observer* observer) -{ - std::vector sorted(self.begin(), self.end()); - std::vector other_sorted(other.begin(), other.end()); - - std::sort(sorted.begin(), sorted.end()); - std::sort(other_sorted.begin(), other_sorted.end()); - - std::set_difference(sorted.begin(), sorted.end(), other_sorted.begin(), other_sorted.end(), TraversableObserverEraseOutputIterator(observer)); - std::set_difference(other_sorted.begin(), other_sorted.end(), sorted.begin(), sorted.end(), TraversableObserverInsertOutputIterator(observer)); -} - -/// \brief A sequence of node references which notifies an observer of inserts and deletions, and uses the global undo system to provide undo for modifications. -class TraversableNodeSet : public scene::Traversable -{ - UnsortedNodeSet m_children; - UndoableObject m_undo; - Observer* m_observer; - - void copy(const TraversableNodeSet& other) - { - m_children = other.m_children; - } - void notifyInsertAll() - { - if(m_observer) - { - for(UnsortedNodeSet::iterator i = m_children.begin(); i != m_children.end(); ++i) - { - m_observer->insert(*i); - } - } - } - void notifyEraseAll() - { - if(m_observer) - { - for(UnsortedNodeSet::iterator i = m_children.begin(); i != m_children.end(); ++i) - { - m_observer->erase(*i); - } - } - } -public: - TraversableNodeSet() - : m_undo(*this), m_observer(0) - { - } - TraversableNodeSet(const TraversableNodeSet& other) - : scene::Traversable(other), m_undo(*this), m_observer(0) - { - copy(other); - notifyInsertAll(); - } - ~TraversableNodeSet() - { - notifyEraseAll(); - } - TraversableNodeSet& operator=(const TraversableNodeSet& other) - { -#if 1 // optimised change-tracking using diff algorithm - if(m_observer) - { - nodeset_diff(m_children, other.m_children, m_observer); - } - copy(other); -#else - TraversableNodeSet tmp(other); - tmp.swap(*this); -#endif - return *this; - } - void swap(TraversableNodeSet& other) - { - std::swap(m_children, other.m_children); - std::swap(m_observer, other.m_observer); - } - - void attach(Observer* observer) - { - ASSERT_MESSAGE(m_observer == 0, "TraversableNodeSet::attach: observer cannot be attached"); - m_observer = observer; - notifyInsertAll(); - } - void detach(Observer* observer) - { - ASSERT_MESSAGE(m_observer == observer, "TraversableNodeSet::detach: observer cannot be detached"); - notifyEraseAll(); - m_observer = 0; - } - /// \brief \copydoc scene::Traversable::insert() - void insert(scene::Node& node) - { - ASSERT_MESSAGE(&node != 0, "TraversableNodeSet::insert: sanity check failed"); - m_undo.save(); - - ASSERT_MESSAGE(m_children.find(NodeSmartReference(node)) == m_children.end(), "TraversableNodeSet::insert - element already exists"); - - m_children.insert(NodeSmartReference(node)); - - if(m_observer) - { - m_observer->insert(node); - } - } - /// \brief \copydoc scene::Traversable::erase() - void erase(scene::Node& node) - { - ASSERT_MESSAGE(&node != 0, "TraversableNodeSet::erase: sanity check failed"); - m_undo.save(); - - ASSERT_MESSAGE(m_children.find(NodeSmartReference(node)) != m_children.end(), "TraversableNodeSet::erase - failed to find element"); - - if(m_observer) - { - m_observer->erase(node); - } - - m_children.erase(NodeSmartReference(node)); - } - /// \brief \copydoc scene::Traversable::traverse() - void traverse(const Walker& walker) - { - UnsortedNodeSet::iterator i = m_children.begin(); - while(i != m_children.end()) - { - // post-increment the iterator - Node_traverseSubgraph(*i++, walker); - // the Walker can safely remove the current node from - // this container without invalidating the iterator - } - } - /// \brief \copydoc scene::Traversable::empty() - bool empty() const - { - return m_children.empty(); - } - - void instanceAttach(MapFile* map) - { - m_undo.instanceAttach(map); - } - void instanceDetach(MapFile* map) - { - m_undo.instanceDetach(map); - } -}; - -namespace std -{ - /// \brief Swaps the values of \p self and \p other. - /// Overloads std::swap. - inline void swap(TraversableNodeSet& self, TraversableNodeSet& other) - { - self.swap(other); - } -} - - -class TraversableNode : public scene::Traversable -{ -public: - TraversableNode() : m_node(0), m_observer(0) - { - } - - // traverse - void attach(Observer* observer) - { - ASSERT_MESSAGE(m_observer == 0, "TraversableNode::attach - cannot attach observer"); - m_observer = observer; - if(m_node != 0) - { - m_observer->insert(*m_node); - } - } - void detach(Observer* observer) - { - ASSERT_MESSAGE(m_observer == observer, "TraversableNode::detach - cannot detach observer"); - if(m_node != 0) - { - m_observer->erase(*m_node); - } - m_observer = 0; - } - void insert(scene::Node& node) - { - ASSERT_MESSAGE(m_node == 0, "TraversableNode::insert - element already exists"); - - m_node = &node; - node.IncRef(); - - if(m_observer != 0) - { - m_observer->insert(node); - } - } - void erase(scene::Node& node) - { - ASSERT_MESSAGE(m_node == &node, "TraversableNode::erase - failed to find element"); - - if(m_observer != 0) - { - m_observer->erase(node); - } - - m_node = 0; - node.DecRef(); - } - void traverse(const scene::Traversable::Walker& walker) - { - if(m_node != 0) - { - Node_traverseSubgraph(*m_node, walker); - } - } - bool empty() const - { - return m_node != 0; - } - - scene::Node& get() - { - return *m_node; - } - -private: - scene::Node* m_node; - Observer* m_observer; -}; - -class TraversableObserverInsert -{ - scene::Node& node; -public: - TraversableObserverInsert(scene::Node& node) : node(node) - { - } - void operator()(scene::Traversable::Observer& observer) const - { - observer.insert(node); - } -}; - -class TraversableObserverErase -{ - scene::Node& node; -public: - TraversableObserverErase(scene::Node& node) : node(node) - { - } - void operator()(scene::Traversable::Observer& observer) const - { - observer.erase(node); - } -}; - -class TraversableObserverPairRelay : public ReferencePair, public scene::Traversable::Observer -{ -public: - void insert(scene::Node& node) - { - forEach(TraversableObserverInsert(node)); - } - void erase(scene::Node& node) - { - forEach(TraversableObserverErase(node)); - } -}; - -template -class ReferenceSet -{ - typedef UniqueSet Values; - Values m_values; -public: - void attach(Type& t) - { - m_values.insert(&t); - } - void detach(Type& t) - { - m_values.erase(&t); - } - template - void forEach(const Functor& functor) - { - for(typename Values::iterator i = m_values.begin(); i != m_values.end(); ++i) - { - functor(*(*i)); - } - } -}; - -class TraversableObserverRelay : public ReferenceSet, public scene::Traversable::Observer -{ -public: - void insert(scene::Node& node) - { - forEach(TraversableObserverInsert(node)); - } - void erase(scene::Node& node) - { - forEach(TraversableObserverErase(node)); - } -}; - - -#endif diff --git a/libs/typesystem.cpp b/libs/typesystem.cpp deleted file mode 100644 index 2f4a476b..00000000 --- a/libs/typesystem.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "typesystem.h" - diff --git a/libs/typesystem.h b/libs/typesystem.h deleted file mode 100644 index f16d4199..00000000 --- a/libs/typesystem.h +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_TYPESYSTEM_H) -#define INCLUDED_TYPESYSTEM_H - - -#include -#include "generic/callback.h" -#include "generic/static.h" - -class InitialiserList -{ - typedef std::list Initialisers; - Initialisers m_initialisers; - mutable bool m_initialised; -public: - InitialiserList() : m_initialised(false) - { - } - void addInitialiser(const Callback& callback) - { - m_initialisers.push_back(callback); - } - void initialise() const - { - if(!m_initialised) - { - m_initialised = true; - - for(Initialisers::const_iterator i = m_initialisers.begin(); i != m_initialisers.end(); ++i) - { - (*i)(); - } - } - } -}; - -//--Type System------------------- - -class TypeSystemInitialiser : public InitialiserList -{ -}; - -typedef SmartStatic StaticTypeSystemInitialiser; - -class TypeSystemRef : public StaticTypeSystemInitialiser -{ -public: - TypeSystemRef() - { - StaticTypeSystemInitialiser::instance().initialise(); - } -}; - - - -typedef std::size_t TypeId; -typedef void*(*TypeCast)(void*); - -template -class TypeCastTable -{ - TypeCast m_casts[SIZE]; -public: - TypeCastTable() - { - std::uninitialized_fill(m_casts, m_casts + SIZE, TypeCast(0)); - } - void install(TypeId typeId, TypeCast typeCast) - { - m_casts[typeId] = typeCast; - } - void* cast(TypeId typeId, void* p) - { - TypeCast typeCast = m_casts[typeId]; - if(typeCast != 0) - { - return typeCast(p); - } - return 0; - } -}; - -template -class CastInstaller -{ -public: - static void install(TypeCastTable& table) - { - table.install(Type::getTypeId(), Cast::cast); - } -}; - -template -class IdentityCast -{ -public: - static void* cast(void* p) - { - return p; - } -}; - -template -class StaticCast -{ -public: - static void* cast(void* p) - { - return static_cast(reinterpret_cast(p)); - } -}; - -template -class NullType -{ -}; - -template -class ContainedCast -{ -public: - static void* cast(void* p) - { - return &reinterpret_cast(p)->get(NullType()); - } -}; - - -#endif diff --git a/libs/undolib.cpp b/libs/undolib.cpp deleted file mode 100644 index 25394998..00000000 --- a/libs/undolib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "undolib.h" diff --git a/libs/undolib.h b/libs/undolib.h deleted file mode 100644 index 5b118fa8..00000000 --- a/libs/undolib.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_UNDOLIB_H) -#define INCLUDED_UNDOLIB_H - -#include "iundo.h" -#include "mapfile.h" -#include "warnings.h" -#include "generic/callback.h" - -template -class BasicUndoMemento : public UndoMemento -{ - Copyable m_data; -public: - BasicUndoMemento(const Copyable& data) - : m_data(data) - { - } - - void release() - { - delete this; - } - - const Copyable& get() const - { - return m_data; - } -}; - - -template -class ObservedUndoableObject : public Undoable -{ - typedef Callback1 ImportCallback; - - Copyable& m_object; - ImportCallback m_importCallback; - UndoObserver* m_undoQueue; - MapFile* m_map; -public: - - ObservedUndoableObject(Copyable& object, const ImportCallback& importCallback) - : m_object(object), m_importCallback(importCallback), m_undoQueue(0), m_map(0) - { - } - ~ObservedUndoableObject() - { - } - - MapFile* map() - { - return m_map; - } - - void instanceAttach(MapFile* map) - { - m_map = map; - m_undoQueue = GlobalUndoSystem().observer(this); - } - void instanceDetach(MapFile* map) - { - m_map = 0; - m_undoQueue = 0; - GlobalUndoSystem().release(this); - } - - void save() - { - if(m_map != 0) - { - m_map->changed(); - } - if(m_undoQueue != 0) - { - m_undoQueue->save(this); - } - } - - UndoMemento* exportState() const - { - return new BasicUndoMemento(m_object); - } - void importState(const UndoMemento* state) - { - save(); - m_importCallback((static_cast*>(state))->get()); - } -}; - -template -class UndoableObject : public Undoable -{ - Copyable& m_object; - UndoObserver* m_undoQueue; - MapFile* m_map; - -public: - UndoableObject(Copyable& object) - : m_object(object), m_undoQueue(0), m_map(0) - {} - ~UndoableObject() - { - } - - void instanceAttach(MapFile* map) - { - m_map = map; - m_undoQueue = GlobalUndoSystem().observer(this); - } - void instanceDetach(MapFile* map) - { - m_map = 0; - m_undoQueue = 0; - GlobalUndoSystem().release(this); - } - - void save() - { - if(m_map != 0) - { - m_map->changed(); - } - if(m_undoQueue != 0) - { - m_undoQueue->save(this); - } - } - - UndoMemento* exportState() const - { - return new BasicUndoMemento(m_object); - } - void importState(const UndoMemento* state) - { - save(); - m_object = (static_cast*>(state))->get(); - } -}; - -#endif diff --git a/libs/uniquenames.cpp b/libs/uniquenames.cpp deleted file mode 100644 index 5e664c0d..00000000 --- a/libs/uniquenames.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "uniquenames.h" - diff --git a/libs/uniquenames.h b/libs/uniquenames.h deleted file mode 100644 index 868336d3..00000000 --- a/libs/uniquenames.h +++ /dev/null @@ -1,335 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_UNIQUENAMES_H) -#define INCLUDED_UNIQUENAMES_H - -#include "debugging/debugging.h" -#include -#include "string/string.h" -#include "generic/static.h" - -#if 1 -class Postfix -{ - unsigned int m_value; -public: - Postfix(const char* postfix) : m_value(atoi(postfix)) - { - } - unsigned int number() const - { - return m_value; - } - void write(char* buffer) - { - sprintf(buffer, "%u", m_value); - } - Postfix& operator++() - { - ++m_value; - return *this; - } - bool operator<(const Postfix& other) const - { - return m_value < other.m_value; - } - bool operator==(const Postfix& other) const - { - return m_value == other.m_value; - } - bool operator!=(const Postfix& other) const - { - return !operator==(other); - } -}; - -#else -class Postfix -{ - std::pair m_value; -public: - Postfix(unsigned int number, unsigned int leading_zeros) - : m_value(leading_zeros, number) - { - } - Postfix(const char* postfix) - : m_value(number_count_leading_zeros(postfix), atoi(postfix)) - { - } - unsigned int number() const - { - return m_value.second; - } - unsigned int leading_zeros() const - { - return m_value.first; - } - void write(char* buffer) - { - for(unsigned int count = 0; count < m_value.first; ++count, ++buffer) - *buffer = '0'; - sprintf(buffer, "%u", m_value.second); - } - Postfix& operator++() - { - ++m_value.second; - if(m_value.first != 0 && m_value.second % 10 == 0) - --m_value.first; - return *this; - } - bool operator<(const Postfix& other) const - { - return m_value < other.m_value; - } - bool operator==(const Postfix& other) const - { - return m_value == other.m_value; - } - bool operator!=(const Postfix& other) const - { - return !operator==(other); - } -}; - -#endif - -typedef std::pair name_t; - -inline void name_write(char* buffer, name_t name) -{ - strcpy(buffer, name.first.c_str()); - name.second.write(buffer + strlen(name.first.c_str())); -} - -inline name_t name_read(const char* name) -{ - const char* end = name + strlen(name); - for(const char* p = end; end != name; --p) - { - if(strrchr("1234567890", *p) == NULL) - break; - end = p; - } - - return name_t(CopiedString(StringRange(name, end)), Postfix(end)); -} - - -class PostFixes -{ - typedef std::map postfixes_t; - postfixes_t m_postfixes; - - Postfix find_first_empty() const - { - Postfix postfix("1"); - for(postfixes_t::const_iterator i = m_postfixes.find(postfix); i != m_postfixes.end(); ++i, ++postfix) - { - if((*i).first != postfix) - { - break; - } - } - return postfix; - } - -public: - Postfix make_unique(Postfix postfix) const - { - postfixes_t::const_iterator i = m_postfixes.find(postfix); - if(i == m_postfixes.end()) - { - return postfix; - } - else - { - return find_first_empty(); - } - } - - void insert(Postfix postfix) - { - postfixes_t::iterator i = m_postfixes.find(postfix); - if(i == m_postfixes.end()) - { - m_postfixes.insert(postfixes_t::value_type(postfix, 1)); - } - else - { - ++(*i).second; - } - } - - void erase(Postfix postfix) - { - postfixes_t::iterator i = m_postfixes.find(postfix); - if(i == m_postfixes.end()) - { - // error - } - else - { - if(--(*i).second == 0) - m_postfixes.erase(i); - } - } - - bool empty() const - { - return m_postfixes.empty(); - } -}; - - -class UniqueNames -{ - typedef std::map names_t; - names_t m_names; -public: - name_t make_unique(const name_t& name) const - { - names_t::const_iterator i = m_names.find(name.first); - if(i == m_names.end()) - { - return name; - } - else - { - return name_t(name.first, (*i).second.make_unique(name.second)); - } - } - - void insert(const name_t& name) - { - m_names[name.first].insert(name.second); - } - - void erase(const name_t& name) - { - names_t::iterator i = m_names.find(name.first); - if(i == m_names.end()) - { - ASSERT_MESSAGE(true, "erase: name not found"); - } - else - { - (*i).second.erase(name.second); - if((*i).second.empty()) - m_names.erase(i); - } - } - - bool empty() const - { - return m_names.empty(); - } -}; - - - -#if 0 - -#undef ERROR_MESSAGE -#define ERROR_MESSAGE(message) - -class TestUniqueName -{ - void name_check_equal(const name_t& name, const char* string, unsigned int postfix) - { - ASSERT_MESSAGE(strcmp(name.first.c_str(), string) == 0 - && name.second.number() == postfix, - "test failed!"); - } - void test_refcount() - { - Names names; - - names.insert(name_t("func_bleh_", "100")); - names.insert(name_t("func_bleh_", "100")); - names.insert(name_t("func_bleh_", "100")); - - - names.erase(name_t("func_bleh_", "100")); - names.erase(name_t("func_bleh_", "100")); - names.erase(name_t("func_bleh_", "100")); - - ASSERT_MESSAGE(names.empty(), "test failed!"); - } - - void test_make_unique() - { - Names names; - - { - name_t name(names.make_unique(name_t("func_bleh_", "01"))); - name_check_equal(name, "func_bleh_", 1); - names.insert(name); - } - { - name_t name(names.make_unique(name_t("func_bleh_", "04"))); - name_check_equal(name, "func_bleh_", 4); - names.insert(name); - } - { - name_t name(names.make_unique(name_t("func_bleh_", "04"))); - name_check_equal(name, "func_bleh_", 2); - names.insert(name); - } - { - name_t name(names.make_unique(name_t("func_bleh_", "1"))); - name_check_equal(name, "func_bleh_", 3); - names.insert(name); - } - { - name_t name(names.make_unique(name_t("func_bleh_", "2"))); - name_check_equal(name, "func_bleh_", 5); - names.insert(name); - } - { - name_t name(names.make_unique(name_t("func_bleh_", "3"))); - name_check_equal(name, "func_bleh_", 6); - names.insert(name); - } - - names.erase(name_t("func_bleh_", "1")); - names.erase(name_t("func_bleh_", "2")); - names.erase(name_t("func_bleh_", "3")); - names.erase(name_t("func_bleh_", "4")); - names.erase(name_t("func_bleh_", "5")); - names.erase(name_t("func_bleh_", "6")); - - ASSERT_MESSAGE(names.empty(), "test failed!"); - } -public: - TestUniqueName() - { - test_refcount(); - test_make_unique(); - } -}; - -const TestUniqueName g_testuniquename; - -#endif - - -#endif diff --git a/libs/versionlib.cpp b/libs/versionlib.cpp deleted file mode 100644 index 9871b771..00000000 --- a/libs/versionlib.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "versionlib.h" - diff --git a/libs/versionlib.h b/libs/versionlib.h deleted file mode 100644 index 368e5de6..00000000 --- a/libs/versionlib.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_VERSIONLIB_H) -#define INCLUDED_VERSIONLIB_H - -#include -#include -#include - -class Version -{ -public: - int major; - int minor; -}; - -inline bool operator<(const Version& version, const Version& other) -{ - return version.major < other.major || (!(other.major < version.major) && version.minor < other.minor); -} - -template -TextOutputStreamType& ostream_write(TextOutputStreamType& outputStream, const Version& version) -{ - return outputStream << version.major << '.' << version.minor; -} - -/// \brief Returns true if \p version (code) is compatible with \p other (data). -inline bool version_compatible(const Version& version, const Version& other) -{ - return version.major == other.major // different major-versions are always incompatible - && !(version.minor < other.minor); // data minor-version is incompatible if greater than code minor-version -} - -inline int string_range_parse_unsigned_decimal_integer(const char* first, const char* last) -{ - int result = 0; - for(; first != last; ++first) - { - result *= 10; - result += *first - '0'; - } - return result; -} - -inline Version version_parse(const char* versionString) -{ - Version version; - const char* endVersion = versionString + strlen(versionString); - - const char* endMajor = strchr(versionString, '.'); - if(endMajor == 0) - { - endMajor = endVersion; - - version.minor = 0; - } - else - { - const char* endMinor = strchr(endMajor + 1, '.'); - if(endMinor == 0) - { - endMinor = endVersion; - } - version.minor = string_range_parse_unsigned_decimal_integer(endMajor + 1, endMinor); - } - version.major = string_range_parse_unsigned_decimal_integer(versionString, endMajor); - - return version; -} - -#endif diff --git a/libs/xml/ixml.cpp b/libs/xml/ixml.cpp deleted file mode 100644 index e22ad307..00000000 --- a/libs/xml/ixml.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ixml.h" diff --git a/libs/xml/ixml.h b/libs/xml/ixml.h deleted file mode 100644 index 73dc83c5..00000000 --- a/libs/xml/ixml.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XML_IXML_H) -#define INCLUDED_XML_IXML_H - -#include "itextstream.h" -#include "generic/constant.h" - -class XMLAttrVisitor -{ -public: - virtual void visit(const char* name, const char* value) = 0; -}; - -class XMLElement -{ -public: - virtual const char* name() const = 0; - virtual const char* attribute(const char* name) const = 0; - virtual void forEachAttribute(XMLAttrVisitor& visitor) const = 0; -}; - -class XMLImporter : public TextOutputStream -{ -public: - STRING_CONSTANT(Name, "XMLImporter"); - - virtual void pushElement(const XMLElement& element) = 0; - virtual void popElement(const char* name) = 0; -}; - -class XMLExporter -{ -public: - STRING_CONSTANT(Name, "XMLExporter"); - - virtual void exportXML(XMLImporter& importer) = 0; -}; - - -#endif diff --git a/libs/xml/xmlelement.cpp b/libs/xml/xmlelement.cpp deleted file mode 100644 index 97ebb374..00000000 --- a/libs/xml/xmlelement.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xmlelement.h" diff --git a/libs/xml/xmlelement.h b/libs/xml/xmlelement.h deleted file mode 100644 index 26200253..00000000 --- a/libs/xml/xmlelement.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XML_XMLELEMENT_H) -#define INCLUDED_XML_XMLELEMENT_H - -#include "xml/ixml.h" -#include "string/string.h" - -#include - -///\brief All string pointers passed to an instance of this class are not -/// copied and must stay valid for the lifetime of the instance. -class StaticElement : public XMLElement -{ - typedef std::map attrs_t; -public: - StaticElement(const char* name) - : m_name(name) - { - } - void insertAttribute(const char* name, const char* value) - { - m_attrs.insert(attrs_t::value_type(name, value)); - } - const char* name() const - { - return m_name; - } - const char* attribute(const char* name) const - { - attrs_t::const_iterator i = m_attrs.find(name); - if(i != m_attrs.end()) - return i->second; - else - return ""; - } - void forEachAttribute(XMLAttrVisitor& visitor) const - { - for(attrs_t::const_iterator i = m_attrs.begin(); i != m_attrs.end(); ++i) - { - visitor.visit(i->first, i->second); - } - } -private: - const char* m_name; - attrs_t m_attrs; -}; - -///\brief All string pointers passed to an instance of this class are copied. -class DynamicElement : public XMLElement -{ - typedef std::map attrs_t; -public: - DynamicElement(const char* name) - : m_name(name) - { - } - void insertAttribute(const char* name, const char* value) - { - m_attrs.insert(attrs_t::value_type(name, value)); - } - const char* name() const - { - return m_name.c_str(); - } - const char* attribute(const char* name) const - { - attrs_t::const_iterator i = m_attrs.find(name); - if(i != m_attrs.end()) - return i->second.c_str(); - else - return ""; - } - void forEachAttribute(XMLAttrVisitor& visitor) const - { - for(attrs_t::const_iterator i = m_attrs.begin(); i != m_attrs.end(); ++i) - { - visitor.visit(i->first.c_str(), i->second.c_str()); - } - } -private: - CopiedString m_name; - attrs_t m_attrs; -}; - -#endif diff --git a/libs/xml/xmlparser.cpp b/libs/xml/xmlparser.cpp deleted file mode 100644 index b6829e7d..00000000 --- a/libs/xml/xmlparser.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xmlparser.h" diff --git a/libs/xml/xmlparser.h b/libs/xml/xmlparser.h deleted file mode 100644 index bea4557a..00000000 --- a/libs/xml/xmlparser.h +++ /dev/null @@ -1,242 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XML_XMLPARSER_H) -#define INCLUDED_XML_XMLPARSER_H - -#include -#include -#include "ixml.h" -#include "libxml/parser.h" -#include "convert.h" - -class TextInputStream; - -class SAXElement : public XMLElement -{ -public: - SAXElement(const char* name, const char** atts) - : m_name(name), m_atts(atts) - { - } - const char* name() const - { - return m_name; - } - const char* attribute(const char* name) const - { - if(m_atts != 0) - { - for(const char** att = m_atts; *att != 0; att+=2) - { - if(strcmp(*att, name) == 0) - { - return *(++att); - } - } - } - return ""; - } - void forEachAttribute(XMLAttrVisitor& visitor) const - { - if(m_atts != 0) - { - for(const char** att = m_atts; *att != 0; att+=2) - { - visitor.visit(*att, *(att+1)); - } - } - } -private: - const char* m_name; - const char** m_atts; -}; - -#include - -class FormattedVA -{ -public: - const char* m_format; - va_list& m_arguments; - FormattedVA(const char* format, va_list& m_arguments) - : m_format(format), m_arguments(m_arguments) - { - } -}; - -class Formatted -{ -public: - const char* m_format; - va_list m_arguments; - Formatted(const char* format, ...) - : m_format(format) - { - va_start(m_arguments, format); - } - ~Formatted() - { - va_end(m_arguments); - } -}; - -#ifdef WIN32 -#if _MSC_VER < 1400 -#define vsnprintf std::vsnprintf -#endif -#endif - -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const FormattedVA& formatted) -{ - char buffer[1024]; - ostream.write(buffer, vsnprintf(buffer, 1023, formatted.m_format, formatted.m_arguments)); - return ostream; -} - -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Formatted& formatted) -{ - char buffer[1024]; - ostream.write(buffer, vsnprintf(buffer, 1023, formatted.m_format, formatted.m_arguments)); - return ostream; -} - -class XMLSAXImporter -{ - XMLImporter& m_importer; - xmlSAXHandler m_sax; - - static void startElement(void *user_data, const xmlChar *name, const xmlChar **atts) - { - SAXElement element(reinterpret_cast(name), reinterpret_cast(atts)); - reinterpret_cast(user_data)->m_importer.pushElement(element); - } - static void endElement(void *user_data, const xmlChar *name) - { - reinterpret_cast(user_data)->m_importer.popElement(reinterpret_cast(name)); - } - static void characters(void *user_data, const xmlChar *ch, int len) - { - reinterpret_cast(user_data)->m_importer - << ConvertUTF8ToLocale(StringRange(reinterpret_cast(ch), reinterpret_cast(ch + len))); - } - - static void warning(void *user_data, const char *msg, ...) - { - va_list args; - va_start(args, msg); - globalErrorStream() << "XML WARNING: " << FormattedVA(msg, args); - va_end(args); - } - static void error(void *user_data, const char *msg, ...) - { - va_list args; - va_start(args, msg); - globalErrorStream() << "XML ERROR: " << FormattedVA(msg, args); - va_end(args); - } - -public: - XMLSAXImporter(XMLImporter& importer) : m_importer(importer) - { - m_sax.internalSubset = 0; - m_sax.isStandalone = 0; - m_sax.hasInternalSubset = 0; - m_sax.hasExternalSubset = 0; - m_sax.resolveEntity = 0; - m_sax.getEntity = 0; - m_sax.entityDecl = 0; - m_sax.notationDecl = 0; - m_sax.attributeDecl = 0; - m_sax.elementDecl = 0; - m_sax.unparsedEntityDecl = 0; - m_sax.setDocumentLocator = 0; - m_sax.startDocument = 0; - m_sax.endDocument = 0; - m_sax.startElement = startElement; - m_sax.endElement = endElement; - m_sax.reference = 0; - m_sax.characters = characters; - m_sax.ignorableWhitespace = 0; - m_sax.processingInstruction = 0; - m_sax.comment = 0; - m_sax.warning = warning; - m_sax.error = error; - m_sax.fatalError = 0; - m_sax.getParameterEntity = 0; - m_sax.cdataBlock = 0; - m_sax.externalSubset = 0; - m_sax.initialized = 1; - } - - xmlSAXHandler* callbacks() - { - return &m_sax; - } - void* context() - { - return this; - } -}; - -class XMLStreamParser : public XMLExporter -{ - enum unnamed0 { BUFSIZE = 1024 }; -public: - XMLStreamParser(TextInputStream& istream) - : m_istream(istream) - { - } - virtual void exportXML(XMLImporter& importer) - { - bool wellFormed = false; - - char chars[BUFSIZE]; - std::size_t res = m_istream.read(chars, 4); - if (res > 0) - { - XMLSAXImporter sax(importer); - - xmlParserCtxtPtr ctxt = xmlCreatePushParserCtxt(sax.callbacks(), sax.context(), chars, static_cast(res), 0); - ctxt->replaceEntities = 1; - - while ((res = m_istream.read(chars, BUFSIZE)) > 0) - { - xmlParseChunk(ctxt, chars, static_cast(res), 0); - } - xmlParseChunk(ctxt, chars, 0, 1); - - wellFormed = (ctxt->wellFormed == 1); - - xmlFreeParserCtxt(ctxt); - } - - //return wellFormed; - } -private: - TextInputStream& m_istream; -}; - - - -#endif diff --git a/libs/xml/xmltextags.cpp b/libs/xml/xmltextags.cpp deleted file mode 100644 index 4ab2c6c3..00000000 --- a/libs/xml/xmltextags.cpp +++ /dev/null @@ -1,597 +0,0 @@ -/* -Copyright (C) 2006, Stefan Greven. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xmltextags.h" - -#include - -#include "qerplugin.h" -#include "stream/stringstream.h" - -XmlTagBuilder::XmlTagBuilder() -{ -} - -XmlTagBuilder::~XmlTagBuilder() -{ - // clean up - xmlFreeDoc(doc); - xmlXPathFreeContext(context); -} - -bool XmlTagBuilder::CreateXmlDocument() -{ - /* Creates an XML file - - returns TRUE if the file was created successfully or FALSE when failed - */ - - xmlTextWriterPtr writer; - - writer = xmlNewTextWriterDoc(&doc, 0); - - // begin a new UTF-8 formatted xml document - xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL); - - // create the root node with stock and custom elements - xmlTextWriterStartElement(writer, (xmlChar*)"root"); - xmlTextWriterWriteString(writer, (xmlChar*)"\n "); - xmlTextWriterStartElement(writer, (xmlChar*)"stock"); - xmlTextWriterWriteString(writer, (xmlChar*)"\n "); - xmlTextWriterEndElement(writer); - xmlTextWriterWriteString(writer, (xmlChar*)"\n "); - xmlTextWriterStartElement(writer, (xmlChar*)"custom"); - xmlTextWriterWriteString(writer, (xmlChar*)"\n "); - xmlTextWriterEndElement(writer); - xmlTextWriterWriteString(writer, (xmlChar*)"\n"); - xmlTextWriterEndElement(writer); - - // end of the xml document - xmlTextWriterEndDocument(writer); - xmlFreeTextWriter(writer); - - if(!doc) - { - return false; - } else { - context = xmlXPathNewContext(doc); - return true; - } -} - -bool XmlTagBuilder::OpenXmlDoc(const char* file, const char* savefile) -{ - /* Reads a XML document from a file - - returns TRUE if the document was read successfully or FALSE when failed - */ - - if(savefile) - m_savefilename = savefile; - else - m_savefilename = file; - - doc = xmlParseFile(file); // TODO error checking! - - if(!doc) - { - return false; - } else { - context = xmlXPathNewContext(doc); - return true; - } -} - -bool XmlTagBuilder::SaveXmlDoc(void) -{ - return SaveXmlDoc(m_savefilename.c_str()); -} - -bool XmlTagBuilder::SaveXmlDoc(const char* file) -{ - /* Writes the XML document - - returns TRUE if the document was saved successfully or FALSE when saving failed - */ - - xmlSaveNoEmptyTags = 1; - - if(xmlSaveFile(file, doc) != -1) - { - return true; - } - return false; -} - -bool XmlTagBuilder::AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType) -{ - /* Adds a shader node - - char* shader - the name of the shader or texture (without trailing .tga or something) - - returns TRUE if the node was added successfully or FALSE when failed - */ - - xmlNodeSetPtr nodePtr = NULL; - xmlXPathObjectPtr xpathPtr = NULL; - - switch(textureType) - { - case STOCK: - xpathPtr = XpathEval("/root/stock"); - break; - case CUSTOM: - xpathPtr = XpathEval("/root/custom"); - }; - - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlNodePtr newnode, newtext; - xmlNodePtr nodeParent = nodePtr->nodeTab[0]; - - // create a new node and set the node attribute (shader path) - switch(nodeShaderType) - { - case SHADER: - newnode = xmlNewNode(NULL, (xmlChar*)"shader"); - break; - case TEXTURE: - newnode = xmlNewNode(NULL, (xmlChar*)"texture"); - }; - - newnode = xmlDocCopyNode(newnode, doc, 1); - xmlSetProp(newnode, (xmlChar*)"path", (xmlChar*)shader); - xmlNodeSetContent(newnode, (xmlChar*)"\n "); - - if(nodePtr->nodeTab[0]->children->next == NULL) // there are no shaders yet - { - // add spaces - newtext = xmlNewText((xmlChar*)" "); - xmlAddChild(nodeParent->children, newtext); - - // add the new node - xmlAddNextSibling(nodeParent->children, newnode); - - // append a new line - newtext = xmlNewText((xmlChar*)"\n "); - xmlAddNextSibling(nodeParent->children->next, newtext); - } else { - // add the node - xmlAddNextSibling(nodeParent->children, newnode); - - // append a new line and spaces - newtext = xmlNewText((xmlChar*)"\n "); - xmlAddNextSibling(nodeParent->children->next, newtext); - } - - xmlXPathFreeObject(xpathPtr); - return true; - } else { - xmlXPathFreeObject(xpathPtr); - return false; - } -} - -bool XmlTagBuilder::DeleteShaderNode(const char* shader) -{ - /* Deletes a shader node - - char* shader - the name of the shader or texture (without trailing .tga or something) - - returns TRUE if the node was deleted successfully or FALSE when failed - */ - - char buffer[256]; - char* expression = GetTagsXpathExpression(buffer, shader, EMPTY); - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlNodePtr ptrContent = nodePtr->nodeTab[0]; - xmlNodePtr ptrWhitespace = nodePtr->nodeTab[0]->prev; - - // delete the node - xmlUnlinkNode(ptrContent); - xmlFreeNode(ptrContent); - - // delete leading whitespace node - xmlUnlinkNode(ptrWhitespace); - xmlFreeNode(ptrWhitespace); - xmlXPathFreeObject(xpathPtr); - return true; - } - xmlXPathFreeObject(xpathPtr); - return false; -} - -bool XmlTagBuilder::CheckShaderTag(const char* shader) -{ - /* Checks whether there exists an entry for a shader/texture with at least one tag - - char* shader - the name of the shader or texture (without trailing .tga or something) - - returns TRUE if the shader is already stored in the XML tag file and has at least one tag - */ - - // build the XPath expression to search for - char buffer[256]; - strcpy(buffer, "/root/*/*[@path='"); - strcat(buffer, shader); - strcat(buffer, "']"); - - char* expression = buffer; - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlXPathFreeObject(xpathPtr); - return true; - } else { - xmlXPathFreeObject(xpathPtr); - return false; - } -} - -bool XmlTagBuilder::CheckShaderTag(const char* shader, const char* content) -{ - /* Checks whether a tag with content already exists - - char* shader - the name of the shader or texture (without trailing .tga or something) - char* content - the node content (a tag name) - - returns TRUE if the tag with content already exists or FALSE if not - */ - - // build the XPath expression to search for - // example expression: "/stock/*[@path='textures/alpha/barb_wire'][child::tag='Alpha']"; - - char buffer[256]; - strcpy(buffer, "/root/*/*[@path='"); - strcat(buffer, shader); - strcat(buffer, "'][child::tag='"); - strcat(buffer, content); - strcat(buffer, "']"); - - char* expression = buffer; - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlXPathFreeObject(xpathPtr); - return true; - } else { - xmlXPathFreeObject(xpathPtr); - return false; - } -} - -bool XmlTagBuilder::AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType) -{ - /* Adds a tag node to an existing shader/texture node if there's no tag with the same content yet - - char* shader - the name of the shader or texture (without trailing .tga or something) - char* content - the node content (a tag name) - - returns TRUE if the node was added successfully or FALSE when failed - */ - - // build the XPath expression - char buffer[256]; - char* expression = GetTagsXpathExpression(buffer, shader, EMPTY); - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) // node was found - { - xmlNodePtr newnode = xmlNewNode(NULL, (xmlChar*)"tag"); - xmlNodePtr nodeParent = nodePtr->nodeTab[0]; - newnode = xmlDocCopyNode(newnode, doc, 1); - xmlNodeSetContent(newnode, (xmlChar*)content); - - if(nodePtr->nodeTab[0]->children->next == NULL) // shader node has NO children - { - // add spaces - xmlNodePtr newtext = xmlNewText((xmlChar*)" "); - xmlAddChild(nodeParent->children, newtext); - - // add new node - xmlAddNextSibling(nodeParent->children, newnode); - - // append a new line + spaces - newtext = xmlNewText((xmlChar*)"\n "); - xmlAddNextSibling(nodeParent->children->next, newtext); - } else { // shader node has children already - the new node will be the first sibling - xmlAddNextSibling(nodeParent->children, newnode); - xmlNodePtr newtext = xmlNewText((xmlChar*)"\n "); - xmlAddNextSibling(nodeParent->children->next, newtext); - } - xmlXPathFreeObject(xpathPtr); - return true; - } else { - xmlXPathFreeObject(xpathPtr); - return false; - } -} - -//int XmlTagBuilder::RenameShaderTag(const char* oldtag, const char* newtag) -int XmlTagBuilder::RenameShaderTag(const char* oldtag, CopiedString newtag) -{ - /* Replaces tag node contents - - char* oldtag - the node content that sould be changed - char* newtag - the new node content - - returns the number of renamed shaders - */ - - int num = 0; - - // build the XPath expression - char expression[256]; - strcpy(expression, "/root/*/*[child::tag='"); - strcat(expression, oldtag); - strcat(expression, "']/*"); - - xmlXPathObjectPtr result = xmlXPathEvalExpression((xmlChar*)expression, context); - if(!result) - return 0; - xmlNodeSetPtr nodePtr = result->nodesetval; - - for(int i = 0; i < nodePtr->nodeNr; i++) - { - xmlNodePtr ptrContent = nodePtr->nodeTab[i]; - char* content = (char*)xmlNodeGetContent(ptrContent); - - if(strcmp(content, oldtag) == 0) // found a node with old content? - { - xmlNodeSetContent(ptrContent, (xmlChar*)newtag.c_str()); - num++; - } - } - - SaveXmlDoc(); - xmlXPathFreeObject(result);// CHANGED - return num; -} - -bool XmlTagBuilder::DeleteShaderTag(const char* shader, const char* tag) -{ - /* Deletes a child node of a shader - - char* shader - the name of the shader or texture (without trailing .tga or something) - char* tag - the tag being deleted - - returns TRUE if the node was deleted successfully or FALSE when failed - */ - - char buffer[256]; - char* expression = GetTagsXpathExpression(buffer, shader, TAG); - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return false; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - for(int i = 0; i < nodePtr->nodeNr; i++) - { - xmlNodePtr ptrContent = nodePtr->nodeTab[i]; - char* content = (char*)(xmlChar*)xmlNodeGetContent(ptrContent); - - if(strcmp(content, tag) == 0) // find the node - { - xmlNodePtr ptrWhitespace = nodePtr->nodeTab[i]->prev; - // delete the node - xmlUnlinkNode(ptrContent); - xmlFreeNode(ptrContent); - - // delete leading whitespace node - xmlUnlinkNode(ptrWhitespace); - xmlFreeNode(ptrWhitespace); - xmlXPathFreeObject(xpathPtr); - return true; - } - } - } - xmlXPathFreeObject(xpathPtr); - return false; -} - -bool XmlTagBuilder::DeleteTag(const char* tag) -{ - /* Deletes a tag from all shaders - - char* tag - the tag being deleted from all shaders - - returns TRUE if the tag was deleted successfully or FALSE when failed - */ - - char expression[256]; - strcpy(expression, "/root/*/*[child::tag='"); - strcat(expression, tag); - strcat(expression, "']"); - - std::set dellist; - TagSearch(expression, dellist); - std::set::iterator iter; - - for(iter = dellist.begin(); iter != dellist.end(); iter++) - { - DeleteShaderTag(iter->c_str(), tag); - } - SaveXmlDoc(); - - return true; -} - -void XmlTagBuilder::GetShaderTags(const char* shader, std::vector& tags) -{ - /* Gets the tags from a shader - - char* shader - the name of the shader - - returns a vector containing the tags - */ - - char* expression; - - if(shader == NULL) // get all tags from all shaders - { - expression = "/root/*/*/tag"; - } else { - char buffer[256]; - expression = GetTagsXpathExpression(buffer, shader, TAG); - } - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - for(int i = 0; i < nodePtr->nodeNr; i++) - { - tags.push_back((CopiedString)(char*)xmlNodeGetContent(nodePtr->nodeTab[i])); - } - } - xmlXPathFreeObject(xpathPtr); -} - -void XmlTagBuilder::GetUntagged(std::set& shaders) -{ - /* Gets all textures and shaders listed in the xml file that don't have any tag - - returns a set containing the shaders (with path) - */ - - char* expression = "/root/*/*[not(child::tag)]"; - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlNodePtr ptr; - - for(int i = 0; i < nodePtr->nodeNr; i++) - { - ptr = nodePtr->nodeTab[i]; - shaders.insert((char*)xmlGetProp(ptr, (xmlChar*)"path")); - } - } - - xmlXPathFreeObject(xpathPtr); -} - -void XmlTagBuilder::GetAllTags(std::set& tags) -{ - /* Gets a list of all tags that are used (assigned to any shader) - - returns a set containing all used tags - */ - - char* expression = "/root/*/*/tag"; - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - for(int i = 0; i < nodePtr->nodeNr; i++) - { - tags.insert((CopiedString)(char*)xmlNodeGetContent(nodePtr->nodeTab[i])); - } - } - - xmlXPathFreeObject(xpathPtr); -} - -void XmlTagBuilder::TagSearch(const char* expression, std::set& paths) -{ - /* Searches shaders by tags - - char* expression - the XPath expression to search - - returns a set containing the found shaders - */ - - xmlXPathObjectPtr xpathPtr = XpathEval(expression); - xmlNodeSetPtr nodePtr; - if(xpathPtr) - nodePtr = xpathPtr->nodesetval; - else - return; - - if(!xmlXPathNodeSetIsEmpty(nodePtr)) - { - xmlNodePtr ptr; - xmlChar* xmlattrib; - for(int i = 0; i < nodePtr->nodeNr; i++) - { - ptr = nodePtr->nodeTab[i]; - xmlattrib = xmlGetProp(ptr, (xmlChar*)"path"); - paths.insert((CopiedString)(char*)xmlattrib); - } - } - xmlXPathFreeObject(xpathPtr); -} - diff --git a/libs/xml/xmltextags.h b/libs/xml/xmltextags.h deleted file mode 100644 index 047fbd70..00000000 --- a/libs/xml/xmltextags.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright (C) 2006, Stefan Greven. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XMLTEXTAGS_H) -#define INCLUDED_XMLTEXTAGS_H - -#include -#include -#include - -#include "iscriplib.h" - -#include -#include - -enum NodeTagType -{ - TAG, - EMPTY -}; - -enum NodeShaderType -{ - SHADER, - TEXTURE -}; - -enum TextureType -{ - STOCK, - CUSTOM -}; - -class XmlTagBuilder -{ -private: - CopiedString m_savefilename; - xmlDocPtr doc; - xmlXPathContextPtr context; - xmlNodeSetPtr nodePtr; - - xmlXPathObjectPtr XpathEval(const char* queryString) - { - xmlChar* expression = (xmlChar*)queryString; - xmlXPathObjectPtr result = xmlXPathEvalExpression(expression, context); - return result; - }; - - char* GetTagsXpathExpression(char* buffer, const char* shader, NodeTagType nodeTagType) - { - strcpy(buffer, "/root/*/*[@path='"); - strcat(buffer, shader); - - switch(nodeTagType) - { - case TAG: - strcat(buffer, "']/tag"); - break; - case EMPTY: - strcat(buffer, "']"); - }; - - return buffer; - } - -public: - XmlTagBuilder(); - ~XmlTagBuilder(); - - bool CreateXmlDocument(); - bool OpenXmlDoc(const char* file, const char* savefile = 0); - bool SaveXmlDoc(const char* file); - bool SaveXmlDoc(void); - bool AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType); - bool DeleteShaderNode(const char* shader); - bool CheckShaderTag(const char* shader); - bool CheckShaderTag(const char* shader, const char* content); - bool AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType); - bool DeleteTag(const char* tag); - int RenameShaderTag(const char* oldtag, CopiedString newtag); - bool DeleteShaderTag(const char* shader, const char* tag); - void GetShaderTags(const char* shader, std::vector& tags); - void GetUntagged(std::set& shaders); - void GetAllTags(std::set& tags); - void TagSearch(const char* expression, std::set& paths); -}; - -#endif diff --git a/libs/xml/xmlwriter.cpp b/libs/xml/xmlwriter.cpp deleted file mode 100644 index b060ef2c..00000000 --- a/libs/xml/xmlwriter.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "xmlwriter.h" diff --git a/libs/xml/xmlwriter.h b/libs/xml/xmlwriter.h deleted file mode 100644 index 85e49d45..00000000 --- a/libs/xml/xmlwriter.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XML_XMLWRITER_H) -#define INCLUDED_XML_XMLWRITER_H - -#include "convert.h" -#include -#include "xml/ixml.h" - -class XMLEntityOutputStream -{ - SingleCharacterOutputStream m_ostream; -public: - XMLEntityOutputStream(TextOutputStream& ostream) - : m_ostream(ostream) - { - } - void write(const char c) - { - m_ostream.write(c); - } - void writeEscaped(const char c) - { - switch(c) - { - case '<': - write('&'); - write('l'); - write('t'); - write(';'); - break; - case '>': - write('&'); - write('g'); - write('t'); - write(';'); - break; - case '"': - write('&'); - write('q'); - write('u'); - write('o'); - write('t'); - write(';'); - break; - case '&': - write('&'); - write('a'); - write('m'); - write('p'); - write(';'); - break; - default: - write(c); - break; - } - } - std::size_t write(const char* buffer, std::size_t length) - { - const char*const end = buffer + length; - for(const char* p = buffer; p != end; ++p) - { - writeEscaped(*p); - } - return length; - } -}; - -template -inline XMLEntityOutputStream& operator<<(XMLEntityOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -class XMLStreamWriter : public XMLImporter, public XMLAttrVisitor -{ - class state_t - { - public: - enum EState - { - eStartElement, - eContent, - }; - state_t() - : m_state(eStartElement) - {} - EState m_state; - }; - - XMLEntityOutputStream m_ostream; - std::vector m_elements; - - void write_cdata(const char* buffer, std::size_t length) - { - m_ostream << ConvertLocaleToUTF8(StringRange(buffer, buffer + length)); - } - void write_string(const char* string) - { - m_ostream << string; - } - void write_quoted_string(const char* string) - { - m_ostream.write('"'); - m_ostream << string; - m_ostream.write('"'); - } -public: - XMLStreamWriter(TextOutputStream& ostream) - : m_ostream(ostream) - { - m_elements.push_back(state_t()); - m_elements.back().m_state = state_t::eContent; - m_ostream.write('<'); - m_ostream.write('?'); - write_string("xml"); - visit("version", "1.0"); - m_ostream.write('?'); - m_ostream.write('>'); - } - - void pushElement(const XMLElement& element) - { - if(m_elements.back().m_state == state_t::eStartElement) - { - m_elements.back().m_state = state_t::eContent; - m_ostream.write('>'); - } - - m_elements.push_back(state_t()); - - m_ostream.write('<'); - write_string(element.name()); - element.forEachAttribute(*this); - } - void popElement(const char* name) - { - if(m_elements.back().m_state == state_t::eStartElement) - { - m_ostream.write('/'); - m_ostream.write('>'); - m_elements.pop_back(); - } - else - { - m_ostream.write('<'); - m_ostream.write('/'); - write_string(name); - m_ostream.write('>'); - m_elements.pop_back(); - } - } - std::size_t write(const char* data, std::size_t length) - { - if(m_elements.back().m_state == state_t::eStartElement) - { - m_elements.back().m_state = state_t::eContent; - m_ostream.write('>'); - } - write_cdata(data, length); - return length; - } - - void visit(const char* name, const char* value) - { - m_ostream.write(' '); - write_string(name); - m_ostream.write('='); - write_quoted_string(value); - } -}; - - -#endif diff --git a/makeversion.py b/makeversion.py index 9cf60721..06c86312 100644 --- a/makeversion.py +++ b/makeversion.py @@ -1,23 +1,3 @@ -# Copyright (C) 1999-2006 Id Software, Inc. and contributors. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - # version and about message management # NOTE: this module is meant to be used on all platforms, it is not SCons centric @@ -32,15 +12,13 @@ # for non-official builds, we have a default message # otherwise, use environment variable $RADIANT_ABOUTMSG # input: -# file pointed to by $RADIANT_ABOUTMSG if exists -# else include/aboutmsg.default +# include/aboutmsg.default +# or file pointed to by $RADIANT_ABOUTMSG if exists # ouput: # include/aboutmsg.h import sys, re, string, os -import svn - def get_version(): # version f = open('include/version.default', 'r') @@ -54,49 +32,41 @@ def get_version(): return (line, major, minor) # you can pass an optional message to append to aboutmsg -def radiant_makeversion(append_about, root = os.getcwd()): +def radiant_makeversion(append_about): (line, major, minor) = get_version() - f = open(os.path.join(root, 'include/version.h'), 'w') + f = open('include/version.h', 'w') f.write('// generated header, see makeversion.py\n') f.write('#define RADIANT_VERSION "%s"\n' % line) f.write('#define RADIANT_MINOR_VERSION "%s"\n' % minor) f.write('#define RADIANT_MAJOR_VERSION "%s"\n' % major) f.close() - f = open(os.path.join(root, 'include/RADIANT_MINOR'), 'w') + f = open('include/RADIANT_MINOR', 'w') f.write(minor) f.close() - f = open(os.path.join(root, 'include/RADIANT_MAJOR'), 'w') + f = open('include/RADIANT_MAJOR', 'w') f.write(major) f.close() - f = open(os.path.join(root, 'include/version'), 'w') + f = open('include/version', 'w') f.write(line) f.close() # aboutmsg - aboutfile = os.path.join(root, 'include/aboutmsg.default') + aboutfile = 'include/aboutmsg.default' if ( os.environ.has_key('RADIANT_ABOUTMSG') ): aboutfile = os.environ['RADIANT_ABOUTMSG'] - line = None - if os.path.isfile(aboutfile): - sys.stdout.write("about message is in %s\n" % aboutfile) - f = open(aboutfile, 'r') - line = f.readline() - f.close() - if line.endswith("\n"): - line = line[:-1] - else: - line = "Custom build" + sys.stdout.write("about message is in %s\n" % aboutfile) + f = open(aboutfile, 'r') + buffer = f.read() + line = string.split(buffer, '\n')[0] + f.close() # optional additional message if ( not append_about is None ): line += append_about sys.stdout.write("about: %s\n" % line) - f = open(os.path.join(root, 'include/aboutmsg.h'), 'w') + f = open('include/aboutmsg.h', 'w') f.write('// generated header, see makeversion.py\n') f.write('#define RADIANT_ABOUTMSG "%s"\n' % line) f.close() # can be used as module (scons build), or by direct call if __name__ == '__main__': - root = os.path.dirname(__file__) - if not os.path.isabs(root): - root = os.getcwd() - radiant_makeversion(None, root) + radiant_makeversion(None) diff --git a/osx_setup.py b/osx_setup.py new file mode 100644 index 00000000..a9660ac1 --- /dev/null +++ b/osx_setup.py @@ -0,0 +1,38 @@ +# module for OSX setup +# extract everything into a package and a .info + +import commands, os, sys + +def system( cmd ): + sys.stdout.write( cmd ) + ret = commands.getstatusoutput( cmd ) + print ret[1] + if (ret[0] != 0): + raise 'command failed' + +def do_osx_setup( major, minor, target ): + rev = '0' + svnroot = 'https://zerowing.idsoftware.com:666/radiant' + branch = 'branches/1.4' + + startdir = os.getcwd() + localdir = 'GtkRadiant-osx-1.' + major + '.' + minor + '-' + rev + workdir = '/tmp/' + localdir + system( 'rm -r ' + workdir + ' ; mkdir -p ' + workdir ) + system( 'cp ./setup/osx/build.sh ./setup/setup.patch ' + workdir ) + + os.chdir( workdir ) + system( 'cvs -d :pserver:anonymous@cvs.icculus.org:/cvs/cvsroot co loki_setup loki_setupdb' ) + system( 'svn export ' + svnroot + '/GtkRadiant/' + branch + ' GtkRadiant' ) + for i in [ 'WolfPack', 'Q2Pack' ]: + system( 'svn export ' + svnroot + '/' + i + '/' + branch + ' ' + i ) + + os.chdir( '/tmp' ) + system( 'tar cvzf ' + localdir + '.tgz ' + localdir ) + system( 'mv ' + localdir + '.tgz ' + startdir ) + + os.chdir( startdir ) + md5sum = commands.getoutput( 'md5sum ' + localdir + '.tgz | cut -b -33' ) + md5sum = md5sum[:-1] + M4_LINE = ' --define=M4_VER_MAJOR=' + major + ' --define=M4_VER_MINOR=' + minor + ' --define=M4_REV=' + rev + ' --define=M4_SETUP_TARGET=' + target + ' --define=M4_MD5SUM=' + md5sum + system( 'm4 ' + M4_LINE + ' setup/osx/radiant.info.m4 > radiant-1.' + major + '.' + minor + '-' + rev + '.info' ) diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp deleted file mode 100644 index 0e35ba34..00000000 --- a/plugins/archivepak/archive.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "archive.h" - -#include "idatastream.h" -#include "cmdlib.h" -#include "bytestreamutils.h" -#include -#include "stream/filestream.h" - -#include "iarchive.h" - -#include "archivelib.h" - - -#include "plugin.h" - -#include -#include "string/string.h" -#include "fs_filesystem.h" - -inline void buffer_findreplace(char* buffer, char find, char replace) -{ - while(*buffer != '\0') - { - if(*buffer == find) - *buffer = replace; - ++buffer; - } -} - -#include "pak.h" - -class PakArchive : public Archive -{ - class PakRecord - { - public: - PakRecord(unsigned int position, unsigned int stream_size) - : m_position(position), m_stream_size(stream_size) - { - } - unsigned int m_position; - unsigned int m_stream_size; - }; - typedef GenericFileSystem PakFileSystem; - PakFileSystem m_filesystem; - FileInputStream m_pakfile; - CopiedString m_name; - -public: - - PakArchive(const char* name) - : m_pakfile(name), m_name(name) - { - if(!m_pakfile.failed()) - { - pakheader_t header; - - m_pakfile.read(reinterpret_cast(header.magic), 4); - header.diroffset = istream_read_uint32_le(m_pakfile); - header.dirsize = istream_read_uint32_le(m_pakfile); - - if(strncmp (header.magic, "PACK", 4) == 0) - { - m_pakfile.seek(header.diroffset); - - for(unsigned int i = 0; i < header.dirsize; i += sizeof(pakentry_t)) - { - pakentry_t entry; - - m_pakfile.read(reinterpret_cast(entry.filename), 0x38); - entry.offset = istream_read_uint32_le(m_pakfile); - entry.size = istream_read_uint32_le(m_pakfile); - - buffer_findreplace(entry.filename, '\\', '/'); - - PakFileSystem::entry_type& file = m_filesystem[entry.filename]; - if(!file.is_directory()) - { - globalOutputStream() << "Warning: pak archive " << makeQuoted(m_name.c_str()) << " contains duplicated file: " << makeQuoted(entry.filename) << "\n"; - } - else - { - file = new PakRecord(entry.offset, entry.size); - } - } - } - } - } - - ~PakArchive() - { - for(PakFileSystem::iterator i = m_filesystem.begin(); i != m_filesystem.end(); ++i) - delete i->second.file(); - } - - void release() - { - delete this; - } - ArchiveFile* openFile(const char* name) - { - PakFileSystem::iterator i = m_filesystem.find(name); - if(i != m_filesystem.end() && !i->second.is_directory()) - { - PakRecord* file = i->second.file(); - return StoredArchiveFile::create(name, m_name.c_str(), file->m_position, file->m_stream_size, file->m_stream_size); - } - return 0; - } - virtual ArchiveTextFile* openTextFile(const char* name) - { - PakFileSystem::iterator i = m_filesystem.find(name); - if(i != m_filesystem.end() && !i->second.is_directory()) - { - PakRecord* file = i->second.file(); - return StoredArchiveTextFile::create(name, m_name.c_str(), file->m_position, file->m_stream_size); - } - return 0; - } - bool containsFile(const char* name) - { - PakFileSystem::iterator i = m_filesystem.find(name); - return i != m_filesystem.end() && !i->second.is_directory(); - } - void forEachFile(VisitorFunc visitor, const char* root) - { - m_filesystem.traverse(visitor, root); - } -}; - - -Archive* OpenArchive(const char* name) -{ - return new PakArchive(name); -} - -#if 0 - -class TestArchive -{ -public: - TestArchive() - { - Archive* archive = OpenArchive("c:/quake3/baseq3/pak0.pak"); - ArchiveFile* file = archive->openFile("gfx/palette.lmp"); - if(file != 0) - { - char buffer[1024]; - file->getInputStream().read((InputStream::byte_type*)buffer, 1024); - file->release(); - } - archive->release(); - } -}; - -TestArchive g_test; - -#endif - -#if 0 - -class TestArchive -{ - class TestVisitor : public Archive::IVisitor - { - public: - void visit(const char* name) - { - int bleh = 0; - } - }; -public: - TestArchive() - { - { - Archive* archive = OpenArchive(""); - archive->release(); - } - { - Archive* archive = OpenArchive("NONEXISTANTFILE"); - archive->release(); - } - { - Archive* archive = OpenArchive("c:/quake/id1/pak0.pak"); - ArchiveFile* file = archive->openFile("gfx/palette.lmp"); - if(file != 0) - { - char buffer[1024]; - file->getInputStream().read((InputStream::byte_type*)buffer, 1024); - file->release(); - } - TestVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 0), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFiles, 0), "progs/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFiles, 0), "maps/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFiles, 1), "sound/ambience/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), "sound/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eDirectories, 1), "sound/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 2), "sound/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 2), ""); - archive->release(); - } - } -}; - -TestArchive g_test; - -#endif diff --git a/plugins/archivepak/archive.h b/plugins/archivepak/archive.h deleted file mode 100644 index 87b440c2..00000000 --- a/plugins/archivepak/archive.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -class Archive; -Archive* OpenArchive(const char* name); diff --git a/plugins/archivepak/archivepak.def b/plugins/archivepak/archivepak.def deleted file mode 100644 index b0d9f31f..00000000 --- a/plugins/archivepak/archivepak.def +++ /dev/null @@ -1,7 +0,0 @@ -; archivepak.def : Declares the module parameters for the DLL. - -LIBRARY "ARCHIVEPAK" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/archivepak/archivepak.vcproj b/plugins/archivepak/archivepak.vcproj deleted file mode 100644 index 537d9d16..00000000 --- a/plugins/archivepak/archivepak.vcproj +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/archivepak/pak.cpp b/plugins/archivepak/pak.cpp deleted file mode 100644 index d31cdf67..00000000 --- a/plugins/archivepak/pak.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pak.h" - diff --git a/plugins/archivepak/pak.h b/plugins/archivepak/pak.h deleted file mode 100644 index 25031c13..00000000 --- a/plugins/archivepak/pak.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PAK_H) -#define INCLUDED_PAK_H - -struct pakheader_t -{ - char magic[4]; // Name of the new WAD format ("PACK") - unsigned int diroffset;// Position of WAD directory from start of file - unsigned int dirsize; // Number of entries * 0x40 (64 char) -}; - -struct pakentry_t -{ - char filename[0x38]; // Name of the file, Unix style, with extension, 50 chars, padded with '\0'. - unsigned int offset; // Position of the entry in PACK file - unsigned int size; // Size of the entry in PACK file -}; - -#endif - diff --git a/plugins/archivepak/plugin.cpp b/plugins/archivepak/plugin.cpp deleted file mode 100644 index d73b0ef5..00000000 --- a/plugins/archivepak/plugin.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "iarchive.h" - -#include "debugging/debugging.h" -#include "modulesystem/singletonmodule.h" - -#include "archive.h" - -class ArchivePakAPI -{ - _QERArchiveTable m_archivepak; -public: - typedef _QERArchiveTable Type; - STRING_CONSTANT(Name, "pak"); - - ArchivePakAPI() - { - m_archivepak.m_pfnOpenArchive = &OpenArchive; - } - _QERArchiveTable* getTable() - { - return &m_archivepak; - } -}; - -typedef SingletonModule ArchivePakModule; - -ArchivePakModule g_ArchivePakModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ArchivePakModule.selfRegister(); -} diff --git a/plugins/archivepak/plugin.h b/plugins/archivepak/plugin.h deleted file mode 100644 index 2f28d852..00000000 --- a/plugins/archivepak/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivewad/archive.cpp b/plugins/archivewad/archive.cpp deleted file mode 100644 index 75b56e02..00000000 --- a/plugins/archivewad/archive.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "archive.h" - -#include "idatastream.h" -#include "cmdlib.h" -#include "bytestreamutils.h" -#include -#include "stream/filestream.h" - -#include "iarchive.h" - -#include "archivelib.h" - -#include "plugin.h" - -#include -#include "string/string.h" - -#include "wad.h" - -class WadArchive : public Archive -{ - class wad_record_t - { - public: - wad_record_t(unsigned int position, unsigned int stream_size, unsigned int file_size) - : m_position(position), m_stream_size(stream_size), m_file_size(file_size) - {} - unsigned int m_position; - unsigned int m_stream_size; - unsigned int m_file_size; - }; - - enum EWadVersion - { - eNotValid, - eWAD2, - eWAD3, - }; - - typedef std::map files_t; - files_t m_files; - CopiedString m_name; - FileInputStream m_wadfile; - - EWadVersion wad_version(const char* identification) - { - if(strncmp(identification, "WAD2", 4) == 0) - return eWAD2; - if(strncmp(identification, "WAD3", 4) == 0) - return eWAD3; - return eNotValid; - } - - const char* type_for_version(EWadVersion version) - { - switch(version) - { - case eWAD2: - return ".mip"; - case eWAD3: - return ".hlw"; - default: - break; - } - return ""; - } - - int miptex_type_for_version(EWadVersion version) - { - switch(version) - { - case eWAD2: - return TYP_MIPTEX; - case eWAD3: - return 67; - default: - break; - } - return -1; - } - -public: - WadArchive(const char* name) - : m_name(name), m_wadfile(name) - { - if(!m_wadfile.failed()) - { - wadinfo_t wadinfo; - istream_read_wadinfo(m_wadfile, wadinfo); - - EWadVersion version = wad_version(wadinfo.identification); - int miptexType = miptex_type_for_version(version); - - if(version != eNotValid) - { - m_wadfile.seek(wadinfo.infotableofs); - - for(int i = 0; i < wadinfo.numlumps; ++i) - { - char buffer[32]; - lumpinfo_t lumpinfo; - istream_read_lumpinfo(m_wadfile, lumpinfo); - if(lumpinfo.type == miptexType) - { - strcpy(buffer, "textures/"); - strcat(buffer, lumpinfo.name); - strcat(buffer, type_for_version(version)); - m_files.insert(files_t::value_type(buffer, wad_record_t(lumpinfo.filepos, lumpinfo.disksize, lumpinfo.size))); - } - } - } - } - } - - void release() - { - delete this; - } - ArchiveFile* openFile(const char* name) - { - files_t::iterator i = m_files.find(name); - if(i != m_files.end()) - { - return StoredArchiveFile::create(name, m_name.c_str(), i->second.m_position, i->second.m_stream_size, i->second.m_file_size); - } - return 0; - } - virtual ArchiveTextFile* openTextFile(const char* name) - { - files_t::iterator i = m_files.find(name); - if(i != m_files.end()) - { - return StoredArchiveTextFile::create(name, m_name.c_str(), i->second.m_position, i->second.m_stream_size); - } - return 0; - } - bool containsFile(const char* name) - { - return m_files.find(name) != m_files.end(); - } - void forEachFile(VisitorFunc visitor, const char* root) - { - if(root[0] == '\0') - { - if(visitor.directory("textures/", 1)) - return; - } - else if(strcmp(root, "textures/") != 0) - { - return; - } - - for(files_t::iterator i = m_files.begin(); i != m_files.end(); ++i) - visitor.file(i->first.c_str()); - } -}; - - -Archive* OpenArchive(const char* name) -{ - return new WadArchive(name); -} - -#if 0 - -class TestArchive -{ - class TestVisitor : public Archive::IVisitor - { - public: - void visit(const char* name) - { - int bleh = 0; - } - }; -public: - TestArchive() - { - { - Archive* archive = OpenArchive(""); - archive->release(); - } - { - Archive* archive = OpenArchive("NONEXISTANTFILE"); - archive->release(); - } - { - Archive* archive = OpenArchive("c:/quake/id1/quake101.wad"); - ArchiveFile* file = archive->openFile("textures/sky1.mip"); - if(file != 0) - { - unsigned char* buffer = new unsigned char[file->size()]; - file->getInputStream().read((InputStream::byte_type*)buffer, file->size()); - delete[] buffer; - file->release(); - } - TestVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 0), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 0), "textures/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), "textures/"); - archive->release(); - } - } -}; - -TestArchive g_test; - -#endif diff --git a/plugins/archivewad/archive.h b/plugins/archivewad/archive.h deleted file mode 100644 index 87b440c2..00000000 --- a/plugins/archivewad/archive.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -class Archive; -Archive* OpenArchive(const char* name); diff --git a/plugins/archivewad/archivewad.def b/plugins/archivewad/archivewad.def deleted file mode 100644 index 382af26a..00000000 --- a/plugins/archivewad/archivewad.def +++ /dev/null @@ -1,7 +0,0 @@ -; archivewad.def : Declares the module parameters for the DLL. - -LIBRARY "ARCHIVEWAD" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/archivewad/archivewad.vcproj b/plugins/archivewad/archivewad.vcproj deleted file mode 100644 index 4d6a678d..00000000 --- a/plugins/archivewad/archivewad.vcproj +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/archivewad/plugin.cpp b/plugins/archivewad/plugin.cpp deleted file mode 100644 index a27c4599..00000000 --- a/plugins/archivewad/plugin.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "iarchive.h" - -#include "debugging/debugging.h" -#include "modulesystem/singletonmodule.h" - -#include "archive.h" - -class ArchiveWadAPI -{ - _QERArchiveTable m_archivewad; -public: - typedef _QERArchiveTable Type; - STRING_CONSTANT(Name, "wad"); - - ArchiveWadAPI() - { - m_archivewad.m_pfnOpenArchive = &OpenArchive; - } - _QERArchiveTable* getTable() - { - return &m_archivewad; - } -}; - -typedef SingletonModule ArchiveWadModule; - -ArchiveWadModule g_ArchiveWadModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ArchiveWadModule.selfRegister(); -} diff --git a/plugins/archivewad/plugin.h b/plugins/archivewad/plugin.h deleted file mode 100644 index 2f28d852..00000000 --- a/plugins/archivewad/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivewad/wad.cpp b/plugins/archivewad/wad.cpp deleted file mode 100644 index 9192a452..00000000 --- a/plugins/archivewad/wad.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "wad.h" - diff --git a/plugins/archivewad/wad.h b/plugins/archivewad/wad.h deleted file mode 100644 index fe64d23b..00000000 --- a/plugins/archivewad/wad.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_WAD_H) -#define INCLUDED_WAD_H - -#include "bytestreamutils.h" -#include "idatastream.h" - -#define CMP_NONE 0 -#define CMP_LZSS 1 - -#define TYP_NONE 0 -#define TYP_LABEL 1 - -#define TYP_LUMPY 64 // 64 + grab command number -#define TYP_PALETTE 64 -#define TYP_QTEX 65 -#define TYP_QPIC 66 -#define TYP_SOUND 67 -#define TYP_MIPTEX 68 - -typedef struct -{ - char identification[4]; // should be WAD2 or 2DAW - int numlumps; - int infotableofs; -} wadinfo_t; - -typedef struct -{ - int filepos; - int disksize; - int size; // uncompressed - char type; - char compression; - char pad1, pad2; - char name[16]; // must be null terminated -} lumpinfo_t; - -inline void istream_read_wadinfo(InputStream& istream, wadinfo_t& wadinfo) -{ - istream.read(reinterpret_cast(wadinfo.identification), 4); - wadinfo.numlumps = istream_read_int32_le(istream); - wadinfo.infotableofs = istream_read_int32_le(istream); -} - -inline void istream_read_lumpinfo(InputStream& istream, lumpinfo_t& lumpinfo) -{ - lumpinfo.filepos = istream_read_int32_le(istream); - lumpinfo.disksize = istream_read_int32_le(istream); - lumpinfo.size = istream_read_int32_le(istream); - lumpinfo.type = istream_read_byte(istream); - lumpinfo.compression = istream_read_byte(istream); - lumpinfo.pad1 = istream_read_byte(istream); - lumpinfo.pad2 = istream_read_byte(istream); - istream.read(reinterpret_cast(lumpinfo.name), 16); -} - -#endif diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp deleted file mode 100644 index 1a171972..00000000 --- a/plugins/archivezip/archive.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "idatastream.h" -#include "cmdlib.h" -#include "bytestreamutils.h" - -#include "modulesystem.h" -#include "iarchive.h" - -#include -#include "stream/filestream.h" -#include "container/array.h" -#include "archivelib.h" -#include "zlibstream.h" - -class DeflatedArchiveFile : public ArchiveFile -{ - CopiedString m_name; - FileInputStream m_istream; - SubFileInputStream m_substream; - DeflatedInputStream m_zipstream; - FileInputStream::size_type m_size; -public: - typedef FileInputStream::size_type size_type; - typedef FileInputStream::position_type position_type; - - DeflatedArchiveFile(const char* name, const char* archiveName, position_type position, size_type stream_size, size_type file_size) - : m_name(name), m_istream(archiveName), m_substream(m_istream, position, stream_size), m_zipstream(m_substream), m_size(file_size) - { - } - - void release() - { - delete this; - } - size_type size() const - { - return m_size; - } - const char* getName() const - { - return m_name.c_str(); - } - InputStream& getInputStream() - { - return m_zipstream; - } -}; - -class DeflatedArchiveTextFile : public ArchiveTextFile -{ - CopiedString m_name; - FileInputStream m_istream; - SubFileInputStream m_substream; - DeflatedInputStream m_zipstream; - BinaryToTextInputStream m_textStream; -public: - typedef FileInputStream::size_type size_type; - typedef FileInputStream::position_type position_type; - - DeflatedArchiveTextFile(const char* name, const char* archiveName, position_type position, size_type stream_size) - : m_name(name), m_istream(archiveName), m_substream(m_istream, position, stream_size), m_zipstream(m_substream), m_textStream(m_zipstream) - { - } - - void release() - { - delete this; - } - TextInputStream& getInputStream() - { - return m_textStream; - } -}; - -#include "pkzip.h" - -#include -#include "string/string.h" -#include "fs_filesystem.h" - - -class ZipArchive : public Archive -{ - class ZipRecord - { - public: - enum ECompressionMode - { - eStored, - eDeflated, - }; - ZipRecord(unsigned int position, unsigned int compressed_size, unsigned int uncompressed_size, ECompressionMode mode) - : m_position(position), m_stream_size(compressed_size), m_file_size(uncompressed_size), m_mode(mode) - { - } - unsigned int m_position; - unsigned int m_stream_size; - unsigned int m_file_size; - ECompressionMode m_mode; - }; - - typedef GenericFileSystem ZipFileSystem; - ZipFileSystem m_filesystem; - CopiedString m_name; - FileInputStream m_istream; - - bool read_record() - { - zip_magic magic; - istream_read_zip_magic(m_istream, magic); - if(!(magic == zip_root_dirent_magic)) - { - return false; - } - zip_version version_encoder; - istream_read_zip_version(m_istream, version_encoder); - zip_version version_extract; - istream_read_zip_version(m_istream, version_extract); - //unsigned short flags = - istream_read_int16_le(m_istream); - unsigned short compression_mode = istream_read_int16_le(m_istream); - if(compression_mode != Z_DEFLATED && compression_mode != 0) - { - return false; - } - zip_dostime dostime; - istream_read_zip_dostime(m_istream, dostime); - //unsigned int crc32 = - istream_read_int32_le(m_istream); - unsigned int compressed_size = istream_read_uint32_le(m_istream); - unsigned int uncompressed_size = istream_read_uint32_le(m_istream); - unsigned int namelength = istream_read_uint16_le(m_istream); - unsigned short extras = istream_read_uint16_le(m_istream); - unsigned short comment = istream_read_uint16_le(m_istream); - //unsigned short diskstart = - istream_read_int16_le(m_istream); - //unsigned short filetype = - istream_read_int16_le(m_istream); - //unsigned int filemode = - istream_read_int32_le(m_istream); - unsigned int position = istream_read_int32_le(m_istream); - - Array filename(namelength+1); - m_istream.read(reinterpret_cast(filename.data()), namelength); - filename[namelength] = '\0'; - - m_istream.seek(extras + comment, FileInputStream::cur); - - if(path_is_directory(filename.data())) - { - m_filesystem[filename.data()] = 0; - } - else - { - ZipFileSystem::entry_type& file = m_filesystem[filename.data()]; - if(!file.is_directory()) - { - globalOutputStream() << "Warning: zip archive " << makeQuoted(m_name.c_str()) << " contains duplicated file: " << makeQuoted(filename.data()) << "\n"; - } - else - { - file = new ZipRecord(position, compressed_size, uncompressed_size, (compression_mode == Z_DEFLATED) ? ZipRecord::eDeflated : ZipRecord::eStored); - } - } - - return true; - } - - bool read_pkzip() - { - SeekableStream::position_type pos = pkzip_find_disk_trailer(m_istream); - if(pos != 0) - { - zip_disk_trailer disk_trailer; - m_istream.seek(pos); - istream_read_zip_disk_trailer(m_istream, disk_trailer); - if(!(disk_trailer.z_magic == zip_disk_trailer_magic)) - { - return false; - } - - m_istream.seek(disk_trailer.z_rootseek); - for(unsigned int i = 0; i < disk_trailer.z_entries; ++i) - { - if(!read_record()) - { - return false; - } - } - return true; - } - return false; - } -public: - ZipArchive(const char* name) - : m_name(name), m_istream(name) - { - if(!m_istream.failed()) - { - if(!read_pkzip()) - { - globalErrorStream() << "ERROR: invalid zip-file " << makeQuoted(name) << '\n'; - } - } - } - ~ZipArchive() - { - for(ZipFileSystem::iterator i = m_filesystem.begin(); i != m_filesystem.end(); ++i) - { - delete i->second.file(); - } - } - - bool failed() - { - return m_istream.failed(); - } - - void release() - { - delete this; - } - ArchiveFile* openFile(const char* name) - { - ZipFileSystem::iterator i = m_filesystem.find(name); - if(i != m_filesystem.end() && !i->second.is_directory()) - { - ZipRecord* file = i->second.file(); - - m_istream.seek(file->m_position); - zip_file_header file_header; - istream_read_zip_file_header(m_istream, file_header); - if(file_header.z_magic != zip_file_header_magic) - { - globalErrorStream() << "error reading zip file " << makeQuoted(m_name.c_str()); - return 0; - } - - switch(file->m_mode) - { - case ZipRecord::eStored: - return StoredArchiveFile::create(name, m_name.c_str(), m_istream.tell(), file->m_stream_size, file->m_file_size); - case ZipRecord::eDeflated: - return new DeflatedArchiveFile(name, m_name.c_str(), m_istream.tell(), file->m_stream_size, file->m_file_size); - } - } - return 0; - } - ArchiveTextFile* openTextFile(const char* name) - { - ZipFileSystem::iterator i = m_filesystem.find(name); - if(i != m_filesystem.end() && !i->second.is_directory()) - { - ZipRecord* file = i->second.file(); - - m_istream.seek(file->m_position); - zip_file_header file_header; - istream_read_zip_file_header(m_istream, file_header); - if(file_header.z_magic != zip_file_header_magic) - { - globalErrorStream() << "error reading zip file " << makeQuoted(m_name.c_str()); - return 0; - } - - switch(file->m_mode) - { - case ZipRecord::eStored: - return StoredArchiveTextFile::create(name, m_name.c_str(), m_istream.tell(), file->m_stream_size); - case ZipRecord::eDeflated: - return new DeflatedArchiveTextFile(name, m_name.c_str(), m_istream.tell(), file->m_stream_size); - } - } - return 0; - } - bool containsFile(const char* name) - { - ZipFileSystem::iterator i = m_filesystem.find(name); - return i != m_filesystem.end() && !i->second.is_directory(); - } - void forEachFile(VisitorFunc visitor, const char* root) - { - m_filesystem.traverse(visitor, root); - } -}; - -Archive* OpenArchive(const char* name) -{ - return new ZipArchive(name); -} - -#if 0 - -class TestZip -{ - class TestVisitor : public Archive::IVisitor - { - public: - void visit(const char* name) - { - int bleh = 0; - } - }; -public: - TestZip() - { - testzip("c:/quake3/baseq3/mapmedia.pk3", "textures/radiant/notex.tga"); - } - - void testzip(const char* name, const char* filename) - { - Archive* archive = OpenArchive(name); - ArchiveFile* file = archive->openFile(filename); - if(file != 0) - { - unsigned char buffer[4096]; - std::size_t count = file->getInputStream().read((InputStream::byte_type*)buffer, 4096); - file->release(); - } - TestVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 0), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFiles, 1), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eDirectories, 1), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), "textures"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), "textures/"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 2), ""); - archive->release(); - } -}; - -TestZip g_TestZip; - -#endif diff --git a/plugins/archivezip/archive.h b/plugins/archivezip/archive.h deleted file mode 100644 index c1a53be0..00000000 --- a/plugins/archivezip/archive.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -Archive* OpenArchive(const char* name); diff --git a/plugins/archivezip/archivezip.def b/plugins/archivezip/archivezip.def deleted file mode 100644 index 82b0c818..00000000 --- a/plugins/archivezip/archivezip.def +++ /dev/null @@ -1,7 +0,0 @@ -; archivezip.def : Declares the module parameters for the DLL. - -LIBRARY "ARCHIVEZIP" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/archivezip/archivezip.vcproj b/plugins/archivezip/archivezip.vcproj deleted file mode 100644 index 8ca095bb..00000000 --- a/plugins/archivezip/archivezip.vcproj +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/archivezip/pkzip.cpp b/plugins/archivezip/pkzip.cpp deleted file mode 100644 index f3387f5f..00000000 --- a/plugins/archivezip/pkzip.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pkzip.h" - diff --git a/plugins/archivezip/pkzip.h b/plugins/archivezip/pkzip.h deleted file mode 100644 index 56ba503a..00000000 --- a/plugins/archivezip/pkzip.h +++ /dev/null @@ -1,266 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PKZIP_H) -#define INCLUDED_PKZIP_H - -#include "bytestreamutils.h" -#include "idatastream.h" -#include - -class zip_magic -{ -public: - bool operator==(const zip_magic& other) const - { - return m_value[0] == other.m_value[0] - && m_value[1] == other.m_value[1] - && m_value[2] == other.m_value[2] - && m_value[3] == other.m_value[3]; - } - bool operator!=(const zip_magic& other) const - { - return !(*this == other); - } - char m_value[4]; -}; - -inline void istream_read_zip_magic(InputStream& istream, zip_magic& magic) -{ - istream.read(reinterpret_cast(magic.m_value), 4); -} - -struct zip_version -{ - char version; - char ostype; -}; - -inline void istream_read_zip_version(InputStream& istream, zip_version& version) -{ - version.version = istream_read_byte(istream); - version.ostype = istream_read_byte(istream); -} - -struct zip_dostime -{ - unsigned short time; - unsigned short date; -}; - -inline void istream_read_zip_dostime(InputStream& istream, zip_dostime& dostime) -{ - dostime.time = istream_read_int16_le(istream); - dostime.date = istream_read_int16_le(istream); -} - -const zip_magic zip_file_header_magic = { 'P', 'K', 0x03, 0x04, }; - -/* A. Local file header */ -struct zip_file_header -{ - zip_magic z_magic; /* local file header signature (0x04034b50) */ - zip_version z_extract; /* version needed to extract */ - unsigned short z_flags; /* general purpose bit flag */ - unsigned short z_compr; /* compression method */ - zip_dostime z_dostime; /* last mod file time (dos format) */ - unsigned int z_crc32; /* crc-32 */ - unsigned int z_csize; /* compressed size */ - unsigned int z_usize; /* uncompressed size */ - unsigned short z_namlen; /* filename length (null if stdin) */ - unsigned short z_extras; /* extra field length */ - /* followed by filename (of variable size) */ - /* followed by extra field (of variable size) */ -}; - -inline void istream_read_zip_file_header(SeekableInputStream& istream, zip_file_header& file_header) -{ - istream_read_zip_magic(istream, file_header.z_magic); - istream_read_zip_version(istream, file_header.z_extract); - file_header.z_flags = istream_read_uint16_le(istream); - file_header.z_compr = istream_read_uint16_le(istream); - istream_read_zip_dostime(istream, file_header.z_dostime); - file_header.z_crc32 = istream_read_uint32_le(istream); - file_header.z_csize = istream_read_uint32_le(istream); - file_header.z_usize = istream_read_uint32_le(istream); - file_header.z_namlen = istream_read_uint16_le(istream); - file_header.z_extras = istream_read_uint16_le(istream); - istream.seek(file_header.z_namlen + file_header.z_extras, SeekableInputStream::cur); -}; - -/* B. data descriptor - * the data descriptor exists only if bit 3 of z_flags is set. It is byte aligned - * and immediately follows the last byte of compressed data. It is only used if - * the output media of the compressor was not seekable, eg. standard output. - */ -const zip_magic zip_file_trailer_magic = { 'P', 'K', 0x07, 0x08, }; - -struct zip_file_trailer -{ - zip_magic z_magic; - unsigned int z_crc32; /* crc-32 */ - unsigned int z_csize; /* compressed size */ - unsigned int z_usize; /* uncompressed size */ -}; - -inline void istream_read_zip_file_trailer(InputStream& istream, zip_file_trailer& file_trailer) -{ - istream_read_zip_magic(istream, file_trailer.z_magic); - file_trailer.z_crc32 = istream_read_uint32_le(istream); - file_trailer.z_csize = istream_read_uint32_le(istream); - file_trailer.z_usize = istream_read_uint32_le(istream); -}; - - -/* C. central directory structure: - [file header] . . . end of central dir record -*/ - -/* directory file header - * - a single entry including filename, extras and comment may not exceed 64k. - */ - -const zip_magic zip_root_dirent_magic = { 'P', 'K', 0x01, 0x02, }; - -struct zip_root_dirent -{ - zip_magic z_magic; - zip_version z_encoder; /* version made by */ - zip_version z_extract; /* version need to extract */ - unsigned short z_flags; /* general purpose bit flag */ - unsigned short z_compr; /* compression method */ - zip_dostime z_dostime; /* last mod file time&date (dos format) */ - unsigned int z_crc32; /* crc-32 */ - unsigned int z_csize; /* compressed size */ - unsigned int z_usize; /* uncompressed size */ - unsigned short z_namlen; /* filename length (null if stdin) */ - unsigned short z_extras; /* extra field length */ - unsigned short z_comment; /* file comment length */ - unsigned short z_diskstart; /* disk number of start (if spanning zip over multiple disks) */ - unsigned short z_filetype; /* internal file attributes, bit0 = ascii */ - unsigned int z_filemode; /* extrnal file attributes, eg. msdos attrib byte */ - unsigned int z_off; /* relative offset of local file header, seekval if singledisk */ - /* followed by filename (of variable size) */ - /* followed by extra field (of variable size) */ - /* followed by file comment (of variable size) */ -}; - -inline void istream_read_zip_root_dirent(SeekableInputStream& istream, zip_root_dirent& root_dirent) -{ - istream_read_zip_magic(istream, root_dirent.z_magic); - istream_read_zip_version(istream, root_dirent.z_encoder); - istream_read_zip_version(istream, root_dirent.z_extract); - root_dirent.z_flags = istream_read_uint16_le(istream); - root_dirent.z_compr = istream_read_uint16_le(istream); - istream_read_zip_dostime(istream, root_dirent.z_dostime); - root_dirent.z_crc32 = istream_read_uint32_le(istream); - root_dirent.z_csize = istream_read_uint32_le(istream); - root_dirent.z_usize = istream_read_uint32_le(istream); - root_dirent.z_namlen = istream_read_uint16_le(istream); - root_dirent.z_extras = istream_read_uint16_le(istream); - root_dirent.z_comment = istream_read_uint16_le(istream); - root_dirent.z_diskstart = istream_read_uint16_le(istream); - root_dirent.z_filetype = istream_read_uint16_le(istream); - root_dirent.z_filemode = istream_read_uint32_le(istream); - root_dirent.z_off = istream_read_uint32_le(istream); - istream.seek(root_dirent.z_namlen + root_dirent.z_extras + root_dirent.z_comment, SeekableInputStream::cur); -} - - /* end of central dir record */ -const zip_magic zip_disk_trailer_magic = { 'P', 'K', 0x05, 0x06, }; -const unsigned int disk_trailer_length = 22; -struct zip_disk_trailer -{ - zip_magic z_magic; - unsigned short z_disk; /* number of this disk */ - unsigned short z_finaldisk; /* number of the disk with the start of the central dir */ - unsigned short z_entries; /* total number of entries in the central dir on this disk */ - unsigned short z_finalentries; /* total number of entries in the central dir */ - unsigned int z_rootsize; /* size of the central directory */ - unsigned int z_rootseek; /* offset of start of central directory with respect to * - * the starting disk number */ - unsigned short z_comment; /* zipfile comment length */ - /* followed by zipfile comment (of variable size) */ -}; - -inline void istream_read_zip_disk_trailer(SeekableInputStream& istream, zip_disk_trailer& disk_trailer) -{ - istream_read_zip_magic(istream, disk_trailer.z_magic); - disk_trailer.z_disk = istream_read_uint16_le(istream); - disk_trailer.z_finaldisk = istream_read_uint16_le(istream); - disk_trailer.z_entries = istream_read_uint16_le(istream); - disk_trailer.z_finalentries = istream_read_uint16_le(istream); - disk_trailer.z_rootsize = istream_read_uint32_le(istream); - disk_trailer.z_rootseek = istream_read_uint32_le(istream); - disk_trailer.z_comment = istream_read_uint16_le(istream); - istream.seek(disk_trailer.z_comment, SeekableInputStream::cur); -} - -inline SeekableStream::position_type pkzip_find_disk_trailer(SeekableInputStream& istream) -{ - istream.seek(0, SeekableInputStream::end); - SeekableStream::position_type start_position = istream.tell(); - if(start_position < disk_trailer_length) - return 0; - start_position -= disk_trailer_length; - - zip_magic magic; - istream.seek(start_position); - istream_read_zip_magic(istream, magic); - - if(magic == zip_disk_trailer_magic) - return start_position; - else - { - const SeekableStream::position_type max_comment = 0x10000; - const SeekableStream::position_type bufshift = 6; - const SeekableStream::position_type bufsize = max_comment >> bufshift; - unsigned char buffer[bufsize]; - - SeekableStream::position_type search_end = (max_comment < start_position) ? start_position - max_comment : 0; - SeekableStream::position_type position = start_position; - while(position != search_end) - { - StreamBase::size_type to_read = std::min(bufsize, position - search_end); - position -= to_read; - - istream.seek(position); - StreamBase::size_type size = istream.read(buffer, to_read); - - unsigned char* p = buffer + size; - while(p != buffer) - { - --p; - magic.m_value[3] = magic.m_value[2]; - magic.m_value[2] = magic.m_value[1]; - magic.m_value[1] = magic.m_value[0]; - magic.m_value[0] = *p; - if(magic == zip_disk_trailer_magic) - { - return position + (p - buffer); - } - } - } - return 0; - } -} - -#endif diff --git a/plugins/archivezip/plugin.cpp b/plugins/archivezip/plugin.cpp deleted file mode 100644 index 82a5a2ab..00000000 --- a/plugins/archivezip/plugin.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "iarchive.h" - -#include "debugging/debugging.h" -#include "modulesystem/singletonmodule.h" - -#include "archive.h" - - -class ArchiveZipAPI -{ - _QERArchiveTable m_archivezip; -public: - typedef _QERArchiveTable Type; - STRING_CONSTANT(Name, "pk3"); - - ArchiveZipAPI() - { - m_archivezip.m_pfnOpenArchive = &OpenArchive; - } - _QERArchiveTable* getTable() - { - return &m_archivezip; - } -}; - -typedef SingletonModule ArchiveZipModule; - -ArchiveZipModule g_ArchiveZipModule; - - -class ArchivePK4API -{ - _QERArchiveTable m_archivepk4; -public: - typedef _QERArchiveTable Type; - STRING_CONSTANT(Name, "pk4"); - - ArchivePK4API() - { - m_archivepk4.m_pfnOpenArchive = &OpenArchive; - } - _QERArchiveTable* getTable() - { - return &m_archivepk4; - } -}; - -typedef SingletonModule ArchivePK4Module; - -ArchivePK4Module g_ArchivePK4Module; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ArchiveZipModule.selfRegister(); - g_ArchivePK4Module.selfRegister(); -} diff --git a/plugins/archivezip/plugin.h b/plugins/archivezip/plugin.h deleted file mode 100644 index 2f28d852..00000000 --- a/plugins/archivezip/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivezip/zlibstream.cpp b/plugins/archivezip/zlibstream.cpp deleted file mode 100644 index e19a70ec..00000000 --- a/plugins/archivezip/zlibstream.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "zlibstream.h" - diff --git a/plugins/archivezip/zlibstream.h b/plugins/archivezip/zlibstream.h deleted file mode 100644 index 63def546..00000000 --- a/plugins/archivezip/zlibstream.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ZLIBSTREAM_H) -#define INCLUDED_ZLIBSTREAM_H - -#include "zlib.h" -#include "idatastream.h" - -/// \brief A wrapper around an InputStream of data compressed with the zlib deflate algorithm. -/// -/// - Uses z_stream to decompress the data stream on the fly. -/// - Uses a buffer to reduce the number of times the wrapped stream must be read. -class DeflatedInputStream : public InputStream -{ - InputStream& m_istream; - z_stream m_zipstream; - enum unnamed0 { m_bufsize = 1024 }; - unsigned char m_buffer[m_bufsize]; - -public: - DeflatedInputStream(InputStream& istream) - : m_istream(istream) - { - m_zipstream.zalloc = 0; - m_zipstream.zfree = 0; - m_zipstream.opaque = 0; - m_zipstream.avail_in = 0; - inflateInit2(&m_zipstream, -MAX_WBITS); - } - ~DeflatedInputStream() - { - inflateEnd(&m_zipstream); - } - size_type read(byte_type* buffer, size_type length) - { - m_zipstream.next_out = buffer; - m_zipstream.avail_out = static_cast(length); - while(m_zipstream.avail_out != 0) - { - if(m_zipstream.avail_in == 0) - { - m_zipstream.next_in = m_buffer; - m_zipstream.avail_in = static_cast(m_istream.read(m_buffer, m_bufsize)); - } - if(inflate(&m_zipstream, Z_SYNC_FLUSH) != Z_OK) - { - break; - } - } - return length - m_zipstream.avail_out; - } -}; - -#endif - - diff --git a/plugins/config.mk b/plugins/config.mk index 8b97a39c..f88a85a1 100644 --- a/plugins/config.mk +++ b/plugins/config.mk @@ -1,32 +1,32 @@ -# Common configuration options for all plugins - -CC=gcc -CXX=g++ -CFLAGS+=`gtk-config --cflags` -Wall -g -I../../include -CPPFLAGS+=`gtk-config --cflags` -Wall -g -I../../include -LDFLAGS+=`gtk-config --libs` -shared -OUTDIR=$(RADIANT_DATA)plugins -OBJS := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC))) -OBJS += $(patsubst %.c,%.o,$(filter %.c,$(SRC))) - -all: $(OUTPUT) - -$(OUTPUT): $(OBJS) - $(CXX) -o $(OUTPUT) $(OBJS) $(LDFLAGS) - @if [ -d $(OUTDIR) ]; then cp $(OUTPUT) $(OUTDIR); fi - -## Other targets -.PHONY: clean - -clean: - rm -f *.o *.d $(OUTPUT) core - -## Dependencies --include $(OBJS:.o=.d) - -%.d: %.cpp - @echo -n "$(@) " > $@ - @if { !(eval $(CXX) -MM $(CPPFLAGS) -w $<) >> $@; }; then \ - rm -f $@; exit 1; \ - fi - @[ -s $@ ] || rm -f $@ +# Common configuration options for all plugins + +CC=gcc +CXX=g++ +CFLAGS+=`gtk-config --cflags` -Wall -g -I../../include +CPPFLAGS+=`gtk-config --cflags` -Wall -g -I../../include +LDFLAGS+=`gtk-config --libs` -shared +OUTDIR=$(RADIANT_DATA)plugins +OBJS := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC))) +OBJS += $(patsubst %.c,%.o,$(filter %.c,$(SRC))) + +all: $(OUTPUT) + +$(OUTPUT): $(OBJS) + $(CXX) -o $(OUTPUT) $(OBJS) $(LDFLAGS) + @if [ -d $(OUTDIR) ]; then cp $(OUTPUT) $(OUTDIR); fi + +## Other targets +.PHONY: clean + +clean: + rm -f *.o *.d $(OUTPUT) core + +## Dependencies +-include $(OBJS:.o=.d) + +%.d: %.cpp + @echo -n "$(@) " > $@ + @if { !(eval $(CXX) -MM $(CPPFLAGS) -w $<) >> $@; }; then \ + rm -f $@; exit 1; \ + fi + @[ -s $@ ] || rm -f $@ diff --git a/plugins/eclassfgd/fgd.def b/plugins/eclassfgd/fgd.def new file mode 100644 index 00000000..7ca58d79 --- /dev/null +++ b/plugins/eclassfgd/fgd.def @@ -0,0 +1,8 @@ +; fgd.def : Declares the module parameters for the DLL. + +LIBRARY "FGD" +DESCRIPTION 'FGD Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/eclassfgd/fgd.vcproj b/plugins/eclassfgd/fgd.vcproj new file mode 100644 index 00000000..cacf1a15 --- /dev/null +++ b/plugins/eclassfgd/fgd.vcproj @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/eclassfgd/plugin.cpp b/plugins/eclassfgd/plugin.cpp new file mode 100644 index 00000000..fa8920af --- /dev/null +++ b/plugins/eclassfgd/plugin.cpp @@ -0,0 +1,1141 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//#define FGD_VERBOSE // define this for extra info in the log. + +#include "plugin.h" + +/*! \file plugin.cpp + \brief .fgd entity description format + + FGD loading code by Dominic Clifton - Hydra (Hydra@Hydras-World.com) + + Overview + ======== + + This module loads .fgd files, fgd files are split into classes: + + base classes + point classes (aka fixed size entities) + solid classes (aka brush entity) + + This program first scans each file, building up a list structures + in memory that contain the information for all the classes found + in the file. + + Then the program looks at each of the non-base classes in the list + and build the eclass_t structure from each one. + + Classes can request information in other classes. + + Solid/Base and Point/Base classes can have the same names as other + classes but there can be only one of each solid/point/base class with + the same name, + + e.g.: + + this is NOT allowed: + + @solidclass = "a" + @solidclass = "a" + + this is NOT allowed: + + @pointclass = "a" + @solidclass = "a" + + this IS allowed: + + @solidclass = "a" + @baseclass = "a" + + Version History + =============== + + v0.1 - 13/March/2002 + - Initial version. + + v0.2 - 16/March/2002 + - sets e->skinpath when it finds an iconsprite() token. + + v0.3 - 21/March/2002 + - Core now supports > 8 spawnflags, changes reflected here too. + - FIXED: mins/maxs were backwards when only w,h,d were in the FGD + (as opposed to the actual mins/maxs being in the .def file) + - Made sure all PointClass entities were fixed size entities + and gave them a default bounding box size if a size() setting + was not in the FGD file. + - Removed the string check for classes requesting another class + with the same name, adjusted Find_Class() so that it can search + for baseclasses only, this fixes the problem with PointClass "light" + requesting the BaseClass "light". + + v0.4 - 25/March/2002 + - bleh, It turns out that non-baseclasses can request non-baseclasses + so now I've changed Find_Class() so that it can ignore a specific class + (i.e. the one that's asking for others, so that classes can't request + themselves but they can request other classes of any kind with the + same name). + - made all spawnflag comments appear in one place, rather than being scattered + all over the comments if a requested class also had some spawnflags + + v0.5 - 6/April/2002 + - not using skinpath for sprites anymore, apprently we can code a model + module to display sprites and model files. + - model() tags are now supported. + + ToDo + ==== + + * add support for setting the eclass_t's modelpath. + (not useful for CS, but very useful for HL). + + * need to implement usage for e->skinpath in the core. + + * cleanup some areas now that GetTokenExtra() is available + (some parts were written prior to it's creation). + + * Import the comments between each BaseClass's main [ ] set. + (unfortunatly they're // cstyle comments, which GetToken skips over) + But still ignore comments OUTSIDE the main [ ] set. + +*/ + +_QERScripLibTable g_ScripLibTable; +_EClassManagerTable g_EClassManagerTable; +_QERFuncTable_1 g_FuncTable; +_QERFileSystemTable g_FileSystemTable; + +// forward declare +void Eclass_ScanFile (char *filename); + +const char* EClass_GetExtension() +{ + return "fgd"; +} + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientFGD g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(ECLASS_MAJOR, "fgd", sizeof(_EClassTable)); + g_SynapseClient.AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(g_ScripLibTable), SYN_REQUIRE, &g_ScripLibTable); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(g_FuncTable), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(ECLASSMANAGER_MAJOR, NULL, sizeof(g_EClassManagerTable), SYN_REQUIRE, &g_EClassManagerTable); + + // Needs a 'default' option for this minor because we certainly don't load anything from wad files :) + g_SynapseClient.AddAPI(VFS_MAJOR, "wad", sizeof(g_FileSystemTable), SYN_REQUIRE, &g_FileSystemTable); + + return &g_SynapseClient; +} + +bool CSynapseClientFGD::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, ECLASS_MAJOR)) + { + _EClassTable* pTable= static_cast<_EClassTable*>(pAPI->mpTable); + + pTable->m_pfnGetExtension = &EClass_GetExtension; + pTable->m_pfnScanFile = &Eclass_ScanFile; + + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientFGD::GetInfo() +{ + return ".fgd eclass module built " __DATE__ " " RADIANT_VERSION; +} + +// ------------------------------------------------------------------------------------------------ + +#define CLASS_NOCLASS 0 +#define CLASS_BASECLASS 1 +#define CLASS_POINTCLASS 2 +#define CLASS_SOLIDCLASS 3 + +char *classnames[] = {"NOT DEFINED","BaseClass","PointClass","SolidClass"}; + +#define OPTION_NOOPTION 0 +#define OPTION_STRING 1 +#define OPTION_CHOICES 2 +#define OPTION_INTEGER 3 +#define OPTION_FLAGS 4 + +char *optionnames[] = {"NOT DEFINED","String","Choices","Integer","Flags"}; + +typedef struct choice_s { + int value; + char *name; +} choice_t; + +typedef struct option_s { + int optiontype; + char *optioninfo; + char *epairname; + char *optiondefault; + GSList *choices; // list of choices_t +} option_t; + +typedef struct class_s { + int classtype; // see CLASS_* above. + char *classname; + GSList *l_baselist; // when building the eclass_t, other class_s's with these names are required. + char *description; + + GSList *l_optionlist; // when building the eclass_t, other class_s's with these names are required. + + bool gotsize; // if set then boundingbox is valid. + vec3_t boundingbox[2]; // mins, maxs + + bool gotcolor; // if set then color is valid. + vec3_t color; // R,G,B, loaded as 0-255 + + char *model; // relative path + filename to a model (.spr/.mdl) file, or NULL +} class_t; + +/* +=========================================================== +utility functions + +=========================================================== +*/ +char *strlower (char *start) +{ + char *in; + in = start; + while (*in) + { + *in = tolower(*in); + in++; + } + return start; +} + +char *addstr(char *dest,char *source) +{ + if (dest) + { + char *ptr; + int len = strlen(dest); + ptr = (char *) malloc (len + strlen(source) + 1); + strcpy(ptr,dest); + strcpy(ptr+len,source); + free(dest); + dest = ptr; + } + else + { + dest = strdup(source); + } + return(dest); +} + +int getindex(unsigned int a) +{ + unsigned int count = 0; + unsigned int b = 0; + for (;b != a;count++) + { + b = (1< a) + return -1; + } + return (count); +} + +void ClearGSList (GSList* lst) +{ + GSList *p = lst; + while (p) + { + free (p->data); + p = g_slist_remove (p, p->data); + } +} + +/*! +free a choice_t structure and it's contents +*/ +void Free_Choice(choice_t *p) +{ + if (p->name) free(p->name); + free (p); + +} + +/* +=========================================================== +Main functions + +=========================================================== +*/ + +/*! +free an option_t structure and it's contents +*/ +void Free_Option(option_t *p) +{ + if (p->epairname) free(p->epairname); + if (p->optiondefault) free(p->optiondefault); + if (p->optioninfo) free(p->optioninfo); + GSList *l = p->choices; + while (l) + { + Free_Choice ((choice_t *)l->data); + l = g_slist_remove (l, l->data); + } + free (p); +} + +/*! +free a class_t structure and it's contents +*/ +void Free_Class(class_t *p) +{ + GSList *l = p->l_optionlist; + while (l) + { + Free_Option ((option_t *)l->data); + l = g_slist_remove (l, l->data); + } + + if (p->classname) free(p->classname); + free (p); +} + +/*! +find a class in the list +*/ +class_t *Find_Class(GSList *l,char *classname, class_t *ignore) +{ + for (GSList *clst = l; clst != NULL; clst = clst->next) + { + class_t *c = (class_t *)clst->data; + + if (c == ignore) + continue; + + // NOTE: to speed up we could make all the classnames lower-case when they're initialised. + if (!stricmp(c->classname,classname)) + { + return c; + } + + } + return NULL; +} + +/*! +Import as much as possible from a class_t into an eclass_t +Note: this is somewhat recursive, as a class can require a class that requires a class and so on.. +*/ +void EClass_ImportFromClass(eclass_t *e, GSList *l_classes, class_t *bc) +{ + char color[128]; + + // We allocate 16k here, but only the memory actually used is kept allocated. + // this is just used for building the final comments string. + // Note: if the FGD file contains comments that are >16k (per entity) then + // radiant will crash upon loading such a file as the eclass_t will become + // corrupted. + // FIXME: we could add some length checking when building "newcomments", but + // that'd slow it down a bit. + char newcomments[16384] = ""; + + //Note: we override the values already in e. + //and we do it in such a way that the items that appear last in the l_baselist + //represent the final values. + + if (bc->description) + { + sprintf(newcomments,"%s\n",bc->description); + e->comments = addstr(e->comments,newcomments); + newcomments[0] = 0; // so we don't add them twice. + } + + + // import from other classes if required. + + if (bc->l_baselist) + { + // this class requires other base classes. + + for (GSList *bclst = bc->l_baselist; bclst != NULL; bclst = bclst->next) + { + char *requestedclass = (char *)bclst->data; + +// class_t *rbc = Find_Class(l_classes, requestedclass, true); + class_t *rbc = Find_Class(l_classes, requestedclass, bc); + + // make sure we don't request ourself! + if (rbc == bc) + { + Sys_Printf ("WARNING: baseclass '%s' tried to request itself!\n", bclst->data); + } + else + { + if (!rbc) + { + Sys_Printf ("WARNING: could not find the requested baseclass '%s' when building '%s'\n", requestedclass,bc->classname); + } + else + { + // call ourself! + EClass_ImportFromClass(e, l_classes, rbc); + } + } + } + } + // SIZE + if (bc->gotsize) + { + e->fixedsize = true; + memcpy(e->mins,bc->boundingbox[0],sizeof( vec3_t )); + memcpy(e->maxs,bc->boundingbox[1],sizeof( vec3_t )); + } +/* + // Hydra: apparently, this would be bad. + + if (bc->sprite) + { + // Hydra - NOTE: e->skinpath is not currently used by the editor but the code + // to set it is used by both this eclass_t loader and the .DEF eclass_t loader. + // TODO: implement using e->skinpath. + if (e->skinpath) + free (e->skinpath); + + e->skinpath = strdup(bc->sprite); + } +*/ + + // MODEL + if (bc->model) + { + if (e->modelpath) + free (e->modelpath); + + e->modelpath = strdup(bc->model); + } + + // COLOR + if (bc->gotcolor) + { + memcpy(e->color,bc->color,sizeof( vec3_t )); + sprintf (color, "(%f %f %f)", e->color[0], e->color[1], e->color[2]); + e->texdef.SetName(color); + } + + // SPAWNFLAGS and COMMENTS + if (bc->l_optionlist) + { + for (GSList *optlst = bc->l_optionlist; optlst != NULL; optlst = optlst->next) + { + option_t *opt = (option_t*) optlst->data; + + if (opt->optiontype != OPTION_FLAGS) + { + // add some info to the comments. + if (opt->optioninfo) + { + sprintf(newcomments+strlen(newcomments),"%s '%s' %s%s\n", + opt->epairname, + opt->optioninfo ? opt->optioninfo : "", + opt->optiondefault ? ", Default: " : "", + opt->optiondefault ? opt->optiondefault : ""); + } + else + { + sprintf(newcomments+strlen(newcomments),"%s %s%s\n", + opt->epairname, + opt->optiondefault ? ", Default: " : "", + opt->optiondefault ? opt->optiondefault : ""); + } + } + + GSList *choicelst; + switch(opt->optiontype) + { + case OPTION_FLAGS : + // grab the flags. + for (choicelst = opt->choices; choicelst != NULL; choicelst = choicelst->next) + { + choice_t *choice = (choice_t*) choicelst->data; + + int index = getindex(choice->value); + index--; + if (index < MAX_FLAGS) + { + strcpy(e->flagnames[index],choice->name); + } + else + { + Sys_Printf ("WARNING: baseclass '%s' has a spawnflag out of range, ignored!\n", bc->classname); + } + } + break; + case OPTION_CHOICES : + strcat(newcomments," Choices:\n"); + for (choicelst = opt->choices; choicelst != NULL; choicelst = choicelst->next) + { + choice_t *choice = (choice_t*) choicelst->data; + sprintf(newcomments+strlen(newcomments)," %5d - %s\n",choice->value,choice->name); + } + break; + } + } + } + + // name + if (e->name) free(e->name); + e->name = strdup(bc->classname); + + // fixed size initialisation + if (bc->classtype == CLASS_POINTCLASS) + { + e->fixedsize = true; + // some point classes dont seem to have size()'s in the fgd, so set up a default here.. + if ((e->mins[0] == 0) && (e->mins[1] == 0) && (e->mins[2] == 0) && + (e->maxs[0] == 0) && (e->maxs[1] == 0) && (e->maxs[2] == 0)) + { + e->mins[0] = -8; + e->mins[1] = -8; + e->mins[2] = -8; + e->maxs[0] = 8; + e->maxs[1] = 8; + e->maxs[2] = 8; + } + + if (e->texdef.GetName() == NULL) + { + // no color specified for this entity in the fgd file + // set one now + // Note: if this eclass_t is not fully built, then this may be + // overridden with the correct color. + + e->color[0] = 1; + e->color[1] = 0.5; // how about a nice bright pink, mmm, nice! :) + e->color[2] = 1; + + sprintf (color, "(%f %f %f)", e->color[0], e->color[1], e->color[2]); + e->texdef.SetName(color); + } + } + + // COMMENTS + if (newcomments[0]) + { + e->comments = addstr(e->comments,newcomments); + } +} + +/*! +create the eclass_t structures and add to the global list. +*/ +void Create_EClasses(GSList *l_classes) +{ + int count = 0; + // loop through the loaded structures finding all the non BaseClasses + for (GSList *clst = l_classes; clst != NULL; clst = clst->next) + { + class_t *c = (class_t *)clst->data; + + if (c->classtype == CLASS_BASECLASS) // not looking for these. + continue; + + eclass_t *e = (eclass_t *) malloc( sizeof( eclass_s )); + memset(e,0,sizeof( eclass_s )); + + EClass_ImportFromClass(e, l_classes, c ); + + // radiant will crash if this is null, and it still could be at this point. + if (!e->comments) + { + e->comments=strdup("No description available, check documentation\n"); + } + + // dump the spawnflags to the end of the comments. + int i; + bool havespawnflags; + + havespawnflags = false; + for (i = 0 ; i < MAX_FLAGS ; i++) + { + if (*e->flagnames[i]) havespawnflags = true; + } + + if (havespawnflags) + { + char spawnline[80]; + e->comments = addstr(e->comments,"Spawnflags\n"); + for (i = 0 ; i < MAX_FLAGS ; i++) + { + if (*e->flagnames[i]) + { + sprintf(spawnline," %d - %s\n", 1<flagnames[i]); + e->comments = addstr(e->comments,spawnline); + } + } + } + + Eclass_InsertAlphabetized (e); + count ++; + // Hydra: ttimo, I don't think this code is required... + // single ? + *Get_Eclass_E() = e; + Set_Eclass_Found(true); + if ( Get_Parsing_Single() ) + break; + } + + Sys_Printf ("FGD Loaded %d entities.\n", count); +} + +void Eclass_ScanFile (char *filename) +{ + int size; + char *data; + char temp[1024]; + GSList *l_classes = NULL; + char token_debug[1024]; //++Hydra FIXME: cleanup this. + bool done = false; + int len,classtype; + + char *token = Token(); + + QE_ConvertDOSToUnixName( temp, filename ); + + size = vfsLoadFullPathFile (filename, (void**)&data); + if (size <= 0) + { + Sys_FPrintf (SYS_ERR, "Eclass_ScanFile: %s not found\n", filename); + return; + } + Sys_Printf ("ScanFile: %s\n", temp); + + // start parsing the file + StartTokenParsing(data); + + // build a list of base classes first + + while (!done) + { + // find an @ sign. + do + { + if (!GetToken(true)) + { + done = true; + break; + } + } while (token[0] != '@'); + + strcpy(temp,token+1); // skip the @ + + classtype = CLASS_NOCLASS; + if (!stricmp(temp,"BaseClass")) classtype = CLASS_BASECLASS; + if (!stricmp(temp,"PointClass")) classtype = CLASS_POINTCLASS; + if (!stricmp(temp,"SolidClass")) classtype = CLASS_SOLIDCLASS; + + if (classtype) + { + class_t *newclass = (class_t *) malloc( sizeof(class_s) ); + memset( newclass, 0, sizeof(class_s) ); + newclass->classtype = classtype; + + while (1) + { + GetTokenExtra(false,"(",false); // option or = + strcpy(token_debug,token); + + if (!strcmp(token,"=")) + { + UnGetToken(); + break; + } + else + { + strlower(token); + if (!strcmp(token,"base")) + { + GetTokenExtra(false,"(",true); // ( + + if (!strcmp(token,"(")) + { + while (GetTokenExtra(false,",)",false)) // option) or option, + { + newclass->l_baselist = g_slist_append (newclass->l_baselist, strdup(token)); + + GetTokenExtra(false,",)",true); // , or ) + if (!strcmp(token,")")) + break; + + } + } + } + else if (!strcmp(token,"size")) + { + // parse (w h d) or (x y z, x y z) + + GetTokenExtra(false,"(",true); // ( + if (!strcmp(token,"(")) + { + int sizedone = false; + float w,h,d; + GetToken(false); + w = atof(token); + GetToken(false); + h = atof(token); + GetToken(false); // number) or number , + strcpy(temp,token); + len = strlen(temp); + if (temp[len-1] == ')') sizedone = true; + temp[len-1] = 0; + d = atof(temp); + if (sizedone) + { + // only one set of cordinates supplied, change the W,H,D to mins/maxs + newclass->boundingbox[0][0] = 0 - (w / 2); + newclass->boundingbox[1][0] = w / 2; + newclass->boundingbox[0][1] = 0 - (h / 2); + newclass->boundingbox[1][1] = h / 2; + newclass->boundingbox[0][2] = 0 - (d / 2); + newclass->boundingbox[1][2] = d / 2; + newclass->gotsize = true; + } + else + { + newclass->boundingbox[0][0] = w; + newclass->boundingbox[0][1] = h; + newclass->boundingbox[0][2] = d; + GetToken(false); + newclass->boundingbox[1][0] = atof(token); + GetToken(false); + newclass->boundingbox[1][1] = atof(token); +/* + GetToken(false); // "number)" or "number )" + strcpy(temp,token); + len = strlen(temp); + if (temp[len-1] == ')') + temp[len-1] = 0; + else + GetToken(false); // ) + newclass->boundingbox[1][2] = atof(temp); +*/ + GetTokenExtra(false,")",false); // number + newclass->boundingbox[1][2] = atof(token); + newclass->gotsize = true; + GetTokenExtra(false,")",true); // ) + } + } + } + else if (!strcmp(token,"color")) + { + GetTokenExtra(false,"(",true); // ( + if (!strcmp(token,"(")) + { + // get the color values (0-255) and normalize them if required. + GetToken(false); + newclass->color[0] = atof(token); + if (newclass->color[0] > 1) + newclass->color[0]/=255; + GetToken(false); + newclass->color[1] = atof(token); + if (newclass->color[1] > 1) + newclass->color[1]/=255; + GetToken(false); + strcpy(temp,token); + len = strlen(temp); + if (temp[len-1] == ')') temp[len-1] = 0; + newclass->color[2] = atof(temp); + if (newclass->color[2] > 1) + newclass->color[2]/=255; + newclass->gotcolor = true; + } + } + else if (!strcmp(token,"iconsprite")) + { + GetTokenExtra(false,"(",true); // ( + if (!strcmp(token,"(")) + { + GetTokenExtra(false,")",false); // filename) + // the model plugins will handle sprites too. + // newclass->sprite = strdup(token); + newclass->model = strdup(token); + GetTokenExtra(false,")",true); // ) + } + } + else if (!strcmp(token,"model")) + { + GetTokenExtra(false,"(",true); // ( + if (!strcmp(token,"(")) + { + GetTokenExtra(false,")",false); // filename) + newclass->model = strdup(token); + GetTokenExtra(false,")",true); // ) + } + } + else + { + // Unsupported + GetToken(false); // skip it. + } + + } + } + + GetToken(false); // = + strcpy(token_debug,token); + if (!strcmp(token,"=")) + { + GetToken(false); + newclass->classname = strdup(token); + } + + // Get the description + if (newclass->classtype != CLASS_BASECLASS) + { + GetToken(false); + if (!strcmp(token,":")) + { + GetToken(false); + newclass->description = strdup(token); + } else UnGetToken(); // no description + } + + // now build the option list. + GetToken(true); // [ or [] + + if (strcmp(token,"[]")) // got some options ? + { + if (!strcmp(token,"[")) + { + // yup + bool optioncomplete = false; + option_t *newoption; + + while (1) + { + GetToken(true); + if (!strcmp(token,"]")) + break; // no more options + + // parse the data and build the option_t + + strcpy(temp,token); + len = strlen(temp); + char *ptr = strchr(temp,'('); + + if (!ptr) + break; + + newoption = (option_t *) malloc ( sizeof( option_s )); + memset( newoption, 0, sizeof( option_s )); + + *ptr++ = 0; + newoption->epairname = strdup(temp); + + len = strlen(ptr); + if (ptr[len-1] != ')') + break; + + ptr[len-1] = 0; + strlower(ptr); + if (!strcmp(ptr,"integer")) + { + newoption->optiontype = OPTION_INTEGER; + } + else if (!strcmp(ptr,"choices")) + { + newoption->optiontype = OPTION_CHOICES; + } + else if (!strcmp(ptr,"flags")) + { + newoption->optiontype = OPTION_FLAGS; + } + else // string + { + newoption->optiontype = OPTION_STRING; + } + + switch (newoption->optiontype) + { + case OPTION_STRING : + case OPTION_INTEGER : + if (!TokenAvailable()) + { + optioncomplete = true; + break; + } + GetToken(false); // : + strcpy(token_debug,token); + if ((token[0] == ':') && (strlen(token) > 1)) + { + newoption->optioninfo = strdup(token+1); + } + else + { + GetToken(false); + newoption->optioninfo = strdup(token); + } + if (TokenAvailable()) // default value ? + { + GetToken(false); + if (!strcmp(token,":")) + { + if (GetToken(false)) + { + newoption->optiondefault = strdup(token); + optioncomplete = true; + } + } + } + else + { + optioncomplete = true; + } + break; + + case OPTION_CHOICES : + GetTokenExtra(false,":",true); // : or :"something like this" (bah!) + strcpy(token_debug,token); + if ((token[0] == ':') && (strlen(token) > 1)) + { + if (token[1] == '\"') + { + strcpy(temp,token+2); + while (1) + { + if (!GetToken(false)) + break; + strcat(temp," "); + strcat(temp,token); + len = strlen(temp); + if (temp[len-1] == '\"') + { + temp[len-1] = 0; + break; + } + } + } + newoption->optioninfo = strdup(temp); + } + else + { + GetToken(false); + newoption->optioninfo = strdup(token); + } + GetToken(false); // : or = + strcpy(token_debug,token); + if (!strcmp(token,":")) + { + GetToken(false); + newoption->optiondefault = strdup(token); + } + else + { + UnGetToken(); + } + // And Follow on... + case OPTION_FLAGS : + GetToken(false); // : or = + strcpy(token_debug,token); + if (strcmp(token,"=")) // missing ? + break; + + GetToken(true); // [ + strcpy(token_debug,token); + if (strcmp(token,"[")) // missing ? + break; + + choice_t *newchoice; + while (1) + { + GetTokenExtra(true,":",true); // "]" or "number", or "number:" + strcpy(token_debug,token); + if (!strcmp(token,"]")) // no more ? + { + optioncomplete = true; + break; + } + strcpy(temp,token); + len = strlen(temp); + if (temp[len-1] == ':') + { + temp[len-1] = 0; + } + else + { + GetToken(false); // : + if (strcmp(token,":")) // missing ? + break; + } + if (!TokenAvailable()) + break; + GetToken(false); // the name + + newchoice = (choice_t *) malloc ( sizeof( choice_s )); + memset( newchoice, 0, sizeof( choice_s )); + + newchoice->value = atoi(temp); + newchoice->name = strdup(token); + + newoption->choices = g_slist_append(newoption->choices, newchoice); + + // ignore any remaining tokens on the line + while (TokenAvailable()) GetToken(false); + + // and it we found a "]" on the end of the line, put it back in the queue. + if (!strcmp(token,"]")) UnGetToken(); + } + break; + + } + + // add option to the newclass + + if (optioncomplete) + { + if (newoption) + { + // add it to the list. + newclass->l_optionlist = g_slist_append(newclass->l_optionlist, newoption); + } + } + else + { + Sys_Printf ("%WARNING: Parse error occured in '%s - %s'\n",classnames[newclass->classtype],newclass->classname); + Free_Option(newoption); + } + + } + } + else + { + UnGetToken(); // shouldn't get here. + } + } + + // add it to our list. + l_classes = g_slist_append (l_classes, newclass); + + } + } + + // finished with the file now. + g_free(data); + + Sys_Printf ("FGD scan complete, building entities...\n"); + + // Once we get here we should have a few (!) lists in memory that we + // can extract all the information required to build a the eclass_t structures. + + Create_EClasses(l_classes); + + // Free everything + + GSList *p = l_classes; + while (p) + { + class_t *tmpclass = (class_t *)p->data; + +#ifdef FGD_VERBOSE + // DEBUG: dump the info... + Sys_Printf ("%s: %s (", classnames[tmpclass->classtype],tmpclass->classname); + for (GSList *tmp = tmpclass->l_baselist; tmp != NULL; tmp = tmp->next) + { + if (tmp != tmpclass->l_baselist) + { + Sys_Printf (", "); + } + Sys_Printf ("%s", (char *)tmp->data); + } + if (tmpclass->gotsize) + { + sprintf(temp,"(%.0f %.0f %.0f) - (%.0f %.0f %.0f)",tmpclass->boundingbox[0][0], + tmpclass->boundingbox[0][1], + tmpclass->boundingbox[0][2], + tmpclass->boundingbox[1][0], + tmpclass->boundingbox[1][1], + tmpclass->boundingbox[1][2]); + } else strcpy(temp,"No Size"); + Sys_Printf (") '%s' Size: %s",tmpclass->description ? tmpclass->description : "No description",temp); + if (tmpclass->gotcolor) + { + sprintf(temp,"(%d %d %d)",tmpclass->color[0], + tmpclass->color[1], + tmpclass->color[2]); + } else strcpy(temp,"No Color"); + Sys_Printf (" Color: %s Options:\n",temp); + if (!tmpclass->l_optionlist) + { + Sys_Printf (" No Options\n"); + } + else + { + option_t *tmpoption; + int count; + GSList *olst; + for (olst = tmpclass->l_optionlist, count = 1; olst != NULL; olst = olst->next, count ++) + { + tmpoption = (option_t *)olst->data; + Sys_Printf (" %d, Type: %s, EPair: %s\n", count,optionnames[tmpoption->optiontype], tmpoption->epairname ); + + choice_t *tmpchoice; + GSList *clst; + int ccount; + for (clst = tmpoption->choices, ccount = 1; clst != NULL; clst = clst->next, ccount ++) + { + tmpchoice = (choice_t *)clst->data; + Sys_Printf (" %d, Value: %d, Name: %s\n", ccount, tmpchoice->value, tmpchoice->name); + } + } + } + +#endif + + // free the baselist. + ClearGSList(tmpclass->l_baselist); + Free_Class (tmpclass); + p = g_slist_remove (p, p->data); + } + +} diff --git a/include/qerplugin.cpp b/plugins/eclassfgd/plugin.h similarity index 57% rename from include/qerplugin.cpp rename to plugins/eclassfgd/plugin.h index dd209319..5f402c17 100644 --- a/include/qerplugin.cpp +++ b/plugins/eclassfgd/plugin.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,5 +19,31 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "qerplugin.h" +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ +#include +#include + +#include "synapse.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#define USE_ECLASSMANAGER_DEFINE +#include "ieclass.h" +#define USE_SCRIPLIBTABLE_DEFINE +#include "iscriplib.h" +#define USE_VFSTABLE_DEFINE +#include "ifilesystem.h" + +class CSynapseClientFGD : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientFGD() { } + virtual ~CSynapseClientFGD() { } +}; + +#endif // _PLUGIN_H_ diff --git a/plugins/entity/angle.cpp b/plugins/entity/angle.cpp deleted file mode 100644 index d00fba03..00000000 --- a/plugins/entity/angle.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "angle.h" - diff --git a/plugins/entity/angle.h b/plugins/entity/angle.h deleted file mode 100644 index 08e8b90d..00000000 --- a/plugins/entity/angle.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ANGLE_H) -#define INCLUDED_ANGLE_H - -#include "ientity.h" - -#include "math/quaternion.h" -#include "generic/callback.h" -#include "stringio.h" - -const float ANGLEKEY_IDENTITY = 0; - -inline void default_angle(float& angle) -{ - angle = ANGLEKEY_IDENTITY; -} -inline void normalise_angle(float& angle) -{ - angle = static_cast(float_mod(angle, 360.0)); -} -inline void read_angle(float& angle, const char* value) -{ - if(!string_parse_float(value, angle)) - { - angle = 0; - } - else - { - normalise_angle(angle); - } -} -inline void write_angle(float angle, Entity* entity) -{ - if(angle == 0) - { - entity->setKeyValue("angle", ""); - } - else - { - char value[64]; - sprintf(value, "%g", angle); - entity->setKeyValue("angle", value); - } -} - -class AngleKey -{ - Callback m_angleChanged; -public: - float m_angle; - - - AngleKey(const Callback& angleChanged) - : m_angleChanged(angleChanged), m_angle(ANGLEKEY_IDENTITY) - { - } - - void angleChanged(const char* value) - { - read_angle(m_angle, value); - m_angleChanged(); - } - typedef MemberCaller1 AngleChangedCaller; - - void write(Entity* entity) const - { - write_angle(m_angle, entity); - } -}; - -inline float angle_rotated(float angle, const Quaternion& rotation) -{ - return matrix4_get_rotation_euler_xyz_degrees( - matrix4_multiplied_by_matrix4( - matrix4_rotation_for_z_degrees(angle), - matrix4_rotation_for_quaternion_quantised(rotation) - ) - ).z(); -} - -#endif diff --git a/plugins/entity/angles.cpp b/plugins/entity/angles.cpp deleted file mode 100644 index d15b1c6e..00000000 --- a/plugins/entity/angles.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "angles.h" - diff --git a/plugins/entity/angles.h b/plugins/entity/angles.h deleted file mode 100644 index fbcb0457..00000000 --- a/plugins/entity/angles.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ANGLES_H) -#define INCLUDED_ANGLES_H - -#include "ientity.h" - -#include "math/quaternion.h" -#include "generic/callback.h" -#include "stringio.h" - -#include "angle.h" - -const Vector3 ANGLESKEY_IDENTITY = Vector3(0, 0, 0); - -inline void default_angles(Vector3& angles) -{ - angles = ANGLESKEY_IDENTITY; -} -inline void normalise_angles(Vector3& angles) -{ - angles[0] = static_cast(float_mod(angles[0], 360)); - angles[1] = static_cast(float_mod(angles[1], 360)); - angles[2] = static_cast(float_mod(angles[2], 360)); -} -inline void read_angle(Vector3& angles, const char* value) -{ - if(!string_parse_float(value, angles[2])) - { - default_angles(angles); - } - else - { - angles[0] = 0; - angles[1] = 0; - normalise_angles(angles); - } -} -inline void read_angles(Vector3& angles, const char* value) -{ - if(!string_parse_vector3(value, angles)) - { - default_angles(angles); - } - else - { - angles = Vector3(angles[2], angles[0], angles[1]); - normalise_angles(angles); - } -} -inline void write_angles(const Vector3& angles, Entity* entity) -{ - if(angles[0] == 0 - && angles[1] == 0 - && angles[2] == 0) - { - entity->setKeyValue("angle", ""); - entity->setKeyValue("angles", ""); - } - else - { - char value[64]; - - if(angles[0] == 0 && angles[1] == 0) - { - entity->setKeyValue("angles", ""); - write_angle(angles[2], entity); - } - else - { - sprintf(value, "%g %g %g", angles[1], angles[2], angles[0]); - entity->setKeyValue("angle", ""); - entity->setKeyValue("angles", value); - } - } -} - -inline Vector3 angles_rotated(const Vector3& angles, const Quaternion& rotation) -{ - return matrix4_get_rotation_euler_xyz_degrees( - matrix4_multiplied_by_matrix4( - matrix4_rotation_for_euler_xyz_degrees(angles), - matrix4_rotation_for_quaternion_quantised(rotation) - ) - ); -} - -class AnglesKey -{ - Callback m_anglesChanged; -public: - Vector3 m_angles; - - - AnglesKey(const Callback& anglesChanged) - : m_anglesChanged(anglesChanged), m_angles(ANGLESKEY_IDENTITY) - { - } - - void angleChanged(const char* value) - { - read_angle(m_angles, value); - m_anglesChanged(); - } - typedef MemberCaller1 AngleChangedCaller; - - void anglesChanged(const char* value) - { - read_angles(m_angles, value); - m_anglesChanged(); - } - typedef MemberCaller1 AnglesChangedCaller; - - void write(Entity* entity) const - { - write_angles(m_angles, entity); - } -}; - - -#endif diff --git a/plugins/entity/colour.cpp b/plugins/entity/colour.cpp deleted file mode 100644 index 1be67400..00000000 --- a/plugins/entity/colour.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "colour.h" - diff --git a/plugins/entity/colour.h b/plugins/entity/colour.h deleted file mode 100644 index 9ca17d0b..00000000 --- a/plugins/entity/colour.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_COLOUR_H) -#define INCLUDED_COLOUR_H - -#include "ientity.h" -#include "irender.h" - -#include "math/vector.h" -#include "eclasslib.h" -#include "generic/callback.h" -#include "stringio.h" - -inline void default_colour(Vector3& colour) -{ - colour = Vector3(1, 1, 1); -} -inline void read_colour(Vector3& colour, const char* value) -{ - if(!string_parse_vector3(value, colour)) - { - default_colour(colour); - } -} -inline void write_colour(const Vector3& colour, Entity* entity) -{ - char value[64]; - - sprintf(value, "%f %f %f", colour[0], colour[1], colour[2]); - entity->setKeyValue("_color", value); -} - -class Colour -{ - Callback m_colourChanged; - Shader* m_state; - - void capture_state() - { - m_state = colour_capture_state_fill(m_colour); - } - void release_state() - { - colour_release_state_fill(m_colour); - } - -public: - Vector3 m_colour; - - Colour(const Callback& colourChanged) - : m_colourChanged(colourChanged) - { - default_colour(m_colour); - capture_state(); - } - ~Colour() - { - release_state(); - } - - void colourChanged(const char* value) - { - release_state(); - read_colour(m_colour, value); - capture_state(); - - m_colourChanged(); - } - typedef MemberCaller1 ColourChangedCaller; - - - void write(Entity* entity) const - { - write_colour(m_colour, entity); - } - - Shader* state() const - { - return m_state; - } -}; - -#endif diff --git a/plugins/entity/curve.cpp b/plugins/entity/curve.cpp deleted file mode 100644 index dd2bc0e3..00000000 --- a/plugins/entity/curve.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "curve.h" - diff --git a/plugins/entity/curve.h b/plugins/entity/curve.h deleted file mode 100644 index 39629549..00000000 --- a/plugins/entity/curve.h +++ /dev/null @@ -1,517 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CURVE_H) -#define INCLUDED_CURVE_H - -#include "ientity.h" -#include "selectable.h" -#include "renderable.h" - -#include - -#include "math/curve.h" -#include "stream/stringstream.h" -#include "signal/signal.h" -#include "selectionlib.h" -#include "render.h" -#include "stringio.h" - -class RenderableCurve : public OpenGLRenderable -{ -public: - std::vector m_vertices; - void render(RenderStateFlags state) const - { - pointvertex_gl_array(&m_vertices.front()); - glDrawArrays(GL_LINE_STRIP, 0, GLsizei(m_vertices.size())); - } -}; - -inline void plotBasisFunction(std::size_t numSegments, int point, int degree) -{ - Knots knots; - KnotVector_openUniform(knots, 4, degree); - - globalOutputStream() << "plotBasisFunction point " << point << " of 4, knot vector:"; - for(Knots::iterator i = knots.begin(); i != knots.end(); ++i) - { - globalOutputStream() << " " << *i; - } - globalOutputStream() << "\n"; - globalOutputStream() << "t=0 basis=" << BSpline_basis(knots, point, degree, 0.0) << "\n"; - for(std::size_t i = 1; i < numSegments; ++i) - { - double t = (1.0 / double(numSegments)) * double(i); - globalOutputStream() << "t=" << t << " basis=" << BSpline_basis(knots, point, degree, t) << "\n"; - } - globalOutputStream() << "t=1 basis=" << BSpline_basis(knots, point, degree, 1.0) << "\n"; -} - -inline bool ControlPoints_parse(ControlPoints& controlPoints, const char* value) -{ - StringTokeniser tokeniser(value, " "); - - std::size_t size; - if(!string_parse_size(tokeniser.getToken(), size)) - { - return false; - } - - if(size < 3) - { - return false; - } - controlPoints.resize(size); - - if(!string_equal(tokeniser.getToken(), "(")) - { - return false; - } - for(ControlPoints::iterator i = controlPoints.begin(); i != controlPoints.end(); ++i) - { - if(!string_parse_float(tokeniser.getToken(), (*i).x()) - || !string_parse_float(tokeniser.getToken(), (*i).y()) - || !string_parse_float(tokeniser.getToken(), (*i).z())) - { - return false; - } - } - if(!string_equal(tokeniser.getToken(), ")")) - { - return false; - } - return true; -} - -inline void ControlPoints_write(const ControlPoints& controlPoints, StringOutputStream& value) -{ - value << Unsigned(controlPoints.size()) << " ("; - for(ControlPoints::const_iterator i = controlPoints.begin(); i != controlPoints.end(); ++i) - { - value << " " << (*i).x() << " " << (*i).y() << " " << (*i).z() << " "; - } - value << ")"; -} - -inline void ControlPoint_testSelect(const Vector3& point, ObservedSelectable& selectable, Selector& selector, SelectionTest& test) -{ - SelectionIntersection best; - test.TestPoint(point, best); - if(best.valid()) - { - Selector_add(selector, selectable, best); - } -} - -class ControlPointTransform -{ - const Matrix4& m_matrix; -public: - ControlPointTransform(const Matrix4& matrix) : m_matrix(matrix) - { - } - void operator()(Vector3& point) const - { - matrix4_transform_point(m_matrix, point); - } -}; - -class ControlPointSnap -{ - float m_snap; -public: - ControlPointSnap(float snap) : m_snap(snap) - { - } - void operator()(Vector3& point) const - { - vector3_snap(point, m_snap); - } -}; - -class ControlPointAdd -{ - RenderablePointVector& m_points; -public: - ControlPointAdd(RenderablePointVector& points) : m_points(points) - { - } - void operator()(const Vector3& point) const - { - m_points.push_back(PointVertex(vertex3f_for_vector3(point), colour_vertex)); - } -}; - -class ControlPointAddSelected -{ - RenderablePointVector& m_points; -public: - ControlPointAddSelected(RenderablePointVector& points) : m_points(points) - { - } - void operator()(const Vector3& point) const - { - m_points.push_back(PointVertex(vertex3f_for_vector3(point), colour_selected)); - } -}; - -class CurveEditType -{ -public: - Shader* m_controlsShader; - Shader* m_selectedShader; -}; - -inline void ControlPoints_write(ControlPoints& controlPoints, const char* key, Entity& entity) -{ - StringOutputStream value(256); - if(!controlPoints.empty()) - { - ControlPoints_write(controlPoints, value); - } - entity.setKeyValue(key, value.c_str()); -} - -class CurveEdit -{ - SelectionChangeCallback m_selectionChanged; - ControlPoints& m_controlPoints; - typedef Array Selectables; - Selectables m_selectables; - - RenderablePointVector m_controlsRender; - mutable RenderablePointVector m_selectedRender; - -public: - typedef Static Type; - - CurveEdit(ControlPoints& controlPoints, const SelectionChangeCallback& selectionChanged) : - m_selectionChanged(selectionChanged), - m_controlPoints(controlPoints), - m_controlsRender(GL_POINTS), - m_selectedRender(GL_POINTS) - { - } - - template - const Functor& forEachSelected(const Functor& functor) - { - ASSERT_MESSAGE(m_controlPoints.size() == m_selectables.size(), "curve instance mismatch"); - ControlPoints::iterator p = m_controlPoints.begin(); - for(Selectables::iterator i = m_selectables.begin(); i != m_selectables.end(); ++i, ++p) - { - if((*i).isSelected()) - { - functor(*p); - } - } - return functor; - } - template - const Functor& forEachSelected(const Functor& functor) const - { - ASSERT_MESSAGE(m_controlPoints.size() == m_selectables.size(), "curve instance mismatch"); - ControlPoints::const_iterator p = m_controlPoints.begin(); - for(Selectables::const_iterator i = m_selectables.begin(); i != m_selectables.end(); ++i, ++p) - { - if((*i).isSelected()) - { - functor(*p); - } - } - return functor; - } - template - const Functor& forEach(const Functor& functor) const - { - for(ControlPoints::const_iterator i = m_controlPoints.begin(); i != m_controlPoints.end(); ++i) - { - functor(*i); - } - return functor; - } - - void testSelect(Selector& selector, SelectionTest& test) - { - ASSERT_MESSAGE(m_controlPoints.size() == m_selectables.size(), "curve instance mismatch"); - ControlPoints::const_iterator p = m_controlPoints.begin(); - for(Selectables::iterator i = m_selectables.begin(); i != m_selectables.end(); ++i, ++p) - { - ControlPoint_testSelect(*p, *i, selector, test); - } - } - - bool isSelected() const - { - for(Selectables::const_iterator i = m_selectables.begin(); i != m_selectables.end(); ++i) - { - if((*i).isSelected()) - { - return true; - } - } - return false; - } - void setSelected(bool selected) - { - for(Selectables::iterator i = m_selectables.begin(); i != m_selectables.end(); ++i) - { - (*i).setSelected(selected); - } - } - - void write(const char* key, Entity& entity) - { - ControlPoints_write(m_controlPoints, key, entity); - } - - void transform(const Matrix4& matrix) - { - forEachSelected(ControlPointTransform(matrix)); - } - void snapto(float snap) - { - forEachSelected(ControlPointSnap(snap)); - } - - void updateSelected() const - { - m_selectedRender.clear(); - forEachSelected(ControlPointAddSelected(m_selectedRender)); - } - - void renderComponents(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(Type::instance().m_controlsShader, Renderer::eWireframeOnly); - renderer.SetState(Type::instance().m_controlsShader, Renderer::eFullMaterials); - renderer.addRenderable(m_controlsRender, localToWorld); - } - - void renderComponentsSelected(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - updateSelected(); - if(!m_selectedRender.empty()) - { - renderer.Highlight(Renderer::ePrimitive, false); - renderer.SetState(Type::instance().m_selectedShader, Renderer::eWireframeOnly); - renderer.SetState(Type::instance().m_selectedShader, Renderer::eFullMaterials); - renderer.addRenderable(m_selectedRender, localToWorld); - } - } - - void curveChanged() - { - m_selectables.resize(m_controlPoints.size(), m_selectionChanged); - - m_controlsRender.clear(); - m_controlsRender.reserve(m_controlPoints.size()); - forEach(ControlPointAdd(m_controlsRender)); - - m_selectedRender.reserve(m_controlPoints.size()); - } - typedef MemberCaller CurveChangedCaller; -}; - - - -const int NURBS_degree = 3; - -class NURBSCurve -{ - Signal0 m_curveChanged; - Callback m_boundsChanged; -public: - ControlPoints m_controlPoints; - ControlPoints m_controlPointsTransformed; - NURBSWeights m_weights; - Knots m_knots; - RenderableCurve m_renderCurve; - AABB m_bounds; - - NURBSCurve(const Callback& boundsChanged) : m_boundsChanged(boundsChanged) - { - } - - SignalHandlerId connect(const SignalHandler& curveChanged) - { - curveChanged(); - return m_curveChanged.connectLast(curveChanged); - } - void disconnect(SignalHandlerId id) - { - m_curveChanged.disconnect(id); - } - void notify() - { - m_curveChanged(); - } - - void tesselate() - { - if(!m_controlPointsTransformed.empty()) - { - const std::size_t numSegments = (m_controlPointsTransformed.size() - 1) * 16; - m_renderCurve.m_vertices.resize(numSegments + 1); - m_renderCurve.m_vertices[0].vertex = vertex3f_for_vector3(m_controlPointsTransformed[0]); - for(std::size_t i = 1; i < numSegments; ++i) - { - m_renderCurve.m_vertices[i].vertex = vertex3f_for_vector3(NURBS_evaluate(m_controlPointsTransformed, m_weights, m_knots, NURBS_degree, (1.0 / double(numSegments)) * double(i))); - } - m_renderCurve.m_vertices[numSegments].vertex = vertex3f_for_vector3(m_controlPointsTransformed[m_controlPointsTransformed.size() - 1]); - } - else - { - m_renderCurve.m_vertices.clear(); - } - } - - void curveChanged() - { - tesselate(); - - m_bounds = AABB(); - for(ControlPoints::iterator i = m_controlPointsTransformed.begin(); i != m_controlPointsTransformed.end(); ++i) - { - aabb_extend_by_point_safe(m_bounds, (*i)); - } - - m_boundsChanged(); - notify(); - } - - bool parseCurve(const char* value) - { - if(!ControlPoints_parse(m_controlPoints, value)) - { - return false; - } - - m_weights.resize(m_controlPoints.size()); - for(NURBSWeights::iterator i = m_weights.begin(); i != m_weights.end(); ++i) - { - (*i) = 1; - } - - KnotVector_openUniform(m_knots, m_controlPoints.size(), NURBS_degree); - - //plotBasisFunction(8, 0, NURBS_degree); - - return true; - } - - void curveChanged(const char* value) - { - if(string_empty(value) || !parseCurve(value)) - { - m_controlPoints.resize(0); - m_knots.resize(0); - m_weights.resize(0); - } - m_controlPointsTransformed = m_controlPoints; - curveChanged(); - } - typedef MemberCaller1 CurveChangedCaller; -}; - -class CatmullRomSpline -{ - Signal0 m_curveChanged; - Callback m_boundsChanged; -public: - ControlPoints m_controlPoints; - ControlPoints m_controlPointsTransformed; - RenderableCurve m_renderCurve; - AABB m_bounds; - - CatmullRomSpline(const Callback& boundsChanged) : m_boundsChanged(boundsChanged) - { - } - - SignalHandlerId connect(const SignalHandler& curveChanged) - { - curveChanged(); - return m_curveChanged.connectLast(curveChanged); - } - void disconnect(SignalHandlerId id) - { - m_curveChanged.disconnect(id); - } - void notify() - { - m_curveChanged(); - } - - void tesselate() - { - if(!m_controlPointsTransformed.empty()) - { - const std::size_t numSegments = (m_controlPointsTransformed.size() - 1) * 16; - m_renderCurve.m_vertices.resize(numSegments + 1); - m_renderCurve.m_vertices[0].vertex = vertex3f_for_vector3(m_controlPointsTransformed[0]); - for(std::size_t i = 1; i < numSegments; ++i) - { - m_renderCurve.m_vertices[i].vertex = vertex3f_for_vector3(CatmullRom_evaluate(m_controlPointsTransformed, (1.0 / double(numSegments)) * double(i))); - } - m_renderCurve.m_vertices[numSegments].vertex = vertex3f_for_vector3(m_controlPointsTransformed[m_controlPointsTransformed.size() - 1]); - } - else - { - m_renderCurve.m_vertices.clear(); - } - } - - bool parseCurve(const char* value) - { - return ControlPoints_parse(m_controlPoints, value); - } - - void curveChanged() - { - tesselate(); - - m_bounds = AABB(); - for(ControlPoints::iterator i = m_controlPointsTransformed.begin(); i != m_controlPointsTransformed.end(); ++i) - { - aabb_extend_by_point_safe(m_bounds, (*i)); - } - - m_boundsChanged(); - notify(); - } - - void curveChanged(const char* value) - { - if(string_empty(value) || !parseCurve(value)) - { - m_controlPoints.resize(0); - } - m_controlPointsTransformed = m_controlPoints; - curveChanged(); - } - typedef MemberCaller1 CurveChangedCaller; -}; - -const char* const curve_Nurbs = "curve_Nurbs"; -const char* const curve_CatmullRomSpline = "curve_CatmullRomSpline"; - - -#endif diff --git a/plugins/entity/doom3group.cpp b/plugins/entity/doom3group.cpp deleted file mode 100644 index 66e2f924..00000000 --- a/plugins/entity/doom3group.cpp +++ /dev/null @@ -1,832 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -///\file -///\brief Represents any Doom3 entity which does not have a fixed size specified in its entity-definition (e.g. func_static). -/// -/// This entity behaves as a group only when the "model" key is empty or is the same as the "name" key. Otherwise it behaves as a model. -/// When behaving as a group, the "origin" key is the translation to be applied to all brushes (not patches) grouped under this entity. -/// When behaving as a model, the "origin", "angle" and "rotation" keys directly control the entity's local-to-parent transform. -/// When either the "curve_Nurbs" or "curve_CatmullRomSpline" keys define a curve, the curve is rendered and can be edited. - -#include "doom3group.h" - -#include "cullable.h" -#include "renderable.h" -#include "editable.h" -#include "modelskin.h" - -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "entitylib.h" -#include "render.h" -#include "eclasslib.h" -#include "stream/stringstream.h" -#include "pivot.h" - -#include "targetable.h" -#include "origin.h" -#include "angle.h" -#include "rotation.h" -#include "model.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" -#include "curve.h" -#include "modelskinkey.h" - -#include "entity.h" - -inline void PointVertexArray_testSelect(PointVertex* first, std::size_t count, SelectionTest& test, SelectionIntersection& best) -{ - test.TestLineStrip( - VertexPointer( - reinterpret_cast(&first->vertex), - sizeof(PointVertex) - ), - IndexPointer::index_type(count), - best - ); -} - -class Doom3Group : - public Bounded, - public Snappable -{ - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; - TraversableNodeSet m_traverse; - MatrixTransform m_transform; - - SingletonModel m_model; - OriginKey m_originKey; - Vector3 m_origin; - - RotationKey m_rotationKey; - Float9 m_rotation; - - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - TraversableObserverPairRelay m_traverseObservers; - Doom3GroupOrigin m_funcStaticOrigin; - RenderablePivot m_renderOrigin; - RenderableNamedEntity m_renderName; - mutable Vector3 m_name_origin; - ModelSkinKey m_skin; - -public: - NURBSCurve m_curveNURBS; - SignalHandlerId m_curveNURBSChanged; - CatmullRomSpline m_curveCatmullRom; - SignalHandlerId m_curveCatmullRomChanged; -private: - mutable AABB m_curveBounds; - - Callback m_transformChanged; - Callback m_evaluateTransform; - - CopiedString m_name; - CopiedString m_modelKey; - bool m_isModel; - - scene::Traversable* m_traversable; - - void construct() - { - default_rotation(m_rotation); - - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - m_keyObservers.insert("model", Doom3Group::ModelChangedCaller(*this)); - m_keyObservers.insert("origin", OriginKey::OriginChangedCaller(m_originKey)); - m_keyObservers.insert("angle", RotationKey::AngleChangedCaller(m_rotationKey)); - m_keyObservers.insert("rotation", RotationKey::RotationChangedCaller(m_rotationKey)); - m_keyObservers.insert("name", NameChangedCaller(*this)); - m_keyObservers.insert(curve_Nurbs, NURBSCurve::CurveChangedCaller(m_curveNURBS)); - m_keyObservers.insert(curve_CatmullRomSpline, CatmullRomSpline::CurveChangedCaller(m_curveCatmullRom)); - m_keyObservers.insert("skin", ModelSkinKey::SkinChangedCaller(m_skin)); - - m_traverseObservers.attach(m_funcStaticOrigin); - m_isModel = false; - m_nameKeys.setKeyIsName(keyIsNameDoom3Doom3Group); - attachTraverse(); - - m_entity.attach(m_keyObservers); - } - void destroy() - { - m_entity.detach(m_keyObservers); - - if(isModel()) - { - detachModel(); - } - else - { - detachTraverse(); - } - - m_traverseObservers.detach(m_funcStaticOrigin); - } - - void attachModel() - { - m_traversable = &m_model.getTraversable(); - m_model.attach(&m_traverseObservers); - } - void detachModel() - { - m_traversable = 0; - m_model.detach(&m_traverseObservers); - } - void attachTraverse() - { - m_traversable = &m_traverse; - m_traverse.attach(&m_traverseObservers); - } - void detachTraverse() - { - m_traversable = 0; - m_traverse.detach(&m_traverseObservers); - } - - bool isModel() const - { - return m_isModel; - } - - void setIsModel(bool newValue) - { - if(newValue && !m_isModel) - { - detachTraverse(); - attachModel(); - - m_nameKeys.setKeyIsName(Static::instance().m_keyIsName); - m_model.modelChanged(m_modelKey.c_str()); - } - else if(!newValue && m_isModel) - { - detachModel(); - attachTraverse(); - - m_nameKeys.setKeyIsName(keyIsNameDoom3Doom3Group); - } - m_isModel = newValue; - updateTransform(); - } - - void updateIsModel() - { - setIsModel(!string_equal(m_modelKey.c_str(), m_name.c_str())); - } - -// vc 2k5 compiler fix -#if _MSC_VER >= 1400 - public: -#endif - - void nameChanged(const char* value) - { - m_name = value; - updateIsModel(); - } - typedef MemberCaller1 NameChangedCaller; - - void modelChanged(const char* value) - { - m_modelKey = value; - updateIsModel(); - if(isModel()) - { - m_model.modelChanged(value); - } - else - { - m_model.modelChanged(""); - } - } - typedef MemberCaller1 ModelChangedCaller; - - void updateTransform() - { - m_transform.localToParent() = g_matrix4_identity; - if(isModel()) - { - matrix4_translate_by_vec3(m_transform.localToParent(), m_origin); - matrix4_multiply_by_matrix4(m_transform.localToParent(), rotation_toMatrix(m_rotation)); - } - m_transformChanged(); - if(!isModel()) - { - m_funcStaticOrigin.originChanged(); - } - } - typedef MemberCaller UpdateTransformCaller; - - void originChanged() - { - m_origin = m_originKey.m_origin; - updateTransform(); - } - typedef MemberCaller OriginChangedCaller; - - void rotationChanged() - { - rotation_assign(m_rotation, m_rotationKey.m_rotation); - updateTransform(); - } - typedef MemberCaller RotationChangedCaller; - - void skinChanged() - { - if(isModel()) - { - scene::Node* node = m_model.getNode(); - if(node != 0) - { - Node_modelSkinChanged(*node); - } - } - } - typedef MemberCaller SkinChangedCaller; - -public: - Doom3Group(EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform) : - m_entity(eclass), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_rotationKey(RotationChangedCaller(*this)), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_funcStaticOrigin(m_traverse, m_origin), - m_renderName(m_named, m_name_origin), - m_name_origin(g_vector3_identity), - m_skin(SkinChangedCaller(*this)), - m_curveNURBS(boundsChanged), - m_curveCatmullRom(boundsChanged), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform), - m_traversable(0) - { - construct(); - } - Doom3Group(const Doom3Group& other, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform) : - m_entity(other.m_entity), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_rotationKey(RotationChangedCaller(*this)), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_funcStaticOrigin(m_traverse, m_origin), - m_renderName(m_named, g_vector3_identity), - m_skin(SkinChangedCaller(*this)), - m_curveNURBS(boundsChanged), - m_curveCatmullRom(boundsChanged), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform), - m_traversable(0) - { - construct(); - } - ~Doom3Group() - { - destroy(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_traverse.instanceAttach(path_find_mapfile(path.begin(), path.end())); - - m_funcStaticOrigin.enable(); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_funcStaticOrigin.disable(); - - m_traverse.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - scene::Traversable& getTraversable() - { - return *m_traversable; - } - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - ModelSkin& getModelSkin() - { - return m_skin.get(); - } - - void attach(scene::Traversable::Observer* observer) - { - m_traverseObservers.attach(*observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_traverseObservers.detach(*observer); - } - - const AABB& localAABB() const - { - m_curveBounds = m_curveNURBS.m_bounds; - aabb_extend_by_aabb_safe(m_curveBounds, m_curveCatmullRom.m_bounds); - return m_curveBounds; - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - if(isModel() && selected) - { - m_renderOrigin.render(renderer, volume, localToWorld); - } - - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eFullMaterials); - - if(!m_curveNURBS.m_renderCurve.m_vertices.empty()) - { - renderer.addRenderable(m_curveNURBS.m_renderCurve, localToWorld); - } - if(!m_curveCatmullRom.m_renderCurve.m_vertices.empty()) - { - renderer.addRenderable(m_curveCatmullRom.m_renderCurve, localToWorld); - } - } - - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected, const AABB& childBounds) const - { - renderSolid(renderer, volume, localToWorld, selected); - - if(g_showNames) - { - // draw models as usual - if(!isModel()) - { - // don't draw the name for worldspawn - if(!strcmp(m_entity.getEntityClass().name(), "worldspawn")) - return; - - // place name in the middle of the "children cloud" - m_name_origin = childBounds.origin; - } - - renderer.addRenderable(m_renderName, localToWorld); - } - } - - void testSelect(Selector& selector, SelectionTest& test, SelectionIntersection& best) - { - PointVertexArray_testSelect(&m_curveNURBS.m_renderCurve.m_vertices[0], m_curveNURBS.m_renderCurve.m_vertices.size(), test, best); - PointVertexArray_testSelect(&m_curveCatmullRom.m_renderCurve.m_vertices[0], m_curveCatmullRom.m_renderCurve.m_vertices.size(), test, best); - } - - void translate(const Vector3& translation) - { - m_origin = origin_translated(m_origin, translation); - } - void rotate(const Quaternion& rotation) - { - rotation_rotate(m_rotation, rotation); - } - void snapto(float snap) - { - m_originKey.m_origin = origin_snapped(m_originKey.m_origin, snap); - m_originKey.write(&m_entity); - } - void revertTransform() - { - m_origin = m_originKey.m_origin; - rotation_assign(m_rotation, m_rotationKey.m_rotation); - m_curveNURBS.m_controlPointsTransformed = m_curveNURBS.m_controlPoints; - m_curveCatmullRom.m_controlPointsTransformed = m_curveCatmullRom.m_controlPoints; - } - void freezeTransform() - { - m_originKey.m_origin = m_origin; - m_originKey.write(&m_entity); - rotation_assign(m_rotationKey.m_rotation, m_rotation); - m_rotationKey.write(&m_entity); - m_curveNURBS.m_controlPoints = m_curveNURBS.m_controlPointsTransformed; - ControlPoints_write(m_curveNURBS.m_controlPoints, curve_Nurbs, m_entity); - m_curveCatmullRom.m_controlPoints = m_curveCatmullRom.m_controlPointsTransformed; - ControlPoints_write(m_curveCatmullRom.m_controlPoints, curve_CatmullRomSpline, m_entity); - } - void transformChanged() - { - revertTransform(); - m_evaluateTransform(); - updateTransform(); - m_curveNURBS.curveChanged(); - m_curveCatmullRom.curveChanged(); - } - typedef MemberCaller TransformChangedCaller; -}; - -class ControlPointAddBounds -{ - AABB& m_bounds; -public: - ControlPointAddBounds(AABB& bounds) : m_bounds(bounds) - { - } - void operator()(const Vector3& point) const - { - aabb_extend_by_point_safe(m_bounds, point); - } -}; - -class Doom3GroupInstance : - public TargetableInstance, - public TransformModifier, - public Renderable, - public SelectionTestable, - public ComponentSelectionTestable, - public ComponentEditable, - public ComponentSnappable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - Doom3Group& m_contained; - CurveEdit m_curveNURBS; - CurveEdit m_curveCatmullRom; - mutable AABB m_aabb_component; -public: - - typedef LazyStatic StaticTypeCasts; - - - Bounded& get(NullType) - { - return m_contained; - } - - STRING_CONSTANT(Name, "Doom3GroupInstance"); - - Doom3GroupInstance(const scene::Path& path, scene::Instance* parent, Doom3Group& contained) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), contained.getEntity(), *this), - TransformModifier(Doom3Group::TransformChangedCaller(contained), ApplyTransformCaller(*this)), - m_contained(contained), - m_curveNURBS(m_contained.m_curveNURBS.m_controlPointsTransformed, SelectionChangedComponentCaller(*this)), - m_curveCatmullRom(m_contained.m_curveCatmullRom.m_controlPointsTransformed, SelectionChangedComponentCaller(*this)) - { - m_contained.instanceAttach(Instance::path()); - m_contained.m_curveNURBSChanged = m_contained.m_curveNURBS.connect(CurveEdit::CurveChangedCaller(m_curveNURBS)); - m_contained.m_curveCatmullRomChanged = m_contained.m_curveCatmullRom.connect(CurveEdit::CurveChangedCaller(m_curveCatmullRom)); - - StaticRenderableConnectionLines::instance().attach(*this); - } - ~Doom3GroupInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - - m_contained.m_curveCatmullRom.disconnect(m_contained.m_curveCatmullRomChanged); - m_contained.m_curveNURBS.disconnect(m_contained.m_curveNURBSChanged); - m_contained.instanceDetach(Instance::path()); - } - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - - m_curveNURBS.renderComponentsSelected(renderer, volume, localToWorld()); - m_curveCatmullRom.renderComponentsSelected(renderer, volume, localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childBounds()); - - m_curveNURBS.renderComponentsSelected(renderer, volume, localToWorld()); - m_curveCatmullRom.renderComponentsSelected(renderer, volume, localToWorld()); - } - void renderComponents(Renderer& renderer, const VolumeTest& volume) const - { - if(GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex) - { - m_curveNURBS.renderComponents(renderer, volume, localToWorld()); - m_curveCatmullRom.renderComponents(renderer, volume, localToWorld()); - } - } - - void testSelect(Selector& selector, SelectionTest& test) - { - test.BeginMesh(localToWorld()); - SelectionIntersection best; - - m_contained.testSelect(selector, test, best); - - if(best.valid()) - { - Selector_add(selector, getSelectable(), best); - } - } - - bool isSelectedComponents() const - { - return m_curveNURBS.isSelected() || m_curveCatmullRom.isSelected(); - } - void setSelectedComponents(bool selected, SelectionSystem::EComponentMode mode) - { - if(mode == SelectionSystem::eVertex) - { - m_curveNURBS.setSelected(selected); - m_curveCatmullRom.setSelected(selected); - } - } - void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - { - if(mode == SelectionSystem::eVertex) - { - test.BeginMesh(localToWorld()); - m_curveNURBS.testSelect(selector, test); - m_curveCatmullRom.testSelect(selector, test); - } - } - - void transformComponents(const Matrix4& matrix) - { - if(m_curveNURBS.isSelected()) - { - m_curveNURBS.transform(matrix); - } - if(m_curveCatmullRom.isSelected()) - { - m_curveCatmullRom.transform(matrix); - } - } - - const AABB& getSelectedComponentsBounds() const - { - m_aabb_component = AABB(); - m_curveNURBS.forEachSelected(ControlPointAddBounds(m_aabb_component)); - m_curveCatmullRom.forEachSelected(ControlPointAddBounds(m_aabb_component)); - return m_aabb_component; - } - - void snapComponents(float snap) - { - if(m_curveNURBS.isSelected()) - { - m_curveNURBS.snapto(snap); - m_curveNURBS.write(curve_Nurbs, m_contained.getEntity()); - } - if(m_curveCatmullRom.isSelected()) - { - m_curveCatmullRom.snapto(snap); - m_curveCatmullRom.write(curve_CatmullRomSpline, m_contained.getEntity()); - } - } - - void evaluateTransform() - { - if(getType() == TRANSFORM_PRIMITIVE) - { - m_contained.translate(getTranslation()); - m_contained.rotate(getRotation()); - } - else - { - transformComponents(calculateTransform()); - } - } - void applyTransform() - { - m_contained.revertTransform(); - evaluateTransform(); - m_contained.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; - - void selectionChangedComponent(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::eComponent)(selectable); - GlobalSelectionSystem().onComponentSelection(*this, selectable); - } - typedef MemberCaller1 SelectionChangedComponentCaller; -}; - -class Doom3GroupNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable, - public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Doom3Group m_contained; - - void construct() - { - m_contained.attach(this); - } - void destroy() - { - m_contained.detach(this); - } -public: - - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_contained.getTraversable(); - } - Snappable& get(NullType) - { - return m_contained; - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - ModelSkin& get(NullType) - { - return m_contained.getModelSkin(); - } - - Doom3GroupNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSet::BoundsChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - Doom3GroupNode(const Doom3GroupNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - scene::Traversable::Observer(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSet::BoundsChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - ~Doom3GroupNode() - { - destroy(); - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new Doom3GroupNode(*this))->node(); - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new Doom3GroupInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -void Doom3Group_construct() -{ - CurveEdit::Type::instance().m_controlsShader = GlobalShaderCache().capture("$POINT"); - CurveEdit::Type::instance().m_selectedShader = GlobalShaderCache().capture("$SELPOINT"); -} - -void Doom3Group_destroy() -{ - GlobalShaderCache().release("$SELPOINT"); - GlobalShaderCache().release("$POINT"); -} - -scene::Node& New_Doom3Group(EntityClass* eclass) -{ - return (new Doom3GroupNode(eclass))->node(); -} diff --git a/plugins/entity/doom3group.h b/plugins/entity/doom3group.h deleted file mode 100644 index bde7f084..00000000 --- a/plugins/entity/doom3group.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STATIC_H) -#define INCLUDED_STATIC_H - -namespace scene -{ - class Node; -} -class EntityClass; - -void Doom3Group_construct(); -void Doom3Group_destroy(); -scene::Node& New_Doom3Group(EntityClass* eclass); - -#endif diff --git a/plugins/entity/eclassmodel.cpp b/plugins/entity/eclassmodel.cpp index d69fb8c8..c4c6dde7 100644 --- a/plugins/entity/eclassmodel.cpp +++ b/plugins/entity/eclassmodel.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,514 +19,157 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -///\file -///\brief Represents any entity which has a fixed size specified in its entity-definition and displays a model (e.g. ammo_bfg). -/// -/// This entity displays the model specified in its entity-definition. -/// The "origin" and "angle" keys directly control the entity's local-to-parent transform. -/// The "rotation" key directly controls the entity's local-to-parent transform for Doom3 only. +#include -#include "eclassmodel.h" +#include "entity_entitymodel.h" -#include "cullable.h" -#include "renderable.h" -#include "editable.h" +// +// CEntityEclassModel implementation +// -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "entitylib.h" -#include "render.h" -#include "eclasslib.h" -#include "pivot.h" - -#include "targetable.h" -#include "origin.h" -#include "angle.h" -#include "rotation.h" -#include "model.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" -#include "modelskinkey.h" - -#include "entity.h" - -class EclassModel : - public Snappable +CEntityEclassModel::CEntityEclassModel () { - MatrixTransform m_transform; - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; + refCount = 1; + m_eclass = NULL; + m_model = NULL; + VectorSet(m_translate, 0,0,0); + VectorSet(m_euler, 0,0,0); + VectorSet(m_scale, 1,1,1); + VectorSet(m_pivot, 0,0,0); + m4x4_identity(m_transform); + m4x4_identity(m_inverse_transform); +} - OriginKey m_originKey; - Vector3 m_origin; - AngleKey m_angleKey; - float m_angle; - RotationKey m_rotationKey; - Float9 m_rotation; - SingletonModel m_model; - - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - RenderablePivot m_renderOrigin; - RenderableNamedEntity m_renderName; - ModelSkinKey m_skin; - - Callback m_transformChanged; - Callback m_evaluateTransform; - - void construct() - { - default_rotation(m_rotation); - - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - if(g_gameType == eGameTypeDoom3) - { - m_keyObservers.insert("angle", RotationKey::AngleChangedCaller(m_rotationKey)); - m_keyObservers.insert("rotation", RotationKey::RotationChangedCaller(m_rotationKey)); - } - else - { - m_keyObservers.insert("angle", AngleKey::AngleChangedCaller(m_angleKey)); - } - m_keyObservers.insert("origin", OriginKey::OriginChangedCaller(m_originKey)); - } - -// vc 2k5 compiler fix -#if _MSC_VER >= 1400 - public: -#endif - - void updateTransform() - { - m_transform.localToParent() = g_matrix4_identity; - matrix4_translate_by_vec3(m_transform.localToParent(), m_origin); - - if(g_gameType == eGameTypeDoom3) - { - matrix4_multiply_by_matrix4(m_transform.localToParent(), rotation_toMatrix(m_rotation)); - } - else - { - matrix4_multiply_by_matrix4(m_transform.localToParent(), matrix4_rotation_for_z_degrees(m_angle)); - } - - m_transformChanged(); - } - typedef MemberCaller UpdateTransformCaller; - - void originChanged() - { - m_origin = m_originKey.m_origin; - updateTransform(); - } - typedef MemberCaller OriginChangedCaller; - void angleChanged() - { - m_angle = m_angleKey.m_angle; - updateTransform(); - } - typedef MemberCaller AngleChangedCaller; - void rotationChanged() - { - rotation_assign(m_rotation, m_rotationKey.m_rotation); - updateTransform(); - } - typedef MemberCaller RotationChangedCaller; - - void skinChanged() - { - scene::Node* node = m_model.getNode(); - if(node != 0) - { - Node_modelSkinChanged(*node); - } - } - typedef MemberCaller SkinChangedCaller; - -public: - - EclassModel(EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(eclass), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_angleKey(AngleChangedCaller(*this)), - m_angle(ANGLEKEY_IDENTITY), - m_rotationKey(RotationChangedCaller(*this)), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, g_vector3_identity), - m_skin(SkinChangedCaller(*this)), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - EclassModel(const EclassModel& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(other.m_entity), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_angleKey(AngleChangedCaller(*this)), - m_angle(ANGLEKEY_IDENTITY), - m_rotationKey(RotationChangedCaller(*this)), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, g_vector3_identity), - m_skin(SkinChangedCaller(*this)), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_entity.attach(m_keyObservers); - m_model.modelChanged(m_entity.getEntityClass().modelpath()); - m_skin.skinChanged(m_entity.getEntityClass().skin()); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_skin.skinChanged(""); - m_model.modelChanged(""); - m_entity.detach(m_keyObservers); - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - scene::Traversable& getTraversable() - { - return m_model.getTraversable(); - } - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - ModelSkin& getModelSkin() - { - return m_skin.get(); - } - - void attach(scene::Traversable::Observer* observer) - { - m_model.attach(observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_model.detach(observer); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - if(selected) - { - m_renderOrigin.render(renderer, volume, localToWorld); - } - - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - renderSolid(renderer, volume, localToWorld, selected); - if(g_showNames) - { - renderer.addRenderable(m_renderName, localToWorld); - } - } - - void translate(const Vector3& translation) - { - m_origin = origin_translated(m_origin, translation); - } - void rotate(const Quaternion& rotation) - { - if(g_gameType == eGameTypeDoom3) - { - rotation_rotate(m_rotation, rotation); - } - else - { - m_angle = angle_rotated(m_angle, rotation); - } - } - void snapto(float snap) - { - m_originKey.m_origin = origin_snapped(m_originKey.m_origin, snap); - m_originKey.write(&m_entity); - } - void revertTransform() - { - m_origin = m_originKey.m_origin; - if(g_gameType == eGameTypeDoom3) - { - rotation_assign(m_rotation, m_rotationKey.m_rotation); - } - else - { - m_angle = m_angleKey.m_angle; - } - } - void freezeTransform() - { - m_originKey.m_origin = m_origin; - m_originKey.write(&m_entity); - if(g_gameType == eGameTypeDoom3) - { - rotation_assign(m_rotationKey.m_rotation, m_rotation); - m_rotationKey.write(&m_entity); - } - else - { - m_angleKey.m_angle = m_angle; - m_angleKey.write(&m_entity); - } - } - void transformChanged() - { - revertTransform(); - m_evaluateTransform(); - updateTransform(); - } - typedef MemberCaller TransformChangedCaller; -}; - -class EclassModelInstance : public TargetableInstance, public TransformModifier, public Renderable +CEntityEclassModel::~CEntityEclassModel () { - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - EclassModel& m_contained; -public: - typedef LazyStatic StaticTypeCasts; - - STRING_CONSTANT(Name, "EclassModelInstance"); - - EclassModelInstance(const scene::Path& path, scene::Instance* parent, EclassModel& contained) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), contained.getEntity(), *this), - TransformModifier(EclassModel::TransformChangedCaller(contained), ApplyTransformCaller(*this)), - m_contained(contained) - { - m_contained.instanceAttach(Instance::path()); - - StaticRenderableConnectionLines::instance().attach(*this); - } - ~EclassModelInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - - m_contained.instanceDetach(Instance::path()); - } - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - - void evaluateTransform() - { - if(getType() == TRANSFORM_PRIMITIVE) - { - m_contained.translate(getTranslation()); - m_contained.rotate(getRotation()); - } - } - void applyTransform() - { - m_contained.revertTransform(); - evaluateTransform(); - m_contained.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; -}; - -class EclassModelNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable, - public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - EclassModel m_contained; - - void construct() - { - m_contained.attach(this); - } - void destroy() - { - m_contained.detach(this); - } - -public: - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_contained.getTraversable(); - } - Snappable& get(NullType) - { - return m_contained; - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - ModelSkin& get(NullType) - { - return m_contained.getModelSkin(); - } - - EclassModelNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - EclassModelNode(const EclassModelNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - scene::Traversable::Observer(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - ~EclassModelNode() - { - destroy(); - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Node& clone() const - { - return (new EclassModelNode(*this))->node(); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new EclassModelInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -scene::Node& New_EclassModel(EntityClass* eclass) -{ - return (new EclassModelNode(eclass))->node(); + if(m_name.c_str()[0] != '\0' + && m_version.c_str()[0] != '\0') + GetModelCache()->DeleteByID(m_name.c_str(), m_version.c_str()); } +// IRender + +void CEntityEclassModel::Draw(int state, int rflags) const +{ + // push the current modelview matrix + // FIXME: put in a check for stack recursion depth.. + // or avoid recursion of opengl matrix stack + g_QglTable.m_pfn_qglPushMatrix(); + // apply the parent-to-local transform + g_QglTable.m_pfn_qglMultMatrixf(m_transform); + + // draw children + if(m_model && m_model->pRender) + { + m_model->pRender->Draw(state, rflags); + } + + g_QglTable.m_pfn_qglPopMatrix(); +} + +// ISelect + +bool CEntityEclassModel::TestRay(const ray_t *ray, vec_t *dist) const +{ + vec_t dist_start = *dist; + vec_t dist_local = *dist; + ray_t ray_local = *ray; + + if (aabb_intersect_ray(&m_BBox, &ray_local, &dist_local)) + *dist = dist_local; + return *dist < dist_start; +} + + +//IEdit + +void CEntityEclassModel::Translate(const vec3_t translation) +{ + VectorIncrement(translation, m_translate); + UpdateCachedData(); +} + +void CEntityEclassModel::Rotate(const vec3_t pivot, const vec3_t rotation) +{ + m4x4_t rotation_matrix; + + m4x4_identity(rotation_matrix); + m4x4_pivoted_rotate_by_vec3(rotation_matrix, rotation, eXYZ, pivot); + m4x4_transform_point(rotation_matrix, m_translate); + + VectorIncrement(rotation, m_euler); + + UpdateCachedData(); +} + +void CEntityEclassModel::OnKeyValueChanged(entity_t *e, const char *key, const char* value) +{ + if(strcmp(key,"origin") == 0) + { + sscanf(value, "%f %f %f", &m_translate[0], &m_translate[1], &m_translate[2]); + UpdateCachedData(); + } + else if(strcmp(key,"angle") == 0) + { + VectorSet(m_euler, 0, 0, (float) atof(value)); + UpdateCachedData(); + } +} + +void CEntityEclassModel::SetEclass(const eclass_t* eclass) +{ + m_eclass = eclass; +} + +void CEntityEclassModel::SetName(const char *name) +{ + if(strcmp(m_name.c_str(), name) == 0) + return; + + if(m_name.c_str()[0] != '\0' + && m_version.c_str()[0] != '\0') + GetModelCache()->DeleteByID(m_name.c_str(), m_version.c_str()); + + m_model = NULL; + m_name = name; + + if(m_name.c_str()[0] != '\0') + { + const char* dot = strrchr(m_name.c_str(), '.'); + if(dot != NULL) + { + m_version = ++dot; + m_model = GetModelCache()->GetByID(m_name.c_str(), m_version.c_str()); + } + } + + UpdateCachedData(); +} + +// +// CEntityEclassModel +// + +// private: + +void CEntityEclassModel::UpdateCachedData() +{ + aabb_t aabb_temp; + + aabb_clear(&aabb_temp); + + m4x4_identity(m_transform); + m4x4_pivoted_transform_by_vec3(m_transform, m_translate, m_euler, eXYZ, m_scale, m_pivot); + memcpy(m_inverse_transform, m_transform, sizeof(m4x4_t)); + if(m4x4_invert(m_inverse_transform) == 1) { + Sys_Printf("ERROR: Singular Matrix, cannot invert"); + } + + if(m_eclass) + aabb_construct_for_vec3(&aabb_temp, m_eclass->mins, m_eclass->maxs); + else + VectorSet(aabb_temp.extents, 8, 8, 8); + + aabb_for_transformed_aabb(&m_BBox, &aabb_temp, m_transform); +} diff --git a/plugins/entity/eclassmodel.h b/plugins/entity/eclassmodel.h deleted file mode 100644 index c9adef95..00000000 --- a/plugins/entity/eclassmodel.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ECLASSMODEL_H) -#define INCLUDED_ECLASSMODEL_H - -namespace scene -{ - class Node; -}; -class EntityClass; - -scene::Node& New_EclassModel(EntityClass* eclass); - -#include "entity.h" - -#endif diff --git a/plugins/entity/entity.cpp b/plugins/entity/entity.cpp index 441481d9..28faf425 100644 --- a/plugins/entity/entity.cpp +++ b/plugins/entity/entity.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,372 +19,359 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "plugin.h" #include "entity.h" - -#include "ifilter.h" -#include "selectable.h" -#include "namespace.h" - -#include "scenelib.h" -#include "entitylib.h" -#include "eclasslib.h" -#include "pivot.h" - -#include "targetable.h" -#include "uniquenames.h" -#include "namekeys.h" -#include "stream/stringstream.h" -#include "filters.h" - - -#include "miscmodel.h" +#include "entity_entitymodel.h" #include "light.h" -#include "group.h" -#include "eclassmodel.h" -#include "generic.h" -#include "doom3group.h" + +int g_entityId = 1; -EGameType g_gameType; +// internal -inline scene::Node& entity_for_eclass(EntityClass* eclass) +static void Entity_FreeEpairs(entity_t *e); + +static void SetKeyValue (epair_t *&e, const char *key, const char *value); +static void DeleteKey (epair_t *&e, const char *key); +static const char *ValueForKey ( epair_t *&e, const char *key); + +static void Entity_OnKeyValueChanged(entity_t *e, const char* key, const char* value); + +// constructor +entity_t *Entity_Alloc() { - if(classname_equal(eclass->name(), "misc_model") - || classname_equal(eclass->name(), "misc_gamemodel") - || classname_equal(eclass->name(), "model_static")) + entity_t *e; + e = (entity_t*)malloc (sizeof(*e)); + e->entityId = g_entityId++; + VectorSet(e->origin, 0, 0, 0); + VectorSet(e->color, 1, 1, 1); + e->redoId = 0; + e->undoId = 0; + e->next = e->prev = NULL; + e->brushes.onext = e->brushes.oprev = &e->brushes; + e->epairs = NULL; + e->eclass = NULL; + e->model.pRender = NULL; + e->model.pSelect = NULL; + e->model.pEdit = NULL; + return e; +} + +// destructor +void Entity_Free (entity_t *e) +{ + while (e->brushes.onext != &e->brushes) + Brush_Free( e->brushes.onext, true ); + + if (e->next) + { + e->next->prev = e->prev; + e->prev->next = e->next; + } + + Entity_FreeEpairs(e); + + if (e->model.pRender) { - return New_MiscModel(eclass); + e->model.pRender->DecRef(); + e->model.pRender = NULL; } - else if(classname_equal(eclass->name(), "light") - || classname_equal(eclass->name(), "lightJunior")) + if (e->model.pSelect) { - return New_Light(eclass); + e->model.pSelect->DecRef(); + e->model.pSelect = NULL; } - if(!eclass->fixedsize) + if (e->model.pEdit) { - if(g_gameType == eGameTypeDoom3) + e->model.pEdit->DecRef(); + e->model.pEdit = NULL; + } + + free (e); +} + +// construct from entity +entity_t *Entity_Clone (entity_t *e) +{ + entity_t *n; + epair_t *ep; + + n = Entity_Alloc(); + n->eclass = e->eclass; + + for (ep = e->epairs ; ep ; ep=ep->next) + SetKeyValue(n, ep->key, ep->value); + + // copy some misc stuff as well + VectorCopy( e->origin, n->origin ); +// VectorCopy( e->vRotation, n->vRotation ); +// VectorCopy( e->vScale, n->vScale ); + +// n->bDirty = true; + + return n; +} + + + + + +const char *ValueForKey ( epair_t *&e, const char *key) +{ + epair_t *ep; + for (ep=e ; ep ; ep=ep->next) + { + if (!strcmp (ep->key, key) ) { - return New_Doom3Group(eclass); - } - else - { - return New_Group(eclass); + return ep->value; } } - else if(!string_empty(eclass->modelpath())) + return ""; +} + +const char *ValueForKey (entity_t *ent, const char *key) +{ + return ValueForKey(ent->epairs, key); +} + +void SetKeyValue (epair_t *&e, const char *key, const char *value) +{ + epair_t *ep; + for (ep=e ; ep ; ep=ep->next) { - return New_EclassModel(eclass); + if (!strcmp (ep->key, key) ) + { + free (ep->value); + ep->value = (char*)malloc(strlen(value)+1); + strcpy (ep->value, value); + return; + } } - else + ep = (epair_t*)malloc (sizeof(*ep)); + ep->next = e; + e = ep; + ep->key = (char*)malloc(strlen(key)+1); + strcpy (ep->key, key); + ep->value = (char*)malloc(strlen(value)+1); + strcpy (ep->value, value); + +} + +void SetKeyValue (entity_t *ent, const char *key, const char *value) +{ + if (ent == NULL) { - return New_GenericEntity(eclass); + Sys_FPrintf(SYS_ERR, "ERROR: SetKeyValue: NULL entity \n"); + return; + } + + if (!key || !key[0]) + { + Sys_FPrintf(SYS_ERR, "ERROR: SetKeyValue: NULL or zero-length key\n"); + return; + } + + SetKeyValue(ent->epairs, key, value); + /*! + \todo TODO broadcast this through a clean messaging API ;-) + */ + Entity_OnKeyValueChanged(ent, key, value); +} + +void DeleteKey (epair_t *&e, const char *key) +{ + epair_t **ep, *next; + + ep = &e; + while (*ep) + { + next = *ep; + if ( !strcmp (next->key, key) ) + { + *ep = next->next; + free(next->key); + free(next->value); + free(next); + return; + } + ep = &next->next; + } +} + +void DeleteKey (entity_t *ent, const char *key) +{ + DeleteKey(ent->epairs, key); + Entity_OnKeyValueChanged(ent, key, ""); +} + +float FloatForKey (entity_t *ent, const char *key) +{ + const char *k; + + k = ValueForKey (ent, key); + return (float) atof(k); +} + +int IntForKey (entity_t *ent, const char *key) +{ + const char *k; + + k = ValueForKey (ent, key); + return atoi(k); +} + +void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec) +{ + const char *k; + + k = ValueForKey (ent, key); + sscanf (k, "%f %f %f", &vec[0], &vec[1], &vec[2]); +} + +/* +=============== +Entity_FreeEpairs + +Frees the entity epairs. +=============== +*/ +void Entity_FreeEpairs(entity_t *e) +{ + epair_t *ep, *next; + + for (ep = e->epairs; ep; ep = next) + { + next = ep->next; + free (ep->key); + free (ep->value); + free (ep); + } + e->epairs = NULL; +} + +void Entity_AddToList(entity_t *e, entity_t *elist) +{ + if (e->next || e->prev) + Error ("Entity_AddToList: already linked"); + //e->next = elist->next; + //elist->next->prev = e; + //elist->next = e; + //e->prev = elist; + e->next = elist; + e->prev = elist->prev; + elist->prev->next = e; + elist->prev = e; +} + +void Entity_RemoveFromList (entity_t *e) +{ + if (!e->next || !e->prev) + Error ("Entity_RemoveFromList: not linked"); + e->next->prev = e->prev; + e->prev->next = e->next; + e->next = e->prev = NULL; +} + +void Entity_LinkBrush (entity_t *e, brush_t *b) +{ + if (b->oprev || b->onext) + Error ("Entity_LinkBrush: Already linked"); + b->owner = e; + +// b->onext = e->brushes.onext; +// b->oprev = &e->brushes; +// e->brushes.onext->oprev = b; +// e->brushes.onext = b; + /* + SPoG - changed to add brushes to end of list instead of start - so this can be used by map loader. + This could concievably cause a problem if someone is traversing e->brushes while calling this function. + So don't. + */ + b->onext = &e->brushes; + b->oprev = e->brushes.oprev; + e->brushes.oprev->onext = b; + e->brushes.oprev = b; +} + +void Entity_UnlinkBrush (brush_t *b) +{ + if (!b->onext || !b->oprev) + Error ("Entity_UnlinkBrush: Not currently linked"); + b->onext->oprev = b->oprev; + b->oprev->onext = b->onext; + b->onext = b->oprev = NULL; + b->owner = NULL; +} + +// for undo +int Entity_MemorySize(entity_t *e) +{ + epair_t *ep; + int size = 0; + + for (ep = e->epairs; ep; ep = ep->next) + { + size += strlen(ep->key); + size += strlen(ep->value); + size += sizeof(epair_t); + } + size += sizeof(entity_t); + return size; +} + +epair_t* Entity_AllocateEpair(const char *key, const char *value) +{ + epair_t *ep = (epair_t*)malloc (sizeof(*ep)); + ep->key = (char*)malloc(strlen(key)+1); + strcpy (ep->key, key); + ep->value = (char*)malloc(strlen(value)+1); + strcpy (ep->value, value); + ep->next = NULL; + return ep; +} + +epair_t** Entity_GetKeyValList(entity_t *e) +{ + return &e->epairs; +} + +void Entity_SetKeyValList(entity_t *e, epair_t* ep) +{ + if( e->epairs ) + Sys_Printf( "Warning : pe->epairs != NULL in Entity_SetKeyValList, will not set\n" ); + else { + e->epairs = ep; + + for (epair_t *pe_ep = e->epairs; pe_ep; pe_ep = pe_ep->next) + Entity_OnKeyValueChanged(e, pe_ep->key, pe_ep->value); } } -void Entity_setName(Entity& entity, const char* name) + +/*! +\todo FIXME TTimo +this is meant to raise messages instead of calling the IEdit directly +*/ +static void Entity_OnKeyValueChanged(entity_t *e, const char *key, const char* value) { - entity.setKeyValue("name", name); -} -typedef ReferenceCaller1 EntitySetNameCaller; - -inline Namespaced* Node_getNamespaced(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline scene::Node& node_for_eclass(EntityClass* eclass) -{ - scene::Node& node = entity_for_eclass(eclass); - Node_getEntity(node)->setKeyValue("classname", eclass->name()); - - if(g_gameType == eGameTypeDoom3 - && string_not_empty(eclass->name()) - && !string_equal(eclass->name(), "worldspawn") - && !string_equal(eclass->name(), "UNKNOWN_CLASS")) - { - char buffer[1024]; - strcpy(buffer, eclass->name()); - strcat(buffer, "_1"); - GlobalNamespace().makeUnique(buffer, EntitySetNameCaller(*Node_getEntity(node))); - } - - Namespaced* namespaced = Node_getNamespaced(node); - if(namespaced != 0) - { - namespaced->setNamespace(GlobalNamespace()); - } - - return node; -} - -EntityCreator::KeyValueChangedFunc EntityKeyValues::m_entityKeyValueChanged = 0; -EntityCreator::KeyValueChangedFunc KeyValue::m_entityKeyValueChanged = 0; -Counter* EntityKeyValues::m_counter = 0; - -bool g_showNames = true; -bool g_showAngles = true; -bool g_newLightDraw = true; -bool g_lightRadii = false; - -class ConnectEntities -{ -public: - Entity* m_e1; - Entity* m_e2; - ConnectEntities(Entity* e1, Entity* e2) : m_e1(e1), m_e2(e2) - { - } - void connect(const char* name) - { - m_e1->setKeyValue("target", name); - m_e2->setKeyValue("targetname", name); - } - typedef MemberCaller1 ConnectCaller; -}; - -inline Entity* ScenePath_getEntity(const scene::Path& path) -{ - Entity* entity = Node_getEntity(path.top()); - if(entity == 0) - { - entity = Node_getEntity(path.parent()); - } - return entity; -} - -class Quake3EntityCreator : public EntityCreator -{ -public: - scene::Node& createEntity(EntityClass* eclass) - { - return node_for_eclass(eclass); - } - void setKeyValueChangedFunc(KeyValueChangedFunc func) - { - EntityKeyValues::setKeyValueChangedFunc(func); - } - void setCounter(Counter* counter) - { - EntityKeyValues::setCounter(counter); - } - void connectEntities(const scene::Path& path, const scene::Path& targetPath) - { - Entity* e1 = ScenePath_getEntity(path); - Entity* e2 = ScenePath_getEntity(targetPath); - - if(e1 == 0 || e2 == 0) - { - globalErrorStream() << "entityConnectSelected: both of the selected instances must be an entity\n"; - return; - } - - if(e1 == e2) - { - globalErrorStream() << "entityConnectSelected: the selected instances must not both be from the same entity\n"; - return; - } - - - UndoableCommand undo("entityConnectSelected"); - - if(g_gameType == eGameTypeDoom3) - { - StringOutputStream key(16); - for(unsigned int i = 0; ; ++i) - { - key << "target"; - if(i != 0) - { - key << i; - } - const char* value = e1->getKeyValue(key.c_str()); - if(string_empty(value)) - { - e1->setKeyValue(key.c_str(), e2->getKeyValue("name")); - break; - } - key.clear(); - } - } - else - { - ConnectEntities connector(e1, e2); - const char* value = e2->getKeyValue("targetname"); - if(string_empty(value)) - { - value = e1->getKeyValue("target"); - } - if(!string_empty(value)) - { - connector.connect(value); - } - else - { - const char* type = e2->getKeyValue("classname"); - if(string_empty(type)) - { - type = "t"; - } - StringOutputStream key(64); - key << type << "1"; - GlobalNamespace().makeUnique(key.c_str(), ConnectEntities::ConnectCaller(connector)); - } - } - - SceneChangeNotify(); - } - void setLightRadii(bool lightRadii) - { - g_lightRadii = lightRadii; - } - bool getLightRadii() - { - return g_lightRadii; - } - void setShowNames(bool showNames) - { - g_showNames = showNames; - } - bool getShowNames() - { - return g_showNames; - } - void setShowAngles(bool showAngles) - { - g_showAngles = showAngles; - } - bool getShowAngles() - { - return g_showAngles; - } - - void printStatistics() const - { - StringPool_analyse(EntityKeyValues::getPool()); - } -}; - -Quake3EntityCreator g_Quake3EntityCreator; - -EntityCreator& GetEntityCreator() -{ - return g_Quake3EntityCreator; -} - - - -class filter_entity_classname : public EntityFilter -{ - const char* m_classname; -public: - filter_entity_classname(const char* classname) : m_classname(classname) - { - } - bool filter(const Entity& entity) const - { - return string_equal(entity.getKeyValue("classname"), m_classname); - } -}; - -class filter_entity_classgroup : public EntityFilter -{ - const char* m_classgroup; - std::size_t m_length; -public: - filter_entity_classgroup(const char* classgroup) : m_classgroup(classgroup), m_length(string_length(m_classgroup)) - { - } - bool filter(const Entity& entity) const - { - return string_equal_n(entity.getKeyValue("classname"), m_classgroup, m_length); - } -}; - -filter_entity_classname g_filter_entity_world("worldspawn"); -filter_entity_classname g_filter_entity_func_group("func_group"); -filter_entity_classname g_filter_entity_light("light"); -filter_entity_classname g_filter_entity_misc_model("misc_model"); -filter_entity_classname g_filter_entity_misc_gamemodel("misc_gamemodel"); -filter_entity_classgroup g_filter_entity_trigger("trigger_"); -filter_entity_classgroup g_filter_entity_path("path_"); - -class filter_entity_doom3model : public EntityFilter -{ -public: - bool filter(const Entity& entity) const - { - return string_equal(entity.getKeyValue("classname"), "func_static") - && !string_equal(entity.getKeyValue("model"), entity.getKeyValue("name")); - } -}; - -filter_entity_doom3model g_filter_entity_doom3model; - - -void Entity_InitFilters() -{ - add_entity_filter(g_filter_entity_world, EXCLUDE_WORLD); - add_entity_filter(g_filter_entity_func_group, EXCLUDE_WORLD); - add_entity_filter(g_filter_entity_world, EXCLUDE_ENT, true); - add_entity_filter(g_filter_entity_trigger, EXCLUDE_TRIGGERS); - add_entity_filter(g_filter_entity_misc_model, EXCLUDE_MODELS); - add_entity_filter(g_filter_entity_misc_gamemodel, EXCLUDE_MODELS); - add_entity_filter(g_filter_entity_doom3model, EXCLUDE_MODELS); - add_entity_filter(g_filter_entity_light, EXCLUDE_LIGHTS); - add_entity_filter(g_filter_entity_path, EXCLUDE_PATHS); -} - - -#include "preferencesystem.h" - -void Entity_Construct(EGameType gameType) -{ - g_gameType = gameType; - if(g_gameType == eGameTypeDoom3) - { - g_targetable_nameKey = "name"; - - Static::instance().m_keyIsName = keyIsNameDoom3; - Static::instance().m_nameKey = "name"; - } - else - { - Static::instance().m_keyIsName = keyIsNameQuake3; - Static::instance().m_nameKey = "targetname"; - } - - GlobalPreferenceSystem().registerPreference("SI_ShowNames", BoolImportStringCaller(g_showNames), BoolExportStringCaller(g_showNames)); - GlobalPreferenceSystem().registerPreference("SI_ShowAngles", BoolImportStringCaller(g_showAngles), BoolExportStringCaller(g_showAngles)); - GlobalPreferenceSystem().registerPreference("NewLightStyle", BoolImportStringCaller(g_newLightDraw), BoolExportStringCaller(g_newLightDraw)); - GlobalPreferenceSystem().registerPreference("LightRadiuses", BoolImportStringCaller(g_lightRadii), BoolExportStringCaller(g_lightRadii)); - - Entity_InitFilters(); - LightType lightType = LIGHTTYPE_DEFAULT; - if(g_gameType == eGameTypeRTCW) - { - lightType = LIGHTTYPE_RTCW; - } - else if(g_gameType == eGameTypeDoom3) - { - lightType = LIGHTTYPE_DOOM3; - } - Light_Construct(lightType); - MiscModel_construct(); - Doom3Group_construct(); - - RenderablePivot::StaticShader::instance() = GlobalShaderCache().capture("$PIVOT"); - - GlobalShaderCache().attachRenderable(StaticRenderableConnectionLines::instance()); -} - -void Entity_Destroy() -{ - GlobalShaderCache().detachRenderable(StaticRenderableConnectionLines::instance()); - - GlobalShaderCache().release("$PIVOT"); - - Doom3Group_destroy(); - MiscModel_destroy(); - Light_Destroy(); + if(strcmp(key,"classname") == 0) + { + e->eclass = Eclass_ForName(value, false); + Entity_UpdateClass(e, value); + if(strcmp(value,"light") == 0) + for(epair_t* ep = e->epairs; ep != NULL; ep=ep->next) + Light_OnKeyValueChanged(e, ep->key, ep->value); + if(e->model.pEdit) + for(epair_t* ep = e->epairs; ep != NULL; ep=ep->next) + e->model.pEdit->OnKeyValueChanged(e, ep->key, ep->value); + } + else if(Entity_IsLight(e)) + Light_OnKeyValueChanged(e, key, value); + else if(e->model.pEdit) + e->model.pEdit->OnKeyValueChanged(e, key, value); + + // update brush mins/maxs for legacy culling system + if(e->model.pRender && e->brushes.onext != &e->brushes) + Brush_Build( e->brushes.onext, true, true, false, true ); } diff --git a/plugins/entity/entity.def b/plugins/entity/entity.def new file mode 100644 index 00000000..6c40d040 --- /dev/null +++ b/plugins/entity/entity.def @@ -0,0 +1,8 @@ +; entity.def : Declares the module parameters for the DLL. + +LIBRARY "ENTITY" +DESCRIPTION 'ENTITY Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/entity/entity.h b/plugins/entity/entity.h index d0424d8c..6ae14603 100644 --- a/plugins/entity/entity.h +++ b/plugins/entity/entity.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,28 +19,34 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_ENTITY_H) -#define INCLUDED_ENTITY_H +// entity.h -class EntityCreator; -EntityCreator& GetEntityCreator(); +// external API -enum EGameType -{ - eGameTypeQuake3, - eGameTypeRTCW, - eGameTypeDoom3, -}; +// construct +entity_t* Entity_Alloc(); +// destruct +void Entity_Free (entity_t *e); +// construct from entity +entity_t* Entity_Clone (entity_t *e); -extern EGameType g_gameType; +// epair interface +void SetKeyValue (entity_t *ent, const char *key, const char *value); +void DeleteKey (entity_t *ent, const char *key); +const char* ValueForKey (entity_t *ent, const char *key); +float FloatForKey (entity_t *ent, const char *key); +int IntForKey (entity_t *ent, const char *key); +void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec); -class FilterSystem; -void Entity_Construct(EGameType gameType = eGameTypeQuake3); -void Entity_Destroy(); +void Entity_AddToList(entity_t *e, entity_t *lst); +void Entity_RemoveFromList(entity_t *e); -extern bool g_showNames; -extern bool g_showAngles; -extern bool g_newLightDraw; -extern bool g_lightRadii; +void Entity_LinkBrush (entity_t *e, brush_t *b); +void Entity_UnlinkBrush (brush_t *b); -#endif +// for undo +int Entity_MemorySize(entity_t *e); + +epair_t* Entity_AllocateEpair(const char *key, const char *value); +epair_t** Entity_GetKeyValList(entity_t *e); +void Entity_SetKeyValList(entity_t *e, epair_t* ep); diff --git a/plugins/entity/entity.vcproj b/plugins/entity/entity.vcproj new file mode 100644 index 00000000..1536d3b7 --- /dev/null +++ b/plugins/entity/entity.vcproj @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/entity/entity_entitymodel.cpp b/plugins/entity/entity_entitymodel.cpp new file mode 100644 index 00000000..53d7a1b1 --- /dev/null +++ b/plugins/entity/entity_entitymodel.cpp @@ -0,0 +1,138 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "entity_entitymodel.h" + +void Entity_UpdateClass(entity_t *e, const char* value) +{ + if(strcmp(value, "misc_model") == 0 + || (strcmp(value, "misc_gamemodel") == 0) + || (strcmp(value, "model_static") == 0)) + { + if (e->model.pRender) e->model.pRender->DecRef(); + if (e->model.pSelect) e->model.pSelect->DecRef(); + if (e->model.pEdit) e->model.pEdit->DecRef(); + e->model.pRender = NULL; + e->model.pSelect = NULL; + e->model.pEdit = NULL; + + CEntityMiscModel *model = new CEntityMiscModel(e); + + e->model.pRender = (IRender*)model; + e->model.pRender->IncRef(); + e->model.pSelect = (ISelect*)model; + e->model.pSelect->IncRef(); + e->model.pEdit = (IEdit*)model; + e->model.pEdit->IncRef(); + + model->DecRef(); + } + else if(e->eclass && e->eclass->modelpath) + { + if (e->model.pRender) e->model.pRender->DecRef(); + if (e->model.pSelect) e->model.pSelect->DecRef(); + if (e->model.pEdit) e->model.pEdit->DecRef(); + e->model.pRender = NULL; + e->model.pSelect = NULL; + e->model.pEdit = NULL; + + CEntityEclassModel *model = new CEntityEclassModel; + + model->SetEclass(e->eclass); + model->SetName(e->eclass->modelpath); + + e->model.pRender = (IRender*)model; + e->model.pRender->IncRef(); + e->model.pSelect = (ISelect*)model; + e->model.pSelect->IncRef(); + e->model.pEdit = (IEdit*)model; + e->model.pEdit->IncRef(); + + model->DecRef(); + } +} + +void pivot_draw(const vec3_t pivot) +{ + vec3_t vCenter, vMin, vMax; + VectorCopy(pivot, vCenter); + + g_QglTable.m_pfn_qglPointSize(4); + + g_QglTable.m_pfn_qglBegin(GL_POINTS); + g_QglTable.m_pfn_qglVertex3fv(vCenter); + g_QglTable.m_pfn_qglEnd(); + + g_QglTable.m_pfn_qglBegin(GL_LINES); + vCenter[0] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[0] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[0] -= 8; + vCenter[1] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[1] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[1] -= 8; + vCenter[2] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[2] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[2] -= 8; + g_QglTable.m_pfn_qglEnd(); + + VectorCopy(vCenter, vMin); + VectorCopy(vCenter, vMax); + vMin[0] -= 4; + vMin[1] -= 4; + vMin[2] -= 4; + vMax[0] += 4; + vMax[1] += 4; + vMax[2] += 4; + + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglEnd(); + + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglEnd(); + + g_QglTable.m_pfn_qglBegin(GL_LINES); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglEnd(); +} + diff --git a/plugins/entity/entity_entitymodel.h b/plugins/entity/entity_entitymodel.h new file mode 100644 index 00000000..dca34ae8 --- /dev/null +++ b/plugins/entity/entity_entitymodel.h @@ -0,0 +1,150 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _ENTITYMODEL_H_ +#define _ENTITYMODEL_H_ + +#include "plugin.h" + +/*! simulates misc_model entity behaviours for rendering/selection/editing */ +class CEntityMiscModel : public IRender, public ISelect, public IEdit +{ +public: + CEntityMiscModel (entity_t *e); + virtual ~CEntityMiscModel (); + + void IncRef() { refCount++; } + void DecRef() { if(--refCount == 0) delete this; } + + // IRender + void Draw(int state, int rflags) const; + const aabb_t *GetAABB() const { return &m_BBox; } + + // ISelect + bool TestRay(const ray_t *ray, vec_t *dist) const; + //bool TestBox(const aabb_t aabb) const; + + // ITransform + void Translate(const vec3_t translation); + void Rotate(const vec3_t pivot, const vec3_t rotation); + const vec_t *GetTranslation() const { return m_translate; } + const vec_t *GetRotation() const { return m_euler; } + void OnKeyValueChanged(entity_t *e, const char *key, const char* value); + + void SetName(const char *name); +private: + void BuildCacheRequestString(const char *name); + /*! updates the AABB and transformation matrix */ + void UpdateCachedData(); + entity_interfaces_t *m_model; + + entity_t *m_entity; + + int refCount; + string_t m_version; + + Str m_cachereq; + + /*! AABB in local space */ + aabb_t m_BBox; + + /*! worldspace-to-localspace translation */ + vec3_t m_translate; + + /*! worldspace-to-localspace euler rotation angles */ + vec3_t m_euler; + + /*! worldspace-to-localspace scale */ + vec3_t m_scale; + + /*! localspace origin, effectively rotation & scale pivot point */ + vec3_t m_pivot; + + /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */ + m4x4_t m_transform; + + /*! localspace-to-worldspace transform */ + m4x4_t m_inverse_transform; +}; + +/*! simulates eclass-model entity behaviours for rendering/selection/editing */ +class CEntityEclassModel : public IRender, public ISelect, public IEdit +{ +public: + CEntityEclassModel (); + virtual ~CEntityEclassModel (); + + void IncRef() { refCount++; } + void DecRef() { if(--refCount == 0) delete this; } + + // IRender + void Draw(int state, int rflags) const; + const aabb_t *GetAABB() const { return &m_BBox; } + + // ISelect + bool TestRay(const ray_t *ray, vec_t *dist) const; + //bool TestBox(const aabb_t aabb) const; + + // ITransform + void Translate(const vec3_t translation); + void Rotate(const vec3_t pivot, const vec3_t rotation); + const vec_t *GetTranslation() const { return m_translate; } + const vec_t *GetRotation() const { return m_euler; } + void OnKeyValueChanged(entity_t *e, const char *key, const char* value); + + void SetName(const char *name); + void SetEclass(const eclass_t* eclass); +private: + /*! updates the AABB and transformation matrix */ + void UpdateCachedData(); + entity_interfaces_t *m_model; + + int refCount; + string_t m_name; + string_t m_version; + const eclass_t *m_eclass; + + /*! AABB in local space */ + aabb_t m_BBox; + + /*! worldspace-to-localspace translation */ + vec3_t m_translate; + + /*! worldspace-to-localspace euler rotation angles */ + vec3_t m_euler; + + /*! worldspace-to-localspace scale */ + vec3_t m_scale; + + /*! localspace origin, effectively rotation & scale pivot point */ + vec3_t m_pivot; + + /*! worldspace-to-localspace transform, generated from translate/euler/scale/pivot */ + m4x4_t m_transform; + + /*! localspace-to-worldspace transform */ + m4x4_t m_inverse_transform; +}; + +void pivot_draw(const vec3_t pivot); +void Entity_UpdateClass(entity_t *e, const char* value); + +#endif /* _ENTITYMODEL_H_ */ diff --git a/plugins/entity/entityq3.def b/plugins/entity/entityq3.def deleted file mode 100644 index 00d82f4b..00000000 --- a/plugins/entity/entityq3.def +++ /dev/null @@ -1,7 +0,0 @@ -; entityq3.def : Declares the module parameters for the DLL. - -LIBRARY "ENTITYQ3" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/entity/entityq3.vcproj b/plugins/entity/entityq3.vcproj deleted file mode 100644 index 2054ebc4..00000000 --- a/plugins/entity/entityq3.vcproj +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/entity/filters.cpp b/plugins/entity/filters.cpp deleted file mode 100644 index ce2f7b41..00000000 --- a/plugins/entity/filters.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "filters.h" - -#include "ifilter.h" - -#include - -class EntityFilterWrapper : public Filter -{ - bool m_active; - bool m_invert; - EntityFilter& m_filter; -public: - EntityFilterWrapper(EntityFilter& filter, bool invert) : m_invert(invert), m_filter(filter) - { - } - void setActive(bool active) - { - m_active = active; - } - bool active() - { - return m_active; - } - bool filter(const Entity& entity) - { - return m_invert ^ m_filter.filter(entity); - } -}; - - -typedef std::list EntityFilters; -EntityFilters g_entityFilters; - -void add_entity_filter(EntityFilter& filter, int mask, bool invert) -{ - g_entityFilters.push_back(EntityFilterWrapper(filter, invert)); - GlobalFilterSystem().addFilter(g_entityFilters.back(), mask); -} - -bool entity_filtered(Entity& entity) -{ - for(EntityFilters::iterator i = g_entityFilters.begin(); i != g_entityFilters.end(); ++i) - { - if((*i).active() && (*i).filter(entity)) - { - return true; - } - } - return false; -} - diff --git a/plugins/entity/filters.h b/plugins/entity/filters.h deleted file mode 100644 index 15760ecd..00000000 --- a/plugins/entity/filters.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_FILTERS_H) -#define INCLUDED_FILTERS_H - -#include "ifilter.h" - -#include "generic/callback.h" -#include "scenelib.h" - -class Entity; - -class EntityFilter -{ -public: - virtual bool filter(const Entity& entity) const = 0; -}; - -bool entity_filtered(Entity& entity); -void add_entity_filter(EntityFilter& filter, int mask, bool invert = false); - -class ClassnameFilter : public Filterable -{ - scene::Node& m_node; -public: - Entity& m_entity; - - ClassnameFilter(Entity& entity, scene::Node& node) : m_node(node), m_entity(entity) - { - } - ~ClassnameFilter() - { - } - - void instanceAttach() - { - GlobalFilterSystem().registerFilterable(*this); - } - void instanceDetach() - { - GlobalFilterSystem().unregisterFilterable(*this); - } - - void updateFiltered() - { - if(entity_filtered(m_entity)) - { - m_node.enable(scene::Node::eFiltered); - } - else - { - m_node.disable(scene::Node::eFiltered); - } - } - - void classnameChanged(const char* value) - { - updateFiltered(); - } - typedef MemberCaller1 ClassnameChangedCaller; -}; - -#endif diff --git a/plugins/entity/generic.cpp b/plugins/entity/generic.cpp deleted file mode 100644 index bc8a6b7c..00000000 --- a/plugins/entity/generic.cpp +++ /dev/null @@ -1,499 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -///\file -///\brief Represents any entity which has a fixed size specified in its entity-definition and does not display a model (e.g. info_player_start). -/// -/// This entity displays an axis-aligned bounding box of the size and colour specified in its entity-definition. -/// The "origin" key directly controls the entity's local-to-parent transform. -/// An arrow is drawn to visualise the "angle" key. - -#include "cullable.h" -#include "renderable.h" -#include "editable.h" - -#include "math/frustum.h" -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "entitylib.h" -#include "render.h" -#include "eclasslib.h" -#include "math/line.h" - -#include "targetable.h" -#include "origin.h" -#include "angle.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" -#include "rotation.h" - -#include "entity.h" - - -class RenderableArrow : public OpenGLRenderable -{ - const Ray& m_ray; - -public: - RenderableArrow(const Ray& ray) - : m_ray(ray) - { - } - - void render(RenderStateFlags state) const - { - arrow_draw(m_ray.origin, m_ray.direction); - } -}; - -inline void read_aabb(AABB& aabb, const EntityClass& eclass) -{ - aabb = aabb_for_minmax(eclass.mins, eclass.maxs); -} - - -class GenericEntity : - public Cullable, - public Bounded, - public Snappable -{ - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; - MatrixTransform m_transform; - - OriginKey m_originKey; - Vector3 m_origin; - AngleKey m_angleKey; - float m_angle; - - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - - AABB m_aabb_local; - Ray m_ray; - - RenderableArrow m_arrow; - RenderableSolidAABB m_aabb_solid; - RenderableWireframeAABB m_aabb_wire; - RenderableNamedEntity m_renderName; - - Callback m_transformChanged; - Callback m_evaluateTransform; - - void construct() - { - read_aabb(m_aabb_local, m_entity.getEntityClass()); - m_ray.origin = m_aabb_local.origin; - m_ray.direction[0] = 1; - m_ray.direction[1] = 0; - m_ray.direction[2] = 0; - - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - m_keyObservers.insert("angle", AngleKey::AngleChangedCaller(m_angleKey)); - m_keyObservers.insert("origin", OriginKey::OriginChangedCaller(m_originKey)); - } - -// vc 2k5 compiler fix -#if _MSC_VER >= 1400 - public: -#endif - - void updateTransform() - { - m_transform.localToParent() = g_matrix4_identity; - matrix4_translate_by_vec3(m_transform.localToParent(), m_origin); - m_ray.direction = matrix4_transformed_direction(matrix4_rotation_for_z(degrees_to_radians(m_angle)), Vector3(1, 0, 0)); - m_transformChanged(); - } - typedef MemberCaller UpdateTransformCaller; - void originChanged() - { - m_origin = m_originKey.m_origin; - updateTransform(); - } - typedef MemberCaller OriginChangedCaller; - void angleChanged() - { - m_angle = m_angleKey.m_angle; - updateTransform(); - } - typedef MemberCaller AngleChangedCaller; -public: - - GenericEntity(EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(eclass), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_angleKey(AngleChangedCaller(*this)), - m_angle(ANGLEKEY_IDENTITY), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_arrow(m_ray), - m_aabb_solid(m_aabb_local), - m_aabb_wire(m_aabb_local), - m_renderName(m_named, g_vector3_identity), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - GenericEntity(const GenericEntity& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(other.m_entity), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_angleKey(AngleChangedCaller(*this)), - m_angle(ANGLEKEY_IDENTITY), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_arrow(m_ray), - m_aabb_solid(m_aabb_local), - m_aabb_wire(m_aabb_local), - m_renderName(m_named, g_vector3_identity), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_entity.attach(m_keyObservers); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_entity.detach(m_keyObservers); - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - - const AABB& localAABB() const - { - return m_aabb_local; - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& volume, const Matrix4& localToWorld) const - { - return volume.TestAABB(localAABB(), localToWorld); - } - - void renderArrow(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - if(g_showAngles) - { - renderer.addRenderable(m_arrow, localToWorld); - } - } - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_entity.getEntityClass().m_state_fill, Renderer::eFullMaterials); - renderer.addRenderable(m_aabb_solid, localToWorld); - renderArrow(renderer, volume, localToWorld); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - renderer.addRenderable(m_aabb_wire, localToWorld); - renderArrow(renderer, volume, localToWorld); - if(g_showNames) - { - renderer.addRenderable(m_renderName, localToWorld); - } - } - - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - test.BeginMesh(localToWorld); - - SelectionIntersection best; - aabb_testselect(m_aabb_local, test, best); - if(best.valid()) - { - selector.addIntersection(best); - } - } - - void translate(const Vector3& translation) - { - m_origin = origin_translated(m_origin, translation); - } - void rotate(const Quaternion& rotation) - { - m_angle = angle_rotated(m_angle, rotation); - } - void snapto(float snap) - { - m_originKey.m_origin = origin_snapped(m_originKey.m_origin, snap); - m_originKey.write(&m_entity); - } - void revertTransform() - { - m_origin = m_originKey.m_origin; - m_angle = m_angleKey.m_angle; - } - void freezeTransform() - { - m_originKey.m_origin = m_origin; - m_originKey.write(&m_entity); - m_angleKey.m_angle = m_angle; - m_angleKey.write(&m_entity); - } - void transformChanged() - { - revertTransform(); - m_evaluateTransform(); - updateTransform(); - } - typedef MemberCaller TransformChangedCaller; -}; - -class GenericEntityInstance : - public TargetableInstance, - public TransformModifier, - public Renderable, - public SelectionTestable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - GenericEntity& m_contained; - mutable AABB m_bounds; -public: - - typedef LazyStatic StaticTypeCasts; - - Bounded& get(NullType) - { - return m_contained; - } - Cullable& get(NullType) - { - return m_contained; - } - - STRING_CONSTANT(Name, "GenericEntityInstance"); - - GenericEntityInstance(const scene::Path& path, scene::Instance* parent, GenericEntity& contained) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), contained.getEntity(), *this), - TransformModifier(GenericEntity::TransformChangedCaller(contained), ApplyTransformCaller(*this)), - m_contained(contained) - { - m_contained.instanceAttach(Instance::path()); - - StaticRenderableConnectionLines::instance().attach(*this); - } - ~GenericEntityInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - - m_contained.instanceDetach(Instance::path()); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld()); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - m_contained.testSelect(selector, test, Instance::localToWorld()); - } - - void evaluateTransform() - { - if(getType() == TRANSFORM_PRIMITIVE) - { - m_contained.translate(getTranslation()); - m_contained.rotate(getRotation()); - } - } - void applyTransform() - { - m_contained.revertTransform(); - evaluateTransform(); - m_contained.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; -}; - -class GenericEntityNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - InstanceSet m_instances; - - scene::Node m_node; - GenericEntity m_contained; - -public: - typedef LazyStatic StaticTypeCasts; - - Snappable& get(NullType) - { - return m_contained; - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - - GenericEntityNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - } - GenericEntityNode(const GenericEntityNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new GenericEntityNode(*this))->node(); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new GenericEntityInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -scene::Node& New_GenericEntity(EntityClass* eclass) -{ - return (new GenericEntityNode(eclass))->node(); -} diff --git a/plugins/entity/generic.h b/plugins/entity/generic.h deleted file mode 100644 index d81389be..00000000 --- a/plugins/entity/generic.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GENERIC_H) -#define INCLUDED_GENERIC_H - -scene::Node& New_GenericEntity(EntityClass* eclass); - -#endif diff --git a/plugins/entity/group.cpp b/plugins/entity/group.cpp deleted file mode 100644 index 8d8d8ca2..00000000 --- a/plugins/entity/group.cpp +++ /dev/null @@ -1,453 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -///\file -///\brief Represents any entity which does not have a fixed size specified in its entity-definition (except misc_model). -/// -/// This entity behaves as a group, i.e. it contains brushes. - -#include "cullable.h" -#include "renderable.h" -#include "editable.h" - -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "entitylib.h" -#include "render.h" -#include "eclasslib.h" - -#include "targetable.h" -#include "origin.h" -#include "angles.h" -#include "scale.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" - -#include "entity.h" - -class Group -{ - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; - MatrixTransform m_transform; - TraversableNodeSet m_traverse; - - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - - RenderableNamedEntity m_renderName; - mutable Vector3 m_name_origin; - - Callback m_transformChanged; - - void construct() - { - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - } - -public: - Group(EntityClass* eclass, scene::Node& node, const Callback& transformChanged) : - m_entity(eclass), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, m_name_origin), - m_name_origin(g_vector3_identity), - m_transformChanged(transformChanged) - { - construct(); - } - Group(const Group& other, scene::Node& node, const Callback& transformChanged) : - m_entity(other.m_entity), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, g_vector3_identity), - m_transformChanged(transformChanged) - { - construct(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_traverse.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_entity.attach(m_keyObservers); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_entity.detach(m_keyObservers); - m_traverse.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - scene::Traversable& getTraversable() - { - return m_traverse; - } - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - - void attach(scene::Traversable::Observer* observer) - { - m_traverse.attach(observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_traverse.detach(observer); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - } - - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, const AABB& childBounds) const - { - renderSolid(renderer, volume, localToWorld); - - if(g_showNames) - { - // don't draw the name for worldspawn - if(!strcmp(m_entity.getEntityClass().name(), "worldspawn")) - return; - - // place name in the middle of the "children cloud" - m_name_origin = childBounds.origin; - - renderer.addRenderable(m_renderName, localToWorld); - } - } -}; - -#if 0 -class TransformableSetTranslation -{ - Translation m_value; -public: - TransformableSetTranslation(const Translation& value) : m_value(value) - { - } - void operator()(Transformable& transformable) const - { - transformable.setTranslation(m_value); - } -}; - -class TransformableSetRotation -{ - Rotation m_value; -public: - TransformableSetRotation(const Rotation& value) : m_value(value) - { - } - void operator()(Transformable& transformable) const - { - transformable.setRotation(m_value); - } -}; - -class TransformableSetScale -{ - Scale m_value; -public: - TransformableSetScale(const Scale& value) : m_value(value) - { - } - void operator()(Transformable& transformable) const - { - transformable.setScale(m_value); - } -}; - -class TransformableSetType -{ - TransformModifierType m_value; -public: - TransformableSetType(const TransformModifierType& value) : m_value(value) - { - } - void operator()(Transformable& transformable) const - { - transformable.setType(m_value); - } -}; - -class TransformableFreezeTransform -{ - TransformModifierType m_value; -public: - void operator()(Transformable& transformable) const - { - transformable.freezeTransform(); - } -}; - -template -inline void Scene_forEachChildTransformable(const Functor& functor, const scene::Path& path) -{ - GlobalSceneGraph().traverse_subgraph(ChildInstanceWalker< InstanceApply >(functor), path); -} -#endif - -class GroupInstance : - public TargetableInstance, -#if 0 - public Transformable, -#endif - public Renderable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceStaticCast::install(m_casts); -#if 0 - InstanceStaticCast::install(m_casts); -#endif - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - Group& m_contained; -public: - typedef LazyStatic StaticTypeCasts; - - GroupInstance(const scene::Path& path, scene::Instance* parent, Group& group) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), group.getEntity(), *this), - m_contained(group) - { - m_contained.instanceAttach(Instance::path()); - StaticRenderableConnectionLines::instance().attach(*this); - } - ~GroupInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - m_contained.instanceDetach(Instance::path()); - } - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), Instance::childBounds()); - } - -#if 0 - void setType(TransformModifierType type) - { - Scene_forEachChildTransformable(TransformableSetType(type), Instance::path()); - } - void setTranslation(const Translation& value) - { - Scene_forEachChildTransformable(TransformableSetTranslation(value), Instance::path()); - } - void setRotation(const Rotation& value) - { - Scene_forEachChildTransformable(TransformableSetRotation(value), Instance::path()); - } - void setScale(const Scale& value) - { - Scene_forEachChildTransformable(TransformableSetScale(value), Instance::path()); - } - void freezeTransform() - { - Scene_forEachChildTransformable(TransformableFreezeTransform(), Instance::path()); - } - - void evaluateTransform() - { - } -#endif -}; - -class GroupNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable, - public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Group m_contained; - - void construct() - { - m_contained.attach(this); - } - void destroy() - { - m_contained.detach(this); - } - -public: - - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_contained.getTraversable(); - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - - GroupNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances)) - { - construct(); - } - GroupNode(const GroupNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - scene::Traversable::Observer(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances)) - { - construct(); - } - ~GroupNode() - { - destroy(); - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new GroupNode(*this))->node(); - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new GroupInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -scene::Node& New_Group(EntityClass* eclass) -{ - return (new GroupNode(eclass))->node(); -} diff --git a/plugins/entity/group.h b/plugins/entity/group.h deleted file mode 100644 index f3c54709..00000000 --- a/plugins/entity/group.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GROUP_H) -#define INCLUDED_GROUP_H - -scene::Node& New_Group(EntityClass* eclass); - -#endif diff --git a/plugins/entity/keyobservers.cpp b/plugins/entity/keyobservers.cpp deleted file mode 100644 index 4c88eb0c..00000000 --- a/plugins/entity/keyobservers.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "keyobservers.h" - diff --git a/plugins/entity/keyobservers.h b/plugins/entity/keyobservers.h deleted file mode 100644 index 3921e364..00000000 --- a/plugins/entity/keyobservers.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_KEYOBSERVERS_H) -#define INCLUDED_KEYOBSERVERS_H - -#include "entitylib.h" -#include - -class KeyObserverMap : public Entity::Observer -{ - typedef std::multimap KeyObservers; - KeyObservers m_keyObservers; -public: - void insert(const char* key, const KeyObserver& observer) - { - m_keyObservers.insert(KeyObservers::value_type(key, observer)); - } - void insert(const char* key, EntityKeyValue& value) - { - for(KeyObservers::const_iterator i = m_keyObservers.find(key); i != m_keyObservers.end() && string_equal((*i).first, key); ++i) - { - value.attach((*i).second); - } - } - void erase(const char* key, EntityKeyValue& value) - { - for(KeyObservers::const_iterator i = m_keyObservers.find(key); i != m_keyObservers.end() && string_equal((*i).first, key); ++i) - { - value.detach((*i).second); - } - } -}; - -#endif diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index 667b38b7..477fc72d 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -1,1912 +1,536 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -///\file -///\brief Represents any light entity (e.g. light). -/// -/// This entity dislays a special 'light' model. -/// The "origin" key directly controls the position of the light model in local space. -/// The "_color" key controls the colour of the light model. -/// The "light" key is visualised with a sphere representing the approximate coverage of the light (except Doom3). -/// Doom3 special behaviour: -/// The entity behaves as a group. -/// The "origin" key is the translation to be applied to all brushes (not patches) grouped under this entity. -/// The "light_center" and "light_radius" keys are visualised with a point and a box when the light is selected. -/// The "rotation" key directly controls the orientation of the light bounding box in local space. -/// The "light_origin" key controls the position of the light independently of the "origin" key if it is specified. -/// The "light_rotation" key duplicates the behaviour of the "rotation" key if it is specified. This appears to be an unfinished feature in Doom3. +#include "plugin.h" +#include "entity.h" #include "light.h" -#include - -#include "cullable.h" -#include "renderable.h" -#include "editable.h" - -#include "math/frustum.h" -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "entitylib.h" -#include "render.h" -#include "eclasslib.h" -#include "render.h" -#include "stringio.h" -#include "traverselib.h" -#include "dragplanes.h" - -#include "targetable.h" -#include "origin.h" -#include "colour.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" -#include "rotation.h" - -#include "entity.h" -extern bool g_newLightDraw; - - -void sphere_draw_fill(const Vector3& origin, float radius, int sides) +void DrawSphere(vec3_t center, float radius, int sides, int nGLState) { + int i, j; + float dt = (float) (2 * Q_PI / (float) sides); + float dp = (float) (Q_PI / (float) sides); + float t, p; + vec3_t v; + if (radius <= 0) return; - const double dt = c_2pi / static_cast(sides); - const double dp = c_pi / static_cast(sides); + g_QglTable.m_pfn_qglBegin(GL_TRIANGLES); + for (i = 0; i <= sides - 1; i++) { + for (j = 0; j <= sides - 2; j++) { + t = i * dt; + p = (float) ((j * dp) - (Q_PI / 2)); - glBegin(GL_TRIANGLES); - for (int i = 0; i <= sides - 1; ++i) - { - for (int j = 0; j <= sides - 2; ++j) - { - const double t = i * dt; - const double p = (j * dp) - (c_pi / 2.0); + VectorPolar(v, radius, t, p); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t, p), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t, p + dp); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t, p + dp), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t + dt, p + dp); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t + dt, p + dp), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t, p); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t, p), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t + dt, p + dp); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t + dt, p + dp), radius))); - glVertex3fv(vector3_to_array(v)); - } - - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t + dt, p), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t + dt, p); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); } } - { - const double p = (sides - 1) * dp - (c_pi / 2.0); - for (int i = 0; i <= sides - 1; ++i) - { - const double t = i * dt; + p = (float) ((sides - 1) * dp - (Q_PI / 2)); + for (i = 0; i <= sides - 1; i++) { + t = i * dt; - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t, p), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t, p); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t + dt, p + dp), radius))); - glVertex3fv(vector3_to_array(v)); - } + VectorPolar(v, radius, t + dt, p + dp); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); - { - Vector3 v(vector3_added(origin, vector3_scaled(vector3_for_spherical(t + dt, p), radius))); - glVertex3fv(vector3_to_array(v)); - } - } + VectorPolar(v, radius, t + dt, p); + VectorAdd(v, center, v); + g_QglTable.m_pfn_qglVertex3fv(v); } - glEnd(); + g_QglTable.m_pfn_qglEnd(); } -void sphere_draw_wire(const Vector3& origin, float radius, int sides) +#define LIGHT_ATTEN_LINEAR 1 +#define LIGHT_ATTEN_ANGLE 2 +#define LIGHT_ATTEN_DISTANCE 4 + +#define LIGHT_Q3A_DEFAULT (LIGHT_ATTEN_ANGLE | LIGHT_ATTEN_DISTANCE) +#define LIGHT_WOLF_DEFAULT (LIGHT_ATTEN_LINEAR | LIGHT_ATTEN_DISTANCE) + +float CalculateEnvelopeForLight(entity_t * e, float fFalloffTolerance) { - { - glBegin(GL_LINE_LOOP); + float fEnvelope = 0.f; + int iSpawnFlags = atoi(ValueForKey(e, "spawnflags")); + int iLightFlags = 0; + float fFade = 1.f; + float fIntensity, fPhotons; + float fScale; + const char *gameFile = g_FuncTable.m_pfnGetGameFile(); - for (int i = 0; i <= sides; i++) - { - double ds = sin((i * 2 * c_pi) / sides); - double dc = cos((i * 2 * c_pi) / sides); + // These variables are tweakable on the q3map2 console, setting to q3map2 + // default here as there is no way to find out what the user actually uses + // right now. Maybe move them to worldspawn? + float fPointScale = 7500.f; + float fLinearScale = 1.f / 8000.f; + //float fFalloffTolerance = 1.f; // Need it as parameter - glVertex3f( - static_cast(origin[0] + radius * dc), - static_cast(origin[1] + radius * ds), - origin[2] - ); + // Arnout: HACK for per-game radii - really need to move this to a per-game module? + if( !strcmp( gameFile, "wolf.game" ) || !strcmp( gameFile, "et.game" ) ) { + // Spawnflags : + // 1: nonlinear + // 2: angle + + // set default flags + iLightFlags = LIGHT_WOLF_DEFAULT; + + // inverse distance squared attenuation? + if (iSpawnFlags & 1) { + iLightFlags &= ~LIGHT_ATTEN_LINEAR; + iLightFlags |= LIGHT_ATTEN_ANGLE; } + // angle attenuate + if (iSpawnFlags & 2) + iLightFlags |= LIGHT_ATTEN_ANGLE; + } else { + // Spawnflags : + // 1: linear + // 2: no angle - glEnd(); + // set default flags + iLightFlags = LIGHT_Q3A_DEFAULT; + + // linear attenuation? + if (iSpawnFlags & 1) { + iLightFlags |= LIGHT_ATTEN_LINEAR; + iLightFlags &= ~LIGHT_ATTEN_ANGLE; + } + // no angle attenuate? + if (iSpawnFlags & 2) + iLightFlags &= ~LIGHT_ATTEN_ANGLE; } - { - glBegin(GL_LINE_LOOP); + // set fade key (from wolf) + if (iLightFlags & LIGHT_ATTEN_LINEAR) { + fFade = FloatForKey(e, "fade"); + if (fFade <= 0.f) + fFade = 1.f; + } + // set light intensity + fIntensity = FloatForKey(e, "_light"); + if (fIntensity == 0.f) + fIntensity = FloatForKey(e, "light"); + if (fIntensity == 0.f) + fIntensity = 300.f; - for (int i = 0; i <= sides; i++) - { - double ds = sin((i * 2 * c_pi) / sides); - double dc = cos((i * 2 * c_pi) / sides); + // set light scale (sof2) + fScale = FloatForKey(e, "scale"); + if (fScale <= 0.f) + fScale = 1.f; + fIntensity *= fScale; - glVertex3f( - static_cast(origin[0] + radius * dc), - origin[1], - static_cast(origin[2] + radius * ds) - ); + // amount of photons + fPhotons = fIntensity * fPointScale; + + // calculate envelope + + // solve distance for non-distance lights + if (!(iLightFlags & LIGHT_ATTEN_DISTANCE)) + //!\todo (spog) can't access global objects in a module - globals are EVIL - solution: API for querying global settings. + fEnvelope = 131072/*g_MaxWorldCoord * 2.f*/; + // solve distance for linear lights + else if (iLightFlags & LIGHT_ATTEN_LINEAR) + fEnvelope = ((fPhotons * fLinearScale) - fFalloffTolerance) / fFade; + // solve for inverse square falloff + else + fEnvelope = sqrt(fPhotons / fFalloffTolerance) /* + fRadius */ ; // Arnout radius is always 0, only for area lights + + return fEnvelope; +} + +float CalculateLightRadius(entity_t * e, bool outer) +{ + float fEnvelope = 0.f; + int iSpawnFlags = atoi(ValueForKey(e, "spawnflags")); + float fIntensity; + float fScale; + const char *gameFile = g_FuncTable.m_pfnGetGameFile(); + + fIntensity = FloatForKey(e, "light"); + if (fIntensity == 0.f) + fIntensity = 300.f; + + // Arnout: HACK for per-game radii - really need to move this to a per-game module + if( !strcmp( gameFile, "sof2.game" ) || !strcmp( gameFile, "jk2.game" ) || !strcmp( gameFile, "ja.game" )) { + // Spawnflags : + // 1: linear + // 2: noincidence + + if (!outer) { + if (iSpawnFlags & 2) + fIntensity *= .9; + else + fIntensity *= .25f; } + // set light scale (sof2) + fScale = FloatForKey(e, "scale"); + if (fScale <= 0.f) + fScale = 1.f; + fIntensity *= fScale; - glEnd(); + fEnvelope = fIntensity; + } else { + float fPointScale = 7500.f; + + if (outer) + fEnvelope = sqrt(fIntensity * fPointScale / 48.f); + else + fEnvelope = sqrt(fIntensity * fPointScale / 255.f); } + return fEnvelope; +} + +void Light_OnIntensityChanged(entity_t* e) +{ + e->fLightEnvelope1[0] = CalculateEnvelopeForLight(e, 1.f); + e->fLightEnvelope1[1] = CalculateEnvelopeForLight(e, 48.f); + e->fLightEnvelope1[2] = CalculateEnvelopeForLight(e, 255.f); + + e->fLightEnvelope2[0] = CalculateLightRadius(e, TRUE); + e->fLightEnvelope2[1] = CalculateLightRadius(e, FALSE); +} + +void Light_OnKeyValueChanged(entity_t *e, const char *key, const char* value) +{ + if(strcmp(key,"_color") == 0) { - glBegin(GL_LINE_LOOP); - - for (int i = 0; i <= sides; i++) - { - double ds = sin((i * 2 * c_pi) / sides); - double dc = cos((i * 2 * c_pi) / sides); - - glVertex3f( - origin[0], - static_cast(origin[1] + radius * dc), - static_cast(origin[2] + radius * ds) - ); - } - - glEnd(); + if (sscanf(ValueForKey(e, "_color"),"%f %f %f", + &e->color[0], &e->color[1], &e->color[2]) != 3) + VectorSet(e->color, 1, 1, 1); + } + else if(strcmp(key,"spawnflags") == 0 || + strcmp(key,"fade") == 0 || + strcmp(key,"_light") == 0 || + strcmp(key,"light") == 0 || + strcmp(key,"scale") == 0) + { + Light_OnIntensityChanged(e); } } -void light_draw_box_lines(const Vector3& origin, const Vector3 points[8]) +bool Entity_IsLight(entity_t *e) { - //draw lines from the center of the bbox to the corners - glBegin(GL_LINES); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[1])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[5])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[2])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[6])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[0])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[4])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[3])); - - glVertex3fv(vector3_to_array(origin)); - glVertex3fv(vector3_to_array(points[7])); - - glEnd(); + return e->eclass != NULL && e->eclass->nShowFlags & ECLASS_LIGHT;//strncmp(ValueforKey(e, "classname"), "light") == 0 } -void light_draw_radius_wire(const Vector3& origin, const float envelope[3]) +static void DrawLightSphere(entity_t * e, int nGLState, int pref) { - if(envelope[0] > 0) - sphere_draw_wire(origin, envelope[0], 24); - if(envelope[1] > 0) - sphere_draw_wire(origin, envelope[1], 24); - if(envelope[2] > 0) - sphere_draw_wire(origin, envelope[2], 24); + const char *target = ValueForKey(e, "target"); + bool bIsSpotLight = !!target[0]; + //!\todo Write an API for modules to register preference settings, and make this preference module-specific. + int nPasses = pref == 1 ? 3 : 2; + + g_QglTable.m_pfn_qglPushAttrib(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); + g_QglTable.m_pfn_qglDepthMask(GL_FALSE); + g_QglTable.m_pfn_qglEnable(GL_BLEND); + g_QglTable.m_pfn_qglBlendFunc(GL_ONE, GL_ONE); + + // Arnout: TODO: spotlight rendering + if (!(bIsSpotLight)) + { + switch(pref) + { + case 1: + g_QglTable.m_pfn_qglColor3f(e->color[0] * .05f, + e->color[1] * .05f, + e->color[2] * .05f); + DrawSphere(e->origin, e->fLightEnvelope1[0], 16, nGLState); + DrawSphere(e->origin, e->fLightEnvelope1[1], 16, nGLState); + DrawSphere(e->origin, e->fLightEnvelope1[2], 16, nGLState); + break; + case 2: + g_QglTable.m_pfn_qglColor3f(e->color[0] * .15f * .95f, + e->color[1] * .15f * .95f, + e->color[2] * .15f * .95f); + DrawSphere(e->origin, e->fLightEnvelope2[0], 16, nGLState); + DrawSphere(e->origin, e->fLightEnvelope2[1], 16, nGLState); + break; + + } + } + + g_QglTable.m_pfn_qglPopAttrib(); } -void light_draw_radius_fill(const Vector3& origin, const float envelope[3]) -{ - if(envelope[0] > 0) - sphere_draw_fill(origin, envelope[0], 16); - if(envelope[1] > 0) - sphere_draw_fill(origin, envelope[1], 16); - if(envelope[2] > 0) - sphere_draw_fill(origin, envelope[2], 16); -} +float F = 0.70710678f; +// North, East, South, West +vec3_t normals[8] = { { 0, F, F }, { F, 0, F }, { 0,-F, F }, {-F, 0, F }, + { 0, F,-F }, { F, 0,-F }, { 0,-F,-F }, {-F, 0,-F } }; -void light_vertices(const AABB& aabb_light, Vector3 points[6]) -{ - Vector3 max(vector3_added(aabb_light.origin, aabb_light.extents)); - Vector3 min(vector3_subtracted(aabb_light.origin, aabb_light.extents)); - Vector3 mid(aabb_light.origin); +unsigned short indices[24] = { 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 2, + 1, 2, 5, 1, 5, 4, 1, 4, 3, 1, 3, 2 }; +void DrawLight(entity_t* e, int nGLState, int pref, int nViewType) +{ + int i; // top, bottom, tleft, tright, bright, bleft - points[0] = Vector3(mid[0], mid[1], max[2]); - points[1] = Vector3(mid[0], mid[1], min[2]); - points[2] = Vector3(min[0], max[1], mid[2]); - points[3] = Vector3(max[0], max[1], mid[2]); - points[4] = Vector3(max[0], min[1], mid[2]); - points[5] = Vector3(min[0], min[1], mid[2]); -} + vec3_t points[6]; + vec3_t vMid, vMin, vMax; + VectorAdd(e->origin, e->eclass->mins, vMin); + VectorAdd(e->origin, e->eclass->maxs, vMax); + vMid[0] = (vMin[0] + vMax[0]) * 0.5; + vMid[1] = (vMin[1] + vMax[1]) * 0.5; + vMid[2] = (vMin[2] + vMax[2]) * 0.5; -void light_draw(const AABB& aabb_light, RenderStateFlags state) -{ - Vector3 points[6]; - light_vertices(aabb_light, points); + VectorSet(points[0], vMid[0], vMid[1], vMax[2]); + VectorSet(points[1], vMid[0], vMid[1], vMin[2]); + VectorSet(points[2], vMin[0], vMax[1], vMid[2]); + VectorSet(points[3], vMax[0], vMax[1], vMid[2]); + VectorSet(points[4], vMax[0], vMin[1], vMid[2]); + VectorSet(points[5], vMin[0], vMin[1], vMid[2]); - if(state & RENDER_LIGHTING) + if (nGLState & DRAW_GL_LIGHTING)// && g_PrefsDlg.m_bGLLighting) { - const float f = 0.70710678f; - // North, East, South, West - const Vector3 normals[8] = { - Vector3( 0, f, f ), - Vector3( f, 0, f ), - Vector3( 0,-f, f ), - Vector3(-f, 0, f ), - Vector3( 0, f,-f ), - Vector3( f, 0,-f ), - Vector3( 0,-f,-f ), - Vector3(-f, 0,-f ), - }; + g_QglTable.m_pfn_qglBegin(GL_TRIANGLES);// NOTE: comment to use gl_triangle_fan instead + //g_QglTable.m_pfn_qglBegin(GL_TRIANGLE_FAN); + g_QglTable.m_pfn_qglVertex3fv(points[0]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); + g_QglTable.m_pfn_qglNormal3fv(normals[0]); + g_QglTable.m_pfn_qglVertex3fv(points[3]); -#if !defined(USE_TRIANGLE_FAN) - glBegin(GL_TRIANGLES); -#else - glBegin(GL_TRIANGLE_FAN); -#endif - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[2])); - glNormal3fv(vector3_to_array(normals[0])); - glVertex3fv(vector3_to_array(points[3])); + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[3]);// + g_QglTable.m_pfn_qglNormal3fv(normals[1]); + g_QglTable.m_pfn_qglVertex3fv(points[4]); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[3])); -#endif - glNormal3fv(vector3_to_array(normals[1])); - glVertex3fv(vector3_to_array(points[4])); + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]);// + g_QglTable.m_pfn_qglNormal3fv(normals[2]); + g_QglTable.m_pfn_qglVertex3fv(points[5]); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[4])); -#endif - glNormal3fv(vector3_to_array(normals[2])); - glVertex3fv(vector3_to_array(points[5])); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[0])); - glVertex3fv(vector3_to_array(points[5])); -#endif - glNormal3fv(vector3_to_array(normals[3])); - glVertex3fv(vector3_to_array(points[2])); -#if defined(USE_TRIANGLE_FAN) - glEnd(); - glBegin(GL_TRIANGLE_FAN); -#endif + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[5]);// + g_QglTable.m_pfn_qglNormal3fv(normals[3]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[2])); - glNormal3fv(vector3_to_array(normals[7])); - glVertex3fv(vector3_to_array(points[5])); + //g_QglTable.m_pfn_qglEnd(); + //g_QglTable.m_pfn_qglBegin(GL_TRIANGLE_FAN); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[5])); -#endif - glNormal3fv(vector3_to_array(normals[6])); - glVertex3fv(vector3_to_array(points[4])); + g_QglTable.m_pfn_qglVertex3fv(points[1]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); + g_QglTable.m_pfn_qglNormal3fv(normals[7]); + g_QglTable.m_pfn_qglVertex3fv(points[5]); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[4])); -#endif - glNormal3fv(vector3_to_array(normals[5])); - glVertex3fv(vector3_to_array(points[3])); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[5]);// + g_QglTable.m_pfn_qglNormal3fv(normals[6]); + g_QglTable.m_pfn_qglVertex3fv(points[4]); -#if !defined(USE_TRIANGLE_FAN) - glVertex3fv(vector3_to_array(points[1])); - glVertex3fv(vector3_to_array(points[3])); -#endif - glNormal3fv(vector3_to_array(normals[4])); - glVertex3fv(vector3_to_array(points[2])); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]);// + g_QglTable.m_pfn_qglNormal3fv(normals[5]); + g_QglTable.m_pfn_qglVertex3fv(points[3]); - glEnd(); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[3]);// + g_QglTable.m_pfn_qglNormal3fv(normals[4]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); + + g_QglTable.m_pfn_qglEnd(); + } + else if (nGLState & DRAW_GL_FILL) + { + vec3_t colors[4]; + VectorScale(e->color, 0.95, colors[0]); + VectorScale(colors[0], 0.95, colors[1]); + VectorScale(colors[1], 0.95, colors[2]); + VectorScale(colors[2], 0.95, colors[3]); + g_QglTable.m_pfn_qglBegin(GL_TRIANGLES);// NOTE: comment to use gl_triangle_fan instead + //g_QglTable.m_pfn_qglBegin(GL_TRIANGLE_FAN); + g_QglTable.m_pfn_qglColor3fv(colors[0]); + g_QglTable.m_pfn_qglVertex3fv(points[0]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); + g_QglTable.m_pfn_qglVertex3fv(points[3]); + + g_QglTable.m_pfn_qglColor3fv(colors[1]); + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[3]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]); + + g_QglTable.m_pfn_qglColor3fv(colors[2]); + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]);// + g_QglTable.m_pfn_qglVertex3fv(points[5]); + + g_QglTable.m_pfn_qglColor3fv(colors[3]); + g_QglTable.m_pfn_qglVertex3fv(points[0]);// + g_QglTable.m_pfn_qglVertex3fv(points[5]);// + g_QglTable.m_pfn_qglVertex3fv(points[2]); + + //g_QglTable.m_pfn_qglEnd(); + //g_QglTable.m_pfn_qglBegin(GL_TRIANGLE_FAN); + + g_QglTable.m_pfn_qglColor3fv(colors[0]); + g_QglTable.m_pfn_qglVertex3fv(points[1]); + g_QglTable.m_pfn_qglVertex3fv(points[2]); + g_QglTable.m_pfn_qglVertex3fv(points[5]); + + g_QglTable.m_pfn_qglColor3fv(colors[1]); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[5]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]); + + g_QglTable.m_pfn_qglColor3fv(colors[2]); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[4]);// + g_QglTable.m_pfn_qglVertex3fv(points[3]); + + g_QglTable.m_pfn_qglColor3fv(colors[3]); + g_QglTable.m_pfn_qglVertex3fv(points[1]);// + g_QglTable.m_pfn_qglVertex3fv(points[3]);// + g_QglTable.m_pfn_qglVertex3fv(points[2]); + + g_QglTable.m_pfn_qglEnd(); } else { - typedef unsigned int index_t; - const index_t indices[24] = { - 0, 2, 3, - 0, 3, 4, - 0, 4, 5, - 0, 5, 2, - 1, 2, 5, - 1, 5, 4, - 1, 4, 3, - 1, 3, 2 - }; -#if 1 - glVertexPointer(3, GL_FLOAT, 0, points); - glDrawElements(GL_TRIANGLES, sizeof(indices)/sizeof(index_t), RenderIndexTypeID, indices); -#else - glBegin(GL_TRIANGLES); - for(unsigned int i = 0; i < sizeof(indices)/sizeof(index_t); ++i) - { - glVertex3fv(points[indices[i]]); - } - glEnd(); -#endif + g_QglTable.m_pfn_qglVertexPointer(3, GL_FLOAT, 0, points); + g_QglTable.m_pfn_qglDrawElements(GL_TRIANGLES, 24, GL_UNSIGNED_SHORT, indices); } // NOTE: prolly not relevant until some time.. // check for DOOM lights -#if 0 if (strlen(ValueForKey(e, "light_right")) > 0) { vec3_t vRight, vUp, vTarget, vTemp; GetVectorForKey (e, "light_right", vRight); GetVectorForKey (e, "light_up", vUp); GetVectorForKey (e, "light_target", vTarget); - glColor3f(0, 1, 0); - glBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglColor3f(0, 1, 0); + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); VectorAdd(vTarget, e->origin, vTemp); VectorAdd(vTemp, vRight, vTemp); VectorAdd(vTemp, vUp, vTemp); - glVertex3fv(e->origin); - glVertex3fv(vTemp); + g_QglTable.m_pfn_qglVertex3fv(e->origin); + g_QglTable.m_pfn_qglVertex3fv(vTemp); VectorAdd(vTarget, e->origin, vTemp); VectorAdd(vTemp, vUp, vTemp); VectorSubtract(vTemp, vRight, vTemp); - glVertex3fv(e->origin); - glVertex3fv(vTemp); + g_QglTable.m_pfn_qglVertex3fv(e->origin); + g_QglTable.m_pfn_qglVertex3fv(vTemp); VectorAdd(vTarget, e->origin, vTemp); VectorAdd(vTemp, vRight, vTemp); VectorSubtract(vTemp, vUp, vTemp); - glVertex3fv(e->origin); - glVertex3fv(vTemp); + g_QglTable.m_pfn_qglVertex3fv(e->origin); + g_QglTable.m_pfn_qglVertex3fv(vTemp); VectorAdd(vTarget, e->origin, vTemp); VectorSubtract(vTemp, vUp, vTemp); VectorSubtract(vTemp, vRight, vTemp); - glVertex3fv(e->origin); - glVertex3fv(vTemp); - glEnd(); + g_QglTable.m_pfn_qglVertex3fv(e->origin); + g_QglTable.m_pfn_qglVertex3fv(vTemp); + g_QglTable.m_pfn_qglEnd(); } -#endif -} -// These variables are tweakable on the q3map2 console, setting to q3map2 -// default here as there is no way to find out what the user actually uses -// right now. Maybe move them to worldspawn? -float fPointScale = 7500.f; -float fLinearScale = 1.f / 8000.f; - -float light_radius_linear(float fIntensity, float fFalloffTolerance) -{ - return ((fIntensity * fPointScale * fLinearScale) - fFalloffTolerance); -} - -float light_radius(float fIntensity, float fFalloffTolerance) -{ - return sqrt(fIntensity * fPointScale / fFalloffTolerance); -} - - -LightType g_lightType = LIGHTTYPE_DEFAULT; - - -bool spawnflags_linear(int flags) -{ - if( g_lightType == LIGHTTYPE_RTCW ) + if(nGLState & DRAW_GL_FILL) { - // Spawnflags : - // 1: nonlinear - // 2: angle - - return !(flags & 1); + DrawLightSphere(e, nGLState, pref); } else { - // Spawnflags : - // 1: linear - // 2: no angle + // Arnout: FIXME: clean this up a bit + // now draw lighting radius stuff... + if (pref) + { + bool bDrawSpotlightArc = false; + int nPasses = pref == 1 ? 3 : 2; - return (flags & 1); + const char *target = ValueForKey(e, "target"); + bool bIsSpotLight = !!target[0]; + + /*!\todo Spotlight.. + if (bIsSpotLight) + { + // find the origin of the target... + entity_t *e = FindEntity("targetname", target); + + if (e) + bDrawSpotlightArc = true; + } + */ + + g_QglTable.m_pfn_qglPushAttrib(GL_LINE_BIT); + g_QglTable.m_pfn_qglLineStipple(8, 0xAAAA); + g_QglTable.m_pfn_qglEnable(GL_LINE_STIPPLE); + + float* envelope = (pref == 1) ? e->fLightEnvelope1 : e->fLightEnvelope2; + for (int iPass = 0; iPass < nPasses; iPass++) + { + float fRadius = envelope[iPass]; + + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); + + if (bIsSpotLight) + { + if (bDrawSpotlightArc) + { + // I give up on this, it's beyond me + } + } + else + { + if (fRadius > 0) + { + int i; + float ds, dc; + + for (i = 0; i <= 24; i++) + { + ds = sin((i * 2 * Q_PI) / 24); + dc = cos((i * 2 * Q_PI) / 24); + + switch (nViewType) + { + case 2: + g_QglTable.m_pfn_qglVertex3f(e->origin[0] + fRadius * dc, + e->origin[1] + fRadius * ds, + e->origin[2]); + break; + case 1: + g_QglTable.m_pfn_qglVertex3f(e->origin[0] + fRadius * dc, + e->origin[1], + e->origin[2] + fRadius * ds); + break; + case 0: + g_QglTable.m_pfn_qglVertex3f(e->origin[0], + e->origin[1] + fRadius * dc, + e->origin[2] + fRadius * ds); + break; + } + } + } + } + g_QglTable.m_pfn_qglEnd(); + } + g_QglTable.m_pfn_qglPopAttrib(); + } } } -class LightRadii -{ -public: - float m_radii[3]; -private: - float m_primaryIntensity; - float m_secondaryIntensity; - int m_flags; - float m_fade; - float m_scale; - - void calculateRadii() - { - float intensity = 300.0f; - - if(m_primaryIntensity != 0.0f) - { - intensity = m_primaryIntensity; - } - else if(m_secondaryIntensity != 0.0f) - { - intensity = m_secondaryIntensity; - } - - intensity *= m_scale; - - if(spawnflags_linear(m_flags)) - { - m_radii[0] = light_radius_linear(intensity, 1.0f) / m_fade; - m_radii[1] = light_radius_linear(intensity, 48.0f) / m_fade; - m_radii[2] = light_radius_linear(intensity, 255.0f) / m_fade; - } - else - { - m_radii[0] = light_radius(intensity, 1.0f); - m_radii[1] = light_radius(intensity, 48.0f); - m_radii[2] = light_radius(intensity, 255.0f); - } - } - -public: - LightRadii() : m_primaryIntensity(0), m_secondaryIntensity(0), m_flags(0), m_fade(1), m_scale(1) - { - } - - - void primaryIntensityChanged(const char* value) - { - m_primaryIntensity = string_read_float(value); - calculateRadii(); - } - typedef MemberCaller1 PrimaryIntensityChangedCaller; - void secondaryIntensityChanged(const char* value) - { - m_secondaryIntensity = string_read_float(value); - calculateRadii(); - } - typedef MemberCaller1 SecondaryIntensityChangedCaller; - void scaleChanged(const char* value) - { - m_scale = string_read_float(value); - if(m_scale <= 0.0f) - { - m_scale = 1.0f; - } - calculateRadii(); - } - typedef MemberCaller1 ScaleChangedCaller; - void fadeChanged(const char* value) - { - m_fade = string_read_float(value); - if(m_fade <= 0.0f) - { - m_fade = 1.0f; - } - calculateRadii(); - } - typedef MemberCaller1 FadeChangedCaller; - void flagsChanged(const char* value) - { - m_flags = string_read_int(value); - calculateRadii(); - } - typedef MemberCaller1 FlagsChangedCaller; -}; - -class Doom3LightRadius -{ -public: - Vector3 m_defaultRadius; - Vector3 m_radius; - Vector3 m_radiusTransformed; - Vector3 m_center; - Callback m_changed; - bool m_useCenterKey; - - Doom3LightRadius(const char* defaultRadius) : m_defaultRadius(300, 300, 300), m_center(0, 0, 0), m_useCenterKey(false) - { - if(!string_parse_vector3(defaultRadius, m_defaultRadius)) - { - globalErrorStream() << "Doom3LightRadius: failed to parse default light radius\n"; - } - m_radius = m_defaultRadius; - } - - void lightRadiusChanged(const char* value) - { - if(!string_parse_vector3(value, m_radius)) - { - m_radius = m_defaultRadius; - } - m_radiusTransformed = m_radius; - m_changed(); - SceneChangeNotify(); - } - typedef MemberCaller1 LightRadiusChangedCaller; - - void lightCenterChanged(const char* value) - { - m_useCenterKey = string_parse_vector3(value, m_center); - if(!m_useCenterKey) - { - m_center = Vector3(0, 0, 0); - } - SceneChangeNotify(); - } - typedef MemberCaller1 LightCenterChangedCaller; -}; - -class RenderLightRadiiWire : public OpenGLRenderable -{ - LightRadii& m_radii; - const Vector3& m_origin; -public: - RenderLightRadiiWire(LightRadii& radii, const Vector3& origin) : m_radii(radii), m_origin(origin) - { - } - void render(RenderStateFlags state) const - { - light_draw_radius_wire(m_origin, m_radii.m_radii); - } -}; - -class RenderLightRadiiFill : public OpenGLRenderable -{ - LightRadii& m_radii; - const Vector3& m_origin; -public: - static Shader* m_state; - - RenderLightRadiiFill(LightRadii& radii, const Vector3& origin) : m_radii(radii), m_origin(origin) - { - } - void render(RenderStateFlags state) const - { - light_draw_radius_fill(m_origin, m_radii.m_radii); - } -}; - -class RenderLightRadiiBox : public OpenGLRenderable -{ - const Vector3& m_origin; -public: - mutable Vector3 m_points[8]; - static Shader* m_state; - - RenderLightRadiiBox(const Vector3& origin) : m_origin(origin) - { - } - void render(RenderStateFlags state) const - { - //draw the bounding box of light based on light_radius key - if((state & RENDER_FILL) != 0) - { - aabb_draw_flatshade(m_points); - } - else - { - aabb_draw_wire(m_points); - } - - #if 1 //disable if you dont want lines going from the center of the light bbox to the corners - light_draw_box_lines(m_origin, m_points); - #endif - } -}; - -Shader* RenderLightRadiiFill::m_state = 0; - -class RenderLightCenter : public OpenGLRenderable -{ - const Vector3& m_center; - EntityClass& m_eclass; -public: - static Shader* m_state; - - RenderLightCenter(const Vector3& center, EntityClass& eclass) : m_center(center), m_eclass(eclass) - { - } - void render(RenderStateFlags state) const - { - glBegin(GL_POINTS); - glColor3fv(vector3_to_array(m_eclass.color)); - glVertex3fv(vector3_to_array(m_center)); - glEnd(); - } -}; - -Shader* RenderLightCenter::m_state = 0; - -class RenderLightProjection : public OpenGLRenderable -{ - const Matrix4& m_projection; -public: - - RenderLightProjection(const Matrix4& projection) : m_projection(projection) - { - } - void render(RenderStateFlags state) const - { - Matrix4 unproject(matrix4_full_inverse(m_projection)); - Vector3 points[8]; - aabb_corners(AABB(Vector3(0.5f, 0.5f, 0.5f), Vector3(0.5f, 0.5f, 0.5f)), points); - points[0] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[0], 1))); - points[1] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[1], 1))); - points[2] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[2], 1))); - points[3] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[3], 1))); - points[4] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[4], 1))); - points[5] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[5], 1))); - points[6] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[6], 1))); - points[7] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[7], 1))); - Vector4 test1 = matrix4_transformed_vector4(unproject, Vector4(0.5f, 0.5f, 0.5f, 1)); - Vector3 test2 = vector4_projected(test1); - aabb_draw_wire(points); - } -}; - -inline void default_extents(Vector3& extents) -{ - extents = Vector3(8, 8, 8); -} - -class ShaderRef -{ - CopiedString m_name; - Shader* m_shader; - void capture() - { - m_shader = GlobalShaderCache().capture(m_name.c_str()); - } - void release() - { - GlobalShaderCache().release(m_name.c_str()); - } -public: - ShaderRef() - { - capture(); - } - ~ShaderRef() - { - release(); - } - void setName(const char* name) - { - release(); - m_name = name; - capture(); - } - Shader* get() const - { - return m_shader; - } -}; - -class LightShader -{ - ShaderRef m_shader; - void setDefault() - { - m_shader.setName(m_defaultShader); - } -public: - static const char* m_defaultShader; - - LightShader() - { - setDefault(); - } - void valueChanged(const char* value) - { - if(string_empty(value)) - { - setDefault(); - } - else - { - m_shader.setName(value); - } - SceneChangeNotify(); - } - typedef MemberCaller1 ValueChangedCaller; - - Shader* get() const - { - return m_shader.get(); - } -}; - -const char* LightShader::m_defaultShader = ""; - -inline const BasicVector4& plane3_to_vector4(const Plane3& self) -{ - return reinterpret_cast&>(self); -} - -inline BasicVector4& plane3_to_vector4(Plane3& self) -{ - return reinterpret_cast&>(self); -} - -inline Matrix4 matrix4_from_planes(const Plane3& left, const Plane3& right, const Plane3& bottom, const Plane3& top, const Plane3& front, const Plane3& back) -{ - return Matrix4( - (right.a - left.a) / 2, - (top.a - bottom.a) / 2, - (back.a - front.a) / 2, - right.a - (right.a - left.a) / 2, - (right.b - left.b) / 2, - (top.b - bottom.b) / 2, - (back.b - front.b) / 2, - right.b - (right.b - left.b) / 2, - (right.c - left.c) / 2, - (top.c - bottom.c) / 2, - (back.c - front.c) / 2, - right.c - (right.c - left.c) / 2, - (right.d - left.d) / 2, - (top.d - bottom.d) / 2, - (back.d - front.d) / 2, - right.d - (right.d - left.d) / 2 - ); -} - -class Light : - public OpenGLRenderable, - public Cullable, - public Bounded, - public Editable, - public Snappable -{ - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; - TraversableNodeSet m_traverse; - IdentityTransform m_transform; - - OriginKey m_originKey; - RotationKey m_rotationKey; - Float9 m_rotation; - Colour m_colour; - - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - TraversableObserverPairRelay m_traverseObservers; - Doom3GroupOrigin m_funcStaticOrigin; - - LightRadii m_radii; - Doom3LightRadius m_doom3Radius; - - RenderLightRadiiWire m_radii_wire; - RenderLightRadiiFill m_radii_fill; - RenderLightRadiiBox m_radii_box; - RenderLightCenter m_render_center; - RenderableNamedEntity m_renderName; - - Vector3 m_lightOrigin; - bool m_useLightOrigin; - Float9 m_lightRotation; - bool m_useLightRotation; - - Vector3 m_lightTarget; - bool m_useLightTarget; - Vector3 m_lightUp; - bool m_useLightUp; - Vector3 m_lightRight; - bool m_useLightRight; - Vector3 m_lightStart; - bool m_useLightStart; - Vector3 m_lightEnd; - bool m_useLightEnd; - - mutable AABB m_doom3AABB; - mutable Matrix4 m_doom3Rotation; - mutable Matrix4 m_doom3Projection; - mutable Frustum m_doom3Frustum; - mutable bool m_doom3ProjectionChanged; - - RenderLightProjection m_renderProjection; - - LightShader m_shader; - - AABB m_aabb_light; - - Callback m_transformChanged; - Callback m_boundsChanged; - Callback m_evaluateTransform; - - void construct() - { - default_rotation(m_rotation); - m_aabb_light.origin = Vector3(0, 0, 0); - default_extents(m_aabb_light.extents); - - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - m_keyObservers.insert("_color", Colour::ColourChangedCaller(m_colour)); - m_keyObservers.insert("origin", OriginKey::OriginChangedCaller(m_originKey)); - m_keyObservers.insert("_light", LightRadii::PrimaryIntensityChangedCaller(m_radii)); - m_keyObservers.insert("light", LightRadii::SecondaryIntensityChangedCaller(m_radii)); - m_keyObservers.insert("fade", LightRadii::FadeChangedCaller(m_radii)); - m_keyObservers.insert("scale", LightRadii::ScaleChangedCaller(m_radii)); - m_keyObservers.insert("spawnflags", LightRadii::FlagsChangedCaller(m_radii)); - - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_keyObservers.insert("angle", RotationKey::AngleChangedCaller(m_rotationKey)); - m_keyObservers.insert("rotation", RotationKey::RotationChangedCaller(m_rotationKey)); - m_keyObservers.insert("light_radius", Doom3LightRadius::LightRadiusChangedCaller(m_doom3Radius)); - m_keyObservers.insert("light_center", Doom3LightRadius::LightCenterChangedCaller(m_doom3Radius)); - m_keyObservers.insert("light_origin", Light::LightOriginChangedCaller(*this)); - m_keyObservers.insert("light_rotation", Light::LightRotationChangedCaller(*this)); - m_keyObservers.insert("light_target", Light::LightTargetChangedCaller(*this)); - m_keyObservers.insert("light_up", Light::LightUpChangedCaller(*this)); - m_keyObservers.insert("light_right", Light::LightRightChangedCaller(*this)); - m_keyObservers.insert("light_start", Light::LightStartChangedCaller(*this)); - m_keyObservers.insert("light_end", Light::LightEndChangedCaller(*this)); - m_keyObservers.insert("texture", LightShader::ValueChangedCaller(m_shader)); - m_useLightTarget = m_useLightUp = m_useLightRight = m_useLightStart = m_useLightEnd = false; - m_doom3ProjectionChanged = true; - } - - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_traverse.attach(&m_traverseObservers); - m_traverseObservers.attach(m_funcStaticOrigin); - - m_entity.m_isContainer = true; - } - } - void destroy() - { - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_traverseObservers.detach(m_funcStaticOrigin); - m_traverse.detach(&m_traverseObservers); - } - } - -// vc 2k5 compiler fix -#if _MSC_VER >= 1400 - public: -#endif - - void updateOrigin() - { - m_boundsChanged(); - - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_funcStaticOrigin.originChanged(); - } - - m_doom3Radius.m_changed(); - - GlobalSelectionSystem().pivotChanged(); - } - - void originChanged() - { - m_aabb_light.origin = m_useLightOrigin ? m_lightOrigin : m_originKey.m_origin; - updateOrigin(); - } - typedef MemberCaller OriginChangedCaller; - - void lightOriginChanged(const char* value) - { - m_useLightOrigin = !string_empty(value); - if(m_useLightOrigin) - { - read_origin(m_lightOrigin, value); - } - originChanged(); - } - typedef MemberCaller1 LightOriginChangedCaller; - - void lightTargetChanged(const char* value) - { - m_useLightTarget = !string_empty(value); - if(m_useLightTarget) - { - read_origin(m_lightTarget, value); - } - projectionChanged(); - } - typedef MemberCaller1 LightTargetChangedCaller; - void lightUpChanged(const char* value) - { - m_useLightUp = !string_empty(value); - if(m_useLightUp) - { - read_origin(m_lightUp, value); - } - projectionChanged(); - } - typedef MemberCaller1 LightUpChangedCaller; - void lightRightChanged(const char* value) - { - m_useLightRight = !string_empty(value); - if(m_useLightRight) - { - read_origin(m_lightRight, value); - } - projectionChanged(); - } - typedef MemberCaller1 LightRightChangedCaller; - void lightStartChanged(const char* value) - { - m_useLightStart = !string_empty(value); - if(m_useLightStart) - { - read_origin(m_lightStart, value); - } - projectionChanged(); - } - typedef MemberCaller1 LightStartChangedCaller; - void lightEndChanged(const char* value) - { - m_useLightEnd = !string_empty(value); - if(m_useLightEnd) - { - read_origin(m_lightEnd, value); - } - projectionChanged(); - } - typedef MemberCaller1 LightEndChangedCaller; - - void writeLightOrigin() - { - write_origin(m_lightOrigin, &m_entity, "light_origin"); - } - - void updateLightRadiiBox() const - { - const Matrix4& rotation = rotation_toMatrix(m_rotation); - aabb_corners(AABB(Vector3(0, 0, 0), m_doom3Radius.m_radiusTransformed), m_radii_box.m_points); - matrix4_transform_point(rotation, m_radii_box.m_points[0]); - vector3_add(m_radii_box.m_points[0], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[1]); - vector3_add(m_radii_box.m_points[1], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[2]); - vector3_add(m_radii_box.m_points[2], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[3]); - vector3_add(m_radii_box.m_points[3], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[4]); - vector3_add(m_radii_box.m_points[4], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[5]); - vector3_add(m_radii_box.m_points[5], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[6]); - vector3_add(m_radii_box.m_points[6], m_aabb_light.origin); - matrix4_transform_point(rotation, m_radii_box.m_points[7]); - vector3_add(m_radii_box.m_points[7], m_aabb_light.origin); - } - - void rotationChanged() - { - rotation_assign(m_rotation, m_useLightRotation ? m_lightRotation : m_rotationKey.m_rotation); - GlobalSelectionSystem().pivotChanged(); - } - typedef MemberCaller RotationChangedCaller; - - void lightRotationChanged(const char* value) - { - m_useLightRotation = !string_empty(value); - if(m_useLightRotation) - { - read_rotation(m_lightRotation, value); - } - rotationChanged(); - } - typedef MemberCaller1 LightRotationChangedCaller; - -public: - - Light(EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform) : - m_entity(eclass), - m_originKey(OriginChangedCaller(*this)), - m_rotationKey(RotationChangedCaller(*this)), - m_colour(Callback()), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_funcStaticOrigin(m_traverse, m_originKey.m_origin), - m_doom3Radius(EntityClass_valueForKey(m_entity.getEntityClass(), "light_radius")), - m_radii_wire(m_radii, m_aabb_light.origin), - m_radii_fill(m_radii, m_aabb_light.origin), - m_radii_box(m_aabb_light.origin), - m_render_center(m_doom3Radius.m_center, m_entity.getEntityClass()), - m_renderName(m_named, m_aabb_light.origin), - m_useLightOrigin(false), - m_useLightRotation(false), - m_renderProjection(m_doom3Projection), - m_transformChanged(transformChanged), - m_boundsChanged(boundsChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - Light(const Light& other, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform) : - m_entity(other.m_entity), - m_originKey(OriginChangedCaller(*this)), - m_rotationKey(RotationChangedCaller(*this)), - m_colour(Callback()), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_funcStaticOrigin(m_traverse, m_originKey.m_origin), - m_doom3Radius(EntityClass_valueForKey(m_entity.getEntityClass(), "light_radius")), - m_radii_wire(m_radii, m_aabb_light.origin), - m_radii_fill(m_radii, m_aabb_light.origin), - m_radii_box(m_aabb_light.origin), - m_render_center(m_doom3Radius.m_center, m_entity.getEntityClass()), - m_renderName(m_named, m_aabb_light.origin), - m_useLightOrigin(false), - m_useLightRotation(false), - m_renderProjection(m_doom3Projection), - m_transformChanged(transformChanged), - m_boundsChanged(boundsChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - ~Light() - { - destroy(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_traverse.instanceAttach(path_find_mapfile(path.begin(), path.end())); - } - m_entity.attach(m_keyObservers); - - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_funcStaticOrigin.enable(); - } - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_funcStaticOrigin.disable(); - } - - m_entity.detach(m_keyObservers); - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_traverse.instanceDetach(path_find_mapfile(path.begin(), path.end())); - } - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - scene::Traversable& getTraversable() - { - return m_traverse; - } - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - - void attach(scene::Traversable::Observer* observer) - { - m_traverseObservers.attach(*observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_traverseObservers.detach(*observer); - } - - void render(RenderStateFlags state) const - { - if(!g_newLightDraw) - { - aabb_draw(m_aabb_light, state); - } - else - { - light_draw(m_aabb_light, state); - } - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& volume, const Matrix4& localToWorld) const - { - return volume.TestAABB(m_aabb_light, localToWorld); - } - - // cache - const AABB& localAABB() const - { - return m_aabb_light; - } - - - mutable Matrix4 m_projectionOrientation; - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - renderer.SetState(m_colour.state(), Renderer::eFullMaterials); - renderer.addRenderable(*this, localToWorld); - - if(selected && g_lightRadii && string_empty(m_entity.getKeyValue("target"))) - { - if(renderer.getStyle() == Renderer::eFullMaterials) - { - renderer.SetState(RenderLightRadiiFill::m_state, Renderer::eFullMaterials); - renderer.Highlight(Renderer::ePrimitive, false); - renderer.addRenderable(m_radii_fill, localToWorld); - } - else - { - renderer.addRenderable(m_radii_wire, localToWorld); - } - } - - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eFullMaterials); - - if(g_lightType == LIGHTTYPE_DOOM3 && selected) - { - if(isProjected()) - { - projection(); - m_projectionOrientation = rotation(); - vector4_to_vector3(m_projectionOrientation.t()) = localAABB().origin; - renderer.addRenderable(m_renderProjection, m_projectionOrientation); - } - else - { - updateLightRadiiBox(); - renderer.addRenderable(m_radii_box, localToWorld); - } - - //draw the center of the light - if(m_doom3Radius.m_useCenterKey) - { - renderer.Highlight(Renderer::ePrimitive, false); - renderer.Highlight(Renderer::eFace, false); - renderer.SetState(m_render_center.m_state, Renderer::eFullMaterials); - renderer.SetState(m_render_center.m_state, Renderer::eWireframeOnly); - renderer.addRenderable(m_render_center, localToWorld); - } - } - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - renderSolid(renderer, volume, localToWorld, selected); - if(g_showNames) - { - renderer.addRenderable(m_renderName, localToWorld); - } - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - test.BeginMesh(localToWorld); - - SelectionIntersection best; - aabb_testselect(m_aabb_light, test, best); - if(best.valid()) - { - selector.addIntersection(best); - } - } - - void translate(const Vector3& translation) - { - m_aabb_light.origin = origin_translated(m_aabb_light.origin, translation); - } - void rotate(const Quaternion& rotation) - { - rotation_rotate(m_rotation, rotation); - } - void snapto(float snap) - { - if(g_lightType == LIGHTTYPE_DOOM3 && !m_useLightOrigin && !m_traverse.empty()) - { - m_useLightOrigin = true; - m_lightOrigin = m_originKey.m_origin; - } - - if(m_useLightOrigin) - { - m_lightOrigin = origin_snapped(m_lightOrigin, snap); - writeLightOrigin(); - } - else - { - m_originKey.m_origin = origin_snapped(m_originKey.m_origin, snap); - m_originKey.write(&m_entity); - } - } - void setLightRadius(const AABB& aabb) - { - m_aabb_light.origin = aabb.origin; - m_doom3Radius.m_radiusTransformed = aabb.extents; - } - void transformLightRadius(const Matrix4& transform) - { - matrix4_transform_point(transform, m_aabb_light.origin); - } - void revertTransform() - { - m_aabb_light.origin = m_useLightOrigin ? m_lightOrigin : m_originKey.m_origin; - rotation_assign(m_rotation, m_useLightRotation ? m_lightRotation : m_rotationKey.m_rotation); - m_doom3Radius.m_radiusTransformed = m_doom3Radius.m_radius; - } - void freezeTransform() - { - if(g_lightType == LIGHTTYPE_DOOM3 && !m_useLightOrigin && !m_traverse.empty()) - { - m_useLightOrigin = true; - } - - if(m_useLightOrigin) - { - m_lightOrigin = m_aabb_light.origin; - writeLightOrigin(); - } - else - { - m_originKey.m_origin = m_aabb_light.origin; - m_originKey.write(&m_entity); - } - - if(g_lightType == LIGHTTYPE_DOOM3) - { - if(!m_useLightRotation && !m_traverse.empty()) - { - m_useLightRotation = true; - } - - if(m_useLightRotation) - { - rotation_assign(m_lightRotation, m_rotation); - write_rotation(m_lightRotation, &m_entity, "light_rotation"); - } - - rotation_assign(m_rotationKey.m_rotation, m_rotation); - write_rotation(m_rotationKey.m_rotation, &m_entity); - - m_doom3Radius.m_radius = m_doom3Radius.m_radiusTransformed; - write_origin(m_doom3Radius.m_radius, &m_entity, "light_radius"); - } - } - void transformChanged() - { - revertTransform(); - m_evaluateTransform(); - updateOrigin(); - } - typedef MemberCaller TransformChangedCaller; - - mutable Matrix4 m_localPivot; - const Matrix4& getLocalPivot() const - { - m_localPivot = rotation_toMatrix(m_rotation); - vector4_to_vector3(m_localPivot.t()) = m_aabb_light.origin; - return m_localPivot; - } - - void setLightChangedCallback(const Callback& callback) - { - m_doom3Radius.m_changed = callback; - } - - const AABB& aabb() const - { - m_doom3AABB = AABB(m_aabb_light.origin, m_doom3Radius.m_radiusTransformed); - return m_doom3AABB; - } - bool testAABB(const AABB& other) const - { - if(isProjected()) - { - Matrix4 transform = rotation(); - vector4_to_vector3(transform.t()) = localAABB().origin; - projection(); - Frustum frustum(frustum_transformed(m_doom3Frustum, transform)); - return frustum_test_aabb(frustum, other) != c_volumeOutside; - } - // test against an AABB which contains the rotated bounds of this light. - const AABB& bounds = aabb(); - return aabb_intersects_aabb(other, AABB( - bounds.origin, - Vector3( - static_cast(fabs(m_rotation[0] * bounds.extents[0]) - + fabs(m_rotation[3] * bounds.extents[1]) - + fabs(m_rotation[6] * bounds.extents[2])), - static_cast(fabs(m_rotation[1] * bounds.extents[0]) - + fabs(m_rotation[4] * bounds.extents[1]) - + fabs(m_rotation[7] * bounds.extents[2])), - static_cast(fabs(m_rotation[2] * bounds.extents[0]) - + fabs(m_rotation[5] * bounds.extents[1]) - + fabs(m_rotation[8] * bounds.extents[2])) - ) - )); - } - - const Matrix4& rotation() const - { - m_doom3Rotation = rotation_toMatrix(m_rotation); - return m_doom3Rotation; - } - const Vector3& offset() const - { - return m_doom3Radius.m_center; - } - const Vector3& colour() const - { - return m_colour.m_colour; - } - - bool isProjected() const - { - return m_useLightTarget && m_useLightUp && m_useLightRight; - } - void projectionChanged() - { - m_doom3ProjectionChanged = true; - m_doom3Radius.m_changed(); - SceneChangeNotify(); - } - - const Matrix4& projection() const - { - if(!m_doom3ProjectionChanged) - { - return m_doom3Projection; - } - m_doom3ProjectionChanged = false; - m_doom3Projection = g_matrix4_identity; - matrix4_translate_by_vec3(m_doom3Projection, Vector3(0.5f, 0.5f, 0)); - matrix4_scale_by_vec3(m_doom3Projection, Vector3(0.5f, 0.5f, 1)); - -#if 0 - Vector3 right = vector3_cross(m_lightUp, vector3_normalised(m_lightTarget)); - Vector3 up = vector3_cross(vector3_normalised(m_lightTarget), m_lightRight); - Vector3 target = m_lightTarget; - Matrix4 test( - -right.x(), -right.y(), -right.z(), 0, - -up.x(), -up.y(), -up.z(), 0, - -target.x(), -target.y(), -target.z(), 0, - 0, 0, 0, 1 - ); - Matrix4 frustum = matrix4_frustum(-0.01, 0.01, -0.01, 0.01, 0.01, 1.0); - test = matrix4_full_inverse(test); - matrix4_premultiply_by_matrix4(test, frustum); - matrix4_multiply_by_matrix4(m_doom3Projection, test); -#elif 0 - const float nearFar = 1 / 49.5f; - Vector3 right = vector3_cross(m_lightUp, vector3_normalised(m_lightTarget + m_lightRight)); - Vector3 up = vector3_cross(vector3_normalised(m_lightTarget + m_lightUp), m_lightRight); - Vector3 target = vector3_negated(m_lightTarget * (1 + nearFar)); - float scale = -1 / vector3_length(m_lightTarget); - Matrix4 test( - -inverse(right.x()), -inverse(up.x()), -inverse(target.x()), 0, - -inverse(right.y()), -inverse(up.y()), -inverse(target.y()), 0, - -inverse(right.z()), -inverse(up.z()), -inverse(target.z()), scale, - 0, 0, -nearFar, 0 - ); - matrix4_multiply_by_matrix4(m_doom3Projection, test); -#elif 0 - Vector3 leftA(m_lightTarget - m_lightRight); - Vector3 leftB(m_lightRight + m_lightUp); - Plane3 left(vector3_normalised(vector3_cross(leftA, leftB)) * (1.0 / 128), 0); - Vector3 rightA(m_lightTarget + m_lightRight); - Vector3 rightB(vector3_cross(rightA, m_lightTarget)); - Plane3 right(vector3_normalised(vector3_cross(rightA, rightB)) * (1.0 / 128), 0); - Vector3 bottomA(m_lightTarget - m_lightUp); - Vector3 bottomB(vector3_cross(bottomA, m_lightTarget)); - Plane3 bottom(vector3_normalised(vector3_cross(bottomA, bottomB)) * (1.0 / 128), 0); - Vector3 topA(m_lightTarget + m_lightUp); - Vector3 topB(vector3_cross(topA, m_lightTarget)); - Plane3 top(vector3_normalised(vector3_cross(topA, topB)) * (1.0 / 128), 0); - Plane3 front(vector3_normalised(m_lightTarget) * (1.0 / 128), 1); - Plane3 back(vector3_normalised(vector3_negated(m_lightTarget)) * (1.0 / 128), 0); - Matrix4 test(matrix4_from_planes(plane3_flipped(left), plane3_flipped(right), plane3_flipped(bottom), plane3_flipped(top), plane3_flipped(front), plane3_flipped(back))); - matrix4_multiply_by_matrix4(m_doom3Projection, test); -#else - - Plane3 lightProject[4]; - - Vector3 start = m_useLightStart && m_useLightEnd ? m_lightStart : vector3_normalised(m_lightTarget); - Vector3 stop = m_useLightStart && m_useLightEnd ? m_lightEnd : m_lightTarget; - - float rLen = vector3_length(m_lightRight); - Vector3 right = vector3_divided(m_lightRight, rLen); - float uLen = vector3_length(m_lightUp); - Vector3 up = vector3_divided(m_lightUp, uLen); - Vector3 normal = vector3_normalised(vector3_cross(up, right)); - - float dist = vector3_dot(m_lightTarget, normal); - if ( dist < 0 ) { - dist = -dist; - normal = vector3_negated(normal); - } - - right *= ( 0.5f * dist ) / rLen; - up *= -( 0.5f * dist ) / uLen; - - lightProject[2] = Plane3(normal, 0); - lightProject[0] = Plane3(right, 0); - lightProject[1] = Plane3(up, 0); - - // now offset to center - Vector4 targetGlobal(m_lightTarget, 1); - { - float a = vector4_dot(targetGlobal, plane3_to_vector4(lightProject[0])); - float b = vector4_dot(targetGlobal, plane3_to_vector4(lightProject[2])); - float ofs = 0.5f - a / b; - plane3_to_vector4(lightProject[0]) += plane3_to_vector4(lightProject[2]) * ofs; - } - { - float a = vector4_dot(targetGlobal, plane3_to_vector4(lightProject[1])); - float b = vector4_dot(targetGlobal, plane3_to_vector4(lightProject[2])); - float ofs = 0.5f - a / b; - plane3_to_vector4(lightProject[1]) += plane3_to_vector4(lightProject[2]) * ofs; - } - - // set the falloff vector - Vector3 falloff = stop - start; - float length = vector3_length(falloff); - falloff = vector3_divided(falloff, length); - if ( length <= 0 ) { - length = 1; - } - falloff *= (1.0f / length); - lightProject[3] = Plane3(falloff, -vector3_dot(start, falloff)); - - // we want the planes of s=0, s=q, t=0, and t=q - m_doom3Frustum.left = lightProject[0]; - m_doom3Frustum.bottom = lightProject[1]; - m_doom3Frustum.right = Plane3(lightProject[2].normal() - lightProject[0].normal(), lightProject[2].dist() - lightProject[0].dist()); - m_doom3Frustum.top = Plane3(lightProject[2].normal() - lightProject[1].normal(), lightProject[2].dist() - lightProject[1].dist()); - - // we want the planes of s=0 and s=1 for front and rear clipping planes - m_doom3Frustum.front = lightProject[3]; - - m_doom3Frustum.back = lightProject[3]; - m_doom3Frustum.back.dist() -= 1.0f; - m_doom3Frustum.back = plane3_flipped(m_doom3Frustum.back); - - Matrix4 test(matrix4_from_planes(m_doom3Frustum.left, m_doom3Frustum.right, m_doom3Frustum.bottom, m_doom3Frustum.top, m_doom3Frustum.front, m_doom3Frustum.back)); - matrix4_multiply_by_matrix4(m_doom3Projection, test); - - m_doom3Frustum.left = plane3_normalised(m_doom3Frustum.left); - m_doom3Frustum.right = plane3_normalised(m_doom3Frustum.right); - m_doom3Frustum.bottom = plane3_normalised(m_doom3Frustum.bottom); - m_doom3Frustum.top = plane3_normalised(m_doom3Frustum.top); - m_doom3Frustum.back = plane3_normalised(m_doom3Frustum.back); - m_doom3Frustum.front = plane3_normalised(m_doom3Frustum.front); -#endif - //matrix4_scale_by_vec3(m_doom3Projection, Vector3(1.0 / 128, 1.0 / 128, 1.0 / 128)); - return m_doom3Projection; - } - - Shader* getShader() const - { - return m_shader.get(); - } -}; - -class LightInstance : - public TargetableInstance, - public TransformModifier, - public Renderable, - public SelectionTestable, - public RendererLight, - public PlaneSelectable, - public ComponentSelectionTestable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceContainedCast::install(m_casts); - //InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - Light& m_contained; - DragPlanes m_dragPlanes;// dragplanes for lightresizing using mousedrag -public: - typedef LazyStatic StaticTypeCasts; - - Bounded& get(NullType) - { - return m_contained; - } - - STRING_CONSTANT(Name, "LightInstance"); - - LightInstance(const scene::Path& path, scene::Instance* parent, Light& contained) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), contained.getEntity(), *this), - TransformModifier(Light::TransformChangedCaller(contained), ApplyTransformCaller(*this)), - m_contained(contained), - m_dragPlanes(SelectedChangedComponentCaller(*this)) - { - m_contained.instanceAttach(Instance::path()); - - if(g_lightType == LIGHTTYPE_DOOM3) - { - GlobalShaderCache().attach(*this); - m_contained.setLightChangedCallback(LightChangedCaller(*this)); - } - - StaticRenderableConnectionLines::instance().attach(*this); - } - ~LightInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_contained.setLightChangedCallback(Callback()); - GlobalShaderCache().detach(*this); - } - - m_contained.instanceDetach(Instance::path()); - } - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - void testSelect(Selector& selector, SelectionTest& test) - { - m_contained.testSelect(selector, test, Instance::localToWorld()); - } - - void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) - { - test.BeginMesh(localToWorld()); - m_dragPlanes.selectPlanes(m_contained.aabb(), selector, test, selectedPlaneCallback, rotation()); - } - void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) - { - m_dragPlanes.selectReversedPlanes(m_contained.aabb(), selector, selectedPlanes, rotation()); - } - - bool isSelectedComponents() const - { - return m_dragPlanes.isSelected(); - } - void setSelectedComponents(bool select, SelectionSystem::EComponentMode mode) - { - if(mode == SelectionSystem::eFace) - { - m_dragPlanes.setSelected(false); - } - } - void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - { - } - - void selectedChangedComponent(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::eComponent)(selectable); - GlobalSelectionSystem().onComponentSelection(*this, selectable); - } - typedef MemberCaller1 SelectedChangedComponentCaller; - - void evaluateTransform() - { - if(getType() == TRANSFORM_PRIMITIVE) - { - m_contained.translate(getTranslation()); - m_contained.rotate(getRotation()); - } - else - { - //globalOutputStream() << getTranslation() << "\n"; - - m_dragPlanes.m_bounds = m_contained.aabb(); - m_contained.setLightRadius(m_dragPlanes.evaluateResize(getTranslation(), rotation())); - } - } - void applyTransform() - { - m_contained.revertTransform(); - evaluateTransform(); - m_contained.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; - - void lightChanged() - { - GlobalShaderCache().changed(*this); - } - typedef MemberCaller LightChangedCaller; - - Shader* getShader() const - { - return m_contained.getShader(); - } - const AABB& aabb() const - { - return m_contained.aabb(); - } - bool testAABB(const AABB& other) const - { - return m_contained.testAABB(other); - } - const Matrix4& rotation() const - { - return m_contained.rotation(); - } - const Vector3& offset() const - { - return m_contained.offset(); - } - const Vector3& colour() const - { - return m_contained.colour(); - } - - bool isProjected() const - { - return m_contained.isProjected(); - } - const Matrix4& projection() const - { - return m_contained.projection(); - } -}; - -class LightNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable, - public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - if(g_lightType == LIGHTTYPE_DOOM3) - { - NodeContainedCast::install(m_casts); - } - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Light m_contained; - - void construct() - { - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_contained.attach(this); - } - } - void destroy() - { - if(g_lightType == LIGHTTYPE_DOOM3) - { - m_contained.detach(this); - } - } -public: - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_contained.getTraversable(); - } - Editable& get(NullType) - { - return m_contained; - } - Snappable& get(NullType) - { - return m_contained; - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - - LightNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSet::BoundsChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - LightNode(const LightNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - scene::Traversable::Observer(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSet::BoundsChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - ~LightNode() - { - destroy(); - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new LightNode(*this))->node(); - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new LightInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -void Light_Construct(LightType lightType) -{ - g_lightType = lightType; - if(g_lightType == LIGHTTYPE_DOOM3) - { - LightShader::m_defaultShader = "lights/defaultPointLight"; -#if 0 - LightShader::m_defaultShader = "lights/defaultProjectedLight"; -#endif - } - RenderLightRadiiFill::m_state = GlobalShaderCache().capture("$Q3MAP2_LIGHT_SPHERE"); - RenderLightCenter::m_state = GlobalShaderCache().capture("$BIGPOINT"); -} -void Light_Destroy() -{ - GlobalShaderCache().release("$Q3MAP2_LIGHT_SPHERE"); - GlobalShaderCache().release("$BIGPOINT"); -} - -scene::Node& New_Light(EntityClass* eclass) -{ - return (new LightNode(eclass))->node(); -} diff --git a/plugins/entity/light.h b/plugins/entity/light.h index 96f677ba..37b714f2 100644 --- a/plugins/entity/light.h +++ b/plugins/entity/light.h @@ -1,6 +1,7 @@ + /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,23 +20,7 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_LIGHT_H) -#define INCLUDED_LIGHT_H +bool Entity_IsLight(entity_t *e); +void Light_OnKeyValueChanged(entity_t *e, const char *key, const char* value); +void DrawLight(entity_t* e, int nGLState, int pref, int nViewType); -namespace scene -{ - class Node; -}; -class EntityClass; - -scene::Node& New_Light(EntityClass* eclass); -enum LightType -{ - LIGHTTYPE_DEFAULT, - LIGHTTYPE_RTCW, - LIGHTTYPE_DOOM3 -}; -void Light_Construct(LightType lightType); -void Light_Destroy(); - -#endif diff --git a/plugins/entity/miscmodel.cpp b/plugins/entity/miscmodel.cpp index c23075fe..106fa17c 100644 --- a/plugins/entity/miscmodel.cpp +++ b/plugins/entity/miscmodel.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,458 +19,236 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -///\file -///\brief Represents the Quake3 misc_model entity. -/// -/// This entity displays the model specified in its "model" key. -/// The "origin", "angles" and "modelscale*" keys directly control the entity's local-to-parent transform. - -#include "cullable.h" -#include "renderable.h" -#include "editable.h" - -#include "selectionlib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "entitylib.h" -#include "eclasslib.h" -#include "render.h" -#include "pivot.h" - -#include "targetable.h" -#include "origin.h" -#include "angles.h" -#include "scale.h" -#include "model.h" -#include "filters.h" -#include "namedentity.h" -#include "keyobservers.h" -#include "namekeys.h" +#include +#include "entity_entitymodel.h" #include "entity.h" -class MiscModel : - public Snappable +// +// CEntityMiscModel implementation +// + +CEntityMiscModel::CEntityMiscModel (entity_t *e) { - EntityKeyValues m_entity; - KeyObserverMap m_keyObservers; - MatrixTransform m_transform; + refCount = 1; + m_entity = e; + m_model = NULL; + VectorSet(m_translate, 0,0,0); + VectorSet(m_euler, 0,0,0); + VectorSet(m_scale, 1,1,1); + VectorSet(m_pivot, 0,0,0); + m4x4_identity(m_transform); + m4x4_identity(m_inverse_transform); +} - OriginKey m_originKey; - Vector3 m_origin; - AnglesKey m_anglesKey; - Vector3 m_angles; - ScaleKey m_scaleKey; - Vector3 m_scale; +CEntityMiscModel::~CEntityMiscModel () +{ + if(m_cachereq.GetBuffer()[0] != ':' + && m_version.c_str()[0] != '\0') + GetModelCache()->DeleteByID(m_cachereq.GetBuffer(), m_version.c_str()); +} - SingletonModel m_model; - ClassnameFilter m_filter; - NamedEntity m_named; - NameKeys m_nameKeys; - RenderablePivot m_renderOrigin; - RenderableNamedEntity m_renderName; +// IRender - Callback m_transformChanged; - Callback m_evaluateTransform; +void CEntityMiscModel::Draw(int state, int rflags) const +{ + // push the current modelview matrix + // FIXME: put in a check for stack recursion depth.. + // or avoid recursion of opengl matrix stack + g_QglTable.m_pfn_qglPushMatrix(); + // apply the parent-to-local transform + g_QglTable.m_pfn_qglMultMatrixf(m_transform); - void construct() + pivot_draw(m_pivot); + + // draw children + if(m_model && m_model->pRender) { - m_keyObservers.insert("classname", ClassnameFilter::ClassnameChangedCaller(m_filter)); - m_keyObservers.insert(Static::instance().m_nameKey, NamedEntity::IdentifierChangedCaller(m_named)); - m_keyObservers.insert("model", SingletonModel::ModelChangedCaller(m_model)); - m_keyObservers.insert("origin", OriginKey::OriginChangedCaller(m_originKey)); - m_keyObservers.insert("angle", AnglesKey::AngleChangedCaller(m_anglesKey)); - m_keyObservers.insert("angles", AnglesKey::AnglesChangedCaller(m_anglesKey)); - m_keyObservers.insert("modelscale", ScaleKey::UniformScaleChangedCaller(m_scaleKey)); - m_keyObservers.insert("modelscale_vec", ScaleKey::ScaleChangedCaller(m_scaleKey)); + m_model->pRender->Draw(state, rflags); } - - void updateTransform() - { - m_transform.localToParent() = g_matrix4_identity; - matrix4_transform_by_euler_xyz_degrees(m_transform.localToParent(), m_origin, m_angles, m_scale); - m_transformChanged(); - } - -// vc 2k5 compiler fix -#if _MSC_VER >= 1400 - public: -#endif - void originChanged() - { - m_origin = m_originKey.m_origin; - updateTransform(); - } - typedef MemberCaller OriginChangedCaller; - void anglesChanged() - { - m_angles = m_anglesKey.m_angles; - updateTransform(); - } - typedef MemberCaller AnglesChangedCaller; - void scaleChanged() - { - m_scale = m_scaleKey.m_scale; - updateTransform(); - } - typedef MemberCaller ScaleChangedCaller; -public: - - MiscModel(EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(eclass), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_anglesKey(AnglesChangedCaller(*this)), - m_angles(ANGLESKEY_IDENTITY), - m_scaleKey(ScaleChangedCaller(*this)), - m_scale(SCALEKEY_IDENTITY), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, g_vector3_identity), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - MiscModel(const MiscModel& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform) : - m_entity(other.m_entity), - m_originKey(OriginChangedCaller(*this)), - m_origin(ORIGINKEY_IDENTITY), - m_anglesKey(AnglesChangedCaller(*this)), - m_angles(ANGLESKEY_IDENTITY), - m_scaleKey(ScaleChangedCaller(*this)), - m_scale(SCALEKEY_IDENTITY), - m_filter(m_entity, node), - m_named(m_entity), - m_nameKeys(m_entity), - m_renderName(m_named, g_vector3_identity), - m_transformChanged(transformChanged), - m_evaluateTransform(evaluateTransform) - { - construct(); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_filter.instanceAttach(); - m_entity.instanceAttach(path_find_mapfile(path.begin(), path.end())); - m_entity.attach(m_keyObservers); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_entity.detach(m_keyObservers); - m_entity.instanceDetach(path_find_mapfile(path.begin(), path.end())); - m_filter.instanceDetach(); - } - } - - EntityKeyValues& getEntity() - { - return m_entity; - } - const EntityKeyValues& getEntity() const - { - return m_entity; - } - - scene::Traversable& getTraversable() - { - return m_model.getTraversable(); - } - Namespaced& getNamespaced() - { - return m_nameKeys; - } - Nameable& getNameable() - { - return m_named; - } - TransformNode& getTransformNode() - { - return m_transform; - } - - void attach(scene::Traversable::Observer* observer) - { - m_model.attach(observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_model.detach(observer); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - if(selected) - { - m_renderOrigin.render(renderer, volume, localToWorld); - } - - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const - { - renderSolid(renderer, volume, localToWorld, selected); - if(g_showNames) - { - renderer.addRenderable(m_renderName, localToWorld); - } - } - - void translate(const Vector3& translation) - { - m_origin = origin_translated(m_origin, translation); - } - void rotate(const Quaternion& rotation) - { - m_angles = angles_rotated(m_angles, rotation); - } - void scale(const Vector3& scaling) - { - m_scale = scale_scaled(m_scale, scaling); - } - void snapto(float snap) - { - m_originKey.m_origin = origin_snapped(m_originKey.m_origin, snap); - m_originKey.write(&m_entity); - } - void revertTransform() - { - m_origin = m_originKey.m_origin; - m_angles = m_anglesKey.m_angles; - m_scale = m_scaleKey.m_scale; - } - void freezeTransform() - { - m_originKey.m_origin = m_origin; - m_originKey.write(&m_entity); - m_anglesKey.m_angles = m_angles; - m_anglesKey.write(&m_entity); - m_scaleKey.m_scale = m_scale; - m_scaleKey.write(&m_entity); - } - void transformChanged() - { - revertTransform(); - m_evaluateTransform(); - updateTransform(); - } - typedef MemberCaller TransformChangedCaller; -}; - -class MiscModelInstance : public TargetableInstance, public TransformModifier, public Renderable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - m_casts = TargetableInstance::StaticTypeCasts::instance().get(); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - MiscModel& m_contained; -public: - typedef LazyStatic StaticTypeCasts; - - STRING_CONSTANT(Name, "MiscModelInstance"); - - MiscModelInstance(const scene::Path& path, scene::Instance* parent, MiscModel& miscmodel) : - TargetableInstance(path, parent, this, StaticTypeCasts::instance().get(), miscmodel.getEntity(), *this), - TransformModifier(MiscModel::TransformChangedCaller(miscmodel), ApplyTransformCaller(*this)), - m_contained(miscmodel) - { - m_contained.instanceAttach(Instance::path()); - StaticRenderableConnectionLines::instance().attach(*this); - } - ~MiscModelInstance() - { - StaticRenderableConnectionLines::instance().detach(*this); - m_contained.instanceDetach(Instance::path()); - } - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderSolid(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected()); - } - void evaluateTransform() - { - if(getType() == TRANSFORM_PRIMITIVE) - { - m_contained.translate(getTranslation()); - m_contained.rotate(getRotation()); - m_contained.scale(getScale()); - } - } - void applyTransform() - { - m_contained.revertTransform(); - evaluateTransform(); - m_contained.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; -}; - -class MiscModelNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable, - public scene::Traversable::Observer -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - MiscModel m_contained; - - void construct() - { - m_contained.attach(this); - } - void destroy() - { - m_contained.detach(this); - } - -public: - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_contained.getTraversable(); - } - Snappable& get(NullType) - { - return m_contained; - } - TransformNode& get(NullType) - { - return m_contained.getTransformNode(); - } - Entity& get(NullType) - { - return m_contained.getEntity(); - } - Nameable& get(NullType) - { - return m_contained.getNameable(); - } - Namespaced& get(NullType) - { - return m_contained.getNamespaced(); - } - - MiscModelNode(EntityClass* eclass) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(eclass, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - MiscModelNode(const MiscModelNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - scene::Traversable::Observer(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_contained(other.m_contained, m_node, InstanceSet::TransformChangedCaller(m_instances), InstanceSetEvaluateTransform::Caller(m_instances)) - { - construct(); - } - ~MiscModelNode() - { - destroy(); - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new MiscModelNode(*this))->node(); - } - - void insert(scene::Node& child) - { - m_instances.insert(child); - } - void erase(scene::Node& child) - { - m_instances.erase(child); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new MiscModelInstance(path, parent, m_contained); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -scene::Node& New_MiscModel(EntityClass* eclass) -{ - return (new MiscModelNode(eclass))->node(); + g_QglTable.m_pfn_qglPopMatrix(); } -void MiscModel_construct() +// ISelect + +bool CEntityMiscModel::TestRay(const ray_t *ray, vec_t *dist) const { + vec_t dist_start = *dist; + vec_t dist_local = *dist; + ray_t ray_local = *ray; + + if (aabb_test_ray(&m_BBox, ray) == 0) + return false; + + ray_transform(&ray_local, m_inverse_transform); + + if(m_model && m_model->pSelect) + { + if(m_model->pSelect->TestRay(&ray_local, &dist_local)) + *dist = dist_local; + } + else *dist = dist_local; + + return *dist < dist_start; } -void MiscModel_destroy() + + +//IEdit + +void CEntityMiscModel::Translate(const vec3_t translation) { + VectorIncrement(translation, m_translate); + UpdateCachedData(); +} + +void CEntityMiscModel::Rotate(const vec3_t pivot, const vec3_t rotation) +{ + m4x4_t rotation_matrix; + + m4x4_identity(rotation_matrix); + m4x4_pivoted_rotate_by_vec3(rotation_matrix, rotation, eXYZ, pivot); + m4x4_transform_point(rotation_matrix, m_translate); + + VectorIncrement(rotation, m_euler); + + UpdateCachedData(); +} + +void CEntityMiscModel::OnKeyValueChanged(entity_t *e, const char *key, const char* value) +{ + if(strcmp(key, "model") == 0) + SetName(value); + else if(strcmp(key, "_frame") == 0) + { + SetName(ValueForKey(e, "model")); + } + else if(strcmp(key, "angle") == 0) + { + VectorSet(m_euler, 0.f, 0.f, 0.f); + m_euler[2] = atof(value); + UpdateCachedData(); + } + else if(strcmp(key, "angles") == 0) + { + VectorSet(m_euler, 0.f, 0.f, 0.f); + if (value[0] != '\0') + sscanf (value, "%f %f %f", &m_euler[1], &m_euler[2], &m_euler[0]); + UpdateCachedData(); + } + else if(strcmp(key, "modelscale") == 0 || strcmp(key,"modelscale_vec") == 0) + { + const char *s; + VectorSet(m_scale, 1.f, 1.f, 1.f); + s = ValueForKey(e,"modelscale"); + if (s[0] != '\0') + { + float f = atof(s); + if( f != 0 ) + VectorSet(m_scale, f, f, f); + else + Sys_FPrintf(SYS_WRN, "WARNING: ignoring 0 modelscale key\n"); + } + s = ValueForKey(e,"modelscale_vec"); + if (s[0] != '\0') + { + sscanf (s, "%f %f %f", &m_scale[0], &m_scale[1], &m_scale[2]); + if (m_scale[0] == 0.0 && m_scale[1] == 0.0 && m_scale[2] == 0.0) + { + VectorSet(m_scale, 1,1,1); + Sys_FPrintf(SYS_WRN, "WARNING: ignoring 0 0 0 modelscale_vec key\n"); + } + } + UpdateCachedData(); + } + else if(strcmp(key, "origin") == 0) + { + sscanf(value, "%f %f %f", &m_translate[0], &m_translate[1], &m_translate[2]); + UpdateCachedData(); + } + else if(strncmp(key,"_remap",6) == 0) + { + SetName(ValueForKey(e, "model")); + } +} + +// +// CEntityMiscModel +// + +// private: + +void CEntityMiscModel::BuildCacheRequestString(const char *name) +{ + bool hasRemaps = false; + + m_cachereq.Format( "%s:%i", name, IntForKey(m_entity,"_frame") ); + + for (epair_t* ep = m_entity->epairs ; ep ; ep=ep->next) + { + if( strncmp(ep->key,"_remap",6) == 0 ) + { + if( !hasRemaps ) + { + hasRemaps = true; + m_cachereq += "?"; + } else { + m_cachereq += "&"; + } + m_cachereq += ep->value; + } + } +} + +void CEntityMiscModel::SetName(const char *name) +{ + Str m_oldcachereq = m_cachereq; + + if( name[0] == '\0' ) { + return; + } + + BuildCacheRequestString(name); + + if(strcmp(m_oldcachereq, m_cachereq) == 0) + return; + + if(m_cachereq.GetBuffer()[0] != ':' + && m_version.c_str()[0] != '\0') + GetModelCache()->DeleteByID(m_cachereq.GetBuffer(), m_version.c_str()); + + m_model = NULL; + + if(name[0] != '\0') + { + const char* dot = strrchr(name, '.'); + if(dot != NULL) + { + m_version = ++dot; + m_model = GetModelCache()->GetByID(m_cachereq.GetBuffer(), m_version.c_str()); + } + } + + UpdateCachedData(); +} + + +void CEntityMiscModel::UpdateCachedData() +{ + aabb_t aabb_temp; + + m4x4_identity(m_transform); + m4x4_pivoted_transform_by_vec3(m_transform, m_translate, m_euler, eXYZ, m_scale, m_pivot); + memcpy(m_inverse_transform, m_transform, sizeof(m4x4_t)); + m4x4_invert(m_inverse_transform); + + aabb_clear(&aabb_temp); + + if(m_model && m_model->pRender) + aabb_extend_by_aabb(&aabb_temp, m_model->pRender->GetAABB()); + else + VectorSet(aabb_temp.extents, 8, 8, 8); + + aabb_for_transformed_aabb(&m_BBox, &aabb_temp, m_transform); } diff --git a/plugins/entity/miscmodel.h b/plugins/entity/miscmodel.h deleted file mode 100644 index bacbdfb6..00000000 --- a/plugins/entity/miscmodel.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MISCMODEL_H) -#define INCLUDED_MISCMODEL_H - -scene::Node& New_MiscModel(EntityClass* eclass); -void MiscModel_construct(); -void MiscModel_destroy(); - -#endif diff --git a/plugins/entity/model.cpp b/plugins/entity/model.cpp deleted file mode 100644 index 6c952183..00000000 --- a/plugins/entity/model.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "model.h" - diff --git a/plugins/entity/model.h b/plugins/entity/model.h deleted file mode 100644 index d02c7a85..00000000 --- a/plugins/entity/model.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODEL_H) -#define INCLUDED_MODEL_H - -#include "entitylib.h" -#include "traverselib.h" -#include "generic/callback.h" -#include "stream/stringstream.h" -#include "os/path.h" -#include "moduleobserver.h" - -class Model : public ModuleObserver -{ - ResourceReference m_resource; - scene::Traversable& m_traverse; - scene::Node* m_node; - Callback m_modelChanged; - -public: - Model(scene::Traversable& traversable, const Callback& modelChanged) - : m_resource(""), m_traverse(traversable), m_node(0), m_modelChanged(modelChanged) - { - m_resource.attach(*this); - } - ~Model() - { - m_resource.detach(*this); - } - - void realise() - { - m_resource.get()->load(); - m_node = m_resource.get()->getNode(); - if(m_node != 0) - { - m_traverse.insert(*m_node); - } - } - void unrealise() - { - if(m_node != 0) - { - m_traverse.erase(*m_node); - } - } - - void modelChanged(const char* value) - { - StringOutputStream cleaned(string_length(value)); - cleaned << PathCleaned(value); - m_resource.detach(*this); - m_resource.setName(cleaned.c_str()); - m_resource.attach(*this); - m_modelChanged(); - } - typedef MemberCaller1 ModelChangedCaller; - - const char* getName() const - { - return m_resource.getName(); - } - scene::Node* getNode() const - { - return m_node; - } -}; - -class SingletonModel -{ - TraversableNode m_traverse; - Model m_model; -public: - SingletonModel() - : m_model(m_traverse, Callback()) - { - } - - void attach(scene::Traversable::Observer* observer) - { - m_traverse.attach(observer); - } - void detach(scene::Traversable::Observer* observer) - { - m_traverse.detach(observer); - } - - scene::Traversable& getTraversable() - { - return m_traverse; - } - - void modelChanged(const char* value) - { - m_model.modelChanged(value); - } - typedef MemberCaller1 ModelChangedCaller; - - scene::Node* getNode() const - { - return m_model.getNode(); - } -}; - -#endif diff --git a/plugins/entity/modelskinkey.cpp b/plugins/entity/modelskinkey.cpp deleted file mode 100644 index d641e519..00000000 --- a/plugins/entity/modelskinkey.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "modelskinkey.h" - diff --git a/plugins/entity/modelskinkey.h b/plugins/entity/modelskinkey.h deleted file mode 100644 index 58c7da24..00000000 --- a/plugins/entity/modelskinkey.h +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODELSKINKEY_H) -#define INCLUDED_MODELSKINKEY_H - -#include "modelskin.h" - -#include "os/path.h" -#include "stream/stringstream.h" -#include "moduleobserver.h" -#include "entitylib.h" -#include "traverselib.h" - -inline void parseTextureName(CopiedString& name, const char* token) -{ - StringOutputStream cleaned(256); - cleaned << PathCleaned(token); - name = StringRange(cleaned.c_str(), path_get_filename_base_end(cleaned.c_str())); // remove extension -} - -class ModelSkinKey : public ModuleObserver -{ - CopiedString m_name; - ModelSkin* m_skin; - Callback m_skinChangedCallback; - - ModelSkinKey(const ModelSkinKey&); - ModelSkinKey operator=(const ModelSkinKey&); - - void construct() - { - m_skin = &GlobalModelSkinCache().capture(m_name.c_str()); - m_skin->attach(*this); - } - void destroy() - { - m_skin->detach(*this); - GlobalModelSkinCache().release(m_name.c_str()); - } - -public: - ModelSkinKey(const Callback& skinChangedCallback) : m_skinChangedCallback(skinChangedCallback) - { - construct(); - } - ~ModelSkinKey() - { - destroy(); - } - ModelSkin& get() const - { - return *m_skin; - } - void skinChanged(const char* value) - { - destroy(); - parseTextureName(m_name, value); - construct(); - } - typedef MemberCaller1 SkinChangedCaller; - - void realise() - { - m_skinChangedCallback(); - } - void unrealise() - { - } -}; - -class InstanceSkinChanged : public scene::Instantiable::Visitor -{ -public: - void visit(scene::Instance& instance) const - { - //\todo don't do this for instances that are not children of the entity setting the skin - SkinnedModel* skinned = InstanceTypeCast::cast(instance); - if(skinned != 0) - { - skinned->skinChanged(); - } - } -}; - -inline void Node_modelSkinChanged(scene::Node& node) -{ - scene::Instantiable* instantiable = Node_getInstantiable(node); - ASSERT_NOTNULL(instantiable); - instantiable->forEachInstance(InstanceSkinChanged()); -} - -#endif diff --git a/plugins/entity/namedentity.cpp b/plugins/entity/namedentity.cpp deleted file mode 100644 index a835f906..00000000 --- a/plugins/entity/namedentity.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "namedentity.h" - diff --git a/plugins/entity/namedentity.h b/plugins/entity/namedentity.h deleted file mode 100644 index 6258d1ce..00000000 --- a/plugins/entity/namedentity.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_NAMEDENTITY_H) -#define INCLUDED_NAMEDENTITY_H - -#include "entitylib.h" -#include "eclasslib.h" -#include "generic/callback.h" -#include "nameable.h" - -#include - -class NameCallbackSet -{ - typedef std::set NameCallbacks; - NameCallbacks m_callbacks; -public: - void insert(const NameCallback& callback) - { - m_callbacks.insert(callback); - } - void erase(const NameCallback& callback) - { - m_callbacks.erase(callback); - } - void changed(const char* name) const - { - for(NameCallbacks::const_iterator i = m_callbacks.begin(); i != m_callbacks.end(); ++i) - { - (*i)(name); - } - } -}; - -class NamedEntity : public Nameable -{ - EntityKeyValues& m_entity; - NameCallbackSet m_changed; - CopiedString m_name; -public: - NamedEntity(EntityKeyValues& entity) : m_entity(entity) - { - } - const char* name() const - { - if(string_empty(m_name.c_str())) - { - return m_entity.getEntityClass().name(); - } - return m_name.c_str(); - } - void attach(const NameCallback& callback) - { - m_changed.insert(callback); - } - void detach(const NameCallback& callback) - { - m_changed.erase(callback); - } - - void identifierChanged(const char* value) - { - if(string_empty(value)) - { - m_changed.changed(m_entity.getEntityClass().name()); - } - else - { - m_changed.changed(value); - } - m_name = value; - } - typedef MemberCaller1 IdentifierChangedCaller; -}; - -class RenderableNamedEntity : public OpenGLRenderable -{ - const NamedEntity& m_named; - const Vector3& m_position; -public: - RenderableNamedEntity(const NamedEntity& named, const Vector3& position) - : m_named(named), m_position(position) - { - } - void render(RenderStateFlags state) const - { - glRasterPos3fv(vector3_to_array(m_position)); - GlobalOpenGL().drawString(m_named.name()); - } -}; - - - -#endif diff --git a/plugins/entity/namekeys.cpp b/plugins/entity/namekeys.cpp deleted file mode 100644 index 9a736754..00000000 --- a/plugins/entity/namekeys.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "namekeys.h" - diff --git a/plugins/entity/namekeys.h b/plugins/entity/namekeys.h deleted file mode 100644 index bb0405e6..00000000 --- a/plugins/entity/namekeys.h +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_NAMEKEYS_H) -#define INCLUDED_NAMEKEYS_H - -#include -#include -#include "generic/static.h" -#include "entitylib.h" -#include "namespace.h" - -inline bool string_is_integer(const char* string) -{ - strtol(string, const_cast(&string), 10); - return *string == '\0'; -} - -typedef bool (*KeyIsNameFunc)(const char* key); - -class KeyIsName -{ -public: - KeyIsNameFunc m_keyIsName; - const char* m_nameKey; - - KeyIsName() - { - } -}; - - -typedef MemberCaller1 KeyValueAssignCaller; -typedef MemberCaller1 KeyValueAttachCaller; -typedef MemberCaller1 KeyValueDetachCaller; - -class NameKeys : public Entity::Observer, public Namespaced -{ - Namespace* m_namespace; - EntityKeyValues& m_entity; - KeyIsNameFunc m_keyIsName; - NameKeys(const NameKeys& other); - NameKeys& operator=(const NameKeys& other); - - typedef std::map KeyValues; - KeyValues m_keyValues; - - void insertName(const char* key, EntityKeyValue& value) - { - if(m_namespace != 0 && m_keyIsName(key)) - { - //globalOutputStream() << "insert " << key << "\n"; - m_namespace->attach(KeyValueAssignCaller(value), KeyValueAttachCaller(value)); - } - } - void eraseName(const char* key, EntityKeyValue& value) - { - if(m_namespace != 0 && m_keyIsName(key)) - { - //globalOutputStream() << "erase " << key << "\n"; - m_namespace->detach(KeyValueAssignCaller(value), KeyValueDetachCaller(value)); - } - } - void insertAll() - { - for(KeyValues::iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - insertName((*i).first.c_str(), *(*i).second); - } - } - void eraseAll() - { - for(KeyValues::iterator i = m_keyValues.begin(); i != m_keyValues.end(); ++i) - { - eraseName((*i).first.c_str(), *(*i).second); - } - } -public: - NameKeys(EntityKeyValues& entity) : m_namespace(0), m_entity(entity), m_keyIsName(Static::instance().m_keyIsName) - { - m_entity.attach(*this); - } - ~NameKeys() - { - m_entity.detach(*this); - } - void setNamespace(Namespace& space) - { - eraseAll(); - m_namespace = &space; - insertAll(); - } - void setKeyIsName(KeyIsNameFunc keyIsName) - { - eraseAll(); - m_keyIsName = keyIsName; - insertAll(); - } - void insert(const char* key, EntityKeyValue& value) - { - m_keyValues.insert(KeyValues::value_type(key, &value)); - insertName(key, value); - } - void erase(const char* key, EntityKeyValue& value) - { - eraseName(key, value); - m_keyValues.erase(key); - } -}; - -inline bool keyIsNameDoom3(const char* key) -{ - return string_equal(key, "target") - || (string_equal_n(key, "target", 6) && string_is_integer(key + 6)) - || string_equal(key, "name"); -} - -inline bool keyIsNameDoom3Doom3Group(const char* key) -{ - return keyIsNameDoom3(key) - || string_equal(key, "model"); -} - -inline bool keyIsNameQuake3(const char* key) -{ - return string_equal(key, "target") - || string_equal(key, "targetname"); -} - -#endif diff --git a/plugins/entity/origin.cpp b/plugins/entity/origin.cpp deleted file mode 100644 index acbb0563..00000000 --- a/plugins/entity/origin.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "origin.h" - diff --git a/plugins/entity/origin.h b/plugins/entity/origin.h deleted file mode 100644 index 75d4ee47..00000000 --- a/plugins/entity/origin.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ORIGIN_H) -#define INCLUDED_ORIGIN_H - -#include "ientity.h" - -#include "math/matrix.h" -#include "generic/callback.h" -#include "stringio.h" - -const Vector3 ORIGINKEY_IDENTITY = Vector3(0, 0, 0); - -inline void default_origin(Vector3& origin) -{ - origin = ORIGINKEY_IDENTITY; -} -inline void read_origin(Vector3& origin, const char* value) -{ - if(!string_parse_vector3(value, origin)) - { - default_origin(origin); - } -} -inline void write_origin(const Vector3& origin, Entity* entity, const char* key) -{ - char value[64]; - sprintf(value, "%g %g %g", origin[0], origin[1], origin[2]); - entity->setKeyValue(key, value); -} - -inline Vector3 origin_translated(const Vector3& origin, const Vector3& translation) -{ - return matrix4_get_translation_vec3( - matrix4_multiplied_by_matrix4( - matrix4_translation_for_vec3(origin), - matrix4_translation_for_vec3(translation) - ) - ); -} - -inline Vector3 origin_snapped(const Vector3& origin, float snap) -{ - return vector3_snapped(origin, snap); -} - -class OriginKey -{ - Callback m_originChanged; -public: - Vector3 m_origin; - - - OriginKey(const Callback& originChanged) - : m_originChanged(originChanged), m_origin(ORIGINKEY_IDENTITY) - { - } - - void originChanged(const char* value) - { - read_origin(m_origin, value); - m_originChanged(); - } - typedef MemberCaller1 OriginChangedCaller; - - - void write(Entity* entity) const - { - write_origin(m_origin, entity, "origin"); - } -}; - - -#include "scenelib.h" - -inline BrushDoom3* Node_getBrushDoom3(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline void BrushDoom3_setDoom3GroupOrigin(scene::Node& node, const Vector3& origin) -{ - BrushDoom3* brush = Node_getBrushDoom3(node); - if(brush != 0) - { - brush->setDoom3GroupOrigin(origin); - } -} - -class SetDoom3GroupOriginWalker : public scene::Traversable::Walker -{ - const Vector3& m_origin; -public: - SetDoom3GroupOriginWalker(const Vector3& origin) : m_origin(origin) - { - } - bool pre(scene::Node& node) const - { - BrushDoom3_setDoom3GroupOrigin(node, m_origin); - return true; - } -}; - -class Doom3GroupOrigin : public scene::Traversable::Observer -{ - scene::Traversable& m_set; - const Vector3& m_origin; - bool m_enabled; - -public: - Doom3GroupOrigin(scene::Traversable& set, const Vector3& origin) : m_set(set), m_origin(origin), m_enabled(false) - { - } - - void enable() - { - m_enabled = true; - originChanged(); - } - void disable() - { - m_enabled = false; - } - - void originChanged() - { - if(m_enabled) - { - m_set.traverse(SetDoom3GroupOriginWalker(m_origin)); - } - } - - void insert(scene::Node& node) - { - if(m_enabled) - { - BrushDoom3_setDoom3GroupOrigin(node, m_origin); - } - } - void erase(scene::Node& node) - { - if(m_enabled) - { - BrushDoom3_setDoom3GroupOrigin(node, Vector3(0, 0, 0)); - } - } -}; - - -#endif diff --git a/plugins/entity/plugin.cpp b/plugins/entity/plugin.cpp index 58ace895..ede5b91c 100644 --- a/plugins/entity/plugin.cpp +++ b/plugins/entity/plugin.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,142 +19,103 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +// +// Model Plugin +// + #include "plugin.h" - -#include "debugging/debugging.h" - -#include "iscenegraph.h" -#include "irender.h" -#include "iselection.h" -#include "ientity.h" -#include "iundo.h" -#include "ieclass.h" -#include "igl.h" -#include "ireference.h" -#include "ifilter.h" -#include "preferencesystem.h" -#include "qerplugin.h" -#include "namespace.h" -#include "modelskin.h" - -#include "typesystem.h" - #include "entity.h" -#include "skincache.h" +#include "entity_entitymodel.h" +#include "light.h" -#include "modulesystem/singletonmodule.h" +// ============================================================================= +// Globals -class EntityDependencies : - public GlobalRadiantModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalReferenceModuleRef, - public GlobalFilterModuleRef, - public GlobalPreferenceSystemModuleRef, - public GlobalNamespaceModuleRef, - public GlobalModelSkinCacheModuleRef +// function tables +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; +_QERBrushTable __BRUSHTABLENAME; +_QERUndoTable __UNDOTABLENAME; +_EClassManagerTable __ECLASSMANAGERTABLENAME; + +// ============================================================================= +// SYNAPSE + +class CSynapseClientEntity : public CSynapseClient { -}; - -class EntityQ3API : public TypeSystemRef -{ - EntityCreator* m_entityq3; public: - typedef EntityCreator Type; - STRING_CONSTANT(Name, "quake3"); - - EntityQ3API() - { - Entity_Construct(); - - m_entityq3 = &GetEntityCreator(); - - GlobalReferenceCache().setEntityCreator(*m_entityq3); - } - ~EntityQ3API() - { - Entity_Destroy(); - } - EntityCreator* getTable() - { - return m_entityq3; - } + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientEntity() { } + virtual ~CSynapseClientEntity() { } }; -typedef SingletonModule EntityQ3Module; -EntityQ3Module g_EntityQ3Module; +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientEntity g_SynapseClient; - -class EntityWolfAPI : public TypeSystemRef -{ - EntityCreator* m_entitywolf; -public: - typedef EntityCreator Type; - STRING_CONSTANT(Name, "wolf"); - - EntityWolfAPI() +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { - Entity_Construct(eGameTypeRTCW); - - m_entitywolf = &GetEntityCreator(); - - GlobalReferenceCache().setEntityCreator(*m_entitywolf); + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - ~EntityWolfAPI() - { - Entity_Destroy(); - } - EntityCreator* getTable() - { - return m_entitywolf; - } -}; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(ENTITY_MAJOR, NULL, sizeof(_QEREntityTable)); + 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); + g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(__BRUSHTABLENAME), SYN_REQUIRE, &__BRUSHTABLENAME); + g_SynapseClient.AddAPI(UNDO_MAJOR, NULL, sizeof(__UNDOTABLENAME), SYN_REQUIRE, &__UNDOTABLENAME); + g_SynapseClient.AddAPI(ECLASSMANAGER_MAJOR, NULL, sizeof(__ECLASSMANAGERTABLENAME), SYN_REQUIRE, &__ECLASSMANAGERTABLENAME); -typedef SingletonModule EntityWolfModule; - -EntityWolfModule g_EntityWolfModule; - - -class EntityDoom3API : public TypeSystemRef -{ - EntityCreator* m_entitydoom3; -public: - typedef EntityCreator Type; - STRING_CONSTANT(Name, "doom3"); - - EntityDoom3API() - { - Entity_Construct(eGameTypeDoom3); - - m_entitydoom3 = &GetEntityCreator(); - - GlobalReferenceCache().setEntityCreator(*m_entitydoom3); - } - ~EntityDoom3API() - { - Entity_Destroy(); - } - EntityCreator* getTable() - { - return m_entitydoom3; - } -}; - -typedef SingletonModule EntityDoom3Module; - -EntityDoom3Module g_EntityDoom3Module; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_EntityQ3Module.selfRegister(); - g_EntityWolfModule.selfRegister(); - g_EntityDoom3Module.selfRegister(); - Doom3ModelSkinCacheModule_selfRegister(server); + return &g_SynapseClient; +} + +bool CSynapseClientEntity::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, ENTITY_MAJOR)) + { + _QEREntityTable* pTable= static_cast<_QEREntityTable*>(pAPI->mpTable); + pTable->m_pfnEntity_Alloc = &Entity_Alloc; + pTable->m_pfnEntity_Free = &Entity_Free; + pTable->m_pfnEntity_Clone = &Entity_Clone; + pTable->m_pfnSetKeyValue = &SetKeyValue; + pTable->m_pfnDeleteKey = &DeleteKey; + pTable->m_pfnValueForKey = &ValueForKey; + pTable->m_pfnFloatForKey = &FloatForKey; + pTable->m_pfnIntForKey = &IntForKey; + pTable->m_pfnGetVectorForKey = &GetVectorForKey; + pTable->m_pfnEntity_AddToList = &Entity_AddToList; + pTable->m_pfnEntity_RemoveFromList = &Entity_RemoveFromList; + pTable->m_pfnEntity_LinkBrush = &Entity_LinkBrush; + pTable->m_pfnEntity_UnlinkBrush = &Entity_UnlinkBrush; + pTable->m_pfnDrawLight = &DrawLight; + pTable->m_pfnEntity_MemorySize = &Entity_MemorySize; + pTable->m_pfnAllocateEpair = &Entity_AllocateEpair; + pTable->m_pfnGetEntityKeyValList = &Entity_GetKeyValList; + pTable->m_pfnSetEntityKeyValList = &Entity_SetKeyValList; + + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientEntity::GetInfo() +{ + return "Entity module built " __DATE__ " " RADIANT_VERSION; } diff --git a/plugins/entity/plugin.h b/plugins/entity/plugin.h index 2f28d852..1c997440 100644 --- a/plugins/entity/plugin.h +++ b/plugins/entity/plugin.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,40 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ -#endif +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +/*! +\todo not sure about what should be used for common data structures, GLib or STL +I think STL would be better since I intend on using STL in synapse +*/ + +#include + +#include "synapse.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "ientity.h" +#define USE_ECLASSMANAGER_DEFINE +#include "ieclass.h" +#define USE_BRUSHTABLE_DEFINE +#include "ibrush.h" +#define USE_UNDOTABLE_DEFINE +#include "iundo.h" +#include "imodel.h" +#include "igl.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERBrushTable __BRUSHTABLENAME; +extern _QERUndoTable __UNDOTABLENAME; +extern _EClassManagerTable __ECLASSMANAGERTABLENAME; + +#define Error g_FuncTable.m_pfnError + +#endif // _PLUGIN_H_ diff --git a/plugins/entity/rotation.cpp b/plugins/entity/rotation.cpp deleted file mode 100644 index 4412d922..00000000 --- a/plugins/entity/rotation.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "rotation.h" - diff --git a/plugins/entity/rotation.h b/plugins/entity/rotation.h deleted file mode 100644 index 458704e4..00000000 --- a/plugins/entity/rotation.h +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ROTATION_H) -#define INCLUDED_ROTATION_H - -#include "ientity.h" - -#include "stream/stringstream.h" -#include "math/quaternion.h" -#include "generic/callback.h" -#include "stringio.h" - -#include "angle.h" - -typedef float Float9[9]; - -inline void default_rotation(Float9 rotation) -{ - rotation[0] = 1; - rotation[1] = 0; - rotation[2] = 0; - rotation[3] = 0; - rotation[4] = 1; - rotation[5] = 0; - rotation[6] = 0; - rotation[7] = 0; - rotation[8] = 1; -} -inline void write_rotation(const Float9 rotation, Entity* entity, const char* key = "rotation") -{ - if(rotation[0] == 1 - && rotation[1] == 0 - && rotation[2] == 0 - && rotation[3] == 0 - && rotation[4] == 1 - && rotation[5] == 0 - && rotation[6] == 0 - && rotation[7] == 0 - && rotation[8] == 1) - { - entity->setKeyValue(key, ""); - } - else - { - StringOutputStream value(256); - value << rotation[0] << ' ' - << rotation[1] << ' ' - << rotation[2] << ' ' - << rotation[3] << ' ' - << rotation[4] << ' ' - << rotation[5] << ' ' - << rotation[6] << ' ' - << rotation[7] << ' ' - << rotation[8]; - entity->setKeyValue(key, value.c_str()); - } -} -inline void read_rotation(Float9 rotation, const char* value) -{ - if(!string_parse_vector(value, rotation, rotation + 9)) - { - default_rotation(rotation); - } -} - -inline Matrix4 rotation_toMatrix(const Float9 rotation) -{ - return Matrix4( - rotation[0], - rotation[1], - rotation[2], - 0, - rotation[3], - rotation[4], - rotation[5], - 0, - rotation[6], - rotation[7], - rotation[8], - 0, - 0, - 0, - 0, - 1 - ); -} - -inline void rotation_fromMatrix(Float9 rotation, const Matrix4& matrix) -{ - rotation[0] = matrix.xx(); - rotation[1] = matrix.xy(); - rotation[2] = matrix.xz(); - rotation[3] = matrix.yx(); - rotation[4] = matrix.yy(); - rotation[5] = matrix.yz(); - rotation[6] = matrix.zx(); - rotation[7] = matrix.zy(); - rotation[8] = matrix.zz(); -} - -inline void rotation_assign(Float9 rotation, const Float9 other) -{ - rotation[0] = other[0]; - rotation[1] = other[1]; - rotation[2] = other[2]; - rotation[3] = other[3]; - rotation[4] = other[4]; - rotation[5] = other[5]; - rotation[6] = other[6]; - rotation[7] = other[7]; - rotation[8] = other[8]; -} - -inline void rotation_rotate(Float9 rotation, const Quaternion& rotate) -{ - rotation_fromMatrix(rotation, - matrix4_multiplied_by_matrix4( - rotation_toMatrix(rotation), - matrix4_rotation_for_quaternion_quantised(rotate) - ) - ); -} - -inline void read_angle(Float9 rotation, const char* value) -{ - float angle; - if(!string_parse_float(value, angle)) - { - default_rotation(rotation); - } - else - { - rotation_fromMatrix(rotation, matrix4_rotation_for_z_degrees(angle)); - } -} - -class RotationKey -{ - Callback m_rotationChanged; -public: - Float9 m_rotation; - - - RotationKey(const Callback& rotationChanged) - : m_rotationChanged(rotationChanged) - { - default_rotation(m_rotation); - } - - void angleChanged(const char* value) - { - read_angle(m_rotation, value); - m_rotationChanged(); - } - typedef MemberCaller1 AngleChangedCaller; - - void rotationChanged(const char* value) - { - read_rotation(m_rotation, value); - m_rotationChanged(); - } - typedef MemberCaller1 RotationChangedCaller; - - void write(Entity* entity) const - { - Vector3 euler = matrix4_get_rotation_euler_xyz_degrees(rotation_toMatrix(m_rotation)); - if(euler[0] == 0 && euler[1] == 0) - { - entity->setKeyValue("rotation", ""); - write_angle(euler[2], entity); - } - else - { - entity->setKeyValue("angle", ""); - write_rotation(m_rotation, entity); - } - } -}; - -#endif diff --git a/plugins/entity/scale.cpp b/plugins/entity/scale.cpp deleted file mode 100644 index 39131484..00000000 --- a/plugins/entity/scale.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "scale.h" - diff --git a/plugins/entity/scale.h b/plugins/entity/scale.h deleted file mode 100644 index 54bfc932..00000000 --- a/plugins/entity/scale.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SCALE_H) -#define INCLUDED_SCALE_H - -#include "ientity.h" - -#include "math/matrix.h" -#include "generic/callback.h" -#include "stringio.h" - -const Vector3 SCALEKEY_IDENTITY = Vector3(1, 1, 1); - -inline void default_scale(Vector3& scale) -{ - scale = SCALEKEY_IDENTITY; -} -inline void read_scale(Vector3& scalevec, const char* value) -{ - float scale; - if(!string_parse_float(value, scale) - || scale == 0) - { - default_scale(scalevec); - } - else - { - scalevec = Vector3(scale, scale, scale); - } -} -inline void read_scalevec(Vector3& scale, const char* value) -{ - if(!string_parse_vector3(value, scale) - || scale[0] == 0 - || scale[1] == 0 - || scale[2] == 0) - default_scale(scale); -} -inline void write_scale(const Vector3& scale, Entity* entity) -{ - if(scale[0] == 1 && scale[1] == 1 && scale[2] == 1) - { - entity->setKeyValue("modelscale", ""); - entity->setKeyValue("modelscale_vec", ""); - } - else - { - char value[64]; - - if(scale[0] == scale[1] && scale[0] == scale[2]) - { - sprintf(value, "%g", scale[0]); - entity->setKeyValue("modelscale_vec", ""); - entity->setKeyValue("modelscale", value); - } - else - { - sprintf(value, "%g %g %g", scale[0], scale[1], scale[2]); - entity->setKeyValue("modelscale", ""); - entity->setKeyValue("modelscale_vec", value); - } - } -} - -inline Vector3 scale_scaled(const Vector3& scale, const Vector3& scaling) -{ - return matrix4_get_scale_vec3( - matrix4_multiplied_by_matrix4( - matrix4_scale_for_vec3(scale), - matrix4_scale_for_vec3(scaling) - ) - ); -} - - -class ScaleKey -{ - Callback m_scaleChanged; -public: - Vector3 m_scale; - - - ScaleKey(const Callback& scaleChanged) - : m_scaleChanged(scaleChanged), m_scale(SCALEKEY_IDENTITY) - { - } - - void uniformScaleChanged(const char* value) - { - read_scale(m_scale, value); - m_scaleChanged(); - } - typedef MemberCaller1 UniformScaleChangedCaller; - - void scaleChanged(const char* value) - { - read_scalevec(m_scale, value); - m_scaleChanged(); - } - typedef MemberCaller1 ScaleChangedCaller; - - void write(Entity* entity) const - { - write_scale(m_scale, entity); - } -}; - - -#endif diff --git a/plugins/entity/skincache.cpp b/plugins/entity/skincache.cpp deleted file mode 100644 index b6a3e139..00000000 --- a/plugins/entity/skincache.cpp +++ /dev/null @@ -1,348 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "skincache.h" - -#include "ifilesystem.h" -#include "iscriplib.h" -#include "iarchive.h" -#include "modelskin.h" - -#include - -#include "stream/stringstream.h" -#include "generic/callback.h" -#include "container/cache.h" -#include "container/hashfunc.h" -#include "os/path.h" -#include "moduleobservers.h" -#include "modulesystem/singletonmodule.h" -#include "stringio.h" - -void parseShaderName(CopiedString& name, const char* token) -{ - StringOutputStream cleaned(256); - cleaned << PathCleaned(token); - name = cleaned.c_str(); -} - -class Doom3ModelSkin -{ - typedef std::map Remaps; - Remaps m_remaps; -public: - bool parseTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - for(;;) - { - const char* token = tokeniser.getToken(); - if(token == 0) - { - return false; - } - if(string_equal(token, "}")) - { - tokeniser.nextLine(); - return true; - } - else if(string_equal(token, "model")) - { - //const char* model = - tokeniser.getToken(); - } - else - { - CopiedString from, to; - parseShaderName(from, token); - - tokeniser.nextLine(); // hack to handle badly formed skins - - parseShaderName(to, tokeniser.getToken()); - - if(!string_equal(from.c_str(), to.c_str())) - { - m_remaps.insert(Remaps::value_type(from, to)); - } - } - tokeniser.nextLine(); - } - } - const char* getRemap(const char* name) const - { - Remaps::const_iterator i = m_remaps.find(name); - if(i != m_remaps.end()) - { - return (*i).second.c_str(); - } - return ""; - } - void forEachRemap(const SkinRemapCallback& callback) const - { - for(Remaps::const_iterator i = m_remaps.begin(); i != m_remaps.end(); ++i) - { - callback(SkinRemap((*i).first.c_str(), (*i).second.c_str())); - } - } -}; - -class GlobalSkins -{ -public: - typedef std::map SkinMap; - SkinMap m_skins; - Doom3ModelSkin g_nullSkin; - - Doom3ModelSkin& getSkin(const char* name) - { - SkinMap::iterator i = m_skins.find(name); - if(i != m_skins.end()) - { - return (*i).second; - } - - return g_nullSkin; - } - - bool parseTokens(Tokeniser& tokeniser) - { - tokeniser.nextLine(); - for(;;) - { - const char* token = tokeniser.getToken(); - if(token == 0) - { - // end of token stream - return true; - } - if(!string_equal(token, "skin")) - { - Tokeniser_unexpectedError(tokeniser, token, "skin"); - return false; - } - const char* other = tokeniser.getToken(); - if(other == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#string"); - return false; - } - CopiedString name; - parseShaderName(name, other); - Doom3ModelSkin& skin = m_skins[name]; - RETURN_FALSE_IF_FAIL(skin.parseTokens(tokeniser)); - } - } - - void parseFile(const char* name) - { - StringOutputStream relativeName(64); - relativeName << "skins/" << name; - ArchiveTextFile* file = GlobalFileSystem().openTextFile(relativeName.c_str()); - if(file != 0) - { - globalOutputStream() << "parsing skins from " << makeQuoted(name) << "\n"; - { - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewSimpleTokeniser(file->getInputStream()); - parseTokens(tokeniser); - tokeniser.release(); - } - file->release(); - } - else - { - globalErrorStream() << "failed to open " << makeQuoted(name) << "\n"; - } - } - - typedef MemberCaller1 ParseFileCaller; - - void construct() - { - GlobalFileSystem().forEachFile("skins/", "skin", ParseFileCaller(*this)); - } - - void destroy() - { - m_skins.clear(); - } - - void realise() - { - construct(); - } - void unrealise() - { - destroy(); - } -}; - -GlobalSkins g_skins; - - -class Doom3ModelSkinCacheElement : public ModelSkin -{ - ModuleObservers m_observers; - Doom3ModelSkin* m_skin; -public: - Doom3ModelSkinCacheElement() : m_skin(0) - { - } - void attach(ModuleObserver& observer) - { - m_observers.attach(observer); - if(realised()) - { - observer.realise(); - } - } - void detach(ModuleObserver& observer) - { - if(realised()) - { - observer.unrealise(); - } - m_observers.detach(observer); - } - bool realised() const - { - return m_skin != 0; - } - void realise(const char* name) - { - ASSERT_MESSAGE(!realised(), "Doom3ModelSkinCacheElement::realise: already realised"); - m_skin = &g_skins.getSkin(name); - m_observers.realise(); - } - void unrealise() - { - ASSERT_MESSAGE(realised(), "Doom3ModelSkinCacheElement::unrealise: not realised"); - m_observers.unrealise(); - m_skin = 0; - } - const char* getRemap(const char* name) const - { - ASSERT_MESSAGE(realised(), "Doom3ModelSkinCacheElement::getRemap: not realised"); - return m_skin->getRemap(name); - } - void forEachRemap(const SkinRemapCallback& callback) const - { - ASSERT_MESSAGE(realised(), "Doom3ModelSkinCacheElement::forEachRemap: not realised"); - m_skin->forEachRemap(callback); - } -}; - -class Doom3ModelSkinCache : public ModelSkinCache, public ModuleObserver -{ - class CreateDoom3ModelSkin - { - Doom3ModelSkinCache& m_cache; - public: - explicit CreateDoom3ModelSkin(Doom3ModelSkinCache& cache) - : m_cache(cache) - { - } - Doom3ModelSkinCacheElement* construct(const CopiedString& name) - { - Doom3ModelSkinCacheElement* skin = new Doom3ModelSkinCacheElement; - if(m_cache.realised()) - { - skin->realise(name.c_str()); - } - return skin; - } - void destroy(Doom3ModelSkinCacheElement* skin) - { - if(m_cache.realised()) - { - skin->unrealise(); - } - delete skin; - } - }; - - typedef HashedCache, CreateDoom3ModelSkin> Cache; - Cache m_cache; - bool m_realised; - -public: - typedef ModelSkinCache Type; - STRING_CONSTANT(Name, "*"); - ModelSkinCache* getTable() - { - return this; - } - - Doom3ModelSkinCache() : m_cache(CreateDoom3ModelSkin(*this)), m_realised(false) - { - GlobalFileSystem().attach(*this); - } - ~Doom3ModelSkinCache() - { - GlobalFileSystem().detach(*this); - } - - ModelSkin& capture(const char* name) - { - return *m_cache.capture(name); - } - void release(const char* name) - { - m_cache.release(name); - } - - bool realised() const - { - return m_realised; - } - void realise() - { - g_skins.realise(); - m_realised = true; - for(Cache::iterator i = m_cache.begin(); i != m_cache.end(); ++i) - { - (*i).value->realise((*i).key.c_str()); - } - } - void unrealise() - { - m_realised = false; - for(Cache::iterator i = m_cache.begin(); i != m_cache.end(); ++i) - { - (*i).value->unrealise(); - } - g_skins.unrealise(); - } -}; - -class Doom3ModelSkinCacheDependencies : public GlobalFileSystemModuleRef, public GlobalScripLibModuleRef -{ -}; - -typedef SingletonModule Doom3ModelSkinCacheModule; - -Doom3ModelSkinCacheModule g_Doom3ModelSkinCacheModule; - -void Doom3ModelSkinCacheModule_selfRegister(ModuleServer& server) -{ - g_Doom3ModelSkinCacheModule.selfRegister(); -} - diff --git a/plugins/entity/skincache.h b/plugins/entity/skincache.h deleted file mode 100644 index b20d4e70..00000000 --- a/plugins/entity/skincache.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SKINCACHE_H) -#define INCLUDED_SKINCACHE_H - -class ModuleServer; -void Doom3ModelSkinCacheModule_selfRegister(ModuleServer& server); - -#endif diff --git a/plugins/entity/targetable.cpp b/plugins/entity/targetable.cpp deleted file mode 100644 index 6e31a901..00000000 --- a/plugins/entity/targetable.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "targetable.h" - -typedef std::map targetnames_t; - -const char* g_targetable_nameKey = "targetname"; - -targetnames_t g_targetnames; - -targetables_t* getTargetables(const char* targetname) -{ - if(targetname[0] == '\0') - return 0; - return &g_targetnames[targetname]; -} - -Shader* RenderableTargetingEntity::m_state; diff --git a/plugins/entity/targetable.h b/plugins/entity/targetable.h deleted file mode 100644 index f9081d88..00000000 --- a/plugins/entity/targetable.h +++ /dev/null @@ -1,452 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_TARGETABLE_H) -#define INCLUDED_TARGETABLE_H - -#include -#include - -#include "cullable.h" -#include "renderable.h" - -#include "math/line.h" -#include "render.h" -#include "generic/callback.h" -#include "selectionlib.h" -#include "entitylib.h" -#include "eclasslib.h" -#include "stringio.h" - -class Targetable -{ -public: - virtual const Vector3& world_position() const = 0; -}; - -typedef std::set targetables_t; - -extern const char* g_targetable_nameKey; - -targetables_t* getTargetables(const char* targetname); - -class EntityConnectionLine : public OpenGLRenderable -{ -public: - Vector3 start; - Vector3 end; - - void render(RenderStateFlags state) const - { - float s1[2], s2[2]; - Vector3 dir(vector3_subtracted(end, start)); - double len = vector3_length(dir); - vector3_scale(dir, 8.0 * (1.0 / len)); - s1[0] = dir[0] - dir[1]; - s1[1] = dir[0] + dir[1]; - s2[0] = dir[0] + dir[1]; - s2[1] = -dir[0] + dir[1]; - - glBegin(GL_LINES); - - glVertex3fv(vector3_to_array(start)); - glVertex3fv(vector3_to_array(end)); - - len*=0.0625; // half / 8 - - Vector3 arrow(start); - for (unsigned int i = 0, count = (len<32)? 1 : static_cast(len*0.0625); i < count; i++) - { - vector3_add(arrow, vector3_scaled(dir, (len<32)?len:32)); - glVertex3fv(vector3_to_array(arrow)); - glVertex3f(arrow[0]+s1[0], arrow[1]+s1[1], arrow[2]+dir[2]); - glVertex3fv(vector3_to_array(arrow)); - glVertex3f(arrow[0]+s2[0], arrow[1]+s2[1], arrow[2]+dir[2]); - } - - glEnd(); - } -}; - -class TargetedEntity -{ - Targetable& m_targetable; - targetables_t* m_targets; - - void construct() - { - if(m_targets != 0) - m_targets->insert(&m_targetable); - } - void destroy() - { - if(m_targets != 0) - m_targets->erase(&m_targetable); - } -public: - TargetedEntity(Targetable& targetable) - : m_targetable(targetable), m_targets(getTargetables("")) - { - construct(); - } - ~TargetedEntity() - { - destroy(); - } - void targetnameChanged(const char* name) - { - destroy(); - m_targets = getTargetables(name); - construct(); - } - typedef MemberCaller1 TargetnameChangedCaller; -}; - - -class TargetingEntity -{ - targetables_t* m_targets; -public: - TargetingEntity() : - m_targets(getTargetables("")) - { - } - void targetChanged(const char* target) - { - m_targets = getTargetables(target); - } - typedef MemberCaller1 TargetChangedCaller; - - typedef targetables_t::iterator iterator; - - iterator begin() const - { - if(m_targets == 0) - { - return iterator(); - } - return m_targets->begin(); - } - iterator end() const - { - if(m_targets == 0) - { - return iterator(); - } - return m_targets->end(); - } - size_t size() const - { - if(m_targets == 0) - { - return 0; - } - return m_targets->size(); - } - bool empty() const - { - return m_targets == 0 || m_targets->empty(); - } -}; - - - -template -void TargetingEntity_forEach(const TargetingEntity& targets, const Functor& functor) -{ - for(TargetingEntity::iterator i = targets.begin(); i != targets.end(); ++i) - { - functor((*i)->world_position()); - } -} - -typedef std::map TargetingEntities; - -template -void TargetingEntities_forEach(const TargetingEntities& targetingEntities, const Functor& functor) -{ - for(TargetingEntities::const_iterator i = targetingEntities.begin(); i != targetingEntities.end(); ++i) - { - TargetingEntity_forEach((*i).second, functor); - } -} - -class TargetLinesPushBack -{ - RenderablePointVector& m_targetLines; - const Vector3& m_worldPosition; - const VolumeTest& m_volume; -public: - TargetLinesPushBack(RenderablePointVector& targetLines, const Vector3& worldPosition, const VolumeTest& volume) : - m_targetLines(targetLines), m_worldPosition(worldPosition), m_volume(volume) - { - } - void operator()(const Vector3& worldPosition) const - { - if(m_volume.TestLine(segment_for_startend(m_worldPosition, worldPosition))) - { - m_targetLines.push_back(PointVertex(reinterpret_cast(m_worldPosition))); - m_targetLines.push_back(PointVertex(reinterpret_cast(worldPosition))); - } - } -}; - -class TargetKeys : public Entity::Observer -{ - TargetingEntities m_targetingEntities; - Callback m_targetsChanged; - - bool readTargetKey(const char* key, std::size_t& index) - { - if(string_equal_n(key, "target", 6)) - { - index = 0; - if(string_empty(key + 6) || string_parse_size(key + 6, index)) - { - return true; - } - } - return false; - } -public: - void setTargetsChanged(const Callback& targetsChanged) - { - m_targetsChanged = targetsChanged; - } - void targetsChanged() - { - m_targetsChanged(); - } - - void insert(const char* key, EntityKeyValue& value) - { - std::size_t index; - if(readTargetKey(key, index)) - { - TargetingEntities::iterator i = m_targetingEntities.insert(TargetingEntities::value_type(index, TargetingEntity())).first; - value.attach(TargetingEntity::TargetChangedCaller((*i).second)); - targetsChanged(); - } - } - void erase(const char* key, EntityKeyValue& value) - { - std::size_t index; - if(readTargetKey(key, index)) - { - TargetingEntities::iterator i = m_targetingEntities.find(index); - value.detach(TargetingEntity::TargetChangedCaller((*i).second)); - m_targetingEntities.erase(i); - targetsChanged(); - } - } - const TargetingEntities& get() const - { - return m_targetingEntities; - } -}; - - - -class RenderableTargetingEntity -{ - TargetingEntity& m_targets; - mutable RenderablePointVector m_target_lines; -public: - static Shader* m_state; - - RenderableTargetingEntity(TargetingEntity& targets) - : m_targets(targets), m_target_lines(GL_LINES) - { - } - void compile(const VolumeTest& volume, const Vector3& world_position) const - { - m_target_lines.clear(); - m_target_lines.reserve(m_targets.size() * 2); - TargetingEntity_forEach(m_targets, TargetLinesPushBack(m_target_lines, world_position, volume)); - } - void render(Renderer& renderer, const VolumeTest& volume, const Vector3& world_position) const - { - if(!m_targets.empty()) - { - compile(volume, world_position); - if(!m_target_lines.empty()) - { - renderer.addRenderable(m_target_lines, g_matrix4_identity); - } - } - } -}; - -class RenderableTargetingEntities -{ - const TargetingEntities& m_targets; - mutable RenderablePointVector m_target_lines; -public: - static Shader* m_state; - - RenderableTargetingEntities(const TargetingEntities& targets) - : m_targets(targets), m_target_lines(GL_LINES) - { - } - void compile(const VolumeTest& volume, const Vector3& world_position) const - { - m_target_lines.clear(); - TargetingEntities_forEach(m_targets, TargetLinesPushBack(m_target_lines, world_position, volume)); - } - void render(Renderer& renderer, const VolumeTest& volume, const Vector3& world_position) const - { - if(!m_targets.empty()) - { - compile(volume, world_position); - if(!m_target_lines.empty()) - { - renderer.addRenderable(m_target_lines, g_matrix4_identity); - } - } - } -}; - - -class TargetableInstance : -public SelectableInstance, -public Targetable, -public Entity::Observer -{ - mutable Vertex3f m_position; - EntityKeyValues& m_entity; - TargetKeys m_targeting; - TargetedEntity m_targeted; - RenderableTargetingEntities m_renderable; -public: - - TargetableInstance( - const scene::Path& path, - scene::Instance* parent, - void* instance, - InstanceTypeCastTable& casts, - EntityKeyValues& entity, - Targetable& targetable - ) : - SelectableInstance(path, parent, instance, casts), - m_entity(entity), - m_targeted(targetable), - m_renderable(m_targeting.get()) - { - m_entity.attach(*this); - m_entity.attach(m_targeting); - } - ~TargetableInstance() - { - m_entity.detach(m_targeting); - m_entity.detach(*this); - } - - void setTargetsChanged(const Callback& targetsChanged) - { - m_targeting.setTargetsChanged(targetsChanged); - } - void targetsChanged() - { - m_targeting.targetsChanged(); - } - - void insert(const char* key, EntityKeyValue& value) - { - if(string_equal(key, g_targetable_nameKey)) - { - value.attach(TargetedEntity::TargetnameChangedCaller(m_targeted)); - } - } - void erase(const char* key, EntityKeyValue& value) - { - if(string_equal(key, g_targetable_nameKey)) - { - value.detach(TargetedEntity::TargetnameChangedCaller(m_targeted)); - } - } - - const Vector3& world_position() const - { -#if 1 - const AABB& bounds = Instance::worldAABB(); - if(aabb_valid(bounds)) - { - return bounds.origin; - } -#else - const AABB& childBounds = Instance::childBounds(); - if(aabb_valid(childBounds)) - { - return childBounds.origin; - } -#endif - return vector4_to_vector3(localToWorld().t()); - } - - void render(Renderer& renderer, const VolumeTest& volume) const - { - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly); - renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eFullMaterials); - m_renderable.render(renderer, volume, world_position()); - } - - const TargetingEntities& getTargeting() const - { - return m_targeting.get(); - } -}; - - -class RenderableConnectionLines : public Renderable -{ - typedef std::set TargetableInstances; - TargetableInstances m_instances; -public: - void attach(TargetableInstance& instance) - { - ASSERT_MESSAGE(m_instances.find(&instance) == m_instances.end(), "cannot attach instance"); - m_instances.insert(&instance); - } - void detach(TargetableInstance& instance) - { - ASSERT_MESSAGE(m_instances.find(&instance) != m_instances.end(), "cannot detach instance"); - m_instances.erase(&instance); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - for(TargetableInstances::const_iterator i = m_instances.begin(); i != m_instances.end(); ++i) - { - if((*i)->path().top().get().visible()) - { - (*i)->render(renderer, volume); - } - } - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } -}; - -typedef Static StaticRenderableConnectionLines; - -#endif diff --git a/plugins/image/bmp.cpp b/plugins/image/bmp.cpp index 9c8ca3d9..223f4e07 100644 --- a/plugins/image/bmp.cpp +++ b/plugins/image/bmp.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,189 +19,384 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include +#include #include "bmp.h" -#include "ifilesystem.h" +#include "image.h" -typedef unsigned char byte; - -#include "imagelib.h" -#include "bytestreamutils.h" - - -typedef unsigned char PaletteEntry[4]; -typedef struct +static void BMPLineNone(FILE *f, char *sline, int pixbytes, int width) { - char id[2]; - unsigned long fileSize; - unsigned long reserved0; - unsigned long bitmapDataOffset; - unsigned long bitmapHeaderSize; - unsigned long width; - unsigned long height; - unsigned short planes; - unsigned short bitsPerPixel; - unsigned long compression; - unsigned long bitmapDataSize; - unsigned long hRes; - unsigned long vRes; - unsigned long colors; - unsigned long importantColors; - PaletteEntry palette[256]; -} BMPHeader_t; + int nbytes, i, k, j; -class ReadPixel8 + switch (pixbytes) + { + case 1 : + nbytes = (width + 3) / 4; + nbytes *= 4; + + fread(sline, width, 1, f); + nbytes -= width; + + while (nbytes-- > 0) fgetc(f); + return; + + case 3 : + nbytes = ((width * 3) + 3) / 4; + nbytes *= 4; + + fread(sline, width, 3, f); + nbytes -= width * 3; + + while (nbytes-- > 0) fgetc(f); + + // reorder bgr to rgb + for (i = 0, j = 0; i < width; i++, j += 3) + { + k = sline[j]; + sline[j] = sline[j+2]; + sline[j+2] = k; + } + + return; + } + + Error("BMPLineNone failed."); +} + + +static void BMPLineRLE8(FILE *f, char *sline, int pixbytes, int width) { - PaletteEntry* m_palette; -public: - ReadPixel8(PaletteEntry* palette) : m_palette(palette) - { - } - void operator()(PointerInputStream& inputStream, byte*& pixbuf) const - { - byte palIndex; - inputStream.read(&palIndex, 1); - *pixbuf++ = m_palette[palIndex][2]; - *pixbuf++ = m_palette[palIndex][1]; - *pixbuf++ = m_palette[palIndex][0]; - *pixbuf++ = 0xff; - } -}; + Error("RLE8 not yet supported."); +} -class ReadPixel16 + +static void BMPLineRLE4(FILE *f, char *sline, int pixbytes, int width) { -public: - void operator()(PointerInputStream& inputStream, byte*& pixbuf) const - { - unsigned short shortPixel; - inputStream.read(reinterpret_cast(&shortPixel), sizeof(unsigned short)); //!\todo Is this endian safe? - *pixbuf++ = static_cast(shortPixel & (31 << 10)) >> 7; - *pixbuf++ = static_cast(shortPixel & (31 << 5)) >> 2; - *pixbuf++ = static_cast(shortPixel & (31)) << 3; - *pixbuf++ = 0xff; - } -}; + Error("RLE4 not yet supported."); +} -class ReadPixel24 + +static void BMPLine(FILE *f, char *scanline, int pixbytes, int width, int rle) { -public: - void operator()(PointerInputStream& inputStream, byte*& pixbuf) const - { - byte bgr[3]; - inputStream.read(bgr, 3); - *pixbuf++ = bgr[2]; - *pixbuf++ = bgr[1]; - *pixbuf++ = bgr[0]; - *pixbuf++ = 255; - } -}; - -class ReadPixel32 -{ -public: - void operator()(PointerInputStream& inputStream, byte*& pixbuf) const - { - byte bgra[4]; - inputStream.read(bgra, 4); - *pixbuf++ = bgra[2]; - *pixbuf++ = bgra[1]; - *pixbuf++ = bgra[0]; - *pixbuf++ = bgra[3]; - } -}; - -template -void ReadBMP(PointerInputStream& inputStream, byte* bmpRGBA, int rows, int columns, ReadPixel readPixel) -{ - for (int row = rows - 1; row >= 0; row--) - { - byte* pixbuf = bmpRGBA + row * columns * 4; - - for (int column = 0; column < columns; column++) + switch (rle) { - readPixel(inputStream, pixbuf); + case xBI_NONE : BMPLineNone(f, scanline, pixbytes, width); return; + case xBI_RLE8 : BMPLineRLE8(f, scanline, pixbytes, width); return; + case xBI_RLE4 : BMPLineRLE4(f, scanline, pixbytes, width); return; } - } + + Error("Unknown compression type."); } -Image* LoadBMPBuff(PointerInputStream& inputStream, std::size_t length) + +/* +static void PrintHeader(binfo_t *b) { - BMPHeader_t bmpHeader; - inputStream.read(reinterpret_cast(bmpHeader.id), 2); - bmpHeader.fileSize = istream_read_uint32_le(inputStream); - bmpHeader.reserved0 = istream_read_uint32_le(inputStream); - bmpHeader.bitmapDataOffset = istream_read_uint32_le(inputStream); - bmpHeader.bitmapHeaderSize = istream_read_uint32_le(inputStream); - bmpHeader.width = istream_read_uint32_le(inputStream); - bmpHeader.height = istream_read_uint32_le(inputStream); - bmpHeader.planes = istream_read_uint16_le(inputStream); - bmpHeader.bitsPerPixel = istream_read_uint16_le(inputStream); - bmpHeader.compression = istream_read_uint32_le(inputStream); - bmpHeader.bitmapDataSize = istream_read_uint32_le(inputStream); - bmpHeader.hRes = istream_read_uint32_le(inputStream); - bmpHeader.vRes = istream_read_uint32_le(inputStream); - bmpHeader.colors = istream_read_uint32_le(inputStream); - bmpHeader.importantColors = istream_read_uint32_le(inputStream); - - if (bmpHeader.bitsPerPixel == 8) - { - int paletteSize = bmpHeader.colors * 4; - inputStream.read(reinterpret_cast(bmpHeader.palette), paletteSize); - } - - if (bmpHeader.id[0] != 'B' && bmpHeader.id[1] != 'M') - { - globalErrorStream() << "LoadBMP: only Windows-style BMP files supported\n"; - return 0; - } - if (bmpHeader.fileSize != length) - { - globalErrorStream() << "LoadBMP: header size does not match file size (" << Unsigned(bmpHeader.fileSize) << " vs. " << Unsigned(length) << ")\n"; - return 0; - } - if (bmpHeader.compression != 0) - { - globalErrorStream() << "LoadBMP: only uncompressed BMP files supported\n"; - return 0; - } - if (bmpHeader.bitsPerPixel < 8) - { - globalErrorStream() << "LoadBMP: monochrome and 4-bit BMP files not supported\n"; - return 0; - } - - int columns = bmpHeader.width; - int rows = bmpHeader.height; - if (rows < 0) - rows = -rows; - - RGBAImage* image = new RGBAImage(columns, rows); - - switch(bmpHeader.bitsPerPixel) - { - case 8: - ReadBMP(inputStream, image->getRGBAPixels(), rows, columns, ReadPixel8(bmpHeader.palette)); - break; - case 16: - ReadBMP(inputStream, image->getRGBAPixels(), rows, columns, ReadPixel16()); - break; - case 24: - ReadBMP(inputStream, image->getRGBAPixels(), rows, columns, ReadPixel24()); - break; - case 32: - ReadBMP(inputStream, image->getRGBAPixels(), rows, columns, ReadPixel32()); - break; - default: - globalErrorStream() << "LoadBMP: illegal pixel_size '" << bmpHeader.bitsPerPixel << "'\n"; - image->release(); - return 0; - } - return image; + printf("biSize : %ld\n", b->biSize); + printf("biWidth : %ld\n", b->biWidth); + printf("biHeight : %ld\n", b->biHeight); + printf("biPlanes : %d\n", b->biPlanes); + printf("biBitCount : %d\n", b->biBitCount); + printf("biCompression : %ld\n", b->biCompression); + printf("biSizeImage : %ld\n", b->biSizeImage); + printf("biXPelsPerMeter: %ld\n", b->biXPelsPerMeter); + printf("biYPelsPerMeter: %ld\n", b->biYPelsPerMeter); + printf("biClrUsed : %ld\n", b->biClrUsed); + printf("biClrImportant : %ld\n", b->biClrImportant); } +*/ -Image* LoadBMP(ArchiveFile& file) +// FIXME: calls to Error(const char *, ... ) are dependant on qe3.cpp +void LoadBMP(char *filename, bitmap_t *bit) { - ScopedArchiveBuffer buffer(file); - PointerInputStream inputStream(buffer.buffer); - return LoadBMPBuff(inputStream, buffer.length); + FILE *f; + bmphd_t bhd; + binfo_t info; + // int pxlsize = 1; + int rowbytes, i, pixbytes; + char *scanline; + + // open file + if ((f = fopen(filename, "rb")) == NULL) + { + Error("Unable to open file");// %s.", filename); + } + + // read in bitmap header + if (fread(&bhd, sizeof(bhd), 1, f) != 1) + { + fclose(f); + Error("Unable to read in bitmap header."); + } + + // make sure we have a valid bitmap file + if (bhd.bfType != BMP_SIGNATURE_WORD) + { + fclose(f); + Error("Invalid BMP file");//: %s", filename); + } + + // load in info header + if (fread(&info, sizeof(info), 1, f) != 1) + { + fclose(f); + Error("Unable to read bitmap info header."); + } + + // make sure this is an info type of bitmap + if (info.biSize != sizeof(binfo_t)) + { + fclose(f); + Error("We only support the info bitmap type."); + } + + // PrintHeader(&info); + + bit->bpp = info.biBitCount; + bit->width = info.biWidth; + bit->height = info.biHeight; + bit->data = NULL; + bit->palette = NULL; + + //currently we only read in 8 and 24 bit bmp files + if (info.biBitCount == 8) pixbytes = 1; + else if (info.biBitCount == 24) pixbytes = 3; + else + { + Error("Only 8BPP and 24BPP supported"); + //Error("BPP %d not supported.", info.biBitCount); + } + + // if this is an eight bit image load palette + if (pixbytes == 1) + { + drgb_t q; + + bit->palette = reinterpret_cast(g_malloc(sizeof(rgb_t) * 256)); + + for (i = 0; i < 256; i++) + { + if (fread(&q, sizeof(drgb_t), 1, f) != 1) + { + fclose(f); g_free(bit->palette); + Error("Unable to read palette."); + } + + bit->palette[i].r = q.red; + bit->palette[i].g = q.green; + bit->palette[i].b = q.blue; + } + } + + // position to start of bitmap + fseek(f, bhd.bfOffBits, SEEK_SET); + + // create scanline to read data into + rowbytes = ((info.biWidth * pixbytes) + 3) / 4; + rowbytes *= 4; + + scanline = reinterpret_cast(g_malloc(rowbytes)); + + // alloc space for new bitmap + bit->data = reinterpret_cast(g_malloc(info.biWidth * pixbytes * info.biHeight)); + + // read in image + for (i = 0; i < info.biHeight; i++) + { + BMPLine(f, scanline, pixbytes, info.biWidth, info.biCompression); + + // store line + memcpy(&bit->data[info.biWidth * pixbytes * (info.biHeight - i - 1)], scanline, info.biWidth * pixbytes); + } + + g_free(scanline); + fclose(f); } + + + +static void BMPEncodeLine(FILE *f, unsigned char *data, int npxls, int pixbytes) +{ + int nbytes, i, j, k; + + switch (pixbytes) + { + case 1 : + nbytes = (npxls + 3) / 4; + nbytes *= 4; + + fwrite(data, npxls, 1, f); + nbytes -= npxls; + + while (nbytes-- > 0) fputc(0, f); + return; + + case 3 : + // reorder rgb to bgr + for (i = 0, j = 0; i < npxls; i++, j+= 3) + { + k = data[j]; + data[j] = data[j + 2]; + data[j + 2] = k; + } + + nbytes = ((npxls * 3) + 3) / 4; + nbytes *= 4; + + fwrite(data, npxls, 3, f); + nbytes -= npxls * 3; + + while (nbytes-- > 0) fputc(0, f); + return; + } + + Error("BMPEncodeLine Failed."); +} + + + +void WriteBMP(char *filename, bitmap_t *bit) +{ + FILE *f; + bmphd_t header; + binfo_t info; + drgb_t q; // palette that gets written + long bmofs; + int w, h, i; + int pixbytes; + + if (bit->bpp == 8) pixbytes = 1; + else if (bit->bpp == 24) pixbytes = 3; + + else + { + Error("Only 8BPP and 24BPP supported"); + //Error("BPP %d not supported.", bit->bpp); + } + + + if ((f = fopen(filename, "wb")) == NULL) + { + Error("Unable to open file");//%s.", filename); + } + + // write out an empty header as a place holder + if (fwrite(&header, sizeof(header), 1, f) != 1) + { + Error("Unable to fwrite."); + } + + // init and write info header + info.biSize = sizeof(binfo_t); + info.biWidth = bit->width; + info.biHeight = bit->height; + info.biPlanes = 1; + info.biBitCount = bit->bpp; + info.biCompression = xBI_NONE; + info.biSizeImage = bit->width * bit->height; + info.biXPelsPerMeter = 0; + info.biYPelsPerMeter = 0; + info.biClrUsed = 256; + info.biClrImportant = 256; + + if (fwrite(&info, sizeof(binfo_t), 1, f) != 1) + { + Error("fwrite failed."); + } + + // write out palette if we need to + if (bit->bpp == 8) + { + for (i = 0; i < 256; i++) + { + q.red = bit->palette[i].r; + q.green = bit->palette[i].g; + q.blue = bit->palette[i].b; + + fwrite(&q, sizeof(q), 1, f); + } + } + + // save offset to start of bitmap + bmofs = ftell(f); + + // output bitmap + w = bit->width; + h = bit->height; + + for (i = h - 1; i >= 0; i--) + { + BMPEncodeLine(f, &bit->data[w * pixbytes * i], w, pixbytes); + } + + // update and rewrite file header + header.bfType = BMP_SIGNATURE_WORD; + header.bfSize = ftell(f); + header.bfOffBits = bmofs; + + fseek(f, 0L, SEEK_SET); + fwrite(&header, sizeof(header), 1, f); + + fclose(f); +} + + +void NewBMP(int width, int height, int bpp, bitmap_t *bit) +{ + int pixbytes; + + if (bpp == 8) pixbytes = 1; + else if (bpp == 24) pixbytes = 3; + + else + { + Error("NewBMP: 8 or 24 bit only."); + } + + bit->bpp = bpp; + bit->width = width; + bit->height = height; + + bit->data = reinterpret_cast(g_malloc(width * height * pixbytes)); + + if (bit->data == NULL) + { + Error("NewBMP: g_malloc failed."); + } + + // see if we need to create a palette + if (pixbytes == 1) + { + bit->palette = (rgb_t *) g_malloc(768); + + if (bit->palette == NULL) + { + Error("NewBMP: unable to g_malloc palette."); + } + } + else + { + bit->palette = NULL; + } +} + + + +void FreeBMP(bitmap_t *bitmap) +{ + if (bitmap->palette) + { + g_free(bitmap->palette); + bitmap->palette = NULL; + } + + if (bitmap->data) + { + g_free(bitmap->data); + bitmap->data = NULL; + } +} + + diff --git a/plugins/image/bmp.h b/plugins/image/bmp.h index 9cd75be8..ea93165c 100644 --- a/plugins/image/bmp.h +++ b/plugins/image/bmp.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,13 +19,82 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_BMP_H) -#define INCLUDED_BMP_H +#ifndef _BMP_H +#define _BMP_H -class Image; -class ArchiveFile; +#define xBI_NONE 0 +#define xBI_RGB 0 +#define xBI_RLE4 2 +#define xBI_RLE8 1 -Image* LoadBMP(ArchiveFile& file); +#define BMP_SIGNATURE_WORD 0x4d42 + +#pragma pack(push) +#pragma pack(1) + +typedef struct { + unsigned short bfType; // signature - 'BM' + unsigned long bfSize; // file size in bytes + unsigned short bfReserved1; // 0 + unsigned short bfReserved2; // 0 + unsigned long bfOffBits; // offset to bitmap +} bmphd_t; + + + +typedef struct { + unsigned long biSize; // size of this struct + long biWidth; // bmap width in pixels + long biHeight; // bmap height in pixels + unsigned short biPlanes; // num planes - always 1 + unsigned short biBitCount; // bits perpixel + unsigned long biCompression; // compression flag + unsigned long biSizeImage; // image size in bytes + long biXPelsPerMeter; // horz resolution + long biYPelsPerMeter; // vert resolution + unsigned long biClrUsed; // 0 -> color table size + unsigned long biClrImportant; // important color count +} binfo_t; + + +typedef struct { + unsigned char blue; + unsigned char green; + unsigned char red; + unsigned char reserved; +} drgb_t; + + +// quake expects its palette to be bgr +// this is totally backwards but what can you do +typedef struct { + unsigned char r; + unsigned char g; + unsigned char b; +} rgb_t; + + +typedef struct { + unsigned char b; + unsigned char g; + unsigned char r; +} bgr_t; + + +typedef struct { + int bpp; // bits per pixel + int width; + int height; + unsigned char *data; + rgb_t *palette; +} bitmap_t; + + +void LoadBMP(char *filename, bitmap_t *bit); +void FreeBMP(bitmap_t *bitmap); +void WriteBMP(char *filename, bitmap_t *bit); +void NewBMP(int width, int height, int bpp, bitmap_t *bit); + +#pragma pack(pop) #endif - diff --git a/plugins/image/dds.cpp b/plugins/image/dds.cpp deleted file mode 100644 index d8416d17..00000000 --- a/plugins/image/dds.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "dds.h" - -#include - -#include "ifilesystem.h" -#include "iarchive.h" -#include "idatastream.h" - -#include "ddslib.h" -#include "imagelib.h" - -Image* LoadDDSBuff(const byte* buffer) -{ - int width, height; - ddsPF_t pixelFormat; - if(DDSGetInfo(reinterpret_cast(const_cast(buffer)), &width, &height, &pixelFormat) == -1) - { - return 0; - } - - RGBAImage* image = new RGBAImage(width, height); - - if(DDSDecompress(reinterpret_cast(const_cast(buffer)), image->getRGBAPixels()) == -1) - { - image->release(); - return 0; - } - return image; -} - -Image* LoadDDS(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadDDSBuff(buffer.buffer); -} diff --git a/plugins/image/dds.h b/plugins/image/dds.h deleted file mode 100644 index 4b4d577f..00000000 --- a/plugins/image/dds.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_DDS_H) -#define INCLUDED_DDS_H - -class Image; -class ArchiveFile; - -Image* LoadDDS(ArchiveFile& file); - -#endif diff --git a/plugins/image/image.cpp b/plugins/image/image.cpp index 4436dde4..34dd6709 100644 --- a/plugins/image/image.cpp +++ b/plugins/image/image.cpp @@ -1,159 +1,133 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// +// Image loading plugin +// +// Leonardo Zide (leo@lokigames.com) +// + +#include #include "image.h" +#include "lbmlib.h" -#include "ifilesystem.h" -#include "iimage.h" +// ============================================================================= +// global tables -#include "jpeg.h" -#include "tga.h" -#include "bmp.h" -#include "pcx.h" -#include "dds.h" +_QERFuncTable_1 g_FuncTable; // Radiant function table +_QERFileSystemTable g_FileSystemTable; +// ============================================================================= +// SYNAPSE -#include "modulesystem/singletonmodule.h" +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientImage g_SynapseClient; -class ImageDependencies : public GlobalFileSystemModuleRef -{ -}; +static const XMLConfigEntry_t entries[] = + { + { VFS_MAJOR, SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; -class ImageTGAAPI -{ - _QERPlugImageTable m_imagetga; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "tga"); - - ImageTGAAPI() +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { - m_imagetga.loadImage = LoadTGA; + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - _QERPlugImageTable* getTable() - { - return &m_imagetga; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(IMAGE_MAJOR, "jpg", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(IMAGE_MAJOR, "tga", sizeof(_QERPlugImageTable)); + // NOTE: these two are for md2 support + // instead of requesting them systematically, we could request them per-config before enabling Q2 support + g_SynapseClient.AddAPI(IMAGE_MAJOR, "pcx", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(IMAGE_MAJOR, "bmp", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; } -}; - -typedef SingletonModule ImageTGAModule; - -ImageTGAModule g_ImageTGAModule; - - -class ImageJPGAPI -{ - _QERPlugImageTable m_imagejpg; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "jpg"); - - ImageJPGAPI() - { - m_imagejpg.loadImage = LoadJPG; - } - _QERPlugImageTable* getTable() - { - return &m_imagejpg; - } -}; - -typedef SingletonModule ImageJPGModule; - -ImageJPGModule g_ImageJPGModule; - - -class ImageBMPAPI -{ - _QERPlugImageTable m_imagebmp; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "bmp"); - - ImageBMPAPI() - { - m_imagebmp.loadImage = LoadBMP; - } - _QERPlugImageTable* getTable() - { - return &m_imagebmp; - } -}; - -typedef SingletonModule ImageBMPModule; - -ImageBMPModule g_ImageBMPModule; - - -class ImagePCXAPI -{ - _QERPlugImageTable m_imagepcx; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "pcx"); - - ImagePCXAPI() - { - m_imagepcx.loadImage = LoadPCX32; - } - _QERPlugImageTable* getTable() - { - return &m_imagepcx; - } -}; - -typedef SingletonModule ImagePCXModule; - -ImagePCXModule g_ImagePCXModule; - - -class ImageDDSAPI -{ - _QERPlugImageTable m_imagedds; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "dds"); - - ImageDDSAPI() - { - m_imagedds.loadImage = LoadDDS; - } - _QERPlugImageTable* getTable() - { - return &m_imagedds; - } -}; - -typedef SingletonModule ImageDDSModule; - -ImageDDSModule g_ImageDDSModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ImageTGAModule.selfRegister(); - g_ImageJPGModule.selfRegister(); - g_ImageBMPModule.selfRegister(); - g_ImagePCXModule.selfRegister(); - g_ImageDDSModule.selfRegister(); + + return &g_SynapseClient; +} + +bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, "image")) + { + _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "jpg")) + { + pTable->m_pfnLoadImage = &LoadJPG; + return true; + } + if (!strcmp(pAPI->minor_name, "tga")) + { + pTable->m_pfnLoadImage = &LoadImage; + return true; + } + if (!strcmp(pAPI->minor_name, "pcx")) + { + pTable->m_pfnLoadImage = &LoadImage; + return true; + } + if (!strcmp(pAPI->minor_name, "bmp")) + { + pTable->m_pfnLoadImage = &LoadImage; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +bool CSynapseClientImage::OnActivate() { + if (!g_FileSystemTable.m_nSize) { + Syn_Printf("ERROR: VFS_MAJOR table was not initialized before OnActivate in '%s' - incomplete synapse.config?\n", GetInfo()); + return false; + } + return true; +} + +#include "version.h" + +const char* CSynapseClientImage::GetInfo() +{ + return "image formats JPG TGA PCX BMP module built " __DATE__ " " RADIANT_VERSION; } diff --git a/plugins/image/image.def b/plugins/image/image.def new file mode 100644 index 00000000..77635858 --- /dev/null +++ b/plugins/image/image.def @@ -0,0 +1,8 @@ +; image.def : Declares the module parameters for the DLL. + +LIBRARY "Image" +DESCRIPTION 'Image Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/image/image.h b/plugins/image/image.h index d694c669..f209fd59 100644 --- a/plugins/image/image.h +++ b/plugins/image/image.h @@ -1,25 +1,68 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_IMAGE_H) -#define INCLUDED_IMAGE_H +#ifndef _IMAGE_H_ +#define _IMAGE_H_ -#endif +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" +#include "iimage.h" + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +extern _QERFuncTable_1 g_FuncTable; +extern _QERFileSystemTable g_FileSystemTable; +void LoadJPG (const char *filename, unsigned char **pic, int *width, int *height); + +#define Error g_FuncTable.m_pfnError +#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile +#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile + +class CSynapseClientImage : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + bool OnActivate(); + const char* GetName() { return "image"; } + + CSynapseClientImage() { } + virtual ~CSynapseClientImage() { } +}; + +#endif // _IMAGE_H_ diff --git a/plugins/image/image.vcproj b/plugins/image/image.vcproj new file mode 100644 index 00000000..6db24b29 --- /dev/null +++ b/plugins/image/image.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/image/imageq3.def b/plugins/image/imageq3.def deleted file mode 100644 index e8c608f6..00000000 --- a/plugins/image/imageq3.def +++ /dev/null @@ -1,7 +0,0 @@ -; imageq3.def : Declares the module parameters for the DLL. - -LIBRARY "ImageQ3" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/image/imageq3.vcproj b/plugins/image/imageq3.vcproj deleted file mode 100644 index c7e6eaf9..00000000 --- a/plugins/image/imageq3.vcproj +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/image/jpeg.cpp b/plugins/image/jpeg.cpp index 29c9bdf9..66df32ff 100644 --- a/plugins/image/jpeg.cpp +++ b/plugins/image/jpeg.cpp @@ -34,23 +34,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "jpeg.h" - +#include #include #include -#include #include +#include extern "C" { -#include "radiant_jpeglib.h" -#include "jpeg6/jerror.h" +#include +#include } -#include "ifilesystem.h" - -#include "imagelib.h" - -typedef unsigned char byte; +#include "image.h" /* Expanded data source object for stdio input */ @@ -318,13 +313,8 @@ static void j_putRGBAScanline (unsigned char* jpegline, int widthPix, unsigned c *oRed = iRed; *oGrn = iGrn; *oBlu = iBlu; - - //!\todo fix jpeglib, it leaves alpha channel uninitialised -#if 1 - *oAlp = 255; -#else - *oAlp = iAlp; -#endif + // ydnar: see bug 900 + *oAlp = 255; //% iAlp; } } @@ -354,53 +344,65 @@ static void j_putGrayScanlineToRGB (unsigned char* jpegline, int widthPix, unsig } } -static Image* LoadJPGBuff_(const void *src_buffer, int src_size) -{ +static int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ) { struct jpeg_decompress_struct cinfo; struct my_jpeg_error_mgr jerr; + JSAMPARRAY buffer; + int row_stride, size; cinfo.err = jpeg_std_error (&jerr.pub); jerr.pub.error_exit = my_jpeg_error_exit; - if (setjmp (jerr.setjmp_buffer)) //< TODO: use c++ exceptions instead of setjmp/longjmp to handle errors + if (setjmp (jerr.setjmp_buffer)) { - globalErrorStream() << "WARNING: JPEG library error: " << errormsg << "\n"; + *pic = (unsigned char*)errormsg; jpeg_destroy_decompress (&cinfo); - return 0; + return -1; } jpeg_create_decompress (&cinfo); - jpeg_buffer_src (&cinfo, const_cast(src_buffer), src_size); + jpeg_buffer_src (&cinfo, src_buffer, src_size); jpeg_read_header (&cinfo, TRUE); jpeg_start_decompress (&cinfo); - int row_stride = cinfo.output_width * cinfo.output_components; + row_stride = cinfo.output_width * cinfo.output_components; - RGBAImage* image = new RGBAImage(cinfo.output_width, cinfo.output_height); + size = cinfo.output_width * cinfo.output_height * 4; + *width = cinfo.output_width; + *height = cinfo.output_height; + *pic = (unsigned char*) (g_malloc (size+1)); + memset (*pic, 0, size+1); - JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); while (cinfo.output_scanline < cinfo.output_height) { jpeg_read_scanlines (&cinfo, buffer, 1); if (cinfo.out_color_components == 4) - j_putRGBAScanline (buffer[0], cinfo.output_width, image->getRGBAPixels(), cinfo.output_scanline-1); + j_putRGBAScanline (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); else if (cinfo.out_color_components == 3) - j_putRGBScanline (buffer[0], cinfo.output_width, image->getRGBAPixels(), cinfo.output_scanline-1); + j_putRGBScanline (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); else if (cinfo.out_color_components == 1) - j_putGrayScanlineToRGB (buffer[0], cinfo.output_width, image->getRGBAPixels(), cinfo.output_scanline-1); + j_putGrayScanlineToRGB (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); } jpeg_finish_decompress (&cinfo); jpeg_destroy_decompress (&cinfo); - return image; + return 0; } -Image* LoadJPG(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadJPGBuff_(buffer.buffer, static_cast(buffer.length)); -} +void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) { + unsigned char *fbuffer = NULL; + int nLen = vfsLoadFile ((char *)filename, (void **)&fbuffer, 0 ); + if (nLen == -1) + return; + if ( LoadJPGBuff( fbuffer, nLen, pic, width, height ) != 0 ) { + g_FuncTable.m_pfnSysPrintf( "WARNING: JPEG library failed to load %s because %s\n", filename, *pic ); + *pic = NULL; + } + + vfsFreeFile( fbuffer ); +} diff --git a/plugins/image/lbmlib.cpp b/plugins/image/lbmlib.cpp new file mode 100644 index 00000000..c7a2e1ef --- /dev/null +++ b/plugins/image/lbmlib.cpp @@ -0,0 +1,762 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// lbmlib.c + +#include +#include +#include +#include "image.h" +#include "lbmlib.h" +#include "bmp.h" + +#define LittleLong(a) GINT32_FROM_LE(a) +#define LittleShort(a) GINT16_FROM_LE(a) + +#include + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf + +/* +============================================================================ + +LOAD PCX + +============================================================================ +*/ +typedef struct +{ + char manufacturer; + char version; + char encoding; + char bits_per_pixel; + unsigned short xmin, ymin, xmax, ymax; + unsigned short hres, vres; + unsigned char palette[48]; + char reserved; + char color_planes; + unsigned short bytes_per_line; + unsigned short palette_type; + char filler[58]; + unsigned char data; // unbounded +} pcx_t; + +/* +============================================================================ + +TARGA IMAGE + +============================================================================ +*/ +typedef struct _TargaHeader +{ + unsigned char id_length, colormap_type, image_type; + unsigned short colormap_index, colormap_length; + unsigned char colormap_size; + unsigned short x_origin, y_origin, width, height; + unsigned char pixel_size, attributes; +} TargaHeader; + +/* +========================================================= + +BMP LOADING + +========================================================= +*/ +typedef struct +{ + char id[2]; + unsigned long fileSize; + unsigned long reserved0; + unsigned long bitmapDataOffset; + unsigned long bitmapHeaderSize; + unsigned long width; + unsigned long height; + unsigned short planes; + unsigned short bitsPerPixel; + unsigned long compression; + unsigned long bitmapDataSize; + unsigned long hRes; + unsigned long vRes; + unsigned long colors; + unsigned long importantColors; + unsigned char palette[256][4]; +} BMPHeader_t; + +static void LoadBMP (const char *name, byte ** pic, int *width, int *height) +{ + int columns, rows, numPixels; + byte *pixbuf; + int row, column; + byte *buf_p; + byte *buffer; + unsigned int length; + BMPHeader_t bmpHeader; + byte *bmpRGBA; + + *pic = NULL; + + // + // load the file + // + length = vfsLoadFile( (char *)name, (void **)&buffer, 0 ); + if (length == (unsigned int) -1) + return; + + buf_p = buffer; + + bmpHeader.id[0] = *buf_p++; + bmpHeader.id[1] = *buf_p++; + bmpHeader.fileSize = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.reserved0 = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.bitmapDataOffset = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.bitmapHeaderSize = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.width = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.height = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.planes = LittleShort (*(short *) buf_p); + buf_p += 2; + bmpHeader.bitsPerPixel = LittleShort (*(short *) buf_p); + buf_p += 2; + bmpHeader.compression = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.bitmapDataSize = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.hRes = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.vRes = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.colors = LittleLong (*(long *) buf_p); + buf_p += 4; + bmpHeader.importantColors = LittleLong (*(long *) buf_p); + buf_p += 4; + + memcpy (bmpHeader.palette, buf_p, sizeof (bmpHeader.palette)); + + if (bmpHeader.bitsPerPixel == 8) + buf_p += 1024; + + if (bmpHeader.id[0] != 'B' && bmpHeader.id[1] != 'M') + { + Sys_Printf ("LoadBMP: only Windows-style BMP files supported (%s)\n", name); + return; + } + if (bmpHeader.fileSize != length) + { + Sys_Printf ("LoadBMP: header size does not match file size (%d vs. %d) (%s)\n", + bmpHeader.fileSize, length, name); + return; + } + if (bmpHeader.compression != 0) + { + Sys_Printf ("LoadBMP: only uncompressed BMP files supported (%s)\n", name); + return; + } + if (bmpHeader.bitsPerPixel < 8) + { + Sys_Printf ("LoadBMP: monochrome and 4-bit BMP files not supported (%s)\n", name); + return; + } + + columns = bmpHeader.width; + rows = bmpHeader.height; + if (rows < 0) + rows = -rows; + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + bmpRGBA = reinterpret_cast < unsigned char *>(g_malloc (numPixels * 4)); + *pic = bmpRGBA; + + + for (row = rows - 1; row >= 0; row--) + { + pixbuf = bmpRGBA + row * columns * 4; + + for (column = 0; column < columns; column++) + { + unsigned char red, green, blue, alpha; + int palIndex; + unsigned short shortPixel; + + switch (bmpHeader.bitsPerPixel) + { + case 8: + palIndex = *buf_p++; + *pixbuf++ = bmpHeader.palette[palIndex][2]; + *pixbuf++ = bmpHeader.palette[palIndex][1]; + *pixbuf++ = bmpHeader.palette[palIndex][0]; + *pixbuf++ = 0xff; + break; + case 16: + shortPixel = *(unsigned short *) pixbuf; + pixbuf += 2; + *pixbuf++ = (shortPixel & (31 << 10)) >> 7; + *pixbuf++ = (shortPixel & (31 << 5)) >> 2; + *pixbuf++ = (shortPixel & (31)) << 3; + *pixbuf++ = 0xff; + break; + case 24: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + case 32: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alpha = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = alpha; + break; + default: + Sys_Printf ("LoadBMP: illegal pixel_size '%d' in file '%s'\n", bmpHeader.bitsPerPixel, + name); + g_free (*pic); + *pic = NULL; + return; + break; + } + } + } + + vfsFreeFile (buffer); + +} + + +/* +================================================================= + +PCX LOADING + +================================================================= +*/ + + +/* +============== +LoadPCX +============== +*/ + +/* RR2DO2 */ +#define DECODEPCX( b, d, r ) d=*b++;if((d&0xC0)==0xC0){r=d&0x3F;d=*b++;}else{r=1;} + +static void LoadPCX( const char *filename, byte **pic, byte **palette, int *width, int *height ) +{ + byte *raw; + pcx_t *pcx; + int x, y, lsize; + int len; + int dataByte, runLength; + byte *out, *pix; + + + /* load the file */ + len = vfsLoadFile (filename, (void **)&raw, 0); + if( len == -1 ) + Error( "LoadPCX: Couldn't read %s", filename ); + + + /* parse the PCX file */ + pcx = (pcx_t *)raw; + raw = &pcx->data; + + pcx->xmin = LittleShort(pcx->xmin); + pcx->ymin = LittleShort(pcx->ymin); + pcx->xmax = LittleShort(pcx->xmax); + pcx->ymax = LittleShort(pcx->ymax); + pcx->hres = LittleShort(pcx->hres); + pcx->vres = LittleShort(pcx->vres); + pcx->bytes_per_line = LittleShort(pcx->bytes_per_line); + pcx->palette_type = LittleShort(pcx->palette_type); + + if (pcx->manufacturer != 0x0a + || pcx->version != 5 + || pcx->encoding != 1 + || pcx->bits_per_pixel != 8 + || pcx->xmax >= 640 + || pcx->ymax >= 480) + Error ("Bad pcx file %s", filename); + + if (palette) + { + *palette = (byte *)malloc(768); + memcpy (*palette, (byte *)pcx + len - 768, 768); + } + + if (width) + *width = pcx->xmax+1; + if (height) + *height = pcx->ymax+1; + + if (!pic) + return; + + out = (byte *)malloc ( (pcx->ymax+1) * (pcx->xmax+1) ); + if (!out) + Error( "LoadPCX: couldn't allocate"); + + *pic = out; + pix = out; + + /* RR2DO2: pcx fix */ + lsize = pcx->color_planes * pcx->bytes_per_line; + + /* go scanline by scanline */ + for( y = 0; y <= pcx->ymax; y++, pix += pcx->xmax + 1 ) + { + /* do a scanline */ + for( x=0; x <= pcx->xmax; ) + { + /* RR2DO2 */ + DECODEPCX( raw, dataByte, runLength ); + while( runLength-- > 0 ) + pix[ x++ ] = dataByte; + } + + /* RR2DO2: discard any other data */ + while( x < lsize ) + { + DECODEPCX( raw, dataByte, runLength ); + x++; + } + while( runLength-- > 0 ) + x++; + } + + /* validity check */ + if( raw - (byte *) pcx > len) + Error( "PCX file %s was malformed", filename ); + free( pcx ); +} + +/* +============== +LoadPCX32 +============== +*/ +static void LoadPCX32 (const char *filename, byte ** pic, int *width, int *height) +{ + byte *palette; + byte *pic8; + int i, c, p; + byte *pic32; + + LoadPCX (filename, &pic8, &palette, width, height); + if (!pic8) + { + *pic = NULL; + return; + } + + c = (*width) * (*height); + pic32 = *pic = reinterpret_cast < unsigned char *>(g_malloc (4 * c)); + for (i = 0; i < c; i++) + { + p = pic8[i]; + pic32[0] = palette[p * 3]; + pic32[1] = palette[p * 3 + 1]; + pic32[2] = palette[p * 3 + 2]; + pic32[3] = 255; + pic32 += 4; + } + + g_free (pic8); + g_free (palette); +} + +/* +========================================================= + +TARGA LOADING + + TTimo: added code to get rid of alphachannel from prefs or ignore it if completely empty + was required since Radiant is using alpha channel when binding the textures for proper curry operation + can be fully turned off from the prefs though +========================================================= +*/ + +/* +============= +LoadTGA +============= +*/ +void LoadTGA (const char *name, byte ** pic, int *width, int *height) +{ + int columns, rows, numPixels; + byte *pixbuf; + int row, column; + byte *buf_p; + byte *buffer; + TargaHeader targa_header; + byte *targa_rgba; + + *pic = NULL; + + // + // load the file + // + int nLen = vfsLoadFile( (char *)name, (void **)&buffer, 0 ); + if (nLen == -1) + return; + + buf_p = buffer; + + targa_header.id_length = *buf_p++; + targa_header.colormap_type = *buf_p++; + targa_header.image_type = *buf_p++; + + targa_header.colormap_index = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.colormap_length = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.colormap_size = *buf_p++; + targa_header.x_origin = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.y_origin = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.width = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.height = LittleShort (*(short *) buf_p); + buf_p += 2; + targa_header.pixel_size = *buf_p++; + targa_header.attributes = *buf_p++; + + bool bAlphaOK = false; + + if (targa_header.image_type != 2 && targa_header.image_type != 10 && targa_header.image_type != 3) + { + Sys_Printf ("LoadTGA: TGA type %d not supported\n", targa_header.image_type); + Sys_Printf ("LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n"); + return; + } + + if (targa_header.colormap_type != 0) + { + Sys_Printf ("LoadTGA: colormaps not supported\n"); + return; + } + + if ((targa_header.pixel_size != 32 && targa_header.pixel_size != 24) + && targa_header.image_type != 3) + { + Sys_Printf ("LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); + return; + } + + columns = targa_header.width; + rows = targa_header.height; + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + targa_rgba = reinterpret_cast < unsigned char *>(g_malloc (numPixels * 4)); + *pic = targa_rgba; + + if (targa_header.id_length != 0) + buf_p += targa_header.id_length; // skip TARGA image comment + + if (targa_header.image_type == 2 || targa_header.image_type == 3) + { + // Uncompressed RGB or gray scale image + for (row = rows - 1; row >= 0; row--) + { + pixbuf = targa_rgba + row * columns * 4; + for (column = 0; column < columns; column++) + { + unsigned char red, green, blue, alphabyte; + switch (targa_header.pixel_size) + { + case 8: + blue = *buf_p++; + green = blue; + red = blue; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + + case 24: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + case 32: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alphabyte = *buf_p++; + // detect if the whole alpha channel is 0 + if (alphabyte != 0) + bAlphaOK = true; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = alphabyte; + break; + default: + Sys_Printf ("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, + name); + g_free (*pic); + *pic = NULL; + return; + break; + } + } + } + + if (!bAlphaOK) + { + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=444 + if (targa_header.pixel_size == 32) + Sys_FPrintf (SYS_WRN, "WARNING: %s has empty alpha channel\n", name); + // disable the alpha value + for (row = rows - 1; row >= 0; row--) + { + pixbuf = targa_rgba + row * columns * 4; + for (column = 0; column < columns; column++) + { + // 32 bit + pixbuf += 3; + *pixbuf++ = 255; + } + } + } + } + else if (targa_header.image_type == 10) + { // Runlength encoded RGB images + unsigned char red, green, blue, alphabyte, packetHeader, packetSize, j; + + red = 0; + green = 0; + blue = 0; + alphabyte = 0xff; + + for (row = rows - 1; row >= 0; row--) + { + pixbuf = targa_rgba + row * columns * 4; + for (column = 0; column < columns;) + { + packetHeader = *buf_p++; + packetSize = 1 + (packetHeader & 0x7f); + if (packetHeader & 0x80) + { // run-length packet + switch (targa_header.pixel_size) + { + case 24: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alphabyte = 255; + break; + case 32: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alphabyte = *buf_p++; + // detect if the whole alpha channel is 0 + if (alphabyte != 0) + bAlphaOK = true; + break; + default: + Sys_Printf ("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, + name); + g_free (*pic); + *pic = NULL; + return; + break; + } + + for (j = 0; j < packetSize; j++) + { + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = alphabyte; + column++; + if (column == columns) + { // run spans across rows + column = 0; + if (row > 0) + row--; + else + goto breakOut; + pixbuf = targa_rgba + row * columns * 4; + } + } + } + else + { // non run-length packet + for (j = 0; j < packetSize; j++) + { + switch (targa_header.pixel_size) + { + case 24: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + case 32: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alphabyte = *buf_p++; + // detect if the whole alpha channel is 0 + if (alphabyte != 0) + bAlphaOK = true; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = alphabyte; + break; + default: + Sys_Printf ("LoadTGA: illegal pixel_size '%d' in file '%s'\n", + targa_header.pixel_size, name); + g_free (*pic); + *pic = NULL; + return; + break; + } + column++; + if (column == columns) + { // pixel packet run spans across rows + column = 0; + if (row > 0) + row--; + else + goto breakOut; + pixbuf = targa_rgba + row * columns * 4; + } + } + } + } + breakOut:; + } + + if (!bAlphaOK) + { + if (targa_header.pixel_size == 32) + Sys_FPrintf (SYS_WRN, "WARNING: %s has empty alpha channel\n", name); + // disable the alpha value + for (row = rows - 1; row >= 0; row--) + { + pixbuf = targa_rgba + row * columns * 4; + for (column = 0; column < columns; column++) + { + // 32 bit + pixbuf += 3; + *pixbuf++ = 255; + } + } + } + + } + + // vertically flipped + if ( (targa_header.attributes & (1<<5)) ) { + int flip; + for (row = 0; row < .5f * rows; row++) + { + for (column = 0; column < columns; column++) + { + flip = *( (int*)targa_rgba + row * columns + column); + *( (int*)targa_rgba + row * columns + column) = *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ); + *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ) = flip; + } + } + } + + vfsFreeFile (buffer); +} + +//=================================================================== + +/* +================= +LoadImage + +Loads any of the supported image types into a cannonical +32 bit format. +================= +*/ +void LoadImage (const char *name, byte ** pic, int *width, int *height) +{ + int len; + *pic = NULL; + *width = 0; + *height = 0; + + len = strlen (name); + if (len < 5) + { + return; + } + + if (!g_strcasecmp (name + len - 4, ".tga")) + { + LoadTGA (name, pic, width, height); + } + else if (!g_strcasecmp (name + len - 4, ".pcx")) + { + LoadPCX32 (name, pic, width, height); + } + else if (!g_strcasecmp (name + len - 4, ".bmp")) + { + LoadBMP (name, pic, width, height); + } + /* + else if (!g_strcasecmp (name + len - 4, ".jpg")) + { + LoadJPG (name, pic, width, height); + } + */ +} diff --git a/plugins/image/lbmlib.h b/plugins/image/lbmlib.h new file mode 100644 index 00000000..a8892be6 --- /dev/null +++ b/plugins/image/lbmlib.h @@ -0,0 +1,46 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// piclib.h + +#ifdef __linux__ +#define WINAPI +#endif + +typedef unsigned char byte; + +void LoadLBM (char *filename, byte **picture, byte **palette); +void WriteLBMfile (char *filename, byte *data, int width, int height + , byte *palette); +void LoadPCX (char *filename, byte **picture, byte **palette, int *width, int *height); +void WritePCXfile (char *filename, byte *data, int width, int height + , byte *palette); + +// loads / saves either lbm or pcx, depending on extension +void Load256Image (char *name, byte **pixels, byte **palette, + int *width, int *height); +void Save256Image (char *name, byte *pixels, byte *palette, + int width, int height); + + +void LoadTGA (char *filename, byte **pixels, int *width, int *height); +// LoadImage will rely on file extension to call LoadTGA LoadPCX32 LoadBMP LoadJPG +void LoadImage( const char *name, byte **pic, int *width, int *height ); diff --git a/plugins/image/pcx.cpp b/plugins/image/pcx.cpp deleted file mode 100644 index 8853cb49..00000000 --- a/plugins/image/pcx.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pcx.h" - -#include "ifilesystem.h" - -typedef unsigned char byte; - -#include - -#include "imagelib.h" -#include "bytestreamutils.h" - -/* -================================================================= - -PCX LOADING - -================================================================= -*/ - -typedef struct -{ - unsigned char manufacturer; - unsigned char version; - unsigned char encoding; - unsigned char bits_per_pixel; - unsigned short xmin, ymin, xmax, ymax; - unsigned short hres, vres; - unsigned char palette[48]; - unsigned char reserved; - unsigned char color_planes; - unsigned short bytes_per_line; - unsigned short palette_type; - unsigned char filler[58]; - unsigned char data; // unbounded -} pcx_t; - -/* -============== -LoadPCX -============== -*/ - -struct PCXRLEPacket -{ - byte data; - int length; -}; - -inline void ByteStream_readPCXRLEPacket(PointerInputStream& inputStream, PCXRLEPacket& packet) -{ - byte d; - inputStream.read(&d, 1); - if((d & 0xC0) == 0xC0) - { - packet.length = d & 0x3F; - inputStream.read(&packet.data, 1); - } - else - { - packet.length = 1; - packet.data = d; - } -} - -void LoadPCXBuff(byte* buffer, std::size_t len, byte **pic, byte **palette, int *width, int *height ) -{ - *pic = 0; - - pcx_t pcx; - int x, y, lsize; - byte *out, *pix; - - /* parse the PCX file */ - - PointerInputStream inputStream(buffer); - - pcx.manufacturer = istream_read_byte(inputStream); - pcx.version = istream_read_byte(inputStream); - pcx.encoding = istream_read_byte(inputStream); - pcx.bits_per_pixel = istream_read_byte(inputStream); - pcx.xmin = istream_read_int16_le(inputStream); - pcx.ymin = istream_read_int16_le(inputStream); - pcx.xmax = istream_read_int16_le(inputStream); - pcx.ymax = istream_read_int16_le(inputStream); - pcx.hres = istream_read_int16_le(inputStream); - pcx.vres = istream_read_int16_le(inputStream); - inputStream.read(pcx.palette, 48); - pcx.reserved = istream_read_byte(inputStream); - pcx.color_planes = istream_read_byte(inputStream); - pcx.bytes_per_line = istream_read_int16_le(inputStream); - pcx.palette_type = istream_read_int16_le(inputStream); - inputStream.read(pcx.filler, 58); - - - if (pcx.manufacturer != 0x0a - || pcx.version != 5 - || pcx.encoding != 1 - || pcx.bits_per_pixel != 8) - return; - - if (width) - *width = pcx.xmax+1; - if (height) - *height = pcx.ymax+1; - - if (!pic) - return; - - out = (byte *)malloc ( (pcx.ymax+1) * (pcx.xmax+1) ); - - *pic = out; - pix = out; - - /* RR2DO2: pcx fix */ - lsize = pcx.color_planes * pcx.bytes_per_line; - - /* go scanline by scanline */ - for( y = 0; y <= pcx.ymax; y++, pix += pcx.xmax + 1 ) - { - /* do a scanline */ - for( x=0; x <= pcx.xmax; ) - { - /* RR2DO2 */ - PCXRLEPacket packet; - ByteStream_readPCXRLEPacket(inputStream, packet); - - while(packet.length-- > 0) - { - pix[ x++ ] = packet.data; - } - } - - /* RR2DO2: discard any other data */ - PCXRLEPacket packet; - while( x < lsize ) - { - ByteStream_readPCXRLEPacket(inputStream, packet); - x++; - } - while( packet.length-- > 0 ) - { - x++; - } - } - - /* validity check */ - if( std::size_t(inputStream.get() - buffer) > len) - { - *pic = 0; - } - - if (palette) - { - *palette = (byte *)malloc(768); - memcpy (*palette, buffer + len - 768, 768); - } -} - -/* -============== -LoadPCX32 -============== -*/ -Image* LoadPCX32Buff(byte* buffer, std::size_t length) -{ - byte *palette; - byte *pic8; - int i, c, p, width, height; - byte *pic32; - - LoadPCXBuff(buffer, length, &pic8, &palette, &width, &height); - if (!pic8) - { - return 0; - } - - RGBAImage* image = new RGBAImage(width, height); - c = (width) * (height); - pic32 = image->getRGBAPixels(); - for (i = 0; i < c; i++) - { - p = pic8[i]; - pic32[0] = palette[p * 3]; - pic32[1] = palette[p * 3 + 1]; - pic32[2] = palette[p * 3 + 2]; - pic32[3] = 255; - pic32 += 4; - } - - free (pic8); - free (palette); - - return image; -} - -Image* LoadPCX32(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadPCX32Buff(buffer.buffer, buffer.length); -} - diff --git a/plugins/image/tga.cpp b/plugins/image/tga.cpp deleted file mode 100644 index 6a6ac9aa..00000000 --- a/plugins/image/tga.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "tga.h" - -#include "ifilesystem.h" -#include "iarchive.h" -#include "idatastream.h" - -typedef unsigned char byte; - -#include - -#include "generic/bitfield.h" -#include "imagelib.h" -#include "bytestreamutils.h" - -// represents x,y origin of tga image being decoded -class Flip00 {}; // no flip -class Flip01 {}; // vertical flip only -class Flip10 {}; // horizontal flip only -class Flip11 {}; // both - -template -void image_decode(PointerInputStream& istream, PixelDecoder& decode, RGBAImage& image, const Flip00&) -{ - RGBAPixel* end = image.pixels + (image.height * image.width); - for(RGBAPixel* row = end; row != image.pixels; row -= image.width) - { - for(RGBAPixel* pixel = row - image.width; pixel != row; ++pixel) - { - decode(istream, *pixel); - } - } -} - -template -void image_decode(PointerInputStream& istream, PixelDecoder& decode, RGBAImage& image, const Flip01&) -{ - RGBAPixel* end = image.pixels + (image.height * image.width); - for(RGBAPixel* row = image.pixels; row != end; row += image.width) - { - for(RGBAPixel* pixel = row; pixel != row + image.width; ++pixel) - { - decode(istream, *pixel); - } - } -} - -template -void image_decode(PointerInputStream& istream, PixelDecoder& decode, RGBAImage& image, const Flip10&) -{ - RGBAPixel* end = image.pixels + (image.height * image.width); - for(RGBAPixel* row = end; row != image.pixels; row -= image.width) - { - for(RGBAPixel* pixel = row; pixel != row - image.width;) - { - decode(istream, *--pixel); - } - } -} - -template -void image_decode(PointerInputStream& istream, PixelDecoder& decode, RGBAImage& image, const Flip11&) -{ - RGBAPixel* end = image.pixels + (image.height * image.width); - for(RGBAPixel* row = image.pixels; row != end; row += image.width) - { - for(RGBAPixel* pixel = row + image.width; pixel != row;) - { - decode(istream, *--pixel); - } - } -} - -inline void istream_read_gray(PointerInputStream& istream, RGBAPixel& pixel) -{ - istream.read(&pixel.blue, 1); - pixel.red = pixel.green = pixel.blue; - pixel.alpha = 0xff; -} - -inline void istream_read_rgb(PointerInputStream& istream, RGBAPixel& pixel) -{ - istream.read(&pixel.blue, 1); - istream.read(&pixel.green, 1); - istream.read(&pixel.red, 1); - pixel.alpha = 0xff; -} - -inline void istream_read_rgba(PointerInputStream& istream, RGBAPixel& pixel) -{ - istream.read(&pixel.blue, 1); - istream.read(&pixel.green, 1); - istream.read(&pixel.red, 1); - istream.read(&pixel.alpha, 1); -} - -class TargaDecodeGrayPixel -{ -public: - void operator()(PointerInputStream& istream, RGBAPixel& pixel) - { - istream_read_gray(istream, pixel); - } -}; - -template -void targa_decode_grayscale(PointerInputStream& istream, RGBAImage& image, const Flip& flip) -{ - TargaDecodeGrayPixel decode; - image_decode(istream, decode, image, flip); -} - -class TargaDecodeRGBPixel -{ -public: - void operator()(PointerInputStream& istream, RGBAPixel& pixel) - { - istream_read_rgb(istream, pixel); - } -}; - -template -void targa_decode_rgb(PointerInputStream& istream, RGBAImage& image, const Flip& flip) -{ - TargaDecodeRGBPixel decode; - image_decode(istream, decode, image, flip); -} - -class TargaDecodeRGBAPixel -{ -public: - void operator()(PointerInputStream& istream, RGBAPixel& pixel) - { - istream_read_rgba(istream, pixel); - } -}; - -template -void targa_decode_rgba(PointerInputStream& istream, RGBAImage& image, const Flip& flip) -{ - TargaDecodeRGBAPixel decode; - image_decode(istream, decode, image, flip); -} - -typedef byte TargaPacket; -typedef byte TargaPacketSize; - -inline void targa_packet_read_istream(TargaPacket& packet, PointerInputStream& istream) -{ - istream.read(&packet, 1); -} - -inline bool targa_packet_is_rle(const TargaPacket& packet) -{ - return (packet & 0x80) != 0; -} - -inline TargaPacketSize targa_packet_size(const TargaPacket& packet) -{ - return 1 + (packet & 0x7f); -} - - -class TargaDecodeRGBPixelRLE -{ - TargaPacketSize m_packetSize; - RGBAPixel m_pixel; - TargaPacket m_packet; -public: - TargaDecodeRGBPixelRLE() : m_packetSize(0) - { - } - void operator()(PointerInputStream& istream, RGBAPixel& pixel) - { - if(m_packetSize == 0) - { - targa_packet_read_istream(m_packet, istream); - m_packetSize = targa_packet_size(m_packet); - - if(targa_packet_is_rle(m_packet)) - { - istream_read_rgb(istream, m_pixel); - } - } - - if(targa_packet_is_rle(m_packet)) - { - pixel = m_pixel; - } - else - { - istream_read_rgb(istream, pixel); - } - - --m_packetSize; - } -}; - -template -void targa_decode_rle_rgb(PointerInputStream& istream, RGBAImage& image, const Flip& flip) -{ - TargaDecodeRGBPixelRLE decode; - image_decode(istream, decode, image, flip); -} - -class TargaDecodeRGBAPixelRLE -{ - TargaPacketSize m_packetSize; - RGBAPixel m_pixel; - TargaPacket m_packet; -public: - TargaDecodeRGBAPixelRLE() : m_packetSize(0) - { - } - void operator()(PointerInputStream& istream, RGBAPixel& pixel) - { - if(m_packetSize == 0) - { - targa_packet_read_istream(m_packet, istream); - m_packetSize = targa_packet_size(m_packet); - - if(targa_packet_is_rle(m_packet)) - { - istream_read_rgba(istream, m_pixel); - } - } - - if(targa_packet_is_rle(m_packet)) - { - pixel = m_pixel; - } - else - { - istream_read_rgba(istream, pixel); - } - - --m_packetSize; - } -}; - -template -void targa_decode_rle_rgba(PointerInputStream& istream, RGBAImage& image, const Flip& flip) -{ - TargaDecodeRGBAPixelRLE decode; - image_decode(istream, decode, image, flip); -} - -struct TargaHeader -{ - unsigned char id_length, colormap_type, image_type; - unsigned short colormap_index, colormap_length; - unsigned char colormap_size; - unsigned short x_origin, y_origin, width, height; - unsigned char pixel_size, attributes; -}; - -inline void targa_header_read_istream(TargaHeader& targa_header, PointerInputStream& istream) -{ - targa_header.id_length = istream_read_byte(istream); - targa_header.colormap_type = istream_read_byte(istream); - targa_header.image_type = istream_read_byte(istream); - - targa_header.colormap_index = istream_read_int16_le(istream); - targa_header.colormap_length = istream_read_int16_le(istream); - targa_header.colormap_size = istream_read_byte(istream); - targa_header.x_origin = istream_read_int16_le(istream); - targa_header.y_origin = istream_read_int16_le(istream); - targa_header.width = istream_read_int16_le(istream); - targa_header.height = istream_read_int16_le(istream); - targa_header.pixel_size = istream_read_byte(istream); - targa_header.attributes = istream_read_byte(istream); - - if (targa_header.id_length != 0) - istream.seek(targa_header.id_length); // skip TARGA image comment -} - -template -class ScopeDelete -{ - Type* m_value; - ScopeDelete(const ScopeDelete&); - ScopeDelete& operator=(const ScopeDelete&); -public: - ScopeDelete(Type* value) : m_value(value) - { - } - ~ScopeDelete() - { - delete m_value; - } - Type* get_pointer() const - { - return m_value; - } -}; - -template -Image* Targa_decodeImageData(const TargaHeader& targa_header, PointerInputStream& istream, const Flip& flip) -{ - RGBAImage* image = new RGBAImage(targa_header.width, targa_header.height); - - if (targa_header.image_type == 2 || targa_header.image_type == 3) - { - switch (targa_header.pixel_size) - { - case 8: - targa_decode_grayscale(istream, *image, flip); - break; - case 24: - targa_decode_rgb(istream, *image, flip); - break; - case 32: - targa_decode_rgba(istream, *image, flip); - break; - default: - globalErrorStream() << "LoadTGA: illegal pixel_size '" << targa_header.pixel_size << "'\n"; - image->release(); - return 0; - } - } - else if (targa_header.image_type == 10) - { - switch (targa_header.pixel_size) - { - case 24: - targa_decode_rle_rgb(istream, *image, flip); - break; - case 32: - targa_decode_rle_rgba(istream, *image, flip); - break; - default: - globalErrorStream() << "LoadTGA: illegal pixel_size '" << targa_header.pixel_size << "'\n"; - image->release(); - return 0; - } - } - - return image; -} - -const unsigned int TGA_FLIP_HORIZONTAL = 0x10; -const unsigned int TGA_FLIP_VERTICAL = 0x20; - -Image* LoadTGABuff(const byte* buffer) -{ - PointerInputStream istream(buffer); - TargaHeader targa_header; - - targa_header_read_istream(targa_header, istream); - - if (targa_header.image_type != 2 && targa_header.image_type != 10 && targa_header.image_type != 3) - { - globalErrorStream() << "LoadTGA: TGA type " << targa_header.image_type << " not supported\n"; - globalErrorStream() << "LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n"; - return 0; - } - - if (targa_header.colormap_type != 0) - { - globalErrorStream() << "LoadTGA: colormaps not supported\n"; - return 0; - } - - if ((targa_header.pixel_size != 32 && targa_header.pixel_size != 24) - && targa_header.image_type != 3) - { - globalErrorStream() << "LoadTGA: Only 32 or 24 bit images supported\n"; - return 0; - } - - if(!bitfield_enabled(targa_header.attributes, TGA_FLIP_HORIZONTAL) - && !bitfield_enabled(targa_header.attributes, TGA_FLIP_VERTICAL)) - { - return Targa_decodeImageData(targa_header, istream, Flip00()); - } - if(!bitfield_enabled(targa_header.attributes, TGA_FLIP_HORIZONTAL) - && bitfield_enabled(targa_header.attributes, TGA_FLIP_VERTICAL)) - { - return Targa_decodeImageData(targa_header, istream, Flip01()); - } - if(bitfield_enabled(targa_header.attributes, TGA_FLIP_HORIZONTAL) - && !bitfield_enabled(targa_header.attributes, TGA_FLIP_VERTICAL)) - { - return Targa_decodeImageData(targa_header, istream, Flip10()); - } - if(bitfield_enabled(targa_header.attributes, TGA_FLIP_HORIZONTAL) - && bitfield_enabled(targa_header.attributes, TGA_FLIP_VERTICAL)) - { - return Targa_decodeImageData(targa_header, istream, Flip11()); - } - - // unreachable - return 0; -} - -Image* LoadTGA(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadTGABuff(buffer.buffer); -} diff --git a/plugins/image/tga.h b/plugins/image/tga.h deleted file mode 100644 index 08e69a76..00000000 --- a/plugins/image/tga.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_TGA_H) -#define INCLUDED_TGA_H - -class Image; -class ArchiveFile; - -Image* LoadTGA(ArchiveFile& file); - -#endif - diff --git a/plugins/imagehl/hlw.cpp b/plugins/imagehl/hlw.cpp deleted file mode 100644 index a4078a3e..00000000 --- a/plugins/imagehl/hlw.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -// by Hydra - hydra@hydras-world.com -// -// HLW = Half-Life-WAD, I don't know if the actual in data in the WAD files -// has it's own name, so I'm just calling the individal textures .HLW files :) -// -// Thanks to the guys that made Wally for releasing an example WAD loader. -// without it this would not have been possible. - -#include "hlw.h" - -#include -#include -#include - -typedef unsigned char byte; - -#include "ifilesystem.h" - -#include "imagelib.h" - - -/* -============================================================================ - -HLW IMAGE - - HalfLife WAD files contain files that look like this: - - Mip section - First mip - Mip header - First mip (width * height) - Second mip (width * height / 4) - Third mip (width * height / 16) - Fourth mip (width * height / 64) - Palette size (WORD) - Palette (Palette size * 3) - Padding (WORD) - -============================================================================ -*/ - -#define GET_MIP_DATA_SIZE(WIDTH, HEIGHT) (sizeof(WAD3_MIP) + (WIDTH * HEIGHT) + (WIDTH * HEIGHT / 4) + (WIDTH * HEIGHT / 16) + (WIDTH * HEIGHT / 64)) - -typedef struct -{ - char name[16]; - unsigned int width, height; - unsigned int offsets[4]; // four mip maps stored -} WAD3_MIP, *LPWAD3_MIP; - -/* -========================================================= - -HLW LOADING - - Hydra: this code isn't bullet proof and probably won't - like corrupt WAD files, but it works for now. - - TODO: make it more robust. -========================================================= -*/ - -/* -============= -LoadHLW -============= -*/ - -Image* LoadHLWBuff(byte* buffer) -{ - byte *buf_p; - unsigned long mipdatasize; - int columns, rows, numPixels; - byte *pixbuf; - int row, column; - byte *palette; - LPWAD3_MIP lpMip; - unsigned char red, green, blue, alphabyte; - - lpMip = (LPWAD3_MIP)buffer; //!\todo Make endian-safe. - - mipdatasize = GET_MIP_DATA_SIZE(lpMip->width,lpMip->height); - - palette = buffer+mipdatasize+2; - - buf_p = buffer+lpMip->offsets[0]; - - columns = lpMip->width; - rows = lpMip->height; - numPixels = columns * rows; - - RGBAImage* image = new RGBAImage(columns, rows); - - for (row = 0; row < rows; row++) - { - pixbuf = image->getRGBAPixels() + row * columns * 4; - - for (column = 0; column < columns; column++) - { - int palIndex; - - palIndex = *buf_p++; - - red = *(palette+(palIndex*3)); - green = *(palette+(palIndex*3)+1); - blue = *(palette+(palIndex*3)+2); - - // HalfLife engine makes pixels that are BLUE transparent. - // So show them that way in the editor. - if (blue == 0xff && red == 0x00 && green == 0x00) - { - alphabyte = 0x00; - blue = 0x00; // don't set the resulting pixel to blue - } - else - { - alphabyte = 0xff; - } - - *pixbuf++ = red; - *pixbuf++ = green; - *pixbuf++ = blue; - - *pixbuf++ = alphabyte; - } - } - - return image; -} - -Image* LoadHLW(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadHLWBuff(buffer.buffer ); -} diff --git a/plugins/imagehl/imagehl.cpp b/plugins/imagehl/imagehl.cpp index af051044..eabfd163 100644 --- a/plugins/imagehl/imagehl.cpp +++ b/plugins/imagehl/imagehl.cpp @@ -1,113 +1,104 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// +// HalfLife WAD format image loading plugin +// +// hydra - hydra@hydras-world.com +// + +#include #include "imagehl.h" +#include "lbmlib.h" -#include "debugging/debugging.h" -#include "ifilesystem.h" -#include "iimage.h" +// ============================================================================= +// static variables -#include "hlw.h" -#include "mip.h" -#include "sprite.h" +_QERFuncTable_1 g_FuncTable; // Radiant function table +_QERFileSystemTable g_FileSystemTable; -#include "modulesystem/singletonmodule.h" +// ============================================================================= +// SYNAPSE +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientImageHL g_SynapseClient; -class ImageDependencies : public GlobalFileSystemModuleRef -{ -}; - -class ImageHLWAPI -{ - _QERPlugImageTable m_imagehlw; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "hlw"); - - ImageHLWAPI() +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { - m_imagehlw.loadImage = LoadHLW; + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - _QERPlugImageTable* getTable() - { - return &m_imagehlw; - } -}; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); -typedef SingletonModule ImageHLWModule; +#ifdef USE_HLW + g_SynapseClient.AddAPI(IMAGE_MAJOR, "hlw", sizeof(_QERPlugImageTable)); +#endif +#ifdef USE_MIP + g_SynapseClient.AddAPI(IMAGE_MAJOR, "mip", sizeof(_QERPlugImageTable)); +#endif +#ifdef USE_IDSP + g_SynapseClient.AddAPI(IMAGE_MAJOR, "spr", sizeof(_QERPlugImageTable)); +#endif + // this "wad" needs to be "*" for the VFS, we don't care what VFS we have, as long as we have one. + g_SynapseClient.AddAPI(VFS_MAJOR, "wad", sizeof(_QERFileSystemTable), SYN_REQUIRE, &g_FileSystemTable); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); -ImageHLWModule g_ImageHLWModule; - - -class ImageMipAPI -{ - _QERPlugImageTable m_imagemip; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "mip"); - - ImageMipAPI() - { - m_imagemip.loadImage = LoadMIP; - } - _QERPlugImageTable* getTable() - { - return &m_imagemip; - } -}; - -typedef SingletonModule ImageMipModule; - -ImageMipModule g_ImageMipModule; - - -class ImageSpriteAPI -{ - _QERPlugImageTable m_imagesprite; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "spr"); - - ImageSpriteAPI() - { - m_imagesprite.loadImage = LoadIDSP; - } - _QERPlugImageTable* getTable() - { - return &m_imagesprite; - } -}; - -typedef SingletonModule ImageSpriteModule; - -ImageSpriteModule g_ImageSpriteModule; - - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ImageHLWModule.selfRegister(); - g_ImageMipModule.selfRegister(); - g_ImageSpriteModule.selfRegister(); + return &g_SynapseClient; +} + +bool CSynapseClientImageHL::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, "image")) + { + _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); + + pTable->m_pfnLoadImage = &LoadImage; + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientImageHL::GetInfo() +{ + return "imagehl formats module built " __DATE__ " " RADIANT_VERSION; } diff --git a/plugins/imagehl/imagehl.def b/plugins/imagehl/imagehl.def index 41d105e4..0e4eb081 100644 --- a/plugins/imagehl/imagehl.def +++ b/plugins/imagehl/imagehl.def @@ -1,7 +1,8 @@ -; imagehl.def : Declares the module parameters for the DLL. +; hlimage.def : Declares the module parameters for the DLL. LIBRARY "ImageHL" +DESCRIPTION 'ImageHL Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here - Radiant_RegisterModules @1 + Synapse_EnumerateInterfaces @1 diff --git a/plugins/imagehl/imagehl.h b/plugins/imagehl/imagehl.h index 9d475770..5042e7e2 100644 --- a/plugins/imagehl/imagehl.h +++ b/plugins/imagehl/imagehl.h @@ -1,25 +1,80 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_IMAGEHL_H) -#define INCLUDED_IMAGEHL_H +#ifndef _IMAGEHL_H_ +#define _IMAGEHL_H_ -#endif +// here we can turn on and off which image formats this .dll will provide. +// just comment the define out to completly remove the code from the .dll. +#define USE_TARGA //Hydra: USE_TARGA is NOT required for HL support. but it might be useful to mappers. remove ? +#define USE_IDSP +#define USE_HLW +#define USE_MIP + +// on with the usual stuff... +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" +#include "iimage.h" + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +extern _QERFuncTable_1 g_FuncTable; +extern _QERFileSystemTable g_FileSystemTable; + +#define Error g_FuncTable.m_pfnError +#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile +#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile + +#define LittleLong(a) GINT32_FROM_LE(a) +#define LittleShort(a) GINT16_FROM_LE(a) + +class CSynapseClientImageHL : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientImageHL() { } + virtual ~CSynapseClientImageHL() { } +}; + +#define DWORD unsigned int +#define BYTE unsigned char +#define WORD unsigned short int + +#endif // _IMAGEHL_H_ diff --git a/plugins/imagehl/imagehl.vcproj b/plugins/imagehl/imagehl.vcproj index ce23ac1e..82301e06 100644 --- a/plugins/imagehl/imagehl.vcproj +++ b/plugins/imagehl/imagehl.vcproj @@ -1,299 +1,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/imagehl/lbmlib.cpp b/plugins/imagehl/lbmlib.cpp new file mode 100644 index 00000000..02e3e100 --- /dev/null +++ b/plugins/imagehl/lbmlib.cpp @@ -0,0 +1,609 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// lbmlib.c + +// by Hydra - hydra@hydras-world.com +// +// This module is based on the image module, but just more stripped down. +// it still currently supports TGA file loading, even though this is not +// required for HalfLife support (unless MD2 files use TGA's) +// +// use the #defines in imagehl.h to enable/disable the various formats. +// +// HLW = Half-Life-WAD, I don't know if the actual in data in the WAD files +// has it's own name, so I'm just calling the individal textures .HLW files :) +// +// Thanks to the guys that made Wally for releasing an example WAD loader. +// without it this would not have been possible. + +#include +#include +#include +#include "imagehl.h" +#include "lbmlib.h" + +#include + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf + + +#ifdef USE_IDSP +/* +============================================================================ + +IDSP IMAGE (.spr files) + +Some code copied straight from the Q1 source, also used the HalfLife SDK as +a reference. + +============================================================================ +*/ + +typedef enum {ST_SYNC=0, ST_RAND } synctype_t; +typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t; + +typedef struct dspriteheader_s { + int ident; + int version; +} dspriteheader_t; + +// Quake1 +typedef struct { + int type; + float boundingradius; + int width; + int height; + int numframes; + float beamlength; + synctype_t synctype; +} dspritev1_t; + +// Halflife +typedef struct { + int type; + int texFormat; + float boundingradius; + int width; + int height; + int numframes; + float beamlength; + synctype_t synctype; +} dspritev2_t; + +typedef struct { + int origin[2]; + int width; + int height; +} dspriteframe_t; + +typedef struct { + short type; +} dspriteframetype_t; + +/* +typedef struct { + byte rgb[256][3]; +} dpalette_t; +*/ + +#define IDSPRITEHEADER (('P'<<24)+('S'<<16)+('D'<<8)+'I') + // little-endian "IDSP" + +/* +============= +LoadIDSP +============= +*/ + +static void LoadIDSP (const char *name, byte ** pic, int *width, int *height) +{ + byte *buffer; + byte *buf_p; + unsigned int length; + int columns, rows, numPixels; + byte *pixbuf; + + int row, column; + byte *bmpRGBA; + byte *palette; + unsigned char red, green, blue, alphabyte; + + dspriteheader_t *header; + dspritev1_t *pinv1; + dspritev2_t *pinv2; + dspriteframetype_t *pframetype; + int version; + int numframes; + int size; + spriteframetype_t frametype; + dspriteframe_t *spriteframe; + + *pic = NULL; + + // + // load the file + // + length = vfsLoadFile ((char *) name, (void **) &buffer, 0); + if (length == (unsigned int) -1) + return; + + header = (dspriteheader_t *)buffer; + + if (header->ident != IDSPRITEHEADER) + { + Sys_Printf ("WARNING: %s has wrong header\n"); + vfsFreeFile (buffer); + return; + } + + version = header->version; + if (version != 1 && version != 2 ) + { + Sys_Printf ("WARNING: %s has wrong version number " + "(%i should be 1 or 2)\n", name, version); + vfsFreeFile (buffer); + return; + } + + // initialise variables depending on the sprite version. + switch (version) + { + case 1: + pinv1 = (dspritev1_t *)(header+1); + numframes = pinv1->numframes; + columns = pinv1->width; + rows = pinv1->height; + pframetype = (dspriteframetype_t *)(pinv1 + 1); + break; + case 2: + pinv2 = (dspritev2_t *)(header+1); + numframes = pinv2->numframes; + columns = pinv2->width; + rows = pinv2->height; + pframetype = (dspriteframetype_t *)(pinv2 + 1); + break; + } + if (numframes > 1) + Sys_Printf ("WARNING: %s has multiple frames, only the first frame will be used.\n", name); + + // palette = buffer+mipdatasize+2; + // buf_p = buffer+lpMip->offsets[0]; + + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + bmpRGBA = reinterpret_cast < unsigned char *>(g_malloc (numPixels * 4)); + *pic = bmpRGBA; + +#ifdef DEBUG + frametype = spriteframetype_t(LittleLong(pframetype->type)); + if (frametype == SPR_SINGLE) + { + Sys_Printf("Single Frame\n"); + } + else if (frametype == SPR_GROUP) + { + Sys_Printf("Group of Frames\n"); + } + else + { + Sys_Printf("Bleh!\n"); // <-- we always get this, wtf! + } +#endif + + palette = (byte *)(pframetype+1); + spriteframe = (dspriteframe_t *)(palette + (256*3) + 4); // what are those 4 extra bytes ? what's missing ? + buf_p = (byte *)(spriteframe + 1); + + int temp; + + temp = buf_p - buffer; + + for (row = 0; row < rows; row++) + { + pixbuf = bmpRGBA + row * columns * 4; + + for (column = 0; column < columns; column++) + { + int palIndex; + + palIndex = *buf_p++; + + red = *(palette+(palIndex*3)); + green = *(palette+(palIndex*3)+1); + blue = *(palette+(palIndex*3)+2); + + // HalfLife engine makes pixels that are BLUE transparent. (RGB = 0x0000FF) + // So show them that way in the editor. + if (blue == 0xff && red == 0x00 && green == 0x00) + { + alphabyte = 0xff; //FIXME: backwards? (so sprite models to render correctly) + blue = 0x00; // don't set the resulting pixel to blue + } + else + { + alphabyte = 0x00; //FIXME: backwards? (so sprite models to render correctly) + } + + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + + *pixbuf++ = alphabyte; + } + } + + vfsFreeFile (buffer); +} +#endif + +#ifdef USE_HLW +/* +============================================================================ + +HLW IMAGE + + HalfLife WAD files contain files that look like this: + + Mip section + First mip + Mip header + First mip (width * height) + Second mip (width * height / 4) + Third mip (width * height / 16) + Fourth mip (width * height / 64) + Palette size (WORD) + Palette (Palette size * 3) + Padding (WORD) + +============================================================================ +*/ + +#define GET_MIP_DATA_SIZE(WIDTH, HEIGHT) (sizeof(WAD3_MIP) + (WIDTH * HEIGHT) + (WIDTH * HEIGHT / 4) + (WIDTH * HEIGHT / 16) + (WIDTH * HEIGHT / 64)) + +typedef struct +{ + char name[16]; + DWORD width, height; + DWORD offsets[4]; // four mip maps stored +} WAD3_MIP, *LPWAD3_MIP; + +/* +========================================================= + +HLW LOADING + + Hydra: this code isn't bullet proof and probably won't + like corrupt WAD files, but it works for now. + + TODO: make it more robust. +========================================================= +*/ + +/* +============= +LoadHLW +============= +*/ + +static void LoadHLW (const char *name, byte ** pic, int *width, int *height) +{ + byte *buffer; + byte *buf_p; + unsigned int length; + unsigned long mipdatasize; + int columns, rows, numPixels; + byte *pixbuf; + int row, column; + byte *bmpRGBA; + byte *palette; + LPWAD3_MIP lpMip; + unsigned char red, green, blue, alphabyte; + + *pic = NULL; + + // + // load the file + // + length = vfsLoadFile ((char *) name, (void **) &buffer, 0); + if (length == (unsigned int) -1) + return; + + lpMip = (LPWAD3_MIP)buffer; + + mipdatasize = GET_MIP_DATA_SIZE(lpMip->width,lpMip->height); + + palette = buffer+mipdatasize+2; + + buf_p = buffer+lpMip->offsets[0]; + + columns = lpMip->width; + rows = lpMip->height; + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + bmpRGBA = reinterpret_cast < unsigned char *>(g_malloc (numPixels * 4)); + *pic = bmpRGBA; + + for (row = 0; row < rows; row++) + { + pixbuf = bmpRGBA + row * columns * 4; + + for (column = 0; column < columns; column++) + { + int palIndex; + + palIndex = *buf_p++; + + red = *(palette+(palIndex*3)); + green = *(palette+(palIndex*3)+1); + blue = *(palette+(palIndex*3)+2); + + // HalfLife engine makes pixels that are BLUE transparent. + // So show them that way in the editor. + if (blue == 0xff && red == 0x00 && green == 0x00) + { + alphabyte = 0x00; + blue = 0x00; // don't set the resulting pixel to blue + } + else + { + alphabyte = 0xff; + } + + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + + *pixbuf++ = alphabyte; + } + } + + vfsFreeFile (buffer); +} +#endif + +#ifdef USE_MIP +/* +============================================================================ + +MIP IMAGE + + Quake WAD files contain miptex files that look like this: + + Mip section + First mip + Mip header + First mip (width * height) + Second mip (width * height / 4) + Third mip (width * height / 16) + Fourth mip (width * height / 64) + +============================================================================ +*/ + +/* +========================================================= + +MIP LOADING + + LordHavoc: this code is based on the HLW code above. +========================================================= +*/ + + +static const byte quakepalette[768] = +{ + 0x00,0x00,0x00, 0x0f,0x0f,0x0f, 0x1f,0x1f,0x1f, 0x2f,0x2f,0x2f, + 0x3f,0x3f,0x3f, 0x4b,0x4b,0x4b, 0x5b,0x5b,0x5b, 0x6b,0x6b,0x6b, + 0x7b,0x7b,0x7b, 0x8b,0x8b,0x8b, 0x9b,0x9b,0x9b, 0xab,0xab,0xab, + 0xbb,0xbb,0xbb, 0xcb,0xcb,0xcb, 0xdb,0xdb,0xdb, 0xeb,0xeb,0xeb, + 0x0f,0x0b,0x07, 0x17,0x0f,0x0b, 0x1f,0x17,0x0b, 0x27,0x1b,0x0f, + 0x2f,0x23,0x13, 0x37,0x2b,0x17, 0x3f,0x2f,0x17, 0x4b,0x37,0x1b, + 0x53,0x3b,0x1b, 0x5b,0x43,0x1f, 0x63,0x4b,0x1f, 0x6b,0x53,0x1f, + 0x73,0x57,0x1f, 0x7b,0x5f,0x23, 0x83,0x67,0x23, 0x8f,0x6f,0x23, + 0x0b,0x0b,0x0f, 0x13,0x13,0x1b, 0x1b,0x1b,0x27, 0x27,0x27,0x33, + 0x2f,0x2f,0x3f, 0x37,0x37,0x4b, 0x3f,0x3f,0x57, 0x47,0x47,0x67, + 0x4f,0x4f,0x73, 0x5b,0x5b,0x7f, 0x63,0x63,0x8b, 0x6b,0x6b,0x97, + 0x73,0x73,0xa3, 0x7b,0x7b,0xaf, 0x83,0x83,0xbb, 0x8b,0x8b,0xcb, + 0x00,0x00,0x00, 0x07,0x07,0x00, 0x0b,0x0b,0x00, 0x13,0x13,0x00, + 0x1b,0x1b,0x00, 0x23,0x23,0x00, 0x2b,0x2b,0x07, 0x2f,0x2f,0x07, + 0x37,0x37,0x07, 0x3f,0x3f,0x07, 0x47,0x47,0x07, 0x4b,0x4b,0x0b, + 0x53,0x53,0x0b, 0x5b,0x5b,0x0b, 0x63,0x63,0x0b, 0x6b,0x6b,0x0f, + 0x07,0x00,0x00, 0x0f,0x00,0x00, 0x17,0x00,0x00, 0x1f,0x00,0x00, + 0x27,0x00,0x00, 0x2f,0x00,0x00, 0x37,0x00,0x00, 0x3f,0x00,0x00, + 0x47,0x00,0x00, 0x4f,0x00,0x00, 0x57,0x00,0x00, 0x5f,0x00,0x00, + 0x67,0x00,0x00, 0x6f,0x00,0x00, 0x77,0x00,0x00, 0x7f,0x00,0x00, + 0x13,0x13,0x00, 0x1b,0x1b,0x00, 0x23,0x23,0x00, 0x2f,0x2b,0x00, + 0x37,0x2f,0x00, 0x43,0x37,0x00, 0x4b,0x3b,0x07, 0x57,0x43,0x07, + 0x5f,0x47,0x07, 0x6b,0x4b,0x0b, 0x77,0x53,0x0f, 0x83,0x57,0x13, + 0x8b,0x5b,0x13, 0x97,0x5f,0x1b, 0xa3,0x63,0x1f, 0xaf,0x67,0x23, + 0x23,0x13,0x07, 0x2f,0x17,0x0b, 0x3b,0x1f,0x0f, 0x4b,0x23,0x13, + 0x57,0x2b,0x17, 0x63,0x2f,0x1f, 0x73,0x37,0x23, 0x7f,0x3b,0x2b, + 0x8f,0x43,0x33, 0x9f,0x4f,0x33, 0xaf,0x63,0x2f, 0xbf,0x77,0x2f, + 0xcf,0x8f,0x2b, 0xdf,0xab,0x27, 0xef,0xcb,0x1f, 0xff,0xf3,0x1b, + 0x0b,0x07,0x00, 0x1b,0x13,0x00, 0x2b,0x23,0x0f, 0x37,0x2b,0x13, + 0x47,0x33,0x1b, 0x53,0x37,0x23, 0x63,0x3f,0x2b, 0x6f,0x47,0x33, + 0x7f,0x53,0x3f, 0x8b,0x5f,0x47, 0x9b,0x6b,0x53, 0xa7,0x7b,0x5f, + 0xb7,0x87,0x6b, 0xc3,0x93,0x7b, 0xd3,0xa3,0x8b, 0xe3,0xb3,0x97, + 0xab,0x8b,0xa3, 0x9f,0x7f,0x97, 0x93,0x73,0x87, 0x8b,0x67,0x7b, + 0x7f,0x5b,0x6f, 0x77,0x53,0x63, 0x6b,0x4b,0x57, 0x5f,0x3f,0x4b, + 0x57,0x37,0x43, 0x4b,0x2f,0x37, 0x43,0x27,0x2f, 0x37,0x1f,0x23, + 0x2b,0x17,0x1b, 0x23,0x13,0x13, 0x17,0x0b,0x0b, 0x0f,0x07,0x07, + 0xbb,0x73,0x9f, 0xaf,0x6b,0x8f, 0xa3,0x5f,0x83, 0x97,0x57,0x77, + 0x8b,0x4f,0x6b, 0x7f,0x4b,0x5f, 0x73,0x43,0x53, 0x6b,0x3b,0x4b, + 0x5f,0x33,0x3f, 0x53,0x2b,0x37, 0x47,0x23,0x2b, 0x3b,0x1f,0x23, + 0x2f,0x17,0x1b, 0x23,0x13,0x13, 0x17,0x0b,0x0b, 0x0f,0x07,0x07, + 0xdb,0xc3,0xbb, 0xcb,0xb3,0xa7, 0xbf,0xa3,0x9b, 0xaf,0x97,0x8b, + 0xa3,0x87,0x7b, 0x97,0x7b,0x6f, 0x87,0x6f,0x5f, 0x7b,0x63,0x53, + 0x6b,0x57,0x47, 0x5f,0x4b,0x3b, 0x53,0x3f,0x33, 0x43,0x33,0x27, + 0x37,0x2b,0x1f, 0x27,0x1f,0x17, 0x1b,0x13,0x0f, 0x0f,0x0b,0x07, + 0x6f,0x83,0x7b, 0x67,0x7b,0x6f, 0x5f,0x73,0x67, 0x57,0x6b,0x5f, + 0x4f,0x63,0x57, 0x47,0x5b,0x4f, 0x3f,0x53,0x47, 0x37,0x4b,0x3f, + 0x2f,0x43,0x37, 0x2b,0x3b,0x2f, 0x23,0x33,0x27, 0x1f,0x2b,0x1f, + 0x17,0x23,0x17, 0x0f,0x1b,0x13, 0x0b,0x13,0x0b, 0x07,0x0b,0x07, + 0xff,0xf3,0x1b, 0xef,0xdf,0x17, 0xdb,0xcb,0x13, 0xcb,0xb7,0x0f, + 0xbb,0xa7,0x0f, 0xab,0x97,0x0b, 0x9b,0x83,0x07, 0x8b,0x73,0x07, + 0x7b,0x63,0x07, 0x6b,0x53,0x00, 0x5b,0x47,0x00, 0x4b,0x37,0x00, + 0x3b,0x2b,0x00, 0x2b,0x1f,0x00, 0x1b,0x0f,0x00, 0x0b,0x07,0x00, + 0x00,0x00,0xff, 0x0b,0x0b,0xef, 0x13,0x13,0xdf, 0x1b,0x1b,0xcf, + 0x23,0x23,0xbf, 0x2b,0x2b,0xaf, 0x2f,0x2f,0x9f, 0x2f,0x2f,0x8f, + 0x2f,0x2f,0x7f, 0x2f,0x2f,0x6f, 0x2f,0x2f,0x5f, 0x2b,0x2b,0x4f, + 0x23,0x23,0x3f, 0x1b,0x1b,0x2f, 0x13,0x13,0x1f, 0x0b,0x0b,0x0f, + 0x2b,0x00,0x00, 0x3b,0x00,0x00, 0x4b,0x07,0x00, 0x5f,0x07,0x00, + 0x6f,0x0f,0x00, 0x7f,0x17,0x07, 0x93,0x1f,0x07, 0xa3,0x27,0x0b, + 0xb7,0x33,0x0f, 0xc3,0x4b,0x1b, 0xcf,0x63,0x2b, 0xdb,0x7f,0x3b, + 0xe3,0x97,0x4f, 0xe7,0xab,0x5f, 0xef,0xbf,0x77, 0xf7,0xd3,0x8b, + 0xa7,0x7b,0x3b, 0xb7,0x9b,0x37, 0xc7,0xc3,0x37, 0xe7,0xe3,0x57, + 0x7f,0xbf,0xff, 0xab,0xe7,0xff, 0xd7,0xff,0xff, 0x67,0x00,0x00, + 0x8b,0x00,0x00, 0xb3,0x00,0x00, 0xd7,0x00,0x00, 0xff,0x00,0x00, + 0xff,0xf3,0x93, 0xff,0xf7,0xc7, 0xff,0xff,0xff, 0x9f,0x5b,0x53 +}; + +/* +============= +LoadMIP +============= +*/ + +static void LoadMIP (const char *name, byte ** pic, int *width, int *height) +{ + byte *buffer; + byte *buf_p; + unsigned int length, palettelength; + unsigned long mipdatasize; + int columns, rows, numPixels; + byte *pixbuf; + int i; + byte *bmpRGBA; + byte *loadedpalette; + const byte *palette; + LPWAD3_MIP lpMip; + + *pic = NULL; + loadedpalette = NULL; + + // + // load the file + // + length = vfsLoadFile ((char *) name, (void **) &buffer, 0); + if (length == (unsigned int) -1) + return; + + lpMip = (LPWAD3_MIP)buffer; + + mipdatasize = GET_MIP_DATA_SIZE(lpMip->width,lpMip->height); + + palettelength = vfsLoadFile ("textures/palette.lmp", (void **) &loadedpalette, 0); + if (palettelength == 768) + palette = loadedpalette; + else + { + loadedpalette = NULL; + palette = quakepalette; + } + + buf_p = buffer+lpMip->offsets[0]; + + columns = lpMip->width; + rows = lpMip->height; + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + //Sys_Printf("lpMip->width = %i, lpMip->height = %i, lpMip->offsets[0] = %i, lpMip->offsets[1] = %i, lpMip->offsets[2] = %i, lpMip->offsets[3] = %i, numPixels = %i\n", lpMip->width, lpMip->height, lpMip->offsets[0], lpMip->offsets[1], lpMip->offsets[2], lpMip->offsets[3], numPixels); + //for (i = 0; i < sizeof(*lpMip); i++) + // Sys_Printf("%02x", (int) ((unsigned char *)lpMip)[i]); + + bmpRGBA = reinterpret_cast < unsigned char *>(g_malloc (numPixels * 4)); + *pic = bmpRGBA; + pixbuf = bmpRGBA; + + for (i = 0; i < numPixels; i++) + { + int palIndex = *buf_p++; + *pixbuf++ = palette[palIndex*3]; + *pixbuf++ = palette[palIndex*3+1]; + *pixbuf++ = palette[palIndex*3+2]; + *pixbuf++ = 0xff; + } + + vfsFreeFile (buffer); + if (loadedpalette != NULL) + vfsFreeFile (loadedpalette); +} +#endif + +/* +================= +LoadImage + +Loads any of the supported image types into a cannonical +32 bit format. +================= +*/ +void LoadImage (const char *name, byte ** pic, int *width, int *height) +{ + int len; + *pic = NULL; + *width = 0; + *height = 0; + + len = strlen (name); + if (len < 5) + { + return; + } + +#ifdef USE_HLW + if (*pic == NULL && !g_strcasecmp (name + len - 4, ".hlw")) + { + LoadHLW (name, pic, width, height); + } +#endif + +#ifdef USE_MIP + if (*pic == NULL && !g_strcasecmp (name + len - 4, ".mip")) + { + LoadMIP (name, pic, width, height); + } +#endif + +#ifdef USE_IDSP + if (*pic == NULL && !g_strcasecmp (name + len - 4, ".spr")) + { + LoadIDSP (name, pic, width, height); + } +#endif +} diff --git a/radiant/autosave.h b/plugins/imagehl/lbmlib.h similarity index 68% rename from radiant/autosave.h rename to plugins/imagehl/lbmlib.h index 730ef2e1..c50318bf 100644 --- a/radiant/autosave.h +++ b/plugins/imagehl/lbmlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,17 +19,17 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_AUTOSAVE_H) -#define INCLUDED_AUTOSAVE_H - -extern bool g_SnapShots_Enabled; - -void AutoSave_clear(); -void QE_CheckAutoSave( void ); -void Map_Snapshot(); - -void Autosave_Construct(); -void Autosave_Destroy(); - +// lbmlib.h +#ifdef __linux__ +#define WINAPI #endif + +typedef unsigned char byte; + +#ifdef USE_TARGA +void LoadTGA (char *filename, byte **pixels, int *width, int *height); +#endif + +// LoadImage will rely on file extension to call LoadTGA loadHLW +void LoadImage( const char *name, byte **pic, int *width, int *height ); diff --git a/plugins/imagehl/mip.cpp b/plugins/imagehl/mip.cpp deleted file mode 100644 index f2271425..00000000 --- a/plugins/imagehl/mip.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mip.h" - -#include -#include -#include - -typedef unsigned char byte; - -#include "ifilesystem.h" - -#include "imagelib.h" -#include "bytestreamutils.h" - -/* -============================================================================ - -MIP IMAGE - - Quake WAD files contain miptex files that look like this: - - Mip section - First mip - Mip header - First mip (width * height) - Second mip (width * height / 4) - Third mip (width * height / 16) - Fourth mip (width * height / 64) - -============================================================================ -*/ - -#define GET_MIP_DATA_SIZE(WIDTH, HEIGHT) (sizeof(WAD3_MIP) + (WIDTH * HEIGHT) + (WIDTH * HEIGHT / 4) + (WIDTH * HEIGHT / 16) + (WIDTH * HEIGHT / 64)) - -const int MIP_NAME_LENGTH = 16; -const int MIP_MIPMAP_COUNT = 4; -typedef struct -{ - char name[MIP_NAME_LENGTH]; - unsigned int width, height; - unsigned int offsets[MIP_MIPMAP_COUNT]; // four mip maps stored -} WAD3_MIP, *LPWAD3_MIP; - -static const byte quakepalette[768] = -{ - 0x00,0x00,0x00, 0x0f,0x0f,0x0f, 0x1f,0x1f,0x1f, 0x2f,0x2f,0x2f, - 0x3f,0x3f,0x3f, 0x4b,0x4b,0x4b, 0x5b,0x5b,0x5b, 0x6b,0x6b,0x6b, - 0x7b,0x7b,0x7b, 0x8b,0x8b,0x8b, 0x9b,0x9b,0x9b, 0xab,0xab,0xab, - 0xbb,0xbb,0xbb, 0xcb,0xcb,0xcb, 0xdb,0xdb,0xdb, 0xeb,0xeb,0xeb, - 0x0f,0x0b,0x07, 0x17,0x0f,0x0b, 0x1f,0x17,0x0b, 0x27,0x1b,0x0f, - 0x2f,0x23,0x13, 0x37,0x2b,0x17, 0x3f,0x2f,0x17, 0x4b,0x37,0x1b, - 0x53,0x3b,0x1b, 0x5b,0x43,0x1f, 0x63,0x4b,0x1f, 0x6b,0x53,0x1f, - 0x73,0x57,0x1f, 0x7b,0x5f,0x23, 0x83,0x67,0x23, 0x8f,0x6f,0x23, - 0x0b,0x0b,0x0f, 0x13,0x13,0x1b, 0x1b,0x1b,0x27, 0x27,0x27,0x33, - 0x2f,0x2f,0x3f, 0x37,0x37,0x4b, 0x3f,0x3f,0x57, 0x47,0x47,0x67, - 0x4f,0x4f,0x73, 0x5b,0x5b,0x7f, 0x63,0x63,0x8b, 0x6b,0x6b,0x97, - 0x73,0x73,0xa3, 0x7b,0x7b,0xaf, 0x83,0x83,0xbb, 0x8b,0x8b,0xcb, - 0x00,0x00,0x00, 0x07,0x07,0x00, 0x0b,0x0b,0x00, 0x13,0x13,0x00, - 0x1b,0x1b,0x00, 0x23,0x23,0x00, 0x2b,0x2b,0x07, 0x2f,0x2f,0x07, - 0x37,0x37,0x07, 0x3f,0x3f,0x07, 0x47,0x47,0x07, 0x4b,0x4b,0x0b, - 0x53,0x53,0x0b, 0x5b,0x5b,0x0b, 0x63,0x63,0x0b, 0x6b,0x6b,0x0f, - 0x07,0x00,0x00, 0x0f,0x00,0x00, 0x17,0x00,0x00, 0x1f,0x00,0x00, - 0x27,0x00,0x00, 0x2f,0x00,0x00, 0x37,0x00,0x00, 0x3f,0x00,0x00, - 0x47,0x00,0x00, 0x4f,0x00,0x00, 0x57,0x00,0x00, 0x5f,0x00,0x00, - 0x67,0x00,0x00, 0x6f,0x00,0x00, 0x77,0x00,0x00, 0x7f,0x00,0x00, - 0x13,0x13,0x00, 0x1b,0x1b,0x00, 0x23,0x23,0x00, 0x2f,0x2b,0x00, - 0x37,0x2f,0x00, 0x43,0x37,0x00, 0x4b,0x3b,0x07, 0x57,0x43,0x07, - 0x5f,0x47,0x07, 0x6b,0x4b,0x0b, 0x77,0x53,0x0f, 0x83,0x57,0x13, - 0x8b,0x5b,0x13, 0x97,0x5f,0x1b, 0xa3,0x63,0x1f, 0xaf,0x67,0x23, - 0x23,0x13,0x07, 0x2f,0x17,0x0b, 0x3b,0x1f,0x0f, 0x4b,0x23,0x13, - 0x57,0x2b,0x17, 0x63,0x2f,0x1f, 0x73,0x37,0x23, 0x7f,0x3b,0x2b, - 0x8f,0x43,0x33, 0x9f,0x4f,0x33, 0xaf,0x63,0x2f, 0xbf,0x77,0x2f, - 0xcf,0x8f,0x2b, 0xdf,0xab,0x27, 0xef,0xcb,0x1f, 0xff,0xf3,0x1b, - 0x0b,0x07,0x00, 0x1b,0x13,0x00, 0x2b,0x23,0x0f, 0x37,0x2b,0x13, - 0x47,0x33,0x1b, 0x53,0x37,0x23, 0x63,0x3f,0x2b, 0x6f,0x47,0x33, - 0x7f,0x53,0x3f, 0x8b,0x5f,0x47, 0x9b,0x6b,0x53, 0xa7,0x7b,0x5f, - 0xb7,0x87,0x6b, 0xc3,0x93,0x7b, 0xd3,0xa3,0x8b, 0xe3,0xb3,0x97, - 0xab,0x8b,0xa3, 0x9f,0x7f,0x97, 0x93,0x73,0x87, 0x8b,0x67,0x7b, - 0x7f,0x5b,0x6f, 0x77,0x53,0x63, 0x6b,0x4b,0x57, 0x5f,0x3f,0x4b, - 0x57,0x37,0x43, 0x4b,0x2f,0x37, 0x43,0x27,0x2f, 0x37,0x1f,0x23, - 0x2b,0x17,0x1b, 0x23,0x13,0x13, 0x17,0x0b,0x0b, 0x0f,0x07,0x07, - 0xbb,0x73,0x9f, 0xaf,0x6b,0x8f, 0xa3,0x5f,0x83, 0x97,0x57,0x77, - 0x8b,0x4f,0x6b, 0x7f,0x4b,0x5f, 0x73,0x43,0x53, 0x6b,0x3b,0x4b, - 0x5f,0x33,0x3f, 0x53,0x2b,0x37, 0x47,0x23,0x2b, 0x3b,0x1f,0x23, - 0x2f,0x17,0x1b, 0x23,0x13,0x13, 0x17,0x0b,0x0b, 0x0f,0x07,0x07, - 0xdb,0xc3,0xbb, 0xcb,0xb3,0xa7, 0xbf,0xa3,0x9b, 0xaf,0x97,0x8b, - 0xa3,0x87,0x7b, 0x97,0x7b,0x6f, 0x87,0x6f,0x5f, 0x7b,0x63,0x53, - 0x6b,0x57,0x47, 0x5f,0x4b,0x3b, 0x53,0x3f,0x33, 0x43,0x33,0x27, - 0x37,0x2b,0x1f, 0x27,0x1f,0x17, 0x1b,0x13,0x0f, 0x0f,0x0b,0x07, - 0x6f,0x83,0x7b, 0x67,0x7b,0x6f, 0x5f,0x73,0x67, 0x57,0x6b,0x5f, - 0x4f,0x63,0x57, 0x47,0x5b,0x4f, 0x3f,0x53,0x47, 0x37,0x4b,0x3f, - 0x2f,0x43,0x37, 0x2b,0x3b,0x2f, 0x23,0x33,0x27, 0x1f,0x2b,0x1f, - 0x17,0x23,0x17, 0x0f,0x1b,0x13, 0x0b,0x13,0x0b, 0x07,0x0b,0x07, - 0xff,0xf3,0x1b, 0xef,0xdf,0x17, 0xdb,0xcb,0x13, 0xcb,0xb7,0x0f, - 0xbb,0xa7,0x0f, 0xab,0x97,0x0b, 0x9b,0x83,0x07, 0x8b,0x73,0x07, - 0x7b,0x63,0x07, 0x6b,0x53,0x00, 0x5b,0x47,0x00, 0x4b,0x37,0x00, - 0x3b,0x2b,0x00, 0x2b,0x1f,0x00, 0x1b,0x0f,0x00, 0x0b,0x07,0x00, - 0x00,0x00,0xff, 0x0b,0x0b,0xef, 0x13,0x13,0xdf, 0x1b,0x1b,0xcf, - 0x23,0x23,0xbf, 0x2b,0x2b,0xaf, 0x2f,0x2f,0x9f, 0x2f,0x2f,0x8f, - 0x2f,0x2f,0x7f, 0x2f,0x2f,0x6f, 0x2f,0x2f,0x5f, 0x2b,0x2b,0x4f, - 0x23,0x23,0x3f, 0x1b,0x1b,0x2f, 0x13,0x13,0x1f, 0x0b,0x0b,0x0f, - 0x2b,0x00,0x00, 0x3b,0x00,0x00, 0x4b,0x07,0x00, 0x5f,0x07,0x00, - 0x6f,0x0f,0x00, 0x7f,0x17,0x07, 0x93,0x1f,0x07, 0xa3,0x27,0x0b, - 0xb7,0x33,0x0f, 0xc3,0x4b,0x1b, 0xcf,0x63,0x2b, 0xdb,0x7f,0x3b, - 0xe3,0x97,0x4f, 0xe7,0xab,0x5f, 0xef,0xbf,0x77, 0xf7,0xd3,0x8b, - 0xa7,0x7b,0x3b, 0xb7,0x9b,0x37, 0xc7,0xc3,0x37, 0xe7,0xe3,0x57, - 0x7f,0xbf,0xff, 0xab,0xe7,0xff, 0xd7,0xff,0xff, 0x67,0x00,0x00, - 0x8b,0x00,0x00, 0xb3,0x00,0x00, 0xd7,0x00,0x00, 0xff,0x00,0x00, - 0xff,0xf3,0x93, 0xff,0xf7,0xc7, 0xff,0xff,0xff, 0x9f,0x5b,0x53 -}; - -/* -============= -LoadMIP -============= -*/ - -Image* LoadMIPBuff(byte* buffer) -{ - byte *buf_p; - int palettelength; - unsigned long mipdatasize; - int columns, rows, numPixels; - byte *pixbuf; - int i; - byte *loadedpalette; - const byte *palette; - - loadedpalette = 0; - - PointerInputStream inputStream(buffer); - - inputStream.seek(MIP_NAME_LENGTH); - columns = istream_read_int32_le(inputStream); - rows = istream_read_int32_le(inputStream); - int offset = istream_read_int32_le(inputStream); - - if(std::size_t(columns) > 65536 && std::size_t(rows) > 65536) - { - return 0; - } - - mipdatasize = GET_MIP_DATA_SIZE(columns, rows); - - palettelength = vfsLoadFile ("gfx/palette.lmp", (void **) &loadedpalette); - if (palettelength == 768) - palette = loadedpalette; - else - { - loadedpalette = 0; - palette = quakepalette; - } - - buf_p = buffer + offset; - - numPixels = columns * rows; - - RGBAImage* image = new RGBAImage(columns, rows); - - //Sys_Printf("lpMip->width = %i, lpMip->height = %i, lpMip->offsets[0] = %i, lpMip->offsets[1] = %i, lpMip->offsets[2] = %i, lpMip->offsets[3] = %i, numPixels = %i\n", lpMip->width, lpMip->height, lpMip->offsets[0], lpMip->offsets[1], lpMip->offsets[2], lpMip->offsets[3], numPixels); - //for (i = 0; i < sizeof(*lpMip); i++) - // Sys_Printf("%02x", (int) ((unsigned char *)lpMip)[i]); - - pixbuf = image->getRGBAPixels(); - - for (i = 0; i < numPixels; i++) - { - int palIndex = *buf_p++; - *pixbuf++ = palette[palIndex*3]; - *pixbuf++ = palette[palIndex*3+1]; - *pixbuf++ = palette[palIndex*3+2]; - *pixbuf++ = 0xff; - } - - if (loadedpalette != 0) - vfsFreeFile(loadedpalette); - - return image; -} - -Image* LoadMIP(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadMIPBuff( buffer.buffer ); -} diff --git a/plugins/imagehl/sprite.cpp b/plugins/imagehl/sprite.cpp deleted file mode 100644 index 8b806f37..00000000 --- a/plugins/imagehl/sprite.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -// by Hydra - hydra@hydras-world.com - -#include "sprite.h" - -#include -#include -#include - -typedef unsigned char byte; - -#include "ifilesystem.h" - -#include "imagelib.h" - -/* -============================================================================ - -IDSP IMAGE (.spr files) - -Some code copied straight from the Q1 source, also used the HalfLife SDK as -a reference. - -============================================================================ -*/ - -typedef enum {ST_SYNC=0, ST_RAND } synctype_t; -typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t; - -typedef struct dspriteheader_s { - int ident; - int version; -} dspriteheader_t; - -// Quake1 -typedef struct { - int type; - float boundingradius; - int width; - int height; - int numframes; - float beamlength; - synctype_t synctype; -} dspritev1_t; - -// Halflife -typedef struct { - int type; - int texFormat; - float boundingradius; - int width; - int height; - int numframes; - float beamlength; - synctype_t synctype; -} dspritev2_t; - -typedef struct { - int origin[2]; - int width; - int height; -} dspriteframe_t; - -typedef struct { - short type; -} dspriteframetype_t; - -/* -typedef struct { - byte rgb[256][3]; -} dpalette_t; -*/ - -#define IDSPRITEHEADER (('P'<<24)+('S'<<16)+('D'<<8)+'I') - // little-endian "IDSP" - -/* -============= -LoadIDSP -============= -*/ - -Image* LoadIDSPBuff(byte *buffer) -{ - byte *buf_p; - int columns, rows, numPixels; - byte *pixbuf; - - int row, column; - byte *palette; - unsigned char red, green, blue, alphabyte; - - dspriteheader_t *header; - dspritev1_t *pinv1; - dspritev2_t *pinv2; - dspriteframetype_t *pframetype; - int version; - int numframes; - dspriteframe_t *spriteframe; - - header = (dspriteheader_t *)buffer; - - if (header->ident != IDSPRITEHEADER) - { - globalErrorStream() << "WARNING: IDSP file has wrong header\n"; - return 0; - } - - version = header->version; - if (version != 1 && version != 2 ) - { - globalErrorStream() << "WARNING: IDSP file has wrong version number " - "(" << version << " should be 1 or 2)\n"; - return 0; - } - - // initialise variables depending on the sprite version. - switch (version) - { - case 1: - pinv1 = (dspritev1_t *)(header+1); - numframes = pinv1->numframes; - columns = pinv1->width; - rows = pinv1->height; - pframetype = (dspriteframetype_t *)(pinv1 + 1); - break; - case 2: - pinv2 = (dspritev2_t *)(header+1); - numframes = pinv2->numframes; - columns = pinv2->width; - rows = pinv2->height; - pframetype = (dspriteframetype_t *)(pinv2 + 1); - break; - default: - globalErrorStream() << "WARNING: IDSP file has unsupported version\n"; - return 0; - } - if (numframes > 1) - globalErrorStream() << "WARNING: IDSP file has multiple frames, only the first frame will be used.\n"; - - // palette = buffer+mipdatasize+2; - // buf_p = buffer+lpMip->offsets[0]; - - numPixels = columns * rows; - - RGBAImage* image = new RGBAImage(columns, rows); - -#ifdef DEBUG - frametype = spriteframetype_t(pframetype->type); - if (frametype == SPR_SINGLE) - { - globalOutputStream() << "Single Frame\n"; - } - else if (frametype == SPR_GROUP) - { - globalOutputStream() << "Group of Frames\n"; - } - else - { - globalOutputStream() << "Bleh!\n"; // <-- we always get this, wtf! - } -#endif - - palette = (byte *)(pframetype+1); - spriteframe = (dspriteframe_t *)(palette + (256*3) + 4); // what are those 4 extra bytes ? what's missing ? - buf_p = (byte *)(spriteframe + 1); - - for (row = 0; row < rows; row++) - { - pixbuf = image->getRGBAPixels() + row * columns * 4; - - for (column = 0; column < columns; column++) - { - int palIndex; - - palIndex = *buf_p++; - - red = *(palette+(palIndex*3)); - green = *(palette+(palIndex*3)+1); - blue = *(palette+(palIndex*3)+2); - - // HalfLife engine makes pixels that are BLUE transparent. (RGB = 0x0000FF) - // So show them that way in the editor. - if (blue == 0xff && red == 0x00 && green == 0x00) - { - alphabyte = 0xff; //FIXME: backwards? (so sprite models to render correctly) - blue = 0x00; // don't set the resulting pixel to blue - } - else - { - alphabyte = 0x00; //FIXME: backwards? (so sprite models to render correctly) - } - - *pixbuf++ = red; - *pixbuf++ = green; - *pixbuf++ = blue; - - *pixbuf++ = alphabyte; - } - } - - return image; -} - -Image* LoadIDSP(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadIDSPBuff( buffer.buffer ); -} diff --git a/plugins/imagem8/imagem8.cpp b/plugins/imagem8/imagem8.cpp new file mode 100644 index 00000000..7d318593 --- /dev/null +++ b/plugins/imagem8/imagem8.cpp @@ -0,0 +1,128 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// Image loading plugin +// +// Leonardo Zide (leo@lokigames.com) +// + +#include +#include "imagem8.h" + +// ============================================================================= +// global tables + +_QERFuncTable_1 g_FuncTable; // Radiant function table +_QERFileSystemTable g_FileSystemTable; + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientImage g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(IMAGE_MAJOR, "m8", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(IMAGE_MAJOR, "m32", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + + Syn_Printf("Dynamic APIs for client '%s'\n", g_SynapseClient.GetInfo()); + if (!g_pSynapseServer->SelectClientConfig(g_SynapseClient.GetName())) + { + Syn_Printf("ERROR: Failed to select synapse client config in '%s'\n", g_SynapseClient.GetInfo()); + return NULL; + } + char *api, *minor; + while(g_pSynapseServer->GetNextConfig(&api, &minor)) + { + Syn_Printf("api: '%s' minor: '%s'\n", api, minor); + if (!strcmp(api, VFS_MAJOR)) + { + g_SynapseClient.AddAPI(VFS_MAJOR, minor, sizeof(_QERFileSystemTable), SYN_REQUIRE, &g_FileSystemTable); + } + else + { + Syn_Printf("WARNING: unknown API node '%s' in synapse config from module '%s'\n", api, g_SynapseClient.GetInfo()); + } + } + return &g_SynapseClient; +} + +bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, IMAGE_MAJOR )) + { + _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "m8")) + { + pTable->m_pfnLoadImage = &LoadM8; + return true; + } + if (!strcmp(pAPI->minor_name, "m32")) + { + pTable->m_pfnLoadImage = &LoadM32; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +bool CSynapseClientImage::OnActivate() { + if (!g_FileSystemTable.m_nSize) { + Syn_Printf("ERROR: VFS_MAJOR table was not initialized before OnActivate in '%s' - incomplete synapse.config?\n", GetInfo()); + return false; + } + return true; +} + +#include "version.h" + +const char* CSynapseClientImage::GetInfo() +{ + return "M8 M32 formats module built " __DATE__ " " RADIANT_VERSION; +} diff --git a/plugins/imagem8/imagem8.def b/plugins/imagem8/imagem8.def new file mode 100644 index 00000000..74739a05 --- /dev/null +++ b/plugins/imagem8/imagem8.def @@ -0,0 +1,8 @@ +; imagem8.def : Declares the module parameters for the DLL. + +LIBRARY "ImageM8" +DESCRIPTION 'ImageM8 Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/imagem8/imagem8.h b/plugins/imagem8/imagem8.h new file mode 100644 index 00000000..2ba99e89 --- /dev/null +++ b/plugins/imagem8/imagem8.h @@ -0,0 +1,70 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _IMAGEM8_H_ +#define _IMAGEM8_H_ + +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" +#include "iimage.h" + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +extern _QERFuncTable_1 g_FuncTable; +extern _QERFileSystemTable g_FileSystemTable; +void LoadM8 (const char *name, unsigned char **pic, int *width, int *height); +void LoadM32 (const char *name, unsigned char **pic, int *width, int *height); + +#define Error g_FuncTable.m_pfnError +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile +#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile + +class CSynapseClientImage : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + bool OnActivate(); + const char* GetName() { return "image"; } + + CSynapseClientImage() { } + virtual ~CSynapseClientImage() { } +}; + +#endif // _IMAGEM8_H_ diff --git a/plugins/imagem8/imagem8.vcproj b/plugins/imagem8/imagem8.vcproj new file mode 100644 index 00000000..a0f2bcf2 --- /dev/null +++ b/plugins/imagem8/imagem8.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/imagem8/m32.cpp b/plugins/imagem8/m32.cpp new file mode 100644 index 00000000..5bbe616e --- /dev/null +++ b/plugins/imagem8/m32.cpp @@ -0,0 +1,77 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include "m32.h" + +void LoadM32(const char *name, unsigned char **pic, int *width, int *height) +{ + FILE *f; + m32_header_t *m32_header; + //rgb_t *palette; + int i, num_pixels, size; + char text_buf[255]; + unsigned int length; + unsigned char *palette_ent, *buf_temp; + unsigned char *buffer, *m32_file_buffer; + + // open file + if ( length = vfsLoadFile ((char *) name, (void **) &m32_file_buffer, 0) == (unsigned int) -1) + { + Sys_Printf("Unable to open file %s\n",name); + return; + } + + m32_header = (m32_header_t *)m32_file_buffer; + + // make sure we have a valid bitmap file + if ( m32_header->version != M32_VERSION) + { + vfsFreeFile(m32_file_buffer); + Sys_Printf("Invalid M32 file %s\n", name); + } + + // Get M32 Info + *width = m32_header->width[0]; // Only interested in 1st MIP + *height = m32_header->height[0]; + num_pixels = (*width) * (*height); + size = num_pixels*4; + + // Allocate buffer + buf_temp = (unsigned char *)(g_malloc(size)); + *pic = buf_temp; + + // Image data + buffer = m32_file_buffer + m32_header->offsets[0]; + + + // Load texture into buffer + palette_ent = buffer; + for(i=0; i +#include +#include +#include "m8.h" + +void LoadM8(const char *name, unsigned char **pic, int *width, int *height) +{ + FILE *f; + m8_header_t *m8_header; + rgb_t *palette; + int i, num_pixels, size; + char text_buf[255] = { 0 }; + char *text_dot_pos; + unsigned int length; + unsigned char *palette_ent, *buf_temp; + unsigned char *buffer, *m8_file_buffer; + + strcpy(text_buf, name); + text_dot_pos = strchr(text_buf, '.'); + if (text_dot_pos) + *text_dot_pos = 0; + // Fix for .pcx.m8 extention + strcat(text_buf, ".pcx.m8"); + + // open file + if ( length = vfsLoadFile ((char *) text_buf, (void **) &m8_file_buffer, 0) == (unsigned int) -1) + { + strcpy(text_buf, name); + for(i=(strlen(text_buf)-1); i>0; i--) + { + if(text_buf[i]=='.') + { + text_buf[i]=0; + break; + } + } + strcat(text_buf, ".m8"); + if ( length = vfsLoadFile ((char *) text_buf, (void **) &m8_file_buffer, 0) == (unsigned int) -1) + { + Sys_Printf("Unable to open file %s\n",name); + return; + } + } + + m8_header = (m8_header_t *)m8_file_buffer; + + // make sure we have a valid M8 file + if ( m8_header->version != M8_VERSION) + { + vfsFreeFile(m8_file_buffer); + Sys_Printf("Invalid M8 file %s\n", name); + return; + } + + // Get M8 Info + *width = m8_header->width[0]; // Only interested in 1st MIP + *height = m8_header->height[0]; + num_pixels = (*width) * (*height); + size = num_pixels*4; + + // Allocate buffer + buf_temp = (unsigned char *)(g_malloc(size)); + *pic = buf_temp; + + // Load Palette + palette = m8_header->palette; + + // Image data + buffer = m8_file_buffer + m8_header->offsets[0]; + + + // Load texture into buffer + palette_ent = buffer; + for(i=0; i - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/imagepng/plugin.cpp b/plugins/imagepng/plugin.cpp index 426c4f06..fc797b30 100644 --- a/plugins/imagepng/plugin.cpp +++ b/plugins/imagepng/plugin.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,28 +19,101 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +// ============================================================================= +// global tables + #include "plugin.h" -#include "debugging/debugging.h" +_QERFuncTable_1 g_FuncTable; +_QERFileSystemTable g_FileSystemTable; + +// ============================================================================= +// SYNAPSE + +#include "synapse.h" + +class CSynapseClientImage : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientImage() { } + virtual ~CSynapseClientImage() { } +}; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientImage g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(IMAGE_MAJOR, "png", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + // NOTE: if imagepng starts being used for non "VFS" "pk3" config, need to add a dynamic config chunk + // see: + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=794 + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=800 + g_SynapseClient.AddAPI(VFS_MAJOR, "pk3", sizeof(_QERFileSystemTable), SYN_REQUIRE, &g_FileSystemTable); + + return &g_SynapseClient; +} + +bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, IMAGE_MAJOR)) + { + _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "png")) + { + pTable->m_pfnLoadImage = &LoadImage; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientImage::GetInfo() +{ + return "PNG loader module built " __DATE__ " " RADIANT_VERSION; +} -#include "ifilesystem.h" -#include "iimage.h" -#include "imagelib.h" // ====== PNG loader functionality ====== #include "png.h" + +#ifdef __APPLE__ //tigital #include +#endif void user_warning_fn(png_structp png_ptr, png_const_charp warning_msg) { - globalErrorStream() << "libpng warning: " << warning_msg << "\n"; + g_FuncTable.m_pfnSysPrintf ("libpng warning: %s\n", warning_msg); } void user_error_fn(png_structp png_ptr, png_const_charp error_msg) { - globalErrorStream() << "libpng error: " << error_msg << "\n"; + g_FuncTable.m_pfnSysPrintf ("libpng error: %s\n", error_msg); longjmp(png_ptr->jmpbuf, 0); } @@ -51,39 +124,44 @@ void user_read_data(png_structp png_ptr, png_bytep data, png_uint_32 length) *p_p_fbuffer += length; } -Image* LoadPNGBuff (unsigned char* fbuffer) +void LoadImage (const char *filename, unsigned char **pic, int *width, int *height) { png_byte** row_pointers; + unsigned char *fbuffer = NULL; png_bytep p_fbuffer; + int nLen = g_FileSystemTable.m_pfnLoadFile( (char *)filename, (void **)&fbuffer, 0 ); + if (nLen == -1) + return; + p_fbuffer = fbuffer; // the reading glue // http://www.libpng.org/pub/png/libpng-manual.html png_structp png_ptr = png_create_read_struct - (PNG_LIBPNG_VER_STRING, (png_voidp)NULL, + (PNG_LIBPNG_VER_STRING, png_voidp_NULL, user_error_fn, user_warning_fn); if (!png_ptr) { - globalErrorStream() << "libpng error: png_create_read_struct\n"; - return 0; + g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_read_struct\n"); + return; } png_infop info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { png_destroy_read_struct(&png_ptr, - (png_infopp)NULL, (png_infopp)NULL); - globalErrorStream() << "libpng error: png_create_info_struct (info_ptr)\n"; - return 0; + png_infopp_NULL, png_infopp_NULL); + g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_info_struct (info_ptr)\n"); + return; } png_infop end_info = png_create_info_struct(png_ptr); if (!end_info) { png_destroy_read_struct(&png_ptr, &info_ptr, - (png_infopp)NULL); - globalErrorStream() << "libpng error: png_create_info_struct (end_info)\n"; - return 0; + png_infopp_NULL); + g_FuncTable.m_pfnSysPrintf ("libpng error: png_create_info_struct (end_info)\n"); + return; } // configure the read function @@ -92,7 +170,12 @@ Image* LoadPNGBuff (unsigned char* fbuffer) if (setjmp(png_ptr->jmpbuf)) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - return 0; + if (*pic) + { + g_free(*pic); + free(row_pointers); + } + return; } png_read_info(png_ptr, info_ptr); @@ -134,17 +217,19 @@ Image* LoadPNGBuff (unsigned char* fbuffer) color_type = png_get_color_type(png_ptr, info_ptr); bit_depth = png_get_bit_depth(png_ptr, info_ptr); - int width = png_get_image_width(png_ptr, info_ptr); - int height = png_get_image_height(png_ptr, info_ptr); + *width = png_get_image_width(png_ptr, info_ptr); + *height = png_get_image_height(png_ptr, info_ptr); // allocate the pixel buffer, and the row pointers - RGBAImage* image = new RGBAImage(width, height); - - row_pointers = (png_byte**) malloc((height) * sizeof(png_byte*)); + int size = (*width)*(*height)*4; + // still have to use that g_malloc heresy + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=491 + *pic = (unsigned char *)g_malloc(size); + row_pointers = (png_byte**) malloc((*height) * sizeof(png_byte*)); int i; - for(i = 0; i < (height); i++) - row_pointers[i] = (png_byte*)(image->getRGBAPixels()) + i * 4 * (width); + for(i = 0; i < (*height); i++) + row_pointers[i] = (png_byte*)(*pic) + i * 4 * (*width); // actual read png_read_image(png_ptr, row_pointers); @@ -156,49 +241,5 @@ Image* LoadPNGBuff (unsigned char* fbuffer) png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); free(row_pointers); - - return image; -} - -Image* LoadPNG(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadPNGBuff( buffer.buffer ); -} - - -#include "modulesystem/singletonmodule.h" - - -class ImageDependencies : public GlobalFileSystemModuleRef -{ -}; - -class ImagePNGAPI -{ - _QERPlugImageTable m_imagepng; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "png"); - - ImagePNGAPI() - { - m_imagepng.loadImage = LoadPNG; - } - _QERPlugImageTable* getTable() - { - return &m_imagepng; - } -}; - -typedef SingletonModule ImagePNGModule; - -ImagePNGModule g_ImagePNGModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ImagePNGModule.selfRegister(); + g_FileSystemTable.m_pfnFreeFile (fbuffer); } diff --git a/plugins/imagepng/plugin.h b/plugins/imagepng/plugin.h index c12a92f5..c52b50bb 100644 --- a/plugins/imagepng/plugin.h +++ b/plugins/imagepng/plugin.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ -#endif +#include "qerplugin.h" +#include "iimage.h" +#include "ifilesystem.h" + +void LoadImage (const char *filename, unsigned char **pic, int *width, int *height); + +#endif // _PLUGIN_H_ diff --git a/plugins/imageq2/imageq2.cpp b/plugins/imageq2/imageq2.cpp deleted file mode 100644 index dfd64467..00000000 --- a/plugins/imageq2/imageq2.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "imageq2.h" - -#include "debugging/debugging.h" -#include "ifilesystem.h" -#include "iimage.h" - -#include "wal.h" -#include "wal32.h" - -#include "modulesystem/singletonmodule.h" - - -class ImageDependencies : public GlobalFileSystemModuleRef -{ -}; - -class ImageWalAPI -{ - _QERPlugImageTable m_imagewal; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "wal"); - - ImageWalAPI() - { - m_imagewal.loadImage = LoadWal; - } - _QERPlugImageTable* getTable() - { - return &m_imagewal; - } -}; - -typedef SingletonModule ImageWalModule; - -ImageWalModule g_ImageWalModule; - -//////////////////////////////////////////////////// - -class ImageM8API -{ - _QERPlugImageTable m_imagem8; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "m8"); - - ImageM8API() - { - m_imagem8.loadImage = LoadM8; - } - _QERPlugImageTable* getTable() - { - return &m_imagem8; - } -}; - -typedef SingletonModule ImageM8Module; - -ImageM8Module g_ImageM8Module; - -//////////////////////////////////////////////////////// - -class ImageM32API -{ - _QERPlugImageTable m_imagem32; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "m32"); - - ImageM32API() - { - m_imagem32.loadImage = LoadM32; - } - _QERPlugImageTable* getTable() - { - return &m_imagem32; - } -}; - -typedef SingletonModule ImageM32Module; - -ImageM32Module g_ImageM32Module; - -//////////////////////////////////////////////////////// - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ImageWalModule.selfRegister(); - g_ImageM8Module.selfRegister(); - g_ImageM32Module.selfRegister(); -} diff --git a/plugins/imageq2/imageq2.def b/plugins/imageq2/imageq2.def deleted file mode 100644 index 8ff29a17..00000000 --- a/plugins/imageq2/imageq2.def +++ /dev/null @@ -1,7 +0,0 @@ -; imageq2.def : Declares the module parameters for the DLL. - -LIBRARY "ImageQ2" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/imageq2/imageq2.h b/plugins/imageq2/imageq2.h deleted file mode 100644 index d9694b48..00000000 --- a/plugins/imageq2/imageq2.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IMAGEQ2_H) -#define INCLUDED_IMAGEQ2_H - -#endif diff --git a/plugins/imageq2/imageq2.vcproj b/plugins/imageq2/imageq2.vcproj deleted file mode 100644 index 34d176ee..00000000 --- a/plugins/imageq2/imageq2.vcproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/imageq2/wal.cpp b/plugins/imageq2/wal.cpp deleted file mode 100644 index 3664de78..00000000 --- a/plugins/imageq2/wal.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "wal.h" - -#include "ifilesystem.h" - -#include "os/path.h" -#include "stream/stringstream.h" -#include "bytestreamutils.h" -#include "imagelib.h" - -#define QUAKE2_WAL 0 -#define HERETIC2_M8 1 - -typedef unsigned char byte; - -struct pcx_header_t -{ - char manufacturer; - char version; - char encoding; - char bits_per_pixel; -}; - -void LoadPCXPalette(const char *filename, byte palette[768]) -{ - byte* buffer; - int length = vfsLoadFile (filename, (void **)&buffer); - if(buffer == 0) - return; - - const pcx_header_t* pcx = reinterpret_cast(buffer); - - if (pcx->manufacturer != 0x0a - || pcx->version != 5 - || pcx->encoding != 1 - || pcx->bits_per_pixel != 8) - return; - - memcpy(palette, buffer + length - 768, 768); - - vfsFreeFile(buffer); -} - -const int WAL_NAME_LENGTH = 32; -const int WAL_MIPMAP_COUNT = 4; -struct wal_header_t -{ - char name[WAL_NAME_LENGTH]; - unsigned width, height; - unsigned offsets[WAL_MIPMAP_COUNT]; // four mip maps stored - char animname[WAL_NAME_LENGTH]; // next frame in animation chain - int flags; - int contents; - int value; -}; - -const int M8_NAME_LENGTH = 32; -const int M8_MIPMAP_COUNT = 16; -struct m8_header_t -{ - int version; - char name[M8_NAME_LENGTH]; - unsigned width[M8_MIPMAP_COUNT], height[M8_MIPMAP_COUNT]; // width and height of each mipmap - unsigned offsets[M8_MIPMAP_COUNT]; // 16 mip maps stored - char animname[M8_NAME_LENGTH]; // next frame in animation chain - byte palette[768]; // palette stored in m8 - int flags; - int contents; - int value; -}; - -Image* LoadMipTex(byte* buffer, byte TypeofTex) -{ - int w, h, offset, flags, contents, value; - byte palette[768]; - byte* source; - - PointerInputStream inputStream(buffer); - - if ( TypeofTex == HERETIC2_M8 ) - { - inputStream.seek(4 + M8_NAME_LENGTH); // version, name - w = istream_read_int32_le(inputStream); - inputStream.seek(4 * (M8_MIPMAP_COUNT - 1)); // remaining widths - h = istream_read_int32_le(inputStream); - inputStream.seek(4 * (M8_MIPMAP_COUNT - 1)); // remaining heights - offset = istream_read_int32_le(inputStream); - inputStream.seek(4 * (M8_MIPMAP_COUNT - 1)); // remaining offsets - inputStream.seek(M8_NAME_LENGTH); // animname - inputStream.read(palette, 768); - flags = istream_read_int32_le(inputStream); - contents = istream_read_int32_le(inputStream); - value = istream_read_int32_le(inputStream); - source = buffer + offset; - } - else - { - LoadPCXPalette("pics/colormap.pcx", palette); - - inputStream.seek(WAL_NAME_LENGTH); // name - w = istream_read_int32_le(inputStream); - h = istream_read_int32_le(inputStream); - offset = istream_read_int32_le(inputStream); - inputStream.seek(4 * (WAL_MIPMAP_COUNT - 1)); // remaining offsets - inputStream.seek(WAL_NAME_LENGTH); // animname - flags = istream_read_int32_le(inputStream); - contents = istream_read_int32_le(inputStream); - value = istream_read_int32_le(inputStream); - source = buffer + offset; - } - - RGBAImageFlags* image = new RGBAImageFlags(w, h, flags, contents, value); - - byte* dest = image->getRGBAPixels(); - byte* end = source + (w * h); - for(; source != end; ++source, dest += 4) - { - *(dest + 0) = palette[*source * 3 + 0]; - *(dest + 1) = palette[*source * 3 + 1]; - *(dest + 2) = palette[*source * 3 + 2]; - *(dest + 3) = 255; - } - - return image; -} - -Image* LoadWal(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadMipTex( buffer.buffer, QUAKE2_WAL ); -} - -Image* LoadM8(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadMipTex( buffer.buffer, HERETIC2_M8 ); -} diff --git a/plugins/imageq2/wal.h b/plugins/imageq2/wal.h deleted file mode 100644 index 4c7901a1..00000000 --- a/plugins/imageq2/wal.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_WAL_H) -#define INCLUDED_WAL_H - -class Image; -class ArchiveFile; - -Image* LoadWal(ArchiveFile& file); -Image* LoadM8(ArchiveFile& file); - -#endif - diff --git a/plugins/imageq2/wal32.cpp b/plugins/imageq2/wal32.cpp deleted file mode 100644 index a472717a..00000000 --- a/plugins/imageq2/wal32.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "wal32.h" - -#include "ifilesystem.h" - -#include "bytestreamutils.h" -#include "imagelib.h" - -typedef unsigned char byte; - -const int M32_NAME_LENGTH = 128; -const int M32_MIPMAP_COUNT = 16; - -typedef struct m32_header_t -{ - int version; - char name[M32_NAME_LENGTH]; - char altname[M32_NAME_LENGTH]; // texture substitution - char animname[M32_NAME_LENGTH]; // next frame in animation chain - char damagename[M32_NAME_LENGTH]; // image that should be shown when damaged - unsigned width[M32_MIPMAP_COUNT], height[M32_MIPMAP_COUNT]; - unsigned offsets[M32_MIPMAP_COUNT]; - int flags; - int contents; - int value; - float scale_x, scale_y; - int mip_scale; - - // detail texturing info - char dt_name[M32_NAME_LENGTH]; // detailed texture name - float dt_scale_x, dt_scale_y; - float dt_u, dt_v; - float dt_alpha; - int dt_src_blend_mode, dt_dst_blend_mode; - - int unused[20]; // future expansion to maintain compatibility with h2 -} m32_header_t; - - -Image* LoadM32Buff(byte* buffer) -{ - PointerInputStream inputStream(buffer); - - inputStream.seek(4 // version - + M32_NAME_LENGTH // name - + M32_NAME_LENGTH // altname - + M32_NAME_LENGTH // animname - + M32_NAME_LENGTH); // damagename - int w = istream_read_uint32_le(inputStream); - inputStream.seek(4 * (M32_MIPMAP_COUNT - 1)); // remaining widths - int h = istream_read_uint32_le(inputStream); - inputStream.seek(4 * (M32_MIPMAP_COUNT - 1)); // remaining heights - int offset = istream_read_uint32_le(inputStream); - inputStream.seek(4 * (M32_MIPMAP_COUNT - 1)); // remaining offsets - int flags = istream_read_uint32_le(inputStream); - int contents = istream_read_uint32_le(inputStream); - int value = istream_read_uint32_le(inputStream); - - RGBAImageFlags* image = new RGBAImageFlags(w, h, flags, contents, value); - - const byte* source = buffer + offset; - std::copy(source, source + (w * h * 4), image->getRGBAPixels()); - - return image; -} - -Image* LoadM32(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadM32Buff(buffer.buffer); -} - diff --git a/plugins/imageq2/wal32.h b/plugins/imageq2/wal32.h deleted file mode 100644 index 8b516c10..00000000 --- a/plugins/imageq2/wal32.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_WAL32_H) -#define INCLUDED_WAL32_H - -class Image; -class ArchiveFile; - -Image* LoadM32(ArchiveFile& file); - -#endif - diff --git a/plugins/imagewal/imagewal.cpp b/plugins/imagewal/imagewal.cpp new file mode 100644 index 00000000..400a1cd9 --- /dev/null +++ b/plugins/imagewal/imagewal.cpp @@ -0,0 +1,97 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include "imagewal.h" + +// ============================================================================= +// global tables + +_QERFuncTable_1 g_FuncTable; // Radiant function table +_QERFileSystemTable g_FileSystemTable; + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientImage g_SynapseClient; + +static const XMLConfigEntry_t entries[] = + { + { VFS_MAJOR, SYN_REQUIRE, sizeof(_QERFileSystemTable), &g_FileSystemTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(IMAGE_MAJOR, "wal", sizeof(_QERPlugImageTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; + } + + return &g_SynapseClient; +} + +bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, IMAGE_MAJOR )) + { + _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "wal")) + { + pTable->m_pfnLoadImage = &LoadWAL; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +bool CSynapseClientImage::OnActivate() { + if (!g_FileSystemTable.m_nSize) { + Syn_Printf("ERROR: VFS_MAJOR table was not initialized before OnActivate in '%s' - incomplete synapse.config?\n", GetInfo()); + return false; + } + return true; +} + +#include "version.h" + +const char* CSynapseClientImage::GetInfo() +{ + return "WAL formats module built " __DATE__ " " RADIANT_VERSION; +} diff --git a/plugins/imagewal/imagewal.def b/plugins/imagewal/imagewal.def new file mode 100644 index 00000000..5101a0cc --- /dev/null +++ b/plugins/imagewal/imagewal.def @@ -0,0 +1,8 @@ +; imagewal.def : Declares the module parameters for the DLL. + +LIBRARY "Imagewal" +DESCRIPTION 'Imagewal Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/imagewal/imagewal.h b/plugins/imagewal/imagewal.h new file mode 100644 index 00000000..b9c8081b --- /dev/null +++ b/plugins/imagewal/imagewal.h @@ -0,0 +1,60 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _IMAGEWAL_H_ +#define _IMAGEWAL_H_ + +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" +#include "iimage.h" + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +extern _QERFuncTable_1 g_FuncTable; +extern _QERFileSystemTable g_FileSystemTable; +void LoadWAL (const char *filename, unsigned char **pic, int *width, int *height); + +#define Error g_FuncTable.m_pfnError +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile +#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile + +class CSynapseClientImage : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + bool OnActivate(); + const char* GetName() { return "image"; } + + CSynapseClientImage() { } + virtual ~CSynapseClientImage() { } +}; + +#endif // _IMAGEWAL_H_ diff --git a/plugins/imagewal/imagewal.vcproj b/plugins/imagewal/imagewal.vcproj new file mode 100644 index 00000000..f32026be --- /dev/null +++ b/plugins/imagewal/imagewal.vcproj @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/imagewal/q2_palette.h b/plugins/imagewal/q2_palette.h new file mode 100644 index 00000000..7479d3c4 --- /dev/null +++ b/plugins/imagewal/q2_palette.h @@ -0,0 +1,66 @@ +unsigned char quake2_palette[256][3] = { +{ 0x0, 0x0 , 0x0 }, { 0xF, 0xF , 0xF }, { 0x1F, 0x1F , 0x1F }, { 0x2F, 0x2F , 0x2F }, +{ 0x3F, 0x3F , 0x3F }, { 0x4B, 0x4B , 0x4B }, { 0x5B, 0x5B , 0x5B }, { 0x6B, 0x6B , 0x6B }, +{ 0x7B, 0x7B , 0x7B }, { 0x8B, 0x8B , 0x8B }, { 0x9B, 0x9B , 0x9B }, { 0xAB, 0xAB , 0xAB }, +{ 0xBB, 0xBB , 0xBB }, { 0xCB, 0xCB , 0xCB }, { 0xDB, 0xDB , 0xDB }, { 0xEB, 0xEB , 0xEB }, +{ 0x63, 0x4B , 0x23 }, { 0x5B, 0x43 , 0x1F }, { 0x53, 0x3F , 0x1F }, { 0x4F, 0x3B , 0x1B }, +{ 0x47, 0x37 , 0x1B }, { 0x3F, 0x2F , 0x17 }, { 0x3B, 0x2B , 0x17 }, { 0x33, 0x27 , 0x13 }, +{ 0x2F, 0x23 , 0x13 }, { 0x2B, 0x1F , 0x13 }, { 0x27, 0x1B , 0xF }, { 0x23, 0x17 , 0xF }, +{ 0x1B, 0x13 , 0xB }, { 0x17, 0xF , 0xB }, { 0x13, 0xF , 0x7 }, { 0xF, 0xB , 0x7 }, +{ 0x5F, 0x5F , 0x6F }, { 0x5B, 0x5B , 0x67 }, { 0x5B, 0x53 , 0x5F }, { 0x57, 0x4F , 0x5B }, +{ 0x53, 0x4B , 0x53 }, { 0x4F, 0x47 , 0x4B }, { 0x47, 0x3F , 0x43 }, { 0x3F, 0x3B , 0x3B }, +{ 0x3B, 0x37 , 0x37 }, { 0x33, 0x2F , 0x2F }, { 0x2F, 0x2B , 0x2B }, { 0x27, 0x27 , 0x27 }, +{ 0x23, 0x23 , 0x23 }, { 0x1B, 0x1B , 0x1B }, { 0x17, 0x17 , 0x17 }, { 0x13, 0x13 , 0x13 }, +{ 0x8F, 0x77 , 0x53 }, { 0x7B, 0x63 , 0x43 }, { 0x73, 0x5B , 0x3B }, { 0x67, 0x4F , 0x2F }, +{ 0xCF, 0x97 , 0x4B }, { 0xA7, 0x7B , 0x3B }, { 0x8B, 0x67 , 0x2F }, { 0x6F, 0x53 , 0x27 }, +{ 0xEB, 0x9F , 0x27 }, { 0xCB, 0x8B , 0x23 }, { 0xAF, 0x77 , 0x1F }, { 0x93, 0x63 , 0x1B }, +{ 0x77, 0x4F , 0x17 }, { 0x5B, 0x3B , 0xF }, { 0x3F, 0x27 , 0xB }, { 0x23, 0x17 , 0x7 }, +{ 0xA7, 0x3B , 0x2B }, { 0x9F, 0x2F , 0x23 }, { 0x97, 0x2B , 0x1B }, { 0x8B, 0x27 , 0x13 }, +{ 0x7F, 0x1F , 0xF }, { 0x73, 0x17 , 0xB }, { 0x67, 0x17 , 0x7 }, { 0x57, 0x13 , 0x0 }, +{ 0x4B, 0xF , 0x0 }, { 0x43, 0xF , 0x0 }, { 0x3B, 0xF , 0x0 }, { 0x33, 0xB , 0x0 }, +{ 0x2B, 0xB , 0x0 }, { 0x23, 0xB , 0x0 }, { 0x1B, 0x7 , 0x0 }, { 0x13, 0x7 , 0x0 }, +{ 0x7B, 0x5F , 0x4B }, { 0x73, 0x57 , 0x43 }, { 0x6B, 0x53 , 0x3F }, { 0x67, 0x4F , 0x3B }, +{ 0x5F, 0x47 , 0x37 }, { 0x57, 0x43 , 0x33 }, { 0x53, 0x3F , 0x2F }, { 0x4B, 0x37 , 0x2B }, +{ 0x43, 0x33 , 0x27 }, { 0x3F, 0x2F , 0x23 }, { 0x37, 0x27 , 0x1B }, { 0x2F, 0x23 , 0x17 }, +{ 0x27, 0x1B , 0x13 }, { 0x1F, 0x17 , 0xF }, { 0x17, 0xF , 0xB }, { 0xF, 0xB , 0x7 }, +{ 0x6F, 0x3B , 0x17 }, { 0x5F, 0x37 , 0x17 }, { 0x53, 0x2F , 0x17 }, { 0x43, 0x2B , 0x17 }, +{ 0x37, 0x23 , 0x13 }, { 0x27, 0x1B , 0xF }, { 0x1B, 0x13 , 0xB }, { 0xF, 0xB , 0x7 }, +{ 0xB3, 0x5B , 0x4F }, { 0xBF, 0x7B , 0x6F }, { 0xCB, 0x9B , 0x93 }, { 0xD7, 0xBB , 0xB7 }, +{ 0xCB, 0xD7 , 0xDF }, { 0xB3, 0xC7 , 0xD3 }, { 0x9F, 0xB7 , 0xC3 }, { 0x87, 0xA7 , 0xB7 }, +{ 0x73, 0x97 , 0xA7 }, { 0x5B, 0x87 , 0x9B }, { 0x47, 0x77 , 0x8B }, { 0x2F, 0x67 , 0x7F }, +{ 0x17, 0x53 , 0x6F }, { 0x13, 0x4B , 0x67 }, { 0xF, 0x43 , 0x5B }, { 0xB, 0x3F , 0x53 }, +{ 0x7, 0x37 , 0x4B }, { 0x7, 0x2F , 0x3F }, { 0x7, 0x27 , 0x33 }, { 0x0, 0x1F , 0x2B }, +{ 0x0, 0x17 , 0x1F }, { 0x0, 0xF , 0x13 }, { 0x0, 0x7 , 0xB }, { 0x0, 0x0 , 0x0 }, +{ 0x8B, 0x57 , 0x57 }, { 0x83, 0x4F , 0x4F }, { 0x7B, 0x47 , 0x47 }, { 0x73, 0x43 , 0x43 }, +{ 0x6B, 0x3B , 0x3B }, { 0x63, 0x33 , 0x33 }, { 0x5B, 0x2F , 0x2F }, { 0x57, 0x2B , 0x2B }, +{ 0x4B, 0x23 , 0x23 }, { 0x3F, 0x1F , 0x1F }, { 0x33, 0x1B , 0x1B }, { 0x2B, 0x13 , 0x13 }, +{ 0x1F, 0xF , 0xF }, { 0x13, 0xB , 0xB }, { 0xB, 0x7 , 0x7 }, { 0x0, 0x0 , 0x0 }, +{ 0x97, 0x9F , 0x7B }, { 0x8F, 0x97 , 0x73 }, { 0x87, 0x8B , 0x6B }, { 0x7F, 0x83 , 0x63 }, +{ 0x77, 0x7B , 0x5F }, { 0x73, 0x73 , 0x57 }, { 0x6B, 0x6B , 0x4F }, { 0x63, 0x63 , 0x47 }, +{ 0x5B, 0x5B , 0x43 }, { 0x4F, 0x4F , 0x3B }, { 0x43, 0x43 , 0x33 }, { 0x37, 0x37 , 0x2B }, +{ 0x2F, 0x2F , 0x23 }, { 0x23, 0x23 , 0x1B }, { 0x17, 0x17 , 0x13 }, { 0xF, 0xF , 0xB }, +{ 0x9F, 0x4B , 0x3F }, { 0x93, 0x43 , 0x37 }, { 0x8B, 0x3B , 0x2F }, { 0x7F, 0x37 , 0x27 }, +{ 0x77, 0x2F , 0x23 }, { 0x6B, 0x2B , 0x1B }, { 0x63, 0x23 , 0x17 }, { 0x57, 0x1F , 0x13 }, +{ 0x4F, 0x1B , 0xF }, { 0x43, 0x17 , 0xB }, { 0x37, 0x13 , 0xB }, { 0x2B, 0xF , 0x7 }, +{ 0x1F, 0xB , 0x7 }, { 0x17, 0x7 , 0x0 }, { 0xB, 0x0 , 0x0 }, { 0x0, 0x0 , 0x0 }, +{ 0x77, 0x7B , 0xCF }, { 0x6F, 0x73 , 0xC3 }, { 0x67, 0x6B , 0xB7 }, { 0x63, 0x63 , 0xA7 }, +{ 0x5B, 0x5B , 0x9B }, { 0x53, 0x57 , 0x8F }, { 0x4B, 0x4F , 0x7F }, { 0x47, 0x47 , 0x73 }, +{ 0x3F, 0x3F , 0x67 }, { 0x37, 0x37 , 0x57 }, { 0x2F, 0x2F , 0x4B }, { 0x27, 0x27 , 0x3F }, +{ 0x23, 0x1F , 0x2F }, { 0x1B, 0x17 , 0x23 }, { 0x13, 0xF , 0x17 }, { 0xB, 0x7 , 0x7 }, +{ 0x9B, 0xAB , 0x7B }, { 0x8F, 0x9F , 0x6F }, { 0x87, 0x97 , 0x63 }, { 0x7B, 0x8B , 0x57 }, +{ 0x73, 0x83 , 0x4B }, { 0x67, 0x77 , 0x43 }, { 0x5F, 0x6F , 0x3B }, { 0x57, 0x67 , 0x33 }, +{ 0x4B, 0x5B , 0x27 }, { 0x3F, 0x4F , 0x1B }, { 0x37, 0x43 , 0x13 }, { 0x2F, 0x3B , 0xB }, +{ 0x23, 0x2F , 0x7 }, { 0x1B, 0x23 , 0x0 }, { 0x13, 0x17 , 0x0 }, { 0xB, 0xF , 0x0 }, +{ 0x0, 0xFF , 0x0 }, { 0x23, 0xE7 , 0xF }, { 0x3F, 0xD3 , 0x1B }, { 0x53, 0xBB , 0x27 }, +{ 0x5F, 0xA7 , 0x2F }, { 0x5F, 0x8F , 0x33 }, { 0x5F, 0x7B , 0x33 }, { 0xFF, 0xFF , 0xFF }, +{ 0xFF, 0xFF , 0xD3 }, { 0xFF, 0xFF , 0xA7 }, { 0xFF, 0xFF , 0x7F }, { 0xFF, 0xFF , 0x53 }, +{ 0xFF, 0xFF , 0x27 }, { 0xFF, 0xEB , 0x1F }, { 0xFF, 0xD7 , 0x17 }, { 0xFF, 0xBF , 0xF }, +{ 0xFF, 0xAB , 0x7 }, { 0xFF, 0x93 , 0x0 }, { 0xEF, 0x7F , 0x0 }, { 0xE3, 0x6B , 0x0 }, +{ 0xD3, 0x57 , 0x0 }, { 0xC7, 0x47 , 0x0 }, { 0xB7, 0x3B , 0x0 }, { 0xAB, 0x2B , 0x0 }, +{ 0x9B, 0x1F , 0x0 }, { 0x8F, 0x17 , 0x0 }, { 0x7F, 0xF , 0x0 }, { 0x73, 0x7 , 0x0 }, +{ 0x5F, 0x0 , 0x0 }, { 0x47, 0x0 , 0x0 }, { 0x2F, 0x0 , 0x0 }, { 0x1B, 0x0 , 0x0 }, +{ 0xEF, 0x0 , 0x0 }, { 0x37, 0x37 , 0xFF }, { 0xFF, 0x0 , 0x0 }, { 0x0, 0x0 , 0xFF }, +{ 0x2B, 0x2B , 0x23 }, { 0x1B, 0x1B , 0x17 }, { 0x13, 0x13 , 0xF }, { 0xEB, 0x97 , 0x7F }, +{ 0xC3, 0x73 , 0x53 }, { 0x9F, 0x57 , 0x33 }, { 0x7B, 0x3F , 0x1B }, { 0xEB, 0xD3 , 0xC7 }, +{ 0xC7, 0xAB , 0x9B }, { 0xA7, 0x8B , 0x77 }, { 0x87, 0x6B , 0x57 }, { 0x9F, 0x5B , 0x53 } +}; diff --git a/plugins/imagewal/wal.cpp b/plugins/imagewal/wal.cpp new file mode 100644 index 00000000..6bb8ca23 --- /dev/null +++ b/plugins/imagewal/wal.cpp @@ -0,0 +1,93 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include "wal.h" + +#include "q2_palette.h" + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf + +void LoadWAL(const char *name, unsigned char **pic, int *width, int *height) +{ + FILE *f; + miptex_t *wal_header; + rgb_t *palette; + int i, num_pixels, size; + char text_buf[255]; + unsigned int length; + unsigned char *palette_ent, *buf_temp; + unsigned char *buffer, *wal_file_buffer; + + // open file + if ( length = vfsLoadFile ((char *) name, (void **) &wal_file_buffer, 0) == (unsigned int) -1) + { + Sys_Printf("Unable to open file %s\n",name); + return; + } + + wal_header = (miptex_t *)wal_file_buffer; + + // make sure we have a valid bitmap file + if ( wal_header->width & 15) + { + vfsFreeFile(wal_file_buffer); + Sys_Printf("Invalid WAL file %s: Width not multiple of 16!\n", name); + return; + } + + if ( wal_header->height & 15) + { + vfsFreeFile(wal_file_buffer); + Sys_Printf("Invalid WAL file %s: Height not multiple of 16!\n", name); + return; + } + + + // Get WAL Info + *width = wal_header->width; // Only interested in 1st MIP + *height = wal_header->height; + num_pixels = (*width) * (*height); + size = num_pixels*4; + + // Allocate buffer + buf_temp = (unsigned char *)(g_malloc(size)); + *pic = buf_temp; + + // Image data + buffer = wal_file_buffer + wal_header->offsets[0]; + + + // Load texture into buffer + palette_ent = buffer; + for(i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/map/parse.cpp b/plugins/map/parse.cpp new file mode 100644 index 00000000..a40a8f34 --- /dev/null +++ b/plugins/map/parse.cpp @@ -0,0 +1,679 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// Hydra - FIXME : TTimo, We need to know what game + engine we're using for +// the halflife (not Q2) specific stuff +// we need an API for modules to get this info! + +// +// parses quake3 map format into internal objects +// + +#include "plugin.h" + +// cmdlib +extern void ExtractFileName (const char *path, char *dest); + +extern int g_MapVersion; +int abortcode; // see imap.h for values. + +// Start of half-life specific stuff + +GSList *g_WadList; // halflife specific. +GSList *g_TextureNameCache; // halflife specific. + +// NOTE TTimo: yuck.. +void FreeGSList( GSList *l ) +{ + while (l) + { + free (l->data); + l = g_slist_remove (l, l->data); + } +} + +// NOTE TTimo: ideally, this would be using Str functions instead +void trim( char *str) +{ + int len; + len = strlen(str); + while(str[--len] == ' ') + str[len] = 0; +} + +void BuildWadList( char *wadstr ) +{ + char wads[2048]; // change to CString usage ? + wads[0] = 0; + char *p1,*p2; + char cleanwadname[QER_MAX_NAMELEN]; + + g_WadList = NULL; + + strcpy(wads,wadstr); + QE_ConvertDOSToUnixName(wads,wads); + + // ok, we got the list of ; delimited wads, now split it into a GSList that contains + // just the wad names themselves. + + p1 = wads; + + do + { + p2 = strchr(p1,';'); + if (p2) + *p2 = 0; // swap the ; with a null terminator + + if (strchr(p1,'/') || strchr(p1,'\\')) + { + ExtractFileName(p1,cleanwadname); + + trim(cleanwadname); + + if (*cleanwadname) + { + g_WadList = g_slist_append (g_WadList, strdup(cleanwadname)); + Sys_Printf("wad: %s\n",cleanwadname); + } + } + else + { + trim(p1); + if (*p1) + { + g_WadList = g_slist_append (g_WadList, strdup(p1)); + Sys_Printf("wad: %s\n",p1); + } + } + if (p2) + p1 = p2+1; // point back to the remainder of the string + else + p1 = NULL; // make it so we exit the loop. + + } while (p1); + + // strip the ".wad" extensions. + for (GSList *l = g_WadList; l != NULL ; l = l->next) + { + p1 = (char *)l->data; + + if (p1[strlen(p1)-4] == '.') + p1[strlen(p1)-4] = 0; + } +} + +// FIXME: usefulness of this cache sounds very discutable +char *CheckCacheForTextureName( const char *cleantexturename ) +{ + char *str; + int len; + GSList *l; + + // search our little cache first to speed things up. + // cache strings are stored as ";" + len = strlen(cleantexturename); + for (l = g_TextureNameCache; l != NULL ; l = l->next) + { + str = (char *)l->data; + if ((strnicmp(cleantexturename,str,len) == 0) && (str[len] == ';')) // must do in this order or we'll get an access violation, even though it's slower. + { + return (str + len + 1); // skip the delimiter ; + } + } + return NULL; +} + +char *AddToCache(const char *cleantexturename, const char *actualname) +{ + char *cachestr; + cachestr = (char *)malloc(strlen(cleantexturename)+1+strlen(actualname)+1); // free()'d when g_TextureNameCache is freed + sprintf(cachestr,"%s;%s",cleantexturename,actualname); + g_TextureNameCache = g_slist_append (g_TextureNameCache, cachestr); + return cachestr; +} + +char *SearchWadsForTextureName( const char *cleantexturename ) +{ + char *str; + char *wadname; + char *actualtexturename = NULL; + GSList *l; + int count; + + actualtexturename = CheckCacheForTextureName(cleantexturename); + if (actualtexturename) + return actualtexturename; + + // still here ? guess it's not in the cache then! + + // search the wads listed in the worldspawn "wad" key + for (l = g_WadList; l != NULL && actualtexturename == NULL ; l = l->next) + { + wadname = (char *)l->data; + + str = new char[strlen(wadname)+strlen(cleantexturename)+9+1+4+1]; + + // hlw here is ok as we never have anything other than hlw files in a wad. + sprintf(str,"textures/%s/%s.hlw",wadname,cleantexturename); + count = vfsGetFileCount(str, VFS_SEARCH_PAK); // only search pack files + // LordHavoc: hacked in .mip loading here + if (!count) + { + sprintf(str,"textures/%s/%s.mip",wadname,cleantexturename); + count = vfsGetFileCount(str, VFS_SEARCH_PAK); // only search pack files + } + + if (count > 0) + { + // strip the extension, build the cache string and add the the cache + str[strlen(str)-4] = 0; + + actualtexturename = AddToCache(cleantexturename,str); + + //point the return value to the actual name, not what we add to the cache + actualtexturename += 1+strlen(cleantexturename); + } + delete [] str; + } + return actualtexturename; +} +// End of half-life specific stuff + +void Patch_Parse(patchMesh_t *pPatch) +{ + int i, j; + char *str; + + char *token = Token(); + + GetToken(true); //{ + + // parse shader name + GetToken(true); + str = new char[strlen(token)+10]; + strcpy(str, "textures/"); + strcpy(str+9, token); + pPatch->pShader = QERApp_Shader_ForName(str); + pPatch->d_texture = pPatch->pShader->getTexture(); + delete [] str; + + GetToken(true); //( + + // parse matrix dimensions + GetToken(false); + pPatch->width = atoi(token); + GetToken(false); + pPatch->height = atoi(token); + + // ignore contents/flags/value + GetToken(false); + GetToken(false); + GetToken(false); + + GetToken(false); //) + + // parse matrix + GetToken(true); //( + for(i=0; iwidth; i++) + { + GetToken(true); //( + for(j=0; jheight; j++) + { + GetToken(false); //( + + GetToken(false); + pPatch->ctrl[i][j].xyz[0] = atof(token); + GetToken(false); + pPatch->ctrl[i][j].xyz[1] = atof(token); + GetToken(false); + pPatch->ctrl[i][j].xyz[2] = atof(token); + GetToken(false); + pPatch->ctrl[i][j].st[0] = atof(token); + GetToken(false); + pPatch->ctrl[i][j].st[1] = atof(token); + + GetToken(false); //) + } + GetToken(false); //) + } + GetToken(true); //) + + GetToken(true); //} +} + +void Face_Parse (face_t *face, bool bAlternateTexdef = false) +{ + int i, j; + char *str; + bool bworldcraft = false; + + char *token = Token(); + + // parse planepts + str = NULL; + for(i=0; i<3; i++) + { + GetToken(true); //( + for(j=0; j<3; j++) + { + GetToken(false); + face->planepts[i][j] = atof(token); + } + GetToken(false); //) + } + + if(bAlternateTexdef) + { + // parse alternate texdef + GetToken (false); // ( + GetToken (false); // ( + for (i=0;i<3;i++) + { + GetToken(false); + face->brushprimit_texdef.coords[0][i]=atof(token); + } + GetToken (false); // ) + GetToken (false); // ( + for (i=0;i<3;i++) + { + GetToken(false); + face->brushprimit_texdef.coords[1][i]=atof(token); + } + GetToken (false); // ) + GetToken (false); // ) + } + + + // parse shader name + GetToken(false); // shader + + // if we're loading a halflife map then we don't have a relative texture name + // we just get . So we need to convert this to a relative name + // like this: "textures//shader", so we use vfsFileFile to get the filename. + + // *** IMPORTANT *** + // For Halflife we need to see if the texture is in wads listed in the + // map's worldspawn "wad" e-pair. If we don't then the image used will be the + // first image with this texture name that is found in any of the wads on the + // user's system. this is not a huge problem, because the map compiler obeys + // the "wad" epair when compiling the map, but the user might end up looking at + // the wrong texture in the editor. (more of a problem if the texture we use + // here has a different size from the one in the wad the map compiler uses...) + + // Hydra: - TTimo: I looked all over for other places to put this, but really it + // is an issue with map loading (because of a limitation of halflife/q2 map format) + // so it's gone in here, it also stops incorrect shader/texdef names getting used + // in the radiant core and it's modules which we'd only have to change later on. + // (either in map_importentities() or the shader module). so it's actually cleaner + // in the long run, even if a little odd. And it keeps more game specific stuff + // OUT of the core, which is a good thing. + + if (g_MapVersion == MAPVERSION_HL) + { + qboolean done = false; + + // FIXME: This bit is halflife specific. + // look in the list of wads supplied in the worldspawn "wad" key/pair for the + // texture first, if it's not in any then we carry on searching the vfs for it + // as usual. + + // each time we find a texture, we add it to the a cache + // so we don't have to hunt the vfs for it each time. + // See SearchWadsForTextureName() and AddToCache() above for cache stuff + + char *wadname; + wadname = SearchWadsForTextureName(token); + + if (wadname) + { + face->texdef.SetName(wadname); + done = true; + } + else + { + // using the cache below means that this message is only ever printed out once! + Sys_Printf("WARNING: could not find \"%s\" in any listed wad files, searching all wad files instead!\n",token); + } + // end of half-life specific bit. + + // check the cache! + if (!done) + { + str = CheckCacheForTextureName(token); + if (str) + { + face->texdef.SetName(str); + done = true; + } + } + + if (!done) + { + char *fullpath; + + str = new char[strlen(token)+4+1]; + + // FIXME: halflife specific file extension, we'll have to support Q2/Q1 formats + // and maybe tga texture format for HL here too.. + sprintf(str,"%s.hlw",token); + fullpath = vfsGetFullPath(str,0,VFS_SEARCH_PAK | VFS_SEARCH_DIR); + + // MIP support for quake + if (!fullpath) + { + sprintf(str,"%s.mip",token); + fullpath = vfsGetFullPath( str, 0, 0 ); + } + + // TGA support in halflife ? + /* + if (!fullpath) + { + sprintf(str,"%s.tga",token); + fullpath = vfsGetFullPath(str); + } + */ + delete [] str; + + if (fullpath) + { + // strip the extension. + int len = strlen(fullpath); + if (fullpath[len-4] == '.') + fullpath[len-4] = '\0'; + + // and set the correct name! + face->texdef.SetName(fullpath); + AddToCache(token,fullpath); + } + else + { + Sys_Printf("WARNING: could not find \"%s\" in the vfs search path\n",token); + str = new char[strlen(token)+10]; + strcpy(str, "textures/"); + strcpy(str+9, token); + face->texdef.SetName(str); + AddToCache(token,str); + delete [] str; + } + } + } + else // !MAPVERSION_HL + { + str = new char[strlen(token)+10]; + strcpy(str, "textures/"); + strcpy(str+9, token); + face->texdef.SetName(str); + delete [] str; + } + + if(!bAlternateTexdef) + { + if (g_MapVersion == MAPVERSION_HL) // Q1 as well ? + { + GetToken(false); + if (token[0] == '[' && token[1] == '\0') + { + bworldcraft = true; + + GetToken(false); // UAxis[0] + GetToken(false); // UAxis[1] + GetToken(false); // UAxis[2] + + GetToken(false); // shift + face->texdef.shift[0] = atof(token); + + GetToken(false); // ] + + GetToken(false); // [ + GetToken(false); // VAxis[0] + GetToken(false); // VAxis[1] + GetToken(false); // VAxis[2] + + GetToken(false); // shift + face->texdef.shift[1] = atof(token); + + GetToken(false); // ] + + // rotation is derived from the U and V axes. + // ZHLT ignores this setting even if present in a .map file. + GetToken(false); + face->texdef.rotate = atof(token); + + // Scales + GetToken(false); + face->texdef.scale[0] = atof(token); + GetToken(false); + face->texdef.scale[1] = atof(token); + } + else + { + UnGetToken(); + } + } + + if (!bworldcraft) // !MAPVERSION_HL + { + // parse texdef + GetToken(false); + face->texdef.shift[0] = atof(token); + GetToken(false); + face->texdef.shift[1] = atof(token); + GetToken(false); + face->texdef.rotate = atof(token); + GetToken(false); + face->texdef.scale[0] = atof(token); + GetToken(false); + face->texdef.scale[1] = atof(token); + } + } + // parse the optional contents/flags/value + if (!bworldcraft && TokenAvailable()) + { + GetToken(true); + if (isdigit(token[0])) + { + face->texdef.contents = atoi(token); + GetToken(false); + face->texdef.flags = atoi(token); + GetToken(false); + face->texdef.value = atoi(token); + } + else + { + UnGetToken(); + } + } +} + +bool Primitive_Parse(brush_t *pBrush) +{ + char *token = Token(); + + GetToken(true); + if (!strcmp(token, "patchDef2")) + { + pBrush->patchBrush = true; + pBrush->pPatch = Patch_Alloc(); + pBrush->pPatch->pSymbiot = pBrush; + Patch_Parse(pBrush->pPatch); + GetToken(true); //} + + // A patchdef should never be loaded from a quake2 map file + // so we just return false and the brush+patch gets freed + // and the user gets told. + if (g_MapVersion != MAPVERSION_Q3) + { + // FIXME: Hydra - I wanted to write out a line number here, but I can't because there's no API to access the core's "scriptline" variable. + Syn_Printf("ERROR: patchDef2's are not supported in Quake%d format .map files!\n",g_MapVersion); + abortcode = MAP_WRONGVERSION; + return false; + } + } + else if (!strcmp(token, "brushDef")) + { + pBrush->bBrushDef = true; + GetToken(true); // { + while(1) + { + face_t *f = pBrush->brush_faces; + pBrush->brush_faces = Face_Alloc(); + Face_Parse(pBrush->brush_faces, true); + pBrush->brush_faces->next = f; + // check for end of brush + GetToken(true); + if(strcmp(token,"}") == 0) + break; + UnGetToken(); + } + GetToken(true); // } + } + else + { + UnGetToken(); + while(1) + { + face_t *f = pBrush->brush_faces; + pBrush->brush_faces = Face_Alloc(); + Face_Parse(pBrush->brush_faces); + pBrush->brush_faces->next = f; + + // check for end of brush + GetToken(true); + if(strcmp(token,"}") == 0) + break; + UnGetToken(); + } + } + return true; +} + +void Entity_Parse(entity_t *pEntity) +{ + brush_t *pBrush; + CPtrArray *brushes = NULL; + char temptoken[1024]; + + char *token = Token(); + + while(1) + { + GetToken(true); // { or } or epair + if (!strcmp(token, "}")) { + break; + } else if(!strcmp(token, "{")) { + + pBrush = Brush_Alloc(); + if (Primitive_Parse(pBrush)) { + ((CPtrArray*)pEntity->pData)->Add(pBrush); + } else { + Brush_Free( pBrush, true ); + } + + } else { + + strcpy(temptoken, token); + GetToken(false); + + SetKeyValue(pEntity, temptoken, token); + + if (g_MapVersion == MAPVERSION_HL) { + // if we've not god a "wads" key/pair already, then break it into a list. + if (!g_WadList && (stricmp(temptoken,"wad") == 0)) { + BuildWadList(token); + } + } + + } + } +} + +void Map_Read (IDataStream *in, CPtrArray *map) +{ + entity_t *pEntity; + char *buf; + + unsigned long len = in->GetLength(); + buf = new char[len+1]; + in->Read(buf, len); + buf[len] = '\0'; + StartTokenParsing(buf); + abortcode = MAP_NOERROR; + + while(abortcode == MAP_NOERROR) + { + if (!GetToken (true)) // { or NULL + break; + pEntity = Entity_Alloc(); + pEntity->pData = new CPtrArray; + Entity_Parse(pEntity); + map->Add(pEntity); + } + + delete [] buf; + + if (abortcode != MAP_NOERROR) + { + int num_ents, num_brushes,i,j; + entity_t *e; + CPtrArray *brushes; + + num_ents = map->GetSize(); + for(i=0; iGetAt(i); + brushes = (CPtrArray*)e->pData; + num_brushes = brushes->GetSize(); + for(j=0; jGetAt(j), true ); + } + brushes->RemoveAll(); + delete brushes; + Entity_Free(e); + } + map->RemoveAll(); + } +} + +void Map_ReadQ3 (IDataStream *in, CPtrArray *map) +{ + g_MapVersion = MAPVERSION_Q3; + Map_Read(in,map); +} + +void Map_ReadHL (IDataStream *in, CPtrArray *map) +{ + g_WadList = NULL; + g_TextureNameCache = NULL; + + g_MapVersion = MAPVERSION_HL; + Map_Read(in,map); + + FreeGSList(g_TextureNameCache); + FreeGSList(g_WadList); +} + +void Map_ReadQ2 (IDataStream *in, CPtrArray *map) +{ + g_MapVersion = MAPVERSION_Q2; + Map_Read(in,map); +} diff --git a/plugins/map/plugin.cpp b/plugins/map/plugin.cpp new file mode 100644 index 00000000..1a7def7a --- /dev/null +++ b/plugins/map/plugin.cpp @@ -0,0 +1,134 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "plugin.h" + +// ============================================================================= +// Globals + +// function tables +_QERFuncTable_1 g_FuncTable; +_QERScripLibTable g_ScripLibTable; +_QERShadersTable g_ShadersTable; +_QEREntityTable __ENTITYTABLENAME; +_QERBrushTable g_BrushTable; +_QERPatchTable g_PatchTable; +_QERFileSystemTable g_FileSystemTable; +/*! +the map version we have been initialized with: Q1/Q2/Q3 +we provide all three formats in the same module +*/ +int g_MapVersion; + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientMap g_SynapseClient; + +static const XMLConfigEntry_t entries[] = + { + { SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(MAP_MAJOR, "mapq3", sizeof(_QERPlugMapTable)); + g_SynapseClient.AddAPI(MAP_MAJOR, "maphl", sizeof(_QERPlugMapTable)); + g_SynapseClient.AddAPI(MAP_MAJOR, "mapq2", sizeof(_QERPlugMapTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(g_FuncTable), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(g_ScripLibTable), SYN_REQUIRE, &g_ScripLibTable); + + // same trick as bobtoolz, see bug #828 + g_SynapseClient.AddAPI( VFS_MAJOR, "*", sizeof(g_FileSystemTable), SYN_REQUIRE, &g_FileSystemTable ); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; + } + + g_SynapseClient.AddAPI(ENTITY_MAJOR, NULL, sizeof(__ENTITYTABLENAME), SYN_REQUIRE, &__ENTITYTABLENAME); + g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(g_BrushTable), SYN_REQUIRE, &g_BrushTable); + g_SynapseClient.AddAPI(PATCH_MAJOR, NULL, sizeof(g_PatchTable), SYN_REQUIRE, &g_PatchTable); + + return &g_SynapseClient; +} + +bool CSynapseClientMap::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, MAP_MAJOR)) + { + _QERPlugMapTable* pTable= static_cast<_QERPlugMapTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "mapq3")) + { + pTable->m_pfnMap_Read = &Map_ReadQ3; + pTable->m_pfnMap_Write = &Map_WriteQ3; + return true; + } + if (!strcmp(pAPI->minor_name, "maphl")) + { + pTable->m_pfnMap_Read = &Map_ReadHL; + pTable->m_pfnMap_Write = &Map_WriteHL; + mbMapHL = true; + return true; + } + if (!strcmp(pAPI->minor_name, "mapq2")) + { + pTable->m_pfnMap_Read = &Map_ReadQ2; + pTable->m_pfnMap_Write = &Map_WriteQ2; + return true; + } + Syn_Printf("ERROR: RequestAPI( Major: '%s' Minor: '%s' ) not found in '%s'\n", pAPI->major_name, pAPI->minor_name, GetInfo()); + return false; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +bool CSynapseClientMap::OnActivate() { + return true; +} + +#include "version.h" + +const char* CSynapseClientMap::GetInfo() +{ + return "MAP format module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientMap::GetName() +{ + return "map"; +} diff --git a/plugins/map/plugin.h b/plugins/map/plugin.h new file mode 100644 index 00000000..e568135e --- /dev/null +++ b/plugins/map/plugin.h @@ -0,0 +1,92 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include +#include + +#include "synapse.h" + +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#define USE_VFSTABLE_DEFINE +#define USE_SCRIPLIBTABLE_DEFINE +#include "iscriplib.h" +#include "imap.h" +#include "ishaders.h" +#define USE_ENTITYTABLE_DEFINE +#include "ientity.h" +#define USE_BRUSHTABLE_DEFINE +#include "ibrush.h" +#define USE_PATCHTABLE_DEFINE +#include "ipatch.h" +#define USE_VFSTABLE_DEFINE +#include "ifilesystem.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERScripLibTable g_ScripLibTable; +extern _QERShadersTable g_ShadersTable; +extern _QEREntityTable __ENTITYTABLENAME; +extern _QERBrushTable g_BrushTable; +extern _QERPatchTable g_PatchTable; +extern _QERFileSystemTable g_FileSystemTable; + +#define Error g_FuncTable.m_pfnError +#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName + +// a bunch of globals to the module +extern void *g_pRadiantWnd; + +#define MAPVERSION_Q3 1 +#define MAPVERSION_HL 2 +#define MAPVERSION_Q2 3 +//#define MAPVERSION_Q1 + +#define MAP_NOERROR 0 +#define MAP_ABORTED 1 +#define MAP_WRONGVERSION 2 + +void Map_ReadQ3 (IDataStream *in, CPtrArray *map); +void Map_WriteQ3 (CPtrArray *map, IDataStream *out); +void Map_ReadHL (IDataStream *in, CPtrArray *map); +void Map_WriteHL (CPtrArray *map, IDataStream *out); +void Map_ReadQ2 (IDataStream *in, CPtrArray *map); +void Map_WriteQ2 (CPtrArray *map, IDataStream *out); + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientMap : public CSynapseClient +{ + bool mbMapHL; +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); ///< required for runtime configuration + bool OnActivate(); + + CSynapseClientMap() { mbMapHL = false; } + virtual ~CSynapseClientMap() { } +}; + +#endif // _PLUGIN_H_ diff --git a/plugins/map/write.cpp b/plugins/map/write.cpp new file mode 100644 index 00000000..fb0700e2 --- /dev/null +++ b/plugins/map/write.cpp @@ -0,0 +1,227 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// writes quake3 map format from internal objects +// + +static int g_count_entities; +static int g_count_brushes; + +#include "plugin.h" +extern int g_MapVersion; + +void Float_Write(float data, IDataStream *out) +{ + if (data == (int)data) + out->printf("%i ", (int)data); + else + out->printf("%f ", data); +} + +void Patch_Write(patchMesh_t *pPatch, IDataStream *out) +{ + int i, j; + const char *str; + + // write shader name and matrix dimensions + str = pPatch->pShader->getName(); + if (strchr(str, ' ')) + { + Sys_FPrintf(SYS_WRN, "WARNING: Patch_Write: shader names with spaces are not allowed, ignoring '%s'\n", str); + str = SHADER_NOT_FOUND; + } + if(!strncmp(str, "textures/", 9)) str+=9; + out->printf("patchDef2\n{\n%s\n( %i %i 0 0 0 )\n", + str, pPatch->width, pPatch->height); + + // write matrix + out->printf("(\n"); + for(i=0; iwidth; i++) + { + out->printf("( "); + for(j=0; jheight; j++) + { + out->printf("( "); + + Float_Write(pPatch->ctrl[i][j].xyz[0], out); + Float_Write(pPatch->ctrl[i][j].xyz[1], out); + Float_Write(pPatch->ctrl[i][j].xyz[2], out); + Float_Write(pPatch->ctrl[i][j].st[0], out); + Float_Write(pPatch->ctrl[i][j].st[1], out); + + out->printf(") "); + } + out->printf(")\n"); + } + out->printf(")\n}\n"); +} + +void Face_Write (face_t *face, IDataStream *out, bool bAlternateTexdef = false) +{ + int i, j; + const char *str; + + // write planepts + for(i=0; i<3; i++) + { + out->printf("( "); + for(j=0; j<3; j++) + { + Float_Write(face->planepts[i][j], out); + } + out->printf(") "); + } + + if(bAlternateTexdef) + { + // write alternate texdef + out->printf("( ( "); + for (i=0;i<3;i++) + Float_Write(face->brushprimit_texdef.coords[0][i], out); + out->printf(") ( "); + for (i=0;i<3;i++) + Float_Write(face->brushprimit_texdef.coords[1][i], out); + out->printf(") ) "); + } + + // write shader name + str = face->texdef.GetName(); + if (strchr(str, ' ')) + { + Sys_FPrintf(SYS_WRN, "WARNING: Face_Write: shader names with spaces are not allowed, ignoring '%s'\n", str); + str = SHADER_NOT_FOUND; + } + if(!strncmp(str, "textures/", 9)) str+=9; + + // Strip all remaining paths. + // FIXME: Hydra - this is actually a HalfLife specific bit, not Q2 map format specific. + if (g_MapVersion == MAPVERSION_HL) + { + char *pos; + while ( pos = (char*)strchr( str, '/' ) ) { + str = pos+1; // to speed optimize, change the "while" to an "if" + } + } + out->printf("%s ", str); + + if(!bAlternateTexdef) + { + // write texdef + out->printf("%i %i %i %f %f ", + (int)face->texdef.shift[0], + (int)face->texdef.shift[1], + (int)face->texdef.rotate, + face->texdef.scale[0], + face->texdef.scale[1]); + } + + if (g_MapVersion == MAPVERSION_Q3) + { + // write surface flags + out->printf("%i %i %i\n", + face->texdef.contents, + face->texdef.flags, + face->texdef.value); + } + + if ( (g_MapVersion == MAPVERSION_HL) || (g_MapVersion == MAPVERSION_Q2) ) + { + // write surface flags if non-zero values. + if (face->texdef.contents || face->texdef.flags || face->texdef.value) + { + out->printf("%i %i %i\n", + face->texdef.contents, + face->texdef.flags, + face->texdef.value); + } + else + { + out->printf("\n"); + } + } + +} + +void Primitive_Write (brush_t *pBrush, IDataStream *out) +{ + if ( (g_MapVersion == MAPVERSION_Q2) && (pBrush->patchBrush) ) + { + Sys_FPrintf(SYS_WRN, "WARNING: Primitive_Write: Patches are not supported in Quake2, ignoring Brush %d\n", g_count_brushes++); + } + else + { + out->printf("// brush %i\n", g_count_brushes++); + out->printf("{\n"); + if(pBrush->patchBrush) + Patch_Write(pBrush->pPatch, out); + else if(pBrush->bBrushDef) + { + out->printf("brushDef\n{\n"); + for(face_t *face = pBrush->brush_faces; face != NULL; face = face->next) + Face_Write (face, out, true); + out->printf("}\n"); + } + else + for(face_t *face = pBrush->brush_faces; face != NULL; face = face->next) + Face_Write (face, out); + out->printf("}\n"); + } +} + +void Entity_Write(entity_t *pEntity, IDataStream *out) +{ + epair_t *pEpair; + CPtrArray *brushes = (CPtrArray*)pEntity->pData; + out->printf("// entity %i\n", g_count_entities++); + out->printf("{\n"); + for(pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next) + out->printf("\"%s\" \"%s\"\n", pEpair->key, pEpair->value); + g_count_brushes = 0; + for(int i=0; iGetSize(); i++) + Primitive_Write((brush_t*)brushes->GetAt(i), out); + out->printf("}\n"); +} + +void Map_Write (CPtrArray *map, IDataStream *out) +{ + g_count_entities = 0; + for(int i=0; iGetSize(); i++) + Entity_Write((entity_t*)map->GetAt(i), out); +} + +void Map_WriteQ3 (CPtrArray *map, IDataStream *out) +{ + g_MapVersion = MAPVERSION_Q3; + Map_Write (map,out); +} + +void Map_WriteHL (CPtrArray *map, IDataStream *out) +{ + g_MapVersion = MAPVERSION_HL; + Map_Write (map,out); +} + +void Map_WriteQ2 (CPtrArray *map, IDataStream *out) +{ + g_MapVersion = MAPVERSION_Q2; + Map_Write (map,out); +} diff --git a/plugins/mapq3/mapq3.vcproj b/plugins/mapq3/mapq3.vcproj deleted file mode 100644 index c1a77520..00000000 --- a/plugins/mapq3/mapq3.vcproj +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/mapq3/parse.cpp b/plugins/mapq3/parse.cpp deleted file mode 100644 index 650b3cdb..00000000 --- a/plugins/mapq3/parse.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "parse.h" - -#include - -#include "ientity.h" -#include "ibrush.h" -#include "ipatch.h" -#include "ieclass.h" -#include "iscriplib.h" -#include "scenelib.h" -#include "string/string.h" -#include "stringio.h" -#include "eclasslib.h" - -inline MapImporter* Node_getMapImporter(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - - -typedef std::list< std::pair > KeyValues; - -NodeSmartReference g_nullNode(NewNullNode()); - - -NodeSmartReference Entity_create(EntityCreator& entityTable, EntityClass* entityClass, const KeyValues& keyValues) -{ - scene::Node& entity(entityTable.createEntity(entityClass)); - for(KeyValues::const_iterator i = keyValues.begin(); i != keyValues.end(); ++i) - { - Node_getEntity(entity)->setKeyValue((*i).first.c_str(), (*i).second.c_str()); - } - return NodeSmartReference(entity); -} - -NodeSmartReference Entity_parseTokens(Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser, int index) -{ - NodeSmartReference entity(g_nullNode); - KeyValues keyValues; - const char* classname = ""; - - int count_primitives = 0; - while(1) - { - tokeniser.nextLine(); - const char* token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#entity-token"); - return g_nullNode; - } - if (!strcmp(token, "}")) // end entity - { - if(entity == g_nullNode) - { - // entity does not have brushes - entity = Entity_create(entityTable, GlobalEntityClassManager().findOrInsert(classname, false), keyValues); - } - return entity; - } - else if(!strcmp(token, "{")) // begin primitive - { - if(entity == g_nullNode) - { - // entity has brushes - entity = Entity_create(entityTable, GlobalEntityClassManager().findOrInsert(classname, true), keyValues); - } - - tokeniser.nextLine(); - - NodeSmartReference primitive(parser.parsePrimitive(tokeniser)); - if(primitive == g_nullNode || !Node_getMapImporter(primitive)->importTokens(tokeniser)) - { - globalErrorStream() << "brush " << count_primitives << ": parse error\n"; - return g_nullNode; - } - - scene::Traversable* traversable = Node_getTraversable(entity); - if(Node_getEntity(entity)->isContainer() && traversable != 0) - { - traversable->insert(primitive); - } - else - { - globalErrorStream() << "entity " << index << ": type " << classname << ": discarding brush " << count_primitives << "\n"; - } - ++count_primitives; - } - else // epair - { - CopiedString key(token); - token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#epair-value"); - return g_nullNode; - } - keyValues.push_back(KeyValues::value_type(key, token)); - if(string_equal(key.c_str(), "classname")) - { - classname = keyValues.back().second.c_str(); - } - } - } - // unreachable code - return g_nullNode; -} - -void Map_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser) -{ - int count_entities = 0; - for(;;) - { - tokeniser.nextLine(); - if (!tokeniser.getToken()) // { or 0 - break; - - NodeSmartReference entity(Entity_parseTokens(tokeniser, entityTable, parser, count_entities)); - - if(entity == g_nullNode) - { - globalErrorStream() << "entity " << count_entities << ": parse error\n"; - return; - } - - Node_getTraversable(root)->insert(entity); - - ++count_entities; - } -} diff --git a/plugins/mapq3/parse.h b/plugins/mapq3/parse.h deleted file mode 100644 index 16c0b1bc..00000000 --- a/plugins/mapq3/parse.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PARSE_H) -#define INCLUDED_PARSE_H - -#include "imap.h" - -class BrushCreator; -class PatchCreator; - -class PrimitiveParser -{ -public: - virtual scene::Node& parsePrimitive(Tokeniser& tokeniser) const = 0; -}; - -void Map_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser); - -namespace scene -{ - class Node; -} - -#include "generic/referencecounted.h" -typedef SmartReference > NodeSmartReference; - -extern NodeSmartReference g_nullNode; - -#endif diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp deleted file mode 100644 index a11dc4a9..00000000 --- a/plugins/mapq3/plugin.cpp +++ /dev/null @@ -1,658 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "iscriplib.h" -#include "ibrush.h" -#include "ipatch.h" -#include "ifiletypes.h" -#include "ieclass.h" -#include "qerplugin.h" - -#include "scenelib.h" -#include "string/string.h" -#include "stringio.h" -#include "generic/constant.h" - -#include "modulesystem/singletonmodule.h" - -#include "parse.h" -#include "write.h" - - -class MapDoom3Dependencies : - public GlobalRadiantModuleRef, - public GlobalFiletypesModuleRef, - public GlobalScripLibModuleRef, - public GlobalEntityClassManagerModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalBrushModuleRef -{ - PatchModuleRef m_patchDef2Doom3Module; - PatchModuleRef m_patchDoom3Module; -public: - MapDoom3Dependencies() : - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")), - GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")), - m_patchDef2Doom3Module("def2doom3"), - m_patchDoom3Module("doom3") - { - } - BrushCreator& getBrushDoom3() - { - return GlobalBrushModule::getTable(); - } - PatchCreator& getPatchDoom3() - { - return *m_patchDoom3Module.getTable(); - } - PatchCreator& getPatchDef2Doom3() - { - return *m_patchDef2Doom3Module.getTable(); - } -}; - -class MapDoom3API : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ - MapDoom3Dependencies& m_dependencies; -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapdoom3"); - INTEGER_CONSTANT(MapVersion, 2); - - MapDoom3API(MapDoom3Dependencies& dependencies) : m_dependencies(dependencies) - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("doom3 maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("doom3 region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "patchDef3")) - { - return m_dependencies.getPatchDoom3().createPatch(); - } - else if(string_equal(primitive, "patchDef2")) - { - return m_dependencies.getPatchDef2Doom3().createPatch(); - } - else if(string_equal(primitive, "brushDef3")) - { - return m_dependencies.getBrushDoom3().createBrush(); - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#doom3-primitive"); - return g_nullNode; - } - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - tokeniser.nextLine(); - if(!Tokeniser_parseToken(tokeniser, "Version")) - { - return; - } - std::size_t version; - if(!Tokeniser_getSize(tokeniser, version)) - { - return; - } - if(version != MapVersion()) - { - globalErrorStream() << "Doom 3 map version " << MapVersion() << " supported, version is " << Unsigned(version) << "\n"; - return; - } - tokeniser.nextLine(); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - writer.writeToken("Version"); - writer.writeInteger(MapVersion()); - writer.nextLine(); - Map_Write(root, traverse, writer, false); - writer.release(); - } -}; - -typedef SingletonModule< - MapDoom3API, - MapDoom3Dependencies, - DependenciesAPIConstructor -> -MapDoom3Module; - -MapDoom3Module g_MapDoom3Module; - - -class MapQuake4API : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ - MapDoom3Dependencies& m_dependencies; -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapquake4"); - INTEGER_CONSTANT(MapVersion, 3); - - MapQuake4API(MapDoom3Dependencies& dependencies) : m_dependencies(dependencies) - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake4 maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake4 region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "patchDef3")) - { - return m_dependencies.getPatchDoom3().createPatch(); - } - else if(string_equal(primitive, "patchDef2")) - { - return m_dependencies.getPatchDef2Doom3().createPatch(); - } - else if(string_equal(primitive, "brushDef3")) - { - return m_dependencies.getBrushDoom3().createBrush(); - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#quake4-primitive"); - return g_nullNode; - } - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - tokeniser.nextLine(); - if(!Tokeniser_parseToken(tokeniser, "Version")) - { - return; - } - std::size_t version; - if(!Tokeniser_getSize(tokeniser, version)) - { - return; - } - if(version != MapVersion()) - { - globalErrorStream() << "Quake 4 map version " << MapVersion() << " supported, version is " << Unsigned(version) << "\n"; - return; - } - tokeniser.nextLine(); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - writer.writeToken("Version"); - writer.writeInteger(MapVersion()); - writer.nextLine(); - Map_Write(root, traverse, writer, false); - writer.release(); - } -}; - -typedef SingletonModule< - MapQuake4API, - MapDoom3Dependencies, - DependenciesAPIConstructor -> -MapQuake4Module; - -MapQuake4Module g_MapQuake4Module; - - -class MapDependencies : - public GlobalRadiantModuleRef, - public GlobalBrushModuleRef, - public GlobalPatchModuleRef, - public GlobalFiletypesModuleRef, - public GlobalScripLibModuleRef, - public GlobalEntityClassManagerModuleRef, - public GlobalSceneGraphModuleRef -{ -public: - MapDependencies() : - GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")), - GlobalPatchModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("patchtypes")), - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")) - { - } -}; - -class MapQ3API : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapq3"); - - MapQ3API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake3 maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake3 region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "patchDef2")) - { - return GlobalPatchModule::getTable().createPatch(); - } - if(GlobalBrushModule::getTable().useAlternativeTextureProjection()) - { - if(string_equal(primitive, "brushDef")) - { - return GlobalBrushModule::getTable().createBrush(); - } - } - else - { - if(string_equal(primitive, "(")) - { - tokeniser.ungetToken(); // ( - return GlobalBrushModule::getTable().createBrush(); - } - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#quake3-primitive"); - return g_nullNode; - } - - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - Map_Write(root, traverse, writer, false); - writer.release(); - } -}; - -typedef SingletonModule MapQ3Module; - -MapQ3Module g_MapQ3Module; - - -class MapQ1API : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapq1"); - - MapQ1API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "(")) - { - tokeniser.ungetToken(); // ( - return GlobalBrushModule::getTable().createBrush(); - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#quake-primitive"); - return g_nullNode; - } - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - Map_Write(root, traverse, writer, true); - writer.release(); - } -}; - -typedef SingletonModule MapQ1Module; - -MapQ1Module g_MapQ1Module; - - -class MapHalfLifeAPI : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "maphl"); - - MapHalfLifeAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("half-life maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("half-life region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "(")) - { - tokeniser.ungetToken(); // ( - return GlobalBrushModule::getTable().createBrush(); - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#halflife-primitive"); - return g_nullNode; - } - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - Map_Write(root, traverse, writer, true); - writer.release(); - } -}; - -typedef SingletonModule MapHalfLifeModule; - -MapHalfLifeModule g_MapHalfLifeModule; - - -class MapQ2API : public TypeSystemRef, public MapFormat, public PrimitiveParser -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapq2"); - - MapQ2API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake2 maps", "*.map")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake2 region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - scene::Node& parsePrimitive(Tokeniser& tokeniser) const - { - const char* primitive = tokeniser.getToken(); - if(primitive != 0) - { - if(string_equal(primitive, "(")) - { - tokeniser.ungetToken(); // ( - return GlobalBrushModule::getTable().createBrush(); - } - } - - Tokeniser_unexpectedError(tokeniser, primitive, "#quake2-primitive"); - return g_nullNode; - } - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - Map_Read(root, tokeniser, entityTable, *this); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream); - Map_Write(root, traverse, writer, true); - writer.release(); - } -}; - -typedef SingletonModule MapQ2Module; - -MapQ2Module g_MapQ2Module; - - - -#define PARSE_ERROR "error parsing VMF" - -inline void parseToken(Tokeniser& tokeniser, const char* token) -{ - ASSERT_MESSAGE(Tokeniser_parseToken(tokeniser, token), "error parsing vmf: token not found: " << makeQuoted(token)); -} - -#include "generic/arrayrange.h" - -class VMFBlock; -typedef ArrayConstRange VMFBlockArrayRange; - - -class VMFBlock -{ -public: - const char* m_name; - VMFBlockArrayRange m_children; - typedef const VMFBlock Value; - - VMFBlock(const char* name, VMFBlockArrayRange children = VMFBlockArrayRange(0, 0)) : m_name(name), m_children(children) - { - } - const char* name() const - { - return m_name; - } - typedef Value* const_iterator; - const_iterator begin() const - { - return m_children.first; - } - const_iterator end() const - { - return m_children.last; - } -}; - -const VMFBlock c_vmfNormals("normals"); -const VMFBlock c_vmfDistances("distances"); -const VMFBlock c_vmfOffsets("offsets"); -const VMFBlock c_vmfOffsetNormals("offset_normals"); -const VMFBlock c_vmfAlphas("alphas"); -const VMFBlock c_vmfTriangleTags("triangle_tags"); -const VMFBlock c_vmfAllowedVerts("allowed_verts"); -const VMFBlock c_vmfDispInfoChildren[] = { c_vmfNormals, c_vmfDistances, c_vmfOffsets, c_vmfOffsetNormals, c_vmfAlphas, c_vmfTriangleTags, c_vmfAllowedVerts }; -const VMFBlock c_vmfDispInfo("dispinfo", ARRAY_RANGE(c_vmfDispInfoChildren)); -const VMFBlock c_vmfSideChildren[] = { c_vmfDispInfo }; -const VMFBlock c_vmfSide("side", ARRAY_RANGE(c_vmfSideChildren)); -const VMFBlock c_vmfEditor("editor"); -const VMFBlock c_vmfVersionInfo("versioninfo"); -const VMFBlock c_vmfViewSettings("viewsettings"); -const VMFBlock c_vmfCordon("cordon"); -const VMFBlock c_vmfGroupChildren[] = { c_vmfEditor }; -const VMFBlock c_vmfGroup("group", ARRAY_RANGE(c_vmfGroupChildren)); -const VMFBlock c_vmfCamera("camera"); -const VMFBlock c_vmfCamerasChildren[] = { c_vmfCamera }; -const VMFBlock c_vmfCameras("cameras", ARRAY_RANGE(c_vmfCamerasChildren)); -VMFBlock c_vmfVisGroup("visgroup"); -VMFBlock c_vmfVisGroups("visgroups", VMFBlockArrayRange(&c_vmfVisGroup, &c_vmfVisGroup+1)); -const VMFBlock c_vmfSolidChildren[] = { c_vmfSide, c_vmfEditor }; -const VMFBlock c_vmfSolid("solid", ARRAY_RANGE(c_vmfSolidChildren)); -const VMFBlock c_vmfConnections("connections"); -const VMFBlock c_vmfEntityChildren[] = { c_vmfEditor, c_vmfSolid, c_vmfGroup, c_vmfConnections }; -const VMFBlock c_vmfEntity("entity", ARRAY_RANGE(c_vmfEntityChildren)); -const VMFBlock c_vmfWorldChildren[] = { c_vmfEditor, c_vmfSolid, c_vmfGroup }; -const VMFBlock c_vmfWorld("world", ARRAY_RANGE(c_vmfWorldChildren)); -const VMFBlock c_vmfRootChildren[] = { c_vmfVersionInfo, c_vmfViewSettings, c_vmfVisGroups, c_vmfWorld, c_vmfEntity, c_vmfCameras, c_vmfCordon }; -const VMFBlock c_vmfRoot("", ARRAY_RANGE(c_vmfRootChildren)); - -class VMFInit -{ -public: - VMFInit() - { - c_vmfVisGroup.m_children = VMFBlockArrayRange(&c_vmfVisGroup, &c_vmfVisGroup+1); - } -}; - -VMFInit g_VMFInit; - -int g_vmf_entities; -int g_vmf_brushes; - -inline VMFBlock::const_iterator VMFBlock_find(const VMFBlock& block, const char* name) -{ - for(VMFBlock::const_iterator i = block.begin(); i != block.end(); ++i) - { - if(string_equal(name, (*i).name())) - { - return i; - } - } - return block.end(); -} - -void VMF_parseBlock(Tokeniser& tokeniser, const VMFBlock& block) -{ - for(;;) - { - const char* key = tokeniser.getToken(); - if(key == 0 || string_equal(key, "}")) - { - tokeniser.ungetToken(); - break; - } - CopiedString tmp(key); - tokeniser.nextLine(); - const char* value = tokeniser.getToken(); - tokeniser.nextLine(); - if(string_equal(value, "{")) - { - VMFBlock::const_iterator i = VMFBlock_find(block, tmp.c_str()); - ASSERT_MESSAGE(i != block.end(), "error parsing vmf block " << makeQuoted(block.name()) << ": unknown block: " << makeQuoted(tmp.c_str())); - if(string_equal(tmp.c_str(), "solid")) - { - ++g_vmf_brushes; - } - else if(string_equal(tmp.c_str(), "entity") || string_equal(tmp.c_str(), "world")) - { - ++g_vmf_entities; - } - VMF_parseBlock(tokeniser, *i); - parseToken(tokeniser, "}"); - tokeniser.nextLine(); - } - else - { - // was a pair - } - } -} - -void VMF_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable) -{ - g_vmf_entities = g_vmf_brushes = 0; - VMF_parseBlock(tokeniser, c_vmfRoot); - globalOutputStream() << g_vmf_entities << " entities\n"; - globalOutputStream() << g_vmf_brushes << " brushes\n"; -} - -class MapVMFAPI : public TypeSystemRef, public MapFormat -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "mapvmf"); - - MapVMFAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("vmf maps", "*.vmf")); - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("vmf region", "*.reg")); - } - MapFormat* getTable() - { - return this; - } - - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream); - VMF_Read(root, tokeniser, entityTable); - tokeniser.release(); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - } -}; - -typedef SingletonModule MapVMFModule; - -MapVMFModule g_MapVMFModule; - - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_MapDoom3Module.selfRegister(); - g_MapQuake4Module.selfRegister(); - g_MapQ3Module.selfRegister(); - g_MapQ1Module.selfRegister(); - g_MapQ2Module.selfRegister(); - g_MapHalfLifeModule.selfRegister(); - g_MapVMFModule.selfRegister(); -} diff --git a/plugins/mapq3/plugin.h b/plugins/mapq3/plugin.h deleted file mode 100644 index 2f28d852..00000000 --- a/plugins/mapq3/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/mapq3/write.cpp b/plugins/mapq3/write.cpp deleted file mode 100644 index f64bbe54..00000000 --- a/plugins/mapq3/write.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "write.h" - -#include "ientity.h" -#include "iscriplib.h" -#include "scenelib.h" - -inline MapExporter* Node_getMapExporter(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - - -static std::size_t g_count_entities; -static std::size_t g_count_brushes; - - -void Entity_ExportTokens(const Entity& entity, TokenWriter& writer) -{ - g_count_brushes = 0; - - class WriteKeyValue : public Entity::Visitor - { - TokenWriter& m_writer; - public: - WriteKeyValue(TokenWriter& writer) - : m_writer(writer) - { - } - - void visit(const char* key, const char* value) - { - m_writer.writeString(key); - m_writer.writeString(value); - m_writer.nextLine(); - } - - } visitor(writer); - - entity.forEachKeyValue(visitor); -} - -class WriteTokensWalker : public scene::Traversable::Walker -{ - mutable Stack m_stack; - TokenWriter& m_writer; - bool m_ignorePatches; -public: - WriteTokensWalker(TokenWriter& writer, bool ignorePatches) - : m_writer(writer), m_ignorePatches(ignorePatches) - { - } - bool pre(scene::Node& node) const - { - m_stack.push(false); - - Entity* entity = Node_getEntity(node); - if(entity != 0) - { - m_writer.writeToken("//"); - m_writer.writeToken("entity"); - m_writer.writeUnsigned(g_count_entities++); - m_writer.nextLine(); - - m_writer.writeToken("{"); - m_writer.nextLine(); - m_stack.top() = true; - - Entity_ExportTokens(*entity, m_writer); - } - else - { - MapExporter* exporter = Node_getMapExporter(node); - if(exporter != 0 - && !(m_ignorePatches && Node_isPatch(node))) - { - m_writer.writeToken("//"); - m_writer.writeToken("brush"); - m_writer.writeUnsigned(g_count_brushes++); - m_writer.nextLine(); - - exporter->exportTokens(m_writer); - } - } - - return true; - } - void post(scene::Node& node) const - { - if(m_stack.top()) - { - m_writer.writeToken("}"); - m_writer.nextLine(); - } - m_stack.pop(); - } -}; - -void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TokenWriter& writer, bool ignorePatches) -{ - g_count_entities = 0; - traverse(root, WriteTokensWalker(writer, ignorePatches)); -} - diff --git a/plugins/mapq3/write.h b/plugins/mapq3/write.h deleted file mode 100644 index cdbe7b7e..00000000 --- a/plugins/mapq3/write.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_WRITE_H) -#define INCLUDED_WRITE_H - -#include "imap.h" - -void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TokenWriter& writer, bool ignorePatches); - -#endif diff --git a/plugins/mapxml/mapxml.def b/plugins/mapxml/mapxml.def index 0c8a247c..feca2974 100644 --- a/plugins/mapxml/mapxml.def +++ b/plugins/mapxml/mapxml.def @@ -1,7 +1,8 @@ ; mapxml.def : Declares the module parameters for the DLL. LIBRARY "MAPXML" +DESCRIPTION 'MAPXML Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here - Radiant_RegisterModules @1 + Synapse_EnumerateInterfaces @1 diff --git a/plugins/mapxml/mapxml.vcproj b/plugins/mapxml/mapxml.vcproj index 07c3d288..c62a2a20 100644 --- a/plugins/mapxml/mapxml.vcproj +++ b/plugins/mapxml/mapxml.vcproj @@ -1,295 +1,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/mapxml/plugin.cpp b/plugins/mapxml/plugin.cpp index 5d62f1ac..e66f52cd 100644 --- a/plugins/mapxml/plugin.cpp +++ b/plugins/mapxml/plugin.cpp @@ -1,107 +1,78 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "plugin.h" -#include "ibrush.h" -#include "ipatch.h" -#include "ifiletypes.h" -#include "ieclass.h" -#include "qerplugin.h" +// ============================================================================= +// Globals -#include "modulesystem/singletonmodule.h" -#include "typesystem.h" +// function tables +_QERFuncTable_1 g_FuncTable; +_QERShadersTable g_ShadersTable; +_QEREntityTable g_EntityTable; +_QERBrushTable g_BrushTable; +_QERPatchTable g_PatchTable; -#include "xmlparse.h" -#include "xmlwrite.h" +// ============================================================================= +// SYNAPSE +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientXMap g_SynapseClient; -class MapXMLDependencies : - public GlobalRadiantModuleRef, - public GlobalBrushModuleRef, - public GlobalFiletypesModuleRef, - public GlobalEntityClassManagerModuleRef, - public GlobalSceneGraphModuleRef -{ - PatchModuleRef m_patchDef2Doom3Module; - PatchModuleRef m_patchDoom3Module; -public: - MapXMLDependencies() : - GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")), - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")), - m_patchDef2Doom3Module("def2doom3"), - m_patchDoom3Module("doom3") +static const XMLConfigEntry_t entries[] = + { + { SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - BrushCreator& getBrushDoom3() - { - return GlobalBrushModule::getTable(); + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(MAP_MAJOR, "mapxml", sizeof(_QERPlugMapTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable); + g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(g_BrushTable), SYN_REQUIRE, &g_BrushTable); + g_SynapseClient.AddAPI(PATCH_MAJOR, NULL, sizeof(g_PatchTable), SYN_REQUIRE, &g_PatchTable); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; } - PatchCreator& getPatchDoom3() - { - return *m_patchDoom3Module.getTable(); - } - PatchCreator& getPatchDef2Doom3() - { - return *m_patchDef2Doom3Module.getTable(); - } -}; - -class MapXMLAPI : public TypeSystemRef, public MapFormat -{ -public: - typedef MapFormat Type; - STRING_CONSTANT(Name, "xmldoom3"); - - MapXMLAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("xml doom3 maps", "*.xmap")); - } - MapFormat* getTable() - { - return this; - } - - void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const - { - Map_Read(root, inputStream, entityTable); - } - void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const - { - Map_Write(root, traverse, outputStream); - } -}; - -typedef SingletonModule MapXMLModule; - -MapXMLModule g_MapXMLModule; - - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - GlobalErrorStream::instance().setOutputStream(server.getErrorStream()); - GlobalOutputStream::instance().setOutputStream(server.getOutputStream()); - GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler()); - GlobalModuleServer::instance().set(server); - - g_MapXMLModule.selfRegister(); + + return &g_SynapseClient; +} + +bool CSynapseClientXMap::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, MAP_MAJOR)) + { + _QERPlugMapTable* pTable= static_cast<_QERPlugMapTable*>(pAPI->mpTable); + pTable->m_pfnMap_Read = &Map_Read; + pTable->m_pfnMap_Write = &Map_Write; + + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientXMap::GetInfo() +{ + return "XMAP module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientXMap::GetName() +{ + return "xmap"; } diff --git a/plugins/mapxml/plugin.h b/plugins/mapxml/plugin.h index 2f28d852..a129b400 100644 --- a/plugins/mapxml/plugin.h +++ b/plugins/mapxml/plugin.h @@ -1,25 +1,49 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ -This file is part of GtkRadiant. +#include +#include -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +#include "libxml/parser.h" -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +#include "synapse.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "imap.h" +#include "ishaders.h" +#define USE_ENTITYTABLE_DEFINE +#include "ientity.h" +#define USE_BRUSHTABLE_DEFINE +#include "ibrush.h" +#define USE_PATCHTABLE_DEFINE +#include "ipatch.h" -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ +extern _QERFuncTable_1 g_FuncTable; +extern _QERShadersTable g_ShadersTable; +extern _QEREntityTable g_EntityTable; +extern _QERBrushTable g_BrushTable; +extern _QERPatchTable g_PatchTable; -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#define Error g_FuncTable.m_pfnError +#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName -#endif +extern void *g_pRadiantWnd; + +void Map_Read (IDataStream *in, CPtrArray *map); +void Map_Write (CPtrArray *map, IDataStream *out); + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientXMap : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); ///< required for XML runtime config + + CSynapseClientXMap() { } + virtual ~CSynapseClientXMap() { } +}; + +#endif // _PLUGIN_H_ diff --git a/plugins/mapxml/xmlparse.cpp b/plugins/mapxml/xmlparse.cpp index 8893f9ec..f9093a5f 100644 --- a/plugins/mapxml/xmlparse.cpp +++ b/plugins/mapxml/xmlparse.cpp @@ -1,277 +1,295 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - // // parses xml tree format into internal objects // -#include "xmlparse.h" -#include +#include "plugin.h" -#include "ientity.h" -#include "ibrush.h" -#include "ipatch.h" -#include "ieclass.h" -#include "eclasslib.h" - -#include "xml/xmlparser.h" -#include "scenelib.h" -#include "generic/reference.h" -#include "generic/object.h" - - -#define PARSE_ERROR "XML PARSE ERROR" - - -inline XMLImporter* Node_getXMLImporter(scene::Node& node) +void Patch_XMLParse(patchMesh_t *pPatch, xmlNodePtr surface) { - return NodeTypeCast::cast(node); + char *str, *content; + int i, j; + + for(xmlNodePtr current = surface->children; current != NULL; current = current->next) + { + if(current->type != XML_ELEMENT_NODE) continue; + if(!strcmp((char *)current->name, "matrix")) + { + str = (char *)xmlGetProp(current, (xmlChar *)"width"); + pPatch->width = atoi(str); + xmlFree(str); + str = (char *)xmlGetProp(current, (xmlChar *)"height"); + pPatch->height = atoi(str); + xmlFree(str); + + content = Q_StrDup((char *)current->children->content); + + str = strtok(content, " \n\r\t\v\0"); + for(i=0; iwidth; i++) + { + for(j=0; jheight; j++) + { + pPatch->ctrl[i][j].xyz[0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + pPatch->ctrl[i][j].xyz[1] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + pPatch->ctrl[i][j].xyz[2] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + pPatch->ctrl[i][j].st[0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + pPatch->ctrl[i][j].st[1] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + } + } + + delete [] content; + } + else if(!strcmp((char *)current->name, "shader")) { + pPatch->pShader = QERApp_Shader_ForName((char*)current->children->content); + pPatch->d_texture = pPatch->pShader->getTexture(); + } + } } - -scene::Node& createPrimitive(const char* name) +void Face_XMLParse (face_t *face, xmlNodePtr surface) { - if(string_equal(name, "brush")) - { - return GlobalBrushCreator().createBrush(); - } - else if(string_equal(name, "patch")) - { - return GlobalPatchCreator().createPatch(); - } + char *str, *content; + int i, j; - ASSERT_MESSAGE(0, PARSE_ERROR << ": primitive type not supported: \"" << name << "\"\n"); - scene::Node* node = 0; - return *node; + for(xmlNodePtr current = surface->children; current != NULL; current = current->next) + { + if(current->type != XML_ELEMENT_NODE) continue; + if(!strcmp((char *)current->name, "planepts")) + { + content = Q_StrDup((char *)current->children->content); + + str = strtok(content, " \n\r\t\v\0"); + for (i=0 ; i<3 ; i++) + { + for (j=0 ; j<3 ; j++) + { + face->planepts[i][j] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + } + } + + delete [] content; + } + else if(!strcmp((char *)current->name, "texdef")) + { + content = Q_StrDup((char *)current->children->content); + + str = strtok(content, " \n\r\t\v\0"); + face->texdef.shift[0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.shift[1] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.rotate = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.scale[0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.scale[1] = atof(str); + + delete [] content; + } + else if(!strcmp((char *)current->name, "bpmatrix")) + { + content = Q_StrDup((char *)current->children->content); + + str = strtok(content, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[0][0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[0][1] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[0][2] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[1][0] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[1][1] = atof(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->brushprimit_texdef.coords[1][2] = atof(str); + + delete [] content; + } + else if(!strcmp((char *)current->name, "flags")) + { + content = Q_StrDup((char *)current->children->content); + + str = strtok(content, " \n\r\t\v\0"); + face->texdef.contents = atoi(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.flags = atoi(str); + str = strtok(NULL, " \n\r\t\v\0"); + face->texdef.value = atoi(str); + + delete [] content; + } + else if(!strcmp((char *)current->name, "shader")) + { + face->texdef.SetName((char *)current->children->content); + } + } } -class TreeXMLImporter : public XMLImporter +void Brush_XMLParse (brush_t *pBrush, xmlNodePtr primitive) { -public: - virtual TreeXMLImporter& child() = 0; -}; + face_t *f; -class SubPrimitiveImporter : public TreeXMLImporter -{ - XMLImporter* m_importer; -public: - SubPrimitiveImporter(XMLImporter* importer) : m_importer(importer) + for(xmlNodePtr current = primitive->children; current != NULL; current = current->next) { + if(current->type != XML_ELEMENT_NODE) continue; + f = pBrush->brush_faces; + pBrush->brush_faces = Face_Alloc(); + Face_XMLParse(pBrush->brush_faces, current); + pBrush->brush_faces->next = f; } - void pushElement(const XMLElement& element) - { - m_importer->pushElement(element); - } - void popElement(const char* name) - { - m_importer->popElement(name); - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_importer->write(buffer, length); - } - SubPrimitiveImporter& child() - { - return *this; - } -}; - -class PrimitiveImporter : public TreeXMLImporter -{ - scene::Node& m_parent; - XMLImporter* m_importer; - char m_child[sizeof(SubPrimitiveImporter)]; - - SubPrimitiveImporter& subprimitive() - { - return *reinterpret_cast(m_child); - } -public: - PrimitiveImporter(scene::Node& parent) : m_parent(parent), m_importer(0) - { - } - void pushElement(const XMLElement& element) - { - if(string_equal(element.name(), "epair")) - { - ASSERT_MESSAGE(string_equal(element.name(), "epair"), PARSE_ERROR); - Node_getEntity(m_parent)->setKeyValue(element.attribute("key"), element.attribute("value")); - } - else - { - NodeSmartReference node(createPrimitive(element.name())); - - m_importer = Node_getXMLImporter(node); - - constructor(subprimitive(), m_importer); - - m_importer->pushElement(element); - - Node_getTraversable(m_parent)->insert(node); - } - } - void popElement(const char* name) - { - if(string_equal(name, "epair")) - { - } - else - { - m_importer->popElement(name); - - destructor(subprimitive()); - m_importer = 0; - } - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_importer->write(buffer, length); - } - TreeXMLImporter& child() - { - return subprimitive(); - } -}; - -class EntityImporter : public TreeXMLImporter -{ - scene::Node& m_parent; - char m_node[sizeof(NodeSmartReference)]; - char m_child[sizeof(PrimitiveImporter)]; - EntityCreator& m_entityTable; - - NodeSmartReference& node() - { - return *reinterpret_cast(m_node); - } - PrimitiveImporter& primitive() - { - return *reinterpret_cast(m_child); - } - -public: - EntityImporter(scene::Node& parent, EntityCreator& entityTable) : m_parent(parent), m_entityTable(entityTable) - { - } - void pushElement(const XMLElement& element) - { - ASSERT_MESSAGE(string_equal(element.name(), "entity"), PARSE_ERROR); - constructor(node(), NodeSmartReference(m_entityTable.createEntity(GlobalEntityClassManager().findOrInsert("", true)))); - constructor(primitive(), makeReference(node().get())); - } - void popElement(const char* name) - { - ASSERT_MESSAGE(string_equal(name, "entity"), PARSE_ERROR); - NodeSmartReference entity(m_entityTable.createEntity(GlobalEntityClassManager().findOrInsert(Node_getEntity(node())->getKeyValue("classname"), node_is_group(node())))); - - { - EntityCopyingVisitor visitor(*Node_getEntity(entity)); - Node_getEntity(node())->forEachKeyValue(visitor); - } - - if(Node_getTraversable(entity) != 0 && !Node_getEntity(entity)->getEntityClass().fixedsize) - { - parentBrushes(node(), entity); - } - - Node_getTraversable(m_parent)->insert(entity); - - destructor(primitive()); - destructor(node()); - } - std::size_t write(const char* buffer, std::size_t length) - { - return length; - } - TreeXMLImporter& child() - { - return primitive(); - } -}; - -class MapDoom3Importer : public TreeXMLImporter -{ - scene::Node& m_root; - char m_child[sizeof(EntityImporter)]; - EntityCreator& m_entityTable; - - EntityImporter& getEntity() - { - return *reinterpret_cast(m_child); - } -public: - MapDoom3Importer(scene::Node& root, EntityCreator& entityTable) : m_root(root), m_entityTable(entityTable) - { - } - void pushElement(const XMLElement& element) - { - ASSERT_MESSAGE(string_equal(element.name(), "mapdoom3"), PARSE_ERROR); - constructor(getEntity(), makeReference(m_root), makeReference(m_entityTable)); - } - void popElement(const char* name) - { - ASSERT_MESSAGE(string_equal(name, "mapdoom3"), PARSE_ERROR); - destructor(getEntity()); - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } - TreeXMLImporter& child() - { - return getEntity(); - } -}; - -class TreeXMLImporterStack : public XMLImporter -{ - std::vector< Reference > m_importers; -public: - TreeXMLImporterStack(TreeXMLImporter& importer) - { - m_importers.push_back(makeReference(importer)); - } - void pushElement(const XMLElement& element) - { - m_importers.back().get().pushElement(element); - m_importers.push_back(makeReference(m_importers.back().get().child())); - } - void popElement(const char* name) - { - m_importers.pop_back(); - m_importers.back().get().popElement(name); - } - std::size_t write(const char* buffer, std::size_t length) - { - return (*(m_importers.end() - 2)).get().write(buffer, length); - } -}; - - -void Map_Read(scene::Node& root, TextInputStream& in, EntityCreator& entityTable) -{ - XMLStreamParser parser(in); - - MapDoom3Importer importer(root, entityTable); - TreeXMLImporterStack stack(importer); - parser.exportXML(stack); +} + +void Entity_XMLParse(entity_t *pEntity, xmlNodePtr entity) +{ + brush_t *pBrush; + + for(xmlNodePtr current = entity->children; current != NULL; current = current->next) + { + if(current->type != XML_ELEMENT_NODE) continue; + if(!strcmp((char *)current->name, "epair")) + { + char *key = (char *)xmlGetProp(current, (xmlChar *)"key"); + char *value = (char *)xmlGetProp(current, (xmlChar *)"value"); + SetKeyValue(pEntity, key, value); + xmlFree(key); + xmlFree(value); + } + else if(strcmp((char *)current->name, "brush") == 0) + { + pBrush = Brush_Alloc(); + Brush_XMLParse(pBrush, current); + ((CPtrArray*)pEntity->pData)->Add(pBrush); + } + else if(strcmp((char *)current->name, "patch") == 0) + { + pBrush = Brush_Alloc(); + pBrush->patchBrush = true; + pBrush->pPatch = Patch_Alloc(); + pBrush->pPatch->pSymbiot = pBrush; + Patch_XMLParse(pBrush->pPatch, current); + ((CPtrArray*)pEntity->pData)->Add(pBrush); + } + } +} + +void Map_XMLRead(CPtrArray *map, xmlNodePtr map_node) +{ + entity_t *pEntity; + xmlNodePtr current; + + for(current = map_node->children; current != NULL; current = current->next) + { + if(current->type != XML_ELEMENT_NODE) continue; + pEntity = Entity_Alloc(); + pEntity->pData = new CPtrArray; + Entity_XMLParse(pEntity, current); + map->Add(pEntity); + } +} + +// SPoG +// temporarily copied from qe3.cpp +// duplicate code starts here (note: g_strAppPath swapped for g_FuncTable.m_pfnGetQERPath()) + +void HandleXMLError( void* ctxt, const char* text, ... ) +{ + va_list argptr; + static char buf[32768]; + + va_start (argptr,text); + vsprintf (buf, text, argptr); + Sys_FPrintf (SYS_ERR, "XML %s\n", buf); + va_end (argptr); +} + +#define DTD_BUFFER_LENGTH 1024 +xmlDocPtr ParseXMLStream(IDataStream *stream, bool validate = false) +{ + xmlDocPtr doc = NULL; + bool wellFormed = false, valid = false; + int res, size = 1024; + char chars[1024]; + xmlParserCtxtPtr ctxt; + + // SPoG + // HACK: use AppPath to resolve DTD location + // do a buffer-safe string copy and concatenate + int i; + char* w; + const char* r; + char buf[DTD_BUFFER_LENGTH]; + + w = buf; + i = 0; + // copy + //assert(g_FuncTable.m_pfnGetQERPath() != NULL); + for(r = g_FuncTable.m_pfnGetQERPath(); iRead(chars, 4); + if (res > 0) + { + ctxt = xmlCreatePushParserCtxt(NULL, NULL, chars, res, buf); + + while ((res = stream->Read(chars, size)) > 0) + { + xmlParseChunk(ctxt, chars, res, 0); + } + xmlParseChunk(ctxt, chars, 0, 1); + doc = ctxt->myDoc; + + wellFormed = (ctxt->wellFormed == 1); + valid = (ctxt->valid == 1); + + xmlFreeParserCtxt(ctxt); + } + + if(wellFormed && (!validate || (validate && valid))) + return doc; + + if(doc != NULL) + xmlFreeDoc(doc); + + return NULL; +} + +// duplicate code ends here + +void Map_Read (IDataStream *in, CPtrArray *map) +{ + xmlDocPtr doc; + + doc = ParseXMLStream(in, false ); // quick hack while dtd validation is broken + + if(doc != NULL) + { + xmlNodePtr node=doc->children; + while(node != NULL && node->type != XML_ELEMENT_NODE) node=node->next; + if(node != NULL) + Map_XMLRead(map, node); + } + + xmlFreeDoc(doc); } diff --git a/plugins/mapxml/xmlparse.h b/plugins/mapxml/xmlparse.h deleted file mode 100644 index 86f1407f..00000000 --- a/plugins/mapxml/xmlparse.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XMLPARSE_H) -#define INCLUDED_XMLPARSE_H - -#include "imap.h" - -void Map_Read(scene::Node& root, TextInputStream& in, EntityCreator& entityTable); - -#endif diff --git a/plugins/mapxml/xmlwrite.cpp b/plugins/mapxml/xmlwrite.cpp index 6e24f7cf..b1409132 100644 --- a/plugins/mapxml/xmlwrite.cpp +++ b/plugins/mapxml/xmlwrite.cpp @@ -1,91 +1,217 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - // // writes xml tree format from internal objects // -#include "xmlwrite.h" -#include "xml/xmlwriter.h" -#include "scenelib.h" -#include "entityxml.h" +#include "plugin.h" -inline XMLExporter* Node_getXMLExporter(scene::Node& node) +char *str_append_token(char *str1, const char *str2) { - return NodeTypeCast::cast(node); + char *str; + if(str1 != NULL) + { + str = new char[strlen(str1)+strlen(str2)+2]; + sprintf(str, "%s %s", str1, str2); + delete [] str1; + } + else + { + str = new char[strlen(str2)+1]; + strcpy(str, str2); + } + return str; } - -class write_all : public scene::Traversable::Walker +void str_from_float(char *buf, float f) { - XMLImporter& m_importer; -public: - write_all(XMLImporter& importer) : m_importer(importer) + if(f == (int)f) sprintf(buf, "%i", (int)f); + else sprintf(buf, "%f", f); +} + +void Patch_XMLWrite(patchMesh_t *pPatch, xmlNodePtr surface) +{ + char buf[16]; + char *str; + int i, j; + xmlNodePtr node; + + // write shader + node = xmlNewChild(surface, NULL, (xmlChar *)"shader", (xmlChar *)pPatch->pShader->getName()); + + // write matrix + str = NULL; + for(i=0; iwidth; i++) { - } - bool pre(scene::Node& node) const - { - Entity* entity = Node_getEntity(node); - if(entity != 0) + for(j=0; jheight; j++) { - m_importer.write("\n", 1); - StaticElement element("entity"); - m_importer.pushElement(element); - entity_export exporter(*entity); - exporter.exportXML(m_importer); + str_from_float(buf, pPatch->ctrl[i][j].xyz[0]); + str = str_append_token(str, buf); + str_from_float(buf, pPatch->ctrl[i][j].xyz[1]); + str = str_append_token(str, buf); + str_from_float(buf, pPatch->ctrl[i][j].xyz[2]); + str = str_append_token(str, buf); + str_from_float(buf, pPatch->ctrl[i][j].st[0]); + str = str_append_token(str, buf); + str_from_float(buf, pPatch->ctrl[i][j].st[1]); + str = str_append_token(str, buf); + } + } + + node = xmlNewChild(surface, NULL, (xmlChar *)"matrix", (xmlChar *)str); + delete [] str; + sprintf(buf, "%i", pPatch->width); + xmlSetProp(node, (xmlChar *)"width", (xmlChar *)buf); + sprintf(buf, "%i", pPatch->height); + xmlSetProp(node, (xmlChar *)"height", (xmlChar *)buf); +} + +void Face_XMLWrite (face_t *face, xmlNodePtr surface, bool bAlternateTexdef = false) +{ + char buf[16]; + xmlNodePtr node; + int i, j; + char *str; + + // write shader + node = xmlNewChild(surface, NULL, (xmlChar *)"shader", (xmlChar *)face->texdef.GetName()); + + // write planepts + str = NULL; + for (i=0 ; i<3 ; i++) + { + for (j=0 ; j<3 ; j++) + { + str_from_float(buf, face->planepts[i][j]); + str = str_append_token(str, buf); + } + } + + node = xmlNewChild(surface, NULL, (xmlChar *)"planepts", (xmlChar *)str); + delete [] str; + + if(!bAlternateTexdef) + { + // write texdef + sprintf(buf, "%i", (int)face->texdef.shift[0]); + str = str_append_token(NULL, buf); + sprintf(buf, "%i", (int)face->texdef.shift[1]); + str = str_append_token(str, buf); + sprintf(buf, "%i", (int)face->texdef.rotate); + str = str_append_token(str, buf); + sprintf(buf, "%f", face->texdef.scale[0]); + str = str_append_token(str, buf); + sprintf(buf, "%f", face->texdef.scale[1]); + str = str_append_token(str, buf); + + node = xmlNewChild(surface, NULL, (xmlChar *)"texdef", (xmlChar *)str); + delete [] str; + } + else + { + // write matrix texdef + str = NULL; + for (i=0 ; i<2 ; i++) + { + for (j=0 ; j<3 ; j++) + { + str_from_float(buf, face->brushprimit_texdef.coords[i][j]); + str = str_append_token(str, buf); + } + } + node = xmlNewChild(surface, NULL, (xmlChar *)"bpmatrix", (xmlChar *)str); + delete [] str; + } + + // write flags + sprintf(buf, "%i", face->texdef.contents); + str = str_append_token(NULL, buf); + sprintf(buf, "%i", face->texdef.flags); + str = str_append_token(str, buf); + sprintf(buf, "%i", face->texdef.value); + str = str_append_token(str, buf); + + node = xmlNewChild(surface, NULL, (xmlChar *)"flags", (xmlChar *)str); + delete [] str; +} + +void Brush_XMLWrite (brush_t *brush, xmlNodePtr primitive) +{ + xmlNodePtr node; + + for(face_t *face = brush->brush_faces; face != NULL; face = face->next) + { + node = xmlNewChild(primitive, NULL, (xmlChar *)"plane", NULL); + Face_XMLWrite (face, node, brush->bBrushDef); + } +} + +void Epair_XMLWrite(epair_t *pEpair, xmlNodePtr epair) +{ + xmlSetProp(epair, (xmlChar *)"key", (xmlChar *)pEpair->key); + xmlSetProp(epair, (xmlChar *)"value", (xmlChar *)pEpair->value); +} + +void Entity_XMLWrite(entity_t *pEntity, xmlNodePtr entity) +{ + brush_t *pBrush; + epair_t *pEpair; + xmlNodePtr node; + + CPtrArray *brushes = (CPtrArray*)pEntity->pData; + + for(pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next) + { + node = xmlNewChild(entity, NULL, (xmlChar *)"epair", NULL); + Epair_XMLWrite(pEpair, node); + } + + for(int i=0; iGetSize(); i++) + { + pBrush = (brush_t*)brushes->GetAt(i); + + if(pBrush->patchBrush) + { + node = xmlNewChild(entity, NULL, (xmlChar *)"patch", NULL); + Patch_XMLWrite(pBrush->pPatch, node); } else { - XMLExporter* exporter = Node_getXMLExporter(node); - if(exporter != 0) - { - m_importer.write("\n", 1); - exporter->exportXML(m_importer); - m_importer.write("\n", 1); - } + node = xmlNewChild(entity, NULL, (xmlChar *)"brush", NULL); + Brush_XMLWrite(pBrush, node); } - return true; - } - void post(scene::Node& node) const - { - if(Node_getEntity(node) != 0) - { - m_importer.write("\n", 1); - m_importer.popElement("entity"); - } - } -}; - -void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& out) -{ - XMLStreamWriter writer(out); - writer.write("\n", 1); - { - StaticElement element("mapdoom3"); - writer.pushElement(element); - - traverse(root, write_all(writer)); - - writer.write("\n", 1); - writer.popElement(element.name()); } } + +void Map_XMLWrite (CPtrArray *map, xmlNodePtr map_node) +{ + entity_t *pEntity; + xmlNodePtr node; + + for(int i=0; iGetSize(); i++) + { + pEntity = (entity_t*)map->GetAt(i); + + node = xmlNewChild(map_node, NULL, (xmlChar *)"entity", NULL); + Entity_XMLWrite(pEntity, node); + } +} + +void Map_Write (CPtrArray *map, IDataStream *out) +{ + xmlChar* buf; + int len; + + xmlDocPtr doc = xmlNewDoc((xmlChar *)"1.0"); + xmlCreateIntSubset(doc, (xmlChar *)"mapq3", NULL, (xmlChar *)"mapq3.dtd"); + doc->children->next = xmlNewDocNode(doc, NULL, (xmlChar *)"mapq3", NULL); + + Map_XMLWrite(map, doc->children->next); + + // xmlDocDumpMemory(doc, &buf, &len); + xmlDocDumpFormatMemory(doc, &buf, &len, 1); + xmlFreeDoc(doc); + + out->Write(buf, len); + + xmlFree(buf); +} diff --git a/plugins/mapxml/xmlwrite.h b/plugins/mapxml/xmlwrite.h deleted file mode 100644 index 619d071f..00000000 --- a/plugins/mapxml/xmlwrite.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_XMLWRITE_H) -#define INCLUDED_XMLWRITE_H - -#include "imap.h" - -void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& out); - -#endif diff --git a/plugins/md3model/doc/md3-design.txt b/plugins/md3model/doc/md3-design.txt deleted file mode 100644 index 047bdeb3..00000000 --- a/plugins/md3model/doc/md3-design.txt +++ /dev/null @@ -1,172 +0,0 @@ -map objects module -================== - -Objective: ----------- - -#1 Turn the md3 code into a module. That is handle all aspects of map objects in -a module. This involves: -- the rendering of the model (sleep mode / shader reload are associated issues) -- the manipulation in the editor (moving, rotating, (scaling?)) - -#2 Have an API generic enough to support other formats than md3. (md1 / md2 for -multiple games support, any other formats). - -What we have: -------------- - -What is the current implementation of md3 support? Were are the important -features that we will need to work with? - -"misc_model" is the required classname for any map object - -entity_t::md3Class -eclass_t *md3Class; -This holds the actual md3 object and the rendering information (tri soup, -shader etc.) -entity_t also has vRotation and vScale which are particular to the model - -for selection of the brush (selection is preliminary step before any -manipulation operation), we create a bounding box from the md3 information -and use the entity's brush list as storage for it. - -Requirements: -------------- - -Some technical requirements go on top of our objective given the existing -implementation. The most important one is that the changes applied to the -core must remain focused around the md3 functionality, and must also lay -out the basics of some wider changes. We can identify some of those changes: - -- introducing a more generalized way of selecting and manipulation things -in the editor. - -- introducing a more generic way of rendering objects in the editor. - -More specifically, the details of rendering and manipulation: - -transformation - translate&rotate: - A transformation increment is provided - The object is transformed by a specified increment. - Depending on the object type, the transformations may affect - the local coordinate space transformation instead of the object. - This local transformation is used in selection and rendering. - -selection: - ray: - Radiant asks model for its world-relative axis-alignedbounding box. - Radiant does intersection test with this bounding box. - If test shows intersection, radiant gives model a ray_t, model tests - for intersection with ray, model returns bool true if intersection - A selection ray in world-space (origin+direction) is provided. - The object must say whether or not it intersects with the ray. - map objects have a special configuration to test on bounding box or trisoup - this is set in preferences independently from the true/false selection tests - area: - radiant uses a bounding box for area selection. (bounding box can be - infinite in some directions for the 'select tall' operations, in practice - we just make them big enough). - -rendering: - geometry: - Radiant tells the object what combination of 4 opengl states is currently active: - none - draw as wireframe - fill - draw as filled - alpha blend - provide an opacity value - texture_2d - provide a texture and texture coordinates - lighting - provide normals, enable/disable smooth shading - The object uses opengl to set up its geometry and to draw itself. - material: - The object provides a material name and is assigned a reference to - a shader that matches the name. - The shader contains the texture ID and the opacity value. - The shader is a reference to an external script and must be refreshed - on request. - - -Proposed implementation: -======================== - -changes in shared interfaces (include/ directory): --------------------------------------------------- - -The following new interfaces will be added: -most likely those interfaces will be implemented in the module - -/*! -something that can be selected -*/ -class ISelect -{ - bool TestRay(ray_t) = 0 - bool TestBox(vec3_t vec_min, vec3_t vec_max) = 0; -} - -/*! -something that can be selected for edition -this must be synced with entity epairs -(such as origin and angles keys) -*/ -class IEdit -{ - void Translate(vec3_t v) = 0; - void Rotate(vec3_t origin, vec3_t angles) = 0; -} - -for rendering, the existing IGL2DWindow and IGL3DWindow APIs -we can define -class IRender : public IGL2DWindow, public IGL3DWindow -so that we have the Render2D and Render3D on the same class - -entity_t will have to be modified, adding the following struct: -typedef struct entity_interfaces_s -{ - ISelect *pSelect - IEdit *pEdit - IRender *pRender -} -entity_interfaces_t; - -When one of the pointers inside entity_t::entity_interfaces -is != we will handle the entity differently that what we are -doing by default. We will rely on these APIs for rendering, -manipulation etc. - -the AABB issue: - - -changes in the core: --------------------- - -In all cases where the entity_t has to be drawn, tested for selection, -manipulated (translation and rotation), add new code to go through the APIs. - - -md3 module: ------------ - -static function table API - -- registering of "model" module -need some minors? "md3" etc. - -- BuildEntity(entity_t) -if an entity involved with models is found, core will call this -entity_t::entity_interfaces will be filled with the relevant classes - -(NOTE:L we don't have a need right now to manipulate a model that -would not be part of an entity. so let's not try to guess what it -would be like) - -CModel -stores the trisoup, local AABBs, references to shaders -(CModel potentially needs a CModelManager to handle -model loads and cached models queries) - -CModelEntity implements IRender ISelect IEdit -stores an entity_t* -implements the interfaces pointed to in the entity_t -is reference counted obviously -stores a CModel*, calls up to it with entity information for rendering - diff --git a/plugins/md3model/ident.h b/plugins/md3model/ident.h deleted file mode 100644 index 30d81fba..00000000 --- a/plugins/md3model/ident.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_IDENT_H) -#define INCLUDED_IDENT_H - -#include - -// equality comparison for two 4-byte ident strings -inline bool ident_equal(const unsigned char* ident, const unsigned char* other) -{ - return ident[0] == other[0] && ident[1] == other[1] && ident[2] == other[2] && ident[3] == other[3]; -} - -#endif diff --git a/plugins/md3model/md2.cpp b/plugins/md3model/md2.cpp deleted file mode 100644 index 55a32f5f..00000000 --- a/plugins/md3model/md2.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "md2.h" - -#include "ifilesystem.h" -#include "imodel.h" - -#include "imagelib.h" -#include "bytestreamutils.h" - -#include "model.h" -#include "ident.h" -#include "mdlnormals.h" - -typedef unsigned char byte; - -/* -======================================================================== - -.MD2 triangle model file format - -======================================================================== -*/ -#define MD2_NUMVERTEXNORMALS 162 -#define MD2_MAX_SKINNAME 64 - -const unsigned char MD2_IDENT[4] = { 'I', 'D', 'P', '2', }; -#define MD2_VERSION 8 - -#define MD2_MAX_TRIANGLES 4096 -#define MD2_MAX_VERTS 2048 -#define MD2_MAX_FRAMES 512 -#define MD2_MAX_MD2SKINS 32 -#define MD2_MAX_SKINNAME 64 - -typedef struct -{ - short s; - short t; -} md2St_t; - -void istream_read_md2St(PointerInputStream& inputStream, md2St_t& st) -{ - st.s = istream_read_int16_le(inputStream); - st.t = istream_read_int16_le(inputStream); -} - -typedef struct -{ - short index_xyz[3]; - short index_st[3]; -} md2Triangle_t; - -void istream_read_md2Triangle(PointerInputStream& inputStream, md2Triangle_t& triangle) -{ - triangle.index_xyz[0] = istream_read_int16_le(inputStream); - triangle.index_xyz[1] = istream_read_int16_le(inputStream); - triangle.index_xyz[2] = istream_read_int16_le(inputStream); - triangle.index_st[0] = istream_read_int16_le(inputStream); - triangle.index_st[1] = istream_read_int16_le(inputStream); - triangle.index_st[2] = istream_read_int16_le(inputStream); -} - -typedef struct -{ - byte v[3]; // scaled byte to fit in frame mins/maxs - byte lightnormalindex; -} md2XyzNormal_t; - -void istream_read_md2XyzNormal(PointerInputStream& inputStream, md2XyzNormal_t& xyz) -{ - inputStream.read(xyz.v, 3); - inputStream.read(&xyz.lightnormalindex, 1); -} - -#define MD2_XYZNORMAL_V0 0 -#define MD2_XYZNORMAL_V1 1 -#define MD2_XYZNORMAL_V2 2 -#define MD2_XYZNORMAL_LNI 3 -#define MD2_XYZNORMAL_SIZE 4 - -typedef struct -{ - float scale[3]; // multiply byte verts by this - float translate[3]; // then add this - char name[16]; // frame name from grabbing - md2XyzNormal_t verts[1]; // variable sized -} md2Frame_t; - -void istream_read_md2Frame(PointerInputStream& inputStream, md2Frame_t& frame) -{ - frame.scale[0] = istream_read_float32_le(inputStream); - frame.scale[1] = istream_read_float32_le(inputStream); - frame.scale[2] = istream_read_float32_le(inputStream); - frame.translate[0] = istream_read_float32_le(inputStream); - frame.translate[1] = istream_read_float32_le(inputStream); - frame.translate[2] = istream_read_float32_le(inputStream); - inputStream.read(reinterpret_cast(frame.name), 16); -} - - -// the glcmd format: -// a positive integer starts a tristrip command, followed by that many -// vertex structures. -// a negative integer starts a trifan command, followed by -x vertexes -// a zero indicates the end of the command list. -// a vertex consists of a floating point s, a floating point t, -// and an integer vertex index. - - -typedef struct -{ - unsigned char ident[4]; - int version; - - int skinwidth; - int skinheight; - int framesize; // byte size of each frame - - int num_skins; - int num_xyz; - int num_st; // greater than num_xyz for seams - int num_tris; - int num_glcmds; // dwords in strip/fan command list - int num_frames; - - int ofs_skins; // each skin is a MAX_SKINNAME string - int ofs_st; // byte offset from start for md2St_t - int ofs_tris; // offset for md2triangle_t - int ofs_frames; // offset for first md2Frame_t - int ofs_glcmds; - int ofs_end; // end of file - -} md2Header_t; - -void istream_read_md2Header(PointerInputStream& inputStream, md2Header_t& header) -{ - inputStream.read(header.ident, 4); - header.version = istream_read_int32_le(inputStream); - header.skinwidth = istream_read_int32_le(inputStream); - header.skinheight = istream_read_int32_le(inputStream); - header.framesize = istream_read_int32_le(inputStream); - header.num_skins = istream_read_int32_le(inputStream); - header.num_xyz = istream_read_int32_le(inputStream); - header.num_st = istream_read_int32_le(inputStream); - header.num_tris = istream_read_int32_le(inputStream); - header.num_glcmds = istream_read_int32_le(inputStream); - header.num_frames = istream_read_int32_le(inputStream); - header.ofs_skins = istream_read_int32_le(inputStream); - header.ofs_st = istream_read_int32_le(inputStream); - header.ofs_tris = istream_read_int32_le(inputStream); - header.ofs_frames = istream_read_int32_le(inputStream); - header.ofs_glcmds = istream_read_int32_le(inputStream); - header.ofs_end = istream_read_int32_le(inputStream); -} - - -ArbitraryMeshVertex MD2Vertex_construct(const md2Header_t* pHeader, const md2Frame_t* pFrame, const md2XyzNormal_t* xyz, const md2St_t* st) -{ - return ArbitraryMeshVertex( - Vertex3f( - xyz->v[0] * pFrame->scale[0] + pFrame->translate[0], - xyz->v[1] * pFrame->scale[1] + pFrame->translate[1], - xyz->v[2] * pFrame->scale[2] + pFrame->translate[2] - ), - Normal3f( - g_mdl_normals[xyz->lightnormalindex][0], - g_mdl_normals[xyz->lightnormalindex][1], - g_mdl_normals[xyz->lightnormalindex][2] - ), - TexCoord2f( - (float)st->s / pHeader->skinwidth, - (float)st->t / pHeader->skinheight - ) - ); -} - -void MD2Surface_read(Model& model, const byte* buffer, ArchiveFile& file) -{ - Surface& surface = model.newSurface(); - md2Header_t header; - { - PointerInputStream inputStream(buffer); - istream_read_md2Header(inputStream, header); - } - - { - - md2Frame_t frame; - PointerInputStream frameStream(buffer + header.ofs_frames); - istream_read_md2Frame(frameStream, frame); - - - surface.indices().reserve(header.num_tris * 3); - - Array md2Xyz(header.num_xyz); - for(Array::iterator i = md2Xyz.begin(); i != md2Xyz.end(); ++i) - { - istream_read_md2XyzNormal(frameStream, *i); - } - - Array md2St(header.num_st); - PointerInputStream stStream(buffer + header.ofs_st); - for(Array::iterator i = md2St.begin(); i != md2St.end(); ++i) - { - istream_read_md2St(stStream, *i); - } - - UniqueVertexBuffer inserter(surface.vertices()); - inserter.reserve(header.num_st); - - PointerInputStream triangleStream(buffer + header.ofs_tris); - for(int i = 0; i < header.num_tris; ++i) - { - md2Triangle_t triangle; - istream_read_md2Triangle(triangleStream, triangle); - surface.indices().insert(inserter.insert(MD2Vertex_construct(&header, &frame, &md2Xyz[triangle.index_xyz[0]], &md2St[triangle.index_st[0]]))); - surface.indices().insert(inserter.insert(MD2Vertex_construct(&header, &frame, &md2Xyz[triangle.index_xyz[1]], &md2St[triangle.index_st[1]]))); - surface.indices().insert(inserter.insert(MD2Vertex_construct(&header, &frame, &md2Xyz[triangle.index_xyz[2]], &md2St[triangle.index_st[2]]))); - } - } - - char skinname[MD2_MAX_SKINNAME]; - char skinnameRelative[MD2_MAX_SKINNAME]; - char path[MD2_MAX_SKINNAME]; - int i = MD2_MAX_SKINNAME; - PointerInputStream inputStream(buffer + header.ofs_skins); - inputStream.read(reinterpret_cast(skinnameRelative), MD2_MAX_SKINNAME); - // relative texture path - allows moving of models in game dir structure without changing the skinpath - // e.g. used in ufo:ai - if (skinnameRelative[0] == '.') - { - strncpy(path, file.getName(), MD2_MAX_SKINNAME); - for (; i--;) - { - // skip filename - if (path[i] == '/' || path[i] == '\\') - break; - path[i] = '\0'; - } -// globalErrorStream() << "modified skinname: " << path << " (path) and " << skinnameRelative << " (texture)" << "\n"; - snprintf(skinname, MD2_MAX_SKINNAME, "%s%s", path, &skinnameRelative[1]); -// globalErrorStream() << skinname << "\n"; - } - else - { - strcpy(skinname, skinnameRelative); - } - surface.setShader(skinname); - surface.updateAABB(); -} - -void MD2Model_read(Model& model, const byte* buffer, ArchiveFile& file) -{ - MD2Surface_read(model, buffer, file); - model.updateAABB(); -} - -scene::Node& MD2Model_new(const byte* buffer, ArchiveFile& file) -{ - ModelNode* modelNode = new ModelNode(); - MD2Model_read(modelNode->model(), buffer, file); - return modelNode->node(); -} - -scene::Node& MD2Model_default() -{ - ModelNode* modelNode = new ModelNode(); - Model_constructNull(modelNode->model()); - return modelNode->node(); -} - -scene::Node& MD2Model_fromBuffer(unsigned char* buffer, ArchiveFile& file) -{ - if (!ident_equal(buffer, MD2_IDENT)) - { - globalErrorStream() << "MD2 read error: incorrect ident\n"; - return MD2Model_default(); - } - else - { - return MD2Model_new(buffer, file); - } -} - -scene::Node& loadMD2Model(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return MD2Model_fromBuffer(buffer.buffer, file); -} diff --git a/plugins/md3model/md2.h b/plugins/md3model/md2.h deleted file mode 100644 index 5b22c004..00000000 --- a/plugins/md3model/md2.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MD2_H) -#define INCLUDED_MD2_H - -namespace scene { class Node; } -class ArchiveFile; -scene::Node& loadMD2Model(ArchiveFile& file); - - -#endif diff --git a/plugins/md3model/md3.cpp b/plugins/md3model/md3.cpp deleted file mode 100644 index 42fa37b6..00000000 --- a/plugins/md3model/md3.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "md3.h" - -#include "ifilesystem.h" -#include "imodel.h" - -#include "imagelib.h" -#include "bytestreamutils.h" - -#include "model.h" -#include "ident.h" -#include "md3normals.h" - -// the maximum size of game reletive pathnames -#define MAX_QPATH 64 - -/* -======================================================================== - -.MD3 triangle model file format - -======================================================================== -*/ - -const unsigned char MD3_IDENT[4] = { 'I', 'D', 'P', '3', }; -#define MD3_VERSION 15 - -// limits -#define MD3_MAX_LODS 4 -#define MD3_MAX_TRIANGLES 8192 // per surface -#define MD3_MAX_VERTS 4096 // per surface -#define MD3_MAX_SHADERS 256 // per surface -#define MD3_MAX_FRAMES 1024 // per model -#define MD3_MAX_SURFACES 32 // per model -#define MD3_MAX_TAGS 16 // per frame - -// vertex scales -#define MD3_XYZ_SCALE (1.f / 64) - -typedef float float3[3]; - -void istream_read_float3(PointerInputStream& inputStream, float3 f) -{ - f[0] = istream_read_float32_le(inputStream); - f[1] = istream_read_float32_le(inputStream); - f[2] = istream_read_float32_le(inputStream); -} - -typedef struct md3Frame_s { - float3 bounds[2]; - float3 localOrigin; - float radius; - char name[16]; -} md3Frame_t; - -void istream_read_md3Frame(PointerInputStream& inputStream, md3Frame_t& frame) -{ - istream_read_float3(inputStream, frame.bounds[0]); - istream_read_float3(inputStream, frame.bounds[1]); - istream_read_float3(inputStream, frame.localOrigin); - frame.radius = istream_read_float32_le(inputStream); - inputStream.read(reinterpret_cast(frame.name), 16); -} - -typedef struct md3Tag_s { - char name[MAX_QPATH]; // tag name - float3 origin; - float3 axis[3]; -} md3Tag_t; - -void istream_read_md3Shader(PointerInputStream& inputStream, md3Tag_t& tag) -{ - inputStream.read(reinterpret_cast(tag.name), MAX_QPATH); - istream_read_float3(inputStream, tag.origin); - istream_read_float3(inputStream, tag.axis[0]); - istream_read_float3(inputStream, tag.axis[1]); - istream_read_float3(inputStream, tag.axis[2]); -} - -/* -** md3Surface_t -** -** CHUNK SIZE -** header sizeof( md3Surface_t ) -** shaders sizeof( md3Shader_t ) * numShaders -** triangles[0] sizeof( md3Triangle_t ) * numTriangles -** st sizeof( md3St_t ) * numVerts -** XyzNormals sizeof( md3XyzNormal_t ) * numVerts * numFrames -*/ -typedef struct { - char ident[4]; // - - char name[MAX_QPATH]; // polyset name - - int flags; - int numFrames; // all surfaces in a model should have the same - - int numShaders; // all surfaces in a model should have the same - int numVerts; - - int numTriangles; - int ofsTriangles; - - int ofsShaders; // offset from start of md3Surface_t - int ofsSt; // texture coords are common for all frames - int ofsXyzNormals; // numVerts * numFrames - - int ofsEnd; // next surface follows -} md3Surface_t; - -void istream_read_md3Surface(PointerInputStream& inputStream, md3Surface_t& surface) -{ - inputStream.read(reinterpret_cast(surface.ident), 4); - inputStream.read(reinterpret_cast(surface.name), MAX_QPATH); - surface.flags = istream_read_int32_le(inputStream); - surface.numFrames = istream_read_int32_le(inputStream); - surface.numShaders = istream_read_int32_le(inputStream); - surface.numVerts = istream_read_int32_le(inputStream); - surface.numTriangles = istream_read_int32_le(inputStream); - surface.ofsTriangles = istream_read_int32_le(inputStream); - surface.ofsShaders = istream_read_int32_le(inputStream); - surface.ofsSt = istream_read_int32_le(inputStream); - surface.ofsXyzNormals = istream_read_int32_le(inputStream); - surface.ofsEnd = istream_read_int32_le(inputStream); -} - -typedef struct { - char name[MAX_QPATH]; - int shaderIndex; // for in-game use -} md3Shader_t; - -void istream_read_md3Shader(PointerInputStream& inputStream, md3Shader_t& shader) -{ - inputStream.read(reinterpret_cast(shader.name), MAX_QPATH); - shader.shaderIndex = istream_read_int32_le(inputStream); -} - -typedef struct { - int indexes[3]; -} md3Triangle_t; - -void istream_read_md3Triangle(PointerInputStream& inputStream, md3Triangle_t& triangle) -{ - triangle.indexes[0] = istream_read_int32_le(inputStream); - triangle.indexes[1] = istream_read_int32_le(inputStream); - triangle.indexes[2] = istream_read_int32_le(inputStream); -} - -typedef struct { - float st[2]; -} md3St_t; - -void istream_read_md3St(PointerInputStream& inputStream, md3St_t& st) -{ - st.st[0] = istream_read_float32_le(inputStream); - st.st[1] = istream_read_float32_le(inputStream); -} - -typedef struct { - short xyz[3]; - short normal; -} md3XyzNormal_t; - -void istream_read_md3XyzNormal(PointerInputStream& inputStream, md3XyzNormal_t& xyz) -{ - xyz.xyz[0] = istream_read_int16_le(inputStream); - xyz.xyz[1] = istream_read_int16_le(inputStream); - xyz.xyz[2] = istream_read_int16_le(inputStream); - xyz.normal = istream_read_int16_le(inputStream); -} - -typedef struct { - char ident[4]; - int version; - - char name[MAX_QPATH]; // model name - - int flags; - - int numFrames; - int numTags; - int numSurfaces; - - int numSkins; - - int ofsFrames; // offset for first frame - int ofsTags; // numFrames * numTags - int ofsSurfaces; // first surface, others follow - - int ofsEnd; // end of file -} md3Header_t; - -void istream_read_md3Header(PointerInputStream& inputStream, md3Header_t& header) -{ - inputStream.read(reinterpret_cast(header.ident), 4); - header.version = istream_read_int32_le(inputStream); - inputStream.read(reinterpret_cast(header.name), MAX_QPATH); - header.flags = istream_read_int32_le(inputStream); - header.numFrames = istream_read_int32_le(inputStream); - header.numTags = istream_read_int32_le(inputStream); - header.numSurfaces = istream_read_int32_le(inputStream); - header.numSkins = istream_read_int32_le(inputStream); - header.ofsFrames = istream_read_int32_le(inputStream); - header.ofsTags = istream_read_int32_le(inputStream); - header.ofsSurfaces = istream_read_int32_le(inputStream); - header.ofsEnd = istream_read_int32_le(inputStream); -} - -int MD3Surface_read(Surface& surface, unsigned char* buffer) -{ - md3Surface_t md3Surface; - { - PointerInputStream inputStream(buffer); - istream_read_md3Surface(inputStream, md3Surface); - } - - { - surface.vertices().reserve(md3Surface.numVerts); - - PointerInputStream xyzNormalStream(buffer + md3Surface.ofsXyzNormals); - PointerInputStream stStream(buffer + md3Surface.ofsSt); - - // read verts into vertex array - xyz, st, normal - for(int i = 0; i < md3Surface.numVerts; i++) - { - md3XyzNormal_t md3Xyz; - istream_read_md3XyzNormal(xyzNormalStream, md3Xyz); - - md3St_t md3St; - istream_read_md3St(stStream, md3St); - - surface.vertices().push_back( - ArbitraryMeshVertex( - Vertex3f( md3Xyz.xyz[0] * MD3_XYZ_SCALE, md3Xyz.xyz[1] * MD3_XYZ_SCALE, md3Xyz.xyz[2] * MD3_XYZ_SCALE), - DecodeNormal(reinterpret_cast(&md3Xyz.normal)), - TexCoord2f(md3St.st[0], md3St.st[1]) - ) - ); - } - } - - { - surface.indices().reserve(md3Surface.numTriangles * 3); - - PointerInputStream inputStream(buffer + md3Surface.ofsTriangles); - for(int i = 0; i < md3Surface.numTriangles; i++) - { - md3Triangle_t md3Triangle; - istream_read_md3Triangle(inputStream, md3Triangle); - surface.indices().insert(md3Triangle.indexes[0]); - surface.indices().insert(md3Triangle.indexes[1]); - surface.indices().insert(md3Triangle.indexes[2]); - } - } - - { - md3Shader_t md3Shader; - { - PointerInputStream inputStream(buffer + md3Surface.ofsShaders); - istream_read_md3Shader(inputStream, md3Shader); - } - surface.setShader(md3Shader.name); - } - - surface.updateAABB(); - - return md3Surface.ofsEnd; -} - -void MD3Model_read(Model& model, unsigned char* buffer) -{ - md3Header_t md3Header; - { - PointerInputStream inputStream(buffer); - istream_read_md3Header(inputStream, md3Header); - } - - unsigned char* surfacePosition = buffer + md3Header.ofsSurfaces; - - for(int i = 0; i != md3Header.numSurfaces; ++i) - { - surfacePosition += MD3Surface_read(model.newSurface(), surfacePosition); - } - - model.updateAABB(); -} - -scene::Node& MD3Model_new(unsigned char* buffer) -{ - ModelNode* modelNode = new ModelNode(); - MD3Model_read(modelNode->model(), buffer); - return modelNode->node(); -} - -scene::Node& MD3Model_default() -{ - ModelNode* modelNode = new ModelNode(); - Model_constructNull(modelNode->model()); - return modelNode->node(); -} - -scene::Node& MD3Model_fromBuffer(unsigned char* buffer) -{ - if (!ident_equal(buffer, MD3_IDENT)) - { - globalErrorStream() << "MD3 read error: incorrect ident\n"; - return MD3Model_default(); - } - else - { - return MD3Model_new(buffer); - } -} - -scene::Node& loadMD3Model(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return MD3Model_fromBuffer(buffer.buffer); -} - diff --git a/plugins/md3model/md3.h b/plugins/md3model/md3.h deleted file mode 100644 index c86269d6..00000000 --- a/plugins/md3model/md3.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MD3_H) -#define INCLUDED_MD3_H - -namespace scene { class Node; } -class ArchiveFile; -scene::Node& loadMD3Model(ArchiveFile& file); - -#endif diff --git a/plugins/md3model/md3normals.cpp b/plugins/md3model/md3normals.cpp deleted file mode 100644 index 3090f2ba..00000000 --- a/plugins/md3model/md3normals.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "md3normals.h" - diff --git a/plugins/md3model/md5.cpp b/plugins/md3model/md5.cpp deleted file mode 100644 index 9ce15a76..00000000 --- a/plugins/md3model/md5.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "md5.h" - -#include "iscriplib.h" -#include "imodel.h" - -#include "archivelib.h" -#include "stringio.h" - -#include "model.h" - -#define MD5_RETURN_FALSE_IF_FAIL(expression) if(!(expression)) { globalErrorStream() << "md5 parse failed: " #expression "\n"; return false; } else - -bool MD5_parseToken(Tokeniser& tokeniser, const char* string) -{ - const char* token = tokeniser.getToken(); - MD5_RETURN_FALSE_IF_FAIL(token != 0); - return string_equal(token, string); -} - -bool MD5_parseFloat(Tokeniser& tokeniser, float& f) -{ - const char* token = tokeniser.getToken(); - MD5_RETURN_FALSE_IF_FAIL(token != 0); - return string_parse_float(token, f); -} - -bool MD5_parseString(Tokeniser& tokeniser, const char*& s) -{ - const char* token = tokeniser.getToken(); - MD5_RETURN_FALSE_IF_FAIL(token != 0); - s = token; - return true; -} - -bool MD5_parseInteger(Tokeniser& tokeniser, int& i) -{ - const char* token = tokeniser.getToken(); - MD5_RETURN_FALSE_IF_FAIL(token != 0); - return string_parse_int(token, i); -} - -bool MD5_parseSize(Tokeniser& tokeniser, std::size_t& i) -{ - const char* token = tokeniser.getToken(); - MD5_RETURN_FALSE_IF_FAIL(token != 0); - return string_parse_size(token, i); -} - -bool MD5_parseVector3(Tokeniser& tokeniser, Vector3& v) -{ - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "(")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, v.x())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, v.y())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, v.z())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, ")")); - return true; -} - -template -inline Element float_squared(const Element& f) -{ - return f * f; -} - -class MD5Joint -{ -public: - int parent; - Vector3 position; - Vector4 rotation; -}; - -typedef Array MD5Joints; - -class MD5Vert -{ -public: - std::size_t index; - float u; - float v; - std::size_t weight_index; - std::size_t weight_count; -}; - -typedef Array MD5Verts; - -class MD5Tri -{ -public: - std::size_t index; - std::size_t a; - std::size_t b; - std::size_t c; -}; - -typedef Array MD5Tris; - -class MD5Weight -{ -public: - std::size_t index; - std::size_t joint; - float t; - Vector3 v; -}; - -typedef Array MD5Weights; - -typedef float MD5Component; -typedef Array MD5Components; - -class MD5Frame -{ -public: - MD5Components m_components; -}; - -typedef Array MD5Weights; - -bool MD5_parseVersion(Tokeniser& tokeniser) -{ - { - const char* versionKey = tokeniser.getToken(); - if(versionKey == 0 || !string_equal(versionKey, "MD5Version")) - { - globalErrorStream() << "not a valid md5 file\n"; - return false; - } - } - { - const char* versionValue = tokeniser.getToken(); - if(versionValue == 0 || !string_equal(versionValue, "10")) - { - globalErrorStream() << "only md5 version 10 supported\n"; - return false; - } - } - - return true; -} - -bool MD5Anim_parse(Tokeniser& tokeniser) -{ - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVersion(tokeniser)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "commandline")); - const char* commandline; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, commandline)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numFrames")); - std::size_t numFrames; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numFrames)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numJoints")); - std::size_t numJoints; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numJoints)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "frameRate")); - std::size_t frameRate; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, frameRate)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numAnimatedComponents")); - std::size_t numAnimatedComponents; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numAnimatedComponents)); - tokeniser.nextLine(); - - // parse heirarchy - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "hierarchy")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(std::size_t i = 0; i < numJoints; ++i) - { - const char* name; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, name)); - int parent; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseInteger(tokeniser, parent)); - std::size_t flags; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, flags)); - std::size_t index; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, index)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - - // parse bounds - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "bounds")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(std::size_t i = 0; i < numFrames; ++i) - { - Vector3 mins; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, mins)); - Vector3 maxs; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, maxs)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - - // parse baseframe - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "baseframe")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(std::size_t i = 0; i < numJoints; ++i) - { - Vector3 position; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, position)); - Vector3 rotation; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, rotation)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - - // parse frames - for(std::size_t i = 0; i < numFrames; ++i) - { - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "frame")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(std::size_t i = 0; i < numAnimatedComponents; ++i) - { - float component; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, component)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - } - - return true; -} - -bool MD5Model_parse(Model& model, Tokeniser& tokeniser) -{ - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVersion(tokeniser)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "commandline")); - const char* commandline; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, commandline)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numJoints")); - std::size_t numJoints; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numJoints)); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numMeshes")); - std::size_t numMeshes; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numMeshes)); - tokeniser.nextLine(); - - MD5Joints joints(numJoints); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "joints")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(MD5Joints::iterator i = joints.begin(); i != joints.end(); ++i) - { - const char* jointName; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, jointName)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseInteger(tokeniser, (*i).parent)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, (*i).position)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, vector4_to_vector3((*i).rotation))); - (*i).rotation.w() = -static_cast(sqrt(1.0f - (float_squared((*i).rotation.x()) + float_squared((*i).rotation.y()) + float_squared((*i).rotation.z())))); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - - for(std::size_t i = 0; i < numMeshes; ++i) - { - Surface& surface = model.newSurface(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "mesh")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "shader")); - const char* shader; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, shader)); - surface.setShader(shader); - tokeniser.nextLine(); - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numverts")); - std::size_t numVerts; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numVerts)); - tokeniser.nextLine(); - - MD5Verts verts(numVerts); - - for(MD5Verts::iterator j = verts.begin(); j != verts.end(); ++j) - { - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "vert")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index)); - MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - verts.begin())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "(")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).u)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).v)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, ")")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).weight_index)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).weight_count)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numtris")); - std::size_t numTris; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numTris)); - tokeniser.nextLine(); - - MD5Tris tris(numTris); - - for(MD5Tris::iterator j = tris.begin(); j != tris.end(); ++j) - { - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "tri")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index)); - MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - tris.begin())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).a)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).b)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).c)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numweights")); - std::size_t numWeights; - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numWeights)); - tokeniser.nextLine(); - - MD5Weights weights(numWeights); - - for(MD5Weights::iterator j = weights.begin(); j != weights.end(); ++j) - { - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "weight")); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index)); - MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - weights.begin())); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).joint)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).t)); - MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, (*j).v)); - tokeniser.nextLine(); - } - - MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}")); - tokeniser.nextLine(); - - for(MD5Verts::iterator j = verts.begin(); j != verts.end(); ++j) - { - MD5Vert& vert = (*j); - - Vector3 skinned(0, 0, 0); - for(std::size_t k = 0; k != vert.weight_count; ++k) - { - MD5Weight& weight = weights[vert.weight_index + k]; - MD5Joint& joint = joints[weight.joint]; - - skinned += (quaternion_transformed_point(joint.rotation, weight.v) + joint.position) * weight.t; - } - - surface.vertices().push_back(ArbitraryMeshVertex(vertex3f_for_vector3(skinned), Normal3f(0, 0, 0), TexCoord2f(vert.u, vert.v))); - } - - for(MD5Tris::iterator j = tris.begin(); j != tris.end(); ++j) - { - MD5Tri& tri = (*j); - surface.indices().insert(RenderIndex(tri.a)); - surface.indices().insert(RenderIndex(tri.b)); - surface.indices().insert(RenderIndex(tri.c)); - } - - for(Surface::indices_t::iterator j = surface.indices().begin(); j != surface.indices().end(); j += 3) - { - ArbitraryMeshVertex& a = surface.vertices()[*(j + 0)]; - ArbitraryMeshVertex& b = surface.vertices()[*(j + 1)]; - ArbitraryMeshVertex& c = surface.vertices()[*(j + 2)]; - Vector3 weightedNormal( - vector3_cross( - reinterpret_cast(c.vertex) - reinterpret_cast(a.vertex), - reinterpret_cast(b.vertex) - reinterpret_cast(a.vertex) - ) - ); - reinterpret_cast(a.normal) += weightedNormal; - reinterpret_cast(b.normal) += weightedNormal; - reinterpret_cast(c.normal) += weightedNormal; - } - - for(Surface::vertices_t::iterator j = surface.vertices().begin(); j != surface.vertices().end(); ++j) - { - vector3_normalise(reinterpret_cast((*j).normal)); - } - - surface.updateAABB(); - } - - model.updateAABB(); - - return true; -} - -void MD5Model_construct(Model& model, TextInputStream& inputStream) -{ - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewSimpleTokeniser(inputStream); - MD5Model_parse(model, tokeniser); - tokeniser.release(); -} - -scene::Node& MD5Model_new(TextInputStream& inputStream) -{ - ModelNode* modelNode = new ModelNode(); - MD5Model_construct(modelNode->model(), inputStream); - return modelNode->node(); -} - -scene::Node& loadMD5Model(ArchiveFile& file) -{ - BinaryToTextInputStream inputStream(file.getInputStream()); - return MD5Model_new(inputStream); -} diff --git a/plugins/md3model/md5.h b/plugins/md3model/md5.h deleted file mode 100644 index 675f827b..00000000 --- a/plugins/md3model/md5.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MD5_H) -#define INCLUDED_MD5_H - -namespace scene { class Node; } -class ArchiveFile; -scene::Node& loadMD5Model(ArchiveFile& file); - -#endif diff --git a/plugins/md3model/mdc.cpp b/plugins/md3model/mdc.cpp deleted file mode 100644 index 8ad00c74..00000000 --- a/plugins/md3model/mdc.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mdc.h" - -#include "ifilesystem.h" -#include "imodel.h" - -#include "imagelib.h" -#include "bytestreamutils.h" - -#include "model.h" -#include "ident.h" -#include "md3normals.h" - - -const unsigned char MDC_IDENT[4] = { 'I', 'D', 'P', 'C', }; -const float MDC_XYZ_SCALE = 0.015625f; -#define MAX_QPATH 64 // max length of a quake game pathname - -typedef float float3[3]; - -struct mdcTriangle_t -{ - unsigned int indexes[3]; // not my spelling -}; - -void istream_read_mdcTriangle(PointerInputStream& inputStream, mdcTriangle_t& triangle) -{ - triangle.indexes[0] = istream_read_uint32_le(inputStream); - triangle.indexes[1] = istream_read_uint32_le(inputStream); - triangle.indexes[2] = istream_read_uint32_le(inputStream); -} - -struct mdcXyzNormal_t -{ - short xyz[3]; // divide by 64 - short normal; // packed same way as md3 -}; - -void istream_read_mdcXyzNormal(PointerInputStream& inputStream, mdcXyzNormal_t& xyz) -{ - xyz.xyz[0] = istream_read_int16_le(inputStream); - xyz.xyz[1] = istream_read_int16_le(inputStream); - xyz.xyz[2] = istream_read_int16_le(inputStream); - xyz.normal = istream_read_int16_le(inputStream); -} - -struct mdcSt_t -{ - float st[2]; // may need to reverse t -}; - -void istream_read_mdcSt(PointerInputStream& inputStream, mdcSt_t& st) -{ - st.st[0] = istream_read_float32_le(inputStream); - st.st[1] = istream_read_float32_le(inputStream); -} - -struct mdcShader_t -{ - char name[MAX_QPATH]; - unsigned int flags; -}; - -void istream_read_mdcShader(PointerInputStream& inputStream, mdcShader_t& shader) -{ - inputStream.read(reinterpret_cast(shader.name), MAX_QPATH); - shader.flags = istream_read_uint32_le(inputStream); -} - -struct mdcTagName_t -{ - char name[MAX_QPATH]; -}; - -struct mdcTagFrame_t -{ - short xyz[3]; // divide by 64 - short angles[3]; // euler in z x y order... deg = * (360.0 / 32767.0) .. rad = * (PI / 32767.0) -}; - -struct mdcFrame_t -{ - float3 bboxMin; - float3 bboxMax; - float3 localOrigin; - float radius; - char name[16]; -}; - -struct mdcSurface_t -{ - byte ident[4]; - char name[MAX_QPATH]; - unsigned int flags; - unsigned int numCompFrames; - unsigned int numBaseFrames; - unsigned int numShaders; - unsigned int numVerts; - unsigned int numTriangles; - unsigned int ofsTriangles; - unsigned int ofsShaders; - unsigned int ofsSt; - unsigned int ofsXyzNormals; - unsigned int ofsCompVerts; - unsigned int ofsFrameBaseFrames; - unsigned int ofsFrameCompFrames; - unsigned int ofsEnd; -}; - -void istream_read_mdcSurface(PointerInputStream& inputStream, mdcSurface_t& surface) -{ - inputStream.read(surface.ident, 4); - inputStream.read(reinterpret_cast(surface.name), MAX_QPATH); - surface.flags = istream_read_uint32_le(inputStream); - surface.numCompFrames = istream_read_uint32_le(inputStream); - surface.numBaseFrames = istream_read_uint32_le(inputStream); - surface.numShaders = istream_read_uint32_le(inputStream); - surface.numVerts = istream_read_uint32_le(inputStream); - surface.numTriangles = istream_read_uint32_le(inputStream); - surface.ofsTriangles = istream_read_uint32_le(inputStream); - surface.ofsShaders = istream_read_uint32_le(inputStream); - surface.ofsSt = istream_read_uint32_le(inputStream); - surface.ofsXyzNormals = istream_read_uint32_le(inputStream); - surface.ofsCompVerts = istream_read_uint32_le(inputStream); - surface.ofsFrameBaseFrames = istream_read_uint32_le(inputStream); - surface.ofsFrameCompFrames = istream_read_uint32_le(inputStream); - surface.ofsEnd = istream_read_uint32_le(inputStream); -} - -struct mdcHeader_t -{ - byte ident[4]; - unsigned int version; - char name[MAX_QPATH]; - unsigned int flags; - unsigned int numFrames; - unsigned int numTags; - unsigned int numSurfaces; - unsigned int numSkins; - unsigned int ofsFrames; - unsigned int ofsTagNames; - unsigned int ofsTags; - unsigned int ofsSurfaces; - unsigned int ofsEnd; -}; - -void istream_read_mdcHeader(PointerInputStream& inputStream, mdcHeader_t& header) -{ - inputStream.read(header.ident, 4); - header.version = istream_read_uint32_le(inputStream); - inputStream.read(reinterpret_cast(header.name), MAX_QPATH); - header.flags = istream_read_uint32_le(inputStream); - header.numFrames = istream_read_uint32_le(inputStream); - header.numTags = istream_read_uint32_le(inputStream); - header.numSurfaces = istream_read_uint32_le(inputStream); - header.numSkins = istream_read_uint32_le(inputStream); - header.ofsFrames = istream_read_uint32_le(inputStream); - header.ofsTagNames = istream_read_uint32_le(inputStream); - header.ofsTags = istream_read_uint32_le(inputStream); - header.ofsSurfaces = istream_read_uint32_le(inputStream); - header.ofsEnd = istream_read_uint32_le(inputStream); -} - -unsigned int MDCSurface_read(Surface& surface, const byte* buffer) -{ - mdcSurface_t mdcSurface; - { - PointerInputStream inputStream(buffer); - istream_read_mdcSurface(inputStream, mdcSurface); - } - - { - surface.vertices().reserve(mdcSurface.numVerts); - - PointerInputStream xyzStream(buffer + mdcSurface.ofsXyzNormals); - PointerInputStream stStream(buffer + mdcSurface.ofsSt); - // read verts into vertex array - xyz, st, normal - for(std::size_t i = 0; i < mdcSurface.numVerts; i++) - { - mdcXyzNormal_t mdcXyzNormal; - istream_read_mdcXyzNormal(xyzStream, mdcXyzNormal); - mdcSt_t mdcSt; - istream_read_mdcSt(stStream, mdcSt); - - surface.vertices().push_back( - ArbitraryMeshVertex( - Vertex3f( mdcXyzNormal.xyz[0] * MDC_XYZ_SCALE, mdcXyzNormal.xyz[1] * MDC_XYZ_SCALE, mdcXyzNormal.xyz[2] * MDC_XYZ_SCALE), - DecodeNormal(reinterpret_cast(&mdcXyzNormal.normal)), - TexCoord2f(mdcSt.st[0], mdcSt.st[1]) - ) - ); - } - } - - { - surface.indices().reserve(mdcSurface.numTriangles * 3); - - PointerInputStream triangleStream(buffer + mdcSurface.ofsTriangles); - - for(std::size_t i = 0; i < mdcSurface.numTriangles; i++) - { - mdcTriangle_t triangle; - istream_read_mdcTriangle(triangleStream, triangle); - surface.indices().insert(triangle.indexes[0]); - surface.indices().insert(triangle.indexes[1]); - surface.indices().insert(triangle.indexes[2]); - } - } - - { - mdcShader_t shader; - PointerInputStream inputStream(buffer + mdcSurface.ofsShaders); - istream_read_mdcShader(inputStream, shader); - surface.setShader(shader.name); - } - - surface.updateAABB(); - - return mdcSurface.ofsEnd; -} - -void MDCModel_read(Model& model, const byte* buffer) -{ - mdcHeader_t header; - { - PointerInputStream inputStream(buffer); - istream_read_mdcHeader(inputStream, header); - } - - const byte* surfacePosition = buffer + header.ofsSurfaces; - - for(std::size_t i = 0; i < header.numSurfaces; i++) - { - surfacePosition += MDCSurface_read(model.newSurface(), surfacePosition); - } - - model.updateAABB(); -} - -scene::Node& MDCModel_new(const byte* buffer) -{ - ModelNode* modelNode = new ModelNode(); - MDCModel_read(modelNode->model(), buffer); - return modelNode->node(); -} - -scene::Node& MDCModel_default() -{ - ModelNode* modelNode = new ModelNode(); - Model_constructNull(modelNode->model()); - return modelNode->node(); -} - -scene::Node& MDCModel_fromBuffer(unsigned char* buffer) -{ - if (!ident_equal(buffer, MDC_IDENT)) - { - globalErrorStream() << "MDC read error: incorrect ident\n"; - return MDCModel_default(); - } - else - { - return MDCModel_new(buffer); - } -} - -scene::Node& loadMDCModel(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return MDCModel_fromBuffer(buffer.buffer); -} - diff --git a/plugins/md3model/mdc.h b/plugins/md3model/mdc.h deleted file mode 100644 index 811679a1..00000000 --- a/plugins/md3model/mdc.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MDC_H) -#define INCLUDED_MDC_H - -namespace scene { class Node; } -class ArchiveFile; -scene::Node& loadMDCModel(ArchiveFile& file); - - -#endif diff --git a/plugins/md3model/mdl.cpp b/plugins/md3model/mdl.cpp deleted file mode 100644 index 9a199fc1..00000000 --- a/plugins/md3model/mdl.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mdl.h" - -#include "ifilesystem.h" -#include "imodel.h" - -#include "imagelib.h" -#include "bytestreamutils.h" - -#include "model.h" -#include "ident.h" -#include "mdlnormals.h" -#include "mdlformat.h" - -void istream_read_mdlHeader(PointerInputStream& inputStream, mdlHeader_t& header) -{ - inputStream.read(header.ident, 4); - header.version = istream_read_int32_le(inputStream); - header.scale[0] = istream_read_float32_le(inputStream); - header.scale[1] = istream_read_float32_le(inputStream); - header.scale[2] = istream_read_float32_le(inputStream); - header.scale_origin[0] = istream_read_float32_le(inputStream); - header.scale_origin[1] = istream_read_float32_le(inputStream); - header.scale_origin[2] = istream_read_float32_le(inputStream); - header.boundingradius = istream_read_float32_le(inputStream); - header.eyeposition[0] = istream_read_float32_le(inputStream); - header.eyeposition[1] = istream_read_float32_le(inputStream); - header.eyeposition[2] = istream_read_float32_le(inputStream); - header.numskins = istream_read_int32_le(inputStream); - header.skinwidth = istream_read_int32_le(inputStream); - header.skinheight = istream_read_int32_le(inputStream); - header.numverts = istream_read_int32_le(inputStream); - header.numtris = istream_read_int32_le(inputStream); - header.numframes = istream_read_int32_le(inputStream); - header.synctype = istream_read_int32_le(inputStream); - header.flags = istream_read_int32_le(inputStream); - header.size = istream_read_float32_le(inputStream); -} - -inline ArbitraryMeshVertex MDLVertex_construct(const mdlHeader_t& header, const mdlXyzNormal_t& xyz, const mdlSt_t& st, bool facesfront) -{ - return ArbitraryMeshVertex( - Vertex3f( - xyz.v[0] * header.scale[0] + header.scale_origin[0], - xyz.v[1] * header.scale[1] + header.scale_origin[1], - xyz.v[2] * header.scale[2] + header.scale_origin[2] - ), - Normal3f( - g_mdl_normals[xyz.lightnormalindex][0], - g_mdl_normals[xyz.lightnormalindex][1], - g_mdl_normals[xyz.lightnormalindex][2] - ), - TexCoord2f( - ((float)st.s / header.skinwidth) + ((st.onseam == MDL_ONSEAM && !facesfront) ? 0.5f : 0.0f), - (float)st.t / header.skinheight - ) - ); -} - -class mdlVertex_t -{ -public: - inline mdlVertex_t(int vertindex, int facesfront) - : m_vertindex(vertindex), m_facesfront(facesfront) - {} - inline bool operator<(const mdlVertex_t& other) const - { - if(m_facesfront < other.m_facesfront) - return true; - if(other.m_facesfront < m_facesfront) - return false; - - if(m_vertindex < other.m_vertindex) - return true; - if(other.m_vertindex < m_vertindex) - return false; - - return false; - } - inline bool operator==(const mdlVertex_t& other) const - { - return m_vertindex == other.m_vertindex - && m_facesfront == other.m_facesfront; - } - - int m_vertindex; - int m_facesfront; -}; - -typedef const mdlTriangle_t* mdlTriangleIterator; - -void MDLSurface_read(Surface& surface, const byte* buffer, const char* name) -{ - mdlHeader_t header; - - PointerInputStream inputStream(buffer); - istream_read_mdlHeader(inputStream, header); - - for(int i = 0; i < header.numskins; ++i) - { - switch(istream_read_int32_le(inputStream)) - { - case MDL_SKIN_SINGLE: - inputStream.seek(header.skinwidth * header.skinheight); - break; - case MDL_SKIN_GROUP: - int numskins = istream_read_int32_le(inputStream); - inputStream.seek(numskins * (4 + (header.skinwidth * header.skinheight))); - break; - } - } - - Array mdlSts(header.numverts); - for(Array::iterator i = mdlSts.begin(); i != mdlSts.end(); ++i) - { - (*i).onseam = istream_read_int32_le(inputStream); - (*i).s = istream_read_int32_le(inputStream); - (*i).t = istream_read_int32_le(inputStream); - } - - Array mdlTriangles(header.numtris); - for(Array::iterator i = mdlTriangles.begin(); i != mdlTriangles.end(); ++i) - { - (*i).facesfront = istream_read_int32_le(inputStream); - (*i).vertindex[0] = istream_read_int32_le(inputStream); - (*i).vertindex[1] = istream_read_int32_le(inputStream); - (*i).vertindex[2] = istream_read_int32_le(inputStream); - } - - { - bool found = false; - for(int i = 0; i < header.numframes && found == false; i++) - { - switch(istream_read_int32_le(inputStream)) - { - case MDL_FRAME_SINGLE: - inputStream.seek(MDL_FRAME_SIZE); - found = true; - break; - case MDL_FRAME_GROUP: - int numframes = istream_read_int32_le(inputStream); - inputStream.seek((MDL_XYZNORMAL_SIZE * 2) + (numframes * 4)); - found = true; - break; - } - } - } - - Array mdlXyzNormals(header.numtris); - for(Array::iterator i = mdlXyzNormals.begin(); i != mdlXyzNormals.end(); ++i) - { - inputStream.read((*i).v, 3); - inputStream.read(&(*i).lightnormalindex, 1); - } - - { - VertexBuffer mdl_vertices; - - { - UniqueVertexBuffer inserter(mdl_vertices); - for(Array::iterator i = mdlTriangles.begin(); i != mdlTriangles.end(); ++i) - { - surface.indices().insert(inserter.insert(mdlVertex_t((*i).vertindex[0], (*i).facesfront))); - surface.indices().insert(inserter.insert(mdlVertex_t((*i).vertindex[1], (*i).facesfront))); - surface.indices().insert(inserter.insert(mdlVertex_t((*i).vertindex[2], (*i).facesfront))); - } - } - - { - surface.vertices().reserve(mdl_vertices.size()); - - for(VertexBuffer::iterator i = mdl_vertices.begin(); i != mdl_vertices.end(); ++i) - { - surface.vertices().push_back(MDLVertex_construct(header, mdlXyzNormals[(*i).m_vertindex], mdlSts[(*i).m_vertindex], (*i).m_facesfront == MDL_FACES_FRONT)); - } - } - } - - surface.setShader(name); - surface.updateAABB(); -} - -void MDLModel_read(Model& model, const byte* buffer, const char* name) -{ - MDLSurface_read(model.newSurface(), buffer, name); - model.updateAABB(); -} - -scene::Node& MDLModel_new(const byte* buffer, const char* name) -{ - ModelNode* modelNode = new ModelNode(); - MDLModel_read(modelNode->model(), buffer, name); - return modelNode->node(); -} - -scene::Node& MDLModel_default() -{ - ModelNode* modelNode = new ModelNode(); - Model_constructNull(modelNode->model()); - return modelNode->node(); -} - -scene::Node& MDLModel_fromBuffer(unsigned char* buffer, const char* name) -{ - if (!ident_equal(buffer, MDL_IDENT)) - { - globalErrorStream() << "MDL read error: incorrect ident\n"; - return MDLModel_default(); - } - else - { - return MDLModel_new(buffer, name); - } -} - -scene::Node& loadMDLModel(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return MDLModel_fromBuffer(buffer.buffer, file.getName()); -} - diff --git a/plugins/md3model/mdl.h b/plugins/md3model/mdl.h deleted file mode 100644 index 28e318fe..00000000 --- a/plugins/md3model/mdl.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MDL_H) -#define INCLUDED_MDL_H - -namespace scene { class Node; } -class ArchiveFile; -scene::Node& loadMDLModel(ArchiveFile& file); - -#endif diff --git a/plugins/md3model/mdlformat.cpp b/plugins/md3model/mdlformat.cpp deleted file mode 100644 index 7d043fb1..00000000 --- a/plugins/md3model/mdlformat.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mdlformat.h" - diff --git a/plugins/md3model/mdlformat.h b/plugins/md3model/mdlformat.h deleted file mode 100644 index c1016028..00000000 --- a/plugins/md3model/mdlformat.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MDLFORMAT_H) -#define INCLUDED_MDLFORMAT_H - -typedef unsigned char byte; - -const unsigned char MDL_IDENT[4] = { 'I', 'D', 'P', 'O', }; - -#define MDL_VERSION 6 - -#define MDL_ONSEAM 0x0020 - -typedef enum { MDL_FRAME_SINGLE=0, MDL_FRAME_GROUP } aliasframetype_t; - -typedef enum { MDL_SKIN_SINGLE=0, MDL_SKIN_GROUP } aliasskintype_t; - -typedef float float3[3]; - -typedef struct { - byte ident[4]; - int version; - float3 scale; - float3 scale_origin; - float boundingradius; - float3 eyeposition; - int numskins; - int skinwidth; - int skinheight; - int numverts; - int numtris; - int numframes; - int synctype; - int flags; - float size; -} mdlHeader_t; - -// TODO: could be shorts - -typedef struct { - int onseam; - int s; - int t; -} mdlSt_t; - -typedef struct dtriangle_s { - int facesfront; - int vertindex[3]; -} mdlTriangle_t; - -#define MDL_FACES_FRONT 1 - -// This mirrors trivert_t in trilib.h, is present so Quake knows how to -// load this data - -typedef struct { - byte v[3]; - byte lightnormalindex; -} mdlXyzNormal_t; - -const int MDL_XYZNORMAL_SIZE = 4; - -typedef struct { - mdlXyzNormal_t bboxmin; // lightnormal isn't used - mdlXyzNormal_t bboxmax; // lightnormal isn't used - char name[16]; // frame name from grabbing -} mdlFrame_t; - -const int MDL_FRAME_SIZE = (MDL_XYZNORMAL_SIZE * 2) + 16; - -typedef struct { - int numframes; - mdlXyzNormal_t bboxmin; // lightnormal isn't used - mdlXyzNormal_t bboxmax; // lightnormal isn't used -} mdlFrameGroup_t; - -const int MDL_FRAMEGROUP_SIZE = 4 + (MDL_XYZNORMAL_SIZE * 2); - -typedef struct { - int numskins; -} mdlSkinGroup_t; - -typedef struct { - float interval; -} mdlFrameInterval_t; - -typedef struct { - float interval; -} mdlSkinInterval_t; - -typedef struct { - aliasframetype_t type; -} mdlFrameType_t; - -typedef struct { - aliasskintype_t type; -} mdlSkinType_t; - -#endif diff --git a/plugins/md3model/mdlimage.cpp b/plugins/md3model/mdlimage.cpp deleted file mode 100644 index 7c282ecd..00000000 --- a/plugins/md3model/mdlimage.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mdlimage.h" - -#include -#include - -#include "ifilesystem.h" -#include "bytestreamutils.h" - -#include "stream/textstream.h" -#include "imagelib.h" - -#include "mdlformat.h" -#include "ident.h" - - -unsigned char mdl_palette[768]; -/* -============== -Texture_InitPalette -============== -*/ -void Texture_InitPalette (byte *pal) -{ - int r,g,b; - int i; - int inf; - byte gammatable[256]; - double gamma; - - gamma = 1.0;//g_qeglobals.d_savedinfo.fGamma; - - if (gamma == 1.0) - { - for (i=0 ; i<256 ; i++) - gammatable[i] = i; - } else - { - for (i=0 ; i<256 ; i++) - { - inf = (int)(255 * pow ( (i+0.5)/255.5 , gamma ) + 0.5); - if (inf < 0) - inf = 0; - if (inf > 255) - inf = 255; - gammatable[i] = inf; - } - } - - for (i=0 ; i<256 ; i++) - { - r = gammatable[pal[0]]; - g = gammatable[pal[1]]; - b = gammatable[pal[2]]; - pal += 3; - - //v = (r<<24) + (g<<16) + (b<<8) + 255; - //v = BigLong (v); - - //mdl_palette[i] = v; - mdl_palette[i*3+0] = r; - mdl_palette[i*3+1] = g; - mdl_palette[i*3+2] = b; - } -} - -bool LoadPalette() -{ - unsigned char* buffer; - //int len = - vfsLoadFile ("gfx/palette.lmp", (void **) &buffer); - if (buffer == 0) - return false; - - Texture_InitPalette(buffer); - - vfsFreeFile(buffer); - - return true; -} - -Image* LoadMDLImageBuff(byte* buffer) -{ - if(!LoadPalette()) - { - return 0; - } - - if(!ident_equal(buffer, MDL_IDENT)) - { - globalErrorStream() << "LoadMDLImage: data has wrong ident\n"; - return 0; - } - - PointerInputStream inputStream(buffer); - inputStream.seek(4 + 4 + 12 + 12 + 4 + 12); - //int numskins = - istream_read_int32_le(inputStream); - int skinwidth = istream_read_int32_le(inputStream); - int skinheight = istream_read_int32_le(inputStream); - inputStream.seek(4 + 4 + 4 + 4 + 4 + 4); - - switch(istream_read_int32_le(inputStream)) - { - case MDL_SKIN_SINGLE: - break; - case MDL_SKIN_GROUP: - int numskins = istream_read_int32_le(inputStream); - inputStream.seek(numskins * 4); - break; - } - - RGBAImage* image = new RGBAImage(skinwidth, skinheight); - unsigned char* pRGBA = image->getRGBAPixels(); - - for(int i=0; i<(skinheight); i++) - { - for(int j=0; j<(skinwidth); j++) - { - byte index = istream_read_byte(inputStream); - *pRGBA++ = mdl_palette[index * 3 + 0]; - *pRGBA++ = mdl_palette[index * 3 + 1]; - *pRGBA++ = mdl_palette[index * 3 + 2]; - *pRGBA++ = 255; - } - } - - return image; -} - -Image* LoadMDLImage(ArchiveFile& file) -{ - ScopedArchiveBuffer buffer(file); - return LoadMDLImageBuff( buffer.buffer ); -} - -void MDLImage_Destroy(byte* pic) -{ - free(pic); -} diff --git a/plugins/md3model/mdlimage.h b/plugins/md3model/mdlimage.h deleted file mode 100644 index 3f64b37d..00000000 --- a/plugins/md3model/mdlimage.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MDLIMAGE_H) -#define INCLUDED_MDLIMAGE_H - -class Image; -class ArchiveFile; - -Image* LoadMDLImage(ArchiveFile& file); - -#endif diff --git a/plugins/md3model/mdlnormals.cpp b/plugins/md3model/mdlnormals.cpp deleted file mode 100644 index 183b9709..00000000 --- a/plugins/md3model/mdlnormals.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mdlnormals.h" - diff --git a/plugins/md3model/mdlnormals.h b/plugins/md3model/mdlnormals.h deleted file mode 100644 index a2c7dd62..00000000 --- a/plugins/md3model/mdlnormals.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -typedef const float mdlNormal_t[3]; -typedef const mdlNormal_t mdlNormals_t[162]; - -const mdlNormals_t g_mdl_normals = { - {-0.525731f, 0.000000f, 0.850651f, }, - {-0.442863f, 0.238856f, 0.864188f, }, - {-0.295242f, 0.000000f, 0.955423f, }, - {-0.309017f, 0.500000f, 0.809017f, }, - {-0.162460f, 0.262866f, 0.951056f, }, - { 0.000000f, 0.000000f, 1.000000f, }, - { 0.000000f, 0.850651f, 0.525731f, }, - {-0.147621f, 0.716567f, 0.681718f, }, - { 0.147621f, 0.716567f, 0.681718f, }, - { 0.000000f, 0.525731f, 0.850651f, }, - { 0.309017f, 0.500000f, 0.809017f, }, - { 0.525731f, 0.000000f, 0.850651f, }, - { 0.295242f, 0.000000f, 0.955423f, }, - { 0.442863f, 0.238856f, 0.864188f, }, - { 0.162460f, 0.262866f, 0.951056f, }, - {-0.681718f, 0.147621f, 0.716567f, }, - {-0.809017f, 0.309017f, 0.500000f, }, - {-0.587785f, 0.425325f, 0.688191f, }, - {-0.850651f, 0.525731f, 0.000000f, }, - {-0.864188f, 0.442863f, 0.238856f, }, - {-0.716567f, 0.681718f, 0.147621f, }, - {-0.688191f, 0.587785f, 0.425325f, }, - {-0.500000f, 0.809017f, 0.309017f, }, - {-0.238856f, 0.864188f, 0.442863f, }, - {-0.425325f, 0.688191f, 0.587785f, }, - {-0.716567f, 0.681718f,-0.147621f, }, - {-0.500000f, 0.809017f,-0.309017f, }, - {-0.525731f, 0.850651f, 0.000000f, }, - { 0.000000f, 0.850651f,-0.525731f, }, - {-0.238856f, 0.864188f,-0.442863f, }, - { 0.000000f, 0.955423f,-0.295242f, }, - {-0.262866f, 0.951056f,-0.162460f, }, - { 0.000000f, 1.000000f, 0.000000f, }, - { 0.000000f, 0.955423f, 0.295242f, }, - {-0.262866f, 0.951056f, 0.162460f, }, - { 0.238856f, 0.864188f, 0.442863f, }, - { 0.262866f, 0.951056f, 0.162460f, }, - { 0.500000f, 0.809017f, 0.309017f, }, - { 0.238856f, 0.864188f,-0.442863f, }, - { 0.262866f, 0.951056f,-0.162460f, }, - { 0.500000f, 0.809017f,-0.309017f, }, - { 0.850651f, 0.525731f, 0.000000f, }, - { 0.716567f, 0.681718f, 0.147621f, }, - { 0.716567f, 0.681718f,-0.147621f, }, - { 0.525731f, 0.850651f, 0.000000f, }, - { 0.425325f, 0.688191f, 0.587785f, }, - { 0.864188f, 0.442863f, 0.238856f, }, - { 0.688191f, 0.587785f, 0.425325f, }, - { 0.809017f, 0.309017f, 0.500000f, }, - { 0.681718f, 0.147621f, 0.716567f, }, - { 0.587785f, 0.425325f, 0.688191f, }, - { 0.955423f, 0.295242f, 0.000000f, }, - { 1.000000f, 0.000000f, 0.000000f, }, - { 0.951056f, 0.162460f, 0.262866f, }, - { 0.850651f,-0.525731f, 0.000000f, }, - { 0.955423f,-0.295242f, 0.000000f, }, - { 0.864188f,-0.442863f, 0.238856f, }, - { 0.951056f,-0.162460f, 0.262866f, }, - { 0.809017f,-0.309017f, 0.500000f, }, - { 0.681718f,-0.147621f, 0.716567f, }, - { 0.850651f, 0.000000f, 0.525731f, }, - { 0.864188f, 0.442863f,-0.238856f, }, - { 0.809017f, 0.309017f,-0.500000f, }, - { 0.951056f, 0.162460f,-0.262866f, }, - { 0.525731f, 0.000000f,-0.850651f, }, - { 0.681718f, 0.147621f,-0.716567f, }, - { 0.681718f,-0.147621f,-0.716567f, }, - { 0.850651f, 0.000000f,-0.525731f, }, - { 0.809017f,-0.309017f,-0.500000f, }, - { 0.864188f,-0.442863f,-0.238856f, }, - { 0.951056f,-0.162460f,-0.262866f, }, - { 0.147621f, 0.716567f,-0.681718f, }, - { 0.309017f, 0.500000f,-0.809017f, }, - { 0.425325f, 0.688191f,-0.587785f, }, - { 0.442863f, 0.238856f,-0.864188f, }, - { 0.587785f, 0.425325f,-0.688191f, }, - { 0.688191f, 0.587785f,-0.425325f, }, - {-0.147621f, 0.716567f,-0.681718f, }, - {-0.309017f, 0.500000f,-0.809017f, }, - { 0.000000f, 0.525731f,-0.850651f, }, - {-0.525731f, 0.000000f,-0.850651f, }, - {-0.442863f, 0.238856f,-0.864188f, }, - {-0.295242f, 0.000000f,-0.955423f, }, - {-0.162460f, 0.262866f,-0.951056f, }, - { 0.000000f, 0.000000f,-1.000000f, }, - { 0.295242f, 0.000000f,-0.955423f, }, - { 0.162460f, 0.262866f,-0.951056f, }, - {-0.442863f,-0.238856f,-0.864188f, }, - {-0.309017f,-0.500000f,-0.809017f, }, - {-0.162460f,-0.262866f,-0.951056f, }, - { 0.000000f,-0.850651f,-0.525731f, }, - {-0.147621f,-0.716567f,-0.681718f, }, - { 0.147621f,-0.716567f,-0.681718f, }, - { 0.000000f,-0.525731f,-0.850651f, }, - { 0.309017f,-0.500000f,-0.809017f, }, - { 0.442863f,-0.238856f,-0.864188f, }, - { 0.162460f,-0.262866f,-0.951056f, }, - { 0.238856f,-0.864188f,-0.442863f, }, - { 0.500000f,-0.809017f,-0.309017f, }, - { 0.425325f,-0.688191f,-0.587785f, }, - { 0.716567f,-0.681718f,-0.147621f, }, - { 0.688191f,-0.587785f,-0.425325f, }, - { 0.587785f,-0.425325f,-0.688191f, }, - { 0.000000f,-0.955423f,-0.295242f, }, - { 0.000000f,-1.000000f, 0.000000f, }, - { 0.262866f,-0.951056f,-0.162460f, }, - { 0.000000f,-0.850651f, 0.525731f, }, - { 0.000000f,-0.955423f, 0.295242f, }, - { 0.238856f,-0.864188f, 0.442863f, }, - { 0.262866f,-0.951056f, 0.162460f, }, - { 0.500000f,-0.809017f, 0.309017f, }, - { 0.716567f,-0.681718f, 0.147621f, }, - { 0.525731f,-0.850651f, 0.000000f, }, - {-0.238856f,-0.864188f,-0.442863f, }, - {-0.500000f,-0.809017f,-0.309017f, }, - {-0.262866f,-0.951056f,-0.162460f, }, - {-0.850651f,-0.525731f, 0.000000f, }, - {-0.716567f,-0.681718f,-0.147621f, }, - {-0.716567f,-0.681718f, 0.147621f, }, - {-0.525731f,-0.850651f, 0.000000f, }, - {-0.500000f,-0.809017f, 0.309017f, }, - {-0.238856f,-0.864188f, 0.442863f, }, - {-0.262866f,-0.951056f, 0.162460f, }, - {-0.864188f,-0.442863f, 0.238856f, }, - {-0.809017f,-0.309017f, 0.500000f, }, - {-0.688191f,-0.587785f, 0.425325f, }, - {-0.681718f,-0.147621f, 0.716567f, }, - {-0.442863f,-0.238856f, 0.864188f, }, - {-0.587785f,-0.425325f, 0.688191f, }, - {-0.309017f,-0.500000f, 0.809017f, }, - {-0.147621f,-0.716567f, 0.681718f, }, - {-0.425325f,-0.688191f, 0.587785f, }, - {-0.162460f,-0.262866f, 0.951056f, }, - { 0.442863f,-0.238856f, 0.864188f, }, - { 0.162460f,-0.262866f, 0.951056f, }, - { 0.309017f,-0.500000f, 0.809017f, }, - { 0.147621f,-0.716567f, 0.681718f, }, - { 0.000000f,-0.525731f, 0.850651f, }, - { 0.425325f,-0.688191f, 0.587785f, }, - { 0.587785f,-0.425325f, 0.688191f, }, - { 0.688191f,-0.587785f, 0.425325f, }, - {-0.955423f, 0.295242f, 0.000000f, }, - {-0.951056f, 0.162460f, 0.262866f, }, - {-1.000000f, 0.000000f, 0.000000f, }, - {-0.850651f, 0.000000f, 0.525731f, }, - {-0.955423f,-0.295242f, 0.000000f, }, - {-0.951056f,-0.162460f, 0.262866f, }, - {-0.864188f, 0.442863f,-0.238856f, }, - {-0.951056f, 0.162460f,-0.262866f, }, - {-0.809017f, 0.309017f,-0.500000f, }, - {-0.864188f,-0.442863f,-0.238856f, }, - {-0.951056f,-0.162460f,-0.262866f, }, - {-0.809017f,-0.309017f,-0.500000f, }, - {-0.681718f, 0.147621f,-0.716567f, }, - {-0.681718f,-0.147621f,-0.716567f, }, - {-0.850651f, 0.000000f,-0.525731f, }, - {-0.688191f, 0.587785f,-0.425325f, }, - {-0.587785f, 0.425325f,-0.688191f, }, - {-0.425325f, 0.688191f,-0.587785f, }, - {-0.425325f,-0.688191f,-0.587785f, }, - {-0.587785f,-0.425325f,-0.688191f, }, - {-0.688191f,-0.587785f,-0.425325f, }, -}; - - diff --git a/plugins/md3model/model.cpp b/plugins/md3model/model.cpp deleted file mode 100644 index 6c952183..00000000 --- a/plugins/md3model/model.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "model.h" - diff --git a/plugins/md3model/model.h b/plugins/md3model/model.h deleted file mode 100644 index 1b41e161..00000000 --- a/plugins/md3model/model.h +++ /dev/null @@ -1,643 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODEL_H) -#define INCLUDED_MODEL_H - -#include "cullable.h" -#include "renderable.h" -#include "selectable.h" -#include "modelskin.h" - -#include "math/frustum.h" -#include "string/string.h" -#include "generic/static.h" -#include "stream/stringstream.h" -#include "os/path.h" -#include "scenelib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "render.h" - -class VectorLightList : public LightList -{ - typedef std::vector Lights; - Lights m_lights; -public: - void addLight(const RendererLight& light) - { - m_lights.push_back(&light); - } - void clear() - { - m_lights.clear(); - } - void evaluateLights() const - { - } - void lightsChanged() const - { - } - void forEachLight(const RendererLightCallback& callback) const - { - for(Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i) - { - callback(*(*i)); - } - } -}; - -inline VertexPointer vertexpointer_arbitrarymeshvertex(const ArbitraryMeshVertex* array) -{ - return VertexPointer(VertexPointer::pointer(&array->vertex), sizeof(ArbitraryMeshVertex)); -} - -inline void parseTextureName(CopiedString& name, const char* token) -{ - StringOutputStream cleaned(256); - cleaned << PathCleaned(token); - name = StringRange(cleaned.c_str(), path_get_filename_base_end(cleaned.c_str())); // remove extension -} - -// generic renderable triangle surface -class Surface : -public OpenGLRenderable -{ -public: - typedef VertexBuffer vertices_t; - typedef IndexBuffer indices_t; -private: - - AABB m_aabb_local; - CopiedString m_shader; - Shader* m_state; - - vertices_t m_vertices; - indices_t m_indices; - - void CaptureShader() - { - m_state = GlobalShaderCache().capture(m_shader.c_str()); - } - void ReleaseShader() - { - GlobalShaderCache().release(m_shader.c_str()); - } - -public: - - Surface() - : m_shader(""), m_state(0) - { - CaptureShader(); - } - ~Surface() - { - ReleaseShader(); - } - - vertices_t& vertices() - { - return m_vertices; - } - indices_t& indices() - { - return m_indices; - } - - void setShader(const char* name) - { - ReleaseShader(); - parseTextureName(m_shader, name); - CaptureShader(); - } - const char* getShader() const - { - return m_shader.c_str(); - } - Shader* getState() const - { - return m_state; - } - void updateAABB() - { - m_aabb_local = AABB(); - for(vertices_t::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - aabb_extend_by_point_safe(m_aabb_local, reinterpret_cast((*i).vertex)); - - - - for(Surface::indices_t::iterator i = m_indices.begin(); i != m_indices.end(); i += 3) - { - ArbitraryMeshVertex& a = m_vertices[*(i + 0)]; - ArbitraryMeshVertex& b = m_vertices[*(i + 1)]; - ArbitraryMeshVertex& c = m_vertices[*(i + 2)]; - - ArbitraryMeshTriangle_sumTangents(a, b, c); - } - - for(Surface::vertices_t::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - vector3_normalise(reinterpret_cast((*i).tangent)); - vector3_normalise(reinterpret_cast((*i).bitangent)); - } - } - - void render(RenderStateFlags state) const - { -#if 1 - if((state & RENDER_BUMP) != 0) - { - if(GlobalShaderCache().useShaderLanguage()) - { - glNormalPointer(GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glVertexAttribPointerARB(c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - glVertexAttribPointerARB(c_attr_Tangent, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->tangent); - glVertexAttribPointerARB(c_attr_Binormal, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->bitangent); - } - else - { - glVertexAttribPointerARB(11, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glVertexAttribPointerARB(8, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - glVertexAttribPointerARB(9, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->tangent); - glVertexAttribPointerARB(10, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->bitangent); - } - } - else - { - glNormalPointer(GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glTexCoordPointer(2, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - } - glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->vertex); - glDrawElements(GL_TRIANGLES, GLsizei(m_indices.size()), RenderIndexTypeID, m_indices.data()); -#else - glBegin(GL_TRIANGLES); - for(unsigned int i = 0; i < m_indices.size(); ++i) - { - glTexCoord2fv(&m_vertices[m_indices[i]].texcoord.s); - glNormal3fv(&m_vertices[m_indices[i]].normal.x); - glVertex3fv(&m_vertices[m_indices[i]].vertex.x); - } - glEnd(); -#endif - -#if defined(_DEBUG) - glBegin(GL_LINES); - - for(VertexBuffer::const_iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - Vector3 normal = vector3_added(vertex3f_to_vector3((*i).vertex), vector3_scaled(normal3f_to_vector3((*i).normal), 8)); - glVertex3fv(vertex3f_to_array((*i).vertex)); - glVertex3fv(vector3_to_array(normal)); - } - glEnd(); -#endif - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - - const AABB& localAABB() const - { - return m_aabb_local; - } - - void render(Renderer& renderer, const Matrix4& localToWorld, Shader* state) const - { - renderer.SetState(state, Renderer::eFullMaterials); - renderer.addRenderable(*this, localToWorld); - } - - void render(Renderer& renderer, const Matrix4& localToWorld) const - { - render(renderer, localToWorld, m_state); - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - test.BeginMesh(localToWorld); - - SelectionIntersection best; - test.TestTriangles( - vertexpointer_arbitrarymeshvertex(m_vertices.data()), - IndexPointer(m_indices.data(), IndexPointer::index_type(m_indices.size())), - best - ); - if(best.valid()) - { - selector.addIntersection(best); - } - } -}; - -// generic model node -class Model : -public Cullable, -public Bounded -{ - typedef std::vector surfaces_t; - surfaces_t m_surfaces; - - AABB m_aabb_local; -public: - Callback m_lightsChanged; - - ~Model() - { - for(surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - { - delete *i; - } - } - - typedef surfaces_t::const_iterator const_iterator; - - const_iterator begin() const - { - return m_surfaces.begin(); - } - const_iterator end() const - { - return m_surfaces.end(); - } - std::size_t size() const - { - return m_surfaces.size(); - } - - Surface& newSurface() - { - m_surfaces.push_back(new Surface); - return *m_surfaces.back(); - } - void updateAABB() - { - m_aabb_local = AABB(); - for(surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - { - aabb_extend_by_aabb_safe(m_aabb_local, (*i)->localAABB()); - } - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - - virtual const AABB& localAABB() const - { - return m_aabb_local; - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - for(surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - { - if((*i)->intersectVolume(test.getVolume(), localToWorld) != c_volumeOutside) - { - (*i)->testSelect(selector, test, localToWorld); - } - } - } -}; - -inline void Surface_addLight(const Surface& surface, VectorLightList& lights, const Matrix4& localToWorld, const RendererLight& light) -{ - if(light.testAABB(aabb_for_oriented_aabb(surface.localAABB(), localToWorld))) - { - lights.addLight(light); - } -} - -class ModelInstance : - public scene::Instance, - public Renderable, - public SelectionTestable, - public LightCullable, - public SkinnedModel -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - Model& m_model; - - const LightList* m_lightList; - typedef Array SurfaceLightLists; - SurfaceLightLists m_surfaceLightLists; - - class Remap - { - public: - CopiedString first; - Shader* second; - Remap() : second(0) - { - } - }; - typedef Array SurfaceRemaps; - SurfaceRemaps m_skins; -public: - - typedef LazyStatic StaticTypeCasts; - - Bounded& get(NullType) - { - return m_model; - } - Cullable& get(NullType) - { - return m_model; - } - - void lightsChanged() - { - m_lightList->lightsChanged(); - } - typedef MemberCaller LightsChangedCaller; - - void constructRemaps() - { - ModelSkin* skin = NodeTypeCast::cast(path().parent()); - if(skin != 0 && skin->realised()) - { - SurfaceRemaps::iterator j = m_skins.begin(); - for(Model::const_iterator i = m_model.begin(); i != m_model.end(); ++i, ++j) - { - const char* remap = skin->getRemap((*i)->getShader()); - if(!string_empty(remap)) - { - (*j).first = remap; - (*j).second = GlobalShaderCache().capture(remap); - } - else - { - (*j).second = 0; - } - } - SceneChangeNotify(); - } - } - void destroyRemaps() - { - for(SurfaceRemaps::iterator i = m_skins.begin(); i != m_skins.end(); ++i) - { - if((*i).second != 0) - { - GlobalShaderCache().release((*i).first.c_str()); - (*i).second = 0; - } - } - } - void skinChanged() - { - ASSERT_MESSAGE(m_skins.size() == m_model.size(), "ERROR"); - destroyRemaps(); - constructRemaps(); - } - - ModelInstance(const scene::Path& path, scene::Instance* parent, Model& model) : - Instance(path, parent, this, StaticTypeCasts::instance().get()), - m_model(model), - m_surfaceLightLists(m_model.size()), - m_skins(m_model.size()) - { - m_lightList = &GlobalShaderCache().attach(*this); - m_model.m_lightsChanged = LightsChangedCaller(*this); - - Instance::setTransformChangedCallback(LightsChangedCaller(*this)); - - constructRemaps(); - } - ~ModelInstance() - { - destroyRemaps(); - - Instance::setTransformChangedCallback(Callback()); - - m_model.m_lightsChanged = Callback(); - GlobalShaderCache().detach(*this); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - SurfaceLightLists::const_iterator j = m_surfaceLightLists.begin(); - SurfaceRemaps::const_iterator k = m_skins.begin(); - for(Model::const_iterator i = m_model.begin(); i != m_model.end(); ++i, ++j, ++k) - { - if((*i)->intersectVolume(volume, localToWorld) != c_volumeOutside) - { - renderer.setLights(*j); - (*i)->render(renderer, localToWorld, (*k).second != 0 ? (*k).second : (*i)->getState()); - } - } - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_lightList->evaluateLights(); - - render(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - m_model.testSelect(selector, test, Instance::localToWorld()); - } - - bool testLight(const RendererLight& light) const - { - return light.testAABB(worldAABB()); - } - void insertLight(const RendererLight& light) - { - const Matrix4& localToWorld = Instance::localToWorld(); - SurfaceLightLists::iterator j = m_surfaceLightLists.begin(); - for(Model::const_iterator i = m_model.begin(); i != m_model.end(); ++i) - { - Surface_addLight(*(*i), *j++, localToWorld, light); - } - } - void clearLights() - { - for(SurfaceLightLists::iterator i = m_surfaceLightLists.begin(); i != m_surfaceLightLists.end(); ++i) - { - (*i).clear(); - } - } -}; - -class ModelNode : public scene::Node::Symbiot, public scene::Instantiable -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Model m_model; -public: - - typedef LazyStatic StaticTypeCasts; - - ModelNode() : m_node(this, this, StaticTypeCasts::instance().get()) - { - } - - Model& model() - { - return m_model; - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new ModelInstance(path, parent, m_model); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - - -inline void Surface_constructQuad(Surface& surface, const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d, const Vector3& normal) -{ - surface.vertices().push_back( - ArbitraryMeshVertex( - vertex3f_for_vector3(a), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_topleft) - ) - ); - surface.vertices().push_back( - ArbitraryMeshVertex( - vertex3f_for_vector3(b), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_topright) - ) - ); - surface.vertices().push_back( - ArbitraryMeshVertex( - vertex3f_for_vector3(c), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_botright) - ) - ); - surface.vertices().push_back( - ArbitraryMeshVertex( - vertex3f_for_vector3(d), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_botleft) - ) - ); -} - -inline void Model_constructNull(Model& model) -{ - Surface& surface = model.newSurface(); - - AABB aabb(Vector3(0, 0, 0), Vector3(8, 8, 8)); - - Vector3 points[8]; - aabb_corners(aabb, points); - - surface.vertices().reserve(24); - - Surface_constructQuad(surface, points[2], points[1], points[5], points[6], aabb_normals[0]); - Surface_constructQuad(surface, points[1], points[0], points[4], points[5], aabb_normals[1]); - Surface_constructQuad(surface, points[0], points[1], points[2], points[3], aabb_normals[2]); - Surface_constructQuad(surface, points[0], points[3], points[7], points[4], aabb_normals[3]); - Surface_constructQuad(surface, points[3], points[2], points[6], points[7], aabb_normals[4]); - Surface_constructQuad(surface, points[7], points[6], points[5], points[4], aabb_normals[5]); - - surface.indices().reserve(36); - - RenderIndex indices[36] = { - 0, 1, 2, 0, 2, 3, - 4, 5, 6, 4, 6, 7, - 8, 9, 10, 8, 10, 11, - 12, 13, 14, 12, 14, 15, - 16, 17, 18, 16, 18, 19, - 20, 21, 22, 10, 22, 23, - }; - - for(RenderIndex* i = indices; i != indices+(sizeof(indices)/sizeof(RenderIndex)); ++i) - { - surface.indices().insert(*i); - } - - surface.setShader(""); - - surface.updateAABB(); - - model.updateAABB(); -} - -#endif diff --git a/plugins/md3model/modelmd3.def b/plugins/md3model/modelmd3.def deleted file mode 100644 index 3d22d503..00000000 --- a/plugins/md3model/modelmd3.def +++ /dev/null @@ -1,7 +0,0 @@ -; modelmd3.def : Declares the module parameters for the DLL. - -LIBRARY "MODELMD3" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/md3model/modelmd3.vcproj b/plugins/md3model/modelmd3.vcproj deleted file mode 100644 index 35c4ef6c..00000000 --- a/plugins/md3model/modelmd3.vcproj +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/md3model/plugin.cpp b/plugins/md3model/plugin.cpp deleted file mode 100644 index dbdff935..00000000 --- a/plugins/md3model/plugin.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "iscenegraph.h" -#include "irender.h" -#include "iselection.h" -#include "iimage.h" -#include "imodel.h" -#include "igl.h" -#include "ifilesystem.h" -#include "iundo.h" -#include "ifiletypes.h" -#include "iscriplib.h" - -#include "modulesystem/singletonmodule.h" -#include "typesystem.h" - -#include "md3.h" -#include "mdl.h" -#include "md2.h" -#include "mdc.h" -#include "mdlimage.h" -#include "md5.h" - - -class MD3ModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD3Model(file); - } -}; - -class ModelDependencies : - public GlobalFileSystemModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalFiletypesModuleRef -{ -}; - -class ModelMD3API : public TypeSystemRef -{ - MD3ModelLoader m_modelmd3; -public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md3"); - - ModelMD3API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md3 models", "*.md3")); - } - ModelLoader* getTable() - { - return &m_modelmd3; - } -}; - -typedef SingletonModule ModelMD3Module; - -ModelMD3Module g_ModelMD3Module; - - - -class MD2ModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD2Model(file); - } -}; - -class ModelMD2API : public TypeSystemRef -{ - MD2ModelLoader m_modelmd2; -public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md2"); - - ModelMD2API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md2 models", "*.md2")); - } - ModelLoader* getTable() - { - return &m_modelmd2; - } -}; - -typedef SingletonModule ModelMD2Module; - -ModelMD2Module g_ModelMD2Module; - -class MDLModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMDLModel(file); - } -}; - -class ModelMDLAPI : public TypeSystemRef -{ - MDLModelLoader m_modelmdl; -public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "mdl"); - - ModelMDLAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdl models", "*.mdl")); - } - ModelLoader* getTable() - { - return &m_modelmdl; - } -}; - -typedef SingletonModule ModelMDLModule; - -ModelMDLModule g_ModelMDLModule; - -class MDCModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMDCModel(file); - } -}; - -class ModelMDCAPI : public TypeSystemRef -{ - MDCModelLoader m_modelmdc; -public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "mdc"); - - ModelMDCAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdc models", "*.mdc")); - } - ModelLoader* getTable() - { - return &m_modelmdc; - } -}; - -typedef SingletonModule ModelMDCModule; - -ModelMDCModule g_ModelMDCModule; - - -class ImageMDLAPI -{ - _QERPlugImageTable m_imagemdl; -public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "mdl"); - - ImageMDLAPI() - { - m_imagemdl.loadImage = &LoadMDLImage; - } - _QERPlugImageTable* getTable() - { - return &m_imagemdl; - } -}; - -typedef SingletonModule ImageMDLModule; - -ImageMDLModule g_ImageMDLModule; - - -class MD5ModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD5Model(file); - } -}; - -class ModelMD5Dependencies : public ModelDependencies, public GlobalScripLibModuleRef -{ -}; - -class ModelMD5API : public TypeSystemRef -{ - MD5ModelLoader m_modelmd5; -public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md5mesh"); - - ModelMD5API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md5 meshes", "*.md5mesh")); - } - ModelLoader* getTable() - { - return &m_modelmd5; - } -}; - -typedef SingletonModule ModelMD5Module; - -ModelMD5Module g_ModelMD5Module; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ModelMD3Module.selfRegister(); - g_ModelMD2Module.selfRegister(); - g_ModelMDLModule.selfRegister(); - g_ModelMDCModule.selfRegister(); - g_ImageMDLModule.selfRegister(); - g_ModelMD5Module.selfRegister(); -} diff --git a/plugins/md3model/plugin.h b/plugins/md3model/plugin.h deleted file mode 100644 index 2f28d852..00000000 --- a/plugins/md3model/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/model/cpicomodel.cpp b/plugins/model/cpicomodel.cpp new file mode 100644 index 00000000..b4338242 --- /dev/null +++ b/plugins/model/cpicomodel.cpp @@ -0,0 +1,220 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "cpicomodel.h" +#include "cpicosurface.h" + +CPicoModel::CPicoModel(const PicoModelKey& key) +: m_refcount(1) +{ + load(key.first.GetBuffer(), key.second); +} + +CPicoModel::CPicoModel(const Str& name) +: m_refcount(1) +{ + load(name.GetBuffer(), 0); +} + +CPicoModel::CPicoModel(const Str& name, const int frame) +: m_refcount(1) +{ + load(name.GetBuffer(), frame); +} + +CPicoModel::CPicoModel(const char *name, const int frame) +: m_refcount(1) +{ + load(name, frame); +} + +void CPicoModel::load(const char *name, const int frame) +{ + CPicoSurface *surf; + picoSurface_t *pSurface; + int i; + + m_name= new char[strlen(name)+1]; + strcpy(m_name,name); + + m_frame = frame; + + if( !(m_pModel = PicoLoadModel(m_name, frame)) ) + { + int len = strlen(m_name); + + // Try loading an mdc if md3 fails and vice-versa (fixme: only do this for games with mdc support) + if( !strcmp( m_name + len - 4, ".md3" ) ) + { + m_name[len - 1] = 'c'; + m_pModel = PicoLoadModel(m_name, frame); + } else if( !strcmp( m_name + len - 4, ".mdc" ) ) + { + m_name[len - 1] = '3'; + m_pModel = PicoLoadModel(m_name, frame); + } + } + + if( m_pModel ) + { + m_children = g_ptr_array_new(); + aabb_clear(&m_BBox); + for (i = 0; i < PicoGetModelNumSurfaces(m_pModel); i++ ) + { + pSurface = PicoGetModelSurface(m_pModel,i); + surf = new CPicoSurface(pSurface); + g_ptr_array_add(m_children, surf); + aabb_extend_by_aabb(&m_BBox, surf->GetAABB()); + } + } + else + { + m_BBox.origin[0] = m_BBox.origin[1] = m_BBox.origin[2] = 0; + m_BBox.extents[0] = m_BBox.extents[1] = m_BBox.extents[2] = 0; + } + + m_parents = g_ptr_array_new(); +} + +CPicoModel::~CPicoModel() +{ + if( m_pModel ) { + for(unsigned int i=0; ilen; i++) + ((CPicoSurface*)m_children->pdata[i])->DecRef(); + g_ptr_array_free(m_children, FALSE); + } + g_ptr_array_free(m_parents, FALSE); + delete [] m_name; +} + +void CPicoModel::AddParent( CPicoParent *parent ) +{ + g_ptr_array_add(m_parents, parent); +} + +void CPicoModel::RemoveParent( CPicoParent *parent ) +{ + unsigned int i; + for(i=0; ilen; i++) { + if( parent == (CPicoParent*)m_parents->pdata[i] ) + g_ptr_array_remove_index_fast(m_parents, i); + } +} + +void CPicoModel::Reload( void ) +{ + CPicoSurface *surf; + picoSurface_t *pSurface; + int i; + unsigned int j; + + // Get rid of the old model + if( m_pModel ) { + for(j=0; jlen; j++) { + ((CPicoSurface*)m_children->pdata[j])->DecRef(); + g_ptr_array_remove_index_fast(m_children, j); + } + } + + // And reload it + m_pModel = PicoLoadModel(m_name, m_frame); + + if( m_pModel ) + { + m_children = g_ptr_array_new(); + aabb_clear(&m_BBox); + for (i = 0; i < PicoGetModelNumSurfaces(m_pModel); i++ ) + { + pSurface = PicoGetModelSurface(m_pModel,i); + surf = new CPicoSurface(pSurface); + g_ptr_array_add(m_children, surf); + aabb_extend_by_aabb(&m_BBox, surf->GetAABB()); + } + } + else + { + m_BBox.origin[0] = m_BBox.origin[1] = m_BBox.origin[2] = 0; + m_BBox.extents[0] = m_BBox.extents[1] = m_BBox.extents[2] = 0; + } + + for(j=0; jlen; j++) { + ((CPicoParent*)m_parents->pdata[j])->UpdateShaders(); + } +} + +void CPicoModel::Draw(int state, vector shaders, int rflags) const +{ + if( m_pModel ) { + for(unsigned int i=0; ilen; i++) + ((CPicoSurface*)m_children->pdata[i])->Draw(state, shaders[i], rflags); + } +} + +void CPicoModel::Draw(int state, int rflags) const +{ + if( m_pModel ) { + for(unsigned int i=0; ilen; i++) + ((CPicoSurface*)m_children->pdata[i])->Draw(state, rflags); + } +} + +bool CPicoModel::TestRay(const ray_t *ray, vec_t *dist) const +{ + vec_t dist_start = *dist; + vec_t dist_local = *dist; + ray_t ray_local = *ray; + + if( !m_pModel ) { + return false; + } + + if (!aabb_intersect_ray(&m_BBox, &ray_local, &dist_local)) + return false; + dist_local = dist_start; + + for(unsigned int i=0; ilen; i++) + { + if(((CPicoSurface*)m_children->pdata[i])->TestRay(&ray_local, &dist_local)) + { + *dist = dist_local; + } + } + + return *dist < dist_start; +} + +int CPicoModel::GetNumSurfaces( void ) +{ + if( !m_pModel ) { + return 0; + } + + return m_children->len; +} + +char *CPicoModel::GetShaderNameForSurface( const unsigned int surf ) +{ + if( !m_pModel || surf < 0 || surf >= m_children->len ) { + return 0; + } + + return ((CPicoSurface*)m_children->pdata[surf])->GetShaderName(); +} diff --git a/plugins/model/cpicomodel.h b/plugins/model/cpicomodel.h new file mode 100644 index 00000000..938cede0 --- /dev/null +++ b/plugins/model/cpicomodel.h @@ -0,0 +1,94 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _CPICOMODEL_H_ +#define _CPICOMODEL_H_ + +#include "plugin.h" +#include "picomodel.h" + +#include "gtkr_vector.h" + +class CPicoParent +{ +public: + virtual void UpdateShaders( void ) = 0; +}; + +class CModelManager; // forward declaration + +//typedef std::pair PicoModelKey; +typedef pair PicoModelKey; + +class CPicoModel : public IRender, public ISelect +{ + friend class CModelManager; +public: + CPicoModel(const PicoModelKey& key); + CPicoModel(const Str& name); + CPicoModel(const Str& name, const int frame); + CPicoModel(const char *name, const int frame); + ~CPicoModel(); + void CPicoModel::load(const char *name, const int frame); + + void IncRef() + { + ++m_refcount; + } + void DecRef() + { + if(--m_refcount == 0) + delete this; + } + + void AddParent( CPicoParent *parent ); + void RemoveParent( CPicoParent *parent ); + + void Reload( void ); + + void Draw(int state, vector shaders, int rflags) const; + //IRender + virtual void Draw( int state, int rflags ) const; + virtual const aabb_t *GetAABB() const { return &m_BBox; } + + //ISelect + virtual bool TestRay( const ray_t *ray, vec_t *dist ) const; + + int GetNumSurfaces( void ); + char *GetShaderNameForSurface( const unsigned int surf ); + +private: + void AccumulateBBox(); + + char *m_name; + int m_frame; + picoModel_t *m_pModel; + unsigned int m_refcount; + aabb_t m_BBox; + GPtrArray *m_children; // array of CPicoSurface + GPtrArray *m_parents; // array of CPicoParent + + GPtrArray* m_shaders; + + bool m_bReloaded; // managed by CModelManager +}; + +#endif // _CPICOMODEL_H_ diff --git a/plugins/model/cpicosurface.cpp b/plugins/model/cpicosurface.cpp new file mode 100644 index 00000000..0fc88fb8 --- /dev/null +++ b/plugins/model/cpicosurface.cpp @@ -0,0 +1,203 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "cpicosurface.h" + +// public + +CPicoSurface::CPicoSurface(picoSurface_t *pSurface) +{ + refCount = 1; + + m_pSurface = pSurface; + + // PicoFixSurfaceNormals( pSurface ); + + AccumulateBBox(); + + m_shader = QERApp_Shader_ForName(GetShaderName()); +} + +CPicoSurface::~CPicoSurface() +{ + m_shader->DecRef(); +} + +void CPicoSurface::Draw(int state, int rflags) +{ + Draw(state, m_shader, rflags); +} + +void CPicoSurface::Draw(int state, IShader *pShader, int rflags) +{ + int j; + + if( !(rflags & (DRAW_RF_SEL_OUTLINE|DRAW_RF_SEL_FILL|DRAW_RF_XY)) ) + { + if(state & DRAW_GL_TEXTURE_2D) + { + g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, pShader->getTexture()->texture_number); + if( (rflags & DRAW_RF_CAM) && (pShader->getFlags() & QER_ALPHAFUNC) ) { + int nFunc = 0; + float fRef = 0.f; + + g_QglTable.m_pfn_qglColor4f( 1.f, 1.f, 1.f, 1.f ); // identity + + g_QglTable.m_pfn_qglEnable( GL_ALPHA_TEST ); + + pShader->getAlphaFunc( &nFunc, &fRef ); + g_QglTable.m_pfn_qglAlphaFunc( nFunc, fRef ); + } + } + else + { + //g_QglTable.m_pfn_qglColor3fv( pShader->getTexture()->color ); +/* g_QglTable.m_pfn_qglEnableClientState(GL_COLOR_ARRAY);*/ + } + + if( !(state & DRAW_GL_WIRE) && (pShader->getFlags() & QER_CULL) ) + { + if( pShader->getCull() == 2 ) + { + g_QglTable.m_pfn_qglDisable( GL_CULL_FACE ); + g_QglTable.m_pfn_qglPolygonMode (GL_FRONT, GL_FILL); + } + else // is 1 + { + g_QglTable.m_pfn_qglCullFace( GL_BACK ); + } + } + } + + switch( PicoGetSurfaceType(m_pSurface) ) + { + case PICO_TRIANGLES: g_QglTable.m_pfn_qglBegin(GL_TRIANGLES); + for (j=0; jgetFlags() & QER_ALPHAFUNC) ) { + g_QglTable.m_pfn_qglDisable( GL_ALPHA_TEST ); + } + +/* if(!(state & DRAW_GL_TEXTURE_2D)) { + g_QglTable.m_pfn_qglDisableClientState(GL_COLOR_ARRAY); + }*/ + + if( !(state & DRAW_GL_WIRE) && (pShader->getFlags() & QER_CULL) ) + { + if( pShader->getCull() == 2 ) + { + g_QglTable.m_pfn_qglPolygonMode (GL_FRONT, GL_LINE); + g_QglTable.m_pfn_qglEnable( GL_CULL_FACE ); + } + else // is 1 + { + g_QglTable.m_pfn_qglCullFace( GL_FRONT ); + } + } + } +} + +// private + +void CPicoSurface::AccumulateBBox() +{ + int i; + picoVec_t *p; + aabb_clear(&m_BBox); + for (i=0; ishader); + } + +private: + int refCount; + aabb_t m_BBox; + picoSurface_t *m_pSurface; + IShader* m_shader; + + void AccumulateBBox(); // accumulate local bbox.. generally created from control handles +}; diff --git a/plugins/model/miscmodel.cpp b/plugins/model/miscmodel.cpp new file mode 100644 index 00000000..2fd9b653 --- /dev/null +++ b/plugins/model/miscmodel.cpp @@ -0,0 +1,451 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "entitymodel.h" + +extern CModelManager g_model_cache; + +// +// CEntityMiscModel implementation +// + +CEntityMiscModel::CEntityMiscModel () +{ + refCount = 1; + m_name = NULL; + m_model = NULL; + m_entity = NULL; + m_frame = 0; + m_remaps = g_ptr_array_new (); + m_shaders = g_ptr_array_new (); + VectorSet(m_translate, 0,0,0); + VectorSet(m_euler, 0,0,0); + VectorSet(m_scale, 1,1,1); + VectorSet(m_pivot, 0,0,0); + m4x4_identity(m_transform); + m4x4_identity(m_inverse_transform); +} + +typedef struct remap_s { + char m_key[64]; + char m_remapbuff[64+1024]; + char *m_remap[2]; +} remap_t; + +CEntityMiscModel::~CEntityMiscModel () +{ + unsigned int i; + + if(m_name && *m_name != '\0') { + if( !g_model_cache.DeleteByNameAndFrame(m_name,m_frame) && m_model ) + m_model->RemoveParent( this ); + m_model = NULL; + delete [] m_name; + } + + for( i = 0; i < m_remaps->len; i++ ) + delete (remap_t*)m_remaps->pdata[i]; + g_ptr_array_free(m_remaps, FALSE); + + for( i = 0; i < m_shaders->len; i++ ) + { + (*(IShader**)m_shaders->pdata[i])->DecRef(); + delete (IShader**)m_shaders->pdata[i]; + } + g_ptr_array_free(m_shaders, FALSE); + + if(m_entity) { + // This might be just an evasion of the actual problem + m_entity->model.pRender = NULL; + m_entity->model.pSelect = NULL; + m_entity->model.pEdit = NULL; + } +} + +// IRender + +void CEntityMiscModel::Draw(int state, int rflags) const +{ + m4x4_t matrix; + vec3_t pivot; + + memcpy(matrix, m_transform, sizeof(m4x4_t)); + m4x4_transpose(matrix); + + VectorAdd(m_pivot, m_translate, pivot); + pivot_draw(pivot); + + // push the current modelview matrix + // FIXME: put in a check for stack recursion depth.. + // or avoid recursion of opengl matrix stack + g_QglTable.m_pfn_qglPushMatrix(); + // apply the parent-to-local transform + g_QglTable.m_pfn_qglMultMatrixf(matrix); + + // draw children + if(m_model) + m_model->Draw(state, m_shaders, rflags); + + g_QglTable.m_pfn_qglPopMatrix(); +} + +// ISelect + +bool CEntityMiscModel::TestRay(const ray_t *ray, vec_t *dist) const +{ + vec_t dist_start = *dist; + vec_t dist_local = *dist; + ray_t ray_local = *ray; + + if (!aabb_intersect_ray(&m_BBox, &ray_local, &dist_local)) + return false; + + if(m_model){ + ray_transform(&ray_local, m_inverse_transform); + dist_local = dist_start; + if(m_model->TestRay(&ray_local, &dist_local)) + *dist = dist_local; + } else *dist = dist_local; + + return *dist < dist_start; +} + + +//IEdit + +void CEntityMiscModel::Translate(const vec3_t translation) +{ + VectorIncrement(translation, m_translate); + UpdateCachedData(); +} + +void CEntityMiscModel::Rotate(const vec3_t pivot, const vec3_t rotation) +{ + m4x4_t rotation_matrix; + + m4x4_identity(rotation_matrix); + m4x4_pivoted_rotate_by_vec3(rotation_matrix, rotation, pivot); + m4x4_transform_point(rotation_matrix, m_translate); + + VectorIncrement(rotation, m_euler); + + UpdateCachedData(); +} + +void CEntityMiscModel::OnKeyChanged(entity_t *e, const char *key) +{ + const char *value; + + // FIXME: keys are case-sensitive? + + m_entity = e; + + if(strcmp(key,"model") == 0) + SetName(ValueForKey(e,"model")); + else if(strcmp(key,"_frame") == 0) + SetFrame(IntForKey(e,"_frame")); + else if(strcmp(key,"angle") == 0 || strcmp(key,"angles") == 0) + { + VectorSet(m_euler, 0.f, 0.f, 0.f); + m_euler[2] = FloatForKey(e,"angle"); + value = ValueForKey(e,"angles"); + if (value[0] != '\0') + sscanf (value, "%f %f %f", &m_euler[0], &m_euler[2], &m_euler[1]); + UpdateCachedData(); + } + else if(strcmp(key,"modelscale") == 0 || strcmp(key,"modelscale_vec") == 0) + { + VectorSet(m_scale, 1.f, 1.f, 1.f); + value = ValueForKey(e,"modelscale"); + if (value[0] != '\0') + { + float f = atof(value); + if( f != 0 ) + VectorSet(m_scale, f, f, f); + else + Sys_FPrintf(SYS_WRN, "WARNING: ignoring 0 modelscale key\n"); + } + value = ValueForKey(e,"modelscale_vec"); + if (value[0] != '\0') + { + sscanf (value, "%f %f %f", &m_scale[0], &m_scale[1], &m_scale[2]); + if (m_scale[0] == 0.0 && m_scale[1] == 0.0 && m_scale[2] == 0.0) + { + VectorSet(m_scale, 1,1,1); + Sys_FPrintf(SYS_WRN, "WARNING: ignoring 0 0 0 modelscale_vec key\n"); + } + } + UpdateCachedData(); + } + else if(strcmp(key,"origin") == 0) + { + value = ValueForKey(e,"origin"); + sscanf(value, "%f %f %f", &m_translate[0], &m_translate[1], &m_translate[2]); + UpdateCachedData(); + } + else if(strncmp(key,"_remap",6) == 0) + { + unsigned int i; + remap_t *pRemap; + char *ch; + + value = ValueForKey(e,key); + + for(i=0; ilen; i++) + { + pRemap = (remap_t*)m_remaps->pdata[i]; + if(strcmp(key,pRemap->m_key) == 0) + break; + } + + if( i == m_remaps->len ) + { + if( value[0] == '\0' ) + return; + + pRemap = new remap_t; + g_ptr_array_add(m_remaps, pRemap); + } + else if( value[0] == '\0' ) + { + g_ptr_array_remove_index_fast(m_remaps, i); + delete pRemap; + + UpdateShaders(); + return; + } + + strncpy(pRemap->m_remapbuff,value,sizeof(pRemap->m_remapbuff)); + strncpy(pRemap->m_key,key,sizeof(pRemap->m_key)); + + pRemap->m_remap[0] = ch = pRemap->m_remapbuff; + + while( *ch && *ch != ';' ) + ch++; + + if( *ch == '\0' ) + { + // bad remap + Sys_FPrintf(SYS_WRN, "WARNING: Shader _remap key found in misc_model without a ; character\n" ); + g_ptr_array_remove_index_fast(m_remaps, i); + delete pRemap; + return; + } + else + { + *ch = '\0'; + pRemap->m_remap[1] = ch + 1; + } + + UpdateShaders(); + } +} + +// +// CEntityMiscModel +// + +// private: + +void CEntityMiscModel::SetName(const char *name) +{ + if(m_name && *m_name != '\0') { + if(strcmp(m_name, name) == 0) + return; + if( !g_model_cache.DeleteByNameAndFrame(m_name,m_frame) && m_model ) + m_model->RemoveParent( this ); + delete [] m_name; + } + + m_model = NULL; + m_name = new char[strlen(name)+1]; + strcpy(m_name,name); + + if(*m_name != '\0') { + m_model = g_model_cache.GetByNameAndFrame(m_name, m_frame); + m_model->AddParent( this ); + } + + UpdateCachedData(); + UpdateShaders(); +} + +void CEntityMiscModel::SetFrame(const int frame) +{ + if( m_frame == frame ) + return; + + if(m_name && *m_name != '\0') { + if( !g_model_cache.DeleteByNameAndFrame(m_name,m_frame) && m_model ) + m_model->RemoveParent( this ); + } + + m_model = NULL; + + m_frame = frame; + + if(*m_name != '\0') { + m_model = g_model_cache.GetByNameAndFrame(m_name, m_frame); + m_model->AddParent( this ); + } + + UpdateCachedData(); +} + +void CEntityMiscModel::UpdateCachedData() +{ + aabb_t aabb_temp; + bbox_t bbox_temp; + + m4x4_identity(m_transform); + m4x4_pivoted_transform_by_vec3(m_transform, m_translate, m_euler, m_scale, m_pivot); + memcpy(m_inverse_transform, m_transform, sizeof(m4x4_t)); + if(m4x4_invert(m_inverse_transform) == 1) { + Sys_Printf("ERROR: Singular Matrix, cannot invert"); + } + + aabb_clear(&aabb_temp); + + if(m_model) + aabb_extend_by_aabb(&aabb_temp, m_model->GetAABB()); + else + { + if (m_entity->eclass) + VectorSet(aabb_temp.extents, m_entity->eclass->maxs[0], m_entity->eclass->maxs[1], m_entity->eclass->maxs[2]); + else + VectorSet(aabb_temp.extents, 8, 8, 8); + } + + // create an oriented BBox in world-space + bbox_for_oriented_aabb(&bbox_temp, &aabb_temp, m_transform, m_euler, m_scale); + // create an axis aligned bbox in world-space + aabb_for_bbox(&m_BBox, &bbox_temp); + + aabb_update_radius(&m_BBox); +} + +void CEntityMiscModel::UpdateShaders() +{ + unsigned int i, j, numSurfaces; + remap_t *pRemap, *pGlobRemap = NULL; + char *surfShaderName; + IShader **pShader; + + if( !m_model ) + { + if( m_shaders->len ) + { + // free our shaders + for( i = 0; i < m_shaders->len; i++ ) + { + g_ptr_array_remove_index_fast(m_shaders, i); + (*(IShader**)m_shaders->pdata[i])->DecRef(); + delete (IShader**)m_shaders->pdata[i]; + } + } + return; + } + + numSurfaces = m_model->GetNumSurfaces(); + + if( numSurfaces < m_shaders->len ) + { + // free unneeded shader pointers + for( i = m_shaders->len - 1; i >= numSurfaces; i-- ) + { + g_ptr_array_remove_index_fast(m_shaders, i); + (*(IShader**)m_shaders->pdata[i])->DecRef(); + delete (IShader**)m_shaders->pdata[i]; + } + } + + // now go through our surface and find our shaders, remap if needed + for( j = 0; j < numSurfaces; j++ ) + { + surfShaderName = m_model->GetShaderNameForSurface(j); + + if( j < m_shaders->len ) + { + pShader = (IShader **)m_shaders->pdata[j]; + } + else + { + pShader = new (IShader *); + *pShader = NULL; + g_ptr_array_add(m_shaders, pShader); + } + + if( m_remaps->len ) + { + for( i = 0; i < m_remaps->len; i++ ) + { + pRemap = (remap_t*)m_remaps->pdata[i]; + if( stricmp(pRemap->m_remap[0],surfShaderName) == 0 ) + { + // only do the shader lookups if really needed + if( !(*pShader) || stricmp(pRemap->m_remap[1],(*pShader)->getName()) ) + { + if( *pShader ) + (*pShader)->DecRef(); + *pShader = QERApp_Shader_ForName(pRemap->m_remap[1]); + } + + pGlobRemap = NULL; + break; + } + else if( pRemap->m_remap[0][0] == '*' && pRemap->m_remap[0][1] == '\0' ) + pGlobRemap = pRemap; + } + + if( pGlobRemap ) + { + if( !(*pShader) || stricmp(pGlobRemap->m_remap[1],(*pShader)->getName()) ) + { + if( *pShader ) + (*pShader)->DecRef(); + *pShader = QERApp_Shader_ForName(pGlobRemap->m_remap[1]); + } + } + else if( i == m_remaps->len ) + { + // Back to the default one, if needed + if( !(*pShader) || (stricmp(surfShaderName,(*pShader)->getName()) && !(surfShaderName[0] == '\0')) ) + { + if( *pShader ) + (*pShader)->DecRef(); + *pShader = QERApp_Shader_ForName(surfShaderName); + } + } + } + else + { + // Model specified shader, if needed + if( !(*pShader) || (stricmp(surfShaderName,(*pShader)->getName()) && !(surfShaderName[0] == '\0')) ) + { + if( *pShader ) + (*pShader)->DecRef(); + *pShader = QERApp_Shader_ForName(surfShaderName); + } + } + } +} diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index 4a1a33bb..1d83f93e 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,1017 +19,70 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "model.h" - +#include "plugin.h" #include "picomodel.h" -#include "iarchive.h" -#include "idatastream.h" -#include "imodel.h" -#include "modelskin.h" - -#include "cullable.h" -#include "renderable.h" -#include "selectable.h" - -#include "math/frustum.h" -#include "string/string.h" -#include "generic/static.h" -#include "shaderlib.h" -#include "scenelib.h" -#include "instancelib.h" -#include "transformlib.h" -#include "traverselib.h" -#include "render.h" - -class VectorLightList : public LightList +void pivot_draw(const vec3_t pivot) { - typedef std::vector Lights; - Lights m_lights; -public: - void addLight(const RendererLight& light) - { - m_lights.push_back(&light); - } - void clear() - { - m_lights.clear(); - } - void evaluateLights() const - { - } - void lightsChanged() const - { - } - void forEachLight(const RendererLightCallback& callback) const - { - for(Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i) - { - callback(*(*i)); - } - } -}; + vec3_t vCenter, vMin, vMax; + VectorCopy(pivot, vCenter); -class PicoSurface : -public OpenGLRenderable -{ - AABB m_aabb_local; - CopiedString m_shader; - Shader* m_state; + g_QglTable.m_pfn_qglPointSize(4); - Array m_vertices; - Array m_indices; + g_QglTable.m_pfn_qglBegin(GL_POINTS); + g_QglTable.m_pfn_qglVertex3fv(vCenter); + g_QglTable.m_pfn_qglEnd(); -public: + g_QglTable.m_pfn_qglBegin(GL_LINES); + vCenter[0] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[0] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[0] -= 8; + vCenter[1] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[1] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[1] -= 8; + vCenter[2] -= 8; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[2] += 16; + g_QglTable.m_pfn_qglVertex3fv(vCenter); + vCenter[2] -= 8; + g_QglTable.m_pfn_qglEnd(); - PicoSurface() - { - constructNull(); - CaptureShader(); - } - PicoSurface(picoSurface_t* surface) - { - CopyPicoSurface(surface); - CaptureShader(); - } - ~PicoSurface() - { - ReleaseShader(); - } + VectorCopy(vCenter, vMin); + VectorCopy(vCenter, vMax); + vMin[0] -= 4; + vMin[1] -= 4; + vMin[2] -= 4; + vMax[0] += 4; + vMax[1] += 4; + vMax[2] += 4; - void render(RenderStateFlags state) const - { - if((state & RENDER_BUMP) != 0) - { - if(GlobalShaderCache().useShaderLanguage()) - { - glNormalPointer(GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glVertexAttribPointerARB(c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - glVertexAttribPointerARB(c_attr_Tangent, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->tangent); - glVertexAttribPointerARB(c_attr_Binormal, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->bitangent); - } - else - { - glVertexAttribPointerARB(11, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glVertexAttribPointerARB(8, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - glVertexAttribPointerARB(9, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->tangent); - glVertexAttribPointerARB(10, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_vertices.data()->bitangent); - } - } - else - { - glNormalPointer(GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->normal); - glTexCoordPointer(2, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->texcoord); - } - glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->vertex); - glDrawElements(GL_TRIANGLES, GLsizei(m_indices.size()), RenderIndexTypeID, m_indices.data()); -#if defined(_DEBUG) - glBegin(GL_LINES); + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglEnd(); + + g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglEnd(); - for(Array::const_iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - Vector3 normal = vector3_added(vertex3f_to_vector3((*i).vertex), vector3_scaled(normal3f_to_vector3((*i).normal), 8)); - glVertex3fv(vertex3f_to_array((*i).vertex)); - glVertex3fv(vector3_to_array(normal)); - } - glEnd(); -#endif - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - - const AABB& localAABB() const - { - return m_aabb_local; - } - - void render(Renderer& renderer, const Matrix4& localToWorld, Shader* state) const - { - renderer.SetState(state, Renderer::eFullMaterials); - renderer.addRenderable(*this, localToWorld); - } - - void render(Renderer& renderer, const Matrix4& localToWorld) const - { - render(renderer, localToWorld, m_state); - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - test.BeginMesh(localToWorld); - - SelectionIntersection best; - testSelect(test, best); - if(best.valid()) - { - selector.addIntersection(best); - } - } - - const char* getShader() const - { - return m_shader.c_str(); - } - Shader* getState() const - { - return m_state; - } - -private: - - void CaptureShader() - { - m_state = GlobalShaderCache().capture(m_shader.c_str()); - } - void ReleaseShader() - { - GlobalShaderCache().release(m_shader.c_str()); - } - - void UpdateAABB() - { - m_aabb_local = AABB(); - for(std::size_t i = 0; i < m_vertices.size(); ++i ) - aabb_extend_by_point_safe(m_aabb_local, reinterpret_cast(m_vertices[i].vertex)); - - - for(Array::iterator i = m_indices.begin(); i != m_indices.end(); i += 3) - { - ArbitraryMeshVertex& a = m_vertices[*(i + 0)]; - ArbitraryMeshVertex& b = m_vertices[*(i + 1)]; - ArbitraryMeshVertex& c = m_vertices[*(i + 2)]; - - ArbitraryMeshTriangle_sumTangents(a, b, c); - } - - for(Array::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - vector3_normalise(reinterpret_cast((*i).tangent)); - vector3_normalise(reinterpret_cast((*i).bitangent)); - } - } - - void testSelect(SelectionTest& test, SelectionIntersection& best) - { - test.TestTriangles( - VertexPointer(VertexPointer::pointer(&m_vertices.data()->vertex), sizeof(ArbitraryMeshVertex)), - IndexPointer(m_indices.data(), IndexPointer::index_type(m_indices.size())), - best - ); - } - - void CopyPicoSurface(picoSurface_t* surface) - { - picoShader_t* shader = PicoGetSurfaceShader( surface ); - if( shader == 0 ) - m_shader = ""; - else - m_shader = PicoGetShaderName( shader ); - - m_vertices.resize( PicoGetSurfaceNumVertexes( surface ) ); - m_indices.resize( PicoGetSurfaceNumIndexes( surface ) ); - - for(std::size_t i = 0; i < m_vertices.size(); ++i ) - { - picoVec_t* xyz = PicoGetSurfaceXYZ( surface, int(i) ); - m_vertices[i].vertex = vertex3f_from_array(xyz); - - picoVec_t* normal = PicoGetSurfaceNormal( surface, int(i) ); - m_vertices[i].normal = normal3f_from_array(normal); - - picoVec_t* st = PicoGetSurfaceST( surface, 0, int(i) ); - m_vertices[i].texcoord = TexCoord2f(st[0], st[1]); - -#if 0 - picoVec_t* color = PicoGetSurfaceColor( surface, 0, int(i) ); - m_vertices[i].colour = Colour4b(color[0], color[1], color[2], color[3]); -#endif - } - - picoIndex_t* indexes = PicoGetSurfaceIndexes( surface, 0 ); - for(std::size_t j = 0; j < m_indices.size(); ++j ) - m_indices[ j ] = indexes[ j ]; - - UpdateAABB(); - } - - void constructQuad(std::size_t index, const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d, const Vector3& normal) - { - m_vertices[index * 4 + 0] = ArbitraryMeshVertex( - vertex3f_for_vector3(a), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_topleft) - ); - m_vertices[index * 4 + 1] = ArbitraryMeshVertex( - vertex3f_for_vector3(b), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_topright) - ); - m_vertices[index * 4 + 2] = ArbitraryMeshVertex( - vertex3f_for_vector3(c), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_botright) - ); - m_vertices[index * 4 + 3] = ArbitraryMeshVertex( - vertex3f_for_vector3(d), - normal3f_for_vector3(normal), - texcoord2f_from_array(aabb_texcoord_botleft) - ); - } - - void constructNull() - { - AABB aabb(Vector3(0, 0, 0), Vector3(8, 8, 8)); - - Vector3 points[8]; - aabb_corners(aabb, points); - - m_vertices.resize(24); - - constructQuad(0, points[2], points[1], points[5], points[6], aabb_normals[0]); - constructQuad(1, points[1], points[0], points[4], points[5], aabb_normals[1]); - constructQuad(2, points[0], points[1], points[2], points[3], aabb_normals[2]); - constructQuad(3, points[0], points[3], points[7], points[4], aabb_normals[3]); - constructQuad(4, points[3], points[2], points[6], points[7], aabb_normals[4]); - constructQuad(5, points[7], points[6], points[5], points[4], aabb_normals[5]); - - m_indices.resize(36); - - RenderIndex indices[36] = { - 0, 1, 2, 0, 2, 3, - 4, 5, 6, 4, 6, 7, - 8, 9, 10, 8, 10, 11, - 12, 13, 14, 12, 14, 15, - 16, 17, 18, 16, 18, 19, - 20, 21, 22, 10, 22, 23, - }; - - - Array::iterator j = m_indices.begin(); - for(RenderIndex* i = indices; i != indices+(sizeof(indices)/sizeof(RenderIndex)); ++i) - { - *j++ = *i; - } - - m_shader = ""; - - UpdateAABB(); - } -}; - - -typedef std::pair PicoModelKey; - - -class PicoModel : -public Cullable, -public Bounded -{ - typedef std::vector surfaces_t; - surfaces_t m_surfaces; - - AABB m_aabb_local; -public: - Callback m_lightsChanged; - - PicoModel() - { - constructNull(); - } - PicoModel(picoModel_t* model) - { - CopyPicoModel(model); - } - ~PicoModel() - { - for(surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - delete *i; - } - - typedef surfaces_t::const_iterator const_iterator; - - const_iterator begin() const - { - return m_surfaces.begin(); - } - const_iterator end() const - { - return m_surfaces.end(); - } - std::size_t size() const - { - return m_surfaces.size(); - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - - virtual const AABB& localAABB() const - { - return m_aabb_local; - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, std::vector states) const - { - for(surfaces_t::const_iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - { - if((*i)->intersectVolume(volume, localToWorld) != c_volumeOutside) - { - (*i)->render(renderer, localToWorld, states[i - m_surfaces.begin()]); - } - } - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - for(surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i) - { - if((*i)->intersectVolume(test.getVolume(), localToWorld) != c_volumeOutside) - { - (*i)->testSelect(selector, test, localToWorld); - } - } - } - -private: - void CopyPicoModel(picoModel_t* model) - { - m_aabb_local = AABB(); - - /* each surface on the model will become a new map drawsurface */ - int numSurfaces = PicoGetModelNumSurfaces( model ); - //% SYs_FPrintf( SYS_VRB, "Model %s has %d surfaces\n", name, numSurfaces ); - for(int s = 0; s < numSurfaces; ++s) - { - /* get surface */ - picoSurface_t* surface = PicoGetModelSurface( model, s ); - if( surface == 0 ) - continue; - - /* only handle triangle surfaces initially (fixme: support patches) */ - if( PicoGetSurfaceType( surface ) != PICO_TRIANGLES ) - continue; - - /* fix the surface's normals */ - PicoFixSurfaceNormals( surface ); - - PicoSurface* picosurface = new PicoSurface(surface); - aabb_extend_by_aabb_safe(m_aabb_local, picosurface->localAABB()); - m_surfaces.push_back(picosurface); - } - } - void constructNull() - { - PicoSurface* picosurface = new PicoSurface(); - m_aabb_local = picosurface->localAABB(); - m_surfaces.push_back(picosurface); - } -}; - -inline void Surface_addLight(PicoSurface& surface, VectorLightList& lights, const Matrix4& localToWorld, const RendererLight& light) -{ - if(light.testAABB(aabb_for_oriented_aabb(surface.localAABB(), localToWorld))) - { - lights.addLight(light); - } + g_QglTable.m_pfn_qglBegin(GL_LINES); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMin[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMin[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMin[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMax[2]); + g_QglTable.m_pfn_qglVertex3f(vMax[0],vMax[1],vMin[2]); + g_QglTable.m_pfn_qglEnd(); } -class PicoModelInstance : - public scene::Instance, - public Renderable, - public SelectionTestable, - public LightCullable, - public SkinnedModel -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - PicoModel& m_picomodel; - - const LightList* m_lightList; - typedef Array SurfaceLightLists; - SurfaceLightLists m_surfaceLightLists; - - class Remap - { - public: - CopiedString first; - Shader* second; - Remap() : second(0) - { - } - }; - typedef Array SurfaceRemaps; - SurfaceRemaps m_skins; - - PicoModelInstance(const PicoModelInstance&); - PicoModelInstance operator=(const PicoModelInstance&); -public: - typedef LazyStatic StaticTypeCasts; - - void* m_test; - - Bounded& get(NullType) - { - return m_picomodel; - } - Cullable& get(NullType) - { - return m_picomodel; - } - - void lightsChanged() - { - m_lightList->lightsChanged(); - } - typedef MemberCaller LightsChangedCaller; - - void constructRemaps() - { - ASSERT_MESSAGE(m_skins.size() == m_picomodel.size(), "ERROR"); - ModelSkin* skin = NodeTypeCast::cast(path().parent()); - if(skin != 0 && skin->realised()) - { - SurfaceRemaps::iterator j = m_skins.begin(); - for(PicoModel::const_iterator i = m_picomodel.begin(); i != m_picomodel.end(); ++i, ++j) - { - const char* remap = skin->getRemap((*i)->getShader()); - if(!string_empty(remap)) - { - (*j).first = remap; - (*j).second = GlobalShaderCache().capture(remap); - } - else - { - (*j).second = 0; - } - } - SceneChangeNotify(); - } - } - void destroyRemaps() - { - ASSERT_MESSAGE(m_skins.size() == m_picomodel.size(), "ERROR"); - for(SurfaceRemaps::iterator i = m_skins.begin(); i != m_skins.end(); ++i) - { - if((*i).second != 0) - { - GlobalShaderCache().release((*i).first.c_str()); - (*i).second = 0; - } - } - } - void skinChanged() - { - destroyRemaps(); - constructRemaps(); - } - - PicoModelInstance(const scene::Path& path, scene::Instance* parent, PicoModel& picomodel) : - Instance(path, parent, this, StaticTypeCasts::instance().get()), - m_picomodel(picomodel), - m_surfaceLightLists(m_picomodel.size()), - m_skins(m_picomodel.size()) - { - m_lightList = &GlobalShaderCache().attach(*this); - m_picomodel.m_lightsChanged = LightsChangedCaller(*this); - - Instance::setTransformChangedCallback(LightsChangedCaller(*this)); - - constructRemaps(); - } - ~PicoModelInstance() - { - destroyRemaps(); - - Instance::setTransformChangedCallback(Callback()); - - m_picomodel.m_lightsChanged = Callback(); - GlobalShaderCache().detach(*this); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - SurfaceLightLists::const_iterator j = m_surfaceLightLists.begin(); - SurfaceRemaps::const_iterator k = m_skins.begin(); - for(PicoModel::const_iterator i = m_picomodel.begin(); i != m_picomodel.end(); ++i, ++j, ++k) - { - if((*i)->intersectVolume(volume, localToWorld) != c_volumeOutside) - { - renderer.setLights(*j); - (*i)->render(renderer, localToWorld, (*k).second != 0 ? (*k).second : (*i)->getState()); - } - } - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_lightList->evaluateLights(); - - render(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - m_picomodel.testSelect(selector, test, Instance::localToWorld()); - } - - bool testLight(const RendererLight& light) const - { - return light.testAABB(worldAABB()); - } - void insertLight(const RendererLight& light) - { - const Matrix4& localToWorld = Instance::localToWorld(); - SurfaceLightLists::iterator j = m_surfaceLightLists.begin(); - for(PicoModel::const_iterator i = m_picomodel.begin(); i != m_picomodel.end(); ++i) - { - Surface_addLight(*(*i), *j++, localToWorld, light); - } - } - void clearLights() - { - for(SurfaceLightLists::iterator i = m_surfaceLightLists.begin(); i != m_surfaceLightLists.end(); ++i) - { - (*i).clear(); - } - } -}; - -class PicoModelNode : public scene::Node::Symbiot, public scene::Instantiable -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - PicoModel m_picomodel; - -public: - typedef LazyStatic StaticTypeCasts; - - PicoModelNode() : m_node(this, this, StaticTypeCasts::instance().get()) - { - } - PicoModelNode(picoModel_t* model) : m_node(this, this, StaticTypeCasts::instance().get()), m_picomodel(model) - { - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new PicoModelInstance(path, parent, m_picomodel); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - - -#if 0 - -template -class create_new -{ -public: - static Type* construct(const Key& key) - { - return new Type(key); - } - static void destroy(Type* value) - { - delete value; - } -}; - -template > -class cache_element : public creation_policy -{ -public: - inline cache_element() : m_count(0), m_value(0) {} - inline ~cache_element() - { - ASSERT_MESSAGE(m_count == 0 , "destroyed a reference before it was released\n"); - if(m_count > 0) - destroy(); - } - inline Type* capture(const Key& key) - { - if(++m_count == 1) - construct(key); - return m_value; - } - inline void release() - { - ASSERT_MESSAGE(!empty(), "failed to release reference - not found in cache\n"); - if(--m_count == 0) - destroy(); - } - inline bool empty() - { - return m_count == 0; - } - inline void refresh(const Key& key) - { - m_value->refresh(key); - } -private: - inline void construct(const Key& key) - { - m_value = creation_policy::construct(key); - } - inline void destroy() - { - creation_policy::destroy(m_value); - } - - std::size_t m_count; - Type* m_value; -}; - -class create_picomodel -{ - typedef PicoModelKey key_type; - typedef PicoModel value_type; -public: - static value_type* construct(const key_type& key) - { - picoModel_t* picomodel = PicoLoadModel(const_cast(key.first.c_str()), key.second); - value_type* value = new value_type(picomodel); - PicoFreeModel(picomodel); - return value; - } - static void destroy(value_type* value) - { - delete value; - } -}; - -#include - -class ModelCache -{ - typedef PicoModel value_type; - -public: - typedef PicoModelKey key_type; - typedef cache_element elem_type; - typedef std::map cache_type; - - value_type* capture(const key_type& key) - { - return m_cache[key].capture(key); - } - void release(const key_type& key) - { - m_cache[key].release(); - } - -private: - cache_type m_cache; -}; - -ModelCache g_model_cache; - - - -typedef struct remap_s { - char m_remapbuff[64+1024]; - char *original; - char *remap; -} remap_t; - -class RemapWrapper : -public Cullable, -public Bounded -{ -public: - RemapWrapper(const char* name) - { - parse_namestr(name); - - m_model = g_model_cache.capture(ModelCache::key_type(m_name, m_frame)); - - construct_shaders(); - } - virtual ~RemapWrapper() - { - g_model_cache.release(ModelCache::key_type(m_name, m_frame)); - - for(shaders_t::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) - { - GlobalShaderCache().release((*i).c_str()); - } - - for(remaps_t::iterator j = m_remaps.begin(); j != m_remaps.end(); ++j) - { - delete (*j); - } - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return m_model->intersectVolume(test, localToWorld); - } - - virtual const AABB& localAABB() const - { - return m_model->localAABB(); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - m_model->render(renderer, volume, localToWorld, m_states); - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - m_model->testSelect(selector, test, localToWorld); - } - -private: - void add_remap(const char *remap) - { - const char *ch; - remap_t *pRemap; - - ch = remap; - - while( *ch && *ch != ';' ) - ch++; - - if( *ch == '\0' ) { - // bad remap - globalErrorStream() << "WARNING: Shader _remap key found in a model entity without a ; character\n"; - } else { - pRemap = new remap_t; - - strncpy( pRemap->m_remapbuff, remap, sizeof(pRemap->m_remapbuff) ); - - pRemap->m_remapbuff[ch - remap] = '\0'; - - pRemap->original = pRemap->m_remapbuff; - pRemap->remap = pRemap->m_remapbuff + ( ch - remap ) + 1; - - m_remaps.push_back( pRemap ); - } - } - - void parse_namestr(const char *name) - { - const char *ptr, *s; - bool hasName, hasFrame; - - hasName = hasFrame = false; - - m_frame = 0; - - for( s = ptr = name; ; ++ptr ) - { - if( !hasName && (*ptr == ':' || *ptr == '\0')) - { - // model name - hasName = true; - m_name = CopiedString(s, ptr); - s = ptr + 1; - } - else if(*ptr == '?' || *ptr == '\0') - { - // model frame - hasFrame = true; - m_frame = atoi(CopiedString(s, ptr).c_str()); - s = ptr + 1; - } - else if(*ptr == '&' || *ptr == '\0') - { - // a remap - add_remap(CopiedString(s, ptr).c_str()); - s = ptr + 1; - } - - if(*ptr == '\0') - break; - } - } - - void construct_shaders() - { - const char* global_shader = shader_for_remap("*"); - - m_shaders.reserve(m_model->size()); - m_states.reserve(m_model->size()); - for(PicoModel::iterator i = m_model->begin(); i != m_model->end(); ++i) - { - const char* shader = shader_for_remap((*i)->getShader()); - m_shaders.push_back( - (shader[0] != '\0') - ? shader - : (global_shader[0] != '\0') - ? global_shader - : (*i)->getShader()); - m_states.push_back(GlobalShaderCache().capture(m_shaders.back().c_str())); - } - } - - inline const char* shader_for_remap(const char* remap) - { - for(remaps_t::iterator i = m_remaps.begin(); i != m_remaps.end(); ++i) - { - if(shader_equal(remap, (*i)->original)) - { - return (*i)->remap; - } - } - return ""; - } - - CopiedString m_name; - int m_frame; - PicoModel* m_model; - - typedef std::vector remaps_t; - remaps_t m_remaps; - typedef std::vector shaders_t; - shaders_t m_shaders; - typedef std::vector states_t; - states_t m_states; -}; - -class RemapWrapperInstance : public scene::Instance, public Renderable, public SelectionTestable -{ - RemapWrapper& m_remapwrapper; -public: - RemapWrapperInstance(const scene::Path& path, scene::Instance* parent, RemapWrapper& remapwrapper) : Instance(path, parent), m_remapwrapper(remapwrapper) - { - scene::Instance::m_cullable = &m_remapwrapper; - scene::Instance::m_render = this; - scene::Instance::m_select = this; - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_remapwrapper.render(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - m_remapwrapper.testSelect(selector, test, Instance::localToWorld()); - } -}; - -class RemapWrapperNode : public scene::Node::Symbiot, public scene::Instantiable -{ - scene::Node m_node; - typedef RemapWrapperInstance instance_type; - InstanceSet m_instances; - RemapWrapper m_remapwrapper; -public: - RemapWrapperNode(const char* name) : m_node(this), m_remapwrapper(name) - { - m_node.m_instance = this; - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new instance_type(path, parent, m_remapwrapper); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -scene::Node& LoadRemapModel(const char* name) -{ - return (new RemapWrapperNode(name))->node(); -} - -#endif - - -size_t picoInputStreamReam(void* inputStream, unsigned char* buffer, size_t length) -{ - return reinterpret_cast(inputStream)->read(buffer, length); -} - -scene::Node& loadPicoModel(const picoModule_t* module, ArchiveFile& file) -{ - picoModel_t* model = PicoModuleLoadModelStream(module, &file.getInputStream(), picoInputStreamReam, file.size(), 0); - PicoModelNode* modelNode = new PicoModelNode(model); - PicoFreeModel(model); - return modelNode->node(); -} diff --git a/plugins/model/model.def b/plugins/model/model.def new file mode 100644 index 00000000..18e255e3 --- /dev/null +++ b/plugins/model/model.def @@ -0,0 +1,8 @@ +; model.def : Declares the module parameters for the DLL. + +LIBRARY "MODEL" +DESCRIPTION 'MODEL Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 \ No newline at end of file diff --git a/plugins/model/model.h b/plugins/model/model.h deleted file mode 100644 index 9de1ffa2..00000000 --- a/plugins/model/model.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MODEL_H) -#define INCLUDED_MODEL_H - -namespace scene { class Node; } -class ArchiveFile; -typedef struct picoModule_s picoModule_t; -scene::Node& loadPicoModel(const picoModule_t* module, ArchiveFile& file); - -#endif diff --git a/plugins/model/model.vcproj b/plugins/model/model.vcproj new file mode 100644 index 00000000..31e89130 --- /dev/null +++ b/plugins/model/model.vcproj @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/model/modelpico.def b/plugins/model/modelpico.def deleted file mode 100644 index b92e0dbb..00000000 --- a/plugins/model/modelpico.def +++ /dev/null @@ -1,7 +0,0 @@ -; modelpico.def : Declares the module parameters for the DLL. - -LIBRARY "MODELPICO" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 \ No newline at end of file diff --git a/plugins/model/modelpico.vcproj b/plugins/model/modelpico.vcproj deleted file mode 100644 index bffb4086..00000000 --- a/plugins/model/modelpico.vcproj +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/model/plugin.cpp b/plugins/model/plugin.cpp index e032e398..a69ce21f 100644 --- a/plugins/model/plugin.cpp +++ b/plugins/model/plugin.cpp @@ -1,6 +1,7 @@ + /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -21,62 +22,81 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "plugin.h" -#include +// toolbar implementation + +class CFlushReloadSelectedToolbarButton : public IToolbarButton +{ +public: + virtual const char* getImage() const + { + return "model_reload_entity.bmp"; + } + virtual const char* getText() const + { + return "Reload"; + } + virtual const char* getTooltip() const + { + return "Flush & Reload Selected Model"; + } + virtual void activate() const + { + DoFlushReloadSelected(); + } + virtual EType getType() const + { + return eButton; + } +}; + +CFlushReloadSelectedToolbarButton g_flushreloadselected; + +unsigned int ToolbarButtonCount() +{ + return 1; +} + +const IToolbarButton* GetToolbarButton(unsigned int index) +{ + return &g_flushreloadselected; +} + +// ============================================================================= +// Pico utility functions + #include "picomodel.h" -typedef unsigned char byte; -#include -#include -#include - -#include "iscenegraph.h" -#include "irender.h" -#include "iselection.h" -#include "iimage.h" -#include "imodel.h" -#include "igl.h" -#include "ifilesystem.h" -#include "iundo.h" -#include "ifiletypes.h" - -#include "modulesystem/singletonmodule.h" -#include "stream/textstream.h" -#include "string/string.h" -#include "stream/stringstream.h" -#include "typesystem.h" - -#include "model.h" void PicoPrintFunc( int level, const char *str ) { - if( str == 0 ) + if( str == NULL ) return; switch( level ) { case PICO_NORMAL: - globalOutputStream() << str << "\n"; + Sys_Printf( "%s\n", str ); break; case PICO_VERBOSE: - //globalOutputStream() << "PICO_VERBOSE: " << str << "\n"; + Sys_FPrintf( SYS_VRB, "%s\n", str ); break; case PICO_WARNING: - globalErrorStream() << "PICO_WARNING: " << str << "\n"; + Sys_Printf( "WARNING: %s\n", str ); break; case PICO_ERROR: - globalErrorStream() << "PICO_ERROR: " << str << "\n"; + Sys_FPrintf( SYS_VRB, "ERROR: %s\n", str ); break; case PICO_FATAL: - globalErrorStream() << "PICO_FATAL: " << str << "\n"; + Sys_Printf( "ERROR: %s\n", str ); break; } } void PicoLoadFileFunc( char *name, byte **buffer, int *bufSize ) { - *bufSize = vfsLoadFile( (const char*) name, (void**) buffer); + *bufSize = vfsLoadFile( (const char*) name, (void**) buffer, 0 ); } void PicoFreeFileFunc( void* file ) @@ -84,7 +104,7 @@ void PicoFreeFileFunc( void* file ) vfsFreeFile(file); } -void pico_initialise() +static void initialise() { PicoInit(); PicoSetMallocFunc( malloc ); @@ -94,96 +114,199 @@ void pico_initialise() PicoSetFreeFileFunc( PicoFreeFileFunc ); } - -class PicoModelLoader : public ModelLoader +static void add_model_apis(CSynapseClient& client) { - const picoModule_t* m_module; -public: - PicoModelLoader(const picoModule_t* module) : m_module(module) + const picoModule_t** modules = PicoModuleList( NULL ); + while(*modules != NULL) { - } - scene::Node& loadModel(ArchiveFile& file) - { - return loadPicoModel(m_module, file); - } -}; + const picoModule_t* module = *modules++; + if(module->canload && module->load) + for(unsigned int j = 0; module->defaultExts[j] != NULL; j++) + client.AddAPI(MODEL_MAJOR, module->defaultExts[j], sizeof(_QERPlugModelTable)); + } +} -class ModelPicoDependencies : - public GlobalFileSystemModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalFiletypesModuleRef +static bool model_is_supported(const char* extension) { -}; + const picoModule_t** modules = PicoModuleList( NULL ); + while(*modules != NULL) + { + const picoModule_t* module = *modules++; + if(module->canload && module->load) + for(unsigned int j = 0; module->defaultExts[j] != NULL; j++) + if(strcmp(extension, module->defaultExts[j]) == 0) + return true; + } + return false; +} -class ModelPicoAPI : public TypeSystemRef +void init_filetypes() { - PicoModelLoader m_modelLoader; -public: - typedef ModelLoader Type; - - ModelPicoAPI(const char* extension, const picoModule_t* module) : - m_modelLoader(module) - { - StringOutputStream filter(128); - filter << "*." << extension; - GlobalFiletypesModule::getTable().addType(Type::Name(), extension, filetype_t(module->displayName, filter.c_str())); - } - ModelLoader* getTable() - { - return &m_modelLoader; - } -}; - -class PicoModelAPIConstructor -{ - CopiedString m_extension; - const picoModule_t* m_module; -public: - PicoModelAPIConstructor(const char* extension, const picoModule_t* module) : - m_extension(extension), m_module(module) - { - } - const char* getName() - { - return m_extension.c_str(); - } - ModelPicoAPI* constructAPI(ModelPicoDependencies& dependencies) - { - return new ModelPicoAPI(m_extension.c_str(), m_module); - } - void destroyAPI(ModelPicoAPI* api) - { - delete api; - } -}; - - -typedef SingletonModule PicoModelModule; -typedef std::list PicoModelModules; -PicoModelModules g_PicoModelModules; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - pico_initialise(); - - const picoModule_t** modules = PicoModuleList( 0 ); - while(*modules != 0) + const picoModule_t **modules = PicoModuleList(NULL); + while(*modules != NULL) { const picoModule_t* module = *modules++; if(module->canload && module->load) { - for(char*const* ext = module->defaultExts; *ext != 0; ++ext) + for(char*const* ext = module->defaultExts; *ext != NULL; ++ext) { - g_PicoModelModules.push_back(PicoModelModule(PicoModelAPIConstructor(*ext, module))); - g_PicoModelModules.back().selfRegister(); + char buf[16]; + buf[0] = '*'; + buf[1] = '.'; + strcpy(buf+2, *ext); + GetFileTypeRegistry()->addType(MODEL_MAJOR, filetype_t(module->displayName, buf)); } } } } + +// plugin implementation + +static const char *PLUGIN_NAME = "Model loading module"; +static const char *PLUGIN_COMMANDS = "About;-;Flush & Reload Models;Flush & Reload Selected"; +static const char *PLUGIN_ABOUT = "Model Module v1.0 for GtkRadiant\nby Arnout van Meer (rr2do2@splashdamage.com)\n\nBased on the MD3Model Module by SPoG\nPicoModel Library Copyright (c) 2002, Randy Reddig & seaw0lf\n\nSupported models:\n"; + +extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) +{ + init_filetypes(); + 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" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush) +{ + if( !strcmp( p, "Flush & Reload Selected" ) ) + DoFlushReloadSelected(); + else if( !strcmp( p, "Flush & Reload Models" ) ) + DoFlushReloadAll(); + else if( !strcmp( p, "About" ) ) { + const picoModule_t** modules = PicoModuleList( NULL ); + char about_buf[1024]; + strncpy(about_buf, PLUGIN_ABOUT, sizeof(about_buf) - 1); + while(*modules != NULL) { + const picoModule_t* module = *modules++; + strncat(about_buf, module->displayName, sizeof(about_buf) - 1); + strncat(about_buf, " (", sizeof(about_buf) - 1); + strncat(about_buf, module->defaultExts[0], sizeof(about_buf) - 1); + strncat(about_buf, ")\n\t", sizeof(about_buf) - 1); + strncat(about_buf, module->copyright, sizeof(about_buf) - 1); + strncat(about_buf, "\n", sizeof(about_buf) - 1); + } + g_FuncTable.m_pfnMessageBox(NULL, about_buf, "About", MB_OK, NULL); + } +} + + +void DoFlushReloadSelected() { +} + +void DoFlushReloadAll() { + GetModelCache()->RefreshAll(); +} + +// ============================================================================= + +// function tables +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; +_QERShadersTable g_ShadersTable; +_QERFileSystemTable g_FileSystemTable; + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientModel g_SynapseClient; + +static const XMLConfigEntry_t entries[] = + { { SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable }, + { VFS_MAJOR, SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() ); + + initialise(); + + add_model_apis(g_SynapseClient); + g_SynapseClient.AddAPI(TOOLBAR_MAJOR, "model", sizeof(_QERPlugToolbarTable)); + g_SynapseClient.AddAPI(PLUGIN_MAJOR, "model", sizeof(_QERPluginTable)); + + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(g_FuncTable), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(QGL_MAJOR, NULL, sizeof(g_QglTable), SYN_REQUIRE, &g_QglTable); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; + } + + return &g_SynapseClient; +} + +bool CSynapseClientModel::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, MODEL_MAJOR)) + { + _QERPlugModelTable* pTable= static_cast<_QERPlugModelTable*>(pAPI->mpTable); + + if (model_is_supported(pAPI->minor_name)) + { + pTable->m_pfnLoadModel = &LoadModel; + return true; + } + } + else if (!strcmp(pAPI->major_name, TOOLBAR_MAJOR)) + { + _QERPlugToolbarTable* pTable= static_cast<_QERPlugToolbarTable*>(pAPI->mpTable); + + pTable->m_pfnToolbarButtonCount = &ToolbarButtonCount; + pTable->m_pfnGetToolbarButton = &GetToolbarButton; + return true; + } + else 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; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientModel::GetInfo() +{ + return "picomodel loader module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientModel::GetName() +{ + return "model"; +} diff --git a/plugins/model/plugin.h b/plugins/model/plugin.h index 2f28d852..b2ccccda 100644 --- a/plugins/model/plugin.h +++ b/plugins/model/plugin.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,58 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ -#endif +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +/*! +\todo not sure about what should be used for common data structures, GLib or STL +I think STL would be better since I intend on using STL in synapse +*/ + +#include + +#include "synapse.h" +#include "iplugin.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "imodel.h" +#include "igl.h" +#include "ifilesystem.h" +#include "ishaders.h" +#include "itoolbar.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERShadersTable g_ShadersTable; +extern _QERFileSystemTable g_FileSystemTable; + +#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile +#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile +#define vfsBasePromptPath g_FileSystemTable.m_pfnBasePromptPath +#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName + +void DoFlushReloadSelected(); +void DoFlushReloadAll(); + +void LoadModel(entity_interfaces_t *model, const char *name); + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientModel : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientModel() { } + virtual ~CSynapseClientModel() { } +}; + +#endif // _PLUGIN_H_ diff --git a/plugins/model/remap.cpp b/plugins/model/remap.cpp new file mode 100644 index 00000000..73468ac5 --- /dev/null +++ b/plugins/model/remap.cpp @@ -0,0 +1,318 @@ + +#include "cpicomodel.h" +#include "qertypes.h" + +#include +#include + +#define RADIANT_ASSERT(condition, message) if(!(condition)) { Sys_Printf("ASSERTION FAILURE: " message "\n"); } else + +template +class cache_element +{ +public: + inline cache_element() : m_count(0), m_value(NULL) {} + inline ~cache_element() + { + RADIANT_ASSERT(m_count == 0 , "destroyed a reference before it was released\n"); + if(m_count > 0) + destroy(); + } + inline value_type* capture(const key_type& key) + { + if(++m_count == 1) + construct(key); + return m_value; + } + inline void release() + { + RADIANT_ASSERT(!empty(), "failed to release reference - not found in cache\n"); + if(--m_count == 0) + destroy(); + } + inline bool empty() + { + return m_count == 0; + } + inline void refresh(const key_type& key) + { + m_value->refresh(key); + } +private: + inline void construct(const key_type& key) + { + m_value = new value_type(key); + } + inline void destroy() + { + delete m_value; + } + + unsigned int m_count; + value_type* m_value; +}; + +class ModelCache +{ + typedef CPicoModel value_type; + +public: + typedef PicoModelKey key_type; + typedef cache_element elem_type; + typedef map cache_type; + + value_type* capture(const key_type& key) + { + return m_cache[key].capture(key); + } + void release(const key_type& key) + { + m_cache[key].release(); + } + +private: + cache_type m_cache; +}; + +ModelCache g_model_cache; + + + +typedef struct remap_s { + char m_remapbuff[64+1024]; + char *original; + char *remap; +} remap_t; + +class RemapWrapper : public IRender, public ISelect +{ + unsigned int m_refcount; +public: + RemapWrapper(entity_interfaces_t* model, const char* name) + : m_refcount(1) + { + parse_namestr(name); + + m_model = g_model_cache.capture(ModelCache::key_type(m_name.GetBuffer(), m_frame)); + + model->pRender = this; + model->pRender->IncRef(); + model->pEdit = NULL; + model->pSelect = this; + model->pSelect->IncRef(); + + construct_shaders(); + } + virtual ~RemapWrapper() + { + g_model_cache.release(ModelCache::key_type(m_name.GetBuffer(), m_frame)); + + for(shaders_t::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) { + (*i)->DecRef(); + } + + for(remaps_t::iterator j = m_remaps.begin(); j != m_remaps.end(); ++j) + { + remap_t *pRemap = (*j); + delete pRemap; + } + m_remaps.clear(); + } + virtual void IncRef() + { + ++m_refcount; + } + virtual void DecRef() + { + if(--m_refcount == 0) + delete this; + } + virtual void Draw(int state, int rflags) const + { + m_model->Draw(state, m_shaders, rflags); + } + virtual const aabb_t *GetAABB() const + { + return m_model->GetAABB(); + } + virtual bool TestRay(const ray_t *ray, vec_t *dist) const + { + return m_model->TestRay(ray, dist); + } +private: + void add_remap(const char *remap) + { + const char *ch; + remap_t *pRemap; + + ch = remap; + + while( *ch && *ch != ';' ) + ch++; + + if( *ch == '\0' ) { + // bad remap + Sys_FPrintf( SYS_WRN, "WARNING: Shader _remap key found in a model entity without a ; character\n" ); + } else { + pRemap = new remap_t; + + strncpy( pRemap->m_remapbuff, remap, sizeof(pRemap->m_remapbuff) ); + + pRemap->m_remapbuff[ch - remap] = '\0'; + + pRemap->original = pRemap->m_remapbuff; + pRemap->remap = pRemap->m_remapbuff + ( ch - remap ) + 1; + + m_remaps.push_back( pRemap ); + } + } + + void parse_namestr(const char *name) + { + const char *ptr, *s; + char buf[1024]; + bool hasName, hasFrame; + + hasName = hasFrame = false; + + for( s = ptr = name; *ptr; ptr++ ) { + if( !hasName && *ptr == ':' ) { + // model name + hasName = true; + strncpy( buf, s, ptr - s ); + buf[ptr - s] = '\0'; + m_name = buf; + s = ptr + 1; + } else if( *ptr == '?' ) { + // model frame + hasFrame = true; + strncpy( buf, s, ptr - s ); + buf[ptr - s] = '\0'; + m_frame = atoi(buf); + s = ptr + 1; + } else if( *ptr == '&' ) { + // a remap + strncpy( buf, s, ptr - s ); + buf[ptr - s] = '\0'; + add_remap( buf ); + s = ptr + 1; + } + } + + if( !hasFrame ) { + // model frame + strncpy( buf, s, ptr - s ); + buf[ptr - s] = '\0'; + m_frame = atoi(buf); + } else { + // a remap + strncpy( buf, s, ptr - s ); + buf[ptr - s] = '\0'; + add_remap( buf ); + } + } + + void construct_shaders() + { + IShader* global_shader = shader_for_remap("*"); + + unsigned int numSurfaces = m_model->GetNumSurfaces(); + m_shaders.reserve(numSurfaces); + // now go through our surface and find our shaders, remap if needed + for(unsigned int j = 0; j < numSurfaces; j++ ) + { + const char* surfShaderName = m_model->GetShaderNameForSurface(j); + IShader* shader = shader_for_remap(surfShaderName); +// m_shaders.push_back((shader) ? shader : (global_shader) ? global_shader : QERApp_Shader_ForName(surfShaderName)); + if( shader ) { + m_shaders.push_back(shader); + } else if( global_shader ) { + m_shaders.push_back(global_shader); + } else { + m_shaders.push_back(QERApp_Shader_ForName(surfShaderName)); + } + } + } + + inline IShader* shader_for_remap(const char* remap) + { + remap_t *pRemap; + remaps_t::iterator i; + for(i = m_remaps.begin(); i != m_remaps.end(); ++i) + { + pRemap = (*i); + if( stricmp( remap, pRemap->original ) == 0 ) + break; + } + return (i != m_remaps.end()) ? QERApp_Shader_ForName(pRemap->remap) : NULL; + } + + Str m_name; + int m_frame; + CPicoModel* m_model; + + typedef vector remaps_t; + remaps_t m_remaps; + typedef vector shaders_t; + shaders_t m_shaders; +}; + +class ModelWrapper : public IRender, public ISelect +{ + unsigned int m_refcount; +public: + ModelWrapper(entity_interfaces_t* model, const char* name) + : m_refcount(1), m_name(name) + { + m_model = g_model_cache.capture(ModelCache::key_type(m_name.GetBuffer(), 0)); + + model->pRender = this; + model->pRender->IncRef(); + model->pEdit = NULL; + model->pSelect = this; + model->pSelect->IncRef(); + } + virtual ~ModelWrapper() + { + g_model_cache.release(ModelCache::key_type(m_name.GetBuffer(), 0)); + } + + virtual void IncRef() + { + ++m_refcount; + } + virtual void DecRef() + { + if(--m_refcount == 0) + delete this; + } + virtual void Draw(int state, int rflags) const + { + m_model->Draw(state, rflags); + } + virtual const aabb_t *GetAABB() const + { + return m_model->GetAABB(); + } + virtual bool TestRay(const ray_t *ray, vec_t *dist) const + { + return m_model->TestRay(ray, dist); + } + + Str m_name; + CPicoModel* m_model; +}; + +void LoadModel(entity_interfaces_t* model, const char* name) +{ + if(strchr(name, ':') != NULL || strchr(name, '?') != NULL || strchr(name, '&') != NULL) + { + RemapWrapper* wrapper = new RemapWrapper(model, name); + wrapper->DecRef(); + } + else + { + ModelWrapper* wrapper = new ModelWrapper(model, name); + wrapper->DecRef(); + } +} diff --git a/radiant/csg.h b/plugins/model/surface.h similarity index 55% rename from radiant/csg.h rename to plugins/model/surface.h index 867ab199..43d9b276 100644 --- a/radiant/csg.h +++ b/plugins/model/surface.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,28 +19,20 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_CSG_H) -#define INCLUDED_CSG_H - -void CSG_MakeHollow (void); -void CSG_Subtract (void); -void CSG_Merge (void); - -namespace scene +class CSurface : public ISurface { - class Graph; -} -template class BasicVector3; -typedef BasicVector3 Vector3; -class Plane3; +public: + CSurface() { refCount = 0; aabb_clear(&m_BBox); m_pShader = NULL; } + ~CSurface() { if(m_pShader != NULL) m_pShader->DecRef(); } + void IncRef() { refCount++; } + void DecRef() { if ( --refCount <= 0 ) delete this; } -void Scene_BrushSetClipPlane(scene::Graph& graph, const Plane3& plane); -enum EBrushSplit -{ - eFront, - eBack, - eFrontAndBack, -}; -void Scene_BrushSplitByPlane(scene::Graph& graph, const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, EBrushSplit split); + const aabb_t *getBBox() const { return &m_BBox; } + IShader *getShader() const { return m_pShader; } + void setShader(const char *name) { if (getShader()) getShader()->DecRef(); m_pShader = QERApp_Shader_ForName(name); getShader()->IncRef(); } -#endif +protected: + int refCount; + aabb_t m_BBox; + IShader *m_pShader; +}; \ No newline at end of file diff --git a/plugins/sample/plugin.cpp b/plugins/sample/plugin.cpp new file mode 100644 index 00000000..e5971217 --- /dev/null +++ b/plugins/sample/plugin.cpp @@ -0,0 +1,209 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "plugin.h" + +#define CMD_SEP "-" +#define CMD_ABOUT "About..." +// ============================================================================= +// Globals + +// function tables +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; +_QERFileSystemTable g_FileSystemTable; +_QEREntityTable g_EntityTable; +_QERAppDataTable g_DataTable; + +// the gtk widget +void *g_pMainWidget; + +// ============================================================================= +// plugin implementation + +#define PLUGIN_NAME "Sample plugin" + +//backwards for some reason +static const char *PLUGIN_COMMANDS = CMD_ABOUT ";" CMD_SEP; +static const char *PLUGIN_ABOUT = "Sample plugin\n"; + +void DoSample (void) +{ + Sys_Printf("Sample button hit"); +} + +#define NUM_TOOLBAR_BUTTONS 1 +typedef struct toolbar_button_info_s +{ + char *image; + char *text; + char *tip; + void (*func)(); + IToolbarButton::EType type; +} toolbar_button_info_t; + +static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] = +{ + { + "sample.bmp", + "Sample", + "Sample image", + DoSample, + IToolbarButton::eToggleButton + }, +}; + +class SampleButton : 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; + } +}; + +SampleButton g_samplebuttons[NUM_TOOLBAR_BUTTONS]; + +unsigned int ToolbarButtonCount (void) +{ + return NUM_TOOLBAR_BUTTONS; +} + +const IToolbarButton* GetToolbarButton (unsigned int index) +{ + g_samplebuttons[index].bi = &toolbar_buttons[index]; + return &g_samplebuttons[index]; +} + +extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) +{ + g_pMainWidget = pMainWidget; + + return PLUGIN_NAME; +} + +extern "C" const char* QERPlug_GetName (void) +{ + return (char *) PLUGIN_NAME; +} + +extern "C" const char* QERPlug_GetCommandList (void) +{ + return (char *) PLUGIN_COMMANDS; +} + +extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush) +{ + if (!strcmp(p, CMD_ABOUT)) { + g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); + } else { + Sys_Printf("Message: %s\n", p); + } +} + +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientSample g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) +{ +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(TOOLBAR_MAJOR, SAMPLE_MINOR, sizeof(_QERPlugToolbarTable)); + g_SynapseClient.AddAPI(PLUGIN_MAJOR, SAMPLE_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); + 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); + // selected brushes + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(g_DataTable), SYN_REQUIRE, &g_DataTable); + + return &g_SynapseClient; +} + +bool CSynapseClientSample::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; + } else 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* CSynapseClientSample::GetInfo() +{ + return PLUGIN_NAME " plugin built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientSample::GetName() +{ + return PLUGIN_NAME; +} + diff --git a/plugins/sample/plugin.h b/plugins/sample/plugin.h new file mode 100644 index 00000000..85b6c7dc --- /dev/null +++ b/plugins/sample/plugin.h @@ -0,0 +1,67 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +#include +// for CPtrArray for idata.h +#include "missing.h" + +#include "synapse.h" +#include "iplugin.h" +#include "itoolbar.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "igl.h" +#include "ifilesystem.h" +#include "ientity.h" +#include "idata.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERFileSystemTable g_FileSystemTable; +extern _QEREntityTable g_EntityTable; +extern _QERAppDataTable g_DataTable; +extern void *g_pMainWidget; + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientSample : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientSample() { } + virtual ~CSynapseClientSample() { } +}; + +#define SAMPLE_MINOR "sample" + +#endif // _PLUGIN_H_ diff --git a/plugins/sample/sample.cpp b/plugins/sample/sample.cpp deleted file mode 100644 index 41aa9bf8..00000000 --- a/plugins/sample/sample.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "sample.h" - -#include "debugging/debugging.h" - -#include "iplugin.h" - -#include "string/string.h" -#include "modulesystem/singletonmodule.h" -#include "typesystem.h" - -namespace Sample -{ - const char* init(void* hApp, void* pMainWidget) - { - return ""; - } - const char* getName() - { - return "Sample Plugin"; - } - const char* getCommandList() - { - return "About;Do Something"; - } - const char* getCommandTitleList() - { - return ""; - } - void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) - { - if(string_equal(command, "About")) - { - globalOutputStream() << "Sample Demo Plugin\n"; - } - if(string_equal(command, "Do Something")) - { - globalOutputStream() << "Sample Command\n"; - } - } - -} // namespace - -class SamplePluginModule : public TypeSystemRef -{ - _QERPluginTable m_plugin; -public: - typedef _QERPluginTable Type; - STRING_CONSTANT(Name, "sample"); - - SamplePluginModule() - { - m_plugin.m_pfnQERPlug_Init = &Sample::init; - m_plugin.m_pfnQERPlug_GetName = &Sample::getName; - m_plugin.m_pfnQERPlug_GetCommandList = &Sample::getCommandList; - m_plugin.m_pfnQERPlug_GetCommandTitleList = &Sample::getCommandTitleList; - m_plugin.m_pfnQERPlug_Dispatch = &Sample::dispatch; - } - _QERPluginTable* getTable() - { - return &m_plugin; - } -}; - -typedef SingletonModule SingletonSamplePluginModule; - -SingletonSamplePluginModule g_SamplePluginModule; - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_SamplePluginModule.selfRegister(); -} diff --git a/plugins/sample/sample.def b/plugins/sample/sample.def index 4906f782..f1f7a842 100644 --- a/plugins/sample/sample.def +++ b/plugins/sample/sample.def @@ -1,7 +1,8 @@ ; sample.def : Declares the module parameters for the DLL. LIBRARY "SAMPLE" +DESCRIPTION 'SAMPLE Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here - Radiant_RegisterModules @1 + Synapse_EnumerateInterfaces @1 diff --git a/plugins/sample/sample.h b/plugins/sample/sample.h deleted file mode 100644 index 2f338b60..00000000 --- a/plugins/sample/sample.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SAMPLE_H) -#define INCLUDED_SAMPLE_H - -#endif diff --git a/plugins/sample/sample.vcproj b/plugins/sample/sample.vcproj index f4e10f8c..83baed4b 100644 --- a/plugins/sample/sample.vcproj +++ b/plugins/sample/sample.vcproj @@ -1,269 +1,65 @@ - - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - - - - - - - - - - - + + + + + + - + \ No newline at end of file diff --git a/plugins/shaders/plugin.cpp b/plugins/shaders/plugin.cpp index 6ef23c37..2a238355 100644 --- a/plugins/shaders/plugin.cpp +++ b/plugins/shaders/plugin.cpp @@ -1,157 +1,103 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// +// Shaders Plugin +// + #include "plugin.h" -#include "ishaders.h" -#include "ifilesystem.h" -#include "itextures.h" -#include "iscriplib.h" -#include "qerplugin.h" +// ============================================================================= +// Globals -#include "string/string.h" -#include "modulesystem/singletonmodule.h" +// function tables +_QERFuncTable_1 g_FuncTable; +_QERAppDataTable g_DataTable; +_QERQglTable g_QglTable; +_QERAppShadersTable g_ShadersTable; +_QERFileSystemTable g_VFSTable; +_QERScripLibTable g_ScripLibTable; +_QERBrushTable g_BrushTable; -#include "shaders.h" +static bool g_bInterfaceInitDone = false; -class ShadersDependencies : - public GlobalFileSystemModuleRef, - public GlobalTexturesModuleRef, - public GlobalScripLibModuleRef, - public GlobalRadiantModuleRef -{ - ImageModuleRef m_bitmapModule; -public: - ShadersDependencies() : - m_bitmapModule("bmp") +// ============================================================================= +// SYNAPSE + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientShaders g_SynapseClient; + +static const XMLConfigEntry_t entries[] = + { + { SHADERS_MAJOR, SYN_PROVIDE, sizeof(_QERShadersTable), NULL }, + { VFS_MAJOR, SYN_REQUIRE, sizeof(g_VFSTable), &g_VFSTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - ImageModuleRef& getBitmapModule() - { - return m_bitmapModule; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) { + return NULL; } -}; + + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_DataTable); + g_SynapseClient.AddAPI(QGL_MAJOR, NULL, sizeof(_QERQglTable), SYN_REQUIRE, &g_QglTable); + g_SynapseClient.AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(_QERScripLibTable), SYN_REQUIRE, &g_ScripLibTable); + g_SynapseClient.AddAPI(BRUSH_MAJOR, NULL, sizeof(_QERBrushTable), SYN_REQUIRE, &g_BrushTable); -class ShadersQ3API -{ - ShaderSystem* m_shadersq3; -public: - typedef ShaderSystem Type; - STRING_CONSTANT(Name, "quake3"); - - ShadersQ3API(ShadersDependencies& dependencies) - { - g_shadersExtension = "shader"; - g_shadersDirectory = "scripts/"; - g_bitmapModule = dependencies.getBitmapModule().getTable(); - Shaders_Construct(); - m_shadersq3 = &GetShaderSystem(); - } - ~ShadersQ3API() - { - Shaders_Destroy(); - } - ShaderSystem* getTable() - { - return m_shadersq3; - } -}; - -typedef SingletonModule > ShadersQ3Module; - -ShadersQ3Module g_ShadersQ3Module; - - -class ShadersDoom3API -{ - ShaderSystem* m_shadersdoom3; -public: - typedef ShaderSystem Type; - STRING_CONSTANT(Name, "doom3"); - - ShadersDoom3API(ShadersDependencies& dependencies) - { - g_shadersExtension = "mtr"; - g_shadersDirectory = "materials/"; - g_enableDefaultShaders = false; - g_shaderLanguage = SHADERLANGUAGE_DOOM3; - g_useShaderList = false; - g_bitmapModule = dependencies.getBitmapModule().getTable(); - Shaders_Construct(); - m_shadersdoom3 = &GetShaderSystem(); - } - ~ShadersDoom3API() - { - Shaders_Destroy(); - } - ShaderSystem* getTable() - { - return m_shadersdoom3; - } -}; - -typedef SingletonModule > ShadersDoom3Module; - -ShadersDoom3Module g_ShadersDoom3Module; - - -class ShadersQuake4API -{ - ShaderSystem* m_shadersquake4; -public: - typedef ShaderSystem Type; - STRING_CONSTANT(Name, "quake4"); - - ShadersQuake4API(ShadersDependencies& dependencies) - { - g_shadersExtension = "mtr"; - g_shadersDirectory = "materials/"; - g_enableDefaultShaders = false; - g_shaderLanguage = SHADERLANGUAGE_QUAKE4; - g_useShaderList = false; - g_bitmapModule = dependencies.getBitmapModule().getTable(); - Shaders_Construct(); - m_shadersquake4 = &GetShaderSystem(); - } - ~ShadersQuake4API() - { - Shaders_Destroy(); - } - ShaderSystem* getTable() - { - return m_shadersquake4; - } -}; - -typedef SingletonModule > ShadersQuake4Module; - -ShadersQuake4Module g_ShadersQuake4Module; - - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ShadersQ3Module.selfRegister(); - g_ShadersDoom3Module.selfRegister(); - g_ShadersQuake4Module.selfRegister(); + return &g_SynapseClient; +} + +#include "version.h" + +const char* CSynapseClientShaders::GetInfo() +{ + return "Q3/Half-Life shaders module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientShaders::GetName() +{ + return "shaders"; } diff --git a/plugins/shaders/plugin.h b/plugins/shaders/plugin.h index 2f28d852..509e5e43 100644 --- a/plugins/shaders/plugin.h +++ b/plugins/shaders/plugin.h @@ -1,25 +1,69 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ +#include "synapse.h" +#include "qerplugin.h" +#include "missing.h" +#include "igl.h" +#include "ishaders.h" +#include "idata.h" +#include "ifilesystem.h" +#include "iscriplib.h" +#define USE_BRUSHTABLE_DEFINE +#include "ibrush.h" -#endif +extern _QERFuncTable_1 g_FuncTable; +extern _QERAppDataTable g_DataTable; +extern _QERQglTable g_QglTable; +extern _QERAppShadersTable g_ShadersTable; +extern _QERFileSystemTable g_VFSTable; +extern _QERScripLibTable g_ScripLibTable; +extern _QERBrushTable g_BrushTable; + +#define vfsGetFileCount g_VFSTable.m_pfnGetFileCount +#define vfsLoadFile g_VFSTable.m_pfnLoadFile +#define vfsFreeFile g_VFSTable.m_pfnFreeFile +#define Sys_Printf g_FuncTable.m_pfnSysPrintf + +class CSynapseClientShaders : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientShaders() { } + virtual ~CSynapseClientShaders() { } +}; + +#endif // _PLUGIN_H_ diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index e95adaff..c4213b87 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -34,2041 +34,956 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "shaders.h" - +// standard headers #include #include -#include -#include +#include "plugin.h" +#include "mathlib.h" +#include "missing.h" //++timo FIXME: this one is intended to go away some day, it's MFC compatibility classes +#include "shaders.h" -#include "ifilesystem.h" -#include "ishaders.h" -#include "iscriplib.h" -#include "itextures.h" -#include "qerplugin.h" -#include "irender.h" +// some forward declarations +IShader *WINAPI QERApp_Shader_ForName (const char *name); +qtexture_t *WINAPI QERApp_Try_Texture_ForName (const char *name); +qtexture_t *WINAPI QERApp_Texture_ForName2 (const char *filename); +IShader *WINAPI QERApp_ColorShader_ForName (const char *name); +void WINAPI QERApp_LoadShaderFile (const char *filename); -#include - -#include "debugging/debugging.h" -#include "string/pooledstring.h" -#include "math/vector.h" -#include "generic/callback.h" -#include "generic/referencecounted.h" -#include "stream/memstream.h" -#include "stream/stringstream.h" -#include "stream/textfilestream.h" -#include "os/path.h" -#include "os/dir.h" -#include "os/file.h" -#include "stringio.h" -#include "shaderlib.h" -#include "texturelib.h" -#include "cmdlib.h" -#include "moduleobservers.h" -#include "archivelib.h" -#include "imagelib.h" - -const char* g_shadersExtension = ""; -const char* g_shadersDirectory = ""; -bool g_enableDefaultShaders = true; -ShaderLanguage g_shaderLanguage = SHADERLANGUAGE_QUAKE3; -bool g_useShaderList = true; -_QERPlugImageTable* g_bitmapModule = 0; -const char* g_texturePrefix = "textures/"; - -void ActiveShaders_IteratorBegin(); -bool ActiveShaders_IteratorAtEnd(); -IShader *ActiveShaders_IteratorCurrent(); -void ActiveShaders_IteratorIncrement(); -Callback g_ActiveShadersChangedNotify; - -void FreeShaders(); -void LoadShaderFile (const char *filename); -qtexture_t *Texture_ForName (const char *filename); - - -/*! -NOTE TTimo: there is an important distinction between SHADER_NOT_FOUND and SHADER_NOTEX: -SHADER_NOT_FOUND means we didn't find the raw texture or the shader for this -SHADER_NOTEX means we recognize this as a shader script, but we are missing the texture to represent it -this was in the initial design of the shader code since early GtkRadiant alpha, and got sort of foxed in 1.2 and put back in -*/ - -Image* loadBitmap(void* environment, const char* name) -{ - DirectoryArchiveFile file(name, name); - if(!file.failed()) - { - return g_bitmapModule->loadImage(file); - } - return 0; -} - -inline byte* getPixel(byte* pixels, int width, int height, int x, int y) -{ - return pixels + (((((y + height) % height) * width) + ((x + width) % width)) * 4); -} - -class KernelElement -{ -public: - int x, y; - float w; -}; - -Image& convertHeightmapToNormalmap(Image& heightmap, float scale) -{ - int w = heightmap.getWidth(); - int h = heightmap.getHeight(); - - Image& normalmap = *(new RGBAImage(heightmap.getWidth(), heightmap.getHeight())); - - byte* in = heightmap.getRGBAPixels(); - byte* out = normalmap.getRGBAPixels(); - -#if 1 - // no filtering - const int kernelSize = 2; - KernelElement kernel_du[kernelSize] = { - {-1, 0,-0.5f }, - { 1, 0, 0.5f } - }; - KernelElement kernel_dv[kernelSize] = { - { 0, 1, 0.5f }, - { 0,-1,-0.5f } - }; -#else - // 3x3 Prewitt - const int kernelSize = 6; - KernelElement kernel_du[kernelSize] = { - {-1, 1,-1.0f }, - {-1, 0,-1.0f }, - {-1,-1,-1.0f }, - { 1, 1, 1.0f }, - { 1, 0, 1.0f }, - { 1,-1, 1.0f } - }; - KernelElement kernel_dv[kernelSize] = { - {-1, 1, 1.0f }, - { 0, 1, 1.0f }, - { 1, 1, 1.0f }, - {-1,-1,-1.0f }, - { 0,-1,-1.0f }, - { 1,-1,-1.0f } - }; -#endif - - int x, y = 0; - while( y < h ) - { - x = 0; - while( x < w ) - { - float du = 0; - for(KernelElement* i = kernel_du; i != kernel_du + kernelSize; ++i) - { - du += (getPixel(in, w, h, x + (*i).x, y + (*i).y)[0] / 255.0) * (*i).w; - } - float dv = 0; - for(KernelElement* i = kernel_dv; i != kernel_dv + kernelSize; ++i) - { - dv += (getPixel(in, w, h, x + (*i).x, y + (*i).y)[0] / 255.0) * (*i).w; - } - - float nx = -du * scale; - float ny = -dv * scale; - float nz = 1.0; - - // Normalize - float norm = 1.0/sqrt(nx*nx + ny*ny + nz*nz); - out[0] = float_to_integer(((nx * norm) + 1) * 127.5); - out[1] = float_to_integer(((ny * norm) + 1) * 127.5); - out[2] = float_to_integer(((nz * norm) + 1) * 127.5); - out[3] = 255; - - x++; - out += 4; - } - - y++; - } - - return normalmap; -} - -Image* loadHeightmap(void* environment, const char* name) -{ - Image* heightmap = GlobalTexturesCache().loadImage(name); - if(heightmap != 0) - { - Image& normalmap = convertHeightmapToNormalmap(*heightmap, *reinterpret_cast(environment)); - heightmap->release(); - return &normalmap; - } - return 0; -} - - -Image* loadSpecial(void* environment, const char* name) -{ - if(*name == '_') // special image - { - StringOutputStream bitmapName(256); - bitmapName << GlobalRadiant().getAppPath() << "bitmaps/" << name + 1 << ".bmp"; - Image* image = loadBitmap(environment, bitmapName.c_str()); - if(image != 0) - { - return image; - } - } - return GlobalTexturesCache().loadImage(name); -} - -class ShaderPoolContext -{ -}; -typedef Static ShaderPool; -typedef PooledString ShaderString; -typedef ShaderString ShaderVariable; -typedef ShaderString ShaderValue; -typedef CopiedString TextureExpression; +//++timo TODO: use stl::map !! (I tried having a look to CMap but it obviously sucks) +CShaderArray g_Shaders; +// whenever a shader gets activated / deactivated this list is updated +// NOTE: make sure you don't add a shader that's already in +// NOTE: all shaders in this array are in the main g_Shaders +CShaderArray g_ActiveShaders; // clean a texture name to the qtexture_t name format we use internally +// NOTE: there are so many cases .. this may need to get updated to cover all of them +// we expect a "textures/" path on top, except if bAddTexture is set to true .. in case we add in needed // NOTE: case sensitivity: the engine is case sensitive. we store the shader name with case information and save with case // information as well. but we assume there won't be any case conflict and so when doing lookups based on shader name, // we compare as case insensitive. That is Radiant is case insensitive, but knows that the engine is case sensitive. //++timo FIXME: we need to put code somewhere to detect when two shaders that are case insensitive equal are present -template -void parseTextureName(StringType& name, const char* token) +const char *WINAPI QERApp_CleanTextureName (const char *name, bool bAddTexture = false) { - StringOutputStream cleaned(256); - cleaned << PathCleaned(token); - name = CopiedString(StringRange(cleaned.c_str(), path_get_filename_base_end(cleaned.c_str()))).c_str(); // remove extension -} - -bool Tokeniser_parseTextureName(Tokeniser& tokeniser, TextureExpression& name) -{ - const char* token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#texture-name"); - return false; - } - parseTextureName(name, token); - return true; -} - -bool Tokeniser_parseShaderName(Tokeniser& tokeniser, CopiedString& name) -{ - const char* token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#shader-name"); - return false; - } - parseTextureName(name, token); - return true; -} - -bool Tokeniser_parseString(Tokeniser& tokeniser, ShaderString& string) -{ - const char* token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#string"); - return false; - } - string = token; - return true; -} - - - -typedef std::list ShaderParameters; -typedef std::list ShaderArguments; - -typedef std::pair BlendFuncExpression; - -class ShaderTemplate -{ - std::size_t m_refcount; - CopiedString m_Name; -public: - - ShaderParameters m_params; - - TextureExpression m_textureName; - TextureExpression m_diffuse; - TextureExpression m_bump; - ShaderValue m_heightmapScale; - TextureExpression m_specular; - TextureExpression m_lightFalloffImage; - - int m_nFlags; - float m_fTrans; - - // alphafunc stuff - IShader::EAlphaFunc m_AlphaFunc; - float m_AlphaRef; - // cull stuff - IShader::ECull m_Cull; - - ShaderTemplate() : - m_refcount(0) - { - m_nFlags = 0; - m_fTrans = 1.0f; - } - - void IncRef() - { - ++m_refcount; - } - void DecRef() - { - ASSERT_MESSAGE(m_refcount != 0, "shader reference-count going below zero"); - if(--m_refcount == 0) - { - delete this; - } - } - - std::size_t refcount() - { - return m_refcount; - } - - const char* getName() const - { - return m_Name.c_str(); - } - void setName(const char* name) - { - m_Name = name; - } - - // ----------------------------------------- - - bool parseDoom3(Tokeniser& tokeniser); - bool parseQuake3(Tokeniser& tokeniser); - bool parseTemplate(Tokeniser& tokeniser); - - - void CreateDefault(const char *name) - { - if(g_enableDefaultShaders) - { - m_textureName = name; - } - else - { - m_textureName = ""; - } - setName(name); - } - - - class MapLayerTemplate - { - TextureExpression m_texture; - BlendFuncExpression m_blendFunc; - bool m_clampToBorder; - ShaderValue m_alphaTest; - public: - MapLayerTemplate(const TextureExpression& texture, const BlendFuncExpression& blendFunc, bool clampToBorder, const ShaderValue& alphaTest) : - m_texture(texture), - m_blendFunc(blendFunc), - m_clampToBorder(false), - m_alphaTest(alphaTest) - { - } - const TextureExpression& texture() const - { - return m_texture; - } - const BlendFuncExpression& blendFunc() const - { - return m_blendFunc; - } - bool clampToBorder() const - { - return m_clampToBorder; - } - const ShaderValue& alphaTest() const - { - return m_alphaTest; - } - }; - typedef std::vector MapLayers; - MapLayers m_layers; -}; - - -bool Doom3Shader_parseHeightmap(Tokeniser& tokeniser, TextureExpression& bump, ShaderValue& heightmapScale) -{ - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, bump)); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ",")); - RETURN_FALSE_IF_FAIL(Tokeniser_parseString(tokeniser, heightmapScale)); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - return true; -} - -bool Doom3Shader_parseAddnormals(Tokeniser& tokeniser, TextureExpression& bump) -{ - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, bump)); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ",")); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "heightmap")); - TextureExpression heightmapName; - ShaderValue heightmapScale; - RETURN_FALSE_IF_FAIL(Doom3Shader_parseHeightmap(tokeniser, heightmapName, heightmapScale)); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - return true; -} - -bool Doom3Shader_parseBumpmap(Tokeniser& tokeniser, TextureExpression& bump, ShaderValue& heightmapScale) -{ - const char* token = tokeniser.getToken(); - if(token == 0) - { - Tokeniser_unexpectedError(tokeniser, token, "#bumpmap"); - return false; - } - if(string_equal(token, "heightmap")) - { - RETURN_FALSE_IF_FAIL(Doom3Shader_parseHeightmap(tokeniser, bump, heightmapScale)); - } - else if(string_equal(token, "addnormals")) - { - RETURN_FALSE_IF_FAIL(Doom3Shader_parseAddnormals(tokeniser, bump)); - } - else - { - parseTextureName(bump, token); - } - return true; -} - -enum LayerTypeId -{ - LAYER_NONE, - LAYER_BLEND, - LAYER_DIFFUSEMAP, - LAYER_BUMPMAP, - LAYER_SPECULARMAP -}; - -class LayerTemplate -{ -public: - LayerTypeId m_type; - TextureExpression m_texture; - BlendFuncExpression m_blendFunc; - bool m_clampToBorder; - ShaderValue m_alphaTest; - ShaderValue m_heightmapScale; - - LayerTemplate() : m_type(LAYER_NONE), m_blendFunc("GL_ONE", "GL_ZERO"), m_clampToBorder(false), m_alphaTest("-1"), m_heightmapScale("0") - { - } -}; - -bool parseShaderParameters(Tokeniser& tokeniser, ShaderParameters& params) -{ - Tokeniser_parseToken(tokeniser, "("); - for(;;) - { - const char* param = tokeniser.getToken(); - if(string_equal(param, ")")) - { - break; - } - params.push_back(param); - const char* comma = tokeniser.getToken(); - if(string_equal(comma, ")")) - { - break; - } - if(!string_equal(comma, ",")) - { - Tokeniser_unexpectedError(tokeniser, comma, ","); - return false; - } - } - return true; -} - -bool ShaderTemplate::parseTemplate(Tokeniser& tokeniser) -{ - m_Name = tokeniser.getToken(); - if(!parseShaderParameters(tokeniser, m_params)) - { - globalErrorStream() << "shader template: " << makeQuoted(m_Name.c_str()) << ": parameter parse failed\n"; - return false; - } - - return parseDoom3(tokeniser); -} - -bool ShaderTemplate::parseDoom3(Tokeniser& tokeniser) -{ - LayerTemplate currentLayer; - bool isFog = false; - - // we need to read until we hit a balanced } - int depth = 0; - for(;;) - { - tokeniser.nextLine(); - const char* token = tokeniser.getToken(); - - if(token == 0) - return false; - - if(string_equal(token, "{")) - { - ++depth; - continue; - } - else if(string_equal(token, "}")) - { - --depth; - if(depth < 0) // error - { - return false; - } - if(depth == 0) // end of shader - { - break; - } - if(depth == 1) // end of layer - { - if(currentLayer.m_type == LAYER_DIFFUSEMAP) - { - m_diffuse = currentLayer.m_texture; - } - else if(currentLayer.m_type == LAYER_BUMPMAP) - { - m_bump = currentLayer.m_texture; - } - else if(currentLayer.m_type == LAYER_SPECULARMAP) - { - m_specular = currentLayer.m_texture; - } - else if(!string_empty(currentLayer.m_texture.c_str())) - { - m_layers.push_back(MapLayerTemplate( - currentLayer.m_texture.c_str(), - currentLayer.m_blendFunc, - currentLayer.m_clampToBorder, - currentLayer.m_alphaTest - )); - } - currentLayer.m_type = LAYER_NONE; - currentLayer.m_texture = ""; - } - continue; - } - - if(depth == 2) // in layer - { - if(string_equal_nocase(token, "blend")) - { - const char* blend = tokeniser.getToken(); - - if(blend == 0) - { - Tokeniser_unexpectedError(tokeniser, blend, "#blend"); - return false; - } - - if(string_equal_nocase(blend, "diffusemap")) - { - currentLayer.m_type = LAYER_DIFFUSEMAP; - } - else if(string_equal_nocase(blend, "bumpmap")) - { - currentLayer.m_type = LAYER_BUMPMAP; - } - else if(string_equal_nocase(blend, "specularmap")) - { - currentLayer.m_type = LAYER_SPECULARMAP; - } - else - { - currentLayer.m_blendFunc.first = blend; - - const char* comma = tokeniser.getToken(); - - if(comma == 0) - { - Tokeniser_unexpectedError(tokeniser, comma, "#comma"); - return false; - } - - if(string_equal(comma, ",")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseString(tokeniser, currentLayer.m_blendFunc.second)); - } - else - { - currentLayer.m_blendFunc.second = ""; - tokeniser.ungetToken(); - } - } - } - else if(string_equal_nocase(token, "map")) - { - if(currentLayer.m_type == LAYER_BUMPMAP) - { - RETURN_FALSE_IF_FAIL(Doom3Shader_parseBumpmap(tokeniser, currentLayer.m_texture, currentLayer.m_heightmapScale)); - } - else - { - const char* map = tokeniser.getToken(); - - if(map == 0) - { - Tokeniser_unexpectedError(tokeniser, map, "#map"); - return false; - } - - if(string_equal(map, "makealpha")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - const char* texture = tokeniser.getToken(); - if(texture == 0) - { - Tokeniser_unexpectedError(tokeniser, texture, "#texture"); - return false; - } - currentLayer.m_texture = texture; - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - } - else - { - parseTextureName(currentLayer.m_texture, map); - } - } - } - else if(string_equal_nocase(token, "zeroclamp")) - { - currentLayer.m_clampToBorder = true; - } -#if 0 - else if(string_equal_nocase(token, "alphaTest")) - { - Tokeniser_getFloat(tokeniser, currentLayer.m_alphaTest); - } + static char stdName[QER_MAX_NAMELEN]; +#ifdef _DEBUG + if (strlen(name)>QER_MAX_NAMELEN) + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, "WARNING: name exceeds QER_MAX_NAMELEN in CleanTextureName\n"); #endif - } - else if(depth == 1) + + strcpy (stdName, name); + g_FuncTable.m_pfnQE_ConvertDOSToUnixName (stdName, stdName); + if (stdName[strlen (name) - 4] == '.') + // strip extension + stdName[strlen (stdName) - 4] = '\0'; + + if (bAddTexture) + { + char aux[QER_MAX_NAMELEN]; + sprintf (aux, "textures/%s", stdName); + strcpy (stdName, aux); + } + return stdName; +} + +int WINAPI QERApp_GetActiveShaderCount () +{ + return g_ActiveShaders.GetSize (); +} + +IShader *WINAPI QERApp_ActiveShader_ForIndex (int i) +{ + return static_cast < CShader * >(g_ActiveShaders.GetAt (i)); +} + +void CShaderArray::SortShaders () +{ + CPtrArray aux; + int i, icount; + int j, jcount; + CShader *pSort; + const char *sSort; + // dumb sort .. would it ever grow big enough so we would have to do something clever? noooo + icount = CPtrArray::GetSize (); + for (i = 0; i < icount; i++) + { + pSort = static_cast < CShader * >(GetAt (i)); + sSort = pSort->getName (); + jcount = aux.GetSize (); + for (j = 0; j < jcount; j++) { - if(string_equal_nocase(token, "qer_editorimage")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, m_textureName)); - } - else if (string_equal_nocase(token, "qer_trans")) - { - m_fTrans = string_read_float(tokeniser.getToken()); - m_nFlags |= QER_TRANS; - } - else if (string_equal_nocase(token, "translucent")) - { - m_fTrans = 1; - m_nFlags |= QER_TRANS; - } - else if (string_equal(token, "DECAL_MACRO")) - { - m_fTrans = 1; - m_nFlags |= QER_TRANS; - } - else if (string_equal_nocase(token, "bumpmap")) - { - RETURN_FALSE_IF_FAIL(Doom3Shader_parseBumpmap(tokeniser, m_bump, m_heightmapScale)); - } - else if (string_equal_nocase(token, "diffusemap")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, m_diffuse)); - } - else if (string_equal_nocase(token, "specularmap")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, m_specular)); - } - else if (string_equal_nocase(token, "twosided")) - { - m_Cull = IShader::eCullNone; - m_nFlags |= QER_CULL; - } - else if (string_equal_nocase(token, "nodraw")) - { - m_nFlags |= QER_NODRAW; - } - else if (string_equal_nocase(token, "nonsolid")) - { - m_nFlags |= QER_NONSOLID; - } - else if (string_equal_nocase(token, "liquid")) - { - m_nFlags |= QER_WATER; - } - else if (string_equal_nocase(token, "areaportal")) - { - m_nFlags |= QER_AREAPORTAL; - } - else if (string_equal_nocase(token, "playerclip") - || string_equal_nocase(token, "monsterclip") - || string_equal_nocase(token, "ikclip") - || string_equal_nocase(token, "moveableclip")) - { - m_nFlags |= QER_CLIP; - } - if (string_equal_nocase(token, "fogLight")) - { - isFog = true; - } - else if (!isFog && string_equal_nocase(token, "lightFalloffImage")) - { - const char* lightFalloffImage = tokeniser.getToken(); - if(lightFalloffImage == 0) - { - Tokeniser_unexpectedError(tokeniser, lightFalloffImage, "#lightFalloffImage"); - return false; - } - if(string_equal_nocase(lightFalloffImage, "makeintensity")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - TextureExpression name; - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, name)); - m_lightFalloffImage = name; - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - } - else - { - m_lightFalloffImage = lightFalloffImage; - } - } - } - } - - if(string_empty(m_textureName.c_str())) - { - m_textureName = m_diffuse; - } - - return true; -} - -typedef SmartPointer ShaderTemplatePointer; -typedef std::map ShaderTemplateMap; - -ShaderTemplateMap g_shaders; -ShaderTemplateMap g_shaderTemplates; - -ShaderTemplate* findTemplate(const char* name) -{ - ShaderTemplateMap::iterator i = g_shaderTemplates.find(name); - if(i != g_shaderTemplates.end()) - { - return (*i).second.get(); - } - return 0; -} - -class ShaderDefinition -{ -public: - ShaderDefinition(ShaderTemplate* shaderTemplate, const ShaderArguments& args, const char* filename) - : shaderTemplate(shaderTemplate), args(args), filename(filename) - { - } - ShaderTemplate* shaderTemplate; - ShaderArguments args; - const char* filename; -}; - -typedef std::map ShaderDefinitionMap; - -ShaderDefinitionMap g_shaderDefinitions; - -bool parseTemplateInstance(Tokeniser& tokeniser, const char* filename) -{ - CopiedString name; - RETURN_FALSE_IF_FAIL(Tokeniser_parseShaderName(tokeniser, name)); - const char* templateName = tokeniser.getToken(); - ShaderTemplate* shaderTemplate = findTemplate(templateName); - if(shaderTemplate == 0) - { - globalErrorStream() << "shader instance: " << makeQuoted(name.c_str()) << ": shader template not found: " << makeQuoted(templateName) << "\n"; - } - - ShaderArguments args; - if(!parseShaderParameters(tokeniser, args)) - { - globalErrorStream() << "shader instance: " << makeQuoted(name.c_str()) << ": argument parse failed\n"; - return false; - } - - if(shaderTemplate != 0) - { - if(!g_shaderDefinitions.insert(ShaderDefinitionMap::value_type(name, ShaderDefinition(shaderTemplate, args, filename))).second) - { - globalErrorStream() << "shader instance: " << makeQuoted(name.c_str()) << ": already exists, second definition ignored\n"; - } - } - return true; -} - - -const char* evaluateShaderValue(const char* value, const ShaderParameters& params, const ShaderArguments& args) -{ - ShaderArguments::const_iterator j = args.begin(); - for(ShaderParameters::const_iterator i = params.begin(); i != params.end(); ++i, ++j) - { - const char* other = (*i).c_str(); - if(string_equal(value, other)) - { - return (*j).c_str(); - } - } - return value; -} - -///\todo BlendFunc parsing -BlendFunc evaluateBlendFunc(const BlendFuncExpression& blendFunc, const ShaderParameters& params, const ShaderArguments& args) -{ - return BlendFunc(BLEND_ONE, BLEND_ZERO); -} - -qtexture_t* evaluateTexture(const TextureExpression& texture, const ShaderParameters& params, const ShaderArguments& args, const LoadImageCallback& loader = GlobalTexturesCache().defaultLoader()) -{ - StringOutputStream result(64); - const char* expression = texture.c_str(); - const char* end = expression + string_length(expression); - if(!string_empty(expression)) - { - for(;;) - { - const char* best = end; - const char* bestParam = 0; - const char* bestArg = 0; - ShaderArguments::const_iterator j = args.begin(); - for(ShaderParameters::const_iterator i = params.begin(); i != params.end(); ++i, ++j) - { - const char* found = strstr(expression, (*i).c_str()); - if(found != 0 && found < best) - { - best = found; - bestParam = (*i).c_str(); - bestArg = (*j).c_str(); - } - } - if(best != end) - { - result << StringRange(expression, best); - result << PathCleaned(bestArg); - expression = best + string_length(bestParam); - } - else - { + if (strcmp (sSort, static_cast < CShader * >(aux.GetAt (j))->getName ()) < 0) break; - } } - result << expression; + aux.InsertAt (j, pSort); } - return GlobalTexturesCache().capture(loader, result.c_str()); + CPtrArray::RemoveAll (); + CPtrArray::InsertAt (0, &aux); } -float evaluateFloat(const ShaderValue& value, const ShaderParameters& params, const ShaderArguments& args) +// will sort the active shaders list by name +// NOTE: it would be easier if the thing would stay sorted by using a map thing +//++timo FIXME: would need to export that to allow external override? +void WINAPI QERApp_SortActiveShaders () { - const char* result = evaluateShaderValue(value.c_str(), params, args); - float f; - if(!string_parse_float(result, f)) - { - globalErrorStream() << "parsing float value failed: " << makeQuoted(result) << "\n"; - } - return f; + g_ActiveShaders.SortShaders (); } -BlendFactor evaluateBlendFactor(const ShaderValue& value, const ShaderParameters& params, const ShaderArguments& args) +// NOTE: case sensitivity +// although we store shader names with case information, Radiant does case insensitive searches +// (we assume there's no case conflict with the names) +CShader *CShaderArray::Shader_ForName (const char *name) const { - const char* result = evaluateShaderValue(value.c_str(), params, args); - - if(string_equal_nocase(result, "gl_zero")) + int i; + for (i = 0; i < CPtrArray::GetSize (); i++) { - return BLEND_ZERO; + CShader *pShader = static_cast < CShader * >(CPtrArray::GetAt (i)); + if (stricmp (pShader->getName (), name) == 0) + return pShader; } - if(string_equal_nocase(result, "gl_one")) - { - return BLEND_ONE; - } - if(string_equal_nocase(result, "gl_src_color")) - { - return BLEND_SRC_COLOUR; - } - if(string_equal_nocase(result, "gl_one_minus_src_color")) - { - return BLEND_ONE_MINUS_SRC_COLOUR; - } - if(string_equal_nocase(result, "gl_src_alpha")) - { - return BLEND_SRC_ALPHA; - } - if(string_equal_nocase(result, "gl_one_minus_src_alpha")) - { - return BLEND_ONE_MINUS_SRC_ALPHA; - } - if(string_equal_nocase(result, "gl_dst_color")) - { - return BLEND_DST_COLOUR; - } - if(string_equal_nocase(result, "gl_one_minus_dst_color")) - { - return BLEND_ONE_MINUS_DST_COLOUR; - } - if(string_equal_nocase(result, "gl_dst_alpha")) - { - return BLEND_DST_ALPHA; - } - if(string_equal_nocase(result, "gl_one_minus_dst_alpha")) - { - return BLEND_ONE_MINUS_DST_ALPHA; - } - if(string_equal_nocase(result, "gl_src_alpha_saturate")) - { - return BLEND_SRC_ALPHA_SATURATE; - } - - globalErrorStream() << "parsing blend-factor value failed: " << makeQuoted(result) << "\n"; - return BLEND_ZERO; + return NULL; } -class CShader : public IShader +void CShader::CreateDefault (const char *name) { - std::size_t m_refcount; - - const ShaderTemplate& m_template; - const ShaderArguments& m_args; - const char* m_filename; - // name is shader-name, otherwise texture-name (if not a real shader) - CopiedString m_Name; - - qtexture_t* m_pTexture; - qtexture_t* m_notfound; - qtexture_t* m_pDiffuse; - float m_heightmapScale; - qtexture_t* m_pBump; - qtexture_t* m_pSpecular; - qtexture_t* m_pLightFalloffImage; - BlendFunc m_blendFunc; - - bool m_bInUse; - - -public: - static bool m_lightingEnabled; - - CShader(const ShaderDefinition& definition) : - m_refcount(0), - m_template(*definition.shaderTemplate), - m_args(definition.args), - m_filename(definition.filename), - m_blendFunc(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA), - m_bInUse(false) - { - m_pTexture = 0; - m_pDiffuse = 0; - m_pBump = 0; - m_pSpecular = 0; - - m_notfound = 0; - - realise(); - } - virtual ~CShader() - { - unrealise(); - - ASSERT_MESSAGE(m_refcount == 0, "deleting active shader"); - } - - // IShaders implementation ----------------- - void IncRef() - { - ++m_refcount; - } - void DecRef() - { - ASSERT_MESSAGE(m_refcount != 0, "shader reference-count going below zero"); - if(--m_refcount == 0) - { - delete this; - } - } - - std::size_t refcount() - { - return m_refcount; - } - - // get/set the qtexture_t* Radiant uses to represent this shader object - qtexture_t* getTexture() const - { - return m_pTexture; - } - qtexture_t* getDiffuse() const - { - return m_pDiffuse; - } - qtexture_t* getBump() const - { - return m_pBump; - } - qtexture_t* getSpecular() const - { - return m_pSpecular; - } - // get shader name - const char* getName() const - { - return m_Name.c_str(); - } - bool IsInUse() const - { - return m_bInUse; - } - void SetInUse(bool bInUse) - { - m_bInUse = bInUse; - g_ActiveShadersChangedNotify(); - } - // get the shader flags - int getFlags() const - { - return m_template.m_nFlags; - } - // get the transparency value - float getTrans() const - { - return m_template.m_fTrans; - } - // test if it's a true shader, or a default shader created to wrap around a texture - bool IsDefault() const - { - return string_empty(m_filename); - } - // get the alphaFunc - void getAlphaFunc(EAlphaFunc *func, float *ref) { *func = m_template.m_AlphaFunc; *ref = m_template.m_AlphaRef; }; - BlendFunc getBlendFunc() const - { - return m_blendFunc; - } - // get the cull type - ECull getCull() - { - return m_template.m_Cull; - }; - // get shader file name (ie the file where this one is defined) - const char* getShaderFileName() const - { - return m_filename; - } - // ----------------------------------------- - - void realise() - { - m_pTexture = evaluateTexture(m_template.m_textureName, m_template.m_params, m_args); - - if(m_pTexture->texture_number == 0) - { - m_notfound = m_pTexture; - - { - StringOutputStream name(256); - name << GlobalRadiant().getAppPath() << "bitmaps/" << (IsDefault() ? "notex.bmp" : "shadernotex.bmp"); - m_pTexture = GlobalTexturesCache().capture(LoadImageCallback(0, loadBitmap), name.c_str()); - } - } - - realiseLighting(); - } - - void unrealise() - { - GlobalTexturesCache().release(m_pTexture); - - if(m_notfound != 0) - { - GlobalTexturesCache().release(m_notfound); - } - - unrealiseLighting(); - } - - void realiseLighting() - { - if(m_lightingEnabled) - { - LoadImageCallback loader = GlobalTexturesCache().defaultLoader(); - if(!string_empty(m_template.m_heightmapScale.c_str())) - { - m_heightmapScale = evaluateFloat(m_template.m_heightmapScale, m_template.m_params, m_args); - loader = LoadImageCallback(&m_heightmapScale, loadHeightmap); - } - m_pDiffuse = evaluateTexture(m_template.m_diffuse, m_template.m_params, m_args); - m_pBump = evaluateTexture(m_template.m_bump, m_template.m_params, m_args, loader); - m_pSpecular = evaluateTexture(m_template.m_specular, m_template.m_params, m_args); - m_pLightFalloffImage = evaluateTexture(m_template.m_lightFalloffImage, m_template.m_params, m_args); - - for(ShaderTemplate::MapLayers::const_iterator i = m_template.m_layers.begin(); i != m_template.m_layers.end(); ++i) - { - m_layers.push_back(evaluateLayer(*i, m_template.m_params, m_args)); - } - - if(m_layers.size() == 1) - { - const BlendFuncExpression& blendFunc = m_template.m_layers.front().blendFunc(); - if(!string_empty(blendFunc.second.c_str())) - { - m_blendFunc = BlendFunc( - evaluateBlendFactor(blendFunc.first.c_str(), m_template.m_params, m_args), - evaluateBlendFactor(blendFunc.second.c_str(), m_template.m_params, m_args) - ); - } - else - { - const char* blend = evaluateShaderValue(blendFunc.first.c_str(), m_template.m_params, m_args); - - if(string_equal_nocase(blend, "add")) - { - m_blendFunc = BlendFunc(BLEND_ONE, BLEND_ONE); - } - else if(string_equal_nocase(blend, "filter")) - { - m_blendFunc = BlendFunc(BLEND_DST_COLOUR, BLEND_ZERO); - } - else if(string_equal_nocase(blend, "blend")) - { - m_blendFunc = BlendFunc(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - } - else - { - globalErrorStream() << "parsing blend value failed: " << makeQuoted(blend) << "\n"; - } - } - } - } - } - - void unrealiseLighting() - { - if(m_lightingEnabled) - { - GlobalTexturesCache().release(m_pDiffuse); - GlobalTexturesCache().release(m_pBump); - GlobalTexturesCache().release(m_pSpecular); - - GlobalTexturesCache().release(m_pLightFalloffImage); - - for(MapLayers::iterator i = m_layers.begin(); i != m_layers.end(); ++i) - { - GlobalTexturesCache().release((*i).texture()); - } - m_layers.clear(); - - m_blendFunc = BlendFunc(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - } - } - - // set shader name - void setName(const char* name) - { - m_Name = name; - } - - class MapLayer : public ShaderLayer - { - qtexture_t* m_texture; - BlendFunc m_blendFunc; - bool m_clampToBorder; - float m_alphaTest; - public: - MapLayer(qtexture_t* texture, BlendFunc blendFunc, bool clampToBorder, float alphaTest) : - m_texture(texture), - m_blendFunc(blendFunc), - m_clampToBorder(false), - m_alphaTest(alphaTest) - { - } - qtexture_t* texture() const - { - return m_texture; - } - BlendFunc blendFunc() const - { - return m_blendFunc; - } - bool clampToBorder() const - { - return m_clampToBorder; - } - float alphaTest() const - { - return m_alphaTest; - } - }; - - static MapLayer evaluateLayer(const ShaderTemplate::MapLayerTemplate& layerTemplate, const ShaderParameters& params, const ShaderArguments& args) - { - return MapLayer( - evaluateTexture(layerTemplate.texture(), params, args), - evaluateBlendFunc(layerTemplate.blendFunc(), params, args), - layerTemplate.clampToBorder(), - evaluateFloat(layerTemplate.alphaTest(), params, args) - ); - } - - typedef std::vector MapLayers; - MapLayers m_layers; - - const ShaderLayer* firstLayer() const - { - if(m_layers.empty()) - { - return 0; - } - return &m_layers.front(); - } - void forEachLayer(const ShaderLayerCallback& callback) const - { - for(MapLayers::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) - { - callback(*i); - } - } - - qtexture_t* lightFalloffImage() const - { - if(!string_empty(m_template.m_lightFalloffImage.c_str())) - { - return m_pLightFalloffImage; - } - return 0; - } -}; - -bool CShader::m_lightingEnabled = false; - -typedef SmartPointer ShaderPointer; -typedef std::map shaders_t; - -shaders_t g_ActiveShaders; - -static shaders_t::iterator g_ActiveShadersIterator; - -void ActiveShaders_IteratorBegin() -{ - g_ActiveShadersIterator = g_ActiveShaders.begin(); + const char *stdName = QERApp_CleanTextureName (name); + m_strTextureName = stdName; + setName (name); } -bool ActiveShaders_IteratorAtEnd() +CShader *CShaderArray::Shader_ForTextureName (const char *name) const { - return g_ActiveShadersIterator == g_ActiveShaders.end(); -} - -IShader *ActiveShaders_IteratorCurrent() -{ - return static_cast(g_ActiveShadersIterator->second); -} - -void ActiveShaders_IteratorIncrement() -{ - ++g_ActiveShadersIterator; -} - -void debug_check_shaders(shaders_t& shaders) -{ - for(shaders_t::iterator i = shaders.begin(); i != shaders.end(); ++i) +#ifdef _DEBUG + // check we were given a texture name that fits the qtexture_t naming conventions + if (strcmp (name, QERApp_CleanTextureName (name)) != 0) + Sys_Printf + ("WARNING: texture name %s doesn't fit qtexture_t conventions in CShaderArray::Shader_ForTextureName\n", + name); +#endif + int i; + for (i = 0; i < CPtrArray::GetSize (); i++) { - ASSERT_MESSAGE(i->second->refcount() == 1, "orphan shader still referenced"); + CShader *pShader = static_cast < CShader * >(CPtrArray::GetAt (i)); + if (strcmp (name, QERApp_CleanTextureName (pShader->getTextureName ())) == 0) + return pShader; } + return NULL; } +IShader *WINAPI QERApp_ActiveShader_ForTextureName (char *name) +{ + return g_ActiveShaders.Shader_ForTextureName (name); +} + +void CShaderArray::AddSingle (void *lp) +{ + int i; + for (i = 0; i < CPtrArray::GetSize (); i++) + { + if (CPtrArray::GetAt (i) == lp) + return; + } + CPtrArray::Add (lp); + static_cast < CShader * >(CPtrArray::GetAt (i))->IncRef(); +} + +void CShaderArray::operator = (const class CShaderArray & src) +{ + int i; + +#ifdef _DEBUG + if (CPtrArray::GetSize () != 0) + Sys_Printf ("WARNING: CShaderArray::operator = expects an empty array\n"); +#endif + Copy (src); + // now go through and IncRef + for (i = 0; i < CPtrArray::GetSize (); i++) + static_cast < IShader * >(CPtrArray::GetAt (i))->IncRef (); +} + +//++timo NOTE: for debugging we may need to keep track and tell wether everything has been properly unloaded +void CShaderArray::ReleaseAll () +{ + int i; + int count = CPtrArray::GetSize (); + // decref + for (i = 0; i < count; i++) + static_cast < IShader * >(CPtrArray::GetAt (i))->DecRef (); + // get rid + CPtrArray::RemoveAll (); +} + +// NOTE TTimo: +// this was hacked to work a long time ago +// in Loki's fenris tracker as bug #104655 +// since that info is no longer available, and the hack has been there for so long, it's part of the code now +// don't remember the details, but basically across a flush and reload for the shaders +// we have to keep track of the patches texture names in a seperate entry +// not sure why anymore, but I know that doesn't happen with brushes +typedef struct patchEntry_s +{ + char name[QER_MAX_NAMELEN]; + patchMesh_t *p; +} patchEntry_t; + +CPtrArray PatchShaders; + +void PushPatch (patchMesh_t * patch) +{ + patchEntry_t *pEntry = new patchEntry_s; + pEntry->p = patch; + strcpy (pEntry->name, patch->pShader->getName ()); + PatchShaders.Add (pEntry); +} + +char *ShaderNameLookup (patchMesh_t * patch) +{ + int i; + int count = PatchShaders.GetSize (); + for (i = 0; i < count; i++) + { + if (static_cast < patchEntry_t * >(PatchShaders.GetAt (i))->p == patch) + return static_cast < patchEntry_t * >(PatchShaders.GetAt (i))->name; + } + Sys_Printf ("ERROR: failed to lookup name in ShaderNameLookup??\n"); + return SHADER_NOT_FOUND; +} +//++timo end clean + // will free all GL binded qtextures and shaders // NOTE: doesn't make much sense out of Radiant exit or called during a reload -void FreeShaders() +void WINAPI QERApp_FreeShaders () { - // reload shaders - // empty the actives shaders list - debug_check_shaders(g_ActiveShaders); - g_ActiveShaders.clear(); - g_shaders.clear(); - g_shaderTemplates.clear(); - g_shaderDefinitions.clear(); - g_ActiveShadersChangedNotify(); -} + int i; + brush_t *b; + brush_t *active_brushes; + brush_t *selected_brushes; + brush_t *filtered_brushes; + qtexture_t **d_qtextures; -bool ShaderTemplate::parseQuake3(Tokeniser& tokeniser) -{ - // name of the qtexture_t we'll use to represent this shader (this one has the "textures\" before) - m_textureName = m_Name.c_str(); + active_brushes = g_DataTable.m_pfnActiveBrushes (); + selected_brushes = g_DataTable.m_pfnSelectedBrushes (); + filtered_brushes = g_DataTable.m_pfnFilteredBrushes (); + d_qtextures = g_ShadersTable.m_pfnQTextures (); - tokeniser.nextLine(); + // store the shader names used by the patches + for (i = 0; i < PatchShaders.GetSize (); i++) + delete static_cast < patchMesh_t * >(PatchShaders.GetAt (i)); + PatchShaders.RemoveAll (); - // we need to read until we hit a balanced } - int depth = 0; - for(;;) + for (b = active_brushes->next; b != NULL && b != active_brushes; b = b->next) { - tokeniser.nextLine(); - const char* token = tokeniser.getToken(); - - if(token == 0) - return false; - - if(string_equal(token, "{")) - { - ++depth; - continue; - } - else if(string_equal(token, "}")) - { - --depth; - if(depth < 0) // underflow - { - return false; - } - if(depth == 0) // end of shader - { - break; - } - - continue; - } - - if(depth == 1) - { - if (string_equal_nocase(token, "qer_nocarve")) - { - m_nFlags |= QER_NOCARVE; - } - else if (string_equal_nocase(token, "qer_trans")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, m_fTrans)); - m_nFlags |= QER_TRANS; - } - else if (string_equal_nocase(token, "qer_editorimage")) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseTextureName(tokeniser, m_textureName)); - } - else if (string_equal_nocase(token, "qer_alphafunc")) - { - const char* alphafunc = tokeniser.getToken(); - - if(alphafunc == 0) - { - Tokeniser_unexpectedError(tokeniser, alphafunc, "#alphafunc"); - return false; - } - - if(string_equal_nocase(alphafunc, "equal")) - { - m_AlphaFunc = IShader::eEqual; - } - else if(string_equal_nocase(alphafunc, "greater")) - { - m_AlphaFunc = IShader::eGreater; - } - else if(string_equal_nocase(alphafunc, "less")) - { - m_AlphaFunc = IShader::eLess; - } - else if(string_equal_nocase(alphafunc, "gequal")) - { - m_AlphaFunc = IShader::eGEqual; - } - else if(string_equal_nocase(alphafunc, "lequal")) - { - m_AlphaFunc = IShader::eLEqual; - } - else - { - m_AlphaFunc = IShader::eAlways; - } - - m_nFlags |= QER_ALPHATEST; - - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, m_AlphaRef)); - } - else if (string_equal_nocase(token, "cull")) - { - const char* cull = tokeniser.getToken(); - - if(cull == 0) - { - Tokeniser_unexpectedError(tokeniser, cull, "#cull"); - return false; - } - - if(string_equal_nocase(cull, "none") - || string_equal_nocase(cull, "twosided") - || string_equal_nocase(cull, "disable")) - { - m_Cull = IShader::eCullNone; - } - else if(string_equal_nocase(cull, "back") - || string_equal_nocase(cull, "backside") - || string_equal_nocase(cull, "backsided")) - { - m_Cull = IShader::eCullBack; - } - else - { - m_Cull = IShader::eCullBack; - } - - m_nFlags |= QER_CULL; - } - else if (string_equal_nocase(token, "surfaceparm")) - { - const char* surfaceparm = tokeniser.getToken(); - - if(surfaceparm == 0) - { - Tokeniser_unexpectedError(tokeniser, surfaceparm, "#surfaceparm"); - return false; - } - - if (string_equal_nocase(surfaceparm, "fog")) - { - m_nFlags |= QER_FOG; - if (m_fTrans == 1.0f) // has not been explicitly set by qer_trans - { - m_fTrans = 0.35f; - } - } - else if (string_equal_nocase(surfaceparm, "nodraw")) - { - m_nFlags |= QER_NODRAW; - } - else if (string_equal_nocase(surfaceparm, "nonsolid")) - { - m_nFlags |= QER_NONSOLID; - } - else if (string_equal_nocase(surfaceparm, "water")) - { - m_nFlags |= QER_WATER; - } - else if (string_equal_nocase(surfaceparm, "lava")) - { - m_nFlags |= QER_LAVA; - } - else if (string_equal_nocase(surfaceparm, "areaportal")) - { - m_nFlags |= QER_AREAPORTAL; - } - else if (string_equal_nocase(surfaceparm, "playerclip")) - { - m_nFlags |= QER_CLIP; - } - else if (string_equal_nocase(surfaceparm, "botclip")) - { - m_nFlags |= QER_BOTCLIP; - } - } - } + if (b->patchBrush) + PushPatch (b->pPatch); + } + for (b = selected_brushes->next; b != NULL && b != selected_brushes; b = b->next) + { + if (b->patchBrush) + PushPatch (b->pPatch); + } + for (b = filtered_brushes->next; b != NULL && b != filtered_brushes; b = b->next) + { + if (b->patchBrush) + PushPatch (b->pPatch); } + // reload shaders + // empty the actives shaders list + g_ActiveShaders.ReleaseAll (); + g_Shaders.ReleaseAll (); + // empty the main g_qeglobals.d_qtextures list + // FIXME: when we reload later on, we need to have the shader names + // for brushes it's stored in the texdef + // but patches don't have texdef + // see bug 104655 for details + // so the solution, build an array of patchMesh_t* and their shader names +#ifdef _DEBUG + Sys_Printf ("FIXME: patch shader reload workaround (old fenris? bug 104655)\n"); +#endif + + //GtkWidget *widget = g_QglTable.m_pfn_GetQeglobalsGLWidget (); + GHashTable *texmap = g_ShadersTable.m_pfnQTexmap (); + + // NOTE: maybe before we'd like to set all qtexture_t in the shaders list to notex? + // NOTE: maybe there are some qtexture_t we don't want to erase? For plain color faces maybe? + while (*d_qtextures) + { + qtexture_t *pTex = *d_qtextures; + qtexture_t *pNextTex = pTex->next; + + //if (widget != NULL) + g_QglTable.m_pfn_qglDeleteTextures (1, &pTex->texture_number); + + g_hash_table_remove (texmap, pTex->name); + + // all qtexture_t should be manipulated with the glib alloc handlers for now + g_free (pTex); + *d_qtextures = pNextTex; + } + + g_QglTable.m_pfn_QE_CheckOpenGLForErrors (); +} + +// those functions are only used during a shader reload phase +// the patch one relies on ShaderNameLookup, a table that is being built only when a flush is performed +// so it's not something we want to expose publicly + +void SetShader (patchMesh_t * patch) +{ + // unhook current shader + patch->pShader->DecRef(); + // don't access this one! it has been deleted .. it's DEAD + patch->d_texture = NULL; + // hook the new one, increment the refcount + // NOTE TTimo this function increments the refcount, don't incref ourselves + patch->pShader = QERApp_Shader_ForName (ShaderNameLookup (patch)); + patch->d_texture = patch->pShader->getTexture (); +} + +void SetShader (face_t * f) +{ + // unhook current shader + f->pShader->DecRef(); + // don't access the texdef! it's DEAD + f->d_texture = NULL; + // hook + // NOTE TTimo this function increments the refcount, don't incref ourselves + f->pShader = QERApp_Shader_ForName (f->texdef.GetName()); + f->d_texture = f->pShader->getTexture (); +} + +void Brush_RefreshShader(brush_t *b) +{ + if (b->patchBrush) + SetShader(b->pPatch); + else if (b->owner->eclass->fixedsize) + { + /*eclass_t *eclass = HasModel(b); + if (eclass) + { + for(entitymodel *model = eclass->model; model!=NULL; model=model->pNext) + if(model && model->strSkin) + model->nTextureBind = g_FuncTable.m_pfnTexture_LoadSkin(((GString *)model->strSkin)->str, &model->nSkinWidth, &model->nSkinHeight); + }*/ + } + else + for (face_t *f=b->brush_faces ; f ; f=f->next) + SetShader(f); +} + +void WINAPI QERApp_ReloadShaders () +{ + brush_t *b; + brush_t *active_brushes; + brush_t *selected_brushes; + brush_t *filtered_brushes; + + QERApp_FreeShaders (); + + g_DataTable.m_pfnLstSkinCache()->RemoveAll(); //md3 skins + + active_brushes = g_DataTable.m_pfnActiveBrushes (); + selected_brushes = g_DataTable.m_pfnSelectedBrushes (); + filtered_brushes = g_DataTable.m_pfnFilteredBrushes (); + + // now we must reload the shader information from shaderfiles + g_ShadersTable.m_pfnBuildShaderList(); + g_ShadersTable.m_pfnPreloadShaders(); + + // refresh the map visuals: replace our old shader objects by the new ones + // on brush faces we have the shader name in texdef.name + // on patches we have the shader name in PatchShaders + // while we walk through the map data, we DecRef the old shaders and push the new ones in + // if all goes well, most of our old shaders will get deleted on the way + + // FIXME: bug 104655, when we come accross a patch, we use the above array since the d_texture is lost + // NOTE: both face_t and patchMesh_t store pointers to the shader and qtexture_t + // in an ideal world they would only store shader and access the qtexture_t through it + // reassign all current shaders + for (b = active_brushes->next; b != NULL && b != active_brushes; b = b->next) + Brush_RefreshShader(b); + for (b = selected_brushes->next; b != NULL && b != selected_brushes; b = b->next) + Brush_RefreshShader(b); + // do that to the filtered brushes as well (we might have some region compiling going on) + for (b = filtered_brushes->next; b != NULL && b != filtered_brushes; b = b->next) + Brush_RefreshShader(b); +} + +int WINAPI QERApp_LoadShadersFromDir (const char *path) +{ + int count = 0; + // scan g_Shaders, and call QERApp_Shader_ForName for each in the given path + // this will load the texture if needed and will set it in use.. + int nSize = g_Shaders.GetSize (); + for (int i = 0; i < nSize; i++) + { + CShader *pShader = reinterpret_cast < CShader * >(g_Shaders[i]); + if (strstr (pShader->getShaderFileName (), path) || strstr (pShader->getName (), path)) + { + count++; + // request the shader, this will load the texture if needed and set "inuse" + //++timo FIXME: should we put an Activate member on CShader? + // this QERApp_Shader_ForName call is a kind of hack + IShader *pFoo = QERApp_Shader_ForName (pShader->getName ()); +#ifdef _DEBUG + // check we activated the right shader + // NOTE: if there was something else loaded, the size of g_Shaders may have changed and strange behaviours are to be expected + if (pFoo != pShader) + Sys_Printf ("WARNING: unexpected pFoo != pShader in QERApp_LoadShadersFromDir\n"); +#else + pFoo = NULL; // leo: shut up the compiler +#endif + } + } + return count; +} + +bool CShader::Parse () +{ + char *token = g_ScripLibTable.m_pfnToken (); + + // the parsing needs to be taken out in another module +// Sys_Printf("TODO: CShader::Parse\n"); + + // token is shader name (full path with a "textures\") + // we remove the "textures\" part + //setName ((char *) &token[9])); + // no we don't + setName (token); + // name of the qtexture_t we'll use to represent this shader (this one has the "textures\" before) + const char *stdName = QERApp_CleanTextureName (token); + m_strTextureName = stdName; // FIXME: BC reports stdName is uninitialised? + g_ScripLibTable.m_pfnGetToken (true); + if (strcmp (token, "{")) + return false; + else + { + // we need to read until we hit a balanced } + int nMatch = 1; + while (nMatch > 0 && g_ScripLibTable.m_pfnGetToken (true)) + { + if (strcmp (token, "{") == 0) + { + nMatch++; + continue; + } + else if (strcmp (token, "}") == 0) + { + nMatch--; + continue; + } + if (nMatch > 1) continue; // ignore layers for now + if (strcmpi (token, "qer_nocarve") == 0) + { + m_nFlags |= QER_NOCARVE; + } + else if (strcmpi (token, "qer_trans") == 0) + { + if (g_ScripLibTable.m_pfnGetToken (true)) + { + m_fTrans = (float) atof (token); + } + m_nFlags |= QER_TRANS; + } + else if (strcmpi (token, "qer_editorimage") == 0) + { + if (g_ScripLibTable.m_pfnGetToken (true)) + { + // bAddTexture changed to false to allow editorimages in other locations than "textures/" + m_strTextureName = QERApp_CleanTextureName (token, false); + } + } + else if (strcmpi (token, "qer_alphafunc") == 0) + { + if (g_ScripLibTable.m_pfnGetToken (true)) + { + + if(stricmp( token, "greater" ) == 0 ) + { + m_nAlphaFunc = GL_GREATER; + } + else if(stricmp( token, "less" ) == 0 ) + { + m_nAlphaFunc = GL_LESS; + } + else if(stricmp( token, "gequal" ) == 0 ) + { + m_nAlphaFunc = GL_GEQUAL; + } + + if( m_nAlphaFunc ) + m_nFlags |= QER_ALPHAFUNC; + } + if (g_ScripLibTable.m_pfnGetToken (true)) + { + m_fAlphaRef = (float) atof (token); + } + } + else if (strcmpi (token, "cull") == 0) + { + if (g_ScripLibTable.m_pfnGetToken (true)) + { + if( stricmp( token, "none" ) == 0 || stricmp( token, "twosided" ) == 0 || stricmp( token, "disable" ) == 0 ) + { + m_nCull = 2; + } + else if( stricmp( token, "back" ) == 0 || stricmp( token, "backside" ) == 0 || stricmp( token, "backsided" ) == 0 ) + { + m_nCull = 1; + } + + if( m_nCull ) + m_nFlags |= QER_CULL; + } + } + else if (strcmpi (token, "surfaceparm") == 0) + { + if (g_ScripLibTable.m_pfnGetToken (true)) + { + if (strcmpi (token, "fog") == 0) + { + m_nFlags |= QER_FOG; + if (m_fTrans == 1.0f) // has not been explicitly set by qer_trans + { + m_fTrans = 0.35f; + } + } + else if (strcmpi (token, "nodraw") == 0) + { + m_nFlags |= QER_NODRAW; + } + else if (strcmpi (token, "nonsolid") == 0) + { + m_nFlags |= QER_NONSOLID; + } + else if (strcmpi (token, "water") == 0) + { + m_nFlags |= QER_WATER; + } + else if (strcmpi (token, "lava") == 0) + { + m_nFlags |= QER_LAVA; + } + } + } + } + if (nMatch != 0) + return false; + } return true; } -class Layer +void CShader::RegisterActivate () { -public: - LayerTypeId m_type; - TextureExpression m_texture; - BlendFunc m_blendFunc; - bool m_clampToBorder; - float m_alphaTest; - float m_heightmapScale; + // fill the qtexture_t with shader information + //++timo FIXME: a lot of that won't be necessary, will be stored at IShader* level +// strcpy (m_pTexture->shadername, m_Name); + // this flag is set only if we have a shaderfile name +// if (m_ShaderFileName[0] != '\0') +// m_pTexture->bFromShader = true; +// else +// m_pTexture->bFromShader = false; + //++timo FIXME: what do we do with that? + //m_pTexture->fTrans = pInfo->m_fTransValue; +// m_pTexture->fTrans = 1.0f; // if != 1.0 it's ot getting drawn in Cam_Draw +// m_pTexture->nShaderFlags = m_nFlags; + // store in the active shaders list (if necessary) + g_ActiveShaders.AddSingle (this); + // when you activate a shader, it gets displayed in the texture browser + m_bDisplayed = true; + IncRef (); +} - Layer() : m_type(LAYER_NONE), m_blendFunc(BLEND_ONE, BLEND_ZERO), m_clampToBorder(false), m_alphaTest(-1), m_heightmapScale(0) +void CShader::Try_Activate () +{ + m_pTexture = QERApp_Try_Texture_ForName (m_strTextureName.GetBuffer()); + if (m_pTexture) + RegisterActivate (); +} + +// Hydra: now returns false if the ORIGINAL shader could not be activated +// (missing texture, or incorrect shader script), true otherwise +// the shader is still activated in all cases. +bool CShader::Activate () +{ + Try_Activate (); + if (!m_pTexture) { + m_pTexture = QERApp_Texture_ForName2 (SHADER_NOTEX); + RegisterActivate (); + return false; } -}; + return true; +} -std::list g_shaderFilenames; - -void ParseShaderFile(Tokeniser& tokeniser, const char* filename) +void WINAPI QERApp_LoadShaderFile (const char *filename) { - g_shaderFilenames.push_back(filename); - filename = g_shaderFilenames.back().c_str(); - tokeniser.nextLine(); - for(;;) + char *pBuff; + int nSize = vfsLoadFile (filename, reinterpret_cast < void **>(&pBuff), 0); + if (nSize > 0) { - const char* token = tokeniser.getToken(); - - if(token == 0) + Sys_Printf ("Parsing shaderfile %s\n", filename); + g_ScripLibTable.m_pfnStartTokenParsing (pBuff); + while (g_ScripLibTable.m_pfnGetToken (true)) { - break; - } + // first token should be the path + name.. (from base) + CShader *pShader = new CShader (); + // we want the relative filename only, it's easier for later lookup .. see QERApp_ReloadShaderFile + char cTmp[1024]; + g_FuncTable.m_pfnQE_ConvertDOSToUnixName (cTmp, filename); + // given the vfs, we should not store the full path + //pShader->setShaderFileName( filename + strlen(ValueForKey(g_qeglobals.d_project_entity, "basepath"))); + pShader->setShaderFileName (filename); + if (pShader->Parse ()) + { + // do we already have this shader? + //++timo NOTE: this may a bit slow, we may need to use a map instead of a dumb list + if (g_Shaders.Shader_ForName (pShader->getName ()) != NULL) + { +#ifdef _DEBUG + Sys_Printf ("WARNING: shader %s is already in memory, definition in %s ignored.\n", + pShader->getName (), filename); +#endif + delete pShader; + } + else + { + pShader->IncRef (); - if(string_equal(token, "table")) - { - if(tokeniser.getToken() == 0) - { - Tokeniser_unexpectedError(tokeniser, 0, "#table-name"); - return; - } - if(!Tokeniser_parseToken(tokeniser, "{")) - { - return; - } - for(;;) - { - const char* option = tokeniser.getToken(); - if(string_equal(option, "{")) - { - for(;;) - { - const char* value = tokeniser.getToken(); - if(string_equal(value, "}")) - { - break; - } - } - - if(!Tokeniser_parseToken(tokeniser, "}")) - { - return; - } - break; - } - } - } - else - { - if(string_equal(token, "guide")) - { - parseTemplateInstance(tokeniser, filename); + g_Shaders.Add ((void *) pShader); + } } else { - if(!string_equal(token, "material") - && !string_equal(token, "particle") - && !string_equal(token, "skin")) - { - tokeniser.ungetToken(); - } - // first token should be the path + name.. (from base) - CopiedString name; - if(!Tokeniser_parseShaderName(tokeniser, name)) - { - } - ShaderTemplatePointer shaderTemplate(new ShaderTemplate()); - shaderTemplate->setName(name.c_str()); - - g_shaders.insert(ShaderTemplateMap::value_type(shaderTemplate->getName(), shaderTemplate)); - - bool result = (g_shaderLanguage == SHADERLANGUAGE_QUAKE3) - ? shaderTemplate->parseQuake3(tokeniser) - : shaderTemplate->parseDoom3(tokeniser); - if (result) - { - // do we already have this shader? - if(!g_shaderDefinitions.insert(ShaderDefinitionMap::value_type(shaderTemplate->getName(), ShaderDefinition(shaderTemplate.get(), ShaderArguments(), filename))).second) - { - #ifdef _DEBUG - globalOutputStream() << "WARNING: shader " << shaderTemplate->getName() << " is already in memory, definition in " << filename << " ignored.\n"; - #endif - } - } - else - { - globalErrorStream() << "Error parsing shader " << shaderTemplate->getName() << "\n"; - return; - } + Sys_Printf ("Error parsing shader %s\n", pShader->getName ()); + delete pShader; } } - } -} - -void parseGuideFile(Tokeniser& tokeniser, const char* filename) -{ - tokeniser.nextLine(); - for(;;) - { - const char* token = tokeniser.getToken(); - - if(token == 0) - { - break; - } - - if(string_equal(token, "guide")) - { - // first token should be the path + name.. (from base) - ShaderTemplatePointer shaderTemplate(new ShaderTemplate); - shaderTemplate->parseTemplate(tokeniser); - if(!g_shaderTemplates.insert(ShaderTemplateMap::value_type(shaderTemplate->getName(), shaderTemplate)).second) - { - globalErrorStream() << "guide " << makeQuoted(shaderTemplate->getName()) << ": already defined, second definition ignored\n"; - } - } - else if(string_equal(token, "inlineGuide")) - { - // skip entire inlineGuide definition - std::size_t depth = 0; - for(;;) - { - tokeniser.nextLine(); - token = tokeniser.getToken(); - if(string_equal(token, "{")) - { - ++depth; - } - else if(string_equal(token, "}")) - { - if(--depth == 0) - { - break; - } - } - } - } - } -} - -void LoadShaderFile(const char* filename) -{ - ArchiveTextFile* file = GlobalFileSystem().openTextFile(filename); - - if(file != 0) - { - globalOutputStream() << "Parsing shaderfile " << filename << "\n"; - - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewScriptTokeniser(file->getInputStream()); - - ParseShaderFile(tokeniser, filename); - - tokeniser.release(); - file->release(); + vfsFreeFile (pBuff); } else { - globalOutputStream() << "Unable to read shaderfile " << filename << "\n"; + Sys_Printf ("Unable to read shaderfile %s\n", filename); } } -typedef FreeCaller1 LoadShaderFileCaller; - - -void loadGuideFile(const char* filename) +IShader *WINAPI QERApp_Try_Shader_ForName (const char *name) { - StringOutputStream fullname(256); - fullname << "guides/" << filename; - ArchiveTextFile* file = GlobalFileSystem().openTextFile(fullname.c_str()); + // look for the shader + CShader *pShader = g_Shaders.Shader_ForName (name); + if (!pShader) + // not found + return NULL; + // we may need to load the texture or use the "shader without texture" one + pShader->Activate (); + pShader->SetDisplayed (true); + return pShader; +} - if(file != 0) +IShader *WINAPI QERApp_CreateShader_ForTextureName (const char *name) +{ + CShader *pShader; + pShader = new CShader; + // CreateDefault expects a texture / shader name relative to the "textures" directory + // (cause shader names are reletive to "textures/") + pShader->CreateDefault (name); + // hook it into the shader list + g_Shaders.Add ((void *) pShader); + pShader->IncRef (); + // if it can't find the texture, SHADER_NOT_FOUND will be used + // Hydra: display an error message, so the user can quickly find a list of missing + // textures by looking at the console. + if (!pShader->Activate ()) { - globalOutputStream() << "Parsing guide file " << fullname.c_str() << "\n"; - - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewScriptTokeniser(file->getInputStream()); - - parseGuideFile(tokeniser, fullname.c_str()); - - tokeniser.release(); - file->release(); + Sys_Printf ("WARNING: Activate shader failed for %s\n",pShader->getName()); } + pShader->SetDisplayed (true); + + return pShader; +} + +IShader *WINAPI QERApp_Shader_ForName (const char *name) +{ + if (name == NULL || strlen (name) == 0) + { + // Hydra: This error can occur if the user loaded a map with/dropped an entity that + // did not set a texture name "(r g b)" - check the entity definition loader + + g_FuncTable.m_pfnSysFPrintf (SYS_ERR, "FIXME: name == NULL || strlen(name) == 0 in QERApp_Shader_ForName\n"); + return QERApp_Shader_ForName (SHADER_NOT_FOUND); + } + // entities that should be represented with plain colors instead of textures + // request a texture name with (r g b) (it's stored in their class_t) + if (name[0] == '(') + { + return QERApp_ColorShader_ForName (name); + } + + CShader *pShader = static_cast < CShader * >(QERApp_Try_Shader_ForName (name)); + if (pShader) + { + pShader->SetDisplayed (true); + return pShader; + } + return QERApp_CreateShader_ForTextureName (name); +} + +qtexture_t *WINAPI QERApp_Try_Texture_ForName (const char *name) +{ + qtexture_t *q; +// char f1[1024], f2[1024]; + unsigned char *pPixels = NULL; + int nWidth, nHeight; + + // convert the texture name to the standard format we use in qtexture_t + const char *stdName = QERApp_CleanTextureName (name); + + // use the hash table + q = (qtexture_t*)g_hash_table_lookup (g_ShadersTable.m_pfnQTexmap (), stdName); + if (q) + return q; + +#ifdef QTEXMAP_DEBUG + for (q = g_qeglobals.d_qtextures; q; q = q->next) + { + if (!strcmp (stdName, q->name)) + { + Sys_Printf ("ERROR: %s is not in texture map, but was found in texture list\n"); + return q; + } + } +#endif + + g_FuncTable.m_pfnLoadImage (name, &pPixels, &nWidth, &nHeight); + + if (!pPixels) + return NULL; // we failed else - { - globalOutputStream() << "Unable to read guide file " << fullname.c_str() << "\n"; - } + Sys_Printf ("LOADED: %s\n", name); + + // instanciate a new qtexture_t + // NOTE: when called by a plugin we must make sure we have set Radiant's GL context before binding the texture + + // we'll be binding the GL texture now + // need to check we are using a right GL context + // with GL plugins that have their own window, the GL context may be the plugin's, in which case loading textures will bug + // g_QglTable.m_pfn_glwidget_make_current (g_QglTable.m_pfn_GetQeglobalsGLWidget ()); + q = g_FuncTable.m_pfnLoadTextureRGBA (pPixels, nWidth, nHeight); + if (!q) + return NULL; + g_free (pPixels); + + strcpy (q->name, name); + // only strip extension if extension there is! + if (q->name[strlen (q->name) - 4] == '.') + q->name[strlen (q->name) - 4] = '\0'; + // hook into the main qtexture_t list + qtexture_t **d_qtextures = g_ShadersTable.m_pfnQTextures (); + q->next = *d_qtextures; + *d_qtextures = q; + // push it in the map + g_hash_table_insert (g_ShadersTable.m_pfnQTexmap (), q->name, q); + return q; } -typedef FreeCaller1 LoadGuideFileCaller; - - -CShader* Try_Shader_ForName(const char* name) +int WINAPI QERApp_HasShader (const char *pName) { - { - shaders_t::iterator i = g_ActiveShaders.find(name); - if(i != g_ActiveShaders.end()) - { - return (*i).second; - } - } - // active shader was not found - - // find matching shader definition - ShaderDefinitionMap::iterator i = g_shaderDefinitions.find(name); - if(i == g_shaderDefinitions.end()) - { - // shader definition was not found + // mickey check the global shader array for existense of pName + CShader *pShader = g_Shaders.Shader_ForName (pName); + if (pShader) + return 1; + return 0; +} - // create new shader definition from default shader template - ShaderTemplatePointer shaderTemplate(new ShaderTemplate()); - shaderTemplate->CreateDefault(name); - g_shaderTemplates.insert(ShaderTemplateMap::value_type(shaderTemplate->getName(), shaderTemplate)); - - i = g_shaderDefinitions.insert(ShaderDefinitionMap::value_type(name, ShaderDefinition(shaderTemplate.get(), ShaderArguments(), ""))).first; - } - - // create shader from existing definition - ShaderPointer pShader(new CShader((*i).second)); - pShader->setName(name); - g_ActiveShaders.insert(shaders_t::value_type(name, pShader)); - g_ActiveShadersChangedNotify(); +IShader *WINAPI QERApp_Shader_ForName_NoLoad (const char *pName) +{ + CShader *pShader = g_Shaders.Shader_ForName (pName); return pShader; } -IShader *Shader_ForName(const char *name) +/*! +This should NEVER return NULL, it is the last-chance call in the load cascade +*/ +qtexture_t *WINAPI QERApp_Texture_ForName2 (const char *filename) { - ASSERT_NOTNULL(name); + qtexture_t *q; + q = QERApp_Try_Texture_ForName (filename); + if (q) + return q; + // not found? use "texture not found" + q = QERApp_Try_Texture_ForName (SHADER_NOT_FOUND); + if (q) + return q; - IShader *pShader = Try_Shader_ForName(name); - pShader->IncRef(); + // still not found? this is a fatal error + g_FuncTable.m_pfnError("Failed to load " SHADER_NOT_FOUND ". Looks like your installation is broken / missing some essential elements."); + return NULL; +} + +void CShader::CreateColor (const char *name) +{ + // parse + sscanf (name, "(%g %g %g)", m_vColor, m_vColor + 1, m_vColor + 2); + m_strTextureName = name; + setName ("color"); + // create the qtexture_t + qtexture_t *q1 = QERApp_Texture_ForName2 (SHADER_NOT_FOUND); + // copy this one + qtexture_t *q2 = new qtexture_t; + memcpy (q2, q1, sizeof (qtexture_t)); + strcpy (q2->name, m_strTextureName.GetBuffer ()); + VectorCopy (m_vColor, q2->color); + m_pTexture = q2; +} + +IShader *WINAPI QERApp_ColorShader_ForName (const char *name) +{ + CShader *pShader = new CShader (); + pShader->CreateColor (name); + // hook it into the shader list + pShader->IncRef (); + g_Shaders.Add ((void *) pShader); return pShader; } - - - -// the list of scripts/*.shader files we need to work with -// those are listed in shaderlist file -GSList *l_shaderfiles = 0; - -GSList* Shaders_getShaderFileList() +void CShaderArray::ReleaseForShaderFile (const char *name) { - return l_shaderfiles; -} - -/* -================== -DumpUnreferencedShaders -usefull function: dumps the list of .shader files that are not referenced to the console -================== -*/ -void IfFound_dumpUnreferencedShader(bool& bFound, const char* filename) -{ - bool listed = false; - - for(GSList* sh = l_shaderfiles; sh != 0; sh = g_slist_next(sh)) + int i; + // decref + for (i = 0; i < CPtrArray::GetSize (); i++) { - if(!strcmp((char*)sh->data, filename)) + IShader *pShader = static_cast < IShader * >(CPtrArray::GetAt (i)); + if (!strcmp (name, pShader->getShaderFileName ())) { - listed = true; - break; + pShader->DecRef (); + CPtrArray::RemoveAt (i); + i--; // get ready for next loop } } - - if(!listed) - { - if(!bFound) - { - bFound = true; - globalOutputStream() << "Following shader files are not referenced in shaderlist.txt:\n"; - } - globalOutputStream() << filename << "\n"; - } -} -typedef ReferenceCaller1 IfFoundDumpUnreferencedShaderCaller; - -void DumpUnreferencedShaders() -{ - bool bFound = false; - GlobalFileSystem().forEachFile(g_shadersDirectory, g_shadersExtension, IfFoundDumpUnreferencedShaderCaller(bFound)); } -void ShaderList_addShaderFile(const char* dirstring) +void WINAPI QERApp_ReloadShaderFile (const char *name) { - bool found = false; + brush_t *b; + face_t *f; + brush_t *active_brushes; + brush_t *selected_brushes; + brush_t *filtered_brushes; - for(GSList* tmp = l_shaderfiles; tmp != 0; tmp = tmp->next) +// Sys_Printf("TODO: QERApp_ReloadShaderFile\n"); + + active_brushes = g_DataTable.m_pfnActiveBrushes (); + selected_brushes = g_DataTable.m_pfnSelectedBrushes (); + filtered_brushes = g_DataTable.m_pfnFilteredBrushes (); + +#ifdef _DEBUG + // check the shader name is a reletive path + // I hacked together a few quick tests to make sure :-) + if (strstr (name, ":\\") || !strstr (name, "scripts")) + Sys_Printf ("WARNING: is %s a reletive path to a shader file? (QERApp_ReloadShaderFile\n"); +#endif + + // in the actives and global shaders lists, decref and unhook the shaders + //++timo NOTE: maybe we'd like to keep track of the shaders we are unhooking? + g_ActiveShaders.ReleaseForShaderFile (name); + g_Shaders.ReleaseForShaderFile (name); + // go through a reload of the shader file + QERApp_LoadShaderFile (name); + // scan all the brushes, replace all the old ones by refs to their new equivalents + for (b = active_brushes->next; b != NULL && b != active_brushes; b = b->next) { - if(string_equal_nocase(dirstring, (char*)tmp->data)) - { - found = true; - globalOutputStream() << "duplicate entry \"" << (char*)tmp->data << "\" in shaderlist.txt\n"; - break; - } + if (b->patchBrush && !strcmp (b->pPatch->pShader->getShaderFileName (), name)) + SetShader (b->pPatch); + else + for (f = b->brush_faces; f; f = f->next) + if (!strcmp (f->pShader->getShaderFileName (), name)) + SetShader (f); } - - if(!found) + for (b = selected_brushes->next; b != NULL && b != selected_brushes; b = b->next) { - l_shaderfiles = g_slist_append(l_shaderfiles, strdup(dirstring)); + if (b->patchBrush && !strcmp (b->pPatch->pShader->getShaderFileName (), name)) + SetShader (b->pPatch); + else + for (f = b->brush_faces; f; f = f->next) + if (!strcmp (f->pShader->getShaderFileName (), name)) + SetShader (f); } + // do that to the filtered brushes as well (we might have some region compiling going on) + for (b = filtered_brushes->next; b != NULL && b != filtered_brushes; b = b->next) + { + if (b->patchBrush && !strcmp (b->pPatch->pShader->getShaderFileName (), name)) + SetShader (b->pPatch); + else + for (f = b->brush_faces; f; f = f->next) + if (!strcmp (f->pShader->getShaderFileName (), name)) + SetShader (f); + } + // call Texture_ShowInUse to clean and display only what's required + g_ShadersTable.m_pfnTexture_ShowInuse (); + QERApp_SortActiveShaders (); + g_FuncTable.m_pfnSysUpdateWindows (W_TEXTURE); } -typedef FreeCaller1 AddShaderFileCaller; - - -/* -================== -BuildShaderList -build a CStringList of shader names -================== -*/ -void BuildShaderList(TextInputStream& shaderlist) +void CShaderArray::SetDisplayed (bool b) { - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewSimpleTokeniser(shaderlist); - tokeniser.nextLine(); - const char* token = tokeniser.getToken(); - StringOutputStream shaderFile(64); - while(token != 0) + int i, count; + count = CPtrArray::GetSize (); + for (i = 0; i < count; i++) + static_cast < IShader * >(CPtrArray::GetAt (i))->SetDisplayed (b); +} + +void CShaderArray::SetInUse (bool b) +{ + int i, count; + count = CPtrArray::GetSize (); + for (i = 0; i < count; i++) + static_cast < IShader * >(CPtrArray::GetAt (i))->SetInUse (b); +} + +// Set the IsDisplayed flag on all active shaders +void WINAPI QERApp_ActiveShaders_SetDisplayed (bool b) +{ + g_ActiveShaders.SetDisplayed (b); +} + +void WINAPI QERApp_ActiveShaders_SetInUse (bool b) +{ + g_ActiveShaders.SetInUse (b); +} + +// ============================================================================= +// SYNAPSE + +bool CSynapseClientShaders::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, SHADERS_MAJOR)) { - // each token should be a shader filename - shaderFile << token << "." << g_shadersExtension; + _QERShadersTable* pTable= static_cast<_QERShadersTable*>(pAPI->mpTable); + + pTable->m_pfnFreeShaders = QERApp_FreeShaders; + pTable->m_pfnReloadShaders = QERApp_ReloadShaders; + pTable->m_pfnLoadShadersFromDir = QERApp_LoadShadersFromDir; + pTable->m_pfnReloadShaderFile = QERApp_ReloadShaderFile; + pTable->m_pfnLoadShaderFile = QERApp_LoadShaderFile; + pTable->m_pfnHasShader = QERApp_HasShader; + pTable->m_pfnTry_Shader_ForName = QERApp_Try_Shader_ForName; + pTable->m_pfnShader_ForName = QERApp_Shader_ForName; + pTable->m_pfnTry_Texture_ForName = QERApp_Try_Texture_ForName; + pTable->m_pfnTexture_ForName = QERApp_Texture_ForName2; + pTable->m_pfnGetActiveShaderCount = QERApp_GetActiveShaderCount; + pTable->m_pfnColorShader_ForName = QERApp_ColorShader_ForName; + pTable->m_pfnShader_ForName_NoLoad = QERApp_Shader_ForName_NoLoad; + pTable->m_pfnActiveShaders_SetInUse = QERApp_ActiveShaders_SetInUse; + pTable->m_pfnSortActiveShaders = QERApp_SortActiveShaders; + pTable->m_pfnActiveShader_ForTextureName = QERApp_ActiveShader_ForTextureName; + pTable->m_pfnCreateShader_ForTextureName = QERApp_CreateShader_ForTextureName; + pTable->m_pfnActiveShaders_SetDisplayed = QERApp_ActiveShaders_SetDisplayed; + pTable->m_pfnActiveShader_ForIndex = QERApp_ActiveShader_ForIndex; + pTable->m_pfnCleanTextureName = QERApp_CleanTextureName; - ShaderList_addShaderFile(shaderFile.c_str()); - - tokeniser.nextLine(); - token = tokeniser.getToken(); - - shaderFile.clear(); - } - tokeniser.release(); -} - -void FreeShaderList() -{ - while(l_shaderfiles != 0) - { - free(l_shaderfiles->data); - l_shaderfiles = g_slist_remove(l_shaderfiles, l_shaderfiles->data); - } -} - -#include "stream/filestream.h" - -bool shaderlist_findOrInstall(const char* enginePath, const char* toolsPath, const char* shaderPath, const char* gamename) -{ - StringOutputStream absShaderList(256); - absShaderList << enginePath << gamename << '/' << shaderPath << "shaderlist.txt"; - if(file_exists(absShaderList.c_str())) - { return true; } - { - StringOutputStream directory(256); - directory << enginePath << gamename << '/' << shaderPath; - if(!file_exists(directory.c_str()) && !Q_mkdir(directory.c_str())) - { - return false; - } - } - { - StringOutputStream defaultShaderList(256); - defaultShaderList << toolsPath << gamename << '/' << "default_shaderlist.txt"; - if(file_exists(defaultShaderList.c_str())) - { - return file_copy(defaultShaderList.c_str(), absShaderList.c_str()); - } - } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); return false; } - -void Shaders_Load() -{ - if(g_shaderLanguage == SHADERLANGUAGE_QUAKE4) - { - GlobalFileSystem().forEachFile("guides/", "guide", LoadGuideFileCaller(), 0); - } - - const char* shaderPath = GlobalRadiant().getGameDescriptionKeyValue("shaderpath"); - if(!string_empty(shaderPath)) - { - StringOutputStream path(256); - path << DirectoryCleaned(shaderPath); - - if(g_useShaderList) - { - // preload shader files that have been listed in shaderlist.txt - const char* basegame = GlobalRadiant().getRequiredGameDescriptionKeyValue("basegame"); - const char* gamename = GlobalRadiant().getGameName(); - const char* enginePath = GlobalRadiant().getEnginePath(); - const char* toolsPath = GlobalRadiant().getGameToolsPath(); - - bool isMod = !string_equal(basegame, gamename); - - if(!isMod || !shaderlist_findOrInstall(enginePath, toolsPath, path.c_str(), gamename)) - { - gamename = basegame; - shaderlist_findOrInstall(enginePath, toolsPath, path.c_str(), gamename); - } - - StringOutputStream absShaderList(256); - absShaderList << enginePath << gamename << '/' << path.c_str() << "shaderlist.txt"; - - { - globalOutputStream() << "Parsing shader files from " << absShaderList.c_str() << "\n"; - TextFileInputStream shaderlistFile(absShaderList.c_str()); - if(shaderlistFile.failed()) - { - globalErrorStream() << "Couldn't find '" << absShaderList.c_str() << "'\n"; - } - else - { - BuildShaderList(shaderlistFile); - DumpUnreferencedShaders(); - } - } - } - else - { - GlobalFileSystem().forEachFile(path.c_str(), g_shadersExtension, AddShaderFileCaller(), 0); - } - - GSList *lst = l_shaderfiles; - StringOutputStream shadername(256); - while(lst) - { - shadername << path.c_str() << reinterpret_cast(lst->data); - LoadShaderFile(shadername.c_str()); - shadername.clear(); - lst = lst->next; - } - } - - //StringPool_analyse(ShaderPool::instance()); -} - -void Shaders_Free() -{ - FreeShaders(); - FreeShaderList(); - g_shaderFilenames.clear(); -} - -ModuleObservers g_observers; - -std::size_t g_shaders_unrealised = 1; // wait until filesystem and is realised before loading anything -bool Shaders_realised() -{ - return g_shaders_unrealised == 0; -} -void Shaders_Realise() -{ - if(--g_shaders_unrealised == 0) - { - Shaders_Load(); - g_observers.realise(); - } -} -void Shaders_Unrealise() -{ - if(++g_shaders_unrealised == 1) - { - g_observers.unrealise(); - Shaders_Free(); - } -} - -void Shaders_Refresh() -{ - Shaders_Unrealise(); - Shaders_Realise(); -} - -class Quake3ShaderSystem : public ShaderSystem, public ModuleObserver -{ -public: - void realise() - { - Shaders_Realise(); - } - void unrealise() - { - Shaders_Unrealise(); - } - void refresh() - { - Shaders_Refresh(); - } - - IShader* getShaderForName(const char* name) - { - return Shader_ForName(name); - } - - void foreachShaderName(const ShaderNameCallback& callback) - { - for(ShaderDefinitionMap::const_iterator i = g_shaderDefinitions.begin(); i != g_shaderDefinitions.end(); ++i) - { - callback((*i).first.c_str()); - } - } - - void beginActiveShadersIterator() - { - ActiveShaders_IteratorBegin(); - } - bool endActiveShadersIterator() - { - return ActiveShaders_IteratorAtEnd(); - } - IShader* dereferenceActiveShadersIterator() - { - return ActiveShaders_IteratorCurrent(); - } - void incrementActiveShadersIterator() - { - ActiveShaders_IteratorIncrement(); - } - void setActiveShadersChangedNotify(const Callback& notify) - { - g_ActiveShadersChangedNotify = notify; - } - - void attach(ModuleObserver& observer) - { - g_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - g_observers.detach(observer); - } - - void setLightingEnabled(bool enabled) - { - if(CShader::m_lightingEnabled != enabled) - { - for(shaders_t::const_iterator i = g_ActiveShaders.begin(); i != g_ActiveShaders.end(); ++i) - { - (*i).second->unrealiseLighting(); - } - CShader::m_lightingEnabled = enabled; - for(shaders_t::const_iterator i = g_ActiveShaders.begin(); i != g_ActiveShaders.end(); ++i) - { - (*i).second->realiseLighting(); - } - } - } - - const char* getTexturePrefix() const - { - return g_texturePrefix; - } -}; - -Quake3ShaderSystem g_Quake3ShaderSystem; - -ShaderSystem& GetShaderSystem() -{ - return g_Quake3ShaderSystem; -} - -void Shaders_Construct() -{ - GlobalFileSystem().attach(g_Quake3ShaderSystem); -} -void Shaders_Destroy() -{ - GlobalFileSystem().detach(g_Quake3ShaderSystem); - - if(Shaders_realised()) - { - Shaders_Free(); - } -} diff --git a/plugins/shaders/shaders.def b/plugins/shaders/shaders.def new file mode 100644 index 00000000..3f3b6a1e --- /dev/null +++ b/plugins/shaders/shaders.def @@ -0,0 +1,8 @@ +; shaders.def : Declares the module parameters for the DLL. + +LIBRARY "Shaders" +DESCRIPTION 'Shaders Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/shaders/shaders.h b/plugins/shaders/shaders.h index 8296b791..253f87ec 100644 --- a/plugins/shaders/shaders.h +++ b/plugins/shaders/shaders.h @@ -28,28 +28,140 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_SHADERS_H) -#define INCLUDED_SHADERS_H +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// internal implementation of IShaders related stuff +// -void Shaders_Construct(); -void Shaders_Destroy(); -class ShaderSystem; -ShaderSystem& GetShaderSystem(); +#ifndef __SHADERS_H_ +#define __SHADERS_H_ -enum ShaderLanguage +//++timo TODO: track all the calls to IncRef and look for not-called DecRef bugs +//++timo TODO: move all needed stuff into the IShader interface + +// Radiant's internal implementation of the IShader object +class CShader : public IShader { - SHADERLANGUAGE_QUAKE3, - SHADERLANGUAGE_DOOM3, - SHADERLANGUAGE_QUAKE4 + int refCount; + qtexture_t *m_pTexture; + // name is shader / texture name (if not a real shader) reletive to "textures/" directory + char m_Name[QER_MAX_NAMELEN]; + char m_ShaderFileName[QER_MAX_NAMELEN]; + int m_nFlags; + float m_fTrans; + // the name of the texture file to be used to represent the shader + //++timo FIXME? + // must fit the qtexture_t convention or not? I think so .. + // ((old .. NOTE: may be a straight copy of the .shader file, doesn't fit the qtexture_t naming requirements)) + CString m_strTextureName; + bool m_bDisplayed; + bool m_bInUse; + // color stuff + bool m_bColor; + vec3_t m_vColor; + // alphafunc stuff + int m_nAlphaFunc; + float m_fAlphaRef; + // cull stuff + int m_nCull; + + // will hook itself in g_ActiveShaders and increment ref count + // will also update the underlying qtexture_t with some information about the shader name etc. + void RegisterActivate(); + +public: + CShader() { refCount = 0; m_pTexture = NULL; m_Name[0]='\0'; m_ShaderFileName[0]='\0'; m_nFlags = 0; m_bInUse = false; m_bDisplayed = false; m_bColor = false; m_fTrans = 1.0f; m_nAlphaFunc = 0; m_fAlphaRef = 0.f; m_nCull = 0; } + virtual ~CShader() { } + + // IShaders implementation ----------------- + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () + { if ( --refCount <= 0 ) + delete this; + } + // get/set the qtexture_t* Radiant uses to represent this shader object + qtexture_t* getTexture() const { return m_pTexture; } + void setTexture(qtexture_t *pTex) { m_pTexture = pTex; } + // get shader name + const char* getName() const { return m_Name; } + bool IsDisplayed() const { return m_bDisplayed; } + void SetDisplayed(bool b) { m_bDisplayed = b; } + // setting in use also sets the display flag on + bool IsInUse() const { return m_bInUse; } + void SetInUse(bool b) { m_bInUse = b; if (m_pTexture) m_pTexture->inuse = true; if (b) m_bDisplayed = true; } + // get the shader flags + int getFlags() { return m_nFlags; } + // get the transparency value + float getTrans() { return m_fTrans; } + // test if it's a true shader, or a default shader created to wrap around a texture + bool IsDefault() { return m_ShaderFileName[0] == '\0'; } + // test if it's a plain color shader, i.e. a shader we use on plain color stuff (like info_playerstart) + bool IsColor() { return m_bColor; } + // get the related color then! + void getColor( vec3_t v) { VectorCopy( m_vColor, v); } + // get the alphaFunc + void getAlphaFunc(int *func, float *ref) { *func = m_nAlphaFunc; *ref = m_fAlphaRef; }; + // get the cull type + int getCull() { return m_nCull; }; + // get/set shader file name (ie the file where this one is defined) + const char* getShaderFileName() const { return m_ShaderFileName; } + // ----------------------------------------- + + // parse yourself! + bool Parse(); + + // search / load the texture to be used when displaying the shader + // after a successfull call to one of these the shader will get displayed in the tex wnd + // if m_strTextureName could not be loaded will set m_pTexture to NULL + void Try_Activate(); + // if m_strTextureName could not be loaded will use a default qtexture + // FIXME TTimo: Activate forces activation, always true + bool Activate(); + + // set shader name + void setName(const char* name) { strcpy(m_Name, name); } + void setShaderFileName(const char* name) { strcpy(m_ShaderFileName, name); } + // create a default shader for a given texture name + // will not activate! + // NOTE: CreateDefault expects a texture name reletive to the base path. Adding a "textures/" may be needed + void CreateDefault(const char* name); + const char* getTextureName() { return m_strTextureName; } + + //++timo clean + // color stuff +// void setColor( vec3_t c ) { VectorCopy( c, m_vColor ); m_bColor = true; } + // create a color shader + void CreateColor(const char* name); }; -extern const char* g_shadersExtension; -extern const char* g_shadersDirectory; -extern ShaderLanguage g_shaderLanguage; -extern bool g_enableDefaultShaders; -extern bool g_useShaderList; -struct _QERPlugImageTable; -extern _QERPlugImageTable* g_bitmapModule; - +// the classical CPtrArray with some enhancements +class CShaderArray : public CPtrArray +{ +public: + CShaderArray() { } + virtual ~CShaderArray() { } + // look for a shader with a given name (may return NULL) + CShader* Shader_ForName( const char * ) const; + // look for a shader with a given texture name (may return NULL) + // NOTE: the texture name is supposed to fit qtexture_t naming conventions .. _DEBUG builds will check + CShader* Shader_ForTextureName( const char * ) const; + // will Add the given object if not already in + void AddSingle(void*); + // will copy / add another CShaderArray, and IncRef + void operator = (const class CShaderArray &); + // will empty the array, decreasing the refcount by 1 + void ReleaseAll(); + // will empty all shaders that match a given filename, decreasing the refcount by 1 + void ReleaseForShaderFile( const char * ); + // sort the array by shader name + void SortShaders(); + // set the IsDisplayed flag for all shaders stored + void SetDisplayed(bool b); + // set the InUse flag for all shaders stored + void SetInUse(bool b); +}; #endif diff --git a/plugins/shaders/shaders.vcproj b/plugins/shaders/shaders.vcproj new file mode 100644 index 00000000..24df4772 --- /dev/null +++ b/plugins/shaders/shaders.vcproj @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/shaders/shadersq3.def b/plugins/shaders/shadersq3.def deleted file mode 100644 index ab664138..00000000 --- a/plugins/shaders/shadersq3.def +++ /dev/null @@ -1,7 +0,0 @@ -; shadersq3.def : Declares the module parameters for the DLL. - -LIBRARY "ShadersQ3" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/shaders/shadersq3.vcproj b/plugins/shaders/shadersq3.vcproj deleted file mode 100644 index 21223707..00000000 --- a/plugins/shaders/shadersq3.vcproj +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/spritemodel/plugin.cpp b/plugins/spritemodel/plugin.cpp index 5b74b87b..4e51e551 100644 --- a/plugins/spritemodel/plugin.cpp +++ b/plugins/spritemodel/plugin.cpp @@ -1,5 +1,6 @@ /* -Copyright (C) 2002 Dominic Clifton. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -36,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA It allows the user to see a graphical representation of the entity in the 3D view (maybe 2D views later) where the entity would just otherwise be a non-descriptive coloured box. - It is designed to be used with the entity view set to WireFrame (as the sprite images are rendered in the middle of the entity's bbox. + It is designed to be used with the entity view set to WireFrame (as the sprite images are rendered in the middle of the entity's bbox). How ? ----- @@ -81,40 +82,76 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also, I can't get the alpha map stuff right so I had to invert the alpha mask in the spr loader so that 0xff = not drawn pixel. + v0.2 - 10/March/2003 + - Updated to coincide with Radiant 1.3.5 test builds. Also, I made sure it worked + under quake3 and it does. + + v0.3 - 10/March/2003 + - Added about box. + ToDo ==== * make sprites always face the camera (is this done in camwindow.cpp ?) + but only if the entity model doesn't have "angle" keys. At the moment + it's better to rotate the model with the angles. * maybe add an option to scale the sprites in the prefs ? - * un-hack the default fall-though to "sprite" model version (see m_version) - * maybe convert to a new kind of class not based on model. * allow sprites on non-fixedsize ents * fix reversed alpha map in spr loader + -> is this actually broken? - * allow an entity to have both an .md? and a sprite model. + * allow an entity to have multiple models (e.g .md3 and a sprite model) + and allow the user to toggle either models on or off. + + * dynamically add the api's depending on what image loading modules are + supported by radiant. + Currently, we hard code to the list in "supportedmodelformats" (see below) + but, all these extensions are stripped when the actual image is loaded. + current the bit of code that decided what model api to use needs reworking + as it decides by looking at the extension of the model name, when in fact + we don't even need an extension. + + Previously the code fell though to use this model as the default model + plugin, but that also has issues. + + what it means is, in the .def files you must specify an image filename + that has one of the extensions listed below, but in actual fact radiant + will use any available image module to load the image. + + + e.g. you could use a model name of "sprites/target_speaker.tga" and have + a file called sprites/target_speaker.png and it would be correctly loaded + even if it not listed below in "supportedmodelformats". + + So, currently in the .def files you can just use the name + "sprites/target_speaker.spr" and it will load the file + from "sprites/target_speaker.*" which is what I propose anyone creating image sets for Q3/Wolf/etc does. */ #include "plugin.h" -#include "spritemodel.h" // ============================================================================= // Globals // function tables -_QERFuncTable_1 __QERTABLENAME; -OpenGLBinding g_QglTable; +_QERFuncTable_1 g_FuncTable; +_QERQglTable g_QglTable; _QERShadersTable g_ShadersTable; // ============================================================================= -// SYNAPSE +// plugin implementation -#include "synapse.h" +static const char *PLUGIN_NAME = "Sprite Model loading module"; +static const char *PLUGIN_COMMANDS = "About..."; + +static const char *PLUGIN_ABOUT = "Sprite Model loading module v0.2 for GTKRadiant\n\n" + "By Hydra!"; char *supportedmodelformats[] = {"spr","bmp","tga","jpg","hlw",NULL}; // NULL is list delimiter @@ -147,31 +184,42 @@ void init_filetypes() } } -extern CSynapseServer* g_pSynapseServer; - -class CSynapseClientModel : public CSynapseClient +extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) { -public: - // CSynapseClient API - bool RequestAPI(APIDescriptor_t *pAPI); - const char* GetInfo(); - const char* GetName(); + init_filetypes(); // see todo list above. + return (char *) PLUGIN_NAME; +} - CSynapseClientModel() { } - virtual ~CSynapseClientModel() { } +extern "C" const char* QERPlug_GetName () +{ + return (char *) PLUGIN_NAME; +} - bool OnActivate() - { - init_filetypes(); // see todo list above. - return true; - } -}; +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) +{ + // NOTE: this never happens in a module + if(!strcmp(p, "About...")) + g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); +} + +// ============================================================================= +// SYNAPSE CSynapseServer* g_pSynapseServer = NULL; CSynapseClientModel g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); @@ -197,12 +245,22 @@ bool CSynapseClientModel::RequestAPI(APIDescriptor_t *pAPI) { _QERPlugModelTable* pTable= static_cast<_QERPlugModelTable*>(pAPI->mpTable); - if (!strcmp(pAPI->minor_name, "sprite")) + if (model_is_supported(pAPI->minor_name)) // see todo list above. { pTable->m_pfnLoadModel = &LoadSpriteModel; return true; } } + else 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; + } Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); return false; diff --git a/plugins/spritemodel/plugin.h b/plugins/spritemodel/plugin.h index ec2b3995..5dca12ee 100644 --- a/plugins/spritemodel/plugin.h +++ b/plugins/spritemodel/plugin.h @@ -1,5 +1,6 @@ /* -Copyright (C) 2002 Dominic Clifton. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -29,19 +30,49 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "mathlib.h" -#include -#include "qertypes.h" +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +/*! +\todo not sure about what should be used for common data structures, GLib or STL +I think STL would be better since I intend on using STL in synapse +*/ + #include +#include "synapse.h" +#include "iplugin.h" #define USE_QERTABLE_DEFINE #include "qerplugin.h" -extern _QERFuncTable_1 __QERTABLENAME; - -#define USE_QGLTABLE_DEFINE -#include "igl.h" -extern OpenGLBinding __QGLTABLENAME; - #include "imodel.h" +#include "igl.h" +#include "ifilesystem.h" +#include "ishaders.h" + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERShadersTable g_ShadersTable; + +#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName +#define QERApp_Try_Shader_ForName g_ShadersTable.m_pfnTry_Shader_ForName + +void LoadSpriteModel(entity_interfaces_t *interfaces, const char *name); + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientModel : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientModel() { } + virtual ~CSynapseClientModel() { } +}; + #endif // _PLUGIN_H_ diff --git a/plugins/spritemodel/spritemodel.cpp b/plugins/spritemodel/spritemodel.cpp index a936cd3b..411f377d 100644 --- a/plugins/spritemodel/spritemodel.cpp +++ b/plugins/spritemodel/spritemodel.cpp @@ -1,5 +1,6 @@ /* -Copyright (C) 2002 Dominic Clifton. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -37,7 +38,7 @@ void LoadSpriteModel(entity_interfaces_t *interfaces, const char *name) if (!pShader) { Sys_Printf("ERROR: can't find shader (or image) for: %s\n", name ); - return;// NULL; + return; } CSpriteModel *model = new CSpriteModel(); @@ -140,14 +141,14 @@ void CSpriteModel::Draw(int state, int rflags) const // so draw it using y/z instead. g_QglTable.m_pfn_qglBegin(GL_QUADS); - g_QglTable.m_pfn_qglTexCoord2f(0.0f, 0.0f); - g_QglTable.m_pfn_qglVertex3f(0.0f, static_cast(w), static_cast(h)); - g_QglTable.m_pfn_qglTexCoord2f(1.0f, 0.0f); - g_QglTable.m_pfn_qglVertex3f(0.0f, 0.0f - static_cast(w), static_cast(h)); - g_QglTable.m_pfn_qglTexCoord2f(1.0f, 1.0f); - g_QglTable.m_pfn_qglVertex3f(0.0f, 0.0f - static_cast(w), 0.0f - static_cast(h)); - g_QglTable.m_pfn_qglTexCoord2f(0.0f, 0.0f); - g_QglTable.m_pfn_qglVertex3f(0.0f, static_cast(w), 0.0f - static_cast(h)); + g_QglTable.m_pfn_qglTexCoord2f (0,0); + g_QglTable.m_pfn_qglVertex3f (0,w,h); + g_QglTable.m_pfn_qglTexCoord2f (1,0); + g_QglTable.m_pfn_qglVertex3f (0,0-w,h); + g_QglTable.m_pfn_qglTexCoord2f (1,1); + g_QglTable.m_pfn_qglVertex3f (0,0-w,0-h); + g_QglTable.m_pfn_qglTexCoord2f (0,1); + g_QglTable.m_pfn_qglVertex3f (0,w,0-h); g_QglTable.m_pfn_qglEnd (); #endif diff --git a/plugins/spritemodel/spritemodel.h b/plugins/spritemodel/spritemodel.h index 899efaf6..c6c26305 100644 --- a/plugins/spritemodel/spritemodel.h +++ b/plugins/spritemodel/spritemodel.h @@ -1,5 +1,6 @@ /* -Copyright (C) 2002 Dominic Clifton. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -54,6 +55,3 @@ private: int refCount; aabb_t m_BBox; }; - -void LoadSpriteModel(entity_interfaces_t *interfaces, const char *name); - diff --git a/plugins/spritemodel/spritemodel.vcproj b/plugins/spritemodel/spritemodel.vcproj index de9010f5..da6392f4 100644 --- a/plugins/spritemodel/spritemodel.vcproj +++ b/plugins/spritemodel/spritemodel.vcproj @@ -1,186 +1,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/jpeg6/.cvsignore b/plugins/surface/.cvsignore similarity index 60% rename from libs/jpeg6/.cvsignore rename to plugins/surface/.cvsignore index face6ad3..af3ce37b 100644 --- a/libs/jpeg6/.cvsignore +++ b/plugins/surface/.cvsignore @@ -1,8 +1,11 @@ +*.d +*.o +*.so Debug Release -*.ncb -*.opt +*.aps *.plg -*.001 +*.bak *.BAK -.consign +*.opt +*.ncb diff --git a/plugins/surface/surface.def b/plugins/surface/surface.def new file mode 100644 index 00000000..23328e4a --- /dev/null +++ b/plugins/surface/surface.def @@ -0,0 +1,8 @@ +; surface.def : Declares the module parameters for the DLL. + +LIBRARY "SURFACE" +DESCRIPTION 'SURFACE Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/surface/surface.vcproj b/plugins/surface/surface.vcproj new file mode 100644 index 00000000..4c588cf5 --- /dev/null +++ b/plugins/surface/surface.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp new file mode 100644 index 00000000..16d721e5 --- /dev/null +++ b/plugins/surface/surfacedialog.cpp @@ -0,0 +1,1925 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Surface Dialog Module +// + +// +// Nurail: Implemented to Module from the main Radiant Surface Dialog code +// + + +#include +#include + +#include "surfdlg_plugin.h" + + + +#ifdef _DEBUG +//#define DBG_SI 1 +#endif + +#include "gtkr_vector.h" + +vector g_texdef_face_vector; + +inline texdef_to_face_t* get_texdef_face_list() +{ + return &(*g_texdef_face_vector.begin()); +} + +inline unsigned int texdef_face_list_empty() +{ + return g_texdef_face_vector.empty(); +} + +inline unsigned int texdef_face_list_size() +{ + return g_texdef_face_vector.size(); +} + +// For different faces having different values +bool is_HShift_conflicting; +bool is_VShift_conflicting; +bool is_HScale_conflicting; +bool is_VScale_conflicting; +bool is_Rotate_conflicting; +bool is_TextureName_conflicting; + +void ShowDlg(); +void HideDlg(); +void SetTexMods(); +void GetTexMods(bool b_SetUndoPoint = FALSE); +void BuildDialog(); +void FitAll(); +void InitDefaultIncrement(texdef_t *); +void DoSnapTToGrid(float hscale, float vscale); +// called to perform a fitting from the outside (shortcut key) +void SurfaceDialogFitAll(); + + +// Dialog Data +int m_nHeight; +int m_nWidth; + +// 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for +int m_nUndoId; + + +texturewin_t *texturewin; +texdef_t *l_pIncrement; +texdef_t texdef_offset; +texdef_t texdef_SI_values; + +// For Texture Entry, activate only on entry change +char old_texture_entry[128]; + +// the texdef to switch back to when the OnCancel is called +texdef_t g_old_texdef; + +// when TRUE, this thing means the surface inspector is currently being displayed +bool g_surfwin = FALSE; +// turn on/off processing of the "changed" "value_changed" messages +// (need to turn off when we are feeding data in) +bool g_bListenChanged = true; +// turn on/off listening of the update messages +bool g_bListenUpdate = true; + +GtkWidget* create_SurfaceInspector (void); +GtkWidget *SurfaceInspector = NULL; + +GtkWidget *m_pWidget; +GtkWidget *GetWidget () { return SurfaceInspector; } +GtkWidget *Get_SI_Module_Widget () { return SurfaceInspector; } +void SetWidget(GtkWidget *new_widget) { m_pWidget = new_widget; } +GtkWidget *GetDlgWidget (const char* name) + { return GTK_WIDGET (g_object_get_data (G_OBJECT (SurfaceInspector), name)); } + +// Spins for FitTexture +GtkWidget *spin_width; +GtkWidget *spin_height; + + +GtkWidget *texture_combo; +GtkWidget *texture_combo_entry; + +GtkWidget *match_grid_button; +GtkWidget *lock_valuechange_togglebutton; + +GtkObject *hshift_value_spinbutton_adj; +GtkWidget *hshift_value_spinbutton; +GtkObject *vshift_value_spinbutton_adj; +GtkWidget *vshift_value_spinbutton; +GtkObject *hscale_value_spinbutton_adj; +GtkWidget *hscale_value_spinbutton; +GtkObject *vscale_value_spinbutton_adj; +GtkWidget *vscale_value_spinbutton; +GtkObject *rotate_value_spinbutton_adj; +GtkWidget *rotate_value_spinbutton; + +GtkObject *hshift_offset_spinbutton_adj; +GtkWidget *hshift_offset_spinbutton; +GtkObject *vshift_offset_spinbutton_adj; +GtkWidget *vshift_offset_spinbutton; +GtkObject *hscale_offset_spinbutton_adj; +GtkWidget *hscale_offset_spinbutton; +GtkObject *vscale_offset_spinbutton_adj; +GtkWidget *vscale_offset_spinbutton; +GtkObject *rotate_offset_spinbutton_adj; +GtkWidget *rotate_offset_spinbutton; + +GtkObject *hshift_step_spinbutton_adj; +GtkWidget *hshift_step_spinbutton; +GtkObject *vshift_step_spinbutton_adj; +GtkWidget *vshift_step_spinbutton; +GtkObject *hscale_step_spinbutton_adj; +GtkWidget *hscale_step_spinbutton; +GtkObject *vscale_step_spinbutton_adj; +GtkWidget *vscale_step_spinbutton; +GtkObject *rotate_step_spinbutton_adj; +GtkWidget *rotate_step_spinbutton; + +GtkObject *fit_width_spinbutton_adj; +GtkWidget *fit_width_spinbutton; +GtkObject *fit_height_spinbutton_adj; +GtkWidget *fit_height_spinbutton; +GtkWidget *fit_button; +GtkWidget *axial_button; + +GtkWidget *done_button; +GtkWidget *apply_button; +GtkWidget *cancel_button; + +// Callbacks +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data); +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data); + +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data); +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_button_clicked (GtkButton *button, gpointer user_data); +static void on_axial_button_clicked (GtkButton *button, gpointer user_data); + +static void on_done_button_clicked (GtkButton *button, gpointer user_data); +static void on_apply_button_clicked (GtkButton *button, gpointer user_data); +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data); + + +/* +=================================================== + + SURFACE INSPECTOR + +=================================================== +*/ + + +void IsFaceConflicting() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char buf[12]; + char texture_name[128]; + + if (texdef_face_list_empty()) + { + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (texture_combo_entry), ""); + return; + } + + g_bListenChanged = FALSE; + + tmp_texdef = &get_texdef_face_list()->texdef; + + strcpy(texture_name, tmp_texdef->GetName() ); + + texdef_SI_values.shift[0] = tmp_texdef->shift[0]; + texdef_SI_values.shift[1] = tmp_texdef->shift[1]; + texdef_SI_values.scale[0] = tmp_texdef->scale[0]; + texdef_SI_values.scale[1] = tmp_texdef->scale[1]; + texdef_SI_values.rotate = tmp_texdef->rotate; + texdef_SI_values.SetName( texture_name ); + + is_HShift_conflicting = FALSE; + is_VShift_conflicting = FALSE; + is_HScale_conflicting = FALSE; + is_VScale_conflicting = FALSE; + is_Rotate_conflicting = FALSE; + is_TextureName_conflicting = FALSE; + + if (texdef_face_list_size() > 1) + { + temp_texdef_face_list = get_texdef_face_list()->next; + + for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] ) + is_HShift_conflicting = TRUE; + + if ( texdef_SI_values.shift[1] != tmp_texdef->shift[1] ) + is_VShift_conflicting = TRUE; + + if ( texdef_SI_values.scale[0] != tmp_texdef->scale[0] ) + is_HScale_conflicting = TRUE; + + if ( texdef_SI_values.scale[1] != tmp_texdef->scale[1] ) + is_VScale_conflicting = TRUE; + + if ( texdef_SI_values.rotate != tmp_texdef->rotate ) + is_Rotate_conflicting = TRUE; + + if ( strcmp( texture_name, tmp_texdef->GetName() ) ) + is_TextureName_conflicting = TRUE; + } + } + + if(is_HShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hshift_value_spinbutton) , texdef_SI_values.shift[0] ); + + if(is_VShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vshift_value_spinbutton) , texdef_SI_values.shift[1] ); + + if(is_HScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hscale_value_spinbutton) , texdef_SI_values.scale[0] ); + + if(is_VScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vscale_value_spinbutton) , texdef_SI_values.scale[1] ); + + if(is_Rotate_conflicting) + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(rotate_value_spinbutton) , texdef_SI_values.rotate ); + + g_bListenChanged = TRUE; +} + +#define MAX_NUM_LIST_ITEMS 15 +static void PopulateTextureComboList() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char blank[1]; + GList *items = NULL; + GList *tmp_item; + int num_of_list_items = 0; + + blank[0] = 0; + + if (texdef_face_list_empty()) + { + items = g_list_append (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + else if ( !is_TextureName_conflicting ) + { + temp_texdef_face_list = get_texdef_face_list(); + tmp_texdef = (texdef_t *) &get_texdef_face_list()->texdef; + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, tmp_texdef->GetName()); + } + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + // Need to do a string compare, hence the custom search + if (!( g_list_find_custom (items, tmp_texdef->GetName(), (GCompareFunc) strcmp ) )) + { + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + num_of_list_items++; + } + // Make sure the combo list isn't too long + if (num_of_list_items >= MAX_NUM_LIST_ITEMS) + break; + } + // If this isn't added last (to the top of the list), g_list_find freaks. + items = g_list_prepend (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (texture_combo), items); + g_list_free(items); + +} + +static void ZeroOffsetValues() +{ + texdef_offset.shift[0] = 0.0; + texdef_offset.shift[1] = 0.0; + texdef_offset.scale[0] = 0.0; + texdef_offset.scale[1] = 0.0; + texdef_offset.rotate = 0.0; +} + +static void GetTexdefInfo_from_Radiant() +{ + g_texdef_face_vector.clear(); + + unsigned int count = GetSelectedFaceCountfromBrushes(); + if(count == 0) + count = GetSelectedFaceCount(); + + g_texdef_face_vector.resize(count); + + if (!texdef_face_list_empty()) + { + texdef_to_face_t* p = get_texdef_face_list(); + GetSelFacesTexdef( get_texdef_face_list() ); + } + + IsFaceConflicting(); + PopulateTextureComboList(); + ZeroOffsetValues(); +} + +static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data) +{ + HideDlg(); + return TRUE; +} + +// make the shift increments match the grid settings +// the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size +// this depends on a scale value if you have selected a particular texture on which you want it to work: +// we move the textures in pixels, not world units. (i.e. increment values are in pixel) +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize +// increment * scale = gridsize +// hscale and vscale are optional parameters, if they are zero they will be set to the default scale +// NOTE: the default scale depends if you are using BP mode or regular. +// For regular it's 0.5f (128 pixels cover 64 world units), for BP it's simply 1.0f +// see fenris #2810 +void DoSnapTToGrid(float hscale, float vscale) +{ + l_pIncrement = Get_SI_Inc(); + + if (hscale == 0.0f) + { + hscale = 0.5f; + } + if (vscale == 0.0f) + { + vscale = 0.5f; + } +#ifdef _DEBUG + Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale); +#endif + l_pIncrement->shift[0] = GridSize() / hscale; + l_pIncrement->shift[1] = GridSize() / vscale; + // now some update work + // FIXME: doesn't look good here, seems to be called several times + SetTexMods(); +} + +void UpdateSurfaceDialog() +{ + if (!g_bListenUpdate) + return; + + if (!SurfaceInspector) + return; + + // avoid long delays on slow computers + while (gtk_events_pending ()) + gtk_main_iteration (); + + if (g_surfwin) + { +#ifdef DBG_SI + Sys_Printf("UpdateSurfaceDialog\n"); +#endif + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } + +} + +// DoSurface will always try to show the surface inspector +// or update it because something new has been selected +void DoSurface (void) +{ +#ifdef DBG_SI + Sys_Printf("DoSurface\n"); +#endif + if (!SurfaceInspector) + create_SurfaceInspector (); + + ShowDlg(); + SetTexMods (); +} + +void ToggleSurface() +{ +#ifdef DBG_SI + Sys_Printf("ToggleSurface Module\n"); +#endif + if (!g_surfwin) + DoSurface (); + else + on_cancel_button_clicked(NULL, NULL); +} + +// NOTE: will raise and show the Surface inspector and exec fit for patches and brushes +void SurfaceDlgFitAll() +{ + DoSurface(); + FitAll(); +} + +// ============================================================================= +// SurfaceDialog class + +void ShowDlg() +{ + + if(!SurfaceInspector) + create_SurfaceInspector(); + else + gtk_widget_show (SurfaceInspector); + + GetTexdefInfo_from_Radiant(); + GetTexMods(TRUE); // Set Initial Undo Point + g_surfwin = TRUE; +} + +void HideDlg() +{ + g_surfwin = FALSE; + gtk_widget_hide (SurfaceInspector); +} + + +// set default values for increments (shift scale and rot) +// this is called by the prefs code if can't find the values +void InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName("foo"); + tex->shift[0] = 8; + tex->shift[1] = 8; + tex->scale[0] = 0.25; + tex->scale[1] = 0.25; + tex->rotate = 10; +} + +void BuildDialog () +{ + if ( !SurfaceInspector ) + create_SurfaceInspector(); +} + +/* +============== +SetTexMods + +Set the fields to the current texdef (i.e. map/texdef -> dialog widgets) +=============== +*/ + +void SetTexMods() +{ + texdef_t *pt; + GtkSpinButton *spin; + GtkAdjustment *adjust; + + texturewin = Texturewin (); + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg SetTexMods\n"); +#endif + + if (!g_surfwin) + return; + + pt = &texturewin->texdef; + + g_bListenChanged = false; + + if(strncmp(pt->GetName(), "textures/", 9) != 0) + texdef_offset.SetName(SHADER_NOT_FOUND); + + + spin = GTK_SPIN_BUTTON (hshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hshift_step_spinbutton), l_pIncrement->shift[0]); + + spin = GTK_SPIN_BUTTON (hshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + + + spin = GTK_SPIN_BUTTON (vshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vshift_step_spinbutton), l_pIncrement->shift[1]); + + spin = GTK_SPIN_BUTTON (vshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + + + spin = GTK_SPIN_BUTTON (hscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hscale_step_spinbutton), l_pIncrement->scale[0]); + + spin = GTK_SPIN_BUTTON (hscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + + + spin = GTK_SPIN_BUTTON (vscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vscale_step_spinbutton), l_pIncrement->scale[1]); + + spin = GTK_SPIN_BUTTON (vscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + + + spin = GTK_SPIN_BUTTON (rotate_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.rotate); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(rotate_step_spinbutton), l_pIncrement->rotate); + + spin = GTK_SPIN_BUTTON (rotate_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + + + g_bListenChanged = true; + + // store the current texdef as our escape route if user hits OnCancel + g_old_texdef = texturewin->texdef; +} + +/* +============== +GetTexMods + +Shows any changes to the main Radiant windows +=============== +*/ +void GetTexMods(bool b_SetUndoPoint) +{ + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg GetTexMods\n"); +#endif + + if ( !texdef_face_list_empty() ) + { + g_bListenUpdate=FALSE; + SetTexdef_FaceList( get_texdef_face_list(), b_SetUndoPoint, false ); + g_bListenUpdate=TRUE; + + if (b_SetUndoPoint) + m_nUndoId = Undo_GetUndoId(); + } +} + +void FitAll() +{ + on_fit_button_clicked(NULL, NULL); +} + + +//////////////////////////////////////////////////////////////////// +// +// GUI Section +// +//////////////////////////////////////////////////////////////////// + +GtkWidget* create_SurfaceInspector (void) +{ + + GtkWidget *label; + GtkWidget *hseparator; + GtkWidget *eventbox; + + GtkWidget *viewport8; + GtkWidget *viewport9; + GtkWidget *viewport2; + GtkWidget *viewport7; + GtkWidget *viewport5; + GtkWidget *viewport6; + GtkWidget *viewport10; + + GtkWidget *table1; + GtkWidget *table4; + GtkWidget *table5; + GtkWidget *table7; + + GtkWidget *alignment1; + GtkWidget *alignment2; + GtkWidget *alignment3; + + GtkWidget *vbox7; + + GtkWidget *hbox1; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hbox4; + + GtkWidget *image1; + GtkWidget *image2; + GtkWidget *image3; + + GtkWidget *hbuttonbox1; + + SurfaceInspector = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (SurfaceInspector), 4); + gtk_window_set_title (GTK_WINDOW (SurfaceInspector), "Surface Inspector"); + + SetWinPos_from_Prefs(SurfaceInspector); + + viewport8 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport8); + gtk_container_add (GTK_CONTAINER (SurfaceInspector), viewport8); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport8), GTK_SHADOW_NONE); + + vbox7 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox7); + gtk_container_add (GTK_CONTAINER (viewport8), vbox7); + + viewport9 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport9); + gtk_box_pack_start (GTK_BOX (vbox7), viewport9, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport9), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport9), GTK_SHADOW_ETCHED_IN); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_container_add (GTK_CONTAINER (viewport9), hbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbox1), 4); + + label = gtk_label_new ("Texture: "); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + texture_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (texture_combo)->popwin), + "KeepMeAround", texture_combo); + gtk_combo_disable_activate ( (GtkCombo*) texture_combo); + gtk_widget_show (texture_combo); + gtk_box_pack_start (GTK_BOX (hbox1), texture_combo, TRUE, TRUE, 0); + + texture_combo_entry = GTK_COMBO (texture_combo)->entry; + gtk_widget_show (texture_combo_entry); + gtk_entry_set_max_length (GTK_ENTRY (texture_combo_entry), 128); + + viewport2 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport2); + gtk_box_pack_start (GTK_BOX (vbox7), viewport2, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport2), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport2), GTK_SHADOW_ETCHED_IN); + + table1 = gtk_table_new (13, 4, FALSE); + gtk_widget_show (table1); + gtk_container_add (GTK_CONTAINER (viewport2), table1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Offset"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 3, 4, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + match_grid_button = gtk_button_new_with_mnemonic ("Match Grid"); + gtk_widget_show (match_grid_button); + gtk_container_add (GTK_CONTAINER (eventbox), match_grid_button); + + label = gtk_label_new ("Value"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new (" H Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 10, 11, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Rotate: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("H Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 1, 2, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + lock_valuechange_togglebutton = gtk_toggle_button_new_with_mnemonic ("UNLOCK"); + gtk_widget_show (lock_valuechange_togglebutton); + gtk_container_add (GTK_CONTAINER (eventbox), lock_valuechange_togglebutton); + + // Value Spins + hshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_value_spinbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), FALSE ); + + vshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_value_spinbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), FALSE ); + + hscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_value_spinbutton, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), FALSE ); + + vscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_value_spinbutton, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), FALSE ); + + rotate_value_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_value_spinbutton_adj), 1, 0); + gtk_widget_show (rotate_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_value_spinbutton, 1, 2, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), FALSE ); + + // Offset Spins + hshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (hshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_offset_spinbutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + + vshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (vshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_offset_spinbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + + hscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (hscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_offset_spinbutton, 2, 3, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + + vscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (vscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_offset_spinbutton, 2, 3, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + + rotate_offset_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_offset_spinbutton_adj), 0, 2); + gtk_widget_show (rotate_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_offset_spinbutton, 2, 3, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + + // Step Spins + hshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_step_spinbutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + vshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_step_spinbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + hscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_step_spinbutton, 3, 4, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + vscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_step_spinbutton, 3, 4, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + rotate_step_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_step_spinbutton_adj), 1, 2); + gtk_widget_show (rotate_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_step_spinbutton, 3, 4, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_step_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 2, 3, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + viewport7 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport7); + gtk_box_pack_start (GTK_BOX (vbox7), viewport7, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport7), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport7), GTK_SHADOW_ETCHED_IN); + + table4 = gtk_table_new (4, 7, FALSE); + gtk_widget_show (table4); + gtk_container_add (GTK_CONTAINER (viewport7), table4); + + viewport5 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport5); + gtk_table_attach (GTK_TABLE (table4), viewport5, 1, 7, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport5), 6); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport5), GTK_SHADOW_ETCHED_OUT); + + table5 = gtk_table_new (2, 3, FALSE); + gtk_widget_show (table5); + gtk_container_add (GTK_CONTAINER (viewport5), table5); + gtk_container_set_border_width (GTK_CONTAINER (table5), 5); + gtk_table_set_col_spacings (GTK_TABLE (table5), 2); + + label = gtk_label_new ("Height"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + label = gtk_label_new ("Width"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + fit_width_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_width_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_width_spinbutton_adj), 1, 0); + gtk_widget_show (fit_width_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_width_spinbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_width_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_width_spinbutton), GTK_UPDATE_IF_VALID); + + fit_height_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_height_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_height_spinbutton_adj), 1, 0); + gtk_widget_show (fit_height_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_height_spinbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 3, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_height_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_height_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 0); + + fit_button = gtk_button_new_with_mnemonic (" Fit "); + gtk_widget_show (fit_button); + gtk_container_add (GTK_CONTAINER (eventbox), fit_button); + + viewport6 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport6); + gtk_table_attach (GTK_TABLE (table4), viewport6, 0, 1, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport6), 4); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport6), GTK_SHADOW_NONE); + + table7 = gtk_table_new (2, 1, FALSE); + gtk_widget_show (table7); + gtk_container_add (GTK_CONTAINER (viewport6), table7); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table7), eventbox, 0, 1, 0, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + axial_button = gtk_button_new_with_mnemonic ("Axial"); + gtk_widget_show (axial_button); + gtk_container_add (GTK_CONTAINER (eventbox), axial_button); + gtk_widget_set_size_request (axial_button, 56, 29); + gtk_container_set_border_width (GTK_CONTAINER (axial_button), 4); + + viewport10 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport10); + gtk_box_pack_start (GTK_BOX (vbox7), viewport10, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport10), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport10), GTK_SHADOW_ETCHED_IN); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_container_add (GTK_CONTAINER (viewport10), hbuttonbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD); + + done_button = gtk_button_new (); + gtk_widget_show (done_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), done_button); + GTK_WIDGET_SET_FLAGS (done_button, GTK_CAN_DEFAULT); + + alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment1); + gtk_container_add (GTK_CONTAINER (done_button), alignment1); + + hbox2 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox2); + gtk_container_add (GTK_CONTAINER (alignment1), hbox2); + + image1 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image1); + gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Done"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + apply_button = gtk_button_new (); + gtk_widget_show (apply_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_button); + GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); + + alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (apply_button), alignment3); + + hbox4 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox4); + gtk_container_add (GTK_CONTAINER (alignment3), hbox4); + + image3 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image3); + gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Apply"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + cancel_button = gtk_button_new (); + gtk_widget_show (cancel_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_button); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment2); + gtk_container_add (GTK_CONTAINER (cancel_button), alignment2); + + hbox3 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox3); + gtk_container_add (GTK_CONTAINER (alignment2), hbox3); + + image2 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image2); + gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Cancel"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + + g_signal_connect ( (gpointer) SurfaceInspector, + "delete_event", + G_CALLBACK (delete_event_callback), + NULL ); + g_signal_connect ((gpointer) SurfaceInspector, "destroy", + G_CALLBACK (gtk_widget_destroy), + NULL); + + g_signal_connect ((gpointer) texture_combo_entry, "key_press_event", + G_CALLBACK (on_texture_combo_entry_key_press_event), + NULL); + g_signal_connect ((gpointer) texture_combo_entry, "activate", + G_CALLBACK (on_texture_combo_entry_activate), + NULL); + + + g_signal_connect ((gpointer) hshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_hshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_vshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_hscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_vscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_offset_spinbutton, "value_changed", + G_CALLBACK (on_rotate_offset_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_value_spinbutton, "value_changed", + G_CALLBACK (on_hshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_value_spinbutton, "value_changed", + G_CALLBACK (on_vshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_value_spinbutton, "value_changed", + G_CALLBACK (on_hscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_value_spinbutton, "value_changed", + G_CALLBACK (on_vscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_value_spinbutton, "value_changed", + G_CALLBACK (on_rotate_value_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_step_spinbutton, "value_changed", + G_CALLBACK (on_hshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_step_spinbutton, "value_changed", + G_CALLBACK (on_vshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_step_spinbutton, "value_changed", + G_CALLBACK (on_hscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_step_spinbutton, "value_changed", + G_CALLBACK (on_vscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_step_spinbutton, "value_changed", + G_CALLBACK (on_rotate_step_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) match_grid_button, "clicked", + G_CALLBACK (on_match_grid_button_clicked), + NULL); + g_signal_connect ((gpointer) lock_valuechange_togglebutton, "toggled", + G_CALLBACK (on_lock_valuechange_togglebutton_toggled), + NULL); + + g_signal_connect ((gpointer) fit_width_spinbutton, "value_changed", + G_CALLBACK (on_fit_width_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_height_spinbutton, "value_changed", + G_CALLBACK (on_fit_height_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_button, "clicked", + G_CALLBACK (on_fit_button_clicked), + NULL); + + g_signal_connect ((gpointer) axial_button, "clicked", + G_CALLBACK (on_axial_button_clicked), + NULL); + + g_signal_connect ((gpointer) done_button, "clicked", + G_CALLBACK (on_done_button_clicked), + NULL); + g_signal_connect ((gpointer) apply_button, "clicked", + G_CALLBACK (on_apply_button_clicked), + NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_cancel_button_clicked), + NULL); + + + return SurfaceInspector; +} + + +// Texture Combo +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, + gpointer user_data) +{ + // Have Tab activate selection as well as Return + if (event->keyval == GDK_Tab) + g_signal_emit_by_name ( texture_combo_entry, "activate" ); + + return FALSE; +} + +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + char text[128] = { 0 }; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + // activate only on entry change + strcpy( text, gtk_entry_get_text(entry)); + if ( strcmp( old_texture_entry, text )) + { + // Check for spaces in shader name + if (text[0] <= ' ' || strchr(text, ' ')) + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text); + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + strcpy( old_texture_entry, text ); + tmp_texdef->SetName( text ); + } + GetTexMods(); + } + } + } +} + +// Offset Spins +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HShift_conflicting) + tmp_texdef->shift[0] = tmp_orig_texdef->shift[0] + texdef_offset.shift[0]; + else + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + } + GetTexMods(); + } +} + +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VShift_conflicting) + tmp_texdef->shift[1] = tmp_orig_texdef->shift[1] + texdef_offset.shift[1]; + else + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + } + GetTexMods(); + } + +} + +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HScale_conflicting) + tmp_texdef->scale[0] = tmp_orig_texdef->scale[0] + texdef_offset.scale[0]; + else + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + } + GetTexMods(); + } + + +} + +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VScale_conflicting) + tmp_texdef->scale[1] = tmp_orig_texdef->scale[1] + texdef_offset.scale[1]; + else + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + } + GetTexMods(); + } + +} + +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_Rotate_conflicting) + tmp_texdef->rotate = tmp_orig_texdef->rotate + texdef_offset.rotate; + else + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + } + GetTexMods(); + } + +} + + +// Match Grid +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data) +{ + float hscale, vscale; + + if( !strcmp(gtk_entry_get_text (GTK_ENTRY (hscale_value_spinbutton)), "") ) + hscale = 0.0; + else + hscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if( !strcmp( gtk_entry_get_text (GTK_ENTRY (vscale_value_spinbutton)), "") ) + vscale = 0.0; + else + vscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + DoSnapTToGrid (hscale, vscale); +} + + +// Lock out changes to Value +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + bool is_Locked; + + is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton)); + + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), is_Locked ); +} + + +// Value Spins +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + is_HShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + is_VShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + is_HScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + is_VScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + is_Rotate_conflicting = FALSE; + } + GetTexMods(); + } +} + + +// Step Spins +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[0] = val; +} + +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged VShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[1] = val; +} + +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[0] = val; +} + +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[1] = val; +} + +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->rotate = val; +} + + +// Fit Texture +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nWidth = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_width_spinbutton) ); +} + +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nHeight = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_height_spinbutton) ); +} + +static void on_fit_button_clicked (GtkButton *button, gpointer user_data) +{ + FaceList_FitTexture(get_texdef_face_list(), m_nHeight, m_nWidth); + Sys_UpdateWindows(W_ALL); +} + + +// Axial Button +static void on_axial_button_clicked (GtkButton *button, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_texdef->shift[0] = 0.0; + tmp_texdef->shift[1] = 0.0; + tmp_texdef->scale[0] = 0.5; + tmp_texdef->scale[1] = 0.5; + tmp_texdef->rotate = 0.0; + } + } + + SetTexdef_FaceList( get_texdef_face_list(), FALSE, TRUE ); + Sys_UpdateWindows(W_ALL); +} + + +// Action Buttons +static void on_done_button_clicked (GtkButton *button, gpointer user_data) +{ + if ( !texdef_face_list_empty() ) + GetTexMods(TRUE); + HideDlg(); + Sys_UpdateWindows(W_ALL); +} + +static void on_apply_button_clicked (GtkButton *button, gpointer user_data) +{ + if (!g_bListenChanged) + return; + if ( !texdef_face_list_empty() ) + { + GetTexMods (TRUE); + Sys_UpdateWindows(W_CAMERA); + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } +} + +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data) +{ + texturewin = Texturewin (); + texturewin->texdef = g_old_texdef; + // cancel the last do if we own it + if ( (m_nUndoId == Undo_GetUndoId()) && ( m_nUndoId != 0 )) + { +#ifdef DBG_SI + Sys_Printf("OnCancel calling Undo_Undo\n"); +#endif + g_bListenUpdate = false; + Undo_Undo(TRUE); + g_bListenUpdate = true; + m_nUndoId = 0; + } + HideDlg(); +} + + diff --git a/plugins/image/pcx.h b/plugins/surface/surfacedialog.h similarity index 74% rename from plugins/image/pcx.h rename to plugins/surface/surfacedialog.h index 49f41d01..4a5b815b 100644 --- a/plugins/image/pcx.h +++ b/plugins/surface/surfacedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,12 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_PCX_H) -#define INCLUDED_PCX_H +#ifndef _SURFACEDIALOG_H_ +#define _SURFACEDIALOG_H_ -class Image; -class ArchiveFile; +void UpdateSurfaceDialog (); +void DoSurface (); +void ToggleSurface (); +void SurfaceDlgFitAll (); +GtkWidget *Get_SI_Module_Widget (); -Image* LoadPCX32(ArchiveFile& file); - -#endif +#endif // _SURFACEDIALOG_H_ diff --git a/plugins/surface/surfdlg_plugin.cpp b/plugins/surface/surfdlg_plugin.cpp new file mode 100644 index 00000000..022f34d2 --- /dev/null +++ b/plugins/surface/surfdlg_plugin.cpp @@ -0,0 +1,127 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include "surfdlg_plugin.h" +#include "surfacedialog.h" + +#include "synapse.h" + +class CSynapseClient_SurfDLG : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + bool OnActivate(); + + CSynapseClient_SurfDLG() { } + virtual ~CSynapseClient_SurfDLG() { } +}; + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; +_QERUndoTable g_UndoTable; +_QERAppSurfaceTable g_AppSurfaceTable; +_QERSelectedFaceTable g_SelectedFaceTable; +_QERShadersTable g_ShadersTable; +_QERAppShadersTable g_AppShadersTable; +_QERAppDataTable g_AppDataTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClient_SurfDLG g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(SURFACEDIALOG_MAJOR, "quake3", sizeof(_QERPlugSurfaceTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable), SYN_REQUIRE, &g_UndoTable); + g_SynapseClient.AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable), SYN_REQUIRE, &g_AppSurfaceTable); + g_SynapseClient.AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable), SYN_REQUIRE, &g_SelectedFaceTable); + g_SynapseClient.AddAPI(SHADERS_MAJOR, "*", sizeof(_QERShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable), SYN_REQUIRE, &g_AppShadersTable); + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_AppDataTable); + + return &g_SynapseClient; +} + +bool CSynapseClient_SurfDLG::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, SURFACEDIALOG_MAJOR)) + { + _QERPlugSurfaceTable* pSurfDialogTable= static_cast<_QERPlugSurfaceTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "quake3")) + { + pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface; + pSurfDialogTable->m_pfnDoSurface = &DoSurface; + pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; + pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; + pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClient_SurfDLG::GetInfo() +{ + return "Surface Dialog (Quake 3) module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClient_SurfDLG::GetName() +{ + return "surface"; +} + +bool CSynapseClient_SurfDLG::OnActivate() +{ + return true; +} diff --git a/plugins/surface/surfdlg_plugin.h b/plugins/surface/surfdlg_plugin.h new file mode 100644 index 00000000..f5391344 --- /dev/null +++ b/plugins/surface/surfdlg_plugin.h @@ -0,0 +1,94 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _SURFDLG_PLUGIN_H_ +#define _SURFDLG_PLUGIN_H_ + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "qerplugin.h" +#include "synapse.h" +#include "iselectedface.h" +#include "iundo.h" +#include "ishaders.h" +#include "mathlib.h" +#include "missing.h" +#include "idata.h" + +#include "isurfaceplugin.h" + +class SurfaceDialog : public IPluginTexdef +{ + int refCount; +public: + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () { if ( --refCount <= 0 ) delete this; } +}; + +extern _QERFuncTable_1 g_FuncTable; +extern _QERUndoTable g_UndoTable; +extern _QERAppSurfaceTable g_AppSurfaceTable; +extern _QERSelectedFaceTable g_SelectedFaceTable; +extern _QERShadersTable g_ShadersTable; +extern _QERAppShadersTable g_AppShadersTable; +extern _QERAppDataTable g_AppDataTable; + +#define GetSelectedFaceCount g_SelectedFaceTable.m_pfnGetSelectedFaceCount + +#define Undo_Undo g_UndoTable.m_pfnUndo_Undo +#define Undo_GetUndoId g_UndoTable.m_pfnUndo_GetUndoId + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf +#define Sys_UpdateWindows g_FuncTable.m_pfnSysUpdateWindows + + +#define Select_FitTexture g_AppSurfaceTable.m_pfnSelect_FitTexture +#define Get_SI_Inc g_AppSurfaceTable.m_pfnQERApp_QeglobalsSavedinfo_SIInc +#define GridSize g_AppSurfaceTable.m_pfnQeglobalsGetGridSize +#define FaceList_FitTexture g_AppSurfaceTable.m_pfnFaceList_FitTexture +#define GetMainWindow g_AppSurfaceTable.m_pfnGetMainWindow +#define GetSelectedFaceCountfromBrushes g_AppSurfaceTable.m_pfnGetSelectedFaceCountfromBrushes +#define GetSelFacesTexdef g_AppSurfaceTable.m_pfnGetSelFacesTexdef +#define SetTexdef_FaceList g_AppSurfaceTable.m_pfnSetTexdef_FaceList +#define SetWinPos_from_Prefs g_AppSurfaceTable.m_pfnSetWinPos_From_Prefs + +#define Texturewin g_AppShadersTable.m_pfnQeglobalsTexturewin + +#endif // _SURFDLG_PLUGIN_H_ + diff --git a/plugins/surface_heretic2/surface_heretic2.def b/plugins/surface_heretic2/surface_heretic2.def new file mode 100644 index 00000000..7f26db48 --- /dev/null +++ b/plugins/surface_heretic2/surface_heretic2.def @@ -0,0 +1,8 @@ +; surface_heretic2.def : Declares the module parameters for the DLL. + +LIBRARY "Surface_Heretic2" +DESCRIPTION 'Surface_Heretic2 Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/surface_heretic2/surface_heretic2.vcproj b/plugins/surface_heretic2/surface_heretic2.vcproj new file mode 100644 index 00000000..27a665ed --- /dev/null +++ b/plugins/surface_heretic2/surface_heretic2.vcproj @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/surface_heretic2/surfacedialog.cpp b/plugins/surface_heretic2/surfacedialog.cpp new file mode 100644 index 00000000..7ee893aa --- /dev/null +++ b/plugins/surface_heretic2/surfacedialog.cpp @@ -0,0 +1,1940 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Surface Dialog Module +// + +// +// Nurail: Implemented to Module from the main Radiant Surface Dialog code +// + + +#include +#include + +#include "surfdlg_plugin.h" + + + +#ifdef _DEBUG +//#define DBG_SI 1 +#endif + +#include "gtkr_vector.h" + +std::vector g_texdef_face_vector; + +inline texdef_to_face_t* get_texdef_face_list() +{ + return &(*g_texdef_face_vector.begin()); +} + +inline unsigned int texdef_face_list_empty() +{ + return g_texdef_face_vector.empty(); +} + +inline unsigned int texdef_face_list_size() +{ + return g_texdef_face_vector.size(); +} + +// For different faces having different values +bool is_HShift_conflicting; +bool is_VShift_conflicting; +bool is_HScale_conflicting; +bool is_VScale_conflicting; +bool is_Rotate_conflicting; +bool is_TextureName_conflicting; + +void ShowDlg(); +void HideDlg(); +void SetTexMods(); +void GetTexMods(bool b_SetUndoPoint = FALSE); +void BuildDialog(); +void FitAll(); +void InitDefaultIncrement(texdef_t *); +void DoSnapTToGrid(float hscale, float vscale); +// called to perform a fitting from the outside (shortcut key) +void SurfaceDialogFitAll(); + +// Heretic2 Flags Functions +void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty); +void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list); +GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget); + + +// Dialog Data +int m_nHeight; +int m_nWidth; + +// 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for +int m_nUndoId; + + +texturewin_t *texturewin; +texdef_t *l_pIncrement; +texdef_t texdef_offset; +texdef_t texdef_SI_values; + +// For Texture Entry, activate only on entry change +char old_texture_entry[128]; + +// the texdef to switch back to when the OnCancel is called +texdef_t g_old_texdef; + +// when TRUE, this thing means the surface inspector is currently being displayed +bool g_surfwin = FALSE; +// turn on/off processing of the "changed" "value_changed" messages +// (need to turn off when we are feeding data in) +bool g_bListenChanged = true; +// turn on/off listening of the update messages +bool g_bListenUpdate = true; + +GtkWidget* create_SurfaceInspector (void); +GtkWidget *SurfaceInspector = NULL; + +GtkWidget *m_pWidget; +GtkWidget *GetWidget () { return SurfaceInspector; } +GtkWidget *Get_SI_Module_Widget () { return SurfaceInspector; } +void SetWidget(GtkWidget *new_widget) { m_pWidget = new_widget; } +GtkWidget *GetDlgWidget (const char* name) + { return GTK_WIDGET (g_object_get_data (G_OBJECT (SurfaceInspector), name)); } + +// Spins for FitTexture +GtkWidget *spin_width; +GtkWidget *spin_height; + + +GtkWidget *texture_combo; +GtkWidget *texture_combo_entry; + +GtkWidget *match_grid_button; +GtkWidget *lock_valuechange_togglebutton; + +GtkObject *hshift_value_spinbutton_adj; +GtkWidget *hshift_value_spinbutton; +GtkObject *vshift_value_spinbutton_adj; +GtkWidget *vshift_value_spinbutton; +GtkObject *hscale_value_spinbutton_adj; +GtkWidget *hscale_value_spinbutton; +GtkObject *vscale_value_spinbutton_adj; +GtkWidget *vscale_value_spinbutton; +GtkObject *rotate_value_spinbutton_adj; +GtkWidget *rotate_value_spinbutton; + +GtkObject *hshift_offset_spinbutton_adj; +GtkWidget *hshift_offset_spinbutton; +GtkObject *vshift_offset_spinbutton_adj; +GtkWidget *vshift_offset_spinbutton; +GtkObject *hscale_offset_spinbutton_adj; +GtkWidget *hscale_offset_spinbutton; +GtkObject *vscale_offset_spinbutton_adj; +GtkWidget *vscale_offset_spinbutton; +GtkObject *rotate_offset_spinbutton_adj; +GtkWidget *rotate_offset_spinbutton; + +GtkObject *hshift_step_spinbutton_adj; +GtkWidget *hshift_step_spinbutton; +GtkObject *vshift_step_spinbutton_adj; +GtkWidget *vshift_step_spinbutton; +GtkObject *hscale_step_spinbutton_adj; +GtkWidget *hscale_step_spinbutton; +GtkObject *vscale_step_spinbutton_adj; +GtkWidget *vscale_step_spinbutton; +GtkObject *rotate_step_spinbutton_adj; +GtkWidget *rotate_step_spinbutton; + +GtkObject *fit_width_spinbutton_adj; +GtkWidget *fit_width_spinbutton; +GtkObject *fit_height_spinbutton_adj; +GtkWidget *fit_height_spinbutton; +GtkWidget *fit_button; +GtkWidget *axial_button; + +GtkWidget *done_button; +GtkWidget *apply_button; +GtkWidget *cancel_button; + +// Callbacks +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data); +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data); + +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data); +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_button_clicked (GtkButton *button, gpointer user_data); +static void on_axial_button_clicked (GtkButton *button, gpointer user_data); + +static void on_done_button_clicked (GtkButton *button, gpointer user_data); +static void on_apply_button_clicked (GtkButton *button, gpointer user_data); +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data); + + +/* +=================================================== + + SURFACE INSPECTOR + +=================================================== +*/ + + +void IsFaceConflicting() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char buf[12]; + char texture_name[128]; + + if (texdef_face_list_empty()) + { + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (texture_combo_entry), ""); + return; + } + + g_bListenChanged = FALSE; + + tmp_texdef = &get_texdef_face_list()->texdef; + + strcpy(texture_name, tmp_texdef->GetName() ); + + texdef_SI_values.shift[0] = tmp_texdef->shift[0]; + texdef_SI_values.shift[1] = tmp_texdef->shift[1]; + texdef_SI_values.scale[0] = tmp_texdef->scale[0]; + texdef_SI_values.scale[1] = tmp_texdef->scale[1]; + texdef_SI_values.rotate = tmp_texdef->rotate; + texdef_SI_values.SetName( texture_name ); + + is_HShift_conflicting = FALSE; + is_VShift_conflicting = FALSE; + is_HScale_conflicting = FALSE; + is_VScale_conflicting = FALSE; + is_Rotate_conflicting = FALSE; + is_TextureName_conflicting = FALSE; + + if (texdef_face_list_size() > 1) + { + temp_texdef_face_list = get_texdef_face_list()->next; + + for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] ) + is_HShift_conflicting = TRUE; + + if ( texdef_SI_values.shift[1] != tmp_texdef->shift[1] ) + is_VShift_conflicting = TRUE; + + if ( texdef_SI_values.scale[0] != tmp_texdef->scale[0] ) + is_HScale_conflicting = TRUE; + + if ( texdef_SI_values.scale[1] != tmp_texdef->scale[1] ) + is_VScale_conflicting = TRUE; + + if ( texdef_SI_values.rotate != tmp_texdef->rotate ) + is_Rotate_conflicting = TRUE; + + if ( strcmp( texture_name, tmp_texdef->GetName() ) ) + is_TextureName_conflicting = TRUE; + } + } + + if(is_HShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hshift_value_spinbutton) , texdef_SI_values.shift[0] ); + + if(is_VShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vshift_value_spinbutton) , texdef_SI_values.shift[1] ); + + if(is_HScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hscale_value_spinbutton) , texdef_SI_values.scale[0] ); + + if(is_VScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vscale_value_spinbutton) , texdef_SI_values.scale[1] ); + + if(is_Rotate_conflicting) + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(rotate_value_spinbutton) , texdef_SI_values.rotate ); + + g_bListenChanged = TRUE; +} + +#define MAX_NUM_LIST_ITEMS 15 +static void PopulateTextureComboList() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char blank[1]; + GList *items = NULL; + GList *tmp_item; + int num_of_list_items = 0; + + blank[0] = 0; + + if (texdef_face_list_empty()) + { + items = g_list_append (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + else if ( !is_TextureName_conflicting ) + { + temp_texdef_face_list = get_texdef_face_list(); + tmp_texdef = (texdef_t *) &get_texdef_face_list()->texdef; + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, tmp_texdef->GetName()); + } + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + // Need to do a string compare, hence the custom search + if (!( g_list_find_custom (items, tmp_texdef->GetName(), (GCompareFunc) strcmp ) )) + { + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + num_of_list_items++; + } + // Make sure the combo list isn't too long + if (num_of_list_items >= MAX_NUM_LIST_ITEMS) + break; + } + // If this isn't added last (to the top of the list), g_list_find freaks. + items = g_list_prepend (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (texture_combo), items); + g_list_free(items); + +} + +static void ZeroOffsetValues() +{ + texdef_offset.shift[0] = 0.0; + texdef_offset.shift[1] = 0.0; + texdef_offset.scale[0] = 0.0; + texdef_offset.scale[1] = 0.0; + texdef_offset.rotate = 0.0; +} + +static void GetTexdefInfo_from_Radiant() +{ + g_texdef_face_vector.clear(); + + unsigned int count = GetSelectedFaceCountfromBrushes(); + if(count == 0) + count = GetSelectedFaceCount(); + + g_texdef_face_vector.resize(count); + + if (!texdef_face_list_empty()) + { + texdef_to_face_t* p = get_texdef_face_list(); + GetSelFacesTexdef( get_texdef_face_list() ); + } + + IsFaceConflicting(); + PopulateTextureComboList(); + ZeroOffsetValues(); + if ( texdef_face_list_empty() ) + SetFlagButtons_Heretic2( get_texdef_face_list() , TRUE); + else + SetFlagButtons_Heretic2( get_texdef_face_list() , FALSE); + +} + +static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data) +{ + HideDlg(); + return TRUE; +} + +// make the shift increments match the grid settings +// the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size +// this depends on a scale value if you have selected a particular texture on which you want it to work: +// we move the textures in pixels, not world units. (i.e. increment values are in pixel) +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize +// increment * scale = gridsize +// hscale and vscale are optional parameters, if they are zero they will be set to the default scale +// NOTE: the default scale depends if you are using BP mode or regular. +// For regular it's 0.5f (128 pixels cover 64 world units), for BP it's simply 1.0f +// see fenris #2810 +void DoSnapTToGrid(float hscale, float vscale) +{ + l_pIncrement = Get_SI_Inc(); + + if (hscale == 0.0f) + { + hscale = 0.5f; + } + if (vscale == 0.0f) + { + vscale = 0.5f; + } +#ifdef _DEBUG + Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale); +#endif + l_pIncrement->shift[0] = GridSize() / hscale; + l_pIncrement->shift[1] = GridSize() / vscale; + // now some update work + // FIXME: doesn't look good here, seems to be called several times + SetTexMods(); +} + +void UpdateSurfaceDialog() +{ + if (!g_bListenUpdate) + return; + + if (!SurfaceInspector) + return; + + // avoid long delays on slow computers + while (gtk_events_pending ()) + gtk_main_iteration (); + + if (g_surfwin) + { +#ifdef DBG_SI + Sys_Printf("UpdateSurfaceDialog\n"); +#endif + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } + +} + +// DoSurface will always try to show the surface inspector +// or update it because something new has been selected +void DoSurface (void) +{ +#ifdef DBG_SI + Sys_Printf("DoSurface\n"); +#endif + if (!SurfaceInspector) + create_SurfaceInspector (); + + ShowDlg(); + SetTexMods (); +} + +void ToggleSurface() +{ +#ifdef DBG_SI + Sys_Printf("ToggleSurface Module\n"); +#endif + if (!g_surfwin) + DoSurface (); + else + on_cancel_button_clicked(NULL, NULL); +} + +// NOTE: will raise and show the Surface inspector and exec fit for patches and brushes +void SurfaceDlgFitAll() +{ + DoSurface(); + FitAll(); +} + +// ============================================================================= +// SurfaceDialog class + +void ShowDlg() +{ + + if(!SurfaceInspector) + create_SurfaceInspector(); + else + gtk_widget_show (SurfaceInspector); + + GetTexdefInfo_from_Radiant(); + GetTexMods(TRUE); // Set Initial Undo Point + g_surfwin = TRUE; +} + +void HideDlg() +{ + g_surfwin = FALSE; + gtk_widget_hide (SurfaceInspector); +} + + +// set default values for increments (shift scale and rot) +// this is called by the prefs code if can't find the values +void InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName("foo"); + tex->shift[0] = 8; + tex->shift[1] = 8; + tex->scale[0] = 0.25; + tex->scale[1] = 0.25; + tex->rotate = 10; +} + +void BuildDialog () +{ + if ( !SurfaceInspector ) + create_SurfaceInspector(); +} + +/* +============== +SetTexMods + +Set the fields to the current texdef (i.e. map/texdef -> dialog widgets) +=============== +*/ + +void SetTexMods() +{ + texdef_t *pt; + GtkSpinButton *spin; + GtkAdjustment *adjust; + + texturewin = Texturewin (); + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg SetTexMods\n"); +#endif + + if (!g_surfwin) + return; + + pt = &texturewin->texdef; + + g_bListenChanged = false; + + if(strncmp(pt->GetName(), "textures/", 9) != 0) + texdef_offset.SetName(SHADER_NOT_FOUND); + + + spin = GTK_SPIN_BUTTON (hshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hshift_step_spinbutton), l_pIncrement->shift[0]); + + spin = GTK_SPIN_BUTTON (hshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + + + spin = GTK_SPIN_BUTTON (vshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vshift_step_spinbutton), l_pIncrement->shift[1]); + + spin = GTK_SPIN_BUTTON (vshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + + + spin = GTK_SPIN_BUTTON (hscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hscale_step_spinbutton), l_pIncrement->scale[0]); + + spin = GTK_SPIN_BUTTON (hscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + + + spin = GTK_SPIN_BUTTON (vscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vscale_step_spinbutton), l_pIncrement->scale[1]); + + spin = GTK_SPIN_BUTTON (vscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + + + spin = GTK_SPIN_BUTTON (rotate_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.rotate); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(rotate_step_spinbutton), l_pIncrement->rotate); + + spin = GTK_SPIN_BUTTON (rotate_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + + + g_bListenChanged = true; + + // store the current texdef as our escape route if user hits OnCancel + g_old_texdef = texturewin->texdef; +} + +/* +============== +GetTexMods + +Shows any changes to the main Radiant windows +=============== +*/ +void GetTexMods(bool b_SetUndoPoint) +{ + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg GetTexMods\n"); +#endif + + if ( !texdef_face_list_empty() ) + { + g_bListenUpdate=FALSE; + SetChangeInFlags_Face_Heretic2 ( get_texdef_face_list() ); + SetTexdef_FaceList( get_texdef_face_list(), b_SetUndoPoint, false ); + g_bListenUpdate=TRUE; + + if (b_SetUndoPoint) + m_nUndoId = Undo_GetUndoId(); + } +} + +void FitAll() +{ + on_fit_button_clicked(NULL, NULL); +} + + +//////////////////////////////////////////////////////////////////// +// +// GUI Section +// +//////////////////////////////////////////////////////////////////// + +GtkWidget* create_SurfaceInspector (void) +{ + + GtkWidget *label; + GtkWidget *hseparator; + GtkWidget *eventbox; + + GtkWidget *viewport8; + GtkWidget *viewport9; + GtkWidget *viewport2; + GtkWidget *viewport7; + GtkWidget *viewport5; + GtkWidget *viewport6; + GtkWidget *viewport10; + + GtkWidget *table1; + GtkWidget *table4; + GtkWidget *table5; + GtkWidget *table7; + + GtkWidget *alignment1; + GtkWidget *alignment2; + GtkWidget *alignment3; + + GtkWidget *vbox7; + + GtkWidget *hbox1; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hbox4; + + GtkWidget *image1; + GtkWidget *image2; + GtkWidget *image3; + + GtkWidget *hbuttonbox1; + + SurfaceInspector = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (SurfaceInspector), 4); + gtk_window_set_title (GTK_WINDOW (SurfaceInspector), "Surface Inspector"); + + SetWinPos_from_Prefs(SurfaceInspector); + + viewport8 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport8); + gtk_container_add (GTK_CONTAINER (SurfaceInspector), viewport8); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport8), GTK_SHADOW_NONE); + + vbox7 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox7); + gtk_container_add (GTK_CONTAINER (viewport8), vbox7); + + viewport9 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport9); + gtk_box_pack_start (GTK_BOX (vbox7), viewport9, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport9), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport9), GTK_SHADOW_ETCHED_IN); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_container_add (GTK_CONTAINER (viewport9), hbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbox1), 4); + + label = gtk_label_new ("Texture: "); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + texture_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (texture_combo)->popwin), + "KeepMeAround", texture_combo); + gtk_combo_disable_activate ( (GtkCombo*) texture_combo); + gtk_widget_show (texture_combo); + gtk_box_pack_start (GTK_BOX (hbox1), texture_combo, TRUE, TRUE, 0); + + texture_combo_entry = GTK_COMBO (texture_combo)->entry; + gtk_widget_show (texture_combo_entry); + gtk_entry_set_max_length (GTK_ENTRY (texture_combo_entry), 128); + + viewport2 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport2); + gtk_box_pack_start (GTK_BOX (vbox7), viewport2, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport2), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport2), GTK_SHADOW_ETCHED_IN); + + table1 = gtk_table_new (13, 4, FALSE); + gtk_widget_show (table1); + gtk_container_add (GTK_CONTAINER (viewport2), table1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Offset"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 3, 4, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + match_grid_button = gtk_button_new_with_mnemonic ("Match Grid"); + gtk_widget_show (match_grid_button); + gtk_container_add (GTK_CONTAINER (eventbox), match_grid_button); + + label = gtk_label_new ("Value"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new (" H Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 10, 11, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Rotate: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("H Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 1, 2, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + lock_valuechange_togglebutton = gtk_toggle_button_new_with_mnemonic ("UNLOCK"); + gtk_widget_show (lock_valuechange_togglebutton); + gtk_container_add (GTK_CONTAINER (eventbox), lock_valuechange_togglebutton); + + // Value Spins + hshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_value_spinbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), FALSE ); + + vshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_value_spinbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), FALSE ); + + hscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_value_spinbutton, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), FALSE ); + + vscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_value_spinbutton, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), FALSE ); + + rotate_value_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_value_spinbutton_adj), 1, 0); + gtk_widget_show (rotate_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_value_spinbutton, 1, 2, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), FALSE ); + + // Offset Spins + hshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (hshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_offset_spinbutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + + vshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (vshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_offset_spinbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + + hscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (hscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_offset_spinbutton, 2, 3, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + + vscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (vscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_offset_spinbutton, 2, 3, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + + rotate_offset_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_offset_spinbutton_adj), 0, 2); + gtk_widget_show (rotate_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_offset_spinbutton, 2, 3, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + + // Step Spins + hshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_step_spinbutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + vshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_step_spinbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + hscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_step_spinbutton, 3, 4, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + vscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_step_spinbutton, 3, 4, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + rotate_step_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_step_spinbutton_adj), 1, 2); + gtk_widget_show (rotate_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_step_spinbutton, 3, 4, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_step_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 2, 3, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + viewport7 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport7); + gtk_box_pack_start (GTK_BOX (vbox7), viewport7, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport7), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport7), GTK_SHADOW_ETCHED_IN); + + table4 = gtk_table_new (4, 7, FALSE); + gtk_widget_show (table4); + gtk_container_add (GTK_CONTAINER (viewport7), table4); + + viewport5 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport5); + gtk_table_attach (GTK_TABLE (table4), viewport5, 1, 7, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport5), 6); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport5), GTK_SHADOW_ETCHED_OUT); + + table5 = gtk_table_new (2, 3, FALSE); + gtk_widget_show (table5); + gtk_container_add (GTK_CONTAINER (viewport5), table5); + gtk_container_set_border_width (GTK_CONTAINER (table5), 5); + gtk_table_set_col_spacings (GTK_TABLE (table5), 2); + + label = gtk_label_new ("Height"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + label = gtk_label_new ("Width"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + fit_width_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_width_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_width_spinbutton_adj), 1, 0); + gtk_widget_show (fit_width_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_width_spinbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_width_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_width_spinbutton), GTK_UPDATE_IF_VALID); + + fit_height_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_height_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_height_spinbutton_adj), 1, 0); + gtk_widget_show (fit_height_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_height_spinbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 3, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_height_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_height_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 0); + + fit_button = gtk_button_new_with_mnemonic (" Fit "); + gtk_widget_show (fit_button); + gtk_container_add (GTK_CONTAINER (eventbox), fit_button); + + viewport6 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport6); + gtk_table_attach (GTK_TABLE (table4), viewport6, 0, 1, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport6), 4); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport6), GTK_SHADOW_NONE); + + table7 = gtk_table_new (2, 1, FALSE); + gtk_widget_show (table7); + gtk_container_add (GTK_CONTAINER (viewport6), table7); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table7), eventbox, 0, 1, 0, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + axial_button = gtk_button_new_with_mnemonic ("Axial"); + gtk_widget_show (axial_button); + gtk_container_add (GTK_CONTAINER (eventbox), axial_button); + gtk_widget_set_size_request (axial_button, 56, 29); + gtk_container_set_border_width (GTK_CONTAINER (axial_button), 4); + + // Fit in Flags sub-dialog + Create_Heretic2FlagsDialog(vbox7); + + viewport10 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport10); + gtk_box_pack_start (GTK_BOX (vbox7), viewport10, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport10), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport10), GTK_SHADOW_ETCHED_IN); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_container_add (GTK_CONTAINER (viewport10), hbuttonbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD); + + done_button = gtk_button_new (); + gtk_widget_show (done_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), done_button); + GTK_WIDGET_SET_FLAGS (done_button, GTK_CAN_DEFAULT); + + alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment1); + gtk_container_add (GTK_CONTAINER (done_button), alignment1); + + hbox2 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox2); + gtk_container_add (GTK_CONTAINER (alignment1), hbox2); + + image1 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image1); + gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Done"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + apply_button = gtk_button_new (); + gtk_widget_show (apply_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_button); + GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); + + alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (apply_button), alignment3); + + hbox4 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox4); + gtk_container_add (GTK_CONTAINER (alignment3), hbox4); + + image3 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image3); + gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Apply"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + cancel_button = gtk_button_new (); + gtk_widget_show (cancel_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_button); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment2); + gtk_container_add (GTK_CONTAINER (cancel_button), alignment2); + + hbox3 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox3); + gtk_container_add (GTK_CONTAINER (alignment2), hbox3); + + image2 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image2); + gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Cancel"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + + g_signal_connect ( (gpointer) SurfaceInspector, + "delete_event", + G_CALLBACK (delete_event_callback), + NULL ); + g_signal_connect ((gpointer) SurfaceInspector, "destroy", + G_CALLBACK (gtk_widget_destroy), + NULL); + + g_signal_connect ((gpointer) texture_combo_entry, "key_press_event", + G_CALLBACK (on_texture_combo_entry_key_press_event), + NULL); + g_signal_connect ((gpointer) texture_combo_entry, "activate", + G_CALLBACK (on_texture_combo_entry_activate), + NULL); + + + g_signal_connect ((gpointer) hshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_hshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_vshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_hscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_vscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_offset_spinbutton, "value_changed", + G_CALLBACK (on_rotate_offset_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_value_spinbutton, "value_changed", + G_CALLBACK (on_hshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_value_spinbutton, "value_changed", + G_CALLBACK (on_vshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_value_spinbutton, "value_changed", + G_CALLBACK (on_hscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_value_spinbutton, "value_changed", + G_CALLBACK (on_vscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_value_spinbutton, "value_changed", + G_CALLBACK (on_rotate_value_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_step_spinbutton, "value_changed", + G_CALLBACK (on_hshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_step_spinbutton, "value_changed", + G_CALLBACK (on_vshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_step_spinbutton, "value_changed", + G_CALLBACK (on_hscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_step_spinbutton, "value_changed", + G_CALLBACK (on_vscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_step_spinbutton, "value_changed", + G_CALLBACK (on_rotate_step_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) match_grid_button, "clicked", + G_CALLBACK (on_match_grid_button_clicked), + NULL); + g_signal_connect ((gpointer) lock_valuechange_togglebutton, "toggled", + G_CALLBACK (on_lock_valuechange_togglebutton_toggled), + NULL); + + g_signal_connect ((gpointer) fit_width_spinbutton, "value_changed", + G_CALLBACK (on_fit_width_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_height_spinbutton, "value_changed", + G_CALLBACK (on_fit_height_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_button, "clicked", + G_CALLBACK (on_fit_button_clicked), + NULL); + + g_signal_connect ((gpointer) axial_button, "clicked", + G_CALLBACK (on_axial_button_clicked), + NULL); + + g_signal_connect ((gpointer) done_button, "clicked", + G_CALLBACK (on_done_button_clicked), + NULL); + g_signal_connect ((gpointer) apply_button, "clicked", + G_CALLBACK (on_apply_button_clicked), + NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_cancel_button_clicked), + NULL); + + + return SurfaceInspector; +} + + +// Texture Combo +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, + gpointer user_data) +{ + // Have Tab activate selection as well as Return + if (event->keyval == GDK_Tab) + g_signal_emit_by_name ( texture_combo_entry, "activate" ); + + return FALSE; +} + +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + char text[128] = { 0 }; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + // activate only on entry change + strcpy( text, gtk_entry_get_text(entry)); + if ( strcmp( old_texture_entry, text )) + { + // Check for spaces in shader name + if (text[0] <= ' ' || strchr(text, ' ')) + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text); + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + strcpy( old_texture_entry, text ); + tmp_texdef->SetName( text ); + } + GetTexMods(); + } + } + } +} + +// Offset Spins +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HShift_conflicting) + tmp_texdef->shift[0] = tmp_orig_texdef->shift[0] + texdef_offset.shift[0]; + else + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + } + GetTexMods(); + } +} + +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VShift_conflicting) + tmp_texdef->shift[1] = tmp_orig_texdef->shift[1] + texdef_offset.shift[1]; + else + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + } + GetTexMods(); + } + +} + +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HScale_conflicting) + tmp_texdef->scale[0] = tmp_orig_texdef->scale[0] + texdef_offset.scale[0]; + else + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + } + GetTexMods(); + } + + +} + +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VScale_conflicting) + tmp_texdef->scale[1] = tmp_orig_texdef->scale[1] + texdef_offset.scale[1]; + else + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + } + GetTexMods(); + } + +} + +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_Rotate_conflicting) + tmp_texdef->rotate = tmp_orig_texdef->rotate + texdef_offset.rotate; + else + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + } + GetTexMods(); + } + +} + + +// Match Grid +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data) +{ + float hscale, vscale; + + if( !strcmp(gtk_entry_get_text (GTK_ENTRY (hscale_value_spinbutton)), "") ) + hscale = 0.0; + else + hscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if( !strcmp( gtk_entry_get_text (GTK_ENTRY (vscale_value_spinbutton)), "") ) + vscale = 0.0; + else + vscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + DoSnapTToGrid (hscale, vscale); +} + + +// Lock out changes to Value +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + bool is_Locked; + + is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton)); + + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), is_Locked ); +} + + +// Value Spins +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + is_HShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + is_VShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + is_HScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + is_VScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + is_Rotate_conflicting = FALSE; + } + GetTexMods(); + } +} + + +// Step Spins +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[0] = val; +} + +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged VShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[1] = val; +} + +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[0] = val; +} + +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[1] = val; +} + +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->rotate = val; +} + + +// Fit Texture +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nWidth = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_width_spinbutton) ); +} + +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nHeight = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_height_spinbutton) ); +} + +static void on_fit_button_clicked (GtkButton *button, gpointer user_data) +{ + FaceList_FitTexture(get_texdef_face_list(), m_nHeight, m_nWidth); + Sys_UpdateWindows(W_ALL); +} + + +// Axial Button +static void on_axial_button_clicked (GtkButton *button, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_texdef->shift[0] = 0.0; + tmp_texdef->shift[1] = 0.0; + tmp_texdef->scale[0] = 0.5; + tmp_texdef->scale[1] = 0.5; + tmp_texdef->rotate = 0.0; + } + } + + SetTexdef_FaceList( get_texdef_face_list(), FALSE, TRUE ); + Sys_UpdateWindows(W_ALL); +} + + +// Action Buttons +static void on_done_button_clicked (GtkButton *button, gpointer user_data) +{ + if ( !texdef_face_list_empty() ) + GetTexMods(TRUE); + HideDlg(); + Sys_UpdateWindows(W_ALL); +} + +static void on_apply_button_clicked (GtkButton *button, gpointer user_data) +{ + if (!g_bListenChanged) + return; + + if ( !texdef_face_list_empty() ) + { + GetTexMods (TRUE); + Sys_UpdateWindows(W_CAMERA); + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } +} + +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data) +{ + texturewin = Texturewin (); + texturewin->texdef = g_old_texdef; + // cancel the last do if we own it + if ( (m_nUndoId == Undo_GetUndoId()) && ( m_nUndoId != 0 )) + { +#ifdef DBG_SI + Sys_Printf("OnCancel calling Undo_Undo\n"); +#endif + g_bListenUpdate = false; + Undo_Undo(TRUE); + g_bListenUpdate = true; + m_nUndoId = 0; + } + HideDlg(); +} + + diff --git a/plugins/imagehl/hlw.h b/plugins/surface_heretic2/surfacedialog.h similarity index 74% rename from plugins/imagehl/hlw.h rename to plugins/surface_heretic2/surfacedialog.h index d61136f4..4a5b815b 100644 --- a/plugins/imagehl/hlw.h +++ b/plugins/surface_heretic2/surfacedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,13 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_HLW_H) -#define INCLUDED_HLW_H +#ifndef _SURFACEDIALOG_H_ +#define _SURFACEDIALOG_H_ -class Image; -class ArchiveFile; - -Image* LoadHLW(ArchiveFile& file); - -#endif +void UpdateSurfaceDialog (); +void DoSurface (); +void ToggleSurface (); +void SurfaceDlgFitAll (); +GtkWidget *Get_SI_Module_Widget (); +#endif // _SURFACEDIALOG_H_ diff --git a/plugins/surface_heretic2/surfaceflagsdialog_heretic2.cpp b/plugins/surface_heretic2/surfaceflagsdialog_heretic2.cpp new file mode 100644 index 00000000..13e1cb4a --- /dev/null +++ b/plugins/surface_heretic2/surfaceflagsdialog_heretic2.cpp @@ -0,0 +1,1417 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include "surfdlg_plugin.h" + +#include "surfaceflagsdialog_heretic2.h" + + GtkWidget *surface_lightbutton; + GtkWidget *surface_slickbutton; + GtkWidget *surface_skybutton; + GtkWidget *surface_warpbutton; + GtkWidget *surface_trans33button; + GtkWidget *surface_trans66button; + GtkWidget *surface_flowingbutton; + GtkWidget *surface_nodrawbutton; + GtkWidget *surface_tallwallbutton; + GtkWidget *surface_alphatexbutton; + GtkWidget *surface_animspeedbutton; + GtkWidget *surface_undulatebutton; + + GtkWidget *surf_gravel_radiobutton; + GSList *surf_gravel_radiobutton_group = NULL; + GtkWidget *surf_metal_radiobutton; + GtkWidget *surf_stone_radiobutton; + GtkWidget *surf_wood_radiobutton; + + GtkWidget *surf_value_entry; + + GtkWidget *notebook1; + + GtkWidget *content_solidbutton; + GtkWidget *content_windowbutton; + GtkWidget *content_illusbutton; + GtkWidget *content_lavabutton; + GtkWidget *content_slimebutton; + GtkWidget *content_waterbutton; + GtkWidget *content_mistbutton; + GtkWidget *content_areaportalbutton; + GtkWidget *content_playerclipbutton; + GtkWidget *content_monsterclipbutton; + GtkWidget *content_current0button; + GtkWidget *content_current90button; + GtkWidget *content_current180button; + GtkWidget *content_current270button; + GtkWidget *content_currentUPbutton; + GtkWidget *content_currentDOWNbutton; + GtkWidget *content_originbutton; + GtkWidget *content_detailbutton; + GtkWidget *content_ladderbutton; + GtkWidget *content_camnoblockbutton; + + + gboolean setup_buttons = TRUE; + + int working_surface_flags; + int surface_mask; + int working_content_flags; + int content_mask; + int working_value; + gboolean surface_material_inconsistant = FALSE; + +inline void set_inconsistent(GtkWidget *toggle_button) +{ + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE); +} + +inline void clear_inconsistent(GtkWidget *toggle_button) +{ + if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) ) + { + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE); + } + +} + +void clear_all_inconsistent(void) +{ + clear_inconsistent( surface_lightbutton ); + clear_inconsistent( surface_slickbutton ); + clear_inconsistent( surface_skybutton ); + clear_inconsistent( surface_warpbutton ); + clear_inconsistent( surface_trans33button ); + clear_inconsistent( surface_trans66button ); + clear_inconsistent( surface_flowingbutton ); + clear_inconsistent( surface_nodrawbutton ); + clear_inconsistent( surface_tallwallbutton ); + clear_inconsistent( surface_alphatexbutton ); + clear_inconsistent( surface_animspeedbutton ); + clear_inconsistent( surface_undulatebutton ); + + clear_inconsistent( surf_gravel_radiobutton ); + clear_inconsistent( surf_metal_radiobutton ); + clear_inconsistent( surf_stone_radiobutton ); + clear_inconsistent( surf_wood_radiobutton ); + + clear_inconsistent( content_solidbutton ); + clear_inconsistent( content_windowbutton ); + clear_inconsistent( content_illusbutton ); + clear_inconsistent( content_lavabutton ); + clear_inconsistent( content_slimebutton ); + clear_inconsistent( content_waterbutton ); + clear_inconsistent( content_mistbutton ); + clear_inconsistent( content_areaportalbutton ); + clear_inconsistent( content_playerclipbutton ); + clear_inconsistent( content_monsterclipbutton ); + clear_inconsistent( content_current0button ); + clear_inconsistent( content_current90button ); + clear_inconsistent( content_current180button ); + clear_inconsistent( content_current270button ); + clear_inconsistent( content_currentUPbutton ); + clear_inconsistent( content_currentDOWNbutton ); + clear_inconsistent( content_originbutton ); + clear_inconsistent( content_detailbutton ); + clear_inconsistent( content_ladderbutton ); + clear_inconsistent( content_camnoblockbutton ); +} + +void clear_all_buttons_and_values() +{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_lightbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_slickbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_skybutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_warpbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans33button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_trans66button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_flowingbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_nodrawbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_tallwallbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_alphatexbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_animspeedbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( surface_undulatebutton ), FALSE); + +// surface_material_inconsistant = TRUE; + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE); + set_inconsistent(surf_gravel_radiobutton); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE); + set_inconsistent(surf_metal_radiobutton); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE); + set_inconsistent(surf_stone_radiobutton); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE); + set_inconsistent(surf_wood_radiobutton); + + gtk_entry_set_text( (GtkEntry *)surf_value_entry, ""); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_solidbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_windowbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_illusbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_lavabutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_slimebutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_waterbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_mistbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_areaportalbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_playerclipbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_monsterclipbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current0button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current90button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current180button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_current270button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentUPbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_currentDOWNbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_originbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_detailbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_ladderbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( content_camnoblockbutton ), FALSE); + +} + +void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty) +{ + int i; + int contents = 0; + int flags = 0; + int value = 0; + int diff_contents = 0; + int diff_flags = 0; + gboolean diff_value = FALSE; + char tex_buff[11]; + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + gboolean surface_which_material_inconsistant[4]; + int surface_iterator; + + setup_buttons = TRUE; + working_surface_flags = 0; + surface_mask = 0; + working_content_flags = 0; + content_mask = 0; + working_value = 0; + surface_material_inconsistant = FALSE; + surface_which_material_inconsistant[0] = FALSE; + surface_which_material_inconsistant[1] = FALSE; + surface_which_material_inconsistant[2] = FALSE; + surface_which_material_inconsistant[3] = FALSE; + + if(!b_isListEmpty) + { + tmp_texdef = &texdef_face_list->texdef; + contents = tmp_texdef->contents; + flags = tmp_texdef->flags; + value = tmp_texdef->value; + + surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material? + surface_which_material_inconsistant[surface_iterator] = TRUE; + + for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent + diff_flags |= flags ^ tmp_texdef->flags; + if (tmp_texdef->value != value) + diff_value = TRUE; + + surface_iterator = (tmp_texdef->flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; // Inconsistant Material? + surface_which_material_inconsistant[surface_iterator] = TRUE; + + Sys_Printf("Diff_Flags: %d\t Surf_Iter: %d\n",diff_flags, surface_iterator); + + } + } + + + clear_all_inconsistent(); + + // If no faces/brushes are selected, clear everything and bail + if(b_isListEmpty) + { + clear_all_buttons_and_values(); + setup_buttons = FALSE; + return; + } + + // Set surface buttons to reflect brush/face flags, contents, and values + if(diff_flags & HERETIC2_SURF_LIGHT) + set_inconsistent(surface_lightbutton); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), (flags & HERETIC2_SURF_LIGHT)); + + if(diff_flags & HERETIC2_SURF_SLICK) + set_inconsistent(surface_slickbutton); + else if(flags & HERETIC2_SURF_SLICK) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_SKY) + set_inconsistent(surface_skybutton); + else if(flags & HERETIC2_SURF_SKY) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_WARP) + set_inconsistent(surface_warpbutton); + else if(flags & HERETIC2_SURF_WARP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_TRANS33) + set_inconsistent(surface_trans33button); + else if(flags & HERETIC2_SURF_TRANS33) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE); + + if(diff_flags & HERETIC2_SURF_TRANS66) + set_inconsistent(surface_trans66button); + else if(flags & HERETIC2_SURF_TRANS66) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE); + + if(diff_flags & HERETIC2_SURF_FLOWING) + set_inconsistent(surface_flowingbutton); + else if(flags & HERETIC2_SURF_FLOWING) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_NODRAW) + set_inconsistent(surface_nodrawbutton); + else if(flags & HERETIC2_SURF_NODRAW) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_TALL_WALL) + set_inconsistent(surface_tallwallbutton); + else if(flags & HERETIC2_SURF_TALL_WALL) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_tallwallbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_ALPHA_TEXTURE) + set_inconsistent(surface_alphatexbutton); + else if(flags & HERETIC2_SURF_ALPHA_TEXTURE) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_alphatexbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_ANIMSPEED) + set_inconsistent(surface_animspeedbutton); + else if(flags & HERETIC2_SURF_ANIMSPEED) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_animspeedbutton ), FALSE); + + if(diff_flags & HERETIC2_SURF_UNDULATE) + set_inconsistent(surface_undulatebutton); + else if(flags & HERETIC2_SURF_UNDULATE) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_undulatebutton ), FALSE); + + if(diff_flags & ~HERETIC2_SURF_MATERIAL_MASK) + { + Sys_Printf("--> %d\n", (diff_flags & ~HERETIC2_SURF_MATERIAL_MASK) ); + Sys_Printf("%d\t%d\t%d\t%d\n", surface_which_material_inconsistant[0], surface_which_material_inconsistant[1], surface_which_material_inconsistant[2], surface_which_material_inconsistant[3]); + + if (surface_which_material_inconsistant[0]) + { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), FALSE); + surface_material_inconsistant = TRUE; + set_inconsistent(surf_gravel_radiobutton); + } + if (surface_which_material_inconsistant[1]) + { + //if (!surface_material_inconsistant) + //{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), FALSE); + surface_material_inconsistant = TRUE; + //} + set_inconsistent(surf_metal_radiobutton); + } + if (surface_which_material_inconsistant[2]) + { + //if (!surface_material_inconsistant) + //{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), FALSE); + surface_material_inconsistant = TRUE; + //} + set_inconsistent(surf_stone_radiobutton); + } + if (surface_which_material_inconsistant[3]) + { + //if (!surface_material_inconsistant) + //{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), FALSE); + surface_material_inconsistant = TRUE; + //} + set_inconsistent(surf_wood_radiobutton); + } + } + else + { + if(flags & ~HERETIC2_SURF_MATERIAL_MASK) + { + surface_iterator = (flags & ~HERETIC2_SURF_MATERIAL_MASK) >> 24; + if( surface_iterator == 1) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_metal_radiobutton ), TRUE); + else if(surface_iterator == 2) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_stone_radiobutton ), TRUE); + else if(surface_iterator == 3) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_wood_radiobutton ), TRUE); + } + else + { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surf_gravel_radiobutton ), TRUE); + } + } + + // Set content buttons to reflect brush values + if(diff_contents & HERETIC2_CONTENTS_SOLID) + set_inconsistent(content_solidbutton); + else if(contents & HERETIC2_CONTENTS_SOLID) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_WINDOW) + set_inconsistent(content_windowbutton); + else if(contents & HERETIC2_CONTENTS_WINDOW) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_ILLUSIONARY) + set_inconsistent(content_illusbutton); + else if(contents & HERETIC2_CONTENTS_ILLUSIONARY) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_illusbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_LAVA) + set_inconsistent(content_lavabutton); + else if(contents & HERETIC2_CONTENTS_LAVA) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_SLIME) + set_inconsistent(content_slimebutton); + else if(contents & HERETIC2_CONTENTS_SLIME) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_WATER) + set_inconsistent(content_waterbutton); + else if(contents & HERETIC2_CONTENTS_WATER) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_MIST) + set_inconsistent(content_mistbutton); + else if(contents & HERETIC2_CONTENTS_MIST) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_AREAPORTAL) + set_inconsistent(content_areaportalbutton); + else if(contents & HERETIC2_CONTENTS_AREAPORTAL) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_PLAYERCLIP) + set_inconsistent(content_playerclipbutton); + else if(contents & HERETIC2_CONTENTS_PLAYERCLIP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_MONSTERCLIP) + set_inconsistent(content_monsterclipbutton); + else if(contents & HERETIC2_CONTENTS_MONSTERCLIP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_0) + set_inconsistent(content_current0button); + else if(contents & HERETIC2_CONTENTS_CURRENT_0) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_90) + set_inconsistent(content_current90button); + else if(contents & HERETIC2_CONTENTS_CURRENT_90) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_180) + set_inconsistent(content_current180button); + else if(contents & HERETIC2_CONTENTS_CURRENT_180) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_270) + set_inconsistent(content_current270button); + else if(contents & HERETIC2_CONTENTS_CURRENT_270) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_UP) + set_inconsistent(content_currentUPbutton); + else if(contents & HERETIC2_CONTENTS_CURRENT_UP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CURRENT_DOWN) + set_inconsistent(content_currentDOWNbutton); + else if(contents & HERETIC2_CONTENTS_CURRENT_DOWN) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_ORIGIN) + set_inconsistent(content_originbutton); + else if(contents & HERETIC2_CONTENTS_ORIGIN) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_DETAIL) + set_inconsistent(content_detailbutton); + else if(contents & HERETIC2_CONTENTS_DETAIL) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_LADDER) + set_inconsistent(content_ladderbutton); + else if(contents & HERETIC2_CONTENTS_LADDER) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE); + + if(diff_contents & HERETIC2_CONTENTS_CAMERANOBLOCK) + set_inconsistent(content_camnoblockbutton); + else if(contents & HERETIC2_CONTENTS_CAMERANOBLOCK) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_camnoblockbutton ), FALSE); + + // Set Value + if(diff_value) + gtk_entry_set_text( (GtkEntry *)surf_value_entry, ""); + else + { + working_value = value; + sprintf( tex_buff, "%d", value); + gtk_entry_set_text( (GtkEntry *)surf_value_entry, tex_buff); + } + + setup_buttons = FALSE; +} + +void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list) +{ + texdef_to_face_t *temp_texdef_face_list; + texdef_t *tmp_texdef; + + for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags; + tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags; + tmp_texdef->value = working_value; + Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask); + Sys_Printf("content: %d\n",tmp_texdef->contents); + } +} + +inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag) // For Material +{ + if (!setup_buttons) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + if (surface_material_inconsistant) + { + clear_inconsistent( surf_gravel_radiobutton ); + clear_inconsistent( surf_metal_radiobutton ); + clear_inconsistent( surf_stone_radiobutton ); + clear_inconsistent( surf_wood_radiobutton ); + } + surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK; + working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | sur_flag; + } +} + +inline void change_material (GtkWidget *togglebutton) +{ + if (!setup_buttons) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + if (surface_material_inconsistant) + { + clear_inconsistent( surf_gravel_radiobutton ); + clear_inconsistent( surf_metal_radiobutton ); + clear_inconsistent( surf_stone_radiobutton ); + clear_inconsistent( surf_wood_radiobutton ); + } + if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton)) ) + { + surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK; + working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_GRAVEL; + } + else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton)) ) + { + surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK; + working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_METAL; + } + else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton)) ) + { + surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK; + working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_STONE; + } + else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton)) ) + { + surface_mask |= ~HERETIC2_SURF_MATERIAL_MASK; + working_surface_flags = (working_surface_flags & HERETIC2_SURF_MATERIAL_MASK) | HERETIC2_SURF_TYPE_WOOD; + } + } +} + +inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to) +{ + + if (!setup_buttons) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set + clear_inconsistent(GTK_WIDGET (togglebutton)); + + surface_mask |= sur_flag; + + if (change_flag_to) + working_surface_flags |= sur_flag; + else + working_surface_flags &= ~sur_flag; + } +} + +inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to) +{ + + if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) + clear_inconsistent(togglebutton); + //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces. + //{ + content_mask |= content_flag; + + if (change_flag_to) + working_content_flags |= content_flag; + else + working_content_flags &= ~content_flag; + //} + } +} + +// Surface Flags Callbacks +void +on_surface_lightbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_lightbutton, HERETIC2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active)); +} + + +void +on_surface_slickbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_slickbutton, HERETIC2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active)); +} + + +void +on_surface_skybutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_skybutton, HERETIC2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active)); +} + + +void +on_surface_warpbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_warpbutton, HERETIC2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active)); +} + + +void +on_surface_trans33button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_trans33button, HERETIC2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active)); +} + + +void +on_surface_trans66button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_trans66button, HERETIC2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active)); +} + + +void +on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_flowingbutton, HERETIC2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active)); +} + + +void +on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_nodrawbutton, HERETIC2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active)); +} + + +void +on_surface_tallwallbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_tallwallbutton, HERETIC2_SURF_TALL_WALL, (GTK_TOGGLE_BUTTON (surface_tallwallbutton)->active)); +} + + +void +on_surface_alphatexbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_alphatexbutton, HERETIC2_SURF_ALPHA_TEXTURE, (GTK_TOGGLE_BUTTON (surface_alphatexbutton)->active)); +} + + +void +on_surface_animspeedbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_animspeedbutton, HERETIC2_SURF_ANIMSPEED, (GTK_TOGGLE_BUTTON (surface_animspeedbutton)->active)); +} + + +void +on_surface_undulatebutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_undulatebutton, HERETIC2_SURF_UNDULATE, (GTK_TOGGLE_BUTTON (surface_undulatebutton)->active)); +} + + +void +on_surf_gravel_radiobutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_gravel_radiobutton))) + change_material(GTK_WIDGET(togglebutton)); +} + +void +on_surf_metal_radiobutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_metal_radiobutton))) + change_material(GTK_WIDGET(togglebutton)); +} + +void +on_surf_stone_radiobutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_stone_radiobutton))) + change_material(GTK_WIDGET(togglebutton)); +} + +void +on_surf_wood_radiobutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(surf_wood_radiobutton))) + change_material(GTK_WIDGET(togglebutton)); +} + +// Content Flags Callbacks +void +on_content_solidbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_solidbutton, HERETIC2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active)); +} + + +void +on_content_windowbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_windowbutton, HERETIC2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active)); +} + + +void +on_content_illusbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_illusbutton, HERETIC2_CONTENTS_ILLUSIONARY, (GTK_TOGGLE_BUTTON (content_illusbutton)->active)); +} + + +void +on_content_lavabutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_lavabutton, HERETIC2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active)); +} + + +void +on_content_slimebutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_slimebutton, HERETIC2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active)); +} + + +void +on_content_waterbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_waterbutton, HERETIC2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active)); +} + + +void +on_content_mistbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_mistbutton, HERETIC2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active)); +} + + +void +on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_areaportalbutton, HERETIC2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active)); +} + + +void +on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_playerclipbutton, HERETIC2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active)); +} + + +void +on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_monsterclipbutton, HERETIC2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active)); +} + + +void +on_content_current0button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current0button, HERETIC2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active)); +} + + +void +on_content_current90button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current90button, HERETIC2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active)); +} + + +void +on_content_current180button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current180button, HERETIC2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active)); +} + + +void +on_content_current270button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current270button, HERETIC2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active)); +} + + +void +on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_currentUPbutton, HERETIC2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active)); +} + + +void +on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_currentDOWNbutton, HERETIC2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active)); +} + + +void +on_content_originbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_originbutton, HERETIC2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active)); +} + + +void +on_content_detailbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_detailbutton, HERETIC2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active)); +} + + +void +on_content_ladderbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_ladderbutton, HERETIC2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active)); +} + + +void +on_content_camnoblockbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_camnoblockbutton, HERETIC2_CONTENTS_CAMERANOBLOCK, (GTK_TOGGLE_BUTTON (content_camnoblockbutton)->active)); +} + +// Value Entry Callback +void +on_surf_value_entry_changed (GtkEditable *editable, + gpointer user_data) +{ + if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value + working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) ); +} + +void +on_surf_value_entry_insert_text (GtkEditable *editable, + gchar *new_text, + gint new_text_length, + gint *position, + gpointer user_data) +{ + int i, count=0; + gchar *result; + int entry_value; + texdef_t *pt; + brush_t *b; + face_t *f; + + // Limit input to digits, throwing out anything else + // Modified from Gtk FAQ for text filtering of GtkEntry + result = g_new (gchar, new_text_length); + + for (i=0; i < new_text_length; i++) { + if (!isdigit(new_text[i])) + continue; + result[count++] = new_text[i]; + } + + if (count > 0) { + gtk_signal_handler_block_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text), + user_data); + gtk_editable_insert_text (editable, result, count, position); + gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_surf_value_entry_insert_text), + user_data); + } + gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text"); + + g_free (result); +} + +#define HERETIC2_FLAG_BUTTON_BORDER 3 + +GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget) +{ + GtkWidget *frame1; + GtkWidget *notebook1; + GtkWidget *vbox3; + GtkWidget *table1; + GtkWidget *frame2; + GtkWidget *hbox4; + GtkWidget *label4; + GtkWidget *vbox4; + GtkWidget *table3; + GtkWidget *label5; + + GtkWidget *hbox1; + GtkWidget *hbox2; + GtkWidget *label2; + GtkWidget *table2; + GtkWidget *label3; + + + frame1 = gtk_frame_new ("Brush/Face Flags"); + gtk_widget_show (frame1); + gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1); + + notebook1 = gtk_notebook_new (); + gtk_widget_show (notebook1); + gtk_container_add (GTK_CONTAINER (frame1), notebook1); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox3); + gtk_container_add (GTK_CONTAINER (notebook1), vbox3); + + table1 = gtk_table_new (3, 4, TRUE); + gtk_widget_show (table1); + gtk_box_pack_start (GTK_BOX (vbox3), table1, TRUE, TRUE, 0); + + surface_lightbutton = gtk_toggle_button_new_with_mnemonic ("Light"); + gtk_widget_show (surface_lightbutton); + gtk_table_attach (GTK_TABLE (table1), surface_lightbutton, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_slickbutton = gtk_toggle_button_new_with_mnemonic ("Slick"); + gtk_widget_show (surface_slickbutton); + gtk_table_attach (GTK_TABLE (table1), surface_slickbutton, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_skybutton = gtk_toggle_button_new_with_mnemonic ("Sky"); + gtk_widget_show (surface_skybutton); + gtk_table_attach (GTK_TABLE (table1), surface_skybutton, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_warpbutton = gtk_toggle_button_new_with_mnemonic ("Warp"); + gtk_widget_show (surface_warpbutton); + gtk_table_attach (GTK_TABLE (table1), surface_warpbutton, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_trans33button = gtk_toggle_button_new_with_mnemonic ("Trans33"); + gtk_widget_show (surface_trans33button); + gtk_table_attach (GTK_TABLE (table1), surface_trans33button, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_trans66button = gtk_toggle_button_new_with_mnemonic ("Trans66"); + gtk_widget_show (surface_trans66button); + gtk_table_attach (GTK_TABLE (table1), surface_trans66button, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_flowingbutton = gtk_toggle_button_new_with_mnemonic ("Flowing"); + gtk_widget_show (surface_flowingbutton); + gtk_table_attach (GTK_TABLE (table1), surface_flowingbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_nodrawbutton = gtk_toggle_button_new_with_mnemonic ("NoDraw"); + gtk_widget_show (surface_nodrawbutton); + gtk_table_attach (GTK_TABLE (table1), surface_nodrawbutton, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_tallwallbutton = gtk_toggle_button_new_with_mnemonic ("TallWall"); + gtk_widget_show (surface_tallwallbutton); + gtk_table_attach (GTK_TABLE (table1), surface_tallwallbutton, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_alphatexbutton = gtk_toggle_button_new_with_mnemonic ("AlphaTex"); + gtk_widget_show (surface_alphatexbutton); + gtk_table_attach (GTK_TABLE (table1), surface_alphatexbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_animspeedbutton = gtk_toggle_button_new_with_mnemonic ("AnimSpeed"); + gtk_widget_show (surface_animspeedbutton); + gtk_table_attach (GTK_TABLE (table1), surface_animspeedbutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + surface_undulatebutton = gtk_toggle_button_new_with_mnemonic ("Undulate"); + gtk_widget_show (surface_undulatebutton); + gtk_table_attach (GTK_TABLE (table1), surface_undulatebutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + frame2 = gtk_frame_new (NULL); + gtk_widget_show (frame2); + gtk_box_pack_start (GTK_BOX (vbox3), frame2, FALSE, FALSE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_ETCHED_OUT); + gtk_container_set_border_width (GTK_CONTAINER (frame2), 4); + + hbox4 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox4); + gtk_container_add (GTK_CONTAINER (frame2), hbox4); + + surf_gravel_radiobutton = gtk_radio_button_new_with_mnemonic (NULL, "Gravel"); + gtk_widget_show (surf_gravel_radiobutton); + gtk_box_pack_start (GTK_BOX (hbox4), surf_gravel_radiobutton, TRUE, FALSE, 0); + + surf_metal_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_gravel_radiobutton), "Metal"); + gtk_widget_show (surf_metal_radiobutton); + gtk_box_pack_start (GTK_BOX (hbox4), surf_metal_radiobutton, TRUE, FALSE, 0); + + surf_stone_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_metal_radiobutton), "Stone"); + gtk_widget_show (surf_stone_radiobutton); + gtk_box_pack_start (GTK_BOX (hbox4), surf_stone_radiobutton, TRUE, FALSE, 0); + + surf_wood_radiobutton = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(surf_stone_radiobutton), "Wood"); + gtk_widget_show (surf_wood_radiobutton); + gtk_box_pack_start (GTK_BOX (hbox4), surf_wood_radiobutton, TRUE, FALSE, 0); + + label4 = gtk_label_new ("Material"); + gtk_widget_show (label4); + gtk_frame_set_label_widget (GTK_FRAME (frame2), label4); + gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT); + + table3 = gtk_table_new (1, 4, FALSE); + gtk_widget_show (table3); + gtk_box_pack_start (GTK_BOX (vbox3), table3, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (table3), 3); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_table_attach (GTK_TABLE (table3), hbox1, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label5 = gtk_label_new ("Value: "); + gtk_widget_show (label5); + gtk_table_attach (GTK_TABLE (table3), label5, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label5), 0, 0); + gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_RIGHT); + + surf_value_entry = gtk_entry_new (); + gtk_widget_show (surf_value_entry); + gtk_table_attach (GTK_TABLE (table3), surf_value_entry, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_table_attach (GTK_TABLE (table3), hbox2, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label2 = gtk_label_new ("Surface Flags"); + gtk_widget_show (label2); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label2); + gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT); + + table2 = gtk_table_new (5, 4, TRUE); + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (notebook1), table2); + + content_solidbutton = gtk_toggle_button_new_with_mnemonic ("Solid"); + gtk_widget_show (content_solidbutton); + gtk_table_attach (GTK_TABLE (table2), content_solidbutton, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_windowbutton = gtk_toggle_button_new_with_mnemonic ("Window"); + gtk_widget_show (content_windowbutton); + gtk_table_attach (GTK_TABLE (table2), content_windowbutton, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_illusbutton = gtk_toggle_button_new_with_mnemonic ("Illusion"); + gtk_widget_show (content_illusbutton); + gtk_table_attach (GTK_TABLE (table2), content_illusbutton, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_lavabutton = gtk_toggle_button_new_with_mnemonic ("Lava"); + gtk_widget_show (content_lavabutton); + gtk_table_attach (GTK_TABLE (table2), content_lavabutton, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_slimebutton = gtk_toggle_button_new_with_mnemonic ("Slime"); + gtk_widget_show (content_slimebutton); + gtk_table_attach (GTK_TABLE (table2), content_slimebutton, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_waterbutton = gtk_toggle_button_new_with_mnemonic ("Water"); + gtk_widget_show (content_waterbutton); + gtk_table_attach (GTK_TABLE (table2), content_waterbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_mistbutton = gtk_toggle_button_new_with_mnemonic ("Mist"); + gtk_widget_show (content_mistbutton); + gtk_table_attach (GTK_TABLE (table2), content_mistbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_areaportalbutton = gtk_toggle_button_new_with_mnemonic ("AreaPortal"); + gtk_widget_show (content_areaportalbutton); + gtk_table_attach (GTK_TABLE (table2), content_areaportalbutton, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_playerclipbutton = gtk_toggle_button_new_with_mnemonic ("PlayerClip"); + gtk_widget_show (content_playerclipbutton); + gtk_table_attach (GTK_TABLE (table2), content_playerclipbutton, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_monsterclipbutton = gtk_toggle_button_new_with_mnemonic ("MonsterClip"); + gtk_widget_show (content_monsterclipbutton); + gtk_table_attach (GTK_TABLE (table2), content_monsterclipbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_current0button = gtk_toggle_button_new_with_mnemonic ("Current 0"); + gtk_widget_show (content_current0button); + gtk_table_attach (GTK_TABLE (table2), content_current0button, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_current90button = gtk_toggle_button_new_with_mnemonic ("Current 90"); + gtk_widget_show (content_current90button); + gtk_table_attach (GTK_TABLE (table2), content_current90button, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_current180button = gtk_toggle_button_new_with_mnemonic ("Current 180"); + gtk_widget_show (content_current180button); + gtk_table_attach (GTK_TABLE (table2), content_current180button, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_current270button = gtk_toggle_button_new_with_mnemonic ("Current 270"); + gtk_widget_show (content_current270button); + gtk_table_attach (GTK_TABLE (table2), content_current270button, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_currentUPbutton = gtk_toggle_button_new_with_mnemonic ("Current UP"); + gtk_widget_show (content_currentUPbutton); + gtk_table_attach (GTK_TABLE (table2), content_currentUPbutton, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_currentDOWNbutton = gtk_toggle_button_new_with_mnemonic ("Current DOWN"); + gtk_widget_show (content_currentDOWNbutton); + gtk_table_attach (GTK_TABLE (table2), content_currentDOWNbutton, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_originbutton = gtk_toggle_button_new_with_mnemonic ("Origin"); + gtk_widget_show (content_originbutton); + gtk_table_attach (GTK_TABLE (table2), content_originbutton, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_detailbutton = gtk_toggle_button_new_with_mnemonic ("Detail"); + gtk_widget_show (content_detailbutton); + gtk_table_attach (GTK_TABLE (table2), content_detailbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_ladderbutton = gtk_toggle_button_new_with_mnemonic ("Ladder"); + gtk_widget_show (content_ladderbutton); + gtk_table_attach (GTK_TABLE (table2), content_ladderbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + content_camnoblockbutton = gtk_toggle_button_new_with_mnemonic ("Cam No Block"); + gtk_widget_show (content_camnoblockbutton); + gtk_table_attach (GTK_TABLE (table2), content_camnoblockbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + label3 = gtk_label_new ("Content Flags"); + gtk_widget_show (label3); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label3); + gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT); + + // Signal Connects + g_signal_connect ((gpointer) surface_lightbutton, "toggled", + G_CALLBACK (on_surface_lightbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_slickbutton, "toggled", + G_CALLBACK (on_surface_slickbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_skybutton, "toggled", + G_CALLBACK (on_surface_skybutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_warpbutton, "toggled", + G_CALLBACK (on_surface_warpbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_trans33button, "toggled", + G_CALLBACK (on_surface_trans33button_toggled), + NULL); + g_signal_connect ((gpointer) surface_trans66button, "toggled", + G_CALLBACK (on_surface_trans66button_toggled), + NULL); + g_signal_connect ((gpointer) surface_flowingbutton, "toggled", + G_CALLBACK (on_surface_flowingbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_nodrawbutton, "toggled", + G_CALLBACK (on_surface_nodrawbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_tallwallbutton, "toggled", + G_CALLBACK (on_surface_tallwallbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_alphatexbutton, "toggled", + G_CALLBACK (on_surface_alphatexbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_animspeedbutton, "toggled", + G_CALLBACK (on_surface_animspeedbutton_toggled), + NULL); + g_signal_connect ((gpointer) surface_undulatebutton, "toggled", + G_CALLBACK (on_surface_undulatebutton_toggled), + NULL); + + g_signal_connect ((gpointer) surf_gravel_radiobutton, "toggled", + G_CALLBACK (on_surf_gravel_radiobutton_toggled), + NULL); + g_signal_connect ((gpointer) surf_metal_radiobutton, "toggled", + G_CALLBACK (on_surf_metal_radiobutton_toggled), + NULL); + g_signal_connect ((gpointer) surf_stone_radiobutton, "toggled", + G_CALLBACK (on_surf_stone_radiobutton_toggled), + NULL); + g_signal_connect ((gpointer) surf_wood_radiobutton, "toggled", + G_CALLBACK (on_surf_wood_radiobutton_toggled), + NULL); + + g_signal_connect ((gpointer) surf_value_entry, "changed", + G_CALLBACK (on_surf_value_entry_changed), + NULL); + g_signal_connect ((gpointer) surf_value_entry, "insert_text", + G_CALLBACK (on_surf_value_entry_insert_text), + NULL); + g_signal_connect ((gpointer) content_solidbutton, "toggled", + G_CALLBACK (on_content_solidbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_windowbutton, "toggled", + G_CALLBACK (on_content_windowbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_illusbutton, "toggled", + G_CALLBACK (on_content_illusbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_lavabutton, "toggled", + G_CALLBACK (on_content_lavabutton_toggled), + NULL); + g_signal_connect ((gpointer) content_slimebutton, "toggled", + G_CALLBACK (on_content_slimebutton_toggled), + NULL); + g_signal_connect ((gpointer) content_waterbutton, "toggled", + G_CALLBACK (on_content_waterbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_mistbutton, "toggled", + G_CALLBACK (on_content_mistbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_areaportalbutton, "toggled", + G_CALLBACK (on_content_areaportalbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_playerclipbutton, "toggled", + G_CALLBACK (on_content_playerclipbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_monsterclipbutton, "toggled", + G_CALLBACK (on_content_monsterclipbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_current0button, "toggled", + G_CALLBACK (on_content_current0button_toggled), + NULL); + g_signal_connect ((gpointer) content_current90button, "toggled", + G_CALLBACK (on_content_current90button_toggled), + NULL); + g_signal_connect ((gpointer) content_current180button, "toggled", + G_CALLBACK (on_content_current180button_toggled), + NULL); + g_signal_connect ((gpointer) content_current270button, "toggled", + G_CALLBACK (on_content_current270button_toggled), + NULL); + g_signal_connect ((gpointer) content_currentUPbutton, "toggled", + G_CALLBACK (on_content_currentUPbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_currentDOWNbutton, "toggled", + G_CALLBACK (on_content_currentDOWNbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_originbutton, "toggled", + G_CALLBACK (on_content_originbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_detailbutton, "toggled", + G_CALLBACK (on_content_detailbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_ladderbutton, "toggled", + G_CALLBACK (on_content_ladderbutton_toggled), + NULL); + g_signal_connect ((gpointer) content_camnoblockbutton, "toggled", + G_CALLBACK (on_content_camnoblockbutton_toggled), + NULL); + + + return frame1; +} + diff --git a/plugins/surface_heretic2/surfaceflagsdialog_heretic2.h b/plugins/surface_heretic2/surfaceflagsdialog_heretic2.h new file mode 100644 index 00000000..c074906e --- /dev/null +++ b/plugins/surface_heretic2/surfaceflagsdialog_heretic2.h @@ -0,0 +1,76 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _SURFACEFLAGSDIALOG_HERETIC2_H + #define _SURFACEFLAGSDIALOG_HERETIC2_H + +// 12 +#define HERETIC2_SURF_LIGHT 0x1 +#define HERETIC2_SURF_SLICK 0x2 +#define HERETIC2_SURF_SKY 0x4 +#define HERETIC2_SURF_WARP 0x8 +#define HERETIC2_SURF_TRANS33 0x10 +#define HERETIC2_SURF_TRANS66 0x20 +#define HERETIC2_SURF_FLOWING 0x40 +#define HERETIC2_SURF_NODRAW 0x80 + +#define HERETIC2_SURF_TALL_WALL 0x400 +#define HERETIC2_SURF_ALPHA_TEXTURE 0x800 +#define HERETIC2_SURF_ANIMSPEED 0x1000 +#define HERETIC2_SURF_UNDULATE 0x2000 + +#define HERETIC2_SURF_TYPE_GRAVEL 0x00000000 +#define HERETIC2_SURF_TYPE_METAL 0x01000000 +#define HERETIC2_SURF_TYPE_STONE 0x02000000 +#define HERETIC2_SURF_TYPE_WOOD 0x03000000 + +#define HERETIC2_SURF_MATERIAL_MASK 0xFCFFFFFF + + +// 20 +#define HERETIC2_CONTENTS_SOLID 0x1 +#define HERETIC2_CONTENTS_WINDOW 0x2 +#define HERETIC2_CONTENTS_ILLUSIONARY 0x4 +#define HERETIC2_CONTENTS_LAVA 0x8 +#define HERETIC2_CONTENTS_SLIME 0x10 +#define HERETIC2_CONTENTS_WATER 0x20 +#define HERETIC2_CONTENTS_MIST 0x40 + +#define HERETIC2_CONTENTS_AREAPORTAL 0x8000 +#define HERETIC2_CONTENTS_PLAYERCLIP 0x10000 +#define HERETIC2_CONTENTS_MONSTERCLIP 0x20000 +#define HERETIC2_CONTENTS_CURRENT_0 0x40000 +#define HERETIC2_CONTENTS_CURRENT_90 0x80000 +#define HERETIC2_CONTENTS_CURRENT_180 0x100000 +#define HERETIC2_CONTENTS_CURRENT_270 0x200000 +#define HERETIC2_CONTENTS_CURRENT_UP 0x400000 +#define HERETIC2_CONTENTS_CURRENT_DOWN 0x800000 +#define HERETIC2_CONTENTS_ORIGIN 0x1000000 + +#define HERETIC2_CONTENTS_DETAIL 0x8000000 + +#define HERETIC2_CONTENTS_LADDER 0x20000000 + +#define HERETIC2_CONTENTS_CAMERANOBLOCK 0x40000000 + + + +#endif // _SURFACEFLAGSDIALOG_HERETIC2_H diff --git a/plugins/surface_heretic2/surfdlg_plugin.cpp b/plugins/surface_heretic2/surfdlg_plugin.cpp new file mode 100644 index 00000000..06254bcf --- /dev/null +++ b/plugins/surface_heretic2/surfdlg_plugin.cpp @@ -0,0 +1,127 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include "surfdlg_plugin.h" +#include "surfacedialog.h" + +#include "synapse.h" + +class CSynapseClient_SurfDLG : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + bool OnActivate(); + + CSynapseClient_SurfDLG() { } + virtual ~CSynapseClient_SurfDLG() { } +}; + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; +_QERUndoTable g_UndoTable; +_QERAppSurfaceTable g_AppSurfaceTable; +_QERSelectedFaceTable g_SelectedFaceTable; +_QERShadersTable g_ShadersTable; +_QERAppShadersTable g_AppShadersTable; +_QERAppDataTable g_AppDataTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClient_SurfDLG g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(SURFACEDIALOG_MAJOR, "heretic2", sizeof(_QERPlugSurfaceTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable), SYN_REQUIRE, &g_UndoTable); + g_SynapseClient.AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable), SYN_REQUIRE, &g_AppSurfaceTable); + g_SynapseClient.AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable), SYN_REQUIRE, &g_SelectedFaceTable); + g_SynapseClient.AddAPI(SHADERS_MAJOR, "quake2", sizeof(_QERShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable), SYN_REQUIRE, &g_AppShadersTable); + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_AppDataTable); + + return &g_SynapseClient; +} + +bool CSynapseClient_SurfDLG::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, SURFACEDIALOG_MAJOR)) + { + _QERPlugSurfaceTable* pSurfDialogTable= static_cast<_QERPlugSurfaceTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "heretic2")) + { + pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface; + pSurfDialogTable->m_pfnDoSurface = &DoSurface; + pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; + pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; + pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClient_SurfDLG::GetInfo() +{ + return "Surface Dialog (Heretic 2) module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClient_SurfDLG::GetName() +{ + return "surface"; +} + +bool CSynapseClient_SurfDLG::OnActivate() +{ + return true; +} diff --git a/plugins/surface_heretic2/surfdlg_plugin.h b/plugins/surface_heretic2/surfdlg_plugin.h new file mode 100644 index 00000000..f5391344 --- /dev/null +++ b/plugins/surface_heretic2/surfdlg_plugin.h @@ -0,0 +1,94 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _SURFDLG_PLUGIN_H_ +#define _SURFDLG_PLUGIN_H_ + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "qerplugin.h" +#include "synapse.h" +#include "iselectedface.h" +#include "iundo.h" +#include "ishaders.h" +#include "mathlib.h" +#include "missing.h" +#include "idata.h" + +#include "isurfaceplugin.h" + +class SurfaceDialog : public IPluginTexdef +{ + int refCount; +public: + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () { if ( --refCount <= 0 ) delete this; } +}; + +extern _QERFuncTable_1 g_FuncTable; +extern _QERUndoTable g_UndoTable; +extern _QERAppSurfaceTable g_AppSurfaceTable; +extern _QERSelectedFaceTable g_SelectedFaceTable; +extern _QERShadersTable g_ShadersTable; +extern _QERAppShadersTable g_AppShadersTable; +extern _QERAppDataTable g_AppDataTable; + +#define GetSelectedFaceCount g_SelectedFaceTable.m_pfnGetSelectedFaceCount + +#define Undo_Undo g_UndoTable.m_pfnUndo_Undo +#define Undo_GetUndoId g_UndoTable.m_pfnUndo_GetUndoId + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf +#define Sys_UpdateWindows g_FuncTable.m_pfnSysUpdateWindows + + +#define Select_FitTexture g_AppSurfaceTable.m_pfnSelect_FitTexture +#define Get_SI_Inc g_AppSurfaceTable.m_pfnQERApp_QeglobalsSavedinfo_SIInc +#define GridSize g_AppSurfaceTable.m_pfnQeglobalsGetGridSize +#define FaceList_FitTexture g_AppSurfaceTable.m_pfnFaceList_FitTexture +#define GetMainWindow g_AppSurfaceTable.m_pfnGetMainWindow +#define GetSelectedFaceCountfromBrushes g_AppSurfaceTable.m_pfnGetSelectedFaceCountfromBrushes +#define GetSelFacesTexdef g_AppSurfaceTable.m_pfnGetSelFacesTexdef +#define SetTexdef_FaceList g_AppSurfaceTable.m_pfnSetTexdef_FaceList +#define SetWinPos_from_Prefs g_AppSurfaceTable.m_pfnSetWinPos_From_Prefs + +#define Texturewin g_AppShadersTable.m_pfnQeglobalsTexturewin + +#endif // _SURFDLG_PLUGIN_H_ + diff --git a/plugins/surface_quake2/surface_quake2.def b/plugins/surface_quake2/surface_quake2.def new file mode 100644 index 00000000..0cec1f32 --- /dev/null +++ b/plugins/surface_quake2/surface_quake2.def @@ -0,0 +1,8 @@ +; surface_quake2.def : Declares the module parameters for the DLL. + +LIBRARY "SURFACE_QUAKE2" +DESCRIPTION 'SURFACE_QUAKE2 Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/surface_quake2/surface_quake2.vcproj b/plugins/surface_quake2/surface_quake2.vcproj new file mode 100644 index 00000000..b940f023 --- /dev/null +++ b/plugins/surface_quake2/surface_quake2.vcproj @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/surface_quake2/surfacedialog.cpp b/plugins/surface_quake2/surfacedialog.cpp new file mode 100644 index 00000000..a9461323 --- /dev/null +++ b/plugins/surface_quake2/surfacedialog.cpp @@ -0,0 +1,1939 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Surface Dialog Module +// + +// +// Nurail: Implemented to Module from the main Radiant Surface Dialog code +// + + +#include +#include + +#include "surfdlg_plugin.h" + + + +#ifdef _DEBUG +//#define DBG_SI 1 +#endif + +#include "gtkr_vector.h" + +std::vector g_texdef_face_vector; + +inline texdef_to_face_t* get_texdef_face_list() +{ + return &(*g_texdef_face_vector.begin()); +} + +inline unsigned int texdef_face_list_empty() +{ + return g_texdef_face_vector.empty(); +} + +inline unsigned int texdef_face_list_size() +{ + return g_texdef_face_vector.size(); +} + +// For different faces having different values +bool is_HShift_conflicting; +bool is_VShift_conflicting; +bool is_HScale_conflicting; +bool is_VScale_conflicting; +bool is_Rotate_conflicting; +bool is_TextureName_conflicting; + +void ShowDlg(); +void HideDlg(); +void SetTexMods(); +void GetTexMods(bool b_SetUndoPoint = FALSE); +void BuildDialog(); +void FitAll(); +void InitDefaultIncrement(texdef_t *); +void DoSnapTToGrid(float hscale, float vscale); +// called to perform a fitting from the outside (shortcut key) +void SurfaceDialogFitAll(); + +// Quake2 Flags Functions +void SetFlagButtons_Quake2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty); +void SetChangeInFlags_Face_Quake2 (texdef_to_face_t *texdef_face_list); +GtkWidget* Create_Quake2FlagsDialog (GtkWidget* surfacedialog_widget); + + +// Dialog Data +int m_nHeight; +int m_nWidth; + +// 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for +int m_nUndoId; + + +texturewin_t *texturewin; +texdef_t *l_pIncrement; +texdef_t texdef_offset; +texdef_t texdef_SI_values; + +// For Texture Entry, activate only on entry change +char old_texture_entry[128]; + +// the texdef to switch back to when the OnCancel is called +texdef_t g_old_texdef; + +// when TRUE, this thing means the surface inspector is currently being displayed +bool g_surfwin = FALSE; +// turn on/off processing of the "changed" "value_changed" messages +// (need to turn off when we are feeding data in) +bool g_bListenChanged = true; +// turn on/off listening of the update messages +bool g_bListenUpdate = true; + +GtkWidget* create_SurfaceInspector (void); +GtkWidget *SurfaceInspector = NULL; + +GtkWidget *m_pWidget; +GtkWidget *GetWidget () { return SurfaceInspector; } +GtkWidget *Get_SI_Module_Widget () { return SurfaceInspector; } +void SetWidget(GtkWidget *new_widget) { m_pWidget = new_widget; } +GtkWidget *GetDlgWidget (const char* name) + { return GTK_WIDGET (g_object_get_data (G_OBJECT (SurfaceInspector), name)); } + +// Spins for FitTexture +GtkWidget *spin_width; +GtkWidget *spin_height; + + +GtkWidget *texture_combo; +GtkWidget *texture_combo_entry; + +GtkWidget *match_grid_button; +GtkWidget *lock_valuechange_togglebutton; + +GtkObject *hshift_value_spinbutton_adj; +GtkWidget *hshift_value_spinbutton; +GtkObject *vshift_value_spinbutton_adj; +GtkWidget *vshift_value_spinbutton; +GtkObject *hscale_value_spinbutton_adj; +GtkWidget *hscale_value_spinbutton; +GtkObject *vscale_value_spinbutton_adj; +GtkWidget *vscale_value_spinbutton; +GtkObject *rotate_value_spinbutton_adj; +GtkWidget *rotate_value_spinbutton; + +GtkObject *hshift_offset_spinbutton_adj; +GtkWidget *hshift_offset_spinbutton; +GtkObject *vshift_offset_spinbutton_adj; +GtkWidget *vshift_offset_spinbutton; +GtkObject *hscale_offset_spinbutton_adj; +GtkWidget *hscale_offset_spinbutton; +GtkObject *vscale_offset_spinbutton_adj; +GtkWidget *vscale_offset_spinbutton; +GtkObject *rotate_offset_spinbutton_adj; +GtkWidget *rotate_offset_spinbutton; + +GtkObject *hshift_step_spinbutton_adj; +GtkWidget *hshift_step_spinbutton; +GtkObject *vshift_step_spinbutton_adj; +GtkWidget *vshift_step_spinbutton; +GtkObject *hscale_step_spinbutton_adj; +GtkWidget *hscale_step_spinbutton; +GtkObject *vscale_step_spinbutton_adj; +GtkWidget *vscale_step_spinbutton; +GtkObject *rotate_step_spinbutton_adj; +GtkWidget *rotate_step_spinbutton; + +GtkObject *fit_width_spinbutton_adj; +GtkWidget *fit_width_spinbutton; +GtkObject *fit_height_spinbutton_adj; +GtkWidget *fit_height_spinbutton; +GtkWidget *fit_button; +GtkWidget *axial_button; + +GtkWidget *done_button; +GtkWidget *apply_button; +GtkWidget *cancel_button; + +// Callbacks +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data); +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data); + +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data); +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_button_clicked (GtkButton *button, gpointer user_data); +static void on_axial_button_clicked (GtkButton *button, gpointer user_data); + +static void on_done_button_clicked (GtkButton *button, gpointer user_data); +static void on_apply_button_clicked (GtkButton *button, gpointer user_data); +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data); + + +/* +=================================================== + + SURFACE INSPECTOR + +=================================================== +*/ + + +void IsFaceConflicting() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char buf[12]; + char texture_name[128]; + + if (texdef_face_list_empty()) + { + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (texture_combo_entry), ""); + return; + } + + g_bListenChanged = FALSE; + + tmp_texdef = &get_texdef_face_list()->texdef; + + strcpy(texture_name, tmp_texdef->GetName() ); + + texdef_SI_values.shift[0] = tmp_texdef->shift[0]; + texdef_SI_values.shift[1] = tmp_texdef->shift[1]; + texdef_SI_values.scale[0] = tmp_texdef->scale[0]; + texdef_SI_values.scale[1] = tmp_texdef->scale[1]; + texdef_SI_values.rotate = tmp_texdef->rotate; + texdef_SI_values.SetName( texture_name ); + + is_HShift_conflicting = FALSE; + is_VShift_conflicting = FALSE; + is_HScale_conflicting = FALSE; + is_VScale_conflicting = FALSE; + is_Rotate_conflicting = FALSE; + is_TextureName_conflicting = FALSE; + + if (texdef_face_list_size() > 1) + { + temp_texdef_face_list = get_texdef_face_list()->next; + + for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] ) + is_HShift_conflicting = TRUE; + + if ( texdef_SI_values.shift[1] != tmp_texdef->shift[1] ) + is_VShift_conflicting = TRUE; + + if ( texdef_SI_values.scale[0] != tmp_texdef->scale[0] ) + is_HScale_conflicting = TRUE; + + if ( texdef_SI_values.scale[1] != tmp_texdef->scale[1] ) + is_VScale_conflicting = TRUE; + + if ( texdef_SI_values.rotate != tmp_texdef->rotate ) + is_Rotate_conflicting = TRUE; + + if ( strcmp( texture_name, tmp_texdef->GetName() ) ) + is_TextureName_conflicting = TRUE; + } + } + + if(is_HShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hshift_value_spinbutton) , texdef_SI_values.shift[0] ); + + if(is_VShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vshift_value_spinbutton) , texdef_SI_values.shift[1] ); + + if(is_HScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hscale_value_spinbutton) , texdef_SI_values.scale[0] ); + + if(is_VScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vscale_value_spinbutton) , texdef_SI_values.scale[1] ); + + if(is_Rotate_conflicting) + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(rotate_value_spinbutton) , texdef_SI_values.rotate ); + + g_bListenChanged = TRUE; +} + +#define MAX_NUM_LIST_ITEMS 15 +static void PopulateTextureComboList() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char blank[1]; + GList *items = NULL; + GList *tmp_item; + int num_of_list_items = 0; + + blank[0] = 0; + + if (texdef_face_list_empty()) + { + items = g_list_append (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + else if ( !is_TextureName_conflicting ) + { + temp_texdef_face_list = get_texdef_face_list(); + tmp_texdef = (texdef_t *) &get_texdef_face_list()->texdef; + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, tmp_texdef->GetName()); + } + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + // Need to do a string compare, hence the custom search + if (!( g_list_find_custom (items, tmp_texdef->GetName(), (GCompareFunc) strcmp ) )) + { + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + num_of_list_items++; + } + // Make sure the combo list isn't too long + if (num_of_list_items >= MAX_NUM_LIST_ITEMS) + break; + } + // If this isn't added last (to the top of the list), g_list_find freaks. + items = g_list_prepend (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (texture_combo), items); + g_list_free(items); + +} + +static void ZeroOffsetValues() +{ + texdef_offset.shift[0] = 0.0; + texdef_offset.shift[1] = 0.0; + texdef_offset.scale[0] = 0.0; + texdef_offset.scale[1] = 0.0; + texdef_offset.rotate = 0.0; +} + +static void GetTexdefInfo_from_Radiant() +{ + g_texdef_face_vector.clear(); + + unsigned int count = GetSelectedFaceCountfromBrushes(); + if(count == 0) + count = GetSelectedFaceCount(); + + g_texdef_face_vector.resize(count); + + if (!texdef_face_list_empty()) + { + texdef_to_face_t* p = get_texdef_face_list(); + GetSelFacesTexdef( get_texdef_face_list() ); + } + + IsFaceConflicting(); + PopulateTextureComboList(); + ZeroOffsetValues(); + if ( texdef_face_list_empty() ) + SetFlagButtons_Quake2( get_texdef_face_list() , TRUE); + else + SetFlagButtons_Quake2( get_texdef_face_list() , FALSE); +} + +static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data) +{ + HideDlg(); + return TRUE; +} + +// make the shift increments match the grid settings +// the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size +// this depends on a scale value if you have selected a particular texture on which you want it to work: +// we move the textures in pixels, not world units. (i.e. increment values are in pixel) +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize +// increment * scale = gridsize +// hscale and vscale are optional parameters, if they are zero they will be set to the default scale +// NOTE: the default scale depends if you are using BP mode or regular. +// For regular it's 0.5f (128 pixels cover 64 world units), for BP it's simply 1.0f +// see fenris #2810 +void DoSnapTToGrid(float hscale, float vscale) +{ + l_pIncrement = Get_SI_Inc(); + + if (hscale == 0.0f) + { + hscale = 0.5f; + } + if (vscale == 0.0f) + { + vscale = 0.5f; + } +#ifdef _DEBUG + Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale); +#endif + l_pIncrement->shift[0] = GridSize() / hscale; + l_pIncrement->shift[1] = GridSize() / vscale; + // now some update work + // FIXME: doesn't look good here, seems to be called several times + SetTexMods(); +} + +void UpdateSurfaceDialog() +{ + if (!g_bListenUpdate) + return; + + if (!SurfaceInspector) + return; + + // avoid long delays on slow computers + while (gtk_events_pending ()) + gtk_main_iteration (); + + if (g_surfwin) + { +#ifdef DBG_SI + Sys_Printf("UpdateSurfaceDialog\n"); +#endif + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } + +} + +// DoSurface will always try to show the surface inspector +// or update it because something new has been selected +void DoSurface (void) +{ +#ifdef DBG_SI + Sys_Printf("DoSurface\n"); +#endif + if (!SurfaceInspector) + create_SurfaceInspector (); + + ShowDlg(); + SetTexMods (); +} + +void ToggleSurface() +{ +#ifdef DBG_SI + Sys_Printf("ToggleSurface Module\n"); +#endif + if (!g_surfwin) + DoSurface (); + else + on_cancel_button_clicked(NULL, NULL); +} + +// NOTE: will raise and show the Surface inspector and exec fit for patches and brushes +void SurfaceDlgFitAll() +{ + DoSurface(); + FitAll(); +} + +// ============================================================================= +// SurfaceDialog class + +void ShowDlg() +{ + + if(!SurfaceInspector) + create_SurfaceInspector(); + else + gtk_widget_show (SurfaceInspector); + + GetTexdefInfo_from_Radiant(); + GetTexMods(TRUE); // Set Initial Undo Point + g_surfwin = TRUE; +} + +void HideDlg() +{ + g_surfwin = FALSE; + gtk_widget_hide (SurfaceInspector); +} + + +// set default values for increments (shift scale and rot) +// this is called by the prefs code if can't find the values +void InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName("foo"); + tex->shift[0] = 8; + tex->shift[1] = 8; + tex->scale[0] = 0.25; + tex->scale[1] = 0.25; + tex->rotate = 10; +} + +void BuildDialog () +{ + if ( !SurfaceInspector ) + create_SurfaceInspector(); +} + +/* +============== +SetTexMods + +Set the fields to the current texdef (i.e. map/texdef -> dialog widgets) +=============== +*/ + +void SetTexMods() +{ + texdef_t *pt; + GtkSpinButton *spin; + GtkAdjustment *adjust; + + texturewin = Texturewin (); + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg SetTexMods\n"); +#endif + + if (!g_surfwin) + return; + + pt = &texturewin->texdef; + + g_bListenChanged = false; + + if(strncmp(pt->GetName(), "textures/", 9) != 0) + texdef_offset.SetName(SHADER_NOT_FOUND); + + + spin = GTK_SPIN_BUTTON (hshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hshift_step_spinbutton), l_pIncrement->shift[0]); + + spin = GTK_SPIN_BUTTON (hshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + + + spin = GTK_SPIN_BUTTON (vshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vshift_step_spinbutton), l_pIncrement->shift[1]); + + spin = GTK_SPIN_BUTTON (vshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + + + spin = GTK_SPIN_BUTTON (hscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hscale_step_spinbutton), l_pIncrement->scale[0]); + + spin = GTK_SPIN_BUTTON (hscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + + + spin = GTK_SPIN_BUTTON (vscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vscale_step_spinbutton), l_pIncrement->scale[1]); + + spin = GTK_SPIN_BUTTON (vscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + + + spin = GTK_SPIN_BUTTON (rotate_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.rotate); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(rotate_step_spinbutton), l_pIncrement->rotate); + + spin = GTK_SPIN_BUTTON (rotate_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + + + g_bListenChanged = true; + + // store the current texdef as our escape route if user hits OnCancel + g_old_texdef = texturewin->texdef; +} + +/* +============== +GetTexMods + +Shows any changes to the main Radiant windows +=============== +*/ +void GetTexMods(bool b_SetUndoPoint) +{ + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg GetTexMods\n"); +#endif + + if ( !texdef_face_list_empty() ) + { + g_bListenUpdate=FALSE; + SetChangeInFlags_Face_Quake2 ( get_texdef_face_list() ); + SetTexdef_FaceList( get_texdef_face_list(), b_SetUndoPoint, false ); + g_bListenUpdate=TRUE; + + if (b_SetUndoPoint) + m_nUndoId = Undo_GetUndoId(); + } +} + +void FitAll() +{ + on_fit_button_clicked(NULL, NULL); +} + + +//////////////////////////////////////////////////////////////////// +// +// GUI Section +// +//////////////////////////////////////////////////////////////////// + +GtkWidget* create_SurfaceInspector (void) +{ + + GtkWidget *label; + GtkWidget *hseparator; + GtkWidget *eventbox; + + GtkWidget *viewport8; + GtkWidget *viewport9; + GtkWidget *viewport2; + GtkWidget *viewport7; + GtkWidget *viewport5; + GtkWidget *viewport6; + GtkWidget *viewport10; + + GtkWidget *table1; + GtkWidget *table4; + GtkWidget *table5; + GtkWidget *table7; + + GtkWidget *alignment1; + GtkWidget *alignment2; + GtkWidget *alignment3; + + GtkWidget *vbox7; + + GtkWidget *hbox1; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hbox4; + + GtkWidget *image1; + GtkWidget *image2; + GtkWidget *image3; + + GtkWidget *hbuttonbox1; + + SurfaceInspector = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (SurfaceInspector), 4); + gtk_window_set_title (GTK_WINDOW (SurfaceInspector), "Surface Inspector"); + + SetWinPos_from_Prefs(SurfaceInspector); + + viewport8 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport8); + gtk_container_add (GTK_CONTAINER (SurfaceInspector), viewport8); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport8), GTK_SHADOW_NONE); + + vbox7 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox7); + gtk_container_add (GTK_CONTAINER (viewport8), vbox7); + + viewport9 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport9); + gtk_box_pack_start (GTK_BOX (vbox7), viewport9, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport9), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport9), GTK_SHADOW_ETCHED_IN); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_container_add (GTK_CONTAINER (viewport9), hbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbox1), 4); + + label = gtk_label_new ("Texture: "); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + texture_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (texture_combo)->popwin), + "KeepMeAround", texture_combo); + gtk_combo_disable_activate ( (GtkCombo*) texture_combo); + gtk_widget_show (texture_combo); + gtk_box_pack_start (GTK_BOX (hbox1), texture_combo, TRUE, TRUE, 0); + + texture_combo_entry = GTK_COMBO (texture_combo)->entry; + gtk_widget_show (texture_combo_entry); + gtk_entry_set_max_length (GTK_ENTRY (texture_combo_entry), 128); + + viewport2 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport2); + gtk_box_pack_start (GTK_BOX (vbox7), viewport2, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport2), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport2), GTK_SHADOW_ETCHED_IN); + + table1 = gtk_table_new (13, 4, FALSE); + gtk_widget_show (table1); + gtk_container_add (GTK_CONTAINER (viewport2), table1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Offset"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 3, 4, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + match_grid_button = gtk_button_new_with_mnemonic ("Match Grid"); + gtk_widget_show (match_grid_button); + gtk_container_add (GTK_CONTAINER (eventbox), match_grid_button); + + label = gtk_label_new ("Value"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new (" H Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 10, 11, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Rotate: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("H Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 1, 2, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + lock_valuechange_togglebutton = gtk_toggle_button_new_with_mnemonic ("UNLOCK"); + gtk_widget_show (lock_valuechange_togglebutton); + gtk_container_add (GTK_CONTAINER (eventbox), lock_valuechange_togglebutton); + + // Value Spins + hshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_value_spinbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), FALSE ); + + vshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_value_spinbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), FALSE ); + + hscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_value_spinbutton, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), FALSE ); + + vscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_value_spinbutton, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), FALSE ); + + rotate_value_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_value_spinbutton_adj), 1, 0); + gtk_widget_show (rotate_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_value_spinbutton, 1, 2, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), FALSE ); + + // Offset Spins + hshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (hshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_offset_spinbutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + + vshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (vshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_offset_spinbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + + hscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (hscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_offset_spinbutton, 2, 3, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + + vscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (vscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_offset_spinbutton, 2, 3, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + + rotate_offset_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_offset_spinbutton_adj), 0, 2); + gtk_widget_show (rotate_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_offset_spinbutton, 2, 3, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + + // Step Spins + hshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_step_spinbutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + vshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_step_spinbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + hscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_step_spinbutton, 3, 4, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + vscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_step_spinbutton, 3, 4, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + rotate_step_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_step_spinbutton_adj), 1, 2); + gtk_widget_show (rotate_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_step_spinbutton, 3, 4, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_step_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 2, 3, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + viewport7 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport7); + gtk_box_pack_start (GTK_BOX (vbox7), viewport7, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport7), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport7), GTK_SHADOW_ETCHED_IN); + + table4 = gtk_table_new (4, 7, FALSE); + gtk_widget_show (table4); + gtk_container_add (GTK_CONTAINER (viewport7), table4); + + viewport5 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport5); + gtk_table_attach (GTK_TABLE (table4), viewport5, 1, 7, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport5), 6); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport5), GTK_SHADOW_ETCHED_OUT); + + table5 = gtk_table_new (2, 3, FALSE); + gtk_widget_show (table5); + gtk_container_add (GTK_CONTAINER (viewport5), table5); + gtk_container_set_border_width (GTK_CONTAINER (table5), 5); + gtk_table_set_col_spacings (GTK_TABLE (table5), 2); + + label = gtk_label_new ("Height"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + label = gtk_label_new ("Width"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + fit_width_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_width_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_width_spinbutton_adj), 1, 0); + gtk_widget_show (fit_width_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_width_spinbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_width_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_width_spinbutton), GTK_UPDATE_IF_VALID); + + fit_height_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_height_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_height_spinbutton_adj), 1, 0); + gtk_widget_show (fit_height_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_height_spinbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 3, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_height_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_height_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 0); + + fit_button = gtk_button_new_with_mnemonic (" Fit "); + gtk_widget_show (fit_button); + gtk_container_add (GTK_CONTAINER (eventbox), fit_button); + + viewport6 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport6); + gtk_table_attach (GTK_TABLE (table4), viewport6, 0, 1, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport6), 4); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport6), GTK_SHADOW_NONE); + + table7 = gtk_table_new (2, 1, FALSE); + gtk_widget_show (table7); + gtk_container_add (GTK_CONTAINER (viewport6), table7); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table7), eventbox, 0, 1, 0, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + axial_button = gtk_button_new_with_mnemonic ("Axial"); + gtk_widget_show (axial_button); + gtk_container_add (GTK_CONTAINER (eventbox), axial_button); + gtk_widget_set_size_request (axial_button, 56, 29); + gtk_container_set_border_width (GTK_CONTAINER (axial_button), 4); + + // Fit in Flags sub-dialog + Create_Quake2FlagsDialog(vbox7); + + viewport10 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport10); + gtk_box_pack_start (GTK_BOX (vbox7), viewport10, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport10), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport10), GTK_SHADOW_ETCHED_IN); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_container_add (GTK_CONTAINER (viewport10), hbuttonbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD); + + done_button = gtk_button_new (); + gtk_widget_show (done_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), done_button); + GTK_WIDGET_SET_FLAGS (done_button, GTK_CAN_DEFAULT); + + alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment1); + gtk_container_add (GTK_CONTAINER (done_button), alignment1); + + hbox2 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox2); + gtk_container_add (GTK_CONTAINER (alignment1), hbox2); + + image1 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image1); + gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Done"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + apply_button = gtk_button_new (); + gtk_widget_show (apply_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_button); + GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); + + alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (apply_button), alignment3); + + hbox4 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox4); + gtk_container_add (GTK_CONTAINER (alignment3), hbox4); + + image3 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image3); + gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Apply"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + cancel_button = gtk_button_new (); + gtk_widget_show (cancel_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_button); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment2); + gtk_container_add (GTK_CONTAINER (cancel_button), alignment2); + + hbox3 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox3); + gtk_container_add (GTK_CONTAINER (alignment2), hbox3); + + image2 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image2); + gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Cancel"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + + g_signal_connect ( (gpointer) SurfaceInspector, + "delete_event", + G_CALLBACK (delete_event_callback), + NULL ); + g_signal_connect ((gpointer) SurfaceInspector, "destroy", + G_CALLBACK (gtk_widget_destroy), + NULL); + + g_signal_connect ((gpointer) texture_combo_entry, "key_press_event", + G_CALLBACK (on_texture_combo_entry_key_press_event), + NULL); + g_signal_connect ((gpointer) texture_combo_entry, "activate", + G_CALLBACK (on_texture_combo_entry_activate), + NULL); + + + g_signal_connect ((gpointer) hshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_hshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_vshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_hscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_vscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_offset_spinbutton, "value_changed", + G_CALLBACK (on_rotate_offset_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_value_spinbutton, "value_changed", + G_CALLBACK (on_hshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_value_spinbutton, "value_changed", + G_CALLBACK (on_vshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_value_spinbutton, "value_changed", + G_CALLBACK (on_hscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_value_spinbutton, "value_changed", + G_CALLBACK (on_vscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_value_spinbutton, "value_changed", + G_CALLBACK (on_rotate_value_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_step_spinbutton, "value_changed", + G_CALLBACK (on_hshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_step_spinbutton, "value_changed", + G_CALLBACK (on_vshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_step_spinbutton, "value_changed", + G_CALLBACK (on_hscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_step_spinbutton, "value_changed", + G_CALLBACK (on_vscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_step_spinbutton, "value_changed", + G_CALLBACK (on_rotate_step_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) match_grid_button, "clicked", + G_CALLBACK (on_match_grid_button_clicked), + NULL); + g_signal_connect ((gpointer) lock_valuechange_togglebutton, "toggled", + G_CALLBACK (on_lock_valuechange_togglebutton_toggled), + NULL); + + g_signal_connect ((gpointer) fit_width_spinbutton, "value_changed", + G_CALLBACK (on_fit_width_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_height_spinbutton, "value_changed", + G_CALLBACK (on_fit_height_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_button, "clicked", + G_CALLBACK (on_fit_button_clicked), + NULL); + + g_signal_connect ((gpointer) axial_button, "clicked", + G_CALLBACK (on_axial_button_clicked), + NULL); + + g_signal_connect ((gpointer) done_button, "clicked", + G_CALLBACK (on_done_button_clicked), + NULL); + g_signal_connect ((gpointer) apply_button, "clicked", + G_CALLBACK (on_apply_button_clicked), + NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_cancel_button_clicked), + NULL); + + + return SurfaceInspector; +} + + +// Texture Combo +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, + gpointer user_data) +{ + // Have Tab activate selection as well as Return + if (event->keyval == GDK_Tab) + g_signal_emit_by_name ( texture_combo_entry, "activate" ); + + return FALSE; +} + +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + char text[128] = { 0 }; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + // activate only on entry change + strcpy( text, gtk_entry_get_text(entry)); + if ( strcmp( old_texture_entry, text )) + { + // Check for spaces in shader name + if (text[0] <= ' ' || strchr(text, ' ')) + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text); + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + strcpy( old_texture_entry, text ); + tmp_texdef->SetName( text ); + } + GetTexMods(); + } + } + } +} + +// Offset Spins +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HShift_conflicting) + tmp_texdef->shift[0] = tmp_orig_texdef->shift[0] + texdef_offset.shift[0]; + else + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + } + GetTexMods(); + } +} + +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VShift_conflicting) + tmp_texdef->shift[1] = tmp_orig_texdef->shift[1] + texdef_offset.shift[1]; + else + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + } + GetTexMods(); + } + +} + +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HScale_conflicting) + tmp_texdef->scale[0] = tmp_orig_texdef->scale[0] + texdef_offset.scale[0]; + else + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + } + GetTexMods(); + } + + +} + +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VScale_conflicting) + tmp_texdef->scale[1] = tmp_orig_texdef->scale[1] + texdef_offset.scale[1]; + else + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + } + GetTexMods(); + } + +} + +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_Rotate_conflicting) + tmp_texdef->rotate = tmp_orig_texdef->rotate + texdef_offset.rotate; + else + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + } + GetTexMods(); + } + +} + + +// Match Grid +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data) +{ + float hscale, vscale; + + if( !strcmp(gtk_entry_get_text (GTK_ENTRY (hscale_value_spinbutton)), "") ) + hscale = 0.0; + else + hscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if( !strcmp( gtk_entry_get_text (GTK_ENTRY (vscale_value_spinbutton)), "") ) + vscale = 0.0; + else + vscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + DoSnapTToGrid (hscale, vscale); +} + + +// Lock out changes to Value +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + bool is_Locked; + + is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton)); + + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), is_Locked ); +} + + +// Value Spins +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + is_HShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + is_VShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + is_HScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + is_VScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + is_Rotate_conflicting = FALSE; + } + GetTexMods(); + } +} + + +// Step Spins +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[0] = val; +} + +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged VShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[1] = val; +} + +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[0] = val; +} + +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[1] = val; +} + +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->rotate = val; +} + + +// Fit Texture +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nWidth = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_width_spinbutton) ); +} + +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nHeight = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_height_spinbutton) ); +} + +static void on_fit_button_clicked (GtkButton *button, gpointer user_data) +{ + FaceList_FitTexture(get_texdef_face_list(), m_nHeight, m_nWidth); + Sys_UpdateWindows(W_ALL); +} + + +// Axial Button +static void on_axial_button_clicked (GtkButton *button, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_texdef->shift[0] = 0.0; + tmp_texdef->shift[1] = 0.0; + tmp_texdef->scale[0] = 0.5; + tmp_texdef->scale[1] = 0.5; + tmp_texdef->rotate = 0.0; + } + } + + SetTexdef_FaceList( get_texdef_face_list(), FALSE, TRUE ); + Sys_UpdateWindows(W_ALL); +} + + +// Action Buttons +static void on_done_button_clicked (GtkButton *button, gpointer user_data) +{ + if ( !texdef_face_list_empty() ) + GetTexMods(TRUE); + HideDlg(); + Sys_UpdateWindows(W_ALL); +} + +static void on_apply_button_clicked (GtkButton *button, gpointer user_data) +{ + if (!g_bListenChanged) + return; + + if ( !texdef_face_list_empty() ) + { + GetTexMods (TRUE); + Sys_UpdateWindows(W_CAMERA); + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } +} + +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data) +{ + texturewin = Texturewin (); + texturewin->texdef = g_old_texdef; + // cancel the last do if we own it + if ( (m_nUndoId == Undo_GetUndoId()) && ( m_nUndoId != 0 )) + { +#ifdef DBG_SI + Sys_Printf("OnCancel calling Undo_Undo\n"); +#endif + g_bListenUpdate = false; + Undo_Undo(TRUE); + g_bListenUpdate = true; + m_nUndoId = 0; + } + HideDlg(); +} + + diff --git a/plugins/imagehl/mip.h b/plugins/surface_quake2/surfacedialog.h similarity index 74% rename from plugins/imagehl/mip.h rename to plugins/surface_quake2/surfacedialog.h index 9403e512..4a5b815b 100644 --- a/plugins/imagehl/mip.h +++ b/plugins/surface_quake2/surfacedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,13 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_MIP_H) -#define INCLUDED_MIP_H +#ifndef _SURFACEDIALOG_H_ +#define _SURFACEDIALOG_H_ -class Image; -class ArchiveFile; - -Image* LoadMIP(ArchiveFile& file); - -#endif +void UpdateSurfaceDialog (); +void DoSurface (); +void ToggleSurface (); +void SurfaceDlgFitAll (); +GtkWidget *Get_SI_Module_Widget (); +#endif // _SURFACEDIALOG_H_ diff --git a/plugins/surface_quake2/surfaceflagsdialog_quake2.cpp b/plugins/surface_quake2/surfaceflagsdialog_quake2.cpp new file mode 100644 index 00000000..5978b4d5 --- /dev/null +++ b/plugins/surface_quake2/surfaceflagsdialog_quake2.cpp @@ -0,0 +1,1168 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include "surfdlg_plugin.h" + +#include "surfaceflagsdialog_quake2.h" + + GtkWidget *notebook1; + + GtkWidget *surface_lightbutton; + GtkWidget *surface_slickbutton; + GtkWidget *surface_skybutton; + GtkWidget *surface_warpbutton; + GtkWidget *surface_trans33button; + GtkWidget *surface_trans66button; + GtkWidget *surface_flowingbutton; + GtkWidget *surface_nodrawbutton; + GtkWidget *surface_hintbutton; + GtkWidget *surface_skipbutton; + + GtkWidget *content_solidbutton; + GtkWidget *content_windowbutton; + GtkWidget *content_auxbutton; + GtkWidget *content_lavabutton; + GtkWidget *content_slimebutton; + GtkWidget *content_waterbutton; + GtkWidget *content_mistbutton; + GtkWidget *content_areaportalbutton; + GtkWidget *content_playerclipbutton; + GtkWidget *content_monsterclipbutton; + GtkWidget *content_current0button; + GtkWidget *content_current90button; + GtkWidget *content_current180button; + GtkWidget *content_current270button; + GtkWidget *content_currentUPbutton; + GtkWidget *content_currentDOWNbutton; + GtkWidget *content_originbutton; + GtkWidget *content_detailbutton; + GtkWidget *content_translucentbutton; + GtkWidget *content_ladderbutton; + + GtkWidget *surfacebutton; + GtkWidget *contentbutton; + + GtkWidget *value_entry; + gboolean setup_buttons = TRUE; + + int working_surface_flags; + int surface_mask; + int working_content_flags; + int content_mask; + int working_value; + +inline void set_inconsistent(GtkWidget *toggle_button) +{ + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE); +} + +inline void clear_inconsistent(GtkWidget *toggle_button) +{ + GtkWidget *button_label; + + if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) ) + { + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE); + } + +} + +void clear_all_inconsistent(void) +{ + clear_inconsistent( surface_lightbutton ); + clear_inconsistent( surface_slickbutton ); + clear_inconsistent( surface_skybutton ); + clear_inconsistent( surface_warpbutton ); + clear_inconsistent( surface_trans33button ); + clear_inconsistent( surface_trans66button ); + clear_inconsistent( surface_flowingbutton ); + clear_inconsistent( surface_nodrawbutton ); + clear_inconsistent( surface_hintbutton ); + clear_inconsistent( surface_skipbutton ); + + clear_inconsistent( content_solidbutton ); + clear_inconsistent( content_windowbutton ); + clear_inconsistent( content_auxbutton ); + clear_inconsistent( content_lavabutton ); + clear_inconsistent( content_slimebutton ); + clear_inconsistent( content_waterbutton ); + clear_inconsistent( content_mistbutton ); + clear_inconsistent( content_areaportalbutton ); + clear_inconsistent( content_playerclipbutton ); + clear_inconsistent( content_monsterclipbutton ); + clear_inconsistent( content_current0button ); + clear_inconsistent( content_current90button ); + clear_inconsistent( content_current180button ); + clear_inconsistent( content_current270button ); + clear_inconsistent( content_currentUPbutton ); + clear_inconsistent( content_currentDOWNbutton ); + clear_inconsistent( content_originbutton ); + clear_inconsistent( content_detailbutton ); + clear_inconsistent( content_translucentbutton ); + clear_inconsistent( content_ladderbutton ); +} + +void clear_all_buttons_and_values() +{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_lightbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE); + + gtk_entry_set_text( (GtkEntry *)value_entry, ""); +} + +void SetFlagButtons_Quake2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty) +{ + int i; + int contents = 0; + int flags = 0; + int value = 0; + int diff_contents = 0; + int diff_flags = 0; + gboolean diff_value = FALSE; + char tex_buff[11]; + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + + + setup_buttons = TRUE; + working_surface_flags = 0; + surface_mask = 0; + working_content_flags = 0; + content_mask = 0; + working_value = 0; + + if(!b_isListEmpty) + { + tmp_texdef = &texdef_face_list->texdef; + contents = tmp_texdef->contents; + flags = tmp_texdef->flags; + value = tmp_texdef->value; + + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value); + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value); + + for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent + diff_flags |= flags ^ tmp_texdef->flags; + if (tmp_texdef->value != value) + diff_value = TRUE; + + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value); + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value); + + } + } + + + + clear_all_inconsistent(); + + // If no faces/brushes are selected, clear everything and bail + if(b_isListEmpty) + { + clear_all_buttons_and_values(); + setup_buttons = FALSE; + return; + } + + // Set surface buttons to reflect brush/face flags, contents, and values + if(diff_flags & QUAKE2_SURF_LIGHT) + set_inconsistent(surface_lightbutton); + else if(flags & QUAKE2_SURF_LIGHT) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_lightbutton), FALSE); + + if(diff_flags & QUAKE2_SURF_SLICK) + set_inconsistent(surface_slickbutton); + else if(flags & QUAKE2_SURF_SLICK) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_slickbutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_SKY) + set_inconsistent(surface_skybutton); + else if(flags & QUAKE2_SURF_SKY) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skybutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_WARP) + set_inconsistent(surface_warpbutton); + else if(flags & QUAKE2_SURF_WARP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_warpbutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_TRANS33) + set_inconsistent(surface_trans33button); + else if(flags & QUAKE2_SURF_TRANS33) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans33button ), FALSE); + + if(diff_flags & QUAKE2_SURF_TRANS66) + set_inconsistent(surface_trans66button); + else if(flags & QUAKE2_SURF_TRANS66) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_trans66button ), FALSE); + + if(diff_flags & QUAKE2_SURF_FLOWING) + set_inconsistent(surface_flowingbutton); + else if(flags & QUAKE2_SURF_FLOWING) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_flowingbutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_NODRAW) + set_inconsistent(surface_nodrawbutton); + else if(flags & QUAKE2_SURF_NODRAW) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_nodrawbutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_HINT) + set_inconsistent(surface_hintbutton); + else if(flags & QUAKE2_SURF_HINT) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_hintbutton ), FALSE); + + if(diff_flags & QUAKE2_SURF_SKIP) + set_inconsistent(surface_skipbutton); + else if(flags & QUAKE2_SURF_SKIP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_skipbutton ), FALSE); + + // Set content buttons to reflect brush values + if(diff_contents & QUAKE2_CONTENTS_SOLID) + set_inconsistent(content_solidbutton); + else if(contents & QUAKE2_CONTENTS_SOLID) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_solidbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_WINDOW) + set_inconsistent(content_windowbutton); + else if(contents & QUAKE2_CONTENTS_WINDOW) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_windowbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_AUX) + set_inconsistent(content_auxbutton); + else if(contents & QUAKE2_CONTENTS_AUX) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_auxbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_LAVA) + set_inconsistent(content_lavabutton); + else if(contents & QUAKE2_CONTENTS_LAVA) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_lavabutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_SLIME) + set_inconsistent(content_slimebutton); + else if(contents & QUAKE2_CONTENTS_SLIME) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_slimebutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_WATER) + set_inconsistent(content_waterbutton); + else if(contents & QUAKE2_CONTENTS_WATER) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_waterbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_MIST) + set_inconsistent(content_mistbutton); + else if(contents & QUAKE2_CONTENTS_MIST) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_mistbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_AREAPORTAL) + set_inconsistent(content_areaportalbutton); + else if(contents & QUAKE2_CONTENTS_AREAPORTAL) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_areaportalbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_PLAYERCLIP) + set_inconsistent(content_playerclipbutton); + else if(contents & QUAKE2_CONTENTS_PLAYERCLIP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_playerclipbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_MONSTERCLIP) + set_inconsistent(content_monsterclipbutton); + else if(contents & QUAKE2_CONTENTS_MONSTERCLIP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_monsterclipbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_0) + set_inconsistent(content_current0button); + else if(contents & QUAKE2_CONTENTS_CURRENT_0) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current0button ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_90) + set_inconsistent(content_current90button); + else if(contents & QUAKE2_CONTENTS_CURRENT_90) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current90button ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_180) + set_inconsistent(content_current180button); + else if(contents & QUAKE2_CONTENTS_CURRENT_180) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current180button ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_270) + set_inconsistent(content_current270button); + else if(contents & QUAKE2_CONTENTS_CURRENT_270) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_current270button ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_UP) + set_inconsistent(content_currentUPbutton); + else if(contents & QUAKE2_CONTENTS_CURRENT_UP) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentUPbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_CURRENT_DOWN) + set_inconsistent(content_currentDOWNbutton); + else if(contents & QUAKE2_CONTENTS_CURRENT_DOWN) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_currentDOWNbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_ORIGIN) + set_inconsistent(content_originbutton); + else if(contents & QUAKE2_CONTENTS_ORIGIN) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_originbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_DETAIL) + set_inconsistent(content_detailbutton); + else if(contents & QUAKE2_CONTENTS_DETAIL) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_detailbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_TRANSLUCENT) + set_inconsistent(content_translucentbutton); + else if(contents & QUAKE2_CONTENTS_TRANSLUCENT) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_translucentbutton ), FALSE); + + if(diff_contents & QUAKE2_CONTENTS_LADDER) + set_inconsistent(content_ladderbutton); + else if(contents & QUAKE2_CONTENTS_LADDER) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_ladderbutton ), FALSE); + + // Set Value + if(diff_value) + gtk_entry_set_text( (GtkEntry *)value_entry, ""); + else + { + working_value = value; + sprintf( tex_buff, "%d", value); + gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff); + } + + setup_buttons = FALSE; +} + +void SetChangeInFlags_Face_Quake2 (texdef_to_face_t *texdef_face_list) +{ + texdef_to_face_t *temp_texdef_face_list; + texdef_t *tmp_texdef; + + for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags; + tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags; + tmp_texdef->value = working_value; + Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask); + Sys_Printf("content: %d\n",tmp_texdef->contents); + } +} + +inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to) +{ + + if (!setup_buttons) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set + clear_inconsistent(GTK_WIDGET (togglebutton)); + + surface_mask |= sur_flag; + + if (change_flag_to) + working_surface_flags |= sur_flag; + else + working_surface_flags &= ~sur_flag; + } +} + +inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to) +{ + + if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) + clear_inconsistent(togglebutton); + //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces. + //{ + content_mask |= content_flag; + + if (change_flag_to) + working_content_flags |= content_flag; + else + working_content_flags &= ~content_flag; + //} + Sys_Printf("content_flag: %d content_mask: %d\n",content_flag,content_mask); + } +} + +// Surface Flags Callbacks +void +on_surface_lightbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_lightbutton, QUAKE2_SURF_LIGHT, (GTK_TOGGLE_BUTTON (surface_lightbutton)->active)); + +} + +void +on_surface_slickbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_slickbutton, QUAKE2_SURF_SLICK, (GTK_TOGGLE_BUTTON (surface_slickbutton)->active)); + +} + +void +on_surface_skybutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_skybutton, QUAKE2_SURF_SKY, (GTK_TOGGLE_BUTTON (surface_skybutton)->active)); +} + +void +on_surface_warpbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_warpbutton, QUAKE2_SURF_WARP, (GTK_TOGGLE_BUTTON (surface_warpbutton)->active)); +} + +void +on_surface_trans33button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_trans33button, QUAKE2_SURF_TRANS33, (GTK_TOGGLE_BUTTON (surface_trans33button)->active)); +} + +void +on_surface_trans66button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_trans66button, QUAKE2_SURF_TRANS66, (GTK_TOGGLE_BUTTON (surface_trans66button)->active)); +} + +void +on_surface_flowingbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_flowingbutton, QUAKE2_SURF_FLOWING, (GTK_TOGGLE_BUTTON (surface_flowingbutton)->active)); +} + +void +on_surface_nodrawbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_nodrawbutton, QUAKE2_SURF_NODRAW, (GTK_TOGGLE_BUTTON (surface_nodrawbutton)->active)); +} + +void +on_surface_hintbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_hintbutton, QUAKE2_SURF_HINT, (GTK_TOGGLE_BUTTON (surface_hintbutton)->active)); +} + +void +on_surface_skipbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_surfaceflag(surface_skipbutton, QUAKE2_SURF_SKIP, (GTK_TOGGLE_BUTTON (surface_skipbutton)->active)); +} + +// Content Flags Callbacks +void +on_content_solidbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_solidbutton, QUAKE2_CONTENTS_SOLID, (GTK_TOGGLE_BUTTON (content_solidbutton)->active)); +} + +void +on_content_windowbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_windowbutton, QUAKE2_CONTENTS_WINDOW, (GTK_TOGGLE_BUTTON (content_windowbutton)->active)); +} + +void +on_content_auxbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_auxbutton, QUAKE2_CONTENTS_AUX, (GTK_TOGGLE_BUTTON (content_auxbutton)->active)); +} + +void +on_content_lavabutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_lavabutton, QUAKE2_CONTENTS_LAVA, (GTK_TOGGLE_BUTTON (content_lavabutton)->active)); +} + +void +on_content_slimebutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_slimebutton, QUAKE2_CONTENTS_SLIME, (GTK_TOGGLE_BUTTON (content_slimebutton)->active)); +} + +void +on_content_waterbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_waterbutton, QUAKE2_CONTENTS_WATER, (GTK_TOGGLE_BUTTON (content_waterbutton)->active)); +} + +void +on_content_mistbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_mistbutton, QUAKE2_CONTENTS_MIST, (GTK_TOGGLE_BUTTON (content_mistbutton)->active)); +} + +void +on_content_areaportalbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_areaportalbutton, QUAKE2_CONTENTS_AREAPORTAL, (GTK_TOGGLE_BUTTON (content_areaportalbutton)->active)); +} + +void +on_content_playerclipbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_playerclipbutton, QUAKE2_CONTENTS_PLAYERCLIP, (GTK_TOGGLE_BUTTON (content_playerclipbutton)->active)); +} + +void +on_content_monsterclipbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_monsterclipbutton, QUAKE2_CONTENTS_MONSTERCLIP, (GTK_TOGGLE_BUTTON (content_monsterclipbutton)->active)); +} + +void +on_content_current0button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current0button, QUAKE2_CONTENTS_CURRENT_0, (GTK_TOGGLE_BUTTON (content_current0button)->active)); +} + +void +on_content_current90button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current90button, QUAKE2_CONTENTS_CURRENT_90, (GTK_TOGGLE_BUTTON (content_current90button)->active)); +} + +void +on_content_current180button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current180button, QUAKE2_CONTENTS_CURRENT_180, (GTK_TOGGLE_BUTTON (content_current180button)->active)); +} + +void +on_content_current270button_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_current270button, QUAKE2_CONTENTS_CURRENT_270, (GTK_TOGGLE_BUTTON (content_current270button)->active)); +} + +void +on_content_currentUPbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_currentUPbutton, QUAKE2_CONTENTS_CURRENT_UP, (GTK_TOGGLE_BUTTON (content_currentUPbutton)->active)); +} + +void +on_content_currentDOWNbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_currentDOWNbutton, QUAKE2_CONTENTS_CURRENT_DOWN, (GTK_TOGGLE_BUTTON (content_currentDOWNbutton)->active)); +} + +void +on_content_originbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_originbutton, QUAKE2_CONTENTS_ORIGIN, (GTK_TOGGLE_BUTTON (content_originbutton)->active)); +} + +void +on_content_detailbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_detailbutton, QUAKE2_CONTENTS_DETAIL, (GTK_TOGGLE_BUTTON (content_detailbutton)->active)); +} + +void +on_content_translucentbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_translucentbutton, QUAKE2_CONTENTS_TRANSLUCENT, (GTK_TOGGLE_BUTTON (content_translucentbutton)->active)); +} + +void +on_content_ladderbutton_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + change_contentflag(content_ladderbutton, QUAKE2_CONTENTS_LADDER, (GTK_TOGGLE_BUTTON (content_ladderbutton)->active)); +} + +// Value Entry Callback +void +on_value_entry_changed (GtkEditable *editable, + gpointer user_data) +{ + if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value + working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) ); +} + +void +on_value_entry_insert_text (GtkEditable *editable, + gchar *new_text, + gint new_text_length, + gint *position, + gpointer user_data) +{ + int i, count=0; + gchar *result; + int entry_value; + texdef_t *pt; + brush_t *b; + face_t *f; + + // Limit input to digits, throwing out anything else + // Modified from Gtk FAQ for text filtering of GtkEntry + result = g_new (gchar, new_text_length); + + for (i=0; i < new_text_length; i++) { + if (!isdigit(new_text[i])) + continue; + result[count++] = new_text[i]; + } + + if (count > 0) { + gtk_signal_handler_block_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + user_data); + gtk_editable_insert_text (editable, result, count, position); + gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + user_data); + } + gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text"); + + g_free (result); +} + +void +on_surfacebutton_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 0); +} + +void +on_contentbutton_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1); +} + + +#define QUAKE2_FLAG_BUTTON_BORDER 3 + +GtkWidget* Create_Quake2FlagsDialog (GtkWidget* surfacedialog_widget) +{ + GtkWidget *frame1; + GtkWidget *vbox1; + GtkWidget *vbox2; + GtkWidget *vbox3; + GtkWidget *vbox4; + GtkWidget *table4; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hseparator1; + GtkWidget *value_label; + GtkWidget *label5; + GtkWidget *table3; + GtkWidget *label6; + GtkWidget *table1; + + + frame1 = gtk_frame_new ("Flags"); + gtk_widget_show (frame1); + gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox1); + gtk_container_add (GTK_CONTAINER (frame1), vbox1); + + notebook1 = gtk_notebook_new (); + gtk_widget_show (notebook1); + gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook1), TRUE); + gtk_container_set_border_width (GTK_CONTAINER (notebook1), 5); + + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (notebook1), vbox2); + + table4 = gtk_table_new (3, 4, FALSE); + gtk_widget_show (table4); + gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0); + + surface_lightbutton = gtk_toggle_button_new_with_label ("Light"); + gtk_signal_connect (GTK_OBJECT (surface_lightbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_lightbutton_toggled), + NULL); + gtk_widget_show (surface_lightbutton); + gtk_table_attach (GTK_TABLE (table4), surface_lightbutton, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_lightbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_slickbutton = gtk_toggle_button_new_with_label ("Slick"); + gtk_signal_connect (GTK_OBJECT (surface_slickbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_slickbutton_toggled), + NULL); + gtk_widget_show (surface_slickbutton); + gtk_table_attach (GTK_TABLE (table4), surface_slickbutton, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_slickbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_skybutton = gtk_toggle_button_new_with_label ("Sky"); + gtk_signal_connect (GTK_OBJECT (surface_skybutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_skybutton_toggled), + NULL); + gtk_widget_show (surface_skybutton); + gtk_table_attach (GTK_TABLE (table4), surface_skybutton, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_skybutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_warpbutton = gtk_toggle_button_new_with_label ("Warp"); + gtk_signal_connect (GTK_OBJECT (surface_warpbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_warpbutton_toggled), + NULL); + gtk_widget_show (surface_warpbutton); + gtk_table_attach (GTK_TABLE (table4), surface_warpbutton, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_warpbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_trans33button = gtk_toggle_button_new_with_label ("Trans 33"); + gtk_signal_connect (GTK_OBJECT (surface_trans33button), "toggled", + GTK_SIGNAL_FUNC (on_surface_trans33button_toggled), + NULL); + gtk_widget_show (surface_trans33button); + gtk_table_attach (GTK_TABLE (table4), surface_trans33button, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_trans33button), QUAKE2_FLAG_BUTTON_BORDER); + + surface_trans66button = gtk_toggle_button_new_with_label ("Trans 66"); + gtk_signal_connect (GTK_OBJECT (surface_trans66button), "toggled", + GTK_SIGNAL_FUNC (on_surface_trans66button_toggled), + NULL); + gtk_widget_show (surface_trans66button); + gtk_table_attach (GTK_TABLE (table4), surface_trans66button, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_trans66button), QUAKE2_FLAG_BUTTON_BORDER); + + surface_flowingbutton = gtk_toggle_button_new_with_label ("Flowing"); + gtk_signal_connect (GTK_OBJECT (surface_flowingbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_flowingbutton_toggled), + NULL); + gtk_widget_show (surface_flowingbutton); + gtk_table_attach (GTK_TABLE (table4), surface_flowingbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_flowingbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_nodrawbutton = gtk_toggle_button_new_with_label ("NoDraw"); + gtk_signal_connect (GTK_OBJECT (surface_nodrawbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_nodrawbutton_toggled), + NULL); + gtk_widget_show (surface_nodrawbutton); + gtk_table_attach (GTK_TABLE (table4), surface_nodrawbutton, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_nodrawbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_hintbutton = gtk_toggle_button_new_with_label ("Hint"); + gtk_signal_connect (GTK_OBJECT (surface_hintbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_hintbutton_toggled), + NULL); + gtk_widget_show (surface_hintbutton); + gtk_table_attach (GTK_TABLE (table4), surface_hintbutton, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_hintbutton), QUAKE2_FLAG_BUTTON_BORDER); + + surface_skipbutton = gtk_toggle_button_new_with_label ("Skip"); + gtk_signal_connect (GTK_OBJECT (surface_skipbutton), "toggled", + GTK_SIGNAL_FUNC (on_surface_skipbutton_toggled), + NULL); + gtk_widget_show (surface_skipbutton); + gtk_table_attach (GTK_TABLE (table4), surface_skipbutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_skipbutton), QUAKE2_FLAG_BUTTON_BORDER); + + hseparator1 = gtk_hseparator_new (); + gtk_widget_show (hseparator1); + gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, FALSE, FALSE, 0); + gtk_widget_set_usize (hseparator1, -2, 5); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0); + + hbox3 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox3); + gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0); + + vbox4 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox4); + gtk_box_pack_start (GTK_BOX (hbox3), vbox4, TRUE, TRUE, 0); + + value_label = gtk_label_new (" Value: "); + gtk_widget_show (value_label); + gtk_box_pack_start (GTK_BOX (hbox3), value_label, FALSE, FALSE, 0); + + value_entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (value_entry), "changed", + GTK_SIGNAL_FUNC (on_value_entry_changed), + NULL); + gtk_signal_connect (GTK_OBJECT (value_entry), "insert_text", + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + NULL); + gtk_entry_set_max_length( (GtkEntry *)value_entry, 11); + gtk_widget_show (value_entry); + gtk_box_pack_start (GTK_BOX (hbox3), value_entry, TRUE, TRUE, 0); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (hbox3), vbox3, TRUE, TRUE, 0); + + label5 = gtk_label_new ("Surface Flags"); + gtk_widget_show (label5); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5); + + table3 = gtk_table_new (5, 4, FALSE); + gtk_widget_show (table3); + gtk_container_add (GTK_CONTAINER (notebook1), table3); + + content_solidbutton = gtk_toggle_button_new_with_label ("Solid"); + gtk_signal_connect (GTK_OBJECT (content_solidbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_solidbutton_toggled), + NULL); + gtk_widget_show (content_solidbutton); + gtk_table_attach (GTK_TABLE (table3), content_solidbutton, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_solidbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_windowbutton = gtk_toggle_button_new_with_label ("Window"); + gtk_signal_connect (GTK_OBJECT (content_windowbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_windowbutton_toggled), + NULL); + gtk_widget_show (content_windowbutton); + gtk_table_attach (GTK_TABLE (table3), content_windowbutton, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_windowbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_auxbutton = gtk_toggle_button_new_with_label ("Aux"); + gtk_signal_connect (GTK_OBJECT (content_auxbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_auxbutton_toggled), + NULL); + gtk_widget_show (content_auxbutton); + gtk_table_attach (GTK_TABLE (table3), content_auxbutton, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_auxbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_lavabutton = gtk_toggle_button_new_with_label ("Lava"); + gtk_signal_connect (GTK_OBJECT (content_lavabutton), "toggled", + GTK_SIGNAL_FUNC (on_content_lavabutton_toggled), + NULL); + gtk_widget_show (content_lavabutton); + gtk_table_attach (GTK_TABLE (table3), content_lavabutton, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_lavabutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_slimebutton = gtk_toggle_button_new_with_label ("Slime"); + gtk_signal_connect (GTK_OBJECT (content_slimebutton), "toggled", + GTK_SIGNAL_FUNC (on_content_slimebutton_toggled), + NULL); + gtk_widget_show (content_slimebutton); + gtk_table_attach (GTK_TABLE (table3), content_slimebutton, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_slimebutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_waterbutton = gtk_toggle_button_new_with_label ("Water"); + gtk_signal_connect (GTK_OBJECT (content_waterbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_waterbutton_toggled), + NULL); + gtk_widget_show (content_waterbutton); + gtk_table_attach (GTK_TABLE (table3), content_waterbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_waterbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_mistbutton = gtk_toggle_button_new_with_label ("Mist"); + gtk_signal_connect (GTK_OBJECT (content_mistbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_mistbutton_toggled), + NULL); + gtk_widget_show (content_mistbutton); + gtk_table_attach (GTK_TABLE (table3), content_mistbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_mistbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_areaportalbutton = gtk_toggle_button_new_with_label ("AreaPortal"); + gtk_signal_connect (GTK_OBJECT (content_areaportalbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_areaportalbutton_toggled), + NULL); + gtk_widget_show (content_areaportalbutton); + gtk_table_attach (GTK_TABLE (table3), content_areaportalbutton, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_areaportalbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_playerclipbutton = gtk_toggle_button_new_with_label ("PlayerClip"); + gtk_signal_connect (GTK_OBJECT (content_playerclipbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_playerclipbutton_toggled), + NULL); + gtk_widget_show (content_playerclipbutton); + gtk_table_attach (GTK_TABLE (table3), content_playerclipbutton, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_playerclipbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_monsterclipbutton = gtk_toggle_button_new_with_label ("MonsterClip"); + gtk_signal_connect (GTK_OBJECT (content_monsterclipbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_monsterclipbutton_toggled), + NULL); + gtk_widget_show (content_monsterclipbutton); + gtk_table_attach (GTK_TABLE (table3), content_monsterclipbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_monsterclipbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_current0button = gtk_toggle_button_new_with_label ("Current 0"); + gtk_signal_connect (GTK_OBJECT (content_current0button), "toggled", + GTK_SIGNAL_FUNC (on_content_current0button_toggled), + NULL); + gtk_widget_show (content_current0button); + gtk_table_attach (GTK_TABLE (table3), content_current0button, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_current0button), QUAKE2_FLAG_BUTTON_BORDER); + + content_current90button = gtk_toggle_button_new_with_label ("Current 90"); + gtk_signal_connect (GTK_OBJECT (content_current90button), "toggled", + GTK_SIGNAL_FUNC (on_content_current90button_toggled), + NULL); + gtk_widget_show (content_current90button); + gtk_table_attach (GTK_TABLE (table3), content_current90button, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_current90button), QUAKE2_FLAG_BUTTON_BORDER); + + content_current180button = gtk_toggle_button_new_with_label ("Current 180"); + gtk_signal_connect (GTK_OBJECT (content_current180button), "toggled", + GTK_SIGNAL_FUNC (on_content_current180button_toggled), + NULL); + gtk_widget_show (content_current180button); + gtk_table_attach (GTK_TABLE (table3), content_current180button, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_current180button), QUAKE2_FLAG_BUTTON_BORDER); + + content_current270button = gtk_toggle_button_new_with_label ("Current 270"); + gtk_signal_connect (GTK_OBJECT (content_current270button), "toggled", + GTK_SIGNAL_FUNC (on_content_current270button_toggled), + NULL); + gtk_widget_show (content_current270button); + gtk_table_attach (GTK_TABLE (table3), content_current270button, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_current270button), QUAKE2_FLAG_BUTTON_BORDER); + + content_currentUPbutton = gtk_toggle_button_new_with_label ("Current UP"); + gtk_signal_connect (GTK_OBJECT (content_currentUPbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_currentUPbutton_toggled), + NULL); + gtk_widget_show (content_currentUPbutton); + gtk_table_attach (GTK_TABLE (table3), content_currentUPbutton, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_currentUPbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_currentDOWNbutton = gtk_toggle_button_new_with_label ("Current DOWN"); + gtk_signal_connect (GTK_OBJECT (content_currentDOWNbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_currentDOWNbutton_toggled), + NULL); + gtk_widget_show (content_currentDOWNbutton); + gtk_table_attach (GTK_TABLE (table3), content_currentDOWNbutton, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_currentDOWNbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_originbutton = gtk_toggle_button_new_with_label ("Origin"); + gtk_signal_connect (GTK_OBJECT (content_originbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_originbutton_toggled), + NULL); + gtk_widget_show (content_originbutton); + gtk_table_attach (GTK_TABLE (table3), content_originbutton, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_originbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_detailbutton = gtk_toggle_button_new_with_label ("Detail"); + gtk_signal_connect (GTK_OBJECT (content_detailbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_detailbutton_toggled), + NULL); + gtk_widget_show (content_detailbutton); + gtk_table_attach (GTK_TABLE (table3), content_detailbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_detailbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_translucentbutton = gtk_toggle_button_new_with_label ("Translucent"); + gtk_signal_connect (GTK_OBJECT (content_translucentbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_translucentbutton_toggled), + NULL); + gtk_widget_show (content_translucentbutton); + gtk_table_attach (GTK_TABLE (table3), content_translucentbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_translucentbutton), QUAKE2_FLAG_BUTTON_BORDER); + + content_ladderbutton = gtk_toggle_button_new_with_label ("Ladder"); + gtk_signal_connect (GTK_OBJECT (content_ladderbutton), "toggled", + GTK_SIGNAL_FUNC (on_content_ladderbutton_toggled), + NULL); + gtk_widget_show (content_ladderbutton); + gtk_table_attach (GTK_TABLE (table3), content_ladderbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_ladderbutton), QUAKE2_FLAG_BUTTON_BORDER); + + label6 = gtk_label_new ("Content Flags"); + gtk_widget_show (label6); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label6); + + return frame1; +} + diff --git a/plugins/surface_quake2/surfaceflagsdialog_quake2.h b/plugins/surface_quake2/surfaceflagsdialog_quake2.h new file mode 100644 index 00000000..985c3708 --- /dev/null +++ b/plugins/surface_quake2/surfaceflagsdialog_quake2.h @@ -0,0 +1,108 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _SURFACEFLAGSDIALOG_QUAKE2_H + #define _SURFACEFLAGSDIALOG_QUAKE2_H + + +#define QUAKE2_SURF_LIGHT 0x1 +#define QUAKE2_SURF_SLICK 0x2 +#define QUAKE2_SURF_SKY 0x4 +#define QUAKE2_SURF_WARP 0x8 +#define QUAKE2_SURF_TRANS33 0x10 +#define QUAKE2_SURF_TRANS66 0x20 +#define QUAKE2_SURF_FLOWING 0x40 +#define QUAKE2_SURF_NODRAW 0x80 +#define QUAKE2_SURF_HINT 0x100 +#define QUAKE2_SURF_SKIP 0x200 + + +#define QUAKE2_CONTENTS_SOLID 0x1 +#define QUAKE2_CONTENTS_WINDOW 0x2 +#define QUAKE2_CONTENTS_AUX 0x4 +#define QUAKE2_CONTENTS_LAVA 0x8 +#define QUAKE2_CONTENTS_SLIME 0x10 +#define QUAKE2_CONTENTS_WATER 0x20 +#define QUAKE2_CONTENTS_MIST 0x40 + +#define QUAKE2_CONTENTS_AREAPORTAL 0x8000 +#define QUAKE2_CONTENTS_PLAYERCLIP 0x10000 +#define QUAKE2_CONTENTS_MONSTERCLIP 0x20000 +#define QUAKE2_CONTENTS_CURRENT_0 0x40000 +#define QUAKE2_CONTENTS_CURRENT_90 0x80000 +#define QUAKE2_CONTENTS_CURRENT_180 0x100000 +#define QUAKE2_CONTENTS_CURRENT_270 0x200000 +#define QUAKE2_CONTENTS_CURRENT_UP 0x400000 +#define QUAKE2_CONTENTS_CURRENT_DOWN 0x800000 +#define QUAKE2_CONTENTS_ORIGIN 0x1000000 + +#define QUAKE2_CONTENTS_DETAIL 0x8000000 +#define QUAKE2_CONTENTS_TRANSLUCENT 0x10000000 +#define QUAKE2_CONTENTS_LADDER 0x20000000 +/* +extern GtkWidget *notebook1; + +extern GtkWidget *surface_lightbutton; +extern GtkWidget *surface_slickbutton; +extern GtkWidget *surface_skybutton; +extern GtkWidget *surface_warpbutton; +extern GtkWidget *surface_trans33button; +extern GtkWidget *surface_trans66button; +extern GtkWidget *surface_flowingbutton; +extern GtkWidget *surface_nodrawbutton; +extern GtkWidget *surface_hintbutton; +extern GtkWidget *surface_skipbutton; + +extern GtkWidget *content_solidbutton; +extern GtkWidget *content_windowbutton; +extern GtkWidget *content_auxbutton; +extern GtkWidget *content_lavabutton; +extern GtkWidget *content_slimebutton; +extern GtkWidget *content_waterbutton; +extern GtkWidget *content_mistbutton; +extern GtkWidget *content_areaportalbutton; +extern GtkWidget *content_playerclipbutton; +extern GtkWidget *content_monsterclipbutton; +extern GtkWidget *content_current0button; +extern GtkWidget *content_current90button; +extern GtkWidget *content_current180button; +extern GtkWidget *content_current270button; +extern GtkWidget *content_currentUPbutton; +extern GtkWidget *content_currentDOWNbutton; +extern GtkWidget *content_originbutton; +extern GtkWidget *content_detailbutton; +extern GtkWidget *content_translucentbutton; +extern GtkWidget *content_ladderbutton; + +extern GtkWidget *surfacebutton; +extern GtkWidget *contentbutton; + +extern GtkWidget *value_entry; +extern gboolean setup_buttons; + +extern int working_surface_flags; +extern int surface_mask; +extern int working_content_flags; +extern int content_mask; +extern int working_value; +*/ + +#endif // _SURFACEFLAGSDIALOG_QUAKE2_H diff --git a/plugins/surface_quake2/surfdlg_plugin.cpp b/plugins/surface_quake2/surfdlg_plugin.cpp new file mode 100644 index 00000000..58c95f16 --- /dev/null +++ b/plugins/surface_quake2/surfdlg_plugin.cpp @@ -0,0 +1,127 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include "surfdlg_plugin.h" +#include "surfacedialog.h" + +#include "synapse.h" + +class CSynapseClient_SurfDLG : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + bool OnActivate(); + + CSynapseClient_SurfDLG() { } + virtual ~CSynapseClient_SurfDLG() { } +}; + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; +_QERUndoTable g_UndoTable; +_QERAppSurfaceTable g_AppSurfaceTable; +_QERSelectedFaceTable g_SelectedFaceTable; +_QERShadersTable g_ShadersTable; +_QERAppShadersTable g_AppShadersTable; +_QERAppDataTable g_AppDataTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClient_SurfDLG g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(SURFACEDIALOG_MAJOR, "quake2", sizeof(_QERPlugSurfaceTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable), SYN_REQUIRE, &g_UndoTable); + g_SynapseClient.AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable), SYN_REQUIRE, &g_AppSurfaceTable); + g_SynapseClient.AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable), SYN_REQUIRE, &g_SelectedFaceTable); + g_SynapseClient.AddAPI(SHADERS_MAJOR, "quake2", sizeof(_QERShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable), SYN_REQUIRE, &g_AppShadersTable); + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_AppDataTable); + + return &g_SynapseClient; +} + +bool CSynapseClient_SurfDLG::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, SURFACEDIALOG_MAJOR)) + { + _QERPlugSurfaceTable* pSurfDialogTable= static_cast<_QERPlugSurfaceTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "quake2")) + { + pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface; + pSurfDialogTable->m_pfnDoSurface = &DoSurface; + pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; + pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; + pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClient_SurfDLG::GetInfo() +{ + return "Surface Dialog (Quake 2) module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClient_SurfDLG::GetName() +{ + return "surface"; +} + +bool CSynapseClient_SurfDLG::OnActivate() +{ + return true; +} diff --git a/plugins/surface_quake2/surfdlg_plugin.h b/plugins/surface_quake2/surfdlg_plugin.h new file mode 100644 index 00000000..f5391344 --- /dev/null +++ b/plugins/surface_quake2/surfdlg_plugin.h @@ -0,0 +1,94 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _SURFDLG_PLUGIN_H_ +#define _SURFDLG_PLUGIN_H_ + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "qerplugin.h" +#include "synapse.h" +#include "iselectedface.h" +#include "iundo.h" +#include "ishaders.h" +#include "mathlib.h" +#include "missing.h" +#include "idata.h" + +#include "isurfaceplugin.h" + +class SurfaceDialog : public IPluginTexdef +{ + int refCount; +public: + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () { if ( --refCount <= 0 ) delete this; } +}; + +extern _QERFuncTable_1 g_FuncTable; +extern _QERUndoTable g_UndoTable; +extern _QERAppSurfaceTable g_AppSurfaceTable; +extern _QERSelectedFaceTable g_SelectedFaceTable; +extern _QERShadersTable g_ShadersTable; +extern _QERAppShadersTable g_AppShadersTable; +extern _QERAppDataTable g_AppDataTable; + +#define GetSelectedFaceCount g_SelectedFaceTable.m_pfnGetSelectedFaceCount + +#define Undo_Undo g_UndoTable.m_pfnUndo_Undo +#define Undo_GetUndoId g_UndoTable.m_pfnUndo_GetUndoId + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf +#define Sys_UpdateWindows g_FuncTable.m_pfnSysUpdateWindows + + +#define Select_FitTexture g_AppSurfaceTable.m_pfnSelect_FitTexture +#define Get_SI_Inc g_AppSurfaceTable.m_pfnQERApp_QeglobalsSavedinfo_SIInc +#define GridSize g_AppSurfaceTable.m_pfnQeglobalsGetGridSize +#define FaceList_FitTexture g_AppSurfaceTable.m_pfnFaceList_FitTexture +#define GetMainWindow g_AppSurfaceTable.m_pfnGetMainWindow +#define GetSelectedFaceCountfromBrushes g_AppSurfaceTable.m_pfnGetSelectedFaceCountfromBrushes +#define GetSelFacesTexdef g_AppSurfaceTable.m_pfnGetSelFacesTexdef +#define SetTexdef_FaceList g_AppSurfaceTable.m_pfnSetTexdef_FaceList +#define SetWinPos_from_Prefs g_AppSurfaceTable.m_pfnSetWinPos_From_Prefs + +#define Texturewin g_AppShadersTable.m_pfnQeglobalsTexturewin + +#endif // _SURFDLG_PLUGIN_H_ + diff --git a/plugins/surface_ufoai/surface_ufoai.def b/plugins/surface_ufoai/surface_ufoai.def new file mode 100644 index 00000000..23669a7b --- /dev/null +++ b/plugins/surface_ufoai/surface_ufoai.def @@ -0,0 +1,8 @@ +; surface_ufoai.def : Declares the module parameters for the DLL. + +LIBRARY "SURFACE_UFOAI" +DESCRIPTION 'SURFACE_UFOAI Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/surface_ufoai/surface_ufoai.vcproj b/plugins/surface_ufoai/surface_ufoai.vcproj new file mode 100644 index 00000000..1a69d667 --- /dev/null +++ b/plugins/surface_ufoai/surface_ufoai.vcproj @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/surface_ufoai/surfacedialog.cpp b/plugins/surface_ufoai/surfacedialog.cpp new file mode 100644 index 00000000..f5e3d0ec --- /dev/null +++ b/plugins/surface_ufoai/surfacedialog.cpp @@ -0,0 +1,1939 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Surface Dialog Module +// + +// +// Nurail: Implemented to Module from the main Radiant Surface Dialog code +// + + +#include +#include + +#include "surfdlg_plugin.h" + + + +#ifdef _DEBUG +//#define DBG_SI 1 +#endif + +#include "gtkr_vector.h" + +std::vector g_texdef_face_vector; + +inline texdef_to_face_t* get_texdef_face_list() +{ + return &(*g_texdef_face_vector.begin()); +} + +inline unsigned int texdef_face_list_empty() +{ + return g_texdef_face_vector.empty(); +} + +inline unsigned int texdef_face_list_size() +{ + return g_texdef_face_vector.size(); +} + +// For different faces having different values +bool is_HShift_conflicting; +bool is_VShift_conflicting; +bool is_HScale_conflicting; +bool is_VScale_conflicting; +bool is_Rotate_conflicting; +bool is_TextureName_conflicting; + +void ShowDlg(); +void HideDlg(); +void SetTexMods(); +void GetTexMods(bool b_SetUndoPoint = FALSE); +void BuildDialog(); +void FitAll(); +void InitDefaultIncrement(texdef_t *); +void DoSnapTToGrid(float hscale, float vscale); +// called to perform a fitting from the outside (shortcut key) +void SurfaceDialogFitAll(); + +// UFOAI Flags Functions +void SetFlagButtons_UFOAI(texdef_to_face_t *texdef_face_list, bool b_isListEmpty); +void SetChangeInFlags_Face_UFOAI(texdef_to_face_t *texdef_face_list); +GtkWidget* Create_UFOAIFlagsDialog(GtkWidget* surfacedialog_widget); + + +// Dialog Data +int m_nHeight; +int m_nWidth; + +// 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for +int m_nUndoId; + + +texturewin_t *texturewin; +texdef_t *l_pIncrement; +texdef_t texdef_offset; +texdef_t texdef_SI_values; + +// For Texture Entry, activate only on entry change +char old_texture_entry[128]; + +// the texdef to switch back to when the OnCancel is called +texdef_t g_old_texdef; + +// when TRUE, this thing means the surface inspector is currently being displayed +bool g_surfwin = FALSE; +// turn on/off processing of the "changed" "value_changed" messages +// (need to turn off when we are feeding data in) +bool g_bListenChanged = true; +// turn on/off listening of the update messages +bool g_bListenUpdate = true; + +GtkWidget* create_SurfaceInspector (void); +GtkWidget *SurfaceInspector = NULL; + +GtkWidget *m_pWidget; +GtkWidget *GetWidget () { return SurfaceInspector; } +GtkWidget *Get_SI_Module_Widget () { return SurfaceInspector; } +void SetWidget(GtkWidget *new_widget) { m_pWidget = new_widget; } +GtkWidget *GetDlgWidget (const char* name) + { return GTK_WIDGET (g_object_get_data (G_OBJECT (SurfaceInspector), name)); } + +// Spins for FitTexture +GtkWidget *spin_width; +GtkWidget *spin_height; + + +GtkWidget *texture_combo; +GtkWidget *texture_combo_entry; + +GtkWidget *match_grid_button; +GtkWidget *lock_valuechange_togglebutton; + +GtkObject *hshift_value_spinbutton_adj; +GtkWidget *hshift_value_spinbutton; +GtkObject *vshift_value_spinbutton_adj; +GtkWidget *vshift_value_spinbutton; +GtkObject *hscale_value_spinbutton_adj; +GtkWidget *hscale_value_spinbutton; +GtkObject *vscale_value_spinbutton_adj; +GtkWidget *vscale_value_spinbutton; +GtkObject *rotate_value_spinbutton_adj; +GtkWidget *rotate_value_spinbutton; + +GtkObject *hshift_offset_spinbutton_adj; +GtkWidget *hshift_offset_spinbutton; +GtkObject *vshift_offset_spinbutton_adj; +GtkWidget *vshift_offset_spinbutton; +GtkObject *hscale_offset_spinbutton_adj; +GtkWidget *hscale_offset_spinbutton; +GtkObject *vscale_offset_spinbutton_adj; +GtkWidget *vscale_offset_spinbutton; +GtkObject *rotate_offset_spinbutton_adj; +GtkWidget *rotate_offset_spinbutton; + +GtkObject *hshift_step_spinbutton_adj; +GtkWidget *hshift_step_spinbutton; +GtkObject *vshift_step_spinbutton_adj; +GtkWidget *vshift_step_spinbutton; +GtkObject *hscale_step_spinbutton_adj; +GtkWidget *hscale_step_spinbutton; +GtkObject *vscale_step_spinbutton_adj; +GtkWidget *vscale_step_spinbutton; +GtkObject *rotate_step_spinbutton_adj; +GtkWidget *rotate_step_spinbutton; + +GtkObject *fit_width_spinbutton_adj; +GtkWidget *fit_width_spinbutton; +GtkObject *fit_height_spinbutton_adj; +GtkWidget *fit_height_spinbutton; +GtkWidget *fit_button; +GtkWidget *axial_button; + +GtkWidget *done_button; +GtkWidget *apply_button; +GtkWidget *cancel_button; + +// Callbacks +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data); +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data); + +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data); +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); + +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data); +static void on_fit_button_clicked (GtkButton *button, gpointer user_data); +static void on_axial_button_clicked (GtkButton *button, gpointer user_data); + +static void on_done_button_clicked (GtkButton *button, gpointer user_data); +static void on_apply_button_clicked (GtkButton *button, gpointer user_data); +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data); + + +/* +=================================================== + + SURFACE INSPECTOR + +=================================================== +*/ + + +void IsFaceConflicting() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char buf[12]; + char texture_name[128]; + + if (texdef_face_list_empty()) + { + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + gtk_entry_set_text( GTK_ENTRY (texture_combo_entry), ""); + return; + } + + g_bListenChanged = FALSE; + + tmp_texdef = &get_texdef_face_list()->texdef; + + strcpy(texture_name, tmp_texdef->GetName() ); + + texdef_SI_values.shift[0] = tmp_texdef->shift[0]; + texdef_SI_values.shift[1] = tmp_texdef->shift[1]; + texdef_SI_values.scale[0] = tmp_texdef->scale[0]; + texdef_SI_values.scale[1] = tmp_texdef->scale[1]; + texdef_SI_values.rotate = tmp_texdef->rotate; + texdef_SI_values.SetName( texture_name ); + + is_HShift_conflicting = FALSE; + is_VShift_conflicting = FALSE; + is_HScale_conflicting = FALSE; + is_VScale_conflicting = FALSE; + is_Rotate_conflicting = FALSE; + is_TextureName_conflicting = FALSE; + + if (texdef_face_list_size() > 1) + { + temp_texdef_face_list = get_texdef_face_list()->next; + + for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] ) + is_HShift_conflicting = TRUE; + + if ( texdef_SI_values.shift[1] != tmp_texdef->shift[1] ) + is_VShift_conflicting = TRUE; + + if ( texdef_SI_values.scale[0] != tmp_texdef->scale[0] ) + is_HScale_conflicting = TRUE; + + if ( texdef_SI_values.scale[1] != tmp_texdef->scale[1] ) + is_VScale_conflicting = TRUE; + + if ( texdef_SI_values.rotate != tmp_texdef->rotate ) + is_Rotate_conflicting = TRUE; + + if ( strcmp( texture_name, tmp_texdef->GetName() ) ) + is_TextureName_conflicting = TRUE; + } + } + + if(is_HShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hshift_value_spinbutton) , texdef_SI_values.shift[0] ); + + if(is_VShift_conflicting) + gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vshift_value_spinbutton) , texdef_SI_values.shift[1] ); + + if(is_HScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(hscale_value_spinbutton) , texdef_SI_values.scale[0] ); + + if(is_VScale_conflicting) + gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(vscale_value_spinbutton) , texdef_SI_values.scale[1] ); + + if(is_Rotate_conflicting) + gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), ""); + else + gtk_spin_button_set_value( GTK_SPIN_BUTTON(rotate_value_spinbutton) , texdef_SI_values.rotate ); + + g_bListenChanged = TRUE; +} + +#define MAX_NUM_LIST_ITEMS 15 +static void PopulateTextureComboList() +{ + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + char blank[1]; + GList *items = NULL; + GList *tmp_item; + int num_of_list_items = 0; + + blank[0] = 0; + + if (texdef_face_list_empty()) + { + items = g_list_append (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + else if ( !is_TextureName_conflicting ) + { + temp_texdef_face_list = get_texdef_face_list(); + tmp_texdef = (texdef_t *) &get_texdef_face_list()->texdef; + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, tmp_texdef->GetName()); + } + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + // Need to do a string compare, hence the custom search + if (!( g_list_find_custom (items, tmp_texdef->GetName(), (GCompareFunc) strcmp ) )) + { + items = g_list_append( items, (gpointer) tmp_texdef->GetName() ); + num_of_list_items++; + } + // Make sure the combo list isn't too long + if (num_of_list_items >= MAX_NUM_LIST_ITEMS) + break; + } + // If this isn't added last (to the top of the list), g_list_find freaks. + items = g_list_prepend (items, (gpointer) blank); + // For Texture Entry, activate only on entry change + strcpy (old_texture_entry, blank); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (texture_combo), items); + g_list_free(items); + +} + +static void ZeroOffsetValues() +{ + texdef_offset.shift[0] = 0.0; + texdef_offset.shift[1] = 0.0; + texdef_offset.scale[0] = 0.0; + texdef_offset.scale[1] = 0.0; + texdef_offset.rotate = 0.0; +} + +static void GetTexdefInfo_from_Radiant() +{ + g_texdef_face_vector.clear(); + + unsigned int count = GetSelectedFaceCountfromBrushes(); + if(count == 0) + count = GetSelectedFaceCount(); + + g_texdef_face_vector.resize(count); + + if (!texdef_face_list_empty()) + { + texdef_to_face_t* p = get_texdef_face_list(); + GetSelFacesTexdef( get_texdef_face_list() ); + } + + IsFaceConflicting(); + PopulateTextureComboList(); + ZeroOffsetValues(); + if ( texdef_face_list_empty() ) + SetFlagButtons_UFOAI( get_texdef_face_list() , TRUE); + else + SetFlagButtons_UFOAI( get_texdef_face_list() , FALSE); +} + +static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data) +{ + HideDlg(); + return TRUE; +} + +// make the shift increments match the grid settings +// the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size +// this depends on a scale value if you have selected a particular texture on which you want it to work: +// we move the textures in pixels, not world units. (i.e. increment values are in pixel) +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize +// increment * scale = gridsize +// hscale and vscale are optional parameters, if they are zero they will be set to the default scale +// NOTE: the default scale depends if you are using BP mode or regular. +// For regular it's 0.5f (128 pixels cover 64 world units), for BP it's simply 1.0f +// see fenris #2810 +void DoSnapTToGrid(float hscale, float vscale) +{ + l_pIncrement = Get_SI_Inc(); + + if (hscale == 0.0f) + { + hscale = 0.5f; + } + if (vscale == 0.0f) + { + vscale = 0.5f; + } +#ifdef _DEBUG + Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale); +#endif + l_pIncrement->shift[0] = GridSize() / hscale; + l_pIncrement->shift[1] = GridSize() / vscale; + // now some update work + // FIXME: doesn't look good here, seems to be called several times + SetTexMods(); +} + +void UpdateSurfaceDialog() +{ + if (!g_bListenUpdate) + return; + + if (!SurfaceInspector) + return; + + // avoid long delays on slow computers + while (gtk_events_pending ()) + gtk_main_iteration (); + + if (g_surfwin) + { +#ifdef DBG_SI + Sys_Printf("UpdateSurfaceDialog\n"); +#endif + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } + +} + +// DoSurface will always try to show the surface inspector +// or update it because something new has been selected +void DoSurface (void) +{ +#ifdef DBG_SI + Sys_Printf("DoSurface\n"); +#endif + if (!SurfaceInspector) + create_SurfaceInspector (); + + ShowDlg(); + SetTexMods (); +} + +void ToggleSurface() +{ +#ifdef DBG_SI + Sys_Printf("ToggleSurface Module\n"); +#endif + if (!g_surfwin) + DoSurface (); + else + on_cancel_button_clicked(NULL, NULL); +} + +// NOTE: will raise and show the Surface inspector and exec fit for patches and brushes +void SurfaceDlgFitAll() +{ + DoSurface(); + FitAll(); +} + +// ============================================================================= +// SurfaceDialog class + +void ShowDlg() +{ + + if(!SurfaceInspector) + create_SurfaceInspector(); + else + gtk_widget_show (SurfaceInspector); + + GetTexdefInfo_from_Radiant(); + GetTexMods(TRUE); // Set Initial Undo Point + g_surfwin = TRUE; +} + +void HideDlg() +{ + g_surfwin = FALSE; + gtk_widget_hide (SurfaceInspector); +} + + +// set default values for increments (shift scale and rot) +// this is called by the prefs code if can't find the values +void InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName("foo"); + tex->shift[0] = 8; + tex->shift[1] = 8; + tex->scale[0] = 0.25; + tex->scale[1] = 0.25; + tex->rotate = 10; +} + +void BuildDialog () +{ + if ( !SurfaceInspector ) + create_SurfaceInspector(); +} + +/* +============== +SetTexMods + +Set the fields to the current texdef (i.e. map/texdef -> dialog widgets) +=============== +*/ + +void SetTexMods() +{ + texdef_t *pt; + GtkSpinButton *spin; + GtkAdjustment *adjust; + + texturewin = Texturewin (); + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg SetTexMods\n"); +#endif + + if (!g_surfwin) + return; + + pt = &texturewin->texdef; + + g_bListenChanged = false; + + if(strncmp(pt->GetName(), "textures/", 9) != 0) + texdef_offset.SetName(SHADER_NOT_FOUND); + + + spin = GTK_SPIN_BUTTON (hshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hshift_step_spinbutton), l_pIncrement->shift[0]); + + spin = GTK_SPIN_BUTTON (hshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + + + spin = GTK_SPIN_BUTTON (vshift_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.shift[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vshift_step_spinbutton), l_pIncrement->shift[1]); + + spin = GTK_SPIN_BUTTON (vshift_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + + + spin = GTK_SPIN_BUTTON (hscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[0]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(hscale_step_spinbutton), l_pIncrement->scale[0]); + + spin = GTK_SPIN_BUTTON (hscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + + + spin = GTK_SPIN_BUTTON (vscale_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.scale[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(vscale_step_spinbutton), l_pIncrement->scale[1]); + + spin = GTK_SPIN_BUTTON (vscale_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + + + spin = GTK_SPIN_BUTTON (rotate_offset_spinbutton); + gtk_spin_button_set_value (spin, texdef_offset.rotate); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + gtk_spin_button_set_value (GTK_SPIN_BUTTON(rotate_step_spinbutton), l_pIncrement->rotate); + + spin = GTK_SPIN_BUTTON (rotate_value_spinbutton); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + + + g_bListenChanged = true; + + // store the current texdef as our escape route if user hits OnCancel + g_old_texdef = texturewin->texdef; +} + +/* +============== +GetTexMods + +Shows any changes to the main Radiant windows +=============== +*/ +void GetTexMods(bool b_SetUndoPoint) +{ + +#ifdef DBG_SI + Sys_Printf("SurfaceDlg GetTexMods\n"); +#endif + + if ( !texdef_face_list_empty() ) + { + g_bListenUpdate=FALSE; + SetChangeInFlags_Face_UFOAI ( get_texdef_face_list() ); + SetTexdef_FaceList( get_texdef_face_list(), b_SetUndoPoint, false ); + g_bListenUpdate=TRUE; + + if (b_SetUndoPoint) + m_nUndoId = Undo_GetUndoId(); + } +} + +void FitAll() +{ + on_fit_button_clicked(NULL, NULL); +} + + +//////////////////////////////////////////////////////////////////// +// +// GUI Section +// +//////////////////////////////////////////////////////////////////// + +GtkWidget* create_SurfaceInspector (void) +{ + + GtkWidget *label; + GtkWidget *hseparator; + GtkWidget *eventbox; + + GtkWidget *viewport8; + GtkWidget *viewport9; + GtkWidget *viewport2; + GtkWidget *viewport7; + GtkWidget *viewport5; + GtkWidget *viewport6; + GtkWidget *viewport10; + + GtkWidget *table1; + GtkWidget *table4; + GtkWidget *table5; + GtkWidget *table7; + + GtkWidget *alignment1; + GtkWidget *alignment2; + GtkWidget *alignment3; + + GtkWidget *vbox7; + + GtkWidget *hbox1; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hbox4; + + GtkWidget *image1; + GtkWidget *image2; + GtkWidget *image3; + + GtkWidget *hbuttonbox1; + + SurfaceInspector = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (SurfaceInspector), 4); + gtk_window_set_title (GTK_WINDOW (SurfaceInspector), "Surface Inspector"); + + SetWinPos_from_Prefs(SurfaceInspector); + + viewport8 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport8); + gtk_container_add (GTK_CONTAINER (SurfaceInspector), viewport8); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport8), GTK_SHADOW_NONE); + + vbox7 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox7); + gtk_container_add (GTK_CONTAINER (viewport8), vbox7); + + viewport9 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport9); + gtk_box_pack_start (GTK_BOX (vbox7), viewport9, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport9), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport9), GTK_SHADOW_ETCHED_IN); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_container_add (GTK_CONTAINER (viewport9), hbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbox1), 4); + + label = gtk_label_new ("Texture: "); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + texture_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (texture_combo)->popwin), + "KeepMeAround", texture_combo); + gtk_combo_disable_activate ( (GtkCombo*) texture_combo); + gtk_widget_show (texture_combo); + gtk_box_pack_start (GTK_BOX (hbox1), texture_combo, TRUE, TRUE, 0); + + texture_combo_entry = GTK_COMBO (texture_combo)->entry; + gtk_widget_show (texture_combo_entry); + gtk_entry_set_max_length (GTK_ENTRY (texture_combo_entry), 128); + + viewport2 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport2); + gtk_box_pack_start (GTK_BOX (vbox7), viewport2, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport2), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport2), GTK_SHADOW_ETCHED_IN); + + table1 = gtk_table_new (13, 4, FALSE); + gtk_widget_show (table1); + gtk_container_add (GTK_CONTAINER (viewport2), table1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Offset"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 3, 4, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + match_grid_button = gtk_button_new_with_mnemonic ("Match Grid"); + gtk_widget_show (match_grid_button); + gtk_container_add (GTK_CONTAINER (eventbox), match_grid_button); + + label = gtk_label_new ("Value"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 9, 10, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new (" H Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("V Scale: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 10, 11, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("Rotate: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + label = gtk_label_new ("H Shift: "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (eventbox), label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 1, 2, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + lock_valuechange_togglebutton = gtk_toggle_button_new_with_mnemonic ("UNLOCK"); + gtk_widget_show (lock_valuechange_togglebutton); + gtk_container_add (GTK_CONTAINER (eventbox), lock_valuechange_togglebutton); + + // Value Spins + hshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_value_spinbutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), FALSE ); + + vshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_value_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_value_spinbutton, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), FALSE ); + + hscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_value_spinbutton, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), FALSE ); + + vscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_value_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_value_spinbutton, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), FALSE ); + + rotate_value_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_value_spinbutton_adj), 1, 0); + gtk_widget_show (rotate_value_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_value_spinbutton, 1, 2, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_value_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_value_spinbutton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), FALSE ); + + // Offset Spins + hshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (hshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_offset_spinbutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE); + + vshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_offset_spinbutton_adj), 0, 2); + gtk_widget_show (vshift_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_offset_spinbutton, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE); + + hscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (hscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_offset_spinbutton, 2, 3, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE); + + vscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_offset_spinbutton_adj), 0, 4); + gtk_widget_show (vscale_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_offset_spinbutton, 2, 3, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE); + + rotate_offset_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_offset_spinbutton_adj), 0, 2); + gtk_widget_show (rotate_offset_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_offset_spinbutton, 2, 3, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 4, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_offset_spinbutton), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE); + + // Step Spins + hshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + hshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (hshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hshift_step_spinbutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + vshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0); + vshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_step_spinbutton_adj), 1, 2); + gtk_widget_show (vshift_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vshift_step_spinbutton, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_step_spinbutton), GTK_UPDATE_IF_VALID); + + hscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + hscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (hscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), hscale_step_spinbutton, 3, 4, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + vscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0); + vscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_step_spinbutton_adj), 1, 4); + gtk_widget_show (vscale_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), vscale_step_spinbutton, 3, 4, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_step_spinbutton), GTK_UPDATE_IF_VALID); + + rotate_step_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0); + rotate_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_step_spinbutton_adj), 1, 2); + gtk_widget_show (rotate_step_spinbutton); + gtk_table_attach (GTK_TABLE (table1), rotate_step_spinbutton, 3, 4, 10, 11, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_step_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 2, 3, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 12, 13, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + viewport7 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport7); + gtk_box_pack_start (GTK_BOX (vbox7), viewport7, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport7), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport7), GTK_SHADOW_ETCHED_IN); + + table4 = gtk_table_new (4, 7, FALSE); + gtk_widget_show (table4); + gtk_container_add (GTK_CONTAINER (viewport7), table4); + + viewport5 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport5); + gtk_table_attach (GTK_TABLE (table4), viewport5, 1, 7, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport5), 6); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport5), GTK_SHADOW_ETCHED_OUT); + + table5 = gtk_table_new (2, 3, FALSE); + gtk_widget_show (table5); + gtk_container_add (GTK_CONTAINER (viewport5), table5); + gtk_container_set_border_width (GTK_CONTAINER (table5), 5); + gtk_table_set_col_spacings (GTK_TABLE (table5), 2); + + label = gtk_label_new ("Height"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + label = gtk_label_new ("Width"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table5), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1); + + fit_width_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_width_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_width_spinbutton_adj), 1, 0); + gtk_widget_show (fit_width_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_width_spinbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_width_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_width_spinbutton), GTK_UPDATE_IF_VALID); + + fit_height_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10); + fit_height_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_height_spinbutton_adj), 1, 0); + gtk_widget_show (fit_height_spinbutton); + gtk_table_attach (GTK_TABLE (table5), fit_height_spinbutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 3, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_height_spinbutton), TRUE); + gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_height_spinbutton), GTK_UPDATE_IF_VALID); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 4, 0); + + fit_button = gtk_button_new_with_mnemonic (" Fit "); + gtk_widget_show (fit_button); + gtk_container_add (GTK_CONTAINER (eventbox), fit_button); + + viewport6 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport6); + gtk_table_attach (GTK_TABLE (table4), viewport6, 0, 1, 0, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport6), 4); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport6), GTK_SHADOW_NONE); + + table7 = gtk_table_new (2, 1, FALSE); + gtk_widget_show (table7); + gtk_container_add (GTK_CONTAINER (viewport6), table7); + + eventbox = gtk_event_box_new (); + gtk_widget_show (eventbox); + gtk_table_attach (GTK_TABLE (table7), eventbox, 0, 1, 0, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + axial_button = gtk_button_new_with_mnemonic ("Axial"); + gtk_widget_show (axial_button); + gtk_container_add (GTK_CONTAINER (eventbox), axial_button); + gtk_widget_set_size_request (axial_button, 56, 29); + gtk_container_set_border_width (GTK_CONTAINER (axial_button), 4); + + // Fit in Flags sub-dialog + Create_UFOAIFlagsDialog(vbox7); + + viewport10 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport10); + gtk_box_pack_start (GTK_BOX (vbox7), viewport10, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (viewport10), 2); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport10), GTK_SHADOW_ETCHED_IN); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_container_add (GTK_CONTAINER (viewport10), hbuttonbox1); + gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD); + + done_button = gtk_button_new (); + gtk_widget_show (done_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), done_button); + GTK_WIDGET_SET_FLAGS (done_button, GTK_CAN_DEFAULT); + + alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment1); + gtk_container_add (GTK_CONTAINER (done_button), alignment1); + + hbox2 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox2); + gtk_container_add (GTK_CONTAINER (alignment1), hbox2); + + image1 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image1); + gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Done"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + apply_button = gtk_button_new (); + gtk_widget_show (apply_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_button); + GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); + + alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (apply_button), alignment3); + + hbox4 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox4); + gtk_container_add (GTK_CONTAINER (alignment3), hbox4); + + image3 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image3); + gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Apply"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + cancel_button = gtk_button_new (); + gtk_widget_show (cancel_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_button); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment2); + gtk_container_add (GTK_CONTAINER (cancel_button), alignment2); + + hbox3 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox3); + gtk_container_add (GTK_CONTAINER (alignment2), hbox3); + + image2 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image2); + gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic ("Cancel"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + + g_signal_connect ( (gpointer) SurfaceInspector, + "delete_event", + G_CALLBACK (delete_event_callback), + NULL ); + g_signal_connect ((gpointer) SurfaceInspector, "destroy", + G_CALLBACK (gtk_widget_destroy), + NULL); + + g_signal_connect ((gpointer) texture_combo_entry, "key_press_event", + G_CALLBACK (on_texture_combo_entry_key_press_event), + NULL); + g_signal_connect ((gpointer) texture_combo_entry, "activate", + G_CALLBACK (on_texture_combo_entry_activate), + NULL); + + + g_signal_connect ((gpointer) hshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_hshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_offset_spinbutton, "value_changed", + G_CALLBACK (on_vshift_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_hscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_offset_spinbutton, "value_changed", + G_CALLBACK (on_vscale_offset_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_offset_spinbutton, "value_changed", + G_CALLBACK (on_rotate_offset_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_value_spinbutton, "value_changed", + G_CALLBACK (on_hshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_value_spinbutton, "value_changed", + G_CALLBACK (on_vshift_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_value_spinbutton, "value_changed", + G_CALLBACK (on_hscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_value_spinbutton, "value_changed", + G_CALLBACK (on_vscale_value_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_value_spinbutton, "value_changed", + G_CALLBACK (on_rotate_value_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) hshift_step_spinbutton, "value_changed", + G_CALLBACK (on_hshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vshift_step_spinbutton, "value_changed", + G_CALLBACK (on_vshift_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) hscale_step_spinbutton, "value_changed", + G_CALLBACK (on_hscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) vscale_step_spinbutton, "value_changed", + G_CALLBACK (on_vscale_step_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) rotate_step_spinbutton, "value_changed", + G_CALLBACK (on_rotate_step_spinbutton_value_changed), + NULL); + + g_signal_connect ((gpointer) match_grid_button, "clicked", + G_CALLBACK (on_match_grid_button_clicked), + NULL); + g_signal_connect ((gpointer) lock_valuechange_togglebutton, "toggled", + G_CALLBACK (on_lock_valuechange_togglebutton_toggled), + NULL); + + g_signal_connect ((gpointer) fit_width_spinbutton, "value_changed", + G_CALLBACK (on_fit_width_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_height_spinbutton, "value_changed", + G_CALLBACK (on_fit_height_spinbutton_value_changed), + NULL); + g_signal_connect ((gpointer) fit_button, "clicked", + G_CALLBACK (on_fit_button_clicked), + NULL); + + g_signal_connect ((gpointer) axial_button, "clicked", + G_CALLBACK (on_axial_button_clicked), + NULL); + + g_signal_connect ((gpointer) done_button, "clicked", + G_CALLBACK (on_done_button_clicked), + NULL); + g_signal_connect ((gpointer) apply_button, "clicked", + G_CALLBACK (on_apply_button_clicked), + NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_cancel_button_clicked), + NULL); + + + return SurfaceInspector; +} + + +// Texture Combo +gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, + gpointer user_data) +{ + // Have Tab activate selection as well as Return + if (event->keyval == GDK_Tab) + g_signal_emit_by_name ( texture_combo_entry, "activate" ); + + return FALSE; +} + +void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + char text[128] = { 0 }; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + // activate only on entry change + strcpy( text, gtk_entry_get_text(entry)); + if ( strcmp( old_texture_entry, text )) + { + // Check for spaces in shader name + if (text[0] <= ' ' || strchr(text, ' ')) + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text); + else + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + strcpy( old_texture_entry, text ); + tmp_texdef->SetName( text ); + } + GetTexMods(); + } + } + } +} + +// Offset Spins +static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HShift_conflicting) + tmp_texdef->shift[0] = tmp_orig_texdef->shift[0] + texdef_offset.shift[0]; + else + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + } + GetTexMods(); + } +} + +static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VShift_conflicting) + tmp_texdef->shift[1] = tmp_orig_texdef->shift[1] + texdef_offset.shift[1]; + else + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + } + GetTexMods(); + } + +} + +static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_HScale_conflicting) + tmp_texdef->scale[0] = tmp_orig_texdef->scale[0] + texdef_offset.scale[0]; + else + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + } + GetTexMods(); + } + + +} + +static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_VScale_conflicting) + tmp_texdef->scale[1] = tmp_orig_texdef->scale[1] + texdef_offset.scale[1]; + else + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + } + GetTexMods(); + } + +} + +static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_offset.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_offset_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + if (is_Rotate_conflicting) + tmp_texdef->rotate = tmp_orig_texdef->rotate + texdef_offset.rotate; + else + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + } + GetTexMods(); + } + +} + + +// Match Grid +static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data) +{ + float hscale, vscale; + + if( !strcmp(gtk_entry_get_text (GTK_ENTRY (hscale_value_spinbutton)), "") ) + hscale = 0.0; + else + hscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if( !strcmp( gtk_entry_get_text (GTK_ENTRY (vscale_value_spinbutton)), "") ) + vscale = 0.0; + else + vscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + DoSnapTToGrid (hscale, vscale); +} + + +// Lock out changes to Value +static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + bool is_Locked; + + is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton)); + + gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), is_Locked ); + gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), is_Locked ); +} + + +// Value Spins +static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0]; + is_HShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1]; + is_VShift_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0]; + is_HScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1]; + is_VScale_conflicting = FALSE; + } + GetTexMods(); + } +} + +static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + texdef_SI_values.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_value_spinbutton) ); + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef; + tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate; + is_Rotate_conflicting = FALSE; + } + GetTexMods(); + } +} + + +// Step Spins +static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[0] = val; +} + +static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged VShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->shift[1] = val; +} + +static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[0] = val; +} + +static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->scale[1] = val; +} + +static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + gfloat val; + GtkAdjustment * adjust; + + if (!g_bListenChanged) + return; + + l_pIncrement = Get_SI_Inc(); + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged HShift\n"); +#endif + + val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_step_spinbutton) ) ; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_offset_spinbutton )); + adjust->step_increment = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_value_spinbutton )); + adjust->step_increment = val; + l_pIncrement->rotate = val; +} + + +// Fit Texture +static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nWidth = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_width_spinbutton) ); +} + +static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data) +{ + m_nHeight = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_height_spinbutton) ); +} + +static void on_fit_button_clicked (GtkButton *button, gpointer user_data) +{ + FaceList_FitTexture(get_texdef_face_list(), m_nHeight, m_nWidth); + Sys_UpdateWindows(W_ALL); +} + + +// Axial Button +static void on_axial_button_clicked (GtkButton *button, gpointer user_data) +{ + texdef_t* tmp_texdef; + texdef_t* tmp_orig_texdef; + texdef_to_face_t* temp_texdef_face_list; + + if (!texdef_face_list_empty() && g_bListenChanged) + { + for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef; + tmp_texdef->shift[0] = 0.0; + tmp_texdef->shift[1] = 0.0; + tmp_texdef->scale[0] = 0.5; + tmp_texdef->scale[1] = 0.5; + tmp_texdef->rotate = 0.0; + } + } + + SetTexdef_FaceList( get_texdef_face_list(), FALSE, TRUE ); + Sys_UpdateWindows(W_ALL); +} + + +// Action Buttons +static void on_done_button_clicked (GtkButton *button, gpointer user_data) +{ + if ( !texdef_face_list_empty() ) + GetTexMods(TRUE); + HideDlg(); + Sys_UpdateWindows(W_ALL); +} + +static void on_apply_button_clicked (GtkButton *button, gpointer user_data) +{ + if (!g_bListenChanged) + return; + + if ( !texdef_face_list_empty() ) + { + GetTexMods (TRUE); + Sys_UpdateWindows(W_CAMERA); + GetTexdefInfo_from_Radiant(); + SetTexMods(); + } +} + +static void on_cancel_button_clicked (GtkButton *button, gpointer user_data) +{ + texturewin = Texturewin (); + texturewin->texdef = g_old_texdef; + // cancel the last do if we own it + if ( (m_nUndoId == Undo_GetUndoId()) && ( m_nUndoId != 0 )) + { +#ifdef DBG_SI + Sys_Printf("OnCancel calling Undo_Undo\n"); +#endif + g_bListenUpdate = false; + Undo_Undo(TRUE); + g_bListenUpdate = true; + m_nUndoId = 0; + } + HideDlg(); +} + + diff --git a/plugins/imagehl/sprite.h b/plugins/surface_ufoai/surfacedialog.h similarity index 74% rename from plugins/imagehl/sprite.h rename to plugins/surface_ufoai/surfacedialog.h index 0badd137..4a5b815b 100644 --- a/plugins/imagehl/sprite.h +++ b/plugins/surface_ufoai/surfacedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,13 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_SPRITE_H) -#define INCLUDED_SPRITE_H +#ifndef _SURFACEDIALOG_H_ +#define _SURFACEDIALOG_H_ -class Image; -class ArchiveFile; - -Image* LoadIDSP(ArchiveFile& file); - -#endif +void UpdateSurfaceDialog (); +void DoSurface (); +void ToggleSurface (); +void SurfaceDlgFitAll (); +GtkWidget *Get_SI_Module_Widget (); +#endif // _SURFACEDIALOG_H_ diff --git a/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp b/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp new file mode 100644 index 00000000..ab7ebc25 --- /dev/null +++ b/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp @@ -0,0 +1,398 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include "surfdlg_plugin.h" + +#include "surfaceflagsdialog_ufoai.h" + +GtkWidget *notebook1; + +// 32 bit is the max +#define MAX_BUTTONS 32 + +GtkWidget *surface_buttons[MAX_BUTTONS]; +GtkWidget *content_buttons[MAX_BUTTONS]; + +GtkWidget *value_entry; +gboolean setup_buttons = TRUE; + +int working_surface_flags; +int surface_mask; +int working_content_flags; +int content_mask; +int working_value; + +inline void set_inconsistent(GtkWidget *toggle_button) +{ + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), TRUE); +} + +inline void clear_inconsistent(GtkWidget *toggle_button) +{ + if ( gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (toggle_button)) ) + { + gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON (toggle_button), FALSE); + } +} + +void clear_all_inconsistent(void) +{ + int i; + + for (i = 0; i < MAX_BUTTONS; i++) { + clear_inconsistent( surface_buttons[i] ); + clear_inconsistent( content_buttons[i] ); + } +} + +void clear_all_buttons_and_values() +{ + int i; + + for (i = 0; i < MAX_BUTTONS; i++) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( surface_buttons[i] ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON ( content_buttons[i] ), FALSE); + } + + gtk_entry_set_text( (GtkEntry *)value_entry, ""); +} + +void SetFlagButtons_UFOAI(texdef_to_face_t *texdef_face_list, bool b_isListEmpty) +{ + int contents = 0; + int flags = 0; + int value = 0; + int diff_contents = 0; + int diff_flags = 0; + gboolean diff_value = FALSE; + char tex_buff[11]; + texdef_t* tmp_texdef; + texdef_to_face_t* temp_texdef_face_list; + int i; + + setup_buttons = TRUE; + working_surface_flags = 0; + surface_mask = 0; + working_content_flags = 0; + content_mask = 0; + working_value = 0; + + if (!b_isListEmpty) { + tmp_texdef = &texdef_face_list->texdef; + contents = tmp_texdef->contents; + flags = tmp_texdef->flags; + value = tmp_texdef->value; + + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value); + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value); + + for (temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent + diff_flags |= flags ^ tmp_texdef->flags; + if (tmp_texdef->value != value) + diff_value = TRUE; + + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value); + Sys_Printf("Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value); + } + } + + clear_all_inconsistent(); + + // If no faces/brushes are selected, clear everything and bail + if (b_isListEmpty) { + clear_all_buttons_and_values(); + setup_buttons = FALSE; + return; + } + + for (i = 0; i < MAX_BUTTONS; i++) { + // Set surface buttons to reflect brush/face flags, contents, and values + if(diff_flags & (1 << i)) + set_inconsistent(surface_buttons[i]); + else if(flags & (1 << i)) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_buttons[i]), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (surface_buttons[i]), FALSE); + + if(diff_contents & (1 << i)) + set_inconsistent(content_buttons[i]); + else if(contents & (1 << i)) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (content_buttons[i]), TRUE); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (content_buttons[i]), FALSE); + } + + // Set Value + if (diff_value) + gtk_entry_set_text( (GtkEntry *)value_entry, ""); + else { + working_value = value; + sprintf( tex_buff, "%d", value); + gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff); + } + + setup_buttons = FALSE; +} + +void SetChangeInFlags_Face_UFOAI (texdef_to_face_t *texdef_face_list) +{ + texdef_to_face_t *temp_texdef_face_list; + texdef_t *tmp_texdef; + + for (temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + tmp_texdef = &temp_texdef_face_list->texdef; + tmp_texdef->flags = (tmp_texdef->flags & ~surface_mask) | working_surface_flags; + tmp_texdef->contents = (tmp_texdef->contents & ~content_mask) | working_content_flags; + tmp_texdef->value = working_value; + Sys_Printf("content_flag: %d content_mask: %d\n",working_content_flags,content_mask); + Sys_Printf("content: %d\n",tmp_texdef->contents); + } +} + +inline void change_surfaceflag (GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to) +{ + if (!setup_buttons) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) // Clear out inconsistent, if set + clear_inconsistent(GTK_WIDGET (togglebutton)); + + surface_mask |= sur_flag; + + if (change_flag_to) + working_surface_flags |= sur_flag; + else + working_surface_flags &= ~sur_flag; + } +} + +inline void change_contentflag (GtkWidget *togglebutton, int content_flag, gboolean change_flag_to) +{ + if ( (!setup_buttons) ) // If we're setting up the buttons, we really don't need to + { // set flags that are already set + if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON (togglebutton))) + clear_inconsistent(togglebutton); + //if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces. + //{ + content_mask |= content_flag; + + if (change_flag_to) + working_content_flags |= content_flag; + else + working_content_flags &= ~content_flag; + //} + Sys_Printf("content_flag: %d content_mask: %d\n",content_flag,content_mask); + } +} + +// Surface Flags Callbacks +void on_surface_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + int flag = GPOINTER_TO_INT(user_data); + change_surfaceflag(GTK_WIDGET (togglebutton), flag, (GTK_TOGGLE_BUTTON (togglebutton)->active)); +} + +// Content Flags Callbacks +void on_content_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) +{ + int flag = GPOINTER_TO_INT(user_data); + change_contentflag(GTK_WIDGET (togglebutton), flag, (GTK_TOGGLE_BUTTON (togglebutton)->active)); +} + +// Value Entry Callback +void on_value_entry_changed (GtkEditable *editable, gpointer user_data) +{ + if ( (!setup_buttons) ) // If we're setting up the buttons, don't change value + working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable) ); +} + +void on_value_entry_insert_text (GtkEditable *editable, gchar *new_text, gint new_text_length, gint *position, gpointer user_data) +{ + int i, count=0; + gchar *result; + + // Limit input to digits, throwing out anything else + // Modified from Gtk FAQ for text filtering of GtkEntry + result = g_new (gchar, new_text_length); + + for (i=0; i < new_text_length; i++) { + if (!isdigit(new_text[i])) + continue; + result[count++] = new_text[i]; + } + + if (count > 0) { + gtk_signal_handler_block_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + user_data); + gtk_editable_insert_text (editable, result, count, position); + gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + user_data); + } + gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text"); + + g_free (result); +} + +void on_surfacebutton_clicked (GtkButton *button, gpointer user_data) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 0); +} + +void on_contentbutton_clicked (GtkButton *button, gpointer user_data) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook1), 1); +} + +#define UFOAI_FLAG_BUTTON_BORDER 3 + +GtkWidget* Create_UFOAIFlagsDialog (GtkWidget* surfacedialog_widget) +{ + GtkWidget *frame1; + GtkWidget *vbox1; + GtkWidget *vbox2; + GtkWidget *vbox3; + GtkWidget *vbox4; + GtkWidget *table4; + GtkWidget *hbox2; + GtkWidget *hbox3; + GtkWidget *hseparator1; + GtkWidget *value_label; + GtkWidget *label5; + GtkWidget *table3; + GtkWidget *label6; + int i, x, y; + const char *buttonLabel; + char buffer[8]; + + frame1 = gtk_frame_new ("Flags"); + gtk_widget_show (frame1); + gtk_container_add (GTK_CONTAINER (surfacedialog_widget), frame1); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox1); + gtk_container_add (GTK_CONTAINER (frame1), vbox1); + + notebook1 = gtk_notebook_new (); + gtk_widget_show (notebook1); + gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook1), TRUE); + gtk_container_set_border_width (GTK_CONTAINER (notebook1), 5); + + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (notebook1), vbox2); + + table4 = gtk_table_new (8, 4, FALSE); + gtk_widget_show (table4); + gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0); + + y = -1; + for (i = 0; i < MAX_BUTTONS; i++) { + if (!(i % 4)) + y++; + x = i % 4; + snprintf(buffer, sizeof(buffer) - 1, "surf%i", i + 1); + buttonLabel = g_FuncTable.m_pfnReadProjectKey(buffer); + Sys_Printf("%s: %s\n", buffer, buttonLabel); + surface_buttons[i] = gtk_toggle_button_new_with_label (buttonLabel); + gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), GINT_TO_POINTER(1 << i)); + gtk_widget_show(surface_buttons[i]); + gtk_table_attach(GTK_TABLE (table4), surface_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (surface_buttons[i]), UFOAI_FLAG_BUTTON_BORDER); + } + + hseparator1 = gtk_hseparator_new (); + gtk_widget_show (hseparator1); + gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, FALSE, FALSE, 0); + gtk_widget_set_usize (hseparator1, -2, 5); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0); + + hbox3 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox3); + gtk_box_pack_start (GTK_BOX (hbox2), hbox3, TRUE, TRUE, 0); + + vbox4 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox4); + gtk_box_pack_start (GTK_BOX (hbox3), vbox4, TRUE, TRUE, 0); + + value_label = gtk_label_new (" Value: "); + gtk_widget_show (value_label); + gtk_box_pack_start (GTK_BOX (hbox3), value_label, FALSE, FALSE, 0); + + value_entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (value_entry), "changed", + GTK_SIGNAL_FUNC (on_value_entry_changed), + NULL); + gtk_signal_connect (GTK_OBJECT (value_entry), "insert_text", + GTK_SIGNAL_FUNC (on_value_entry_insert_text), + NULL); + gtk_entry_set_max_length( (GtkEntry *)value_entry, 11); + gtk_widget_show (value_entry); + gtk_box_pack_start (GTK_BOX (hbox3), value_entry, TRUE, TRUE, 0); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (hbox3), vbox3, TRUE, TRUE, 0); + + label5 = gtk_label_new ("Surface Flags"); + gtk_widget_show (label5); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5); + + table3 = gtk_table_new (8, 4, FALSE); + gtk_widget_show (table3); + gtk_container_add (GTK_CONTAINER (notebook1), table3); + + y = -1; + for (i = 0; i < MAX_BUTTONS; i++) { + if (!(i % 4)) + y++; + x = i % 4; + snprintf(buffer, sizeof(buffer) - 1, "cont%i", i + 1); + buttonLabel = g_FuncTable.m_pfnReadProjectKey(buffer); + content_buttons[i] = gtk_toggle_button_new_with_label(buttonLabel); + gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), GINT_TO_POINTER(1 << i)); + gtk_widget_show(content_buttons[i]); + gtk_table_attach(GTK_TABLE (table3), content_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_container_set_border_width (GTK_CONTAINER (content_buttons[i]), UFOAI_FLAG_BUTTON_BORDER); + } + + label6 = gtk_label_new ("Content Flags"); + gtk_widget_show (label6); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label6); + + return frame1; +} + diff --git a/include/iplugin.cpp b/plugins/surface_ufoai/surfaceflagsdialog_ufoai.h similarity index 82% rename from include/iplugin.cpp rename to plugins/surface_ufoai/surfaceflagsdialog_ufoai.h index ebfc591f..a6de6463 100644 --- a/include/iplugin.cpp +++ b/plugins/surface_ufoai/surfaceflagsdialog_ufoai.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,5 +19,7 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "iplugin.h" +#ifndef _SURFACEFLAGSDIALOG_UFOAI_H +#define _SURFACEFLAGSDIALOG_UFOAI_H +#endif // _SURFACEFLAGSDIALOG_UFOAI_H diff --git a/plugins/surface_ufoai/surfdlg_plugin.cpp b/plugins/surface_ufoai/surfdlg_plugin.cpp new file mode 100644 index 00000000..694b052f --- /dev/null +++ b/plugins/surface_ufoai/surfdlg_plugin.cpp @@ -0,0 +1,127 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include "surfdlg_plugin.h" +#include "surfacedialog.h" + +#include "synapse.h" + +class CSynapseClient_SurfDLG : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + bool OnActivate(); + + CSynapseClient_SurfDLG() { } + virtual ~CSynapseClient_SurfDLG() { } +}; + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; +_QERUndoTable g_UndoTable; +_QERAppSurfaceTable g_AppSurfaceTable; +_QERSelectedFaceTable g_SelectedFaceTable; +_QERShadersTable g_ShadersTable; +_QERAppShadersTable g_AppShadersTable; +_QERAppDataTable g_AppDataTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClient_SurfDLG g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(SURFACEDIALOG_MAJOR, "ufoai", sizeof(_QERPlugSurfaceTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + g_SynapseClient.AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable), SYN_REQUIRE, &g_UndoTable); + g_SynapseClient.AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable), SYN_REQUIRE, &g_AppSurfaceTable); + g_SynapseClient.AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable), SYN_REQUIRE, &g_SelectedFaceTable); + g_SynapseClient.AddAPI(SHADERS_MAJOR, "ufoai", sizeof(_QERShadersTable), SYN_REQUIRE, &g_ShadersTable); + g_SynapseClient.AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable), SYN_REQUIRE, &g_AppShadersTable); + g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_AppDataTable); + + return &g_SynapseClient; +} + +bool CSynapseClient_SurfDLG::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, SURFACEDIALOG_MAJOR)) + { + _QERPlugSurfaceTable* pSurfDialogTable= static_cast<_QERPlugSurfaceTable*>(pAPI->mpTable); + if (!strcmp(pAPI->minor_name, "ufoai")) + { + pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface; + pSurfDialogTable->m_pfnDoSurface = &DoSurface; + pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog; + pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll; + pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget; + return true; + } + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClient_SurfDLG::GetInfo() +{ + return "Surface Dialog (UFO: Alien Invasion) module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClient_SurfDLG::GetName() +{ + return "surface"; +} + +bool CSynapseClient_SurfDLG::OnActivate() +{ + return true; +} diff --git a/plugins/surface_ufoai/surfdlg_plugin.h b/plugins/surface_ufoai/surfdlg_plugin.h new file mode 100644 index 00000000..f5391344 --- /dev/null +++ b/plugins/surface_ufoai/surfdlg_plugin.h @@ -0,0 +1,94 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _SURFDLG_PLUGIN_H_ +#define _SURFDLG_PLUGIN_H_ + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "qerplugin.h" +#include "synapse.h" +#include "iselectedface.h" +#include "iundo.h" +#include "ishaders.h" +#include "mathlib.h" +#include "missing.h" +#include "idata.h" + +#include "isurfaceplugin.h" + +class SurfaceDialog : public IPluginTexdef +{ + int refCount; +public: + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () { if ( --refCount <= 0 ) delete this; } +}; + +extern _QERFuncTable_1 g_FuncTable; +extern _QERUndoTable g_UndoTable; +extern _QERAppSurfaceTable g_AppSurfaceTable; +extern _QERSelectedFaceTable g_SelectedFaceTable; +extern _QERShadersTable g_ShadersTable; +extern _QERAppShadersTable g_AppShadersTable; +extern _QERAppDataTable g_AppDataTable; + +#define GetSelectedFaceCount g_SelectedFaceTable.m_pfnGetSelectedFaceCount + +#define Undo_Undo g_UndoTable.m_pfnUndo_Undo +#define Undo_GetUndoId g_UndoTable.m_pfnUndo_GetUndoId + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf +#define Sys_UpdateWindows g_FuncTable.m_pfnSysUpdateWindows + + +#define Select_FitTexture g_AppSurfaceTable.m_pfnSelect_FitTexture +#define Get_SI_Inc g_AppSurfaceTable.m_pfnQERApp_QeglobalsSavedinfo_SIInc +#define GridSize g_AppSurfaceTable.m_pfnQeglobalsGetGridSize +#define FaceList_FitTexture g_AppSurfaceTable.m_pfnFaceList_FitTexture +#define GetMainWindow g_AppSurfaceTable.m_pfnGetMainWindow +#define GetSelectedFaceCountfromBrushes g_AppSurfaceTable.m_pfnGetSelectedFaceCountfromBrushes +#define GetSelFacesTexdef g_AppSurfaceTable.m_pfnGetSelFacesTexdef +#define SetTexdef_FaceList g_AppSurfaceTable.m_pfnSetTexdef_FaceList +#define SetWinPos_from_Prefs g_AppSurfaceTable.m_pfnSetWinPos_From_Prefs + +#define Texturewin g_AppShadersTable.m_pfnQeglobalsTexturewin + +#endif // _SURFDLG_PLUGIN_H_ + diff --git a/plugins/textool/2DView.cpp b/plugins/textool/2DView.cpp index fa902149..3bad3fbb 100644 --- a/plugins/textool/2DView.cpp +++ b/plugins/textool/2DView.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/plugins/textool/2DView.h b/plugins/textool/2DView.h index 65c95ca9..59163f80 100644 --- a/plugins/textool/2DView.h +++ b/plugins/textool/2DView.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/plugins/textool/ControlPointsManager.cpp b/plugins/textool/ControlPointsManager.cpp index 4af38038..814ddf9d 100644 --- a/plugins/textool/ControlPointsManager.cpp +++ b/plugins/textool/ControlPointsManager.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "StdAfx.h" void CControlPointsManagerBFace::Init (int iPts, CtrlPts_t *Pts, C2DView *p2DView, int TexSize[2], - _QERFaceData* pFaceData, OpenGLBinding *pQglTable) + _QERFaceData* pFaceData, _QERQglTable *pQglTable) { ManagerState = Idle; m_NumPoints = iPts; @@ -168,7 +168,7 @@ bool CControlPointsManagerBFace::OnLButtonUp (int x, int y) return false; } -void CControlPointsManagerBFace::render() +void CControlPointsManagerBFace::Render() { int i; @@ -242,7 +242,7 @@ patch manager ====================================================================== */ -void CControlPointsManagerPatch::Init( patchMesh_t* pWorkPatch, C2DView *p2DView, OpenGLBinding *pQglTable, patchMesh_t* pPatch ) +void CControlPointsManagerPatch::Init( patchMesh_t* pWorkPatch, C2DView *p2DView, _QERQglTable *pQglTable, patchMesh_t* pPatch ) { CControlPointsManager::Init( p2DView, pQglTable ); m_pPatch = pPatch; @@ -302,7 +302,7 @@ bool CControlPointsManagerPatch::OnLButtonUp (int x, int y) return false; } -void CControlPointsManagerPatch::render() +void CControlPointsManagerPatch::Render() { int i,j; diff --git a/plugins/textool/ControlPointsManager.h b/plugins/textool/ControlPointsManager.h index 4305098c..70374005 100644 --- a/plugins/textool/ControlPointsManager.h +++ b/plugins/textool/ControlPointsManager.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -41,18 +41,18 @@ class CControlPointsManager { protected: // used by Render - OpenGLBinding *m_pQglTable; + _QERQglTable *m_pQglTable; C2DView *m_p2DView; public: CControlPointsManager() { m_pQglTable = NULL; m_p2DView = NULL; } virtual ~CControlPointsManager() { } - void Init( C2DView *p2DView, OpenGLBinding *pQglTable ) { m_pQglTable = pQglTable; m_p2DView = p2DView; } + void Init( C2DView *p2DView, _QERQglTable *pQglTable ) { m_pQglTable = pQglTable; m_p2DView = p2DView; } virtual bool OnLButtonDown (int x, int y) = 0; virtual bool OnMouseMove (int x, int y) = 0; virtual bool OnLButtonUp (int x, int y) = 0; - virtual void render() = 0; + virtual void Render() = 0; virtual void Commit() = 0; }; @@ -87,14 +87,14 @@ public: CControlPointsManagerBFace() { ManagerState = Idle; } virtual ~CControlPointsManagerBFace() { } // NOTE: pQglTable is sent to CControlPointsManager::Init - void Init(int iPts, CtrlPts_t *Pts, C2DView *p2DView, int TexSize[2], _QERFaceData* pFaceData, OpenGLBinding *pQglTable); + void Init(int iPts, CtrlPts_t *Pts, C2DView *p2DView, int TexSize[2], _QERFaceData* pFaceData, _QERQglTable *pQglTable); // CControlPointsManager interface ------------------------------------- virtual bool OnLButtonDown (int x, int y); virtual bool OnMouseMove (int x, int y); virtual bool OnLButtonUp (int x, int y); - virtual void render(); + virtual void Render(); virtual void Commit(); private: @@ -119,14 +119,14 @@ public: CControlPointsManagerPatch() { ManagerState = Idle; } virtual ~CControlPointsManagerPatch() { } // NOTE: pQglTable is sent to CControlPointsManager::Init - void Init( patchMesh_t* pWorkPatch, C2DView *p2DView, OpenGLBinding *pQglTable, patchMesh_t* pPatch ); + void Init( patchMesh_t* pWorkPatch, C2DView *p2DView, _QERQglTable *pQglTable, patchMesh_t* pPatch ); // CControlPointsManager interface ------------------------------------- virtual bool OnLButtonDown (int x, int y); virtual bool OnMouseMove (int x, int y); virtual bool OnLButtonUp (int x, int y); - virtual void render(); + virtual void Render(); virtual void Commit(); }; diff --git a/plugins/textool/Doc/TexTool.html b/plugins/textool/Doc/TexTool.html index 7e619092..d8590034 100644 --- a/plugins/textool/Doc/TexTool.html +++ b/plugins/textool/Doc/TexTool.html @@ -1,123 +1,123 @@ - - - TexTool plugin for Q3Radiant - documentation -
- - -TexTool plugin for Q3Radiant
-
Introduction -

TexTool is a set of texture tools for Q3Radiant. It was designed to help fine-tuning texture placement -on brushes and patches.

-Warning: -

The plugin needs brush primitives texture coordinates to operate. If this feature is not enabled in your project -settings you'll only be able to edit patches.

-
Basic use -

It's a "drag-n-drop control points" interface. Select a single face on a brush ( with shift+ctrl+left mouse clic), -or a patch, and do Plugins > Q3 Texture Tools > Go.... You can select points and move them... if you are editing -a brush face, you can rotate the shape by clicking on an anchor point first, then dragging another point.

-
- - - - - -TexTool screenshot - -
- -

There are also a few misc keys to help you. You can - -right clic + move the mouse to change the point of view -and use - -Inser and - -Suppr to zoom in/out. - - - - - -
- -


-Appendix: keyboard shortcuts -

You can use the following keyboard shortcuts:

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - KEY
-
- - usage
-
ESC
-
cancel the changes and hide TexTool window
-
RETURN
-
validate changes into the editor (also resets the view)
-
INSERT
-
zoom in
-
SUPPR
-
zoom out
-
RIGHT CLIC+MOVE
-
move the view
-
LEFT CLIC+MOVE
-
grab a control point and move it
-
RIGHT CLIC
-
drop down menu
-

-

Feedback, enhancements bugs etc. to timo@qeradiant.com

-

- - - + + + TexTool plugin for Q3Radiant - documentation +
+ + +TexTool plugin for Q3Radiant
+
Introduction +

TexTool is a set of texture tools for Q3Radiant. It was designed to help fine-tuning texture placement +on brushes and patches.

+Warning: +

The plugin needs brush primitives texture coordinates to operate. If this feature is not enabled in your project +settings you'll only be able to edit patches.

+
Basic use +

It's a "drag-n-drop control points" interface. Select a single face on a brush ( with shift+ctrl+left mouse clic), +or a patch, and do Plugins > Q3 Texture Tools > Go.... You can select points and move them... if you are editing +a brush face, you can rotate the shape by clicking on an anchor point first, then dragging another point.

+
+ + + + + +TexTool screenshot + +
+ +

There are also a few misc keys to help you. You can + +right clic + move the mouse to change the point of view +and use + +Inser and + +Suppr to zoom in/out. + + + + + +
+ +


+Appendix: keyboard shortcuts +

You can use the following keyboard shortcuts:

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + KEY
+
+ + usage
+
ESC
+
cancel the changes and hide TexTool window
+
RETURN
+
validate changes into the editor (also resets the view)
+
INSERT
+
zoom in
+
SUPPR
+
zoom out
+
RIGHT CLIC+MOVE
+
move the view
+
LEFT CLIC+MOVE
+
grab a control point and move it
+
RIGHT CLIC
+
drop down menu
+

+

Feedback, enhancements bugs etc. to timo@qeradiant.com

+

+ + + diff --git a/plugins/textool/StdAfx.cpp b/plugins/textool/StdAfx.cpp index 1b6e3d3c..e3560890 100644 --- a/plugins/textool/StdAfx.cpp +++ b/plugins/textool/StdAfx.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // stdafx.cpp : source file that includes just the standard includes // stdafx.obj will contain the pre-compiled type information -#include "stdafx.h" +#include "StdAfx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file diff --git a/plugins/textool/StdAfx.h b/plugins/textool/StdAfx.h index f23eeafd..f54bb591 100644 --- a/plugins/textool/StdAfx.h +++ b/plugins/textool/StdAfx.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#if !defined(WIN32) +#if defined(__linux__) || defined(__APPLE__) // Necessary for proper boolean type declaration #include "qertypes.h" @@ -125,7 +125,7 @@ typedef struct } CtrlPts_t; #include "ControlPointsManager.h" -extern OpenGLBinding g_QglTable; +extern _QERQglTable g_QglTable; extern _QERFuncTable_1 g_FuncTable; // prefs globals // NOTE: these are used by the CControlPointsManager classes, not very C++ish diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index 9ba7b01b..eb519033 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -38,7 +38,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data) ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); *loop = 0; - *ret = gpointer_to_int (data); + *ret = (int)data; } static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) @@ -182,7 +182,7 @@ CWindowListener g_Listen; // plugin interfaces --------------------------- bool g_bQglInitDone = false; -OpenGLBinding g_QglTable; +_QERQglTable g_QglTable; bool g_bSelectedFaceInitDone = false; _QERSelectedFaceTable g_SelectedFaceTable; bool g_bUITable = false; @@ -533,7 +533,7 @@ static void DoExpose () } // let the control points manager render - g_pManager->render( ); + g_pManager->Render( ); } static bool CanProcess () @@ -821,14 +821,14 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b // if it's the first call, perhaps we need some additional init steps if (!g_bQglInitDone) { - g_QglTable.m_nSize = sizeof(OpenGLBinding); + g_QglTable.m_nSize = sizeof(_QERQglTable); if ( g_FuncTable.m_pfnRequestInterface( QERQglTable_GUID, static_cast(&g_QglTable) ) ) { g_bQglInitDone = true; } else { - Sys_Printf("TexTool plugin: OpenGLBinding interface request failed\n"); + Sys_Printf("TexTool plugin: _QERQglTable interface request failed\n"); return; } } @@ -919,8 +919,13 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b CSynapseServer* g_pSynapseServer = NULL; CSynapseClientTexTool g_SynapseClient; -extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer) -{ +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif if (strcmp(version, SYNAPSE_VERSION)) { Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); diff --git a/plugins/textool/TexTool.rc b/plugins/textool/TexTool.rc index 69d0eaf5..02394880 100644 --- a/plugins/textool/TexTool.rc +++ b/plugins/textool/TexTool.rc @@ -1,136 +1,136 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DIALOG2 DIALOGEX 0, 0, 290, 206 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -FONT 8, "MS Sans Serif" -BEGIN -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_DIALOG2, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 283 - TOPMARGIN, 7 - BOTTOMMARGIN, 199 - END -END -#endif // APSTUDIO_INVOKED - -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_DROP_MENU MENU DISCARDABLE -BEGIN - POPUP "Drop" - BEGIN - MENUITEM "Validate (RETURN)", ID_DROP_VALIDATE - MENUITEM "Zoom in (INSERT)", ID_DROP_ZOOMIN - MENUITEM "Zoom out (SUPPR)", ID_DROP_ZOOMOUT - MENUITEM "Cancel (ESC)", ID_DROP_CANCEL - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // French (France) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG2 DIALOGEX 0, 0, 290, 206 +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +FONT 8, "MS Sans Serif" +BEGIN +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG2, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 283 + TOPMARGIN, 7 + BOTTOMMARGIN, 199 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_DROP_MENU MENU DISCARDABLE +BEGIN + POPUP "Drop" + BEGIN + MENUITEM "Validate (RETURN)", ID_DROP_VALIDATE + MENUITEM "Zoom in (INSERT)", ID_DROP_ZOOMIN + MENUITEM "Zoom out (SUPPR)", ID_DROP_ZOOMOUT + MENUITEM "Cancel (ESC)", ID_DROP_CANCEL + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// French (France) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) +#ifdef _WIN32 +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // French (France) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/textool/TexTool.vcproj b/plugins/textool/TexTool.vcproj index e5e285a3..f1f6a838 100644 --- a/plugins/textool/TexTool.vcproj +++ b/plugins/textool/TexTool.vcproj @@ -1,211 +1,99 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/vfspak/vfs.cpp b/plugins/vfspak/vfs.cpp new file mode 100644 index 00000000..5b5a0299 --- /dev/null +++ b/plugins/vfspak/vfs.cpp @@ -0,0 +1,803 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// Rules: +// +// - Directories should be searched in the following order: ~/.q3a/baseq3, +// install dir (/usr/local/games/quake3/baseq3) and cd_path (/mnt/cdrom/baseq3). +// +// - Pak files are searched first inside the directories. +// - Case insensitive. +// - Unix-style slashes (/) +// +// Leonardo Zide (leo@lokigames.com) +// + +#include +#include +#if defined __linux__ || defined (__APPLE__) + #include + #include + #define WINAPI +#else + #include + #include + #define R_OK 04 + #define S_ISDIR(mode) (mode & _S_IFDIR) +#endif + +#include "str.h" +#include +#include +#include "vfs.h" +#include "vfspak.h" + +typedef struct +{ + char magic[4]; // Name of the new WAD format ("PACK") + gint32 diroffset; // Position of WAD directory from start of file + gint32 dirsize; // Number of entries * 0x40 (64 char) +} pakheader_t; + +typedef struct +{ + char filename[0x38]; // Name of the file, Unix style, with extension, 50 chars, padded with '\0'. + gint32 offset; // Position of the entry in PACK file + gint32 size; // Size of the entry in PACK file +} pakentry_t; + +typedef struct +{ + char* name; + pakentry_t entry; + FILE *pak; +} VFS_PAKFILE; + +// ============================================================================= +// Global variables + +static GSList* g_unzFiles; +static GSList* g_pakFiles; +static char g_strDirs[VFS_MAXDIRS][PATH_MAX]; +static int g_numDirs; +static bool g_bUsePak = true; + +// ============================================================================= +// Static functions + +static void vfsAddSlash (char *str) +{ + int n = strlen (str); + if (n > 0) + { + if (str[n-1] != '\\' && str[n-1] != '/') + strcat (str, "/"); + } +} + +static void vfsFixDOSName (char *src) +{ + if (src == NULL) + return; + + while (*src) + { + if (*src == '\\') + *src = '/'; + src++; + } +} + +static void vfsInitPakFile (const char *filename) +{ + pakheader_t header; + FILE *f; + long i; + + f = fopen (filename, "rb"); + if (f == NULL) + return; + + // read header + fread (header.magic, 1, 4, f); + fread (&header.diroffset, 1, 4, f); + fread (&header.dirsize, 1, 4, f); + + // fix endianess + header.diroffset = GINT32_FROM_LE (header.diroffset); + header.dirsize = GINT32_FROM_LE (header.dirsize); + + // check that the magic header + if (strncmp (header.magic, "PACK", 4)) + { + fclose (f); + return; + } + + g_FuncTable.m_pfnSysPrintf(" pak file: %s\n", filename); + + g_unzFiles = g_slist_append (g_unzFiles, f); + fseek (f, header.diroffset, SEEK_SET); + + for (i = 0; i < (long)(header.dirsize/sizeof (pakentry_t)); i++) + { + VFS_PAKFILE* file; + + file = (VFS_PAKFILE*)g_malloc (sizeof (VFS_PAKFILE)); + g_pakFiles = g_slist_append (g_pakFiles, file); + + fread (file->entry.filename, 1, sizeof (file->entry.filename), f); + fread (&file->entry.offset, 1, sizeof (file->entry.offset), f); + fread (&file->entry.size, 1, sizeof (file->entry.size), f); + file->pak = f; + + // fix endianess + file->entry.offset = GINT32_FROM_LE (file->entry.offset); + file->entry.size = GINT32_FROM_LE (file->entry.size); + + // fix filename + vfsFixDOSName (file->entry.filename); + g_strdown (file->entry.filename); + //g_FuncTable.m_pfnSysPrintf("vfs file from pak: %s\n", file->entry.filename); + } +} + +static GSList* vfsGetListInternal (const char *dir, const char *ext, bool directories) +{ + GSList *lst, *lst_aux, *files = NULL; + char dirname[NAME_MAX], extension[NAME_MAX], filename[NAME_MAX]; + int dirlen; + char *ptr; + //struct dirent *dirlist; + char *dirlist; + struct stat st; + GDir *diskdir; + int i; + + dirname[0] = '\0'; + if (dir != NULL) + { + strcat (dirname, dir); + g_strdown (dirname); + vfsFixDOSName (dirname); + vfsAddSlash (dirname); + Sys_Printf("vfs dirname_1: %s\n", dirname); + } + //else + // dirname[0] = '\0'; + dirlen = strlen (dirname); + + if (ext != NULL) + strcpy (extension, ext); + else + extension[0] = '\0'; + g_strdown (extension); + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + gboolean found = FALSE; + ptr = file->entry.filename; + + // check that the file name begins with dirname + for (i = 0; (*ptr && i < dirlen); i++, ptr++) + if (*ptr != dirname[i]) + break; + + if (i != dirlen) + continue; + + if (directories) + { + char *sep = strchr (ptr, '/'); + if (sep == NULL) + continue; + + i = sep-ptr; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strncmp ((char*)lst_aux->data, ptr, i) == 0) + { + found = TRUE; + break; + } + + if (!found) + { + char *name = g_strndup (ptr, i+1); + name[i] = '\0'; + files = g_slist_append (files, name); + } + } + else + { + // check extension + if ((ext != NULL) && (strstr (ptr, extension) == NULL)) + continue; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, ptr) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (ptr)); + } + } + + for (i = 0; i < g_numDirs; i++) + { + strcpy (dirname, g_strDirs[i]); + strcat (dirname, dir); + g_strdown (dirname); + vfsFixDOSName (dirname); + vfsAddSlash (dirname); + + diskdir = g_dir_open (dirname, 0, NULL); + + if (diskdir != NULL) + { + while (1) + { + const char* name = g_dir_read_name(diskdir); + if(name == NULL) + break; + + if (directories && (name[0] == '.')) + continue; + + sprintf (filename, "%s%s", dirname, name); + stat (filename, &st); + Sys_Printf("vfs FileName: %s\n", filename); + + if ((S_ISDIR (st.st_mode) != 0) != directories) + continue; + + gboolean found = FALSE; + + dirlist = g_strdup(name); + + g_strdown (dirlist); + + char *ptr_ext = strrchr (dirlist, '.'); + if(ext == NULL + || (ext != NULL && ptr_ext != NULL && ptr_ext[0] != '\0' && strcmp (ptr_ext+1, extension) == 0)) + { + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, dirlist) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (dirlist)); + } + + g_free(dirlist); + } + g_dir_close (diskdir); + } + } + + return files; +} + +/*! +This behaves identically to -stricmp(a,b), except that ASCII chars +[\]^`_ come AFTER alphabet chars instead of before. This is because +it effectively converts all alphabet chars to uppercase before comparison, +while stricmp converts them to lowercase. +*/ +//!\todo Analyse the code in rtcw/q3 to see how it behaves. +static int vfsPakSort (const void *a, const void *b) +{ + char *s1, *s2; + int c1, c2; + + s1 = (char*)a; + s2 = (char*)b; + + do { + c1 = *s1++; + c2 = *s2++; + + if (c1 >= 'a' && c1 <= 'z') + { + c1 -= ('a' - 'A'); + } + if (c2 >= 'a' && c2 <= 'z') + { + c2 -= ('a' - 'A'); + } + + if ( c1 == '\\' || c1 == ':' ) + { + c1 = '/'; + } + if ( c2 == '\\' || c2 == ':' ) + { + c2 = '/'; + } + + // Arnout: note - sort pakfiles in reverse order. This ensures that + // later pakfiles override earlier ones. This because the vfs module + // returns a filehandle to the first file it can find (while it should + // return the filehandle to the file in the most overriding pakfile, the + // last one in the list that is). + if (c1 < c2) + { + //return -1; // strings not equal + return 1; // strings not equal + } + if (c1 > c2) + { + //return 1; + return -1; + } + } while (c1); + + return 0; // strings are equal +} + +// ============================================================================= +// Global functions + +void vfsInitDirectory (const char *path) +{ + char filename[PATH_MAX]; + //struct dirent *direntry; + GDir *dir; + //GSList *dirlistptr; + GSList *dirlist = NULL; + + if (g_numDirs == (VFS_MAXDIRS-1)) + return; + + strcpy (g_strDirs[g_numDirs], path); + vfsFixDOSName (g_strDirs[g_numDirs]); + vfsAddSlash (g_strDirs[g_numDirs]); + g_numDirs++; + + if (g_bUsePak) + { + dir = g_dir_open (path, 0, NULL); + if (dir != NULL) + { + g_FuncTable.m_pfnSysPrintf("vfs directory: %s\n", path); + + for(;;) + { + const char* name = g_dir_read_name(dir); + if(name == NULL) + break; + + char *ext = strrchr (name, '.'); + if ((ext == NULL) || (strcasecmp (ext, ".pak") != 0)) + continue; + + char* direntry = g_strdup(name); + dirlist = g_slist_append (dirlist, direntry); + } + + g_dir_close (dir); + + + // sort them + dirlist = g_slist_sort (dirlist, vfsPakSort); + + // add the entries to the vfs and free the list + while (dirlist) + { + GSList *cur = dirlist; + char* name = (char*)cur->data; + + sprintf (filename, "%s/%s", path, name); + vfsInitPakFile (filename); + + g_free (name); + dirlist = g_slist_remove (cur, name); + } + } else + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, "vfs directory not found: %s\n", path); + + } +} + + +// frees all memory that we allocated +void vfsShutdown () +{ + while (g_unzFiles) + { + fclose ((FILE*)g_unzFiles->data); + g_unzFiles = g_slist_remove (g_unzFiles, g_unzFiles->data); + } + + while (g_pakFiles) + { + g_free (g_pakFiles->data); + g_pakFiles = g_slist_remove (g_pakFiles, g_pakFiles->data); + } +} + +GSList* vfsGetFileList (const char *dir, const char *ext) +{ + return vfsGetListInternal (dir, ext, false); +} + +GSList* vfsGetDirList (const char *dir) +{ + return vfsGetListInternal (dir, NULL, true); +} + +void vfsClearFileDirList (GSList **lst) +{ + while (*lst) + { + g_free ((*lst)->data); + *lst = g_slist_remove (*lst, (*lst)->data); + } +} + +// return the number of files that match +int vfsGetFileCount (const char *filename, int flag) +{ + int i, count = 0; + char fixed[NAME_MAX], tmp[NAME_MAX]; + GSList *lst; + + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + if (strcmp (file->entry.filename, fixed) == 0) + count++; + } + + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, fixed); + if (access (tmp, R_OK) == 0) + count++; + } + + return count; +} + +// NOTE: when loading a file, you have to allocate one extra byte and set it to \0 +int vfsLoadFile (const char *filename, void **bufferptr, int index) +{ + int i, count = 0; + char tmp[NAME_MAX], fixed[NAME_MAX]; + GSList *lst; + + *bufferptr = NULL; + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); + + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, filename); + if (access (tmp, R_OK) == 0) + { + if (count == index) + { + long len; + FILE *f; + + f = fopen (tmp, "rb"); + if (f == NULL) + return -1; + + fseek (f, 0, SEEK_END); + len = ftell (f); + rewind (f); + + *bufferptr = malloc (len+1); + if (*bufferptr == NULL) + return -1; + + fread (*bufferptr, 1, len, f); + fclose (f); + + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[len] = 0; + + return len; + } + + count++; + } + } + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + if (strcmp (file->entry.filename, fixed) != 0) + continue; + + if (count == index) + { + fseek (file->pak, file->entry.offset, SEEK_SET); + + *bufferptr = malloc (file->entry.size+1); + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[file->entry.size] = 0; + + return fread (*bufferptr, 1, file->entry.size, file->pak); + } + + count++; + } + + return -1; +} + +void vfsFreeFile (void *p) +{ + g_free(p); +} + +// open a full path file +int vfsLoadFullPathFile (const char *filename, void **bufferptr) +{ + FILE *f; + long len; + + f = fopen (filename, "rb"); + if (f == NULL) + return -1; + + fseek (f, 0, SEEK_END); + len = ftell (f); + rewind (f); + + *bufferptr = g_malloc (len+1); + if (*bufferptr == NULL) + return -1; + + fread (*bufferptr, 1, len, f); + fclose (f); + + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[len] = 0; + + return len; +} + +void vfsCleanFileName(char *in) +{ + strlwr(in); + vfsFixDOSName(in); + int n = strlen(in); + if (in[n-1] == '/') + in[n-1] = '\0'; +} + +const char* vfsBasePromptPath() +{ +#ifdef _WIN32 + static char* path = "C:"; +#else + static char* path = "/"; +#endif + return path; +} + +/*! +\param shorten will try to match against the short version +http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=144 +recent switch back to short path names in project settings has broken some stuff +with shorten == true, we will convert in to short version before looking for root +FIXME WAAA .. the stuff below is much more simple on linux .. add appropriate #ifdef +*/ +char* vfsExtractRelativePath_short(const char *in, bool shorten) +{ + int i; + char l_in[PATH_MAX]; + char check[PATH_MAX]; + static char out[PATH_MAX]; + out[0] = 0; + +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: %s\n", in); +#endif + +#ifdef _WIN32 + if (shorten) + { + // make it short + if (GetShortPathName(in, l_in, PATH_MAX) == 0) + { +#ifdef DBG_RLTPATH + Sys_Printf("GetShortPathName failed\n"); +#endif + return NULL; + } + } + else + { + strcpy(l_in,in); + } + vfsCleanFileName(l_in); +#else + strcpy(l_in, in); + vfsCleanFileName(l_in); +#endif // ifdef WIN32 + + +#ifdef DBG_RLTPATH + Sys_Printf("cleaned path: %s\n", l_in); +#endif + + for (i = 0; i < g_numDirs; i++) + { + strcpy(check,g_strDirs[i]); + vfsCleanFileName(check); +#ifdef DBG_RLTPATH + Sys_Printf("Matching against %s\n", check); +#endif + + // try to find a match + if (strstr(l_in, check)) + { + strcpy(out,l_in+strlen(check)+1); + break; + } + + } + if (out[0]!=0) + { +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: success\n"); +#endif + return out; + } +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: failed\n"); +#endif + return NULL; +} + +// HYDRA: this now searches VFS/PAK files in addition to the filesystem +// if FLAG is unspecified then ONLY dirs are searched. +// PAK's are searched before DIRs to mimic engine behaviour +// index is ignored when searching PAK files. +// see ifilesystem.h +char* vfsGetFullPath(const char *in, int index, int flag) +{ + int count = 0; + static char out[PATH_MAX]; + char tmp[NAME_MAX]; + int i; + + if (flag & VFS_SEARCH_PAK) + { + char fixed[NAME_MAX]; + GSList *lst; + + strcpy (fixed, in); + vfsFixDOSName (fixed); + g_strdown (fixed); + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + char *ptr,*lastptr; + lastptr = file->name; + + while (ptr = strchr(lastptr,'/')) + lastptr = ptr+1; + + if (strcmp (lastptr, fixed) == 0) + { + strncpy(out,file->name,PATH_MAX); + return out; + } + } + + } + + if (!flag || (flag & VFS_SEARCH_DIR)) + { + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, in); + if (access (tmp, R_OK) == 0) + { + if (count == index) + { + strcpy (out, tmp); + return out; + } + count++; + } + } + } + return NULL; +} + +// FIXME TTimo: this and the above should be merged at some point +char* vfsExtractRelativePath(const char *in) +{ + static char out[PATH_MAX]; + unsigned int i, count; + char *chunk, *backup = NULL; // those point to out stuff + char *ret = vfsExtractRelativePath_short(in, false); + if (!ret) + { +#ifdef DBG_RLTPATH + Sys_Printf("trying with a short version\n"); +#endif + ret = vfsExtractRelativePath_short(in, true); + if (ret) + { + // ok, but we have a relative short version now + // hack the long relative version out of here + count = 0; + for(i=0;i +#include "vfspak.h" +#include "vfs.h" + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientVFS g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(VFS_MAJOR, "pak", sizeof(_QERFileSystemTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + + return &g_SynapseClient; +} + +bool CSynapseClientVFS::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, VFS_MAJOR)) + { + _QERFileSystemTable* pTable= static_cast<_QERFileSystemTable*>(pAPI->mpTable); + pTable->m_pfnInitDirectory = &vfsInitDirectory; + pTable->m_pfnShutdown = &vfsShutdown; + pTable->m_pfnFreeFile = &vfsFreeFile; + pTable->m_pfnGetDirList = &vfsGetDirList; + pTable->m_pfnGetFileList = &vfsGetFileList; + pTable->m_pfnClearFileDirList = &vfsClearFileDirList; + pTable->m_pfnGetFileCount = &vfsGetFileCount; + pTable->m_pfnLoadFile = &vfsLoadFile; + pTable->m_pfnLoadFullPathFile = &vfsLoadFullPathFile; + pTable->m_pfnExtractRelativePath = &vfsExtractRelativePath; + pTable->m_pfnGetFullPath = &vfsGetFullPath; + pTable->m_pfnBasePromptPath = &vfsBasePromptPath; + return true; + } + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientVFS::GetInfo() +{ + return "PAK VFS module built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientVFS::GetName() +{ + return "VFS"; +} diff --git a/plugins/vfspak/vfspak.def b/plugins/vfspak/vfspak.def new file mode 100644 index 00000000..5172d2d8 --- /dev/null +++ b/plugins/vfspak/vfspak.def @@ -0,0 +1,8 @@ +; vfspak.def : Declares the module parameters for the DLL. + +LIBRARY "VFSPAK" +DESCRIPTION 'VFSPAK Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/radiant/gtkdlgs.h b/plugins/vfspak/vfspak.h similarity index 68% rename from radiant/gtkdlgs.h rename to plugins/vfspak/vfspak.h index 36989916..2e10ca62 100644 --- a/radiant/gtkdlgs.h +++ b/plugins/vfspak/vfspak.h @@ -28,32 +28,37 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_GTKDLGS_H) -#define INCLUDED_GTKDLGS_H +#ifndef _VFSPAK_H_ +#define _VFSPAK_H_ +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "synapse.h" #include "qerplugin.h" -#include "string/string.h" +#include "ifilesystem.h" -EMessageBoxReturn DoLightIntensityDlg (int *intensity); -EMessageBoxReturn DoShaderTagDlg (CopiedString *tag, char* title); -EMessageBoxReturn DoShaderInfoDlg (const char* name, const char* filename, char* title); -EMessageBoxReturn DoTextureLayout (float *fx, float *fy); -void DoTextEditor (const char* filename, int cursorpos); +extern _QERFuncTable_1 g_FuncTable; +extern CSynapseServer* g_pSynapseServer; -void DoProjectSettings(); +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf -void DoFind(); -void DoSides(int type, int axis); -void DoAbout(); +class CSynapseClientVFS : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientVFS() { } + virtual ~CSynapseClientVFS() { } +}; - -#ifdef WIN32 -extern bool g_TextEditor_useWin32Editor; -#else -#include "string/stringfwd.h" -extern bool g_TextEditor_useCustomEditor; -extern CopiedString g_TextEditor_editorCommand; -#endif - - -#endif +#endif // _VFSPAK_H_ diff --git a/plugins/vfspak/vfspak.vcproj b/plugins/vfspak/vfspak.vcproj new file mode 100644 index 00000000..e39d942e --- /dev/null +++ b/plugins/vfspak/vfspak.vcproj @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/vfspk3/archive.cpp b/plugins/vfspk3/archive.cpp deleted file mode 100644 index 9147f8f0..00000000 --- a/plugins/vfspk3/archive.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "archive.h" - -#include "idatastream.h" -#include "iarchive.h" - -#include -#include -#include - -#include "stream/filestream.h" -#include "stream/textfilestream.h" -#include "string/string.h" -#include "os/path.h" -#include "os/file.h" -#include "os/dir.h" -#include "archivelib.h" -#include "fs_path.h" - -#include "vfspk3.h" - - -class DirectoryArchive : public Archive -{ - CopiedString m_root; -public: - DirectoryArchive(const char* root) : m_root(root) - { - } - - void release() - { - delete this; - } - virtual ArchiveFile* openFile(const char* name) - { - UnixPath path(m_root.c_str()); - path.push_filename(name); - DirectoryArchiveFile* file = new DirectoryArchiveFile(name, path.c_str()); - if(!file->failed()) - { - return file; - } - file->release(); - return 0; - } - virtual ArchiveTextFile* openTextFile(const char* name) - { - UnixPath path(m_root.c_str()); - path.push_filename(name); - DirectoryArchiveTextFile* file = new DirectoryArchiveTextFile(name, path.c_str()); - if(!file->failed()) - { - return file; - } - file->release(); - return 0; - } - virtual bool containsFile(const char* name) - { - UnixPath path(m_root.c_str()); - path.push_filename(name); - return file_readable(path.c_str()); - } - virtual void forEachFile(VisitorFunc visitor, const char* root) - { - std::vector dirs; - UnixPath path(m_root.c_str()); - path.push(root); - dirs.push_back(directory_open(path.c_str())); - - while(!dirs.empty() && directory_good(dirs.back())) - { - const char* name = directory_read_and_increment(dirs.back()); - - if(name == 0) - { - directory_close(dirs.back()); - dirs.pop_back(); - path.pop(); - } - else if(!string_equal(name, ".") && !string_equal(name, "..")) - { - path.push_filename(name); - - bool is_directory = file_is_directory(path.c_str()); - - if(!is_directory) - visitor.file(path_make_relative(path.c_str(), m_root.c_str())); - - path.pop(); - - if(is_directory) - { - path.push(name); - - if(!visitor.directory(path_make_relative(path.c_str(), m_root.c_str()), dirs.size())) - dirs.push_back(directory_open(path.c_str())); - else - path.pop(); - } - } - } - } -}; - -Archive* OpenArchive(const char* name) -{ - return new DirectoryArchive(name); -} - -#if 0 - -class TestArchive -{ - class TestVisitor : public Archive::IVisitor - { - public: - virtual void visit(const char* name) - { - int bleh = 0; - } - }; -public: - void test1() - { - Archive* archive = OpenArchive("d:/quake/id1/"); - ArchiveFile* file = archive->openFile("quake101.wad"); - if(file != 0) - { - char buffer[1024]; - file->getInputStream().read(buffer, 1024); - file->release(); - } - TestVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 0), ""); - archive->release(); - } - void test2() - { - Archive* archive = OpenArchive("d:/gtkradiant_root/baseq3/"); - TestVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 2), ""); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFiles, 1), "textures"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eDirectories, 1), "textures"); - archive->forEachFile(Archive::VisitorFunc(&visitor, Archive::eFilesAndDirectories, 1), "textures"); - archive->release(); - } - TestArchive() - { - test1(); - test2(); - } -}; - -TestArchive g_test; - -#endif diff --git a/plugins/vfspk3/archive.h b/plugins/vfspk3/archive.h deleted file mode 100644 index 09874c37..00000000 --- a/plugins/vfspk3/archive.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ARCHIVE_H) -#define INCLUDED_ARCHIVE_H - -#include "iarchive.h" - -const _QERArchiveTable* GetArchiveTable(ArchiveModules& archiveModules, const char* type); - -#endif diff --git a/plugins/vfspk3/unzip-vfspk3.h b/plugins/vfspk3/unzip-vfspk3.h new file mode 100644 index 00000000..001a1f54 --- /dev/null +++ b/plugins/vfspk3/unzip-vfspk3.h @@ -0,0 +1,299 @@ +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef void* unzFile; +#endif + + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + unsigned int tm_sec; /* seconds after the minute - [0,59] */ + unsigned int tm_min; /* minutes after the hour - [0,59] */ + unsigned int tm_hour; /* hours since midnight - [0,23] */ + unsigned int tm_mday; /* day of the month - [1,31] */ + unsigned int tm_mon; /* months since January - [0,11] */ + unsigned int tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + unsigned long number_entry; /* total number of entries in the central dir on this disk */ + unsigned long size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + unsigned long version; /* version made by 2 unsigned chars */ + unsigned long version_needed; /* version needed to extract 2 unsigned chars */ + unsigned long flag; /* general purpose bit flag 2 unsigned chars */ + unsigned long compression_method; /* compression method 2 unsigned chars */ + unsigned long dosDate; /* last mod file date in Dos fmt 4 unsigned chars */ + unsigned long crc; /* crc-32 4 unsigned chars */ + unsigned long compressed_size; /* compressed size 4 unsigned chars */ + unsigned long uncompressed_size; /* uncompressed size 4 unsigned chars */ + unsigned long size_filename; /* filename length 2 unsigned chars */ + unsigned long size_file_extra; /* extra field length 2 unsigned chars */ + unsigned long size_file_comment; /* file comment length 2 unsigned chars */ + + unsigned long disk_num_start; /* disk number start 2 unsigned chars */ + unsigned long internal_fa; /* internal file attributes 2 unsigned chars */ + unsigned long external_fa; /* external file attributes 4 unsigned chars */ + + tm_unz tmu_date; +} unz_file_info; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + unsigned long offset_curfile;/* relative offset of static header 4 unsigned chars */ +} unz_file_info_internal; + +typedef void* (*alloc_func) (void* opaque, unsigned int items, unsigned int size); +typedef void (*free_func) (void* opaque, void* address); + +struct internal_state; + +typedef struct z_stream_s { + unsigned char *next_in; /* next input unsigned char */ + unsigned int avail_in; /* number of unsigned chars available at next_in */ + unsigned long total_in; /* total nb of input unsigned chars read so */ + + unsigned char *next_out; /* next output unsigned char should be put there */ + unsigned int avail_out; /* remaining free space at next_out */ + unsigned long total_out; /* total nb of unsigned chars output so */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + unsigned char* opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + unsigned long adler; /* adler32 value of the uncompressed data */ + unsigned long reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream *z_streamp; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + unsigned long pos_in_zipfile; /* position in unsigned char on the zipfile, for fseek*/ + unsigned long stream_initialised; /* flag set if stream structure is initialised*/ + + unsigned long offset_local_extrafield;/* offset of the static extra field */ + unsigned int size_local_extrafield;/* size of the static extra field */ + unsigned long pos_local_extrafield; /* position in the static extra field in read*/ + + unsigned long crc32; /* crc32 of all data uncompressed */ + unsigned long crc32_wait; /* crc32 we must obtain after decompress all */ + unsigned long rest_read_compressed; /* number of unsigned char to be decompressed */ + unsigned long rest_read_uncompressed;/*number of unsigned char to be obtained after decomp*/ + FILE* file; /* io structore of the zipfile */ + unsigned long compression_method; /* compression method (0==store) */ + unsigned long byte_before_the_zipfile;/* unsigned char before the zipfile, (>0 for sfx)*/ +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + FILE* file; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + unsigned long byte_before_the_zipfile;/* unsigned char before the zipfile, (>0 for sfx)*/ + unsigned long num_file; /* number of the current file in the zipfile*/ + unsigned long pos_in_central_dir; /* pos of the current file in the central dir*/ + unsigned long current_file_ok; /* flag about the usability of the current file*/ + unsigned long central_pos; /* position of the beginning of the central dir*/ + + unsigned long size_central_dir; /* size of the central directory */ + unsigned long offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ +} unz_s; + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +#define UNZ_CASESENSITIVE 1 +#define UNZ_NOTCASESENSITIVE 2 +#define UNZ_OSDEFAULTCASE 0 + +extern int unzStringFileNameCompare (const char* fileName1, const char* fileName2, int iCaseSensitivity); + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + +extern unzFile unzOpen (const char *path); +extern unzFile unzReOpen (const char* path, unzFile file); + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer + "zlib/zlib111.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern int unzClose (unzFile file); + +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info); + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int unzGetGlobalComment (unzFile file, char *szComment, unsigned long uSizeBuf); + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of unsigned char copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int unzGoToFirstFile (unzFile file); + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int unzGoToNextFile (unzFile file); + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity); + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +extern int unzGetCurrentFileInfo (unzFile file, unz_file_info *pfile_info, char *szFileName, unsigned long fileNameBufferSize, void *extraField, unsigned long extraFieldBufferSize, char *szComment, unsigned long commentBufferSize); + +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int unzOpenCurrentFile (unzFile file); + +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int unzCloseCurrentFile (unzFile file); + +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + + +extern int unzReadCurrentFile (unzFile file, void* buf, unsigned len); + +/* + Read unsigned chars from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of unsigned char copied if somes unsigned chars are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern long unztell(unzFile file); + +/* + Give the current position in uncompressed data +*/ + +extern int unzeof (unzFile file); + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int unzGetLocalExtrafield (unzFile file, void* buf, unsigned len); + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of unsigned chars copied in buf, or (if <0) + the error code +*/ diff --git a/plugins/vfspk3/unzip.cpp b/plugins/vfspk3/unzip.cpp new file mode 100644 index 00000000..f7b7db1f --- /dev/null +++ b/plugins/vfspk3/unzip.cpp @@ -0,0 +1,4537 @@ +/***************************************************************************** + * name: unzip.c + * + * desc: IO on .zip files using portions of zlib + * + * + *****************************************************************************/ + +#include +#include +#include +#include "unzip-vfspk3.h" + +typedef unsigned char byte; + +/* unzip.h -- IO for uncompress .zip files using zlib + Version 0.15 beta, Mar 19th, 1998, + + Copyright (C) 1998 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Encryption and multi volume ZipFile (span) are not supported. + Old compressions used by old PKZip 1.x are not supported + + THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE + CAN CHANGE IN FUTURE VERSION !! + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ +/* for more info about .ZIP format, see + ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip */ + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.3, July 9th, 1998 + + Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-1998 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +#define OF(args) args +#endif + +typedef unsigned char Byte; /* 8 bits */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ +typedef Byte *voidp; + +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#endif /* _ZCONF_H */ + +#define ZLIB_VERSION "1.1.3" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +const char * zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +int deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +int deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +int deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +int inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +int inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +int inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +int deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +int deflateSetDictionary OF((z_streamp strm, + const Byte *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +int deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +int deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +int deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +int inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +int inflateSetDictionary OF((z_streamp strm, + const Byte *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +int inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +int inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +int compress OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +int compress2 OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +int uncompress OF((Byte *dest, uLong *destLen, + const Byte *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +gzFile gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +gzFile gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +int gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +int gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +int gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +int gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +int gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +char * gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +int gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +int gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +int gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +long gzseek OF((gzFile file, + long offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +int gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +long gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +int gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +int gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +const char * gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +uLong adler32 OF((uLong adler, const Byte *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +uLong crc32 OF((uLong crc, const Byte *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +// private stuff to not include cmdlib.h +/* +============================================================================ + + BYTE ORDER FUNCTIONS + +============================================================================ +*/ + +#ifdef _SGI_SOURCE +#define __BIG_ENDIAN__ +#endif + +#ifdef __BIG_ENDIAN__ + +short __LittleShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return (b1<<8) + b2; +} + +short __BigShort (short l) +{ + return l; +} + + +int __LittleLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int __BigLong (int l) +{ + return l; +} + + +float __LittleFloat (float l) +{ + union {byte b[4]; float f;} in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float __BigFloat (float l) +{ + return l; +} + + +#else + + +short __BigShort (short l) +{ + byte b1,b2; + + b1 = l&255; + b2 = (l>>8)&255; + + return (b1<<8) + b2; +} + +short __LittleShort (short l) +{ + return l; +} + + +int __BigLong (int l) +{ + byte b1,b2,b3,b4; + + b1 = l&255; + b2 = (l>>8)&255; + b3 = (l>>16)&255; + b4 = (l>>24)&255; + + return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; +} + +int __LittleLong (int l) +{ + return l; +} + +float __BigFloat (float l) +{ + union {byte b[4]; float f;} in, out; + + in.f = l; + out.b[0] = in.b[3]; + out.b[1] = in.b[2]; + out.b[2] = in.b[1]; + out.b[3] = in.b[0]; + + return out.f; +} + +float __LittleFloat (float l) +{ + return l; +} + + + +#endif + + + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +int deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +int inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +int deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +int inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +const char * zError OF((int err)); +int inflateSyncPoint OF((z_streamp z)); +const uLong * get_crc_table OF((void)); + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#define zmemcpy memcpy +#define zmemcmp memcmp +#define zmemzero(dest, len) memset(dest, 0, len) + +/* Diagnostic functions */ +#ifdef _ZIP_DEBUG_ + int z_verbose = 0; +# define Assert(cond,msg) assert(cond); + //{if(!(cond)) Sys_Error(msg);} +# define Trace(x) {if (z_verbose>=0) Sys_Error x ;} +# define Tracev(x) {if (z_verbose>0) Sys_Error x ;} +# define Tracevv(x) {if (z_verbose>1) Sys_Error x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) Sys_Error x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) Sys_Error x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (*check_func) OF((uLong check, const Byte *buf, uInt len)); +voidp zcalloc OF((voidp opaque, unsigned items, unsigned size)); +void zcfree OF((voidp opaque, voidp ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidp)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + + +#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \ + !defined(CASESENSITIVITYDEFAULT_NO) +#define CASESENSITIVITYDEFAULT_NO +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (65536) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + +/* +static int unzlocal_getByte(FILE *fin,int *pi) +{ + unsigned char c; + int err = fread(&c, 1, 1, fin); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ferror(fin)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} +*/ + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +static int unzlocal_getShort (FILE* fin, uLong *pX) +{ + short v; + + fread( &v, sizeof(v), 1, fin ); + + *pX = __LittleShort( v); + return UNZ_OK; + +/* + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +*/ +} + +static int unzlocal_getLong (FILE *fin, uLong *pX) +{ + int v; + + fread( &v, sizeof(v), 1, fin ); + + *pX = __LittleLong( v); + return UNZ_OK; + +/* + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +*/ +} + + +/* My own strcmpi / strcasecmp */ +static int strcmpcasenosensitive_internal (const char* fileName1,const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int unzStringFileNameCompare (const char* fileName1,const char* fileName2,int iCaseSensitivity) +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#define BUFREADCOMMENT (0x400) + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +static uLong unzlocal_SearchCentralDir(FILE *fin) +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (fseek(fin,0,SEEK_END) != 0) + return 0; + + + uSizeFile = ftell( fin ); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)malloc(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (fseek(fin,uReadPos,SEEK_SET)!=0) + break; + + if (fread(buf,(uInt)uReadSize,1,fin)!=1) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + free(buf); + return uPosFound; +} + +extern unzFile unzReOpen (const char* path, unzFile file) +{ + unz_s *s; + FILE * fin; + + fin=fopen(path,"rb"); + if (fin==NULL) + return NULL; + + s=(unz_s*)malloc(sizeof(unz_s)); + memcpy(s, (unz_s*)file, sizeof(unz_s)); + + s->file = fin; + return (unzFile)s; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer + "zlib/zlib109.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile unzOpen (const char* path) +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + FILE * fin ; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + fin=fopen(path,"rb"); + if (fin==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(fin); + if (central_pos==0) + err=UNZ_ERRNO; + + if (fseek(fin,central_pos,SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(fin,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + fclose(s->file); + free(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int unzGetGlobalInfo (unzFile file,unz_global_info *pglobal_info) +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +static void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm) +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +static int unzlocal_GetCurrentFileInfoInternal (unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extrafile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek += file_info.size_file_extra - uSizeRead; + } + else + lSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentfile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int unzGetCurrentFileInfo ( unzFile file, unz_file_info *pfile_info, + char *szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char *szComment, uLong commentBufferSize) +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int unzGoToFirstFile (unzFile file) +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int unzGoToNextFile (unzFile file) +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz_s* s; + int err; + + + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + return err; +} + + +/* + Read the static header of the current zipfile + Check the coherency of the static header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in static header + (filename and size of extra field data) +*/ +static int unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uInt* piSizeVar, + uLong *poffset_local_extrafield, + uInt *psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (fseek(s->file,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int unzOpenCurrentFile (unzFile file) +{ + int err=UNZ_OK; + int Store; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the static extra field */ + uInt size_local_extrafield; /* size of the static extra field */ + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + malloc(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)malloc(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + free(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + Store = s->cur_file_info.compression_method==0; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->file=s->file; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if (!Store) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidp)0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + + s->pfile_in_zip_read = pfile_in_zip_read_info; + return UNZ_OK; +} + + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int unzReadCurrentFile (unzFile file, void *buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Byte*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if (len>pfile_in_zip_read_info->rest_read_uncompressed) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (s->cur_file_info.compressed_size == pfile_in_zip_read_info->rest_read_compressed) + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1, + pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Byte*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if (pfile_in_zip_read_info->compression_method==0) + { + uInt uDoCopy,i ; + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Byte *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern long unztell (unzFile file) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (long)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int unzeof (unzFile file) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the static-header version of the extra field (sometimes, there is + more info in the static-header version than in the central-header) + + if buf==NULL, it return the size of the static extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int unzGetLocalExtrafield (unzFile file,void *buf,unsigned len) +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + free(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + free(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf) +{ + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (fread(szComment,(uInt)uReadThis,1,s->file)!=1) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + + +#ifdef DYNAMIC_CRC_TABLE + +static int crc_table_empty = 1; +static uLong crc_table[256]; +static void make_crc_table OF((void)); + +/* + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all + the information needed to generate CRC's on data a byte at a time for all + combinations of CRC register values and incoming bytes. +*/ +static void make_crc_table() +{ + uLong c; + int n, k; + uLong poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + + for (n = 0; n < 256; n++) + { + c = (uLong)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[n] = c; + } + crc_table_empty = 0; +} +#else +/* ======================================================================== + * Table of CRC-32's of all single-byte values (made by make_crc_table) + */ +static const uLong crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const uLong * get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) make_crc_table(); +#endif + return (const uLong *)crc_table; +} + +/* ========================================================================= */ +#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); +#define DO2(buf) DO1(buf); DO1(buf); +#define DO4(buf) DO2(buf); DO2(buf); +#define DO8(buf) DO4(buf); DO4(buf); + +/* ========================================================================= */ +uLong crc32(uLong crc, const Byte *buf, uInt len) +{ + if (buf == Z_NULL) return 0L; +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif + crc = crc ^ 0xffffffffL; + while (len >= 8) + { + DO8(buf); + len -= 8; + } + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; +} + +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_blocks_state; +typedef struct inflate_blocks_state inflate_blocks_statef; + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLong *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Byte *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* Table for deflate from PKZIP's appnote.txt. */ +static const uInt border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +typedef struct inflate_huft_s inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +extern int inflate_trees_bits OF(( + uInt *, /* 19 code lengths */ + uInt *, /* bits tree desired/actual depth */ + inflate_huft * *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uInt *, /* that many (total) code lengths */ + uInt *, /* literal desired/actual bit depth */ + uInt *, /* distance desired/actual bit depth */ + inflate_huft * *, /* literal/length tree result */ + inflate_huft * *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_fixed OF(( + uInt *, /* literal desired/actual bit depth */ + uInt *, /* distance desired/actual bit depth */ + inflate_huft * *, /* literal/length tree result */ + inflate_huft * *, /* distance tree result */ + z_streamp)); /* for memory allocation */ + + +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_codes_state; +typedef struct inflate_codes_state inflate_codes_statef; + +extern inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +extern int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +extern void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uInt *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Byte *window; /* sliding window */ + Byte *end; /* one byte after sliding window */ + Byte *read; /* window read pointer */ + Byte *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load static pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +extern uInt inflate_mask[17]; + +/* copy as much as possible from the sliding window to the output area */ +extern int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +#endif + + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + + +void inflate_blocks_reset(inflate_blocks_statef *s, z_streamp z, uLong *c) +{ + if (c != Z_NULL) + *c = s->check; + if (s->mode == BTREE || s->mode == DTREE) + ZFREE(z, s->sub.trees.blens); + if (s->mode == CODES) + inflate_codes_free(s->sub.decode.codes, z); + s->mode = TYPE; + s->bitk = 0; + s->bitb = 0; + s->read = s->write = s->window; + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0); + Tracev(("inflate: blocks reset\n")); +} + + +inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w) +{ + inflate_blocks_statef *s; + + if ((s = (inflate_blocks_statef *)ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + return s; + if ((s->hufts = + (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + { + ZFREE(z, s); + return Z_NULL; + } + if ((s->window = (Byte *)ZALLOC(z, 1, w)) == Z_NULL) + { + ZFREE(z, s->hufts); + ZFREE(z, s); + return Z_NULL; + } + s->end = s->window + w; + s->checkfn = c; + s->mode = TYPE; + Tracev(("inflate: blocks allocated\n")); + inflate_blocks_reset(s, z, Z_NULL); + return s; +} + + +int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input based on current state */ + while (1) switch (s->mode) + { + case TYPE: + NEEDBITS(3) + t = (uInt)b & 7; + s->last = t & 1; + switch (t >> 1) + { + case 0: /* stored */ + Tracev(("inflate: stored block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + t = k & 7; /* go to byte boundary */ + DUMPBITS(t) + s->mode = LENS; /* get length of stored block */ + break; + case 1: /* fixed */ + Tracev(("inflate: fixed codes block%s\n", + s->last ? " (last)" : "")); + { + uInt bl, bd; + inflate_huft *tl, *td; + + inflate_trees_fixed(&bl, &bd, &tl, &td, z); + s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + if (s->sub.decode.codes == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + } + DUMPBITS(3) + s->mode = CODES; + break; + case 2: /* dynamic */ + Tracev(("inflate: dynamic codes block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + s->mode = TABLE; + break; + case 3: /* illegal */ + DUMPBITS(3) + s->mode = BAD; + z->msg = (char*)"invalid block type"; + r = Z_DATA_ERROR; + LEAVE + } + break; + case LENS: + NEEDBITS(32) + if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) + { + s->mode = BAD; + z->msg = (char*)"invalid stored block lengths"; + r = Z_DATA_ERROR; + LEAVE + } + s->sub.left = (uInt)b & 0xffff; + b = k = 0; /* dump bits */ + Tracev(("inflate: stored length %u\n", s->sub.left)); + s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); + break; + case STORED: + if (n == 0) + LEAVE + NEEDOUT + t = s->sub.left; + if (t > n) t = n; + if (t > m) t = m; + zmemcpy(q, p, t); + p += t; n -= t; + q += t; m -= t; + if ((s->sub.left -= t) != 0) + break; + Tracev(("inflate: stored end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + s->mode = s->last ? DRY : TYPE; + break; + case TABLE: + NEEDBITS(14) + s->sub.trees.table = t = (uInt)b & 0x3fff; +#ifndef PKZIP_BUG_WORKAROUND + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + s->mode = BAD; + z->msg = (char*)"too many length or distance symbols"; + r = Z_DATA_ERROR; + LEAVE + } +#endif + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if ((s->sub.trees.blens = (uInt*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + DUMPBITS(14) + s->sub.trees.index = 0; + Tracev(("inflate: table sizes ok\n")); + s->mode = BTREE; + case BTREE: + while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) + { + NEEDBITS(3) + s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; + DUMPBITS(3) + } + while (s->sub.trees.index < 19) + s->sub.trees.blens[border[s->sub.trees.index++]] = 0; + s->sub.trees.bb = 7; + t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + &s->sub.trees.tb, s->hufts, z); + if (t != Z_OK) + { + ZFREE(z, s->sub.trees.blens); + r = t; + if (r == Z_DATA_ERROR) + s->mode = BAD; + LEAVE + } + s->sub.trees.index = 0; + Tracev(("inflate: bits tree ok\n")); + s->mode = DTREE; + case DTREE: + while (t = s->sub.trees.table, + s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) + { + inflate_huft *h; + uInt i, j, c; + + t = s->sub.trees.bb; + NEEDBITS(t) + h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + t = h->bits; + c = h->base; + if (c < 16) + { + DUMPBITS(t) + s->sub.trees.blens[s->sub.trees.index++] = c; + } + else /* c == 16..18 */ + { + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + NEEDBITS(t + i) + DUMPBITS(t) + j += (uInt)b & inflate_mask[i]; + DUMPBITS(i) + i = s->sub.trees.index; + t = s->sub.trees.table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + z->msg = (char*)"invalid bit length repeat"; + r = Z_DATA_ERROR; + LEAVE + } + c = c == 16 ? s->sub.trees.blens[i - 1] : 0; + do { + s->sub.trees.blens[i++] = c; + } while (--j); + s->sub.trees.index = i; + } + } + s->sub.trees.tb = Z_NULL; + { + uInt bl, bd; + inflate_huft *tl, *td; + inflate_codes_statef *c; + + bl = 9; /* must be <= 9 for lookahead assumptions */ + bd = 6; /* must be <= 9 for lookahead assumptions */ + t = s->sub.trees.table; + t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + s->sub.trees.blens, &bl, &bd, &tl, &td, + s->hufts, z); + ZFREE(z, s->sub.trees.blens); + if (t != Z_OK) + { + if (t == (uInt)Z_DATA_ERROR) + s->mode = BAD; + r = t; + LEAVE + } + Tracev(("inflate: trees ok\n")); + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + s->sub.decode.codes = c; + } + s->mode = CODES; + case CODES: + UPDATE + if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + return inflate_flush(s, z, r); + r = Z_OK; + inflate_codes_free(s->sub.decode.codes, z); + LOAD + Tracev(("inflate: codes end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + if (!s->last) + { + s->mode = TYPE; + break; + } + s->mode = DRY; + case DRY: + FLUSH + if (s->read != s->write) + LEAVE + s->mode = DONE; + case DONE: + r = Z_STREAM_END; + LEAVE + case BAD: + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +} + + +int inflate_blocks_free(inflate_blocks_statef *s, z_streamp z) +{ + inflate_blocks_reset(s, z, Z_NULL); + ZFREE(z, s->window); + ZFREE(z, s->hufts); + ZFREE(z, s); + Tracev(("inflate: blocks freed\n")); + return Z_OK; +} + + +void inflate_set_dictionary(inflate_blocks_statef *s, const Byte *d, uInt n) +{ + zmemcpy(s->window, d, n); + s->read = s->write = s->window + n; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. + * IN assertion: s != Z_NULL + */ +int inflate_blocks_sync_point(inflate_blocks_statef *s) +{ + return s->mode == LENS; +} + +/* And'ing with mask[n] masks the lower n bits */ +uInt inflate_mask[17] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +/* copy as much as possible from the sliding window to the output area */ +int inflate_flush(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt n; + Byte *p; + Byte *q; + + /* static copies of source and destination pointers */ + p = z->next_out; + q = s->read; + + /* compute number of bytes to copy as as end of window */ + n = (uInt)((q <= s->write ? s->write : s->end) - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy as as end of window */ + zmemcpy(p, q, n); + p += n; + q += n; + + /* see if more to copy at beginning of window */ + if (q == s->end) + { + /* wrap pointers */ + q = s->window; + if (s->write == s->end) + s->write = s->window; + + /* compute bytes to copy */ + n = (uInt)(s->write - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy */ + zmemcpy(p, q, n); + p += n; + q += n; + } + + /* update pointers */ + z->next_out = p; + s->read = q; + + /* done */ + return r; +} + +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +const char inflate_copyright[] = + " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + + +static int huft_build OF(( + uInt *, /* code lengths in bits */ + uInt, /* number of codes */ + uInt, /* number of "simple" codes */ + const uInt *, /* list of base values for non-simple codes */ + const uInt *, /* list of extra bits for non-simple codes */ + inflate_huft **, /* result: starting table */ + uInt *, /* maximum lookup bits (returns actual) */ + inflate_huft *, /* space for trees */ + uInt *, /* hufts used in space */ + uInt * )); /* space for values */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +static const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* see note #13 above about 258 */ +static const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ +static const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +static const uInt cpdext[30] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ +#define BMAX 15 /* maximum bit length of any code */ + +static int huft_build(uInt *b, uInt n, uInt s, const uInt *d, const uInt *e, inflate_huft ** t, uInt *m, inflate_huft *hp, uInt *hn, uInt *v) +//uInt *b; /* code lengths in bits (all assumed <= BMAX) */ +//uInt n; /* number of codes (assumed <= 288) */ +//uInt s; /* number of simple-valued codes (0..s-1) */ +//const uInt *d; /* list of base values for non-simple codes */ +//const uInt *e; /* list of extra bits for non-simple codes */ +//inflate_huft ** t; /* result: starting table */ +//uInt *m; /* maximum lookup bits, returns actual */ +//inflate_huft *hp; /* space for trees */ +//uInt *hn; /* hufts used in space */ +//uInt *v; /* working area: values in order of bit length */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + if the given code set is incomplete (the tables are still built in this + case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + lengths), or Z_MEM_ERROR if not enough memory. */ +{ + + uInt a; /* counter for codes of length k */ + uInt c[BMAX+1]; /* bit length count table */ + uInt f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register uInt i; /* counter, current code */ + register uInt j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ + register uInt *p; /* pointer into c[], b[], or v[] */ + inflate_huft *q; /* points to current table */ + struct inflate_huft_s r; /* table entry for structure assignment */ + inflate_huft *u[BMAX]; /* table stack */ + register int w; /* bits before this table == (l * h) */ + uInt x[BMAX+1]; /* bit offsets, then code stack */ + uInt *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + uInt z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + p = c; +#define C0 *p++ = 0; +#define C2 C0 C0 C0 C0 +#define C4 C2 C2 C2 C2 + C4 /* clear c[]--assume BMAX+1 is 16 */ + p = b; i = n; + do { + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (inflate_huft *)Z_NULL; + *m = 0; + return Z_OK; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((uInt)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((uInt)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return Z_DATA_ERROR; + if ((y -= c[i]) < 0) + return Z_DATA_ERROR; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)Z_NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = g - w; + z = z > (uInt)l ? l : z; /* table size upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate new table */ + if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ + return Z_MEM_ERROR; /* not enough memory */ + u[h] = q = hp + *hn; + *hn += z; + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.bits = (Byte)l; /* bits to dump before this table */ + r.exop = (Byte)j; /* bits in this table */ + j = i >> (w - l); + r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ + u[h-1][j] = r; /* connect to last table */ + } + else + *t = q; /* first table is returned result */ + } + + /* set up table entry in r */ + r.bits = (Byte)(k - w); + if (p >= v + n) + r.exop = 128 + 64; /* out of values--invalid code */ + else if (*p < s) + { + r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ + r.base = *p++; /* simple code is just the value */ + } + else + { + r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ + r.base = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + mask = (1 << w) - 1; /* needed on HP, cc -O bug */ + while ((i & mask) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + mask = (1 << w) - 1; + } + } + } + + + /* Return Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; +} + + +int inflate_trees_bits(uInt *c, uInt *bb, inflate_huft * *tb, inflate_huft *hp, z_streamp z) +//uInt *c; /* 19 code lengths */ +//uInt *bb; /* bits tree desired/actual depth */ +//inflate_huft * *tb; /* bits tree result */ +//inflate_huft *hp; /* space for trees */ +//z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uInt *v; /* work area for huft_build */ + + if ((v = (uInt*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uInt*)Z_NULL, (uInt*)Z_NULL, + tb, bb, hp, &hn, v); + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed dynamic bit lengths tree"; + else if (r == Z_BUF_ERROR || *bb == 0) + { + z->msg = (char*)"incomplete dynamic bit lengths tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +} + + +int inflate_trees_dynamic(uInt nl, uInt nd, uInt *c, uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, inflate_huft *hp, z_streamp z) +//uInt nl; /* number of literal/length codes */ +//uInt nd; /* number of distance codes */ +//uInt *c; /* that many (total) code lengths */ +//uInt *bl; /* literal desired/actual bit depth */ +//uInt *bd; /* distance desired/actual bit depth */ +//inflate_huft * *tl; /* literal/length tree result */ +//inflate_huft * *td; /* distance tree result */ +//inflate_huft *hp; /* space for trees */ +//z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uInt *v; /* work area for huft_build */ + + /* allocate work area */ + if ((v = (uInt*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + + /* build literal/length tree */ + r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); + if (r != Z_OK || *bl == 0) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed literal/length tree"; + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"incomplete literal/length tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; + } + + /* build distance tree */ + r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); + if (r != Z_OK || (*bd == 0 && nl > 257)) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed distance tree"; + else if (r == Z_BUF_ERROR) { +#ifdef PKZIP_BUG_WORKAROUND + r = Z_OK; + } +#else + z->msg = (char*)"incomplete distance tree"; + r = Z_DATA_ERROR; + } + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"empty distance tree with lengths"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +#endif + } + + /* done */ + ZFREE(z, v); + return Z_OK; +} + +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +static uInt fixed_bl = 9; +static uInt fixed_bd = 5; +static inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +static inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; + +int inflate_trees_fixed(uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, z_streamp z) +//uInt *bl; /* literal desired/actual bit depth */ +//uInt *bd; /* distance desired/actual bit depth */ +//inflate_huft * *tl; /* literal/length tree result */ +//inflate_huft * *td; /* distance tree result */ +//z_streamp z; /* for memory allocation */ +{ + *bl = fixed_bl; + *bd = fixed_bd; + *tl = fixed_tl; + *td = fixed_td; + return Z_OK; +} + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* macros for bit input with no checking and for returning unused bytes */ +#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;} + +/* Called with number of bytes left to write in window at least 258 + (the maximum string length) and number of input bytes available + at least ten. The ten bytes are six bytes for the longest length/ + distance pair plus four bytes for overloading the bit buffer. */ + +int inflate_fast(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, inflate_blocks_statef *s, z_streamp z) +{ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + uInt ml; /* mask for literal/length tree */ + uInt md; /* mask for distance tree */ + uInt c; /* bytes to copy */ + uInt d; /* distance back to copy from */ + Byte *r; /* copy source pointer */ + + /* load input, output, bit values */ + LOAD + + /* initialize masks */ + ml = inflate_mask[bl]; + md = inflate_mask[bd]; + + /* do until not enough input or output space for fast loop */ + do { /* assume called with m >= 258 && n >= 10 */ + /* get literal/length code */ + GRABBITS(20) /* max bits for literal/length code */ + if ((e = (t = tl + ((uInt)b & ml))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + continue; + } + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits for length */ + e &= 15; + c = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv(("inflate: * length %u\n", c)); + + /* decode distance base of block to copy */ + GRABBITS(15); /* max bits for distance code */ + e = (t = td + ((uInt)b & md))->exop; + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits to add to distance base */ + e &= 15; + GRABBITS(e) /* get extra bits (up to 13) */ + d = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv(("inflate: * distance %u\n", d)); + + /* do the copy */ + m -= c; + if ((uInt)(q - s->window) >= d) /* offset before dest */ + { /* just copy */ + r = q - d; + *q++ = *r++; c--; /* minimum count is three, */ + *q++ = *r++; c--; /* so unroll loop a little */ + } + else /* else offset after destination */ + { + e = d - (uInt)(q - s->window); /* bytes from offset to end */ + r = s->end - e; /* pointer to offset */ + if (c > e) /* if source crosses, */ + { + c -= e; /* copy to end of window */ + do { + *q++ = *r++; + } while (--e); + r = s->window; /* copy rest from start of window */ + } + } + do { /* copy all or what's left */ + *q++ = *r++; + } while (--c); + break; + } + else if ((e & 64) == 0) + { + t += t->base; + e = (t += ((uInt)b & inflate_mask[e]))->exop; + } + else + { + z->msg = (char*)"invalid distance code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + break; + } + if ((e & 64) == 0) + { + t += t->base; + if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + break; + } + } + else if (e & 32) + { + Tracevv(("inflate: * end of block\n")); + UNGRAB + UPDATE + return Z_STREAM_END; + } + else + { + z->msg = (char*)"invalid literal/length code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + } while (m >= 258 && n >= 10); + + /* not enough input or output--restore pointers and return */ + UNGRAB + UPDATE + return Z_OK; +} + +/* infcodes.c -- process literals and length/distance pairs + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + START, /* x: set up for LEN */ + LEN, /* i: get length/literal/eob next */ + LENEXT, /* i: getting length extra (have base) */ + DIST, /* i: get distance next */ + DISTEXT, /* i: getting distance extra */ + COPY, /* o: copying bytes in window, waiting for space */ + LIT, /* o: got literal, waiting for output space */ + WASH, /* o: got eob, possibly still output waiting */ + END, /* x: got eob and all data flushed */ + BADCODE} /* x: got error */ +inflate_codes_mode; + +/* inflate codes private state */ +struct inflate_codes_state { + + /* mode */ + inflate_codes_mode mode; /* current inflate_codes mode */ + + /* mode dependent information */ + uInt len; + union { + struct { + inflate_huft *tree; /* pointer into tree */ + uInt need; /* bits needed */ + } code; /* if LEN or DIST, where in tree */ + uInt lit; /* if LIT, literal */ + struct { + uInt get; /* bits to get for extra */ + uInt dist; /* distance back to copy from */ + } copy; /* if EXT or COPY, where and how much */ + } sub; /* submode */ + + /* mode independent information */ + Byte lbits; /* ltree bits decoded per branch */ + Byte dbits; /* dtree bits decoder per branch */ + inflate_huft *ltree; /* literal/length/eob tree */ + inflate_huft *dtree; /* distance tree */ + +}; + + +inflate_codes_statef *inflate_codes_new(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, z_streamp z) +{ + inflate_codes_statef *c; + + if ((c = (inflate_codes_statef *) + ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + { + c->mode = START; + c->lbits = (Byte)bl; + c->dbits = (Byte)bd; + c->ltree = tl; + c->dtree = td; + Tracev(("inflate: codes new\n")); + } + return c; +} + + +int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r) +{ + uInt j; /* temporary storage */ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Byte *p; /* input data pointer */ + uInt n; /* bytes available there */ + Byte *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + Byte *f; /* pointer to copy strings from */ + inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input and output based on current state */ + while (1) switch (c->mode) + { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + case START: /* x: set up for LEN */ +#ifndef SLOW + if (m >= 258 && n >= 10) + { + UPDATE + r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + LOAD + if (r != Z_OK) + { + c->mode = r == Z_STREAM_END ? WASH : BADCODE; + break; + } + } +#endif /* !SLOW */ + c->sub.code.need = c->lbits; + c->sub.code.tree = c->ltree; + c->mode = LEN; + case LEN: /* i: get length/literal/eob next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e == 0) /* literal */ + { + c->sub.lit = t->base; + Tracevv((t->base >= 0x20 && t->base < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", t->base)); + c->mode = LIT; + break; + } + if (e & 16) /* length */ + { + c->sub.copy.get = e & 15; + c->len = t->base; + c->mode = LENEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + if (e & 32) /* end of block */ + { + Tracevv(("inflate: end of block\n")); + c->mode = WASH; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid literal/length code"; + r = Z_DATA_ERROR; + LEAVE + case LENEXT: /* i: getting length extra (have base) */ + j = c->sub.copy.get; + NEEDBITS(j) + c->len += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + c->sub.code.need = c->dbits; + c->sub.code.tree = c->dtree; + Tracevv(("inflate: length %u\n", c->len)); + c->mode = DIST; + case DIST: /* i: get distance next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e & 16) /* distance */ + { + c->sub.copy.get = e & 15; + c->sub.copy.dist = t->base; + c->mode = DISTEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid distance code"; + r = Z_DATA_ERROR; + LEAVE + case DISTEXT: /* i: getting distance extra */ + j = c->sub.copy.get; + NEEDBITS(j) + c->sub.copy.dist += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + Tracevv(("inflate: distance %u\n", c->sub.copy.dist)); + c->mode = COPY; + case COPY: /* o: copying bytes in window, waiting for space */ +#ifndef __TURBOC__ /* Turbo C bug for following expression */ + f = (uInt)(q - s->window) < c->sub.copy.dist ? + s->end - (c->sub.copy.dist - (q - s->window)) : + q - c->sub.copy.dist; +#else + f = q - c->sub.copy.dist; + if ((uInt)(q - s->window) < c->sub.copy.dist) + f = s->end - (c->sub.copy.dist - (uInt)(q - s->window)); +#endif + while (c->len) + { + NEEDOUT + OUTBYTE(*f++) + if (f == s->end) + f = s->window; + c->len--; + } + c->mode = START; + break; + case LIT: /* o: got literal, waiting for output space */ + NEEDOUT + OUTBYTE(c->sub.lit) + c->mode = START; + break; + case WASH: /* o: got eob, possibly more output */ + if (k > 7) /* return unused byte, if any */ + { + Assert(k < 16, "inflate_codes grabbed too many bytes") + k -= 8; + n++; + p--; /* can always return one */ + } + FLUSH + if (s->read != s->write) + LEAVE + c->mode = END; + case END: + r = Z_STREAM_END; + LEAVE + case BADCODE: /* x: got error */ + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +void inflate_codes_free(inflate_codes_statef *c, z_streamp z) +{ + ZFREE(z, c); + Tracev(("inflate: codes free\n")); +} + +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#undef DO1 +#undef DO2 +#undef DO4 +#undef DO8 + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +uLong adler32(uLong adler, const Byte *buf, uInt len) +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} + + +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-1998 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLong *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Byte *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); + +typedef enum { + imMETHOD, /* waiting for method byte */ + imFLAG, /* waiting for flag byte */ + imDICT4, /* four dictionary check bytes to go */ + imDICT3, /* three dictionary check bytes to go */ + imDICT2, /* two dictionary check bytes to go */ + imDICT1, /* one dictionary check byte to go */ + imDICT0, /* waiting for inflateSetDictionary */ + imBLOCKS, /* decompressing blocks */ + imCHECK4, /* four check bytes to go */ + imCHECK3, /* three check bytes to go */ + imCHECK2, /* two check bytes to go */ + imCHECK1, /* one check byte to go */ + imDONE, /* finished check, done */ + imBAD} /* got an error--stay here */ +inflate_mode; + +/* inflate private state */ +struct internal_state { + + /* mode */ + inflate_mode mode; /* current inflate mode */ + + /* mode dependent information */ + union { + uInt method; /* if FLAGS, method byte */ + struct { + uLong was; /* computed check value */ + uLong need; /* stream check value */ + } check; /* if CHECK, check values to compare */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ + } sub; /* submode */ + + /* mode independent information */ + int nowrap; /* flag for no wrapper */ + uInt wbits; /* log2(window size) (8..15, defaults to 15) */ + inflate_blocks_statef + *blocks; /* current inflate_blocks state */ + +}; + + +int inflateReset(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + z->total_in = z->total_out = 0; + z->msg = Z_NULL; + z->state->mode = z->state->nowrap ? imBLOCKS : imMETHOD; + inflate_blocks_reset(z->state->blocks, z, Z_NULL); + Tracev(("inflate: reset\n")); + return Z_OK; +} + + +int inflateEnd(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->blocks != Z_NULL) + inflate_blocks_free(z->state->blocks, z); + ZFREE(z, z->state); + z->state = Z_NULL; + Tracev(("inflate: end\n")); + return Z_OK; +} + + + +int inflateInit2_(z_streamp z, int w, const char *version, int stream_size) +{ + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != sizeof(z_stream)) + return Z_VERSION_ERROR; + + /* initialize state */ + if (z == Z_NULL) + return Z_STREAM_ERROR; + z->msg = Z_NULL; + if (z->zalloc == Z_NULL) + { + z->zalloc = (void *(*)(void *, unsigned, unsigned))zcalloc; + z->opaque = (voidp)0; + } + if (z->zfree == Z_NULL) z->zfree = (void (*)(void *, void *))zcfree; + if ((z->state = (struct internal_state *) + ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) + return Z_MEM_ERROR; + z->state->blocks = Z_NULL; + + /* handle undocumented nowrap option (no zlib header or check) */ + z->state->nowrap = 0; + if (w < 0) + { + w = - w; + z->state->nowrap = 1; + } + + /* set window size */ + if (w < 8 || w > 15) + { + inflateEnd(z); + return Z_STREAM_ERROR; + } + z->state->wbits = (uInt)w; + + /* create inflate_blocks state */ + if ((z->state->blocks = + inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + == Z_NULL) + { + inflateEnd(z); + return Z_MEM_ERROR; + } + Tracev(("inflate: allocated\n")); + + /* reset state */ + inflateReset(z); + return Z_OK; +} + + +int inflateInit_(z_streamp z, const char *version, int stream_size) +{ + return inflateInit2_(z, DEF_WBITS, version, stream_size); +} + + +#define iNEEDBYTE {if(z->avail_in==0)return r;r=f;} +#define iNEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) + +int inflate(z_streamp z, int f) +{ + int r; + uInt b; + + if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) + return Z_STREAM_ERROR; + f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; + r = Z_BUF_ERROR; + while (1) switch (z->state->mode) + { + case imMETHOD: + iNEEDBYTE + if (((z->state->sub.method = iNEXTBYTE) & 0xf) != Z_DEFLATED) + { + z->state->mode = imBAD; + z->msg = (char*)"unknown compression method"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + if ((z->state->sub.method >> 4) + 8 > z->state->wbits) + { + z->state->mode = imBAD; + z->msg = (char*)"invalid window size"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + z->state->mode = imFLAG; + case imFLAG: + iNEEDBYTE + b = iNEXTBYTE; + if (((z->state->sub.method << 8) + b) % 31) + { + z->state->mode = imBAD; + z->msg = (char*)"incorrect header check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev(("inflate: zlib header ok\n")); + if (!(b & PRESET_DICT)) + { + z->state->mode = imBLOCKS; + break; + } + z->state->mode = imDICT4; + case imDICT4: + iNEEDBYTE + z->state->sub.check.need = (uLong)iNEXTBYTE << 24; + z->state->mode = imDICT3; + case imDICT3: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 16; + z->state->mode = imDICT2; + case imDICT2: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 8; + z->state->mode = imDICT1; + case imDICT1: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE; + z->adler = z->state->sub.check.need; + z->state->mode = imDICT0; + return Z_NEED_DICT; + case imDICT0: + z->state->mode = imBAD; + z->msg = (char*)"need dictionary"; + z->state->sub.marker = 0; /* can try inflateSync */ + return Z_STREAM_ERROR; + case imBLOCKS: + r = inflate_blocks(z->state->blocks, z, r); + if (r == Z_DATA_ERROR) + { + z->state->mode = imBAD; + z->state->sub.marker = 0; /* can try inflateSync */ + break; + } + if (r == Z_OK) + r = f; + if (r != Z_STREAM_END) + return r; + r = f; + inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + if (z->state->nowrap) + { + z->state->mode = imDONE; + break; + } + z->state->mode = imCHECK4; + case imCHECK4: + iNEEDBYTE + z->state->sub.check.need = (uLong)iNEXTBYTE << 24; + z->state->mode = imCHECK3; + case imCHECK3: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 16; + z->state->mode = imCHECK2; + case imCHECK2: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE << 8; + z->state->mode = imCHECK1; + case imCHECK1: + iNEEDBYTE + z->state->sub.check.need += (uLong)iNEXTBYTE; + + if (z->state->sub.check.was != z->state->sub.check.need) + { + z->state->mode = imBAD; + z->msg = (char*)"incorrect data check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev(("inflate: zlib check ok\n")); + z->state->mode = imDONE; + case imDONE: + return Z_STREAM_END; + case imBAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +int inflateSetDictionary(z_streamp z, const Byte *dictionary, uInt dictLength) +{ + uInt length = dictLength; + + if (z == Z_NULL || z->state == Z_NULL || z->state->mode != imDICT0) + return Z_STREAM_ERROR; + + if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; + z->adler = 1L; + + if (length >= ((uInt)1<state->wbits)) + { + length = (1<state->wbits)-1; + dictionary += dictLength - length; + } + inflate_set_dictionary(z->state->blocks, dictionary, length); + z->state->mode = imBLOCKS; + return Z_OK; +} + + +int inflateSync(z_streamp z) +{ + uInt n; /* number of bytes to look at */ + Byte *p; /* pointer to bytes */ + uInt m; /* number of marker bytes found in a row */ + uLong r, w; /* temporaries to save total_in and total_out */ + + /* set up */ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->mode != imBAD) + { + z->state->mode = imBAD; + z->state->sub.marker = 0; + } + if ((n = z->avail_in) == 0) + return Z_BUF_ERROR; + p = z->next_in; + m = z->state->sub.marker; + + /* search */ + while (n && m < 4) + { + static const Byte mark[4] = {0, 0, 0xff, 0xff}; + if (*p == mark[m]) + m++; + else if (*p) + m = 0; + else + m = 4 - m; + p++, n--; + } + + /* restore */ + z->total_in += p - z->next_in; + z->next_in = p; + z->avail_in = n; + z->state->sub.marker = m; + + /* return no joy or set up to restart on a new block */ + if (m != 4) + return Z_DATA_ERROR; + r = z->total_in; w = z->total_out; + inflateReset(z); + z->total_in = r; z->total_out = w; + z->state->mode = imBLOCKS; + return Z_OK; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + * but removes the length bytes of the resulting empty stored block. When + * decompressing, PPP checks that at the end of input packet, inflate is + * waiting for these length bytes. + */ +int inflateSyncPoint(z_streamp z) +{ + if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL) + return Z_STREAM_ERROR; + return inflate_blocks_sync_point(z->state->blocks); +} + +voidp zcalloc (voidp opaque, unsigned items, unsigned size) +{ + if (opaque) items += size - size; /* make compiler happy */ + return (voidp)malloc(items*size); +} + +void zcfree (voidp opaque, voidp ptr) +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + diff --git a/plugins/vfspk3/vfs.cpp b/plugins/vfspk3/vfs.cpp index 68837483..69578298 100644 --- a/plugins/vfspk3/vfs.cpp +++ b/plugins/vfspk3/vfs.cpp @@ -41,83 +41,65 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "vfs.h" - +#include #include -#include -#include -#include -#include -#include "qerplugin.h" -#include "idatastream.h" -#include "iarchive.h" -ArchiveModules& FileSystemQ3API_getArchiveModules(); -#include "ifilesystem.h" - -#include "generic/callback.h" -#include "string/string.h" -#include "stream/stringstream.h" -#include "os/path.h" -#include "moduleobservers.h" - - -#define VFS_MAXDIRS 8 - -#if defined(WIN32) -#define PATH_MAX 260 +#if defined (__linux__) || defined (__APPLE__) + #include + #include +#else + #include + #include + #define R_OK 04 + #define S_ISDIR(mode) (mode & _S_IFDIR) #endif -#define gamemode_get GlobalRadiant().getGameMode +// TTimo: String functions +// see http://www.qeradiant.com/faq/index.cgi?file=175 +#include "str.h" +#include +#include +#include "vfspk3.h" +#include "vfs.h" +#include "unzip-vfspk3.h" + +typedef struct +{ + char* name; + unz_s zipinfo; + unzFile zipfile; + guint32 size; +} VFS_PAKFILE; // ============================================================================= // Global variables -Archive* OpenArchive(const char* name); - -struct archive_entry_t -{ - CopiedString name; - Archive* archive; - bool is_pakfile; -}; - -#include - -typedef std::list archives_t; - -static archives_t g_archives; -static char g_strDirs[VFS_MAXDIRS][PATH_MAX+1]; +static GSList* g_unzFiles; +static GSList* g_pakFiles; +static char g_strDirs[VFS_MAXDIRS][PATH_MAX]; static int g_numDirs; static bool g_bUsePak = true; -ModuleObservers g_observers; - // ============================================================================= // Static functions -static void AddSlash (char *str) +static void vfsAddSlash (char *str) { - std::size_t n = strlen (str); + int n = strlen (str); if (n > 0) { if (str[n-1] != '\\' && str[n-1] != '/') - { - globalErrorStream() << "WARNING: directory path does not end with separator: " << str << "\n"; strcat (str, "/"); - } } } -static void FixDOSName (char *src) +static void vfsFixDOSName (char *src) { - if (src == 0 || strchr(src, '\\') == 0) + if (src == NULL) return; - globalErrorStream() << "WARNING: invalid path separator '\\': " << src << "\n"; - while (*src) { if (*src == '\\') @@ -126,389 +108,415 @@ static void FixDOSName (char *src) } } - - -const _QERArchiveTable* GetArchiveTable(ArchiveModules& archiveModules, const char* ext) +static void vfsInitPakFile (const char *filename) { - StringOutputStream tmp(16); - tmp << LowerCase(ext); - return archiveModules.findModule(tmp.c_str()); -} -static void InitPakFile (ArchiveModules& archiveModules, const char *filename) -{ - const _QERArchiveTable* table = GetArchiveTable(archiveModules, path_get_extension(filename)); + unz_global_info gi; + unzFile uf; + guint32 i; + int err; - if(table != 0) + uf = unzOpen (filename); + if (uf == NULL) { - archive_entry_t entry; - entry.name = filename; + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, " failed to init pak file %s\n", filename); + return; + } + g_FuncTable.m_pfnSysPrintf(" pak file: %s\n", filename); - entry.archive = table->m_pfnOpenArchive(filename); - entry.is_pakfile = true; - g_archives.push_back(entry); - globalOutputStream() << " pak file: " << filename << "\n"; + g_unzFiles = g_slist_append (g_unzFiles, uf); + + err = unzGetGlobalInfo (uf,&gi); + if (err != UNZ_OK) + return; + unzGoToFirstFile(uf); + + for (i = 0; i < gi.number_entry; i++) + { + char filename_inzip[NAME_MAX]; + unz_file_info file_info; + VFS_PAKFILE* file; + + err = unzGetCurrentFileInfo (uf, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); + if (err != UNZ_OK) + break; + + file = (VFS_PAKFILE*)g_malloc (sizeof (VFS_PAKFILE)); + g_pakFiles = g_slist_append (g_pakFiles, file); + + vfsFixDOSName (filename_inzip); + g_strdown (filename_inzip); + + file->name = g_strdup (filename_inzip); + file->size = file_info.uncompressed_size; + file->zipfile = uf; + memcpy (&file->zipinfo, uf, sizeof (unz_s)); + + if ((i+1) < gi.number_entry) + { + err = unzGoToNextFile(uf); + if (err!=UNZ_OK) + break; + } } } -inline void pathlist_prepend_unique(GSList*& pathlist, char* path) +static GSList* vfsGetListInternal (const char *refdir, const char *ext, bool directories) { - if(g_slist_find_custom(pathlist, path, (GCompareFunc)path_compare) == 0) + GSList *lst, *lst_aux, *files = NULL; + char dirname[NAME_MAX], extension[NAME_MAX], filename[NAME_MAX]; + char basedir[NAME_MAX]; + int dirlen; + char *ptr; + char *dirlist; + struct stat st; + GDir *diskdir; + int i; + + if (refdir != NULL) { - pathlist = g_slist_prepend(pathlist, path); - } + strcpy (dirname, refdir); + g_strdown (dirname); + vfsFixDOSName (dirname); + vfsAddSlash (dirname); + } else + dirname[0] = '\0'; + dirlen = strlen (dirname); + + if (ext != NULL) + strcpy (extension, ext); else - { - g_free(path); - } -} + extension[0] = '\0'; + g_strdown (extension); -class DirectoryListVisitor : public Archive::Visitor -{ - GSList*& m_matches; - const char* m_directory; -public: - DirectoryListVisitor(GSList*& matches, const char* directory) - : m_matches(matches), m_directory(directory) - {} - void visit(const char* name) + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) { - const char* subname = path_make_relative(name, m_directory); - if(subname != name) - { - if(subname[0] == '/') - ++subname; - char* dir = g_strdup(subname); - char* last_char = dir + strlen(dir); - if(last_char != dir && *(--last_char) == '/') - *last_char = '\0'; - pathlist_prepend_unique(m_matches, dir); - } - } -}; + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + gboolean found = FALSE; + ptr = file->name; -class FileListVisitor : public Archive::Visitor -{ - GSList*& m_matches; - const char* m_directory; - const char* m_extension; -public: - FileListVisitor(GSList*& matches, const char* directory, const char* extension) - : m_matches(matches), m_directory(directory), m_extension(extension) - {} - void visit(const char* name) - { - const char* subname = path_make_relative(name, m_directory); - if(subname != name) - { - if(subname[0] == '/') - ++subname; - if(m_extension[0] == '*' || extension_equal(path_get_extension(subname), m_extension)) - pathlist_prepend_unique(m_matches, g_strdup (subname)); - } - } -}; - -static GSList* GetListInternal (const char *refdir, const char *ext, bool directories, std::size_t depth) -{ - GSList* files = 0; + // check that the file name begins with dirname + for (i = 0; (*ptr && i < dirlen); i++, ptr++) + if (*ptr != dirname[i]) + break; - ASSERT_MESSAGE(refdir[strlen(refdir) - 1] == '/', "search path does not end in '/'"); + if (i != dirlen) + continue; - if(directories) - { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + if (directories) { - DirectoryListVisitor visitor(files, refdir); - (*i).archive->forEachFile(Archive::VisitorFunc(visitor, Archive::eDirectories, depth), refdir); - } - } - else - { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + char *sep = strchr (ptr, '/'); + if (sep == NULL) + continue; + + i = sep-ptr; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strncmp ((char*)lst_aux->data, ptr, i) == 0) + { + found = TRUE; + break; + } + + if (!found) + { + char *name = g_strndup (ptr, i+1); + name[i] = '\0'; + files = g_slist_append (files, name); + } + } else { - FileListVisitor visitor(files, refdir, ext); - (*i).archive->forEachFile(Archive::VisitorFunc(visitor, Archive::eFiles, depth), refdir); + // check extension + char *ptr_ext = strrchr (ptr, '.'); + if ((ext != NULL) && ((ptr_ext == NULL) || (strcmp (ptr_ext+1, extension) != 0))) + continue; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, ptr) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (ptr)); } } - files = g_slist_reverse(files); + for (i = 0; i < g_numDirs; i++) + { + strcpy (basedir, g_strDirs[i]); + strcat (basedir, dirname); + + diskdir = g_dir_open (basedir, 0, NULL); + + if (diskdir != NULL) + { + while (1) + { + const char* name = g_dir_read_name(diskdir); + if(name == NULL) + break; + + if (directories && (name[0] == '.')) + continue; + + sprintf (filename, "%s%s", basedir, name); + stat (filename, &st); + + if ((S_ISDIR (st.st_mode) != 0) != directories) + continue; + + gboolean found = FALSE; + + dirlist = g_strdup(name); + + g_strdown (dirlist); + + char *ptr_ext = strrchr (dirlist, '.'); + if(ext == NULL + || (ext != NULL && ptr_ext != NULL && ptr_ext[0] != '\0' && strcmp (ptr_ext+1, extension) == 0)) + { + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, dirlist) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (dirlist)); + } + + g_free(dirlist); + } + g_dir_close (diskdir); + } + } return files; } -inline int ascii_to_upper(int c) -{ - if (c >= 'a' && c <= 'z') - { - return c - ('a' - 'A'); - } - return c; -} - /*! -This behaves identically to stricmp(a,b), except that ASCII chars +This behaves identically to -stricmp(a,b), except that ASCII chars [\]^`_ come AFTER alphabet chars instead of before. This is because -it converts all alphabet chars to uppercase before comparison, +it effectively converts all alphabet chars to uppercase before comparison, while stricmp converts them to lowercase. */ -static int string_compare_nocase_upper(const char* a, const char* b) +//!\todo Analyse the code in rtcw/q3 to see how it behaves. +static int vfsPakSort (const void *a, const void *b) { - for(;;) - { - int c1 = ascii_to_upper(*a++); - int c2 = ascii_to_upper(*b++); + char *s1, *s2; + int c1, c2; + s1 = (char*)a; + s2 = (char*)b; + + do { + c1 = *s1++; + c2 = *s2++; + + if (c1 >= 'a' && c1 <= 'z') + { + c1 -= ('a' - 'A'); + } + if (c2 >= 'a' && c2 <= 'z') + { + c2 -= ('a' - 'A'); + } + + if ( c1 == '\\' || c1 == ':' ) + { + c1 = '/'; + } + if ( c2 == '\\' || c2 == ':' ) + { + c2 = '/'; + } + + // Arnout: note - sort pakfiles in reverse order. This ensures that + // later pakfiles override earlier ones. This because the vfs module + // returns a filehandle to the first file it can find (while it should + // return the filehandle to the file in the most overriding pakfile, the + // last one in the list that is). if (c1 < c2) { - return -1; // a < b + //return -1; // strings not equal + return 1; // strings not equal } if (c1 > c2) { - return 1; // a > b + //return 1; + return -1; } - if(c1 == 0) - { - return 0; // a == b - } - } + } while (c1); + + return 0; // strings are equal } -// Arnout: note - sort pakfiles in reverse order. This ensures that -// later pakfiles override earlier ones. This because the vfs module -// returns a filehandle to the first file it can find (while it should -// return the filehandle to the file in the most overriding pakfile, the -// last one in the list that is). - -//!\todo Analyse the code in rtcw/q3 to see which order it sorts pak files. -class PakLess -{ -public: - bool operator()(const CopiedString& self, const CopiedString& other) const - { - return string_compare_nocase_upper(self.c_str(), other.c_str()) > 0; - } -}; - -typedef std::set Archives; - // ============================================================================= // Global functions // reads all pak files from a dir -void InitDirectory(const char* directory, ArchiveModules& archiveModules) +/*! +The gamemode hacks in here will do undefined things with files called zz_*. +This is simple to fix by cleaning up the hacks, but may be better left alone +if the engine code does the same thing. +*/ +void vfsInitDirectory (const char *path) { + char filename[PATH_MAX]; + GDir *dir; + GSList *dirlistptr, *dirlist = NULL; + int iGameMode; // 0: no filtering 1: SP 2: MP + if (g_numDirs == (VFS_MAXDIRS-1)) return; - strncpy(g_strDirs[g_numDirs], directory, PATH_MAX); - g_strDirs[g_numDirs][PATH_MAX] = '\0'; - FixDOSName (g_strDirs[g_numDirs]); - AddSlash (g_strDirs[g_numDirs]); + // See if we are in "sp" or "mp" mapping mode + const char* gamemode = g_FuncTable.m_pfnReadProjectKey("gamemode"); - const char* path = g_strDirs[g_numDirs]; - + if (gamemode) + { + if (strcmp (gamemode, "sp") == 0) + iGameMode = 1; + else if (strcmp (gamemode, "mp") == 0) + iGameMode = 2; + else + iGameMode = 0; + } else + iGameMode = 0; + + strcpy (g_strDirs[g_numDirs], path); + vfsFixDOSName (g_strDirs[g_numDirs]); + vfsAddSlash (g_strDirs[g_numDirs]); g_numDirs++; - { - archive_entry_t entry; - entry.name = path; - entry.archive = OpenArchive(path); - entry.is_pakfile = false; - g_archives.push_back(entry); - } - if (g_bUsePak) { - GDir* dir = g_dir_open (path, 0, 0); + dir = g_dir_open (path, 0, NULL); - if (dir != 0) + if (dir != NULL) { - globalOutputStream() << "vfs directory: " << path << "\n"; + g_FuncTable.m_pfnSysPrintf("vfs directory: %s\n", path); - const char* ignore_prefix = ""; - const char* override_prefix = ""; - - { - // See if we are in "sp" or "mp" mapping mode - const char* gamemode = gamemode_get(); - - if (strcmp (gamemode, "sp") == 0) - { - ignore_prefix = "mp_"; - override_prefix = "sp_"; - } - else if (strcmp (gamemode, "mp") == 0) - { - ignore_prefix = "sp_"; - override_prefix = "mp_"; - } - } - - Archives archives; - Archives archivesOverride; for(;;) { const char* name = g_dir_read_name(dir); - if(name == 0) + if(name == NULL) break; - const char *ext = strrchr (name, '.'); - if ((ext == 0) || *(++ext) == '\0' || GetArchiveTable(archiveModules, ext) == 0) + char *ext = (char*)strrchr(name, '.'); + if ((ext == NULL) || (strcasecmp (ext, ".pk3") != 0)) continue; - // using the same kludge as in engine to ensure consistency - if(!string_empty(ignore_prefix) && strncmp(name, ignore_prefix, strlen(ignore_prefix)) == 0) - { - continue; - } - if(!string_empty(override_prefix) && strncmp(name, override_prefix, strlen(override_prefix)) == 0) - { - archivesOverride.insert(name); - continue; - } + char* direntry = g_strdup(name); - archives.insert(name); + // using the same kludge as in engine to ensure consistency + switch (iGameMode) + { + case 1: // SP + if (strncmp(direntry,"sp_",3) == 0) + memcpy(direntry,"zz",2); + break; + case 2: // MP + if (strncmp(direntry,"mp_",3) == 0) + memcpy(direntry,"zz",2); + break; + } + + dirlist = g_slist_append (dirlist, direntry); } g_dir_close (dir); - // add the entries to the vfs - for(Archives::iterator i = archivesOverride.begin(); i != archivesOverride.end(); ++i) + // sort them + dirlist = g_slist_sort (dirlist, vfsPakSort); + + // add the entries to the vfs and free the list + while (dirlist) { - char filename[PATH_MAX]; - strcpy(filename, path); - strcat(filename, (*i).c_str()); - InitPakFile(archiveModules, filename); - } - for(Archives::iterator i = archives.begin(); i != archives.end(); ++i) - { - char filename[PATH_MAX]; - strcpy(filename, path); - strcat(filename, (*i).c_str()); - InitPakFile(archiveModules, filename); + GSList *cur = dirlist; + char* name = (char*)cur->data; + + switch (iGameMode) + { + case 1: // SP + if (strncmp(name,"mp_",3) == 0) + { + g_free (name); + dirlist = g_slist_remove (cur, name); + continue; + } else if (strncmp(name,"zz_",3) == 0) + memcpy(name,"sp",2); + break; + case 2: // MP + if (strncmp(name,"sp_",3) == 0) + { + g_free (name); + dirlist = g_slist_remove (cur, name); + continue; + } else if (strncmp(name,"zz_",3) == 0) + memcpy(name,"mp",2); + break; + } + + sprintf (filename, "%s/%s", path, name); + vfsInitPakFile (filename); + + g_free (name); + dirlist = g_slist_remove (cur, name); } } else - { - globalErrorStream() << "vfs directory not found: " << path << "\n"; - } + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, "vfs directory not found: %s\n", path); } } // frees all memory that we allocated // FIXME TTimo this should be improved so that we can shutdown and restart the VFS without exiting Radiant? // (for instance when modifying the project settings) -void Shutdown() +void vfsShutdown () { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + while (g_unzFiles) { - (*i).archive->release(); - } - g_archives.clear(); - - g_numDirs = 0; -} - -#define VFS_SEARCH_PAK 0x1 -#define VFS_SEARCH_DIR 0x2 - -int GetFileCount (const char *filename, int flag) -{ - int count = 0; - char fixed[PATH_MAX+1]; - - strncpy(fixed, filename, PATH_MAX); - fixed[PATH_MAX] = '\0'; - FixDOSName (fixed); - - if(!flag) - flag = VFS_SEARCH_PAK | VFS_SEARCH_DIR; - - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) - { - if((*i).is_pakfile && (flag & VFS_SEARCH_PAK) != 0 - || !(*i).is_pakfile && (flag & VFS_SEARCH_DIR) != 0) - { - if((*i).archive->containsFile(fixed)) - ++count; - } + unzClose ((unzFile)g_unzFiles->data); + g_unzFiles = g_slist_remove (g_unzFiles, g_unzFiles->data); } - return count; -} - -ArchiveFile* OpenFile(const char* filename) -{ - ASSERT_MESSAGE(strchr(filename, '\\') == 0, "path contains invalid separator '\\': \"" << filename << "\""); - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + // avoid dangling pointer operation (makes BC hangry) + GSList *cur = g_pakFiles; + GSList *next = cur; + while (next) { - ArchiveFile* file = (*i).archive->openFile(filename); - if(file != 0) - { - return file; - } + cur = next; + VFS_PAKFILE* file = (VFS_PAKFILE*)cur->data; + g_free (file->name); + g_free (file); + next = g_slist_remove (cur, file); } - - return 0; + g_pakFiles = NULL; } -ArchiveTextFile* OpenTextFile(const char* filename) +void vfsFreeFile (void *p) { - ASSERT_MESSAGE(strchr(filename, '\\') == 0, "path contains invalid separator '\\': \"" << filename << "\""); - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) - { - ArchiveTextFile* file = (*i).archive->openTextFile(filename); - if(file != 0) - { - return file; - } - } - - return 0; + g_free(p); } -// NOTE: when loading a file, you have to allocate one extra byte and set it to \0 -std::size_t LoadFile (const char *filename, void **bufferptr, int index) +GSList* vfsGetFileList (const char *dir, const char *ext) { - char fixed[PATH_MAX+1]; - - strncpy (fixed, filename, PATH_MAX); - fixed[PATH_MAX] = '\0'; - FixDOSName (fixed); - - ArchiveFile* file = OpenFile(fixed); - - if(file != 0) - { - *bufferptr = malloc (file->size()+1); - // we need to end the buffer with a 0 - ((char*) (*bufferptr))[file->size()] = 0; - - std::size_t length = file->getInputStream().read((InputStream::byte_type*)*bufferptr, file->size()); - file->release(); - return length; - } - - *bufferptr = 0; - return 0; + return vfsGetListInternal (dir, ext, false); } -void FreeFile (void *p) +GSList* vfsGetDirList (const char *dir) { - free(p); + return vfsGetListInternal (dir, NULL, true); } -GSList* GetFileList (const char *dir, const char *ext, std::size_t depth) -{ - return GetListInternal (dir, ext, false, depth); -} - -GSList* GetDirList (const char *dir, std::size_t depth) -{ - return GetListInternal (dir, 0, true, depth); -} - -void ClearFileDirList (GSList **lst) +void vfsClearFileDirList (GSList **lst) { while (*lst) { @@ -516,168 +524,331 @@ void ClearFileDirList (GSList **lst) *lst = g_slist_remove (*lst, (*lst)->data); } } - -const char* FindFile(const char* relative) + +int vfsGetFileCount (const char *filename, int flag) { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + int i, count = 0; + char fixed[NAME_MAX], tmp[NAME_MAX]; + GSList *lst; + + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); + + if (!flag || (flag & VFS_SEARCH_PAK)) { - if((*i).archive->containsFile(relative)) + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) { - return (*i).name.c_str(); + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + if (strcmp (file->name, fixed) == 0) + count++; } } - return ""; + if (!flag || (flag & VFS_SEARCH_DIR)) + { + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, fixed); + if (access (tmp, R_OK) == 0) + count++; + } + } + + return count; } -const char* FindPath(const char* absolute) +// open a full path file +int vfsLoadFullPathFile (const char *filename, void **bufferptr) { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) - { - if(path_equal_n(absolute, (*i).name.c_str(), string_length((*i).name.c_str()))) - { - return (*i).name.c_str(); - } - } + FILE *f; + long len; - return ""; + f = fopen (filename, "rb"); + if (f == NULL) + return -1; + + fseek (f, 0, SEEK_END); + len = ftell (f); + rewind (f); + + *bufferptr = g_malloc (len+1); + if (*bufferptr == NULL) + return -1; + + fread (*bufferptr, 1, len, f); + fclose (f); + + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[len] = 0; + + return len; } - -class Quake3FileSystem : public VirtualFileSystem +// NOTE: when loading a file, you have to allocate one extra byte and set it to \0 +int vfsLoadFile (const char *filename, void **bufferptr, int index) { -public: - void initDirectory(const char *path) - { - InitDirectory(path, FileSystemQ3API_getArchiveModules()); - } - void initialise() - { - globalOutputStream() << "filesystem initialised\n"; - g_observers.realise(); - } - void shutdown() - { - g_observers.unrealise(); - globalOutputStream() << "filesystem shutdown\n"; - Shutdown(); - } + int i, count = 0; + char tmp[NAME_MAX], fixed[NAME_MAX]; + GSList *lst; - int getFileCount(const char *filename, int flags) - { - return GetFileCount(filename, flags); - } - ArchiveFile* openFile(const char* filename) - { - return OpenFile(filename); - } - ArchiveTextFile* openTextFile(const char* filename) - { - return OpenTextFile(filename); - } - std::size_t loadFile(const char *filename, void **buffer) - { - return LoadFile(filename, buffer, 0); - } - void freeFile(void *p) - { - FreeFile(p); - } + *bufferptr = NULL; + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); - void forEachDirectory(const char* basedir, const FileNameCallback& callback, std::size_t depth) + for (i = 0; i < g_numDirs; i++) { - GSList* list = GetDirList(basedir, depth); - - for(GSList* i = list; i != 0; i = g_slist_next(i)) + strcpy (tmp, g_strDirs[i]); + strcat (tmp, filename); + if (access (tmp, R_OK) == 0) { - callback(reinterpret_cast((*i).data)); - } - - ClearFileDirList(&list); - } - void forEachFile(const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth) - { - GSList* list = GetFileList(basedir, extension, depth); - - for(GSList* i = list; i != 0; i = g_slist_next(i)) - { - const char* name = reinterpret_cast((*i).data); - if(extension_equal(path_get_extension(name), extension)) + if (count == index) { - callback(name); + return vfsLoadFullPathFile(tmp,bufferptr); + } + + count++; + } + } + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + if (strcmp (file->name, fixed) != 0) + continue; + + if (count == index) + { + memcpy (file->zipfile, &file->zipinfo, sizeof (unz_s)); + + if (unzOpenCurrentFile (file->zipfile) != UNZ_OK) + return -1; + + *bufferptr = g_malloc (file->size+1); + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[file->size] = 0; + + i = unzReadCurrentFile (file->zipfile , *bufferptr, file->size); + unzCloseCurrentFile (file->zipfile); + if (i > 0) + return file->size; + else + return -1; + } + + count++; + } + + return -1; +} + +//#ifdef _DEBUG +#if 1 + #define DBG_RLTPATH +#endif + +/*! +\param shorten will try to match against the short version +http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=144 +recent switch back to short path names in project settings has broken some stuff +with shorten == true, we will convert in to short version before looking for root +FIXME WAAA .. the stuff below is much more simple on linux .. add appropriate #ifdef +*/ +char* vfsExtractRelativePath_short(const char *in, bool shorten) +{ + int i; + char l_in[PATH_MAX]; + char check[PATH_MAX]; + static char out[PATH_MAX]; + out[0] = 0; + +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: %s\n", in); +#endif + +#ifdef _WIN32 + if (shorten) + { + // make it short + if (GetShortPathName(in, l_in, PATH_MAX) == 0) + { +#ifdef DBG_RLTPATH + Sys_Printf("GetShortPathName failed\n"); +#endif + return NULL; + } + } + else + { + strcpy(l_in,in); + } + vfsCleanFileName(l_in); +#else + strcpy(l_in, in); + vfsCleanFileName(l_in); +#endif // ifdef WIN32 + + +#ifdef DBG_RLTPATH + Sys_Printf("cleaned path: %s\n", l_in); +#endif + + for (i = 0; i < g_numDirs; i++) + { + strcpy(check,g_strDirs[i]); + vfsCleanFileName(check); +#ifdef DBG_RLTPATH + Sys_Printf("Matching against %s\n", check); +#endif + + // try to find a match + if (strstr(l_in, check)) + { + strcpy(out,l_in+strlen(check)+1); + break; + } + + } + if (out[0]!=0) + { +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: success\n"); +#endif + return out; + } +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: failed\n"); +#endif + return NULL; +} + + +// FIXME TTimo: this and the above should be merged at some point +char* vfsExtractRelativePath(const char *in) +{ + static char out[PATH_MAX]; + unsigned int i, count; + char *chunk, *backup = NULL; // those point to out stuff + char *ret = vfsExtractRelativePath_short(in, false); + if (!ret) + { +#ifdef DBG_RLTPATH + Sys_Printf("trying with a short version\n"); +#endif + ret = vfsExtractRelativePath_short(in, true); + if (ret) + { + // ok, but we have a relative short version now + // hack the long relative version out of here + count = 0; + for(i=0;idata; + + char *ptr,*lastptr; + lastptr = file->name; + + while (ptr = strchr(lastptr,'/')) + lastptr = ptr+1; + + if (strcmp (lastptr, fixed) == 0) + { + strncpy(out,file->name,PATH_MAX); + return out; } } - ClearFileDirList(&list); - } - GSList* getDirList(const char *basedir) - { - return GetDirList(basedir, 1); - } - GSList* getFileList(const char *basedir, const char *extension) - { - return GetFileList(basedir, extension, 1); - } - void clearFileDirList(GSList **lst) - { - ClearFileDirList(lst); } - const char* findFile(const char *name) + if (!flag || (flag & VFS_SEARCH_DIR)) { - return FindFile(name); - } - const char* findRoot(const char *name) + for (i = 0; i < g_numDirs; i++) { - return FindPath(name); - } - - void attach(ModuleObserver& observer) - { - g_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - g_observers.detach(observer); - } - - Archive* getArchive(const char* archiveName) - { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) + strcpy (tmp, g_strDirs[i]); + strcat (tmp, in); + if (access (tmp, R_OK) == 0) { - if((*i).is_pakfile) + if (count == index) { - if(path_equal((*i).name.c_str(), archiveName)) - { - return (*i).archive; - } - } - } - return 0; - } - void forEachArchive(const ArchiveNameCallback& callback) - { - for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) - { - if((*i).is_pakfile) - { - callback((*i).name.c_str()); + strcpy (out, tmp); + return out; } + count++; } } -}; - -Quake3FileSystem g_Quake3FileSystem; - -void FileSystem_Init() -{ + } + return NULL; } -void FileSystem_Shutdown() + +// TODO TTimo on linux the base prompt is ~/.q3a/ +// given the file dialog, we could push the strFSBasePath and ~/.q3a into the directory shortcuts +// FIXME TTimo is this really a VFS functionality? +// actually .. this should be the decision of the core isn't it? +// or .. add an API so that the base prompt can be set during VFS init +const char* vfsBasePromptPath() { +#ifdef _WIN32 + static char* path = "C:"; +#else + static char* path = "/"; +#endif + return path; } -VirtualFileSystem& GetFileSystem() -{ - return g_Quake3FileSystem; -} diff --git a/plugins/vfspk3/vfs.h b/plugins/vfspk3/vfs.h index 3fe10791..bfb3479e 100644 --- a/plugins/vfspk3/vfs.h +++ b/plugins/vfspk3/vfs.h @@ -28,12 +28,41 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_VFS_H) -#define INCLUDED_VFS_H +#ifndef _VFS_H_ +#define _VFS_H_ -void FileSystem_Init(); -void FileSystem_Shutdown(); -class VirtualFileSystem; -VirtualFileSystem& GetFileSystem(); +#define VFS_MAXDIRS 8 -#endif +void vfsInitDirectory (const char *path); +void vfsShutdown (); +void vfsFreeFile (void *p); +GSList* vfsGetFileList (const char *dir, const char *ext); +GSList* vfsGetDirList (const char *dir); +void vfsClearFileDirList (GSList **lst); +int vfsGetFileCount (const char *filename, int flag); +int vfsLoadFile (const char *filename, void **buffer, int index = 0); +int vfsLoadFullPathFile (const char *filename, void **buffer); + +// some useful functions +// clean a file name to a unique representation +// very usefull if you have to do some weird manips on the files +// works on regular files and dirs +// will convert to lowercase, unix path ('/' filename seperator) +// on win32, will build the short path name +// directories will be cleaned, no ending filename seperator +// we modify the entry directly, the size of the string can only go down +void vfsCleanFileName(char *); +// these return a static char*, doesn't need to be freed or anything +// get the base path to use when raising file dialogs +// we manually add "maps/" or "sounds/" or "mapobjects/models/" etc. +const char* vfsBasePromptPath(); +// extract the relative path from a full path +// will match against any of the base paths we have +// returns NULL if not found +char* vfsExtractRelativePath(const char *in); +// returns the full path (in a static buff) to a file given it's relative path +// returns the first file in the list or NULL if not found +// see ifilesystem.h for more notes +char* vfsGetFullPath(const char*, int index = 0, int flag = 0); + +#endif // _VFS_H_ diff --git a/plugins/vfspk3/vfspk3.cpp b/plugins/vfspk3/vfspk3.cpp index e7fca372..23d8bae1 100644 --- a/plugins/vfspk3/vfspk3.cpp +++ b/plugins/vfspk3/vfspk3.cpp @@ -1,85 +1,104 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// +// Quake 3 Virtual FileSystem - reads files from different dirs and inside pak files +// +// Leonardo Zide (leo@lokigames.com) +// + +#ifdef _WIN32 +#include +#endif + +#include #include "vfspk3.h" - -#include "qerplugin.h" -#include "iarchive.h" -#include "ifilesystem.h" - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/modulesmap.h" - #include "vfs.h" -class FileSystemDependencies : public GlobalRadiantModuleRef -{ - ArchiveModulesRef m_archive_modules; -public: - FileSystemDependencies() : - m_archive_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("archivetypes")) - { - } - ArchiveModules& getArchiveModules() - { - return m_archive_modules.get(); - } -}; +// ============================================================================= +// SYNAPSE -class FileSystemQ3API -{ - VirtualFileSystem* m_filesystemq3; -public: - typedef VirtualFileSystem Type; - STRING_CONSTANT(Name, "*"); +_QERFuncTable_1 g_FuncTable; - FileSystemQ3API() - { - FileSystem_Init(); - m_filesystemq3 = &GetFileSystem(); +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientVFS g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + + if ( strcmp( version, SYNAPSE_VERSION ) ) { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; } - ~FileSystemQ3API() - { - FileSystem_Shutdown(); - } - VirtualFileSystem* getTable() - { - return m_filesystemq3; - } -}; + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() ); + + g_SynapseClient.AddAPI( VFS_MAJOR, "pk3", sizeof( _QERFileSystemTable ) ); + g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( _QERFuncTable_1 ), SYN_REQUIRE, &g_FuncTable ); -typedef SingletonModule FileSystemQ3Module; - -FileSystemQ3Module g_FileSystemQ3Module; - -ArchiveModules& FileSystemQ3API_getArchiveModules() -{ - return g_FileSystemQ3Module.getDependencies().getArchiveModules(); + return &g_SynapseClient; } - - -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) +bool CSynapseClientVFS::RequestAPI(APIDescriptor_t *pAPI) { - initialiseModule(server); + if (!strcmp(pAPI->major_name, VFS_MAJOR)) + { + _QERFileSystemTable* pTable= static_cast<_QERFileSystemTable*>(pAPI->mpTable); + pTable->m_pfnInitDirectory = &vfsInitDirectory; + pTable->m_pfnShutdown = &vfsShutdown; + pTable->m_pfnFreeFile = &vfsFreeFile; + pTable->m_pfnGetDirList = &vfsGetDirList; + pTable->m_pfnGetFileList = &vfsGetFileList; + pTable->m_pfnClearFileDirList = &vfsClearFileDirList; + pTable->m_pfnGetFileCount = &vfsGetFileCount; + pTable->m_pfnLoadFile = &vfsLoadFile; + pTable->m_pfnLoadFullPathFile = &vfsLoadFullPathFile; + pTable->m_pfnExtractRelativePath = &vfsExtractRelativePath; + pTable->m_pfnGetFullPath = &vfsGetFullPath; + pTable->m_pfnBasePromptPath = &vfsBasePromptPath; + return true; + } - g_FileSystemQ3Module.selfRegister(); + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientVFS::GetInfo() +{ + return "PK3 VFS module built " __DATE__ " " RADIANT_VERSION; } diff --git a/plugins/vfspk3/vfspk3.def b/plugins/vfspk3/vfspk3.def new file mode 100644 index 00000000..d4c34e7f --- /dev/null +++ b/plugins/vfspk3/vfspk3.def @@ -0,0 +1,8 @@ +; vfspk3.def : Declares the module parameters for the DLL. + +LIBRARY "VFSPK3" +DESCRIPTION 'VFSPK3 Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/vfspk3/vfspk3.h b/plugins/vfspk3/vfspk3.h index 8710fd13..20dc95fe 100644 --- a/plugins/vfspk3/vfspk3.h +++ b/plugins/vfspk3/vfspk3.h @@ -1,25 +1,63 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_VFSPK3_H) -#define INCLUDED_VFSPK3_H +#ifndef _VFSPK3_H_ +#define _VFSPK3_H_ -#endif +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" + +extern _QERFuncTable_1 g_FuncTable; +extern CSynapseServer* g_pSynapseServer; + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf + +class CSynapseClientVFS : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientVFS() { } + virtual ~CSynapseClientVFS() { } +}; + +#endif // _VFSPK3_H_ diff --git a/plugins/vfspk3/vfspk3.vcproj b/plugins/vfspk3/vfspk3.vcproj new file mode 100644 index 00000000..ba6208c1 --- /dev/null +++ b/plugins/vfspk3/vfspk3.vcproj @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/vfspk3/vfsq3.def b/plugins/vfspk3/vfsq3.def deleted file mode 100644 index 885ffeb9..00000000 --- a/plugins/vfspk3/vfsq3.def +++ /dev/null @@ -1,7 +0,0 @@ -; vfsq3.def : Declares the module parameters for the DLL. - -LIBRARY "VFSQ3" - -EXPORTS - ; Explicit exports can go here - Radiant_RegisterModules @1 diff --git a/plugins/vfspk3/vfsq3.vcproj b/plugins/vfspk3/vfsq3.vcproj deleted file mode 100644 index e52ffedc..00000000 --- a/plugins/vfspk3/vfsq3.vcproj +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/vfswad/unwad.cpp b/plugins/vfswad/unwad.cpp new file mode 100644 index 00000000..36a7ee9d --- /dev/null +++ b/plugins/vfswad/unwad.cpp @@ -0,0 +1,251 @@ +#include +#include +#include + +#include "unwad.h" + + +wadFile_t *wadCleanup(wadFile_t *wf) +{ + if (wf) + { + if (wf->fin) fclose(wf->fin); + if (wf->lpHeader) free(wf->lpHeader); + if (wf->lpLump) free(wf->lpLump); + if (wf->lpMip) free(wf->lpMip); + if (wf->wadfilename) free(wf->wadfilename); + free (wf); + wf = NULL; + } + return wf; +} + +int wadGetCurrentFileInfo ( wadFile_t *wf, char *szFileName, unsigned long fileNameBufferSize, unsigned long *filesize) +{ + /* returns 0 if error, or 1 for sucess */ + // if this fails you'll need to re-position the fileposition + // before attempting any other calls. e.g. call wadGoToFirstFile() + + if (fread(wf->lpLump,sizeof(WAD3_LUMP),1,wf->fin)!=1) + return 0; + strncpy(szFileName, wf->lpLump->name, fileNameBufferSize); + szFileName[fileNameBufferSize-1] = 0; // null terminate + + *filesize = wf->lpLump->size; + + return 1; +} + +int wadGoToFile(wadFile_t *wf, unsigned long filenum) +{ + if (!wf) + return 0; + + if (!wf->fin) + return 0; + + if (filenum >= wf->lpHeader->numlumps) + return 0; + + if (fseek(wf->fin,wf->lpHeader->infotableofs + (filenum * sizeof(WAD3_LUMP)),SEEK_SET) != 0) + return 0; + + wf->currentfile = filenum; + + return 1; +} + +int wadGoToNextFile(wadFile_t *wf) +{ + return(wadGoToFile(wf, wf->currentfile + 1)); +} + +int wadGoToFirstFile(wadFile_t *wf) +{ + /* returns 0 if error, or 1 for sucess */ + + if (!wf) + return 0; + + if (!wf->fin) + return 0; + + if (fseek(wf->fin,wf->lpHeader->infotableofs,SEEK_SET) != 0) + return 0; + + wf->currentfile = 0; + + return 1; +} + +wadFile_t *wadOpen(const char* path) +{ + + wadFile_t *wf = NULL; + + if (!path) + return NULL; + + wf = new wadFile_s; + memset (wf, 0, sizeof(*wf)); + + if (!wf) + return NULL; + + wf->fin=fopen(path,"rb"); + if (wf->fin==NULL) + return wadCleanup(wf); + + // get the file size + if (fseek(wf->fin,0,SEEK_END) != 0) + return wadCleanup(wf); + + wf->FileSize = ftell( wf->fin ); + + // Make sure it's at least big enough to manipulate the header + if (wf->FileSize < sizeof(WAD3_HEADER)) + { + // WAD3 file is malformed. + return wadCleanup(wf); + } + + // go back to the start + if (fseek(wf->fin,0,SEEK_SET)!=0) + return wadCleanup(wf); + + // allocate buffers + wf->lpHeader = (LPWAD3_HEADER) malloc(sizeof(WAD3_HEADER)); + wf->lpLump = (LPWAD3_LUMP) malloc(sizeof(WAD3_LUMP)); + wf->lpMip = (LPWAD3_MIP) malloc(sizeof(WAD3_MIP)); + + if (!(wf->lpHeader) || !(wf->lpLump) || !(wf->lpMip)) + return wadCleanup(wf); + + // read the header. + if (fread(wf->lpHeader,sizeof(WAD3_HEADER),1,wf->fin)!=1) + return wadCleanup(wf); + + if (wf->lpHeader->identification != WAD2_ID && wf->lpHeader->identification != WAD3_ID) + { + // Invalid WAD3 header id. + return wadCleanup(wf); + } + + // Make sure our table is really there + if ( ((wf->lpHeader->numlumps * sizeof(WAD3_LUMP)) + wf->lpHeader->infotableofs) > wf->FileSize) + { + // WAD3 file is malformed. + return wadCleanup(wf); + } + + // Store the name of the wadfile + if (!(wf->wadfilename = strdup(path))) + return wadCleanup(wf); + + return wf; +} + +int wadOpenCurrentFileByNum (wadFile_t *wf, unsigned long filenumber) +{ + /* returns 0 if error, or 1 for sucess */ + return(wadGoToFile(wf, filenumber)); +} + +void wadCloseCurrentFile (wadFile_t *wf) +{ + // nothing to do really... +} + +unsigned long wadReadCurrentFile (wadFile_t *wf , char *bufferptr, unsigned long size) +{ + // returns 0 if error, or the amount of data read into the buffer + if (fread(wf->lpLump,sizeof(WAD3_LUMP),1,wf->fin)!=1) + return 0; + + // dunno how to handle any other image types but this (yet) + if (wf->lpLump->type != WAD2_TYPE_MIP && wf->lpLump->type != WAD3_TYPE_MIP) + return 0; + + // go to first mip + if (fseek(wf->fin, wf->lpLump->filepos, SEEK_SET) != 0) + return 0; + + if (fread(bufferptr,size,1,wf->fin) == 1) + return (size); + else + return 0; +} + +/* + +.. or we could do it the long way, and process the file as we go.. + + +*/ +/* +unsigned long wadReadCurrentFile (wadFile_t *wf , char *bufferptr, unsigned long size) +{ + // returns 0 if error, or the amount of data read into the buffer + unsigned long bufferpos; + unsigned long mipdatasize; + WORD palettesize; + + if (fread(wf->lpLump,sizeof(WAD3_LUMP),1,wf->fin)!=1) + return 0; + + if (wf->lpLump->type == WAD3_TYPE_MIP) // can we handle it ? + { + + // bounds check. + if (wf->lpLump->filepos >= wf->FileSize) + return 0; // malformed wad3 + + // go to first mip + if (fseek(wf->fin, wf->lpLump->filepos, SEEK_SET) != 0) + return 0; + + // and read it + if (fread(wf->lpMip,sizeof(WAD3_MIP),1,wf->fin)!=1) + return 0; + + // store in buffer. + memcpy(bufferptr, wf->lpMip, sizeof(WAD3_MIP)); + bufferpos = sizeof(WAD3_MIP); + + // now read the MIP data. + // mip data + if (fseek(wf->fin, wf->lpLump->filepos + wf->lpMip->offsets[0], SEEK_SET) != 0) + return 0; + + mipdatasize = GET_MIP_DATA_SIZE(wf->lpMip->width,wf->lpMip->height); + + if (fread(bufferptr+bufferpos, mipdatasize, 1, wf->fin)!=1) + return 0; + + bufferpos += mipdatasize; + + // ok, that's the mip data itself, now grab the palette size. + if (fread(bufferptr+bufferpos,sizeof(WORD),1,wf->fin)!=1) + return 0; + + palettesize = *(WORD *)(bufferptr+bufferpos); + + bufferpos += sizeof(WORD); + + // grab the palette itself + if (fread(bufferptr+bufferpos,palettesize*3,1,wf->fin)!=1) + return 0; + + bufferpos += palettesize*3; + + // and finally the one-word padding. + if (fread(bufferptr+bufferpos,sizeof(WORD),1,wf->fin)!=1) + return 0; + + bufferpos += sizeof(WORD); + + return(bufferpos); // return the amount of bytes read. + } + return 0; +} +*/ diff --git a/plugins/vfswad/unwad.h b/plugins/vfswad/unwad.h new file mode 100644 index 00000000..074a75ea --- /dev/null +++ b/plugins/vfswad/unwad.h @@ -0,0 +1,111 @@ + +#ifndef _WAD3_H_ +#define _WAD3_H_ + +// WAD3 (Half-Life) Header and mip structs +// WAD2 (Quake) Header and mip structs added by LordHavoc + +#define WADBUFSIZE 32768 + +#define WAD2_TYPE_MIP 0x44 +#define WAD2_ID ('W' | 'A' << 8 | 'D' << 16 | '2' << 24) +#define WAD3_TYPE_MIP 0x43 +#define WAD3_ID ('W' | 'A' << 8 | 'D' << 16 | '3' << 24) +#define GET_MIP_DATA_SIZE(WIDTH, HEIGHT) ((WIDTH * HEIGHT) + (WIDTH * HEIGHT / 4) + (WIDTH * HEIGHT / 16) + (WIDTH * HEIGHT / 64)) + +/* + + WAD3 pseudo-structure: + + WAD3 Header + Mip section + First mip + Mip header + First mip (width * height) + Second mip (width * height / 4) + Third mip (width * height / 16) + Fourth mip (width * height / 64) + Palette size (WORD) + Palette (Palette size * 3) + Padding (WORD) + [...] + Last mip + Lump table + First lump entry + Lump header + [...] + Last lump entry + + WAD2 pseudo-structure: + + WAD2 Header + Mip section + First mip + Mip header + First mip (width * height) + Second mip (width * height / 4) + Third mip (width * height / 16) + Fourth mip (width * height / 64) + [...] + Last mip + Lump table + First lump entry + Lump header + [...] + Last lump entry +*/ + +#define DWORD unsigned int +#define BYTE unsigned char +#define WORD unsigned short int + +typedef struct +{ + DWORD identification; + DWORD numlumps; + DWORD infotableofs; // Lump table +} WAD3_HEADER, *LPWAD3_HEADER; + +typedef struct +{ + DWORD filepos; + DWORD disksize; + DWORD size; // uncompressed + BYTE type; + BYTE compression; + BYTE pad1, pad2; + char name[16]; // must be null terminated +} WAD3_LUMP, *LPWAD3_LUMP; + +typedef struct +{ + char name[16]; + DWORD width, height; + DWORD offsets[4]; // four mip maps stored +} WAD3_MIP, *LPWAD3_MIP; + + +typedef struct wadFile_s +{ + FILE * fin; + LPWAD3_HEADER lpHeader; + LPWAD3_LUMP lpLump; + LPWAD3_MIP lpMip; + + DWORD FileSize; + unsigned long currentfile; + char *wadfilename; +} wadFile_t; + + +wadFile_t *wadOpen(const char* path); +wadFile_t *wadCleanup(wadFile_t *wf); +int wadGoToFirstFile(wadFile_t *wf); +int wadGetCurrentFileInfo ( wadFile_t *wf, char *szFileName, unsigned long fileNameBufferSize, unsigned long *filesize); +int wadGoToNextFile(wadFile_t *wf); + +int wadOpenCurrentFileByNum (wadFile_t *wf, unsigned long filenumber); +void wadCloseCurrentFile (wadFile_t *wf); +unsigned long wadReadCurrentFile (wadFile_t *wf , char *bufferptr, unsigned long size); + +#endif // #ifndef _WAD3_H_ diff --git a/plugins/vfswad/vfs.cpp b/plugins/vfswad/vfs.cpp new file mode 100644 index 00000000..251fc704 --- /dev/null +++ b/plugins/vfswad/vfs.cpp @@ -0,0 +1,759 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// Rules: +// +// - Directories should be searched in the following order: ~/.q3a/baseq3, +// install dir (/usr/local/games/quake3/baseq3) and cd_path (/mnt/cdrom/baseq3). +// +// - Pak files are searched first inside the directories. +// - Case insensitive. +// - Unix-style slashes (/) (windows is backwards .. everyone knows that) +// +// Leonardo Zide (leo@lokigames.com) +// + +#include +#include + +#if defined (__linux__) || defined (__APPLE__) + #include + #include +#else + #include + #include + #define R_OK 04 + #define S_ISDIR(mode) (mode & _S_IFDIR) +#endif + +// TTimo: String functions +// see http://www.qeradiant.com/faq/index.cgi?file=175 +#include "str.h" + +#include +#include + +#include "vfswad.h" +#include "vfs.h" +#include "unwad.h" + +typedef struct +{ + char* name; + WAD3_LUMP wadlump; + wadFile_t *wadfile; + unsigned long filenumber; + unsigned long size; +} VFS_PAKFILE; + +// ============================================================================= +// Global variables + +static GSList* g_wadFiles; +static GSList* g_pakFiles; +static char g_strDirs[VFS_MAXDIRS][PATH_MAX]; +static int g_numDirs; + +// ============================================================================= +// Static functions + +static void vfsAddSlash (char *str) +{ + int n = strlen (str); + if (n > 0) + { + if (str[n-1] != '\\' && str[n-1] != '/') + strcat (str, "/"); + } +} + +static void vfsFixDOSName (char *src) +{ + if (src == NULL) + return; + + while (*src) + { + if (*src == '\\') + *src = '/'; + src++; + } +} + +//FIXME: STUPID short filenames.. get RID of it asap +// copied verbatim from qe3.cpp +int vfsBuildShortPathName(const char* pPath, char* pBuffer, int nBufferLen) +{ +#ifdef _WIN32 + char *pFile = NULL; + int nResult = GetFullPathName(pPath, nBufferLen, pBuffer, &pFile); + nResult = GetShortPathName(pPath, pBuffer, nBufferLen); + if (nResult == 0) + strcpy(pBuffer, pPath); // Use long filename + return nResult; +#endif + +#if defined (__linux__) || defined (__APPLE__) + + // remove /../ from directories + const char *scr = pPath; char *dst = pBuffer; + for (int i = 0; (i < nBufferLen) && (*scr != 0); i++) + { + if (*scr == '/' && *(scr+1) == '.' && *(scr+2) == '.') + { + scr += 3; + while (dst != pBuffer && *(--dst) != '/') + { + i--; + } + } + + *dst = *scr; + + scr++; dst++; + } + *dst = 0; + + return strlen (pBuffer); +#endif +} + +static void vfsInitPakFile (const char *filename) +{ + wadFile_t *wf; + unsigned int i; + int err; + char *wadnameptr; + char wadname[NAME_MAX]; + + wf = wadOpen (filename); + if (wf == NULL) + { + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, " failed to init wad file %s\n", filename); + return; + } + g_FuncTable.m_pfnSysPrintf(" wad file: %s\n", filename); + + for (i = strlen(filename)-1 ; i >= 0 && filename[i] != '\\' && filename[i] != '/' ; i --) + wadnameptr = (char *)filename + i; + + strcpy(wadname,wadnameptr); + wadname[strlen(wadname)-4] = 0; // ditch the .wad so everthing looks nice! + + g_wadFiles = g_slist_append (g_wadFiles, wf); // store the wadfile handle + + wadGoToFirstFile(wf); + + for (i = 0; i < wf->lpHeader->numlumps; i++) + { + char filename_inwad[NAME_MAX]; + char filename_inwadfixed[NAME_MAX]; + unsigned long filesize; + VFS_PAKFILE* file; + + err = wadGetCurrentFileInfo (wf, filename_inwad, sizeof(filename_inwad) - 5, &filesize); // -5 for extension + null terminator + if (err != 1) + break; + + file = (VFS_PAKFILE*)g_malloc (sizeof (VFS_PAKFILE)); + g_pakFiles = g_slist_append (g_pakFiles, file); + + vfsFixDOSName (filename_inwad); + g_strdown (filename_inwad); + + // texturenames in wad files don't have an extensions or paths, so we must add them! + if (wf->lpLump->type == WAD2_TYPE_MIP) + { + sprintf(filename_inwadfixed,"textures/%s/%s.mip",wadname,filename_inwad); + }else { + sprintf(filename_inwadfixed,"textures/%s/%s.hlw",wadname,filename_inwad); + } + + //g_FuncTable.m_pfnSysFPrintf(SYS_WRN, " scanned %s\\%s\n", filename,filename_inwad); + + file->name = g_strdup (filename_inwadfixed); + file->size = filesize; + file->filenumber = wf->currentfile; + file->wadfile = wf; + memcpy(&file->wadlump, wf->lpLump, sizeof(WAD3_LUMP)); + + err = wadGoToNextFile(wf); + if (err != 1) + break; + } +} + +static GSList* vfsGetListInternal (const char *refdir, const char *ext, bool directories) +{ + GSList *lst, *lst_aux, *files = NULL; + char dirname[NAME_MAX], extension[NAME_MAX], filename[NAME_MAX]; + char basedir[NAME_MAX]; + int dirlen; + char *ptr; + struct stat st; + int i; + + if (refdir != NULL) + { + strcpy (dirname, refdir); + g_strdown (dirname); + vfsFixDOSName (dirname); + vfsAddSlash (dirname); + } else + dirname[0] = '\0'; + dirlen = strlen (dirname); + + if (ext != NULL) + strcpy (extension, ext); + else + extension[0] = '\0'; + g_strdown (extension); + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + gboolean found = FALSE; + ptr = file->name; + + // check that the file name begins with dirname + for (i = 0; (*ptr && i < dirlen); i++, ptr++) + if (*ptr != dirname[i]) + break; + + if (i != dirlen) + continue; + + if (directories) + { + char *sep = strchr (ptr, '/'); + if (sep == NULL) + continue; + + i = sep-ptr; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strncmp ((char*)lst_aux->data, ptr, i) == 0) + { + found = TRUE; + break; + } + + if (!found) + { + char *name = g_strndup (ptr, i+1); + name[i] = '\0'; + files = g_slist_append (files, name); + } + } else + { + // check extension + char *ptr_ext = strrchr (ptr, '.'); + if ((ext != NULL) && ((ptr_ext == NULL) || (strcmp (ptr_ext+1, extension) != 0))) + continue; + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, ptr) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (ptr)); + } + } + + for (i = 0; i < g_numDirs; i++) + { + strcpy (basedir, g_strDirs[i]); + strcat (basedir, dirname); + + GDir* dir = g_dir_open (basedir, 0, NULL); + + if (dir != NULL) + { + for(;;) + { + const char* name = g_dir_read_name(dir); + if(name == NULL) + break; + + if (directories && (name[0] == '.')) + continue; + + sprintf (filename, "%s%s", basedir, name); + stat (filename, &st); + + if ((S_ISDIR (st.st_mode) != 0) != directories) + continue; + + gboolean found = FALSE; + + char* direntry = g_strdup(name); + + g_strdown (direntry); + + char *ptr_ext = strrchr (direntry, '.'); + + if(ext == NULL + || (ext != NULL && ptr_ext != NULL && ptr_ext[0] != '\0' && strcmp (ptr_ext+1, extension) == 0)) + { + + // check for duplicates + for (lst_aux = files; lst_aux; lst_aux = g_slist_next (lst_aux)) + if (strcmp ((char*)lst_aux->data, direntry) == 0) + { + found = TRUE; + break; + } + + if (!found) + files = g_slist_append (files, g_strdup (direntry)); + } + + g_free(direntry); + } + g_dir_close(dir); + } + } + + return files; +} + +// ============================================================================= +// Global functions + +// reads all pak files from a dir +void vfsInitDirectory (const char *path) +{ + char filename[PATH_MAX]; + + if (g_numDirs == (VFS_MAXDIRS-1)) + return; + + strcpy (g_strDirs[g_numDirs], path); + vfsFixDOSName (g_strDirs[g_numDirs]); + vfsAddSlash (g_strDirs[g_numDirs]); + g_numDirs++; + +// if (g_PrefsDlg.m_bPAK) + // TODO: can't read prefs from a module, bah.. + if (1) + { + GDir* dir = g_dir_open (path, 0, NULL); + if (dir != NULL) + { + g_FuncTable.m_pfnSysPrintf("vfs directory: %s\n", path); + while (1) + { + const char* name = g_dir_read_name(dir); + if(name == NULL) + break; + + char *ext = strrchr (name, '.'); + if ((ext == NULL) || (strcmp (ext, ".wad") != 0)) + continue; + + sprintf (filename, "%s/%s", path, name); + vfsInitPakFile (filename); + } + g_dir_close (dir); + } else + g_FuncTable.m_pfnSysFPrintf(SYS_WRN, "vfs directory not found: %s\n", path); + } +} + +// frees all memory that we allocated +// FIXME TTimo this should be improved so that we can shutdown and restart the VFS without exiting Radiant? +// (for instance when modifying the project settings) +void vfsShutdown () +{ + wadFile_t *tmpptr; + + while (g_wadFiles) + { + wadCleanup((wadFile_t *)g_wadFiles->data); + g_wadFiles = g_slist_remove (g_wadFiles, g_wadFiles->data); + } + + // avoid dangling pointer operation (makes BC hangry) + GSList *cur = g_pakFiles; + GSList *next = cur; + while (next) + { + cur = next; + VFS_PAKFILE* file = (VFS_PAKFILE*)cur->data; + g_free (file->name); + g_free (file); + next = g_slist_remove (cur, file); + } + g_pakFiles = NULL; +} + +void vfsFreeFile (void *p) +{ + g_free(p); +} + +GSList* vfsGetFileList (const char *dir, const char *ext) +{ + return vfsGetListInternal (dir, ext, false); +} + +GSList* vfsGetDirList (const char *dir) +{ + return vfsGetListInternal (dir, NULL, true); +} + +void vfsClearFileDirList (GSList **lst) +{ + while (*lst) + { + g_free ((*lst)->data); + *lst = g_slist_remove (*lst, (*lst)->data); + } +} + +// return the number of files that match +int vfsGetFileCount (const char *filename, int flag) +{ + int i, count = 0; + char fixed[NAME_MAX], tmp[NAME_MAX]; + GSList *lst; + + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); + + if (!flag || (flag & VFS_SEARCH_PAK)) + { + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + if (strcmp (file->name, fixed) == 0) + count++; + } + } + + if (!flag || (flag & VFS_SEARCH_DIR)) + { + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, fixed); + if (access (tmp, R_OK) == 0) + count++; + } + } + + return count; +} + +// open a full path file +int vfsLoadFullPathFile (const char *filename, void **bufferptr) +{ + FILE *f; + long len; + + f = fopen (filename, "rb"); + if (f == NULL) + return -1; + + fseek (f, 0, SEEK_END); + len = ftell (f); + rewind (f); + + *bufferptr = g_malloc (len+1); + if (*bufferptr == NULL) + return -1; + + fread (*bufferptr, 1, len, f); + fclose (f); + + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[len] = 0; + + return len; +} + +// NOTE: when loading a file, you have to allocate one extra byte and set it to \0 +int vfsLoadFile (const char *filename, void **bufferptr, int index) +{ + int i, count = 0; + char tmp[NAME_MAX], fixed[NAME_MAX]; + GSList *lst; + + *bufferptr = NULL; + strcpy (fixed, filename); + vfsFixDOSName (fixed); + g_strdown (fixed); + + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, filename); + if (access (tmp, R_OK) == 0) + { + if (count == index) + { + return vfsLoadFullPathFile(tmp,bufferptr); + /* + long len; + FILE *f; + + f = fopen (tmp, "rb"); + if (f == NULL) + return -1; + + fseek (f, 0, SEEK_END); + len = ftell (f); + rewind (f); + + *bufferptr = g_malloc (len+1); + if (*bufferptr == NULL) + return -1; + + fread (*bufferptr, 1, len, f); + fclose (f); + + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[len] = 0; + + return len; + */ + } + + count++; + } + } + + + // Textures in HalfLife wads don't have paths, but in the list of files + // we store the actual full paths of the files and what WAD they're in. + // so what we have to do is strip the paths and just compare filenames. + + // Hydra: well, we did do this, but now we don't, as the map loader now + // fills in the correct paths for each texture. + + /* + char *searchname; + char *fixedptr; + + fixedptr = fixed; + + for (i = strlen(fixed)-1 ; i >= 0 && fixed[i] != '\\' && fixed[i] != '/' ; i --) + fixedptr = (char *)fixed + i; + */ + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + + /* + searchname = file->name; + for (i = strlen(file->name)-1 ; i >= 0 && file->name[i] != '\\' && file->name[i] != '/' ; i --) + searchname = (char *)file->name + i; + if (strcmp (searchname, fixedptr) != 0) + continue; + */ + + if (strcmp (file->name, fixed) != 0) + continue; + + if (count == index) + { + // Useful for debugging + //Sys_Printf("VFSWAD: reading from %s\n",file->wadfile->wadfilename); + + if (wadOpenCurrentFileByNum (file->wadfile, file->filenumber) != 1) + return -1; + + *bufferptr = g_malloc (file->size+1); + // we need to end the buffer with a 0 + ((char*) (*bufferptr))[file->size] = 0; + + i = wadReadCurrentFile (file->wadfile , (char *)*bufferptr, file->size); + wadCloseCurrentFile (file->wadfile); + if (i > 0) + return file->size; + else + return -1; + } + + count++; + } + + return -1; +} + +//#ifdef _DEBUG +#if 0 + #define DBG_RLTPATH +#endif + +char* vfsExtractRelativePath(const char *in) +{ + int i; + char l_in[PATH_MAX]; + char check[PATH_MAX]; + static char out[PATH_MAX]; + out[0] = 0; + +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: %s\n", in); +#endif + + strcpy(l_in,in); + vfsCleanFileName(l_in); + +#ifdef DBG_RLTPATH + Sys_Printf("cleaned path: %s\n", l_in); +#endif + + for (i = 0; i < g_numDirs; i++) + { + strcpy(check,g_strDirs[i]); + vfsCleanFileName(check); +#ifdef DBG_RLTPATH + Sys_Printf("Matching against %s\n", check); +#endif + + // try to find a match + if (strstr(l_in, check)) + { + strcpy(out,l_in+strlen(check)+1); + break; + } + } + if (out[0]!=0) + { +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: success\n"); +#endif + return out; + } +#ifdef DBG_RLTPATH + Sys_Printf("vfsExtractRelativePath: failed\n"); +#endif + return NULL; +} + +// removed CString usage +void vfsCleanFileName(char *in) +{ + char str[PATH_MAX]; + vfsBuildShortPathName (in, str, PATH_MAX); + strlwr(str); + vfsFixDOSName(str); + int n = strlen(str); + if (str[n-1] == '/') + str[n-1] = '\0'; + strcpy (in, str); +} + +// HYDRA: this now searches VFS/PAK files in addition to the filesystem +// if FLAG is unspecified then ONLY dirs are searched. +// PAK's are searched before DIRs to mimic engine behaviour +// index is ignored when searching PAK files. +// see ifilesystem.h +char* vfsGetFullPath(const char *in, int index, int flag) +{ + int count = 0; + static char out[PATH_MAX]; + char tmp[NAME_MAX]; + int i; + + if (flag & VFS_SEARCH_PAK) + { + char fixed[NAME_MAX]; + GSList *lst; + + strcpy (fixed, in); + vfsFixDOSName (fixed); + g_strdown (fixed); + + for (lst = g_pakFiles; lst != NULL; lst = g_slist_next (lst)) + { + VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; + + char *ptr,*lastptr; + lastptr = file->name; + + while (ptr = strchr(lastptr,'/')) + lastptr = ptr+1; + + if (strcmp (lastptr, fixed) == 0) + { + strncpy(out,file->name,PATH_MAX); + return out; + } + } + + } + + if (!flag || (flag & VFS_SEARCH_DIR)) + { + for (i = 0; i < g_numDirs; i++) + { + strcpy (tmp, g_strDirs[i]); + strcat (tmp, in); + if (access (tmp, R_OK) == 0) + { + if (count == index) + { + strcpy (out, tmp); + return out; + } + count++; + } + } + } + return NULL; +} + +// TODO TTimo on linux the base prompt is ~/.q3a/ +// given the file dialog, we could push the strFSBasePath and ~/.q3a into the directory shortcuts +// FIXME TTimo is this really a VFS functionality? +// actually .. this should be the decision of the core isn't it? +// or .. add an API so that the base prompt can be set during VFS init +const char* vfsBasePromptPath() +{ +#ifdef _WIN32 + static char* path = "C:"; +#else + static char* path = "/"; +#endif + return path; +} + diff --git a/plugins/vfswad/vfs.h b/plugins/vfswad/vfs.h new file mode 100644 index 00000000..ec9791f8 --- /dev/null +++ b/plugins/vfswad/vfs.h @@ -0,0 +1,69 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _VFS_H_ +#define _VFS_H_ + +#define VFS_MAXDIRS 8 + +void vfsInitDirectory (const char *path); +void vfsShutdown (); +void vfsFreeFile (void *p); +GSList* vfsGetFileList (const char *dir, const char *ext); +GSList* vfsGetDirList (const char *dir); +void vfsClearFileDirList (GSList **lst); +int vfsGetFileCount (const char *filename, int flag); +int vfsLoadFile (const char *filename, void **buffer, int index = 0); +int vfsLoadFullPathFile (const char *filename, void **buffer); + +// some useful functions +// clean a file name to a unique representation +// very usefull if you have to do some weird manips on the files +// works on regular files and dirs +// will convert to lowercase, unix path ('/' filename seperator) +// on win32, will build the short path name +// directories will be cleaned, no ending filename seperator +// we modify the entry directly, the size of the string can only go down +void vfsCleanFileName(char *); +// these return a static char*, doesn't need to be freed or anything +// get the base path to use when raising file dialogs +// we manually add "maps/" or "sounds/" or "mapobjects/models/" etc. +const char* vfsBasePromptPath(); +// extract the relative path from a full path +// will match against any of the base paths we have +// returns NULL if not found +char* vfsExtractRelativePath(const char *in); +// returns the full path (in a static buff) to a file given it's relative path +// returns the first file in the list or NULL if not found +// see ifilesystem.h for more notes +char* vfsGetFullPath(const char*, int index = 0, int flag = 0); + + +#endif // _VFS_H_ diff --git a/plugins/vfswad/vfswad.cpp b/plugins/vfswad/vfswad.cpp new file mode 100644 index 00000000..ee6e8b02 --- /dev/null +++ b/plugins/vfswad/vfswad.cpp @@ -0,0 +1,106 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// HalfLife Virtual FileSystem - reads files from different dirs and inside wad files +// +// Coding by Dominic Clifton - Hydra - hydra@hydras-world.com +// +// based on code by Leonardo Zide (leo@lokigames.com) +// + +#ifdef _WIN32 +#include +#endif + +#include +#include "vfswad.h" +#include "vfs.h" + +// ============================================================================= +// SYNAPSE + +_QERFuncTable_1 g_FuncTable; + +CSynapseServer* g_pSynapseServer = NULL; +CSynapseClientVFS g_SynapseClient; + +#if __GNUC__ >= 4 +#pragma GCC visibility push(default) +#endif +extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) { +#if __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + if (strcmp(version, SYNAPSE_VERSION)) + { + Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); + return NULL; + } + g_pSynapseServer = pServer; + g_pSynapseServer->IncRef(); + Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf()); + + g_SynapseClient.AddAPI(VFS_MAJOR, "wad", sizeof(_QERFileSystemTable)); + g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable); + + return &g_SynapseClient; +} + +bool CSynapseClientVFS::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, VFS_MAJOR)) + { + _QERFileSystemTable* pTable= static_cast<_QERFileSystemTable*>(pAPI->mpTable); + pTable->m_pfnInitDirectory = &vfsInitDirectory; + pTable->m_pfnShutdown = &vfsShutdown; + pTable->m_pfnFreeFile = &vfsFreeFile; + pTable->m_pfnGetDirList = &vfsGetDirList; + pTable->m_pfnGetFileList = &vfsGetFileList; + pTable->m_pfnClearFileDirList = &vfsClearFileDirList; + pTable->m_pfnGetFileCount = &vfsGetFileCount; + pTable->m_pfnLoadFile = &vfsLoadFile; + pTable->m_pfnLoadFullPathFile = &vfsLoadFullPathFile; + pTable->m_pfnExtractRelativePath = &vfsExtractRelativePath; + pTable->m_pfnGetFullPath = &vfsGetFullPath; + pTable->m_pfnBasePromptPath = &vfsBasePromptPath; + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; +} + +#include "version.h" + +const char* CSynapseClientVFS::GetInfo() +{ + return "WAD VFS module built " __DATE__ " " RADIANT_VERSION; +} diff --git a/plugins/vfswad/vfswad.def b/plugins/vfswad/vfswad.def new file mode 100644 index 00000000..0515e470 --- /dev/null +++ b/plugins/vfswad/vfswad.def @@ -0,0 +1,8 @@ +; vfswad.def : Declares the module parameters for the DLL. + +LIBRARY "vfswad" +DESCRIPTION 'vfswad Windows Dynamic Link Library' + +EXPORTS + ; Explicit exports can go here + Synapse_EnumerateInterfaces @1 diff --git a/plugins/vfswad/vfswad.h b/plugins/vfswad/vfswad.h new file mode 100644 index 00000000..4845d591 --- /dev/null +++ b/plugins/vfswad/vfswad.h @@ -0,0 +1,63 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _VFSWAD_H_ +#define _VFSWAD_H_ + +#ifdef __linux__ + +typedef void* HMODULE; +typedef void* LPVOID; +typedef char* LPCSTR; + +#endif // __linux__ + +#include "synapse.h" +#include "qerplugin.h" +#include "ifilesystem.h" + +extern _QERFuncTable_1 g_FuncTable; +extern CSynapseServer* g_pSynapseServer; + +#define Sys_Printf g_FuncTable.m_pfnSysPrintf +#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf + +class CSynapseClientVFS : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + CSynapseClientVFS() { } + virtual ~CSynapseClientVFS() { } +}; + +#endif // _VFSWAD_H_ diff --git a/plugins/vfswad/vfswad.txt b/plugins/vfswad/vfswad.txt new file mode 100644 index 00000000..34185307 --- /dev/null +++ b/plugins/vfswad/vfswad.txt @@ -0,0 +1,30 @@ +VFSWAD +====== + +Coding by Dominic Clifton - Hydra - hydra@hydras-world.com + +What is it ? +------------ + +This GTKRadiant 1.2+ plugin handles the extracting of files from .WAD files. +I'll refer to these files as .HLW files, even though they don't have any +extension when they're stored in the .WAD file itself. + +You need an image plugin to go with this plugin that can read .HLW files +My ImageHL plugin does just this. + +Developer Notes +--------------- + +The project file will copy the compiled DLL file and this .TXT file to +"$(HLRADIANTDIR)\modules" so make sure you have that environment variable +defined. + +For my GTKRadiant 1.2 HalfLife game pack files I use the directory: +"E:\games\HalfLife\Tools\GTKR12N\". Under which there are the directories +"modules" and "plugins" + +Credits +------- +Thanks to the guys that made Wally for releasing an example WAD loader. +without it this would not have been possible. diff --git a/plugins/vfswad/vfswad.vcproj b/plugins/vfswad/vfswad.vcproj new file mode 100644 index 00000000..f44ee23c --- /dev/null +++ b/plugins/vfswad/vfswad.vcproj @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/radiant.sln b/radiant.sln new file mode 100644 index 00000000..f4ace9ff --- /dev/null +++ b/radiant.sln @@ -0,0 +1,167 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "radiant", "radiant\radiant.vcproj", "{65D02375-63EE-4A8A-9F8E-504B1D5A1D02}" + ProjectSection(ProjectDependencies) = postProject + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} = {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + {5DCC8086-830E-42E6-B080-5A287F8FF5DC} = {5DCC8086-830E-42E6-B080-5A287F8FF5DC} + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01} = {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01} + {0B522841-BDCC-493A-BA5C-604AE2CD5756} = {0B522841-BDCC-493A-BA5C-604AE2CD5756} + {3886C418-A41E-4AFF-BBD1-8E1E508920C9} = {3886C418-A41E-4AFF-BBD1-8E1E508920C9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "synapse", "libs\synapse\synapse.vcproj", "{E13CCFB0-A366-4EF3-A66F-C374B563E4DF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmdlib", "libs\cmdlib\cmdlib.vcproj", "{0B522841-BDCC-493A-BA5C-604AE2CD5756}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ddslib", "libs\ddslib\ddslib.vcproj", "{5DCC8086-830E-42E6-B080-5A287F8FF5DC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "l_net", "libs\l_net\l_net.vcproj", "{3886C418-A41E-4AFF-BBD1-8E1E508920C9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mathlib", "libs\mathlib\mathlib.vcproj", "{320CF5DE-0DFD-4C3F-B558-5F4098E111C8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "md5lib", "libs\md5lib\md5lib.vcproj", "{DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "picomodel", "libs\picomodel\picomodel.vcproj", "{444E6FDA-83BD-49F1-89A4-7CF716F742A8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "camera", "contrib\camera\camera.vcproj", "{A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}" + ProjectSection(ProjectDependencies) = postProject + {6C1116CE-D99E-4629-9E69-A9329335D706} = {6C1116CE-D99E-4629-9E69-A9329335D706} + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "entity", "plugins\entity\entity.vcproj", "{17DD38AA-4842-45BC-9304-2ADC1A12B4F4}" + ProjectSection(ProjectDependencies) = postProject + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} = {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image", "plugins\image\image.vcproj", "{1F9977F6-216F-4AE1-9928-59B72CF31C46}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagepng", "plugins\imagepng\imagepng.vcproj", "{43C01E60-21CC-49F5-8A11-F460BC866A31}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map", "plugins\map\map.vcproj", "{1B0E70B0-ED20-4021-9BBE-5168CB8DAE90}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapxml", "plugins\mapxml\mapxml.vcproj", "{DDBF170A-42DF-4836-9006-816422E08493}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "model", "plugins\model\model.vcproj", "{83C877DA-17B2-4863-B085-06AE9A8D68F3}" + ProjectSection(ProjectDependencies) = postProject + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} = {320CF5DE-0DFD-4C3F-B558-5F4098E111C8} + {444E6FDA-83BD-49F1-89A4-7CF716F742A8} = {444E6FDA-83BD-49F1-89A4-7CF716F742A8} + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders", "plugins\shaders\shaders.vcproj", "{AEBCB950-AB67-48BB-9AF5-FCFB042824E8}" + ProjectSection(ProjectDependencies) = postProject + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "surface", "plugins\surface\surface.vcproj", "{6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}" + ProjectSection(ProjectDependencies) = postProject + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}" + ProjectSection(ProjectDependencies) = postProject + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Splines", "libs\splines\Splines.vcproj", "{6C1116CE-D99E-4629-9E69-A9329335D706}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "q3map2", "tools\quake3\q3map2\q3map2.vcproj", "{F5D0509C-80E0-49B7-B033-885D8253063A}" + ProjectSection(ProjectDependencies) = postProject + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01} = {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {65D02375-63EE-4A8A-9F8E-504B1D5A1D02}.Debug|Win32.ActiveCfg = Debug|Win32 + {65D02375-63EE-4A8A-9F8E-504B1D5A1D02}.Debug|Win32.Build.0 = Debug|Win32 + {65D02375-63EE-4A8A-9F8E-504B1D5A1D02}.Release|Win32.ActiveCfg = Release|Win32 + {65D02375-63EE-4A8A-9F8E-504B1D5A1D02}.Release|Win32.Build.0 = Release|Win32 + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}.Debug|Win32.Build.0 = Debug|Win32 + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}.Release|Win32.ActiveCfg = Release|Win32 + {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}.Release|Win32.Build.0 = Release|Win32 + {0B522841-BDCC-493A-BA5C-604AE2CD5756}.Debug|Win32.ActiveCfg = Debug|Win32 + {0B522841-BDCC-493A-BA5C-604AE2CD5756}.Debug|Win32.Build.0 = Debug|Win32 + {0B522841-BDCC-493A-BA5C-604AE2CD5756}.Release|Win32.ActiveCfg = Release|Win32 + {0B522841-BDCC-493A-BA5C-604AE2CD5756}.Release|Win32.Build.0 = Release|Win32 + {5DCC8086-830E-42E6-B080-5A287F8FF5DC}.Debug|Win32.ActiveCfg = Debug|Win32 + {5DCC8086-830E-42E6-B080-5A287F8FF5DC}.Debug|Win32.Build.0 = Debug|Win32 + {5DCC8086-830E-42E6-B080-5A287F8FF5DC}.Release|Win32.ActiveCfg = Release|Win32 + {5DCC8086-830E-42E6-B080-5A287F8FF5DC}.Release|Win32.Build.0 = Release|Win32 + {3886C418-A41E-4AFF-BBD1-8E1E508920C9}.Debug|Win32.ActiveCfg = Debug|Win32 + {3886C418-A41E-4AFF-BBD1-8E1E508920C9}.Debug|Win32.Build.0 = Debug|Win32 + {3886C418-A41E-4AFF-BBD1-8E1E508920C9}.Release|Win32.ActiveCfg = Release|Win32 + {3886C418-A41E-4AFF-BBD1-8E1E508920C9}.Release|Win32.Build.0 = Release|Win32 + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8}.Debug|Win32.ActiveCfg = Debug|Win32 + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8}.Debug|Win32.Build.0 = Debug|Win32 + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8}.Release|Win32.ActiveCfg = Release|Win32 + {320CF5DE-0DFD-4C3F-B558-5F4098E111C8}.Release|Win32.Build.0 = Release|Win32 + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01}.Debug|Win32.ActiveCfg = Debug|Win32 + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01}.Debug|Win32.Build.0 = Debug|Win32 + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01}.Release|Win32.ActiveCfg = Release|Win32 + {DC2F2B6B-2596-4B90-88CE-2FDE4C2FFB01}.Release|Win32.Build.0 = Release|Win32 + {444E6FDA-83BD-49F1-89A4-7CF716F742A8}.Debug|Win32.ActiveCfg = Debug|Win32 + {444E6FDA-83BD-49F1-89A4-7CF716F742A8}.Debug|Win32.Build.0 = Debug|Win32 + {444E6FDA-83BD-49F1-89A4-7CF716F742A8}.Release|Win32.ActiveCfg = Release|Win32 + {444E6FDA-83BD-49F1-89A4-7CF716F742A8}.Release|Win32.Build.0 = Release|Win32 + {A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}.Debug|Win32.ActiveCfg = Debug|Win32 + {A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}.Debug|Win32.Build.0 = Debug|Win32 + {A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}.Release|Win32.ActiveCfg = Release|Win32 + {A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}.Release|Win32.Build.0 = Release|Win32 + {17DD38AA-4842-45BC-9304-2ADC1A12B4F4}.Debug|Win32.ActiveCfg = Debug|Win32 + {17DD38AA-4842-45BC-9304-2ADC1A12B4F4}.Debug|Win32.Build.0 = Debug|Win32 + {17DD38AA-4842-45BC-9304-2ADC1A12B4F4}.Release|Win32.ActiveCfg = Release|Win32 + {17DD38AA-4842-45BC-9304-2ADC1A12B4F4}.Release|Win32.Build.0 = Release|Win32 + {1F9977F6-216F-4AE1-9928-59B72CF31C46}.Debug|Win32.ActiveCfg = Debug|Win32 + {1F9977F6-216F-4AE1-9928-59B72CF31C46}.Debug|Win32.Build.0 = Debug|Win32 + {1F9977F6-216F-4AE1-9928-59B72CF31C46}.Release|Win32.ActiveCfg = Release|Win32 + {1F9977F6-216F-4AE1-9928-59B72CF31C46}.Release|Win32.Build.0 = Release|Win32 + {43C01E60-21CC-49F5-8A11-F460BC866A31}.Debug|Win32.ActiveCfg = Debug|Win32 + {43C01E60-21CC-49F5-8A11-F460BC866A31}.Debug|Win32.Build.0 = Debug|Win32 + {43C01E60-21CC-49F5-8A11-F460BC866A31}.Release|Win32.ActiveCfg = Release|Win32 + {43C01E60-21CC-49F5-8A11-F460BC866A31}.Release|Win32.Build.0 = Release|Win32 + {1B0E70B0-ED20-4021-9BBE-5168CB8DAE90}.Debug|Win32.ActiveCfg = Debug|Win32 + {1B0E70B0-ED20-4021-9BBE-5168CB8DAE90}.Debug|Win32.Build.0 = Debug|Win32 + {1B0E70B0-ED20-4021-9BBE-5168CB8DAE90}.Release|Win32.ActiveCfg = Release|Win32 + {1B0E70B0-ED20-4021-9BBE-5168CB8DAE90}.Release|Win32.Build.0 = Release|Win32 + {DDBF170A-42DF-4836-9006-816422E08493}.Debug|Win32.ActiveCfg = Debug|Win32 + {DDBF170A-42DF-4836-9006-816422E08493}.Debug|Win32.Build.0 = Debug|Win32 + {DDBF170A-42DF-4836-9006-816422E08493}.Release|Win32.ActiveCfg = Release|Win32 + {DDBF170A-42DF-4836-9006-816422E08493}.Release|Win32.Build.0 = Release|Win32 + {83C877DA-17B2-4863-B085-06AE9A8D68F3}.Debug|Win32.ActiveCfg = Debug|Win32 + {83C877DA-17B2-4863-B085-06AE9A8D68F3}.Debug|Win32.Build.0 = Debug|Win32 + {83C877DA-17B2-4863-B085-06AE9A8D68F3}.Release|Win32.ActiveCfg = Release|Win32 + {83C877DA-17B2-4863-B085-06AE9A8D68F3}.Release|Win32.Build.0 = Release|Win32 + {AEBCB950-AB67-48BB-9AF5-FCFB042824E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {AEBCB950-AB67-48BB-9AF5-FCFB042824E8}.Debug|Win32.Build.0 = Debug|Win32 + {AEBCB950-AB67-48BB-9AF5-FCFB042824E8}.Release|Win32.ActiveCfg = Release|Win32 + {AEBCB950-AB67-48BB-9AF5-FCFB042824E8}.Release|Win32.Build.0 = Release|Win32 + {6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}.Debug|Win32.ActiveCfg = Debug|Win32 + {6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}.Debug|Win32.Build.0 = Debug|Win32 + {6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}.Release|Win32.ActiveCfg = Release|Win32 + {6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}.Release|Win32.Build.0 = Release|Win32 + {DEFCF433-3A47-40EB-BBF7-861211C3A941}.Debug|Win32.ActiveCfg = Debug|Win32 + {DEFCF433-3A47-40EB-BBF7-861211C3A941}.Debug|Win32.Build.0 = Debug|Win32 + {DEFCF433-3A47-40EB-BBF7-861211C3A941}.Release|Win32.ActiveCfg = Release|Win32 + {DEFCF433-3A47-40EB-BBF7-861211C3A941}.Release|Win32.Build.0 = Release|Win32 + {6C1116CE-D99E-4629-9E69-A9329335D706}.Debug|Win32.ActiveCfg = Debug|Win32 + {6C1116CE-D99E-4629-9E69-A9329335D706}.Debug|Win32.Build.0 = Debug|Win32 + {6C1116CE-D99E-4629-9E69-A9329335D706}.Release|Win32.ActiveCfg = Release|Win32 + {6C1116CE-D99E-4629-9E69-A9329335D706}.Release|Win32.Build.0 = Release|Win32 + {F5D0509C-80E0-49B7-B033-885D8253063A}.Debug|Win32.ActiveCfg = Debug|Win32 + {F5D0509C-80E0-49B7-B033-885D8253063A}.Debug|Win32.Build.0 = Debug|Win32 + {F5D0509C-80E0-49B7-B033-885D8253063A}.Release|Win32.ActiveCfg = Release|Win32 + {F5D0509C-80E0-49B7-B033-885D8253063A}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/radiant.xcode/apple.pbxuser b/radiant.xcode/apple.pbxuser new file mode 100644 index 00000000..7e5d5832 --- /dev/null +++ b/radiant.xcode/apple.pbxuser @@ -0,0 +1,496 @@ +// !$*UTF8*$! +{ + 1865048206253BC4005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1736, 11689}}"; + sepNavSelRange = "{27154, 0}"; + sepNavVisRect = "{{0, 9653}, {699, 833}}"; + sepNavWindowFrame = "{{15, 128}, {759, 895}}"; + }; + }; + 1865048306253BC4005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {728, 4157}}"; + sepNavSelRange = "{509, 0}"; + sepNavVisRect = "{{0, 3371}, {720, 786}}"; + }; + }; + 18650B1A06253BD4005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {848, 1763}}"; + sepNavSelRange = "{3427, 0}"; + sepNavVisRect = "{{0, 837}, {699, 833}}"; + }; + }; + 18650B8806253BD5005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {720, 786}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRect = "{{0, 0}, {720, 786}}"; + }; + }; + 18650B8906253BD5005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1532, 833}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRect = "{{0, 0}, {699, 833}}"; + }; + }; + 1865158D06253D50005AB5DA = { + activeExec = 0; + }; + 186515AC06255F40005AB5DA = { + activeExec = 0; + }; + 1865EBCC06253B29005AB5DA = { + activeBuildStyle = 1865EBCA06253B29005AB5DA; + activeTarget = 186515AC06255F40005AB5DA; + addToTargets = ( + ); + codeSenseManager = 1865EBCE06253B29005AB5DA; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 190, + 20, + 39, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 167, + 41, + 20, + 41, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 103238153; + PBXPrepackagedSmartGroups_v2 = ( + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + activationKey = OldTargetSmartGroup; + clz = PBXTargetSmartGroup; + description = "Displays all targets of the project."; + globalID = 1C37FABC04509CD000000102; + name = Targets; + preferences = { + image = Targets; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXTargetSmartGroup2; + description = "Displays all targets of the project as well as nested build phases."; + globalID = 1C37FBAC04509CD000000102; + name = Targets; + preferences = { + image = Targets; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXExecutablesSmartGroup; + description = "Displays all executables of the project."; + globalID = 1C37FAAC04509CD000000102; + name = Executables; + preferences = { + image = Executable; + }; + }, + { + " PBXTransientLocationAtTop " = bottom; + absolutePathToBundle = ""; + clz = PBXErrorsWarningsSmartGroup; + description = "Displays files with errors or warnings."; + globalID = 1C08E77C0454961000C914BD; + name = "Errors and Warnings"; + preferences = { + fnmatch = ""; + image = WarningsErrors; + recursive = 1; + regex = ""; + root = ""; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXFilenameSmartGroup; + description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter."; + globalID = 1CC0EA4004350EF90044410B; + name = "Implementation Files"; + preferences = { + canSave = 1; + fnmatch = ""; + image = SmartFolder; + isLeaf = 0; + recursive = 1; + regex = "?*\\.[mcMC]"; + root = ""; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXFilenameSmartGroup; + description = "This group displays Interface Builder NIB Files."; + globalID = 1CC0EA4004350EF90041110B; + name = "NIB Files"; + preferences = { + canSave = 1; + fnmatch = "*.nib"; + image = SmartFolder; + isLeaf = 0; + recursive = 1; + regex = ""; + root = ""; + }; + }, + { + PBXTransientLocationAtTop = no; + absolutePathToBundle = ""; + clz = PBXFindSmartGroup; + description = "Displays Find Results."; + globalID = 1C37FABC05509CD000000102; + name = "Find Results"; + preferences = { + image = spyglass; + }; + }, + { + PBXTransientLocationAtTop = no; + absolutePathToBundle = ""; + clz = PBXBookmarksSmartGroup; + description = "Displays Project Bookmarks."; + globalID = 1C37FABC05539CD112110102; + name = Bookmarks; + preferences = { + image = Bookmarks; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = XCSCMSmartGroup; + description = "Displays files with interesting SCM status."; + globalID = E2644B35053B69B200211256; + name = SCM; + preferences = { + image = PBXRepository; + isLeaf = 0; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXSymbolsSmartGroup; + description = "Displays all symbols for the project."; + globalID = 1C37FABC04509CD000100104; + name = "Project Symbols"; + preferences = { + image = ProjectSymbols; + isLeaf = 1; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXFilenameSmartGroup; + description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter."; + globalID = PBXTemplateMarker; + name = "Simple Filter SmartGroup"; + preferences = { + canSave = 1; + fnmatch = "*.nib"; + image = SmartFolder; + isLeaf = 0; + recursive = 1; + regex = ""; + root = ""; + }; + }, + { + PBXTransientLocationAtTop = bottom; + absolutePathToBundle = ""; + clz = PBXFilenameSmartGroup; + description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter."; + globalID = PBXTemplateMarker; + name = "Simple Regular Expression SmartGroup"; + preferences = { + canSave = 1; + fnmatch = ""; + image = SmartFolder; + isLeaf = 0; + recursive = 1; + regex = "?*\\.[mcMC]"; + root = ""; + }; + }, + ); + PBXWorkspaceContents = ( + { + PBXProjectWorkspaceModule_StateKey_Rev39 = { + PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = { + BoundsStr = "{{0, 0}, {288, 284}}"; + Rows = ( + 0, + ); + VisibleRectStr = "{{0, 0}, {288, 284}}"; + }; + PBXProjectWorkspaceModule_EditorOpen = false; + PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = { + PBXSplitModuleInNavigatorKey = { + SplitCount = 1; + }; + }; + PBXProjectWorkspaceModule_GeometryKey_Rev15 = { + PBXProjectWorkspaceModule_SGTM_Geometry = { + _collapsingFrameDimension = 0; + _indexOfCollapsedView = 0; + _percentageOfCollapsedView = 0; + sizes = ( + "{{0, 0}, {297, 301}}", + "{{297, 0}, {303, 301}}", + ); + }; + }; + PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {303, 301}}"; + PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}"; + PBXProjectWorkspaceModule_OldSuperviewFrame = "{{297, 0}, {303, 301}}"; + PBXProjectWorkspaceModule_SGTM = { + PBXBottomSmartGroupGIDs = ( + 1C37FBAC04509CD000000102, + 1C37FAAC04509CD000000102, + 1C08E77C0454961000C914BD, + 1CC0EA4004350EF90044410B, + 1CC0EA4004350EF90041110B, + 1C37FABC05509CD000000102, + 1C37FABC05539CD112110102, + E2644B35053B69B200211256, + 1C37FABC04509CD000100104, + ); + PBXSmartGroupTreeModuleColumnData = { + PBXSmartGroupTreeModuleColumnWidthsKey = ( + 280, + ); + PBXSmartGroupTreeModuleColumnsKey_v4 = ( + MainColumn, + ); + }; + PBXSmartGroupTreeModuleOutlineStateKey_v7 = { + PBXSmartGroupTreeModuleOutlineStateExpansionKey = ( + 1865EBC806253B29005AB5DA, + 1865EBD506253B76005AB5DA, + 1865048406253BC4005AB5DA, + 186504B506253BC5005AB5DA, + 186504CA06253BC5005AB5DA, + 18650A2106253BD1005AB5DA, + 18650ACA06253BD3005AB5DA, + 18650ADE06253BD3005AB5DA, + 18650B7006253BD5005AB5DA, + 1C37FBAC04509CD000000102, + ); + PBXSmartGroupTreeModuleOutlineStateSelectionKey = ( + ( + 84, + 81, + 42, + 1, + 0, + ), + ); + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 1273}, {280, 283}}"; + }; + PBXTopSmartGroupGIDs = ( + ); + }; + }; + }, + ); + "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXBuildResultsModule" = { + }; + "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugCLIModule" = { + }; + "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXNavigatorGroup" = { + PBXSplitModuleInNavigatorKey = { + SplitCount = 1; + }; + }; + "PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = { + PBXProjectWorkspaceModule_StateKey_Rev39 = { + PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = { + BoundsStr = "{{0, 0}, {403, 284}}"; + Rows = ( + 0, + ); + VisibleRectStr = "{{0, 0}, {403, 284}}"; + }; + PBXProjectWorkspaceModule_EditorOpen = false; + PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = { + PBXSplitModuleInNavigatorKey = { + SplitCount = 1; + }; + }; + PBXProjectWorkspaceModule_GeometryKey_Rev15 = { + PBXProjectWorkspaceModule_SGTM_Geometry = { + _collapsingFrameDimension = 0; + _indexOfCollapsedView = 0; + _percentageOfCollapsedView = 0; + sizes = ( + "{{0, 0}, {182, 301}}", + "{{182, 0}, {418, 301}}", + ); + }; + }; + PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {418, 301}}"; + PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 0}, {750, 480}}"; + PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {418, 301}}"; + PBXProjectWorkspaceModule_SGTM = { + PBXBottomSmartGroupGIDs = ( + 1C37FBAC04509CD000000102, + 1C37FAAC04509CD000000102, + 1C08E77C0454961000C914BD, + 1CC0EA4004350EF90044410B, + 1CC0EA4004350EF90041110B, + 1C37FABC05509CD000000102, + 1C37FABC05539CD112110102, + E2644B35053B69B200211256, + 1C37FABC04509CD000100104, + ); + PBXSmartGroupTreeModuleColumnData = { + PBXSmartGroupTreeModuleColumnWidthsKey = ( + 165, + ); + PBXSmartGroupTreeModuleColumnsKey_v4 = ( + MainColumn, + ); + }; + PBXSmartGroupTreeModuleOutlineStateKey_v7 = { + PBXSmartGroupTreeModuleOutlineStateExpansionKey = ( + 1865EBC806253B29005AB5DA, + 1865EBD506253B76005AB5DA, + 1865048406253BC4005AB5DA, + 18650B7006253BD5005AB5DA, + 1C37FBAC04509CD000000102, + 186E28A30625621E00080878, + ); + PBXSmartGroupTreeModuleOutlineStateSelectionKey = ( + ( + 53, + 51, + 42, + 1, + 0, + ), + ); + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 733}, {165, 283}}"; + }; + PBXTopSmartGroupGIDs = ( + ); + }; + }; + }; + PBXWorkspaceGeometries = ( + { + Frame = "{{0, 0}, {600, 301}}"; + PBXProjectWorkspaceModule_GeometryKey_Rev15 = { + }; + RubberWindowFrame = "864 615 600 343 0 0 1680 1028 "; + }, + ); + "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXBuildResultsModule" = { + Frame = "{{0, 0}, {643, 462}}"; + PBXModuleWindowStatusBarHidden = YES; + RubberWindowFrame = "600 374 643 483 0 0 1680 1028 "; + }; + "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugCLIModule" = { + Frame = "{{0, 0}, {400, 201}}"; + PBXModuleWindowStatusBarHidden = YES; + RubberWindowFrame = "50 1000 400 222 0 0 1680 1028 "; + }; + "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXNavigatorGroup" = { + Frame = "{{0, 0}, {741, 869}}"; + PBXModuleWindowStatusBarHidden = YES; + RubberWindowFrame = "15 133 741 890 0 0 1680 1028 "; + }; + "PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = { + Frame = "{{0, 0}, {600, 301}}"; + PBXProjectWorkspaceModule_GeometryKey_Rev15 = { + PBXProjectWorkspaceModule_BuildResultsWindowVisible = true; + PBXProjectWorkspaceModule_PinnedFile = /Users/apple/GtkRadiant/setup/osx/build.sh; + }; + RubberWindowFrame = "864 615 600 343 0 0 1680 1028 "; + }; + PBXWorkspaceStateSaveDate = 103238153; + }; + sourceControlManager = 1865EBCD06253B29005AB5DA; + userBuildSettings = { + }; + }; + 1865EBCD06253B29005AB5DA = { + isa = PBXSourceControlManager; + scmConfiguration = { + }; + scmType = ""; + }; + 1865EBCE06253B29005AB5DA = { + indexTemplatePath = ""; + isa = PBXCodeSenseManager; + usesDefaults = 1; + wantsCodeCompletion = 1; + wantsCodeCompletionAutoPopup = 0; + wantsCodeCompletionAutoSuggestions = 0; + wantsCodeCompletionCaseSensitivity = 1; + wantsCodeCompletionOnlyMatchingItems = 1; + wantsCodeCompletionParametersIncluded = 1; + wantsCodeCompletionPlaceholdersInserted = 1; + wantsCodeCompletionTabCompletes = 1; + wantsIndex = 1; + }; + 1865F17706253B81005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {2762, 78581}}"; + sepNavSelRange = "{187, 0}"; + sepNavVisRect = "{{0, 0}, {699, 833}}"; + }; + }; + 1865FCB706253BAF005AB5DA = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1118, 833}}"; + sepNavSelRange = "{1196, 0}"; + sepNavVisRect = "{{0, 0}, {699, 833}}"; + }; + }; +} diff --git a/radiant.xcode/project.pbxproj b/radiant.xcode/project.pbxproj new file mode 100644 index 00000000..4157860b --- /dev/null +++ b/radiant.xcode/project.pbxproj @@ -0,0 +1,95793 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 39; + objects = { + 1865000006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865000106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865000206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865000306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865000406253BB8005AB5DA = { + children = ( + 1865000506253BB8005AB5DA, + 1865000606253BB8005AB5DA, + 1865000706253BB8005AB5DA, + 1865000806253BB8005AB5DA, + 1865000906253BB8005AB5DA, + 1865000A06253BB8005AB5DA, + 1865000B06253BB8005AB5DA, + 1865000C06253BB8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865000506253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000A06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000B06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000C06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865000D06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865000E06253BB8005AB5DA = { + children = ( + 1865000F06253BB8005AB5DA, + 1865001006253BB8005AB5DA, + 1865001106253BB8005AB5DA, + 1865001206253BB8005AB5DA, + 1865001306253BB8005AB5DA, + 1865001406253BB8005AB5DA, + 1865001506253BB8005AB5DA, + 1865001606253BB8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865000F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "surface_quake2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001406253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001506253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865001706253BB8005AB5DA = { + children = ( + 1865001806253BB8005AB5DA, + 1865001906253BB8005AB5DA, + 1865001A06253BB8005AB5DA, + 1865001B06253BB8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865001806253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865001906253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865001A06253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865001B06253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865001C06253BB8005AB5DA = { + children = ( + 1865001D06253BB8005AB5DA, + 1865001E06253BB8005AB5DA, + 1865001F06253BB8005AB5DA, + 1865002006253BB8005AB5DA, + 1865002106253BB8005AB5DA, + 1865002206253BB8005AB5DA, + 1865002306253BB8005AB5DA, + 1865002406253BB8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865001D06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865001E06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865001F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_quake2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002406253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865002506253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = surface_quake2.def; + refType = 4; + sourceTree = ""; + }; + 1865002606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = surface_quake2.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865002706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfacedialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865002806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfacedialog.h; + refType = 4; + sourceTree = ""; + }; + 1865002906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfaceflagsdialog_quake2.cpp; + refType = 4; + sourceTree = ""; + }; + 1865002A06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfaceflagsdialog_quake2.h; + refType = 4; + sourceTree = ""; + }; + 1865002B06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfdlg_plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865002C06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfdlg_plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865002D06253BB8005AB5DA = { + children = ( + 1865002E06253BB8005AB5DA, + 1865002F06253BB8005AB5DA, + 1865003006253BB8005AB5DA, + 1865007706253BB9005AB5DA, + 1865007806253BB9005AB5DA, + 1865007906253BB9005AB5DA, + 1865007A06253BB9005AB5DA, + 1865007B06253BB9005AB5DA, + 1865007C06253BB9005AB5DA, + 1865009B06253BB9005AB5DA, + 1865009C06253BB9005AB5DA, + 1865009D06253BB9005AB5DA, + 1865009E06253BB9005AB5DA, + 1865009F06253BB9005AB5DA, + 186500A006253BB9005AB5DA, + 186500A106253BB9005AB5DA, + ); + isa = PBXGroup; + path = textool; + refType = 4; + sourceTree = ""; + }; + 1865002E06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865002F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865003006253BB8005AB5DA = { + children = ( + 1865003106253BB8005AB5DA, + 1865003206253BB8005AB5DA, + 1865003306253BB8005AB5DA, + 1865003406253BB8005AB5DA, + 1865003506253BB8005AB5DA, + 1865004406253BB8005AB5DA, + 1865005306253BB8005AB5DA, + 1865005406253BB8005AB5DA, + 1865006306253BB8005AB5DA, + 1865006806253BB9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865003106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865003206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865003306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865003406253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865003506253BB8005AB5DA = { + children = ( + 1865003606253BB8005AB5DA, + 1865003706253BB8005AB5DA, + 1865003806253BB8005AB5DA, + 1865003906253BB8005AB5DA, + 1865003A06253BB8005AB5DA, + 1865003B06253BB8005AB5DA, + 1865003C06253BB8005AB5DA, + 1865003D06253BB8005AB5DA, + 1865003E06253BB8005AB5DA, + 1865003F06253BB8005AB5DA, + 1865004006253BB8005AB5DA, + 1865004106253BB8005AB5DA, + 1865004206253BB8005AB5DA, + 1865004306253BB8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865003606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003A06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003B06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003C06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003D06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003E06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865003F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865004006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865004106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865004206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865004306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865004406253BB8005AB5DA = { + children = ( + 1865004506253BB8005AB5DA, + 1865004606253BB8005AB5DA, + 1865004706253BB8005AB5DA, + 1865004806253BB8005AB5DA, + 1865004906253BB8005AB5DA, + 1865004A06253BB8005AB5DA, + 1865004B06253BB8005AB5DA, + 1865004C06253BB8005AB5DA, + 1865004D06253BB8005AB5DA, + 1865004E06253BB8005AB5DA, + 1865004F06253BB8005AB5DA, + 1865005006253BB8005AB5DA, + 1865005106253BB8005AB5DA, + 1865005206253BB8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865004506253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004A06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004B06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004C06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004D06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004E06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865004F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865005006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865005106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865005206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865005306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865005406253BB8005AB5DA = { + children = ( + 1865005506253BB8005AB5DA, + 1865005606253BB8005AB5DA, + 1865005706253BB8005AB5DA, + 1865005806253BB8005AB5DA, + 1865005906253BB8005AB5DA, + 1865005A06253BB8005AB5DA, + 1865005B06253BB8005AB5DA, + 1865005C06253BB8005AB5DA, + 1865005D06253BB8005AB5DA, + 1865005E06253BB8005AB5DA, + 1865005F06253BB8005AB5DA, + 1865006006253BB8005AB5DA, + 1865006106253BB8005AB5DA, + 1865006206253BB8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865005506253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005606253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005A06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005B06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005C06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005D06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005E06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865005F06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865006006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865006106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865006206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "TexTool.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865006306253BB8005AB5DA = { + children = ( + 1865006406253BB8005AB5DA, + 1865006506253BB8005AB5DA, + 1865006606253BB8005AB5DA, + 1865006706253BB9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865006406253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865006506253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865006606253BB8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865006706253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865006806253BB9005AB5DA = { + children = ( + 1865006906253BB9005AB5DA, + 1865006A06253BB9005AB5DA, + 1865006B06253BB9005AB5DA, + 1865006C06253BB9005AB5DA, + 1865006D06253BB9005AB5DA, + 1865006E06253BB9005AB5DA, + 1865006F06253BB9005AB5DA, + 1865007006253BB9005AB5DA, + 1865007106253BB9005AB5DA, + 1865007206253BB9005AB5DA, + 1865007306253BB9005AB5DA, + 1865007406253BB9005AB5DA, + 1865007506253BB9005AB5DA, + 1865007606253BB9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865006906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006A06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006B06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006C06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "2DView.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006D06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006E06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865006F06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ControlPointsManager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007006253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007206253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007306253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865007706253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = 2DView.cpp; + refType = 4; + sourceTree = ""; + }; + 1865007806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = 2DView.h; + refType = 4; + sourceTree = ""; + }; + 1865007906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changelog.txt; + refType = 4; + sourceTree = ""; + }; + 1865007A06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = ControlPointsManager.cpp; + refType = 4; + sourceTree = ""; + }; + 1865007B06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ControlPointsManager.h; + refType = 4; + sourceTree = ""; + }; + 1865007C06253BB9005AB5DA = { + children = ( + 1865007D06253BB9005AB5DA, + 1865007E06253BB9005AB5DA, + 1865009906253BB9005AB5DA, + 1865009A06253BB9005AB5DA, + ); + isa = PBXGroup; + path = Doc; + refType = 4; + sourceTree = ""; + }; + 1865007D06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865007E06253BB9005AB5DA = { + children = ( + 1865007F06253BB9005AB5DA, + 1865008006253BB9005AB5DA, + 1865008106253BB9005AB5DA, + 1865008206253BB9005AB5DA, + 1865008306253BB9005AB5DA, + 1865008706253BB9005AB5DA, + 1865008B06253BB9005AB5DA, + 1865008C06253BB9005AB5DA, + 1865009006253BB9005AB5DA, + 1865009506253BB9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865007F06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865008006253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865008106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865008206253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865008306253BB9005AB5DA = { + children = ( + 1865008406253BB9005AB5DA, + 1865008506253BB9005AB5DA, + 1865008606253BB9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865008406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865008506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image2.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865008606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865008706253BB9005AB5DA = { + children = ( + 1865008806253BB9005AB5DA, + 1865008906253BB9005AB5DA, + 1865008A06253BB9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865008806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865008906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image2.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865008A06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865008B06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865008C06253BB9005AB5DA = { + children = ( + 1865008D06253BB9005AB5DA, + 1865008E06253BB9005AB5DA, + 1865008F06253BB9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865008D06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865008E06253BB9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "Image2.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865008F06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865009006253BB9005AB5DA = { + children = ( + 1865009106253BB9005AB5DA, + 1865009206253BB9005AB5DA, + 1865009306253BB9005AB5DA, + 1865009406253BB9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865009106253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865009206253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865009306253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865009406253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865009506253BB9005AB5DA = { + children = ( + 1865009606253BB9005AB5DA, + 1865009706253BB9005AB5DA, + 1865009806253BB9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865009606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865009706253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image2.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865009806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865009906253BB9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = Image2.jpg; + refType = 4; + sourceTree = ""; + }; + 1865009A06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = TexTool.html; + refType = 4; + sourceTree = ""; + }; + 1865009B06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resource.h; + refType = 4; + sourceTree = ""; + }; + 1865009C06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = StdAfx.cpp; + refType = 4; + sourceTree = ""; + }; + 1865009D06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = StdAfx.h; + refType = 4; + sourceTree = ""; + }; + 1865009E06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = TexTool.cpp; + refType = 4; + sourceTree = ""; + }; + 1865009F06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TexTool.def; + refType = 4; + sourceTree = ""; + }; + 186500A006253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TexTool.rc; + refType = 4; + sourceTree = ""; + }; + 186500A106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = TexTool.vcproj; + refType = 4; + sourceTree = ""; + }; + 186500A206253BB9005AB5DA = { + children = ( + 186500A306253BB9005AB5DA, + 186500CA06253BB9005AB5DA, + 186500CB06253BB9005AB5DA, + 186500CC06253BB9005AB5DA, + 186500CD06253BB9005AB5DA, + 186500CE06253BB9005AB5DA, + 186500CF06253BB9005AB5DA, + ); + isa = PBXGroup; + path = vfspak; + refType = 4; + sourceTree = ""; + }; + 186500A306253BB9005AB5DA = { + children = ( + 186500A406253BB9005AB5DA, + 186500A506253BB9005AB5DA, + 186500A606253BB9005AB5DA, + 186500A706253BB9005AB5DA, + 186500A806253BB9005AB5DA, + 186500AF06253BB9005AB5DA, + 186500B606253BB9005AB5DA, + 186500B706253BB9005AB5DA, + 186500BE06253BB9005AB5DA, + 186500C306253BB9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186500A406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186500A506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186500A606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186500A706253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186500A806253BB9005AB5DA = { + children = ( + 186500A906253BB9005AB5DA, + 186500AA06253BB9005AB5DA, + 186500AB06253BB9005AB5DA, + 186500AC06253BB9005AB5DA, + 186500AD06253BB9005AB5DA, + 186500AE06253BB9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186500A906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AA06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AB06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AC06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AD06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AE06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500AF06253BB9005AB5DA = { + children = ( + 186500B006253BB9005AB5DA, + 186500B106253BB9005AB5DA, + 186500B206253BB9005AB5DA, + 186500B306253BB9005AB5DA, + 186500B406253BB9005AB5DA, + 186500B506253BB9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186500B006253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B206253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B306253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500B606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186500B706253BB9005AB5DA = { + children = ( + 186500B806253BB9005AB5DA, + 186500B906253BB9005AB5DA, + 186500BA06253BB9005AB5DA, + 186500BB06253BB9005AB5DA, + 186500BC06253BB9005AB5DA, + 186500BD06253BB9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186500B806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500B906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500BA06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500BB06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500BC06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500BD06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "vfspak.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500BE06253BB9005AB5DA = { + children = ( + 186500BF06253BB9005AB5DA, + 186500C006253BB9005AB5DA, + 186500C106253BB9005AB5DA, + 186500C206253BB9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186500BF06253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186500C006253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186500C106253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186500C206253BB9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186500C306253BB9005AB5DA = { + children = ( + 186500C406253BB9005AB5DA, + 186500C506253BB9005AB5DA, + 186500C606253BB9005AB5DA, + 186500C706253BB9005AB5DA, + 186500C806253BB9005AB5DA, + 186500C906253BB9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186500C406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500C506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500C606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500C706253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500C806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500C906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspak.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500CA06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfs.cpp; + refType = 4; + sourceTree = ""; + }; + 186500CB06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfs.h; + refType = 4; + sourceTree = ""; + }; + 186500CC06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfspak.cpp; + refType = 4; + sourceTree = ""; + }; + 186500CD06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = vfspak.def; + refType = 4; + sourceTree = ""; + }; + 186500CE06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfspak.h; + refType = 4; + sourceTree = ""; + }; + 186500CF06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = vfspak.vcproj; + refType = 4; + sourceTree = ""; + }; + 186500D006253BB9005AB5DA = { + children = ( + 186500D106253BB9005AB5DA, + 186500D206253BB9005AB5DA, + 1865010906253BBA005AB5DA, + 1865010A06253BBA005AB5DA, + 1865010B06253BBA005AB5DA, + 1865010C06253BBA005AB5DA, + 1865010D06253BBA005AB5DA, + 1865010E06253BBA005AB5DA, + 1865010F06253BBA005AB5DA, + 1865011006253BBA005AB5DA, + 1865011106253BBA005AB5DA, + ); + isa = PBXGroup; + path = vfspk3; + refType = 4; + sourceTree = ""; + }; + 186500D106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 186500D206253BB9005AB5DA = { + children = ( + 186500D306253BB9005AB5DA, + 186500D406253BB9005AB5DA, + 186500D506253BB9005AB5DA, + 186500D606253BB9005AB5DA, + 186500D706253BB9005AB5DA, + 186500E206253BB9005AB5DA, + 186500ED06253BB9005AB5DA, + 186500EE06253BBA005AB5DA, + 186500F906253BBA005AB5DA, + 186500FE06253BBA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186500D306253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186500D406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186500D506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186500D606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186500D706253BB9005AB5DA = { + children = ( + 186500D806253BB9005AB5DA, + 186500D906253BB9005AB5DA, + 186500DA06253BB9005AB5DA, + 186500DB06253BB9005AB5DA, + 186500DC06253BB9005AB5DA, + 186500DD06253BB9005AB5DA, + 186500DE06253BB9005AB5DA, + 186500DF06253BB9005AB5DA, + 186500E006253BB9005AB5DA, + 186500E106253BB9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186500D806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500D906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip-vfspk3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DA06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DB06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DC06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DD06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DE06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500DF06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500E006253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500E106253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500E206253BB9005AB5DA = { + children = ( + 186500E306253BB9005AB5DA, + 186500E406253BB9005AB5DA, + 186500E506253BB9005AB5DA, + 186500E606253BB9005AB5DA, + 186500E706253BB9005AB5DA, + 186500E806253BB9005AB5DA, + 186500E906253BB9005AB5DA, + 186500EA06253BB9005AB5DA, + 186500EB06253BB9005AB5DA, + 186500EC06253BB9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186500E306253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E406253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip-vfspk3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E506253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E606253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E706253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E806253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500E906253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500EA06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500EB06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500EC06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186500ED06253BB9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186500EE06253BBA005AB5DA = { + children = ( + 186500EF06253BBA005AB5DA, + 186500F006253BBA005AB5DA, + 186500F106253BBA005AB5DA, + 186500F206253BBA005AB5DA, + 186500F306253BBA005AB5DA, + 186500F406253BBA005AB5DA, + 186500F506253BBA005AB5DA, + 186500F606253BBA005AB5DA, + 186500F706253BBA005AB5DA, + 186500F806253BBA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186500EF06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip-vfspk3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F206253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F706253BBA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "vfspk3.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F806253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "vfspk3.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186500F906253BBA005AB5DA = { + children = ( + 186500FA06253BBA005AB5DA, + 186500FB06253BBA005AB5DA, + 186500FC06253BBA005AB5DA, + 186500FD06253BBA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186500FA06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186500FB06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186500FC06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186500FD06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186500FE06253BBA005AB5DA = { + children = ( + 186500FF06253BBA005AB5DA, + 1865010006253BBA005AB5DA, + 1865010106253BBA005AB5DA, + 1865010206253BBA005AB5DA, + 1865010306253BBA005AB5DA, + 1865010406253BBA005AB5DA, + 1865010506253BBA005AB5DA, + 1865010606253BBA005AB5DA, + 1865010706253BBA005AB5DA, + 1865010806253BBA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186500FF06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip-vfspk3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010206253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010706253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010806253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865010906253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "unzip-vfspk3.h"; + refType = 4; + sourceTree = ""; + }; + 1865010A06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = unzip.cpp; + refType = 4; + sourceTree = ""; + }; + 1865010B06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865010C06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfs.h; + refType = 4; + sourceTree = ""; + }; + 1865010D06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfspk3.cpp; + refType = 4; + sourceTree = ""; + }; + 1865010E06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = vfspk3.def; + refType = 4; + sourceTree = ""; + }; + 1865010F06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfspk3.h; + refType = 4; + sourceTree = ""; + }; + 1865011006253BBA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = vfspk3.proj; + refType = 4; + sourceTree = ""; + }; + 1865011106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = vfspk3.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865011206253BBA005AB5DA = { + children = ( + 1865011306253BBA005AB5DA, + 1865014606253BBA005AB5DA, + 1865014706253BBA005AB5DA, + 1865014806253BBA005AB5DA, + 1865014906253BBA005AB5DA, + 1865014A06253BBA005AB5DA, + 1865014B06253BBA005AB5DA, + 1865014C06253BBA005AB5DA, + 1865014D06253BBA005AB5DA, + 1865014E06253BBA005AB5DA, + ); + isa = PBXGroup; + path = vfswad; + refType = 4; + sourceTree = ""; + }; + 1865011306253BBA005AB5DA = { + children = ( + 1865011406253BBA005AB5DA, + 1865011506253BBA005AB5DA, + 1865011606253BBA005AB5DA, + 1865011706253BBA005AB5DA, + 1865011806253BBA005AB5DA, + 1865012206253BBA005AB5DA, + 1865012C06253BBA005AB5DA, + 1865012D06253BBA005AB5DA, + 1865013706253BBA005AB5DA, + 1865013C06253BBA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865011406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865011506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865011606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865011706253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865011806253BBA005AB5DA = { + children = ( + 1865011906253BBA005AB5DA, + 1865011A06253BBA005AB5DA, + 1865011B06253BBA005AB5DA, + 1865011C06253BBA005AB5DA, + 1865011D06253BBA005AB5DA, + 1865011E06253BBA005AB5DA, + 1865011F06253BBA005AB5DA, + 1865012006253BBA005AB5DA, + 1865012106253BBA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865011906253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011A06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011B06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011C06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011D06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011E06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865011F06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865012006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865012106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865012206253BBA005AB5DA = { + children = ( + 1865012306253BBA005AB5DA, + 1865012406253BBA005AB5DA, + 1865012506253BBA005AB5DA, + 1865012606253BBA005AB5DA, + 1865012706253BBA005AB5DA, + 1865012806253BBA005AB5DA, + 1865012906253BBA005AB5DA, + 1865012A06253BBA005AB5DA, + 1865012B06253BBA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865012306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012706253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012806253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012906253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012A06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012B06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865012C06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865012D06253BBA005AB5DA = { + children = ( + 1865012E06253BBA005AB5DA, + 1865012F06253BBA005AB5DA, + 1865013006253BBA005AB5DA, + 1865013106253BBA005AB5DA, + 1865013206253BBA005AB5DA, + 1865013306253BBA005AB5DA, + 1865013406253BBA005AB5DA, + 1865013506253BBA005AB5DA, + 1865013606253BBA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865012E06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865012F06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013206253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "vfswad.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865013706253BBA005AB5DA = { + children = ( + 1865013806253BBA005AB5DA, + 1865013906253BBA005AB5DA, + 1865013A06253BBA005AB5DA, + 1865013B06253BBA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865013806253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865013906253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865013A06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865013B06253BBA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865013C06253BBA005AB5DA = { + children = ( + 1865013D06253BBA005AB5DA, + 1865013E06253BBA005AB5DA, + 1865013F06253BBA005AB5DA, + 1865014006253BBA005AB5DA, + 1865014106253BBA005AB5DA, + 1865014206253BBA005AB5DA, + 1865014306253BBA005AB5DA, + 1865014406253BBA005AB5DA, + 1865014506253BBA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865013D06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865013E06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unwad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865013F06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014106253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014206253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfswad.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865014606253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = unwad.cpp; + refType = 4; + sourceTree = ""; + }; + 1865014706253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = unwad.h; + refType = 4; + sourceTree = ""; + }; + 1865014806253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865014906253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfs.h; + refType = 4; + sourceTree = ""; + }; + 1865014A06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vfswad.cpp; + refType = 4; + sourceTree = ""; + }; + 1865014B06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = vfswad.def; + refType = 4; + sourceTree = ""; + }; + 1865014C06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfswad.h; + refType = 4; + sourceTree = ""; + }; + 1865014D06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = vfswad.txt; + refType = 4; + sourceTree = ""; + }; + 1865014E06253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = vfswad.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865014F06253BBA005AB5DA = { + children = ( + 1865015006253BBA005AB5DA, + 1865015106253BBA005AB5DA, + 1865030C06253BC1005AB5DA, + 1865041106253BC3005AB5DA, + 1865041206253BC3005AB5DA, + 1865041306253BC3005AB5DA, + 1865041406253BC3005AB5DA, + 1865041506253BC3005AB5DA, + 1865041606253BC3005AB5DA, + 1865041706253BC3005AB5DA, + 1865041806253BC3005AB5DA, + 1865041906253BC3005AB5DA, + 1865041A06253BC3005AB5DA, + 1865041B06253BC3005AB5DA, + 1865041C06253BC3005AB5DA, + 1865041D06253BC3005AB5DA, + 1865041E06253BC3005AB5DA, + 1865041F06253BC3005AB5DA, + 1865042006253BC3005AB5DA, + 1865042106253BC3005AB5DA, + 1865042206253BC3005AB5DA, + 1865042306253BC3005AB5DA, + 1865042406253BC3005AB5DA, + 1865042506253BC3005AB5DA, + 1865042606253BC3005AB5DA, + 1865042706253BC3005AB5DA, + 1865042806253BC3005AB5DA, + 1865042906253BC3005AB5DA, + 1865042A06253BC3005AB5DA, + 1865042B06253BC3005AB5DA, + 1865042C06253BC3005AB5DA, + 1865042D06253BC4005AB5DA, + 1865042E06253BC4005AB5DA, + 1865042F06253BC4005AB5DA, + 1865043006253BC4005AB5DA, + 1865043106253BC4005AB5DA, + 1865043206253BC4005AB5DA, + 1865043306253BC4005AB5DA, + 1865043406253BC4005AB5DA, + 1865043506253BC4005AB5DA, + 1865043606253BC4005AB5DA, + 1865043706253BC4005AB5DA, + 1865043806253BC4005AB5DA, + 1865043906253BC4005AB5DA, + 1865043A06253BC4005AB5DA, + 1865043B06253BC4005AB5DA, + 1865043C06253BC4005AB5DA, + 1865043D06253BC4005AB5DA, + 1865043E06253BC4005AB5DA, + 1865043F06253BC4005AB5DA, + 1865044006253BC4005AB5DA, + 1865044106253BC4005AB5DA, + 1865044206253BC4005AB5DA, + 1865044306253BC4005AB5DA, + 1865044406253BC4005AB5DA, + 1865044506253BC4005AB5DA, + 1865044606253BC4005AB5DA, + 1865044706253BC4005AB5DA, + 1865044806253BC4005AB5DA, + 1865044906253BC4005AB5DA, + 1865044A06253BC4005AB5DA, + 1865044B06253BC4005AB5DA, + 1865044C06253BC4005AB5DA, + 1865044D06253BC4005AB5DA, + 1865044E06253BC4005AB5DA, + 1865044F06253BC4005AB5DA, + 1865045006253BC4005AB5DA, + 1865045106253BC4005AB5DA, + 1865045206253BC4005AB5DA, + 1865045306253BC4005AB5DA, + 1865045406253BC4005AB5DA, + 1865045506253BC4005AB5DA, + 1865045606253BC4005AB5DA, + 1865045706253BC4005AB5DA, + 1865045806253BC4005AB5DA, + 1865045906253BC4005AB5DA, + 1865045A06253BC4005AB5DA, + 1865045B06253BC4005AB5DA, + 1865045C06253BC4005AB5DA, + 1865045D06253BC4005AB5DA, + 1865045E06253BC4005AB5DA, + 1865045F06253BC4005AB5DA, + 1865046006253BC4005AB5DA, + 1865046106253BC4005AB5DA, + 1865046206253BC4005AB5DA, + 1865046306253BC4005AB5DA, + 1865046406253BC4005AB5DA, + 1865046506253BC4005AB5DA, + 1865046606253BC4005AB5DA, + 1865046706253BC4005AB5DA, + 1865046806253BC4005AB5DA, + 1865046906253BC4005AB5DA, + 1865046A06253BC4005AB5DA, + 1865046B06253BC4005AB5DA, + 1865046C06253BC4005AB5DA, + 1865046D06253BC4005AB5DA, + 1865046E06253BC4005AB5DA, + 1865046F06253BC4005AB5DA, + 1865047006253BC4005AB5DA, + 1865047106253BC4005AB5DA, + 1865047206253BC4005AB5DA, + 1865047306253BC4005AB5DA, + 1865047406253BC4005AB5DA, + 1865047506253BC4005AB5DA, + 1865047606253BC4005AB5DA, + 1865047706253BC4005AB5DA, + 1865047806253BC4005AB5DA, + 1865047906253BC4005AB5DA, + 1865047A06253BC4005AB5DA, + ); + isa = PBXGroup; + path = radiant; + refType = 4; + sourceTree = ""; + }; + 1865015006253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865015106253BBA005AB5DA = { + children = ( + 1865015206253BBA005AB5DA, + 1865015306253BBA005AB5DA, + 1865015406253BBA005AB5DA, + 1865015506253BBA005AB5DA, + 1865015606253BBA005AB5DA, + 186501C206253BBC005AB5DA, + 1865022E06253BBD005AB5DA, + 1865022F06253BBD005AB5DA, + 1865029B06253BBF005AB5DA, + 186502A006253BBF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865015206253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865015306253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865015406253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865015506253BBA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865015606253BBA005AB5DA = { + children = ( + 1865015706253BBB005AB5DA, + 1865015806253BBB005AB5DA, + 1865015906253BBB005AB5DA, + 1865015A06253BBB005AB5DA, + 1865015B06253BBB005AB5DA, + 1865015C06253BBB005AB5DA, + 1865015D06253BBB005AB5DA, + 1865015E06253BBB005AB5DA, + 1865015F06253BBB005AB5DA, + 1865016006253BBB005AB5DA, + 1865016106253BBB005AB5DA, + 1865016206253BBB005AB5DA, + 1865016306253BBB005AB5DA, + 1865016406253BBB005AB5DA, + 1865016506253BBB005AB5DA, + 1865016606253BBB005AB5DA, + 1865016706253BBB005AB5DA, + 1865016806253BBB005AB5DA, + 1865016906253BBB005AB5DA, + 1865016A06253BBB005AB5DA, + 1865016B06253BBB005AB5DA, + 1865016C06253BBB005AB5DA, + 1865016D06253BBB005AB5DA, + 1865016E06253BBB005AB5DA, + 1865016F06253BBB005AB5DA, + 1865017006253BBB005AB5DA, + 1865017106253BBB005AB5DA, + 1865017206253BBB005AB5DA, + 1865017306253BBB005AB5DA, + 1865017406253BBB005AB5DA, + 1865017506253BBB005AB5DA, + 1865017606253BBB005AB5DA, + 1865017706253BBB005AB5DA, + 1865017806253BBB005AB5DA, + 1865017906253BBB005AB5DA, + 1865017A06253BBB005AB5DA, + 1865017B06253BBB005AB5DA, + 1865017C06253BBB005AB5DA, + 1865017D06253BBB005AB5DA, + 1865017E06253BBB005AB5DA, + 1865017F06253BBB005AB5DA, + 1865018006253BBB005AB5DA, + 1865018106253BBB005AB5DA, + 1865018206253BBB005AB5DA, + 1865018306253BBB005AB5DA, + 1865018406253BBB005AB5DA, + 1865018506253BBB005AB5DA, + 1865018606253BBB005AB5DA, + 1865018706253BBB005AB5DA, + 1865018806253BBB005AB5DA, + 1865018906253BBB005AB5DA, + 1865018A06253BBB005AB5DA, + 1865018B06253BBB005AB5DA, + 1865018C06253BBB005AB5DA, + 1865018D06253BBB005AB5DA, + 1865018E06253BBB005AB5DA, + 1865018F06253BBB005AB5DA, + 1865019006253BBB005AB5DA, + 1865019106253BBB005AB5DA, + 1865019206253BBB005AB5DA, + 1865019306253BBB005AB5DA, + 1865019406253BBB005AB5DA, + 1865019506253BBB005AB5DA, + 1865019606253BBB005AB5DA, + 1865019706253BBB005AB5DA, + 1865019806253BBB005AB5DA, + 1865019906253BBB005AB5DA, + 1865019A06253BBB005AB5DA, + 1865019B06253BBB005AB5DA, + 1865019C06253BBB005AB5DA, + 1865019D06253BBC005AB5DA, + 1865019E06253BBC005AB5DA, + 1865019F06253BBC005AB5DA, + 186501A006253BBC005AB5DA, + 186501A106253BBC005AB5DA, + 186501A206253BBC005AB5DA, + 186501A306253BBC005AB5DA, + 186501A406253BBC005AB5DA, + 186501A506253BBC005AB5DA, + 186501A606253BBC005AB5DA, + 186501A706253BBC005AB5DA, + 186501A806253BBC005AB5DA, + 186501A906253BBC005AB5DA, + 186501AA06253BBC005AB5DA, + 186501AB06253BBC005AB5DA, + 186501AC06253BBC005AB5DA, + 186501AD06253BBC005AB5DA, + 186501AE06253BBC005AB5DA, + 186501AF06253BBC005AB5DA, + 186501B006253BBC005AB5DA, + 186501B106253BBC005AB5DA, + 186501B206253BBC005AB5DA, + 186501B306253BBC005AB5DA, + 186501B406253BBC005AB5DA, + 186501B506253BBC005AB5DA, + 186501B606253BBC005AB5DA, + 186501B706253BBC005AB5DA, + 186501B806253BBC005AB5DA, + 186501B906253BBC005AB5DA, + 186501BA06253BBC005AB5DA, + 186501BB06253BBC005AB5DA, + 186501BC06253BBC005AB5DA, + 186501BD06253BBC005AB5DA, + 186501BE06253BBC005AB5DA, + 186501BF06253BBC005AB5DA, + 186501C006253BBC005AB5DA, + 186501C106253BBC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865015706253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015806253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bp_dlg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015906253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015A06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015B06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015C06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushscript.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015D06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015E06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865015F06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016006253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016106253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016206253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016306253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialoginfo.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016406253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "drag.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016506253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016606253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016706253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016806253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "error.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016906253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016A06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016B06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016C06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016D06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016E06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865016F06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017006253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017106253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glinterface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017206253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017306253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017406253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017506253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017606253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017706253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017806253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017906253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017A06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017B06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017C06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017D06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017E06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865017F06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018006253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018106253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018206253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018306253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018406253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018506253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Makefile.mac.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018606253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018706253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018806253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018906253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018A06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018B06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018C06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018D06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018E06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginentities.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865018F06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019006253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019106253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pmesh.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019206253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019306253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019406253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019506253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019606253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "profile.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019706253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019806253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019906253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qedefs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019A06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019B06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl-mac.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019C06253BBB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019D06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019E06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl_ext.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865019F06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "queuedraw.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A006253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A106253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A206253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A306253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A406253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A506253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selectedface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A606253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A706253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A806253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501A906253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AA06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AB06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AC06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "targetname.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AD06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AE06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501AF06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B006253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B106253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B206253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B306253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B406253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B506253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B606253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vertsel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B706253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B806253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501B906253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BA06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BB06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlstuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BC06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BD06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BE06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501BF06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501C006253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501C106253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186501C206253BBC005AB5DA = { + children = ( + 186501C306253BBC005AB5DA, + 186501C406253BBC005AB5DA, + 186501C506253BBC005AB5DA, + 186501C606253BBC005AB5DA, + 186501C706253BBC005AB5DA, + 186501C806253BBC005AB5DA, + 186501C906253BBC005AB5DA, + 186501CA06253BBC005AB5DA, + 186501CB06253BBC005AB5DA, + 186501CC06253BBC005AB5DA, + 186501CD06253BBC005AB5DA, + 186501CE06253BBC005AB5DA, + 186501CF06253BBC005AB5DA, + 186501D006253BBC005AB5DA, + 186501D106253BBC005AB5DA, + 186501D206253BBC005AB5DA, + 186501D306253BBC005AB5DA, + 186501D406253BBC005AB5DA, + 186501D506253BBC005AB5DA, + 186501D606253BBC005AB5DA, + 186501D706253BBC005AB5DA, + 186501D806253BBC005AB5DA, + 186501D906253BBC005AB5DA, + 186501DA06253BBC005AB5DA, + 186501DB06253BBC005AB5DA, + 186501DC06253BBC005AB5DA, + 186501DD06253BBC005AB5DA, + 186501DE06253BBC005AB5DA, + 186501DF06253BBC005AB5DA, + 186501E006253BBC005AB5DA, + 186501E106253BBC005AB5DA, + 186501E206253BBC005AB5DA, + 186501E306253BBC005AB5DA, + 186501E406253BBC005AB5DA, + 186501E506253BBC005AB5DA, + 186501E606253BBC005AB5DA, + 186501E706253BBC005AB5DA, + 186501E806253BBC005AB5DA, + 186501E906253BBC005AB5DA, + 186501EA06253BBD005AB5DA, + 186501EB06253BBD005AB5DA, + 186501EC06253BBD005AB5DA, + 186501ED06253BBD005AB5DA, + 186501EE06253BBD005AB5DA, + 186501EF06253BBD005AB5DA, + 186501F006253BBD005AB5DA, + 186501F106253BBD005AB5DA, + 186501F206253BBD005AB5DA, + 186501F306253BBD005AB5DA, + 186501F406253BBD005AB5DA, + 186501F506253BBD005AB5DA, + 186501F606253BBD005AB5DA, + 186501F706253BBD005AB5DA, + 186501F806253BBD005AB5DA, + 186501F906253BBD005AB5DA, + 186501FA06253BBD005AB5DA, + 186501FB06253BBD005AB5DA, + 186501FC06253BBD005AB5DA, + 186501FD06253BBD005AB5DA, + 186501FE06253BBD005AB5DA, + 186501FF06253BBD005AB5DA, + 1865020006253BBD005AB5DA, + 1865020106253BBD005AB5DA, + 1865020206253BBD005AB5DA, + 1865020306253BBD005AB5DA, + 1865020406253BBD005AB5DA, + 1865020506253BBD005AB5DA, + 1865020606253BBD005AB5DA, + 1865020706253BBD005AB5DA, + 1865020806253BBD005AB5DA, + 1865020906253BBD005AB5DA, + 1865020A06253BBD005AB5DA, + 1865020B06253BBD005AB5DA, + 1865020C06253BBD005AB5DA, + 1865020D06253BBD005AB5DA, + 1865020E06253BBD005AB5DA, + 1865020F06253BBD005AB5DA, + 1865021006253BBD005AB5DA, + 1865021106253BBD005AB5DA, + 1865021206253BBD005AB5DA, + 1865021306253BBD005AB5DA, + 1865021406253BBD005AB5DA, + 1865021506253BBD005AB5DA, + 1865021606253BBD005AB5DA, + 1865021706253BBD005AB5DA, + 1865021806253BBD005AB5DA, + 1865021906253BBD005AB5DA, + 1865021A06253BBD005AB5DA, + 1865021B06253BBD005AB5DA, + 1865021C06253BBD005AB5DA, + 1865021D06253BBD005AB5DA, + 1865021E06253BBD005AB5DA, + 1865021F06253BBD005AB5DA, + 1865022006253BBD005AB5DA, + 1865022106253BBD005AB5DA, + 1865022206253BBD005AB5DA, + 1865022306253BBD005AB5DA, + 1865022406253BBD005AB5DA, + 1865022506253BBD005AB5DA, + 1865022606253BBD005AB5DA, + 1865022706253BBD005AB5DA, + 1865022806253BBD005AB5DA, + 1865022906253BBD005AB5DA, + 1865022A06253BBD005AB5DA, + 1865022B06253BBD005AB5DA, + 1865022C06253BBD005AB5DA, + 1865022D06253BBD005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186501C306253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C406253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bp_dlg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C506253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C606253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C706253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C806253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushscript.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501C906253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CA06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CB06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CC06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CD06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CE06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501CF06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialoginfo.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D006253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "drag.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D106253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D206253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D306253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D406253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "error.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D506253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D606253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D706253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D806253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501D906253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DA06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DB06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DC06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DD06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glinterface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DE06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501DF06253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E006253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E106253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E206253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E306253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E406253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E506253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E606253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E706253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E806253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501E906253BBC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501EA06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501EB06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501EC06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501ED06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501EE06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501EF06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Makefile.mac.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501F906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FA06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginentities.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FB06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FC06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FD06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pmesh.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FE06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186501FF06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "profile.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qedefs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl-mac.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020A06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl_ext.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020B06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "queuedraw.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020C06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020D06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020E06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865020F06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selectedface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "targetname.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021A06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021B06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021C06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021D06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021E06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865021F06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vertsel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlstuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022A06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022B06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022C06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022D06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865022E06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865022F06253BBD005AB5DA = { + children = ( + 1865023006253BBD005AB5DA, + 1865023106253BBD005AB5DA, + 1865023206253BBD005AB5DA, + 1865023306253BBD005AB5DA, + 1865023406253BBD005AB5DA, + 1865023506253BBD005AB5DA, + 1865023606253BBD005AB5DA, + 1865023706253BBD005AB5DA, + 1865023806253BBD005AB5DA, + 1865023906253BBD005AB5DA, + 1865023A06253BBD005AB5DA, + 1865023B06253BBD005AB5DA, + 1865023C06253BBD005AB5DA, + 1865023D06253BBD005AB5DA, + 1865023E06253BBD005AB5DA, + 1865023F06253BBD005AB5DA, + 1865024006253BBD005AB5DA, + 1865024106253BBD005AB5DA, + 1865024206253BBD005AB5DA, + 1865024306253BBD005AB5DA, + 1865024406253BBD005AB5DA, + 1865024506253BBD005AB5DA, + 1865024606253BBD005AB5DA, + 1865024706253BBD005AB5DA, + 1865024806253BBD005AB5DA, + 1865024906253BBD005AB5DA, + 1865024A06253BBD005AB5DA, + 1865024B06253BBE005AB5DA, + 1865024C06253BBE005AB5DA, + 1865024D06253BBE005AB5DA, + 1865024E06253BBE005AB5DA, + 1865024F06253BBE005AB5DA, + 1865025006253BBE005AB5DA, + 1865025106253BBE005AB5DA, + 1865025206253BBE005AB5DA, + 1865025306253BBE005AB5DA, + 1865025406253BBE005AB5DA, + 1865025506253BBE005AB5DA, + 1865025606253BBE005AB5DA, + 1865025706253BBE005AB5DA, + 1865025806253BBE005AB5DA, + 1865025906253BBE005AB5DA, + 1865025A06253BBE005AB5DA, + 1865025B06253BBE005AB5DA, + 1865025C06253BBE005AB5DA, + 1865025D06253BBE005AB5DA, + 1865025E06253BBE005AB5DA, + 1865025F06253BBE005AB5DA, + 1865026006253BBE005AB5DA, + 1865026106253BBE005AB5DA, + 1865026206253BBE005AB5DA, + 1865026306253BBE005AB5DA, + 1865026406253BBE005AB5DA, + 1865026506253BBE005AB5DA, + 1865026606253BBE005AB5DA, + 1865026706253BBE005AB5DA, + 1865026806253BBF005AB5DA, + 1865026906253BBF005AB5DA, + 1865026A06253BBF005AB5DA, + 1865026B06253BBF005AB5DA, + 1865026C06253BBF005AB5DA, + 1865026D06253BBF005AB5DA, + 1865026E06253BBF005AB5DA, + 1865026F06253BBF005AB5DA, + 1865027006253BBF005AB5DA, + 1865027106253BBF005AB5DA, + 1865027206253BBF005AB5DA, + 1865027306253BBF005AB5DA, + 1865027406253BBF005AB5DA, + 1865027506253BBF005AB5DA, + 1865027606253BBF005AB5DA, + 1865027706253BBF005AB5DA, + 1865027806253BBF005AB5DA, + 1865027906253BBF005AB5DA, + 1865027A06253BBF005AB5DA, + 1865027B06253BBF005AB5DA, + 1865027C06253BBF005AB5DA, + 1865027D06253BBF005AB5DA, + 1865027E06253BBF005AB5DA, + 1865027F06253BBF005AB5DA, + 1865028006253BBF005AB5DA, + 1865028106253BBF005AB5DA, + 1865028206253BBF005AB5DA, + 1865028306253BBF005AB5DA, + 1865028406253BBF005AB5DA, + 1865028506253BBF005AB5DA, + 1865028606253BBF005AB5DA, + 1865028706253BBF005AB5DA, + 1865028806253BBF005AB5DA, + 1865028906253BBF005AB5DA, + 1865028A06253BBF005AB5DA, + 1865028B06253BBF005AB5DA, + 1865028C06253BBF005AB5DA, + 1865028D06253BBF005AB5DA, + 1865028E06253BBF005AB5DA, + 1865028F06253BBF005AB5DA, + 1865029006253BBF005AB5DA, + 1865029106253BBF005AB5DA, + 1865029206253BBF005AB5DA, + 1865029306253BBF005AB5DA, + 1865029406253BBF005AB5DA, + 1865029506253BBF005AB5DA, + 1865029606253BBF005AB5DA, + 1865029706253BBF005AB5DA, + 1865029806253BBF005AB5DA, + 1865029906253BBF005AB5DA, + 1865029A06253BBF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865023006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bp_dlg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushscript.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023A06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023B06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023C06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialoginfo.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023D06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "drag.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023E06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865023F06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024006253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024106253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "error.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024206253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024306253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024406253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024506253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024606253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024706253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024806253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024906253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024A06253BBD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glinterface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024B06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024C06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024D06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024E06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865024F06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025006253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025106253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025206253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025306253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025406253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025506253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025606253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025706253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025806253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025906253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025A06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "GtkRadiant.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025B06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025C06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025D06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025E06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Makefile.mac.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865025F06253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026006253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026106253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026206253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026306253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026406253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026506253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026606253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026706253BBE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginentities.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026806253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026906253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026A06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pmesh.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026B06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026C06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026D06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026E06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865026F06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "profile.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027006253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027106253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027206253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qedefs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027306253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027406253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl-mac.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027506253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027606253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027706253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl_ext.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027806253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "queuedraw.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027906253BBF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "radiant.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027A06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027B06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027C06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027D06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027E06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selectedface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865027F06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028006253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028106253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028206253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028306253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028406253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028506253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "targetname.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028606253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028706253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028806253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028906253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028A06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028B06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028C06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028D06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028E06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865028F06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vertsel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029006253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029106253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029206253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029306253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029406253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlstuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029506253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029606253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029706253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029806253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029906253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029A06253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865029B06253BBF005AB5DA = { + children = ( + 1865029C06253BBF005AB5DA, + 1865029D06253BBF005AB5DA, + 1865029E06253BBF005AB5DA, + 1865029F06253BBF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865029C06253BBF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865029D06253BBF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865029E06253BBF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865029F06253BBF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186502A006253BBF005AB5DA = { + children = ( + 186502A106253BBF005AB5DA, + 186502A206253BBF005AB5DA, + 186502A306253BBF005AB5DA, + 186502A406253BBF005AB5DA, + 186502A506253BBF005AB5DA, + 186502A606253BBF005AB5DA, + 186502A706253BBF005AB5DA, + 186502A806253BBF005AB5DA, + 186502A906253BC0005AB5DA, + 186502AA06253BC0005AB5DA, + 186502AB06253BC0005AB5DA, + 186502AC06253BC0005AB5DA, + 186502AD06253BC0005AB5DA, + 186502AE06253BC0005AB5DA, + 186502AF06253BC0005AB5DA, + 186502B006253BC0005AB5DA, + 186502B106253BC0005AB5DA, + 186502B206253BC0005AB5DA, + 186502B306253BC0005AB5DA, + 186502B406253BC0005AB5DA, + 186502B506253BC0005AB5DA, + 186502B606253BC0005AB5DA, + 186502B706253BC0005AB5DA, + 186502B806253BC0005AB5DA, + 186502B906253BC0005AB5DA, + 186502BA06253BC0005AB5DA, + 186502BB06253BC0005AB5DA, + 186502BC06253BC0005AB5DA, + 186502BD06253BC0005AB5DA, + 186502BE06253BC0005AB5DA, + 186502BF06253BC0005AB5DA, + 186502C006253BC0005AB5DA, + 186502C106253BC0005AB5DA, + 186502C206253BC0005AB5DA, + 186502C306253BC0005AB5DA, + 186502C406253BC0005AB5DA, + 186502C506253BC0005AB5DA, + 186502C606253BC0005AB5DA, + 186502C706253BC0005AB5DA, + 186502C806253BC0005AB5DA, + 186502C906253BC0005AB5DA, + 186502CA06253BC0005AB5DA, + 186502CB06253BC0005AB5DA, + 186502CC06253BC0005AB5DA, + 186502CD06253BC0005AB5DA, + 186502CE06253BC0005AB5DA, + 186502CF06253BC0005AB5DA, + 186502D006253BC0005AB5DA, + 186502D106253BC0005AB5DA, + 186502D206253BC0005AB5DA, + 186502D306253BC0005AB5DA, + 186502D406253BC0005AB5DA, + 186502D506253BC0005AB5DA, + 186502D606253BC0005AB5DA, + 186502D706253BC0005AB5DA, + 186502D806253BC0005AB5DA, + 186502D906253BC0005AB5DA, + 186502DA06253BC0005AB5DA, + 186502DB06253BC0005AB5DA, + 186502DC06253BC0005AB5DA, + 186502DD06253BC0005AB5DA, + 186502DE06253BC0005AB5DA, + 186502DF06253BC0005AB5DA, + 186502E006253BC0005AB5DA, + 186502E106253BC0005AB5DA, + 186502E206253BC1005AB5DA, + 186502E306253BC1005AB5DA, + 186502E406253BC1005AB5DA, + 186502E506253BC1005AB5DA, + 186502E606253BC1005AB5DA, + 186502E706253BC1005AB5DA, + 186502E806253BC1005AB5DA, + 186502E906253BC1005AB5DA, + 186502EA06253BC1005AB5DA, + 186502EB06253BC1005AB5DA, + 186502EC06253BC1005AB5DA, + 186502ED06253BC1005AB5DA, + 186502EE06253BC1005AB5DA, + 186502EF06253BC1005AB5DA, + 186502F006253BC1005AB5DA, + 186502F106253BC1005AB5DA, + 186502F206253BC1005AB5DA, + 186502F306253BC1005AB5DA, + 186502F406253BC1005AB5DA, + 186502F506253BC1005AB5DA, + 186502F606253BC1005AB5DA, + 186502F706253BC1005AB5DA, + 186502F806253BC1005AB5DA, + 186502F906253BC1005AB5DA, + 186502FA06253BC1005AB5DA, + 186502FB06253BC1005AB5DA, + 186502FC06253BC1005AB5DA, + 186502FD06253BC1005AB5DA, + 186502FE06253BC1005AB5DA, + 186502FF06253BC1005AB5DA, + 1865030006253BC1005AB5DA, + 1865030106253BC1005AB5DA, + 1865030206253BC1005AB5DA, + 1865030306253BC1005AB5DA, + 1865030406253BC1005AB5DA, + 1865030506253BC1005AB5DA, + 1865030606253BC1005AB5DA, + 1865030706253BC1005AB5DA, + 1865030806253BC1005AB5DA, + 1865030906253BC1005AB5DA, + 1865030A06253BC1005AB5DA, + 1865030B06253BC1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186502A106253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A206253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bp_dlg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A306253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A406253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A506253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A606253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushscript.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A706253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A806253BBF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502A906253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AA06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AB06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AC06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AD06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialoginfo.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AE06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "drag.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502AF06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B006253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B106253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclass_def.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B206253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "error.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B306253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B406253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "feedback.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B506253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B606253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B706253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B806253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "filters.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502B906253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BA06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "findtexturedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BB06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glinterface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BC06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BD06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwidget.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BE06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502BF06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C006253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C106253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "groupdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C206253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C306253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C406253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-darwin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C506253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C606253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel-linux.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C706253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C806253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkfilesel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502C906253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CA06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkmisc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CB06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CC06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CD06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CE06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mainframe.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502CF06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Makefile.mac.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D006253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D106253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D206253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D306253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D406253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D506253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D606253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patchdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D706253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D806253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginentities.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502D906253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DA06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pluginmanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DB06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pmesh.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DC06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DD06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "points.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DE06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502DF06253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preferences.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E006253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "profile.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E106253BC0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E206253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qe3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qedefs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl-mac.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qgl_ext.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502E906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "queuedraw.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502EA06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502EB06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502EC06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502ED06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502EE06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502EF06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selectedface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F006253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F106253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F206253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "targetname.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texmanip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502F906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FA06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FB06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "texwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FC06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FD06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ui.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FE06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186502FF06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "undo.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030006253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vertsel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030106253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030206253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "watchbsp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "winding.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlstuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xywindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "z.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030A06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030B06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "zwindow.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865030C06253BC1005AB5DA = { + children = ( + 1865030D06253BC1005AB5DA, + 186503E006253BC3005AB5DA, + 186503E106253BC3005AB5DA, + 186503E206253BC3005AB5DA, + 186503E306253BC3005AB5DA, + 186503E406253BC3005AB5DA, + 186503E506253BC3005AB5DA, + 186503E606253BC3005AB5DA, + 186503E706253BC3005AB5DA, + 186503E806253BC3005AB5DA, + 186503E906253BC3005AB5DA, + 186503EA06253BC3005AB5DA, + 186503EB06253BC3005AB5DA, + 186503EC06253BC3005AB5DA, + 186503ED06253BC3005AB5DA, + 186503EE06253BC3005AB5DA, + 186503EF06253BC3005AB5DA, + 186503F006253BC3005AB5DA, + 186503F106253BC3005AB5DA, + 186503F206253BC3005AB5DA, + 186503F306253BC3005AB5DA, + 186503F406253BC3005AB5DA, + 186503F506253BC3005AB5DA, + 186503F606253BC3005AB5DA, + 186503F706253BC3005AB5DA, + 186503F806253BC3005AB5DA, + 186503F906253BC3005AB5DA, + 186503FA06253BC3005AB5DA, + 186503FB06253BC3005AB5DA, + 186503FC06253BC3005AB5DA, + 186503FD06253BC3005AB5DA, + 186503FE06253BC3005AB5DA, + 186503FF06253BC3005AB5DA, + 1865040006253BC3005AB5DA, + 1865040106253BC3005AB5DA, + 1865040206253BC3005AB5DA, + 1865040306253BC3005AB5DA, + 1865040406253BC3005AB5DA, + 1865040506253BC3005AB5DA, + 1865040606253BC3005AB5DA, + 1865040706253BC3005AB5DA, + 1865040806253BC3005AB5DA, + 1865040906253BC3005AB5DA, + 1865040A06253BC3005AB5DA, + 1865040B06253BC3005AB5DA, + 1865040C06253BC3005AB5DA, + 1865040D06253BC3005AB5DA, + 1865040E06253BC3005AB5DA, + 1865040F06253BC3005AB5DA, + 1865041006253BC3005AB5DA, + ); + isa = PBXGroup; + path = bitmaps; + refType = 4; + sourceTree = ""; + }; + 1865030D06253BC1005AB5DA = { + children = ( + 1865030E06253BC1005AB5DA, + 1865030F06253BC1005AB5DA, + 1865031006253BC1005AB5DA, + 1865031106253BC1005AB5DA, + 1865031206253BC1005AB5DA, + 1865034406253BC2005AB5DA, + 1865037606253BC2005AB5DA, + 1865037706253BC2005AB5DA, + 186503A906253BC3005AB5DA, + 186503AE06253BC3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865030E06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865030F06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865031006253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865031106253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865031206253BC1005AB5DA = { + children = ( + 1865031306253BC1005AB5DA, + 1865031406253BC1005AB5DA, + 1865031506253BC1005AB5DA, + 1865031606253BC1005AB5DA, + 1865031706253BC1005AB5DA, + 1865031806253BC1005AB5DA, + 1865031906253BC1005AB5DA, + 1865031A06253BC1005AB5DA, + 1865031B06253BC1005AB5DA, + 1865031C06253BC1005AB5DA, + 1865031D06253BC1005AB5DA, + 1865031E06253BC1005AB5DA, + 1865031F06253BC1005AB5DA, + 1865032006253BC1005AB5DA, + 1865032106253BC1005AB5DA, + 1865032206253BC1005AB5DA, + 1865032306253BC1005AB5DA, + 1865032406253BC1005AB5DA, + 1865032506253BC1005AB5DA, + 1865032606253BC1005AB5DA, + 1865032706253BC1005AB5DA, + 1865032806253BC1005AB5DA, + 1865032906253BC1005AB5DA, + 1865032A06253BC1005AB5DA, + 1865032B06253BC1005AB5DA, + 1865032C06253BC1005AB5DA, + 1865032D06253BC1005AB5DA, + 1865032E06253BC1005AB5DA, + 1865032F06253BC1005AB5DA, + 1865033006253BC1005AB5DA, + 1865033106253BC1005AB5DA, + 1865033206253BC1005AB5DA, + 1865033306253BC1005AB5DA, + 1865033406253BC1005AB5DA, + 1865033506253BC1005AB5DA, + 1865033606253BC1005AB5DA, + 1865033706253BC1005AB5DA, + 1865033806253BC1005AB5DA, + 1865033906253BC1005AB5DA, + 1865033A06253BC1005AB5DA, + 1865033B06253BC1005AB5DA, + 1865033C06253BC1005AB5DA, + 1865033D06253BC1005AB5DA, + 1865033E06253BC1005AB5DA, + 1865033F06253BC1005AB5DA, + 1865034006253BC2005AB5DA, + 1865034106253BC2005AB5DA, + 1865034206253BC2005AB5DA, + 1865034306253BC2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865031306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipx.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipy.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipz.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatex.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatey.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatez.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_bevel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031A06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_endcap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031B06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_ibevel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031C06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_iendcap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031D06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curve_cap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031E06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectcurve.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865031F06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectmodel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032006253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_open.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032106253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_save.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032206253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_bend.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_drilldown.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_insdel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_showboundingbox.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_weld.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_wireframe.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032A06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "popup_selection.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032B06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockx.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032C06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelocky.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032D06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockz.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032E06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mouserotate.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865032F06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mousescale.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033006253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgmerge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033106253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgsubtract.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033206253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_makehollow.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033306253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectcompletetall.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033406253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectinside.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033506253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectpartialtall.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033606253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selecttouching.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033706253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "show_entities.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033806253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033906253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures_popup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033A06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameratoggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033B06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameraupdate.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033C06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_change.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033D06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_clipper.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033E06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cubicclipping.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865033F06253BC1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_entity.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865034006253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window1.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865034106253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window2.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865034206253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window3.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865034306253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window4.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865034406253BC2005AB5DA = { + children = ( + 1865034506253BC2005AB5DA, + 1865034606253BC2005AB5DA, + 1865034706253BC2005AB5DA, + 1865034806253BC2005AB5DA, + 1865034906253BC2005AB5DA, + 1865034A06253BC2005AB5DA, + 1865034B06253BC2005AB5DA, + 1865034C06253BC2005AB5DA, + 1865034D06253BC2005AB5DA, + 1865034E06253BC2005AB5DA, + 1865034F06253BC2005AB5DA, + 1865035006253BC2005AB5DA, + 1865035106253BC2005AB5DA, + 1865035206253BC2005AB5DA, + 1865035306253BC2005AB5DA, + 1865035406253BC2005AB5DA, + 1865035506253BC2005AB5DA, + 1865035606253BC2005AB5DA, + 1865035706253BC2005AB5DA, + 1865035806253BC2005AB5DA, + 1865035906253BC2005AB5DA, + 1865035A06253BC2005AB5DA, + 1865035B06253BC2005AB5DA, + 1865035C06253BC2005AB5DA, + 1865035D06253BC2005AB5DA, + 1865035E06253BC2005AB5DA, + 1865035F06253BC2005AB5DA, + 1865036006253BC2005AB5DA, + 1865036106253BC2005AB5DA, + 1865036206253BC2005AB5DA, + 1865036306253BC2005AB5DA, + 1865036406253BC2005AB5DA, + 1865036506253BC2005AB5DA, + 1865036606253BC2005AB5DA, + 1865036706253BC2005AB5DA, + 1865036806253BC2005AB5DA, + 1865036906253BC2005AB5DA, + 1865036A06253BC2005AB5DA, + 1865036B06253BC2005AB5DA, + 1865036C06253BC2005AB5DA, + 1865036D06253BC2005AB5DA, + 1865036E06253BC2005AB5DA, + 1865036F06253BC2005AB5DA, + 1865037006253BC2005AB5DA, + 1865037106253BC2005AB5DA, + 1865037206253BC2005AB5DA, + 1865037306253BC2005AB5DA, + 1865037406253BC2005AB5DA, + 1865037506253BC2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865034506253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipx.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034606253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipy.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034706253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipz.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034806253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatex.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034906253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatey.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034A06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatez.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034B06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_bevel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034C06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_endcap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034D06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_ibevel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034E06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_iendcap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865034F06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curve_cap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035006253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectcurve.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035106253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectmodel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035206253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_open.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035306253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_save.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035406253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035506253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035606253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_bend.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035706253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_drilldown.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035806253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_insdel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035906253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_showboundingbox.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035A06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_weld.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035B06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_wireframe.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035C06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "popup_selection.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035D06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockx.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035E06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelocky.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865035F06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockz.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036006253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mouserotate.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036106253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mousescale.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036206253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgmerge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036306253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgsubtract.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036406253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_makehollow.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036506253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectcompletetall.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036606253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectinside.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036706253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectpartialtall.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036806253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selecttouching.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036906253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "show_entities.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036A06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036B06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures_popup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036C06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameratoggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036D06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameraupdate.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036E06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_change.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865036F06253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_clipper.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037006253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cubicclipping.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037106253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_entity.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037206253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window1.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037306253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window2.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037406253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window3.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037506253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window4.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865037606253BC2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865037706253BC2005AB5DA = { + children = ( + 1865037806253BC2005AB5DA, + 1865037906253BC2005AB5DA, + 1865037A06253BC2005AB5DA, + 1865037B06253BC2005AB5DA, + 1865037C06253BC2005AB5DA, + 1865037D06253BC2005AB5DA, + 1865037E06253BC2005AB5DA, + 1865037F06253BC2005AB5DA, + 1865038006253BC2005AB5DA, + 1865038106253BC2005AB5DA, + 1865038206253BC2005AB5DA, + 1865038306253BC2005AB5DA, + 1865038406253BC2005AB5DA, + 1865038506253BC2005AB5DA, + 1865038606253BC2005AB5DA, + 1865038706253BC2005AB5DA, + 1865038806253BC2005AB5DA, + 1865038906253BC2005AB5DA, + 1865038A06253BC2005AB5DA, + 1865038B06253BC2005AB5DA, + 1865038C06253BC2005AB5DA, + 1865038D06253BC2005AB5DA, + 1865038E06253BC2005AB5DA, + 1865038F06253BC2005AB5DA, + 1865039006253BC2005AB5DA, + 1865039106253BC2005AB5DA, + 1865039206253BC2005AB5DA, + 1865039306253BC2005AB5DA, + 1865039406253BC2005AB5DA, + 1865039506253BC2005AB5DA, + 1865039606253BC2005AB5DA, + 1865039706253BC2005AB5DA, + 1865039806253BC2005AB5DA, + 1865039906253BC2005AB5DA, + 1865039A06253BC2005AB5DA, + 1865039B06253BC2005AB5DA, + 1865039C06253BC2005AB5DA, + 1865039D06253BC2005AB5DA, + 1865039E06253BC2005AB5DA, + 1865039F06253BC2005AB5DA, + 186503A006253BC2005AB5DA, + 186503A106253BC2005AB5DA, + 186503A206253BC2005AB5DA, + 186503A306253BC2005AB5DA, + 186503A406253BC2005AB5DA, + 186503A506253BC2005AB5DA, + 186503A606253BC2005AB5DA, + 186503A706253BC2005AB5DA, + 186503A806253BC2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865037806253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_flipx.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037906253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_flipy.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037A06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_flipz.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037B06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_rotatex.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037C06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_rotatey.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037D06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "brush_rotatez.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037E06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "cap_bevel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865037F06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "cap_endcap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038006253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "cap_ibevel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038106253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "cap_iendcap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038206253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "curve_cap.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038306253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "dontselectcurve.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038406253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "dontselectmodel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038506253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "file_open.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038606253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "file_save.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038706253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "icon.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038806253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "logo.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038906253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_bend.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038A06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_drilldown.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038B06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_insdel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038C06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_showboundingbox.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038D06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_weld.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038E06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "patch_wireframe.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865038F06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "popup_selection.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039006253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "scalelockx.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039106253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "scalelocky.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039206253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "scalelockz.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039306253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "select_mouserotate.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039406253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "select_mousescale.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039506253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_csgmerge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039606253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_csgsubtract.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039706253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_makehollow.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039806253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_selectcompletetall.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039906253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_selectinside.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039A06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_selectpartialtall.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039B06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "selection_selecttouching.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039C06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "show_entities.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039D06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "splash.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039E06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "textures_popup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865039F06253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_cameratoggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A006253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_cameraupdate.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A106253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_change.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A206253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_clipper.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A306253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_cubicclipping.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A406253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "view_entity.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A506253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "window1.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A606253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "window2.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A706253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "window3.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A806253BC2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "window4.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186503A906253BC3005AB5DA = { + children = ( + 186503AA06253BC3005AB5DA, + 186503AB06253BC3005AB5DA, + 186503AC06253BC3005AB5DA, + 186503AD06253BC3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186503AA06253BC3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186503AB06253BC3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186503AC06253BC3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186503AD06253BC3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186503AE06253BC3005AB5DA = { + children = ( + 186503AF06253BC3005AB5DA, + 186503B006253BC3005AB5DA, + 186503B106253BC3005AB5DA, + 186503B206253BC3005AB5DA, + 186503B306253BC3005AB5DA, + 186503B406253BC3005AB5DA, + 186503B506253BC3005AB5DA, + 186503B606253BC3005AB5DA, + 186503B706253BC3005AB5DA, + 186503B806253BC3005AB5DA, + 186503B906253BC3005AB5DA, + 186503BA06253BC3005AB5DA, + 186503BB06253BC3005AB5DA, + 186503BC06253BC3005AB5DA, + 186503BD06253BC3005AB5DA, + 186503BE06253BC3005AB5DA, + 186503BF06253BC3005AB5DA, + 186503C006253BC3005AB5DA, + 186503C106253BC3005AB5DA, + 186503C206253BC3005AB5DA, + 186503C306253BC3005AB5DA, + 186503C406253BC3005AB5DA, + 186503C506253BC3005AB5DA, + 186503C606253BC3005AB5DA, + 186503C706253BC3005AB5DA, + 186503C806253BC3005AB5DA, + 186503C906253BC3005AB5DA, + 186503CA06253BC3005AB5DA, + 186503CB06253BC3005AB5DA, + 186503CC06253BC3005AB5DA, + 186503CD06253BC3005AB5DA, + 186503CE06253BC3005AB5DA, + 186503CF06253BC3005AB5DA, + 186503D006253BC3005AB5DA, + 186503D106253BC3005AB5DA, + 186503D206253BC3005AB5DA, + 186503D306253BC3005AB5DA, + 186503D406253BC3005AB5DA, + 186503D506253BC3005AB5DA, + 186503D606253BC3005AB5DA, + 186503D706253BC3005AB5DA, + 186503D806253BC3005AB5DA, + 186503D906253BC3005AB5DA, + 186503DA06253BC3005AB5DA, + 186503DB06253BC3005AB5DA, + 186503DC06253BC3005AB5DA, + 186503DD06253BC3005AB5DA, + 186503DE06253BC3005AB5DA, + 186503DF06253BC3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186503AF06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipx.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B006253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipy.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B106253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_flipz.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B206253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatex.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B306253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatey.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B406253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_rotatez.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B506253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_bevel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B606253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_endcap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B706253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_ibevel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B806253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cap_iendcap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503B906253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curve_cap.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BA06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectcurve.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BB06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dontselectmodel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BC06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_open.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BD06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "file_save.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BE06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503BF06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C006253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_bend.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C106253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_drilldown.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C206253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_insdel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C306253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_showboundingbox.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C406253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_weld.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C506253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch_wireframe.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C606253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "popup_selection.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C706253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockx.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C806253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelocky.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503C906253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scalelockz.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CA06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mouserotate.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CB06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "select_mousescale.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CC06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgmerge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CD06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_csgsubtract.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CE06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_makehollow.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503CF06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectcompletetall.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D006253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectinside.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D106253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selectpartialtall.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D206253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "selection_selecttouching.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D306253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "show_entities.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D406253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D506253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures_popup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D606253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameratoggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D706253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cameraupdate.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D806253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_change.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503D906253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_clipper.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DA06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_cubicclipping.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DB06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view_entity.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DC06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window1.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DD06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window2.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DE06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window3.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503DF06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "window4.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186503E006253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_flipx.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E106253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_flipy.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E206253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_flipz.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E306253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_rotatex.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E406253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_rotatey.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E506253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = brush_rotatez.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E606253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = cap_bevel.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E706253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = cap_endcap.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E806253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = cap_ibevel.bmp; + refType = 4; + sourceTree = ""; + }; + 186503E906253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = cap_iendcap.bmp; + refType = 4; + sourceTree = ""; + }; + 186503EA06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = curve_cap.bmp; + refType = 4; + sourceTree = ""; + }; + 186503EB06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = dontselectcurve.bmp; + refType = 4; + sourceTree = ""; + }; + 186503EC06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = dontselectmodel.bmp; + refType = 4; + sourceTree = ""; + }; + 186503ED06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = file_open.bmp; + refType = 4; + sourceTree = ""; + }; + 186503EE06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = file_save.bmp; + refType = 4; + sourceTree = ""; + }; + 186503EF06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = icon.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F006253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = logo.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F106253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_bend.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F206253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_drilldown.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F306253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_insdel.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F406253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_showboundingbox.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F506253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_weld.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F606253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = patch_wireframe.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F706253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = popup_selection.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F806253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = scalelockx.bmp; + refType = 4; + sourceTree = ""; + }; + 186503F906253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = scalelocky.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FA06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = scalelockz.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FB06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = select_mouserotate.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FC06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = select_mousescale.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FD06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_csgmerge.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FE06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_csgsubtract.bmp; + refType = 4; + sourceTree = ""; + }; + 186503FF06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_makehollow.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040006253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_selectcompletetall.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040106253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_selectinside.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040206253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_selectpartialtall.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040306253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = selection_selecttouching.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040406253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = show_entities.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040506253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = splash.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040606253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = textures_popup.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040706253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_cameratoggle.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040806253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_cameraupdate.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040906253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_change.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040A06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_clipper.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040B06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_cubicclipping.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040C06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = view_entity.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040D06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = window1.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040E06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = window2.bmp; + refType = 4; + sourceTree = ""; + }; + 1865040F06253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = window3.bmp; + refType = 4; + sourceTree = ""; + }; + 1865041006253BC3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = window4.bmp; + refType = 4; + sourceTree = ""; + }; + 1865041106253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = bp_dlg.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041206253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = brush.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041306253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = brush.h; + refType = 4; + sourceTree = ""; + }; + 1865041406253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = brush_primit.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041506253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = brushscript.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041606253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = camera.h; + refType = 4; + sourceTree = ""; + }; + 1865041706253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = camwindow.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041806253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = camwindow.h; + refType = 4; + sourceTree = ""; + }; + 1865041906253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = csg.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041A06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041B06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = dialog.h; + refType = 4; + sourceTree = ""; + }; + 1865041C06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dialoginfo.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041D06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = drag.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041E06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = eclass.cpp; + refType = 4; + sourceTree = ""; + }; + 1865041F06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = eclass_def.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042006253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = eclass_def.h; + refType = 4; + sourceTree = ""; + }; + 1865042106253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = error.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042206253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = feedback.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042306253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = feedback.h; + refType = 4; + sourceTree = ""; + }; + 1865042406253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = file.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042506253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = file.h; + refType = 4; + sourceTree = ""; + }; + 1865042606253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = filters.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042706253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = filters.h; + refType = 4; + sourceTree = ""; + }; + 1865042806253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = findtexturedialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042906253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = findtexturedialog.h; + refType = 4; + sourceTree = ""; + }; + 1865042A06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = glinterface.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042B06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = glwidget.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042C06253BC3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = glwidget.h; + refType = 4; + sourceTree = ""; + }; + 1865042D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = glwindow.cpp; + refType = 4; + sourceTree = ""; + }; + 1865042E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = glwindow.h; + refType = 4; + sourceTree = ""; + }; + 1865042F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = groupdialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865043006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = groupdialog.h; + refType = 4; + sourceTree = ""; + }; + 1865043106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = gtkdlgs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865043206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = "gtkfilesel-darwin.c"; + refType = 4; + sourceTree = ""; + }; + 1865043306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "gtkfilesel-darwin.h"; + refType = 4; + sourceTree = ""; + }; + 1865043406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = "gtkfilesel-linux.c"; + refType = 4; + sourceTree = ""; + }; + 1865043506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "gtkfilesel-linux.h"; + refType = 4; + sourceTree = ""; + }; + 1865043606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = gtkfilesel.c; + refType = 4; + sourceTree = ""; + }; + 1865043706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gtkfilesel.h; + refType = 4; + sourceTree = ""; + }; + 1865043806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = gtkmisc.cpp; + refType = 4; + sourceTree = ""; + }; + 1865043906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gtkmisc.h; + refType = 4; + sourceTree = ""; + }; + 1865043A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = GtkRadiant.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865043B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = main.cpp; + refType = 4; + sourceTree = ""; + }; + 1865043C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = mainframe.cpp; + refType = 4; + sourceTree = ""; + }; + 1865043D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = mainframe.h; + refType = 4; + sourceTree = ""; + }; + 1865043E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Makefile.mac; + refType = 4; + sourceTree = ""; + }; + 1865043F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = map.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = map.h; + refType = 4; + sourceTree = ""; + }; + 1865044106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = missing.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = parse.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = parse.h; + refType = 4; + sourceTree = ""; + }; + 1865044406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = patchdialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = patchdialog.h; + refType = 4; + sourceTree = ""; + }; + 1865044606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865044706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = pluginentities.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = pluginmanager.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = pluginmanager.h; + refType = 4; + sourceTree = ""; + }; + 1865044A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = pmesh.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = points.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = points.h; + refType = 4; + sourceTree = ""; + }; + 1865044D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = preferences.cpp; + refType = 4; + sourceTree = ""; + }; + 1865044E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = preferences.h; + refType = 4; + sourceTree = ""; + }; + 1865044F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = profile.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = qe3.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qe3.h; + refType = 4; + sourceTree = ""; + }; + 1865045206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qedefs.h; + refType = 4; + sourceTree = ""; + }; + 1865045306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qfiles.h; + refType = 4; + sourceTree = ""; + }; + 1865045406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = "qgl-mac.c"; + refType = 4; + sourceTree = ""; + }; + 1865045506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qgl.c; + refType = 4; + sourceTree = ""; + }; + 1865045606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qgl.h; + refType = 4; + sourceTree = ""; + }; + 1865045706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = qgl_ext.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = queuedraw.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045906253BC4005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.ico; + path = radiant.ico; + refType = 4; + sourceTree = ""; + }; + 1865045A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = radiant.rc; + refType = 4; + sourceTree = ""; + }; + 1865045B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resource.h; + refType = 4; + sourceTree = ""; + }; + 1865045C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = select.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = select.h; + refType = 4; + sourceTree = ""; + }; + 1865045E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = selectedface.cpp; + refType = 4; + sourceTree = ""; + }; + 1865045F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = stdafx.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = stdafx.h; + refType = 4; + sourceTree = ""; + }; + 1865046106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfacedialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfacedialog.h; + refType = 4; + sourceTree = ""; + }; + 1865046306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfaceplugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfaceplugin.h; + refType = 4; + sourceTree = ""; + }; + 1865046506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = targetname.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = texmanip.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = texmanip.h; + refType = 4; + sourceTree = ""; + }; + 1865046806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = textures.h; + refType = 4; + sourceTree = ""; + }; + 1865046906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = texwindow.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = texwindow.h; + refType = 4; + sourceTree = ""; + }; + 1865046B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = ui.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ui.h; + refType = 4; + sourceTree = ""; + }; + 1865046D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = undo.cpp; + refType = 4; + sourceTree = ""; + }; + 1865046E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = undo.h; + refType = 4; + sourceTree = ""; + }; + 1865046F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = vertsel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = watchbsp.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = watchbsp.h; + refType = 4; + sourceTree = ""; + }; + 1865047206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = winding.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = winding.h; + refType = 4; + sourceTree = ""; + }; + 1865047406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = xmlstuff.h; + refType = 4; + sourceTree = ""; + }; + 1865047506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = xywindow.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = xywindow.h; + refType = 4; + sourceTree = ""; + }; + 1865047706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = z.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = z.h; + refType = 4; + sourceTree = ""; + }; + 1865047906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = zwindow.cpp; + refType = 4; + sourceTree = ""; + }; + 1865047A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = zwindow.h; + refType = 4; + sourceTree = ""; + }; + 1865047B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = radiant.sln; + refType = 4; + sourceTree = ""; + }; + 1865047C06253BC4005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "wrapper.pb-project"; + path = radiant.xcode; + refType = 4; + sourceTree = ""; + }; + 1865047D06253BC4005AB5DA = { + children = ( + ); + isa = PBXGroup; + name = Products; + refType = 4; + sourceTree = ""; + }; + 1865047E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README; + refType = 4; + sourceTree = ""; + }; + 1865047F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.doxygen; + refType = 4; + sourceTree = ""; + }; + 1865048006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = run_python.bat; + refType = 4; + sourceTree = ""; + }; + 1865048106253BC4005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = scons.signatures; + refType = 4; + sourceTree = ""; + }; + 1865048206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = SConscript; + refType = 4; + sourceTree = ""; + }; + 1865048306253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = SConstruct; + refType = 4; + sourceTree = ""; + }; + 1865048406253BC4005AB5DA = { + children = ( + 1865048506253BC4005AB5DA, + 186504B406253BC5005AB5DA, + 186504B506253BC5005AB5DA, + 186504CA06253BC5005AB5DA, + 18650A1006253BD1005AB5DA, + 18650A2006253BD1005AB5DA, + 18650A2106253BD1005AB5DA, + 18650B6F06253BD5005AB5DA, + 18650B7006253BD5005AB5DA, + 18650B8A06253BD5005AB5DA, + 18650BB306253BD5005AB5DA, + 18650BB406253BD5005AB5DA, + 18650BB506253BD5005AB5DA, + 18650BB606253BD5005AB5DA, + 18650BB706253BD5005AB5DA, + 18650BB806253BD5005AB5DA, + ); + isa = PBXGroup; + path = setup; + refType = 4; + sourceTree = ""; + }; + 1865048506253BC4005AB5DA = { + children = ( + 1865048606253BC4005AB5DA, + 1865048706253BC4005AB5DA, + 1865048806253BC4005AB5DA, + 1865048906253BC4005AB5DA, + 1865048A06253BC4005AB5DA, + 1865049306253BC4005AB5DA, + 1865049C06253BC4005AB5DA, + 1865049D06253BC4005AB5DA, + 186504A606253BC5005AB5DA, + 186504AB06253BC5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865048606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865048706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865048806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865048906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865048A06253BC4005AB5DA = { + children = ( + 1865048B06253BC4005AB5DA, + 1865048C06253BC4005AB5DA, + 1865048D06253BC4005AB5DA, + 1865048E06253BC4005AB5DA, + 1865048F06253BC4005AB5DA, + 1865049006253BC4005AB5DA, + 1865049106253BC4005AB5DA, + 1865049206253BC4005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865048B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865048C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865048D06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "openurl.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865048E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "quickstart.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865048F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiantgtkrc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865049006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865049106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.patch.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865049206253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865049306253BC4005AB5DA = { + children = ( + 1865049406253BC4005AB5DA, + 1865049506253BC4005AB5DA, + 1865049606253BC4005AB5DA, + 1865049706253BC4005AB5DA, + 1865049806253BC4005AB5DA, + 1865049906253BC4005AB5DA, + 1865049A06253BC4005AB5DA, + 1865049B06253BC4005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865049406253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049506253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049606253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "openurl.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049706253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "quickstart.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049806253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiantgtkrc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049906253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049A06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.patch.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049B06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865049C06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865049D06253BC4005AB5DA = { + children = ( + 1865049E06253BC4005AB5DA, + 1865049F06253BC4005AB5DA, + 186504A006253BC4005AB5DA, + 186504A106253BC4005AB5DA, + 186504A206253BC5005AB5DA, + 186504A306253BC5005AB5DA, + 186504A406253BC5005AB5DA, + 186504A506253BC5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865049E06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865049F06253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A006253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "openurl.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A106253BC4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "quickstart.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A206253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiantgtkrc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A306253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "setup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A406253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.patch.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A506253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504A606253BC5005AB5DA = { + children = ( + 186504A706253BC5005AB5DA, + 186504A806253BC5005AB5DA, + 186504A906253BC5005AB5DA, + 186504AA06253BC5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186504A706253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504A806253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504A906253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504AA06253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504AB06253BC5005AB5DA = { + children = ( + 186504AC06253BC5005AB5DA, + 186504AD06253BC5005AB5DA, + 186504AE06253BC5005AB5DA, + 186504AF06253BC5005AB5DA, + 186504B006253BC5005AB5DA, + 186504B106253BC5005AB5DA, + 186504B206253BC5005AB5DA, + 186504B306253BC5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504AC06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504AD06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504AE06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "openurl.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504AF06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "quickstart.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504B006253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiantgtkrc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504B106253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504B206253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.patch.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504B306253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504B406253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changelog.txt; + refType = 4; + sourceTree = ""; + }; + 186504B506253BC5005AB5DA = { + children = ( + 186504B606253BC5005AB5DA, + 186504C906253BC5005AB5DA, + ); + isa = PBXGroup; + path = common; + refType = 4; + sourceTree = ""; + }; + 186504B606253BC5005AB5DA = { + children = ( + 186504B706253BC5005AB5DA, + 186504B806253BC5005AB5DA, + 186504B906253BC5005AB5DA, + 186504BA06253BC5005AB5DA, + 186504BB06253BC5005AB5DA, + 186504BD06253BC5005AB5DA, + 186504BF06253BC5005AB5DA, + 186504C006253BC5005AB5DA, + 186504C206253BC5005AB5DA, + 186504C706253BC5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186504B706253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186504B806253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186504B906253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186504BA06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186504BB06253BC5005AB5DA = { + children = ( + 186504BC06253BC5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504BC06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504BD06253BC5005AB5DA = { + children = ( + 186504BE06253BC5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504BE06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504BF06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186504C006253BC5005AB5DA = { + children = ( + 186504C106253BC5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504C106253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504C206253BC5005AB5DA = { + children = ( + 186504C306253BC5005AB5DA, + 186504C406253BC5005AB5DA, + 186504C506253BC5005AB5DA, + 186504C606253BC5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186504C306253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504C406253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504C506253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504C606253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504C706253BC5005AB5DA = { + children = ( + 186504C806253BC5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504C806253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504C906253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = setup.pm; + refType = 4; + sourceTree = ""; + }; + 186504CA06253BC5005AB5DA = { + children = ( + 186504CB06253BC5005AB5DA, + 186504DA06253BC5005AB5DA, + 1865087506253BCD005AB5DA, + 186509C306253BD1005AB5DA, + ); + isa = PBXGroup; + path = data; + refType = 4; + sourceTree = ""; + }; + 186504CB06253BC5005AB5DA = { + children = ( + 186504CC06253BC5005AB5DA, + 186504CD06253BC5005AB5DA, + 186504CE06253BC5005AB5DA, + 186504CF06253BC5005AB5DA, + 186504D006253BC5005AB5DA, + 186504D106253BC5005AB5DA, + 186504D206253BC5005AB5DA, + 186504D306253BC5005AB5DA, + 186504D406253BC5005AB5DA, + 186504D906253BC5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186504CC06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186504CD06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186504CE06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186504CF06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186504D006253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504D106253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504D206253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186504D306253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504D406253BC5005AB5DA = { + children = ( + 186504D506253BC5005AB5DA, + 186504D606253BC5005AB5DA, + 186504D706253BC5005AB5DA, + 186504D806253BC5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186504D506253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504D606253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504D706253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504D806253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504D906253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504DA06253BC5005AB5DA = { + children = ( + 186504DB06253BC5005AB5DA, + 186504F606253BC5005AB5DA, + 186504F706253BC5005AB5DA, + 186504F806253BC5005AB5DA, + 186504F906253BC5005AB5DA, + 1865052206253BC6005AB5DA, + 1865077106253BCB005AB5DA, + 1865081C06253BCC005AB5DA, + ); + isa = PBXGroup; + path = baseq3; + refType = 4; + sourceTree = ""; + }; + 186504DB06253BC5005AB5DA = { + children = ( + 186504DC06253BC5005AB5DA, + 186504DD06253BC5005AB5DA, + 186504DE06253BC5005AB5DA, + 186504DF06253BC5005AB5DA, + 186504E006253BC5005AB5DA, + 186504E406253BC5005AB5DA, + 186504E806253BC5005AB5DA, + 186504E906253BC5005AB5DA, + 186504ED06253BC5005AB5DA, + 186504F206253BC5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186504DC06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186504DD06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186504DE06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186504DF06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186504E006253BC5005AB5DA = { + children = ( + 186504E106253BC5005AB5DA, + 186504E206253BC5005AB5DA, + 186504E306253BC5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504E106253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common-spog.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504E206253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curry.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504E306253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504E406253BC5005AB5DA = { + children = ( + 186504E506253BC5005AB5DA, + 186504E606253BC5005AB5DA, + 186504E706253BC5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504E506253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common-spog.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504E606253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curry.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504E706253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504E806253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186504E906253BC5005AB5DA = { + children = ( + 186504EA06253BC5005AB5DA, + 186504EB06253BC5005AB5DA, + 186504EC06253BC5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504EA06253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "common-spog.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504EB06253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "curry.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504EC06253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "mapmedia.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186504ED06253BC5005AB5DA = { + children = ( + 186504EE06253BC5005AB5DA, + 186504EF06253BC5005AB5DA, + 186504F006253BC5005AB5DA, + 186504F106253BC5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186504EE06253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186504EF06253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186504F006253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186504F106253BC5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504F206253BC5005AB5DA = { + children = ( + 186504F306253BC5005AB5DA, + 186504F406253BC5005AB5DA, + 186504F506253BC5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186504F306253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common-spog.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504F406253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "curry.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504F506253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186504F606253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "common-spog.pk3"; + refType = 4; + sourceTree = ""; + }; + 186504F706253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = curry.pk3; + refType = 4; + sourceTree = ""; + }; + 186504F806253BC5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = mapmedia.pk3; + refType = 4; + sourceTree = ""; + }; + 186504F906253BC5005AB5DA = { + children = ( + 186504FA06253BC5005AB5DA, + 1865051D06253BC6005AB5DA, + 1865051E06253BC6005AB5DA, + 1865051F06253BC6005AB5DA, + 1865052006253BC6005AB5DA, + 1865052106253BC6005AB5DA, + ); + isa = PBXGroup; + path = maps; + refType = 4; + sourceTree = ""; + }; + 186504FA06253BC5005AB5DA = { + children = ( + 186504FB06253BC5005AB5DA, + 186504FC06253BC5005AB5DA, + 186504FD06253BC5005AB5DA, + 186504FE06253BC5005AB5DA, + 186504FF06253BC5005AB5DA, + 1865050506253BC6005AB5DA, + 1865050B06253BC6005AB5DA, + 1865050C06253BC6005AB5DA, + 1865051206253BC6005AB5DA, + 1865051706253BC6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186504FB06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186504FC06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186504FD06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186504FE06253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186504FF06253BC5005AB5DA = { + children = ( + 1865050006253BC5005AB5DA, + 1865050106253BC5005AB5DA, + 1865050206253BC6005AB5DA, + 1865050306253BC6005AB5DA, + 1865050406253BC6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865050006253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050106253BC5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm17sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050206253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm1sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050306253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm7sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050406253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050506253BC6005AB5DA = { + children = ( + 1865050606253BC6005AB5DA, + 1865050706253BC6005AB5DA, + 1865050806253BC6005AB5DA, + 1865050906253BC6005AB5DA, + 1865050A06253BC6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865050606253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865050706253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm17sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865050806253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm1sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865050906253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm7sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865050A06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865050B06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865050C06253BC6005AB5DA = { + children = ( + 1865050D06253BC6005AB5DA, + 1865050E06253BC6005AB5DA, + 1865050F06253BC6005AB5DA, + 1865051006253BC6005AB5DA, + 1865051106253BC6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865050D06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050E06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm17sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865050F06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm1sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865051006253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm7sample.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865051106253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865051206253BC6005AB5DA = { + children = ( + 1865051306253BC6005AB5DA, + 1865051406253BC6005AB5DA, + 1865051506253BC6005AB5DA, + 1865051606253BC6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865051306253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865051406253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865051506253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865051606253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865051706253BC6005AB5DA = { + children = ( + 1865051806253BC6005AB5DA, + 1865051906253BC6005AB5DA, + 1865051A06253BC6005AB5DA, + 1865051B06253BC6005AB5DA, + 1865051C06253BC6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865051806253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865051906253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm17sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865051A06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm1sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865051B06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3dm7sample.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865051C06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865051D06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = museum.map; + refType = 4; + sourceTree = ""; + }; + 1865051E06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3dm17sample.map; + refType = 4; + sourceTree = ""; + }; + 1865051F06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3dm1sample.map; + refType = 4; + sourceTree = ""; + }; + 1865052006253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3dm7sample.map; + refType = 4; + sourceTree = ""; + }; + 1865052106253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = terrademoQ3.map; + refType = 4; + sourceTree = ""; + }; + 1865052206253BC6005AB5DA = { + children = ( + 1865052306253BC6005AB5DA, + 1865053206253BC6005AB5DA, + ); + isa = PBXGroup; + path = models; + refType = 4; + sourceTree = ""; + }; + 1865052306253BC6005AB5DA = { + children = ( + 1865052406253BC6005AB5DA, + 1865052506253BC6005AB5DA, + 1865052606253BC6005AB5DA, + 1865052706253BC6005AB5DA, + 1865052806253BC6005AB5DA, + 1865052906253BC6005AB5DA, + 1865052A06253BC6005AB5DA, + 1865052B06253BC6005AB5DA, + 1865052C06253BC6005AB5DA, + 1865053106253BC6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865052406253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865052506253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865052606253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865052706253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865052806253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865052906253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865052A06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865052B06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865052C06253BC6005AB5DA = { + children = ( + 1865052D06253BC6005AB5DA, + 1865052E06253BC6005AB5DA, + 1865052F06253BC6005AB5DA, + 1865053006253BC6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865052D06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865052E06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865052F06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865053006253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865053106253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865053206253BC6005AB5DA = { + children = ( + 1865053306253BC6005AB5DA, + 1865055606253BC6005AB5DA, + 1865056B06253BC6005AB5DA, + 1865058506253BC7005AB5DA, + 1865059F06253BC7005AB5DA, + 186505B906253BC7005AB5DA, + 186505BA06253BC7005AB5DA, + 186505D906253BC7005AB5DA, + 186505EE06253BC8005AB5DA, + 1865060306253BC8005AB5DA, + 1865060406253BC8005AB5DA, + 1865061906253BC8005AB5DA, + 1865063306253BC8005AB5DA, + 1865064806253BC8005AB5DA, + 1865065D06253BC8005AB5DA, + 1865068606253BC9005AB5DA, + 186506A506253BC9005AB5DA, + 186506BA06253BC9005AB5DA, + 186506BB06253BC9005AB5DA, + 186506DA06253BC9005AB5DA, + 186506EF06253BC9005AB5DA, + 1865070406253BC9005AB5DA, + 1865075006253BCA005AB5DA, + 1865075106253BCA005AB5DA, + 1865077006253BCA005AB5DA, + ); + isa = PBXGroup; + path = mapobjects; + refType = 4; + sourceTree = ""; + }; + 1865053306253BC6005AB5DA = { + children = ( + 1865053406253BC6005AB5DA, + 1865053506253BC6005AB5DA, + 1865053606253BC6005AB5DA, + 1865053706253BC6005AB5DA, + 1865053806253BC6005AB5DA, + 1865053E06253BC6005AB5DA, + 1865054406253BC6005AB5DA, + 1865054506253BC6005AB5DA, + 1865054B06253BC6005AB5DA, + 1865055006253BC6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865053406253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865053506253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865053606253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865053706253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865053806253BC6005AB5DA = { + children = ( + 1865053906253BC6005AB5DA, + 1865053A06253BC6005AB5DA, + 1865053B06253BC6005AB5DA, + 1865053C06253BC6005AB5DA, + 1865053D06253BC6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865053906253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gargoyle1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865053A06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "kmlamp1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865053B06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "statue_major.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865053C06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visor_posed.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865053D06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "walllamp3.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865053E06253BC6005AB5DA = { + children = ( + 1865053F06253BC6005AB5DA, + 1865054006253BC6005AB5DA, + 1865054106253BC6005AB5DA, + 1865054206253BC6005AB5DA, + 1865054306253BC6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865053F06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gargoyle1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865054006253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "kmlamp1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865054106253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "statue_major.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865054206253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visor_posed.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865054306253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "walllamp3.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865054406253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865054506253BC6005AB5DA = { + children = ( + 1865054606253BC6005AB5DA, + 1865054706253BC6005AB5DA, + 1865054806253BC6005AB5DA, + 1865054906253BC6005AB5DA, + 1865054A06253BC6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865054606253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gargoyle1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865054706253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "kmlamp1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865054806253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "statue_major.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865054906253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "visor_posed.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865054A06253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "walllamp3.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865054B06253BC6005AB5DA = { + children = ( + 1865054C06253BC6005AB5DA, + 1865054D06253BC6005AB5DA, + 1865054E06253BC6005AB5DA, + 1865054F06253BC6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865054C06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865054D06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865054E06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865054F06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865055006253BC6005AB5DA = { + children = ( + 1865055106253BC6005AB5DA, + 1865055206253BC6005AB5DA, + 1865055306253BC6005AB5DA, + 1865055406253BC6005AB5DA, + 1865055506253BC6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865055106253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gargoyle1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865055206253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "kmlamp1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865055306253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "statue_major.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865055406253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visor_posed.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865055506253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "walllamp3.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865055606253BC6005AB5DA = { + children = ( + 1865055706253BC6005AB5DA, + 1865056A06253BC6005AB5DA, + ); + isa = PBXGroup; + path = banner; + refType = 4; + sourceTree = ""; + }; + 1865055706253BC6005AB5DA = { + children = ( + 1865055806253BC6005AB5DA, + 1865055906253BC6005AB5DA, + 1865055A06253BC6005AB5DA, + 1865055B06253BC6005AB5DA, + 1865055C06253BC6005AB5DA, + 1865055E06253BC6005AB5DA, + 1865056006253BC6005AB5DA, + 1865056106253BC6005AB5DA, + 1865056306253BC6005AB5DA, + 1865056806253BC6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865055806253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865055906253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865055A06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865055B06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865055C06253BC6005AB5DA = { + children = ( + 1865055D06253BC6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865055D06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "banner5.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865055E06253BC6005AB5DA = { + children = ( + 1865055F06253BC6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865055F06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "banner5.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865056006253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865056106253BC6005AB5DA = { + children = ( + 1865056206253BC6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865056206253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "banner5.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865056306253BC6005AB5DA = { + children = ( + 1865056406253BC6005AB5DA, + 1865056506253BC6005AB5DA, + 1865056606253BC6005AB5DA, + 1865056706253BC6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865056406253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865056506253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865056606253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865056706253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865056806253BC6005AB5DA = { + children = ( + 1865056906253BC6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865056906253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "banner5.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865056A06253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = banner5.md3; + refType = 4; + sourceTree = ""; + }; + 1865056B06253BC6005AB5DA = { + children = ( + 1865056C06253BC6005AB5DA, + 1865058306253BC7005AB5DA, + 1865058406253BC7005AB5DA, + ); + isa = PBXGroup; + path = baph; + refType = 4; + sourceTree = ""; + }; + 1865056C06253BC6005AB5DA = { + children = ( + 1865056D06253BC6005AB5DA, + 1865056E06253BC6005AB5DA, + 1865056F06253BC6005AB5DA, + 1865057006253BC6005AB5DA, + 1865057106253BC6005AB5DA, + 1865057406253BC6005AB5DA, + 1865057706253BC6005AB5DA, + 1865057806253BC6005AB5DA, + 1865057B06253BC6005AB5DA, + 1865058006253BC6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865056D06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865056E06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865056F06253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865057006253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865057106253BC6005AB5DA = { + children = ( + 1865057206253BC6005AB5DA, + 1865057306253BC6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865057206253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "baphomet_gold.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865057306253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lil_baphomet.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865057406253BC6005AB5DA = { + children = ( + 1865057506253BC6005AB5DA, + 1865057606253BC6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865057506253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "baphomet_gold.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865057606253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lil_baphomet.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865057706253BC6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865057806253BC6005AB5DA = { + children = ( + 1865057906253BC6005AB5DA, + 1865057A06253BC6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865057906253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "baphomet_gold.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865057A06253BC6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "lil_baphomet.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865057B06253BC6005AB5DA = { + children = ( + 1865057C06253BC6005AB5DA, + 1865057D06253BC6005AB5DA, + 1865057E06253BC6005AB5DA, + 1865057F06253BC6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865057C06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865057D06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865057E06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865057F06253BC6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865058006253BC6005AB5DA = { + children = ( + 1865058106253BC7005AB5DA, + 1865058206253BC7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865058106253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "baphomet_gold.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865058206253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lil_baphomet.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865058306253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = baphomet_gold.md3; + refType = 4; + sourceTree = ""; + }; + 1865058406253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = lil_baphomet.md3; + refType = 4; + sourceTree = ""; + }; + 1865058506253BC7005AB5DA = { + children = ( + 1865058606253BC7005AB5DA, + 1865059D06253BC7005AB5DA, + 1865059E06253BC7005AB5DA, + ); + isa = PBXGroup; + path = bitch; + refType = 4; + sourceTree = ""; + }; + 1865058606253BC7005AB5DA = { + children = ( + 1865058706253BC7005AB5DA, + 1865058806253BC7005AB5DA, + 1865058906253BC7005AB5DA, + 1865058A06253BC7005AB5DA, + 1865058B06253BC7005AB5DA, + 1865058E06253BC7005AB5DA, + 1865059106253BC7005AB5DA, + 1865059206253BC7005AB5DA, + 1865059506253BC7005AB5DA, + 1865059A06253BC7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865058706253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865058806253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865058906253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865058A06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865058B06253BC7005AB5DA = { + children = ( + 1865058C06253BC7005AB5DA, + 1865058D06253BC7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865058C06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembot.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865058D06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembotbig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865058E06253BC7005AB5DA = { + children = ( + 1865058F06253BC7005AB5DA, + 1865059006253BC7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865058F06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembot.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865059006253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembotbig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865059106253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865059206253BC7005AB5DA = { + children = ( + 1865059306253BC7005AB5DA, + 1865059406253BC7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865059306253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "fembot.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865059406253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "fembotbig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865059506253BC7005AB5DA = { + children = ( + 1865059606253BC7005AB5DA, + 1865059706253BC7005AB5DA, + 1865059806253BC7005AB5DA, + 1865059906253BC7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865059606253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865059706253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865059806253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865059906253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865059A06253BC7005AB5DA = { + children = ( + 1865059B06253BC7005AB5DA, + 1865059C06253BC7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865059B06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembot.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865059C06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fembotbig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865059D06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = fembot.md3; + refType = 4; + sourceTree = ""; + }; + 1865059E06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = fembotbig.md3; + refType = 4; + sourceTree = ""; + }; + 1865059F06253BC7005AB5DA = { + children = ( + 186505A006253BC7005AB5DA, + 186505B706253BC7005AB5DA, + 186505B806253BC7005AB5DA, + ); + isa = PBXGroup; + path = corpse; + refType = 4; + sourceTree = ""; + }; + 186505A006253BC7005AB5DA = { + children = ( + 186505A106253BC7005AB5DA, + 186505A206253BC7005AB5DA, + 186505A306253BC7005AB5DA, + 186505A406253BC7005AB5DA, + 186505A506253BC7005AB5DA, + 186505A806253BC7005AB5DA, + 186505AB06253BC7005AB5DA, + 186505AC06253BC7005AB5DA, + 186505AF06253BC7005AB5DA, + 186505B406253BC7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186505A106253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186505A206253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186505A306253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186505A406253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186505A506253BC7005AB5DA = { + children = ( + 186505A606253BC7005AB5DA, + 186505A706253BC7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505A606253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "corpse.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505A706253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "torso.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505A806253BC7005AB5DA = { + children = ( + 186505A906253BC7005AB5DA, + 186505AA06253BC7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505A906253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "corpse.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505AA06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "torso.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505AB06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186505AC06253BC7005AB5DA = { + children = ( + 186505AD06253BC7005AB5DA, + 186505AE06253BC7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505AD06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "corpse.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505AE06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "torso.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505AF06253BC7005AB5DA = { + children = ( + 186505B006253BC7005AB5DA, + 186505B106253BC7005AB5DA, + 186505B206253BC7005AB5DA, + 186505B306253BC7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186505B006253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505B106253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505B206253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505B306253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505B406253BC7005AB5DA = { + children = ( + 186505B506253BC7005AB5DA, + 186505B606253BC7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505B506253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "corpse.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505B606253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "torso.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505B706253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = corpse.md3; + refType = 4; + sourceTree = ""; + }; + 186505B806253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = torso.md3; + refType = 4; + sourceTree = ""; + }; + 186505B906253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = gargoyle1.md3; + refType = 4; + sourceTree = ""; + }; + 186505BA06253BC7005AB5DA = { + children = ( + 186505BB06253BC7005AB5DA, + 186505D606253BC7005AB5DA, + 186505D706253BC7005AB5DA, + 186505D806253BC7005AB5DA, + ); + isa = PBXGroup; + path = gratelamp; + refType = 4; + sourceTree = ""; + }; + 186505BB06253BC7005AB5DA = { + children = ( + 186505BC06253BC7005AB5DA, + 186505BD06253BC7005AB5DA, + 186505BE06253BC7005AB5DA, + 186505BF06253BC7005AB5DA, + 186505C006253BC7005AB5DA, + 186505C406253BC7005AB5DA, + 186505C806253BC7005AB5DA, + 186505C906253BC7005AB5DA, + 186505CD06253BC7005AB5DA, + 186505D206253BC7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186505BC06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186505BD06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186505BE06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186505BF06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186505C006253BC7005AB5DA = { + children = ( + 186505C106253BC7005AB5DA, + 186505C206253BC7005AB5DA, + 186505C306253BC7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505C106253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratelamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505C206253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505C306253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorchbig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505C406253BC7005AB5DA = { + children = ( + 186505C506253BC7005AB5DA, + 186505C606253BC7005AB5DA, + 186505C706253BC7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505C506253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratelamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505C606253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505C706253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorchbig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505C806253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186505C906253BC7005AB5DA = { + children = ( + 186505CA06253BC7005AB5DA, + 186505CB06253BC7005AB5DA, + 186505CC06253BC7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505CA06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gratelamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505CB06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gratetorch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505CC06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gratetorchbig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505CD06253BC7005AB5DA = { + children = ( + 186505CE06253BC7005AB5DA, + 186505CF06253BC7005AB5DA, + 186505D006253BC7005AB5DA, + 186505D106253BC7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186505CE06253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505CF06253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505D006253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505D106253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505D206253BC7005AB5DA = { + children = ( + 186505D306253BC7005AB5DA, + 186505D406253BC7005AB5DA, + 186505D506253BC7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505D306253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratelamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505D406253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505D506253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gratetorchbig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505D606253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = gratelamp.md3; + refType = 4; + sourceTree = ""; + }; + 186505D706253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = gratetorch.md3; + refType = 4; + sourceTree = ""; + }; + 186505D806253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = gratetorchbig.md3; + refType = 4; + sourceTree = ""; + }; + 186505D906253BC7005AB5DA = { + children = ( + 186505DA06253BC7005AB5DA, + 186505ED06253BC7005AB5DA, + ); + isa = PBXGroup; + path = jesus; + refType = 4; + sourceTree = ""; + }; + 186505DA06253BC7005AB5DA = { + children = ( + 186505DB06253BC7005AB5DA, + 186505DC06253BC7005AB5DA, + 186505DD06253BC7005AB5DA, + 186505DE06253BC7005AB5DA, + 186505DF06253BC7005AB5DA, + 186505E106253BC7005AB5DA, + 186505E306253BC7005AB5DA, + 186505E406253BC7005AB5DA, + 186505E606253BC7005AB5DA, + 186505EB06253BC7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186505DB06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186505DC06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186505DD06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186505DE06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186505DF06253BC7005AB5DA = { + children = ( + 186505E006253BC7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505E006253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jesus.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505E106253BC7005AB5DA = { + children = ( + 186505E206253BC7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505E206253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jesus.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505E306253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186505E406253BC7005AB5DA = { + children = ( + 186505E506253BC7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505E506253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "jesus.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505E606253BC7005AB5DA = { + children = ( + 186505E706253BC7005AB5DA, + 186505E806253BC7005AB5DA, + 186505E906253BC7005AB5DA, + 186505EA06253BC7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186505E706253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505E806253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505E906253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505EA06253BC7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505EB06253BC7005AB5DA = { + children = ( + 186505EC06253BC7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186505EC06253BC7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jesus.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505ED06253BC7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = jesus.md3; + refType = 4; + sourceTree = ""; + }; + 186505EE06253BC8005AB5DA = { + children = ( + 186505EF06253BC8005AB5DA, + 1865060206253BC8005AB5DA, + ); + isa = PBXGroup; + path = jets; + refType = 4; + sourceTree = ""; + }; + 186505EF06253BC8005AB5DA = { + children = ( + 186505F006253BC8005AB5DA, + 186505F106253BC8005AB5DA, + 186505F206253BC8005AB5DA, + 186505F306253BC8005AB5DA, + 186505F406253BC8005AB5DA, + 186505F606253BC8005AB5DA, + 186505F806253BC8005AB5DA, + 186505F906253BC8005AB5DA, + 186505FB06253BC8005AB5DA, + 1865060006253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186505F006253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186505F106253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186505F206253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186505F306253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186505F406253BC8005AB5DA = { + children = ( + 186505F506253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505F506253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jets01.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505F606253BC8005AB5DA = { + children = ( + 186505F706253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505F706253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jets01.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186505F806253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186505F906253BC8005AB5DA = { + children = ( + 186505FA06253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505FA06253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "jets01.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186505FB06253BC8005AB5DA = { + children = ( + 186505FC06253BC8005AB5DA, + 186505FD06253BC8005AB5DA, + 186505FE06253BC8005AB5DA, + 186505FF06253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186505FC06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186505FD06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186505FE06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186505FF06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865060006253BC8005AB5DA = { + children = ( + 1865060106253BC8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865060106253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jets01.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865060206253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = jets01.md3; + refType = 4; + sourceTree = ""; + }; + 1865060306253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = kmlamp1.md3; + refType = 4; + sourceTree = ""; + }; + 1865060406253BC8005AB5DA = { + children = ( + 1865060506253BC8005AB5DA, + 1865061806253BC8005AB5DA, + ); + isa = PBXGroup; + path = lamps; + refType = 4; + sourceTree = ""; + }; + 1865060506253BC8005AB5DA = { + children = ( + 1865060606253BC8005AB5DA, + 1865060706253BC8005AB5DA, + 1865060806253BC8005AB5DA, + 1865060906253BC8005AB5DA, + 1865060A06253BC8005AB5DA, + 1865060C06253BC8005AB5DA, + 1865060E06253BC8005AB5DA, + 1865060F06253BC8005AB5DA, + 1865061106253BC8005AB5DA, + 1865061606253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865060606253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865060706253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865060806253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865060906253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865060A06253BC8005AB5DA = { + children = ( + 1865060B06253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865060B06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bot_lamp2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865060C06253BC8005AB5DA = { + children = ( + 1865060D06253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865060D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bot_lamp2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865060E06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865060F06253BC8005AB5DA = { + children = ( + 1865061006253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865061006253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bot_lamp2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865061106253BC8005AB5DA = { + children = ( + 1865061206253BC8005AB5DA, + 1865061306253BC8005AB5DA, + 1865061406253BC8005AB5DA, + 1865061506253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865061206253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865061306253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865061406253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865061506253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865061606253BC8005AB5DA = { + children = ( + 1865061706253BC8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865061706253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bot_lamp2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865061806253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = bot_lamp2.md3; + refType = 4; + sourceTree = ""; + }; + 1865061906253BC8005AB5DA = { + children = ( + 1865061A06253BC8005AB5DA, + 1865063106253BC8005AB5DA, + 1865063206253BC8005AB5DA, + ); + isa = PBXGroup; + path = pipe; + refType = 4; + sourceTree = ""; + }; + 1865061A06253BC8005AB5DA = { + children = ( + 1865061B06253BC8005AB5DA, + 1865061C06253BC8005AB5DA, + 1865061D06253BC8005AB5DA, + 1865061E06253BC8005AB5DA, + 1865061F06253BC8005AB5DA, + 1865062206253BC8005AB5DA, + 1865062506253BC8005AB5DA, + 1865062606253BC8005AB5DA, + 1865062906253BC8005AB5DA, + 1865062E06253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865061B06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865061C06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865061D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865061E06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865061F06253BC8005AB5DA = { + children = ( + 1865062006253BC8005AB5DA, + 1865062106253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865062006253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865062106253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02b.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865062206253BC8005AB5DA = { + children = ( + 1865062306253BC8005AB5DA, + 1865062406253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865062306253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865062406253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02b.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865062506253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865062606253BC8005AB5DA = { + children = ( + 1865062706253BC8005AB5DA, + 1865062806253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865062706253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pipe02.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865062806253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pipe02b.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865062906253BC8005AB5DA = { + children = ( + 1865062A06253BC8005AB5DA, + 1865062B06253BC8005AB5DA, + 1865062C06253BC8005AB5DA, + 1865062D06253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865062A06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865062B06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865062C06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865062D06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865062E06253BC8005AB5DA = { + children = ( + 1865062F06253BC8005AB5DA, + 1865063006253BC8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865062F06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865063006253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pipe02b.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865063106253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pipe02.md3; + refType = 4; + sourceTree = ""; + }; + 1865063206253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pipe02b.md3; + refType = 4; + sourceTree = ""; + }; + 1865063306253BC8005AB5DA = { + children = ( + 1865063406253BC8005AB5DA, + 1865064706253BC8005AB5DA, + ); + isa = PBXGroup; + path = podium; + refType = 4; + sourceTree = ""; + }; + 1865063406253BC8005AB5DA = { + children = ( + 1865063506253BC8005AB5DA, + 1865063606253BC8005AB5DA, + 1865063706253BC8005AB5DA, + 1865063806253BC8005AB5DA, + 1865063906253BC8005AB5DA, + 1865063B06253BC8005AB5DA, + 1865063D06253BC8005AB5DA, + 1865063E06253BC8005AB5DA, + 1865064006253BC8005AB5DA, + 1865064506253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865063506253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865063606253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865063706253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865063806253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865063906253BC8005AB5DA = { + children = ( + 1865063A06253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865063A06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "podium4.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865063B06253BC8005AB5DA = { + children = ( + 1865063C06253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865063C06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "podium4.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865063D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865063E06253BC8005AB5DA = { + children = ( + 1865063F06253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865063F06253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "podium4.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865064006253BC8005AB5DA = { + children = ( + 1865064106253BC8005AB5DA, + 1865064206253BC8005AB5DA, + 1865064306253BC8005AB5DA, + 1865064406253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865064106253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865064206253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865064306253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865064406253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865064506253BC8005AB5DA = { + children = ( + 1865064606253BC8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865064606253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "podium4.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865064706253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = podium4.md3; + refType = 4; + sourceTree = ""; + }; + 1865064806253BC8005AB5DA = { + children = ( + 1865064906253BC8005AB5DA, + 1865065C06253BC8005AB5DA, + ); + isa = PBXGroup; + path = portal_2; + refType = 4; + sourceTree = ""; + }; + 1865064906253BC8005AB5DA = { + children = ( + 1865064A06253BC8005AB5DA, + 1865064B06253BC8005AB5DA, + 1865064C06253BC8005AB5DA, + 1865064D06253BC8005AB5DA, + 1865064E06253BC8005AB5DA, + 1865065006253BC8005AB5DA, + 1865065206253BC8005AB5DA, + 1865065306253BC8005AB5DA, + 1865065506253BC8005AB5DA, + 1865065A06253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865064A06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865064B06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865064C06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865064D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865064E06253BC8005AB5DA = { + children = ( + 1865064F06253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865064F06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portal_2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865065006253BC8005AB5DA = { + children = ( + 1865065106253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865065106253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portal_2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865065206253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865065306253BC8005AB5DA = { + children = ( + 1865065406253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865065406253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "portal_2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865065506253BC8005AB5DA = { + children = ( + 1865065606253BC8005AB5DA, + 1865065706253BC8005AB5DA, + 1865065806253BC8005AB5DA, + 1865065906253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865065606253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865065706253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865065806253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865065906253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865065A06253BC8005AB5DA = { + children = ( + 1865065B06253BC8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865065B06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portal_2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865065C06253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = portal_2.md3; + refType = 4; + sourceTree = ""; + }; + 1865065D06253BC8005AB5DA = { + children = ( + 1865065E06253BC8005AB5DA, + 1865068106253BC9005AB5DA, + 1865068206253BC9005AB5DA, + 1865068306253BC9005AB5DA, + 1865068406253BC9005AB5DA, + 1865068506253BC9005AB5DA, + ); + isa = PBXGroup; + path = skel; + refType = 4; + sourceTree = ""; + }; + 1865065E06253BC8005AB5DA = { + children = ( + 1865065F06253BC8005AB5DA, + 1865066006253BC8005AB5DA, + 1865066106253BC8005AB5DA, + 1865066206253BC8005AB5DA, + 1865066306253BC8005AB5DA, + 1865066906253BC8005AB5DA, + 1865066F06253BC8005AB5DA, + 1865067006253BC8005AB5DA, + 1865067606253BC8005AB5DA, + 1865067B06253BC8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865065F06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865066006253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865066106253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865066206253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865066306253BC8005AB5DA = { + children = ( + 1865066406253BC8005AB5DA, + 1865066506253BC8005AB5DA, + 1865066606253BC8005AB5DA, + 1865066706253BC8005AB5DA, + 1865066806253BC8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865066406253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel01.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865066506253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel02mid.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865066606253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel_ribs.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865066706253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xray.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865066806253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xraybig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865066906253BC8005AB5DA = { + children = ( + 1865066A06253BC8005AB5DA, + 1865066B06253BC8005AB5DA, + 1865066C06253BC8005AB5DA, + 1865066D06253BC8005AB5DA, + 1865066E06253BC8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865066A06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel01.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865066B06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel02mid.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865066C06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel_ribs.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865066D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xray.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865066E06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xraybig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865066F06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865067006253BC8005AB5DA = { + children = ( + 1865067106253BC8005AB5DA, + 1865067206253BC8005AB5DA, + 1865067306253BC8005AB5DA, + 1865067406253BC8005AB5DA, + 1865067506253BC8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865067106253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "skel01.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865067206253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "skel02mid.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865067306253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "skel_ribs.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865067406253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "xray.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865067506253BC8005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "xraybig.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865067606253BC8005AB5DA = { + children = ( + 1865067706253BC8005AB5DA, + 1865067806253BC8005AB5DA, + 1865067906253BC8005AB5DA, + 1865067A06253BC8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865067706253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865067806253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865067906253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865067A06253BC8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865067B06253BC8005AB5DA = { + children = ( + 1865067C06253BC8005AB5DA, + 1865067D06253BC8005AB5DA, + 1865067E06253BC8005AB5DA, + 1865067F06253BC8005AB5DA, + 1865068006253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865067C06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel01.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865067D06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel02mid.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865067E06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skel_ribs.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865067F06253BC8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xray.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865068006253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xraybig.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865068106253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = skel01.md3; + refType = 4; + sourceTree = ""; + }; + 1865068206253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = skel02mid.md3; + refType = 4; + sourceTree = ""; + }; + 1865068306253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = skel_ribs.md3; + refType = 4; + sourceTree = ""; + }; + 1865068406253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = xray.md3; + refType = 4; + sourceTree = ""; + }; + 1865068506253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = xraybig.md3; + refType = 4; + sourceTree = ""; + }; + 1865068606253BC9005AB5DA = { + children = ( + 1865068706253BC9005AB5DA, + 186506A206253BC9005AB5DA, + 186506A306253BC9005AB5DA, + 186506A406253BC9005AB5DA, + ); + isa = PBXGroup; + path = skull; + refType = 4; + sourceTree = ""; + }; + 1865068706253BC9005AB5DA = { + children = ( + 1865068806253BC9005AB5DA, + 1865068906253BC9005AB5DA, + 1865068A06253BC9005AB5DA, + 1865068B06253BC9005AB5DA, + 1865068C06253BC9005AB5DA, + 1865069006253BC9005AB5DA, + 1865069406253BC9005AB5DA, + 1865069506253BC9005AB5DA, + 1865069906253BC9005AB5DA, + 1865069E06253BC9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865068806253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865068906253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865068A06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865068B06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865068C06253BC9005AB5DA = { + children = ( + 1865068D06253BC9005AB5DA, + 1865068E06253BC9005AB5DA, + 1865068F06253BC9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865068D06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "monkeyface.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865068E06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865068F06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull_tilt1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865069006253BC9005AB5DA = { + children = ( + 1865069106253BC9005AB5DA, + 1865069206253BC9005AB5DA, + 1865069306253BC9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865069106253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "monkeyface.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865069206253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865069306253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull_tilt1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865069406253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865069506253BC9005AB5DA = { + children = ( + 1865069606253BC9005AB5DA, + 1865069706253BC9005AB5DA, + 1865069806253BC9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865069606253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "monkeyface.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865069706253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "skull.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865069806253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "skull_tilt1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865069906253BC9005AB5DA = { + children = ( + 1865069A06253BC9005AB5DA, + 1865069B06253BC9005AB5DA, + 1865069C06253BC9005AB5DA, + 1865069D06253BC9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865069A06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865069B06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865069C06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865069D06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865069E06253BC9005AB5DA = { + children = ( + 1865069F06253BC9005AB5DA, + 186506A006253BC9005AB5DA, + 186506A106253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865069F06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "monkeyface.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506A006253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506A106253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skull_tilt1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506A206253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = monkeyface.md3; + refType = 4; + sourceTree = ""; + }; + 186506A306253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = skull.md3; + refType = 4; + sourceTree = ""; + }; + 186506A406253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = skull_tilt1.md3; + refType = 4; + sourceTree = ""; + }; + 186506A506253BC9005AB5DA = { + children = ( + 186506A606253BC9005AB5DA, + 186506B906253BC9005AB5DA, + ); + isa = PBXGroup; + path = spotlamp; + refType = 4; + sourceTree = ""; + }; + 186506A606253BC9005AB5DA = { + children = ( + 186506A706253BC9005AB5DA, + 186506A806253BC9005AB5DA, + 186506A906253BC9005AB5DA, + 186506AA06253BC9005AB5DA, + 186506AB06253BC9005AB5DA, + 186506AD06253BC9005AB5DA, + 186506AF06253BC9005AB5DA, + 186506B006253BC9005AB5DA, + 186506B206253BC9005AB5DA, + 186506B706253BC9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186506A706253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186506A806253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186506A906253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186506AA06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186506AB06253BC9005AB5DA = { + children = ( + 186506AC06253BC9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506AC06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spotlamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506AD06253BC9005AB5DA = { + children = ( + 186506AE06253BC9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506AE06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spotlamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506AF06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186506B006253BC9005AB5DA = { + children = ( + 186506B106253BC9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506B106253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "spotlamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506B206253BC9005AB5DA = { + children = ( + 186506B306253BC9005AB5DA, + 186506B406253BC9005AB5DA, + 186506B506253BC9005AB5DA, + 186506B606253BC9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186506B306253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506B406253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506B506253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506B606253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506B706253BC9005AB5DA = { + children = ( + 186506B806253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506B806253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spotlamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506B906253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = spotlamp.md3; + refType = 4; + sourceTree = ""; + }; + 186506BA06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = statue_major.md3; + refType = 4; + sourceTree = ""; + }; + 186506BB06253BC9005AB5DA = { + children = ( + 186506BC06253BC9005AB5DA, + 186506D706253BC9005AB5DA, + 186506D806253BC9005AB5DA, + 186506D906253BC9005AB5DA, + ); + isa = PBXGroup; + path = storch; + refType = 4; + sourceTree = ""; + }; + 186506BC06253BC9005AB5DA = { + children = ( + 186506BD06253BC9005AB5DA, + 186506BE06253BC9005AB5DA, + 186506BF06253BC9005AB5DA, + 186506C006253BC9005AB5DA, + 186506C106253BC9005AB5DA, + 186506C506253BC9005AB5DA, + 186506C906253BC9005AB5DA, + 186506CA06253BC9005AB5DA, + 186506CE06253BC9005AB5DA, + 186506D306253BC9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186506BD06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186506BE06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186506BF06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186506C006253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186506C106253BC9005AB5DA = { + children = ( + 186506C206253BC9005AB5DA, + 186506C306253BC9005AB5DA, + 186506C406253BC9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506C206253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506C306253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storchx.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506C406253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tall_torch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506C506253BC9005AB5DA = { + children = ( + 186506C606253BC9005AB5DA, + 186506C706253BC9005AB5DA, + 186506C806253BC9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506C606253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506C706253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storchx.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506C806253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tall_torch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506C906253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186506CA06253BC9005AB5DA = { + children = ( + 186506CB06253BC9005AB5DA, + 186506CC06253BC9005AB5DA, + 186506CD06253BC9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506CB06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "storch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506CC06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "storchx.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506CD06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tall_torch.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506CE06253BC9005AB5DA = { + children = ( + 186506CF06253BC9005AB5DA, + 186506D006253BC9005AB5DA, + 186506D106253BC9005AB5DA, + 186506D206253BC9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186506CF06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506D006253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506D106253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506D206253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506D306253BC9005AB5DA = { + children = ( + 186506D406253BC9005AB5DA, + 186506D506253BC9005AB5DA, + 186506D606253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506D406253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506D506253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "storchx.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506D606253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tall_torch.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506D706253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = storch.md3; + refType = 4; + sourceTree = ""; + }; + 186506D806253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = storchx.md3; + refType = 4; + sourceTree = ""; + }; + 186506D906253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tall_torch.md3; + refType = 4; + sourceTree = ""; + }; + 186506DA06253BC9005AB5DA = { + children = ( + 186506DB06253BC9005AB5DA, + 186506EE06253BC9005AB5DA, + ); + isa = PBXGroup; + path = teleporter; + refType = 4; + sourceTree = ""; + }; + 186506DB06253BC9005AB5DA = { + children = ( + 186506DC06253BC9005AB5DA, + 186506DD06253BC9005AB5DA, + 186506DE06253BC9005AB5DA, + 186506DF06253BC9005AB5DA, + 186506E006253BC9005AB5DA, + 186506E206253BC9005AB5DA, + 186506E406253BC9005AB5DA, + 186506E506253BC9005AB5DA, + 186506E706253BC9005AB5DA, + 186506EC06253BC9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186506DC06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186506DD06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186506DE06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186506DF06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186506E006253BC9005AB5DA = { + children = ( + 186506E106253BC9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506E106253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "teleporter.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506E206253BC9005AB5DA = { + children = ( + 186506E306253BC9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506E306253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "teleporter.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506E406253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186506E506253BC9005AB5DA = { + children = ( + 186506E606253BC9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506E606253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "teleporter.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506E706253BC9005AB5DA = { + children = ( + 186506E806253BC9005AB5DA, + 186506E906253BC9005AB5DA, + 186506EA06253BC9005AB5DA, + 186506EB06253BC9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186506E806253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506E906253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506EA06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506EB06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506EC06253BC9005AB5DA = { + children = ( + 186506ED06253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186506ED06253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "teleporter.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506EE06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = teleporter.md3; + refType = 4; + sourceTree = ""; + }; + 186506EF06253BC9005AB5DA = { + children = ( + 186506F006253BC9005AB5DA, + 1865070306253BC9005AB5DA, + ); + isa = PBXGroup; + path = timlamp; + refType = 4; + sourceTree = ""; + }; + 186506F006253BC9005AB5DA = { + children = ( + 186506F106253BC9005AB5DA, + 186506F206253BC9005AB5DA, + 186506F306253BC9005AB5DA, + 186506F406253BC9005AB5DA, + 186506F506253BC9005AB5DA, + 186506F706253BC9005AB5DA, + 186506F906253BC9005AB5DA, + 186506FA06253BC9005AB5DA, + 186506FC06253BC9005AB5DA, + 1865070106253BC9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186506F106253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186506F206253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186506F306253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186506F406253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186506F506253BC9005AB5DA = { + children = ( + 186506F606253BC9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506F606253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "timlamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506F706253BC9005AB5DA = { + children = ( + 186506F806253BC9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506F806253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "timlamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186506F906253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186506FA06253BC9005AB5DA = { + children = ( + 186506FB06253BC9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186506FB06253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "timlamp.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186506FC06253BC9005AB5DA = { + children = ( + 186506FD06253BC9005AB5DA, + 186506FE06253BC9005AB5DA, + 186506FF06253BC9005AB5DA, + 1865070006253BC9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186506FD06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186506FE06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186506FF06253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865070006253BC9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865070106253BC9005AB5DA = { + children = ( + 1865070206253BC9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865070206253BC9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "timlamp.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865070306253BC9005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = timlamp.md3; + refType = 4; + sourceTree = ""; + }; + 1865070406253BC9005AB5DA = { + children = ( + 1865070506253BC9005AB5DA, + 1865074406253BCA005AB5DA, + 1865074506253BCA005AB5DA, + 1865074606253BCA005AB5DA, + 1865074706253BCA005AB5DA, + 1865074806253BCA005AB5DA, + 1865074906253BCA005AB5DA, + 1865074A06253BCA005AB5DA, + 1865074B06253BCA005AB5DA, + 1865074C06253BCA005AB5DA, + 1865074D06253BCA005AB5DA, + 1865074E06253BCA005AB5DA, + 1865074F06253BCA005AB5DA, + ); + isa = PBXGroup; + path = tree2; + refType = 4; + sourceTree = ""; + }; + 1865070506253BC9005AB5DA = { + children = ( + 1865070606253BCA005AB5DA, + 1865070706253BCA005AB5DA, + 1865070806253BCA005AB5DA, + 1865070906253BCA005AB5DA, + 1865070A06253BCA005AB5DA, + 1865071706253BCA005AB5DA, + 1865072406253BCA005AB5DA, + 1865072506253BCA005AB5DA, + 1865073206253BCA005AB5DA, + 1865073706253BCA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865070606253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865070706253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865070806253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865070906253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865070A06253BCA005AB5DA = { + children = ( + 1865070B06253BCA005AB5DA, + 1865070C06253BCA005AB5DA, + 1865070D06253BCA005AB5DA, + 1865070E06253BCA005AB5DA, + 1865070F06253BCA005AB5DA, + 1865071006253BCA005AB5DA, + 1865071106253BCA005AB5DA, + 1865071206253BCA005AB5DA, + 1865071306253BCA005AB5DA, + 1865071406253BCA005AB5DA, + 1865071506253BCA005AB5DA, + 1865071606253BCA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865070B06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "branch2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865070C06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865070D06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree10.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865070E06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865070F06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree3.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071006253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree4.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071106253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree5.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071206253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree6.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071306253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree7.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071406253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree8.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071506253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree9.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071606253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trunk2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865071706253BCA005AB5DA = { + children = ( + 1865071806253BCA005AB5DA, + 1865071906253BCA005AB5DA, + 1865071A06253BCA005AB5DA, + 1865071B06253BCA005AB5DA, + 1865071C06253BCA005AB5DA, + 1865071D06253BCA005AB5DA, + 1865071E06253BCA005AB5DA, + 1865071F06253BCA005AB5DA, + 1865072006253BCA005AB5DA, + 1865072106253BCA005AB5DA, + 1865072206253BCA005AB5DA, + 1865072306253BCA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865071806253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "branch2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071906253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071A06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree10.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071B06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071C06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree3.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071D06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree4.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071E06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree5.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865071F06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree6.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865072006253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree7.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865072106253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree8.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865072206253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree9.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865072306253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trunk2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865072406253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865072506253BCA005AB5DA = { + children = ( + 1865072606253BCA005AB5DA, + 1865072706253BCA005AB5DA, + 1865072806253BCA005AB5DA, + 1865072906253BCA005AB5DA, + 1865072A06253BCA005AB5DA, + 1865072B06253BCA005AB5DA, + 1865072C06253BCA005AB5DA, + 1865072D06253BCA005AB5DA, + 1865072E06253BCA005AB5DA, + 1865072F06253BCA005AB5DA, + 1865073006253BCA005AB5DA, + 1865073106253BCA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865072606253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "branch2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072706253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree1.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072806253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree10.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072906253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree2.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072A06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree3.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072B06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree4.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072C06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree5.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072D06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree6.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072E06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree7.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865072F06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree8.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865073006253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "tree9.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865073106253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "trunk2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865073206253BCA005AB5DA = { + children = ( + 1865073306253BCA005AB5DA, + 1865073406253BCA005AB5DA, + 1865073506253BCA005AB5DA, + 1865073606253BCA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865073306253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865073406253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865073506253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865073606253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865073706253BCA005AB5DA = { + children = ( + 1865073806253BCA005AB5DA, + 1865073906253BCA005AB5DA, + 1865073A06253BCA005AB5DA, + 1865073B06253BCA005AB5DA, + 1865073C06253BCA005AB5DA, + 1865073D06253BCA005AB5DA, + 1865073E06253BCA005AB5DA, + 1865073F06253BCA005AB5DA, + 1865074006253BCA005AB5DA, + 1865074106253BCA005AB5DA, + 1865074206253BCA005AB5DA, + 1865074306253BCA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865073806253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "branch2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073906253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree1.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073A06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree10.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073B06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree2.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073C06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree3.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073D06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree4.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073E06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree5.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865073F06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree6.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865074006253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree7.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865074106253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree8.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865074206253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree9.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865074306253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trunk2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865074406253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = branch2.tga; + refType = 4; + sourceTree = ""; + }; + 1865074506253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree1.md3; + refType = 4; + sourceTree = ""; + }; + 1865074606253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree10.md3; + refType = 4; + sourceTree = ""; + }; + 1865074706253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree2.md3; + refType = 4; + sourceTree = ""; + }; + 1865074806253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree3.md3; + refType = 4; + sourceTree = ""; + }; + 1865074906253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree4.md3; + refType = 4; + sourceTree = ""; + }; + 1865074A06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree5.md3; + refType = 4; + sourceTree = ""; + }; + 1865074B06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree6.md3; + refType = 4; + sourceTree = ""; + }; + 1865074C06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree7.md3; + refType = 4; + sourceTree = ""; + }; + 1865074D06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree8.md3; + refType = 4; + sourceTree = ""; + }; + 1865074E06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = tree9.md3; + refType = 4; + sourceTree = ""; + }; + 1865074F06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = trunk2.tga; + refType = 4; + sourceTree = ""; + }; + 1865075006253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = visor_posed.md3; + refType = 4; + sourceTree = ""; + }; + 1865075106253BCA005AB5DA = { + children = ( + 1865075206253BCA005AB5DA, + 1865076D06253BCA005AB5DA, + 1865076E06253BCA005AB5DA, + 1865076F06253BCA005AB5DA, + ); + isa = PBXGroup; + path = wallhead; + refType = 4; + sourceTree = ""; + }; + 1865075206253BCA005AB5DA = { + children = ( + 1865075306253BCA005AB5DA, + 1865075406253BCA005AB5DA, + 1865075506253BCA005AB5DA, + 1865075606253BCA005AB5DA, + 1865075706253BCA005AB5DA, + 1865075B06253BCA005AB5DA, + 1865075F06253BCA005AB5DA, + 1865076006253BCA005AB5DA, + 1865076406253BCA005AB5DA, + 1865076906253BCA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865075306253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865075406253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865075506253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865075606253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865075706253BCA005AB5DA = { + children = ( + 1865075806253BCA005AB5DA, + 1865075906253BCA005AB5DA, + 1865075A06253BCA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865075806253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "femhead.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865075906253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lion.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865075A06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wallhead02.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865075B06253BCA005AB5DA = { + children = ( + 1865075C06253BCA005AB5DA, + 1865075D06253BCA005AB5DA, + 1865075E06253BCA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865075C06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "femhead.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865075D06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lion.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865075E06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wallhead02.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865075F06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865076006253BCA005AB5DA = { + children = ( + 1865076106253BCA005AB5DA, + 1865076206253BCA005AB5DA, + 1865076306253BCA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865076106253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "femhead.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865076206253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "lion.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865076306253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "wallhead02.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865076406253BCA005AB5DA = { + children = ( + 1865076506253BCA005AB5DA, + 1865076606253BCA005AB5DA, + 1865076706253BCA005AB5DA, + 1865076806253BCA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865076506253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865076606253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865076706253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865076806253BCA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865076906253BCA005AB5DA = { + children = ( + 1865076A06253BCA005AB5DA, + 1865076B06253BCA005AB5DA, + 1865076C06253BCA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865076A06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "femhead.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865076B06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lion.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865076C06253BCA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wallhead02.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865076D06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = femhead.md3; + refType = 4; + sourceTree = ""; + }; + 1865076E06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = lion.md3; + refType = 4; + sourceTree = ""; + }; + 1865076F06253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = wallhead02.md3; + refType = 4; + sourceTree = ""; + }; + 1865077006253BCA005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = walllamp3.md3; + refType = 4; + sourceTree = ""; + }; + 1865077106253BCB005AB5DA = { + children = ( + 1865077206253BCB005AB5DA, + 186507FD06253BCC005AB5DA, + 186507FE06253BCC005AB5DA, + 186507FF06253BCC005AB5DA, + 1865080006253BCC005AB5DA, + 1865080106253BCC005AB5DA, + 1865080206253BCC005AB5DA, + 1865080306253BCC005AB5DA, + 1865080406253BCC005AB5DA, + 1865080506253BCC005AB5DA, + 1865080606253BCC005AB5DA, + 1865080706253BCC005AB5DA, + 1865080806253BCC005AB5DA, + 1865080906253BCC005AB5DA, + 1865080A06253BCC005AB5DA, + 1865080B06253BCC005AB5DA, + 1865080C06253BCC005AB5DA, + 1865080D06253BCC005AB5DA, + 1865080E06253BCC005AB5DA, + 1865080F06253BCC005AB5DA, + 1865081006253BCC005AB5DA, + 1865081106253BCC005AB5DA, + 1865081206253BCC005AB5DA, + 1865081306253BCC005AB5DA, + 1865081406253BCC005AB5DA, + 1865081506253BCC005AB5DA, + 1865081606253BCC005AB5DA, + 1865081706253BCC005AB5DA, + 1865081806253BCC005AB5DA, + 1865081906253BCC005AB5DA, + 1865081A06253BCC005AB5DA, + 1865081B06253BCC005AB5DA, + ); + isa = PBXGroup; + path = scripts; + refType = 4; + sourceTree = ""; + }; + 1865077206253BCB005AB5DA = { + children = ( + 1865077306253BCB005AB5DA, + 1865077406253BCB005AB5DA, + 1865077506253BCB005AB5DA, + 1865077606253BCB005AB5DA, + 1865077706253BCB005AB5DA, + 1865079706253BCB005AB5DA, + 186507B706253BCB005AB5DA, + 186507B806253BCB005AB5DA, + 186507D806253BCC005AB5DA, + 186507DD06253BCC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865077306253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865077406253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865077506253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865077606253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865077706253BCB005AB5DA = { + children = ( + 1865077806253BCB005AB5DA, + 1865077906253BCB005AB5DA, + 1865077A06253BCB005AB5DA, + 1865077B06253BCB005AB5DA, + 1865077C06253BCB005AB5DA, + 1865077D06253BCB005AB5DA, + 1865077E06253BCB005AB5DA, + 1865077F06253BCB005AB5DA, + 1865078006253BCB005AB5DA, + 1865078106253BCB005AB5DA, + 1865078206253BCB005AB5DA, + 1865078306253BCB005AB5DA, + 1865078406253BCB005AB5DA, + 1865078506253BCB005AB5DA, + 1865078606253BCB005AB5DA, + 1865078706253BCB005AB5DA, + 1865078806253BCB005AB5DA, + 1865078906253BCB005AB5DA, + 1865078A06253BCB005AB5DA, + 1865078B06253BCB005AB5DA, + 1865078C06253BCB005AB5DA, + 1865078D06253BCB005AB5DA, + 1865078E06253BCB005AB5DA, + 1865078F06253BCB005AB5DA, + 1865079006253BCB005AB5DA, + 1865079106253BCB005AB5DA, + 1865079206253BCB005AB5DA, + 1865079306253BCB005AB5DA, + 1865079406253BCB005AB5DA, + 1865079506253BCB005AB5DA, + 1865079606253BCB005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865077806253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_button.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077906253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_door.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077A06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077B06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077C06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_object.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077D06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_support.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077E06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865077F06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078006253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078106253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078206253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "default_project.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078306253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078406253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078506253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_block.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078606253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_button.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078706253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_door.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078806253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078906253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078A06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078B06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078C06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hell.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078D06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078E06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865078F06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079006253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "organics.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079106253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079206253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079306253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079406253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skin.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079506253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079606253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865079706253BCB005AB5DA = { + children = ( + 1865079806253BCB005AB5DA, + 1865079906253BCB005AB5DA, + 1865079A06253BCB005AB5DA, + 1865079B06253BCB005AB5DA, + 1865079C06253BCB005AB5DA, + 1865079D06253BCB005AB5DA, + 1865079E06253BCB005AB5DA, + 1865079F06253BCB005AB5DA, + 186507A006253BCB005AB5DA, + 186507A106253BCB005AB5DA, + 186507A206253BCB005AB5DA, + 186507A306253BCB005AB5DA, + 186507A406253BCB005AB5DA, + 186507A506253BCB005AB5DA, + 186507A606253BCB005AB5DA, + 186507A706253BCB005AB5DA, + 186507A806253BCB005AB5DA, + 186507A906253BCB005AB5DA, + 186507AA06253BCB005AB5DA, + 186507AB06253BCB005AB5DA, + 186507AC06253BCB005AB5DA, + 186507AD06253BCB005AB5DA, + 186507AE06253BCB005AB5DA, + 186507AF06253BCB005AB5DA, + 186507B006253BCB005AB5DA, + 186507B106253BCB005AB5DA, + 186507B206253BCB005AB5DA, + 186507B306253BCB005AB5DA, + 186507B406253BCB005AB5DA, + 186507B506253BCB005AB5DA, + 186507B606253BCB005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865079806253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_button.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079906253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_door.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079A06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079B06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079C06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_object.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079D06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_support.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079E06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865079F06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A006253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A106253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A206253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "default_project.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A306253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A406253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A506253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_block.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A606253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_button.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A706253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_door.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A806253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507A906253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AA06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AB06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AC06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hell.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AD06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AE06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507AF06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B006253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "organics.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B106253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B206253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B306253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B406253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skin.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B506253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B606253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507B706253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186507B806253BCB005AB5DA = { + children = ( + 186507B906253BCB005AB5DA, + 186507BA06253BCB005AB5DA, + 186507BB06253BCB005AB5DA, + 186507BC06253BCB005AB5DA, + 186507BD06253BCB005AB5DA, + 186507BE06253BCB005AB5DA, + 186507BF06253BCB005AB5DA, + 186507C006253BCB005AB5DA, + 186507C106253BCB005AB5DA, + 186507C206253BCB005AB5DA, + 186507C306253BCC005AB5DA, + 186507C406253BCC005AB5DA, + 186507C506253BCC005AB5DA, + 186507C606253BCC005AB5DA, + 186507C706253BCC005AB5DA, + 186507C806253BCC005AB5DA, + 186507C906253BCC005AB5DA, + 186507CA06253BCC005AB5DA, + 186507CB06253BCC005AB5DA, + 186507CC06253BCC005AB5DA, + 186507CD06253BCC005AB5DA, + 186507CE06253BCC005AB5DA, + 186507CF06253BCC005AB5DA, + 186507D006253BCC005AB5DA, + 186507D106253BCC005AB5DA, + 186507D206253BCC005AB5DA, + 186507D306253BCC005AB5DA, + 186507D406253BCC005AB5DA, + 186507D506253BCC005AB5DA, + 186507D606253BCC005AB5DA, + 186507D706253BCC005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186507B906253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_button.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BA06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_door.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BB06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BC06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BD06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_object.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BE06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_support.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507BF06253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C006253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C106253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C206253BCB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "default_project.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_block.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_button.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C806253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_door.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507C906253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CA06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CB06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CC06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CD06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hell.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CE06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507CF06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "organics.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D206253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skin.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186507D806253BCC005AB5DA = { + children = ( + 186507D906253BCC005AB5DA, + 186507DA06253BCC005AB5DA, + 186507DB06253BCC005AB5DA, + 186507DC06253BCC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186507D906253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186507DA06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186507DB06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186507DC06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186507DD06253BCC005AB5DA = { + children = ( + 186507DE06253BCC005AB5DA, + 186507DF06253BCC005AB5DA, + 186507E006253BCC005AB5DA, + 186507E106253BCC005AB5DA, + 186507E206253BCC005AB5DA, + 186507E306253BCC005AB5DA, + 186507E406253BCC005AB5DA, + 186507E506253BCC005AB5DA, + 186507E606253BCC005AB5DA, + 186507E706253BCC005AB5DA, + 186507E806253BCC005AB5DA, + 186507E906253BCC005AB5DA, + 186507EA06253BCC005AB5DA, + 186507EB06253BCC005AB5DA, + 186507EC06253BCC005AB5DA, + 186507ED06253BCC005AB5DA, + 186507EE06253BCC005AB5DA, + 186507EF06253BCC005AB5DA, + 186507F006253BCC005AB5DA, + 186507F106253BCC005AB5DA, + 186507F206253BCC005AB5DA, + 186507F306253BCC005AB5DA, + 186507F406253BCC005AB5DA, + 186507F506253BCC005AB5DA, + 186507F606253BCC005AB5DA, + 186507F706253BCC005AB5DA, + 186507F806253BCC005AB5DA, + 186507F906253BCC005AB5DA, + 186507FA06253BCC005AB5DA, + 186507FB06253BCC005AB5DA, + 186507FC06253BCC005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186507DE06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_button.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507DF06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_door.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E206253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_object.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_support.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E806253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "default_project.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507E906253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507EA06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507EB06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_block.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507EC06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_button.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507ED06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_door.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507EE06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507EF06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F206253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hell.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "organics.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F806253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507F906253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507FA06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skin.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507FB06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademoQ3.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507FC06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186507FD06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_button.shader; + refType = 4; + sourceTree = ""; + }; + 186507FE06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_door.shader; + refType = 4; + sourceTree = ""; + }; + 186507FF06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_floor.shader; + refType = 4; + sourceTree = ""; + }; + 1865080006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_light.shader; + refType = 4; + sourceTree = ""; + }; + 1865080106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_object.shader; + refType = 4; + sourceTree = ""; + }; + 1865080206253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_support.shader; + refType = 4; + sourceTree = ""; + }; + 1865080306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_trim.shader; + refType = 4; + sourceTree = ""; + }; + 1865080406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_wall.shader; + refType = 4; + sourceTree = ""; + }; + 1865080506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = common.shader; + refType = 4; + sourceTree = ""; + }; + 1865080606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ctf.shader; + refType = 4; + sourceTree = ""; + }; + 1865080706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = default_project.proj; + refType = 4; + sourceTree = ""; + }; + 1865080806253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = entities.def; + refType = 4; + sourceTree = ""; + }; + 1865080906253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gfx.shader; + refType = 4; + sourceTree = ""; + }; + 1865080A06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_block.shader; + refType = 4; + sourceTree = ""; + }; + 1865080B06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_button.shader; + refType = 4; + sourceTree = ""; + }; + 1865080C06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_door.shader; + refType = 4; + sourceTree = ""; + }; + 1865080D06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_floor.shader; + refType = 4; + sourceTree = ""; + }; + 1865080E06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_light.shader; + refType = 4; + sourceTree = ""; + }; + 1865080F06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_trim.shader; + refType = 4; + sourceTree = ""; + }; + 1865081006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_wall.shader; + refType = 4; + sourceTree = ""; + }; + 1865081106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = hell.shader; + refType = 4; + sourceTree = ""; + }; + 1865081206253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = liquids.shader; + refType = 4; + sourceTree = ""; + }; + 1865081306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = models.shader; + refType = 4; + sourceTree = ""; + }; + 1865081406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = museum.shader; + refType = 4; + sourceTree = ""; + }; + 1865081506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = organics.shader; + refType = 4; + sourceTree = ""; + }; + 1865081606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = sfx.shader; + refType = 4; + sourceTree = ""; + }; + 1865081706253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shaderlist.txt; + refType = 4; + sourceTree = ""; + }; + 1865081806253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = skies.shader; + refType = 4; + sourceTree = ""; + }; + 1865081906253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = skin.shader; + refType = 4; + sourceTree = ""; + }; + 1865081A06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = terrademoQ3.shader; + refType = 4; + sourceTree = ""; + }; + 1865081B06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = test.shader; + refType = 4; + sourceTree = ""; + }; + 1865081C06253BCC005AB5DA = { + children = ( + 1865081D06253BCC005AB5DA, + 1865082C06253BCC005AB5DA, + 1865084106253BCC005AB5DA, + 1865085606253BCD005AB5DA, + ); + isa = PBXGroup; + path = textures; + refType = 4; + sourceTree = ""; + }; + 1865081D06253BCC005AB5DA = { + children = ( + 1865081E06253BCC005AB5DA, + 1865081F06253BCC005AB5DA, + 1865082006253BCC005AB5DA, + 1865082106253BCC005AB5DA, + 1865082206253BCC005AB5DA, + 1865082306253BCC005AB5DA, + 1865082406253BCC005AB5DA, + 1865082506253BCC005AB5DA, + 1865082606253BCC005AB5DA, + 1865082B06253BCC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865081E06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865081F06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865082006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865082106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865082206253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865082306253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865082406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865082506253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865082606253BCC005AB5DA = { + children = ( + 1865082706253BCC005AB5DA, + 1865082806253BCC005AB5DA, + 1865082906253BCC005AB5DA, + 1865082A06253BCC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865082706253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865082806253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865082906253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865082A06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865082B06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865082C06253BCC005AB5DA = { + children = ( + 1865082D06253BCC005AB5DA, + 1865084006253BCC005AB5DA, + ); + isa = PBXGroup; + path = proto2; + refType = 4; + sourceTree = ""; + }; + 1865082D06253BCC005AB5DA = { + children = ( + 1865082E06253BCC005AB5DA, + 1865082F06253BCC005AB5DA, + 1865083006253BCC005AB5DA, + 1865083106253BCC005AB5DA, + 1865083206253BCC005AB5DA, + 1865083406253BCC005AB5DA, + 1865083606253BCC005AB5DA, + 1865083706253BCC005AB5DA, + 1865083906253BCC005AB5DA, + 1865083E06253BCC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865082E06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865082F06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865083006253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865083106253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865083206253BCC005AB5DA = { + children = ( + 1865083306253BCC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865083306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pj_terralpha01.pcx.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865083406253BCC005AB5DA = { + children = ( + 1865083506253BCC005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865083506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pj_terralpha01.pcx.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865083606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865083706253BCC005AB5DA = { + children = ( + 1865083806253BCC005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865083806253BCC005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pj_terralpha01.pcx.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865083906253BCC005AB5DA = { + children = ( + 1865083A06253BCC005AB5DA, + 1865083B06253BCC005AB5DA, + 1865083C06253BCC005AB5DA, + 1865083D06253BCC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865083A06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865083B06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865083C06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865083D06253BCC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865083E06253BCC005AB5DA = { + children = ( + 1865083F06253BCC005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865083F06253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pj_terralpha01.pcx.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865084006253BCC005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pj_terralpha01.pcx; + refType = 4; + sourceTree = ""; + }; + 1865084106253BCC005AB5DA = { + children = ( + 1865084206253BCC005AB5DA, + 1865085506253BCD005AB5DA, + ); + isa = PBXGroup; + path = skies2; + refType = 4; + sourceTree = ""; + }; + 1865084206253BCC005AB5DA = { + children = ( + 1865084306253BCC005AB5DA, + 1865084406253BCC005AB5DA, + 1865084506253BCC005AB5DA, + 1865084606253BCC005AB5DA, + 1865084706253BCC005AB5DA, + 1865084906253BCD005AB5DA, + 1865084B06253BCD005AB5DA, + 1865084C06253BCD005AB5DA, + 1865084E06253BCD005AB5DA, + 1865085306253BCD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865084306253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865084406253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865084506253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865084606253BCC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865084706253BCC005AB5DA = { + children = ( + 1865084806253BCD005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865084806253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clouds.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865084906253BCD005AB5DA = { + children = ( + 1865084A06253BCD005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865084A06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clouds.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865084B06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865084C06253BCD005AB5DA = { + children = ( + 1865084D06253BCD005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865084D06253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "clouds.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865084E06253BCD005AB5DA = { + children = ( + 1865084F06253BCD005AB5DA, + 1865085006253BCD005AB5DA, + 1865085106253BCD005AB5DA, + 1865085206253BCD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865084F06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865085006253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865085106253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865085206253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865085306253BCD005AB5DA = { + children = ( + 1865085406253BCD005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865085406253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clouds.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865085506253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = clouds.tga; + refType = 4; + sourceTree = ""; + }; + 1865085606253BCD005AB5DA = { + children = ( + 1865085706253BCD005AB5DA, + 1865087206253BCD005AB5DA, + 1865087306253BCD005AB5DA, + 1865087406253BCD005AB5DA, + ); + isa = PBXGroup; + path = stone; + refType = 4; + sourceTree = ""; + }; + 1865085706253BCD005AB5DA = { + children = ( + 1865085806253BCD005AB5DA, + 1865085906253BCD005AB5DA, + 1865085A06253BCD005AB5DA, + 1865085B06253BCD005AB5DA, + 1865085C06253BCD005AB5DA, + 1865086006253BCD005AB5DA, + 1865086406253BCD005AB5DA, + 1865086506253BCD005AB5DA, + 1865086906253BCD005AB5DA, + 1865086E06253BCD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865085806253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865085906253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865085A06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865085B06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865085C06253BCD005AB5DA = { + children = ( + 1865085D06253BCD005AB5DA, + 1865085E06253BCD005AB5DA, + 1865085F06253BCD005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865085D06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock10b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865085E06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock12b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865085F06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock9b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865086006253BCD005AB5DA = { + children = ( + 1865086106253BCD005AB5DA, + 1865086206253BCD005AB5DA, + 1865086306253BCD005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865086106253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock10b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865086206253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock12b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865086306253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock9b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865086406253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865086506253BCD005AB5DA = { + children = ( + 1865086606253BCD005AB5DA, + 1865086706253BCD005AB5DA, + 1865086806253BCD005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865086606253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pjrock10b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865086706253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pjrock12b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865086806253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "pjrock9b_2.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865086906253BCD005AB5DA = { + children = ( + 1865086A06253BCD005AB5DA, + 1865086B06253BCD005AB5DA, + 1865086C06253BCD005AB5DA, + 1865086D06253BCD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865086A06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865086B06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865086C06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865086D06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865086E06253BCD005AB5DA = { + children = ( + 1865086F06253BCD005AB5DA, + 1865087006253BCD005AB5DA, + 1865087106253BCD005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865086F06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock10b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865087006253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock12b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865087106253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pjrock9b_2.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865087206253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pjrock10b_2.tga; + refType = 4; + sourceTree = ""; + }; + 1865087306253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pjrock12b_2.tga; + refType = 4; + sourceTree = ""; + }; + 1865087406253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pjrock9b_2.tga; + refType = 4; + sourceTree = ""; + }; + 1865087506253BCD005AB5DA = { + children = ( + 1865087606253BCD005AB5DA, + 1865088D06253BCD005AB5DA, + 1865088E06253BCD005AB5DA, + 186508DB06253BCE005AB5DA, + 1865091506253BCF005AB5DA, + 1865099D06253BD0005AB5DA, + 1865099E06253BD0005AB5DA, + ); + isa = PBXGroup; + path = missionpack; + refType = 4; + sourceTree = ""; + }; + 1865087606253BCD005AB5DA = { + children = ( + 1865087706253BCD005AB5DA, + 1865087806253BCD005AB5DA, + 1865087906253BCD005AB5DA, + 1865087A06253BCD005AB5DA, + 1865087B06253BCD005AB5DA, + 1865087E06253BCD005AB5DA, + 1865088106253BCD005AB5DA, + 1865088206253BCD005AB5DA, + 1865088506253BCD005AB5DA, + 1865088A06253BCD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865087706253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865087806253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865087906253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865087A06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865087B06253BCD005AB5DA = { + children = ( + 1865087C06253BCD005AB5DA, + 1865087D06253BCD005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865087C06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia-TA.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865087D06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo-README.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865087E06253BCD005AB5DA = { + children = ( + 1865087F06253BCD005AB5DA, + 1865088006253BCD005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865087F06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia-TA.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865088006253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo-README.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865088106253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865088206253BCD005AB5DA = { + children = ( + 1865088306253BCD005AB5DA, + 1865088406253BCD005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865088306253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "mapmedia-TA.pk3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865088406253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo-README.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865088506253BCD005AB5DA = { + children = ( + 1865088606253BCD005AB5DA, + 1865088706253BCD005AB5DA, + 1865088806253BCD005AB5DA, + 1865088906253BCD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865088606253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865088706253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865088806253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865088906253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865088A06253BCD005AB5DA = { + children = ( + 1865088B06253BCD005AB5DA, + 1865088C06253BCD005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865088B06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapmedia-TA.pk3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865088C06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo-README.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865088D06253BCD005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "mapmedia-TA.pk3"; + refType = 4; + sourceTree = ""; + }; + 1865088E06253BCD005AB5DA = { + children = ( + 1865088F06253BCD005AB5DA, + 186508A206253BCD005AB5DA, + 186508DA06253BCE005AB5DA, + ); + isa = PBXGroup; + path = maps; + refType = 4; + sourceTree = ""; + }; + 1865088F06253BCD005AB5DA = { + children = ( + 1865089006253BCD005AB5DA, + 1865089106253BCD005AB5DA, + 1865089206253BCD005AB5DA, + 1865089306253BCD005AB5DA, + 1865089406253BCD005AB5DA, + 1865089606253BCD005AB5DA, + 1865089806253BCD005AB5DA, + 1865089906253BCD005AB5DA, + 1865089B06253BCD005AB5DA, + 186508A006253BCD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865089006253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865089106253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865089206253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865089306253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865089406253BCD005AB5DA = { + children = ( + 1865089506253BCD005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865089506253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865089606253BCD005AB5DA = { + children = ( + 1865089706253BCD005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865089706253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865089806253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865089906253BCD005AB5DA = { + children = ( + 1865089A06253BCD005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865089A06253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865089B06253BCD005AB5DA = { + children = ( + 1865089C06253BCD005AB5DA, + 1865089D06253BCD005AB5DA, + 1865089E06253BCD005AB5DA, + 1865089F06253BCD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865089C06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865089D06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865089E06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865089F06253BCD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508A006253BCD005AB5DA = { + children = ( + 186508A106253BCD005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508A106253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508A206253BCD005AB5DA = { + children = ( + 186508A306253BCD005AB5DA, + 186508D206253BCE005AB5DA, + 186508D306253BCE005AB5DA, + 186508D406253BCE005AB5DA, + 186508D506253BCE005AB5DA, + 186508D606253BCE005AB5DA, + 186508D706253BCE005AB5DA, + 186508D806253BCE005AB5DA, + 186508D906253BCE005AB5DA, + ); + isa = PBXGroup; + path = "Team Arena Prefabs"; + refType = 4; + sourceTree = ""; + }; + 186508A306253BCD005AB5DA = { + children = ( + 186508A406253BCD005AB5DA, + 186508A506253BCD005AB5DA, + 186508A606253BCD005AB5DA, + 186508A706253BCD005AB5DA, + 186508A806253BCD005AB5DA, + 186508B106253BCE005AB5DA, + 186508BA06253BCE005AB5DA, + 186508BB06253BCE005AB5DA, + 186508C406253BCE005AB5DA, + 186508C906253BCE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186508A406253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186508A506253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186508A606253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186508A706253BCD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186508A806253BCD005AB5DA = { + children = ( + 186508A906253BCE005AB5DA, + 186508AA06253BCE005AB5DA, + 186508AB06253BCE005AB5DA, + 186508AC06253BCE005AB5DA, + 186508AD06253BCE005AB5DA, + 186508AE06253BCE005AB5DA, + 186508AF06253BCE005AB5DA, + 186508B006253BCE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508A906253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AA06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_neutral.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AB06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AC06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AD06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AE06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508AF06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_neutral.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508B006253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508B106253BCE005AB5DA = { + children = ( + 186508B206253BCE005AB5DA, + 186508B306253BCE005AB5DA, + 186508B406253BCE005AB5DA, + 186508B506253BCE005AB5DA, + 186508B606253BCE005AB5DA, + 186508B706253BCE005AB5DA, + 186508B806253BCE005AB5DA, + 186508B906253BCE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508B206253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B306253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_neutral.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B406253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B506253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B606253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B706253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B806253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_neutral.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508B906253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508BA06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186508BB06253BCE005AB5DA = { + children = ( + 186508BC06253BCE005AB5DA, + 186508BD06253BCE005AB5DA, + 186508BE06253BCE005AB5DA, + 186508BF06253BCE005AB5DA, + 186508C006253BCE005AB5DA, + 186508C106253BCE005AB5DA, + 186508C206253BCE005AB5DA, + 186508C306253BCE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508BC06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508BD06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_neutral.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508BE06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508BF06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508C006253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508C106253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_blue.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508C206253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_neutral.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508C306253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_red.pfb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186508C406253BCE005AB5DA = { + children = ( + 186508C506253BCE005AB5DA, + 186508C606253BCE005AB5DA, + 186508C706253BCE005AB5DA, + 186508C806253BCE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186508C506253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508C606253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508C706253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508C806253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508C906253BCE005AB5DA = { + children = ( + 186508CA06253BCE005AB5DA, + 186508CB06253BCE005AB5DA, + 186508CC06253BCE005AB5DA, + 186508CD06253BCE005AB5DA, + 186508CE06253BCE005AB5DA, + 186508CF06253BCE005AB5DA, + 186508D006253BCE005AB5DA, + 186508D106253BCE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508CA06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508CB06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_neutral.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508CC06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "armorpad_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508CD06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508CE06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA_banner_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508CF06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_blue.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508D006253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_neutral.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508D106253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "weaponpad_red.pfb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186508D206253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = armorpad_blue.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D306253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = armorpad_neutral.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D406253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = armorpad_red.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D506253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TA_banner_blue.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D606253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TA_banner_red.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D706253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = weaponpad_blue.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D806253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = weaponpad_neutral.pfb; + refType = 4; + sourceTree = ""; + }; + 186508D906253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = weaponpad_red.pfb; + refType = 4; + sourceTree = ""; + }; + 186508DA06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = terrademo.map; + refType = 4; + sourceTree = ""; + }; + 186508DB06253BCE005AB5DA = { + children = ( + 186508DC06253BCE005AB5DA, + 186508EB06253BCE005AB5DA, + ); + isa = PBXGroup; + path = models; + refType = 4; + sourceTree = ""; + }; + 186508DC06253BCE005AB5DA = { + children = ( + 186508DD06253BCE005AB5DA, + 186508DE06253BCE005AB5DA, + 186508DF06253BCE005AB5DA, + 186508E006253BCE005AB5DA, + 186508E106253BCE005AB5DA, + 186508E206253BCE005AB5DA, + 186508E306253BCE005AB5DA, + 186508E406253BCE005AB5DA, + 186508E506253BCE005AB5DA, + 186508EA06253BCE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186508DD06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186508DE06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186508DF06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186508E006253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186508E106253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508E206253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508E306253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186508E406253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508E506253BCE005AB5DA = { + children = ( + 186508E606253BCE005AB5DA, + 186508E706253BCE005AB5DA, + 186508E806253BCE005AB5DA, + 186508E906253BCE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186508E606253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508E706253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508E806253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508E906253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508EA06253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508EB06253BCE005AB5DA = { + children = ( + 186508EC06253BCE005AB5DA, + 186508FB06253BCE005AB5DA, + ); + isa = PBXGroup; + path = mapobjects; + refType = 4; + sourceTree = ""; + }; + 186508EC06253BCE005AB5DA = { + children = ( + 186508ED06253BCE005AB5DA, + 186508EE06253BCE005AB5DA, + 186508EF06253BCE005AB5DA, + 186508F006253BCE005AB5DA, + 186508F106253BCE005AB5DA, + 186508F206253BCE005AB5DA, + 186508F306253BCE005AB5DA, + 186508F406253BCE005AB5DA, + 186508F506253BCE005AB5DA, + 186508FA06253BCE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186508ED06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186508EE06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186508EF06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186508F006253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186508F106253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508F206253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508F306253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186508F406253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508F506253BCE005AB5DA = { + children = ( + 186508F606253BCE005AB5DA, + 186508F706253BCE005AB5DA, + 186508F806253BCE005AB5DA, + 186508F906253BCE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186508F606253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186508F706253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186508F806253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186508F906253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508FA06253BCE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186508FB06253BCE005AB5DA = { + children = ( + 186508FC06253BCE005AB5DA, + 1865091306253BCF005AB5DA, + 1865091406253BCF005AB5DA, + ); + isa = PBXGroup; + path = spawn; + refType = 4; + sourceTree = ""; + }; + 186508FC06253BCE005AB5DA = { + children = ( + 186508FD06253BCE005AB5DA, + 186508FE06253BCF005AB5DA, + 186508FF06253BCF005AB5DA, + 1865090006253BCF005AB5DA, + 1865090106253BCF005AB5DA, + 1865090406253BCF005AB5DA, + 1865090706253BCF005AB5DA, + 1865090806253BCF005AB5DA, + 1865090B06253BCF005AB5DA, + 1865091006253BCF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186508FD06253BCE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186508FE06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186508FF06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865090006253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865090106253BCF005AB5DA = { + children = ( + 1865090206253BCF005AB5DA, + 1865090306253BCF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865090206253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865090306253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn_r.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865090406253BCF005AB5DA = { + children = ( + 1865090506253BCF005AB5DA, + 1865090606253BCF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865090506253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865090606253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn_r.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865090706253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865090806253BCF005AB5DA = { + children = ( + 1865090906253BCF005AB5DA, + 1865090A06253BCF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865090906253BCF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "spawn.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865090A06253BCF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "spawn_r.md3.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865090B06253BCF005AB5DA = { + children = ( + 1865090C06253BCF005AB5DA, + 1865090D06253BCF005AB5DA, + 1865090E06253BCF005AB5DA, + 1865090F06253BCF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865090C06253BCF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865090D06253BCF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865090E06253BCF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865090F06253BCF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865091006253BCF005AB5DA = { + children = ( + 1865091106253BCF005AB5DA, + 1865091206253BCF005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865091106253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865091206253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spawn_r.md3.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865091306253BCF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = spawn.md3; + refType = 4; + sourceTree = ""; + }; + 1865091406253BCF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = spawn_r.md3; + refType = 4; + sourceTree = ""; + }; + 1865091506253BCF005AB5DA = { + children = ( + 1865091606253BCF005AB5DA, + 1865098506253BD0005AB5DA, + 1865098606253BD0005AB5DA, + 1865098706253BD0005AB5DA, + 1865098806253BD0005AB5DA, + 1865098906253BD0005AB5DA, + 1865098A06253BD0005AB5DA, + 1865098B06253BD0005AB5DA, + 1865098C06253BD0005AB5DA, + 1865098D06253BD0005AB5DA, + 1865098E06253BD0005AB5DA, + 1865098F06253BD0005AB5DA, + 1865099006253BD0005AB5DA, + 1865099106253BD0005AB5DA, + 1865099206253BD0005AB5DA, + 1865099306253BD0005AB5DA, + 1865099406253BD0005AB5DA, + 1865099506253BD0005AB5DA, + 1865099606253BD0005AB5DA, + 1865099706253BD0005AB5DA, + 1865099806253BD0005AB5DA, + 1865099906253BD0005AB5DA, + 1865099A06253BD0005AB5DA, + 1865099B06253BD0005AB5DA, + 1865099C06253BD0005AB5DA, + ); + isa = PBXGroup; + path = scripts; + refType = 4; + sourceTree = ""; + }; + 1865091606253BCF005AB5DA = { + children = ( + 1865091706253BCF005AB5DA, + 1865091806253BCF005AB5DA, + 1865091906253BCF005AB5DA, + 1865091A06253BCF005AB5DA, + 1865091B06253BCF005AB5DA, + 1865093406253BCF005AB5DA, + 1865094D06253BD0005AB5DA, + 1865094E06253BD0005AB5DA, + 1865096706253BD0005AB5DA, + 1865096C06253BD0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865091706253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865091806253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865091906253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865091A06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865091B06253BCF005AB5DA = { + children = ( + 1865091C06253BCF005AB5DA, + 1865091D06253BCF005AB5DA, + 1865091E06253BCF005AB5DA, + 1865091F06253BCF005AB5DA, + 1865092006253BCF005AB5DA, + 1865092106253BCF005AB5DA, + 1865092206253BCF005AB5DA, + 1865092306253BCF005AB5DA, + 1865092406253BCF005AB5DA, + 1865092506253BCF005AB5DA, + 1865092606253BCF005AB5DA, + 1865092706253BCF005AB5DA, + 1865092806253BCF005AB5DA, + 1865092906253BCF005AB5DA, + 1865092A06253BCF005AB5DA, + 1865092B06253BCF005AB5DA, + 1865092C06253BCF005AB5DA, + 1865092D06253BCF005AB5DA, + 1865092E06253BCF005AB5DA, + 1865092F06253BCF005AB5DA, + 1865093006253BCF005AB5DA, + 1865093106253BCF005AB5DA, + 1865093206253BCF005AB5DA, + 1865093306253BCF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865091C06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865091D06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865091E06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865091F06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092006253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092106253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092206253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092306253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092406253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities-ta.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092506253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092606253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092706253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092806253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092906253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092A06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "proto2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092B06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092C06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092D06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092E06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865092F06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865093006253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stone2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865093106253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865093206253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865093306253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865093406253BCF005AB5DA = { + children = ( + 1865093506253BCF005AB5DA, + 1865093606253BCF005AB5DA, + 1865093706253BCF005AB5DA, + 1865093806253BCF005AB5DA, + 1865093906253BCF005AB5DA, + 1865093A06253BCF005AB5DA, + 1865093B06253BCF005AB5DA, + 1865093C06253BCF005AB5DA, + 1865093D06253BCF005AB5DA, + 1865093E06253BCF005AB5DA, + 1865093F06253BCF005AB5DA, + 1865094006253BCF005AB5DA, + 1865094106253BCF005AB5DA, + 1865094206253BCF005AB5DA, + 1865094306253BD0005AB5DA, + 1865094406253BD0005AB5DA, + 1865094506253BD0005AB5DA, + 1865094606253BD0005AB5DA, + 1865094706253BD0005AB5DA, + 1865094806253BD0005AB5DA, + 1865094906253BD0005AB5DA, + 1865094A06253BD0005AB5DA, + 1865094B06253BD0005AB5DA, + 1865094C06253BD0005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865093506253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093606253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093706253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093806253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093906253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093A06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093B06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093C06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093D06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities-ta.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093E06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865093F06253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094006253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094106253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094206253BCF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "proto2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094706253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094806253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094906253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stone2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094A06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094B06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094C06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865094D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865094E06253BD0005AB5DA = { + children = ( + 1865094F06253BD0005AB5DA, + 1865095006253BD0005AB5DA, + 1865095106253BD0005AB5DA, + 1865095206253BD0005AB5DA, + 1865095306253BD0005AB5DA, + 1865095406253BD0005AB5DA, + 1865095506253BD0005AB5DA, + 1865095606253BD0005AB5DA, + 1865095706253BD0005AB5DA, + 1865095806253BD0005AB5DA, + 1865095906253BD0005AB5DA, + 1865095A06253BD0005AB5DA, + 1865095B06253BD0005AB5DA, + 1865095C06253BD0005AB5DA, + 1865095D06253BD0005AB5DA, + 1865095E06253BD0005AB5DA, + 1865095F06253BD0005AB5DA, + 1865096006253BD0005AB5DA, + 1865096106253BD0005AB5DA, + 1865096206253BD0005AB5DA, + 1865096306253BD0005AB5DA, + 1865096406253BD0005AB5DA, + 1865096506253BD0005AB5DA, + 1865096606253BD0005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865094F06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095706253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities-ta.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095806253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095906253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095A06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095B06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095C06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "proto2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095E06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865095F06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stone2.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tim.shader.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865096706253BD0005AB5DA = { + children = ( + 1865096806253BD0005AB5DA, + 1865096906253BD0005AB5DA, + 1865096A06253BD0005AB5DA, + 1865096B06253BD0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865096806253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865096906253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865096A06253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865096B06253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865096C06253BD0005AB5DA = { + children = ( + 1865096D06253BD0005AB5DA, + 1865096E06253BD0005AB5DA, + 1865096F06253BD0005AB5DA, + 1865097006253BD0005AB5DA, + 1865097106253BD0005AB5DA, + 1865097206253BD0005AB5DA, + 1865097306253BD0005AB5DA, + 1865097406253BD0005AB5DA, + 1865097506253BD0005AB5DA, + 1865097606253BD0005AB5DA, + 1865097706253BD0005AB5DA, + 1865097806253BD0005AB5DA, + 1865097906253BD0005AB5DA, + 1865097A06253BD0005AB5DA, + 1865097B06253BD0005AB5DA, + 1865097C06253BD0005AB5DA, + 1865097D06253BD0005AB5DA, + 1865097E06253BD0005AB5DA, + 1865097F06253BD0005AB5DA, + 1865098006253BD0005AB5DA, + 1865098106253BD0005AB5DA, + 1865098206253BD0005AB5DA, + 1865098306253BD0005AB5DA, + 1865098406253BD0005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865096D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865096E06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_floor2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865096F06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_light.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "base_wall2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "common.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities-ta.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_trim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097706253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gothic_wall.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097806253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097906253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "liquids2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097A06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "museum.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097B06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "proto2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097C06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sfx2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097E06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865097F06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skies2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stone2.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tim.shader.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865098506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_floor.shader; + refType = 4; + sourceTree = ""; + }; + 1865098606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_floor2.shader; + refType = 4; + sourceTree = ""; + }; + 1865098706253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_light.shader; + refType = 4; + sourceTree = ""; + }; + 1865098806253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_wall.shader; + refType = 4; + sourceTree = ""; + }; + 1865098906253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = base_wall2.shader; + refType = 4; + sourceTree = ""; + }; + 1865098A06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = common.shader; + refType = 4; + sourceTree = ""; + }; + 1865098B06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ctf.shader; + refType = 4; + sourceTree = ""; + }; + 1865098C06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ctf2.shader; + refType = 4; + sourceTree = ""; + }; + 1865098D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entities-ta.def"; + refType = 4; + sourceTree = ""; + }; + 1865098E06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_trim.shader; + refType = 4; + sourceTree = ""; + }; + 1865098F06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gothic_wall.shader; + refType = 4; + sourceTree = ""; + }; + 1865099006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = liquids.shader; + refType = 4; + sourceTree = ""; + }; + 1865099106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = liquids2.shader; + refType = 4; + sourceTree = ""; + }; + 1865099206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = museum.shader; + refType = 4; + sourceTree = ""; + }; + 1865099306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = proto2.shader; + refType = 4; + sourceTree = ""; + }; + 1865099406253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = sfx.shader; + refType = 4; + sourceTree = ""; + }; + 1865099506253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = sfx2.shader; + refType = 4; + sourceTree = ""; + }; + 1865099606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shaderlist.txt; + refType = 4; + sourceTree = ""; + }; + 1865099706253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = skies.shader; + refType = 4; + sourceTree = ""; + }; + 1865099806253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = skies2.shader; + refType = 4; + sourceTree = ""; + }; + 1865099906253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = stone2.shader; + refType = 4; + sourceTree = ""; + }; + 1865099A06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = team.shader; + refType = 4; + sourceTree = ""; + }; + 1865099B06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = terrain.shader; + refType = 4; + sourceTree = ""; + }; + 1865099C06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = tim.shader; + refType = 4; + sourceTree = ""; + }; + 1865099D06253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrademo-README.txt"; + refType = 4; + sourceTree = ""; + }; + 1865099E06253BD0005AB5DA = { + children = ( + 1865099F06253BD0005AB5DA, + 186509AE06253BD1005AB5DA, + ); + isa = PBXGroup; + path = textures; + refType = 4; + sourceTree = ""; + }; + 1865099F06253BD0005AB5DA = { + children = ( + 186509A006253BD0005AB5DA, + 186509A106253BD0005AB5DA, + 186509A206253BD0005AB5DA, + 186509A306253BD0005AB5DA, + 186509A406253BD0005AB5DA, + 186509A506253BD0005AB5DA, + 186509A606253BD0005AB5DA, + 186509A706253BD1005AB5DA, + 186509A806253BD1005AB5DA, + 186509AD06253BD1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186509A006253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186509A106253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186509A206253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186509A306253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186509A406253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509A506253BD0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509A606253BD0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186509A706253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509A806253BD1005AB5DA = { + children = ( + 186509A906253BD1005AB5DA, + 186509AA06253BD1005AB5DA, + 186509AB06253BD1005AB5DA, + 186509AC06253BD1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186509A906253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509AA06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509AB06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509AC06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509AD06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509AE06253BD1005AB5DA = { + children = ( + 186509AF06253BD1005AB5DA, + 186509C206253BD1005AB5DA, + ); + isa = PBXGroup; + path = base_wall2; + refType = 4; + sourceTree = ""; + }; + 186509AF06253BD1005AB5DA = { + children = ( + 186509B006253BD1005AB5DA, + 186509B106253BD1005AB5DA, + 186509B206253BD1005AB5DA, + 186509B306253BD1005AB5DA, + 186509B406253BD1005AB5DA, + 186509B606253BD1005AB5DA, + 186509B806253BD1005AB5DA, + 186509B906253BD1005AB5DA, + 186509BB06253BD1005AB5DA, + 186509C006253BD1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186509B006253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186509B106253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186509B206253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186509B306253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186509B406253BD1005AB5DA = { + children = ( + 186509B506253BD1005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509B506253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "techfloor_kc_blue.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509B606253BD1005AB5DA = { + children = ( + 186509B706253BD1005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509B706253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "techfloor_kc_blue.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509B806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186509B906253BD1005AB5DA = { + children = ( + 186509BA06253BD1005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509BA06253BD1005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "techfloor_kc_blue.tga.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509BB06253BD1005AB5DA = { + children = ( + 186509BC06253BD1005AB5DA, + 186509BD06253BD1005AB5DA, + 186509BE06253BD1005AB5DA, + 186509BF06253BD1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186509BC06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509BD06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509BE06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509BF06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509C006253BD1005AB5DA = { + children = ( + 186509C106253BD1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509C106253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "techfloor_kc_blue.tga.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509C206253BD1005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = techfloor_kc_blue.tga; + refType = 4; + sourceTree = ""; + }; + 186509C306253BD1005AB5DA = { + children = ( + 186509C406253BD1005AB5DA, + 186509EF06253BD1005AB5DA, + 186509F006253BD1005AB5DA, + 18650A0A06253BD1005AB5DA, + 18650A0B06253BD1005AB5DA, + 18650A0C06253BD1005AB5DA, + 18650A0D06253BD1005AB5DA, + 18650A0E06253BD1005AB5DA, + 18650A0F06253BD1005AB5DA, + ); + isa = PBXGroup; + path = tools; + refType = 4; + sourceTree = ""; + }; + 186509C406253BD1005AB5DA = { + children = ( + 186509C506253BD1005AB5DA, + 186509C606253BD1005AB5DA, + 186509C706253BD1005AB5DA, + 186509C806253BD1005AB5DA, + 186509C906253BD1005AB5DA, + 186509D106253BD1005AB5DA, + 186509D906253BD1005AB5DA, + 186509DA06253BD1005AB5DA, + 186509E206253BD1005AB5DA, + 186509E706253BD1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186509C506253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186509C606253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186509C706253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186509C806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186509C906253BD1005AB5DA = { + children = ( + 186509CA06253BD1005AB5DA, + 186509CB06253BD1005AB5DA, + 186509CC06253BD1005AB5DA, + 186509CD06253BD1005AB5DA, + 186509CE06253BD1005AB5DA, + 186509CF06253BD1005AB5DA, + 186509D006253BD1005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509CA06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "credits.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509CB06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game.xlink.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509CC06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "global.xlink.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509CD06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "links.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509CE06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.qdt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509CF06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509D006253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.config.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509D106253BD1005AB5DA = { + children = ( + 186509D206253BD1005AB5DA, + 186509D306253BD1005AB5DA, + 186509D406253BD1005AB5DA, + 186509D506253BD1005AB5DA, + 186509D606253BD1005AB5DA, + 186509D706253BD1005AB5DA, + 186509D806253BD1005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509D206253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "credits.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D306253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game.xlink.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D406253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "global.xlink.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D506253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "links.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D606253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.qdt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D706253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.config.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509D906253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186509DA06253BD1005AB5DA = { + children = ( + 186509DB06253BD1005AB5DA, + 186509DC06253BD1005AB5DA, + 186509DD06253BD1005AB5DA, + 186509DE06253BD1005AB5DA, + 186509DF06253BD1005AB5DA, + 186509E006253BD1005AB5DA, + 186509E106253BD1005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509DB06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "credits.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509DC06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "game.xlink.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509DD06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "global.xlink.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509DE06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "links.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509DF06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.qdt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509E006253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509E106253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "synapse.config.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509E206253BD1005AB5DA = { + children = ( + 186509E306253BD1005AB5DA, + 186509E406253BD1005AB5DA, + 186509E506253BD1005AB5DA, + 186509E606253BD1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186509E306253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509E406253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509E506253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509E606253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509E706253BD1005AB5DA = { + children = ( + 186509E806253BD1005AB5DA, + 186509E906253BD1005AB5DA, + 186509EA06253BD1005AB5DA, + 186509EB06253BD1005AB5DA, + 186509EC06253BD1005AB5DA, + 186509ED06253BD1005AB5DA, + 186509EE06253BD1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186509E806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "credits.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509E906253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game.xlink.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509EA06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "global.xlink.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509EB06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "links.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509EC06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.qdt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509ED06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shortcuts.ini.sample.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509EE06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.config.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509EF06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = credits.html; + refType = 4; + sourceTree = ""; + }; + 186509F006253BD1005AB5DA = { + children = ( + 186509F106253BD1005AB5DA, + 18650A0806253BD1005AB5DA, + 18650A0906253BD1005AB5DA, + ); + isa = PBXGroup; + path = dtds; + refType = 4; + sourceTree = ""; + }; + 186509F106253BD1005AB5DA = { + children = ( + 186509F206253BD1005AB5DA, + 186509F306253BD1005AB5DA, + 186509F406253BD1005AB5DA, + 186509F506253BD1005AB5DA, + 186509F606253BD1005AB5DA, + 186509F906253BD1005AB5DA, + 186509FC06253BD1005AB5DA, + 186509FD06253BD1005AB5DA, + 18650A0006253BD1005AB5DA, + 18650A0506253BD1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186509F206253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186509F306253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186509F406253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186509F506253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186509F606253BD1005AB5DA = { + children = ( + 186509F706253BD1005AB5DA, + 186509F806253BD1005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186509F706253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapq3.dtd.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509F806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "project.dtd.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509F906253BD1005AB5DA = { + children = ( + 186509FA06253BD1005AB5DA, + 186509FB06253BD1005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186509FA06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapq3.dtd.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509FB06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "project.dtd.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186509FC06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186509FD06253BD1005AB5DA = { + children = ( + 186509FE06253BD1005AB5DA, + 186509FF06253BD1005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186509FE06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapq3.dtd.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186509FF06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "project.dtd.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A0006253BD1005AB5DA = { + children = ( + 18650A0106253BD1005AB5DA, + 18650A0206253BD1005AB5DA, + 18650A0306253BD1005AB5DA, + 18650A0406253BD1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A0106253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A0206253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A0306253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A0406253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A0506253BD1005AB5DA = { + children = ( + 18650A0606253BD1005AB5DA, + 18650A0706253BD1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A0606253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapq3.dtd.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A0706253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "project.dtd.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A0806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = mapq3.dtd; + refType = 4; + sourceTree = ""; + }; + 18650A0906253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = project.dtd; + refType = 4; + sourceTree = ""; + }; + 18650A0A06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = game.xlink; + refType = 4; + sourceTree = ""; + }; + 18650A0B06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = global.xlink; + refType = 4; + sourceTree = ""; + }; + 18650A0C06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = links.htm; + refType = 4; + sourceTree = ""; + }; + 18650A0D06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3data.qdt; + refType = 4; + sourceTree = ""; + }; + 18650A0E06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shortcuts.ini.sample; + refType = 4; + sourceTree = ""; + }; + 18650A0F06253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = synapse.config; + refType = 4; + sourceTree = ""; + }; + 18650A1006253BD1005AB5DA = { + children = ( + 18650A1106253BD1005AB5DA, + ); + isa = PBXGroup; + path = deb; + refType = 4; + sourceTree = ""; + }; + 18650A1106253BD1005AB5DA = { + children = ( + 18650A1206253BD1005AB5DA, + 18650A1306253BD1005AB5DA, + 18650A1406253BD1005AB5DA, + 18650A1506253BD1005AB5DA, + 18650A1606253BD1005AB5DA, + 18650A1706253BD1005AB5DA, + 18650A1806253BD1005AB5DA, + 18650A1906253BD1005AB5DA, + 18650A1A06253BD1005AB5DA, + 18650A1F06253BD1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A1206253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A1306253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A1406253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A1506253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A1606253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A1706253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A1806253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650A1906253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A1A06253BD1005AB5DA = { + children = ( + 18650A1B06253BD1005AB5DA, + 18650A1C06253BD1005AB5DA, + 18650A1D06253BD1005AB5DA, + 18650A1E06253BD1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A1B06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A1C06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A1D06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A1E06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A1F06253BD1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A2006253BD1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = license.txt; + refType = 4; + sourceTree = ""; + }; + 18650A2106253BD1005AB5DA = { + children = ( + 18650A2206253BD2005AB5DA, + 18650A4D06253BD2005AB5DA, + 18650A4E06253BD2005AB5DA, + 18650A4F06253BD2005AB5DA, + 18650A6406253BD2005AB5DA, + 18650A9306253BD3005AB5DA, + 18650AC606253BD3005AB5DA, + 18650AC706253BD3005AB5DA, + 18650AC806253BD3005AB5DA, + 18650AC906253BD3005AB5DA, + 18650ACA06253BD3005AB5DA, + 18650B1D06253BD4005AB5DA, + 18650B6E06253BD5005AB5DA, + ); + isa = PBXGroup; + path = linux; + refType = 4; + sourceTree = ""; + }; + 18650A2206253BD2005AB5DA = { + children = ( + 18650A2306253BD2005AB5DA, + 18650A2406253BD2005AB5DA, + 18650A2506253BD2005AB5DA, + 18650A2606253BD2005AB5DA, + 18650A2706253BD2005AB5DA, + 18650A2F06253BD2005AB5DA, + 18650A3706253BD2005AB5DA, + 18650A3806253BD2005AB5DA, + 18650A4006253BD2005AB5DA, + 18650A4506253BD2005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A2306253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A2406253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A2506253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A2606253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A2706253BD2005AB5DA = { + children = ( + 18650A2806253BD2005AB5DA, + 18650A2906253BD2005AB5DA, + 18650A2A06253BD2005AB5DA, + 18650A2B06253BD2005AB5DA, + 18650A2C06253BD2005AB5DA, + 18650A2D06253BD2005AB5DA, + 18650A2E06253BD2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2806253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2906253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2A06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2B06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2C06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2D06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2E06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A2F06253BD2005AB5DA = { + children = ( + 18650A3006253BD2005AB5DA, + 18650A3106253BD2005AB5DA, + 18650A3206253BD2005AB5DA, + 18650A3306253BD2005AB5DA, + 18650A3406253BD2005AB5DA, + 18650A3506253BD2005AB5DA, + 18650A3606253BD2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A3006253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3106253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3206253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3306253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3406253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3506253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3606253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A3706253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650A3806253BD2005AB5DA = { + children = ( + 18650A3906253BD2005AB5DA, + 18650A3A06253BD2005AB5DA, + 18650A3B06253BD2005AB5DA, + 18650A3C06253BD2005AB5DA, + 18650A3D06253BD2005AB5DA, + 18650A3E06253BD2005AB5DA, + 18650A3F06253BD2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3906253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3A06253BD2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bspc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3B06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3C06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3D06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3E06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "setup.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A3F06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A4006253BD2005AB5DA = { + children = ( + 18650A4106253BD2005AB5DA, + 18650A4206253BD2005AB5DA, + 18650A4306253BD2005AB5DA, + 18650A4406253BD2005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A4106253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A4206253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A4306253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A4406253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A4506253BD2005AB5DA = { + children = ( + 18650A4606253BD2005AB5DA, + 18650A4706253BD2005AB5DA, + 18650A4806253BD2005AB5DA, + 18650A4906253BD2005AB5DA, + 18650A4A06253BD2005AB5DA, + 18650A4B06253BD2005AB5DA, + 18650A4C06253BD2005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A4606253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4706253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4806253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4906253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4A06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4B06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4C06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A4D06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = all.cf; + refType = 4; + sourceTree = ""; + }; + 18650A4E06253BD2005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = bspc; + refType = 4; + sourceTree = ""; + }; + 18650A4F06253BD2005AB5DA = { + children = ( + 18650A5006253BD2005AB5DA, + 18650A6306253BD2005AB5DA, + ); + isa = PBXGroup; + path = bug750; + refType = 4; + sourceTree = ""; + }; + 18650A5006253BD2005AB5DA = { + children = ( + 18650A5106253BD2005AB5DA, + 18650A5206253BD2005AB5DA, + 18650A5306253BD2005AB5DA, + 18650A5406253BD2005AB5DA, + 18650A5506253BD2005AB5DA, + 18650A5706253BD2005AB5DA, + 18650A5906253BD2005AB5DA, + 18650A5A06253BD2005AB5DA, + 18650A5C06253BD2005AB5DA, + 18650A6106253BD2005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A5106253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A5206253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A5306253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A5406253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A5506253BD2005AB5DA = { + children = ( + 18650A5606253BD2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A5606253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "loki_setup.patch.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A5706253BD2005AB5DA = { + children = ( + 18650A5806253BD2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A5806253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "loki_setup.patch.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A5906253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650A5A06253BD2005AB5DA = { + children = ( + 18650A5B06253BD2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A5B06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "loki_setup.patch.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A5C06253BD2005AB5DA = { + children = ( + 18650A5D06253BD2005AB5DA, + 18650A5E06253BD2005AB5DA, + 18650A5F06253BD2005AB5DA, + 18650A6006253BD2005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A5D06253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A5E06253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A5F06253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A6006253BD2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A6106253BD2005AB5DA = { + children = ( + 18650A6206253BD2005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A6206253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "loki_setup.patch.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A6306253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = loki_setup.patch; + refType = 4; + sourceTree = ""; + }; + 18650A6406253BD2005AB5DA = { + children = ( + 18650A6506253BD2005AB5DA, + 18650A7C06253BD3005AB5DA, + 18650A9106253BD3005AB5DA, + 18650A9206253BD3005AB5DA, + ); + isa = PBXGroup; + path = Help; + refType = 4; + sourceTree = ""; + }; + 18650A6506253BD2005AB5DA = { + children = ( + 18650A6606253BD2005AB5DA, + 18650A6706253BD2005AB5DA, + 18650A6806253BD2005AB5DA, + 18650A6906253BD2005AB5DA, + 18650A6A06253BD2005AB5DA, + 18650A6D06253BD2005AB5DA, + 18650A7006253BD2005AB5DA, + 18650A7106253BD2005AB5DA, + 18650A7406253BD3005AB5DA, + 18650A7906253BD3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A6606253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A6706253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A6806253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A6906253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A6A06253BD2005AB5DA = { + children = ( + 18650A6B06253BD2005AB5DA, + 18650A6C06253BD2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A6B06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A6C06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3A_EULA.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A6D06253BD2005AB5DA = { + children = ( + 18650A6E06253BD2005AB5DA, + 18650A6F06253BD2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A6E06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A6F06253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3A_EULA.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A7006253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650A7106253BD2005AB5DA = { + children = ( + 18650A7206253BD2005AB5DA, + 18650A7306253BD3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A7206253BD2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A7306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3A_EULA.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A7406253BD3005AB5DA = { + children = ( + 18650A7506253BD3005AB5DA, + 18650A7606253BD3005AB5DA, + 18650A7706253BD3005AB5DA, + 18650A7806253BD3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A7506253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A7606253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A7706253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A7806253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A7906253BD3005AB5DA = { + children = ( + 18650A7A06253BD3005AB5DA, + 18650A7B06253BD3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A7A06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A7B06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3A_EULA.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A7C06253BD3005AB5DA = { + children = ( + 18650A7D06253BD3005AB5DA, + 18650A9006253BD3005AB5DA, + ); + isa = PBXGroup; + path = DocsArt; + refType = 4; + sourceTree = ""; + }; + 18650A7D06253BD3005AB5DA = { + children = ( + 18650A7E06253BD3005AB5DA, + 18650A7F06253BD3005AB5DA, + 18650A8006253BD3005AB5DA, + 18650A8106253BD3005AB5DA, + 18650A8206253BD3005AB5DA, + 18650A8406253BD3005AB5DA, + 18650A8606253BD3005AB5DA, + 18650A8706253BD3005AB5DA, + 18650A8906253BD3005AB5DA, + 18650A8E06253BD3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A7E06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A7F06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A8006253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A8106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A8206253BD3005AB5DA = { + children = ( + 18650A8306253BD3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "toolback.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8406253BD3005AB5DA = { + children = ( + 18650A8506253BD3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A8506253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "toolback.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A8606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650A8706253BD3005AB5DA = { + children = ( + 18650A8806253BD3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8806253BD3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "toolback.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8906253BD3005AB5DA = { + children = ( + 18650A8A06253BD3005AB5DA, + 18650A8B06253BD3005AB5DA, + 18650A8C06253BD3005AB5DA, + 18650A8D06253BD3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650A8A06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8B06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650A8C06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650A8D06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A8E06253BD3005AB5DA = { + children = ( + 18650A8F06253BD3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650A8F06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "toolback.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650A9006253BD3005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = toolback.jpg; + refType = 4; + sourceTree = ""; + }; + 18650A9106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = Index.html; + refType = 4; + sourceTree = ""; + }; + 18650A9206253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Q3A_EULA.txt; + refType = 4; + sourceTree = ""; + }; + 18650A9306253BD3005AB5DA = { + children = ( + 18650A9406253BD3005AB5DA, + 18650ABF06253BD3005AB5DA, + 18650AC006253BD3005AB5DA, + 18650AC106253BD3005AB5DA, + 18650AC206253BD3005AB5DA, + 18650AC306253BD3005AB5DA, + 18650AC406253BD3005AB5DA, + 18650AC506253BD3005AB5DA, + ); + isa = PBXGroup; + path = makeself; + refType = 4; + sourceTree = ""; + }; + 18650A9406253BD3005AB5DA = { + children = ( + 18650A9506253BD3005AB5DA, + 18650A9606253BD3005AB5DA, + 18650A9706253BD3005AB5DA, + 18650A9806253BD3005AB5DA, + 18650A9906253BD3005AB5DA, + 18650AA106253BD3005AB5DA, + 18650AA906253BD3005AB5DA, + 18650AAA06253BD3005AB5DA, + 18650AB206253BD3005AB5DA, + 18650AB706253BD3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650A9506253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650A9606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650A9706253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650A9806253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650A9906253BD3005AB5DA = { + children = ( + 18650A9A06253BD3005AB5DA, + 18650A9B06253BD3005AB5DA, + 18650A9C06253BD3005AB5DA, + 18650A9D06253BD3005AB5DA, + 18650A9E06253BD3005AB5DA, + 18650A9F06253BD3005AB5DA, + 18650AA006253BD3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9A06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COPYING.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9B06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself-header.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9C06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.lsm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9D06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9E06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650A9F06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AA006253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "update-readme.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AA106253BD3005AB5DA = { + children = ( + 18650AA206253BD3005AB5DA, + 18650AA306253BD3005AB5DA, + 18650AA406253BD3005AB5DA, + 18650AA506253BD3005AB5DA, + 18650AA606253BD3005AB5DA, + 18650AA706253BD3005AB5DA, + 18650AA806253BD3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650AA206253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COPYING.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself-header.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA406253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.lsm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA506253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA706253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA806253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "update-readme.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AA906253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650AAA06253BD3005AB5DA = { + children = ( + 18650AAB06253BD3005AB5DA, + 18650AAC06253BD3005AB5DA, + 18650AAD06253BD3005AB5DA, + 18650AAE06253BD3005AB5DA, + 18650AAF06253BD3005AB5DA, + 18650AB006253BD3005AB5DA, + 18650AB106253BD3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650AAB06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COPYING.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AAC06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself-header.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AAD06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.lsm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AAE06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "makeself.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AAF06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AB006253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AB106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "update-readme.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AB206253BD3005AB5DA = { + children = ( + 18650AB306253BD3005AB5DA, + 18650AB406253BD3005AB5DA, + 18650AB506253BD3005AB5DA, + 18650AB606253BD3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650AB306253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650AB406253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650AB506253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650AB606253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650AB706253BD3005AB5DA = { + children = ( + 18650AB806253BD3005AB5DA, + 18650AB906253BD3005AB5DA, + 18650ABA06253BD3005AB5DA, + 18650ABB06253BD3005AB5DA, + 18650ABC06253BD3005AB5DA, + 18650ABD06253BD3005AB5DA, + 18650ABE06253BD3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650AB806253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COPYING.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AB906253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself-header.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABA06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.lsm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABB06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeself.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABC06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABD06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABE06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "update-readme.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ABF06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = COPYING; + refType = 4; + sourceTree = ""; + }; + 18650AC006253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "makeself-header.sh"; + refType = 4; + sourceTree = ""; + }; + 18650AC106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = makeself.lsm; + refType = 4; + sourceTree = ""; + }; + 18650AC206253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = makeself.sh; + refType = 4; + sourceTree = ""; + }; + 18650AC306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README; + refType = 4; + sourceTree = ""; + }; + 18650AC406253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TODO; + refType = 4; + sourceTree = ""; + }; + 18650AC506253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "update-readme"; + refType = 4; + sourceTree = ""; + }; + 18650AC606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = nightly.cf; + refType = 4; + sourceTree = ""; + }; + 18650AC706253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3.cf; + refType = 4; + sourceTree = ""; + }; + 18650AC806253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README; + refType = 4; + sourceTree = ""; + }; + 18650AC906253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = setup.sh; + refType = 4; + sourceTree = ""; + }; + 18650ACA06253BD3005AB5DA = { + children = ( + 18650ACB06253BD3005AB5DA, + 18650ADE06253BD3005AB5DA, + 18650B1C06253BD4005AB5DA, + ); + isa = PBXGroup; + path = setup_image; + refType = 4; + sourceTree = ""; + }; + 18650ACB06253BD3005AB5DA = { + children = ( + 18650ACC06253BD3005AB5DA, + 18650ACD06253BD3005AB5DA, + 18650ACE06253BD3005AB5DA, + 18650ACF06253BD3005AB5DA, + 18650AD006253BD3005AB5DA, + 18650AD206253BD3005AB5DA, + 18650AD406253BD3005AB5DA, + 18650AD506253BD3005AB5DA, + 18650AD706253BD3005AB5DA, + 18650ADC06253BD3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650ACC06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650ACD06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650ACE06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650ACF06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650AD006253BD3005AB5DA = { + children = ( + 18650AD106253BD3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650AD106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AD206253BD3005AB5DA = { + children = ( + 18650AD306253BD3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650AD306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AD406253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650AD506253BD3005AB5DA = { + children = ( + 18650AD606253BD3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650AD606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AD706253BD3005AB5DA = { + children = ( + 18650AD806253BD3005AB5DA, + 18650AD906253BD3005AB5DA, + 18650ADA06253BD3005AB5DA, + 18650ADB06253BD3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650AD806253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650AD906253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650ADA06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650ADB06253BD3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650ADC06253BD3005AB5DA = { + children = ( + 18650ADD06253BD3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650ADD06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650ADE06253BD3005AB5DA = { + children = ( + 18650ADF06253BD3005AB5DA, + 18650B0606253BD4005AB5DA, + 18650B1606253BD4005AB5DA, + 18650B1706253BD4005AB5DA, + 18650B1806253BD4005AB5DA, + 18650B1906253BD4005AB5DA, + 18650B1A06253BD4005AB5DA, + 18650B1B06253BD4005AB5DA, + ); + isa = PBXGroup; + path = setup.data; + refType = 4; + sourceTree = ""; + }; + 18650ADF06253BD3005AB5DA = { + children = ( + 18650AE006253BD3005AB5DA, + 18650AE106253BD3005AB5DA, + 18650AE206253BD3005AB5DA, + 18650AE306253BD3005AB5DA, + 18650AE406253BD3005AB5DA, + 18650AEB06253BD4005AB5DA, + 18650AF206253BD4005AB5DA, + 18650AF306253BD4005AB5DA, + 18650AFA06253BD4005AB5DA, + 18650AFF06253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650AE006253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650AE106253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650AE206253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650AE306253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650AE406253BD3005AB5DA = { + children = ( + 18650AE506253BD3005AB5DA, + 18650AE606253BD3005AB5DA, + 18650AE706253BD3005AB5DA, + 18650AE806253BD3005AB5DA, + 18650AE906253BD3005AB5DA, + 18650AEA06253BD3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650AE506253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.games.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AE606253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AE706253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "postinstall.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AE806253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.glade.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AE906253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.xml.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AEA06253BD3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.xpm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AEB06253BD4005AB5DA = { + children = ( + 18650AEC06253BD4005AB5DA, + 18650AED06253BD4005AB5DA, + 18650AEE06253BD4005AB5DA, + 18650AEF06253BD4005AB5DA, + 18650AF006253BD4005AB5DA, + 18650AF106253BD4005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650AEC06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.games.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AED06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AEE06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "postinstall.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AEF06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.glade.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AF006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.xml.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AF106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.xpm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650AF206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650AF306253BD4005AB5DA = { + children = ( + 18650AF406253BD4005AB5DA, + 18650AF506253BD4005AB5DA, + 18650AF606253BD4005AB5DA, + 18650AF706253BD4005AB5DA, + 18650AF806253BD4005AB5DA, + 18650AF906253BD4005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF406253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "config.games.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF606253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "postinstall.sh.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF706253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "setup.glade.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF806253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "setup.xml.in.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AF906253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.xpm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650AFA06253BD4005AB5DA = { + children = ( + 18650AFB06253BD4005AB5DA, + 18650AFC06253BD4005AB5DA, + 18650AFD06253BD4005AB5DA, + 18650AFE06253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650AFB06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650AFC06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650AFD06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650AFE06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650AFF06253BD4005AB5DA = { + children = ( + 18650B0006253BD4005AB5DA, + 18650B0106253BD4005AB5DA, + 18650B0206253BD4005AB5DA, + 18650B0306253BD4005AB5DA, + 18650B0406253BD4005AB5DA, + 18650B0506253BD4005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B0006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.games.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "postinstall.sh.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0306253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.glade.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0406253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.xml.in.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splash.xpm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B0606253BD4005AB5DA = { + children = ( + 18650B0706253BD4005AB5DA, + ); + isa = PBXGroup; + path = bin; + refType = 4; + sourceTree = ""; + }; + 18650B0706253BD4005AB5DA = { + children = ( + 18650B0806253BD4005AB5DA, + 18650B0906253BD4005AB5DA, + 18650B0A06253BD4005AB5DA, + 18650B0B06253BD4005AB5DA, + 18650B0C06253BD4005AB5DA, + 18650B0D06253BD4005AB5DA, + 18650B0E06253BD4005AB5DA, + 18650B0F06253BD4005AB5DA, + 18650B1006253BD4005AB5DA, + 18650B1506253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B0806253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B0906253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B0A06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B0B06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B0C06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B0D06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B0E06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B0F06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B1006253BD4005AB5DA = { + children = ( + 18650B1106253BD4005AB5DA, + 18650B1206253BD4005AB5DA, + 18650B1306253BD4005AB5DA, + 18650B1406253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B1106253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B1206253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B1306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B1406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B1506253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B1606253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = config.games.sh; + refType = 4; + sourceTree = ""; + }; + 18650B1706253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = config.sh.in; + refType = 4; + sourceTree = ""; + }; + 18650B1806253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = postinstall.sh.in; + refType = 4; + sourceTree = ""; + }; + 18650B1906253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = setup.glade; + refType = 4; + sourceTree = ""; + }; + 18650B1A06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = setup.xml.in; + refType = 4; + sourceTree = ""; + }; + 18650B1B06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = splash.xpm; + refType = 4; + sourceTree = ""; + }; + 18650B1C06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = setup.sh.in; + refType = 4; + sourceTree = ""; + }; + 18650B1D06253BD4005AB5DA = { + children = ( + 18650B1E06253BD4005AB5DA, + 18650B2D06253BD4005AB5DA, + ); + isa = PBXGroup; + path = setup_image.Linux; + refType = 4; + sourceTree = ""; + }; + 18650B1E06253BD4005AB5DA = { + children = ( + 18650B1F06253BD4005AB5DA, + 18650B2006253BD4005AB5DA, + 18650B2106253BD4005AB5DA, + 18650B2206253BD4005AB5DA, + 18650B2306253BD4005AB5DA, + 18650B2406253BD4005AB5DA, + 18650B2506253BD4005AB5DA, + 18650B2606253BD4005AB5DA, + 18650B2706253BD4005AB5DA, + 18650B2C06253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B1F06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B2006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B2106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B2206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B2306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B2406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B2506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B2606253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B2706253BD4005AB5DA = { + children = ( + 18650B2806253BD4005AB5DA, + 18650B2906253BD4005AB5DA, + 18650B2A06253BD4005AB5DA, + 18650B2B06253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B2806253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B2906253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B2A06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B2B06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B2C06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B2D06253BD4005AB5DA = { + children = ( + 18650B2E06253BD4005AB5DA, + 18650B3D06253BD4005AB5DA, + ); + isa = PBXGroup; + path = setup.data; + refType = 4; + sourceTree = ""; + }; + 18650B2E06253BD4005AB5DA = { + children = ( + 18650B2F06253BD4005AB5DA, + 18650B3006253BD4005AB5DA, + 18650B3106253BD4005AB5DA, + 18650B3206253BD4005AB5DA, + 18650B3306253BD4005AB5DA, + 18650B3406253BD4005AB5DA, + 18650B3506253BD4005AB5DA, + 18650B3606253BD4005AB5DA, + 18650B3706253BD4005AB5DA, + 18650B3C06253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B2F06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B3006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B3106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B3206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B3306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B3406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B3506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B3606253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B3706253BD4005AB5DA = { + children = ( + 18650B3806253BD4005AB5DA, + 18650B3906253BD4005AB5DA, + 18650B3A06253BD4005AB5DA, + 18650B3B06253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B3806253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B3906253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B3A06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B3B06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B3C06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B3D06253BD4005AB5DA = { + children = ( + 18650B3E06253BD4005AB5DA, + 18650B4D06253BD4005AB5DA, + ); + isa = PBXGroup; + path = bin; + refType = 4; + sourceTree = ""; + }; + 18650B3E06253BD4005AB5DA = { + children = ( + 18650B3F06253BD4005AB5DA, + 18650B4006253BD4005AB5DA, + 18650B4106253BD4005AB5DA, + 18650B4206253BD4005AB5DA, + 18650B4306253BD4005AB5DA, + 18650B4406253BD4005AB5DA, + 18650B4506253BD4005AB5DA, + 18650B4606253BD4005AB5DA, + 18650B4706253BD4005AB5DA, + 18650B4C06253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B3F06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B4006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B4106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B4206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B4306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B4406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B4506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B4606253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B4706253BD4005AB5DA = { + children = ( + 18650B4806253BD4005AB5DA, + 18650B4906253BD4005AB5DA, + 18650B4A06253BD4005AB5DA, + 18650B4B06253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B4806253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B4906253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B4A06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B4B06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B4C06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B4D06253BD4005AB5DA = { + children = ( + 18650B4E06253BD4005AB5DA, + 18650B5D06253BD4005AB5DA, + ); + isa = PBXGroup; + path = Linux; + refType = 4; + sourceTree = ""; + }; + 18650B4E06253BD4005AB5DA = { + children = ( + 18650B4F06253BD4005AB5DA, + 18650B5006253BD4005AB5DA, + 18650B5106253BD4005AB5DA, + 18650B5206253BD4005AB5DA, + 18650B5306253BD4005AB5DA, + 18650B5406253BD4005AB5DA, + 18650B5506253BD4005AB5DA, + 18650B5606253BD4005AB5DA, + 18650B5706253BD4005AB5DA, + 18650B5C06253BD4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B4F06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B5006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B5106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B5206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B5306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B5406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B5506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B5606253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B5706253BD4005AB5DA = { + children = ( + 18650B5806253BD4005AB5DA, + 18650B5906253BD4005AB5DA, + 18650B5A06253BD4005AB5DA, + 18650B5B06253BD4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B5806253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B5906253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B5A06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B5B06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B5C06253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B5D06253BD4005AB5DA = { + children = ( + 18650B5E06253BD4005AB5DA, + 18650B6D06253BD5005AB5DA, + ); + isa = PBXGroup; + path = x86; + refType = 4; + sourceTree = ""; + }; + 18650B5E06253BD4005AB5DA = { + children = ( + 18650B5F06253BD4005AB5DA, + 18650B6006253BD4005AB5DA, + 18650B6106253BD4005AB5DA, + 18650B6206253BD4005AB5DA, + 18650B6306253BD4005AB5DA, + 18650B6406253BD4005AB5DA, + 18650B6506253BD4005AB5DA, + 18650B6606253BD4005AB5DA, + 18650B6706253BD4005AB5DA, + 18650B6C06253BD5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B5F06253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B6006253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B6106253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B6206253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B6306253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B6406253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B6506253BD4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B6606253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B6706253BD4005AB5DA = { + children = ( + 18650B6806253BD4005AB5DA, + 18650B6906253BD4005AB5DA, + 18650B6A06253BD5005AB5DA, + 18650B6B06253BD5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B6806253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B6906253BD4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B6A06253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B6B06253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B6C06253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B6D06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.man; + path = "glibc-2.1"; + refType = 4; + sourceTree = ""; + }; + 18650B6E06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = wolf.cf; + refType = 4; + sourceTree = ""; + }; + 18650B6F06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = openurl.sh; + refType = 4; + sourceTree = ""; + }; + 18650B7006253BD5005AB5DA = { + children = ( + 18650B7106253BD5005AB5DA, + 18650B8806253BD5005AB5DA, + 18650B8906253BD5005AB5DA, + ); + isa = PBXGroup; + path = osx; + refType = 4; + sourceTree = ""; + }; + 18650B7106253BD5005AB5DA = { + children = ( + 18650B7206253BD5005AB5DA, + 18650B7306253BD5005AB5DA, + 18650B7406253BD5005AB5DA, + 18650B7506253BD5005AB5DA, + 18650B7606253BD5005AB5DA, + 18650B7906253BD5005AB5DA, + 18650B7C06253BD5005AB5DA, + 18650B7D06253BD5005AB5DA, + 18650B8006253BD5005AB5DA, + 18650B8506253BD5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B7206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B7306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B7406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B7506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B7606253BD5005AB5DA = { + children = ( + 18650B7706253BD5005AB5DA, + 18650B7806253BD5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B7706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "build.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B7806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.info.m4.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B7906253BD5005AB5DA = { + children = ( + 18650B7A06253BD5005AB5DA, + 18650B7B06253BD5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B7A06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "build.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B7B06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.info.m4.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B7C06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B7D06253BD5005AB5DA = { + children = ( + 18650B7E06253BD5005AB5DA, + 18650B7F06253BD5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B7E06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "build.sh.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B7F06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.info.m4.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B8006253BD5005AB5DA = { + children = ( + 18650B8106253BD5005AB5DA, + 18650B8206253BD5005AB5DA, + 18650B8306253BD5005AB5DA, + 18650B8406253BD5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650B8106253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B8206253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B8306253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B8406253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B8506253BD5005AB5DA = { + children = ( + 18650B8606253BD5005AB5DA, + 18650B8706253BD5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650B8606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "build.sh.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B8706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.info.m4.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B8806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = build.sh; + refType = 4; + sourceTree = ""; + }; + 18650B8906253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = radiant.info.m4; + refType = 4; + sourceTree = ""; + }; + 18650B8A06253BD5005AB5DA = { + children = ( + 18650B8B06253BD5005AB5DA, + 18650BAE06253BD5005AB5DA, + 18650BAF06253BD5005AB5DA, + 18650BB006253BD5005AB5DA, + 18650BB106253BD5005AB5DA, + 18650BB206253BD5005AB5DA, + ); + isa = PBXGroup; + path = PluginSDK; + refType = 4; + sourceTree = ""; + }; + 18650B8B06253BD5005AB5DA = { + children = ( + 18650B8C06253BD5005AB5DA, + 18650B8D06253BD5005AB5DA, + 18650B8E06253BD5005AB5DA, + 18650B8F06253BD5005AB5DA, + 18650B9006253BD5005AB5DA, + 18650B9606253BD5005AB5DA, + 18650B9C06253BD5005AB5DA, + 18650B9D06253BD5005AB5DA, + 18650BA306253BD5005AB5DA, + 18650BA806253BD5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650B8C06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650B8D06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650B8E06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650B8F06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650B9006253BD5005AB5DA = { + children = ( + 18650B9106253BD5005AB5DA, + 18650B9206253BD5005AB5DA, + 18650B9306253BD5005AB5DA, + 18650B9406253BD5005AB5DA, + 18650B9506253BD5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildGtkSrc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildSDK.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildZip.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9606253BD5005AB5DA = { + children = ( + 18650B9706253BD5005AB5DA, + 18650B9806253BD5005AB5DA, + 18650B9906253BD5005AB5DA, + 18650B9A06253BD5005AB5DA, + 18650B9B06253BD5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650B9706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildGtkSrc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B9806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildSDK.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B9906253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildZip.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B9A06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B9B06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650B9C06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650B9D06253BD5005AB5DA = { + children = ( + 18650B9E06253BD5005AB5DA, + 18650B9F06253BD5005AB5DA, + 18650BA006253BD5005AB5DA, + 18650BA106253BD5005AB5DA, + 18650BA206253BD5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9E06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "BuildGtkSrc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650B9F06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "BuildSDK.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "BuildZip.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA306253BD5005AB5DA = { + children = ( + 18650BA406253BD5005AB5DA, + 18650BA506253BD5005AB5DA, + 18650BA606253BD5005AB5DA, + 18650BA706253BD5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650BA406253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA506253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650BA606253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650BA706253BD5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650BA806253BD5005AB5DA = { + children = ( + 18650BA906253BD5005AB5DA, + 18650BAA06253BD5005AB5DA, + 18650BAB06253BD5005AB5DA, + 18650BAC06253BD5005AB5DA, + 18650BAD06253BD5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650BA906253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildGtkSrc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BAA06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildSDK.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BAB06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BuildZip.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BAC06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BAD06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BAE06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = BuildGtkSrc; + refType = 4; + sourceTree = ""; + }; + 18650BAF06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = BuildSDK; + refType = 4; + sourceTree = ""; + }; + 18650BB006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = BuildZip; + refType = 4; + sourceTree = ""; + }; + 18650BB106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = README.html; + refType = 4; + sourceTree = ""; + }; + 18650BB206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TODO; + refType = 4; + sourceTree = ""; + }; + 18650BB306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = quickstart.txt; + refType = 4; + sourceTree = ""; + }; + 18650BB406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = radiantgtkrc; + refType = 4; + sourceTree = ""; + }; + 18650BB506253BD5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = setup.bmp; + refType = 4; + sourceTree = ""; + }; + 18650BB606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = setup.patch; + refType = 4; + sourceTree = ""; + }; + 18650BB706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shortcuts.ini.sample; + refType = 4; + sourceTree = ""; + }; + 18650BB806253BD5005AB5DA = { + children = ( + 18650BB906253BD5005AB5DA, + 18650C1806253BD6005AB5DA, + 18650C1906253BD6005AB5DA, + 18650C3806253BD6005AB5DA, + 18650C3906253BD6005AB5DA, + 18650C3A06253BD6005AB5DA, + 18650C3B06253BD6005AB5DA, + 18650C3C06253BD6005AB5DA, + 18650C3D06253BD6005AB5DA, + 18650C3E06253BD6005AB5DA, + 18650C3F06253BD6005AB5DA, + 18650C4006253BD6005AB5DA, + 18650C4106253BD6005AB5DA, + 18650C4206253BD6005AB5DA, + 18650C4306253BD6005AB5DA, + 18650C4406253BD6005AB5DA, + 18650C4506253BD6005AB5DA, + 18650C4606253BD6005AB5DA, + 18650C4706253BD6005AB5DA, + 18650C4806253BD6005AB5DA, + 18650C4906253BD6005AB5DA, + 18650F9906253BDE005AB5DA, + 18650F9A06253BDE005AB5DA, + ); + isa = PBXGroup; + path = win32; + refType = 4; + sourceTree = ""; + }; + 18650BB906253BD5005AB5DA = { + children = ( + 18650BBA06253BD5005AB5DA, + 18650BBB06253BD5005AB5DA, + 18650BBC06253BD5005AB5DA, + 18650BBD06253BD5005AB5DA, + 18650BBE06253BD5005AB5DA, + 18650BD306253BD5005AB5DA, + 18650BE806253BD5005AB5DA, + 18650BE906253BD5005AB5DA, + 18650BFE06253BD6005AB5DA, + 18650C0306253BD6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650BBA06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650BBB06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650BBC06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650BBD06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650BBE06253BD5005AB5DA = { + children = ( + 18650BBF06253BD5005AB5DA, + 18650BC006253BD5005AB5DA, + 18650BC106253BD5005AB5DA, + 18650BC206253BD5005AB5DA, + 18650BC306253BD5005AB5DA, + 18650BC406253BD5005AB5DA, + 18650BC506253BD5005AB5DA, + 18650BC606253BD5005AB5DA, + 18650BC706253BD5005AB5DA, + 18650BC806253BD5005AB5DA, + 18650BC906253BD5005AB5DA, + 18650BCA06253BD5005AB5DA, + 18650BCB06253BD5005AB5DA, + 18650BCC06253BD5005AB5DA, + 18650BCD06253BD5005AB5DA, + 18650BCE06253BD5005AB5DA, + 18650BCF06253BD5005AB5DA, + 18650BD006253BD5005AB5DA, + 18650BD106253BD5005AB5DA, + 18650BD206253BD5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650BBF06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classic.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "et.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "halflife.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HOWTO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "id-hl.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ja.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jk2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BC906253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCA06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCB06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolfet.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCC06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven-hl.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCD06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCE06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BCF06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sof2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BD006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stvef.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BD106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BD206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BD306253BD5005AB5DA = { + children = ( + 18650BD406253BD5005AB5DA, + 18650BD506253BD5005AB5DA, + 18650BD606253BD5005AB5DA, + 18650BD706253BD5005AB5DA, + 18650BD806253BD5005AB5DA, + 18650BD906253BD5005AB5DA, + 18650BDA06253BD5005AB5DA, + 18650BDB06253BD5005AB5DA, + 18650BDC06253BD5005AB5DA, + 18650BDD06253BD5005AB5DA, + 18650BDE06253BD5005AB5DA, + 18650BDF06253BD5005AB5DA, + 18650BE006253BD5005AB5DA, + 18650BE106253BD5005AB5DA, + 18650BE206253BD5005AB5DA, + 18650BE306253BD5005AB5DA, + 18650BE406253BD5005AB5DA, + 18650BE506253BD5005AB5DA, + 18650BE606253BD5005AB5DA, + 18650BE706253BD5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650BD406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BD506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classic.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BD606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "et.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BD706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "halflife.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BD806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BD906253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HOWTO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDA06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "id-hl.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDB06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ja.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDC06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jk2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDD06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDE06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BDF06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolfet.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven-hl.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sof2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stvef.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE706253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650BE806253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650BE906253BD5005AB5DA = { + children = ( + 18650BEA06253BD5005AB5DA, + 18650BEB06253BD5005AB5DA, + 18650BEC06253BD5005AB5DA, + 18650BED06253BD5005AB5DA, + 18650BEE06253BD5005AB5DA, + 18650BEF06253BD5005AB5DA, + 18650BF006253BD5005AB5DA, + 18650BF106253BD5005AB5DA, + 18650BF206253BD5005AB5DA, + 18650BF306253BD5005AB5DA, + 18650BF406253BD5005AB5DA, + 18650BF506253BD5005AB5DA, + 18650BF606253BD5005AB5DA, + 18650BF706253BD6005AB5DA, + 18650BF806253BD6005AB5DA, + 18650BF906253BD6005AB5DA, + 18650BFA06253BD6005AB5DA, + 18650BFB06253BD6005AB5DA, + 18650BFC06253BD6005AB5DA, + 18650BFD06253BD6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650BEA06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BEB06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classic.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BEC06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "et.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BED06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "halflife.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BEE06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BEF06253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HOWTO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF006253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "id-hl.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF106253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ja.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF206253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jk2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF306253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF406253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF506253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF606253BD5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolfet.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven-hl.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BF906253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BFA06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sof2.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BFB06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stvef.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BFC06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BFD06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650BFE06253BD6005AB5DA = { + children = ( + 18650BFF06253BD6005AB5DA, + 18650C0006253BD6005AB5DA, + 18650C0106253BD6005AB5DA, + 18650C0206253BD6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650BFF06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C0006253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C0106253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C0206253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C0306253BD6005AB5DA = { + children = ( + 18650C0406253BD6005AB5DA, + 18650C0506253BD6005AB5DA, + 18650C0606253BD6005AB5DA, + 18650C0706253BD6005AB5DA, + 18650C0806253BD6005AB5DA, + 18650C0906253BD6005AB5DA, + 18650C0A06253BD6005AB5DA, + 18650C0B06253BD6005AB5DA, + 18650C0C06253BD6005AB5DA, + 18650C0D06253BD6005AB5DA, + 18650C0E06253BD6005AB5DA, + 18650C0F06253BD6005AB5DA, + 18650C1006253BD6005AB5DA, + 18650C1106253BD6005AB5DA, + 18650C1206253BD6005AB5DA, + 18650C1306253BD6005AB5DA, + 18650C1406253BD6005AB5DA, + 18650C1506253BD6005AB5DA, + 18650C1606253BD6005AB5DA, + 18650C1706253BD6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C0406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "all.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classic.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0606253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "et.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "halflife.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0906253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HOWTO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0A06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "id-hl.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0B06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ja.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jk2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0D06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nightly.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0E06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C0F06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1006253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3wolfet.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1106253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven-hl.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1306253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "setup.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sof2.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stvef.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1606253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wolf.cf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C1806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = all.cf; + refType = 4; + sourceTree = ""; + }; + 18650C1906253BD6005AB5DA = { + children = ( + 18650C1A06253BD6005AB5DA, + 18650C3506253BD6005AB5DA, + 18650C3606253BD6005AB5DA, + 18650C3706253BD6005AB5DA, + ); + isa = PBXGroup; + path = bin; + refType = 4; + sourceTree = ""; + }; + 18650C1A06253BD6005AB5DA = { + children = ( + 18650C1B06253BD6005AB5DA, + 18650C1C06253BD6005AB5DA, + 18650C1D06253BD6005AB5DA, + 18650C1E06253BD6005AB5DA, + 18650C1F06253BD6005AB5DA, + 18650C2306253BD6005AB5DA, + 18650C2706253BD6005AB5DA, + 18650C2806253BD6005AB5DA, + 18650C2C06253BD6005AB5DA, + 18650C3106253BD6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650C1B06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650C1C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650C1D06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650C1E06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650C1F06253BD6005AB5DA = { + children = ( + 18650C2006253BD6005AB5DA, + 18650C2106253BD6005AB5DA, + 18650C2206253BD6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2006253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.exe.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2106253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcp70.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcr70.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2306253BD6005AB5DA = { + children = ( + 18650C2406253BD6005AB5DA, + 18650C2506253BD6005AB5DA, + 18650C2606253BD6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C2406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.exe.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C2506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcp70.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C2606253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcr70.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C2706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650C2806253BD6005AB5DA = { + children = ( + 18650C2906253BD6005AB5DA, + 18650C2A06253BD6005AB5DA, + 18650C2B06253BD6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2906253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bspc.exe.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2A06253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "msvcp70.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2B06253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "msvcr70.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2C06253BD6005AB5DA = { + children = ( + 18650C2D06253BD6005AB5DA, + 18650C2E06253BD6005AB5DA, + 18650C2F06253BD6005AB5DA, + 18650C3006253BD6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650C2D06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C2E06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C2F06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C3006253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C3106253BD6005AB5DA = { + children = ( + 18650C3206253BD6005AB5DA, + 18650C3306253BD6005AB5DA, + 18650C3406253BD6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C3206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.exe.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C3306253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcp70.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C3406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "msvcr70.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C3506253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = bspc.exe; + refType = 4; + sourceTree = ""; + }; + 18650C3606253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = msvcp70.dll; + refType = 4; + sourceTree = ""; + }; + 18650C3706253BD6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = msvcr70.dll; + refType = 4; + sourceTree = ""; + }; + 18650C3806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = classic.cf; + refType = 4; + sourceTree = ""; + }; + 18650C3906253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = et.cf; + refType = 4; + sourceTree = ""; + }; + 18650C3A06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = halflife.cf; + refType = 4; + sourceTree = ""; + }; + 18650C3B06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = heretic2.cf; + refType = 4; + sourceTree = ""; + }; + 18650C3C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = HOWTO; + refType = 4; + sourceTree = ""; + }; + 18650C3D06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "id-hl.cf"; + refType = 4; + sourceTree = ""; + }; + 18650C3E06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ja.cf; + refType = 4; + sourceTree = ""; + }; + 18650C3F06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = jk2.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4006253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = nightly.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4106253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3wolf.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4306253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3wolfet.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "raven-hl.cf"; + refType = 4; + sourceTree = ""; + }; + 18650C4506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = raven.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4606253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = setup.pl; + refType = 4; + sourceTree = ""; + }; + 18650C4706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = sof2.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = stvef.cf; + refType = 4; + sourceTree = ""; + }; + 18650C4906253BD6005AB5DA = { + children = ( + 18650C4A06253BD6005AB5DA, + 18650C5D06253BD6005AB5DA, + 18650C7706253BD7005AB5DA, + 18650D7C06253BD9005AB5DA, + 18650D7D06253BD9005AB5DA, + 18650DE206253BDA005AB5DA, + 18650DF706253BDA005AB5DA, + 18650E1106253BDB005AB5DA, + 18650F4006253BDE005AB5DA, + 18650F5506253BDE005AB5DA, + 18650F7F06253BDE005AB5DA, + ); + isa = PBXGroup; + path = template; + refType = 4; + sourceTree = ""; + }; + 18650C4A06253BD6005AB5DA = { + children = ( + 18650C4B06253BD6005AB5DA, + 18650C4C06253BD6005AB5DA, + 18650C4D06253BD6005AB5DA, + 18650C4E06253BD6005AB5DA, + 18650C4F06253BD6005AB5DA, + 18650C5106253BD6005AB5DA, + 18650C5306253BD6005AB5DA, + 18650C5406253BD6005AB5DA, + 18650C5606253BD6005AB5DA, + 18650C5B06253BD6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650C4B06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650C4C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650C4D06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650C4E06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650C4F06253BD6005AB5DA = { + children = ( + 18650C5006253BD6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5006253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.ipr.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5106253BD6005AB5DA = { + children = ( + 18650C5206253BD6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C5206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.ipr.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C5306253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650C5406253BD6005AB5DA = { + children = ( + 18650C5506253BD6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.ipr.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5606253BD6005AB5DA = { + children = ( + 18650C5706253BD6005AB5DA, + 18650C5806253BD6005AB5DA, + 18650C5906253BD6005AB5DA, + 18650C5A06253BD6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650C5706253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5806253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C5906253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C5A06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C5B06253BD6005AB5DA = { + children = ( + 18650C5C06253BD6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C5C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.ipr.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C5D06253BD6005AB5DA = { + children = ( + 18650C5E06253BD6005AB5DA, + 18650C7506253BD7005AB5DA, + 18650C7606253BD7005AB5DA, + ); + isa = PBXGroup; + path = "Component Definitions"; + refType = 4; + sourceTree = ""; + }; + 18650C5E06253BD6005AB5DA = { + children = ( + 18650C5F06253BD6005AB5DA, + 18650C6006253BD6005AB5DA, + 18650C6106253BD6005AB5DA, + 18650C6206253BD6005AB5DA, + 18650C6306253BD6005AB5DA, + 18650C6606253BD6005AB5DA, + 18650C6906253BD6005AB5DA, + 18650C6A06253BD6005AB5DA, + 18650C6D06253BD6005AB5DA, + 18650C7206253BD6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650C5F06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650C6006253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650C6106253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650C6206253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650C6306253BD6005AB5DA = { + children = ( + 18650C6406253BD6005AB5DA, + 18650C6506253BD6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6406253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.cdf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6506253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6606253BD6005AB5DA = { + children = ( + 18650C6706253BD6005AB5DA, + 18650C6806253BD6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C6706253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.cdf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C6806253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C6906253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650C6A06253BD6005AB5DA = { + children = ( + 18650C6B06253BD6005AB5DA, + 18650C6C06253BD6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6B06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.cdf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6C06253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6D06253BD6005AB5DA = { + children = ( + 18650C6E06253BD6005AB5DA, + 18650C6F06253BD6005AB5DA, + 18650C7006253BD6005AB5DA, + 18650C7106253BD6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650C6E06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C6F06253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650C7006253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650C7106253BD6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C7206253BD6005AB5DA = { + children = ( + 18650C7306253BD6005AB5DA, + 18650C7406253BD7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650C7306253BD6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.cdf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C7406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650C7506253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.cdf; + refType = 4; + sourceTree = ""; + }; + 18650C7606253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.fgl; + refType = 4; + sourceTree = ""; + }; + 18650C7706253BD7005AB5DA = { + children = ( + 18650C7806253BD7005AB5DA, + 18650D4B06253BD9005AB5DA, + 18650D4C06253BD9005AB5DA, + 18650D4D06253BD9005AB5DA, + 18650D4E06253BD9005AB5DA, + 18650D4F06253BD9005AB5DA, + 18650D5006253BD9005AB5DA, + 18650D5106253BD9005AB5DA, + 18650D5206253BD9005AB5DA, + 18650D5306253BD9005AB5DA, + 18650D5406253BD9005AB5DA, + 18650D5506253BD9005AB5DA, + 18650D5606253BD9005AB5DA, + 18650D5706253BD9005AB5DA, + 18650D5806253BD9005AB5DA, + 18650D5906253BD9005AB5DA, + 18650D5A06253BD9005AB5DA, + 18650D5B06253BD9005AB5DA, + 18650D5C06253BD9005AB5DA, + 18650D5D06253BD9005AB5DA, + 18650D5E06253BD9005AB5DA, + 18650D5F06253BD9005AB5DA, + 18650D6006253BD9005AB5DA, + 18650D6106253BD9005AB5DA, + 18650D6206253BD9005AB5DA, + 18650D6306253BD9005AB5DA, + 18650D6406253BD9005AB5DA, + 18650D6506253BD9005AB5DA, + 18650D6606253BD9005AB5DA, + 18650D6706253BD9005AB5DA, + 18650D6806253BD9005AB5DA, + 18650D6906253BD9005AB5DA, + 18650D6A06253BD9005AB5DA, + 18650D6B06253BD9005AB5DA, + 18650D6C06253BD9005AB5DA, + 18650D6D06253BD9005AB5DA, + 18650D6E06253BD9005AB5DA, + 18650D6F06253BD9005AB5DA, + 18650D7006253BD9005AB5DA, + 18650D7106253BD9005AB5DA, + 18650D7206253BD9005AB5DA, + 18650D7306253BD9005AB5DA, + 18650D7406253BD9005AB5DA, + 18650D7506253BD9005AB5DA, + 18650D7606253BD9005AB5DA, + 18650D7706253BD9005AB5DA, + 18650D7806253BD9005AB5DA, + 18650D7906253BD9005AB5DA, + 18650D7A06253BD9005AB5DA, + 18650D7B06253BD9005AB5DA, + ); + isa = PBXGroup; + path = "File Groups"; + refType = 4; + sourceTree = ""; + }; + 18650C7806253BD7005AB5DA = { + children = ( + 18650C7906253BD7005AB5DA, + 18650C7A06253BD7005AB5DA, + 18650C7B06253BD7005AB5DA, + 18650C7C06253BD7005AB5DA, + 18650C7D06253BD7005AB5DA, + 18650CAF06253BD7005AB5DA, + 18650CE106253BD8005AB5DA, + 18650CE206253BD8005AB5DA, + 18650D1406253BD8005AB5DA, + 18650D1906253BD8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650C7906253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650C7A06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650C7B06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650C7C06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650C7D06253BD7005AB5DA = { + children = ( + 18650C7E06253BD7005AB5DA, + 18650C7F06253BD7005AB5DA, + 18650C8006253BD7005AB5DA, + 18650C8106253BD7005AB5DA, + 18650C8206253BD7005AB5DA, + 18650C8306253BD7005AB5DA, + 18650C8406253BD7005AB5DA, + 18650C8506253BD7005AB5DA, + 18650C8606253BD7005AB5DA, + 18650C8706253BD7005AB5DA, + 18650C8806253BD7005AB5DA, + 18650C8906253BD7005AB5DA, + 18650C8A06253BD7005AB5DA, + 18650C8B06253BD7005AB5DA, + 18650C8C06253BD7005AB5DA, + 18650C8D06253BD7005AB5DA, + 18650C8E06253BD7005AB5DA, + 18650C8F06253BD7005AB5DA, + 18650C9006253BD7005AB5DA, + 18650C9106253BD7005AB5DA, + 18650C9206253BD7005AB5DA, + 18650C9306253BD7005AB5DA, + 18650C9406253BD7005AB5DA, + 18650C9506253BD7005AB5DA, + 18650C9606253BD7005AB5DA, + 18650C9706253BD7005AB5DA, + 18650C9806253BD7005AB5DA, + 18650C9906253BD7005AB5DA, + 18650C9A06253BD7005AB5DA, + 18650C9B06253BD7005AB5DA, + 18650C9C06253BD7005AB5DA, + 18650C9D06253BD7005AB5DA, + 18650C9E06253BD7005AB5DA, + 18650C9F06253BD7005AB5DA, + 18650CA006253BD7005AB5DA, + 18650CA106253BD7005AB5DA, + 18650CA206253BD7005AB5DA, + 18650CA306253BD7005AB5DA, + 18650CA406253BD7005AB5DA, + 18650CA506253BD7005AB5DA, + 18650CA606253BD7005AB5DA, + 18650CA706253BD7005AB5DA, + 18650CA806253BD7005AB5DA, + 18650CA906253BD7005AB5DA, + 18650CAA06253BD7005AB5DA, + 18650CAB06253BD7005AB5DA, + 18650CAC06253BD7005AB5DA, + 18650CAD06253BD7005AB5DA, + 18650CAE06253BD7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650C7E06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Compile Manual.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C7F06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fdf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8006253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8106253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8206253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Example Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8306253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8506253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8606253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8706253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8806253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8906253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8A06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8B06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Model Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8C06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - bkgrnd2d.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8D06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - BobToolz.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8E06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3 Wolf.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C8F06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9006253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9106253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - GTK GenSurf.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9206253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Pk3Man.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9306253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - PrtView.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - TexTool.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9506253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLL Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9606253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLLs.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9706253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9806253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Misc Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9906253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9A06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9B06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Default Project.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9C06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Editor Images - SPoG pk3.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9D06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9E06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Misc Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650C9F06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Sample Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA006253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA106253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Shader Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA206253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist-ta.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA306253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA506253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA606253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA706253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA806253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CA906253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Sample Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAA06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Teams Manual.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAB06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Terrain Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAC06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool Help.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAD06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Exectuable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAE06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CAF06253BD7005AB5DA = { + children = ( + 18650CB006253BD7005AB5DA, + 18650CB106253BD7005AB5DA, + 18650CB206253BD7005AB5DA, + 18650CB306253BD7005AB5DA, + 18650CB406253BD7005AB5DA, + 18650CB506253BD7005AB5DA, + 18650CB606253BD7005AB5DA, + 18650CB706253BD7005AB5DA, + 18650CB806253BD7005AB5DA, + 18650CB906253BD7005AB5DA, + 18650CBA06253BD7005AB5DA, + 18650CBB06253BD7005AB5DA, + 18650CBC06253BD7005AB5DA, + 18650CBD06253BD7005AB5DA, + 18650CBE06253BD7005AB5DA, + 18650CBF06253BD7005AB5DA, + 18650CC006253BD7005AB5DA, + 18650CC106253BD7005AB5DA, + 18650CC206253BD7005AB5DA, + 18650CC306253BD7005AB5DA, + 18650CC406253BD7005AB5DA, + 18650CC506253BD8005AB5DA, + 18650CC606253BD8005AB5DA, + 18650CC706253BD8005AB5DA, + 18650CC806253BD8005AB5DA, + 18650CC906253BD8005AB5DA, + 18650CCA06253BD8005AB5DA, + 18650CCB06253BD8005AB5DA, + 18650CCC06253BD8005AB5DA, + 18650CCD06253BD8005AB5DA, + 18650CCE06253BD8005AB5DA, + 18650CCF06253BD8005AB5DA, + 18650CD006253BD8005AB5DA, + 18650CD106253BD8005AB5DA, + 18650CD206253BD8005AB5DA, + 18650CD306253BD8005AB5DA, + 18650CD406253BD8005AB5DA, + 18650CD506253BD8005AB5DA, + 18650CD606253BD8005AB5DA, + 18650CD706253BD8005AB5DA, + 18650CD806253BD8005AB5DA, + 18650CD906253BD8005AB5DA, + 18650CDA06253BD8005AB5DA, + 18650CDB06253BD8005AB5DA, + 18650CDC06253BD8005AB5DA, + 18650CDD06253BD8005AB5DA, + 18650CDE06253BD8005AB5DA, + 18650CDF06253BD8005AB5DA, + 18650CE006253BD8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650CB006253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Compile Manual.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB106253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fdf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB206253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB306253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Example Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB506253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB606253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB706253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB806253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CB906253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBA06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBB06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBC06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBD06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Model Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBE06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - bkgrnd2d.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CBF06253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - BobToolz.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC006253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3 Wolf.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC106253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC206253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC306253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - GTK GenSurf.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC406253BD7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Pk3Man.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - PrtView.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - TexTool.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLL Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLLs.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CC906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCA06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Misc Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCB06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCC06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCD06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Default Project.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCE06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Editor Images - SPoG pk3.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CCF06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Misc Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Sample Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Shader Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist-ta.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CD906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDA06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDB06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Sample Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDC06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Teams Manual.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDD06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Terrain Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDE06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool Help.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CDF06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Exectuable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CE006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650CE106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650CE206253BD8005AB5DA = { + children = ( + 18650CE306253BD8005AB5DA, + 18650CE406253BD8005AB5DA, + 18650CE506253BD8005AB5DA, + 18650CE606253BD8005AB5DA, + 18650CE706253BD8005AB5DA, + 18650CE806253BD8005AB5DA, + 18650CE906253BD8005AB5DA, + 18650CEA06253BD8005AB5DA, + 18650CEB06253BD8005AB5DA, + 18650CEC06253BD8005AB5DA, + 18650CED06253BD8005AB5DA, + 18650CEE06253BD8005AB5DA, + 18650CEF06253BD8005AB5DA, + 18650CF006253BD8005AB5DA, + 18650CF106253BD8005AB5DA, + 18650CF206253BD8005AB5DA, + 18650CF306253BD8005AB5DA, + 18650CF406253BD8005AB5DA, + 18650CF506253BD8005AB5DA, + 18650CF606253BD8005AB5DA, + 18650CF706253BD8005AB5DA, + 18650CF806253BD8005AB5DA, + 18650CF906253BD8005AB5DA, + 18650CFA06253BD8005AB5DA, + 18650CFB06253BD8005AB5DA, + 18650CFC06253BD8005AB5DA, + 18650CFD06253BD8005AB5DA, + 18650CFE06253BD8005AB5DA, + 18650CFF06253BD8005AB5DA, + 18650D0006253BD8005AB5DA, + 18650D0106253BD8005AB5DA, + 18650D0206253BD8005AB5DA, + 18650D0306253BD8005AB5DA, + 18650D0406253BD8005AB5DA, + 18650D0506253BD8005AB5DA, + 18650D0606253BD8005AB5DA, + 18650D0706253BD8005AB5DA, + 18650D0806253BD8005AB5DA, + 18650D0906253BD8005AB5DA, + 18650D0A06253BD8005AB5DA, + 18650D0B06253BD8005AB5DA, + 18650D0C06253BD8005AB5DA, + 18650D0D06253BD8005AB5DA, + 18650D0E06253BD8005AB5DA, + 18650D0F06253BD8005AB5DA, + 18650D1006253BD8005AB5DA, + 18650D1106253BD8005AB5DA, + 18650D1206253BD8005AB5DA, + 18650D1306253BD8005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Compile Manual.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fdf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Example Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CE906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CEA06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CEB06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CEC06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CED06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CEE06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CEF06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Model Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - bkgrnd2d.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - BobToolz.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3 Wolf.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - GTK GenSurf.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Pk3Man.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - PrtView.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CF906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - TexTool.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFA06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLL Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFB06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLLs.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFC06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFD06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Misc Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFE06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650CFF06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Default Project.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Editor Images - SPoG pk3.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Misc Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Sample Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Shader Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist-ta.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0A06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0B06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Executable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0C06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0D06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0E06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Sample Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D0F06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Teams Manual.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Terrain Manual Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool Help.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Exectuable Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Media Files.fgl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1406253BD8005AB5DA = { + children = ( + 18650D1506253BD8005AB5DA, + 18650D1606253BD8005AB5DA, + 18650D1706253BD8005AB5DA, + 18650D1806253BD8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650D1506253BD8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1606253BD8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650D1706253BD8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650D1806253BD8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650D1906253BD8005AB5DA = { + children = ( + 18650D1A06253BD8005AB5DA, + 18650D1B06253BD8005AB5DA, + 18650D1C06253BD8005AB5DA, + 18650D1D06253BD8005AB5DA, + 18650D1E06253BD8005AB5DA, + 18650D1F06253BD8005AB5DA, + 18650D2006253BD8005AB5DA, + 18650D2106253BD8005AB5DA, + 18650D2206253BD8005AB5DA, + 18650D2306253BD8005AB5DA, + 18650D2406253BD8005AB5DA, + 18650D2506253BD8005AB5DA, + 18650D2606253BD8005AB5DA, + 18650D2706253BD8005AB5DA, + 18650D2806253BD8005AB5DA, + 18650D2906253BD8005AB5DA, + 18650D2A06253BD8005AB5DA, + 18650D2B06253BD8005AB5DA, + 18650D2C06253BD8005AB5DA, + 18650D2D06253BD8005AB5DA, + 18650D2E06253BD8005AB5DA, + 18650D2F06253BD8005AB5DA, + 18650D3006253BD8005AB5DA, + 18650D3106253BD8005AB5DA, + 18650D3206253BD8005AB5DA, + 18650D3306253BD8005AB5DA, + 18650D3406253BD8005AB5DA, + 18650D3506253BD8005AB5DA, + 18650D3606253BD9005AB5DA, + 18650D3706253BD9005AB5DA, + 18650D3806253BD9005AB5DA, + 18650D3906253BD9005AB5DA, + 18650D3A06253BD9005AB5DA, + 18650D3B06253BD9005AB5DA, + 18650D3C06253BD9005AB5DA, + 18650D3D06253BD9005AB5DA, + 18650D3E06253BD9005AB5DA, + 18650D3F06253BD9005AB5DA, + 18650D4006253BD9005AB5DA, + 18650D4106253BD9005AB5DA, + 18650D4206253BD9005AB5DA, + 18650D4306253BD9005AB5DA, + 18650D4406253BD9005AB5DA, + 18650D4506253BD9005AB5DA, + 18650D4606253BD9005AB5DA, + 18650D4706253BD9005AB5DA, + 18650D4806253BD9005AB5DA, + 18650D4906253BD9005AB5DA, + 18650D4A06253BD9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650D1A06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Compile Manual.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D1B06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.fdf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D1C06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D1D06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D1E06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Example Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D1F06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2606253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2706253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Model Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2806253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - bkgrnd2d.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2906253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - BobToolz.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2A06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3 Wolf.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2B06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2C06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2D06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - GTK GenSurf.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2E06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Pk3Man.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D2F06253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - PrtView.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3006253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - TexTool.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3106253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLL Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3206253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLLs.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3306253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3406253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Misc Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3506253BD8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3606253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3706253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Default Project.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3806253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Editor Images - SPoG pk3.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3906253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3A06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Misc Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3B06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Sample Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3C06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3D06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Shader Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3E06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist-ta.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D3F06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4006253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4106253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4206253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Executable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4306253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4406253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4506253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Sample Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4606253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Teams Manual.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4706253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Terrain Manual Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4806253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool Help.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4906253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Exectuable Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4A06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Media Files.fgl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D4B06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Compile Manual.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D4C06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.fdf; + refType = 4; + sourceTree = ""; + }; + 18650D4D06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D4E06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ET Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D4F06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Example Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5006253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5106253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Halflife Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5206253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5306253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Heretic2 Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5406253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5506253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JA Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5606253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5706253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "JKII Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5806253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Model Manual Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5906253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - bkgrnd2d.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5A06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - BobToolz.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5B06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3 Wolf.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5C06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry pk3.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5D06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Curry.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5E06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - GTK GenSurf.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D5F06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - Pk3Man.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6006253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - PrtView.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6106253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Plugins - TexTool.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6206253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLL Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6306253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program DLLs.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6406253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6506253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Program Misc Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6606253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6706253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q2 Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6806253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Default Project.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6906253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Editor Images - SPoG pk3.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6A06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6B06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Misc Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6C06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Q3 Sample Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6D06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant Manual Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6E06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Shader Manual Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D6F06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaderlist-ta.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7006253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shaderlist.fgl; + refType = 4; + sourceTree = ""; + }; + 18650D7106253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7206253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SOF2 Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7306253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Executable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7406253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STVEF Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7506253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Manual Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7606253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Sample Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7706253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TA Teams Manual.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7806253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Terrain Manual Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7906253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TexTool Help.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7A06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Exectuable Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7B06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Wolf Media Files.fgl"; + refType = 4; + sourceTree = ""; + }; + 18650D7C06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = GtkRadiant.ipr; + refType = 4; + sourceTree = ""; + }; + 18650D7D06253BD9005AB5DA = { + children = ( + 18650D7E06253BD9005AB5DA, + 18650D8D06253BDA005AB5DA, + ); + isa = PBXGroup; + path = Media; + refType = 4; + sourceTree = ""; + }; + 18650D7E06253BD9005AB5DA = { + children = ( + 18650D7F06253BD9005AB5DA, + 18650D8006253BD9005AB5DA, + 18650D8106253BD9005AB5DA, + 18650D8206253BD9005AB5DA, + 18650D8306253BD9005AB5DA, + 18650D8406253BD9005AB5DA, + 18650D8506253BD9005AB5DA, + 18650D8606253BDA005AB5DA, + 18650D8706253BDA005AB5DA, + 18650D8C06253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650D7F06253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650D8006253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650D8106253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650D8206253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650D8306253BD9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650D8406253BD9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650D8506253BD9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650D8606253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650D8706253BDA005AB5DA = { + children = ( + 18650D8806253BDA005AB5DA, + 18650D8906253BDA005AB5DA, + 18650D8A06253BDA005AB5DA, + 18650D8B06253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650D8806253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650D8906253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650D8A06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650D8B06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650D8C06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650D8D06253BDA005AB5DA = { + children = ( + 18650D8E06253BDA005AB5DA, + 18650DA106253BDA005AB5DA, + 18650DA206253BDA005AB5DA, + 18650DC206253BDA005AB5DA, + 18650DD206253BDA005AB5DA, + ); + isa = PBXGroup; + path = GtkRadiant; + refType = 4; + sourceTree = ""; + }; + 18650D8E06253BDA005AB5DA = { + children = ( + 18650D8F06253BDA005AB5DA, + 18650D9006253BDA005AB5DA, + 18650D9106253BDA005AB5DA, + 18650D9206253BDA005AB5DA, + 18650D9306253BDA005AB5DA, + 18650D9506253BDA005AB5DA, + 18650D9706253BDA005AB5DA, + 18650D9806253BDA005AB5DA, + 18650D9A06253BDA005AB5DA, + 18650D9F06253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650D8F06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650D9006253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650D9106253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650D9206253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650D9306253BDA005AB5DA = { + children = ( + 18650D9406253BDA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.mda.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9506253BDA005AB5DA = { + children = ( + 18650D9606253BDA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650D9606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.mda.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650D9706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650D9806253BDA005AB5DA = { + children = ( + 18650D9906253BDA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9906253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.mda.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9A06253BDA005AB5DA = { + children = ( + 18650D9B06253BDA005AB5DA, + 18650D9C06253BDA005AB5DA, + 18650D9D06253BDA005AB5DA, + 18650D9E06253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650D9B06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9C06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650D9D06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650D9E06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650D9F06253BDA005AB5DA = { + children = ( + 18650DA006253BDA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DA006253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.mda.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650DA106253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.mda; + refType = 4; + sourceTree = ""; + }; + 18650DA206253BDA005AB5DA = { + children = ( + 18650DA306253BDA005AB5DA, + 18650DB206253BDA005AB5DA, + ); + isa = PBXGroup; + path = "Disk Images"; + refType = 4; + sourceTree = ""; + }; + 18650DA306253BDA005AB5DA = { + children = ( + 18650DA406253BDA005AB5DA, + 18650DA506253BDA005AB5DA, + 18650DA606253BDA005AB5DA, + 18650DA706253BDA005AB5DA, + 18650DA806253BDA005AB5DA, + 18650DA906253BDA005AB5DA, + 18650DAA06253BDA005AB5DA, + 18650DAB06253BDA005AB5DA, + 18650DAC06253BDA005AB5DA, + 18650DB106253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DA406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DA506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DA606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DA706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DA806253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DA906253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DAA06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650DAB06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DAC06253BDA005AB5DA = { + children = ( + 18650DAD06253BDA005AB5DA, + 18650DAE06253BDA005AB5DA, + 18650DAF06253BDA005AB5DA, + 18650DB006253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650DAD06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DAE06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DAF06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DB006253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DB106253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DB206253BDA005AB5DA = { + children = ( + 18650DB306253BDA005AB5DA, + ); + isa = PBXGroup; + path = Disk1; + refType = 4; + sourceTree = ""; + }; + 18650DB306253BDA005AB5DA = { + children = ( + 18650DB406253BDA005AB5DA, + 18650DB506253BDA005AB5DA, + 18650DB606253BDA005AB5DA, + 18650DB706253BDA005AB5DA, + 18650DB806253BDA005AB5DA, + 18650DB906253BDA005AB5DA, + 18650DBA06253BDA005AB5DA, + 18650DBB06253BDA005AB5DA, + 18650DBC06253BDA005AB5DA, + 18650DC106253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DB406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DB506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DB606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DB706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DB806253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DB906253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DBA06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650DBB06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DBC06253BDA005AB5DA = { + children = ( + 18650DBD06253BDA005AB5DA, + 18650DBE06253BDA005AB5DA, + 18650DBF06253BDA005AB5DA, + 18650DC006253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650DBD06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DBE06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DBF06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DC006253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DC106253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DC206253BDA005AB5DA = { + children = ( + 18650DC306253BDA005AB5DA, + ); + isa = PBXGroup; + path = "Log Files"; + refType = 4; + sourceTree = ""; + }; + 18650DC306253BDA005AB5DA = { + children = ( + 18650DC406253BDA005AB5DA, + 18650DC506253BDA005AB5DA, + 18650DC606253BDA005AB5DA, + 18650DC706253BDA005AB5DA, + 18650DC806253BDA005AB5DA, + 18650DC906253BDA005AB5DA, + 18650DCA06253BDA005AB5DA, + 18650DCB06253BDA005AB5DA, + 18650DCC06253BDA005AB5DA, + 18650DD106253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DC406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DC506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DC606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DC706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DC806253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DC906253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DCA06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650DCB06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DCC06253BDA005AB5DA = { + children = ( + 18650DCD06253BDA005AB5DA, + 18650DCE06253BDA005AB5DA, + 18650DCF06253BDA005AB5DA, + 18650DD006253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650DCD06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DCE06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DCF06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DD006253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DD106253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DD206253BDA005AB5DA = { + children = ( + 18650DD306253BDA005AB5DA, + ); + isa = PBXGroup; + path = "Report Files"; + refType = 4; + sourceTree = ""; + }; + 18650DD306253BDA005AB5DA = { + children = ( + 18650DD406253BDA005AB5DA, + 18650DD506253BDA005AB5DA, + 18650DD606253BDA005AB5DA, + 18650DD706253BDA005AB5DA, + 18650DD806253BDA005AB5DA, + 18650DD906253BDA005AB5DA, + 18650DDA06253BDA005AB5DA, + 18650DDB06253BDA005AB5DA, + 18650DDC06253BDA005AB5DA, + 18650DE106253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DD406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DD506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DD606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DD706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DD806253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DD906253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DDA06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650DDB06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DDC06253BDA005AB5DA = { + children = ( + 18650DDD06253BDA005AB5DA, + 18650DDE06253BDA005AB5DA, + 18650DDF06253BDA005AB5DA, + 18650DE006253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650DDD06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DDE06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DDF06253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DE006253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DE106253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DE206253BDA005AB5DA = { + children = ( + 18650DE306253BDA005AB5DA, + 18650DF606253BDA005AB5DA, + ); + isa = PBXGroup; + path = "Registry Entries"; + refType = 4; + sourceTree = ""; + }; + 18650DE306253BDA005AB5DA = { + children = ( + 18650DE406253BDA005AB5DA, + 18650DE506253BDA005AB5DA, + 18650DE606253BDA005AB5DA, + 18650DE706253BDA005AB5DA, + 18650DE806253BDA005AB5DA, + 18650DEA06253BDA005AB5DA, + 18650DEC06253BDA005AB5DA, + 18650DED06253BDA005AB5DA, + 18650DEF06253BDA005AB5DA, + 18650DF406253BDA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DE406253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DE506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DE606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DE706253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DE806253BDA005AB5DA = { + children = ( + 18650DE906253BDA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DE906253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.rge.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650DEA06253BDA005AB5DA = { + children = ( + 18650DEB06253BDA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DEB06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.rge.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650DEC06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650DED06253BDA005AB5DA = { + children = ( + 18650DEE06253BDA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DEE06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.rge.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650DEF06253BDA005AB5DA = { + children = ( + 18650DF006253BDA005AB5DA, + 18650DF106253BDA005AB5DA, + 18650DF206253BDA005AB5DA, + 18650DF306253BDA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650DF006253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DF106253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650DF206253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650DF306253BDA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DF406253BDA005AB5DA = { + children = ( + 18650DF506253BDA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650DF506253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.rge.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650DF606253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.rge; + refType = 4; + sourceTree = ""; + }; + 18650DF706253BDA005AB5DA = { + children = ( + 18650DF806253BDA005AB5DA, + 18650E0F06253BDB005AB5DA, + 18650E1006253BDB005AB5DA, + ); + isa = PBXGroup; + path = "Script Files"; + refType = 4; + sourceTree = ""; + }; + 18650DF806253BDA005AB5DA = { + children = ( + 18650DF906253BDA005AB5DA, + 18650DFA06253BDA005AB5DA, + 18650DFB06253BDA005AB5DA, + 18650DFC06253BDA005AB5DA, + 18650DFD06253BDA005AB5DA, + 18650E0006253BDB005AB5DA, + 18650E0306253BDB005AB5DA, + 18650E0406253BDB005AB5DA, + 18650E0706253BDB005AB5DA, + 18650E0C06253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650DF906253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650DFA06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650DFB06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650DFC06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650DFD06253BDA005AB5DA = { + children = ( + 18650DFE06253BDA005AB5DA, + 18650DFF06253BDB005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650DFE06253BDA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650DFF06253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.rul.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0006253BDB005AB5DA = { + children = ( + 18650E0106253BDB005AB5DA, + 18650E0206253BDB005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E0106253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E0206253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.rul.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E0306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E0406253BDB005AB5DA = { + children = ( + 18650E0506253BDB005AB5DA, + 18650E0606253BDB005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.rul.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0706253BDB005AB5DA = { + children = ( + 18650E0806253BDB005AB5DA, + 18650E0906253BDB005AB5DA, + 18650E0A06253BDB005AB5DA, + 18650E0B06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E0806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0906253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E0A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E0B06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E0C06253BDB005AB5DA = { + children = ( + 18650E0D06253BDB005AB5DA, + 18650E0E06253BDB005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E0D06253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E0E06253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.rul.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E0F06253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Setup.map; + refType = 4; + sourceTree = ""; + }; + 18650E1006253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Setup.rul; + refType = 4; + sourceTree = ""; + }; + 18650E1106253BDB005AB5DA = { + children = ( + 18650E1206253BDB005AB5DA, + 18650E2106253BDB005AB5DA, + 18650EA006253BDC005AB5DA, + ); + isa = PBXGroup; + path = "Setup Files"; + refType = 4; + sourceTree = ""; + }; + 18650E1206253BDB005AB5DA = { + children = ( + 18650E1306253BDB005AB5DA, + 18650E1406253BDB005AB5DA, + 18650E1506253BDB005AB5DA, + 18650E1606253BDB005AB5DA, + 18650E1706253BDB005AB5DA, + 18650E1806253BDB005AB5DA, + 18650E1906253BDB005AB5DA, + 18650E1A06253BDB005AB5DA, + 18650E1B06253BDB005AB5DA, + 18650E2006253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E1306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E1406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E1506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E1606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E1706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E1806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E1906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E1A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E1B06253BDB005AB5DA = { + children = ( + 18650E1C06253BDB005AB5DA, + 18650E1D06253BDB005AB5DA, + 18650E1E06253BDB005AB5DA, + 18650E1F06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E1C06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E1D06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E1E06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E1F06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E2006253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E2106253BDB005AB5DA = { + children = ( + 18650E2206253BDB005AB5DA, + 18650E3106253BDB005AB5DA, + 18650E6106253BDB005AB5DA, + ); + isa = PBXGroup; + path = "Compressed Files"; + refType = 4; + sourceTree = ""; + }; + 18650E2206253BDB005AB5DA = { + children = ( + 18650E2306253BDB005AB5DA, + 18650E2406253BDB005AB5DA, + 18650E2506253BDB005AB5DA, + 18650E2606253BDB005AB5DA, + 18650E2706253BDB005AB5DA, + 18650E2806253BDB005AB5DA, + 18650E2906253BDB005AB5DA, + 18650E2A06253BDB005AB5DA, + 18650E2B06253BDB005AB5DA, + 18650E3006253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E2306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E2406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E2506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E2606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E2706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E2806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E2906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E2A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E2B06253BDB005AB5DA = { + children = ( + 18650E2C06253BDB005AB5DA, + 18650E2D06253BDB005AB5DA, + 18650E2E06253BDB005AB5DA, + 18650E2F06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E2C06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E2D06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E2E06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E2F06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E3006253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E3106253BDB005AB5DA = { + children = ( + 18650E3206253BDB005AB5DA, + 18650E4106253BDB005AB5DA, + 18650E5106253BDB005AB5DA, + ); + isa = PBXGroup; + path = "0009-English"; + refType = 4; + sourceTree = ""; + }; + 18650E3206253BDB005AB5DA = { + children = ( + 18650E3306253BDB005AB5DA, + 18650E3406253BDB005AB5DA, + 18650E3506253BDB005AB5DA, + 18650E3606253BDB005AB5DA, + 18650E3706253BDB005AB5DA, + 18650E3806253BDB005AB5DA, + 18650E3906253BDB005AB5DA, + 18650E3A06253BDB005AB5DA, + 18650E3B06253BDB005AB5DA, + 18650E4006253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E3306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E3406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E3506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E3606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E3706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E3806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E3906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E3A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E3B06253BDB005AB5DA = { + children = ( + 18650E3C06253BDB005AB5DA, + 18650E3D06253BDB005AB5DA, + 18650E3E06253BDB005AB5DA, + 18650E3F06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E3C06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E3D06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E3E06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E3F06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E4006253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E4106253BDB005AB5DA = { + children = ( + 18650E4206253BDB005AB5DA, + ); + isa = PBXGroup; + path = "Intel 32"; + refType = 4; + sourceTree = ""; + }; + 18650E4206253BDB005AB5DA = { + children = ( + 18650E4306253BDB005AB5DA, + 18650E4406253BDB005AB5DA, + 18650E4506253BDB005AB5DA, + 18650E4606253BDB005AB5DA, + 18650E4706253BDB005AB5DA, + 18650E4806253BDB005AB5DA, + 18650E4906253BDB005AB5DA, + 18650E4A06253BDB005AB5DA, + 18650E4B06253BDB005AB5DA, + 18650E5006253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E4306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E4406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E4506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E4606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E4706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E4806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E4906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E4A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E4B06253BDB005AB5DA = { + children = ( + 18650E4C06253BDB005AB5DA, + 18650E4D06253BDB005AB5DA, + 18650E4E06253BDB005AB5DA, + 18650E4F06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E4C06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E4D06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E4E06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E4F06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E5006253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E5106253BDB005AB5DA = { + children = ( + 18650E5206253BDB005AB5DA, + ); + isa = PBXGroup; + path = "OS Independent"; + refType = 4; + sourceTree = ""; + }; + 18650E5206253BDB005AB5DA = { + children = ( + 18650E5306253BDB005AB5DA, + 18650E5406253BDB005AB5DA, + 18650E5506253BDB005AB5DA, + 18650E5606253BDB005AB5DA, + 18650E5706253BDB005AB5DA, + 18650E5806253BDB005AB5DA, + 18650E5906253BDB005AB5DA, + 18650E5A06253BDB005AB5DA, + 18650E5B06253BDB005AB5DA, + 18650E6006253BDB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E5306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E5406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E5506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E5606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E5706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E5806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E5906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E5A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E5B06253BDB005AB5DA = { + children = ( + 18650E5C06253BDB005AB5DA, + 18650E5D06253BDB005AB5DA, + 18650E5E06253BDB005AB5DA, + 18650E5F06253BDB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E5C06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E5D06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E5E06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E5F06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E6006253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E6106253BDB005AB5DA = { + children = ( + 18650E6206253BDB005AB5DA, + 18650E7106253BDC005AB5DA, + 18650E8106253BDC005AB5DA, + ); + isa = PBXGroup; + path = "Language Independent"; + refType = 4; + sourceTree = ""; + }; + 18650E6206253BDB005AB5DA = { + children = ( + 18650E6306253BDB005AB5DA, + 18650E6406253BDB005AB5DA, + 18650E6506253BDB005AB5DA, + 18650E6606253BDB005AB5DA, + 18650E6706253BDB005AB5DA, + 18650E6806253BDB005AB5DA, + 18650E6906253BDB005AB5DA, + 18650E6A06253BDB005AB5DA, + 18650E6B06253BDC005AB5DA, + 18650E7006253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E6306253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E6406253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E6506253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E6606253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E6706253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E6806253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E6906253BDB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E6A06253BDB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E6B06253BDC005AB5DA = { + children = ( + 18650E6C06253BDC005AB5DA, + 18650E6D06253BDC005AB5DA, + 18650E6E06253BDC005AB5DA, + 18650E6F06253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E6C06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E6D06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E6E06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E6F06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E7006253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E7106253BDC005AB5DA = { + children = ( + 18650E7206253BDC005AB5DA, + ); + isa = PBXGroup; + path = "Intel 32"; + refType = 4; + sourceTree = ""; + }; + 18650E7206253BDC005AB5DA = { + children = ( + 18650E7306253BDC005AB5DA, + 18650E7406253BDC005AB5DA, + 18650E7506253BDC005AB5DA, + 18650E7606253BDC005AB5DA, + 18650E7706253BDC005AB5DA, + 18650E7806253BDC005AB5DA, + 18650E7906253BDC005AB5DA, + 18650E7A06253BDC005AB5DA, + 18650E7B06253BDC005AB5DA, + 18650E8006253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E7306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E7406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E7506253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E7606253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E7706253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E7806253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E7906253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E7A06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E7B06253BDC005AB5DA = { + children = ( + 18650E7C06253BDC005AB5DA, + 18650E7D06253BDC005AB5DA, + 18650E7E06253BDC005AB5DA, + 18650E7F06253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E7C06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E7D06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E7E06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E7F06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E8006253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E8106253BDC005AB5DA = { + children = ( + 18650E8206253BDC005AB5DA, + 18650E9D06253BDC005AB5DA, + 18650E9E06253BDC005AB5DA, + 18650E9F06253BDC005AB5DA, + ); + isa = PBXGroup; + path = "OS Independent"; + refType = 4; + sourceTree = ""; + }; + 18650E8206253BDC005AB5DA = { + children = ( + 18650E8306253BDC005AB5DA, + 18650E8406253BDC005AB5DA, + 18650E8506253BDC005AB5DA, + 18650E8606253BDC005AB5DA, + 18650E8706253BDC005AB5DA, + 18650E8B06253BDC005AB5DA, + 18650E8F06253BDC005AB5DA, + 18650E9006253BDC005AB5DA, + 18650E9406253BDC005AB5DA, + 18650E9906253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650E8306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650E8406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650E8506253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650E8606253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650E8706253BDC005AB5DA = { + children = ( + 18650E8806253BDC005AB5DA, + 18650E8906253BDC005AB5DA, + 18650E8A06253BDC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E8806253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "_IsUser.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E8906253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "infolist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E8A06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E8B06253BDC005AB5DA = { + children = ( + 18650E8C06253BDC005AB5DA, + 18650E8D06253BDC005AB5DA, + 18650E8E06253BDC005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E8C06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "_IsUser.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E8D06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "infolist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E8E06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E8F06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650E9006253BDC005AB5DA = { + children = ( + 18650E9106253BDC005AB5DA, + 18650E9206253BDC005AB5DA, + 18650E9306253BDC005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9106253BDC005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "_IsUser.dll.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9206253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "infolist.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9406253BDC005AB5DA = { + children = ( + 18650E9506253BDC005AB5DA, + 18650E9606253BDC005AB5DA, + 18650E9706253BDC005AB5DA, + 18650E9806253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650E9506253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9606253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650E9706253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650E9806253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E9906253BDC005AB5DA = { + children = ( + 18650E9A06253BDC005AB5DA, + 18650E9B06253BDC005AB5DA, + 18650E9C06253BDC005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650E9A06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "_IsUser.dll.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E9B06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "infolist.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E9C06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "license.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650E9D06253BDC005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = _IsUser.dll; + refType = 4; + sourceTree = ""; + }; + 18650E9E06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = infolist.txt; + refType = 4; + sourceTree = ""; + }; + 18650E9F06253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = license.txt; + refType = 4; + sourceTree = ""; + }; + 18650EA006253BDC005AB5DA = { + children = ( + 18650EA106253BDC005AB5DA, + 18650EB006253BDC005AB5DA, + 18650EE006253BDD005AB5DA, + 18650EF006253BDD005AB5DA, + 18650F2006253BDE005AB5DA, + 18650F3006253BDE005AB5DA, + ); + isa = PBXGroup; + path = "Uncompressed Files"; + refType = 4; + sourceTree = ""; + }; + 18650EA106253BDC005AB5DA = { + children = ( + 18650EA206253BDC005AB5DA, + 18650EA306253BDC005AB5DA, + 18650EA406253BDC005AB5DA, + 18650EA506253BDC005AB5DA, + 18650EA606253BDC005AB5DA, + 18650EA706253BDC005AB5DA, + 18650EA806253BDC005AB5DA, + 18650EA906253BDC005AB5DA, + 18650EAA06253BDC005AB5DA, + 18650EAF06253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650EA206253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650EA306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650EA406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650EA506253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650EA606253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EA706253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EA806253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650EA906253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EAA06253BDC005AB5DA = { + children = ( + 18650EAB06253BDC005AB5DA, + 18650EAC06253BDC005AB5DA, + 18650EAD06253BDC005AB5DA, + 18650EAE06253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650EAB06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EAC06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EAD06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EAE06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EAF06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EB006253BDC005AB5DA = { + children = ( + 18650EB106253BDC005AB5DA, + 18650EC006253BDC005AB5DA, + 18650ED006253BDC005AB5DA, + ); + isa = PBXGroup; + path = "0009-English"; + refType = 4; + sourceTree = ""; + }; + 18650EB106253BDC005AB5DA = { + children = ( + 18650EB206253BDC005AB5DA, + 18650EB306253BDC005AB5DA, + 18650EB406253BDC005AB5DA, + 18650EB506253BDC005AB5DA, + 18650EB606253BDC005AB5DA, + 18650EB706253BDC005AB5DA, + 18650EB806253BDC005AB5DA, + 18650EB906253BDC005AB5DA, + 18650EBA06253BDC005AB5DA, + 18650EBF06253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650EB206253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650EB306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650EB406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650EB506253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650EB606253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EB706253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EB806253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650EB906253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EBA06253BDC005AB5DA = { + children = ( + 18650EBB06253BDC005AB5DA, + 18650EBC06253BDC005AB5DA, + 18650EBD06253BDC005AB5DA, + 18650EBE06253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650EBB06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EBC06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EBD06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EBE06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EBF06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EC006253BDC005AB5DA = { + children = ( + 18650EC106253BDC005AB5DA, + ); + isa = PBXGroup; + path = "Intel 32"; + refType = 4; + sourceTree = ""; + }; + 18650EC106253BDC005AB5DA = { + children = ( + 18650EC206253BDC005AB5DA, + 18650EC306253BDC005AB5DA, + 18650EC406253BDC005AB5DA, + 18650EC506253BDC005AB5DA, + 18650EC606253BDC005AB5DA, + 18650EC706253BDC005AB5DA, + 18650EC806253BDC005AB5DA, + 18650EC906253BDC005AB5DA, + 18650ECA06253BDC005AB5DA, + 18650ECF06253BDC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650EC206253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650EC306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650EC406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650EC506253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650EC606253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EC706253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EC806253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650EC906253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650ECA06253BDC005AB5DA = { + children = ( + 18650ECB06253BDC005AB5DA, + 18650ECC06253BDC005AB5DA, + 18650ECD06253BDC005AB5DA, + 18650ECE06253BDC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650ECB06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650ECC06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650ECD06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650ECE06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650ECF06253BDC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650ED006253BDC005AB5DA = { + children = ( + 18650ED106253BDC005AB5DA, + ); + isa = PBXGroup; + path = "OS Independent"; + refType = 4; + sourceTree = ""; + }; + 18650ED106253BDC005AB5DA = { + children = ( + 18650ED206253BDC005AB5DA, + 18650ED306253BDC005AB5DA, + 18650ED406253BDC005AB5DA, + 18650ED506253BDD005AB5DA, + 18650ED606253BDD005AB5DA, + 18650ED706253BDD005AB5DA, + 18650ED806253BDD005AB5DA, + 18650ED906253BDD005AB5DA, + 18650EDA06253BDD005AB5DA, + 18650EDF06253BDD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650ED206253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650ED306253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650ED406253BDC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650ED506253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650ED606253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650ED706253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650ED806253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650ED906253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EDA06253BDD005AB5DA = { + children = ( + 18650EDB06253BDD005AB5DA, + 18650EDC06253BDD005AB5DA, + 18650EDD06253BDD005AB5DA, + 18650EDE06253BDD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650EDB06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EDC06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EDD06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EDE06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EDF06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EE006253BDD005AB5DA = { + children = ( + 18650EE106253BDD005AB5DA, + ); + isa = PBXGroup; + path = Disk1; + refType = 4; + sourceTree = ""; + }; + 18650EE106253BDD005AB5DA = { + children = ( + 18650EE206253BDD005AB5DA, + 18650EE306253BDD005AB5DA, + 18650EE406253BDD005AB5DA, + 18650EE506253BDD005AB5DA, + 18650EE606253BDD005AB5DA, + 18650EE706253BDD005AB5DA, + 18650EE806253BDD005AB5DA, + 18650EE906253BDD005AB5DA, + 18650EEA06253BDD005AB5DA, + 18650EEF06253BDD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650EE206253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650EE306253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650EE406253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650EE506253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650EE606253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EE706253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EE806253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650EE906253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EEA06253BDD005AB5DA = { + children = ( + 18650EEB06253BDD005AB5DA, + 18650EEC06253BDD005AB5DA, + 18650EED06253BDD005AB5DA, + 18650EEE06253BDD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650EEB06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EEC06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EED06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EEE06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EEF06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EF006253BDD005AB5DA = { + children = ( + 18650EF106253BDD005AB5DA, + 18650F0006253BDD005AB5DA, + 18650F1006253BDD005AB5DA, + ); + isa = PBXGroup; + path = "Language Independent"; + refType = 4; + sourceTree = ""; + }; + 18650EF106253BDD005AB5DA = { + children = ( + 18650EF206253BDD005AB5DA, + 18650EF306253BDD005AB5DA, + 18650EF406253BDD005AB5DA, + 18650EF506253BDD005AB5DA, + 18650EF606253BDD005AB5DA, + 18650EF706253BDD005AB5DA, + 18650EF806253BDD005AB5DA, + 18650EF906253BDD005AB5DA, + 18650EFA06253BDD005AB5DA, + 18650EFF06253BDD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650EF206253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650EF306253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650EF406253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650EF506253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650EF606253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EF706253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EF806253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650EF906253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EFA06253BDD005AB5DA = { + children = ( + 18650EFB06253BDD005AB5DA, + 18650EFC06253BDD005AB5DA, + 18650EFD06253BDD005AB5DA, + 18650EFE06253BDD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650EFB06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650EFC06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650EFD06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650EFE06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650EFF06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F0006253BDD005AB5DA = { + children = ( + 18650F0106253BDD005AB5DA, + ); + isa = PBXGroup; + path = "Intel 32"; + refType = 4; + sourceTree = ""; + }; + 18650F0106253BDD005AB5DA = { + children = ( + 18650F0206253BDD005AB5DA, + 18650F0306253BDD005AB5DA, + 18650F0406253BDD005AB5DA, + 18650F0506253BDD005AB5DA, + 18650F0606253BDD005AB5DA, + 18650F0706253BDD005AB5DA, + 18650F0806253BDD005AB5DA, + 18650F0906253BDD005AB5DA, + 18650F0A06253BDD005AB5DA, + 18650F0F06253BDD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F0206253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F0306253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F0406253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F0506253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F0606253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F0706253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F0806253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F0906253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F0A06253BDD005AB5DA = { + children = ( + 18650F0B06253BDD005AB5DA, + 18650F0C06253BDD005AB5DA, + 18650F0D06253BDD005AB5DA, + 18650F0E06253BDD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F0B06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F0C06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F0D06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F0E06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F0F06253BDD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F1006253BDD005AB5DA = { + children = ( + 18650F1106253BDD005AB5DA, + ); + isa = PBXGroup; + path = "OS Independent"; + refType = 4; + sourceTree = ""; + }; + 18650F1106253BDD005AB5DA = { + children = ( + 18650F1206253BDD005AB5DA, + 18650F1306253BDE005AB5DA, + 18650F1406253BDE005AB5DA, + 18650F1506253BDE005AB5DA, + 18650F1606253BDE005AB5DA, + 18650F1706253BDE005AB5DA, + 18650F1806253BDE005AB5DA, + 18650F1906253BDE005AB5DA, + 18650F1A06253BDE005AB5DA, + 18650F1F06253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F1206253BDD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F1306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F1406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F1506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F1606253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F1706253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F1806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F1906253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F1A06253BDE005AB5DA = { + children = ( + 18650F1B06253BDE005AB5DA, + 18650F1C06253BDE005AB5DA, + 18650F1D06253BDE005AB5DA, + 18650F1E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F1B06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F1C06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F1D06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F1E06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F1F06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F2006253BDE005AB5DA = { + children = ( + 18650F2106253BDE005AB5DA, + ); + isa = PBXGroup; + path = LastDisk; + refType = 4; + sourceTree = ""; + }; + 18650F2106253BDE005AB5DA = { + children = ( + 18650F2206253BDE005AB5DA, + 18650F2306253BDE005AB5DA, + 18650F2406253BDE005AB5DA, + 18650F2506253BDE005AB5DA, + 18650F2606253BDE005AB5DA, + 18650F2706253BDE005AB5DA, + 18650F2806253BDE005AB5DA, + 18650F2906253BDE005AB5DA, + 18650F2A06253BDE005AB5DA, + 18650F2F06253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F2206253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F2306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F2406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F2506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F2606253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F2706253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F2806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F2906253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F2A06253BDE005AB5DA = { + children = ( + 18650F2B06253BDE005AB5DA, + 18650F2C06253BDE005AB5DA, + 18650F2D06253BDE005AB5DA, + 18650F2E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F2B06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F2C06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F2D06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F2E06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F2F06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F3006253BDE005AB5DA = { + children = ( + 18650F3106253BDE005AB5DA, + ); + isa = PBXGroup; + path = Other; + refType = 4; + sourceTree = ""; + }; + 18650F3106253BDE005AB5DA = { + children = ( + 18650F3206253BDE005AB5DA, + 18650F3306253BDE005AB5DA, + 18650F3406253BDE005AB5DA, + 18650F3506253BDE005AB5DA, + 18650F3606253BDE005AB5DA, + 18650F3706253BDE005AB5DA, + 18650F3806253BDE005AB5DA, + 18650F3906253BDE005AB5DA, + 18650F3A06253BDE005AB5DA, + 18650F3F06253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F3206253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F3306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F3406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F3506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F3606253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F3706253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F3806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F3906253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F3A06253BDE005AB5DA = { + children = ( + 18650F3B06253BDE005AB5DA, + 18650F3C06253BDE005AB5DA, + 18650F3D06253BDE005AB5DA, + 18650F3E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F3B06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F3C06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F3D06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F3E06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F3F06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F4006253BDE005AB5DA = { + children = ( + 18650F4106253BDE005AB5DA, + 18650F5406253BDE005AB5DA, + ); + isa = PBXGroup; + path = "Shell Objects"; + refType = 4; + sourceTree = ""; + }; + 18650F4106253BDE005AB5DA = { + children = ( + 18650F4206253BDE005AB5DA, + 18650F4306253BDE005AB5DA, + 18650F4406253BDE005AB5DA, + 18650F4506253BDE005AB5DA, + 18650F4606253BDE005AB5DA, + 18650F4806253BDE005AB5DA, + 18650F4A06253BDE005AB5DA, + 18650F4B06253BDE005AB5DA, + 18650F4D06253BDE005AB5DA, + 18650F5206253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F4206253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F4306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F4406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F4506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F4606253BDE005AB5DA = { + children = ( + 18650F4706253BDE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F4706253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F4806253BDE005AB5DA = { + children = ( + 18650F4906253BDE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F4906253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F4A06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F4B06253BDE005AB5DA = { + children = ( + 18650F4C06253BDE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F4C06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F4D06253BDE005AB5DA = { + children = ( + 18650F4E06253BDE005AB5DA, + 18650F4F06253BDE005AB5DA, + 18650F5006253BDE005AB5DA, + 18650F5106253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F4E06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F4F06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F5006253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F5106253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F5206253BDE005AB5DA = { + children = ( + 18650F5306253BDE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F5306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F5406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.shl; + refType = 4; + sourceTree = ""; + }; + 18650F5506253BDE005AB5DA = { + children = ( + 18650F5606253BDE005AB5DA, + 18650F6906253BDE005AB5DA, + 18650F7E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = "String Tables"; + refType = 4; + sourceTree = ""; + }; + 18650F5606253BDE005AB5DA = { + children = ( + 18650F5706253BDE005AB5DA, + 18650F5806253BDE005AB5DA, + 18650F5906253BDE005AB5DA, + 18650F5A06253BDE005AB5DA, + 18650F5B06253BDE005AB5DA, + 18650F5D06253BDE005AB5DA, + 18650F5F06253BDE005AB5DA, + 18650F6006253BDE005AB5DA, + 18650F6206253BDE005AB5DA, + 18650F6706253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F5706253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F5806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F5906253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F5A06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F5B06253BDE005AB5DA = { + children = ( + 18650F5C06253BDE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F5C06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F5D06253BDE005AB5DA = { + children = ( + 18650F5E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F5E06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F5F06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F6006253BDE005AB5DA = { + children = ( + 18650F6106253BDE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F6106253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F6206253BDE005AB5DA = { + children = ( + 18650F6306253BDE005AB5DA, + 18650F6406253BDE005AB5DA, + 18650F6506253BDE005AB5DA, + 18650F6606253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F6306253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F6406253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F6506253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F6606253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F6706253BDE005AB5DA = { + children = ( + 18650F6806253BDE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F6806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Default.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F6906253BDE005AB5DA = { + children = ( + 18650F6A06253BDE005AB5DA, + 18650F7D06253BDE005AB5DA, + ); + isa = PBXGroup; + path = "0009-English"; + refType = 4; + sourceTree = ""; + }; + 18650F6A06253BDE005AB5DA = { + children = ( + 18650F6B06253BDE005AB5DA, + 18650F6C06253BDE005AB5DA, + 18650F6D06253BDE005AB5DA, + 18650F6E06253BDE005AB5DA, + 18650F6F06253BDE005AB5DA, + 18650F7106253BDE005AB5DA, + 18650F7306253BDE005AB5DA, + 18650F7406253BDE005AB5DA, + 18650F7606253BDE005AB5DA, + 18650F7B06253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F6B06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F6C06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F6D06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F6E06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F6F06253BDE005AB5DA = { + children = ( + 18650F7006253BDE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7006253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "value.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7106253BDE005AB5DA = { + children = ( + 18650F7206253BDE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F7206253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "value.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F7306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F7406253BDE005AB5DA = { + children = ( + 18650F7506253BDE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "value.shl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7606253BDE005AB5DA = { + children = ( + 18650F7706253BDE005AB5DA, + 18650F7806253BDE005AB5DA, + 18650F7906253BDE005AB5DA, + 18650F7A06253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F7706253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7806253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F7906253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F7A06253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F7B06253BDE005AB5DA = { + children = ( + 18650F7C06253BDE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F7C06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "value.shl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F7D06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = value.shl; + refType = 4; + sourceTree = ""; + }; + 18650F7E06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Default.shl; + refType = 4; + sourceTree = ""; + }; + 18650F7F06253BDE005AB5DA = { + children = ( + 18650F8006253BDE005AB5DA, + 18650F9706253BDE005AB5DA, + 18650F9806253BDE005AB5DA, + ); + isa = PBXGroup; + path = "Text Substitutions"; + refType = 4; + sourceTree = ""; + }; + 18650F8006253BDE005AB5DA = { + children = ( + 18650F8106253BDE005AB5DA, + 18650F8206253BDE005AB5DA, + 18650F8306253BDE005AB5DA, + 18650F8406253BDE005AB5DA, + 18650F8506253BDE005AB5DA, + 18650F8806253BDE005AB5DA, + 18650F8B06253BDE005AB5DA, + 18650F8C06253BDE005AB5DA, + 18650F8F06253BDE005AB5DA, + 18650F9406253BDE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F8106253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F8206253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650F8306253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650F8406253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650F8506253BDE005AB5DA = { + children = ( + 18650F8606253BDE005AB5DA, + 18650F8706253BDE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8606253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Build.tsb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8706253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.tsb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8806253BDE005AB5DA = { + children = ( + 18650F8906253BDE005AB5DA, + 18650F8A06253BDE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F8906253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Build.tsb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F8A06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.tsb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F8B06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650F8C06253BDE005AB5DA = { + children = ( + 18650F8D06253BDE005AB5DA, + 18650F8E06253BDE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8D06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Build.tsb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8E06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.tsb.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650F8F06253BDE005AB5DA = { + children = ( + 18650F9006253BDE005AB5DA, + 18650F9106253BDE005AB5DA, + 18650F9206253BDE005AB5DA, + 18650F9306253BDE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650F9006253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650F9106253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650F9206253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650F9306253BDE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F9406253BDE005AB5DA = { + children = ( + 18650F9506253BDE005AB5DA, + 18650F9606253BDE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650F9506253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Build.tsb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F9606253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Setup.tsb.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650F9706253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Build.tsb; + refType = 4; + sourceTree = ""; + }; + 18650F9806253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Setup.tsb; + refType = 4; + sourceTree = ""; + }; + 18650F9906253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TODO; + refType = 4; + sourceTree = ""; + }; + 18650F9A06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = wolf.cf; + refType = 4; + sourceTree = ""; + }; + 18650F9B06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = site.conf; + refType = 4; + sourceTree = ""; + }; + 18650F9C06253BDE005AB5DA = { + children = ( + 18650F9D06253BDE005AB5DA, + 18650FAC06253BDF005AB5DA, + 1865129206253BE7005AB5DA, + ); + isa = PBXGroup; + path = tools; + refType = 4; + sourceTree = ""; + }; + 18650F9D06253BDE005AB5DA = { + children = ( + 18650F9E06253BDE005AB5DA, + 18650F9F06253BDE005AB5DA, + 18650FA006253BDE005AB5DA, + 18650FA106253BDE005AB5DA, + 18650FA206253BDF005AB5DA, + 18650FA306253BDF005AB5DA, + 18650FA406253BDF005AB5DA, + 18650FA506253BDF005AB5DA, + 18650FA606253BDF005AB5DA, + 18650FAB06253BDF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650F9E06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650F9F06253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650FA006253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650FA106253BDE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650FA206253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650FA306253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650FA406253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650FA506253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650FA606253BDF005AB5DA = { + children = ( + 18650FA706253BDF005AB5DA, + 18650FA806253BDF005AB5DA, + 18650FA906253BDF005AB5DA, + 18650FAA06253BDF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650FA706253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650FA806253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650FA906253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650FAA06253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650FAB06253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650FAC06253BDF005AB5DA = { + children = ( + 18650FAD06253BDF005AB5DA, + 18650FBC06253BDF005AB5DA, + 1865103F06253BE1005AB5DA, + 186510D106253BE3005AB5DA, + 1865111306253BE3005AB5DA, + ); + isa = PBXGroup; + path = quake2; + refType = 4; + sourceTree = ""; + }; + 18650FAD06253BDF005AB5DA = { + children = ( + 18650FAE06253BDF005AB5DA, + 18650FAF06253BDF005AB5DA, + 18650FB006253BDF005AB5DA, + 18650FB106253BDF005AB5DA, + 18650FB206253BDF005AB5DA, + 18650FB306253BDF005AB5DA, + 18650FB406253BDF005AB5DA, + 18650FB506253BDF005AB5DA, + 18650FB606253BDF005AB5DA, + 18650FBB06253BDF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650FAE06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650FAF06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650FB006253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650FB106253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650FB206253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650FB306253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650FB406253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650FB506253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650FB606253BDF005AB5DA = { + children = ( + 18650FB706253BDF005AB5DA, + 18650FB806253BDF005AB5DA, + 18650FB906253BDF005AB5DA, + 18650FBA06253BDF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 18650FB706253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650FB806253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650FB906253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650FBA06253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650FBB06253BDF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 18650FBC06253BDF005AB5DA = { + children = ( + 18650FBD06253BDF005AB5DA, + 1865102806253BE1005AB5DA, + 1865102906253BE1005AB5DA, + 1865102A06253BE1005AB5DA, + 1865102B06253BE1005AB5DA, + 1865102C06253BE1005AB5DA, + 1865102D06253BE1005AB5DA, + 1865102E06253BE1005AB5DA, + 1865102F06253BE1005AB5DA, + 1865103006253BE1005AB5DA, + 1865103106253BE1005AB5DA, + 1865103206253BE1005AB5DA, + 1865103306253BE1005AB5DA, + 1865103406253BE1005AB5DA, + 1865103506253BE1005AB5DA, + 1865103606253BE1005AB5DA, + 1865103706253BE1005AB5DA, + 1865103806253BE1005AB5DA, + 1865103906253BE1005AB5DA, + 1865103A06253BE1005AB5DA, + 1865103B06253BE1005AB5DA, + 1865103C06253BE1005AB5DA, + 1865103D06253BE1005AB5DA, + 1865103E06253BE1005AB5DA, + ); + isa = PBXGroup; + path = common; + refType = 4; + sourceTree = ""; + }; + 18650FBD06253BDF005AB5DA = { + children = ( + 18650FBE06253BDF005AB5DA, + 18650FBF06253BDF005AB5DA, + 18650FC006253BDF005AB5DA, + 18650FC106253BDF005AB5DA, + 18650FC206253BDF005AB5DA, + 18650FDA06253BDF005AB5DA, + 18650FF206253BE0005AB5DA, + 18650FF306253BE0005AB5DA, + 1865100B06253BE0005AB5DA, + 1865101006253BE0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 18650FBE06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 18650FBF06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 18650FC006253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 18650FC106253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 18650FC206253BDF005AB5DA = { + children = ( + 18650FC306253BDF005AB5DA, + 18650FC406253BDF005AB5DA, + 18650FC506253BDF005AB5DA, + 18650FC606253BDF005AB5DA, + 18650FC706253BDF005AB5DA, + 18650FC806253BDF005AB5DA, + 18650FC906253BDF005AB5DA, + 18650FCA06253BDF005AB5DA, + 18650FCB06253BDF005AB5DA, + 18650FCC06253BDF005AB5DA, + 18650FCD06253BDF005AB5DA, + 18650FCE06253BDF005AB5DA, + 18650FCF06253BDF005AB5DA, + 18650FD006253BDF005AB5DA, + 18650FD106253BDF005AB5DA, + 18650FD206253BDF005AB5DA, + 18650FD306253BDF005AB5DA, + 18650FD406253BDF005AB5DA, + 18650FD506253BDF005AB5DA, + 18650FD606253BDF005AB5DA, + 18650FD706253BDF005AB5DA, + 18650FD806253BDF005AB5DA, + 18650FD906253BDF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC306253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC406253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC506253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC606253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC706253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC806253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FC906253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCA06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCB06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCC06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCD06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCE06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FCF06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD006253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD106253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD206253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD306253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_threads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD406253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD506253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD606253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD706253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD806253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FD906253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FDA06253BDF005AB5DA = { + children = ( + 18650FDB06253BDF005AB5DA, + 18650FDC06253BDF005AB5DA, + 18650FDD06253BE0005AB5DA, + 18650FDE06253BE0005AB5DA, + 18650FDF06253BE0005AB5DA, + 18650FE006253BE0005AB5DA, + 18650FE106253BE0005AB5DA, + 18650FE206253BE0005AB5DA, + 18650FE306253BE0005AB5DA, + 18650FE406253BE0005AB5DA, + 18650FE506253BE0005AB5DA, + 18650FE606253BE0005AB5DA, + 18650FE706253BE0005AB5DA, + 18650FE806253BE0005AB5DA, + 18650FE906253BE0005AB5DA, + 18650FEA06253BE0005AB5DA, + 18650FEB06253BE0005AB5DA, + 18650FEC06253BE0005AB5DA, + 18650FED06253BE0005AB5DA, + 18650FEE06253BE0005AB5DA, + 18650FEF06253BE0005AB5DA, + 18650FF006253BE0005AB5DA, + 18650FF106253BE0005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 18650FDB06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FDC06253BDF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FDD06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FDE06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FDF06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE006253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE106253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE206253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE306253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE406253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE506253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE606253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE706253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE806253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FE906253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FEA06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FEB06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_threads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FEC06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FED06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FEE06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FEF06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FF006253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FF106253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 18650FF206253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 18650FF306253BE0005AB5DA = { + children = ( + 18650FF406253BE0005AB5DA, + 18650FF506253BE0005AB5DA, + 18650FF606253BE0005AB5DA, + 18650FF706253BE0005AB5DA, + 18650FF806253BE0005AB5DA, + 18650FF906253BE0005AB5DA, + 18650FFA06253BE0005AB5DA, + 18650FFB06253BE0005AB5DA, + 18650FFC06253BE0005AB5DA, + 18650FFD06253BE0005AB5DA, + 18650FFE06253BE0005AB5DA, + 18650FFF06253BE0005AB5DA, + 1865100006253BE0005AB5DA, + 1865100106253BE0005AB5DA, + 1865100206253BE0005AB5DA, + 1865100306253BE0005AB5DA, + 1865100406253BE0005AB5DA, + 1865100506253BE0005AB5DA, + 1865100606253BE0005AB5DA, + 1865100706253BE0005AB5DA, + 1865100806253BE0005AB5DA, + 1865100906253BE0005AB5DA, + 1865100A06253BE0005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF406253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF506253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF606253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF706253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF806253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FF906253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFA06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFB06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFC06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFD06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFE06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 18650FFF06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100006253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100106253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100206253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100306253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100406253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_threads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100506253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100606253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100706253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100806253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100906253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100A06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865100B06253BE0005AB5DA = { + children = ( + 1865100C06253BE0005AB5DA, + 1865100D06253BE0005AB5DA, + 1865100E06253BE0005AB5DA, + 1865100F06253BE0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865100C06253BE0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865100D06253BE0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865100E06253BE0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865100F06253BE0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865101006253BE0005AB5DA = { + children = ( + 1865101106253BE0005AB5DA, + 1865101206253BE0005AB5DA, + 1865101306253BE0005AB5DA, + 1865101406253BE0005AB5DA, + 1865101506253BE0005AB5DA, + 1865101606253BE0005AB5DA, + 1865101706253BE0005AB5DA, + 1865101806253BE0005AB5DA, + 1865101906253BE0005AB5DA, + 1865101A06253BE0005AB5DA, + 1865101B06253BE0005AB5DA, + 1865101C06253BE0005AB5DA, + 1865101D06253BE0005AB5DA, + 1865101E06253BE0005AB5DA, + 1865101F06253BE0005AB5DA, + 1865102006253BE0005AB5DA, + 1865102106253BE0005AB5DA, + 1865102206253BE0005AB5DA, + 1865102306253BE0005AB5DA, + 1865102406253BE0005AB5DA, + 1865102506253BE0005AB5DA, + 1865102606253BE1005AB5DA, + 1865102706253BE1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865101106253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101206253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101306253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101406253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101506253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101606253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101706253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101806253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101906253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101A06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101B06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101C06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101D06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101E06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865101F06253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102006253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102106253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_threads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102206253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102306253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102406253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102506253BE0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102606253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102706253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865102806253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile.c; + refType = 4; + sourceTree = ""; + }; + 1865102906253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bspfile.h; + refType = 4; + sourceTree = ""; + }; + 1865102A06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = cmdlib.c; + refType = 4; + sourceTree = ""; + }; + 1865102B06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cmdlib.h; + refType = 4; + sourceTree = ""; + }; + 1865102C06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = inout.c; + refType = 4; + sourceTree = ""; + }; + 1865102D06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = inout.h; + refType = 4; + sourceTree = ""; + }; + 1865102E06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l3dslib.c; + refType = 4; + sourceTree = ""; + }; + 1865102F06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = l3dslib.h; + refType = 4; + sourceTree = ""; + }; + 1865103006253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lbmlib.c; + refType = 4; + sourceTree = ""; + }; + 1865103106253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lbmlib.h; + refType = 4; + sourceTree = ""; + }; + 1865103206253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = mathlib.c; + refType = 4; + sourceTree = ""; + }; + 1865103306253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = mathlib.h; + refType = 4; + sourceTree = ""; + }; + 1865103406253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = md4.c; + refType = 4; + sourceTree = ""; + }; + 1865103506253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = path_init.c; + refType = 4; + sourceTree = ""; + }; + 1865103606253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = polylib.c; + refType = 4; + sourceTree = ""; + }; + 1865103706253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = polylib.h; + refType = 4; + sourceTree = ""; + }; + 1865103806253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q2_threads.h; + refType = 4; + sourceTree = ""; + }; + 1865103906253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qfiles.h; + refType = 4; + sourceTree = ""; + }; + 1865103A06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = scriplib.c; + refType = 4; + sourceTree = ""; + }; + 1865103B06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = scriplib.h; + refType = 4; + sourceTree = ""; + }; + 1865103C06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = threads.c; + refType = 4; + sourceTree = ""; + }; + 1865103D06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = trilib.c; + refType = 4; + sourceTree = ""; + }; + 1865103E06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = trilib.h; + refType = 4; + sourceTree = ""; + }; + 1865103F06253BE1005AB5DA = { + children = ( + 1865104006253BE1005AB5DA, + 186510B706253BE3005AB5DA, + 186510B806253BE3005AB5DA, + 186510B906253BE3005AB5DA, + 186510BA06253BE3005AB5DA, + 186510BB06253BE3005AB5DA, + 186510BC06253BE3005AB5DA, + 186510BD06253BE3005AB5DA, + 186510BE06253BE3005AB5DA, + 186510BF06253BE3005AB5DA, + 186510C006253BE3005AB5DA, + 186510C106253BE3005AB5DA, + 186510C206253BE3005AB5DA, + 186510C306253BE3005AB5DA, + 186510C406253BE3005AB5DA, + 186510C506253BE3005AB5DA, + 186510C606253BE3005AB5DA, + 186510C706253BE3005AB5DA, + 186510C806253BE3005AB5DA, + 186510C906253BE3005AB5DA, + 186510CA06253BE3005AB5DA, + 186510CB06253BE3005AB5DA, + 186510CC06253BE3005AB5DA, + 186510CD06253BE3005AB5DA, + 186510CE06253BE3005AB5DA, + 186510CF06253BE3005AB5DA, + 186510D006253BE3005AB5DA, + ); + isa = PBXGroup; + path = q2map; + refType = 4; + sourceTree = ""; + }; + 1865104006253BE1005AB5DA = { + children = ( + 1865104106253BE1005AB5DA, + 1865104206253BE1005AB5DA, + 1865104306253BE1005AB5DA, + 1865104406253BE1005AB5DA, + 1865104506253BE1005AB5DA, + 1865106006253BE2005AB5DA, + 1865107B06253BE2005AB5DA, + 1865107C06253BE2005AB5DA, + 1865109706253BE2005AB5DA, + 1865109C06253BE2005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865104106253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865104206253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865104306253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865104406253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865104506253BE1005AB5DA = { + children = ( + 1865104606253BE1005AB5DA, + 1865104706253BE1005AB5DA, + 1865104806253BE1005AB5DA, + 1865104906253BE1005AB5DA, + 1865104A06253BE1005AB5DA, + 1865104B06253BE1005AB5DA, + 1865104C06253BE1005AB5DA, + 1865104D06253BE1005AB5DA, + 1865104E06253BE1005AB5DA, + 1865104F06253BE1005AB5DA, + 1865105006253BE1005AB5DA, + 1865105106253BE1005AB5DA, + 1865105206253BE1005AB5DA, + 1865105306253BE1005AB5DA, + 1865105406253BE1005AB5DA, + 1865105506253BE1005AB5DA, + 1865105606253BE1005AB5DA, + 1865105706253BE1005AB5DA, + 1865105806253BE1005AB5DA, + 1865105906253BE1005AB5DA, + 1865105A06253BE1005AB5DA, + 1865105B06253BE1005AB5DA, + 1865105C06253BE2005AB5DA, + 1865105D06253BE2005AB5DA, + 1865105E06253BE2005AB5DA, + 1865105F06253BE2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865104606253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104706253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104806253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "faces.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104906253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flow.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104A06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gldraw.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104B06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104C06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104D06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmap.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104E06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865104F06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105006253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nodraw.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105106253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patches.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105206253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105306253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105406253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105506253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105606253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105706253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105806253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105906253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105A06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105B06253BE1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105C06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105D06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trace.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105E06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865105F06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865106006253BE2005AB5DA = { + children = ( + 1865106106253BE2005AB5DA, + 1865106206253BE2005AB5DA, + 1865106306253BE2005AB5DA, + 1865106406253BE2005AB5DA, + 1865106506253BE2005AB5DA, + 1865106606253BE2005AB5DA, + 1865106706253BE2005AB5DA, + 1865106806253BE2005AB5DA, + 1865106906253BE2005AB5DA, + 1865106A06253BE2005AB5DA, + 1865106B06253BE2005AB5DA, + 1865106C06253BE2005AB5DA, + 1865106D06253BE2005AB5DA, + 1865106E06253BE2005AB5DA, + 1865106F06253BE2005AB5DA, + 1865107006253BE2005AB5DA, + 1865107106253BE2005AB5DA, + 1865107206253BE2005AB5DA, + 1865107306253BE2005AB5DA, + 1865107406253BE2005AB5DA, + 1865107506253BE2005AB5DA, + 1865107606253BE2005AB5DA, + 1865107706253BE2005AB5DA, + 1865107806253BE2005AB5DA, + 1865107906253BE2005AB5DA, + 1865107A06253BE2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865106106253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106206253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106306253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "faces.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106406253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flow.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106506253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gldraw.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106606253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106706253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106806253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmap.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106906253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106A06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106B06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nodraw.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106C06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patches.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106D06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106E06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865106F06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107006253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107106253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107206253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107306253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107406253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107506253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107606253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107706253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107806253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trace.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107906253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107A06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865107B06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865107C06253BE2005AB5DA = { + children = ( + 1865107D06253BE2005AB5DA, + 1865107E06253BE2005AB5DA, + 1865107F06253BE2005AB5DA, + 1865108006253BE2005AB5DA, + 1865108106253BE2005AB5DA, + 1865108206253BE2005AB5DA, + 1865108306253BE2005AB5DA, + 1865108406253BE2005AB5DA, + 1865108506253BE2005AB5DA, + 1865108606253BE2005AB5DA, + 1865108706253BE2005AB5DA, + 1865108806253BE2005AB5DA, + 1865108906253BE2005AB5DA, + 1865108A06253BE2005AB5DA, + 1865108B06253BE2005AB5DA, + 1865108C06253BE2005AB5DA, + 1865108D06253BE2005AB5DA, + 1865108E06253BE2005AB5DA, + 1865108F06253BE2005AB5DA, + 1865109006253BE2005AB5DA, + 1865109106253BE2005AB5DA, + 1865109206253BE2005AB5DA, + 1865109306253BE2005AB5DA, + 1865109406253BE2005AB5DA, + 1865109506253BE2005AB5DA, + 1865109606253BE2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865107D06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865107E06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865107F06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "faces.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108006253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flow.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108106253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gldraw.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108206253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108306253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108406253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmap.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108506253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108606253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108706253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nodraw.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108806253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patches.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108906253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108A06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108B06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108C06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "q2map.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108D06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108E06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865108F06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109006253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109106253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109206253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109306253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109406253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trace.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109506253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109606253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865109706253BE2005AB5DA = { + children = ( + 1865109806253BE2005AB5DA, + 1865109906253BE2005AB5DA, + 1865109A06253BE2005AB5DA, + 1865109B06253BE2005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865109806253BE2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865109906253BE2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865109A06253BE2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865109B06253BE2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865109C06253BE2005AB5DA = { + children = ( + 1865109D06253BE2005AB5DA, + 1865109E06253BE2005AB5DA, + 1865109F06253BE2005AB5DA, + 186510A006253BE2005AB5DA, + 186510A106253BE2005AB5DA, + 186510A206253BE2005AB5DA, + 186510A306253BE2005AB5DA, + 186510A406253BE2005AB5DA, + 186510A506253BE2005AB5DA, + 186510A606253BE2005AB5DA, + 186510A706253BE3005AB5DA, + 186510A806253BE3005AB5DA, + 186510A906253BE3005AB5DA, + 186510AA06253BE3005AB5DA, + 186510AB06253BE3005AB5DA, + 186510AC06253BE3005AB5DA, + 186510AD06253BE3005AB5DA, + 186510AE06253BE3005AB5DA, + 186510AF06253BE3005AB5DA, + 186510B006253BE3005AB5DA, + 186510B106253BE3005AB5DA, + 186510B206253BE3005AB5DA, + 186510B306253BE3005AB5DA, + 186510B406253BE3005AB5DA, + 186510B506253BE3005AB5DA, + 186510B606253BE3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865109D06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865109E06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "csg.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865109F06253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "faces.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A006253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flow.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A106253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gldraw.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A206253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A306253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A406253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmap.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A506253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A606253BE2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "nodraw.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patches.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510A906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AA06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AB06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AC06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2map.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AD06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AE06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qbsp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510AF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qrad.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B206253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qvis.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textures.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trace.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510B706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = brushbsp.c; + refType = 4; + sourceTree = ""; + }; + 186510B806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = csg.c; + refType = 4; + sourceTree = ""; + }; + 186510B906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = faces.c; + refType = 4; + sourceTree = ""; + }; + 186510BA06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = flow.c; + refType = 4; + sourceTree = ""; + }; + 186510BB06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = gldraw.c; + refType = 4; + sourceTree = ""; + }; + 186510BC06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = glfile.c; + refType = 4; + sourceTree = ""; + }; + 186510BD06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = leakfile.c; + refType = 4; + sourceTree = ""; + }; + 186510BE06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lightmap.c; + refType = 4; + sourceTree = ""; + }; + 186510BF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = main.c; + refType = 4; + sourceTree = ""; + }; + 186510C006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = map.c; + refType = 4; + sourceTree = ""; + }; + 186510C106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = nodraw.c; + refType = 4; + sourceTree = ""; + }; + 186510C206253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = patches.c; + refType = 4; + sourceTree = ""; + }; + 186510C306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = portals.c; + refType = 4; + sourceTree = ""; + }; + 186510C406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = prtfile.c; + refType = 4; + sourceTree = ""; + }; + 186510C506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q2map.h; + refType = 4; + sourceTree = ""; + }; + 186510C606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = q2map.vcproj; + refType = 4; + sourceTree = ""; + }; + 186510C706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qbsp.c; + refType = 4; + sourceTree = ""; + }; + 186510C806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qbsp.h; + refType = 4; + sourceTree = ""; + }; + 186510C906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qrad.c; + refType = 4; + sourceTree = ""; + }; + 186510CA06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qrad.h; + refType = 4; + sourceTree = ""; + }; + 186510CB06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qvis.c; + refType = 4; + sourceTree = ""; + }; + 186510CC06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qvis.h; + refType = 4; + sourceTree = ""; + }; + 186510CD06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = textures.c; + refType = 4; + sourceTree = ""; + }; + 186510CE06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = trace.c; + refType = 4; + sourceTree = ""; + }; + 186510CF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tree.c; + refType = 4; + sourceTree = ""; + }; + 186510D006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = writebsp.c; + refType = 4; + sourceTree = ""; + }; + 186510D106253BE3005AB5DA = { + children = ( + 186510D206253BE3005AB5DA, + 1865110906253BE3005AB5DA, + 1865110A06253BE3005AB5DA, + 1865110B06253BE3005AB5DA, + 1865110C06253BE3005AB5DA, + 1865110D06253BE3005AB5DA, + 1865110E06253BE3005AB5DA, + 1865110F06253BE3005AB5DA, + 1865111006253BE3005AB5DA, + 1865111106253BE3005AB5DA, + 1865111206253BE3005AB5DA, + ); + isa = PBXGroup; + path = qdata; + refType = 4; + sourceTree = ""; + }; + 186510D206253BE3005AB5DA = { + children = ( + 186510D306253BE3005AB5DA, + 186510D406253BE3005AB5DA, + 186510D506253BE3005AB5DA, + 186510D606253BE3005AB5DA, + 186510D706253BE3005AB5DA, + 186510E206253BE3005AB5DA, + 186510ED06253BE3005AB5DA, + 186510EE06253BE3005AB5DA, + 186510F906253BE3005AB5DA, + 186510FE06253BE3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186510D306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186510D406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186510D506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186510D606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186510D706253BE3005AB5DA = { + children = ( + 186510D806253BE3005AB5DA, + 186510D906253BE3005AB5DA, + 186510DA06253BE3005AB5DA, + 186510DB06253BE3005AB5DA, + 186510DC06253BE3005AB5DA, + 186510DD06253BE3005AB5DA, + 186510DE06253BE3005AB5DA, + 186510DF06253BE3005AB5DA, + 186510E006253BE3005AB5DA, + 186510E106253BE3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186510D806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510D906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DA06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makefile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DB06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DC06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DD06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DE06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510DF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510E006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510E106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510E206253BE3005AB5DA = { + children = ( + 186510E306253BE3005AB5DA, + 186510E406253BE3005AB5DA, + 186510E506253BE3005AB5DA, + 186510E606253BE3005AB5DA, + 186510E706253BE3005AB5DA, + 186510E806253BE3005AB5DA, + 186510E906253BE3005AB5DA, + 186510EA06253BE3005AB5DA, + 186510EB06253BE3005AB5DA, + 186510EC06253BE3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186510E306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makefile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510E906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510EA06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510EB06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510EC06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186510ED06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186510EE06253BE3005AB5DA = { + children = ( + 186510EF06253BE3005AB5DA, + 186510F006253BE3005AB5DA, + 186510F106253BE3005AB5DA, + 186510F206253BE3005AB5DA, + 186510F306253BE3005AB5DA, + 186510F406253BE3005AB5DA, + 186510F506253BE3005AB5DA, + 186510F606253BE3005AB5DA, + 186510F706253BE3005AB5DA, + 186510F806253BE3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186510EF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makefile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F206253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "qdata3.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186510F906253BE3005AB5DA = { + children = ( + 186510FA06253BE3005AB5DA, + 186510FB06253BE3005AB5DA, + 186510FC06253BE3005AB5DA, + 186510FD06253BE3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186510FA06253BE3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186510FB06253BE3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186510FC06253BE3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186510FD06253BE3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186510FE06253BE3005AB5DA = { + children = ( + 186510FF06253BE3005AB5DA, + 1865110006253BE3005AB5DA, + 1865110106253BE3005AB5DA, + 1865110206253BE3005AB5DA, + 1865110306253BE3005AB5DA, + 1865110406253BE3005AB5DA, + 1865110506253BE3005AB5DA, + 1865110606253BE3005AB5DA, + 1865110706253BE3005AB5DA, + 1865110806253BE3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186510FF06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makefile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110206253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110306253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110406253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865110906253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = anorms.h; + refType = 4; + sourceTree = ""; + }; + 1865110A06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = images.c; + refType = 4; + sourceTree = ""; + }; + 1865110B06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.make; + path = makefile; + refType = 4; + sourceTree = ""; + }; + 1865110C06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = models.c; + refType = 4; + sourceTree = ""; + }; + 1865110D06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qdata.c; + refType = 4; + sourceTree = ""; + }; + 1865110E06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qdata.h; + refType = 4; + sourceTree = ""; + }; + 1865110F06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = qdata3.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865111006253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = sprites.c; + refType = 4; + sourceTree = ""; + }; + 1865111106253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tables.c; + refType = 4; + sourceTree = ""; + }; + 1865111206253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = video.c; + refType = 4; + sourceTree = ""; + }; + 1865111306253BE3005AB5DA = { + children = ( + 1865111406253BE3005AB5DA, + 1865118F06253BE5005AB5DA, + 1865119006253BE5005AB5DA, + 1865119106253BE5005AB5DA, + 1865119206253BE5005AB5DA, + 1865119306253BE5005AB5DA, + 1865119406253BE5005AB5DA, + 1865122606253BE7005AB5DA, + 1865122706253BE7005AB5DA, + 1865122806253BE7005AB5DA, + 1865122906253BE7005AB5DA, + 1865122A06253BE7005AB5DA, + 1865122B06253BE7005AB5DA, + 1865122C06253BE7005AB5DA, + 1865122D06253BE7005AB5DA, + 1865122E06253BE7005AB5DA, + 1865128406253BE7005AB5DA, + 1865128506253BE7005AB5DA, + 1865128606253BE7005AB5DA, + 1865128706253BE7005AB5DA, + 1865128806253BE7005AB5DA, + 1865128906253BE7005AB5DA, + 1865128A06253BE7005AB5DA, + 1865128B06253BE7005AB5DA, + 1865128C06253BE7005AB5DA, + 1865128D06253BE7005AB5DA, + 1865128E06253BE7005AB5DA, + 1865128F06253BE7005AB5DA, + 1865129006253BE7005AB5DA, + 1865129106253BE7005AB5DA, + ); + isa = PBXGroup; + path = qdata_heretic2; + refType = 4; + sourceTree = ""; + }; + 1865111406253BE3005AB5DA = { + children = ( + 1865111506253BE3005AB5DA, + 1865111606253BE3005AB5DA, + 1865111706253BE3005AB5DA, + 1865111806253BE3005AB5DA, + 1865111906253BE3005AB5DA, + 1865113506253BE4005AB5DA, + 1865115106253BE5005AB5DA, + 1865115206253BE5005AB5DA, + 1865116E06253BE5005AB5DA, + 1865117306253BE5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865111506253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865111606253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865111706253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865111806253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865111906253BE3005AB5DA = { + children = ( + 1865111A06253BE3005AB5DA, + 1865111B06253BE4005AB5DA, + 1865111C06253BE4005AB5DA, + 1865111D06253BE4005AB5DA, + 1865111E06253BE4005AB5DA, + 1865111F06253BE4005AB5DA, + 1865112006253BE4005AB5DA, + 1865112106253BE4005AB5DA, + 1865112206253BE4005AB5DA, + 1865112306253BE4005AB5DA, + 1865112406253BE4005AB5DA, + 1865112506253BE4005AB5DA, + 1865112606253BE4005AB5DA, + 1865112706253BE4005AB5DA, + 1865112806253BE4005AB5DA, + 1865112906253BE4005AB5DA, + 1865112A06253BE4005AB5DA, + 1865112B06253BE4005AB5DA, + 1865112C06253BE4005AB5DA, + 1865112D06253BE4005AB5DA, + 1865112E06253BE4005AB5DA, + 1865112F06253BE4005AB5DA, + 1865113006253BE4005AB5DA, + 1865113106253BE4005AB5DA, + 1865113206253BE4005AB5DA, + 1865113306253BE4005AB5DA, + 1865113406253BE4005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865111A06253BE3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adpcm.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865111B06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865111C06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865111D06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865111E06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "book.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865111F06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodels.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112006253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon1.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112106253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112206253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112306253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112406253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "joints.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112506253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112606253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pics.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112706253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_fmodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112806253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112906253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112A06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112B06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112C06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3_heretic2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112D06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112E06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.aps.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865112F06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113006253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113106253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "svdcmp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113206253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113306253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tmix.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113406253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865113506253BE4005AB5DA = { + children = ( + 1865113606253BE4005AB5DA, + 1865113706253BE4005AB5DA, + 1865113806253BE4005AB5DA, + 1865113906253BE4005AB5DA, + 1865113A06253BE4005AB5DA, + 1865113B06253BE4005AB5DA, + 1865113C06253BE4005AB5DA, + 1865113D06253BE4005AB5DA, + 1865113E06253BE4005AB5DA, + 1865113F06253BE4005AB5DA, + 1865114006253BE4005AB5DA, + 1865114106253BE4005AB5DA, + 1865114206253BE4005AB5DA, + 1865114306253BE4005AB5DA, + 1865114406253BE4005AB5DA, + 1865114506253BE4005AB5DA, + 1865114606253BE4005AB5DA, + 1865114706253BE4005AB5DA, + 1865114806253BE4005AB5DA, + 1865114906253BE4005AB5DA, + 1865114A06253BE4005AB5DA, + 1865114B06253BE4005AB5DA, + 1865114C06253BE5005AB5DA, + 1865114D06253BE5005AB5DA, + 1865114E06253BE5005AB5DA, + 1865114F06253BE5005AB5DA, + 1865115006253BE5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865113606253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adpcm.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113706253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113806253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113906253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113A06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "book.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113B06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodels.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113C06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon1.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113D06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113E06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865113F06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114006253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "joints.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114106253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114206253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pics.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114306253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_fmodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114406253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114506253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114606253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114706253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114806253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3_heretic2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114906253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114A06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.aps.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114B06253BE4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "svdcmp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114E06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865114F06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tmix.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865115006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865115106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865115206253BE5005AB5DA = { + children = ( + 1865115306253BE5005AB5DA, + 1865115406253BE5005AB5DA, + 1865115506253BE5005AB5DA, + 1865115606253BE5005AB5DA, + 1865115706253BE5005AB5DA, + 1865115806253BE5005AB5DA, + 1865115906253BE5005AB5DA, + 1865115A06253BE5005AB5DA, + 1865115B06253BE5005AB5DA, + 1865115C06253BE5005AB5DA, + 1865115D06253BE5005AB5DA, + 1865115E06253BE5005AB5DA, + 1865115F06253BE5005AB5DA, + 1865116006253BE5005AB5DA, + 1865116106253BE5005AB5DA, + 1865116206253BE5005AB5DA, + 1865116306253BE5005AB5DA, + 1865116406253BE5005AB5DA, + 1865116506253BE5005AB5DA, + 1865116606253BE5005AB5DA, + 1865116706253BE5005AB5DA, + 1865116806253BE5005AB5DA, + 1865116906253BE5005AB5DA, + 1865116A06253BE5005AB5DA, + 1865116B06253BE5005AB5DA, + 1865116C06253BE5005AB5DA, + 1865116D06253BE5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865115306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adpcm.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "book.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodels.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115906253BE5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "icon1.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115A06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115B06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "joints.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115E06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865115F06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pics.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_fmodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "qdata3_heretic2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116706253BE5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "script1.aps.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116A06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "svdcmp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116B06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tmix.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865116E06253BE5005AB5DA = { + children = ( + 1865116F06253BE5005AB5DA, + 1865117006253BE5005AB5DA, + 1865117106253BE5005AB5DA, + 1865117206253BE5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865116F06253BE5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865117006253BE5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865117106253BE5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865117206253BE5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865117306253BE5005AB5DA = { + children = ( + 1865117406253BE5005AB5DA, + 1865117506253BE5005AB5DA, + 1865117606253BE5005AB5DA, + 1865117706253BE5005AB5DA, + 1865117806253BE5005AB5DA, + 1865117906253BE5005AB5DA, + 1865117A06253BE5005AB5DA, + 1865117B06253BE5005AB5DA, + 1865117C06253BE5005AB5DA, + 1865117D06253BE5005AB5DA, + 1865117E06253BE5005AB5DA, + 1865117F06253BE5005AB5DA, + 1865118006253BE5005AB5DA, + 1865118106253BE5005AB5DA, + 1865118206253BE5005AB5DA, + 1865118306253BE5005AB5DA, + 1865118406253BE5005AB5DA, + 1865118506253BE5005AB5DA, + 1865118606253BE5005AB5DA, + 1865118706253BE5005AB5DA, + 1865118806253BE5005AB5DA, + 1865118906253BE5005AB5DA, + 1865118A06253BE5005AB5DA, + 1865118B06253BE5005AB5DA, + 1865118C06253BE5005AB5DA, + 1865118D06253BE5005AB5DA, + 1865118E06253BE5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865117406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adpcm.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "animcomp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "anorms.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "book.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodels.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117A06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icon1.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117B06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jointed.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117E06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "joints.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865117F06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pics.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_fmodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qd_skeletons.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qdata3_heretic2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.aps.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "script1.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118A06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sprites.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118B06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "svdcmp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tables.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tmix.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118E06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865118F06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = adpcm.h; + refType = 4; + sourceTree = ""; + }; + 1865119006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = animcomp.c; + refType = 4; + sourceTree = ""; + }; + 1865119106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = animcomp.h; + refType = 4; + sourceTree = ""; + }; + 1865119206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = anorms.h; + refType = 4; + sourceTree = ""; + }; + 1865119306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = book.c; + refType = 4; + sourceTree = ""; + }; + 1865119406253BE5005AB5DA = { + children = ( + 1865119506253BE5005AB5DA, + 1865120C06253BE6005AB5DA, + 1865120D06253BE6005AB5DA, + 1865120E06253BE6005AB5DA, + 1865120F06253BE6005AB5DA, + 1865121006253BE6005AB5DA, + 1865121106253BE6005AB5DA, + 1865121206253BE6005AB5DA, + 1865121306253BE6005AB5DA, + 1865121406253BE6005AB5DA, + 1865121506253BE6005AB5DA, + 1865121606253BE6005AB5DA, + 1865121706253BE6005AB5DA, + 1865121806253BE6005AB5DA, + 1865121906253BE6005AB5DA, + 1865121A06253BE6005AB5DA, + 1865121B06253BE7005AB5DA, + 1865121C06253BE7005AB5DA, + 1865121D06253BE7005AB5DA, + 1865121E06253BE7005AB5DA, + 1865121F06253BE7005AB5DA, + 1865122006253BE7005AB5DA, + 1865122106253BE7005AB5DA, + 1865122206253BE7005AB5DA, + 1865122306253BE7005AB5DA, + 1865122406253BE7005AB5DA, + 1865122506253BE7005AB5DA, + ); + isa = PBXGroup; + path = common; + refType = 4; + sourceTree = ""; + }; + 1865119506253BE5005AB5DA = { + children = ( + 1865119606253BE5005AB5DA, + 1865119706253BE5005AB5DA, + 1865119806253BE5005AB5DA, + 1865119906253BE5005AB5DA, + 1865119A06253BE5005AB5DA, + 186511B506253BE5005AB5DA, + 186511D006253BE6005AB5DA, + 186511D106253BE6005AB5DA, + 186511EC06253BE6005AB5DA, + 186511F106253BE6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865119606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865119706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865119806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865119906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865119A06253BE5005AB5DA = { + children = ( + 1865119B06253BE5005AB5DA, + 1865119C06253BE5005AB5DA, + 1865119D06253BE5005AB5DA, + 1865119E06253BE5005AB5DA, + 1865119F06253BE5005AB5DA, + 186511A006253BE5005AB5DA, + 186511A106253BE5005AB5DA, + 186511A206253BE5005AB5DA, + 186511A306253BE5005AB5DA, + 186511A406253BE5005AB5DA, + 186511A506253BE5005AB5DA, + 186511A606253BE5005AB5DA, + 186511A706253BE5005AB5DA, + 186511A806253BE5005AB5DA, + 186511A906253BE5005AB5DA, + 186511AA06253BE5005AB5DA, + 186511AB06253BE5005AB5DA, + 186511AC06253BE5005AB5DA, + 186511AD06253BE5005AB5DA, + 186511AE06253BE5005AB5DA, + 186511AF06253BE5005AB5DA, + 186511B006253BE5005AB5DA, + 186511B106253BE5005AB5DA, + 186511B206253BE5005AB5DA, + 186511B306253BE5005AB5DA, + 186511B406253BE5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865119B06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865119C06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865119D06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865119E06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865119F06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "her2_threads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511A906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AA06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AB06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AC06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AD06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AE06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511AF06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511B506253BE5005AB5DA = { + children = ( + 186511B606253BE5005AB5DA, + 186511B706253BE5005AB5DA, + 186511B806253BE5005AB5DA, + 186511B906253BE5005AB5DA, + 186511BA06253BE5005AB5DA, + 186511BB06253BE5005AB5DA, + 186511BC06253BE5005AB5DA, + 186511BD06253BE5005AB5DA, + 186511BE06253BE5005AB5DA, + 186511BF06253BE5005AB5DA, + 186511C006253BE5005AB5DA, + 186511C106253BE5005AB5DA, + 186511C206253BE5005AB5DA, + 186511C306253BE5005AB5DA, + 186511C406253BE5005AB5DA, + 186511C506253BE5005AB5DA, + 186511C606253BE5005AB5DA, + 186511C706253BE5005AB5DA, + 186511C806253BE6005AB5DA, + 186511C906253BE6005AB5DA, + 186511CA06253BE6005AB5DA, + 186511CB06253BE6005AB5DA, + 186511CC06253BE6005AB5DA, + 186511CD06253BE6005AB5DA, + 186511CE06253BE6005AB5DA, + 186511CF06253BE6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186511B606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511B706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511B806253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511B906253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BA06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "her2_threads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BB06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BC06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BD06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BE06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511BF06253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C006253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C106253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C206253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C306253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C406253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C506253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C606253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C706253BE5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511C906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CA06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CB06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CC06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CD06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CE06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511CF06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511D006253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186511D106253BE6005AB5DA = { + children = ( + 186511D206253BE6005AB5DA, + 186511D306253BE6005AB5DA, + 186511D406253BE6005AB5DA, + 186511D506253BE6005AB5DA, + 186511D606253BE6005AB5DA, + 186511D706253BE6005AB5DA, + 186511D806253BE6005AB5DA, + 186511D906253BE6005AB5DA, + 186511DA06253BE6005AB5DA, + 186511DB06253BE6005AB5DA, + 186511DC06253BE6005AB5DA, + 186511DD06253BE6005AB5DA, + 186511DE06253BE6005AB5DA, + 186511DF06253BE6005AB5DA, + 186511E006253BE6005AB5DA, + 186511E106253BE6005AB5DA, + 186511E206253BE6005AB5DA, + 186511E306253BE6005AB5DA, + 186511E406253BE6005AB5DA, + 186511E506253BE6005AB5DA, + 186511E606253BE6005AB5DA, + 186511E706253BE6005AB5DA, + 186511E806253BE6005AB5DA, + 186511E906253BE6005AB5DA, + 186511EA06253BE6005AB5DA, + 186511EB06253BE6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186511D206253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D306253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D406253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D506253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D606253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "her2_threads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D706253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511D906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DA06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DB06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DC06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DD06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DE06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511DF06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E006253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E106253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E206253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E306253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E406253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E506253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E606253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E706253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511E906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511EA06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511EB06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186511EC06253BE6005AB5DA = { + children = ( + 186511ED06253BE6005AB5DA, + 186511EE06253BE6005AB5DA, + 186511EF06253BE6005AB5DA, + 186511F006253BE6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186511ED06253BE6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186511EE06253BE6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186511EF06253BE6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186511F006253BE6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186511F106253BE6005AB5DA = { + children = ( + 186511F206253BE6005AB5DA, + 186511F306253BE6005AB5DA, + 186511F406253BE6005AB5DA, + 186511F506253BE6005AB5DA, + 186511F606253BE6005AB5DA, + 186511F706253BE6005AB5DA, + 186511F806253BE6005AB5DA, + 186511F906253BE6005AB5DA, + 186511FA06253BE6005AB5DA, + 186511FB06253BE6005AB5DA, + 186511FC06253BE6005AB5DA, + 186511FD06253BE6005AB5DA, + 186511FE06253BE6005AB5DA, + 186511FF06253BE6005AB5DA, + 1865120006253BE6005AB5DA, + 1865120106253BE6005AB5DA, + 1865120206253BE6005AB5DA, + 1865120306253BE6005AB5DA, + 1865120406253BE6005AB5DA, + 1865120506253BE6005AB5DA, + 1865120606253BE6005AB5DA, + 1865120706253BE6005AB5DA, + 1865120806253BE6005AB5DA, + 1865120906253BE6005AB5DA, + 1865120A06253BE6005AB5DA, + 1865120B06253BE6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186511F206253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F306253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F406253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F506253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F606253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "her2_threads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F706253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511F906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FA06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FB06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FC06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FD06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FE06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186511FF06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120006253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120106253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120206253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120306253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120406253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120506253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120606253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120706253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "token.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120A06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120B06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865120C06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile.c; + refType = 4; + sourceTree = ""; + }; + 1865120D06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bspfile.h; + refType = 4; + sourceTree = ""; + }; + 1865120E06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = cmdlib.c; + refType = 4; + sourceTree = ""; + }; + 1865120F06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cmdlib.h; + refType = 4; + sourceTree = ""; + }; + 1865121006253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = her2_threads.h; + refType = 4; + sourceTree = ""; + }; + 1865121106253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = inout.c; + refType = 4; + sourceTree = ""; + }; + 1865121206253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = inout.h; + refType = 4; + sourceTree = ""; + }; + 1865121306253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l3dslib.c; + refType = 4; + sourceTree = ""; + }; + 1865121406253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = l3dslib.h; + refType = 4; + sourceTree = ""; + }; + 1865121506253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lbmlib.c; + refType = 4; + sourceTree = ""; + }; + 1865121606253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lbmlib.h; + refType = 4; + sourceTree = ""; + }; + 1865121706253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = mathlib.c; + refType = 4; + sourceTree = ""; + }; + 1865121806253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = mathlib.h; + refType = 4; + sourceTree = ""; + }; + 1865121906253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = md4.c; + refType = 4; + sourceTree = ""; + }; + 1865121A06253BE6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = path_init.c; + refType = 4; + sourceTree = ""; + }; + 1865121B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = polylib.c; + refType = 4; + sourceTree = ""; + }; + 1865121C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = polylib.h; + refType = 4; + sourceTree = ""; + }; + 1865121D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qfiles.c; + refType = 4; + sourceTree = ""; + }; + 1865121E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qfiles.h; + refType = 4; + sourceTree = ""; + }; + 1865121F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = scriplib.c; + refType = 4; + sourceTree = ""; + }; + 1865122006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = scriplib.h; + refType = 4; + sourceTree = ""; + }; + 1865122106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = threads.c; + refType = 4; + sourceTree = ""; + }; + 1865122206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = token.c; + refType = 4; + sourceTree = ""; + }; + 1865122306253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = token.h; + refType = 4; + sourceTree = ""; + }; + 1865122406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = trilib.c; + refType = 4; + sourceTree = ""; + }; + 1865122506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = trilib.h; + refType = 4; + sourceTree = ""; + }; + 1865122606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = fmodels.c; + refType = 4; + sourceTree = ""; + }; + 1865122706253BE7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.ico; + path = icon1.ico; + refType = 4; + sourceTree = ""; + }; + 1865122806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = images.c; + refType = 4; + sourceTree = ""; + }; + 1865122906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = jointed.c; + refType = 4; + sourceTree = ""; + }; + 1865122A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jointed.h; + refType = 4; + sourceTree = ""; + }; + 1865122B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = joints.h; + refType = 4; + sourceTree = ""; + }; + 1865122C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = models.c; + refType = 4; + sourceTree = ""; + }; + 1865122D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pics.c; + refType = 4; + sourceTree = ""; + }; + 1865122E06253BE7005AB5DA = { + children = ( + 1865122F06253BE7005AB5DA, + 1865127606253BE7005AB5DA, + 1865127706253BE7005AB5DA, + 1865127806253BE7005AB5DA, + 1865127906253BE7005AB5DA, + 1865127A06253BE7005AB5DA, + 1865127B06253BE7005AB5DA, + 1865127C06253BE7005AB5DA, + 1865127D06253BE7005AB5DA, + 1865127E06253BE7005AB5DA, + 1865127F06253BE7005AB5DA, + 1865128006253BE7005AB5DA, + 1865128106253BE7005AB5DA, + 1865128206253BE7005AB5DA, + 1865128306253BE7005AB5DA, + ); + isa = PBXGroup; + path = qcommon; + refType = 4; + sourceTree = ""; + }; + 1865122F06253BE7005AB5DA = { + children = ( + 1865123006253BE7005AB5DA, + 1865123106253BE7005AB5DA, + 1865123206253BE7005AB5DA, + 1865123306253BE7005AB5DA, + 1865123406253BE7005AB5DA, + 1865124306253BE7005AB5DA, + 1865125206253BE7005AB5DA, + 1865125306253BE7005AB5DA, + 1865126206253BE7005AB5DA, + 1865126706253BE7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865123006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865123106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865123206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865123306253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865123406253BE7005AB5DA = { + children = ( + 1865123506253BE7005AB5DA, + 1865123606253BE7005AB5DA, + 1865123706253BE7005AB5DA, + 1865123806253BE7005AB5DA, + 1865123906253BE7005AB5DA, + 1865123A06253BE7005AB5DA, + 1865123B06253BE7005AB5DA, + 1865123C06253BE7005AB5DA, + 1865123D06253BE7005AB5DA, + 1865123E06253BE7005AB5DA, + 1865123F06253BE7005AB5DA, + 1865124006253BE7005AB5DA, + 1865124106253BE7005AB5DA, + 1865124206253BE7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865123506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "angles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "arrayedlist.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flex.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "h2common.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "placement.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_typedef.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865123F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865124006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865124106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865124206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865124306253BE7005AB5DA = { + children = ( + 1865124406253BE7005AB5DA, + 1865124506253BE7005AB5DA, + 1865124606253BE7005AB5DA, + 1865124706253BE7005AB5DA, + 1865124806253BE7005AB5DA, + 1865124906253BE7005AB5DA, + 1865124A06253BE7005AB5DA, + 1865124B06253BE7005AB5DA, + 1865124C06253BE7005AB5DA, + 1865124D06253BE7005AB5DA, + 1865124E06253BE7005AB5DA, + 1865124F06253BE7005AB5DA, + 1865125006253BE7005AB5DA, + 1865125106253BE7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865124406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "angles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "arrayedlist.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flex.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "h2common.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "placement.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_typedef.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865124F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865125006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865125106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865125206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865125306253BE7005AB5DA = { + children = ( + 1865125406253BE7005AB5DA, + 1865125506253BE7005AB5DA, + 1865125606253BE7005AB5DA, + 1865125706253BE7005AB5DA, + 1865125806253BE7005AB5DA, + 1865125906253BE7005AB5DA, + 1865125A06253BE7005AB5DA, + 1865125B06253BE7005AB5DA, + 1865125C06253BE7005AB5DA, + 1865125D06253BE7005AB5DA, + 1865125E06253BE7005AB5DA, + 1865125F06253BE7005AB5DA, + 1865126006253BE7005AB5DA, + 1865126106253BE7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865125406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "angles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "arrayedlist.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flex.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "h2common.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "placement.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_typedef.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865125F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865126006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865126106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865126206253BE7005AB5DA = { + children = ( + 1865126306253BE7005AB5DA, + 1865126406253BE7005AB5DA, + 1865126506253BE7005AB5DA, + 1865126606253BE7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865126306253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865126406253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865126506253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865126606253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865126706253BE7005AB5DA = { + children = ( + 1865126806253BE7005AB5DA, + 1865126906253BE7005AB5DA, + 1865126A06253BE7005AB5DA, + 1865126B06253BE7005AB5DA, + 1865126C06253BE7005AB5DA, + 1865126D06253BE7005AB5DA, + 1865126E06253BE7005AB5DA, + 1865126F06253BE7005AB5DA, + 1865127006253BE7005AB5DA, + 1865127106253BE7005AB5DA, + 1865127206253BE7005AB5DA, + 1865127306253BE7005AB5DA, + 1865127406253BE7005AB5DA, + 1865127506253BE7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865126806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "angles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "arrayedlist.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "flex.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fmodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "h2common.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "placement.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_typedef.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865126F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127306253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resourcemanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "skeletons.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865127606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = angles.h; + refType = 4; + sourceTree = ""; + }; + 1865127706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = arrayedlist.h; + refType = 4; + sourceTree = ""; + }; + 1865127806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = flex.h; + refType = 4; + sourceTree = ""; + }; + 1865127906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = fmodel.h; + refType = 4; + sourceTree = ""; + }; + 1865127A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = h2common.h; + refType = 4; + sourceTree = ""; + }; + 1865127B06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = placement.h; + refType = 4; + sourceTree = ""; + }; + 1865127C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q_typedef.h; + refType = 4; + sourceTree = ""; + }; + 1865127D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qfiles.h; + refType = 4; + sourceTree = ""; + }; + 1865127E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = reference.c; + refType = 4; + sourceTree = ""; + }; + 1865127F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = reference.h; + refType = 4; + sourceTree = ""; + }; + 1865128006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = resourcemanager.c; + refType = 4; + sourceTree = ""; + }; + 1865128106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resourcemanager.h; + refType = 4; + sourceTree = ""; + }; + 1865128206253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = skeletons.c; + refType = 4; + sourceTree = ""; + }; + 1865128306253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = skeletons.h; + refType = 4; + sourceTree = ""; + }; + 1865128406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qd_fmodel.h; + refType = 4; + sourceTree = ""; + }; + 1865128506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qd_skeletons.c; + refType = 4; + sourceTree = ""; + }; + 1865128606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qd_skeletons.h; + refType = 4; + sourceTree = ""; + }; + 1865128706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = qdata.c; + refType = 4; + sourceTree = ""; + }; + 1865128806253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qdata.h; + refType = 4; + sourceTree = ""; + }; + 1865128906253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = qdata3_heretic2.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865128A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resource.h; + refType = 4; + sourceTree = ""; + }; + 1865128B06253BE7005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = script1.aps; + refType = 4; + sourceTree = ""; + }; + 1865128C06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = script1.rc; + refType = 4; + sourceTree = ""; + }; + 1865128D06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = sprites.c; + refType = 4; + sourceTree = ""; + }; + 1865128E06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = svdcmp.c; + refType = 4; + sourceTree = ""; + }; + 1865128F06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tables.c; + refType = 4; + sourceTree = ""; + }; + 1865129006253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tmix.c; + refType = 4; + sourceTree = ""; + }; + 1865129106253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = video.c; + refType = 4; + sourceTree = ""; + }; + 1865129206253BE7005AB5DA = { + children = ( + 1865129306253BE7005AB5DA, + 186512A206253BE7005AB5DA, + 186512B206253BE8005AB5DA, + 1865135806253BEA005AB5DA, + 186513C206253BEB005AB5DA, + 186513E206253BEB005AB5DA, + ); + isa = PBXGroup; + path = quake3; + refType = 4; + sourceTree = ""; + }; + 1865129306253BE7005AB5DA = { + children = ( + 1865129406253BE7005AB5DA, + 1865129506253BE7005AB5DA, + 1865129606253BE7005AB5DA, + 1865129706253BE7005AB5DA, + 1865129806253BE7005AB5DA, + 1865129906253BE7005AB5DA, + 1865129A06253BE7005AB5DA, + 1865129B06253BE7005AB5DA, + 1865129C06253BE7005AB5DA, + 186512A106253BE7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865129406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865129506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865129606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865129706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865129806253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865129906253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865129A06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865129B06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865129C06253BE7005AB5DA = { + children = ( + 1865129D06253BE7005AB5DA, + 1865129E06253BE7005AB5DA, + 1865129F06253BE7005AB5DA, + 186512A006253BE7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865129D06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865129E06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865129F06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186512A006253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186512A106253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186512A206253BE7005AB5DA = { + children = ( + 186512A306253BE7005AB5DA, + ); + isa = PBXGroup; + path = code; + refType = 4; + sourceTree = ""; + }; + 186512A306253BE7005AB5DA = { + children = ( + 186512A406253BE7005AB5DA, + 186512A506253BE7005AB5DA, + 186512A606253BE7005AB5DA, + 186512A706253BE7005AB5DA, + 186512A806253BE7005AB5DA, + 186512A906253BE7005AB5DA, + 186512AA06253BE7005AB5DA, + 186512AB06253BE7005AB5DA, + 186512AC06253BE7005AB5DA, + 186512B106253BE8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186512A406253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186512A506253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186512A606253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186512A706253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186512A806253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186512A906253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186512AA06253BE7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186512AB06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186512AC06253BE7005AB5DA = { + children = ( + 186512AD06253BE7005AB5DA, + 186512AE06253BE7005AB5DA, + 186512AF06253BE8005AB5DA, + 186512B006253BE8005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186512AD06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186512AE06253BE7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186512AF06253BE8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186512B006253BE8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186512B106253BE8005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186512B206253BE8005AB5DA = { + children = ( + 186512B306253BE8005AB5DA, + 1865133A06253BE9005AB5DA, + 1865133B06253BE9005AB5DA, + 1865133C06253BE9005AB5DA, + 1865133D06253BE9005AB5DA, + 1865133E06253BE9005AB5DA, + 1865133F06253BE9005AB5DA, + 1865134006253BE9005AB5DA, + 1865134106253BE9005AB5DA, + 1865134206253BE9005AB5DA, + 1865134306253BE9005AB5DA, + 1865134406253BE9005AB5DA, + 1865134506253BE9005AB5DA, + 1865134606253BE9005AB5DA, + 1865134706253BE9005AB5DA, + 1865134806253BE9005AB5DA, + 1865134906253BEA005AB5DA, + 1865134A06253BEA005AB5DA, + 1865134B06253BEA005AB5DA, + 1865134C06253BEA005AB5DA, + 1865134D06253BEA005AB5DA, + 1865134E06253BEA005AB5DA, + 1865134F06253BEA005AB5DA, + 1865135006253BEA005AB5DA, + 1865135106253BEA005AB5DA, + 1865135206253BEA005AB5DA, + 1865135306253BEA005AB5DA, + 1865135406253BEA005AB5DA, + 1865135506253BEA005AB5DA, + 1865135606253BEA005AB5DA, + 1865135706253BEA005AB5DA, + ); + isa = PBXGroup; + path = common; + refType = 4; + sourceTree = ""; + }; + 186512B306253BE8005AB5DA = { + children = ( + 186512B406253BE8005AB5DA, + 186512B506253BE8005AB5DA, + 186512B606253BE8005AB5DA, + 186512B706253BE8005AB5DA, + 186512B806253BE8005AB5DA, + 186512D706253BE8005AB5DA, + 186512F606253BE9005AB5DA, + 186512F706253BE9005AB5DA, + 1865131606253BE9005AB5DA, + 1865131B06253BE9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186512B406253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186512B506253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186512B606253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186512B706253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186512B806253BE8005AB5DA = { + children = ( + 186512B906253BE8005AB5DA, + 186512BA06253BE8005AB5DA, + 186512BB06253BE8005AB5DA, + 186512BC06253BE8005AB5DA, + 186512BD06253BE8005AB5DA, + 186512BE06253BE8005AB5DA, + 186512BF06253BE8005AB5DA, + 186512C006253BE8005AB5DA, + 186512C106253BE8005AB5DA, + 186512C206253BE8005AB5DA, + 186512C306253BE8005AB5DA, + 186512C406253BE8005AB5DA, + 186512C506253BE8005AB5DA, + 186512C606253BE8005AB5DA, + 186512C706253BE8005AB5DA, + 186512C806253BE8005AB5DA, + 186512C906253BE8005AB5DA, + 186512CA06253BE8005AB5DA, + 186512CB06253BE8005AB5DA, + 186512CC06253BE8005AB5DA, + 186512CD06253BE8005AB5DA, + 186512CE06253BE8005AB5DA, + 186512CF06253BE8005AB5DA, + 186512D006253BE8005AB5DA, + 186512D106253BE8005AB5DA, + 186512D206253BE8005AB5DA, + 186512D306253BE8005AB5DA, + 186512D406253BE8005AB5DA, + 186512D506253BE8005AB5DA, + 186512D606253BE8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186512B906253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BA06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BB06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BC06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BD06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BE06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512BF06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C006253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C106253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C206253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C306253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C406253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C506253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C606253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C706253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C806253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512C906253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CA06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CB06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CC06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qthreads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CD06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CE06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512CF06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflags.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D006253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D106253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D206253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D306253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D406253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D506253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D606253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512D706253BE8005AB5DA = { + children = ( + 186512D806253BE8005AB5DA, + 186512D906253BE8005AB5DA, + 186512DA06253BE8005AB5DA, + 186512DB06253BE8005AB5DA, + 186512DC06253BE8005AB5DA, + 186512DD06253BE8005AB5DA, + 186512DE06253BE8005AB5DA, + 186512DF06253BE8005AB5DA, + 186512E006253BE8005AB5DA, + 186512E106253BE8005AB5DA, + 186512E206253BE8005AB5DA, + 186512E306253BE8005AB5DA, + 186512E406253BE8005AB5DA, + 186512E506253BE8005AB5DA, + 186512E606253BE8005AB5DA, + 186512E706253BE8005AB5DA, + 186512E806253BE8005AB5DA, + 186512E906253BE8005AB5DA, + 186512EA06253BE8005AB5DA, + 186512EB06253BE8005AB5DA, + 186512EC06253BE8005AB5DA, + 186512ED06253BE8005AB5DA, + 186512EE06253BE8005AB5DA, + 186512EF06253BE8005AB5DA, + 186512F006253BE8005AB5DA, + 186512F106253BE8005AB5DA, + 186512F206253BE8005AB5DA, + 186512F306253BE9005AB5DA, + 186512F406253BE9005AB5DA, + 186512F506253BE9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186512D806253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512D906253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DA06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DB06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DC06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DD06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DE06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512DF06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E006253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E106253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E206253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E306253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E406253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E506253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E606253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E706253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E806253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512E906253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512EA06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512EB06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qthreads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512EC06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512ED06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512EE06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflags.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512EF06253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F006253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F106253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F206253BE8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186512F606253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186512F706253BE9005AB5DA = { + children = ( + 186512F806253BE9005AB5DA, + 186512F906253BE9005AB5DA, + 186512FA06253BE9005AB5DA, + 186512FB06253BE9005AB5DA, + 186512FC06253BE9005AB5DA, + 186512FD06253BE9005AB5DA, + 186512FE06253BE9005AB5DA, + 186512FF06253BE9005AB5DA, + 1865130006253BE9005AB5DA, + 1865130106253BE9005AB5DA, + 1865130206253BE9005AB5DA, + 1865130306253BE9005AB5DA, + 1865130406253BE9005AB5DA, + 1865130506253BE9005AB5DA, + 1865130606253BE9005AB5DA, + 1865130706253BE9005AB5DA, + 1865130806253BE9005AB5DA, + 1865130906253BE9005AB5DA, + 1865130A06253BE9005AB5DA, + 1865130B06253BE9005AB5DA, + 1865130C06253BE9005AB5DA, + 1865130D06253BE9005AB5DA, + 1865130E06253BE9005AB5DA, + 1865130F06253BE9005AB5DA, + 1865131006253BE9005AB5DA, + 1865131106253BE9005AB5DA, + 1865131206253BE9005AB5DA, + 1865131306253BE9005AB5DA, + 1865131406253BE9005AB5DA, + 1865131506253BE9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186512F806253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512F906253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FA06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FB06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FC06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FD06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FE06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186512FF06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130006253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130106253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130206253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130606253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130706253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130806253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130906253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130A06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130B06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qthreads.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130C06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130D06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130E06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflags.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865130F06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131006253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131106253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131206253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865131606253BE9005AB5DA = { + children = ( + 1865131706253BE9005AB5DA, + 1865131806253BE9005AB5DA, + 1865131906253BE9005AB5DA, + 1865131A06253BE9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865131706253BE9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865131806253BE9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865131906253BE9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865131A06253BE9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865131B06253BE9005AB5DA = { + children = ( + 1865131C06253BE9005AB5DA, + 1865131D06253BE9005AB5DA, + 1865131E06253BE9005AB5DA, + 1865131F06253BE9005AB5DA, + 1865132006253BE9005AB5DA, + 1865132106253BE9005AB5DA, + 1865132206253BE9005AB5DA, + 1865132306253BE9005AB5DA, + 1865132406253BE9005AB5DA, + 1865132506253BE9005AB5DA, + 1865132606253BE9005AB5DA, + 1865132706253BE9005AB5DA, + 1865132806253BE9005AB5DA, + 1865132906253BE9005AB5DA, + 1865132A06253BE9005AB5DA, + 1865132B06253BE9005AB5DA, + 1865132C06253BE9005AB5DA, + 1865132D06253BE9005AB5DA, + 1865132E06253BE9005AB5DA, + 1865132F06253BE9005AB5DA, + 1865133006253BE9005AB5DA, + 1865133106253BE9005AB5DA, + 1865133206253BE9005AB5DA, + 1865133306253BE9005AB5DA, + 1865133406253BE9005AB5DA, + 1865133506253BE9005AB5DA, + 1865133606253BE9005AB5DA, + 1865133706253BE9005AB5DA, + 1865133806253BE9005AB5DA, + 1865133906253BE9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865131C06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865131D06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aselib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865131E06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865131F06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132006253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132106253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132206253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagelib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inout.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132606253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132706253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132806253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132906253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132A06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mutex.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132B06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132C06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polylib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132D06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132E06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qfiles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865132F06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qthreads.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133006253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133106253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "scriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133206253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflags.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "threads.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "trilib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133606253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133706253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133806253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133906253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865133A06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = aselib.c; + refType = 4; + sourceTree = ""; + }; + 1865133B06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = aselib.h; + refType = 4; + sourceTree = ""; + }; + 1865133C06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile.c; + refType = 4; + sourceTree = ""; + }; + 1865133D06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bspfile.h; + refType = 4; + sourceTree = ""; + }; + 1865133E06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = cmdlib.c; + refType = 4; + sourceTree = ""; + }; + 1865133F06253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cmdlib.h; + refType = 4; + sourceTree = ""; + }; + 1865134006253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = imagelib.c; + refType = 4; + sourceTree = ""; + }; + 1865134106253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imagelib.h; + refType = 4; + sourceTree = ""; + }; + 1865134206253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = inout.c; + refType = 4; + sourceTree = ""; + }; + 1865134306253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = inout.h; + refType = 4; + sourceTree = ""; + }; + 1865134406253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l3dslib.c; + refType = 4; + sourceTree = ""; + }; + 1865134506253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = l3dslib.h; + refType = 4; + sourceTree = ""; + }; + 1865134606253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = md4.c; + refType = 4; + sourceTree = ""; + }; + 1865134706253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = mutex.c; + refType = 4; + sourceTree = ""; + }; + 1865134806253BE9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = mutex.h; + refType = 4; + sourceTree = ""; + }; + 1865134906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = polylib.c; + refType = 4; + sourceTree = ""; + }; + 1865134A06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = polylib.h; + refType = 4; + sourceTree = ""; + }; + 1865134B06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = polyset.h; + refType = 4; + sourceTree = ""; + }; + 1865134C06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qfiles.h; + refType = 4; + sourceTree = ""; + }; + 1865134D06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qthreads.h; + refType = 4; + sourceTree = ""; + }; + 1865134E06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = scriplib.c; + refType = 4; + sourceTree = ""; + }; + 1865134F06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = scriplib.h; + refType = 4; + sourceTree = ""; + }; + 1865135006253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfaceflags.h; + refType = 4; + sourceTree = ""; + }; + 1865135106253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = threads.c; + refType = 4; + sourceTree = ""; + }; + 1865135206253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = trilib.c; + refType = 4; + sourceTree = ""; + }; + 1865135306253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = trilib.h; + refType = 4; + sourceTree = ""; + }; + 1865135406253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = unzip.c; + refType = 4; + sourceTree = ""; + }; + 1865135506253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = unzip.h; + refType = 4; + sourceTree = ""; + }; + 1865135606253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = vfs.c; + refType = 4; + sourceTree = ""; + }; + 1865135706253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = vfs.h; + refType = 4; + sourceTree = ""; + }; + 1865135806253BEA005AB5DA = { + children = ( + 1865135906253BEA005AB5DA, + 1865135A06253BEA005AB5DA, + 1865135B06253BEA005AB5DA, + 186513B206253BEB005AB5DA, + 186513B306253BEB005AB5DA, + 186513B406253BEB005AB5DA, + 186513B506253BEB005AB5DA, + 186513B606253BEB005AB5DA, + 186513B706253BEB005AB5DA, + 186513B806253BEB005AB5DA, + 186513B906253BEB005AB5DA, + 186513BA06253BEB005AB5DA, + 186513BB06253BEB005AB5DA, + 186513BC06253BEB005AB5DA, + 186513BD06253BEB005AB5DA, + 186513BE06253BEB005AB5DA, + 186513BF06253BEB005AB5DA, + 186513C006253BEB005AB5DA, + 186513C106253BEB005AB5DA, + ); + isa = PBXGroup; + path = q3data; + refType = 4; + sourceTree = ""; + }; + 1865135906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865135A06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865135B06253BEA005AB5DA = { + children = ( + 1865135C06253BEA005AB5DA, + 1865135D06253BEA005AB5DA, + 1865135E06253BEA005AB5DA, + 1865135F06253BEA005AB5DA, + 1865136006253BEA005AB5DA, + 1865137306253BEA005AB5DA, + 1865138606253BEA005AB5DA, + 1865138706253BEA005AB5DA, + 1865139A06253BEA005AB5DA, + 1865139F06253BEB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865135C06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865135D06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865135E06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865135F06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865136006253BEA005AB5DA = { + children = ( + 1865136106253BEA005AB5DA, + 1865136206253BEA005AB5DA, + 1865136306253BEA005AB5DA, + 1865136406253BEA005AB5DA, + 1865136506253BEA005AB5DA, + 1865136606253BEA005AB5DA, + 1865136706253BEA005AB5DA, + 1865136806253BEA005AB5DA, + 1865136906253BEA005AB5DA, + 1865136A06253BEA005AB5DA, + 1865136B06253BEA005AB5DA, + 1865136C06253BEA005AB5DA, + 1865136D06253BEA005AB5DA, + 1865136E06253BEA005AB5DA, + 1865136F06253BEA005AB5DA, + 1865137006253BEA005AB5DA, + 1865137106253BEA005AB5DA, + 1865137206253BEA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865136106253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136206253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136306253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136406253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136506253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "compress.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136606253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136706253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136806253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136A06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "oldstuff.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136B06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136C06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136D06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136E06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865136F06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865137006253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865137106253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stripper.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865137206253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865137306253BEA005AB5DA = { + children = ( + 1865137406253BEA005AB5DA, + 1865137506253BEA005AB5DA, + 1865137606253BEA005AB5DA, + 1865137706253BEA005AB5DA, + 1865137806253BEA005AB5DA, + 1865137906253BEA005AB5DA, + 1865137A06253BEA005AB5DA, + 1865137B06253BEA005AB5DA, + 1865137C06253BEA005AB5DA, + 1865137D06253BEA005AB5DA, + 1865137E06253BEA005AB5DA, + 1865137F06253BEA005AB5DA, + 1865138006253BEA005AB5DA, + 1865138106253BEA005AB5DA, + 1865138206253BEA005AB5DA, + 1865138306253BEA005AB5DA, + 1865138406253BEA005AB5DA, + 1865138506253BEA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865137406253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137506253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137606253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137706253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137806253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "compress.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137A06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137B06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137C06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137D06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "oldstuff.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137E06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865137F06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138006253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138106253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138206253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138306253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138406253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stripper.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138506253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865138606253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865138706253BEA005AB5DA = { + children = ( + 1865138806253BEA005AB5DA, + 1865138906253BEA005AB5DA, + 1865138A06253BEA005AB5DA, + 1865138B06253BEA005AB5DA, + 1865138C06253BEA005AB5DA, + 1865138D06253BEA005AB5DA, + 1865138E06253BEA005AB5DA, + 1865138F06253BEA005AB5DA, + 1865139006253BEA005AB5DA, + 1865139106253BEA005AB5DA, + 1865139206253BEA005AB5DA, + 1865139306253BEA005AB5DA, + 1865139406253BEA005AB5DA, + 1865139506253BEA005AB5DA, + 1865139606253BEA005AB5DA, + 1865139706253BEA005AB5DA, + 1865139806253BEA005AB5DA, + 1865139906253BEA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865138806253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138A06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138B06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138C06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "compress.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138D06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138E06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865138F06253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139006253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139106253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "oldstuff.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139206253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139306253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139406253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139506253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139606253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139706253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "q3data.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139806253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stripper.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139906253BEA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865139A06253BEA005AB5DA = { + children = ( + 1865139B06253BEA005AB5DA, + 1865139C06253BEA005AB5DA, + 1865139D06253BEA005AB5DA, + 1865139E06253BEA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865139B06253BEA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865139C06253BEA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865139D06253BEA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865139E06253BEA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865139F06253BEB005AB5DA = { + children = ( + 186513A006253BEB005AB5DA, + 186513A106253BEB005AB5DA, + 186513A206253BEB005AB5DA, + 186513A306253BEB005AB5DA, + 186513A406253BEB005AB5DA, + 186513A506253BEB005AB5DA, + 186513A606253BEB005AB5DA, + 186513A706253BEB005AB5DA, + 186513A806253BEB005AB5DA, + 186513A906253BEB005AB5DA, + 186513AA06253BEB005AB5DA, + 186513AB06253BEB005AB5DA, + 186513AC06253BEB005AB5DA, + 186513AD06253BEB005AB5DA, + 186513AE06253BEB005AB5DA, + 186513AF06253BEB005AB5DA, + 186513B006253BEB005AB5DA, + 186513B106253BEB005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186513A006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A206253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "3dslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "compress.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "images.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3lib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "models.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513A906253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "oldstuff.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AB06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "p3dlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AC06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "polyset.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AD06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AE06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513AF06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3data.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513B006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stripper.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513B106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "video.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186513B206253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = 3dslib.c; + refType = 4; + sourceTree = ""; + }; + 186513B306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = 3dslib.h; + refType = 4; + sourceTree = ""; + }; + 186513B406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = compress.c; + refType = 4; + sourceTree = ""; + }; + 186513B506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = images.c; + refType = 4; + sourceTree = ""; + }; + 186513B606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = md3lib.c; + refType = 4; + sourceTree = ""; + }; + 186513B706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = md3lib.h; + refType = 4; + sourceTree = ""; + }; + 186513B806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = models.c; + refType = 4; + sourceTree = ""; + }; + 186513B906253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = oldstuff.c; + refType = 4; + sourceTree = ""; + }; + 186513BA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = p3dlib.c; + refType = 4; + sourceTree = ""; + }; + 186513BB06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = p3dlib.h; + refType = 4; + sourceTree = ""; + }; + 186513BC06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = polyset.c; + refType = 4; + sourceTree = ""; + }; + 186513BD06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = q3data.c; + refType = 4; + sourceTree = ""; + }; + 186513BE06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q3data.h; + refType = 4; + sourceTree = ""; + }; + 186513BF06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = q3data.vcproj; + refType = 4; + sourceTree = ""; + }; + 186513C006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = stripper.c; + refType = 4; + sourceTree = ""; + }; + 186513C106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = video.c; + refType = 4; + sourceTree = ""; + }; + 186513C206253BEB005AB5DA = { + children = ( + 186513C306253BEB005AB5DA, + 186513D206253BEB005AB5DA, + ); + isa = PBXGroup; + path = q3map; + refType = 4; + sourceTree = ""; + }; + 186513C306253BEB005AB5DA = { + children = ( + 186513C406253BEB005AB5DA, + 186513C506253BEB005AB5DA, + 186513C606253BEB005AB5DA, + 186513C706253BEB005AB5DA, + 186513C806253BEB005AB5DA, + 186513C906253BEB005AB5DA, + 186513CA06253BEB005AB5DA, + 186513CB06253BEB005AB5DA, + 186513CC06253BEB005AB5DA, + 186513D106253BEB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186513C406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186513C506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186513C606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186513C706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186513C806253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186513C906253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186513CA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186513CB06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186513CC06253BEB005AB5DA = { + children = ( + 186513CD06253BEB005AB5DA, + 186513CE06253BEB005AB5DA, + 186513CF06253BEB005AB5DA, + 186513D006253BEB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186513CD06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186513CE06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186513CF06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186513D006253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186513D106253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186513D206253BEB005AB5DA = { + children = ( + 186513D306253BEB005AB5DA, + ); + isa = PBXGroup; + path = NetTest; + refType = 4; + sourceTree = ""; + }; + 186513D306253BEB005AB5DA = { + children = ( + 186513D406253BEB005AB5DA, + 186513D506253BEB005AB5DA, + 186513D606253BEB005AB5DA, + 186513D706253BEB005AB5DA, + 186513D806253BEB005AB5DA, + 186513D906253BEB005AB5DA, + 186513DA06253BEB005AB5DA, + 186513DB06253BEB005AB5DA, + 186513DC06253BEB005AB5DA, + 186513E106253BEB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186513D406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186513D506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186513D606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186513D706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186513D806253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186513D906253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186513DA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 186513DB06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186513DC06253BEB005AB5DA = { + children = ( + 186513DD06253BEB005AB5DA, + 186513DE06253BEB005AB5DA, + 186513DF06253BEB005AB5DA, + 186513E006253BEB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 186513DD06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186513DE06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 186513DF06253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 186513E006253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186513E106253BEB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 186513E206253BEB005AB5DA = { + children = ( + 186513E306253BEB005AB5DA, + 186513E406253BEB005AB5DA, + 186514D306253BEE005AB5DA, + 186514D406253BEE005AB5DA, + 186514D506253BEE005AB5DA, + 186514D606253BEE005AB5DA, + 186514D706253BEE005AB5DA, + 186514D806253BEE005AB5DA, + 186514D906253BEE005AB5DA, + 186514DA06253BEE005AB5DA, + 186514DB06253BEE005AB5DA, + 186514DC06253BEE005AB5DA, + 186514DD06253BEE005AB5DA, + 186514DE06253BEE005AB5DA, + 186514DF06253BEE005AB5DA, + 186514E006253BEE005AB5DA, + 186514E106253BEE005AB5DA, + 186514E206253BEE005AB5DA, + 186514E306253BEE005AB5DA, + 186514E406253BEE005AB5DA, + 186514E506253BEE005AB5DA, + 186514E606253BEE005AB5DA, + 186514E706253BEE005AB5DA, + 186514E806253BEE005AB5DA, + 186514E906253BEE005AB5DA, + 186514EA06253BEE005AB5DA, + 186514EB06253BEE005AB5DA, + 186514EC06253BEE005AB5DA, + 186514ED06253BEE005AB5DA, + 186514EE06253BEE005AB5DA, + 186514EF06253BEE005AB5DA, + 186514F006253BEE005AB5DA, + 186514F106253BEE005AB5DA, + 186514F206253BEE005AB5DA, + 186514F306253BEE005AB5DA, + 186514F406253BEE005AB5DA, + 186514F506253BEE005AB5DA, + 186514F606253BEE005AB5DA, + 186514F706253BEE005AB5DA, + 186514F806253BEE005AB5DA, + 186514F906253BEE005AB5DA, + 186514FA06253BEE005AB5DA, + 186514FB06253BEE005AB5DA, + 186514FC06253BEE005AB5DA, + 186514FD06253BEE005AB5DA, + 186514FE06253BEE005AB5DA, + 186514FF06253BEE005AB5DA, + 1865150006253BEE005AB5DA, + 1865150106253BEE005AB5DA, + 1865150206253BEE005AB5DA, + 1865150306253BEE005AB5DA, + 1865150406253BEE005AB5DA, + 1865150506253BEE005AB5DA, + 1865150606253BEE005AB5DA, + 1865150706253BEE005AB5DA, + 1865150806253BEE005AB5DA, + 1865150906253BEE005AB5DA, + ); + isa = PBXGroup; + path = q3map2; + refType = 4; + sourceTree = ""; + }; + 186513E306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 186513E406253BEB005AB5DA = { + children = ( + 186513E506253BEB005AB5DA, + 186513E606253BEB005AB5DA, + 186513E706253BEB005AB5DA, + 186513E806253BEB005AB5DA, + 186513E906253BEB005AB5DA, + 1865142206253BEC005AB5DA, + 1865145B06253BEC005AB5DA, + 1865145C06253BEC005AB5DA, + 1865149506253BED005AB5DA, + 1865149A06253BED005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 186513E506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 186513E606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 186513E706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 186513E806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 186513E906253BEB005AB5DA = { + children = ( + 186513EA06253BEB005AB5DA, + 186513EB06253BEB005AB5DA, + 186513EC06253BEB005AB5DA, + 186513ED06253BEB005AB5DA, + 186513EE06253BEB005AB5DA, + 186513EF06253BEB005AB5DA, + 186513F006253BEB005AB5DA, + 186513F106253BEB005AB5DA, + 186513F206253BEB005AB5DA, + 186513F306253BEB005AB5DA, + 186513F406253BEB005AB5DA, + 186513F506253BEB005AB5DA, + 186513F606253BEB005AB5DA, + 186513F706253BEB005AB5DA, + 186513F806253BEB005AB5DA, + 186513F906253BEB005AB5DA, + 186513FA06253BEB005AB5DA, + 186513FB06253BEB005AB5DA, + 186513FC06253BEB005AB5DA, + 186513FD06253BEB005AB5DA, + 186513FE06253BEB005AB5DA, + 186513FF06253BEB005AB5DA, + 1865140006253BEB005AB5DA, + 1865140106253BEB005AB5DA, + 1865140206253BEB005AB5DA, + 1865140306253BEB005AB5DA, + 1865140406253BEB005AB5DA, + 1865140506253BEB005AB5DA, + 1865140606253BEB005AB5DA, + 1865140706253BEB005AB5DA, + 1865140806253BEB005AB5DA, + 1865140906253BEB005AB5DA, + 1865140A06253BEB005AB5DA, + 1865140B06253BEB005AB5DA, + 1865140C06253BEB005AB5DA, + 1865140D06253BEB005AB5DA, + 1865140E06253BEB005AB5DA, + 1865140F06253BEB005AB5DA, + 1865141006253BEB005AB5DA, + 1865141106253BEB005AB5DA, + 1865141206253BEB005AB5DA, + 1865141306253BEB005AB5DA, + 1865141406253BEB005AB5DA, + 1865141506253BEB005AB5DA, + 1865141606253BEB005AB5DA, + 1865141706253BEB005AB5DA, + 1865141806253BEB005AB5DA, + 1865141906253BEB005AB5DA, + 1865141A06253BEB005AB5DA, + 1865141B06253BEB005AB5DA, + 1865141C06253BEB005AB5DA, + 1865141D06253BEB005AB5DA, + 1865141E06253BEB005AB5DA, + 1865141F06253BEB005AB5DA, + 1865142006253BEC005AB5DA, + 1865142106253BEC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 186513EA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513EB06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513EC06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513ED06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513EE06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_abstract.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513EF06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_ibsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_rbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map1.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F206253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map2.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_ase.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "decals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "facebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fog.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ef.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513F906253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ja.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FA06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_jk2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FB06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_quake3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FC06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_sof2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FD06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_t.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FE06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_tenebrae.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 186513FF06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolfet.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140206253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_bounce.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_shadows.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_trace.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_ydnar.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140906253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps_ydnar.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140A06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listen.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140B06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140C06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140D06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mesh.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140E06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865140F06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141006253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141106253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141206253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141306253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141406253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141506253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141606253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141706253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141806253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141906253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_extra.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141A06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_foliage.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141B06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_fur.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141C06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_meta.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141D06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tjunction.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141E06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865141F06253BEB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vis.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865142006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visflow.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865142106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865142206253BEC005AB5DA = { + children = ( + 1865142306253BEC005AB5DA, + 1865142406253BEC005AB5DA, + 1865142506253BEC005AB5DA, + 1865142606253BEC005AB5DA, + 1865142706253BEC005AB5DA, + 1865142806253BEC005AB5DA, + 1865142906253BEC005AB5DA, + 1865142A06253BEC005AB5DA, + 1865142B06253BEC005AB5DA, + 1865142C06253BEC005AB5DA, + 1865142D06253BEC005AB5DA, + 1865142E06253BEC005AB5DA, + 1865142F06253BEC005AB5DA, + 1865143006253BEC005AB5DA, + 1865143106253BEC005AB5DA, + 1865143206253BEC005AB5DA, + 1865143306253BEC005AB5DA, + 1865143406253BEC005AB5DA, + 1865143506253BEC005AB5DA, + 1865143606253BEC005AB5DA, + 1865143706253BEC005AB5DA, + 1865143806253BEC005AB5DA, + 1865143906253BEC005AB5DA, + 1865143A06253BEC005AB5DA, + 1865143B06253BEC005AB5DA, + 1865143C06253BEC005AB5DA, + 1865143D06253BEC005AB5DA, + 1865143E06253BEC005AB5DA, + 1865143F06253BEC005AB5DA, + 1865144006253BEC005AB5DA, + 1865144106253BEC005AB5DA, + 1865144206253BEC005AB5DA, + 1865144306253BEC005AB5DA, + 1865144406253BEC005AB5DA, + 1865144506253BEC005AB5DA, + 1865144606253BEC005AB5DA, + 1865144706253BEC005AB5DA, + 1865144806253BEC005AB5DA, + 1865144906253BEC005AB5DA, + 1865144A06253BEC005AB5DA, + 1865144B06253BEC005AB5DA, + 1865144C06253BEC005AB5DA, + 1865144D06253BEC005AB5DA, + 1865144E06253BEC005AB5DA, + 1865144F06253BEC005AB5DA, + 1865145006253BEC005AB5DA, + 1865145106253BEC005AB5DA, + 1865145206253BEC005AB5DA, + 1865145306253BEC005AB5DA, + 1865145406253BEC005AB5DA, + 1865145506253BEC005AB5DA, + 1865145606253BEC005AB5DA, + 1865145706253BEC005AB5DA, + 1865145806253BEC005AB5DA, + 1865145906253BEC005AB5DA, + 1865145A06253BEC005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865142306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_abstract.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_ibsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_rbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map1.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map2.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142C06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_ase.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "decals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865142F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "facebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fog.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ef.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ja.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_jk2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_quake3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_sof2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_t.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_tenebrae.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolfet.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143C06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_bounce.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_shadows.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865143F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_trace.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_ydnar.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps_ydnar.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listen.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mesh.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144C06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865144F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_extra.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_foliage.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_fur.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_meta.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tjunction.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vis.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visflow.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865145B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865145C06253BEC005AB5DA = { + children = ( + 1865145D06253BEC005AB5DA, + 1865145E06253BEC005AB5DA, + 1865145F06253BEC005AB5DA, + 1865146006253BEC005AB5DA, + 1865146106253BEC005AB5DA, + 1865146206253BEC005AB5DA, + 1865146306253BEC005AB5DA, + 1865146406253BEC005AB5DA, + 1865146506253BEC005AB5DA, + 1865146606253BEC005AB5DA, + 1865146706253BEC005AB5DA, + 1865146806253BEC005AB5DA, + 1865146906253BEC005AB5DA, + 1865146A06253BEC005AB5DA, + 1865146B06253BEC005AB5DA, + 1865146C06253BEC005AB5DA, + 1865146D06253BEC005AB5DA, + 1865146E06253BEC005AB5DA, + 1865146F06253BEC005AB5DA, + 1865147006253BEC005AB5DA, + 1865147106253BEC005AB5DA, + 1865147206253BEC005AB5DA, + 1865147306253BEC005AB5DA, + 1865147406253BEC005AB5DA, + 1865147506253BEC005AB5DA, + 1865147606253BEC005AB5DA, + 1865147706253BEC005AB5DA, + 1865147806253BEC005AB5DA, + 1865147906253BEC005AB5DA, + 1865147A06253BEC005AB5DA, + 1865147B06253BEC005AB5DA, + 1865147C06253BEC005AB5DA, + 1865147D06253BEC005AB5DA, + 1865147E06253BEC005AB5DA, + 1865147F06253BEC005AB5DA, + 1865148006253BEC005AB5DA, + 1865148106253BEC005AB5DA, + 1865148206253BEC005AB5DA, + 1865148306253BEC005AB5DA, + 1865148406253BED005AB5DA, + 1865148506253BED005AB5DA, + 1865148606253BED005AB5DA, + 1865148706253BED005AB5DA, + 1865148806253BED005AB5DA, + 1865148906253BED005AB5DA, + 1865148A06253BED005AB5DA, + 1865148B06253BED005AB5DA, + 1865148C06253BED005AB5DA, + 1865148D06253BED005AB5DA, + 1865148E06253BED005AB5DA, + 1865148F06253BED005AB5DA, + 1865149006253BED005AB5DA, + 1865149106253BED005AB5DA, + 1865149206253BED005AB5DA, + 1865149306253BED005AB5DA, + 1865149406253BED005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865145D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865145E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865145F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_abstract.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_ibsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_rbsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map1.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map2.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_ase.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "decals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "facebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fog.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ef.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146C06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ja.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_jk2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_quake3.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865146F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_sof2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_t.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_tenebrae.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolfet.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147406253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147506253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147606253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147706253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_bounce.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147806253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_shadows.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147906253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_trace.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147A06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_ydnar.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147B06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147C06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps_ydnar.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147D06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = "listen.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147E06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865147F06253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148006253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mesh.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148106253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148206253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148306253BEC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148406253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148506253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148606253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148706253BED005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "q3map2.ico.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148806253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148906253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "q3map2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148A06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148B06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148C06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_extra.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148D06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_foliage.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148E06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_fur.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865148F06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_meta.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149006253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tjunction.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149106253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149206253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vis.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149306253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visflow.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149406253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865149506253BED005AB5DA = { + children = ( + 1865149606253BED005AB5DA, + 1865149706253BED005AB5DA, + 1865149806253BED005AB5DA, + 1865149906253BED005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865149606253BED005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865149706253BED005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865149806253BED005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865149906253BED005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865149A06253BED005AB5DA = { + children = ( + 1865149B06253BED005AB5DA, + 1865149C06253BED005AB5DA, + 1865149D06253BED005AB5DA, + 1865149E06253BED005AB5DA, + 1865149F06253BED005AB5DA, + 186514A006253BED005AB5DA, + 186514A106253BED005AB5DA, + 186514A206253BED005AB5DA, + 186514A306253BED005AB5DA, + 186514A406253BED005AB5DA, + 186514A506253BED005AB5DA, + 186514A606253BED005AB5DA, + 186514A706253BED005AB5DA, + 186514A806253BED005AB5DA, + 186514A906253BED005AB5DA, + 186514AA06253BED005AB5DA, + 186514AB06253BED005AB5DA, + 186514AC06253BED005AB5DA, + 186514AD06253BED005AB5DA, + 186514AE06253BED005AB5DA, + 186514AF06253BED005AB5DA, + 186514B006253BED005AB5DA, + 186514B106253BED005AB5DA, + 186514B206253BED005AB5DA, + 186514B306253BED005AB5DA, + 186514B406253BED005AB5DA, + 186514B506253BED005AB5DA, + 186514B606253BED005AB5DA, + 186514B706253BED005AB5DA, + 186514B806253BED005AB5DA, + 186514B906253BED005AB5DA, + 186514BA06253BED005AB5DA, + 186514BB06253BED005AB5DA, + 186514BC06253BED005AB5DA, + 186514BD06253BED005AB5DA, + 186514BE06253BED005AB5DA, + 186514BF06253BED005AB5DA, + 186514C006253BED005AB5DA, + 186514C106253BED005AB5DA, + 186514C206253BED005AB5DA, + 186514C306253BED005AB5DA, + 186514C406253BED005AB5DA, + 186514C506253BED005AB5DA, + 186514C606253BED005AB5DA, + 186514C706253BED005AB5DA, + 186514C806253BED005AB5DA, + 186514C906253BEE005AB5DA, + 186514CA06253BEE005AB5DA, + 186514CB06253BEE005AB5DA, + 186514CC06253BEE005AB5DA, + 186514CD06253BEE005AB5DA, + 186514CE06253BEE005AB5DA, + 186514CF06253BEE005AB5DA, + 186514D006253BEE005AB5DA, + 186514D106253BEE005AB5DA, + 186514D206253BEE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865149B06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865149C06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865149D06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brush_primit.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865149E06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865149F06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_abstract.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A006253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_ibsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A106253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspfile_rbsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A206253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map1.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A306253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.q3map2.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A406253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_ase.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A506253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "convert_map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A606253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "decals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A706253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "facebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A806253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fog.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514A906253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ef.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AA06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_ja.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AB06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_jk2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AC06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_quake3.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AD06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_sof2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AE06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_t.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514AF06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_tenebrae.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B006253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B106253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "game_wolfet.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B206253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B306253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "leakfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B406253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B506253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_bounce.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B606253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_shadows.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B706253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_trace.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B806253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light_ydnar.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514B906253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BA06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lightmaps_ydnar.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BB06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listen.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BC06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "main.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BD06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BE06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mesh.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514BF06253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C006253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "patch.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C106253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "path_init.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C206253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C306253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtfile.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C406253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C506253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.ico.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C606253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C706253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C806253BED005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514C906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CA06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_extra.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CB06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_foliage.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CC06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_fur.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CD06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_meta.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CE06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tjunction.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514CF06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tree.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514D006253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vis.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514D106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visflow.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514D206253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "writebsp.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 186514D306253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = brush.c; + refType = 4; + sourceTree = ""; + }; + 186514D406253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = brush_primit.c; + refType = 4; + sourceTree = ""; + }; + 186514D506253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bsp.c; + refType = 4; + sourceTree = ""; + }; + 186514D606253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile_abstract.c; + refType = 4; + sourceTree = ""; + }; + 186514D706253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile_ibsp.c; + refType = 4; + sourceTree = ""; + }; + 186514D806253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bspfile_rbsp.c; + refType = 4; + sourceTree = ""; + }; + 186514D906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changelog.q3map1; + refType = 4; + sourceTree = ""; + }; + 186514DA06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changelog.q3map2.txt; + refType = 4; + sourceTree = ""; + }; + 186514DB06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = convert_ase.c; + refType = 4; + sourceTree = ""; + }; + 186514DC06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = convert_map.c; + refType = 4; + sourceTree = ""; + }; + 186514DD06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = decals.c; + refType = 4; + sourceTree = ""; + }; + 186514DE06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = facebsp.c; + refType = 4; + sourceTree = ""; + }; + 186514DF06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = fog.c; + refType = 4; + sourceTree = ""; + }; + 186514E006253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_ef.h; + refType = 4; + sourceTree = ""; + }; + 186514E106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_ja.h; + refType = 4; + sourceTree = ""; + }; + 186514E206253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_jk2.h; + refType = 4; + sourceTree = ""; + }; + 186514E306253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_quake3.h; + refType = 4; + sourceTree = ""; + }; + 186514E406253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_sof2.h; + refType = 4; + sourceTree = ""; + }; + 186514E506253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_t.h; + refType = 4; + sourceTree = ""; + }; + 186514E606253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_tenebrae.h; + refType = 4; + sourceTree = ""; + }; + 186514E706253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_wolf.h; + refType = 4; + sourceTree = ""; + }; + 186514E806253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = game_wolfet.h; + refType = 4; + sourceTree = ""; + }; + 186514E906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = image.c; + refType = 4; + sourceTree = ""; + }; + 186514EA06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = leakfile.c; + refType = 4; + sourceTree = ""; + }; + 186514EB06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = light.c; + refType = 4; + sourceTree = ""; + }; + 186514EC06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = light_bounce.c; + refType = 4; + sourceTree = ""; + }; + 186514ED06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = light_shadows.c; + refType = 4; + sourceTree = ""; + }; + 186514EE06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = light_trace.c; + refType = 4; + sourceTree = ""; + }; + 186514EF06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = light_ydnar.c; + refType = 4; + sourceTree = ""; + }; + 186514F006253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lightmaps.c; + refType = 4; + sourceTree = ""; + }; + 186514F106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lightmaps_ydnar.c; + refType = 4; + sourceTree = ""; + }; + 186514F206253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = listen.pl; + refType = 4; + sourceTree = ""; + }; + 186514F306253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = main.c; + refType = 4; + sourceTree = ""; + }; + 186514F406253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = map.c; + refType = 4; + sourceTree = ""; + }; + 186514F506253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = mesh.c; + refType = 4; + sourceTree = ""; + }; + 186514F606253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = model.c; + refType = 4; + sourceTree = ""; + }; + 186514F706253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = patch.c; + refType = 4; + sourceTree = ""; + }; + 186514F806253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = path_init.c; + refType = 4; + sourceTree = ""; + }; + 186514F906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = portals.c; + refType = 4; + sourceTree = ""; + }; + 186514FA06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = prtfile.c; + refType = 4; + sourceTree = ""; + }; + 186514FB06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q3map2.h; + refType = 4; + sourceTree = ""; + }; + 186514FC06253BEE005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.ico; + path = q3map2.ico; + refType = 4; + sourceTree = ""; + }; + 186514FD06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3map2.rc; + refType = 4; + sourceTree = ""; + }; + 186514FE06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = q3map2.vcproj; + refType = 4; + sourceTree = ""; + }; + 186514FF06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = shaders.c; + refType = 4; + sourceTree = ""; + }; + 1865150006253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface.c; + refType = 4; + sourceTree = ""; + }; + 1865150106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface_extra.c; + refType = 4; + sourceTree = ""; + }; + 1865150206253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface_foliage.c; + refType = 4; + sourceTree = ""; + }; + 1865150306253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface_fur.c; + refType = 4; + sourceTree = ""; + }; + 1865150406253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface_meta.c; + refType = 4; + sourceTree = ""; + }; + 1865150506253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tjunction.c; + refType = 4; + sourceTree = ""; + }; + 1865150606253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = tree.c; + refType = 4; + sourceTree = ""; + }; + 1865150706253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = vis.c; + refType = 4; + sourceTree = ""; + }; + 1865150806253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = visflow.c; + refType = 4; + sourceTree = ""; + }; + 1865150906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = writebsp.c; + refType = 4; + sourceTree = ""; + }; + 1865150A06253BEE005AB5DA = { + children = ( + 1865150B06253BEE005AB5DA, + ); + isa = PBXGroup; + path = vslick; + refType = 4; + sourceTree = ""; + }; + 1865150B06253BEE005AB5DA = { + children = ( + 1865150C06253BEE005AB5DA, + 1865150D06253BEE005AB5DA, + 1865150E06253BEE005AB5DA, + 1865150F06253BEE005AB5DA, + 1865151006253BEE005AB5DA, + 1865152006253BEE005AB5DA, + 1865153006253BEF005AB5DA, + 1865153106253BEF005AB5DA, + 1865154106253BEF005AB5DA, + 1865154606253BEF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865150C06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865150D06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865150E06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865150F06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865151006253BEE005AB5DA = { + children = ( + 1865151106253BEE005AB5DA, + 1865151206253BEE005AB5DA, + 1865151306253BEE005AB5DA, + 1865151406253BEE005AB5DA, + 1865151506253BEE005AB5DA, + 1865151606253BEE005AB5DA, + 1865151706253BEE005AB5DA, + 1865151806253BEE005AB5DA, + 1865151906253BEE005AB5DA, + 1865151A06253BEE005AB5DA, + 1865151B06253BEE005AB5DA, + 1865151C06253BEE005AB5DA, + 1865151D06253BEE005AB5DA, + 1865151E06253BEE005AB5DA, + 1865151F06253BEE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865151106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151206253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151306253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151406253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151506253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151606253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151706253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151806253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3model.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151906253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pak.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151A06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pk3man.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151B06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151C06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151D06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151E06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textool.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865151F06253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865152006253BEE005AB5DA = { + children = ( + 1865152106253BEE005AB5DA, + 1865152206253BEF005AB5DA, + 1865152306253BEF005AB5DA, + 1865152406253BEF005AB5DA, + 1865152506253BEF005AB5DA, + 1865152606253BEF005AB5DA, + 1865152706253BEF005AB5DA, + 1865152806253BEF005AB5DA, + 1865152906253BEF005AB5DA, + 1865152A06253BEF005AB5DA, + 1865152B06253BEF005AB5DA, + 1865152C06253BEF005AB5DA, + 1865152D06253BEF005AB5DA, + 1865152E06253BEF005AB5DA, + 1865152F06253BEF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865152106253BEE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152206253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152306253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152406253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152506253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152606253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152706253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152806253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3model.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152906253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pak.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152A06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pk3man.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152B06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152C06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152D06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152E06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textool.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865152F06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865153006253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865153106253BEF005AB5DA = { + children = ( + 1865153206253BEF005AB5DA, + 1865153306253BEF005AB5DA, + 1865153406253BEF005AB5DA, + 1865153506253BEF005AB5DA, + 1865153606253BEF005AB5DA, + 1865153706253BEF005AB5DA, + 1865153806253BEF005AB5DA, + 1865153906253BEF005AB5DA, + 1865153A06253BEF005AB5DA, + 1865153B06253BEF005AB5DA, + 1865153C06253BEF005AB5DA, + 1865153D06253BEF005AB5DA, + 1865153E06253BEF005AB5DA, + 1865153F06253BEF005AB5DA, + 1865154006253BEF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865153206253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153306253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153406253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153506253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153606253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153706253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153806253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153906253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3model.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153A06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pak.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153B06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pk3man.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153C06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153D06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153E06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865153F06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textool.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865154006253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vpj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865154106253BEF005AB5DA = { + children = ( + 1865154206253BEF005AB5DA, + 1865154306253BEF005AB5DA, + 1865154406253BEF005AB5DA, + 1865154506253BEF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865154206253BEF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865154306253BEF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865154406253BEF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865154506253BEF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865154606253BEF005AB5DA = { + children = ( + 1865154706253BEF005AB5DA, + 1865154806253BEF005AB5DA, + 1865154906253BEF005AB5DA, + 1865154A06253BEF005AB5DA, + 1865154B06253BEF005AB5DA, + 1865154C06253BEF005AB5DA, + 1865154D06253BEF005AB5DA, + 1865154E06253BEF005AB5DA, + 1865154F06253BEF005AB5DA, + 1865155006253BEF005AB5DA, + 1865155106253BEF005AB5DA, + 1865155206253BEF005AB5DA, + 1865155306253BEF005AB5DA, + 1865155406253BEF005AB5DA, + 1865155506253BEF005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865154706253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154806253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154906253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154A06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154B06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154C06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154D06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154E06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md3model.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865154F06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pak.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155006253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pk3man.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155106253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155206253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Radiant.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155306253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155406253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "textool.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155506253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vfspk3.vpj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865155606253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.python; + path = win32_install.py; + refType = 4; + sourceTree = ""; + }; + 1865155706253BEF005AB5DA = { + children = ( + 1865155806253BEF005AB5DA, + 1865158306253BF0005AB5DA, + 1865158406253BF0005AB5DA, + 1865158506253BF0005AB5DA, + 1865158606253BF0005AB5DA, + 1865158706253BF0005AB5DA, + 1865158806253BF0005AB5DA, + 1865158906253BF0005AB5DA, + ); + isa = PBXGroup; + path = www; + refType = 4; + sourceTree = ""; + }; + 1865155806253BEF005AB5DA = { + children = ( + 1865155906253BEF005AB5DA, + 1865155A06253BEF005AB5DA, + 1865155B06253BEF005AB5DA, + 1865155C06253BEF005AB5DA, + 1865155D06253BEF005AB5DA, + 1865156506253BEF005AB5DA, + 1865156D06253BEF005AB5DA, + 1865156E06253BEF005AB5DA, + 1865157606253BF0005AB5DA, + 1865157B06253BF0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865155906253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865155A06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865155B06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865155C06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865155D06253BEF005AB5DA = { + children = ( + 1865155E06253BEF005AB5DA, + 1865155F06253BEF005AB5DA, + 1865156006253BEF005AB5DA, + 1865156106253BEF005AB5DA, + 1865156206253BEF005AB5DA, + 1865156306253BEF005AB5DA, + 1865156406253BEF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865155E06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bug.shtml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865155F06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "coding.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156006253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156106253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkradiant.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156206253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hosted.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156306253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156406253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reviews.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865156506253BEF005AB5DA = { + children = ( + 1865156606253BEF005AB5DA, + 1865156706253BEF005AB5DA, + 1865156806253BEF005AB5DA, + 1865156906253BEF005AB5DA, + 1865156A06253BEF005AB5DA, + 1865156B06253BEF005AB5DA, + 1865156C06253BEF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865156606253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bug.shtml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156706253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "coding.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156806253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156906253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkradiant.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156A06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hosted.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156B06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156C06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reviews.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865156D06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865156E06253BEF005AB5DA = { + children = ( + 1865156F06253BEF005AB5DA, + 1865157006253BF0005AB5DA, + 1865157106253BF0005AB5DA, + 1865157206253BF0005AB5DA, + 1865157306253BF0005AB5DA, + 1865157406253BF0005AB5DA, + 1865157506253BF0005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865156F06253BEF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bug.shtml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157006253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "coding.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157106253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157206253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkradiant.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157306253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hosted.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157406253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157506253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reviews.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865157606253BF0005AB5DA = { + children = ( + 1865157706253BF0005AB5DA, + 1865157806253BF0005AB5DA, + 1865157906253BF0005AB5DA, + 1865157A06253BF0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865157706253BF0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865157806253BF0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865157906253BF0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865157A06253BF0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865157B06253BF0005AB5DA = { + children = ( + 1865157C06253BF0005AB5DA, + 1865157D06253BF0005AB5DA, + 1865157E06253BF0005AB5DA, + 1865157F06253BF0005AB5DA, + 1865158006253BF0005AB5DA, + 1865158106253BF0005AB5DA, + 1865158206253BF0005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865157C06253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bug.shtml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865157D06253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "coding.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865157E06253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865157F06253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkradiant.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865158006253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hosted.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865158106253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865158206253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reviews.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865158306253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html.other; + path = bug.shtml; + refType = 4; + sourceTree = ""; + }; + 1865158406253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = coding.html; + refType = 4; + sourceTree = ""; + }; + 1865158506253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = files.html; + refType = 4; + sourceTree = ""; + }; + 1865158606253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = gtkradiant.html; + refType = 4; + sourceTree = ""; + }; + 1865158706253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = hosted.html; + refType = 4; + sourceTree = ""; + }; + 1865158806253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.html; + refType = 4; + sourceTree = ""; + }; + 1865158906253BF0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = reviews.html; + refType = 4; + sourceTree = ""; + }; + 1865158C06253D50005AB5DA = { + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + isa = PBXShellScriptBuildPhase; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "source /sw/bin/init.sh\nscons"; + }; + 1865158D06253D50005AB5DA = { + buildPhases = ( + 1865158C06253D50005AB5DA, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = radiant; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + }; + dependencies = ( + ); + isa = PBXAggregateTarget; + name = radiant; + productName = radiant; + }; + 186515AB06255F40005AB5DA = { + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + isa = PBXShellScriptBuildPhase; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "source /sw/bin/init.sh\nscons BUILD=info"; + }; + 186515AC06255F40005AB5DA = { + buildPhases = ( + 186515AB06255F40005AB5DA, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = setup; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + }; + dependencies = ( + ); + isa = PBXAggregateTarget; + name = setup; + productName = setup; + }; + 1865EBC806253B29005AB5DA = { + children = ( + 1865EBD506253B76005AB5DA, + ); + isa = PBXGroup; + refType = 4; + sourceTree = ""; + }; + 1865EBCA06253B29005AB5DA = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = NO; + }; + isa = PBXBuildStyle; + name = Development; + }; + 1865EBCB06253B29005AB5DA = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = YES; + }; + isa = PBXBuildStyle; + name = Deployment; + }; + 1865EBCC06253B29005AB5DA = { + buildSettings = { + }; + buildStyles = ( + 1865EBCA06253B29005AB5DA, + 1865EBCB06253B29005AB5DA, + ); + hasScannedForEncodings = 1; + isa = PBXProject; + mainGroup = 1865EBC806253B29005AB5DA; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 1865047D06253BC4005AB5DA; + ProjectRef = 1865047C06253BC4005AB5DA; + }, + ); + targets = ( + 1865158D06253D50005AB5DA, + 186515AC06255F40005AB5DA, + ); + }; + 1865EBD506253B76005AB5DA = { + children = ( + 1865EBD606253B76005AB5DA, + 1865EBD706253B76005AB5DA, + 1865EC5206253B77005AB5DA, + 1865EC5306253B77005AB5DA, + 1865EC7006253B77005AB5DA, + 1865EC7106253B77005AB5DA, + 1865EC7206253B77005AB5DA, + 1865F11706253B80005AB5DA, + 1865F11806253B80005AB5DA, + 1865F11906253B80005AB5DA, + 1865F11A06253B80005AB5DA, + 1865F73306253B98005AB5DA, + 1865F73406253B98005AB5DA, + 1865F73506253B98005AB5DA, + 1865F75506253B99005AB5DA, + 1865F85206253B9D005AB5DA, + 1865F85306253B9D005AB5DA, + 1865F85406253B9D005AB5DA, + 1865F85506253B9D005AB5DA, + 1865F85606253B9E005AB5DA, + 1865F85706253B9E005AB5DA, + 1865F91B06253BA2005AB5DA, + 1865F91C06253BA2005AB5DA, + 1865F91D06253BA2005AB5DA, + 1865FCB306253BAF005AB5DA, + 1865FCB406253BAF005AB5DA, + 1865FCB506253BAF005AB5DA, + 1865FCB606253BAF005AB5DA, + 1865FCB706253BAF005AB5DA, + 1865FCB806253BAF005AB5DA, + 1865FCB906253BAF005AB5DA, + 1865014F06253BBA005AB5DA, + 1865047B06253BC4005AB5DA, + 1865047C06253BC4005AB5DA, + 1865047E06253BC4005AB5DA, + 1865047F06253BC4005AB5DA, + 1865048006253BC4005AB5DA, + 1865048106253BC4005AB5DA, + 1865048206253BC4005AB5DA, + 1865048306253BC4005AB5DA, + 1865048406253BC4005AB5DA, + 18650F9B06253BDE005AB5DA, + 18650F9C06253BDE005AB5DA, + 1865150A06253BEE005AB5DA, + 1865155606253BEF005AB5DA, + 1865155706253BEF005AB5DA, + ); + isa = PBXGroup; + name = GtkRadiant; + path = ""; + refType = 4; + sourceTree = ""; + }; + 1865EBD606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865EBD706253B76005AB5DA = { + children = ( + 1865EBD806253B76005AB5DA, + 1865EBD906253B76005AB5DA, + 1865EBDA06253B76005AB5DA, + 1865EBDB06253B76005AB5DA, + 1865EBDC06253B76005AB5DA, + 1865EBF806253B76005AB5DA, + 1865EC1406253B76005AB5DA, + 1865EC1506253B76005AB5DA, + 1865EC3106253B76005AB5DA, + 1865EC3606253B76005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EBD806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EBD906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EBDA06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EBDB06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EBDC06253B76005AB5DA = { + children = ( + 1865EBDD06253B76005AB5DA, + 1865EBDE06253B76005AB5DA, + 1865EBDF06253B76005AB5DA, + 1865EBE006253B76005AB5DA, + 1865EBE106253B76005AB5DA, + 1865EBE206253B76005AB5DA, + 1865EBE306253B76005AB5DA, + 1865EBE406253B76005AB5DA, + 1865EBE506253B76005AB5DA, + 1865EBE606253B76005AB5DA, + 1865EBE706253B76005AB5DA, + 1865EBE806253B76005AB5DA, + 1865EBE906253B76005AB5DA, + 1865EBEA06253B76005AB5DA, + 1865EBEB06253B76005AB5DA, + 1865EBEC06253B76005AB5DA, + 1865EBED06253B76005AB5DA, + 1865EBEE06253B76005AB5DA, + 1865EBEF06253B76005AB5DA, + 1865EBF006253B76005AB5DA, + 1865EBF106253B76005AB5DA, + 1865EBF206253B76005AB5DA, + 1865EBF306253B76005AB5DA, + 1865EBF406253B76005AB5DA, + 1865EBF506253B76005AB5DA, + 1865EBF606253B76005AB5DA, + 1865EBF706253B76005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBDD06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBDE06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BSD.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBDF06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES-MACOS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COMPILING.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTOR_AGREEMENT.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTORS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DarwinCompileInfo.rtf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoxyConfig.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE506253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.readme.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendox.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBE906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GPL.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBEA06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.prj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBEB06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INSTALL.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBEC06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LGPL.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBED06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBEE06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE_ID.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBEF06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeversion.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "osx_setup.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.sln.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.doxygen.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "run_python.bat.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF506253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConscript.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConstruct.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "win32_install.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EBF806253B76005AB5DA = { + children = ( + 1865EBF906253B76005AB5DA, + 1865EBFA06253B76005AB5DA, + 1865EBFB06253B76005AB5DA, + 1865EBFC06253B76005AB5DA, + 1865EBFD06253B76005AB5DA, + 1865EBFE06253B76005AB5DA, + 1865EBFF06253B76005AB5DA, + 1865EC0006253B76005AB5DA, + 1865EC0106253B76005AB5DA, + 1865EC0206253B76005AB5DA, + 1865EC0306253B76005AB5DA, + 1865EC0406253B76005AB5DA, + 1865EC0506253B76005AB5DA, + 1865EC0606253B76005AB5DA, + 1865EC0706253B76005AB5DA, + 1865EC0806253B76005AB5DA, + 1865EC0906253B76005AB5DA, + 1865EC0A06253B76005AB5DA, + 1865EC0B06253B76005AB5DA, + 1865EC0C06253B76005AB5DA, + 1865EC0D06253B76005AB5DA, + 1865EC0E06253B76005AB5DA, + 1865EC0F06253B76005AB5DA, + 1865EC1006253B76005AB5DA, + 1865EC1106253B76005AB5DA, + 1865EC1206253B76005AB5DA, + 1865EC1306253B76005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EBF906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFA06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BSD.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFB06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES-MACOS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFC06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COMPILING.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFD06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTOR_AGREEMENT.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFE06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTORS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EBFF06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DarwinCompileInfo.rtf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoxyConfig.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.readme.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendox.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0506253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GPL.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.prj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INSTALL.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LGPL.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0A06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE_ID.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0B06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeversion.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0C06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "osx_setup.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0D06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.sln.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0E06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.doxygen.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC0F06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC1006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "run_python.bat.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC1106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConscript.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC1206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConstruct.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC1306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "win32_install.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC1406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EC1506253B76005AB5DA = { + children = ( + 1865EC1606253B76005AB5DA, + 1865EC1706253B76005AB5DA, + 1865EC1806253B76005AB5DA, + 1865EC1906253B76005AB5DA, + 1865EC1A06253B76005AB5DA, + 1865EC1B06253B76005AB5DA, + 1865EC1C06253B76005AB5DA, + 1865EC1D06253B76005AB5DA, + 1865EC1E06253B76005AB5DA, + 1865EC1F06253B76005AB5DA, + 1865EC2006253B76005AB5DA, + 1865EC2106253B76005AB5DA, + 1865EC2206253B76005AB5DA, + 1865EC2306253B76005AB5DA, + 1865EC2406253B76005AB5DA, + 1865EC2506253B76005AB5DA, + 1865EC2606253B76005AB5DA, + 1865EC2706253B76005AB5DA, + 1865EC2806253B76005AB5DA, + 1865EC2906253B76005AB5DA, + 1865EC2A06253B76005AB5DA, + 1865EC2B06253B76005AB5DA, + 1865EC2C06253B76005AB5DA, + 1865EC2D06253B76005AB5DA, + 1865EC2E06253B76005AB5DA, + 1865EC2F06253B76005AB5DA, + 1865EC3006253B76005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BSD.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES-MACOS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COMPILING.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1A06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTOR_AGREEMENT.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1B06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTORS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1C06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DarwinCompileInfo.rtf.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1D06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoxyConfig.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1E06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC1F06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.readme.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "gen.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "gendox.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GPL.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.prj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INSTALL.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2506253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LGPL.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE_ID.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeversion.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "osx_setup.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2A06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.sln.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2B06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.doxygen.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2C06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2D06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "run_python.bat.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2E06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConscript.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC2F06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConstruct.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC3006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "win32_install.py.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC3106253B76005AB5DA = { + children = ( + 1865EC3206253B76005AB5DA, + 1865EC3306253B76005AB5DA, + 1865EC3406253B76005AB5DA, + 1865EC3506253B76005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EC3206253B76005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC3306253B76005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EC3406253B76005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC3506253B76005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EC3606253B76005AB5DA = { + children = ( + 1865EC3706253B76005AB5DA, + 1865EC3806253B76005AB5DA, + 1865EC3906253B76005AB5DA, + 1865EC3A06253B76005AB5DA, + 1865EC3B06253B76005AB5DA, + 1865EC3C06253B76005AB5DA, + 1865EC3D06253B76005AB5DA, + 1865EC3E06253B76005AB5DA, + 1865EC3F06253B76005AB5DA, + 1865EC4006253B76005AB5DA, + 1865EC4106253B76005AB5DA, + 1865EC4206253B76005AB5DA, + 1865EC4306253B76005AB5DA, + 1865EC4406253B76005AB5DA, + 1865EC4506253B76005AB5DA, + 1865EC4606253B76005AB5DA, + 1865EC4706253B76005AB5DA, + 1865EC4806253B77005AB5DA, + 1865EC4906253B77005AB5DA, + 1865EC4A06253B77005AB5DA, + 1865EC4B06253B77005AB5DA, + 1865EC4C06253B77005AB5DA, + 1865EC4D06253B77005AB5DA, + 1865EC4E06253B77005AB5DA, + 1865EC4F06253B77005AB5DA, + 1865EC5006253B77005AB5DA, + 1865EC5106253B77005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EC3706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3806253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BSD.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3906253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES-MACOS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3A06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "COMPILING.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3B06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTOR_AGREEMENT.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3C06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CONTRIBUTORS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3D06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DarwinCompileInfo.rtf.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3E06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoxyConfig.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC3F06253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4006253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.readme.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4106253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gen.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4206253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendox.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4306253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GPL.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4406253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "GtkRadiant.prj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4506253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INSTALL.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4606253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LGPL.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4706253B76005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4806253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LICENSE_ID.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4906253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "makeversion.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4A06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "osx_setup.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4B06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant.sln.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4C06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.doxygen.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4D06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "README.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4E06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "run_python.bat.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC4F06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConscript.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC5006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "SConstruct.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC5106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "win32_install.py.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC5206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = BSD; + refType = 4; + sourceTree = ""; + }; + 1865EC5306253B77005AB5DA = { + children = ( + 1865EC5406253B77005AB5DA, + 1865EC6206253B77005AB5DA, + ); + isa = PBXGroup; + path = build; + refType = 4; + sourceTree = ""; + }; + 1865EC5406253B77005AB5DA = { + children = ( + 1865EC5506253B77005AB5DA, + 1865EC5E06253B77005AB5DA, + ); + isa = PBXGroup; + path = debug; + refType = 4; + sourceTree = ""; + }; + 1865EC5506253B77005AB5DA = { + children = ( + 1865EC5606253B77005AB5DA, + 1865EC5A06253B77005AB5DA, + ); + isa = PBXGroup; + path = contrib; + refType = 4; + sourceTree = ""; + }; + 1865EC5606253B77005AB5DA = { + children = ( + 1865EC5706253B77005AB5DA, + 1865EC5806253B77005AB5DA, + 1865EC5906253B77005AB5DA, + ); + isa = PBXGroup; + path = bkgrnd2d; + refType = 4; + sourceTree = ""; + }; + 1865EC5706253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = bkgrnd2d.os; + refType = 4; + sourceTree = ""; + }; + 1865EC5806253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = dialog.os; + refType = 4; + sourceTree = ""; + }; + 1865EC5906253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = plugin.os; + refType = 4; + sourceTree = ""; + }; + 1865EC5A06253B77005AB5DA = { + children = ( + 1865EC5B06253B77005AB5DA, + 1865EC5C06253B77005AB5DA, + ); + isa = PBXGroup; + path = bobtoolz; + refType = 4; + sourceTree = ""; + }; + 1865EC5B06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = "bobToolz-GTK.os"; + refType = 4; + sourceTree = ""; + }; + 1865EC5C06253B77005AB5DA = { + children = ( + 1865EC5D06253B77005AB5DA, + ); + isa = PBXGroup; + path = dialogs; + refType = 4; + sourceTree = ""; + }; + 1865EC5D06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = "dialogs-gtk.os"; + refType = 4; + sourceTree = ""; + }; + 1865EC5E06253B77005AB5DA = { + children = ( + 1865EC5F06253B77005AB5DA, + 1865EC6006253B77005AB5DA, + ); + isa = PBXGroup; + path = libs; + refType = 4; + sourceTree = ""; + }; + 1865EC5F06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = archive.ar; + path = libsynapse.a; + refType = 4; + sourceTree = ""; + }; + 1865EC6006253B77005AB5DA = { + children = ( + 1865EC6106253B77005AB5DA, + ); + isa = PBXGroup; + path = synapse; + refType = 4; + sourceTree = ""; + }; + 1865EC6106253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.objfile"; + path = synapse.o; + refType = 4; + sourceTree = ""; + }; + 1865EC6206253B77005AB5DA = { + children = ( + 1865EC6306253B77005AB5DA, + ); + isa = PBXGroup; + path = radiant.build; + refType = 4; + sourceTree = ""; + }; + 1865EC6306253B77005AB5DA = { + children = ( + 1865EC6406253B77005AB5DA, + 1865EC6506253B77005AB5DA, + 1865EC6606253B77005AB5DA, + 1865EC6706253B77005AB5DA, + 1865EC6806253B77005AB5DA, + 1865EC6906253B77005AB5DA, + 1865EC6A06253B77005AB5DA, + 1865EC6B06253B77005AB5DA, + 1865EC6C06253B77005AB5DA, + 1865EC6F06253B77005AB5DA, + ); + isa = PBXGroup; + path = radiant.pbxindex; + refType = 4; + sourceTree = ""; + }; + 1865EC6406253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = categories.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6506253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = cdecls.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6606253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = decls.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6706253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = files.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6806253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = imports.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6906253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = pbxindex.header; + refType = 4; + sourceTree = ""; + }; + 1865EC6A06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = protocols.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6B06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = refs.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC6C06253B77005AB5DA = { + children = ( + 1865EC6D06253B77005AB5DA, + 1865EC6E06253B77005AB5DA, + ); + isa = PBXGroup; + path = strings.pbxstrings; + refType = 4; + sourceTree = ""; + }; + 1865EC6D06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = control; + refType = 4; + sourceTree = ""; + }; + 1865EC6E06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = strings; + refType = 4; + sourceTree = ""; + }; + 1865EC6F06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = subclasses.pbxbtree; + refType = 4; + sourceTree = ""; + }; + 1865EC7006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES-MACOS"; + refType = 4; + sourceTree = ""; + }; + 1865EC7106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = COMPILING; + refType = 4; + sourceTree = ""; + }; + 1865EC7206253B77005AB5DA = { + children = ( + 1865EC7306253B77005AB5DA, + 1865EC8206253B77005AB5DA, + 1865ECE306253B77005AB5DA, + 1865EF5B06253B7C005AB5DA, + 1865EFCB06253B7D005AB5DA, + 1865F03506253B7E005AB5DA, + 1865F05906253B7E005AB5DA, + 1865F08906253B7E005AB5DA, + ); + isa = PBXGroup; + path = contrib; + refType = 4; + sourceTree = ""; + }; + 1865EC7306253B77005AB5DA = { + children = ( + 1865EC7406253B77005AB5DA, + 1865EC7506253B77005AB5DA, + 1865EC7606253B77005AB5DA, + 1865EC7706253B77005AB5DA, + 1865EC7806253B77005AB5DA, + 1865EC7906253B77005AB5DA, + 1865EC7A06253B77005AB5DA, + 1865EC7B06253B77005AB5DA, + 1865EC7C06253B77005AB5DA, + 1865EC8106253B77005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EC7406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EC7506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EC7606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EC7706253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EC7806253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC7906253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EC7A06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EC7B06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC7C06253B77005AB5DA = { + children = ( + 1865EC7D06253B77005AB5DA, + 1865EC7E06253B77005AB5DA, + 1865EC7F06253B77005AB5DA, + 1865EC8006253B77005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EC7D06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC7E06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EC7F06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8006253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EC8106253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EC8206253B77005AB5DA = { + children = ( + 1865EC8306253B77005AB5DA, + 1865ECB606253B77005AB5DA, + 1865ECDA06253B77005AB5DA, + 1865ECDB06253B77005AB5DA, + 1865ECDC06253B77005AB5DA, + 1865ECDD06253B77005AB5DA, + 1865ECDE06253B77005AB5DA, + 1865ECDF06253B77005AB5DA, + 1865ECE006253B77005AB5DA, + 1865ECE106253B77005AB5DA, + 1865ECE206253B77005AB5DA, + ); + isa = PBXGroup; + path = bkgrnd2d; + refType = 4; + sourceTree = ""; + }; + 1865EC8306253B77005AB5DA = { + children = ( + 1865EC8406253B77005AB5DA, + 1865EC8506253B77005AB5DA, + 1865EC8606253B77005AB5DA, + 1865EC8706253B77005AB5DA, + 1865EC8806253B77005AB5DA, + 1865EC9206253B77005AB5DA, + 1865EC9C06253B77005AB5DA, + 1865EC9D06253B77005AB5DA, + 1865ECA706253B77005AB5DA, + 1865ECAC06253B77005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EC8406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EC8506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EC8606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EC8706253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EC8806253B77005AB5DA = { + children = ( + 1865EC8906253B77005AB5DA, + 1865EC8A06253B77005AB5DA, + 1865EC8B06253B77005AB5DA, + 1865EC8C06253B77005AB5DA, + 1865EC8D06253B77005AB5DA, + 1865EC8E06253B77005AB5DA, + 1865EC8F06253B77005AB5DA, + 1865EC9006253B77005AB5DA, + 1865EC9106253B77005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8906253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8A06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8B06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8C06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8D06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8E06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC8F06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC9006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC9106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme_bkgrnd2d-b0.25.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC9206253B77005AB5DA = { + children = ( + 1865EC9306253B77005AB5DA, + 1865EC9406253B77005AB5DA, + 1865EC9506253B77005AB5DA, + 1865EC9606253B77005AB5DA, + 1865EC9706253B77005AB5DA, + 1865EC9806253B77005AB5DA, + 1865EC9906253B77005AB5DA, + 1865EC9A06253B77005AB5DA, + 1865EC9B06253B77005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EC9306253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9706253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9806253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9906253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9A06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9B06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme_bkgrnd2d-b0.25.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EC9C06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EC9D06253B77005AB5DA = { + children = ( + 1865EC9E06253B77005AB5DA, + 1865EC9F06253B77005AB5DA, + 1865ECA006253B77005AB5DA, + 1865ECA106253B77005AB5DA, + 1865ECA206253B77005AB5DA, + 1865ECA306253B77005AB5DA, + 1865ECA406253B77005AB5DA, + 1865ECA506253B77005AB5DA, + 1865ECA606253B77005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC9E06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EC9F06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "bkgrnd2d.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA306253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme_bkgrnd2d-b0.25.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA706253B77005AB5DA = { + children = ( + 1865ECA806253B77005AB5DA, + 1865ECA906253B77005AB5DA, + 1865ECAA06253B77005AB5DA, + 1865ECAB06253B77005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865ECA806253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECA906253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865ECAA06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECAB06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865ECAC06253B77005AB5DA = { + children = ( + 1865ECAD06253B77005AB5DA, + 1865ECAE06253B77005AB5DA, + 1865ECAF06253B77005AB5DA, + 1865ECB006253B77005AB5DA, + 1865ECB106253B77005AB5DA, + 1865ECB206253B77005AB5DA, + 1865ECB306253B77005AB5DA, + 1865ECB406253B77005AB5DA, + 1865ECB506253B77005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865ECAD06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECAE06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECAF06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB306253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme_bkgrnd2d-b0.25.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECB606253B77005AB5DA = { + children = ( + 1865ECB706253B77005AB5DA, + 1865ECD606253B77005AB5DA, + 1865ECD706253B77005AB5DA, + 1865ECD806253B77005AB5DA, + 1865ECD906253B77005AB5DA, + ); + isa = PBXGroup; + path = bitmaps; + refType = 4; + sourceTree = ""; + }; + 1865ECB706253B77005AB5DA = { + children = ( + 1865ECB806253B77005AB5DA, + 1865ECB906253B77005AB5DA, + 1865ECBA06253B77005AB5DA, + 1865ECBB06253B77005AB5DA, + 1865ECBC06253B77005AB5DA, + 1865ECC106253B77005AB5DA, + 1865ECC606253B77005AB5DA, + 1865ECC706253B77005AB5DA, + 1865ECCC06253B77005AB5DA, + 1865ECD106253B77005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865ECB806253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865ECB906253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865ECBA06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865ECBB06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865ECBC06253B77005AB5DA = { + children = ( + 1865ECBD06253B77005AB5DA, + 1865ECBE06253B77005AB5DA, + 1865ECBF06253B77005AB5DA, + 1865ECC006253B77005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECBD06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_conf.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECBE06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xy_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECBF06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xz_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECC006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_yz_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECC106253B77005AB5DA = { + children = ( + 1865ECC206253B77005AB5DA, + 1865ECC306253B77005AB5DA, + 1865ECC406253B77005AB5DA, + 1865ECC506253B77005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865ECC206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_conf.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECC306253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xy_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECC406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xz_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECC506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_yz_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECC606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865ECC706253B77005AB5DA = { + children = ( + 1865ECC806253B77005AB5DA, + 1865ECC906253B77005AB5DA, + 1865ECCA06253B77005AB5DA, + 1865ECCB06253B77005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECC806253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bkgrnd2d_conf.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECC906253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bkgrnd2d_xy_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECCA06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bkgrnd2d_xz_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECCB06253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bkgrnd2d_yz_toggle.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECCC06253B77005AB5DA = { + children = ( + 1865ECCD06253B77005AB5DA, + 1865ECCE06253B77005AB5DA, + 1865ECCF06253B77005AB5DA, + 1865ECD006253B77005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865ECCD06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECCE06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865ECCF06253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECD006253B77005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865ECD106253B77005AB5DA = { + children = ( + 1865ECD206253B77005AB5DA, + 1865ECD306253B77005AB5DA, + 1865ECD406253B77005AB5DA, + 1865ECD506253B77005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865ECD206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_conf.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECD306253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xy_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECD406253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_xz_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECD506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bkgrnd2d_yz_toggle.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ECD606253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bkgrnd2d_conf.bmp; + refType = 4; + sourceTree = ""; + }; + 1865ECD706253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bkgrnd2d_xy_toggle.bmp; + refType = 4; + sourceTree = ""; + }; + 1865ECD806253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bkgrnd2d_xz_toggle.bmp; + refType = 4; + sourceTree = ""; + }; + 1865ECD906253B77005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bkgrnd2d_yz_toggle.bmp; + refType = 4; + sourceTree = ""; + }; + 1865ECDA06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = bkgrnd2d.cpp; + refType = 4; + sourceTree = ""; + }; + 1865ECDB06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = bkgrnd2d.def; + refType = 4; + sourceTree = ""; + }; + 1865ECDC06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bkgrnd2d.h; + refType = 4; + sourceTree = ""; + }; + 1865ECDD06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = bkgrnd2d.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865ECDE06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865ECDF06253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = dialog.h; + refType = 4; + sourceTree = ""; + }; + 1865ECE006253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865ECE106253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865ECE206253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme_bkgrnd2d-b0.25.txt"; + refType = 4; + sourceTree = ""; + }; + 1865ECE306253B77005AB5DA = { + children = ( + 1865ECE406253B77005AB5DA, + 1865EDE306253B7A005AB5DA, + 1865EE2006253B7A005AB5DA, + 1865EE2106253B7A005AB5DA, + 1865EE2206253B7A005AB5DA, + 1865EE2306253B7A005AB5DA, + 1865EE2406253B7A005AB5DA, + 1865EE2506253B7A005AB5DA, + 1865EE2606253B7A005AB5DA, + 1865EE2706253B7A005AB5DA, + 1865EE2806253B7A005AB5DA, + 1865EE5B06253B7B005AB5DA, + 1865EE5C06253B7B005AB5DA, + 1865EE5D06253B7B005AB5DA, + 1865EE5E06253B7B005AB5DA, + 1865EE5F06253B7B005AB5DA, + 1865EE6006253B7B005AB5DA, + 1865EE6106253B7B005AB5DA, + 1865EE6206253B7B005AB5DA, + 1865EE6306253B7B005AB5DA, + 1865EE6406253B7B005AB5DA, + 1865EE6506253B7B005AB5DA, + 1865EE6606253B7B005AB5DA, + 1865EE6706253B7B005AB5DA, + 1865EE6806253B7B005AB5DA, + 1865EE6906253B7B005AB5DA, + 1865EEF106253B7C005AB5DA, + 1865EEF206253B7C005AB5DA, + 1865EEF306253B7C005AB5DA, + 1865EEF406253B7C005AB5DA, + 1865EEF506253B7C005AB5DA, + 1865EEF606253B7C005AB5DA, + 1865EEF706253B7C005AB5DA, + 1865EEF806253B7C005AB5DA, + 1865EEF906253B7C005AB5DA, + 1865EEFA06253B7C005AB5DA, + 1865EEFB06253B7C005AB5DA, + 1865EEFC06253B7C005AB5DA, + 1865EEFD06253B7C005AB5DA, + 1865EEFE06253B7C005AB5DA, + 1865EEFF06253B7C005AB5DA, + 1865EF0006253B7C005AB5DA, + 1865EF0106253B7C005AB5DA, + 1865EF0206253B7C005AB5DA, + 1865EF0306253B7C005AB5DA, + 1865EF0406253B7C005AB5DA, + 1865EF0506253B7C005AB5DA, + 1865EF0606253B7C005AB5DA, + 1865EF0706253B7C005AB5DA, + 1865EF0806253B7C005AB5DA, + 1865EF0906253B7C005AB5DA, + 1865EF1E06253B7C005AB5DA, + 1865EF1F06253B7C005AB5DA, + 1865EF2006253B7C005AB5DA, + 1865EF2106253B7C005AB5DA, + 1865EF2206253B7C005AB5DA, + 1865EF3706253B7C005AB5DA, + 1865EF3806253B7C005AB5DA, + 1865EF3906253B7C005AB5DA, + 1865EF3A06253B7C005AB5DA, + 1865EF3B06253B7C005AB5DA, + 1865EF3C06253B7C005AB5DA, + 1865EF3D06253B7C005AB5DA, + 1865EF3E06253B7C005AB5DA, + 1865EF3F06253B7C005AB5DA, + 1865EF5906253B7C005AB5DA, + 1865EF5A06253B7C005AB5DA, + ); + isa = PBXGroup; + path = bobtoolz; + refType = 4; + sourceTree = ""; + }; + 1865ECE406253B77005AB5DA = { + children = ( + 1865ECE506253B77005AB5DA, + 1865ECE606253B77005AB5DA, + 1865ECE706253B77005AB5DA, + 1865ECE806253B77005AB5DA, + 1865ECE906253B77005AB5DA, + 1865ED2606253B78005AB5DA, + 1865ED6306253B79005AB5DA, + 1865ED6406253B79005AB5DA, + 1865EDA106253B79005AB5DA, + 1865EDA606253B79005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865ECE506253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865ECE606253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865ECE706253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865ECE806253B77005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865ECE906253B77005AB5DA = { + children = ( + 1865ECEA06253B78005AB5DA, + 1865ECEB06253B78005AB5DA, + 1865ECEC06253B78005AB5DA, + 1865ECED06253B78005AB5DA, + 1865ECEE06253B78005AB5DA, + 1865ECEF06253B78005AB5DA, + 1865ECF006253B78005AB5DA, + 1865ECF106253B78005AB5DA, + 1865ECF206253B78005AB5DA, + 1865ECF306253B78005AB5DA, + 1865ECF406253B78005AB5DA, + 1865ECF506253B78005AB5DA, + 1865ECF606253B78005AB5DA, + 1865ECF706253B78005AB5DA, + 1865ECF806253B78005AB5DA, + 1865ECF906253B78005AB5DA, + 1865ECFA06253B78005AB5DA, + 1865ECFB06253B78005AB5DA, + 1865ECFC06253B78005AB5DA, + 1865ECFD06253B78005AB5DA, + 1865ECFE06253B78005AB5DA, + 1865ECFF06253B78005AB5DA, + 1865ED0006253B78005AB5DA, + 1865ED0106253B78005AB5DA, + 1865ED0206253B78005AB5DA, + 1865ED0306253B78005AB5DA, + 1865ED0406253B78005AB5DA, + 1865ED0506253B78005AB5DA, + 1865ED0606253B78005AB5DA, + 1865ED0706253B78005AB5DA, + 1865ED0806253B78005AB5DA, + 1865ED0906253B78005AB5DA, + 1865ED0A06253B78005AB5DA, + 1865ED0B06253B78005AB5DA, + 1865ED0C06253B78005AB5DA, + 1865ED0D06253B78005AB5DA, + 1865ED0E06253B78005AB5DA, + 1865ED0F06253B78005AB5DA, + 1865ED1006253B78005AB5DA, + 1865ED1106253B78005AB5DA, + 1865ED1206253B78005AB5DA, + 1865ED1306253B78005AB5DA, + 1865ED1406253B78005AB5DA, + 1865ED1506253B78005AB5DA, + 1865ED1606253B78005AB5DA, + 1865ED1706253B78005AB5DA, + 1865ED1806253B78005AB5DA, + 1865ED1906253B78005AB5DA, + 1865ED1A06253B78005AB5DA, + 1865ED1B06253B78005AB5DA, + 1865ED1C06253B78005AB5DA, + 1865ED1D06253B78005AB5DA, + 1865ED1E06253B78005AB5DA, + 1865ED1F06253B78005AB5DA, + 1865ED2006253B78005AB5DA, + 1865ED2106253B78005AB5DA, + 1865ED2206253B78005AB5DA, + 1865ED2306253B78005AB5DA, + 1865ED2406253B78005AB5DA, + 1865ED2506253B78005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECEA06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECEB06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz-gtk.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECEC06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECED06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECEE06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECEF06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz_gtk.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cportals.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CPortals.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF606253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfToolz-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctftoolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECF906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFA06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFB06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFC06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFD06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFE06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ECFF06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0606253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0A06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0B06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0C06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0D06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0E06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED0F06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-ctf-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1606253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1A06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1B06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1C06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource-gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1D06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1E06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED1F06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED2606253B78005AB5DA = { + children = ( + 1865ED2706253B78005AB5DA, + 1865ED2806253B78005AB5DA, + 1865ED2906253B78005AB5DA, + 1865ED2A06253B78005AB5DA, + 1865ED2B06253B78005AB5DA, + 1865ED2C06253B78005AB5DA, + 1865ED2D06253B78005AB5DA, + 1865ED2E06253B78005AB5DA, + 1865ED2F06253B78005AB5DA, + 1865ED3006253B78005AB5DA, + 1865ED3106253B78005AB5DA, + 1865ED3206253B78005AB5DA, + 1865ED3306253B78005AB5DA, + 1865ED3406253B78005AB5DA, + 1865ED3506253B78005AB5DA, + 1865ED3606253B78005AB5DA, + 1865ED3706253B78005AB5DA, + 1865ED3806253B78005AB5DA, + 1865ED3906253B78005AB5DA, + 1865ED3A06253B78005AB5DA, + 1865ED3B06253B78005AB5DA, + 1865ED3C06253B78005AB5DA, + 1865ED3D06253B78005AB5DA, + 1865ED3E06253B78005AB5DA, + 1865ED3F06253B78005AB5DA, + 1865ED4006253B78005AB5DA, + 1865ED4106253B78005AB5DA, + 1865ED4206253B78005AB5DA, + 1865ED4306253B78005AB5DA, + 1865ED4406253B78005AB5DA, + 1865ED4506253B78005AB5DA, + 1865ED4606253B78005AB5DA, + 1865ED4706253B78005AB5DA, + 1865ED4806253B78005AB5DA, + 1865ED4906253B78005AB5DA, + 1865ED4A06253B78005AB5DA, + 1865ED4B06253B78005AB5DA, + 1865ED4C06253B78005AB5DA, + 1865ED4D06253B78005AB5DA, + 1865ED4E06253B78005AB5DA, + 1865ED4F06253B78005AB5DA, + 1865ED5006253B78005AB5DA, + 1865ED5106253B78005AB5DA, + 1865ED5206253B78005AB5DA, + 1865ED5306253B78005AB5DA, + 1865ED5406253B78005AB5DA, + 1865ED5506253B79005AB5DA, + 1865ED5606253B79005AB5DA, + 1865ED5706253B79005AB5DA, + 1865ED5806253B79005AB5DA, + 1865ED5906253B79005AB5DA, + 1865ED5A06253B79005AB5DA, + 1865ED5B06253B79005AB5DA, + 1865ED5C06253B79005AB5DA, + 1865ED5D06253B79005AB5DA, + 1865ED5E06253B79005AB5DA, + 1865ED5F06253B79005AB5DA, + 1865ED6006253B79005AB5DA, + 1865ED6106253B79005AB5DA, + 1865ED6206253B79005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865ED2706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz-gtk.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2A06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2B06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2C06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz_gtk.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2D06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2E06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED2F06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cportals.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CPortals.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfToolz-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctftoolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3606253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3A06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3B06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3C06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3D06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3E06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED3F06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4506253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4606253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4706253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4806253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4906253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4A06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4B06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4C06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4D06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4E06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED4F06253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5006253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5106253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-ctf-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5206253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5306253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5406253B78005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5506253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5606253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource-gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5A06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5B06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5C06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5D06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5E06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED5F06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED6006253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED6106253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED6206253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865ED6306253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865ED6406253B79005AB5DA = { + children = ( + 1865ED6506253B79005AB5DA, + 1865ED6606253B79005AB5DA, + 1865ED6706253B79005AB5DA, + 1865ED6806253B79005AB5DA, + 1865ED6906253B79005AB5DA, + 1865ED6A06253B79005AB5DA, + 1865ED6B06253B79005AB5DA, + 1865ED6C06253B79005AB5DA, + 1865ED6D06253B79005AB5DA, + 1865ED6E06253B79005AB5DA, + 1865ED6F06253B79005AB5DA, + 1865ED7006253B79005AB5DA, + 1865ED7106253B79005AB5DA, + 1865ED7206253B79005AB5DA, + 1865ED7306253B79005AB5DA, + 1865ED7406253B79005AB5DA, + 1865ED7506253B79005AB5DA, + 1865ED7606253B79005AB5DA, + 1865ED7706253B79005AB5DA, + 1865ED7806253B79005AB5DA, + 1865ED7906253B79005AB5DA, + 1865ED7A06253B79005AB5DA, + 1865ED7B06253B79005AB5DA, + 1865ED7C06253B79005AB5DA, + 1865ED7D06253B79005AB5DA, + 1865ED7E06253B79005AB5DA, + 1865ED7F06253B79005AB5DA, + 1865ED8006253B79005AB5DA, + 1865ED8106253B79005AB5DA, + 1865ED8206253B79005AB5DA, + 1865ED8306253B79005AB5DA, + 1865ED8406253B79005AB5DA, + 1865ED8506253B79005AB5DA, + 1865ED8606253B79005AB5DA, + 1865ED8706253B79005AB5DA, + 1865ED8806253B79005AB5DA, + 1865ED8906253B79005AB5DA, + 1865ED8A06253B79005AB5DA, + 1865ED8B06253B79005AB5DA, + 1865ED8C06253B79005AB5DA, + 1865ED8D06253B79005AB5DA, + 1865ED8E06253B79005AB5DA, + 1865ED8F06253B79005AB5DA, + 1865ED9006253B79005AB5DA, + 1865ED9106253B79005AB5DA, + 1865ED9206253B79005AB5DA, + 1865ED9306253B79005AB5DA, + 1865ED9406253B79005AB5DA, + 1865ED9506253B79005AB5DA, + 1865ED9606253B79005AB5DA, + 1865ED9706253B79005AB5DA, + 1865ED9806253B79005AB5DA, + 1865ED9906253B79005AB5DA, + 1865ED9A06253B79005AB5DA, + 1865ED9B06253B79005AB5DA, + 1865ED9C06253B79005AB5DA, + 1865ED9D06253B79005AB5DA, + 1865ED9E06253B79005AB5DA, + 1865ED9F06253B79005AB5DA, + 1865EDA006253B79005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6506253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6606253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz-gtk.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6A06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "bobToolz_gtk.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6B06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6C06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6D06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cportals.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6E06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CPortals.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED6F06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7006253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7106253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfToolz-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7206253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctftoolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7306253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7406253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7506253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7606253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7A06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7B06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7C06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7D06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7E06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED7F06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8006253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8106253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8206253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8306253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8406253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8506253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8606253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8A06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8B06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8C06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8D06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8E06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED8F06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-ctf-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9006253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-GTK.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9106253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9206253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9306253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9406253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9506253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9606253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource-gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9A06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9B06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9C06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9D06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9E06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865ED9F06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDA006253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDA106253B79005AB5DA = { + children = ( + 1865EDA206253B79005AB5DA, + 1865EDA306253B79005AB5DA, + 1865EDA406253B79005AB5DA, + 1865EDA506253B79005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EDA206253B79005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDA306253B79005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EDA406253B79005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDA506253B79005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EDA606253B79005AB5DA = { + children = ( + 1865EDA706253B79005AB5DA, + 1865EDA806253B79005AB5DA, + 1865EDA906253B79005AB5DA, + 1865EDAA06253B79005AB5DA, + 1865EDAB06253B79005AB5DA, + 1865EDAC06253B79005AB5DA, + 1865EDAD06253B79005AB5DA, + 1865EDAE06253B79005AB5DA, + 1865EDAF06253B79005AB5DA, + 1865EDB006253B7A005AB5DA, + 1865EDB106253B7A005AB5DA, + 1865EDB206253B7A005AB5DA, + 1865EDB306253B7A005AB5DA, + 1865EDB406253B7A005AB5DA, + 1865EDB506253B7A005AB5DA, + 1865EDB606253B7A005AB5DA, + 1865EDB706253B7A005AB5DA, + 1865EDB806253B7A005AB5DA, + 1865EDB906253B7A005AB5DA, + 1865EDBA06253B7A005AB5DA, + 1865EDBB06253B7A005AB5DA, + 1865EDBC06253B7A005AB5DA, + 1865EDBD06253B7A005AB5DA, + 1865EDBE06253B7A005AB5DA, + 1865EDBF06253B7A005AB5DA, + 1865EDC006253B7A005AB5DA, + 1865EDC106253B7A005AB5DA, + 1865EDC206253B7A005AB5DA, + 1865EDC306253B7A005AB5DA, + 1865EDC406253B7A005AB5DA, + 1865EDC506253B7A005AB5DA, + 1865EDC606253B7A005AB5DA, + 1865EDC706253B7A005AB5DA, + 1865EDC806253B7A005AB5DA, + 1865EDC906253B7A005AB5DA, + 1865EDCA06253B7A005AB5DA, + 1865EDCB06253B7A005AB5DA, + 1865EDCC06253B7A005AB5DA, + 1865EDCD06253B7A005AB5DA, + 1865EDCE06253B7A005AB5DA, + 1865EDCF06253B7A005AB5DA, + 1865EDD006253B7A005AB5DA, + 1865EDD106253B7A005AB5DA, + 1865EDD206253B7A005AB5DA, + 1865EDD306253B7A005AB5DA, + 1865EDD406253B7A005AB5DA, + 1865EDD506253B7A005AB5DA, + 1865EDD606253B7A005AB5DA, + 1865EDD706253B7A005AB5DA, + 1865EDD806253B7A005AB5DA, + 1865EDD906253B7A005AB5DA, + 1865EDDA06253B7A005AB5DA, + 1865EDDB06253B7A005AB5DA, + 1865EDDC06253B7A005AB5DA, + 1865EDDD06253B7A005AB5DA, + 1865EDDE06253B7A005AB5DA, + 1865EDDF06253B7A005AB5DA, + 1865EDE006253B7A005AB5DA, + 1865EDE106253B7A005AB5DA, + 1865EDE206253B7A005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EDA706253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDA806253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz-gtk.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDA906253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAA06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAB06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAC06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobToolz_gtk.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAD06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAE06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bsploader.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDAF06253B79005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cportals.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CPortals.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfresource_gtk.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctfToolz-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctftoolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBobView.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DBrush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDB906253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBA06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEntity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBB06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBC06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DEPair.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBD06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBE06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DListener.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDBF06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DMap.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPatch.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPlane.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DPoint.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DShape.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDC906253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCA06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTrainDrawer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCB06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCC06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DTreePlanter.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCD06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCE06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DVisDrawer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDCF06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DWinding.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-ctf-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers-GTK.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lists.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDD906253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource-gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDA06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDB06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDC06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ScriptParser.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDD06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDE06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shapes.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDDF06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDE006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDE106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDE206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "visfind.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDE306253B7A005AB5DA = { + children = ( + 1865EDE406253B7A005AB5DA, + 1865EE1706253B7A005AB5DA, + 1865EE1806253B7A005AB5DA, + 1865EE1906253B7A005AB5DA, + 1865EE1A06253B7A005AB5DA, + 1865EE1B06253B7A005AB5DA, + 1865EE1C06253B7A005AB5DA, + 1865EE1D06253B7A005AB5DA, + 1865EE1E06253B7A005AB5DA, + 1865EE1F06253B7A005AB5DA, + ); + isa = PBXGroup; + path = bitmaps; + refType = 4; + sourceTree = ""; + }; + 1865EDE406253B7A005AB5DA = { + children = ( + 1865EDE506253B7A005AB5DA, + 1865EDE606253B7A005AB5DA, + 1865EDE706253B7A005AB5DA, + 1865EDE806253B7A005AB5DA, + 1865EDE906253B7A005AB5DA, + 1865EDF306253B7A005AB5DA, + 1865EDFD06253B7A005AB5DA, + 1865EDFE06253B7A005AB5DA, + 1865EE0806253B7A005AB5DA, + 1865EE0D06253B7A005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EDE506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EDE606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EDE706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EDE806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EDE906253B7A005AB5DA = { + children = ( + 1865EDEA06253B7A005AB5DA, + 1865EDEB06253B7A005AB5DA, + 1865EDEC06253B7A005AB5DA, + 1865EDED06253B7A005AB5DA, + 1865EDEE06253B7A005AB5DA, + 1865EDEF06253B7A005AB5DA, + 1865EDF006253B7A005AB5DA, + 1865EDF106253B7A005AB5DA, + 1865EDF206253B7A005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDEA06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_caulk.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDEB06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_cleanup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDEC06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_dropent.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDED06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_merge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDEE06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_poly.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDEF06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_split.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDF006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_trainpathplot.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDF106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_treeplanter.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDF206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_turnedge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDF306253B7A005AB5DA = { + children = ( + 1865EDF406253B7A005AB5DA, + 1865EDF506253B7A005AB5DA, + 1865EDF606253B7A005AB5DA, + 1865EDF706253B7A005AB5DA, + 1865EDF806253B7A005AB5DA, + 1865EDF906253B7A005AB5DA, + 1865EDFA06253B7A005AB5DA, + 1865EDFB06253B7A005AB5DA, + 1865EDFC06253B7A005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EDF406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_caulk.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDF506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_cleanup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDF606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_dropent.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDF706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_merge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDF806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_poly.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDF906253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_split.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDFA06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_trainpathplot.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDFB06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_treeplanter.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDFC06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_turnedge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EDFD06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EDFE06253B7A005AB5DA = { + children = ( + 1865EDFF06253B7A005AB5DA, + 1865EE0006253B7A005AB5DA, + 1865EE0106253B7A005AB5DA, + 1865EE0206253B7A005AB5DA, + 1865EE0306253B7A005AB5DA, + 1865EE0406253B7A005AB5DA, + 1865EE0506253B7A005AB5DA, + 1865EE0606253B7A005AB5DA, + 1865EE0706253B7A005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EDFF06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_caulk.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0006253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_cleanup.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0106253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_dropent.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0206253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_merge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0306253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_poly.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0406253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_split.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0506253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_trainpathplot.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0606253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_treeplanter.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0706253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "bobtoolz_turnedge.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0806253B7A005AB5DA = { + children = ( + 1865EE0906253B7A005AB5DA, + 1865EE0A06253B7A005AB5DA, + 1865EE0B06253B7A005AB5DA, + 1865EE0C06253B7A005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EE0906253B7A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0A06253B7A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EE0B06253B7A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE0C06253B7A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EE0D06253B7A005AB5DA = { + children = ( + 1865EE0E06253B7A005AB5DA, + 1865EE0F06253B7A005AB5DA, + 1865EE1006253B7A005AB5DA, + 1865EE1106253B7A005AB5DA, + 1865EE1206253B7A005AB5DA, + 1865EE1306253B7A005AB5DA, + 1865EE1406253B7A005AB5DA, + 1865EE1506253B7A005AB5DA, + 1865EE1606253B7A005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EE0E06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_caulk.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE0F06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_cleanup.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_dropent.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_merge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_poly.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_split.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_trainpathplot.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_treeplanter.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz_turnedge.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE1706253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_caulk.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1806253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_cleanup.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1906253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_dropent.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1A06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_merge.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1B06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_poly.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1C06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_split.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1D06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_trainpathplot.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1E06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_treeplanter.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE1F06253B7A005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = bobtoolz_turnedge.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EE2006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = "bobToolz-GTK.cpp"; + refType = 4; + sourceTree = ""; + }; + 1865EE2106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bobtoolz-gtk.rc"; + refType = 4; + sourceTree = ""; + }; + 1865EE2206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = bobToolz.def; + refType = 4; + sourceTree = ""; + }; + 1865EE2306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bobToolz.h; + refType = 4; + sourceTree = ""; + }; + 1865EE2406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = bobToolz.rc; + refType = 4; + sourceTree = ""; + }; + 1865EE2506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = bobToolz_gtk.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865EE2606253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = bsploader.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE2706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bsploader.h; + refType = 4; + sourceTree = ""; + }; + 1865EE2806253B7A005AB5DA = { + children = ( + 1865EE2906253B7A005AB5DA, + 1865EE5406253B7B005AB5DA, + 1865EE5506253B7B005AB5DA, + 1865EE5606253B7B005AB5DA, + 1865EE5706253B7B005AB5DA, + 1865EE5806253B7B005AB5DA, + 1865EE5906253B7B005AB5DA, + 1865EE5A06253B7B005AB5DA, + ); + isa = PBXGroup; + path = bt; + refType = 4; + sourceTree = ""; + }; + 1865EE2906253B7A005AB5DA = { + children = ( + 1865EE2A06253B7A005AB5DA, + 1865EE2B06253B7A005AB5DA, + 1865EE2C06253B7A005AB5DA, + 1865EE2D06253B7A005AB5DA, + 1865EE2E06253B7A005AB5DA, + 1865EE3606253B7A005AB5DA, + 1865EE3E06253B7A005AB5DA, + 1865EE3F06253B7A005AB5DA, + 1865EE4706253B7B005AB5DA, + 1865EE4C06253B7B005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EE2A06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EE2B06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EE2C06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EE2D06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EE2E06253B7A005AB5DA = { + children = ( + 1865EE2F06253B7A005AB5DA, + 1865EE3006253B7A005AB5DA, + 1865EE3106253B7A005AB5DA, + 1865EE3206253B7A005AB5DA, + 1865EE3306253B7A005AB5DA, + 1865EE3406253B7A005AB5DA, + 1865EE3506253B7A005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE2F06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el1.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el2.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-blue.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-red.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex-trim.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3406253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3506253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tp_ent.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE3606253B7A005AB5DA = { + children = ( + 1865EE3706253B7A005AB5DA, + 1865EE3806253B7A005AB5DA, + 1865EE3906253B7A005AB5DA, + 1865EE3A06253B7A005AB5DA, + 1865EE3B06253B7A005AB5DA, + 1865EE3C06253B7A005AB5DA, + 1865EE3D06253B7A005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EE3706253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el1.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3806253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el2.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3906253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-blue.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3A06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-red.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3B06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex-trim.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3C06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3D06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tp_ent.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE3E06253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EE3F06253B7A005AB5DA = { + children = ( + 1865EE4006253B7A005AB5DA, + 1865EE4106253B7A005AB5DA, + 1865EE4206253B7A005AB5DA, + 1865EE4306253B7A005AB5DA, + 1865EE4406253B7B005AB5DA, + 1865EE4506253B7B005AB5DA, + 1865EE4606253B7B005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4006253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el1.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4106253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el2.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4206253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-blue.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4306253B7A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-red.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex-trim.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tp_ent.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4706253B7B005AB5DA = { + children = ( + 1865EE4806253B7B005AB5DA, + 1865EE4906253B7B005AB5DA, + 1865EE4A06253B7B005AB5DA, + 1865EE4B06253B7B005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EE4806253B7B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4906253B7B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EE4A06253B7B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE4B06253B7B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EE4C06253B7B005AB5DA = { + children = ( + 1865EE4D06253B7B005AB5DA, + 1865EE4E06253B7B005AB5DA, + 1865EE4F06253B7B005AB5DA, + 1865EE5006253B7B005AB5DA, + 1865EE5106253B7B005AB5DA, + 1865EE5206253B7B005AB5DA, + 1865EE5306253B7B005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EE4D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el1.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE4E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el2.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE4F06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-blue.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE5006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-red.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE5106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex-trim.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE5206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE5306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tp_ent.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE5406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el1.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bt-el2.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-blue.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ctf-red.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5806253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex-trim.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5906253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "door-tex.txt"; + refType = 4; + sourceTree = ""; + }; + 1865EE5A06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = tp_ent.txt; + refType = 4; + sourceTree = ""; + }; + 1865EE5B06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = cportals.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE5C06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = CPortals.h; + refType = 4; + sourceTree = ""; + }; + 1865EE5D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ctfresource_gtk.h; + refType = 4; + sourceTree = ""; + }; + 1865EE5E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ctfresource_gtk.rc; + refType = 4; + sourceTree = ""; + }; + 1865EE5F06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = "ctfToolz-GTK.cpp"; + refType = 4; + sourceTree = ""; + }; + 1865EE6006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ctftoolz.def; + refType = 4; + sourceTree = ""; + }; + 1865EE6106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DBobView.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE6206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DBobView.h; + refType = 4; + sourceTree = ""; + }; + 1865EE6306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DBrush.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE6406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DBrush.h; + refType = 4; + sourceTree = ""; + }; + 1865EE6506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DEntity.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE6606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DEntity.h; + refType = 4; + sourceTree = ""; + }; + 1865EE6706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DEPair.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EE6806253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DEPair.h; + refType = 4; + sourceTree = ""; + }; + 1865EE6906253B7B005AB5DA = { + children = ( + 1865EE6A06253B7B005AB5DA, + 1865EED906253B7C005AB5DA, + 1865EEDA06253B7C005AB5DA, + 1865EEDB06253B7C005AB5DA, + 1865EEDC06253B7C005AB5DA, + 1865EEDD06253B7C005AB5DA, + 1865EEDE06253B7C005AB5DA, + 1865EEDF06253B7C005AB5DA, + 1865EEE006253B7C005AB5DA, + 1865EEE106253B7C005AB5DA, + 1865EEE206253B7C005AB5DA, + 1865EEE306253B7C005AB5DA, + 1865EEE406253B7C005AB5DA, + 1865EEE506253B7C005AB5DA, + 1865EEE606253B7C005AB5DA, + 1865EEE706253B7C005AB5DA, + 1865EEE806253B7C005AB5DA, + 1865EEE906253B7C005AB5DA, + 1865EEEA06253B7C005AB5DA, + 1865EEEB06253B7C005AB5DA, + 1865EEEC06253B7C005AB5DA, + 1865EEED06253B7C005AB5DA, + 1865EEEE06253B7C005AB5DA, + 1865EEEF06253B7C005AB5DA, + 1865EEF006253B7C005AB5DA, + ); + isa = PBXGroup; + path = dialogs; + refType = 4; + sourceTree = ""; + }; + 1865EE6A06253B7B005AB5DA = { + children = ( + 1865EE6B06253B7B005AB5DA, + 1865EE6C06253B7B005AB5DA, + 1865EE6D06253B7B005AB5DA, + 1865EE6E06253B7B005AB5DA, + 1865EE6F06253B7B005AB5DA, + 1865EE8806253B7B005AB5DA, + 1865EEA106253B7B005AB5DA, + 1865EEA206253B7B005AB5DA, + 1865EEBB06253B7C005AB5DA, + 1865EEC006253B7C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EE6B06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EE6C06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EE6D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EE6E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EE6F06253B7B005AB5DA = { + children = ( + 1865EE7006253B7B005AB5DA, + 1865EE7106253B7B005AB5DA, + 1865EE7206253B7B005AB5DA, + 1865EE7306253B7B005AB5DA, + 1865EE7406253B7B005AB5DA, + 1865EE7506253B7B005AB5DA, + 1865EE7606253B7B005AB5DA, + 1865EE7706253B7B005AB5DA, + 1865EE7806253B7B005AB5DA, + 1865EE7906253B7B005AB5DA, + 1865EE7A06253B7B005AB5DA, + 1865EE7B06253B7B005AB5DA, + 1865EE7C06253B7B005AB5DA, + 1865EE7D06253B7B005AB5DA, + 1865EE7E06253B7B005AB5DA, + 1865EE7F06253B7B005AB5DA, + 1865EE8006253B7B005AB5DA, + 1865EE8106253B7B005AB5DA, + 1865EE8206253B7B005AB5DA, + 1865EE8306253B7B005AB5DA, + 1865EE8406253B7B005AB5DA, + 1865EE8506253B7B005AB5DA, + 1865EE8606253B7B005AB5DA, + 1865EE8706253B7B005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushcheckdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BrushCheckDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7806253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7906253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7A06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7B06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7C06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE7F06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EE8806253B7B005AB5DA = { + children = ( + 1865EE8906253B7B005AB5DA, + 1865EE8A06253B7B005AB5DA, + 1865EE8B06253B7B005AB5DA, + 1865EE8C06253B7B005AB5DA, + 1865EE8D06253B7B005AB5DA, + 1865EE8E06253B7B005AB5DA, + 1865EE8F06253B7B005AB5DA, + 1865EE9006253B7B005AB5DA, + 1865EE9106253B7B005AB5DA, + 1865EE9206253B7B005AB5DA, + 1865EE9306253B7B005AB5DA, + 1865EE9406253B7B005AB5DA, + 1865EE9506253B7B005AB5DA, + 1865EE9606253B7B005AB5DA, + 1865EE9706253B7B005AB5DA, + 1865EE9806253B7B005AB5DA, + 1865EE9906253B7B005AB5DA, + 1865EE9A06253B7B005AB5DA, + 1865EE9B06253B7B005AB5DA, + 1865EE9C06253B7B005AB5DA, + 1865EE9D06253B7B005AB5DA, + 1865EE9E06253B7B005AB5DA, + 1865EE9F06253B7B005AB5DA, + 1865EEA006253B7B005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EE8906253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8A06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8B06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8C06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE8F06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushcheckdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BrushCheckDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9806253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9906253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9A06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9B06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9C06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9D06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9E06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EE9F06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEA006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEA106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EEA206253B7B005AB5DA = { + children = ( + 1865EEA306253B7B005AB5DA, + 1865EEA406253B7B005AB5DA, + 1865EEA506253B7B005AB5DA, + 1865EEA606253B7B005AB5DA, + 1865EEA706253B7B005AB5DA, + 1865EEA806253B7B005AB5DA, + 1865EEA906253B7B005AB5DA, + 1865EEAA06253B7B005AB5DA, + 1865EEAB06253B7B005AB5DA, + 1865EEAC06253B7B005AB5DA, + 1865EEAD06253B7B005AB5DA, + 1865EEAE06253B7B005AB5DA, + 1865EEAF06253B7B005AB5DA, + 1865EEB006253B7B005AB5DA, + 1865EEB106253B7B005AB5DA, + 1865EEB206253B7B005AB5DA, + 1865EEB306253B7B005AB5DA, + 1865EEB406253B7B005AB5DA, + 1865EEB506253B7B005AB5DA, + 1865EEB606253B7B005AB5DA, + 1865EEB706253B7B005AB5DA, + 1865EEB806253B7C005AB5DA, + 1865EEB906253B7C005AB5DA, + 1865EEBA06253B7C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA806253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEA906253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushcheckdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAA06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BrushCheckDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAB06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAC06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAD06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAE06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEAF06253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB006253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB106253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB206253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB306253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB406253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB506253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB606253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB706253B7B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEB906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEBA06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEBB06253B7C005AB5DA = { + children = ( + 1865EEBC06253B7C005AB5DA, + 1865EEBD06253B7C005AB5DA, + 1865EEBE06253B7C005AB5DA, + 1865EEBF06253B7C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EEBC06253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEBD06253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EEBE06253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EEBF06253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EEC006253B7C005AB5DA = { + children = ( + 1865EEC106253B7C005AB5DA, + 1865EEC206253B7C005AB5DA, + 1865EEC306253B7C005AB5DA, + 1865EEC406253B7C005AB5DA, + 1865EEC506253B7C005AB5DA, + 1865EEC606253B7C005AB5DA, + 1865EEC706253B7C005AB5DA, + 1865EEC806253B7C005AB5DA, + 1865EEC906253B7C005AB5DA, + 1865EECA06253B7C005AB5DA, + 1865EECB06253B7C005AB5DA, + 1865EECC06253B7C005AB5DA, + 1865EECD06253B7C005AB5DA, + 1865EECE06253B7C005AB5DA, + 1865EECF06253B7C005AB5DA, + 1865EED006253B7C005AB5DA, + 1865EED106253B7C005AB5DA, + 1865EED206253B7C005AB5DA, + 1865EED306253B7C005AB5DA, + 1865EED406253B7C005AB5DA, + 1865EED506253B7C005AB5DA, + 1865EED606253B7C005AB5DA, + 1865EED706253B7C005AB5DA, + 1865EED806253B7C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EEC106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AutoCaulkStartDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "brushcheckdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "BrushCheckDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EEC906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECA06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs-gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECB06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECC06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DoorDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECD06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECE06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EECF06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IntersectInfoDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pathplotterdialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PolygonDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StairDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TextureResetDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EED906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = AboutDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEDA06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = AboutDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEDB06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = AutoCaulkDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEDC06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = AutoCaulkDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEDD06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = AutoCaulkStartDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEDE06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = AutoCaulkStartDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEDF06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = brushcheckdialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEE006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = BrushCheckDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEE106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = "dialogs-gtk.cpp"; + refType = 4; + sourceTree = ""; + }; + 1865EEE206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "dialogs-gtk.h"; + refType = 4; + sourceTree = ""; + }; + 1865EEE306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DoorDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEE406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DoorDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEE506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = IntersectDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEE606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = IntersectDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEE706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = IntersectInfoDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEE806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = IntersectInfoDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEE906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = pathplotterdialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEEA06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = pathplotterdialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEEB06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = PolygonDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEEC06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = PolygonDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEED06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = StairDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEEE06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = StairDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEEF06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = TextureResetDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEF006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = TextureResetDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865EEF106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DListener.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEF206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DListener.h; + refType = 4; + sourceTree = ""; + }; + 1865EEF306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DMap.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEF406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DMap.h; + refType = 4; + sourceTree = ""; + }; + 1865EEF506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DPatch.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEF606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DPatch.h; + refType = 4; + sourceTree = ""; + }; + 1865EEF706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DPlane.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEF806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DPlane.h; + refType = 4; + sourceTree = ""; + }; + 1865EEF906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DPoint.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEFA06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DPoint.h; + refType = 4; + sourceTree = ""; + }; + 1865EEFB06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DShape.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEFC06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DShape.h; + refType = 4; + sourceTree = ""; + }; + 1865EEFD06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DTrainDrawer.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EEFE06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DTrainDrawer.h; + refType = 4; + sourceTree = ""; + }; + 1865EEFF06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DTreePlanter.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF0006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DTreePlanter.h; + refType = 4; + sourceTree = ""; + }; + 1865EF0106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DVisDrawer.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF0206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DVisDrawer.h; + refType = 4; + sourceTree = ""; + }; + 1865EF0306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = DWinding.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF0406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DWinding.h; + refType = 4; + sourceTree = ""; + }; + 1865EF0506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = "funchandlers-ctf-GTK.cpp"; + refType = 4; + sourceTree = ""; + }; + 1865EF0606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = "funchandlers-GTK.cpp"; + refType = 4; + sourceTree = ""; + }; + 1865EF0706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = funchandlers.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF0806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = funchandlers.h; + refType = 4; + sourceTree = ""; + }; + 1865EF0906253B7C005AB5DA = { + children = ( + 1865EF0A06253B7C005AB5DA, + 1865EF1D06253B7C005AB5DA, + ); + isa = PBXGroup; + path = interfaces; + refType = 4; + sourceTree = ""; + }; + 1865EF0A06253B7C005AB5DA = { + children = ( + 1865EF0B06253B7C005AB5DA, + 1865EF0C06253B7C005AB5DA, + 1865EF0D06253B7C005AB5DA, + 1865EF0E06253B7C005AB5DA, + 1865EF0F06253B7C005AB5DA, + 1865EF1106253B7C005AB5DA, + 1865EF1306253B7C005AB5DA, + 1865EF1406253B7C005AB5DA, + 1865EF1606253B7C005AB5DA, + 1865EF1B06253B7C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EF0B06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EF0C06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EF0D06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EF0E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EF0F06253B7C005AB5DA = { + children = ( + 1865EF1006253B7C005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IScriptParser.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1106253B7C005AB5DA = { + children = ( + 1865EF1206253B7C005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF1206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IScriptParser.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF1306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF1406253B7C005AB5DA = { + children = ( + 1865EF1506253B7C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IScriptParser.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1606253B7C005AB5DA = { + children = ( + 1865EF1706253B7C005AB5DA, + 1865EF1806253B7C005AB5DA, + 1865EF1906253B7C005AB5DA, + 1865EF1A06253B7C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EF1706253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1806253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF1906253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF1A06253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF1B06253B7C005AB5DA = { + children = ( + 1865EF1C06253B7C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF1C06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "IScriptParser.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF1D06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = IScriptParser.h; + refType = 4; + sourceTree = ""; + }; + 1865EF1E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = lists.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF1F06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lists.h; + refType = 4; + sourceTree = ""; + }; + 1865EF2006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = misc.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF2106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = misc.h; + refType = 4; + sourceTree = ""; + }; + 1865EF2206253B7C005AB5DA = { + children = ( + 1865EF2306253B7C005AB5DA, + 1865EF3606253B7C005AB5DA, + ); + isa = PBXGroup; + path = res; + refType = 4; + sourceTree = ""; + }; + 1865EF2306253B7C005AB5DA = { + children = ( + 1865EF2406253B7C005AB5DA, + 1865EF2506253B7C005AB5DA, + 1865EF2606253B7C005AB5DA, + 1865EF2706253B7C005AB5DA, + 1865EF2806253B7C005AB5DA, + 1865EF2A06253B7C005AB5DA, + 1865EF2C06253B7C005AB5DA, + 1865EF2D06253B7C005AB5DA, + 1865EF2F06253B7C005AB5DA, + 1865EF3406253B7C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EF2406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EF2506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EF2606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EF2706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EF2806253B7C005AB5DA = { + children = ( + 1865EF2906253B7C005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF2906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.rc2.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF2A06253B7C005AB5DA = { + children = ( + 1865EF2B06253B7C005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF2B06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.rc2.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF2C06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF2D06253B7C005AB5DA = { + children = ( + 1865EF2E06253B7C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF2E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.rc2.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF2F06253B7C005AB5DA = { + children = ( + 1865EF3006253B7C005AB5DA, + 1865EF3106253B7C005AB5DA, + 1865EF3206253B7C005AB5DA, + 1865EF3306253B7C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EF3006253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF3106253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF3206253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF3306253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF3406253B7C005AB5DA = { + children = ( + 1865EF3506253B7C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF3506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.rc2.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF3606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = plugin.rc2; + refType = 4; + sourceTree = ""; + }; + 1865EF3706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "resource-gtk.h"; + refType = 4; + sourceTree = ""; + }; + 1865EF3806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resource.h; + refType = 4; + sourceTree = ""; + }; + 1865EF3906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = ScriptParser.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF3A06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ScriptParser.h; + refType = 4; + sourceTree = ""; + }; + 1865EF3B06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = shapes.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF3C06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = shapes.h; + refType = 4; + sourceTree = ""; + }; + 1865EF3D06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = StdAfx.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF3E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = StdAfx.h; + refType = 4; + sourceTree = ""; + }; + 1865EF3F06253B7C005AB5DA = { + children = ( + 1865EF4006253B7C005AB5DA, + 1865EF5706253B7C005AB5DA, + 1865EF5806253B7C005AB5DA, + ); + isa = PBXGroup; + path = txt; + refType = 4; + sourceTree = ""; + }; + 1865EF4006253B7C005AB5DA = { + children = ( + 1865EF4106253B7C005AB5DA, + 1865EF4206253B7C005AB5DA, + 1865EF4306253B7C005AB5DA, + 1865EF4406253B7C005AB5DA, + 1865EF4506253B7C005AB5DA, + 1865EF4806253B7C005AB5DA, + 1865EF4B06253B7C005AB5DA, + 1865EF4C06253B7C005AB5DA, + 1865EF4F06253B7C005AB5DA, + 1865EF5406253B7C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EF4106253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EF4206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EF4306253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EF4406253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EF4506253B7C005AB5DA = { + children = ( + 1865EF4606253B7C005AB5DA, + 1865EF4706253B7C005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4806253B7C005AB5DA = { + children = ( + 1865EF4906253B7C005AB5DA, + 1865EF4A06253B7C005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF4906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF4A06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF4B06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF4C06253B7C005AB5DA = { + children = ( + 1865EF4D06253B7C005AB5DA, + 1865EF4E06253B7C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4D06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF4F06253B7C005AB5DA = { + children = ( + 1865EF5006253B7C005AB5DA, + 1865EF5106253B7C005AB5DA, + 1865EF5206253B7C005AB5DA, + 1865EF5306253B7C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EF5006253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF5106253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF5206253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF5306253B7C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF5406253B7C005AB5DA = { + children = ( + 1865EF5506253B7C005AB5DA, + 1865EF5606253B7C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF5506253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changelog.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF5606253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "readme.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF5706253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changelog.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF5806253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = readme.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF5906253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = visfind.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EF5A06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = visfind.h; + refType = 4; + sourceTree = ""; + }; + 1865EF5B06253B7C005AB5DA = { + children = ( + 1865EF5C06253B7C005AB5DA, + 1865EFA706253B7D005AB5DA, + 1865EFBC06253B7D005AB5DA, + 1865EFBD06253B7D005AB5DA, + 1865EFBE06253B7D005AB5DA, + 1865EFBF06253B7D005AB5DA, + 1865EFC006253B7D005AB5DA, + 1865EFC106253B7D005AB5DA, + 1865EFC206253B7D005AB5DA, + 1865EFC306253B7D005AB5DA, + 1865EFC406253B7D005AB5DA, + 1865EFC506253B7D005AB5DA, + 1865EFC606253B7D005AB5DA, + 1865EFC706253B7D005AB5DA, + 1865EFC806253B7D005AB5DA, + 1865EFC906253B7D005AB5DA, + 1865EFCA06253B7D005AB5DA, + ); + isa = PBXGroup; + path = camera; + refType = 4; + sourceTree = ""; + }; + 1865EF5C06253B7C005AB5DA = { + children = ( + 1865EF5D06253B7C005AB5DA, + 1865EF5E06253B7C005AB5DA, + 1865EF5F06253B7C005AB5DA, + 1865EF6006253B7C005AB5DA, + 1865EF6106253B7C005AB5DA, + 1865EF7106253B7D005AB5DA, + 1865EF8106253B7D005AB5DA, + 1865EF8206253B7D005AB5DA, + 1865EF9206253B7D005AB5DA, + 1865EF9706253B7D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EF5D06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EF5E06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EF5F06253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EF6006253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EF6106253B7C005AB5DA = { + children = ( + 1865EF6206253B7C005AB5DA, + 1865EF6306253B7D005AB5DA, + 1865EF6406253B7D005AB5DA, + 1865EF6506253B7D005AB5DA, + 1865EF6606253B7D005AB5DA, + 1865EF6706253B7D005AB5DA, + 1865EF6806253B7D005AB5DA, + 1865EF6906253B7D005AB5DA, + 1865EF6A06253B7D005AB5DA, + 1865EF6B06253B7D005AB5DA, + 1865EF6C06253B7D005AB5DA, + 1865EF6D06253B7D005AB5DA, + 1865EF6E06253B7D005AB5DA, + 1865EF6F06253B7D005AB5DA, + 1865EF7006253B7D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6206253B7C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6706253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs_common.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6A06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6B06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6C06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6D06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6E06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF6F06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF7006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF7106253B7D005AB5DA = { + children = ( + 1865EF7206253B7D005AB5DA, + 1865EF7306253B7D005AB5DA, + 1865EF7406253B7D005AB5DA, + 1865EF7506253B7D005AB5DA, + 1865EF7606253B7D005AB5DA, + 1865EF7706253B7D005AB5DA, + 1865EF7806253B7D005AB5DA, + 1865EF7906253B7D005AB5DA, + 1865EF7A06253B7D005AB5DA, + 1865EF7B06253B7D005AB5DA, + 1865EF7C06253B7D005AB5DA, + 1865EF7D06253B7D005AB5DA, + 1865EF7E06253B7D005AB5DA, + 1865EF7F06253B7D005AB5DA, + 1865EF8006253B7D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF7206253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7706253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs_common.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7A06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7B06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7C06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7D06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7E06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF7F06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF8006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF8106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EF8206253B7D005AB5DA = { + children = ( + 1865EF8306253B7D005AB5DA, + 1865EF8406253B7D005AB5DA, + 1865EF8506253B7D005AB5DA, + 1865EF8606253B7D005AB5DA, + 1865EF8706253B7D005AB5DA, + 1865EF8806253B7D005AB5DA, + 1865EF8906253B7D005AB5DA, + 1865EF8A06253B7D005AB5DA, + 1865EF8B06253B7D005AB5DA, + 1865EF8C06253B7D005AB5DA, + 1865EF8D06253B7D005AB5DA, + 1865EF8E06253B7D005AB5DA, + 1865EF8F06253B7D005AB5DA, + 1865EF9006253B7D005AB5DA, + 1865EF9106253B7D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "camera.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8706253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs_common.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8A06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8B06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8C06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8D06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8E06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF8F06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF9006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF9106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF9206253B7D005AB5DA = { + children = ( + 1865EF9306253B7D005AB5DA, + 1865EF9406253B7D005AB5DA, + 1865EF9506253B7D005AB5DA, + 1865EF9606253B7D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EF9306253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF9406253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EF9506253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EF9606253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF9706253B7D005AB5DA = { + children = ( + 1865EF9806253B7D005AB5DA, + 1865EF9906253B7D005AB5DA, + 1865EF9A06253B7D005AB5DA, + 1865EF9B06253B7D005AB5DA, + 1865EF9C06253B7D005AB5DA, + 1865EF9D06253B7D005AB5DA, + 1865EF9E06253B7D005AB5DA, + 1865EF9F06253B7D005AB5DA, + 1865EFA006253B7D005AB5DA, + 1865EFA106253B7D005AB5DA, + 1865EFA206253B7D005AB5DA, + 1865EFA306253B7D005AB5DA, + 1865EFA406253B7D005AB5DA, + 1865EFA506253B7D005AB5DA, + 1865EFA606253B7D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EF9806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9A06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9B06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9C06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9D06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9E06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dialogs_common.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EF9F06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "funchandlers.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA206253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "listener.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "renderer.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFA706253B7D005AB5DA = { + children = ( + 1865EFA806253B7D005AB5DA, + 1865EFBB06253B7D005AB5DA, + ); + isa = PBXGroup; + path = bitmaps; + refType = 4; + sourceTree = ""; + }; + 1865EFA806253B7D005AB5DA = { + children = ( + 1865EFA906253B7D005AB5DA, + 1865EFAA06253B7D005AB5DA, + 1865EFAB06253B7D005AB5DA, + 1865EFAC06253B7D005AB5DA, + 1865EFAD06253B7D005AB5DA, + 1865EFAF06253B7D005AB5DA, + 1865EFB106253B7D005AB5DA, + 1865EFB206253B7D005AB5DA, + 1865EFB406253B7D005AB5DA, + 1865EFB906253B7D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EFA906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EFAA06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EFAB06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EFAC06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EFAD06253B7D005AB5DA = { + children = ( + 1865EFAE06253B7D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFAE06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera_insp.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFAF06253B7D005AB5DA = { + children = ( + 1865EFB006253B7D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EFB006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera_insp.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFB106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EFB206253B7D005AB5DA = { + children = ( + 1865EFB306253B7D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFB306253B7D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "camera_insp.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFB406253B7D005AB5DA = { + children = ( + 1865EFB506253B7D005AB5DA, + 1865EFB606253B7D005AB5DA, + 1865EFB706253B7D005AB5DA, + 1865EFB806253B7D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865EFB506253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFB606253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EFB706253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFB806253B7D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EFB906253B7D005AB5DA = { + children = ( + 1865EFBA06253B7D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865EFBA06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "camera_insp.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFBB06253B7D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = camera_insp.bmp; + refType = 4; + sourceTree = ""; + }; + 1865EFBC06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = camera.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFBD06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = camera.def; + refType = 4; + sourceTree = ""; + }; + 1865EFBE06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = camera.h; + refType = 4; + sourceTree = ""; + }; + 1865EFBF06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = camera.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865EFC006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dialogs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFC106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = dialogs.h; + refType = 4; + sourceTree = ""; + }; + 1865EFC206253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dialogs_common.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFC306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = funchandlers.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFC406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = funchandlers.h; + refType = 4; + sourceTree = ""; + }; + 1865EFC506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = listener.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFC606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = listener.h; + refType = 4; + sourceTree = ""; + }; + 1865EFC706253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = misc.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFC806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = misc.h; + refType = 4; + sourceTree = ""; + }; + 1865EFC906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = renderer.cpp; + refType = 4; + sourceTree = ""; + }; + 1865EFCA06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = renderer.h; + refType = 4; + sourceTree = ""; + }; + 1865EFCB06253B7D005AB5DA = { + children = ( + 1865EFCC06253B7D005AB5DA, + 1865EFCD06253B7D005AB5DA, + 1865F02406253B7E005AB5DA, + 1865F02506253B7E005AB5DA, + 1865F02606253B7E005AB5DA, + 1865F02706253B7E005AB5DA, + 1865F02806253B7E005AB5DA, + 1865F02906253B7E005AB5DA, + 1865F02A06253B7E005AB5DA, + 1865F02B06253B7E005AB5DA, + 1865F02C06253B7E005AB5DA, + 1865F02D06253B7E005AB5DA, + 1865F02E06253B7E005AB5DA, + 1865F02F06253B7E005AB5DA, + 1865F03006253B7E005AB5DA, + 1865F03106253B7E005AB5DA, + 1865F03206253B7E005AB5DA, + 1865F03306253B7E005AB5DA, + 1865F03406253B7E005AB5DA, + ); + isa = PBXGroup; + path = gtkgensurf; + refType = 4; + sourceTree = ""; + }; + 1865EFCC06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865EFCD06253B7D005AB5DA = { + children = ( + 1865EFCE06253B7D005AB5DA, + 1865EFCF06253B7D005AB5DA, + 1865EFD006253B7D005AB5DA, + 1865EFD106253B7D005AB5DA, + 1865EFD206253B7D005AB5DA, + 1865EFE506253B7E005AB5DA, + 1865EFF806253B7E005AB5DA, + 1865EFF906253B7E005AB5DA, + 1865F00C06253B7E005AB5DA, + 1865F01106253B7E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865EFCE06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865EFCF06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865EFD006253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865EFD106253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865EFD206253B7D005AB5DA = { + children = ( + 1865EFD306253B7D005AB5DA, + 1865EFD406253B7D005AB5DA, + 1865EFD506253B7D005AB5DA, + 1865EFD606253B7D005AB5DA, + 1865EFD706253B7D005AB5DA, + 1865EFD806253B7D005AB5DA, + 1865EFD906253B7D005AB5DA, + 1865EFDA06253B7D005AB5DA, + 1865EFDB06253B7D005AB5DA, + 1865EFDC06253B7D005AB5DA, + 1865EFDD06253B7E005AB5DA, + 1865EFDE06253B7E005AB5DA, + 1865EFDF06253B7E005AB5DA, + 1865EFE006253B7E005AB5DA, + 1865EFE106253B7E005AB5DA, + 1865EFE206253B7E005AB5DA, + 1865EFE306253B7E005AB5DA, + 1865EFE406253B7E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD306253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD406253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bitmap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD506253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD606253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dec.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD706253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "face.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD806253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "font.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFD906253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDA06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDB06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genmap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDC06253B7D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDD06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDE06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFDF06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkgensurf.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE006253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFE506253B7E005AB5DA = { + children = ( + 1865EFE606253B7E005AB5DA, + 1865EFE706253B7E005AB5DA, + 1865EFE806253B7E005AB5DA, + 1865EFE906253B7E005AB5DA, + 1865EFEA06253B7E005AB5DA, + 1865EFEB06253B7E005AB5DA, + 1865EFEC06253B7E005AB5DA, + 1865EFED06253B7E005AB5DA, + 1865EFEE06253B7E005AB5DA, + 1865EFEF06253B7E005AB5DA, + 1865EFF006253B7E005AB5DA, + 1865EFF106253B7E005AB5DA, + 1865EFF206253B7E005AB5DA, + 1865EFF306253B7E005AB5DA, + 1865EFF406253B7E005AB5DA, + 1865EFF506253B7E005AB5DA, + 1865EFF606253B7E005AB5DA, + 1865EFF706253B7E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865EFE606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFE706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bitmap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFE806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFE906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dec.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFEA06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "face.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFEB06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "font.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFEC06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFED06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFEE06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genmap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFEF06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF006253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkgensurf.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865EFF806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865EFF906253B7E005AB5DA = { + children = ( + 1865EFFA06253B7E005AB5DA, + 1865EFFB06253B7E005AB5DA, + 1865EFFC06253B7E005AB5DA, + 1865EFFD06253B7E005AB5DA, + 1865EFFE06253B7E005AB5DA, + 1865EFFF06253B7E005AB5DA, + 1865F00006253B7E005AB5DA, + 1865F00106253B7E005AB5DA, + 1865F00206253B7E005AB5DA, + 1865F00306253B7E005AB5DA, + 1865F00406253B7E005AB5DA, + 1865F00506253B7E005AB5DA, + 1865F00606253B7E005AB5DA, + 1865F00706253B7E005AB5DA, + 1865F00806253B7E005AB5DA, + 1865F00906253B7E005AB5DA, + 1865F00A06253B7E005AB5DA, + 1865F00B06253B7E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFA06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFB06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bitmap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFC06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFD06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dec.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFE06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "face.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865EFFF06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "font.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00006253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genmap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "gtkgensurf.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00C06253B7E005AB5DA = { + children = ( + 1865F00D06253B7E005AB5DA, + 1865F00E06253B7E005AB5DA, + 1865F00F06253B7E005AB5DA, + 1865F01006253B7E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F00D06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F00E06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F00F06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F01006253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F01106253B7E005AB5DA = { + children = ( + 1865F01206253B7E005AB5DA, + 1865F01306253B7E005AB5DA, + 1865F01406253B7E005AB5DA, + 1865F01506253B7E005AB5DA, + 1865F01606253B7E005AB5DA, + 1865F01706253B7E005AB5DA, + 1865F01806253B7E005AB5DA, + 1865F01906253B7E005AB5DA, + 1865F01A06253B7E005AB5DA, + 1865F01B06253B7E005AB5DA, + 1865F01C06253B7E005AB5DA, + 1865F01D06253B7E005AB5DA, + 1865F01E06253B7E005AB5DA, + 1865F01F06253B7E005AB5DA, + 1865F02006253B7E005AB5DA, + 1865F02106253B7E005AB5DA, + 1865F02206253B7E005AB5DA, + 1865F02306253B7E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F01206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bitmap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dec.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "face.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "font.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendlgs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genmap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gensurf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkgensurf.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F01F06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "heretic.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F02006253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F02106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F02206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "triangle.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F02306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "view.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F02406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = bitmap.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = CHANGES; + refType = 4; + sourceTree = ""; + }; + 1865F02606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = dec.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = face.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = font.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = gendlgs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gendlgs.h; + refType = 4; + sourceTree = ""; + }; + 1865F02B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = genmap.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = gensurf.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F02D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gensurf.def; + refType = 4; + sourceTree = ""; + }; + 1865F02E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gensurf.h; + refType = 4; + sourceTree = ""; + }; + 1865F02F06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = gtkgensurf.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F03006253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = heretic.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F03106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F03206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = triangle.c; + refType = 4; + sourceTree = ""; + }; + 1865F03306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = triangle.h; + refType = 4; + sourceTree = ""; + }; + 1865F03406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = view.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F03506253B7E005AB5DA = { + children = ( + 1865F03606253B7E005AB5DA, + 1865F05506253B7E005AB5DA, + 1865F05606253B7E005AB5DA, + 1865F05706253B7E005AB5DA, + 1865F05806253B7E005AB5DA, + ); + isa = PBXGroup; + path = hydratoolz; + refType = 4; + sourceTree = ""; + }; + 1865F03606253B7E005AB5DA = { + children = ( + 1865F03706253B7E005AB5DA, + 1865F03806253B7E005AB5DA, + 1865F03906253B7E005AB5DA, + 1865F03A06253B7E005AB5DA, + 1865F03B06253B7E005AB5DA, + 1865F04006253B7E005AB5DA, + 1865F04506253B7E005AB5DA, + 1865F04606253B7E005AB5DA, + 1865F04B06253B7E005AB5DA, + 1865F05006253B7E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F03706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F03806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F03906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F03A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F03B06253B7E005AB5DA = { + children = ( + 1865F03C06253B7E005AB5DA, + 1865F03D06253B7E005AB5DA, + 1865F03E06253B7E005AB5DA, + 1865F03F06253B7E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F03C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F03D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F03E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F03F06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04006253B7E005AB5DA = { + children = ( + 1865F04106253B7E005AB5DA, + 1865F04206253B7E005AB5DA, + 1865F04306253B7E005AB5DA, + 1865F04406253B7E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F04106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F04206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F04306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F04406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F04506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F04606253B7E005AB5DA = { + children = ( + 1865F04706253B7E005AB5DA, + 1865F04806253B7E005AB5DA, + 1865F04906253B7E005AB5DA, + 1865F04A06253B7E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "hydratoolz.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04906253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04B06253B7E005AB5DA = { + children = ( + 1865F04C06253B7E005AB5DA, + 1865F04D06253B7E005AB5DA, + 1865F04E06253B7E005AB5DA, + 1865F04F06253B7E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F04C06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04D06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F04E06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F04F06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F05006253B7E005AB5DA = { + children = ( + 1865F05106253B7E005AB5DA, + 1865F05206253B7E005AB5DA, + 1865F05306253B7E005AB5DA, + 1865F05406253B7E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F05106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F05206253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "hydratoolz.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F05306253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F05406253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F05506253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = hydratoolz.def; + refType = 4; + sourceTree = ""; + }; + 1865F05606253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = hydratoolz.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F05706253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F05806253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865F05906253B7E005AB5DA = { + children = ( + 1865F05A06253B7E005AB5DA, + 1865F06906253B7E005AB5DA, + ); + isa = PBXGroup; + path = patches; + refType = 4; + sourceTree = ""; + }; + 1865F05A06253B7E005AB5DA = { + children = ( + 1865F05B06253B7E005AB5DA, + 1865F05C06253B7E005AB5DA, + 1865F05D06253B7E005AB5DA, + 1865F05E06253B7E005AB5DA, + 1865F05F06253B7E005AB5DA, + 1865F06006253B7E005AB5DA, + 1865F06106253B7E005AB5DA, + 1865F06206253B7E005AB5DA, + 1865F06306253B7E005AB5DA, + 1865F06806253B7E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F05B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F05C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F05D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F05E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F05F06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F06006253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F06106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F06206253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F06306253B7E005AB5DA = { + children = ( + 1865F06406253B7E005AB5DA, + 1865F06506253B7E005AB5DA, + 1865F06606253B7E005AB5DA, + 1865F06706253B7E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F06406253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F06506253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F06606253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F06706253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F06806253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F06906253B7E005AB5DA = { + children = ( + 1865F06A06253B7E005AB5DA, + 1865F07906253B7E005AB5DA, + ); + isa = PBXGroup; + path = Gtk; + refType = 4; + sourceTree = ""; + }; + 1865F06A06253B7E005AB5DA = { + children = ( + 1865F06B06253B7E005AB5DA, + 1865F06C06253B7E005AB5DA, + 1865F06D06253B7E005AB5DA, + 1865F06E06253B7E005AB5DA, + 1865F06F06253B7E005AB5DA, + 1865F07006253B7E005AB5DA, + 1865F07106253B7E005AB5DA, + 1865F07206253B7E005AB5DA, + 1865F07306253B7E005AB5DA, + 1865F07806253B7E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F06B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F06C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F06D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F06E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F06F06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F07006253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F07106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F07206253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F07306253B7E005AB5DA = { + children = ( + 1865F07406253B7E005AB5DA, + 1865F07506253B7E005AB5DA, + 1865F07606253B7E005AB5DA, + 1865F07706253B7E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F07406253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F07506253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F07606253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F07706253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F07806253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F07906253B7E005AB5DA = { + children = ( + 1865F07A06253B7E005AB5DA, + ); + isa = PBXGroup; + path = fileselect; + refType = 4; + sourceTree = ""; + }; + 1865F07A06253B7E005AB5DA = { + children = ( + 1865F07B06253B7E005AB5DA, + 1865F07C06253B7E005AB5DA, + 1865F07D06253B7E005AB5DA, + 1865F07E06253B7E005AB5DA, + 1865F07F06253B7E005AB5DA, + 1865F08006253B7E005AB5DA, + 1865F08106253B7E005AB5DA, + 1865F08206253B7E005AB5DA, + 1865F08306253B7E005AB5DA, + 1865F08806253B7E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F07B06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F07C06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F07D06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F07E06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F07F06253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F08006253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F08106253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F08206253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F08306253B7E005AB5DA = { + children = ( + 1865F08406253B7E005AB5DA, + 1865F08506253B7E005AB5DA, + 1865F08606253B7E005AB5DA, + 1865F08706253B7E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F08406253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F08506253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F08606253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F08706253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F08806253B7E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F08906253B7E005AB5DA = { + children = ( + 1865F08A06253B7E005AB5DA, + 1865F08B06253B7E005AB5DA, + 1865F0EE06253B7F005AB5DA, + 1865F0EF06253B7F005AB5DA, + 1865F0F006253B7F005AB5DA, + 1865F0F106253B7F005AB5DA, + 1865F0F206253B7F005AB5DA, + 1865F0F306253B7F005AB5DA, + 1865F0F406253B7F005AB5DA, + 1865F0F506253B7F005AB5DA, + 1865F0F606253B80005AB5DA, + 1865F0F706253B80005AB5DA, + 1865F0F806253B80005AB5DA, + 1865F0F906253B80005AB5DA, + 1865F0FA06253B80005AB5DA, + 1865F0FB06253B80005AB5DA, + 1865F0FC06253B80005AB5DA, + 1865F0FD06253B80005AB5DA, + 1865F0FE06253B80005AB5DA, + 1865F0FF06253B80005AB5DA, + 1865F11406253B80005AB5DA, + 1865F11506253B80005AB5DA, + 1865F11606253B80005AB5DA, + ); + isa = PBXGroup; + path = prtview; + refType = 4; + sourceTree = ""; + }; + 1865F08A06253B7E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F08B06253B7E005AB5DA = { + children = ( + 1865F08C06253B7F005AB5DA, + 1865F08D06253B7F005AB5DA, + 1865F08E06253B7F005AB5DA, + 1865F08F06253B7F005AB5DA, + 1865F09006253B7F005AB5DA, + 1865F0A606253B7F005AB5DA, + 1865F0BC06253B7F005AB5DA, + 1865F0BD06253B7F005AB5DA, + 1865F0D306253B7F005AB5DA, + 1865F0D806253B7F005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F08C06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F08D06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F08E06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F08F06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F09006253B7F005AB5DA = { + children = ( + 1865F09106253B7F005AB5DA, + 1865F09206253B7F005AB5DA, + 1865F09306253B7F005AB5DA, + 1865F09406253B7F005AB5DA, + 1865F09506253B7F005AB5DA, + 1865F09606253B7F005AB5DA, + 1865F09706253B7F005AB5DA, + 1865F09806253B7F005AB5DA, + 1865F09906253B7F005AB5DA, + 1865F09A06253B7F005AB5DA, + 1865F09B06253B7F005AB5DA, + 1865F09C06253B7F005AB5DA, + 1865F09D06253B7F005AB5DA, + 1865F09E06253B7F005AB5DA, + 1865F09F06253B7F005AB5DA, + 1865F0A006253B7F005AB5DA, + 1865F0A106253B7F005AB5DA, + 1865F0A206253B7F005AB5DA, + 1865F0A306253B7F005AB5DA, + 1865F0A406253B7F005AB5DA, + 1865F0A506253B7F005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09606253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09706253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09806253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09906253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09A06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09B06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09C06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.aps.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09D06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09E06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F09F06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0A606253B7F005AB5DA = { + children = ( + 1865F0A706253B7F005AB5DA, + 1865F0A806253B7F005AB5DA, + 1865F0A906253B7F005AB5DA, + 1865F0AA06253B7F005AB5DA, + 1865F0AB06253B7F005AB5DA, + 1865F0AC06253B7F005AB5DA, + 1865F0AD06253B7F005AB5DA, + 1865F0AE06253B7F005AB5DA, + 1865F0AF06253B7F005AB5DA, + 1865F0B006253B7F005AB5DA, + 1865F0B106253B7F005AB5DA, + 1865F0B206253B7F005AB5DA, + 1865F0B306253B7F005AB5DA, + 1865F0B406253B7F005AB5DA, + 1865F0B506253B7F005AB5DA, + 1865F0B606253B7F005AB5DA, + 1865F0B706253B7F005AB5DA, + 1865F0B806253B7F005AB5DA, + 1865F0B906253B7F005AB5DA, + 1865F0BA06253B7F005AB5DA, + 1865F0BB06253B7F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F0A706253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0A806253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0A906253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AA06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AB06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AC06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AD06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AE06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0AF06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.aps.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B606253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B706253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B806253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0B906253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0BA06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0BB06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0BC06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F0BD06253B7F005AB5DA = { + children = ( + 1865F0BE06253B7F005AB5DA, + 1865F0BF06253B7F005AB5DA, + 1865F0C006253B7F005AB5DA, + 1865F0C106253B7F005AB5DA, + 1865F0C206253B7F005AB5DA, + 1865F0C306253B7F005AB5DA, + 1865F0C406253B7F005AB5DA, + 1865F0C506253B7F005AB5DA, + 1865F0C606253B7F005AB5DA, + 1865F0C706253B7F005AB5DA, + 1865F0C806253B7F005AB5DA, + 1865F0C906253B7F005AB5DA, + 1865F0CA06253B7F005AB5DA, + 1865F0CB06253B7F005AB5DA, + 1865F0CC06253B7F005AB5DA, + 1865F0CD06253B7F005AB5DA, + 1865F0CE06253B7F005AB5DA, + 1865F0CF06253B7F005AB5DA, + 1865F0D006253B7F005AB5DA, + 1865F0D106253B7F005AB5DA, + 1865F0D206253B7F005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0BE06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0BF06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C606253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C706253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C806253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0C906253B7F005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "PrtView.aps.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CA06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CB06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CC06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CD06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CE06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0CF06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "PrtView.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D306253B7F005AB5DA = { + children = ( + 1865F0D406253B7F005AB5DA, + 1865F0D506253B7F005AB5DA, + 1865F0D606253B7F005AB5DA, + 1865F0D706253B7F005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F0D406253B7F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D506253B7F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F0D606253B7F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F0D706253B7F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F0D806253B7F005AB5DA = { + children = ( + 1865F0D906253B7F005AB5DA, + 1865F0DA06253B7F005AB5DA, + 1865F0DB06253B7F005AB5DA, + 1865F0DC06253B7F005AB5DA, + 1865F0DD06253B7F005AB5DA, + 1865F0DE06253B7F005AB5DA, + 1865F0DF06253B7F005AB5DA, + 1865F0E006253B7F005AB5DA, + 1865F0E106253B7F005AB5DA, + 1865F0E206253B7F005AB5DA, + 1865F0E306253B7F005AB5DA, + 1865F0E406253B7F005AB5DA, + 1865F0E506253B7F005AB5DA, + 1865F0E606253B7F005AB5DA, + 1865F0E706253B7F005AB5DA, + 1865F0E806253B7F005AB5DA, + 1865F0E906253B7F005AB5DA, + 1865F0EA06253B7F005AB5DA, + 1865F0EB06253B7F005AB5DA, + 1865F0EC06253B7F005AB5DA, + 1865F0ED06253B7F005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F0D906253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DA06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DB06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "AboutDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DC06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DD06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ConfigDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DE06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0DF06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkdlgs.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "LoadPortalFileDialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "portals.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.aps.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E606253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E706253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "prtview.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E806253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0E906253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0EA06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0EB06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "resource.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0EC06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0ED06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stdafx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F0EE06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = AboutDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0EF06253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = AboutDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865F0F006253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = ConfigDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0F106253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ConfigDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865F0F206253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = gtkdlgs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0F306253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gtkdlgs.h; + refType = 4; + sourceTree = ""; + }; + 1865F0F406253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = LoadPortalFileDialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0F506253B7F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = LoadPortalFileDialog.h; + refType = 4; + sourceTree = ""; + }; + 1865F0F606253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = portals.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0F706253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = portals.h; + refType = 4; + sourceTree = ""; + }; + 1865F0F806253B80005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = PrtView.aps; + refType = 4; + sourceTree = ""; + }; + 1865F0F906253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = prtview.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F0FA06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = PrtView.def; + refType = 4; + sourceTree = ""; + }; + 1865F0FB06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = prtview.h; + refType = 4; + sourceTree = ""; + }; + 1865F0FC06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = PrtView.rc; + refType = 4; + sourceTree = ""; + }; + 1865F0FD06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = PrtView.txt; + refType = 4; + sourceTree = ""; + }; + 1865F0FE06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = PrtView.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F0FF06253B80005AB5DA = { + children = ( + 1865F10006253B80005AB5DA, + 1865F11306253B80005AB5DA, + ); + isa = PBXGroup; + path = res; + refType = 4; + sourceTree = ""; + }; + 1865F10006253B80005AB5DA = { + children = ( + 1865F10106253B80005AB5DA, + 1865F10206253B80005AB5DA, + 1865F10306253B80005AB5DA, + 1865F10406253B80005AB5DA, + 1865F10506253B80005AB5DA, + 1865F10706253B80005AB5DA, + 1865F10906253B80005AB5DA, + 1865F10A06253B80005AB5DA, + 1865F10C06253B80005AB5DA, + 1865F11106253B80005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F10106253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F10206253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F10306253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F10406253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F10506253B80005AB5DA = { + children = ( + 1865F10606253B80005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F10606253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc2.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F10706253B80005AB5DA = { + children = ( + 1865F10806253B80005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F10806253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc2.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F10906253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F10A06253B80005AB5DA = { + children = ( + 1865F10B06253B80005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F10B06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc2.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F10C06253B80005AB5DA = { + children = ( + 1865F10D06253B80005AB5DA, + 1865F10E06253B80005AB5DA, + 1865F10F06253B80005AB5DA, + 1865F11006253B80005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F10D06253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F10E06253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F10F06253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F11006253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F11106253B80005AB5DA = { + children = ( + 1865F11206253B80005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F11206253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PrtView.rc2.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F11306253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = PrtView.rc2; + refType = 4; + sourceTree = ""; + }; + 1865F11406253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = resource.h; + refType = 4; + sourceTree = ""; + }; + 1865F11506253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = stdafx.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F11606253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = stdafx.h; + refType = 4; + sourceTree = ""; + }; + 1865F11706253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = CONTRIBUTOR_AGREEMENT; + refType = 4; + sourceTree = ""; + }; + 1865F11806253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = CONTRIBUTORS; + refType = 4; + sourceTree = ""; + }; + 1865F11906253B80005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = text.rtf; + path = DarwinCompileInfo.rtf; + refType = 4; + sourceTree = ""; + }; + 1865F11A06253B80005AB5DA = { + children = ( + 1865F11B06253B80005AB5DA, + 1865F12A06253B80005AB5DA, + 1865F25206253B84005AB5DA, + ); + isa = PBXGroup; + path = docs; + refType = 4; + sourceTree = ""; + }; + 1865F11B06253B80005AB5DA = { + children = ( + 1865F11C06253B80005AB5DA, + 1865F11D06253B80005AB5DA, + 1865F11E06253B80005AB5DA, + 1865F11F06253B80005AB5DA, + 1865F12006253B80005AB5DA, + 1865F12106253B80005AB5DA, + 1865F12206253B80005AB5DA, + 1865F12306253B80005AB5DA, + 1865F12406253B80005AB5DA, + 1865F12906253B80005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F11C06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F11D06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F11E06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F11F06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F12006253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F12106253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F12206253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F12306253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F12406253B80005AB5DA = { + children = ( + 1865F12506253B80005AB5DA, + 1865F12606253B80005AB5DA, + 1865F12706253B80005AB5DA, + 1865F12806253B80005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F12506253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F12606253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F12706253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F12806253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F12906253B80005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F12A06253B80005AB5DA = { + children = ( + 1865F12B06253B80005AB5DA, + 1865F12C06253B80005AB5DA, + 1865F17706253B81005AB5DA, + 1865F17806253B81005AB5DA, + 1865F17906253B81005AB5DA, + 1865F17A06253B81005AB5DA, + 1865F17B06253B81005AB5DA, + 1865F17C06253B81005AB5DA, + 1865F17D06253B81005AB5DA, + 1865F17E06253B81005AB5DA, + 1865F1B606253B82005AB5DA, + 1865F1B706253B82005AB5DA, + 1865F1E006253B82005AB5DA, + 1865F1E106253B82005AB5DA, + 1865F1E206253B82005AB5DA, + 1865F21006253B83005AB5DA, + 1865F22506253B83005AB5DA, + 1865F22606253B83005AB5DA, + 1865F22706253B83005AB5DA, + 1865F22806253B83005AB5DA, + 1865F22906253B83005AB5DA, + ); + isa = PBXGroup; + path = developer; + refType = 4; + sourceTree = ""; + }; + 1865F12B06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F12C06253B80005AB5DA = { + children = ( + 1865F12D06253B80005AB5DA, + 1865F12E06253B80005AB5DA, + 1865F12F06253B80005AB5DA, + 1865F13006253B80005AB5DA, + 1865F13106253B80005AB5DA, + 1865F14106253B80005AB5DA, + 1865F15106253B81005AB5DA, + 1865F15206253B81005AB5DA, + 1865F16206253B81005AB5DA, + 1865F16706253B81005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F12D06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F12E06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F12F06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F13006253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F13106253B80005AB5DA = { + children = ( + 1865F13206253B80005AB5DA, + 1865F13306253B80005AB5DA, + 1865F13406253B80005AB5DA, + 1865F13506253B80005AB5DA, + 1865F13606253B80005AB5DA, + 1865F13706253B80005AB5DA, + 1865F13806253B80005AB5DA, + 1865F13906253B80005AB5DA, + 1865F13A06253B80005AB5DA, + 1865F13B06253B80005AB5DA, + 1865F13C06253B80005AB5DA, + 1865F13D06253B80005AB5DA, + 1865F13E06253B80005AB5DA, + 1865F13F06253B80005AB5DA, + 1865F14006253B80005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13206253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13306253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changes.201.202.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13406253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13506253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "d2u.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13606253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "data-driven-design.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13706253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DRAFT.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13806253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "frp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13906253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HEAP.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13A06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3mapfeedback.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13B06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TESTERS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13C06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13D06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32BETA.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13E06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32SETUP.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F13F06253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XML.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F14006253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLmap.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F14106253B80005AB5DA = { + children = ( + 1865F14206253B80005AB5DA, + 1865F14306253B80005AB5DA, + 1865F14406253B80005AB5DA, + 1865F14506253B80005AB5DA, + 1865F14606253B81005AB5DA, + 1865F14706253B81005AB5DA, + 1865F14806253B81005AB5DA, + 1865F14906253B81005AB5DA, + 1865F14A06253B81005AB5DA, + 1865F14B06253B81005AB5DA, + 1865F14C06253B81005AB5DA, + 1865F14D06253B81005AB5DA, + 1865F14E06253B81005AB5DA, + 1865F14F06253B81005AB5DA, + 1865F15006253B81005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F14206253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14306253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changes.201.202.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14406253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14506253B80005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "d2u.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14606253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "data-driven-design.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14706253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DRAFT.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14806253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "frp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14906253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HEAP.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14A06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3mapfeedback.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14B06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TESTERS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14C06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14D06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32BETA.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14E06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32SETUP.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F14F06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XML.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F15006253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLmap.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F15106253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F15206253B81005AB5DA = { + children = ( + 1865F15306253B81005AB5DA, + 1865F15406253B81005AB5DA, + 1865F15506253B81005AB5DA, + 1865F15606253B81005AB5DA, + 1865F15706253B81005AB5DA, + 1865F15806253B81005AB5DA, + 1865F15906253B81005AB5DA, + 1865F15A06253B81005AB5DA, + 1865F15B06253B81005AB5DA, + 1865F15C06253B81005AB5DA, + 1865F15D06253B81005AB5DA, + 1865F15E06253B81005AB5DA, + 1865F15F06253B81005AB5DA, + 1865F16006253B81005AB5DA, + 1865F16106253B81005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15306253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15406253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changes.201.202.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15506253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15606253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "d2u.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15706253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "data-driven-design.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15806253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DRAFT.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15906253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "frp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15A06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HEAP.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15B06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3mapfeedback.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15C06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TESTERS.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15D06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15E06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32BETA.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F15F06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32SETUP.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F16006253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XML.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F16106253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLmap.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F16206253B81005AB5DA = { + children = ( + 1865F16306253B81005AB5DA, + 1865F16406253B81005AB5DA, + 1865F16506253B81005AB5DA, + 1865F16606253B81005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F16306253B81005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F16406253B81005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F16506253B81005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F16606253B81005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F16706253B81005AB5DA = { + children = ( + 1865F16806253B81005AB5DA, + 1865F16906253B81005AB5DA, + 1865F16A06253B81005AB5DA, + 1865F16B06253B81005AB5DA, + 1865F16C06253B81005AB5DA, + 1865F16D06253B81005AB5DA, + 1865F16E06253B81005AB5DA, + 1865F16F06253B81005AB5DA, + 1865F17006253B81005AB5DA, + 1865F17106253B81005AB5DA, + 1865F17206253B81005AB5DA, + 1865F17306253B81005AB5DA, + 1865F17406253B81005AB5DA, + 1865F17506253B81005AB5DA, + 1865F17606253B81005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F16806253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16906253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "changes.201.202.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16A06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CHANGES.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16B06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "d2u.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16C06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "data-driven-design.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16D06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "DRAFT.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16E06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "frp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F16F06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "HEAP.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17006253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3mapfeedback.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17106253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TESTERS.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17206253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "TODO.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17306253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32BETA.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17406253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "WIN32SETUP.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17506253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XML.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17606253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLmap.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F17706253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = CHANGES; + refType = 4; + sourceTree = ""; + }; + 1865F17806253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = changes.201.202; + refType = 4; + sourceTree = ""; + }; + 1865F17906253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = d2u; + refType = 4; + sourceTree = ""; + }; + 1865F17A06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "data-driven-design.txt"; + refType = 4; + sourceTree = ""; + }; + 1865F17B06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = DRAFT; + refType = 4; + sourceTree = ""; + }; + 1865F17C06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = frp; + refType = 4; + sourceTree = ""; + }; + 1865F17D06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = HEAP; + refType = 4; + sourceTree = ""; + }; + 1865F17E06253B81005AB5DA = { + children = ( + 1865F17F06253B81005AB5DA, + 1865F1AE06253B82005AB5DA, + 1865F1AF06253B82005AB5DA, + 1865F1B006253B82005AB5DA, + 1865F1B106253B82005AB5DA, + 1865F1B206253B82005AB5DA, + 1865F1B306253B82005AB5DA, + 1865F1B406253B82005AB5DA, + 1865F1B506253B82005AB5DA, + ); + isa = PBXGroup; + path = Inspector; + refType = 4; + sourceTree = ""; + }; + 1865F17F06253B81005AB5DA = { + children = ( + 1865F18006253B81005AB5DA, + 1865F18106253B81005AB5DA, + 1865F18206253B81005AB5DA, + 1865F18306253B81005AB5DA, + 1865F18406253B81005AB5DA, + 1865F18D06253B81005AB5DA, + 1865F19606253B82005AB5DA, + 1865F19706253B82005AB5DA, + 1865F1A006253B82005AB5DA, + 1865F1A506253B82005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F18006253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F18106253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F18206253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F18306253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F18406253B81005AB5DA = { + children = ( + 1865F18506253B81005AB5DA, + 1865F18606253B81005AB5DA, + 1865F18706253B81005AB5DA, + 1865F18806253B81005AB5DA, + 1865F18906253B81005AB5DA, + 1865F18A06253B81005AB5DA, + 1865F18B06253B81005AB5DA, + 1865F18C06253B81005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18506253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classdiagram1.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18606253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "collaborationdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18706253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inspector.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18806253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.argo.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18906253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.xmi.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18A06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_classdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18B06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_collaborationdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18C06253B81005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_usecasediagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F18D06253B81005AB5DA = { + children = ( + 1865F18E06253B82005AB5DA, + 1865F18F06253B82005AB5DA, + 1865F19006253B82005AB5DA, + 1865F19106253B82005AB5DA, + 1865F19206253B82005AB5DA, + 1865F19306253B82005AB5DA, + 1865F19406253B82005AB5DA, + 1865F19506253B82005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F18E06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classdiagram1.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F18F06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "collaborationdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19006253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inspector.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19106253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.argo.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19206253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.xmi.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19306253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_classdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19406253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_collaborationdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19506253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_usecasediagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F19606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F19706253B82005AB5DA = { + children = ( + 1865F19806253B82005AB5DA, + 1865F19906253B82005AB5DA, + 1865F19A06253B82005AB5DA, + 1865F19B06253B82005AB5DA, + 1865F19C06253B82005AB5DA, + 1865F19D06253B82005AB5DA, + 1865F19E06253B82005AB5DA, + 1865F19F06253B82005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19806253B82005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "classdiagram1.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "collaborationdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19A06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inspector.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19B06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Inspectors.argo.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19C06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Inspectors.xmi.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19D06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Inspectors_classdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19E06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Inspectors_collaborationdiagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F19F06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Inspectors_usecasediagram1.pgml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1A006253B82005AB5DA = { + children = ( + 1865F1A106253B82005AB5DA, + 1865F1A206253B82005AB5DA, + 1865F1A306253B82005AB5DA, + 1865F1A406253B82005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F1A106253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1A206253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F1A306253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1A406253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F1A506253B82005AB5DA = { + children = ( + 1865F1A606253B82005AB5DA, + 1865F1A706253B82005AB5DA, + 1865F1A806253B82005AB5DA, + 1865F1A906253B82005AB5DA, + 1865F1AA06253B82005AB5DA, + 1865F1AB06253B82005AB5DA, + 1865F1AC06253B82005AB5DA, + 1865F1AD06253B82005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F1A606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classdiagram1.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1A706253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "collaborationdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1A806253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "inspector.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1A906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.argo.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1AA06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors.xmi.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1AB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_classdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1AC06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_collaborationdiagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1AD06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Inspectors_usecasediagram1.pgml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1AE06253B82005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = classdiagram1.gif; + refType = 4; + sourceTree = ""; + }; + 1865F1AF06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = collaborationdiagram1.pgml; + refType = 4; + sourceTree = ""; + }; + 1865F1B006253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = inspector.txt; + refType = 4; + sourceTree = ""; + }; + 1865F1B106253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Inspectors.argo; + refType = 4; + sourceTree = ""; + }; + 1865F1B206253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Inspectors.xmi; + refType = 4; + sourceTree = ""; + }; + 1865F1B306253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Inspectors_classdiagram1.pgml; + refType = 4; + sourceTree = ""; + }; + 1865F1B406253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Inspectors_collaborationdiagram1.pgml; + refType = 4; + sourceTree = ""; + }; + 1865F1B506253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Inspectors_usecasediagram1.pgml; + refType = 4; + sourceTree = ""; + }; + 1865F1B606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3mapfeedback.txt; + refType = 4; + sourceTree = ""; + }; + 1865F1B706253B82005AB5DA = { + children = ( + 1865F1B806253B82005AB5DA, + 1865F1DB06253B82005AB5DA, + 1865F1DC06253B82005AB5DA, + 1865F1DD06253B82005AB5DA, + 1865F1DE06253B82005AB5DA, + 1865F1DF06253B82005AB5DA, + ); + isa = PBXGroup; + path = RegExp; + refType = 4; + sourceTree = ""; + }; + 1865F1B806253B82005AB5DA = { + children = ( + 1865F1B906253B82005AB5DA, + 1865F1BA06253B82005AB5DA, + 1865F1BB06253B82005AB5DA, + 1865F1BC06253B82005AB5DA, + 1865F1BD06253B82005AB5DA, + 1865F1C306253B82005AB5DA, + 1865F1C906253B82005AB5DA, + 1865F1CA06253B82005AB5DA, + 1865F1D006253B82005AB5DA, + 1865F1D506253B82005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F1B906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F1BA06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F1BB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F1BC06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F1BD06253B82005AB5DA = { + children = ( + 1865F1BE06253B82005AB5DA, + 1865F1BF06253B82005AB5DA, + 1865F1C006253B82005AB5DA, + 1865F1C106253B82005AB5DA, + 1865F1C206253B82005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1BE06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.cleaned.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1BF06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1C006253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pattern.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1C106253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "replace.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1C206253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tstscrpt.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1C306253B82005AB5DA = { + children = ( + 1865F1C406253B82005AB5DA, + 1865F1C506253B82005AB5DA, + 1865F1C606253B82005AB5DA, + 1865F1C706253B82005AB5DA, + 1865F1C806253B82005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F1C406253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.cleaned.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1C506253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1C606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pattern.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1C706253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "replace.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1C806253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tstscrpt.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1C906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F1CA06253B82005AB5DA = { + children = ( + 1865F1CB06253B82005AB5DA, + 1865F1CC06253B82005AB5DA, + 1865F1CD06253B82005AB5DA, + 1865F1CE06253B82005AB5DA, + 1865F1CF06253B82005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1CB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.cleaned.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1CC06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1CD06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pattern.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1CE06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "replace.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1CF06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tstscrpt.pl.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1D006253B82005AB5DA = { + children = ( + 1865F1D106253B82005AB5DA, + 1865F1D206253B82005AB5DA, + 1865F1D306253B82005AB5DA, + 1865F1D406253B82005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F1D106253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1D206253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F1D306253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1D406253B82005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F1D506253B82005AB5DA = { + children = ( + 1865F1D606253B82005AB5DA, + 1865F1D706253B82005AB5DA, + 1865F1D806253B82005AB5DA, + 1865F1D906253B82005AB5DA, + 1865F1DA06253B82005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F1D606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.cleaned.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1D706253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Go.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1D806253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pattern.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1D906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "replace.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1DA06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "tstscrpt.pl.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1DB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Go; + refType = 4; + sourceTree = ""; + }; + 1865F1DC06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Go.cleaned; + refType = 4; + sourceTree = ""; + }; + 1865F1DD06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = pattern; + refType = 4; + sourceTree = ""; + }; + 1865F1DE06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = replace.pl; + refType = 4; + sourceTree = ""; + }; + 1865F1DF06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.perl; + path = tstscrpt.pl; + refType = 4; + sourceTree = ""; + }; + 1865F1E006253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TESTERS; + refType = 4; + sourceTree = ""; + }; + 1865F1E106253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = TODO; + refType = 4; + sourceTree = ""; + }; + 1865F1E206253B82005AB5DA = { + children = ( + 1865F1E306253B82005AB5DA, + 1865F20A06253B83005AB5DA, + 1865F20B06253B83005AB5DA, + 1865F20C06253B83005AB5DA, + 1865F20D06253B83005AB5DA, + 1865F20E06253B83005AB5DA, + 1865F20F06253B83005AB5DA, + ); + isa = PBXGroup; + path = TstMaps; + refType = 4; + sourceTree = ""; + }; + 1865F1E306253B82005AB5DA = { + children = ( + 1865F1E406253B82005AB5DA, + 1865F1E506253B82005AB5DA, + 1865F1E606253B82005AB5DA, + 1865F1E706253B82005AB5DA, + 1865F1E806253B82005AB5DA, + 1865F1EF06253B82005AB5DA, + 1865F1F606253B82005AB5DA, + 1865F1F706253B82005AB5DA, + 1865F1FE06253B83005AB5DA, + 1865F20306253B83005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F1E406253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F1E506253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F1E606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F1E706253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F1E806253B82005AB5DA = { + children = ( + 1865F1E906253B82005AB5DA, + 1865F1EA06253B82005AB5DA, + 1865F1EB06253B82005AB5DA, + 1865F1EC06253B82005AB5DA, + 1865F1ED06253B82005AB5DA, + 1865F1EE06253B82005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1E906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Desktop_pb_leaf.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1EA06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "komap1.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1EB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "realloc.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1EC06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sput.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1ED06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ttq3dm3.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1EE06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "western.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1EF06253B82005AB5DA = { + children = ( + 1865F1F006253B82005AB5DA, + 1865F1F106253B82005AB5DA, + 1865F1F206253B82005AB5DA, + 1865F1F306253B82005AB5DA, + 1865F1F406253B82005AB5DA, + 1865F1F506253B82005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F1F006253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Desktop_pb_leaf.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F106253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "komap1.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F206253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "realloc.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F306253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sput.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F406253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ttq3dm3.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F506253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "western.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F1F606253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F1F706253B82005AB5DA = { + children = ( + 1865F1F806253B82005AB5DA, + 1865F1F906253B82005AB5DA, + 1865F1FA06253B82005AB5DA, + 1865F1FB06253B82005AB5DA, + 1865F1FC06253B83005AB5DA, + 1865F1FD06253B83005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1F806253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Desktop_pb_leaf.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1F906253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "komap1.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1FA06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "realloc.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1FB06253B82005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sput.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1FC06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ttq3dm3.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1FD06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "western.map.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F1FE06253B83005AB5DA = { + children = ( + 1865F1FF06253B83005AB5DA, + 1865F20006253B83005AB5DA, + 1865F20106253B83005AB5DA, + 1865F20206253B83005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F1FF06253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F20006253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F20106253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F20206253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F20306253B83005AB5DA = { + children = ( + 1865F20406253B83005AB5DA, + 1865F20506253B83005AB5DA, + 1865F20606253B83005AB5DA, + 1865F20706253B83005AB5DA, + 1865F20806253B83005AB5DA, + 1865F20906253B83005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F20406253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Desktop_pb_leaf.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20506253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "komap1.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20606253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "realloc.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20706253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sput.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20806253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ttq3dm3.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20906253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "western.map.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F20A06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Desktop_pb_leaf.map; + refType = 4; + sourceTree = ""; + }; + 1865F20B06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = komap1.map; + refType = 4; + sourceTree = ""; + }; + 1865F20C06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = realloc.map; + refType = 4; + sourceTree = ""; + }; + 1865F20D06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = sput.map; + refType = 4; + sourceTree = ""; + }; + 1865F20E06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ttq3dm3.map; + refType = 4; + sourceTree = ""; + }; + 1865F20F06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = western.map; + refType = 4; + sourceTree = ""; + }; + 1865F21006253B83005AB5DA = { + children = ( + 1865F21106253B83005AB5DA, + 1865F22406253B83005AB5DA, + ); + isa = PBXGroup; + path = UML; + refType = 4; + sourceTree = ""; + }; + 1865F21106253B83005AB5DA = { + children = ( + 1865F21206253B83005AB5DA, + 1865F21306253B83005AB5DA, + 1865F21406253B83005AB5DA, + 1865F21506253B83005AB5DA, + 1865F21606253B83005AB5DA, + 1865F21806253B83005AB5DA, + 1865F21A06253B83005AB5DA, + 1865F21B06253B83005AB5DA, + 1865F21D06253B83005AB5DA, + 1865F22206253B83005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F21206253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F21306253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F21406253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F21506253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F21606253B83005AB5DA = { + children = ( + 1865F21706253B83005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F21706253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modules.zargo.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F21806253B83005AB5DA = { + children = ( + 1865F21906253B83005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F21906253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modules.zargo.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F21A06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F21B06253B83005AB5DA = { + children = ( + 1865F21C06253B83005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F21C06253B83005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "modules.zargo.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F21D06253B83005AB5DA = { + children = ( + 1865F21E06253B83005AB5DA, + 1865F21F06253B83005AB5DA, + 1865F22006253B83005AB5DA, + 1865F22106253B83005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F21E06253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F21F06253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F22006253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F22106253B83005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F22206253B83005AB5DA = { + children = ( + 1865F22306253B83005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F22306253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modules.zargo.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F22406253B83005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = modules.zargo; + refType = 4; + sourceTree = ""; + }; + 1865F22506253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = WIN32BETA; + refType = 4; + sourceTree = ""; + }; + 1865F22606253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = WIN32SETUP; + refType = 4; + sourceTree = ""; + }; + 1865F22706253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = XML.txt; + refType = 4; + sourceTree = ""; + }; + 1865F22806253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = XMLmap.txt; + refType = 4; + sourceTree = ""; + }; + 1865F22906253B83005AB5DA = { + children = ( + 1865F22A06253B83005AB5DA, + 1865F24D06253B84005AB5DA, + 1865F24E06253B84005AB5DA, + 1865F24F06253B84005AB5DA, + 1865F25006253B84005AB5DA, + 1865F25106253B84005AB5DA, + ); + isa = PBXGroup; + path = XMLPush; + refType = 4; + sourceTree = ""; + }; + 1865F22A06253B83005AB5DA = { + children = ( + 1865F22B06253B83005AB5DA, + 1865F22C06253B83005AB5DA, + 1865F22D06253B83005AB5DA, + 1865F22E06253B83005AB5DA, + 1865F22F06253B83005AB5DA, + 1865F23506253B83005AB5DA, + 1865F23B06253B84005AB5DA, + 1865F23C06253B84005AB5DA, + 1865F24206253B84005AB5DA, + 1865F24706253B84005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F22B06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F22C06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F22D06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F22E06253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F22F06253B83005AB5DA = { + children = ( + 1865F23006253B83005AB5DA, + 1865F23106253B83005AB5DA, + 1865F23206253B83005AB5DA, + 1865F23306253B83005AB5DA, + 1865F23406253B83005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23006253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ReadMe.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23106253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23206253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23306253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLDump.xml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23406253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLPush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23506253B83005AB5DA = { + children = ( + 1865F23606253B83005AB5DA, + 1865F23706253B83005AB5DA, + 1865F23806253B83005AB5DA, + 1865F23906253B83005AB5DA, + 1865F23A06253B84005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F23606253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ReadMe.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F23706253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F23806253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F23906253B83005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLDump.xml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F23A06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLPush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F23B06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F23C06253B84005AB5DA = { + children = ( + 1865F23D06253B84005AB5DA, + 1865F23E06253B84005AB5DA, + 1865F23F06253B84005AB5DA, + 1865F24006253B84005AB5DA, + 1865F24106253B84005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23D06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ReadMe.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23E06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F23F06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F24006253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "XMLDump.xml.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F24106253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLPush.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F24206253B84005AB5DA = { + children = ( + 1865F24306253B84005AB5DA, + 1865F24406253B84005AB5DA, + 1865F24506253B84005AB5DA, + 1865F24606253B84005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F24306253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F24406253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F24506253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F24606253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F24706253B84005AB5DA = { + children = ( + 1865F24806253B84005AB5DA, + 1865F24906253B84005AB5DA, + 1865F24A06253B84005AB5DA, + 1865F24B06253B84005AB5DA, + 1865F24C06253B84005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F24806253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ReadMe.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F24906253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F24A06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "StdAfx.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F24B06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLDump.xml.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F24C06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "XMLPush.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F24D06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ReadMe.txt; + refType = 4; + sourceTree = ""; + }; + 1865F24E06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = StdAfx.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F24F06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = StdAfx.h; + refType = 4; + sourceTree = ""; + }; + 1865F25006253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = XMLDump.xml; + refType = 4; + sourceTree = ""; + }; + 1865F25106253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = XMLPush.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F25206253B84005AB5DA = { + children = ( + 1865F25306253B84005AB5DA, + 1865F26206253B84005AB5DA, + 1865F47606253B8C005AB5DA, + ); + isa = PBXGroup; + path = manual; + refType = 4; + sourceTree = ""; + }; + 1865F25306253B84005AB5DA = { + children = ( + 1865F25406253B84005AB5DA, + 1865F25506253B84005AB5DA, + 1865F25606253B84005AB5DA, + 1865F25706253B84005AB5DA, + 1865F25806253B84005AB5DA, + 1865F25906253B84005AB5DA, + 1865F25A06253B84005AB5DA, + 1865F25B06253B84005AB5DA, + 1865F25C06253B84005AB5DA, + 1865F26106253B84005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F25406253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F25506253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F25606253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F25706253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F25806253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F25906253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F25A06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F25B06253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F25C06253B84005AB5DA = { + children = ( + 1865F25D06253B84005AB5DA, + 1865F25E06253B84005AB5DA, + 1865F25F06253B84005AB5DA, + 1865F26006253B84005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F25D06253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F25E06253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F25F06253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F26006253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F26106253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F26206253B84005AB5DA = { + children = ( + 1865F26306253B84005AB5DA, + 1865F27606253B85005AB5DA, + 1865F2D106253B86005AB5DA, + 1865F2EB06253B86005AB5DA, + 1865F30006253B87005AB5DA, + 1865F31506253B87005AB5DA, + 1865F32A06253B87005AB5DA, + 1865F33F06253B87005AB5DA, + 1865F35406253B88005AB5DA, + 1865F36906253B88005AB5DA, + 1865F37E06253B88005AB5DA, + 1865F39306253B89005AB5DA, + 1865F3A806253B89005AB5DA, + 1865F3BD06253B89005AB5DA, + 1865F3D206253B8A005AB5DA, + 1865F3E706253B8A005AB5DA, + 1865F3E806253B8A005AB5DA, + 1865F46106253B8C005AB5DA, + ); + isa = PBXGroup; + path = Q3Rad_Manual; + refType = 4; + sourceTree = ""; + }; + 1865F26306253B84005AB5DA = { + children = ( + 1865F26406253B84005AB5DA, + 1865F26506253B84005AB5DA, + 1865F26606253B84005AB5DA, + 1865F26706253B84005AB5DA, + 1865F26806253B84005AB5DA, + 1865F26A06253B84005AB5DA, + 1865F26C06253B84005AB5DA, + 1865F26D06253B84005AB5DA, + 1865F26F06253B84005AB5DA, + 1865F27406253B84005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F26406253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F26506253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F26606253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F26706253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F26806253B84005AB5DA = { + children = ( + 1865F26906253B84005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F26906253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F26A06253B84005AB5DA = { + children = ( + 1865F26B06253B84005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F26B06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F26C06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F26D06253B84005AB5DA = { + children = ( + 1865F26E06253B84005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F26E06253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F26F06253B84005AB5DA = { + children = ( + 1865F27006253B84005AB5DA, + 1865F27106253B84005AB5DA, + 1865F27206253B84005AB5DA, + 1865F27306253B84005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F27006253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F27106253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F27206253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F27306253B84005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F27406253B84005AB5DA = { + children = ( + 1865F27506253B84005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F27506253B84005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F27606253B85005AB5DA = { + children = ( + 1865F27706253B85005AB5DA, + 1865F2C206253B86005AB5DA, + 1865F2C306253B86005AB5DA, + 1865F2C406253B86005AB5DA, + 1865F2C506253B86005AB5DA, + 1865F2C606253B86005AB5DA, + 1865F2C706253B86005AB5DA, + 1865F2C806253B86005AB5DA, + 1865F2C906253B86005AB5DA, + 1865F2CA06253B86005AB5DA, + 1865F2CB06253B86005AB5DA, + 1865F2CC06253B86005AB5DA, + 1865F2CD06253B86005AB5DA, + 1865F2CE06253B86005AB5DA, + 1865F2CF06253B86005AB5DA, + 1865F2D006253B86005AB5DA, + ); + isa = PBXGroup; + path = appndx; + refType = 4; + sourceTree = ""; + }; + 1865F27706253B85005AB5DA = { + children = ( + 1865F27806253B85005AB5DA, + 1865F27906253B85005AB5DA, + 1865F27A06253B85005AB5DA, + 1865F27B06253B85005AB5DA, + 1865F27C06253B85005AB5DA, + 1865F28C06253B85005AB5DA, + 1865F29C06253B85005AB5DA, + 1865F29D06253B85005AB5DA, + 1865F2AD06253B85005AB5DA, + 1865F2B206253B85005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F27806253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F27906253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F27A06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F27B06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F27C06253B85005AB5DA = { + children = ( + 1865F27D06253B85005AB5DA, + 1865F27E06253B85005AB5DA, + 1865F27F06253B85005AB5DA, + 1865F28006253B85005AB5DA, + 1865F28106253B85005AB5DA, + 1865F28206253B85005AB5DA, + 1865F28306253B85005AB5DA, + 1865F28406253B85005AB5DA, + 1865F28506253B85005AB5DA, + 1865F28606253B85005AB5DA, + 1865F28706253B85005AB5DA, + 1865F28806253B85005AB5DA, + 1865F28906253B85005AB5DA, + 1865F28A06253B85005AB5DA, + 1865F28B06253B85005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F27D06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_a.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F27E06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F27F06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_2.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28006253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_3.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28106253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_4.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28206253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_5.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28306253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_6.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28406253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_7.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28506253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_8.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28606253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_9.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28706253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_c.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28806253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_d.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28906253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_e.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28A06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_f.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28B06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sskey_dl.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F28C06253B85005AB5DA = { + children = ( + 1865F28D06253B85005AB5DA, + 1865F28E06253B85005AB5DA, + 1865F28F06253B85005AB5DA, + 1865F29006253B85005AB5DA, + 1865F29106253B85005AB5DA, + 1865F29206253B85005AB5DA, + 1865F29306253B85005AB5DA, + 1865F29406253B85005AB5DA, + 1865F29506253B85005AB5DA, + 1865F29606253B85005AB5DA, + 1865F29706253B85005AB5DA, + 1865F29806253B85005AB5DA, + 1865F29906253B85005AB5DA, + 1865F29A06253B85005AB5DA, + 1865F29B06253B85005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F28D06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_a.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F28E06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F28F06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_2.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29006253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_3.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29106253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_4.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29206253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_5.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29306253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_6.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29406253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_7.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29506253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_8.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29606253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_9.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29706253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_c.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29806253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_d.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29906253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_e.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29A06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_f.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29B06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sskey_dl.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F29C06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F29D06253B85005AB5DA = { + children = ( + 1865F29E06253B85005AB5DA, + 1865F29F06253B85005AB5DA, + 1865F2A006253B85005AB5DA, + 1865F2A106253B85005AB5DA, + 1865F2A206253B85005AB5DA, + 1865F2A306253B85005AB5DA, + 1865F2A406253B85005AB5DA, + 1865F2A506253B85005AB5DA, + 1865F2A606253B85005AB5DA, + 1865F2A706253B85005AB5DA, + 1865F2A806253B85005AB5DA, + 1865F2A906253B85005AB5DA, + 1865F2AA06253B85005AB5DA, + 1865F2AB06253B85005AB5DA, + 1865F2AC06253B85005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F29E06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_a.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F29F06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A006253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_2.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A106253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_3.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A206253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_4.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A306253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_5.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A406253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_6.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A506253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_7.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A606253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_8.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A706253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_9.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A806253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_c.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2A906253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_d.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2AA06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_e.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2AB06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_f.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2AC06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sskey_dl.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2AD06253B85005AB5DA = { + children = ( + 1865F2AE06253B85005AB5DA, + 1865F2AF06253B85005AB5DA, + 1865F2B006253B85005AB5DA, + 1865F2B106253B85005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F2AE06253B85005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2AF06253B85005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F2B006253B85005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2B106253B85005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2B206253B85005AB5DA = { + children = ( + 1865F2B306253B85005AB5DA, + 1865F2B406253B85005AB5DA, + 1865F2B506253B85005AB5DA, + 1865F2B606253B85005AB5DA, + 1865F2B706253B85005AB5DA, + 1865F2B806253B85005AB5DA, + 1865F2B906253B85005AB5DA, + 1865F2BA06253B85005AB5DA, + 1865F2BB06253B85005AB5DA, + 1865F2BC06253B85005AB5DA, + 1865F2BD06253B85005AB5DA, + 1865F2BE06253B86005AB5DA, + 1865F2BF06253B86005AB5DA, + 1865F2C006253B86005AB5DA, + 1865F2C106253B86005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2B306253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_a.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B406253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B506253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_2.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B606253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_3.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B706253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_4.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B806253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_5.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2B906253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_6.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BA06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_7.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BB06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_8.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BC06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_b_9.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BD06253B85005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_c.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BE06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_d.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2BF06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_e.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2C006253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appn_f.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2C106253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "sskey_dl.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2C206253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_a.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C306253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C406253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_2.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C506253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_3.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C606253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_4.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C706253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_5.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C806253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_6.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2C906253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_7.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CA06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_8.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CB06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_b_9.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CC06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_c.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CD06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_d.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CE06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_e.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2CF06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appn_f.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2D006253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = sskey_dl.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2D106253B86005AB5DA = { + children = ( + 1865F2D206253B86005AB5DA, + 1865F2E906253B86005AB5DA, + 1865F2EA06253B86005AB5DA, + ); + isa = PBXGroup; + path = ch01; + refType = 4; + sourceTree = ""; + }; + 1865F2D206253B86005AB5DA = { + children = ( + 1865F2D306253B86005AB5DA, + 1865F2D406253B86005AB5DA, + 1865F2D506253B86005AB5DA, + 1865F2D606253B86005AB5DA, + 1865F2D706253B86005AB5DA, + 1865F2DA06253B86005AB5DA, + 1865F2DD06253B86005AB5DA, + 1865F2DE06253B86005AB5DA, + 1865F2E106253B86005AB5DA, + 1865F2E606253B86005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F2D306253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F2D406253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F2D506253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F2D606253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F2D706253B86005AB5DA = { + children = ( + 1865F2D806253B86005AB5DA, + 1865F2D906253B86005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2D806253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2D906253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_2.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2DA06253B86005AB5DA = { + children = ( + 1865F2DB06253B86005AB5DA, + 1865F2DC06253B86005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F2DB06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2DC06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_2.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2DD06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F2DE06253B86005AB5DA = { + children = ( + 1865F2DF06253B86005AB5DA, + 1865F2E006253B86005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2DF06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2E006253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_2.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2E106253B86005AB5DA = { + children = ( + 1865F2E206253B86005AB5DA, + 1865F2E306253B86005AB5DA, + 1865F2E406253B86005AB5DA, + 1865F2E506253B86005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F2E206253B86005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2E306253B86005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F2E406253B86005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2E506253B86005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2E606253B86005AB5DA = { + children = ( + 1865F2E706253B86005AB5DA, + 1865F2E806253B86005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2E706253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2E806253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_2.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2E906253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg1_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2EA06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg1_2.htm; + refType = 4; + sourceTree = ""; + }; + 1865F2EB06253B86005AB5DA = { + children = ( + 1865F2EC06253B86005AB5DA, + 1865F2FF06253B87005AB5DA, + ); + isa = PBXGroup; + path = ch02; + refType = 4; + sourceTree = ""; + }; + 1865F2EC06253B86005AB5DA = { + children = ( + 1865F2ED06253B86005AB5DA, + 1865F2EE06253B86005AB5DA, + 1865F2EF06253B86005AB5DA, + 1865F2F006253B86005AB5DA, + 1865F2F106253B86005AB5DA, + 1865F2F306253B87005AB5DA, + 1865F2F506253B87005AB5DA, + 1865F2F606253B87005AB5DA, + 1865F2F806253B87005AB5DA, + 1865F2FD06253B87005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F2ED06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F2EE06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F2EF06253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F2F006253B86005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F2F106253B86005AB5DA = { + children = ( + 1865F2F206253B87005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2F206253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2F306253B87005AB5DA = { + children = ( + 1865F2F406253B87005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F2F406253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2F506253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F2F606253B87005AB5DA = { + children = ( + 1865F2F706253B87005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2F706253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2F806253B87005AB5DA = { + children = ( + 1865F2F906253B87005AB5DA, + 1865F2FA06253B87005AB5DA, + 1865F2FB06253B87005AB5DA, + 1865F2FC06253B87005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F2F906253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2FA06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F2FB06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F2FC06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2FD06253B87005AB5DA = { + children = ( + 1865F2FE06253B87005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F2FE06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F2FF06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg2_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F30006253B87005AB5DA = { + children = ( + 1865F30106253B87005AB5DA, + 1865F31406253B87005AB5DA, + ); + isa = PBXGroup; + path = ch03; + refType = 4; + sourceTree = ""; + }; + 1865F30106253B87005AB5DA = { + children = ( + 1865F30206253B87005AB5DA, + 1865F30306253B87005AB5DA, + 1865F30406253B87005AB5DA, + 1865F30506253B87005AB5DA, + 1865F30606253B87005AB5DA, + 1865F30806253B87005AB5DA, + 1865F30A06253B87005AB5DA, + 1865F30B06253B87005AB5DA, + 1865F30D06253B87005AB5DA, + 1865F31206253B87005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F30206253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F30306253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F30406253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F30506253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F30606253B87005AB5DA = { + children = ( + 1865F30706253B87005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F30706253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F30806253B87005AB5DA = { + children = ( + 1865F30906253B87005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F30906253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F30A06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F30B06253B87005AB5DA = { + children = ( + 1865F30C06253B87005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F30C06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F30D06253B87005AB5DA = { + children = ( + 1865F30E06253B87005AB5DA, + 1865F30F06253B87005AB5DA, + 1865F31006253B87005AB5DA, + 1865F31106253B87005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F30E06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F30F06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F31006253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F31106253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F31206253B87005AB5DA = { + children = ( + 1865F31306253B87005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F31306253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F31406253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg3_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F31506253B87005AB5DA = { + children = ( + 1865F31606253B87005AB5DA, + 1865F32906253B87005AB5DA, + ); + isa = PBXGroup; + path = ch04; + refType = 4; + sourceTree = ""; + }; + 1865F31606253B87005AB5DA = { + children = ( + 1865F31706253B87005AB5DA, + 1865F31806253B87005AB5DA, + 1865F31906253B87005AB5DA, + 1865F31A06253B87005AB5DA, + 1865F31B06253B87005AB5DA, + 1865F31D06253B87005AB5DA, + 1865F31F06253B87005AB5DA, + 1865F32006253B87005AB5DA, + 1865F32206253B87005AB5DA, + 1865F32706253B87005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F31706253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F31806253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F31906253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F31A06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F31B06253B87005AB5DA = { + children = ( + 1865F31C06253B87005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F31C06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F31D06253B87005AB5DA = { + children = ( + 1865F31E06253B87005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F31E06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F31F06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F32006253B87005AB5DA = { + children = ( + 1865F32106253B87005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F32106253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F32206253B87005AB5DA = { + children = ( + 1865F32306253B87005AB5DA, + 1865F32406253B87005AB5DA, + 1865F32506253B87005AB5DA, + 1865F32606253B87005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F32306253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F32406253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F32506253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F32606253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F32706253B87005AB5DA = { + children = ( + 1865F32806253B87005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F32806253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F32906253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg4_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F32A06253B87005AB5DA = { + children = ( + 1865F32B06253B87005AB5DA, + 1865F33E06253B87005AB5DA, + ); + isa = PBXGroup; + path = ch05; + refType = 4; + sourceTree = ""; + }; + 1865F32B06253B87005AB5DA = { + children = ( + 1865F32C06253B87005AB5DA, + 1865F32D06253B87005AB5DA, + 1865F32E06253B87005AB5DA, + 1865F32F06253B87005AB5DA, + 1865F33006253B87005AB5DA, + 1865F33206253B87005AB5DA, + 1865F33406253B87005AB5DA, + 1865F33506253B87005AB5DA, + 1865F33706253B87005AB5DA, + 1865F33C06253B87005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F32C06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F32D06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F32E06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F32F06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F33006253B87005AB5DA = { + children = ( + 1865F33106253B87005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33106253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33206253B87005AB5DA = { + children = ( + 1865F33306253B87005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F33306253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F33406253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F33506253B87005AB5DA = { + children = ( + 1865F33606253B87005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33606253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33706253B87005AB5DA = { + children = ( + 1865F33806253B87005AB5DA, + 1865F33906253B87005AB5DA, + 1865F33A06253B87005AB5DA, + 1865F33B06253B87005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F33806253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33906253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F33A06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F33B06253B87005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F33C06253B87005AB5DA = { + children = ( + 1865F33D06253B87005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F33D06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F33E06253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg5_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F33F06253B87005AB5DA = { + children = ( + 1865F34006253B87005AB5DA, + 1865F35306253B88005AB5DA, + ); + isa = PBXGroup; + path = ch06; + refType = 4; + sourceTree = ""; + }; + 1865F34006253B87005AB5DA = { + children = ( + 1865F34106253B87005AB5DA, + 1865F34206253B87005AB5DA, + 1865F34306253B87005AB5DA, + 1865F34406253B88005AB5DA, + 1865F34506253B88005AB5DA, + 1865F34706253B88005AB5DA, + 1865F34906253B88005AB5DA, + 1865F34A06253B88005AB5DA, + 1865F34C06253B88005AB5DA, + 1865F35106253B88005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F34106253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F34206253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F34306253B87005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F34406253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F34506253B88005AB5DA = { + children = ( + 1865F34606253B88005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F34606253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F34706253B88005AB5DA = { + children = ( + 1865F34806253B88005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F34806253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F34906253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F34A06253B88005AB5DA = { + children = ( + 1865F34B06253B88005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F34B06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F34C06253B88005AB5DA = { + children = ( + 1865F34D06253B88005AB5DA, + 1865F34E06253B88005AB5DA, + 1865F34F06253B88005AB5DA, + 1865F35006253B88005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F34D06253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F34E06253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F34F06253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F35006253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F35106253B88005AB5DA = { + children = ( + 1865F35206253B88005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F35206253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F35306253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg6_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F35406253B88005AB5DA = { + children = ( + 1865F35506253B88005AB5DA, + 1865F36806253B88005AB5DA, + ); + isa = PBXGroup; + path = ch07; + refType = 4; + sourceTree = ""; + }; + 1865F35506253B88005AB5DA = { + children = ( + 1865F35606253B88005AB5DA, + 1865F35706253B88005AB5DA, + 1865F35806253B88005AB5DA, + 1865F35906253B88005AB5DA, + 1865F35A06253B88005AB5DA, + 1865F35C06253B88005AB5DA, + 1865F35E06253B88005AB5DA, + 1865F35F06253B88005AB5DA, + 1865F36106253B88005AB5DA, + 1865F36606253B88005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F35606253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F35706253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F35806253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F35906253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F35A06253B88005AB5DA = { + children = ( + 1865F35B06253B88005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F35B06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg7_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F35C06253B88005AB5DA = { + children = ( + 1865F35D06253B88005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F35D06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg7_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F35E06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F35F06253B88005AB5DA = { + children = ( + 1865F36006253B88005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F36006253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg7_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F36106253B88005AB5DA = { + children = ( + 1865F36206253B88005AB5DA, + 1865F36306253B88005AB5DA, + 1865F36406253B88005AB5DA, + 1865F36506253B88005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F36206253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F36306253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F36406253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F36506253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F36606253B88005AB5DA = { + children = ( + 1865F36706253B88005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F36706253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg7_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F36806253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg7_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F36906253B88005AB5DA = { + children = ( + 1865F36A06253B88005AB5DA, + 1865F37D06253B88005AB5DA, + ); + isa = PBXGroup; + path = ch08; + refType = 4; + sourceTree = ""; + }; + 1865F36A06253B88005AB5DA = { + children = ( + 1865F36B06253B88005AB5DA, + 1865F36C06253B88005AB5DA, + 1865F36D06253B88005AB5DA, + 1865F36E06253B88005AB5DA, + 1865F36F06253B88005AB5DA, + 1865F37106253B88005AB5DA, + 1865F37306253B88005AB5DA, + 1865F37406253B88005AB5DA, + 1865F37606253B88005AB5DA, + 1865F37B06253B88005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F36B06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F36C06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F36D06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F36E06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F36F06253B88005AB5DA = { + children = ( + 1865F37006253B88005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37006253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg8_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37106253B88005AB5DA = { + children = ( + 1865F37206253B88005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F37206253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg8_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F37306253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F37406253B88005AB5DA = { + children = ( + 1865F37506253B88005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37506253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg8_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37606253B88005AB5DA = { + children = ( + 1865F37706253B88005AB5DA, + 1865F37806253B88005AB5DA, + 1865F37906253B88005AB5DA, + 1865F37A06253B88005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F37706253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37806253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F37906253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F37A06253B88005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F37B06253B88005AB5DA = { + children = ( + 1865F37C06253B88005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F37C06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg8_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F37D06253B88005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg8_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F37E06253B88005AB5DA = { + children = ( + 1865F37F06253B89005AB5DA, + 1865F39206253B89005AB5DA, + ); + isa = PBXGroup; + path = ch09; + refType = 4; + sourceTree = ""; + }; + 1865F37F06253B89005AB5DA = { + children = ( + 1865F38006253B89005AB5DA, + 1865F38106253B89005AB5DA, + 1865F38206253B89005AB5DA, + 1865F38306253B89005AB5DA, + 1865F38406253B89005AB5DA, + 1865F38606253B89005AB5DA, + 1865F38806253B89005AB5DA, + 1865F38906253B89005AB5DA, + 1865F38B06253B89005AB5DA, + 1865F39006253B89005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F38006253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F38106253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F38206253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F38306253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F38406253B89005AB5DA = { + children = ( + 1865F38506253B89005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38506253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg9_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38606253B89005AB5DA = { + children = ( + 1865F38706253B89005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F38706253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg9_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F38806253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F38906253B89005AB5DA = { + children = ( + 1865F38A06253B89005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38A06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg9_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38B06253B89005AB5DA = { + children = ( + 1865F38C06253B89005AB5DA, + 1865F38D06253B89005AB5DA, + 1865F38E06253B89005AB5DA, + 1865F38F06253B89005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F38C06253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38D06253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F38E06253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F38F06253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F39006253B89005AB5DA = { + children = ( + 1865F39106253B89005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F39106253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg9_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F39206253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg9_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F39306253B89005AB5DA = { + children = ( + 1865F39406253B89005AB5DA, + 1865F3A706253B89005AB5DA, + ); + isa = PBXGroup; + path = ch10; + refType = 4; + sourceTree = ""; + }; + 1865F39406253B89005AB5DA = { + children = ( + 1865F39506253B89005AB5DA, + 1865F39606253B89005AB5DA, + 1865F39706253B89005AB5DA, + 1865F39806253B89005AB5DA, + 1865F39906253B89005AB5DA, + 1865F39B06253B89005AB5DA, + 1865F39D06253B89005AB5DA, + 1865F39E06253B89005AB5DA, + 1865F3A006253B89005AB5DA, + 1865F3A506253B89005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F39506253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F39606253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F39706253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F39806253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F39906253B89005AB5DA = { + children = ( + 1865F39A06253B89005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F39A06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg10_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F39B06253B89005AB5DA = { + children = ( + 1865F39C06253B89005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F39C06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg10_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F39D06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F39E06253B89005AB5DA = { + children = ( + 1865F39F06253B89005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F39F06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg10_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3A006253B89005AB5DA = { + children = ( + 1865F3A106253B89005AB5DA, + 1865F3A206253B89005AB5DA, + 1865F3A306253B89005AB5DA, + 1865F3A406253B89005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F3A106253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3A206253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3A306253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3A406253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3A506253B89005AB5DA = { + children = ( + 1865F3A606253B89005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3A606253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg10_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3A706253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg10_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F3A806253B89005AB5DA = { + children = ( + 1865F3A906253B89005AB5DA, + 1865F3BC06253B89005AB5DA, + ); + isa = PBXGroup; + path = ch11; + refType = 4; + sourceTree = ""; + }; + 1865F3A906253B89005AB5DA = { + children = ( + 1865F3AA06253B89005AB5DA, + 1865F3AB06253B89005AB5DA, + 1865F3AC06253B89005AB5DA, + 1865F3AD06253B89005AB5DA, + 1865F3AE06253B89005AB5DA, + 1865F3B006253B89005AB5DA, + 1865F3B206253B89005AB5DA, + 1865F3B306253B89005AB5DA, + 1865F3B506253B89005AB5DA, + 1865F3BA06253B89005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F3AA06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F3AB06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F3AC06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F3AD06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F3AE06253B89005AB5DA = { + children = ( + 1865F3AF06253B89005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3AF06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg11_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3B006253B89005AB5DA = { + children = ( + 1865F3B106253B89005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3B106253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg11_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3B206253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F3B306253B89005AB5DA = { + children = ( + 1865F3B406253B89005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3B406253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg11_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3B506253B89005AB5DA = { + children = ( + 1865F3B606253B89005AB5DA, + 1865F3B706253B89005AB5DA, + 1865F3B806253B89005AB5DA, + 1865F3B906253B89005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F3B606253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3B706253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3B806253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3B906253B89005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3BA06253B89005AB5DA = { + children = ( + 1865F3BB06253B89005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3BB06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg11_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3BC06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg11_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F3BD06253B89005AB5DA = { + children = ( + 1865F3BE06253B89005AB5DA, + 1865F3D106253B8A005AB5DA, + ); + isa = PBXGroup; + path = ch12; + refType = 4; + sourceTree = ""; + }; + 1865F3BE06253B89005AB5DA = { + children = ( + 1865F3BF06253B89005AB5DA, + 1865F3C006253B89005AB5DA, + 1865F3C106253B89005AB5DA, + 1865F3C206253B89005AB5DA, + 1865F3C306253B89005AB5DA, + 1865F3C506253B89005AB5DA, + 1865F3C706253B89005AB5DA, + 1865F3C806253B8A005AB5DA, + 1865F3CA06253B8A005AB5DA, + 1865F3CF06253B8A005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F3BF06253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F3C006253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F3C106253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F3C206253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F3C306253B89005AB5DA = { + children = ( + 1865F3C406253B89005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3C406253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg12_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3C506253B89005AB5DA = { + children = ( + 1865F3C606253B89005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3C606253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg12_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3C706253B89005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F3C806253B8A005AB5DA = { + children = ( + 1865F3C906253B8A005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3C906253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg12_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3CA06253B8A005AB5DA = { + children = ( + 1865F3CB06253B8A005AB5DA, + 1865F3CC06253B8A005AB5DA, + 1865F3CD06253B8A005AB5DA, + 1865F3CE06253B8A005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F3CB06253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3CC06253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3CD06253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3CE06253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3CF06253B8A005AB5DA = { + children = ( + 1865F3D006253B8A005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3D006253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg12_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3D106253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg12_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F3D206253B8A005AB5DA = { + children = ( + 1865F3D306253B8A005AB5DA, + 1865F3E606253B8A005AB5DA, + ); + isa = PBXGroup; + path = gtkrad; + refType = 4; + sourceTree = ""; + }; + 1865F3D306253B8A005AB5DA = { + children = ( + 1865F3D406253B8A005AB5DA, + 1865F3D506253B8A005AB5DA, + 1865F3D606253B8A005AB5DA, + 1865F3D706253B8A005AB5DA, + 1865F3D806253B8A005AB5DA, + 1865F3DA06253B8A005AB5DA, + 1865F3DC06253B8A005AB5DA, + 1865F3DD06253B8A005AB5DA, + 1865F3DF06253B8A005AB5DA, + 1865F3E406253B8A005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F3D406253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F3D506253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F3D606253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F3D706253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F3D806253B8A005AB5DA = { + children = ( + 1865F3D906253B8A005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3D906253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3DA06253B8A005AB5DA = { + children = ( + 1865F3DB06253B8A005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3DB06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3DC06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F3DD06253B8A005AB5DA = { + children = ( + 1865F3DE06253B8A005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3DE06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3DF06253B8A005AB5DA = { + children = ( + 1865F3E006253B8A005AB5DA, + 1865F3E106253B8A005AB5DA, + 1865F3E206253B8A005AB5DA, + 1865F3E306253B8A005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F3E006253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3E106253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F3E206253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3E306253B8A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3E406253B8A005AB5DA = { + children = ( + 1865F3E506253B8A005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F3E506253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F3E606253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg1_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F3E706253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.htm; + refType = 4; + sourceTree = ""; + }; + 1865F3E806253B8A005AB5DA = { + children = ( + 1865F3E906253B8A005AB5DA, + 1865F44C06253B8B005AB5DA, + 1865F44D06253B8B005AB5DA, + 1865F44E06253B8B005AB5DA, + 1865F44F06253B8B005AB5DA, + 1865F45006253B8B005AB5DA, + 1865F45106253B8B005AB5DA, + 1865F45206253B8B005AB5DA, + 1865F45306253B8B005AB5DA, + 1865F45406253B8B005AB5DA, + 1865F45506253B8B005AB5DA, + 1865F45606253B8B005AB5DA, + 1865F45706253B8B005AB5DA, + 1865F45806253B8B005AB5DA, + 1865F45906253B8B005AB5DA, + 1865F45A06253B8B005AB5DA, + 1865F45B06253B8B005AB5DA, + 1865F45C06253B8B005AB5DA, + 1865F45D06253B8B005AB5DA, + 1865F45E06253B8B005AB5DA, + 1865F45F06253B8B005AB5DA, + 1865F46006253B8C005AB5DA, + ); + isa = PBXGroup; + path = Q3Rad_Manual_files; + refType = 4; + sourceTree = ""; + }; + 1865F3E906253B8A005AB5DA = { + children = ( + 1865F3EA06253B8A005AB5DA, + 1865F3EB06253B8A005AB5DA, + 1865F3EC06253B8A005AB5DA, + 1865F3ED06253B8A005AB5DA, + 1865F3EE06253B8A005AB5DA, + 1865F40406253B8A005AB5DA, + 1865F41A06253B8B005AB5DA, + 1865F41B06253B8B005AB5DA, + 1865F43106253B8B005AB5DA, + 1865F43606253B8B005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F3EA06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F3EB06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F3EC06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F3ED06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F3EE06253B8A005AB5DA = { + children = ( + 1865F3EF06253B8A005AB5DA, + 1865F3F006253B8A005AB5DA, + 1865F3F106253B8A005AB5DA, + 1865F3F206253B8A005AB5DA, + 1865F3F306253B8A005AB5DA, + 1865F3F406253B8A005AB5DA, + 1865F3F506253B8A005AB5DA, + 1865F3F606253B8A005AB5DA, + 1865F3F706253B8A005AB5DA, + 1865F3F806253B8A005AB5DA, + 1865F3F906253B8A005AB5DA, + 1865F3FA06253B8A005AB5DA, + 1865F3FB06253B8A005AB5DA, + 1865F3FC06253B8A005AB5DA, + 1865F3FD06253B8A005AB5DA, + 1865F3FE06253B8A005AB5DA, + 1865F3FF06253B8A005AB5DA, + 1865F40006253B8A005AB5DA, + 1865F40106253B8A005AB5DA, + 1865F40206253B8A005AB5DA, + 1865F40306253B8A005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3EF06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F006253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image003.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F106253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image004.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F206253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image006.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F306253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image008.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F406253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image010.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F506253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image012.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F606253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image014.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F706253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image016.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F806253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image018.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3F906253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image020.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FA06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image022.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FB06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image024.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FC06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image026.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FD06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image028.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FE06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image030.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F3FF06253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image032.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F40006253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image034.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F40106253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image035.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F40206253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image038.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F40306253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image040.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F40406253B8A005AB5DA = { + children = ( + 1865F40506253B8A005AB5DA, + 1865F40606253B8A005AB5DA, + 1865F40706253B8B005AB5DA, + 1865F40806253B8B005AB5DA, + 1865F40906253B8B005AB5DA, + 1865F40A06253B8B005AB5DA, + 1865F40B06253B8B005AB5DA, + 1865F40C06253B8B005AB5DA, + 1865F40D06253B8B005AB5DA, + 1865F40E06253B8B005AB5DA, + 1865F40F06253B8B005AB5DA, + 1865F41006253B8B005AB5DA, + 1865F41106253B8B005AB5DA, + 1865F41206253B8B005AB5DA, + 1865F41306253B8B005AB5DA, + 1865F41406253B8B005AB5DA, + 1865F41506253B8B005AB5DA, + 1865F41606253B8B005AB5DA, + 1865F41706253B8B005AB5DA, + 1865F41806253B8B005AB5DA, + 1865F41906253B8B005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F40506253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40606253B8A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image003.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40706253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image004.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40806253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image006.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40906253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image008.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40A06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image010.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40B06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image012.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40C06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image014.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40D06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image016.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40E06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image018.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F40F06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image020.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41006253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image022.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41106253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image024.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41206253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image026.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41306253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image028.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41406253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image030.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41506253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image032.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41606253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image034.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41706253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image035.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41806253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image038.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41906253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image040.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F41A06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F41B06253B8B005AB5DA = { + children = ( + 1865F41C06253B8B005AB5DA, + 1865F41D06253B8B005AB5DA, + 1865F41E06253B8B005AB5DA, + 1865F41F06253B8B005AB5DA, + 1865F42006253B8B005AB5DA, + 1865F42106253B8B005AB5DA, + 1865F42206253B8B005AB5DA, + 1865F42306253B8B005AB5DA, + 1865F42406253B8B005AB5DA, + 1865F42506253B8B005AB5DA, + 1865F42606253B8B005AB5DA, + 1865F42706253B8B005AB5DA, + 1865F42806253B8B005AB5DA, + 1865F42906253B8B005AB5DA, + 1865F42A06253B8B005AB5DA, + 1865F42B06253B8B005AB5DA, + 1865F42C06253B8B005AB5DA, + 1865F42D06253B8B005AB5DA, + 1865F42E06253B8B005AB5DA, + 1865F42F06253B8B005AB5DA, + 1865F43006253B8B005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F41C06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image002.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F41D06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image003.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F41E06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image004.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F41F06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image006.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42006253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image008.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42106253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image010.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42206253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image012.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42306253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image014.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42406253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image016.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42506253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image018.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42606253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image020.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42706253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image022.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42806253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image024.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42906253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image026.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42A06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image028.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42B06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image030.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42C06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image032.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42D06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image034.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42E06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image035.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F42F06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image038.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F43006253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image040.png.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F43106253B8B005AB5DA = { + children = ( + 1865F43206253B8B005AB5DA, + 1865F43306253B8B005AB5DA, + 1865F43406253B8B005AB5DA, + 1865F43506253B8B005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F43206253B8B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F43306253B8B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F43406253B8B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F43506253B8B005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F43606253B8B005AB5DA = { + children = ( + 1865F43706253B8B005AB5DA, + 1865F43806253B8B005AB5DA, + 1865F43906253B8B005AB5DA, + 1865F43A06253B8B005AB5DA, + 1865F43B06253B8B005AB5DA, + 1865F43C06253B8B005AB5DA, + 1865F43D06253B8B005AB5DA, + 1865F43E06253B8B005AB5DA, + 1865F43F06253B8B005AB5DA, + 1865F44006253B8B005AB5DA, + 1865F44106253B8B005AB5DA, + 1865F44206253B8B005AB5DA, + 1865F44306253B8B005AB5DA, + 1865F44406253B8B005AB5DA, + 1865F44506253B8B005AB5DA, + 1865F44606253B8B005AB5DA, + 1865F44706253B8B005AB5DA, + 1865F44806253B8B005AB5DA, + 1865F44906253B8B005AB5DA, + 1865F44A06253B8B005AB5DA, + 1865F44B06253B8B005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F43706253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43806253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image003.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43906253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image004.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43A06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image006.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43B06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image008.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43C06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image010.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43D06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image012.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43E06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image014.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F43F06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image016.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44006253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image018.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44106253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image020.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44206253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image022.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44306253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image024.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44406253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image026.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44506253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image028.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44606253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image030.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44706253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image032.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44806253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image034.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44906253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image035.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44A06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image038.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44B06253B8B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image040.png.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F44C06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image002.png; + refType = 4; + sourceTree = ""; + }; + 1865F44D06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image003.png; + refType = 4; + sourceTree = ""; + }; + 1865F44E06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image004.png; + refType = 4; + sourceTree = ""; + }; + 1865F44F06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image006.png; + refType = 4; + sourceTree = ""; + }; + 1865F45006253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image008.png; + refType = 4; + sourceTree = ""; + }; + 1865F45106253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image010.png; + refType = 4; + sourceTree = ""; + }; + 1865F45206253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image012.png; + refType = 4; + sourceTree = ""; + }; + 1865F45306253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image014.png; + refType = 4; + sourceTree = ""; + }; + 1865F45406253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image016.png; + refType = 4; + sourceTree = ""; + }; + 1865F45506253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image018.png; + refType = 4; + sourceTree = ""; + }; + 1865F45606253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image020.png; + refType = 4; + sourceTree = ""; + }; + 1865F45706253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image022.png; + refType = 4; + sourceTree = ""; + }; + 1865F45806253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image024.png; + refType = 4; + sourceTree = ""; + }; + 1865F45906253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image026.png; + refType = 4; + sourceTree = ""; + }; + 1865F45A06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image028.png; + refType = 4; + sourceTree = ""; + }; + 1865F45B06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image030.png; + refType = 4; + sourceTree = ""; + }; + 1865F45C06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image032.png; + refType = 4; + sourceTree = ""; + }; + 1865F45D06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image034.png; + refType = 4; + sourceTree = ""; + }; + 1865F45E06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image035.png; + refType = 4; + sourceTree = ""; + }; + 1865F45F06253B8B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image038.png; + refType = 4; + sourceTree = ""; + }; + 1865F46006253B8C005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.png; + path = image040.png; + refType = 4; + sourceTree = ""; + }; + 1865F46106253B8C005AB5DA = { + children = ( + 1865F46206253B8C005AB5DA, + 1865F47506253B8C005AB5DA, + ); + isa = PBXGroup; + path = styles; + refType = 4; + sourceTree = ""; + }; + 1865F46206253B8C005AB5DA = { + children = ( + 1865F46306253B8C005AB5DA, + 1865F46406253B8C005AB5DA, + 1865F46506253B8C005AB5DA, + 1865F46606253B8C005AB5DA, + 1865F46706253B8C005AB5DA, + 1865F46906253B8C005AB5DA, + 1865F46B06253B8C005AB5DA, + 1865F46C06253B8C005AB5DA, + 1865F46E06253B8C005AB5DA, + 1865F47306253B8C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F46306253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F46406253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F46506253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F46606253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F46706253B8C005AB5DA = { + children = ( + 1865F46806253B8C005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F46806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F46906253B8C005AB5DA = { + children = ( + 1865F46A06253B8C005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F46A06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F46B06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F46C06253B8C005AB5DA = { + children = ( + 1865F46D06253B8C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F46D06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F46E06253B8C005AB5DA = { + children = ( + 1865F46F06253B8C005AB5DA, + 1865F47006253B8C005AB5DA, + 1865F47106253B8C005AB5DA, + 1865F47206253B8C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F46F06253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F47006253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F47106253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F47206253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F47306253B8C005AB5DA = { + children = ( + 1865F47406253B8C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F47406253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F47506253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3rad.css; + refType = 4; + sourceTree = ""; + }; + 1865F47606253B8C005AB5DA = { + children = ( + 1865F47706253B8C005AB5DA, + 1865F48606253B8C005AB5DA, + 1865F4B406253B8C005AB5DA, + 1865F4DE06253B8D005AB5DA, + 1865F4F306253B8D005AB5DA, + 1865F5C506253B8F005AB5DA, + 1865F65406253B92005AB5DA, + ); + isa = PBXGroup; + path = quake3; + refType = 4; + sourceTree = ""; + }; + 1865F47706253B8C005AB5DA = { + children = ( + 1865F47806253B8C005AB5DA, + 1865F47906253B8C005AB5DA, + 1865F47A06253B8C005AB5DA, + 1865F47B06253B8C005AB5DA, + 1865F47C06253B8C005AB5DA, + 1865F47D06253B8C005AB5DA, + 1865F47E06253B8C005AB5DA, + 1865F47F06253B8C005AB5DA, + 1865F48006253B8C005AB5DA, + 1865F48506253B8C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F47806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F47906253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F47A06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F47B06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F47C06253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F47D06253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F47E06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F47F06253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48006253B8C005AB5DA = { + children = ( + 1865F48106253B8C005AB5DA, + 1865F48206253B8C005AB5DA, + 1865F48306253B8C005AB5DA, + 1865F48406253B8C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F48106253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48206253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F48306253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48406253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F48506253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F48606253B8C005AB5DA = { + children = ( + 1865F48706253B8C005AB5DA, + 1865F4AE06253B8C005AB5DA, + 1865F4AF06253B8C005AB5DA, + 1865F4B006253B8C005AB5DA, + 1865F4B106253B8C005AB5DA, + 1865F4B206253B8C005AB5DA, + 1865F4B306253B8C005AB5DA, + ); + isa = PBXGroup; + path = Compile_Manual; + refType = 4; + sourceTree = ""; + }; + 1865F48706253B8C005AB5DA = { + children = ( + 1865F48806253B8C005AB5DA, + 1865F48906253B8C005AB5DA, + 1865F48A06253B8C005AB5DA, + 1865F48B06253B8C005AB5DA, + 1865F48C06253B8C005AB5DA, + 1865F49306253B8C005AB5DA, + 1865F49A06253B8C005AB5DA, + 1865F49B06253B8C005AB5DA, + 1865F4A206253B8C005AB5DA, + 1865F4A706253B8C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F48806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F48906253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F48A06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F48B06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F48C06253B8C005AB5DA = { + children = ( + 1865F48D06253B8C005AB5DA, + 1865F48E06253B8C005AB5DA, + 1865F48F06253B8C005AB5DA, + 1865F49006253B8C005AB5DA, + 1865F49106253B8C005AB5DA, + 1865F49206253B8C005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48D06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48E06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cfgq3.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F48F06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "headskins.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49006253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49106253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modelskins.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49206253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49306253B8C005AB5DA = { + children = ( + 1865F49406253B8C005AB5DA, + 1865F49506253B8C005AB5DA, + 1865F49606253B8C005AB5DA, + 1865F49706253B8C005AB5DA, + 1865F49806253B8C005AB5DA, + 1865F49906253B8C005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F49406253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49506253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cfgq3.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49606253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "headskins.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49706253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modelskins.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49906253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F49A06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F49B06253B8C005AB5DA = { + children = ( + 1865F49C06253B8C005AB5DA, + 1865F49D06253B8C005AB5DA, + 1865F49E06253B8C005AB5DA, + 1865F49F06253B8C005AB5DA, + 1865F4A006253B8C005AB5DA, + 1865F4A106253B8C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49C06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49D06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cfgq3.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49E06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "headskins.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F49F06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4A006253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modelskins.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4A106253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4A206253B8C005AB5DA = { + children = ( + 1865F4A306253B8C005AB5DA, + 1865F4A406253B8C005AB5DA, + 1865F4A506253B8C005AB5DA, + 1865F4A606253B8C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F4A306253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4A406253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4A506253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4A606253B8C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4A706253B8C005AB5DA = { + children = ( + 1865F4A806253B8C005AB5DA, + 1865F4A906253B8C005AB5DA, + 1865F4AA06253B8C005AB5DA, + 1865F4AB06253B8C005AB5DA, + 1865F4AC06253B8C005AB5DA, + 1865F4AD06253B8C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4A806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bspc.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4A906253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cfgq3.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4AA06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "headskins.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4AB06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4AC06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "modelskins.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4AD06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3map.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4AE06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = bspc.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4AF06253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = cfgq3.c; + refType = 4; + sourceTree = ""; + }; + 1865F4B006253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = headskins.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4B106253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.html; + refType = 4; + sourceTree = ""; + }; + 1865F4B206253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = modelskins.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4B306253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = q3map.html; + refType = 4; + sourceTree = ""; + }; + 1865F4B406253B8C005AB5DA = { + children = ( + 1865F4B506253B8C005AB5DA, + 1865F4C806253B8D005AB5DA, + 1865F4C906253B8D005AB5DA, + ); + isa = PBXGroup; + path = Model_Manual; + refType = 4; + sourceTree = ""; + }; + 1865F4B506253B8C005AB5DA = { + children = ( + 1865F4B606253B8C005AB5DA, + 1865F4B706253B8C005AB5DA, + 1865F4B806253B8C005AB5DA, + 1865F4B906253B8C005AB5DA, + 1865F4BA06253B8D005AB5DA, + 1865F4BC06253B8D005AB5DA, + 1865F4BE06253B8D005AB5DA, + 1865F4BF06253B8D005AB5DA, + 1865F4C106253B8D005AB5DA, + 1865F4C606253B8D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F4B606253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F4B706253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F4B806253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F4B906253B8C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F4BA06253B8D005AB5DA = { + children = ( + 1865F4BB06253B8D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4BB06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_manual.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4BC06253B8D005AB5DA = { + children = ( + 1865F4BD06253B8D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4BD06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_manual.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4BE06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4BF06253B8D005AB5DA = { + children = ( + 1865F4C006253B8D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4C006253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_manual.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4C106253B8D005AB5DA = { + children = ( + 1865F4C206253B8D005AB5DA, + 1865F4C306253B8D005AB5DA, + 1865F4C406253B8D005AB5DA, + 1865F4C506253B8D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F4C206253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4C306253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4C406253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4C506253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4C606253B8D005AB5DA = { + children = ( + 1865F4C706253B8D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4C706253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_manual.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4C806253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = model_manual.htm; + refType = 4; + sourceTree = ""; + }; + 1865F4C906253B8D005AB5DA = { + children = ( + 1865F4CA06253B8D005AB5DA, + 1865F4DD06253B8D005AB5DA, + ); + isa = PBXGroup; + path = styles; + refType = 4; + sourceTree = ""; + }; + 1865F4CA06253B8D005AB5DA = { + children = ( + 1865F4CB06253B8D005AB5DA, + 1865F4CC06253B8D005AB5DA, + 1865F4CD06253B8D005AB5DA, + 1865F4CE06253B8D005AB5DA, + 1865F4CF06253B8D005AB5DA, + 1865F4D106253B8D005AB5DA, + 1865F4D306253B8D005AB5DA, + 1865F4D406253B8D005AB5DA, + 1865F4D606253B8D005AB5DA, + 1865F4DB06253B8D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F4CB06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F4CC06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F4CD06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F4CE06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F4CF06253B8D005AB5DA = { + children = ( + 1865F4D006253B8D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4D006253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4D106253B8D005AB5DA = { + children = ( + 1865F4D206253B8D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4D206253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4D306253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4D406253B8D005AB5DA = { + children = ( + 1865F4D506253B8D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4D506253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4D606253B8D005AB5DA = { + children = ( + 1865F4D706253B8D005AB5DA, + 1865F4D806253B8D005AB5DA, + 1865F4D906253B8D005AB5DA, + 1865F4DA06253B8D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F4D706253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4D806253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4D906253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4DA06253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4DB06253B8D005AB5DA = { + children = ( + 1865F4DC06253B8D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4DC06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4DD06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3rad.css; + refType = 4; + sourceTree = ""; + }; + 1865F4DE06253B8D005AB5DA = { + children = ( + 1865F4DF06253B8D005AB5DA, + 1865F4F206253B8D005AB5DA, + ); + isa = PBXGroup; + path = New_Teams_For_Q3TA; + refType = 4; + sourceTree = ""; + }; + 1865F4DF06253B8D005AB5DA = { + children = ( + 1865F4E006253B8D005AB5DA, + 1865F4E106253B8D005AB5DA, + 1865F4E206253B8D005AB5DA, + 1865F4E306253B8D005AB5DA, + 1865F4E406253B8D005AB5DA, + 1865F4E606253B8D005AB5DA, + 1865F4E806253B8D005AB5DA, + 1865F4E906253B8D005AB5DA, + 1865F4EB06253B8D005AB5DA, + 1865F4F006253B8D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F4E006253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F4E106253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F4E206253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F4E306253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F4E406253B8D005AB5DA = { + children = ( + 1865F4E506253B8D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4E506253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4E606253B8D005AB5DA = { + children = ( + 1865F4E706253B8D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4E706253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4E806253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4E906253B8D005AB5DA = { + children = ( + 1865F4EA06253B8D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4EA06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4EB06253B8D005AB5DA = { + children = ( + 1865F4EC06253B8D005AB5DA, + 1865F4ED06253B8D005AB5DA, + 1865F4EE06253B8D005AB5DA, + 1865F4EF06253B8D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F4EC06253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4ED06253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4EE06253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4EF06253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4F006253B8D005AB5DA = { + children = ( + 1865F4F106253B8D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F4F106253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4F206253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.html; + refType = 4; + sourceTree = ""; + }; + 1865F4F306253B8D005AB5DA = { + children = ( + 1865F4F406253B8D005AB5DA, + 1865F50706253B8D005AB5DA, + 1865F51C06253B8D005AB5DA, + 1865F53106253B8E005AB5DA, + 1865F54606253B8E005AB5DA, + 1865F55B06253B8E005AB5DA, + 1865F57006253B8E005AB5DA, + 1865F58506253B8E005AB5DA, + 1865F59A06253B8F005AB5DA, + 1865F59B06253B8F005AB5DA, + 1865F5B006253B8F005AB5DA, + ); + isa = PBXGroup; + path = Q3AShader_Manual; + refType = 4; + sourceTree = ""; + }; + 1865F4F406253B8D005AB5DA = { + children = ( + 1865F4F506253B8D005AB5DA, + 1865F4F606253B8D005AB5DA, + 1865F4F706253B8D005AB5DA, + 1865F4F806253B8D005AB5DA, + 1865F4F906253B8D005AB5DA, + 1865F4FB06253B8D005AB5DA, + 1865F4FD06253B8D005AB5DA, + 1865F4FE06253B8D005AB5DA, + 1865F50006253B8D005AB5DA, + 1865F50506253B8D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F4F506253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F4F606253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F4F706253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F4F806253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F4F906253B8D005AB5DA = { + children = ( + 1865F4FA06253B8D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4FA06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4FB06253B8D005AB5DA = { + children = ( + 1865F4FC06253B8D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F4FC06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F4FD06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F4FE06253B8D005AB5DA = { + children = ( + 1865F4FF06253B8D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F4FF06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F50006253B8D005AB5DA = { + children = ( + 1865F50106253B8D005AB5DA, + 1865F50206253B8D005AB5DA, + 1865F50306253B8D005AB5DA, + 1865F50406253B8D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F50106253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F50206253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F50306253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F50406253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F50506253B8D005AB5DA = { + children = ( + 1865F50606253B8D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F50606253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F50706253B8D005AB5DA = { + children = ( + 1865F50806253B8D005AB5DA, + 1865F51B06253B8D005AB5DA, + ); + isa = PBXGroup; + path = appendix; + refType = 4; + sourceTree = ""; + }; + 1865F50806253B8D005AB5DA = { + children = ( + 1865F50906253B8D005AB5DA, + 1865F50A06253B8D005AB5DA, + 1865F50B06253B8D005AB5DA, + 1865F50C06253B8D005AB5DA, + 1865F50D06253B8D005AB5DA, + 1865F50F06253B8D005AB5DA, + 1865F51106253B8D005AB5DA, + 1865F51206253B8D005AB5DA, + 1865F51406253B8D005AB5DA, + 1865F51906253B8D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F50906253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F50A06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F50B06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F50C06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F50D06253B8D005AB5DA = { + children = ( + 1865F50E06253B8D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F50E06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appA.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F50F06253B8D005AB5DA = { + children = ( + 1865F51006253B8D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F51006253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appA.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F51106253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F51206253B8D005AB5DA = { + children = ( + 1865F51306253B8D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F51306253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appA.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F51406253B8D005AB5DA = { + children = ( + 1865F51506253B8D005AB5DA, + 1865F51606253B8D005AB5DA, + 1865F51706253B8D005AB5DA, + 1865F51806253B8D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F51506253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F51606253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F51706253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F51806253B8D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F51906253B8D005AB5DA = { + children = ( + 1865F51A06253B8D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F51A06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "appA.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F51B06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = appA.html; + refType = 4; + sourceTree = ""; + }; + 1865F51C06253B8D005AB5DA = { + children = ( + 1865F51D06253B8D005AB5DA, + 1865F53006253B8E005AB5DA, + ); + isa = PBXGroup; + path = ch01; + refType = 4; + sourceTree = ""; + }; + 1865F51D06253B8D005AB5DA = { + children = ( + 1865F51E06253B8D005AB5DA, + 1865F51F06253B8D005AB5DA, + 1865F52006253B8D005AB5DA, + 1865F52106253B8D005AB5DA, + 1865F52206253B8D005AB5DA, + 1865F52406253B8E005AB5DA, + 1865F52606253B8E005AB5DA, + 1865F52706253B8E005AB5DA, + 1865F52906253B8E005AB5DA, + 1865F52E06253B8E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F51E06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F51F06253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F52006253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F52106253B8D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F52206253B8D005AB5DA = { + children = ( + 1865F52306253B8E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52306253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52406253B8E005AB5DA = { + children = ( + 1865F52506253B8E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F52506253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F52606253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F52706253B8E005AB5DA = { + children = ( + 1865F52806253B8E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52806253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52906253B8E005AB5DA = { + children = ( + 1865F52A06253B8E005AB5DA, + 1865F52B06253B8E005AB5DA, + 1865F52C06253B8E005AB5DA, + 1865F52D06253B8E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F52A06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52B06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F52C06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F52D06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F52E06253B8E005AB5DA = { + children = ( + 1865F52F06253B8E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F52F06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg1_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F53006253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg1_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F53106253B8E005AB5DA = { + children = ( + 1865F53206253B8E005AB5DA, + 1865F54506253B8E005AB5DA, + ); + isa = PBXGroup; + path = ch02; + refType = 4; + sourceTree = ""; + }; + 1865F53206253B8E005AB5DA = { + children = ( + 1865F53306253B8E005AB5DA, + 1865F53406253B8E005AB5DA, + 1865F53506253B8E005AB5DA, + 1865F53606253B8E005AB5DA, + 1865F53706253B8E005AB5DA, + 1865F53906253B8E005AB5DA, + 1865F53B06253B8E005AB5DA, + 1865F53C06253B8E005AB5DA, + 1865F53E06253B8E005AB5DA, + 1865F54306253B8E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F53306253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F53406253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F53506253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F53606253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F53706253B8E005AB5DA = { + children = ( + 1865F53806253B8E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F53806253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F53906253B8E005AB5DA = { + children = ( + 1865F53A06253B8E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F53A06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F53B06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F53C06253B8E005AB5DA = { + children = ( + 1865F53D06253B8E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F53D06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F53E06253B8E005AB5DA = { + children = ( + 1865F53F06253B8E005AB5DA, + 1865F54006253B8E005AB5DA, + 1865F54106253B8E005AB5DA, + 1865F54206253B8E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F53F06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F54006253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F54106253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F54206253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F54306253B8E005AB5DA = { + children = ( + 1865F54406253B8E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F54406253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg2_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F54506253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg2_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F54606253B8E005AB5DA = { + children = ( + 1865F54706253B8E005AB5DA, + 1865F55A06253B8E005AB5DA, + ); + isa = PBXGroup; + path = ch03; + refType = 4; + sourceTree = ""; + }; + 1865F54706253B8E005AB5DA = { + children = ( + 1865F54806253B8E005AB5DA, + 1865F54906253B8E005AB5DA, + 1865F54A06253B8E005AB5DA, + 1865F54B06253B8E005AB5DA, + 1865F54C06253B8E005AB5DA, + 1865F54E06253B8E005AB5DA, + 1865F55006253B8E005AB5DA, + 1865F55106253B8E005AB5DA, + 1865F55306253B8E005AB5DA, + 1865F55806253B8E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F54806253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F54906253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F54A06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F54B06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F54C06253B8E005AB5DA = { + children = ( + 1865F54D06253B8E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F54D06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F54E06253B8E005AB5DA = { + children = ( + 1865F54F06253B8E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F54F06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F55006253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F55106253B8E005AB5DA = { + children = ( + 1865F55206253B8E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F55206253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F55306253B8E005AB5DA = { + children = ( + 1865F55406253B8E005AB5DA, + 1865F55506253B8E005AB5DA, + 1865F55606253B8E005AB5DA, + 1865F55706253B8E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F55406253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F55506253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F55606253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F55706253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F55806253B8E005AB5DA = { + children = ( + 1865F55906253B8E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F55906253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg3_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F55A06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg3_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F55B06253B8E005AB5DA = { + children = ( + 1865F55C06253B8E005AB5DA, + 1865F56F06253B8E005AB5DA, + ); + isa = PBXGroup; + path = ch04; + refType = 4; + sourceTree = ""; + }; + 1865F55C06253B8E005AB5DA = { + children = ( + 1865F55D06253B8E005AB5DA, + 1865F55E06253B8E005AB5DA, + 1865F55F06253B8E005AB5DA, + 1865F56006253B8E005AB5DA, + 1865F56106253B8E005AB5DA, + 1865F56306253B8E005AB5DA, + 1865F56506253B8E005AB5DA, + 1865F56606253B8E005AB5DA, + 1865F56806253B8E005AB5DA, + 1865F56D06253B8E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F55D06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F55E06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F55F06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F56006253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F56106253B8E005AB5DA = { + children = ( + 1865F56206253B8E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56206253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56306253B8E005AB5DA = { + children = ( + 1865F56406253B8E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F56406253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F56506253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F56606253B8E005AB5DA = { + children = ( + 1865F56706253B8E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56706253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56806253B8E005AB5DA = { + children = ( + 1865F56906253B8E005AB5DA, + 1865F56A06253B8E005AB5DA, + 1865F56B06253B8E005AB5DA, + 1865F56C06253B8E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F56906253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56A06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F56B06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F56C06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F56D06253B8E005AB5DA = { + children = ( + 1865F56E06253B8E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F56E06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg4_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F56F06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg4_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F57006253B8E005AB5DA = { + children = ( + 1865F57106253B8E005AB5DA, + 1865F58406253B8E005AB5DA, + ); + isa = PBXGroup; + path = ch05; + refType = 4; + sourceTree = ""; + }; + 1865F57106253B8E005AB5DA = { + children = ( + 1865F57206253B8E005AB5DA, + 1865F57306253B8E005AB5DA, + 1865F57406253B8E005AB5DA, + 1865F57506253B8E005AB5DA, + 1865F57606253B8E005AB5DA, + 1865F57806253B8E005AB5DA, + 1865F57A06253B8E005AB5DA, + 1865F57B06253B8E005AB5DA, + 1865F57D06253B8E005AB5DA, + 1865F58206253B8E005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F57206253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F57306253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F57406253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F57506253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F57606253B8E005AB5DA = { + children = ( + 1865F57706253B8E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F57706253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F57806253B8E005AB5DA = { + children = ( + 1865F57906253B8E005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F57906253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F57A06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F57B06253B8E005AB5DA = { + children = ( + 1865F57C06253B8E005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F57C06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F57D06253B8E005AB5DA = { + children = ( + 1865F57E06253B8E005AB5DA, + 1865F57F06253B8E005AB5DA, + 1865F58006253B8E005AB5DA, + 1865F58106253B8E005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F57E06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F57F06253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F58006253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F58106253B8E005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F58206253B8E005AB5DA = { + children = ( + 1865F58306253B8E005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F58306253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg5_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F58406253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg5_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F58506253B8E005AB5DA = { + children = ( + 1865F58606253B8E005AB5DA, + 1865F59906253B8F005AB5DA, + ); + isa = PBXGroup; + path = ch06; + refType = 4; + sourceTree = ""; + }; + 1865F58606253B8E005AB5DA = { + children = ( + 1865F58706253B8E005AB5DA, + 1865F58806253B8E005AB5DA, + 1865F58906253B8E005AB5DA, + 1865F58A06253B8E005AB5DA, + 1865F58B06253B8F005AB5DA, + 1865F58D06253B8F005AB5DA, + 1865F58F06253B8F005AB5DA, + 1865F59006253B8F005AB5DA, + 1865F59206253B8F005AB5DA, + 1865F59706253B8F005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F58706253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F58806253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F58906253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F58A06253B8E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F58B06253B8F005AB5DA = { + children = ( + 1865F58C06253B8F005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F58C06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F58D06253B8F005AB5DA = { + children = ( + 1865F58E06253B8F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F58E06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F58F06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F59006253B8F005AB5DA = { + children = ( + 1865F59106253B8F005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F59106253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F59206253B8F005AB5DA = { + children = ( + 1865F59306253B8F005AB5DA, + 1865F59406253B8F005AB5DA, + 1865F59506253B8F005AB5DA, + 1865F59606253B8F005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F59306253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F59406253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F59506253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F59606253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F59706253B8F005AB5DA = { + children = ( + 1865F59806253B8F005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F59806253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pg6_1.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F59906253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pg6_1.htm; + refType = 4; + sourceTree = ""; + }; + 1865F59A06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.htm; + refType = 4; + sourceTree = ""; + }; + 1865F59B06253B8F005AB5DA = { + children = ( + 1865F59C06253B8F005AB5DA, + 1865F5AF06253B8F005AB5DA, + ); + isa = PBXGroup; + path = q3ashader_manual_files; + refType = 4; + sourceTree = ""; + }; + 1865F59C06253B8F005AB5DA = { + children = ( + 1865F59D06253B8F005AB5DA, + 1865F59E06253B8F005AB5DA, + 1865F59F06253B8F005AB5DA, + 1865F5A006253B8F005AB5DA, + 1865F5A106253B8F005AB5DA, + 1865F5A306253B8F005AB5DA, + 1865F5A506253B8F005AB5DA, + 1865F5A606253B8F005AB5DA, + 1865F5A806253B8F005AB5DA, + 1865F5AD06253B8F005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F59D06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F59E06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F59F06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F5A006253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F5A106253B8F005AB5DA = { + children = ( + 1865F5A206253B8F005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5A206253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5A306253B8F005AB5DA = { + children = ( + 1865F5A406253B8F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5A406253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5A506253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F5A606253B8F005AB5DA = { + children = ( + 1865F5A706253B8F005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5A706253B8F005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "image002.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5A806253B8F005AB5DA = { + children = ( + 1865F5A906253B8F005AB5DA, + 1865F5AA06253B8F005AB5DA, + 1865F5AB06253B8F005AB5DA, + 1865F5AC06253B8F005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F5A906253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5AA06253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5AB06253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5AC06253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5AD06253B8F005AB5DA = { + children = ( + 1865F5AE06253B8F005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5AE06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image002.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5AF06253B8F005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = image002.jpg; + refType = 4; + sourceTree = ""; + }; + 1865F5B006253B8F005AB5DA = { + children = ( + 1865F5B106253B8F005AB5DA, + 1865F5C406253B8F005AB5DA, + ); + isa = PBXGroup; + path = styles; + refType = 4; + sourceTree = ""; + }; + 1865F5B106253B8F005AB5DA = { + children = ( + 1865F5B206253B8F005AB5DA, + 1865F5B306253B8F005AB5DA, + 1865F5B406253B8F005AB5DA, + 1865F5B506253B8F005AB5DA, + 1865F5B606253B8F005AB5DA, + 1865F5B806253B8F005AB5DA, + 1865F5BA06253B8F005AB5DA, + 1865F5BB06253B8F005AB5DA, + 1865F5BD06253B8F005AB5DA, + 1865F5C206253B8F005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F5B206253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F5B306253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F5B406253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F5B506253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F5B606253B8F005AB5DA = { + children = ( + 1865F5B706253B8F005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5B706253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5B806253B8F005AB5DA = { + children = ( + 1865F5B906253B8F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5B906253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5BA06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F5BB06253B8F005AB5DA = { + children = ( + 1865F5BC06253B8F005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5BC06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5BD06253B8F005AB5DA = { + children = ( + 1865F5BE06253B8F005AB5DA, + 1865F5BF06253B8F005AB5DA, + 1865F5C006253B8F005AB5DA, + 1865F5C106253B8F005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F5BE06253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5BF06253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5C006253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5C106253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5C206253B8F005AB5DA = { + children = ( + 1865F5C306253B8F005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5C306253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q3rad.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5C406253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = q3rad.css; + refType = 4; + sourceTree = ""; + }; + 1865F5C506253B8F005AB5DA = { + children = ( + 1865F5C606253B8F005AB5DA, + 1865F5D906253B8F005AB5DA, + 1865F61B06253B91005AB5DA, + 1865F65306253B92005AB5DA, + ); + isa = PBXGroup; + path = Team_Arena_Mapping_Help; + refType = 4; + sourceTree = ""; + }; + 1865F5C606253B8F005AB5DA = { + children = ( + 1865F5C706253B8F005AB5DA, + 1865F5C806253B8F005AB5DA, + 1865F5C906253B8F005AB5DA, + 1865F5CA06253B8F005AB5DA, + 1865F5CB06253B8F005AB5DA, + 1865F5CD06253B8F005AB5DA, + 1865F5CF06253B8F005AB5DA, + 1865F5D006253B8F005AB5DA, + 1865F5D206253B8F005AB5DA, + 1865F5D706253B8F005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F5C706253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F5C806253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F5C906253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F5CA06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F5CB06253B8F005AB5DA = { + children = ( + 1865F5CC06253B8F005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5CC06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5CD06253B8F005AB5DA = { + children = ( + 1865F5CE06253B8F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5CE06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5CF06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F5D006253B8F005AB5DA = { + children = ( + 1865F5D106253B8F005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5D106253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5D206253B8F005AB5DA = { + children = ( + 1865F5D306253B8F005AB5DA, + 1865F5D406253B8F005AB5DA, + 1865F5D506253B8F005AB5DA, + 1865F5D606253B8F005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F5D306253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5D406253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5D506253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5D606253B8F005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5D706253B8F005AB5DA = { + children = ( + 1865F5D806253B8F005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F5D806253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5D906253B8F005AB5DA = { + children = ( + 1865F5DA06253B8F005AB5DA, + 1865F61106253B90005AB5DA, + 1865F61206253B90005AB5DA, + 1865F61306253B90005AB5DA, + 1865F61406253B90005AB5DA, + 1865F61506253B90005AB5DA, + 1865F61606253B90005AB5DA, + 1865F61706253B90005AB5DA, + 1865F61806253B90005AB5DA, + 1865F61906253B90005AB5DA, + 1865F61A06253B90005AB5DA, + ); + isa = PBXGroup; + path = pages; + refType = 4; + sourceTree = ""; + }; + 1865F5DA06253B8F005AB5DA = { + children = ( + 1865F5DB06253B8F005AB5DA, + 1865F5DC06253B8F005AB5DA, + 1865F5DD06253B8F005AB5DA, + 1865F5DE06253B8F005AB5DA, + 1865F5DF06253B8F005AB5DA, + 1865F5EA06253B90005AB5DA, + 1865F5F506253B90005AB5DA, + 1865F5F606253B90005AB5DA, + 1865F60106253B90005AB5DA, + 1865F60606253B90005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F5DB06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F5DC06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F5DD06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F5DE06253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F5DF06253B8F005AB5DA = { + children = ( + 1865F5E006253B8F005AB5DA, + 1865F5E106253B8F005AB5DA, + 1865F5E206253B8F005AB5DA, + 1865F5E306253B8F005AB5DA, + 1865F5E406253B8F005AB5DA, + 1865F5E506253B8F005AB5DA, + 1865F5E606253B8F005AB5DA, + 1865F5E706253B8F005AB5DA, + 1865F5E806253B90005AB5DA, + 1865F5E906253B90005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E006253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design_tips.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E106253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map_converters_checklist.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E206253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preface.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E306253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E406253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ta_game_types.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E506253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E606253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_entity_definitions.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E706253B8F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_prefabs.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E806253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_powerup_bases.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5E906253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "using_new_game_entities.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5EA06253B90005AB5DA = { + children = ( + 1865F5EB06253B90005AB5DA, + 1865F5EC06253B90005AB5DA, + 1865F5ED06253B90005AB5DA, + 1865F5EE06253B90005AB5DA, + 1865F5EF06253B90005AB5DA, + 1865F5F006253B90005AB5DA, + 1865F5F106253B90005AB5DA, + 1865F5F206253B90005AB5DA, + 1865F5F306253B90005AB5DA, + 1865F5F406253B90005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F5EB06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design_tips.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5EC06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map_converters_checklist.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5ED06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preface.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5EE06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5EF06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ta_game_types.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F006253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F106253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_entity_definitions.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F206253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_prefabs.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F306253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_powerup_bases.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F406253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "using_new_game_entities.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F5F506253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F5F606253B90005AB5DA = { + children = ( + 1865F5F706253B90005AB5DA, + 1865F5F806253B90005AB5DA, + 1865F5F906253B90005AB5DA, + 1865F5FA06253B90005AB5DA, + 1865F5FB06253B90005AB5DA, + 1865F5FC06253B90005AB5DA, + 1865F5FD06253B90005AB5DA, + 1865F5FE06253B90005AB5DA, + 1865F5FF06253B90005AB5DA, + 1865F60006253B90005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5F706253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design_tips.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5F806253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map_converters_checklist.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5F906253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preface.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FA06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FB06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ta_game_types.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FC06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.htm.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FD06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_entity_definitions.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FE06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_prefabs.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F5FF06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_powerup_bases.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F60006253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "using_new_game_entities.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F60106253B90005AB5DA = { + children = ( + 1865F60206253B90005AB5DA, + 1865F60306253B90005AB5DA, + 1865F60406253B90005AB5DA, + 1865F60506253B90005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F60206253B90005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F60306253B90005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F60406253B90005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F60506253B90005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F60606253B90005AB5DA = { + children = ( + 1865F60706253B90005AB5DA, + 1865F60806253B90005AB5DA, + 1865F60906253B90005AB5DA, + 1865F60A06253B90005AB5DA, + 1865F60B06253B90005AB5DA, + 1865F60C06253B90005AB5DA, + 1865F60D06253B90005AB5DA, + 1865F60E06253B90005AB5DA, + 1865F60F06253B90005AB5DA, + 1865F61006253B90005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F60706253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design_tips.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60806253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map_converters_checklist.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60906253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "preface.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60A06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60B06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ta_game_types.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60C06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.htm.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60D06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_entity_definitions.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60E06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_arena_prefabs.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F60F06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "team_powerup_bases.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F61006253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "using_new_game_entities.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F61106253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = design_tips.html; + refType = 4; + sourceTree = ""; + }; + 1865F61206253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = map_converters_checklist.html; + refType = 4; + sourceTree = ""; + }; + 1865F61306253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = preface.html; + refType = 4; + sourceTree = ""; + }; + 1865F61406253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = related_links.html; + refType = 4; + sourceTree = ""; + }; + 1865F61506253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = ta_game_types.html; + refType = 4; + sourceTree = ""; + }; + 1865F61606253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = table_of_contents.htm; + refType = 4; + sourceTree = ""; + }; + 1865F61706253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = team_arena_entity_definitions.html; + refType = 4; + sourceTree = ""; + }; + 1865F61806253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = team_arena_prefabs.html; + refType = 4; + sourceTree = ""; + }; + 1865F61906253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = team_powerup_bases.html; + refType = 4; + sourceTree = ""; + }; + 1865F61A06253B90005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = using_new_game_entities.html; + refType = 4; + sourceTree = ""; + }; + 1865F61B06253B91005AB5DA = { + children = ( + 1865F61C06253B91005AB5DA, + 1865F64B06253B92005AB5DA, + 1865F64C06253B92005AB5DA, + 1865F64D06253B92005AB5DA, + 1865F64E06253B92005AB5DA, + 1865F64F06253B92005AB5DA, + 1865F65006253B92005AB5DA, + 1865F65106253B92005AB5DA, + 1865F65206253B92005AB5DA, + ); + isa = PBXGroup; + path = pics; + refType = 4; + sourceTree = ""; + }; + 1865F61C06253B91005AB5DA = { + children = ( + 1865F61D06253B91005AB5DA, + 1865F61E06253B91005AB5DA, + 1865F61F06253B91005AB5DA, + 1865F62006253B91005AB5DA, + 1865F62106253B91005AB5DA, + 1865F62A06253B91005AB5DA, + 1865F63306253B91005AB5DA, + 1865F63406253B91005AB5DA, + 1865F63D06253B91005AB5DA, + 1865F64206253B91005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F61D06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F61E06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F61F06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F62006253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F62106253B91005AB5DA = { + children = ( + 1865F62206253B91005AB5DA, + 1865F62306253B91005AB5DA, + 1865F62406253B91005AB5DA, + 1865F62506253B91005AB5DA, + 1865F62606253B91005AB5DA, + 1865F62706253B91005AB5DA, + 1865F62806253B91005AB5DA, + 1865F62906253B91005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62206253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CRUSADER.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62306253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INTRUDER.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62406253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62506253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MAINPOP.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62606253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MENUBACKgif.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62706253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PAGANs.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62806253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STROGGS.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62906253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "THEFALLEN.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F62A06253B91005AB5DA = { + children = ( + 1865F62B06253B91005AB5DA, + 1865F62C06253B91005AB5DA, + 1865F62D06253B91005AB5DA, + 1865F62E06253B91005AB5DA, + 1865F62F06253B91005AB5DA, + 1865F63006253B91005AB5DA, + 1865F63106253B91005AB5DA, + 1865F63206253B91005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F62B06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CRUSADER.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F62C06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INTRUDER.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F62D06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F62E06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MAINPOP.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F62F06253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MENUBACKgif.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F63006253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PAGANs.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F63106253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STROGGS.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F63206253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "THEFALLEN.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F63306253B91005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F63406253B91005AB5DA = { + children = ( + 1865F63506253B91005AB5DA, + 1865F63606253B91005AB5DA, + 1865F63706253B91005AB5DA, + 1865F63806253B91005AB5DA, + 1865F63906253B91005AB5DA, + 1865F63A06253B91005AB5DA, + 1865F63B06253B91005AB5DA, + 1865F63C06253B91005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63506253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "CRUSADER.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63606253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "INTRUDER.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63706253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "logo.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63806253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "MAINPOP.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63906253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "MENUBACKgif.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63A06253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "PAGANs.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63B06253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "STROGGS.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63C06253B91005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "THEFALLEN.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63D06253B91005AB5DA = { + children = ( + 1865F63E06253B91005AB5DA, + 1865F63F06253B91005AB5DA, + 1865F64006253B91005AB5DA, + 1865F64106253B91005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F63E06253B91005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F63F06253B91005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F64006253B91005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F64106253B91005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F64206253B91005AB5DA = { + children = ( + 1865F64306253B92005AB5DA, + 1865F64406253B92005AB5DA, + 1865F64506253B92005AB5DA, + 1865F64606253B92005AB5DA, + 1865F64706253B92005AB5DA, + 1865F64806253B92005AB5DA, + 1865F64906253B92005AB5DA, + 1865F64A06253B92005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F64306253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "CRUSADER.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64406253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "INTRUDER.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64506253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "logo.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64606253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MAINPOP.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64706253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "MENUBACKgif.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64806253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "PAGANs.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64906253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "STROGGS.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64A06253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "THEFALLEN.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F64B06253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = CRUSADER.gif; + refType = 4; + sourceTree = ""; + }; + 1865F64C06253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = INTRUDER.gif; + refType = 4; + sourceTree = ""; + }; + 1865F64D06253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = logo.gif; + refType = 4; + sourceTree = ""; + }; + 1865F64E06253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = MAINPOP.gif; + refType = 4; + sourceTree = ""; + }; + 1865F64F06253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = MENUBACKgif.gif; + refType = 4; + sourceTree = ""; + }; + 1865F65006253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = PAGANs.gif; + refType = 4; + sourceTree = ""; + }; + 1865F65106253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = STROGGS.gif; + refType = 4; + sourceTree = ""; + }; + 1865F65206253B92005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = THEFALLEN.gif; + refType = 4; + sourceTree = ""; + }; + 1865F65306253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = start.html; + refType = 4; + sourceTree = ""; + }; + 1865F65406253B92005AB5DA = { + children = ( + 1865F65506253B92005AB5DA, + 1865F66806253B93005AB5DA, + 1865F71306253B97005AB5DA, + 1865F73206253B98005AB5DA, + ); + isa = PBXGroup; + path = Terrain_Manual; + refType = 4; + sourceTree = ""; + }; + 1865F65506253B92005AB5DA = { + children = ( + 1865F65606253B92005AB5DA, + 1865F65706253B92005AB5DA, + 1865F65806253B92005AB5DA, + 1865F65906253B92005AB5DA, + 1865F65A06253B92005AB5DA, + 1865F65C06253B92005AB5DA, + 1865F65E06253B92005AB5DA, + 1865F65F06253B92005AB5DA, + 1865F66106253B92005AB5DA, + 1865F66606253B93005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F65606253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F65706253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F65806253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F65906253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F65A06253B92005AB5DA = { + children = ( + 1865F65B06253B92005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F65B06253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F65C06253B92005AB5DA = { + children = ( + 1865F65D06253B92005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F65D06253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F65E06253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F65F06253B92005AB5DA = { + children = ( + 1865F66006253B92005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F66006253B92005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F66106253B92005AB5DA = { + children = ( + 1865F66206253B93005AB5DA, + 1865F66306253B93005AB5DA, + 1865F66406253B93005AB5DA, + 1865F66506253B93005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F66206253B93005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F66306253B93005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F66406253B93005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F66506253B93005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F66606253B93005AB5DA = { + children = ( + 1865F66706253B93005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F66706253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F66806253B93005AB5DA = { + children = ( + 1865F66906253B93005AB5DA, + 1865F6F406253B96005AB5DA, + 1865F6F506253B96005AB5DA, + 1865F6F606253B96005AB5DA, + 1865F6F706253B96005AB5DA, + 1865F6F806253B96005AB5DA, + 1865F6F906253B96005AB5DA, + 1865F6FA06253B96005AB5DA, + 1865F6FB06253B96005AB5DA, + 1865F6FC06253B96005AB5DA, + 1865F6FD06253B96005AB5DA, + 1865F6FE06253B96005AB5DA, + 1865F6FF06253B96005AB5DA, + 1865F70006253B96005AB5DA, + 1865F70106253B96005AB5DA, + 1865F70206253B97005AB5DA, + 1865F70306253B97005AB5DA, + 1865F70406253B97005AB5DA, + 1865F70506253B97005AB5DA, + 1865F70606253B97005AB5DA, + 1865F70706253B97005AB5DA, + 1865F70806253B97005AB5DA, + 1865F70906253B97005AB5DA, + 1865F70A06253B97005AB5DA, + 1865F70B06253B97005AB5DA, + 1865F70C06253B97005AB5DA, + 1865F70D06253B97005AB5DA, + 1865F70E06253B97005AB5DA, + 1865F70F06253B97005AB5DA, + 1865F71006253B97005AB5DA, + 1865F71106253B97005AB5DA, + 1865F71206253B97005AB5DA, + ); + isa = PBXGroup; + path = pages; + refType = 4; + sourceTree = ""; + }; + 1865F66906253B93005AB5DA = { + children = ( + 1865F66A06253B93005AB5DA, + 1865F66B06253B93005AB5DA, + 1865F66C06253B93005AB5DA, + 1865F66D06253B93005AB5DA, + 1865F66E06253B93005AB5DA, + 1865F68E06253B94005AB5DA, + 1865F6AE06253B94005AB5DA, + 1865F6AF06253B94005AB5DA, + 1865F6CF06253B95005AB5DA, + 1865F6D406253B96005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F66A06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F66B06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F66C06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F66D06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F66E06253B93005AB5DA = { + children = ( + 1865F66F06253B93005AB5DA, + 1865F67006253B93005AB5DA, + 1865F67106253B93005AB5DA, + 1865F67206253B93005AB5DA, + 1865F67306253B93005AB5DA, + 1865F67406253B93005AB5DA, + 1865F67506253B93005AB5DA, + 1865F67606253B93005AB5DA, + 1865F67706253B93005AB5DA, + 1865F67806253B93005AB5DA, + 1865F67906253B93005AB5DA, + 1865F67A06253B93005AB5DA, + 1865F67B06253B93005AB5DA, + 1865F67C06253B93005AB5DA, + 1865F67D06253B93005AB5DA, + 1865F67E06253B93005AB5DA, + 1865F67F06253B93005AB5DA, + 1865F68006253B93005AB5DA, + 1865F68106253B93005AB5DA, + 1865F68206253B93005AB5DA, + 1865F68306253B93005AB5DA, + 1865F68406253B93005AB5DA, + 1865F68506253B93005AB5DA, + 1865F68606253B93005AB5DA, + 1865F68706253B93005AB5DA, + 1865F68806253B93005AB5DA, + 1865F68906253B93005AB5DA, + 1865F68A06253B93005AB5DA, + 1865F68B06253B94005AB5DA, + 1865F68C06253B94005AB5DA, + 1865F68D06253B94005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F66F06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_bots.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67006253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_buildings_to_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67106253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "art_tools.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67206253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "blocking_vis.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67306253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "boxing_in_the_world.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67406253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clipping_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67506253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_alphamap.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67606253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67706253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_keys_and_values.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67806253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glossary.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67906253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_map_into_terrain_mesh.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67A06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_maps.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67B06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image3.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67C06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image4.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67D06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image5.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67E06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image6.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F67F06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "introduction.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68006253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "key_changes.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68106253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lighting_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68206253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "manipulating_the_terrain_mesh.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68306253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapping_the_textures.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68406253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "new_or_revised_q3map_shader_comm.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68506253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "other_possible_height_map_tools.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68606253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68706253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "suggested_gensurf_settings.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68806253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68906253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_entity.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68A06253B93005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_mesh_into_terrain_entity.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68B06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_related_worldspawn_features.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68C06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_texture.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68D06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "the_meta_shader.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F68E06253B94005AB5DA = { + children = ( + 1865F68F06253B94005AB5DA, + 1865F69006253B94005AB5DA, + 1865F69106253B94005AB5DA, + 1865F69206253B94005AB5DA, + 1865F69306253B94005AB5DA, + 1865F69406253B94005AB5DA, + 1865F69506253B94005AB5DA, + 1865F69606253B94005AB5DA, + 1865F69706253B94005AB5DA, + 1865F69806253B94005AB5DA, + 1865F69906253B94005AB5DA, + 1865F69A06253B94005AB5DA, + 1865F69B06253B94005AB5DA, + 1865F69C06253B94005AB5DA, + 1865F69D06253B94005AB5DA, + 1865F69E06253B94005AB5DA, + 1865F69F06253B94005AB5DA, + 1865F6A006253B94005AB5DA, + 1865F6A106253B94005AB5DA, + 1865F6A206253B94005AB5DA, + 1865F6A306253B94005AB5DA, + 1865F6A406253B94005AB5DA, + 1865F6A506253B94005AB5DA, + 1865F6A606253B94005AB5DA, + 1865F6A706253B94005AB5DA, + 1865F6A806253B94005AB5DA, + 1865F6A906253B94005AB5DA, + 1865F6AA06253B94005AB5DA, + 1865F6AB06253B94005AB5DA, + 1865F6AC06253B94005AB5DA, + 1865F6AD06253B94005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F68F06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_bots.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69006253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_buildings_to_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69106253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "art_tools.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69206253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "blocking_vis.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69306253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "boxing_in_the_world.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69406253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clipping_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69506253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_alphamap.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69606253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69706253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_keys_and_values.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69806253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glossary.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69906253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_map_into_terrain_mesh.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69A06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_maps.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69B06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image3.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69C06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image4.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69D06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image5.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69E06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image6.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F69F06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "introduction.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A006253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "key_changes.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A106253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lighting_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A206253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "manipulating_the_terrain_mesh.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A306253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapping_the_textures.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A406253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "new_or_revised_q3map_shader_comm.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A506253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "other_possible_height_map_tools.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A606253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A706253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "suggested_gensurf_settings.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A806253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6A906253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_entity.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6AA06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_mesh_into_terrain_entity.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6AB06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_related_worldspawn_features.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6AC06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_texture.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6AD06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "the_meta_shader.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6AE06253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F6AF06253B94005AB5DA = { + children = ( + 1865F6B006253B94005AB5DA, + 1865F6B106253B95005AB5DA, + 1865F6B206253B95005AB5DA, + 1865F6B306253B95005AB5DA, + 1865F6B406253B95005AB5DA, + 1865F6B506253B95005AB5DA, + 1865F6B606253B95005AB5DA, + 1865F6B706253B95005AB5DA, + 1865F6B806253B95005AB5DA, + 1865F6B906253B95005AB5DA, + 1865F6BA06253B95005AB5DA, + 1865F6BB06253B95005AB5DA, + 1865F6BC06253B95005AB5DA, + 1865F6BD06253B95005AB5DA, + 1865F6BE06253B95005AB5DA, + 1865F6BF06253B95005AB5DA, + 1865F6C006253B95005AB5DA, + 1865F6C106253B95005AB5DA, + 1865F6C206253B95005AB5DA, + 1865F6C306253B95005AB5DA, + 1865F6C406253B95005AB5DA, + 1865F6C506253B95005AB5DA, + 1865F6C606253B95005AB5DA, + 1865F6C706253B95005AB5DA, + 1865F6C806253B95005AB5DA, + 1865F6C906253B95005AB5DA, + 1865F6CA06253B95005AB5DA, + 1865F6CB06253B95005AB5DA, + 1865F6CC06253B95005AB5DA, + 1865F6CD06253B95005AB5DA, + 1865F6CE06253B95005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B006253B94005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_bots.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B106253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_buildings_to_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B206253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "art_tools.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B306253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "blocking_vis.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B406253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "boxing_in_the_world.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B506253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clipping_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B606253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_alphamap.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B706253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B806253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_keys_and_values.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6B906253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glossary.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BA06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_map_into_terrain_mesh.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BB06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_maps.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BC06253B95005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "Image3.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BD06253B95005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "Image4.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BE06253B95005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "Image5.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6BF06253B95005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "Image6.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C006253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "introduction.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C106253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "key_changes.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C206253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lighting_the_terrain.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C306253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "manipulating_the_terrain_mesh.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C406253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapping_the_textures.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C506253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "new_or_revised_q3map_shader_comm.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C606253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "other_possible_height_map_tools.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C706253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C806253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "suggested_gensurf_settings.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6C906253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CA06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_entity.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CB06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_mesh_into_terrain_entity.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CC06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_related_worldspawn_features.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CD06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_texture.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CE06253B95005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "the_meta_shader.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6CF06253B95005AB5DA = { + children = ( + 1865F6D006253B95005AB5DA, + 1865F6D106253B96005AB5DA, + 1865F6D206253B96005AB5DA, + 1865F6D306253B96005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F6D006253B95005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6D106253B96005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F6D206253B96005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F6D306253B96005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F6D406253B96005AB5DA = { + children = ( + 1865F6D506253B96005AB5DA, + 1865F6D606253B96005AB5DA, + 1865F6D706253B96005AB5DA, + 1865F6D806253B96005AB5DA, + 1865F6D906253B96005AB5DA, + 1865F6DA06253B96005AB5DA, + 1865F6DB06253B96005AB5DA, + 1865F6DC06253B96005AB5DA, + 1865F6DD06253B96005AB5DA, + 1865F6DE06253B96005AB5DA, + 1865F6DF06253B96005AB5DA, + 1865F6E006253B96005AB5DA, + 1865F6E106253B96005AB5DA, + 1865F6E206253B96005AB5DA, + 1865F6E306253B96005AB5DA, + 1865F6E406253B96005AB5DA, + 1865F6E506253B96005AB5DA, + 1865F6E606253B96005AB5DA, + 1865F6E706253B96005AB5DA, + 1865F6E806253B96005AB5DA, + 1865F6E906253B96005AB5DA, + 1865F6EA06253B96005AB5DA, + 1865F6EB06253B96005AB5DA, + 1865F6EC06253B96005AB5DA, + 1865F6ED06253B96005AB5DA, + 1865F6EE06253B96005AB5DA, + 1865F6EF06253B96005AB5DA, + 1865F6F006253B96005AB5DA, + 1865F6F106253B96005AB5DA, + 1865F6F206253B96005AB5DA, + 1865F6F306253B96005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F6D506253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_bots.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6D606253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "adding_buildings_to_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6D706253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "art_tools.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6D806253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "blocking_vis.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6D906253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "boxing_in_the_world.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DA06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clipping_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DB06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_alphamap.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DC06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "creating_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DD06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_keys_and_values.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DE06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "glossary.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6DF06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_map_into_terrain_mesh.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E006253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "height_maps.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E106253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image3.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E206253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image4.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E306253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image5.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E406253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Image6.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E506253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "introduction.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E606253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "key_changes.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E706253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lighting_the_terrain.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E806253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "manipulating_the_terrain_mesh.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6E906253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapping_the_textures.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6EA06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "new_or_revised_q3map_shader_comm.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6EB06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "other_possible_height_map_tools.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6EC06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "related_links.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6ED06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "suggested_gensurf_settings.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6EE06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "table_of_contents.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6EF06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_entity.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6F006253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_mesh_into_terrain_entity.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6F106253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_related_worldspawn_features.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6F206253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain_texture.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6F306253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "the_meta_shader.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F6F406253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = adding_bots.html; + refType = 4; + sourceTree = ""; + }; + 1865F6F506253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = adding_buildings_to_terrain.html; + refType = 4; + sourceTree = ""; + }; + 1865F6F606253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = art_tools.html; + refType = 4; + sourceTree = ""; + }; + 1865F6F706253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = blocking_vis.html; + refType = 4; + sourceTree = ""; + }; + 1865F6F806253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = boxing_in_the_world.html; + refType = 4; + sourceTree = ""; + }; + 1865F6F906253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = clipping_the_terrain.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FA06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = creating_the_alphamap.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FB06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = creating_the_terrain.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FC06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = entity_keys_and_values.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FD06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = glossary.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FE06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = height_map_into_terrain_mesh.html; + refType = 4; + sourceTree = ""; + }; + 1865F6FF06253B96005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = height_maps.html; + refType = 4; + sourceTree = ""; + }; + 1865F70006253B96005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = Image3.gif; + refType = 4; + sourceTree = ""; + }; + 1865F70106253B96005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = Image4.gif; + refType = 4; + sourceTree = ""; + }; + 1865F70206253B97005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = Image5.gif; + refType = 4; + sourceTree = ""; + }; + 1865F70306253B97005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = Image6.gif; + refType = 4; + sourceTree = ""; + }; + 1865F70406253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = introduction.html; + refType = 4; + sourceTree = ""; + }; + 1865F70506253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = key_changes.html; + refType = 4; + sourceTree = ""; + }; + 1865F70606253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = lighting_the_terrain.html; + refType = 4; + sourceTree = ""; + }; + 1865F70706253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = manipulating_the_terrain_mesh.html; + refType = 4; + sourceTree = ""; + }; + 1865F70806253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = mapping_the_textures.html; + refType = 4; + sourceTree = ""; + }; + 1865F70906253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = new_or_revised_q3map_shader_comm.html; + refType = 4; + sourceTree = ""; + }; + 1865F70A06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = other_possible_height_map_tools.html; + refType = 4; + sourceTree = ""; + }; + 1865F70B06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = related_links.html; + refType = 4; + sourceTree = ""; + }; + 1865F70C06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = suggested_gensurf_settings.html; + refType = 4; + sourceTree = ""; + }; + 1865F70D06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = table_of_contents.html; + refType = 4; + sourceTree = ""; + }; + 1865F70E06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = terrain_entity.html; + refType = 4; + sourceTree = ""; + }; + 1865F70F06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = terrain_mesh_into_terrain_entity.html; + refType = 4; + sourceTree = ""; + }; + 1865F71006253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = terrain_related_worldspawn_features.html; + refType = 4; + sourceTree = ""; + }; + 1865F71106253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = terrain_texture.html; + refType = 4; + sourceTree = ""; + }; + 1865F71206253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = the_meta_shader.html; + refType = 4; + sourceTree = ""; + }; + 1865F71306253B97005AB5DA = { + children = ( + 1865F71406253B97005AB5DA, + 1865F72F06253B98005AB5DA, + 1865F73006253B98005AB5DA, + 1865F73106253B98005AB5DA, + ); + isa = PBXGroup; + path = pics; + refType = 4; + sourceTree = ""; + }; + 1865F71406253B97005AB5DA = { + children = ( + 1865F71506253B97005AB5DA, + 1865F71606253B97005AB5DA, + 1865F71706253B97005AB5DA, + 1865F71806253B97005AB5DA, + 1865F71906253B97005AB5DA, + 1865F71D06253B97005AB5DA, + 1865F72106253B98005AB5DA, + 1865F72206253B98005AB5DA, + 1865F72606253B98005AB5DA, + 1865F72B06253B98005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F71506253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F71606253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F71706253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F71806253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F71906253B97005AB5DA = { + children = ( + 1865F71A06253B97005AB5DA, + 1865F71B06253B97005AB5DA, + 1865F71C06253B97005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F71A06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "background.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F71B06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F71C06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F71D06253B97005AB5DA = { + children = ( + 1865F71E06253B97005AB5DA, + 1865F71F06253B97005AB5DA, + 1865F72006253B98005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F71E06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "background.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F71F06253B97005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F72006253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F72106253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F72206253B98005AB5DA = { + children = ( + 1865F72306253B98005AB5DA, + 1865F72406253B98005AB5DA, + 1865F72506253B98005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72306253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "background.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72406253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "start.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72506253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "terrain.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72606253B98005AB5DA = { + children = ( + 1865F72706253B98005AB5DA, + 1865F72806253B98005AB5DA, + 1865F72906253B98005AB5DA, + 1865F72A06253B98005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F72706253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72806253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F72906253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F72A06253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F72B06253B98005AB5DA = { + children = ( + 1865F72C06253B98005AB5DA, + 1865F72D06253B98005AB5DA, + 1865F72E06253B98005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F72C06253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "background.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F72D06253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "start.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F72E06253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "terrain.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F72F06253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = background.jpg; + refType = 4; + sourceTree = ""; + }; + 1865F73006253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = start.gif; + refType = 4; + sourceTree = ""; + }; + 1865F73106253B98005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = terrain.jpg; + refType = 4; + sourceTree = ""; + }; + 1865F73206253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = start.html; + refType = 4; + sourceTree = ""; + }; + 1865F73306253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = DoxyConfig; + refType = 4; + sourceTree = ""; + }; + 1865F73406253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Doxyfile; + refType = 4; + sourceTree = ""; + }; + 1865F73506253B98005AB5DA = { + children = ( + 1865F73606253B98005AB5DA, + 1865F74506253B99005AB5DA, + ); + isa = PBXGroup; + path = "doxygen-out"; + refType = 4; + sourceTree = ""; + }; + 1865F73606253B98005AB5DA = { + children = ( + 1865F73706253B98005AB5DA, + 1865F73806253B98005AB5DA, + 1865F73906253B98005AB5DA, + 1865F73A06253B98005AB5DA, + 1865F73B06253B98005AB5DA, + 1865F73C06253B98005AB5DA, + 1865F73D06253B98005AB5DA, + 1865F73E06253B98005AB5DA, + 1865F73F06253B98005AB5DA, + 1865F74406253B98005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F73706253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F73806253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F73906253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F73A06253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F73B06253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F73C06253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F73D06253B98005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F73E06253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F73F06253B98005AB5DA = { + children = ( + 1865F74006253B98005AB5DA, + 1865F74106253B98005AB5DA, + 1865F74206253B98005AB5DA, + 1865F74306253B98005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F74006253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F74106253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F74206253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F74306253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F74406253B98005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F74506253B99005AB5DA = { + children = ( + 1865F74606253B99005AB5DA, + ); + isa = PBXGroup; + path = images; + refType = 4; + sourceTree = ""; + }; + 1865F74606253B99005AB5DA = { + children = ( + 1865F74706253B99005AB5DA, + 1865F74806253B99005AB5DA, + 1865F74906253B99005AB5DA, + 1865F74A06253B99005AB5DA, + 1865F74B06253B99005AB5DA, + 1865F74C06253B99005AB5DA, + 1865F74D06253B99005AB5DA, + 1865F74E06253B99005AB5DA, + 1865F74F06253B99005AB5DA, + 1865F75406253B99005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F74706253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F74806253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F74906253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F74A06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F74B06253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F74C06253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F74D06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F74E06253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F74F06253B99005AB5DA = { + children = ( + 1865F75006253B99005AB5DA, + 1865F75106253B99005AB5DA, + 1865F75206253B99005AB5DA, + 1865F75306253B99005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F75006253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75106253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F75206253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75306253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F75406253B99005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F75506253B99005AB5DA = { + children = ( + 1865F75606253B99005AB5DA, + 1865F79106253B9A005AB5DA, + 1865F79206253B9A005AB5DA, + 1865F79306253B9A005AB5DA, + 1865F79406253B9A005AB5DA, + 1865F79506253B9A005AB5DA, + 1865F79606253B9A005AB5DA, + 1865F79706253B9A005AB5DA, + 1865F79806253B9A005AB5DA, + 1865F79906253B9A005AB5DA, + 1865F7F906253B9D005AB5DA, + 1865F7FA06253B9D005AB5DA, + 1865F7FB06253B9D005AB5DA, + 1865F85106253B9D005AB5DA, + ); + isa = PBXGroup; + path = Doxygen_files; + refType = 4; + sourceTree = ""; + }; + 1865F75606253B99005AB5DA = { + children = ( + 1865F75706253B99005AB5DA, + 1865F75806253B99005AB5DA, + 1865F75906253B99005AB5DA, + 1865F75A06253B99005AB5DA, + 1865F75B06253B99005AB5DA, + 1865F76706253B99005AB5DA, + 1865F77306253B9A005AB5DA, + 1865F77406253B9A005AB5DA, + 1865F78006253B9A005AB5DA, + 1865F78506253B9A005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F75706253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F75806253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F75906253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F75A06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F75B06253B99005AB5DA = { + children = ( + 1865F75C06253B99005AB5DA, + 1865F75D06253B99005AB5DA, + 1865F75E06253B99005AB5DA, + 1865F75F06253B99005AB5DA, + 1865F76006253B99005AB5DA, + 1865F76106253B99005AB5DA, + 1865F76206253B99005AB5DA, + 1865F76306253B99005AB5DA, + 1865F76406253B99005AB5DA, + 1865F76506253B99005AB5DA, + 1865F76606253B99005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75C06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxy_mainpage.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75D06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75E06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F75F06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_foot.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76006253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_head.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76106253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76206253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_foot.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76306253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_head.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76406253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendoxfunctions.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76506253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genDoxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76606253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference1.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F76706253B99005AB5DA = { + children = ( + 1865F76806253B99005AB5DA, + 1865F76906253B99005AB5DA, + 1865F76A06253B99005AB5DA, + 1865F76B06253B99005AB5DA, + 1865F76C06253B99005AB5DA, + 1865F76D06253B99005AB5DA, + 1865F76E06253B99005AB5DA, + 1865F76F06253B99005AB5DA, + 1865F77006253B9A005AB5DA, + 1865F77106253B9A005AB5DA, + 1865F77206253B9A005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F76806253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxy_mainpage.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76906253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76A06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76B06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_foot.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76C06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_head.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76D06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76E06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_foot.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F76F06253B99005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_head.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F77006253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendoxfunctions.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F77106253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genDoxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F77206253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference1.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F77306253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F77406253B9A005AB5DA = { + children = ( + 1865F77506253B9A005AB5DA, + 1865F77606253B9A005AB5DA, + 1865F77706253B9A005AB5DA, + 1865F77806253B9A005AB5DA, + 1865F77906253B9A005AB5DA, + 1865F77A06253B9A005AB5DA, + 1865F77B06253B9A005AB5DA, + 1865F77C06253B9A005AB5DA, + 1865F77D06253B9A005AB5DA, + 1865F77E06253B9A005AB5DA, + 1865F77F06253B9A005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77506253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxy_mainpage.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77606253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77706253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77806253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_foot.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77906253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_head.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77A06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77B06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_foot.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77C06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_head.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77D06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = "gendoxfunctions.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77E06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genDoxyfile.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F77F06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference1.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F78006253B9A005AB5DA = { + children = ( + 1865F78106253B9A005AB5DA, + 1865F78206253B9A005AB5DA, + 1865F78306253B9A005AB5DA, + 1865F78406253B9A005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F78106253B9A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F78206253B9A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F78306253B9A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F78406253B9A005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F78506253B9A005AB5DA = { + children = ( + 1865F78606253B9A005AB5DA, + 1865F78706253B9A005AB5DA, + 1865F78806253B9A005AB5DA, + 1865F78906253B9A005AB5DA, + 1865F78A06253B9A005AB5DA, + 1865F78B06253B9A005AB5DA, + 1865F78C06253B9A005AB5DA, + 1865F78D06253B9A005AB5DA, + 1865F78E06253B9A005AB5DA, + 1865F78F06253B9A005AB5DA, + 1865F79006253B9A005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F78606253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxy_mainpage.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78706253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Doxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78806253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78906253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_foot.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78A06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant_head.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78B06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78C06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_foot.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78D06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_reference_head.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78E06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gendoxfunctions.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F78F06253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "genDoxyfile.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F79006253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "reference1.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F79106253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = doxy_mainpage.h; + refType = 4; + sourceTree = ""; + }; + 1865F79206253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Doxyfile; + refType = 4; + sourceTree = ""; + }; + 1865F79306253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = doxygen_gtkradiant.css; + refType = 4; + sourceTree = ""; + }; + 1865F79406253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = doxygen_gtkradiant_foot.html; + refType = 4; + sourceTree = ""; + }; + 1865F79506253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = doxygen_gtkradiant_head.html; + refType = 4; + sourceTree = ""; + }; + 1865F79606253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = doxygen_index.html; + refType = 4; + sourceTree = ""; + }; + 1865F79706253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = doxygen_reference_foot.html; + refType = 4; + sourceTree = ""; + }; + 1865F79806253B9A005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = doxygen_reference_head.html; + refType = 4; + sourceTree = ""; + }; + 1865F79906253B9A005AB5DA = { + children = ( + 1865F79A06253B9B005AB5DA, + 1865F7E906253B9C005AB5DA, + 1865F7EA06253B9C005AB5DA, + 1865F7EB06253B9C005AB5DA, + 1865F7EC06253B9D005AB5DA, + 1865F7ED06253B9D005AB5DA, + 1865F7EE06253B9D005AB5DA, + 1865F7EF06253B9D005AB5DA, + 1865F7F006253B9D005AB5DA, + 1865F7F106253B9D005AB5DA, + 1865F7F206253B9D005AB5DA, + 1865F7F306253B9D005AB5DA, + 1865F7F406253B9D005AB5DA, + 1865F7F506253B9D005AB5DA, + 1865F7F606253B9D005AB5DA, + 1865F7F706253B9D005AB5DA, + 1865F7F806253B9D005AB5DA, + ); + isa = PBXGroup; + path = example; + refType = 4; + sourceTree = ""; + }; + 1865F79A06253B9B005AB5DA = { + children = ( + 1865F79B06253B9B005AB5DA, + 1865F79C06253B9B005AB5DA, + 1865F79D06253B9B005AB5DA, + 1865F79E06253B9B005AB5DA, + 1865F79F06253B9B005AB5DA, + 1865F7B006253B9B005AB5DA, + 1865F7C106253B9B005AB5DA, + 1865F7C206253B9B005AB5DA, + 1865F7D306253B9C005AB5DA, + 1865F7D806253B9C005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F79B06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F79C06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F79D06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F79E06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F79F06253B9B005AB5DA = { + children = ( + 1865F7A006253B9B005AB5DA, + 1865F7A106253B9B005AB5DA, + 1865F7A206253B9B005AB5DA, + 1865F7A306253B9B005AB5DA, + 1865F7A406253B9B005AB5DA, + 1865F7A506253B9B005AB5DA, + 1865F7A606253B9B005AB5DA, + 1865F7A706253B9B005AB5DA, + 1865F7A806253B9B005AB5DA, + 1865F7A906253B9B005AB5DA, + 1865F7AA06253B9B005AB5DA, + 1865F7AB06253B9B005AB5DA, + 1865F7AC06253B9B005AB5DA, + 1865F7AD06253B9B005AB5DA, + 1865F7AE06253B9B005AB5DA, + 1865F7AF06253B9B005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A006253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "annotated.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A106253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classes.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A206253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair-members.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A306253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A406253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A506253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A606253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A706253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "functions.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A806253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.dot.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7A906253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AA06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AB06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AC06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pages.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AD06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c-source.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AE06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7AF06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "todo.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7B006253B9B005AB5DA = { + children = ( + 1865F7B106253B9B005AB5DA, + 1865F7B206253B9B005AB5DA, + 1865F7B306253B9B005AB5DA, + 1865F7B406253B9B005AB5DA, + 1865F7B506253B9B005AB5DA, + 1865F7B606253B9B005AB5DA, + 1865F7B706253B9B005AB5DA, + 1865F7B806253B9B005AB5DA, + 1865F7B906253B9B005AB5DA, + 1865F7BA06253B9B005AB5DA, + 1865F7BB06253B9B005AB5DA, + 1865F7BC06253B9B005AB5DA, + 1865F7BD06253B9B005AB5DA, + 1865F7BE06253B9B005AB5DA, + 1865F7BF06253B9B005AB5DA, + 1865F7C006253B9B005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F7B106253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "annotated.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B206253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classes.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B306253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair-members.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B406253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B506253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B606253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B706253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B806253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "functions.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7B906253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.dot.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BA06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BB06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BC06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BD06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pages.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BE06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c-source.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7BF06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7C006253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "todo.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7C106253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F7C206253B9B005AB5DA = { + children = ( + 1865F7C306253B9B005AB5DA, + 1865F7C406253B9B005AB5DA, + 1865F7C506253B9B005AB5DA, + 1865F7C606253B9B005AB5DA, + 1865F7C706253B9B005AB5DA, + 1865F7C806253B9B005AB5DA, + 1865F7C906253B9B005AB5DA, + 1865F7CA06253B9B005AB5DA, + 1865F7CB06253B9B005AB5DA, + 1865F7CC06253B9B005AB5DA, + 1865F7CD06253B9B005AB5DA, + 1865F7CE06253B9C005AB5DA, + 1865F7CF06253B9C005AB5DA, + 1865F7D006253B9C005AB5DA, + 1865F7D106253B9C005AB5DA, + 1865F7D206253B9C005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C306253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "annotated.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C406253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classes.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C506253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair-members.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C606253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C706253B9B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "doxygen.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C806253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7C906253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CA06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "functions.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CB06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.dot.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CC06253B9B005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "graph_legend.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CD06253B9B005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CE06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7CF06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pages.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D006253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c-source.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D106253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D206253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "todo.html.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D306253B9C005AB5DA = { + children = ( + 1865F7D406253B9C005AB5DA, + 1865F7D506253B9C005AB5DA, + 1865F7D606253B9C005AB5DA, + 1865F7D706253B9C005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F7D406253B9C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D506253B9C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F7D606253B9C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F7D706253B9C005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F7D806253B9C005AB5DA = { + children = ( + 1865F7D906253B9C005AB5DA, + 1865F7DA06253B9C005AB5DA, + 1865F7DB06253B9C005AB5DA, + 1865F7DC06253B9C005AB5DA, + 1865F7DD06253B9C005AB5DA, + 1865F7DE06253B9C005AB5DA, + 1865F7DF06253B9C005AB5DA, + 1865F7E006253B9C005AB5DA, + 1865F7E106253B9C005AB5DA, + 1865F7E206253B9C005AB5DA, + 1865F7E306253B9C005AB5DA, + 1865F7E406253B9C005AB5DA, + 1865F7E506253B9C005AB5DA, + 1865F7E606253B9C005AB5DA, + 1865F7E706253B9C005AB5DA, + 1865F7E806253B9C005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F7D906253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "annotated.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DA06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classes.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DB06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair-members.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DC06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "classIEpair.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DD06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DE06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "doxygen_gtkradiant.css.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7DF06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "files.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E006253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "functions.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E106253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.dot.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E206253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E306253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "graph_legend.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E406253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "index.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E506253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pages.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E606253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c-source.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E706253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "test_8c.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E806253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "todo.html.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F7E906253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = annotated.html; + refType = 4; + sourceTree = ""; + }; + 1865F7EA06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = classes.html; + refType = 4; + sourceTree = ""; + }; + 1865F7EB06253B9C005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = "classIEpair-members.html"; + refType = 4; + sourceTree = ""; + }; + 1865F7EC06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = classIEpair.html; + refType = 4; + sourceTree = ""; + }; + 1865F7ED06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = doxygen.gif; + refType = 4; + sourceTree = ""; + }; + 1865F7EE06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = doxygen_gtkradiant.css; + refType = 4; + sourceTree = ""; + }; + 1865F7EF06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = files.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F006253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = functions.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F106253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = graph_legend.dot; + refType = 4; + sourceTree = ""; + }; + 1865F7F206253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = graph_legend.gif; + refType = 4; + sourceTree = ""; + }; + 1865F7F306253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = graph_legend.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F406253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = index.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F506253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = pages.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F606253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = "test_8c-source.html"; + refType = 4; + sourceTree = ""; + }; + 1865F7F706253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = test_8c.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F806253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = todo.html; + refType = 4; + sourceTree = ""; + }; + 1865F7F906253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = gendoxfunctions; + refType = 4; + sourceTree = ""; + }; + 1865F7FA06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = genDoxyfile; + refType = 4; + sourceTree = ""; + }; + 1865F7FB06253B9D005AB5DA = { + children = ( + 1865F7FC06253B9D005AB5DA, + 1865F84306253B9D005AB5DA, + 1865F84406253B9D005AB5DA, + 1865F84506253B9D005AB5DA, + 1865F84606253B9D005AB5DA, + 1865F84706253B9D005AB5DA, + 1865F84806253B9D005AB5DA, + 1865F84906253B9D005AB5DA, + 1865F84A06253B9D005AB5DA, + 1865F84B06253B9D005AB5DA, + 1865F84C06253B9D005AB5DA, + 1865F84D06253B9D005AB5DA, + 1865F84E06253B9D005AB5DA, + 1865F84F06253B9D005AB5DA, + 1865F85006253B9D005AB5DA, + ); + isa = PBXGroup; + path = images; + refType = 4; + sourceTree = ""; + }; + 1865F7FC06253B9D005AB5DA = { + children = ( + 1865F7FD06253B9D005AB5DA, + 1865F7FE06253B9D005AB5DA, + 1865F7FF06253B9D005AB5DA, + 1865F80006253B9D005AB5DA, + 1865F80106253B9D005AB5DA, + 1865F81006253B9D005AB5DA, + 1865F81F06253B9D005AB5DA, + 1865F82006253B9D005AB5DA, + 1865F82F06253B9D005AB5DA, + 1865F83406253B9D005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F7FD06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F7FE06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F7FF06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F80006253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F80106253B9D005AB5DA = { + children = ( + 1865F80206253B9D005AB5DA, + 1865F80306253B9D005AB5DA, + 1865F80406253B9D005AB5DA, + 1865F80506253B9D005AB5DA, + 1865F80606253B9D005AB5DA, + 1865F80706253B9D005AB5DA, + 1865F80806253B9D005AB5DA, + 1865F80906253B9D005AB5DA, + 1865F80A06253B9D005AB5DA, + 1865F80B06253B9D005AB5DA, + 1865F80C06253B9D005AB5DA, + 1865F80D06253B9D005AB5DA, + 1865F80E06253B9D005AB5DA, + 1865F80F06253B9D005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80206253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-left-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80306253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-left.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80406253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80506253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80606253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-right-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80706253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-left.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80806253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80906253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80A06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80B06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash_sm.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80C06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "history_id_logo.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80D06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80E06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F80F06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-title.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F81006253B9D005AB5DA = { + children = ( + 1865F81106253B9D005AB5DA, + 1865F81206253B9D005AB5DA, + 1865F81306253B9D005AB5DA, + 1865F81406253B9D005AB5DA, + 1865F81506253B9D005AB5DA, + 1865F81606253B9D005AB5DA, + 1865F81706253B9D005AB5DA, + 1865F81806253B9D005AB5DA, + 1865F81906253B9D005AB5DA, + 1865F81A06253B9D005AB5DA, + 1865F81B06253B9D005AB5DA, + 1865F81C06253B9D005AB5DA, + 1865F81D06253B9D005AB5DA, + 1865F81E06253B9D005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F81106253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-left-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81206253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-left.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81306253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81406253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81506253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-right-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81606253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-left.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81706253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81806253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81906253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81A06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash_sm.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81B06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "history_id_logo.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81C06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81D06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81E06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-title.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F81F06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F82006253B9D005AB5DA = { + children = ( + 1865F82106253B9D005AB5DA, + 1865F82206253B9D005AB5DA, + 1865F82306253B9D005AB5DA, + 1865F82406253B9D005AB5DA, + 1865F82506253B9D005AB5DA, + 1865F82606253B9D005AB5DA, + 1865F82706253B9D005AB5DA, + 1865F82806253B9D005AB5DA, + 1865F82906253B9D005AB5DA, + 1865F82A06253B9D005AB5DA, + 1865F82B06253B9D005AB5DA, + 1865F82C06253B9D005AB5DA, + 1865F82D06253B9D005AB5DA, + 1865F82E06253B9D005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82106253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-left-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82206253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-lower-left.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82306253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-lower-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82406253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-lower-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82506253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-right-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82606253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-upper-left.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82706253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-upper-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82806253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "body-upper-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82906253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gtkr_splash.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82A06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "gtkr_splash_sm.jpg.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82B06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "history_id_logo.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82C06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "top-right.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82D06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "top-tile.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82E06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "top-title.gif.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F82F06253B9D005AB5DA = { + children = ( + 1865F83006253B9D005AB5DA, + 1865F83106253B9D005AB5DA, + 1865F83206253B9D005AB5DA, + 1865F83306253B9D005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F83006253B9D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F83106253B9D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F83206253B9D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F83306253B9D005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F83406253B9D005AB5DA = { + children = ( + 1865F83506253B9D005AB5DA, + 1865F83606253B9D005AB5DA, + 1865F83706253B9D005AB5DA, + 1865F83806253B9D005AB5DA, + 1865F83906253B9D005AB5DA, + 1865F83A06253B9D005AB5DA, + 1865F83B06253B9D005AB5DA, + 1865F83C06253B9D005AB5DA, + 1865F83D06253B9D005AB5DA, + 1865F83E06253B9D005AB5DA, + 1865F83F06253B9D005AB5DA, + 1865F84006253B9D005AB5DA, + 1865F84106253B9D005AB5DA, + 1865F84206253B9D005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F83506253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-left-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83606253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-left.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83706253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83806253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-lower-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83906253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-right-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83A06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-left.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83B06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83C06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "body-upper-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83D06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83E06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_splash_sm.jpg.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F83F06253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "history_id_logo.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F84006253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-right.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F84106253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-tile.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F84206253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "top-title.gif.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F84306253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-left-tile.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84406253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-lower-left.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84506253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-lower-right.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84606253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-lower-tile.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84706253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-right-tile.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84806253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-upper-left.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84906253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-upper-right.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84A06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "body-upper-tile.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84B06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = gtkr_splash.jpg; + refType = 4; + sourceTree = ""; + }; + 1865F84C06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.jpeg; + path = gtkr_splash_sm.jpg; + refType = 4; + sourceTree = ""; + }; + 1865F84D06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = history_id_logo.gif; + refType = 4; + sourceTree = ""; + }; + 1865F84E06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "top-right.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F84F06253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "top-tile.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F85006253B9D005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.gif; + path = "top-title.gif"; + refType = 4; + sourceTree = ""; + }; + 1865F85106253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.html; + path = reference1.html; + refType = 4; + sourceTree = ""; + }; + 1865F85206253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = gen.readme; + refType = 4; + sourceTree = ""; + }; + 1865F85306253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = gen.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F85406253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.sh; + path = gendox; + refType = 4; + sourceTree = ""; + }; + 1865F85506253B9D005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = GPL; + refType = 4; + sourceTree = ""; + }; + 1865F85606253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = GtkRadiant.prj; + refType = 4; + sourceTree = ""; + }; + 1865F85706253B9E005AB5DA = { + children = ( + 1865F85806253B9E005AB5DA, + 1865F85906253B9E005AB5DA, + 1865F8F406253BA1005AB5DA, + 1865F8F506253BA1005AB5DA, + 1865F8F606253BA1005AB5DA, + 1865F8F706253BA1005AB5DA, + 1865F8F806253BA1005AB5DA, + 1865F8F906253BA1005AB5DA, + 1865F8FA06253BA1005AB5DA, + 1865F8FB06253BA1005AB5DA, + 1865F8FC06253BA1005AB5DA, + 1865F8FD06253BA1005AB5DA, + 1865F8FE06253BA1005AB5DA, + 1865F8FF06253BA1005AB5DA, + 1865F90006253BA1005AB5DA, + 1865F90106253BA1005AB5DA, + 1865F90206253BA1005AB5DA, + 1865F90306253BA1005AB5DA, + 1865F90406253BA1005AB5DA, + 1865F90506253BA1005AB5DA, + 1865F90606253BA1005AB5DA, + 1865F90706253BA2005AB5DA, + 1865F90806253BA2005AB5DA, + 1865F90906253BA2005AB5DA, + 1865F90A06253BA2005AB5DA, + 1865F90B06253BA2005AB5DA, + 1865F90C06253BA2005AB5DA, + 1865F90D06253BA2005AB5DA, + 1865F90E06253BA2005AB5DA, + 1865F90F06253BA2005AB5DA, + 1865F91006253BA2005AB5DA, + 1865F91106253BA2005AB5DA, + 1865F91206253BA2005AB5DA, + 1865F91306253BA2005AB5DA, + 1865F91406253BA2005AB5DA, + 1865F91506253BA2005AB5DA, + 1865F91606253BA2005AB5DA, + 1865F91706253BA2005AB5DA, + 1865F91806253BA2005AB5DA, + 1865F91906253BA2005AB5DA, + 1865F91A06253BA2005AB5DA, + ); + isa = PBXGroup; + path = include; + refType = 4; + sourceTree = ""; + }; + 1865F85806253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F85906253B9E005AB5DA = { + children = ( + 1865F85A06253B9E005AB5DA, + 1865F85B06253B9E005AB5DA, + 1865F85C06253B9E005AB5DA, + 1865F85D06253B9E005AB5DA, + 1865F85E06253B9E005AB5DA, + 1865F88206253B9E005AB5DA, + 1865F8A606253B9F005AB5DA, + 1865F8A706253B9F005AB5DA, + 1865F8CB06253BA0005AB5DA, + 1865F8D006253BA0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F85A06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F85B06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F85C06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F85D06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F85E06253B9E005AB5DA = { + children = ( + 1865F85F06253B9E005AB5DA, + 1865F86006253B9E005AB5DA, + 1865F86106253B9E005AB5DA, + 1865F86206253B9E005AB5DA, + 1865F86306253B9E005AB5DA, + 1865F86406253B9E005AB5DA, + 1865F86506253B9E005AB5DA, + 1865F86606253B9E005AB5DA, + 1865F86706253B9E005AB5DA, + 1865F86806253B9E005AB5DA, + 1865F86906253B9E005AB5DA, + 1865F86A06253B9E005AB5DA, + 1865F86B06253B9E005AB5DA, + 1865F86C06253B9E005AB5DA, + 1865F86D06253B9E005AB5DA, + 1865F86E06253B9E005AB5DA, + 1865F86F06253B9E005AB5DA, + 1865F87006253B9E005AB5DA, + 1865F87106253B9E005AB5DA, + 1865F87206253B9E005AB5DA, + 1865F87306253B9E005AB5DA, + 1865F87406253B9E005AB5DA, + 1865F87506253B9E005AB5DA, + 1865F87606253B9E005AB5DA, + 1865F87706253B9E005AB5DA, + 1865F87806253B9E005AB5DA, + 1865F87906253B9E005AB5DA, + 1865F87A06253B9E005AB5DA, + 1865F87B06253B9E005AB5DA, + 1865F87C06253B9E005AB5DA, + 1865F87D06253B9E005AB5DA, + 1865F87E06253B9E005AB5DA, + 1865F87F06253B9E005AB5DA, + 1865F88006253B9E005AB5DA, + 1865F88106253B9E005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F85F06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86006253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aboutmsg.default.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86106253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_list.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86206253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_vector.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86306253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibrush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86406253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibspfrontend.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86506253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icamera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86606253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86706253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idatastream.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86806253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ieclass.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86906253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ientity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86A06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ifilesystem.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86B06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86C06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iimage.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86D06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imap.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86E06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F86F06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ipatch.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87006253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87106253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "irefcount.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87206253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iscriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87306253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iselectedface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87406253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishaders.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87506253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishadersmanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87606253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "isurfaceplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87706253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "itoolbar.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87806253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87906253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui_gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87A06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iundo.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87B06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc_def.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87C06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qerplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87D06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qertypes.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87E06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qsysprintf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F87F06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stl_check.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F88006253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stream_version.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F88106253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "version.default.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F88206253B9E005AB5DA = { + children = ( + 1865F88306253B9E005AB5DA, + 1865F88406253B9E005AB5DA, + 1865F88506253B9E005AB5DA, + 1865F88606253B9E005AB5DA, + 1865F88706253B9E005AB5DA, + 1865F88806253B9E005AB5DA, + 1865F88906253B9E005AB5DA, + 1865F88A06253B9E005AB5DA, + 1865F88B06253B9E005AB5DA, + 1865F88C06253B9E005AB5DA, + 1865F88D06253B9E005AB5DA, + 1865F88E06253B9E005AB5DA, + 1865F88F06253B9E005AB5DA, + 1865F89006253B9E005AB5DA, + 1865F89106253B9E005AB5DA, + 1865F89206253B9E005AB5DA, + 1865F89306253B9E005AB5DA, + 1865F89406253B9E005AB5DA, + 1865F89506253B9E005AB5DA, + 1865F89606253B9E005AB5DA, + 1865F89706253B9F005AB5DA, + 1865F89806253B9F005AB5DA, + 1865F89906253B9F005AB5DA, + 1865F89A06253B9F005AB5DA, + 1865F89B06253B9F005AB5DA, + 1865F89C06253B9F005AB5DA, + 1865F89D06253B9F005AB5DA, + 1865F89E06253B9F005AB5DA, + 1865F89F06253B9F005AB5DA, + 1865F8A006253B9F005AB5DA, + 1865F8A106253B9F005AB5DA, + 1865F8A206253B9F005AB5DA, + 1865F8A306253B9F005AB5DA, + 1865F8A406253B9F005AB5DA, + 1865F8A506253B9F005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F88306253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88406253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aboutmsg.default.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88506253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_list.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88606253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_vector.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88706253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibrush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88806253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibspfrontend.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88906253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icamera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88A06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88B06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idatastream.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88C06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ieclass.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88D06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ientity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88E06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ifilesystem.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F88F06253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89006253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iimage.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89106253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imap.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89206253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89306253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ipatch.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89406253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89506253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "irefcount.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89606253B9E005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iscriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89706253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iselectedface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89806253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishaders.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89906253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishadersmanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89A06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "isurfaceplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89B06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "itoolbar.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89C06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89D06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui_gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89E06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iundo.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F89F06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc_def.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A006253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qerplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A106253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qertypes.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A206253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qsysprintf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A306253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stl_check.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A406253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stream_version.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A506253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "version.default.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8A606253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F8A706253B9F005AB5DA = { + children = ( + 1865F8A806253B9F005AB5DA, + 1865F8A906253B9F005AB5DA, + 1865F8AA06253B9F005AB5DA, + 1865F8AB06253B9F005AB5DA, + 1865F8AC06253B9F005AB5DA, + 1865F8AD06253B9F005AB5DA, + 1865F8AE06253B9F005AB5DA, + 1865F8AF06253B9F005AB5DA, + 1865F8B006253B9F005AB5DA, + 1865F8B106253B9F005AB5DA, + 1865F8B206253B9F005AB5DA, + 1865F8B306253B9F005AB5DA, + 1865F8B406253B9F005AB5DA, + 1865F8B506253B9F005AB5DA, + 1865F8B606253B9F005AB5DA, + 1865F8B706253B9F005AB5DA, + 1865F8B806253B9F005AB5DA, + 1865F8B906253B9F005AB5DA, + 1865F8BA06253B9F005AB5DA, + 1865F8BB06253B9F005AB5DA, + 1865F8BC06253B9F005AB5DA, + 1865F8BD06253B9F005AB5DA, + 1865F8BE06253B9F005AB5DA, + 1865F8BF06253B9F005AB5DA, + 1865F8C006253B9F005AB5DA, + 1865F8C106253B9F005AB5DA, + 1865F8C206253B9F005AB5DA, + 1865F8C306253B9F005AB5DA, + 1865F8C406253B9F005AB5DA, + 1865F8C506253B9F005AB5DA, + 1865F8C606253B9F005AB5DA, + 1865F8C706253B9F005AB5DA, + 1865F8C806253BA0005AB5DA, + 1865F8C906253BA0005AB5DA, + 1865F8CA06253BA0005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8A806253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8A906253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aboutmsg.default.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AA06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_list.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AB06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_vector.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AC06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibrush.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AD06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibspfrontend.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AE06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icamera.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8AF06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idata.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B006253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idatastream.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B106253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ieclass.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B206253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ientity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B306253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ifilesystem.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B406253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B506253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iimage.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B606253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imap.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B706253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B806253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ipatch.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8B906253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BA06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "irefcount.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BB06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iscriplib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BC06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iselectedface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BD06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishaders.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BE06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishadersmanager.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8BF06253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "isurfaceplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C006253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "itoolbar.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C106253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C206253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui_gtk.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C306253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iundo.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C406253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc_def.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C506253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qerplugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C606253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qertypes.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C706253B9F005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qsysprintf.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C806253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stl_check.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8C906253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stream_version.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8CA06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "version.default.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8CB06253BA0005AB5DA = { + children = ( + 1865F8CC06253BA0005AB5DA, + 1865F8CD06253BA0005AB5DA, + 1865F8CE06253BA0005AB5DA, + 1865F8CF06253BA0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F8CC06253BA0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8CD06253BA0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F8CE06253BA0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F8CF06253BA0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F8D006253BA0005AB5DA = { + children = ( + 1865F8D106253BA0005AB5DA, + 1865F8D206253BA0005AB5DA, + 1865F8D306253BA0005AB5DA, + 1865F8D406253BA0005AB5DA, + 1865F8D506253BA0005AB5DA, + 1865F8D606253BA0005AB5DA, + 1865F8D706253BA0005AB5DA, + 1865F8D806253BA0005AB5DA, + 1865F8D906253BA0005AB5DA, + 1865F8DA06253BA0005AB5DA, + 1865F8DB06253BA0005AB5DA, + 1865F8DC06253BA0005AB5DA, + 1865F8DD06253BA0005AB5DA, + 1865F8DE06253BA0005AB5DA, + 1865F8DF06253BA0005AB5DA, + 1865F8E006253BA0005AB5DA, + 1865F8E106253BA0005AB5DA, + 1865F8E206253BA0005AB5DA, + 1865F8E306253BA0005AB5DA, + 1865F8E406253BA0005AB5DA, + 1865F8E506253BA0005AB5DA, + 1865F8E606253BA0005AB5DA, + 1865F8E706253BA0005AB5DA, + 1865F8E806253BA0005AB5DA, + 1865F8E906253BA0005AB5DA, + 1865F8EA06253BA0005AB5DA, + 1865F8EB06253BA0005AB5DA, + 1865F8EC06253BA0005AB5DA, + 1865F8ED06253BA0005AB5DA, + 1865F8EE06253BA0005AB5DA, + 1865F8EF06253BA0005AB5DA, + 1865F8F006253BA0005AB5DA, + 1865F8F106253BA0005AB5DA, + 1865F8F206253BA0005AB5DA, + 1865F8F306253BA1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F8D106253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D206253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "aboutmsg.default.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D306253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_list.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D406253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "gtkr_vector.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D506253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibrush.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D606253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ibspfrontend.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D706253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "icamera.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D806253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idata.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8D906253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "idatastream.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DA06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ieclass.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DB06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ientity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DC06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ifilesystem.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DD06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DE06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iimage.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8DF06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imap.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E006253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E106253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ipatch.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E206253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E306253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "irefcount.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E406253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iscriplib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E506253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iselectedface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E606253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishaders.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E706253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ishadersmanager.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E806253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "isurfaceplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8E906253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "itoolbar.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8EA06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8EB06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iui_gtk.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8EC06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "iundo.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8ED06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "misc_def.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8EE06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qerplugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8EF06253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qertypes.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8F006253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "qsysprintf.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8F106253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stl_check.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8F206253BA0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "stream_version.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8F306253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "version.default.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F8F406253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = aboutmsg.default; + refType = 4; + sourceTree = ""; + }; + 1865F8F506253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = aboutmsg.h; + refType = 4; + sourceTree = ""; + }; + 1865F8F606253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gtkr_list.h; + refType = 4; + sourceTree = ""; + }; + 1865F8F706253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = gtkr_vector.h; + refType = 4; + sourceTree = ""; + }; + 1865F8F806253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ibrush.h; + refType = 4; + sourceTree = ""; + }; + 1865F8F906253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ibspfrontend.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FA06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = icamera.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FB06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = idata.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FC06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = idatastream.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FD06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ieclass.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FE06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ientity.h; + refType = 4; + sourceTree = ""; + }; + 1865F8FF06253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ifilesystem.h; + refType = 4; + sourceTree = ""; + }; + 1865F90006253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = igl.h; + refType = 4; + sourceTree = ""; + }; + 1865F90106253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iimage.h; + refType = 4; + sourceTree = ""; + }; + 1865F90206253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imap.h; + refType = 4; + sourceTree = ""; + }; + 1865F90306253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imodel.h; + refType = 4; + sourceTree = ""; + }; + 1865F90406253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ipatch.h; + refType = 4; + sourceTree = ""; + }; + 1865F90506253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iplugin.h; + refType = 4; + sourceTree = ""; + }; + 1865F90606253BA1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = irefcount.h; + refType = 4; + sourceTree = ""; + }; + 1865F90706253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iscriplib.h; + refType = 4; + sourceTree = ""; + }; + 1865F90806253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iselectedface.h; + refType = 4; + sourceTree = ""; + }; + 1865F90906253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ishaders.h; + refType = 4; + sourceTree = ""; + }; + 1865F90A06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ishadersmanager.h; + refType = 4; + sourceTree = ""; + }; + 1865F90B06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = isurfaceplugin.h; + refType = 4; + sourceTree = ""; + }; + 1865F90C06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = itoolbar.h; + refType = 4; + sourceTree = ""; + }; + 1865F90D06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iui.h; + refType = 4; + sourceTree = ""; + }; + 1865F90E06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iui_gtk.h; + refType = 4; + sourceTree = ""; + }; + 1865F90F06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = iundo.h; + refType = 4; + sourceTree = ""; + }; + 1865F91006253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = misc_def.h; + refType = 4; + sourceTree = ""; + }; + 1865F91106253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qerplugin.h; + refType = 4; + sourceTree = ""; + }; + 1865F91206253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qertypes.h; + refType = 4; + sourceTree = ""; + }; + 1865F91306253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = qsysprintf.h; + refType = 4; + sourceTree = ""; + }; + 1865F91406253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = RADIANT_MAJOR; + refType = 4; + sourceTree = ""; + }; + 1865F91506253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = RADIANT_MINOR; + refType = 4; + sourceTree = ""; + }; + 1865F91606253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = stl_check.h; + refType = 4; + sourceTree = ""; + }; + 1865F91706253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = stream_version.h; + refType = 4; + sourceTree = ""; + }; + 1865F91806253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = version; + refType = 4; + sourceTree = ""; + }; + 1865F91906253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = version.default; + refType = 4; + sourceTree = ""; + }; + 1865F91A06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = version.h; + refType = 4; + sourceTree = ""; + }; + 1865F91B06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = INSTALL.txt; + refType = 4; + sourceTree = ""; + }; + 1865F91C06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = LGPL; + refType = 4; + sourceTree = ""; + }; + 1865F91D06253BA2005AB5DA = { + children = ( + 1865F91E06253BA2005AB5DA, + 1865F91F06253BA2005AB5DA, + 1865F96A06253BA5005AB5DA, + 1865F96B06253BA5005AB5DA, + 1865F98F06253BA6005AB5DA, + 1865F99006253BA6005AB5DA, + 1865F9AA06253BA7005AB5DA, + 1865F9AB06253BA7005AB5DA, + 1865F9AC06253BA7005AB5DA, + 1865FA6B06253BA9005AB5DA, + 1865FA6C06253BA9005AB5DA, + 1865FA9F06253BA9005AB5DA, + 1865FAEF06253BAA005AB5DA, + 1865FB1D06253BAA005AB5DA, + 1865FB1E06253BAA005AB5DA, + 1865FB3D06253BAB005AB5DA, + 1865FB3E06253BAB005AB5DA, + 1865FB3F06253BAB005AB5DA, + 1865FB4006253BAB005AB5DA, + 1865FB6906253BAB005AB5DA, + 1865FB6A06253BAB005AB5DA, + 1865FC0C06253BAD005AB5DA, + 1865FC0D06253BAD005AB5DA, + 1865FC0E06253BAD005AB5DA, + 1865FC7806253BAE005AB5DA, + 1865FC7906253BAE005AB5DA, + 1865FCB206253BAF005AB5DA, + ); + isa = PBXGroup; + path = libs; + refType = 4; + sourceTree = ""; + }; + 1865F91E06253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F91F06253BA2005AB5DA = { + children = ( + 1865F92006253BA2005AB5DA, + 1865F92106253BA2005AB5DA, + 1865F92206253BA3005AB5DA, + 1865F92306253BA3005AB5DA, + 1865F92406253BA3005AB5DA, + 1865F93406253BA3005AB5DA, + 1865F94406253BA3005AB5DA, + 1865F94506253BA4005AB5DA, + 1865F95506253BA4005AB5DA, + 1865F95A06253BA4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F92006253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F92106253BA2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F92206253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F92306253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F92406253BA3005AB5DA = { + children = ( + 1865F92506253BA3005AB5DA, + 1865F92606253BA3005AB5DA, + 1865F92706253BA3005AB5DA, + 1865F92806253BA3005AB5DA, + 1865F92906253BA3005AB5DA, + 1865F92A06253BA3005AB5DA, + 1865F92B06253BA3005AB5DA, + 1865F92C06253BA3005AB5DA, + 1865F92D06253BA3005AB5DA, + 1865F92E06253BA3005AB5DA, + 1865F92F06253BA3005AB5DA, + 1865F93006253BA3005AB5DA, + 1865F93106253BA3005AB5DA, + 1865F93206253BA3005AB5DA, + 1865F93306253BA3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92506253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92606253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bytebool.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92706253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92806253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92906253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl_to_qgl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92A06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeglib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92B06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92C06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92D06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92E06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "multimon.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F92F06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F93006253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F93106253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant_jpeglib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F93206253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "str.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F93306253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F93406253BA3005AB5DA = { + children = ( + 1865F93506253BA3005AB5DA, + 1865F93606253BA3005AB5DA, + 1865F93706253BA3005AB5DA, + 1865F93806253BA3005AB5DA, + 1865F93906253BA3005AB5DA, + 1865F93A06253BA3005AB5DA, + 1865F93B06253BA3005AB5DA, + 1865F93C06253BA3005AB5DA, + 1865F93D06253BA3005AB5DA, + 1865F93E06253BA3005AB5DA, + 1865F93F06253BA3005AB5DA, + 1865F94006253BA3005AB5DA, + 1865F94106253BA3005AB5DA, + 1865F94206253BA3005AB5DA, + 1865F94306253BA3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F93506253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93606253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bytebool.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93706253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93806253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93906253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl_to_qgl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93A06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeglib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93B06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93C06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93D06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93E06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "multimon.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F93F06253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F94006253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F94106253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant_jpeglib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F94206253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "str.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F94306253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F94406253BA3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F94506253BA4005AB5DA = { + children = ( + 1865F94606253BA4005AB5DA, + 1865F94706253BA4005AB5DA, + 1865F94806253BA4005AB5DA, + 1865F94906253BA4005AB5DA, + 1865F94A06253BA4005AB5DA, + 1865F94B06253BA4005AB5DA, + 1865F94C06253BA4005AB5DA, + 1865F94D06253BA4005AB5DA, + 1865F94E06253BA4005AB5DA, + 1865F94F06253BA4005AB5DA, + 1865F95006253BA4005AB5DA, + 1865F95106253BA4005AB5DA, + 1865F95206253BA4005AB5DA, + 1865F95306253BA4005AB5DA, + 1865F95406253BA4005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94606253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94706253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bytebool.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94806253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94906253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94A06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl_to_qgl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94B06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeglib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94C06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94D06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94E06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F94F06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "multimon.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95006253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95106253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95206253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant_jpeglib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95306253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "str.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95406253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95506253BA4005AB5DA = { + children = ( + 1865F95606253BA4005AB5DA, + 1865F95706253BA4005AB5DA, + 1865F95806253BA4005AB5DA, + 1865F95906253BA4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F95606253BA4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95706253BA4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F95806253BA4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F95906253BA4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F95A06253BA4005AB5DA = { + children = ( + 1865F95B06253BA4005AB5DA, + 1865F95C06253BA4005AB5DA, + 1865F95D06253BA4005AB5DA, + 1865F95E06253BA4005AB5DA, + 1865F95F06253BA4005AB5DA, + 1865F96006253BA4005AB5DA, + 1865F96106253BA4005AB5DA, + 1865F96206253BA4005AB5DA, + 1865F96306253BA4005AB5DA, + 1865F96406253BA4005AB5DA, + 1865F96506253BA4005AB5DA, + 1865F96606253BA5005AB5DA, + 1865F96706253BA5005AB5DA, + 1865F96806253BA5005AB5DA, + 1865F96906253BA5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F95B06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F95C06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bytebool.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F95D06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F95E06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F95F06253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "igl_to_qgl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96006253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeglib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96106253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96206253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96306253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "missing.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96406253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "multimon.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96506253BA4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96606253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96706253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "radiant_jpeglib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96806253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "str.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96906253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F96A06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bytebool.h; + refType = 4; + sourceTree = ""; + }; + 1865F96B06253BA5005AB5DA = { + children = ( + 1865F96C06253BA5005AB5DA, + 1865F96D06253BA5005AB5DA, + 1865F96E06253BA5005AB5DA, + 1865F98D06253BA6005AB5DA, + 1865F98E06253BA6005AB5DA, + ); + isa = PBXGroup; + path = cmdlib; + refType = 4; + sourceTree = ""; + }; + 1865F96C06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F96D06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865F96E06253BA5005AB5DA = { + children = ( + 1865F96F06253BA5005AB5DA, + 1865F97006253BA5005AB5DA, + 1865F97106253BA5005AB5DA, + 1865F97206253BA5005AB5DA, + 1865F97306253BA5005AB5DA, + 1865F97806253BA5005AB5DA, + 1865F97D06253BA5005AB5DA, + 1865F97E06253BA5005AB5DA, + 1865F98306253BA5005AB5DA, + 1865F98806253BA6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F96F06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F97006253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F97106253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F97206253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F97306253BA5005AB5DA = { + children = ( + 1865F97406253BA5005AB5DA, + 1865F97506253BA5005AB5DA, + 1865F97606253BA5005AB5DA, + 1865F97706253BA5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97406253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97506253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97606253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97706253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97806253BA5005AB5DA = { + children = ( + 1865F97906253BA5005AB5DA, + 1865F97A06253BA5005AB5DA, + 1865F97B06253BA5005AB5DA, + 1865F97C06253BA5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F97906253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F97A06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F97B06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F97C06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F97D06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F97E06253BA5005AB5DA = { + children = ( + 1865F97F06253BA5005AB5DA, + 1865F98006253BA5005AB5DA, + 1865F98106253BA5005AB5DA, + 1865F98206253BA5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F97F06253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98006253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98106253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98206253BA5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "cmdlib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98306253BA5005AB5DA = { + children = ( + 1865F98406253BA5005AB5DA, + 1865F98506253BA5005AB5DA, + 1865F98606253BA5005AB5DA, + 1865F98706253BA5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F98406253BA5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98506253BA5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F98606253BA5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F98706253BA5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F98806253BA6005AB5DA = { + children = ( + 1865F98906253BA6005AB5DA, + 1865F98A06253BA6005AB5DA, + 1865F98B06253BA6005AB5DA, + 1865F98C06253BA6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F98906253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F98A06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F98B06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F98C06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cmdlib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F98D06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = cmdlib.cpp; + refType = 4; + sourceTree = ""; + }; + 1865F98E06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = cmdlib.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F98F06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cmdlib.h; + refType = 4; + sourceTree = ""; + }; + 1865F99006253BA6005AB5DA = { + children = ( + 1865F99106253BA6005AB5DA, + 1865F9A806253BA6005AB5DA, + 1865F9A906253BA7005AB5DA, + ); + isa = PBXGroup; + path = ddslib; + refType = 4; + sourceTree = ""; + }; + 1865F99106253BA6005AB5DA = { + children = ( + 1865F99206253BA6005AB5DA, + 1865F99306253BA6005AB5DA, + 1865F99406253BA6005AB5DA, + 1865F99506253BA6005AB5DA, + 1865F99606253BA6005AB5DA, + 1865F99906253BA6005AB5DA, + 1865F99C06253BA6005AB5DA, + 1865F99D06253BA6005AB5DA, + 1865F9A006253BA6005AB5DA, + 1865F9A506253BA6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F99206253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F99306253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F99406253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F99506253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F99606253BA6005AB5DA = { + children = ( + 1865F99706253BA6005AB5DA, + 1865F99806253BA6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F99706253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F99806253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F99906253BA6005AB5DA = { + children = ( + 1865F99A06253BA6005AB5DA, + 1865F99B06253BA6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F99A06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F99B06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F99C06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F99D06253BA6005AB5DA = { + children = ( + 1865F99E06253BA6005AB5DA, + 1865F99F06253BA6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F99E06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F99F06253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "ddslib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9A006253BA6005AB5DA = { + children = ( + 1865F9A106253BA6005AB5DA, + 1865F9A206253BA6005AB5DA, + 1865F9A306253BA6005AB5DA, + 1865F9A406253BA6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865F9A106253BA6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9A206253BA6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F9A306253BA6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9A406253BA6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F9A506253BA6005AB5DA = { + children = ( + 1865F9A606253BA6005AB5DA, + 1865F9A706253BA6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865F9A606253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9A706253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ddslib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9A806253BA6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = ddslib.c; + refType = 4; + sourceTree = ""; + }; + 1865F9A906253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = ddslib.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865F9AA06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ddslib.h; + refType = 4; + sourceTree = ""; + }; + 1865F9AB06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = igl_to_qgl.h; + refType = 4; + sourceTree = ""; + }; + 1865F9AC06253BA7005AB5DA = { + children = ( + 1865F9AD06253BA7005AB5DA, + 1865F9AE06253BA7005AB5DA, + 1865F9AF06253BA7005AB5DA, + 1865FA4A06253BA9005AB5DA, + 1865FA4B06253BA9005AB5DA, + 1865FA4C06253BA9005AB5DA, + 1865FA4D06253BA9005AB5DA, + 1865FA4E06253BA9005AB5DA, + 1865FA4F06253BA9005AB5DA, + 1865FA5006253BA9005AB5DA, + 1865FA5106253BA9005AB5DA, + 1865FA5206253BA9005AB5DA, + 1865FA5306253BA9005AB5DA, + 1865FA5406253BA9005AB5DA, + 1865FA5506253BA9005AB5DA, + 1865FA5606253BA9005AB5DA, + 1865FA5706253BA9005AB5DA, + 1865FA5806253BA9005AB5DA, + 1865FA5906253BA9005AB5DA, + 1865FA5A06253BA9005AB5DA, + 1865FA5B06253BA9005AB5DA, + 1865FA5C06253BA9005AB5DA, + 1865FA5D06253BA9005AB5DA, + 1865FA5E06253BA9005AB5DA, + 1865FA5F06253BA9005AB5DA, + 1865FA6006253BA9005AB5DA, + 1865FA6106253BA9005AB5DA, + 1865FA6206253BA9005AB5DA, + 1865FA6306253BA9005AB5DA, + 1865FA6406253BA9005AB5DA, + 1865FA6506253BA9005AB5DA, + 1865FA6606253BA9005AB5DA, + 1865FA6706253BA9005AB5DA, + 1865FA6806253BA9005AB5DA, + 1865FA6906253BA9005AB5DA, + 1865FA6A06253BA9005AB5DA, + ); + isa = PBXGroup; + path = jpeg6; + refType = 4; + sourceTree = ""; + }; + 1865F9AD06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865F9AE06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865F9AF06253BA7005AB5DA = { + children = ( + 1865F9B006253BA7005AB5DA, + 1865F9B106253BA7005AB5DA, + 1865F9B206253BA7005AB5DA, + 1865F9B306253BA7005AB5DA, + 1865F9B406253BA7005AB5DA, + 1865F9D806253BA8005AB5DA, + 1865F9FC06253BA8005AB5DA, + 1865F9FD06253BA8005AB5DA, + 1865FA2106253BA9005AB5DA, + 1865FA2606253BA9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865F9B006253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865F9B106253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865F9B206253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865F9B306253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865F9B406253BA7005AB5DA = { + children = ( + 1865F9B506253BA7005AB5DA, + 1865F9B606253BA7005AB5DA, + 1865F9B706253BA7005AB5DA, + 1865F9B806253BA7005AB5DA, + 1865F9B906253BA7005AB5DA, + 1865F9BA06253BA7005AB5DA, + 1865F9BB06253BA7005AB5DA, + 1865F9BC06253BA7005AB5DA, + 1865F9BD06253BA7005AB5DA, + 1865F9BE06253BA7005AB5DA, + 1865F9BF06253BA7005AB5DA, + 1865F9C006253BA7005AB5DA, + 1865F9C106253BA7005AB5DA, + 1865F9C206253BA7005AB5DA, + 1865F9C306253BA7005AB5DA, + 1865F9C406253BA7005AB5DA, + 1865F9C506253BA7005AB5DA, + 1865F9C606253BA7005AB5DA, + 1865F9C706253BA7005AB5DA, + 1865F9C806253BA7005AB5DA, + 1865F9C906253BA8005AB5DA, + 1865F9CA06253BA8005AB5DA, + 1865F9CB06253BA8005AB5DA, + 1865F9CC06253BA8005AB5DA, + 1865F9CD06253BA8005AB5DA, + 1865F9CE06253BA8005AB5DA, + 1865F9CF06253BA8005AB5DA, + 1865F9D006253BA8005AB5DA, + 1865F9D106253BA8005AB5DA, + 1865F9D206253BA8005AB5DA, + 1865F9D306253BA8005AB5DA, + 1865F9D406253BA8005AB5DA, + 1865F9D506253BA8005AB5DA, + 1865F9D606253BA8005AB5DA, + 1865F9D706253BA8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9B506253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9B606253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9B706253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jchuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9B806253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jcomapi.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9B906253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jconfig.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BA06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapimin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BB06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapistd.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BC06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdatasrc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BD06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcoefct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BE06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcolor.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9BF06253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdct.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C006253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jddctmgr.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C106253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C206253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C306253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdinput.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C406253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmainct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C506253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmarker.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C606253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmaster.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C706253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdpostct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C806253BA7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdsample.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9C906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdtrans.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CA06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CB06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CC06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jfdctflt.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CD06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jidctflt.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CE06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jinclude.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9CF06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemmgr.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D006253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemnobs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D106253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemsys.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D206253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmorecfg.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D306253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D406253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpegint.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D506253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpgload.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D606253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jutils.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D706253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jversion.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9D806253BA8005AB5DA = { + children = ( + 1865F9D906253BA8005AB5DA, + 1865F9DA06253BA8005AB5DA, + 1865F9DB06253BA8005AB5DA, + 1865F9DC06253BA8005AB5DA, + 1865F9DD06253BA8005AB5DA, + 1865F9DE06253BA8005AB5DA, + 1865F9DF06253BA8005AB5DA, + 1865F9E006253BA8005AB5DA, + 1865F9E106253BA8005AB5DA, + 1865F9E206253BA8005AB5DA, + 1865F9E306253BA8005AB5DA, + 1865F9E406253BA8005AB5DA, + 1865F9E506253BA8005AB5DA, + 1865F9E606253BA8005AB5DA, + 1865F9E706253BA8005AB5DA, + 1865F9E806253BA8005AB5DA, + 1865F9E906253BA8005AB5DA, + 1865F9EA06253BA8005AB5DA, + 1865F9EB06253BA8005AB5DA, + 1865F9EC06253BA8005AB5DA, + 1865F9ED06253BA8005AB5DA, + 1865F9EE06253BA8005AB5DA, + 1865F9EF06253BA8005AB5DA, + 1865F9F006253BA8005AB5DA, + 1865F9F106253BA8005AB5DA, + 1865F9F206253BA8005AB5DA, + 1865F9F306253BA8005AB5DA, + 1865F9F406253BA8005AB5DA, + 1865F9F506253BA8005AB5DA, + 1865F9F606253BA8005AB5DA, + 1865F9F706253BA8005AB5DA, + 1865F9F806253BA8005AB5DA, + 1865F9F906253BA8005AB5DA, + 1865F9FA06253BA8005AB5DA, + 1865F9FB06253BA8005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865F9D906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DA06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DB06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jchuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DC06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jcomapi.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DD06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jconfig.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DE06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapimin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9DF06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapistd.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E006253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdatasrc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E106253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcoefct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E206253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcolor.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E306253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdct.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E406253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jddctmgr.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E506253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E606253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E706253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdinput.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E806253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmainct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9E906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmarker.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9EA06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmaster.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9EB06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdpostct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9EC06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdsample.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9ED06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdtrans.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9EE06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9EF06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F006253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jfdctflt.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F106253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jidctflt.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F206253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jinclude.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F306253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemmgr.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F406253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemnobs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F506253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemsys.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F606253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmorecfg.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F706253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F806253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpegint.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9F906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpgload.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9FA06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jutils.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9FB06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jversion.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865F9FC06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865F9FD06253BA8005AB5DA = { + children = ( + 1865F9FE06253BA8005AB5DA, + 1865F9FF06253BA8005AB5DA, + 1865FA0006253BA8005AB5DA, + 1865FA0106253BA8005AB5DA, + 1865FA0206253BA8005AB5DA, + 1865FA0306253BA8005AB5DA, + 1865FA0406253BA8005AB5DA, + 1865FA0506253BA8005AB5DA, + 1865FA0606253BA8005AB5DA, + 1865FA0706253BA8005AB5DA, + 1865FA0806253BA8005AB5DA, + 1865FA0906253BA8005AB5DA, + 1865FA0A06253BA8005AB5DA, + 1865FA0B06253BA8005AB5DA, + 1865FA0C06253BA8005AB5DA, + 1865FA0D06253BA8005AB5DA, + 1865FA0E06253BA8005AB5DA, + 1865FA0F06253BA8005AB5DA, + 1865FA1006253BA8005AB5DA, + 1865FA1106253BA8005AB5DA, + 1865FA1206253BA8005AB5DA, + 1865FA1306253BA8005AB5DA, + 1865FA1406253BA8005AB5DA, + 1865FA1506253BA8005AB5DA, + 1865FA1606253BA8005AB5DA, + 1865FA1706253BA8005AB5DA, + 1865FA1806253BA8005AB5DA, + 1865FA1906253BA8005AB5DA, + 1865FA1A06253BA8005AB5DA, + 1865FA1B06253BA8005AB5DA, + 1865FA1C06253BA8005AB5DA, + 1865FA1D06253BA8005AB5DA, + 1865FA1E06253BA9005AB5DA, + 1865FA1F06253BA9005AB5DA, + 1865FA2006253BA9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9FE06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865F9FF06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0006253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jchuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0106253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jcomapi.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0206253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jconfig.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0306253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapimin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0406253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapistd.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0506253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdatasrc.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0606253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcoefct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0706253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcolor.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0806253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdct.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jddctmgr.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0A06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0B06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0C06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdinput.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0D06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmainct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0E06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmarker.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA0F06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmaster.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1006253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdpostct.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1106253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdsample.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1206253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdtrans.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1306253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1406253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1506253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jfdctflt.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1606253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jidctflt.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1706253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jinclude.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1806253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemmgr.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1906253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemnobs.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1A06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemsys.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1B06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmorecfg.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1C06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "jpeg6.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1D06253BA8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpegint.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpgload.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA1F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jutils.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA2006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jversion.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA2106253BA9005AB5DA = { + children = ( + 1865FA2206253BA9005AB5DA, + 1865FA2306253BA9005AB5DA, + 1865FA2406253BA9005AB5DA, + 1865FA2506253BA9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FA2206253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA2306253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FA2406253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA2506253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FA2606253BA9005AB5DA = { + children = ( + 1865FA2706253BA9005AB5DA, + 1865FA2806253BA9005AB5DA, + 1865FA2906253BA9005AB5DA, + 1865FA2A06253BA9005AB5DA, + 1865FA2B06253BA9005AB5DA, + 1865FA2C06253BA9005AB5DA, + 1865FA2D06253BA9005AB5DA, + 1865FA2E06253BA9005AB5DA, + 1865FA2F06253BA9005AB5DA, + 1865FA3006253BA9005AB5DA, + 1865FA3106253BA9005AB5DA, + 1865FA3206253BA9005AB5DA, + 1865FA3306253BA9005AB5DA, + 1865FA3406253BA9005AB5DA, + 1865FA3506253BA9005AB5DA, + 1865FA3606253BA9005AB5DA, + 1865FA3706253BA9005AB5DA, + 1865FA3806253BA9005AB5DA, + 1865FA3906253BA9005AB5DA, + 1865FA3A06253BA9005AB5DA, + 1865FA3B06253BA9005AB5DA, + 1865FA3C06253BA9005AB5DA, + 1865FA3D06253BA9005AB5DA, + 1865FA3E06253BA9005AB5DA, + 1865FA3F06253BA9005AB5DA, + 1865FA4006253BA9005AB5DA, + 1865FA4106253BA9005AB5DA, + 1865FA4206253BA9005AB5DA, + 1865FA4306253BA9005AB5DA, + 1865FA4406253BA9005AB5DA, + 1865FA4506253BA9005AB5DA, + 1865FA4606253BA9005AB5DA, + 1865FA4706253BA9005AB5DA, + 1865FA4806253BA9005AB5DA, + 1865FA4906253BA9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FA2706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jchuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jcomapi.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jconfig.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapimin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdapistd.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdatasrc.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA2F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcoefct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdcolor.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdct.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jddctmgr.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdhuff.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdinput.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmainct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmarker.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdmaster.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdpostct.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdsample.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jdtrans.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jerror.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jfdctflt.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA3F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jidctflt.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jinclude.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemmgr.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemnobs.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmemsys.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jmorecfg.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg6.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpegint.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpgload.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jutils.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jversion.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA4A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jchuff.h; + refType = 4; + sourceTree = ""; + }; + 1865FA4B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jcomapi.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA4C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jconfig.h; + refType = 4; + sourceTree = ""; + }; + 1865FA4D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdapimin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA4E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdapistd.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA4F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdatasrc.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdcoefct.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdcolor.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jdct.h; + refType = 4; + sourceTree = ""; + }; + 1865FA5306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jddctmgr.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdhuff.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jdhuff.h; + refType = 4; + sourceTree = ""; + }; + 1865FA5606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdinput.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdmainct.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdmarker.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdmaster.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdpostct.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdsample.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jdtrans.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jerror.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA5E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jerror.h; + refType = 4; + sourceTree = ""; + }; + 1865FA5F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jfdctflt.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jidctflt.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jinclude.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jmemmgr.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jmemnobs.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jmemsys.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jmorecfg.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = jpeg6.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FA6706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jpegint.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jpgload.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jutils.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FA6A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jversion.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = jpeglib.h; + refType = 4; + sourceTree = ""; + }; + 1865FA6C06253BA9005AB5DA = { + children = ( + 1865FA6D06253BA9005AB5DA, + 1865FA6E06253BA9005AB5DA, + 1865FA9906253BA9005AB5DA, + 1865FA9A06253BA9005AB5DA, + 1865FA9B06253BA9005AB5DA, + 1865FA9C06253BA9005AB5DA, + 1865FA9D06253BA9005AB5DA, + 1865FA9E06253BA9005AB5DA, + ); + isa = PBXGroup; + path = l_net; + refType = 4; + sourceTree = ""; + }; + 1865FA6D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865FA6E06253BA9005AB5DA = { + children = ( + 1865FA6F06253BA9005AB5DA, + 1865FA7006253BA9005AB5DA, + 1865FA7106253BA9005AB5DA, + 1865FA7206253BA9005AB5DA, + 1865FA7306253BA9005AB5DA, + 1865FA7B06253BA9005AB5DA, + 1865FA8306253BA9005AB5DA, + 1865FA8406253BA9005AB5DA, + 1865FA8C06253BA9005AB5DA, + 1865FA9106253BA9005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FA6F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FA7006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FA7106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FA7206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FA7306253BA9005AB5DA = { + children = ( + 1865FA7406253BA9005AB5DA, + 1865FA7506253BA9005AB5DA, + 1865FA7606253BA9005AB5DA, + 1865FA7706253BA9005AB5DA, + 1865FA7806253BA9005AB5DA, + 1865FA7906253BA9005AB5DA, + 1865FA7A06253BA9005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_berkley.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA7B06253BA9005AB5DA = { + children = ( + 1865FA7C06253BA9005AB5DA, + 1865FA7D06253BA9005AB5DA, + 1865FA7E06253BA9005AB5DA, + 1865FA7F06253BA9005AB5DA, + 1865FA8006253BA9005AB5DA, + 1865FA8106253BA9005AB5DA, + 1865FA8206253BA9005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FA7C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA7D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA7E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA7F06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA8006253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_berkley.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA8106253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA8206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA8306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FA8406253BA9005AB5DA = { + children = ( + 1865FA8506253BA9005AB5DA, + 1865FA8606253BA9005AB5DA, + 1865FA8706253BA9005AB5DA, + 1865FA8806253BA9005AB5DA, + 1865FA8906253BA9005AB5DA, + 1865FA8A06253BA9005AB5DA, + 1865FA8B06253BA9005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "l_net.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_berkley.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8C06253BA9005AB5DA = { + children = ( + 1865FA8D06253BA9005AB5DA, + 1865FA8E06253BA9005AB5DA, + 1865FA8F06253BA9005AB5DA, + 1865FA9006253BA9005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FA8D06253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA8E06253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FA8F06253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FA9006253BA9005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FA9106253BA9005AB5DA = { + children = ( + 1865FA9206253BA9005AB5DA, + 1865FA9306253BA9005AB5DA, + 1865FA9406253BA9005AB5DA, + 1865FA9506253BA9005AB5DA, + 1865FA9606253BA9005AB5DA, + 1865FA9706253BA9005AB5DA, + 1865FA9806253BA9005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FA9206253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9306253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9406253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9506253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9606253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_berkley.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9706253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9806253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "l_net_wins.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FA9906253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l_net.c; + refType = 4; + sourceTree = ""; + }; + 1865FA9A06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = l_net.h; + refType = 4; + sourceTree = ""; + }; + 1865FA9B06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = l_net.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FA9C06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l_net_berkley.c; + refType = 4; + sourceTree = ""; + }; + 1865FA9D06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = l_net_wins.c; + refType = 4; + sourceTree = ""; + }; + 1865FA9E06253BA9005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = l_net_wins.h; + refType = 4; + sourceTree = ""; + }; + 1865FA9F06253BA9005AB5DA = { + children = ( + 1865FAA006253BA9005AB5DA, + 1865FAAF06253BAA005AB5DA, + 1865FABF06253BAA005AB5DA, + 1865FACF06253BAA005AB5DA, + 1865FADF06253BAA005AB5DA, + ); + isa = PBXGroup; + path = libxml2; + refType = 4; + sourceTree = ""; + }; + 1865FAA006253BA9005AB5DA = { + children = ( + 1865FAA106253BAA005AB5DA, + 1865FAA206253BAA005AB5DA, + 1865FAA306253BAA005AB5DA, + 1865FAA406253BAA005AB5DA, + 1865FAA506253BAA005AB5DA, + 1865FAA606253BAA005AB5DA, + 1865FAA706253BAA005AB5DA, + 1865FAA806253BAA005AB5DA, + 1865FAA906253BAA005AB5DA, + 1865FAAE06253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAA106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAA206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAA306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAA406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAA506253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAA606253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAA706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FAA806253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAA906253BAA005AB5DA = { + children = ( + 1865FAAA06253BAA005AB5DA, + 1865FAAB06253BAA005AB5DA, + 1865FAAC06253BAA005AB5DA, + 1865FAAD06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FAAA06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAAB06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAAC06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAAD06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FAAE06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FAAF06253BAA005AB5DA = { + children = ( + 1865FAB006253BAA005AB5DA, + ); + isa = PBXGroup; + path = doc; + refType = 4; + sourceTree = ""; + }; + 1865FAB006253BAA005AB5DA = { + children = ( + 1865FAB106253BAA005AB5DA, + 1865FAB206253BAA005AB5DA, + 1865FAB306253BAA005AB5DA, + 1865FAB406253BAA005AB5DA, + 1865FAB506253BAA005AB5DA, + 1865FAB606253BAA005AB5DA, + 1865FAB706253BAA005AB5DA, + 1865FAB806253BAA005AB5DA, + 1865FAB906253BAA005AB5DA, + 1865FABE06253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAB106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAB206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAB306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAB406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAB506253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAB606253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAB706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FAB806253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAB906253BAA005AB5DA = { + children = ( + 1865FABA06253BAA005AB5DA, + 1865FABB06253BAA005AB5DA, + 1865FABC06253BAA005AB5DA, + 1865FABD06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FABA06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FABB06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FABC06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FABD06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FABE06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FABF06253BAA005AB5DA = { + children = ( + 1865FAC006253BAA005AB5DA, + ); + isa = PBXGroup; + path = example; + refType = 4; + sourceTree = ""; + }; + 1865FAC006253BAA005AB5DA = { + children = ( + 1865FAC106253BAA005AB5DA, + 1865FAC206253BAA005AB5DA, + 1865FAC306253BAA005AB5DA, + 1865FAC406253BAA005AB5DA, + 1865FAC506253BAA005AB5DA, + 1865FAC606253BAA005AB5DA, + 1865FAC706253BAA005AB5DA, + 1865FAC806253BAA005AB5DA, + 1865FAC906253BAA005AB5DA, + 1865FACE06253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAC106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAC206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAC306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAC406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAC506253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAC606253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAC706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FAC806253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAC906253BAA005AB5DA = { + children = ( + 1865FACA06253BAA005AB5DA, + 1865FACB06253BAA005AB5DA, + 1865FACC06253BAA005AB5DA, + 1865FACD06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FACA06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FACB06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FACC06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FACD06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FACE06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FACF06253BAA005AB5DA = { + children = ( + 1865FAD006253BAA005AB5DA, + ); + isa = PBXGroup; + path = libxml; + refType = 4; + sourceTree = ""; + }; + 1865FAD006253BAA005AB5DA = { + children = ( + 1865FAD106253BAA005AB5DA, + 1865FAD206253BAA005AB5DA, + 1865FAD306253BAA005AB5DA, + 1865FAD406253BAA005AB5DA, + 1865FAD506253BAA005AB5DA, + 1865FAD606253BAA005AB5DA, + 1865FAD706253BAA005AB5DA, + 1865FAD806253BAA005AB5DA, + 1865FAD906253BAA005AB5DA, + 1865FADE06253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAD106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAD206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAD306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAD406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAD506253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAD606253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAD706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FAD806253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAD906253BAA005AB5DA = { + children = ( + 1865FADA06253BAA005AB5DA, + 1865FADB06253BAA005AB5DA, + 1865FADC06253BAA005AB5DA, + 1865FADD06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FADA06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FADB06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FADC06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FADD06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FADE06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FADF06253BAA005AB5DA = { + children = ( + 1865FAE006253BAA005AB5DA, + ); + isa = PBXGroup; + path = MSDev; + refType = 4; + sourceTree = ""; + }; + 1865FAE006253BAA005AB5DA = { + children = ( + 1865FAE106253BAA005AB5DA, + 1865FAE206253BAA005AB5DA, + 1865FAE306253BAA005AB5DA, + 1865FAE406253BAA005AB5DA, + 1865FAE506253BAA005AB5DA, + 1865FAE606253BAA005AB5DA, + 1865FAE706253BAA005AB5DA, + 1865FAE806253BAA005AB5DA, + 1865FAE906253BAA005AB5DA, + 1865FAEE06253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAE106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAE206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAE306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAE406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAE506253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAE606253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAE706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FAE806253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAE906253BAA005AB5DA = { + children = ( + 1865FAEA06253BAA005AB5DA, + 1865FAEB06253BAA005AB5DA, + 1865FAEC06253BAA005AB5DA, + 1865FAED06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FAEA06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAEB06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAEC06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAED06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FAEE06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FAEF06253BAA005AB5DA = { + children = ( + 1865FAF006253BAA005AB5DA, + 1865FB1706253BAA005AB5DA, + 1865FB1806253BAA005AB5DA, + 1865FB1906253BAA005AB5DA, + 1865FB1A06253BAA005AB5DA, + 1865FB1B06253BAA005AB5DA, + 1865FB1C06253BAA005AB5DA, + ); + isa = PBXGroup; + path = mathlib; + refType = 4; + sourceTree = ""; + }; + 1865FAF006253BAA005AB5DA = { + children = ( + 1865FAF106253BAA005AB5DA, + 1865FAF206253BAA005AB5DA, + 1865FAF306253BAA005AB5DA, + 1865FAF406253BAA005AB5DA, + 1865FAF506253BAA005AB5DA, + 1865FAFC06253BAA005AB5DA, + 1865FB0306253BAA005AB5DA, + 1865FB0406253BAA005AB5DA, + 1865FB0B06253BAA005AB5DA, + 1865FB1006253BAA005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FAF106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FAF206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FAF306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FAF406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FAF506253BAA005AB5DA = { + children = ( + 1865FAF606253BAA005AB5DA, + 1865FAF706253BAA005AB5DA, + 1865FAF806253BAA005AB5DA, + 1865FAF906253BAA005AB5DA, + 1865FAFA06253BAA005AB5DA, + 1865FAFB06253BAA005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAF606253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bbox.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAF706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "linear.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAF806253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m4x4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAF906253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAFA06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAFB06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ray.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FAFC06253BAA005AB5DA = { + children = ( + 1865FAFD06253BAA005AB5DA, + 1865FAFE06253BAA005AB5DA, + 1865FAFF06253BAA005AB5DA, + 1865FB0006253BAA005AB5DA, + 1865FB0106253BAA005AB5DA, + 1865FB0206253BAA005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FAFD06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bbox.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FAFE06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "linear.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FAFF06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m4x4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB0006253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB0106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB0206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ray.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB0306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FB0406253BAA005AB5DA = { + children = ( + 1865FB0506253BAA005AB5DA, + 1865FB0606253BAA005AB5DA, + 1865FB0706253BAA005AB5DA, + 1865FB0806253BAA005AB5DA, + 1865FB0906253BAA005AB5DA, + 1865FB0A06253BAA005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0506253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bbox.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0606253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "linear.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m4x4.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0806253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0906253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "mathlib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0A06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ray.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0B06253BAA005AB5DA = { + children = ( + 1865FB0C06253BAA005AB5DA, + 1865FB0D06253BAA005AB5DA, + 1865FB0E06253BAA005AB5DA, + 1865FB0F06253BAA005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FB0C06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0D06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB0E06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB0F06253BAA005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB1006253BAA005AB5DA = { + children = ( + 1865FB1106253BAA005AB5DA, + 1865FB1206253BAA005AB5DA, + 1865FB1306253BAA005AB5DA, + 1865FB1406253BAA005AB5DA, + 1865FB1506253BAA005AB5DA, + 1865FB1606253BAA005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB1106253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bbox.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1206253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "linear.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1306253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m4x4.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1406253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1506253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mathlib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1606253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "ray.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB1706253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = bbox.c; + refType = 4; + sourceTree = ""; + }; + 1865FB1806253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = linear.c; + refType = 4; + sourceTree = ""; + }; + 1865FB1906253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = m4x4.c; + refType = 4; + sourceTree = ""; + }; + 1865FB1A06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = mathlib.c; + refType = 4; + sourceTree = ""; + }; + 1865FB1B06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = mathlib.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FB1C06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = ray.c; + refType = 4; + sourceTree = ""; + }; + 1865FB1D06253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = mathlib.h; + refType = 4; + sourceTree = ""; + }; + 1865FB1E06253BAA005AB5DA = { + children = ( + 1865FB1F06253BAA005AB5DA, + 1865FB3A06253BAB005AB5DA, + 1865FB3B06253BAB005AB5DA, + 1865FB3C06253BAB005AB5DA, + ); + isa = PBXGroup; + path = md5lib; + refType = 4; + sourceTree = ""; + }; + 1865FB1F06253BAA005AB5DA = { + children = ( + 1865FB2006253BAA005AB5DA, + 1865FB2106253BAB005AB5DA, + 1865FB2206253BAB005AB5DA, + 1865FB2306253BAB005AB5DA, + 1865FB2406253BAB005AB5DA, + 1865FB2806253BAB005AB5DA, + 1865FB2C06253BAB005AB5DA, + 1865FB2D06253BAB005AB5DA, + 1865FB3106253BAB005AB5DA, + 1865FB3606253BAB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FB2006253BAA005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FB2106253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FB2206253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FB2306253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FB2406253BAB005AB5DA = { + children = ( + 1865FB2506253BAB005AB5DA, + 1865FB2606253BAB005AB5DA, + 1865FB2706253BAB005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2506253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Conscript.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2606253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2706253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2806253BAB005AB5DA = { + children = ( + 1865FB2906253BAB005AB5DA, + 1865FB2A06253BAB005AB5DA, + 1865FB2B06253BAB005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB2906253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Conscript.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB2A06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB2B06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB2C06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FB2D06253BAB005AB5DA = { + children = ( + 1865FB2E06253BAB005AB5DA, + 1865FB2F06253BAB005AB5DA, + 1865FB3006253BAB005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2E06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Conscript.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB2F06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB3006253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "md5lib.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB3106253BAB005AB5DA = { + children = ( + 1865FB3206253BAB005AB5DA, + 1865FB3306253BAB005AB5DA, + 1865FB3406253BAB005AB5DA, + 1865FB3506253BAB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FB3206253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB3306253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB3406253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB3506253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB3606253BAB005AB5DA = { + children = ( + 1865FB3706253BAB005AB5DA, + 1865FB3806253BAB005AB5DA, + 1865FB3906253BAB005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB3706253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Conscript.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB3806253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB3906253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "md5lib.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB3A06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = Conscript; + refType = 4; + sourceTree = ""; + }; + 1865FB3B06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = md5lib.c; + refType = 4; + sourceTree = ""; + }; + 1865FB3C06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = md5lib.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FB3D06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = md5lib.h; + refType = 4; + sourceTree = ""; + }; + 1865FB3E06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = missing.h; + refType = 4; + sourceTree = ""; + }; + 1865FB3F06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = multimon.h; + refType = 4; + sourceTree = ""; + }; + 1865FB4006253BAB005AB5DA = { + children = ( + 1865FB4106253BAB005AB5DA, + 1865FB4206253BAB005AB5DA, + 1865FB4306253BAB005AB5DA, + 1865FB6606253BAB005AB5DA, + 1865FB6706253BAB005AB5DA, + 1865FB6806253BAB005AB5DA, + ); + isa = PBXGroup; + path = pak; + refType = 4; + sourceTree = ""; + }; + 1865FB4106253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865FB4206253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvswrappers; + refType = 4; + sourceTree = ""; + }; + 1865FB4306253BAB005AB5DA = { + children = ( + 1865FB4406253BAB005AB5DA, + 1865FB4506253BAB005AB5DA, + 1865FB4606253BAB005AB5DA, + 1865FB4706253BAB005AB5DA, + 1865FB4806253BAB005AB5DA, + 1865FB4E06253BAB005AB5DA, + 1865FB5406253BAB005AB5DA, + 1865FB5506253BAB005AB5DA, + 1865FB5B06253BAB005AB5DA, + 1865FB6006253BAB005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FB4406253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FB4506253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FB4606253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FB4706253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FB4806253BAB005AB5DA = { + children = ( + 1865FB4906253BAB005AB5DA, + 1865FB4A06253BAB005AB5DA, + 1865FB4B06253BAB005AB5DA, + 1865FB4C06253BAB005AB5DA, + 1865FB4D06253BAB005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4906253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4A06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4B06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4C06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4D06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB4E06253BAB005AB5DA = { + children = ( + 1865FB4F06253BAB005AB5DA, + 1865FB5006253BAB005AB5DA, + 1865FB5106253BAB005AB5DA, + 1865FB5206253BAB005AB5DA, + 1865FB5306253BAB005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB4F06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB5006253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB5106253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB5206253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB5306253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB5406253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FB5506253BAB005AB5DA = { + children = ( + 1865FB5606253BAB005AB5DA, + 1865FB5706253BAB005AB5DA, + 1865FB5806253BAB005AB5DA, + 1865FB5906253BAB005AB5DA, + 1865FB5A06253BAB005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5606253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5706253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5806253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5906253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5A06253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5B06253BAB005AB5DA = { + children = ( + 1865FB5C06253BAB005AB5DA, + 1865FB5D06253BAB005AB5DA, + 1865FB5E06253BAB005AB5DA, + 1865FB5F06253BAB005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FB5C06253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5D06253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB5E06253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB5F06253BAB005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB6006253BAB005AB5DA = { + children = ( + 1865FB6106253BAB005AB5DA, + 1865FB6206253BAB005AB5DA, + 1865FB6306253BAB005AB5DA, + 1865FB6406253BAB005AB5DA, + 1865FB6506253BAB005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FB6106253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB6206253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvswrappers.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB6306253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pakstuff.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB6406253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB6506253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unzip.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB6606253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = pakstuff.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FB6706253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = unzip.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FB6806253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = unzip.h; + refType = 4; + sourceTree = ""; + }; + 1865FB6906253BAB005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = pakstuff.h; + refType = 4; + sourceTree = ""; + }; + 1865FB6A06253BAB005AB5DA = { + children = ( + 1865FB6B06253BAB005AB5DA, + 1865FBB606253BAC005AB5DA, + 1865FBFD06253BAD005AB5DA, + 1865FBFE06253BAD005AB5DA, + 1865FBFF06253BAD005AB5DA, + 1865FC0006253BAD005AB5DA, + 1865FC0106253BAD005AB5DA, + 1865FC0206253BAD005AB5DA, + 1865FC0306253BAD005AB5DA, + 1865FC0406253BAD005AB5DA, + 1865FC0506253BAD005AB5DA, + 1865FC0606253BAD005AB5DA, + 1865FC0706253BAD005AB5DA, + 1865FC0806253BAD005AB5DA, + 1865FC0906253BAD005AB5DA, + 1865FC0A06253BAD005AB5DA, + 1865FC0B06253BAD005AB5DA, + ); + isa = PBXGroup; + path = picomodel; + refType = 4; + sourceTree = ""; + }; + 1865FB6B06253BAB005AB5DA = { + children = ( + 1865FB6C06253BAC005AB5DA, + 1865FB6D06253BAC005AB5DA, + 1865FB6E06253BAC005AB5DA, + 1865FB6F06253BAC005AB5DA, + 1865FB7006253BAC005AB5DA, + 1865FB8006253BAC005AB5DA, + 1865FB9006253BAC005AB5DA, + 1865FB9106253BAC005AB5DA, + 1865FBA106253BAC005AB5DA, + 1865FBA606253BAC005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FB6C06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FB6D06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FB6E06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FB6F06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FB7006253BAC005AB5DA = { + children = ( + 1865FB7106253BAC005AB5DA, + 1865FB7206253BAC005AB5DA, + 1865FB7306253BAC005AB5DA, + 1865FB7406253BAC005AB5DA, + 1865FB7506253BAC005AB5DA, + 1865FB7606253BAC005AB5DA, + 1865FB7706253BAC005AB5DA, + 1865FB7806253BAC005AB5DA, + 1865FB7906253BAC005AB5DA, + 1865FB7A06253BAC005AB5DA, + 1865FB7B06253BAC005AB5DA, + 1865FB7C06253BAC005AB5DA, + 1865FB7D06253BAC005AB5DA, + 1865FB7E06253BAC005AB5DA, + 1865FB7F06253BAC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7106253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7506253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodules.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7606253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_3ds.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ase.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7A06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_lwo.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7B06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md2.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7C06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md3.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7D06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_mdc.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7E06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ms3d.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB7F06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_obj.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB8006253BAC005AB5DA = { + children = ( + 1865FB8106253BAC005AB5DA, + 1865FB8206253BAC005AB5DA, + 1865FB8306253BAC005AB5DA, + 1865FB8406253BAC005AB5DA, + 1865FB8506253BAC005AB5DA, + 1865FB8606253BAC005AB5DA, + 1865FB8706253BAC005AB5DA, + 1865FB8806253BAC005AB5DA, + 1865FB8906253BAC005AB5DA, + 1865FB8A06253BAC005AB5DA, + 1865FB8B06253BAC005AB5DA, + 1865FB8C06253BAC005AB5DA, + 1865FB8D06253BAC005AB5DA, + 1865FB8E06253BAC005AB5DA, + 1865FB8F06253BAC005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FB8106253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8506253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodules.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8606253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_3ds.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ase.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8A06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_lwo.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8B06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md2.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8C06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md3.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8D06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_mdc.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8E06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ms3d.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB8F06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_obj.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FB9006253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FB9106253BAC005AB5DA = { + children = ( + 1865FB9206253BAC005AB5DA, + 1865FB9306253BAC005AB5DA, + 1865FB9406253BAC005AB5DA, + 1865FB9506253BAC005AB5DA, + 1865FB9606253BAC005AB5DA, + 1865FB9706253BAC005AB5DA, + 1865FB9806253BAC005AB5DA, + 1865FB9906253BAC005AB5DA, + 1865FB9A06253BAC005AB5DA, + 1865FB9B06253BAC005AB5DA, + 1865FB9C06253BAC005AB5DA, + 1865FB9D06253BAC005AB5DA, + 1865FB9E06253BAC005AB5DA, + 1865FB9F06253BAC005AB5DA, + 1865FBA006253BAC005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9506253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "picomodel.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9606253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodules.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_3ds.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ase.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9A06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9B06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_lwo.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9C06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md2.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9D06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md3.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9E06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_mdc.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FB9F06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ms3d.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBA006253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_obj.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBA106253BAC005AB5DA = { + children = ( + 1865FBA206253BAC005AB5DA, + 1865FBA306253BAC005AB5DA, + 1865FBA406253BAC005AB5DA, + 1865FBA506253BAC005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FBA206253BAC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBA306253BAC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FBA406253BAC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBA506253BAC005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FBA606253BAC005AB5DA = { + children = ( + 1865FBA706253BAC005AB5DA, + 1865FBA806253BAC005AB5DA, + 1865FBA906253BAC005AB5DA, + 1865FBAA06253BAC005AB5DA, + 1865FBAB06253BAC005AB5DA, + 1865FBAC06253BAC005AB5DA, + 1865FBAD06253BAC005AB5DA, + 1865FBAE06253BAC005AB5DA, + 1865FBAF06253BAC005AB5DA, + 1865FBB006253BAC005AB5DA, + 1865FBB106253BAC005AB5DA, + 1865FBB206253BAC005AB5DA, + 1865FBB306253BAC005AB5DA, + 1865FBB406253BAC005AB5DA, + 1865FBB506253BAC005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FBA706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBA806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picointernal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBA906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAA06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAB06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodules.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAC06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_3ds.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAD06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ase.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAE06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBAF06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_fm.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB006253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_lwo.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB106253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md2.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_md3.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_mdc.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_ms3d.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB506253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pm_obj.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBB606253BAC005AB5DA = { + children = ( + 1865FBB706253BAC005AB5DA, + 1865FBF206253BAD005AB5DA, + 1865FBF306253BAD005AB5DA, + 1865FBF406253BAD005AB5DA, + 1865FBF506253BAD005AB5DA, + 1865FBF606253BAD005AB5DA, + 1865FBF706253BAD005AB5DA, + 1865FBF806253BAD005AB5DA, + 1865FBF906253BAD005AB5DA, + 1865FBFA06253BAD005AB5DA, + 1865FBFB06253BAD005AB5DA, + 1865FBFC06253BAD005AB5DA, + ); + isa = PBXGroup; + path = lwo; + refType = 4; + sourceTree = ""; + }; + 1865FBB706253BAC005AB5DA = { + children = ( + 1865FBB806253BAC005AB5DA, + 1865FBB906253BAC005AB5DA, + 1865FBBA06253BAC005AB5DA, + 1865FBBB06253BAC005AB5DA, + 1865FBBC06253BAC005AB5DA, + 1865FBC806253BAC005AB5DA, + 1865FBD406253BAC005AB5DA, + 1865FBD506253BAC005AB5DA, + 1865FBE106253BAD005AB5DA, + 1865FBE606253BAD005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FBB806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FBB906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FBBA06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FBBB06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FBBC06253BAC005AB5DA = { + children = ( + 1865FBBD06253BAC005AB5DA, + 1865FBBE06253BAC005AB5DA, + 1865FBBF06253BAC005AB5DA, + 1865FBC006253BAC005AB5DA, + 1865FBC106253BAC005AB5DA, + 1865FBC206253BAC005AB5DA, + 1865FBC306253BAC005AB5DA, + 1865FBC406253BAC005AB5DA, + 1865FBC506253BAC005AB5DA, + 1865FBC606253BAC005AB5DA, + 1865FBC706253BAC005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBBD06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clip.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBBE06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "envelope.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBBF06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "list.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC006253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwio.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC106253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwob.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pntspols.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC506253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC606253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vecmath.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vmap.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBC806253BAC005AB5DA = { + children = ( + 1865FBC906253BAC005AB5DA, + 1865FBCA06253BAC005AB5DA, + 1865FBCB06253BAC005AB5DA, + 1865FBCC06253BAC005AB5DA, + 1865FBCD06253BAC005AB5DA, + 1865FBCE06253BAC005AB5DA, + 1865FBCF06253BAC005AB5DA, + 1865FBD006253BAC005AB5DA, + 1865FBD106253BAC005AB5DA, + 1865FBD206253BAC005AB5DA, + 1865FBD306253BAC005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FBC906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clip.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCA06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "envelope.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCB06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "list.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCC06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwio.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCD06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCE06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBCF06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwob.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBD006253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pntspols.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBD106253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBD206253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vecmath.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBD306253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vmap.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBD406253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FBD506253BAC005AB5DA = { + children = ( + 1865FBD606253BAC005AB5DA, + 1865FBD706253BAC005AB5DA, + 1865FBD806253BAC005AB5DA, + 1865FBD906253BAC005AB5DA, + 1865FBDA06253BAC005AB5DA, + 1865FBDB06253BAC005AB5DA, + 1865FBDC06253BAC005AB5DA, + 1865FBDD06253BAD005AB5DA, + 1865FBDE06253BAD005AB5DA, + 1865FBDF06253BAD005AB5DA, + 1865FBE006253BAD005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBD606253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clip.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBD706253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "envelope.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBD806253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "list.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBD906253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwio.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDA06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDB06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDC06253BAC005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwob.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDD06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pntspols.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDE06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBDF06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vecmath.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBE006253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vmap.c.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBE106253BAD005AB5DA = { + children = ( + 1865FBE206253BAD005AB5DA, + 1865FBE306253BAD005AB5DA, + 1865FBE406253BAD005AB5DA, + 1865FBE506253BAD005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FBE206253BAD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBE306253BAD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FBE406253BAD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FBE506253BAD005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FBE606253BAD005AB5DA = { + children = ( + 1865FBE706253BAD005AB5DA, + 1865FBE806253BAD005AB5DA, + 1865FBE906253BAD005AB5DA, + 1865FBEA06253BAD005AB5DA, + 1865FBEB06253BAD005AB5DA, + 1865FBEC06253BAD005AB5DA, + 1865FBED06253BAD005AB5DA, + 1865FBEE06253BAD005AB5DA, + 1865FBEF06253BAD005AB5DA, + 1865FBF006253BAD005AB5DA, + 1865FBF106253BAD005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FBE706253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "clip.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBE806253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "envelope.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBE906253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "list.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBEA06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwio.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBEB06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBEC06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwo2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBED06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lwob.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBEE06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "pntspols.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBEF06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBF006253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vecmath.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBF106253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "vmap.c.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FBF206253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = clip.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF306253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = envelope.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF406253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = list.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF506253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lwio.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF606253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lwo2.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF706253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lwo2.h; + refType = 4; + sourceTree = ""; + }; + 1865FBF806253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = lwob.c; + refType = 4; + sourceTree = ""; + }; + 1865FBF906253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pntspols.c; + refType = 4; + sourceTree = ""; + }; + 1865FBFA06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = surface.c; + refType = 4; + sourceTree = ""; + }; + 1865FBFB06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = vecmath.c; + refType = 4; + sourceTree = ""; + }; + 1865FBFC06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = vmap.c; + refType = 4; + sourceTree = ""; + }; + 1865FBFD06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = picointernal.c; + refType = 4; + sourceTree = ""; + }; + 1865FBFE06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = picointernal.h; + refType = 4; + sourceTree = ""; + }; + 1865FBFF06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = picomodel.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0006253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = picomodel.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FC0106253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = picomodules.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0206253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_3ds.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0306253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_ase.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0406253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_fm.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0506253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = pm_fm.h; + refType = 4; + sourceTree = ""; + }; + 1865FC0606253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_lwo.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0706253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_md2.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0806253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_md3.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0906253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_mdc.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0A06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_ms3d.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0B06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; + path = pm_obj.c; + refType = 4; + sourceTree = ""; + }; + 1865FC0C06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = picomodel.h; + refType = 4; + sourceTree = ""; + }; + 1865FC0D06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = radiant_jpeglib.h; + refType = 4; + sourceTree = ""; + }; + 1865FC0E06253BAD005AB5DA = { + children = ( + 1865FC0F06253BAD005AB5DA, + 1865FC1006253BAD005AB5DA, + 1865FC6706253BAE005AB5DA, + 1865FC6806253BAE005AB5DA, + 1865FC6906253BAE005AB5DA, + 1865FC6A06253BAE005AB5DA, + 1865FC6B06253BAE005AB5DA, + 1865FC6C06253BAE005AB5DA, + 1865FC6D06253BAE005AB5DA, + 1865FC6E06253BAE005AB5DA, + 1865FC6F06253BAE005AB5DA, + 1865FC7006253BAE005AB5DA, + 1865FC7106253BAE005AB5DA, + 1865FC7206253BAE005AB5DA, + 1865FC7306253BAE005AB5DA, + 1865FC7406253BAE005AB5DA, + 1865FC7506253BAE005AB5DA, + 1865FC7606253BAE005AB5DA, + 1865FC7706253BAE005AB5DA, + ); + isa = PBXGroup; + path = splines; + refType = 4; + sourceTree = ""; + }; + 1865FC0F06253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865FC1006253BAD005AB5DA = { + children = ( + 1865FC1106253BAD005AB5DA, + 1865FC1206253BAD005AB5DA, + 1865FC1306253BAD005AB5DA, + 1865FC1406253BAD005AB5DA, + 1865FC1506253BAD005AB5DA, + 1865FC2806253BAE005AB5DA, + 1865FC3B06253BAE005AB5DA, + 1865FC3C06253BAE005AB5DA, + 1865FC4F06253BAE005AB5DA, + 1865FC5406253BAE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FC1106253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FC1206253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FC1306253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FC1406253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FC1506253BAD005AB5DA = { + children = ( + 1865FC1606253BAD005AB5DA, + 1865FC1706253BAD005AB5DA, + 1865FC1806253BAD005AB5DA, + 1865FC1906253BAE005AB5DA, + 1865FC1A06253BAE005AB5DA, + 1865FC1B06253BAE005AB5DA, + 1865FC1C06253BAE005AB5DA, + 1865FC1D06253BAE005AB5DA, + 1865FC1E06253BAE005AB5DA, + 1865FC1F06253BAE005AB5DA, + 1865FC2006253BAE005AB5DA, + 1865FC2106253BAE005AB5DA, + 1865FC2206253BAE005AB5DA, + 1865FC2306253BAE005AB5DA, + 1865FC2406253BAE005AB5DA, + 1865FC2506253BAE005AB5DA, + 1865FC2606253BAE005AB5DA, + 1865FC2706253BAE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1606253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1706253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1806253BAD005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC1F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2206253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Splines.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_list.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC2806253BAE005AB5DA = { + children = ( + 1865FC2906253BAE005AB5DA, + 1865FC2A06253BAE005AB5DA, + 1865FC2B06253BAE005AB5DA, + 1865FC2C06253BAE005AB5DA, + 1865FC2D06253BAE005AB5DA, + 1865FC2E06253BAE005AB5DA, + 1865FC2F06253BAE005AB5DA, + 1865FC3006253BAE005AB5DA, + 1865FC3106253BAE005AB5DA, + 1865FC3206253BAE005AB5DA, + 1865FC3306253BAE005AB5DA, + 1865FC3406253BAE005AB5DA, + 1865FC3506253BAE005AB5DA, + 1865FC3606253BAE005AB5DA, + 1865FC3706253BAE005AB5DA, + 1865FC3806253BAE005AB5DA, + 1865FC3906253BAE005AB5DA, + 1865FC3A06253BAE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FC2906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC2F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3206253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Splines.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_list.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC3B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FC3C06253BAE005AB5DA = { + children = ( + 1865FC3D06253BAE005AB5DA, + 1865FC3E06253BAE005AB5DA, + 1865FC3F06253BAE005AB5DA, + 1865FC4006253BAE005AB5DA, + 1865FC4106253BAE005AB5DA, + 1865FC4206253BAE005AB5DA, + 1865FC4306253BAE005AB5DA, + 1865FC4406253BAE005AB5DA, + 1865FC4506253BAE005AB5DA, + 1865FC4606253BAE005AB5DA, + 1865FC4706253BAE005AB5DA, + 1865FC4806253BAE005AB5DA, + 1865FC4906253BAE005AB5DA, + 1865FC4A06253BAE005AB5DA, + 1865FC4B06253BAE005AB5DA, + 1865FC4C06253BAE005AB5DA, + 1865FC4D06253BAE005AB5DA, + 1865FC4E06253BAE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC3D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC3E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC3F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4206253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "Splines.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_list.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC4F06253BAE005AB5DA = { + children = ( + 1865FC5006253BAE005AB5DA, + 1865FC5106253BAE005AB5DA, + 1865FC5206253BAE005AB5DA, + 1865FC5306253BAE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FC5006253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC5106253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FC5206253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC5306253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FC5406253BAE005AB5DA = { + children = ( + 1865FC5506253BAE005AB5DA, + 1865FC5606253BAE005AB5DA, + 1865FC5706253BAE005AB5DA, + 1865FC5806253BAE005AB5DA, + 1865FC5906253BAE005AB5DA, + 1865FC5A06253BAE005AB5DA, + 1865FC5B06253BAE005AB5DA, + 1865FC5C06253BAE005AB5DA, + 1865FC5D06253BAE005AB5DA, + 1865FC5E06253BAE005AB5DA, + 1865FC5F06253BAE005AB5DA, + 1865FC6006253BAE005AB5DA, + 1865FC6106253BAE005AB5DA, + 1865FC6206253BAE005AB5DA, + 1865FC6306253BAE005AB5DA, + 1865FC6406253BAE005AB5DA, + 1865FC6506253BAE005AB5DA, + 1865FC6606253BAE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FC5506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_angles.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_matrix.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_quaternion.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "math_vector.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC5F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q_shared.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6206253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "splines.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "Splines.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_list.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "util_str.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC6706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = math_angles.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC6806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = math_angles.h; + refType = 4; + sourceTree = ""; + }; + 1865FC6906253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = math_matrix.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC6A06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = math_matrix.h; + refType = 4; + sourceTree = ""; + }; + 1865FC6B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = math_quaternion.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC6C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = math_quaternion.h; + refType = 4; + sourceTree = ""; + }; + 1865FC6D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = math_vector.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC6E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = math_vector.h; + refType = 4; + sourceTree = ""; + }; + 1865FC6F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = q_parse.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC7006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = q_shared.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC7106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q_shared.h; + refType = 4; + sourceTree = ""; + }; + 1865FC7206253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = splines.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC7306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = splines.h; + refType = 4; + sourceTree = ""; + }; + 1865FC7406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = Splines.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FC7506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = util_list.h; + refType = 4; + sourceTree = ""; + }; + 1865FC7606253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = util_str.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FC7706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = util_str.h; + refType = 4; + sourceTree = ""; + }; + 1865FC7806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = str.h; + refType = 4; + sourceTree = ""; + }; + 1865FC7906253BAE005AB5DA = { + children = ( + 1865FC7A06253BAE005AB5DA, + 1865FC9106253BAE005AB5DA, + 1865FCB006253BAF005AB5DA, + 1865FCB106253BAF005AB5DA, + ); + isa = PBXGroup; + path = synapse; + refType = 4; + sourceTree = ""; + }; + 1865FC7A06253BAE005AB5DA = { + children = ( + 1865FC7B06253BAE005AB5DA, + 1865FC7C06253BAE005AB5DA, + 1865FC7D06253BAE005AB5DA, + 1865FC7E06253BAE005AB5DA, + 1865FC7F06253BAE005AB5DA, + 1865FC8206253BAE005AB5DA, + 1865FC8506253BAE005AB5DA, + 1865FC8606253BAE005AB5DA, + 1865FC8906253BAE005AB5DA, + 1865FC8E06253BAE005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FC7B06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FC7C06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FC7D06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FC7E06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FC7F06253BAE005AB5DA = { + children = ( + 1865FC8006253BAE005AB5DA, + 1865FC8106253BAE005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8106253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8206253BAE005AB5DA = { + children = ( + 1865FC8306253BAE005AB5DA, + 1865FC8406253BAE005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FC8306253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC8406253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC8506253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FC8606253BAE005AB5DA = { + children = ( + 1865FC8706253BAE005AB5DA, + 1865FC8806253BAE005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8706253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8806253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "synapse.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8906253BAE005AB5DA = { + children = ( + 1865FC8A06253BAE005AB5DA, + 1865FC8B06253BAE005AB5DA, + 1865FC8C06253BAE005AB5DA, + 1865FC8D06253BAE005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FC8A06253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8B06253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FC8C06253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC8D06253BAE005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FC8E06253BAE005AB5DA = { + children = ( + 1865FC8F06253BAE005AB5DA, + 1865FC9006253BAE005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FC8F06253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC9006253BAE005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "synapse.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC9106253BAE005AB5DA = { + children = ( + 1865FC9206253BAE005AB5DA, + 1865FCAD06253BAF005AB5DA, + 1865FCAE06253BAF005AB5DA, + 1865FCAF06253BAF005AB5DA, + ); + isa = PBXGroup; + path = doc; + refType = 4; + sourceTree = ""; + }; + 1865FC9206253BAE005AB5DA = { + children = ( + 1865FC9306253BAF005AB5DA, + 1865FC9406253BAF005AB5DA, + 1865FC9506253BAF005AB5DA, + 1865FC9606253BAF005AB5DA, + 1865FC9706253BAF005AB5DA, + 1865FC9B06253BAF005AB5DA, + 1865FC9F06253BAF005AB5DA, + 1865FCA006253BAF005AB5DA, + 1865FCA406253BAF005AB5DA, + 1865FCA906253BAF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FC9306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FC9406253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FC9506253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FC9606253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FC9706253BAF005AB5DA = { + children = ( + 1865FC9806253BAF005AB5DA, + 1865FC9906253BAF005AB5DA, + 1865FC9A06253BAF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC9806253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC9906253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "runtime.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC9A06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unload.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FC9B06253BAF005AB5DA = { + children = ( + 1865FC9C06253BAF005AB5DA, + 1865FC9D06253BAF005AB5DA, + 1865FC9E06253BAF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FC9C06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC9D06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "runtime.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC9E06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unload.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FC9F06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCA006253BAF005AB5DA = { + children = ( + 1865FCA106253BAF005AB5DA, + 1865FCA206253BAF005AB5DA, + 1865FCA306253BAF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA106253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "runtime.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unload.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA406253BAF005AB5DA = { + children = ( + 1865FCA506253BAF005AB5DA, + 1865FCA606253BAF005AB5DA, + 1865FCA706253BAF005AB5DA, + 1865FCA806253BAF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FCA506253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA606253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCA706253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCA806253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCA906253BAF005AB5DA = { + children = ( + 1865FCAA06253BAF005AB5DA, + 1865FCAB06253BAF005AB5DA, + 1865FCAC06253BAF005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCAA06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "design.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCAB06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "runtime.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCAC06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "unload.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCAD06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = design.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCAE06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = runtime.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCAF06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = unload.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCB006253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = synapse.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FCB106253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = synapse.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FCB206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = synapse.h; + refType = 4; + sourceTree = ""; + }; + 1865FCB306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = LICENSE; + refType = 4; + sourceTree = ""; + }; + 1865FCB406253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = LICENSE_ID; + refType = 4; + sourceTree = ""; + }; + 1865FCB506253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.python; + path = makeversion.py; + refType = 4; + sourceTree = ""; + }; + 1865FCB606253BAF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = makeversion.pyc; + refType = 4; + sourceTree = ""; + }; + 1865FCB706253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.script.python; + path = osx_setup.py; + refType = 4; + sourceTree = ""; + }; + 1865FCB806253BAF005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = osx_setup.pyc; + refType = 4; + sourceTree = ""; + }; + 1865FCB906253BAF005AB5DA = { + children = ( + 1865FCBA06253BAF005AB5DA, + 1865FCCD06253BAF005AB5DA, + 1865FCDD06253BAF005AB5DA, + 1865FCDE06253BAF005AB5DA, + 1865FD0206253BB0005AB5DA, + 1865FD4E06253BB1005AB5DA, + 1865FD9006253BB1005AB5DA, + 1865FDC306253BB2005AB5DA, + 1865FDFB06253BB3005AB5DA, + 1865FE1F06253BB3005AB5DA, + 1865FE5206253BB3005AB5DA, + 1865FE8006253BB4005AB5DA, + 1865FEAE06253BB4005AB5DA, + 1865FF1406253BB5005AB5DA, + 1865FF2406253BB5005AB5DA, + 1865FF5C06253BB6005AB5DA, + 1865FF8A06253BB7005AB5DA, + 1865FFBD06253BB7005AB5DA, + 1865FFF506253BB8005AB5DA, + 1865002D06253BB8005AB5DA, + 186500A206253BB9005AB5DA, + 186500D006253BB9005AB5DA, + 1865011206253BBA005AB5DA, + ); + isa = PBXGroup; + path = plugins; + refType = 4; + sourceTree = ""; + }; + 1865FCBA06253BAF005AB5DA = { + children = ( + 1865FCBB06253BAF005AB5DA, + 1865FCBC06253BAF005AB5DA, + 1865FCBD06253BAF005AB5DA, + 1865FCBE06253BAF005AB5DA, + 1865FCBF06253BAF005AB5DA, + 1865FCC106253BAF005AB5DA, + 1865FCC306253BAF005AB5DA, + 1865FCC406253BAF005AB5DA, + 1865FCC606253BAF005AB5DA, + 1865FCCB06253BAF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FCBB06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FCBC06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FCBD06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FCBE06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FCBF06253BAF005AB5DA = { + children = ( + 1865FCC006253BAF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCC006253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.mk.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCC106253BAF005AB5DA = { + children = ( + 1865FCC206253BAF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCC206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.mk.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCC306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCC406253BAF005AB5DA = { + children = ( + 1865FCC506253BAF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCC506253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.mk.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCC606253BAF005AB5DA = { + children = ( + 1865FCC706253BAF005AB5DA, + 1865FCC806253BAF005AB5DA, + 1865FCC906253BAF005AB5DA, + 1865FCCA06253BAF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FCC706253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCC806253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCC906253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCCA06253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCCB06253BAF005AB5DA = { + children = ( + 1865FCCC06253BAF005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCCC06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "config.mk.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCCD06253BAF005AB5DA = { + children = ( + 1865FCCE06253BAF005AB5DA, + ); + isa = PBXGroup; + path = archivewad; + refType = 4; + sourceTree = ""; + }; + 1865FCCE06253BAF005AB5DA = { + children = ( + 1865FCCF06253BAF005AB5DA, + 1865FCD006253BAF005AB5DA, + 1865FCD106253BAF005AB5DA, + 1865FCD206253BAF005AB5DA, + 1865FCD306253BAF005AB5DA, + 1865FCD406253BAF005AB5DA, + 1865FCD506253BAF005AB5DA, + 1865FCD606253BAF005AB5DA, + 1865FCD706253BAF005AB5DA, + 1865FCDC06253BAF005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FCCF06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FCD006253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FCD106253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FCD206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FCD306253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCD406253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCD506253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCD606253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCD706253BAF005AB5DA = { + children = ( + 1865FCD806253BAF005AB5DA, + 1865FCD906253BAF005AB5DA, + 1865FCDA06253BAF005AB5DA, + 1865FCDB06253BAF005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FCD806253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCD906253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCDA06253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCDB06253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCDC06253BAF005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCDD06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = config.mk; + refType = 4; + sourceTree = ""; + }; + 1865FCDE06253BAF005AB5DA = { + children = ( + 1865FCDF06253BAF005AB5DA, + 1865FCFE06253BB0005AB5DA, + 1865FCFF06253BB0005AB5DA, + 1865FD0006253BB0005AB5DA, + 1865FD0106253BB0005AB5DA, + ); + isa = PBXGroup; + path = eclassfgd; + refType = 4; + sourceTree = ""; + }; + 1865FCDF06253BAF005AB5DA = { + children = ( + 1865FCE006253BAF005AB5DA, + 1865FCE106253BAF005AB5DA, + 1865FCE206253BAF005AB5DA, + 1865FCE306253BAF005AB5DA, + 1865FCE406253BAF005AB5DA, + 1865FCE906253BAF005AB5DA, + 1865FCEE06253BAF005AB5DA, + 1865FCEF06253BAF005AB5DA, + 1865FCF406253BAF005AB5DA, + 1865FCF906253BB0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FCE006253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FCE106253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FCE206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FCE306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FCE406253BAF005AB5DA = { + children = ( + 1865FCE506253BAF005AB5DA, + 1865FCE606253BAF005AB5DA, + 1865FCE706253BAF005AB5DA, + 1865FCE806253BAF005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCE506253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCE606253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCE706253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCE806253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCE906253BAF005AB5DA = { + children = ( + 1865FCEA06253BAF005AB5DA, + 1865FCEB06253BAF005AB5DA, + 1865FCEC06253BAF005AB5DA, + 1865FCED06253BAF005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCEA06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCEB06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCEC06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCED06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCEE06253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FCEF06253BAF005AB5DA = { + children = ( + 1865FCF006253BAF005AB5DA, + 1865FCF106253BAF005AB5DA, + 1865FCF206253BAF005AB5DA, + 1865FCF306253BAF005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF006253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF106253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "fgd.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF206253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF306253BAF005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF406253BAF005AB5DA = { + children = ( + 1865FCF506253BB0005AB5DA, + 1865FCF606253BB0005AB5DA, + 1865FCF706253BB0005AB5DA, + 1865FCF806253BB0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FCF506253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF606253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FCF706253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FCF806253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCF906253BB0005AB5DA = { + children = ( + 1865FCFA06253BB0005AB5DA, + 1865FCFB06253BB0005AB5DA, + 1865FCFC06253BB0005AB5DA, + 1865FCFD06253BB0005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FCFA06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCFB06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "fgd.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCFC06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCFD06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FCFE06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = fgd.def; + refType = 4; + sourceTree = ""; + }; + 1865FCFF06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = fgd.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FD0006253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD0106253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FD0206253BB0005AB5DA = { + children = ( + 1865FD0306253BB0005AB5DA, + 1865FD4206253BB0005AB5DA, + 1865FD4306253BB0005AB5DA, + 1865FD4406253BB0005AB5DA, + 1865FD4506253BB0005AB5DA, + 1865FD4606253BB0005AB5DA, + 1865FD4706253BB0005AB5DA, + 1865FD4806253BB0005AB5DA, + 1865FD4906253BB0005AB5DA, + 1865FD4A06253BB0005AB5DA, + 1865FD4B06253BB0005AB5DA, + 1865FD4C06253BB0005AB5DA, + 1865FD4D06253BB1005AB5DA, + ); + isa = PBXGroup; + path = entity; + refType = 4; + sourceTree = ""; + }; + 1865FD0306253BB0005AB5DA = { + children = ( + 1865FD0406253BB0005AB5DA, + 1865FD0506253BB0005AB5DA, + 1865FD0606253BB0005AB5DA, + 1865FD0706253BB0005AB5DA, + 1865FD0806253BB0005AB5DA, + 1865FD1506253BB0005AB5DA, + 1865FD2206253BB0005AB5DA, + 1865FD2306253BB0005AB5DA, + 1865FD3006253BB0005AB5DA, + 1865FD3506253BB0005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FD0406253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FD0506253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FD0606253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FD0706253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FD0806253BB0005AB5DA = { + children = ( + 1865FD0906253BB0005AB5DA, + 1865FD0A06253BB0005AB5DA, + 1865FD0B06253BB0005AB5DA, + 1865FD0C06253BB0005AB5DA, + 1865FD0D06253BB0005AB5DA, + 1865FD0E06253BB0005AB5DA, + 1865FD0F06253BB0005AB5DA, + 1865FD1006253BB0005AB5DA, + 1865FD1106253BB0005AB5DA, + 1865FD1206253BB0005AB5DA, + 1865FD1306253BB0005AB5DA, + 1865FD1406253BB0005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0906253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclassmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0A06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0B06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0C06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0D06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0E06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD0F06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1006253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1106253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1206253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1306253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1406253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD1506253BB0005AB5DA = { + children = ( + 1865FD1606253BB0005AB5DA, + 1865FD1706253BB0005AB5DA, + 1865FD1806253BB0005AB5DA, + 1865FD1906253BB0005AB5DA, + 1865FD1A06253BB0005AB5DA, + 1865FD1B06253BB0005AB5DA, + 1865FD1C06253BB0005AB5DA, + 1865FD1D06253BB0005AB5DA, + 1865FD1E06253BB0005AB5DA, + 1865FD1F06253BB0005AB5DA, + 1865FD2006253BB0005AB5DA, + 1865FD2106253BB0005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FD1606253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclassmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1706253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1806253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1906253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1A06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1B06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1C06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1D06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1E06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD1F06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD2006253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD2106253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD2206253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FD2306253BB0005AB5DA = { + children = ( + 1865FD2406253BB0005AB5DA, + 1865FD2506253BB0005AB5DA, + 1865FD2606253BB0005AB5DA, + 1865FD2706253BB0005AB5DA, + 1865FD2806253BB0005AB5DA, + 1865FD2906253BB0005AB5DA, + 1865FD2A06253BB0005AB5DA, + 1865FD2B06253BB0005AB5DA, + 1865FD2C06253BB0005AB5DA, + 1865FD2D06253BB0005AB5DA, + 1865FD2E06253BB0005AB5DA, + 1865FD2F06253BB0005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2406253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclassmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2506253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2606253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2706253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2806253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "entity.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2906253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2A06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2B06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2C06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2D06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2E06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD2F06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD3006253BB0005AB5DA = { + children = ( + 1865FD3106253BB0005AB5DA, + 1865FD3206253BB0005AB5DA, + 1865FD3306253BB0005AB5DA, + 1865FD3406253BB0005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FD3106253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD3206253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FD3306253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD3406253BB0005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FD3506253BB0005AB5DA = { + children = ( + 1865FD3606253BB0005AB5DA, + 1865FD3706253BB0005AB5DA, + 1865FD3806253BB0005AB5DA, + 1865FD3906253BB0005AB5DA, + 1865FD3A06253BB0005AB5DA, + 1865FD3B06253BB0005AB5DA, + 1865FD3C06253BB0005AB5DA, + 1865FD3D06253BB0005AB5DA, + 1865FD3E06253BB0005AB5DA, + 1865FD3F06253BB0005AB5DA, + 1865FD4006253BB0005AB5DA, + 1865FD4106253BB0005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FD3606253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "eclassmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3706253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3806253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3906253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3A06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3B06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3C06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "entity_entitymodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3D06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3E06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "light.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD3F06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD4006253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD4106253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD4206253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = eclassmodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4306253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = entity.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4406253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = entity.def; + refType = 4; + sourceTree = ""; + }; + 1865FD4506253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = entity.h; + refType = 4; + sourceTree = ""; + }; + 1865FD4606253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entity.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FD4706253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = entity_entitymodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4806253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = entity_entitymodel.h; + refType = 4; + sourceTree = ""; + }; + 1865FD4906253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = light.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4A06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = light.h; + refType = 4; + sourceTree = ""; + }; + 1865FD4B06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = miscmodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4C06253BB0005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD4D06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FD4E06253BB1005AB5DA = { + children = ( + 1865FD4F06253BB1005AB5DA, + 1865FD5006253BB1005AB5DA, + 1865FD8706253BB1005AB5DA, + 1865FD8806253BB1005AB5DA, + 1865FD8906253BB1005AB5DA, + 1865FD8A06253BB1005AB5DA, + 1865FD8B06253BB1005AB5DA, + 1865FD8C06253BB1005AB5DA, + 1865FD8D06253BB1005AB5DA, + 1865FD8E06253BB1005AB5DA, + 1865FD8F06253BB1005AB5DA, + ); + isa = PBXGroup; + path = image; + refType = 4; + sourceTree = ""; + }; + 1865FD4F06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865FD5006253BB1005AB5DA = { + children = ( + 1865FD5106253BB1005AB5DA, + 1865FD5206253BB1005AB5DA, + 1865FD5306253BB1005AB5DA, + 1865FD5406253BB1005AB5DA, + 1865FD5506253BB1005AB5DA, + 1865FD6006253BB1005AB5DA, + 1865FD6B06253BB1005AB5DA, + 1865FD6C06253BB1005AB5DA, + 1865FD7706253BB1005AB5DA, + 1865FD7C06253BB1005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FD5106253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FD5206253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FD5306253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FD5406253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FD5506253BB1005AB5DA = { + children = ( + 1865FD5606253BB1005AB5DA, + 1865FD5706253BB1005AB5DA, + 1865FD5806253BB1005AB5DA, + 1865FD5906253BB1005AB5DA, + 1865FD5A06253BB1005AB5DA, + 1865FD5B06253BB1005AB5DA, + 1865FD5C06253BB1005AB5DA, + 1865FD5D06253BB1005AB5DA, + 1865FD5E06253BB1005AB5DA, + 1865FD5F06253BB1005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5606253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5706253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5806253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5906253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5A06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5B06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5C06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5D06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5E06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD5F06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD6006253BB1005AB5DA = { + children = ( + 1865FD6106253BB1005AB5DA, + 1865FD6206253BB1005AB5DA, + 1865FD6306253BB1005AB5DA, + 1865FD6406253BB1005AB5DA, + 1865FD6506253BB1005AB5DA, + 1865FD6606253BB1005AB5DA, + 1865FD6706253BB1005AB5DA, + 1865FD6806253BB1005AB5DA, + 1865FD6906253BB1005AB5DA, + 1865FD6A06253BB1005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FD6106253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6206253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6306253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6406253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6506253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6606253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6706253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6806253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6906253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6A06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD6B06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FD6C06253BB1005AB5DA = { + children = ( + 1865FD6D06253BB1005AB5DA, + 1865FD6E06253BB1005AB5DA, + 1865FD6F06253BB1005AB5DA, + 1865FD7006253BB1005AB5DA, + 1865FD7106253BB1005AB5DA, + 1865FD7206253BB1005AB5DA, + 1865FD7306253BB1005AB5DA, + 1865FD7406253BB1005AB5DA, + 1865FD7506253BB1005AB5DA, + 1865FD7606253BB1005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD6D06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD6E06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD6F06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7006253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7106253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7206253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7306253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "image.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7406253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7506253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7606253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7706253BB1005AB5DA = { + children = ( + 1865FD7806253BB1005AB5DA, + 1865FD7906253BB1005AB5DA, + 1865FD7A06253BB1005AB5DA, + 1865FD7B06253BB1005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FD7806253BB1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7906253BB1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FD7A06253BB1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD7B06253BB1005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FD7C06253BB1005AB5DA = { + children = ( + 1865FD7D06253BB1005AB5DA, + 1865FD7E06253BB1005AB5DA, + 1865FD7F06253BB1005AB5DA, + 1865FD8006253BB1005AB5DA, + 1865FD8106253BB1005AB5DA, + 1865FD8206253BB1005AB5DA, + 1865FD8306253BB1005AB5DA, + 1865FD8406253BB1005AB5DA, + 1865FD8506253BB1005AB5DA, + 1865FD8606253BB1005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FD7D06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD7E06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD7F06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "bmp.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8006253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8106253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8206253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8306253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "image.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8406253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "jpeg.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8506253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8606253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FD8706253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = bmp.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD8806253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = bmp.h; + refType = 4; + sourceTree = ""; + }; + 1865FD8906253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = image.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD8A06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = image.def; + refType = 4; + sourceTree = ""; + }; + 1865FD8B06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = image.h; + refType = 4; + sourceTree = ""; + }; + 1865FD8C06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = image.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FD8D06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = jpeg.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD8E06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = lbmlib.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FD8F06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lbmlib.h; + refType = 4; + sourceTree = ""; + }; + 1865FD9006253BB1005AB5DA = { + children = ( + 1865FD9106253BB1005AB5DA, + 1865FDBC06253BB2005AB5DA, + 1865FDBD06253BB2005AB5DA, + 1865FDBE06253BB2005AB5DA, + 1865FDBF06253BB2005AB5DA, + 1865FDC006253BB2005AB5DA, + 1865FDC106253BB2005AB5DA, + 1865FDC206253BB2005AB5DA, + ); + isa = PBXGroup; + path = imagehl; + refType = 4; + sourceTree = ""; + }; + 1865FD9106253BB1005AB5DA = { + children = ( + 1865FD9206253BB1005AB5DA, + 1865FD9306253BB1005AB5DA, + 1865FD9406253BB1005AB5DA, + 1865FD9506253BB1005AB5DA, + 1865FD9606253BB1005AB5DA, + 1865FD9E06253BB2005AB5DA, + 1865FDA606253BB2005AB5DA, + 1865FDA706253BB2005AB5DA, + 1865FDAF06253BB2005AB5DA, + 1865FDB406253BB2005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FD9206253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FD9306253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FD9406253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FD9506253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FD9606253BB1005AB5DA = { + children = ( + 1865FD9706253BB1005AB5DA, + 1865FD9806253BB1005AB5DA, + 1865FD9906253BB1005AB5DA, + 1865FD9A06253BB1005AB5DA, + 1865FD9B06253BB1005AB5DA, + 1865FD9C06253BB2005AB5DA, + 1865FD9D06253BB2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9706253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9806253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9906253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9A06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9B06253BB1005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9C06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9D06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FD9E06253BB2005AB5DA = { + children = ( + 1865FD9F06253BB2005AB5DA, + 1865FDA006253BB2005AB5DA, + 1865FDA106253BB2005AB5DA, + 1865FDA206253BB2005AB5DA, + 1865FDA306253BB2005AB5DA, + 1865FDA406253BB2005AB5DA, + 1865FDA506253BB2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FD9F06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA006253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA106253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA206253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA306253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA406253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA506253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDA606253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FDA706253BB2005AB5DA = { + children = ( + 1865FDA806253BB2005AB5DA, + 1865FDA906253BB2005AB5DA, + 1865FDAA06253BB2005AB5DA, + 1865FDAB06253BB2005AB5DA, + 1865FDAC06253BB2005AB5DA, + 1865FDAD06253BB2005AB5DA, + 1865FDAE06253BB2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDA806253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDA906253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAA06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAB06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.txt.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAC06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "imagehl.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAD06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAE06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDAF06253BB2005AB5DA = { + children = ( + 1865FDB006253BB2005AB5DA, + 1865FDB106253BB2005AB5DA, + 1865FDB206253BB2005AB5DA, + 1865FDB306253BB2005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FDB006253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDB106253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FDB206253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDB306253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FDB406253BB2005AB5DA = { + children = ( + 1865FDB506253BB2005AB5DA, + 1865FDB606253BB2005AB5DA, + 1865FDB706253BB2005AB5DA, + 1865FDB806253BB2005AB5DA, + 1865FDB906253BB2005AB5DA, + 1865FDBA06253BB2005AB5DA, + 1865FDBB06253BB2005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FDB506253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDB606253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDB706253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDB806253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.txt.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDB906253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagehl.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDBA06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDBB06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "lbmlib.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDBC06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = imagehl.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FDBD06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = imagehl.def; + refType = 4; + sourceTree = ""; + }; + 1865FDBE06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imagehl.h; + refType = 4; + sourceTree = ""; + }; + 1865FDBF06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = imagehl.txt; + refType = 4; + sourceTree = ""; + }; + 1865FDC006253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = imagehl.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FDC106253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = lbmlib.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FDC206253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = lbmlib.h; + refType = 4; + sourceTree = ""; + }; + 1865FDC306253BB2005AB5DA = { + children = ( + 1865FDC406253BB2005AB5DA, + 1865FDF306253BB3005AB5DA, + 1865FDF406253BB3005AB5DA, + 1865FDF506253BB3005AB5DA, + 1865FDF606253BB3005AB5DA, + 1865FDF706253BB3005AB5DA, + 1865FDF806253BB3005AB5DA, + 1865FDF906253BB3005AB5DA, + 1865FDFA06253BB3005AB5DA, + ); + isa = PBXGroup; + path = imagem8; + refType = 4; + sourceTree = ""; + }; + 1865FDC406253BB2005AB5DA = { + children = ( + 1865FDC506253BB2005AB5DA, + 1865FDC606253BB2005AB5DA, + 1865FDC706253BB2005AB5DA, + 1865FDC806253BB2005AB5DA, + 1865FDC906253BB2005AB5DA, + 1865FDD206253BB2005AB5DA, + 1865FDDB06253BB2005AB5DA, + 1865FDDC06253BB2005AB5DA, + 1865FDE506253BB2005AB5DA, + 1865FDEA06253BB2005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FDC506253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FDC606253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FDC706253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FDC806253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FDC906253BB2005AB5DA = { + children = ( + 1865FDCA06253BB2005AB5DA, + 1865FDCB06253BB2005AB5DA, + 1865FDCC06253BB2005AB5DA, + 1865FDCD06253BB2005AB5DA, + 1865FDCE06253BB2005AB5DA, + 1865FDCF06253BB2005AB5DA, + 1865FDD006253BB2005AB5DA, + 1865FDD106253BB2005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCA06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCB06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCC06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCD06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCE06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDCF06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDD006253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDD106253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDD206253BB2005AB5DA = { + children = ( + 1865FDD306253BB2005AB5DA, + 1865FDD406253BB2005AB5DA, + 1865FDD506253BB2005AB5DA, + 1865FDD606253BB2005AB5DA, + 1865FDD706253BB2005AB5DA, + 1865FDD806253BB2005AB5DA, + 1865FDD906253BB2005AB5DA, + 1865FDDA06253BB2005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FDD306253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD406253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD506253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD606253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD706253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD806253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDD906253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDDA06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDDB06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FDDC06253BB2005AB5DA = { + children = ( + 1865FDDD06253BB2005AB5DA, + 1865FDDE06253BB2005AB5DA, + 1865FDDF06253BB2005AB5DA, + 1865FDE006253BB2005AB5DA, + 1865FDE106253BB2005AB5DA, + 1865FDE206253BB2005AB5DA, + 1865FDE306253BB2005AB5DA, + 1865FDE406253BB2005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDDD06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDDE06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDDF06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE006253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "imagem8.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE106253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE206253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE306253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE406253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE506253BB2005AB5DA = { + children = ( + 1865FDE606253BB2005AB5DA, + 1865FDE706253BB2005AB5DA, + 1865FDE806253BB2005AB5DA, + 1865FDE906253BB2005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FDE606253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE706253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FDE806253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FDE906253BB2005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FDEA06253BB2005AB5DA = { + children = ( + 1865FDEB06253BB2005AB5DA, + 1865FDEC06253BB2005AB5DA, + 1865FDED06253BB2005AB5DA, + 1865FDEE06253BB2005AB5DA, + 1865FDEF06253BB2005AB5DA, + 1865FDF006253BB2005AB5DA, + 1865FDF106253BB2005AB5DA, + 1865FDF206253BB3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FDEB06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDEC06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDED06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDEE06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagem8.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDEF06253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDF006253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m32.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDF106253BB2005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDF206253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "m8.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FDF306253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = imagem8.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FDF406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = imagem8.def; + refType = 4; + sourceTree = ""; + }; + 1865FDF506253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imagem8.h; + refType = 4; + sourceTree = ""; + }; + 1865FDF606253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = imagem8.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FDF706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = m32.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FDF806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = m32.h; + refType = 4; + sourceTree = ""; + }; + 1865FDF906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = m8.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FDFA06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = m8.h; + refType = 4; + sourceTree = ""; + }; + 1865FDFB06253BB3005AB5DA = { + children = ( + 1865FDFC06253BB3005AB5DA, + 1865FE1B06253BB3005AB5DA, + 1865FE1C06253BB3005AB5DA, + 1865FE1D06253BB3005AB5DA, + 1865FE1E06253BB3005AB5DA, + ); + isa = PBXGroup; + path = imagepng; + refType = 4; + sourceTree = ""; + }; + 1865FDFC06253BB3005AB5DA = { + children = ( + 1865FDFD06253BB3005AB5DA, + 1865FDFE06253BB3005AB5DA, + 1865FDFF06253BB3005AB5DA, + 1865FE0006253BB3005AB5DA, + 1865FE0106253BB3005AB5DA, + 1865FE0606253BB3005AB5DA, + 1865FE0B06253BB3005AB5DA, + 1865FE0C06253BB3005AB5DA, + 1865FE1106253BB3005AB5DA, + 1865FE1606253BB3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FDFD06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FDFE06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FDFF06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FE0006253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FE0106253BB3005AB5DA = { + children = ( + 1865FE0206253BB3005AB5DA, + 1865FE0306253BB3005AB5DA, + 1865FE0406253BB3005AB5DA, + 1865FE0506253BB3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0206253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0306253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0506253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0606253BB3005AB5DA = { + children = ( + 1865FE0706253BB3005AB5DA, + 1865FE0806253BB3005AB5DA, + 1865FE0906253BB3005AB5DA, + 1865FE0A06253BB3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE0706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE0806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE0906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE0A06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE0B06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FE0C06253BB3005AB5DA = { + children = ( + 1865FE0D06253BB3005AB5DA, + 1865FE0E06253BB3005AB5DA, + 1865FE0F06253BB3005AB5DA, + 1865FE1006253BB3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0D06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0E06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "imagepng.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE0F06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE1006253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE1106253BB3005AB5DA = { + children = ( + 1865FE1206253BB3005AB5DA, + 1865FE1306253BB3005AB5DA, + 1865FE1406253BB3005AB5DA, + 1865FE1506253BB3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FE1206253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE1306253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE1406253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE1506253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE1606253BB3005AB5DA = { + children = ( + 1865FE1706253BB3005AB5DA, + 1865FE1806253BB3005AB5DA, + 1865FE1906253BB3005AB5DA, + 1865FE1A06253BB3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE1706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE1806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagepng.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE1906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE1A06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE1B06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = imagepng.def; + refType = 4; + sourceTree = ""; + }; + 1865FE1C06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = imagepng.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FE1D06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE1E06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FE1F06253BB3005AB5DA = { + children = ( + 1865FE2006253BB3005AB5DA, + 1865FE4B06253BB3005AB5DA, + 1865FE4C06253BB3005AB5DA, + 1865FE4D06253BB3005AB5DA, + 1865FE4E06253BB3005AB5DA, + 1865FE4F06253BB3005AB5DA, + 1865FE5006253BB3005AB5DA, + 1865FE5106253BB3005AB5DA, + ); + isa = PBXGroup; + path = imagewal; + refType = 4; + sourceTree = ""; + }; + 1865FE2006253BB3005AB5DA = { + children = ( + 1865FE2106253BB3005AB5DA, + 1865FE2206253BB3005AB5DA, + 1865FE2306253BB3005AB5DA, + 1865FE2406253BB3005AB5DA, + 1865FE2506253BB3005AB5DA, + 1865FE2D06253BB3005AB5DA, + 1865FE3506253BB3005AB5DA, + 1865FE3606253BB3005AB5DA, + 1865FE3E06253BB3005AB5DA, + 1865FE4306253BB3005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FE2106253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FE2206253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FE2306253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FE2406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FE2506253BB3005AB5DA = { + children = ( + 1865FE2606253BB3005AB5DA, + 1865FE2706253BB3005AB5DA, + 1865FE2806253BB3005AB5DA, + 1865FE2906253BB3005AB5DA, + 1865FE2A06253BB3005AB5DA, + 1865FE2B06253BB3005AB5DA, + 1865FE2C06253BB3005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2606253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2A06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_palette.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2B06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2C06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE2D06253BB3005AB5DA = { + children = ( + 1865FE2E06253BB3005AB5DA, + 1865FE2F06253BB3005AB5DA, + 1865FE3006253BB3005AB5DA, + 1865FE3106253BB3005AB5DA, + 1865FE3206253BB3005AB5DA, + 1865FE3306253BB3005AB5DA, + 1865FE3406253BB3005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE2E06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE2F06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3006253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3106253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3206253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_palette.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3306253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE3506253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FE3606253BB3005AB5DA = { + children = ( + 1865FE3706253BB3005AB5DA, + 1865FE3806253BB3005AB5DA, + 1865FE3906253BB3005AB5DA, + 1865FE3A06253BB3005AB5DA, + 1865FE3B06253BB3005AB5DA, + 1865FE3C06253BB3005AB5DA, + 1865FE3D06253BB3005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3A06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "imagewal.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3B06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_palette.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3C06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3D06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE3E06253BB3005AB5DA = { + children = ( + 1865FE3F06253BB3005AB5DA, + 1865FE4006253BB3005AB5DA, + 1865FE4106253BB3005AB5DA, + 1865FE4206253BB3005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FE3F06253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE4006253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE4106253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE4206253BB3005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE4306253BB3005AB5DA = { + children = ( + 1865FE4406253BB3005AB5DA, + 1865FE4506253BB3005AB5DA, + 1865FE4606253BB3005AB5DA, + 1865FE4706253BB3005AB5DA, + 1865FE4806253BB3005AB5DA, + 1865FE4906253BB3005AB5DA, + 1865FE4A06253BB3005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE4406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4506253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4606253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "imagewal.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4806253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "q2_palette.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4906253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4A06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wal.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE4B06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = imagewal.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE4C06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = imagewal.def; + refType = 4; + sourceTree = ""; + }; + 1865FE4D06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = imagewal.h; + refType = 4; + sourceTree = ""; + }; + 1865FE4E06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = imagewal.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FE4F06253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = q2_palette.h; + refType = 4; + sourceTree = ""; + }; + 1865FE5006253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = wal.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE5106253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = wal.h; + refType = 4; + sourceTree = ""; + }; + 1865FE5206253BB3005AB5DA = { + children = ( + 1865FE5306253BB3005AB5DA, + 1865FE7A06253BB4005AB5DA, + 1865FE7B06253BB4005AB5DA, + 1865FE7C06253BB4005AB5DA, + 1865FE7D06253BB4005AB5DA, + 1865FE7E06253BB4005AB5DA, + 1865FE7F06253BB4005AB5DA, + ); + isa = PBXGroup; + path = map; + refType = 4; + sourceTree = ""; + }; + 1865FE5306253BB3005AB5DA = { + children = ( + 1865FE5406253BB3005AB5DA, + 1865FE5506253BB3005AB5DA, + 1865FE5606253BB3005AB5DA, + 1865FE5706253BB3005AB5DA, + 1865FE5806253BB3005AB5DA, + 1865FE5F06253BB4005AB5DA, + 1865FE6606253BB4005AB5DA, + 1865FE6706253BB4005AB5DA, + 1865FE6E06253BB4005AB5DA, + 1865FE7306253BB4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FE5406253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FE5506253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FE5606253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FE5706253BB3005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FE5806253BB3005AB5DA = { + children = ( + 1865FE5906253BB4005AB5DA, + 1865FE5A06253BB4005AB5DA, + 1865FE5B06253BB4005AB5DA, + 1865FE5C06253BB4005AB5DA, + 1865FE5D06253BB4005AB5DA, + 1865FE5E06253BB4005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5A06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5B06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5C06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5D06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5E06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "write.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE5F06253BB4005AB5DA = { + children = ( + 1865FE6006253BB4005AB5DA, + 1865FE6106253BB4005AB5DA, + 1865FE6206253BB4005AB5DA, + 1865FE6306253BB4005AB5DA, + 1865FE6406253BB4005AB5DA, + 1865FE6506253BB4005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE6006253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6106253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6206253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6306253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6406253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6506253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "write.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE6606253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FE6706253BB4005AB5DA = { + children = ( + 1865FE6806253BB4005AB5DA, + 1865FE6906253BB4005AB5DA, + 1865FE6A06253BB4005AB5DA, + 1865FE6B06253BB4005AB5DA, + 1865FE6C06253BB4005AB5DA, + 1865FE6D06253BB4005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6806253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "map.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6A06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6B06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6C06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6D06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "write.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE6E06253BB4005AB5DA = { + children = ( + 1865FE6F06253BB4005AB5DA, + 1865FE7006253BB4005AB5DA, + 1865FE7106253BB4005AB5DA, + 1865FE7206253BB4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FE6F06253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE7006253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE7106253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE7206253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE7306253BB4005AB5DA = { + children = ( + 1865FE7406253BB4005AB5DA, + 1865FE7506253BB4005AB5DA, + 1865FE7606253BB4005AB5DA, + 1865FE7706253BB4005AB5DA, + 1865FE7806253BB4005AB5DA, + 1865FE7906253BB4005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FE7406253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7506253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "map.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7606253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "parse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7706253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7806253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "write.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE7A06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = map.def; + refType = 4; + sourceTree = ""; + }; + 1865FE7B06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = map.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FE7C06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = parse.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE7D06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE7E06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FE7F06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = write.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FE8006253BB4005AB5DA = { + children = ( + 1865FE8106253BB4005AB5DA, + 1865FEA806253BB4005AB5DA, + 1865FEA906253BB4005AB5DA, + 1865FEAA06253BB4005AB5DA, + 1865FEAB06253BB4005AB5DA, + 1865FEAC06253BB4005AB5DA, + 1865FEAD06253BB4005AB5DA, + ); + isa = PBXGroup; + path = mapxml; + refType = 4; + sourceTree = ""; + }; + 1865FE8106253BB4005AB5DA = { + children = ( + 1865FE8206253BB4005AB5DA, + 1865FE8306253BB4005AB5DA, + 1865FE8406253BB4005AB5DA, + 1865FE8506253BB4005AB5DA, + 1865FE8606253BB4005AB5DA, + 1865FE8D06253BB4005AB5DA, + 1865FE9406253BB4005AB5DA, + 1865FE9506253BB4005AB5DA, + 1865FE9C06253BB4005AB5DA, + 1865FEA106253BB4005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FE8206253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FE8306253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FE8406253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FE8506253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FE8606253BB4005AB5DA = { + children = ( + 1865FE8706253BB4005AB5DA, + 1865FE8806253BB4005AB5DA, + 1865FE8906253BB4005AB5DA, + 1865FE8A06253BB4005AB5DA, + 1865FE8B06253BB4005AB5DA, + 1865FE8C06253BB4005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8706253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8806253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8A06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8B06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlparse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8C06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlwrite.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE8D06253BB4005AB5DA = { + children = ( + 1865FE8E06253BB4005AB5DA, + 1865FE8F06253BB4005AB5DA, + 1865FE9006253BB4005AB5DA, + 1865FE9106253BB4005AB5DA, + 1865FE9206253BB4005AB5DA, + 1865FE9306253BB4005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE8E06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE8F06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE9006253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE9106253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE9206253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlparse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE9306253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlwrite.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FE9406253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FE9506253BB4005AB5DA = { + children = ( + 1865FE9606253BB4005AB5DA, + 1865FE9706253BB4005AB5DA, + 1865FE9806253BB4005AB5DA, + 1865FE9906253BB4005AB5DA, + 1865FE9A06253BB4005AB5DA, + 1865FE9B06253BB4005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9606253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9706253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "mapxml.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9806253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9A06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlparse.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9B06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlwrite.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9C06253BB4005AB5DA = { + children = ( + 1865FE9D06253BB4005AB5DA, + 1865FE9E06253BB4005AB5DA, + 1865FE9F06253BB4005AB5DA, + 1865FEA006253BB4005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FE9D06253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FE9E06253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FE9F06253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEA006253BB4005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FEA106253BB4005AB5DA = { + children = ( + 1865FEA206253BB4005AB5DA, + 1865FEA306253BB4005AB5DA, + 1865FEA406253BB4005AB5DA, + 1865FEA506253BB4005AB5DA, + 1865FEA606253BB4005AB5DA, + 1865FEA706253BB4005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FEA206253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA306253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "mapxml.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA406253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA506253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA606253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlparse.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA706253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "xmlwrite.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEA806253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = mapxml.def; + refType = 4; + sourceTree = ""; + }; + 1865FEA906253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = mapxml.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FEAA06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FEAB06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FEAC06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = xmlparse.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FEAD06253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = xmlwrite.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FEAE06253BB4005AB5DA = { + children = ( + 1865FEAF06253BB4005AB5DA, + 1865FEEE06253BB5005AB5DA, + 1865FF0806253BB5005AB5DA, + 1865FF0906253BB5005AB5DA, + 1865FF0A06253BB5005AB5DA, + 1865FF0B06253BB5005AB5DA, + 1865FF0C06253BB5005AB5DA, + 1865FF0D06253BB5005AB5DA, + 1865FF0E06253BB5005AB5DA, + 1865FF0F06253BB5005AB5DA, + 1865FF1006253BB5005AB5DA, + 1865FF1106253BB5005AB5DA, + 1865FF1206253BB5005AB5DA, + 1865FF1306253BB5005AB5DA, + ); + isa = PBXGroup; + path = model; + refType = 4; + sourceTree = ""; + }; + 1865FEAF06253BB4005AB5DA = { + children = ( + 1865FEB006253BB4005AB5DA, + 1865FEB106253BB4005AB5DA, + 1865FEB206253BB4005AB5DA, + 1865FEB306253BB4005AB5DA, + 1865FEB406253BB4005AB5DA, + 1865FEC106253BB5005AB5DA, + 1865FECE06253BB5005AB5DA, + 1865FECF06253BB5005AB5DA, + 1865FEDC06253BB5005AB5DA, + 1865FEE106253BB5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FEB006253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FEB106253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FEB206253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FEB306253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FEB406253BB4005AB5DA = { + children = ( + 1865FEB506253BB4005AB5DA, + 1865FEB606253BB5005AB5DA, + 1865FEB706253BB5005AB5DA, + 1865FEB806253BB5005AB5DA, + 1865FEB906253BB5005AB5DA, + 1865FEBA06253BB5005AB5DA, + 1865FEBB06253BB5005AB5DA, + 1865FEBC06253BB5005AB5DA, + 1865FEBD06253BB5005AB5DA, + 1865FEBE06253BB5005AB5DA, + 1865FEBF06253BB5005AB5DA, + 1865FEC006253BB5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEB506253BB4005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEB606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEB706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEB806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEB906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBA06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBB06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBC06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBD06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBE06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEBF06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "remap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEC006253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEC106253BB5005AB5DA = { + children = ( + 1865FEC206253BB5005AB5DA, + 1865FEC306253BB5005AB5DA, + 1865FEC406253BB5005AB5DA, + 1865FEC506253BB5005AB5DA, + 1865FEC606253BB5005AB5DA, + 1865FEC706253BB5005AB5DA, + 1865FEC806253BB5005AB5DA, + 1865FEC906253BB5005AB5DA, + 1865FECA06253BB5005AB5DA, + 1865FECB06253BB5005AB5DA, + 1865FECC06253BB5005AB5DA, + 1865FECD06253BB5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FEC206253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC306253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC406253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC506253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEC906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FECA06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FECB06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FECC06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "remap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FECD06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FECE06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FECF06253BB5005AB5DA = { + children = ( + 1865FED006253BB5005AB5DA, + 1865FED106253BB5005AB5DA, + 1865FED206253BB5005AB5DA, + 1865FED306253BB5005AB5DA, + 1865FED406253BB5005AB5DA, + 1865FED506253BB5005AB5DA, + 1865FED606253BB5005AB5DA, + 1865FED706253BB5005AB5DA, + 1865FED806253BB5005AB5DA, + 1865FED906253BB5005AB5DA, + 1865FEDA06253BB5005AB5DA, + 1865FEDB06253BB5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED006253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED106253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED206253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED306253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED406253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED506253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "model.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FED906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEDA06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "remap.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEDB06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEDC06253BB5005AB5DA = { + children = ( + 1865FEDD06253BB5005AB5DA, + 1865FEDE06253BB5005AB5DA, + 1865FEDF06253BB5005AB5DA, + 1865FEE006253BB5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FEDD06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEDE06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FEDF06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEE006253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FEE106253BB5005AB5DA = { + children = ( + 1865FEE206253BB5005AB5DA, + 1865FEE306253BB5005AB5DA, + 1865FEE406253BB5005AB5DA, + 1865FEE506253BB5005AB5DA, + 1865FEE606253BB5005AB5DA, + 1865FEE706253BB5005AB5DA, + 1865FEE806253BB5005AB5DA, + 1865FEE906253BB5005AB5DA, + 1865FEEA06253BB5005AB5DA, + 1865FEEB06253BB5005AB5DA, + 1865FEEC06253BB5005AB5DA, + 1865FEED06253BB5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FEE206253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE306253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicomodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE406253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE506253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "cpicosurface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "miscmodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEE906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEEA06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEEB06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEEC06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "remap.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEED06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEEE06253BB5005AB5DA = { + children = ( + 1865FEEF06253BB5005AB5DA, + 1865FF0606253BB5005AB5DA, + 1865FF0706253BB5005AB5DA, + ); + isa = PBXGroup; + path = bitmaps; + refType = 4; + sourceTree = ""; + }; + 1865FEEF06253BB5005AB5DA = { + children = ( + 1865FEF006253BB5005AB5DA, + 1865FEF106253BB5005AB5DA, + 1865FEF206253BB5005AB5DA, + 1865FEF306253BB5005AB5DA, + 1865FEF406253BB5005AB5DA, + 1865FEF706253BB5005AB5DA, + 1865FEFA06253BB5005AB5DA, + 1865FEFB06253BB5005AB5DA, + 1865FEFE06253BB5005AB5DA, + 1865FF0306253BB5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FEF006253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FEF106253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FEF206253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FEF306253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FEF406253BB5005AB5DA = { + children = ( + 1865FEF506253BB5005AB5DA, + 1865FEF606253BB5005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEF506253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_reload_entity.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEF606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEF706253BB5005AB5DA = { + children = ( + 1865FEF806253BB5005AB5DA, + 1865FEF906253BB5005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FEF806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_reload_entity.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEF906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FEFA06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FEFB06253BB5005AB5DA = { + children = ( + 1865FEFC06253BB5005AB5DA, + 1865FEFD06253BB5005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEFC06253BB5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "model_reload_entity.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEFD06253BB5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "picomodel.bmp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FEFE06253BB5005AB5DA = { + children = ( + 1865FEFF06253BB5005AB5DA, + 1865FF0006253BB5005AB5DA, + 1865FF0106253BB5005AB5DA, + 1865FF0206253BB5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FEFF06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF0006253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF0106253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF0206253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF0306253BB5005AB5DA = { + children = ( + 1865FF0406253BB5005AB5DA, + 1865FF0506253BB5005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF0406253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "model_reload_entity.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF0506253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "picomodel.bmp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF0606253BB5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = model_reload_entity.bmp; + refType = 4; + sourceTree = ""; + }; + 1865FF0706253BB5005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = image.bmp; + path = picomodel.bmp; + refType = 4; + sourceTree = ""; + }; + 1865FF0806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = cpicomodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF0906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cpicomodel.h; + refType = 4; + sourceTree = ""; + }; + 1865FF0A06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = cpicosurface.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF0B06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = cpicosurface.h; + refType = 4; + sourceTree = ""; + }; + 1865FF0C06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = miscmodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF0D06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = model.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF0E06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = model.def; + refType = 4; + sourceTree = ""; + }; + 1865FF0F06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = model.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FF1006253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF1106253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FF1206253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = remap.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF1306253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surface.h; + refType = 4; + sourceTree = ""; + }; + 1865FF1406253BB5005AB5DA = { + children = ( + 1865FF1506253BB5005AB5DA, + ); + isa = PBXGroup; + path = sample; + refType = 4; + sourceTree = ""; + }; + 1865FF1506253BB5005AB5DA = { + children = ( + 1865FF1606253BB5005AB5DA, + 1865FF1706253BB5005AB5DA, + 1865FF1806253BB5005AB5DA, + 1865FF1906253BB5005AB5DA, + 1865FF1A06253BB5005AB5DA, + 1865FF1B06253BB5005AB5DA, + 1865FF1C06253BB5005AB5DA, + 1865FF1D06253BB5005AB5DA, + 1865FF1E06253BB5005AB5DA, + 1865FF2306253BB5005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FF1606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FF1706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FF1806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FF1906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FF1A06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF1B06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF1C06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FF1D06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF1E06253BB5005AB5DA = { + children = ( + 1865FF1F06253BB5005AB5DA, + 1865FF2006253BB5005AB5DA, + 1865FF2106253BB5005AB5DA, + 1865FF2206253BB5005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FF1F06253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2006253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF2106253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2206253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF2306253BB5005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF2406253BB5005AB5DA = { + children = ( + 1865FF2506253BB5005AB5DA, + 1865FF5406253BB6005AB5DA, + 1865FF5506253BB6005AB5DA, + 1865FF5606253BB6005AB5DA, + 1865FF5706253BB6005AB5DA, + 1865FF5806253BB6005AB5DA, + 1865FF5906253BB6005AB5DA, + 1865FF5A06253BB6005AB5DA, + 1865FF5B06253BB6005AB5DA, + ); + isa = PBXGroup; + path = shaders; + refType = 4; + sourceTree = ""; + }; + 1865FF2506253BB5005AB5DA = { + children = ( + 1865FF2606253BB5005AB5DA, + 1865FF2706253BB5005AB5DA, + 1865FF2806253BB5005AB5DA, + 1865FF2906253BB5005AB5DA, + 1865FF2A06253BB5005AB5DA, + 1865FF3306253BB6005AB5DA, + 1865FF3C06253BB6005AB5DA, + 1865FF3D06253BB6005AB5DA, + 1865FF4606253BB6005AB5DA, + 1865FF4B06253BB6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FF2606253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FF2706253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FF2806253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FF2906253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FF2A06253BB5005AB5DA = { + children = ( + 1865FF2B06253BB5005AB5DA, + 1865FF2C06253BB5005AB5DA, + 1865FF2D06253BB5005AB5DA, + 1865FF2E06253BB5005AB5DA, + 1865FF2F06253BB5005AB5DA, + 1865FF3006253BB6005AB5DA, + 1865FF3106253BB6005AB5DA, + 1865FF3206253BB6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2B06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2C06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2D06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2E06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF2F06253BB5005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3106253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3206253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shadershl.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3306253BB6005AB5DA = { + children = ( + 1865FF3406253BB6005AB5DA, + 1865FF3506253BB6005AB5DA, + 1865FF3606253BB6005AB5DA, + 1865FF3706253BB6005AB5DA, + 1865FF3806253BB6005AB5DA, + 1865FF3906253BB6005AB5DA, + 1865FF3A06253BB6005AB5DA, + 1865FF3B06253BB6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF3406253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3506253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3606253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3706253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3806253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3906253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3A06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3B06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shadershl.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF3C06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FF3D06253BB6005AB5DA = { + children = ( + 1865FF3E06253BB6005AB5DA, + 1865FF3F06253BB6005AB5DA, + 1865FF4006253BB6005AB5DA, + 1865FF4106253BB6005AB5DA, + 1865FF4206253BB6005AB5DA, + 1865FF4306253BB6005AB5DA, + 1865FF4406253BB6005AB5DA, + 1865FF4506253BB6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3E06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF3F06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4106253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4206253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4306253BB6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = "shaders.proj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4406253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "shaders.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4506253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shadershl.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4606253BB6005AB5DA = { + children = ( + 1865FF4706253BB6005AB5DA, + 1865FF4806253BB6005AB5DA, + 1865FF4906253BB6005AB5DA, + 1865FF4A06253BB6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FF4706253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4806253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF4906253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF4A06253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF4B06253BB6005AB5DA = { + children = ( + 1865FF4C06253BB6005AB5DA, + 1865FF4D06253BB6005AB5DA, + 1865FF4E06253BB6005AB5DA, + 1865FF4F06253BB6005AB5DA, + 1865FF5006253BB6005AB5DA, + 1865FF5106253BB6005AB5DA, + 1865FF5206253BB6005AB5DA, + 1865FF5306253BB6005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF4C06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF4D06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF4E06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF4F06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF5006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF5106253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.proj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF5206253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shaders.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF5306253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "shadershl.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF5406253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF5506253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FF5606253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = shaders.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF5706253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shaders.def; + refType = 4; + sourceTree = ""; + }; + 1865FF5806253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = shaders.h; + refType = 4; + sourceTree = ""; + }; + 1865FF5906253BB6005AB5DA = { + isa = PBXFileReference; + lastKnownFileType = file; + path = shaders.proj; + refType = 4; + sourceTree = ""; + }; + 1865FF5A06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = shaders.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FF5B06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = shadershl.def; + refType = 4; + sourceTree = ""; + }; + 1865FF5C06253BB6005AB5DA = { + children = ( + 1865FF5D06253BB6005AB5DA, + 1865FF8406253BB7005AB5DA, + 1865FF8506253BB7005AB5DA, + 1865FF8606253BB7005AB5DA, + 1865FF8706253BB7005AB5DA, + 1865FF8806253BB7005AB5DA, + 1865FF8906253BB7005AB5DA, + ); + isa = PBXGroup; + path = spritemodel; + refType = 4; + sourceTree = ""; + }; + 1865FF5D06253BB6005AB5DA = { + children = ( + 1865FF5E06253BB6005AB5DA, + 1865FF5F06253BB6005AB5DA, + 1865FF6006253BB6005AB5DA, + 1865FF6106253BB6005AB5DA, + 1865FF6206253BB6005AB5DA, + 1865FF6906253BB6005AB5DA, + 1865FF7006253BB6005AB5DA, + 1865FF7106253BB6005AB5DA, + 1865FF7806253BB6005AB5DA, + 1865FF7D06253BB6005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FF5E06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FF5F06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FF6006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FF6106253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FF6206253BB6005AB5DA = { + children = ( + 1865FF6306253BB6005AB5DA, + 1865FF6406253BB6005AB5DA, + 1865FF6506253BB6005AB5DA, + 1865FF6606253BB6005AB5DA, + 1865FF6706253BB6005AB5DA, + 1865FF6806253BB6005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6306253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6406253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6506253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6606253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6706253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6806253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF6906253BB6005AB5DA = { + children = ( + 1865FF6A06253BB6005AB5DA, + 1865FF6B06253BB6005AB5DA, + 1865FF6C06253BB6005AB5DA, + 1865FF6D06253BB6005AB5DA, + 1865FF6E06253BB6005AB5DA, + 1865FF6F06253BB6005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF6A06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF6B06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF6C06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF6D06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF6E06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF6F06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF7006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FF7106253BB6005AB5DA = { + children = ( + 1865FF7206253BB6005AB5DA, + 1865FF7306253BB6005AB5DA, + 1865FF7406253BB6005AB5DA, + 1865FF7506253BB6005AB5DA, + 1865FF7606253BB6005AB5DA, + 1865FF7706253BB6005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7206253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7306253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7406253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7506253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7606253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7706253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "spritemodel.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7806253BB6005AB5DA = { + children = ( + 1865FF7906253BB6005AB5DA, + 1865FF7A06253BB6005AB5DA, + 1865FF7B06253BB6005AB5DA, + 1865FF7C06253BB6005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FF7906253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7A06253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF7B06253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF7C06253BB6005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF7D06253BB6005AB5DA = { + children = ( + 1865FF7E06253BB6005AB5DA, + 1865FF7F06253BB6005AB5DA, + 1865FF8006253BB6005AB5DA, + 1865FF8106253BB6005AB5DA, + 1865FF8206253BB7005AB5DA, + 1865FF8306253BB7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FF7E06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF7F06253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF8006253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF8106253BB6005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF8206253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF8306253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "spritemodel.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF8406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF8506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FF8606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = spritemodel.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FF8706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = spritemodel.def; + refType = 4; + sourceTree = ""; + }; + 1865FF8806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = spritemodel.h; + refType = 4; + sourceTree = ""; + }; + 1865FF8906253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = spritemodel.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FF8A06253BB7005AB5DA = { + children = ( + 1865FF8B06253BB7005AB5DA, + 1865FF8C06253BB7005AB5DA, + 1865FFB706253BB7005AB5DA, + 1865FFB806253BB7005AB5DA, + 1865FFB906253BB7005AB5DA, + 1865FFBA06253BB7005AB5DA, + 1865FFBB06253BB7005AB5DA, + 1865FFBC06253BB7005AB5DA, + ); + isa = PBXGroup; + path = surface; + refType = 4; + sourceTree = ""; + }; + 1865FF8B06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = .cvsignore; + refType = 4; + sourceTree = ""; + }; + 1865FF8C06253BB7005AB5DA = { + children = ( + 1865FF8D06253BB7005AB5DA, + 1865FF8E06253BB7005AB5DA, + 1865FF8F06253BB7005AB5DA, + 1865FF9006253BB7005AB5DA, + 1865FF9106253BB7005AB5DA, + 1865FF9906253BB7005AB5DA, + 1865FFA106253BB7005AB5DA, + 1865FFA206253BB7005AB5DA, + 1865FFAA06253BB7005AB5DA, + 1865FFAF06253BB7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FF8D06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FF8E06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FF8F06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FF9006253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FF9106253BB7005AB5DA = { + children = ( + 1865FF9206253BB7005AB5DA, + 1865FF9306253BB7005AB5DA, + 1865FF9406253BB7005AB5DA, + 1865FF9506253BB7005AB5DA, + 1865FF9606253BB7005AB5DA, + 1865FF9706253BB7005AB5DA, + 1865FF9806253BB7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9206253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9306253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FF9906253BB7005AB5DA = { + children = ( + 1865FF9A06253BB7005AB5DA, + 1865FF9B06253BB7005AB5DA, + 1865FF9C06253BB7005AB5DA, + 1865FF9D06253BB7005AB5DA, + 1865FF9E06253BB7005AB5DA, + 1865FF9F06253BB7005AB5DA, + 1865FFA006253BB7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FF9A06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF9B06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF9C06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF9D06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF9E06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FF9F06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFA006253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFA106253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FFA206253BB7005AB5DA = { + children = ( + 1865FFA306253BB7005AB5DA, + 1865FFA406253BB7005AB5DA, + 1865FFA506253BB7005AB5DA, + 1865FFA606253BB7005AB5DA, + 1865FFA706253BB7005AB5DA, + 1865FFA806253BB7005AB5DA, + 1865FFA906253BB7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA306253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "surface.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFA906253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFAA06253BB7005AB5DA = { + children = ( + 1865FFAB06253BB7005AB5DA, + 1865FFAC06253BB7005AB5DA, + 1865FFAD06253BB7005AB5DA, + 1865FFAE06253BB7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FFAB06253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFAC06253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FFAD06253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFAE06253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FFAF06253BB7005AB5DA = { + children = ( + 1865FFB006253BB7005AB5DA, + 1865FFB106253BB7005AB5DA, + 1865FFB206253BB7005AB5DA, + 1865FFB306253BB7005AB5DA, + 1865FFB406253BB7005AB5DA, + 1865FFB506253BB7005AB5DA, + 1865FFB606253BB7005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FFB006253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = ".cvsignore.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB106253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB206253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB306253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFB706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = surface.def; + refType = 4; + sourceTree = ""; + }; + 1865FFB806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = surface.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FFB906253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfacedialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FFBA06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfacedialog.h; + refType = 4; + sourceTree = ""; + }; + 1865FFBB06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfdlg_plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FFBC06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfdlg_plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FFBD06253BB7005AB5DA = { + children = ( + 1865FFBE06253BB7005AB5DA, + 1865FFED06253BB8005AB5DA, + 1865FFEE06253BB8005AB5DA, + 1865FFEF06253BB8005AB5DA, + 1865FFF006253BB8005AB5DA, + 1865FFF106253BB8005AB5DA, + 1865FFF206253BB8005AB5DA, + 1865FFF306253BB8005AB5DA, + 1865FFF406253BB8005AB5DA, + ); + isa = PBXGroup; + path = surface_heretic2; + refType = 4; + sourceTree = ""; + }; + 1865FFBE06253BB7005AB5DA = { + children = ( + 1865FFBF06253BB7005AB5DA, + 1865FFC006253BB7005AB5DA, + 1865FFC106253BB7005AB5DA, + 1865FFC206253BB7005AB5DA, + 1865FFC306253BB7005AB5DA, + 1865FFCC06253BB7005AB5DA, + 1865FFD506253BB7005AB5DA, + 1865FFD606253BB7005AB5DA, + 1865FFDF06253BB7005AB5DA, + 1865FFE406253BB7005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FFBF06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FFC006253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FFC106253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FFC206253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FFC306253BB7005AB5DA = { + children = ( + 1865FFC406253BB7005AB5DA, + 1865FFC506253BB7005AB5DA, + 1865FFC606253BB7005AB5DA, + 1865FFC706253BB7005AB5DA, + 1865FFC806253BB7005AB5DA, + 1865FFC906253BB7005AB5DA, + 1865FFCA06253BB7005AB5DA, + 1865FFCB06253BB7005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFC906253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFCA06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFCB06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFCC06253BB7005AB5DA = { + children = ( + 1865FFCD06253BB7005AB5DA, + 1865FFCE06253BB7005AB5DA, + 1865FFCF06253BB7005AB5DA, + 1865FFD006253BB7005AB5DA, + 1865FFD106253BB7005AB5DA, + 1865FFD206253BB7005AB5DA, + 1865FFD306253BB7005AB5DA, + 1865FFD406253BB7005AB5DA, + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FFCD06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFCE06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFCF06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD006253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD106253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD206253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD306253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD406253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFD506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = README.txt; + refType = 4; + sourceTree = ""; + }; + 1865FFD606253BB7005AB5DA = { + children = ( + 1865FFD706253BB7005AB5DA, + 1865FFD806253BB7005AB5DA, + 1865FFD906253BB7005AB5DA, + 1865FFDA06253BB7005AB5DA, + 1865FFDB06253BB7005AB5DA, + 1865FFDC06253BB7005AB5DA, + 1865FFDD06253BB7005AB5DA, + 1865FFDE06253BB7005AB5DA, + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFD706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFD806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = "surface_heretic2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFD906253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDA06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDB06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDC06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDD06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDE06253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFDF06253BB7005AB5DA = { + children = ( + 1865FFE006253BB7005AB5DA, + 1865FFE106253BB7005AB5DA, + 1865FFE206253BB7005AB5DA, + 1865FFE306253BB7005AB5DA, + ); + isa = PBXGroup; + path = tmp; + refType = 4; + sourceTree = ""; + }; + 1865FFE006253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFE106253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = props; + refType = 4; + sourceTree = ""; + }; + 1865FFE206253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = "text-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFE306253BB7005AB5DA = { + children = ( + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FFE406253BB7005AB5DA = { + children = ( + 1865FFE506253BB7005AB5DA, + 1865FFE606253BB7005AB5DA, + 1865FFE706253BB7005AB5DA, + 1865FFE806253BB7005AB5DA, + 1865FFE906253BB8005AB5DA, + 1865FFEA06253BB8005AB5DA, + 1865FFEB06253BB8005AB5DA, + 1865FFEC06253BB8005AB5DA, + ); + isa = PBXGroup; + path = wcprops; + refType = 4; + sourceTree = ""; + }; + 1865FFE506253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.def.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFE606253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_heretic2.vcproj.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFE706253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFE806253BB7005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFE906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFEA06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfaceflagsdialog_heretic2.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFEB06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.cpp.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFEC06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfdlg_plugin.h.svn-work"; + refType = 4; + sourceTree = ""; + }; + 1865FFED06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = surface_heretic2.def; + refType = 4; + sourceTree = ""; + }; + 1865FFEE06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = surface_heretic2.vcproj; + refType = 4; + sourceTree = ""; + }; + 1865FFEF06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfacedialog.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FFF006253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfacedialog.h; + refType = 4; + sourceTree = ""; + }; + 1865FFF106253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfaceflagsdialog_heretic2.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FFF206253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfaceflagsdialog_heretic2.h; + refType = 4; + sourceTree = ""; + }; + 1865FFF306253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + path = surfdlg_plugin.cpp; + refType = 4; + sourceTree = ""; + }; + 1865FFF406253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = surfdlg_plugin.h; + refType = 4; + sourceTree = ""; + }; + 1865FFF506253BB8005AB5DA = { + children = ( + 1865FFF606253BB8005AB5DA, + 1865002506253BB8005AB5DA, + 1865002606253BB8005AB5DA, + 1865002706253BB8005AB5DA, + 1865002806253BB8005AB5DA, + 1865002906253BB8005AB5DA, + 1865002A06253BB8005AB5DA, + 1865002B06253BB8005AB5DA, + 1865002C06253BB8005AB5DA, + ); + isa = PBXGroup; + path = surface_quake2; + refType = 4; + sourceTree = ""; + }; + 1865FFF606253BB8005AB5DA = { + children = ( + 1865FFF706253BB8005AB5DA, + 1865FFF806253BB8005AB5DA, + 1865FFF906253BB8005AB5DA, + 1865FFFA06253BB8005AB5DA, + 1865FFFB06253BB8005AB5DA, + 1865000406253BB8005AB5DA, + 1865000D06253BB8005AB5DA, + 1865000E06253BB8005AB5DA, + 1865001706253BB8005AB5DA, + 1865001C06253BB8005AB5DA, + ); + isa = PBXGroup; + path = .svn; + refType = 4; + sourceTree = ""; + }; + 1865FFF706253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "dir-wcprops"; + refType = 4; + sourceTree = ""; + }; + 1865FFF806253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "empty-file"; + refType = 4; + sourceTree = ""; + }; + 1865FFF906253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text.plist.xml; + path = entries; + refType = 4; + sourceTree = ""; + }; + 1865FFFA06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = format; + refType = 4; + sourceTree = ""; + }; + 1865FFFB06253BB8005AB5DA = { + children = ( + 1865FFFC06253BB8005AB5DA, + 1865FFFD06253BB8005AB5DA, + 1865FFFE06253BB8005AB5DA, + 1865FFFF06253BB8005AB5DA, + 1865000006253BB8005AB5DA, + 1865000106253BB8005AB5DA, + 1865000206253BB8005AB5DA, + 1865000306253BB8005AB5DA, + ); + isa = PBXGroup; + path = "prop-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFFC06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.def.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFFD06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surface_quake2.vcproj.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFFE06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.cpp.svn-base"; + refType = 4; + sourceTree = ""; + }; + 1865FFFF06253BB8005AB5DA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = "surfacedialog.h.svn-base"; + refType = 4; + sourceTree = ""; + }; + }; + rootObject = 1865EBCC06253B29005AB5DA; +} diff --git a/radiant/GtkRadiant.vcproj b/radiant/GtkRadiant.vcproj deleted file mode 100644 index 366a4187..00000000 --- a/radiant/GtkRadiant.vcproj +++ /dev/null @@ -1,961 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/radiant/Makefile.mac b/radiant/Makefile.mac new file mode 100644 index 00000000..27260a84 --- /dev/null +++ b/radiant/Makefile.mac @@ -0,0 +1,91 @@ +## Makefile for GtkRadiant + +ifeq ($(DEBUG),1) +DEBUG=true +else +DEBUG=false +endif + +CC=gcc +CPPFLAGS=-I../libs -I../include `gtk-config --cflags` `xml-config --cflags` -I/usr/X11R6/include -Wall -DQUAKE3 +LDFLAGS=`xml-config --libs` +DATE=`date +%m%d` +ZIP=radiant-src.$(DATE).tgz +LIBS=../libs/cmdlib.a ../libs/pak.a ../libs/jpeg6.a ../libs/l_net.a +OUTDIR=$(RADIANT_DATA) + +LDFLAGS += $(subst -rdynamic,,$(shell gtk-config --libs)) -lGL /usr/local/lib/libdl.a + +ifeq ($(DEBUG), false) +CPPFLAGS += -O3 -DNDEBUG +else +CPPFLAGS += -g -D_DEBUG +endif + +CFLAGS=$(CPPFLAGS) + +SRC= glwidget.cpp qgl.c bmp.cpp brush.cpp brush_primit.cpp brushscript.cpp camwindow.cpp \ + csg.cpp dialog.cpp dialoginfo.cpp drag.cpp eclass.cpp entity.cpp file.cpp \ + findtexturedialog.cpp glinterface.cpp glwindow.cpp groupdialog.cpp gtkdlgs.cpp \ + gtkmisc.cpp iepairs.cpp ishaders.cpp lbmlib.cpp \ + main.cpp mainframe.cpp map.cpp mathlib.cpp messaging.cpp missing.cpp parse.cpp \ + patchdialog.cpp plugin.cpp pluginentities.cpp pluginmanager.cpp pmesh.cpp \ + points.cpp preferences.cpp profile.cpp qe3.cpp select.cpp \ + selectedface.cpp shaderinfo.cpp surfacedialog.cpp surfaceplugin.cpp \ + texwindow.cpp undo.cpp vertsel.cpp watchbsp.cpp winding.cpp xywindow.cpp \ + z.cpp zwindow.cpp feedback.cpp gtkfilesel-darwin.c + +# TA_HACK +SRC += vfs.cpp + +OBJS := \ + $(patsubst %.c,%.o,$(filter %.c,$(SRC))) \ + $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC))) + +all: radiant + +help: + @echo 'Use "make DEBUG=0" or "export DEBUG=1; make" for release builds' + +radiant: $(OBJS) $(LIBS) + $(CC) -o radiant $(OBJS) $(LDFLAGS) $(LIBS) + @if [ -d $(OUTDIR) ]; then cp radiant $(OUTDIR); fi + +# Other targets +.PHONY: clean veryclean + +clean: + rm -f *.o *.d radiant core + +veryclean: clean + find libs -name \*.o | xargs rm -f + rm -f libs/*.a + +zip: veryclean + cd .. && tar -zcf $(ZIP) radiant + +## Dependencies + +-include $(OBJS:.o=.d) + +## Libraries + +../libs/cmdlib.a: + cd ../libs/cmdlib && make + +../libs/pak.a: + cd ../libs/pak && make + +../libs/jpeg6.a: + cd ../libs/jpeg6 && make + +../libs/l_net.a: + cd ../libs/l_net && make + +libs: + cd ../libs/cmdlib && $(MAKE) clean && $(MAKE) DEBUG=$(DEBUG) + cd ../libs/pak && $(MAKE) clean && $(MAKE) DEBUG=$(DEBUG) + cd ../libs/l_net && $(MAKE) clean && $(MAKE) DEBUG=$(DEBUG) + +tools: + cd ../q3tools/q3map && $(MAKE) clean && $(MAKE) DEBUG=$(DEBUG) diff --git a/radiant/autosave.cpp b/radiant/autosave.cpp deleted file mode 100644 index febe95af..00000000 --- a/radiant/autosave.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "autosave.h" - -#include "os/file.h" -#include "os/path.h" -#include "cmdlib.h" -#include "stream/stringstream.h" -#include "gtkutil/messagebox.h" -#include "scenelib.h" -#include "mapfile.h" - -#include "map.h" -#include "mainframe.h" -#include "qe3.h" -#include "preferences.h" - - -#if defined(WIN32) -#define PATH_MAX 260 -#endif - - -bool DoesFileExist(const char* name, std::size_t& size) -{ - if(file_exists(name)) - { - size += file_size(name); - return true; - } - return false; -} - -void Map_Snapshot() -{ - // we need to do the following - // 1. make sure the snapshot directory exists (create it if it doesn't) - // 2. find out what the lastest save is based on number - // 3. inc that and save the map - const char* path = Map_Name(g_map); - const char* name = path_get_filename_start(path); - - StringOutputStream snapshotsDir(256); - snapshotsDir << StringRange(path, name) << "snapshots"; - - if(file_exists(snapshotsDir.c_str()) || Q_mkdir(snapshotsDir.c_str())) - { - std::size_t lSize = 0; - StringOutputStream strNewPath(256); - strNewPath << snapshotsDir.c_str() << '/' << name; - - StringOutputStream snapshotFilename(256); - - for(int nCount = 0; ; ++nCount) - { - // The original map's filename is "/." - // The snapshot's filename will be "/snapshots/.." - const char* end = path_get_filename_base_end(strNewPath.c_str()); - snapshotFilename << StringRange(strNewPath.c_str(), end) << '.' << nCount << end; - - if(!DoesFileExist(snapshotFilename.c_str(), lSize)) - { - break; - } - - snapshotFilename.clear(); - } - - // save in the next available slot - Map_SaveFile(snapshotFilename.c_str()); - - if (lSize > 50 * 1024 * 1024) // total size of saves > 50 mb - { - globalOutputStream() << "The snapshot files in " << snapshotsDir.c_str() << " total more than 50 megabytes. You might consider cleaning up."; - } - } - else - { - StringOutputStream strMsg(256); - strMsg << "Snapshot save failed.. unabled to create directory\n" << snapshotsDir.c_str(); - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), strMsg.c_str()); - } -} -/* -=============== -QE_CheckAutoSave - -If five minutes have passed since making a change -and the map hasn't been saved, save it out. -=============== -*/ - -bool g_AutoSave_Enabled = true; -int m_AutoSave_Frequency = 5; -bool g_SnapShots_Enabled = false; - -namespace -{ - time_t s_start = 0; - std::size_t s_changes = 0; -} - -void AutoSave_clear() -{ - s_changes = 0; -} - -scene::Node& Map_Node() -{ - return GlobalSceneGraph().root(); -} - -void QE_CheckAutoSave( void ) -{ - if(!Map_Valid(g_map) || !ScreenUpdates_Enabled()) - { - return; - } - - time_t now; - time(&now); - - if(s_start == 0 || s_changes == Node_getMapFile(Map_Node())->changes()) - { - s_start = now; - } - - if((now - s_start) > (60 * m_AutoSave_Frequency)) - { - s_start = now; - s_changes = Node_getMapFile(Map_Node())->changes(); - - if (g_AutoSave_Enabled) - { - const char* strMsg = g_SnapShots_Enabled ? "Autosaving snapshot..." : "Autosaving..."; - globalOutputStream() << strMsg << "\n"; - //Sys_Status(strMsg); - - // only snapshot if not working on a default map - if (g_SnapShots_Enabled && !Map_Unnamed(g_map)) - { - Map_Snapshot(); - } - else - { - if(Map_Unnamed(g_map)) - { - StringOutputStream autosave(256); - autosave << g_qeglobals.m_userGamePath.c_str() << "maps/"; - Q_mkdir(autosave.c_str()); - autosave << "autosave.map"; - Map_SaveFile(autosave.c_str()); - } - else - { - const char* name = Map_Name(g_map); - const char* extension = path_get_filename_base_end(name); - StringOutputStream autosave(256); - autosave << StringRange(name, extension) << ".autosave" << extension; - Map_SaveFile(autosave.c_str()); - } - } - } - else - { - globalOutputStream() << "Autosave skipped...\n"; - //Sys_Status ("Autosave skipped..."); - } - } -} - -void Autosave_constructPreferences(PreferencesPage& page) -{ - GtkWidget* autosave_enabled = page.appendCheckBox("Autosave", "Enable Autosave", g_AutoSave_Enabled); - GtkWidget* autosave_frequency = page.appendSpinner("Autosave Frequency (minutes)", m_AutoSave_Frequency, 1, 1, 60); - Widget_connectToggleDependency(autosave_frequency, autosave_enabled); - page.appendCheckBox("", "Save Snapshots", g_SnapShots_Enabled); -} -void Autosave_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Autosave", "Autosave Preferences")); - Autosave_constructPreferences(page); -} -void Autosave_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - - -#include "preferencesystem.h" -#include "stringio.h" - -void Autosave_Construct() -{ - GlobalPreferenceSystem().registerPreference("Autosave", BoolImportStringCaller(g_AutoSave_Enabled), BoolExportStringCaller(g_AutoSave_Enabled)); - GlobalPreferenceSystem().registerPreference("AutosaveMinutes", IntImportStringCaller(m_AutoSave_Frequency), IntExportStringCaller(m_AutoSave_Frequency)); - GlobalPreferenceSystem().registerPreference("Snapshots", BoolImportStringCaller(g_SnapShots_Enabled), BoolExportStringCaller(g_SnapShots_Enabled)); - - Autosave_registerPreferencesPage(); -} - -void Autosave_Destroy() -{ -} - diff --git a/radiant/bp_dlg.cpp b/radiant/bp_dlg.cpp new file mode 100644 index 00000000..ac71d3de --- /dev/null +++ b/radiant/bp_dlg.cpp @@ -0,0 +1,155 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION +// +// custom Gtk dialog for brush primitives load/save + +#include "stdafx.h" + +void BP_dialog_button_callback (GtkWidget *widget, gpointer data) +{ + GtkWidget *parent; + int *loop, *ret; + + parent = gtk_widget_get_toplevel (widget); + loop = (int*)g_object_get_data (G_OBJECT (parent), "loop"); + ret = (int*)g_object_get_data (G_OBJECT (parent), "ret"); + + *loop = 0; + *ret = (int)data; +} + +gint BP_dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + int *loop; + + gtk_widget_hide (widget); + loop = (int*)g_object_get_data (G_OBJECT (widget), "loop"); + *loop = 0; + + return TRUE; +} + +// ret: 0 = abort, 1 = load and convert, 2 = changed project settings, load and don't convert +// the user might decide to switch the BP mode in project settings +// status: 0 = loading regular, got conflict 1 = loading BP, got conflict +// int WINAPI gtk_MessageBox (GtkWidget *parent, const char* lpText, const char* lpCaption, guint32 uType) +int BP_MessageBox (int status) +{ + GtkWidget *window, *w, *vbox, *hbox; + GtkAccelGroup *accel; + int ret, loop = 1; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_signal_connect (GTK_OBJECT (window), "delete_event", + GTK_SIGNAL_FUNC (BP_dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + + gtk_window_set_title (GTK_WINDOW (window), "Current map format is incompatible"); + + gtk_container_border_width (GTK_CONTAINER (window), 10); + g_object_set_data (G_OBJECT (window), "loop", &loop); + g_object_set_data (G_OBJECT (window), "ret", &ret); + gtk_widget_realize (window); + + gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (g_pParentWnd->m_pWidget)); + + accel = gtk_accel_group_new (); + gtk_window_add_accel_group (GTK_WINDOW (window), accel); + + vbox = gtk_vbox_new (FALSE, 10); + gtk_container_add (GTK_CONTAINER (window), vbox); + gtk_widget_show (vbox); + + if (status == 0) + { + w = gtk_label_new ("This map was saved using brush primitives format\n" + "and your project settings use the standard format.\n" + "Do you want to convert the map, change default format or abort?\n" + "NOTE: due to limitations of the standard format, " + "some texture alignments may be lost after conversion."); + } + else + { + w = gtk_label_new ("This map was saved using standard format\n" + "and your project settings use the new \"brush primitives\" format.\n" + "Do you want to convert the map, change default format or abort?\n" + "NOTE: Next versions of Radiant will allow mixing the two formats" + "in the same maps for a smooth transition."); + } + gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); + gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT); + gtk_widget_show (w); + + w = gtk_hseparator_new (); + gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); + gtk_widget_show (w); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); + gtk_widget_show (hbox); + + w = gtk_button_new_with_label ("Convert"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (BP_dialog_button_callback), GINT_TO_POINTER (1)); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("Change default"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (BP_dialog_button_callback), GINT_TO_POINTER (2)); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("Abort load"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (BP_dialog_button_callback), GINT_TO_POINTER (0)); + gtk_widget_show (w); + ret = 0; // abort + + gtk_widget_show (window); + gtk_grab_add (window); + + while (loop) + gtk_main_iteration (); + + if (ret == 2) + { + // change project settings + if (status == 0) + g_qeglobals.m_bBrushPrimitMode = TRUE; + else + g_qeglobals.m_bBrushPrimitMode = FALSE; + SetKeyValue(g_qeglobals.d_project_entity, "brush_primit", (g_qeglobals.m_bBrushPrimitMode ? "1" : "0" )); + } + + gtk_grab_remove (window); + gtk_widget_destroy (window); + + return ret; +} diff --git a/radiant/brush.cpp b/radiant/brush.cpp index d2f217b3..2e578035 100644 --- a/radiant/brush.cpp +++ b/radiant/brush.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,399 +19,3639 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "brush.h" -#include "signal/signal.h" +#include "stdafx.h" +#include +#include "winding.h" +#include +#include "filters.h" -Signal0 g_brushTextureChangedCallbacks; +extern MainFrame* g_pParentWnd; +extern void MemFile_fprintf(MemStream* pMemFile, const char* pText, ...); -void Brush_addTextureChangedCallback(const SignalHandler& handler) +// globals + +int g_nBrushId = 0; + +#ifdef ENABLE_GROUPS +const char* Brush_Name(brush_t *b) { - g_brushTextureChangedCallbacks.connectLast(handler); + static char cBuff[1024]; + b->numberId = g_nBrushId++; + if (g_qeglobals.m_bBrushPrimitMode) + { + sprintf(cBuff, "Brush %i", b->numberId); + Brush_SetEpair(b, "Name", cBuff); + } + return cBuff; +} +#endif + +brush_t *Brush_Alloc() +{ + brush_t *b = (brush_t*)qmalloc(sizeof(brush_t)); + return b; +} +/* +void Brush_Free(brush_t *b) +{ + free(b); +} +*/ +void PrintWinding (winding_t *w) +{ + int i; + + Sys_Printf ("-------------\n"); + for (i=0 ; inumpoints ; i++) + Sys_Printf ("(%5.2f, %5.2f, %5.2f)\n", w->points[i][0] + , w->points[i][1], w->points[i][2]); } -void Brush_textureChanged() +void PrintPlane (plane_t *p) { - g_brushTextureChangedCallbacks(); + Sys_Printf ("(%5.2f, %5.2f, %5.2f) : %5.2f\n", p->normal[0], p->normal[1], + p->normal[2], p->dist); } -QuantiseFunc Face::m_quantise; -EBrushType Face::m_type; -EBrushType FacePlane::m_type; -bool g_brush_texturelock_enabled = false; - -EBrushType Brush::m_type; -double Brush::m_maxWorldCoord = 0; -Shader* Brush::m_state_point; -Shader* BrushClipPlane::m_state = 0; -Shader* BrushInstance::m_state_selpoint; -Counter* BrushInstance::m_counter = 0; - -FaceInstanceSet g_SelectedFaceInstances; - - -struct SListNode +void PrintVector (vec3_t v) { - SListNode* m_next; + Sys_Printf ("(%5.2f, %5.2f, %5.2f)\n", v[0], v[1], v[2]); +} + + +/* +============================================================================= + + TEXTURE COORDINATES + +============================================================================= +*/ + + +/* +================== +textureAxisFromPlane +================== +*/ +vec3_t baseaxis[18] = +{ +{0,0,1}, {1,0,0}, {0,-1,0}, // floor +{0,0,-1}, {1,0,0}, {0,-1,0}, // ceiling +{1,0,0}, {0,1,0}, {0,0,-1}, // west wall +{-1,0,0}, {0,1,0}, {0,0,-1}, // east wall +{0,1,0}, {1,0,0}, {0,0,-1}, // south wall +{0,-1,0}, {1,0,0}, {0,0,-1} // north wall }; -class ProximalVertex +void TextureAxisFromPlane(plane_t *pln, vec3_t xv, vec3_t yv) { -public: - const SListNode* m_vertices; - - ProximalVertex(const SListNode* next) - : m_vertices(next) - { - } - - bool operator<(const ProximalVertex& other) const - { - if(!(operator==(other))) - { - return m_vertices < other.m_vertices; - } - return false; - } - bool operator==(const ProximalVertex& other) const - { - const SListNode* v = m_vertices; - std::size_t DEBUG_LOOP = 0; - do - { - if(v == other.m_vertices) - return true; - v = v->m_next; - //ASSERT_MESSAGE(DEBUG_LOOP < c_brush_maxFaces, "infinite loop"); - if(!(DEBUG_LOOP < c_brush_maxFaces)) - { - break; - } - ++DEBUG_LOOP; - } - while(v != m_vertices); - return false; - } -}; - -typedef Array ProximalVertexArray; -std::size_t ProximalVertexArray_index(const ProximalVertexArray& array, const ProximalVertex& vertex) -{ - return vertex.m_vertices - array.data(); + int bestaxis; + float dot,best; + int i; + + best = 0; + bestaxis = 0; + + for (i=0 ; i<6 ; i++) + { + dot = DotProduct (pln->normal, baseaxis[i*3]); + if (g_PrefsDlg.m_bQ3Map2Texturing && dot > best + 0.0001f || dot > best) + { + best = dot; + bestaxis = i; + } + } + + VectorCopy (baseaxis[bestaxis*3+1], xv); + VectorCopy (baseaxis[bestaxis*3+2], yv); } -inline bool Brush_isBounded(const Brush& brush) +float lightaxis[3] = {0.6f, 0.8f, 1.0f}; +/* +================ +SetShadeForPlane + +Light different planes differently to +improve recognition +================ +*/ +extern float ShadeForNormal(vec3_t normal); + +float SetShadeForPlane (plane_t *p) { - for(Brush::const_iterator i = brush.begin(); i != brush.end(); ++i) - { - if(!(*i)->is_bounded()) - { - return false; - } - } - return true; + //return ShadeForNormal(p->normal); + + + int i; + float f; + + // axial plane + for (i=0 ; i<3 ; i++) + if (fabs(p->normal[i]) > 0.9) + { + f = lightaxis[i]; + return f; + } + + // between two axial planes + for (i=0 ; i<3 ; i++) + if (fabs(p->normal[i]) < 0.1) + { + f = (lightaxis[(i+1)%3] + lightaxis[(i+2)%3])/2; + return f; + } + + // other + f= (lightaxis[0] + lightaxis[1] + lightaxis[2]) / 3; + return f; + } -void Brush::buildBRep() -{ - bool degenerate = buildWindings(); +vec3_t vecs[2]; +float shift[2]; - std::size_t faces_size = 0; - std::size_t faceVerticesCount = 0; - for(Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i) +/* +================ +Face_Alloc +================ +*/ +face_t *Face_Alloc( void ) +{ + face_t *f = (face_t*)qmalloc( sizeof( *f ) ); + return f; +} + +/* +================ +Face_Free +================ +*/ +void Face_Free( face_t *f ) +{ + assert( f != 0 ); + + if ( f->face_winding ) + { + free( f->face_winding ); + f->face_winding = 0; + } + f->texdef.~texdef_t();; + + free( f ); +} + +/* +================ +Face_Clone +================ +*/ +face_t *Face_Clone (face_t *f) +{ + face_t *n; + + n = Face_Alloc(); + n->texdef = f->texdef; + n->brushprimit_texdef = f->brushprimit_texdef; + + memcpy (n->planepts, f->planepts, sizeof(n->planepts)); + + // all other fields are derived, and will be set by Brush_Build + // FIXME: maybe not, for example n->pData! + return n; +} + +/* +================ +Face_FullClone + +makes an exact copy of the face +================ +*/ +face_t *Face_FullClone (face_t *f) +{ + face_t *n; + + n = Face_Alloc(); + n->texdef = f->texdef; + n->brushprimit_texdef = f->brushprimit_texdef; + memcpy(n->planepts, f->planepts, sizeof(n->planepts)); + memcpy(&n->plane, &f->plane, sizeof(plane_t)); + if (f->face_winding) + n->face_winding = Winding_Clone(f->face_winding); + else + n->face_winding = NULL; + n->pShader = f->pShader; + n->pShader->IncRef(); + n->d_texture = n->pShader->getTexture(); + return n; +} + +void Face_SetShader(face_t *face, const char *name) +{ + if(face->pShader != NULL) + face->pShader->DecRef(); + face->texdef.SetName(name); + face->pShader = QERApp_Shader_ForName(name); + face->pShader->IncRef(); + face->d_texture = face->pShader->getTexture(); + face->texdef.flags = face->pShader->getFlags(); +} + +void Face_SetShader(face_t *face, IShader *shader) +{ + if(face->pShader != NULL) + face->pShader->DecRef(); + face->texdef.SetName(shader->getName()); + face->d_texture = shader->getTexture(); + face->texdef.flags = shader->getFlags(); + face->pShader = shader; + face->pShader->IncRef(); +} + +/* +================ +Clamp +================ +*/ +void Clamp(float& f, int nClamp) +{ + float fFrac = f - static_cast(f); + f = static_cast(f) % nClamp; + f += fFrac; +} + +/* +================ +Face_MoveTexture +================ +*/ +void Face_MoveTexture(face_t *f, vec3_t delta) +{ + vec3_t vX, vY; + + if (g_qeglobals.m_bBrushPrimitMode) + ShiftTextureGeometric_BrushPrimit( f, delta ); + else + { + TextureAxisFromPlane(&f->plane, vX, vY); + + vec3_t vDP, vShift; + vDP[0] = DotProduct(delta, vX); + vDP[1] = DotProduct(delta, vY); + + double fAngle = f->texdef.rotate / 180 * Q_PI; + double c = cos(fAngle); + double s = sin(fAngle); + + vShift[0] = vDP[0] * c - vDP[1] * s; + vShift[1] = vDP[0] * s + vDP[1] * c; + + if (!f->texdef.scale[0]) + f->texdef.scale[0] = g_pGameDescription->mTextureDefaultScale; + if (!f->texdef.scale[1]) + f->texdef.scale[1] = g_pGameDescription->mTextureDefaultScale; + + f->texdef.shift[0] -= vShift[0] / f->texdef.scale[0]; + f->texdef.shift[1] -= vShift[1] / f->texdef.scale[1]; + + // clamp the shifts + Clamp(f->texdef.shift[0], f->d_texture->width); + Clamp(f->texdef.shift[1], f->d_texture->height); + } +} + +/* +================ +Face_SetColor +================ +*/ +/*!\todo Replace all face_t::d_texture access with face_t::pShader::GetTexture.*/ +void Face_SetColor (brush_t *b, face_t *f, float fCurveColor) +{ + // set shading for face + f->d_shade = SetShadeForPlane (&f->plane); + f->d_color[0] = f->pShader->getTexture()->color[0] * f->d_shade; + f->d_color[1] = f->pShader->getTexture()->color[1] * f->d_shade; + f->d_color[2] = f->pShader->getTexture()->color[2] * f->d_shade; +} + +/* +================ +Face_TextureVectors +================ +*/ +void Face_TextureVectors (face_t *f, float STfromXYZ[2][4]) +{ + vec3_t pvecs[2]; + int sv, tv; + float ang, sinv, cosv; + float ns, nt; + int i,j; + qtexture_t *q; + texdef_t *td; + +#ifdef _DEBUG + // this code is not supposed to be used while in BP mode, warning here can help spot the problem + if (g_qeglobals.m_bBrushPrimitMode && !g_qeglobals.bNeedConvert) + Sys_Printf("Warning : illegal call of Face_TextureVectors in brush primitive mode\n"); +#endif + + td = &f->texdef; + q = f->d_texture; + + memset (STfromXYZ, 0, 8*sizeof(float)); + + if (!td->scale[0]) + td->scale[0] = g_pGameDescription->mTextureDefaultScale; + if (!td->scale[1]) + td->scale[1] = g_pGameDescription->mTextureDefaultScale; + + // get natural texture axis + TextureAxisFromPlane(&f->plane, pvecs[0], pvecs[1]); + + // rotate axis + if (td->rotate == 0) + { sinv = 0 ; cosv = 1; } + else if (td->rotate == 90) + { sinv = 1 ; cosv = 0; } + else if (td->rotate == 180) + { sinv = 0 ; cosv = -1; } + else if (td->rotate == 270) + { sinv = -1 ; cosv = 0; } + else + { + ang = td->rotate / 180 * Q_PI; + sinv = sin(ang); + cosv = cos(ang); + } + + if (pvecs[0][0]) + sv = 0; + else if (pvecs[0][1]) + sv = 1; + else + sv = 2; + + if (pvecs[1][0]) + tv = 0; + else if (pvecs[1][1]) + tv = 1; + else + tv = 2; + + for (i=0 ; i<2 ; i++) { + ns = cosv * pvecs[i][sv] - sinv * pvecs[i][tv]; + nt = sinv * pvecs[i][sv] + cosv * pvecs[i][tv]; + STfromXYZ[i][sv] = ns; + STfromXYZ[i][tv] = nt; + } + + // scale + for (i=0 ; i<2 ; i++) + for (j=0 ; j<3 ; j++) + STfromXYZ[i][j] = STfromXYZ[i][j] / td->scale[i]; + + // shift + STfromXYZ[0][3] = td->shift[0]; + STfromXYZ[1][3] = td->shift[1]; + + for (j=0 ; j<4 ; j++) { + STfromXYZ[0][j] /= q->width; + STfromXYZ[1][j] /= q->height; + } +} + +/* +================ +Face_MakePlane +================ +*/ +void Face_MakePlane (face_t *f) +{ + int j; + vec3_t t1, t2, t3; + + // convert to a vector / dist plane + for (j=0 ; j<3 ; j++) + { + t1[j] = f->planepts[0][j] - f->planepts[1][j]; + t2[j] = f->planepts[2][j] - f->planepts[1][j]; + t3[j] = f->planepts[1][j]; + } + + CrossProduct(t1,t2, f->plane.normal); + if (VectorCompare (f->plane.normal, vec3_origin)) + Sys_FPrintf (SYS_WRN, "WARNING: brush plane with no normal\n"); + VectorNormalize (f->plane.normal, f->plane.normal); + f->plane.dist = DotProduct (t3, f->plane.normal); +} + +/* +================ +EmitTextureCoordinates +================ +*/ +void EmitTextureCoordinates ( float *xyzst, qtexture_t *q, face_t *f) +{ + float STfromXYZ[2][4]; + + Face_TextureVectors (f, STfromXYZ); + xyzst[3] = DotProduct (xyzst, STfromXYZ[0]) + STfromXYZ[0][3]; + xyzst[4] = DotProduct (xyzst, STfromXYZ[1]) + STfromXYZ[1][3]; +} + +//========================================================================== + +/* +================ +Brush_MakeFacePlanes +================ +*/ +void Brush_MakeFacePlanes (brush_t *b) +{ + face_t *f; + + for (f=b->brush_faces ; f ; f=f->next) + { + Face_MakePlane (f); + } +} + +/* +================ +DrawBrushEntityName +================ +*/ +void DrawBrushEntityName (brush_t *b) +{ + const char *name; + float a, s, c; + vec3_t mid; + int i; + + if (!b->owner) + return; // during contruction + + if (b->owner == world_entity) + return; + + if (b != b->owner->brushes.onext) + return; // not key brush + + // TTimo: Brush_DrawFacingAngle is for camera view rendering, this function is called for 2D views + // FIXME - spog - not sure who put this here.. Brush_DrawFacingAngle() does this job? + // Brush_DrawFacingAngle() works when called, but is not being called. + if (g_qeglobals.d_savedinfo.show_angles && (b->owner->eclass->nShowFlags & ECLASS_ANGLE)) { - if((*i)->contributes()) - { - ++faces_size; - } - faceVerticesCount += (*i)->getWinding().numpoints; + // draw the angle pointer + a = FloatForKey (b->owner, "angle"); + s = sin (a/180*Q_PI); + c = cos (a/180*Q_PI); + for (i=0 ; i<3 ; i++) + mid[i] = (b->mins[i] + b->maxs[i])*0.5; + + qglBegin (GL_LINE_STRIP); + qglVertex3fv (mid); + mid[0] += c*8; + mid[1] += s*8; + mid[2] += s*8; + qglVertex3fv (mid); + mid[0] -= c*4; + mid[1] -= s*4; + mid[2] -= s*4; + mid[0] -= s*4; + mid[1] += c*4; + mid[2] += c*4; + qglVertex3fv (mid); + mid[0] += c*4; + mid[1] += s*4; + mid[2] += s*4; + mid[0] += s*4; + mid[1] -= c*4; + mid[2] -= c*4; + qglVertex3fv (mid); + mid[0] -= c*4; + mid[1] -= s*4; + mid[2] -= s*4; + mid[0] += s*4; + mid[1] -= c*4; + mid[2] -= c*4; + qglVertex3fv (mid); + qglEnd (); } - if(degenerate || faces_size < 4 || faceVerticesCount != (faceVerticesCount>>1)<<1) // sum of vertices for each face of a valid polyhedron is always even + if (g_qeglobals.d_savedinfo.show_names) { - m_uniqueVertexPoints.resize(0); + name = ValueForKey (b->owner, "classname"); + qglRasterPos3f (b->mins[0]+4, b->mins[1]+4, b->mins[2]+4); + gtk_glwidget_print_string(name); + } +} - vertex_clear(); - edge_clear(); +/* +================= +Brush_MakeFaceWinding - m_edge_indices.resize(0); - m_edge_faces.resize(0); +returns the visible polygon on a face +================= +*/ +winding_t *Brush_MakeFaceWinding (brush_t *b, face_t *face) +{ + winding_t *w; + face_t *clip; + plane_t plane; + qboolean past; - m_faceCentroidPoints.resize(0); - m_uniqueEdgePoints.resize(0); - m_uniqueVertexPoints.resize(0); + // get a poly that covers an effectively infinite area + w = Winding_BaseForPlane (&face->plane); - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->getWinding().resize(0); - } + // chop the poly by all of the other faces + past = false; + for (clip = b->brush_faces ; clip && w ; clip=clip->next) + { + if (clip == face) + { + past = true; + continue; + } + if (DotProduct (face->plane.normal, clip->plane.normal) > 0.999 + && fabs(face->plane.dist - clip->plane.dist) < 0.01 ) + { // identical plane, use the later one + if (past) + { + free (w); + return NULL; + } + continue; + } + + // flip the plane, because we want to keep the back side + VectorSubtract (vec3_origin,clip->plane.normal, plane.normal); + plane.dist = -clip->plane.dist; + + w = Winding_Clip (w, &plane, false); + if (!w) + return w; + } + + if (w->numpoints < 3) + { + free(w); + w = NULL; + } + + if (!w) + Sys_FPrintf (SYS_WRN, "unused plane\n"); + + return w; +} + +/* +================= +Brush_SnapPlanepts +================= +*/ +void Brush_SnapPlanepts (brush_t *b) +{ + int i, j; + face_t *f; + + if (g_PrefsDlg.m_bNoClamp) + return; + + if (g_qeglobals.d_bSmallGrid) + { + for (f=b->brush_faces ; f; f=f->next) + for (i=0 ; i<3 ; i++) + for (j=0 ; j<3 ; j++) + f->planepts[i][j] = floor (f->planepts[i][j]/g_qeglobals.d_gridsize + 0.5)*g_qeglobals.d_gridsize; } else { - { - typedef std::vector FaceVertices; - FaceVertices faceVertices; - faceVertices.reserve(faceVerticesCount); + for (f=b->brush_faces ; f; f=f->next) + for (i=0 ; i<3 ; i++) + for (j=0 ; j<3 ; j++) + f->planepts[i][j] = floor (f->planepts[i][j] + 0.5); + } +} + +/* +** Brush_Build +** +** Builds a brush rendering data and also sets the min/max bounds +*/ +// TTimo +// added a bConvert flag to convert between old and new brush texture formats +// TTimo +// brush grouping: update the group treeview if necessary +void Brush_Build( brush_t *b, bool bSnap, bool bMarkMap, bool bConvert, bool bFilterTest) +{ + bool bLocalConvert; - { - for(std::size_t i = 0; i != m_faces.size(); ++i) - { - for(std::size_t j = 0; j < m_faces[i]->getWinding().numpoints; ++j) - { - faceVertices.push_back(FaceVertexId(i, j)); - } - } - } - - IndexBuffer uniqueEdgeIndices; - typedef VertexBuffer UniqueEdges; - UniqueEdges uniqueEdges; - - uniqueEdgeIndices.reserve(faceVertices.size()); - uniqueEdges.reserve(faceVertices.size()); - - { - ProximalVertexArray edgePairs; - edgePairs.resize(faceVertices.size()); - - { - for(std::size_t i=0; i inserter(uniqueEdges); - for(ProximalVertexArray::iterator i = edgePairs.begin(); i != edgePairs.end(); ++i) - { - uniqueEdgeIndices.insert(inserter.insert(ProximalVertex(&(*i)))); - } - } - - { - edge_clear(); - m_select_edges.reserve(uniqueEdges.size()); - for(UniqueEdges::iterator i = uniqueEdges.begin(); i != uniqueEdges.end(); ++i) - { - edge_push_back(faceVertices[ProximalVertexArray_index(edgePairs, *i)]); - } - } - - { - m_edge_faces.resize(uniqueEdges.size()); - for(std::size_t i=0; igetWinding()[faceVertex.getVertex()].adjacent); - } - } - - { - m_uniqueEdgePoints.resize(uniqueEdges.size()); - for(std::size_t i=0; igetWinding(); - Vector3 edge = vector3_mid(w[faceVertex.getVertex()].vertex, w[Winding_next(w, faceVertex.getVertex())].vertex); - m_uniqueEdgePoints[i] = pointvertex_for_windingpoint(edge, colour_vertex); - } - } - - } - - - IndexBuffer uniqueVertexIndices; - typedef VertexBuffer UniqueVertices; - UniqueVertices uniqueVertices; - - uniqueVertexIndices.reserve(faceVertices.size()); - uniqueVertices.reserve(faceVertices.size()); - - { - ProximalVertexArray vertexRings; - vertexRings.resize(faceVertices.size()); - - { - for(std::size_t i=0; i inserter(uniqueVertices); - for(ProximalVertexArray::iterator i = vertexRings.begin(); i != vertexRings.end(); ++i) - { - uniqueVertexIndices.insert(inserter.insert(ProximalVertex(&(*i)))); - } - } - - { - vertex_clear(); - m_select_vertices.reserve(uniqueVertices.size()); - for(UniqueVertices::iterator i = uniqueVertices.begin(); i != uniqueVertices.end(); ++i) - { - vertex_push_back(faceVertices[ProximalVertexArray_index(vertexRings, (*i))]); - } - } - - { - m_uniqueVertexPoints.resize(uniqueVertices.size()); - for(std::size_t i=0; igetWinding(); - m_uniqueVertexPoints[i] = pointvertex_for_windingpoint(winding[faceVertex.getVertex()].vertex, colour_vertex); - } - } - } - - if((uniqueVertices.size() + faces_size) - uniqueEdges.size() != 2) - { - globalErrorStream() << "Final B-Rep: inconsistent vertex count\n"; - } - -#if BRUSH_CONNECTIVITY_DEBUG - if((uniqueVertices.size() + faces_size) - uniqueEdges.size() != 2) - { - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - std::size_t faceIndex = std::distance(m_faces.begin(), i); - - if(!(*i)->contributes()) - { - globalOutputStream() << "face: " << Unsigned(faceIndex) << " does not contribute\n"; - } - - Winding_printConnectivity((*i)->getWinding()); - } - } + +#ifdef _DEBUG + if (!g_qeglobals.m_bBrushPrimitMode && bConvert) + Sys_Printf("Warning : conversion from brush primitive to old brush format not implemented\n"); #endif - // edge-index list for wireframe rendering + // if bConvert is set and g_qeglobals.bNeedConvert is not, that just means we need convert for this brush only + if (bConvert && !g_qeglobals.bNeedConvert) + { +#ifdef _DEBUG + //++timo FIXME: it's not very clear when this can happen, I guess while dealing with plugins that send brushes + // back and forth in one format or the other .. more when mixing BP / noBP in the same maps. +#endif + bLocalConvert = true; + g_qeglobals.bNeedConvert = true; + } + else + bLocalConvert = false; + + /* + ** build the windings and generate the bounding box + */ + Brush_BuildWindings(b, bSnap); + + if(b->owner->model.pRender) + { + const aabb_t *aabb = b->owner->model.pRender->GetAABB(); + VectorAdd(aabb->origin, aabb->extents, b->maxs); + VectorSubtract(aabb->origin, aabb->extents, b->mins); + } + + //Patch_BuildPoints (b); // does nothing but set b->patchBrush true if the texdef contains SURF_PATCH ! + + /* + ** move the points and edges if in select mode + */ + if (g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_edge) + SetupVertexSelection (); + + if (b->itemOwner == 0) //NULL) + Group_AddToProperGroup(b); + + if (bMarkMap) + { + Sys_MarkMapModified(); + } + + if (bLocalConvert) + g_qeglobals.bNeedConvert = false; + + // spog - applying filters to brush during brush_build instead of during redraw + if (bFilterTest) + b->bFiltered = FilterBrush( b ); +} + +/* +============== +Brush_SplitBrushByFace + +The incoming brush is NOT freed. +The incoming face is NOT left referenced. +============== +*/ +void Brush_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back, boolean bCaulk) +{ + brush_t *b; + face_t *nf; + vec3_t temp; + + b = Brush_Clone (in); + nf = Face_Clone (f); + + nf->texdef = b->brush_faces->texdef; + if (bCaulk) + { + nf->texdef.SetName(g_pGameDescription->mCaulkShader.GetBuffer()); + } + nf->next = b->brush_faces; + b->brush_faces = nf; + + Brush_Build( b ); + Brush_RemoveEmptyFaces ( b ); + if ( !b->brush_faces ) + { // completely clipped away + Brush_Free (b); + *back = NULL; + } + else + { + Entity_LinkBrush (in->owner, b); + *back = b; + } + + b = Brush_Clone (in); + nf = Face_Clone (f); + // swap the plane winding + VectorCopy (nf->planepts[0], temp); + VectorCopy (nf->planepts[1], nf->planepts[0]); + VectorCopy (temp, nf->planepts[1]); + + nf->texdef = b->brush_faces->texdef; + if (bCaulk) + { + nf->texdef.SetName(g_pGameDescription->mCaulkShader.GetBuffer()); + } + nf->next = b->brush_faces; + b->brush_faces = nf; + + Brush_Build( b ); + Brush_RemoveEmptyFaces ( b ); + if ( !b->brush_faces ) + { // completely clipped away + Brush_Free (b); + *front = NULL; + } + else + { + Entity_LinkBrush (in->owner, b); + *front = b; + } +} + +/* +================= +Brush_BestSplitFace + +returns the best face to split the brush with. +return NULL if the brush is convex +================= +*/ +face_t *Brush_BestSplitFace(brush_t *b) +{ + face_t *face, *f, *bestface; + winding_t *front, *back; + int splits, tinywindings, value, bestvalue; + + bestvalue = 999999; + bestface = NULL; + for (face = b->brush_faces; face; face = face->next) + { + splits = 0; + tinywindings = 0; + for (f = b->brush_faces; f; f = f->next) + { + if (f == face) continue; + // + Winding_SplitEpsilon(f->face_winding, face->plane.normal, face->plane.dist, 0.1f, &front, &back); + + if (!front) + { + Winding_Free(back); + } + else if (!back) + { + Winding_Free(front); + } + else + { + splits++; + if (Winding_IsTiny(front)) tinywindings++; + if (Winding_IsTiny(back)) tinywindings++; + } + } + if (splits) + { + value = splits + 50 * tinywindings; + if (value < bestvalue) + { + bestvalue = value; + bestface = face; + } + } + } + return bestface; +} + +/* +================= +Brush_MakeConvexBrushes + +MrE FIXME: this doesn't work because the old + Brush_SplitBrushByFace is used +Turns the brush into a minimal number of convex brushes. +If the input brush is convex then it will be returned. +Otherwise the input brush will be freed. +NOTE: the input brush should have windings for the faces. +================= +*/ +brush_t *Brush_MakeConvexBrushes(brush_t *b) +{ + brush_t *front, *back, *end; + face_t *face; + + b->next = NULL; + face = Brush_BestSplitFace(b); + if (!face) return b; + Brush_SplitBrushByFace(b, face, &front, &back); + //this should never happen + if (!front && !back) return b; + Brush_Free(b); + if (!front) + return Brush_MakeConvexBrushes(back); + b = Brush_MakeConvexBrushes(front); + if (back) + { + for (end = b; end->next; end = end->next); + end->next = Brush_MakeConvexBrushes(back); + } + return b; +} + +/* +================= +Brush_Convex +================= +*/ +int Brush_Convex(brush_t *b) +{ + face_t *face1, *face2; + + for (face1 = b->brush_faces; face1; face1 = face1->next) + { + if (!face1->face_winding) continue; + for (face2 = b->brush_faces; face2; face2 = face2->next) + { + if (face1 == face2) continue; + if (!face2->face_winding) continue; + if (Winding_PlanesConcave(face1->face_winding, face2->face_winding, + face1->plane.normal, face2->plane.normal, + face1->plane.dist, face2->plane.dist)) + { + return false; + } + } + } + return true; +} + +/* +================= +Brush_MoveVertexes + +- The input brush must be convex +- The input brush must have face windings. +- The output brush will be convex. +- Returns true if the WHOLE vertex movement is performed. +================= +*/ + +// define this to debug the vertex editing mode +#ifdef _DEBUG +//#define DBG_VERT +#endif + +#define MAX_MOVE_FACES 64 + +int Brush_MoveVertex(brush_t *b, vec3_t vertex, vec3_t delta, vec3_t end, bool bSnap) +{ + face_t *f, *face, *newface, *lastface, *nextface; + face_t *movefaces[MAX_MOVE_FACES]; + int movefacepoints[MAX_MOVE_FACES]; + winding_t *w, tmpw; + vec3_t start, mid; + plane_t plane; + int i, j, k, nummovefaces, result, done; + float dot, front, back, frac, smallestfrac; + +#ifdef DBG_VERT + Sys_Printf("Bursh_MoveVertex: %p vertex: %g %g %g delta: %g %g %g end: %g %g %g snap: %s\n", b, vertex[0], vertex[1], vertex[2], delta[0], delta[1], delta[2], end[0], end[1], end[2], bSnap ? "true" : "false" ); +#endif + + result = true; + // + tmpw.numpoints = 3; + tmpw.maxpoints = 3; + VectorCopy(vertex, start); + VectorAdd(vertex, delta, end); + //snap or not? + if (bSnap) + for (i = 0; i < 3; i++) + end[i] = floor(end[i] / g_qeglobals.d_gridsize + 0.1) * g_qeglobals.d_gridsize; + // + VectorCopy(end, mid); + //if the start and end are the same + if (Point_Equal(start, end, 0.3f)) return false; + //the end point may not be the same as another vertex + for (face = b->brush_faces; face; face = face->next) + { + w = face->face_winding; + if (!w) continue; + for (i = 0; i < w->numpoints; i++) + { + if (Point_Equal(w->points[i], end, 0.3f)) + { + VectorCopy(vertex, end); + return false; + } + } + } + // + done = false; + while(!done) + { + //chop off triangles from all brush faces that use the to be moved vertex + //store pointers to these chopped off triangles in movefaces[] + nummovefaces = 0; + for (face = b->brush_faces; face; face = face->next) + { + w = face->face_winding; + if (!w) continue; + for (i = 0; i < w->numpoints; i++) + { + if (Point_Equal(w->points[i], start, 0.2f)) + { + if (face->face_winding->numpoints <= 3) + { + movefacepoints[nummovefaces] = i; + movefaces[nummovefaces++] = face; + break; + } + dot = DotProduct(end, face->plane.normal) - face->plane.dist; + //if the end point is in front of the face plane + if (dot > 0.1) + { + //fanout triangle subdivision + for (k = i; k < i + w->numpoints-3; k++) + { + VectorCopy(w->points[i], tmpw.points[0]); + VectorCopy(w->points[(k+1) % w->numpoints], tmpw.points[1]); + VectorCopy(w->points[(k+2) % w->numpoints], tmpw.points[2]); + // + newface = Face_Clone(face); + //get the original + for (f = face; f->original; f = f->original) ; + newface->original = f; + //store the new winding + if (newface->face_winding) Winding_Free(newface->face_winding); + newface->face_winding = Winding_Clone(&tmpw); + //get the texture information + newface->pShader = face->pShader; + newface->d_texture = face->d_texture; + + //add the face to the brush + newface->next = b->brush_faces; + b->brush_faces = newface; + //add this new triangle to the move faces + movefacepoints[nummovefaces] = 0; + movefaces[nummovefaces++] = newface; + } + //give the original face a new winding + VectorCopy(w->points[(i-2+w->numpoints) % w->numpoints], tmpw.points[0]); + VectorCopy(w->points[(i-1+w->numpoints) % w->numpoints], tmpw.points[1]); + VectorCopy(w->points[i], tmpw.points[2]); + Winding_Free(face->face_winding); + face->face_winding = Winding_Clone(&tmpw); + //add the original face to the move faces + movefacepoints[nummovefaces] = 2; + movefaces[nummovefaces++] = face; + } + else + { + //chop a triangle off the face + VectorCopy(w->points[(i-1+w->numpoints) % w->numpoints], tmpw.points[0]); + VectorCopy(w->points[i], tmpw.points[1]); + VectorCopy(w->points[(i+1) % w->numpoints], tmpw.points[2]); + //remove the point from the face winding + Winding_RemovePoint(w, i); + //get texture crap right + Face_SetColor(b, face, 1.0); + for (j = 0; j < w->numpoints; j++) + EmitTextureCoordinates(w->points[j], face->d_texture, face); + //make a triangle face + newface = Face_Clone(face); + //get the original + for (f = face; f->original; f = f->original) ; + newface->original = f; + //store the new winding + if (newface->face_winding) Winding_Free(newface->face_winding); + newface->face_winding = Winding_Clone(&tmpw); + //get the texture + newface->pShader = face->pShader; + newface->d_texture = newface->pShader->getTexture(); +// newface->d_texture = QERApp_Texture_ForName2( newface->texdef.name ); + //add the face to the brush + newface->next = b->brush_faces; + b->brush_faces = newface; + // + movefacepoints[nummovefaces] = 1; + movefaces[nummovefaces++] = newface; + } + break; + } + } + } + //now movefaces contains pointers to triangle faces that + //contain the to be moved vertex + // + done = true; + VectorCopy(end, mid); + smallestfrac = 1; + for (face = b->brush_faces; face; face = face->next) + { + //check if there is a move face that has this face as the original + for (i = 0; i < nummovefaces; i++) + { + if (movefaces[i]->original == face) break; + } + if (i >= nummovefaces) continue; + //check if the original is not a move face itself + for (j = 0; j < nummovefaces; j++) + { + if (face == movefaces[j]) break; + } + //if the original is not a move face itself + if (j >= nummovefaces) + { + memcpy(&plane, &movefaces[i]->original->plane, sizeof(plane_t)); + } + else + { + k = movefacepoints[j]; + w = movefaces[j]->face_winding; + VectorCopy(w->points[(k+1)%w->numpoints], tmpw.points[0]); + VectorCopy(w->points[(k+2)%w->numpoints], tmpw.points[1]); + // + k = movefacepoints[i]; + w = movefaces[i]->face_winding; + VectorCopy(w->points[(k+1)%w->numpoints], tmpw.points[2]); + if (!Plane_FromPoints(tmpw.points[0], tmpw.points[1], tmpw.points[2], &plane)) + { + VectorCopy(w->points[(k+2)%w->numpoints], tmpw.points[2]); + if (!Plane_FromPoints(tmpw.points[0], tmpw.points[1], tmpw.points[2], &plane)) + //this should never happen otherwise the face merge did a crappy job a previous pass + continue; + } + } + //now we've got the plane to check agains + front = DotProduct(start, plane.normal) - plane.dist; + back = DotProduct(end, plane.normal) - plane.dist; + //if the whole move is at one side of the plane + if (front < 0.01 && back < 0.01) continue; + if (front > -0.01 && back > -0.01) continue; + //if there's no movement orthogonal to this plane at all + if (fabs(front-back) < 0.001) continue; + //ok first only move till the plane is hit + frac = front/(front-back); + if (frac < smallestfrac) + { + mid[0] = start[0] + (end[0] - start[0]) * frac; + mid[1] = start[1] + (end[1] - start[1]) * frac; + mid[2] = start[2] + (end[2] - start[2]) * frac; + smallestfrac = frac; + } + // + done = false; + } + + //move the vertex + for (i = 0; i < nummovefaces; i++) + { + //move vertex to end position + VectorCopy(mid, movefaces[i]->face_winding->points[movefacepoints[i]]); + //create new face plane + for (j = 0; j < 3; j++) + { + VectorCopy(movefaces[i]->face_winding->points[j], movefaces[i]->planepts[j]); + } + Face_MakePlane(movefaces[i]); + if (VectorLength(movefaces[i]->plane.normal) < 0.1) + result = false; + } + //if the brush is no longer convex + if (!result || !Brush_Convex(b)) + { + for (i = 0; i < nummovefaces; i++) + { + //move the vertex back to the initial position + VectorCopy(start, movefaces[i]->face_winding->points[movefacepoints[i]]); + //create new face plane + for (j = 0; j < 3; j++) + { + VectorCopy(movefaces[i]->face_winding->points[j], movefaces[i]->planepts[j]); + } + Face_MakePlane(movefaces[i]); + } + result = false; + VectorCopy(start, end); + done = true; + } + else + { + VectorCopy(mid, start); + } + //get texture crap right + for (i = 0; i < nummovefaces; i++) + { + Face_SetColor(b, movefaces[i], 1.0); + for (j = 0; j < movefaces[i]->face_winding->numpoints; j++) + EmitTextureCoordinates(movefaces[i]->face_winding->points[j], movefaces[i]->d_texture, movefaces[i]); + } + + //now try to merge faces with their original faces + lastface = NULL; + for (face = b->brush_faces; face; face = nextface) + { + nextface = face->next; + if (!face->original) + { + lastface = face; + continue; + } + if (!Plane_Equal(&face->plane, &face->original->plane, false)) + { + lastface = face; + continue; + } + w = Winding_TryMerge(face->face_winding, face->original->face_winding, face->plane.normal, true); + if (!w) + { + lastface = face; + continue; + } + Winding_Free(face->original->face_winding); + face->original->face_winding = w; + //get texture crap right + Face_SetColor(b, face->original, 1.0); + for (j = 0; j < face->original->face_winding->numpoints; j++) + EmitTextureCoordinates(face->original->face_winding->points[j], face->original->d_texture, face->original); + //remove the face that was merged with the original + if (lastface) lastface->next = face->next; + else b->brush_faces = face->next; + Face_Free(face); + } + } + return result; +} + +/* +================= +Brush_InsertVertexBetween +================= +*/ +int Brush_InsertVertexBetween(brush_t *b, vec3_t p1, vec3_t p2) +{ + face_t *face; + winding_t *w, *neww; + vec3_t point; + int i, insert; + + if (Point_Equal(p1, p2, 0.4f)) + return false; + VectorAdd(p1, p2, point); + VectorScale(point, 0.5f, point); + insert = false; + //the end point may not be the same as another vertex + for (face = b->brush_faces; face; face = face->next) + { + w = face->face_winding; + if (!w) continue; + neww = NULL; + for (i = 0; i < w->numpoints; i++) + { + if (!Point_Equal(w->points[i], p1, 0.1f)) + continue; + if (Point_Equal(w->points[(i+1) % w->numpoints], p2, 0.1f)) + { + neww = Winding_InsertPoint(w, point, (i+1) % w->numpoints); + break; + } + else if (Point_Equal(w->points[(i-1+w->numpoints) % w->numpoints], p2, 0.3f)) + { + neww = Winding_InsertPoint(w, point, i); + break; + } + } + if (neww) + { + Winding_Free(face->face_winding); + face->face_winding = neww; + insert = true; + } + } + return insert; +} + + +/* +================= +Brush_ResetFaceOriginals +================= +*/ +void Brush_ResetFaceOriginals(brush_t *b) +{ + face_t *face; + + for (face = b->brush_faces; face; face = face->next) + { + face->original = NULL; + } +} + +#ifdef ENABLE_GROUPS +/* +============== +Brush_SetEpair +sets an epair for the given brush +============== +*/ +void Brush_SetEpair(brush_t *b, const char *pKey, const char *pValue) +{ + if (g_qeglobals.m_bBrushPrimitMode) + { + if (b->patchBrush) + { + Patch_SetEpair(b->pPatch, pKey, pValue); + } + else + { + SetKeyValue(b->epairs, pKey, pValue); + } + } + else + { + Sys_Printf("Can only set key/values in Brush primitive mode\n"); + } +} + +/* +================= +Brush_GetKeyValue +================= +*/ +const char* Brush_GetKeyValue(brush_t *b, const char *pKey) +{ + if (g_qeglobals.m_bBrushPrimitMode) + { + if (b->patchBrush) + { + return Patch_GetKeyValue(b->pPatch, pKey); + } + else + { + return ValueForKey(b->epairs, pKey); + } + } + else + { + Sys_Printf("Can only set brush/patch key/values in Brush primitive mode\n"); + } + return ""; +} +#endif +/* +================= +CheckName +temporary stuff, detect potential problems when saving the texture name +================= +*/ +void CheckName( face_t *fa, char *pname ) +{ + if (!strlen(fa->texdef.GetName())) + { +#ifdef _DEBUG + Sys_Printf("WARNING: unexpected texdef.name is empty in Brush.cpp CheckName\n"); +#endif + fa->texdef.SetName(SHADER_NOT_FOUND); + strcpy(pname, SHADER_NOT_FOUND); + return; + } + + // some people manage to get long filename textures (with spaces) in their maps + if (strchr( fa->texdef.GetName(), ' ' )) + { + char Msg1[1024]; + + sprintf( Msg1, "Can't save texture with spaces in name. Rename %s\nNOTE: This message may popup several times .. once for each buggy face detected.", fa->texdef.GetName() ); + + Sys_Printf("%s\n", Msg1 ); + gtk_MessageBox(g_pParentWnd->m_pWidget, Msg1, "Error saving map", MB_OK ); + strcpy( pname, SHADER_NOT_FOUND ); + return; + } + + //++timo FIXME: bug #103494 detection attempt + // TODO: clean this detection part when bug will have disappeared + if (fa->texdef.GetName()[0] == '(') + { + char *text = "Bug #103494 detected, dropping texture. Please report to timo@qeradiant.com if you have a way to reproduce!\nNOTE: this message may popup several times .. once for each buggy face detected."; + Sys_Printf("%s\n", text); + gtk_MessageBox(g_pParentWnd->m_pWidget, text, "Error saving map", MB_OK ); + // need to cleanup this dead face name or we may loop endlessly + fa->texdef.SetName(SHADER_NOT_FOUND); + strcpy( pname, SHADER_NOT_FOUND ); + return; + } + strcpy( pname, fa->texdef.GetName()+9 ); // remove "textures/" +} + +/* +============= +Brush_Create + +Create non-textured blocks for entities +The brush is NOT linked to any list +============= +*/ +brush_t *Brush_Create (vec3_t mins, vec3_t maxs, texdef_t *texdef) +{ + int i, j; + vec3_t pts[4][2]; + face_t *f; + brush_t *b; + +#if DBG_BP + // brush primitive mode : convert texdef to brushprimit_texdef ? + // most of the time texdef is empty + if (g_qeglobals.m_bBrushPrimitMode) + { + // check texdef is empty .. if there are cases it's not we need to write some conversion code + if (texdef->shift[0]!=0 || texdef->shift[1]!=0 || texdef->scale[0]!=0 || texdef->scale[1]!=0 || texdef->rotate!=0) + Sys_Printf("Warning : non-zero texdef detected in Brush_Create .. need brush primitive conversion\n"); + } +#endif + + for (i=0 ; i<3 ; i++) + { + if (maxs[i] < mins[i]) + Error ("Brush_InitSolid: backwards"); + } + + b = Brush_Alloc(); + + pts[0][0][0] = mins[0]; + pts[0][0][1] = mins[1]; + + pts[1][0][0] = mins[0]; + pts[1][0][1] = maxs[1]; + + pts[2][0][0] = maxs[0]; + pts[2][0][1] = maxs[1]; + + pts[3][0][0] = maxs[0]; + pts[3][0][1] = mins[1]; + + for (i=0 ; i<4 ; i++) + { + pts[i][0][2] = mins[2]; + pts[i][1][0] = pts[i][0][0]; + pts[i][1][1] = pts[i][0][1]; + pts[i][1][2] = maxs[2]; + } + + for (i=0 ; i<4 ; i++) + { + f = Face_Alloc(); + f->texdef = *texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = b->brush_faces; + b->brush_faces = f; + j = (i+1)%4; + + VectorCopy (pts[j][1], f->planepts[0]); + VectorCopy (pts[i][1], f->planepts[1]); + VectorCopy (pts[i][0], f->planepts[2]); + } + + f = Face_Alloc(); + f->texdef = *texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorCopy (pts[0][1], f->planepts[0]); + VectorCopy (pts[1][1], f->planepts[1]); + VectorCopy (pts[2][1], f->planepts[2]); + + f = Face_Alloc(); + f->texdef = *texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorCopy (pts[2][0], f->planepts[0]); + VectorCopy (pts[1][0], f->planepts[1]); + VectorCopy (pts[0][0], f->planepts[2]); + + return b; +} + +/* +============= +Brush_CreatePyramid + +Create non-textured pyramid for light entities +The brush is NOT linked to any list +============= +*/ +brush_t *Brush_CreatePyramid (vec3_t mins, vec3_t maxs, texdef_t *texdef) +{ + int i; + + //++timo handle new brush primitive ? return here ?? + return Brush_Create(mins, maxs, texdef); + + for (i=0 ; i<3 ; i++) + if (maxs[i] < mins[i]) + Error ("Brush_InitSolid: backwards"); + + brush_t* b = Brush_Alloc(); + + vec3_t corners[4]; + + float fMid = Rad_rint(mins[2] + (Rad_rint((maxs[2] - mins[2]) / 2))); + + corners[0][0] = mins[0]; + corners[0][1] = mins[1]; + corners[0][2] = fMid; + + corners[1][0] = mins[0]; + corners[1][1] = maxs[1]; + corners[1][2] = fMid; + + corners[2][0] = maxs[0]; + corners[2][1] = maxs[1]; + corners[2][2] = fMid; + + corners[3][0] = maxs[0]; + corners[3][1] = mins[1]; + corners[3][2] = fMid; + + vec3_t top, bottom; + + top[0] = Rad_rint(mins[0] + ((maxs[0] - mins[0]) / 2)); + top[1] = Rad_rint(mins[1] + ((maxs[1] - mins[1]) / 2)); + top[2] = Rad_rint(maxs[2]); + + VectorCopy(top, bottom); + bottom[2] = mins[2]; + + // sides + for (i = 0; i < 4; i++) + { + face_t* f = Face_Alloc(); + f->texdef = *texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = b->brush_faces; + b->brush_faces = f; + int j = (i+1)%4; + + VectorCopy (top, f->planepts[0]); + VectorCopy (corners[i], f->planepts[1]); + VectorCopy(corners[j], f->planepts[2]); + + f = Face_Alloc(); + f->texdef = *texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorCopy (bottom, f->planepts[2]); + VectorCopy (corners[i], f->planepts[1]); + VectorCopy(corners[j], f->planepts[0]); + } + + return b; +} + + + + +/* +============= +Brush_MakeSided + +Makes the current brush have the given number of 2d sides +============= +*/ +void Brush_MakeSided (int sides) +{ + int i, axis = 0; + vec3_t mins, maxs; + brush_t *b; + texdef_t *texdef; + face_t *f; + vec3_t mid; + float width; + float sv, cv; + + if (sides < 3) + { + Sys_Status ("Bad sides number", 0); + return; + } + + if (sides >= MAX_POINTS_ON_WINDING-4) + { + Sys_Printf("too many sides.\n"); + return; + } + + if (!QE_SingleBrush ()) + { + Sys_Status ("Must have a single brush selected", 0 ); + return; + } + + b = selected_brushes.next; + VectorCopy (b->mins, mins); + VectorCopy (b->maxs, maxs); + texdef = &g_qeglobals.d_texturewin.texdef; + + Brush_Free (b); + + if (g_pParentWnd->ActiveXY()) + { + switch(g_pParentWnd->ActiveXY()->GetViewType()) + { + case XY: axis = 2; break; + case XZ: axis = 1; break; + case YZ: axis = 0; break; + } + } + else + { + axis = 2; + } + + // find center of brush + width = 8; + for (i = 0; i < 3; i++) + { + mid[i] = (maxs[i] + mins[i]) * 0.5; + if (i == axis) continue; + if ((maxs[i] - mins[i]) * 0.5 > width) + width = (maxs[i] - mins[i]) * 0.5; + } + + b = Brush_Alloc(); + + // create top face + f = Face_Alloc(); + f->texdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + f->planepts[2][(axis+1)%3] = mins[(axis+1)%3]; f->planepts[2][(axis+2)%3] = mins[(axis+2)%3]; f->planepts[2][axis] = maxs[axis]; + f->planepts[1][(axis+1)%3] = maxs[(axis+1)%3]; f->planepts[1][(axis+2)%3] = mins[(axis+2)%3]; f->planepts[1][axis] = maxs[axis]; + f->planepts[0][(axis+1)%3] = maxs[(axis+1)%3]; f->planepts[0][(axis+2)%3] = maxs[(axis+2)%3]; f->planepts[0][axis] = maxs[axis]; + + // create bottom face + f = Face_Alloc(); + f->texdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + f->planepts[0][(axis+1)%3] = mins[(axis+1)%3]; f->planepts[0][(axis+2)%3] = mins[(axis+2)%3]; f->planepts[0][axis] = mins[axis]; + f->planepts[1][(axis+1)%3] = maxs[(axis+1)%3]; f->planepts[1][(axis+2)%3] = mins[(axis+2)%3]; f->planepts[1][axis] = mins[axis]; + f->planepts[2][(axis+1)%3] = maxs[(axis+1)%3]; f->planepts[2][(axis+2)%3] = maxs[(axis+2)%3]; f->planepts[2][axis] = mins[axis]; + + for (i=0 ; itexdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + sv = sin (i*3.14159265*2/sides); + cv = cos (i*3.14159265*2/sides); + + f->planepts[0][(axis+1)%3] = floor(mid[(axis+1)%3]+width*cv+0.5); + f->planepts[0][(axis+2)%3] = floor(mid[(axis+2)%3]+width*sv+0.5); + f->planepts[0][axis] = mins[axis]; + + f->planepts[1][(axis+1)%3] = f->planepts[0][(axis+1)%3]; + f->planepts[1][(axis+2)%3] = f->planepts[0][(axis+2)%3]; + f->planepts[1][axis] = maxs[axis]; + + f->planepts[2][(axis+1)%3] = floor(f->planepts[0][(axis+1)%3] - width*sv + 0.5); + f->planepts[2][(axis+2)%3] = floor(f->planepts[0][(axis+2)%3] + width*cv + 0.5); + f->planepts[2][axis] = maxs[axis]; + } + + Brush_AddToList (b, &selected_brushes); + + Entity_LinkBrush (world_entity, b); + + Brush_Build( b ); + + Sys_UpdateWindows (W_ALL); +} + + + +/* +============= +Brush_Free + +Frees the brush with all of its faces and display list. +Unlinks the brush from whichever chain it is in. +Decrements the owner entity's brushcount. +Removes owner entity if this was the last brush +unless owner is the world. +Removes from groups +============= +*/ +void Brush_Free (brush_t *b, bool bRemoveNode) +{ + face_t *f, *next; + epair_t *ep, *enext; + + // remove from group + if (bRemoveNode) + Group_RemoveBrush(b); + + // free the patch if it's there + if (b->patchBrush) + { + Patch_Delete(b->pPatch); + } + + // free faces + for (f=b->brush_faces ; f ; f=next) + { + next = f->next; + Face_Free( f ); + } + + // TTimo : free brush epairs + for (ep = b->epairs ; ep ; ep=enext ) + { + enext = ep->next; + free (ep->key); + free (ep->value); + free (ep); + } + + // unlink from active/selected list + if (b->next) + Brush_RemoveFromList (b); + + // unlink from entity list + if (b->onext) + Entity_UnlinkBrush (b); + + free (b); +} + +/* +============= +Face_MemorySize +============= +*/ +int Face_MemorySize(face_t *f ) +{ + int size = 0; + + if (f->face_winding) + { +// size += _msize(f->face_winding); + size += sizeof(vec3_t)*f->face_winding->numpoints+2*sizeof(int); + } +// size += _msize(f); + size += sizeof(face_t); + return size; +} + +/* +============= +Brush_MemorySize +============= +*/ +int Brush_MemorySize(brush_t *b) +{ + face_t *f; + epair_t *ep; + int size = 0; + + // + if (b->patchBrush) + { + size += Patch_MemorySize(b->pPatch); + } + // + for (f = b->brush_faces; f; f = f->next) + { + size += Face_MemorySize(f); + } + // + for (ep = b->epairs; ep; ep = ep->next ) + { +// size += _msize(ep->key); + size += strlen(ep->key); +// size += _msize(ep->value); + size += strlen(ep->value); +// size += _msize(ep); + size += sizeof(epair_t); + } +// size += _msize(b); + size += sizeof(brush_t); + return size; +} + + +/* +============ +Brush_Clone + +Does NOT add the new brush to any lists +============ +*/ +brush_t *Brush_Clone (brush_t *b) +{ + brush_t *n = NULL; + face_t *f, *nf; + + if (b->patchBrush) + { + patchMesh_t *p = Patch_Duplicate(b->pPatch); + Brush_RemoveFromList(p->pSymbiot); + Entity_UnlinkBrush(p->pSymbiot); + n = p->pSymbiot; + } + else + { + n = Brush_Alloc(); + n->numberId = g_nBrushId++; + n->owner = b->owner; + for (f=b->brush_faces ; f ; f=f->next) + { + nf = Face_Clone( f ); + nf->next = n->brush_faces; + n->brush_faces = nf; + } + } + + return n; +} + +/* +============ +Brush_Clone + +Does NOT add the new brush to any lists +============ +*/ +brush_t *Brush_FullClone(brush_t *b) +{ + brush_t *n = NULL; + face_t *f, *nf, *f2, *nf2; + int j; + + if (b->patchBrush) + { + patchMesh_t *p = Patch_Duplicate(b->pPatch); + Brush_RemoveFromList(p->pSymbiot); + Entity_UnlinkBrush(p->pSymbiot); + n = p->pSymbiot; + n->owner = b->owner; + Brush_Build(n); + } + else + { + n = Brush_Alloc(); + n->numberId = g_nBrushId++; + n->owner = b->owner; + VectorCopy(b->mins, n->mins); + VectorCopy(b->maxs, n->maxs); + // + for (f = b->brush_faces; f; f = f->next) + { + if (f->original) continue; + nf = Face_FullClone(f); + nf->next = n->brush_faces; + n->brush_faces = nf; + //copy all faces that have the original set to this face + for (f2 = b->brush_faces; f2; f2 = f2->next) + { + if (f2->original == f) + { + nf2 = Face_FullClone(f2); + nf2->next = n->brush_faces; + n->brush_faces = nf2; + //set original + nf2->original = nf; + } + } + } + for (nf = n->brush_faces; nf; nf = nf->next) + { + Face_SetColor(n, nf, 1.0); + if (nf->face_winding) { - m_edge_indices.resize(uniqueEdgeIndices.size()); - - for(std::size_t i=0, count=0; iface_winding); + else { - const Winding& winding = m_faces[i]->getWinding(); - for(std::size_t j = 0; j < winding.numpoints; ++j) - { - const RenderIndex edge_index = uniqueEdgeIndices[count+j]; + for (j = 0; j < nf->face_winding->numpoints; j++) + EmitTextureCoordinates(nf->face_winding->points[j], nf->d_texture, nf); + } + } + } + } + return n; +} - m_edge_indices[edge_index].first = uniqueVertexIndices[count + j]; - m_edge_indices[edge_index].second = uniqueVertexIndices[count + Winding_next(winding, j)]; + // FIXME - spog - finish this later.. + /* +bool Triangle_Ray(vec3_t origin, vec3_t dir, vec3_t p1, vec3_t p2, vec3_t p3) +{ + int i; + vec3_t v1, v2, normal[3]; + float d; + + //Sys_Printf("p1: %f %f %f\n",p1[0],p1[1],p1[2]); + //Sys_Printf("p2: %f %f %f\n",p2[0],p2[1],p2[2]); + //Sys_Printf("p3: %f %f %f\n",p3[0],p3[1],p3[2]); + //Sys_Printf("origin: %f %f %f\n",origin[0],origin[1],origin[2]); + + // test ray against triangle + // get triangle plane normal + //VectorSubtract(p1, p2, v1); + //VectorSubtract(p1, p3, v2); + //CrossProduct(v1, v2, v1); + // check normal against direction + //if (DotProduct(dir, v1) >= 0) + //{ + // generate cone normals + VectorSubtract(origin, p1, v1); + VectorSubtract(origin, p2, v2); + CrossProduct(v1, v2, normal[0]); + VectorSubtract(origin, p2, v1); + VectorSubtract(origin, p3, v2); + CrossProduct(v1, v2, normal[1]); + VectorSubtract(origin, p3, v1); + VectorSubtract(origin, p1, v2); + CrossProduct(v1, v2, normal[2]); + //} + //else + //{ + // flip normals if triangle faces away + // Sys_Printf("flipped\n"); + // VectorSubtract(origin, p1, v1); + // VectorSubtract(origin, p3, v2); + // CrossProduct(v1, v2, normal[0]); + // VectorSubtract(origin, p3, v1); + // VectorSubtract(origin, p2, v2); + // CrossProduct(v1, v2, normal[1]); + // VectorSubtract(origin, p2, v1); + // VectorSubtract(origin, p1, v2); + // CrossProduct(v1, v2, normal[2]); + //} + + for (i=0; i<3; i++) + { + VectorNormalize(normal[i]); + //Sys_Printf("direction: %f %f %f\n",dir[0],dir[1],dir[2]); + //Sys_Printf("normal: %f %f %f\n",normal[i][0],normal[i][1],normal[i][2]); + d = DotProduct(dir, normal[i]); + //Sys_Printf("dotproduct: %f\n",d); + if (d < 0) + return false; + } + return true; +} +*/ + +/* +extern int Triangle_Ray(float orig[3], float dir[3], bool bCullBack, + float vert0[3], float vert1[3], float vert2[3], + double *t, double *u, double *v); + +bool Model_Ray(brush_t *b, vec3_t origin, vec3_t dir, double *t, double *u, double *v) +{ + bool bIntersect = false; + float tBest = FLT_MAX; + int i, j; + vec3_t xyz[3]; + vec3_t vRay[2]; + + float angle = FloatForKey (b->owner, "angle"); // FIXME: should be set when this entity key is set + + VectorSubtract (origin, b->owner->origin, vRay[0]); + VectorCopy (dir, vRay[1]); + + if (angle > 0) + { + int i; + float s, c; + float x, y; + + s = sin (-angle/180*Q_PI); + c = cos (-angle/180*Q_PI); + + for (i=0; i<2; i++) + { + x = vRay[i][0]; + y = vRay[i][1]; + vRay[i][0] = (x * c) - (y * s); + vRay[i][1] = (x * s) + (y * c); + } + } + + entitymodel *model = b->owner->md3Class->model; + + while (model != NULL) + { + for (i = 0; i < model->nTriCount; i++) + { + for (j = 0; j < 3; j++) + VectorCopy(model->pVertList[model->pTriList[i].indexes[j]].v, xyz[j]); + + if (Triangle_Ray(vRay[0], vRay[1], true, xyz[0], xyz[2], xyz[1], t, u, v)) + { + bIntersect = true; + if (*t < tBest) + tBest = *t; + } + } + model = model->pNext; + } + if (bIntersect) + { + *t = tBest; + return true; + } + else + { + *t = 0; + return false; + } +} +*/ + +/* +============== +Brush_Ray + +Itersects a ray with a brush +Returns the face hit and the distance along the ray the intersection occured at +Returns NULL and 0 if not hit at all + +http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=556 +============== +*/ +extern bool Patch_Ray(patchMesh_t *patch, vec3_t origin, vec3_t dir, double *t, double *u, double *v); +face_t *Brush_Ray (vec3_t origin, vec3_t dir, brush_t *b, float *dist, int nFlags) +{ + face_t *f, *firstface = NULL; + vec3_t p1, p2; + float frac, d1, d2; + int i; + + if (b->owner->eclass->fixedsize + && b->owner->model.pSelect + && !(!IsBrushSelected(b) && (g_PrefsDlg.m_nEntityShowState & ENTITY_SELECTED_ONLY)) + && g_PrefsDlg.m_nEntityShowState != ENTITY_BOX) + { + ray_t ray_local; + vec_t dist_local = FLT_MAX; + ray_construct_for_vec3(&ray_local, origin, dir); + if (b->owner->model.pSelect->TestRay(&ray_local, &dist_local)) + { + *dist = dist_local; + return b->brush_faces; + } + else + { + *dist = 0.0f; + return NULL; + } + } + + VectorCopy (origin, p1); + for (i=0 ; i<3 ; i++) + p2[i] = p1[i] + dir[i]*2*g_MaxWorldCoord; + + for (f=b->brush_faces ; f ; f=f->next) + { + d1 = DotProduct (p1, f->plane.normal) - f->plane.dist; + d2 = DotProduct (p2, f->plane.normal) - f->plane.dist; + if (d1 >= 0 && d2 >= 0) + { + *dist = 0; + return NULL; // ray is on front side of face + } + if (d1 <=0 && d2 <= 0) + continue; + // clip the ray to the plane + frac = d1 / (d1 - d2); + if (d1 > 0) + { + firstface = f; + for (i=0 ; i<3 ; i++) + p1[i] = p1[i] + frac *(p2[i] - p1[i]); + } + else + { + for (i=0 ; i<3 ; i++) + p2[i] = p1[i] + frac *(p2[i] - p1[i]); + } + } + + // find distance p1 is along dir + VectorSubtract (p1, origin, p1); + d1 = DotProduct (p1, dir); + + *dist = d1; + + // new test stuff for patches + if (!g_PrefsDlg.m_bPatchBBoxSelect && b->patchBrush) + { + double t, u, v; // t is the distance from origin to point-of-intersection.. er.. i don't know what u and v are + if (!Patch_Ray(b->pPatch, origin, dir, &t, &u, &v)) + { + *dist = 0; + return NULL; + } + else + { + *dist = (float)t; + //Sys_Printf("t: %f, u: %f, v: %f\n", t, u, v); + } + } + + // IMPORTANT NOTE: + // modifications to the discarding code here should be matched in the selection code + // see Brush_Draw + + // do some last minute filtering + if (firstface && nFlags & SF_CAMERA) + { + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK) + { + if (strstr(firstface->texdef.GetName(), "caulk")) + { + *dist = 0; + return NULL; + } + } + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_BOTCLIP) + { + if (strstr(firstface->texdef.GetName(), "botclip") || strstr(firstface->texdef.GetName(), "clipmonster")) + { + *dist = 0; + return NULL; + } + } + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLIP) + { + if (strstr(firstface->texdef.GetName(), "clip")) + { + *dist = 0; + return NULL; + } + } + } + + return firstface; +} + +//PGM +face_t *Brush_Point (vec3_t origin, brush_t *b) +{ + face_t *f; + float d1; + + for (f=b->brush_faces ; f ; f=f->next) + { + d1 = DotProduct (origin, f->plane.normal) - f->plane.dist; + if (d1 > 0) + { + return NULL; // point is on front side of face + } + } + + return b->brush_faces; +} +//PGM + + +void Brush_AddToList (brush_t *b, brush_t *blist) +{ + if (b->next || b->prev) + Error ("Brush_AddToList: already linked"); + + if (blist == &selected_brushes || blist == &active_brushes) + { + if (b->patchBrush && blist == &selected_brushes) + { + Patch_Select(b->pPatch); + } + } + b->next = blist->next; + blist->next->prev = b; + blist->next = b; + b->prev = blist; + + // TTimo messaging + DispatchRadiantMsg( RADIANT_SELECTION ); +} + +void Brush_RemoveFromList (brush_t *b) +{ + if (!b->next || !b->prev) + Error ("Brush_RemoveFromList: not linked"); + + if (b->patchBrush) + { + Patch_Deselect(b->pPatch); + } + b->next->prev = b->prev; + b->prev->next = b->next; + b->next = b->prev = NULL; +} + +/* +=============== +SetFaceTexdef + +Doesn't set the curve flags + +NOTE : ( TTimo ) + never trust f->d_texture here, f->texdef and f->d_texture are out of sync when called by Brush_SetTexture + use Texture_ForName() to find the right shader + FIXME : send the right shader ( qtexture_t * ) in the parameters ? + +TTimo: surface plugin, added an IPluginTexdef* parameter + if not NULL, get ->Copy() of it into the face ( and remember to hook ) + if NULL, ask for a default + + TTimo - shader code cleanup + added IShader* parameter + =============== +*/ +void SetFaceTexdef2 (brush_t *b, face_t *f, IShader *pShader, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pPlugTexdef) { + int oldFlags; + int oldContents; + face_t *tf; + + oldFlags = f->texdef.flags; + oldContents = f->texdef.contents; + if (g_qeglobals.m_bBrushPrimitMode) + { + f->texdef = *texdef; + ConvertTexMatWithQTexture( brushprimit_texdef, NULL, &f->brushprimit_texdef, QERApp_Shader_ForName( f->texdef.GetName() )->getTexture() ); + } + else + if (bFitScale) + { + f->texdef = *texdef; + // fit the scaling of the texture on the actual plane + vec3_t p1,p2,p3; // absolute coordinates + // compute absolute coordinates + ComputeAbsolute(f,p1,p2,p3); + // compute the scale + vec3_t vx,vy; + VectorSubtract(p2,p1,vx); + VectorNormalize(vx, vx); + VectorSubtract(p3,p1,vy); + VectorNormalize(vy, vy); + // assign scale + VectorScale(vx,texdef->scale[0],vx); + VectorScale(vy,texdef->scale[1],vy); + VectorAdd(p1,vx,p2); + VectorAdd(p1,vy,p3); + // compute back shift scale rot + AbsoluteToLocal(f->plane,f,p1,p2,p3); + } + else + f->texdef = *texdef; + f->texdef.flags = (f->texdef.flags & ~SURF_KEEP) | (oldFlags & SURF_KEEP); + f->texdef.contents = (f->texdef.contents & ~CONTENTS_KEEP) | (oldContents & CONTENTS_KEEP); + + // if this is a curve face, set all other curve faces to the same texdef + if (f->texdef.flags & SURF_CURVE) + { + for (tf = b->brush_faces ; tf ; tf = tf->next) + { + if (tf->texdef.flags & SURF_CURVE) + tf->texdef = f->texdef; + } + } +} + +/* +=============== +SetFaceTexdef + +Doesn't set the curve flags + +NOTE : ( TTimo ) + never trust f->d_texture here, f->texdef and f->d_texture are out of sync when called by Brush_SetTexture + use Texture_ForName() to find the right shader + FIXME : send the right shader ( qtexture_t * ) in the parameters ? + + TTimo: surface plugin, added an IPluginTexdef* parameter + if not NULL, get ->Copy() of it into the face ( and remember to hook ) + if NULL, ask for a default +=============== +*/ +void SetFaceTexdef (face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pPlugTexdef) { + int oldFlags; + int oldContents; + + oldFlags = f->texdef.flags; + oldContents = f->texdef.contents; + + if(strcmp(f->texdef.GetName(), texdef->GetName()) != 0) // set shader here instead of Brush_Build + Face_SetShader(f, texdef->GetName()); + + if (g_qeglobals.m_bBrushPrimitMode) + { + f->texdef = *texdef; + ConvertTexMatWithQTexture( brushprimit_texdef, NULL, &f->brushprimit_texdef, QERApp_Shader_ForName( f->texdef.GetName() )->getTexture() ); + } + else + { + if (bFitScale) + { + f->texdef = *texdef; + // fit the scaling of the texture on the actual plane + vec3_t p1,p2,p3; // absolute coordinates + // compute absolute coordinates + ComputeAbsolute(f,p1,p2,p3); + // compute the scale + vec3_t vx,vy; + VectorSubtract(p2,p1,vx); + VectorNormalize(vx, vx); + VectorSubtract(p3,p1,vy); + VectorNormalize(vy, vy); + // assign scale + VectorScale(vx,texdef->scale[0],vx); + VectorScale(vy,texdef->scale[1],vy); + VectorAdd(p1,vx,p2); + VectorAdd(p1,vy,p3); + // compute back shift scale rot + AbsoluteToLocal(f->plane,f,p1,p2,p3); + } + else + { + f->texdef = *texdef; + } + } + f->texdef.flags = (f->texdef.flags & ~SURF_KEEP) | (oldFlags & SURF_KEEP); + f->texdef.contents = (f->texdef.contents & ~CONTENTS_KEEP) | (oldContents & CONTENTS_KEEP); +} + +#ifdef _DEBUG +void Brush_SetTexture2 (brush_t *b, IShader *pShader, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pTexdef) +{ + for (face_t* f = b->brush_faces ; f ; f = f->next) + SetFaceTexdef2 (b, f, pShader, texdef, brushprimit_texdef, bFitScale, pTexdef); + Brush_Build( b ); + if (b->patchBrush) + { + Patch_SetTexture(b->pPatch, texdef, pTexdef ); + b->bFiltered = FilterBrush( b ); + } +} +#endif + +void Brush_SetTexture (brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef* pTexdef) +{ + for (face_t* f = b->brush_faces ; f ; f = f->next) + SetFaceTexdef (f, texdef, brushprimit_texdef, bFitScale, pTexdef); + Brush_Build( b ); + if (b->patchBrush) + { + Patch_SetTexture(b->pPatch, texdef, pTexdef ); + b->bFiltered = FilterBrush( b ); + } +} + + +qboolean ClipLineToFace (vec3_t p1, vec3_t p2, face_t *f) +{ + float d1, d2, fr; + int i; + float *v; + + d1 = DotProduct (p1, f->plane.normal) - f->plane.dist; + d2 = DotProduct (p2, f->plane.normal) - f->plane.dist; + + if (d1 >= 0 && d2 >= 0) + return false; // totally outside + if (d1 <= 0 && d2 <= 0) + return true; // totally inside + + fr = d1 / (d1 - d2); + + if (d1 > 0) + v = p1; + else + v = p2; + + for (i=0 ; i<3 ; i++) + v[i] = p1[i] + fr*(p2[i] - p1[i]); + + return true; +} + + +int AddPlanept (float *f) +{ + int i; + + for (i=0 ; iowner->eclass->fixedsize) + return; + + c = 0; + for (i=0 ; i<3 ; i++) + c += AddPlanept (f->planepts[i]); + if (c == 0) + return; // already completely added + + // select all points on this plane in all brushes the selection + for (b2=selected_brushes.next ; b2 != &selected_brushes ; b2 = b2->next) + { + if (b2 == b) + continue; + for (f2=b2->brush_faces ; f2 ; f2=f2->next) + { + for (i=0 ; i<3 ; i++) + if (fabs(DotProduct(f2->planepts[i], f->plane.normal) + -f->plane.dist) > ON_EPSILON) + break; + if (i==3) + { // move this face as well + Brush_SelectFaceForDragging (b2, f2, shear); + break; + } + } + } + + + // if shearing, take all the planes adjacent to + // selected faces and rotate their points so the + // edge clipped by a selcted face has two of the points + if (!shear) + return; + + for (f2=b->brush_faces ; f2 ; f2=f2->next) + { + if (f2 == f) + continue; + w = Brush_MakeFaceWinding (b, f2); + if (!w) + continue; + + // any points on f will become new control points + for (i=0 ; inumpoints ; i++) + { + d = DotProduct (w->points[i], f->plane.normal) + - f->plane.dist; + if (d > -ON_EPSILON && d < ON_EPSILON) + break; + } + + // + // if none of the points were on the plane, + // leave it alone + // + if (i != w->numpoints) + { + if (i == 0) + { // see if the first clockwise point was the + // last point on the winding + d = DotProduct (w->points[w->numpoints-1] + , f->plane.normal) - f->plane.dist; + if (d > -ON_EPSILON && d < ON_EPSILON) + i = w->numpoints - 1; + } + + AddPlanept (f2->planepts[0]); + + VectorCopy (w->points[i], f2->planepts[0]); + if (++i == w->numpoints) + i = 0; + + // see if the next point is also on the plane + d = DotProduct (w->points[i] + , f->plane.normal) - f->plane.dist; + if (d > -ON_EPSILON && d < ON_EPSILON) + AddPlanept (f2->planepts[1]); + + VectorCopy (w->points[i], f2->planepts[1]); + if (++i == w->numpoints) + i = 0; + + // the third point is never on the plane + + VectorCopy (w->points[i], f2->planepts[2]); + } + + free(w); + } +} + +/* +============== +Brush_SideSelect + +The mouse click did not hit the brush, so grab one or more side +planes for dragging +============== +*/ +void Brush_SideSelect (brush_t *b, vec3_t origin, vec3_t dir + , qboolean shear) +{ + face_t *f, *f2; + vec3_t p1, p2; + + for (f=b->brush_faces ; f ; f=f->next) + { + VectorCopy (origin, p1); + VectorMA (origin, 2*g_MaxWorldCoord, dir, p2); + + for (f2=b->brush_faces ; f2 ; f2=f2->next) + { + if (f2 == f) + continue; + ClipLineToFace (p1, p2, f2); + } + + if (f2) + continue; + + if (VectorCompare (p1, origin)) + continue; + if (ClipLineToFace (p1, p2, f)) + continue; + + Brush_SelectFaceForDragging (b, f, shear); + } +} + +bool g_bBuildWindingsNoTexBuild = false; + +void Brush_SetBuildWindingsNoTexBuild(bool bBuild) +{ + g_bBuildWindingsNoTexBuild = bBuild; +} + +// TTimo: don't rebuild pShader and d_texture if it doesn't seem necessary +// saves quite a lot of time, but on the other hand we've gotta make sure we clean the d_texture in some cases +// ie when we want to update a shader +// default will make Radiant rebuild the texture, but it can be turned off by setting the flag g_bBuildWindingsNoTexBuild +void Brush_BuildWindings( brush_t *b, bool bSnap ) +{ + winding_t *w; + face_t *face; + vec_t v; + + if (bSnap) + Brush_SnapPlanepts( b ); + + // clear the mins/maxs bounds + b->mins[0] = b->mins[1] = b->mins[2] = 99999; + b->maxs[0] = b->maxs[1] = b->maxs[2] = -99999; + + Brush_MakeFacePlanes (b); + + face = b->brush_faces; + + float fCurveColor = 1.0; + + for ( ; face ; face=face->next) + { + int i, j; + free(face->face_winding); + w = face->face_winding = Brush_MakeFaceWinding (b, face); + + if (!g_bBuildWindingsNoTexBuild || !face->d_texture) + { +#ifdef _DEBUG + // if there's no d_texture, then we expect pShader to be empty + if (!face->d_texture && face->pShader) + Sys_FPrintf(SYS_ERR, "ERROR: unexpected face->pShader != NULL with face->d_texture == NULL in Brush_BuildWindings\n"); +#endif + if ((!face->d_texture && !face->pShader) || !face->pShader) + { + // NOTE TTimo + // patch 84 for bug 253 doesn't dec ref the potential face->pShader + // add a debug check to make sure this is actually not necessary +#ifdef _DEBUG + if (face->pShader) + { + Sys_FPrintf(SYS_ERR, "ERROR: face->pShader != NULL in Brush_BuildWindings\n"); + } +#endif + face->pShader = QERApp_Shader_ForName( face->texdef.GetName() ); + face->pShader->IncRef(); + face->d_texture = face->pShader->getTexture(); + } + } + + if (!w) + continue; + + for (i=0 ; inumpoints ; i++) + { + // add to bounding box + for (j=0 ; j<3 ; j++) + { + v = w->points[i][j]; + if (v > b->maxs[j]) + b->maxs[j] = v; + if (v < b->mins[j]) + b->mins[j] = v; + } + } + Face_SetColor (b, face, fCurveColor); + + fCurveColor -= .10f; + if (fCurveColor <= 0) + fCurveColor = 1.0f; + + // computing ST coordinates for the windings + if (g_qeglobals.m_bBrushPrimitMode) + { + if (g_qeglobals.bNeedConvert) + { + // we have parsed old brushes format and need conversion + // convert old brush texture representation to new format + FaceToBrushPrimitFace(face); +#ifdef _DEBUG + // use old texture coordinates code to check against + for (i=0 ; inumpoints ; i++) + EmitTextureCoordinates( w->points[i], face->d_texture, face); +#endif + } + // use new texture representation to compute texture coordinates + // in debug mode we will check against old code and warn if there are differences + EmitBrushPrimitTextureCoordinates(face,w); + } + else + { + if (g_qeglobals.bNeedConvert) + { + BrushPrimitFaceToFace(face); +/* + // we have parsed brush primitives and need conversion back to standard format + // NOTE: converting back is a quick hack, there's some information lost and we can't do anything about it + // FIXME: if we normalize the texture matrix to a standard 2x2 size, we end up with wrong scaling + // I tried various tweaks, no luck .. seems shifting is lost + brushprimit_texdef_t aux; + ConvertTexMatWithQTexture( &face->brushprimit_texdef, face->d_texture, &aux, NULL ); + TexMatToFakeTexCoords( aux.coords, face->texdef.shift, &face->texdef.rotate, face->texdef.scale ); + face->texdef.scale[0]/=2.0; + face->texdef.scale[1]/=2.0; +*/ + } + for (i=0 ; inumpoints ; i++) + EmitTextureCoordinates( w->points[i], face->d_texture, face); + } + } +} + +/* +================== +Brush_RemoveEmptyFaces + +Frees any overconstraining faces +================== +*/ +void Brush_RemoveEmptyFaces ( brush_t *b ) +{ + face_t *f, *next; + + f = b->brush_faces; + b->brush_faces = NULL; + + for ( ; f ; f=next) + { + next = f->next; + if (!f->face_winding) + Face_Free (f); + else + { + f->next = b->brush_faces; + b->brush_faces = f; + } + + } +} + +void Brush_SnapToGrid(brush_t *pb) +{ + face_t *f; + vec3_t temp; + vec3_t diff[2]; + int mult[3]; + int i, j, n; + // TTimo: some brushes are "special" and should not be snapped + // specially fixed-size entity ones + if (pb->owner->eclass->fixedsize) + { + // save current origin + VectorCopy (pb->owner->origin, temp); + // snap the origin + VectorFSnap(pb->owner->origin, g_qeglobals.d_gridsize); + // return if amount is zero + if (VectorCompare (pb->owner->origin, temp)) + return; + // transform brush faces same amount + VectorSubtract (pb->owner->origin, temp, temp); + for (f = pb->brush_faces; f; f = f->next) + { + for (i=0 ; i<3 ; i++) + VectorAdd (f->planepts[i], temp, f->planepts[i]); + } + } + else + { + for (f = pb->brush_faces ; f; f = f->next) + { + for (j=0; j<2; j++) + { + // spog - move planepts apart just far enough to avoid snapping two together + VectorSubtract (f->planepts[j+1], f->planepts[j], diff[j]); + for (i=0; i<3; i++) + { + if (diff[j][i] == 0.0f) + mult[i] = 2; // next value up from 1 + else // multiplier = gridsize / component difference, rounded up + mult[i] = (int)ceil(fabs(g_qeglobals.d_gridsize / diff[j][i])); + } + + if (mult[0] > 1 && mult[1] > 1 && mult[2] > 1) // if all multipliers are greater than 1 + { + n = (mult[0] >= mult[1] && mult[0] >= mult[2]) ? 0 : (mult[1] >= mult[0] && mult[1] >= mult[2]) ? 1 : 2; + for (i=0; i<3; i++) + diff[j][i] *= mult[n]; // multiply difference by multiplier of smallest component + } + VectorAdd (f->planepts[j], diff[j], f->planepts[j+1]); + } + + for (i=0; i<3; i++) + VectorFSnap(f->planepts[i], g_qeglobals.d_gridsize); + + } + } + Brush_Build(pb,true,true,false,false); // don't filter +} + +void Brush_Rotate(brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild) +{ + for (face_t* f=b->brush_faces ; f ; f=f->next) + { + for (int i=0 ; i<3 ; i++) + { + VectorRotateOrigin (f->planepts[i], vAngle, vOrigin, f->planepts[i]); + } + } + if (bBuild) + { + Brush_Build(b,false,false,false,false); // don't filter + } +} + +void Brush_Center(brush_t *b, vec3_t vNewCenter) +{ + vec3_t vMid; + // get center of the brush + for (int j = 0; j < 3; j++) + { + vMid[j] = b->mins[j] + fabs((b->maxs[j] - b->mins[j]) * 0.5); + } + // calc distance between centers + VectorSubtract(vNewCenter, vMid, vMid); + Brush_Move(b, vMid, true); + +} + +void Brush_Resize(brush_t *b, vec3_t vMin, vec3_t vMax) +{ + face_t *f; + texdef_t texdef; + int i; + short box[3][2] = { { 0, 1 }, { 2, 0 }, { 1, 2 } }; + + for (i=0 ; i<3 ; i++) + if (vMax[i] < vMin[i]) + Error ("Brush_Resize: invalid input"); + + if(b->brush_faces != NULL) + texdef = b->brush_faces->texdef; + else + texdef = g_qeglobals.d_texturewin.texdef; + + while (b->brush_faces != NULL) + { + f = b->brush_faces->next; + Face_Free(b->brush_faces); + b->brush_faces = f; + } + + for(i=0; i<3; i++) + { + f = b->brush_faces; + b->brush_faces = Face_Alloc(); + b->brush_faces->next = f; + f = b->brush_faces; + f->texdef = texdef; + VectorCopy(vMax, f->planepts[0]); + VectorCopy(vMax, f->planepts[1]); + VectorCopy(vMax, f->planepts[2]); + f->planepts[2][box[i][0]] = vMin[box[i][0]]; + f->planepts[1][box[i][1]] = vMin[box[i][1]]; + } + for(i=0; i<3; i++) + { + f = b->brush_faces; + b->brush_faces = Face_Alloc(); + b->brush_faces->next = f; + f = b->brush_faces; + f->texdef = texdef; + VectorCopy(vMin, f->planepts[0]); + VectorCopy(vMin, f->planepts[1]); + VectorCopy(vMin, f->planepts[2]); + f->planepts[1][box[i][0]] = vMax[box[i][0]]; + f->planepts[2][box[i][1]] = vMax[box[i][1]]; + } +} + +void FacingVectors (entity_t *e, vec3_t forward, vec3_t right, vec3_t up) +{ + int angleVal; + vec3_t angles; + + angleVal = IntForKey(e, "angle"); + if (angleVal == -1) // up + { + VectorSet(angles, 270, 0, 0); + } + else if(angleVal == -2) // down + { + VectorSet(angles, 90, 0, 0); + } + else + { + VectorSet(angles, 0, angleVal, 0); + } + + AngleVectors(angles, forward, right, up); +} + +void Brush_DrawFacingAngle (brush_t *b, entity_t *e) +{ + vec3_t forward, right, up; + vec3_t endpoint, tip1, tip2; + vec3_t start; + float dist; + + VectorAdd(e->brushes.onext->mins, e->brushes.onext->maxs, start); + VectorScale(start, 0.5, start); + dist = (b->maxs[0] - start[0]) * 2.5; + + FacingVectors (e, forward, right, up); + VectorMA (start, dist, forward, endpoint); + + dist = (b->maxs[0] - start[0]) * 0.5; + VectorMA (endpoint, -dist, forward, tip1); + VectorMA (tip1, -dist, up, tip1); + VectorMA (tip1, 2*dist, up, tip2); + + qglColor4f (1, 1, 1, 1); + qglLineWidth (4); + qglBegin (GL_LINES); + qglVertex3fv (start); + qglVertex3fv (endpoint); + qglVertex3fv (endpoint); + qglVertex3fv (tip1); + qglVertex3fv (endpoint); + qglVertex3fv (tip2); + qglEnd (); + qglLineWidth (1); +} + +void Brush_FaceDraw(face_t *face, int nGLState) +{ + const winding_t *w = face->face_winding; + if (w == NULL) return; + if (nGLState & DRAW_GL_LIGHTING && g_PrefsDlg.m_bGLLighting) + qglNormal3fv(face->plane.normal); + /* + if (mode & DRAW_GL_TEXTURE_2D) + qglTexCoordPointer(2, GL_FLOAT, 5, &w->points[3]); + qglVertexPointer(3, GL_FLOAT, 5, w->points); + + if (mode & DRAW_GL_FILL) + qglDrawArrays(GL_TRIANGLE_FAN, 0, w->numpoints); + else + qglDrawArrays(GL_POLYGON, 0, w->numpoints); + */ + + if (nGLState & DRAW_GL_FILL) + qglBegin(GL_TRIANGLE_FAN); + else + qglBegin(GL_POLYGON); + + for (int i=0 ; inumpoints ; i++) + { + if (nGLState & DRAW_GL_TEXTURE_2D) + qglTexCoord2fv( &w->points[i][3] ); + qglVertex3fv(w->points[i]); + } + qglEnd(); +} + +#define Q2_SURF_TRANS33 0x00000010 +#define Q2_SURF_TRANS66 0x00000020 + +void Brush_Draw(brush_t *b) +{ + face_t *face; + int order; + qtexture_t *prev = 0; + winding_t *w; + + int nDrawMode = g_pParentWnd->GetCamWnd()->Camera()->draw_mode; + int nGLState = g_pParentWnd->GetCamWnd()->Camera()->draw_glstate; + + GLfloat material[4], identity[4]; + VectorSet(identity, 0.8f, 0.8f, 0.8f); + IShader *pShader; + qglPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); + qglDisableClientState(GL_NORMAL_ARRAY); + + // guarantee the texture will be set first + bool bTrans; + float transVal; + prev = NULL; + for (face = b->brush_faces,order = 0 ; face ; face=face->next, order++) + { + w = face->face_winding; + if (!w) + { + continue; // freed face + } + + bTrans = (face->pShader->getFlags() & QER_TRANS); + transVal = face->pShader->getTrans(); + // try to read the texture def surface flags to get trans + if (!bTrans) { + if (face->texdef.flags & Q2_SURF_TRANS33) { + bTrans = true; + transVal = 0.33; + } else if (face->texdef.flags & Q2_SURF_TRANS66) { + bTrans = true; + transVal = 0.66; + } + } + + if (bTrans && !(nGLState & DRAW_GL_BLEND)) + continue; + if (!bTrans && nGLState & DRAW_GL_BLEND) + continue; + + // IMPORTANT NOTE: + // modifications to the discarding code here should be matched in the selection code + // see Brush_Ray + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK) + { + if (strstr(face->texdef.GetName(), "caulk")) + continue; + } + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_BOTCLIP) + { + if (strstr(face->texdef.GetName(), "botclip") || strstr(face->texdef.GetName(), "clipmonster")) + continue; + } + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLIP) + { + if (strstr(face->texdef.GetName(), "clip")) + continue; + } + + if (nGLState & DRAW_GL_TEXTURE_2D && face->d_texture->name[0] == '(') + { + prev = NULL; + qglDisable(GL_TEXTURE_2D); + } + else if (nGLState & DRAW_GL_TEXTURE_2D && (nDrawMode == cd_texture || nDrawMode == cd_light) && face->d_texture != prev) + { + // set the texture for this face + prev = face->d_texture; + qglBindTexture( GL_TEXTURE_2D, face->d_texture->texture_number ); + } + + if (nGLState & DRAW_GL_LIGHTING && !g_PrefsDlg.m_bGLLighting) + { + if (!b->owner->eclass->fixedsize) + material[3] = transVal; + else + material[3] = 1; + VectorCopy(face->d_color, material); + + if (nGLState & DRAW_GL_TEXTURE_2D) + qglColor4f(face->d_shade, face->d_shade, face->d_shade, material[3]); + else + qglColor4fv(material); + } + else if (!b->owner->eclass->fixedsize) + { + pShader = face->pShader; + VectorCopy(pShader->getTexture()->color, material); + material[3] = identity[3] = transVal; + + if (nGLState & DRAW_GL_TEXTURE_2D) + qglColor4fv(identity); + else + qglColor4fv(material); + } + + // draw the polygon + + Brush_FaceDraw(face, nGLState); + } + qglPopClientAttrib(); +} + +void Face_Draw( face_t *f ) +{ + int i; + + if ( f->face_winding == 0 ) + return; + qglBegin(GL_POLYGON); + for ( i = 0 ; i < f->face_winding->numpoints; i++) + qglVertex3fv( f->face_winding->points[i] ); + qglEnd(); +} + +entity_t *FindEntity(const char *pszKey, const char *pszValue) +{ + entity_t *pe; + + pe = entities.next; + + for (; pe != NULL && pe != &entities ; pe = pe->next) + { + if (!strcmp(ValueForKey(pe, pszKey), pszValue)) + return pe; + } + + return NULL; +} + +void Brush_DrawXY(brush_t *b, int nViewType) +{ + face_t *face; + int order; + winding_t *w; + int i; + + if (b->patchBrush) + { + Patch_DrawXY(b->pPatch); + if (!g_bPatchShowBounds) + return; + } + + if (b->owner->eclass->fixedsize) + { + if (g_PrefsDlg.m_bNewLightDraw && (b->owner->eclass->nShowFlags & ECLASS_LIGHT)) + { +#if 1 // requires vertex arrays enabled + DrawLight(b->owner, DRAW_GL_WIRE, (IsBrushSelected(b)) ? g_PrefsDlg.m_nLightRadiuses : 0, nViewType); +#else + vec3_t vCorners[4]; + float fMid = b->mins[2] + (b->maxs[2] - b->mins[2]) / 2; + + vCorners[0][0] = b->mins[0]; + vCorners[0][1] = b->mins[1]; + vCorners[0][2] = fMid; + + vCorners[1][0] = b->mins[0]; + vCorners[1][1] = b->maxs[1]; + vCorners[1][2] = fMid; + + vCorners[2][0] = b->maxs[0]; + vCorners[2][1] = b->maxs[1]; + vCorners[2][2] = fMid; + + vCorners[3][0] = b->maxs[0]; + vCorners[3][1] = b->mins[1]; + vCorners[3][2] = fMid; + + vec3_t vTop, vBottom; + + vTop[0] = b->mins[0] + ((b->maxs[0] - b->mins[0]) / 2); + vTop[1] = b->mins[1] + ((b->maxs[1] - b->mins[1]) / 2); + vTop[2] = b->maxs[2]; + + VectorCopy(vTop, vBottom); + vBottom[2] = b->mins[2]; + + qglBegin(GL_LINES); + qglVertex3fv(vTop); + qglVertex3fv(vCorners[0]); + qglVertex3fv(vTop); + qglVertex3fv(vCorners[1]); + qglVertex3fv(vTop); + qglVertex3fv(vCorners[2]); + qglVertex3fv(vTop); + qglVertex3fv(vCorners[3]); + qglEnd(); + + qglBegin(GL_LINES); + qglVertex3fv(vBottom); + qglVertex3fv(vCorners[0]); + qglVertex3fv(vBottom); + qglVertex3fv(vCorners[1]); + qglVertex3fv(vBottom); + qglVertex3fv(vCorners[2]); + qglVertex3fv(vBottom); + qglVertex3fv(vCorners[3]); + qglEnd(); + + qglBegin(GL_LINE_LOOP); + qglVertex3fv(vCorners[0]); + qglVertex3fv(vCorners[1]); + qglVertex3fv(vCorners[2]); + qglVertex3fv(vCorners[3]); + qglEnd(); +#endif + DrawBrushEntityName (b); + return; + } + else if (b->owner->model.pRender && !(!IsBrushSelected(b) && (g_PrefsDlg.m_nEntityShowState & ENTITY_SELECTED_ONLY))) + { + qglPushAttrib(GL_CURRENT_BIT); // save brush colour + qglColor3fv(b->owner->eclass->color); + if( g_PrefsDlg.m_nEntityShowState != ENTITY_BOX ) + b->owner->model.pRender->Draw(DRAW_GL_WIRE, DRAW_RF_XY); + aabb_draw(b->owner->model.pRender->GetAABB(), DRAW_GL_WIRE); + qglPopAttrib(); + return; + } + //} + } + + for (face = b->brush_faces,order = 0 ; face ; face=face->next, order++) + { + // moved so check occurs earlier + w = face->face_winding; + if (!w) + continue; + // only draw polygons facing in a direction we care about + if (nViewType == XY) + { + if (face->plane.normal[2] <= 0) + continue; + } + else + { + if (nViewType == XZ) + { + if (face->plane.normal[1] >= 0) // stop axes being mirrored + continue; + } + else + { + if (face->plane.normal[0] <= 0) + continue; + } + } + + // draw the polygon + qglBegin(GL_LINE_LOOP); + for (i=0 ; inumpoints ; i++) + qglVertex3fv(w->points[i]); + qglEnd(); + } + + DrawBrushEntityName (b); + +} + +/* +============ +Brush_Move +============ +*/ +void Brush_Move (brush_t *b, const vec3_t move, bool bSnap) +{ + int i; + face_t *f; + + for (f=b->brush_faces ; f ; f=f->next) + for (i=0 ; i<3 ; i++) + VectorAdd (f->planepts[i], move, f->planepts[i]); + + if (g_PrefsDlg.m_bTextureLock && !b->owner->eclass->fixedsize) + { + for (f=b->brush_faces ; f ; f=f->next) + { + vec3_t vTemp; + VectorCopy(move, vTemp); + Face_MoveTexture(f, vTemp); + } + } + + Brush_Build( b, bSnap,true,false,false); // don't filter + + + if (b->patchBrush) + { + //Patch_Move(b->nPatchID, move); + Patch_Move(b->pPatch, move); + } + + + // PGM - keep the origin vector up to date on fixed size entities. + if(b->owner->eclass->fixedsize) + { + char text[64]; + VectorAdd(b->owner->origin, move, b->owner->origin); + sprintf (text, "%i %i %i", + (int)b->owner->origin[0], (int)b->owner->origin[1], (int)b->owner->origin[2]); + SetKeyValue(b->owner, "origin", text); + //VectorAdd(b->maxs, b->mins, b->owner->origin); + //VectorScale(b->owner->origin, 0.5, b->owner->origin); + } +} + + + +void Brush_Print(brush_t* b) +{ + int nFace = 0; + for (face_t* f = b->brush_faces ; f ; f=f->next) + { + Sys_Printf("Face %i\n", nFace++); + Sys_Printf("%f %f %f\n", f->planepts[0][0], f->planepts[0][1], f->planepts[0][2]); + Sys_Printf("%f %f %f\n", f->planepts[1][0], f->planepts[1][1], f->planepts[1][2]); + Sys_Printf("%f %f %f\n", f->planepts[2][0], f->planepts[2][1], f->planepts[2][2]); + } + } + + + +/* +============= +Brush_MakeSided + +Makes the current brushhave the given number of 2d sides and turns it into a cone +============= +*/ +void Brush_MakeSidedCone(int sides) +{ + int i; + vec3_t mins, maxs; + brush_t *b; + texdef_t *texdef; + face_t *f; + vec3_t mid; + float width; + float sv, cv; + + if (sides < 3 || sides > 32) + { + Sys_Status ("Bad sides number", 0); + return; + } + + if (!QE_SingleBrush ()) + { + Sys_Status ("Must have a single brush selected", 0 ); + return; + } + + b = selected_brushes.next; + VectorCopy (b->mins, mins); + VectorCopy (b->maxs, maxs); + texdef = &g_qeglobals.d_texturewin.texdef; + + Brush_Free (b); + + // find center of brush + width = 8; + for (i=0 ; i<2 ; i++) + { + mid[i] = (maxs[i] + mins[i])*0.5; + if (maxs[i] - mins[i] > width) + width = maxs[i] - mins[i]; + } + width /= 2; + + b = Brush_Alloc(); + + // create bottom face + f = Face_Alloc(); + f->texdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + f->planepts[0][0] = mins[0];f->planepts[0][1] = mins[1];f->planepts[0][2] = mins[2]; + f->planepts[1][0] = maxs[0];f->planepts[1][1] = mins[1];f->planepts[1][2] = mins[2]; + f->planepts[2][0] = maxs[0];f->planepts[2][1] = maxs[1];f->planepts[2][2] = mins[2]; + + for (i=0 ; itexdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + sv = sin (i*3.14159265*2/sides); + cv = cos (i*3.14159265*2/sides); + + + f->planepts[0][0] = floor(mid[0]+width*cv+0.5); + f->planepts[0][1] = floor(mid[1]+width*sv+0.5); + f->planepts[0][2] = mins[2]; + + f->planepts[1][0] = mid[0]; + f->planepts[1][1] = mid[1]; + f->planepts[1][2] = maxs[2]; + + f->planepts[2][0] = floor(f->planepts[0][0] - width * sv + 0.5); + f->planepts[2][1] = floor(f->planepts[0][1] + width * cv + 0.5); + f->planepts[2][2] = maxs[2]; + + } + + Brush_AddToList (b, &selected_brushes); + + Entity_LinkBrush (world_entity, b); + + Brush_Build( b ); + + Sys_UpdateWindows (W_ALL); +} + +/* +============= +Brush_MakeSided + +Makes the current brushhave the given number of 2d sides and turns it into a sphere +============= + +*/ +void Brush_MakeSidedSphere(int sides) +{ + int i,j; + vec3_t mins, maxs; + brush_t *b; + texdef_t *texdef; + face_t *f; + vec3_t mid; + + if (sides < 4 || sides > 32) + { + Sys_Status ("Bad sides number", 0); + return; + } + + if (!QE_SingleBrush ()) + { + Sys_Status ("Must have a single brush selected", 0 ); + return; + } + + b = selected_brushes.next; + VectorCopy (b->mins, mins); + VectorCopy (b->maxs, maxs); + texdef = &g_qeglobals.d_texturewin.texdef; + + Brush_Free (b); + + // find center of brush + float radius = 8; + for (i=0 ; i<2 ; i++) + { + mid[i] = (maxs[i] + mins[i])*0.5; + if (maxs[i] - mins[i] > radius) + radius = maxs[i] - mins[i]; + } + radius /= 2; + + b = Brush_Alloc(); + + float dt = float(2 * Q_PI / sides); + float dp = float(Q_PI / sides); + float t,p; + for(i=0; i <= sides-1; i++) + { + for(j=0;j <= sides-2; j++) + { + t = i * dt; + p = float(j * dp - Q_PI / 2); + + f = Face_Alloc(); + f->texdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorPolar(f->planepts[0], radius, t, p); + VectorPolar(f->planepts[1], radius, t, p + dp); + VectorPolar(f->planepts[2], radius, t + dt, p + dp); + + for (int k = 0; k < 3; k++) + VectorAdd(f->planepts[k], mid, f->planepts[k]); + } + } + + p = float((sides - 1) * dp - Q_PI / 2); + for(i = 0; i <= sides-1; i++) + { + t = i * dt; + + f = Face_Alloc(); + f->texdef = *texdef; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorPolar(f->planepts[0], radius, t, p); + VectorPolar(f->planepts[1], radius, t + dt, p + dp); + VectorPolar(f->planepts[2], radius, t + dt, p); + + for (int k = 0; k < 3; k++) + VectorAdd(f->planepts[k], mid, f->planepts[k]); + } + + Brush_AddToList (b, &selected_brushes); + + Entity_LinkBrush (world_entity, b); + + Brush_Build( b ); + + Sys_UpdateWindows (W_ALL); +} + +void Face_FitTexture( face_t * face, int nHeight, int nWidth ) +{ + winding_t *w; + vec3_t mins,maxs; + int i; + float width, height, temp; + float rot_width, rot_height; + float cosv,sinv,ang; + float min_t, min_s, max_t, max_s; + float s,t; + vec3_t vecs[2]; + vec3_t coords[4]; + texdef_t *td; + + if (nHeight < 1) + nHeight = 1; + if (nWidth < 1) + nWidth = 1; + + ClearBounds (mins, maxs); + + w = face->face_winding; + if (!w) + { + return; + } + for (i=0 ; inumpoints ; i++) + { + AddPointToBounds( w->points[i], mins, maxs ); + } + + if (g_qeglobals.m_bBrushPrimitMode) + Face_FitTexture_BrushPrimit( face, mins, maxs, nHeight, nWidth ); + else + { + + td = &face->texdef; + // + // get the current angle + // + ang = td->rotate / 180 * Q_PI; + sinv = sin(ang); + cosv = cos(ang); + + // get natural texture axis + TextureAxisFromPlane(&face->plane, vecs[0], vecs[1]); + + min_s = DotProduct( mins, vecs[0] ); + min_t = DotProduct( mins, vecs[1] ); + max_s = DotProduct( maxs, vecs[0] ); + max_t = DotProduct( maxs, vecs[1] ); + width = max_s - min_s; + height = max_t - min_t; + coords[0][0] = min_s; + coords[0][1] = min_t; + coords[1][0] = max_s; + coords[1][1] = min_t; + coords[2][0] = min_s; + coords[2][1] = max_t; + coords[3][0] = max_s; + coords[3][1] = max_t; + min_s = min_t = 99999; + max_s = max_t = -99999; + for (i=0; i<4; i++) + { + s = cosv * coords[i][0] - sinv * coords[i][1]; + t = sinv * coords[i][0] + cosv * coords[i][1]; + if (i&1) + { + if (s > max_s) + { + max_s = s; + } + } + else + { + if (s < min_s) + { + min_s = s; + } + if (i<2) + { + if (t < min_t) + { + min_t = t; + } + } + else + { + if (t > max_t) + { + max_t = t; } - count += winding.numpoints; } } } - - { - m_faceCentroidPoints.resize(m_faces.size()); - for(std::size_t i=0; iconstruct_centroid(); - m_faceCentroidPoints[i] = pointvertex_for_windingpoint(m_faces[i]->centroid(), colour_vertex); - } - } + rot_width = (max_s - min_s); + rot_height = (max_t - min_t); + td->scale[0] = -(rot_width/((float)(face->d_texture->width*nWidth))); + td->scale[1] = -(rot_height/((float)(face->d_texture->height*nHeight))); + + td->shift[0] = min_s/td->scale[0]; + temp = (int)(td->shift[0] / (face->d_texture->width*nWidth)); + temp = (temp+1)*face->d_texture->width*nWidth; + td->shift[0] = (int)(temp - td->shift[0])%(face->d_texture->width*nWidth); + + td->shift[1] = min_t/td->scale[1]; + temp = (int)(td->shift[1] / (face->d_texture->height*nHeight)); + temp = (temp+1)*(face->d_texture->height*nHeight); + td->shift[1] = (int)(temp - td->shift[1])%(face->d_texture->height*nHeight); + + td->shift[1] = min_t/td->scale[1]; + temp = (int)(td->shift[1] / (face->d_texture->height*nHeight)); + temp = (temp+1)*(face->d_texture->height*nHeight); + td->shift[1] = (int)(temp - td->shift[1])%(face->d_texture->height*nHeight); + } } - -class FaceFilterWrapper : public Filter +void Brush_FitTexture( brush_t *b, int nHeight, int nWidth ) { - FaceFilter& m_filter; - bool m_active; - bool m_invert; -public: - FaceFilterWrapper(FaceFilter& filter, bool invert) : - m_filter(filter), - m_invert(invert) - { - } - void setActive(bool active) - { - m_active = active; - } - bool active() - { - return m_active; - } - bool filter(const Face& face) - { - return m_invert ^ m_filter.filter(face); - } -}; + face_t *face; - -typedef std::list FaceFilters; -FaceFilters g_faceFilters; - -void add_face_filter(FaceFilter& filter, int mask, bool invert) -{ - g_faceFilters.push_back(FaceFilterWrapper(filter, invert)); - GlobalFilterSystem().addFilter(g_faceFilters.back(), mask); + for (face = b->brush_faces ; face ; face=face->next) + { + Face_FitTexture( face, nHeight, nWidth ); + } } -bool face_filtered(Face& face) +void aabb_draw(const aabb_t *aabb, int mode) { - for(FaceFilters::iterator i = g_faceFilters.begin(); i != g_faceFilters.end(); ++i) + vec3_t normals[6] = { { 1, 0, 0}, { 0, 1, 0 }, { 0, 0, 1 }, {-1, 0, 0}, { 0,-1, 0 }, { 0, 0,-1 } }; + vec3_t points[8]; + vec3_t vMin, vMax; + VectorSubtract(aabb->origin, aabb->extents, vMin); + VectorAdd(aabb->origin, aabb->extents, vMax); + VectorSet(points[0], vMin[0], vMax[1], vMax[2]); + VectorSet(points[1], vMax[0], vMax[1], vMax[2]); + VectorSet(points[2], vMax[0], vMin[1], vMax[2]); + VectorSet(points[3], vMin[0], vMin[1], vMax[2]); + VectorSet(points[4], vMin[0], vMax[1], vMin[2]); + VectorSet(points[5], vMax[0], vMax[1], vMin[2]); + VectorSet(points[6], vMax[0], vMin[1], vMin[2]); + VectorSet(points[7], vMin[0], vMin[1], vMin[2]); + + qglBegin(GL_QUADS); + + qglNormal3fv(normals[0]); + qglVertex3fv(points[2]); + qglVertex3fv(points[1]); + qglVertex3fv(points[5]); + qglVertex3fv(points[6]); + + qglNormal3fv(normals[1]); + qglVertex3fv(points[1]); + qglVertex3fv(points[0]); + qglVertex3fv(points[4]); + qglVertex3fv(points[5]); + + qglNormal3fv(normals[2]); + qglVertex3fv(points[0]); + qglVertex3fv(points[1]); + qglVertex3fv(points[2]); + qglVertex3fv(points[3]); + + qglNormal3fv(normals[3]); + qglVertex3fv(points[3]); + qglVertex3fv(points[7]); + qglVertex3fv(points[4]); + qglVertex3fv(points[0]); + + qglNormal3fv(normals[4]); + qglVertex3fv(points[3]); + qglVertex3fv(points[2]); + qglVertex3fv(points[6]); + qglVertex3fv(points[7]); + + qglNormal3fv(normals[5]); + qglVertex3fv(points[7]); + qglVertex3fv(points[6]); + qglVertex3fv(points[5]); + qglVertex3fv(points[4]); + + qglEnd(); + +/* + + + vec3_t Coords[8]; + + vec3_t vMin, vMax; + VectorSubtract(aabb->origin, aabb->extents, vMin); + VectorAdd(aabb->origin, aabb->extents, vMax); + VectorSet(Coords[0], vMin[0], vMax[1], vMax[2]); + VectorSet(Coords[1], vMax[0], vMax[1], vMax[2]); + VectorSet(Coords[2], vMax[0], vMin[1], vMax[2]); + VectorSet(Coords[3], vMin[0], vMin[1], vMax[2]); + VectorSet(Coords[4], vMin[0], vMax[1], vMin[2]); + VectorSet(Coords[5], vMax[0], vMax[1], vMin[2]); + VectorSet(Coords[6], vMax[0], vMin[1], vMin[2]); + VectorSet(Coords[7], vMin[0], vMin[1], vMin[2]); + + vec3_t Normals[8] = { {-1, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 1 }, + { 0, 0,-1 }, + { 0, 1, 0 }, + { 1, 0, 0 }, + { 0,-1, 0 } }; + + unsigned short Indices[24] = { 2, 1, 5, 6, + 1, 0, 4, 5, + 0, 1, 2, 3, + 3, 7, 4, 0, + 3, 2, 6, 7, + 7, 6, 5, 4 }; + + qglVertexPointer(3, GL_FLOAT, 0, Coords); // filling the arrays + qglNormalPointer(GL_FLOAT, 0, Normals); + + //glLockArraysEXT(0, count); // extension GL_EXT_compiled_vertex_array + + qglDrawElements(GL_QUADS, 24, GL_UNSIGNED_SHORT, Indices); + + //glUnlockArraysEXT; // extension GL_EXT_compiled_vertex_array +*/ +} + +qboolean IsBrushSelected(brush_t* bSel) +{ + for (brush_t* b = selected_brushes.next ;b != NULL && b != &selected_brushes; b = b->next) { - if((*i).active() && (*i).filter(face)) - { + if (b == bSel) return true; - } - } - return false; -} - - -class BrushFilterWrapper : public Filter -{ - bool m_active; - bool m_invert; - BrushFilter& m_filter; -public: - BrushFilterWrapper(BrushFilter& filter, bool invert) : m_invert(invert), m_filter(filter) - { - } - void setActive(bool active) - { - m_active = active; - } - bool active() - { - return m_active; - } - bool filter(const Brush& brush) - { - return m_invert ^ m_filter.filter(brush); - } -}; - - -typedef std::list BrushFilters; -BrushFilters g_brushFilters; - -void add_brush_filter(BrushFilter& filter, int mask, bool invert) -{ - g_brushFilters.push_back(BrushFilterWrapper(filter, invert)); - GlobalFilterSystem().addFilter(g_brushFilters.back(), mask); -} - -bool brush_filtered(Brush& brush) -{ - for(BrushFilters::iterator i = g_brushFilters.begin(); i != g_brushFilters.end(); ++i) - { - if((*i).active() && (*i).filter(brush)) - { - return true; - } } return false; } diff --git a/radiant/brush.h b/radiant/brush.h index 851a9836..08a5e057 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,4200 +19,71 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_BRUSH_H) -#define INCLUDED_BRUSH_H -/// \file -/// \brief The brush primitive. -/// -/// A collection of planes that define a convex polyhedron. -/// The Boundary-Representation of this primitive is a manifold polygonal mesh. -/// Each face polygon is represented by a list of vertices in a \c Winding. -/// Each vertex is associated with another face that is adjacent to the edge -/// formed by itself and the next vertex in the winding. This information can -/// be used to find edge-pairs and vertex-rings. - - -#include "debugging/debugging.h" - -#include "itexdef.h" -#include "iundo.h" -#include "iselection.h" -#include "irender.h" -#include "imap.h" -#include "ibrush.h" -#include "igl.h" -#include "ifilter.h" -#include "nameable.h" -#include "moduleobserver.h" - -#include - -#include "cullable.h" -#include "renderable.h" -#include "selectable.h" -#include "editable.h" -#include "mapfile.h" - -#include "math/frustum.h" -#include "selectionlib.h" -#include "render.h" -#include "texturelib.h" -#include "container/container.h" -#include "generic/bitfield.h" -#include "signal/signalfwd.h" - -#include "winding.h" -#include "brush_primit.h" - -const unsigned int BRUSH_DETAIL_FLAG = 27; -const unsigned int BRUSH_DETAIL_MASK = (1 << BRUSH_DETAIL_FLAG); - -enum EBrushType -{ - eBrushTypeQuake, - eBrushTypeQuake2, - eBrushTypeQuake3, - eBrushTypeQuake3BP, - eBrushTypeDoom3, - eBrushTypeQuake4, - eBrushTypeHalfLife, -}; - - -#define BRUSH_CONNECTIVITY_DEBUG 0 -#define BRUSH_DEGENERATE_DEBUG 0 - -template -inline TextOuputStreamType& ostream_write(TextOuputStreamType& ostream, const Matrix4& m) -{ - return ostream << "(" << m[0] << " " << m[1] << " " << m[2] << " " << m[3] << ", " - << m[4] << " " << m[5] << " " << m[6] << " " << m[7] << ", " - << m[8] << " " << m[9] << " " << m[10] << " " << m[11] << ", " - << m[12] << " " << m[13] << " " << m[14] << " " << m[15] << ")"; -} - -inline void print_vector3(const Vector3& v) -{ - globalOutputStream() << "( " << v.x() << " " << v.y() << " " << v.z() << " )\n"; -} - -inline void print_3x3(const Matrix4& m) -{ - globalOutputStream() << "( " << m.xx() << " " << m.xy() << " " << m.xz() << " ) " - << "( " << m.yx() << " " << m.yy() << " " << m.yz() << " ) " - << "( " << m.zx() << " " << m.zy() << " " << m.zz() << " )\n"; -} - - - -inline bool texdef_sane(const texdef_t& texdef) -{ - return fabs(texdef.shift[0]) < (1 << 16) - && fabs(texdef.shift[1]) < (1 << 16); -} - -inline void Winding_DrawWireframe(const Winding& winding) -{ - glVertexPointer(3, GL_FLOAT, sizeof(WindingVertex), &winding.points.data()->vertex); - glDrawArrays(GL_LINE_LOOP, 0, GLsizei(winding.numpoints)); -} - -inline void Winding_Draw(const Winding& winding, const Vector3& normal, RenderStateFlags state) -{ - glVertexPointer(3, GL_FLOAT, sizeof(WindingVertex), &winding.points.data()->vertex); - - if((state & RENDER_BUMP) != 0) - { - Vector3 normals[c_brush_maxFaces]; - typedef Vector3* Vector3Iter; - for(Vector3Iter i = normals, end = normals + winding.numpoints; i != end; ++i) - { - *i = normal; - } - if(GlobalShaderCache().useShaderLanguage()) - { - glNormalPointer(GL_FLOAT, sizeof(Vector3), normals); - glVertexAttribPointerARB(c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->texcoord); - glVertexAttribPointerARB(c_attr_Tangent, 3, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->tangent); - glVertexAttribPointerARB(c_attr_Binormal, 3, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->bitangent); - } - else - { - glVertexAttribPointerARB(11, 3, GL_FLOAT, 0, sizeof(Vector3), normals); - glVertexAttribPointerARB(8, 2, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->texcoord); - glVertexAttribPointerARB(9, 3, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->tangent); - glVertexAttribPointerARB(10, 3, GL_FLOAT, 0, sizeof(WindingVertex), &winding.points.data()->bitangent); - } - } - else - { - if (state & RENDER_LIGHTING) - { - Vector3 normals[c_brush_maxFaces]; - typedef Vector3* Vector3Iter; - for(Vector3Iter i = normals, last = normals + winding.numpoints; i != last; ++i) - { - *i = normal; - } - glNormalPointer(GL_FLOAT, sizeof(Vector3), normals); - } - - if (state & RENDER_TEXTURE) - { - glTexCoordPointer(2, GL_FLOAT, sizeof(WindingVertex), &winding.points.data()->texcoord); - } - } -#if 0 - if (state & RENDER_FILL) - { - glDrawArrays(GL_TRIANGLE_FAN, 0, GLsizei(winding.numpoints)); - } - else - { - glDrawArrays(GL_LINE_LOOP, 0, GLsizei(winding.numpoints)); - } -#else - glDrawArrays(GL_POLYGON, 0, GLsizei(winding.numpoints)); -#endif - -#if 0 - const Winding& winding = winding; - - if(state & RENDER_FILL) - { - glBegin(GL_POLYGON); - } - else - { - glBegin(GL_LINE_LOOP); - } - - if (state & RENDER_LIGHTING) - glNormal3fv(normal); - - for(int i = 0; i < winding.numpoints; ++i) - { - if (state & RENDER_TEXTURE) - glTexCoord2fv(&winding.points[i][3]); - glVertex3fv(winding.points[i]); - } - glEnd(); -#endif -} - - -#include "shaderlib.h" - -typedef DoubleVector3 PlanePoints[3]; - -inline bool planepts_equal(const PlanePoints planepts, const PlanePoints other) -{ - return planepts[0] == other[0] && planepts[1] == other[1] && planepts[2] == other[2]; -} - -inline void planepts_assign(PlanePoints planepts, const PlanePoints other) -{ - planepts[0] = other[0]; - planepts[1] = other[1]; - planepts[2] = other[2]; -} - -inline void planepts_quantise(PlanePoints planepts, double snap) -{ - vector3_snap(planepts[0], snap); - vector3_snap(planepts[1], snap); - vector3_snap(planepts[2], snap); -} - -inline float vector3_max_component(const Vector3& vec3) -{ - return std::max(fabsf(vec3[0]), std::max(fabsf(vec3[1]), fabsf(vec3[2]))); -} - -inline void edge_snap(Vector3& edge, double snap) -{ - float scale = static_cast(ceil(fabs(snap / vector3_max_component(edge)))); - if(scale > 0.0f) - { - vector3_scale(edge, scale); - } - vector3_snap(edge, snap); -} - -inline void planepts_snap(PlanePoints planepts, double snap) -{ - Vector3 edge01(vector3_subtracted(planepts[1], planepts[0])); - Vector3 edge12(vector3_subtracted(planepts[2], planepts[1])); - Vector3 edge20(vector3_subtracted(planepts[0], planepts[2])); - - double length_squared_01 = vector3_dot(edge01, edge01); - double length_squared_12 = vector3_dot(edge12, edge12); - double length_squared_20 = vector3_dot(edge20, edge20); - - vector3_snap(planepts[0], snap); - - if(length_squared_01 < length_squared_12) - { - if(length_squared_12 < length_squared_20) - { - edge_snap(edge01, snap); - edge_snap(edge12, snap); - planepts[1] = vector3_added(planepts[0], edge01); - planepts[2] = vector3_added(planepts[1], edge12); - } - else - { - edge_snap(edge20, snap); - edge_snap(edge01, snap); - planepts[1] = vector3_added(planepts[0], edge20); - planepts[2] = vector3_added(planepts[1], edge01); - } - } - else - { - if(length_squared_01 < length_squared_20) - { - edge_snap(edge01, snap); - edge_snap(edge12, snap); - planepts[1] = vector3_added(planepts[0], edge01); - planepts[2] = vector3_added(planepts[1], edge12); - } - else - { - edge_snap(edge12, snap); - edge_snap(edge20, snap); - planepts[1] = vector3_added(planepts[0], edge12); - planepts[2] = vector3_added(planepts[1], edge20); - } - } -} - -inline PointVertex pointvertex_for_planept(const DoubleVector3& point, const Colour4b& colour) -{ - return PointVertex( - Vertex3f( - static_cast(point.x()), - static_cast(point.y()), - static_cast(point.z()) - ), - colour - ); -} - -inline PointVertex pointvertex_for_windingpoint(const Vector3& point, const Colour4b& colour) -{ - return PointVertex( - vertex3f_for_vector3(point), - colour - ); -} - -inline bool check_plane_is_integer(const PlanePoints& planePoints) -{ - return !float_is_integer(planePoints[0][0]) - || !float_is_integer(planePoints[0][1]) - || !float_is_integer(planePoints[0][2]) - || !float_is_integer(planePoints[1][0]) - || !float_is_integer(planePoints[1][1]) - || !float_is_integer(planePoints[1][2]) - || !float_is_integer(planePoints[2][0]) - || !float_is_integer(planePoints[2][1]) - || !float_is_integer(planePoints[2][2]); -} - -inline void brush_check_shader(const char* name) -{ - if(!shader_valid(name)) - { - globalErrorStream() << "brush face has invalid texture name: '" << name << "'\n"; - } -} - -class FaceShaderObserver -{ -public: - virtual void realiseShader() = 0; - virtual void unrealiseShader() = 0; -}; - -class FaceShaderObserverRealise -{ -public: - void operator()(FaceShaderObserver& observer) const - { - observer.realiseShader(); - } -}; - -class FaceShaderObserverUnrealise -{ -public: - void operator()(FaceShaderObserver& observer) const - { - observer.unrealiseShader(); - } -}; - -typedef ReferencePair FaceShaderObserverPair; - - -class ContentsFlagsValue -{ -public: - ContentsFlagsValue() - { - } - ContentsFlagsValue(int surfaceFlags, int contentFlags, int value, bool specified) : - m_surfaceFlags(surfaceFlags), - m_contentFlags(contentFlags), - m_value(value), - m_specified(specified) - { - } - int m_surfaceFlags; - int m_contentFlags; - int m_value; - bool m_specified; -}; - -inline void ContentsFlagsValue_assignMasked(ContentsFlagsValue& flags, const ContentsFlagsValue& other) -{ - bool detail = bitfield_enabled(flags.m_contentFlags, BRUSH_DETAIL_MASK); - flags = other; - if(detail) - { - flags.m_contentFlags = bitfield_enable(flags.m_contentFlags, BRUSH_DETAIL_MASK); - } - else - { - flags.m_contentFlags = bitfield_disable(flags.m_contentFlags, BRUSH_DETAIL_MASK); - } -} - - -class FaceShader : public ModuleObserver -{ -public: - class SavedState - { - public: - CopiedString m_shader; - ContentsFlagsValue m_flags; - - SavedState(const FaceShader& faceShader) - { - m_shader = faceShader.getShader(); - m_flags = faceShader.m_flags; - } - - void exportState(FaceShader& faceShader) const - { - faceShader.setShader(m_shader.c_str()); - faceShader.setFlags(m_flags); - } - }; - - CopiedString m_shader; - Shader* m_state; - ContentsFlagsValue m_flags; - FaceShaderObserverPair m_observers; - bool m_instanced; - bool m_realised; - - FaceShader(const char* shader, const ContentsFlagsValue& flags = ContentsFlagsValue(0, 0, 0, false)) : - m_shader(shader), - m_state(0), - m_flags(flags), - m_instanced(false), - m_realised(false) - { - captureShader(); - } - ~FaceShader() - { - releaseShader(); - } - // copy-construction not supported - FaceShader(const FaceShader& other); - - void instanceAttach() - { - m_instanced = true; - m_state->incrementUsed(); - } - void instanceDetach() - { - m_state->decrementUsed(); - m_instanced = false; - } - - void captureShader() - { - ASSERT_MESSAGE(m_state == 0, "shader cannot be captured"); - brush_check_shader(m_shader.c_str()); - m_state = GlobalShaderCache().capture(m_shader.c_str()); - m_state->attach(*this); - } - void releaseShader() - { - ASSERT_MESSAGE(m_state != 0, "shader cannot be released"); - m_state->detach(*this); - GlobalShaderCache().release(m_shader.c_str()); - m_state = 0; - } - - void realise() - { - ASSERT_MESSAGE(!m_realised, "FaceTexdef::realise: already realised"); - m_realised = true; - m_observers.forEach(FaceShaderObserverRealise()); - } - void unrealise() - { - ASSERT_MESSAGE(m_realised, "FaceTexdef::unrealise: already unrealised"); - m_observers.forEach(FaceShaderObserverUnrealise()); - m_realised = false; - } - - void attach(FaceShaderObserver& observer) - { - m_observers.attach(observer); - if(m_realised) - { - observer.realiseShader(); - } - } - - void detach(FaceShaderObserver& observer) - { - if(m_realised) - { - observer.unrealiseShader(); - } - m_observers.detach(observer); - } - - const char* getShader() const - { - return m_shader.c_str(); - } - void setShader(const char* name) - { - if(m_instanced) - { - m_state->decrementUsed(); - } - releaseShader(); - m_shader = name; - captureShader(); - if(m_instanced) - { - m_state->incrementUsed(); - } - } - ContentsFlagsValue getFlags() const - { - ASSERT_MESSAGE(m_realised, "FaceShader::getFlags: flags not valid when unrealised"); - if(!m_flags.m_specified) - { - return ContentsFlagsValue( - m_state->getTexture().surfaceFlags, - m_state->getTexture().contentFlags, - m_state->getTexture().value, - true - ); - } - return m_flags; - } - void setFlags(const ContentsFlagsValue& flags) - { - ASSERT_MESSAGE(m_realised, "FaceShader::setFlags: flags not valid when unrealised"); - ContentsFlagsValue_assignMasked(m_flags, flags); - } - - Shader* state() const - { - return m_state; - } - - std::size_t width() const - { - if(m_realised) - { - return m_state->getTexture().width; - } - return 1; - } - std::size_t height() const - { - if(m_realised) - { - return m_state->getTexture().height; - } - return 1; - } - unsigned int shaderFlags() const - { - if(m_realised) - { - return m_state->getFlags(); - } - return 0; - } -}; - - - - -class FaceTexdef : public FaceShaderObserver -{ - // not copyable - FaceTexdef(const FaceTexdef& other); - // not assignable - FaceTexdef& operator=(const FaceTexdef& other); -public: - class SavedState - { - public: - TextureProjection m_projection; - - SavedState(const FaceTexdef& faceTexdef) - { - m_projection = faceTexdef.m_projection; - } - - void exportState(FaceTexdef& faceTexdef) const - { - Texdef_Assign(faceTexdef.m_projection, m_projection); - } - }; - - FaceShader& m_shader; - TextureProjection m_projection; - bool m_projectionInitialised; - bool m_scaleApplied; - - FaceTexdef( - FaceShader& shader, - const TextureProjection& projection, - bool projectionInitialised = true - ) : - m_shader(shader), - m_projection(projection), - m_projectionInitialised(projectionInitialised), - m_scaleApplied(false) - { - m_shader.attach(*this); - } - ~FaceTexdef() - { - m_shader.detach(*this); - } - - void addScale() - { - ASSERT_MESSAGE(!m_scaleApplied, "texture scale aready added"); - m_scaleApplied = true; - m_projection.m_brushprimit_texdef.addScale(m_shader.width(), m_shader.height()); - } - void removeScale() - { - ASSERT_MESSAGE(m_scaleApplied, "texture scale aready removed"); - m_scaleApplied = false; - m_projection.m_brushprimit_texdef.removeScale(m_shader.width(), m_shader.height()); - } - - void realiseShader() - { - if(m_projectionInitialised && !m_scaleApplied) - { - addScale(); - } - } - void unrealiseShader() - { - if(m_projectionInitialised && m_scaleApplied) - { - removeScale(); - } - } - - void setTexdef(const TextureProjection& projection) - { - removeScale(); - Texdef_Assign(m_projection, projection); - addScale(); - } - - void shift(float s, float t) - { - ASSERT_MESSAGE(texdef_sane(m_projection.m_texdef), "FaceTexdef::shift: bad texdef"); - removeScale(); - Texdef_Shift(m_projection, s, t); - addScale(); - } - - void scale(float s, float t) - { - removeScale(); - Texdef_Scale(m_projection, s, t); - addScale(); - } - - void rotate(float angle) - { - removeScale(); - Texdef_Rotate(m_projection, angle); - addScale(); - } - - void fit(const Vector3& normal, const Winding& winding, float s_repeat, float t_repeat) - { - Texdef_FitTexture(m_projection, m_shader.width(), m_shader.height(), normal, winding, s_repeat, t_repeat); - } - - void emitTextureCoordinates(Winding& winding, const Vector3& normal, const Matrix4& localToWorld) - { - Texdef_EmitTextureCoordinates(m_projection, m_shader.width(), m_shader.height(), winding, normal, localToWorld); - } - - void transform(const Plane3& plane, const Matrix4& matrix) - { - removeScale(); - Texdef_transformLocked(m_projection, m_shader.width(), m_shader.height(), plane, matrix); - addScale(); - } - - TextureProjection normalised() const - { - brushprimit_texdef_t tmp(m_projection.m_brushprimit_texdef); - tmp.removeScale(m_shader.width(), m_shader.height()); - return TextureProjection(m_projection.m_texdef, tmp, m_projection.m_basis_s, m_projection.m_basis_t); - } - void setBasis(const Vector3& normal) - { - Matrix4 basis; - Normal_GetTransform(normal, basis); - m_projection.m_basis_s = Vector3(basis.xx(), basis.yx(), basis.zx()); - m_projection.m_basis_t = Vector3(-basis.xy(), -basis.yy(), -basis.zy()); - } -}; - -inline void planepts_print(const PlanePoints& planePoints, TextOutputStream& ostream) -{ - ostream << "( " << planePoints[0][0] << " " << planePoints[0][1] << " " << planePoints[0][2] << " ) " - << "( " << planePoints[1][0] << " " << planePoints[1][1] << " " << planePoints[1][2] << " ) " - << "( " << planePoints[2][0] << " " << planePoints[2][1] << " " << planePoints[2][2] << " )"; -} - - -inline Plane3 Plane3_applyTranslation(const Plane3& plane, const Vector3& translation) -{ - Plane3 tmp(plane3_translated(Plane3(plane.normal(), -plane.dist()), translation)); - return Plane3(tmp.normal(), -tmp.dist()); -} - -inline Plane3 Plane3_applyTransform(const Plane3& plane, const Matrix4& matrix) -{ - Plane3 tmp(plane3_transformed(Plane3(plane.normal(), -plane.dist()), matrix)); - return Plane3(tmp.normal(), -tmp.dist()); -} - -class FacePlane -{ - PlanePoints m_planepts; - Plane3 m_planeCached; - Plane3 m_plane; -public: - Vector3 m_funcStaticOrigin; - - static EBrushType m_type; - - static bool isDoom3Plane() - { - return FacePlane::m_type == eBrushTypeDoom3 || FacePlane::m_type == eBrushTypeQuake4; - } - - class SavedState - { - public: - PlanePoints m_planepts; - Plane3 m_plane; - - SavedState(const FacePlane& facePlane) - { - if(facePlane.isDoom3Plane()) - { - m_plane = facePlane.m_plane; - } - else - { - planepts_assign(m_planepts, facePlane.planePoints()); - } - } - - void exportState(FacePlane& facePlane) const - { - if(facePlane.isDoom3Plane()) - { - facePlane.m_plane = m_plane; - facePlane.updateTranslated(); - } - else - { - planepts_assign(facePlane.planePoints(), m_planepts); - facePlane.MakePlane(); - } - } - }; - - FacePlane() : m_funcStaticOrigin(0, 0, 0) - { - } - FacePlane(const FacePlane& other) : m_funcStaticOrigin(0, 0, 0) - { - if(!isDoom3Plane()) - { - planepts_assign(m_planepts, other.m_planepts); - MakePlane(); - } - else - { - m_plane = other.m_plane; - updateTranslated(); - } - } - - void MakePlane() - { - if(!isDoom3Plane()) - { -#if 0 - if(check_plane_is_integer(m_planepts)) - { - globalErrorStream() << "non-integer planepts: "; - planepts_print(m_planepts, globalErrorStream()); - globalErrorStream() << "\n"; - } -#endif - m_planeCached = plane3_for_points(m_planepts); - } - } - - void reverse() - { - if(!isDoom3Plane()) - { - vector3_swap(m_planepts[0], m_planepts[2]); - MakePlane(); - } - else - { - m_planeCached = plane3_flipped(m_plane); - updateSource(); - } - } - void transform(const Matrix4& matrix, bool mirror) - { - if(!isDoom3Plane()) - { - -#if 0 - bool off = check_plane_is_integer(planePoints()); -#endif - - matrix4_transform_point(matrix, m_planepts[0]); - matrix4_transform_point(matrix, m_planepts[1]); - matrix4_transform_point(matrix, m_planepts[2]); - - if(mirror) - { - reverse(); - } - -#if 0 - if(check_plane_is_integer(planePoints())) - { - if(!off) - { - globalErrorStream() << "caused by transform\n"; - } - } -#endif - MakePlane(); - } - else - { - m_planeCached = Plane3_applyTransform(m_planeCached, matrix); - updateSource(); - } - } - void offset(float offset) - { - if(!isDoom3Plane()) - { - Vector3 move(vector3_scaled(m_planeCached.normal(), -offset)); - - vector3_subtract(m_planepts[0], move); - vector3_subtract(m_planepts[1], move); - vector3_subtract(m_planepts[2], move); - - MakePlane(); - } - else - { - m_planeCached.d += offset; - updateSource(); - } - } - - void updateTranslated() - { - m_planeCached = Plane3_applyTranslation(m_plane, m_funcStaticOrigin); - } - void updateSource() - { - m_plane = Plane3_applyTranslation(m_planeCached, vector3_negated(m_funcStaticOrigin)); - } - - - PlanePoints& planePoints() - { - return m_planepts; - } - const PlanePoints& planePoints() const - { - return m_planepts; - } - const Plane3& plane3() const - { - return m_planeCached; - } - void setDoom3Plane(const Plane3& plane) - { - m_plane = plane; - updateTranslated(); - } - const Plane3& getDoom3Plane() const - { - return m_plane; - } - - void copy(const FacePlane& other) - { - if(!isDoom3Plane()) - { - planepts_assign(m_planepts, other.m_planepts); - MakePlane(); - } - else - { - m_planeCached = other.m_plane; - updateSource(); - } - } - void copy(const Vector3& p0, const Vector3& p1, const Vector3& p2) - { - if(!isDoom3Plane()) - { - m_planepts[0] = p0; - m_planepts[1] = p1; - m_planepts[2] = p2; - MakePlane(); - } - else - { - m_planeCached = plane3_for_points(p2, p1, p0); - updateSource(); - } - } -}; - -inline void Winding_testSelect(Winding& winding, SelectionTest& test, SelectionIntersection& best) -{ - test.TestPolygon(VertexPointer(reinterpret_cast(&winding.points.data()->vertex), sizeof(WindingVertex)), winding.numpoints, best); -} - -const double GRID_MIN = 0.125; - -inline double quantiseInteger(double f) -{ - return float_to_integer(f); -} - -inline double quantiseFloating(double f) -{ - return float_snapped(f, 1.f / (1 << 16)); -} - -typedef double (*QuantiseFunc)(double f); - -class Face; - -class FaceFilter -{ -public: - virtual bool filter(const Face& face) const = 0; -}; - -bool face_filtered(Face& face); -void add_face_filter(FaceFilter& filter, int mask, bool invert = false); - -void Brush_addTextureChangedCallback(const SignalHandler& callback); -void Brush_textureChanged(); - - -extern bool g_brush_texturelock_enabled; - -class FaceObserver -{ -public: - virtual void planeChanged() = 0; - virtual void connectivityChanged() = 0; - virtual void shaderChanged() = 0; - virtual void evaluateTransform() = 0; -}; - -class Face : -public OpenGLRenderable, -public Filterable, -public Undoable, -public FaceShaderObserver -{ - std::size_t m_refcount; - - class SavedState : public UndoMemento - { - public: - FacePlane::SavedState m_planeState; - FaceTexdef::SavedState m_texdefState; - FaceShader::SavedState m_shaderState; - - SavedState(const Face& face) : m_planeState(face.getPlane()), m_texdefState(face.getTexdef()), m_shaderState(face.getShader()) - { - } - - void exportState(Face& face) const - { - m_planeState.exportState(face.getPlane()); - m_shaderState.exportState(face.getShader()); - m_texdefState.exportState(face.getTexdef()); - } - - void release() - { - delete this; - } - }; - -public: - static QuantiseFunc m_quantise; - static EBrushType m_type; - - PlanePoints m_move_planepts; - PlanePoints m_move_planeptsTransformed; -private: - FacePlane m_plane; - FacePlane m_planeTransformed; - FaceShader m_shader; - FaceTexdef m_texdef; - TextureProjection m_texdefTransformed; - - Winding m_winding; - Vector3 m_centroid; - bool m_filtered; - - FaceObserver* m_observer; - UndoObserver* m_undoable_observer; - MapFile* m_map; - - // assignment not supported - Face& operator=(const Face& other); - // copy-construction not supported - Face(const Face& other); - -public: - - Face(FaceObserver* observer) : - m_refcount(0), - m_shader(texdef_name_default()), - m_texdef(m_shader, TextureProjection(), false), - m_filtered(false), - m_observer(observer), - m_undoable_observer(0), - m_map(0) - { - m_shader.attach(*this); - m_plane.copy(Vector3(0, 0, 0), Vector3(64, 0, 0), Vector3(0, 64, 0)); - m_texdef.setBasis(m_plane.plane3().normal()); - planeChanged(); - } - Face( - const Vector3& p0, - const Vector3& p1, - const Vector3& p2, - const char* shader, - const TextureProjection& projection, - FaceObserver* observer - ) : - m_refcount(0), - m_shader(shader), - m_texdef(m_shader, projection), - m_observer(observer), - m_undoable_observer(0), - m_map(0) - { - m_shader.attach(*this); - m_plane.copy(p0, p1, p2); - m_texdef.setBasis(m_plane.plane3().normal()); - planeChanged(); - updateFiltered(); - } - Face(const Face& other, FaceObserver* observer) : - m_refcount(0), - m_shader(other.m_shader.getShader(), other.m_shader.m_flags), - m_texdef(m_shader, other.getTexdef().normalised()), - m_observer(observer), - m_undoable_observer(0), - m_map(0) - { - m_shader.attach(*this); - m_plane.copy(other.m_plane); - planepts_assign(m_move_planepts, other.m_move_planepts); - m_texdef.setBasis(m_plane.plane3().normal()); - planeChanged(); - updateFiltered(); - } - ~Face() - { - m_shader.detach(*this); - } - - void planeChanged() - { - revertTransform(); - m_observer->planeChanged(); - } - - void realiseShader() - { - m_observer->shaderChanged(); - } - void unrealiseShader() - { - } - - void instanceAttach(MapFile* map) - { - m_shader.instanceAttach(); - m_map = map; - m_undoable_observer = GlobalUndoSystem().observer(this); - GlobalFilterSystem().registerFilterable(*this); - } - void instanceDetach(MapFile* map) - { - GlobalFilterSystem().unregisterFilterable(*this); - m_undoable_observer = 0; - GlobalUndoSystem().release(this); - m_map = 0; - m_shader.instanceDetach(); - } - - void render(RenderStateFlags state) const - { - Winding_Draw(m_winding, m_planeTransformed.plane3().normal(), state); - } - - void updateFiltered() - { - m_filtered = face_filtered(*this); - } - bool isFiltered() const - { - return m_filtered; - } - - void undoSave() - { - if(m_map != 0) - { - m_map->changed(); - } - if(m_undoable_observer != 0) - { - m_undoable_observer->save(this); - } - } - - // undoable - UndoMemento* exportState() const - { - return new SavedState(*this); - } - void importState(const UndoMemento* data) - { - undoSave(); - - static_cast(data)->exportState(*this); - - planeChanged(); - m_observer->connectivityChanged(); - texdefChanged(); - m_observer->shaderChanged(); - updateFiltered(); - } - - void IncRef() - { - ++m_refcount; - } - void DecRef() - { - if(--m_refcount == 0) - delete this; - } - - void flipWinding() - { - m_plane.reverse(); - planeChanged(); - } - - bool intersectVolume(const VolumeTest& volume, const Matrix4& localToWorld) const - { - return volume.TestPlane(Plane3(plane3().normal(), -plane3().dist()), localToWorld); - } - - void render(Renderer& renderer, const Matrix4& localToWorld) const - { - renderer.SetState(m_shader.state(), Renderer::eFullMaterials); - renderer.addRenderable(*this, localToWorld); - } - - void transform(const Matrix4& matrix, bool mirror) - { - if(g_brush_texturelock_enabled) - { - Texdef_transformLocked(m_texdefTransformed, m_shader.width(), m_shader.height(), m_plane.plane3(), matrix); - } - - m_planeTransformed.transform(matrix, mirror); - -#if 0 - ASSERT_MESSAGE(projectionaxis_for_normal(normal) == projectionaxis_for_normal(plane3().normal()), "bleh"); -#endif - m_observer->planeChanged(); - } - - void assign_planepts(const PlanePoints planepts) - { - m_planeTransformed.copy(planepts[0], planepts[1], planepts[2]); - m_observer->planeChanged(); - } - - /// \brief Reverts the transformable state of the brush to identity. - void revertTransform() - { - m_planeTransformed = m_plane; - planepts_assign(m_move_planeptsTransformed, m_move_planepts); - m_texdefTransformed = m_texdef.m_projection; - } - void freezeTransform() - { - undoSave(); - m_plane = m_planeTransformed; - planepts_assign(m_move_planepts, m_move_planeptsTransformed); - m_texdef.m_projection = m_texdefTransformed; - } - - void update_move_planepts_vertex(std::size_t index, PlanePoints planePoints) - { - std::size_t numpoints = getWinding().numpoints; - ASSERT_MESSAGE(index < numpoints, "update_move_planepts_vertex: invalid index"); - - std::size_t opposite = Winding_Opposite(getWinding(), index); - std::size_t adjacent = Winding_wrap(getWinding(), opposite+numpoints-1); - planePoints[0] = getWinding()[opposite].vertex; - planePoints[1] = getWinding()[index].vertex; - planePoints[2] = getWinding()[adjacent].vertex; - // winding points are very inaccurate, so they must be quantised before using them to generate the face-plane - planepts_quantise(planePoints, GRID_MIN); - } - - void snapto(float snap) - { - if(contributes()) - { -#if 0 - ASSERT_MESSAGE(plane3_valid(m_plane.plane3()), "invalid plane before snap to grid"); - planepts_snap(m_plane.planePoints(), snap); - ASSERT_MESSAGE(plane3_valid(m_plane.plane3()), "invalid plane after snap to grid"); -#else - PlanePoints planePoints; - update_move_planepts_vertex(0, planePoints); - vector3_snap(planePoints[0], snap); - vector3_snap(planePoints[1], snap); - vector3_snap(planePoints[2], snap); - assign_planepts(planePoints); - freezeTransform(); -#endif - SceneChangeNotify(); - if(!plane3_valid(m_plane.plane3())) - { - globalErrorStream() << "WARNING: invalid plane after snap to grid\n"; - } - } - } - - void testSelect(SelectionTest& test, SelectionIntersection& best) - { - Winding_testSelect(m_winding, test, best); - } - - void testSelect_centroid(SelectionTest& test, SelectionIntersection& best) - { - test.TestPoint(m_centroid, best); - } - - void shaderChanged() - { - EmitTextureCoordinates(); - Brush_textureChanged(); - m_observer->shaderChanged(); - updateFiltered(); - planeChanged(); - SceneChangeNotify(); - } - - const char* GetShader() const - { - return m_shader.getShader(); - } - void SetShader(const char* name) - { - undoSave(); - m_shader.setShader(name); - shaderChanged(); - } - - void revertTexdef() - { - m_texdefTransformed = m_texdef.m_projection; - } - void texdefChanged() - { - revertTexdef(); - EmitTextureCoordinates(); - Brush_textureChanged(); - } - - void GetTexdef(TextureProjection& projection) const - { - projection = m_texdef.normalised(); - } - void SetTexdef(const TextureProjection& projection) - { - undoSave(); - m_texdef.setTexdef(projection); - texdefChanged(); - } - - void GetFlags(ContentsFlagsValue& flags) const - { - flags = m_shader.getFlags(); - } - void SetFlags(const ContentsFlagsValue& flags) - { - undoSave(); - m_shader.setFlags(flags); - m_observer->shaderChanged(); - updateFiltered(); - } - - void ShiftTexdef(float s, float t) - { - undoSave(); - m_texdef.shift(s, t); - texdefChanged(); - } - - void ScaleTexdef(float s, float t) - { - undoSave(); - m_texdef.scale(s, t); - texdefChanged(); - } - - void RotateTexdef(float angle) - { - undoSave(); - m_texdef.rotate(angle); - texdefChanged(); - } - - void FitTexture(float s_repeat, float t_repeat) - { - undoSave(); - m_texdef.fit(m_plane.plane3().normal(), m_winding, s_repeat, t_repeat); - texdefChanged(); - } - - void EmitTextureCoordinates() - { - Texdef_EmitTextureCoordinates(m_texdefTransformed, m_shader.width(), m_shader.height(), m_winding, plane3().normal(), g_matrix4_identity); - } - - - const Vector3& centroid() const - { - return m_centroid; - } - - void construct_centroid() - { - Winding_Centroid(m_winding, plane3(), m_centroid); - } - - const Winding& getWinding() const - { - return m_winding; - } - Winding& getWinding() - { - return m_winding; - } - - const Plane3& plane3() const - { - m_observer->evaluateTransform(); - return m_planeTransformed.plane3(); - } - FacePlane& getPlane() - { - return m_plane; - } - const FacePlane& getPlane() const - { - return m_plane; - } - FaceTexdef& getTexdef() - { - return m_texdef; - } - const FaceTexdef& getTexdef() const - { - return m_texdef; - } - FaceShader& getShader() - { - return m_shader; - } - const FaceShader& getShader() const - { - return m_shader; - } - - bool isDetail() const - { - return (m_shader.m_flags.m_contentFlags & BRUSH_DETAIL_MASK) != 0; - } - void setDetail(bool detail) - { - undoSave(); - if(detail && !isDetail()) - { - m_shader.m_flags.m_contentFlags |= BRUSH_DETAIL_MASK; - } - else if(!detail && isDetail()) - { - m_shader.m_flags.m_contentFlags &= ~BRUSH_DETAIL_MASK; - } - m_observer->shaderChanged(); - } - - bool contributes() const - { - return m_winding.numpoints > 2; - } - bool is_bounded() const - { - for(Winding::const_iterator i = m_winding.begin(); i != m_winding.end(); ++i) - { - if((*i).adjacent == c_brush_maxFaces) - { - return false; - } - } - return true; - } -}; - - -class FaceVertexId -{ - std::size_t m_face; - std::size_t m_vertex; - -public: - FaceVertexId(std::size_t face, std::size_t vertex) - : m_face(face), m_vertex(vertex) - { - } - - std::size_t getFace() const - { - return m_face; - } - std::size_t getVertex() const - { - return m_vertex; - } -}; - -typedef std::size_t faceIndex_t; - -struct EdgeRenderIndices -{ - RenderIndex first; - RenderIndex second; - - EdgeRenderIndices() - : first(0), second(0) - { - } - EdgeRenderIndices(const RenderIndex _first, const RenderIndex _second) - : first(_first), second(_second) - { - } -}; - -struct EdgeFaces -{ - faceIndex_t first; - faceIndex_t second; - - EdgeFaces() - : first(c_brush_maxFaces), second(c_brush_maxFaces) - { - } - EdgeFaces(const faceIndex_t _first, const faceIndex_t _second) - : first(_first), second(_second) - { - } -}; - -class RenderableWireframe : public OpenGLRenderable -{ -public: - void render(RenderStateFlags state) const - { -#if 1 - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices->colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices->vertex); - glDrawElements(GL_LINES, GLsizei(m_size<<1), RenderIndexTypeID, m_faceVertex.data()); -#else - glBegin(GL_LINES); - for(std::size_t i = 0; i < m_size; ++i) - { - glVertex3fv(&m_vertices[m_faceVertex[i].first].vertex.x); - glVertex3fv(&m_vertices[m_faceVertex[i].second].vertex.x); - } - glEnd(); -#endif - } - - Array m_faceVertex; - std::size_t m_size; - const PointVertex* m_vertices; -}; - -class Brush; -typedef std::vector brush_vector_t; - -class BrushFilter -{ -public: - virtual bool filter(const Brush& brush) const = 0; -}; - -bool brush_filtered(Brush& brush); -void add_brush_filter(BrushFilter& filter, int mask, bool invert = false); - - -/// \brief Returns true if 'self' takes priority when building brush b-rep. -inline bool plane3_inside(const Plane3& self, const Plane3& other) -{ - if(vector3_equal_epsilon(self.normal(), other.normal(), 0.001)) - { - return self.dist() < other.dist(); - } - return true; -} - -typedef SmartPointer FaceSmartPointer; -typedef std::vector Faces; - -/// \brief Returns the unique-id of the edge adjacent to \p faceVertex in the edge-pair for the set of \p faces. -inline FaceVertexId next_edge(const Faces& faces, FaceVertexId faceVertex) -{ - std::size_t adjacent_face = faces[faceVertex.getFace()]->getWinding()[faceVertex.getVertex()].adjacent; - std::size_t adjacent_vertex = Winding_FindAdjacent(faces[adjacent_face]->getWinding(), faceVertex.getFace()); - - ASSERT_MESSAGE(adjacent_vertex != c_brush_maxFaces, "connectivity data invalid"); - if(adjacent_vertex == c_brush_maxFaces) - { - return faceVertex; - } - - return FaceVertexId(adjacent_face, adjacent_vertex); -} - -/// \brief Returns the unique-id of the vertex adjacent to \p faceVertex in the vertex-ring for the set of \p faces. -inline FaceVertexId next_vertex(const Faces& faces, FaceVertexId faceVertex) -{ - FaceVertexId nextEdge = next_edge(faces, faceVertex); - return FaceVertexId(nextEdge.getFace(), Winding_next(faces[nextEdge.getFace()]->getWinding(), nextEdge.getVertex())); -} - -class SelectableEdge -{ - Vector3 getEdge() const - { - const Winding& winding = getFace().getWinding(); - return vector3_mid(winding[m_faceVertex.getVertex()].vertex, winding[Winding_next(winding, m_faceVertex.getVertex())].vertex); - } - -public: - Faces& m_faces; - FaceVertexId m_faceVertex; - - SelectableEdge(Faces& faces, FaceVertexId faceVertex) - : m_faces(faces), m_faceVertex(faceVertex) - { - } - SelectableEdge& operator=(const SelectableEdge& other) - { - m_faceVertex = other.m_faceVertex; - return *this; - } - - Face& getFace() const - { - return *m_faces[m_faceVertex.getFace()]; - } - - void testSelect(SelectionTest& test, SelectionIntersection& best) - { - test.TestPoint(getEdge(), best); - } -}; - -class SelectableVertex -{ - Vector3 getVertex() const - { - return getFace().getWinding()[m_faceVertex.getVertex()].vertex; - } - -public: - Faces& m_faces; - FaceVertexId m_faceVertex; - - SelectableVertex(Faces& faces, FaceVertexId faceVertex) - : m_faces(faces), m_faceVertex(faceVertex) - { - } - SelectableVertex& operator=(const SelectableVertex& other) - { - m_faceVertex = other.m_faceVertex; - return *this; - } - - Face& getFace() const - { - return *m_faces[m_faceVertex.getFace()]; - } - - void testSelect(SelectionTest& test, SelectionIntersection& best) - { - test.TestPoint(getVertex(), best); - } -}; - -class BrushObserver -{ -public: - virtual void reserve(std::size_t size) = 0; - virtual void clear() = 0; - virtual void push_back(Face& face) = 0; - virtual void pop_back() = 0; - virtual void erase(std::size_t index) = 0; - virtual void connectivityChanged() = 0; - - virtual void edge_clear() = 0; - virtual void edge_push_back(SelectableEdge& edge) = 0; - - virtual void vertex_clear() = 0; - virtual void vertex_push_back(SelectableVertex& vertex) = 0; - - virtual void DEBUG_verify() const = 0; -}; - -class BrushVisitor -{ -public: - virtual void visit(Face& face) const = 0; -}; - -class Brush : - public TransformNode, - public Bounded, - public Cullable, - public Snappable, - public Undoable, - public FaceObserver, - public Filterable, - public Nameable, - public BrushDoom3 -{ -private: - scene::Node* m_node; - typedef UniqueSet Observers; - Observers m_observers; - UndoObserver* m_undoable_observer; - MapFile* m_map; - - // state - Faces m_faces; - // ---- - - // cached data compiled from state - Array m_faceCentroidPoints; - RenderablePointArray m_render_faces; - - Array m_uniqueVertexPoints; - typedef std::vector SelectableVertices; - SelectableVertices m_select_vertices; - RenderablePointArray m_render_vertices; - - Array m_uniqueEdgePoints; - typedef std::vector SelectableEdges; - SelectableEdges m_select_edges; - RenderablePointArray m_render_edges; - - Array m_edge_indices; - Array m_edge_faces; - - AABB m_aabb_local; - // ---- - - Callback m_evaluateTransform; - Callback m_boundsChanged; - - mutable bool m_planeChanged; // b-rep evaluation required - mutable bool m_transformChanged; // transform evaluation required - // ---- - -public: - STRING_CONSTANT(Name, "Brush"); - - Callback m_lightsChanged; - - // static data - static Shader* m_state_point; - // ---- - - static EBrushType m_type; - static double m_maxWorldCoord; - - Brush(scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged) : - m_node(&node), - m_undoable_observer(0), - m_map(0), - m_render_faces(m_faceCentroidPoints, GL_POINTS), - m_render_vertices(m_uniqueVertexPoints, GL_POINTS), - m_render_edges(m_uniqueEdgePoints, GL_POINTS), - m_evaluateTransform(evaluateTransform), - m_boundsChanged(boundsChanged), - m_planeChanged(false), - m_transformChanged(false) - { - planeChanged(); - } - Brush(const Brush& other, scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged) : - m_node(&node), - m_undoable_observer(0), - m_map(0), - m_render_faces(m_faceCentroidPoints, GL_POINTS), - m_render_vertices(m_uniqueVertexPoints, GL_POINTS), - m_render_edges(m_uniqueEdgePoints, GL_POINTS), - m_evaluateTransform(evaluateTransform), - m_boundsChanged(boundsChanged), - m_planeChanged(false), - m_transformChanged(false) - { - copy(other); - } - Brush(const Brush& other) : - TransformNode(other), - Bounded(other), - Cullable(other), - Snappable(), - Undoable(other), - FaceObserver(other), - Filterable(other), - Nameable(other), - BrushDoom3(other), - m_node(0), - m_undoable_observer(0), - m_map(0), - m_render_faces(m_faceCentroidPoints, GL_POINTS), - m_render_vertices(m_uniqueVertexPoints, GL_POINTS), - m_render_edges(m_uniqueEdgePoints, GL_POINTS), - m_planeChanged(false), - m_transformChanged(false) - { - copy(other); - } - ~Brush() - { - ASSERT_MESSAGE(m_observers.empty(), "Brush::~Brush: observers still attached"); - } - - // assignment not supported - Brush& operator=(const Brush& other); - - void setDoom3GroupOrigin(const Vector3& origin) - { - //globalOutputStream() << "func_static origin before: " << m_funcStaticOrigin << " after: " << origin << "\n"; - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->getPlane().m_funcStaticOrigin = origin; - (*i)->getPlane().updateTranslated(); - (*i)->planeChanged(); - } - planeChanged(); - } - - void attach(BrushObserver& observer) - { - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - observer.push_back(*(*i)); - } - - for(SelectableEdges::iterator i = m_select_edges.begin(); i !=m_select_edges.end(); ++i) - { - observer.edge_push_back(*i); - } - - for(SelectableVertices::iterator i = m_select_vertices.begin(); i != m_select_vertices.end(); ++i) - { - observer.vertex_push_back(*i); - } - - m_observers.insert(&observer); - } - void detach(BrushObserver& observer) - { - m_observers.erase(&observer); - } - - void forEachFace(const BrushVisitor& visitor) const - { - for(Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - visitor.visit(*(*i)); - } - } - - void forEachFace_instanceAttach(MapFile* map) const - { - for(Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->instanceAttach(map); - } - } - void forEachFace_instanceDetach(MapFile* map) const - { - for(Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->instanceDetach(map); - } - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_map = path_find_mapfile(path.begin(), path.end()); - m_undoable_observer = GlobalUndoSystem().observer(this); - GlobalFilterSystem().registerFilterable(*this); - forEachFace_instanceAttach(m_map); - } - else - { - ASSERT_MESSAGE(path_find_mapfile(path.begin(), path.end()) == m_map, "node is instanced across more than one file"); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - forEachFace_instanceDetach(m_map); - GlobalFilterSystem().unregisterFilterable(*this); - m_map = 0; - m_undoable_observer = 0; - GlobalUndoSystem().release(this); - } - } - - // nameable - const char* name() const - { - return "brush"; - } - void attach(const NameCallback& callback) - { - } - void detach(const NameCallback& callback) - { - } - - // filterable - void updateFiltered() - { - if(m_node != 0) - { - if(brush_filtered(*this)) - { - m_node->enable(scene::Node::eFiltered); - } - else - { - m_node->disable(scene::Node::eFiltered); - } - } - } - - // observer - void planeChanged() - { - m_planeChanged = true; - aabbChanged(); - m_lightsChanged(); - } - void shaderChanged() - { - updateFiltered(); - planeChanged(); - } - - void evaluateBRep() const - { - if(m_planeChanged) - { - m_planeChanged = false; - const_cast(this)->buildBRep(); - } - } - - void transformChanged() - { - m_transformChanged = true; - planeChanged(); - } - typedef MemberCaller TransformChangedCaller; - - void evaluateTransform() - { - if(m_transformChanged) - { - m_transformChanged = false; - revertTransform(); - m_evaluateTransform(); - } - } - const Matrix4& localToParent() const - { - return g_matrix4_identity; - } - void aabbChanged() - { - m_boundsChanged(); - } - const AABB& localAABB() const - { - evaluateBRep(); - return m_aabb_local; - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - - void renderComponents(SelectionSystem::EComponentMode mode, Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - switch(mode) - { - case SelectionSystem::eVertex: - renderer.addRenderable(m_render_vertices, localToWorld); - break; - case SelectionSystem::eEdge: - renderer.addRenderable(m_render_edges, localToWorld); - break; - case SelectionSystem::eFace: - renderer.addRenderable(m_render_faces, localToWorld); - break; - default: - break; - } - } - - void transform(const Matrix4& matrix) - { - bool mirror = matrix4_handedness(matrix) == MATRIX4_LEFTHANDED; - - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->transform(matrix, mirror); - } - } - void snapto(float snap) - { - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->snapto(snap); - } - } - void revertTransform() - { - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->revertTransform(); - } - } - void freezeTransform() - { - for(Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i) - { - (*i)->freezeTransform(); - } - } - - /// \brief Returns the absolute index of the \p faceVertex. - std::size_t absoluteIndex(FaceVertexId faceVertex) - { - std::size_t index = 0; - for(std::size_t i = 0; i < faceVertex.getFace(); ++i) - { - index += m_faces[i]->getWinding().numpoints; - } - return index + faceVertex.getVertex(); - } - - void appendFaces(const Faces& other) - { - clear(); - for(Faces::const_iterator i = other.begin(); i != other.end(); ++i) - { - push_back(*i); - } - } - - /// \brief The undo memento for a brush stores only the list of face references - the faces are not copied. - class BrushUndoMemento : public UndoMemento - { - public: - BrushUndoMemento(const Faces& faces) : m_faces(faces) - { - } - void release() - { - delete this; - } - - Faces m_faces; - }; - - void undoSave() - { - if(m_map != 0) - { - m_map->changed(); - } - if(m_undoable_observer != 0) - { - m_undoable_observer->save(this); - } - } - - UndoMemento* exportState() const - { - return new BrushUndoMemento(m_faces); - } - - void importState(const UndoMemento* state) - { - undoSave(); - appendFaces(static_cast(state)->m_faces); - planeChanged(); - - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->DEBUG_verify(); - } - } - - bool isDetail() - { - return !m_faces.empty() && m_faces.front()->isDetail(); - } - - /// \brief Appends a copy of \p face to the end of the face list. - Face* addFace(const Face& face) - { - if(m_faces.size() == c_brush_maxFaces) - { - return 0; - } - undoSave(); - push_back(FaceSmartPointer(new Face(face, this))); - m_faces.back()->setDetail(isDetail()); - planeChanged(); - return m_faces.back(); - } - - /// \brief Appends a new face constructed from the parameters to the end of the face list. - Face* addPlane(const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection) - { - if(m_faces.size() == c_brush_maxFaces) - { - return 0; - } - undoSave(); - push_back(FaceSmartPointer(new Face(p0, p1, p2, shader, projection, this))); - m_faces.back()->setDetail(isDetail()); - planeChanged(); - return m_faces.back(); - } - - static void constructStatic(EBrushType type) - { - m_type = type; - Face::m_type = type; - FacePlane::m_type = type; - - g_bp_globals.m_texdefTypeId = TEXDEFTYPEID_QUAKE; - if(m_type == eBrushTypeQuake3BP || m_type == eBrushTypeDoom3 || m_type == eBrushTypeQuake4) - { - g_bp_globals.m_texdefTypeId = TEXDEFTYPEID_BRUSHPRIMITIVES; - g_brush_texturelock_enabled = true; - } - else if(m_type == eBrushTypeHalfLife) - { - g_bp_globals.m_texdefTypeId = TEXDEFTYPEID_HALFLIFE; - g_brush_texturelock_enabled = true; - } - - Face::m_quantise = (m_type == eBrushTypeQuake) ? quantiseInteger : quantiseFloating; - - m_state_point = GlobalShaderCache().capture("$POINT"); - } - static void destroyStatic() - { - GlobalShaderCache().release("$POINT"); - } - - std::size_t DEBUG_size() - { - return m_faces.size(); - } - - typedef Faces::const_iterator const_iterator; - - const_iterator begin() const - { - return m_faces.begin(); - } - const_iterator end() const - { - return m_faces.end(); - } - - Face* back() - { - return m_faces.back(); - } - const Face* back() const - { - return m_faces.back(); - } - void reserve(std::size_t count) - { - m_faces.reserve(count); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->reserve(count); - } - } - void push_back(Faces::value_type face) - { - m_faces.push_back(face); - if(m_instanceCounter.m_count != 0) - { - m_faces.back()->instanceAttach(m_map); - } - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->push_back(*face); - (*i)->DEBUG_verify(); - } - } - void pop_back() - { - if(m_instanceCounter.m_count != 0) - { - m_faces.back()->instanceDetach(m_map); - } - m_faces.pop_back(); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->pop_back(); - (*i)->DEBUG_verify(); - } - } - void erase(std::size_t index) - { - if(m_instanceCounter.m_count != 0) - { - m_faces[index]->instanceDetach(m_map); - } - m_faces.erase(m_faces.begin() + index); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->erase(index); - (*i)->DEBUG_verify(); - } - } - void connectivityChanged() - { - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->connectivityChanged(); - } - } - - - void clear() - { - undoSave(); - if(m_instanceCounter.m_count != 0) - { - forEachFace_instanceDetach(m_map); - } - m_faces.clear(); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->clear(); - (*i)->DEBUG_verify(); - } - } - std::size_t size() const - { - return m_faces.size(); - } - bool empty() const - { - return m_faces.empty(); - } - - /// \brief Returns true if any face of the brush contributes to the final B-Rep. - bool hasContributingFaces() const - { - for(const_iterator i = begin(); i != end(); ++i) - { - if((*i)->contributes()) - { - return true; - } - } - return false; - } - - /// \brief Removes faces that do not contribute to the brush. This is useful for cleaning up after CSG operations on the brush. - /// Note: removal of empty faces is not performed during direct brush manipulations, because it would make a manipulation irreversible if it created an empty face. - void removeEmptyFaces() - { - evaluateBRep(); - - { - std::size_t i = 0; - while(i < m_faces.size()) - { - if(!m_faces[i]->contributes()) - { - erase(i); - planeChanged(); - } - else - { - ++i; - } - } - } - } - - /// \brief Constructs \p winding from the intersection of \p plane with the other planes of the brush. - void windingForClipPlane(Winding& winding, const Plane3& plane) const - { - FixedWinding buffer[2]; - bool swap = false; - - // get a poly that covers an effectively infinite area - Winding_createInfinite(buffer[swap], plane, m_maxWorldCoord + 1); - - // chop the poly by all of the other faces - { - for (std::size_t i = 0; i < m_faces.size(); ++i) - { - const Face& clip = *m_faces[i]; - - if(plane3_equal(clip.plane3(), plane) - || !plane3_valid(clip.plane3()) || !plane_unique(i) - || plane3_opposing(plane, clip.plane3())) - { - continue; - } - - buffer[!swap].clear(); - -#if BRUSH_CONNECTIVITY_DEBUG - globalOutputStream() << "clip vs face: " << i << "\n"; -#endif - - { - // flip the plane, because we want to keep the back side - Plane3 clipPlane(vector3_negated(clip.plane3().normal()), -clip.plane3().dist()); - Winding_Clip(buffer[swap], plane, clipPlane, i, buffer[!swap]); - } - -#if BRUSH_CONNECTIVITY_DEBUG - for(FixedWinding::Points::iterator k = buffer[!swap].points.begin(), j = buffer[!swap].points.end() - 1; k != buffer[!swap].points.end(); j = k, ++k) - { - if(vector3_length_squared(vector3_subtracted((*k).vertex, (*j).vertex)) < 1) - { - globalOutputStream() << "v: " << std::distance(buffer[!swap].points.begin(), j) << " tiny edge adjacent to face " << (*j).adjacent << "\n"; - } - } -#endif - - //ASSERT_MESSAGE(buffer[!swap].numpoints != 1, "created single-point winding"); - - swap = !swap; - } - } - - Winding_forFixedWinding(winding, buffer[swap]); - -#if BRUSH_CONNECTIVITY_DEBUG - Winding_printConnectivity(winding); - - for(Winding::iterator i = winding.begin(), j = winding.end() - 1; i != winding.end(); j = i, ++i) - { - if(vector3_length_squared(vector3_subtracted((*i).vertex, (*j).vertex)) < 1) - { - globalOutputStream() << "v: " << std::distance(winding.begin(), j) << " tiny edge adjacent to face " << (*j).adjacent << "\n"; - } - } -#endif - } - - void update_wireframe(RenderableWireframe& wire, const bool* faces_visible) const - { - wire.m_faceVertex.resize(m_edge_indices.size()); - wire.m_vertices = m_uniqueVertexPoints.data(); - wire.m_size = 0; - for(std::size_t i = 0; i < m_edge_faces.size(); ++i) - { - if(faces_visible[m_edge_faces[i].first] - || faces_visible[m_edge_faces[i].second]) - { - wire.m_faceVertex[wire.m_size++] = m_edge_indices[i]; - } - } - } - - - void update_faces_wireframe(Array& wire, const bool* faces_visible) const - { - std::size_t count = 0; - for(std::size_t i = 0; i < m_faceCentroidPoints.size(); ++i) - { - if(faces_visible[i]) - { - ++count; - } - } - - wire.resize(count); - Array::iterator p = wire.begin(); - for(std::size_t i = 0; i < m_faceCentroidPoints.size(); ++i) - { - if(faces_visible[i]) - { - *p++ = m_faceCentroidPoints[i]; - } - } - } - - /// \brief Makes this brush a deep-copy of the \p other. - void copy(const Brush& other) - { - for(Faces::const_iterator i = other.m_faces.begin(); i != other.m_faces.end(); ++i) - { - addFace(*(*i)); - } - planeChanged(); - } - -private: - void edge_push_back(FaceVertexId faceVertex) - { - m_select_edges.push_back(SelectableEdge(m_faces, faceVertex)); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->edge_push_back(m_select_edges.back()); - } - } - void edge_clear() - { - m_select_edges.clear(); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->edge_clear(); - } - } - void vertex_push_back(FaceVertexId faceVertex) - { - m_select_vertices.push_back(SelectableVertex(m_faces, faceVertex)); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->vertex_push_back(m_select_vertices.back()); - } - } - void vertex_clear() - { - m_select_vertices.clear(); - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->vertex_clear(); - } - } - - /// \brief Returns true if the face identified by \p index is preceded by another plane that takes priority over it. - bool plane_unique(std::size_t index) const - { - // duplicate plane - for(std::size_t i = 0; i < m_faces.size(); ++i) - { - if(index != i && !plane3_inside(m_faces[index]->plane3(), m_faces[i]->plane3())) - { - return false; - } - } - return true; - } - - /// \brief Removes edges that are smaller than the tolerance used when generating brush windings. - void removeDegenerateEdges() - { - for (std::size_t i = 0; i < m_faces.size(); ++i) - { - Winding& winding = m_faces[i]->getWinding(); - for(Winding::iterator j = winding.begin(); j != winding.end();) - { - std::size_t index = std::distance(winding.begin(), j); - std::size_t next = Winding_next(winding, index); - if(Edge_isDegenerate(winding[index].vertex, winding[next].vertex)) - { -#if BRUSH_DEGENERATE_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << i << ": degenerate edge adjacent to " << winding[index].adjacent << "\n"; -#endif - Winding& other = m_faces[winding[index].adjacent]->getWinding(); - std::size_t adjacent = Winding_FindAdjacent(other, i); - if(adjacent != c_brush_maxFaces) - { - other.erase(other.begin() + adjacent); - } - winding.erase(j); - } - else - { - ++j; - } - } - } - } - - /// \brief Invalidates faces that have only two vertices in their winding, while preserving edge-connectivity information. - void removeDegenerateFaces() - { - // save adjacency info for degenerate faces - for (std::size_t i = 0; i < m_faces.size(); ++i) - { - Winding& degen = m_faces[i]->getWinding(); - - if(degen.numpoints == 2) - { -#if BRUSH_DEGENERATE_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << i << ": degenerate winding adjacent to " << degen[0].adjacent << ", " << degen[1].adjacent << "\n"; -#endif - // this is an "edge" face, where the plane touches the edge of the brush - { - Winding& winding = m_faces[degen[0].adjacent]->getWinding(); - std::size_t index = Winding_FindAdjacent(winding, i); - if(index != c_brush_maxFaces) - { -#if BRUSH_DEGENERATE_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << degen[0].adjacent << ": remapping adjacent " << winding[index].adjacent << " to " << degen[1].adjacent << "\n"; -#endif - winding[index].adjacent = degen[1].adjacent; - } - } - - { - Winding& winding = m_faces[degen[1].adjacent]->getWinding(); - std::size_t index = Winding_FindAdjacent(winding, i); - if(index != c_brush_maxFaces) - { -#if BRUSH_DEGENERATE_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << degen[1].adjacent << ": remapping adjacent " << winding[index].adjacent << " to " << degen[0].adjacent << "\n"; -#endif - winding[index].adjacent = degen[0].adjacent; - } - } - - degen.resize(0); - } - } - } - - /// \brief Removes edges that have the same adjacent-face as their immediate neighbour. - void removeDuplicateEdges() - { - // verify face connectivity graph - for(std::size_t i = 0; i < m_faces.size(); ++i) - { - //if(m_faces[i]->contributes()) - { - Winding& winding = m_faces[i]->getWinding(); - for(std::size_t j = 0; j != winding.numpoints;) - { - std::size_t next = Winding_next(winding, j); - if(winding[j].adjacent == winding[next].adjacent) - { -#if BRUSH_DEGENERATE_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << i << ": removed duplicate edge adjacent to face " << winding[j].adjacent << "\n"; -#endif - winding.erase(winding.begin() + next); - } - else - { - ++j; - } - } - } - } - } - - /// \brief Removes edges that do not have a matching pair in their adjacent-face. - void verifyConnectivityGraph() - { - // verify face connectivity graph - for(std::size_t i = 0; i < m_faces.size(); ++i) - { - //if(m_faces[i]->contributes()) - { - Winding& winding = m_faces[i]->getWinding(); - for(Winding::iterator j = winding.begin(); j != winding.end();) - { -#if BRUSH_CONNECTIVITY_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << i << ": adjacent to face " << (*j).adjacent << "\n"; -#endif - // remove unidirectional graph edges - if((*j).adjacent == c_brush_maxFaces - || Winding_FindAdjacent(m_faces[(*j).adjacent]->getWinding(), i) == c_brush_maxFaces) - { -#if BRUSH_CONNECTIVITY_DEBUG - globalOutputStream() << "Brush::buildWindings: face " << i << ": removing unidirectional connectivity graph edge adjacent to face " << (*j).adjacent << "\n"; -#endif - winding.erase(j); - } - else - { - ++j; - } - } - } - } - } - - /// \brief Returns true if the brush is a finite volume. A brush without a finite volume extends past the maximum world bounds and is not valid. - bool isBounded() - { - for(const_iterator i = begin(); i != end(); ++i) - { - if(!(*i)->is_bounded()) - { - return false; - } - } - return true; - } - - /// \brief Constructs the polygon windings for each face of the brush. Also updates the brush bounding-box and face texture-coordinates. - bool buildWindings() - { - - { - m_aabb_local = AABB(); - - for (std::size_t i = 0; i < m_faces.size(); ++i) - { - Face& f = *m_faces[i]; - - if(!plane3_valid(f.plane3()) || !plane_unique(i)) - { - f.getWinding().resize(0); - } - else - { -#if BRUSH_CONNECTIVITY_DEBUG - globalOutputStream() << "face: " << i << "\n"; -#endif - windingForClipPlane(f.getWinding(), f.plane3()); - - // update brush bounds - const Winding& winding = f.getWinding(); - for(Winding::const_iterator i = winding.begin(); i != winding.end(); ++i) - { - aabb_extend_by_point_safe(m_aabb_local, (*i).vertex); - } - - // update texture coordinates - f.EmitTextureCoordinates(); - } - } - } - - bool degenerate = !isBounded(); - - if(!degenerate) - { - // clean up connectivity information. - // these cleanups must be applied in a specific order. - removeDegenerateEdges(); - removeDegenerateFaces(); - removeDuplicateEdges(); - verifyConnectivityGraph(); - } - - return degenerate; - } - - /// \brief Constructs the face windings and updates anything that depends on them. - void buildBRep(); -}; - - - -class FaceInstance; - -class FaceInstanceSet -{ - typedef SelectionList FaceInstances; - FaceInstances m_faceInstances; -public: - void insert(FaceInstance& faceInstance) - { - m_faceInstances.append(faceInstance); - } - void erase(FaceInstance& faceInstance) - { - m_faceInstances.erase(faceInstance); - } - - template - void foreach(Functor functor) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - functor(*(*i)); - } - } - - bool empty() const - { - return m_faceInstances.empty(); - } - FaceInstance& last() const - { - return m_faceInstances.back(); - } -}; - -extern FaceInstanceSet g_SelectedFaceInstances; - -typedef std::list VertexSelection; - -inline VertexSelection::iterator VertexSelection_find(VertexSelection& self, std::size_t value) -{ - return std::find(self.begin(), self.end(), value); -} - -inline VertexSelection::const_iterator VertexSelection_find(const VertexSelection& self, std::size_t value) -{ - return std::find(self.begin(), self.end(), value); -} - -inline VertexSelection::iterator VertexSelection_insert(VertexSelection& self, std::size_t value) -{ - VertexSelection::iterator i = VertexSelection_find(self, value); - if(i == self.end()) - { - self.push_back(value); - return --self.end(); - } - return i; -} -inline void VertexSelection_erase(VertexSelection& self, std::size_t value) -{ - VertexSelection::iterator i = VertexSelection_find(self, value); - if(i != self.end()) - { - self.erase(i); - } -} - -inline bool triangle_reversed(std::size_t x, std::size_t y, std::size_t z) -{ - return !((x < y && y < z) || (z < x && x < y) || (y < z && z < x)); -} -template -inline Vector3 triangle_cross(const BasicVector3& x, const BasicVector3 y, const BasicVector3& z) -{ - return vector3_cross(y - x, z - x); -} -template -inline bool triangles_same_winding(const BasicVector3& x1, const BasicVector3 y1, const BasicVector3& z1, const BasicVector3& x2, const BasicVector3 y2, const BasicVector3& z2) -{ - return vector3_dot(triangle_cross(x1, y1, z1), triangle_cross(x2, y2, z2)) > 0; -} - - -typedef const Plane3* PlanePointer; -typedef PlanePointer* PlanesIterator; - -class VectorLightList : public LightList -{ - typedef std::vector Lights; - Lights m_lights; -public: - void addLight(const RendererLight& light) - { - m_lights.push_back(&light); - } - void clear() - { - m_lights.clear(); - } - void evaluateLights() const - { - } - void lightsChanged() const - { - } - void forEachLight(const RendererLightCallback& callback) const - { - for(Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i) - { - callback(*(*i)); - } - } -}; - -class FaceInstance -{ - Face* m_face; - ObservedSelectable m_selectable; - ObservedSelectable m_selectableVertices; - ObservedSelectable m_selectableEdges; - SelectionChangeCallback m_selectionChanged; - - VertexSelection m_vertexSelection; - VertexSelection m_edgeSelection; - -public: - mutable VectorLightList m_lights; - - FaceInstance(Face& face, const SelectionChangeCallback& observer) : - m_face(&face), - m_selectable(SelectedChangedCaller(*this)), - m_selectableVertices(observer), - m_selectableEdges(observer), - m_selectionChanged(observer) - { - } - FaceInstance(const FaceInstance& other) : - m_face(other.m_face), - m_selectable(SelectedChangedCaller(*this)), - m_selectableVertices(other.m_selectableVertices), - m_selectableEdges(other.m_selectableEdges), - m_selectionChanged(other.m_selectionChanged) - { - } - FaceInstance& operator=(const FaceInstance& other) - { - m_face = other.m_face; - return *this; - } - - Face& getFace() - { - return *m_face; - } - const Face& getFace() const - { - return *m_face; - } - - void selectedChanged(const Selectable& selectable) - { - if(selectable.isSelected()) - { - g_SelectedFaceInstances.insert(*this); - } - else - { - g_SelectedFaceInstances.erase(*this); - } - m_selectionChanged(selectable); - } - typedef MemberCaller1 SelectedChangedCaller; - - bool selectedVertices() const - { - return !m_vertexSelection.empty(); - } - bool selectedEdges() const - { - return !m_edgeSelection.empty(); - } - bool isSelected() const - { - return m_selectable.isSelected(); - } - - bool selectedComponents() const - { - return selectedVertices() || selectedEdges() || isSelected(); - } - bool selectedComponents(SelectionSystem::EComponentMode mode) const - { - switch(mode) - { - case SelectionSystem::eVertex: - return selectedVertices(); - case SelectionSystem::eEdge: - return selectedEdges(); - case SelectionSystem::eFace: - return isSelected(); - default: - return false; - } - } - void setSelected(SelectionSystem::EComponentMode mode, bool select) - { - switch(mode) - { - case SelectionSystem::eFace: - m_selectable.setSelected(select); - break; - case SelectionSystem::eVertex: - ASSERT_MESSAGE(!select, "select-all not supported"); - - m_vertexSelection.clear(); - m_selectableVertices.setSelected(false); - break; - case SelectionSystem::eEdge: - ASSERT_MESSAGE(!select, "select-all not supported"); - - m_edgeSelection.clear(); - m_selectableEdges.setSelected(false); - break; - default: - break; - } - } - - template - void SelectedVertices_foreach(Functor functor) const - { - for(VertexSelection::const_iterator i = m_vertexSelection.begin(); i != m_vertexSelection.end(); ++i) - { - std::size_t index = Winding_FindAdjacent(getFace().getWinding(), *i); - if(index != c_brush_maxFaces) - { - functor(getFace().getWinding()[index].vertex); - } - } - } - template - void SelectedEdges_foreach(Functor functor) const - { - for(VertexSelection::const_iterator i = m_edgeSelection.begin(); i != m_edgeSelection.end(); ++i) - { - std::size_t index = Winding_FindAdjacent(getFace().getWinding(), *i); - if(index != c_brush_maxFaces) - { - const Winding& winding = getFace().getWinding(); - std::size_t adjacent = Winding_next(winding, index); - functor(vector3_mid(winding[index].vertex, winding[adjacent].vertex)); - } - } - } - template - void SelectedFaces_foreach(Functor functor) const - { - if(isSelected()) - { - functor(centroid()); - } - } - - template - void SelectedComponents_foreach(Functor functor) const - { - SelectedVertices_foreach(functor); - SelectedEdges_foreach(functor); - SelectedFaces_foreach(functor); - } - - void iterate_selected(AABB& aabb) const - { - SelectedComponents_foreach(AABBExtendByPoint(aabb)); - } - - class RenderablePointVectorPushBack - { - RenderablePointVector& m_points; - public: - RenderablePointVectorPushBack(RenderablePointVector& points) : m_points(points) - { - } - void operator()(const Vector3& point) const - { - const Colour4b colour_selected(0, 0, 255, 255); - m_points.push_back(pointvertex_for_windingpoint(point, colour_selected)); - } - }; - - void iterate_selected(RenderablePointVector& points) const - { - SelectedComponents_foreach(RenderablePointVectorPushBack(points)); - } - - bool intersectVolume(const VolumeTest& volume, const Matrix4& localToWorld) const - { - return m_face->intersectVolume(volume, localToWorld); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - if(!m_face->isFiltered() && m_face->contributes() && intersectVolume(volume, localToWorld)) - { - renderer.PushState(); - if(selectedComponents()) - { - renderer.Highlight(Renderer::eFace); - } - m_face->render(renderer, localToWorld); - renderer.PopState(); - } - } - - void testSelect(SelectionTest& test, SelectionIntersection& best) - { - if(!m_face->isFiltered()) - { - m_face->testSelect(test, best); - } - } - void testSelect(Selector& selector, SelectionTest& test) - { - SelectionIntersection best; - testSelect(test, best); - if(best.valid()) - { - Selector_add(selector, m_selectable, best); - } - } - void testSelect_centroid(Selector& selector, SelectionTest& test) - { - if(m_face->contributes() && !m_face->isFiltered()) - { - SelectionIntersection best; - m_face->testSelect_centroid(test, best); - if(best.valid()) - { - Selector_add(selector, m_selectable, best); - } - } - } - - void selectPlane(Selector& selector, const Line& line, PlanesIterator first, PlanesIterator last, const PlaneCallback& selectedPlaneCallback) - { - for(Winding::const_iterator i = getFace().getWinding().begin(); i != getFace().getWinding().end(); ++i) - { - Vector3 v(vector3_subtracted(line_closest_point(line, (*i).vertex), (*i).vertex)); - double dot = vector3_dot(getFace().plane3().normal(), v); - if(dot <= 0) - { - return; - } - } - - Selector_add(selector, m_selectable); - - selectedPlaneCallback(getFace().plane3()); - } - void selectReversedPlane(Selector& selector, const SelectedPlanes& selectedPlanes) - { - if(selectedPlanes.contains(plane3_flipped(getFace().plane3()))) - { - Selector_add(selector, m_selectable); - } - } - - void transformComponents(const Matrix4& matrix) - { - if(isSelected()) - { - m_face->transform(matrix, false); - } - if(selectedVertices()) - { - if(m_vertexSelection.size() == 1) - { - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]); - m_face->assign_planepts(m_face->m_move_planeptsTransformed); - } - else if(m_vertexSelection.size() == 2) - { - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]); - m_face->assign_planepts(m_face->m_move_planeptsTransformed); - } - else if(m_vertexSelection.size() >= 3) - { - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]); - m_face->assign_planepts(m_face->m_move_planeptsTransformed); - } - } - if(selectedEdges()) - { - if(m_edgeSelection.size() == 1) - { - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]); - m_face->assign_planepts(m_face->m_move_planeptsTransformed); - } - else if(m_edgeSelection.size() >= 2) - { - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[0]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[1]); - matrix4_transform_point(matrix, m_face->m_move_planeptsTransformed[2]); - m_face->assign_planepts(m_face->m_move_planeptsTransformed); - } - } - } - - void snapto(float snap) - { - m_face->snapto(snap); - } - - void snapComponents(float snap) - { - if(isSelected()) - { - snapto(snap); - } - if(selectedVertices()) - { - vector3_snap(m_face->m_move_planepts[0], snap); - vector3_snap(m_face->m_move_planepts[1], snap); - vector3_snap(m_face->m_move_planepts[2], snap); - m_face->assign_planepts(m_face->m_move_planepts); - planepts_assign(m_face->m_move_planeptsTransformed, m_face->m_move_planepts); - m_face->freezeTransform(); - } - if(selectedEdges()) - { - vector3_snap(m_face->m_move_planepts[0], snap); - vector3_snap(m_face->m_move_planepts[1], snap); - vector3_snap(m_face->m_move_planepts[2], snap); - m_face->assign_planepts(m_face->m_move_planepts); - planepts_assign(m_face->m_move_planeptsTransformed, m_face->m_move_planepts); - m_face->freezeTransform(); - } - } - void update_move_planepts_vertex(std::size_t index) - { - m_face->update_move_planepts_vertex(index, m_face->m_move_planepts); - } - void update_move_planepts_vertex2(std::size_t index, std::size_t other) - { - const std::size_t numpoints = m_face->getWinding().numpoints; - ASSERT_MESSAGE(index < numpoints, "select_vertex: invalid index"); - - const std::size_t opposite = Winding_Opposite(m_face->getWinding(), index, other); - - if(triangle_reversed(index, other, opposite)) - { - std::swap(index, other); - } - - ASSERT_MESSAGE( - triangles_same_winding( - m_face->getWinding()[opposite].vertex, - m_face->getWinding()[index].vertex, - m_face->getWinding()[other].vertex, - m_face->getWinding()[0].vertex, - m_face->getWinding()[1].vertex, - m_face->getWinding()[2].vertex - ), - "update_move_planepts_vertex2: error" - ); - - m_face->m_move_planepts[0] = m_face->getWinding()[opposite].vertex; - m_face->m_move_planepts[1] = m_face->getWinding()[index].vertex; - m_face->m_move_planepts[2] = m_face->getWinding()[other].vertex; - planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate - } - void update_selection_vertex() - { - if(m_vertexSelection.size() == 0) - { - m_selectableVertices.setSelected(false); - } - else - { - m_selectableVertices.setSelected(true); - - if(m_vertexSelection.size() == 1) - { - std::size_t index = Winding_FindAdjacent(getFace().getWinding(), *m_vertexSelection.begin()); - - if(index != c_brush_maxFaces) - { - update_move_planepts_vertex(index); - } - } - else if(m_vertexSelection.size() == 2) - { - std::size_t index = Winding_FindAdjacent(getFace().getWinding(), *m_vertexSelection.begin()); - std::size_t other = Winding_FindAdjacent(getFace().getWinding(), *(++m_vertexSelection.begin())); - - if(index != c_brush_maxFaces - && other != c_brush_maxFaces) - { - update_move_planepts_vertex2(index, other); - } - } - } - } - void select_vertex(std::size_t index, bool select) - { - if(select) - { - VertexSelection_insert(m_vertexSelection, getFace().getWinding()[index].adjacent); - } - else - { - VertexSelection_erase(m_vertexSelection, getFace().getWinding()[index].adjacent); - } - - SceneChangeNotify(); - update_selection_vertex(); - } - - bool selected_vertex(std::size_t index) const - { - return VertexSelection_find(m_vertexSelection, getFace().getWinding()[index].adjacent) != m_vertexSelection.end(); - } - - void update_move_planepts_edge(std::size_t index) - { - std::size_t numpoints = m_face->getWinding().numpoints; - ASSERT_MESSAGE(index < numpoints, "select_edge: invalid index"); - - std::size_t adjacent = Winding_next(m_face->getWinding(), index); - std::size_t opposite = Winding_Opposite(m_face->getWinding(), index); - m_face->m_move_planepts[0] = m_face->getWinding()[index].vertex; - m_face->m_move_planepts[1] = m_face->getWinding()[adjacent].vertex; - m_face->m_move_planepts[2] = m_face->getWinding()[opposite].vertex; - planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate - } - void update_selection_edge() - { - if(m_edgeSelection.size() == 0) - { - m_selectableEdges.setSelected(false); - } - else - { - m_selectableEdges.setSelected(true); - - if(m_edgeSelection.size() == 1) - { - std::size_t index = Winding_FindAdjacent(getFace().getWinding(), *m_edgeSelection.begin()); - - if(index != c_brush_maxFaces) - { - update_move_planepts_edge(index); - } - } - } - } - void select_edge(std::size_t index, bool select) - { - if(select) - { - VertexSelection_insert(m_edgeSelection, getFace().getWinding()[index].adjacent); - } - else - { - VertexSelection_erase(m_edgeSelection, getFace().getWinding()[index].adjacent); - } - - SceneChangeNotify(); - update_selection_edge(); - } - - bool selected_edge(std::size_t index) const - { - return VertexSelection_find(m_edgeSelection, getFace().getWinding()[index].adjacent) != m_edgeSelection.end(); - } - - const Vector3& centroid() const - { - return m_face->centroid(); - } - - void connectivityChanged() - { - // This occurs when a face is added or removed. - // The current vertex and edge selections no longer valid and must be cleared. - m_vertexSelection.clear(); - m_selectableVertices.setSelected(false); - m_edgeSelection.clear(); - m_selectableEdges.setSelected(false); - } -}; - -class BrushClipPlane : public OpenGLRenderable -{ - Plane3 m_plane; - Winding m_winding; - static Shader* m_state; -public: - static void constructStatic() - { - m_state = GlobalShaderCache().capture("$CLIPPER_OVERLAY"); - } - static void destroyStatic() - { - GlobalShaderCache().release("$CLIPPER_OVERLAY"); - } - - void setPlane(const Brush& brush, const Plane3& plane) - { - m_plane = plane; - if(plane3_valid(m_plane)) - { - brush.windingForClipPlane(m_winding, m_plane); - } - else - { - m_winding.resize(0); - } - } - - void render(RenderStateFlags state) const - { - if((state & RENDER_FILL) != 0) - { - Winding_Draw(m_winding, m_plane.normal(), state); - } - else - { - Winding_DrawWireframe(m_winding); - } - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_state, Renderer::eWireframeOnly); - renderer.SetState(m_state, Renderer::eFullMaterials); - renderer.addRenderable(*this, localToWorld); - } -}; - -inline void Face_addLight(const FaceInstance& face, const Matrix4& localToWorld, const RendererLight& light) -{ - const Plane3& facePlane = face.getFace().plane3(); - const Vector3& origin = light.aabb().origin; - Plane3 tmp(plane3_transformed(Plane3(facePlane.normal(), -facePlane.dist()), localToWorld)); - if(!plane3_test_point(tmp, origin) - || !plane3_test_point(tmp, vector3_added(origin, light.offset()))) - { - face.m_lights.addLight(light); - } -} - - - -typedef std::vector FaceInstances; - -class EdgeInstance : public Selectable -{ - FaceInstances& m_faceInstances; - SelectableEdge* m_edge; - - void select_edge(bool select) - { - FaceVertexId faceVertex = m_edge->m_faceVertex; - m_faceInstances[faceVertex.getFace()].select_edge(faceVertex.getVertex(), select); - faceVertex = next_edge(m_edge->m_faces, faceVertex); - m_faceInstances[faceVertex.getFace()].select_edge(faceVertex.getVertex(), select); - } - bool selected_edge() const - { - FaceVertexId faceVertex = m_edge->m_faceVertex; - if(!m_faceInstances[faceVertex.getFace()].selected_edge(faceVertex.getVertex())) - { - return false; - } - faceVertex = next_edge(m_edge->m_faces, faceVertex); - if(!m_faceInstances[faceVertex.getFace()].selected_edge(faceVertex.getVertex())) - { - return false; - } - - return true; - } - -public: - EdgeInstance(FaceInstances& faceInstances, SelectableEdge& edge) - : m_faceInstances(faceInstances), m_edge(&edge) - { - } - EdgeInstance& operator=(const EdgeInstance& other) - { - m_edge = other.m_edge; - return *this; - } - - void setSelected(bool select) - { - select_edge(select); - } - bool isSelected() const - { - return selected_edge(); - } - - - void testSelect(Selector& selector, SelectionTest& test) - { - SelectionIntersection best; - m_edge->testSelect(test, best); - if(best.valid()) - { - Selector_add(selector, *this, best); - } - } -}; - -class VertexInstance : public Selectable -{ - FaceInstances& m_faceInstances; - SelectableVertex* m_vertex; - - void select_vertex(bool select) - { - FaceVertexId faceVertex = m_vertex->m_faceVertex; - do - { - m_faceInstances[faceVertex.getFace()].select_vertex(faceVertex.getVertex(), select); - faceVertex = next_vertex(m_vertex->m_faces, faceVertex); - } - while(faceVertex.getFace() != m_vertex->m_faceVertex.getFace()); - } - bool selected_vertex() const - { - FaceVertexId faceVertex = m_vertex->m_faceVertex; - do - { - if(!m_faceInstances[faceVertex.getFace()].selected_vertex(faceVertex.getVertex())) - { - return false; - } - faceVertex = next_vertex(m_vertex->m_faces, faceVertex); - } - while(faceVertex.getFace() != m_vertex->m_faceVertex.getFace()); - return true; - } - -public: - VertexInstance(FaceInstances& faceInstances, SelectableVertex& vertex) - : m_faceInstances(faceInstances), m_vertex(&vertex) - { - } - VertexInstance& operator=(const VertexInstance& other) - { - m_vertex = other.m_vertex; - return *this; - } - - void setSelected(bool select) - { - select_vertex(select); - } - bool isSelected() const - { - return selected_vertex(); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - SelectionIntersection best; - m_vertex->testSelect(test, best); - if(best.valid()) - { - Selector_add(selector, *this, best); - } - } -}; - -class BrushInstanceVisitor -{ -public: - virtual void visit(FaceInstance& face) const = 0; -}; - -class BrushInstance : -public BrushObserver, -public scene::Instance, -public Selectable, -public Renderable, -public SelectionTestable, -public ComponentSelectionTestable, -public ComponentEditable, -public ComponentSnappable, -public PlaneSelectable, -public LightCullable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceStaticCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - InstanceContainedCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - - Brush& m_brush; - - FaceInstances m_faceInstances; - - typedef std::vector EdgeInstances; - EdgeInstances m_edgeInstances; - typedef std::vector VertexInstances; - VertexInstances m_vertexInstances; - - ObservedSelectable m_selectable; - - mutable RenderableWireframe m_render_wireframe; - mutable RenderablePointVector m_render_selected; - mutable AABB m_aabb_component; - mutable Array m_faceCentroidPointsCulled; - RenderablePointArray m_render_faces_wireframe; - mutable bool m_viewChanged; // requires re-evaluation of view-dependent cached data - - BrushClipPlane m_clipPlane; - - static Shader* m_state_selpoint; - - const LightList* m_lightList; - - TransformModifier m_transform; - - BrushInstance(const BrushInstance& other); // NOT COPYABLE - BrushInstance& operator=(const BrushInstance& other); // NOT ASSIGNABLE -public: - static Counter* m_counter; - - typedef LazyStatic StaticTypeCasts; - - void lightsChanged() - { - m_lightList->lightsChanged(); - } - typedef MemberCaller LightsChangedCaller; - - STRING_CONSTANT(Name, "BrushInstance"); - - BrushInstance(const scene::Path& path, scene::Instance* parent, Brush& brush) : - Instance(path, parent, this, StaticTypeCasts::instance().get()), - m_brush(brush), - m_selectable(SelectedChangedCaller(*this)), - m_render_selected(GL_POINTS), - m_render_faces_wireframe(m_faceCentroidPointsCulled, GL_POINTS), - m_viewChanged(false), - m_transform(Brush::TransformChangedCaller(m_brush), ApplyTransformCaller(*this)) - { - m_brush.instanceAttach(Instance::path()); - m_brush.attach(*this); - m_counter->increment(); - - m_lightList = &GlobalShaderCache().attach(*this); - m_brush.m_lightsChanged = LightsChangedCaller(*this); ///\todo Make this work with instancing. - - Instance::setTransformChangedCallback(LightsChangedCaller(*this)); - } - ~BrushInstance() - { - Instance::setTransformChangedCallback(Callback()); - - m_brush.m_lightsChanged = Callback(); - GlobalShaderCache().detach(*this); - - m_counter->decrement(); - m_brush.detach(*this); - m_brush.instanceDetach(Instance::path()); - } - - Brush& getBrush() - { - return m_brush; - } - const Brush& getBrush() const - { - return m_brush; - } - - Bounded& get(NullType) - { - return m_brush; - } - Cullable& get(NullType) - { - return m_brush; - } - Transformable& get(NullType) - { - return m_transform; - } - - void selectedChanged(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::ePrimitive)(selectable); - GlobalSelectionSystem().onSelectedChanged(*this, selectable); - - Instance::selectedChanged(); - } - typedef MemberCaller1 SelectedChangedCaller; - - void selectedChangedComponent(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::eComponent)(selectable); - GlobalSelectionSystem().onComponentSelection(*this, selectable); - } - typedef MemberCaller1 SelectedChangedComponentCaller; - - const BrushInstanceVisitor& forEachFaceInstance(const BrushInstanceVisitor& visitor) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - visitor.visit(*i); - } - return visitor; - } - - static void constructStatic() - { - m_state_selpoint = GlobalShaderCache().capture("$SELPOINT"); - } - static void destroyStatic() - { - GlobalShaderCache().release("$SELPOINT"); - } - - void clear() - { - m_faceInstances.clear(); - } - void reserve(std::size_t size) - { - m_faceInstances.reserve(size); - } - - void push_back(Face& face) - { - m_faceInstances.push_back(FaceInstance(face, SelectedChangedComponentCaller(*this))); - } - void pop_back() - { - ASSERT_MESSAGE(!m_faceInstances.empty(), "erasing invalid element"); - m_faceInstances.pop_back(); - } - void erase(std::size_t index) - { - ASSERT_MESSAGE(index < m_faceInstances.size(), "erasing invalid element"); - m_faceInstances.erase(m_faceInstances.begin() + index); - } - void connectivityChanged() - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).connectivityChanged(); - } - } - - void edge_clear() - { - m_edgeInstances.clear(); - } - void edge_push_back(SelectableEdge& edge) - { - m_edgeInstances.push_back(EdgeInstance(m_faceInstances, edge)); - } - - void vertex_clear() - { - m_vertexInstances.clear(); - } - void vertex_push_back(SelectableVertex& vertex) - { - m_vertexInstances.push_back(VertexInstance(m_faceInstances, vertex)); - } - - void DEBUG_verify() const - { - ASSERT_MESSAGE(m_faceInstances.size() == m_brush.DEBUG_size(), "FATAL: mismatch"); - } - - bool isSelected() const - { - return m_selectable.isSelected(); - } - void setSelected(bool select) - { - m_selectable.setSelected(select); - } - - void update_selected() const - { - m_render_selected.clear(); - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - if((*i).getFace().contributes()) - { - (*i).iterate_selected(m_render_selected); - } - } - } - - void evaluateViewDependent(const VolumeTest& volume, const Matrix4& localToWorld) const - { - if(m_viewChanged) - { - m_viewChanged = false; - - bool faces_visible[c_brush_maxFaces]; - { - bool* j = faces_visible; - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i, ++j) - { - *j = (*i).intersectVolume(volume, localToWorld); - } - } - - m_brush.update_wireframe(m_render_wireframe, faces_visible); - m_brush.update_faces_wireframe(m_faceCentroidPointsCulled, faces_visible); - } - } - - void renderComponentsSelected(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - m_brush.evaluateBRep(); - - update_selected(); - if(!m_render_selected.empty()) - { - renderer.Highlight(Renderer::ePrimitive, false); - renderer.SetState(m_state_selpoint, Renderer::eWireframeOnly); - renderer.SetState(m_state_selpoint, Renderer::eFullMaterials); - renderer.addRenderable(m_render_selected, localToWorld); - } - } - - void renderComponents(Renderer& renderer, const VolumeTest& volume) const - { - m_brush.evaluateBRep(); - - const Matrix4& localToWorld = Instance::localToWorld(); - - renderer.SetState(m_brush.m_state_point, Renderer::eWireframeOnly); - renderer.SetState(m_brush.m_state_point, Renderer::eFullMaterials); - - if(volume.fill() && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace) - { - evaluateViewDependent(volume, localToWorld); - renderer.addRenderable(m_render_faces_wireframe, localToWorld); - } - else - { - m_brush.renderComponents(GlobalSelectionSystem().ComponentMode(), renderer, volume, localToWorld); - } - } - - void renderClipPlane(Renderer& renderer, const VolumeTest& volume) const - { - if(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip && isSelected()) - { - m_clipPlane.render(renderer, volume, localToWorld()); - } - } - - void renderCommon(Renderer& renderer, const VolumeTest& volume) const - { - bool componentMode = GlobalSelectionSystem().Mode() == SelectionSystem::eComponent; - - if(componentMode && isSelected()) - { - renderComponents(renderer, volume); - } - - if(parentSelected()) - { - if(!componentMode) - { - renderer.Highlight(Renderer::eFace); - } - renderer.Highlight(Renderer::ePrimitive); - } - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - //renderCommon(renderer, volume); - - m_lightList->evaluateLights(); - - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - renderer.setLights((*i).m_lights); - (*i).render(renderer, volume, localToWorld); - } - - renderComponentsSelected(renderer, volume, localToWorld); - } - - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - //renderCommon(renderer, volume); - - evaluateViewDependent(volume, localToWorld); - - if(m_render_wireframe.m_size != 0) - { - renderer.addRenderable(m_render_wireframe, localToWorld); - } - - renderComponentsSelected(renderer, volume, localToWorld); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_brush.evaluateBRep(); - - renderClipPlane(renderer, volume); - - renderSolid(renderer, volume, localToWorld()); - } - - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_brush.evaluateBRep(); - - renderClipPlane(renderer, volume); - - renderWireframe(renderer, volume, localToWorld()); - } - - void viewChanged() const - { - m_viewChanged = true; - } - - void testSelect(Selector& selector, SelectionTest& test) - { - test.BeginMesh(localToWorld()); - - SelectionIntersection best; - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).testSelect(test, best); - } - if(best.valid()) - { - selector.addIntersection(best); - } - } - - bool isSelectedComponents() const - { - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - if((*i).selectedComponents()) - { - return true; - } - } - return false; - } - void setSelectedComponents(bool select, SelectionSystem::EComponentMode mode) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).setSelected(mode, select); - } - } - void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - { - test.BeginMesh(localToWorld()); - - switch(mode) - { - case SelectionSystem::eVertex: - { - for(VertexInstances::iterator i = m_vertexInstances.begin(); i != m_vertexInstances.end(); ++i) - { - (*i).testSelect(selector, test); - } - } - break; - case SelectionSystem::eEdge: - { - for(EdgeInstances::iterator i = m_edgeInstances.begin(); i != m_edgeInstances.end(); ++i) - { - (*i).testSelect(selector, test); - } - } - break; - case SelectionSystem::eFace: - { - if(test.getVolume().fill()) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).testSelect(selector, test); - } - } - else - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).testSelect_centroid(selector, test); - } - } - } - break; - default: - break; - } - } - - void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) - { - test.BeginMesh(localToWorld()); - - PlanePointer brushPlanes[c_brush_maxFaces]; - PlanesIterator j = brushPlanes; - - for(Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i) - { - *j++ = &(*i)->plane3(); - } - - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).selectPlane(selector, Line(test.getNear(), test.getFar()), brushPlanes, j, selectedPlaneCallback); - } - } - void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).selectReversedPlane(selector, selectedPlanes); - } - } - - - void transformComponents(const Matrix4& matrix) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).transformComponents(matrix); - } - } - const AABB& getSelectedComponentsBounds() const - { - m_aabb_component = AABB(); - - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).iterate_selected(m_aabb_component); - } - - return m_aabb_component; - } - - void snapComponents(float snap) - { - for(FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).snapComponents(snap); - } - } - void evaluateTransform() - { - Matrix4 matrix(m_transform.calculateTransform()); - //globalOutputStream() << "matrix: " << matrix << "\n"; - - if(m_transform.getType() == TRANSFORM_PRIMITIVE) - { - m_brush.transform(matrix); - } - else - { - transformComponents(matrix); - } - } - void applyTransform() - { - m_brush.revertTransform(); - evaluateTransform(); - m_brush.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; - - void setClipPlane(const Plane3& plane) - { - m_clipPlane.setPlane(m_brush, plane); - } - - bool testLight(const RendererLight& light) const - { - return light.testAABB(worldAABB()); - } - void insertLight(const RendererLight& light) - { - const Matrix4& localToWorld = Instance::localToWorld(); - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - Face_addLight(*i, localToWorld, light); - } - } - void clearLights() - { - for(FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) - { - (*i).m_lights.clear(); - } - } -}; - -inline BrushInstance* Instance_getBrush(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - - -template -class BrushSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - BrushSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - BrushInstance* brush = Instance_getBrush(instance); - if(brush != 0) - { - m_functor(*brush); - } - } -}; - -template -inline const Functor& Scene_forEachSelectedBrush(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(BrushSelectedVisitor(functor)); - return functor; -} - -template -class BrushVisibleSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - BrushVisibleSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - BrushInstance* brush = Instance_getBrush(instance); - if(brush != 0 - && instance.path().top().get().visible()) - { - m_functor(*brush); - } - } -}; - -template -inline const Functor& Scene_forEachVisibleSelectedBrush(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(BrushVisibleSelectedVisitor(functor)); - return functor; -} - -class BrushForEachFace -{ - const BrushInstanceVisitor& m_visitor; -public: - BrushForEachFace(const BrushInstanceVisitor& visitor) : m_visitor(visitor) - { - } - void operator()(BrushInstance& brush) const - { - brush.forEachFaceInstance(m_visitor); - } -}; - -template -class FaceInstanceVisitFace : public BrushInstanceVisitor -{ - const Functor& functor; -public: - FaceInstanceVisitFace(const Functor& functor) - : functor(functor) - { - } - void visit(FaceInstance& face) const - { - functor(face.getFace()); - } -}; - -template -inline const Functor& Brush_forEachFace(BrushInstance& brush, const Functor& functor) -{ - brush.forEachFaceInstance(FaceInstanceVisitFace(functor)); - return functor; -} - -template -class FaceVisitAll : public BrushVisitor -{ - const Functor& functor; -public: - FaceVisitAll(const Functor& functor) - : functor(functor) - { - } - void visit(Face& face) const - { - functor(face); - } -}; - -template -inline const Functor& Brush_forEachFace(const Brush& brush, const Functor& functor) -{ - brush.forEachFace(FaceVisitAll(functor)); - return functor; -} - -template -inline const Functor& Brush_forEachFace(Brush& brush, const Functor& functor) -{ - brush.forEachFace(FaceVisitAll(functor)); - return functor; -} - -template -class FaceInstanceVisitAll : public BrushInstanceVisitor -{ - const Functor& functor; -public: - FaceInstanceVisitAll(const Functor& functor) - : functor(functor) - { - } - void visit(FaceInstance& face) const - { - functor(face); - } -}; - -template -inline const Functor& Brush_ForEachFaceInstance(BrushInstance& brush, const Functor& functor) -{ - brush.forEachFaceInstance(FaceInstanceVisitAll(functor)); - return functor; -} - -template -inline const Functor& Scene_forEachBrush(scene::Graph& graph, const Functor& functor) -{ - graph.traverse(InstanceWalker< InstanceApply >(functor)); - return functor; -} - -template -class InstanceIfVisible : public Functor -{ -public: - InstanceIfVisible(const Functor& functor) : Functor(functor) - { - } - void operator()(scene::Instance& instance) - { - if(instance.path().top().get().visible()) - { - Functor::operator()(instance); - } - } -}; - -template -class BrushVisibleWalker : public scene::Graph::Walker -{ - const Functor& m_functor; -public: - BrushVisibleWalker(const Functor& functor) : m_functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - BrushInstance* brush = Instance_getBrush(instance); - if(brush != 0) - { - m_functor(*brush); - } - } - return true; - } -}; - -template -inline const Functor& Scene_forEachVisibleBrush(scene::Graph& graph, const Functor& functor) -{ - graph.traverse(BrushVisibleWalker(functor)); - return functor; -} - -template -inline const Functor& Scene_ForEachBrush_ForEachFace(scene::Graph& graph, const Functor& functor) -{ - Scene_forEachBrush(graph, BrushForEachFace(FaceInstanceVisitFace(functor))); - return functor; -} - -// d1223m -template -inline const Functor& Scene_ForEachBrush_ForEachFaceInstance(scene::Graph& graph, const Functor& functor) -{ - Scene_forEachBrush(graph, BrushForEachFace(FaceInstanceVisitAll(functor))); - return functor; -} - -template -inline const Functor& Scene_ForEachSelectedBrush_ForEachFace(scene::Graph& graph, const Functor& functor) -{ - Scene_forEachSelectedBrush(BrushForEachFace(FaceInstanceVisitFace(functor))); - return functor; -} - -template -inline const Functor& Scene_ForEachSelectedBrush_ForEachFaceInstance(scene::Graph& graph, const Functor& functor) -{ - Scene_forEachSelectedBrush(BrushForEachFace(FaceInstanceVisitAll(functor))); - return functor; -} - -template -class FaceVisitorWrapper -{ - const Functor& functor; -public: - FaceVisitorWrapper(const Functor& functor) : functor(functor) - { - } - - void operator()(FaceInstance& faceInstance) const - { - functor(faceInstance.getFace()); - } -}; - -template -inline const Functor& Scene_ForEachSelectedBrushFace(scene::Graph& graph, const Functor& functor) -{ - g_SelectedFaceInstances.foreach(FaceVisitorWrapper(functor)); - return functor; -} - - -#endif +// brush.h + +// some usefull flags to control the behaviour of Brush_Build +extern bool g_bBuildWindingsNoTexBuild; + +void Brush_AddToList (brush_t *b, brush_t *lst); +void Brush_Build(brush_t *b, bool bSnap = true, bool bMarkMap = true, bool bConvert = false, bool bFilterTest = true); +void Brush_SetBuildWindingsNoTexBuild(bool bBuild); +void Brush_BuildWindings( brush_t *b, bool bSnap = true ); +brush_t* Brush_Clone (brush_t *b); +brush_t* Brush_FullClone(brush_t *b); +brush_t* Brush_Create (vec3_t mins, vec3_t maxs, texdef_t *texdef); +void Brush_Resize(brush_t *b, vec3_t vMin, vec3_t vMax); +void Brush_FaceDraw(face_t *face, int nGLState); +void Brush_Draw( brush_t *b ); +void Brush_DrawXY(brush_t *b, int nViewType); +// set bRemoveNode to false to avoid trying to delete the item in group view tree control +void Brush_Free (brush_t *b, bool bRemoveNode = true); +int Brush_MemorySize(brush_t *b); +void Brush_MakeSided (int sides); +void Brush_MakeSidedCone (int sides); +void Brush_Move (brush_t *b, const vec3_t move, bool bSnap = true); +int Brush_MoveVertex(brush_t *b, vec3_t vertex, vec3_t delta, vec3_t end, bool bSnap = true); +void Brush_ResetFaceOriginals(brush_t *b); +face_t* Brush_Ray (vec3_t origin, vec3_t dir, brush_t *b, float *dist, int nFlags = 0); +void Brush_RemoveFromList (brush_t *b); +// bCaulk means the faces created during the operation will be caulked, this is used in conjunction with g_PrefsDlg.m_bClipCaulk +void Brush_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back, boolean bCaulk = false); +void Brush_SelectFaceForDragging (brush_t *b, face_t *f, qboolean shear); +void Brush_SetTexture (brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef= (IPluginTexdef*)NULL); +void Brush_SideSelect (brush_t *b, vec3_t origin, vec3_t dir, qboolean shear); +void Brush_SnapToGrid(brush_t *pb); +void Brush_Rotate(brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild = true); +void Brush_MakeSidedSphere(int sides); +//void Brush_Write (brush_t *b, FILE *f); +//void Brush_Write (brush_t *b, MemStream* pMemFile); +void Brush_RemoveEmptyFaces ( brush_t *b ); +winding_t* Brush_MakeFaceWinding (brush_t *b, face_t *face); + +void Brush_RefreshShader(brush_t *b); + +int AddPlanept (float *f); +float SetShadeForPlane (plane_t *p); + +face_t* Face_Alloc( void ); +void Face_Free( face_t *f ); +face_t* Face_Clone (face_t *f); +void Face_SetShader(face_t *face, const char *name); +/*! +faster version if you know the IShader already +(instead of hash table lookup by name) +*/ +void Face_SetShader(face_t *face, IShader *shader); +void Face_MakePlane (face_t *f); +void Face_Draw( face_t *face ); +void Face_TextureVectors (face_t *f, float STfromXYZ[2][4]); +void SetFaceTexdef (face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL ); + +void Face_FitTexture( face_t * face, int nHeight, int nWidth ); +void Brush_FitTexture( brush_t *b, int nHeight, int nWidth ); +//void Brush_SetEpair(brush_t *b, const char *pKey, const char *pValue); +//const char* Brush_GetKeyValue(brush_t *b, const char *pKey); +brush_t *Brush_Alloc(); +const char* Brush_Name(brush_t *b); + +//eclass_t* HasModel(brush_t *b); +void aabb_draw(const aabb_t *aabb, int mode); diff --git a/radiant/brush_primit.cpp b/radiant/brush_primit.cpp index 02b821dd..915ea332 100644 --- a/radiant/brush_primit.cpp +++ b/radiant/brush_primit.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,431 +19,12 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "brush_primit.h" - -#include "debugging/debugging.h" - -#include "itexdef.h" -#include "itextures.h" - -#include - -#include "stringio.h" -#include "texturelib.h" -#include "math/matrix.h" -#include "math/plane.h" -#include "math/aabb.h" - -#include "winding.h" -#include "preferences.h" - - -/*! -\brief Construct a transform from XYZ space to ST space (3d to 2d). -This will be one of three axis-aligned spaces, depending on the surface normal. -NOTE: could also be done by swapping values. -*/ -void Normal_GetTransform(const Vector3& normal, Matrix4& transform) -{ - switch (projectionaxis_for_normal(normal)) - { - case eProjectionAxisZ: - transform[0] = 1; - transform[1] = 0; - transform[2] = 0; - - transform[4] = 0; - transform[5] = 1; - transform[6] = 0; - - transform[8] = 0; - transform[9] = 0; - transform[10] = 1; - break; - case eProjectionAxisY: - transform[0] = 1; - transform[1] = 0; - transform[2] = 0; - - transform[4] = 0; - transform[5] = 0; - transform[6] = -1; - - transform[8] = 0; - transform[9] = 1; - transform[10] = 0; - break; - case eProjectionAxisX: - transform[0] = 0; - transform[1] = 0; - transform[2] = 1; - - transform[4] = 1; - transform[5] = 0; - transform[6] = 0; - - transform[8] = 0; - transform[9] = 1; - transform[10] = 0; - break; - } - transform[3] = transform[7] = transform[11] = transform[12] = transform[13] = transform[14] = 0; - transform[15] = 1; -} - -/*! -\brief Construct a transform in ST space from the texdef. -Transforms constructed from quake's texdef format are (-shift)*(1/scale)*(-rotate) with x translation sign flipped. -This would really make more sense if it was inverseof(shift*rotate*scale).. oh well. -*/ -inline void Texdef_toTransform(const texdef_t& texdef, float width, float height, Matrix4& transform) -{ - double inverse_scale[2]; - - // transform to texdef shift/scale/rotate - inverse_scale[0] = 1 / (texdef.scale[0] * width); - inverse_scale[1] = 1 / (texdef.scale[1] * -height); - transform[12] = texdef.shift[0] / width; - transform[13] = -texdef.shift[1] / -height; - double c = cos(degrees_to_radians(-texdef.rotate)); - double s = sin(degrees_to_radians(-texdef.rotate)); - transform[0] = static_cast(c * inverse_scale[0]); - transform[1] = static_cast(s * inverse_scale[1]); - transform[4] = static_cast(-s * inverse_scale[0]); - transform[5] = static_cast(c * inverse_scale[1]); - transform[2] = transform[3] = transform[6] = transform[7] = transform[8] = transform[9] = transform[11] = transform[14] = 0; - transform[10] = transform[15] = 1; -} - -inline void BPTexdef_toTransform(const brushprimit_texdef_t& bp_texdef, Matrix4& transform) -{ - transform = g_matrix4_identity; - transform.xx() = bp_texdef.coords[0][0]; - transform.yx() = bp_texdef.coords[0][1]; - transform.tx() = bp_texdef.coords[0][2]; - transform.xy() = bp_texdef.coords[1][0]; - transform.yy() = bp_texdef.coords[1][1]; - transform.ty() = bp_texdef.coords[1][2]; -} - -inline void Texdef_toTransform(const TextureProjection& projection, float width, float height, Matrix4& transform) -{ - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_toTransform(projection.m_brushprimit_texdef, transform); - } - else - { - Texdef_toTransform(projection.m_texdef, width, height, transform); - } -} - -// handles degenerate cases, just in case library atan2 doesn't -inline double arctangent_yx(double y, double x) -{ - if(fabs(x) > 1.0E-6) - { - return atan2(y, x); - } - else if(y > 0) - { - return c_half_pi; - } - else - { - return -c_half_pi; - } -} - -inline void Texdef_fromTransform(texdef_t& texdef, float width, float height, const Matrix4& transform) -{ - texdef.scale[0] = static_cast((1.0 / vector2_length(Vector2(transform[0], transform[4]))) / width); - texdef.scale[1] = static_cast((1.0 / vector2_length(Vector2(transform[1], transform[5]))) / height); - - texdef.rotate = static_cast(-radians_to_degrees(arctangent_yx(-transform[4], transform[0]))); - - if(texdef.rotate == -180.0f) - { - texdef.rotate = 180.0f; - } - - texdef.shift[0] = transform[12] * width; - texdef.shift[1] = transform[13] * height; - - // If the 2d cross-product of the x and y axes is positive, one of the axes has a negative scale. - if(vector2_cross(Vector2(transform[0], transform[4]), Vector2(transform[1], transform[5])) > 0) - { - if(texdef.rotate >= 180.0f) - { - texdef.rotate -= 180.0f; - texdef.scale[0] = -texdef.scale[0]; - } - else - { - texdef.scale[1] = -texdef.scale[1]; - } - } - //globalOutputStream() << "fromTransform: " << texdef.shift[0] << " " << texdef.shift[1] << " " << texdef.scale[0] << " " << texdef.scale[1] << " " << texdef.rotate << "\n"; -} - -inline void BPTexdef_fromTransform(brushprimit_texdef_t& bp_texdef, const Matrix4& transform) -{ - bp_texdef.coords[0][0] = transform.xx(); - bp_texdef.coords[0][1] = transform.yx(); - bp_texdef.coords[0][2] = transform.tx(); - bp_texdef.coords[1][0] = transform.xy(); - bp_texdef.coords[1][1] = transform.yy(); - bp_texdef.coords[1][2] = transform.ty(); -} - -inline void Texdef_fromTransform(TextureProjection& projection, float width, float height, const Matrix4& transform) -{ - ASSERT_MESSAGE((transform[0] != 0 || transform[4] != 0) - && (transform[1] != 0 || transform[5] != 0), "invalid texture matrix"); - - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_fromTransform(projection.m_brushprimit_texdef, transform); - } - else - { - Texdef_fromTransform(projection.m_texdef, width, height, transform); - } -} - -inline void Texdef_normalise(texdef_t& texdef, float width, float height) -{ - // it may be useful to also normalise the rotation here, if this function is used elsewhere. - texdef.shift[0] = float_mod(texdef.shift[0], width); - texdef.shift[1] = float_mod(texdef.shift[1], height); - //globalOutputStream() << "normalise: " << texdef.shift[0] << " " << texdef.shift[1] << " " << texdef.scale[0] << " " << texdef.scale[1] << " " << texdef.rotate << "\n"; -} - -inline void BPTexdef_normalise(brushprimit_texdef_t& bp_texdef, float width, float height) -{ - bp_texdef.coords[0][2] = float_mod(bp_texdef.coords[0][2], width); - bp_texdef.coords[1][2] = float_mod(bp_texdef.coords[1][2], height); -} - -/// \brief Normalise \p projection for a given texture \p width and \p height. -/// -/// All texture-projection translation (shift) values are congruent modulo the dimensions of the texture. -/// This function normalises shift values to the smallest positive congruent values. -void Texdef_normalise(TextureProjection& projection, float width, float height) -{ - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_normalise(projection.m_brushprimit_texdef, width, height); - } - else - { - Texdef_normalise(projection.m_texdef, width, height); - } -} - -void ComputeAxisBase(const Vector3& normal, Vector3& texS, Vector3& texT); - -inline void DebugAxisBase(const Vector3& normal) -{ - Vector3 x, y; - ComputeAxisBase(normal, x, y); - globalOutputStream() << "BP debug: " << x << y << normal << "\n"; -} - -void Texdef_basisForNormal(const TextureProjection& projection, const Vector3& normal, Matrix4& basis) -{ - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - basis = g_matrix4_identity; - ComputeAxisBase(normal, vector4_to_vector3(basis.x()), vector4_to_vector3(basis.y())); - vector4_to_vector3(basis.z()) = normal; - matrix4_transpose(basis); - //DebugAxisBase(normal); - } - else if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_HALFLIFE) - { - basis = g_matrix4_identity; - vector4_to_vector3(basis.x()) = projection.m_basis_s; - vector4_to_vector3(basis.y()) = vector3_negated(projection.m_basis_t); - vector4_to_vector3(basis.z()) = vector3_normalised(vector3_cross(vector4_to_vector3(basis.x()), vector4_to_vector3(basis.y()))); - matrix4_multiply_by_matrix4(basis, matrix4_rotation_for_z_degrees(-projection.m_texdef.rotate)); - //globalOutputStream() << "debug: " << projection.m_basis_s << projection.m_basis_t << normal << "\n"; - matrix4_transpose(basis); - } - else - { - Normal_GetTransform(normal, basis); - } -} - -void Texdef_EmitTextureCoordinates(const TextureProjection& projection, std::size_t width, std::size_t height, Winding& w, const Vector3& normal, const Matrix4& localToWorld) -{ - if(w.numpoints < 3) - { - return; - } - //globalOutputStream() << "normal: " << normal << "\n"; - - Matrix4 local2tex; - Texdef_toTransform(projection, (float)width, (float)height, local2tex); - //globalOutputStream() << "texdef: " << static_cast(local2tex.x()) << static_cast(local2tex.y()) << "\n"; - -#if 0 - { - TextureProjection tmp; - Texdef_fromTransform(tmp, (float)width, (float)height, local2tex); - Matrix4 tmpTransform; - Texdef_toTransform(tmp, (float)width, (float)height, tmpTransform); - ASSERT_MESSAGE(matrix4_equal_epsilon(local2tex, tmpTransform, 0.0001f), "bleh"); - } -#endif - - { - Matrix4 xyz2st; - // we don't care if it's not normalised... - Texdef_basisForNormal(projection, matrix4_transformed_direction(localToWorld, normal), xyz2st); - //globalOutputStream() << "basis: " << static_cast(xyz2st.x()) << static_cast(xyz2st.y()) << static_cast(xyz2st.z()) << "\n"; - matrix4_multiply_by_matrix4(local2tex, xyz2st); - } - - Vector3 tangent(vector3_normalised(vector4_to_vector3(matrix4_transposed(local2tex).x()))); - Vector3 bitangent(vector3_normalised(vector4_to_vector3(matrix4_transposed(local2tex).y()))); - - matrix4_multiply_by_matrix4(local2tex, localToWorld); - - for(Winding::iterator i = w.begin(); i != w.end(); ++i) - { - Vector3 texcoord = matrix4_transformed_point(local2tex, (*i).vertex); - (*i).texcoord[0] = texcoord[0]; - (*i).texcoord[1] = texcoord[1]; - - (*i).tangent = tangent; - (*i).bitangent = bitangent; - } -} - -/*! -\brief Provides the axis-base of the texture ST space for this normal, -as they had been transformed to world XYZ space. -*/ -void TextureAxisFromNormal(const Vector3& normal, Vector3& s, Vector3& t) -{ - switch (projectionaxis_for_normal(normal)) - { - case eProjectionAxisZ: - s[0] = 1; - s[1] = 0; - s[2] = 0; - - t[0] = 0; - t[1] = -1; - t[2] = 0; - - break; - case eProjectionAxisY: - s[0] = 1; - s[1] = 0; - s[2] = 0; - - t[0] = 0; - t[1] = 0; - t[2] = -1; - - break; - case eProjectionAxisX: - s[0] = 0; - s[1] = 1; - s[2] = 0; - - t[0] = 0; - t[1] = 0; - t[2] = -1; - - break; - } -} - -void Texdef_Assign(texdef_t& td, const texdef_t& other) -{ - td = other; -} - -void Texdef_Shift(texdef_t& td, float s, float t) -{ - td.shift[0] += s; - td.shift[1] += t; -} - -void Texdef_Scale(texdef_t& td, float s, float t) -{ - td.scale[0] += s; - td.scale[1] += t; -} - -void Texdef_Rotate(texdef_t& td, float angle) -{ - td.rotate += angle; - td.rotate = static_cast(float_to_integer(td.rotate) % 360); -} - -// NOTE: added these from Ritual's Q3Radiant -void ClearBounds(Vector3& mins, Vector3& maxs) -{ - mins[0] = mins[1] = mins[2] = 99999; - maxs[0] = maxs[1] = maxs[2] = -99999; -} - -void AddPointToBounds(const Vector3& v, Vector3& mins, Vector3& maxs) -{ - int i; - float val; - - for (i=0 ; i<3 ; i++) - { - val = v[i]; - if (val < mins[i]) - mins[i] = val; - if (val > maxs[i]) - maxs[i] = val; - } -} - -template -inline BasicVector3 vector3_inverse(const BasicVector3& self) -{ - return BasicVector3( - Element(1.0 / self.x()), - Element(1.0 / self.y()), - Element(1.0 / self.z()) - ); -} - -// low level functions .. put in mathlib? -#define BPMatCopy(a,b) {b[0][0] = a[0][0]; b[0][1] = a[0][1]; b[0][2] = a[0][2]; b[1][0] = a[1][0]; b[1][1] = a[1][1]; b[1][2] = a[1][2];} -// apply a scale transformation to the BP matrix -#define BPMatScale(m,sS,sT) {m[0][0]*=sS; m[1][0]*=sS; m[0][1]*=sT; m[1][1]*=sT;} -// apply a translation transformation to a BP matrix -#define BPMatTranslate(m,s,t) {m[0][2] += m[0][0]*s + m[0][1]*t; m[1][2] += m[1][0]*s+m[1][1]*t;} -// 2D homogeneous matrix product C = A*B -void BPMatMul(float A[2][3], float B[2][3], float C[2][3]); -// apply a rotation (degrees) -void BPMatRotate(float A[2][3], float theta); -#ifdef _DEBUG -void BPMatDump(float A[2][3]); -#endif - -#ifdef _DEBUG -//#define DBG_BP -#endif - - -bp_globals_t g_bp_globals; -float g_texdef_default_scale; +#include "stdafx.h" // compute a determinant using Sarrus rule //++timo "inline" this with a macro -// NOTE : the three vectors are understood as columns of the matrix -inline float SarrusDet(const Vector3& a, const Vector3& b, const Vector3& c) +// NOTE : the three vec3_t are understood as columns of the matrix +vec_t SarrusDet(vec3_t a, vec3_t b, vec3_t c) { return a[0]*b[1]*c[2]+b[0]*c[1]*a[2]+c[0]*a[1]*b[2] -c[0]*b[1]*a[2]-a[1]*b[0]*c[2]-a[0]*b[2]*c[1]; @@ -456,11 +37,11 @@ inline float SarrusDet(const Vector3& a, const Vector3& b, const Vector3& c) // NOTE: the third coord of the A,B,C point is ignored // NOTE: see the commented out section to fill M and D //++timo TODO: update the other members to use this when possible -void MatrixForPoints( Vector3 M[3], Vector3 D[2], brushprimit_texdef_t *T ) +void MatrixForPoints( vec3_t M[3], vec3_t D[2], brushprimit_texdef_t *T ) { -// Vector3 M[3]; // columns of the matrix .. easier that way (the indexing is not standard! it's column-line .. later computations are easier that way) - float det; -// Vector3 D[2]; +// vec3_t M[3]; // columns of the matrix .. easier that way (the indexing is not standard! it's column-line .. later computations are easier that way) + vec_t det; +// vec3_t D[2]; M[2][0]=1.0f; M[2][1]=1.0f; M[2][2]=1.0f; #if 0 // fill the data vectors @@ -488,40 +69,16 @@ void MatrixForPoints( Vector3 M[3], Vector3 D[2], brushprimit_texdef_t *T ) // NOTE : ComputeAxisBase here and in q3map code must always BE THE SAME ! // WARNING : special case behaviour of atan2(y,x) <-> atan(y/x) might not be the same everywhere when x == 0 // rotation by (0,RotY,RotZ) assigns X to normal -void ComputeAxisBase(const Vector3& normal, Vector3& texS, Vector3& texT) +void ComputeAxisBase(vec3_t normal,vec3_t texS,vec3_t texT ) { -#if 1 - const Vector3 up(0, 0, 1); - const Vector3 down(0, 0, -1); - - if(vector3_equal_epsilon(normal, up, float(1e-6))) - { - texS = Vector3(0, 1, 0); - texT = Vector3(1, 0, 0); - } - else if(vector3_equal_epsilon(normal, down, float(1e-6))) - { - texS = Vector3(0, 1, 0); - texT = Vector3(-1, 0, 0); - } - else - { - texS = vector3_normalised(vector3_cross(normal, up)); - texT = vector3_normalised(vector3_cross(normal, texS)); - vector3_negate(texS); - } - -#else - float RotY,RotZ; + vec_t RotY,RotZ; // do some cleaning - /* if (fabs(normal[0])<1e-6) normal[0]=0.0f; if (fabs(normal[1])<1e-6) normal[1]=0.0f; if (fabs(normal[2])<1e-6) normal[2]=0.0f; - */ RotY=-atan2(normal[2],sqrt(normal[1]*normal[1]+normal[0]*normal[0])); RotZ=atan2(normal[1],normal[0]); // rotate (0,1,0) and (0,0,1) to compute texS and texT @@ -532,16 +89,14 @@ void ComputeAxisBase(const Vector3& normal, Vector3& texS, Vector3& texT) texT[0]=-sin(RotY)*cos(RotZ); texT[1]=-sin(RotY)*sin(RotZ); texT[2]=-cos(RotY); -#endif } -#if 0 // texdef conversion void FaceToBrushPrimitFace(face_t *f) { - Vector3 texX,texY; - Vector3 proj; + vec3_t texX,texY; + vec3_t proj; // ST of (0,0) (1,0) (0,1) - float ST[3][5]; // [ point index ] [ xyz ST ] + vec_t ST[3][5]; // [ point index ] [ xyz ST ] //++timo not used as long as brushprimit_texdef and texdef are static /* f->brushprimit_texdef.contents=f->texdef.contents; f->brushprimit_texdef.flags=f->texdef.flags; @@ -550,12 +105,12 @@ void FaceToBrushPrimitFace(face_t *f) #ifdef DBG_BP if ( f->plane.normal[0]==0.0f && f->plane.normal[1]==0.0f && f->plane.normal[2]==0.0f ) { - globalOutputStream() << "Warning : f->plane.normal is (0,0,0) in FaceToBrushPrimitFace\n"; + Sys_Printf("Warning : f->plane.normal is (0,0,0) in FaceToBrushPrimitFace\n"); } // check d_texture if (!f->d_texture) { - globalOutputStream() << "Warning : f.d_texture is 0 in FaceToBrushPrimitFace\n"; + Sys_Printf("Warning : f.d_texture is NULL in FaceToBrushPrimitFace\n"); return; } #endif @@ -569,13 +124,13 @@ void FaceToBrushPrimitFace(face_t *f) // (0,1) in plane axis base is texY in world coordinates + projection on the affine plane // use old texture code to compute the ST coords of these points VectorCopy(proj,ST[0]); - EmitTextureCoordinates(ST[0], f->pShader->getTexture(), f); + EmitTextureCoordinates(ST[0], f->d_texture, f); VectorCopy(texX,ST[1]); VectorAdd(ST[1],proj,ST[1]); - EmitTextureCoordinates(ST[1], f->pShader->getTexture(), f); + EmitTextureCoordinates(ST[1], f->d_texture, f); VectorCopy(texY,ST[2]); VectorAdd(ST[2],proj,ST[2]); - EmitTextureCoordinates(ST[2], f->pShader->getTexture(), f); + EmitTextureCoordinates(ST[2], f->d_texture, f); // compute texture matrix f->brushprimit_texdef.coords[0][2]=ST[0][3]; f->brushprimit_texdef.coords[1][2]=ST[0][4]; @@ -586,10 +141,10 @@ void FaceToBrushPrimitFace(face_t *f) } // compute texture coordinates for the winding points -void EmitBrushPrimitTextureCoordinates(face_t * f, Winding * w) +void EmitBrushPrimitTextureCoordinates(face_t * f, winding_t * w) { - Vector3 texX,texY; - float x,y; + vec3_t texX,texY; + vec_t x,y; // compute axis base ComputeAxisBase(f->plane.normal,texX,texY); // in case the texcoords matrix is empty, build a default one @@ -598,145 +153,114 @@ void EmitBrushPrimitTextureCoordinates(face_t * f, Winding * w) { f->brushprimit_texdef.coords[0][0] = 1.0f; f->brushprimit_texdef.coords[1][1] = 1.0f; - ConvertTexMatWithQTexture( &f->brushprimit_texdef, 0, &f->brushprimit_texdef, f->pShader->getTexture() ); + ConvertTexMatWithQTexture( &f->brushprimit_texdef, NULL, &f->brushprimit_texdef, f->d_texture ); } int i; - for (i=0 ; inumpoints ; i++) { - x=vector3_dot(w.point_at(i),texX); - y=vector3_dot(w.point_at(i),texY); -#if 0 + x=DotProduct(w->points[i],texX); + y=DotProduct(w->points[i],texY); #ifdef DBG_BP - if (g_bp_globals.bNeedConvert) + if (g_qeglobals.bNeedConvert) { // check we compute the same ST as the traditional texture computation used before - float S=f->brushprimit_texdef.coords[0][0]*x+f->brushprimit_texdef.coords[0][1]*y+f->brushprimit_texdef.coords[0][2]; - float T=f->brushprimit_texdef.coords[1][0]*x+f->brushprimit_texdef.coords[1][1]*y+f->brushprimit_texdef.coords[1][2]; - if ( fabs(S-w.point_at(i)[3])>1e-2 || fabs(T-w.point_at(i)[4])>1e-2 ) + vec_t S=f->brushprimit_texdef.coords[0][0]*x+f->brushprimit_texdef.coords[0][1]*y+f->brushprimit_texdef.coords[0][2]; + vec_t T=f->brushprimit_texdef.coords[1][0]*x+f->brushprimit_texdef.coords[1][1]*y+f->brushprimit_texdef.coords[1][2]; + if ( fabs(S-w->points[i][3])>1e-2 || fabs(T-w->points[i][4])>1e-2 ) { - if ( fabs(S-w.point_at(i)[3])>1e-4 || fabs(T-w.point_at(i)[4])>1e-4 ) - globalOutputStream() << "Warning : precision loss in brush -> brush primitive texture computation\n"; + if ( fabs(S-w->points[i][3])>1e-4 || fabs(T-w->points[i][4])>1e-4 ) + Sys_Printf("Warning : precision loss in brush -> brush primitive texture computation\n"); else - globalOutputStream() << "Warning : brush -> brush primitive texture computation bug detected\n"; + Sys_Printf("Warning : brush -> brush primitive texture computation bug detected\n"); } } #endif -#endif - w.point_at(i)[3]=f->brushprimit_texdef.coords[0][0]*x+f->brushprimit_texdef.coords[0][1]*y+f->brushprimit_texdef.coords[0][2]; - w.point_at(i)[4]=f->brushprimit_texdef.coords[1][0]*x+f->brushprimit_texdef.coords[1][1]*y+f->brushprimit_texdef.coords[1][2]; + w->points[i][3]=f->brushprimit_texdef.coords[0][0]*x+f->brushprimit_texdef.coords[0][1]*y+f->brushprimit_texdef.coords[0][2]; + w->points[i][4]=f->brushprimit_texdef.coords[1][0]*x+f->brushprimit_texdef.coords[1][1]*y+f->brushprimit_texdef.coords[1][2]; } } -#endif - -typedef float texmat_t[2][3]; - -void TexMat_Scale(texmat_t texmat, float s, float t) -{ - texmat[0][0] *= s; - texmat[0][1] *= s; - texmat[0][2] *= s; - texmat[1][0] *= t; - texmat[1][1] *= t; - texmat[1][2] *= t; -} - -void TexMat_Assign(texmat_t texmat, const texmat_t other) -{ - texmat[0][0] = other[0][0]; - texmat[0][1] = other[0][1]; - texmat[0][2] = other[0][2]; - texmat[1][0] = other[1][0]; - texmat[1][1] = other[1][1]; - texmat[1][2] = other[1][2]; -} - -void ConvertTexMatWithDimensions(const texmat_t texmat1, std::size_t w1, std::size_t h1, - texmat_t texmat2, std::size_t w2, std::size_t h2) -{ - TexMat_Assign(texmat2, texmat1); - TexMat_Scale(texmat2, static_cast(w1) / static_cast(w2), static_cast(h1) / static_cast(h2)); -} - -#if 0 -// convert a texture matrix between two qtexture_t -// if 0 for qtexture_t, basic 2x2 texture is assumed ( straight mapping between s/t coordinates and geometric coordinates ) -void ConvertTexMatWithQTexture( const float texMat1[2][3], const qtexture_t *qtex1, float texMat2[2][3], const qtexture_t *qtex2 ) -{ - ConvertTexMatWithDimensions(texMat1, (qtex1) ? qtex1->width : 2, (qtex1) ? qtex1->height : 2, - texMat2, (qtex2) ? qtex2->width : 2, (qtex2) ? qtex2->height : 2); -} - -void ConvertTexMatWithQTexture( const brushprimit_texdef_t *texMat1, const qtexture_t *qtex1, brushprimit_texdef_t *texMat2, const qtexture_t *qtex2 ) -{ - ConvertTexMatWithQTexture(texMat1->coords, qtex1, texMat2->coords, qtex2); -} -#endif // compute a fake shift scale rot representation from the texture matrix // these shift scale rot values are to be understood in the local axis base -// Note: this code looks similar to Texdef_fromTransform, but the algorithm is slightly different. - -void TexMatToFakeTexCoords(const brushprimit_texdef_t& bp_texdef, texdef_t& texdef) +void TexMatToFakeTexCoords( vec_t texMat[2][3], float shift[2], float *rot, float scale[2] ) { - texdef.scale[0] = static_cast(1.0 / vector2_length(Vector2(bp_texdef.coords[0][0], bp_texdef.coords[1][0]))); - texdef.scale[1] = static_cast(1.0 / vector2_length(Vector2(bp_texdef.coords[0][1], bp_texdef.coords[1][1]))); - - texdef.rotate = -static_cast(radians_to_degrees(arctangent_yx(bp_texdef.coords[1][0], bp_texdef.coords[0][0]))); - - texdef.shift[0] = -bp_texdef.coords[0][2]; - texdef.shift[1] = bp_texdef.coords[1][2]; - - // determine whether or not an axis is flipped using a 2d cross-product - double cross = vector2_cross(Vector2(bp_texdef.coords[0][0], bp_texdef.coords[0][1]), Vector2(bp_texdef.coords[1][0], bp_texdef.coords[1][1])); - if(cross < 0) - { - // This is a bit of a compromise when using BPs--since we don't know *which* axis was flipped, - // we pick one (rather arbitrarily) using the following convention: If the X-axis is between - // 0 and 180, we assume it's the Y-axis that flipped, otherwise we assume it's the X-axis and - // subtract out 180 degrees to compensate. - if(texdef.rotate >= 180.0f) - { - texdef.rotate -= 180.0f; - texdef.scale[0] = -texdef.scale[0]; - } - else - { - texdef.scale[1] = -texdef.scale[1]; - } - } +#ifdef DBG_BP + // check this matrix is orthogonal + if (fabs(texMat[0][0]*texMat[0][1]+texMat[1][0]*texMat[1][1])>ZERO_EPSILON) + Sys_Printf("Warning : non orthogonal texture matrix in TexMatToFakeTexCoords\n"); +#endif + scale[0]=sqrt(texMat[0][0]*texMat[0][0]+texMat[1][0]*texMat[1][0]); + scale[1]=sqrt(texMat[0][1]*texMat[0][1]+texMat[1][1]*texMat[1][1]); +#ifdef DBG_BP + if (scale[0]0) + *rot=90.0f; + else + *rot=-90.0f; + } + else + *rot = RAD2DEG( atan2( texMat[1][0], texMat[0][0] ) ); + shift[0] = -texMat[0][2]; + shift[1] = texMat[1][2]; } // compute back the texture matrix from fake shift scale rot -void FakeTexCoordsToTexMat(const texdef_t& texdef, brushprimit_texdef_t& bp_texdef) +// the matrix returned must be understood as a qtexture_t with width=2 height=2 ( the default one ) +void FakeTexCoordsToTexMat( float shift[2], float rot, float scale[2], vec_t texMat[2][3] ) { - double r = degrees_to_radians(-texdef.rotate); - double c = cos(r); - double s = sin(r); - double x = 1.0f / texdef.scale[0]; - double y = 1.0f / texdef.scale[1]; - bp_texdef.coords[0][0] = static_cast(x * c); - bp_texdef.coords[1][0] = static_cast(x * s); - bp_texdef.coords[0][1] = static_cast(y * -s); - bp_texdef.coords[1][1] = static_cast(y * c); - bp_texdef.coords[0][2] = -texdef.shift[0]; - bp_texdef.coords[1][2] = texdef.shift[1]; + texMat[0][0] = scale[0] * cos( DEG2RAD( rot ) ); + texMat[1][0] = scale[0] * sin( DEG2RAD( rot ) ); + texMat[0][1] = -1.0f * scale[1] * sin( DEG2RAD( rot ) ); + texMat[1][1] = scale[1] * cos( DEG2RAD( rot ) ); + texMat[0][2] = -shift[0]; + texMat[1][2] = shift[1]; +} + +// convert a texture matrix between two qtexture_t +// if NULL for qtexture_t, basic 2x2 texture is assumed ( straight mapping between s/t coordinates and geometric coordinates ) +void ConvertTexMatWithQTexture( vec_t texMat1[2][3], qtexture_t *qtex1, vec_t texMat2[2][3], qtexture_t *qtex2 ) +{ + float s1,s2; + s1 = ( qtex1 ? static_cast( qtex1->width ) : 2.0f ) / ( qtex2 ? static_cast( qtex2->width ) : 2.0f ); + s2 = ( qtex1 ? static_cast( qtex1->height ) : 2.0f ) / ( qtex2 ? static_cast( qtex2->height ) : 2.0f ); + texMat2[0][0]=s1*texMat1[0][0]; + texMat2[0][1]=s1*texMat1[0][1]; + texMat2[0][2]=s1*texMat1[0][2]; + texMat2[1][0]=s2*texMat1[1][0]; + texMat2[1][1]=s2*texMat1[1][1]; + texMat2[1][2]=s2*texMat1[1][2]; +} + +void ConvertTexMatWithQTexture( brushprimit_texdef_t *texMat1, qtexture_t *qtex1, brushprimit_texdef_t *texMat2, qtexture_t *qtex2 ) +{ + ConvertTexMatWithQTexture(texMat1->coords, qtex1, texMat2->coords, qtex2); } -#if 0 // texture locking (brush primit) // used for texture locking // will move the texture according to a geometric vector -void ShiftTextureGeometric_BrushPrimit(face_t *f, Vector3& delta) +void ShiftTextureGeometric_BrushPrimit(face_t *f, vec3_t delta) { - Vector3 texS,texT; - float tx,ty; - Vector3 M[3]; // columns of the matrix .. easier that way - float det; - Vector3 D[2]; + vec3_t texS,texT; + vec_t tx,ty; + vec3_t M[3]; // columns of the matrix .. easier that way + vec_t det; + vec3_t D[2]; // compute plane axis base ( doesn't change with translation ) ComputeAxisBase( f->plane.normal, texS, texT ); // compute translation vector in plane axis base - tx = vector3_dot( delta, texS ); - ty = vector3_dot( delta, texT ); + tx = DotProduct( delta, texS ); + ty = DotProduct( delta, texT ); // fill the data vectors M[0][0]=tx; M[0][1]=1.0f+tx; M[0][2]=tx; M[1][0]=ty; M[1][1]=ty; M[1][2]=1.0f+ty; @@ -765,21 +289,20 @@ void ShiftTextureRelative_BrushPrimit( face_t *f, float x, float y) float s,t; // as a ratio against texture size // the scale of the texture is not relevant here (we work directly on a transformation from the base vectors) - s = (x * 2.0) / (float)f->pShader->getTexture().width; - t = (y * 2.0) / (float)f->pShader->getTexture().height; + s = (x * 2.0) / (float)f->d_texture->width; + t = (y * 2.0) / (float)f->d_texture->height; f->brushprimit_texdef.coords[0][2] -= s; f->brushprimit_texdef.coords[1][2] -= t; } -#endif // TTimo: FIXME: I don't like that, it feels broken // (and it's likely that it's not used anymore) // best fitted 2D vector is x.X+y.Y -void ComputeBest2DVector( Vector3& v, Vector3& X, Vector3& Y, int &x, int &y ) +void ComputeBest2DVector( vec3_t v, vec3_t X, vec3_t Y, int &x, int &y ) { double sx,sy; - sx = vector3_dot( v, X ); - sy = vector3_dot( v, Y ); + sx = DotProduct( v, X ); + sy = DotProduct( v, Y ); if ( fabs(sy) > fabs(sx) ) { x = 0; @@ -798,8 +321,73 @@ void ComputeBest2DVector( Vector3& v, Vector3& X, Vector3& Y, int &x, int &y ) } } +//++timo FIXME quick'n dirty hack, doesn't care about current texture settings (angle) +// can be improved .. bug #107311 +// mins and maxs are the face bounding box +//++timo fixme: we use the face info, mins and maxs are irrelevant +void Face_FitTexture_BrushPrimit( face_t *f, vec3_t mins, vec3_t maxs, int nHeight, int nWidth ) +{ + vec3_t BBoxSTMin, BBoxSTMax; + winding_t *w; + int i,j; + vec_t val; + vec3_t M[3],D[2]; +// vec3_t N[2],Mf[2]; + brushprimit_texdef_t N; + vec3_t Mf[2]; + + + // we'll be working on a standardized texture size +// ConvertTexMatWithQTexture( &f->brushprimit_texdef, f->d_texture, &f->brushprimit_texdef, NULL ); + // compute the BBox in ST coords + EmitBrushPrimitTextureCoordinates( f, f->face_winding ); + ClearBounds( BBoxSTMin, BBoxSTMax ); + w = f->face_winding; + for (i=0 ; inumpoints ; i++) + { + // AddPointToBounds in 2D on (S,T) coordinates + for (j=0 ; j<2 ; j++) + { + val = w->points[i][j+3]; + if (val < BBoxSTMin[j]) + BBoxSTMin[j] = val; + if (val > BBoxSTMax[j]) + BBoxSTMax[j] = val; + } + } + // we have the three points of the BBox (BBoxSTMin[0].BBoxSTMin[1]) (BBoxSTMax[0],BBoxSTMin[1]) (BBoxSTMin[0],BBoxSTMax[1]) in ST space + // the BP matrix we are looking for gives (0,0) (nwidth,0) (0,nHeight) coordinates in (Sfit,Tfit) space to these three points + // we have A(Sfit,Tfit) = (0,0) = Mf * A(TexS,TexT) = N * M * A(TexS,TexT) = N * A(S,T) + // so we solve the system for N and then Mf = N * M + M[0][0] = BBoxSTMin[0]; M[0][1] = BBoxSTMax[0]; M[0][2] = BBoxSTMin[0]; + M[1][0] = BBoxSTMin[1]; M[1][1] = BBoxSTMin[1]; M[1][2] = BBoxSTMax[1]; + D[0][0] = 0.0f; D[0][1] = nWidth; D[0][2] = 0.0f; + D[1][0] = 0.0f; D[1][1] = 0.0f; D[1][2] = nHeight; + MatrixForPoints( M, D, &N ); + +#if 0 + // FIT operation gives coordinates of three points of the bounding box in (S',T'), our target axis base + // A(S',T')=(0,0) B(S',T')=(nWidth,0) C(S',T')=(0,nHeight) + // and we have them in (S,T) axis base: A(S,T)=(BBoxSTMin[0],BBoxSTMin[1]) B(S,T)=(BBoxSTMax[0],BBoxSTMin[1]) C(S,T)=(BBoxSTMin[0],BBoxSTMax[1]) + // we compute the N transformation so that: A(S',T') = N * A(S,T) + VectorSet( N[0], (BBoxSTMax[0]-BBoxSTMin[0])/(float)nWidth, 0.0f, BBoxSTMin[0] ); + VectorSet( N[1], 0.0f, (BBoxSTMax[1]-BBoxSTMin[1])/(float)nHeight, BBoxSTMin[1] ); +#endif + + // the final matrix is the product (Mf stands for Mfit) + Mf[0][0] = N.coords[0][0] * f->brushprimit_texdef.coords[0][0] + N.coords[0][1] * f->brushprimit_texdef.coords[1][0]; + Mf[0][1] = N.coords[0][0] * f->brushprimit_texdef.coords[0][1] + N.coords[0][1] * f->brushprimit_texdef.coords[1][1]; + Mf[0][2] = N.coords[0][0] * f->brushprimit_texdef.coords[0][2] + N.coords[0][1] * f->brushprimit_texdef.coords[1][2] + N.coords[0][2]; + Mf[1][0] = N.coords[1][0] * f->brushprimit_texdef.coords[0][0] + N.coords[1][1] * f->brushprimit_texdef.coords[1][0]; + Mf[1][1] = N.coords[1][0] * f->brushprimit_texdef.coords[0][1] + N.coords[1][1] * f->brushprimit_texdef.coords[1][1]; + Mf[1][2] = N.coords[1][0] * f->brushprimit_texdef.coords[0][2] + N.coords[1][1] * f->brushprimit_texdef.coords[1][2] + N.coords[1][2]; + // copy back + VectorCopy( Mf[0], f->brushprimit_texdef.coords[0] ); + VectorCopy( Mf[1], f->brushprimit_texdef.coords[1] ); + // handle the texture size +// ConvertTexMatWithQTexture( &f->brushprimit_texdef, NULL, &f->brushprimit_texdef, f->d_texture ); +} -#if 0 // texdef conversion void BrushPrimitFaceToFace(face_t *face) { // we have parsed brush primitives and need conversion back to standard format @@ -807,15 +395,12 @@ void BrushPrimitFaceToFace(face_t *face) // FIXME: if we normalize the texture matrix to a standard 2x2 size, we end up with wrong scaling // I tried various tweaks, no luck .. seems shifting is lost brushprimit_texdef_t aux; - ConvertTexMatWithQTexture( &face->brushprimit_texdef, face->pShader->getTexture(), &aux, 0 ); + ConvertTexMatWithQTexture( &face->brushprimit_texdef, face->d_texture, &aux, NULL ); TexMatToFakeTexCoords( aux.coords, face->texdef.shift, &face->texdef.rotate, face->texdef.scale ); face->texdef.scale[0]/=2.0; face->texdef.scale[1]/=2.0; } -#endif - -#if 0 // texture locking (brush primit) // TEXTURE LOCKING ----------------------------------------------------------------------------------------------------- // (Relevant to the editor only?) @@ -825,30 +410,30 @@ void BrushPrimitFaceToFace(face_t *face) // if there are more linear transformations that need the locking, going to a C++ or code pointer solution would be best // (but right now I want to keep brush_primit.cpp striclty C) -bool txlock_bRotation; +qboolean txlock_bRotation; // rotation locking params int txl_nAxis; float txl_fDeg; -Vector3 txl_vOrigin; +vec3_t txl_vOrigin; // flip locking params -Vector3 txl_matrix[3]; -Vector3 txl_origin; +vec3_t txl_matrix[3]; +vec3_t txl_origin; void TextureLockTransformation_BrushPrimit(face_t *f) { - Vector3 Orig,texS,texT; // axis base of initial plane + vec3_t Orig,texS,texT; // axis base of initial plane // used by transformation algo - Vector3 temp; int j; - Vector3 vRotate; // rotation vector + vec3_t temp; int j; + vec3_t vRotate; // rotation vector - Vector3 rOrig,rvecS,rvecT; // geometric transformation of (0,0) (1,0) (0,1) { initial plane axis base } - Vector3 rNormal,rtexS,rtexT; // axis base for the transformed plane - Vector3 lOrig,lvecS,lvecT; // [2] are not used ( but usefull for debugging ) - Vector3 M[3]; - float det; - Vector3 D[2]; + vec3_t rOrig,rvecS,rvecT; // geometric transformation of (0,0) (1,0) (0,1) { initial plane axis base } + vec3_t rNormal,rtexS,rtexT; // axis base for the transformed plane + vec3_t lOrig,lvecS,lvecT; // [2] are not used ( but usefull for debugging ) + vec3_t M[3]; + vec_t det; + vec3_t D[2]; // compute plane axis base ComputeAxisBase( f->plane.normal, texS, texT ); @@ -870,26 +455,29 @@ void TextureLockTransformation_BrushPrimit(face_t *f) } else { + VectorSubtract (Orig, txl_origin, temp); for (j=0 ; j<3 ; j++) - rOrig[j] = vector3_dot(vector3_subtracted(Orig, txl_origin), txl_matrix[j]) + txl_origin[j]; + rOrig[j] = DotProduct(temp, txl_matrix[j]) + txl_origin[j]; + VectorSubtract (texS, txl_origin, temp); for (j=0 ; j<3 ; j++) - rvecS[j] = vector3_dot(vector3_subtracted(texS, txl_origin), txl_matrix[j]) + txl_origin[j]; + rvecS[j] = DotProduct(temp, txl_matrix[j]) + txl_origin[j]; + VectorSubtract (texT, txl_origin, temp); for (j=0 ; j<3 ; j++) - rvecT[j] = vector3_dot(vector3_subtracted(texT, txl_origin), txl_matrix[j]) + txl_origin[j]; + rvecT[j] = DotProduct(temp, txl_matrix[j]) + txl_origin[j]; // we also need the axis base of the target plane, apply the transformation matrix to the normal too.. for (j=0 ; j<3 ; j++) - rNormal[j] = vector3_dot(f->plane.normal, txl_matrix[j]); + rNormal[j] = DotProduct(f->plane.normal, txl_matrix[j]); } // compute rotated plane axis base ComputeAxisBase( rNormal, rtexS, rtexT ); // compute S/T coordinates of the three points in rotated axis base ( in M matrix ) - lOrig[0] = vector3_dot( rOrig, rtexS ); - lOrig[1] = vector3_dot( rOrig, rtexT ); - lvecS[0] = vector3_dot( rvecS, rtexS ); - lvecS[1] = vector3_dot( rvecS, rtexT ); - lvecT[0] = vector3_dot( rvecT, rtexS ); - lvecT[1] = vector3_dot( rvecT, rtexT ); + lOrig[0] = DotProduct( rOrig, rtexS ); + lOrig[1] = DotProduct( rOrig, rtexT ); + lvecS[0] = DotProduct( rvecS, rtexS ); + lvecS[1] = DotProduct( rvecS, rtexT ); + lvecT[0] = DotProduct( rvecT, rtexS ); + lvecT[1] = DotProduct( rvecT, rtexT ); M[0][0] = lOrig[0]; M[1][0] = lOrig[1]; M[2][0] = 1.0f; M[0][1] = lvecS[0]; M[1][1] = lvecS[1]; M[2][1] = 1.0f; M[0][2] = lvecT[0]; M[1][2] = lvecT[1]; M[2][2] = 1.0f; @@ -912,7 +500,7 @@ void TextureLockTransformation_BrushPrimit(face_t *f) // texture locking // called before the points on the face are actually rotated -void RotateFaceTexture_BrushPrimit(face_t *f, int nAxis, float fDeg, Vector3& vOrigin ) +void RotateFaceTexture_BrushPrimit(face_t *f, int nAxis, float fDeg, vec3_t vOrigin ) { // this is a placeholder to call the general texture locking algorithm txlock_bRotation = true; @@ -926,7 +514,7 @@ void RotateFaceTexture_BrushPrimit(face_t *f, int nAxis, float fDeg, Vector3& vO // this matches the select_matrix algo used in select.cpp // this needs to be called on the face BEFORE any geometric transformation // it will compute the texture matrix that will represent the same texture on the face after the geometric transformation is done -void ApplyMatrix_BrushPrimit(face_t *f, Vector3 matrix[3], Vector3& origin) +void ApplyMatrix_BrushPrimit(face_t *f, vec3_t matrix[3], vec3_t origin) { // this is a placeholder to call the general texture locking algorithm txlock_bRotation = false; @@ -936,10 +524,9 @@ void ApplyMatrix_BrushPrimit(face_t *f, Vector3 matrix[3], Vector3& origin) VectorCopy(origin, txl_origin); TextureLockTransformation_BrushPrimit(f); } -#endif // don't do C==A! -void BPMatMul(float A[2][3], float B[2][3], float C[2][3]) +void BPMatMul(vec_t A[2][3], vec_t B[2][3], vec_t C[2][3]) { C[0][0] = A[0][0]*B[0][0]+A[0][1]*B[1][0]; C[1][0] = A[1][0]*B[0][0]+A[1][1]*B[1][0]; @@ -949,35 +536,28 @@ void BPMatMul(float A[2][3], float B[2][3], float C[2][3]) C[1][2] = A[1][0]*B[0][2]+A[1][1]*B[1][2]+A[1][2]; } -void BPMatDump(float A[2][3]) +void BPMatDump(vec_t A[2][3]) { - globalOutputStream() << "" << A[0][0] - << " " << A[0][1] - << " " << A[0][2] - << "\n" << A[1][0] - << " " << A[1][2] - << " " << A[1][2] - << "\n0 0 1\n"; + Sys_Printf("%g %g %g\n%g %g %g\n0 0 1\n", A[0][0], A[0][1], A[0][2], A[1][0], A[1][1], A[1][2]); } -void BPMatRotate(float A[2][3], float theta) +void BPMatRotate(vec_t A[2][3], float theta) { - float m[2][3]; - float aux[2][3]; - memset(&m, 0, sizeof(float)*6); - m[0][0] = static_cast(cos(degrees_to_radians(theta))); - m[0][1] = static_cast(-sin(degrees_to_radians(theta))); + vec_t m[2][3]; + vec_t aux[2][3]; + memset(&m, 0, sizeof(vec_t)*6); + m[0][0] = cos(theta*Q_PI/180.0); + m[0][1] = -sin(theta*Q_PI/180.0); m[1][0] = -m[0][1]; m[1][1] = m[0][0]; BPMatMul(A, m, aux); BPMatCopy(aux,A); } -#if 0 // camera-relative texture shift // get the relative axes of the current texturing -void BrushPrimit_GetRelativeAxes(face_t *f, Vector3& vecS, Vector3& vecT) +void BrushPrimit_GetRelativeAxes(face_t *f, vec3_t vecS, vec3_t vecT) { - float vS[2],vT[2]; + vec_t vS[2],vT[2]; // first we compute them as expressed in plane axis base // BP matrix has coordinates of plane axis base expressed in geometric axis base // so we use the line vectors @@ -986,7 +566,7 @@ void BrushPrimit_GetRelativeAxes(face_t *f, Vector3& vecS, Vector3& vecT) vT[0] = f->brushprimit_texdef.coords[1][0]; vT[1] = f->brushprimit_texdef.coords[1][1]; // now compute those vectors in geometric space - Vector3 texS, texT; // axis base of the plane (geometric) + vec3_t texS, texT; // axis base of the plane (geometric) ComputeAxisBase(f->plane.normal, texS, texT); // vecS[] = vS[0].texS[] + vS[1].texT[] // vecT[] = vT[0].texS[] + vT[1].texT[] @@ -998,469 +578,23 @@ void BrushPrimit_GetRelativeAxes(face_t *f, Vector3& vecS, Vector3& vecT) vecT[2] = vT[0]*texS[2] + vT[1]*texT[2]; } -// brush primitive texture adjustments, use the camera view to map adjustments -// ShiftTextureRelative_BrushPrimit ( s , t ) will shift relative to the texture -void ShiftTextureRelative_Camera(face_t *f, int x, int y) +// GL matrix 4x4 product (3D homogeneous matrix) +// NOTE: the crappy thing is that GL doesn't follow the standard convention [line][column] +// otherwise it's all good +void GLMatMul(vec_t M[4][4], vec_t A[4], vec_t B[4]) { - Vector3 vecS, vecT; - float XY[2]; // the values we are going to send for translation - float sgn[2]; // +1 or -1 - int axis[2]; - CamWnd* pCam; - - // get the two relative texture axes for the current texturing - BrushPrimit_GetRelativeAxes(f, vecS, vecT); - - // center point of the face, project it on the camera space - Vector3 C; - VectorClear(C); - int i; - for (i=0; iface_winding->numpoints; i++) + unsigned short i,j; + for (i=0;i<4;i++) { - VectorAdd(C,f->face_winding->point_at(i),C); - } - VectorScale(C,1.0/f->face_winding->numpoints,C); - - pCam = g_pParentWnd->GetCamWnd(); - pCam->MatchViewAxes(C, vecS, axis[0], sgn[0]); - pCam->MatchViewAxes(C, vecT, axis[1], sgn[1]); - - // this happens when the two directions can't be mapped on two different directions on the screen - // then the move will occur against a single axis - // (i.e. the user is not positioned well enough to send understandable shift commands) - // NOTE: in most cases this warning is not very relevant because the user would use one of the two axes - // for which the solution is easy (the other one being unknown) - // so this warning could be removed - if (axis[0] == axis[1]) - globalOutputStream() << "Warning: degenerate in ShiftTextureRelative_Camera\n"; - - // compute the X Y geometric increments - // those geometric increments will be applied along the texture axes (the ones we computed above) - XY[0] = 0; - XY[1] = 0; - if (x!=0) - { - // moving right/left - XY[axis[0]] += sgn[0]*x; - } - if (y!=0) - { - XY[axis[1]] += sgn[1]*y; - } - // we worked out a move along vecS vecT, and we now it's geometric amplitude - // apply it - ShiftTextureRelative_BrushPrimit(f, XY[0], XY[1]); -} -#endif - - -void BPTexdef_Assign(brushprimit_texdef_t& bp_td, const brushprimit_texdef_t& bp_other) -{ - bp_td = bp_other; -} - -void BPTexdef_Shift(brushprimit_texdef_t& bp_td, float s, float t) -{ - // shift a texture (texture adjustments) along it's current texture axes - // x and y are geometric values, which we must compute as ST increments - // this depends on the texture size and the pixel/texel ratio - // as a ratio against texture size - // the scale of the texture is not relevant here (we work directly on a transformation from the base vectors) - bp_td.coords[0][2] -= s; - bp_td.coords[1][2] += t; -} - -void BPTexdef_Scale(brushprimit_texdef_t& bp_td, float s, float t) -{ - // apply same scale as the spinner button of the surface inspector - texdef_t texdef; - // compute fake shift scale rot - TexMatToFakeTexCoords( bp_td, texdef ); - // update - texdef.scale[0] += s; - texdef.scale[1] += t; - // compute new normalized texture matrix - FakeTexCoordsToTexMat( texdef, bp_td ); -} - -void BPTexdef_Rotate(brushprimit_texdef_t& bp_td, float angle) -{ - // apply same scale as the spinner button of the surface inspector - texdef_t texdef; - // compute fake shift scale rot - TexMatToFakeTexCoords( bp_td, texdef ); - // update - texdef.rotate += angle; - // compute new normalized texture matrix - FakeTexCoordsToTexMat( texdef, bp_td ); -} - -void BPTexdef_Construct(brushprimit_texdef_t& bp_td, std::size_t width, std::size_t height) -{ - bp_td.coords[0][0] = 1.0f; - bp_td.coords[1][1] = 1.0f; - ConvertTexMatWithDimensions(bp_td.coords, 2, 2, bp_td.coords, width, height); -} - -void Texdef_Assign(TextureProjection& projection, const TextureProjection& other) -{ - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_Assign(projection.m_brushprimit_texdef, other.m_brushprimit_texdef); - } - else - { - Texdef_Assign(projection.m_texdef, other.m_texdef); - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_HALFLIFE) + B[i] = 0.0; + for (j=0;j<4;j++) { - projection.m_basis_s = other.m_basis_s; - projection.m_basis_t = other.m_basis_t; + B[i] += M[j][i]*A[j]; } } } -void Texdef_Shift(TextureProjection& projection, float s, float t) +qboolean IsBrushPrimitMode() { - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_Shift(projection.m_brushprimit_texdef, s, t); - } - else - { - Texdef_Shift(projection.m_texdef, s, t); - } + return(g_qeglobals.m_bBrushPrimitMode); } - -void Texdef_Scale(TextureProjection& projection, float s, float t) -{ - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_Scale(projection.m_brushprimit_texdef, s, t); - } - else - { - Texdef_Scale(projection.m_texdef, s, t); - } -} - -void Texdef_Rotate(TextureProjection& projection, float angle) -{ - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - BPTexdef_Rotate(projection.m_brushprimit_texdef, angle); - } - else - { - Texdef_Rotate(projection.m_texdef, angle); - } -} - -void Texdef_FitTexture(TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat) -{ - if(w.numpoints < 3) - { - return; - } - - Matrix4 st2tex; - Texdef_toTransform(projection, (float)width, (float)height, st2tex); - - // the current texture transform - Matrix4 local2tex = st2tex; - { - Matrix4 xyz2st; - Texdef_basisForNormal(projection, normal, xyz2st); - matrix4_multiply_by_matrix4(local2tex, xyz2st); - } - - // the bounds of the current texture transform - AABB bounds; - for(Winding::const_iterator i = w.begin(); i != w.end(); ++i) - { - Vector3 texcoord = matrix4_transformed_point(local2tex, (*i).vertex); - aabb_extend_by_point_safe(bounds, texcoord); - } - bounds.origin.z() = 0; - bounds.extents.z() = 1; - - // the bounds of a perfectly fitted texture transform - AABB perfect(Vector3(s_repeat * 0.5, t_repeat * 0.5, 0), Vector3(s_repeat * 0.5, t_repeat * 0.5, 1)); - - // the difference between the current texture transform and the perfectly fitted transform - Matrix4 matrix(matrix4_translation_for_vec3(bounds.origin - perfect.origin)); - matrix4_pivoted_scale_by_vec3(matrix, bounds.extents / perfect.extents, perfect.origin); - matrix4_affine_invert(matrix); - - // apply the difference to the current texture transform - matrix4_premultiply_by_matrix4(st2tex, matrix); - - Texdef_fromTransform(projection, (float)width, (float)height, st2tex); - Texdef_normalise(projection, (float)width, (float)height); -} - -float Texdef_getDefaultTextureScale() -{ - return g_texdef_default_scale; -} - -void TexDef_Construct_Default(TextureProjection& projection) -{ - projection.m_texdef.scale[0] = Texdef_getDefaultTextureScale(); - projection.m_texdef.scale[1] = Texdef_getDefaultTextureScale(); - - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - FakeTexCoordsToTexMat(projection.m_texdef, projection.m_brushprimit_texdef); - } -} - - - -void ShiftScaleRotate_fromFace(texdef_t& shiftScaleRotate, const TextureProjection& projection) -{ - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - TexMatToFakeTexCoords(projection.m_brushprimit_texdef, shiftScaleRotate); - } - else - { - shiftScaleRotate = projection.m_texdef; - } -} - -void ShiftScaleRotate_toFace(const texdef_t& shiftScaleRotate, TextureProjection& projection) -{ - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - // compute texture matrix - // the matrix returned must be understood as a qtexture_t with width=2 height=2 - FakeTexCoordsToTexMat( shiftScaleRotate, projection.m_brushprimit_texdef ); - } - else - { - projection.m_texdef = shiftScaleRotate; - } -} - - -inline void print_vector3(const Vector3& v) -{ - globalOutputStream() << "( " << v.x() << " " << v.y() << " " << v.z() << " )\n"; -} - -inline void print_3x3(const Matrix4& m) -{ - globalOutputStream() << "( " << m.xx() << " " << m.xy() << " " << m.xz() << " ) " - << "( " << m.yx() << " " << m.yy() << " " << m.yz() << " ) " - << "( " << m.zx() << " " << m.zy() << " " << m.zz() << " )\n"; -} - - -inline Matrix4 matrix4_rotation_for_vector3(const Vector3& x, const Vector3& y, const Vector3& z) -{ - return Matrix4( - x.x(), x.y(), x.z(), 0, - y.x(), y.y(), y.z(), 0, - z.x(), z.y(), z.z(), 0, - 0, 0, 0, 1 - ); -} - -inline Matrix4 matrix4_swap_axes(const Vector3& from, const Vector3& to) -{ - if(from.x() != 0 && to.y() != 0) - { - return matrix4_rotation_for_vector3(to, from, g_vector3_axis_z); - } - - if(from.x() != 0 && to.z() != 0) - { - return matrix4_rotation_for_vector3(to, g_vector3_axis_y, from); - } - - if(from.y() != 0 && to.z() != 0) - { - return matrix4_rotation_for_vector3(g_vector3_axis_x, to, from); - } - - if(from.y() != 0 && to.x() != 0) - { - return matrix4_rotation_for_vector3(from, to, g_vector3_axis_z); - } - - if(from.z() != 0 && to.x() != 0) - { - return matrix4_rotation_for_vector3(from, g_vector3_axis_y, to); - } - - if(from.z() != 0 && to.y() != 0) - { - return matrix4_rotation_for_vector3(g_vector3_axis_x, from, to); - } - - ERROR_MESSAGE("unhandled axis swap case"); - - return g_matrix4_identity; -} - -inline Matrix4 matrix4_reflection_for_plane(const Plane3& plane) -{ - return Matrix4( - static_cast(1 - (2 * plane.a * plane.a)), - static_cast(-2 * plane.a * plane.b), - static_cast(-2 * plane.a * plane.c), - 0, - static_cast(-2 * plane.b * plane.a), - static_cast(1 - (2 * plane.b * plane.b)), - static_cast(-2 * plane.b * plane.c), - 0, - static_cast(-2 * plane.c * plane.a), - static_cast(-2 * plane.c * plane.b), - static_cast(1 - (2 * plane.c * plane.c)), - 0, - static_cast(-2 * plane.d * plane.a), - static_cast(-2 * plane.d * plane.b), - static_cast(-2 * plane.d * plane.c), - 1 - ); -} - -inline Matrix4 matrix4_reflection_for_plane45(const Plane3& plane, const Vector3& from, const Vector3& to) -{ - Vector3 first = from; - Vector3 second = to; - - if(vector3_dot(from, plane.normal()) > 0 == vector3_dot(to, plane.normal()) > 0) - { - first = vector3_negated(first); - second = vector3_negated(second); - } - -#if 0 - globalOutputStream() << "normal: "; - print_vector3(plane.normal()); - - globalOutputStream() << "from: "; - print_vector3(first); - - globalOutputStream() << "to: "; - print_vector3(second); -#endif - - Matrix4 swap = matrix4_swap_axes(first, second); - - Matrix4 tmp = matrix4_reflection_for_plane(plane); - - swap.tx() = -static_cast(-2 * plane.a * plane.d); - swap.ty() = -static_cast(-2 * plane.b * plane.d); - swap.tz() = -static_cast(-2 * plane.c * plane.d); - - return swap; -} - -void Texdef_transformLocked(TextureProjection& projection, std::size_t width, std::size_t height, const Plane3& plane, const Matrix4& identity2transformed) -{ - //globalOutputStream() << "identity2transformed: " << identity2transformed << "\n"; - - //globalOutputStream() << "plane.normal(): " << plane.normal() << "\n"; - - Vector3 normalTransformed(matrix4_transformed_direction(identity2transformed, plane.normal())); - - //globalOutputStream() << "normalTransformed: " << normalTransformed << "\n"; - - // identity: identity space - // transformed: transformation - // stIdentity: base st projection space before transformation - // stTransformed: base st projection space after transformation - // stOriginal: original texdef space - - // stTransformed2stOriginal = stTransformed -> transformed -> identity -> stIdentity -> stOriginal - - Matrix4 identity2stIdentity; - Texdef_basisForNormal(projection, plane.normal(), identity2stIdentity); - //globalOutputStream() << "identity2stIdentity: " << identity2stIdentity << "\n"; - - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_HALFLIFE) - { - matrix4_transform_direction(identity2transformed, projection.m_basis_s); - matrix4_transform_direction(identity2transformed, projection.m_basis_t); - } - - Matrix4 transformed2stTransformed; - Texdef_basisForNormal(projection, normalTransformed, transformed2stTransformed); - - Matrix4 stTransformed2identity(matrix4_affine_inverse(matrix4_multiplied_by_matrix4(transformed2stTransformed, identity2transformed))); - - Vector3 originalProjectionAxis(vector4_to_vector3(matrix4_affine_inverse(identity2stIdentity).z())); - - Vector3 transformedProjectionAxis(vector4_to_vector3(stTransformed2identity.z())); - - Matrix4 stIdentity2stOriginal; - Texdef_toTransform(projection, (float)width, (float)height, stIdentity2stOriginal); - Matrix4 identity2stOriginal(matrix4_multiplied_by_matrix4(stIdentity2stOriginal, identity2stIdentity)); - - //globalOutputStream() << "originalProj: " << originalProjectionAxis << "\n"; - //globalOutputStream() << "transformedProj: " << transformedProjectionAxis << "\n"; - double dot = vector3_dot(originalProjectionAxis, transformedProjectionAxis); - //globalOutputStream() << "dot: " << dot << "\n"; - if(dot == 0) - { - // The projection axis chosen for the transformed normal is at 90 degrees - // to the transformed projection axis chosen for the original normal. - // This happens when the projection axis is ambiguous - e.g. for the plane - // 'X == Y' the projection axis could be either X or Y. - //globalOutputStream() << "flipped\n"; -#if 0 - globalOutputStream() << "projection off by 90\n"; - globalOutputStream() << "normal: "; - print_vector3(plane.normal()); - globalOutputStream() << "original projection: "; - print_vector3(originalProjectionAxis); - globalOutputStream() << "transformed projection: "; - print_vector3(transformedProjectionAxis); -#endif - - Matrix4 identityCorrected = matrix4_reflection_for_plane45(plane, originalProjectionAxis, transformedProjectionAxis); - - identity2stOriginal = matrix4_multiplied_by_matrix4(identity2stOriginal, identityCorrected); - } - - Matrix4 stTransformed2stOriginal = matrix4_multiplied_by_matrix4(identity2stOriginal, stTransformed2identity); - - Texdef_fromTransform(projection, (float)width, (float)height, stTransformed2stOriginal); - Texdef_normalise(projection, (float)width, (float)height); -} - -#if 1 -void Q3_to_matrix(const texdef_t& texdef, float width, float height, const Vector3& normal, Matrix4& matrix) -{ - Normal_GetTransform(normal, matrix); - - Matrix4 transform; - - Texdef_toTransform(texdef, width, height, transform); - - matrix4_multiply_by_matrix4(matrix, transform); -} - -void BP_from_matrix(brushprimit_texdef_t& bp_texdef, const Vector3& normal, const Matrix4& transform) -{ - Matrix4 basis; - basis = g_matrix4_identity; - ComputeAxisBase(normal, vector4_to_vector3(basis.x()), vector4_to_vector3(basis.y())); - vector4_to_vector3(basis.z()) = normal; - matrix4_transpose(basis); - matrix4_affine_invert(basis); - - Matrix4 basis2texture = matrix4_multiplied_by_matrix4(basis, transform); - - BPTexdef_fromTransform(bp_texdef, basis2texture); -} - -void Q3_to_BP(const texdef_t& texdef, float width, float height, const Vector3& normal, brushprimit_texdef_t& bp_texdef) -{ - Matrix4 matrix; - Q3_to_matrix(texdef, width, height, normal, matrix); - BP_from_matrix(bp_texdef, normal, matrix); -} -#endif diff --git a/radiant/brush_primit.h b/radiant/brush_primit.h deleted file mode 100644 index 897f19f9..00000000 --- a/radiant/brush_primit.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSH_PRIMIT_H) -#define INCLUDED_BRUSH_PRIMIT_H - -#include "math/vector.h" -#include "itexdef.h" -#include "debugging/debugging.h" -// Timo -// new brush primitive texdef -struct brushprimit_texdef_t -{ - brushprimit_texdef_t() - { - coords[0][0] = 2.0f; - coords[0][1] = 0.f; - coords[0][2] = 0.f; - coords[1][0] = 0.f; - coords[1][1] = 2.0f; - coords[1][2] = 0.f; - } - void removeScale(std::size_t width, std::size_t height) - { -#if 1 - coords[0][0] *= width; - coords[0][1] *= width; - coords[0][2] *= width; - coords[1][0] *= height; - coords[1][1] *= height; - coords[1][2] *= height; -#endif - } - void addScale(std::size_t width, std::size_t height) - { -#if 1 - ASSERT_MESSAGE(width > 0, "shader-width is 0"); - ASSERT_MESSAGE(height > 0, "shader-height is 0"); - coords[0][0] /= width; - coords[0][1] /= width; - coords[0][2] /= width; - coords[1][0] /= height; - coords[1][1] /= height; - coords[1][2] /= height; -#endif - } - float coords[2][3]; -}; - -class TextureProjection -{ -public: - texdef_t m_texdef; - brushprimit_texdef_t m_brushprimit_texdef; - Vector3 m_basis_s; - Vector3 m_basis_t; - - TextureProjection() - { - } - TextureProjection( - const texdef_t& texdef, - const brushprimit_texdef_t& brushprimit_texdef, - const Vector3& basis_s, - const Vector3& basis_t - ) : - m_texdef(texdef), - m_brushprimit_texdef(brushprimit_texdef), - m_basis_s(basis_s), - m_basis_t(basis_t) - { - } -}; - -float Texdef_getDefaultTextureScale(); - -class texdef_t; -struct Winding; -template class BasicVector3; -typedef BasicVector3 Vector3; -template class BasicVector4; -typedef BasicVector4 Vector4; -typedef Vector4 Quaternion; -class Matrix4; -class Plane3; - -void Normal_GetTransform(const Vector3& normal, Matrix4& transform); - -void TexDef_Construct_Default(TextureProjection& projection); - -void Texdef_Assign(TextureProjection& projection, const TextureProjection& other); -void Texdef_Shift(TextureProjection& projection, float s, float t); -void Texdef_Scale(TextureProjection& projection, float s, float t); -void Texdef_Rotate(TextureProjection& projection, float angle); -void Texdef_FitTexture(TextureProjection& projection, std::size_t width, std::size_t height, const Vector3& normal, const Winding& w, float s_repeat, float t_repeat); -void Texdef_EmitTextureCoordinates(const TextureProjection& projection, std::size_t width, std::size_t height, Winding& w, const Vector3& normal, const Matrix4& localToWorld); - -void ShiftScaleRotate_fromFace(texdef_t& shiftScaleRotate, const TextureProjection& projection); -void ShiftScaleRotate_toFace(const texdef_t& shiftScaleRotate, TextureProjection& projection); - -void Texdef_transformLocked(TextureProjection& projection, std::size_t width, std::size_t height, const Plane3& plane, const Matrix4& transform); -void Texdef_normalise(TextureProjection& projection, float width, float height); - -enum TexdefTypeId -{ - TEXDEFTYPEID_QUAKE, - TEXDEFTYPEID_BRUSHPRIMITIVES, - TEXDEFTYPEID_HALFLIFE, -}; - -struct bp_globals_t -{ - // tells if we are internally using brush primitive (texture coordinates and map format) - // this is a shortcut for IntForKey( g_qeglobals.d_project_entity, "brush_primit" ) - // NOTE: must keep the two ones in sync - TexdefTypeId m_texdefTypeId; -}; - -extern bp_globals_t g_bp_globals; -extern float g_texdef_default_scale; - -#endif diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp deleted file mode 100644 index 441f099d..00000000 --- a/radiant/brushmanip.cpp +++ /dev/null @@ -1,1490 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brushmanip.h" - - -#include "gtkutil/widget.h" -#include "gtkutil/menu.h" -#include "gtkmisc.h" -#include "brushnode.h" -#include "map.h" -#include "texwindow.h" -#include "gtkdlgs.h" -#include "commands.h" -#include "mainframe.h" -#include "dialog.h" -#include "xywindow.h" -#include "preferences.h" - -#include - -void Brush_ConstructCuboid(Brush& brush, const AABB& bounds, const char* shader, const TextureProjection& projection) -{ - const unsigned char box[3][2] = { { 0, 1 }, { 2, 0 }, { 1, 2 } }; - Vector3 mins(vector3_subtracted(bounds.origin, bounds.extents)); - Vector3 maxs(vector3_added(bounds.origin, bounds.extents)); - - brush.clear(); - brush.reserve(6); - - { - for(int i=0; i < 3; ++i) - { - Vector3 planepts1(maxs); - Vector3 planepts2(maxs); - planepts2[box[i][0]] = mins[box[i][0]]; - planepts1[box[i][1]] = mins[box[i][1]]; - - brush.addPlane(maxs, planepts1, planepts2, shader, projection); - } - } - { - for(int i=0; i < 3; ++i) - { - Vector3 planepts1(mins); - Vector3 planepts2(mins); - planepts1[box[i][0]] = maxs[box[i][0]]; - planepts2[box[i][1]] = maxs[box[i][1]]; - - brush.addPlane(mins, planepts1, planepts2, shader, projection); - } - } -} - -inline float max_extent(const Vector3& extents) -{ - return std::max(std::max(extents[0], extents[1]), extents[2]); -} - -inline float max_extent_2d(const Vector3& extents, int axis) -{ - switch(axis) - { - case 0: - return std::max(extents[1], extents[2]); - case 1: - return std::max(extents[0], extents[2]); - default: - return std::max(extents[0], extents[1]); - } -} - -const std::size_t c_brushPrism_minSides = 3; -const std::size_t c_brushPrism_maxSides = c_brush_maxFaces - 2; -const char* const c_brushPrism_name = "brushPrism"; - -void Brush_ConstructPrism(Brush& brush, const AABB& bounds, std::size_t sides, int axis, const char* shader, const TextureProjection& projection) -{ - if(sides < c_brushPrism_minSides) - { - globalErrorStream() << c_brushPrism_name << ": sides " << Unsigned(sides) << ": too few sides, minimum is " << Unsigned(c_brushPrism_minSides) << "\n"; - return; - } - if(sides > c_brushPrism_maxSides) - { - globalErrorStream() << c_brushPrism_name << ": sides " << Unsigned(sides) << ": too many sides, maximum is " << Unsigned(c_brushPrism_maxSides) << "\n"; - return; - } - - brush.clear(); - brush.reserve(sides+2); - - Vector3 mins(vector3_subtracted(bounds.origin, bounds.extents)); - Vector3 maxs(vector3_added(bounds.origin, bounds.extents)); - - float radius = max_extent_2d(bounds.extents, axis); - const Vector3& mid = bounds.origin; - Vector3 planepts[3]; - - planepts[2][(axis+1)%3] = mins[(axis+1)%3]; - planepts[2][(axis+2)%3] = mins[(axis+2)%3]; - planepts[2][axis] = maxs[axis]; - planepts[1][(axis+1)%3] = maxs[(axis+1)%3]; - planepts[1][(axis+2)%3] = mins[(axis+2)%3]; - planepts[1][axis] = maxs[axis]; - planepts[0][(axis+1)%3] = maxs[(axis+1)%3]; - planepts[0][(axis+2)%3] = maxs[(axis+2)%3]; - planepts[0][axis] = maxs[axis]; - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - - planepts[0][(axis+1)%3] = mins[(axis+1)%3]; - planepts[0][(axis+2)%3] = mins[(axis+2)%3]; - planepts[0][axis] = mins[axis]; - planepts[1][(axis+1)%3] = maxs[(axis+1)%3]; - planepts[1][(axis+2)%3] = mins[(axis+2)%3]; - planepts[1][axis] = mins[axis]; - planepts[2][(axis+1)%3] = maxs[(axis+1)%3]; - planepts[2][(axis+2)%3] = maxs[(axis+2)%3]; - planepts[2][axis] = mins[axis]; - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - - for (std::size_t i=0 ; i(floor(mid[(axis+1)%3]+radius*cv+0.5)); - planepts[0][(axis+2)%3] = static_cast(floor(mid[(axis+2)%3]+radius*sv+0.5)); - planepts[0][axis] = mins[axis]; - - planepts[1][(axis+1)%3] = planepts[0][(axis+1)%3]; - planepts[1][(axis+2)%3] = planepts[0][(axis+2)%3]; - planepts[1][axis] = maxs[axis]; - - planepts[2][(axis+1)%3] = static_cast(floor(planepts[0][(axis+1)%3] - radius*sv + 0.5)); - planepts[2][(axis+2)%3] = static_cast(floor(planepts[0][(axis+2)%3] + radius*cv + 0.5)); - planepts[2][axis] = maxs[axis]; - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - } -} - -const std::size_t c_brushCone_minSides = 3; -const std::size_t c_brushCone_maxSides = 32; -const char* const c_brushCone_name = "brushCone"; - -void Brush_ConstructCone(Brush& brush, const AABB& bounds, std::size_t sides, const char* shader, const TextureProjection& projection) -{ - if(sides < c_brushCone_minSides) - { - globalErrorStream() << c_brushCone_name << ": sides " << Unsigned(sides) << ": too few sides, minimum is " << Unsigned(c_brushCone_minSides) << "\n"; - return; - } - if(sides > c_brushCone_maxSides) - { - globalErrorStream() << c_brushCone_name << ": sides " << Unsigned(sides) << ": too many sides, maximum is " << Unsigned(c_brushCone_maxSides) << "\n"; - return; - } - - brush.clear(); - brush.reserve(sides+1); - - Vector3 mins(vector3_subtracted(bounds.origin, bounds.extents)); - Vector3 maxs(vector3_added(bounds.origin, bounds.extents)); - - float radius = max_extent(bounds.extents); - const Vector3& mid = bounds.origin; - Vector3 planepts[3]; - - planepts[0][0] = mins[0];planepts[0][1] = mins[1];planepts[0][2] = mins[2]; - planepts[1][0] = maxs[0];planepts[1][1] = mins[1];planepts[1][2] = mins[2]; - planepts[2][0] = maxs[0];planepts[2][1] = maxs[1];planepts[2][2] = mins[2]; - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - - for (std::size_t i=0 ; i(floor(mid[0]+radius*cv+0.5)); - planepts[0][1] = static_cast(floor(mid[1]+radius*sv+0.5)); - planepts[0][2] = mins[2]; - - planepts[1][0] = mid[0]; - planepts[1][1] = mid[1]; - planepts[1][2] = maxs[2]; - - planepts[2][0] = static_cast(floor(planepts[0][0] - radius * sv + 0.5)); - planepts[2][1] = static_cast(floor(planepts[0][1] + radius * cv + 0.5)); - planepts[2][2] = maxs[2]; - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - } -} - -const std::size_t c_brushSphere_minSides = 3; -const std::size_t c_brushSphere_maxSides = 7; -const char* const c_brushSphere_name = "brushSphere"; - -void Brush_ConstructSphere(Brush& brush, const AABB& bounds, std::size_t sides, const char* shader, const TextureProjection& projection) -{ - if(sides < c_brushSphere_minSides) - { - globalErrorStream() << c_brushSphere_name << ": sides " << Unsigned(sides) << ": too few sides, minimum is " << Unsigned(c_brushSphere_minSides) << "\n"; - return; - } - if(sides > c_brushSphere_maxSides) - { - globalErrorStream() << c_brushSphere_name << ": sides " << Unsigned(sides) << ": too many sides, maximum is " << Unsigned(c_brushSphere_maxSides) << "\n"; - return; - } - - brush.clear(); - brush.reserve(sides*sides); - - float radius = max_extent(bounds.extents); - const Vector3& mid = bounds.origin; - Vector3 planepts[3]; - - double dt = 2 * c_pi / sides; - double dp = c_pi / sides; - for(std::size_t i=0; i < sides; i++) - { - for(std::size_t j=0;j < sides-1; j++) - { - double t = i * dt; - double p = float(j * dp - c_pi / 2); - - planepts[0] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t, p), radius)); - planepts[1] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t, p + dp), radius)); - planepts[2] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t + dt, p + dp), radius)); - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - } - } - - { - double p = (sides - 1) * dp - c_pi / 2; - for(std::size_t i = 0; i < sides; i++) - { - double t = i * dt; - - planepts[0] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t, p), radius)); - planepts[1] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t + dt, p + dp), radius)); - planepts[2] = vector3_added(mid, vector3_scaled(vector3_for_spherical(t + dt, p), radius)); - - brush.addPlane(planepts[0], planepts[1], planepts[2], shader, projection); - } - } -} - -int GetViewAxis() -{ - switch(GlobalXYWnd_getCurrentViewType()) - { - case XY: - return 2; - case XZ: - return 1; - case YZ: - return 0; - } - return 2; -} - -void Brush_ConstructPrefab(Brush& brush, EBrushPrefab type, const AABB& bounds, std::size_t sides, const char* shader, const TextureProjection& projection) -{ - switch(type) - { - case eBrushCuboid: - { - UndoableCommand undo("brushCuboid"); - - Brush_ConstructCuboid(brush, bounds, shader, projection); - } - break; - case eBrushPrism: - { - int axis = GetViewAxis(); - StringOutputStream command; - command << c_brushPrism_name << " -sides " << Unsigned(sides) << " -axis " << axis; - UndoableCommand undo(command.c_str()); - - Brush_ConstructPrism(brush, bounds, sides, axis, shader, projection); - } - break; - case eBrushCone: - { - StringOutputStream command; - command << c_brushCone_name << " -sides " << Unsigned(sides); - UndoableCommand undo(command.c_str()); - - Brush_ConstructCone(brush, bounds, sides, shader, projection); - } - break; - case eBrushSphere: - { - StringOutputStream command; - command << c_brushSphere_name << " -sides " << Unsigned(sides); - UndoableCommand undo(command.c_str()); - - Brush_ConstructSphere(brush, bounds, sides, shader, projection); - } - break; - } -} - - -void ConstructRegionBrushes(scene::Node* brushes[6], const Vector3& region_mins, const Vector3& region_maxs) -{ - { - // set mins - Vector3 mins(region_mins[0]-32, region_mins[1]-32, region_mins[2]-32); - - // vary maxs - for(std::size_t i=0; i<3; i++) - { - Vector3 maxs(region_maxs[0]+32, region_maxs[1]+32, region_maxs[2]+32); - maxs[i] = region_mins[i]; - Brush_ConstructCuboid(*Node_getBrush(*brushes[i]), aabb_for_minmax(mins, maxs), texdef_name_default(), TextureProjection()); - } - } - - { - // set maxs - Vector3 maxs(region_maxs[0]+32, region_maxs[1]+32, region_maxs[2]+32); - - // vary mins - for(std::size_t i=0; i<3; i++) - { - Vector3 mins(region_mins[0]-32, region_mins[1]-32, region_mins[2]-32); - mins[i] = region_maxs[i]; - Brush_ConstructCuboid(*Node_getBrush(*brushes[i+3]), aabb_for_minmax(mins, maxs), texdef_name_default(), TextureProjection()); - } - } -} - - -class FaceSetTexdef -{ - const TextureProjection& m_projection; -public: - FaceSetTexdef(const TextureProjection& projection) : m_projection(projection) - { - } - void operator()(Face& face) const - { - face.SetTexdef(m_projection); - } -}; - -void Scene_BrushSetTexdef_Selected(scene::Graph& graph, const TextureProjection& projection) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceSetTexdef(projection)); - SceneChangeNotify(); -} - -void Scene_BrushSetTexdef_Component_Selected(scene::Graph& graph, const TextureProjection& projection) -{ - Scene_ForEachSelectedBrushFace(graph, FaceSetTexdef(projection)); - SceneChangeNotify(); -} - - -class FaceSetFlags -{ - const ContentsFlagsValue& m_projection; -public: - FaceSetFlags(const ContentsFlagsValue& flags) : m_projection(flags) - { - } - void operator()(Face& face) const - { - face.SetFlags(m_projection); - } -}; - -void Scene_BrushSetFlags_Selected(scene::Graph& graph, const ContentsFlagsValue& flags) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceSetFlags(flags)); - SceneChangeNotify(); -} - -void Scene_BrushSetFlags_Component_Selected(scene::Graph& graph, const ContentsFlagsValue& flags) -{ - Scene_ForEachSelectedBrushFace(graph, FaceSetFlags(flags)); - SceneChangeNotify(); -} - -class FaceShiftTexdef -{ - float m_s, m_t; -public: - FaceShiftTexdef(float s, float t) : m_s(s), m_t(t) - { - } - void operator()(Face& face) const - { - face.ShiftTexdef(m_s, m_t); - } -}; - -void Scene_BrushShiftTexdef_Selected(scene::Graph& graph, float s, float t) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceShiftTexdef(s, t)); - SceneChangeNotify(); -} - -void Scene_BrushShiftTexdef_Component_Selected(scene::Graph& graph, float s, float t) -{ - Scene_ForEachSelectedBrushFace(graph, FaceShiftTexdef(s, t)); - SceneChangeNotify(); -} - -class FaceScaleTexdef -{ - float m_s, m_t; -public: - FaceScaleTexdef(float s, float t) : m_s(s), m_t(t) - { - } - void operator()(Face& face) const - { - face.ScaleTexdef(m_s, m_t); - } -}; - -void Scene_BrushScaleTexdef_Selected(scene::Graph& graph, float s, float t) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceScaleTexdef(s, t)); - SceneChangeNotify(); -} - -void Scene_BrushScaleTexdef_Component_Selected(scene::Graph& graph, float s, float t) -{ - Scene_ForEachSelectedBrushFace(graph, FaceScaleTexdef(s, t)); - SceneChangeNotify(); -} - -class FaceRotateTexdef -{ - float m_angle; -public: - FaceRotateTexdef(float angle) : m_angle(angle) - { - } - void operator()(Face& face) const - { - face.RotateTexdef(m_angle); - } -}; - -void Scene_BrushRotateTexdef_Selected(scene::Graph& graph, float angle) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceRotateTexdef(angle)); - SceneChangeNotify(); -} - -void Scene_BrushRotateTexdef_Component_Selected(scene::Graph& graph, float angle) -{ - Scene_ForEachSelectedBrushFace(graph, FaceRotateTexdef(angle)); - SceneChangeNotify(); -} - - -class FaceSetShader -{ - const char* m_name; -public: - FaceSetShader(const char* name) : m_name(name) {} - void operator()(Face& face) const - { - face.SetShader(m_name); - } -}; - -void Scene_BrushSetShader_Selected(scene::Graph& graph, const char* name) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceSetShader(name)); - SceneChangeNotify(); -} - -void Scene_BrushSetShader_Component_Selected(scene::Graph& graph, const char* name) -{ - Scene_ForEachSelectedBrushFace(graph, FaceSetShader(name)); - SceneChangeNotify(); -} - -class FaceSetDetail -{ - bool m_detail; -public: - FaceSetDetail(bool detail) : m_detail(detail) - { - } - void operator()(Face& face) const - { - face.setDetail(m_detail); - } -}; - -void Scene_BrushSetDetail_Selected(scene::Graph& graph, bool detail) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceSetDetail(detail)); - SceneChangeNotify(); -} - -bool Face_FindReplaceShader(Face& face, const char* find, const char* replace) -{ - if(shader_equal(face.GetShader(), find)) - { - face.SetShader(replace); - return true; - } - return false; -} - -class FaceFindReplaceShader -{ - const char* m_find; - const char* m_replace; -public: - FaceFindReplaceShader(const char* find, const char* replace) : m_find(find), m_replace(replace) - { - } - void operator()(Face& face) const - { - Face_FindReplaceShader(face, m_find, m_replace); - } -}; - -class FaceFindShader -{ - const char* m_find; - const char* m_replace; -public: - FaceFindShader(const char* find) : m_find(find) - { - } - void operator()(FaceInstance& faceinst) const - { - if(shader_equal(faceinst.getFace().GetShader(), m_find)) - { - faceinst.setSelected(SelectionSystem::eFace, true); - } - } -}; - -bool DoingSearch(const char *repl) -{ - return (repl == NULL || (strcmp("textures/", repl)==0)); -} - -void Scene_BrushFindReplaceShader(scene::Graph& graph, const char* find, const char* replace) -{ - if (DoingSearch(replace)) - { - Scene_ForEachBrush_ForEachFaceInstance(graph, FaceFindShader(find)); - } - else - { - Scene_ForEachBrush_ForEachFace(graph, FaceFindReplaceShader(find, replace)); - } -} - -void Scene_BrushFindReplaceShader_Selected(scene::Graph& graph, const char* find, const char* replace) -{ - if (DoingSearch(replace)) - { - Scene_ForEachSelectedBrush_ForEachFaceInstance(graph, - FaceFindShader(find)); - } - else - { - Scene_ForEachSelectedBrush_ForEachFace(graph, - FaceFindReplaceShader(find, replace)); - } -} - -// TODO: find for components -// d1223m: dont even know what they are... -void Scene_BrushFindReplaceShader_Component_Selected(scene::Graph& graph, const char* find, const char* replace) -{ - if (DoingSearch(replace)) - { - - } - else - { - Scene_ForEachSelectedBrushFace(graph, FaceFindReplaceShader(find, replace)); - } -} - - -class FaceFitTexture -{ - float m_s_repeat, m_t_repeat; -public: - FaceFitTexture(float s_repeat, float t_repeat) : m_s_repeat(s_repeat), m_t_repeat(t_repeat) - { - } - void operator()(Face& face) const - { - face.FitTexture(m_s_repeat, m_t_repeat); - } -}; - -void Scene_BrushFitTexture_Selected(scene::Graph& graph, float s_repeat, float t_repeat) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceFitTexture(s_repeat, t_repeat)); - SceneChangeNotify(); -} - -void Scene_BrushFitTexture_Component_Selected(scene::Graph& graph, float s_repeat, float t_repeat) -{ - Scene_ForEachSelectedBrushFace(graph, FaceFitTexture(s_repeat, t_repeat)); - SceneChangeNotify(); -} - -TextureProjection g_defaultTextureProjection; -const TextureProjection& TextureTransform_getDefault() -{ - TexDef_Construct_Default(g_defaultTextureProjection); - return g_defaultTextureProjection; -} - -void Scene_BrushConstructPrefab(scene::Graph& graph, EBrushPrefab type, std::size_t sides, const char* shader) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path(); - - Brush* brush = Node_getBrush(path.top()); - if(brush != 0) - { - AABB bounds = brush->localAABB(); // copy bounds because the brush will be modified - Brush_ConstructPrefab(*brush, type, bounds, sides, shader, TextureTransform_getDefault()); - SceneChangeNotify(); - } - } -} - -void Scene_BrushResize_Selected(scene::Graph& graph, const AABB& bounds, const char* shader) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path(); - - Brush* brush = Node_getBrush(path.top()); - if(brush != 0) - { - Brush_ConstructCuboid(*brush, bounds, shader, TextureTransform_getDefault()); - SceneChangeNotify(); - } - } -} - -bool Brush_hasShader(const Brush& brush, const char* name) -{ - for(Brush::const_iterator i = brush.begin(); i != brush.end(); ++i) - { - if(shader_equal((*i)->GetShader(), name)) - { - return true; - } - } - return false; -} - -class BrushSelectByShaderWalker : public scene::Graph::Walker -{ - const char* m_name; -public: - BrushSelectByShaderWalker(const char* name) - : m_name(name) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 && Brush_hasShader(*brush, m_name)) - { - Instance_getSelectable(instance)->setSelected(true); - } - } - return true; - } -}; - -void Scene_BrushSelectByShader(scene::Graph& graph, const char* name) -{ - graph.traverse(BrushSelectByShaderWalker(name)); -} - -class FaceSelectByShader -{ - const char* m_name; -public: - FaceSelectByShader(const char* name) - : m_name(name) - { - } - void operator()(FaceInstance& face) const - { - printf("checking %s = %s\n", face.getFace().GetShader(), m_name); - if(shader_equal(face.getFace().GetShader(), m_name)) - { - face.setSelected(SelectionSystem::eFace, true); - } - } -}; - -void Scene_BrushSelectByShader_Component(scene::Graph& graph, const char* name) -{ - Scene_ForEachSelectedBrush_ForEachFaceInstance(graph, FaceSelectByShader(name)); -} - -class FaceGetTexdef -{ - TextureProjection& m_projection; - mutable bool m_done; -public: - FaceGetTexdef(TextureProjection& projection) - : m_projection(projection), m_done(false) - { - } - void operator()(Face& face) const - { - if(!m_done) - { - m_done = true; - face.GetTexdef(m_projection); - } - } -}; - - -void Scene_BrushGetTexdef_Selected(scene::Graph& graph, TextureProjection& projection) -{ - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceGetTexdef(projection)); -} - -void Scene_BrushGetTexdef_Component_Selected(scene::Graph& graph, TextureProjection& projection) -{ -#if 1 - if(!g_SelectedFaceInstances.empty()) - { - FaceInstance& faceInstance = g_SelectedFaceInstances.last(); - faceInstance.getFace().GetTexdef(projection); - } -#else - FaceGetTexdef visitor(projection); - Scene_ForEachSelectedBrushFace(graph, visitor); -#endif -} - -void Scene_BrushGetShaderSize_Component_Selected(scene::Graph& graph, size_t& width, size_t& height) -{ - if(!g_SelectedFaceInstances.empty()) - { - FaceInstance& faceInstance = g_SelectedFaceInstances.last(); - width = faceInstance.getFace().getShader().width(); - height = faceInstance.getFace().getShader().height(); - } -} - - -class FaceGetFlags -{ - ContentsFlagsValue& m_flags; - mutable bool m_done; -public: - FaceGetFlags(ContentsFlagsValue& flags) - : m_flags(flags), m_done(false) - { - } - void operator()(Face& face) const - { - if(!m_done) - { - m_done = true; - face.GetFlags(m_flags); - } - } -}; - - -void Scene_BrushGetFlags_Selected(scene::Graph& graph, ContentsFlagsValue& flags) -{ -#if 1 - if(GlobalSelectionSystem().countSelected() != 0) - { - BrushInstance* brush = Instance_getBrush(GlobalSelectionSystem().ultimateSelected()); - if(brush != 0) - { - Brush_forEachFace(*brush, FaceGetFlags(flags)); - } - } -#else - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceGetFlags(flags)); -#endif -} - -void Scene_BrushGetFlags_Component_Selected(scene::Graph& graph, ContentsFlagsValue& flags) -{ -#if 1 - if(!g_SelectedFaceInstances.empty()) - { - FaceInstance& faceInstance = g_SelectedFaceInstances.last(); - faceInstance.getFace().GetFlags(flags); - } -#else - Scene_ForEachSelectedBrushFace(graph, FaceGetFlags(flags)); -#endif -} - - -class FaceGetShader -{ - CopiedString& m_shader; - mutable bool m_done; -public: - FaceGetShader(CopiedString& shader) - : m_shader(shader), m_done(false) - { - } - void operator()(Face& face) const - { - if(!m_done) - { - m_done = true; - m_shader = face.GetShader(); - } - } -}; - -void Scene_BrushGetShader_Selected(scene::Graph& graph, CopiedString& shader) -{ -#if 1 - if(GlobalSelectionSystem().countSelected() != 0) - { - BrushInstance* brush = Instance_getBrush(GlobalSelectionSystem().ultimateSelected()); - if(brush != 0) - { - Brush_forEachFace(*brush, FaceGetShader(shader)); - } - } -#else - Scene_ForEachSelectedBrush_ForEachFace(graph, FaceGetShader(shader)); -#endif -} - -void Scene_BrushGetShader_Component_Selected(scene::Graph& graph, CopiedString& shader) -{ -#if 1 - if(!g_SelectedFaceInstances.empty()) - { - FaceInstance& faceInstance = g_SelectedFaceInstances.last(); - shader = faceInstance.getFace().GetShader(); - } -#else - FaceGetShader visitor(shader); - Scene_ForEachSelectedBrushFace(graph, visitor); -#endif -} - - -class filter_face_shader : public FaceFilter -{ - const char* m_shader; -public: - filter_face_shader(const char* shader) : m_shader(shader) - { - } - bool filter(const Face& face) const - { - return shader_equal(face.GetShader(), m_shader); - } -}; - -class filter_face_shader_prefix : public FaceFilter -{ - const char* m_prefix; -public: - filter_face_shader_prefix(const char* prefix) : m_prefix(prefix) - { - } - bool filter(const Face& face) const - { - return shader_equal_n(face.GetShader(), m_prefix, strlen(m_prefix)); - } -}; - -class filter_face_flags : public FaceFilter -{ - int m_flags; -public: - filter_face_flags(int flags) : m_flags(flags) - { - } - bool filter(const Face& face) const - { - return (face.getShader().shaderFlags() & m_flags) != 0; - } -}; - -class filter_face_contents : public FaceFilter -{ - int m_contents; -public: - filter_face_contents(int contents) : m_contents(contents) - { - } - bool filter(const Face& face) const - { - return (face.getShader().m_flags.m_contentFlags & m_contents) != 0; - } -}; - - - -class FaceFilterAny -{ - FaceFilter* m_filter; - bool& m_filtered; -public: - FaceFilterAny(FaceFilter* filter, bool& filtered) : m_filter(filter), m_filtered(filtered) - { - m_filtered = false; - } - void operator()(Face& face) const - { - if(m_filter->filter(face)) - { - m_filtered = true; - } - } -}; - -class filter_brush_any_face : public BrushFilter -{ - FaceFilter* m_filter; -public: - filter_brush_any_face(FaceFilter* filter) : m_filter(filter) - { - } - bool filter(const Brush& brush) const - { - bool filtered; - Brush_forEachFace(brush, FaceFilterAny(m_filter, filtered)); - return filtered; - } -}; - -class FaceFilterAll -{ - FaceFilter* m_filter; - bool& m_filtered; -public: - FaceFilterAll(FaceFilter* filter, bool& filtered) : m_filter(filter), m_filtered(filtered) - { - m_filtered = true; - } - void operator()(Face& face) const - { - if(!m_filter->filter(face)) - { - m_filtered = false; - } - } -}; - -class filter_brush_all_faces : public BrushFilter -{ - FaceFilter* m_filter; -public: - filter_brush_all_faces(FaceFilter* filter) : m_filter(filter) - { - } - bool filter(const Brush& brush) const - { - bool filtered; - Brush_forEachFace(brush, FaceFilterAll(m_filter, filtered)); - return filtered; - } -}; - - -filter_face_flags g_filter_face_clip(QER_CLIP); -filter_brush_all_faces g_filter_brush_clip(&g_filter_face_clip); - -filter_face_shader g_filter_face_clip_q2("textures/clip"); -filter_brush_all_faces g_filter_brush_clip_q2(&g_filter_face_clip_q2); - -filter_face_shader g_filter_face_weapclip("textures/common/weapclip"); -filter_brush_all_faces g_filter_brush_weapclip(&g_filter_face_weapclip); - -filter_face_shader g_filter_face_botclip("textures/common/botclip"); -filter_brush_all_faces g_filter_brush_botclip(&g_filter_face_botclip); - -filter_face_shader_prefix g_filter_face_caulk("textures/common/caulk"); -filter_brush_all_faces g_filter_brush_caulk(&g_filter_face_caulk); - -filter_face_shader_prefix g_filter_face_caulk_ja("textures/system/caulk"); -filter_brush_all_faces g_filter_brush_caulk_ja(&g_filter_face_caulk_ja); - -filter_face_shader_prefix g_filter_face_liquids("textures/liquids/"); -filter_brush_any_face g_filter_brush_liquids(&g_filter_face_liquids); - -filter_face_shader g_filter_face_hint("textures/common/hint"); -filter_brush_any_face g_filter_brush_hint(&g_filter_face_hint); - -filter_face_shader g_filter_face_hint_q2("textures/hint"); -filter_brush_any_face g_filter_brush_hint_q2(&g_filter_face_hint_q2); - -filter_face_shader g_filter_face_hint_ja("textures/system/hint"); -filter_brush_any_face g_filter_brush_hint_ja(&g_filter_face_hint_ja); - -filter_face_shader g_filter_face_areaportal("textures/common/areaportal"); -filter_brush_all_faces g_filter_brush_areaportal(&g_filter_face_areaportal); - -filter_face_shader g_filter_face_visportal("textures/editor/visportal"); -filter_brush_any_face g_filter_brush_visportal(&g_filter_face_visportal); - -filter_face_shader g_filter_face_clusterportal("textures/common/clusterportal"); -filter_brush_all_faces g_filter_brush_clusterportal(&g_filter_face_clusterportal); - -filter_face_shader g_filter_face_lightgrid("textures/common/lightgrid"); -filter_brush_all_faces g_filter_brush_lightgrid(&g_filter_face_lightgrid); - -filter_face_flags g_filter_face_translucent(QER_TRANS); -filter_brush_all_faces g_filter_brush_translucent(&g_filter_face_translucent); - -filter_face_contents g_filter_face_detail(BRUSH_DETAIL_MASK); -filter_brush_all_faces g_filter_brush_detail(&g_filter_face_detail); - - -void BrushFilters_construct() -{ - add_brush_filter(g_filter_brush_clip, EXCLUDE_CLIP); - add_brush_filter(g_filter_brush_clip_q2, EXCLUDE_CLIP); - add_brush_filter(g_filter_brush_weapclip, EXCLUDE_CLIP); - add_brush_filter(g_filter_brush_botclip, EXCLUDE_BOTCLIP); - add_brush_filter(g_filter_brush_caulk, EXCLUDE_CAULK); - add_brush_filter(g_filter_brush_caulk_ja, EXCLUDE_CAULK); - add_face_filter(g_filter_face_caulk, EXCLUDE_CAULK); - add_face_filter(g_filter_face_caulk_ja, EXCLUDE_CAULK); - add_brush_filter(g_filter_brush_liquids, EXCLUDE_LIQUIDS); - add_brush_filter(g_filter_brush_hint, EXCLUDE_HINTSSKIPS); - add_brush_filter(g_filter_brush_hint_q2, EXCLUDE_HINTSSKIPS); - add_brush_filter(g_filter_brush_hint_ja, EXCLUDE_HINTSSKIPS); - add_brush_filter(g_filter_brush_clusterportal, EXCLUDE_CLUSTERPORTALS); - add_brush_filter(g_filter_brush_visportal, EXCLUDE_VISPORTALS); - add_brush_filter(g_filter_brush_areaportal, EXCLUDE_AREAPORTALS); - add_brush_filter(g_filter_brush_translucent, EXCLUDE_TRANSLUCENT); - add_brush_filter(g_filter_brush_detail, EXCLUDE_DETAILS); - add_brush_filter(g_filter_brush_detail, EXCLUDE_STRUCTURAL, true); - add_brush_filter(g_filter_brush_lightgrid, EXCLUDE_LIGHTGRID); -} - -#if 0 - -void normalquantisation_draw() -{ - glPointSize(1); - glBegin(GL_POINTS); - for(std::size_t i = 0; i <= c_quantise_normal; ++i) - { - for(std::size_t j = 0; j <= c_quantise_normal; ++j) - { - Normal3f vertex(normal3f_normalised(Normal3f( - static_cast(c_quantise_normal - j - i), - static_cast(i), - static_cast(j) - ))); - VectorScale(normal3f_to_array(vertex), 64.f, normal3f_to_array(vertex)); - glVertex3fv(normal3f_to_array(vertex)); - vertex.x = -vertex.x; - glVertex3fv(normal3f_to_array(vertex)); - } - } - glEnd(); -} - -class RenderableNormalQuantisation : public OpenGLRenderable -{ -public: - void render(RenderStateFlags state) const - { - normalquantisation_draw(); - } -}; - -const float g_test_quantise_normal = 1.f / static_cast(1 << 3); - -class TestNormalQuantisation -{ - void check_normal(const Normal3f& normal, const Normal3f& other) - { - spherical_t spherical = spherical_from_normal3f(normal); - double longditude = RAD2DEG(spherical.longditude); - double latitude = RAD2DEG(spherical.latitude); - double x = cos(spherical.longditude) * sin(spherical.latitude); - double y = sin(spherical.longditude) * sin(spherical.latitude); - double z = cos(spherical.latitude); - - ASSERT_MESSAGE(normal3f_dot(normal, other) > 0.99, "bleh"); - } - - void test_normal(const Normal3f& normal) - { - Normal3f test = normal3f_from_spherical(spherical_from_normal3f(normal)); - check_normal(normal, test); - - EOctant octant = normal3f_classify_octant(normal); - Normal3f folded = normal3f_fold_octant(normal, octant); - ESextant sextant = normal3f_classify_sextant(folded); - folded = normal3f_fold_sextant(folded, sextant); - - double scale = static_cast(c_quantise_normal) / (folded.x + folded.y + folded.z); - - double zbits = folded.z * scale; - double ybits = folded.y * scale; - - std::size_t zbits_q = static_cast(zbits); - std::size_t ybits_q = static_cast(ybits); - - ASSERT_MESSAGE(zbits_q <= (c_quantise_normal / 8) * 3, "bleh"); - ASSERT_MESSAGE(ybits_q <= (c_quantise_normal / 2), "bleh"); - ASSERT_MESSAGE(zbits_q + ((c_quantise_normal / 2) - ybits_q) <= (c_quantise_normal / 2), "bleh"); - - std::size_t y_t = (zbits_q < (c_quantise_normal / 4)) ? ybits_q : (c_quantise_normal / 2) - ybits_q; - std::size_t z_t = (zbits_q < (c_quantise_normal / 4)) ? zbits_q : (c_quantise_normal / 2) - zbits_q; - std::size_t index = (c_quantise_normal / 4) * y_t + z_t; - ASSERT_MESSAGE(index <= (c_quantise_normal / 4)*(c_quantise_normal / 2), "bleh"); - - Normal3f tmp(c_quantise_normal - zbits_q - ybits_q, ybits_q, zbits_q); - tmp = normal3f_normalised(tmp); - - Normal3f unfolded = normal3f_unfold_octant(normal3f_unfold_sextant(tmp, sextant), octant); - - check_normal(normal, unfolded); - - double dot = normal3f_dot(normal, unfolded); - float length = VectorLength(normal3f_to_array(unfolded)); - float inv_length = 1 / length; - - Normal3f quantised = normal3f_quantised(normal); - check_normal(normal, quantised); - } - void test2(const Normal3f& normal, const Normal3f& other) - { - if(normal3f_quantised(normal) != normal3f_quantised(other)) - { - int bleh = 0; - } - } - - static Normal3f normalise(float x, float y, float z) - { - return normal3f_normalised(Normal3f(x, y, z)); - } - - float vec_rand() - { - return static_cast(rand() - (RAND_MAX/2)); - } - - Normal3f normal3f_rand() - { - return normalise(vec_rand(), vec_rand(), vec_rand()); - } - -public: - TestNormalQuantisation() - { - for(int i = 4096; i > 0; --i) - test_normal(normal3f_rand()); - - test_normal(normalise(1, 0, 0)); - test_normal(normalise(0, 1, 0)); - test_normal(normalise(0, 0, 1)); - test_normal(normalise(1, 1, 0)); - test_normal(normalise(1, 0, 1)); - test_normal(normalise(0, 1, 1)); - - test_normal(normalise(10000, 10000, 10000)); - test_normal(normalise(10000, 10000, 10001)); - test_normal(normalise(10000, 10000, 10002)); - test_normal(normalise(10000, 10000, 10010)); - test_normal(normalise(10000, 10000, 10020)); - test_normal(normalise(10000, 10000, 10030)); - test_normal(normalise(10000, 10000, 10100)); - test_normal(normalise(10000, 10000, 10101)); - test_normal(normalise(10000, 10000, 10102)); - test_normal(normalise(10000, 10000, 10200)); - test_normal(normalise(10000, 10000, 10201)); - test_normal(normalise(10000, 10000, 10202)); - test_normal(normalise(10000, 10000, 10203)); - test_normal(normalise(10000, 10000, 10300)); - - - test2(normalise(10000, 10000, 10000), normalise(10000, 10000, 10001)); - test2(normalise(10000, 10000, 10001), normalise(10000, 10001, 10000)); - } -}; - -TestNormalQuantisation g_testNormalQuantisation; - - -#endif - -#if 0 -class TestSelectableObserver : public observer_template -{ -public: - void notify(const Selectable& arguments) - { - bool bleh = arguments.isSelected(); - } -}; - -inline void test_bleh() -{ - TestSelectableObserver test; - ObservableSelectableInstance< SingleObservable< SelectionChangeCallback > > bleh; - bleh.attach(test); - bleh.setSelected(true); - bleh.detach(test); -} - -class TestBleh -{ -public: - TestBleh() - { - test_bleh(); - } -}; - -const TestBleh testbleh; -#endif - - -#if 0 -class TestRefcountedString -{ -public: - TestRefcountedString() - { - { - // copy construct - SmartString string1("string1"); - SmartString string2(string1); - SmartString string3(string2); - } - { - // refcounted assignment - SmartString string1("string1"); - SmartString string2("string2"); - string1 = string2; - } - { - // copy assignment - SmartString string1("string1"); - SmartString string2("string2"); - string1 = string2.c_str(); - } - { - // self-assignment - SmartString string1("string1"); - string1 = string1; - } - { - // self-assignment via another reference - SmartString string1("string1"); - SmartString string2(string1); - string1 = string2; - } - } -}; - -const TestRefcountedString g_testRefcountedString; - -#endif - -void Select_MakeDetail() -{ - UndoableCommand undo("brushSetDetail"); - Scene_BrushSetDetail_Selected(GlobalSceneGraph(), true); -} - -void Select_MakeStructural() -{ - UndoableCommand undo("brushClearDetail"); - Scene_BrushSetDetail_Selected(GlobalSceneGraph(), false); -} - -class BrushMakeSided -{ - std::size_t m_count; -public: - BrushMakeSided(std::size_t count) - : m_count(count) - { - } - void set() - { - Scene_BrushConstructPrefab(GlobalSceneGraph(), eBrushPrism, m_count, TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); - } - typedef MemberCaller SetCaller; -}; - - -BrushMakeSided g_brushmakesided3(3); -BrushMakeSided g_brushmakesided4(4); -BrushMakeSided g_brushmakesided5(5); -BrushMakeSided g_brushmakesided6(6); -BrushMakeSided g_brushmakesided7(7); -BrushMakeSided g_brushmakesided8(8); -BrushMakeSided g_brushmakesided9(9); - -inline int axis_for_viewtype(int viewtype) -{ - switch(viewtype) - { - case XY: - return 2; - case XZ: - return 1; - case YZ: - return 0; - } - return 2; -} - -class BrushPrefab -{ - EBrushPrefab m_type; -public: - BrushPrefab(EBrushPrefab type) - : m_type(type) - { - } - void set() - { - DoSides(m_type, axis_for_viewtype(GetViewAxis())); - } - typedef MemberCaller SetCaller; -}; - -BrushPrefab g_brushprism(eBrushPrism); -BrushPrefab g_brushcone(eBrushCone); -BrushPrefab g_brushsphere(eBrushSphere); - - -void FlipClip(); -void SplitClip(); -void Clip(); -void OnClipMode(bool enable); -bool ClipMode(); - - -void ClipSelected() -{ - if(ClipMode()) - { - UndoableCommand undo("clipperClip"); - Clip(); - } -} - -void SplitSelected() -{ - if(ClipMode()) - { - UndoableCommand undo("clipperSplit"); - SplitClip(); - } -} - -void FlipClipper() -{ - FlipClip(); -} - - -Callback g_texture_lock_status_changed; -BoolExportCaller g_texdef_movelock_caller(g_brush_texturelock_enabled); -ToggleItem g_texdef_movelock_item(g_texdef_movelock_caller); - -void Texdef_ToggleMoveLock() -{ - g_brush_texturelock_enabled = !g_brush_texturelock_enabled; - g_texdef_movelock_item.update(); - g_texture_lock_status_changed(); -} - - - - - -void Brush_registerCommands() -{ - GlobalToggles_insert("TogTexLock", FreeCaller(), ToggleItem::AddCallbackCaller(g_texdef_movelock_item), Accelerator('T', (GdkModifierType)GDK_SHIFT_MASK)); - - GlobalCommands_insert("BrushPrism", BrushPrefab::SetCaller(g_brushprism)); - GlobalCommands_insert("BrushCone", BrushPrefab::SetCaller(g_brushcone)); - GlobalCommands_insert("BrushSphere", BrushPrefab::SetCaller(g_brushsphere)); - - GlobalCommands_insert("Brush3Sided", BrushMakeSided::SetCaller(g_brushmakesided3), Accelerator('3', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush4Sided", BrushMakeSided::SetCaller(g_brushmakesided4), Accelerator('4', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush5Sided", BrushMakeSided::SetCaller(g_brushmakesided5), Accelerator('5', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush6Sided", BrushMakeSided::SetCaller(g_brushmakesided6), Accelerator('6', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush7Sided", BrushMakeSided::SetCaller(g_brushmakesided7), Accelerator('7', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush8Sided", BrushMakeSided::SetCaller(g_brushmakesided8), Accelerator('8', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Brush9Sided", BrushMakeSided::SetCaller(g_brushmakesided9), Accelerator('9', (GdkModifierType)GDK_CONTROL_MASK)); - - GlobalCommands_insert("ClipSelected", FreeCaller(), Accelerator(GDK_Return)); - GlobalCommands_insert("SplitSelected", FreeCaller(), Accelerator(GDK_Return, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("FlipClip", FreeCaller(), Accelerator(GDK_Return, (GdkModifierType)GDK_CONTROL_MASK)); - - GlobalCommands_insert("MakeDetail", FreeCaller(), Accelerator('M', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("MakeStructural", FreeCaller(), Accelerator('S', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); -} - -void Brush_constructMenu(GtkMenu* menu) -{ - create_menu_item_with_mnemonic(menu, "Prism...", "BrushPrism"); - create_menu_item_with_mnemonic(menu, "Cone...", "BrushCone"); - create_menu_item_with_mnemonic(menu, "Sphere...", "BrushSphere"); - menu_separator (menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "CSG"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Make _Hollow", "CSGHollow"); - create_menu_item_with_mnemonic(menu_in_menu, "CSG _Subtract", "CSGSubtract"); - create_menu_item_with_mnemonic(menu_in_menu, "CSG _Merge", "CSGMerge"); - } - menu_separator(menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Clipper"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - - create_menu_item_with_mnemonic(menu_in_menu, "Clip selection", "ClipSelected"); - create_menu_item_with_mnemonic(menu_in_menu, "Split selection", "SplitSelected"); - create_menu_item_with_mnemonic(menu_in_menu, "Flip Clip orientation", "FlipClip"); - } - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Make detail", "MakeDetail"); - create_menu_item_with_mnemonic(menu, "Make structural", "MakeStructural"); - - create_check_menu_item_with_mnemonic(menu, "Texture Lock", "TogTexLock"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Copy Face Texture", "FaceCopyTexture"); - create_menu_item_with_mnemonic(menu, "Paste Face Texture", "FacePasteTexture"); - - command_connect_accelerator("Brush3Sided"); - command_connect_accelerator("Brush4Sided"); - command_connect_accelerator("Brush5Sided"); - command_connect_accelerator("Brush6Sided"); - command_connect_accelerator("Brush7Sided"); - command_connect_accelerator("Brush8Sided"); - command_connect_accelerator("Brush9Sided"); -} diff --git a/radiant/brushmanip.h b/radiant/brushmanip.h deleted file mode 100644 index 088a89fe..00000000 --- a/radiant/brushmanip.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_BRUSHWRAPPER_H) -#define INCLUDED_BRUSHWRAPPER_H - -#include -#include "string/stringfwd.h" -#include "generic/callbackfwd.h" - -enum EBrushPrefab -{ - eBrushCuboid, - eBrushPrism, - eBrushCone, - eBrushSphere, -}; - -class TextureProjection; -class ContentsFlagsValue; -namespace scene -{ - class Graph; -} -void Scene_BrushConstructPrefab(scene::Graph& graph, EBrushPrefab type, std::size_t sides, const char* shader); -class AABB; -void Scene_BrushResize_Selected(scene::Graph& graph, const AABB& bounds, const char* shader); -void Scene_BrushSetTexdef_Selected(scene::Graph& graph, const TextureProjection& projection); -void Scene_BrushSetTexdef_Component_Selected(scene::Graph& graph, const TextureProjection& projection); -void Scene_BrushGetTexdef_Selected(scene::Graph& graph, TextureProjection& projection); -void Scene_BrushGetTexdef_Component_Selected(scene::Graph& graph, TextureProjection& projection); -void Scene_BrushGetShaderSize_Component_Selected(scene::Graph& graph, size_t& width, size_t& height); -void Scene_BrushSetFlags_Selected(scene::Graph& graph, const ContentsFlagsValue& flags); -void Scene_BrushSetFlags_Component_Selected(scene::Graph& graph, const ContentsFlagsValue& flags); -void Scene_BrushGetFlags_Selected(scene::Graph& graph, ContentsFlagsValue& flags); -void Scene_BrushGetFlags_Component_Selected(scene::Graph& graph, ContentsFlagsValue& flags); -void Scene_BrushShiftTexdef_Selected(scene::Graph& graph, float s, float t); -void Scene_BrushShiftTexdef_Component_Selected(scene::Graph& graph, float s, float t); -void Scene_BrushScaleTexdef_Selected(scene::Graph& graph, float s, float t); -void Scene_BrushScaleTexdef_Component_Selected(scene::Graph& graph, float s, float t); -void Scene_BrushRotateTexdef_Selected(scene::Graph& graph, float angle); -void Scene_BrushRotateTexdef_Component_Selected(scene::Graph& graph, float angle); -void Scene_BrushSetShader_Selected(scene::Graph& graph, const char* name); -void Scene_BrushSetShader_Component_Selected(scene::Graph& graph, const char* name); -void Scene_BrushGetShader_Selected(scene::Graph& graph, CopiedString& shader); -void Scene_BrushGetShader_Component_Selected(scene::Graph& graph, CopiedString& shader); -void Scene_BrushFindReplaceShader(scene::Graph& graph, const char* find, const char* replace); -void Scene_BrushFindReplaceShader_Selected(scene::Graph& graph, const char* find, const char* replace); -void Scene_BrushFindReplaceShader_Component_Selected(scene::Graph& graph, const char* find, const char* replace); -void Scene_BrushSelectByShader(scene::Graph& graph, const char* name); -void Scene_BrushSelectByShader_Component(scene::Graph& graph, const char* name); -void Scene_BrushFitTexture_Selected(scene::Graph& graph, float s_repeat, float t_repeat); -void Scene_BrushFitTexture_Component_Selected(scene::Graph& graph, float s_repeat, float t_repeat); - -typedef struct _GtkMenu GtkMenu; -void Brush_constructMenu(GtkMenu* menu); - -extern Callback g_texture_lock_status_changed; - -void BrushFilters_construct(); -void Brush_registerCommands(); - -#endif diff --git a/radiant/brushmodule.cpp b/radiant/brushmodule.cpp deleted file mode 100644 index 6b47e092..00000000 --- a/radiant/brushmodule.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brushmodule.h" - -#include "qerplugin.h" - -#include "brushnode.h" -#include "brushmanip.h" - -#include "preferencesystem.h" -#include "stringio.h" - -#include "map.h" -#include "qe3.h" -#include "mainframe.h" -#include "preferences.h" - -LatchedBool g_useAlternativeTextureProjection(false, "Use alternative texture-projection"); -bool g_showAlternativeTextureProjectionOption = false; -bool g_brush_always_caulk; - -bool getTextureLockEnabled() -{ - return g_brush_texturelock_enabled; -} - -void Face_importSnapPlanes(bool value) -{ - Face::m_quantise = value ? quantiseInteger : quantiseFloating; -} -typedef FreeCaller1 FaceImportSnapPlanesCaller; - -void Face_exportSnapPlanes(const BoolImportCallback& importer) -{ - importer(Face::m_quantise == quantiseInteger); -} -typedef FreeCaller1 FaceExportSnapPlanesCaller; - -void Brush_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox( - "", "Snap planes to integer grid", - FaceImportSnapPlanesCaller(), - FaceExportSnapPlanesCaller() - ); - page.appendEntry( - "Default texture scale", - g_texdef_default_scale - ); - if(g_showAlternativeTextureProjectionOption) - { - page.appendCheckBox( - "", "Use alternative texture-projection", - LatchedBoolImportCaller(g_useAlternativeTextureProjection), - BoolExportCaller(g_useAlternativeTextureProjection.m_latched) - ); - } - // d1223m - page.appendCheckBox("", - "Always use caulk for new brushes", - g_brush_always_caulk - ); -} -void Brush_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Brush", "Brush Settings")); - Brush_constructPreferences(page); -} -void Brush_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - - -void Brush_Construct(EBrushType type) -{ - if(type == eBrushTypeQuake3) - { - g_showAlternativeTextureProjectionOption = true; - - GlobalPreferenceSystem().registerPreference( - "AlternativeTextureProjection", - BoolImportStringCaller(g_useAlternativeTextureProjection.m_latched), - BoolExportStringCaller(g_useAlternativeTextureProjection.m_latched) - ); - g_useAlternativeTextureProjection.useLatched(); - - if(g_useAlternativeTextureProjection.m_value) - { - type = eBrushTypeQuake3BP; - } - - // d1223m - GlobalPreferenceSystem().registerPreference( - "BrushAlwaysCaulk", - BoolImportStringCaller(g_brush_always_caulk), - BoolExportStringCaller(g_brush_always_caulk)); - } - - Brush_registerCommands(); - Brush_registerPreferencesPage(); - - BrushFilters_construct(); - - BrushClipPlane::constructStatic(); - BrushInstance::constructStatic(); - Brush::constructStatic(type); - - Brush::m_maxWorldCoord = g_MaxWorldCoord; - BrushInstance::m_counter = &g_brushCount; - - g_texdef_default_scale = 0.5f; - const char* value = g_pGameDescription->getKeyValue("default_scale"); - if(!string_empty(value)) - { - float scale = static_cast(atof(value)); - if(scale != 0) - { - g_texdef_default_scale = scale; - } - else - { - globalErrorStream() << "error parsing \"default_scale\" attribute\n"; - } - } - - GlobalPreferenceSystem().registerPreference("TextureLock", BoolImportStringCaller(g_brush_texturelock_enabled), BoolExportStringCaller(g_brush_texturelock_enabled)); - GlobalPreferenceSystem().registerPreference("BrushSnapPlanes", makeBoolStringImportCallback(FaceImportSnapPlanesCaller()), makeBoolStringExportCallback(FaceExportSnapPlanesCaller())); - GlobalPreferenceSystem().registerPreference("TexdefDefaultScale", FloatImportStringCaller(g_texdef_default_scale), FloatExportStringCaller(g_texdef_default_scale)); - - GridStatus_getTextureLockEnabled = getTextureLockEnabled; - g_texture_lock_status_changed = FreeCaller(); -} - -void Brush_Destroy() -{ - Brush::m_maxWorldCoord = 0; - BrushInstance::m_counter = 0; - - Brush::destroyStatic(); - BrushInstance::destroyStatic(); - BrushClipPlane::destroyStatic(); -} - -void Brush_clipperColourChanged() -{ - BrushClipPlane::destroyStatic(); - BrushClipPlane::constructStatic(); -} - -void BrushFaceData_fromFace(const BrushFaceDataCallback& callback, Face& face) -{ - _QERFaceData faceData; - faceData.m_p0 = face.getPlane().planePoints()[0]; - faceData.m_p1 = face.getPlane().planePoints()[1]; - faceData.m_p2 = face.getPlane().planePoints()[2]; - faceData.m_shader = face.GetShader(); - faceData.m_texdef = face.getTexdef().m_projection.m_texdef; - faceData.contents = face.getShader().m_flags.m_contentFlags; - faceData.flags = face.getShader().m_flags.m_surfaceFlags; - faceData.value = face.getShader().m_flags.m_value; - callback(faceData); -} -typedef ConstReferenceCaller1 BrushFaceDataFromFaceCaller; -typedef Callback1 FaceCallback; - -class Quake3BrushCreator : public BrushCreator -{ -public: - scene::Node& createBrush() - { - return (new BrushNode)->node(); - } - bool useAlternativeTextureProjection() const - { - return g_useAlternativeTextureProjection.m_value; - } - void Brush_forEachFace(scene::Node& brush, const BrushFaceDataCallback& callback) - { - ::Brush_forEachFace(*Node_getBrush(brush), FaceCallback(BrushFaceDataFromFaceCaller(callback))); - } - bool Brush_addFace(scene::Node& brush, const _QERFaceData& faceData) - { - Node_getBrush(brush)->undoSave(); - return Node_getBrush(brush)->addPlane(faceData.m_p0, faceData.m_p1, faceData.m_p2, faceData.m_shader, TextureProjection(faceData.m_texdef, brushprimit_texdef_t(), Vector3(0, 0, 0), Vector3(0, 0, 0))) != 0; - } -}; - -Quake3BrushCreator g_Quake3BrushCreator; - -BrushCreator& GetBrushCreator() -{ - return g_Quake3BrushCreator; -} - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - - -class BrushDependencies : - public GlobalRadiantModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalFilterModuleRef -{ -}; - -class BrushDoom3API : public TypeSystemRef -{ - BrushCreator* m_brushdoom3; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "doom3"); - - BrushDoom3API() - { - Brush_Construct(eBrushTypeDoom3); - - m_brushdoom3 = &GetBrushCreator(); - } - ~BrushDoom3API() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushdoom3; - } -}; - -typedef SingletonModule BrushDoom3Module; -typedef Static StaticBrushDoom3Module; -StaticRegisterModule staticRegisterBrushDoom3(StaticBrushDoom3Module::instance()); - - -class BrushQuake4API : public TypeSystemRef -{ - BrushCreator* m_brushquake4; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "quake4"); - - BrushQuake4API() - { - Brush_Construct(eBrushTypeQuake4); - - m_brushquake4 = &GetBrushCreator(); - } - ~BrushQuake4API() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushquake4; - } -}; - -typedef SingletonModule BrushQuake4Module; -typedef Static StaticBrushQuake4Module; -StaticRegisterModule staticRegisterBrushQuake4(StaticBrushQuake4Module::instance()); - - -class BrushQuake3API : public TypeSystemRef -{ - BrushCreator* m_brushquake3; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "quake3"); - - BrushQuake3API() - { - Brush_Construct(eBrushTypeQuake3); - - m_brushquake3 = &GetBrushCreator(); - } - ~BrushQuake3API() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushquake3; - } -}; - -typedef SingletonModule BrushQuake3Module; -typedef Static StaticBrushQuake3Module; -StaticRegisterModule staticRegisterBrushQuake3(StaticBrushQuake3Module::instance()); - - -class BrushQuake2API : public TypeSystemRef -{ - BrushCreator* m_brushquake2; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "quake2"); - - BrushQuake2API() - { - Brush_Construct(eBrushTypeQuake2); - - m_brushquake2 = &GetBrushCreator(); - } - ~BrushQuake2API() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushquake2; - } -}; - -typedef SingletonModule BrushQuake2Module; -typedef Static StaticBrushQuake2Module; -StaticRegisterModule staticRegisterBrushQuake2(StaticBrushQuake2Module::instance()); - - -class BrushQuake1API : public TypeSystemRef -{ - BrushCreator* m_brushquake1; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "quake"); - - BrushQuake1API() - { - Brush_Construct(eBrushTypeQuake); - - m_brushquake1 = &GetBrushCreator(); - } - ~BrushQuake1API() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushquake1; - } -}; - -typedef SingletonModule BrushQuake1Module; -typedef Static StaticBrushQuake1Module; -StaticRegisterModule staticRegisterBrushQuake1(StaticBrushQuake1Module::instance()); - - -class BrushHalfLifeAPI : public TypeSystemRef -{ - BrushCreator* m_brushhalflife; -public: - typedef BrushCreator Type; - STRING_CONSTANT(Name, "halflife"); - - BrushHalfLifeAPI() - { - Brush_Construct(eBrushTypeHalfLife); - - m_brushhalflife = &GetBrushCreator(); - } - ~BrushHalfLifeAPI() - { - Brush_Destroy(); - } - BrushCreator* getTable() - { - return m_brushhalflife; - } -}; - -typedef SingletonModule BrushHalfLifeModule; -typedef Static StaticBrushHalfLifeModule; -StaticRegisterModule staticRegisterBrushHalfLife(StaticBrushHalfLifeModule::instance()); diff --git a/radiant/brushmodule.h b/radiant/brushmodule.h deleted file mode 100644 index 20f73473..00000000 --- a/radiant/brushmodule.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSHMODULE_H) -#define INCLUDED_BRUSHMODULE_H - -void Brush_clipperColourChanged(); - -#endif diff --git a/radiant/brushnode.cpp b/radiant/brushnode.cpp deleted file mode 100644 index 35f46877..00000000 --- a/radiant/brushnode.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brushnode.h" - diff --git a/radiant/brushnode.h b/radiant/brushnode.h deleted file mode 100644 index 5e1465e3..00000000 --- a/radiant/brushnode.h +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSHNODE_H) -#define INCLUDED_BRUSHNODE_H - -#include "instancelib.h" -#include "brush.h" -#include "brushtokens.h" -#include "brushxml.h" - -class BrushNode : -public scene::Node::Symbiot, -public scene::Instantiable, -public scene::Cloneable -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Brush m_brush; - BrushTokenImporter m_mapImporter; - BrushTokenExporter m_mapExporter; - BrushXMLImporter m_xmlImporter; - BrushXMLExporter m_xmlExporter; - -public: - - typedef LazyStatic StaticTypeCasts; - - Snappable& get(NullType) - { - return m_brush; - } - TransformNode& get(NullType) - { - return m_brush; - } - Brush& get(NullType) - { - return m_brush; - } - XMLImporter& get(NullType) - { - return m_xmlImporter; - } - XMLExporter& get(NullType) - { - return m_xmlExporter; - } - MapImporter& get(NullType) - { - return m_mapImporter; - } - MapExporter& get(NullType) - { - return m_mapExporter; - } - Nameable& get(NullType) - { - return m_brush; - } - BrushDoom3& get(NullType) - { - return m_brush; - } - - BrushNode() : - m_node(this, this, StaticTypeCasts::instance().get()), - m_brush(m_node, InstanceSetEvaluateTransform::Caller(m_instances), InstanceSet::BoundsChangedCaller(m_instances)), - m_mapImporter(m_brush), - m_mapExporter(m_brush), - m_xmlImporter(m_brush), - m_xmlExporter(m_brush) - { - } - BrushNode(const BrushNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_brush(other.m_brush, m_node, InstanceSetEvaluateTransform::Caller(m_instances), InstanceSet::BoundsChangedCaller(m_instances)), - m_mapImporter(m_brush), - m_mapExporter(m_brush), - m_xmlImporter(m_brush), - m_xmlExporter(m_brush) - { - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Node& clone() const - { - return (new BrushNode(*this))->node(); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new BrushInstance(path, parent, m_brush); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -inline Brush* Node_getBrush(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -#endif diff --git a/radiant/brushscript.cpp b/radiant/brushscript.cpp new file mode 100644 index 00000000..68892fc2 --- /dev/null +++ b/radiant/brushscript.cpp @@ -0,0 +1,698 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// BrushScript stuff +// + +/*! +\todo is this still used / in working state? +should we cleanup and remove it for good +*/ + +#include "stdafx.h" +#include "gtkmisc.h" + +// +struct SVariableDef +{ + CString m_strName; + CString m_strInput; + float m_fValue; +}; + +struct SVecVariableDef +{ + CString m_strName; + CString m_strInput; + vec3_t m_vValue; +}; + + + +const int MAX_VARIABLES = 64; + +brush_t* g_pHold1 = NULL; +brush_t* g_pHold2 = NULL; +brush_t* g_pHold3 = NULL; +bool g_bRotateAroundSelection; +int g_nVariableCount; +int g_nVecVariableCount; +int g_nLoopCounter; +float g_fDefault = 9999.9f; +vec3_t g_vDefault; +bool g_bStartLoop; +char* g_pLooper; +bool g_bKeepGoing; + +SVariableDef g_Variables[MAX_VARIABLES]; +SVecVariableDef g_VecVariables[MAX_VARIABLES]; + +void InitForScriptRun() +{ + g_pHold1 = NULL; + g_pHold2 = NULL; + g_pHold3 = NULL; + g_bRotateAroundSelection = true; + g_nVariableCount = 0; + g_nVecVariableCount = 0; + g_nLoopCounter = 0; + g_bStartLoop = false; + g_pLooper = NULL; + g_bKeepGoing = true; +} + +void AddVariable(const char* pName, float fValue, const char* pInput = NULL) +{ + if (g_nVariableCount < MAX_VARIABLES) + { + g_Variables[g_nVariableCount].m_strName = pName; + g_Variables[g_nVariableCount].m_strName.MakeLower(); + g_Variables[g_nVariableCount].m_fValue = fValue; + if (pInput) + g_Variables[g_nVariableCount].m_strInput = pInput; + g_nVariableCount++; + } + else + gtk_MessageBox(g_pParentWnd->m_pWidget, "Maximum script variable limit reached!"); +} + +float VariableValue(const char* pName) +{ + CString strName = pName; + strName.MakeLower(); + for (int n = 0; n < g_nVariableCount; n++) + { + if (strName == g_Variables[n].m_strName) + return g_Variables[n].m_fValue; + } + //strName.Format("Reference to non-existant varirable %s", pName); + //g_pParentWnd->MessageBox(strName); + return g_fDefault; +} + +void SetVariableValue(const char* pName, float fValue) +{ + CString strName = pName; + strName.MakeLower(); + for (int n = 0; n < g_nVariableCount; n++) + { + if (strName == g_Variables[n].m_strName) + g_Variables[n].m_fValue = fValue; + } +} + + + +void AddVectorVariable(const char* pName, const char* pInput = NULL) +{ + if (g_nVecVariableCount < MAX_VARIABLES) + { + g_VecVariables[g_nVecVariableCount].m_strName = pName; + g_VecVariables[g_nVecVariableCount].m_strName.MakeLower(); + if (pInput) + g_VecVariables[g_nVariableCount].m_strInput = pInput; + g_nVecVariableCount++; + } + else + gtk_MessageBox(g_pParentWnd->m_pWidget, "Maximum script variable limit reached!"); +} + +void VectorVariableValue(const char* pName, vec3_t& v) +{ + CString strName = pName; + strName.MakeLower(); + for (int n = 0; n < g_nVecVariableCount; n++) + { + if (strName == g_VecVariables[n].m_strName) + { + VectorCopy(g_VecVariables[n].m_vValue, v); + return; + } + } + strName.Format("Reference to non-existant variable %s", pName); + gtk_MessageBox(g_pParentWnd->m_pWidget, strName); +} + +void SetVectorVariableValue(const char* pName, vec3_t v) +{ + CString strName = pName; + strName.MakeLower(); + for (int n = 0; n < g_nVecVariableCount; n++) + { + if (strName == g_VecVariables[n].m_strName) + VectorCopy(v, g_VecVariables[n].m_vValue); + } +} + + + + + +// commands +// +// _CopySelected(nHoldPos) +// copies selected brush to hold spot 1, 2 or 3 +// +// _MoveSelected(x, y, z) +// moves selected brush by coords provided +// +// _RotateSelected(x, y, z) +// rotates selected brush by coords provided +// +// _MoveHold(nHoldPos, x, y, z) +// moves brush in hold pos by coords provided +// +// _RotateHold(nHoldPos, x, y, z) +// rotates brush in hold pos by coords provided +// +// _CopyToMap(nHoldPos) +// copies hold brush to map +// +// _CopyAndSelect(nHoldPos) +// copies hold brush to map and selects it +// +// _Input(VarName1, ... VarNamennn) +// inputs a list of values from the user +// + +typedef void (PFNScript)(char*&); + + +struct SBrushScript +{ + const char* m_pName; + PFNScript* m_pProc; +}; + + +const char* GetParam(char*& pBuffer) +{ + static CString strParam; + bool bStringMode = false; + + while (*pBuffer != (char)NULL && isspace(*pBuffer)) // skip and whitespace + pBuffer++; + + if (*pBuffer == '(') // if it's an opening paren, skip it + pBuffer++; + + if (*pBuffer == '\"') // string ? + { + pBuffer++; + bStringMode = true; + } + + strParam = ""; + + if (bStringMode) + { + while (*pBuffer != (char)NULL && *pBuffer != '\"') + strParam += *pBuffer++; + } + else + { + while (*pBuffer != (char)NULL && *pBuffer != ' ' && *pBuffer != ')' && *pBuffer != ',') + strParam += *pBuffer++; + } + + if (*pBuffer != (char)NULL) // skip last char + pBuffer++; + + if (strParam.GetLength() > 0) + { + if (strParam.GetAt(0) == '$') // ? variable name + { + float f = VariableValue(strParam); + if (f != g_fDefault) + strParam.Format("%f", f); + } + } + + return strParam; +} + +brush_t* CopyBrush(brush_t* p) +{ + brush_t* pCopy = Brush_Clone(p); + //Brush_AddToList (pCopy, &active_brushes); + //Entity_LinkBrush (world_entity, pCopy); + Brush_Build(pCopy, false); + + return pCopy; +} + + +void CopySelected(char*& pBuffer) +{ + // expects one param + CString strParam = GetParam(pBuffer); + int n = atoi(strParam); + + brush_t* pCopy = NULL; + if (selected_brushes.next != &selected_brushes && + selected_brushes.next->next == &selected_brushes) + pCopy = selected_brushes.next; + + if (pCopy) + { + if (n == 1) + { + //if (g_pHold1) + //Brush_Free(g_pHold1); + g_pHold1 = CopyBrush(pCopy); + } + else if (n == 2) + { + //if (g_pHold2) + //Brush_Free(g_pHold2); + g_pHold2 = CopyBrush(pCopy); + } + else + { + //if (g_pHold3) + //Brush_Free(g_pHold3); + g_pHold3 = CopyBrush(pCopy); + } + } +} + +void MoveSelected(char*& pBuffer) +{ + vec3_t v; + CString strParam = GetParam(pBuffer); + v[0] = atof(strParam); + strParam = GetParam(pBuffer); + v[1] = atof(strParam); + strParam = GetParam(pBuffer); + v[2] = atof(strParam); + Select_Move(v, false); + Sys_UpdateWindows(W_ALL); +} + +void RotateSelected(char*& pBuffer) +{ + vec3_t v; + + if (g_bRotateAroundSelection) + { + Select_GetTrueMid(v); + VectorCopy(v, g_pParentWnd->ActiveXY()->RotateOrigin()); + } + + CString strParam = GetParam(pBuffer); + v[0] = atof(strParam); + strParam = GetParam(pBuffer); + v[1] = atof(strParam); + strParam = GetParam(pBuffer); + v[2] = atof(strParam); + for (int i = 0; i < 3; i++) + if (v[i] != 0.0) + Select_RotateAxis(i, v[i], false , true); + Sys_UpdateWindows(W_ALL); +} + +void MoveHold(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + brush_t* pBrush = NULL; + int nHold = atoi(strParam); + if (nHold == 1) + pBrush = g_pHold1; + else if (nHold == 2) + pBrush = g_pHold2; + else + pBrush = g_pHold3; + + if (pBrush) + { + vec3_t v; + strParam = GetParam(pBuffer); + v[0] = atof(strParam); + strParam = GetParam(pBuffer); + v[1] = atof(strParam); + strParam = GetParam(pBuffer); + v[2] = atof(strParam); + Brush_Move (pBrush, v, false); + } +} + +void RotateHold(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + brush_t* pBrush = NULL; + int nHold = atoi(strParam); + if (nHold == 1) + pBrush = g_pHold1; + else if (nHold == 2) + pBrush = g_pHold2; + else + pBrush = g_pHold3; + + if (pBrush) + { + vec3_t v; + strParam = GetParam(pBuffer); + v[0] = atof(strParam); + strParam = GetParam(pBuffer); + v[1] = atof(strParam); + strParam = GetParam(pBuffer); + v[2] = atof(strParam); + for (int i = 0; i < 3; i++) + if (v[i] != 0.0) + Select_RotateAxis(i, v[i]); + } +} + +void CopyToMap(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + brush_t* pBrush = NULL; + int nHold = atoi(strParam); + if (nHold == 1) + pBrush = g_pHold1; + else if (nHold == 2) + pBrush = g_pHold2; + else + pBrush = g_pHold3; + + if (pBrush) + { + Brush_AddToList(pBrush, &active_brushes); + Entity_LinkBrush (world_entity, pBrush); + Brush_Build(pBrush, false); + + Sys_UpdateWindows(W_ALL); + } +} + +void CopyAndSelect(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + brush_t* pBrush = NULL; + int nHold = atoi(strParam); + if (nHold == 1) + pBrush = g_pHold1; + else if (nHold == 2) + pBrush = g_pHold2; + else + pBrush = g_pHold3; + + if (pBrush) + { + Select_Deselect(); + Brush_AddToList(pBrush, &active_brushes); + Entity_LinkBrush (world_entity, pBrush); + Brush_Build(pBrush, false); + + Select_Brush(pBrush); + Sys_UpdateWindows(W_ALL); + } +} + +void Input(char*& pBuffer) +{ + bool bGo = false; + const char *fields[5] = { "", "", "", "", "" }; + float values[5]; + + for (int n = 0; n < g_nVariableCount; n++) + { + if (g_Variables[n].m_strInput.GetLength() > 0) + { + bGo = true; + if (n < 5) + { + switch (n) + { + case 0 : fields[1] = g_Variables[n].m_strInput.GetBuffer (); break; + case 1 : fields[2] = g_Variables[n].m_strInput.GetBuffer (); break; + case 2 : fields[3] = g_Variables[n].m_strInput.GetBuffer (); break; + case 3 : fields[4] = g_Variables[n].m_strInput.GetBuffer (); break; + case 4 : fields[5] = g_Variables[n].m_strInput.GetBuffer (); break; + } + } + } + } + + if (bGo) + { + if (DoBSInputDlg (fields, values) == IDOK) + { + for (int n = 0; n < g_nVariableCount; n++) + { + if (g_Variables[n].m_strInput.GetLength() > 0) + { + if (n < 5) + { + switch (n) + { + case 0 : g_Variables[n].m_fValue = values[1]; break; + case 1 : g_Variables[n].m_fValue = values[2]; break; + case 2 : g_Variables[n].m_fValue = values[3]; break; + case 3 : g_Variables[n].m_fValue = values[4]; break; + case 4 : g_Variables[n].m_fValue = values[5]; break; + } + } + } + } + } + else g_bKeepGoing = false; + } +} + +bool g_bWaiting; +void _3DPointDone(bool b, int n) +{ + g_bWaiting = false; +} + +void _3DPointInput(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + CString strParam2 = GetParam(pBuffer); + ShowInfoDialog(strParam2); + AddVectorVariable(strParam, strParam2); + g_bWaiting = true; + AcquirePath(2, &_3DPointDone); + while (g_bWaiting) + gtk_main_iteration (); + HideInfoDialog(); + SetVectorVariableValue(strParam, g_PathPoints[0]); +} + +void SetRotateOrigin(char*& pBuffer) +{ + vec3_t v; + CString strParam = GetParam(pBuffer); + VectorVariableValue(strParam, v); + VectorCopy(v, g_pParentWnd->ActiveXY()->RotateOrigin()); + g_bRotateAroundSelection = false; +} + +void InputVar(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + CString strParam2 = GetParam(pBuffer); + AddVariable(strParam, 0.0, strParam2); +} + +void LoopCount(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + g_nLoopCounter = atoi(strParam); + if (g_nLoopCounter == 0) + g_nLoopCounter = (int)VariableValue(strParam); + if (g_nLoopCounter > 0) + g_pLooper = pBuffer; +} + +void LoopRun(char*& pBuffer) +{ + if (g_bStartLoop == true) + { + g_nLoopCounter--; + if (g_nLoopCounter == 0) + { + g_bStartLoop = false; + GetParam(pBuffer); + } + else + pBuffer = g_pLooper; + } + else + { + if (g_pLooper && g_nLoopCounter > 0) + { + g_bStartLoop = true; + pBuffer = g_pLooper; + } + else + { + GetParam(pBuffer); + } + } +} + + +void ConfirmMessage(char*& pBuffer) +{ + CString strParam = GetParam(pBuffer); + if (gtk_MessageBox(g_pParentWnd->m_pWidget, strParam, "Script Info", MB_OKCANCEL) == IDCANCEL) + g_bKeepGoing = false; +} + +void Spherize(char*& pBuffer) +{ + g_bScreenUpdates = false; + for (int n = 0; n < 120; n += 36) + { + for (int i = 0; i < 360; i += 36) + { + Select_RotateAxis(0, i, false , true); + CSG_Subtract(); + } + Select_RotateAxis(2, n, false , true); + } + g_bScreenUpdates = true; +} + +void RunIt(char*& pBuffer); +SBrushScript g_ScriptCmds[] = +{ + {"_CopySelected", &CopySelected}, + {"_MoveSelected", &MoveSelected}, + {"_RotateSelected", &RotateSelected}, + {"_MoveHold", &MoveHold}, + {"_RotateHold", &RotateHold}, + {"_CopyToMap", &CopyToMap}, + {"_CopyAndSelect", &CopyAndSelect}, + {"_Input", &Input}, + {"_3DPointInput", &_3DPointInput}, + {"_SetRotateOrigin", &SetRotateOrigin}, + {"_InputVar", &InputVar}, + {"_LoopCount", &LoopCount}, + {"_LoopRun", &LoopRun}, + {"_ConfirmMessage", &ConfirmMessage}, + {"_Spherize", &Spherize}, + {"_RunScript", RunIt} +}; + +const int g_nScriptCmdCount = sizeof(g_ScriptCmds) / sizeof(SBrushScript); + +void RunScript(char* pBuffer) +{ + g_pHold1 = NULL; + g_pHold2 = NULL; + g_pHold3 = NULL; + + while (g_bKeepGoing && pBuffer && *pBuffer) + { + while (*pBuffer != (char)NULL && *pBuffer != '_') + pBuffer++; + + char* pTemp = pBuffer; + int nLen = 0; + while (*pTemp != (char)NULL && *pTemp != '(') + { + pTemp++; + nLen++; + } + if (*pBuffer != (char)NULL) + { + bool bFound = false; + for (int i = 0; i < g_nScriptCmdCount; i++) + { + //if (strnicmp(g_ScriptCmds[i].m_pName, pBuffer, strlen(g_ScriptCmds[i].m_pName)) == 0) + if (strnicmp(g_ScriptCmds[i].m_pName, pBuffer, nLen) == 0) + { + pBuffer += strlen(g_ScriptCmds[i].m_pName); + g_ScriptCmds[i].m_pProc(pBuffer); + if (g_bStartLoop) + { + } + bFound = true; + break; + } + } + if (!bFound) + pBuffer++; + } + } +} + + +void RunScriptByName(char* pBuffer, bool bInit) +{ + if (bInit) + InitForScriptRun(); + char* pScript = new char[4096]; + CString strINI; + strINI = g_strGameToolsPath; + strINI += "/scripts.ini"; + CString strScript; + FILE *f; + + f = fopen (strINI.GetBuffer(), "rt"); + if (f != NULL) + { + char line[1024], *ptr; + + // read section names + while (fgets (line, 1024, f) != 0) + { + if (line[0] != '[') + continue; + + ptr = strchr (line, ']'); + *ptr = '\0'; + + if (strcmp (line, pScript) == 0) + { + while (fgets (line, 1024, f) != 0) + { + if ((strchr (line, '=') == NULL) || + strlen (line) == 0) + break; + strScript += line; + } + break; + } + } + fclose (f); + } + RunScript((char*)strScript.GetBuffer()); +} + + +void RunIt(char*& pBuffer) +{ + brush_t* p1 = g_pHold1; + brush_t* p2 = g_pHold2; + brush_t* p3 = g_pHold3; + + CString strParam = GetParam(pBuffer); + RunScriptByName((char*)strParam.GetBuffer(), false); + + g_pHold3 = p3; + g_pHold2 = p2; + g_pHold1 = p1; +} + diff --git a/radiant/brushtokens.cpp b/radiant/brushtokens.cpp deleted file mode 100644 index e8674c98..00000000 --- a/radiant/brushtokens.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brushtokens.h" - diff --git a/radiant/brushtokens.h b/radiant/brushtokens.h deleted file mode 100644 index 19d8c7b9..00000000 --- a/radiant/brushtokens.h +++ /dev/null @@ -1,738 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSHTOKENS_H) -#define INCLUDED_BRUSHTOKENS_H - -#include "stringio.h" -#include "stream/stringstream.h" -#include "brush.h" - -inline bool FaceShader_importContentsFlagsValue(FaceShader& faceShader, Tokeniser& tokeniser) -{ - // parse the optional contents/flags/value - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_contentFlags)); - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_surfaceFlags)); - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_value)); - return true; -} - -inline bool FaceTexdef_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser) -{ - // parse texdef - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[0])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[1])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.rotate)); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[0])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[1])); - - ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_importTokens: bad texdef"); - return true; -} - -inline bool FaceTexdef_BP_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser) -{ - // parse alternate texdef - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][0])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][1])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][2])); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - } - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][0])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][1])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][2])); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - } - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - return true; -} - -inline bool FaceTexdef_HalfLife_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser) -{ - // parse texdef - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "[")); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.x())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.y())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.z())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[0])); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "]")); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "[")); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.x())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.y())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.z())); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[1])); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "]")); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.rotate)); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[0])); - RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[1])); - - texdef.m_projection.m_texdef.rotate = -texdef.m_projection.m_texdef.rotate; - - ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_importTokens: bad texdef"); - return true; -} - -inline bool FacePlane_importTokens(FacePlane& facePlane, Tokeniser& tokeniser) -{ - // parse planepts - for(std::size_t i = 0; i<3; i++) - { - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - for(std::size_t j = 0; j < 3; ++j) - { - RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, facePlane.planePoints()[i][j])); - } - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - } - facePlane.MakePlane(); - return true; -} - -inline bool FacePlane_Doom3_importTokens(FacePlane& facePlane, Tokeniser& tokeniser) -{ - Plane3 plane; - // parse plane equation - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.a)); - RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.b)); - RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.c)); - RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.d)); - plane.d = -plane.d; - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - - facePlane.setDoom3Plane(plane); - return true; -} - -inline bool FaceShader_Doom3_importTokens(FaceShader& faceShader, Tokeniser& tokeniser) -{ - const char *shader = tokeniser.getToken(); - if(shader == 0) - { - Tokeniser_unexpectedError(tokeniser, shader, "#shader-name"); - return false; - } - if(string_equal(shader, "_emptyname")) - { - shader = texdef_name_default(); - } - faceShader.setShader(shader); - return true; -} - -inline bool FaceShader_importTokens(FaceShader& faceShader, Tokeniser& tokeniser) -{ - const char* texture = tokeniser.getToken(); - if(texture == 0) - { - Tokeniser_unexpectedError(tokeniser, texture, "#texture-name"); - return false; - } - if(string_equal(texture, "NULL")) - { - faceShader.setShader(texdef_name_default()); - } - else - { - StringOutputStream shader(string_length(GlobalTexturePrefix_get()) + string_length(texture)); - shader << GlobalTexturePrefix_get() << texture; - faceShader.setShader(shader.c_str()); - } - return true; -} - - - - -class Doom3FaceTokenImporter -{ - Face& m_face; -public: - Doom3FaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_Doom3_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_Doom3_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser)); - - m_face.getTexdef().m_projectionInitialised = true; - m_face.getTexdef().m_scaleApplied = true; - - return true; - } -}; - -class Quake4FaceTokenImporter -{ - Face& m_face; -public: - Quake4FaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_Doom3_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_Doom3_importTokens(m_face.getShader(), tokeniser)); - - m_face.getTexdef().m_projectionInitialised = true; - m_face.getTexdef().m_scaleApplied = true; - - return true; - } -}; - -class Quake2FaceTokenImporter -{ - Face& m_face; -public: - Quake2FaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser)); - if(Tokeniser_nextTokenIsDigit(tokeniser)) - { - m_face.getShader().m_flags.m_specified = true; - RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser)); - } - m_face.getTexdef().m_scaleApplied = true; - return true; - } -}; - -class Quake3FaceTokenImporter -{ - Face& m_face; -public: - Quake3FaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser)); - m_face.getTexdef().m_scaleApplied = true; - return true; - } -}; - -class Quake3BPFaceTokenImporter -{ - Face& m_face; -public: - Quake3BPFaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser)); - - m_face.getTexdef().m_projectionInitialised = true; - m_face.getTexdef().m_scaleApplied = true; - - return true; - } -}; - -class QuakeFaceTokenImporter -{ - Face& m_face; -public: - QuakeFaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser)); - m_face.getTexdef().m_scaleApplied = true; - return true; - } -}; - -class HalfLifeFaceTokenImporter -{ - Face& m_face; -public: - HalfLifeFaceTokenImporter(Face& face) : m_face(face) - { - } - bool importTokens(Tokeniser& tokeniser) - { - RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser)); - RETURN_FALSE_IF_FAIL(FaceTexdef_HalfLife_importTokens(m_face.getTexdef(), tokeniser)); - m_face.getTexdef().m_scaleApplied = true; - return true; - } -}; - - -inline void FacePlane_Doom3_exportTokens(const FacePlane& facePlane, TokenWriter& writer) -{ - // write plane equation - writer.writeToken("("); - writer.writeFloat(facePlane.getDoom3Plane().a); - writer.writeFloat(facePlane.getDoom3Plane().b); - writer.writeFloat(facePlane.getDoom3Plane().c); - writer.writeFloat(-facePlane.getDoom3Plane().d); - writer.writeToken(")"); -} - -inline void FacePlane_exportTokens(const FacePlane& facePlane, TokenWriter& writer) -{ - // write planepts - for(std::size_t i=0; i<3; i++) - { - writer.writeToken("("); - for(std::size_t j=0; j<3; j++) - { - writer.writeFloat(Face::m_quantise(facePlane.planePoints()[i][j])); - } - writer.writeToken(")"); - } -} - -inline void FaceTexdef_BP_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer) -{ - // write alternate texdef - writer.writeToken("("); - { - writer.writeToken("("); - for(std::size_t i=0;i<3;i++) - { - writer.writeFloat(faceTexdef.m_projection.m_brushprimit_texdef.coords[0][i]); - } - writer.writeToken(")"); - } - { - writer.writeToken("("); - for(std::size_t i=0;i<3;i++) - { - writer.writeFloat(faceTexdef.m_projection.m_brushprimit_texdef.coords[1][i]); - } - writer.writeToken(")"); - } - writer.writeToken(")"); -} - -inline void FaceTexdef_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer) -{ - ASSERT_MESSAGE(texdef_sane(faceTexdef.m_projection.m_texdef), "FaceTexdef_exportTokens: bad texdef"); - // write texdef - writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[0]); - writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[1]); - writer.writeFloat(faceTexdef.m_projection.m_texdef.rotate); - writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[0]); - writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[1]); -} - -inline void FaceTexdef_HalfLife_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer) -{ - ASSERT_MESSAGE(texdef_sane(faceTexdef.m_projection.m_texdef), "FaceTexdef_exportTokens: bad texdef"); - // write texdef - writer.writeToken("["); - writer.writeFloat(faceTexdef.m_projection.m_basis_s.x()); - writer.writeFloat(faceTexdef.m_projection.m_basis_s.y()); - writer.writeFloat(faceTexdef.m_projection.m_basis_s.z()); - writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[0]); - writer.writeToken("]"); - writer.writeToken("["); - writer.writeFloat(faceTexdef.m_projection.m_basis_t.x()); - writer.writeFloat(faceTexdef.m_projection.m_basis_t.y()); - writer.writeFloat(faceTexdef.m_projection.m_basis_t.z()); - writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[1]); - writer.writeToken("]"); - writer.writeFloat(-faceTexdef.m_projection.m_texdef.rotate); - writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[0]); - writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[1]); -} - -inline void FaceShader_ContentsFlagsValue_exportTokens(const FaceShader& faceShader, TokenWriter& writer) -{ - // write surface flags - writer.writeInteger(faceShader.m_flags.m_contentFlags); - writer.writeInteger(faceShader.m_flags.m_surfaceFlags); - writer.writeInteger(faceShader.m_flags.m_value); -} - -inline void FaceShader_exportTokens(const FaceShader& faceShader, TokenWriter& writer) -{ - // write shader name - if(string_empty(shader_get_textureName(faceShader.getShader()))) - { - writer.writeToken("NULL"); - } - else - { - writer.writeToken(shader_get_textureName(faceShader.getShader())); - } -} - -inline void FaceShader_Doom3_exportTokens(const FaceShader& faceShader, TokenWriter& writer) -{ - // write shader name - if(string_empty(shader_get_textureName(faceShader.getShader()))) - { - writer.writeString("_emptyname"); - } - else - { - writer.writeString(faceShader.getShader()); - } -} - -class Doom3FaceTokenExporter -{ - const Face& m_face; -public: - Doom3FaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_Doom3_exportTokens(m_face.getPlane(), writer); - FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer); - FaceShader_Doom3_exportTokens(m_face.getShader(), writer); - FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer); - writer.nextLine(); - } -}; - -class Quake4FaceTokenExporter -{ - const Face& m_face; -public: - Quake4FaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_Doom3_exportTokens(m_face.getPlane(), writer); - FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer); - FaceShader_Doom3_exportTokens(m_face.getShader(), writer); - writer.nextLine(); - } -}; - -class Quake2FaceTokenExporter -{ - const Face& m_face; -public: - Quake2FaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_exportTokens(m_face.getPlane(), writer); - FaceShader_exportTokens(m_face.getShader(), writer); - FaceTexdef_exportTokens(m_face.getTexdef(), writer); - if(m_face.getShader().m_flags.m_specified || m_face.isDetail()) - { - FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer); - } - writer.nextLine(); - } -}; - -class Quake3FaceTokenExporter -{ - const Face& m_face; -public: - Quake3FaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_exportTokens(m_face.getPlane(), writer); - FaceShader_exportTokens(m_face.getShader(), writer); - FaceTexdef_exportTokens(m_face.getTexdef(), writer); - FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer); - writer.nextLine(); - } -}; - -class Quake3BPFaceTokenExporter -{ - const Face& m_face; -public: - Quake3BPFaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_exportTokens(m_face.getPlane(), writer); - FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer); - FaceShader_exportTokens(m_face.getShader(), writer); - FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer); - writer.nextLine(); - } -}; - -class QuakeFaceTokenExporter -{ - const Face& m_face; -public: - QuakeFaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_exportTokens(m_face.getPlane(), writer); - FaceShader_exportTokens(m_face.getShader(), writer); - FaceTexdef_exportTokens(m_face.getTexdef(), writer); - writer.nextLine(); - } -}; - -class HalfLifeFaceTokenExporter -{ - const Face& m_face; -public: - HalfLifeFaceTokenExporter(const Face& face) : m_face(face) - { - } - void exportTokens(TokenWriter& writer) const - { - FacePlane_exportTokens(m_face.getPlane(), writer); - FaceShader_exportTokens(m_face.getShader(), writer); - FaceTexdef_HalfLife_exportTokens(m_face.getTexdef(), writer); - writer.nextLine(); - } -}; - - -class BrushTokenImporter : public MapImporter -{ - Brush& m_brush; - -public: - BrushTokenImporter(Brush& brush) : m_brush(brush) - { - } - bool importTokens(Tokeniser& tokeniser) - { - if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4) - { - tokeniser.nextLine(); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "{")); - } - while(1) - { - // check for end of brush - tokeniser.nextLine(); - const char* token = tokeniser.getToken(); - if(string_equal(token, "}")) - { - break; - } - - tokeniser.ungetToken(); - - m_brush.push_back(FaceSmartPointer(new Face(&m_brush))); - - //!todo BP support - tokeniser.nextLine(); - - Face& face = *m_brush.back(); - - switch(Brush::m_type) - { - case eBrushTypeDoom3: - { - Doom3FaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeQuake4: - { - Quake4FaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeQuake2: - { - Quake2FaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeQuake3: - { - Quake3FaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeQuake3BP: - { - Quake3BPFaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeQuake: - { - QuakeFaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - case eBrushTypeHalfLife: - { - HalfLifeFaceTokenImporter importer(face); - RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser)); - } - break; - } - face.planeChanged(); - } - if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4) - { - tokeniser.nextLine(); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "}")); - } - - m_brush.planeChanged(); - m_brush.shaderChanged(); - - return true; - } -}; - - -class BrushTokenExporter : public MapExporter -{ - const Brush& m_brush; - -public: - BrushTokenExporter(const Brush& brush) : m_brush(brush) - { - } - void exportTokens(TokenWriter& writer) const - { - m_brush.evaluateBRep(); // ensure b-rep is up-to-date, so that non-contributing faces can be identified. - - if(!m_brush.hasContributingFaces()) - { - return; - } - - writer.writeToken("{"); - writer.nextLine(); - - if(Brush::m_type == eBrushTypeQuake3BP) - { - writer.writeToken("brushDef"); - writer.nextLine(); - writer.writeToken("{"); - writer.nextLine(); - } - - if(Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4) - { - writer.writeToken("brushDef3"); - writer.nextLine(); - writer.writeToken("{"); - writer.nextLine(); - } - - for(Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i) - { - const Face& face = *(*i); - - if(face.contributes()) - { - switch(Brush::m_type) - { - case eBrushTypeDoom3: - { - Doom3FaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeQuake4: - { - Quake4FaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeQuake2: - { - Quake2FaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeQuake3: - { - Quake3FaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeQuake3BP: - { - Quake3BPFaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeQuake: - { - QuakeFaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - case eBrushTypeHalfLife: - { - HalfLifeFaceTokenExporter exporter(face); - exporter.exportTokens(writer); - } - break; - } - } - } - - if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4) - { - writer.writeToken("}"); - writer.nextLine(); - } - - writer.writeToken("}"); - writer.nextLine(); - } -}; - - -#endif diff --git a/radiant/brushxml.cpp b/radiant/brushxml.cpp deleted file mode 100644 index ae18cf34..00000000 --- a/radiant/brushxml.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "brushxml.h" - diff --git a/radiant/brushxml.h b/radiant/brushxml.h deleted file mode 100644 index afadc8a0..00000000 --- a/radiant/brushxml.h +++ /dev/null @@ -1,457 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_BRUSHXML_H) -#define INCLUDED_BRUSHXML_H - -#include "stream/stringstream.h" -#include "xml/xmlelement.h" - -#include "brush.h" - -inline void FaceTexdef_BP_importXML(FaceTexdef& texdef, const char* xmlContent) -{ - StringTokeniser content(xmlContent); - - texdef.m_projection.m_brushprimit_texdef.coords[0][0] = static_cast(atof(content.getToken())); - texdef.m_projection.m_brushprimit_texdef.coords[0][1] = static_cast(atof(content.getToken())); - texdef.m_projection.m_brushprimit_texdef.coords[0][2] = static_cast(atof(content.getToken())); - texdef.m_projection.m_brushprimit_texdef.coords[1][0] = static_cast(atof(content.getToken())); - texdef.m_projection.m_brushprimit_texdef.coords[1][1] = static_cast(atof(content.getToken())); - texdef.m_projection.m_brushprimit_texdef.coords[1][2] = static_cast(atof(content.getToken())); -} -inline void FaceTexdef_importXML(FaceTexdef& texdef, const char* xmlContent) -{ - StringTokeniser content(xmlContent); - - texdef.m_projection.m_texdef.shift[0] = static_cast(atof(content.getToken())); - texdef.m_projection.m_texdef.shift[1] = static_cast(atof(content.getToken())); - texdef.m_projection.m_texdef.rotate = static_cast(atof(content.getToken())); - texdef.m_projection.m_texdef.scale[0] = static_cast(atof(content.getToken())); - texdef.m_projection.m_texdef.scale[1] = static_cast(atof(content.getToken())); - - ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_importXML: bad texdef"); -} - -inline void FacePlane_importXML(FacePlane& facePlane, const char* xmlContent) -{ - StringTokeniser content(xmlContent); - - for (int i = 0; i < 3; ++i) - { - for (int j = 0; j < 3; ++j) - { - facePlane.planePoints()[i][j] = atof(content.getToken()); - } - } - facePlane.MakePlane(); -} - - -class FaceXMLImporter -{ - struct xml_state_t - { - enum EState - { - eDefault, - ePlanePts, - eTexdef, - eBPMatrix, - eFlags, - eShader, - }; - - EState m_state; - StringOutputStream m_content; - - xml_state_t(EState state) - : m_state(state) - {} - - EState state() const - { - return m_state; - } - const char* content() const - { - return m_content.c_str(); - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_content.write(buffer, length); - } - }; - - std::vector m_xml_state; - Face& m_face; -public: - FaceXMLImporter(Face& face) : m_face(face) - { - m_xml_state.push_back(xml_state_t::eDefault); - } - ~FaceXMLImporter() - { - m_face.planeChanged(); - } - - void pushElement(const XMLElement& element) - { - ASSERT_MESSAGE(m_xml_state.back().state() == xml_state_t::eDefault, "parse error"); - - if(strcmp(element.name(), "planepts") == 0) - { - m_xml_state.push_back(xml_state_t::ePlanePts); - } - else if(strcmp(element.name(), "texdef") == 0) - { - m_xml_state.push_back(xml_state_t::eTexdef); - } - else if(strcmp(element.name(), "bpmatrix") == 0) - { - m_xml_state.push_back(xml_state_t::eBPMatrix); - } - else if(strcmp(element.name(), "flags") == 0) - { - m_xml_state.push_back(xml_state_t::eFlags); - } - else if(strcmp(element.name(), "shader") == 0) - { - m_xml_state.push_back(xml_state_t::eShader); - } - } - void popElement(const char* name) - { - ASSERT_MESSAGE(m_xml_state.back().state() != xml_state_t::eDefault, "parse error"); - - switch(m_xml_state.back().state()) - { - case xml_state_t::ePlanePts: - { - FacePlane_importXML(m_face.getPlane(), m_xml_state.back().content()); - } - break; - case xml_state_t::eTexdef: - { - FaceTexdef_importXML(m_face.getTexdef(), m_xml_state.back().content()); - } - break; - case xml_state_t::eBPMatrix: - { - FaceTexdef_BP_importXML(m_face.getTexdef(), m_xml_state.back().content()); - } - break; - case xml_state_t::eFlags: - { - StringTokeniser content(m_xml_state.back().content()); - - m_face.getShader().m_flags.m_contentFlags = atoi(content.getToken()); - m_face.getShader().m_flags.m_surfaceFlags = atoi(content.getToken()); - m_face.getShader().m_flags.m_value = atoi(content.getToken()); - } - break; - case xml_state_t::eShader: - { - m_face.getShader().setShader(m_xml_state.back().content()); - } - break; - default: - break; - } - - m_xml_state.pop_back(); - } - std::size_t write(const char* data, std::size_t length) - { - ASSERT_MESSAGE(!m_xml_state.empty(), "parse error"); - return m_xml_state.back().write(data, length); - } -}; - - -inline void FaceTexdef_exportXML(const FaceTexdef& texdef, XMLImporter& importer) -{ - StaticElement element("texdef"); - importer.pushElement(element); - - ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_exportXML: bad texdef"); - - importer << texdef.m_projection.m_texdef.shift[0] - << ' ' << texdef.m_projection.m_texdef.shift[1] - << ' ' << texdef.m_projection.m_texdef.rotate - << ' ' << texdef.m_projection.m_texdef.scale[0] - << ' ' << texdef.m_projection.m_texdef.scale[1]; - - importer.popElement(element.name()); -} -inline void FaceTexdef_BP_exportXML(const FaceTexdef& texdef, XMLImporter& importer) -{ - StaticElement element("texdef"); - importer.pushElement(element); - - for(int i = 0; i < 2; ++i) - { - for(int j = 0; j < 3; ++j) - { - importer << texdef.m_projection.m_brushprimit_texdef.coords[i][j] << ' '; - } - } - - importer.popElement(element.name()); -} -inline void FaceShader_ContentsFlagsValue_exportXML(const FaceShader& faceShader, XMLImporter& importer) -{ - StaticElement element("flags"); - importer.pushElement(element); - - { - importer << faceShader.m_flags.m_contentFlags - << ' ' << faceShader.m_flags.m_surfaceFlags - << ' ' << faceShader.m_flags.m_value; - } - - importer.popElement(element.name()); -} - -inline void FacePlane_exportXML(const FacePlane& facePlane, XMLImporter& importer) -{ - StaticElement element("planepts"); - importer.pushElement(element); - - { - // write planepts - for (int i=0 ; i<3 ; i++) - { - for (int j=0 ; j<3 ; j++) - { - importer << Face::m_quantise(facePlane.planePoints()[i][j]) << ' '; - } - } - } - - importer.popElement(element.name()); -} - -inline void FacePolygon_exportXML(const Winding& w, const BasicVector3& normal, XMLImporter& importer) -{ - DynamicElement element("polygon"); - - char tmp[32]; - - sprintf(tmp, "%f", normal.x()); - element.insertAttribute("nx", tmp); - - sprintf(tmp, "%f", normal.y()); - element.insertAttribute("ny", tmp); - - sprintf(tmp, "%f", normal.z()); - element.insertAttribute("nz", tmp); - - importer.pushElement(element); - - for(unsigned int i = 0; i < w.numpoints; ++i) - { - DynamicElement c("vertex"); - - sprintf(tmp, "%f", w.points[i].vertex.x()); - c.insertAttribute("x", tmp); - - sprintf(tmp, "%f", w.points[i].vertex.y()); - c.insertAttribute("y", tmp); - - sprintf(tmp, "%f", w.points[i].vertex.z()); - c.insertAttribute("z", tmp); - - sprintf(tmp, "%f", w.points[i].texcoord.x()); - c.insertAttribute("s", tmp); - - sprintf(tmp, "%f", w.points[i].texcoord.y()); - c.insertAttribute("t", tmp); - - importer.pushElement(c); - importer.popElement(c.name()); - } - - importer.popElement(element.name()); -} - -class FaceXMLExporter -{ - const Face& m_face; -public: - FaceXMLExporter(const Face& face) : m_face(face) - { - } - void exportXML(XMLImporter& importer) - { - bool bAlternateTexdef = (Face::m_type == eBrushTypeQuake3BP || Face::m_type == eBrushTypeDoom3 || Face::m_type == eBrushTypeQuake4); - - // write shader - { - StaticElement element("shader"); - importer.pushElement(element); - importer << m_face.getShader().getShader(); - importer.popElement(element.name()); - } - - FacePolygon_exportXML(m_face.getWinding(), m_face.getPlane().plane3().normal(), importer); - FacePlane_exportXML(m_face.getPlane(), importer); - - if(!bAlternateTexdef) - { - FaceTexdef_exportXML(m_face.getTexdef(), importer); - } - else - { - FaceTexdef_BP_exportXML(m_face.getTexdef(), importer); - } - - FaceShader_ContentsFlagsValue_exportXML(m_face.getShader(), importer); - } -}; - - -class BrushXMLImporter : public XMLImporter -{ - class xml_state_t - { - public: - enum EState - { - eDefault, - eBrush, - eFace, - }; - - private: - EState m_state; - - public: - xml_state_t(EState state) - : m_state(state) - { - } - EState state() const - { - return m_state; - } - }; - - std::vector m_xml_state; - char m_faceImporter[sizeof(FaceXMLImporter)]; - Brush& m_brush; - - FaceXMLImporter& faceImporter() - { - return *reinterpret_cast(m_faceImporter); - } - -public: - BrushXMLImporter(Brush& brush) : m_brush(brush) - { - m_xml_state.push_back(xml_state_t::eDefault); - } - void pushElement(const XMLElement& element) - { - switch(m_xml_state.back().state()) - { - case xml_state_t::eDefault: - ASSERT_MESSAGE(strcmp(element.name(), "brush") == 0, "parse error"); - m_xml_state.push_back(xml_state_t::eBrush); - break; - case xml_state_t::eBrush: - ASSERT_MESSAGE(strcmp(element.name(), "plane") == 0, "parse error"); - m_xml_state.push_back(xml_state_t::eFace); - m_brush.push_back(FaceSmartPointer(new Face(&m_brush))); - constructor(faceImporter(), makeReference(*m_brush.back())); - m_brush.planeChanged(); - m_brush.shaderChanged(); - break; - case xml_state_t::eFace: - m_xml_state.push_back(xml_state_t::eFace); - faceImporter().pushElement(element); - break; - } - } - void popElement(const char* name) - { - ASSERT_MESSAGE(!m_xml_state.empty(), "parse error"); - m_xml_state.pop_back(); - - switch(m_xml_state.back().state()) - { - case xml_state_t::eDefault: - break; - case xml_state_t::eBrush: - destructor(faceImporter()); - break; - case xml_state_t::eFace: - faceImporter().popElement(name); - break; - } - } - std::size_t write(const char* data, std::size_t length) - { - switch(m_xml_state.back().state()) - { - case xml_state_t::eFace: - return faceImporter().write(data, length); - break; - default: - break; - } - return length; - } -}; - -class BrushXMLExporter : public XMLExporter -{ - const Brush& m_brush; - -public: - BrushXMLExporter(const Brush& brush) : m_brush(brush) - { - } - void exportXML(XMLImporter& importer) - { - m_brush.evaluateBRep(); // ensure b-rep is up-to-date, so that non-contributing faces can be identified. - ASSERT_MESSAGE(m_brush.hasContributingFaces(), "exporting an empty brush"); - - const StaticElement brushElement("brush"); - importer.pushElement(brushElement); - - for(Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i) - { - if((*i)->contributes()) - { - const StaticElement element("plane"); - importer.pushElement(element); - FaceXMLExporter(*(*i)).exportXML(importer); - importer.popElement(element.name()); - } - } - - importer.popElement(brushElement.name()); - } -}; - - -#endif diff --git a/radiant/build.cpp b/radiant/build.cpp deleted file mode 100644 index dcb23a28..00000000 --- a/radiant/build.cpp +++ /dev/null @@ -1,1158 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "build.h" -#include "debugging/debugging.h" - -#include -#include -#include "stream/stringstream.h" -#include "versionlib.h" - -#include "mainframe.h" - -typedef std::map Variables; -Variables g_build_variables; - -void build_clear_variables() -{ - g_build_variables.clear(); -} - -void build_set_variable(const char* name, const char* value) -{ - g_build_variables[name] = value; -} - -const char* build_get_variable(const char* name) -{ - Variables::iterator i = g_build_variables.find(name); - if(i != g_build_variables.end()) - { - return (*i).second.c_str(); - } - globalErrorStream() << "undefined build variable: " << makeQuoted(name) << "\n"; - return ""; -} - -#include "xml/ixml.h" -#include "xml/xmlelement.h" - -class Evaluatable -{ -public: - virtual void evaluate(StringBuffer& output) = 0; - virtual void exportXML(XMLImporter& importer) = 0; -}; - -class VariableString : public Evaluatable -{ - CopiedString m_string; -public: - VariableString() : m_string() - { - } - VariableString(const char* string) : m_string(string) - { - } - const char* c_str() const - { - return m_string.c_str(); - } - void setString(const char* string) - { - m_string = string; - } - void evaluate(StringBuffer& output) - { - StringBuffer variable; - bool in_variable = false; - for(const char* i = m_string.c_str(); *i != '\0'; ++i) - { - if(!in_variable) - { - switch(*i) - { - case '[': - in_variable = true; - break; - default: - output.push_back(*i); - break; - } - } - else - { - switch(*i) - { - case ']': - in_variable = false; - output.push_string(build_get_variable(variable.c_str())); - variable.clear(); - break; - default: - variable.push_back(*i); - break; - } - } - } - } - void exportXML(XMLImporter& importer) - { - importer << c_str(); - } -}; - -class Conditional : public Evaluatable -{ - VariableString* m_test; -public: - Evaluatable* m_result; - Conditional(VariableString* test) : m_test(test) - { - } - ~Conditional() - { - delete m_test; - delete m_result; - } - void evaluate(StringBuffer& output) - { - StringBuffer buffer; - m_test->evaluate(buffer); - if(!string_empty(buffer.c_str())) - { - m_result->evaluate(output); - } - } - void exportXML(XMLImporter& importer) - { - StaticElement conditionElement("cond"); - conditionElement.insertAttribute("value", m_test->c_str()); - importer.pushElement(conditionElement); - m_result->exportXML(importer); - importer.popElement(conditionElement.name()); - } -}; - -typedef std::vector Evaluatables; - -class Tool : public Evaluatable -{ - Evaluatables m_evaluatables; -public: - ~Tool() - { - for(Evaluatables::iterator i = m_evaluatables.begin(); i != m_evaluatables.end(); ++i) - { - delete (*i); - } - } - void push_back(Evaluatable* evaluatable) - { - m_evaluatables.push_back(evaluatable); - } - void evaluate(StringBuffer& output) - { - for(Evaluatables::iterator i = m_evaluatables.begin(); i != m_evaluatables.end(); ++i) - { - (*i)->evaluate(output); - } - } - void exportXML(XMLImporter& importer) - { - for(Evaluatables::iterator i = m_evaluatables.begin(); i != m_evaluatables.end(); ++i) - { - (*i)->exportXML(importer); - } - } -}; - -#include "xml/ixml.h" - -class XMLElementParser : public TextOutputStream -{ -public: - virtual XMLElementParser& pushElement(const XMLElement& element) = 0; - virtual void popElement(const char* name) = 0; -}; - -class VariableStringXMLConstructor : public XMLElementParser -{ - StringBuffer m_buffer; - VariableString& m_variableString; -public: - VariableStringXMLConstructor(VariableString& variableString) : m_variableString(variableString) - { - } - ~VariableStringXMLConstructor() - { - m_variableString.setString(m_buffer.c_str()); - } - std::size_t write(const char* buffer, std::size_t length) - { - m_buffer.push_range(buffer, buffer + length); - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\""); - return *this; - } - void popElement(const char* name) - { - } -}; - -class ConditionalXMLConstructor : public XMLElementParser -{ - StringBuffer m_buffer; - Conditional& m_conditional; -public: - ConditionalXMLConstructor(Conditional& conditional) : m_conditional(conditional) - { - } - ~ConditionalXMLConstructor() - { - m_conditional.m_result = new VariableString(m_buffer.c_str()); - } - std::size_t write(const char* buffer, std::size_t length) - { - m_buffer.push_range(buffer, buffer + length); - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\""); - return *this; - } - void popElement(const char* name) - { - } -}; - -class ToolXMLConstructor : public XMLElementParser -{ - StringBuffer m_buffer; - Tool& m_tool; - ConditionalXMLConstructor* m_conditional; -public: - ToolXMLConstructor(Tool& tool) : m_tool(tool) - { - } - ~ToolXMLConstructor() - { - flush(); - } - std::size_t write(const char* buffer, std::size_t length) - { - m_buffer.push_range(buffer, buffer + length); - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - if(string_equal(element.name(), "cond")) - { - flush(); - Conditional* conditional = new Conditional(new VariableString(element.attribute("value"))); - m_tool.push_back(conditional); - m_conditional = new ConditionalXMLConstructor(*conditional); - return *m_conditional; - } - else - { - ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\""); - return *this; - } - } - void popElement(const char* name) - { - if(string_equal(name, "cond")) - { - delete m_conditional; - } - } - - void flush() - { - if(!m_buffer.empty()) - { - m_tool.push_back(new VariableString(m_buffer.c_str())); - m_buffer.clear(); - } - } -}; - -typedef VariableString BuildCommand; -typedef std::list Build; - -class BuildXMLConstructor : public XMLElementParser -{ - VariableStringXMLConstructor* m_variableString; - Build& m_build; -public: - BuildXMLConstructor(Build& build) : m_build(build) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - if(string_equal(element.name(), "command")) - { - m_build.push_back(BuildCommand()); - m_variableString = new VariableStringXMLConstructor(m_build.back()); - return *m_variableString; - } - else - { - ERROR_MESSAGE("parse error: invalid element"); - return *this; - } - } - void popElement(const char* name) - { - delete m_variableString; - } -}; - -typedef std::pair BuildPair; - -class BuildPairEqual -{ - const char* m_name; -public: - BuildPairEqual(const char* name) : m_name(name) - { - } - bool operator()(const BuildPair& self) const - { - return string_equal(self.first.c_str(), m_name); - } -}; - -typedef std::list Project; - -Project::iterator Project_find(Project& project, const char* name) -{ - return std::find_if(project.begin(), project.end(), BuildPairEqual(name)); -} - -Project::iterator Project_find(Project& project, std::size_t index) -{ - Project::iterator i = project.begin(); - while(index-- != 0 && i != project.end()) - { - ++i; - } - return i; -} - -Build& project_find(Project& project, const char* build) -{ - Project::iterator i = Project_find(project, build); - ASSERT_MESSAGE(i != project.end(), "error finding build command"); - return (*i).second; -} - -Build::iterator Build_find(Build& build, std::size_t index) -{ - Build::iterator i = build.begin(); - while(index-- != 0 && i != build.end()) - { - ++i; - } - return i; -} - -typedef std::map Tools; - -class ProjectXMLConstructor : public XMLElementParser -{ - ToolXMLConstructor* m_tool; - BuildXMLConstructor* m_build; - Project& m_project; - Tools& m_tools; -public: - ProjectXMLConstructor(Project& project, Tools& tools) : m_project(project), m_tools(tools) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - if(string_equal(element.name(), "var")) - { - Tools::iterator i = m_tools.insert(Tools::value_type(element.attribute("name"), Tool())).first; - m_tool = new ToolXMLConstructor((*i).second); - return *m_tool; - } - else if(string_equal(element.name(), "build")) - { - m_project.push_back(Project::value_type(element.attribute("name"), Build())); - m_build = new BuildXMLConstructor(m_project.back().second); - return *m_build; - } - else - { - ERROR_MESSAGE("parse error: invalid element"); - return *this; - } - } - void popElement(const char* name) - { - if(string_equal(name, "var")) - { - delete m_tool; - } - else if(string_equal(name, "build")) - { - delete m_build; - } - } -}; - -class SkipAllParser : public XMLElementParser -{ -public: - std::size_t write(const char* buffer, std::size_t length) - { - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - return *this; - } - void popElement(const char* name) - { - } -}; - -class RootXMLConstructor : public XMLElementParser -{ - CopiedString m_elementName; - XMLElementParser& m_parser; - SkipAllParser m_skip; - Version m_version; - bool m_compatible; -public: - RootXMLConstructor(const char* elementName, XMLElementParser& parser, const char* version) : - m_elementName(elementName), - m_parser(parser), - m_version(version_parse(version)), - m_compatible(false) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - return length; - } - XMLElementParser& pushElement(const XMLElement& element) - { - if(string_equal(element.name(), m_elementName.c_str())) - { - Version dataVersion(version_parse(element.attribute("version"))); - if(version_compatible(m_version, dataVersion)) - { - m_compatible = true; - return m_parser; - } - else - { - return m_skip; - } - } - else - { - //ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\""); - return *this; - } - } - void popElement(const char* name) - { - } - - bool versionCompatible() const - { - return m_compatible; - } -}; - -namespace -{ - Project g_build_project; - Tools g_build_tools; - bool g_build_changed = false; -} - -void build_error_undefined_tool(const char* build, const char* tool) -{ - globalErrorStream() << "build " << makeQuoted(build) << " refers to undefined tool " << makeQuoted(tool) << '\n'; -} - -void project_verify(Project& project, Tools& tools) -{ -#if 0 - for(Project::iterator i = project.begin(); i != project.end(); ++i) - { - Build& build = (*i).second; - for(Build::iterator j = build.begin(); j != build.end(); ++j) - { - Tools::iterator k = tools.find((*j).first); - if(k == g_build_tools.end()) - { - build_error_undefined_tool((*i).first.c_str(), (*j).first.c_str()); - } - } - } -#endif -} - -void build_run(const char* name, CommandListener& listener) -{ - for(Tools::iterator i = g_build_tools.begin(); i != g_build_tools.end(); ++i) - { - StringBuffer output; - (*i).second.evaluate(output); - build_set_variable((*i).first.c_str(), output.c_str()); - } - - { - Project::iterator i = Project_find(g_build_project, name); - if(i != g_build_project.end()) - { - Build& build = (*i).second; - for(Build::iterator j = build.begin(); j != build.end(); ++j) - { - StringBuffer output; - (*j).evaluate(output); - listener.execute(output.c_str()); - } - } - else - { - globalErrorStream() << "build " << makeQuoted(name) << " not defined"; - } - } -} - - -typedef std::vector XMLElementStack; - -class XMLParser : public XMLImporter -{ - XMLElementStack m_stack; -public: - XMLParser(XMLElementParser& parser) - { - m_stack.push_back(&parser); - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_stack.back()->write(buffer, length); - } - void pushElement(const XMLElement& element) - { - m_stack.push_back(&m_stack.back()->pushElement(element)); - } - void popElement(const char* name) - { - m_stack.pop_back(); - m_stack.back()->popElement(name); - } -}; - -#include "stream/textfilestream.h" -#include "xml/xmlparser.h" - -const char* const BUILDMENU_VERSION = "2.0"; - -bool build_commands_parse(const char* filename) -{ - TextFileInputStream projectFile(filename); - if(!projectFile.failed()) - { - ProjectXMLConstructor projectConstructor(g_build_project, g_build_tools); - RootXMLConstructor rootConstructor("project", projectConstructor, BUILDMENU_VERSION); - XMLParser importer(rootConstructor); - XMLStreamParser parser(projectFile); - parser.exportXML(importer); - - if(rootConstructor.versionCompatible()) - { - project_verify(g_build_project, g_build_tools); - - return true; - } - globalErrorStream() << "failed to parse build menu: " << makeQuoted(filename) << "\n"; - } - return false; -} - -void build_commands_clear() -{ - g_build_project.clear(); - g_build_tools.clear(); -} - -class BuildXMLExporter -{ - Build& m_build; -public: - BuildXMLExporter(Build& build) : m_build(build) - { - } - void exportXML(XMLImporter& importer) - { - importer << "\n"; - for(Build::iterator i = m_build.begin(); i != m_build.end(); ++i) - { - StaticElement commandElement("command"); - importer.pushElement(commandElement); - (*i).exportXML(importer); - importer.popElement(commandElement.name()); - importer << "\n"; - } - } -}; - -class ProjectXMLExporter -{ - Project& m_project; - Tools& m_tools; -public: - ProjectXMLExporter(Project& project, Tools& tools) : m_project(project), m_tools(tools) - { - } - void exportXML(XMLImporter& importer) - { - StaticElement projectElement("project"); - projectElement.insertAttribute("version", BUILDMENU_VERSION); - importer.pushElement(projectElement); - importer << "\n"; - - for(Tools::iterator i = m_tools.begin(); i != m_tools.end(); ++i) - { - StaticElement toolElement("var"); - toolElement.insertAttribute("name", (*i).first.c_str()); - importer.pushElement(toolElement); - (*i).second.exportXML(importer); - importer.popElement(toolElement.name()); - importer << "\n"; - } - for(Project::iterator i = m_project.begin(); i != m_project.end(); ++i) - { - StaticElement buildElement("build"); - buildElement.insertAttribute("name", (*i).first.c_str()); - importer.pushElement(buildElement); - BuildXMLExporter buildExporter((*i).second); - buildExporter.exportXML(importer); - importer.popElement(buildElement.name()); - importer << "\n"; - } - importer.popElement(projectElement.name()); - } -}; - -#include "xml/xmlwriter.h" - -void build_commands_write(const char* filename) -{ - TextFileOutputStream projectFile(filename); - if(!projectFile.failed()) - { - XMLStreamWriter writer(projectFile); - ProjectXMLExporter projectExporter(g_build_project, g_build_tools); - writer << "\n"; - projectExporter.exportXML(writer); - writer << "\n"; - } -} - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtkutil/dialog.h" -#include "gtkutil/closure.h" -#include "gtkutil/window.h" -#include "gtkdlgs.h" - -void Build_refreshMenu(GtkMenu* menu); - - -void BSPCommandList_Construct(GtkListStore* store, Project& project) -{ - gtk_list_store_clear(store); - - for(Project::iterator i = project.begin(); i != project.end(); ++i) - { - const char* buildName = (*i).first.c_str(); - - GtkTreeIter buildIter; - gtk_list_store_append(store, &buildIter); - gtk_list_store_set(store, &buildIter, 0, const_cast(buildName), -1); - } - - GtkTreeIter lastIter; - gtk_list_store_append(store, &lastIter); -} - -class ProjectList -{ -public: - Project& m_project; - GtkListStore* m_store; - bool m_changed; - ProjectList(Project& project) : m_project(project), m_changed(false) - { - } -}; - -gboolean project_cell_edited(GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ProjectList* projectList) -{ - Project& project = projectList->m_project; - - GtkTreePath* path = gtk_tree_path_new_from_string(path_string); - - ASSERT_MESSAGE(gtk_tree_path_get_depth(path) == 1, "invalid path length"); - - GtkTreeIter iter; - gtk_tree_model_get_iter(GTK_TREE_MODEL(projectList->m_store), &iter, path); - - Project::iterator i = Project_find(project, gtk_tree_path_get_indices(path)[0]); - if(i != project.end()) - { - projectList->m_changed = true; - if(string_empty(new_text)) - { - project.erase(i); - Build_refreshMenu(g_bsp_menu); - - gtk_list_store_remove(projectList->m_store, &iter); - } - else - { - (*i).first = new_text; - Build_refreshMenu(g_bsp_menu); - - gtk_list_store_set(projectList->m_store, &iter, 0, new_text, -1); - } - } - else if(!string_empty(new_text)) - { - projectList->m_changed = true; - project.push_back(Project::value_type(new_text, Build())); - Build_refreshMenu(g_bsp_menu); - - gtk_list_store_set(projectList->m_store, &iter, 0, new_text, -1); - GtkTreeIter lastIter; - gtk_list_store_append(projectList->m_store, &lastIter); - } - - gtk_tree_path_free(path); - - return FALSE; -} - -gboolean project_key_press(GtkWidget* widget, GdkEventKey* event, ProjectList* projectList) -{ - Project& project = projectList->m_project; - - if(event->keyval == GDK_Delete) - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); - GtkTreeIter iter; - GtkTreeModel* model; - if(gtk_tree_selection_get_selected(selection, &model, &iter)) - { - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - Project::iterator x = Project_find(project, gtk_tree_path_get_indices(path)[0]); - gtk_tree_path_free(path); - - if(x != project.end()) - { - projectList->m_changed = true; - project.erase(x); - Build_refreshMenu(g_bsp_menu); - - gtk_list_store_remove(projectList->m_store, &iter); - } - } - } - return FALSE; -} - - -Build* g_current_build = 0; - -gboolean project_selection_changed(GtkTreeSelection* selection, GtkListStore* store) -{ - Project& project = g_build_project; - - gtk_list_store_clear(store); - - GtkTreeIter iter; - GtkTreeModel* model; - if(gtk_tree_selection_get_selected(selection, &model, &iter)) - { - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - Project::iterator x = Project_find(project, gtk_tree_path_get_indices(path)[0]); - gtk_tree_path_free(path); - - if(x != project.end()) - { - Build& build = (*x).second; - g_current_build = &build; - - for(Build::iterator i = build.begin(); i != build.end(); ++i) - { - GtkTreeIter commandIter; - gtk_list_store_append(store, &commandIter); - gtk_list_store_set(store, &commandIter, 0, const_cast((*i).c_str()), -1); - } - GtkTreeIter lastIter; - gtk_list_store_append(store, &lastIter); - } - else - { - g_current_build = 0; - } - } - else - { - g_current_build = 0; - } - - return FALSE; -} - -gboolean commands_cell_edited(GtkCellRendererText* cell, gchar* path_string, gchar* new_text, GtkListStore* store) -{ - if(g_current_build == 0) - { - return FALSE; - } - Build& build = *g_current_build; - - GtkTreePath* path = gtk_tree_path_new_from_string(path_string); - - ASSERT_MESSAGE(gtk_tree_path_get_depth(path) == 1, "invalid path length"); - - GtkTreeIter iter; - gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, path); - - Build::iterator i = Build_find(build, gtk_tree_path_get_indices(path)[0]); - if(i != build.end()) - { - g_build_changed = true; - (*i).setString(new_text); - - gtk_list_store_set(store, &iter, 0, new_text, -1); - } - else if(!string_empty(new_text)) - { - g_build_changed = true; - build.push_back(Build::value_type(VariableString(new_text))); - - gtk_list_store_set(store, &iter, 0, new_text, -1); - - GtkTreeIter lastIter; - gtk_list_store_append(store, &lastIter); - } - - gtk_tree_path_free(path); - - return FALSE; -} - -gboolean commands_key_press(GtkWidget* widget, GdkEventKey* event, GtkListStore* store) -{ - if(g_current_build == 0) - { - return FALSE; - } - Build& build = *g_current_build; - - if(event->keyval == GDK_Delete) - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); - GtkTreeIter iter; - GtkTreeModel* model; - if(gtk_tree_selection_get_selected(selection, &model, &iter)) - { - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - Build::iterator i = Build_find(build, gtk_tree_path_get_indices(path)[0]); - gtk_tree_path_free(path); - - if(i != build.end()) - { - g_build_changed = true; - build.erase(i); - - gtk_list_store_remove(store, &iter); - } - } - } - return FALSE; -} - - -GtkWindow* BuildMenuDialog_construct(ModalDialog& modal, ProjectList& projectList) -{ - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Build Menu", G_CALLBACK(dialog_delete_callback), &modal, -1, 400); - - GtkWidget* buildView = 0; - - { - GtkTable* table1 = create_dialog_table(2, 2, 4, 4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(table1)); - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_table_attach(table1, GTK_WIDGET(vbox), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &modal); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &modal); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - } - { - GtkFrame* frame = create_dialog_frame("Build menu"); - gtk_table_attach(table1, GTK_WIDGET(frame), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - { - GtkScrolledWindow* scr = create_scrolled_window(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(scr)); - - { - GtkListStore* store = gtk_list_store_new(1, G_TYPE_STRING); - - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - object_set_boolean_property(G_OBJECT(renderer), "editable", TRUE); - g_signal_connect(renderer, "edited", G_CALLBACK(project_cell_edited), &projectList); - - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - - GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); - gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE); - - gtk_widget_show(view); - - buildView = view; - projectList.m_store = store; - gtk_container_add(GTK_CONTAINER (scr), view); - - g_signal_connect(G_OBJECT(view), "key_press_event", G_CALLBACK(project_key_press), &projectList); - - g_object_unref(G_OBJECT(store)); - } - } - } - { - GtkFrame* frame = create_dialog_frame("Commandline"); - gtk_table_attach(table1, GTK_WIDGET(frame), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - { - GtkScrolledWindow* scr = create_scrolled_window(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(scr)); - - { - GtkListStore* store = gtk_list_store_new(1, G_TYPE_STRING); - - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - object_set_boolean_property(G_OBJECT(renderer), "editable", TRUE); - g_signal_connect(renderer, "edited", G_CALLBACK(commands_cell_edited), store); - - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - - GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); - gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE); - - gtk_widget_show(view); - - gtk_container_add(GTK_CONTAINER (scr), view); - - g_object_unref(G_OBJECT(store)); - - g_signal_connect(G_OBJECT(view), "key_press_event", G_CALLBACK(commands_key_press), store); - - g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(buildView))), "changed", G_CALLBACK(project_selection_changed), store); - } - } - } - } - - BSPCommandList_Construct(projectList.m_store, g_build_project); - - return window; -} - -namespace -{ - CopiedString g_buildMenu; -} - -void LoadBuildMenu(); - -void DoBuildMenu() -{ - ModalDialog modal; - - ProjectList projectList(g_build_project); - - GtkWindow* window = BuildMenuDialog_construct(modal, projectList); - - if(modal_dialog_show(window, modal) == eIDCANCEL) - { - build_commands_clear(); - LoadBuildMenu(); - - Build_refreshMenu(g_bsp_menu); - } - else if(projectList.m_changed) - { - g_build_changed = true; - } - - gtk_widget_destroy(GTK_WIDGET(window)); -} - - - -#include "gtkutil/menu.h" -#include "mainframe.h" -#include "preferences.h" -#include "qe3.h" - -typedef struct _GtkMenuItem GtkMenuItem; - -class BuildMenuItem -{ - const char* m_name; -public: - GtkMenuItem* m_item; - BuildMenuItem(const char* name, GtkMenuItem* item) - : m_name(name), m_item(item) - { - } - void run() - { - RunBSP(m_name); - } - typedef MemberCaller RunCaller; -}; - -typedef std::list BuildMenuItems; -BuildMenuItems g_BuildMenuItems; - - -GtkMenu* g_bsp_menu; - -void Build_constructMenu(GtkMenu* menu) -{ - for(Project::iterator i = g_build_project.begin(); i != g_build_project.end(); ++i) - { - g_BuildMenuItems.push_back(BuildMenuItem((*i).first.c_str(), 0)); - g_BuildMenuItems.back().m_item = create_menu_item_with_mnemonic(menu, (*i).first.c_str(), BuildMenuItem::RunCaller(g_BuildMenuItems.back())); - } -} - - -void Build_refreshMenu(GtkMenu* menu) -{ - for(BuildMenuItems::iterator i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i) - { - gtk_container_remove(GTK_CONTAINER(menu), GTK_WIDGET((*i).m_item)); - } - - g_BuildMenuItems.clear(); - - Build_constructMenu(menu); -} - - -void LoadBuildMenu() -{ - if(string_empty(g_buildMenu.c_str()) || !build_commands_parse(g_buildMenu.c_str())) - { - { - StringOutputStream buffer(256); - buffer << GameToolsPath_get() << "default_build_menu.xml"; - - bool success = build_commands_parse(buffer.c_str()); - ASSERT_MESSAGE(success, "failed to parse default build commands: " << buffer.c_str()); - } - { - StringOutputStream buffer(256); - buffer << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/build_menu.xml"; - - g_buildMenu = buffer.c_str(); - } - } -} - -void SaveBuildMenu() -{ - if(g_build_changed) - { - g_build_changed = false; - build_commands_write(g_buildMenu.c_str()); - } -} - -#include "preferencesystem.h" -#include "stringio.h" - -void BuildMenu_Construct() -{ - GlobalPreferenceSystem().registerPreference("BuildMenu", CopiedStringImportStringCaller(g_buildMenu), CopiedStringExportStringCaller(g_buildMenu)); - LoadBuildMenu(); -} -void BuildMenu_Destroy() -{ - SaveBuildMenu(); -} diff --git a/radiant/build.h b/radiant/build.h deleted file mode 100644 index 3b3244d7..00000000 --- a/radiant/build.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#if !defined(INCLUDED_BUILD_H) -#define INCLUDED_BUILD_H - -void build_set_variable(const char* name, const char* value); -void build_clear_variables(); - -class CommandListener -{ -public: - virtual void execute(const char* command) = 0; -}; -void build_run(const char* name, CommandListener& listener); - -void DoBuildMenu(); - -void BuildMenu_Construct(); -void BuildMenu_Destroy(); - -typedef struct _GtkMenu GtkMenu; -void Build_constructMenu(GtkMenu* menu); -extern GtkMenu* g_bsp_menu; - - -#endif diff --git a/radiant/camera.h b/radiant/camera.h new file mode 100644 index 00000000..57a9fae2 --- /dev/null +++ b/radiant/camera.h @@ -0,0 +1,83 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// window system independent camera view code + +typedef enum +{ + cd_wire, + cd_solid, + cd_texture, + cd_light, +// cd_blend +} camera_draw_mode; + +#define DRAW_GL_FILL 0x0001 +#define DRAW_GL_LIGHTING 0x0010 +#define DRAW_GL_TEXTURE_2D 0x0100 +#define DRAW_GL_BLEND 0x1000 + +#define DRAW_GL_WIRE 0x0000 +#define DRAW_GL_FLAT 0x0001 +#define DRAW_GL_SOLID 0x0011 +#define DRAW_GL_TEXTURED 0x0111 + +#define DRAW_WIRE 0 +#define DRAW_SOLID 1 +#define DRAW_TEXTURED 2 + +// TTimo: camera code is a huge mess +// someone courageous should clean it up +// this will probably happen when we have new rendering code + +#define MOVE_FORWARD 0x001 +#define MOVE_BACK 0x002 +#define MOVE_ROTRIGHT 0x004 +#define MOVE_ROTLEFT 0x008 +#define MOVE_STRAFERIGHT 0x010 +#define MOVE_STRAFELEFT 0x020 + +typedef struct +{ + int width, height; + + qboolean timing; + + vec3_t origin; + // TTimo + // indexes: PITCH = 0 YAW = 1 ROLL = 3 + // AFAIK in Radiant we always have ROLL=0 + vec3_t angles; + + camera_draw_mode draw_mode; + int draw_glstate; + + vec3_t color; // background + + vec3_t forward, right; // move matrix (TTimo: used to have up but it was not updated) + vec3_t vup, vpn, vright; // view matrix (taken from the GL_PROJECTION matrix) + + float projection[4][4]; + float modelview[4][4]; + + unsigned int movementflags; // movement flags + +} camera_t; diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 0c054b43..85cdccc6 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,1486 +25,1236 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "camwindow.h" +#include "stdafx.h" +#include +#include -#include "debugging/debugging.h" +extern void DrawPathLines(); +extern void Select_ShiftTexture(int x, int y); +extern void Select_RotateTexture(int amt); +extern void DrawAlternatePoint(vec3_t v, float scale); +//extern void Select_ScaleTexture(int x, int y); -#include "iscenegraph.h" -#include "irender.h" -#include "igl.h" -#include "icamera.h" -#include "cullable.h" -#include "renderable.h" -#include "preferencesystem.h" - -#include "signal/signal.h" -#include "container/array.h" -#include "scenelib.h" -#include "render.h" -#include "cmdlib.h" -#include "math/frustum.h" - -#include "gtkutil/widget.h" -#include "gtkutil/button.h" -#include "gtkutil/toolbar.h" -#include "gtkutil/glwidget.h" -#include "gtkutil/xorrectangle.h" -#include "gtkmisc.h" -#include "selection.h" -#include "mainframe.h" -#include "preferences.h" -#include "commands.h" -#include "xywindow.h" -#include "windowobservers.h" -#include "renderstate.h" - -#include "timer.h" - -Signal0 g_cameraMoved_callbacks; - -void AddCameraMovedCallback(const SignalHandler& handler) -{ - g_cameraMoved_callbacks.connectLast(handler); -} - -void CameraMovedNotify() -{ - g_cameraMoved_callbacks(); -} - - -struct camwindow_globals_private_t -{ - int m_nMoveSpeed; - bool m_bCamLinkSpeed; - int m_nAngleSpeed; - bool m_bCamInverseMouse; - bool m_bCamDiscrete; - bool m_bCubicClipping; - bool m_showStats; - - camwindow_globals_private_t() : - m_nMoveSpeed(100), - m_bCamLinkSpeed(true), - m_nAngleSpeed(3), - m_bCamInverseMouse(false), - m_bCamDiscrete(true), - m_bCubicClipping(true), - m_showStats(true) - { - } - -}; - -camwindow_globals_private_t g_camwindow_globals_private; - - -const Matrix4 g_opengl2radiant( - 0, 0,-1, 0, - -1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 0, 1 -); - -const Matrix4 g_radiant2opengl( - 0,-1, 0, 0, - 0, 0, 1, 0, - -1, 0, 0, 0, - 0, 0, 0, 1 -); - -struct camera_t; -void Camera_mouseMove(camera_t& camera, int x, int y); - -enum camera_draw_mode -{ - cd_wire, - cd_solid, - cd_texture, - cd_lighting -}; - -struct camera_t -{ - int width, height; - - bool timing; - - Vector3 origin; - Vector3 angles; - - Vector3 color; // background - - Vector3 forward, right; // move matrix (TTimo: used to have up but it was not updated) - Vector3 vup, vpn, vright; // view matrix (taken from the modelview matrix) - - Matrix4 projection; - Matrix4 modelview; - - bool m_strafe; // true when in strafemode toggled by the ctrl-key - bool m_strafe_forward; // true when in strafemode by ctrl-key and shift is pressed for forward strafing - - unsigned int movementflags; // movement flags - Timer m_keycontrol_timer; - guint m_keymove_handler; - - - float fieldOfView; - - DeferredMotionDelta m_mouseMove; - - static void motionDelta(int x, int y, void* data) - { - Camera_mouseMove(*reinterpret_cast(data), x, y); - } - - View* m_view; - Callback m_update; - - static camera_draw_mode draw_mode; - - camera_t(View* view, const Callback& update) - : width(0), - height(0), - timing(false), - origin(0, 0, 0), - angles(0, 0, 0), - color(0, 0, 0), - movementflags(0), - m_keymove_handler(0), - fieldOfView(90.0f), - m_mouseMove(motionDelta, this), - m_view(view), - m_update(update) - { - } -}; - -camera_draw_mode camera_t::draw_mode = cd_texture; - -inline Matrix4 projection_for_camera(float near_z, float far_z, float fieldOfView, int width, int height) -{ - const float half_width = static_cast(near_z * tan(degrees_to_radians(fieldOfView * 0.5))); - const float half_height = half_width * (static_cast(height) / static_cast(width)); - - return matrix4_frustum( - -half_width, - half_width, - -half_height, - half_height, - near_z, - far_z - ); -} - -float Camera_getFarClipPlane(camera_t& camera) -{ - return (g_camwindow_globals_private.m_bCubicClipping)? pow(2.0, (g_camwindow_globals.m_nCubicScale + 7) / 2.0) : 32768.0f; -} - -void Camera_updateProjection(camera_t& camera) -{ - float farClip = Camera_getFarClipPlane(camera); - camera.projection = projection_for_camera(farClip / 4096.0f, farClip, camera.fieldOfView, camera.width, camera.height); - - camera.m_view->Construct(camera.projection, camera.modelview, camera.width, camera.height); -} - -void Camera_updateVectors(camera_t& camera) -{ - for (int i=0 ; i<3 ; i++) - { - camera.vright[i] = camera.modelview[(i<<2)+0]; - camera.vup[i] = camera.modelview[(i<<2)+1]; - camera.vpn[i] = camera.modelview[(i<<2)+2]; - } -} - -void Camera_updateModelview(camera_t& camera) -{ - camera.modelview = g_matrix4_identity; - - // roll, pitch, yaw - Vector3 radiant_eulerXYZ(0, -camera.angles[CAMERA_PITCH], camera.angles[CAMERA_YAW]); - - matrix4_translate_by_vec3(camera.modelview, camera.origin); - matrix4_rotate_by_euler_xyz_degrees(camera.modelview, radiant_eulerXYZ); - matrix4_multiply_by_matrix4(camera.modelview, g_radiant2opengl); - matrix4_affine_invert(camera.modelview); - - Camera_updateVectors(camera); - - camera.m_view->Construct(camera.projection, camera.modelview, camera.width, camera.height); -} - - -void Camera_Move_updateAxes(camera_t& camera) -{ - double ya = degrees_to_radians(camera.angles[CAMERA_YAW]); - - // the movement matrix is kept 2d - camera.forward[0] = static_cast(cos(ya)); - camera.forward[1] = static_cast(sin(ya)); - camera.forward[2] = 0; - camera.right[0] = camera.forward[1]; - camera.right[1] = -camera.forward[0]; -} - -void Camera_Freemove_updateAxes(camera_t& camera) -{ - camera.right = camera.vright; - camera.forward = vector3_negated(camera.vpn); -} - -const Vector3& Camera_getOrigin(camera_t& camera) -{ - return camera.origin; -} - -void Camera_setOrigin(camera_t& camera, const Vector3& origin) -{ - camera.origin = origin; - Camera_updateModelview(camera); - camera.m_update(); - CameraMovedNotify(); -} - -const Vector3& Camera_getAngles(camera_t& camera) -{ - return camera.angles; -} - -void Camera_setAngles(camera_t& camera, const Vector3& angles) -{ - camera.angles = angles; - Camera_updateModelview(camera); - camera.m_update(); - CameraMovedNotify(); -} - - -void Camera_FreeMove(camera_t& camera, int dx, int dy) -{ - // free strafe mode, toggled by the ctrl key with optional shift for forward movement - if(camera.m_strafe) - { - float strafespeed = 0.65f; - - if(g_camwindow_globals_private.m_bCamLinkSpeed) - { - strafespeed = (float)g_camwindow_globals_private.m_nMoveSpeed / 100; - } - - camera.origin -= camera.vright * strafespeed * dx; - if(camera.m_strafe_forward) - camera.origin += camera.vpn * strafespeed * dy; - else - camera.origin += camera.vup * strafespeed * dy; - } - else// free rotation - { - const float dtime = 0.1f; - - if (g_camwindow_globals_private.m_bCamInverseMouse) - camera.angles[CAMERA_PITCH] -= dy * dtime * g_camwindow_globals_private.m_nAngleSpeed; - else - camera.angles[CAMERA_PITCH] += dy * dtime * g_camwindow_globals_private.m_nAngleSpeed; - - camera.angles[CAMERA_YAW] += dx * dtime * g_camwindow_globals_private.m_nAngleSpeed; - - if (camera.angles[CAMERA_PITCH] > 90) - camera.angles[CAMERA_PITCH] = 90; - else if (camera.angles[CAMERA_PITCH] < -90) - camera.angles[CAMERA_PITCH] = -90; - - if (camera.angles[CAMERA_YAW] >= 360) - camera.angles[CAMERA_YAW] -=360; - else if (camera.angles[CAMERA_YAW] <= 0) - camera.angles[CAMERA_YAW] +=360; - } - - Camera_updateModelview(camera); - Camera_Freemove_updateAxes(camera); -} - -void Cam_MouseControl(camera_t& camera, int x, int y) -{ - int xl, xh; - int yl, yh; - float xf, yf; - - xf = (float)(x - camera.width/2) / (camera.width/2); - yf = (float)(y - camera.height/2) / (camera.height/2); - - xl = camera.width/3; - xh = xl*2; - yl = camera.height/3; - yh = yl*2; - - xf *= 1.0f - fabsf(yf); - if (xf < 0) - { - xf += 0.1f; - if (xf > 0) - xf = 0; - } - else - { - xf -= 0.1f; - if (xf < 0) - xf = 0; - } - - vector3_add(camera.origin, vector3_scaled(camera.forward, yf * 0.1f* g_camwindow_globals_private.m_nMoveSpeed)); - camera.angles[CAMERA_YAW] += xf * -0.1f * g_camwindow_globals_private.m_nAngleSpeed; - - Camera_updateModelview(camera); -} - -void Camera_mouseMove(camera_t& camera, int x, int y) -{ - //globalOutputStream() << "mousemove... "; - Camera_FreeMove(camera, -x, -y); - camera.m_update(); - CameraMovedNotify(); -} - -const unsigned int MOVE_NONE = 0; -const unsigned int MOVE_FORWARD = 1 << 0; -const unsigned int MOVE_BACK = 1 << 1; -const unsigned int MOVE_ROTRIGHT = 1 << 2; -const unsigned int MOVE_ROTLEFT = 1 << 3; -const unsigned int MOVE_STRAFERIGHT = 1 << 4; -const unsigned int MOVE_STRAFELEFT = 1 << 5; -const unsigned int MOVE_UP = 1 << 6; -const unsigned int MOVE_DOWN = 1 << 7; -const unsigned int MOVE_PITCHUP = 1 << 8; -const unsigned int MOVE_PITCHDOWN = 1 << 9; -const unsigned int MOVE_ALL = MOVE_FORWARD|MOVE_BACK|MOVE_ROTRIGHT|MOVE_ROTLEFT|MOVE_STRAFERIGHT|MOVE_STRAFELEFT|MOVE_UP|MOVE_DOWN|MOVE_PITCHUP|MOVE_PITCHDOWN; - -void Cam_KeyControl(camera_t& camera, float dtime) -{ - // Update angles - if (camera.movementflags & MOVE_ROTLEFT) - camera.angles[CAMERA_YAW] += 15 * dtime* g_camwindow_globals_private.m_nAngleSpeed; - if (camera.movementflags & MOVE_ROTRIGHT) - camera.angles[CAMERA_YAW] -= 15 * dtime * g_camwindow_globals_private.m_nAngleSpeed; - if (camera.movementflags & MOVE_PITCHUP) - { - camera.angles[CAMERA_PITCH] += 15 * dtime* g_camwindow_globals_private.m_nAngleSpeed; - if(camera.angles[CAMERA_PITCH] > 90) - camera.angles[CAMERA_PITCH] = 90; - } - if (camera.movementflags & MOVE_PITCHDOWN) - { - camera.angles[CAMERA_PITCH] -= 15 * dtime * g_camwindow_globals_private.m_nAngleSpeed; - if(camera.angles[CAMERA_PITCH] < -90) - camera.angles[CAMERA_PITCH] = -90; - } - - Camera_updateModelview(camera); - Camera_Freemove_updateAxes(camera); - - // Update position - if (camera.movementflags & MOVE_FORWARD) - vector3_add(camera.origin, vector3_scaled(camera.forward, dtime * g_camwindow_globals_private.m_nMoveSpeed)); - if (camera.movementflags & MOVE_BACK) - vector3_add(camera.origin, vector3_scaled(camera.forward, -dtime * g_camwindow_globals_private.m_nMoveSpeed)); - if (camera.movementflags & MOVE_STRAFELEFT) - vector3_add(camera.origin, vector3_scaled(camera.right, -dtime * g_camwindow_globals_private.m_nMoveSpeed)); - if (camera.movementflags & MOVE_STRAFERIGHT) - vector3_add(camera.origin, vector3_scaled(camera.right, dtime * g_camwindow_globals_private.m_nMoveSpeed)); - if (camera.movementflags & MOVE_UP) - vector3_add(camera.origin, vector3_scaled(g_vector3_axis_z, dtime * g_camwindow_globals_private.m_nMoveSpeed)); - if (camera.movementflags & MOVE_DOWN) - vector3_add(camera.origin, vector3_scaled(g_vector3_axis_z, -dtime * g_camwindow_globals_private.m_nMoveSpeed)); - - Camera_updateModelview(camera); -} - -void Camera_keyMove(camera_t& camera) -{ - camera.m_mouseMove.flush(); - - //globalOutputStream() << "keymove... "; - float time_seconds = camera.m_keycontrol_timer.elapsed_msec() / static_cast(msec_per_sec); - camera.m_keycontrol_timer.start(); - if(time_seconds > 0.05f) - { - time_seconds = 0.05f; // 20fps - } - Cam_KeyControl(camera, time_seconds * 5.0f); - - camera.m_update(); - CameraMovedNotify(); -} - -gboolean camera_keymove(gpointer data) -{ - Camera_keyMove(*reinterpret_cast(data)); - return TRUE; -} - -void Camera_setMovementFlags(camera_t& camera, unsigned int mask) -{ - if((~camera.movementflags & mask) != 0 && camera.movementflags == 0) - { - camera.m_keymove_handler = g_idle_add(camera_keymove, &camera); - } - camera.movementflags |= mask; -} -void Camera_clearMovementFlags(camera_t& camera, unsigned int mask) -{ - if((camera.movementflags & ~mask) == 0 && camera.movementflags != 0) - { - g_source_remove(camera.m_keymove_handler); - camera.m_keymove_handler = 0; - } - camera.movementflags &= ~mask; -} - -void Camera_MoveForward_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_FORWARD); -} -void Camera_MoveForward_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_FORWARD); -} -void Camera_MoveBack_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_BACK); -} -void Camera_MoveBack_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_BACK); -} - -void Camera_MoveLeft_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_STRAFELEFT); -} -void Camera_MoveLeft_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_STRAFELEFT); -} -void Camera_MoveRight_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_STRAFERIGHT); -} -void Camera_MoveRight_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_STRAFERIGHT); -} - -void Camera_MoveUp_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_UP); -} -void Camera_MoveUp_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_UP); -} -void Camera_MoveDown_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_DOWN); -} -void Camera_MoveDown_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_DOWN); -} - -void Camera_RotateLeft_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_ROTLEFT); -} -void Camera_RotateLeft_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_ROTLEFT); -} -void Camera_RotateRight_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_ROTRIGHT); -} -void Camera_RotateRight_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_ROTRIGHT); -} - -void Camera_PitchUp_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_PITCHUP); -} -void Camera_PitchUp_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_PITCHUP); -} -void Camera_PitchDown_KeyDown(camera_t& camera) -{ - Camera_setMovementFlags(camera, MOVE_PITCHDOWN); -} -void Camera_PitchDown_KeyUp(camera_t& camera) -{ - Camera_clearMovementFlags(camera, MOVE_PITCHDOWN); -} - - -typedef ReferenceCaller FreeMoveCameraMoveForwardKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveForwardKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveBackKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveBackKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveLeftKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveLeftKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveRightKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveRightKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveUpKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveUpKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveDownKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveDownKeyUpCaller; - - -#define SPEED_MOVE 32 -#define SPEED_TURN 22.5 -#define MIN_CAM_SPEED 10 -#define MAX_CAM_SPEED 610 -#define CAM_SPEED_STEP 50 - -void Camera_MoveForward_Discrete(camera_t& camera) -{ - Camera_Move_updateAxes(camera); - Camera_setOrigin(camera, vector3_added(Camera_getOrigin(camera), vector3_scaled(camera.forward, SPEED_MOVE))); -} -void Camera_MoveBack_Discrete(camera_t& camera) -{ - Camera_Move_updateAxes(camera); - Camera_setOrigin(camera, vector3_added(Camera_getOrigin(camera), vector3_scaled(camera.forward, -SPEED_MOVE))); -} - -void Camera_MoveUp_Discrete(camera_t& camera) -{ - Vector3 origin(Camera_getOrigin(camera)); - origin[2] += SPEED_MOVE; - Camera_setOrigin(camera, origin); -} -void Camera_MoveDown_Discrete(camera_t& camera) -{ - Vector3 origin(Camera_getOrigin(camera)); - origin[2] -= SPEED_MOVE; - Camera_setOrigin(camera, origin); -} - -void Camera_MoveLeft_Discrete(camera_t& camera) -{ - Camera_Move_updateAxes(camera); - Camera_setOrigin(camera, vector3_added(Camera_getOrigin(camera), vector3_scaled(camera.right, -SPEED_MOVE))); -} -void Camera_MoveRight_Discrete(camera_t& camera) -{ - Camera_Move_updateAxes(camera); - Camera_setOrigin(camera, vector3_added(Camera_getOrigin(camera), vector3_scaled(camera.right, SPEED_MOVE))); -} - -void Camera_RotateLeft_Discrete(camera_t& camera) -{ - Vector3 angles(Camera_getAngles(camera)); - angles[CAMERA_YAW] += SPEED_TURN; - Camera_setAngles(camera, angles); -} -void Camera_RotateRight_Discrete(camera_t& camera) -{ - Vector3 angles(Camera_getAngles(camera)); - angles[CAMERA_YAW] -= SPEED_TURN; - Camera_setAngles(camera, angles); -} - -void Camera_PitchUp_Discrete(camera_t& camera) -{ - Vector3 angles(Camera_getAngles(camera)); - angles[CAMERA_PITCH] += SPEED_TURN; - if (angles[CAMERA_PITCH] > 90) - angles[CAMERA_PITCH] = 90; - Camera_setAngles(camera, angles); -} -void Camera_PitchDown_Discrete(camera_t& camera) -{ - Vector3 angles(Camera_getAngles(camera)); - angles[CAMERA_PITCH] -= SPEED_TURN; - if (angles[CAMERA_PITCH] < -90) - angles[CAMERA_PITCH] = -90; - Camera_setAngles(camera, angles); -} - - -class RadiantCameraView : public CameraView -{ - camera_t& m_camera; - View* m_view; - Callback m_update; -public: - RadiantCameraView(camera_t& camera, View* view, const Callback& update) : m_camera(camera), m_view(view), m_update(update) - { - } - void update() - { - m_view->Construct(m_camera.projection, m_camera.modelview, m_camera.width, m_camera.height); - m_update(); - } - void setModelview(const Matrix4& modelview) - { - m_camera.modelview = modelview; - matrix4_multiply_by_matrix4(m_camera.modelview, g_radiant2opengl); - matrix4_affine_invert(m_camera.modelview); - Camera_updateVectors(m_camera); - update(); - } - void setFieldOfView(float fieldOfView) - { - float farClip = Camera_getFarClipPlane(m_camera); - m_camera.projection = projection_for_camera(farClip / 4096.0f, farClip, fieldOfView, m_camera.width, m_camera.height); - update(); - } -}; - - -void Camera_motionDelta(int x, int y, unsigned int state, void* data) -{ - camera_t* cam = reinterpret_cast(data); - - cam->m_mouseMove.motion_delta(x, y, state); - cam->m_strafe = (state & GDK_CONTROL_MASK) != 0; - - if(cam->m_strafe) - cam->m_strafe_forward = (state & GDK_SHIFT_MASK) != 0; - else - cam->m_strafe_forward = false; -} - -class CamWnd -{ - View m_view; - camera_t m_Camera; - RadiantCameraView m_cameraview; -#if 0 - int m_PositionDragCursorX; - int m_PositionDragCursorY; -#endif - - guint m_freemove_handle_focusout; - - static Shader* m_state_select1; - static Shader* m_state_select2; - - FreezePointer m_freezePointer; - -public: - GtkWidget* m_gl_widget; - GtkWindow* m_parent; - - SelectionSystemWindowObserver* m_window_observer; - XORRectangle m_XORRectangle; - - DeferredDraw m_deferredDraw; - DeferredMotion m_deferred_motion; - - guint m_selection_button_press_handler; - guint m_selection_button_release_handler; - guint m_selection_motion_handler; - - guint m_freelook_button_press_handler; - - guint m_sizeHandler; - guint m_exposeHandler; - - CamWnd(); - ~CamWnd(); - - bool m_drawing; - void queue_draw() - { - //ASSERT_MESSAGE(!m_drawing, "CamWnd::queue_draw(): called while draw is already in progress"); - if(m_drawing) - { - return; - } - //globalOutputStream() << "queue... "; - m_deferredDraw.draw(); - } - void draw(); - - static void captureStates() - { - m_state_select1 = GlobalShaderCache().capture("$CAM_HIGHLIGHT"); - m_state_select2 = GlobalShaderCache().capture("$CAM_OVERLAY"); - } - static void releaseStates() - { - GlobalShaderCache().release("$CAM_HIGHLIGHT"); - GlobalShaderCache().release("$CAM_OVERLAY"); - } - - camera_t& getCamera() - { - return m_Camera; - }; - - void BenchMark(); - void Cam_ChangeFloor(bool up); - - void DisableFreeMove(); - void EnableFreeMove(); - bool m_bFreeMove; - - CameraView& getCameraView() - { - return m_cameraview; - } - -private: - void Cam_Draw(); -}; - -typedef MemberCaller CamWndQueueDraw; - -Shader* CamWnd::m_state_select1 = 0; -Shader* CamWnd::m_state_select2 = 0; - -CamWnd* NewCamWnd() -{ - return new CamWnd; -} -void DeleteCamWnd(CamWnd* camwnd) -{ - delete camwnd; -} - -void CamWnd_constructStatic() -{ - CamWnd::captureStates(); -} - -void CamWnd_destroyStatic() -{ - CamWnd::releaseStates(); -} - -static CamWnd* g_camwnd = 0; - -void GlobalCamera_setCamWnd(CamWnd& camwnd) -{ - g_camwnd = &camwnd; -} - - -GtkWidget* CamWnd_getWidget(CamWnd& camwnd) -{ - return camwnd.m_gl_widget; -} - -GtkWindow* CamWnd_getParent(CamWnd& camwnd) -{ - return camwnd.m_parent; -} - -ToggleShown g_camera_shown(true); - -void CamWnd_setParent(CamWnd& camwnd, GtkWindow* parent) -{ - camwnd.m_parent = parent; - g_camera_shown.connect(GTK_WIDGET(camwnd.m_parent)); -} - -void CamWnd_Update(CamWnd& camwnd) -{ - camwnd.queue_draw(); -} - - - -camwindow_globals_t g_camwindow_globals; - -const Vector3& Camera_getOrigin(CamWnd& camwnd) -{ - return Camera_getOrigin(camwnd.getCamera()); -} - -void Camera_setOrigin(CamWnd& camwnd, const Vector3& origin) -{ - Camera_setOrigin(camwnd.getCamera(), origin); -} - -const Vector3& Camera_getAngles(CamWnd& camwnd) -{ - return Camera_getAngles(camwnd.getCamera()); -} - -void Camera_setAngles(CamWnd& camwnd, const Vector3& angles) -{ - Camera_setAngles(camwnd.getCamera(), angles); -} +extern int g_nPatchClickedView; +brush_t* g_pSplitList = NULL; // ============================================================================= // CamWnd class -gboolean enable_freelook_button_press(GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd) +CamWnd::CamWnd () + : GLWindow (TRUE), m_XORRectangle(m_pWidget) { - if(event->type == GDK_BUTTON_PRESS && event->button == 3) - { - camwnd->EnableFreeMove(); - return TRUE; - } - return FALSE; + m_nNumTransBrushes = 0; + memset(&m_Camera, 0, sizeof(camera_t)); + m_pSide_select = NULL; + m_bClipMode = false; + m_bFreeMove = false; + Cam_Init(); } -gboolean disable_freelook_button_press(GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd) +CamWnd::~CamWnd () { - if(event->type == GDK_BUTTON_PRESS && event->button == 3) - { - camwnd->DisableFreeMove(); - return TRUE; - } - return FALSE; } -#if 0 -gboolean mousecontrol_button_press(GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd) +void CamWnd::OnCreate () { - if(event->type == GDK_BUTTON_PRESS && event->button == 3) + if (!MakeCurrent ()) + Error ("glMakeCurrent failed"); + + gtk_glwidget_create_font (m_pWidget); + + // report OpenGL information + Sys_Printf ("GL_VENDOR: %s\n", qglGetString (GL_VENDOR)); + Sys_Printf ("GL_RENDERER: %s\n", qglGetString (GL_RENDERER)); + Sys_Printf ("GL_VERSION: %s\n", qglGetString (GL_VERSION)); + Sys_Printf ("GL_EXTENSIONS: %s\n", qglGetString (GL_EXTENSIONS)); + + // Set off texture compression supported + g_qeglobals.bTextureCompressionSupported = 0; + + // finalize OpenGL init + // NOTE + // why is this here? well .. the Gtk objects get constructed when you enter gtk_main + // and I wanted to have the extensions information in the editor startup console (avoid looking that up in the early console) + // RIANT + // I Split this up so as to add support for extension and user-friendly + // compression format selection. + // ADD new globals for your new format so as to minimise + // calls to Sys_QGL_ExtensionSupported + // NOTE TTimo: I don't really like this approach with globals. Frequent calls to Sys_QGL_ExtensionSupported don't sound like + // a problem to me. If there is some caching to be done, then I think it should be inside Sys_QGL_ExtensionSupported + /////////////////////////////////////////// + // Check for default OpenGL + if (Sys_QGL_ExtensionSupported ("GL_ARB_texture_compression")) { - Cam_MouseControl(camwnd->getCamera(), event->x, widget->allocation.height - 1 - event->y); + g_qeglobals.bTextureCompressionSupported = 1; + g_qeglobals.m_bOpenGLCompressionSupported = 1; } - return FALSE; -} + + // INSERT PROPRIETARY EXTENSIONS HERE + // Check for S3 extensions + // create a bool global for extension supported + if (Sys_QGL_ExtensionSupported ("GL_EXT_texture_compression_s3tc")) + { + g_qeglobals.bTextureCompressionSupported = 1; + g_qeglobals.m_bS3CompressionSupported = 1; + } + + g_qeglobals.m_bOpenGLReady = true; + + g_PrefsDlg.UpdateTextureCompression(); + +#ifdef ATIHACK_812 + g_PrefsDlg.UpdateATIHack(); #endif -void camwnd_update_xor_rectangle(CamWnd& self, rect_t area) + g_qeglobals_gui.d_camera = m_pWidget; +} + +void CamWnd::Cam_Init () { - if(GTK_WIDGET_VISIBLE(self.m_gl_widget)) + m_Camera.timing = false; + m_Camera.origin[0] = 0.f; + m_Camera.origin[1] = 20.f; + m_Camera.origin[2] = 46.f; + m_Camera.color[0] = 0.3f; + m_Camera.color[1] = 0.3f; + m_Camera.color[2] = 0.3f; + m_nCambuttonstate = 0; +} + +void CamWnd::OnSize(int cx, int cy) +{ + m_Camera.width = cx; + m_Camera.height = cy; + gtk_widget_queue_draw(m_pWidget); +} + +rectangle_t rectangle_from_area_cam() +{ + const float left = MIN(g_qeglobals.d_vAreaTL[0], g_qeglobals.d_vAreaBR[0]); + const float top = MAX(g_qeglobals.d_vAreaTL[1], g_qeglobals.d_vAreaBR[1]); + const float right = MAX(g_qeglobals.d_vAreaTL[0], g_qeglobals.d_vAreaBR[0]); + const float bottom = MIN(g_qeglobals.d_vAreaTL[1], g_qeglobals.d_vAreaBR[1]); + return rectangle_t(left, bottom, right - left, top - bottom); +} + +void update_xor_rectangle(XORRectangle& xor_rectangle) +{ + rectangle_t rectangle; + if ((g_qeglobals.d_select_mode == sel_area)) + rectangle = rectangle_from_area_cam(); + xor_rectangle.set(rectangle); +} + +void CamWnd::OnMouseMove(guint32 flags, int pointx, int pointy) +{ + int height = m_pWidget->allocation.height; + // NOTE RR2DO2 this hasn't got any use anymore really. It is an old qeradiant feature + // that can be re-enabled by removing the checks for HasCapture and not shift/ctrl down + // but the scaling/rotating (unless done with the steps set in the surface inspector + // dialog) is way too sensitive to be of any use + if (HasCapture () && Sys_AltDown () && + !((flags & MK_SHIFT) || (flags & MK_CONTROL))) { - self.m_XORRectangle.set(rectangle_from_area(area.min, area.max, self.getCamera().width, self.getCamera().height)); - } -} - - -gboolean selection_button_press(GtkWidget* widget, GdkEventButton* event, WindowObserver* observer) -{ - if(event->type == GDK_BUTTON_PRESS) - { - observer->onMouseDown(WindowVector_forDouble(event->x, event->y), button_for_button(event->button), modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean selection_button_release(GtkWidget* widget, GdkEventButton* event, WindowObserver* observer) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - observer->onMouseUp(WindowVector_forDouble(event->x, event->y), button_for_button(event->button), modifiers_for_state(event->state)); - } - return FALSE; -} - -void selection_motion(gdouble x, gdouble y, guint state, void* data) -{ - //globalOutputStream() << "motion... "; - reinterpret_cast(data)->onMouseMotion(WindowVector_forDouble(x, y), modifiers_for_state(state)); -} - -inline WindowVector windowvector_for_widget_centre(GtkWidget* widget) -{ - return WindowVector(static_cast(widget->allocation.width / 2), static_cast(widget->allocation.height / 2)); -} - -gboolean selection_button_press_freemove(GtkWidget* widget, GdkEventButton* event, WindowObserver* observer) -{ - if(event->type == GDK_BUTTON_PRESS) - { - observer->onMouseDown(windowvector_for_widget_centre(widget), button_for_button(event->button), modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean selection_button_release_freemove(GtkWidget* widget, GdkEventButton* event, WindowObserver* observer) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - observer->onMouseUp(windowvector_for_widget_centre(widget), button_for_button(event->button), modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean selection_motion_freemove(GtkWidget *widget, GdkEventMotion *event, WindowObserver* observer) -{ - observer->onMouseMotion(windowvector_for_widget_centre(widget), modifiers_for_state(event->state)); - return FALSE; -} - -gboolean wheelmove_scroll(GtkWidget* widget, GdkEventScroll* event, CamWnd* camwnd) -{ - if(event->direction == GDK_SCROLL_UP) - { - Camera_Freemove_updateAxes(camwnd->getCamera()); - Camera_setOrigin(*camwnd, vector3_added(Camera_getOrigin(*camwnd), vector3_scaled(camwnd->getCamera().forward, static_cast(g_camwindow_globals_private.m_nMoveSpeed)))); - } - else if(event->direction == GDK_SCROLL_DOWN) - { - Camera_Freemove_updateAxes(camwnd->getCamera()); - Camera_setOrigin(*camwnd, vector3_added(Camera_getOrigin(*camwnd), vector3_scaled(camwnd->getCamera().forward, -static_cast(g_camwindow_globals_private.m_nMoveSpeed)))); - } - - return FALSE; -} - -gboolean camera_size_allocate(GtkWidget* widget, GtkAllocation* allocation, CamWnd* camwnd) -{ - camwnd->getCamera().width = allocation->width; - camwnd->getCamera().height = allocation->height; - Camera_updateProjection(camwnd->getCamera()); - camwnd->m_window_observer->onSizeChanged(camwnd->getCamera().width, camwnd->getCamera().height); - camwnd->queue_draw(); - return FALSE; -} - -gboolean camera_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data) -{ - reinterpret_cast(data)->draw(); - return FALSE; -} - -void KeyEvent_connect(const char* name) -{ - const KeyEvent& keyEvent = GlobalKeyEvents_find(name); - keydown_accelerators_add(keyEvent.m_accelerator, keyEvent.m_keyDown); - keyup_accelerators_add(keyEvent.m_accelerator, keyEvent.m_keyUp); -} - -void KeyEvent_disconnect(const char* name) -{ - const KeyEvent& keyEvent = GlobalKeyEvents_find(name); - keydown_accelerators_remove(keyEvent.m_accelerator); - keyup_accelerators_remove(keyEvent.m_accelerator); -} - -void CamWnd_registerCommands(CamWnd& camwnd) -{ - GlobalKeyEvents_insert("CameraForward", Accelerator(GDK_Up), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraBack", Accelerator(GDK_Down), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraLeft", Accelerator(GDK_Left), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraRight", Accelerator(GDK_Right), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraStrafeRight", Accelerator(GDK_period), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraStrafeLeft", Accelerator(GDK_comma), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraUp", Accelerator('D'), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraDown", Accelerator('C'), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraAngleDown", Accelerator('A'), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraAngleUp", Accelerator('Z'), - ReferenceCaller(camwnd.getCamera()), - ReferenceCaller(camwnd.getCamera()) - ); - - GlobalKeyEvents_insert("CameraFreeMoveForward", Accelerator(GDK_Up), - FreeMoveCameraMoveForwardKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveForwardKeyUpCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraFreeMoveBack", Accelerator(GDK_Down), - FreeMoveCameraMoveBackKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveBackKeyUpCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraFreeMoveLeft", Accelerator(GDK_Left), - FreeMoveCameraMoveLeftKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveLeftKeyUpCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraFreeMoveRight", Accelerator(GDK_Right), - FreeMoveCameraMoveRightKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveRightKeyUpCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraFreeMoveUp", Accelerator('D'), - FreeMoveCameraMoveUpKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveUpKeyUpCaller(camwnd.getCamera()) - ); - GlobalKeyEvents_insert("CameraFreeMoveDown", Accelerator('C'), - FreeMoveCameraMoveDownKeyDownCaller(camwnd.getCamera()), - FreeMoveCameraMoveDownKeyUpCaller(camwnd.getCamera()) - ); - - GlobalCommands_insert("CameraForward", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_Up)); - GlobalCommands_insert("CameraBack", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_Down)); - GlobalCommands_insert("CameraLeft", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_Left)); - GlobalCommands_insert("CameraRight", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_Right)); - GlobalCommands_insert("CameraStrafeRight", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_period)); - GlobalCommands_insert("CameraStrafeLeft", ReferenceCaller(camwnd.getCamera()), Accelerator(GDK_comma)); - - GlobalCommands_insert("CameraUp", ReferenceCaller(camwnd.getCamera()), Accelerator('D')); - GlobalCommands_insert("CameraDown", ReferenceCaller(camwnd.getCamera()), Accelerator('C')); - GlobalCommands_insert("CameraAngleUp", ReferenceCaller(camwnd.getCamera()), Accelerator('A')); - GlobalCommands_insert("CameraAngleDown", ReferenceCaller(camwnd.getCamera()), Accelerator('Z')); -} - -void CamWnd_Move_Enable(CamWnd& camwnd) -{ - KeyEvent_connect("CameraForward"); - KeyEvent_connect("CameraBack"); - KeyEvent_connect("CameraLeft"); - KeyEvent_connect("CameraRight"); - KeyEvent_connect("CameraStrafeRight"); - KeyEvent_connect("CameraStrafeLeft"); - KeyEvent_connect("CameraUp"); - KeyEvent_connect("CameraDown"); - KeyEvent_connect("CameraAngleUp"); - KeyEvent_connect("CameraAngleDown"); -} - -void CamWnd_Move_Disable(CamWnd& camwnd) -{ - KeyEvent_disconnect("CameraForward"); - KeyEvent_disconnect("CameraBack"); - KeyEvent_disconnect("CameraLeft"); - KeyEvent_disconnect("CameraRight"); - KeyEvent_disconnect("CameraStrafeRight"); - KeyEvent_disconnect("CameraStrafeLeft"); - KeyEvent_disconnect("CameraUp"); - KeyEvent_disconnect("CameraDown"); - KeyEvent_disconnect("CameraAngleUp"); - KeyEvent_disconnect("CameraAngleDown"); -} - -void CamWnd_Move_Discrete_Enable(CamWnd& camwnd) -{ - command_connect_accelerator("CameraForward"); - command_connect_accelerator("CameraBack"); - command_connect_accelerator("CameraLeft"); - command_connect_accelerator("CameraRight"); - command_connect_accelerator("CameraStrafeRight"); - command_connect_accelerator("CameraStrafeLeft"); - command_connect_accelerator("CameraUp"); - command_connect_accelerator("CameraDown"); - command_connect_accelerator("CameraAngleUp"); - command_connect_accelerator("CameraAngleDown"); -} - -void CamWnd_Move_Discrete_Disable(CamWnd& camwnd) -{ - command_disconnect_accelerator("CameraForward"); - command_disconnect_accelerator("CameraBack"); - command_disconnect_accelerator("CameraLeft"); - command_disconnect_accelerator("CameraRight"); - command_disconnect_accelerator("CameraStrafeRight"); - command_disconnect_accelerator("CameraStrafeLeft"); - command_disconnect_accelerator("CameraUp"); - command_disconnect_accelerator("CameraDown"); - command_disconnect_accelerator("CameraAngleUp"); - command_disconnect_accelerator("CameraAngleDown"); -} - -void CamWnd_Move_Discrete_Import(CamWnd& camwnd, bool value) -{ - if(g_camwindow_globals_private.m_bCamDiscrete) - { - CamWnd_Move_Discrete_Disable(camwnd); + if (flags & MK_CONTROL) + Select_RotateTexture(pointy - m_ptLastCursorY); + else + if (flags & MK_SHIFT) + Select_ScaleTexture(pointx - m_ptLastCursorX, m_ptLastCursorY - pointy); + else + Select_ShiftTexture(pointx - m_ptLastCursorX, m_ptLastCursorY - pointy); } else { - CamWnd_Move_Disable(camwnd); + Cam_MouseMoved(pointx, height - 1 - pointy, flags); + } + m_ptLastCursorX = pointx; + m_ptLastCursorY = pointy; + + update_xor_rectangle(m_XORRectangle); +} + +void CamWnd::OnMouseWheel(bool bUp) +{ + if (bUp) + VectorMA (m_Camera.origin, g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin); + else + VectorMA (m_Camera.origin, -g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin); + + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); +} + +void CamWnd::OnLButtonDown(guint32 nFlags, int pointx, int pointy) +{ + m_ptLastCursorX = pointx; + m_ptLastCursorY = pointy; + OriginalMouseDown(nFlags, pointx, pointy); +} + +void CamWnd::OnLButtonUp(guint32 nFlags, int pointx, int pointy) +{ + OriginalMouseUp(nFlags, pointx, pointy); +} + +void CamWnd::OnMButtonDown(guint32 nFlags, int pointx, int pointy) +{ + OriginalMouseDown(nFlags, pointx, pointy); +} + +void CamWnd::OnMButtonUp(guint32 nFlags, int pointx, int pointy) +{ + OriginalMouseUp(nFlags, pointx, pointy); +} + +void CamWnd::OnRButtonDown(guint32 nFlags, int pointx, int pointy) +{ + OriginalMouseDown(nFlags, pointx, pointy); +} + +void CamWnd::OnRButtonUp(guint32 nFlags, int pointx, int pointy) +{ + OriginalMouseUp(nFlags, pointx, pointy); +} + +void CamWnd::OriginalMouseUp(guint32 nFlags, int pointx, int pointy) +{ + int height = m_pWidget->allocation.height; + + if(g_qeglobals.d_select_mode == sel_facets_on || g_qeglobals.d_select_mode == sel_facets_off) + { + g_qeglobals.d_select_mode = sel_brush; } - g_camwindow_globals_private.m_bCamDiscrete = value; + Cam_MouseUp(pointx, height - 1 - pointy, nFlags); + ReleaseCapture (); - if(g_camwindow_globals_private.m_bCamDiscrete) + update_xor_rectangle(m_XORRectangle); +} + +void CamWnd::OriginalMouseDown(guint32 nFlags, int pointx, int pointy) +{ + int height = m_pWidget->allocation.height; + + SetFocus(); + SetCapture(); + Cam_MouseDown (pointx, height - 1 - pointy, nFlags); + + update_xor_rectangle(m_XORRectangle); +} + +void CamWnd::Cam_BuildMatrix() +{ + float ya; + float matrix[4][4]; + int i; + + if (!m_bFreeMove) { - CamWnd_Move_Discrete_Enable(camwnd); + ya = m_Camera.angles[1]/180*Q_PI; + + // the movement matrix is kept 2d + m_Camera.forward[0] = cos(ya); + m_Camera.forward[1] = sin(ya); + m_Camera.forward[2] = 0; + m_Camera.right[0] = m_Camera.forward[1]; + m_Camera.right[1] = -m_Camera.forward[0]; } else { - CamWnd_Move_Enable(camwnd); + AngleVectors( m_Camera.angles, m_Camera.forward, m_Camera.right, NULL ); + m_Camera.forward[2] = -m_Camera.forward[2]; } + + memcpy(matrix, m_Camera.projection, sizeof(m4x4_t)); + m4x4_multiply_by_m4x4(&matrix[0][0], &m_Camera.modelview[0][0]); + + //qglGetFloatv (GL_PROJECTION_MATRIX, &matrix[0][0]); + + for (i=0 ; i<3 ; i++) + { + m_Camera.vright[i] = matrix[i][0]; + m_Camera.vup[i] = matrix[i][1]; + m_Camera.vpn[i] = matrix[i][2]; + } + + VectorNormalize (m_Camera.vright, m_Camera.vright); + VectorNormalize (m_Camera.vup, m_Camera.vup); + VectorNormalize (m_Camera.vpn, m_Camera.vpn); } -void CamWnd_Move_Discrete_Import(bool value) +void CamWnd::Cam_ChangeFloor (qboolean up) { - if(g_camwnd != 0) - { - CamWnd_Move_Discrete_Import(*g_camwnd, value); - } + brush_t *b; + float d, bestd, current; + vec3_t start, dir; + + start[0] = m_Camera.origin[0]; + start[1] = m_Camera.origin[1]; + start[2] = g_MaxWorldCoord; + dir[0] = dir[1] = 0; + dir[2] = -1; + + current = g_MaxWorldCoord - (m_Camera.origin[2] - 48); + if (up) + bestd = 0; else + bestd = 2*g_MaxWorldCoord; + + for (b=active_brushes.next ; b != &active_brushes ; b=b->next) { - g_camwindow_globals_private.m_bCamDiscrete = value; - } -} - - - -void CamWnd_Add_Handlers_Move(CamWnd& camwnd) -{ - camwnd.m_selection_button_press_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_press_event", G_CALLBACK(selection_button_press), camwnd.m_window_observer); - camwnd.m_selection_button_release_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_release_event", G_CALLBACK(selection_button_release), camwnd.m_window_observer); - camwnd.m_selection_motion_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "motion_notify_event", G_CALLBACK(DeferredMotion::gtk_motion), &camwnd.m_deferred_motion); - - camwnd.m_freelook_button_press_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_press_event", G_CALLBACK(enable_freelook_button_press), &camwnd); - - if(g_camwindow_globals_private.m_bCamDiscrete) - { - CamWnd_Move_Discrete_Enable(camwnd); - } - else - { - CamWnd_Move_Enable(camwnd); - } -} - -void CamWnd_Remove_Handlers_Move(CamWnd& camwnd) -{ - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_button_press_handler); - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_button_release_handler); - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_motion_handler); - - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_freelook_button_press_handler); - - if(g_camwindow_globals_private.m_bCamDiscrete) - { - CamWnd_Move_Discrete_Disable(camwnd); - } - else - { - CamWnd_Move_Disable(camwnd); - } -} - -void CamWnd_Add_Handlers_FreeMove(CamWnd& camwnd) -{ - camwnd.m_selection_button_press_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_press_event", G_CALLBACK(selection_button_press_freemove), camwnd.m_window_observer); - camwnd.m_selection_button_release_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_release_event", G_CALLBACK(selection_button_release_freemove), camwnd.m_window_observer); - camwnd.m_selection_motion_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "motion_notify_event", G_CALLBACK(selection_motion_freemove), camwnd.m_window_observer); - - camwnd.m_freelook_button_press_handler = g_signal_connect(G_OBJECT(camwnd.m_gl_widget), "button_press_event", G_CALLBACK(disable_freelook_button_press), &camwnd); - - KeyEvent_connect("CameraFreeMoveForward"); - KeyEvent_connect("CameraFreeMoveBack"); - KeyEvent_connect("CameraFreeMoveLeft"); - KeyEvent_connect("CameraFreeMoveRight"); - KeyEvent_connect("CameraFreeMoveUp"); - KeyEvent_connect("CameraFreeMoveDown"); -} - -void CamWnd_Remove_Handlers_FreeMove(CamWnd& camwnd) -{ - KeyEvent_disconnect("CameraFreeMoveForward"); - KeyEvent_disconnect("CameraFreeMoveBack"); - KeyEvent_disconnect("CameraFreeMoveLeft"); - KeyEvent_disconnect("CameraFreeMoveRight"); - KeyEvent_disconnect("CameraFreeMoveUp"); - KeyEvent_disconnect("CameraFreeMoveDown"); - - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_button_press_handler); - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_button_release_handler); - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_selection_motion_handler); - - g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_freelook_button_press_handler); -} - -CamWnd::CamWnd() : - m_view(true), - m_Camera(&m_view, CamWndQueueDraw(*this)), - m_cameraview(m_Camera, &m_view, ReferenceCaller(*this)), - m_gl_widget(glwidget_new(TRUE)), - m_window_observer(NewWindowObserver()), - m_XORRectangle(m_gl_widget), - m_deferredDraw(WidgetQueueDrawCaller(*m_gl_widget)), - m_deferred_motion(selection_motion, m_window_observer), - m_selection_button_press_handler(0), - m_selection_button_release_handler(0), - m_selection_motion_handler(0), - m_freelook_button_press_handler(0), - m_drawing(false) -{ - m_bFreeMove = false; - - GlobalWindowObservers_add(m_window_observer); - GlobalWindowObservers_connectWidget(m_gl_widget); - - m_window_observer->setRectangleDrawCallback(ReferenceCaller1(*this)); - m_window_observer->setView(m_view); - - gtk_widget_ref(m_gl_widget); - - gtk_widget_set_events(m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK); - GTK_WIDGET_SET_FLAGS (m_gl_widget, GTK_CAN_FOCUS); - - m_sizeHandler = g_signal_connect(G_OBJECT(m_gl_widget), "size_allocate", G_CALLBACK(camera_size_allocate), this); - m_exposeHandler = g_signal_connect(G_OBJECT(m_gl_widget), "expose_event", G_CALLBACK(camera_expose), this); - - Map_addValidCallback(g_map, DeferredDrawOnMapValidChangedCaller(m_deferredDraw)); - - CamWnd_registerCommands(*this); - - CamWnd_Add_Handlers_Move(*this); - - g_signal_connect(G_OBJECT(m_gl_widget), "scroll_event", G_CALLBACK(wheelmove_scroll), this); - - AddSceneChangeCallback(ReferenceCaller(*this)); - - PressedButtons_connect(g_pressedButtons, m_gl_widget); -} - -CamWnd::~CamWnd() -{ - if(m_bFreeMove) - { - DisableFreeMove(); + if (!Brush_Ray (start, dir, b, &d)) + continue; + if (up && d < current && d > bestd) + bestd = d; + if (!up && d > current && d < bestd) + bestd = d; } - CamWnd_Remove_Handlers_Move(*this); - - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_sizeHandler); - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_exposeHandler); - - gtk_widget_unref(m_gl_widget); - - m_window_observer->release(); -} - -class FloorHeightWalker : public scene::Graph::Walker -{ - float m_current; - float& m_bestUp; - float& m_bestDown; -public: - FloorHeightWalker(float current, float& bestUp, float& bestDown) : - m_current(current), m_bestUp(bestUp), m_bestDown(bestDown) - { - bestUp = g_MaxWorldCoord; - bestDown = -g_MaxWorldCoord; - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible() - && Node_isBrush(path.top())) // this node is a floor - { - const AABB& aabb = instance.worldAABB(); - float floorHeight = aabb.origin.z() + aabb.extents.z(); - if(floorHeight > m_current && floorHeight < m_bestUp) - { - m_bestUp = floorHeight; - } - if(floorHeight < m_current && floorHeight > m_bestDown) - { - m_bestDown = floorHeight; - } - } - return true; - } -}; - -void CamWnd::Cam_ChangeFloor(bool up) -{ - float current = m_Camera.origin[2] - 48; - float bestUp; - float bestDown; - GlobalSceneGraph().traverse(FloorHeightWalker(current, bestUp, bestDown)); - - if(up && bestUp != g_MaxWorldCoord) - { - current = bestUp; - } - if(!up && bestDown != -g_MaxWorldCoord) - { - current = bestDown; - } - - m_Camera.origin[2] = current + 48; - Camera_updateModelview(getCamera()); - CamWnd_Update(*this); - CameraMovedNotify(); -} - - -#if 0 - -// button_press - Sys_GetCursorPos(&m_PositionDragCursorX, &m_PositionDragCursorY); - -// motion - if ( (m_bFreeMove && (buttons == (RAD_CONTROL|RAD_SHIFT))) - || (!m_bFreeMove && (buttons == (RAD_RBUTTON|RAD_CONTROL))) ) - { - Cam_PositionDrag(); - CamWnd_Update(camwnd); - CameraMovedNotify(); + if (bestd == 0 || bestd == 2*g_MaxWorldCoord) return; - } + + m_Camera.origin[2] += current - bestd; + Sys_UpdateWindows (W_CAMERA|W_Z_OVERLAY); +} void CamWnd::Cam_PositionDrag() { int x, y; - Sys_GetCursorPos(GTK_WINDOW(m_gl_widget), &x, &y); - if (x != m_PositionDragCursorX || y != m_PositionDragCursorY) + Sys_GetCursorPos (&x, &y); + if (x != m_ptCursorX || y != m_ptCursorY) { - x -= m_PositionDragCursorX; - vector3_add(m_Camera.origin, vector3_scaled(m_Camera.vright, x)); - y -= m_PositionDragCursorY; + x -= m_ptCursorX; + VectorMA (m_Camera.origin, x, m_Camera.vright, m_Camera.origin); + y -= m_ptCursorY; m_Camera.origin[2] -= y; - Camera_updateModelview(); - CamWnd_Update(camwnd); - CameraMovedNotify(); + Sys_SetCursorPos(m_ptCursorX, m_ptCursorY); + Sys_UpdateWindows (W_CAMERA | W_XY_OVERLAY); + } +} - Sys_SetCursorPos(GTK_WINDOW(m_parent), m_PositionDragCursorX, m_PositionDragCursorY); +void CamWnd::Cam_MouseControl (float dtime) +{ + Cam_KeyControl (dtime); + + if( g_PrefsDlg.m_bCamFreeLook ) + { + int dx, dy; + gint x, y; + + if( !m_bFreeMove || m_nCambuttonstate == MK_CONTROL ) + return; + + // Update angles + Sys_GetCursorPos(&m_ptCursorX, &m_ptCursorY); + + dx = m_ptLastCamCursorX - m_ptCursorX; + dy = m_ptLastCamCursorY - m_ptCursorY; + + gdk_window_get_origin( m_pWidget->window, &x, &y); + + m_ptLastCamCursorX = x + (m_Camera.width / 2); + m_ptLastCamCursorY = y + (m_Camera.height / 2); + + Sys_SetCursorPos(m_ptLastCamCursorX, m_ptLastCamCursorY); + + // Don't use pitch + if(!g_PrefsDlg.m_bCamFreeLookStrafe) { + if (g_PrefsDlg.m_bCamInverseMouse) + m_Camera.angles[PITCH] -= dy * dtime * g_PrefsDlg.m_nAngleSpeed; + else + m_Camera.angles[PITCH] += dy * dtime * g_PrefsDlg.m_nAngleSpeed; + } else { + VectorMA (m_Camera.origin, dy * (float) (g_PrefsDlg.m_nMoveSpeed / 6.0f), m_Camera.forward, m_Camera.origin); + } + + m_Camera.angles[YAW] += dx * dtime * g_PrefsDlg.m_nAngleSpeed; + + if (m_Camera.angles[PITCH] > 90) + m_Camera.angles[PITCH] = 90; + else if (m_Camera.angles[PITCH] < -90) + m_Camera.angles[PITCH] = -90; + + if (m_Camera.angles[YAW] >= 360) + m_Camera.angles[YAW] = 0; + else if (m_Camera.angles[YAW] <= -360) + m_Camera.angles[YAW] = 0; + + if( dx || dy || m_Camera.movementflags ) + { + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); + } + } + else + { + int xl, xh; + int yl, yh; + float xf, yf; + + if (g_PrefsDlg.m_nMouseButtons == 2) + { + if (m_nCambuttonstate != (MK_RBUTTON | MK_SHIFT)) + return; + } + else + { + if (m_nCambuttonstate != MK_RBUTTON) + return; + } + + xf = (float)(m_ptButtonX - m_Camera.width/2) / (m_Camera.width/2); + yf = (float)(m_ptButtonY - m_Camera.height/2) / (m_Camera.height/2); + + xl = m_Camera.width/3; + xh = xl*2; + yl = m_Camera.height/3; + yh = yl*2; + + xf *= 1.0 - fabs(yf); + if (xf < 0) + { + xf += 0.1f; + if (xf > 0) + xf = 0; + } + else + { + xf -= 0.1f; + if (xf < 0) + xf = 0; + } + + VectorMA (m_Camera.origin, yf*dtime*g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin); + m_Camera.angles[YAW] += xf*-dtime*g_PrefsDlg.m_nAngleSpeed; + + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); + } +} + +void CamWnd::Cam_KeyControl (float dtime) { + + // Update angles + if (m_Camera.movementflags & MOVE_ROTLEFT) + m_Camera.angles[YAW] += 15*dtime*g_PrefsDlg.m_nAngleSpeed; + if (m_Camera.movementflags & MOVE_ROTRIGHT) + m_Camera.angles[YAW] -= 15*dtime*g_PrefsDlg.m_nAngleSpeed; + + // Update position + if (m_Camera.movementflags & MOVE_FORWARD) + VectorMA (m_Camera.origin, dtime*g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin); + if (m_Camera.movementflags & MOVE_BACK) + VectorMA (m_Camera.origin, -dtime*g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin); + if (m_Camera.movementflags & MOVE_STRAFELEFT) + VectorMA (m_Camera.origin, -dtime*g_PrefsDlg.m_nMoveSpeed, m_Camera.right, m_Camera.origin); + if (m_Camera.movementflags & MOVE_STRAFERIGHT) + VectorMA (m_Camera.origin, dtime*g_PrefsDlg.m_nMoveSpeed, m_Camera.right, m_Camera.origin); + + // Save a screen update (when m_bFreeMove is enabled, mousecontrol does the update) + if( !m_bFreeMove && m_Camera.movementflags ) + { + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); + } +} + +// NOTE TTimo if there's an OS-level focus out of the application +// then we can release the camera cursor grab +static gint camwindow_focusout(GtkWidget* widget, GdkEventKey* event, gpointer data) +{ + g_pParentWnd->GetCamWnd ()->ToggleFreeMove(); + return FALSE; +} + +void CamWnd::ToggleFreeMove() +{ + GdkWindow *window; + GtkWidget *widget; + + m_bFreeMove = !m_bFreeMove; + Camera()->movementflags = 0; + m_ptLastCamCursorX = m_ptCursorX; + m_ptLastCamCursorY = m_ptCursorY; + + if (g_pParentWnd->CurrentStyle() == MainFrame::eFloating) + { + widget = g_pParentWnd->GetCamWnd ()->m_pParent; + window = widget->window; + } + else + { + widget = g_pParentWnd->m_pWidget; + window = widget->window; + } + + if (m_bFreeMove) + { + + SetFocus(); + SetCapture(); + + { + GdkPixmap *pixmap; + GdkBitmap *mask; + char buffer [(32 * 32)/8]; + memset (buffer, 0, (32 * 32)/8); + GdkColor white = {0, 0xffff, 0xffff, 0xffff}; + GdkColor black = {0, 0x0000, 0x0000, 0x0000}; + pixmap = gdk_bitmap_create_from_data (NULL, buffer, 32, 32); + mask = gdk_bitmap_create_from_data (NULL, buffer, 32, 32); + GdkCursor *cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &white, &black, 1, 1); + + gdk_window_set_cursor (window, cursor); + gdk_cursor_unref (cursor); + gdk_drawable_unref (pixmap); + gdk_drawable_unref (mask); + } + + // RR2DO2: FIXME why does this only work the 2nd and + // further times the event is called? (floating windows + // mode seems to work fine though...) + m_FocusOutHandler_id = gtk_signal_connect (GTK_OBJECT (widget), "focus_out_event", + GTK_SIGNAL_FUNC (camwindow_focusout), g_pParentWnd); + + { + GdkEventMask mask = (GdkEventMask)(GDK_POINTER_MOTION_MASK + | GDK_POINTER_MOTION_HINT_MASK + | GDK_BUTTON_MOTION_MASK + | GDK_BUTTON1_MOTION_MASK + | GDK_BUTTON2_MOTION_MASK + | GDK_BUTTON3_MOTION_MASK + | GDK_BUTTON_PRESS_MASK + | GDK_BUTTON_RELEASE_MASK); + + gdk_pointer_grab(widget->window, TRUE, mask, widget->window, NULL, GDK_CURRENT_TIME); + } + } + else + { + gdk_pointer_ungrab(GDK_CURRENT_TIME); + + gtk_signal_disconnect (GTK_OBJECT (widget), m_FocusOutHandler_id); + + GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR); + gdk_window_set_cursor (window, cursor); + gdk_cursor_unref (cursor); + + ReleaseCapture(); + } + + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); +} + +void CamWnd::Cam_MouseDown(int x, int y, int buttons) +{ + vec3_t dir; + float f, r, u; + int i; + + + // + // calc ray direction + // + u = (float)( y - ( m_Camera.height * .5f ) ) / ( m_Camera.width * .5f ); + r = (float)( x - ( m_Camera.width * .5f ) ) / ( m_Camera.width * .5f ); + f = 1; + + for (i=0 ; i<3 ; i++) + dir[i] = m_Camera.vpn[i] * f + m_Camera.vright[i] * r + m_Camera.vup[i] * u; + VectorNormalize (dir, dir); + + Sys_GetCursorPos(&m_ptCursorX, &m_ptCursorY); + + m_nCambuttonstate = buttons; + m_ptButtonX = x; + m_ptButtonY = y; + + // LBUTTON = manipulate selection + // shift-LBUTTON = select + // middle button = grab texture + // ctrl-middle button = set entire brush to texture + // ctrl-shift-middle button = set single face to texture + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + if ((buttons == MK_LBUTTON) + || (buttons == (MK_LBUTTON | MK_SHIFT)) + || (buttons == (MK_LBUTTON | MK_CONTROL)) + || (buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT)) + || (buttons == nMouseButton) + || (buttons == (nMouseButton|MK_SHIFT)) + || (buttons == (nMouseButton|MK_CONTROL)) + || (buttons == (nMouseButton|MK_SHIFT|MK_CONTROL))) + { + if (g_PrefsDlg.m_nMouseButtons == 2 && (buttons == (MK_RBUTTON | MK_SHIFT))) + { + if (g_PrefsDlg.m_bCamFreeLook) + ToggleFreeMove(); + else + Cam_MouseControl (0.1f); + } + else + { + // something global needs to track which window is responsible for stuff + Patch_SetView(W_CAMERA); + Drag_Begin (x, y, buttons, m_Camera.vright, m_Camera.vup, m_Camera.origin, dir, true); + } + return; + } + + if (buttons == MK_RBUTTON) + { + if (g_PrefsDlg.m_bCamFreeLook) + ToggleFreeMove(); + else + Cam_MouseControl (0.1f); + return; + } +} + +void CamWnd::Cam_MouseUp (int x, int y, int buttons) +{ + m_nCambuttonstate = 0; + Drag_MouseUp (buttons); +} + +void CamWnd::Cam_MouseMoved (int x, int y, int buttons) +{ + m_nCambuttonstate = buttons; + if (!buttons) + return; + + if( g_PrefsDlg.m_nCamDragMultiSelect ) + { + if (g_qeglobals.d_select_mode == sel_brush_on || g_qeglobals.d_select_mode == sel_brush_off) + { + bool bDoDragMultiSelect = FALSE; + + if( g_PrefsDlg.m_nCamDragMultiSelect == 1 && buttons == (MK_LBUTTON|MK_SHIFT) ) + bDoDragMultiSelect = TRUE; + else if( g_PrefsDlg.m_nCamDragMultiSelect == 2 && buttons == (MK_LBUTTON|MK_CONTROL) && Sys_AltDown() ) + bDoDragMultiSelect = TRUE; + + if( bDoDragMultiSelect ) + { + vec3_t dir; + float f, r, u; + int i; + + // + // calc ray direction + // + u = (float)( y - ( m_Camera.height * .5f ) ) / ( m_Camera.width * .5f ); + r = (float)( x - ( m_Camera.width * .5f ) ) / ( m_Camera.width * .5f ); + f = 1; + + for (i=0 ; i<3 ; i++) + dir[i] = m_Camera.vpn[i] * f + m_Camera.vright[i] * r + m_Camera.vup[i] * u; + VectorNormalize (dir,dir); + + switch( g_qeglobals.d_select_mode ) + { + case sel_brush_on: + Select_Ray( m_Camera.origin, dir, (SF_DRAG_ON|SF_CAMERA) ); + break; + + case sel_brush_off: + Select_Ray( m_Camera.origin, dir, (SF_DRAG_OFF|SF_CAMERA) ); + break; + + default: + break; + } + return; + } + } + else if (g_qeglobals.d_select_mode == sel_facets_on || g_qeglobals.d_select_mode == sel_facets_off) + { + if( buttons == (MK_LBUTTON|MK_CONTROL|MK_SHIFT) ) + { + vec3_t dir; + float f, r, u; + int i; + + // + // calc ray direction + // + u = (float)( y - ( m_Camera.height * .5f ) ) / ( m_Camera.width * .5f ); + r = (float)( x - ( m_Camera.width * .5f ) ) / ( m_Camera.width * .5f ); + f = 1; + + for (i=0 ; i<3 ; i++) + dir[i] = m_Camera.vpn[i] * f + m_Camera.vright[i] * r + m_Camera.vup[i] * u; + VectorNormalize (dir,dir); + + switch( g_qeglobals.d_select_mode ) + { + case sel_facets_on: + Select_Ray( m_Camera.origin, dir, (SF_SINGLEFACE|SF_DRAG_ON|SF_CAMERA) ); + break; + + case sel_facets_off: + Select_Ray( m_Camera.origin, dir, (SF_SINGLEFACE|SF_DRAG_OFF|SF_CAMERA) ); + break; + + default: + break; + } + return; + } + } + } + + m_ptButtonX = x; + m_ptButtonY = y; + + if ( (m_bFreeMove && (buttons & MK_CONTROL) && !(buttons & MK_SHIFT)) || (!m_bFreeMove && (buttons == (MK_RBUTTON|MK_CONTROL))) ) + { + Cam_PositionDrag (); + Sys_UpdateWindows (W_XY|W_CAMERA|W_Z); + return; + } + + Sys_GetCursorPos(&m_ptCursorX, &m_ptCursorY); + + if (buttons & (MK_LBUTTON | MK_MBUTTON) ) + { + Drag_MouseMoved (x, y, buttons); + if(g_qeglobals.d_select_mode != sel_area) + Sys_UpdateWindows (W_XY|W_CAMERA|W_Z); + } +} + +void CamWnd::InitCull() +{ + int i; + + VectorSubtract (m_Camera.vpn, m_Camera.vright, m_vCull1); + VectorAdd (m_Camera.vpn, m_Camera.vright, m_vCull2); + + for (i=0 ; i<3 ; i++) + { + if (m_vCull1[i] > 0) + m_nCullv1[i] = 3+i; + else + m_nCullv1[i] = i; + if (m_vCull2[i] > 0) + m_nCullv2[i] = 3+i; + else + m_nCullv2[i] = i; + } +} + +qboolean CamWnd::CullBrush (brush_t *b) +{ + int i; + vec3_t point; + float d; + + if (g_PrefsDlg.m_bCubicClipping) + { + float fLevel = g_PrefsDlg.m_nCubicScale * 64; + + point[0] = m_Camera.origin[0] - fLevel; + point[1] = m_Camera.origin[1] - fLevel; + point[2] = m_Camera.origin[2] - fLevel; + + for (i=0; i<3; i++) + if (b->mins[i] < point[i] && b->maxs[i] < point[i]) + return true; + + point[0] = m_Camera.origin[0] + fLevel; + point[1] = m_Camera.origin[1] + fLevel; + point[2] = m_Camera.origin[2] + fLevel; + + for (i=0; i<3; i++) + if (b->mins[i] > point[i] && b->maxs[i] > point[i]) + return true; + } + + for (i=0 ; i<3 ; i++) + point[i] = b->mins[m_nCullv1[i]] - m_Camera.origin[i]; + + d = DotProduct (point, m_vCull1); + if (d < -1) + return true; + + for (i=0 ; i<3 ; i++) + point[i] = b->mins[m_nCullv2[i]] - m_Camera.origin[i]; + + d = DotProduct (point, m_vCull2); + if (d < -1) + return true; + + return false; +} + +// project a 3D point onto the camera space +// we use the GL viewing matrixes +// this is the implementation of a glu function (I realized that afterwards): gluProject +void CamWnd::ProjectCamera(const vec3_t A, vec_t B[2]) +{ + + vec_t P1[4],P2[4],P3[4]; + VectorCopy(A,P1); P1[3] = 1; + + GLMatMul(m_Camera.modelview , P1, P2); + GLMatMul(m_Camera.projection, P2, P3); + + // we ASSUME that the view port is 0 0 m_Camera.width m_Camera.height (you can check in Cam_Draw) + B[0] = (float)m_Camera.width * ( P3[0] + 1.0 ) / 2.0; + B[1] = (float)m_Camera.height * ( P3[1] + 1.0 ) / 2.0; + +} + +// vec defines a direction in geometric space and P an origin point +// the user is interacting from the camera view +// (for example with texture adjustment shortcuts) +// and intuitively if he hits left / right / up / down +// what happens in geometric space should match the left/right/up/down move in camera space +// axis = 0: vec is along left/right +// axis = 1: vec is along up/down +// sgn = +1: same directions +// sgn = -1: opposite directions +// Implementation: +// typical use case is giving a face center and a normalized vector +// 1) compute start and endpoint, project them in camera view, get the direction +// depending on the situation, we might bump into precision issues with that +// 2) possible to compute the projected direction independently? +// this solution would be better but right now I don't see how to do it.. +void CamWnd::MatchViewAxes(const vec3_t P, const vec3_t vec, int &axis, float &sgn) +{ + + vec_t A[2],B[2],V[2]; + ProjectCamera(P,A); + vec3_t Q; + VectorAdd(P,vec,Q); + ProjectCamera(Q,B); + // V is the vector projected in camera space + V[0] = B[0] - A[0]; + V[1] = B[1] - A[1]; + if (fabs(V[0])>fabs(V[1])) + { + // best match is against right + axis = 0; + if (V[0]>0) + sgn = +1; + else + sgn = -1; + } + else + { + // best match is against up + axis = 1; + if (V[1]>0) + sgn = +1; + else + sgn = -1; + } +} + +#if 0 +void CamWnd::DrawLightRadius(brush_t* pBrush) +{ + // if lighting + int nRadius = Brush_LightRadius(pBrush); + if (nRadius > 0) + { + Brush_SetLightColor(pBrush); + qglEnable (GL_BLEND); + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglDisable (GL_TEXTURE_2D); + + qglEnable(GL_TEXTURE_2D); + qglDisable(GL_BLEND); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); } } #endif +extern void DrawPatchMesh(patchMesh_t *pm); +extern void DrawPatchControls(patchMesh_t *pm); +extern void Brush_DrawFacingAngle (brush_t *b, entity_t *e); +extern void Brush_DrawModel(brush_t *b, bool bTextured = false); +extern void DrawModelOrigin(brush_t *b); +extern void DrawModelBBox(brush_t *b); -// NOTE TTimo if there's an OS-level focus out of the application -// then we can release the camera cursor grab -static gboolean camwindow_freemove_focusout(GtkWidget* widget, GdkEventFocus* event, gpointer data) +void CamWnd::Cam_DrawBrush(brush_t *b, int mode) { - reinterpret_cast(data)->DisableFreeMove(); - return FALSE; -} + int nGLState = m_Camera.draw_glstate; + int nDrawMode = m_Camera.draw_mode; + int nModelMode = g_PrefsDlg.m_nEntityShowState; -void CamWnd::EnableFreeMove() -{ - //globalOutputStream() << "EnableFreeMove\n"; + GLfloat material[4], identity[4]; + VectorSet(identity, 0.8f, 0.8f, 0.8f); + IShader *pShader; - ASSERT_MESSAGE(!m_bFreeMove, "EnableFreeMove: free-move was already enabled"); - m_bFreeMove = true; - Camera_clearMovementFlags(getCamera(), MOVE_ALL); - - CamWnd_Remove_Handlers_Move(*this); - CamWnd_Add_Handlers_FreeMove(*this); - - gtk_window_set_focus(m_parent, m_gl_widget); - m_freemove_handle_focusout = g_signal_connect(G_OBJECT(m_gl_widget), "focus_out_event", G_CALLBACK(camwindow_freemove_focusout), this); - m_freezePointer.freeze_pointer(m_parent, Camera_motionDelta, &m_Camera); - - CamWnd_Update(*this); -} - -void CamWnd::DisableFreeMove() -{ - //globalOutputStream() << "DisableFreeMove\n"; - - ASSERT_MESSAGE(m_bFreeMove, "DisableFreeMove: free-move was not enabled"); - m_bFreeMove = false; - Camera_clearMovementFlags(getCamera(), MOVE_ALL); - - CamWnd_Remove_Handlers_FreeMove(*this); - CamWnd_Add_Handlers_Move(*this); - - m_freezePointer.unfreeze_pointer(m_parent); - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_freemove_handle_focusout); - - CamWnd_Update(*this); -} - - -#include "renderer.h" - -class CamRenderer: public Renderer -{ - struct state_type + // lights + if (b->owner->eclass->fixedsize && b->owner->eclass->nShowFlags & ECLASS_LIGHT && g_PrefsDlg.m_bNewLightDraw) { - state_type() : m_highlight(0), m_state(0), m_lights(0) - { - } - unsigned int m_highlight; - Shader* m_state; - const LightList* m_lights; - }; + switch (mode) + { + case DRAW_SOLID: + VectorCopy(b->owner->color, material); + VectorScale(material, 0.8f, material); + material[3] = 1.0f; - std::vector m_state_stack; - RenderStateFlags m_globalstate; - Shader* m_state_select0; - Shader* m_state_select1; - const Vector3& m_viewer; + qglColor4fv(material); + + if (g_PrefsDlg.m_bNewLightDraw) + DrawLight(b->owner, nGLState, (IsBrushSelected(b)) ? g_PrefsDlg.m_nLightRadiuses : 0, 0); -public: - CamRenderer(RenderStateFlags globalstate, Shader* select0, Shader* select1, const Vector3& viewer) : - m_globalstate(globalstate), - m_state_select0(select0), - m_state_select1(select1), - m_viewer(viewer) - { - ASSERT_NOTNULL(select0); - ASSERT_NOTNULL(select1); - m_state_stack.push_back(state_type()); + break; + } } - void SetState(Shader* state, EStyle style) + // models + else if(b->owner->eclass->fixedsize && b->owner->model.pRender + && !(!IsBrushSelected(b) && (nModelMode & ENTITY_SELECTED_ONLY))) { - ASSERT_NOTNULL(state); - if(style == eFullMaterials) - { - m_state_stack.back().m_state = state; + switch (mode) + { + case DRAW_TEXTURED: + if (!(nModelMode & ENTITY_WIREFRAME) && nModelMode != ENTITY_BOX) + { + VectorCopy(b->owner->eclass->color, material); + material[3] = identity[3] = 1.0f; + + qglEnable(GL_CULL_FACE); + + if(!(nGLState & DRAW_GL_TEXTURE_2D)) qglColor4fv(material); + else qglColor4fv(identity); + if(nGLState & DRAW_GL_LIGHTING) qglShadeModel(GL_SMOOTH); + + b->owner->model.pRender->Draw(nGLState, DRAW_RF_CAM); + } + break; + case DRAW_WIRE: + VectorCopy(b->owner->eclass->color, material); + material[3] = 1.0f; + qglColor4fv(material); + + // model view mode "wireframe" or "selected wire" + if(nModelMode & ENTITY_WIREFRAME) + b->owner->model.pRender->Draw(nGLState, DRAW_RF_CAM); + + // model view mode "skinned and boxed" + if(!(b->owner->eclass->nShowFlags & ECLASS_MISCMODEL) ) + { + qglColor4fv(material); + aabb_draw(b->owner->model.pRender->GetAABB(), DRAW_GL_WIRE); + } + else if(nModelMode & ENTITY_BOXED) + { + aabb_draw(b->owner->model.pRender->GetAABB(), DRAW_GL_WIRE); + } +/* + if(!(nModelMode & ENTITY_BOXED) && b->owner->eclass->nShowFlags & ECLASS_MISCMODEL) + DrawModelOrigin(b); +*/ + } + } + + // patches + else if (b->patchBrush) + { + bool bTrans = (b->pPatch->pShader->getTrans() < 1.0f); + switch(mode) + { + case DRAW_TEXTURED: + if (!g_bPatchWireFrame && ((nGLState & DRAW_GL_BLEND && bTrans) || (!(nGLState & DRAW_GL_BLEND) && !bTrans))) + { + qglDisable(GL_CULL_FACE); + + pShader = b->pPatch->pShader; + VectorCopy(pShader->getTexture()->color, material); + material[3] = identity[3] = pShader->getTrans(); + + if(nGLState & DRAW_GL_TEXTURE_2D) { + qglColor4fv(identity); + qglBindTexture(GL_TEXTURE_2D, pShader->getTexture()->texture_number); + } + else + qglColor4fv(material); + if(nGLState & DRAW_GL_LIGHTING) qglShadeModel(GL_SMOOTH); + + DrawPatchMesh(b->pPatch); + } + break; + case DRAW_WIRE: + if (g_bPatchWireFrame) + { + VectorCopy(b->pPatch->pShader->getTexture()->color, material); + material[3] = 1.0; + qglColor4fv(material); + DrawPatchMesh(b->pPatch); + } + if ( b->pPatch->bSelected && (g_qeglobals.d_select_mode == sel_curvepoint + || g_qeglobals.d_select_mode == sel_area + || g_bPatchBendMode)) + DrawPatchControls(b->pPatch); } } - const EStyle getStyle() const - { - return eFullMaterials; - } - void PushState() - { - m_state_stack.push_back(m_state_stack.back()); - } - void PopState() - { - ASSERT_MESSAGE(!m_state_stack.empty(), "popping empty stack"); - m_state_stack.pop_back(); - } - void Highlight(EHighlightMode mode, bool bEnable = true) - { - (bEnable) - ? m_state_stack.back().m_highlight |= mode - : m_state_stack.back().m_highlight &= ~mode; - } - void setLights(const LightList& lights) - { - m_state_stack.back().m_lights = &lights; - } - void addRenderable(const OpenGLRenderable& renderable, const Matrix4& world) - { - if(m_state_stack.back().m_highlight & ePrimitive) - { - m_state_select0->addRenderable(renderable, world, m_state_stack.back().m_lights); - } - if(m_state_stack.back().m_highlight & eFace) - { - m_state_select1->addRenderable(renderable, world, m_state_stack.back().m_lights); - } - m_state_stack.back().m_state->addRenderable(renderable, world, m_state_stack.back().m_lights); + // brushes + else if(b->owner->eclass->fixedsize) + { + switch(mode) + { + case DRAW_SOLID: + VectorCopy(b->owner->eclass->color, material); + VectorScale(material, 0.8f, material); + material[3] = 1.0f; + qglColor4fv(material); + + qglEnable(GL_CULL_FACE); + qglShadeModel(GL_FLAT); + Brush_Draw(b); + break; + case DRAW_WIRE: + if((g_qeglobals.d_savedinfo.include & INCLUDE_ANGLES) + && (b->owner->eclass->nShowFlags & ECLASS_ANGLE)) + Brush_DrawFacingAngle(b, b->owner); + } + } + + // brushes + else + { + switch(mode) + { + case DRAW_TEXTURED: + qglEnable(GL_CULL_FACE); + qglShadeModel(GL_FLAT); + Brush_Draw(b); + } + } +} + +void CamWnd::Cam_DrawBrushes(int mode) +{ + brush_t *b; + brush_t *pList = (g_bClipMode && g_pSplitList) ? g_pSplitList : &selected_brushes; + + for(b = active_brushes.next; b != &active_brushes; b=b->next) + if (!b->bFiltered && !b->bCamCulled) Cam_DrawBrush(b, mode); + for(b = pList->next; b != pList; b=b->next) + if (!b->bFiltered && !b->bCamCulled) Cam_DrawBrush(b, mode); +} + +void CamWnd::Cam_DrawStuff() +{ + GLfloat identity[4]; + VectorSet(identity, 0.8f, 0.8f, 0.8f); + brush_t *b; + + for(b = active_brushes.next; b != &active_brushes; b=b->next) + b->bCamCulled = CullBrush(b); + + for(b = selected_brushes.next; b != &selected_brushes; b=b->next) + b->bCamCulled = CullBrush(b); + + switch (m_Camera.draw_mode) + { + case cd_wire: + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_BLEND); + qglEnable(GL_DEPTH_TEST); + qglEnableClientState(GL_VERTEX_ARRAY); + qglDisableClientState(GL_TEXTURE_COORD_ARRAY); + qglShadeModel(GL_FLAT); + if(g_PrefsDlg.m_bGLLighting) { + qglDisable(GL_LIGHTING); + qglDisable(GL_COLOR_MATERIAL); + qglDisableClientState(GL_NORMAL_ARRAY); + } + m_Camera.draw_glstate = DRAW_GL_WIRE; + break; + + case cd_solid: + qglCullFace(GL_FRONT); + qglEnable(GL_CULL_FACE); + qglShadeModel (GL_FLAT); + qglPolygonMode (GL_FRONT, GL_LINE); + qglPolygonMode (GL_BACK, GL_FILL); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_BLEND); + qglEnable(GL_DEPTH_TEST); + qglEnableClientState(GL_VERTEX_ARRAY); + qglDisableClientState(GL_TEXTURE_COORD_ARRAY); + qglPolygonOffset(-1.0, 2); + if(g_PrefsDlg.m_bGLLighting) { + qglEnable(GL_LIGHTING); + qglEnable(GL_COLOR_MATERIAL); +// qglEnable(GL_RESCALE_NORMAL); + qglEnableClientState(GL_NORMAL_ARRAY); + } + m_Camera.draw_glstate = DRAW_GL_SOLID; + break; + + case cd_texture: + qglCullFace(GL_FRONT); + qglEnable(GL_CULL_FACE); + qglShadeModel (GL_FLAT); + qglPolygonMode (GL_FRONT, GL_LINE); + qglPolygonMode (GL_BACK, GL_FILL); + qglEnable(GL_TEXTURE_2D); + qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + qglDisable(GL_BLEND); + qglEnable(GL_DEPTH_TEST); + qglEnableClientState(GL_VERTEX_ARRAY); + qglEnableClientState(GL_TEXTURE_COORD_ARRAY); + if(g_PrefsDlg.m_bGLLighting) { + qglEnable(GL_LIGHTING); + qglDisable(GL_COLOR_MATERIAL); + qglMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, identity); + qglEnableClientState(GL_NORMAL_ARRAY); +// qglEnable(GL_RESCALE_NORMAL); + } + qglPolygonOffset(-1.0, 2); + m_Camera.draw_glstate = DRAW_GL_TEXTURED; + break; + + default: Sys_Printf("CamWnd::Cam_DrawStuff:invalid render mode\n"); } - void render(const Matrix4& modelview, const Matrix4& projection) - { - GlobalShaderCache().render(m_globalstate, modelview, projection, m_viewer); - } -}; + Cam_DrawBrushes(DRAW_TEXTURED); + + // setup for solid stuff + switch(m_Camera.draw_mode) + { + case cd_texture: + qglDisable(GL_TEXTURE_2D); + m_Camera.draw_glstate &= ~DRAW_GL_TEXTURE_2D; + if(g_PrefsDlg.m_bGLLighting) + qglEnable(GL_COLOR_MATERIAL); + qglDisableClientState(GL_TEXTURE_COORD_ARRAY); + break; + case cd_solid: + break; + case cd_wire: + break; + default: Sys_Printf("CamWnd::Cam_DrawStuff:invalid render mode\n"); + } + + qglEnable(GL_CULL_FACE); + qglShadeModel(GL_FLAT); + Cam_DrawBrushes(DRAW_SOLID); + + // setup for wireframe stuff + switch(m_Camera.draw_mode) + { + case cd_texture: + if(g_PrefsDlg.m_bGLLighting) { + qglDisable(GL_LIGHTING); + qglDisable(GL_COLOR_MATERIAL); + qglDisableClientState(GL_NORMAL_ARRAY); +// qglDisable(GL_RESCALE_NORMAL); + } + qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + break; + case cd_solid: + if(g_PrefsDlg.m_bGLLighting) { + qglDisable(GL_LIGHTING); + qglDisable(GL_COLOR_MATERIAL); + qglDisableClientState(GL_NORMAL_ARRAY); +// qglDisable(GL_RESCALE_NORMAL); + } + qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + break; + case cd_wire: + break; + default: Sys_Printf("CamWnd::Cam_DrawStuff:invalid render mode\n"); + } + + qglDisable(GL_CULL_FACE); + Cam_DrawBrushes(DRAW_WIRE); + + // setup for transparent texture stuff + switch(m_Camera.draw_mode) + { + case cd_texture: + qglPolygonMode (GL_FRONT, GL_LINE); + qglPolygonMode (GL_BACK, GL_FILL); + if(g_PrefsDlg.m_bGLLighting) { + qglEnable(GL_COLOR_MATERIAL); + qglEnableClientState(GL_NORMAL_ARRAY); + qglMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, identity); + } + qglEnable(GL_TEXTURE_2D); + qglEnableClientState(GL_TEXTURE_COORD_ARRAY); + m_Camera.draw_glstate = DRAW_GL_TEXTURED; + break; + case cd_solid: + qglPolygonMode (GL_FRONT, GL_LINE); + qglPolygonMode (GL_BACK, GL_FILL); + if(g_PrefsDlg.m_bGLLighting) { + qglEnable(GL_LIGHTING); + qglEnable(GL_COLOR_MATERIAL); + qglEnableClientState(GL_NORMAL_ARRAY); +// qglEnable(GL_RESCALE_NORMAL); + } + m_Camera.draw_glstate = DRAW_GL_SOLID; + break; + case cd_wire: + m_Camera.draw_glstate = DRAW_GL_WIRE; + break; + default: Sys_Printf("CamWnd::Cam_DrawStuff:invalid render mode\n"); + } + + + qglEnable(GL_BLEND); + m_Camera.draw_glstate |= DRAW_GL_BLEND; + qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // FIXME: some .TGA are buggy, have a completely empty alpha channel + // if such brushes are rendered in this loop they would be totally transparent with GL_MODULATE + // so I decided using GL_DECAL instead + // if an empty-alpha-channel or nearly-empty texture is used. It will be blank-transparent. + // this could get better if you can get qglTexEnviv (GL_TEXTURE_ENV, to work .. patches are welcome + // Arnout: empty alpha channels are now always filled with data. Don't set this anymore (would cause problems with qer_alphafunc too) +// qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + + Cam_DrawBrushes(DRAW_TEXTURED); + +// qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + qglDisable(GL_BLEND); + + // setup for wireframe stuff + switch(m_Camera.draw_mode) + { + case cd_texture: + if(g_PrefsDlg.m_bGLLighting) { + qglDisable(GL_COLOR_MATERIAL); + qglDisable(GL_LIGHTING); +// qglDisable(GL_RESCALE_NORMAL); + } + break; + case cd_solid: + if(g_PrefsDlg.m_bGLLighting) { + qglDisable(GL_COLOR_MATERIAL); + qglDisable(GL_LIGHTING); +// qglDisable(GL_RESCALE_NORMAL); + } + break; + case cd_wire: + break; + default: Sys_Printf("CamWnd::Cam_DrawStuff:invalid render mode\n"); + } + +} /* ============== @@ -1512,580 +1262,439 @@ Cam_Draw ============== */ -void ShowStatsToggle() -{ - g_camwindow_globals_private.m_showStats ^= 1; -} -typedef FreeCaller ShowStatsToggleCaller; - -void ShowStatsExport(const BoolImportCallback& importer) -{ - importer(g_camwindow_globals_private.m_showStats); -} -typedef FreeCaller1 ShowStatsExportCaller; - -ShowStatsExportCaller g_show_stats_caller; -BoolExportCallback g_show_stats_callback(g_show_stats_caller); -ToggleItem g_show_stats(g_show_stats_callback); +void QueueClear (); +void QueueDraw (); void CamWnd::Cam_Draw() { - glViewport(0, 0, m_Camera.width, m_Camera.height); + brush_t *brush; + face_t *face; + float screenaspect; + float yfov; + double start = 0.0, end; + int i; + + if (!active_brushes.next) + return; // not valid yet + + if (m_Camera.timing) + start = Sys_DoubleTime (); + + // + // clear + // + QE_CheckOpenGLForErrors(); + + qglViewport(0, 0, m_Camera.width, m_Camera.height); + qglClearColor (g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][0], + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][1], + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][2], 0); + qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // + // set up viewpoint + // + + + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity (); + + screenaspect = (float)m_Camera.width / m_Camera.height; + yfov = 2*atan((float)m_Camera.height / m_Camera.width)*180/Q_PI; + qgluPerspective (yfov, screenaspect, 8, 32768); + + // we're too lazy to calc projection matrix ourselves!!! + qglGetFloatv (GL_PROJECTION_MATRIX, &m_Camera.projection[0][0]); + + vec3_t vec; + + m4x4_identity(&m_Camera.modelview[0][0]); + VectorSet(vec, -90, 0, 0); + m4x4_rotate_by_vec3(&m_Camera.modelview[0][0], vec, eXYZ); + VectorSet(vec, 0, 0, 90); + m4x4_rotate_by_vec3(&m_Camera.modelview[0][0], vec, eXYZ); + VectorSet(vec, 0, m_Camera.angles[0], 0); + m4x4_rotate_by_vec3(&m_Camera.modelview[0][0], vec, eXYZ); + VectorSet(vec, 0, 0, -m_Camera.angles[1]); + m4x4_rotate_by_vec3(&m_Camera.modelview[0][0], vec, eXYZ); + VectorSet(vec, -m_Camera.origin[0], -m_Camera.origin[1], -m_Camera.origin[2]); + m4x4_translate_by_vec3(&m_Camera.modelview[0][0], vec); + + Cam_BuildMatrix (); + + qglMatrixMode(GL_MODELVIEW); + qglLoadIdentity(); + + qglMultMatrixf(&m_Camera.modelview[0][0]); + + // grab the GL_PROJECTION and GL_MODELVIEW matrixes + // used in GetRelativeAxes + //qglGetFloatv (GL_PROJECTION_MATRIX, &m_Camera.projection[0][0]); + //qglGetFloatv (GL_MODELVIEW_MATRIX, &m_Camera.modelview[0][0]); + #if 0 + // TTimo: this is not used, just for verification (0, 0, m_Camera.width, m_Camera.height) GLint viewprt[4]; - glGetIntegerv (GL_VIEWPORT, viewprt); + qglGetIntegerv (GL_VIEWPORT, viewprt); #endif - // enable depth buffer writes - glDepthMask(GL_TRUE); - - Vector3 clearColour(0, 0, 0); - if(m_Camera.draw_mode != cd_lighting) - { - clearColour = g_camwindow_globals.color_cameraback; - } - - glClearColor(clearColour[0], clearColour[1], clearColour[2], 0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - extern void Renderer_ResetStats(); - Renderer_ResetStats(); - extern void Cull_ResetStats(); - Cull_ResetStats(); - - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(reinterpret_cast(&m_Camera.projection)); - - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(reinterpret_cast(&m_Camera.modelview)); - - - // one directional light source directly behind the viewer + if (g_PrefsDlg.m_bGLLighting) { GLfloat inverse_cam_dir[4], ambient[4], diffuse[4];//, material[4]; - ambient[0] = ambient[1] = ambient[2] = 0.4f; + ambient[0] = ambient[1] = ambient[2] = 0.6f; ambient[3] = 1.0f; diffuse[0] = diffuse[1] = diffuse[2] = 0.4f; diffuse[3] = 1.0f; //material[0] = material[1] = material[2] = 0.8f; //material[3] = 1.0f; - inverse_cam_dir[0] = m_Camera.vpn[0]; - inverse_cam_dir[1] = m_Camera.vpn[1]; - inverse_cam_dir[2] = m_Camera.vpn[2]; + vec3_t vCam, vRotate; + VectorSet(vCam, -1, 0, 0); //default cam pos + VectorSet(vRotate, 0, -m_Camera.angles[0], 0); + VectorRotate(vCam, vRotate, vCam); + VectorSet(vRotate, 0, 0, m_Camera.angles[1]); + VectorRotate(vCam, vRotate, vCam); + + inverse_cam_dir[0] = vCam[0]; + inverse_cam_dir[1] = vCam[1]; + inverse_cam_dir[2] = vCam[2]; inverse_cam_dir[3] = 0; - glLightfv(GL_LIGHT0, GL_POSITION, inverse_cam_dir); + qglColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + qglLightfv(GL_LIGHT0, GL_POSITION, inverse_cam_dir); - glEnable(GL_LIGHT0); + qglLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + qglLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + + qglEnable(GL_LIGHT0); } + InitCull (); - unsigned int globalstate = RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_ALPHATEST|RENDER_BLEND|RENDER_CULLFACE|RENDER_COLOURARRAY|RENDER_OFFSETLINE|RENDER_POLYGONSMOOTH|RENDER_LINESMOOTH|RENDER_FOG|RENDER_COLOURCHANGE; - switch (m_Camera.draw_mode) + // + // draw stuff + // + + Cam_DrawStuff(); + + qglEnableClientState(GL_VERTEX_ARRAY); + qglDisableClientState(GL_NORMAL_ARRAY); + qglDisableClientState(GL_TEXTURE_COORD_ARRAY); + qglDisable (GL_TEXTURE_2D); + qglDisable (GL_LIGHTING); + qglDisable (GL_COLOR_MATERIAL); + + qglEnable (GL_CULL_FACE); + + brush_t* pList = (g_bClipMode && g_pSplitList) ? g_pSplitList : &selected_brushes; + + if (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_BSEL) { - case cd_wire: - break; - case cd_solid: - globalstate |= RENDER_FILL - | RENDER_LIGHTING - | RENDER_SMOOTH - | RENDER_SCALED; - break; - case cd_texture: - globalstate |= RENDER_FILL - | RENDER_LIGHTING - | RENDER_TEXTURE - | RENDER_SMOOTH - | RENDER_SCALED; - break; - case cd_lighting: - globalstate |= RENDER_FILL - | RENDER_LIGHTING - | RENDER_TEXTURE - | RENDER_SMOOTH - | RENDER_SCALED - | RENDER_BUMP - | RENDER_PROGRAM - | RENDER_SCREEN; - break; - default: - globalstate = 0; - break; - } + qglColor4f(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][0], g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1], g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2], 0.3f); + qglEnable (GL_BLEND); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglDepthFunc (GL_LEQUAL); + for (brush = pList->next ; brush != pList ; brush=brush->next) + { + if (brush->bCamCulled) // draw selected faces of filtered brushes to remind that there is a selection + continue; - if(!g_xywindow_globals.m_bNoStipple) + if (brush->patchBrush && (g_qeglobals.d_select_mode == sel_curvepoint || g_qeglobals.d_select_mode == sel_area)) + continue; + + if (!g_PrefsDlg.m_bPatchBBoxSelect && brush->patchBrush) + { + DrawPatchMesh(brush->pPatch); + } + else if(brush->owner->model.pRender && g_PrefsDlg.m_nEntityShowState != ENTITY_BOX) + { + brush->owner->model.pRender->Draw(DRAW_GL_FLAT, (DRAW_RF_SEL_OUTLINE|DRAW_RF_CAM)); + } + else + { + for (face=brush->brush_faces ; face ; face=face->next) + Brush_FaceDraw(face, DRAW_GL_FLAT); + } + } + + + int nCount = g_ptrSelectedFaces.GetSize(); + if (nCount > 0) + { + for (int i = 0; i < nCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + Brush_FaceDraw(selFace, DRAW_GL_FLAT); + } + } + + qglDisableClientState(GL_NORMAL_ARRAY); + qglDepthFunc (GL_LESS); + } + + if (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF) { - globalstate |= RENDER_LINESTIPPLE|RENDER_POLYGONSTIPPLE; + // non-zbuffered outline + qglDisable (GL_BLEND); + qglDisable (GL_DEPTH_TEST); + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglColor3f (1, 1, 1); + for (brush = pList->next ; brush != pList ; brush=brush->next) + { + if ((brush->patchBrush && (g_qeglobals.d_select_mode == sel_curvepoint || g_qeglobals.d_select_mode == sel_area))) + continue; + + if (!g_PrefsDlg.m_bPatchBBoxSelect && brush->patchBrush) + { + DrawPatchMesh(brush->pPatch); + } + else if(brush->owner->model.pRender && g_PrefsDlg.m_nEntityShowState != ENTITY_BOX) + { + brush->owner->model.pRender->Draw(DRAW_GL_WIRE, (DRAW_RF_SEL_FILL|DRAW_RF_CAM)); + + // Hydra : always draw bbox outline! + aabb_draw(brush->owner->model.pRender->GetAABB(), DRAW_GL_WIRE); + } + else + { + for (face=brush->brush_faces ; face ; face=face->next) + Brush_FaceDraw(face, DRAW_GL_WIRE); + } + } } + // edge / vertex flags + if (g_qeglobals.d_select_mode == sel_vertex) { - CamRenderer renderer(globalstate, m_state_select2, m_state_select1, m_view.getViewer()); - - Scene_Render(renderer, m_view); - - renderer.render(m_Camera.modelview, m_Camera.projection); + // GL_POINTS on Kyro Workaround + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + // brush verts + qglPointSize (4); + qglColor3f (0,1,0); + qglBegin (GL_POINTS); + for (i=0 ; i(m_Camera.height) - 1.0f, 0.0f); - extern const char* Renderer_GetStats(); - GlobalOpenGL().drawString(Renderer_GetStats()); +#if 0 + if ((g_qeglobals.d_select_mode == sel_area) && (g_nPatchClickedView == W_CAMERA)) + { + // setup orthographic projection mode + qglMatrixMode(GL_PROJECTION); + //qglPushMatrix(); + qglLoadIdentity(); + qglDisable(GL_DEPTH_TEST); + qglOrtho(0, (float)m_Camera.width, 0, (float)m_Camera.height, -100, 100); + //qglScalef(1, -1, 1); + //qglTranslatef(0, -(float)m_Camera.height, 0); + qglMatrixMode(GL_MODELVIEW); - glRasterPos3f(1.0f, static_cast(m_Camera.height) - 11.0f, 0.0f); - extern const char* Cull_GetStats(); - GlobalOpenGL().drawString(Cull_GetStats()); - } + // area selection hack + qglLoadIdentity(); + qglDisable(GL_CULL_FACE); + qglEnable (GL_BLEND); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglColor4f(0.0, 0.0, 1.0, 0.25); + qglRectf(g_qeglobals.d_vAreaTL[0], g_qeglobals.d_vAreaTL[1], g_qeglobals.d_vAreaBR[0], g_qeglobals.d_vAreaBR[1]); + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglDisable (GL_BLEND); + qglEnable (GL_CULL_FACE); + } +#endif // bind back to the default texture so that we don't have problems // elsewhere using/modifying texture maps between contexts - glBindTexture( GL_TEXTURE_2D, 0 ); -} + qglBindTexture( GL_TEXTURE_2D, 0 ); -void CamWnd::draw() -{ - m_drawing = true; - - //globalOutputStream() << "draw...\n"; - if (glwidget_make_current(m_gl_widget) != FALSE) + qglFinish(); + QE_CheckOpenGLForErrors(); + // Sys_EndWait(); + if (m_Camera.timing) { - if(Map_Valid(g_map) && ScreenUpdates_Enabled()) - { - GlobalOpenGL_debugAssertNoErrors(); - Cam_Draw(); - GlobalOpenGL_debugAssertNoErrors(); - //qglFinish(); - - m_XORRectangle.set(rectangle_t()); - } - - glwidget_swap_buffers(m_gl_widget); + end = Sys_DoubleTime (); + Sys_Printf ("Camera: %i ms\n", (int)(1000*(end-start))); } - m_drawing = false; + for (brush = active_brushes.next ; brush != &active_brushes ; brush=brush->next) + brush->bCamCulled = false; + + for (brush = pList->next ; brush != pList ; brush=brush->next) + brush->bCamCulled = false; +} + +void CamWnd::OnExpose () +{ + if (!MakeCurrent ()) + { + Sys_Printf("ERROR: glXMakeCurrent failed..\n "); + Sys_Printf("Please restart Radiant if the camera view is not working\n"); + } + else + { + QE_CheckOpenGLForErrors(); + g_pSplitList = NULL; + if (g_bClipMode) + { + if (g_Clip1.Set() && g_Clip2.Set()) + { + g_pSplitList = (g_bSwitch) ? + &g_brBackSplits : &g_brFrontSplits; + } + } + + Patch_LODMatchAll(); // spog + + Cam_Draw (); + QE_CheckOpenGLForErrors (); + + m_XORRectangle.set(rectangle_t()); + SwapBuffers (); + } } void CamWnd::BenchMark() { - double dStart = Sys_DoubleTime(); + if (!MakeCurrent ()) + Error ("glXMakeCurrent failed in Benchmark"); + + qglDrawBuffer (GL_FRONT); + double dStart = Sys_DoubleTime (); for (int i=0 ; i < 100 ; i++) { - Vector3 angles; - angles[CAMERA_ROLL] = 0; - angles[CAMERA_PITCH] = 0; - angles[CAMERA_YAW] = static_cast(i * (360.0 / 100.0)); - Camera_setAngles(*this, angles); + m_Camera.angles[YAW] = i*4; + Cam_Draw(); } - double dEnd = Sys_DoubleTime(); - globalOutputStream() << FloatFormat(dEnd - dStart, 5, 2), " seconds\n"; -} - - -void fill_view_camera_menu(GtkMenu* menu) -{ - create_check_menu_item_with_mnemonic(menu, "Camera View", "ToggleCamera"); -} - -void GlobalCamera_ResetAngles() -{ - CamWnd& camwnd = *g_camwnd; - Vector3 angles; - angles[CAMERA_ROLL] = angles[CAMERA_PITCH] = 0; - angles[CAMERA_YAW] = static_cast(22.5 * floor((Camera_getAngles(camwnd)[CAMERA_YAW]+11)/22.5)); - Camera_setAngles(camwnd, angles); -} - -void Camera_ChangeFloorUp() -{ - CamWnd& camwnd = *g_camwnd; - camwnd.Cam_ChangeFloor (true); -} - -void Camera_ChangeFloorDown() -{ - CamWnd& camwnd = *g_camwnd; - camwnd.Cam_ChangeFloor (false); -} - -void Camera_CubeIn() -{ - CamWnd& camwnd = *g_camwnd; - g_camwindow_globals.m_nCubicScale--; - if (g_camwindow_globals.m_nCubicScale < 1) - g_camwindow_globals.m_nCubicScale = 1; - Camera_updateProjection(camwnd.getCamera()); - CamWnd_Update(camwnd); - g_pParentWnd->SetGridStatus(); -} - -void Camera_CubeOut() -{ - CamWnd& camwnd = *g_camwnd; - g_camwindow_globals.m_nCubicScale++; - if (g_camwindow_globals.m_nCubicScale > 23) - g_camwindow_globals.m_nCubicScale = 23; - Camera_updateProjection(camwnd.getCamera()); - CamWnd_Update(camwnd); - g_pParentWnd->SetGridStatus(); -} - -bool Camera_GetFarClip() -{ - return g_camwindow_globals_private.m_bCubicClipping; -} - -BoolExportCaller g_getfarclip_caller(g_camwindow_globals_private.m_bCubicClipping); -ToggleItem g_getfarclip_item(g_getfarclip_caller); - -void Camera_SetFarClip(bool value) -{ - CamWnd& camwnd = *g_camwnd; - g_camwindow_globals_private.m_bCubicClipping = value; - g_getfarclip_item.update(); - Camera_updateProjection(camwnd.getCamera()); - CamWnd_Update(camwnd); -} - -void Camera_ToggleFarClip() -{ - Camera_SetFarClip(!Camera_GetFarClip()); -} - - -void CamWnd_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_toggle_button(toolbar, "Cubic clip the camera view (\\)", "view_cubicclipping.bmp", "ToggleCubicClip"); -} - -void CamWnd_registerShortcuts() -{ - toggle_add_accelerator("ToggleCubicClip"); - - if(g_pGameDescription->mGameType == "doom3") - { - command_connect_accelerator("TogglePreview"); - } - - command_connect_accelerator("CameraSpeedInc"); - command_connect_accelerator("CameraSpeedDec"); -} - - -void GlobalCamera_Benchmark() -{ - CamWnd& camwnd = *g_camwnd; - camwnd.BenchMark(); -} - -void GlobalCamera_Update() -{ - CamWnd& camwnd = *g_camwnd; - CamWnd_Update(camwnd); -} - -camera_draw_mode CamWnd_GetMode() -{ - return camera_t::draw_mode; -} -void CamWnd_SetMode(camera_draw_mode mode) -{ - ShaderCache_setBumpEnabled(mode == cd_lighting); - camera_t::draw_mode = mode; - if(g_camwnd != 0) - { - CamWnd_Update(*g_camwnd); - } -} - -void CamWnd_TogglePreview(void) -{ - // gametype must be doom3 for this function to work - // if the gametype is not doom3 something is wrong with the - // global command list or somebody else calls this function. - ASSERT_MESSAGE(g_pGameDescription->mGameType == "doom3", "CamWnd_TogglePreview called although mGameType is not doom3 compatible"); - - // switch between textured and lighting mode - CamWnd_SetMode((CamWnd_GetMode() == cd_lighting) ? cd_texture : cd_lighting); -} - - -CameraModel* g_camera_model = 0; - -void CamWnd_LookThroughCamera(CamWnd& camwnd) -{ - if(g_camera_model != 0) - { - CamWnd_Add_Handlers_Move(camwnd); - g_camera_model->setCameraView(0, Callback()); - g_camera_model = 0; - Camera_updateModelview(camwnd.getCamera()); - Camera_updateProjection(camwnd.getCamera()); - CamWnd_Update(camwnd); - } -} - -inline CameraModel* Instance_getCameraModel(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -void CamWnd_LookThroughSelected(CamWnd& camwnd) -{ - if(g_camera_model != 0) - { - CamWnd_LookThroughCamera(camwnd); - } - - if(GlobalSelectionSystem().countSelected() != 0) - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - CameraModel* cameraModel = Instance_getCameraModel(instance); - if(cameraModel != 0) - { - CamWnd_Remove_Handlers_Move(camwnd); - g_camera_model = cameraModel; - g_camera_model->setCameraView(&camwnd.getCameraView(), ReferenceCaller(camwnd)); - } - } -} - -void GlobalCamera_LookThroughSelected() -{ - CamWnd_LookThroughSelected(*g_camwnd); -} - -void GlobalCamera_LookThroughCamera() -{ - CamWnd_LookThroughCamera(*g_camwnd); -} - - -void RenderModeImport(int value) -{ - switch(value) - { - case 0: - CamWnd_SetMode(cd_wire); - break; - case 1: - CamWnd_SetMode(cd_solid); - break; - case 2: - CamWnd_SetMode(cd_texture); - break; - case 3: - CamWnd_SetMode(cd_lighting); - break; - default: - CamWnd_SetMode(cd_texture); - } -} -typedef FreeCaller1 RenderModeImportCaller; - -void RenderModeExport(const IntImportCallback& importer) -{ - switch(CamWnd_GetMode()) - { - case cd_wire: - importer(0); - break; - case cd_solid: - importer(1); - break; - case cd_texture: - importer(2); - break; - case cd_lighting: - importer(3); - break; - } -} -typedef FreeCaller1 RenderModeExportCaller; - -void Camera_constructPreferences(PreferencesPage& page) -{ - page.appendSlider("Movement Speed", g_camwindow_globals_private.m_nMoveSpeed, TRUE, 0, 0, 100, MIN_CAM_SPEED, MAX_CAM_SPEED, 1, 10, 10); - page.appendCheckBox("", "Link strafe speed to movement speed", g_camwindow_globals_private.m_bCamLinkSpeed); - page.appendSlider("Rotation Speed", g_camwindow_globals_private.m_nAngleSpeed, TRUE, 0, 0, 3, 1, 180, 1, 10, 10); - page.appendCheckBox("", "Invert mouse vertical axis", g_camwindow_globals_private.m_bCamInverseMouse); - page.appendCheckBox( - "", "Discrete movement", - FreeCaller1(), - BoolExportCaller(g_camwindow_globals_private.m_bCamDiscrete) - ); - page.appendCheckBox( - "", "Enable far-clip plane", - FreeCaller1(), - BoolExportCaller(g_camwindow_globals_private.m_bCubicClipping) - ); - - if(g_pGameDescription->mGameType == "doom3") - { - const char* render_mode[] = { "Wireframe", "Flatshade", "Textured", "Lighting" }; - - page.appendCombo( - "Render Mode", - STRING_ARRAY_RANGE(render_mode), - IntImportCallback(RenderModeImportCaller()), - IntExportCallback(RenderModeExportCaller()) - ); - } - else - { - const char* render_mode[] = { "Wireframe", "Flatshade", "Textured" }; - - page.appendCombo( - "Render Mode", - STRING_ARRAY_RANGE(render_mode), - IntImportCallback(RenderModeImportCaller()), - IntExportCallback(RenderModeExportCaller()) - ); - } -} -void Camera_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Camera", "Camera View Preferences")); - Camera_constructPreferences(page); -} -void Camera_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - -#include "preferencesystem.h" -#include "stringio.h" -#include "dialog.h" - -typedef FreeCaller1 CamWndMoveDiscreteImportCaller; - -void CameraSpeed_increase() -{ - if(g_camwindow_globals_private.m_nMoveSpeed <= (MAX_CAM_SPEED - CAM_SPEED_STEP - 10)) - { - g_camwindow_globals_private.m_nMoveSpeed += CAM_SPEED_STEP; - } else { - g_camwindow_globals_private.m_nMoveSpeed = MAX_CAM_SPEED - 10; - } -} - -void CameraSpeed_decrease() -{ - if(g_camwindow_globals_private.m_nMoveSpeed >= (MIN_CAM_SPEED + CAM_SPEED_STEP)) - { - g_camwindow_globals_private.m_nMoveSpeed -= CAM_SPEED_STEP; - } else { - g_camwindow_globals_private.m_nMoveSpeed = MIN_CAM_SPEED; - } -} - -/// \brief Initialisation for things that have the same lifespan as this module. -void CamWnd_Construct() -{ - GlobalCommands_insert("CenterView", FreeCaller(), Accelerator(GDK_End)); - - GlobalToggles_insert("ToggleCubicClip", FreeCaller(), ToggleItem::AddCallbackCaller(g_getfarclip_item), Accelerator('\\', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("CubicClipZoomIn", FreeCaller(), Accelerator('[', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("CubicClipZoomOut", FreeCaller(), Accelerator(']', (GdkModifierType)GDK_CONTROL_MASK)); - - GlobalCommands_insert("UpFloor", FreeCaller(), Accelerator(GDK_Prior)); - GlobalCommands_insert("DownFloor", FreeCaller(), Accelerator(GDK_Next)); - - GlobalToggles_insert("ToggleCamera", ToggleShown::ToggleCaller(g_camera_shown), ToggleItem::AddCallbackCaller(g_camera_shown.m_item), Accelerator('C', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("LookThroughSelected", FreeCaller()); - GlobalCommands_insert("LookThroughCamera", FreeCaller()); - - if(g_pGameDescription->mGameType == "doom3") - { - GlobalCommands_insert("TogglePreview", FreeCaller(), Accelerator(GDK_F3)); - } - - GlobalCommands_insert("CameraSpeedInc", FreeCaller(), Accelerator(GDK_KP_Add, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("CameraSpeedDec", FreeCaller(), Accelerator(GDK_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK)); - - GlobalShortcuts_insert("CameraForward", Accelerator(GDK_Up)); - GlobalShortcuts_insert("CameraBack", Accelerator(GDK_Down)); - GlobalShortcuts_insert("CameraLeft", Accelerator(GDK_Left)); - GlobalShortcuts_insert("CameraRight", Accelerator(GDK_Right)); - GlobalShortcuts_insert("CameraStrafeRight", Accelerator(GDK_period)); - GlobalShortcuts_insert("CameraStrafeLeft", Accelerator(GDK_comma)); - - GlobalShortcuts_insert("CameraUp", Accelerator('D')); - GlobalShortcuts_insert("CameraDown", Accelerator('C')); - GlobalShortcuts_insert("CameraAngleUp", Accelerator('A')); - GlobalShortcuts_insert("CameraAngleDown", Accelerator('Z')); - - GlobalShortcuts_insert("CameraFreeMoveForward", Accelerator(GDK_Up)); - GlobalShortcuts_insert("CameraFreeMoveBack", Accelerator(GDK_Down)); - GlobalShortcuts_insert("CameraFreeMoveLeft", Accelerator(GDK_Left)); - GlobalShortcuts_insert("CameraFreeMoveRight", Accelerator(GDK_Right)); - - GlobalToggles_insert("ShowStats", ShowStatsToggleCaller(), ToggleItem::AddCallbackCaller(g_show_stats)); - - GlobalPreferenceSystem().registerPreference("ShowStats", BoolImportStringCaller(g_camwindow_globals_private.m_showStats), BoolExportStringCaller(g_camwindow_globals_private.m_showStats)); - GlobalPreferenceSystem().registerPreference("MoveSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nMoveSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nMoveSpeed)); - GlobalPreferenceSystem().registerPreference("CamLinkSpeed", BoolImportStringCaller(g_camwindow_globals_private.m_bCamLinkSpeed), BoolExportStringCaller(g_camwindow_globals_private.m_bCamLinkSpeed)); - GlobalPreferenceSystem().registerPreference("AngleSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nAngleSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nAngleSpeed)); - GlobalPreferenceSystem().registerPreference("CamInverseMouse", BoolImportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse), BoolExportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse)); - GlobalPreferenceSystem().registerPreference("CamDiscrete", makeBoolStringImportCallback(CamWndMoveDiscreteImportCaller()), BoolExportStringCaller(g_camwindow_globals_private.m_bCamDiscrete)); - GlobalPreferenceSystem().registerPreference("CubicClipping", BoolImportStringCaller(g_camwindow_globals_private.m_bCubicClipping), BoolExportStringCaller(g_camwindow_globals_private.m_bCubicClipping)); - GlobalPreferenceSystem().registerPreference("CubicScale", IntImportStringCaller(g_camwindow_globals.m_nCubicScale), IntExportStringCaller(g_camwindow_globals.m_nCubicScale)); - GlobalPreferenceSystem().registerPreference("SI_Colors4", Vector3ImportStringCaller(g_camwindow_globals.color_cameraback), Vector3ExportStringCaller(g_camwindow_globals.color_cameraback)); - GlobalPreferenceSystem().registerPreference("SI_Colors12", Vector3ImportStringCaller(g_camwindow_globals.color_selbrushes3d), Vector3ExportStringCaller(g_camwindow_globals.color_selbrushes3d)); - GlobalPreferenceSystem().registerPreference("CameraRenderMode", makeIntStringImportCallback(RenderModeImportCaller()), makeIntStringExportCallback(RenderModeExportCaller())); - - CamWnd_constructStatic(); - - Camera_registerPreferencesPage(); -} -void CamWnd_Destroy() -{ - CamWnd_destroyStatic(); + SwapBuffers (); + qglDrawBuffer (GL_BACK); + double dEnd = Sys_DoubleTime (); + Sys_Printf ("%5.2f seconds\n", dEnd - dStart); } diff --git a/radiant/camwindow.h b/radiant/camwindow.h index 2c8c59f7..e352d26a 100644 --- a/radiant/camwindow.h +++ b/radiant/camwindow.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,69 +19,153 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_CAMWINDOW_H) -#define INCLUDED_CAMWINDOW_H +#ifndef _CAMWINDOW_H_ +#define _CAMWINDOW_H_ -#include "math/vector.h" -#include "signal/signalfwd.h" +class XYWnd; -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; +#include "glwindow.h" -class CamWnd; -CamWnd* NewCamWnd(); -void DeleteCamWnd(CamWnd* camwnd); - -void AddCameraMovedCallback(const SignalHandler& handler); - -void CamWnd_Update(CamWnd& camwnd); - -GtkWidget* CamWnd_getWidget(CamWnd& camwnd); -void CamWnd_setParent(CamWnd& camwnd, GtkWindow* parent); - -void GlobalCamera_setCamWnd(CamWnd& camwnd); - -typedef struct _GtkMenu GtkMenu; -void fill_view_camera_menu(GtkMenu* menu); -typedef struct _GtkToolbar GtkToolbar; -void CamWnd_constructToolbar(GtkToolbar* toolbar); -void CamWnd_registerShortcuts(); - -void GlobalCamera_Benchmark(); - -const Vector3& Camera_getOrigin(CamWnd& camwnd); -void Camera_setOrigin(CamWnd& camwnd, const Vector3& origin); - -enum +class rectangle_t { - CAMERA_PITCH = 0, // up / down - CAMERA_YAW = 1, // left / right - CAMERA_ROLL = 2, // fall over +public: + rectangle_t() + : x(0), y(0), w(0), h(0) + {} + rectangle_t(float _x, float _y, float _w, float _h) + : x(_x), y(_y), w(_w), h(_h) + {} + float x; + float y; + float w; + float h; }; -const Vector3& Camera_getAngles(CamWnd& camwnd); -void Camera_setAngles(CamWnd& camwnd, const Vector3& angles); - - -struct camwindow_globals_t +class XORRectangle { - Vector3 color_cameraback; - Vector3 color_selbrushes3d; - - int m_nCubicScale; - - camwindow_globals_t() : - color_cameraback(0.25f, 0.25f, 0.25f), - color_selbrushes3d(1.0f, 0.f, 0.f), - m_nCubicScale(13) +public: + XORRectangle(GtkWidget* widget) + : m_widget(widget), m_gc(NULL) + {} + ~XORRectangle() { + if(initialised()) + gdk_gc_unref(m_gc); + } + void set(rectangle_t rectangle) + { + lazy_init(); + draw(); + m_rectangle = rectangle; + draw(); + } +private: + bool initialised() const + { + return m_gc != NULL; + } + void lazy_init() + { + if(!initialised()) + { + m_gc = gdk_gc_new(m_widget->window); + + GdkColor color = { 0, 0xffff, 0xffff, 0xffff, }; + GdkColormap* colormap = gdk_window_get_colormap(m_widget->window); + gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE); + gdk_gc_copy(m_gc, m_widget->style->white_gc); + gdk_gc_set_foreground(m_gc, &color); + gdk_gc_set_background(m_gc, &color); + + gdk_gc_set_function(m_gc, GDK_XOR); + } + } + void draw() const + { + const int x = (int)m_rectangle.x; + const int y = (int)m_rectangle.y; + const int w = (int)m_rectangle.w; + const int h = (int)m_rectangle.h; + gdk_draw_rectangle(m_widget->window, m_gc, TRUE, x, -(h) - (y - m_widget->allocation.height), w, h); } + rectangle_t m_rectangle; + + GtkWidget* m_widget; + GdkGC* m_gc; }; -extern camwindow_globals_t g_camwindow_globals; +class CamWnd : public GLWindow +{ +public: + void MatchViewAxes(const vec3_t P, const vec3_t vec, int &axis, float &sgn); + void ReInitGL(); + void BenchMark(); + CamWnd(); + virtual ~CamWnd(); + camera_t *Camera(){return &m_Camera;}; + void Cam_MouseControl(float dtime); + void Cam_ChangeFloor(qboolean up); + void ToggleFreeMove(); + bool m_bFreeMove; -void CamWnd_Construct(); -void CamWnd_Destroy(); +protected: + void Cam_Init(); + void Cam_BuildMatrix(); + void Cam_PositionDrag(); + void Cam_KeyControl(float dtime); + void Cam_MouseDown(int x, int y, int buttons); + void Cam_MouseUp (int x, int y, int buttons); + void Cam_MouseMoved (int x, int y, int buttons); + void InitCull(); + qboolean CullBrush (brush_t *b); + void Cam_Draw(); + void Cam_DrawStuff(); + void Cam_DrawBrushes(int mode); + void Cam_DrawBrush(brush_t *b, int mode); -#endif + brush_t* m_TransBrushes[MAX_MAP_BRUSHES]; + int m_nNumTransBrushes; + camera_t m_Camera; + int m_nCambuttonstate; + int m_ptButtonX; + int m_ptCursorX; + int m_ptLastCursorX; + int m_ptLastCamCursorX; + int m_ptButtonY; + int m_ptCursorY; + int m_ptLastCursorY; + int m_ptLastCamCursorY; + face_t* m_pSide_select; + vec3_t m_vCull1; + vec3_t m_vCull2; + int m_nCullv1[3]; + int m_nCullv2[3]; + bool m_bClipMode; + guint m_FocusOutHandler_id; + + void OnCreate (); + void OnExpose (); + void OnLButtonDown (guint32 flags, int x, int y); + void OnRButtonDown (guint32 flags, int x, int y); + void OnMButtonDown (guint32 flags, int x, int y); + void OnLButtonUp (guint32 flags, int pointx, int pointy); + void OnRButtonUp (guint32 flags, int pointx, int pointy); + void OnMButtonUp (guint32 flags, int pointx, int pointy); + void OnMouseMove (guint32 flags, int pointx, int pointy); + void OnMouseWheel(bool bUp); + void OnSize(int cx, int cy); + +protected: + void OriginalMouseDown (guint32 nFlags, int pointX, int pointY); + void OriginalMouseUp (guint32 nFlags, int pointX, int pointY); + +private: + XORRectangle m_XORRectangle; + + // project a point in geometric space into camera space + void ProjectCamera(const vec3_t A, vec_t B[2]); +}; + + +#endif // _CAMWINDOW_H_ diff --git a/radiant/clippertool.cpp b/radiant/clippertool.cpp deleted file mode 100644 index a49b7246..00000000 --- a/radiant/clippertool.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "clippertool.h" - diff --git a/radiant/clippertool.h b/radiant/clippertool.h deleted file mode 100644 index 6101f1a6..00000000 --- a/radiant/clippertool.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CLIPPERTOOL_H) -#define INCLUDED_CLIPPERTOOL_H - -#endif diff --git a/radiant/commands.cpp b/radiant/commands.cpp deleted file mode 100644 index c1e1b2a3..00000000 --- a/radiant/commands.cpp +++ /dev/null @@ -1,424 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "commands.h" - -#include "debugging/debugging.h" -#include "warnings.h" - -#include -#include "string/string.h" -#include "versionlib.h" -#include "gtkutil/accelerator.h" - -typedef std::pair ShortcutValue; // accelerator, isRegistered -typedef std::map Shortcuts; - -void Shortcuts_foreach(Shortcuts& shortcuts, CommandVisitor& visitor) -{ - for(Shortcuts::iterator i = shortcuts.begin(); i != shortcuts.end(); ++i) - { - visitor.visit((*i).first.c_str(), (*i).second.first); - } -} - -Shortcuts g_shortcuts; - -const Accelerator& GlobalShortcuts_insert(const char* name, const Accelerator& accelerator) -{ - return (*g_shortcuts.insert(Shortcuts::value_type(name, ShortcutValue(accelerator, false))).first).second.first; -} - -void GlobalShortcuts_foreach(CommandVisitor& visitor) -{ - Shortcuts_foreach(g_shortcuts, visitor); -} - -void GlobalShortcuts_register(const char* name) -{ - Shortcuts::iterator i = g_shortcuts.find(name); - if(i != g_shortcuts.end()) - { - (*i).second.second = true; - } -} - -void GlobalShortcuts_reportUnregistered() -{ - for(Shortcuts::iterator i = g_shortcuts.begin(); i != g_shortcuts.end(); ++i) - { - if((*i).second.first.key != 0 && !(*i).second.second) - { - globalOutputStream() << "shortcut not registered: " << (*i).first.c_str() << "\n"; - } - } -} - -typedef std::map Commands; - -Commands g_commands; - -void GlobalCommands_insert(const char* name, const Callback& callback, const Accelerator& accelerator) -{ - bool added = g_commands.insert(Commands::value_type(name, Command(callback, GlobalShortcuts_insert(name, accelerator)))).second; - ASSERT_MESSAGE(added, "command already registered: " << makeQuoted(name)); -} - -const Command& GlobalCommands_find(const char* command) -{ - Commands::iterator i = g_commands.find(command); - ASSERT_MESSAGE(i != g_commands.end(), "failed to lookup command " << makeQuoted(command)); - return (*i).second; -} - -typedef std::map Toggles; - - -Toggles g_toggles; - -void GlobalToggles_insert(const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator) -{ - bool added = g_toggles.insert(Toggles::value_type(name, Toggle(callback, GlobalShortcuts_insert(name, accelerator), exportCallback))).second; - ASSERT_MESSAGE(added, "toggle already registered: " << makeQuoted(name)); -} -const Toggle& GlobalToggles_find(const char* name) -{ - Toggles::iterator i = g_toggles.find(name); - ASSERT_MESSAGE(i != g_toggles.end(), "failed to lookup toggle " << makeQuoted(name)); - return (*i).second; -} - -typedef std::map KeyEvents; - - -KeyEvents g_keyEvents; - -void GlobalKeyEvents_insert(const char* name, const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp) -{ - bool added = g_keyEvents.insert(KeyEvents::value_type(name, KeyEvent(GlobalShortcuts_insert(name, accelerator), keyDown, keyUp))).second; - ASSERT_MESSAGE(added, "command already registered: " << makeQuoted(name)); -} -const KeyEvent& GlobalKeyEvents_find(const char* name) -{ - KeyEvents::iterator i = g_keyEvents.find(name); - ASSERT_MESSAGE(i != g_keyEvents.end(), "failed to lookup keyEvent " << makeQuoted(name)); - return (*i).second; -} - - - - -#include - -#include -#include -#include -#include -#include - -#include "gtkutil/dialog.h" -#include "mainframe.h" - -#include "stream/textfilestream.h" -#include "stream/stringstream.h" - - -struct command_list_dialog_t : public ModalDialog -{ - command_list_dialog_t() - : m_close_button(*this, eIDCANCEL) - { - } - ModalDialogButton m_close_button; -}; - -void DoCommandListDlg() -{ - command_list_dialog_t dialog; - - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), "Mapped Commands", dialog, -1, 400); - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - - { - GtkScrolledWindow* scr = create_scrolled_window(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(scr), TRUE, TRUE, 0); - - { - GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); - - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Command", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - } - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Key", renderer, "text", 1, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - } - - gtk_widget_show(view); - gtk_container_add(GTK_CONTAINER (scr), view); - - { - // Initialize dialog - StringOutputStream path(256); - path << SettingsPath_get() << "commandlist.txt"; - globalOutputStream() << "Writing the command list to " << path.c_str() << "\n"; - class BuildCommandList : public CommandVisitor - { - TextFileOutputStream m_commandList; - GtkListStore* m_store; - public: - BuildCommandList(const char* filename, GtkListStore* store) : m_commandList(filename), m_store(store) - { - } - void visit(const char* name, Accelerator& accelerator) - { - StringOutputStream modifiers; - modifiers << accelerator; - - { - GtkTreeIter iter; - gtk_list_store_append(m_store, &iter); - gtk_list_store_set(m_store, &iter, 0, name, 1, modifiers.c_str(), -1); - } - - if(!m_commandList.failed()) - { - m_commandList << makeLeftJustified(name, 25) << " " << modifiers.c_str() << '\n'; - } - } - } visitor(path.c_str(), store); - - GlobalShortcuts_foreach(visitor); - } - - g_object_unref(G_OBJECT(store)); - } - } - - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - { - GtkButton* button = create_modal_dialog_button("Close", dialog.m_close_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_grab_focus(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - - modal_dialog_show(window, dialog); - gtk_widget_destroy(GTK_WIDGET(window)); -} - -#include "profile/profile.h" - -const char* const COMMANDS_VERSION = "1.0"; - -void SaveCommandMap(const char* path) -{ - StringOutputStream strINI(256); - strINI << path << "shortcuts.ini"; - - TextFileOutputStream file(strINI.c_str()); - if(!file.failed()) - { - file << "[Version]\n"; - file << "number=" << COMMANDS_VERSION << "\n"; - file << "\n"; - file << "[Commands]\n"; - class WriteCommandMap : public CommandVisitor - { - TextFileOutputStream& m_file; - public: - WriteCommandMap(TextFileOutputStream& file) : m_file(file) - { - } - void visit(const char* name, Accelerator& accelerator) - { - m_file << name << "="; - - const char* key = global_keys_find(accelerator.key); - if(!string_empty(key)) - { - m_file << key; - } - else if(accelerator.key != 0) - { - m_file << gdk_keyval_name(accelerator.key); - } - - if(accelerator.modifiers & GDK_MOD1_MASK) - { - m_file << "+Alt"; - } - if(accelerator.modifiers & GDK_CONTROL_MASK) - { - m_file << "+Ctrl"; - } - if(accelerator.modifiers & GDK_SHIFT_MASK) - { - m_file << "+Shift"; - } - - m_file << "\n"; - } - } visitor(file); - GlobalShortcuts_foreach(visitor); - } -} - -const char* stringrange_find(const char* first, const char* last, char c) -{ - const char* p = strchr(first, '+'); - if(p == 0) - { - return last; - } - return p; -} - -class ReadCommandMap : public CommandVisitor -{ - const char* m_filename; - std::size_t m_count; -public: - ReadCommandMap(const char* filename) : m_filename(filename), m_count(0) - { - } - void visit(const char* name, Accelerator& accelerator) - { - char value[1024]; - if (read_var(m_filename, "Commands", name, value )) - { - if(string_empty(value)) - { - accelerator.key = 0; - accelerator.modifiers = (GdkModifierType)0; - return; - } - int modifiers = 0; - const char* last = value + string_length(value); - const char* keyEnd = stringrange_find(value, last, '+'); - for(const char* modifier = keyEnd; modifier != last;) - { - const char* next = stringrange_find(modifier + 1, last, '+'); - if(next - modifier == 4 - && string_equal_nocase_n(modifier, "+alt", 4)) - { - modifiers |= GDK_MOD1_MASK; - } - else if(next - modifier == 5 - && string_equal_nocase_n(modifier, "+ctrl", 5) != 0) - { - modifiers |= GDK_CONTROL_MASK; - } - else if(next - modifier == 6 - && string_equal_nocase_n(modifier, "+shift", 6) != 0) - { - modifiers |= GDK_SHIFT_MASK; - } - else - { - globalOutputStream() << "WARNING: failed to parse user command " << makeQuoted(value) << ": unknown modifier " << makeQuoted(StringRange(modifier, next)) << "\n"; - } - modifier = next; - } - accelerator.modifiers = (GdkModifierType)modifiers; - - - // strBuff has been cleaned of it's modifiers .. switch between a regular key and a virtual one - // based on length - if(keyEnd - value == 1) // most often case.. deal with first - { - accelerator.key = std::toupper(value[0]); - ++m_count; - } - else // special key - { - CopiedString keyName(StringRange(value, keyEnd)); - accelerator.key = global_keys_find(keyName.c_str()); - if(accelerator.key != 0) - { - ++m_count; - } - else - { - globalOutputStream() << "WARNING: failed to parse user command " << makeQuoted(value) << ": unknown key " << makeQuoted(keyName.c_str()) << "\n"; - } - } - } - } - std::size_t count() const - { - return m_count; - } -}; - -void LoadCommandMap(const char* path) -{ - StringOutputStream strINI(256); - strINI << path << "shortcuts.ini"; - - FILE* f = fopen (strINI.c_str(), "r"); - if (f != 0) - { - fclose(f); - globalOutputStream() << "loading custom shortcuts list from " << makeQuoted(strINI.c_str()) << "\n"; - - Version version = version_parse(COMMANDS_VERSION); - Version dataVersion = { 0, 0 }; - - { - char value[1024]; - if(read_var(strINI.c_str(), "Version", "number", value)) - { - dataVersion = version_parse(value); - } - } - - if(version_compatible(version, dataVersion)) - { - globalOutputStream() << "commands import: data version " << dataVersion << " is compatible with code version " << version << "\n"; - ReadCommandMap visitor(strINI.c_str()); - GlobalShortcuts_foreach(visitor); - globalOutputStream() << "parsed " << Unsigned(visitor.count()) << " custom shortcuts\n"; - } - else - { - globalOutputStream() << "commands import: data version " << dataVersion << " is not compatible with code version " << version << "\n"; - } - } - else - { - globalOutputStream() << "failed to load custom shortcuts from " << makeQuoted(strINI.c_str()) << "\n"; - } -} diff --git a/radiant/commands.h b/radiant/commands.h deleted file mode 100644 index e97ec22b..00000000 --- a/radiant/commands.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_COMMANDS_H) -#define INCLUDED_COMMANDS_H - -#include "gtkutil/accelerator.h" - - -const Accelerator& GlobalShortcuts_insert(const char* name, const Accelerator& accelerator); -void GlobalShortcuts_register(const char* name); -void GlobalShortcuts_reportUnregistered(); - -class CommandVisitor -{ -public: - virtual void visit(const char* name, Accelerator& accelerator) = 0; -}; - -void GlobalCommands_insert(const char* name, const Callback& callback, const Accelerator& accelerator = accelerator_null()); -const Command& GlobalCommands_find(const char* name); - -void GlobalToggles_insert(const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator = accelerator_null()); -const Toggle& GlobalToggles_find(const char* name); - -void GlobalKeyEvents_insert(const char* name, const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp); -const KeyEvent& GlobalKeyEvents_find(const char* name); - - -void DoCommandListDlg(); - -void LoadCommandMap(const char* path); -void SaveCommandMap(const char* path); - - -#endif diff --git a/radiant/console.cpp b/radiant/console.cpp deleted file mode 100644 index 37a03428..00000000 --- a/radiant/console.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "console.h" - -#include -#include -#include -#include -#include - -#include "gtkutil/accelerator.h" -#include "gtkutil/messagebox.h" -#include "gtkutil/container.h" -#include "gtkutil/menu.h" -#include "gtkutil/nonmodal.h" -#include "stream/stringstream.h" -#include "convert.h" - -#include "version.h" -#include "aboutmsg.h" -#include "gtkmisc.h" -#include "mainframe.h" - -// handle to the console log file -namespace -{ - FILE* g_hLogFile; -} - -bool g_Console_enableLogging = false; - -// called whenever we need to open/close/check the console log file -void Sys_LogFile(bool enable) -{ - if (enable && !g_hLogFile) - { - // settings say we should be logging and we don't have a log file .. so create it - // open a file to log the console (if user prefs say so) - // the file handle is g_hLogFile - // the log file is erased - StringOutputStream name(256); - name << SettingsPath_get() << "radiant.log"; - g_hLogFile = fopen( name.c_str(), "w" ); - if (g_hLogFile != 0) - { - globalOutputStream() << "Started logging to " << name.c_str() << "\n"; - time_t localtime; - time(&localtime); - globalOutputStream() << "Today is: " << ctime(&localtime) - << "This is GtkRadiant '" RADIANT_VERSION "' compiled " __DATE__ "\n" RADIANT_ABOUTMSG "\n"; - } - else - gtk_MessageBox (0, "Failed to create log file, check write permissions in Radiant directory.\n", - "Console logging", eMB_OK, eMB_ICONERROR ); - } - else if (!enable && g_hLogFile != 0) - { - // settings say we should not be logging but still we have an active logfile .. close it - time_t localtime; - time(&localtime); - globalOutputStream() << "Closing log file at " << ctime(&localtime) << "\n"; - fclose( g_hLogFile ); - g_hLogFile = 0; - } -} - -GtkWidget* g_console = 0; - -void console_clear() -{ - GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(g_console)); - gtk_text_buffer_set_text(buffer, "", -1); -} - -void console_populate_popup(GtkTextView* textview, GtkMenu* menu, gpointer user_data) -{ - menu_separator(menu); - - GtkWidget* item = gtk_menu_item_new_with_label ("Clear"); - g_signal_connect(G_OBJECT (item), "activate", G_CALLBACK(console_clear), 0); - gtk_widget_show (item); - container_add_widget(GTK_CONTAINER(menu), item); -} - -gboolean destroy_set_null(GtkWindow* widget, GtkWidget** p) -{ - *p = 0; - return FALSE; -} - -WidgetFocusPrinter g_consoleWidgetFocusPrinter("console"); - -GtkWidget* Console_constructWindow(GtkWindow* toplevel) -{ - GtkWidget* scr = gtk_scrolled_window_new (0, 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); - gtk_widget_show(scr); - - { - GtkWidget* text = gtk_text_view_new(); - gtk_widget_set_size_request(text, 0, -1); // allow shrinking - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD); - gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE); - gtk_container_add(GTK_CONTAINER (scr), text); - gtk_widget_show(text); - g_console = text; - - //globalExtendedASCIICharacterSet().print(); - - widget_connect_escape_clear_focus_widget(g_console); - - //g_consoleWidgetFocusPrinter.connect(g_console); - - g_signal_connect(G_OBJECT(g_console), "populate-popup", G_CALLBACK(console_populate_popup), 0); - g_signal_connect(G_OBJECT(g_console), "destroy", G_CALLBACK(destroy_set_null), &g_console); - } - - gtk_container_set_focus_chain(GTK_CONTAINER(scr), NULL); - - return scr; -} - -class GtkTextBufferOutputStream : public TextOutputStream -{ - GtkTextBuffer* textBuffer; - GtkTextIter* iter; - GtkTextTag* tag; -public: - GtkTextBufferOutputStream(GtkTextBuffer* textBuffer, GtkTextIter* iter, GtkTextTag* tag) : textBuffer(textBuffer), iter(iter), tag(tag) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - gtk_text_buffer_insert_with_tags(textBuffer, iter, buffer, gint(length), tag, 0); - return length; - } -}; - -std::size_t Sys_Print(int level, const char* buf, std::size_t length) -{ - bool contains_newline = std::find(buf, buf+length, '\n') != buf+length; - - if(level == SYS_ERR) - { - Sys_LogFile(true); - } - - if (g_hLogFile != 0) - { - fwrite(buf, 1, length, g_hLogFile); - if(contains_newline) - { - fflush(g_hLogFile); - } - } - - if (level != SYS_NOCON) - { - if (g_console != 0) - { - GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(g_console)); - - GtkTextIter iter; - gtk_text_buffer_get_end_iter(buffer, &iter); - - static GtkTextMark* end = gtk_text_buffer_create_mark(buffer, "end", &iter, FALSE); - - const GdkColor yellow = { 0, 0xb0ff, 0xb0ff, 0x0000 }; - const GdkColor red = { 0, 0xffff, 0x0000, 0x0000 }; - const GdkColor black = { 0, 0x0000, 0x0000, 0x0000 }; - - static GtkTextTag* error_tag = gtk_text_buffer_create_tag (buffer, "red_foreground", "foreground-gdk", &red, 0); - static GtkTextTag* warning_tag = gtk_text_buffer_create_tag (buffer, "yellow_foreground", "foreground-gdk", &yellow, 0); - static GtkTextTag* standard_tag = gtk_text_buffer_create_tag (buffer, "black_foreground", "foreground-gdk", &black, 0); - GtkTextTag* tag; - switch (level) - { - case SYS_WRN: - tag = warning_tag; - break; - case SYS_ERR: - tag = error_tag; - break; - case SYS_STD: - case SYS_VRB: - default: - tag = standard_tag; - break; - } - - - { - GtkTextBufferOutputStream textBuffer(buffer, &iter, tag); - if(!globalCharacterSet().isUTF8()) - { - BufferedTextOutputStream buffered(textBuffer); - buffered << ConvertLocaleToUTF8(StringRange(buf, buf + length)); - } - else - { - textBuffer << StringRange(buf, buf + length); - } - } - - // update console widget immediatly if we're doing something time-consuming - if(contains_newline) - { - gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(g_console), end); - - if(!ScreenUpdates_Enabled() && GTK_WIDGET_REALIZED(g_console)) - { - ScreenUpdates_process(); - } - } - } - } - return length; -} - - -class SysPrintOutputStream : public TextOutputStream -{ -public: - std::size_t write(const char* buffer, std::size_t length) - { - return Sys_Print(SYS_STD, buffer, length); - } -}; - -class SysPrintErrorStream : public TextOutputStream -{ -public: - std::size_t write(const char* buffer, std::size_t length) - { - return Sys_Print(SYS_ERR, buffer, length); - } -}; - -SysPrintOutputStream g_outputStream; - -TextOutputStream& getSysPrintOutputStream() -{ - return g_outputStream; -} - -SysPrintErrorStream g_errorStream; - -TextOutputStream& getSysPrintErrorStream() -{ - return g_errorStream; -} - - diff --git a/radiant/console.h b/radiant/console.h deleted file mode 100644 index 4e79782e..00000000 --- a/radiant/console.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_CONSOLE_H) -#define INCLUDED_CONSOLE_H - -#include - -#define SYS_VRB 0 ///< verbose support (on/off) -#define SYS_STD 1 ///< standard print level - this is the default -#define SYS_WRN 2 ///< warnings -#define SYS_ERR 3 ///< error -#define SYS_NOCON 4 ///< no console, only print to the file (useful whenever Sys_Printf and output IS the problem) - -std::size_t Sys_Print(int level, const char* buf, std::size_t length); -class TextOutputStream; -TextOutputStream& getSysPrintOutputStream(); -TextOutputStream& getSysPrintErrorStream(); - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -GtkWidget* Console_constructWindow(GtkWindow* toplevel); - -// will open/close the log file based on the parameter -void Sys_LogFile(bool enable); -extern bool g_Console_enableLogging; - - -#endif diff --git a/radiant/csg.cpp b/radiant/csg.cpp index f30fb980..f5da8b74 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,138 +19,9 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "csg.h" - -#include "debugging/debugging.h" - -#include - -#include "map.h" -#include "brushmanip.h" -#include "brushnode.h" -#include "grid.h" - -void Face_makeBrush(Face& face, const Brush& brush, brush_vector_t& out, float offset) -{ - if(face.contributes()) - { - out.push_back(new Brush(brush)); - Face* newFace = out.back()->addFace(face); - if(newFace != 0) - { - newFace->flipWinding(); - newFace->getPlane().offset(offset); - newFace->planeChanged(); - } - } -} - -class FaceMakeBrush -{ - const Brush& brush; - brush_vector_t& out; - float offset; -public: - FaceMakeBrush(const Brush& brush, brush_vector_t& out, float offset) - : brush(brush), out(out), offset(offset) - { - } - void operator()(Face& face) const - { - Face_makeBrush(face, brush, out, offset); - } -}; - -void Brush_makeHollow(const Brush& brush, brush_vector_t& out, float offset) -{ - Brush_forEachFace(brush, FaceMakeBrush(brush, out, offset)); -} - -class BrushHollowSelectedWalker : public scene::Graph::Walker -{ - float m_offset; -public: - BrushHollowSelectedWalker(float offset) - : m_offset(offset) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 - && Instance_getSelectable(instance)->isSelected() - && path.size() > 1) - { - brush_vector_t out; - Brush_makeHollow(*brush, out, m_offset); - for(brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i) - { - (*i)->removeEmptyFaces(); - NodeSmartReference node((new BrushNode())->node()); - Node_getBrush(node)->copy(*(*i)); - delete (*i); - Node_getTraversable(path.parent())->insert(node); - } - } - } - return true; - } -}; - -typedef std::list brushlist_t; - -class BrushGatherSelected : public scene::Graph::Walker -{ - brush_vector_t& m_brushlist; -public: - BrushGatherSelected(brush_vector_t& brushlist) - : m_brushlist(brushlist) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 - && Instance_getSelectable(instance)->isSelected()) - { - m_brushlist.push_back(brush); - } - } - return true; - } -}; - -class BrushDeleteSelected : public scene::Graph::Walker -{ -public: - bool pre(const scene::Path& path, scene::Instance& instance) const - { - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 - && Instance_getSelectable(instance)->isSelected() - && path.size() > 1) - { - Path_deleteTop(path); - } - } - } -}; - -void Scene_BrushMakeHollow_Selected(scene::Graph& graph) -{ - GlobalSceneGraph().traverse(BrushHollowSelectedWalker(GetGridSize())); - GlobalSceneGraph().traverse(BrushDeleteSelected()); -} +#include "stdafx.h" +#include "winding.h" +#include "filters.h" /* ============= @@ -158,394 +29,557 @@ CSG_MakeHollow ============= */ +void Brush_Scale(brush_t* b) +{ + for (face_t* f = b->brush_faces ; f ; f=f->next) + { + for (int i=0 ; i<3 ; i++) + { + VectorScale (f->planepts[i], g_qeglobals.d_gridsize, f->planepts[i]); + } + } +} + void CSG_MakeHollow (void) { - UndoableCommand undo("brushHollow"); + brush_t *b, *front, *back, *next; + face_t *f; + face_t split; + vec3_t move; + int i; - Scene_BrushMakeHollow_Selected(GlobalSceneGraph()); + for (b = selected_brushes.next ; b != &selected_brushes ; b=next) + { + next = b->next; - SceneChangeNotify(); + if (b->owner->eclass->fixedsize || b->patchBrush || b->bFiltered) + continue; + + for (f = b->brush_faces ; f ; f=f->next) + { + split = *f; + VectorScale (f->plane.normal, g_qeglobals.d_gridsize, move); + for (i=0 ; i<3 ; i++) + VectorSubtract (split.planepts[i], move, split.planepts[i]); + + Brush_SplitBrushByFace (b, &split, &front, &back); + if (back) + Brush_Free (back); + if (front) + Brush_AddToList (front, &selected_brushes); + } + Brush_Free (b); + } + Sys_UpdateWindows (W_ALL); } -template -class RemoveReference -{ -public: - typedef Type type; -}; +/* +============= +Brush_Merge -template -class RemoveReference -{ -public: - typedef Type type; -}; + Returns a new brush that is created by merging brush1 and brush2. + May return NULL if brush1 and brush2 do not create a convex brush when merged. + The input brushes brush1 and brush2 stay intact. -template -class Dereference + if onlyshape is true then the merge is allowed based on the shape only + otherwise the texture/shader references of faces in the same plane have to + be the same as well. +============= +*/ +brush_t *Brush_Merge(brush_t *brush1, brush_t *brush2, int onlyshape) { - const Functor& functor; -public: - typedef typename RemoveReference::type* first_argument_type; - typedef typename Functor::result_type result_type; - Dereference(const Functor& functor) : functor(functor) - { - } - result_type operator()(first_argument_type firstArgument) const - { - return functor(*firstArgument); - } -}; + int i, shared; + brush_t *newbrush; + face_t *face1, *face2, *newface, *f; -template -inline Dereference makeDereference(const Functor& functor) -{ - return Dereference(functor); + // check for bounding box overlapp + for (i = 0; i < 3; i++) + { + if (brush1->mins[i] > brush2->maxs[i] + ON_EPSILON + || brush1->maxs[i] < brush2->mins[i] - ON_EPSILON) + { + // never merge if the brushes overlap + return NULL; + } + } + // + shared = 0; + // check if the new brush would be convex... flipped planes make a brush non-convex + for (face1 = brush1->brush_faces; face1; face1 = face1->next) + { + // don't check the faces of brush 1 and 2 touching each other + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + if (Plane_Equal(&face1->plane, &face2->plane, true)) + { + shared++; + // there may only be ONE shared side + if (shared > 1) + return NULL; + break; + } + } + // if this face plane is shared + if (face2) continue; + // + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + // don't check the faces of brush 1 and 2 touching each other + for (f = brush1->brush_faces; f; f = f->next) + { + if (Plane_Equal(&face2->plane, &f->plane, true)) break; + } + if (f) + continue; + // + if (Plane_Equal(&face1->plane, &face2->plane, false)) + { + //if the texture/shader references should be the same but are not + if (!onlyshape && stricmp(face1->texdef.GetName(), face2->texdef.GetName()) != 0) return NULL; + continue; + } + // + if (Winding_PlanesConcave(face1->face_winding, face2->face_winding, + face1->plane.normal, face2->plane.normal, + face1->plane.dist, face2->plane.dist)) + { + return NULL; + } //end if + } //end for + } //end for + // + newbrush = Brush_Alloc(); + // + for (face1 = brush1->brush_faces; face1; face1 = face1->next) + { + // don't add the faces of brush 1 and 2 touching each other + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + if (Plane_Equal(&face1->plane, &face2->plane, true)) + break; + } + if (face2) + continue; + // don't add faces with the same plane twice + for (f = newbrush->brush_faces; f; f = f->next) + { + if (Plane_Equal(&face1->plane, &f->plane, false)) + break; + if (Plane_Equal(&face1->plane, &f->plane, true)) + break; + } + if (f) + continue; + // + newface = Face_Alloc(); + newface->texdef = face1->texdef; + VectorCopy(face1->planepts[0], newface->planepts[0]); + VectorCopy(face1->planepts[1], newface->planepts[1]); + VectorCopy(face1->planepts[2], newface->planepts[2]); + newface->plane = face1->plane; + newface->next = newbrush->brush_faces; + newbrush->brush_faces = newface; + } + // + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + // don't add the faces of brush 1 and 2 touching each other + for (face1 = brush1->brush_faces; face1; face1 = face1->next) + { + if (Plane_Equal(&face2->plane, &face1->plane, true)) + break; + } + if (face1) + continue; + // don't add faces with the same plane twice + for (f = newbrush->brush_faces; f; f = f->next) + { + if (Plane_Equal(&face2->plane, &f->plane, false)) + break; + if (Plane_Equal(&face2->plane, &f->plane, true)) + break; + } + if (f) + continue; + // + newface = Face_Alloc(); + newface->texdef = face2->texdef; + VectorCopy(face2->planepts[0], newface->planepts[0]); + VectorCopy(face2->planepts[1], newface->planepts[1]); + VectorCopy(face2->planepts[2], newface->planepts[2]); + newface->plane = face2->plane; + newface->next = newbrush->brush_faces; + newbrush->brush_faces = newface; + } + // link the new brush to an entity + Entity_LinkBrush (brush1->owner, newbrush); + // build windings for the faces + Brush_BuildWindings( newbrush, false); + + return newbrush; } -typedef Face* FacePointer; -const FacePointer c_nullFacePointer = 0; +/* +============= +Brush_MergeListPairs -template -Face* Brush_findIf(const Brush& brush, const Predicate& predicate) + Returns a list with merged brushes. + Tries to merge brushes pair wise. + The input list is destroyed. + Input and output should be a single linked list using .next +============= +*/ +brush_t *Brush_MergeListPairs(brush_t *brushlist, int onlyshape) { - Brush::const_iterator i = std::find_if(brush.begin(), brush.end(), makeDereference(predicate)); - return i == brush.end() ? c_nullFacePointer : *i; // uses c_nullFacePointer instead of 0 because otherwise gcc 4.1 attempts conversion to int + int nummerges, merged; + brush_t *b1, *b2, *tail, *newbrush, *newbrushlist; + brush_t *lastb2; + + if (!brushlist) return NULL; + + nummerges = 0; + do + { + for (tail = brushlist; tail; tail = tail->next) + { + if (!tail->next) break; + } + merged = 0; + newbrushlist = NULL; + for (b1 = brushlist; b1; b1 = brushlist) + { + lastb2 = b1; + for (b2 = b1->next; b2; b2 = b2->next) + { + newbrush = Brush_Merge(b1, b2, onlyshape); + if (newbrush) + { + tail->next = newbrush; + lastb2->next = b2->next; + brushlist = brushlist->next; + b1->next = b1->prev = NULL; + b2->next = b2->prev = NULL; + Brush_Free(b1); + Brush_Free(b2); + for (tail = brushlist; tail; tail = tail->next) + { + if (!tail->next) break; + } //end for + merged++; + nummerges++; + break; + } + lastb2 = b2; + } + //if b1 can't be merged with any of the other brushes + if (!b2) + { + brushlist = brushlist->next; + //keep b1 + b1->next = newbrushlist; + newbrushlist = b1; + } + } + brushlist = newbrushlist; + } while(merged); + return newbrushlist; } -template -class BindArguments1 -{ - typedef typename Caller::second_argument_type FirstBound; - FirstBound firstBound; -public: - typedef typename Caller::result_type result_type; - typedef typename Caller::first_argument_type first_argument_type; - BindArguments1(FirstBound firstBound) - : firstBound(firstBound) - { - } - result_type operator()(first_argument_type firstArgument) const - { - return Caller::call(firstArgument, firstBound); - } -}; +/* +============= +Brush_MergeList -template -class BindArguments2 -{ - typedef typename Caller::second_argument_type FirstBound; - typedef typename Caller::third_argument_type SecondBound; - FirstBound firstBound; - SecondBound secondBound; -public: - typedef typename Caller::result_type result_type; - typedef typename Caller::first_argument_type first_argument_type; - BindArguments2(FirstBound firstBound, SecondBound secondBound) - : firstBound(firstBound), secondBound(secondBound) - { - } - result_type operator()(first_argument_type firstArgument) const - { - return Caller::call(firstArgument, firstBound, secondBound); - } -}; + Tries to merge all brushes in the list into one new brush. + The input brush list stays intact. + Returns NULL if no merged brush can be created. + To create a new brush the brushes in the list may not overlap and + the outer faces of the brushes together should make a new convex brush. -template -BindArguments2 bindArguments(const Caller& caller, FirstBound firstBound, SecondBound secondBound) + if onlyshape is true then the merge is allowed based on the shape only + otherwise the texture/shader references of faces in the same plane have to + be the same as well. +============= +*/ +brush_t *Brush_MergeList(brush_t *brushlist, int onlyshape) { - return BindArguments2(firstBound, secondBound); + brush_t *brush1, *brush2, *brush3, *newbrush; + face_t *face1, *face2, *face3, *newface, *f; + + if (!brushlist) return NULL; + for (brush1 = brushlist; brush1; brush1 = brush1->next) + { + // check if the new brush would be convex... flipped planes make a brush concave + for (face1 = brush1->brush_faces; face1; face1 = face1->next) + { + // don't check face1 if it touches another brush + for (brush2 = brushlist; brush2; brush2 = brush2->next) + { + if (brush2 == brush1) continue; + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + if (Plane_Equal(&face1->plane, &face2->plane, true)) + { + break; + } + } + if (face2) break; + } + // if face1 touches another brush + if (brush2) continue; + // + for (brush2 = brush1->next; brush2; brush2 = brush2->next) + { + // don't check the faces of brush 2 touching another brush + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + for (brush3 = brushlist; brush3; brush3 = brush3->next) + { + if (brush3 == brush2) continue; + for (face3 = brush3->brush_faces; face3; face3 = face3->next) + { + if (Plane_Equal(&face2->plane, &face3->plane, true)) break; + } + if (face3) break; + } + // if face2 touches another brush + if (brush3) continue; + // + if (Plane_Equal(&face1->plane, &face2->plane, false)) + { + //if the texture/shader references should be the same but are not + if (!onlyshape && stricmp(face1->texdef.GetName(), face2->texdef.GetName()) != 0) return NULL; + continue; + } + // + if (Winding_PlanesConcave(face1->face_winding, face2->face_winding, + face1->plane.normal, face2->plane.normal, + face1->plane.dist, face2->plane.dist)) + { + return NULL; + } + } + } + } + } + // + newbrush = Brush_Alloc(); + // + for (brush1 = brushlist; brush1; brush1 = brush1->next) + { + for (face1 = brush1->brush_faces; face1; face1 = face1->next) + { + // don't add face1 to the new brush if it touches another brush + for (brush2 = brushlist; brush2; brush2 = brush2->next) + { + if (brush2 == brush1) continue; + for (face2 = brush2->brush_faces; face2; face2 = face2->next) + { + if (Plane_Equal(&face1->plane, &face2->plane, true)) + { + break; + } + } + if (face2) break; + } + if (brush2) continue; + // don't add faces with the same plane twice + for (f = newbrush->brush_faces; f; f = f->next) + { + if (Plane_Equal(&face1->plane, &f->plane, false)) + break; + if (Plane_Equal(&face1->plane, &f->plane, true)) + break; + } + if (f) + continue; + // + newface = Face_Alloc(); + newface->texdef = face1->texdef; + VectorCopy(face1->planepts[0], newface->planepts[0]); + VectorCopy(face1->planepts[1], newface->planepts[1]); + VectorCopy(face1->planepts[2], newface->planepts[2]); + newface->plane = face1->plane; + newface->next = newbrush->brush_faces; + newbrush->brush_faces = newface; + } + } + // link the new brush to an entity + Entity_LinkBrush (brushlist->owner, newbrush); + // build windings for the faces + Brush_BuildWindings( newbrush, false); + + return newbrush; } -inline bool Face_testPlane(const Face& face, const Plane3& plane, bool flipped) +/* +============= +Brush_Subtract + + Returns a list of brushes that remain after B is subtracted from A. + May by empty if A is contained inside B. + The originals are undisturbed. +============= +*/ +brush_t *Brush_Subtract(brush_t *a, brush_t *b) { - return face.contributes() && !Winding_TestPlane(face.getWinding(), plane, flipped); -} -typedef Function3 FaceTestPlane; + // a - b = out (list) + brush_t *front, *back; + brush_t *in, *out, *next; + face_t *f; - - -/// \brief Returns true if -/// \li !flipped && brush is BACK or ON -/// \li flipped && brush is FRONT or ON -bool Brush_testPlane(const Brush& brush, const Plane3& plane, bool flipped) -{ - brush.evaluateBRep(); -#if 1 - for(Brush::const_iterator i(brush.begin()); i != brush.end(); ++i) - { - if(Face_testPlane(*(*i), plane, flipped)) - { - return false; - } - } - return true; -#else - return Brush_findIf(brush, bindArguments(FaceTestPlane(), makeReference(plane), flipped)) == 0; -#endif + in = a; + out = NULL; + for (f = b->brush_faces; f && in; f = f->next) + { + Brush_SplitBrushByFace(in, f, &front, &back); + if (in != a) Brush_Free(in); + if (front) + { // add to list + front->next = out; + out = front; + } + in = back; + } + //NOTE: in != a just in case brush b has no faces + if (in && in != a) + { + Brush_Free(in); + } + else + { //didn't really intersect + for (b = out; b; b = next) + { + next = b->next; + b->next = b->prev = NULL; + Brush_Free(b); + } + return a; + } + return out; } -brushsplit_t Brush_classifyPlane(const Brush& brush, const Plane3& plane) +/* +============= +CSG_Subtract +============= +*/ +void CSG_Subtract (void) { - brush.evaluateBRep(); - brushsplit_t split; - for(Brush::const_iterator i(brush.begin()); i != brush.end(); ++i) - { - if((*i)->contributes()) - { - split += Winding_ClassifyPlane((*i)->getWinding(), plane); - } - } - return split; -} + brush_t *b, *s, *fragments, *nextfragment, *frag, *next, *snext; + brush_t fragmentlist; + int i, numfragments, numbrushes; -bool Brush_subtract(const Brush& brush, const Brush& other, brush_vector_t& ret_fragments) -{ - if(aabb_intersects_aabb(brush.localAABB(), other.localAABB())) - { - brush_vector_t fragments; - fragments.reserve(other.size()); - Brush back(brush); + Sys_Printf ("Subtracting...\n"); - for(Brush::const_iterator i(other.begin()); i != other.end(); ++i) - { - if((*i)->contributes()) - { - brushsplit_t split = Brush_classifyPlane(back, (*i)->plane3()); - if(split.counts[ePlaneFront] != 0 - && split.counts[ePlaneBack] != 0) - { - fragments.push_back(new Brush(back)); - Face* newFace = fragments.back()->addFace(*(*i)); - if(newFace != 0) - { - newFace->flipWinding(); - } - back.addFace(*(*i)); - } - else if(split.counts[ePlaneBack] == 0) - { - for(brush_vector_t::iterator i = fragments.begin(); i != fragments.end(); ++i) - { - delete(*i); - } - return false; - } - } - } - ret_fragments.insert(ret_fragments.end(), fragments.begin(), fragments.end()); - return true; - } - return false; -} + if (selected_brushes.next == &selected_brushes) + { + Sys_Printf("No brushes selected.\n"); + return; + } -class SubtractBrushesFromUnselected : public scene::Graph::Walker -{ - const brush_vector_t& m_brushlist; - std::size_t& m_before; - std::size_t& m_after; -public: - SubtractBrushesFromUnselected(const brush_vector_t& brushlist, std::size_t& before, std::size_t& after) - : m_brushlist(brushlist), m_before(before), m_after(after) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 - && !Instance_getSelectable(instance)->isSelected()) - { - brush_vector_t buffer[2]; - bool swap = false; - Brush* original = new Brush(*brush); - buffer[static_cast(swap)].push_back(original); - - { - for(brush_vector_t::const_iterator i(m_brushlist.begin()); i != m_brushlist.end(); ++i) - { - for(brush_vector_t::iterator j(buffer[static_cast(swap)].begin()); j != buffer[static_cast(swap)].end(); ++j) - { - if(Brush_subtract(*(*j), *(*i), buffer[static_cast(!swap)])) - { - delete (*j); - } - else - { - buffer[static_cast(!swap)].push_back((*j)); - } - } - buffer[static_cast(swap)].clear(); - swap = !swap; - } - } + fragmentlist.next = &fragmentlist; + fragmentlist.prev = &fragmentlist; - brush_vector_t& out = buffer[static_cast(swap)]; + numfragments = 0; + numbrushes = 0; + for (b = selected_brushes.next ; b != &selected_brushes ; b=next) + { + next = b->next; - if(out.size() == 1 && out.back() == original) - { - delete original; - } - else - { - ++m_before; - for(brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i) - { - ++m_after; - NodeSmartReference node((new BrushNode())->node()); - (*i)->removeEmptyFaces(); - ASSERT_MESSAGE(!(*i)->empty(), "brush left with no faces after subtract"); - Node_getBrush(node)->copy(*(*i)); - delete (*i); - Node_getTraversable(path.parent())->insert(node); - } - Path_deleteTop(path); - } - } - } - } -}; + if (b->owner->eclass->fixedsize) + continue; // can't use texture from a fixed entity, so don't subtract -void CSG_Subtract() -{ - brush_vector_t selected_brushes; - GlobalSceneGraph().traverse(BrushGatherSelected(selected_brushes)); + // chop all fragments further up + for (s = fragmentlist.next; s != &fragmentlist; s = snext) + { + snext = s->next; - if (selected_brushes.empty()) - { - globalOutputStream() << "CSG Subtract: No brushes selected.\n"; - } - else - { - globalOutputStream() << "CSG Subtract: Subtracting " << Unsigned(selected_brushes.size()) << " brushes.\n"; + for (i=0 ; i<3 ; i++) + if (b->mins[i] >= s->maxs[i] - ON_EPSILON + || b->maxs[i] <= s->mins[i] + ON_EPSILON) + break; + if (i != 3) + continue; // definately don't touch + fragments = Brush_Subtract(s, b); + // if the brushes did not really intersect + if (fragments == s) + continue; + // try to merge fragments + fragments = Brush_MergeListPairs(fragments, true); + // add the fragments to the list + for (frag = fragments; frag; frag = nextfragment) + { + nextfragment = frag->next; + frag->next = NULL; + frag->owner = s->owner; + Brush_AddToList(frag, &fragmentlist); + } + // free the original brush + Brush_Free(s); + } - UndoableCommand undo("brushSubtract"); + // chop any active brushes up + for (s = active_brushes.next; s != &active_brushes; s = snext) + { + snext = s->next; - // subtract selected from unselected - std::size_t before = 0; - std::size_t after = 0; - GlobalSceneGraph().traverse(SubtractBrushesFromUnselected(selected_brushes, before, after)); - globalOutputStream() << "CSG Subtract: Result: " - << Unsigned(after) << " fragment" << (after == 1 ? "" : "s") - << " from " << Unsigned(before) << " brush" << (before == 1? "" : "es") << ".\n"; + if (s->owner->eclass->fixedsize || s->patchBrush || s->bFiltered) + continue; - SceneChangeNotify(); - } -} + if (s->brush_faces->pShader->getFlags() & QER_NOCARVE) + { + continue; + } -class BrushSplitByPlaneSelected : public scene::Graph::Walker -{ - const Vector3& m_p0; - const Vector3& m_p1; - const Vector3& m_p2; - const char* m_shader; - const TextureProjection& m_projection; - EBrushSplit m_split; -public: - BrushSplitByPlaneSelected(const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection, EBrushSplit split) - : m_p0(p0), m_p1(p1), m_p2(p2), m_shader(shader), m_projection(projection), m_split(split) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Brush* brush = Node_getBrush(path.top()); - if(brush != 0 - && Instance_getSelectable(instance)->isSelected()) - { - Plane3 plane(plane3_for_points(m_p0, m_p1, m_p2)); - if(plane3_valid(plane)) - { - brushsplit_t split = Brush_classifyPlane(*brush, m_split == eFront ? plane3_flipped(plane) : plane); - if(split.counts[ePlaneBack] && split.counts[ePlaneFront]) - { - // the plane intersects this brush - if(m_split == eFrontAndBack) - { - NodeSmartReference node((new BrushNode())->node()); - Brush* fragment = Node_getBrush(node); - fragment->copy(*brush); - Face* newFace = fragment->addPlane(m_p0, m_p1, m_p2, m_shader, m_projection); - if(newFace != 0 && m_split != eFront) - { - newFace->flipWinding(); - } - fragment->removeEmptyFaces(); - ASSERT_MESSAGE(!fragment->empty(), "brush left with no faces after split"); + for (i=0 ; i<3 ; i++) + if (b->mins[i] >= s->maxs[i] - ON_EPSILON + || b->maxs[i] <= s->mins[i] + ON_EPSILON) + break; + if (i != 3) + continue; // definately don't touch - Node_getTraversable(path.parent())->insert(node); - { - scene::Path fragmentPath = path; - fragmentPath.top() = makeReference(node.get()); - selectPath(fragmentPath, true); - } - } + fragments = Brush_Subtract(s, b); + // if the brushes did not really intersect + if (fragments == s) + continue; + // + Undo_AddBrush(s); + // one extra brush chopped up + numbrushes++; + // try to merge fragments + fragments = Brush_MergeListPairs(fragments, true); + // add the fragments to the list + for (frag = fragments; frag; frag = nextfragment) + { + nextfragment = frag->next; + frag->next = NULL; + frag->owner = s->owner; + Brush_AddToList(frag, &fragmentlist); + } + // free the original brush + Brush_Free(s); + } + } - Face* newFace = brush->addPlane(m_p0, m_p1, m_p2, m_shader, m_projection); - if(newFace != 0 && m_split == eFront) - { - newFace->flipWinding(); - } - brush->removeEmptyFaces(); - ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after split"); - } - else - // the plane does not intersect this brush - if(m_split != eFrontAndBack && split.counts[ePlaneBack] != 0) - { - // the brush is "behind" the plane - Path_deleteTop(path); - } - } - } - } - } -}; + // move all fragments to the active brush list + for (frag = fragmentlist.next; frag != &fragmentlist; frag = nextfragment) + { + nextfragment = frag->next; + numfragments++; + Brush_RemoveFromList(frag); + Brush_AddToList(frag, &active_brushes); + Undo_EndBrush(frag); + } -void Scene_BrushSplitByPlane(scene::Graph& graph, const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, EBrushSplit split) -{ - TextureProjection projection; - TexDef_Construct_Default(projection); - graph.traverse(BrushSplitByPlaneSelected(p0, p1, p2, shader, projection, split)); - SceneChangeNotify(); -} - - -class BrushInstanceSetClipPlane : public scene::Graph::Walker -{ - Plane3 m_plane; -public: - BrushInstanceSetClipPlane(const Plane3& plane) - : m_plane(plane) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - BrushInstance* brush = Instance_getBrush(instance); - if(brush != 0 - && path.top().get().visible() - && brush->isSelected()) - { - BrushInstance& brushInstance = *brush; - brushInstance.setClipPlane(m_plane); - } - return true; - } -}; - -void Scene_BrushSetClipPlane(scene::Graph& graph, const Plane3& plane) -{ - graph.traverse(BrushInstanceSetClipPlane(plane)); + /*if (numfragments == 0) + { + Sys_Printf("Selected brush%s did not intersect with any other brushes.\n", + (selected_brushes.next->next == &selected_brushes) ? "":"es"); + return; + }*/ + Sys_Printf("done. (created %d fragment%s out of %d brush%s)\n", numfragments, (numfragments == 1)?"":"s", + numbrushes, (numbrushes == 1)?"":"es"); + Sys_UpdateWindows(W_ALL); } /* @@ -553,140 +587,101 @@ void Scene_BrushSetClipPlane(scene::Graph& graph, const Plane3& plane) CSG_Merge ============= */ -bool Brush_merge(Brush& brush, const brush_vector_t& in, bool onlyshape) -{ - // gather potential outer faces - - { - typedef std::vector Faces; - Faces faces; - for(brush_vector_t::const_iterator i(in.begin()); i != in.end(); ++i) - { - (*i)->evaluateBRep(); - for(Brush::const_iterator j((*i)->begin()); j != (*i)->end(); ++j) - { - if(!(*j)->contributes()) - { - continue; - } - - const Face& face1 = *(*j); - - bool skip = false; - // test faces of all input brushes - //!\todo SPEEDUP: Flag already-skip faces and only test brushes from i+1 upwards. - for(brush_vector_t::const_iterator k(in.begin()); !skip && k != in.end(); ++k) - { - if(k != i) // don't test a brush against itself - { - for(Brush::const_iterator l((*k)->begin()); !skip && l != (*k)->end(); ++l) - { - const Face& face2 = *(*l); - - // face opposes another face - if(plane3_opposing(face1.plane3(), face2.plane3())) - { - // skip opposing planes - skip = true; - break; - } - } - } - } - - // check faces already stored - for(Faces::const_iterator m = faces.begin(); !skip && m != faces.end(); ++m) - { - const Face& face2 = *(*m); - - // face equals another face - if (plane3_equal(face1.plane3(), face2.plane3())) - { - //if the texture/shader references should be the same but are not - if (!onlyshape && !shader_equal(face1.getShader().getShader(), face2.getShader().getShader())) - { - return false; - } - // skip duplicate planes - skip = true; - break; - } - - // face1 plane intersects face2 winding or vice versa - if (Winding_PlanesConcave(face1.getWinding(), face2.getWinding(), face1.plane3(), face2.plane3())) - { - // result would not be convex - return false; - } - } - - if(!skip) - { - faces.push_back(&face1); - } - } - } - for(Faces::const_iterator i = faces.begin(); i != faces.end(); ++i) - { - if(!brush.addFace(*(*i))) - { - // result would have too many sides - return false; - } - } - } - - brush.removeEmptyFaces(); - - return true; -} - void CSG_Merge(void) { - brush_vector_t selected_brushes; + brush_t *b, *next, *newlist, *newbrush; + struct entity_s *owner; - // remove selected - GlobalSceneGraph().traverse(BrushGatherSelected(selected_brushes)); + Sys_Printf ("Merging...\n"); - if (selected_brushes.empty()) - { - globalOutputStream() << "CSG Merge: No brushes selected.\n"; - return; - } + if (selected_brushes.next == &selected_brushes) + { + Sys_Printf("No brushes selected.\n"); + return; + } - if (selected_brushes.size() < 2) - { - globalOutputStream() << "CSG Merge: At least two brushes have to be selected.\n"; - return; - } + if (selected_brushes.next->next == &selected_brushes) + { + Sys_Printf("At least two brushes have to be selected.\n"); + return; + } - globalOutputStream() << "CSG Merge: Merging " << Unsigned(selected_brushes.size()) << " brushes.\n"; + owner = selected_brushes.next->owner; - UndoableCommand undo("brushMerge"); + for (b = selected_brushes.next; b != &selected_brushes; b = next) + { + next = b->next; - scene::Path merged_path = GlobalSelectionSystem().ultimateSelected().path(); + if (b->owner->eclass->fixedsize) + { + // can't use texture from a fixed entity, so don't subtract + Sys_Printf("Cannot add fixed size entities.\n"); + return; + } - NodeSmartReference node((new BrushNode())->node()); - Brush* brush = Node_getBrush(node); - // if the new brush would not be convex - if(!Brush_merge(*brush, selected_brushes, true)) - { - globalOutputStream() << "CSG Merge: Failed - result would not be convex.\n"; - } - else - { - ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after merge"); + if (b->patchBrush) + { + Sys_Printf("Cannot add patches.\n"); + return; + } - // free the original brushes - GlobalSceneGraph().traverse(BrushDeleteSelected()); + // TTimo: cleanup + // disable the qer_nocarve for CSG-MERGE operations +#if 0 + if (b->brush_faces->d_texture->bFromShader && (b->brush_faces->d_texture->nShaderFlags & QER_NOCARVE)) + { + Sys_Printf("Cannot add brushes using shaders that don't allows CSG operations.\n"); + return; + } +#endif - merged_path.pop(); - Node_getTraversable(merged_path.top())->insert(node); - merged_path.push(makeReference(node.get())); + if (b->owner != owner) + { + Sys_Printf("Cannot add brushes from different entities.\n"); + return; + } - selectPath(merged_path, true); + } - globalOutputStream() << "CSG Merge: Succeeded.\n"; - SceneChangeNotify(); - } + newlist = NULL; + for (b = selected_brushes.next; b != &selected_brushes; b = next) + { + next = b->next; + + Brush_RemoveFromList(b); + b->next = newlist; + b->prev = NULL; + newlist = b; + } + + newbrush = Brush_MergeList(newlist, true); + // if the new brush would not be convex + if (!newbrush) + { + // add the brushes back into the selection + for (b = newlist; b; b = next) + { + next = b->next; + b->next = NULL; + b->prev = NULL; + Brush_AddToList(b, &selected_brushes); + } + Sys_Printf("Cannot add a set of brushes with a concave hull.\n"); + return; + } + // free the original brushes + for (b = newlist; b; b = next) + { + next = b->next; + b->next = NULL; + b->prev = NULL; + Brush_Free(b); + } + + newbrush->bFiltered = FilterBrush(newbrush); // spog - set filters for the new brush + + Brush_AddToList(newbrush, &selected_brushes); + + Sys_Printf ("done.\n"); + Sys_UpdateWindows (W_ALL); } diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index cb5c7069..fb1263e4 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,728 +26,277 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "dialog.h" - -#include "debugging/debugging.h" - - -#include "mainframe.h" - +#include "stdafx.h" +#include #include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "stream/stringstream.h" -#include "convert.h" -#include "gtkutil/dialog.h" -#include "gtkutil/button.h" -#include "gtkutil/entry.h" -#include "gtkutil/image.h" - -#include "gtkmisc.h" - - -GtkEntry* DialogEntry_new() +typedef struct { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_widget_set_size_request(GTK_WIDGET(entry), 64, -1); - return entry; -} - -class DialogEntryRow -{ -public: - DialogEntryRow(GtkWidget* row, GtkEntry* entry) : m_row(row), m_entry(entry) - { - } - GtkWidget* m_row; - GtkEntry* m_entry; -}; - -DialogEntryRow DialogEntryRow_new(const char* name) -{ - GtkWidget* alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); - gtk_widget_show(alignment); - - GtkEntry* entry = DialogEntry_new(); - gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(entry)); - - return DialogEntryRow(GTK_WIDGET(DialogRow_new(name, alignment)), entry); -} - - -GtkSpinButton* DialogSpinner_new(double value, double lower, double upper, int fraction) -{ - double step = 1.0 / double(fraction); - unsigned int digits = 0; - for(;fraction > 1; fraction /= 10) - { - ++digits; - } - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(value, lower, upper, step, 10, 10)), step, digits)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_widget_set_size_request(GTK_WIDGET(spin), 64, -1); - return spin; -} - -class DialogSpinnerRow -{ -public: - DialogSpinnerRow(GtkWidget* row, GtkSpinButton* spin) : m_row(row), m_spin(spin) - { - } - GtkWidget* m_row; - GtkSpinButton* m_spin; -}; - -DialogSpinnerRow DialogSpinnerRow_new(const char* name, double value, double lower, double upper, int fraction) -{ - GtkWidget* alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); - gtk_widget_show(alignment); - - GtkSpinButton* spin = DialogSpinner_new(value, lower, upper, fraction); - gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(spin)); - - return DialogSpinnerRow(GTK_WIDGET(DialogRow_new(name, alignment)), spin); -} - - - -template< - typename Type_, - typename Other_, - void(*Import)(Type_&, Other_), - void(*Export)(Type_&, const Callback1&) -> -class ImportExport -{ -public: - typedef Type_ Type; - typedef Other_ Other; - - typedef ReferenceCaller1 ImportCaller; - typedef ReferenceCaller1&, Export> ExportCaller; -}; - -typedef ImportExport BoolImportExport; -typedef ImportExport IntImportExport; -typedef ImportExport SizeImportExport; -typedef ImportExport FloatImportExport; -typedef ImportExport StringImportExport; - - - -void BoolToggleImport(GtkToggleButton& widget, bool value) -{ - gtk_toggle_button_set_active(&widget, value); -} -void BoolToggleExport(GtkToggleButton& widget, const BoolImportCallback& importCallback) -{ - importCallback(gtk_toggle_button_get_active(&widget) != FALSE); -} -typedef ImportExport BoolToggleImportExport; - - -void IntRadioImport(GtkRadioButton& widget, int index) -{ - radio_button_set_active(&widget, index); -} -void IntRadioExport(GtkRadioButton& widget, const IntImportCallback& importCallback) -{ - importCallback(radio_button_get_active(&widget)); -} -typedef ImportExport IntRadioImportExport; - -template -class StringFromType -{ - StringOutputStream value; -public: - StringFromType(const Type& type) - { - value << Formatter(type); - } - operator const char*() const - { - return value.c_str(); - } -}; - -typedef StringFromType LocaleToUTF8; -typedef StringFromType UTF8ToLocale; - -void TextEntryImport(GtkEntry& widget, const char* text) -{ - gtk_entry_set_text(&widget, LocaleToUTF8(text)); -} -void TextEntryExport(GtkEntry& widget, const StringImportCallback& importCallback) -{ - importCallback(UTF8ToLocale(gtk_entry_get_text(&widget))); -} -typedef ImportExport TextEntryImportExport; - - -void IntEntryImport(GtkEntry& widget, int value) -{ - entry_set_int(&widget, value); -} -void IntEntryExport(GtkEntry& widget, const IntImportCallback& importCallback) -{ - importCallback(atoi(gtk_entry_get_text (&widget))); -} -typedef ImportExport IntEntryImportExport; - - -void SizeEntryImport(GtkEntry& widget, std::size_t value) -{ - entry_set_int(&widget, int(value)); -} -void SizeEntryExport(GtkEntry& widget, const SizeImportCallback& importCallback) -{ - int value = atoi(gtk_entry_get_text(&widget)); - if(value < 0) - { - value = 0; - } - importCallback(value); -} -typedef ImportExport SizeEntryImportExport; - - -void FloatEntryImport(GtkEntry& widget, float value) -{ - entry_set_float(&widget, value); -} -void FloatEntryExport(GtkEntry& widget, const FloatImportCallback& importCallback) -{ - importCallback((float)atof(gtk_entry_get_text(&widget))); -} -typedef ImportExport FloatEntryImportExport; - - -void FloatSpinnerImport(GtkSpinButton& widget, float value) -{ - gtk_spin_button_set_value(&widget, value); -} -void FloatSpinnerExport(GtkSpinButton& widget, const FloatImportCallback& importCallback) -{ - importCallback(float(gtk_spin_button_get_value_as_float(&widget))); -} -typedef ImportExport FloatSpinnerImportExport; - - -void IntSpinnerImport(GtkSpinButton& widget, int value) -{ - gtk_spin_button_set_value(&widget, value); -} -void IntSpinnerExport(GtkSpinButton& widget, const IntImportCallback& importCallback) -{ - importCallback(gtk_spin_button_get_value_as_int(&widget)); -} -typedef ImportExport IntSpinnerImportExport; - - -void IntAdjustmentImport(GtkAdjustment& widget, int value) -{ - gtk_adjustment_set_value(&widget, value); -} -void IntAdjustmentExport(GtkAdjustment& widget, const IntImportCallback& importCallback) -{ - importCallback((int)gtk_adjustment_get_value(&widget)); -} -typedef ImportExport IntAdjustmentImportExport; - - -void IntComboImport(GtkComboBox& widget, int value) -{ - gtk_combo_box_set_active(&widget, value); -} -void IntComboExport(GtkComboBox& widget, const IntImportCallback& importCallback) -{ - importCallback(gtk_combo_box_get_active(&widget)); -} -typedef ImportExport IntComboImportExport; - - -template -class CallbackDialogData : public DLG_DATA -{ -public: - typedef Callback1 ImportCallback; - typedef Callback1 ExportCallback; - -private: - ImportCallback m_importWidget; - ExportCallback m_exportWidget; - ImportCallback m_importViewer; - ExportCallback m_exportViewer; - -public: - CallbackDialogData(const ImportCallback& importWidget, const ExportCallback& exportWidget, const ImportCallback& importViewer, const ExportCallback& exportViewer) - : m_importWidget(importWidget), m_exportWidget(exportWidget), m_importViewer(importViewer), m_exportViewer(exportViewer) - { - } - void release() - { - delete this; - } - void importData() const - { - m_exportViewer(m_importWidget); - } - void exportData() const - { - m_exportWidget(m_importViewer); - } -}; - -template -class AddData -{ - DialogDataList& m_data; -public: - AddData(DialogDataList& data) : m_data(data) - { - } - void apply(typename Widget::Type& widget, typename Viewer::Type& viewer) const - { - m_data.push_back( - new CallbackDialogData( - typename Widget::ImportCaller(widget), - typename Widget::ExportCaller(widget), - typename Viewer::ImportCaller(viewer), - typename Viewer::ExportCaller(viewer) - ) - ); - } -}; - -template -class AddCustomData -{ - DialogDataList& m_data; -public: - AddCustomData(DialogDataList& data) : m_data(data) - { - } - void apply( - typename Widget::Type& widget, - const Callback1& importViewer, - const Callback1&>& exportViewer - ) const - { - m_data.push_back( - new CallbackDialogData( - typename Widget::ImportCaller(widget), - typename Widget::ExportCaller(widget), - importViewer, - exportViewer - ) - ); - } -}; + GtkObject *object; + void *buffer; + DLG_DATA_TYPE type; +} DLG_DATA; // ============================================================================= // Dialog class -Dialog::Dialog() : m_window(0), m_parent(0) +Dialog::Dialog () { + m_pDataList = (GSList*)NULL; + m_nReturn = IDCANCEL; + m_bNeedBuild = true; + m_nLoop = 0; } -Dialog::~Dialog() +Dialog::~Dialog () { - for(DialogDataList::iterator i = m_data.begin(); i != m_data.end(); ++i) + while (m_pDataList) { - (*i)->release(); + free (m_pDataList->data); + m_pDataList = g_slist_remove (m_pDataList, m_pDataList->data); } - - ASSERT_MESSAGE(m_window == 0, "dialog window not destroyed"); + + if (m_pWidget != NULL) + gtk_widget_destroy (m_pWidget); } -void Dialog::ShowDlg() +// i suspect that this is redundant - gtk manages to remember the data stored in its widgets across a hide/show +void Dialog::ShowDlg () { - ASSERT_MESSAGE(m_window != 0, "dialog was not constructed"); - importData(); - gtk_widget_show(GTK_WIDGET(m_window)); + Create (); + UpdateData (FALSE); + gtk_widget_show (m_pWidget); } -void Dialog::HideDlg() +void Dialog::HideDlg () { - ASSERT_MESSAGE(m_window != 0, "dialog was not constructed"); - exportData(); - gtk_widget_hide(GTK_WIDGET(m_window)); + UpdateData (TRUE); + gtk_widget_hide (m_pWidget); } static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data) { reinterpret_cast(data)->HideDlg(); - reinterpret_cast(data)->EndModal(eIDCANCEL); + reinterpret_cast(data)->EndModal(IDCANCEL); return TRUE; } -void Dialog::Create() +void Dialog::Create () { - ASSERT_MESSAGE(m_window == 0, "dialog cannot be constructed"); - - m_window = BuildDialog(); - g_signal_connect(G_OBJECT(m_window), "delete_event", G_CALLBACK(delete_event_callback), this); -} - -void Dialog::Destroy() -{ - ASSERT_MESSAGE(m_window != 0, "dialog cannot be destroyed"); - - gtk_widget_destroy(GTK_WIDGET(m_window)); - m_window = 0; -} - - -void Dialog::AddBoolToggleData(GtkToggleButton& widget, const BoolImportCallback& importViewer, const BoolExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddIntRadioData(GtkRadioButton& widget, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddTextEntryData(GtkEntry& widget, const StringImportCallback& importViewer, const StringExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddIntEntryData(GtkEntry& widget, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddSizeEntryData(GtkEntry& widget, const SizeImportCallback& importViewer, const SizeExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddFloatEntryData(GtkEntry& widget, const FloatImportCallback& importViewer, const FloatExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddFloatSpinnerData(GtkSpinButton& widget, const FloatImportCallback& importViewer, const FloatExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddIntSpinnerData(GtkSpinButton& widget, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddIntAdjustmentData(GtkAdjustment& widget, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - -void Dialog::AddIntComboData(GtkComboBox& widget, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - AddCustomData(m_data).apply(widget, importViewer, exportViewer); -} - - -void Dialog::AddDialogData(GtkToggleButton& widget, bool& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkRadioButton& widget, int& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkEntry& widget, CopiedString& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkEntry& widget, int& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkEntry& widget, std::size_t& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkEntry& widget, float& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkSpinButton& widget, float& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkSpinButton& widget, int& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkAdjustment& widget, int& data) -{ - AddData(m_data).apply(widget, data); -} -void Dialog::AddDialogData(GtkComboBox& widget, int& data) -{ - AddData(m_data).apply(widget, data); -} - -void Dialog::exportData() -{ - for(DialogDataList::iterator i = m_data.begin(); i != m_data.end(); ++i) + if (m_bNeedBuild) { - (*i)->exportData(); + m_pWidget = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "delete_event", + GTK_SIGNAL_FUNC (delete_event_callback), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (m_pWidget), "loop", &m_nLoop); + g_object_set_data (G_OBJECT (m_pWidget), "ret", &m_nReturn); + + BuildDialog(); + m_bNeedBuild = false; } } -void Dialog::importData() +void Dialog::Destroy () { - for(DialogDataList::iterator i = m_data.begin(); i != m_data.end(); ++i) + if (m_pWidget != NULL) { - (*i)->importData(); + gtk_widget_destroy (m_pWidget); + m_pWidget = NULL; } } -void Dialog::EndModal (EMessageBoxReturn code) +void Dialog::AddDialogData( GtkObject *object, void *buf, DLG_DATA_TYPE type ) { - m_modal.loop = 0; - m_modal.ret = code; + DLG_DATA *data; + + data = (DLG_DATA*)qmalloc (sizeof(DLG_DATA)); + data->object = object; + data->buffer = buf; + data->type = type; + + m_pDataList = g_slist_append (m_pDataList, data); } -EMessageBoxReturn Dialog::DoModal() +void Dialog::AddModalButton( GtkWidget *widget, int ret ) { + gtk_signal_connect( GTK_OBJECT( widget ), "clicked", + GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( ret ) ); +} + +void Dialog::UpdateData (bool retrieve) + { + DLG_DATA *data; + GSList *lst; + char buf[32]; + + if (retrieve) + { + for (lst = m_pDataList; lst != NULL; lst = g_slist_next (lst)) + { + data = (DLG_DATA*)lst->data; + + switch (data->type) + { + case DLG_CHECK_BOOL: + *(bool*)data->buffer = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->object)); + break; + case DLG_RADIO_INT: + { + GSList *radio = gtk_radio_button_group (GTK_RADIO_BUTTON (data->object)); + *(int*)data->buffer = g_slist_length (radio) - 1; + for (; radio; radio = g_slist_next (radio)) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio->data))) + break; + else + (*(int*)data->buffer)--; + } break; + case DLG_ENTRY_TEXT: + { + const char *txt; + Str* str; + str = (Str*)data->buffer; + txt = gtk_entry_get_text (GTK_ENTRY (data->object)); + *str = txt; + } break; + case DLG_ENTRY_FLOAT: + *(float*)data->buffer = atof (gtk_entry_get_text (GTK_ENTRY (data->object))); + break; + case DLG_ENTRY_INT: + *(int*)data->buffer = atoi (gtk_entry_get_text (GTK_ENTRY (data->object))); + break; + case DLG_SPIN_FLOAT: + *(float*)data->buffer = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (data->object)); + break; + case DLG_SPIN_INT: + *(int*)data->buffer = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->object)); + break; + case DLG_ADJ_INT: + *(int*)data->buffer = (int) GTK_ADJUSTMENT (data->object)->value; + break; + case DLG_COMBO_INT: + { + GList *lst = GTK_LIST (GTK_COMBO (data->object)->list)->children; + char *label; + const char *entry; + int i; + + *(int*)data->buffer = -1; + entry = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (data->object)->entry)); + + for (i = 0; lst != NULL; lst = g_list_next (lst)) + { + gtk_label_get (GTK_LABEL (GTK_BIN (lst->data)->child), &label); + + if (strcmp (label, entry) == 0) + { + *(int*)data->buffer = i; + break; + } + i++; + } + } + break; + case DLG_COMBO_BOX_INT: { + *(int*)data->buffer = gtk_combo_box_get_active( GTK_COMBO_BOX( data->object ) ); + } + break; + + } + } + } + else + { + for (lst = m_pDataList; lst != NULL; lst = g_slist_next (lst)) + { + data = (DLG_DATA*)lst->data; + + switch (data->type) + { + case DLG_CHECK_BOOL: + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->object), *(bool*)data->buffer); + break; + case DLG_RADIO_INT: + { + GSList *radio = gtk_radio_button_group (GTK_RADIO_BUTTON (data->object)); + gpointer btn = g_slist_nth_data (radio, g_slist_length (radio) - (*(int*)data->buffer) - 1); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (btn), TRUE); + } break; + case DLG_ENTRY_TEXT: + { + Str* str; + str = (Str*)data->buffer; + const char *txt = str->GetBuffer (); + gtk_entry_set_text (GTK_ENTRY (data->object), txt); + } break; + case DLG_ENTRY_FLOAT: + sprintf (buf, "%g", (*(float*)data->buffer)); + gtk_entry_set_text (GTK_ENTRY (data->object), buf); + break; + case DLG_ENTRY_INT: + sprintf (buf, "%d", (*(int*)data->buffer)); + gtk_entry_set_text (GTK_ENTRY (data->object), buf); + break; + case DLG_SPIN_FLOAT: + gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->object), (*(float*)data->buffer)); + break; + case DLG_SPIN_INT: + gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->object), (*(int*)data->buffer)); + break; + case DLG_ADJ_INT: + gtk_adjustment_set_value (GTK_ADJUSTMENT (data->object), (*(int*)data->buffer)); + break; + case DLG_COMBO_INT: { + GList *lst = GTK_LIST (GTK_COMBO (data->object)->list)->children; + char *entry = ""; + + if (*(int*)data->buffer != -1) + { + lst = g_list_nth (lst, *(int*)data->buffer); + if (lst != NULL) + gtk_label_get (GTK_LABEL (GTK_BIN (lst->data)->child), &entry); + } + + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (data->object)->entry), entry); + } + break; + case DLG_COMBO_BOX_INT: { + gtk_combo_box_set_active( GTK_COMBO_BOX( data->object ), *(int*)data->buffer ); + } + break; + } + } + } +} + +void Dialog::EndModal( int code ) { + m_nLoop = 0; + m_nReturn = code; +} + +int Dialog::DoModal() { - importData(); + Create(); + UpdateData( FALSE ); PreModal(); - EMessageBoxReturn ret = modal_dialog_show(m_window, m_modal); - ASSERT_NOTNULL(m_window); - if(ret == eIDOK) - { - exportData(); + gtk_grab_add( m_pWidget ); + gtk_widget_show( m_pWidget ); + + m_nLoop = 1; + while ( m_nLoop ) { + gtk_main_iteration(); } - gtk_widget_hide(GTK_WIDGET(m_window)); + if ( m_pWidget != NULL ) { + UpdateData( TRUE ); - PostModal(m_modal.ret); - - return m_modal.ret; -} - - -GtkWidget* Dialog::addCheckBox(GtkWidget* vbox, const char* name, const char* flag, const BoolImportCallback& importViewer, const BoolExportCallback& exportViewer) -{ - GtkWidget* check = gtk_check_button_new_with_label(flag); - gtk_widget_show(check); - AddBoolToggleData(*GTK_TOGGLE_BUTTON(check), importViewer, exportViewer); - - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(DialogRow_new(name, check))); - return check; -} - -GtkWidget* Dialog::addCheckBox(GtkWidget* vbox, const char* name, const char* flag, bool& data) -{ - return addCheckBox(vbox, name, flag, BoolImportCaller(data), BoolExportCaller(data)); -} - -void Dialog::addCombo(GtkWidget* vbox, const char* name, StringArrayRange values, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - GtkWidget* alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); - gtk_widget_show(alignment); - { - GtkWidget* combo = gtk_combo_box_new_text(); - - for(StringArrayRange::Iterator i = values.first; i != values.last; ++i) - { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), *i); - } - - AddIntComboData(*GTK_COMBO_BOX(combo), importViewer, exportViewer); - - gtk_widget_show (combo); - gtk_container_add(GTK_CONTAINER(alignment), combo); + gtk_grab_remove( m_pWidget ); + gtk_widget_hide( m_pWidget ); } + PostModal( m_nReturn ); - GtkTable* row = DialogRow_new(name, alignment); - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(row)); -} - -void Dialog::addCombo(GtkWidget* vbox, const char* name, int& data, StringArrayRange values) -{ - addCombo(vbox, name, values, IntImportCaller(data), IntExportCaller(data)); -} - -void Dialog::addSlider(GtkWidget* vbox, const char* name, int& data, gboolean draw_value, const char* low, const char* high, double value, double lower, double upper, double step_increment, double page_increment, double page_size) -{ -#if 0 - if(draw_value == FALSE) - { - GtkWidget* hbox2 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox2); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox2), FALSE, FALSE, 0); - { - GtkWidget* label = gtk_label_new (low); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); - } - { - GtkWidget* label = gtk_label_new (high); - gtk_widget_show (label); - gtk_box_pack_end (GTK_BOX (hbox2), label, FALSE, FALSE, 0); - } - } -#endif - - // adjustment - GtkObject* adj = gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size); - AddIntAdjustmentData(*GTK_ADJUSTMENT(adj), IntImportCaller(data), IntExportCaller(data)); - - // scale - GtkWidget* alignment = gtk_alignment_new(0.0, 0.5, 1.0, 0.0); - gtk_widget_show(alignment); - - GtkWidget* scale = gtk_hscale_new(GTK_ADJUSTMENT(adj)); - gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_LEFT); - gtk_widget_show(scale); - gtk_container_add(GTK_CONTAINER(alignment), scale); - - gtk_scale_set_draw_value(GTK_SCALE (scale), draw_value); - gtk_scale_set_digits(GTK_SCALE (scale), 0); - - GtkTable* row = DialogRow_new(name, alignment); - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(row)); -} - -void Dialog::addRadio(GtkWidget* vbox, const char* name, StringArrayRange names, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - GtkWidget* alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0); - gtk_widget_show(alignment); - { - RadioHBox radioBox = RadioHBox_new(names); - gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(radioBox.m_hbox)); - AddIntRadioData(*GTK_RADIO_BUTTON(radioBox.m_radio), importViewer, exportViewer); - } - - GtkTable* row = DialogRow_new(name, alignment); - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(row)); -} - -void Dialog::addRadio(GtkWidget* vbox, const char* name, int& data, StringArrayRange names) -{ - addRadio(vbox, name, names, IntImportCaller(data), IntExportCaller(data)); -} - -void Dialog::addRadioIcons(GtkWidget* vbox, const char* name, StringArrayRange icons, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - GtkWidget* table = gtk_table_new (2, static_cast(icons.last - icons.first), FALSE); - gtk_widget_show (table); - - gtk_table_set_row_spacings (GTK_TABLE (table), 5); - gtk_table_set_col_spacings (GTK_TABLE (table), 5); - - GSList* group = 0; - GtkWidget* radio = 0; - for(StringArrayRange::Iterator icon = icons.first; icon != icons.last; ++icon) - { - guint pos = static_cast(icon - icons.first); - GtkImage* image = new_local_image(*icon); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(image), pos, pos+1, 0, 1, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - - radio = gtk_radio_button_new(group); - gtk_widget_show (radio); - gtk_table_attach (GTK_TABLE (table), radio, pos, pos+1, 1, 2, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - - group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio)); - } - - AddIntRadioData(*GTK_RADIO_BUTTON(radio), importViewer, exportViewer); - - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(DialogRow_new(name, table))); -} - -void Dialog::addRadioIcons(GtkWidget* vbox, const char* name, int& data, StringArrayRange icons) -{ - addRadioIcons(vbox, name, icons, IntImportCaller(data), IntExportCaller(data)); -} - -GtkWidget* Dialog::addIntEntry(GtkWidget* vbox, const char* name, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - DialogEntryRow row(DialogEntryRow_new(name)); - AddIntEntryData(*row.m_entry, importViewer, exportViewer); - DialogVBox_packRow(GTK_VBOX(vbox), row.m_row); - return row.m_row; -} - -GtkWidget* Dialog::addSizeEntry(GtkWidget* vbox, const char* name, const SizeImportCallback& importViewer, const SizeExportCallback& exportViewer) -{ - DialogEntryRow row(DialogEntryRow_new(name)); - AddSizeEntryData(*row.m_entry, importViewer, exportViewer); - DialogVBox_packRow(GTK_VBOX(vbox), row.m_row); - return row.m_row; -} - -GtkWidget* Dialog::addFloatEntry(GtkWidget* vbox, const char* name, const FloatImportCallback& importViewer, const FloatExportCallback& exportViewer) -{ - DialogEntryRow row(DialogEntryRow_new(name)); - AddFloatEntryData(*row.m_entry, importViewer, exportViewer); - DialogVBox_packRow(GTK_VBOX(vbox), row.m_row); - return row.m_row; -} - -GtkWidget* Dialog::addPathEntry(GtkWidget* vbox, const char* name, bool browse_directory, const StringImportCallback& importViewer, const StringExportCallback& exportViewer) -{ - PathEntry pathEntry = PathEntry_new(); - g_signal_connect(G_OBJECT(pathEntry.m_button), "clicked", G_CALLBACK(browse_directory ? button_clicked_entry_browse_directory : button_clicked_entry_browse_file), pathEntry.m_entry); - - AddTextEntryData(*GTK_ENTRY(pathEntry.m_entry), importViewer, exportViewer); - - GtkTable* row = DialogRow_new(name, GTK_WIDGET(pathEntry.m_frame)); - DialogVBox_packRow(GTK_VBOX(vbox), GTK_WIDGET(row)); - - return GTK_WIDGET(row); -} - -GtkWidget* Dialog::addPathEntry(GtkWidget* vbox, const char* name, CopiedString& data, bool browse_directory) -{ - return addPathEntry(vbox, name, browse_directory, StringImportCallback(StringImportCaller(data)), StringExportCallback(StringExportCaller(data))); -} - -GtkWidget* Dialog::addSpinner(GtkWidget* vbox, const char* name, double value, double lower, double upper, const IntImportCallback& importViewer, const IntExportCallback& exportViewer) -{ - DialogSpinnerRow row(DialogSpinnerRow_new(name, value, lower, upper, 1)); - AddIntSpinnerData(*row.m_spin, importViewer, exportViewer); - DialogVBox_packRow(GTK_VBOX(vbox), row.m_row); - return row.m_row; -} - -GtkWidget* Dialog::addSpinner(GtkWidget* vbox, const char* name, int& data, double value, double lower, double upper) -{ - return addSpinner(vbox, name, value, lower, upper, IntImportCallback(IntImportCaller(data)), IntExportCallback(IntExportCaller(data))); -} - -GtkWidget* Dialog::addSpinner(GtkWidget* vbox, const char* name, double value, double lower, double upper, const FloatImportCallback& importViewer, const FloatExportCallback& exportViewer) -{ - DialogSpinnerRow row(DialogSpinnerRow_new(name, value, lower, upper, 10)); - AddFloatSpinnerData(*row.m_spin, importViewer, exportViewer); - DialogVBox_packRow(GTK_VBOX(vbox), row.m_row); - return row.m_row; + return m_nReturn; } diff --git a/radiant/dialog.h b/radiant/dialog.h index d7ac94bd..cd00eff1 100644 --- a/radiant/dialog.h +++ b/radiant/dialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,190 +19,68 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_DIALOG_H) -#define INCLUDED_DIALOG_H +#ifndef _DIALOG_H_ +#define _DIALOG_H_ -#include +#include +#include "str.h" +#include "gtkmisc.h" -#include "gtkutil/dialog.h" -#include "generic/callback.h" -#include "string/string.h" - -template -class ReferenceCaller1; - -inline void BoolImport(bool& self, bool value) +typedef enum { - self = value; -} -typedef ReferenceCaller1 BoolImportCaller; - -inline void BoolExport(bool& self, const BoolImportCallback& importCallback) -{ - importCallback(self); -} -typedef ReferenceCaller1 BoolExportCaller; - - -inline void IntImport(int& self, int value) -{ - self = value; -} -typedef ReferenceCaller1 IntImportCaller; - -inline void IntExport(int& self, const IntImportCallback& importCallback) -{ - importCallback(self); -} -typedef ReferenceCaller1 IntExportCaller; - - -inline void SizeImport(std::size_t& self, std::size_t value) -{ - self = value; -} -typedef ReferenceCaller1 SizeImportCaller; - -inline void SizeExport(std::size_t& self, const SizeImportCallback& importCallback) -{ - importCallback(self); -} -typedef ReferenceCaller1 SizeExportCaller; - - -inline void FloatImport(float& self, float value) -{ - self = value; -} -typedef ReferenceCaller1 FloatImportCaller; - -inline void FloatExport(float& self, const FloatImportCallback& importCallback) -{ - importCallback(self); -} -typedef ReferenceCaller1 FloatExportCaller; - - -inline void StringImport(CopiedString& self, const char* value) -{ - self = value; -} -typedef ReferenceCaller1 StringImportCaller; -inline void StringExport(CopiedString& self, const StringImportCallback& importCallback) -{ - importCallback(self.c_str()); -} -typedef ReferenceCaller1 StringExportCaller; - - -struct DLG_DATA -{ - virtual void release() = 0; - virtual void importData() const = 0; - virtual void exportData() const = 0; -}; - -typedef struct _GtkWindow GtkWindow; -typedef struct _GtkToggleButton GtkToggleButton; -typedef struct _GtkRadioButton GtkRadioButton; -typedef struct _GtkSpinButton GtkSpinButton; -typedef struct _GtkComboBox GtkComboBox; -typedef struct _GtkEntry GtkEntry; -typedef struct _GtkAdjustment GtkAdjustment; - -template -class CallbackDialogData; - -typedef std::list DialogDataList; + DLG_CHECK_BOOL, + DLG_RADIO_INT, + DLG_ENTRY_TEXT, + DLG_ENTRY_FLOAT, + DLG_ENTRY_INT, + DLG_SPIN_FLOAT, + DLG_SPIN_INT, + DLG_ADJ_INT, + DLG_COMBO_INT, + DLG_COMBO_BOX_INT, +} DLG_DATA_TYPE; class Dialog { - GtkWindow* m_window; - DialogDataList m_data; -public: - ModalDialog m_modal; - GtkWindow* m_parent; - - Dialog(); - virtual ~Dialog(); + public: + Dialog (); + virtual ~Dialog (); /*! start modal dialog box - you need to use AddModalButton to select eIDOK eIDCANCEL buttons + you need to use AddModalButton to select IDOK IDCANCEL buttons */ - EMessageBoxReturn DoModal(); - void EndModal (EMessageBoxReturn code); - virtual GtkWindow* BuildDialog() = 0; - virtual void exportData(); - virtual void importData(); - virtual void PreModal() { }; - virtual void PostModal (EMessageBoxReturn code) { }; - virtual void ShowDlg(); - virtual void HideDlg(); - void Create(); - void Destroy(); - GtkWindow* GetWidget() - { - return m_window; - } - const GtkWindow* GetWidget() const - { - return m_window; - } + int DoModal (); + void EndModal (int code); + virtual void BuildDialog () = 0; + virtual void UpdateData (bool retrieve); + virtual void PreModal () { }; + virtual void PostModal (int code) { }; + virtual void ShowDlg (); + virtual void HideDlg (); + void Create (); + void Destroy (); + GtkWidget* GetDlgWidget (const char* name) + { return GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), name)); } + GtkWidget* GetWidget () + { return m_pWidget; } - GtkWidget* addCheckBox(GtkWidget* vbox, const char* name, const char* flag, const BoolImportCallback& importCallback, const BoolExportCallback& exportCallback); - GtkWidget* addCheckBox(GtkWidget* vbox, const char* name, const char* flag, bool& data); - void addCombo(GtkWidget* vbox, const char* name, StringArrayRange values, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void addCombo(GtkWidget* vbox, const char* name, int& data, StringArrayRange values); - void addSlider(GtkWidget* vbox, const char* name, int& data, gboolean draw_value, const char* low, const char* high, double value, double lower, double upper, double step_increment, double page_increment, double page_size); - void addRadio(GtkWidget* vbox, const char* name, StringArrayRange names, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void addRadio(GtkWidget* vbox, const char* name, int& data, StringArrayRange names); - void addRadioIcons(GtkWidget* vbox, const char* name, StringArrayRange icons, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void addRadioIcons(GtkWidget* vbox, const char* name, int& data, StringArrayRange icons); - GtkWidget* addIntEntry(GtkWidget* vbox, const char* name, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - GtkWidget* addEntry(GtkWidget* vbox, const char* name, int& data) - { - return addIntEntry(vbox, name, IntImportCaller(data), IntExportCaller(data)); - } - GtkWidget* addSizeEntry(GtkWidget* vbox, const char* name, const SizeImportCallback& importCallback, const SizeExportCallback& exportCallback); - GtkWidget* addEntry(GtkWidget* vbox, const char* name, std::size_t& data) - { - return addSizeEntry(vbox, name, SizeImportCaller(data), SizeExportCaller(data)); - } - GtkWidget* addFloatEntry(GtkWidget* vbox, const char* name, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback); - GtkWidget* addEntry(GtkWidget* vbox, const char* name, float& data) - { - return addFloatEntry(vbox, name, FloatImportCaller(data), FloatExportCaller(data)); - } - GtkWidget* addPathEntry(GtkWidget* vbox, const char* name, bool browse_directory, const StringImportCallback& importCallback, const StringExportCallback& exportCallback); - GtkWidget* addPathEntry(GtkWidget* vbox, const char* name, CopiedString& data, bool directory); - GtkWidget* addSpinner(GtkWidget* vbox, const char* name, int& data, double value, double lower, double upper); - GtkWidget* addSpinner(GtkWidget* vbox, const char* name, double value, double lower, double upper, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - GtkWidget* addSpinner(GtkWidget* vbox, const char* name, double value, double lower, double upper, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback); + protected: + GtkWidget *m_pWidget; + int m_nLoop; + int m_nReturn; -protected: + void AddDialogData (GtkWidget *widget, void *buf, DLG_DATA_TYPE type) + { AddDialogData (GTK_OBJECT (widget), buf, type); }; + void AddDialogData (GtkObject *object, void *buf, DLG_DATA_TYPE type); + /*! + used in overloaded BuildDialog implementations to configure modal behaviour easily + */ + void AddModalButton( GtkWidget *widget, int ret ); - void AddBoolToggleData(GtkToggleButton& object, const BoolImportCallback& importCallback, const BoolExportCallback& exportCallback); - void AddIntRadioData(GtkRadioButton& object, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void AddTextEntryData(GtkEntry& object, const StringImportCallback& importCallback, const StringExportCallback& exportCallback); - void AddIntEntryData(GtkEntry& object, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void AddSizeEntryData(GtkEntry& object, const SizeImportCallback& importCallback, const SizeExportCallback& exportCallback); - void AddFloatEntryData(GtkEntry& object, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback); - void AddFloatSpinnerData(GtkSpinButton& object, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback); - void AddIntSpinnerData(GtkSpinButton& object, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void AddIntAdjustmentData(GtkAdjustment& object, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - void AddIntComboData(GtkComboBox& object, const IntImportCallback& importCallback, const IntExportCallback& exportCallback); - - void AddDialogData(GtkToggleButton& object, bool& data); - void AddDialogData(GtkRadioButton& object, int& data); - void AddDialogData(GtkEntry& object, CopiedString& data); - void AddDialogData(GtkEntry& object, int& data); - void AddDialogData(GtkEntry& object, std::size_t& data); - void AddDialogData(GtkEntry& object, float& data); - void AddDialogData(GtkSpinButton& object, float& data); - void AddDialogData(GtkSpinButton& object, int& data); - void AddDialogData(GtkAdjustment& object, int& data); - void AddDialogData(GtkComboBox& object, int& data); + private: + GSList* m_pDataList; + bool m_bNeedBuild; }; -#endif +#endif // _DIALOG_H_ diff --git a/radiant/dialoginfo.cpp b/radiant/dialoginfo.cpp new file mode 100644 index 00000000..54a7472c --- /dev/null +++ b/radiant/dialoginfo.cpp @@ -0,0 +1,75 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// InfoDialog - non-modal, not derived from Dialog +// +// Leonardo Zide (leo@lokigames.com) +// + +#include "stdafx.h" +#include +//#include "qe3.h" + +GtkWidget *g_dlgInfo; +GtkWidget *s_pEdit; + +// ============================================================================= +// Global functions + +void ShowInfoDialog(const char* pText) +{ + if (g_dlgInfo == NULL) + { + GtkWidget *dlg, *scr, *text; + + g_dlgInfo = dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Information"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (gtk_widget_hide), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + gtk_window_set_default_size (GTK_WINDOW (dlg), 300, 150); + + scr = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scr); + gtk_container_add (GTK_CONTAINER (dlg), scr); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_container_set_border_width (GTK_CONTAINER (scr), 5); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + s_pEdit = text = gtk_text_view_new(); + gtk_container_add (GTK_CONTAINER (scr), text); + gtk_widget_show (text); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD); + } + + GtkTextBuffer* buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(s_pEdit)); + gtk_text_buffer_set_text (buffer, pText, -1); + gtk_widget_show (g_dlgInfo); +} + +void HideInfoDialog() +{ + if (g_dlgInfo) + gtk_widget_hide (g_dlgInfo); +} + diff --git a/radiant/drag.cpp b/radiant/drag.cpp new file mode 100644 index 00000000..d8df7b82 --- /dev/null +++ b/radiant/drag.cpp @@ -0,0 +1,845 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "stdafx.h" +//#include "qe3.h" + +/* + + drag either multiple brushes, or select plane points from + a single brush. + +*/ + +extern int g_nPatchClickedView; + +qboolean drag_ok; +vec3_t drag_xvec; +vec3_t drag_yvec; + +//static int buttonstate; +int pressx, pressy; +static vec3_t pressdelta; +static vec3_t vPressStart; +//static int buttonx, buttony; + + +//int num_move_points; +//float *move_points[1024]; + +int lastx, lasty; + +qboolean drag_first; + + +void AxializeVector (vec3_t v) +{ + vec3_t a; + float o; + int i; + + if (!v[0] && !v[1]) + return; + if (!v[1] && !v[2]) + return; + if (!v[0] && !v[2]) + return; + + for (i=0 ; i<3 ; i++) + a[i] = fabs(v[i]); + if (a[0] > a[1] && a[0] > a[2]) + i = 0; + else if (a[1] > a[0] && a[1] > a[2]) + i = 1; + else + i = 2; + + o = v[i]; + VectorCopy (vec3_origin, v); + if (o<0) + v[i] = -1; + else + v[i] = 1; + +} + +/* +=========== +Drag_Setup +=========== +*/ +extern void SelectCurvePointByRay (vec3_t org, vec3_t dir, int buttons); + +void Drag_Setup (int x, int y, int buttons, + vec3_t xaxis, vec3_t yaxis, + vec3_t origin, vec3_t dir) +{ + trace_t t; + face_t *f; + + drag_first = true; + + VectorCopy (vec3_origin, pressdelta); + pressx = x; + pressy = y; + + // snap to nearest axis for camwindow drags + VectorCopy (xaxis, drag_xvec); + AxializeVector (drag_xvec); + VectorCopy (yaxis, drag_yvec); + AxializeVector (drag_yvec); + + if (g_qeglobals.d_select_mode == sel_curvepoint) + { + SelectCurvePointByRay (origin, dir, buttons); + + if(g_qeglobals.d_select_mode == sel_area) + { + drag_ok = true; + + if(g_nPatchClickedView == W_CAMERA ) { + VectorSet( g_qeglobals.d_vAreaTL, x, y, 0 ); + VectorSet( g_qeglobals.d_vAreaBR, x, y, 0 ); + } + } + else if (g_qeglobals.d_num_move_points) // don't add an undo if there are no points selected + { + drag_ok = true; + Sys_UpdateWindows(W_ALL); + Undo_Start("drag curve point"); + Undo_AddBrushList(&selected_brushes); + } + return; + } + else + { + g_qeglobals.d_num_move_points = 0; + } + + if (g_qeglobals.d_select_mode == sel_areatall) + { + VectorCopy(origin, g_qeglobals.d_vAreaTL); + VectorCopy(origin, g_qeglobals.d_vAreaBR); + + Sys_UpdateWindows(W_ALL); + + drag_ok = true; + return; + } + + if (selected_brushes.next == &selected_brushes) + { + //in this case a new brush is created when the dragging + //takes place in the XYWnd, An useless undo is created + //when the dragging takes place in the CamWnd + Undo_Start("create brush"); + + Sys_Status("No selection to drag", 0); + return; + } + + if (g_qeglobals.d_select_mode == sel_vertex) + { + SelectVertexByRay (origin, dir); + if (g_qeglobals.d_num_move_points) + { + drag_ok = true; + Undo_Start("drag vertex"); + Undo_AddBrushList(&selected_brushes); + // Need an update here for highlighting selected vertices + Sys_UpdateWindows(W_XY | W_CAMERA); + return; + } + } + + if (g_qeglobals.d_select_mode == sel_edge) + { + SelectEdgeByRay (origin, dir); + if (g_qeglobals.d_num_move_points) + { + drag_ok = true; + Undo_Start("drag edge"); + Undo_AddBrushList(&selected_brushes); + return; + } + } + + // + // check for direct hit first + // + t = Test_Ray (origin, dir, true); + if (t.selected) + { + drag_ok = true; + + Undo_Start("drag selection"); + Undo_AddBrushList(&selected_brushes); + + if (buttons == (MK_LBUTTON|MK_CONTROL) ) + { + Sys_Printf ("Shear dragging face\n"); + Brush_SelectFaceForDragging (t.brush, t.face, true); + } + else if (buttons == (MK_LBUTTON|MK_CONTROL|MK_SHIFT) ) + { + Sys_Printf ("Sticky dragging brush\n"); + for (f=t.brush->brush_faces ; f ; f=f->next) + Brush_SelectFaceForDragging (t.brush, f, false); + } + else + Sys_Printf ("Dragging entire selection\n"); + + return; + } + + if (g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_edge) + return; + + // + // check for side hit + // + // multiple brushes selected? + if (selected_brushes.next->next != &selected_brushes) + { + // yes, special handling + bool bOK = (g_PrefsDlg.m_bALTEdge) ? Sys_AltDown() : true; + if (bOK) + { + for (brush_t* pBrush = selected_brushes.next ; pBrush != &selected_brushes ; pBrush = pBrush->next) + { + if (buttons & MK_CONTROL) + Brush_SideSelect (pBrush, origin, dir, true); + else + Brush_SideSelect (pBrush, origin, dir, false); + } + } + else + { + Sys_Printf ("press ALT to drag multiple edges\n"); + return; + } + } + else + { + // single select.. trying to drag fixed entities handle themselves and just move + if (buttons & MK_CONTROL) + Brush_SideSelect (selected_brushes.next, origin, dir, true); + else + Brush_SideSelect (selected_brushes.next, origin, dir, false); + } + + Sys_Printf ("Side stretch\n"); + drag_ok = true; + + Undo_Start("side stretch"); + Undo_AddBrushList(&selected_brushes); +} + +entity_t *peLink; + +void UpdateTarget(vec3_t origin, vec3_t dir) +{ + trace_t t; + entity_t *pe; + int i; + char sz[128]; + + t = Test_Ray (origin, dir, 0); + + if (!t.brush) + return; + + pe = t.brush->owner; + + if (pe == NULL) + return; + + // is this the first? + if (peLink != NULL) + { + + // Get the target id from out current target + // if there is no id, make one + + i = IntForKey(pe, "target"); + if (i <= 0) + { + i = GetUniqueTargetId(1); + sprintf(sz, "%d", i); + + SetKeyValue(pe, "target", sz); + } + + // set the target # into our src + + sprintf(sz, "%d", i); + SetKeyValue(peLink, "targetname", sz); + + Sys_UpdateWindows(W_ENTITY); + + } + + // promote the target to the src + + peLink = pe; + +} + +/* +=========== +Drag_Begin +//++timo test three button mouse and three button emulation here ? +=========== +*/ +void Drag_Begin (int x, int y, int buttons, + vec3_t xaxis, vec3_t yaxis, + vec3_t origin, vec3_t dir, bool sf_camera) +{ + trace_t t; + bool altdown; + int nFlag; + + drag_ok = false; + VectorCopy (vec3_origin, pressdelta); + VectorCopy (vec3_origin, vPressStart); + + drag_first = true; + peLink = NULL; + + altdown = Sys_AltDown(); + + // shift-LBUTTON = select entire brush + // shift-alt-LBUTTON = drill select + if (buttons == (MK_LBUTTON | MK_SHIFT) && g_qeglobals.d_select_mode != sel_curvepoint) + { + nFlag = altdown ? SF_CYCLE : 0; + if (sf_camera) + nFlag |= SF_CAMERA; + else + nFlag |= SF_ENTITIES_FIRST; + Select_Ray(origin, dir, nFlag); + return; + } + + // (shift-)alt-LBUTTON = area select completely tall + if ( !sf_camera && + ( g_PrefsDlg.m_bALTEdge ? buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT) : (buttons == MK_LBUTTON || buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT)) ) && + altdown && g_qeglobals.d_select_mode != sel_curvepoint) + { + if (g_pParentWnd->ActiveXY()->AreaSelectOK()) + { + g_qeglobals.d_select_mode = sel_areatall; + + Drag_Setup (x, y, buttons, xaxis, yaxis, origin, dir); + return; + } + } + + // ctrl-alt-LBUTTON = multiple brush select without selecting whole entities + if (buttons == (MK_LBUTTON | MK_CONTROL) && altdown && g_qeglobals.d_select_mode != sel_curvepoint) + { + nFlag = 0; + if (sf_camera) + nFlag |= SF_CAMERA; + else + nFlag |= SF_ENTITIES_FIRST; + Select_Ray (origin, dir, nFlag); + UpdateSurfaceDialog(); + + return; + } + + // ctrl-shift LBUTTON = select single face + if (sf_camera && buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT) && g_qeglobals.d_select_mode != sel_curvepoint) + { + if(Sys_AltDown()) + { + brush_t *b; + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if(b->pPatch) + continue; + + for (face_t* pFace = b->brush_faces; pFace; pFace = pFace->next) + { + g_ptrSelectedFaces.Add(pFace); + g_ptrSelectedFaceBrushes.Add(b); + } + } + + for (b = selected_brushes.next; b != &selected_brushes; ) + { + brush_t *pb = b; + b = b->next; + Brush_RemoveFromList (pb); + Brush_AddToList (pb, &active_brushes); + } + } + else + Select_Deselect (true); + + Select_Ray (origin, dir, (SF_SINGLEFACE|SF_CAMERA)); + return; + } + + + // LBUTTON + all other modifiers = manipulate selection + if (buttons & MK_LBUTTON) + { + Drag_Setup (x, y, buttons, xaxis, yaxis, origin, dir); + return; + } + + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + // middle button = grab texture + if (buttons == nMouseButton) + { + t = Test_Ray (origin, dir, false); + if (t.face) + { + UpdateWorkzone_ForBrush( t.brush ); + // use a local brushprimit_texdef fitted to a default 2x2 texture + brushprimit_texdef_t bp_local; + ConvertTexMatWithQTexture( &t.face->brushprimit_texdef, t.face->d_texture, &bp_local, NULL ); + Texture_SetTexture ( &t.face->texdef, &bp_local, false, NULL); + UpdateSurfaceDialog(); + UpdatePatchInspector(); + } + else + Sys_Printf ("Did not select a texture\n"); + return; + } + + // ctrl-middle button = set entire brush to texture + if (buttons == (nMouseButton|MK_CONTROL) ) + { + t = Test_Ray (origin, dir, false); + if (t.brush) + { + if (t.brush->brush_faces->texdef.GetName()[0] == '(') + Sys_Printf ("Can't change an entity texture\n"); + else + { + Brush_SetTexture (t.brush, &g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, false, static_cast( g_qeglobals.d_texturewin.pTexdef ) ); + Sys_UpdateWindows (W_ALL); + } + } + else + Sys_Printf ("Didn't hit a btrush\n"); + return; + } + + // ctrl-shift-middle button = set single face to texture + if (buttons == (nMouseButton|MK_SHIFT|MK_CONTROL) ) + { + t = Test_Ray (origin, dir, false); + if (t.brush) + { + if (t.brush->brush_faces->texdef.GetName()[0] == '(') + Sys_Printf ("Can't change an entity texture\n"); + else + { + SetFaceTexdef (t.face, &g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef); + Brush_Build( t.brush ); + + Sys_UpdateWindows (W_ALL); + } + } + else + Sys_Printf ("Didn't hit a btrush\n"); + return; + } + + if (buttons == (nMouseButton | MK_SHIFT)) + { + Sys_Printf("Set brush face texture info\n"); + t = Test_Ray (origin, dir, false); + if (t.brush) + { + if (t.brush->brush_faces->texdef.GetName()[0] == '(') + { + if (t.brush->owner->eclass->nShowFlags & ECLASS_LIGHT) + { + CString strBuff; + qtexture_t* pTex = g_qeglobals.d_texturewin.pShader->getTexture(); + if (pTex) + { + vec3_t vColor; + VectorCopy(pTex->color, vColor); + + float fLargest = 0.0f; + for (int i = 0; i < 3; i++) + { + if (vColor[i] > fLargest) + fLargest = vColor[i]; + } + + if (fLargest == 0.0f) + { + vColor[0] = vColor[1] = vColor[2] = 1.0f; + } + else + { + float fScale = 1.0f / fLargest; + for (int i = 0; i < 3; i++) + { + vColor[i] *= fScale; + } + } + strBuff.Format("%f %f %f",pTex->color[0], pTex->color[1], pTex->color[2]); + SetKeyValue(t.brush->owner, "_color", strBuff.GetBuffer()); + Sys_UpdateWindows (W_ALL); + } + } + else + { + Sys_Printf ("Can't select an entity brush face\n"); + } + } + else + { + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=425 + Face_SetShader(t.face, g_qeglobals.d_texturewin.texdef.GetName()); + Brush_Build(t.brush); + + Sys_UpdateWindows (W_ALL); + } + } + else + Sys_Printf ("Didn't hit a brush\n"); + return; + } + +} + + +// +//=========== +//MoveSelection +//=========== +// +void MoveSelection (vec3_t move) +{ + int i, success; + brush_t *b; + CString strStatus; + vec3_t vTemp, vTemp2, end; + + if (!move[0] && !move[1] && !move[2]) + { + return; + } + + if (!(g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall)) + { + move[0] = (g_nScaleHow & SCALE_X) ? 0 : move[0]; + move[1] = (g_nScaleHow & SCALE_Y) ? 0 : move[1]; + move[2] = (g_nScaleHow & SCALE_Z) ? 0 : move[2]; + } + + if (g_pParentWnd->ActiveXY()->RotateMode() || g_bPatchBendMode) + { + float fDeg = -move[2]; + float fAdj = move[2]; + int nAxis = 0; + if (g_pParentWnd->ActiveXY()->GetViewType() == XY) + { + fDeg = -move[1]; + fAdj = move[1]; + nAxis = 2; + } + else + if (g_pParentWnd->ActiveXY()->GetViewType() == XZ) + { + fDeg = move[2]; + fAdj = move[2]; + nAxis = 1; + } + else + nAxis = 0; + + g_pParentWnd->ActiveXY()->Rotation()[nAxis] += fAdj; + strStatus.Format("%s x:: %.1f y:: %.1f z:: %.1f", (g_bPatchBendMode) ? "Bend angle" : "Rotation", g_pParentWnd->ActiveXY()->Rotation()[0], g_pParentWnd->ActiveXY()->Rotation()[1], g_pParentWnd->ActiveXY()->Rotation()[2]); + g_pParentWnd->SetStatusText(2, strStatus); + + if (g_bPatchBendMode) + { + Patch_SelectBendNormal(); + Select_RotateAxis(nAxis, fDeg*2, false, true); + Patch_SelectBendAxis(); + Select_RotateAxis(nAxis, fDeg, false, true); + } + else + { + Select_RotateAxis(nAxis, fDeg, false, true); + } + return; + } + + if (g_pParentWnd->ActiveXY()->ScaleMode()) + { + vec3_t v; + v[0] = v[1] = v[2] = 1.0f; + if (move[1] > 0) + { + v[0] = 1.1f; + v[1] = 1.1f; + v[2] = 1.1f; + } + else + if (move[1] < 0) + { + v[0] = 0.9f; + v[1] = 0.9f; + v[2] = 0.9f; + } + + Select_Scale((g_nScaleHow & SCALE_X) ? 1.0f : v[0], + (g_nScaleHow & SCALE_Y) ? 1.0f : v[1], + (g_nScaleHow & SCALE_Z) ? 1.0f : v[2]); + // is that really necessary??? + Sys_UpdateWindows (W_ALL); + return; + } + + + vec3_t vDistance; + VectorSubtract(pressdelta, vPressStart, vDistance); + strStatus.Format("Distance x: %.1f y: %.1f z: %.1f", vDistance[0], vDistance[1], vDistance[2]); + g_pParentWnd->SetStatusText(3, strStatus); + + // + // dragging only a part of the selection + // + + // this is fairly crappy way to deal with curvepoint and area selection + // but it touches the smallest amount of code this way + // + if (g_qeglobals.d_num_move_points || g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall) + { + //area selection + if (g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall) + { + VectorAdd(g_qeglobals.d_vAreaBR, move, g_qeglobals.d_vAreaBR); + return; + } + //curve point selection + if (g_qeglobals.d_select_mode == sel_curvepoint) + { + Patch_UpdateSelected(move); + return; + } + //vertex selection + if (g_qeglobals.d_select_mode == sel_vertex && g_PrefsDlg.m_bVertexSplit) + { + if(g_qeglobals.d_num_move_points) { + success = true; + for (b = selected_brushes.next; b != &selected_brushes; b = b->next) + { + success &= Brush_MoveVertex(b, g_qeglobals.d_move_points[0], move, end, true); + } + if (success) + VectorCopy(end, g_qeglobals.d_move_points[0]); + } + return; + } + //all other selection types + for (i=0 ; inext) + { + bool bMoved = false; + for(face_t *f = b->brush_faces; !bMoved && f!=NULL; f=f->next) + for(int p=0; !bMoved && p<3; p++) + for (i=0 ; !bMoved && iplanepts[p] == g_qeglobals.d_move_points[i]) + bMoved = true; + if(!bMoved) continue; + + VectorCopy(b->maxs, vTemp); + VectorSubtract(vTemp, b->mins, vTemp); + Brush_Build(b,true,true,false,false); // don't filter + for (i=0 ; i<3 ; i++) + { + if (b->mins[i] > b->maxs[i] + || b->maxs[i] - b->mins[i] > g_MaxBrushSize) + break; // dragged backwards or fucked up + } + if (i != 3) + break; + if (b->patchBrush) + { + VectorCopy(b->maxs, vTemp2); + VectorSubtract(vTemp2, b->mins, vTemp2); + VectorSubtract(vTemp2, vTemp, vTemp2); + //if (!Patch_DragScale(b->nPatchID, vTemp2, move)) + if (!Patch_DragScale(b->pPatch, vTemp2, move)) + { + b = NULL; + break; + } + } + } + // if any of the brushes were crushed out of existance + // calcel the entire move + if (b != &selected_brushes) + { + Sys_Printf ("Brush dragged backwards, move canceled\n"); + for (i=0 ; inext) + Brush_Build(b,true,true,false,false); // don't filter + } + + } + else + { + // reset face originals from vertex edit mode + // this is dirty, but unfortunately necessary because Brush_Build + // can remove windings + for (b = selected_brushes.next; b != &selected_brushes; b = b->next) + { + Brush_ResetFaceOriginals(b); + } + // + // if there are lots of brushes selected, just translate instead + // of rebuilding the brushes + // NOTE: this is not actually done, but would be a good idea + // + Select_Move (move); + } +} + +/* +=========== +Drag_MouseMoved +=========== +*/ +void Drag_MouseMoved (int x, int y, int buttons) +{ + vec3_t move, delta; + int i; + + if (!buttons) + { + drag_ok = false; + return; + } + if (!drag_ok) + return; + + // clear along one axis + if (buttons & MK_SHIFT && (g_PrefsDlg.m_bALTEdge && g_qeglobals.d_select_mode != sel_areatall)) + { + drag_first = false; + if (abs(x-pressx) > abs(y-pressy)) + y = pressy; + else + x = pressx; + } + + if (g_qeglobals.d_select_mode == sel_area && g_nPatchClickedView == W_CAMERA) + { + camera_t *m_pCamera = g_pParentWnd->GetCamWnd()->Camera(); + + // snap to window + if( y > m_pCamera->height ) y = m_pCamera->height - 1; else if( y < 0 ) y = 0; + if( x > m_pCamera->width ) x = m_pCamera->width - 1; else if( x < 0 ) x = 0; + + VectorSet (move, x - pressx, y - pressy, 0); + } else + { + for (i=0 ; i<3 ; i++) + { + move[i] = drag_xvec[i]*(x - pressx) + drag_yvec[i]*(y - pressy); + if (!g_PrefsDlg.m_bNoClamp) + { + move[i] = floor(move[i]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize; + } + } + } + + VectorSubtract (move, pressdelta, delta); + VectorCopy (move, pressdelta); + + MoveSelection (delta); +} + +/* +=========== +Drag_MouseUp +=========== +*/ +void Drag_MouseUp (int nButtons) +{ + Sys_Status ("Drag completed.", 0); + + if (g_qeglobals.d_select_mode == sel_area) + { + Patch_SelectAreaPoints(nButtons & MK_CONTROL); // adds to selection and/or deselects selected points if ctrl is held + g_qeglobals.d_select_mode = sel_curvepoint; + Sys_UpdateWindows (W_ALL); + } + + if (g_qeglobals.d_select_mode == sel_areatall) + { + vec3_t mins, maxs; + + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + + // get our rectangle + mins[nDim1] = MIN( g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1] ); + mins[nDim2] = MIN( g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2] ); + maxs[nDim1] = MAX( g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1] ); + maxs[nDim2] = MAX( g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2] ); + + // deselect current selection + if( !(nButtons & (MK_CONTROL|MK_SHIFT)) ) + Select_Deselect(); + + // select new selection + Select_RealCompleteTall( mins, maxs ); + + Sys_UpdateWindows (W_ALL); + } + + if (g_qeglobals.d_select_translate[0] || g_qeglobals.d_select_translate[1] || g_qeglobals.d_select_translate[2]) + { + Select_Move (g_qeglobals.d_select_translate); + VectorCopy (vec3_origin, g_qeglobals.d_select_translate); + Sys_UpdateWindows (W_CAMERA); + } + + /* note: added cleanup here, since an edge drag will leave selected vertices + in g_qeglobals.d_num_move_points + */ + if ( g_qeglobals.d_select_mode != sel_vertex && + g_qeglobals.d_select_mode != sel_curvepoint && + g_qeglobals.d_select_mode != sel_edge) + g_qeglobals.d_num_move_points = 0; + + g_pParentWnd->SetStatusText(3, ""); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + UpdateSurfaceDialog(); +} diff --git a/radiant/eclass.cpp b/radiant/eclass.cpp index edbf4156..cd6cd485 100644 --- a/radiant/eclass.cpp +++ b/radiant/eclass.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,396 +19,479 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "eclass.h" +#include "stdafx.h" +#include +#if defined (__linux__) || defined (__APPLE__) +#include +#endif +#include "assert.h" -#include "debugging/debugging.h" +eclass_t *eclass = NULL; +eclass_t *eclass_bad = NULL; +const vec3_t smallbox[2] = {{-8,-8,-8},{8,8,8}}; +char eclass_directory[1024]; -#include - -#include "ifilesystem.h" - -#include "string/string.h" -#include "eclasslib.h" -#include "os/path.h" -#include "os/dir.h" -#include "stream/stringstream.h" -#include "moduleobservers.h" - -#include "cmdlib.h" - -#include "preferences.h" -#include "mainframe.h" - - -namespace -{ - typedef std::map EntityClasses; - EntityClasses g_entityClasses; - EntityClass *eclass_bad = 0; - char eclass_directory[1024]; - typedef std::map ListAttributeTypes; - ListAttributeTypes g_listTypes; -} - -EClassModules& EntityClassManager_getEClassModules(); +qboolean parsing_single = false; +eclass_t *eclass_e; /*! implementation of the EClass manager API */ - -void CleanEntityList(EntityClasses& entityClasses) +eclass_t** Get_EClass_E() { - for(EntityClasses::iterator i = entityClasses.begin(); i != entityClasses.end(); ++i) - { - (*i).second->free((*i).second); - } - entityClasses.clear(); + return &eclass_e; } -void Eclass_Clear() +void Set_Eclass_Found(qboolean b) { - CleanEntityList(g_entityClasses); - g_listTypes.clear(); + eclass_found = b; } -EntityClass* EClass_InsertSortedList(EntityClasses& entityClasses, EntityClass *entityClass) +qboolean Get_Parsing_Single() { - std::pair result = entityClasses.insert(EntityClasses::value_type(entityClass->name(), entityClass)); - if(!result.second) - { - entityClass->free(entityClass); - } - return (*result.first).second; -} - -EntityClass* Eclass_InsertAlphabetized (EntityClass *e) -{ - return EClass_InsertSortedList(g_entityClasses, e); -} - -void Eclass_forEach(EntityClassVisitor& visitor) -{ - for(EntityClasses::iterator i = g_entityClasses.begin(); i != g_entityClasses.end(); ++i) - { - visitor.visit((*i).second); - } + return parsing_single; } -class RadiantEclassCollector : public EntityClassCollector +// md3 cache for misc_models +//eclass_t *g_md3Cache = NULL; + +/* + +the classname, color triple, and bounding box are parsed out of comments +A ? size means take the exact brush size. + +/ *QUAKED (0 0 0) ? +/ *QUAKED (0 0 0) (-8 -8 -8) (8 8 8) + +Flag names can follow the size description: + +/ *QUAKED func_door (0 .5 .8) ? START_OPEN STONE_SOUND DOOR_DONT_LINK GOLD_KEY SILVER_KEY + +*/ + +void CleanEntityList(eclass_t *&pList) { -public: - void insert(EntityClass* eclass) + while (pList) { - Eclass_InsertAlphabetized(eclass); - } - void insert(const char* name, const ListAttributeType& list) - { - g_listTypes.insert(ListAttributeTypes::value_type(name, list)); - } -}; + eclass_t* pTemp = pList->next; -RadiantEclassCollector g_collector; - -const ListAttributeType* EntityClass_findListType(const char* name) -{ - ListAttributeTypes::iterator i = g_listTypes.find(name); - if(i != g_listTypes.end()) - { - return &(*i).second; - } - return 0; -} - - -class EntityClassFilterMode -{ -public: - bool filter_mp_sp; - const char* mp_ignore_prefix; - const char* sp_ignore_prefix; - - EntityClassFilterMode() : - filter_mp_sp(!string_empty(g_pGameDescription->getKeyValue("eclass_filter_gamemode"))), - mp_ignore_prefix(g_pGameDescription->getKeyValue("eclass_sp_prefix")), - sp_ignore_prefix(g_pGameDescription->getKeyValue("eclass_mp_prefix")) - { - if(string_empty(mp_ignore_prefix)) + entitymodel *model = pList->model; + while (model != NULL) { - mp_ignore_prefix = "sp_"; + delete []model->pTriList; + if (model->strSkin) + g_string_free( (GString *)model->strSkin, TRUE ); + model->strSkin = NULL; + model = model->pNext; } - if(string_empty(sp_ignore_prefix)) - { - sp_ignore_prefix = "mp_"; + + if (pList->modelpath) { + free(pList->modelpath); + pList->modelpath = NULL; } + if (pList->skinpath) { + free(pList->skinpath); + pList->skinpath = NULL; + } + + free(pList->name); + free(pList->comments); + free(pList); + pList = pTemp; } -}; -class EntityClassesLoadFile + pList = NULL; + +} + + +void CleanUpEntities() { - const EntityClassScanner& scanner; - const char* m_directory; -public: - EntityClassesLoadFile(const EntityClassScanner& scanner, const char* directory) : scanner(scanner), m_directory(directory) + // NOTE: maybe some leak checks needed .. older versions of Radiant looked like they were freezing more stuff + CleanEntityList(eclass); + //CleanEntityList(g_md3Cache); + if (eclass_bad) { + free(eclass_bad->name); + free(eclass_bad->comments); + free(eclass_bad); + eclass_bad = NULL; } - void operator()(const char* name) const - { - EntityClassFilterMode filterMode; +} - if(filterMode.filter_mp_sp) - { - if(string_empty(GlobalRadiant().getGameMode()) || string_equal(GlobalRadiant().getGameMode(), "sp")) - { - if(string_equal_n(name, filterMode.sp_ignore_prefix, strlen(filterMode.sp_ignore_prefix))) - { - globalOutputStream() << "Ignoring '" << name << "'\n"; - return; - } - } - else - { - if(string_equal_n(name, filterMode.mp_ignore_prefix, strlen(filterMode.mp_ignore_prefix))) - { - globalOutputStream() << "Ignoring '" << name << "'\n"; - return; - } - } - } +void EClass_InsertSortedList(eclass_t *&pList, eclass_t *e) +{ + eclass_t *s; + + if (!pList) + { + pList = e; + return; + } + + + s = pList; + if (stricmp (e->name, s->name) < 0) + { + e->next = s; + pList = e; + return; + } + + do + { + if (!s->next || stricmp (e->name, s->next->name) < 0) + { + e->next = s->next; + s->next = e; + return; + } + s=s->next; + } while (1); +} + +/* +================= +Eclass_InsertAlphabetized +================= +*/ +void Eclass_InsertAlphabetized (eclass_t *e) +{ +#if 1 + EClass_InsertSortedList(eclass, e); +#else + eclass_t *s; + + if (!eclass) + { + eclass = e; + return; + } + + + s = eclass; + if (stricmp (e->name, s->name) < 0) + { + e->next = s; + eclass = e; + return; + } + + do + { + if (!s->next || stricmp (e->name, s->next->name) < 0) + { + e->next = s->next; + s->next = e; + return; + } + s=s->next; + } while (1); +#endif +} + +/*! +This looks at each eclass_t, if it has a "modelpath" set then it leaves it alone +if it's not set it checks to see if a file called "sprites/.*" exists, and +if it does exist then it sets the "modelpath" to "sprites/.spr" +*/ +void Eclass_CreateSpriteModelPaths() +{ + int Counts[4] = { 0, 0, 0, 0 }; + char filename[512]; // should be big enough, ExtractFileBase doesn't take a buffer size... + eclass_t *e; + + // get a list of all sprite/*>* files in all sprite/ directories + Sys_Printf("Searching VFS for files in sprites/*.* that match entity names...\n"); + GSList *pFiles = vfsGetFileList("sprites", NULL); + GSList *pFile; + + if (pFiles) + { + // find an eclass without a modelpath. + for (e=eclass ; e ; e=e->next) + { + Counts[0]++; + if (e->modelpath) + { +#ifdef _DEBUG + Sys_Printf("Ignoring sprite for entity %s (modelpath: \"%s\")\n",e->name,e->modelpath); +#endif + Counts[1]++; + continue; // ignore this eclass, it's already got a model + } + + // TODO: remove this check when we can have sprites for non-fixed size entities. + if (!e->fixedsize) + { +#ifdef _DEBUG + Sys_Printf("Ignoring sprite for non-fixed-size entity %s\n",e->name); +#endif + Counts[2]++; + continue; // can't have sprites for non-fixed size entities (yet!) + } + + + Sys_Printf("Searching for sprite for fixed-size entity %s...",e->name); + + pFile = pFiles; // point to start of list + + // look for a file that has the same name, with any extension. + bool Found = FALSE; + while (pFile) + { + + // strip the path/ and the .extension. + ExtractFileBase((char *)pFile->data,filename); + + // does the eclass name match the filename? + if (stricmp(e->name,filename) == 0) + { + // yes, so generate a sprite filename using the all-encompasing .spr extension + // so that the model wrapper knows the sprite model plugin will be the model + // plugin used to render it. + CString strSpriteName; + strSpriteName.Format("sprites/%s.spr",e->name); + e->modelpath = strdup(strSpriteName.GetBuffer()); + Sys_Printf("Found! (\"%s\")\n",(char *)pFile->data); + Counts[3]++; + Found = TRUE; + } + pFile = pFile->next; + } + + if (!Found) + Sys_Printf("not found\n"); + + } + + vfsClearFileDirList(&pFiles); + } + Sys_Printf("%d entities were scanned\n" + "%d entities that already had models/sprites were ignored\n" + "%d non-fixed-size entities were ignored\n" + "%d entities did not have matching sprite files\n" + "%d entities had sprite files and have been attached\n", + Counts[0],Counts[1],Counts[2],Counts[0]-Counts[3],Counts[3]); + +} + +void EClass_InitForFileList(GSList *pFiles, _EClassTable *pTable) +{ + GSList *pFile = pFiles; + while (pFile) + { // for a given name, we grab the first .def in the vfs // this allows to override baseq3/scripts/entities.def for instance - StringOutputStream relPath(256); - relPath << m_directory << name; - - scanner.scanFile(g_collector, relPath.c_str()); - } -}; - -struct PathLess -{ - bool operator()(const CopiedString& path, const CopiedString& other) const - { - return path_less(path.c_str(), other.c_str()); - } -}; - -typedef std::map Paths; - -class PathsInsert -{ - Paths& m_paths; - const char* m_directory; -public: - PathsInsert(Paths& paths, const char* directory) : m_paths(paths), m_directory(directory) - { - } - void operator()(const char* name) const - { - m_paths.insert(Paths::value_type(name, m_directory)); - } -}; - - -void EntityClassQuake3_constructDirectory(const char* directory, const char* extension, Paths& paths) -{ - globalOutputStream() << "EntityClass: searching " << makeQuoted(directory) << " for *." << extension << '\n'; - Directory_forEach(directory, matchFileExtension(extension, PathsInsert(paths, directory))); -} - - -void EntityClassQuake3_Construct() -{ - StringOutputStream baseDirectory(256); - StringOutputStream gameDirectory(256); - const char* basegame = GlobalRadiant().getRequiredGameDescriptionKeyValue("basegame"); - const char* gamename = GlobalRadiant().getGameName(); - baseDirectory << GlobalRadiant().getGameToolsPath() << basegame << '/'; - gameDirectory << GlobalRadiant().getGameToolsPath() << gamename << '/'; - - class LoadEntityDefinitionsVisitor : public EClassModules::Visitor - { - const char* baseDirectory; - const char* gameDirectory; - public: - LoadEntityDefinitionsVisitor(const char* baseDirectory, const char* gameDirectory) - : baseDirectory(baseDirectory), gameDirectory(gameDirectory) + char relPath[PATH_MAX]; + strcpy(relPath, "scripts/"); + strcat(relPath, (char*)pFile->data); + // FIXME TTimo http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 + if (!vfsGetFullPath(relPath, 0, 0)) { + Sys_FPrintf(SYS_ERR, "Failed to find the full path for '%s' in the VFS\n", relPath); + Sys_FPrintf(SYS_ERR, "did you hit bug http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 ?\n"); } - void visit(const char* name, const EntityClassScanner& table) const - { - Paths paths; - EntityClassQuake3_constructDirectory(baseDirectory, table.getExtension(), paths); - if(!string_equal(baseDirectory, gameDirectory)) - { - EntityClassQuake3_constructDirectory(gameDirectory, table.getExtension(), paths); - } - - for(Paths::iterator i = paths.begin(); i != paths.end(); ++i) - { - EntityClassesLoadFile(table, (*i).second)((*i).first.c_str()); - } - } - }; - - EntityClassManager_getEClassModules().foreachModule(LoadEntityDefinitionsVisitor(baseDirectory.c_str(), gameDirectory.c_str())); + else + pTable->m_pfnScanFile(vfsGetFullPath(relPath, 0, 0)); + pFile = pFile->next; + } } -EntityClass *Eclass_ForName(const char *name, bool has_brushes) +/*! +Manually create an eclass_t, for when no modules exist. +this replaces and centralizes the eclass_t allocation +*/ +eclass_t * EClass_Create( const char *name, float col1, float col2, float col3, const vec3_t *mins, const vec3_t *maxs, const char *comments ) { - ASSERT_NOTNULL(name); + eclass_t *e; + char color[128]; - if(string_empty(name)) + e = (eclass_t*)malloc(sizeof(*e)); + memset (e, 0, sizeof(*e)); + + e->name = strdup(name); + + // grab the color, reformat as texture name + e->color[0] = col1; + e->color[1] = col2; + e->color[2] = col3; + sprintf (color, "(%f %f %f)", e->color[0], e->color[1], e->color[2]); + e->texdef.SetName(color); + + // supplied size ? + if (mins && maxs) { - return eclass_bad; + // Hydra: + // If we set worldspawn to be a fixed-size all the textures are + // displayed as flat-shaded. This is a KLUDGE now that we have + // multiple game support as the worldspawn entity is game specific. + // Note that this is only ever fixed for the user if a definition + // for the worldspawn entity was not loaded, this can happen for + // several reasons: + // a) no entity definition plugin exists + // b) no entity definition files were found + // c) no entity definition file contained an entry for worldspawn. + + if (stricmp(name,"worldspawn") != 0) e->fixedsize = true; + + // copy the sizes.. + memcpy(e->mins,mins,sizeof(vec3_t)); + memcpy(e->maxs,maxs,sizeof(vec3_t)); } - EntityClasses::iterator i = g_entityClasses.find(name); - if(i != g_entityClasses.end() && string_equal((*i).first, name)) + if (comments) + e->comments = strdup(comments); + else { - return (*i).second; + e->comments = (char*)malloc(1); + e->comments[0] = '\0'; } - EntityClass* e = EntityClass_Create_Default(name, has_brushes); - return Eclass_InsertAlphabetized(e); + return e; } -class EntityClassQuake3 : public ModuleObserver +void Eclass_Init () { - std::size_t m_unrealised; - ModuleObservers m_observers; -public: - EntityClassQuake3() : m_unrealised(4) - { - } - void realise() - { - if(--m_unrealised == 0) - { - //globalOutputStream() << "Entity Classes: realise\n"; - EntityClassQuake3_Construct(); - m_observers.realise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - m_observers.unrealise(); - //globalOutputStream() << "Entity Classes: unrealise\n"; - Eclass_Clear(); - } - } - void attach(ModuleObserver& observer) - { - m_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - m_observers.detach(observer); - } -}; + GSList *pFiles; -EntityClassQuake3 g_EntityClassQuake3; - -void EntityClass_attach(ModuleObserver& observer) -{ - g_EntityClassQuake3.attach(observer); -} -void EntityClass_detach(ModuleObserver& observer) -{ - g_EntityClassQuake3.detach(observer); -} - -void EntityClass_realise() -{ - g_EntityClassQuake3.realise(); -} -void EntityClass_unrealise() -{ - g_EntityClassQuake3.unrealise(); -} - -void EntityClassQuake3_construct() -{ // start by creating the default unknown eclass - eclass_bad = EClass_Create("UNKNOWN_CLASS", Vector3(0.0f, 0.5f, 0.0f), ""); - - EntityClass_realise(); + eclass_bad = EClass_Create("UNKNOWN_CLASS" , 0, 0.5, 0,NULL,NULL,NULL); + + // now scan the definitions + _EClassTable *pTable = &g_EClassDefTable; + while (pTable) + { + // read in all scripts/*. + pFiles = vfsGetFileList("scripts", pTable->m_pfnGetExtension()); + if (pFiles) + { + GSList *pFile = pFiles; + while (pFile) + { + /*! + \todo the MP/SP filtering rules need to be CLEANED UP and SANITIZED + */ + // HACK + // JKII SP/MP mapping mode + if (g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"), "sp")) + { + // SP mapping, ignore mp_*.def + char *name = (char *)pFile->data; + if (name[0]=='m' && name[1]=='p' && name[2]=='_') + { + Sys_Printf("Single Player mapping mode. Ignoring '%s'\n", name); + pFile = pFile->next; + continue; + } + } + else + { + // MP mapping, ignore sp_*.def + char *name = (char *)pFile->data; + if (name[0]=='s' && name[1]=='p' && name[2]=='_') + { + Sys_Printf("Multiplayer mapping mode. Ignoring '%s'\n", name); + pFile = pFile->next; + continue; + } + } + } + // RIANT + // STVEF SP/MP mapping mode + else if (g_pGameDescription->mGameFile == "stvef.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"), "sp")) + { + // SP mapping, ignore mp_*.def + char *name = (char *)pFile->data; + if (name[0]=='m' && name[1]=='p' && name[2]=='_') + { + Sys_Printf("Single Player mapping mode. Ignoring '%s'\n", name); + pFile = pFile->next; + continue; + } + } + else + { + // HM mapping, ignore sp_*.def + char *name = (char *)pFile->data; + if (name[0]=='h' && name[1]=='m' && name[2]=='_') + { + Sys_Printf("HoloMatch mapping mode. Ignoring '%s'\n", name); + pFile = pFile->next; + continue; + } + } + } + // for a given name, we grab the first .def in the vfs + // this allows to override baseq3/scripts/entities.def for instance + char relPath[PATH_MAX]; + strcpy(relPath, "scripts/"); + strcat(relPath, (char*)pFile->data); + // FIXME TTimo http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 + char *fullpath = vfsGetFullPath(relPath, 0, 0); + if (!fullpath) + { + Sys_FPrintf(SYS_ERR, "Failed to find the full path for \"%s\" in the VFS\n", relPath); + Sys_FPrintf(SYS_ERR, "did you hit bug http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 ?\n"); + } + else + pTable->m_pfnScanFile(fullpath); + if (g_pGameDescription->mEClassSingleLoad) + break; + pFile = pFile->next; + } + vfsClearFileDirList(&pFiles); + pFiles = NULL; + } + else + Sys_FPrintf(SYS_ERR, "Didn't find any scripts/*.%s files to load EClass information\n", pTable->m_pfnGetExtension()); + + // we deal with two formats max, if the other table exists, loop again + if (g_bHaveEClassExt && pTable == &g_EClassDefTable) + pTable = &g_EClassExtTable; + else + pTable = NULL; // done, exit + } + Eclass_CreateSpriteModelPaths(); } -void EntityClassQuake3_destroy() +eclass_t *Eclass_ForName (const char *name, qboolean has_brushes) { - EntityClass_unrealise(); + eclass_t *e; - eclass_bad->free(eclass_bad); + if (!name || *name == '\0') + return eclass_bad; + +#ifdef _DEBUG + // grouping stuff, not an eclass + if (strcmp(name, "group_info")==0) + Sys_Printf("WARNING: unexpected group_info entity in Eclass_ForName\n"); +#endif + + if (!name) + return eclass_bad; + + for (e=eclass ; e ; e=e->next) + if (!strcmp (name, e->name)) + return e; + + // create a new class for it + if (has_brushes) + { + e = EClass_Create(name , 0, 0.5, 0,NULL,NULL,"Not found in source."); + } + else + { + e = EClass_Create(name , 0, 0.5, 0,&smallbox[0],&smallbox[1],"Not found in source."); + } + + Eclass_InsertAlphabetized (e); + + return e; } - -#include "modulesystem/modulesmap.h" - -class EntityClassQuake3Dependencies : - public GlobalRadiantModuleRef, - public GlobalFileSystemModuleRef, - public GlobalShaderCacheModuleRef -{ - EClassModulesRef m_eclass_modules; -public: - EntityClassQuake3Dependencies() : - m_eclass_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclasstype")) - { - } - EClassModules& getEClassModules() - { - return m_eclass_modules.get(); - } -}; - -class EclassManagerAPI -{ - EntityClassManager m_eclassmanager; -public: - typedef EntityClassManager Type; - STRING_CONSTANT(Name, "quake3"); - - EclassManagerAPI() - { - EntityClassQuake3_construct(); - - m_eclassmanager.findOrInsert = &Eclass_ForName; - m_eclassmanager.findListType = &EntityClass_findListType; - m_eclassmanager.forEach = &Eclass_forEach; - m_eclassmanager.attach = &EntityClass_attach; - m_eclassmanager.detach = &EntityClass_detach; - m_eclassmanager.realise = &EntityClass_realise; - m_eclassmanager.unrealise = &EntityClass_unrealise; - - GlobalRadiant().attachGameToolsPathObserver(g_EntityClassQuake3); - GlobalRadiant().attachGameModeObserver(g_EntityClassQuake3); - GlobalRadiant().attachGameNameObserver(g_EntityClassQuake3); - } - ~EclassManagerAPI() - { - GlobalRadiant().detachGameNameObserver(g_EntityClassQuake3); - GlobalRadiant().detachGameModeObserver(g_EntityClassQuake3); - GlobalRadiant().detachGameToolsPathObserver(g_EntityClassQuake3); - - EntityClassQuake3_destroy(); - } - EntityClassManager* getTable() - { - return &m_eclassmanager; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule EclassManagerModule; -typedef Static StaticEclassManagerModule; -StaticRegisterModule staticRegisterEclassManager(StaticEclassManagerModule::instance()); - -EClassModules& EntityClassManager_getEClassModules() -{ - return StaticEclassManagerModule::instance().getDependencies().getEClassModules(); -} - diff --git a/radiant/eclass.h b/radiant/eclass.h deleted file mode 100644 index 48d52ba3..00000000 --- a/radiant/eclass.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ECLASS_H) -#define INCLUDED_ECLASS_H - -#endif diff --git a/radiant/eclass_def.cpp b/radiant/eclass_def.cpp index 01341ed5..d5988860 100644 --- a/radiant/eclass_def.cpp +++ b/radiant/eclass_def.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,159 +19,93 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "cmdlib.h" + +#include "synapse.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#define USE_ECLASSMANAGER_DEFINE +#include "ieclass.h" +#define USE_SCRIPLIBTABLE_DEFINE +#include "iscriplib.h" + +#define __VFSTABLENAME g_FileSystemTable_def +#define USE_VFSTABLE_DEFINE +#include "ifilesystem.h" + + #include "eclass_def.h" -#include "iscriplib.h" -#include "ifilesystem.h" -#include "iarchive.h" +/*! \file eclass_def.cpp + \brief .def entity description format + implements parsing for .def entity format + this is statically linked into the radiant core as we always need it, but really considered + as an idependant module by the rest of the core. "ECLASS_MAJOR" "def" +*/ -#include "eclasslib.h" -#include "stream/stringstream.h" -#include "stream/textfilestream.h" -#include "modulesystem/moduleregistry.h" -#include "os/path.h" +_QERScripLibTable g_ScripLibTable; +_EClassManagerTable g_EClassManagerTable; +_QERFuncTable_1 g_FuncTable; +_QERFileSystemTable g_FileSystemTable_def; + +CSynapseBuiltinClientDef eclass_def; + +// forward declare, I'm cheap +void Eclass_ScanFile (char *filename); const char* EClass_GetExtension() { return "def"; } -void Eclass_ScanFile (EntityClassCollector& collector, const char *filename); - -#include "modulesystem/singletonmodule.h" - -class EntityClassDefDependencies : public GlobalShaderCacheModuleRef, public GlobalScripLibModuleRef +void CSynapseBuiltinClientDef::EnumerateInterfaces(CSynapseServer *server) { -}; - -class EclassDefAPI -{ - EntityClassScanner m_eclassdef; -public: - typedef EntityClassScanner Type; - STRING_CONSTANT(Name, "def"); - - EclassDefAPI() - { - m_eclassdef.scanFile = &Eclass_ScanFile; - m_eclassdef.getExtension = &EClass_GetExtension; - } - EntityClassScanner* getTable() - { - return &m_eclassdef; - } -}; - -typedef SingletonModule EclassDefModule; -typedef Static StaticEclassDefModule; -StaticRegisterModule staticRegisterEclassDef(StaticEclassDefModule::instance()); - - -#include "string/string.h" - -#include - - -char com_token[1024]; -bool com_eof; - -/* -============== -COM_Parse - -Parse a token out of a string -============== -*/ -const char *COM_Parse (const char *data) -{ - int c; - int len; - - len = 0; - com_token[0] = 0; - - if (!data) - return 0; - -// skip whitespace -skipwhite: - while ( (c = *data) <= ' ') - { - if (c == 0) - { - com_eof = true; - return 0; // end of file; - } - data++; - } - -// skip // comments - if (c=='/' && data[1] == '/') - { - while (*data && *data != '\n') - data++; - goto skipwhite; - } - - -// handle quoted strings specially - if (c == '\"') - { - data++; - do - { - c = *data++; - if (c=='\"') - { - com_token[len] = 0; - return data; - } - com_token[len] = c; - len++; - } while (1); - } - -// parse single characters - if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':') - { - com_token[len] = c; - len++; - com_token[len] = 0; - return data+1; - } - -// parse a regular word - do - { - com_token[len] = c; - data++; - len++; - c = *data; - if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':') - break; - } while (c>32); - - com_token[len] = 0; - return data; + AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(g_ScripLibTable), SYN_REQUIRE, &g_ScripLibTable); + AddAPI(RADIANT_MAJOR, NULL, sizeof(g_FuncTable), SYN_REQUIRE, &g_FuncTable); + AddAPI(ECLASSMANAGER_MAJOR, NULL, sizeof(g_EClassManagerTable), SYN_REQUIRE, &g_EClassManagerTable); + // hardcode the minor for now, we can still add it to the synapse.config at some point + AddAPI(VFS_MAJOR, "pk3", sizeof(g_FileSystemTable_def), SYN_REQUIRE, &g_FileSystemTable_def); + + AddAPI(ECLASS_MAJOR, "def", sizeof(_EClassTable)); } -const char* Get_COM_Token() +bool CSynapseBuiltinClientDef::RequestAPI(APIDescriptor_t *pAPI) { - return com_token; + if (!strcmp(pAPI->major_name, ECLASS_MAJOR)) + { + _EClassTable* pTable= static_cast<_EClassTable*>(pAPI->mpTable); + pTable->m_pfnScanFile = &Eclass_ScanFile; + pTable->m_pfnGetExtension = &EClass_GetExtension; + + return true; + } + + Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo()); + return false; } +#include "version.h" -const char *debugname; +const char* CSynapseBuiltinClientDef::GetInfo() +{ + return "Builtin .def module built " __DATE__ " " RADIANT_VERSION; +} -void setSpecialLoad(EntityClass *e, const char* pWhat, CopiedString& p) +// ------------------------------------------------------------------------------------------------ + +qboolean eclass_found; +char *debugname; + +void setSpecialLoad(eclass_t *e, const char* pWhat, char*& p) { // Hydra: removed some amazingly bad cstring usage, whoever wrote that // needs to be taken out and shot. - const char *pText = 0; - const char *where = 0; + char *pText = NULL; + char *where = NULL; - where = strstr(e->comments(),pWhat); + p = NULL; // incase we don't find what we're looking for. + where = strstr(e->comments,pWhat); if (!where) return; @@ -182,52 +116,48 @@ void setSpecialLoad(EntityClass *e, const char* pWhat, CopiedString& p) where = strchr(pText,'\"'); if (where) { - p = StringRange(pText, where); + int len = (where-pText); + p = new char[len + 1]; + strncpy(p,pText,len); + p[len]=0; // just to make sure, as most implementations of strncpy don't null terminate } else - { - p = pText; - } + p = strdup(pText); } -#include "eclasslib.h" - -/* - -the classname, color triple, and bounding box are parsed out of comments -A ? size means take the exact brush size. - -/ *QUAKED (0 0 0) ? -/ *QUAKED (0 0 0) (-8 -8 -8) (8 8 8) - -Flag names can follow the size description: - -/ *QUAKED func_door (0 .5 .8) ? START_OPEN STONE_SOUND DOOR_DONT_LINK GOLD_KEY SILVER_KEY - -*/ - -EntityClass *Eclass_InitFromText (const char *text) +eclass_t *Eclass_InitFromText (char *text) { - EntityClass* e = Eclass_Alloc(); - e->free = &Eclass_Free; + char *t; + int len; + int r, i; + char parms[256], *p; + eclass_t *e; + char color[128]; + + e = (eclass_t*)malloc(sizeof(*e)); + memset (e, 0, sizeof(*e)); + + text += strlen("/*QUAKED "); // grab the name text = COM_Parse (text); - e->m_name = Get_COM_Token(); - debugname = e->name(); + e->name = (char*)malloc (strlen(Get_COM_Token())+1); + strcpy (e->name, Get_COM_Token()); + debugname = e->name; - { - // grab the color, reformat as texture name - int r = sscanf (text," (%f %f %f)", &e->color[0], &e->color[1], &e->color[2]); - if (r != 3) - return e; - eclass_capture_state(e); + // grab the color, reformat as texture name + r = sscanf (text," (%f %f %f)", &e->color[0], &e->color[1], &e->color[2]); + if (r != 3) { + return e; } + sprintf (color, "(%f %f %f)", e->color[0], e->color[1], e->color[2]); + //strcpy (e->texdef.name, color); + e->texdef.SetName(color); while (*text != ')') { if (!*text) { - return 0; + return e; } text++; } @@ -238,18 +168,18 @@ EntityClass *Eclass_InitFromText (const char *text) if (Get_COM_Token()[0] == '(') { // parse the size as two vectors e->fixedsize = true; - int r = sscanf (text,"%f %f %f) (%f %f %f)", &e->mins[0], &e->mins[1], &e->mins[2], + r = sscanf (text,"%f %f %f) (%f %f %f)", &e->mins[0], &e->mins[1], &e->mins[2], &e->maxs[0], &e->maxs[1], &e->maxs[2]); if (r != 6) { - return 0; + return e; } - for (int i=0 ; i<2 ; i++) + for (i=0 ; i<2 ; i++) { while (*text != ')') { if (!*text) { - return 0; + return e; } text++; } @@ -257,151 +187,120 @@ EntityClass *Eclass_InitFromText (const char *text) } } - char parms[256]; // get the flags - { - // copy to the first /n - char* p = parms; - while (*text && *text != '\n') - *p++ = *text++; - *p = 0; - text++; - } + // copy to the first /n + p = parms; + while (*text && *text != '\n') + *p++ = *text++; + *p = 0; + text++; + + // any remaining words are parm flags + p = parms; + for (i=0 ; iflagnames[i], Get_COM_Token()); + } + + // find the length until close comment + for (t=text ; t[0] && !(t[0]=='*' && t[1]=='/') ; t++) + ; + + // copy the comment block out + len = t-text; + e->comments = (char*)malloc (len+1); + memcpy (e->comments, text, len); +#ifdef _WIN32 + // the win32 Gtk widgets are expecting text stuff to be in unix format (that is CR only instead of DOS's CR/LF) + // we convert on the fly by replacing the LF with a ' ' (yeah I'm cheap) + for (i=0 ; icomments[i] = ' '; + else + e->comments[i] = text[i]; +#endif + e->comments[len] = 0; + + setSpecialLoad(e, "model=", e->modelpath); + setSpecialLoad(e, "skin=", e->skinpath); + char *pFrame = NULL; + setSpecialLoad(e, "frame=", pFrame); + if (pFrame != NULL) { - // any remaining words are parm flags - const char* p = parms; - for (std::size_t i=0 ; iflagnames[i], Get_COM_Token()); - } + e->nFrame = atoi(pFrame); + delete pFrame; //Hydra - Fixed memory leak! } - e->m_comments = text; + if(!e->skinpath) + setSpecialLoad(e, "texture=", e->skinpath); - setSpecialLoad(e, "model=", e->m_modelpath); - StringOutputStream buffer(string_length(e->m_modelpath.c_str())); - buffer << PathCleaned(e->m_modelpath.c_str()); - e->m_modelpath = buffer.c_str(); + // setup show flags + e->nShowFlags = 0; + if (strcmpi(e->name, "light") == 0 || strcmpi(e->name, "dlight") == 0 || strcmpi(e->name, "lightjunior") == 0) + { + e->nShowFlags |= ECLASS_LIGHT; + } - if(!e->fixedsize) + if ( (strnicmp(e->name, "info_player", strlen("info_player")) == 0) + ||(strnicmp(e->name, "path_corner", strlen("path_corner")) == 0) + ||(strnicmp(e->name, "team_ctf", strlen("team_ctf")) == 0) + ||(strnicmp(e->name, "misc_teleporter_dest", strlen("misc_teleporter_dest")) == 0) + ) { - EntityClass_insertAttribute(*e, "angle", EntityClassAttribute("direction", "Direction", "0")); + e->nShowFlags |= ECLASS_ANGLE; } - else + if (strcmpi(e->name, "path") == 0) { - EntityClass_insertAttribute(*e, "angle", EntityClassAttribute("angle", "Yaw Angle", "0")); + e->nShowFlags |= ECLASS_PATH; } - EntityClass_insertAttribute(*e, "model", EntityClassAttribute("model", "Model")); - EntityClass_insertAttribute(*e, "noise", EntityClassAttribute("sound", "Sound")); + if (strcmpi(e->name, "misc_model") == 0) + { + e->nShowFlags |= ECLASS_MISCMODEL; + } + return e; } -void Eclass_ScanFile (EntityClassCollector& collector, const char *filename) +void Eclass_ScanFile (char *filename) { - EntityClass *e; + int size; + char *data; + eclass_t *e; + int i; + char temp[1024]; - TextFileInputStream inputFile(filename); - if(inputFile.failed()) + QE_ConvertDOSToUnixName( temp, filename ); + + size = vfsLoadFullPathFile(filename, (void**)&data); + if (size <= 0) { - globalErrorStream() << "ScanFile: " << filename << " not found\n"; + Sys_FPrintf (SYS_ERR, "Eclass_ScanFile: %s not found\n", filename); return; } - globalOutputStream() << "ScanFile: " << filename << "\n"; - - enum EParserState + Sys_Printf ("ScanFile: %s\n", temp); + eclass_found = false; + for (i=0 ; i bufferedInput(inputFile); - for(;;) - { - char c; - if(!bufferedInput.readChar(c)) + if (!strncmp(data+i, "/*QUAKED",8)) { - break; - } - - switch(state) - { - case eParseDefault: - if(c == '/') - { - state = eParseSolidus; - } - break; - case eParseSolidus: - if(c == '/') - { - state = eParseComment; - } - else if(c == '*') - { - p = quakeEd; - state = eParseQuakeED; - } - break; - case eParseComment: - if(c == '\n') - { - state = eParseDefault; - } - break; - case eParseQuakeED: - if(c == *p) - { - if(*(++p) == '\0') - { - state = eParseEntityClass; - } - } + e = Eclass_InitFromText (data+i); + if (e) + Eclass_InsertAlphabetized (e); else - { - state = eParseDefault; - } - break; - case eParseEntityClass: - if(c == '*') - { - state = eParseEntityClassEnd; - } - else - { - buffer.push_back(c); - } - break; - case eParseEntityClassEnd: - if(c == '/') - { - e = Eclass_InitFromText(buffer.c_str()); - state = eParseDefault; - if (e) - collector.insert(e); - else - globalErrorStream() << "Error parsing: " << debugname << " in " << filename << "\n"; - - buffer.clear(); - state = eParseDefault; - } - else - { - buffer.push_back('*'); - buffer.push_back(c); - state = eParseEntityClass; - } - break; + Sys_FPrintf (SYS_ERR, "Error parsing: %s in %s\n",debugname, filename); + + // single ? + *Get_Eclass_E() = e; + Set_Eclass_Found(true); + if ( Get_Parsing_Single() ) + break; } } + + g_free (data); } diff --git a/radiant/eclass_def.h b/radiant/eclass_def.h index 23a5ef4d..e7a6f07a 100644 --- a/radiant/eclass_def.h +++ b/radiant/eclass_def.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,26 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_ECLASS_DEF_H) -#define INCLUDED_ECLASS_DEF_H +/*! \file eclass_def.h + \brief the part shared between radiant core and it's builtin module eclass_def.cpp +*/ + +#ifndef _ECLASS_DEF_H_ +#define _ECLASS_DEF_H_ + +class CSynapseBuiltinClientDef : public CSynapseBuiltinClient +{ + public: + CSynapseBuiltinClientDef() {} + virtual ~CSynapseBuiltinClientDef() {} + + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + + // CSynapseBuiltinClient API + void EnumerateInterfaces(CSynapseServer *server); + +}; #endif diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp deleted file mode 100644 index 217c4ec5..00000000 --- a/radiant/eclass_doom3.cpp +++ /dev/null @@ -1,929 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "eclass_doom3.h" - -#include "debugging/debugging.h" - -#include - -#include "ifilesystem.h" -#include "iscriplib.h" -#include "iarchive.h" -#include "qerplugin.h" - -#include "generic/callback.h" -#include "string/string.h" -#include "eclasslib.h" -#include "os/path.h" -#include "os/dir.h" -#include "stream/stringstream.h" -#include "moduleobservers.h" -#include "stringio.h" - -class RawString -{ - const char* m_value; -public: - RawString(const char* value) : m_value(value) - { - } - const char* c_str() const - { - return m_value; - } -}; - -inline bool operator<(const RawString& self, const RawString& other) -{ - return string_less_nocase(self.c_str(), other.c_str()); -} - -typedef std::map EntityClasses; -EntityClasses g_EntityClassDoom3_classes; -EntityClass *g_EntityClassDoom3_bad = 0; - - -void EntityClassDoom3_clear() -{ - for(EntityClasses::iterator i = g_EntityClassDoom3_classes.begin(); i != g_EntityClassDoom3_classes.end(); ++i) - { - (*i).second->free((*i).second); - } - g_EntityClassDoom3_classes.clear(); -} - -// entityClass will be inserted only if another of the same name does not already exist. -// if entityClass was inserted, the same object is returned, otherwise the already-existing object is returned. -EntityClass* EntityClassDoom3_insertUnique(EntityClass* entityClass) -{ - return (*g_EntityClassDoom3_classes.insert(EntityClasses::value_type(entityClass->name(), entityClass)).first).second; -} - -void EntityClassDoom3_forEach(EntityClassVisitor& visitor) -{ - for(EntityClasses::iterator i = g_EntityClassDoom3_classes.begin(); i != g_EntityClassDoom3_classes.end(); ++i) - { - visitor.visit((*i).second); - } -} - -inline void printParseError(const char* message) -{ - globalErrorStream() << message; -} - -#define PARSE_RETURN_FALSE_IF_FAIL(expression) if(!(expression)) { printParseError(FILE_LINE "\nparse failed: " #expression "\n"); return false; } else - -bool EntityClassDoom3_parseToken(Tokeniser& tokeniser) -{ - const char* token = tokeniser.getToken(); - PARSE_RETURN_FALSE_IF_FAIL(token != 0); - return true; -} - -bool EntityClassDoom3_parseToken(Tokeniser& tokeniser, const char* string) -{ - const char* token = tokeniser.getToken(); - PARSE_RETURN_FALSE_IF_FAIL(token != 0); - return string_equal(token, string); -} - -bool EntityClassDoom3_parseString(Tokeniser& tokeniser, const char*& s) -{ - const char* token = tokeniser.getToken(); - PARSE_RETURN_FALSE_IF_FAIL(token != 0); - s = token; - return true; -} - -bool EntityClassDoom3_parseString(Tokeniser& tokeniser, CopiedString& s) -{ - const char* token = tokeniser.getToken(); - PARSE_RETURN_FALSE_IF_FAIL(token != 0); - s = token; - return true; -} - -bool EntityClassDoom3_parseString(Tokeniser& tokeniser, StringOutputStream& s) -{ - const char* token = tokeniser.getToken(); - PARSE_RETURN_FALSE_IF_FAIL(token != 0); - s << token; - return true; -} - -bool EntityClassDoom3_parseUnknown(Tokeniser& tokeniser) -{ - //const char* name = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - - //globalOutputStream() << "parsing unknown block " << makeQuoted(name) << "\n"; - - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - std::size_t depth = 1; - for(;;) - { - const char* token; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, token)); - if(string_equal(token, "}")) - { - if(--depth == 0) - { - tokeniser.nextLine(); - break; - } - } - else if(string_equal(token, "{")) - { - ++depth; - } - tokeniser.nextLine(); - } - return true; -} - - -class Model -{ -public: - bool m_resolved; - CopiedString m_mesh; - CopiedString m_skin; - CopiedString m_parent; - typedef std::map Anims; - Anims m_anims; - Model() : m_resolved(false) - { - } -}; - -typedef std::map Models; - -Models g_models; - -void Model_resolveInheritance(const char* name, Model& model) -{ - if(model.m_resolved == false) - { - model.m_resolved = true; - - if(!string_empty(model.m_parent.c_str())) - { - Models::iterator i = g_models.find(model.m_parent); - if(i == g_models.end()) - { - globalErrorStream() << "model " << name << " inherits unknown model " << model.m_parent.c_str() << "\n"; - } - else - { - Model_resolveInheritance((*i).first.c_str(), (*i).second); - model.m_mesh = (*i).second.m_mesh; - model.m_skin = (*i).second.m_skin; - } - } - } -} - -bool EntityClassDoom3_parseModel(Tokeniser& tokeniser) -{ - const char* name; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, name)); - - Model& model = g_models[name]; - - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - for(;;) - { - const char* parameter; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, parameter)); - if(string_equal(parameter, "}")) - { - tokeniser.nextLine(); - break; - } - else if(string_equal(parameter, "inherit")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, model.m_parent)); - tokeniser.nextLine(); - } - else if(string_equal(parameter, "remove")) - { - //const char* remove = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - tokeniser.nextLine(); - } - else if(string_equal(parameter, "mesh")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, model.m_mesh)); - tokeniser.nextLine(); - } - else if(string_equal(parameter, "skin")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, model.m_skin)); - tokeniser.nextLine(); - } - else if(string_equal(parameter, "offset")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, "(")); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, ")")); - tokeniser.nextLine(); - } - else if(string_equal(parameter, "channel")) - { - //const char* channelName = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, "(")); - for(;;) - { - const char* end; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, end)); - if(string_equal(end, ")")) - { - tokeniser.nextLine(); - break; - } - } - } - else if(string_equal(parameter, "anim")) - { - CopiedString animName; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, animName)); - const char* animFile; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, animFile)); - model.m_anims.insert(Model::Anims::value_type(animName, animFile)); - - const char* token; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, token)); - - while(string_equal(token, ",")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, animFile)); - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, token)); - } - - if(string_equal(token, "{")) - { - for(;;) - { - const char* end; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, end)); - if(string_equal(end, "}")) - { - tokeniser.nextLine(); - break; - } - tokeniser.nextLine(); - } - } - else - { - tokeniser.ungetToken(); - } - } - else - { - globalErrorStream() << "unknown model parameter: " << makeQuoted(parameter) << "\n"; - return false; - } - tokeniser.nextLine(); - } - return true; -} - -inline bool char_isSpaceOrTab(char c) -{ - return c == ' ' || c == '\t'; -} - -inline bool char_isNotSpaceOrTab(char c) -{ - return !char_isSpaceOrTab(c); -} - -template -inline const char* string_find_if(const char* string, Predicate predicate) -{ - for(; *string != 0; ++string) - { - if(predicate(*string)) - { - return string; - } - } - return string; -} - -inline const char* string_findFirstSpaceOrTab(const char* string) -{ - return string_find_if(string, char_isSpaceOrTab); -} - -inline const char* string_findFirstNonSpaceOrTab(const char* string) -{ - return string_find_if(string, char_isNotSpaceOrTab); -} - - -static bool EntityClass_parse(EntityClass& entityClass, Tokeniser& tokeniser) -{ - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, entityClass.m_name)); - - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser, "{")); - tokeniser.nextLine(); - - StringOutputStream usage(256); - StringOutputStream description(256); - CopiedString* currentDescription = 0; - StringOutputStream* currentString = 0; - - for(;;) - { - const char* key; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, key)); - - const char* last = string_findFirstSpaceOrTab(key); - CopiedString first(StringRange(key, last)); - - if(!string_empty(last)) - { - last = string_findFirstNonSpaceOrTab(last); - } - - if(currentString != 0 && string_equal(key, "\\")) - { - tokeniser.nextLine(); - *currentString << " "; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, *currentString)); - continue; - } - - if(currentDescription != 0) - { - *currentDescription = description.c_str(); - description.clear(); - currentDescription = 0; - } - currentString = 0; - - if(string_equal(key, "}")) - { - tokeniser.nextLine(); - break; - } - else if(string_equal(key, "model")) - { - const char* token; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, token)); - entityClass.fixedsize = true; - StringOutputStream buffer(256); - buffer << PathCleaned(token); - entityClass.m_modelpath = buffer.c_str(); - } - else if(string_equal(key, "editor_color")) - { - const char* value; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, value)); - if(!string_empty(value)) - { - entityClass.colorSpecified = true; - bool success = string_parse_vector3(value, entityClass.color); - ASSERT_MESSAGE(success, "editor_color: parse error"); - } - } - else if(string_equal(key, "editor_ragdoll")) - { - //bool ragdoll = atoi(tokeniser.getToken()) != 0; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - else if(string_equal(key, "editor_mins")) - { - entityClass.sizeSpecified = true; - const char* value; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, value)); - if(!string_empty(value) && !string_equal(value, "?")) - { - entityClass.fixedsize = true; - bool success = string_parse_vector3(value, entityClass.mins); - ASSERT_MESSAGE(success, "editor_mins: parse error"); - } - } - else if(string_equal(key, "editor_maxs")) - { - entityClass.sizeSpecified = true; - const char* value; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, value)); - if(!string_empty(value) && !string_equal(value, "?")) - { - entityClass.fixedsize = true; - bool success = string_parse_vector3(value, entityClass.maxs); - ASSERT_MESSAGE(success, "editor_maxs: parse error"); - } - } - else if(string_equal(key, "editor_usage")) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, usage)); - currentString = &usage; - } - else if(string_equal_n(key, "editor_usage", 12)) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, usage)); - currentString = &usage; - } - else if(string_equal(key, "editor_rotatable") - || string_equal(key, "editor_showangle") - || string_equal(key, "editor_showangles") // typo? in prey movables.def - || string_equal(key, "editor_mover") - || string_equal(key, "editor_model") - || string_equal(key, "editor_material") - || string_equal(key, "editor_combatnode") - || (!string_empty(last) && string_equal(first.c_str(), "editor_gui")) - || string_equal_n(key, "editor_copy", 11)) - { - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - else if(!string_empty(last) && (string_equal(first.c_str(), "editor_var") || string_equal(first.c_str(), "editor_string"))) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "string"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_float")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "string"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_snd")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "sound"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_bool")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "boolean"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_int")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "integer"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_model")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "model"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && string_equal(first.c_str(), "editor_color")) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "color"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(!string_empty(last) && (string_equal(first.c_str(), "editor_material") || string_equal(first.c_str(), "editor_mat"))) - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, last).second; - attribute.m_type = "shader"; - currentDescription = &attribute.m_description; - currentString = &description; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, description)); - } - else if(string_equal(key, "inherit")) - { - entityClass.inheritanceResolved = false; - ASSERT_MESSAGE(entityClass.m_parent.empty(), "only one 'inherit' supported per entityDef"); - const char* token; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, token)); - entityClass.m_parent.push_back(token); - } - // begin quake4-specific keys - else if(string_equal(key, "editor_targetonsel")) - { - //const char* value = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - else if(string_equal(key, "editor_menu")) - { - //const char* value = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - else if(string_equal(key, "editor_ignore")) - { - //const char* value = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - // end quake4-specific keys - // begin ignore prey (unknown/unused?) entity keys - else if(string_equal(key, "editor_light") - || string_equal(key, "editor_def def_debrisspawner") - || string_equal(key, "editor_def def_drop") - || string_equal(key, "editor_def def_guihand") - || string_equal(key, "editor_def def_mine")) - { - //const char* value = - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseToken(tokeniser)); - } - // end ignore prey entity keys - else - { - CopiedString tmp(key); - ASSERT_MESSAGE(!string_equal_n(key, "editor_", 7), "unsupported editor key: " << makeQuoted(key)); - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, key).second; - attribute.m_type = "string"; - const char* value; - PARSE_RETURN_FALSE_IF_FAIL(EntityClassDoom3_parseString(tokeniser, value)); - if(string_equal(value, "}")) // hack for quake4 powerups.def bug - { - globalErrorStream() << "entityDef " << makeQuoted(entityClass.m_name.c_str()) << " key " << makeQuoted(tmp.c_str()) << " has no value\n"; - break; - } - else - { - attribute.m_value = value; - } - } - tokeniser.nextLine(); - } - - entityClass.m_comments = usage.c_str(); - - if(string_equal(entityClass.m_name.c_str(), "light")) - { - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "light_radius").second; - attribute.m_type = "vector3"; - attribute.m_value = "300 300 300"; - } - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "light_center").second; - attribute.m_type = "vector3"; - } - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "noshadows").second; - attribute.m_type = "boolean"; - attribute.m_value = "0"; - } - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "nospecular").second; - attribute.m_type = "boolean"; - attribute.m_value = "0"; - } - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "nodiffuse").second; - attribute.m_type = "boolean"; - attribute.m_value = "0"; - } - { - EntityClassAttribute& attribute = EntityClass_insertAttribute(entityClass, "falloff").second; - attribute.m_type = "real"; - } - } - - return true; -} - -bool EntityClassDoom3_parseEntityDef(Tokeniser& tokeniser) -{ - EntityClass* entityClass = Eclass_Alloc(); - entityClass->free = &Eclass_Free; - - if(!EntityClass_parse(*entityClass, tokeniser)) - { - eclass_capture_state(entityClass); // finish constructing the entity so that it can be destroyed cleanly. - entityClass->free(entityClass); - return false; - } - - EntityClass* inserted = EntityClassDoom3_insertUnique(entityClass); - if(inserted != entityClass) - { - globalErrorStream() << "entityDef " << entityClass->name() << " is already defined, second definition ignored\n"; - eclass_capture_state(entityClass); // finish constructing the entity so that it can be destroyed cleanly. - entityClass->free(entityClass); - } - return true; -} - -bool EntityClassDoom3_parseBlock(Tokeniser& tokeniser, const char* blockType) -{ - if(string_equal(blockType, "entityDef")) - { - return EntityClassDoom3_parseEntityDef(tokeniser); - } - else if(string_equal(blockType, "model")) - { - return EntityClassDoom3_parseModel(tokeniser); - } - else - { - return EntityClassDoom3_parseUnknown(tokeniser); - } -} - -bool EntityClassDoom3_parse(TextInputStream& inputStream, const char* filename) -{ - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewScriptTokeniser(inputStream); - - tokeniser.nextLine(); - - for(;;) - { - const char* blockType = tokeniser.getToken(); - if(blockType == 0) - { - return true; - } - CopiedString tmp(blockType); - if(!EntityClassDoom3_parseBlock(tokeniser, tmp.c_str())) - { - globalErrorStream() << GlobalFileSystem().findFile(filename) << filename << ":" << (unsigned int)tokeniser.getLine() << ": " << tmp.c_str() << " parse failed, skipping rest of file\n"; - return false; - } - } - - tokeniser.release(); -} - - -void EntityClassDoom3_loadFile(const char* filename) -{ - globalOutputStream() << "parsing entity classes from " << makeQuoted(filename) << "\n"; - - StringOutputStream fullname(256); - fullname << "def/" << filename; - - ArchiveTextFile* file = GlobalFileSystem().openTextFile(fullname.c_str()); - if(file != 0) - { - EntityClassDoom3_parse(file->getInputStream(), fullname.c_str()); - file->release(); - } -} - -EntityClass* EntityClassDoom3_findOrInsert(const char *name, bool has_brushes) -{ - ASSERT_NOTNULL(name); - - if(string_empty(name)) - { - return g_EntityClassDoom3_bad; - } - - EntityClasses::iterator i = g_EntityClassDoom3_classes.find(name); - if(i != g_EntityClassDoom3_classes.end() - //&& string_equal((*i).first, name) - ) - { - return (*i).second; - } - - EntityClass* e = EntityClass_Create_Default(name, has_brushes); - EntityClass* inserted = EntityClassDoom3_insertUnique(e); - ASSERT_MESSAGE(inserted == e, ""); - return inserted; -} - -const ListAttributeType* EntityClassDoom3_findListType(const char* name) -{ - return 0; -} - - -void EntityClass_resolveInheritance(EntityClass* derivedClass) -{ - if(derivedClass->inheritanceResolved == false) - { - derivedClass->inheritanceResolved = true; - EntityClasses::iterator i = g_EntityClassDoom3_classes.find(derivedClass->m_parent.front().c_str()); - if(i == g_EntityClassDoom3_classes.end()) - { - globalErrorStream() << "failed to find entityDef " << makeQuoted(derivedClass->m_parent.front().c_str()) << " inherited by " << makeQuoted(derivedClass->m_name.c_str()) << "\n"; - } - else - { - EntityClass* parentClass = (*i).second; - EntityClass_resolveInheritance(parentClass); - if(!derivedClass->colorSpecified) - { - derivedClass->colorSpecified = parentClass->colorSpecified; - derivedClass->color = parentClass->color; - } - if(!derivedClass->sizeSpecified) - { - derivedClass->sizeSpecified = parentClass->sizeSpecified; - derivedClass->mins = parentClass->mins; - derivedClass->maxs = parentClass->maxs; - derivedClass->fixedsize = parentClass->fixedsize; - } - - for(EntityClassAttributes::iterator j = parentClass->m_attributes.begin(); j != parentClass->m_attributes.end(); ++j) - { - EntityClass_insertAttribute(*derivedClass, (*j).first.c_str(), (*j).second); - } - } - } -} - -class EntityClassDoom3 : public ModuleObserver -{ - std::size_t m_unrealised; - ModuleObservers m_observers; -public: - EntityClassDoom3() : m_unrealised(2) - { - } - void realise() - { - if(--m_unrealised == 0) - { - globalOutputStream() << "searching vfs directory " << makeQuoted("def") << " for *.def\n"; - GlobalFileSystem().forEachFile("def/", "def", FreeCaller1()); - - { - for(Models::iterator i = g_models.begin(); i != g_models.end(); ++i) - { - Model_resolveInheritance((*i).first.c_str(), (*i).second); - } - } - { - for(EntityClasses::iterator i = g_EntityClassDoom3_classes.begin(); i != g_EntityClassDoom3_classes.end(); ++i) - { - EntityClass_resolveInheritance((*i).second); - if(!string_empty((*i).second->m_modelpath.c_str())) - { - Models::iterator j = g_models.find((*i).second->m_modelpath); - if(j != g_models.end()) - { - (*i).second->m_modelpath = (*j).second.m_mesh; - (*i).second->m_skin = (*j).second.m_skin; - } - } - eclass_capture_state((*i).second); - - StringOutputStream usage(256); - - usage << "-------- NOTES --------\n"; - - if(!string_empty((*i).second->m_comments.c_str())) - { - usage << (*i).second->m_comments.c_str() << "\n"; - } - - usage << "\n-------- KEYS --------\n"; - - for(EntityClassAttributes::iterator j = (*i).second->m_attributes.begin(); j != (*i).second->m_attributes.end(); ++j) - { - const char* name = EntityClassAttributePair_getName(*j); - const char* description = EntityClassAttributePair_getDescription(*j); - if(!string_equal(name, description)) - { - usage << EntityClassAttributePair_getName(*j) << " : " << EntityClassAttributePair_getDescription(*j) << "\n"; - } - } - - (*i).second->m_comments = usage.c_str(); - } - } - - m_observers.realise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - m_observers.unrealise(); - EntityClassDoom3_clear(); - } - } - void attach(ModuleObserver& observer) - { - m_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - m_observers.detach(observer); - } -}; - -EntityClassDoom3 g_EntityClassDoom3; - -void EntityClassDoom3_attach(ModuleObserver& observer) -{ - g_EntityClassDoom3.attach(observer); -} -void EntityClassDoom3_detach(ModuleObserver& observer) -{ - g_EntityClassDoom3.detach(observer); -} - -void EntityClassDoom3_realise() -{ - g_EntityClassDoom3.realise(); -} -void EntityClassDoom3_unrealise() -{ - g_EntityClassDoom3.unrealise(); -} - -void EntityClassDoom3_construct() -{ - GlobalFileSystem().attach(g_EntityClassDoom3); - - // start by creating the default unknown eclass - g_EntityClassDoom3_bad = EClass_Create("UNKNOWN_CLASS", Vector3(0.0f, 0.5f, 0.0f), ""); - - EntityClassDoom3_realise(); -} - -void EntityClassDoom3_destroy() -{ - EntityClassDoom3_unrealise(); - - g_EntityClassDoom3_bad->free(g_EntityClassDoom3_bad); - - GlobalFileSystem().detach(g_EntityClassDoom3); -} - -class EntityClassDoom3Dependencies : public GlobalFileSystemModuleRef, public GlobalShaderCacheModuleRef -{ -}; - -class EntityClassDoom3API -{ - EntityClassManager m_eclassmanager; -public: - typedef EntityClassManager Type; - STRING_CONSTANT(Name, "doom3"); - - EntityClassDoom3API() - { - EntityClassDoom3_construct(); - - m_eclassmanager.findOrInsert = &EntityClassDoom3_findOrInsert; - m_eclassmanager.findListType = &EntityClassDoom3_findListType; - m_eclassmanager.forEach = &EntityClassDoom3_forEach; - m_eclassmanager.attach = &EntityClassDoom3_attach; - m_eclassmanager.detach = &EntityClassDoom3_detach; - m_eclassmanager.realise = &EntityClassDoom3_realise; - m_eclassmanager.unrealise = &EntityClassDoom3_unrealise; - } - ~EntityClassDoom3API() - { - EntityClassDoom3_destroy(); - } - EntityClassManager* getTable() - { - return &m_eclassmanager; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule EntityClassDoom3Module; -typedef Static StaticEntityClassDoom3Module; -StaticRegisterModule staticRegisterEntityClassDoom3(StaticEntityClassDoom3Module::instance()); diff --git a/radiant/eclass_doom3.h b/radiant/eclass_doom3.h deleted file mode 100644 index 7c8169cb..00000000 --- a/radiant/eclass_doom3.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ECLASS_DOOM3_H) -#define INCLUDED_ECLASS_DOOM3_H - -#endif diff --git a/radiant/eclass_fgd.cpp b/radiant/eclass_fgd.cpp deleted file mode 100644 index 6d5fb663..00000000 --- a/radiant/eclass_fgd.cpp +++ /dev/null @@ -1,807 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "eclass_fgd.h" - -#include "debugging/debugging.h" - -#include - -#include "ifilesystem.h" -#include "iscriplib.h" -#include "qerplugin.h" - -#include "string/string.h" -#include "eclasslib.h" -#include "os/path.h" -#include "os/dir.h" -#include "stream/stringstream.h" -#include "moduleobservers.h" -#include "stringio.h" -#include "stream/textfilestream.h" - -namespace -{ - typedef std::map EntityClasses; - EntityClasses g_EntityClassFGD_classes; - typedef std::map BaseClasses; - BaseClasses g_EntityClassFGD_bases; - EntityClass *g_EntityClassFGD_bad = 0; - typedef std::map ListAttributeTypes; - ListAttributeTypes g_listTypesFGD; -} - - -void EntityClassFGD_clear() -{ - for(BaseClasses::iterator i = g_EntityClassFGD_bases.begin(); i != g_EntityClassFGD_bases.end(); ++i) - { - (*i).second->free((*i).second); - } - g_EntityClassFGD_bases.clear(); - g_listTypesFGD.clear(); -} - -EntityClass* EntityClassFGD_insertUniqueBase(EntityClass* entityClass) -{ - std::pair result = g_EntityClassFGD_bases.insert(BaseClasses::value_type(entityClass->name(), entityClass)); - if(!result.second) - { - globalErrorStream() << "duplicate base class: " << makeQuoted(entityClass->name()) << "\n"; - //eclass_capture_state(entityClass); - //entityClass->free(entityClass); - } - return (*result.first).second; -} - -EntityClass* EntityClassFGD_insertUnique(EntityClass* entityClass) -{ - EntityClassFGD_insertUniqueBase(entityClass); - std::pair result = g_EntityClassFGD_classes.insert(EntityClasses::value_type(entityClass->name(), entityClass)); - if(!result.second) - { - globalErrorStream() << "duplicate entity class: " << makeQuoted(entityClass->name()) << "\n"; - eclass_capture_state(entityClass); - entityClass->free(entityClass); - } - return (*result.first).second; -} - -void EntityClassFGD_forEach(EntityClassVisitor& visitor) -{ - for(EntityClasses::iterator i = g_EntityClassFGD_classes.begin(); i != g_EntityClassFGD_classes.end(); ++i) - { - visitor.visit((*i).second); - } -} - -inline bool EntityClassFGD_parseToken(Tokeniser& tokeniser, const char* token) -{ - return string_equal(tokeniser.getToken(), token); -} - -#define PARSE_ERROR "error parsing entity class definition" - -void EntityClassFGD_parseSplitString(Tokeniser& tokeniser, CopiedString& string) -{ - StringOutputStream buffer(256); - for(;;) - { - buffer << tokeniser.getToken(); - if(!string_equal(tokeniser.getToken(), "+")) - { - tokeniser.ungetToken(); - string = buffer.c_str(); - return; - } - } -} - -void EntityClassFGD_parseClass(Tokeniser& tokeniser, bool fixedsize, bool isBase) -{ - EntityClass* entityClass = Eclass_Alloc(); - entityClass->free = &Eclass_Free; - entityClass->fixedsize = fixedsize; - entityClass->inheritanceResolved = false; - entityClass->mins = Vector3(-8, -8, -8); - entityClass->maxs = Vector3(8, 8, 8); - - for(;;) - { - const char* property = tokeniser.getToken(); - if(string_equal(property, "=")) - { - break; - } - else if(string_equal(property, "base")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - for(;;) - { - const char* base = tokeniser.getToken(); - if(string_equal(base, ")")) - { - break; - } - else if(!string_equal(base, ",")) - { - entityClass->m_parent.push_back(base); - } - } - } - else if(string_equal(property, "size")) - { - entityClass->sizeSpecified = true; - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - Tokeniser_getFloat(tokeniser, entityClass->mins.x()); - Tokeniser_getFloat(tokeniser, entityClass->mins.y()); - Tokeniser_getFloat(tokeniser, entityClass->mins.z()); - const char* token = tokeniser.getToken(); - if(string_equal(token, ",")) - { - Tokeniser_getFloat(tokeniser, entityClass->maxs.x()); - Tokeniser_getFloat(tokeniser, entityClass->maxs.y()); - Tokeniser_getFloat(tokeniser, entityClass->maxs.z()); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else - { - entityClass->maxs = entityClass->mins; - vector3_negate(entityClass->mins); - ASSERT_MESSAGE(string_equal(token, ")"), ""); - } - } - else if(string_equal(property, "color")) - { - entityClass->colorSpecified = true; - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - Tokeniser_getFloat(tokeniser, entityClass->color.x()); - entityClass->color.x() /= 256.0; - Tokeniser_getFloat(tokeniser, entityClass->color.y()); - entityClass->color.y() /= 256.0; - Tokeniser_getFloat(tokeniser, entityClass->color.z()); - entityClass->color.z() /= 256.0; - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else if(string_equal(property, "iconsprite")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - StringOutputStream buffer(256); - buffer << PathCleaned(tokeniser.getToken()); - entityClass->m_modelpath = buffer.c_str(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else if(string_equal(property, "sprite") - || string_equal(property, "decal") - // hl2 below - || string_equal(property, "overlay") - || string_equal(property, "light") - || string_equal(property, "keyframe") - || string_equal(property, "animator") - || string_equal(property, "quadbounds")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - // hl2 below - else if(string_equal(property, "sphere") - || string_equal(property, "sweptplayerhull") - || string_equal(property, "studio") - || string_equal(property, "studioprop") - || string_equal(property, "lightprop") - || string_equal(property, "lightcone") - || string_equal(property, "sidelist")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - if(string_equal(tokeniser.getToken(), ")")) - { - tokeniser.ungetToken(); - } - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else if(string_equal(property, "line") - || string_equal(property, "cylinder")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - //const char* r = - tokeniser.getToken(); - //const char* g = - tokeniser.getToken(); - //const char* b = - tokeniser.getToken(); - for(;;) - { - if(string_equal(tokeniser.getToken(), ")")) - { - tokeniser.ungetToken(); - break; - } - //const char* name = - tokeniser.getToken(); - } - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else if(string_equal(property, "wirebox")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - //const char* mins = - tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ","), PARSE_ERROR); - //const char* maxs = - tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else if(string_equal(property, "halfgridsnap")) - { - } - else - { - ERROR_MESSAGE(PARSE_ERROR); - } - } - - entityClass->m_name = tokeniser.getToken(); - - if(!isBase) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ":"), PARSE_ERROR); - - EntityClassFGD_parseSplitString(tokeniser, entityClass->m_comments); - } - - tokeniser.nextLine(); - - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "["), PARSE_ERROR); - - tokeniser.nextLine(); - - for(;;) - { - CopiedString key = tokeniser.getToken(); - if(string_equal(key.c_str(), "]")) - { - tokeniser.nextLine(); - break; - } - - if(string_equal_nocase(key.c_str(), "input") - || string_equal_nocase(key.c_str(), "output")) - { - const char* name = tokeniser.getToken(); - if(!string_equal(name, "(")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - //const char* type = - tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - const char* descriptionSeparator = tokeniser.getToken(); - if(string_equal(descriptionSeparator, ":")) - { - CopiedString description; - EntityClassFGD_parseSplitString(tokeniser, description); - } - else - { - tokeniser.ungetToken(); - } - tokeniser.nextLine(); - continue; - } - } - - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - CopiedString type = tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - - if(string_equal_nocase(type.c_str(), "flags")) - { - EntityClassAttribute attribute; - - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "="), PARSE_ERROR); - tokeniser.nextLine(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "["), PARSE_ERROR); - tokeniser.nextLine(); - for(;;) - { - const char* flag = tokeniser.getToken(); - if(string_equal(flag, "]")) - { - tokeniser.nextLine(); - break; - } - else - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ":"), PARSE_ERROR); - //const char* name = - tokeniser.getToken(); - { - const char* defaultSeparator = tokeniser.getToken(); - if(string_equal(defaultSeparator, ":")) - { - tokeniser.getToken(); - { - const char* descriptionSeparator = tokeniser.getToken(); - if(string_equal(descriptionSeparator, ":")) - { - EntityClassFGD_parseSplitString(tokeniser, attribute.m_description); - } - else - { - tokeniser.ungetToken(); - } - } - } - else - { - tokeniser.ungetToken(); - } - } - } - tokeniser.nextLine(); - } - EntityClass_insertAttribute(*entityClass, key.c_str(), attribute); - } - else if(string_equal_nocase(type.c_str(), "choices")) - { - EntityClassAttribute attribute; - - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ":"), PARSE_ERROR); - attribute.m_name = tokeniser.getToken(); - const char* valueSeparator = tokeniser.getToken(); - if(string_equal(valueSeparator, ":")) - { - const char* value = tokeniser.getToken(); - if(!string_equal(value, ":")) - { - attribute.m_value = value; - } - else - { - tokeniser.ungetToken(); - } - { - const char* descriptionSeparator = tokeniser.getToken(); - if(string_equal(descriptionSeparator, ":")) - { - EntityClassFGD_parseSplitString(tokeniser, attribute.m_description); - } - else - { - tokeniser.ungetToken(); - } - } - } - else - { - tokeniser.ungetToken(); - } - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "="), PARSE_ERROR); - tokeniser.nextLine(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "["), PARSE_ERROR); - tokeniser.nextLine(); - - StringOutputStream listTypeName(64); - listTypeName << entityClass->m_name.c_str() << "_" << attribute.m_name.c_str(); - attribute.m_type = listTypeName.c_str(); - - ListAttributeType& listType = g_listTypesFGD[listTypeName.c_str()]; - - for(;;) - { - const char* value = tokeniser.getToken(); - if(string_equal(value, "]")) - { - tokeniser.nextLine(); - break; - } - else - { - CopiedString tmp(value); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ":"), PARSE_ERROR); - const char* name = tokeniser.getToken(); - listType.push_back(name, tmp.c_str()); - } - tokeniser.nextLine(); - } - - for(ListAttributeType::const_iterator i = listType.begin(); i != listType.end(); ++i) - { - if(string_equal(attribute.m_value.c_str(), (*i).first.c_str())) - { - attribute.m_value = (*i).second.c_str(); - } - } - - EntityClass_insertAttribute(*entityClass, key.c_str(), attribute); - } - else if(string_equal_nocase(type.c_str(), "decal")) - { - } - else if(string_equal_nocase(type.c_str(), "string") - || string_equal_nocase(type.c_str(), "integer") - || string_equal_nocase(type.c_str(), "studio") - || string_equal_nocase(type.c_str(), "sprite") - || string_equal_nocase(type.c_str(), "color255") - || string_equal_nocase(type.c_str(), "target_source") - || string_equal_nocase(type.c_str(), "target_destination") - || string_equal_nocase(type.c_str(), "sound") - // hl2 below - || string_equal_nocase(type.c_str(), "angle") - || string_equal_nocase(type.c_str(), "origin") - || string_equal_nocase(type.c_str(), "float") - || string_equal_nocase(type.c_str(), "node_dest") - || string_equal_nocase(type.c_str(), "filterclass") - || string_equal_nocase(type.c_str(), "vector") - || string_equal_nocase(type.c_str(), "sidelist") - || string_equal_nocase(type.c_str(), "material") - || string_equal_nocase(type.c_str(), "vecline") - || string_equal_nocase(type.c_str(), "axis") - || string_equal_nocase(type.c_str(), "npcclass") - || string_equal_nocase(type.c_str(), "target_name_or_class") - || string_equal_nocase(type.c_str(), "pointentityclass") - || string_equal_nocase(type.c_str(), "scene")) - { - if(!string_equal(tokeniser.getToken(), "readonly")) - { - tokeniser.ungetToken(); - } - - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ":"), PARSE_ERROR); - const char* attributeType = "string"; - if(string_equal_nocase(type.c_str(), "studio")) - { - attributeType = "model"; - } - - EntityClassAttribute attribute; - attribute.m_type = attributeType; - attribute.m_name = tokeniser.getToken(); - - const char* defaultSeparator = tokeniser.getToken(); - if(string_equal(defaultSeparator, ":")) - { - const char* value = tokeniser.getToken(); - if(!string_equal(value, ":")) - { - attribute.m_value = value; - } - else - { - tokeniser.ungetToken(); - } - - { - const char* descriptionSeparator = tokeniser.getToken(); - if(string_equal(descriptionSeparator, ":")) - { - EntityClassFGD_parseSplitString(tokeniser, attribute.m_description); - } - else - { - tokeniser.ungetToken(); - } - } - } - else - { - tokeniser.ungetToken(); - } - EntityClass_insertAttribute(*entityClass, key.c_str(), attribute); - } - else - { - ERROR_MESSAGE("unknown key type: " << makeQuoted(type.c_str())); - } - tokeniser.nextLine(); - } - - if(isBase) - { - EntityClassFGD_insertUniqueBase(entityClass); - } - else - { - EntityClassFGD_insertUnique(entityClass); - } -} - -void EntityClassFGD_loadFile(const char* filename); - -void EntityClassFGD_parse(TextInputStream& inputStream, const char* path) -{ - Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewScriptTokeniser(inputStream); - - tokeniser.nextLine(); - - for(;;) - { - const char* blockType = tokeniser.getToken(); - if(blockType == 0) - { - break; - } - if(string_equal(blockType, "@SolidClass")) - { - EntityClassFGD_parseClass(tokeniser, false, false); - } - else if(string_equal(blockType, "@BaseClass")) - { - EntityClassFGD_parseClass(tokeniser, false, true); - } - else if(string_equal(blockType, "@PointClass") - // hl2 below - || string_equal(blockType, "@KeyFrameClass") - || string_equal(blockType, "@MoveClass") - || string_equal(blockType, "@FilterClass") - || string_equal(blockType, "@NPCClass")) - { - EntityClassFGD_parseClass(tokeniser, true, false); - } - // hl2 below - else if(string_equal(blockType, "@include")) - { - StringOutputStream includePath(256); - includePath << StringRange(path, path_get_filename_start(path)); - includePath << tokeniser.getToken(); - EntityClassFGD_loadFile(includePath.c_str()); - } - else if(string_equal(blockType, "@mapsize")) - { - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, "("), PARSE_ERROR); - //const char* min = - tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ","), PARSE_ERROR); - //const char* max = - tokeniser.getToken(); - ASSERT_MESSAGE(EntityClassFGD_parseToken(tokeniser, ")"), PARSE_ERROR); - } - else - { - ERROR_MESSAGE("unknown block type: " << makeQuoted(blockType)); - } - } - - tokeniser.release(); -} - - -void EntityClassFGD_loadFile(const char* filename) -{ - TextFileInputStream file(filename); - if(!file.failed()) - { - globalOutputStream() << "parsing entity classes from " << makeQuoted(filename) << "\n"; - - EntityClassFGD_parse(file, filename); - } -} - -EntityClass* EntityClassFGD_findOrInsert(const char *name, bool has_brushes) -{ - ASSERT_NOTNULL(name); - - if(string_empty(name)) - { - return g_EntityClassFGD_bad; - } - - EntityClasses::iterator i = g_EntityClassFGD_classes.find(name); - if(i != g_EntityClassFGD_classes.end() - //&& string_equal((*i).first, name) - ) - { - return (*i).second; - } - - EntityClass* e = EntityClass_Create_Default(name, has_brushes); - return EntityClassFGD_insertUnique(e); -} - -const ListAttributeType* EntityClassFGD_findListType(const char *name) -{ - ListAttributeTypes::iterator i = g_listTypesFGD.find(name); - if(i != g_listTypesFGD.end()) - { - return &(*i).second; - } - return 0; - -} - - -void EntityClassFGD_resolveInheritance(EntityClass* derivedClass) -{ - if(derivedClass->inheritanceResolved == false) - { - derivedClass->inheritanceResolved = true; - for(StringList::iterator j = derivedClass->m_parent.begin(); j != derivedClass->m_parent.end(); ++j) - { - BaseClasses::iterator i = g_EntityClassFGD_bases.find((*j).c_str()); - if(i == g_EntityClassFGD_bases.end()) - { - globalErrorStream() << "failed to find entityDef " << makeQuoted((*j).c_str()) << " inherited by " << makeQuoted(derivedClass->m_name.c_str()) << "\n"; - } - else - { - EntityClass* parentClass = (*i).second; - EntityClassFGD_resolveInheritance(parentClass); - if(!derivedClass->colorSpecified) - { - derivedClass->colorSpecified = parentClass->colorSpecified; - derivedClass->color = parentClass->color; - } - if(!derivedClass->sizeSpecified) - { - derivedClass->sizeSpecified = parentClass->sizeSpecified; - derivedClass->mins = parentClass->mins; - derivedClass->maxs = parentClass->maxs; - } - - for(EntityClassAttributes::iterator k = parentClass->m_attributes.begin(); k != parentClass->m_attributes.end(); ++k) - { - EntityClass_insertAttribute(*derivedClass, (*k).first.c_str(), (*k).second); - } - } - } - } -} - -class EntityClassFGD : public ModuleObserver -{ - std::size_t m_unrealised; - ModuleObservers m_observers; -public: - EntityClassFGD() : m_unrealised(3) - { - } - void realise() - { - if(--m_unrealised == 0) - { - StringOutputStream filename(256); - filename << GlobalRadiant().getGameToolsPath() << GlobalRadiant().getGameName() << "/halflife.fgd"; - EntityClassFGD_loadFile(filename.c_str()); - - { - for(EntityClasses::iterator i = g_EntityClassFGD_classes.begin(); i != g_EntityClassFGD_classes.end(); ++i) - { - EntityClassFGD_resolveInheritance((*i).second); - if((*i).second->fixedsize && string_empty((*i).second->m_modelpath.c_str())) - { - if(!(*i).second->sizeSpecified) - { - globalErrorStream() << "size not specified for entity class: " << makeQuoted((*i).second->m_name.c_str()) << '\n'; - } - if(!(*i).second->colorSpecified) - { - globalErrorStream() << "color not specified for entity class: " << makeQuoted((*i).second->m_name.c_str()) << '\n'; - } - } - } - } - { - for(BaseClasses::iterator i = g_EntityClassFGD_bases.begin(); i != g_EntityClassFGD_bases.end(); ++i) - { - eclass_capture_state((*i).second); - } - } - - m_observers.realise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - m_observers.unrealise(); - EntityClassFGD_clear(); - } - } - void attach(ModuleObserver& observer) - { - m_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - m_observers.detach(observer); - } -}; - -EntityClassFGD g_EntityClassFGD; - -void EntityClassFGD_attach(ModuleObserver& observer) -{ - g_EntityClassFGD.attach(observer); -} -void EntityClassFGD_detach(ModuleObserver& observer) -{ - g_EntityClassFGD.detach(observer); -} - -void EntityClassFGD_realise() -{ - g_EntityClassFGD.realise(); -} -void EntityClassFGD_unrealise() -{ - g_EntityClassFGD.unrealise(); -} - -void EntityClassFGD_construct() -{ - // start by creating the default unknown eclass - g_EntityClassFGD_bad = EClass_Create("UNKNOWN_CLASS", Vector3(0.0f, 0.5f, 0.0f), ""); - - EntityClassFGD_realise(); -} - -void EntityClassFGD_destroy() -{ - EntityClassFGD_unrealise(); - - g_EntityClassFGD_bad->free(g_EntityClassFGD_bad); -} - -class EntityClassFGDDependencies : public GlobalFileSystemModuleRef, public GlobalShaderCacheModuleRef, public GlobalRadiantModuleRef -{ -}; - -class EntityClassFGDAPI -{ - EntityClassManager m_eclassmanager; -public: - typedef EntityClassManager Type; - STRING_CONSTANT(Name, "halflife"); - - EntityClassFGDAPI() - { - EntityClassFGD_construct(); - - m_eclassmanager.findOrInsert = &EntityClassFGD_findOrInsert; - m_eclassmanager.findListType = &EntityClassFGD_findListType; - m_eclassmanager.forEach = &EntityClassFGD_forEach; - m_eclassmanager.attach = &EntityClassFGD_attach; - m_eclassmanager.detach = &EntityClassFGD_detach; - m_eclassmanager.realise = &EntityClassFGD_realise; - m_eclassmanager.unrealise = &EntityClassFGD_unrealise; - - GlobalRadiant().attachGameToolsPathObserver(g_EntityClassFGD); - GlobalRadiant().attachGameNameObserver(g_EntityClassFGD); - } - ~EntityClassFGDAPI() - { - GlobalRadiant().detachGameNameObserver(g_EntityClassFGD); - GlobalRadiant().detachGameToolsPathObserver(g_EntityClassFGD); - - EntityClassFGD_destroy(); - } - EntityClassManager* getTable() - { - return &m_eclassmanager; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule EntityClassFGDModule; -typedef Static StaticEntityClassFGDModule; -StaticRegisterModule staticRegisterEntityClassFGD(StaticEntityClassFGDModule::instance()); diff --git a/radiant/eclass_fgd.h b/radiant/eclass_fgd.h deleted file mode 100644 index f8540b39..00000000 --- a/radiant/eclass_fgd.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ECLASS_FGD_H) -#define INCLUDED_ECLASS_FGD_H - -#endif diff --git a/radiant/eclass_xml.cpp b/radiant/eclass_xml.cpp deleted file mode 100644 index 5195b4e7..00000000 --- a/radiant/eclass_xml.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -///\file -///\brief EntityClass plugin that supports the .ent xml entity-definition format. -/// -/// the .ent xml format expresses entity-definitions. -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// the attributes of an entity type are defined like this: -/// -/// <[name of attribute type] -/// key="[entity key name]" -/// name="[name shown in gui]" -/// value="[default entity key value]" -/// >[comment text shown in gui] -/// -/// each attribute type has a specialised attribute-editor GUI -/// -/// currently-supported attribute types: -/// -/// string a string -/// array an array of strings - value is a semi-colon-delimited string -/// integer an integer value -/// boolean an integer - shows as a checkbox - true = non-zero -/// integer2 two integer values -/// integer3 three integer values -/// real3 three floating-point values -/// angle specialisation of real - Yaw angle -/// direction specialisation of real - Yaw angle, -1 = down, -2 = up -/// angles specialisation of real3 - Pitch Yaw Roll -/// color specialisation of real3 - RGB floating-point colour -/// target a string that uniquely identifies an entity or group of entities -/// targetname a string that uniquely identifies an entity or group of entities -/// sound the VFS path to a sound file -/// texture the VFS path to a texture file or a shader name -/// model the VFS path to a model file -/// skin the VFS path to a skin file -/// -/// -/// flag attributes define a flag in the "spawnflags" key: -/// -/// [comment text shown in gui] -/// -/// the default value for a flag bit is always 0. -/// -/// -/// List attributes have a set of valid values. -/// Create new list attribute types like this: -/// -/// -/// -/// -/// -/// -/// these can then be used as attribute types. -/// -/// -/// An attribute definition should specify a default value that corresponds -/// with the default value given by the game. If the default value is not -/// specified in the attribute definition, it is assumed to be an empty string. -/// -/// If the currently-selected entity in Radiant does not specify a value for -/// the key of an attribute, the default value from the attribute-definition -/// will be displayed in the attribute-editor and used when visualising the -/// entity in the preview windows. E.g. the Doom3 "light" entity has a -/// "light_radius" key. Light entities without a "light_radius" key are -/// displayed in Doom3 with a radius of 300. The default value for the -/// "light_radius" attribute definition should be specified as "300 300 300". -/// - - - - -#include "eclass_xml.h" - -#include "ieclass.h" -#include "irender.h" -#include "ifilesystem.h" -#include "iarchive.h" - -#include "xml/xmlparser.h" -#include "generic/object.h" -#include "generic/reference.h" -#include "stream/stringstream.h" -#include "stream/textfilestream.h" -#include "os/path.h" -#include "eclasslib.h" -#include "modulesystem/moduleregistry.h" -#include "stringio.h" - -#define PARSE_ERROR(elementName, name) makeQuoted(elementName) << " is not a valid child of " << makeQuoted(name) - -class IgnoreBreaks -{ -public: - const char* m_first; - const char* m_last; - IgnoreBreaks(const char* first, const char* last) : m_first(first), m_last(last) - { - } -}; - -template -TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const IgnoreBreaks& ignoreBreaks) -{ - for(const char* i = ignoreBreaks.m_first; i != ignoreBreaks.m_last; ++i) - { - if(*i != '\n') - { - ostream << *i; - } - } - return ostream; -} - -namespace -{ - -class TreeXMLImporter : public TextOutputStream -{ -public: - virtual TreeXMLImporter& pushElement(const XMLElement& element) = 0; - virtual void popElement(const char* name) = 0; -}; - -template -class Storage -{ - char m_storage[sizeof(Type)]; -public: - Type& get() - { - return *reinterpret_cast(m_storage); - } - const Type& get() const - { - return *reinterpret_cast(m_storage); - } -}; - -class BreakImporter : public TreeXMLImporter -{ -public: - BreakImporter(StringOutputStream& comment) - { - comment << '\n'; - } - static const char* name() - { - return "n"; - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), name())); - return *this; - } - void popElement(const char* elementName) - { - ERROR_MESSAGE(PARSE_ERROR(elementName, name())); - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -class AttributeImporter : public TreeXMLImporter -{ - StringOutputStream& m_comment; - -public: - AttributeImporter(StringOutputStream& comment, EntityClass* entityClass, const XMLElement& element) : m_comment(comment) - { - const char* type = element.name(); - const char* key = element.attribute("key"); - const char* name = element.attribute("name"); - const char* value = element.attribute("value"); - - ASSERT_MESSAGE(!string_empty(key), "key attribute not specified"); - ASSERT_MESSAGE(!string_empty(name), "name attribute not specified"); - - if(string_equal(type, "flag")) - { - std::size_t bit = atoi(element.attribute("bit")); - ASSERT_MESSAGE(bit < MAX_FLAGS, "invalid flag bit"); - ASSERT_MESSAGE(string_empty(entityClass->flagnames[bit]), "non-unique flag bit"); - strcpy(entityClass->flagnames[bit], key); - } - - m_comment << key; - m_comment << " : "; - - EntityClass_insertAttribute(*entityClass, key, EntityClassAttribute(type, name, value)); - } - ~AttributeImporter() - { - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), "attribute")); - return *this; - } - void popElement(const char* elementName) - { - ERROR_MESSAGE(PARSE_ERROR(elementName, "attribute")); - } - std::size_t write(const char* data, std::size_t length) - { - return m_comment.write(data, length); - } -}; - -bool attributeSupported(const char* name) -{ - return string_equal(name, "real") - || string_equal(name, "integer") - || string_equal(name, "boolean") - || string_equal(name, "string") - || string_equal(name, "array") - || string_equal(name, "flag") - || string_equal(name, "real3") - || string_equal(name, "integer3") - || string_equal(name, "direction") - || string_equal(name, "angle") - || string_equal(name, "angles") - || string_equal(name, "color") - || string_equal(name, "target") - || string_equal(name, "targetname") - || string_equal(name, "sound") - || string_equal(name, "texture") - || string_equal(name, "model") - || string_equal(name, "skin") - || string_equal(name, "integer2"); -} - -typedef std::map ListAttributeTypes; - -bool listAttributeSupported(ListAttributeTypes& listTypes, const char* name) -{ - return listTypes.find(name) != listTypes.end(); -} - - -class ClassImporter : public TreeXMLImporter -{ - EntityClassCollector& m_collector; - EntityClass* m_eclass; - StringOutputStream m_comment; - Storage m_attribute; - ListAttributeTypes& m_listTypes; - -public: - ClassImporter(EntityClassCollector& collector, ListAttributeTypes& listTypes, const XMLElement& element) : m_collector(collector), m_listTypes(listTypes) - { - m_eclass = Eclass_Alloc(); - m_eclass->free = &Eclass_Free; - - const char* name = element.attribute("name"); - ASSERT_MESSAGE(!string_empty(name), "name attribute not specified for class"); - m_eclass->m_name = name; - - const char* color = element.attribute("color"); - ASSERT_MESSAGE(!string_empty(name), "color attribute not specified for class " << name); - string_parse_vector3(color, m_eclass->color); - eclass_capture_state(m_eclass); - - const char* model = element.attribute("model"); - if(!string_empty(model)) - { - StringOutputStream buffer(256); - buffer << PathCleaned(model); - m_eclass->m_modelpath = buffer.c_str(); - } - - const char* type = element.name(); - if(string_equal(type, "point")) - { - const char* box = element.attribute("box"); - ASSERT_MESSAGE(!string_empty(box), "box attribute not found for class " << name); - m_eclass->fixedsize = true; - string_parse_vector(box, &m_eclass->mins.x(), &m_eclass->mins.x() + 6); - } - } - ~ClassImporter() - { - m_eclass->m_comments = m_comment.c_str(); - m_collector.insert(m_eclass); - - for(ListAttributeTypes::iterator i = m_listTypes.begin(); i != m_listTypes.end(); ++i) - { - m_collector.insert((*i).first.c_str(), (*i).second); - } - } - static const char* name() - { - return "class"; - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - if(attributeSupported(element.name()) || listAttributeSupported(m_listTypes, element.name())) - { - constructor(m_attribute.get(), makeReference(m_comment), m_eclass, element); - return m_attribute.get(); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), name())); - return *this; - } - } - void popElement(const char* elementName) - { - if(attributeSupported(elementName) || listAttributeSupported(m_listTypes, elementName)) - { - destructor(m_attribute.get()); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(elementName, name())); - } - } - std::size_t write(const char* data, std::size_t length) - { - return m_comment.write(data, length); - } -}; - -class ItemImporter : public TreeXMLImporter -{ -public: - ItemImporter(ListAttributeType& list, const XMLElement& element) - { - const char* name = element.attribute("name"); - const char* value = element.attribute("value"); - list.push_back(name, value); - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), "item")); - return *this; - } - void popElement(const char* elementName) - { - ERROR_MESSAGE(PARSE_ERROR(elementName, "item")); - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -bool isItem(const char* name) -{ - return string_equal(name, "item"); -} - -class ListAttributeImporter : public TreeXMLImporter -{ - ListAttributeType* m_listType; - Storage m_item; -public: - ListAttributeImporter(ListAttributeTypes& listTypes, const XMLElement& element) - { - const char* name = element.attribute("name"); - m_listType = &listTypes[name]; - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - if(isItem(element.name())) - { - constructor(m_item.get(), makeReference(*m_listType), element); - return m_item.get(); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), "list")); - return *this; - } - } - void popElement(const char* elementName) - { - if(isItem(elementName)) - { - destructor(m_item.get()); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(elementName, "list")); - } - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -bool classSupported(const char* name) -{ - return string_equal(name, "group") - || string_equal(name, "point"); -} - -bool listSupported(const char* name) -{ - return string_equal(name, "list"); -} - -class ClassesImporter : public TreeXMLImporter -{ - EntityClassCollector& m_collector; - Storage m_class; - Storage m_list; - ListAttributeTypes m_listTypes; - -public: - ClassesImporter(EntityClassCollector& collector) : m_collector(collector) - { - } - static const char* name() - { - return "classes"; - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - if(classSupported(element.name())) - { - constructor(m_class.get(), makeReference(m_collector), makeReference(m_listTypes), element); - return m_class.get(); - } - else if(listSupported(element.name())) - { - constructor(m_list.get(), makeReference(m_listTypes), element); - return m_list.get(); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), name())); - return *this; - } - } - void popElement(const char* elementName) - { - if(classSupported(elementName)) - { - destructor(m_class.get()); - } - else if(listSupported(elementName)) - { - destructor(m_list.get()); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(elementName, name())); - } - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -class EclassXMLImporter : public TreeXMLImporter -{ - EntityClassCollector& m_collector; - Storage m_classes; - -public: - EclassXMLImporter(EntityClassCollector& collector) : m_collector(collector) - { - } - static const char* name() - { - return "classes"; - } - TreeXMLImporter& pushElement(const XMLElement& element) - { - if(string_equal(element.name(), ClassesImporter::name())) - { - constructor(m_classes.get(), makeReference(m_collector)); - return m_classes.get(); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(element.name(), name())); - return *this; - } - } - void popElement(const char* elementName) - { - if(string_equal(elementName, ClassesImporter::name())) - { - destructor(m_classes.get()); - } - else - { - ERROR_MESSAGE(PARSE_ERROR(elementName, name())); - } - } - std::size_t write(const char* data, std::size_t length) - { - return length; - } -}; - -class TreeXMLImporterStack : public XMLImporter -{ - std::vector< Reference > m_importers; -public: - TreeXMLImporterStack(TreeXMLImporter& importer) - { - m_importers.push_back(makeReference(importer)); - } - void pushElement(const XMLElement& element) - { - m_importers.push_back(makeReference(m_importers.back().get().pushElement(element))); - } - void popElement(const char* name) - { - m_importers.pop_back(); - m_importers.back().get().popElement(name); - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_importers.back().get().write(buffer, length); - } -}; - - - -const char* GetExtension() -{ - return "ent"; -} -void ScanFile(EntityClassCollector& collector, const char *filename) -{ - TextFileInputStream inputFile(filename); - if(!inputFile.failed()) - { - XMLStreamParser parser(inputFile); - - EclassXMLImporter importer(collector); - TreeXMLImporterStack stack(importer); - parser.exportXML(stack); - } -} - - -} - -#include "modulesystem/singletonmodule.h" - -class EntityClassXMLDependencies : public GlobalFileSystemModuleRef, public GlobalShaderCacheModuleRef -{ -}; - -class EclassXMLAPI -{ - EntityClassScanner m_eclassxml; -public: - typedef EntityClassScanner Type; - STRING_CONSTANT(Name, "xml"); - - EclassXMLAPI() - { - m_eclassxml.scanFile = &ScanFile; - m_eclassxml.getExtension = &GetExtension; - } - EntityClassScanner* getTable() - { - return &m_eclassxml; - } -}; - -typedef SingletonModule EclassXMLModule; -typedef Static StaticEclassXMLModule; -StaticRegisterModule staticRegisterEclassXML(StaticEclassXMLModule::instance()); diff --git a/radiant/eclass_xml.h b/radiant/eclass_xml.h deleted file mode 100644 index 7884d0e8..00000000 --- a/radiant/eclass_xml.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ECLASS_XML_H) -#define INCLUDED_ECLASS_XML_H - -#endif diff --git a/radiant/entity.cpp b/radiant/entity.cpp deleted file mode 100644 index c2a31091..00000000 --- a/radiant/entity.cpp +++ /dev/null @@ -1,482 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entity.h" - -#include "ientity.h" -#include "iselection.h" -#include "imodel.h" -#include "ifilesystem.h" -#include "iundo.h" -#include "editable.h" - -#include "eclasslib.h" -#include "scenelib.h" -#include "os/path.h" -#include "os/file.h" -#include "stream/stringstream.h" -#include "stringio.h" - -#include "gtkutil/filechooser.h" -#include "gtkmisc.h" -#include "select.h" -#include "map.h" -#include "preferences.h" -#include "gtkdlgs.h" -#include "mainframe.h" -#include "qe3.h" -#include "commands.h" - -struct entity_globals_t -{ - Vector3 color_entity; - - entity_globals_t() : - color_entity(0.0f, 0.0f, 0.0f) - { - } -}; - -entity_globals_t g_entity_globals; - -class EntitySetKeyValueSelected : public scene::Graph::Walker -{ - const char* m_key; - const char* m_value; -public: - EntitySetKeyValueSelected(const char* key, const char* value) - : m_key(key), m_value(value) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && (instance.childSelected() || Instance_getSelectable(instance)->isSelected())) - { - entity->setKeyValue(m_key, m_value); - } - } -}; - -class EntitySetClassnameSelected : public scene::Graph::Walker -{ - const char* m_classname; -public: - EntitySetClassnameSelected(const char* classname) - : m_classname(classname) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && (instance.childSelected() || Instance_getSelectable(instance)->isSelected())) - { - NodeSmartReference node(GlobalEntityCreator().createEntity(GlobalEntityClassManager().findOrInsert(m_classname, node_is_group(path.top())))); - - EntityCopyingVisitor visitor(*Node_getEntity(node)); - - entity->forEachKeyValue(visitor); - - NodeSmartReference child(path.top().get()); - NodeSmartReference parent(path.parent().get()); - Node_getTraversable(parent)->erase(child); - if(Node_getTraversable(child) != 0 - && Node_getTraversable(node) != 0 - && node_is_group(node)) - { - parentBrushes(child, node); - } - Node_getTraversable(parent)->insert(node); - } - } -}; - -void Scene_EntitySetKeyValue_Selected(const char* key, const char* value) -{ - GlobalSceneGraph().traverse(EntitySetKeyValueSelected(key, value)); -} - -void Scene_EntitySetClassname_Selected(const char* classname) -{ - GlobalSceneGraph().traverse(EntitySetClassnameSelected(classname)); -} - - -void Entity_ungroupSelected() -{ - if (GlobalSelectionSystem().countSelected() < 1) return; - - UndoableCommand undo("ungroupSelectedEntities"); - - scene::Path world_path(makeReference(GlobalSceneGraph().root())); - world_path.push(makeReference(Map_FindOrInsertWorldspawn(g_map))); - - scene::Instance &instance = GlobalSelectionSystem().ultimateSelected(); - scene::Path path = instance.path(); - - if (!Node_isEntity(path.top())) path.pop(); - - if(Node_getEntity(path.top()) != 0 - && node_is_group(path.top())) - { - if(world_path.top().get_pointer() != path.top().get_pointer()) - { - parentBrushes(path.top(), world_path.top()); - Path_deleteTop(path); - } - } -} - - - -void Entity_connectSelected() -{ - if(GlobalSelectionSystem().countSelected() == 2) - { - GlobalEntityCreator().connectEntities( - GlobalSelectionSystem().penultimateSelected().path(), - GlobalSelectionSystem().ultimateSelected().path() - ); - } - else - { - globalErrorStream() << "entityConnectSelected: exactly two instances must be selected\n"; - } -} - -AABB Doom3Light_getBounds(const AABB& workzone) -{ - AABB aabb(workzone); - - Vector3 defaultRadius(300, 300, 300); - if(!string_parse_vector3(EntityClass_valueForKey(*GlobalEntityClassManager().findOrInsert("light", false), "light_radius"), defaultRadius)) - { - globalErrorStream() << "Doom3Light_getBounds: failed to parse default light radius\n"; - } - - if(aabb.extents[0] == 0) - { - aabb.extents[0] = defaultRadius[0]; - } - if(aabb.extents[1] == 0) - { - aabb.extents[1] = defaultRadius[1]; - } - if(aabb.extents[2] == 0) - { - aabb.extents[2] = defaultRadius[2]; - } - - if(aabb_valid(aabb)) - { - return aabb; - } - return AABB(Vector3(0, 0, 0), Vector3(64, 64, 64)); -} - -int g_iLastLightIntensity; - -void Entity_createFromSelection(const char* name, const Vector3& origin) -{ -#if 0 - if(string_equal_nocase(name, "worldspawn")) - { - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), "Can't create an entity with worldspawn.", "info"); - return; - } -#endif - - EntityClass* entityClass = GlobalEntityClassManager().findOrInsert(name, true); - - bool isModel = string_equal_nocase(name, "misc_model") - || string_equal_nocase(name, "misc_gamemodel") - || string_equal_nocase(name, "model_static") - || (GlobalSelectionSystem().countSelected() == 0 && string_equal_nocase(name, "func_static")); - - bool brushesSelected = Scene_countSelectedBrushes(GlobalSceneGraph()) != 0; - - if(!(entityClass->fixedsize || isModel) && !brushesSelected) - { - globalErrorStream() << "failed to create a group entity - no brushes are selected\n"; - return; - } - - AABB workzone(aabb_for_minmax(Select_getWorkZone().d_work_min, Select_getWorkZone().d_work_max)); - - - NodeSmartReference node(GlobalEntityCreator().createEntity(entityClass)); - - Node_getTraversable(GlobalSceneGraph().root())->insert(node); - - scene::Path entitypath(makeReference(GlobalSceneGraph().root())); - entitypath.push(makeReference(node.get())); - scene::Instance& instance = findInstance(entitypath); - - if(entityClass->fixedsize || (isModel && !brushesSelected)) - { - Select_Delete(); - - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->setType(TRANSFORM_PRIMITIVE); - transform->setTranslation(origin); - transform->freezeTransform(); - } - - GlobalSelectionSystem().setSelectedAll(false); - - Instance_setSelected(instance, true); - } - else - { - if (g_pGameDescription->mGameType == "doom3") - { - Node_getEntity(node)->setKeyValue("model", Node_getEntity(node)->getKeyValue("name")); - } - - Scene_parentSelectedBrushesToEntity(GlobalSceneGraph(), node); - Scene_forEachChildSelectable(SelectableSetSelected(true), instance.path()); - } - - // tweaking: when right clic dropping a light entity, ask for light value in a custom dialog box - // see SF bug 105383 - - if (g_pGameDescription->mGameType == "hl") - { - // FIXME - Hydra: really we need a combined light AND color dialog for halflife. - if (string_equal_nocase(name, "light") - || string_equal_nocase(name, "light_environment") - || string_equal_nocase(name, "light_spot")) - { - int intensity = g_iLastLightIntensity; - - if (DoLightIntensityDlg (&intensity) == eIDOK) - { - g_iLastLightIntensity = intensity; - char buf[30]; - sprintf( buf, "255 255 255 %d", intensity ); - Node_getEntity(node)->setKeyValue("_light", buf); - } - } - } - else if(string_equal_nocase(name, "light")) - { - if(g_pGameDescription->mGameType != "doom3") - { - int intensity = g_iLastLightIntensity; - - if (DoLightIntensityDlg (&intensity) == eIDOK) - { - g_iLastLightIntensity = intensity; - char buf[10]; - sprintf( buf, "%d", intensity ); - Node_getEntity(node)->setKeyValue("light", buf); - } - } - else if(brushesSelected) // use workzone to set light position/size for doom3 lights, if there are brushes selected - { - AABB bounds(Doom3Light_getBounds(workzone)); - StringOutputStream key(64); - key << bounds.origin[0] << " " << bounds.origin[1] << " " << bounds.origin[2]; - Node_getEntity(node)->setKeyValue("origin", key.c_str()); - key.clear(); - key << bounds.extents[0] << " " << bounds.extents[1] << " " << bounds.extents[2]; - Node_getEntity(node)->setKeyValue("light_radius", key.c_str()); - } - } - - if(isModel) - { - const char* model = misc_model_dialog(GTK_WIDGET(MainFrame_getWindow())); - if(model != 0) - { - Node_getEntity(node)->setKeyValue("model", model); - } - } -} - - -bool DoNormalisedColor(Vector3& color) -{ - if(!color_dialog(GTK_WIDGET(MainFrame_getWindow()), color)) - return false; - /* - ** scale colors so that at least one component is at 1.0F - */ - - float largest = 0.0F; - - if ( color[0] > largest ) - largest = color[0]; - if ( color[1] > largest ) - largest = color[1]; - if ( color[2] > largest ) - largest = color[2]; - - if ( largest == 0.0F ) - { - color[0] = 1.0F; - color[1] = 1.0F; - color[2] = 1.0F; - } - else - { - float scaler = 1.0F / largest; - - color[0] *= scaler; - color[1] *= scaler; - color[2] *= scaler; - } - - return true; -} - -void Entity_setColour() -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path(); - Entity* entity = Node_getEntity(path.top()); - if(entity != 0) - { - const char* strColor = entity->getKeyValue("_color"); - if(!string_empty(strColor)) - { - Vector3 rgb; - if (string_parse_vector3(strColor, rgb)) - { - g_entity_globals.color_entity = rgb; - } - } - - if(g_pGameDescription->mGameType == "doom3" - ? color_dialog(GTK_WIDGET(MainFrame_getWindow()), g_entity_globals.color_entity) - : DoNormalisedColor(g_entity_globals.color_entity)) - { - char buffer[128]; - sprintf(buffer, "%g %g %g", g_entity_globals.color_entity[0], - g_entity_globals.color_entity[1], - g_entity_globals.color_entity[2]); - - Scene_EntitySetKeyValue_Selected("_color", buffer); - } - } - } -} - -const char* misc_model_dialog(GtkWidget* parent) -{ - StringOutputStream buffer(1024); - - buffer << g_qeglobals.m_userGamePath.c_str() << "models/"; - - if(!file_readable(buffer.c_str())) - { - // just go to fsmain - buffer.clear(); - buffer << g_qeglobals.m_userGamePath.c_str() << "/"; - } - - const char *filename = file_dialog (parent, TRUE, "Choose Model", buffer.c_str(), ModelLoader::Name()); - if (filename != 0) - { - // use VFS to get the correct relative path - const char* relative = path_make_relative(filename, GlobalFileSystem().findRoot(filename)); - if(relative == filename) - { - globalOutputStream() << "WARNING: could not extract the relative path, using full path instead\n"; - } - return relative; - } - return 0; -} - -void LightRadiiImport(EntityCreator& self, bool value) -{ - self.setLightRadii(value); -} -typedef ReferenceCaller1 LightRadiiImportCaller; - -void LightRadiiExport(EntityCreator& self, const BoolImportCallback& importer) -{ - importer(self.getLightRadii()); -} -typedef ReferenceCaller1 LightRadiiExportCaller; - -void Entity_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox( - "Show", "Light Radii", - LightRadiiImportCaller(GlobalEntityCreator()), - LightRadiiExportCaller(GlobalEntityCreator()) - ); -} -void Entity_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Entities", "Entity Display Preferences")); - Entity_constructPreferences(page); -} -void Entity_registerPreferencesPage() -{ - PreferencesDialog_addDisplayPage(FreeCaller1()); -} - - - -void Entity_constructMenu(GtkMenu* menu) -{ - create_menu_item_with_mnemonic(menu, "_Ungroup", "UngroupSelection"); - create_menu_item_with_mnemonic(menu, "_Connect", "ConnectSelection"); - create_menu_item_with_mnemonic(menu, "_Select Color...", "EntityColor"); -} - - - -#include "preferencesystem.h" -#include "stringio.h" - -void Entity_Construct() -{ - GlobalCommands_insert("EntityColor", FreeCaller(), Accelerator('K')); - GlobalCommands_insert("ConnectSelection", FreeCaller(), Accelerator('K', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("UngroupSelection", FreeCaller()); - - GlobalPreferenceSystem().registerPreference("SI_Colors5", Vector3ImportStringCaller(g_entity_globals.color_entity), Vector3ExportStringCaller(g_entity_globals.color_entity)); - GlobalPreferenceSystem().registerPreference("LastLightIntensity", IntImportStringCaller(g_iLastLightIntensity), IntExportStringCaller(g_iLastLightIntensity)); - - Entity_registerPreferencesPage(); -} - -void Entity_Destroy() -{ -} - diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp deleted file mode 100644 index e2f3c194..00000000 --- a/radiant/entityinspector.cpp +++ /dev/null @@ -1,1761 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entityinspector.h" - -#include "debugging/debugging.h" - -#include "ientity.h" -#include "ifilesystem.h" -#include "imodel.h" -#include "iscenegraph.h" -#include "iselection.h" -#include "iundo.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "os/path.h" -#include "eclasslib.h" -#include "scenelib.h" -#include "generic/callback.h" -#include "os/file.h" -#include "stream/stringstream.h" -#include "moduleobserver.h" -#include "convert.h" -#include "stringio.h" - -#include "gtkutil/accelerator.h" -#include "gtkutil/dialog.h" -#include "gtkutil/filechooser.h" -#include "gtkutil/messagebox.h" -#include "gtkutil/nonmodal.h" -#include "gtkutil/button.h" -#include "gtkutil/entry.h" -#include "gtkutil/container.h" - -#include "qe3.h" -#include "gtkmisc.h" -#include "gtkdlgs.h" -#include "entity.h" -#include "mainframe.h" -#include "textureentry.h" - -GtkEntry* numeric_entry_new() -{ - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_widget_set_size_request(GTK_WIDGET(entry), 64, -1); - return entry; -} - -namespace -{ - typedef std::map KeyValues; - KeyValues g_selectedKeyValues; - KeyValues g_selectedDefaultKeyValues; -} - -const char* SelectedEntity_getValueForKey(const char* key) -{ - { - KeyValues::const_iterator i = g_selectedKeyValues.find(key); - if(i != g_selectedKeyValues.end()) - { - return (*i).second.c_str(); - } - } - { - KeyValues::const_iterator i = g_selectedDefaultKeyValues.find(key); - if(i != g_selectedDefaultKeyValues.end()) - { - return (*i).second.c_str(); - } - } - return ""; -} - -void Scene_EntitySetKeyValue_Selected_Undoable(const char* key, const char* value) -{ - StringOutputStream command(256); - command << "entitySetKeyValue -key " << makeQuoted(key) << " -value " << makeQuoted(value); - UndoableCommand undo(command.c_str()); - Scene_EntitySetKeyValue_Selected(key, value); -} - -class EntityAttribute -{ -public: - virtual GtkWidget* getWidget() const = 0; - virtual void update() = 0; - virtual void release() = 0; -}; - -class BooleanAttribute : public EntityAttribute -{ - CopiedString m_key; - GtkCheckButton* m_check; - - static gboolean toggled(GtkWidget *widget, BooleanAttribute* self) - { - self->apply(); - return FALSE; - } -public: - BooleanAttribute(const char* key) : - m_key(key), - m_check(0) - { - GtkCheckButton* check = GTK_CHECK_BUTTON(gtk_check_button_new()); - gtk_widget_show(GTK_WIDGET(check)); - - m_check = check; - - guint handler = g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggled), this); - g_object_set_data(G_OBJECT(check), "handler", gint_to_pointer(handler)); - - update(); - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_check); - } - void release() - { - delete this; - } - void apply() - { - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_check)) ? "1" : "0"); - } - typedef MemberCaller ApplyCaller; - - void update() - { - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - if(!string_empty(value)) - { - toggle_button_set_active_no_signal(GTK_TOGGLE_BUTTON(m_check), atoi(value) != 0); - } - else - { - toggle_button_set_active_no_signal(GTK_TOGGLE_BUTTON(m_check), false); - } - } - typedef MemberCaller UpdateCaller; -}; - - -class StringAttribute : public EntityAttribute -{ - CopiedString m_key; - GtkEntry* m_entry; - NonModalEntry m_nonModal; -public: - StringAttribute(const char* key) : - m_key(key), - m_entry(0), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_widget_set_size_request(GTK_WIDGET(entry), 50, -1); - - m_entry = entry; - m_nonModal.connect(m_entry); - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_entry); - } - GtkEntry* getEntry() const - { - return m_entry; - } - - void release() - { - delete this; - } - void apply() - { - StringOutputStream value(64); - value << ConvertUTF8ToLocale(gtk_entry_get_text(m_entry)); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - StringOutputStream value(64); - value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str())); - gtk_entry_set_text(m_entry, value.c_str()); - } - typedef MemberCaller UpdateCaller; -}; - -class ShaderAttribute : public StringAttribute -{ -public: - ShaderAttribute(const char* key) : StringAttribute(key) - { - GlobalShaderEntryCompletion::instance().connect(StringAttribute::getEntry()); - } -}; - - -class ModelAttribute : public EntityAttribute -{ - CopiedString m_key; - BrowsedPathEntry m_entry; - NonModalEntry m_nonModal; -public: - ModelAttribute(const char* key) : - m_key(key), - m_entry(BrowseCaller(*this)), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - m_nonModal.connect(m_entry.m_entry.m_entry); - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_entry.m_entry.m_frame); - } - void apply() - { - StringOutputStream value(64); - value << ConvertUTF8ToLocale(gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry))); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str()); - } - typedef MemberCaller ApplyCaller; - void update() - { - StringOutputStream value(64); - value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str())); - gtk_entry_set_text(GTK_ENTRY(m_entry.m_entry.m_entry), value.c_str()); - } - typedef MemberCaller UpdateCaller; - void browse(const BrowsedPathEntry::SetPathCallback& setPath) - { - const char *filename = misc_model_dialog(gtk_widget_get_toplevel(GTK_WIDGET(m_entry.m_entry.m_frame))); - - if(filename != 0) - { - setPath(filename); - apply(); - } - } - typedef MemberCaller1 BrowseCaller; -}; - -const char* browse_sound(GtkWidget* parent) -{ - StringOutputStream buffer(1024); - - buffer << g_qeglobals.m_userGamePath.c_str() << "sound/"; - - if(!file_readable(buffer.c_str())) - { - // just go to fsmain - buffer.clear(); - buffer << g_qeglobals.m_userGamePath.c_str() << "/"; - } - - const char* filename = file_dialog(parent, TRUE, "Open Wav File", buffer.c_str(), "sound"); - if(filename != 0) - { - const char* relative = path_make_relative(filename, GlobalFileSystem().findRoot(filename)); - if(relative == filename) - { - globalOutputStream() << "WARNING: could not extract the relative path, using full path instead\n"; - } - return relative; - } - return filename; -} - -class SoundAttribute : public EntityAttribute -{ - CopiedString m_key; - BrowsedPathEntry m_entry; - NonModalEntry m_nonModal; -public: - SoundAttribute(const char* key) : - m_key(key), - m_entry(BrowseCaller(*this)), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - m_nonModal.connect(m_entry.m_entry.m_entry); - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_entry.m_entry.m_frame); - } - void apply() - { - StringOutputStream value(64); - value << ConvertUTF8ToLocale(gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry))); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str()); - } - typedef MemberCaller ApplyCaller; - void update() - { - StringOutputStream value(64); - value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str())); - gtk_entry_set_text(GTK_ENTRY(m_entry.m_entry.m_entry), value.c_str()); - } - typedef MemberCaller UpdateCaller; - void browse(const BrowsedPathEntry::SetPathCallback& setPath) - { - const char *filename = browse_sound(gtk_widget_get_toplevel(GTK_WIDGET(m_entry.m_entry.m_frame))); - - if(filename != 0) - { - setPath(filename); - apply(); - } - } - typedef MemberCaller1 BrowseCaller; -}; - -inline double angle_normalised(double angle) -{ - return float_mod(angle, 360.0); -} - -class AngleAttribute : public EntityAttribute -{ - CopiedString m_key; - GtkEntry* m_entry; - NonModalEntry m_nonModal; -public: - AngleAttribute(const char* key) : - m_key(key), - m_entry(0), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - GtkEntry* entry = numeric_entry_new(); - m_entry = entry; - m_nonModal.connect(m_entry); - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_entry); - } - void apply() - { - StringOutputStream angle(32); - angle << angle_normalised(entry_get_float(m_entry)); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), angle.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - if(!string_empty(value)) - { - StringOutputStream angle(32); - angle << angle_normalised(atof(value)); - gtk_entry_set_text(m_entry, angle.c_str()); - } - else - { - gtk_entry_set_text(m_entry, "0"); - } - } - typedef MemberCaller UpdateCaller; -}; - -namespace -{ - typedef const char* String; - const String buttons[] = { "up", "down", "z-axis" }; -} - -class DirectionAttribute : public EntityAttribute -{ - CopiedString m_key; - GtkEntry* m_entry; - NonModalEntry m_nonModal; - RadioHBox m_radio; - NonModalRadio m_nonModalRadio; - GtkHBox* m_hbox; -public: - DirectionAttribute(const char* key) : - m_key(key), - m_entry(0), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)), - m_radio(RadioHBox_new(STRING_ARRAY_RANGE(buttons))), - m_nonModalRadio(ApplyRadioCaller(*this)) - { - GtkEntry* entry = numeric_entry_new(); - m_entry = entry; - m_nonModal.connect(m_entry); - - m_nonModalRadio.connect(m_radio.m_radio); - - m_hbox = GTK_HBOX(gtk_hbox_new(FALSE, 4)); - gtk_widget_show(GTK_WIDGET(m_hbox)); - - gtk_box_pack_start(GTK_BOX(m_hbox), GTK_WIDGET(m_radio.m_hbox), TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(m_hbox), GTK_WIDGET(m_entry), TRUE, TRUE, 0); - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_hbox); - } - void apply() - { - StringOutputStream angle(32); - angle << angle_normalised(entry_get_float(m_entry)); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), angle.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - if(!string_empty(value)) - { - float f = float(atof(value)); - if(f == -1) - { - gtk_widget_set_sensitive(GTK_WIDGET(m_entry), FALSE); - radio_button_set_active_no_signal(m_radio.m_radio, 0); - gtk_entry_set_text(m_entry, ""); - } - else if(f == -2) - { - gtk_widget_set_sensitive(GTK_WIDGET(m_entry), FALSE); - radio_button_set_active_no_signal(m_radio.m_radio, 1); - gtk_entry_set_text(m_entry, ""); - } - else - { - gtk_widget_set_sensitive(GTK_WIDGET(m_entry), TRUE); - radio_button_set_active_no_signal(m_radio.m_radio, 2); - StringOutputStream angle(32); - angle << angle_normalised(f); - gtk_entry_set_text(m_entry, angle.c_str()); - } - } - else - { - gtk_entry_set_text(m_entry, "0"); - } - } - typedef MemberCaller UpdateCaller; - - void applyRadio() - { - int index = radio_button_get_active(m_radio.m_radio); - if(index == 0) - { - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), "-1"); - } - else if(index == 1) - { - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), "-2"); - } - else if(index == 2) - { - apply(); - } - } - typedef MemberCaller ApplyRadioCaller; -}; - - -class AnglesEntry -{ -public: - GtkEntry* m_roll; - GtkEntry* m_pitch; - GtkEntry* m_yaw; - AnglesEntry() : m_roll(0), m_pitch(0), m_yaw(0) - { - } -}; - -typedef BasicVector3 DoubleVector3; - -class AnglesAttribute : public EntityAttribute -{ - CopiedString m_key; - AnglesEntry m_angles; - NonModalEntry m_nonModal; - GtkBox* m_hbox; -public: - AnglesAttribute(const char* key) : - m_key(key), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - m_hbox = GTK_BOX(gtk_hbox_new(TRUE, 4)); - gtk_widget_show(GTK_WIDGET(m_hbox)); - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_angles.m_pitch = entry; - m_nonModal.connect(m_angles.m_pitch); - } - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_angles.m_yaw = entry; - m_nonModal.connect(m_angles.m_yaw); - } - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_angles.m_roll = entry; - m_nonModal.connect(m_angles.m_roll); - } - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_hbox); - } - void apply() - { - StringOutputStream angles(64); - angles << angle_normalised(entry_get_float(m_angles.m_pitch)) - << " " << angle_normalised(entry_get_float(m_angles.m_yaw)) - << " " << angle_normalised(entry_get_float(m_angles.m_roll)); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), angles.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - StringOutputStream angle(32); - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - if(!string_empty(value)) - { - DoubleVector3 pitch_yaw_roll; - if(!string_parse_vector3(value, pitch_yaw_roll)) - { - pitch_yaw_roll = DoubleVector3(0, 0, 0); - } - - angle << angle_normalised(pitch_yaw_roll.x()); - gtk_entry_set_text(m_angles.m_pitch, angle.c_str()); - angle.clear(); - - angle << angle_normalised(pitch_yaw_roll.y()); - gtk_entry_set_text(m_angles.m_yaw, angle.c_str()); - angle.clear(); - - angle << angle_normalised(pitch_yaw_roll.z()); - gtk_entry_set_text(m_angles.m_roll, angle.c_str()); - angle.clear(); - } - else - { - gtk_entry_set_text(m_angles.m_pitch, "0"); - gtk_entry_set_text(m_angles.m_yaw, "0"); - gtk_entry_set_text(m_angles.m_roll, "0"); - } - } - typedef MemberCaller UpdateCaller; -}; - -class Vector3Entry -{ -public: - GtkEntry* m_x; - GtkEntry* m_y; - GtkEntry* m_z; - Vector3Entry() : m_x(0), m_y(0), m_z(0) - { - } -}; - -class Vector3Attribute : public EntityAttribute -{ - CopiedString m_key; - Vector3Entry m_vector3; - NonModalEntry m_nonModal; - GtkBox* m_hbox; -public: - Vector3Attribute(const char* key) : - m_key(key), - m_nonModal(ApplyCaller(*this), UpdateCaller(*this)) - { - m_hbox = GTK_BOX(gtk_hbox_new(TRUE, 4)); - gtk_widget_show(GTK_WIDGET(m_hbox)); - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_vector3.m_x = entry; - m_nonModal.connect(m_vector3.m_x); - } - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_vector3.m_y = entry; - m_nonModal.connect(m_vector3.m_y); - } - { - GtkEntry* entry = numeric_entry_new(); - gtk_box_pack_start(m_hbox, GTK_WIDGET(entry), TRUE, TRUE, 0); - m_vector3.m_z = entry; - m_nonModal.connect(m_vector3.m_z); - } - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_hbox); - } - void apply() - { - StringOutputStream vector3(64); - vector3 << entry_get_float(m_vector3.m_x) - << " " << entry_get_float(m_vector3.m_y) - << " " << entry_get_float(m_vector3.m_z); - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), vector3.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - StringOutputStream buffer(32); - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - if(!string_empty(value)) - { - DoubleVector3 x_y_z; - if(!string_parse_vector3(value, x_y_z)) - { - x_y_z = DoubleVector3(0, 0, 0); - } - - buffer << x_y_z.x(); - gtk_entry_set_text(m_vector3.m_x, buffer.c_str()); - buffer.clear(); - - buffer << x_y_z.y(); - gtk_entry_set_text(m_vector3.m_y, buffer.c_str()); - buffer.clear(); - - buffer << x_y_z.z(); - gtk_entry_set_text(m_vector3.m_z, buffer.c_str()); - buffer.clear(); - } - else - { - gtk_entry_set_text(m_vector3.m_x, "0"); - gtk_entry_set_text(m_vector3.m_y, "0"); - gtk_entry_set_text(m_vector3.m_z, "0"); - } - } - typedef MemberCaller UpdateCaller; -}; - -class NonModalComboBox -{ - Callback m_changed; - guint m_changedHandler; - - static gboolean changed(GtkComboBox *widget, NonModalComboBox* self) - { - self->m_changed(); - return FALSE; - } - -public: - NonModalComboBox(const Callback& changed) : m_changed(changed), m_changedHandler(0) - { - } - void connect(GtkComboBox* combo) - { - m_changedHandler = g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(changed), this); - } - void setActive(GtkComboBox* combo, int value) - { - g_signal_handler_disconnect(G_OBJECT(combo), m_changedHandler); - gtk_combo_box_set_active(combo, value); - connect(combo); - } -}; - -class ListAttribute : public EntityAttribute -{ - CopiedString m_key; - GtkComboBox* m_combo; - NonModalComboBox m_nonModal; - const ListAttributeType& m_type; -public: - ListAttribute(const char* key, const ListAttributeType& type) : - m_key(key), - m_combo(0), - m_nonModal(ApplyCaller(*this)), - m_type(type) - { - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - - for(ListAttributeType::const_iterator i = type.begin(); i != type.end(); ++i) - { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), (*i).first.c_str()); - } - - gtk_widget_show(GTK_WIDGET(combo)); - m_nonModal.connect(combo); - - m_combo = combo; - } - void release() - { - delete this; - } - GtkWidget* getWidget() const - { - return GTK_WIDGET(m_combo); - } - void apply() - { - Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), m_type[gtk_combo_box_get_active(m_combo)].second.c_str()); - } - typedef MemberCaller ApplyCaller; - - void update() - { - const char* value = SelectedEntity_getValueForKey(m_key.c_str()); - ListAttributeType::const_iterator i = m_type.findValue(value); - if(i != m_type.end()) - { - m_nonModal.setActive(m_combo, static_cast(std::distance(m_type.begin(), i))); - } - else - { - m_nonModal.setActive(m_combo, 0); - } - } - typedef MemberCaller UpdateCaller; -}; - - -namespace -{ - GtkWidget* g_entity_split1 = 0; - GtkWidget* g_entity_split2 = 0; - int g_entitysplit1_position; - int g_entitysplit2_position; - - bool g_entityInspector_windowConstructed = false; - - GtkTreeView* g_entityClassList; - GtkTextView* g_entityClassComment; - - GtkCheckButton* g_entitySpawnflagsCheck[MAX_FLAGS]; - - GtkEntry* g_entityKeyEntry; - GtkEntry* g_entityValueEntry; - - GtkListStore* g_entlist_store; - GtkListStore* g_entprops_store; - const EntityClass* g_current_flags = 0; - const EntityClass* g_current_comment = 0; - const EntityClass* g_current_attributes = 0; - - // the number of active spawnflags - int g_spawnflag_count; - // table: index, match spawnflag item to the spawnflag index (i.e. which bit) - int spawn_table[MAX_FLAGS]; - // we change the layout depending on how many spawn flags we need to display - // the table is a 4x4 in which we need to put the comment box g_entityClassComment and the spawn flags.. - GtkTable* g_spawnflagsTable; - - GtkVBox* g_attributeBox = 0; - typedef std::vector EntityAttributes; - EntityAttributes g_entityAttributes; -} - -void GlobalEntityAttributes_clear() -{ - for(EntityAttributes::iterator i = g_entityAttributes.begin(); i != g_entityAttributes.end(); ++i) - { - (*i)->release(); - } - g_entityAttributes.clear(); -} - -class GetKeyValueVisitor : public Entity::Visitor -{ - KeyValues& m_keyvalues; -public: - GetKeyValueVisitor(KeyValues& keyvalues) - : m_keyvalues(keyvalues) - { - } - - void visit(const char* key, const char* value) - { - m_keyvalues.insert(KeyValues::value_type(CopiedString(key), CopiedString(value))); - } - -}; - -void Entity_GetKeyValues(const Entity& entity, KeyValues& keyvalues, KeyValues& defaultValues) -{ - GetKeyValueVisitor visitor(keyvalues); - - entity.forEachKeyValue(visitor); - - const EntityClassAttributes& attributes = entity.getEntityClass().m_attributes; - - for(EntityClassAttributes::const_iterator i = attributes.begin(); i != attributes.end(); ++i) - { - defaultValues.insert(KeyValues::value_type((*i).first, (*i).second.m_value)); - } -} - -void Entity_GetKeyValues_Selected(KeyValues& keyvalues, KeyValues& defaultValues) -{ - class EntityGetKeyValues : public SelectionSystem::Visitor - { - KeyValues& m_keyvalues; - KeyValues& m_defaultValues; - mutable std::set m_visited; - public: - EntityGetKeyValues(KeyValues& keyvalues, KeyValues& defaultValues) - : m_keyvalues(keyvalues), m_defaultValues(defaultValues) - { - } - void visit(scene::Instance& instance) const - { - Entity* entity = Node_getEntity(instance.path().top()); - if(entity == 0 && instance.path().size() != 1) - { - entity = Node_getEntity(instance.path().parent()); - } - if(entity != 0 && m_visited.insert(entity).second) - { - Entity_GetKeyValues(*entity, m_keyvalues, m_defaultValues); - } - } - } visitor(keyvalues, defaultValues); - GlobalSelectionSystem().foreachSelected(visitor); -} - -const char* keyvalues_valueforkey(KeyValues& keyvalues, const char* key) -{ - KeyValues::iterator i = keyvalues.find(CopiedString(key)); - if(i != keyvalues.end()) - return (*i).second.c_str(); - return ""; -} - -class EntityClassListStoreAppend : public EntityClassVisitor -{ - GtkListStore* store; -public: - EntityClassListStoreAppend(GtkListStore* store_) : store(store_) - { - } - void visit(EntityClass* e) - { - GtkTreeIter iter; - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, 0, e->name(), 1, e, -1); - } -}; - -void EntityClassList_fill() -{ - EntityClassListStoreAppend append(g_entlist_store); - GlobalEntityClassManager().forEach(append); -} - -void EntityClassList_clear() -{ - gtk_list_store_clear(g_entlist_store); -} - -void SetComment(EntityClass* eclass) -{ - if(eclass == g_current_comment) - return; - - g_current_comment = eclass; - - GtkTextBuffer* buffer = gtk_text_view_get_buffer(g_entityClassComment); - gtk_text_buffer_set_text(buffer, eclass->comments(), -1); -} - -void SurfaceFlags_setEntityClass(EntityClass* eclass) -{ - if(eclass == g_current_flags) - return; - - g_current_flags = eclass; - - int spawnflag_count = 0; - - { - // do a first pass to count the spawn flags, don't touch the widgets, we don't know in what state they are - for (int i=0 ; iflagnames[i] && eclass->flagnames[i][0] != 0 && strcmp(eclass->flagnames[i],"-")) - { - spawn_table[spawnflag_count] = i; - spawnflag_count++; - } - } - } - - // disable all remaining boxes - // NOTE: these boxes might not even be on display - { - for (int i = 0; i < g_spawnflag_count; ++i) - { - GtkWidget* widget = GTK_WIDGET(g_entitySpawnflagsCheck[i]); - gtk_label_set_text(GTK_LABEL(GTK_BIN(widget)->child), " "); - gtk_widget_hide(widget); - gtk_widget_ref(widget); - gtk_container_remove(GTK_CONTAINER(g_spawnflagsTable), widget); - } - } - - g_spawnflag_count = spawnflag_count; - - { - for (int i = 0; i < g_spawnflag_count; ++i) - { - GtkWidget* widget = GTK_WIDGET(g_entitySpawnflagsCheck[i]); - gtk_widget_show (widget); - - StringOutputStream str(16); - str << LowerCase(eclass->flagnames[spawn_table[i]]); - - gtk_table_attach(g_spawnflagsTable, widget, i%4, i%4+1, i/4, i/4+1, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(GTK_FILL), 0, 0); - gtk_widget_unref(widget); - - gtk_label_set_text(GTK_LABEL(GTK_BIN(widget)->child), str.c_str()); - } - } -} - -void EntityClassList_selectEntityClass(EntityClass* eclass) -{ - GtkTreeModel* model = GTK_TREE_MODEL(g_entlist_store); - GtkTreeIter iter; - for(gboolean good = gtk_tree_model_get_iter_first(model, &iter); good != FALSE; good = gtk_tree_model_iter_next(model, &iter)) - { - char* text; - gtk_tree_model_get(model, &iter, 0, &text, -1); - if (strcmp (text, eclass->name()) == 0) - { - GtkTreeView* view = g_entityClassList; - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); - if(GTK_WIDGET_REALIZED(view)) - { - gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); - } - gtk_tree_path_free(path); - good = FALSE; - } - g_free(text); - } -} - -void EntityInspector_appendAttribute(const char* name, EntityAttribute& attribute) -{ - GtkTable* row = DialogRow_new(name, attribute.getWidget()); - DialogVBox_packRow(g_attributeBox, GTK_WIDGET(row)); -} - - -template -class StatelessAttributeCreator -{ -public: - static EntityAttribute* create(const char* name) - { - return new Attribute(name); - } -}; - -class EntityAttributeFactory -{ - typedef EntityAttribute* (*CreateFunc)(const char* name); - typedef std::map Creators; - Creators m_creators; -public: - EntityAttributeFactory() - { - m_creators.insert(Creators::value_type("string", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("color", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("integer", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("real", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("shader", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("boolean", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("angle", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("direction", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("angles", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("model", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("sound", &StatelessAttributeCreator::create)); - m_creators.insert(Creators::value_type("vector3", &StatelessAttributeCreator::create)); - } - EntityAttribute* create(const char* type, const char* name) - { - Creators::iterator i = m_creators.find(type); - if(i != m_creators.end()) - { - return (*i).second(name); - } - const ListAttributeType* listType = GlobalEntityClassManager().findListType(type); - if(listType != 0) - { - return new ListAttribute(name, *listType); - } - return 0; - } -}; - -typedef Static GlobalEntityAttributeFactory; - -void EntityInspector_setEntityClass(EntityClass *eclass) -{ - EntityClassList_selectEntityClass(eclass); - SurfaceFlags_setEntityClass(eclass); - - if(eclass != g_current_attributes) - { - g_current_attributes = eclass; - - container_remove_all(GTK_CONTAINER(g_attributeBox)); - GlobalEntityAttributes_clear(); - - for(EntityClassAttributes::const_iterator i = eclass->m_attributes.begin(); i != eclass->m_attributes.end(); ++i) - { - EntityAttribute* attribute = GlobalEntityAttributeFactory::instance().create((*i).second.m_type.c_str(), (*i).first.c_str()); - if(attribute != 0) - { - g_entityAttributes.push_back(attribute); - EntityInspector_appendAttribute(EntityClassAttributePair_getName(*i), *g_entityAttributes.back()); - } - } - } -} - -void EntityInspector_updateSpawnflags() -{ - { - int f = atoi(SelectedEntity_getValueForKey("spawnflags")); - for (int i = 0; i < g_spawnflag_count; ++i) - { - int v = !!(f&(1<update(); - } -} - -class EntityInspectorDraw -{ - IdleDraw m_idleDraw; -public: - EntityInspectorDraw() : m_idleDraw(FreeCaller()) - { - } - void queueDraw() - { - m_idleDraw.queueDraw(); - } -}; - -EntityInspectorDraw g_EntityInspectorDraw; - - -void EntityInspector_keyValueChanged() -{ - g_EntityInspectorDraw.queueDraw(); -} -void EntityInspector_selectionChanged(const Selectable&) -{ - EntityInspector_keyValueChanged(); -} - -// Creates a new entity based on the currently selected brush and entity type. -// -void EntityClassList_createEntity() -{ - GtkTreeView* view = g_entityClassList; - - // find out what type of entity we are trying to create - GtkTreeModel* model; - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(view), &model, &iter) == FALSE) - { - gtk_MessageBox(gtk_widget_get_toplevel(GTK_WIDGET(g_entityClassList)), "You must have a selected class to create an entity", "info"); - return; - } - - char* text; - gtk_tree_model_get(model, &iter, 0, &text, -1); - - { - StringOutputStream command; - command << "entityCreate -class " << text; - - UndoableCommand undo(command.c_str()); - - Entity_createFromSelection(text, g_vector3_identity); - } - g_free(text); -} - -void EntityInspector_applyKeyValue() -{ - // Get current selection text - StringOutputStream key(64); - key << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityKeyEntry)); - StringOutputStream value(64); - value << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityValueEntry)); - - - // TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity - if (!strcmp(key.c_str(), "classname") && !strcmp(value.c_str(), "worldspawn")) - { - gtk_MessageBox(gtk_widget_get_toplevel(GTK_WIDGET(g_entityKeyEntry)), "Cannot change \"classname\" key back to worldspawn.", 0, eMB_OK ); - return; - } - - - // RR2DO2: we don't want spaces in entity keys - if (strstr( key.c_str(), " " )) - { - gtk_MessageBox(gtk_widget_get_toplevel(GTK_WIDGET(g_entityKeyEntry)), "No spaces are allowed in entity keys.", 0, eMB_OK ); - return; - } - - if(strcmp(key.c_str(), "classname") == 0) - { - StringOutputStream command; - command << "entitySetClass -class " << value.c_str(); - UndoableCommand undo(command.c_str()); - Scene_EntitySetClassname_Selected(value.c_str()); - } - else - { - Scene_EntitySetKeyValue_Selected_Undoable(key.c_str(), value.c_str()); - } -} - -void EntityInspector_clearKeyValue() -{ - // Get current selection text - StringOutputStream key(64); - key << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityKeyEntry)); - - if(strcmp(key.c_str(), "classname") != 0) - { - StringOutputStream command; - command << "entityDeleteKey -key " << key.c_str(); - UndoableCommand undo(command.c_str()); - Scene_EntitySetKeyValue_Selected(key.c_str(), ""); - } -} - -void EntityInspector_clearAllKeyValues() -{ - UndoableCommand undo("entityClear"); - - // remove all keys except classname - for(KeyValues::iterator i = g_selectedKeyValues.begin(); i != g_selectedKeyValues.end(); ++i) - { - if(strcmp((*i).first.c_str(), "classname") != 0) - { - Scene_EntitySetKeyValue_Selected((*i).first.c_str(), ""); - } - } -} - -// ============================================================================= -// callbacks - -static void EntityClassList_selection_changed(GtkTreeSelection* selection, gpointer data) -{ - GtkTreeModel* model; - GtkTreeIter selected; - if(gtk_tree_selection_get_selected(selection, &model, &selected)) - { - EntityClass* eclass; - gtk_tree_model_get(model, &selected, 1, &eclass, -1); - if(eclass != 0) - { - SetComment(eclass); - } - } -} - -static gint EntityClassList_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data) -{ - if (event->type == GDK_2BUTTON_PRESS) - { - EntityClassList_createEntity(); - return TRUE; - } - return FALSE; -} - -static gint EntityClassList_keypress(GtkWidget* widget, GdkEventKey* event, gpointer data) -{ - unsigned int code = gdk_keyval_to_upper (event->keyval); - - if (event->keyval == GDK_Return) - { - EntityClassList_createEntity(); - return TRUE; - } - - // select the entity that starts with the key pressed - if (code <= 'Z' && code >= 'A') - { - GtkTreeView* view = g_entityClassList; - GtkTreeModel* model; - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(view), &model, &iter) == FALSE - || gtk_tree_model_iter_next(model, &iter) == FALSE) - { - gtk_tree_model_get_iter_first(model, &iter); - } - - for(std::size_t count = gtk_tree_model_iter_n_children(model, 0); count > 0; --count) - { - char* text; - gtk_tree_model_get(model, &iter, 0, &text, -1); - - if (toupper (text[0]) == (int)code) - { - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); - if(GTK_WIDGET_REALIZED(view)) - { - gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0); - } - gtk_tree_path_free(path); - count = 1; - } - - g_free(text); - - if(gtk_tree_model_iter_next(model, &iter) == FALSE) - gtk_tree_model_get_iter_first(model, &iter); - } - - return TRUE; - } - return FALSE; -} - -static void EntityProperties_selection_changed(GtkTreeSelection* selection, gpointer data) -{ - // find out what type of entity we are trying to create - GtkTreeModel* model; - GtkTreeIter iter; - if(gtk_tree_selection_get_selected(selection, &model, &iter) == FALSE) - { - return; - } - - char* key; - char* val; - gtk_tree_model_get(model, &iter, 0, &key, 1, &val, -1); - - gtk_entry_set_text(g_entityKeyEntry, key); - gtk_entry_set_text(g_entityValueEntry, val); - - g_free(key); - g_free(val); -} - -static void SpawnflagCheck_toggled(GtkWidget *widget, gpointer data) -{ - EntityInspector_applySpawnflags(); -} - -static gint EntityEntry_keypress(GtkEntry* widget, GdkEventKey* event, gpointer data) -{ - if (event->keyval == GDK_Return) - { - if(widget == g_entityKeyEntry) - { - gtk_entry_set_text(g_entityValueEntry, ""); - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), GTK_WIDGET(g_entityValueEntry)); - } - else - { - EntityInspector_applyKeyValue(); - } - return TRUE; - } - if (event->keyval == GDK_Escape) - { - gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), NULL); - return TRUE; - } - - return FALSE; -} - -void EntityInspector_destroyWindow(GtkWidget* widget, gpointer data) -{ - g_entitysplit1_position = gtk_paned_get_position(GTK_PANED(g_entity_split1)); - g_entitysplit2_position = gtk_paned_get_position(GTK_PANED(g_entity_split2)); - - g_entityInspector_windowConstructed = false; - GlobalEntityAttributes_clear(); -} - -GtkWidget* EntityInspector_constructWindow(GtkWindow* toplevel) -{ - GtkWidget* vbox = gtk_vbox_new(FALSE, 2); - gtk_widget_show (vbox); - gtk_container_set_border_width(GTK_CONTAINER (vbox), 2); - - g_signal_connect(G_OBJECT(vbox), "destroy", G_CALLBACK(EntityInspector_destroyWindow), 0); - - { - GtkWidget* split1 = gtk_vpaned_new(); - gtk_box_pack_start(GTK_BOX(vbox), split1, TRUE, TRUE, 0); - gtk_widget_show (split1); - - g_entity_split1 = split1; - - { - GtkWidget* split2 = gtk_vpaned_new(); - gtk_paned_add1 (GTK_PANED (split1), split2); - gtk_widget_show (split2); - - g_entity_split2 = split2; - - { - // class list - GtkWidget* scr = gtk_scrolled_window_new (0, 0); - gtk_widget_show (scr); - gtk_paned_add1 (GTK_PANED (split2), scr); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); - - { - GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); - - GtkTreeView* view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(GTK_TREE_MODEL(store))); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view), FALSE); - gtk_tree_view_set_headers_visible(view, FALSE); - g_signal_connect(G_OBJECT(view), "button_press_event", G_CALLBACK(EntityClassList_button_press), 0); - g_signal_connect(G_OBJECT(view), "key_press_event", G_CALLBACK(EntityClassList_keypress), 0); - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Key", renderer, "text", 0, 0); - gtk_tree_view_append_column(view, column); - } - - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(view); - g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(EntityClassList_selection_changed), 0); - } - - gtk_widget_show(GTK_WIDGET(view)); - - gtk_container_add(GTK_CONTAINER(scr), GTK_WIDGET(view)); - - g_object_unref(G_OBJECT(store)); - g_entityClassList = view; - g_entlist_store = store; - } - } - - { - GtkWidget* scr = gtk_scrolled_window_new (0, 0); - gtk_widget_show (scr); - gtk_paned_add2 (GTK_PANED (split2), scr); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); - - { - GtkTextView* text = GTK_TEXT_VIEW(gtk_text_view_new()); - gtk_widget_set_size_request(GTK_WIDGET(text), 0, -1); // allow shrinking - gtk_text_view_set_wrap_mode(text, GTK_WRAP_WORD); - gtk_text_view_set_editable(text, FALSE); - gtk_widget_show(GTK_WIDGET(text)); - gtk_container_add(GTK_CONTAINER(scr), GTK_WIDGET(text)); - g_entityClassComment = text; - } - } - } - - { - GtkWidget* split2 = gtk_vpaned_new(); - gtk_paned_add2 (GTK_PANED (split1), split2); - gtk_widget_show(split2); - - { - GtkWidget* vbox2 = gtk_vbox_new (FALSE, 2); - gtk_widget_show (vbox2); - gtk_paned_pack1(GTK_PANED(split2), vbox2, FALSE, FALSE); - - { - // Spawnflags (4 colums wide max, or window gets too wide.) - GtkTable* table = GTK_TABLE(gtk_table_new(4, 4, FALSE)); - gtk_box_pack_start (GTK_BOX (vbox2), GTK_WIDGET(table), FALSE, TRUE, 0); - gtk_widget_show(GTK_WIDGET(table)); - - g_spawnflagsTable = table; - - for (int i = 0; i < MAX_FLAGS; i++) - { - GtkCheckButton* check = GTK_CHECK_BUTTON(gtk_check_button_new_with_label("")); - gtk_widget_ref(GTK_WIDGET(check)); - g_object_set_data(G_OBJECT(check), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(SpawnflagCheck_toggled), 0))); - g_entitySpawnflagsCheck[i] = check; - } - } - - { - // key/value list - GtkWidget* scr = gtk_scrolled_window_new (0, 0); - gtk_widget_show (scr); - gtk_box_pack_start (GTK_BOX (vbox2), scr, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); - - { - GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); - - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view), FALSE); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - } - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 1, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - } - - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); - g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(EntityProperties_selection_changed), 0); - } - - gtk_widget_show(view); - - gtk_container_add(GTK_CONTAINER (scr), view); - - g_object_unref(G_OBJECT(store)); - - g_entprops_store = store; - } - } - - { - // key/value entry - GtkTable* table = GTK_TABLE(gtk_table_new(2, 2, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(table), FALSE, TRUE, 0); - gtk_table_set_row_spacings(table, 3); - gtk_table_set_col_spacings(table, 5); - - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_events(GTK_WIDGET(entry), GDK_KEY_PRESS_MASK); - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(EntityEntry_keypress), 0); - g_entityKeyEntry = entry; - } - - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_events(GTK_WIDGET(entry), GDK_KEY_PRESS_MASK); - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(EntityEntry_keypress), 0); - g_entityValueEntry = entry; - } - - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Value")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Key")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - } - - { - GtkBox* hbox = GTK_BOX(gtk_hbox_new(TRUE, 4)); - gtk_widget_show(GTK_WIDGET(hbox)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(hbox), FALSE, TRUE, 0); - - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("Clear All")); - gtk_widget_show(GTK_WIDGET(button)); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(EntityInspector_clearAllKeyValues), 0); - gtk_box_pack_start(hbox, GTK_WIDGET(button), TRUE, TRUE, 0); - } - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("Delete Key")); - gtk_widget_show(GTK_WIDGET(button)); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(EntityInspector_clearKeyValue), 0); - gtk_box_pack_start(hbox, GTK_WIDGET(button), TRUE, TRUE, 0); - } - } - } - - { - GtkWidget* scr = gtk_scrolled_window_new(0, 0); - gtk_widget_show(scr); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - - GtkWidget* viewport = gtk_viewport_new(0, 0); - gtk_widget_show(viewport); - gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); - - g_attributeBox = GTK_VBOX(gtk_vbox_new(FALSE, 2)); - gtk_widget_show(GTK_WIDGET(g_attributeBox)); - - gtk_container_add(GTK_CONTAINER(viewport), GTK_WIDGET(g_attributeBox)); - gtk_container_add(GTK_CONTAINER(scr), viewport); - gtk_paned_pack2(GTK_PANED(split2), scr, FALSE, FALSE); - } - } - } - - - { - // show the sliders in any case - if(g_entitysplit2_position > 22) - { - gtk_paned_set_position (GTK_PANED(g_entity_split2), g_entitysplit2_position); - } else { - g_entitysplit2_position = 22; - gtk_paned_set_position (GTK_PANED(g_entity_split2), 22); - } - if((g_entitysplit1_position - g_entitysplit2_position) > 27) - { - gtk_paned_set_position (GTK_PANED(g_entity_split1), g_entitysplit1_position); - } else { - gtk_paned_set_position (GTK_PANED(g_entity_split1), g_entitysplit2_position + 27); - } - } - - g_entityInspector_windowConstructed = true; - EntityClassList_fill(); - - typedef FreeCaller1 EntityInspectorSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(EntityInspectorSelectionChangedCaller()); - GlobalEntityCreator().setKeyValueChangedFunc(EntityInspector_keyValueChanged); - - // hack - gtk_container_set_focus_chain(GTK_CONTAINER(vbox), NULL); - - return vbox; -} - -class EntityInspector : public ModuleObserver -{ - std::size_t m_unrealised; -public: - EntityInspector() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - if(g_entityInspector_windowConstructed) - { - //globalOutputStream() << "Entity Inspector: realise\n"; - EntityClassList_fill(); - } - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - if(g_entityInspector_windowConstructed) - { - //globalOutputStream() << "Entity Inspector: unrealise\n"; - EntityClassList_clear(); - } - } - } -}; - -EntityInspector g_EntityInspector; - -#include "preferencesystem.h" -#include "stringio.h" - -void EntityInspector_construct() -{ - GlobalEntityClassManager().attach(g_EntityInspector); - - GlobalPreferenceSystem().registerPreference("EntitySplit1", IntImportStringCaller(g_entitysplit1_position), IntExportStringCaller(g_entitysplit1_position)); - GlobalPreferenceSystem().registerPreference("EntitySplit2", IntImportStringCaller(g_entitysplit2_position), IntExportStringCaller(g_entitysplit2_position)); - -} - -void EntityInspector_destroy() -{ - GlobalEntityClassManager().detach(g_EntityInspector); -} - diff --git a/radiant/entityinspector.h b/radiant/entityinspector.h deleted file mode 100644 index 62a69ab6..00000000 --- a/radiant/entityinspector.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ENTITYINSPECTOR_H) -#define INCLUDED_ENTITYINSPECTOR_H - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -GtkWidget* EntityInspector_constructWindow(GtkWindow* parent); -void EntityInspector_construct(); -void EntityInspector_destroy(); - -#endif diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp deleted file mode 100644 index e6944a6d..00000000 --- a/radiant/entitylist.cpp +++ /dev/null @@ -1,430 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "entitylist.h" - -#include "iselection.h" - -#include -#include -#include -#include - -#include "string/string.h" -#include "scenelib.h" -#include "nameable.h" -#include "signal/isignal.h" -#include "generic/object.h" - -#include "gtkutil/widget.h" -#include "gtkutil/window.h" -#include "gtkutil/idledraw.h" -#include "gtkutil/accelerator.h" -#include "gtkutil/closure.h" - -#include "treemodel.h" - -void RedrawEntityList(); -typedef FreeCaller RedrawEntityListCaller; - -typedef struct _GtkTreeView GtkTreeView; - -class EntityList -{ -public: - enum EDirty - { - eDefault, - eSelection, - eInsertRemove, - }; - - EDirty m_dirty; - - IdleDraw m_idleDraw; - WindowPositionTracker m_positionTracker; - - GtkWindow* m_window; - GtkTreeView* m_tree_view; - GraphTreeModel* m_tree_model; - bool m_selection_disabled; - - EntityList() : - m_dirty(EntityList::eDefault), - m_idleDraw(RedrawEntityListCaller()), - m_window(0), - m_selection_disabled(false) - { - } - - bool visible() const - { - return GTK_WIDGET_VISIBLE(GTK_WIDGET(m_window)); - } -}; - -namespace -{ - EntityList* g_EntityList; - - inline EntityList& getEntityList() - { - ASSERT_NOTNULL(g_EntityList); - return *g_EntityList; - } -} - - -inline Nameable* Node_getNameable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -const char* node_get_name(scene::Node& node) -{ - Nameable* nameable = Node_getNameable(node); - return (nameable != 0) - ? nameable->name() - : "node"; -} - -template -inline void gtk_tree_model_get_pointer(GtkTreeModel* model, GtkTreeIter* iter, gint column, value_type** pointer) -{ - GValue value = GValue_default(); - gtk_tree_model_get_value(model, iter, column, &value); - *pointer = (value_type*)g_value_get_pointer(&value); -} - - - -void entitylist_treeviewcolumn_celldatafunc(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer data) -{ - scene::Node* node; - gtk_tree_model_get_pointer(model, iter, 0, &node); - scene::Instance* instance; - gtk_tree_model_get_pointer(model, iter, 1, &instance); - if(node != 0) - { - gtk_cell_renderer_set_fixed_size(renderer, -1, -1); - char* name = const_cast(node_get_name(*node)); - g_object_set(G_OBJECT(renderer), "text", name, "visible", TRUE, 0); - - //globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n"; - GtkStyle* style = gtk_widget_get_style(GTK_WIDGET(getEntityList().m_tree_view)); - if(instance->childSelected()) - { - g_object_set(G_OBJECT(renderer), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], 0); - } - else - { - g_object_set(G_OBJECT(renderer), "cell-background-gdk", &style->base[GTK_STATE_NORMAL], 0); - } - } - else - { - gtk_cell_renderer_set_fixed_size(renderer, -1, 0); - g_object_set(G_OBJECT(renderer), "text", "", "visible", FALSE, 0); - } -} - -static gboolean entitylist_tree_select(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data) -{ - GtkTreeIter iter; - gtk_tree_model_get_iter(model, &iter, path); - scene::Node* node; - gtk_tree_model_get_pointer(model, &iter, 0, &node); - scene::Instance* instance; - gtk_tree_model_get_pointer(model, &iter, 1, &instance); - Selectable* selectable = Instance_getSelectable(*instance); - - if(node == 0) - { - if(path_currently_selected != FALSE) - { - getEntityList().m_selection_disabled = true; - GlobalSelectionSystem().setSelectedAll(false); - getEntityList().m_selection_disabled = false; - } - } - else if(selectable != 0) - { - getEntityList().m_selection_disabled = true; - selectable->setSelected(path_currently_selected == FALSE); - getEntityList().m_selection_disabled = false; - return TRUE; - } - - return FALSE; -} - -static gboolean entitylist_tree_select_null(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data) -{ - return TRUE; -} - -void EntityList_ConnectSignals(GtkTreeView* view) -{ - GtkTreeSelection* select = gtk_tree_view_get_selection(view); - gtk_tree_selection_set_select_function(select, entitylist_tree_select, NULL, 0); -} - -void EntityList_DisconnectSignals(GtkTreeView* view) -{ - GtkTreeSelection* select = gtk_tree_view_get_selection(view); - gtk_tree_selection_set_select_function(select, entitylist_tree_select_null, 0, 0); -} - - - -gboolean treemodel_update_selection(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer data) -{ - GtkTreeView* view = reinterpret_cast(data); - - scene::Instance* instance; - gtk_tree_model_get_pointer(model, iter, 1, &instance); - Selectable* selectable = Instance_getSelectable(*instance); - - if(selectable != 0) - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(view); - if(selectable->isSelected()) - { - gtk_tree_selection_select_path(selection, path); - } - else - { - gtk_tree_selection_unselect_path(selection, path); - } - } - - return FALSE; -} - -void EntityList_UpdateSelection(GtkTreeModel* model, GtkTreeView* view) -{ - EntityList_DisconnectSignals(view); - gtk_tree_model_foreach(model, treemodel_update_selection, view); - EntityList_ConnectSignals(view); -} - - -void RedrawEntityList() -{ - switch(getEntityList().m_dirty) - { - case EntityList::eInsertRemove: - case EntityList::eSelection: - EntityList_UpdateSelection(GTK_TREE_MODEL(getEntityList().m_tree_model), getEntityList().m_tree_view); - default: - break; - } - getEntityList().m_dirty = EntityList::eDefault; -} - -void entitylist_queue_draw() -{ - getEntityList().m_idleDraw.queueDraw(); -} - -void EntityList_SelectionUpdate() -{ - if(getEntityList().m_selection_disabled) - return; - - if(getEntityList().m_dirty < EntityList::eSelection) - getEntityList().m_dirty = EntityList::eSelection; - entitylist_queue_draw(); -} - -void EntityList_SelectionChanged(const Selectable& selectable) -{ - EntityList_SelectionUpdate(); -} - -void entitylist_treeview_rowcollapsed(GtkTreeView* view, GtkTreeIter* iter, GtkTreePath* path, gpointer user_data) -{ -} - -void entitylist_treeview_row_expanded(GtkTreeView* view, GtkTreeIter* iter, GtkTreePath* path, gpointer user_data) -{ - EntityList_SelectionUpdate(); -} - - -void EntityList_SetShown(bool shown) -{ - widget_set_visible(GTK_WIDGET(getEntityList().m_window), shown); -} - -void EntityList_toggleShown() -{ - EntityList_SetShown(!getEntityList().visible()); -} - -gint graph_tree_model_compare_name(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) -{ - scene::Node* first; - gtk_tree_model_get(model, a, 0, (gpointer*)&first, -1); - scene::Node* second; - gtk_tree_model_get(model, b, 0, (gpointer*)&second, -1); - int result = 0; - if(first != 0 && second != 0) - { - result = string_compare(node_get_name(*first), node_get_name(*second)); - } - if(result == 0) - { - return (first < second) ? -1 : (second < first) ? 1 : 0; - } - return result; -} - -extern GraphTreeModel* scene_graph_get_tree_model(); -void AttachEntityTreeModel() -{ - getEntityList().m_tree_model = scene_graph_get_tree_model(); - - gtk_tree_view_set_model(getEntityList().m_tree_view, GTK_TREE_MODEL(getEntityList().m_tree_model)); -} - -void DetachEntityTreeModel() -{ - getEntityList().m_tree_model = 0; - - gtk_tree_view_set_model(getEntityList().m_tree_view, 0); -} - -void EntityList_constructWindow(GtkWindow* main_window) -{ - ASSERT_MESSAGE(getEntityList().m_window == 0, "error"); - - GtkWindow* window = create_persistent_floating_window("Entity List", main_window); - - gtk_window_add_accel_group(window, global_accel); - - getEntityList().m_positionTracker.connect(window); - - - getEntityList().m_window = window; - - { - GtkScrolledWindow* scr = create_scrolled_window(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(scr)); - - { - GtkWidget* view = gtk_tree_view_new(); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new(); - gtk_tree_view_column_pack_start(column, renderer, TRUE); - gtk_tree_view_column_set_cell_data_func(column, renderer, entitylist_treeviewcolumn_celldatafunc, 0, 0); - - GtkTreeSelection* select = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); - gtk_tree_selection_set_mode(select, GTK_SELECTION_MULTIPLE); - - g_signal_connect(G_OBJECT(view), "row_expanded", G_CALLBACK(entitylist_treeview_row_expanded), 0); - g_signal_connect(G_OBJECT(view), "row_collapsed", G_CALLBACK(entitylist_treeview_rowcollapsed), 0); - - gtk_tree_view_append_column (GTK_TREE_VIEW (view), column); - - gtk_widget_show(view); - gtk_container_add (GTK_CONTAINER(scr), view); - getEntityList().m_tree_view = GTK_TREE_VIEW(view); - } - } - - EntityList_ConnectSignals(getEntityList().m_tree_view); - AttachEntityTreeModel(); -} - -void EntityList_destroyWindow() -{ - DetachEntityTreeModel(); - EntityList_DisconnectSignals(getEntityList().m_tree_view); - destroy_floating_window(getEntityList().m_window); -} - -#include "preferencesystem.h" - -#include "iselection.h" - -namespace -{ - scene::Node* nullNode = 0; -} - -class NullSelectedInstance : public scene::Instance, public Selectable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceStaticCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - -public: - typedef LazyStatic StaticTypeCasts; - - NullSelectedInstance() : Instance(scene::Path(makeReference(*nullNode)), 0, this, StaticTypeCasts::instance().get()) - { - } - - void setSelected(bool select) - { - ERROR_MESSAGE("error"); - } - bool isSelected() const - { - return true; - } -}; - -typedef LazyStatic StaticNullSelectedInstance; - - -void EntityList_Construct() -{ - graph_tree_model_insert(scene_graph_get_tree_model(), StaticNullSelectedInstance::instance()); - - g_EntityList = new EntityList; - - getEntityList().m_positionTracker.setPosition(c_default_window_pos); - - GlobalPreferenceSystem().registerPreference("EntityInfoDlg", WindowPositionTrackerImportStringCaller(getEntityList().m_positionTracker), WindowPositionTrackerExportStringCaller(getEntityList().m_positionTracker)); - - typedef FreeCaller1 EntityListSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(EntityListSelectionChangedCaller()); -} -void EntityList_Destroy() -{ - delete g_EntityList; - - graph_tree_model_erase(scene_graph_get_tree_model(), StaticNullSelectedInstance::instance()); -} diff --git a/radiant/entitylist.h b/radiant/entitylist.h deleted file mode 100644 index cdad18db..00000000 --- a/radiant/entitylist.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ENTITYLIST_H) -#define INCLUDED_ENTITYLIST_H - -void EntityList_Construct(); -void EntityList_Destroy(); - -typedef struct _GtkWindow GtkWindow; -void EntityList_constructWindow(GtkWindow* main_window); -void EntityList_destroyWindow(); -void EntityList_toggleShown(); - -#endif diff --git a/radiant/environment.cpp b/radiant/environment.cpp deleted file mode 100644 index a3bfd43f..00000000 --- a/radiant/environment.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "environment.h" - -#include "stream/textstream.h" -#include "string/string.h" -#include "stream/stringstream.h" -#include "debugging/debugging.h" -#include "os/path.h" -#include "cmdlib.h" - - -int g_argc; -char** g_argv; - -void args_init(int argc, char* argv[]) -{ - int i, j, k; - - for (i = 1; i < argc; i++) - { - for (k = i; k < argc; k++) - if (argv[k] != 0) - break; - - if (k > i) - { - k -= i; - for (j = i + k; j < argc; j++) - argv[j-k] = argv[j]; - argc -= k; - } - } - - g_argc = argc; - g_argv = argv; -} - -namespace -{ - CopiedString home_path; - CopiedString app_path; -} - -const char* environment_get_home_path() -{ - return home_path.c_str(); -} - -const char* environment_get_app_path() -{ - return app_path.c_str(); -} - - -#if defined(POSIX) - -#include -#include -#include - -#include - -const char* LINK_NAME = -#if defined (__linux__) - "/proc/self/exe" -#else // FreeBSD and OSX - "/proc/curproc/file" -#endif -; - -/// brief Returns the filename of the executable belonging to the current process, or 0 if not found. -char* getexename(char *buf) -{ - /* Now read the symbolic link */ - int ret = readlink(LINK_NAME, buf, PATH_MAX); - - if(ret == -1) - { - globalOutputStream() << "getexename: falling back to argv[0]: " << makeQuoted(g_argv[0]); - const char* path = realpath(g_argv[0], buf); - if(path == 0) - { - /* In case of an error, leave the handling up to the caller */ - return ""; - } - } - - /* Ensure proper NUL termination */ - buf[ret] = 0; - - /* delete the program name */ - *(strrchr(buf, '/')) = '\0'; - - // NOTE: we build app path with a trailing '/' - // it's a general convention in Radiant to have the slash at the end of directories - if (buf[strlen(buf)-1] != '/') - { - strcat(buf, "/"); - } - - return buf; -} - -void environment_init(int argc, char* argv[]) -{ - // Give away unnecessary root privileges. - // Important: must be done before calling gtk_init(). - char *loginname; - struct passwd *pw; - seteuid(getuid()); - if (geteuid() == 0 && (loginname = getlogin()) != 0 && - (pw = getpwnam(loginname)) != 0) - setuid(pw->pw_uid); - - args_init(argc, argv); - - { - StringOutputStream home(256); - home << DirectoryCleaned(g_get_home_dir()) << ".radiant/"; - Q_mkdir(home.c_str()); - home_path = home.c_str(); - } - { - char real[PATH_MAX]; - app_path = getexename(real); - ASSERT_MESSAGE(!string_empty(app_path.c_str()), "failed to deduce app path"); - } -} - -#elif defined(WIN32) - -#include -#include - -void environment_init(int argc, char* argv[]) -{ - args_init(argc, argv); - - { - char appdata[MAX_PATH+1]; - SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, appdata); - - StringOutputStream home(256); - if(string_empty(appdata)) - { - ERROR_MESSAGE("Application Data folder not available.\n" - "Please install shfolder redistributable package.\n" - "Radiant will use C:\\ for user preferences.\n"); - home << "C:"; - } - else - { - home << PathCleaned(appdata); - } - home << "/RadiantSettings/"; - Q_mkdir(home.c_str()); - home_path = home.c_str(); - } - { - // get path to the editor - char filename[MAX_PATH+1]; - GetModuleFileName(0, filename, MAX_PATH); - char* last_separator = strrchr(filename, '\\'); - if(last_separator != 0) - { - *(last_separator+1) = '\0'; - } - else - { - filename[0] = '\0'; - } - StringOutputStream app(256); - app << PathCleaned(filename); - app_path = app.c_str(); - } -} - -#else -#error "unsupported platform" -#endif diff --git a/radiant/environment.h b/radiant/environment.h deleted file mode 100644 index 7667fbfe..00000000 --- a/radiant/environment.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ENVIRONMENT_H) -#define INCLUDED_ENVIRONMENT_H - -void environment_init(int argc, char* argv[]); -const char* environment_get_home_path(); -const char* environment_get_app_path(); - -#endif diff --git a/radiant/error.cpp b/radiant/error.cpp index 0ff75d1c..3d2a97c2 100644 --- a/radiant/error.cpp +++ b/radiant/error.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,26 +19,13 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "error.h" - -#include "debugging/debugging.h" -#include "igl.h" - -#include "gtkutil/messagebox.h" -#include "console.h" -#include "preferences.h" - - -#ifdef WIN32 #define UNICODE -#include -#else -#include +#include "stdafx.h" + +#if defined (__linux__) || defined (__APPLE__) #include #endif - - /* ================= Error @@ -64,7 +51,16 @@ void Error (const char *error, ...) strcat( text, "\n" ); -#ifdef WIN32 +#if defined (__linux__) || defined (__APPLE__) + if (errno != 0) + { + strcat( text, "errno: " ); + strcat( text, strerror (errno)); + strcat( text, "\n"); + } +#endif + +#ifdef _WIN32 if (GetLastError() != 0) { LPVOID lpMsgBuf; @@ -72,12 +68,12 @@ void Error (const char *error, ...) FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - 0, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, - 0 + NULL ); strcat( text, "GetLastError: " ); /* @@ -91,7 +87,7 @@ void Error (const char *error, ...) scan = next; text[strlen(text)+1] = '\0'; if ((scan[0] >= 0) && (scan[0] <= 127)) - text[strlen(text)] = char(scan[0]); + text[strlen(text)] = scan[0]; else text[strlen(text)] = '?'; next = CharNext(scan); @@ -99,40 +95,57 @@ void Error (const char *error, ...) strcat( text, "\n"); LocalFree( lpMsgBuf ); } -#else - if (errno != 0) - { - strcat( text, "errno: " ); - strcat( text, strerror (errno)); - strcat( text, "\n"); - } #endif - -#if 0 // we need to have a current context to call glError() - if (g_glwindow_globals.d_glBase != 0) + if (g_qeglobals_gui.d_glBase != NULL) { - // glGetError .. can record several errors, clears after calling + // qglGetError .. can record several errors, clears after calling //++timo TODO: be able to deal with several errors if necessary, for now I'm just warning about pending error messages // NOTE: forget that, most boards don't seem to follow the OpenGL standard - GLenum iGLError = glGetError(); + GLenum iGLError = qglGetError(); if (iGLError != GL_NO_ERROR) { // use our own gluErrorString - strcat( text, "gluErrorString: " ); - strcat( text, (char*)gluErrorString( iGLError ) ); + strcat( text, "qgluErrorString: " ); + strcat( text, (char*)qgluErrorString( iGLError ) ); strcat( text, "\n" ); } } -#endif - strcat (text, "An unrecoverable error has occured.\n"); + strcat (text, "An unrecoverable error has occured.\n" + "Would you like to edit Preferences before exiting Radiant?"); - ERROR_MESSAGE(text); + Sys_Printf(text); + + if (gtk_MessageBox(NULL, text, "Error", MB_YESNO) == IDYES) + { + Sys_Printf("Doing prefs..\n"); + g_PrefsDlg.LoadPrefs (); + g_PrefsDlg.DoModal(); + } + + QGL_Shutdown(); + + g_PrefsDlg.Destroy (); + g_dlgSurface.Destroy (); + g_dlgFind.Destroy (); // force close logging if necessary - Sys_LogFile(false); + g_PrefsDlg.mGamesDialog.m_bLogConsole = false; + Sys_LogFile(); _exit (1); } + +void WINAPI Error (char *error, ...) +{ + va_list argptr; + char text[1024]; + + va_start (argptr,error); + vsprintf (text, error,argptr); + va_end (argptr); + + Error((const char *)text); +} diff --git a/radiant/error.h b/radiant/error.h deleted file mode 100644 index b114640a..00000000 --- a/radiant/error.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_ERROR_H) -#define INCLUDED_ERROR_H - -void Error(const char *error, ...); - -#endif diff --git a/radiant/feedback.cpp b/radiant/feedback.cpp index 9a847ce2..80c64edf 100644 --- a/radiant/feedback.cpp +++ b/radiant/feedback.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,35 +25,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // classes used for describing geometry information from q3map feedback // +#include "stdafx.h" + #include "feedback.h" - -#include "debugging/debugging.h" - -#include "igl.h" -#include "iselection.h" - -#include -#include -#include -#include -#include -#include - -#include "map.h" -#include "dialog.h" -#include "mainframe.h" - +#include "glib.h" +#include CDbgDlg g_DbgDlg; -void Feedback_draw2D(VIEWTYPE viewType) +void CSelectMsg::saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) { - g_DbgDlg.draw2D(viewType); -} - -void CSelectMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) -{ - if(string_equal(reinterpret_cast(name), "select")) + if (strcmp ((char *)name, "select")==0) { // read the message ESelectState = SELECT_MESSAGE; @@ -61,46 +43,45 @@ void CSelectMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const else { // read the brush - ASSERT_MESSAGE(string_equal(reinterpret_cast(name), "brush"), "FEEDBACK PARSE ERROR"); - ASSERT_MESSAGE(ESelectState == SELECT_MESSAGE, "FEEDBACK PARSE ERROR"); + assert (strcmp ((char *)name, "brush")==0); + assert (ESelectState == SELECT_MESSAGE); ESelectState = SELECT_BRUSH; - globalOutputStream() << message.c_str() << '\n'; } } -void CSelectMsg::saxEndElement(message_info_t *ctx, const xmlChar *name) +void CSelectMsg::saxEndElement (message_info_t *ctx, const xmlChar *name) { - if(string_equal(reinterpret_cast(name), "select")) + if (strcmp ((char *)name, "select")==0) { + ctx->bGeometry = false; } } -void CSelectMsg::saxCharacters(message_info_t *ctx, const xmlChar *ch, int len) +void CSelectMsg::saxCharacters (message_info_t *ctx, const xmlChar *ch, int len) { - if(ESelectState == SELECT_MESSAGE) + if (ESelectState == SELECT_MESSAGE) { - message.write(reinterpret_cast(ch), len); + message = g_string_sized_new (len+1); + memcpy (message->str, ch, len); + message->str[len]='\0'; + Sys_Printf ("%s\n", message->str); } else { - brush.write(reinterpret_cast(ch), len); + assert (ESelectState == SELECT_BRUSH); + sscanf ((char *)ch, "%i %i", &entitynum, &brushnum); } } -IGL2DWindow* CSelectMsg::Highlight() +void CSelectMsg::Highlight () { - GlobalSelectionSystem().setSelectedAll(false); - int entitynum, brushnum; - if(sscanf(reinterpret_cast(brush.c_str()), "%i %i", &entitynum, &brushnum) == 2) - { - SelectBrush (entitynum, brushnum); - } - return 0; + Select_Deselect (); + SelectBrush (entitynum, brushnum); } -void CPointMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) +void CPointMsg::saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) { - if(string_equal(reinterpret_cast(name), "pointmsg")) + if (strcmp ((char *)name, "pointmsg")==0) { // read the message EPointState = POINT_MESSAGE; @@ -108,67 +89,75 @@ void CPointMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const else { // read the brush - ASSERT_MESSAGE(string_equal(reinterpret_cast(name), "point"), "FEEDBACK PARSE ERROR"); - ASSERT_MESSAGE(EPointState == POINT_MESSAGE, "FEEDBACK PARSE ERROR"); + assert (strcmp ((char *)name, "point")==0); + assert (EPointState == POINT_MESSAGE); EPointState = POINT_POINT; - globalOutputStream() << message.c_str() << '\n'; } } void CPointMsg::saxEndElement (message_info_t *ctx, const xmlChar *name) { - if(string_equal(reinterpret_cast(name), "pointmsg")) + if (strcmp ((char *)name, "pointmsg")==0) { - } - else if(string_equal(reinterpret_cast(name), "point")) - { - sscanf(point.c_str(), "%g %g %g", &(pt[0]), &(pt[1]), &(pt[2])); - point.clear(); + ctx->bGeometry = false; } } void CPointMsg::saxCharacters (message_info_t *ctx, const xmlChar *ch, int len) { - if(EPointState == POINT_MESSAGE) + if (EPointState == POINT_MESSAGE) { - message.write(reinterpret_cast(ch), len); + message = g_string_sized_new (len+1); + memcpy (message->str, ch, len); + message->str[len]='\0'; + Sys_Printf ("%s\n", message->str); } else { - ASSERT_MESSAGE(EPointState == POINT_POINT, "FEEDBACK PARSE ERROR"); - point.write(reinterpret_cast(ch), len); + assert (EPointState == POINT_POINT); + sscanf ((char *)ch, "%g %g %g", &(pt[0]), &(pt[1]), &(pt[2])); } } -IGL2DWindow* CPointMsg::Highlight() +void CPointMsg::Highlight () { - return this; + // use the entity API to push a point + // the API requires a ref count, we do it manually for the current instance + if (refCount == 0) + { + refCount++; + QERApp_HookGL2DWindow (this); + } } -void CPointMsg::DropHighlight() +void CPointMsg::DropHighlight () { + assert (refCount > 0); + QERApp_UnHookGL2DWindow (this); + // do a refCount-- locally (see Highlight) + refCount--; } void CPointMsg::Draw2D( VIEWTYPE vt ) { int nDim1 = (vt == YZ) ? 1 : 0; int nDim2 = (vt == XY) ? 1 : 2; - glPointSize(4); - glColor3f(1.0f,0.0f,0.0f); - glBegin (GL_POINTS); - glVertex2f (pt[nDim1], pt[nDim2]); - glEnd(); - glBegin (GL_LINE_LOOP); - glVertex2f (pt[nDim1]-8, pt[nDim2]-8); - glVertex2f (pt[nDim1]+8, pt[nDim2]-8); - glVertex2f (pt[nDim1]+8, pt[nDim2]+8); - glVertex2f (pt[nDim1]-8, pt[nDim2]+8); - glEnd(); + qglPointSize(4); + qglColor3f(1.0f,0.0f,0.0f); + qglBegin (GL_POINTS); + qglVertex2f (pt[nDim1], pt[nDim2]); + qglEnd(); + qglBegin (GL_LINE_LOOP); + qglVertex2f (pt[nDim1]-8, pt[nDim2]-8); + qglVertex2f (pt[nDim1]+8, pt[nDim2]-8); + qglVertex2f (pt[nDim1]+8, pt[nDim2]+8); + qglVertex2f (pt[nDim1]-8, pt[nDim2]+8); + qglEnd(); } -void CWindingMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) +void CWindingMsg::saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) { - if(string_equal(reinterpret_cast(name), "windingmsg")) + if (strcmp ((char *)name, "windingmsg")==0) { // read the message EPointState = WINDING_MESSAGE; @@ -176,28 +165,44 @@ void CWindingMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, cons else { // read the brush - ASSERT_MESSAGE(string_equal(reinterpret_cast(name), "winding"), "FEEDBACK PARSE ERROR"); - ASSERT_MESSAGE(EPointState == WINDING_MESSAGE, "FEEDBACK PARSE ERROR"); + assert (strcmp ((char *)name, "winding")==0); + assert (EPointState == WINDING_MESSAGE); EPointState = WINDING_WINDING; - globalOutputStream() << message.c_str() << '\n'; } } -void CWindingMsg::saxEndElement(message_info_t *ctx, const xmlChar *name) +void CWindingMsg::saxEndElement (message_info_t *ctx, const xmlChar *name) { - if(string_equal(reinterpret_cast(name), "windingmsg")) + if (strcmp ((char *)name, "windingmsg")==0) { + ctx->bGeometry = false; } - else if(string_equal(reinterpret_cast(name), "winding")) - { - const char* c = winding.c_str(); - sscanf(c, "%i ", &numpoints); +} - int i = 0; - for(; i < numpoints; i++) +void CWindingMsg::saxCharacters (message_info_t *ctx, const xmlChar *ch, int len) +{ + if (EPointState == WINDING_MESSAGE) + { + message = g_string_sized_new (len+1); + memcpy (message->str, ch, len); + message->str[len]='\0'; + Sys_Printf ("%s\n", message->str); + } + else + { + char* c; + int i; + + assert (EPointState == WINDING_WINDING); + + + c = (char*)ch; + sscanf (c, "%i ", &numpoints); + + for(i = 0; i < numpoints; i++) { - c = strchr(c + 1, '('); - if(c) // even if we are given the number of points when the cycle begins .. don't trust it too much + c = strchr(++c, '('); + if (c) // even if we are given the number of points when the cycle begins .. don't trust it too much sscanf(c, "(%g %g %g)", &wt[i][0], &wt[i][1], &wt[i][2]); else break; @@ -206,26 +211,23 @@ void CWindingMsg::saxEndElement(message_info_t *ctx, const xmlChar *name) } } -void CWindingMsg::saxCharacters(message_info_t *ctx, const xmlChar *ch, int len) +void CWindingMsg::Highlight () { - if(EPointState == WINDING_MESSAGE) + // use the entity API to push a point + // the API requires a ref count, we do it manually for the current instance + if (refCount == 0) { - message.write(reinterpret_cast(ch), len); - } - else - { - ASSERT_MESSAGE(EPointState == WINDING_WINDING, "FEEDBACK PARSE ERROR"); - winding.write(reinterpret_cast(ch), len); + refCount++; + QERApp_HookGL2DWindow (this); } } -IGL2DWindow* CWindingMsg::Highlight() -{ - return this; -} - -void CWindingMsg::DropHighlight() +void CWindingMsg::DropHighlight () { + assert (refCount > 0); + QERApp_UnHookGL2DWindow (this); + // do a refCount-- locally (see Highlight) + refCount--; } void CWindingMsg::Draw2D( VIEWTYPE vt ) @@ -234,24 +236,24 @@ void CWindingMsg::Draw2D( VIEWTYPE vt ) int nDim1 = (vt == YZ) ? 1 : 0; int nDim2 = (vt == XY) ? 1 : 2; - glColor3f(1.0f,0.f,0.0f); + qglColor3f(1.0f,0.f,0.0f); - glPointSize(4); - glBegin (GL_POINTS); + qglPointSize(4); + qglBegin (GL_POINTS); for(i = 0; i < numpoints; i++) - glVertex2f (wt[i][nDim1], wt[i][nDim2]); - glEnd(); - glPointSize(1); + qglVertex2f (wt[i][nDim1], wt[i][nDim2]); + qglEnd(); + qglPointSize(1); - glEnable (GL_BLEND); - glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(0.133f,0.4f,1.0f,0.5f); - glBegin (GL_POLYGON); + qglEnable (GL_BLEND); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglColor4f(0.133f,0.4f,1.0f,0.5f); + qglBegin (GL_POLYGON); for(i = 0; i < numpoints; i++) - glVertex2f (wt[i][nDim1], wt[i][nDim2]); - glEnd(); - glDisable (GL_BLEND); + qglVertex2f (wt[i][nDim1], wt[i][nDim2]); + qglEnd(); + qglDisable (GL_BLEND); } // triggered when the user selects an entry in the feedback box @@ -271,73 +273,75 @@ static void feedback_selection_changed(GtkTreeSelection* selection, gpointer dat void CDbgDlg::DropHighlight() { - if(m_pHighlight != 0) + if (m_pHighlight) { m_pHighlight->DropHighlight(); - m_pHighlight = 0; - m_pDraw2D = 0; + m_pHighlight = NULL; } } void CDbgDlg::SetHighlight(gint row) { ISAXHandler *h = GetElement(row); - if(h != NULL) + if (h != NULL) { - m_pDraw2D = h->Highlight(); + h->Highlight(); m_pHighlight = h; } } -ISAXHandler *CDbgDlg::GetElement (std::size_t row) -{ - return static_cast(g_ptr_array_index(m_pFeedbackElements, gint(row))); +ISAXHandler *CDbgDlg::GetElement( gint row ) { + return static_cast( g_ptr_array_index( m_pFeedbackElements, row ) ); } -void CDbgDlg::Init() -{ - DropHighlight(); - - // free all the ISAXHandler*, clean it - while (m_pFeedbackElements->len) - { - static_cast(g_ptr_array_index (m_pFeedbackElements, 0))->Release(); - g_ptr_array_remove_index (m_pFeedbackElements, 0); - } - - if(m_clist != NULL) - gtk_list_store_clear (m_clist); +void CDbgDlg::ClearFeedbackArray() { + // free all the ISAXHandler*, clean it + while ( m_pFeedbackElements->len ) { + // some ISAXHandler are static and passed around but should never be deleted + ISAXHandler *handler = static_cast< ISAXHandler * >( g_ptr_array_index( m_pFeedbackElements, 0 ) ); + if ( handler->ShouldDelete() ) { + delete handler; + } + g_ptr_array_remove_index( m_pFeedbackElements, 0 ); + } } -void CDbgDlg::Push (ISAXHandler *pHandler) -{ - // push in the list - g_ptr_array_add (m_pFeedbackElements, (void *)pHandler); +void CDbgDlg::Init() { + DropHighlight(); - if(GetWidget() == 0) - { - Create(); - } + ClearFeedbackArray(); - // put stuff in the list - gtk_list_store_clear (m_clist); - for(std::size_t i = 0; i < static_cast(m_pFeedbackElements->len); ++i) - { - GtkTreeIter iter; - gtk_list_store_append(m_clist, &iter); - gtk_list_store_set(m_clist, &iter, 0, GetElement(i)->getName(), -1); - } - - ShowDlg(); + if ( m_clist != NULL ) { + gtk_list_store_clear( m_clist ); + } } -GtkWindow* CDbgDlg::BuildDialog() +void CDbgDlg::Push( ISAXHandler *pHandler ) { + // push in the list + g_ptr_array_add( m_pFeedbackElements, (void *)pHandler ); + + if ( m_pWidget == NULL ) { + Create(); + } + // put stuff in the list + gtk_list_store_clear( m_clist ); + unsigned int i; + for ( i = 0; i < m_pFeedbackElements->len; i++ ) { + GtkTreeIter iter; + gtk_list_store_append( m_clist, &iter ); + gtk_list_store_set( m_clist, &iter, 0, GetElement(i)->getName(), -1 ); + } + + ShowDlg(); +} + +void CDbgDlg::BuildDialog () { - GtkWindow* window = create_floating_window("Q3Map debug window", MainFrame_getWindow()); + gtk_window_set_title (GTK_WINDOW (m_pWidget), "Q3Map debug window"); GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scr); - gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (scr)); + gtk_container_add (GTK_CONTAINER (m_pWidget), GTK_WIDGET (scr)); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); @@ -367,6 +371,4 @@ GtkWindow* CDbgDlg::BuildDialog() m_clist = store; } - - return window; } diff --git a/radiant/feedback.h b/radiant/feedback.h index 4d199bd4..fa5fcdc4 100644 --- a/radiant/feedback.h +++ b/radiant/feedback.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -28,42 +28,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef __Q3MAP_FEEDBACK__ #define __Q3MAP_FEEDBACK__ -#include "math/vector.h" -#include "stream/stringstream.h" -#include -#include "xmlstuff.h" -#include "dialog.h" -#include "xywindow.h" - -// we use these classes to let plugins draw inside the Radiant windows -// 2D window like YZ XZ XY -class IGL2DWindow -{ -public: - // Increment the number of references to this object - virtual void IncRef() = 0; - // Decrement the reference count - virtual void DecRef() = 0; - virtual void Draw2D( VIEWTYPE vt ) = 0; -}; - -// 3D window -class IGL3DWindow -{ -public: - // Increment the number of references to this object - virtual void IncRef() = 0; - // Decrement the reference count - virtual void DecRef() = 0; - virtual void Draw3D() = 0; -}; +#include "libxml/parser.h" // a select message with a brush/entity select information class CSelectMsg : public ISAXHandler { enum { SELECT_MESSAGE, SELECT_BRUSH } ESelectState; - StringOutputStream message; - StringOutputStream brush; + GString *message; + int entitynum, brushnum; public: CSelectMsg() { ESelectState = SELECT_MESSAGE; } // SAX interface @@ -71,116 +43,83 @@ public: void saxEndElement (message_info_t *ctx, const xmlChar *name); void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len); // for use in the dialog window - const char* getName() { return message.c_str(); } - IGL2DWindow* Highlight(); + char *getName() { return message->str; } + void Highlight(); void DropHighlight() { } }; class CPointMsg : public ISAXHandler, public IGL2DWindow { enum { POINT_MESSAGE, POINT_POINT } EPointState; - StringOutputStream message; - StringOutputStream point; - Vector3 pt; + GString *message; + vec3_t pt; int refCount; public: CPointMsg() { EPointState = POINT_MESSAGE; refCount = 0; } // SAX interface - void Release() - { - delete this; - } void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs); void saxEndElement (message_info_t *ctx, const xmlChar *name); void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len); // for use in the dialog window - const char* getName() { return message.c_str(); } - IGL2DWindow* Highlight(); + char *getName() { return message->str; } + void Highlight(); void DropHighlight(); // IGL2DWindow interface -------------------------------- // Increment the number of references to this object - void IncRef() { refCount++; } + void IncRef () { refCount++; } // Decrement the reference count - void DecRef() { refCount--; if (refCount <= 0) delete this; } + void DecRef () { refCount--; if (refCount <= 0) delete this; } void Draw2D( VIEWTYPE vt ); }; class CWindingMsg : public ISAXHandler, public IGL2DWindow { enum { WINDING_MESSAGE, WINDING_WINDING } EPointState; - StringOutputStream message; - StringOutputStream winding; - Vector3 wt[256]; + GString *message; + vec3_t wt[256]; int numpoints; int refCount; public: CWindingMsg() { EPointState = WINDING_MESSAGE; refCount = 0; numpoints = 0; } // SAX interface - void Release() - { - delete this; - } void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs); void saxEndElement (message_info_t *ctx, const xmlChar *name); void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len); // for use in the dialog window - const char* getName() { return message.c_str(); } - IGL2DWindow* Highlight(); + char *getName() { return message->str; } + void Highlight(); void DropHighlight(); // IGL2DWindow interface -------------------------------- // Increment the number of references to this object - void IncRef() { refCount++; } + void IncRef () { refCount++; } // Decrement the reference count - void DecRef() { refCount--; if (refCount <= 0) delete this; } + void DecRef () { refCount--; if (refCount <= 0) delete this; } void Draw2D( VIEWTYPE vt ); }; -typedef struct _GtkListStore GtkListStore; - class CDbgDlg : public Dialog { GPtrArray *m_pFeedbackElements; // the list widget we use in the dialog GtkListStore* m_clist; ISAXHandler *m_pHighlight; - IGL2DWindow* m_pDraw2D; public: - CDbgDlg() - { - m_pFeedbackElements = g_ptr_array_new(); - m_pHighlight = NULL; - m_pDraw2D = NULL; - } + CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; } + virtual ~CDbgDlg() { ClearFeedbackArray(); } // refresh items - void Push (ISAXHandler *); + void Push( ISAXHandler * ); // clean the debug window, release all ISAXHanlders we have - void Init(); - ISAXHandler *GetElement(std::size_t row); - void SetHighlight(gint row); - void DropHighlight(); - void draw2D(VIEWTYPE viewType) - { - if(m_pDraw2D != 0) - { - m_pDraw2D->Draw2D(viewType); - } - } - void destroyWindow() - { - if(GetWidget() != 0) - { - Destroy(); - } - } -// void HideDlg(); + void Init(); + ISAXHandler *GetElement(gint row); + void SetHighlight(gint row); + void DropHighlight(); protected: - GtkWindow* BuildDialog(); + void BuildDialog(); + void ClearFeedbackArray(); }; extern CDbgDlg g_DbgDlg; -void Feedback_draw2D(VIEWTYPE viewType); - #endif diff --git a/libs/profile/file.cpp b/radiant/file.cpp similarity index 77% rename from libs/profile/file.cpp rename to radiant/file.cpp index 19756e8e..5d051ca1 100644 --- a/libs/profile/file.cpp +++ b/radiant/file.cpp @@ -35,12 +35,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "file.h" +#include "stdafx.h" +#include #include #include #include -#include + + +IDataStream::IDataStream() +{ } + +IDataStream::~IDataStream() +{ } ///////////////////////////////////////////////////////////////////////////// // File construction/destruction @@ -55,7 +62,7 @@ MemStream::MemStream() m_bAutoDelete = true; } -MemStream::MemStream(size_type nLen) +MemStream::MemStream(unsigned long nLen) { m_nGrowBytes = 1024; m_nPosition = 0; @@ -93,7 +100,7 @@ FileStream::~FileStream() ///////////////////////////////////////////////////////////////////////////// // File operations -char* MemStream::ReadString(char* pBuf, size_type nMax) +char* MemStream::ReadString(char* pBuf, unsigned long nMax) { int nRead = 0; unsigned char ch; @@ -120,34 +127,34 @@ char* MemStream::ReadString(char* pBuf, size_type nMax) return pBuf; } -char* FileStream::ReadString(char* pBuf, size_type nMax) +char* FileStream::ReadString(char* pBuf, unsigned long nMax) { - return fgets(pBuf, static_cast(nMax), m_hFile); + return fgets(pBuf, nMax, m_hFile); } -MemStream::size_type MemStream::read(byte_type* buffer, size_type length) +unsigned long MemStream::Read(void* pBuf, unsigned long nCount) { - if (length == 0) + if (nCount == 0) return 0; if (m_nPosition > m_nFileSize) return 0; - size_type nRead; - if (m_nPosition + length > m_nFileSize) - nRead = m_nFileSize - m_nPosition; + unsigned long nRead; + if (m_nPosition + nCount > m_nFileSize) + nRead = (unsigned long)(m_nFileSize - m_nPosition); else - nRead = length; + nRead = nCount; - memcpy((unsigned char*)buffer, (unsigned char*)m_pBuffer + m_nPosition, nRead); + memcpy((unsigned char*)pBuf, (unsigned char*)m_pBuffer + m_nPosition, nRead); m_nPosition += nRead; return nRead; } -FileStream::size_type FileStream::read(byte_type* buffer, size_type length) +unsigned long FileStream::Read(void* pBuf, unsigned long nCount) { - return fread(buffer, 1, length, m_hFile); + return fread(pBuf, 1, nCount, m_hFile); } int MemStream::GetChar() @@ -166,27 +173,27 @@ int FileStream::GetChar() return fgetc(m_hFile); } -MemStream::size_type MemStream::write(const byte_type* buffer, size_type length) +unsigned long MemStream::Write(const void* pBuf, unsigned long nCount) { - if (length == 0) + if (nCount == 0) return 0; - if (m_nPosition + length > m_nBufferSize) - GrowFile(m_nPosition + length); + if (m_nPosition + nCount > m_nBufferSize) + GrowFile(m_nPosition + nCount); - memcpy((unsigned char*)m_pBuffer + m_nPosition, (unsigned char*)buffer, length); + memcpy((unsigned char*)m_pBuffer + m_nPosition, (unsigned char*)pBuf, nCount); - m_nPosition += size_type(length); + m_nPosition += nCount; if (m_nPosition > m_nFileSize) m_nFileSize = m_nPosition; - return length; + return nCount; } -FileStream::size_type FileStream::write(const byte_type* buffer, size_type length) +unsigned long FileStream::Write(const void* pBuf, unsigned long nCount) { - return fwrite(buffer, 1, length, m_hFile); + return fwrite(pBuf, 1, nCount, m_hFile); } int MemStream::PutChar(int c) @@ -224,7 +231,7 @@ void MemStream::printf(const char* s, ...) va_start (args, s); vsprintf(buffer, s, args); va_end (args); - write(reinterpret_cast(buffer), strlen(buffer)); + Write(buffer, strlen(buffer)); } int FileStream::PutChar(int c) @@ -260,9 +267,9 @@ void FileStream::Close() m_bCloseOnDelete = false; } -int MemStream::Seek(offset_type lOff, int nFrom) +unsigned long MemStream::Seek(long lOff, int nFrom) { - size_type lNewPos = m_nPosition; + unsigned long lNewPos = m_nPosition; if (nFrom == SEEK_SET) lNewPos = lOff; @@ -271,36 +278,36 @@ int MemStream::Seek(offset_type lOff, int nFrom) else if (nFrom == SEEK_END) lNewPos = m_nFileSize + lOff; else - return (position_type)-1; + return (unsigned long)-1; m_nPosition = lNewPos; - return static_cast(m_nPosition); + return m_nPosition; } -int FileStream::Seek(offset_type lOff, int nFrom) +unsigned long FileStream::Seek(long lOff, int nFrom) { fseek (m_hFile, lOff, nFrom); return ftell(m_hFile); } -MemStream::position_type MemStream::GetPosition() const +unsigned long MemStream::GetPosition() const { return m_nPosition; } -FileStream::position_type FileStream::GetPosition() const +unsigned long FileStream::GetPosition() const { return ftell(m_hFile); } -void MemStream::GrowFile(size_type nNewLen) +void MemStream::GrowFile(unsigned long nNewLen) { if (nNewLen > m_nBufferSize) { // grow the buffer - size_type nNewBufferSize = m_nBufferSize; + unsigned long nNewBufferSize = m_nBufferSize; // determine new buffer size while (nNewBufferSize < nNewLen) @@ -348,7 +355,7 @@ void FileStream::Abort() } } -void MemStream::SetLength(size_type nNewLen) +void MemStream::SetLength(unsigned long nNewLen) { if (nNewLen > m_nBufferSize) GrowFile(nNewLen); @@ -359,25 +366,25 @@ void MemStream::SetLength(size_type nNewLen) m_nFileSize = nNewLen; } -void FileStream::SetLength(size_type nNewLen) +void FileStream::SetLength(unsigned long nNewLen) { - fseek(m_hFile, static_cast(nNewLen), SEEK_SET); + fseek(m_hFile, nNewLen, SEEK_SET); } -MemStream::size_type MemStream::GetLength() const +unsigned long MemStream::GetLength() const { return m_nFileSize; } -FileStream::size_type FileStream::GetLength() const +unsigned long FileStream::GetLength() const { - size_type nLen, nCur; + unsigned long nLen, nCur; // Seek is a non const operation nCur = ftell(m_hFile); fseek(m_hFile, 0, SEEK_END); nLen = ftell(m_hFile); - fseek(m_hFile, static_cast(nCur), SEEK_SET); + fseek(m_hFile, nCur, SEEK_SET); return nLen; } diff --git a/radiant/file.h b/radiant/file.h new file mode 100644 index 00000000..03ec33fc --- /dev/null +++ b/radiant/file.h @@ -0,0 +1,119 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// file.h +//////////////////////////////////////////////////// + +#ifndef _FILE_H_ +#define _FILE_H_ + +//#include + +class MemStream : public IDataStream +{ +public: + MemStream(); + MemStream(unsigned long nLen); + virtual ~MemStream(); + + int refCount; + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + +protected: + // MemFile specific: + unsigned long m_nGrowBytes; + unsigned long m_nPosition; + unsigned long m_nBufferSize; + unsigned long m_nFileSize; + unsigned char* m_pBuffer; + bool m_bAutoDelete; + void GrowFile(unsigned long nNewLen); + +public: + unsigned long GetPosition() const; + unsigned long Seek(long lOff, int nFrom); + void SetLength(unsigned long nNewLen); + unsigned long GetLength() const; + + unsigned char* GetBuffer () const + { return m_pBuffer; } + + char* ReadString(char* pBuf, unsigned long nMax); + unsigned long Read(void* pBuf, unsigned long nCount); + unsigned long Write(const void* pBuf, unsigned long nCount); + int GetChar(); + int PutChar(int c); + + void printf(const char*, ...); ///< \todo implement on MemStream + + void Abort(); + void Flush(); + void Close(); + bool Open(const char *filename, const char *mode); +}; + +class FileStream : public IDataStream +{ +public: + FileStream(); + virtual ~FileStream(); + + int refCount; + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + +protected: + // DiscFile specific: + FILE* m_hFile; + bool m_bCloseOnDelete; + +public: + unsigned long GetPosition() const; + unsigned long Seek(long lOff, int nFrom); + void SetLength(unsigned long nNewLen); + unsigned long GetLength() const; + + char* ReadString(char* pBuf, unsigned long nMax); + unsigned long Read(void* pBuf, unsigned long nCount); + unsigned long Write(const void* pBuf, unsigned long nCount); + int GetChar(); + int PutChar(int c); + + void printf(const char*, ...); ///< completely matches the usual printf behaviour + + void Abort(); + void Flush(); + void Close(); + bool Open(const char *filename, const char *mode); +}; + +#endif // _FILE_H_ diff --git a/radiant/filetypes.cpp b/radiant/filetypes.cpp deleted file mode 100644 index b76b968e..00000000 --- a/radiant/filetypes.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "filetypes.h" - -#include "debugging/debugging.h" - -#include "ifiletypes.h" - -#include "string/string.h" -#include "os/path.h" -#include -#include - -class RadiantFileTypeRegistry : public IFileTypeRegistry -{ - struct filetype_copy_t - { - filetype_copy_t(const char* moduleName, const filetype_t other) - : m_moduleName(moduleName), m_name(other.name), m_pattern(other.pattern) - { - } - const char* getModuleName() const - { - return m_moduleName.c_str(); - } - filetype_t getType() const - { - return filetype_t(m_name.c_str(), m_pattern.c_str()); - } - private: - CopiedString m_moduleName; - CopiedString m_name; - CopiedString m_pattern; - }; - typedef std::vector filetype_list_t; - std::map m_typelists; -public: - RadiantFileTypeRegistry() - { - addType("*", "*", filetype_t("All Files", "*.*")); - } - void addType(const char* moduleType, const char* moduleName, filetype_t type) - { - m_typelists[moduleType].push_back(filetype_copy_t(moduleName, type)); - } - void getTypeList(const char* moduleType, IFileTypeList* typelist) - { - filetype_list_t& list_ref = m_typelists[moduleType]; - for(filetype_list_t::iterator i = list_ref.begin(); i != list_ref.end(); ++i) - { - typelist->addType((*i).getModuleName(), (*i).getType()); - } - } -}; - -static RadiantFileTypeRegistry g_patterns; - -IFileTypeRegistry* GetFileTypeRegistry() -{ - return &g_patterns; -} - -const char* findModuleName(IFileTypeRegistry* registry, const char* moduleType, const char* extension) -{ - class SearchFileTypeList : public IFileTypeList - { - char m_pattern[128]; - const char* m_moduleName; - public: - SearchFileTypeList(const char* ext) - : m_moduleName("") - { - m_pattern[0] = '*'; - m_pattern[1] = '.'; - strncpy(m_pattern + 2, ext, 125); - m_pattern[127] = '\0'; - } - void addType(const char* moduleName, filetype_t type) - { - if(extension_equal(m_pattern, type.pattern)) - { - m_moduleName = moduleName; - } - } - - const char* getModuleName() - { - return m_moduleName; - } - } search(extension); - registry->getTypeList(moduleType, &search); - return search.getModuleName(); -} - - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class FiletypesAPI -{ - IFileTypeRegistry* m_filetypes; -public: - typedef IFileTypeRegistry Type; - STRING_CONSTANT(Name, "*"); - - FiletypesAPI() - { - m_filetypes = GetFileTypeRegistry(); - } - IFileTypeRegistry* getTable() - { - return m_filetypes; - } -}; - -typedef SingletonModule FiletypesModule; -typedef Static StaticFiletypesModule; -StaticRegisterModule staticRegisterFiletypes(StaticFiletypesModule::instance()); - - diff --git a/radiant/filetypes.h b/radiant/filetypes.h deleted file mode 100644 index f924c793..00000000 --- a/radiant/filetypes.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_FILETYPES_H) -#define INCLUDED_FILETYPES_H - -class IFileTypeRegistry; -IFileTypeRegistry* GetFileTypeRegistry(); -const char* findModuleName(IFileTypeRegistry* registry, const char* moduleType, const char* extension); - -#endif diff --git a/radiant/filters.cpp b/radiant/filters.cpp index 74e7774a..5e0b069e 100644 --- a/radiant/filters.cpp +++ b/radiant/filters.cpp @@ -1,321 +1,290 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "filters.h" +#include "stdafx.h" -#include "debugging/debugging.h" - -#include "ifilter.h" - -#include "scenelib.h" - -#include -#include - -#include "gtkutil/widget.h" -#include "gtkutil/menu.h" -#include "gtkmisc.h" -#include "mainframe.h" -#include "commands.h" -#include "preferences.h" - -struct filters_globals_t +// type 1 = texture filter (name) +// type 3 = entity filter (name) +// type 2 = QER_* shader flags +// type 4 = entity classes +// type 5 = surface flags (q2) +// type 6 = content flags (q2) +// type 7 = content flags - no match (q2) +bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exclude) { - std::size_t exclude; - - filters_globals_t() : - exclude(0) - { - } -}; - -filters_globals_t g_filters_globals; - -inline bool filter_active(int mask) -{ - return (g_filters_globals.exclude & mask) > 0; + bfilter_t *pNew = new bfilter_t; + pNew->next = pFilter; + pNew->attribute = type; + if (type == 1 || type == 3) pNew->string = str; + if (type == 2 || type == 4 || type == 5 || type == 6 || type == 7) pNew->mask = bmask; + if (g_qeglobals.d_savedinfo.exclude & exclude) + pNew->active = true; + else + pNew->active = false; + return pNew; } -class FilterWrapper +bfilter_t *FilterCreate (int type, int bmask, char *str, int exclude) { -public: - FilterWrapper(Filter& filter, int mask) : m_filter(filter), m_mask(mask) - { - } - void update() - { - m_filter.setActive(filter_active(m_mask)); - } -private: - Filter& m_filter; - int m_mask; -}; + g_qeglobals.d_savedinfo.filters = FilterAdd(g_qeglobals.d_savedinfo.filters, type, bmask, str, exclude); + Syn_Printf("Added filter %s (type: %i, bmask: %i, exclude: %i)\n", str, type, bmask, exclude); + return g_qeglobals.d_savedinfo.filters; +} -typedef std::list Filters; -Filters g_filters; +extern void PerformFiltering(); -typedef std::set Filterables; -Filterables g_filterables; - -void UpdateFilters() +void FiltersActivate (void) { - { - for(Filters::iterator i = g_filters.begin(); i != g_filters.end(); ++i) - { - (*i).update(); - } - } + PerformFiltering(); + Sys_UpdateWindows(W_XY|W_CAMERA); +} - { - for(Filterables::iterator i = g_filterables.begin(); i != g_filterables.end(); ++i) - { - (*i)->updateFiltered(); - } - } + // removes the filter list at *pFilter, returns NULL pointer +bfilter_t *FilterListDelete(bfilter_t *pFilter) +{ + if (pFilter != NULL) + { + FilterListDelete(pFilter->next); + delete pFilter; + } + return NULL; } -class BasicFilterSystem : public FilterSystem + //spog - FilterUpdate is called each time the filters are changed by menu or shortcuts +bfilter_t *FilterUpdate(bfilter_t *pFilter) { -public: - void addFilter(Filter& filter, int mask) - { - g_filters.push_back(FilterWrapper(filter, mask)); - g_filters.back().update(); - } - void registerFilterable(Filterable& filterable) - { - ASSERT_MESSAGE(g_filterables.find(&filterable) == g_filterables.end(), "filterable already registered"); - filterable.updateFiltered(); - g_filterables.insert(&filterable); - } - void unregisterFilterable(Filterable& filterable) - { - ASSERT_MESSAGE(g_filterables.find(&filterable) != g_filterables.end(), "filterable not registered"); - g_filterables.erase(&filterable); - } -}; - -BasicFilterSystem g_FilterSystem; - -FilterSystem& GetFilterSystem() -{ - return g_FilterSystem; + pFilter = FilterAdd(pFilter,1,0,"clip",EXCLUDE_CLIP); + pFilter = FilterAdd(pFilter,1,0,"caulk",EXCLUDE_CAULK); + pFilter = FilterAdd(pFilter,1,0,"liquids",EXCLUDE_LIQUIDS); + pFilter = FilterAdd(pFilter,1,0,"hint",EXCLUDE_HINTSSKIPS); + pFilter = FilterAdd(pFilter,1,0,"clusterportal",EXCLUDE_CLUSTERPORTALS); + pFilter = FilterAdd(pFilter,1,0,"areaportal",EXCLUDE_AREAPORTALS); + pFilter = FilterAdd(pFilter,2,QER_TRANS,NULL,EXCLUDE_TRANSLUCENT); + pFilter = FilterAdd(pFilter,3,0,"trigger",EXCLUDE_TRIGGERS); + pFilter = FilterAdd(pFilter,3,0,"misc_model",EXCLUDE_MODELS); + pFilter = FilterAdd(pFilter,3,0,"misc_gamemodel",EXCLUDE_MODELS); + pFilter = FilterAdd(pFilter,4,ECLASS_LIGHT,NULL,EXCLUDE_LIGHTS); + pFilter = FilterAdd(pFilter,4,ECLASS_PATH,NULL,EXCLUDE_PATHS); + pFilter = FilterAdd(pFilter,1,0,"lightgrid",EXCLUDE_LIGHTGRID); + pFilter = FilterAdd(pFilter,1,0,"botclip",EXCLUDE_BOTCLIP); + pFilter = FilterAdd(pFilter,1,0,"clipmonster",EXCLUDE_BOTCLIP); + return pFilter; } -void PerformFiltering() +/* +================== +FilterBrush +================== +*/ + +bool FilterBrush(brush_t *pb) { - UpdateFilters(); - SceneChangeNotify(); + + if (!pb->owner) + return FALSE; // during construction + + if (pb->hiddenBrush) + return TRUE; + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_WORLD) + { + if (strcmp(pb->owner->eclass->name, "worldspawn") == 0 || !strcmp(pb->owner->eclass->name,"func_group")) // hack, treating func_group as world + { + return TRUE; + } + } + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_ENT) + { + if (strcmp(pb->owner->eclass->name, "worldspawn") != 0 && strcmp(pb->owner->eclass->name,"func_group")) // hack, treating func_group as world + { + return TRUE; + } + } + + if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_CURVES ) + { + if (pb->patchBrush) + { + return TRUE; + } + } + + + if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_DETAILS ) + { + if (!pb->patchBrush && pb->brush_faces->texdef.contents & CONTENTS_DETAIL ) + { + return TRUE; + } + } + if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_STRUCTURAL ) + { + if (!pb->patchBrush && !( pb->brush_faces->texdef.contents & CONTENTS_DETAIL )) + { + return TRUE; + } + } + + // if brush belongs to world entity or a brushmodel entity and is not a patch + if ( ( strcmp(pb->owner->eclass->name, "worldspawn") == 0 + || !strncmp( pb->owner->eclass->name, "func", 4) + || !strncmp( pb->owner->eclass->name, "trigger", 7) ) && !pb->patchBrush ) + { + bool filterbrush = false; + for (face_t *f=pb->brush_faces;f!=NULL;f = f->next) + { + filterbrush=false; + for (bfilter_t *filters = g_qeglobals.d_savedinfo.filters; + filters != NULL; + filters = filters->next) + { + if (!filters->active) + continue; + // exclude by attribute 1 brush->face->pShader->getName() + if (filters->attribute == 1) + { + if (strstr(f->pShader->getName(),filters->string)) + { + filterbrush=true; + break; + } + } + // exclude by attribute 2 brush->face->pShader->getFlags() + else if (filters->attribute == 2) + { + if (f->pShader->getFlags() & filters->mask) + { + filterbrush=true; + break; + } + // quake2 - 5 == surface flags, 6 == content flags + } + else if (filters->attribute == 5) + { + if (f->texdef.flags && f->texdef.flags & filters->mask) + { + filterbrush=true; + break; + } + } + else if (filters->attribute == 6) + { + if (f->texdef.contents && f->texdef.contents & filters->mask) + { + filterbrush=true; + break; + } + } + else if (filters->attribute == 7) + { + if (f->texdef.contents && !(f->texdef.contents & filters->mask)) + { + filterbrush=true; + break; + } + } + } + if (!filterbrush) + break; + } + if (filterbrush)// if no face is found that should not be excluded + return true; // exclude this brush + } + + // if brush is a patch + if ( pb->patchBrush ) + { + bool drawpatch=true; + for (bfilter_t *filters = g_qeglobals.d_savedinfo.filters; + filters != NULL; + filters = filters->next) + { + // exclude by attribute 1 (for patch) brush->pPatch->pShader->getName() + if (filters->active + && filters->attribute == 1) + { + if (strstr(pb->pPatch->pShader->getName(),filters->string)) + { + drawpatch=false; + break; + } + } + + // exclude by attribute 2 (for patch) brush->pPatch->pShader->getFlags() + if (filters->active + && filters->attribute == 2) + { + if (pb->pPatch->pShader->getFlags() & filters->mask) + { + drawpatch=false; + break; + } + } + } + if (!drawpatch) // if a shader is found that should be excluded + return TRUE; // exclude this patch + } + + if (strcmp(pb->owner->eclass->name, "worldspawn") != 0) // if brush does not belong to world entity + { + bool drawentity=true; + for (bfilter_t *filters = g_qeglobals.d_savedinfo.filters; + filters != NULL; + filters = filters->next) + { + // exclude by attribute 3 brush->owner->eclass->name + if (filters->active + && filters->attribute == 3) + { + if (strstr(pb->owner->eclass->name,filters->string)) + { + drawentity=false; + break; + } + } + + // exclude by attribute 4 brush->owner->eclass->nShowFlags + else if (filters->active + && filters->attribute == 4) + { + if ( pb->owner->eclass->nShowFlags & filters->mask ) + { + drawentity=false; + break; + } + } + } + if (!drawentity) // if an eclass property is found that should be excluded + return TRUE; // exclude this brush + } + return FALSE; } - -class ToggleFilterFlag -{ - const unsigned int m_mask; -public: - ToggleItem m_item; - - ToggleFilterFlag(unsigned int mask) : m_mask(mask), m_item(ActiveCaller(*this)) - { - } - ToggleFilterFlag(const ToggleFilterFlag& other) : m_mask(other.m_mask), m_item(ActiveCaller(*this)) - { - } - void active(const BoolImportCallback& importCallback) - { - importCallback((g_filters_globals.exclude & m_mask) != 0); - } - typedef MemberCaller1 ActiveCaller; - void toggle() - { - g_filters_globals.exclude ^= m_mask; - m_item.update(); - PerformFiltering(); - } - void reset() - { - g_filters_globals.exclude = 0; - m_item.update(); - PerformFiltering(); - } - typedef MemberCaller ToggleCaller; -}; - - -typedef std::list ToggleFilterFlags; -ToggleFilterFlags g_filter_items; - -void add_filter_command(unsigned int flag, const char* command, const Accelerator& accelerator) -{ - g_filter_items.push_back(ToggleFilterFlag(flag)); - GlobalToggles_insert(command, ToggleFilterFlag::ToggleCaller(g_filter_items.back()), ToggleItem::AddCallbackCaller(g_filter_items.back().m_item), accelerator); -} - -void InvertFilters() -{ - std::list::iterator iter; - - for(iter = g_filter_items.begin(); iter != g_filter_items.end(); ++iter) - { - iter->toggle(); - } -} - -void ResetFilters() -{ - std::list::iterator iter; - - for(iter = g_filter_items.begin(); iter != g_filter_items.end(); ++iter) - { - iter->reset(); - } -} - -void Filters_constructMenu(GtkMenu* menu_in_menu) -{ - create_check_menu_item_with_mnemonic(menu_in_menu, "World", "FilterWorldBrushes"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Entities", "FilterEntities"); - if(g_pGameDescription->mGameType == "doom3") - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Visportals", "FilterVisportals"); - } - else - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Areaportals", "FilterAreaportals"); - } - create_check_menu_item_with_mnemonic(menu_in_menu, "Translucent", "FilterTranslucent"); - if(g_pGameDescription->mGameType != "doom3") - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Liquids", "FilterLiquids"); - } - create_check_menu_item_with_mnemonic(menu_in_menu, "Caulk", "FilterCaulk"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Clips", "FilterClips"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Paths", "FilterPaths"); - if(g_pGameDescription->mGameType != "doom3") - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Clusterportals", "FilterClusterportals"); - } - create_check_menu_item_with_mnemonic(menu_in_menu, "Lights", "FilterLights"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Structural", "FilterStructural"); - if(g_pGameDescription->mGameType != "doom3") - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Lightgrid", "FilterLightgrid"); - } - create_check_menu_item_with_mnemonic(menu_in_menu, "Patches", "FilterPatches"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Details", "FilterDetails"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Hints", "FilterHintsSkips"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Models", "FilterModels"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Triggers", "FilterTriggers"); - if(g_pGameDescription->mGameType != "doom3") - { - create_check_menu_item_with_mnemonic(menu_in_menu, "Botclips", "FilterBotClips"); - } - // filter manipulation - menu_separator(menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Invert filters", "InvertFilters"); - create_menu_item_with_mnemonic(menu_in_menu, "Reset filters", "ResetFilters"); -} - - -#include "preferencesystem.h" -#include "stringio.h" - -void ConstructFilters() -{ - GlobalPreferenceSystem().registerPreference("SI_Exclude", SizeImportStringCaller(g_filters_globals.exclude), SizeExportStringCaller(g_filters_globals.exclude)); - - GlobalCommands_insert("InvertFilters", FreeCaller()); - GlobalCommands_insert("ResetFilters", FreeCaller()); - - add_filter_command(EXCLUDE_WORLD, "FilterWorldBrushes", Accelerator('1', (GdkModifierType)GDK_MOD1_MASK)); - add_filter_command(EXCLUDE_ENT, "FilterEntities", Accelerator('2', (GdkModifierType)GDK_MOD1_MASK)); - if(g_pGameDescription->mGameType == "doom3") - { - add_filter_command(EXCLUDE_VISPORTALS, "FilterVisportals", Accelerator('3', (GdkModifierType)GDK_MOD1_MASK)); - } - else - { - add_filter_command(EXCLUDE_AREAPORTALS, "FilterAreaportals", Accelerator('3', (GdkModifierType)GDK_MOD1_MASK)); - } - add_filter_command(EXCLUDE_TRANSLUCENT, "FilterTranslucent", Accelerator('4', (GdkModifierType)GDK_MOD1_MASK)); - add_filter_command(EXCLUDE_LIQUIDS, "FilterLiquids", Accelerator('5', (GdkModifierType)GDK_MOD1_MASK)); - add_filter_command(EXCLUDE_CAULK, "FilterCaulk", Accelerator('6', (GdkModifierType)GDK_MOD1_MASK )); - add_filter_command(EXCLUDE_CLIP, "FilterClips", Accelerator('7', (GdkModifierType)GDK_MOD1_MASK)); - add_filter_command(EXCLUDE_PATHS, "FilterPaths", Accelerator('8', (GdkModifierType)GDK_MOD1_MASK)); - if(g_pGameDescription->mGameType != "doom3") - { - add_filter_command(EXCLUDE_CLUSTERPORTALS, "FilterClusterportals", Accelerator('9', (GdkModifierType)GDK_MOD1_MASK)); - } - add_filter_command(EXCLUDE_LIGHTS, "FilterLights", Accelerator('0', (GdkModifierType)GDK_MOD1_MASK)); - add_filter_command(EXCLUDE_STRUCTURAL, "FilterStructural", Accelerator('D', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - if(g_pGameDescription->mGameType != "doom3") - { - add_filter_command(EXCLUDE_LIGHTGRID, "FilterLightgrid", accelerator_null()); - } - add_filter_command(EXCLUDE_CURVES, "FilterPatches", Accelerator('P', (GdkModifierType)GDK_CONTROL_MASK)); - add_filter_command(EXCLUDE_DETAILS, "FilterDetails", Accelerator('D', (GdkModifierType)GDK_CONTROL_MASK)); - add_filter_command(EXCLUDE_HINTSSKIPS, "FilterHintsSkips", Accelerator('H', (GdkModifierType)GDK_CONTROL_MASK)); - add_filter_command(EXCLUDE_MODELS, "FilterModels", Accelerator('M', (GdkModifierType)GDK_SHIFT_MASK)); - add_filter_command(EXCLUDE_TRIGGERS, "FilterTriggers", Accelerator('T', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - if(g_pGameDescription->mGameType != "doom3") - { - add_filter_command(EXCLUDE_BOTCLIP, "FilterBotClips", Accelerator('M', (GdkModifierType)GDK_MOD1_MASK)); - } - - PerformFiltering(); -} - -void DestroyFilters() -{ - g_filters.clear(); -} - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class FilterAPI -{ - FilterSystem* m_filter; -public: - typedef FilterSystem Type; - STRING_CONSTANT(Name, "*"); - - FilterAPI() - { - ConstructFilters(); - - m_filter = &GetFilterSystem(); - } - ~FilterAPI() - { - DestroyFilters(); - } - FilterSystem* getTable() - { - return m_filter; - } -}; - -typedef SingletonModule FilterModule; -typedef Static StaticFilterModule; -StaticRegisterModule staticRegisterFilter(StaticFilterModule::instance()); - - diff --git a/radiant/filters.h b/radiant/filters.h index 631cef84..05776f55 100644 --- a/radiant/filters.h +++ b/radiant/filters.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,10 +19,14 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_FILTERS_H) -#define INCLUDED_FILTERS_H +#ifndef _FILTERS_H_ +#define _FILTERS_H_ -typedef struct _GtkMenu GtkMenu; -void Filters_constructMenu(GtkMenu* menu_in_menu); +void FiltersActivate(void); +bfilter_t *FilterCreate(int type, int bmask, char *str, int exclude); +bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exclude); +bfilter_t *FilterListDelete(bfilter_t *pFilter); +bfilter_t *FilterUpdate(bfilter_t *pFilter); +bool FilterBrush(brush_t *pb); -#endif +#endif // _FILTERS_H_ diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 52891d80..012208c2 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,148 +25,115 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // +#include "stdafx.h" #include "findtexturedialog.h" -#include "debugging/debugging.h" - -#include "ishaders.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtkutil/window.h" -#include "stream/stringstream.h" - -#include "commands.h" -#include "dialog.h" -#include "select.h" -#include "textureentry.h" - - - -class FindTextureDialog : public Dialog -{ - public: - static void setReplaceStr(const char* name); - static void setFindStr(const char* name); - static bool isOpen(); - static void show(); - typedef FreeCaller<&FindTextureDialog::show> ShowCaller; - static void updateTextures(const char* name); - - FindTextureDialog(); - virtual ~FindTextureDialog(); - GtkWindow* BuildDialog(); - - void constructWindow(GtkWindow* parent) - { - m_parent = parent; - Create(); - } - void destroyWindow() - { - Destroy(); - } - - - bool m_bSelectedOnly; - CopiedString m_strFind; - CopiedString m_strReplace; -}; - -FindTextureDialog g_FindTextureDialog; +FindTextureDialog g_TexFindDlg; +FindTextureDialog& g_dlgFind = g_TexFindDlg; static bool g_bFindActive = true; -namespace +static void OnApply(GtkWidget *widget, gpointer data) { - void FindTextureDialog_apply() - { - StringOutputStream find(256); - StringOutputStream replace(256); + g_dlgFind.UpdateData(TRUE); + FindReplaceTextures(g_dlgFind.m_strFind, g_dlgFind.m_strReplace, + g_dlgFind.m_bSelectedOnly, g_dlgFind.m_bForce, FALSE); +} - find << "textures/" << g_FindTextureDialog.m_strFind.c_str(); - replace << "textures/" << g_FindTextureDialog.m_strReplace.c_str(); - FindReplaceTextures(find.c_str(), replace.c_str(), g_FindTextureDialog.m_bSelectedOnly); +static void OnFind(GtkWidget *widget, gpointer data) +{ + g_dlgFind.UpdateData(TRUE); + FindReplaceTextures(g_dlgFind.m_strFind, g_dlgFind.m_strReplace, + g_dlgFind.m_bSelectedOnly, FALSE, TRUE); +} + +static void OnOK(GtkWidget *widget, gpointer data) +{ + g_dlgFind.UpdateData(TRUE); + FindReplaceTextures(g_dlgFind.m_strFind, g_dlgFind.m_strReplace, + g_dlgFind.m_bSelectedOnly, g_dlgFind.m_bForce, FALSE); + g_dlgFind.HideDlg (); +} + +static void OnClose(GtkWidget *widget, gpointer data) +{ + g_dlgFind.HideDlg (); +} + +static void popup_selected (GtkWidget *widget, gpointer data) +{ + gchar *str; + + gtk_label_get (GTK_LABEL (GTK_BIN (widget)->child), &str); + gtk_entry_set_text (GTK_ENTRY (data), str); +} + +static void find_clicked (GtkWidget *widget, gpointer data) +{ + GtkWidget *menu, *item; + menu = gtk_menu_new (); + + for (int i = 0; i < QERApp_GetActiveShaderCount (); i++) + { + IShader *pShader = QERApp_ActiveShader_ForIndex (i); + + item = gtk_menu_item_new_with_label (pShader->getName ()); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (popup_selected), data); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); } - static void OnApply(GtkWidget* widget, gpointer data) - { - g_FindTextureDialog.exportData(); - FindTextureDialog_apply(); - } + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); +} - static void OnFind(GtkWidget* widget, gpointer data) - { - g_FindTextureDialog.exportData(); - FindTextureDialog_apply(); - } +static gint find_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data) +{ + g_bFindActive = true; + return FALSE; +} - static void OnOK(GtkWidget* widget, gpointer data) - { - g_FindTextureDialog.exportData(); - FindTextureDialog_apply(); - g_FindTextureDialog.HideDlg(); - } - - static void OnClose(GtkWidget* widget, gpointer data) - { - g_FindTextureDialog.HideDlg(); - } - - - static gint find_focus_in (GtkWidget* widget, GdkEventFocus *event, gpointer data) - { - g_bFindActive = true; - return FALSE; - } - - static gint replace_focus_in (GtkWidget* widget, GdkEventFocus *event, gpointer data) - { - g_bFindActive = false; - return FALSE; - } +static gint replace_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data) +{ + g_bFindActive = false; + return FALSE; } // ============================================================================= // FindTextureDialog class -FindTextureDialog::FindTextureDialog() +FindTextureDialog::FindTextureDialog () { m_bSelectedOnly = FALSE; + m_strFind = ""; + m_strReplace = ""; + m_bForce = FALSE; + m_bLive = TRUE; } -FindTextureDialog::~FindTextureDialog() +FindTextureDialog::~FindTextureDialog () { } -GtkWindow* FindTextureDialog::BuildDialog() +void FindTextureDialog::BuildDialog () { - GtkWidget* vbox, *hbox, *table, *label; - GtkWidget* button, *check, *entry; + GtkWidget *dlg, *vbox, *hbox, *table, *label; + GtkWidget *button, *check, *entry, *arrow; - GtkWindow* dlg = create_floating_window("Find / Replace Texture(s)", m_parent); + dlg = m_pWidget; + gtk_window_set_title (GTK_WINDOW (dlg), "Find / Replace Texture(s)"); + gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (g_pParentWnd->m_pWidget)); hbox = gtk_hbox_new (FALSE, 5); gtk_widget_show (hbox); - gtk_container_add(GTK_CONTAINER(dlg), GTK_WIDGET(hbox)); + gtk_container_add (GTK_CONTAINER (dlg), hbox); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); vbox = gtk_vbox_new (FALSE, 5); gtk_widget_show (vbox); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); - table = gtk_table_new (2, 2, FALSE); + table = gtk_table_new (2, 3, FALSE); gtk_widget_show (table); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); gtk_table_set_row_spacings (GTK_TABLE (table), 5); gtk_table_set_col_spacings (GTK_TABLE (table), 5); @@ -184,118 +151,139 @@ GtkWindow* FindTextureDialog::BuildDialog() (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - entry = gtk_entry_new(); + entry = gtk_entry_new (); gtk_widget_show (entry); gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(entry), "focus_in_event", - G_CALLBACK(find_focus_in), 0); - AddDialogData(*GTK_ENTRY(entry), m_strFind); - GlobalTextureEntryCompletion::instance().connect(GTK_ENTRY(entry)); + gtk_signal_connect (GTK_OBJECT (entry), "focus_in_event", + GTK_SIGNAL_FUNC (find_focus_in), NULL); + AddDialogData (entry, &m_strFind, DLG_ENTRY_TEXT); - entry = gtk_entry_new(); + button = gtk_button_new (); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (find_clicked), entry); + + arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT); + gtk_widget_show (arrow); + gtk_container_add (GTK_CONTAINER (button), arrow); + + entry = gtk_entry_new (); gtk_widget_show (entry); gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(entry), "focus_in_event", - G_CALLBACK(replace_focus_in), 0); - AddDialogData(*GTK_ENTRY(entry), m_strReplace); - GlobalTextureEntryCompletion::instance().connect(GTK_ENTRY(entry)); + gtk_signal_connect (GTK_OBJECT (entry), "focus_in_event", + GTK_SIGNAL_FUNC (replace_focus_in), NULL); + AddDialogData (entry, &m_strReplace, DLG_ENTRY_TEXT); - check = gtk_check_button_new_with_label ("Within selected brushes only"); + button = gtk_button_new (); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (find_clicked), entry); + + arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT); + gtk_widget_show (arrow); + gtk_container_add (GTK_CONTAINER (button), arrow); + + check = gtk_check_button_new_with_label ("Use selected brushes only"); gtk_widget_show (check); - gtk_box_pack_start(GTK_BOX(vbox), check, TRUE, TRUE, 0); - AddDialogData(*GTK_TOGGLE_BUTTON(check), m_bSelectedOnly); + gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0); + AddDialogData (check, &m_bSelectedOnly, DLG_CHECK_BOOL); + + check = gtk_check_button_new_with_label ("Replace everywhere (selected/active), don't test against Find"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0); + AddDialogData (check, &m_bForce, DLG_CHECK_BOOL); + + check = gtk_check_button_new_with_label ("Live updates from Texture/Camera windows"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0); + AddDialogData (check, &m_bLive, DLG_CHECK_BOOL); vbox = gtk_vbox_new (FALSE, 5); gtk_widget_show (vbox); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + button = gtk_button_new_with_label( "Find" ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", + GTK_SIGNAL_FUNC( OnFind ), NULL ); + gtk_widget_set_usize( button, 60, -2 ); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnOK), NULL); + gtk_widget_set_usize (button, 60, -2); button = gtk_button_new_with_label ("Apply"); gtk_widget_show (button); - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnApply), 0); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnApply), NULL); gtk_widget_set_usize (button, 60, -2); button = gtk_button_new_with_label ("Close"); gtk_widget_show (button); - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnClose), 0); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnClose), NULL); gtk_widget_set_usize (button, 60, -2); - return dlg; + gtk_widget_show (dlg); } -void FindTextureDialog::updateTextures(const char* name) +void FindTextureDialog::updateTextures(const char *p) { if (isOpen()) { if (g_bFindActive) { - setFindStr(name + 9); + setFindStr(p); } else { - setReplaceStr(name + 9); + setReplaceStr(p); } } } bool FindTextureDialog::isOpen() { - return GTK_WIDGET_VISIBLE(g_FindTextureDialog.GetWidget()) == TRUE; + return (g_dlgFind.m_pWidget == NULL || GTK_WIDGET_VISIBLE (g_dlgFind.m_pWidget) == FALSE) ? false : true; } -void FindTextureDialog::setFindStr(const char* name) +void FindTextureDialog::setFindStr(const char * p) { - g_FindTextureDialog.exportData(); - g_FindTextureDialog.m_strFind = name; - g_FindTextureDialog.importData(); + g_dlgFind.UpdateData(TRUE); + if (g_dlgFind.m_bLive) + { + g_dlgFind.m_strFind = p; + g_dlgFind.UpdateData(FALSE); + } } -void FindTextureDialog::setReplaceStr(const char* name) +void FindTextureDialog::setReplaceStr(const char * p) { - g_FindTextureDialog.exportData(); - g_FindTextureDialog.m_strReplace = name; - g_FindTextureDialog.importData(); + g_dlgFind.UpdateData(TRUE); + if (g_dlgFind.m_bLive) + { + g_dlgFind.m_strReplace = p; + g_dlgFind.UpdateData(FALSE); + } } void FindTextureDialog::show() { - g_FindTextureDialog.ShowDlg(); + g_dlgFind.ShowDlg (); } - - -void FindTextureDialog_constructWindow(GtkWindow* main_window) -{ - g_FindTextureDialog.constructWindow(main_window); -} - -void FindTextureDialog_destroyWindow() -{ - g_FindTextureDialog.destroyWindow(); -} - -bool FindTextureDialog_isOpen() -{ - return g_FindTextureDialog.isOpen(); -} - -void FindTextureDialog_selectTexture(const char* name) -{ - g_FindTextureDialog.updateTextures(name); -} - -void FindTextureDialog_Construct() -{ - GlobalCommands_insert("FindReplaceTextures", FindTextureDialog::ShowCaller()); -} - -void FindTextureDialog_Destroy() -{ -} - diff --git a/radiant/findtexturedialog.h b/radiant/findtexturedialog.h index 5535ec5d..eb1e61e1 100644 --- a/radiant/findtexturedialog.h +++ b/radiant/findtexturedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,16 +19,31 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_FINDTEXTUREDIALOG_H) -#define INCLUDED_FINDTEXTUREDIALOG_H +#ifndef _FINDTEXTUREDIALOG_H_ +#define _FINDTEXTUREDIALOG_H_ -void FindTextureDialog_Construct(); -void FindTextureDialog_Destroy(); +#include "dialog.h" -typedef struct _GtkWindow GtkWindow; -void FindTextureDialog_constructWindow(GtkWindow* main_window); -void FindTextureDialog_destroyWindow(); -bool FindTextureDialog_isOpen(); -void FindTextureDialog_selectTexture(const char* name); +class FindTextureDialog : public Dialog +{ + public: + static void setReplaceStr(const char* p); + static void setFindStr(const char* p); + static bool isOpen(); + static void show(); + static void updateTextures(const char* p); -#endif + FindTextureDialog (); + virtual ~FindTextureDialog (); + void BuildDialog (); + + bool m_bSelectedOnly; + Str m_strFind; + Str m_strReplace; + bool m_bForce; + bool m_bLive; + +}; + + +#endif //_FINDTEXTUREDIALOG_H_ diff --git a/radiant/glinterface.cpp b/radiant/glinterface.cpp new file mode 100644 index 00000000..13e7e6c9 --- /dev/null +++ b/radiant/glinterface.cpp @@ -0,0 +1,91 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// +// DESCRIPTION: +// Quick interface hack for selected face interface +// this one really needs more work, but I'm in a hurry with TexTool + +#include "stdafx.h" +//#include "qe3.h" + +// stores objects that want to be hooked into drawing in the XY window or Camera view +//++timo TODO: add support for Z view ... (texture view?) +CPtrArray l_GL2DWindows; +CPtrArray l_GL3DWindows; + +void WINAPI QERApp_HookGL2DWindow(IGL2DWindow* pGLW) +{ + l_GL2DWindows.Add( pGLW ); + pGLW->IncRef(); +} + +void WINAPI QERApp_UnHookGL2DWindow(IGL2DWindow* pGLW) +{ + for( int i = 0; i < l_GL2DWindows.GetSize(); i++ ) + { + if (l_GL2DWindows.GetAt(i) == pGLW) + { + l_GL2DWindows.RemoveAt(i); + pGLW->DecRef(); + return; + } + } +#ifdef _DEBUG + Sys_Printf("ERROR: IGL2DWindow* not found in QERApp_UnHookGL2DWindow\n"); +#endif +} + +void Draw2DPluginEntities( VIEWTYPE vt ) +{ + for(int i = 0; i(l_GL2DWindows.GetAt(i))->Draw2D( vt ); +} + +void WINAPI QERApp_HookGL3DWindow(IGL3DWindow* pGLW) +{ + l_GL3DWindows.Add( pGLW ); + pGLW->IncRef(); +} + +void WINAPI QERApp_UnHookGL3DWindow(IGL3DWindow* pGLW) +{ + for( int i = 0; i < l_GL3DWindows.GetSize(); i++ ) + { + if (l_GL3DWindows.GetAt(i) == pGLW) + { + l_GL3DWindows.RemoveAt(i); + pGLW->DecRef(); + return; + } + } +#ifdef _DEBUG + Sys_Printf("ERROR: IGL3DWindow* not found in QERApp_UnHookGL3DWindow\n"); +#endif +} + +void Draw3DPluginEntities() +{ + for(int i = 0; i(l_GL3DWindows.GetAt(i))->Draw3D(); +} diff --git a/radiant/glwidget.cpp b/radiant/glwidget.cpp index 47500097..4498107f 100644 --- a/radiant/glwidget.cpp +++ b/radiant/glwidget.cpp @@ -1,55 +1,254 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// OpenGL widget based on GtkGLExt + +#include "stdafx.h" + +#include #include "glwidget.h" +#include "qgl.h" -#include "igtkgl.h" -#include "modulesystem.h" -#include "gtkutil/glwidget.h" +typedef int* attribs_t; +typedef const attribs_t* configs_iterator; -class GtkGLAPI -{ - _QERGtkGLTable m_gtkgl; -public: - typedef _QERGtkGLTable Type; - STRING_CONSTANT(Name, "*"); - - GtkGLAPI() - { - m_gtkgl.glwidget_new = &glwidget_new; - m_gtkgl.glwidget_swap_buffers = &glwidget_swap_buffers; - m_gtkgl.glwidget_make_current = &glwidget_make_current; - m_gtkgl.glwidget_destroy_context = &glwidget_destroy_context; - m_gtkgl.glwidget_create_context = &glwidget_create_context; - } - _QERGtkGLTable* getTable() - { - return &m_gtkgl; - } +int config_rgba32[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 8, + GDK_GL_BLUE_SIZE, 8, + GDK_GL_GREEN_SIZE, 8, + GDK_GL_ALPHA_SIZE, 8, + GDK_GL_ATTRIB_LIST_NONE, }; -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" +int config_rgba[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 1, + GDK_GL_BLUE_SIZE, 1, + GDK_GL_GREEN_SIZE, 1, + GDK_GL_ALPHA_SIZE, 1, + GDK_GL_ATTRIB_LIST_NONE, +}; -typedef SingletonModule GtkGLModule; -typedef Static StaticGtkGLModule; -StaticRegisterModule staticRegisterGtkGL(StaticGtkGLModule::instance()); +const attribs_t configs[] = { + config_rgba32, + config_rgba, +}; + +GdkGLConfig* glconfig_new() +{ + GdkGLConfig* glconfig = NULL; + + for(configs_iterator i = configs, end = configs + 2; i != end && glconfig == NULL; ++i) + { + glconfig = gdk_gl_config_new(*i); + } + + if(glconfig == NULL) + { + return gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGBA | GDK_GL_MODE_DOUBLE)); + } + + return glconfig; +} + +int config_rgba32_depth32[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 8, + GDK_GL_BLUE_SIZE, 8, + GDK_GL_GREEN_SIZE, 8, + GDK_GL_ALPHA_SIZE, 8, + GDK_GL_DEPTH_SIZE, 32, + GDK_GL_ATTRIB_LIST_NONE, +}; + +int config_rgba32_depth24[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 8, + GDK_GL_BLUE_SIZE, 8, + GDK_GL_GREEN_SIZE, 8, + GDK_GL_ALPHA_SIZE, 8, + GDK_GL_DEPTH_SIZE, 24, + GDK_GL_ATTRIB_LIST_NONE, +}; + +int config_rgba32_depth16[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 8, + GDK_GL_BLUE_SIZE, 8, + GDK_GL_GREEN_SIZE, 8, + GDK_GL_ALPHA_SIZE, 8, + GDK_GL_DEPTH_SIZE, 16, + GDK_GL_ATTRIB_LIST_NONE, +}; + +int config_rgba32_depth[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 8, + GDK_GL_BLUE_SIZE, 8, + GDK_GL_GREEN_SIZE, 8, + GDK_GL_ALPHA_SIZE, 8, + GDK_GL_DEPTH_SIZE, 1, + GDK_GL_ATTRIB_LIST_NONE, +}; + +int config_rgba_depth16[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 1, + GDK_GL_BLUE_SIZE, 1, + GDK_GL_GREEN_SIZE, 1, + GDK_GL_ALPHA_SIZE, 1, + GDK_GL_DEPTH_SIZE, 16, + GDK_GL_ATTRIB_LIST_NONE, +}; + +int config_rgba_depth[] = { + GDK_GL_RGBA, + GDK_GL_DOUBLEBUFFER, + GDK_GL_RED_SIZE, 1, + GDK_GL_BLUE_SIZE, 1, + GDK_GL_GREEN_SIZE, 1, + GDK_GL_ALPHA_SIZE, 1, + GDK_GL_DEPTH_SIZE, 1, + GDK_GL_ATTRIB_LIST_NONE, +}; + +const attribs_t configs_with_depth[] = +{ + config_rgba32_depth32, + config_rgba32_depth24, + config_rgba32_depth16, + config_rgba32_depth, + config_rgba_depth16, + config_rgba_depth, +}; + +GdkGLConfig* glconfig_new_with_depth() +{ + GdkGLConfig* glconfig = NULL; + + for(configs_iterator i = configs_with_depth, end = configs_with_depth + 6; i != end && glconfig == NULL; ++i) + { + glconfig = gdk_gl_config_new(*i); + } + + if(glconfig == NULL) + { + return gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGBA | GDK_GL_MODE_DOUBLE | GDK_GL_MODE_DEPTH)); + } + + return glconfig; +} + +GtkWidget* WINAPI gtk_glwidget_new (gboolean zbuffer, GtkWidget* share) +{ + GtkWidget* drawing_area = gtk_drawing_area_new(); + GdkGLConfig* glconfig = (zbuffer) ? glconfig_new_with_depth() : glconfig_new(); + GdkGLContext* shared_context = (share) ? gtk_widget_get_gl_context(share) : NULL; + + gtk_widget_set_gl_capability (drawing_area, glconfig, shared_context, TRUE, GDK_GL_RGBA_TYPE); + + return drawing_area; +} + +void WINAPI gtk_glwidget_destroy_context (GtkWidget *widget) +{ +} + +void WINAPI gtk_glwidget_create_context (GtkWidget *widget) +{ +} + +void WINAPI gtk_glwidget_swap_buffers (GtkWidget *widget) +{ + GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget); + gdk_gl_drawable_swap_buffers (gldrawable); +} + +gboolean WINAPI gtk_glwidget_make_current (GtkWidget *widget) +{ + GdkGLContext *glcontext = gtk_widget_get_gl_context (widget); + GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget); + return gdk_gl_drawable_gl_begin (gldrawable, glcontext); +} + +GLuint font_list_base; +static gchar font_string[] = "courier 8"; +static gint font_height; + +void gtk_glwidget_create_font (GtkWidget *widget) +{ + GdkGLContext *glcontext = gtk_widget_get_gl_context (widget); + GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget); + + PangoFontDescription *font_desc; + PangoFont *font; + PangoFontMetrics *font_metrics; + + font_list_base = qglGenLists (256); + + font_desc = pango_font_description_from_string (font_string); + + font = gdk_gl_font_use_pango_font (font_desc, 0, 256, font_list_base); + + if(font != NULL) + { + font_metrics = pango_font_get_metrics (font, NULL); + + font_height = pango_font_metrics_get_ascent (font_metrics) + + pango_font_metrics_get_descent (font_metrics); + font_height = PANGO_PIXELS (font_height); + + pango_font_metrics_unref (font_metrics); + } + + pango_font_description_free (font_desc); +} + + +void gtk_glwidget_print_string(const char *s) +{ + qglListBase(font_list_base); + qglCallLists(strlen(s), GL_UNSIGNED_BYTE, (unsigned char *)s); +} + +void gtk_glwidget_print_char(char s) +{ + qglListBase(font_list_base); + qglCallLists(1, GL_UNSIGNED_BYTE, (unsigned char *) &s); +} diff --git a/radiant/glwidget.h b/radiant/glwidget.h index 6d9ab361..582a5ddb 100644 --- a/radiant/glwidget.h +++ b/radiant/glwidget.h @@ -1,25 +1,45 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (c) 2001, Loki software, inc. +All rights reserved. -This file is part of GtkRadiant. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_GLWIDGET_H) -#define INCLUDED_GLWIDGET_H +#ifndef _GLWIDGET_H_ +#define _GLWIDGET_H_ -#endif +GtkWidget* WINAPI gtk_glwidget_new (gboolean zbufffer, GtkWidget* share); +void WINAPI gtk_glwidget_swap_buffers (GtkWidget *widget); +gboolean WINAPI gtk_glwidget_make_current (GtkWidget *widget); +void WINAPI gtk_glwidget_destroy_context (GtkWidget *widget); +void WINAPI gtk_glwidget_create_context (GtkWidget *widget); +void gtk_glwidget_create_font (GtkWidget *widget); + +void gtk_glwidget_print_string(const char *s); +void gtk_glwidget_print_char(char s); + + +#endif /* _GLWIDGET_H_ */ diff --git a/radiant/glwindow.cpp b/radiant/glwindow.cpp new file mode 100644 index 00000000..df6b0cf7 --- /dev/null +++ b/radiant/glwindow.cpp @@ -0,0 +1,287 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// GLWindow - Base class for the small views used by Radiant +// +// Leonardo Zide (leo@lokigames.com +// + +#include "stdafx.h" +#include "glwidget.h" +#include "glwindow.h" + +// ============================================================================= +// static functions + +static void realize (GtkWidget *widget, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + + wnd->OnCreate (); +} + +static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + +#ifndef _WIN32 + if (event->count > 0) + return TRUE; +#endif + + if (!g_pParentWnd->IsSleeping ()) + wnd->OnExpose (); + + return TRUE; +} + +static void button_press (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + guint32 flags = 0; + + gdk_pointer_grab (widget->window, FALSE, + (GdkEventMask)(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK), + NULL, NULL, GDK_CURRENT_TIME); + + gtk_window_set_focus (GTK_WINDOW (g_pParentWnd->m_pWidget), widget); + + switch (event->button) + { + case 1: flags |= MK_LBUTTON; break; + case 2: flags |= MK_MBUTTON; break; + case 3: flags |= MK_RBUTTON; break; +#if !GTK_CHECK_VERSION (1,3,0) + case 4: wnd->OnMouseWheel(true); break; + case 5: wnd->OnMouseWheel(false); break; +#endif + } + + if ((event->state & GDK_CONTROL_MASK) != 0) + flags |= MK_CONTROL; + + if ((event->state & GDK_SHIFT_MASK) != 0) + flags |= MK_SHIFT; + + if (event->type == GDK_BUTTON_PRESS) + { + switch (event->button) + { + case 1: + wnd->OnLButtonDown (flags, (int)event->x, (int)event->y); break; + case 2: + wnd->OnMButtonDown (flags, (int)event->x, (int)event->y); break; + case 3: + wnd->OnRButtonDown (flags, (int)event->x, (int)event->y); break; + } + } + else if (event->type == GDK_2BUTTON_PRESS) + { + // do nothing + } +} + +static void button_release (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + guint32 flags = 0; + + gdk_pointer_ungrab (GDK_CURRENT_TIME); + + if ((event->state & GDK_CONTROL_MASK) != 0) + flags |= MK_CONTROL; + + if ((event->state & GDK_SHIFT_MASK) != 0) + flags |= MK_SHIFT; + + switch (event->button) + { + case 1: + wnd->OnLButtonUp (flags, (int)event->x, (int)event->y); break; + case 2: + wnd->OnMButtonUp (flags, (int)event->x, (int)event->y); break; + case 3: + wnd->OnRButtonUp (flags, (int)event->x, (int)event->y); break; + } +} + +static void motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + guint32 flags = 0; + + if ((event->state & GDK_BUTTON1_MASK) != 0) + flags |= MK_LBUTTON; + + if ((event->state & GDK_BUTTON2_MASK) != 0) + flags |= MK_MBUTTON; + + if ((event->state & GDK_BUTTON3_MASK) != 0) + flags |= MK_RBUTTON; + + if ((event->state & GDK_CONTROL_MASK) != 0) + flags |= MK_CONTROL; + + if ((event->state & GDK_SHIFT_MASK) != 0) + flags |= MK_SHIFT; + + wnd->OnMouseMove (flags, (int)event->x, (int)event->y); +} + +static void resize (GtkWidget *widget, GtkAllocation *allocation, gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + wnd->OnSize (allocation->width, allocation->height); +} + +static gint timer (gpointer data) +{ + GLWindow *wnd = (GLWindow*)data; + wnd->OnTimer (); + + return TRUE; +} + +//! GtkGLExt port. +/* +static void create_context (GtkWidget *widget, gpointer data) +{ + if (g_qeglobals_gui.d_glBase == NULL) + g_qeglobals_gui.d_glBase = widget; +} + +static void destroy_context (GtkWidget *widget, gpointer data) +{ + if (g_qeglobals_gui.d_glBase == widget) + g_qeglobals_gui.d_glBase = NULL; +} +*/ + +#if GTK_CHECK_VERSION (1,3,0) +static gint scroll_event( GtkWidget *widget, + GdkEventScroll *event, + gpointer data ) +{ + GLWindow *wnd = (GLWindow*)data; + wnd->OnMouseWheel((event->direction == GDK_SCROLL_UP) ? true : false); + return TRUE; +} +#endif + +// ============================================================================= +// GLWindow class + +#ifdef _DEBUG +//#define DBG_GLWINDOW +#endif + +GLWindow::GLWindow (bool zbuffer) +{ + m_nTimer = 0; + m_bMouseCapture = FALSE; + m_pParent = NULL; + + m_pWidget = gtk_glwidget_new (zbuffer, g_qeglobals_gui.d_glBase); + GTK_WIDGET_SET_FLAGS (m_pWidget, GTK_CAN_FOCUS); + +#ifdef DBG_GLWINDOW + Sys_Printf("GLWindow::GLWindow m_pWidget = %p\n", m_pWidget); +#endif + +//! GtkGLExt port. +//#if defined (__linux__) || defined (__APPLE__) + if (g_qeglobals_gui.d_glBase == NULL) + g_qeglobals_gui.d_glBase = m_pWidget; +//#endif + +#if GTK_CHECK_VERSION (1,3,0) + gtk_widget_set_events (m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK); +#else + gtk_widget_set_events (m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK); +#endif + + // Connect signal handlers + gtk_signal_connect (GTK_OBJECT (m_pWidget), "realize", GTK_SIGNAL_FUNC (realize), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "expose_event", GTK_SIGNAL_FUNC (expose), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "motion_notify_event", GTK_SIGNAL_FUNC (motion), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "button_press_event", GTK_SIGNAL_FUNC (button_press), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "button_release_event",GTK_SIGNAL_FUNC (button_release), this); + gtk_signal_connect (GTK_OBJECT (m_pWidget), "size_allocate", GTK_SIGNAL_FUNC (resize), this); +//! GtkGLExt port. +// gtk_signal_connect (GTK_OBJECT (m_pWidget), "create_context", GTK_SIGNAL_FUNC (create_context), this); +// gtk_signal_connect (GTK_OBJECT (m_pWidget), "destroy_context", GTK_SIGNAL_FUNC (destroy_context), this); +#if GTK_CHECK_VERSION (1,3,0) + gtk_signal_connect (GTK_OBJECT (m_pWidget), "scroll_event", GTK_SIGNAL_FUNC (scroll_event), this); +#endif +} + +GLWindow::~GLWindow () +{ +#ifdef DBG_GLWINDOW + Sys_Printf("GLWindow::~GLWindow m_pWidget = %p\n", m_pWidget); +#endif + + if (m_pWidget && GTK_IS_WIDGET (m_pWidget)) + gtk_widget_destroy (m_pWidget); +} + +void GLWindow::DestroyContext () +{ + gtk_glwidget_destroy_context (m_pWidget); +} + +void GLWindow::CreateContext () +{ + gtk_glwidget_create_context (m_pWidget); +} + +void GLWindow::SetTimer (guint millisec) +{ + m_nTimer = gtk_timeout_add (millisec, timer, this); +} + +void GLWindow::KillTimer () +{ + gtk_timeout_remove (m_nTimer); + m_nTimer = 0; +} + +bool GLWindow::MakeCurrent () +{ + return gtk_glwidget_make_current (m_pWidget); +} + +void GLWindow::SwapBuffers () +{ + gtk_glwidget_swap_buffers (m_pWidget); +} diff --git a/radiant/glwindow.h b/radiant/glwindow.h new file mode 100644 index 00000000..a6bac087 --- /dev/null +++ b/radiant/glwindow.h @@ -0,0 +1,108 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _GLWINDOW_H_ +#define _GLWINDOW_H_ + +class GLWindow +{ + public: + GLWindow (bool zbuffer); + virtual ~GLWindow (); + + bool MakeCurrent (); + void SwapBuffers (); + void SetTimer (guint millisec); + void KillTimer (); + bool HasTimer () + { return m_nTimer != 0; } + void DestroyContext (); + void CreateContext (); + + virtual void OnCreate () { } + virtual void OnExpose () { } + + virtual void OnLButtonDown (guint32 flags, int x, int y) { } + virtual void OnRButtonDown (guint32 flags, int x, int y) { } + virtual void OnMButtonDown (guint32 flags, int x, int y) { } + virtual void OnLButtonUp (guint32 flags, int pointx, int pointy) { } + virtual void OnRButtonUp (guint32 flags, int pointx, int pointy) { } + virtual void OnMButtonUp (guint32 flags, int pointx, int pointy) { } + virtual void OnMouseMove (guint32 flags, int pointx, int pointy) { } + + + virtual void OnSize (int cx, int cy) { } + virtual void OnTimer () { } + + virtual void OnMouseWheel (bool bUp) { } + + void RedrawWindow () + { + gtk_widget_queue_draw(m_pWidget); + } + + void SetFocus () + { + /* gdk_window_raise (m_pWidget->window); */ + } + + void SetCapture () + { + m_bMouseCapture = TRUE; + } + + void ReleaseCapture () + { + m_bMouseCapture = FALSE; + } + + bool HasCapture () + { + return m_bMouseCapture; + } + + GtkWidget* GetWidget () + { + return m_pWidget; + } + + // member variables + public: + GtkWidget* m_pParent; // for floating windows only + + protected: + bool m_bMouseCapture; + GtkWidget* m_pWidget; + + private: + guint m_nTimer; // only one timer supported +}; + +#endif //_GLWINDOW_H_ diff --git a/radiant/grid.cpp b/radiant/grid.cpp deleted file mode 100644 index e93ce401..00000000 --- a/radiant/grid.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "grid.h" - -#include -#include -#include - -#include "preferencesystem.h" - -#include "gtkutil/widget.h" -#include "signal/signal.h" -#include "stringio.h" - -#include "gtkmisc.h" -#include "commands.h" -#include "preferences.h" - - - -Signal0 g_gridChange_callbacks; - -void AddGridChangeCallback(const SignalHandler& handler) -{ - g_gridChange_callbacks.connectLast(handler); - handler(); -} - -void GridChangeNotify() -{ - g_gridChange_callbacks(); -} - -enum GridPower -{ - GRIDPOWER_0125 = -3, - GRIDPOWER_025 = -2, - GRIDPOWER_05 = -1, - GRIDPOWER_1 = 0, - GRIDPOWER_2 = 1, - GRIDPOWER_4 = 2, - GRIDPOWER_8 = 3, - GRIDPOWER_16 = 4, - GRIDPOWER_32 = 5, - GRIDPOWER_64 = 6, - GRIDPOWER_128 = 7, - GRIDPOWER_256 = 8, -}; - - -typedef const char* GridName; -// this must match the GridPower enumeration -const GridName g_gridnames[] = { - "0.125", - "0.25", - "0.5", - "1", - "2", - "4", - "8", - "16", - "32", - "64", - "128", - "256", -}; - -inline GridPower GridPower_forGridDefault(int gridDefault) -{ - return static_cast(gridDefault - 3); -} - -inline int GridDefault_forGridPower(GridPower gridPower) -{ - return gridPower + 3; -} - -int g_grid_default = GridDefault_forGridPower(GRIDPOWER_8); - -int g_grid_power = GridPower_forGridDefault(g_grid_default); - -int Grid_getPower() -{ - return g_grid_power; -} - -inline float GridSize_forGridPower(int gridPower) -{ - return pow(2.0f, gridPower); -} - -float g_gridsize = GridSize_forGridPower(g_grid_power); - -float GetGridSize() -{ - return g_gridsize; -} - - -void setGridPower(GridPower power); - -class GridMenuItem -{ - GridPower m_id; - - GridMenuItem(const GridMenuItem& other); // NOT COPYABLE - GridMenuItem& operator=(const GridMenuItem& other); // NOT ASSIGNABLE -public: - ToggleItem m_item; - - GridMenuItem(GridPower id) : m_id(id), m_item(ExportCaller(*this)) - { - } - void set() - { - g_grid_power = m_id; - m_item.update(); - setGridPower(m_id); - } - typedef MemberCaller SetCaller; - void active(const BoolImportCallback& importCallback) - { - importCallback(g_grid_power == m_id); - } - typedef MemberCaller1 ExportCaller; -}; - -GridMenuItem g_gridMenu0125(GRIDPOWER_0125); -GridMenuItem g_gridMenu025(GRIDPOWER_025); -GridMenuItem g_gridMenu05(GRIDPOWER_05); -GridMenuItem g_gridMenu1(GRIDPOWER_1); -GridMenuItem g_gridMenu2(GRIDPOWER_2); -GridMenuItem g_gridMenu4(GRIDPOWER_4); -GridMenuItem g_gridMenu8(GRIDPOWER_8); -GridMenuItem g_gridMenu16(GRIDPOWER_16); -GridMenuItem g_gridMenu32(GRIDPOWER_32); -GridMenuItem g_gridMenu64(GRIDPOWER_64); -GridMenuItem g_gridMenu128(GRIDPOWER_128); -GridMenuItem g_gridMenu256(GRIDPOWER_256); - -void setGridPower(GridPower power) -{ - g_gridsize = GridSize_forGridPower(power); - - g_gridMenu0125.m_item.update(); - g_gridMenu025.m_item.update(); - g_gridMenu05.m_item.update(); - g_gridMenu1.m_item.update(); - g_gridMenu2.m_item.update(); - g_gridMenu4.m_item.update(); - g_gridMenu8.m_item.update(); - g_gridMenu16.m_item.update(); - g_gridMenu32.m_item.update(); - g_gridMenu64.m_item.update(); - g_gridMenu128.m_item.update(); - g_gridMenu256.m_item.update(); - GridChangeNotify(); -} - -void GridPrev() -{ - if(g_grid_power > GRIDPOWER_0125) - { - setGridPower(static_cast(--g_grid_power)); - } -} - -void GridNext() -{ - if(g_grid_power < GRIDPOWER_256) - { - setGridPower(static_cast(++g_grid_power)); - } -} - - -void Grid_registerCommands() -{ - GlobalCommands_insert("GridDown", FreeCaller(), Accelerator('[')); - GlobalCommands_insert("GridUp", FreeCaller(), Accelerator(']')); - - GlobalToggles_insert("SetGrid0.125", GridMenuItem::SetCaller(g_gridMenu0125), ToggleItem::AddCallbackCaller(g_gridMenu0125.m_item)); - GlobalToggles_insert("SetGrid0.25", GridMenuItem::SetCaller(g_gridMenu025), ToggleItem::AddCallbackCaller(g_gridMenu025.m_item)); - GlobalToggles_insert("SetGrid0.5", GridMenuItem::SetCaller(g_gridMenu05), ToggleItem::AddCallbackCaller(g_gridMenu05.m_item)); - GlobalToggles_insert("SetGrid1", GridMenuItem::SetCaller(g_gridMenu1), ToggleItem::AddCallbackCaller(g_gridMenu1.m_item), Accelerator('1')); - GlobalToggles_insert("SetGrid2", GridMenuItem::SetCaller(g_gridMenu2), ToggleItem::AddCallbackCaller(g_gridMenu2.m_item), Accelerator('2')); - GlobalToggles_insert("SetGrid4", GridMenuItem::SetCaller(g_gridMenu4), ToggleItem::AddCallbackCaller(g_gridMenu4.m_item), Accelerator('3')); - GlobalToggles_insert("SetGrid8", GridMenuItem::SetCaller(g_gridMenu8), ToggleItem::AddCallbackCaller(g_gridMenu8.m_item), Accelerator('4')); - GlobalToggles_insert("SetGrid16", GridMenuItem::SetCaller(g_gridMenu16), ToggleItem::AddCallbackCaller(g_gridMenu16.m_item), Accelerator('5')); - GlobalToggles_insert("SetGrid32", GridMenuItem::SetCaller(g_gridMenu32), ToggleItem::AddCallbackCaller(g_gridMenu32.m_item), Accelerator('6')); - GlobalToggles_insert("SetGrid64", GridMenuItem::SetCaller(g_gridMenu64), ToggleItem::AddCallbackCaller(g_gridMenu64.m_item), Accelerator('7')); - GlobalToggles_insert("SetGrid128", GridMenuItem::SetCaller(g_gridMenu128), ToggleItem::AddCallbackCaller(g_gridMenu128.m_item), Accelerator('8')); - GlobalToggles_insert("SetGrid256", GridMenuItem::SetCaller(g_gridMenu256), ToggleItem::AddCallbackCaller(g_gridMenu256.m_item), Accelerator('9')); -} - - -void Grid_constructMenu(GtkMenu* menu) -{ - create_check_menu_item_with_mnemonic(menu, "Grid0.125", "SetGrid0.125"); - create_check_menu_item_with_mnemonic(menu, "Grid0.25", "SetGrid0.25"); - create_check_menu_item_with_mnemonic(menu, "Grid0.5", "SetGrid0.5"); - create_check_menu_item_with_mnemonic(menu, "Grid1", "SetGrid1"); - create_check_menu_item_with_mnemonic(menu, "Grid2", "SetGrid2"); - create_check_menu_item_with_mnemonic(menu, "Grid4", "SetGrid4"); - create_check_menu_item_with_mnemonic(menu, "Grid8", "SetGrid8"); - create_check_menu_item_with_mnemonic(menu, "Grid16", "SetGrid16"); - create_check_menu_item_with_mnemonic(menu, "Grid32", "SetGrid32"); - create_check_menu_item_with_mnemonic(menu, "Grid64", "SetGrid64"); - create_check_menu_item_with_mnemonic(menu, "Grid128", "SetGrid128"); - create_check_menu_item_with_mnemonic(menu, "Grid256", "SetGrid256"); -} - -void Grid_registerShortcuts() -{ - command_connect_accelerator("ToggleGrid"); - command_connect_accelerator("GridDown"); - command_connect_accelerator("GridUp"); -} - -void Grid_constructPreferences(PreferencesPage& page) -{ - page.appendCombo( - "Default grid spacing", - g_grid_default, - ARRAY_RANGE(g_gridnames) - ); -} -void Grid_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Grid", "Grid Settings")); - Grid_constructPreferences(page); -} -void Grid_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - -void Grid_construct() -{ - Grid_registerPreferencesPage(); - - g_grid_default = GridDefault_forGridPower(GRIDPOWER_8); - - GlobalPreferenceSystem().registerPreference("GridDefault", IntImportStringCaller(g_grid_default), IntExportStringCaller(g_grid_default)); - - g_grid_power = GridPower_forGridDefault(g_grid_default); - g_gridsize = GridSize_forGridPower(g_grid_power); -} - -void Grid_destroy() -{ -} diff --git a/radiant/grid.h b/radiant/grid.h deleted file mode 100644 index cf2671e9..00000000 --- a/radiant/grid.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_GRID_H) -#define INCLUDED_GRID_H - -#include "signal/signalfwd.h" - -float GetGridSize(); -int Grid_getPower(); - -void AddGridChangeCallback(const SignalHandler& handler); - -void Grid_registerCommands(); -typedef struct _GtkMenu GtkMenu; -void Grid_constructMenu(GtkMenu* menu); - -void Grid_registerShortcuts(); - -void Grid_construct(); -void Grid_destroy(); - -#endif diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 1b89cc2f..d4570ff0 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,207 +26,1688 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // +#ifndef _WIN32 + #include +#endif +#include +#include "stdafx.h" #include "groupdialog.h" -#include "debugging/debugging.h" +GtkWidget* EntWidgets[EntLast]; +GtkListStore* g_entlist_store; +GtkListStore* g_entprops_store; +int inspector_mode; // W_TEXTURE, W_ENTITY, or W_CONSOLE +qboolean multiple_entities; +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=17 +qboolean disable_spawn_get = false; +entity_t *edit_entity; +/* +static GdkPixmap *tree_pixmaps[7]; +static GdkBitmap *tree_masks[7]; +*/ +#define IMG_PATCH 0 +#define IMG_BRUSH 1 +#define IMG_GROUP 2 +#define IMG_ENTITY 3 +#define IMG_ENTITYGROUP 4 +#define IMG_MODEL 5 +#define IMG_SCRIPT 6 -#include +// misc group support +#define MAX_GROUPS 4096 +#define GROUP_DELIMETER '@' +#define GROUPNAME "QER_Group_%i" -#include -#include -#include -#include +GroupDlg g_wndGroup; +GroupDlg *g_pGroupDlg = &g_wndGroup; -#include "gtkutil/widget.h" -#include "gtkutil/accelerator.h" -#include "entityinspector.h" -#include "gtkmisc.h" -#include "multimon.h" -#include "console.h" -#include "commands.h" +// group_t are loaded / saved through "group_info" entities +// they hold epairs for group settings and additionnal access info (tree nodes) +group_t *g_pGroups = NULL; +// the number of active spawnflags +static int spawnflag_count; +// table: index, match spawnflag item to the spawnflag index (i.e. which bit) +static int spawn_table[MAX_FLAGS]; +// we change the layout depending on how many spawn flags we need to display +// the table is a 4x4 in which we need to put the comment box EntWidgets[EntComment] and the spawn flags.. +static GtkWidget *LayoutTable; +// 0: none of them are hooked +// 1: only the text, 2: text and four checks, 3: text and 8 checks +static int widget_state = 0; -#include -#include "gtkutil/window.h" +static void entity_check (GtkWidget *widget, gpointer data); -class GroupDlg +// ============================================================================= +// Global functions + +/* +=============================================================== + +ENTITY WINDOW + +=============================================================== +*/ + +void FillClassList () { -public: - GtkWidget* m_pNotebook; - GtkWindow* m_window; + GtkListStore* store = g_entlist_store; - GroupDlg(); - void Create(GtkWindow* parent); + gtk_list_store_clear(store); - void Show() + for (eclass_t* e = eclass ; e ; e = e->next) { - // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event - m_position_tracker.sync(m_window); - gtk_widget_show(GTK_WIDGET(m_window)); - } - void Hide() - { - gtk_widget_hide(GTK_WIDGET(m_window)); - } - - WindowPositionTracker m_position_tracker; -}; - -namespace -{ - GroupDlg g_GroupDlg; - - std::size_t g_current_page; - std::vector g_pages; + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, e->name, 1, e, -1); + } } -void GroupDialog_updatePageTitle(GtkWindow* window, std::size_t pageIndex) +// SetKeyValuePairs +// +// Reset the key/value (aka property) listbox and fill it with the +// k/v pairs from the entity being edited. +// + +void SetKeyValuePairs (bool bClearMD3) { - if(pageIndex < g_pages.size()) + GtkListStore* store = g_entprops_store; + + gtk_list_store_clear(store); + + if (edit_entity == NULL) { - g_pages[pageIndex](PointerCaller1(window)); + // if there's no entity, then display no key/values + return; } -} -static gboolean switch_page(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data) -{ - GroupDialog_updatePageTitle(GTK_WINDOW(data), page_num); - g_current_page = page_num; + // save current key/val pair around filling epair box + // row_select wipes it and sets to first in list + Str strKey = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntKeyField])); + Str strVal = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntValueField])); - return FALSE; -} -GroupDlg::GroupDlg() : m_window(0) -{ - m_position_tracker.setPosition(c_default_window_pos); -} - -void GroupDlg::Create(GtkWindow* parent) -{ - ASSERT_MESSAGE(m_window == 0, "dialog already created"); - - GtkWindow* window = create_persistent_floating_window("Entities", parent); - - global_accel_connect_window(window); - - window_connect_focus_in_clear_focus_widget(window); - - m_window = window; - -#ifdef WIN32 - if( g_multimon_globals.m_bStartOnPrimMon ) + // Walk through list and add pairs + for(epair_t* epair = edit_entity->epairs ; epair ; epair = epair->next) { - WindowPosition pos(m_position_tracker.getPosition()); - PositionWindowOnPrimaryScreen(pos); - m_position_tracker.setPosition(pos); + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, epair->key, 1, epair->value, -1); } + + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), strKey.GetBuffer()); + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), strVal.GetBuffer()); + + Sys_UpdateWindows(W_CAMERA | W_XY); +} + +// SetSpawnFlags +// +// Update the checkboxes to reflect the flag state of the entity +// +void SetSpawnFlags(void) +{ + int f, i, v; + + disable_spawn_get = true; + + f = atoi(ValueForKey (edit_entity, "spawnflags")); + for (i=0 ; inext) + DeleteKey (b->owner, "spawnflags"); + } + else + DeleteKey (edit_entity, "spawnflags"); + } + else + { + sprintf (sz, "%i", f); + if (multiple_entities) + { + brush_t *b; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + SetKeyValue(b->owner, "spawnflags", sz); + } + else + SetKeyValue (edit_entity, "spawnflags", sz); + } + SetKeyValuePairs (); +} + +//#define DBG_UPDATESEL + +// UpdateSel +// +// Update the listbox, checkboxes and k/v pairs to reflect the new selection +// iIndex is the index in the list box with the class name, -1 if not found +bool UpdateSel(int iIndex, eclass_t *pec) +{ + int i, next_state; + brush_t *b; + + // syndrom of crappy code, we may get into stack overflowing crap with this function and Gtk + // if we play with the list of entity classes + // using a static flag to prevent recursion + static bool bBlockUpdate = false; + + if (bBlockUpdate) + return FALSE; // NOTE TTimo wtf is the return value for anyway? + +#ifdef DBG_UPDATESEL + Sys_FPrintf(SYS_WRN, "UpdateSel\n"); #endif - m_position_tracker.connect(window); + if (selected_brushes.next == &selected_brushes) { - GtkWidget* notebook = gtk_notebook_new(); - gtk_widget_show(notebook); - gtk_container_add (GTK_CONTAINER (window), notebook); - gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_BOTTOM); - m_pNotebook = notebook; - - g_signal_connect(G_OBJECT(notebook), "switch_page", G_CALLBACK(switch_page), window); - } -} - - -GtkWidget* GroupDialog_addPage(const char* tabLabel, GtkWidget* widget, const StringExportCallback& title) -{ - GtkWidget* w = gtk_label_new(tabLabel); - gtk_widget_show(w); - GtkWidget* page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), gtk_notebook_insert_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), widget, w, -1)); - g_pages.push_back(title); - - return page; -} - - -bool GroupDialog_isShown() -{ - return widget_is_visible(GTK_WIDGET(g_GroupDlg.m_window)); -} -void GroupDialog_setShown(bool shown) -{ - shown ? g_GroupDlg.Show() : g_GroupDlg.Hide(); -} -void GroupDialog_ToggleShow() -{ - GroupDialog_setShown(!GroupDialog_isShown()); -} - -void GroupDialog_constructWindow(GtkWindow* main_window) -{ - g_GroupDlg.Create(main_window); -} -void GroupDialog_destroyWindow() -{ - ASSERT_NOTNULL(g_GroupDlg.m_window); - destroy_floating_window(g_GroupDlg.m_window); - g_GroupDlg.m_window = 0; -} - - -GtkWindow* GroupDialog_getWindow() -{ - return g_GroupDlg.m_window; -} -void GroupDialog_show() -{ - g_GroupDlg.Show(); -} - -GtkWidget* GroupDialog_getPage() -{ - return gtk_notebook_get_nth_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), gint(g_current_page)); -} - -void GroupDialog_setPage(GtkWidget* page) -{ - g_current_page = gtk_notebook_page_num(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), page); - gtk_notebook_set_current_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), gint(g_current_page)); -} - -void GroupDialog_showPage(GtkWidget* page) -{ - if(GroupDialog_getPage() == page) - { - GroupDialog_ToggleShow(); + edit_entity = world_entity; + multiple_entities = false; } else { - gtk_widget_show(GTK_WIDGET(g_GroupDlg.m_window)); - GroupDialog_setPage(page); + edit_entity = selected_brushes.next->owner; + for (b=selected_brushes.next->next ; b != &selected_brushes ; b=b->next) + { + if (b->owner != edit_entity) + { + multiple_entities = true; + break; + } + } } -} -void GroupDialog_cycle() -{ - g_current_page = (g_current_page + 1) % g_pages.size(); - gtk_notebook_set_current_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), gint(g_current_page)); -} - -void GroupDialog_updatePageTitle(GtkWidget* page) -{ - if(GroupDialog_getPage() == page) + if (iIndex != -1) { - GroupDialog_updatePageTitle(g_GroupDlg.m_window, g_current_page); +#ifdef DBG_UPDATESEL + Sys_FPrintf(SYS_WRN,"Setting focus_row to %d\n", iIndex); +#endif + bBlockUpdate = true; + + GtkTreeView* view = GTK_TREE_VIEW(EntWidgets[EntList]); + GtkTreePath* path = gtk_tree_path_new(); + gtk_tree_path_append_index(path, iIndex); + gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); + gtk_tree_view_scroll_to_cell(view, path, NULL, FALSE, 0, 0); + gtk_tree_path_free(path); + + bBlockUpdate = false; + } + + if (pec == NULL) + return TRUE; + + // Set up the description + { + GtkTextBuffer* buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(EntWidgets[EntComment])); + gtk_text_buffer_set_text (buffer, pec->comments, -1); + } + + spawnflag_count = 0; + + // do a first pass to count the spawn flags, don't touch the widgets, we don't know in what state they are + for (i=0 ; iflagnames[i] && pec->flagnames[i][0] != 0 && strcmp(pec->flagnames[i],"-")) + { + spawn_table[spawnflag_count] = i; + spawnflag_count++; + } + } + + // what's new widget state + if (spawnflag_count==0) + next_state = 1; + else if (spawnflag_count<=4) + next_state = 2; + else if (spawnflag_count<=8) + next_state = 3; + else if (spawnflag_count<=12) + next_state = 4; + else + next_state = 5; + widget_state = next_state; + static int last_count = 0; + + // disable all remaining boxes + // NOTE: these boxes might not even be on display + for (i = 0; i < last_count; i++) + { + GtkWidget* widget = EntWidgets[EntCheck1+i]; + gtk_label_set_text (GTK_LABEL (GTK_BIN (widget)->child), " "); + gtk_widget_hide (widget); + gtk_widget_ref (widget); + gtk_container_remove (GTK_CONTAINER (LayoutTable), widget); + } + last_count = spawnflag_count; + + for (i=0 ; iflagnames[spawn_table[i]]; + str.MakeLower (); + +// gtk_table_attach (GTK_TABLE (LayoutTable), widget, i%4, i%4+1, i/4, i/4+1, + gtk_table_attach (GTK_TABLE (LayoutTable), widget, i%4, i%4+1, i/4, i/4+1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_widget_unref (widget); + + gtk_label_set_text (GTK_LABEL (GTK_BIN (widget)->child), str.GetBuffer ()); + } + + SetSpawnFlags(); + + SetKeyValuePairs(); + + return TRUE; +} + +bool UpdateEntitySel(eclass_t *pec) +{ +#ifdef DBG_UPDATESEL + Sys_FPrintf(SYS_WRN, "UpdateEntitySel\n"); +#endif + + GtkTreeModel* model = GTK_TREE_MODEL(g_entlist_store); + GtkTreeIter iter; + unsigned int i = 0; + for(gboolean good = gtk_tree_model_get_iter_first(model, &iter); good != FALSE; good = gtk_tree_model_iter_next(model, &iter)) + { + char* text; + gtk_tree_model_get(model, &iter, 0, &text, -1); + if (strcmp (text, pec->name) == 0) + { +#ifdef DBG_UPDATESEL + Sys_FPrintf(SYS_WRN, "found a match: %d %s\n", i, pec->name); +#endif + return UpdateSel (i, pec); + } + g_free(text); + ++i; + } + return UpdateSel (-1, pec); +} + +// CreateEntity +// +// Creates a new entity based on the currently selected brush and entity type. +// + +void CreateEntity(void) +{ + GtkTreeView* view = GTK_TREE_VIEW(EntWidgets[EntList]); + + // check to make sure we have a brush + if (selected_brushes.next == &selected_brushes) + { + gtk_MessageBox(g_pParentWnd->m_pWidget, "You must have a selected brush to create an entity", "info"); + return; + } + + // find out what type of entity we are trying to create + GtkTreeModel* model; + GtkTreeIter iter; + if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(view), &model, &iter) == FALSE) + { + gtk_MessageBox (g_pParentWnd->m_pWidget, "You must have a selected class to create an entity", "info"); + return; + } + + char* text; + gtk_tree_model_get(model, &iter, 0, &text, -1); + CreateEntityFromName(text, vec3_origin); + g_free(text); + + if (selected_brushes.next == &selected_brushes) + edit_entity = world_entity; + else + edit_entity = selected_brushes.next->owner; + + SetKeyValuePairs(); + Select_Deselect (); + Select_Brush (edit_entity->brushes.onext); + Sys_UpdateWindows(W_ALL); +} + +/* +=============== +AddProp + +=============== +*/ +void AddProp() +{ + if (edit_entity == NULL) + return; + + // Get current selection text + const char* key = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntKeyField])); + const char* value = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntValueField])); + + + // TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity + if (!strcmp(key, "classname") && !strcmp(value, "worldspawn")) + { + gtk_MessageBox(g_pParentWnd->m_pWidget, "Cannot change \"classname\" key back to worldspawn.", NULL, MB_OK ); + return; + } + + + // RR2DO2: we don't want spaces in entity keys + if (strstr( key, " " )) + { + gtk_MessageBox(g_pParentWnd->m_pWidget, "No spaces are allowed in entity keys.", NULL, MB_OK ); + return; + } + + if (multiple_entities) + { + brush_t *b; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + SetKeyValue(b->owner, key, value); + } + else + SetKeyValue(edit_entity, key, value); + + // refresh the prop listbox + SetKeyValuePairs(); + + +#ifdef USEPLUGINENTITIES + // if it's a plugin entity, perhaps we need to update some drawing parameters + // NOTE: perhaps moving this code to a seperate func would help if we need it in other places + // TODO: we need to call some update func in the IPluginEntity in case model name changes etc. + // ( for the moment only bounding brush is updated ), see UpdateModelBrush in Ritual's Q3Radiant + if (edit_entity->eclass->nShowFlags & ECLASS_PLUGINENTITY) + { + vec3_t mins, maxs; + edit_entity->pPlugEnt->GetBounds( mins, maxs ); + // replace old bounding brush by newly computed one + // NOTE: this part is similar to Entity_BuildModelBrush in Ritual's Q3Radiant, it can be + // usefull moved into a seperate func + brush_t *b,*oldbrush; + if (edit_entity->brushes.onext != &edit_entity->brushes) + oldbrush = edit_entity->brushes.onext; + b = Brush_Create (mins, maxs, &edit_entity->eclass->texdef); + Entity_LinkBrush (edit_entity, b); + Brush_Build( b, true ); + Select_Deselect(); + Brush_AddToList (edit_entity->brushes.onext, &selected_brushes); + if (oldbrush) + Brush_Free( oldbrush ); + } +#endif // USEPLUGINENTITIES +} + +/* +=============== +DelProp + +=============== +*/ +void DelProp(void) +{ + if (edit_entity == NULL) + return; + + // Get current selection text + const char* key = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntKeyField])); + + if (multiple_entities) + { + brush_t *b; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + DeleteKey(b->owner, key); + } + else + DeleteKey(edit_entity, key); + + // refresh the prop listbox + SetKeyValuePairs(); +} + +void ResetEntity () +{ + epair_t *pep; + int i; + + if (edit_entity == NULL) + return; + + if (multiple_entities) + { + brush_t *b; + + for (b=selected_brushes.next; b != &selected_brushes; b=b->next) + for (pep = b->owner->epairs; pep; ) + { + if (strcmp (pep->key, "classname") != 0) + { + DeleteKey (b->owner, pep->key); + pep = b->owner->epairs; + } + else + pep = pep->next; + } + } + else + for (pep = edit_entity->epairs; pep; ) + { + if (strcmp (pep->key, "classname") != 0) + { + DeleteKey (edit_entity, pep->key); + pep = edit_entity->epairs; + } + else + pep = pep->next; + } + + // refresh the dialog + SetKeyValuePairs (); + for (i = EntCheck1; i <= EntCheck16; i++) + gtk_signal_handler_block_by_func (GTK_OBJECT (EntWidgets[i]), GTK_SIGNAL_FUNC (entity_check), NULL); + SetSpawnFlags (); + for (i = EntCheck1; i <= EntCheck16; i++) + gtk_signal_handler_unblock_by_func (GTK_OBJECT (EntWidgets[i]), GTK_SIGNAL_FUNC (entity_check), NULL); +} + +bool GetSelectAllCriteria(CString &strKey, CString &strVal) +{ + GtkTreeModel* model; + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(EntWidgets[EntProps])), &model, &iter) + && (inspector_mode == W_ENTITY) + && GTK_WIDGET_VISIBLE (g_pGroupDlg->m_pWidget)) + { + strKey = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntKeyField])); + strVal = gtk_entry_get_text (GTK_ENTRY (EntWidgets[EntValueField])); + return TRUE; + } + return FALSE; +} + + +void AssignSound() +{ + char buffer[NAME_MAX]; + + strcpy (buffer, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat (buffer, "sound/"); + + if( access(buffer, R_OK) != 0 ) + { + // just go to fsmain + strcpy (buffer, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat (buffer, "/"); + } + + const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, "Open Wav File", buffer, "sound"); + if (filename != NULL) + { + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), "noise"); + char *aux = vfsExtractRelativePath (filename); + CString str; + if (aux) + str = aux; + else + { + Sys_FPrintf (SYS_WRN, "WARNING: could not extract the relative path, using full path instead\n"); + str = filename; + } + + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer()); + AddProp(); } } - -#include "preferencesystem.h" - -void GroupDialog_Construct() +void AssignModel() { - GlobalPreferenceSystem().registerPreference("EntityWnd", WindowPositionTrackerImportStringCaller(g_GroupDlg.m_position_tracker), WindowPositionTrackerExportStringCaller(g_GroupDlg.m_position_tracker)); + char buffer[NAME_MAX]; - GlobalCommands_insert("ViewEntityInfo", FreeCaller(), Accelerator('N')); + strcpy (buffer, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat (buffer, "models/"); + + if( access(buffer, R_OK) != 0 ) + { + // just go to fsmain + strcpy (buffer, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat (buffer, "/"); + } + + const char *filename = file_dialog (g_pGroupDlg->m_pWidget, TRUE, "Open Model", buffer, MODEL_MAJOR); + if (filename != NULL) + { + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), "model"); + // use VFS to get the correct relative path + char *aux = vfsExtractRelativePath (filename); + CString str; + if (aux) + str = aux; + else + { + Sys_FPrintf (SYS_WRN, "WARNING: could not extract the relative path, using full path instead\n"); + str = filename; + } + + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), str.GetBuffer()); + AddProp(); + edit_entity->brushes.onext->bModelFailed = false; + } } -void GroupDialog_Destroy() + +/* +============== +SetInspectorMode +============== +*/ +void SetInspectorMode(int iType) { + if (iType == W_GROUP) + gtk_MessageBox(g_pParentWnd->m_pWidget, "Brush grouping is not functional yet", NULL, MB_OK | MB_ICONWARNING ); + + if (!g_pParentWnd->FloatingGroupDialog() && + (iType == W_TEXTURE || iType == W_CONSOLE)) + return; + + // Is the caller asking us to cycle to the next window? + if (iType == -1) + { + if (inspector_mode == W_ENTITY) + iType = W_TEXTURE; + else if (inspector_mode == W_TEXTURE) + iType = W_CONSOLE; + else if (inspector_mode == W_CONSOLE) + iType = W_GROUP; + else + iType = W_ENTITY; + } + + switch(iType) + { + case W_ENTITY: + // entity is always first in the inspector + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), "Entities"); + gtk_notebook_set_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), 0); + break; + + case W_TEXTURE: + g_pParentWnd->GetTexWnd()->FocusEdit(); + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), "Textures"); + if (g_pParentWnd->FloatingGroupDialog()) + gtk_notebook_set_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), 1); + break; + + case W_CONSOLE: + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), "Console"); + if (g_pParentWnd->FloatingGroupDialog()) + gtk_notebook_set_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), 2); + break; + + case W_GROUP: + if (g_pParentWnd->FloatingGroupDialog()) + gtk_notebook_set_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), 3); + else + gtk_notebook_set_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), 1); + break; + + default: + break; + } } + +void Group_Add(entity_t *e) +{ + /* + group_t *g = (group_t*)qmalloc(sizeof(group_t)); + g->epairs = e->epairs; + g->next = NULL; + e->epairs = NULL; + + // create a new group node + char *text = ValueForKey(g->epairs, "group"); + g->itemOwner = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), g_wndGroup.m_hWorld, NULL, &text, 0, + tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], + tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], TRUE, TRUE); + g->next = g_pGroups; + g_pGroups = g; + */ +} +/* +group_t* Group_Alloc(char *name) +{ + group_t *g = (group_t*)qmalloc(sizeof(group_t)); + SetKeyValue( g->epairs, "group", name ); + return g; +} + +group_t* Group_ForName(const char * name) +{ + group_t *g = g_pGroups; + while (g != NULL) + { + if (strcmp( ValueForKey(g->epairs,"group"), name ) == 0) + break; + g = g->next; + } + return g; +} + +void Group_AddToItem(brush_t *b, GtkCTreeNode* item) +{ + int nImage = IMG_BRUSH; + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + const char *pName = NULL; + // const char *pNamed = Brush_GetKeyValue(b, "name"); + + if (!b->owner || (b->owner == world_entity)) + { + if (b->patchBrush) + { + pName = "Generic Patch"; + nImage = IMG_PATCH; + } + else + { + pName = "Generic Brush"; + nImage = IMG_BRUSH; + } + } + else + { + pName = b->owner->eclass->name; + if (b->owner->eclass->fixedsize) + { + nImage = IMG_ENTITY; + } + else + { + nImage = IMG_ENTITYGROUP; + } + } + + GtkCTreeNode *newItem; + int i = (b->patchBrush) ? IMG_PATCH : IMG_BRUSH; + newItem = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), item, NULL, (gchar**)&pName, 0, + tree_pixmaps[i], tree_masks[i], tree_pixmaps[i], + tree_masks[i], TRUE, TRUE); + gtk_ctree_node_set_row_data (GTK_CTREE (g_wndGroup.m_pTree), newItem, b); + b->itemOwner = newItem; +} +*/ +void Group_RemoveBrush(brush_t *b) +{ + /* + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + if (b->itemOwner) + { + gtk_ctree_remove_node (GTK_CTREE (g_pGroupDlg->m_pTree), b->itemOwner); + b->itemOwner = NULL; + } + DeleteKey(b->epairs, "group"); + */ +} +/* +void Group_AddToWorld(brush_t *b) +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + GtkCTreeNode *parent = gtk_ctree_node_nth (GTK_CTREE (g_pGroupDlg->m_pTree), 0); + Group_AddToItem(b, parent); +} +*/ +void Group_AddToProperGroup(brush_t *b) +{ + /* + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + + // NOTE: we do a local copy of the "group" key because it gets erased by Group_RemoveBrush + const char *pGroup = Brush_GetKeyValue(b, "group"); + // remove the entry in the tree if there's one + if (b->itemOwner) + { + gtk_ctree_remove_node (GTK_CTREE (g_pGroupDlg->m_pTree), b->itemOwner); + b->itemOwner = NULL; + } + + if (*pGroup != 0) + { + // find the item + group_t *g = Group_ForName(pGroup); + if (g) + Group_AddToItem(b, g->itemOwner); +#ifdef _DEBUG + else + Sys_Printf("WARNING: unexpected Group_ForName not found in Group_AddToProperGroup\n"); +#endif + } + else + { + Group_AddToWorld(b); + } + */ +} +/* +void Group_AddToSelected(brush_t *b) +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + GtkCTreeNode *item; + item = gtk_ctree_node_nth (GTK_CTREE (g_pGroupDlg->m_pTree), GTK_CLIST (g_pGroupDlg->m_pTree)->focus_row); + if (item == NULL) + { + item = gtk_ctree_node_nth (GTK_CTREE (g_pGroupDlg->m_pTree), 0); + } + Group_AddToItem(b, item); +} +*/ +/* +void Group_Save(FILE *f) +{ + group_t *g = g_pGroups; + while (g) + { + fprintf(f,"{\n\"classname\" \"group_info\"\n\"group\" \"%s\"\n}\n", ValueForKey( g->epairs, "group" )); + g = g->next; + } +} +*/ + +void Group_Init() +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + // start by cleaning everything + // clean the groups + //++timo FIXME: we leak, delete the groups on the way (I don't have time to do it now) +#ifdef _DEBUG + Sys_Printf("TODO: fix leak in Group_Init\n"); +#endif + group_t *g = g_pGroups; + while (g) + { + epair_t *ep,*enext; + for (ep = g->epairs ; ep ; ep=enext ) + { + enext = ep->next; + free (ep->key); + free (ep->value); + free (ep); + } + g = g->next; + } + /* + GtkCTreeNode *world; + char *text = "World"; + g_pGroups = NULL; + gtk_clist_clear (GTK_CLIST (g_wndGroup.m_pTree)); + world = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), NULL, NULL, &text, 0, + tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], tree_pixmaps[IMG_GROUP], + tree_masks[IMG_GROUP], FALSE, TRUE); + */ + // walk through all the brushes, remove the itemOwner key and add them back where they belong + brush_t *b; + for (b = active_brushes.next; b != &active_brushes; b = b->next) + { + b->itemOwner = NULL; + Group_AddToProperGroup(b); + } + for (b = selected_brushes.next ; b != &selected_brushes ; b = b->next) + { + b->itemOwner = NULL; + Group_AddToProperGroup(b); + } +} +/* +// scan through world_entity for groups in this map? +// we use GROUPNAME "QER_group_%i" to look for existing groups and their naming +//++timo FIXME: is this actually needed for anything? +void Group_GetListFromWorld(GSList **pArray) +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + + if (world_entity == NULL) + { + return; + } + + char cBuff[1024]; + for (int i =0; i < MAX_GROUPS; i++) + { + sprintf(cBuff, GROUPNAME, i); + char *pGroup = ValueForKey(world_entity, cBuff); + if (pGroup && strlen(pGroup) > 0) + { + *pArray = g_slist_append (*pArray, g_strdup (pGroup)); + } + else + { + break; + } + } +} + +void Group_RemoveListFromWorld() +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + return; + } + GSList* array = NULL; + Group_GetListFromWorld(&array); + + while (array) + { + DeleteKey(world_entity, (char*)array->data); + g_free (array->data); + array = g_slist_remove (array, array->data); + } +} + +int CountChar(const char *p, char c) +{ + int nCount = 0; + int nLen = strlen(p)-1; + while (nLen-- >= 0) + { + if (p[nLen] == c) + { + nCount++; + } + } + return nCount; +} +*/ +// ============================================================================= +// callbacks + +static void eclasslist_selection_changed(GtkTreeSelection* selection, gpointer data) +{ + GtkTreeModel* model; + GtkTreeIter selected; + // no world entity, we are not ready yet + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=917 + if( !world_entity ) { + return; + } + if(gtk_tree_selection_get_selected(selection, &model, &selected)) + { + eclass_t* eclass; + gtk_tree_model_get(model, &selected, 1, &eclass, -1); + if(eclass != NULL) + { + GtkTreePath* path = gtk_tree_model_get_path(model, &selected); + UpdateSel(gtk_tree_path_get_indices(path)[0], eclass); + gtk_tree_path_free(path); + } + } +} + +static gint eclasslist_button_press (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + if (event->type == GDK_2BUTTON_PRESS) + { + CreateEntity (); + return TRUE; + } + return FALSE; +} + +static gint eclasslist_keypress (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ + unsigned int code = gdk_keyval_to_upper (event->keyval); + + if (event->keyval == GDK_Return) + { + CreateEntity (); + return TRUE; + } + + // select the entity that starts with the key pressed + if (code <= 'Z' && code >= 'A') + { + GtkTreeView* view = GTK_TREE_VIEW(EntWidgets[EntList]); + GtkTreeModel* model; + GtkTreeIter iter; + if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(view), &model, &iter) == FALSE + || gtk_tree_model_iter_next(model, &iter) == FALSE) + { + gtk_tree_model_get_iter_first(model, &iter); + } + + for(unsigned int count = gtk_tree_model_iter_n_children(model, NULL); count > 0; --count) + { + char* text; + gtk_tree_model_get(model, &iter, 0, &text, -1); + + if (toupper (text[0]) == (int)code) + { + GtkTreePath* path = gtk_tree_model_get_path(model, &iter); + gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path); + gtk_tree_view_scroll_to_cell(view, path, NULL, FALSE, 0, 0); + gtk_tree_path_free(path); + count = 1; + } + + g_free(text); + + if(gtk_tree_model_iter_next(model, &iter) == FALSE) + gtk_tree_model_get_iter_first(model, &iter); + } + + return TRUE; + } + return FALSE; +} + + +static void proplist_selection_changed(GtkTreeSelection* selection, gpointer data) +{ + // find out what type of entity we are trying to create + GtkTreeModel* model; + GtkTreeIter iter; + if(gtk_tree_selection_get_selected(selection, &model, &iter) == FALSE) + { + return; + } + + char* key; + char* val; + gtk_tree_model_get(model, &iter, 0, &key, 1, &val, -1); + + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), key); + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), val); + + g_free(key); + g_free(val); +} + +static void entity_check (GtkWidget *widget, gpointer data) +{ + if( !disable_spawn_get ) + GetSpawnFlags(); +} + +static void entitylist_angle (GtkWidget *widget, gpointer data) +{ + SetKeyValue (edit_entity, "angle", (char*)data); + SetKeyValuePairs (); +} + +static gint entityentry_keypress (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ + if (event->keyval == GDK_Tab) + { + if (widget == EntWidgets[EntKeyField]) + { + //gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), ""); + gtk_window_set_focus (GTK_WINDOW (g_pGroupDlg->m_pWidget), EntWidgets[EntValueField]); + } + else + gtk_window_set_focus (GTK_WINDOW (g_pGroupDlg->m_pWidget), EntWidgets[EntKeyField]); + + return TRUE; + } + else if (event->keyval == GDK_Return) + { + if (widget == EntWidgets[EntKeyField]) + { + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), ""); + gtk_window_set_focus (GTK_WINDOW (g_pGroupDlg->m_pWidget), EntWidgets[EntValueField]); + } + else + { + AddProp (); + } + return TRUE; + } + + return FALSE; +} +/* +// add a new group, put all selected brushes into the group +static void groupdlg_add (GtkWidget *widget, gpointer data) +{ + char* name = DoNameDlg ("New Group"); + + if (name != NULL) + { + // create a new group node + GtkCTreeNode *item; + item = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), g_pGroupDlg->m_hWorld, NULL, &name, 0, + tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], + tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], FALSE, TRUE); + + // create a new group + group_t *g = Group_Alloc (name); + g->itemOwner = item; + g->next = g_pGroups; + g_pGroups = g; + + // now add the selected brushes + // NOTE: it would be much faster to give the group_t for adding + // but Select_AddToGroup is the standard way for all other cases + Select_AddToGroup (name); + g_free (name); + } +} +*/ +static void switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data) +{ + char *text; + gtk_label_get(GTK_LABEL(gtk_notebook_get_tab_label(notebook, gtk_notebook_get_nth_page(notebook, page_num))), &text); + gtk_window_set_title (GTK_WINDOW (data), text); + + gpointer item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_misc_selectentitycolor"); + + if (g_pParentWnd->FloatingGroupDialog()) + { + switch (page_num) + { + case 0: inspector_mode = W_ENTITY; break; + case 1: inspector_mode = W_TEXTURE; break; + case 2: inspector_mode = W_CONSOLE; break; + default: inspector_mode = W_GROUP; break; + } + } + else + { + if (page_num == 0) + inspector_mode = W_ENTITY; + else + inspector_mode = W_GROUP; + } + + if (inspector_mode == W_ENTITY) + gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE); + else + gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE); +} + +// ============================================================================= +// GroupDlg class + +// NOTE: when a key is hit with group window focused, we catch in this handler but it gets propagated to mainframe too +// therefore the message will be intercepted and used as a ID_SELECTION_DESELECT +static gint OnDialogKey (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ +#ifdef DBG_PI + Sys_Printf("OnDialogKey\n"); +#endif + if ((event->keyval == GDK_Escape) && (g_pParentWnd->CurrentStyle() != MainFrame::eFloating)) + { + // toggle off the group view (whatever part of it is currently displayed) + // this used to be done with a g_pParentWnd->OnViewEntity(); but it had bad consequences + // http://fenris.lokigames.com/show_bug.cgi?id=2773 + widget_delete_hide (g_qeglobals_gui.d_entity); + return TRUE; + } + return FALSE; +} + +GroupDlg::GroupDlg () +{ + m_pWidget = NULL; + m_hWorld = NULL; +} + +#ifdef _WIN32 +extern void PositionWindowOnPrimaryScreen(window_position_t& position); +#endif + +void GroupDlg::Create () +{ + if (m_pWidget != NULL) + return; + + GtkWidget* dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posEntityWnd ); + } +#endif + load_window_pos (dlg, g_PrefsDlg.mWindowInfo.posEntityWnd); + + gtk_window_set_title (GTK_WINDOW (dlg), "Entities"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", GTK_SIGNAL_FUNC (widget_delete_hide), NULL); + // catch 'Esc' + gtk_signal_connect (GTK_OBJECT (dlg), "key_press_event", GTK_SIGNAL_FUNC (OnDialogKey), NULL); + gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (g_pParentWnd->m_pWidget)); + g_qeglobals_gui.d_entity = dlg; + + { + GtkWidget* notebook = gtk_notebook_new (); + gtk_widget_show (notebook); + gtk_container_add (GTK_CONTAINER (dlg), notebook); + gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_BOTTOM); + m_pNotebook = notebook; + + { + GtkWidget* vbox = gtk_vbox_new (FALSE, 2); + gtk_widget_show (vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); + + { + GtkWidget* label = gtk_label_new ("Entities"); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); + } + + { + GtkWidget* split1 = gtk_vpaned_new (); + gtk_box_pack_start (GTK_BOX (vbox), split1, TRUE, TRUE, 0); + gtk_widget_show (split1); + + { + GtkWidget* split2 = gtk_vpaned_new (); + gtk_paned_add1 (GTK_PANED (split1), split2); + gtk_widget_show (split2); + + g_object_set_data (G_OBJECT (dlg), "split1", split1); + g_object_set_data (G_OBJECT (dlg), "split2", split2); + + { + GtkWidget* vbox2 = gtk_vbox_new (FALSE, 2); + gtk_widget_show (vbox2); + gtk_paned_pack2 (GTK_PANED (split1), vbox2, FALSE, FALSE); + + { + GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scr); + gtk_paned_add1 (GTK_PANED (split2), scr); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + { + GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + g_signal_connect(G_OBJECT(view), "button_press_event", G_CALLBACK(eclasslist_button_press), NULL); + g_signal_connect(G_OBJECT(view), "key_press_event", G_CALLBACK(eclasslist_keypress), this); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Key", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(eclasslist_selection_changed), dlg); + } + + gtk_widget_show(view); + + gtk_container_add(GTK_CONTAINER (scr), view); + + g_object_unref(G_OBJECT(store)); + EntWidgets[EntList] = view; + g_entlist_store = store; + } + } + + { + GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scr); + gtk_paned_add2 (GTK_PANED (split2), scr); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + { + GtkWidget* text = gtk_text_view_new(); + gtk_widget_set_size_request(text, 0, -1); // allow shrinking + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD); + gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE); + gtk_widget_show (text); + gtk_container_add (GTK_CONTAINER (scr), text); + EntWidgets[EntComment] = text; + } + } + + { + // Spawnflags (4 colums wide max, or window gets too wide.) + GtkWidget* table = LayoutTable = gtk_table_new (4, 4, FALSE); + gtk_box_pack_start (GTK_BOX (vbox2), LayoutTable, FALSE, TRUE, 0); + gtk_widget_show(LayoutTable); + + for (int i = 0; i < MAX_FLAGS; i++) + { + GtkWidget* check = gtk_check_button_new_with_label (""); + gtk_widget_ref (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); + EntWidgets[EntCheck1+i] = check; + } + + //++timo cleanme: these flags where Q2 stuff + /* + check = gtk_check_button_new_with_label ("!Easy"); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); + gtk_table_attach (GTK_TABLE (table), check, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + EntWidgets[EntCheck17] = check; + + check = gtk_check_button_new_with_label ("!Medium"); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); + gtk_table_attach (GTK_TABLE (table), check, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + EntWidgets[EntCheck18] = check; + + check = gtk_check_button_new_with_label ("!Hard"); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); + gtk_table_attach (GTK_TABLE (table), check, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + EntWidgets[EntCheck19] = check; + + check = gtk_check_button_new_with_label ("!DeathMatch"); + gtk_widget_show (check); + gtk_signal_connect (GTK_OBJECT (check), "toggled", GTK_SIGNAL_FUNC (entity_check), NULL); + gtk_table_attach (GTK_TABLE (table), check, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + EntWidgets[EntCheck20] = check; + */ + } + + { + GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (vbox2), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + { + GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 1, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(proplist_selection_changed), dlg); + } + + gtk_widget_show(view); + + gtk_container_add(GTK_CONTAINER (scr), view); + + g_object_unref(G_OBJECT(store)); + + EntWidgets[EntProps] = view; + g_entprops_store = store; + } + } + } + + int x = g_PrefsDlg.mWindowInfo.nEntitySplit1; + if (x != -1) + { + gtk_paned_set_position (GTK_PANED (split1), x); + + while (gtk_events_pending ()) gtk_main_iteration (); + x = g_PrefsDlg.mWindowInfo.nEntitySplit2; + + if (x != -1) + gtk_paned_set_position (GTK_PANED (split2), x); + } + } + } + + { + GtkWidget* table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + { + GtkWidget* entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_events (entry, GDK_KEY_PRESS_MASK); + gtk_signal_connect (GTK_OBJECT (entry), "key_press_event", + GTK_SIGNAL_FUNC (entityentry_keypress), this); + EntWidgets[EntKeyField] = entry; + } + + { + GtkWidget* entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_events (entry, GDK_KEY_PRESS_MASK); + gtk_signal_connect (GTK_OBJECT (entry), "key_press_event", + GTK_SIGNAL_FUNC (entityentry_keypress), this); + EntWidgets[EntValueField] = entry; + } + + { + GtkWidget* label = gtk_label_new ("Value"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + } + + { + GtkWidget* label = gtk_label_new ("Key"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + } + } + + { + GtkWidget* hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + { + GtkWidget* table = gtk_table_new (3, 3, TRUE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, TRUE, 0); + + { + GtkWidget* button = gtk_button_new_with_label ("360"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"360"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("45"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"45"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("90"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"90"); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + + { + GtkWidget* button = gtk_button_new_with_label ("135"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"135"); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("180"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"180"); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("225"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"225"); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("270"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"270"); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("315"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"315"); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + } + } + + { + GtkWidget* vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0); + + { + GtkWidget* button = gtk_button_new_with_label ("Reset"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (ResetEntity), NULL); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("Up"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"-1"); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("Dn"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (entitylist_angle), (void *)"-2"); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + } + + { + GtkWidget* vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0); + + { + GtkWidget* button = gtk_button_new_with_label ("Del Key/Pair"); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (DelProp), NULL); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("Sound..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (AssignSound), NULL); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + + { + GtkWidget* button = gtk_button_new_with_label ("Model..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (AssignModel), NULL); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + } + } + } + } + + if (g_pParentWnd->FloatingGroupDialog()) + { + { + GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + gtk_widget_show (scr); + gtk_container_set_border_width (GTK_CONTAINER (scr), 3); + + { + GtkWidget* text = gtk_text_view_new (); + gtk_widget_set_size_request(text, 0, -1); // allow shrinking + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD); + gtk_text_view_set_editable (GTK_TEXT_VIEW(text), FALSE); + gtk_container_add (GTK_CONTAINER (scr), text); + gtk_widget_show (text); + g_qeglobals_gui.d_edit = text; + } + + { + GtkWidget* label = gtk_label_new ("Console"); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), scr, label); + } + } + } + + + //++timo NOTE: this part for grouping code, don't remove! (we'll put it back in sometime soon) + + /* + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); + + scr = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (vbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + + ctree = gtk_ctree_new (1, 0); + gtk_widget_show (ctree); + gtk_container_add (GTK_CONTAINER (scr), ctree); + gtk_clist_column_titles_hide (GTK_CLIST (ctree)); + m_pTree = ctree; + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("Add..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (groupdlg_add), NULL); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Edit..."); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Delete"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize (button, 60, -2); + + label = gtk_label_new ("Groups"); + gtk_widget_show (label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); + */ + inspector_mode = W_ENTITY; + // gtk_window_set_title (GTK_WINDOW (dlg), "Entities"); + m_pWidget = dlg; + /* + load_pixmap ("grouptree1.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[0], &tree_masks[0]); + load_pixmap ("grouptree2.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[1], &tree_masks[1]); + load_pixmap ("grouptree3.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[2], &tree_masks[2]); + load_pixmap ("grouptree4.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[3], &tree_masks[3]); + load_pixmap ("grouptree5.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[4], &tree_masks[4]); + load_pixmap ("grouptree6.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[5], &tree_masks[5]); + load_pixmap ("grouptree7.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[6], &tree_masks[6]); + + Group_Init(); +*/ + g_signal_connect (G_OBJECT (notebook), "switch_page", G_CALLBACK (switch_page), dlg); + } +} + diff --git a/radiant/groupdialog.h b/radiant/groupdialog.h index 92caffab..33e3640c 100644 --- a/radiant/groupdialog.h +++ b/radiant/groupdialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,30 +19,90 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_GROUPDIALOG_H) -#define INCLUDED_GROUPDIALOG_H +#ifndef _GROUPDIALOG_H_ +#define _GROUPDIALOG_H_ -#include "generic/callback.h" +#define DlgXBorder 5 +#define DlgYBorder 5 -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -void GroupDialog_Construct(); -void GroupDialog_Destroy(); - -void GroupDialog_constructWindow(GtkWindow* main_window); -void GroupDialog_destroyWindow(); -GtkWindow* GroupDialog_getWindow(); -void GroupDialog_show(); - -inline void RawStringExport(const char* string, const StringImportCallback& importer) +enum { - importer(string); -} -typedef ConstPointerCaller1 RawStringExportCaller; -GtkWidget* GroupDialog_addPage(const char* tabLabel, GtkWidget* widget, const StringExportCallback& title); + EntList, + EntComment, +// Spawnflags + EntCheck1, + EntCheck2, + EntCheck3, + EntCheck4, + EntCheck5, + EntCheck6, + EntCheck7, + EntCheck8, +// Extra Spawnflags for Halflife Support + EntCheck9, + EntCheck10, + EntCheck11, + EntCheck12, + EntCheck13, + EntCheck14, + EntCheck15, + EntCheck16, -void GroupDialog_showPage(GtkWidget* page); -void GroupDialog_updatePageTitle(GtkWidget* page); +/* + EntCheck17, + EntCheck18, + EntCheck19, + EntCheck20, +*/ + EntProps, + EntDir0, + EntDir45, + EntDir90, + EntDir135, + EntDir180, + EntDir225, + EntDir270, + EntDir315, + EntDirUp, + EntDirDown, + EntDelProp, + EntKeyLabel, + EntKeyField, + EntValueLabel, + EntValueField, + EntColor, + EntAssignSounds, + EntAssignModels, + EntTab, -#endif + EntLast, +}; + +// 17..20 where used for spawnflags (!Easy !Medium !Hard etc.), empty now.. +extern GtkWidget* EntWidgets[EntLast]; + +//extern int rgIds[EntLast]; + + +class GroupDlg +{ + public: + GroupDlg (); + void Create (); + + void Show () + { gtk_widget_show (m_pWidget); }; + void Hide () + { gtk_widget_hide (m_pWidget); }; + + public: + GtkWidget* m_pNotebook; + GtkWidget* m_pWidget; + GtkWidget* m_pTree; + GtkCTreeNode* m_hWorld; //leo: not used keeping because of the win32 version +}; + +extern GroupDlg *g_pGroupDlg; + +#endif // _GROUPDIALOG_H_ diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 1b1e5cc4..58006414 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -34,422 +34,2568 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "gtkdlgs.h" - -#include "debugging/debugging.h" -#include "version.h" -#include "aboutmsg.h" - -#include "igl.h" -#include "iscenegraph.h" -#include "iselection.h" - +#include "stdafx.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include "os/path.h" -#include "math/aabb.h" -#include "container/array.h" -#include "generic/static.h" -#include "stream/stringstream.h" -#include "convert.h" -#include "gtkutil/messagebox.h" -#include "gtkutil/image.h" +#ifdef _WIN32 +#include +#endif -#include "gtkmisc.h" -#include "brushmanip.h" -#include "build.h" -#include "qe3.h" -#include "texwindow.h" -#include "xywindow.h" -#include "mainframe.h" -#include "preferences.h" -#include "url.h" -#include "cmdlib.h" +#ifdef _WIN32 +#include +#endif +// ============================================================================= +// Color selection dialog +qboolean DoColor (int iIndex) +{ + static bool bColorOpen = false; + + if(bColorOpen) + { + Sys_FPrintf(SYS_WRN, "DoColor dialog is already open\n"); + return false; + } + + bColorOpen = true; + + if (color_dialog (g_pParentWnd->m_pWidget, g_qeglobals.d_savedinfo.colors[iIndex])) + { + /* + ** scale colors so that at least one component is at 1.0F + ** if this is meant to select an entity color + */ + if (iIndex == COLOR_ENTITY) + { + float largest = 0.0F; + + if ( g_qeglobals.d_savedinfo.colors[iIndex][0] > largest ) + largest = g_qeglobals.d_savedinfo.colors[iIndex][0]; + if ( g_qeglobals.d_savedinfo.colors[iIndex][1] > largest ) + largest = g_qeglobals.d_savedinfo.colors[iIndex][1]; + if ( g_qeglobals.d_savedinfo.colors[iIndex][2] > largest ) + largest = g_qeglobals.d_savedinfo.colors[iIndex][2]; + + if ( largest == 0.0F ) + { + g_qeglobals.d_savedinfo.colors[iIndex][0] = 1.0F; + g_qeglobals.d_savedinfo.colors[iIndex][1] = 1.0F; + g_qeglobals.d_savedinfo.colors[iIndex][2] = 1.0F; + } + else + { + float scaler = 1.0F / largest; + + g_qeglobals.d_savedinfo.colors[iIndex][0] *= scaler; + g_qeglobals.d_savedinfo.colors[iIndex][1] *= scaler; + g_qeglobals.d_savedinfo.colors[iIndex][2] *= scaler; + } + } + + Sys_UpdateWindows (W_ALL); + bColorOpen = false; + return true; + } + else { + bColorOpen = false; + return false; + } +} // ============================================================================= // Project settings dialog -class GameComboConfiguration +static void UpdateBSPCommandList (GtkWidget *dialog); + +static void DoProjectAddEdit (bool edit, GtkWidget *parent) { -public: - const char* basegame_dir; - const char* basegame; - const char* known_dir; - const char* known; - const char* custom; + GtkWidget *dlg, *vbox, *hbox, *label, *table, *button; + GtkWidget *cmd, *text; + int loop = 1, ret = IDCANCEL; - GameComboConfiguration() : - basegame_dir(g_pGameDescription->getRequiredKeyValue("basegame")), - basegame(g_pGameDescription->getRequiredKeyValue("basegamename")), - known_dir(g_pGameDescription->getKeyValue("knowngame")), - known(g_pGameDescription->getKeyValue("knowngamename")), - custom(g_pGameDescription->getRequiredKeyValue("unknowngamename")) - { - } -}; - -typedef LazyStatic LazyStaticGameComboConfiguration; - -inline GameComboConfiguration& globalGameComboConfiguration() -{ - return LazyStaticGameComboConfiguration::instance(); -} - - -struct gamecombo_t -{ - gamecombo_t(int _game, const char* _fs_game, bool _sensitive) - : game(_game), fs_game(_fs_game), sensitive(_sensitive) - {} - int game; - const char* fs_game; - bool sensitive; -}; - -gamecombo_t gamecombo_for_dir(const char* dir) -{ - if(string_equal(dir, globalGameComboConfiguration().basegame_dir)) - { - return gamecombo_t(0, "", false); - } - else if(string_equal(dir, globalGameComboConfiguration().known_dir)) - { - return gamecombo_t(1, dir, false); - } + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + if (edit) + gtk_window_set_title (GTK_WINDOW (dlg), "Edit Command"); else + gtk_window_set_title (GTK_WINDOW (dlg), "Add Command"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Menu text"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + label = gtk_label_new ("Command"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + text = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "text", text); + gtk_widget_show (text); + gtk_table_attach (GTK_TABLE (table), text, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (text, 300, -2); + + cmd = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "cmd", cmd); + gtk_widget_show (cmd); + gtk_table_attach (GTK_TABLE (table), cmd, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (cmd, 300, -2); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + if (edit) { - return gamecombo_t(string_empty(globalGameComboConfiguration().known_dir) ? 1 : 2, dir, true); - } -} - -gamecombo_t gamecombo_for_gamename(const char* gamename) -{ - if ((strlen(gamename) == 0) || !strcmp(gamename, globalGameComboConfiguration().basegame)) - { - return gamecombo_t(0, "", false); - } - else if (!strcmp(gamename, globalGameComboConfiguration().known)) - { - return gamecombo_t(1, globalGameComboConfiguration().known_dir, false); - } - else - { - return gamecombo_t(string_empty(globalGameComboConfiguration().known_dir) ? 1 : 2, "", true); - } -} - -inline void path_copy_clean(char* destination, const char* source) -{ - char* i = destination; - - while(*source != '\0') - { - *i++ = (*source == '\\') ? '/' : *source; - ++source; - } - - if(i != destination && *(i-1) != '/') - *(i++) = '/'; - - *i = '\0'; -} - - -struct GameCombo -{ - GtkComboBox* game_select; - GtkEntry* fsgame_entry; -}; - -gboolean OnSelchangeComboWhatgame(GtkWidget *widget, GameCombo* combo) -{ - const char *gamename; - { + GtkTreeView* view = GTK_TREE_VIEW (g_object_get_data (G_OBJECT(parent), "view")); + GtkTreeSelection* selection = gtk_tree_view_get_selection(view); GtkTreeIter iter; - gtk_combo_box_get_active_iter(combo->game_select, &iter); - gtk_tree_model_get(gtk_combo_box_get_model(combo->game_select), &iter, 0, (gpointer*)&gamename, -1); + GtkTreeModel* model; + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + char* key; + gtk_tree_model_get(model, &iter, 0, &key, -1); + const char* value = ValueForKey (g_qeglobals.d_project_entity, key); + gtk_entry_set_text (GTK_ENTRY (text), key); + gtk_entry_set_text (GTK_ENTRY (cmd), value); + g_free(key); + } } - gamecombo_t gamecombo = gamecombo_for_gamename(gamename); - - gtk_entry_set_text(combo->fsgame_entry, gamecombo.fs_game); - gtk_widget_set_sensitive(GTK_WIDGET(combo->fsgame_entry), gamecombo.sensitive); + gtk_grab_add (dlg); + gtk_widget_show (dlg); + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + const char* key = gtk_entry_get_text (GTK_ENTRY (text)); + const char* value = gtk_entry_get_text (GTK_ENTRY (cmd)); + + if (strlen (key) <= 0 || strlen (value) <= 0) + { + Sys_Printf ("Command not added\n"); + } + else + { + if (edit) + { + SetKeyValue (g_qeglobals.d_project_entity, key, value); + FillBSPMenu (); + } + else + { + if (key[0] == 'b' && key[1] == 's' && key[2] == 'p') + { + SetKeyValue (g_qeglobals.d_project_entity, key, value); + FillBSPMenu (); + } + else + Sys_Printf ("BSP commands must be preceded by \"bsp\""); + } + + UpdateBSPCommandList (parent); + } + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +static void UpdateBSPCommandList (GtkWidget *dialog) +{ + GtkListStore* store = GTK_LIST_STORE (g_object_get_data (G_OBJECT(dialog), "bsp_commands")); + + gtk_list_store_clear(store); + + for(epair_t* ep = g_qeglobals.d_project_entity->epairs; ep != NULL; ep = ep->next) + { + if(ep->key[0] == 'b' && ep->key[1] == 's' && ep->key[2] == 'p') + { + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, ep->key, -1); + } + } +} + +static void project_add (GtkWidget *widget, gpointer data) +{ + GtkWidget *dlg = GTK_WIDGET (data); + DoProjectAddEdit (false, dlg); + UpdateBSPCommandList (dlg); +} + +static void project_change (GtkWidget *widget, gpointer data) +{ + GtkWidget *dlg = GTK_WIDGET (data); + DoProjectAddEdit (true, dlg); + UpdateBSPCommandList (dlg); +} + +static void project_remove (GtkWidget *widget, gpointer data) +{ + GtkWidget* project = GTK_WIDGET(data); + + GtkTreeView* view = GTK_TREE_VIEW (g_object_get_data (G_OBJECT(project), "view")); + GtkTreeSelection* selection = gtk_tree_view_get_selection(view); + GtkTreeIter iter; + GtkTreeModel* model; + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + char* key; + gtk_tree_model_get(model, &iter, 0, &key, -1); + DeleteKey (g_qeglobals.d_project_entity, key); + g_free(key); + + char* index = gtk_tree_model_get_string_from_iter(model, &iter); + Sys_Printf ("Selected %s\n", index); + g_free(index); + + UpdateBSPCommandList(project); + FillBSPMenu(); + } +} + +static const char* sQ3ComboItem = "Quake III Arena"; +static const char* sTAComboItem = "Quake III: Team Arena"; +static const char* sModComboItem = "Custom Quake III modification"; +static const char* sWolfComboItem = "Return To Castle Wolfenstein"; +static const char* sWolfModComboItem = "Custom RTCW modification"; +static const char* sHLComboItem = "Half-life"; +static const char* sHLModComboItem = "Custom Half-life modification"; + +static const char* sWolfSPCombo = "Single Player mapping mode"; +static const char* sWolfMPCombo = "Multiplayer mapping mode"; + +// Arnout +// HARD-CODED ET HACK +static const char* sETComboItem = "Wolfenstein: Enemy Territory"; +static const char* sETModComboItem = "Custom ET modification"; + +// RIANT +// HARD-CODED JK2 HACK +static const char* sJK2ComboItem = "Jedi Knight II Outcast"; +static const char* sJK2ModComboItem = "Custom JK2 modification"; +static const char* sJK2SPCombo = "Single Player mapping mode"; +static const char* sJK2MPCombo = "Multiplayer mapping mode"; + +// TTimo +// HARD-CODED JA HACK +static const char* sJAComboItem = "Jedi Knight Jedi Academy"; +static const char* sJAModComboItem = "Custom JA modification"; +static const char* sJASPCombo = "Single Player mapping mode"; +static const char* sJAMPCombo = "Multiplayer mapping mode"; + +// RIANT +// HARD-CODED STVEF2 HACK +static const char* sSTVEFComboItem = "Star Trek Voyager : Elite Force"; +static const char* sSTVEFModComboItem = "Custom Elite Force modification"; +static const char* sSTVEFSPCombo = "Single Player mapping mode"; +static const char* sSTVEFMPCombo = "Holo Match mapping mode"; + +// RIANT +// HARD-CODED SOF2 HACK +static const char* sSOF2ComboItem = "Soldier of Fortune II - Double Helix"; +static const char* sSOF2ModComboItem = "Custom Sof2 modification"; +static const char* sSOF2SPCombo = "Single Player mapping mode"; +static const char* sSOF2MPCombo = "Multiplayer mapping mode"; + +static GtkWidget* game_select; // GTK_COMBO +static GtkEntry* fsgame_entry; + +gint OnSelchangeComboWhatgame (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + const char *dir = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(game_select)->entry)); + // HACK: Wolf + if (g_pGameDescription->mGameFile == "wolf.game") + { + if (!strcmp(dir,sWolfComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + + } + // HACK: ET + else if (g_pGameDescription->mGameFile == "et.game") + { + if (!strcmp(dir,sETComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + + } + else if (g_pGameDescription->mGameFile == "hl.game") + { + if (!strcmp(dir,sHLComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + + } + // RIANT + // HACK: JK2 + else if (g_pGameDescription->mGameFile == "jk2.game") + { + if (!strcmp(dir,sJK2ComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + } + // TTimo + // HACK: JA + else if (g_pGameDescription->mGameFile == "ja.game") + { + if (!strcmp(dir,sJAComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + } + // RIANT + // HACK: STVEF + else if (g_pGameDescription->mGameFile == "stvef.game") + { + if (!strcmp(dir,sSTVEFComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + } + // RIANT + // HACK: SOF2 + else if (g_pGameDescription->mGameFile == "sof2.game") + { + if (!strcmp(dir,sSOF2ComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + } + // QUAKE 3 + else + { + if (!strcmp(dir,sQ3ComboItem)) + { + // disable the fs_game text entry + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else if (!strcmp(dir,sTAComboItem)) + { + gtk_entry_set_text (fsgame_entry, "missionpack"); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), false); + } + else + { + gtk_entry_set_text (fsgame_entry, ""); + gtk_widget_set_sensitive(GTK_WIDGET(fsgame_entry), true); + } + } + + return TRUE; +} + +void DoProjectSettings () +{ + GtkWidget *project; + GtkWidget *frame, *label, *vbox, *table1, *table2, *button; + GtkWidget *brush; + GtkWidget *scr; + GtkWidget *base, *game; + GtkWidget *gamemode_combo; + GList *combo_list = (GList*)NULL; + + int loop = 1, ret = IDCANCEL; + + project = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (project), "Project Settings"); + gtk_signal_connect (GTK_OBJECT (project), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (project), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (project), "loop", &loop); + g_object_set_data (G_OBJECT (project), "ret", &ret); + gtk_window_set_default_size (GTK_WINDOW (project), 550, 400); + + table1 = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table1); + gtk_container_add (GTK_CONTAINER (project), table1); + gtk_container_set_border_width (GTK_CONTAINER (table1), 5); + gtk_table_set_row_spacings (GTK_TABLE (table1), 5); + gtk_table_set_col_spacings (GTK_TABLE (table1), 5); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_table_attach (GTK_TABLE (table1), vbox, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_table_attach (GTK_TABLE (table1), vbox, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + button = gtk_button_new_with_label ("Add..."); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (project_add), project); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Change..."); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (project_change), project); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Remove"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (project_remove), project); + gtk_widget_set_usize (button, 60, -2); + + frame = gtk_frame_new ("Misc settings"); + gtk_widget_show (frame); + gtk_table_attach (GTK_TABLE (table1), frame, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + brush = gtk_check_button_new_with_label ("Use brush primitives in MAP files (NOTE: experimental feature,\n" + "required by the texture tools plugin)"); + gtk_widget_show (brush); + gtk_container_add (GTK_CONTAINER (frame), brush); + gtk_container_set_border_width (GTK_CONTAINER (brush), 5); + + frame = gtk_frame_new ("Menu commands"); + gtk_widget_show (frame); + gtk_table_attach (GTK_TABLE (table1), frame, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_container_add (GTK_CONTAINER (frame), scr); + gtk_container_set_border_width (GTK_CONTAINER (scr), 5); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + + { + GtkListStore* store = gtk_list_store_new(1, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + + GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE); + + gtk_widget_show(view); + + g_object_set_data(G_OBJECT (project), "view", view); + g_object_set_data(G_OBJECT (project), "bsp_commands", store); + gtk_container_add(GTK_CONTAINER (scr), view); + + g_object_unref(G_OBJECT(store)); + } + + frame = gtk_frame_new ("Project settings"); + gtk_widget_show (frame); + gtk_table_attach (GTK_TABLE (table1), frame, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + // HACK: hardcoded game stuff + if (g_pGameDescription->mGameFile == "wolf.game" || + g_pGameDescription->mGameFile == "et.game" || + g_pGameDescription->mGameFile == "jk2.game" || + g_pGameDescription->mGameFile == "stvef.game" || + g_pGameDescription->mGameFile == "sof2.game" || + g_pGameDescription->mGameFile == "ja.game" ) + { + table2 = gtk_table_new (9, 2, FALSE); + } + else + { + table2 = gtk_table_new (8, 2, FALSE); + } + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (frame), table2); + gtk_container_set_border_width (GTK_CONTAINER (table2), 5); + gtk_table_set_row_spacings (GTK_TABLE (table2), 5); + gtk_table_set_col_spacings (GTK_TABLE (table2), 5); + + /* + fill in the game selection combo + HACK: hardcoded Q3/Wolf/HL switch + \todo that stuff would be faster to write with implementation of property bags and associated code to edit + */ + if (g_pGameDescription->mGameFile == "wolf.game") + { + combo_list = g_list_append (combo_list, (void *)sWolfComboItem); + combo_list = g_list_append (combo_list, (void *)sWolfModComboItem); + } + else if (g_pGameDescription->mGameFile == "et.game") + { + combo_list = g_list_append (combo_list, (void *)sETComboItem); + combo_list = g_list_append (combo_list, (void *)sETModComboItem); + } + else if (g_pGameDescription->mGameFile == "hl.game") + { + combo_list = g_list_append (combo_list, (void *)sHLComboItem); + combo_list = g_list_append (combo_list, (void *)sHLModComboItem); + } + // RIANT + // JK2 HACK + else if (g_pGameDescription->mGameFile == "jk2.game") + { + combo_list = g_list_append (combo_list, (void *)sJK2ComboItem); + combo_list = g_list_append (combo_list, (void *)sJK2ModComboItem); + } + // TTimo + // JA HACK + else if (g_pGameDescription->mGameFile == "ja.game") + { + combo_list = g_list_append (combo_list, (void *)sJAComboItem); + combo_list = g_list_append (combo_list, (void *)sJAModComboItem); + } + // RIANT + // STVEF HACK + else if (g_pGameDescription->mGameFile == "stvef.game") + { + combo_list = g_list_append (combo_list, (void *)sSTVEFComboItem); + combo_list = g_list_append (combo_list, (void *)sSTVEFModComboItem); + } + // RIANT + // SOF2 HACK A LA JK2 A LA WOLF + else if (g_pGameDescription->mGameFile == "sof2.game") + { + combo_list = g_list_append (combo_list, (void *)sSOF2ComboItem); + combo_list = g_list_append (combo_list, (void *)sSOF2ModComboItem); + } + else + { + // Q3 or default + combo_list = g_list_append (combo_list, (void *)sQ3ComboItem); + combo_list = g_list_append (combo_list, (void *)sTAComboItem); + combo_list = g_list_append (combo_list, (void *)sModComboItem); + } + + game_select = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (game_select), combo_list); + gtk_widget_show (game_select); + gtk_table_attach (GTK_TABLE (table2), game_select, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + gtk_signal_connect (GTK_OBJECT(GTK_COMBO (game_select)->entry), "changed", + GTK_SIGNAL_FUNC (OnSelchangeComboWhatgame), NULL); + + g_list_free (combo_list); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (game_select)->entry), FALSE); + + game = gtk_entry_new(); + fsgame_entry = GTK_ENTRY(game); + gtk_widget_show(game); + gtk_table_attach(GTK_TABLE(table2), game, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + /* + wolf specific: select MP or SP mode + */ + if (g_pGameDescription->mGameFile == "wolf.game") + { + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)sWolfSPCombo); + combo_list = g_list_append (combo_list, (void *)sWolfMPCombo); + + gamemode_combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (gamemode_combo), combo_list); + gtk_widget_show(gamemode_combo); + gtk_table_attach (GTK_TABLE (table2), gamemode_combo, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + g_list_free (combo_list); + combo_list = NULL; + + label = gtk_label_new ("Mapping mode"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + } + + // RIANT + // JK2 HACK + if (g_pGameDescription->mGameFile == "jk2.game") + { + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)sJK2SPCombo); + combo_list = g_list_append (combo_list, (void *)sJK2MPCombo); + + gamemode_combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (gamemode_combo), combo_list); + gtk_widget_show(gamemode_combo); + gtk_table_attach (GTK_TABLE (table2), gamemode_combo, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + g_list_free (combo_list); + combo_list = NULL; + + label = gtk_label_new ("Mapping mode"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + } + // TTimo + // JA HACK + if (g_pGameDescription->mGameFile == "ja.game") + { + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)sJASPCombo); + combo_list = g_list_append (combo_list, (void *)sJAMPCombo); + + gamemode_combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (gamemode_combo), combo_list); + gtk_widget_show(gamemode_combo); + gtk_table_attach (GTK_TABLE (table2), gamemode_combo, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + g_list_free (combo_list); + combo_list = NULL; + + label = gtk_label_new ("Mapping mode"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + } + // RIANT + // STVEF HACK + if (g_pGameDescription->mGameFile == "stvef.game") + { + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)sSTVEFSPCombo); + combo_list = g_list_append (combo_list, (void *)sSTVEFMPCombo); + + gamemode_combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (gamemode_combo), combo_list); + gtk_widget_show(gamemode_combo); + gtk_table_attach (GTK_TABLE (table2), gamemode_combo, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + g_list_free (combo_list); + combo_list = NULL; + + label = gtk_label_new ("Mapping mode"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + } + // RIANT + // SOF2 HACK + if (g_pGameDescription->mGameFile == "sof2.game") + { + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)sSOF2SPCombo); + combo_list = g_list_append (combo_list, (void *)sSOF2MPCombo); + + gamemode_combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (gamemode_combo), combo_list); + gtk_widget_show(gamemode_combo); + gtk_table_attach (GTK_TABLE (table2), gamemode_combo, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + g_list_free (combo_list); + combo_list = NULL; + + label = gtk_label_new ("Mapping mode"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + } + + /* + the usual stuff + */ + + base = gtk_entry_new (); + g_object_set_data (G_OBJECT (project), "base", base); + gtk_widget_show (base); + gtk_table_attach (GTK_TABLE (table2), base, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + + label = gtk_label_new ("basepath"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + + label = gtk_label_new ("Select mod"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + label = gtk_label_new ("fs_game"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table2), label, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + // Initialize fields + gtk_entry_set_text (GTK_ENTRY (base), ValueForKey (g_qeglobals.d_project_entity, "basepath")); + UpdateBSPCommandList (project); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (brush), (g_qeglobals.m_bBrushPrimitMode) ? TRUE : FALSE); + + // initialise the fs_game selection from the project settings into the dialog + const char *dir = ValueForKey (g_qeglobals.d_project_entity, "gamename"); + // HACK: hardcoded wolf stuff + if (g_pGameDescription->mGameFile == "wolf.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"main")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sWolfComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sWolfModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // HACK: hardcoded et stuff + if (g_pGameDescription->mGameFile == "et.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"etmain")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sETComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sETModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // HACK: hardcoded half-life stuff + else if (g_pGameDescription->mGameFile == "hl.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"valve")) + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sHLComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sHLModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // RIANT + // JK2 HACK + else if (g_pGameDescription->mGameFile == "jk2.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"base")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sJK2ComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sJK2ModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // TTimo + // JA HACK + else if (g_pGameDescription->mGameFile == "ja.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"base")) + { + // no fs_game set, we are running stock editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sJAComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sJAModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // RIANT + // STVEF2 HACK + else if (g_pGameDescription->mGameFile == "stvef.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"baseEf")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sSTVEFComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sSTVEFModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + // RIANT + // SOF2 HACK + else if (g_pGameDescription->mGameFile == "sof2.game") + { + if ((strlen(dir) == 0) || !stricmp(dir,"base")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sSOF2ComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sSOF2ModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + else + { + if ((strlen(dir) == 0) || !strcmp(dir,"baseq3")) + { + // no fs_game set, we are running stock Quake III Arena editing + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sQ3ComboItem); + gtk_entry_set_text (GTK_ENTRY (game), ""); + gtk_widget_set_sensitive(game, false); + } + else if (!strcmp(dir,"missionpack")) + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sTAComboItem); + gtk_entry_set_text (GTK_ENTRY (game), "missionpack"); + gtk_widget_set_sensitive(game, false); + } + else + { + // this is a custom mod + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (game_select)->entry), sModComboItem); + gtk_entry_set_text (GTK_ENTRY (game), dir); + gtk_widget_set_sensitive(game, true); + } + } + + // HACK: hardcoded wolf stuff + if (g_pGameDescription->mGameFile == "wolf.game") + { + const char *gamemode = ValueForKey (g_qeglobals.d_project_entity, "gamemode"); + if ((strlen(gamemode) == 0) || !strcmp(gamemode,"sp")) + { + // nothing set yet, or single player + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sWolfSPCombo); + } + else + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sWolfMPCombo); + } + } + + // JK2 HACK + else if (g_pGameDescription->mGameFile == "jk2.game") + { + const char *gamemode = ValueForKey (g_qeglobals.d_project_entity, "gamemode"); + if ((strlen(gamemode) == 0) || !strcmp(gamemode,"sp")) + { + // nothing set yet, or single player + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sJK2SPCombo); + } + else + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sJK2MPCombo); + } + } + // JA HACK + else if (g_pGameDescription->mGameFile == "ja.game") + { + const char *gamemode = ValueForKey (g_qeglobals.d_project_entity, "gamemode"); + if ((strlen(gamemode) == 0) || !strcmp(gamemode,"sp")) + { + // nothing set yet, or single player + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sJASPCombo); + } + else + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sJAMPCombo); + } + } + // STVEF HACK + else if (g_pGameDescription->mGameFile == "stvef.game") + { + const char *gamemode = ValueForKey (g_qeglobals.d_project_entity, "gamemode"); + if ((strlen(gamemode) == 0) || !strcmp(gamemode,"sp")) + { + // nothing set yet, or single player + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sSTVEFSPCombo); + } + else + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sSTVEFMPCombo); + } + } + // SOF2 HACK + else if (g_pGameDescription->mGameFile == "sof2.game") + { + const char *gamemode = ValueForKey (g_qeglobals.d_project_entity, "gamemode"); + if ((strlen(gamemode) == 0) || !strcmp(gamemode,"sp")) + { + // nothing set yet, or single player + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sSOF2SPCombo); + } + else + { + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gamemode_combo)->entry), sSOF2MPCombo); + } + } + + gtk_grab_add (project); + gtk_widget_show (project); + + g_pGameDescription->Dump(); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + char buf[1024]; + const char *r; + char *w; + + // convert path to unix format + for(r = gtk_entry_get_text (GTK_ENTRY (base)), w=buf; *r != '\0'; r++, w++) + *w = (*r == '\\') ? '/' : *r; + // add last slash + if(w != buf && *(w-1) != '/') *(w++) = '/'; + // terminate string + *w = '\0'; + SetKeyValue (g_qeglobals.d_project_entity, "basepath", buf); + + dir = gtk_entry_get_text (GTK_ENTRY (game)); + // Hack: hard coded wolf stuff + if (g_pGameDescription->mGameFile == "wolf.game") + { + if (!strlen(dir) || !stricmp(dir,"main")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + // Hack: hard coded ET stuff + else if (g_pGameDescription->mGameFile == "et.game") + { + if (!strlen(dir) || !stricmp(dir,"etmain")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + // Hack: hard coded Half-life stuff + else if (g_pGameDescription->mGameFile == "hl.game") + { + if (!strlen(dir) || !stricmp(dir,"valve")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + else if (g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game") + { + if (!strlen(dir) || !stricmp(dir,"base")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + // RIANT + // STVEF HACK + else if (g_pGameDescription->mGameFile == "stvef.game") + { + if (!strlen(dir) || !stricmp(dir,"baseEf")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + else + { + if (!strlen(dir) || !strcmp(dir,"baseq3")) + { + DeleteKey (g_qeglobals.d_project_entity, "gamename"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamename", dir); + } + } + + // HACK: hardcoded wolf stuff + if (g_pGameDescription->mGameFile == "wolf.game") + { + // read from gamemode_combo + const char *gamemode = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(gamemode_combo)->entry)); + if (!strlen(gamemode) || !strcmp(gamemode, sWolfSPCombo)) + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "sp"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "mp"); + } + } + + // RIANT + // JK2 HACK + if (g_pGameDescription->mGameFile == "jk2.game") + { + // read from gamemode_combo + const char *gamemode = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(gamemode_combo)->entry)); + if (!strlen(gamemode) || !strcmp(gamemode, sJK2SPCombo)) + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "sp"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "mp"); + } + } + // TTimo + // JA HACK + if (g_pGameDescription->mGameFile == "ja.game") + { + // read from gamemode_combo + const char *gamemode = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(gamemode_combo)->entry)); + if (!strlen(gamemode) || !strcmp(gamemode, sJASPCombo)) + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "sp"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "mp"); + } + } + + // RIANT + // STVEF HACK + if (g_pGameDescription->mGameFile == "stvef.game") + { + // read from gamemode_combo + const char *gamemode = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(gamemode_combo)->entry)); + if (!strlen(gamemode) || !strcmp(gamemode, sSTVEFSPCombo)) + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "sp"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "mp"); + } + } + + g_qeglobals.m_strHomeMaps = g_qeglobals.m_strHomeGame; + const char* str = ValueForKey(g_qeglobals.d_project_entity, "gamename"); + if(str[0] == '\0') str = g_pGameDescription->mBaseGame.GetBuffer(); + g_qeglobals.m_strHomeMaps += str; + g_qeglobals.m_strHomeMaps += '/'; + + // RIANT + // SOF2 HACK + if (g_pGameDescription->mGameFile == "sof2.game") + { + // read from gamemode_combo + const char *gamemode = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(gamemode_combo)->entry)); + if (!strlen(gamemode) || !strcmp(gamemode, sSOF2SPCombo)) + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "sp"); + } + else + { + SetKeyValue (g_qeglobals.d_project_entity, "gamemode", "mp"); + } + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (brush))) + g_qeglobals.m_bBrushPrimitMode = TRUE; + else + g_qeglobals.m_bBrushPrimitMode = FALSE; + + SetKeyValue(g_qeglobals.d_project_entity, "brush_primit", (g_qeglobals.m_bBrushPrimitMode ? "1" : "0" )); + + QE_SaveProject( g_PrefsDlg.m_strLastProject.GetBuffer() ); + } + + gtk_grab_remove (project); + gtk_widget_destroy (project); +} + +// ============================================================================= +// MapInfo dialog + +void DoMapInfo () +{ + static GtkWidget *dlg; + GtkWidget *vbox, *vbox2, *hbox, *table, *button, *label, *scr; + GtkWidget *brushes_entry, *entities_entry, *net_entry; + int loop = 1, ret = IDCANCEL; + + if (dlg != NULL) + return; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + load_window_pos(dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd); + + gtk_window_set_title (GTK_WINDOW (dlg), "Map Info"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + table = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + brushes_entry = gtk_entry_new (); + gtk_widget_show (brushes_entry); + gtk_table_attach (GTK_TABLE (table), brushes_entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (brushes_entry), FALSE); + + entities_entry = gtk_entry_new (); + gtk_widget_show (entities_entry); + gtk_table_attach (GTK_TABLE (table), entities_entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (entities_entry), FALSE); + + net_entry = gtk_entry_new (); + gtk_widget_show (net_entry); + gtk_table_attach (GTK_TABLE (table), net_entry, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (net_entry), FALSE); + + label = gtk_label_new ("Total Brushes"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Total Entities"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Net brush count\n(non entity)"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Close"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + label = gtk_label_new ("Entity breakdown"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (vbox), scr, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (scr), 5); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scr), GTK_SHADOW_IN); + + GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + + { + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(view), TRUE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Entity", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + gtk_tree_view_column_set_sort_column_id(column, 0); + } + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Count", renderer, "text", 1, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + gtk_tree_view_column_set_sort_column_id(column, 1); + } + + gtk_widget_show(view); + + gtk_container_add(GTK_CONTAINER (scr), view); + } + + // Initialize fields + int TotalBrushes = 0, TotalEntities = 0, Net = 0; + + for (brush_t* pBrush = active_brushes.next; pBrush != &active_brushes; pBrush = pBrush->next) + { + TotalBrushes++; + if (pBrush->owner == world_entity) + Net++; + } + + typedef struct + { + const char *name; + int count; + } map_t; + + GSList *l, *entitymap = NULL; + map_t *entry; + + for (entity_t* pEntity = entities.next; pEntity != &entities; pEntity=pEntity->next) + { + TotalEntities++; + bool add = true; + + for (l = entitymap; l; l = g_slist_next (l)) + { + entry = (map_t*)l->data; + + if (strcmp (entry->name, pEntity->eclass->name) == 0) + { + entry->count++; + add = false; + break; + } + } + + if (add) + { + entry = (map_t*)qmalloc (sizeof (map_t)); + entry->name = pEntity->eclass->name; + entry->count = 1; + entitymap = g_slist_append (entitymap, entry); + } + } + + while (entitymap) + { + entry = (map_t*)entitymap->data; + char tmp[16]; + sprintf (tmp, "%d", entry->count); + GtkTreeIter iter; + gtk_list_store_append(GTK_LIST_STORE(store), &iter); + gtk_list_store_set(GTK_LIST_STORE(store), &iter, 0, entry->name, 1, tmp, -1); + free (entry); + entitymap = g_slist_remove (entitymap, entry); + } + + g_object_unref(G_OBJECT(store)); + + char tmp[16]; + sprintf (tmp, "%d", TotalBrushes); + gtk_entry_set_text (GTK_ENTRY (brushes_entry), tmp); + sprintf (tmp, "%d", TotalEntities); + gtk_entry_set_text (GTK_ENTRY (entities_entry), tmp); + sprintf (tmp, "%d", Net); + gtk_entry_set_text (GTK_ENTRY (net_entry), tmp); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + // save before exit + save_window_pos(dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + dlg = NULL; +} + +// ============================================================================= +// Entity List dialog + +static void entitylist_select (GtkWidget *widget, gpointer data) +{ + GtkTreeView* view = GTK_TREE_VIEW(g_object_get_data (G_OBJECT (data), "entities")); + + GtkTreeSelection* selection = gtk_tree_view_get_selection(view); + + GtkTreeModel* model; + GtkTreeIter selected; + if(gtk_tree_selection_get_selected(selection, &model, &selected)) + { + entity_t* pEntity; + gtk_tree_model_get(model, &selected, 1, &pEntity, -1); + + if (pEntity) + { + for (epair_t* pEpair = pEntity->epairs; pEpair; pEpair = pEpair->next) + { + Select_Deselect (); + Select_Brush (pEntity->brushes.onext); + Sys_UpdateWindows(W_ALL); + } + } + } +} + +static gint entitylist_click (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + if (event->type == GDK_2BUTTON_PRESS) + { + entitylist_select (NULL, data); + return TRUE; + } return FALSE; } -class MappingMode +static void entitylist_selection_changed(GtkTreeSelection* selection, gpointer data) { -public: - bool do_mapping_mode; - const char* sp_mapping_mode; - const char* mp_mapping_mode; + GtkListStore* store = GTK_LIST_STORE (g_object_get_data (G_OBJECT (data), "keyvalues")); - MappingMode() : - do_mapping_mode(!string_empty(g_pGameDescription->getKeyValue("show_gamemode"))), - sp_mapping_mode("Single Player mapping mode"), - mp_mapping_mode("Multiplayer mapping mode") + gtk_list_store_clear(store); + + GtkTreeModel* model; + GtkTreeIter selected; + if(gtk_tree_selection_get_selected(selection, &model, &selected)) { - } -}; + entity_t* pEntity; + gtk_tree_model_get(model, &selected, 1, &pEntity, -1); -typedef LazyStatic LazyStaticMappingMode; - -inline MappingMode& globalMappingMode() -{ - return LazyStaticMappingMode::instance(); -} - -class ProjectSettingsDialog -{ -public: - GameCombo game_combo; - GtkComboBox* gamemode_combo; -}; - -GtkWindow* ProjectSettingsDialog_construct(ProjectSettingsDialog& dialog, ModalDialog& modal) -{ - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Project Settings", G_CALLBACK(dialog_delete_callback), &modal); - - { - GtkTable* table1 = create_dialog_table(1, 2, 4, 4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(table1)); + if (pEntity) { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_table_attach(table1, GTK_WIDGET(vbox), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); + for (epair_t* pEpair = pEntity->epairs; pEpair; pEpair = pEpair->next) { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &modal); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &modal); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); + GtkTreeIter appended; + gtk_list_store_append(store, &appended); + gtk_list_store_set(store, &appended, 0, pEpair->key, 1, pEpair->value, -1); } } + } +} + +void DoEntityList () +{ + static GtkWidget *dlg; + GtkWidget *vbox, *hbox, *hbox2, *button, *scr; + int loop = 1, ret = IDCANCEL; + + if (dlg != NULL) + return; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + load_window_pos (dlg, g_PrefsDlg.mWindowInfo.posEntityInfoWnd); + + gtk_window_set_title (GTK_WINDOW (dlg), "Entities"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (TRUE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (hbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + { + GtkTreeStore* store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + g_signal_connect(G_OBJECT(view), "button_press_event", G_CALLBACK(entitylist_click), dlg); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(entitylist_selection_changed), dlg); + } + + gtk_widget_show(view); + + gtk_container_add(GTK_CONTAINER (scr), view); + g_object_set_data (G_OBJECT (dlg), "entities", view); + { - GtkFrame* frame = create_dialog_frame("Project settings"); - gtk_table_attach(table1, GTK_WIDGET(frame), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); { - GtkTable* table2 = create_dialog_table((globalMappingMode().do_mapping_mode) ? 4 : 3, 2, 4, 4, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(table2)); + GtkTreeIter child; + gtk_tree_store_append(store, &child, NULL); + gtk_tree_store_set(store, &child, 0, world_entity->eclass->name, 1, world_entity, -1); + } + GSList *l, *entitymap = NULL; + typedef struct + { + GtkTreeIter node; + const char *name; + } map_t; + map_t *entry; + + for (entity_t* pEntity=entities.next; pEntity != &entities; pEntity=pEntity->next) + { + GtkTreeIter parent; + bool found = false; + + for (l = entitymap; l; l = g_slist_next (l)) { - GtkLabel* label = GTK_LABEL(gtk_label_new("Select mod")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table2, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - } - { - dialog.game_combo.game_select = GTK_COMBO_BOX(gtk_combo_box_new_text()); + entry = (map_t*)l->data; - gtk_combo_box_append_text(dialog.game_combo.game_select, globalGameComboConfiguration().basegame); - if(globalGameComboConfiguration().known[0] != '\0') - gtk_combo_box_append_text(dialog.game_combo.game_select, globalGameComboConfiguration().known); - gtk_combo_box_append_text(dialog.game_combo.game_select, globalGameComboConfiguration().custom); - - gtk_widget_show(GTK_WIDGET(dialog.game_combo.game_select)); - gtk_table_attach(table2, GTK_WIDGET(dialog.game_combo.game_select), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - g_signal_connect(G_OBJECT(dialog.game_combo.game_select), "changed", G_CALLBACK(OnSelchangeComboWhatgame), &dialog.game_combo); + if (strcmp (entry->name, pEntity->eclass->name) == 0) + { + parent = entry->node; + found = true; + break; + } } + if (!found) { - GtkLabel* label = GTK_LABEL(gtk_label_new("fs_game")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table2, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table2, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + gtk_tree_store_append(store, &parent, NULL); + gtk_tree_store_set(store, &parent, 0, pEntity->eclass->name, 1, NULL, -1); - dialog.game_combo.fsgame_entry = entry; - } + entry = (map_t*)malloc (sizeof(map_t)); + entitymap = g_slist_append (entitymap, entry); + entry->name = pEntity->eclass->name; + entry->node = parent; + } + + GtkTreeIter child; + gtk_tree_store_append(store, &child, &parent); + gtk_tree_store_set(store, &child, 0, pEntity->eclass->name, 1, pEntity, -1); + } + + while (entitymap) + { + free (entitymap->data); + entitymap = g_slist_remove (entitymap, entitymap->data); + } + } + + g_object_unref(G_OBJECT(store)); + } + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (vbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + + { + GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Key", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Value", renderer, "text", 1, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + gtk_widget_show(view); + + g_object_set_data(G_OBJECT(dlg), "keyvalues", store); + gtk_container_add(GTK_CONTAINER (scr), view); + + g_object_unref(G_OBJECT(store)); + } + + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0); - if(globalMappingMode().do_mapping_mode) + button = gtk_button_new_with_label ("Select"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (entitylist_select), dlg); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Close"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + save_window_pos (dlg, g_PrefsDlg.mWindowInfo.posMapInfoWnd); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + dlg = NULL; +} + +// ============================================================================= +// Rotate dialog + +static void rotatedlg_apply (GtkWidget *widget, gpointer data) +{ + GtkSpinButton *spin; + float f; + + spin = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (data), "x")); + f = gtk_spin_button_get_value_as_float (spin); + if (f != 0.0) + Select_RotateAxis(0,f); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 0.0f); // reset to 0 on Apply + + spin = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (data), "y")); + f = gtk_spin_button_get_value_as_float (spin); + if (f != 0.0) + Select_RotateAxis(1,f); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 0.0f); + + spin = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (data), "z")); + f = gtk_spin_button_get_value_as_float (spin); + if (f != 0.0) + Select_RotateAxis(2,f); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 0.0f); +} + +void DoRotateDlg () +{ + GtkWidget *dlg, *hbox, *vbox, *table, *label, *button; + GtkWidget *x, *y, *z; + GtkObject *adj; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Arbitrary rotation"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + table = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new (" X "); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new (" Y "); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new (" Z "); + + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + adj = gtk_adjustment_new (0, -359, 359, 1, 10, 10); + x = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + g_object_set_data (G_OBJECT (dlg), "x", x); + gtk_widget_show (x); + gtk_table_attach (GTK_TABLE (table), x, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (x, 60, -2); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (x), TRUE); + + adj = gtk_adjustment_new (0, -359, 359, 1, 10, 10); + y = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + g_object_set_data (G_OBJECT (dlg), "y", y); + gtk_widget_show (y); + gtk_table_attach (GTK_TABLE (table), y, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (y), TRUE); + + adj = gtk_adjustment_new (0, -359, 359, 1, 10, 10); + z = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + g_object_set_data (G_OBJECT (dlg), "z", z); + gtk_widget_show (z); + gtk_table_attach (GTK_TABLE (table), z, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (z), TRUE); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + button = gtk_button_new_with_label ("Apply"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (rotatedlg_apply), dlg); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + rotatedlg_apply (button, dlg); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Gamma dialog + +void DoGamma () +{ + GtkWidget *dlg, *vbox, *hbox, *label, *button, *entry; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Gamma"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); + + label = gtk_label_new ("0.0 is brightest\n1.0 is darkest"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); + + label = gtk_label_new ("You must restart for the\nsettings to take effect"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + // Initialize dialog + char buf[16]; + sprintf (buf, "%1.1f", g_qeglobals.d_savedinfo.fGamma); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + g_qeglobals.d_savedinfo.fGamma = g_strtod (gtk_entry_get_text (GTK_ENTRY (entry)), NULL); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Find Brush Dialog + +// helper function to walk through the active brushes only and drop the regioned out ones +bool WalkRegionBrush (brush_t **b, entity_t *e) +{ + brush_t *b2; + do + { + for(b2=active_brushes.next ; b2 != &active_brushes ; b2=b2->next) + { + if (b2==*b) + break; // this is an active brush + } + if (b2==&active_brushes) + { + // this is a regioned out brush + *b = (*b)->onext; + if (*b == &e->brushes) + { + Sys_Status ("No such brush", 0); + return false; + } + } + } while (b2==&active_brushes); + return true; +} + +void SelectBrush (int entitynum, int brushnum) +{ + entity_t *e; + brush_t *b; + int i; + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503 + // making this work when regioning is on too + + if (entitynum == 0) + e = world_entity; + else + { + e = entities.next; + while (--entitynum) + { + e = e->next; + if (e == &entities) + { + Sys_Status ("No such entity", 0); + return; + } + if (region_active) + { + // we need to make sure we walk to the next 'active' entity to have a valid --entitynum + // that is, find a brush that belongs to this entity in the active brushes + do { - GtkLabel* label = GTK_LABEL(gtk_label_new("Mapping mode")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table2, GTK_WIDGET(label), 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - gtk_combo_box_append_text(combo, globalMappingMode().sp_mapping_mode); - gtk_combo_box_append_text(combo, globalMappingMode().mp_mapping_mode); - - gtk_widget_show(GTK_WIDGET(combo)); - gtk_table_attach(table2, GTK_WIDGET(combo), 1, 2, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - dialog.gamemode_combo = combo; - } + for (b = active_brushes.next ; b != &active_brushes ; b=b->next) + { + if (b->owner == e) + break; // this is an active entity + } + if (b==&active_brushes) + { + // this is a regioned out entity + e = e->next; + // don't walk past the end either + if (e == &entities) + { + Sys_Status ("No such entity", 0); + return; + } + } + } while(b==&active_brushes); } } } - // initialise the fs_game selection from the project settings into the dialog - const char* dir = gamename_get(); - gamecombo_t gamecombo = gamecombo_for_dir(dir); - - gtk_combo_box_set_active(dialog.game_combo.game_select, gamecombo.game); - gtk_entry_set_text(dialog.game_combo.fsgame_entry, gamecombo.fs_game); - gtk_widget_set_sensitive(GTK_WIDGET(dialog.game_combo.fsgame_entry), gamecombo.sensitive); - - if(globalMappingMode().do_mapping_mode) + b = e->brushes.onext; + if (b == &e->brushes) { - const char *gamemode = gamemode_get(); - if (string_empty(gamemode) || string_equal(gamemode, "sp")) + Sys_Status ("No such brush", 0); + return; + } + if (region_active) + { + if (!WalkRegionBrush(&b, e)) + return; + } + + while (brushnum--) + { + b = b->onext; + if (b == &e->brushes) { - gtk_combo_box_set_active(dialog.gamemode_combo, 0); + Sys_Status ("No such brush", 0); + return; } - else + if (region_active) { - gtk_combo_box_set_active(dialog.gamemode_combo, 1); + if (!WalkRegionBrush(&b, e)) + return; } } - return window; + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + + Sys_UpdateWindows (W_ALL); + for (i = 0; i < 3; i++) + { + if (g_pParentWnd->GetXYWnd()) + g_pParentWnd->GetXYWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2; + + if (g_pParentWnd->GetXZWnd()) + g_pParentWnd->GetXZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2; + + if (g_pParentWnd->GetYZWnd()) + g_pParentWnd->GetYZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2; + } + + Sys_Status ("Selected", 0); } -void ProjectSettingsDialog_ok(ProjectSettingsDialog& dialog) +static void GetSelectionIndex (int *ent, int *brush) { - const char* dir = gtk_entry_get_text(dialog.game_combo.fsgame_entry); - - const char* new_gamename = path_equal(dir, globalGameComboConfiguration().basegame_dir) - ? "" - : dir; + brush_t *b, *b2; + entity_t *entity; - if(!path_equal(new_gamename, gamename_get())) + *ent = *brush = 0; + + b = selected_brushes.next; + if (b == &selected_brushes) + return; + + // find entity + if (b->owner != world_entity) { - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Changing Game Name"); - - EnginePath_Unrealise(); - - gamename_set(new_gamename); - - EnginePath_Realise(); + (*ent)++; + for (entity = entities.next; entity != &entities; entity=entity->next, (*ent)++) + ; } - if(globalMappingMode().do_mapping_mode) - { - // read from gamemode_combo - int active = gtk_combo_box_get_active(dialog.gamemode_combo); - if(active == -1 || active == 0) - { - gamemode_set("sp"); - } - else - { - gamemode_set("mp"); - } - } + // find brush + for (b2=b->owner->brushes.onext; b2 != b && b2 != &b->owner->brushes; b2=b2->onext, (*brush)++) + ; } -void DoProjectSettings() +void DoFind () { - if(ConfirmModified("Edit Project Settings")) + GtkWidget *dlg, *vbox, *hbox, *table, *label, *button, *entity, *brush; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Find Brush"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Entity number"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Brush number"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + entity = gtk_entry_new (); + gtk_widget_show (entity); + gtk_table_attach (GTK_TABLE (table), entity, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + brush = gtk_entry_new (); + gtk_widget_show (brush); + gtk_table_attach (GTK_TABLE (table), brush, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + // Initialize dialog + char buf[16]; + int ent, br; + + GetSelectionIndex (&ent, &br); + sprintf (buf, "%i", ent); + gtk_entry_set_text (GTK_ENTRY (entity), buf); + sprintf (buf, "%i", br); + gtk_entry_set_text (GTK_ENTRY (brush), buf); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) { - ModalDialog modal; - ProjectSettingsDialog dialog; - - GtkWindow* window = ProjectSettingsDialog_construct(dialog, modal); - - if(modal_dialog_show(window, modal) == eIDOK) - { - ProjectSettingsDialog_ok(dialog); - } - - gtk_widget_destroy(GTK_WIDGET(window)); + const char *entstr = gtk_entry_get_text (GTK_ENTRY (entity)); + const char *brushstr = gtk_entry_get_text (GTK_ENTRY (brush)); + SelectBrush (atoi(entstr), atoi(brushstr)); } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); } // ============================================================================= // Arbitrary Sides dialog -void DoSides (int type, int axis) +void DoSides (bool bCone, bool bSphere, bool bTorus) { - ModalDialog dialog; - GtkEntry* sides_entry; + GtkWidget *dlg, *vbox, *hbox, *button, *label, *entry; + int loop = 1, ret = IDCANCEL; - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Arbitrary sides", G_CALLBACK(dialog_delete_callback), &dialog); + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Arbitrary sides"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + label = gtk_label_new ("Sides:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Sides:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry), FALSE, FALSE, 0); - sides_entry = entry; - gtk_widget_grab_focus(GTK_WIDGET(entry)); - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - } + const char *str = gtk_entry_get_text (GTK_ENTRY (entry)); + + if (bCone) + Brush_MakeSidedCone(atoi(str)); + else if (bSphere) + Brush_MakeSidedSphere(atoi(str)); + else + Brush_MakeSided (atoi(str)); } - if(modal_dialog_show(window, dialog) == eIDOK) - { - const char *str = gtk_entry_get_text(sides_entry); + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} - Scene_BrushConstructPrefab(GlobalSceneGraph(), (EBrushPrefab)type, atoi(str), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); +// ============================================================================= +// New Patch dialog + +void DoNewPatchDlg () +{ + GtkWidget *dlg, *hbox, *table, *vbox, *label, *button, *combo; + GtkWidget *width, *height; + GList *combo_list = (GList*)NULL; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Patch density"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Width:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Height:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + combo_list = g_list_append (combo_list, (void *)"3"); + combo_list = g_list_append (combo_list, (void *)"5"); + combo_list = g_list_append (combo_list, (void *)"7"); + combo_list = g_list_append (combo_list, (void *)"9"); + combo_list = g_list_append (combo_list, (void *)"11"); + combo_list = g_list_append (combo_list, (void *)"13"); + combo_list = g_list_append (combo_list, (void *)"15"); + + combo = gtk_combo_new (); + width = GTK_COMBO (combo)->entry; + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + combo = gtk_combo_new (); + height = GTK_COMBO (combo)->entry; + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + // Initialize dialog + g_list_free (combo_list); + gtk_entry_set_text (GTK_ENTRY (width), "3"); + gtk_entry_set_editable (GTK_ENTRY (width), FALSE); + gtk_entry_set_text (GTK_ENTRY (height), "3"); + gtk_entry_set_editable (GTK_ENTRY (height), FALSE); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + const char* w = gtk_entry_get_text (GTK_ENTRY (width)); + const char* h = gtk_entry_get_text (GTK_ENTRY (height)); + + Patch_GenericMesh(atoi (w), atoi (h), g_pParentWnd->ActiveXY ()->GetViewType ()); + Sys_UpdateWindows (W_ALL); } - gtk_widget_destroy(GTK_WIDGET(window)); + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// New Patch dialog + +void DoScaleDlg () +{ + GtkWidget *dlg, *hbox, *table, *vbox, *label, *button; + GtkWidget *x, *y, *z; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Scale"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + table = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("X:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Y:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Z:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + x = gtk_entry_new (); + gtk_widget_show (x); + gtk_table_attach (GTK_TABLE (table), x, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + y = gtk_entry_new (); + gtk_widget_show (y); + gtk_table_attach (GTK_TABLE (table), y, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + z = gtk_entry_new (); + gtk_widget_show (z); + gtk_table_attach (GTK_TABLE (table), z, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + // Initialize dialog + gtk_entry_set_text (GTK_ENTRY (x), "1.0"); + gtk_entry_set_text (GTK_ENTRY (y), "1.0"); + gtk_entry_set_text (GTK_ENTRY (z), "1.0"); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + float sx, sy, sz; + sx = atof (gtk_entry_get_text (GTK_ENTRY (x))); + sy = atof (gtk_entry_get_text (GTK_ENTRY (y))); + sz = atof (gtk_entry_get_text (GTK_ENTRY (z))); + + if (sx > 0 && sy > 0 && sz > 0) + { + Select_Scale(sx, sy, sz); + Sys_UpdateWindows (W_ALL); + } + else + Sys_Printf("Warning.. Tried to scale by a zero value."); + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Thicken Patch dialog + +void DoThickenDlg () +{ + GtkWidget *dlg, *vbox, *hbox, *vbox2, *button, *label; + GtkWidget *amount, *seams, *group; + int loop = 1, ret = IDCANCEL; + static qboolean bGroupResult = true; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Thicken Patch"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + label = gtk_label_new ("This produces a set of patches\n" + "that contains the original patch along with the\n" + "'thick' patch and an optimal set of seam patches."); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + label = gtk_label_new ("Amount:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + amount = gtk_entry_new (); + gtk_widget_show (amount); + gtk_box_pack_start (GTK_BOX (hbox), amount, FALSE, FALSE, 0); + + seams = gtk_check_button_new_with_label ("Seams"); + gtk_widget_show (seams); + gtk_box_pack_start (GTK_BOX (hbox), seams, FALSE, FALSE, 0); + + // bGroupResult + group = gtk_check_button_new_with_label("Result to func_group"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(group), bGroupResult); + gtk_box_pack_start(GTK_BOX(vbox), group, FALSE, FALSE, 0); + gtk_widget_show(group); + + + // Initialize dialog + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (seams), TRUE); + gtk_entry_set_text (GTK_ENTRY (amount), "8"); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group))) + bGroupResult = true; + else + bGroupResult = false; + Patch_Thicken (atoi (gtk_entry_get_text (GTK_ENTRY (amount))), + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (seams)), bGroupResult); + Sys_UpdateWindows (W_ALL); + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); } // ============================================================================= @@ -457,279 +2603,1082 @@ void DoSides (int type, int axis) void about_button_changelog (GtkWidget *widget, gpointer data) { - StringOutputStream log(256); - log << AppPath_get() << "changelog.txt"; - OpenURL(log.c_str()); + Str log; + log = g_strAppPath; + log += "changelog.txt"; + OpenURL(log.GetBuffer()); } void about_button_credits (GtkWidget *widget, gpointer data) { - StringOutputStream cred(256); - cred << AppPath_get() << "credits.html"; - OpenURL(cred.c_str()); + Str cred; + cred = g_strAppPath; + cred += "credits.html"; + OpenURL(cred.GetBuffer()); } -void DoAbout() +void DoAbout () { - ModalDialog dialog; - ModalDialogButton ok_button(dialog, eIDOK); + GtkWidget *dlg, *vbox, *vbox2, *hbox, *frame, *table, *label, *pixmap, *button, *sc_extensions, *text_extensions; + int loop = 1, ret = IDCANCEL; - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), "About GtkRadiant", dialog); + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "About GtkRadiant"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 10); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, FALSE, 0); + + frame = gtk_frame_new ((char*)NULL); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "logo.bmp"); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (frame), pixmap); + + label = gtk_label_new ("GtkRadiant " RADIANT_VERSION "\n" + __DATE__ "\n\n" + RADIANT_ABOUTMSG "\n\n" + "By qeradiant.com\n\n" + "This product contains software technology\n" + "from id Software, Inc. ('id Technology').\n" + "id Technology 2000 id Software,Inc.\n\n" + "GtkRadiant is unsupported, however\n" + "you may report your problems at\n" + "http://zerowing.idsoftware.com/bugzilla" + ); + + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + + button = gtk_button_new_with_label ("Credits"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (about_button_credits), NULL); + + button = gtk_button_new_with_label ("Changelog"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (about_button_changelog), NULL); + + frame = gtk_frame_new ("OpenGL Properties"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); + + table = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + gtk_container_set_border_width (GTK_CONTAINER (table), 5); + + label = gtk_label_new ("Vendor:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Version:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Renderer:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ((char*)qglGetString (GL_VENDOR)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ((char*)qglGetString (GL_VERSION)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ((char*)qglGetString (GL_RENDERER)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + frame = gtk_frame_new ("OpenGL Extensions"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (frame), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + sc_extensions = gtk_scrolled_window_new(NULL, NULL); + gtk_box_pack_start(GTK_BOX(hbox), sc_extensions, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sc_extensions), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sc_extensions), GTK_SHADOW_IN); + gtk_widget_show(sc_extensions); + + text_extensions = gtk_text_view_new(); + gtk_text_view_set_editable(GTK_TEXT_VIEW(text_extensions), FALSE); + gtk_container_add (GTK_CONTAINER (sc_extensions), text_extensions); + GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_extensions)); + gtk_text_buffer_set_text(buffer, (char *)qglGetString(GL_EXTENSIONS), -1); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_extensions), GTK_WRAP_WORD);; + gtk_widget_show(text_extensions); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Command List dialog + +void DoCommandListDlg () +{ + GtkWidget *dlg, *vbox, *hbox, *scr, *button; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Mapped Commands"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + gtk_window_set_default_size (GTK_WINDOW (dlg), 400, 400); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (hbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scr), GTK_SHADOW_IN); { - GtkVBox* vbox = create_dialog_vbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); + GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); { - GtkHBox* hbox = create_dialog_hbox(4); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, TRUE, 0); + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Command", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Key", renderer, "text", 1, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + gtk_widget_show(view); + gtk_container_add(GTK_CONTAINER (scr), view); + + { + // Initialize dialog + CString path; + path = g_strTempPath; + path += "commandlist.txt"; + + GSList *cmds = NULL; + int n; + + for (n = 0; n < g_nCommandCount; n++) + cmds = g_slist_append (cmds, g_Commands[n].m_strCommand); + cmds = g_slist_sort (cmds, (gint (*)(const void *, const void *))strcmp); + + Sys_Printf("Writing the command list to %s", path.GetBuffer() ); + FILE* fileout = fopen (path.GetBuffer (), "wt"); + + while (cmds) { - GtkVBox* vbox2 = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox2), TRUE, FALSE, 0); + for (n = 0; n < g_nCommandCount; n++) + if (cmds->data == g_Commands[n].m_strCommand) + break; + + char c = g_Commands[n].m_nKey; + CString strLine, strMod(""), strKeys (c); + + for (int k = 0; k < g_nKeyCount; k++) { - GtkFrame* frame = create_dialog_frame(0, GTK_SHADOW_IN); - gtk_box_pack_start(GTK_BOX (vbox2), GTK_WIDGET(frame), FALSE, FALSE, 0); + if (g_Keys[k].m_nVKKey == g_Commands[n].m_nKey) { - GtkImage* image = new_local_image("logo.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(image)); + strKeys = g_Keys[k].m_strName; + break; } } + + if (g_Commands[n].m_nModifiers & RAD_SHIFT) + strMod = "Shift"; + if (g_Commands[n].m_nModifiers & RAD_ALT) + strMod += (strMod.GetLength() > 0) ? " + Alt" : "Alt"; + if (g_Commands[n].m_nModifiers & RAD_CONTROL) + strMod += (strMod.GetLength() > 0) ? " + Control" : "Control"; + if (strMod.GetLength() > 0) + strMod += " + "; + strMod += strKeys; + + { + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, g_Commands[n].m_strCommand, 1, strMod.GetBuffer (), -1); + } + + if (fileout != NULL) + { + strLine.Format("%-25s %s\r\n", g_Commands[n].m_strCommand, strMod.GetBuffer ()); + fputs (strLine.GetBuffer (), fileout); + } + + cmds = g_slist_remove (cmds, cmds->data); } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("GtkRadiant " RADIANT_VERSION "\n" - __DATE__ "\n\n" - RADIANT_ABOUTMSG "\n\n" - "By qeradiant.com\n\n" - "This program is free software\n" - "licensed under the GNU GPL.\n\n" - "GtkRadiant is unsupported, however\n" - "you may report your problems at\n" - "http://zerowing.idsoftware.com/bugzilla" - )); - - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); - } + if (fileout != NULL) + fclose (fileout); + } + + g_object_unref(G_OBJECT(store)); + } + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Close"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// Texture List dialog + +void DoTextureListDlg () +{ + GtkWidget *dlg, *vbox, *hbox, *scr, *button; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Textures"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + gtk_window_set_default_size (GTK_WINDOW (dlg), 400, 400); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (hbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scr), GTK_SHADOW_IN); + + GtkWidget* texture_list; + + { + GtkListStore* store = gtk_list_store_new(1, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + gtk_widget_show(view); + gtk_container_add(GTK_CONTAINER (scr), view); + + { + // Initialize dialog + GSList *textures = (GSList*)NULL; + FillTextureMenu(&textures); + while (textures != NULL) { - GtkVBox* vbox2 = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox2), FALSE, TRUE, 0); { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start (GTK_BOX (vbox2), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Credits", G_CALLBACK(about_button_credits), 0); - gtk_box_pack_start (GTK_BOX (vbox2), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Changelog", G_CALLBACK(about_button_changelog), 0); - gtk_box_pack_start (GTK_BOX (vbox2), GTK_WIDGET(button), FALSE, FALSE, 0); + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, (gchar*)textures->data, -1); } + free (textures->data); + textures = g_slist_remove (textures, textures->data); } } + + g_object_unref(G_OBJECT(store)); + + texture_list = view; + } + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Load"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Close"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(texture_list)); + + GtkTreeModel* model; + GtkTreeIter iter; + if(gtk_tree_selection_get_selected(selection, &model, &iter)) { - GtkFrame* frame = create_dialog_frame("OpenGL Properties"); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), FALSE, FALSE, 0); - { - GtkTable* table = create_dialog_table(3, 2, 4, 4, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(table)); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Vendor:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Version:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Renderer:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new(reinterpret_cast(glGetString(GL_VENDOR)))); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new(reinterpret_cast(glGetString(GL_VERSION)))); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new(reinterpret_cast(glGetString(GL_RENDERER)))); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - } - { - GtkFrame* frame = create_dialog_frame("OpenGL Extensions"); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkScrolledWindow* sc_extensions = create_scrolled_window(GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, 4); - gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET(sc_extensions)); - { - GtkWidget* text_extensions = gtk_text_view_new(); - gtk_text_view_set_editable(GTK_TEXT_VIEW(text_extensions), FALSE); - gtk_container_add (GTK_CONTAINER (sc_extensions), text_extensions); - GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_extensions)); - gtk_text_buffer_set_text(buffer, reinterpret_cast(glGetString(GL_EXTENSIONS)), -1); - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_extensions), GTK_WRAP_WORD); - gtk_widget_show(text_extensions); - } - } - } + GtkTreePath* path = gtk_tree_model_get_path(model, &iter); + if(gtk_tree_path_get_depth(path) == 1) + Texture_ShowDirectory(gtk_tree_path_get_indices(path)[0] + CMD_TEXTUREWAD); + gtk_tree_path_free(path); } } - modal_dialog_show(window, dialog); + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} - gtk_widget_destroy(GTK_WIDGET(window)); +// ============================================================================= +// Cap dialog + +int DoCapDlg (int *type, bool *b_GroupResult) +{ + GtkWidget *dlg, *vbox, *hbox, *table, *pixmap, *button, *group_toggle, *radio_vbox; + GtkWidget *bevel, *endcap, *ibevel, *iendcap; + GSList *group = (GSList*)NULL; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Cap"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + // Gef: Added a vbox to contain the toggle buttons + radio_vbox = gtk_vbox_new(FALSE, 4); + gtk_container_add(GTK_CONTAINER(hbox), radio_vbox); + gtk_widget_show(radio_vbox); + + table = gtk_table_new (4, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (radio_vbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "cap_bevel.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "cap_endcap.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "cap_ibevel.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "cap_iendcap.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + bevel = gtk_radio_button_new_with_label (group, "Bevel"); + gtk_widget_show (bevel); + gtk_table_attach (GTK_TABLE (table), bevel, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), + (GtkAttachOptions) (0), 0, 0); + group = gtk_radio_button_group (GTK_RADIO_BUTTON (bevel)); + + endcap = gtk_radio_button_new_with_label (group, "Endcap"); + gtk_widget_show (endcap); + gtk_table_attach (GTK_TABLE (table), endcap, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), + (GtkAttachOptions) (0), 0, 0); + group = gtk_radio_button_group (GTK_RADIO_BUTTON (endcap)); + + ibevel = gtk_radio_button_new_with_label (group, "Inverted Bevel"); + gtk_widget_show (ibevel); + gtk_table_attach (GTK_TABLE (table), ibevel, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), + (GtkAttachOptions) (0), 0, 0); + group = gtk_radio_button_group (GTK_RADIO_BUTTON (ibevel)); + + iendcap = gtk_radio_button_new_with_label (group, "Inverted Endcap"); + gtk_widget_show (iendcap); + gtk_table_attach (GTK_TABLE (table), iendcap, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), + (GtkAttachOptions) (0), 0, 0); + group = gtk_radio_button_group (GTK_RADIO_BUTTON (iendcap)); + + // Gef: added radio toggle for func_grouping capped patches + group_toggle = gtk_check_button_new_with_label("Result to func_group"); + gtk_container_add(GTK_CONTAINER(radio_vbox), group_toggle); + gtk_widget_show(group_toggle); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + // Gef: Set the state of the func_group toggle + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (group_toggle), *b_GroupResult); + + // Initialize dialog + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bevel), TRUE); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (bevel))) + *type = BEVEL; //*type = CapDialog::BEVEL; + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (endcap))) + *type = ENDCAP; //*type = CapDialog::ENDCAP; + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ibevel))) + *type = IBEVEL; // *type = CapDialog::IBEVEL; + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (iendcap))) + *type = IENDCAP; // *type = CapDialog::IENDCAP; + + // Gef: Added toggle for optional cap func_grouping + *b_GroupResult = (bool *)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group_toggle)); + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return ret; +} + +// ============================================================================= +// Scripts dialog + +void DoScriptsDlg () +{ + GtkWidget *dlg, *vbox, *vbox2, *hbox, *label, *button, *scr; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Available Scripts - Not Implemented Yet"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + label = gtk_label_new ("WARNING: BrushScripting is in a highly experimental state and is\n" + "far from complete. If you attempt to use them it is VERY LIKELY\n" + "that Radiant will crash. Save your work before attempting to\n" + "make use of any scripting features."); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); + + scr = gtk_scrolled_window_new ((GtkAdjustment*)NULL, (GtkAdjustment*)NULL); + gtk_widget_show (scr); + gtk_box_pack_start (GTK_BOX (hbox), scr, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scr), GTK_SHADOW_IN); + + GtkWidget* scripts_list; + + { + GtkListStore* store = gtk_list_store_new(1, G_TYPE_STRING); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + gtk_widget_show(view); + gtk_container_add(GTK_CONTAINER (scr), view); + + { + // Initialize dialog + CString strINI; + strINI = g_strGameToolsPath; + strINI += "/scripts.ini"; + FILE *f; + + f = fopen (strINI.GetBuffer(), "rt"); + if (f != NULL) + { + char line[1024], *ptr; + + // read section names + while (fgets (line, 1024, f) != 0) + { + if (line[0] != '[') + continue; + + ptr = strchr (line, ']'); + *ptr = '\0'; + + { + GtkTreeIter iter; + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, line, -1); + } + } + fclose (f); + } + } + + g_object_unref(G_OBJECT(store)); + + scripts_list = view; + } + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("Run"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("New..."); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_widget_set_sensitive (button, FALSE); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Edit..."); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_widget_set_sensitive (button, FALSE); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Close"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (vbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(scripts_list)); + + GtkTreeModel* model; + GtkTreeIter iter; + if(gtk_tree_selection_get_selected(selection, &model, &iter)) + { + char* script; + gtk_tree_model_get(model, &iter, 0, &script, -1); + RunScriptByName(script, true); + g_free(script); + } + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); +} + +// ============================================================================= +// dialog + +int DoBSInputDlg (const char *fields[5], float values[5]) +{ + GtkWidget *dlg, *vbox, *hbox, *label, *button; + GtkWidget *entries[5]; + int i, loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "BrushScript Input"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + // Create entries and initialize them + for (i = 0; i < 5; i++) + { + if (strlen (fields[i]) == 0) + continue; + + label = gtk_label_new (fields[i]); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + entries[i] = gtk_entry_new (); + gtk_widget_show (entries[i]); + gtk_box_pack_start (GTK_BOX (vbox), entries[i], TRUE, TRUE, 0); + + char buf[32]; + sprintf (buf, "%f", values[i]); + gtk_entry_set_text (GTK_ENTRY (entries[i]), buf); + } + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + for (i = 0; i < 5; i++) + { + if (strlen (fields[i]) == 0) + continue; + + values[i] = atof (gtk_entry_get_text (GTK_ENTRY (entries[i]))); + } + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return ret; } // ============================================================================= // TextureLayout dialog -EMessageBoxReturn DoTextureLayout (float *fx, float *fy) +int DoTextureLayout (float *fx, float *fy) { - ModalDialog dialog; - ModalDialogButton ok_button(dialog, eIDOK); - ModalDialogButton cancel_button(dialog, eIDCANCEL); - GtkEntry* x; - GtkEntry* y; + GtkWidget *dlg, *vbox, *hbox, *table, *label, *button; + GtkWidget *x, *y; + int loop = 1, ret = IDCANCEL; - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), "Patch texture layout", dialog); + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Patch texture layout"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Texture will be fit across the patch based\n" - "on the x and y values given. Values of 1x1\n" - "will \"fit\" the texture. 2x2 will repeat\n" - "it twice, etc.")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), TRUE, TRUE, 0); - gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); - } - { - GtkTable* table = create_dialog_table(2, 2, 4, 4); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), TRUE, TRUE, 0); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Texture x:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Texture y:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); - gtk_widget_grab_focus(GTK_WIDGET(entry)); + label = gtk_label_new ("Texture will be fit across the patch based\n" + "on the x and y values given. Values of 1x1\n" + "will \"fit\" the texture. 2x2 will repeat\n" + "it twice, etc."); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - x = entry; - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Texture x:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - y = entry; - } - } - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_modal_dialog_button("Cancel", cancel_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - } - } + label = gtk_label_new ("Texture y:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + x = gtk_entry_new (); + gtk_widget_show (x); + gtk_table_attach (GTK_TABLE (table), x, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + y = gtk_entry_new (); + gtk_widget_show (y); + gtk_table_attach (GTK_TABLE (table), y, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); // Initialize - gtk_entry_set_text(x, "4.0"); - gtk_entry_set_text(y, "4.0"); + gtk_entry_set_text (GTK_ENTRY (x), "4.0"); + gtk_entry_set_text (GTK_ENTRY (y), "4.0"); + gtk_grab_add (dlg); + gtk_widget_show (dlg); - EMessageBoxReturn ret = modal_dialog_show(window, dialog); - if (ret == eIDOK) + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) { - *fx = static_cast(atof(gtk_entry_get_text(x))); - *fy = static_cast(atof(gtk_entry_get_text(y))); + *fx = atof (gtk_entry_get_text (GTK_ENTRY (x))); + *fy = atof (gtk_entry_get_text (GTK_ENTRY (y))); } - gtk_widget_destroy(GTK_WIDGET(window)); + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); return ret; } +// ============================================================================= +// Name dialog + +char* DoNameDlg (const char* title) +{ + GtkWidget *dlg, *vbox, *hbox, *label, *button, *entry; + int loop = 1, ret = IDCANCEL; + char *str; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), title); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + label = gtk_label_new ("Name:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + str = strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + else + str = NULL; + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return str; +} + +// ============================================================================= +// NewProject dialog + +char* DoNewProjectDlg () +{ + GtkWidget *dlg, *vbox, *hbox, *label, *button, *entry, *check; + int loop = 1, ret = IDCANCEL; + char *str; + + // start by a warning message + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=459 + CString msg; + msg = "Are you sure you want a new project?\n"; + msg += "Please note that creating a new project is not the prefered way to setup GtkRadiant for mod editing.\n"; + msg += "Check http://www.qeradiant.com/faq/index.cgi?file=220 for more information"; + if (gtk_MessageBox(NULL, msg.GetBuffer(), "Confirm", MB_YESNO, "http://www.qeradiant.com/faq/index.cgi?file=220" ) == IDNO) + { + return NULL; + } + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "New Project"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + label = gtk_label_new ("This will create a new directory beneath your\n" + "game path based on the project name you give."); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + + label = gtk_label_new ("Project name:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); + + check = gtk_check_button_new_with_label ("Include game dll files"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0); + gtk_widget_set_sensitive (check, FALSE); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_set_usize (button, 60, -2); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + str = strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + else + str = NULL; + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return str; +} + // ============================================================================= // Text Editor dialog // master window widget -static GtkWidget *text_editor = 0; +static GtkWidget *text_editor = NULL; static GtkWidget *text_widget; // slave, text widget from the gtk editor static gint editor_delete (GtkWidget *widget, gpointer data) { - if (gtk_MessageBox (widget, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION) == eIDNO) + if (gtk_MessageBox (widget, "Close the shader editor ?", "Radiant", MB_YESNO) == IDNO) return TRUE; gtk_widget_hide (text_editor); @@ -742,7 +3691,7 @@ static void editor_save (GtkWidget *widget, gpointer data) FILE *f = fopen ((char*)g_object_get_data (G_OBJECT (data), "filename"), "w"); gpointer text = g_object_get_data (G_OBJECT (data), "text"); - if (f == 0) + if (f == NULL) { gtk_MessageBox (GTK_WIDGET(data), "Error saving file !"); return; @@ -755,31 +3704,108 @@ static void editor_save (GtkWidget *widget, gpointer data) static void editor_close (GtkWidget *widget, gpointer data) { - if (gtk_MessageBox (text_editor, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION) == eIDNO) + if (gtk_MessageBox (text_editor, "Close the shader editor ?", "Radiant", MB_YESNO) == IDNO) return; gtk_widget_hide (text_editor); } -static void CreateGtkTextEditor() +// several attempts +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=355 +#if 0 +#ifdef _WIN32 + +HWND FindEditWindow() +{ + return FindWindow("TFormEditPadLite", NULL); +} + +HWND FindEditWindow() +{ + HWND hwnd = FindWindow("TFormEditPadLite", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TPanel", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TPanel", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TEditPadEditor", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TWinControlProxy", NULL); + return hwnd; + } + } + } + } + return NULL; +} + +HWND FindEditWindow() +{ + HWND hwnd = FindWindow("TFormEditPadLite", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TPanel", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TPanel", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TPanel", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TFrameSearchReplace", NULL); + if (hwnd) + { + hwnd = FindWindowEx(hwnd, NULL, "TJGStringEditorControl", NULL); + return hwnd; + } + } + } + } + } + return NULL; +} + +HWND FindEditWindow() +{ + HWND hwnd = FindWindow("TEditPadForm", NULL); + HWND hwndEdit = NULL; + if (hwnd != NULL) + { + HWND hwndTab = FindWindowEx(hwnd, NULL, "TTabControl", NULL); + if (hwndTab != NULL) + { + hwndEdit = FindWindowEx(hwndTab, NULL, "TRicherEdit", NULL); + } + } + return hwndEdit; +} +#endif +#endif // #if 0 + +static void CreateGtkTextEditor () { GtkWidget *dlg; GtkWidget *vbox, *hbox, *button, *scr, *text; dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect(G_OBJECT(dlg), "delete_event", - G_CALLBACK(editor_delete), 0); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (editor_delete), NULL); gtk_window_set_default_size (GTK_WINDOW (dlg), 600, 300); vbox = gtk_vbox_new (FALSE, 5); gtk_widget_show (vbox); - gtk_container_add(GTK_CONTAINER(dlg), GTK_WIDGET(vbox)); + gtk_container_add (GTK_CONTAINER (dlg), vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - scr = gtk_scrolled_window_new (0, 0); + scr = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scr); - gtk_box_pack_start(GTK_BOX(vbox), scr, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), scr, TRUE, TRUE, 0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); @@ -791,20 +3817,20 @@ static void CreateGtkTextEditor() hbox = gtk_hbox_new (FALSE, 5); gtk_widget_show (hbox); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); button = gtk_button_new_with_label ("Close"); gtk_widget_show (button); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(editor_close), dlg); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (editor_close), dlg); gtk_widget_set_usize (button, 60, -2); button = gtk_button_new_with_label ("Save"); gtk_widget_show (button); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(editor_save), dlg); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (editor_save), dlg); gtk_widget_set_usize (button, 60, -2); text_editor = dlg; @@ -819,16 +3845,16 @@ static void DoGtkTextEditor (const char* filename, guint cursorpos) // Load file FILE *f = fopen (filename, "r"); - if (f == 0) + if (f == NULL) { - globalOutputStream() << "Unable to load file " << filename << " in shader editor.\n"; + Sys_Printf("Unable to load file %s in shader editor.\n", filename); gtk_widget_hide (text_editor); } else { fseek (f, 0, SEEK_END); int len = ftell (f); - void *buf = malloc (len); + void *buf = qmalloc (len); void *old_filename; rewind (f); @@ -847,8 +3873,9 @@ static void DoGtkTextEditor (const char* filename, guint cursorpos) // trying to show later gtk_widget_show (text_editor); -#ifdef WIN32 - process_gui(); +#ifdef _WIN32 + while (gtk_events_pending ()) + gtk_main_iteration (); #endif // only move the cursor if it's not exceeding the size.. @@ -862,7 +3889,7 @@ static void DoGtkTextEditor (const char* filename, guint cursorpos) gtk_text_buffer_place_cursor(text_buffer, &text_iter); } -#ifdef WIN32 +#ifdef _WIN32 gtk_widget_queue_draw(text_widget); #endif @@ -871,227 +3898,30 @@ static void DoGtkTextEditor (const char* filename, guint cursorpos) } } -// ============================================================================= -// Light Intensity dialog - -EMessageBoxReturn DoLightIntensityDlg (int *intensity) -{ - ModalDialog dialog; - GtkEntry* intensity_entry; - ModalDialogButton ok_button(dialog, eIDOK); - ModalDialogButton cancel_button(dialog, eIDCANCEL); - - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), "Light intensity", dialog, -1, -1); - - GtkAccelGroup *accel_group = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel_group); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("ESC for default, ENTER to validate")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(entry), TRUE, TRUE, 0); - - gtk_widget_grab_focus(GTK_WIDGET(entry)); - - intensity_entry = entry; - } - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - { - GtkButton* button = create_modal_dialog_button("Cancel", cancel_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - } - } - - char buf[16]; - sprintf (buf, "%d", *intensity); - gtk_entry_set_text(intensity_entry, buf); - - EMessageBoxReturn ret = modal_dialog_show(window, dialog); - if(ret == eIDOK) - *intensity = atoi (gtk_entry_get_text(intensity_entry)); - - gtk_widget_destroy(GTK_WIDGET(window)); - - return ret; -} - -// ============================================================================= -// Add new shader tag dialog - -EMessageBoxReturn DoShaderTagDlg (CopiedString* tag, char* title) -{ - ModalDialog dialog; - GtkEntry* textentry; - ModalDialogButton ok_button(dialog, eIDOK); - ModalDialogButton cancel_button(dialog, eIDCANCEL); - - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), title, dialog, -1, -1); - - GtkAccelGroup *accel_group = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel_group); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - //GtkLabel* label = GTK_LABEL(gtk_label_new("Enter one ore more tags separated by spaces")); - GtkLabel* label = GTK_LABEL(gtk_label_new("ESC to cancel, ENTER to validate")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(entry), TRUE, TRUE, 0); - - gtk_widget_grab_focus(GTK_WIDGET(entry)); - - textentry = entry; - } - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - { - GtkButton* button = create_modal_dialog_button("Cancel", cancel_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - } - } - - EMessageBoxReturn ret = modal_dialog_show(window, dialog); - if(ret == eIDOK) - { - *tag = gtk_entry_get_text(textentry); - } - - gtk_widget_destroy(GTK_WIDGET(window)); - - return ret; -} - -EMessageBoxReturn DoShaderInfoDlg (const char* name, const char* filename, char* title) -{ - ModalDialog dialog; - ModalDialogButton ok_button(dialog, eIDOK); - - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), title, dialog, -1, -1); - - GtkAccelGroup *accel_group = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel_group); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("The selected shader")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new(name)); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("is located in file")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new(filename)); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - } - } - - EMessageBoxReturn ret = modal_dialog_show(window, dialog); - - gtk_widget_destroy(GTK_WIDGET(window)); - - return ret; -} - - - -#ifdef WIN32 -#include -#endif - -#ifdef WIN32 - // use the file associations to open files instead of builtin Gtk editor -bool g_TextEditor_useWin32Editor = true; -#else - // custom shader editor -bool g_TextEditor_useCustomEditor = false; -CopiedString g_TextEditor_editorCommand(""); -#endif - void DoTextEditor (const char* filename, int cursorpos) { -#ifdef WIN32 - if (g_TextEditor_useWin32Editor) + CString strEditCommand; +#ifdef _WIN32 + if (g_PrefsDlg.m_bUseWin32Editor) { - globalOutputStream() << "opening file '" << filename << "' (line " << cursorpos << " info ignored)\n"; - ShellExecute((HWND)GDK_WINDOW_HWND (GTK_WIDGET(MainFrame_getWindow())->window), "open", filename, 0, 0, SW_SHOW ); + Sys_Printf("opening file '%s' (line %d info ignored)\n", filename); + ShellExecute((HWND)GDK_WINDOW_HWND (g_pParentWnd->m_pWidget->window), "open", filename, NULL, NULL, SW_SHOW ); return; } #else // check if a custom editor is set - if(g_TextEditor_useCustomEditor && !g_TextEditor_editorCommand.empty()) + if((g_PrefsDlg.m_bUseCustomEditor) && (g_PrefsDlg.m_strEditorCommand.GetLength() > 0)) { - StringOutputStream strEditCommand(256); - strEditCommand << g_TextEditor_editorCommand.c_str() << " \"" << filename << "\""; + strEditCommand = g_PrefsDlg.m_strEditorCommand; + strEditCommand += " \""; + strEditCommand += filename; + strEditCommand += "\""; - globalOutputStream() << "Launching: " << strEditCommand.c_str() << "\n"; + Sys_Printf("Launching: %s\n", strEditCommand.GetBuffer()); // note: linux does not return false if the command failed so it will assume success - if (Q_Exec(0, const_cast(strEditCommand.c_str()), 0, true) == false) + if (Q_Exec(NULL, (char *)strEditCommand.GetBuffer(), NULL, true) == false) { - globalOutputStream() << "Failed to execute " << strEditCommand.c_str() << ", using default\n"; + Sys_FPrintf(SYS_WRN, "Warning: Failed to execute %s, using default\n", strEditCommand.GetBuffer()); } else { @@ -1102,4 +3932,112 @@ void DoTextEditor (const char* filename, int cursorpos) #endif DoGtkTextEditor (filename, cursorpos); + + // old win32 code with EditPad bindings, broken + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=355 +#if 0 + strEditCommand = g_strAppPath.GetBuffer(); + strEditCommand += "editpad.exe"; + strEditCommand += " \""; + strEditCommand += filename; + strEditCommand += "\""; + if (Q_Exec(NULL, (char *)strEditCommand.GetBuffer(), NULL, true) == false) + { + Sys_FPrintf(SYS_WRN, "WARNING: Gtk shader editor is not fully functional on windows in general and unstable on win98 in particular.\n"); + Sys_FPrintf(SYS_WRN, " you can use EditPad instead (install it in Radiant's directory): http://www.qeradiant.com/?data=files&files_dir=18\n"); + DoGtkTextEditor (filename, cursorpos); + } + else + { + // TTimo: we used to call Delay here, to continue processing messages. But it seems to induce a lot of instabilities. + // so now the user will simply have to wait. + Sleep( 1500 ); + + // now grab the edit window and scroll to the shader we want to edit + HWND hwndEdit = FindEditWindow(); + + if (hwndEdit != NULL) + PostMessage(hwndEdit, EM_SETSEL, cursorpos, cursorpos); + else + Sys_Printf("Unable to load shader editor.\n"); + } +#endif +} + +// ============================================================================= +// Light Intensity dialog + +int DoLightIntensityDlg (int *intensity) +{ + GtkWidget *dlg, *vbox, *hbox, *label, *button, *entry; + int loop = 1, ret = IDCANCEL; + + dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (dlg), "Light intensity"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); + + GtkAccelGroup *accel_group = gtk_accel_group_new (); + gtk_window_add_accel_group (GTK_WINDOW (dlg), accel_group); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (dlg), hbox); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + label = gtk_label_new ("ESC for default, ENTER to validate"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + button = gtk_button_new_with_label ("OK"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_add_accelerator (button, "clicked", accel_group, + GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_add_accelerator (button, "clicked", accel_group, + GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE); + gtk_widget_set_usize (button, 60, -2); + + char buf[16]; + sprintf (buf, "%d", *intensity); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + gtk_grab_add (dlg); + gtk_widget_show (dlg); + + while (loop) + gtk_main_iteration (); + + if (ret == IDOK) + *intensity = atoi (gtk_entry_get_text (GTK_ENTRY (entry))); + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + return ret; } diff --git a/radiant/gtkfilesel-darwin.c b/radiant/gtkfilesel-darwin.c new file mode 100644 index 00000000..65c8bd0d --- /dev/null +++ b/radiant/gtkfilesel-darwin.c @@ -0,0 +1,3360 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + + +// leo FIXME: if we keep this file then we'll need to ask permission to the author, this is LGPL +// This file is from the Advanced File Selector widget +// by Michael Torrie +// http://students.cs.byu.edu/~torriem/gtk/ + +// common files win32/linux +#include +#include +#include +#include +#include +#include + +// TTimo +// NOTE: the mkdir stuff etc. is in .. but I don't know what's the best strategy yet. +// just including here doesn't cut it + +#if defined (__linux__) || (__APPLE__) +#include +#include +#include +#include +#include "fnmatch.h" +#endif + +// leo: added "gtk/" +#include "gdk/gdkkeysyms.h" +#include "gtk/gtkbutton.h" +#include "gtk/gtkentry.h" +#include "gtkfilesel-darwin.h" +#include "gtk/gtkhbox.h" +#include "gtk/gtkhbbox.h" +#include "gtk/gtklabel.h" +#include "gtk/gtklist.h" +#include "gtk/gtklistitem.h" +#include "gtk/gtkmain.h" +#include "gtk/gtkscrolledwindow.h" +#include "gtk/gtksignal.h" +#include "gtk/gtkvbox.h" +#include "gtk/gtkmenu.h" +#include "gtk/gtkmenuitem.h" +#include "gtk/gtkoptionmenu.h" +#include "gtk/gtkclist.h" +#include "gtk/gtkdialog.h" +#include "gtk/gtkcombo.h" +#include "gtk/gtkframe.h" + +// leo: disable NLS +//#include "gtk/gtkintl.h" +#define _(String) (String) + +#define DIR_LIST_WIDTH 180 +#define DIR_LIST_HEIGHT 180 +#define FILE_LIST_WIDTH 180 +#define FILE_LIST_HEIGHT 180 + +/* I've put this here so it doesn't get confused with the + * file completion interface */ +typedef struct _HistoryCallbackArg HistoryCallbackArg; + +struct _HistoryCallbackArg +{ + gchar *directory; + GtkWidget *menu_item; +}; + + +typedef struct _CompletionState CompletionState; +typedef struct _CompletionDir CompletionDir; +typedef struct _CompletionDirSent CompletionDirSent; +typedef struct _CompletionDirEntry CompletionDirEntry; +typedef struct _CompletionUserDir CompletionUserDir; +typedef struct _PossibleCompletion PossibleCompletion; + +/* Non-external file completion decls and structures */ + +/* A contant telling PRCS how many directories to cache. Its actually + * kept in a list, so the geometry isn't important. */ +#define CMPL_DIRECTORY_CACHE_SIZE 10 + +/* A constant used to determine whether a substring was an exact + * match by first_diff_index() + */ +#define PATTERN_MATCH -1 +/* The arguments used by all fnmatch() calls below + */ +#define FNMATCH_FLAGS (FNM_PATHNAME | FNM_PERIOD) + +#define CMPL_ERRNO_TOO_LONG ((1<<16)-1) + +/* This structure contains all the useful information about a directory + * for the purposes of filename completion. These structures are cached + * in the CompletionState struct. CompletionDir's are reference counted. + */ +struct _CompletionDirSent +{ + ino_t inode; + time_t mtime; + dev_t device; + + gint entry_count; + gchar *name_buffer; /* memory segment containing names of all entries */ + + struct _CompletionDirEntry *entries; +}; + +struct _CompletionDir +{ + CompletionDirSent *sent; + + gchar *fullname; + gint fullname_len; + + struct _CompletionDir *cmpl_parent; + gint cmpl_index; + gchar *cmpl_text; +}; + +/* This structure contains pairs of directory entry names with a flag saying + * whether or not they are a valid directory. NOTE: This information is used + * to provide the caller with information about whether to update its completions + * or try to open a file. Since directories are cached by the directory mtime, + * a symlink which points to an invalid file (which will not be a directory), + * will not be reevaluated if that file is created, unless the containing + * directory is touched. I consider this case to be worth ignoring (josh). + */ +struct _CompletionDirEntry +{ + gint is_dir; + gchar *entry_name; +}; + +struct _CompletionUserDir +{ + gchar *login; + gchar *homedir; +}; + +struct _PossibleCompletion +{ + /* accessible fields, all are accessed externally by functions + * declared above + */ + gchar *text; + gint is_a_completion; + gint is_directory; + + gint file_size; + gint file_time; + gint uid; + gint gid; + /* Private fields + */ + gint text_alloc; +}; + +struct _CompletionState +{ + gint last_valid_char; + gchar *updated_text; + gint updated_text_len; + gint updated_text_alloc; + gint re_complete; + + gchar *user_dir_name_buffer; + gint user_directories_len; + + gchar *last_completion_text; + + gint user_completion_index; /* if >= 0, currently completing ~user */ + + struct _CompletionDir *completion_dir; /* directory completing from */ + struct _CompletionDir *active_completion_dir; + + struct _PossibleCompletion the_completion; + + struct _CompletionDir *reference_dir; /* initial directory */ + + GList* directory_storage; + GList* directory_sent_storage; + + struct _CompletionUserDir *user_directories; +}; + + +/* File completion functions which would be external, were they used + * outside of this file. + */ + +static CompletionState* cmpl_init_state (void); +static void cmpl_free_state (CompletionState *cmpl_state); +static gint cmpl_state_okay (CompletionState* cmpl_state); +static gchar* cmpl_strerror (gint); + +static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete, + gchar **remaining_text, + CompletionState *cmpl_state); + +/* Returns a name for consideration, possibly a completion, this name + * will be invalid after the next call to cmpl_next_completion. + */ +static char* cmpl_this_completion (PossibleCompletion*); + +/* True if this completion matches the given text. Otherwise, this + * output can be used to have a list of non-completions. + */ +static gint cmpl_is_a_completion (PossibleCompletion*); + +/* True if the completion is a directory + */ +static gint cmpl_is_directory (PossibleCompletion*); + +/* Obtains the next completion, or NULL + */ +static PossibleCompletion* cmpl_next_completion (CompletionState*); + +/* Updating completions: the return value of cmpl_updated_text() will + * be text_to_complete completed as much as possible after the most + * recent call to cmpl_completion_matches. For the present + * application, this is the suggested replacement for the user's input + * string. You must CALL THIS AFTER ALL cmpl_text_completions have + * been received. + */ +static gchar* cmpl_updated_text (CompletionState* cmpl_state); + +/* After updating, to see if the completion was a directory, call + * this. If it was, you should consider re-calling completion_matches. + */ +static gint cmpl_updated_dir (CompletionState* cmpl_state); + +/* Current location: if using file completion, return the current + * directory, from which file completion begins. More specifically, + * the cwd concatenated with all exact completions up to the last + * directory delimiter('/'). + */ +static gchar* cmpl_reference_position (CompletionState* cmpl_state); + +/* backing up: if cmpl_completion_matches returns NULL, you may query + * the index of the last completable character into cmpl_updated_text. + */ +static gint cmpl_last_valid_char (CompletionState* cmpl_state); + +/* When the user selects a non-directory, call cmpl_completion_fullname + * to get the full name of the selected file. + */ +static gchar* cmpl_completion_fullname (gchar*, CompletionState* cmpl_state); + + +/* Directory operations. */ +static CompletionDir* open_ref_dir (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static gboolean check_dir (gchar *dir_name, + struct stat *result, + gboolean *stat_subdirs); +static CompletionDir* open_dir (gchar* dir_name, + CompletionState* cmpl_state); +static CompletionDir* open_user_dir (gchar* text_to_complete, + CompletionState *cmpl_state); +static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, + CompletionState *cmpl_state); +static CompletionDirSent* open_new_dir (gchar* dir_name, + struct stat* sbuf, + gboolean stat_subdirs); +static gint correct_dir_fullname (CompletionDir* cmpl_dir); +static gint correct_parent (CompletionDir* cmpl_dir, + struct stat *sbuf); +static gchar* find_parent_dir_fullname (gchar* dirname); +static CompletionDir* attach_dir (CompletionDirSent* sent, + gchar* dir_name, + CompletionState *cmpl_state); +static void free_dir_sent (CompletionDirSent* sent); +static void free_dir (CompletionDir *dir); +static void prune_memory_usage(CompletionState *cmpl_state); + +/* Completion operations */ +static PossibleCompletion* attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state); +static PossibleCompletion* attempt_file_completion(CompletionState *cmpl_state); +static CompletionDir* find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static PossibleCompletion* append_completion_text(gchar* text, + CompletionState* cmpl_state); +static gint get_pwdb(CompletionState* cmpl_state); +static gint first_diff_index(gchar* pat, gchar* text); +static gint compare_user_dir(const void* a, const void* b); +static gint compare_cmpl_dir(const void* a, const void* b); +static void update_cmpl(PossibleCompletion* poss, + CompletionState* cmpl_state); + +static void gtk_file_selection_class_init (GtkFileSelectionClass *klass); +static void gtk_file_selection_init (GtkFileSelection *filesel); +static void gtk_file_selection_destroy (GtkObject *object); +static gint gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); + +static void gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data); + +static void gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete); +static void gtk_file_selection_abort (GtkFileSelection *fs); + +static void gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_dir); + +static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); +static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); + +static gboolean gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data); +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + gpointer user_data); +static void gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data); +static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); +static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_home_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_up_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_prev_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_next_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data); + +static gint gtk_file_selection_match_char (gchar, gchar *mask); +static gint gtk_file_selection_match_mask (gchar *,gchar *); + + +static GtkWindowClass *parent_class = NULL; + +/* Saves errno when something cmpl does fails. */ +static gint cmpl_errno; + + +void gtk_file_selection_clear_masks (GtkFileSelection *filesel) +{ + GList *list; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + list = filesel->masks; + while (list) + { + g_free (list->data); + list = list->next; + } + filesel->masks = NULL; + + gtk_list_clear_items (GTK_LIST (GTK_COMBO (filesel->mask_entry)->list), 0, -1); +} + +void gtk_file_selection_set_masks (GtkFileSelection *filesel, const gchar **masks) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + while (*masks) + { + filesel->masks = g_list_append (filesel->masks, (gpointer)*masks); + masks++; + } + + if (filesel->masks) + gtk_combo_set_popdown_strings (GTK_COMBO (filesel->mask_entry), filesel->masks); +} + + +/* General notes: + * Make prev and next inactive if their respective * + * histories are empty. + * Add facilities for handling hidden files and * + * directories * + * Add an api to access the mask, and hidden files * + * check box? (prob not in 1.2.x series) * + */ + +/* Routine for applying mask to filenames * + * Need to be optimized to minimize recursion * + * help the for loop by looking for the next * + * instance of the mask character following * + * the '*'. ei *.c -- look for '.' * + * Also, swap all *? pairs (-> ?*), as that * + * will make it possible to look ahead (? * + * makes it very nondeterministic as in *?.c * + * which really is ?*.c * + * Allow multiply masks, separted by commas * + * Allow more flexible [] handling (ie [a-zA-Z] * + * * + */ +static gint gtk_file_selection_match_char (gchar text, gchar *mask){ + gchar *maskc; + gint x; + gint s; + + if (mask[0] == '[') + { + if (!strchr (mask,']')) return 0; + maskc = g_strdup(mask + 1); /* get the portion of mask inside []*/ + + (*(strchr (maskc,']'))) = 0; + s = strlen ((char *)maskc); + + for (x = 0; x < s; x++){ + if (text == maskc[x]) + { + g_free (maskc); + return s + 2; + } + } + g_free (maskc); + return 0; + } + + if (mask[0] == '?') return 1; + if (mask[0] == text) return 1; + + return 0; +} + + +static gint gtk_file_selection_match_mask (gchar *text, gchar *mask){ + + int mc; + int tc; + + tc = 0; mc = 0; + + if (mask[0] == 0 && text[0] == 0) return 1; + + if (mask[0] == '*') + { + for (tc = 0; tc <= strlen(text); tc++) + { + if (gtk_file_selection_match_mask (text + tc, mask + 1)) + return 1; + } + return 0; + } + mc = gtk_file_selection_match_char (text[0], mask); + + if(mc) + return gtk_file_selection_match_mask (text + 1, mask + mc); + else + return 0; +} + +GtkType +gtk_file_selection_get_type (void) +{ + static GtkType file_selection_type = 0; + + if (!file_selection_type) + { + static const GtkTypeInfo filesel_info = + { + "GtkFileSelection", + sizeof (GtkFileSelection), + sizeof (GtkFileSelectionClass), + (GtkClassInitFunc) gtk_file_selection_class_init, + (GtkObjectInitFunc) gtk_file_selection_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); + } + + return file_selection_type; +} + +static void +gtk_file_selection_class_init (GtkFileSelectionClass *klass) //tigital +{ + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*) klass; + + parent_class = gtk_type_class (GTK_TYPE_WINDOW); + + object_class->destroy = gtk_file_selection_destroy; +} + +static void +gtk_file_selection_init (GtkFileSelection *filesel) +{ + GtkWidget *entry_vbox; + GtkWidget *label; + GtkWidget *list_hbox; + GtkWidget *confirm_area; + GtkWidget *vbox; + GtkWidget *hbox; + GtkWidget *pulldown_hbox; + GtkWidget *scrolled_win; + GtkWidget *mask_label; + GtkWidget *bigframe; + GtkWidget *label_lookingin; + GtkWidget *up_button; + GtkWidget *home_button; + GtkWidget *prev_button; + GtkWidget *next_button; + GtkWidget *refresh_button; + + char *dir_title [2]; + char *file_title [2]; + + filesel->cmpl_state = cmpl_init_state (); + + filesel->mask=NULL; + filesel->prev_history=NULL; + filesel->next_history=NULL; + filesel->saved_entry=NULL; + + /* The dialog-sized vertical box */ + filesel->main_vbox = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); + gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox); + gtk_widget_show (filesel->main_vbox); + + /* The horizontal box containing create, rename etc. buttons */ + filesel->button_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(filesel->button_area), GTK_BUTTONBOX_START); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(filesel->button_area), 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, + FALSE, FALSE, 0); + gtk_widget_show (filesel->button_area); + + gtk_file_selection_show_fileop_buttons(filesel); + + /* hbox for pulldown menu */ + pulldown_hbox = gtk_hbox_new (FALSE, 5); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); + gtk_widget_show (pulldown_hbox); + + /* The combo box that replaces the pulldown menu */ + label_lookingin = gtk_label_new (_("Looking in:")); + gtk_widget_show (label_lookingin); + gtk_box_pack_start (GTK_BOX (pulldown_hbox), label_lookingin, FALSE, FALSE, 0); + + filesel->history_combo = gtk_combo_new(); + gtk_widget_show(filesel->history_combo); + gtk_combo_set_value_in_list(GTK_COMBO(filesel->history_combo),FALSE,FALSE); + gtk_box_pack_start (GTK_BOX(pulldown_hbox),filesel->history_combo, + TRUE,TRUE, 0); + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->entry),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"button-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_key_handler, + (gpointer) filesel); + + /* frame to put the following hbox in */ + bigframe = gtk_frame_new (NULL); + gtk_widget_show (bigframe); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), bigframe, TRUE, TRUE, 0); + + /* The horizontal box containing the directory and file listboxes */ + list_hbox = gtk_hbox_new (FALSE, 5); + gtk_container_add (GTK_CONTAINER(bigframe), list_hbox); + gtk_container_set_border_width (GTK_CONTAINER (list_hbox), 5); + gtk_widget_show (list_hbox); + + /* vbox to put the buttons and directory listing in */ + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (list_hbox), vbox, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + home_button = gtk_button_new_with_label (_("Home")); + gtk_widget_show (home_button); + gtk_signal_connect (GTK_OBJECT (home_button), "clicked", + (GtkSignalFunc) gtk_file_selection_home_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), home_button, TRUE,TRUE, 0); + + prev_button = gtk_button_new_with_label (_("Prev")); + gtk_signal_connect (GTK_OBJECT (prev_button), "clicked", + (GtkSignalFunc) gtk_file_selection_prev_button, + (gpointer) filesel); + gtk_widget_show (prev_button); + gtk_box_pack_start (GTK_BOX (hbox), prev_button, TRUE,TRUE, 0); + + up_button = gtk_button_new_with_label (_("Up")); + gtk_signal_connect (GTK_OBJECT (up_button), "clicked", + (GtkSignalFunc) gtk_file_selection_up_button, + (gpointer) filesel); + gtk_widget_show (up_button); + gtk_box_pack_start (GTK_BOX (hbox), up_button, TRUE,TRUE, 0); + + next_button = gtk_button_new_with_label (_("Next")); + gtk_widget_show (next_button); + gtk_signal_connect (GTK_OBJECT (next_button), "clicked", + (GtkSignalFunc) gtk_file_selection_next_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), next_button, TRUE,TRUE, 0); + + refresh_button = gtk_button_new_with_label (_("Refresh")); + gtk_widget_show (refresh_button); + gtk_signal_connect (GTK_OBJECT (refresh_button), "clicked", + (GtkSignalFunc) gtk_file_selection_refresh_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), refresh_button, TRUE, TRUE, 0); + + /* The directories clist */ + dir_title[0] = _("Directories"); + dir_title[1] = NULL; + filesel->dir_list = gtk_clist_new_with_titles (1, (gchar**) dir_title); + gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", + (GtkSignalFunc) gtk_file_selection_dir_button, + (gpointer) filesel); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "unselect_row", + (GtkSignalFunc) gtk_file_selection_undir_button, + (gpointer) filesel); + gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE,TRUE, 5); + gtk_widget_show (filesel->dir_list); + gtk_widget_show (scrolled_win); + + /* vbox area for mask entry and files clist */ + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (list_hbox), vbox, TRUE, TRUE, 0); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + mask_label = gtk_label_new (_("Mask:")); + gtk_widget_show (mask_label); + gtk_box_pack_start (GTK_BOX (hbox), mask_label, FALSE, FALSE, 0); + + filesel->mask_entry = gtk_entry_new (); + gtk_widget_show (filesel->mask_entry); + gtk_signal_connect(GTK_OBJECT(filesel->mask_entry),"activate", + (GtkSignalFunc) gtk_file_selection_mask_entry_callback, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox),filesel->mask_entry, TRUE, TRUE, 0); + + + /* The files clist */ + file_title[0] = _("Files"); + file_title[1] = NULL; + filesel->file_list = gtk_clist_new_with_titles (1, (gchar**) file_title); + gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", + (GtkSignalFunc) gtk_file_selection_file_button, + (gpointer) filesel); + gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 5); + gtk_widget_show (filesel->file_list); + gtk_widget_show (scrolled_win); + + /* action area for packing buttons into. */ + filesel->action_area = gtk_hbox_new (TRUE, 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, + FALSE, FALSE, 0); + gtk_widget_show (filesel->action_area); + + /* The OK/Cancel button area */ + confirm_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_area), 5); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0); + gtk_widget_show (confirm_area); + + /* The OK button */ + filesel->ok_button = gtk_button_new_with_label (_("OK")); + GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0); + gtk_widget_grab_default (filesel->ok_button); + gtk_widget_show (filesel->ok_button); + + /* The Cancel button */ + filesel->cancel_button = gtk_button_new_with_label (_("Cancel")); + GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0); + gtk_widget_show (filesel->cancel_button); + + /* The selection entry widget */ + entry_vbox = gtk_vbox_new (FALSE, 2); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); + gtk_widget_show (entry_vbox); + + filesel->selection_text = label = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (entry_vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + + filesel->selection_entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event", + (GtkSignalFunc) gtk_file_selection_key_press, filesel); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event", + (GtkSignalFunc) gtk_widget_grab_default, + GTK_OBJECT (filesel->ok_button)); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate", + (GtkSignalFunc) gtk_button_clicked, + GTK_OBJECT (filesel->ok_button)); + gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0); + gtk_widget_show (filesel->selection_entry); + + if (!cmpl_state_okay (filesel->cmpl_state)) + { + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf); + } + else + { + gtk_file_selection_populate (filesel, "", FALSE); + } + + gtk_widget_grab_focus (filesel->selection_entry); +} + +GtkWidget* +gtk_file_selection_new (const gchar *title) +{ + GtkFileSelection *filesel; + + filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION); + gtk_window_set_title (GTK_WINDOW (filesel), title); + + return GTK_WIDGET (filesel); +} + +void +gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + /* delete, create directory, and rename */ + if (!filesel->fileop_c_dir) + { + filesel->fileop_c_dir = gtk_button_new_with_label (_("Create Dir")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_c_dir, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_c_dir); + } + + if (!filesel->fileop_del_file) + { + filesel->fileop_del_file = gtk_button_new_with_label (_("Delete File")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_del_file, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_del_file); + } + + if (!filesel->fileop_ren_file) + { + filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename File")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_ren_file, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_ren_file); + } + + gtk_widget_queue_resize(GTK_WIDGET(filesel)); +} + +void +gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + if (filesel->fileop_ren_file) + { + gtk_widget_destroy (filesel->fileop_ren_file); + filesel->fileop_ren_file = NULL; + } + + if (filesel->fileop_del_file) + { + gtk_widget_destroy (filesel->fileop_del_file); + filesel->fileop_del_file = NULL; + } + + if (filesel->fileop_c_dir) + { + gtk_widget_destroy (filesel->fileop_c_dir); + filesel->fileop_c_dir = NULL; + } +} + + + +void +gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename) +{ + char buf[MAXPATHLEN]; + const char *name, *last_slash; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (filename != NULL); + + last_slash = strrchr (filename, '/'); + + if (!last_slash) + { + buf[0] = 0; + name = filename; + } + else + { + gint len = MIN (MAXPATHLEN - 1, last_slash - filename + 1); + + strncpy (buf, filename, len); + buf[len] = 0; + + name = last_slash + 1; + } + + gtk_file_selection_populate (filesel, buf, FALSE); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name); +} + +gchar* +gtk_file_selection_get_filename (GtkFileSelection *filesel) +{ + static char nothing[2] = ""; + char *text; + char *filename; + + g_return_val_if_fail (filesel != NULL, nothing); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing); + + text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); + if (text) + { + filename = cmpl_completion_fullname (text, filesel->cmpl_state); + return filename; + } + + return nothing; +} + +void +gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern) +{ + gchar *new_pattern; + gint x; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (pattern != NULL); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); + + if(strchr(pattern,'*') || strchr(pattern,'?')) + { + for(x=strlen(pattern);x>=0;x--) + { + if(pattern[x]=='/') break; + } + gtk_entry_set_text(GTK_ENTRY(filesel->mask_entry),g_strdup(pattern+x+1)); + + if(filesel->mask) g_free(filesel->mask); + + filesel->mask=g_strdup(pattern+x+1); + new_pattern=g_strdup(pattern); + new_pattern[x+1]=0; + gtk_file_selection_populate (filesel, (gchar*) new_pattern, TRUE); + g_free(new_pattern); + } + else + { + gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE); + } +} + +static void +gtk_file_selection_destroy (GtkObject *object) +{ + GtkFileSelection *filesel; + GList *list; + + g_return_if_fail (object != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (object)); + + filesel = GTK_FILE_SELECTION (object); + + if (filesel->fileop_dialog) + gtk_widget_destroy (filesel->fileop_dialog); + + if (filesel->next_history) + { + list = filesel->next_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->next_history); + filesel->next_history = NULL; + + if (filesel->prev_history) + { + list = filesel->prev_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->prev_history); + filesel->prev_history = NULL; + + if (filesel->mask) + { + g_free (filesel->mask); + filesel->mask = NULL; + } + + cmpl_free_state (filesel->cmpl_state); + filesel->cmpl_state = NULL; + + if (GTK_OBJECT_CLASS (parent_class)->destroy) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + +/* Begin file operations callbacks */ + +static void +gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message) +{ + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + + g_return_if_fail (error_message != NULL); + + /* main dialog */ + dialog = gtk_dialog_new (); + /* + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + */ + gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, make this dialog modal too */ + /* When error dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(error_message); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* yes, we free it */ + g_free (error_message); + + /* close button */ + button = gtk_button_new_with_label (_("Close")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + fs->fileop_dialog = NULL; +} + + +static void +gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *dirname; + gchar *path; + gchar *full_path; + gchar *buf; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", dirname, NULL); + if ( (mkdir (full_path, 0755) < 0) ) + { + buf = g_strconcat ("Error creating directory \"", dirname, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_create_dir (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(_("Directory name:")); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* The directory entry widget */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + /* buttons */ + button = gtk_button_new_with_label (_("Create")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + CompletionState *cmpl_state; + gchar *path; + gchar *full_path; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", fs->fileop_file, NULL); + if ( (unlink (full_path) < 0) ) + { + buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_delete_file (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + gchar *filename; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(filename) < 1) + return; + + fs->fileop_file = filename; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* buttons */ + button = gtk_button_new_with_label (_("Delete")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); + +} + +static void +gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *buf; + gchar *file; + gchar *path; + gchar *new_filename; + gchar *old_filename; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + new_filename = g_strconcat (path, "/", file, NULL); + old_filename = g_strconcat (path, "/", fs->fileop_file, NULL); + + if ( (rename (old_filename, new_filename)) < 0) + { + buf = g_strconcat ("Error renaming file \"", file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (new_filename); + g_free (old_filename); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_rename_file (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(fs->fileop_file) < 1) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* New filename entry */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); + gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), + 0, strlen (fs->fileop_file)); + + /* buttons */ + button = gtk_button_new_with_label (_("Rename")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + + +static gint +gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + GtkFileSelection *fs; + char *text; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + fs = GTK_FILE_SELECTION (user_data); + + if (event->keyval == GDK_Tab) + { + text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + + text = g_strdup (text); + + gtk_file_selection_populate (fs, text, TRUE); + + g_free (text); + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + + return TRUE; + } + if (fs->saved_entry) + { + gtk_clist_unselect_all ((GtkCList *) (fs->dir_list)); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + + + return FALSE; +} + +static void +gtk_file_selection_home_button (GtkWidget *widget, gpointer data){ + GList *list; + + GtkFileSelection *fs=data; + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs,"~/",FALSE); +} + +static void +gtk_file_selection_up_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, "../", FALSE); /*change directories. */ + +} + +static void +gtk_file_selection_prev_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->prev_history; + + if (list && g_list_length(list) > 1) + { + first = list; /* get first element */ + list = list->next; /* pop off current directory */ + + list->prev = NULL; /* make this the new head. */ + + fs->prev_history = list; /* update prev_history list */ + fs->next_history = g_list_prepend(fs->next_history,first->data); /* put it on next_history */ + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + + + path = g_malloc(strlen(list->data)+4); /* plenty of space */ + strcpy(path,list->data); /* get the 2nd path in the history */ + strcat(path,"/"); /* append a '/' */ + gtk_file_selection_populate (fs, path, FALSE); /* change directories. */ + g_free (path); + } +} + +static void +gtk_file_selection_next_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + + if (list && g_list_length(list) > 0) + { + first = list; /*get first element*/ + list = list->next; /*pop off current directory*/ + + if (list) + list->prev = NULL; + + fs->next_history = list; /*update prev_history list*/ + + path = g_malloc(strlen(first->data)+4); /*plenty of space*/ + strcpy(path,first->data); + strcat(path,"/"); /*append a / */ + gtk_file_selection_populate (fs, path, FALSE); /*change directories.*/ + g_free(path); + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + } +} + +void static +gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_file_selection_populate (fs,"",FALSE); +} + +static void +gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + if(fs->mask) + g_free (fs->mask); + + fs->mask = g_strdup(gtk_entry_get_text (GTK_ENTRY(fs->mask_entry))); + + if (strlen(fs->mask) == 0) + { + g_free (fs->mask); + fs->mask = NULL; + } + + gtk_file_selection_refresh_button (widget,data); +} + +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + /* + g_print("Key pressed! \n"); + */ + + return TRUE; +} + +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + gpointer user_data) +{ + + GtkFileSelection *fs = user_data; + GList *list; + gchar *path; + + list = fs->next_history; + if(list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(GTK_ENTRY (((GtkCombo *)fs->history_combo)->entry)))+4); + strcpy (path,gtk_entry_get_text(GTK_ENTRY( ((GtkCombo *)fs->history_combo)->entry))); + strcat (path,"/"); + + gtk_file_selection_populate (fs,path,TRUE); + + g_free (path); + + return TRUE; +} + +static gboolean +gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + GtkEntry *entry=(GtkEntry *)widget; + GtkFileSelection *fs=data; + GList *list; + gchar *path; + + g_return_val_if_fail (fs != NULL,FALSE); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs),FALSE); + + + if (event->keyval == GDK_Return) + { + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(entry))+4); + strcpy (path,gtk_entry_get_text(entry)); + strcat (path,"/"); + gtk_file_selection_populate (fs,path,TRUE); + g_free (path); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + return TRUE; + } + else + { + return FALSE; + } + +} + +static void +gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_directory) +{ + gchar *current_dir; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + g_return_if_fail (current_directory != NULL); + + current_dir = g_strdup (current_directory); + + if(fs->prev_history) + { + if (strcmp((fs->prev_history)->data,current_dir)) + { /*if this item isn't on the top of the list */ + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + } else { + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (fs->history_combo),fs->prev_history); + + g_free (current_dir); +} + +static void +gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = user_data; + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->file_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + gtk_button_clicked (GTK_BUTTON (fs->ok_button)); + break; + + default: + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GList *list; + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, filename, FALSE); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + break; + + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) g_free (fs->saved_entry); + fs->saved_entry=g_strdup(gtk_entry_get_text(GTK_ENTRY (fs->selection_entry))); + + temp=g_strconcat(filename,fs->saved_entry,NULL); + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), temp); + g_free (temp); + + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) + { + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); //????? + + g_free (filename); + } +} + +static void +gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete) +{ + CompletionState *cmpl_state; + PossibleCompletion* poss; + gchar* filename; + gint row; + gchar* rem_path = rel_path; + gchar* sel_text; + gchar* text[2]; + gint did_recurse = FALSE; + gint possible_count = 0; + gint selection_index = -1; + gint file_list_width; + gint dir_list_width; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state); + + if (!cmpl_state_okay (cmpl_state)) + { + /* Something went wrong. */ + gtk_file_selection_abort (fs); + return; + } + + g_assert (cmpl_state->reference_dir); + + gtk_clist_freeze (GTK_CLIST (fs->dir_list)); + gtk_clist_clear (GTK_CLIST (fs->dir_list)); + gtk_clist_freeze (GTK_CLIST (fs->file_list)); + gtk_clist_clear (GTK_CLIST (fs->file_list)); + + /* Set the dir_list to include ./ and ../ */ + text[1] = NULL; + text[0] = "./"; + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + + text[0] = "../"; + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + + /*reset the max widths of the lists*/ + dir_list_width = gdk_string_width(fs->dir_list->style->font,"../"); + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width); + file_list_width = 1; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width); + + while (poss) + { + if (cmpl_is_a_completion (poss)) + { + possible_count += 1; + + filename = cmpl_this_completion (poss); + + text[0] = filename; + + if (cmpl_is_directory (poss)) + { + if (strcmp (filename, "./") != 0 && + strcmp (filename, "../") != 0) + { + int width = gdk_string_width(fs->dir_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + if(width > dir_list_width) + { + dir_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0, + width); + } + } + } + else + { + if(fs->mask) + { + if (gtk_file_selection_match_mask(filename,fs->mask)) + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + else + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + } + + poss = cmpl_next_completion (cmpl_state); + } + + gtk_clist_thaw (GTK_CLIST (fs->dir_list)); + gtk_clist_thaw (GTK_CLIST (fs->file_list)); + + /* File lists are set. */ + + g_assert (cmpl_state->reference_dir); + + if (try_complete) + { + + /* User is trying to complete filenames, so advance the user's input + * string to the updated_text, which is the common leading substring + * of all possible completions, and if its a directory attempt + * attempt completions in it. */ + + if (cmpl_updated_text (cmpl_state)[0]) + { + + if (cmpl_updated_dir (cmpl_state)) + { + gchar* dir_name = g_strdup (cmpl_updated_text (cmpl_state)); + + did_recurse = TRUE; + + gtk_file_selection_populate (fs, dir_name, TRUE); + + g_free (dir_name); + } + else + { + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), + cmpl_updated_text (cmpl_state)); + } + } + else + { + selection_index = cmpl_last_valid_char (cmpl_state) - + (strlen (rel_path) - strlen (rem_path)); + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); + } + } + else + { + if (fs->selection_entry) + /* Here we need to take the old filename and keep it!*/ + /*gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), "");*/ + ; + } + + if (!did_recurse) + { + if (fs->selection_entry) + gtk_entry_set_position (GTK_ENTRY (fs->selection_entry), selection_index); + + if (fs->selection_entry) + { + sel_text = g_strconcat (_("Selection: "), + cmpl_reference_position (cmpl_state), + NULL); + + gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text); + g_free (sel_text); + } + + gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state)); + + } +} + +static void +gtk_file_selection_abort (GtkFileSelection *fs) +{ + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + /* BEEP gdk_beep(); */ + + if (fs->selection_entry) + gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf); +} + +/**********************************************************************/ +/* External Interface */ +/**********************************************************************/ + +/* The four completion state selectors + */ +static gchar* +cmpl_updated_text (CompletionState* cmpl_state) +{ + return cmpl_state->updated_text; +} + +static gint +cmpl_updated_dir (CompletionState* cmpl_state) +{ + return cmpl_state->re_complete; +} + +static gchar* +cmpl_reference_position (CompletionState* cmpl_state) +{ + return cmpl_state->reference_dir->fullname; +} + +static gint +cmpl_last_valid_char (CompletionState* cmpl_state) +{ + return cmpl_state->last_valid_char; +} + +static gchar* +cmpl_completion_fullname (gchar* text, CompletionState* cmpl_state) +{ + static char nothing[2] = ""; + + if (!cmpl_state_okay (cmpl_state)) + { + return nothing; + } + else if (text[0] == '/') + { + strcpy (cmpl_state->updated_text, text); + } + else if (text[0] == '~') + { + CompletionDir* dir; + char* slash; + + dir = open_user_dir (text, cmpl_state); + + if (!dir) + { + /* spencer says just return ~something, so + * for now just do it. */ + strcpy (cmpl_state->updated_text, text); + } + else + { + + strcpy (cmpl_state->updated_text, dir->fullname); + + slash = strchr (text, '/'); + + if (slash) + strcat (cmpl_state->updated_text, slash); + } + } + else + { + strcpy (cmpl_state->updated_text, cmpl_state->reference_dir->fullname); + if (strcmp (cmpl_state->reference_dir->fullname, "/") != 0) + strcat (cmpl_state->updated_text, "/"); + strcat (cmpl_state->updated_text, text); + } + + return cmpl_state->updated_text; +} + +/* The three completion selectors + */ +static gchar* +cmpl_this_completion (PossibleCompletion* pc) +{ + return pc->text; +} + +static gint +cmpl_is_directory (PossibleCompletion* pc) +{ + return pc->is_directory; +} + +static gint +cmpl_is_a_completion (PossibleCompletion* pc) +{ + return pc->is_a_completion; +} + +/**********************************************************************/ +/* Construction, deletion */ +/**********************************************************************/ + +static CompletionState* +cmpl_init_state (void) +{ + gchar getcwd_buf[2*MAXPATHLEN]; + CompletionState *new_state; + + new_state = g_new (CompletionState, 1); + + /* We don't use getcwd() on SUNOS, because, it does a popen("pwd") + * and, if that wasn't bad enough, hangs in doing so. + */ +#if defined(sun) && !defined(__SVR4) + if (!getwd (getcwd_buf)) +#else + if (!getcwd (getcwd_buf, MAXPATHLEN)) +#endif + { + /* Oh joy, we can't get the current directory. Um..., we should have + * a root directory, right? Right? (Probably not portable to non-Unix) + */ + strcpy (getcwd_buf, "/"); + } + +tryagain: + + new_state->reference_dir = NULL; + new_state->completion_dir = NULL; + new_state->active_completion_dir = NULL; + new_state->directory_storage = NULL; + new_state->directory_sent_storage = NULL; + new_state->last_valid_char = 0; + new_state->updated_text = g_new (gchar, MAXPATHLEN); + new_state->updated_text_alloc = MAXPATHLEN; + new_state->the_completion.text = g_new (gchar, MAXPATHLEN); + new_state->the_completion.text_alloc = MAXPATHLEN; + new_state->user_dir_name_buffer = NULL; + new_state->user_directories = NULL; + + new_state->reference_dir = open_dir (getcwd_buf, new_state); + + if (!new_state->reference_dir) + { + /* Directories changing from underneath us, grumble */ + strcpy (getcwd_buf, "/"); + goto tryagain; + } + + return new_state; +} + +static void +cmpl_free_dir_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_dir_sent_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir_sent (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_state (CompletionState* cmpl_state) +{ + cmpl_free_dir_list (cmpl_state->directory_storage); + cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage); + + if (cmpl_state->user_dir_name_buffer) + g_free (cmpl_state->user_dir_name_buffer); + if (cmpl_state->user_directories) + g_free (cmpl_state->user_directories); + if (cmpl_state->the_completion.text) + g_free (cmpl_state->the_completion.text); + if (cmpl_state->updated_text) + g_free (cmpl_state->updated_text); + + g_free (cmpl_state); +} + +static void +free_dir(CompletionDir* dir) +{ + g_free(dir->fullname); + g_free(dir); +} + +static void +free_dir_sent(CompletionDirSent* sent) +{ + g_free(sent->name_buffer); + g_free(sent->entries); + g_free(sent); +} + +static void +prune_memory_usage(CompletionState *cmpl_state) +{ + GList* cdsl = cmpl_state->directory_sent_storage; + GList* cdl = cmpl_state->directory_storage; + GList* cdl0 = cdl; + gint len = 0; + + for(; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1) + cdsl = cdsl->next; + + if (cdsl) { + cmpl_free_dir_sent_list(cdsl->next); + cdsl->next = NULL; + } + + cmpl_state->directory_storage = NULL; + while (cdl) { + if (cdl->data == cmpl_state->reference_dir) + cmpl_state->directory_storage = g_list_prepend(NULL, cdl->data); + else + free_dir (cdl->data); + cdl = cdl->next; + } + + g_list_free(cdl0); +} + +/**********************************************************************/ +/* The main entrances. */ +/**********************************************************************/ + +static PossibleCompletion* +cmpl_completion_matches (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + PossibleCompletion *poss; + + prune_memory_usage(cmpl_state); + + g_assert (text_to_complete != NULL); + + cmpl_state->user_completion_index = -1; + cmpl_state->last_completion_text = text_to_complete; + cmpl_state->the_completion.text[0] = 0; + cmpl_state->last_valid_char = 0; + cmpl_state->updated_text_len = -1; + cmpl_state->updated_text[0] = 0; + cmpl_state->re_complete = FALSE; + + first_slash = strchr (text_to_complete, '/'); + + if (text_to_complete[0] == '~' && !first_slash) + { + /* Text starts with ~ and there is no slash, show all the + * home directory completions. + */ + poss = attempt_homedir_completion (text_to_complete, cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; + } + + cmpl_state->reference_dir = + open_ref_dir (text_to_complete, remaining_text, cmpl_state); + + if(!cmpl_state->reference_dir) + return NULL; + + cmpl_state->completion_dir = + find_completion_dir (*remaining_text, remaining_text, cmpl_state); + + cmpl_state->last_valid_char = *remaining_text - text_to_complete; + + if(!cmpl_state->completion_dir) + return NULL; + + cmpl_state->completion_dir->cmpl_index = -1; + cmpl_state->completion_dir->cmpl_parent = NULL; + cmpl_state->completion_dir->cmpl_text = *remaining_text; + + cmpl_state->active_completion_dir = cmpl_state->completion_dir; + + cmpl_state->reference_dir = cmpl_state->completion_dir; + + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +static PossibleCompletion* +cmpl_next_completion (CompletionState* cmpl_state) +{ + PossibleCompletion* poss = NULL; + + cmpl_state->the_completion.text[0] = 0; + + if(cmpl_state->user_completion_index >= 0) + poss = attempt_homedir_completion(cmpl_state->last_completion_text, cmpl_state); + else + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +/**********************************************************************/ +/* Directory Operations */ +/**********************************************************************/ + +/* Open the directory where completion will begin from, if possible. */ +static CompletionDir* +open_ref_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + CompletionDir *new_dir; + + first_slash = strchr(text_to_complete, '/'); + + if (text_to_complete[0] == '~') + { + new_dir = open_user_dir(text_to_complete, cmpl_state); + + if(new_dir) + { + if(first_slash) + *remaining_text = first_slash + 1; + else + *remaining_text = text_to_complete + strlen(text_to_complete); + } + else + { + return NULL; + } + } + else if (text_to_complete[0] == '/' || !cmpl_state->reference_dir) + { + gchar *tmp = g_strdup(text_to_complete); + gchar *p; + + p = tmp; + while (*p && *p != '*' && *p != '?') + p++; + + *p = '\0'; + p = strrchr(tmp, '/'); + if (p) + { + if (p == tmp) + p++; + + *p = '\0'; + + new_dir = open_dir(tmp, cmpl_state); + + if(new_dir) + *remaining_text = text_to_complete + + ((p == tmp + 1) ? (p - tmp) : (p + 1 - tmp)); + } + else + { + /* If no possible candidates, use the cwd */ + gchar *curdir = g_get_current_dir (); + + new_dir = open_dir(curdir, cmpl_state); + + if (new_dir) + *remaining_text = text_to_complete; + + g_free (curdir); + } + + g_free (tmp); + } + else + { + *remaining_text = text_to_complete; + + new_dir = open_dir(cmpl_state->reference_dir->fullname, cmpl_state); + } + + if(new_dir) + { + new_dir->cmpl_index = -1; + new_dir->cmpl_parent = NULL; + } + + return new_dir; +} + +/* open a directory by user name */ +static CompletionDir* +open_user_dir(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gchar *first_slash; + gint cmp_len; + + g_assert(text_to_complete && text_to_complete[0] == '~'); + + first_slash = strchr(text_to_complete, '/'); + + if (first_slash) + cmp_len = first_slash - text_to_complete - 1; + else + cmp_len = strlen(text_to_complete + 1); + + if(!cmp_len) + { + /* ~/ */ + gchar *homedir = g_get_home_dir (); + + if (homedir) + return open_dir(homedir, cmpl_state); + else + return NULL; + } + else + { + /* ~user/ */ + char* copy = g_new(char, cmp_len + 1); + struct passwd *pwd; + strncpy(copy, text_to_complete + 1, cmp_len); + copy[cmp_len] = 0; + pwd = getpwnam(copy); + g_free(copy); + if (!pwd) + { + cmpl_errno = errno; + return NULL; + } + + return open_dir(pwd->pw_dir, cmpl_state); + } +} + +/* open a directory relative the the current relative directory */ +static CompletionDir* +open_relative_dir(gchar* dir_name, + CompletionDir* dir, + CompletionState *cmpl_state) +{ + gchar path_buf[2*MAXPATHLEN]; + + if(dir->fullname_len + strlen(dir_name) + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir->fullname); + + if(dir->fullname_len > 1) + { + path_buf[dir->fullname_len] = '/'; + strcpy(path_buf + dir->fullname_len + 1, dir_name); + } + else + { + strcpy(path_buf + dir->fullname_len, dir_name); + } + + return open_dir(path_buf, cmpl_state); +} + +/* after the cache lookup fails, really open a new directory */ +static CompletionDirSent* +open_new_dir(gchar* dir_name, struct stat* sbuf, gboolean stat_subdirs) +{ + CompletionDirSent* sent; + DIR* directory; + gchar *buffer_ptr; + struct dirent *dirent_ptr; + gint buffer_size = 0; + gint entry_count = 0; + gint i; + struct stat ent_sbuf; + char path_buf[MAXPATHLEN*2]; + gint path_buf_len; + + sent = g_new(CompletionDirSent, 1); + sent->mtime = sbuf->st_mtime; + sent->inode = sbuf->st_ino; + sent->device = sbuf->st_dev; + + path_buf_len = strlen(dir_name); + + if (path_buf_len > MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir_name); + + directory = opendir(dir_name); + + if(!directory) + { + cmpl_errno = errno; + return NULL; + } + + while((dirent_ptr = readdir(directory)) != NULL) + { + int entry_len = strlen(dirent_ptr->d_name); + buffer_size += entry_len + 1; + entry_count += 1; + + if(path_buf_len + entry_len + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + closedir(directory); + return NULL; + } + } + + sent->name_buffer = g_new(gchar, buffer_size); + sent->entries = g_new(CompletionDirEntry, entry_count); + sent->entry_count = entry_count; + + buffer_ptr = sent->name_buffer; + + rewinddir(directory); + + for(i = 0; i < entry_count; i += 1) + { + dirent_ptr = readdir(directory); + + if(!dirent_ptr) + { + cmpl_errno = errno; + closedir(directory); + return NULL; + } + + strcpy(buffer_ptr, dirent_ptr->d_name); + sent->entries[i].entry_name = buffer_ptr; + buffer_ptr += strlen(dirent_ptr->d_name); + *buffer_ptr = 0; + buffer_ptr += 1; + + path_buf[path_buf_len] = '/'; + strcpy(path_buf + path_buf_len + 1, dirent_ptr->d_name); + + if (stat_subdirs) + { + if(stat(path_buf, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) + sent->entries[i].is_dir = 1; + else + /* stat may fail, and we don't mind, since it could be a + * dangling symlink. */ + sent->entries[i].is_dir = 0; + } + else + sent->entries[i].is_dir = 1; + } + + qsort(sent->entries, sent->entry_count, sizeof(CompletionDirEntry), compare_cmpl_dir); + + closedir(directory); + + return sent; +} + +static gboolean +check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) +{ + /* A list of directories that we know only contain other directories. + * Trying to stat every file in these directories would be very + * expensive. + */ + + static struct { + gchar *name; + gboolean present; + struct stat statbuf; + } no_stat_dirs[] = { + { "/afs", FALSE, { 0 } }, + { "/net", FALSE, { 0 } } + }; + + static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]); + static gboolean initialized = FALSE; + + gint i; + + if (!initialized) + { + initialized = TRUE; + for (i = 0; i < n_no_stat_dirs; i++) + { + if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) + no_stat_dirs[i].present = TRUE; + } + } + + if(stat(dir_name, result) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + *stat_subdirs = TRUE; + for (i=0; ist_dev) && + (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) + { + *stat_subdirs = FALSE; + break; + } + } + + return TRUE; +} + +/* open a directory by absolute pathname */ +static CompletionDir* +open_dir(gchar* dir_name, CompletionState* cmpl_state) +{ + struct stat sbuf; + gboolean stat_subdirs; + CompletionDirSent *sent; + GList* cdsl; + + if (!check_dir (dir_name, &sbuf, &stat_subdirs)) + return NULL; + + cdsl = cmpl_state->directory_sent_storage; + + while (cdsl) + { + sent = cdsl->data; + + if(sent->inode == sbuf.st_ino && + sent->mtime == sbuf.st_mtime && + sent->device == sbuf.st_dev) + return attach_dir(sent, dir_name, cmpl_state); + + cdsl = cdsl->next; + } + + sent = open_new_dir(dir_name, &sbuf, stat_subdirs); + + if (sent) { + cmpl_state->directory_sent_storage = + g_list_prepend(cmpl_state->directory_sent_storage, sent); + + return attach_dir(sent, dir_name, cmpl_state); + } + + return NULL; +} + +static CompletionDir* +attach_dir(CompletionDirSent* sent, gchar* dir_name, CompletionState *cmpl_state) +{ + CompletionDir* new_dir; + + new_dir = g_new(CompletionDir, 1); + + cmpl_state->directory_storage = + g_list_prepend(cmpl_state->directory_storage, new_dir); + + new_dir->sent = sent; + new_dir->fullname = g_strdup(dir_name); + new_dir->fullname_len = strlen(dir_name); + + return new_dir; +} + +static gint +correct_dir_fullname(CompletionDir* cmpl_dir) +{ + gint length = strlen(cmpl_dir->fullname); + struct stat sbuf; + + if (strcmp(cmpl_dir->fullname + length - 2, "/.") == 0) + { + if (length == 2) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } else { + cmpl_dir->fullname[length - 2] = 0; + } + } + else if (strcmp(cmpl_dir->fullname + length - 3, "/./") == 0) + cmpl_dir->fullname[length - 2] = 0; + else if (strcmp(cmpl_dir->fullname + length - 3, "/..") == 0) + { + if(length == 3) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 2] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + else if (strcmp(cmpl_dir->fullname + length - 4, "/../") == 0) + { + if(length == 4) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 3] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + + cmpl_dir->fullname_len = strlen(cmpl_dir->fullname); + + return TRUE; +} + +static gint +correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf) +{ + struct stat parbuf; + gchar *last_slash; + gchar *new_name; + gchar c = 0; + + last_slash = strrchr(cmpl_dir->fullname, '/'); + + g_assert(last_slash); + + if(last_slash != cmpl_dir->fullname) + { /* last_slash[0] = 0; */ } + else + { + c = last_slash[1]; + last_slash[1] = 0; + } + + if (stat(cmpl_dir->fullname, &parbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev) + /* it wasn't a link */ + return TRUE; + + if(c) + last_slash[1] = c; + /* else + last_slash[0] = '/'; */ + + /* it was a link, have to figure it out the hard way */ + + new_name = find_parent_dir_fullname(cmpl_dir->fullname); + + if (!new_name) + return FALSE; + + g_free(cmpl_dir->fullname); + + cmpl_dir->fullname = new_name; + + return TRUE; +} + +static gchar* +find_parent_dir_fullname(gchar* dirname) +{ + gchar buffer[MAXPATHLEN]; + gchar buffer2[MAXPATHLEN]; + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer)) +#else + if(!getcwd(buffer, MAXPATHLEN)) +#endif + { + cmpl_errno = errno; + return NULL; + } + + if(chdir(dirname) != 0 || chdir("..") != 0) + { + cmpl_errno = errno; + return NULL; + } + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer2)) +#else + if(!getcwd(buffer2, MAXPATHLEN)) +#endif + { + chdir(buffer); + cmpl_errno = errno; + + return NULL; + } + + if(chdir(buffer) != 0) + { + cmpl_errno = errno; + return NULL; + } + + return g_strdup(buffer2); +} + +/**********************************************************************/ +/* Completion Operations */ +/**********************************************************************/ + +static PossibleCompletion* +attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gint index, length; + + if (!cmpl_state->user_dir_name_buffer && + !get_pwdb(cmpl_state)) + return NULL; + length = strlen(text_to_complete) - 1; + + cmpl_state->user_completion_index += 1; + + while(cmpl_state->user_completion_index < cmpl_state->user_directories_len) + { + index = first_diff_index(text_to_complete + 1, + cmpl_state->user_directories + [cmpl_state->user_completion_index].login); + + switch(index) + { + case PATTERN_MATCH: + break; + default: + if(cmpl_state->last_valid_char < (index + 1)) + cmpl_state->last_valid_char = index + 1; + cmpl_state->user_completion_index += 1; + continue; + } + + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + append_completion_text("~", cmpl_state); + + append_completion_text(cmpl_state-> + user_directories[cmpl_state->user_completion_index].login, + cmpl_state); + + return append_completion_text("/", cmpl_state); + } + + if(text_to_complete[1] || + cmpl_state->user_completion_index > cmpl_state->user_directories_len) + { + cmpl_state->user_completion_index = -1; + return NULL; + } + else + { + cmpl_state->user_completion_index += 1; + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + return append_completion_text("~/", cmpl_state); + } +} + +/* returns the index (>= 0) of the first differing character, + * PATTERN_MATCH if the completion matches */ +static gint +first_diff_index(gchar* pat, gchar* text) +{ + gint diff = 0; + + while(*pat && *text && *text == *pat) + { + pat += 1; + text += 1; + diff += 1; + } + + if(*pat) + return diff; + + return PATTERN_MATCH; +} + +static PossibleCompletion* +append_completion_text(gchar* text, CompletionState* cmpl_state) +{ + gint len, i = 1; + + if(!cmpl_state->the_completion.text) + return NULL; + + len = strlen(text) + strlen(cmpl_state->the_completion.text) + 1; + + if(cmpl_state->the_completion.text_alloc > len) + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } + + while(i < len) { i <<= 1; } + + cmpl_state->the_completion.text_alloc = i; + + cmpl_state->the_completion.text = (gchar*)g_realloc(cmpl_state->the_completion.text, i); + + if(!cmpl_state->the_completion.text) + return NULL; + else + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } +} + +static CompletionDir* +find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash = strchr(text_to_complete, '/'); + CompletionDir* dir = cmpl_state->reference_dir; + CompletionDir* next; + *remaining_text = text_to_complete; + + while(first_slash) + { + gint len = first_slash - *remaining_text; + gint found = 0; + gchar *found_name = NULL; /* Quiet gcc */ + gint i; + gchar* pat_buf = g_new (gchar, len + 1); + + strncpy(pat_buf, *remaining_text, len); + pat_buf[len] = 0; + + for(i = 0; i < dir->sent->entry_count; i += 1) + { + if(dir->sent->entries[i].is_dir && + fnmatch(pat_buf, dir->sent->entries[i].entry_name, + FNMATCH_FLAGS)!= FNM_NOMATCH) + { + if(found) + { + g_free (pat_buf); + return dir; + } + else + { + found = 1; + found_name = dir->sent->entries[i].entry_name; + } + } + } + + if (!found) + { + /* Perhaps we are trying to open an automount directory */ + found_name = pat_buf; + } + + next = open_relative_dir(found_name, dir, cmpl_state); + + if(!next) + { + g_free (pat_buf); + return NULL; + } + + next->cmpl_parent = dir; + + dir = next; + + if(!correct_dir_fullname(dir)) + { + g_free(pat_buf); + return NULL; + } + + *remaining_text = first_slash + 1; + first_slash = strchr(*remaining_text, '/'); + + g_free (pat_buf); + } + + return dir; +} + +static void +update_cmpl(PossibleCompletion* poss, CompletionState* cmpl_state) +{ + gint cmpl_len; + + if(!poss || !cmpl_is_a_completion(poss)) + return; + + cmpl_len = strlen(cmpl_this_completion(poss)); + + if(cmpl_state->updated_text_alloc < cmpl_len + 1) + { + cmpl_state->updated_text = + (gchar*)g_realloc(cmpl_state->updated_text, + cmpl_state->updated_text_alloc); + cmpl_state->updated_text_alloc = 2*cmpl_len; + } + + if(cmpl_state->updated_text_len < 0) + { + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + cmpl_state->updated_text_len = cmpl_len; + cmpl_state->re_complete = cmpl_is_directory(poss); + } + else if(cmpl_state->updated_text_len == 0) + { + cmpl_state->re_complete = FALSE; + } + else + { + gint first_diff = + first_diff_index(cmpl_state->updated_text, + cmpl_this_completion(poss)); + + cmpl_state->re_complete = FALSE; + + if(first_diff == PATTERN_MATCH) + return; + + if(first_diff > cmpl_state->updated_text_len) + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + + cmpl_state->updated_text_len = first_diff; + cmpl_state->updated_text[first_diff] = 0; + } +} + +static PossibleCompletion* +attempt_file_completion(CompletionState *cmpl_state) +{ + gchar *pat_buf, *first_slash; + CompletionDir *dir = cmpl_state->active_completion_dir; + + dir->cmpl_index += 1; + + if(dir->cmpl_index == dir->sent->entry_count) + { + if(dir->cmpl_parent == NULL) + { + cmpl_state->active_completion_dir = NULL; + + return NULL; + } + else + { + cmpl_state->active_completion_dir = dir->cmpl_parent; + + return attempt_file_completion(cmpl_state); + } + } + + g_assert(dir->cmpl_text); + + first_slash = strchr(dir->cmpl_text, '/'); + + if(first_slash) + { + gint len = first_slash - dir->cmpl_text; + + pat_buf = g_new (gchar, len + 1); + strncpy(pat_buf, dir->cmpl_text, len); + pat_buf[len] = 0; + } + else + { + gint len = strlen(dir->cmpl_text); + + pat_buf = g_new (gchar, len + 2); + strcpy(pat_buf, dir->cmpl_text); + strcpy(pat_buf + len, "*"); + } + + if(first_slash) + { + if(dir->sent->entries[dir->cmpl_index].is_dir) + { + if(fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH) + { + CompletionDir* new_dir; + + new_dir = open_relative_dir(dir->sent->entries[dir->cmpl_index].entry_name, + dir, cmpl_state); + + if(!new_dir) + { + g_free (pat_buf); + return NULL; + } + + new_dir->cmpl_parent = dir; + + new_dir->cmpl_index = -1; + new_dir->cmpl_text = first_slash + 1; + + cmpl_state->active_completion_dir = new_dir; + + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + if(dir->cmpl_parent != NULL) + { + append_completion_text(dir->fullname + + strlen(cmpl_state->completion_dir->fullname) + 1, + cmpl_state); + append_completion_text("/", cmpl_state); + } + + append_completion_text(dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); + + cmpl_state->the_completion.is_a_completion = + (fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH); + + cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; + if(dir->sent->entries[dir->cmpl_index].is_dir) + append_completion_text("/", cmpl_state); + + g_free (pat_buf); + return &cmpl_state->the_completion; + } +} + + +static gint +get_pwdb(CompletionState* cmpl_state) +{ + struct passwd *pwd_ptr; + gchar* buf_ptr; + gint len = 0, i, count = 0; + + if(cmpl_state->user_dir_name_buffer) + return TRUE; + setpwent (); + + while ((pwd_ptr = getpwent()) != NULL) + { + len += strlen(pwd_ptr->pw_name); + len += strlen(pwd_ptr->pw_dir); + len += 2; + count += 1; + } + + setpwent (); + + cmpl_state->user_dir_name_buffer = g_new(gchar, len); + cmpl_state->user_directories = g_new(CompletionUserDir, count); + cmpl_state->user_directories_len = count; + + buf_ptr = cmpl_state->user_dir_name_buffer; + + for(i = 0; i < count; i += 1) + { + pwd_ptr = getpwent(); + if(!pwd_ptr) + { + cmpl_errno = errno; + goto error; + } + + strcpy(buf_ptr, pwd_ptr->pw_name); + cmpl_state->user_directories[i].login = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + strcpy(buf_ptr, pwd_ptr->pw_dir); + cmpl_state->user_directories[i].homedir = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + } + + qsort(cmpl_state->user_directories, + cmpl_state->user_directories_len, + sizeof(CompletionUserDir), + compare_user_dir); + + endpwent(); + + return TRUE; + +error: + + if(cmpl_state->user_dir_name_buffer) + g_free(cmpl_state->user_dir_name_buffer); + if(cmpl_state->user_directories) + g_free(cmpl_state->user_directories); + + cmpl_state->user_dir_name_buffer = NULL; + cmpl_state->user_directories = NULL; + + return FALSE; +} + +static gint +compare_user_dir(const void* a, const void* b) +{ + return strcmp((((CompletionUserDir*)a))->login, + (((CompletionUserDir*)b))->login); +} + +static gint +compare_cmpl_dir(const void* a, const void* b) +{ + return strcmp((((CompletionDirEntry*)a))->entry_name, + (((CompletionDirEntry*)b))->entry_name); +} + +static gint +cmpl_state_okay(CompletionState* cmpl_state) +{ + return cmpl_state && cmpl_state->reference_dir; +} + +static gchar* +cmpl_strerror(gint err) +{ + if(err == CMPL_ERRNO_TOO_LONG) + return "Name too long"; + else + return g_strerror (err); +} + + +/* Testing area */ +#ifdef TORRIE_DEBUG + +/* Get the selected filename and print it to the console */ +void file_ok_sel( GtkWidget *w, + GtkFileSelection *fs ) +{ + g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); +} + +void destroy( GtkWidget *widget, + gpointer data ) +{ + gtk_main_quit (); +} + +int main( int argc, + char *argv[] ) +{ + GtkWidget *filew; + + gtk_init (&argc, &argv); + + /* Create a new file selection widget */ + filew = gtk_file_selection_new ("Michael's Glorious File Selector"); +// gtk_file_selection_complete(GTK_FILE_SELECTION(filew),"bob"); + + + gtk_signal_connect (GTK_OBJECT (filew), "destroy", + (GtkSignalFunc) destroy, &filew); + /* Connect the ok_button to file_ok_sel function */ + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), + "clicked", (GtkSignalFunc) file_ok_sel, filew ); + + /* Connect the cancel_button to destroy the widget */ + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION + (filew)->cancel_button), + "clicked", (GtkSignalFunc) gtk_widget_destroy, + GTK_OBJECT (filew)); + + + gtk_widget_show(filew); + +/* + g_print("%d",gtk_file_selection_match_mask("mask.c","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m???.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m??*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c*")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","n*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.c","[mn]*")); + g_print("%d",gtk_file_selection_match_mask("COPYING","*.xpm")); +*/ + gtk_main (); + + return 0; +} + +/* example-end */ +#endif diff --git a/radiant/gtkfilesel-darwin.h b/radiant/gtkfilesel-darwin.h new file mode 100644 index 00000000..135a1fa5 --- /dev/null +++ b/radiant/gtkfilesel-darwin.h @@ -0,0 +1,129 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_FILESEL_H__ +#define __GTK_FILESEL_H__ + + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) +#define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) +#define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) +#define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) +#define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) + + +typedef struct _GtkFileSelection GtkFileSelection; +typedef struct _GtkFileSelectionClass GtkFileSelectionClass; + +struct _GtkFileSelection +{ + GtkWindow window; + + GtkWidget *dir_list; + GtkWidget *file_list; + GtkWidget *selection_entry; + GtkWidget *selection_text; + GtkWidget *main_vbox; + GtkWidget *ok_button; + GtkWidget *cancel_button; + GtkWidget *help_button; + + /* These are not used. Just fillers in the class structure */ + GtkWidget *history_pulldown; + GtkWidget *history_menu; + GList *history_list; + /* ***************** */ + + GtkWidget *fileop_dialog; + GtkWidget *fileop_entry; + gchar *fileop_file; + gpointer cmpl_state; + + GtkWidget *fileop_c_dir; + GtkWidget *fileop_del_file; + GtkWidget *fileop_ren_file; + + GtkWidget *button_area; + GtkWidget *action_area; + + GtkWidget *history_combo; + GList *prev_history; + GList *next_history; + GtkWidget *mask_entry; + gchar *mask; + gchar *saved_entry; + + GList *masks; + +}; + +struct _GtkFileSelectionClass +{ + GtkWindowClass parent_class; +}; + + +GtkType gtk_file_selection_get_type (void); +GtkWidget* gtk_file_selection_new (const gchar *title); +void gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename); +gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); +void gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern); +void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); +void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel); + +/* proposed interface */ +void gtk_file_selection_clear_masks (GtkFileSelection *filesel); +void gtk_file_selection_set_masks (GtkFileSelection *filesel, + const gchar **masks); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GTK_FILESEL_H__ */ + + + + + + + + + + diff --git a/radiant/gtkfilesel-linux.c b/radiant/gtkfilesel-linux.c new file mode 100644 index 00000000..16fe0b56 --- /dev/null +++ b/radiant/gtkfilesel-linux.c @@ -0,0 +1,4987 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ +#define LEO + +#ifdef LEO +#define _(a) a + +static char * back_xpm[] = { +"14 14 33 1", +" c None", +". c #000000", +"+ c #C6D7C6", +"@ c #E7EBE7", +"# c #FFFFFF", +"$ c #DEEBDE", +"% c #F7F7F7", +"& c #DEE7DE", +"* c #EFF3EF", +"= c #101810", +"- c #B5C7AD", +"; c #EFEFEF", +"> c #D6E3D6", +", c #213021", +"' c #315931", +") c #52824A", +"! c #739A6B", +"~ c #84A673", +"{ c #7BA673", +"] c #84AA73", +"^ c #84AA7B", +"/ c #84AE7B", +"( c #63925A", +"_ c #526D4A", +": c #4A7D42", +"< c #739E6B", +"[ c #739A63", +"} c #4A7539", +"| c #638E52", +"1 c #427139", +"2 c #6BA663", +"3 c #5A8A52", +"4 c #315929", +" ..", +" ..+.", +" ..@#+.", +" ..$#%%+.", +" ..&#%*%%+.", +" .=&#******+.", +"..-#;>&@****+,", +"..')!~{]^/^/(.", +" .._:<^~^/^(.", +" ..':[]~/(.", +" ..}:[~|.", +" ..123.", +" ..4.", +" .."}; + +static char * up_xpm[] = { +"14 14 36 1", +" c None", +". c #000000", +"+ c #181C18", +"@ c #D6DBD6", +"# c #94AA8C", +"$ c #000400", +"% c #DEDFDE", +"& c #94AA84", +"* c #E7E3E7", +"= c #94B28C", +"- c #6B865A", +"; c #EFEBEF", +"> c #9CB694", +", c #8CA684", +"' c #EFEFEF", +") c #F7EFF7", +"! c #9CB68C", +"~ c #63865A", +"{ c #94B684", +"] c #94AE84", +"^ c #739263", +"/ c #F7F3F7", +"( c #94B284", +"_ c #849E73", +": c #8CAE7B", +"< c #8CAA84", +"[ c #7B966B", +"} c #8CA67B", +"| c #DEDBD6", +"1 c #E7E7E7", +"2 c #8CAE84", +"3 c #8CAA7B", +"4 c #738E63", +"5 c #BDBEB5", +"6 c #BDC3BD", +"7 c #637D52", +" .. ", +" .. ", +" +@#$ ", +" .%&. ", +" .**=-. ", +" .;;>,. ", +" .*')!&~. ", +" .;)){]^. ", +" .*')/(]_-. ", +" .;)//::<[. ", +" .*')//:::}-. ", +" .|1;;12]3}4. ", +".556666^^^^-7.", +".............."}; + +static char * forward_xpm[] = { +"14 14 36 1", +" c None", +". c #000000", +"+ c #E7EBDE", +"@ c #FFFFFF", +"# c #F7F7EF", +"$ c #D6E3D6", +"% c #F7F7F7", +"& c #EFF3EF", +"* c #CEDFCE", +"= c #CEDBC6", +"- c #E7EFE7", +"; c #181818", +"> c #292829", +", c #E7EBE7", +"' c #DEE7DE", +") c #B5C7AD", +"! c #9CBA94", +"~ c #8CAE84", +"{ c #84AA7B", +"] c #7BA673", +"^ c #84A67B", +"/ c #739A6B", +"( c #5A824A", +"_ c #395931", +": c #9CBA8C", +"< c #84AE7B", +"[ c #739E6B", +"} c #527D4A", +"| c #425942", +"1 c #84A673", +"2 c #4A7142", +"3 c #94B284", +"4 c #395D31", +"5 c #5A8652", +"6 c #315929", +"7 c #396531", +".. ", +".+.. ", +".@#$.. ", +".@%&#*.. ", +".@%%&&%=.. ", +".@&&&&&-#=;. ", +">@&&&&,'$'&)..", +".!~{~{{]^/(_..", +".:{<{^{[}|.. ", +".:<1{/}2.. ", +".31/}4.. ", +".{56.. ", +".7.. ", +".. "}; + +static char * refresh_xpm[] = { +"16 16 11 1", +" c None", +". c #000000", +"+ c #526942", +"@ c #4A6139", +"# c #526542", +"$ c #5A7142", +"% c #425531", +"& c #314529", +"* c #425131", +"= c #425931", +"- c #5A754A", +" . ", +" .. ", +" .+@... ", +" .#$##@%.. ", +" .+#...%%. ", +" . .. .&. ", +" . . .&. ", +" .. .. ", +" .. .. ", +" .*. . . ", +" .*. .. . ", +" .%@...#=. ", +" ..##-#@#. ", +" ...@%. ", +" .. ", +" . "}; + +#endif + +#ifndef LEO +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fnmatch.h" + +#if (defined TORRIE_DEBUG || defined LEO) +#include +#include +#include +#include "gtkfilesel-linux.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#else +#include "gdk/gdkkeysyms.h" +#include "gtkbutton.h" +#include "gtkentry.h" +#include "gtkfilesel.h" +#include "gtkhbox.h" +#include "gtkhbbox.h" +#include "gtklabel.h" +#include "gtklist.h" +#include "gtklistitem.h" +#include "gtkmain.h" +#include "gtkscrolledwindow.h" +#include "gtksignal.h" +#include "gtkvbox.h" +#include "gtkmenu.h" +#include "gtkmenuitem.h" +#include "gtkoptionmenu.h" +#include "gtkclist.h" +#include "gtkdialog.h" +#include "gtkcombo.h" +#include "gtkframe.h" +#include "gtkhpaned.h" +#include "gtktable.h" +#include "gtkpixmap.h" +#include "gtknotebook.h" +#include "gtkhseparator.h" +#include "gtktogglebutton.h" +#endif + +#ifndef LEO +#include "gtkintl.h" + +#include "back.xpm" +#include "up.xpm" +#include "forward.xpm" +#include "refresh.xpm" +#endif + +#define DIR_LIST_WIDTH 180 +#define DIR_LIST_HEIGHT 180 +#define FILE_LIST_WIDTH 180 +#define FILE_LIST_HEIGHT 180 +#define BOOKMARK_FILE "/.gtkfilesel_bookmarks" +#define MASK_FILE "/.gtkfilesel_masks" +#define TIME_STRING_BUF 50 + +/* I've put this here so it doesn't get confused with the + * file completion interface */ +typedef struct _HistoryCallbackArg HistoryCallbackArg; + +struct _HistoryCallbackArg +{ + gchar *directory; + GtkWidget *menu_item; +}; + + +typedef struct _BookmarkMenuStruct BookmarkMenuStruct; +struct _BookmarkMenuStruct { + GtkWidget *menu_item; + gchar *desc; + gchar *path; +}; + +typedef struct _CompletionState CompletionState; +typedef struct _CompletionDir CompletionDir; +typedef struct _CompletionDirSent CompletionDirSent; +typedef struct _CompletionDirEntry CompletionDirEntry; +typedef struct _CompletionUserDir CompletionUserDir; +typedef struct _PossibleCompletion PossibleCompletion; + +/* Non-external file completion decls and structures */ + +/* A contant telling PRCS how many directories to cache. Its actually + * kept in a list, so the geometry isn't important. */ +#define CMPL_DIRECTORY_CACHE_SIZE 10 + +/* A constant used to determine whether a substring was an exact + * match by first_diff_index() + */ +#define PATTERN_MATCH -1 +/* The arguments used by all fnmatch() calls below + */ +#define FNMATCH_FLAGS (FNM_PATHNAME | FNM_PERIOD) + +#define CMPL_ERRNO_TOO_LONG ((1<<16)-1) + +/* This structure contains all the useful information about a directory + * for the purposes of filename completion. These structures are cached + * in the CompletionState struct. CompletionDir's are reference counted. + */ +struct _CompletionDirSent +{ + ino_t inode; + time_t mtime; + dev_t device; + + gint entry_count; + gchar *name_buffer; /* memory segment containing names of all entries */ + + struct _CompletionDirEntry *entries; +}; + +struct _CompletionDir +{ + CompletionDirSent *sent; + + gchar *fullname; + gint fullname_len; + + struct _CompletionDir *cmpl_parent; + gint cmpl_index; + gchar *cmpl_text; +}; + +/* This structure contains pairs of directory entry names with a flag saying + * whether or not they are a valid directory. NOTE: This information is used + * to provide the caller with information about whether to update its completions + * or try to open a file. Since directories are cached by the directory mtime, + * a symlink which points to an invalid file (which will not be a directory), + * will not be reevaluated if that file is created, unless the containing + * directory is touched. I consider this case to be worth ignoring (josh). + */ +struct _CompletionDirEntry +{ + gint is_dir; + gchar *entry_name; +}; + +struct _CompletionUserDir +{ + gchar *login; + gchar *homedir; +}; + +struct _PossibleCompletion +{ + /* accessible fields, all are accessed externally by functions + * declared above + */ + gchar *text; + gint is_a_completion; + gint is_directory; + + gint file_size; + gint file_time; + gint uid; + gint gid; + /* Private fields + */ + gint text_alloc; +}; + +struct _CompletionState +{ + gint last_valid_char; + gchar *updated_text; + gint updated_text_len; + gint updated_text_alloc; + gint re_complete; + + gchar *user_dir_name_buffer; + gint user_directories_len; + + gchar *last_completion_text; + + gint user_completion_index; /* if >= 0, currently completing ~user */ + + struct _CompletionDir *completion_dir; /* directory completing from */ + struct _CompletionDir *active_completion_dir; + + struct _PossibleCompletion the_completion; + + struct _CompletionDir *reference_dir; /* initial directory */ + + GList* directory_storage; + GList* directory_sent_storage; + + struct _CompletionUserDir *user_directories; +}; + +/* Widgets from the Properties Dialog */ +typedef struct _PropertiesPrivate PropertiesPrivate; + +struct _PropertiesPrivate +{ + GtkWidget *mode_label; + GtkWidget *mode_buttons[12]; +}; + +/* pixmap creation function */ +GtkWidget* create_pixmap (GtkWidget *widget, + const gchar *pixmap_char); + +/* File completion functions which would be external, were they used + * outside of this file. + */ + +static CompletionState* cmpl_init_state (void); +static void cmpl_free_state (CompletionState *cmpl_state); +static gint cmpl_state_okay (CompletionState* cmpl_state); +static gchar* cmpl_strerror (gint); + +static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete, + gchar **remaining_text, + CompletionState *cmpl_state); + +/* Returns a name for consideration, possibly a completion, this name + * will be invalid after the next call to cmpl_next_completion. + */ +static char* cmpl_this_completion (PossibleCompletion*); + +/* True if this completion matches the given text. Otherwise, this + * output can be used to have a list of non-completions. + */ +static gint cmpl_is_a_completion (PossibleCompletion*); + +/* True if the completion is a directory + */ +static gint cmpl_is_directory (PossibleCompletion*); + +/* Obtains the next completion, or NULL + */ +static PossibleCompletion* cmpl_next_completion (CompletionState*); + +/* Updating completions: the return value of cmpl_updated_text() will + * be text_to_complete completed as much as possible after the most + * recent call to cmpl_completion_matches. For the present + * application, this is the suggested replacement for the user's input + * string. You must CALL THIS AFTER ALL cmpl_text_completions have + * been received. + */ +static gchar* cmpl_updated_text (CompletionState* cmpl_state); + +/* After updating, to see if the completion was a directory, call + * this. If it was, you should consider re-calling completion_matches. + */ +static gint cmpl_updated_dir (CompletionState* cmpl_state); + +/* Current location: if using file completion, return the current + * directory, from which file completion begins. More specifically, + * the cwd concatenated with all exact completions up to the last + * directory delimiter('/'). + */ +static gchar* cmpl_reference_position (CompletionState* cmpl_state); + +/* backing up: if cmpl_completion_matches returns NULL, you may query + * the index of the last completable character into cmpl_updated_text. + */ +static gint cmpl_last_valid_char (CompletionState* cmpl_state); + +/* When the user selects a non-directory, call cmpl_completion_fullname + * to get the full name of the selected file. + */ +static gchar* cmpl_completion_fullname (gchar*, CompletionState* cmpl_state); + + +/* Directory operations. */ +static CompletionDir* open_ref_dir (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static gboolean check_dir (gchar *dir_name, + struct stat *result, + gboolean *stat_subdirs); +static CompletionDir* open_dir (gchar* dir_name, + CompletionState* cmpl_state); +static CompletionDir* open_user_dir (gchar* text_to_complete, + CompletionState *cmpl_state); +static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, + CompletionState *cmpl_state); +static CompletionDirSent* open_new_dir (gchar* dir_name, + struct stat* sbuf, + gboolean stat_subdirs); +static gint correct_dir_fullname (CompletionDir* cmpl_dir); +static gint correct_parent (CompletionDir* cmpl_dir, + struct stat *sbuf); +static gchar* find_parent_dir_fullname (gchar* dirname); +static CompletionDir* attach_dir (CompletionDirSent* sent, + gchar* dir_name, + CompletionState *cmpl_state); +static void free_dir_sent (CompletionDirSent* sent); +static void free_dir (CompletionDir *dir); +static void prune_memory_usage(CompletionState *cmpl_state); + +/* Completion operations */ +static PossibleCompletion* attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state); +static PossibleCompletion* attempt_file_completion(CompletionState *cmpl_state); +static CompletionDir* find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static PossibleCompletion* append_completion_text(gchar* text, + CompletionState* cmpl_state); +static gint get_pwdb(CompletionState* cmpl_state); +static gint first_diff_index(gchar* pat, gchar* text); +static gint compare_user_dir(const void* a, const void* b); +static gint compare_cmpl_dir(const void* a, const void* b); +static void update_cmpl(PossibleCompletion* poss, + CompletionState* cmpl_state); + +static void gtk_file_selection_class_init (GtkFileSelectionClass *klass); +static void gtk_file_selection_init (GtkFileSelection *filesel); +static void gtk_file_selection_realize (GtkWidget *widget); +static void gtk_file_selection_destroy (GtkObject *object); +static gint gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); + +static void gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data); + +static void gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete); +static void gtk_file_selection_abort (GtkFileSelection *fs); + +static void gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_dir); + +static void gtk_file_selection_create_dir (gpointer data); +static void gtk_file_selection_delete_file (gpointer data); +static void gtk_file_selection_rename_file (gpointer data); +static void gtk_file_selection_properties (gpointer data); +static void gtk_file_selection_properties_update_mode (GtkWidget *widget, gpointer data); +static mode_t gtk_file_selection_properties_get_mode (PropertiesPrivate* private); + +static gboolean gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data); +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + + gpointer user_data); +static void gtk_file_selection_bookmark_callback (GtkWidget *widget, gpointer data); +static void gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data); +static gint gtk_file_selection_mask_entry_key_callback (GtkWidget *widget, GdkEventKey *event, gpointer data); +static gint gtk_file_selection_mask_entry_button_callback (GtkWidget *widget, GdkEventButton *event, gpointer data); + +//static void gtk_file_selection_home_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_bookmark_button (GtkWidget *widget, + GtkFileSelection *fs); + +static void gtk_file_selection_up_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_prev_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_next_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data); + +static gint gtk_file_selection_files_list_key_callback (GtkWidget *widget, GdkEventKey *event, gpointer data); + + +static gint gtk_file_selection_match_char (gchar, gchar *mask); +static gint gtk_file_selection_match_mask (gchar *,gchar *); + +static void gtk_file_selection_load_bookmarks(GtkFileSelection *fs); +static void gtk_file_selection_add_bookmark (GtkFileSelection *fs, gchar *desc, gchar *path); +gint gtk_file_selection_save_bookmarks (GtkFileSelection *fs); + +static void gtk_file_selection_load_masks(GtkFileSelection *fs); + +static gint gtk_file_selection_show_fileop_menu (GtkCList *clist, + GdkEvent *event, + GtkFileSelection *fs); + + +static GtkWindowClass *parent_class = NULL; + +/* Saves errno when something cmpl does fails. */ +static gint cmpl_errno; + +#ifdef G_WITH_CYGWIN +/* + * Take the path currently in the file selection + * entry field and translate as necessary from + * a WIN32 style to CYGWIN32 style path. For + * instance translate: + * x:\somepath\file.jpg + * to: + * //x/somepath/file.jpg + * + * Replace the path in the selection text field. + * Return a boolean value concerning whether a + * translation had to be made. + */ +int +translate_win32_path (GtkFileSelection *filesel) +{ + int updated = 0; + gchar *path; + + /* + * Retrieve the current path + */ + path = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); + + /* + * Translate only if this looks like a DOS-ish + * path... First handle any drive letters. + */ + if (isalpha (path[0]) && (path[1] == ':')) { + /* + * This part kind of stinks... It isn't possible + * to know if there is enough space in the current + * string for the extra character required in this + * conversion. Assume that there isn't enough space + * and use the set function on the text field to + * set the newly created string. + */ + gchar *newPath = g_strdup_printf ("//%c/%s", path[0], (path + 3)); + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), newPath); + + path = newPath; + updated = 1; + } + + /* + * Now, replace backslashes with forward slashes + * if necessary. + */ + if (strchr (path, '\\')) + { + int index; + for (index = 0; path[index] != '\0'; index++) + if (path[index] == '\\') + path[index] = '/'; + + updated = 1; + } + + return updated; +} +#endif + +/* General notes: + * Make prev and next inactive if their respective * + * histories are empty. + * Add facilities for handling hidden files and * + * directories * + * Add an api to access the mask, and hidden files * + * check box? (prob not in 1.2.x series) * + */ + +/* Routine for applying mask to filenames * + * Need to be optimized to minimize recursion * + * help the for loop by looking for the next * + * instance of the mask character following * + * the '*'. ei *.c -- look for '.' * + * Also, swap all *? pairs (-> ?*), as that * + * will make it possible to look ahead (? * + * makes it very nondeterministic as in *?.c * + * which really is ?*.c * + * * + */ +static gint gtk_file_selection_match_char (gchar text, gchar *mask) +{ + gchar *maskc; + gint x; + gint s; + gchar lastc; + gchar nextc; + + if (mask[0] == '[') + { + if (!strchr (mask,']')) return 0; + lastc = 0; + + maskc = g_strdup(mask + 1); /* get the portion of mask inside []*/ + (*(strchr (maskc + 1,']'))) = 0; + s = strlen ((char *)maskc); + + for (x = 0 ; x < s ; x ++){ + if (maskc[x] == '-') + { + if (x == s) return 1; + nextc = maskc[x + 1]; + + if (nextc > lastc) + { + if ((lastc <= text) && (nextc >= text)) + { + g_free (maskc); + return s + 2; + } + } + else if ((lastc >= text) && (nextc <= text)) + { + g_free (maskc); + return s + 2; + } + } + else if (text == maskc[x]) + { + g_free (maskc); + return s + 2; + } + lastc = maskc[x]; + } + g_free (maskc); + + return 0; + } + + if (mask[0] == '?') return 1; + if (mask[0] == text) return 1; + + return 0; +} + + +static gint gtk_file_selection_match_mask1 (gchar *text, gchar *mask) +{ + + int mc; + int tc; + + tc = 0; mc = 0; + + if (mask[0] == 0 && text[0] == 0) return 1; + + if (mask[0] == '*') + { + for (tc = 0; tc <= strlen(text); tc++) + { + if (gtk_file_selection_match_mask1 (text + tc, mask + 1)) + return 1; + } + return 0; + } + mc = gtk_file_selection_match_char (text[0], mask); + + if(mc) + return gtk_file_selection_match_mask1 (text + 1, mask + mc); + else + return 0; +} + +static gint gtk_file_selection_match_mask (gchar *text, gchar *mask) +{ + gchar *masks; + gchar *bmask; + gchar *emask; + + masks=g_strdup(mask); + + emask=strchr(masks,'<'); + if(emask){ + bmask=emask+1; + emask=strchr(bmask,'>'); + if(emask){ + *emask=0; + } + }else{ + bmask=masks; + } + + do{ + if((emask=strchr(bmask,',')) || (emask=strchr(bmask,';'))){ + *emask=0; + if (gtk_file_selection_match_mask1 (text, bmask)){ + g_free(masks); + return 1; + } + + bmask=emask+1; + } + }while(emask); + + if(gtk_file_selection_match_mask1 (text, bmask)){ + g_free(masks); + return 1; + } + g_free(masks); + return 0; +} + +static void +gtk_file_selection_load_bookmarks(GtkFileSelection *fs) +{ + GList *list; + gchar *bookmark_file; + gchar *bookmark_data; + struct stat file_info; + gint file; + gint lp; + gint cp; + BookmarkMenuStruct *item; + + + if(fs->bookmark_list){ //erase + list=fs->bookmark_list; + while(list){ + item=list->data; + g_free(item->desc); + g_free(item->path); + g_free(item); + list=list->next; + } + g_list_free (fs->bookmark_list); + fs->bookmark_list = NULL; + gtk_widget_destroy (fs->bookmark_menu); + } + + fs->bookmark_menu=gtk_menu_new(); + + /* spacer */ + item=g_malloc(sizeof(item)); + item->menu_item = gtk_menu_item_new(); + gtk_widget_show(item->menu_item); + gtk_menu_append (GTK_MENU(fs->bookmark_menu), item->menu_item); + + item=g_malloc(sizeof(item)); + item->desc=g_strdup("Add bookmark"); + item->path=g_strdup("."); + item->menu_item=gtk_menu_item_new_with_label (item->desc); + gtk_widget_show(item->menu_item); + //fs->bookmark_list=g_list_append(fs->bookmark_list,item); + //set signal here!! + gtk_menu_append (GTK_MENU(fs->bookmark_menu), item->menu_item); + + item=g_malloc(sizeof(item)); + item->desc=g_strdup("Edit bookmark"); + item->path=g_strdup("."); + item->menu_item=gtk_menu_item_new_with_label (item->desc); + gtk_widget_show(item->menu_item); + //fs->bookmark_list=g_list_append(fs->bookmark_list,item); + //set signal here!! + gtk_menu_append (GTK_MENU(fs->bookmark_menu), item->menu_item); + + bookmark_file=g_strconcat(g_get_home_dir(), BOOKMARK_FILE ,NULL); + if(!stat(bookmark_file,&file_info) && (file = open(bookmark_file, O_RDONLY )) > 0) + { + if(file_info.st_size <65536 ) + { + bookmark_data=g_malloc(file_info.st_size); + + if(file && read(file, bookmark_data, file_info.st_size)) + { + cp=lp=0; + + while (cp < file_info.st_size) + { + while (cp < file_info.st_size && bookmark_data[cp] != '<' ) + cp++; + bookmark_data[cp]=0; + item=g_malloc(sizeof(BookmarkMenuStruct)); + item->desc=g_strdup(bookmark_data+lp); + lp=++cp; + + while (cp < file_info.st_size && bookmark_data[cp] != '>' ) + cp++; + + bookmark_data[cp]=0; + //create menu items + item->path=g_strdup(bookmark_data+lp); + gtk_file_selection_add_bookmark ((gpointer) fs, (gpointer) item->desc, (gpointer) item->path); + + cp++; + + while(cp < file_info.st_size && bookmark_data[cp] < 33 ) + cp++; + lp=cp; + } + } + + close(file); + } + } else { + + /* Add some default items, then save off to bookmarks file */ + + gtk_file_selection_add_bookmark ((gpointer) fs, "Home", "~/"); + gtk_file_selection_add_bookmark ((gpointer) fs, "Root", "/"); + + gtk_file_selection_save_bookmarks ((gpointer) fs); + } +} + +static void +gtk_file_selection_add_bookmark (GtkFileSelection *fs, gchar *desc, gchar *path) +{ + /* Add item to menu */ + BookmarkMenuStruct *item; + item=g_malloc(sizeof(item)); + item->desc = (gpointer) desc; + item->path = (gpointer) path; + item->menu_item=gtk_menu_item_new_with_label (item->desc); + gtk_widget_show(item->menu_item); + fs->bookmark_list=g_list_append(fs->bookmark_list,item); + gtk_signal_connect (GTK_OBJECT(item->menu_item), "activate", + (GtkSignalFunc) gtk_file_selection_bookmark_callback, + (gpointer) fs); + gtk_menu_insert (GTK_MENU(fs->bookmark_menu), item->menu_item, g_list_length(fs->bookmark_list) -1); +} + +gint +gtk_file_selection_save_bookmarks (GtkFileSelection *fs) +{ + BookmarkMenuStruct *item; + gchar *bookmark_file; + gchar *item_data; + gint file; + GList *list; + + bookmark_file=g_strconcat(g_get_home_dir(), BOOKMARK_FILE ,NULL); + + if ((file = open(bookmark_file, O_CREAT | O_WRONLY | O_TRUNC, 0600)) > 0) + { + for (list = g_list_first (fs->bookmark_list); list != NULL; list = g_list_next(list)) { + item = list->data; + item_data = g_strconcat(item->desc, " <", item->path, ">\n", NULL); + if (write (file, item_data, strlen(item_data)) != strlen(item_data)) { + return TRUE; + } + g_free(item_data); + } + + close(file); + } else { + return TRUE; + } + + return FALSE; +} + +static void +gtk_file_selection_load_masks(GtkFileSelection *fs) +{ + /* + GList *list; + gchar *masks_file; + gchar *masks_data; + struct stat file_info; + gint file; + gint lp; + gint cp; + + if(fs->masks){ + list=fs->masks; + while(list){ + g_free(list->data); + list=list->next; + } + fs->masks = NULL; + } + + masks_file=g_strconcat(g_get_home_dir(), MASK_FILE,NULL); //put in #define + if(!stat(masks_file,&file_info)) + { + if(file_info.st_size <65536 ) + { + masks_data=g_malloc(file_info.st_size); + + file = open(masks_file, O_RDONLY ); + + if(file && read(file, masks_data, file_info.st_size)) + { + cp=lp=0; + + while (cp < file_info.st_size) + { + while (cp < file_info.st_size && masks_data[cp] != '>' ) + cp++; + + masks_data[++cp]=0; + if (masks_data[lp]=='<') { //if there was no description, strip off brackets + lp++; + masks_data[cp-1]=0; + } +// g_print("%s\n",masks_data+lp); + fs->masks = g_list_append(fs->masks, g_strdup(masks_data+lp)); + + while(cp < file_info.st_size && masks_data[cp] < 33 ) + cp++; + lp=cp; + } + } + + close(file); + } + } + */ + if (!fs->masks) { + /* masks is still null, fill it with default data... */ + /* + fs->masks = g_list_append(fs->masks, "all files <*>"); + fs->masks = g_list_append(fs->masks, "mp3s/playlists <*.mp3,*.m3u>"); + fs->masks = g_list_append(fs->masks, "src/hdr <*.[CcHh],*.[Cc][Cc],*.[Hh][Hh],*.cpp>"); + fs->masks = g_list_append(fs->masks, "html docs <*.html,*.htm,*.HTM,*.php*,*.inc>"); + fs->masks = g_list_append(fs->masks, "images <*.png,*.jpg,*.jpeg,*.gif,*.xpm,*.tiff>"); + fs->masks = g_list_append(fs->masks, "package <*.rpm,*.deb>"); + fs->masks = g_list_append(fs->masks, "archive <*.tgz,*.tb2,*.tar*,*.zip,*.rar>"); + fs->masks = g_list_append(fs->masks, "compressed <*.Z,*.gz,*.bz2>"); + */ + } +} + +void gtk_file_selection_clear_masks (GtkFileSelection *filesel) +{ + GList *list; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + list = filesel->masks; + while (list) + { + g_free (list->data); + list = list->next; + } + filesel->masks = NULL; + + gtk_list_clear_items (GTK_LIST (GTK_COMBO (filesel->mask_entry)->list), 0, -1); +} + +void gtk_file_selection_set_masks (GtkFileSelection *filesel, const gchar **masks) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + while (*masks) + { + filesel->masks = g_list_append (filesel->masks, (gpointer)*masks); + masks++; + } + + if (filesel->masks) + gtk_combo_set_popdown_strings (GTK_COMBO (filesel->mask_entry), filesel->masks); +} + +GtkType +gtk_file_selection_get_type (void) +{ + static GtkType file_selection_type = 0; + + if (!file_selection_type) + { + static const GtkTypeInfo filesel_info = + { + "GtkFileSelection", + sizeof (GtkFileSelection), + sizeof (GtkFileSelectionClass), + (GtkClassInitFunc) gtk_file_selection_class_init, + (GtkObjectInitFunc) gtk_file_selection_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); + } + + return file_selection_type; +} + +static void +gtk_file_selection_class_init (GtkFileSelectionClass *class) +{ + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + + object_class = (GtkObjectClass*) class; + + parent_class = gtk_type_class (GTK_TYPE_WINDOW); + + widget_class = GTK_WIDGET_CLASS (class); + + widget_class->realize = gtk_file_selection_realize; + object_class->destroy = gtk_file_selection_destroy; +} + +static void +gtk_file_selection_init (GtkFileSelection *filesel) +{ + GtkWidget *entry_vbox; + GtkWidget *label; + GtkWidget *list_vbox; + GtkWidget *confirm_area; + GtkWidget *vbox; + GtkWidget *hbox; + GtkWidget *hbox2; + GtkWidget *table; + GtkWidget *pulldown_hbox; + GtkWidget *scrolled_win; + GtkWidget *mask_label; + GtkWidget *bigframe; + GtkWidget *button; + GtkWidget *hpaned; + GtkWidget *menu_item; + GtkWidget *pixmap; + + char *dir_title [2]; + char *file_title [2]; + + filesel->cmpl_state = cmpl_init_state (); + + filesel->mask=NULL; + filesel->prev_history=NULL; + filesel->next_history=NULL; + filesel->saved_entry=NULL; + filesel->bookmark_list=NULL; + filesel->masks=NULL; + filesel->selection_text = NULL; + filesel->fileop_data = NULL; + + gtk_file_selection_load_masks(filesel); + gtk_file_selection_load_bookmarks(filesel); + + /* The dialog-sized vertical box */ + filesel->main_vbox = gtk_vbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (filesel), 0); + gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox); + gtk_widget_show (filesel->main_vbox); + + /* hbox for pulldown menu */ + pulldown_hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); + gtk_widget_show (pulldown_hbox); + + /* The horizontal box containing create, rename etc. buttons */ + +/* + filesel->button_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(filesel->button_area), GTK_BUTTONBOX_START); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(filesel->button_area), 0); + gtk_box_pack_start (GTK_BOX (pulldown_hbox), filesel->button_area, + FALSE, FALSE, 0); + gtk_button_box_set_child_size(GTK_BUTTON_BOX(filesel->button_area),0,0); + gtk_button_box_set_child_ipadding(GTK_BUTTON_BOX(filesel->button_area),0,0); + */ + + filesel->button_area = gtk_hbox_new (TRUE,0); + //gtk_box_pack_start (GTK_BOX (pulldown_hbox), filesel->button_area, + // FALSE, FALSE, 0); + + //gtk_widget_show (filesel->button_area); + + gtk_file_selection_show_fileop_buttons(filesel); + /* frame to put the following hbox in */ + bigframe = gtk_frame_new (NULL); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), bigframe, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (bigframe), GTK_SHADOW_OUT); + gtk_widget_show (bigframe); + + + list_vbox = gtk_vbox_new (FALSE,3); + gtk_widget_show(list_vbox); + gtk_container_add (GTK_CONTAINER(bigframe), list_vbox); + gtk_container_set_border_width (GTK_CONTAINER (list_vbox),2); + gtk_widget_show (list_vbox); + + /* The horizontal box containing the directory and file listboxes */ +// list_hbox = gtk_hbox_new (FALSE, 3); + //gtk_container_add (GTK_CONTAINER(bigframe), list_hbox); + //gtk_container_set_border_width (GTK_CONTAINER (list_hbox), 3); +// gtk_box_pack_start(GTK_BOX(list_vbox), list_hbox, FALSE,FALSE,0); +// gtk_widget_show (list_hbox); + + hpaned=gtk_hpaned_new(); + gtk_widget_show(hpaned); + gtk_container_set_border_width (GTK_CONTAINER (hpaned), 1); + gtk_paned_set_gutter_size (GTK_PANED (hpaned), 10); + gtk_box_pack_start (GTK_BOX(list_vbox), hpaned,TRUE,TRUE,0); + + /* vbox to put the buttons and directory listing in */ + vbox = gtk_vbox_new (FALSE, 3); + gtk_widget_show (vbox); + gtk_container_add(GTK_CONTAINER(hpaned),vbox); + //gtk_box_pack_start (GTK_BOX (hpaned), vbox, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 4); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + +// home_button = gtk_button_new_with_label (_("Home")); +// gtk_widget_show (home_button); +// gtk_signal_connect (GTK_OBJECT (home_button), "clicked", +// (GtkSignalFunc) gtk_file_selection_home_button, +// (gpointer) filesel); +// gtk_box_pack_start (GTK_BOX (hbox), home_button, TRUE,TRUE, 0); + + /* Here we add the bookmark menu button */ + #define If we're going to make bookmark a menu, we don't need + #define to keep it in the filesel structure + button=gtk_button_new_with_label(_("Bookmarks")); + gtk_widget_show(button); + gtk_box_pack_start (GTK_BOX(hbox), button, FALSE,FALSE,0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_bookmark_button, + (gpointer) filesel); + + hbox2 = gtk_hbox_new (FALSE, 2); + gtk_box_pack_start (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); + gtk_widget_show(hbox2); + + /* Prev button */ + button = gtk_button_new (); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_prev_button, + (gpointer) filesel); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE,FALSE, 0); + pixmap = create_pixmap (filesel->main_vbox, (gpointer) back_xpm); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (button), pixmap); + + /* Up button */ + button = gtk_button_new (); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_up_button, + (gpointer) filesel); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE,FALSE, 0); + pixmap = create_pixmap (filesel->main_vbox, (gpointer) up_xpm); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (button), pixmap); + + /* next button */ + button = gtk_button_new (); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_next_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE,FALSE, 0); + pixmap = create_pixmap (filesel->main_vbox, (gpointer) forward_xpm); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (button), pixmap); + + /* refresh button */ + button = gtk_button_new (); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_refresh_button, + (gpointer) filesel); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE,FALSE, 0); + pixmap = create_pixmap (filesel->main_vbox, (gpointer) refresh_xpm); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (button), pixmap); + + /* menu for right click file operations */ + filesel->fileop_menu = gtk_menu_new(); + + menu_item = gtk_menu_item_new_with_label ("Rename..."); + gtk_widget_show(menu_item); + gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", + (GtkSignalFunc) gtk_file_selection_rename_file, + (gpointer) filesel); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + + menu_item = gtk_menu_item_new_with_label ("Delete"); + gtk_widget_show(menu_item); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", + (GtkSignalFunc) gtk_file_selection_delete_file, + (gpointer) filesel); + + menu_item = gtk_menu_item_new (); + gtk_widget_show(menu_item); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + + menu_item = gtk_menu_item_new_with_label ("Create Directory..."); + gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", + (GtkSignalFunc) gtk_file_selection_create_dir, + (gpointer) filesel); + gtk_widget_show(menu_item); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + + menu_item = gtk_menu_item_new (); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + gtk_widget_show(menu_item); + + menu_item = gtk_menu_item_new_with_label ("Properties..."); + gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", + (GtkSignalFunc) gtk_file_selection_properties, + (gpointer) filesel); + gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); + gtk_widget_show(menu_item); + + /* The directories clist */ + dir_title[0] = _("Directories"); + dir_title[1] = NULL; + filesel->dir_list = gtk_clist_new_with_titles (1, (gchar**) dir_title); + gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", + (GtkSignalFunc) gtk_file_selection_dir_button, + (gpointer) filesel); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "unselect_row", + (GtkSignalFunc) gtk_file_selection_undir_button, + (gpointer) filesel); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "button_press_event", + GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), + (gpointer) filesel); + + gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE,TRUE, 0); + //gtk_container_add(GTK_CONTAINER(hpaned), scrolled_win); + + gtk_widget_show (filesel->dir_list); + gtk_widget_show (scrolled_win); + + vbox = gtk_vbox_new (FALSE, 3); + gtk_widget_show (vbox); + gtk_container_add(GTK_CONTAINER(hpaned),vbox); + /* vbox area for mask entry and files clist */ + + hbox = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + mask_label = gtk_label_new (_("Mask:")); + gtk_widget_show (mask_label); + gtk_box_pack_start (GTK_BOX (hbox), mask_label, FALSE, FALSE, 2); + +/* + filesel->mask_entry = gtk_entry_new (); + gtk_widget_show (filesel->mask_entry); + gtk_signal_connect(GTK_OBJECT(filesel->mask_entry),"activate", + (GtkSignalFunc) gtk_file_4_mask_entry_callback, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox),filesel->mask_entry, TRUE, TRUE, 0); + */ + + filesel->mask_entry = gtk_combo_new (); + gtk_widget_show (filesel->mask_entry); + gtk_combo_set_value_in_list(GTK_COMBO(filesel->mask_entry),FALSE,FALSE); + gtk_signal_connect(GTK_OBJECT(GTK_COMBO(filesel->mask_entry)->entry),"activate", + (GtkSignalFunc) gtk_file_selection_mask_entry_callback, + (gpointer) filesel); + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->mask_entry)->entry),"key-press-event", + (GtkSignalFunc) gtk_file_selection_mask_entry_key_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->mask_entry)->list),"button-release-event", + (GtkSignalFunc) gtk_file_selection_mask_entry_button_callback, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox),filesel->mask_entry, TRUE, TRUE, 0); + + if (filesel->masks) + gtk_combo_set_popdown_strings (GTK_COMBO (filesel->mask_entry), filesel->masks); + + + /* The files clist */ + file_title[0] = _("Files"); + file_title[1] = NULL; + filesel->file_list = gtk_clist_new_with_titles (1, (gchar**) file_title); + gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", + (GtkSignalFunc) gtk_file_selection_file_button, + (gpointer) filesel); + gtk_signal_connect (GTK_OBJECT (filesel->file_list), "key-press-event", + (GtkSignalFunc) gtk_file_selection_files_list_key_callback, + (gpointer) filesel); + + gtk_signal_connect (GTK_OBJECT (filesel->file_list), "button_press_event", + GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), + (gpointer) filesel); + + gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); + gtk_widget_show (filesel->file_list); + gtk_widget_show (scrolled_win); + + /* action area for packing buttons into. */ + filesel->action_area = gtk_hbox_new (TRUE, 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, + FALSE, FALSE, 2); + gtk_widget_show (filesel->action_area); + + /* + hbox=gtk_hbox_new(FALSE,0); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), hbox, FALSE,FALSE, 0); + gtk_widget_show (hbox); + */ + + /* The selection entry widget */ + + entry_vbox = gtk_vbox_new (FALSE, 0); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); + gtk_widget_show (entry_vbox); + + table = gtk_table_new ( 2, 2, FALSE ); + gtk_box_pack_start (GTK_BOX (entry_vbox), table, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (table), 4); + gtk_table_set_row_spacings (GTK_TABLE (table), 2); + gtk_table_set_col_spacings (GTK_TABLE (table), 4); + + + label = gtk_label_new (_("Selection:")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_show (label); + + + filesel->selection_entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event", + (GtkSignalFunc) gtk_file_selection_key_press, filesel); + gtk_table_attach (GTK_TABLE (table), filesel->selection_entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_show (filesel->selection_entry); + + + label = gtk_label_new (_("Directory:")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_show (label); + + + filesel->history_combo = gtk_combo_new(); + gtk_combo_set_value_in_list(GTK_COMBO(filesel->history_combo),FALSE,FALSE); + gtk_table_attach (GTK_TABLE (table), filesel->history_combo, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_show(filesel->history_combo); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->entry),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"button-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_key_handler, + (gpointer) filesel); + + filesel->selection_text = NULL; + + + /* The OK/Cancel button area */ + confirm_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_area), 5); + gtk_box_pack_end (GTK_BOX (entry_vbox), confirm_area, FALSE, FALSE, 0); + gtk_widget_show (confirm_area); + + /* The OK button */ + filesel->ok_button = gtk_button_new_with_label (_("OK")); + GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event", + (GtkSignalFunc) gtk_widget_grab_default, + GTK_OBJECT (filesel->ok_button)); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate", + (GtkSignalFunc) gtk_button_clicked, + GTK_OBJECT (filesel->ok_button)); + gtk_widget_grab_default (filesel->ok_button); + gtk_widget_show (filesel->ok_button); + + /* The Cancel button */ + filesel->cancel_button = gtk_button_new_with_label (_("Cancel")); + GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0); + gtk_widget_show (filesel->cancel_button); + + gtk_widget_show(table); + + + /* + filesel->selection_text = label = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (entry_vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + */ + + + if (!cmpl_state_okay (filesel->cmpl_state)) + { + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + /* + gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf); + */ + } + else + { + gtk_file_selection_populate (filesel, "", FALSE); + } + + gtk_widget_grab_focus (filesel->selection_entry); +} + +GtkWidget* +gtk_file_selection_new (const gchar *title) +{ + GtkFileSelection *filesel; + + filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION); + gtk_window_set_title (GTK_WINDOW (filesel), title); + /* !!! put check here to figure out if screen > 640x480, if true + We need to make the file selection dialog bigger. much bigger.. + or maybe we should keep it at a certan percentage of the screen + size? */ + + gtk_window_set_default_size(GTK_WINDOW (filesel), 520, 420); + return GTK_WIDGET (filesel); +} + +void +gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + return; + + /* delete, create directory, and rename */ +/* + if (!filesel->fileop_c_dir) + { + filesel->fileop_c_dir = gtk_button_new_with_label (_("MkDir")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_c_dir, TRUE,TRUE, 0); + gtk_widget_show (filesel->fileop_c_dir); + } + + if (!filesel->fileop_del_file) + { + filesel->fileop_del_file = gtk_button_new_with_label (_("Delete")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_del_file, TRUE,TRUE, 0); + gtk_widget_show (filesel->fileop_del_file); + } + + if (!filesel->fileop_ren_file) + { + filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_ren_file, TRUE,TRUE, 0); + gtk_widget_show (filesel->fileop_ren_file); + } + + gtk_widget_queue_resize(GTK_WIDGET(filesel)); + */ +} + +void +gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + return; + /* + if (filesel->fileop_ren_file) + { + gtk_widget_destroy (filesel->fileop_ren_file); + filesel->fileop_ren_file = NULL; + } + + if (filesel->fileop_del_file) + { + gtk_widget_destroy (filesel->fileop_del_file); + filesel->fileop_del_file = NULL; + } + + if (filesel->fileop_c_dir) + { + gtk_widget_destroy (filesel->fileop_c_dir); + filesel->fileop_c_dir = NULL; + } + */ +} + + + +void +gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename) +{ + char buf[MAXPATHLEN]; + const char *name, *last_slash; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (filename != NULL); + + last_slash = strrchr (filename, '/'); + + if (!last_slash) + { + buf[0] = 0; + name = filename; + } + else + { + gint len = MIN (MAXPATHLEN - 1, last_slash - filename + 1); + + strncpy (buf, filename, len); + buf[len] = 0; + + name = last_slash + 1; + } + + gtk_file_selection_populate (filesel, buf, FALSE); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name); +} + +gchar* +gtk_file_selection_get_filename (GtkFileSelection *filesel) +{ + static char nothing[2] = ""; + char *text; + char *filename; + + g_return_val_if_fail (filesel != NULL, nothing); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing); + + text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); + if (text) + { + filename = cmpl_completion_fullname (text, filesel->cmpl_state); + return filename; + } + + return nothing; +} + +void +gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern) +{ + gchar *new_pattern; + gint x; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (pattern != NULL); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); + + if(strchr(pattern,'*') || strchr(pattern,'?')) + { + for(x=strlen(pattern);x>=0;x--) + { + if(pattern[x]=='/') break; + } + gtk_entry_set_text(GTK_ENTRY(filesel->mask_entry),g_strdup(pattern+x+1)); + + if(filesel->mask) g_free(filesel->mask); + + filesel->mask=g_strdup(pattern+x+1); + new_pattern=g_strdup(pattern); + new_pattern[x+1]=0; + gtk_file_selection_populate (filesel, (gchar*) new_pattern, TRUE); + g_free(new_pattern); + } + else + { + gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE); + } +} + +static void +gtk_file_selection_realize (GtkWidget *widget) +{ + GtkFileSelection *filesel; + const gchar *masks[] = { "All Files <*>", NULL }; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (widget)); + + filesel = GTK_FILE_SELECTION (widget); + + /* make sure that we have at least one mask */ + if (!filesel->masks) + gtk_file_selection_set_masks (filesel, masks); + + filesel->mask = g_strdup ((gchar*) filesel->masks->data); + gtk_file_selection_populate (filesel, "", FALSE); + + + if (GTK_WIDGET_CLASS (parent_class)->realize) + (* GTK_WIDGET_CLASS (parent_class)->realize) (widget); +} + +static void +gtk_file_selection_destroy (GtkObject *object) +{ + GtkFileSelection *filesel; + GList *list; + + g_return_if_fail (object != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (object)); + + filesel = GTK_FILE_SELECTION (object); + + if (filesel->fileop_dialog) + gtk_widget_destroy (filesel->fileop_dialog); + + if (filesel->next_history) + { + list = filesel->next_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->next_history); + filesel->next_history = NULL; + + if (filesel->prev_history) + { + list = filesel->prev_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->prev_history); + filesel->prev_history = NULL; + + if (filesel->mask) + { + g_free (filesel->mask); + filesel->mask = NULL; + } + + cmpl_free_state (filesel->cmpl_state); + filesel->cmpl_state = NULL; + + if (GTK_OBJECT_CLASS (parent_class)->destroy) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + +/* Begin file operations callbacks */ + +static gint +gtk_file_selection_show_fileop_menu (GtkCList *clist, GdkEvent *event, GtkFileSelection *fs) +{ + GdkEventButton *event_button; + + g_return_val_if_fail (clist != NULL, FALSE); + g_return_val_if_fail (GTK_IS_CLIST (clist), FALSE); + g_return_val_if_fail (event != NULL, FALSE); + g_return_val_if_fail (fs != NULL, FALSE); + g_return_val_if_fail (GTK_FILE_SELECTION (fs), FALSE); + + if (event->type == GDK_BUTTON_PRESS) + { + event_button = (GdkEventButton *) event; + if (event_button->button == 3) + { + + gtk_menu_popup (GTK_MENU (fs->fileop_menu), NULL, NULL, NULL, NULL, + event_button->button, event_button->time); + return TRUE; + } + } + + return FALSE; +} + +static void +gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message) +{ + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + + g_return_if_fail (error_message != NULL); + + /* main dialog */ + dialog = gtk_dialog_new (); + /* + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + */ + gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, make this dialog modal too */ + /* When error dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(error_message); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* yes, we free it */ + g_free (error_message); + + /* close button */ + button = gtk_button_new_with_label (_("Close")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + fs->fileop_dialog = NULL; + g_free (fs->fileop_data); + fs->fileop_data = NULL; +} + + +static void +gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *dirname; + gchar *path; + gchar *full_path; + gchar *buf; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", dirname, NULL); + if ( (mkdir (full_path, 0755) < 0) ) + { + buf = g_strconcat ("Error creating directory \"", dirname, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_create_dir (gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(_("Directory name:")); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* The directory entry widget */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + /* buttons */ + button = gtk_button_new_with_label (_("Create")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + CompletionState *cmpl_state; + gchar *path; + gchar *full_path; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", fs->fileop_file, NULL); + if ( (unlink (full_path) < 0) ) + { + buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_delete_file (gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + gchar *filename; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(filename) < 1) + return; + + fs->fileop_file = filename; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* buttons */ + button = gtk_button_new_with_label (_("Delete")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); + +} + +static void +gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *buf; + gchar *file; + gchar *path; + gchar *new_filename; + gchar *old_filename; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + new_filename = g_strconcat (path, "/", file, NULL); + old_filename = g_strconcat (path, "/", fs->fileop_file, NULL); + + if (strcmp (new_filename, old_filename)) + if ((rename (old_filename, new_filename)) < 0) + { + buf = g_strconcat ("Error renaming file \"", file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (new_filename); + g_free (old_filename); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_file_mode_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + PropertiesPrivate *priv = fs->fileop_data; + CompletionState *cmpl_state; + gchar *filename, *file, *path; + mode_t mode; + + mode = gtk_file_selection_properties_get_mode (priv); + + file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + filename = g_strconcat (path, "/", file, NULL); + if (chmod (filename, mode) == -1) + { + gchar *buf = g_strconcat ("Error changing file mode of \"", filename, "\": ", + g_strerror (errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); + } + else + gtk_file_selection_rename_file_confirmed (widget, data); + + g_free (filename); +} + +static void +gtk_file_selection_rename_file (gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(fs->fileop_file) < 1) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* New filename entry */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); + gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), + 0, strlen (fs->fileop_file)); + + /* buttons */ + button = gtk_button_new_with_label (_("Rename")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static mode_t +gtk_file_selection_properties_get_mode (PropertiesPrivate* priv) +{ + mode_t mode = 0; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[0]))) + mode |= S_IRUSR; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[1]))) + mode |= S_IWUSR; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[2]))) + mode |= S_IXUSR; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[3]))) + mode |= S_ISUID; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[4]))) + mode |= S_IRGRP; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[5]))) + mode |= S_IWGRP; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[6]))) + mode |= S_IXGRP; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[7]))) + mode |= S_ISGID; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[8]))) + mode |= S_IROTH; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[9]))) + mode |= S_IWOTH; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[10]))) + mode |= S_IXOTH; + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mode_buttons[11]))) + mode |= S_ISVTX; + + return mode; +} + +static void +gtk_file_selection_properties_update_mode (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + PropertiesPrivate *priv = fs->fileop_data; + gchar str[8]; + + sprintf (str, "(%.4o)", gtk_file_selection_properties_get_mode (priv)); + gtk_label_set (GTK_LABEL (priv->mode_label), str); +} + +static void +gtk_file_selection_properties (gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *hbox; + GtkWidget *button; + GtkWidget *notebook; + GtkWidget *table; + GtkWidget *hseparator; + GtkWidget *entry; + GtkWidget *togglebutton; + struct stat statbuf; + struct passwd *pw; + struct group *gp; + gchar *buf; + gchar *path; + gchar *filename; + gchar timeBuf[TIME_STRING_BUF]; + gint pagenum = 0; + PropertiesPrivate *priv; + int i; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + priv = fs->fileop_data = g_malloc (sizeof (PropertiesPrivate)); + + gtk_window_set_title (GTK_WINDOW (dialog), ("Properties")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + /* Dialog guts go here */ + notebook = gtk_notebook_new (); + gtk_widget_show (notebook); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), notebook, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (notebook), 8); + + path = cmpl_reference_position(fs->cmpl_state); + fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + filename = g_strconcat(path, "/", fs->fileop_file, NULL); + if (strlen(fs->fileop_file) > 0 && !(stat(filename, &statbuf))) + { + /* stats page */ + table = gtk_table_new (9, 2, FALSE); + gtk_widget_show (table); + gtk_container_add (GTK_CONTAINER (notebook), table); + gtk_container_set_border_width (GTK_CONTAINER (table), 5); + gtk_table_set_row_spacings (GTK_TABLE (table), 4); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); + + label = gtk_label_new (_("Statistics")); + gtk_widget_show (label); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), pagenum), label); + pagenum++; + /* path and filename */ + label = gtk_label_new (_("Path:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new (_(path)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new (_("File Name:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + fs->fileop_entry = entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_text (GTK_ENTRY (entry), fs->fileop_file); + if (access (filename, W_OK)) + gtk_widget_set_sensitive( GTK_WIDGET (entry), FALSE); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table), hseparator, 0, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + /* file type and size */ + label = gtk_label_new (_("Type:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + switch (statbuf.st_mode & S_IFMT) + { + case S_IFSOCK: + buf = g_strdup ("Socket"); + break; + case S_IFLNK: + buf = g_strdup ("Symbolic link"); + break; + case S_IFREG: + buf = g_strdup ("File"); + break; + case S_IFBLK: + buf = g_strdup ("Block device"); + break; + case S_IFDIR: + buf = g_strdup ("Directory"); + break; + case S_IFCHR: + buf = g_strdup ("Character device"); + break; + case S_IFIFO: + buf = g_strdup ("First-in/first-out pipe"); + break; + default: + buf = g_strdup ("Unknown"); + } + + + label = gtk_label_new (buf); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new (_("Size:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new (_(g_strdup_printf ("%ld bytes", statbuf.st_size))); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_table_attach (GTK_TABLE (table), hseparator, 0, 2, 5, 6, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + /* file dates */ + label = gtk_label_new (_("Created:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + strftime (timeBuf, TIME_STRING_BUF, "%a %b %d %X %Y", localtime(&statbuf.st_mtime)); + label = gtk_label_new (_(timeBuf)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 6, 7, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + + + label = gtk_label_new (_("Modified:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + strftime (timeBuf, TIME_STRING_BUF, "%a %b %d %X %Y", localtime(&statbuf.st_mtime)); + label = gtk_label_new (_(timeBuf)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + + label = gtk_label_new (_("Accessed:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 8, 9, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + strftime (timeBuf, TIME_STRING_BUF, "%a %b %d %X %Y", localtime(&statbuf.st_atime)); + label = gtk_label_new (_(timeBuf)); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 8, 9, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + /* permissions page */ + vbox = gtk_vbox_new (FALSE, 4); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (notebook), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + label = gtk_label_new (_("Permissions")); + gtk_widget_show (label); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), pagenum), label); + pagenum++; + + /* owner / group */ + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 2); + gtk_table_set_col_spacings (GTK_TABLE (table), 8); + + label = gtk_label_new (_("Owner:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + entry = gtk_entry_new(); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((pw = getpwuid(statbuf.st_uid))) + gtk_entry_set_text(GTK_ENTRY (entry), pw->pw_name); + else + gtk_entry_set_text(GTK_ENTRY (entry), (gpointer) statbuf.st_uid); + if (access (filename, W_OK) || (getuid() != 0)) + gtk_widget_set_sensitive( GTK_WIDGET (entry), FALSE); + + + label = gtk_label_new (_("Group:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + entry = gtk_entry_new(); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((gp = getgrgid(statbuf.st_gid))) + gtk_entry_set_text(GTK_ENTRY (entry), gp->gr_name); + else + gtk_entry_set_text(GTK_ENTRY (entry), (gpointer) statbuf.st_gid); + if (access (filename, W_OK) || (getuid() != 0)) + gtk_widget_set_sensitive( GTK_WIDGET (entry), FALSE); + + + hseparator = gtk_hseparator_new (); + gtk_widget_show (hseparator); + gtk_box_pack_start (GTK_BOX (vbox), hseparator, FALSE, TRUE, 0); + + /* permissions */ + table = gtk_table_new (4, 5, TRUE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 2); + gtk_table_set_col_spacings (GTK_TABLE (table), 4); + if (access (filename, W_OK) || ((getuid() != statbuf.st_uid) && getuid() != 0)) + gtk_widget_set_sensitive (GTK_WIDGET (table), FALSE); + + hbox = gtk_hbox_new (FALSE, 1); + gtk_widget_show (hbox); + gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + priv->mode_label = label = gtk_label_new ("(0000)"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + label = gtk_label_new (_("Read")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new (_("Write")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new (_("Exec")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 3, 4, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new (_("Special")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 4, 5, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + + label = gtk_label_new (_("User:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + priv->mode_buttons[0] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IRUSR) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[1] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IWUSR) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[2] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IXUSR) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[3] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 4, 5, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_ISUID) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + + + label = gtk_label_new (_("Group:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + priv->mode_buttons[4] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IRGRP) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[5] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IWGRP) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[6] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IXGRP) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[7] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 4, 5, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_ISGID) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + label = gtk_label_new (_("Other:")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + priv->mode_buttons[8] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IROTH) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[9] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IWOTH) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[10] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_IXOTH) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + priv->mode_buttons[11] = togglebutton = gtk_toggle_button_new_with_label (""); + gtk_widget_show (togglebutton); + gtk_table_attach (GTK_TABLE (table), togglebutton, 4, 5, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + if ((statbuf.st_mode & ~(S_IFMT)) & S_ISVTX) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (togglebutton), TRUE); + + for (i = 0; i < 12; i++) + gtk_signal_connect (GTK_OBJECT (priv->mode_buttons[i]), "toggled", + GTK_SIGNAL_FUNC (gtk_file_selection_properties_update_mode), fs); + gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (priv->mode_buttons[0])); + } + /* global page */ + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (notebook), vbox); + + label = gtk_label_new (_("Global")); + gtk_widget_show (label); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), pagenum), label); + pagenum++; + + label = gtk_label_new (_("dialog preferances will go here")); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + + /* end of dialog guts */ + + /* buttons */ + button = gtk_button_new_with_label (_("OK")); + // gtk_signal_connect (GTK_OBJECT (button), "clicked", + // (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, + // (gpointer) fs); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_file_mode_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + g_free (filename); + gtk_widget_show (dialog); +} + +static gint +gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + + GtkFileSelection *fs; + char *text; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + fs = GTK_FILE_SELECTION (user_data); + + if (fs->saved_entry) + { + gtk_clist_unselect_all ((GtkCList *) (fs->dir_list)); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + if (event->keyval == GDK_Tab) + { + text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + + text = g_strdup (text); + + gtk_file_selection_populate (fs, text, TRUE); + + g_free (text); + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + + return TRUE; + } + + + return FALSE; +} + +/* +static void +gtk_file_selection_home_button (GtkWidget *widget, gpointer data){ + GList *list; + + GtkFileSelection *fs=data; + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs,"~/",FALSE); +} +*/ +static void +gtk_file_selection_bookmark_button (GtkWidget *widget, + GtkFileSelection *fs) +{ + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_FILE_SELECTION (fs)); + + gtk_menu_popup (GTK_MENU (fs->bookmark_menu), NULL, NULL, NULL, NULL, + 0, 0); + +} + +static void +gtk_file_selection_up_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, "../", FALSE); /*change directories. */ + +} + +static void +gtk_file_selection_prev_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->prev_history; + + if (list && g_list_length(list) > 1) + { + first = list; /* get first element */ + list = list->next; /* pop off current directory */ + + list->prev = NULL; /* make this the new head. */ + + fs->prev_history = list; /* update prev_history list */ + fs->next_history = g_list_prepend(fs->next_history,first->data); /* put it on next_history */ + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + + + path = g_malloc(strlen(list->data)+4); /* plenty of space */ + strcpy(path,list->data); /* get the 2nd path in the history */ + strcat(path,"/"); /* append a '/' */ + gtk_file_selection_populate (fs, path, FALSE); /* change directories. */ + g_free (path); + } +} + +static void +gtk_file_selection_next_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + + if (list && g_list_length(list) > 0) + { + first = list; /*get first element*/ + list = list->next; /*pop off current directory*/ + + if (list) + list->prev = NULL; + + fs->next_history = list; /*update prev_history list*/ + + path = g_malloc(strlen(first->data)+4); /*plenty of space*/ + strcpy(path,first->data); + strcat(path,"/"); /*append a / */ + gtk_file_selection_populate (fs, path, FALSE); /*change directories.*/ + g_free(path); + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + } +} + +void static +gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_file_selection_populate (fs,"",FALSE); +} + +static void +gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + if(fs->mask) + g_free (fs->mask); + + fs->mask = g_strdup(gtk_entry_get_text (GTK_ENTRY(GTK_COMBO(fs->mask_entry)->entry))); + + if (strlen(fs->mask) == 0) + { + g_free (fs->mask); + fs->mask = NULL; + } + + gtk_file_selection_refresh_button (widget,data); +} + +static gint gtk_file_selection_files_list_key_callback (GtkWidget *widget, GdkEventKey *event, gpointer data){ + GtkFileSelection *fs=data; + gchar *saved; + gchar key[2]; + +// g_print("Key event: %d\n",event->keyval); + //we need some sort of timeout. + + //if the key is a normal character then + //add to our saved_entry1 + //if it's backspace then remove one character + //otherwise let it through (and erase our buffer. + + if(event->keyval > GDK_space && event->keyval <= GDK_Korean_Won) { + key[1]=0; + key[0]=event->keyval; + saved=fs->saved_entry1; + if(fs->saved_entry1){ + fs->saved_entry1=g_strconcat(saved,key,NULL); + g_free(saved); + }else{ + fs->saved_entry1=g_strdup(key); + } + g_print("complete: %s\n",fs->saved_entry1); + /*gtk_label_set_text(GTK_LABEL(fs->completion_label), fs->saved_entry1); */ + + saved=g_strdup(gtk_entry_get_text(GTK_ENTRY(fs->selection_entry))); + gtk_file_selection_complete(fs,fs->saved_entry1); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),saved); + g_free(saved); + }else if (event->keyval == GDK_BackSpace) { + if(strlen(fs->saved_entry1)){ + fs->saved_entry1[strlen(fs->saved_entry1)-1]=0; + g_print("complete: %s\n",fs->saved_entry1); + /*gtk_label_set_text(GTK_LABEL(fs->completion_label),fs->saved_entry1); */ + saved=g_strdup(gtk_entry_get_text(GTK_ENTRY(fs->selection_entry))); + gtk_file_selection_complete(fs,fs->saved_entry1); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),saved); + g_free(saved); + } + }else if (event->keyval == GDK_Tab) { + saved=g_strdup(gtk_entry_get_text(GTK_ENTRY(fs->selection_entry))); + gtk_file_selection_populate(fs,fs->saved_entry1,TRUE); + g_free(fs->saved_entry1); + fs->saved_entry1=gtk_entry_get_text(GTK_ENTRY(fs->selection_entry)); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),saved); + g_free(saved); + + g_print("complete: %s\n",fs->saved_entry1); + /* gtk_label_set_text(GTK_LABEL(fs->completion_label),fs->saved_entry1);*/ + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + }else { + if(fs->saved_entry1){ + g_free(fs->saved_entry1); + fs->saved_entry1=NULL; + } + /* gtk_label_set_text(GTK_LABEL(fs->completion_label)," "); */ + } + + return TRUE; +} + + +static gint gtk_file_selection_mask_entry_key_callback (GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + GtkEntry *entry=(GtkEntry *)widget; + GtkFileSelection *fs=data; + + g_return_val_if_fail (fs != NULL,FALSE); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs),FALSE); + + + if (event->keyval == GDK_Return || event->keyval == GDK_Tab) + { + if(fs->mask) + g_free(fs->mask); + + fs->mask=g_strdup(gtk_entry_get_text(entry)); + gtk_file_selection_refresh_button(widget,fs); + + if (event->keyval == GDK_Return) + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + return TRUE; + } + else + { + return FALSE; + } +} + +static gint gtk_file_selection_mask_entry_button_callback (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + GtkFileSelection *fs = data; + + if(fs->mask) + g_free(fs->mask); + + fs->mask=g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(fs->mask_entry)->entry))); + gtk_file_selection_refresh_button(widget,fs); + + return TRUE; + +} + +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + /* + g_print("Key pressed! \n"); + */ + + return TRUE; +} + +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + gpointer user_data) +{ + + GtkFileSelection *fs = user_data; + GList *list; + gchar *path; + + list = fs->next_history; + if(list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(GTK_ENTRY (((GtkCombo *)fs->history_combo)->entry)))+4); + strcpy (path,gtk_entry_get_text(GTK_ENTRY( ((GtkCombo *)fs->history_combo)->entry))); + strcat (path,"/"); + + gtk_file_selection_populate (fs,path,TRUE); + + g_free (path); + + return TRUE; +} + +static gboolean +gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + GtkEntry *entry=(GtkEntry *)widget; + GtkFileSelection *fs=data; + GList *list; + gchar *path; + + g_return_val_if_fail (fs != NULL,FALSE); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs),FALSE); + + + if (event->keyval == GDK_Return) + { + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(entry))+4); + strcpy (path,gtk_entry_get_text(entry)); + strcat (path,"/"); + gtk_file_selection_populate (fs,path,TRUE); + g_free (path); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + return TRUE; + } + else + { + return FALSE; + } + +} + + +static void gtk_file_selection_bookmark_callback (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + BookmarkMenuStruct *item; + GList *list; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + +//g_print ("Callback\n"); + list = fs->bookmark_list; + while(list) { + item = list->data; + if (item->menu_item == widget) { + if(strcmp(item->path,"./")) { + gtk_file_selection_populate (fs, item->path, FALSE); + } + break; + } + list=list->next; + } +} + +static void +gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_directory) +{ + gchar *current_dir; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + g_return_if_fail (current_directory != NULL); + + current_dir = g_strdup (current_directory); + + if(fs->prev_history) + { + if (strcmp((fs->prev_history)->data,current_dir)) + { /*if this item isn't on the top of the list */ + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + } else { + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (fs->history_combo),fs->prev_history); + + g_free (current_dir); +} + +static void +gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = user_data; + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->file_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (fs->saved_entry) + { + gtk_clist_unselect_all ((GtkCList *) (fs->dir_list)); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + if(fs->saved_entry1){ + g_free(fs->saved_entry1); + fs->saved_entry1=NULL; + } + /* gtk_label_set_text(GTK_LABEL(fs->completion_label)," "); */ + + + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + gtk_button_clicked (GTK_BUTTON (fs->ok_button)); + break; + + default: +/* + if (bevent->button && GDK_BUTTON2_MASK) + { + g_print("Right click! -- %d\n",bevent->button); + } + else + { + */ + + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + /*}*/ + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GList *list; + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, filename, FALSE); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + break; + + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) g_free (fs->saved_entry); + fs->saved_entry=g_strdup(gtk_entry_get_text(GTK_ENTRY (fs->selection_entry))); + + temp=g_strconcat(filename,fs->saved_entry,NULL); + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), temp); + g_free (temp); + + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) + { + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); //????? + + g_free (filename); + } +} + +static void +gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete) +{ + CompletionState *cmpl_state; + PossibleCompletion* poss; + gchar* filename; + gint row; + gchar* rem_path = rel_path; + gchar* sel_text; + gchar* text[2]; + gint did_recurse = FALSE; + gint possible_count = 0; + gint selection_index = -1; + gint file_list_width; + gint dir_list_width; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state); + + if (!cmpl_state_okay (cmpl_state)) + { + /* Something went wrong. */ + gtk_file_selection_abort (fs); + return; + } + + g_assert (cmpl_state->reference_dir); + + gtk_clist_freeze (GTK_CLIST (fs->dir_list)); + gtk_clist_clear (GTK_CLIST (fs->dir_list)); + gtk_clist_freeze (GTK_CLIST (fs->file_list)); + gtk_clist_clear (GTK_CLIST (fs->file_list)); + + /* Set the dir_list to include ./ and ../ */ + /* Actually, no let's not. + text[1] = NULL; + text[0] = "./"; + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + */ + + text[0] = "../"; //Do we need ..? + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + + /*reset the max widths of the lists*/ + dir_list_width = gdk_string_width(fs->dir_list->style->font,"../"); + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width); + file_list_width = 1; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width); + + while (poss) + { + if (cmpl_is_a_completion (poss)) + { + possible_count += 1; + + filename = cmpl_this_completion (poss); + + text[0] = filename; + + if (cmpl_is_directory (poss)) + { + if (strcmp (filename, "./") != 0 && + strcmp (filename, "../") != 0) + { + int width = gdk_string_width(fs->dir_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + if(width > dir_list_width) + { + dir_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0, + width); + } + } + } + else + { + if(fs->mask) + { + if (gtk_file_selection_match_mask(filename,fs->mask)) + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + else + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + } + + poss = cmpl_next_completion (cmpl_state); + } + + gtk_clist_thaw (GTK_CLIST (fs->dir_list)); + gtk_clist_thaw (GTK_CLIST (fs->file_list)); + + /* File lists are set. */ + + g_assert (cmpl_state->reference_dir); + + if (try_complete) + { + + /* User is trying to complete filenames, so advance the user's input + * string to the updated_text, which is the common leading substring + * of all possible completions, and if its a directory attempt + * attempt completions in it. */ + + if (cmpl_updated_text (cmpl_state)[0]) + { + + if (cmpl_updated_dir (cmpl_state)) + { + gchar* dir_name = g_strdup (cmpl_updated_text (cmpl_state)); + + did_recurse = TRUE; + + gtk_file_selection_populate (fs, dir_name, TRUE); + + g_free (dir_name); + } + else + { + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), + cmpl_updated_text (cmpl_state)); + } + } + else + { + selection_index = cmpl_last_valid_char (cmpl_state) - + (strlen (rel_path) - strlen (rem_path)); + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); + } + } + else + { + if (fs->selection_entry) + /* Here we need to take the old filename and keep it!*/ + /*gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), "");*/ + ; + } + + if (!did_recurse) + { + if (fs->selection_entry) + gtk_entry_set_position (GTK_ENTRY (fs->selection_entry), selection_index); + + if (fs->selection_entry) + { + sel_text = g_strconcat (_("Selection: "), + cmpl_reference_position (cmpl_state), + NULL); + +/* + gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text); +*/ + g_free (sel_text); + } + + gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state)); + + } +} + +static void +gtk_file_selection_abort (GtkFileSelection *fs) +{ + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + /* BEEP gdk_beep(); */ + +/* + if (fs->selection_entry) + gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf); +*/ +} + +/**********************************************************************/ +/* External Interface */ +/**********************************************************************/ + +/* The four completion state selectors + */ +static gchar* +cmpl_updated_text (CompletionState* cmpl_state) +{ + return cmpl_state->updated_text; +} + +static gint +cmpl_updated_dir (CompletionState* cmpl_state) +{ + return cmpl_state->re_complete; +} + +static gchar* +cmpl_reference_position (CompletionState* cmpl_state) +{ + return cmpl_state->reference_dir->fullname; +} + +static gint +cmpl_last_valid_char (CompletionState* cmpl_state) +{ + return cmpl_state->last_valid_char; +} + +static gchar* +cmpl_completion_fullname (gchar* text, CompletionState* cmpl_state) +{ + static char nothing[2] = ""; + + if (!cmpl_state_okay (cmpl_state)) + { + return nothing; + } + else if (text[0] == '/') + { + strcpy (cmpl_state->updated_text, text); + } + else if (text[0] == '~') + { + CompletionDir* dir; + char* slash; + + dir = open_user_dir (text, cmpl_state); + + if (!dir) + { + /* spencer says just return ~something, so + * for now just do it. */ + strcpy (cmpl_state->updated_text, text); + } + else + { + + strcpy (cmpl_state->updated_text, dir->fullname); + + slash = strchr (text, '/'); + + if (slash) + strcat (cmpl_state->updated_text, slash); + } + } + else + { + strcpy (cmpl_state->updated_text, cmpl_state->reference_dir->fullname); + if (strcmp (cmpl_state->reference_dir->fullname, "/") != 0) + strcat (cmpl_state->updated_text, "/"); + strcat (cmpl_state->updated_text, text); + } + + return cmpl_state->updated_text; +} + +/* The three completion selectors + */ +static gchar* +cmpl_this_completion (PossibleCompletion* pc) +{ + return pc->text; +} + +static gint +cmpl_is_directory (PossibleCompletion* pc) +{ + return pc->is_directory; +} + +static gint +cmpl_is_a_completion (PossibleCompletion* pc) +{ + return pc->is_a_completion; +} + +/**********************************************************************/ +/* Construction, deletion */ +/**********************************************************************/ + +static CompletionState* +cmpl_init_state (void) +{ + gchar getcwd_buf[2*MAXPATHLEN]; + CompletionState *new_state; + + new_state = g_new (CompletionState, 1); + + /* We don't use getcwd() on SUNOS, because, it does a popen("pwd") + * and, if that wasn't bad enough, hangs in doing so. + */ +#if defined(sun) && !defined(__SVR4) + if (!getwd (getcwd_buf)) +#else + if (!getcwd (getcwd_buf, MAXPATHLEN)) +#endif + { + /* Oh joy, we can't get the current directory. Um..., we should have + * a root directory, right? Right? (Probably not portable to non-Unix) + */ + strcpy (getcwd_buf, "/"); + } + +tryagain: + + new_state->reference_dir = NULL; + new_state->completion_dir = NULL; + new_state->active_completion_dir = NULL; + new_state->directory_storage = NULL; + new_state->directory_sent_storage = NULL; + new_state->last_valid_char = 0; + new_state->updated_text = g_new (gchar, MAXPATHLEN); + new_state->updated_text_alloc = MAXPATHLEN; + new_state->the_completion.text = g_new (gchar, MAXPATHLEN); + new_state->the_completion.text_alloc = MAXPATHLEN; + new_state->user_dir_name_buffer = NULL; + new_state->user_directories = NULL; + + new_state->reference_dir = open_dir (getcwd_buf, new_state); + + if (!new_state->reference_dir) + { + /* Directories changing from underneath us, grumble */ + strcpy (getcwd_buf, "/"); + goto tryagain; + } + + return new_state; +} + +static void +cmpl_free_dir_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_dir_sent_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir_sent (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_state (CompletionState* cmpl_state) +{ + cmpl_free_dir_list (cmpl_state->directory_storage); + cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage); + + if (cmpl_state->user_dir_name_buffer) + g_free (cmpl_state->user_dir_name_buffer); + if (cmpl_state->user_directories) + g_free (cmpl_state->user_directories); + if (cmpl_state->the_completion.text) + g_free (cmpl_state->the_completion.text); + if (cmpl_state->updated_text) + g_free (cmpl_state->updated_text); + + g_free (cmpl_state); +} + +static void +free_dir(CompletionDir* dir) +{ + g_free(dir->fullname); + g_free(dir); +} + +static void +free_dir_sent(CompletionDirSent* sent) +{ + g_free(sent->name_buffer); + g_free(sent->entries); + g_free(sent); +} + +static void +prune_memory_usage(CompletionState *cmpl_state) +{ + GList* cdsl = cmpl_state->directory_sent_storage; + GList* cdl = cmpl_state->directory_storage; + GList* cdl0 = cdl; + gint len = 0; + + for(; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1) + cdsl = cdsl->next; + + if (cdsl) { + cmpl_free_dir_sent_list(cdsl->next); + cdsl->next = NULL; + } + + cmpl_state->directory_storage = NULL; + while (cdl) { + if (cdl->data == cmpl_state->reference_dir) + cmpl_state->directory_storage = g_list_prepend(NULL, cdl->data); + else + free_dir (cdl->data); + cdl = cdl->next; + } + + g_list_free(cdl0); +} + +/**********************************************************************/ +/* The main entrances. */ +/**********************************************************************/ + +static PossibleCompletion* +cmpl_completion_matches (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + PossibleCompletion *poss; + + prune_memory_usage(cmpl_state); + + g_assert (text_to_complete != NULL); + + cmpl_state->user_completion_index = -1; + cmpl_state->last_completion_text = text_to_complete; + cmpl_state->the_completion.text[0] = 0; + cmpl_state->last_valid_char = 0; + cmpl_state->updated_text_len = -1; + cmpl_state->updated_text[0] = 0; + cmpl_state->re_complete = FALSE; + + first_slash = strchr (text_to_complete, '/'); + + if (text_to_complete[0] == '~' && !first_slash) + { + /* Text starts with ~ and there is no slash, show all the + * home directory completions. + */ + poss = attempt_homedir_completion (text_to_complete, cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; + } + + cmpl_state->reference_dir = + open_ref_dir (text_to_complete, remaining_text, cmpl_state); + + if(!cmpl_state->reference_dir) + return NULL; + + cmpl_state->completion_dir = + find_completion_dir (*remaining_text, remaining_text, cmpl_state); + + cmpl_state->last_valid_char = *remaining_text - text_to_complete; + + if(!cmpl_state->completion_dir) + return NULL; + + cmpl_state->completion_dir->cmpl_index = -1; + cmpl_state->completion_dir->cmpl_parent = NULL; + cmpl_state->completion_dir->cmpl_text = *remaining_text; + + cmpl_state->active_completion_dir = cmpl_state->completion_dir; + + cmpl_state->reference_dir = cmpl_state->completion_dir; + + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +static PossibleCompletion* +cmpl_next_completion (CompletionState* cmpl_state) +{ + PossibleCompletion* poss = NULL; + + cmpl_state->the_completion.text[0] = 0; + + if(cmpl_state->user_completion_index >= 0) + poss = attempt_homedir_completion(cmpl_state->last_completion_text, cmpl_state); + else + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +/**********************************************************************/ +/* Directory Operations */ +/**********************************************************************/ + +/* Open the directory where completion will begin from, if possible. */ +static CompletionDir* +open_ref_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + CompletionDir *new_dir; + + first_slash = strchr(text_to_complete, '/'); + + if (text_to_complete[0] == '~') + { + new_dir = open_user_dir(text_to_complete, cmpl_state); + + if(new_dir) + { + if(first_slash) + *remaining_text = first_slash + 1; + else + *remaining_text = text_to_complete + strlen(text_to_complete); + } + else + { + return NULL; + } + } + else if (text_to_complete[0] == '/' || !cmpl_state->reference_dir) + { + gchar *tmp = g_strdup(text_to_complete); + gchar *p; + + p = tmp; + while (*p && *p != '*' && *p != '?') + p++; + + *p = '\0'; + p = strrchr(tmp, '/'); + if (p) + { + if (p == tmp) + p++; + + *p = '\0'; + + new_dir = open_dir(tmp, cmpl_state); + + if(new_dir) + *remaining_text = text_to_complete + + ((p == tmp + 1) ? (p - tmp) : (p + 1 - tmp)); + } + else + { + /* If no possible candidates, use the cwd */ + gchar *curdir = g_get_current_dir (); + + new_dir = open_dir(curdir, cmpl_state); + + if (new_dir) + *remaining_text = text_to_complete; + + g_free (curdir); + } + + g_free (tmp); + } + else + { + *remaining_text = text_to_complete; + + new_dir = open_dir(cmpl_state->reference_dir->fullname, cmpl_state); + } + + if(new_dir) + { + new_dir->cmpl_index = -1; + new_dir->cmpl_parent = NULL; + } + + return new_dir; +} + +/* open a directory by user name */ +static CompletionDir* +open_user_dir(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gchar *first_slash; + gint cmp_len; + + g_assert(text_to_complete && text_to_complete[0] == '~'); + + first_slash = strchr(text_to_complete, '/'); + + if (first_slash) + cmp_len = first_slash - text_to_complete - 1; + else + cmp_len = strlen(text_to_complete + 1); + + if(!cmp_len) + { + /* ~/ */ + gchar *homedir = g_get_home_dir (); + + if (homedir) + return open_dir(homedir, cmpl_state); + else + return NULL; + } + else + { + /* ~user/ */ + char* copy = g_new(char, cmp_len + 1); + struct passwd *pwd; + strncpy(copy, text_to_complete + 1, cmp_len); + copy[cmp_len] = 0; + pwd = getpwnam(copy); + g_free(copy); + if (!pwd) + { + cmpl_errno = errno; + return NULL; + } + + return open_dir(pwd->pw_dir, cmpl_state); + } +} + +/* open a directory relative the the current relative directory */ +static CompletionDir* +open_relative_dir(gchar* dir_name, + CompletionDir* dir, + CompletionState *cmpl_state) +{ + gchar path_buf[2*MAXPATHLEN]; + + if(dir->fullname_len + strlen(dir_name) + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir->fullname); + + if(dir->fullname_len > 1) + { + path_buf[dir->fullname_len] = '/'; + strcpy(path_buf + dir->fullname_len + 1, dir_name); + } + else + { + strcpy(path_buf + dir->fullname_len, dir_name); + } + + return open_dir(path_buf, cmpl_state); +} + +/* after the cache lookup fails, really open a new directory */ +static CompletionDirSent* +open_new_dir(gchar* dir_name, struct stat* sbuf, gboolean stat_subdirs) +{ + CompletionDirSent* sent; + DIR* directory; + gchar *buffer_ptr; + struct dirent *dirent_ptr; + gint buffer_size = 0; + gint entry_count = 0; + gint i; + struct stat ent_sbuf; + char path_buf[MAXPATHLEN*2]; + gint path_buf_len; + + sent = g_new(CompletionDirSent, 1); + sent->mtime = sbuf->st_mtime; + sent->inode = sbuf->st_ino; + sent->device = sbuf->st_dev; + + path_buf_len = strlen(dir_name); + + if (path_buf_len > MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir_name); + + directory = opendir(dir_name); + + if(!directory) + { + cmpl_errno = errno; + return NULL; + } + + while((dirent_ptr = readdir(directory)) != NULL) + { + int entry_len = strlen(dirent_ptr->d_name); + buffer_size += entry_len + 1; + entry_count += 1; + + if(path_buf_len + entry_len + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + closedir(directory); + return NULL; + } + } + + sent->name_buffer = g_new(gchar, buffer_size); + sent->entries = g_new(CompletionDirEntry, entry_count); + sent->entry_count = entry_count; + + buffer_ptr = sent->name_buffer; + + rewinddir(directory); + + for(i = 0; i < entry_count; i += 1) + { + dirent_ptr = readdir(directory); + + if(!dirent_ptr) + { + cmpl_errno = errno; + closedir(directory); + return NULL; + } + + strcpy(buffer_ptr, dirent_ptr->d_name); + sent->entries[i].entry_name = buffer_ptr; + buffer_ptr += strlen(dirent_ptr->d_name); + *buffer_ptr = 0; + buffer_ptr += 1; + + path_buf[path_buf_len] = '/'; + strcpy(path_buf + path_buf_len + 1, dirent_ptr->d_name); + + if (stat_subdirs) + { + if(stat(path_buf, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) + sent->entries[i].is_dir = 1; + else + /* stat may fail, and we don't mind, since it could be a + * dangling symlink. */ + sent->entries[i].is_dir = 0; + } + else + sent->entries[i].is_dir = 1; + } + + qsort(sent->entries, sent->entry_count, sizeof(CompletionDirEntry), compare_cmpl_dir); + + closedir(directory); + + return sent; +} + +static gboolean +check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) +{ + /* A list of directories that we know only contain other directories. + * Trying to stat every file in these directories would be very + * expensive. + */ + + static struct { + gchar *name; + gboolean present; + struct stat statbuf; + } no_stat_dirs[] = { + { "/afs", FALSE, { 0 } }, + { "/net", FALSE, { 0 } } + }; + + static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]); + static gboolean initialized = FALSE; + + gint i; + + if (!initialized) + { + initialized = TRUE; + for (i = 0; i < n_no_stat_dirs; i++) + { + if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) + no_stat_dirs[i].present = TRUE; + } + } + + if(stat(dir_name, result) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + *stat_subdirs = TRUE; + for (i=0; ist_dev) && + (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) + { + *stat_subdirs = FALSE; + break; + } + } + + return TRUE; +} + +/* open a directory by absolute pathname */ +static CompletionDir* +open_dir(gchar* dir_name, CompletionState* cmpl_state) +{ + struct stat sbuf; + gboolean stat_subdirs; + CompletionDirSent *sent; + GList* cdsl; + + if (!check_dir (dir_name, &sbuf, &stat_subdirs)) + return NULL; + + cdsl = cmpl_state->directory_sent_storage; + + while (cdsl) + { + sent = cdsl->data; + + if(sent->inode == sbuf.st_ino && + sent->mtime == sbuf.st_mtime && + sent->device == sbuf.st_dev) + return attach_dir(sent, dir_name, cmpl_state); + + cdsl = cdsl->next; + } + + sent = open_new_dir(dir_name, &sbuf, stat_subdirs); + + if (sent) { + cmpl_state->directory_sent_storage = + g_list_prepend(cmpl_state->directory_sent_storage, sent); + + return attach_dir(sent, dir_name, cmpl_state); + } + + return NULL; +} + +static CompletionDir* +attach_dir(CompletionDirSent* sent, gchar* dir_name, CompletionState *cmpl_state) +{ + CompletionDir* new_dir; + + new_dir = g_new(CompletionDir, 1); + + cmpl_state->directory_storage = + g_list_prepend(cmpl_state->directory_storage, new_dir); + + new_dir->sent = sent; + new_dir->fullname = g_strdup(dir_name); + new_dir->fullname_len = strlen(dir_name); + + return new_dir; +} + +static gint +correct_dir_fullname(CompletionDir* cmpl_dir) +{ + gint length = strlen(cmpl_dir->fullname); + struct stat sbuf; + + if (strcmp(cmpl_dir->fullname + length - 2, "/.") == 0) + { + if (length == 2) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } else { + cmpl_dir->fullname[length - 2] = 0; + } + } + else if (strcmp(cmpl_dir->fullname + length - 3, "/./") == 0) + cmpl_dir->fullname[length - 2] = 0; + else if (strcmp(cmpl_dir->fullname + length - 3, "/..") == 0) + { + if(length == 3) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 2] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + else if (strcmp(cmpl_dir->fullname + length - 4, "/../") == 0) + { + if(length == 4) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 3] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + + cmpl_dir->fullname_len = strlen(cmpl_dir->fullname); + + return TRUE; +} + +static gint +correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf) +{ + struct stat parbuf; + gchar *last_slash; + gchar *new_name; + gchar c = 0; + + last_slash = strrchr(cmpl_dir->fullname, '/'); + + g_assert(last_slash); + + if(last_slash != cmpl_dir->fullname) + { /* last_slash[0] = 0; */ } + else + { + c = last_slash[1]; + last_slash[1] = 0; + } + + if (stat(cmpl_dir->fullname, &parbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev) + /* it wasn't a link */ + return TRUE; + + if(c) + last_slash[1] = c; + /* else + last_slash[0] = '/'; */ + + /* it was a link, have to figure it out the hard way */ + + new_name = find_parent_dir_fullname(cmpl_dir->fullname); + + if (!new_name) + return FALSE; + + g_free(cmpl_dir->fullname); + + cmpl_dir->fullname = new_name; + + return TRUE; +} + +static gchar* +find_parent_dir_fullname(gchar* dirname) +{ + gchar buffer[MAXPATHLEN]; + gchar buffer2[MAXPATHLEN]; + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer)) +#else + if(!getcwd(buffer, MAXPATHLEN)) +#endif + { + cmpl_errno = errno; + return NULL; + } + + if(chdir(dirname) != 0 || chdir("..") != 0) + { + cmpl_errno = errno; + return NULL; + } + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer2)) +#else + if(!getcwd(buffer2, MAXPATHLEN)) +#endif + { + chdir(buffer); + cmpl_errno = errno; + + return NULL; + } + + if(chdir(buffer) != 0) + { + cmpl_errno = errno; + return NULL; + } + + return g_strdup(buffer2); +} + +/**********************************************************************/ +/* Completion Operations */ +/**********************************************************************/ + +static PossibleCompletion* +attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gint index, length; + + if (!cmpl_state->user_dir_name_buffer && + !get_pwdb(cmpl_state)) + return NULL; + length = strlen(text_to_complete) - 1; + + cmpl_state->user_completion_index += 1; + + while(cmpl_state->user_completion_index < cmpl_state->user_directories_len) + { + index = first_diff_index(text_to_complete + 1, + cmpl_state->user_directories + [cmpl_state->user_completion_index].login); + + switch(index) + { + case PATTERN_MATCH: + break; + default: + if(cmpl_state->last_valid_char < (index + 1)) + cmpl_state->last_valid_char = index + 1; + cmpl_state->user_completion_index += 1; + continue; + } + + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + append_completion_text("~", cmpl_state); + + append_completion_text(cmpl_state-> + user_directories[cmpl_state->user_completion_index].login, + cmpl_state); + + return append_completion_text("/", cmpl_state); + } + + if(text_to_complete[1] || + cmpl_state->user_completion_index > cmpl_state->user_directories_len) + { + cmpl_state->user_completion_index = -1; + return NULL; + } + else + { + cmpl_state->user_completion_index += 1; + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + return append_completion_text("~/", cmpl_state); + } +} + +/* returns the index (>= 0) of the first differing character, + * PATTERN_MATCH if the completion matches */ +static gint +first_diff_index(gchar* pat, gchar* text) +{ + gint diff = 0; + + while(*pat && *text && *text == *pat) + { + pat += 1; + text += 1; + diff += 1; + } + + if(*pat) + return diff; + + return PATTERN_MATCH; +} + +static PossibleCompletion* +append_completion_text(gchar* text, CompletionState* cmpl_state) +{ + gint len, i = 1; + + if(!cmpl_state->the_completion.text) + return NULL; + + len = strlen(text) + strlen(cmpl_state->the_completion.text) + 1; + + if(cmpl_state->the_completion.text_alloc > len) + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } + + while(i < len) { i <<= 1; } + + cmpl_state->the_completion.text_alloc = i; + + cmpl_state->the_completion.text = (gchar*)g_realloc(cmpl_state->the_completion.text, i); + + if(!cmpl_state->the_completion.text) + return NULL; + else + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } +} + +static CompletionDir* +find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash = strchr(text_to_complete, '/'); + CompletionDir* dir = cmpl_state->reference_dir; + CompletionDir* next; + *remaining_text = text_to_complete; + + while(first_slash) + { + gint len = first_slash - *remaining_text; + gint found = 0; + gchar *found_name = NULL; /* Quiet gcc */ + gint i; + gchar* pat_buf = g_new (gchar, len + 1); + + strncpy(pat_buf, *remaining_text, len); + pat_buf[len] = 0; + + for(i = 0; i < dir->sent->entry_count; i += 1) + { + if(dir->sent->entries[i].is_dir && + fnmatch(pat_buf, dir->sent->entries[i].entry_name, + FNMATCH_FLAGS)!= FNM_NOMATCH) + { + if(found) + { + g_free (pat_buf); + return dir; + } + else + { + found = 1; + found_name = dir->sent->entries[i].entry_name; + } + } + } + + if (!found) + { + /* Perhaps we are trying to open an automount directory */ + found_name = pat_buf; + } + + next = open_relative_dir(found_name, dir, cmpl_state); + + if(!next) + { + g_free (pat_buf); + return NULL; + } + + next->cmpl_parent = dir; + + dir = next; + + if(!correct_dir_fullname(dir)) + { + g_free(pat_buf); + return NULL; + } + + *remaining_text = first_slash + 1; + first_slash = strchr(*remaining_text, '/'); + + g_free (pat_buf); + } + + return dir; +} + +static void +update_cmpl(PossibleCompletion* poss, CompletionState* cmpl_state) +{ + gint cmpl_len; + + if(!poss || !cmpl_is_a_completion(poss)) + return; + + cmpl_len = strlen(cmpl_this_completion(poss)); + + if(cmpl_state->updated_text_alloc < cmpl_len + 1) + { + cmpl_state->updated_text = + (gchar*)g_realloc(cmpl_state->updated_text, + cmpl_state->updated_text_alloc); + cmpl_state->updated_text_alloc = 2*cmpl_len; + } + + if(cmpl_state->updated_text_len < 0) + { + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + cmpl_state->updated_text_len = cmpl_len; + cmpl_state->re_complete = cmpl_is_directory(poss); + } + else if(cmpl_state->updated_text_len == 0) + { + cmpl_state->re_complete = FALSE; + } + else + { + gint first_diff = + first_diff_index(cmpl_state->updated_text, + cmpl_this_completion(poss)); + + cmpl_state->re_complete = FALSE; + + if(first_diff == PATTERN_MATCH) + return; + + if(first_diff > cmpl_state->updated_text_len) + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + + cmpl_state->updated_text_len = first_diff; + cmpl_state->updated_text[first_diff] = 0; + } +} + +static PossibleCompletion* +attempt_file_completion(CompletionState *cmpl_state) +{ + gchar *pat_buf, *first_slash; + CompletionDir *dir = cmpl_state->active_completion_dir; + + dir->cmpl_index += 1; + + if(dir->cmpl_index == dir->sent->entry_count) + { + if(dir->cmpl_parent == NULL) + { + cmpl_state->active_completion_dir = NULL; + + return NULL; + } + else + { + cmpl_state->active_completion_dir = dir->cmpl_parent; + + return attempt_file_completion(cmpl_state); + } + } + + g_assert(dir->cmpl_text); + + first_slash = strchr(dir->cmpl_text, '/'); + + if(first_slash) + { + gint len = first_slash - dir->cmpl_text; + + pat_buf = g_new (gchar, len + 1); + strncpy(pat_buf, dir->cmpl_text, len); + pat_buf[len] = 0; + } + else + { + gint len = strlen(dir->cmpl_text); + + pat_buf = g_new (gchar, len + 2); + strcpy(pat_buf, dir->cmpl_text); + strcpy(pat_buf + len, "*"); + } + + if(first_slash) + { + if(dir->sent->entries[dir->cmpl_index].is_dir) + { + if(fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH) + { + CompletionDir* new_dir; + + new_dir = open_relative_dir(dir->sent->entries[dir->cmpl_index].entry_name, + dir, cmpl_state); + + if(!new_dir) + { + g_free (pat_buf); + return NULL; + } + + new_dir->cmpl_parent = dir; + + new_dir->cmpl_index = -1; + new_dir->cmpl_text = first_slash + 1; + + cmpl_state->active_completion_dir = new_dir; + + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + if(dir->cmpl_parent != NULL) + { + append_completion_text(dir->fullname + + strlen(cmpl_state->completion_dir->fullname) + 1, + cmpl_state); + append_completion_text("/", cmpl_state); + } + + append_completion_text(dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); + + cmpl_state->the_completion.is_a_completion = + (fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH); + + cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; + if(dir->sent->entries[dir->cmpl_index].is_dir) + append_completion_text("/", cmpl_state); + + g_free (pat_buf); + return &cmpl_state->the_completion; + } +} + + +static gint +get_pwdb(CompletionState* cmpl_state) +{ + struct passwd *pwd_ptr; + gchar* buf_ptr; + gint len = 0, i, count = 0; + + if(cmpl_state->user_dir_name_buffer) + return TRUE; + setpwent (); + + while ((pwd_ptr = getpwent()) != NULL) + { + len += strlen(pwd_ptr->pw_name); + len += strlen(pwd_ptr->pw_dir); + len += 2; + count += 1; + } + + setpwent (); + + cmpl_state->user_dir_name_buffer = g_new(gchar, len); + cmpl_state->user_directories = g_new(CompletionUserDir, count); + cmpl_state->user_directories_len = count; + + buf_ptr = cmpl_state->user_dir_name_buffer; + + for(i = 0; i < count; i += 1) + { + pwd_ptr = getpwent(); + if(!pwd_ptr) + { + cmpl_errno = errno; + goto error; + } + + strcpy(buf_ptr, pwd_ptr->pw_name); + cmpl_state->user_directories[i].login = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + strcpy(buf_ptr, pwd_ptr->pw_dir); + cmpl_state->user_directories[i].homedir = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + } + + qsort(cmpl_state->user_directories, + cmpl_state->user_directories_len, + sizeof(CompletionUserDir), + compare_user_dir); + + endpwent(); + + return TRUE; + +error: + + if(cmpl_state->user_dir_name_buffer) + g_free(cmpl_state->user_dir_name_buffer); + if(cmpl_state->user_directories) + g_free(cmpl_state->user_directories); + + cmpl_state->user_dir_name_buffer = NULL; + cmpl_state->user_directories = NULL; + + return FALSE; +} + +static gint +compare_user_dir(const void* a, const void* b) +{ + return strcmp((((CompletionUserDir*)a))->login, + (((CompletionUserDir*)b))->login); +} + +static gint +compare_cmpl_dir(const void* a, const void* b) +{ + return strcmp((((CompletionDirEntry*)a))->entry_name, + (((CompletionDirEntry*)b))->entry_name); +} + +static gint +cmpl_state_okay(CompletionState* cmpl_state) +{ + return cmpl_state && cmpl_state->reference_dir; +} + +static gchar* +cmpl_strerror(gint err) +{ + if(err == CMPL_ERRNO_TOO_LONG) + return "Name too long"; + else + return g_strerror (err); +} + +/* This is an internally used function to create pixmaps. */ +GtkWidget* +create_pixmap(GtkWidget *widget, const gchar *pixmap_char) +{ + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + GtkWidget *pixmap; + GdkColormap *colormap; + + colormap = gtk_widget_get_colormap (widget); + + gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (GTK_WIDGET(widget)->window, + colormap, + &mask, + NULL, + (gpointer) pixmap_char); + if (gdkpixmap == NULL) + { + g_warning ("Error loading pixmap: %s", pixmap_char); + return NULL; + } + pixmap = gtk_pixmap_new (gdkpixmap, mask); + gdk_pixmap_unref (gdkpixmap); + gdk_bitmap_unref (mask); + return pixmap; +} + + +/* Testing area */ +#ifdef TORRIE_DEBUG + +/* Get the selected filename and print it to the console */ +void file_ok_sel( GtkWidget *w, + GtkFileSelection *fs ) +{ + g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); +} + +void destroy( GtkWidget *widget, + gpointer data ) +{ + gtk_main_quit (); +} + +int main( int argc, + char *argv[] ) +{ + GtkWidget *filew; + const gchar *masks[] = { "mp3s/playlists <*.mp3,*.m3u>", + "src/hdr <*.[CcHh],*.[Cc][Cc],*.[Hh][Hh],*.cpp>", + NULL }; + + gtk_init (&argc, &argv); + + /* Create a new file selection widget */ + filew = gtk_file_selection_new ("Spiffy File Selector"); +// gtk_file_selection_complete(GTK_FILE_SELECTION(filew),"bob"); + + gtk_file_selection_set_masks (GTK_FILE_SELECTION (filew), masks); + + gtk_signal_connect (GTK_OBJECT (filew), "destroy", + (GtkSignalFunc) destroy, &filew); + /* Connect the ok_button to file_ok_sel function */ + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), + "clicked", (GtkSignalFunc) file_ok_sel, filew ); + + /* Connect the cancel_button to destroy the widget */ + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION + (filew)->cancel_button), + "clicked", (GtkSignalFunc) gtk_widget_destroy, + GTK_OBJECT (filew)); + + + gtk_widget_show(filew); + +/* + g_print("%d",gtk_file_selection_match_mask("mask.c","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m???.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m??*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c*")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","n*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.c","[mn]*")); + g_print("%d",gtk_file_selection_match_mask("COPYING","*.xpm")); +*/ + gtk_main (); + + return 0; +} +/* example-end */ +#endif diff --git a/radiant/gtkfilesel-linux.h b/radiant/gtkfilesel-linux.h new file mode 100644 index 00000000..b9ab49b7 --- /dev/null +++ b/radiant/gtkfilesel-linux.h @@ -0,0 +1,143 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_FILESEL_H__ +#define __GTK_FILESEL_H__ + + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) +#define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) +#define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) +#define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) +#define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) + + +typedef struct _GtkFileSelection GtkFileSelection; +typedef struct _GtkFileSelectionClass GtkFileSelectionClass; + +struct _GtkFileSelection +{ + GtkWindow window; + + GtkWidget *dir_list; + GtkWidget *file_list; + GtkWidget *selection_entry; + GtkWidget *selection_text; + GtkWidget *main_vbox; + GtkWidget *ok_button; + GtkWidget *cancel_button; + GtkWidget *help_button; + + /* These are not used. Just fillers in the class structure */ + GtkWidget *history_pulldown; + GtkWidget *history_menu; + GList *history_list; + /* ***************** */ + + GtkWidget *fileop_dialog; + GtkWidget *fileop_entry; + gchar *fileop_file; + gpointer cmpl_state; + gpointer fileop_data; + + GtkWidget *fileop_c_dir; + GtkWidget *fileop_del_file; + GtkWidget *fileop_ren_file; + + GtkWidget *button_area; + GtkWidget *action_area; + + GtkWidget *history_combo; + GList *prev_history; + GList *next_history; + GtkWidget *mask_entry; + gchar *mask; + gchar *saved_entry; + gchar *saved_entry1; + GtkWidget *completion_label; + + GtkWidget *bookmark_menu; + GList *bookmark_list; + GList *masks; + + GtkWidget *fileop_menu; + +}; + +struct _GtkFileSelectionClass +{ + GtkWindowClass parent_class; +}; + + +GtkType gtk_file_selection_get_type (void); +GtkWidget* gtk_file_selection_new (const gchar *title); +void gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename); +gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); +void gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern); +void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); +void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel); + +/* proposed interface */ +void gtk_file_selection_clear_masks (GtkFileSelection *filesel); +void gtk_file_selection_set_masks (GtkFileSelection *filesel, + const gchar **masks); +/* + where masks is a NULL-terminated array of strings of the format: + + "DESCRIPTION " or simply "MASK" + ie: "C,C++ files <*.[Cc],*.cc,*.cpp>" or simply + "*.jpg,*.gif" etc + +*/ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GTK_FILESEL_H__ */ + + + + + + + + + + diff --git a/radiant/gtkfilesel.c b/radiant/gtkfilesel.c new file mode 100644 index 00000000..aacc3b99 --- /dev/null +++ b/radiant/gtkfilesel.c @@ -0,0 +1,3337 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + + +// leo FIXME: if we keep this file then we'll need to ask permission to the author, this is LGPL +// This file is from the Advanced File Selector widget +// by Michael Torrie +// http://students.cs.byu.edu/~torriem/gtk/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fnmatch.h" + +// leo: added "gtk/" +#include "gdk/gdkkeysyms.h" +#include "gtk/gtkbutton.h" +#include "gtk/gtkentry.h" +#include "gtkfilesel.h" +#include "gtk/gtkhbox.h" +#include "gtk/gtkhbbox.h" +#include "gtk/gtklabel.h" +#include "gtk/gtklist.h" +#include "gtk/gtklistitem.h" +#include "gtk/gtkmain.h" +#include "gtk/gtkscrolledwindow.h" +#include "gtk/gtksignal.h" +#include "gtk/gtkvbox.h" +#include "gtk/gtkmenu.h" +#include "gtk/gtkmenuitem.h" +#include "gtk/gtkoptionmenu.h" +#include "gtk/gtkclist.h" +#include "gtk/gtkdialog.h" +#include "gtk/gtkcombo.h" +#include "gtk/gtkframe.h" + +// leo: disable NLS +//#include "gtk/gtkintl.h" +#define _(String) (String) + +#define DIR_LIST_WIDTH 180 +#define DIR_LIST_HEIGHT 180 +#define FILE_LIST_WIDTH 180 +#define FILE_LIST_HEIGHT 180 + +/* I've put this here so it doesn't get confused with the + * file completion interface */ +typedef struct _HistoryCallbackArg HistoryCallbackArg; + +struct _HistoryCallbackArg +{ + gchar *directory; + GtkWidget *menu_item; +}; + + +typedef struct _CompletionState CompletionState; +typedef struct _CompletionDir CompletionDir; +typedef struct _CompletionDirSent CompletionDirSent; +typedef struct _CompletionDirEntry CompletionDirEntry; +typedef struct _CompletionUserDir CompletionUserDir; +typedef struct _PossibleCompletion PossibleCompletion; + +/* Non-external file completion decls and structures */ + +/* A contant telling PRCS how many directories to cache. Its actually + * kept in a list, so the geometry isn't important. */ +#define CMPL_DIRECTORY_CACHE_SIZE 10 + +/* A constant used to determine whether a substring was an exact + * match by first_diff_index() + */ +#define PATTERN_MATCH -1 +/* The arguments used by all fnmatch() calls below + */ +#define FNMATCH_FLAGS (FNM_PATHNAME | FNM_PERIOD) + +#define CMPL_ERRNO_TOO_LONG ((1<<16)-1) + +/* This structure contains all the useful information about a directory + * for the purposes of filename completion. These structures are cached + * in the CompletionState struct. CompletionDir's are reference counted. + */ +struct _CompletionDirSent +{ + ino_t inode; + time_t mtime; + dev_t device; + + gint entry_count; + gchar *name_buffer; /* memory segment containing names of all entries */ + + struct _CompletionDirEntry *entries; +}; + +struct _CompletionDir +{ + CompletionDirSent *sent; + + gchar *fullname; + gint fullname_len; + + struct _CompletionDir *cmpl_parent; + gint cmpl_index; + gchar *cmpl_text; +}; + +/* This structure contains pairs of directory entry names with a flag saying + * whether or not they are a valid directory. NOTE: This information is used + * to provide the caller with information about whether to update its completions + * or try to open a file. Since directories are cached by the directory mtime, + * a symlink which points to an invalid file (which will not be a directory), + * will not be reevaluated if that file is created, unless the containing + * directory is touched. I consider this case to be worth ignoring (josh). + */ +struct _CompletionDirEntry +{ + gint is_dir; + gchar *entry_name; +}; + +struct _CompletionUserDir +{ + gchar *login; + gchar *homedir; +}; + +struct _PossibleCompletion +{ + /* accessible fields, all are accessed externally by functions + * declared above + */ + gchar *text; + gint is_a_completion; + gint is_directory; + + gint file_size; + gint file_time; + gint uid; + gint gid; + /* Private fields + */ + gint text_alloc; +}; + +struct _CompletionState +{ + gint last_valid_char; + gchar *updated_text; + gint updated_text_len; + gint updated_text_alloc; + gint re_complete; + + gchar *user_dir_name_buffer; + gint user_directories_len; + + gchar *last_completion_text; + + gint user_completion_index; /* if >= 0, currently completing ~user */ + + struct _CompletionDir *completion_dir; /* directory completing from */ + struct _CompletionDir *active_completion_dir; + + struct _PossibleCompletion the_completion; + + struct _CompletionDir *reference_dir; /* initial directory */ + + GList* directory_storage; + GList* directory_sent_storage; + + struct _CompletionUserDir *user_directories; +}; + + +/* File completion functions which would be external, were they used + * outside of this file. + */ + +static CompletionState* cmpl_init_state (void); +static void cmpl_free_state (CompletionState *cmpl_state); +static gint cmpl_state_okay (CompletionState* cmpl_state); +static gchar* cmpl_strerror (gint); + +static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete, + gchar **remaining_text, + CompletionState *cmpl_state); + +/* Returns a name for consideration, possibly a completion, this name + * will be invalid after the next call to cmpl_next_completion. + */ +static char* cmpl_this_completion (PossibleCompletion*); + +/* True if this completion matches the given text. Otherwise, this + * output can be used to have a list of non-completions. + */ +static gint cmpl_is_a_completion (PossibleCompletion*); + +/* True if the completion is a directory + */ +static gint cmpl_is_directory (PossibleCompletion*); + +/* Obtains the next completion, or NULL + */ +static PossibleCompletion* cmpl_next_completion (CompletionState*); + +/* Updating completions: the return value of cmpl_updated_text() will + * be text_to_complete completed as much as possible after the most + * recent call to cmpl_completion_matches. For the present + * application, this is the suggested replacement for the user's input + * string. You must CALL THIS AFTER ALL cmpl_text_completions have + * been received. + */ +static gchar* cmpl_updated_text (CompletionState* cmpl_state); + +/* After updating, to see if the completion was a directory, call + * this. If it was, you should consider re-calling completion_matches. + */ +static gint cmpl_updated_dir (CompletionState* cmpl_state); + +/* Current location: if using file completion, return the current + * directory, from which file completion begins. More specifically, + * the cwd concatenated with all exact completions up to the last + * directory delimiter('/'). + */ +static gchar* cmpl_reference_position (CompletionState* cmpl_state); + +/* backing up: if cmpl_completion_matches returns NULL, you may query + * the index of the last completable character into cmpl_updated_text. + */ +static gint cmpl_last_valid_char (CompletionState* cmpl_state); + +/* When the user selects a non-directory, call cmpl_completion_fullname + * to get the full name of the selected file. + */ +static gchar* cmpl_completion_fullname (gchar*, CompletionState* cmpl_state); + + +/* Directory operations. */ +static CompletionDir* open_ref_dir (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static gboolean check_dir (gchar *dir_name, + struct stat *result, + gboolean *stat_subdirs); +static CompletionDir* open_dir (gchar* dir_name, + CompletionState* cmpl_state); +static CompletionDir* open_user_dir (gchar* text_to_complete, + CompletionState *cmpl_state); +static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, + CompletionState *cmpl_state); +static CompletionDirSent* open_new_dir (gchar* dir_name, + struct stat* sbuf, + gboolean stat_subdirs); +static gint correct_dir_fullname (CompletionDir* cmpl_dir); +static gint correct_parent (CompletionDir* cmpl_dir, + struct stat *sbuf); +static gchar* find_parent_dir_fullname (gchar* dirname); +static CompletionDir* attach_dir (CompletionDirSent* sent, + gchar* dir_name, + CompletionState *cmpl_state); +static void free_dir_sent (CompletionDirSent* sent); +static void free_dir (CompletionDir *dir); +static void prune_memory_usage(CompletionState *cmpl_state); + +/* Completion operations */ +static PossibleCompletion* attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state); +static PossibleCompletion* attempt_file_completion(CompletionState *cmpl_state); +static CompletionDir* find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state); +static PossibleCompletion* append_completion_text(gchar* text, + CompletionState* cmpl_state); +static gint get_pwdb(CompletionState* cmpl_state); +static gint first_diff_index(gchar* pat, gchar* text); +static gint compare_user_dir(const void* a, const void* b); +static gint compare_cmpl_dir(const void* a, const void* b); +static void update_cmpl(PossibleCompletion* poss, + CompletionState* cmpl_state); + +static void gtk_file_selection_class_init (GtkFileSelectionClass *klass); +static void gtk_file_selection_init (GtkFileSelection *filesel); +static void gtk_file_selection_destroy (GtkObject *object); +static gint gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); + +static void gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data); + +static void gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer data); + +static void gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete); +static void gtk_file_selection_abort (GtkFileSelection *fs); + +static void gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_dir); + +static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); +static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); + +static gboolean gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data); +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + gpointer user_data); +static void gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data); +static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); +static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); +static void gtk_file_selection_home_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_up_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_prev_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_next_button (GtkWidget *widget, gpointer data); +static void gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data); + +static gint gtk_file_selection_match_char (gchar, gchar *mask); +static gint gtk_file_selection_match_mask (gchar *,gchar *); + + +static GtkWindowClass *parent_class = NULL; + +/* Saves errno when something cmpl does fails. */ +static gint cmpl_errno; + +/* General notes: + * Make prev and next inactive if their respective * + * histories are empty. + * Add facilities for handling hidden files and * + * directories * + * Add an api to access the mask, and hidden files * + * check box? (prob not in 1.2.x series) * + */ + +/* Routine for applying mask to filenames * + * Need to be optimized to minimize recursion * + * help the for loop by looking for the next * + * instance of the mask character following * + * the '*'. ei *.c -- look for '.' * + * Also, swap all *? pairs (-> ?*), as that * + * will make it possible to look ahead (? * + * makes it very nondeterministic as in *?.c * + * which really is ?*.c * + * Allow multiply masks, separted by commas * + * Allow more flexible [] handling (ie [a-zA-Z] * + * * + */ +static gint gtk_file_selection_match_char (gchar text, gchar *mask){ + gchar *maskc; + gint x; + gint s; + + if (mask[0] == '[') + { + if (!strchr (mask,']')) return 0; + maskc = g_strdup(mask + 1); /* get the portion of mask inside []*/ + + (*(strchr (maskc,']'))) = 0; + s = strlen ((char *)maskc); + + for (x = 0; x < s; x++){ + if (text == maskc[x]) + { + g_free (maskc); + return s + 2; + } + } + g_free (maskc); + return 0; + } + + if (mask[0] == '?') return 1; + if (mask[0] == text) return 1; + + return 0; +} + + +static gint gtk_file_selection_match_mask (gchar *text, gchar *mask){ + + int mc; + int tc; + + tc = 0; mc = 0; + + if (mask[0] == 0 && text[0] == 0) return 1; + + if (mask[0] == '*') + { + for (tc = 0; tc <= strlen(text); tc++) + { + if (gtk_file_selection_match_mask (text + tc, mask + 1)) + return 1; + } + return 0; + } + mc = gtk_file_selection_match_char (text[0], mask); + + if(mc) + return gtk_file_selection_match_mask (text + 1, mask + mc); + else + return 0; +} + +GtkType +gtk_file_selection_get_type (void) +{ + static GtkType file_selection_type = 0; + + if (!file_selection_type) + { + static const GtkTypeInfo filesel_info = + { + "GtkFileSelection", + sizeof (GtkFileSelection), + sizeof (GtkFileSelectionClass), + (GtkClassInitFunc) gtk_file_selection_class_init, + (GtkObjectInitFunc) gtk_file_selection_init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); + } + + return file_selection_type; +} + +static void +gtk_file_selection_class_init (GtkFileSelectionClass *class) +{ + GtkObjectClass *object_class; + + object_class = (GtkObjectClass*) class; + + parent_class = gtk_type_class (GTK_TYPE_WINDOW); + + object_class->destroy = gtk_file_selection_destroy; +} + +static void +gtk_file_selection_init (GtkFileSelection *filesel) +{ + GtkWidget *entry_vbox; + GtkWidget *label; + GtkWidget *list_hbox; + GtkWidget *confirm_area; + GtkWidget *vbox; + GtkWidget *hbox; + GtkWidget *pulldown_hbox; + GtkWidget *scrolled_win; + GtkWidget *mask_label; + GtkWidget *bigframe; + GtkWidget *label_lookingin; + GtkWidget *up_button; + GtkWidget *home_button; + GtkWidget *prev_button; + GtkWidget *next_button; + GtkWidget *refresh_button; + + char *dir_title [2]; + char *file_title [2]; + + filesel->cmpl_state = cmpl_init_state (); + + filesel->mask=NULL; + filesel->prev_history=NULL; + filesel->next_history=NULL; + filesel->saved_entry=NULL; + + /* The dialog-sized vertical box */ + filesel->main_vbox = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); + gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox); + gtk_widget_show (filesel->main_vbox); + + /* The horizontal box containing create, rename etc. buttons */ + filesel->button_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(filesel->button_area), GTK_BUTTONBOX_START); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(filesel->button_area), 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, + FALSE, FALSE, 0); + gtk_widget_show (filesel->button_area); + + gtk_file_selection_show_fileop_buttons(filesel); + + /* hbox for pulldown menu */ + pulldown_hbox = gtk_hbox_new (FALSE, 5); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); + gtk_widget_show (pulldown_hbox); + + /* The combo box that replaces the pulldown menu */ + label_lookingin = gtk_label_new (_("Looking in:")); + gtk_widget_show (label_lookingin); + gtk_box_pack_start (GTK_BOX (pulldown_hbox), label_lookingin, FALSE, FALSE, 0); + + filesel->history_combo = gtk_combo_new(); + gtk_widget_show(filesel->history_combo); + gtk_combo_set_value_in_list(GTK_COMBO(filesel->history_combo),FALSE,FALSE); + gtk_box_pack_start (GTK_BOX(pulldown_hbox),filesel->history_combo, + TRUE,TRUE, 0); + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->entry),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"button-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_callback, + (gpointer) filesel); + + gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->list),"key-press-event", + (GtkSignalFunc) gtk_file_selection_history_combo_list_key_handler, + (gpointer) filesel); + + /* frame to put the following hbox in */ + bigframe = gtk_frame_new (NULL); + gtk_widget_show (bigframe); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), bigframe, TRUE, TRUE, 0); + + /* The horizontal box containing the directory and file listboxes */ + list_hbox = gtk_hbox_new (FALSE, 5); + gtk_container_add (GTK_CONTAINER(bigframe), list_hbox); + gtk_container_set_border_width (GTK_CONTAINER (list_hbox), 5); + gtk_widget_show (list_hbox); + + /* vbox to put the buttons and directory listing in */ + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (list_hbox), vbox, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + home_button = gtk_button_new_with_label (_("Home")); + gtk_widget_show (home_button); + gtk_signal_connect (GTK_OBJECT (home_button), "clicked", + (GtkSignalFunc) gtk_file_selection_home_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), home_button, TRUE,TRUE, 0); + + prev_button = gtk_button_new_with_label (_("Prev")); + gtk_signal_connect (GTK_OBJECT (prev_button), "clicked", + (GtkSignalFunc) gtk_file_selection_prev_button, + (gpointer) filesel); + gtk_widget_show (prev_button); + gtk_box_pack_start (GTK_BOX (hbox), prev_button, TRUE,TRUE, 0); + + up_button = gtk_button_new_with_label (_("Up")); + gtk_signal_connect (GTK_OBJECT (up_button), "clicked", + (GtkSignalFunc) gtk_file_selection_up_button, + (gpointer) filesel); + gtk_widget_show (up_button); + gtk_box_pack_start (GTK_BOX (hbox), up_button, TRUE,TRUE, 0); + + next_button = gtk_button_new_with_label (_("Next")); + gtk_widget_show (next_button); + gtk_signal_connect (GTK_OBJECT (next_button), "clicked", + (GtkSignalFunc) gtk_file_selection_next_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), next_button, TRUE,TRUE, 0); + + refresh_button = gtk_button_new_with_label (_("Refresh")); + gtk_widget_show (refresh_button); + gtk_signal_connect (GTK_OBJECT (refresh_button), "clicked", + (GtkSignalFunc) gtk_file_selection_refresh_button, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox), refresh_button, TRUE, TRUE, 0); + + /* The directories clist */ + dir_title[0] = _("Directories"); + dir_title[1] = NULL; + filesel->dir_list = gtk_clist_new_with_titles (1, (gchar**) dir_title); + gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", + (GtkSignalFunc) gtk_file_selection_dir_button, + (gpointer) filesel); + gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "unselect_row", + (GtkSignalFunc) gtk_file_selection_undir_button, + (gpointer) filesel); + gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE,TRUE, 5); + gtk_widget_show (filesel->dir_list); + gtk_widget_show (scrolled_win); + + /* vbox area for mask entry and files clist */ + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (list_hbox), vbox, TRUE, TRUE, 0); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + mask_label = gtk_label_new (_("Mask:")); + gtk_widget_show (mask_label); + gtk_box_pack_start (GTK_BOX (hbox), mask_label, FALSE, FALSE, 0); + + filesel->mask_entry = gtk_entry_new (); + gtk_widget_show (filesel->mask_entry); + gtk_signal_connect(GTK_OBJECT(filesel->mask_entry),"activate", + (GtkSignalFunc) gtk_file_selection_mask_entry_callback, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (hbox),filesel->mask_entry, TRUE, TRUE, 0); + + + /* The files clist */ + file_title[0] = _("Files"); + file_title[1] = NULL; + filesel->file_list = gtk_clist_new_with_titles (1, (gchar**) file_title); + gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); + gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", + (GtkSignalFunc) gtk_file_selection_file_button, + (gpointer) filesel); + gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 5); + gtk_widget_show (filesel->file_list); + gtk_widget_show (scrolled_win); + + /* action area for packing buttons into. */ + filesel->action_area = gtk_hbox_new (TRUE, 0); + gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, + FALSE, FALSE, 0); + gtk_widget_show (filesel->action_area); + + /* The OK/Cancel button area */ + confirm_area = gtk_hbutton_box_new (); + gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_area), 5); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0); + gtk_widget_show (confirm_area); + + /* The OK button */ + filesel->ok_button = gtk_button_new_with_label (_("OK")); + GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0); + gtk_widget_grab_default (filesel->ok_button); + gtk_widget_show (filesel->ok_button); + + /* The Cancel button */ + filesel->cancel_button = gtk_button_new_with_label (_("Cancel")); + GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT); + gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0); + gtk_widget_show (filesel->cancel_button); + + /* The selection entry widget */ + entry_vbox = gtk_vbox_new (FALSE, 2); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); + gtk_widget_show (entry_vbox); + + filesel->selection_text = label = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (entry_vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + + filesel->selection_entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event", + (GtkSignalFunc) gtk_file_selection_key_press, filesel); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event", + (GtkSignalFunc) gtk_widget_grab_default, + GTK_OBJECT (filesel->ok_button)); + gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate", + (GtkSignalFunc) gtk_button_clicked, + GTK_OBJECT (filesel->ok_button)); + gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0); + gtk_widget_show (filesel->selection_entry); + + if (!cmpl_state_okay (filesel->cmpl_state)) + { + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf); + } + else + { + gtk_file_selection_populate (filesel, "", FALSE); + } + + gtk_widget_grab_focus (filesel->selection_entry); +} + +GtkWidget* +gtk_file_selection_new (const gchar *title) +{ + GtkFileSelection *filesel; + + filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION); + gtk_window_set_title (GTK_WINDOW (filesel), title); + + return GTK_WIDGET (filesel); +} + +void +gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + /* delete, create directory, and rename */ + if (!filesel->fileop_c_dir) + { + filesel->fileop_c_dir = gtk_button_new_with_label (_("Create Dir")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_c_dir, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_c_dir); + } + + if (!filesel->fileop_del_file) + { + filesel->fileop_del_file = gtk_button_new_with_label (_("Delete File")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_del_file, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_del_file); + } + + if (!filesel->fileop_ren_file) + { + filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename File")); + gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file, + (gpointer) filesel); + gtk_box_pack_start (GTK_BOX (filesel->button_area), + filesel->fileop_ren_file, TRUE, TRUE, 0); + gtk_widget_show (filesel->fileop_ren_file); + } + + gtk_widget_queue_resize(GTK_WIDGET(filesel)); +} + +void +gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + + if (filesel->fileop_ren_file) + { + gtk_widget_destroy (filesel->fileop_ren_file); + filesel->fileop_ren_file = NULL; + } + + if (filesel->fileop_del_file) + { + gtk_widget_destroy (filesel->fileop_del_file); + filesel->fileop_del_file = NULL; + } + + if (filesel->fileop_c_dir) + { + gtk_widget_destroy (filesel->fileop_c_dir); + filesel->fileop_c_dir = NULL; + } +} + + + +void +gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename) +{ + char buf[MAXPATHLEN]; + const char *name, *last_slash; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (filename != NULL); + + last_slash = strrchr (filename, '/'); + + if (!last_slash) + { + buf[0] = 0; + name = filename; + } + else + { + gint len = MIN (MAXPATHLEN - 1, last_slash - filename + 1); + + strncpy (buf, filename, len); + buf[len] = 0; + + name = last_slash + 1; + } + + gtk_file_selection_populate (filesel, buf, FALSE); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name); +} + +gchar* +gtk_file_selection_get_filename (GtkFileSelection *filesel) +{ + static char nothing[2] = ""; + char *text; + char *filename; + + g_return_val_if_fail (filesel != NULL, nothing); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing); + + text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); + if (text) + { + filename = cmpl_completion_fullname (text, filesel->cmpl_state); + return filename; + } + + return nothing; +} + +void +gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern) +{ + gchar *new_pattern; + gint x; + + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (pattern != NULL); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); + + if(strchr(pattern,'*') || strchr(pattern,'?')) + { + for(x=strlen(pattern);x>=0;x--) + { + if(pattern[x]=='/') break; + } + gtk_entry_set_text(GTK_ENTRY(filesel->mask_entry),g_strdup(pattern+x+1)); + + if(filesel->mask) g_free(filesel->mask); + + filesel->mask=g_strdup(pattern+x+1); + new_pattern=g_strdup(pattern); + new_pattern[x+1]=0; + gtk_file_selection_populate (filesel, (gchar*) new_pattern, TRUE); + g_free(new_pattern); + } + else + { + gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE); + } +} + +static void +gtk_file_selection_destroy (GtkObject *object) +{ + GtkFileSelection *filesel; + GList *list; + + g_return_if_fail (object != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (object)); + + filesel = GTK_FILE_SELECTION (object); + + if (filesel->fileop_dialog) + gtk_widget_destroy (filesel->fileop_dialog); + + if (filesel->next_history) + { + list = filesel->next_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->next_history); + filesel->next_history = NULL; + + if (filesel->prev_history) + { + list = filesel->prev_history; + while (list) + { + g_free (list->data); + list = list->next; + } + } + g_list_free (filesel->prev_history); + filesel->prev_history = NULL; + + if (filesel->mask) + { + g_free (filesel->mask); + filesel->mask = NULL; + } + + cmpl_free_state (filesel->cmpl_state); + filesel->cmpl_state = NULL; + + if (GTK_OBJECT_CLASS (parent_class)->destroy) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + +/* Begin file operations callbacks */ + +static void +gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message) +{ + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + + g_return_if_fail (error_message != NULL); + + /* main dialog */ + dialog = gtk_dialog_new (); + /* + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + */ + gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, make this dialog modal too */ + /* When error dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(error_message); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* yes, we free it */ + g_free (error_message); + + /* close button */ + button = gtk_button_new_with_label (_("Close")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + fs->fileop_dialog = NULL; +} + + +static void +gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *dirname; + gchar *path; + gchar *full_path; + gchar *buf; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", dirname, NULL); + if ( (mkdir (full_path, 0755) < 0) ) + { + buf = g_strconcat ("Error creating directory \"", dirname, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_create_dir (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + label = gtk_label_new(_("Directory name:")); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + /* The directory entry widget */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + /* buttons */ + button = gtk_button_new_with_label (_("Create")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + +static void +gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + CompletionState *cmpl_state; + gchar *path; + gchar *full_path; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + full_path = g_strconcat (path, "/", fs->fileop_file, NULL); + if ( (unlink (full_path) < 0) ) + { + buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (full_path); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_delete_file (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *vbox; + GtkWidget *button; + GtkWidget *dialog; + gchar *filename; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(filename) < 1) + return; + + fs->fileop_file = filename; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog is closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* buttons */ + button = gtk_button_new_with_label (_("Delete")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); + +} + +static void +gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + gchar *buf; + gchar *file; + gchar *path; + gchar *new_filename; + gchar *old_filename; + CompletionState *cmpl_state; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); + cmpl_state = (CompletionState*) fs->cmpl_state; + path = cmpl_reference_position (cmpl_state); + + new_filename = g_strconcat (path, "/", file, NULL); + old_filename = g_strconcat (path, "/", fs->fileop_file, NULL); + + if ( (rename (old_filename, new_filename)) < 0) + { + buf = g_strconcat ("Error renaming file \"", file, "\": ", + g_strerror(errno), NULL); + gtk_file_selection_fileop_error (fs, buf); + } + g_free (new_filename); + g_free (old_filename); + + gtk_widget_destroy (fs->fileop_dialog); + gtk_file_selection_populate (fs, "", FALSE); +} + +static void +gtk_file_selection_rename_file (GtkWidget *widget, gpointer data) +{ + GtkFileSelection *fs = data; + GtkWidget *label; + GtkWidget *dialog; + GtkWidget *vbox; + GtkWidget *button; + gchar *buf; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + if (fs->fileop_dialog) + return; + + fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + if (strlen(fs->fileop_file) < 1) + return; + + /* main dialog */ + fs->fileop_dialog = dialog = gtk_dialog_new (); + gtk_signal_connect (GTK_OBJECT (dialog), "destroy", + (GtkSignalFunc) gtk_file_selection_fileop_destroy, + (gpointer) fs); + gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + + /* If file dialog is grabbed, grab option dialog */ + /* When option dialog closed, file dialog will be grabbed again */ + if (GTK_WINDOW(fs)->modal) + gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER(vbox), 8); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, + FALSE, FALSE, 0); + gtk_widget_show(vbox); + + buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL); + label = gtk_label_new(buf); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + g_free(buf); + + /* New filename entry */ + fs->fileop_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, + TRUE, TRUE, 5); + GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); + gtk_widget_show (fs->fileop_entry); + + gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); + gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), + 0, strlen (fs->fileop_file)); + + /* buttons */ + button = gtk_button_new_with_label (_("Rename")); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, + (gpointer) fs); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_show(button); + + button = gtk_button_new_with_label (_("Cancel")); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) gtk_widget_destroy, + (gpointer) dialog); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), + button, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(button); + gtk_widget_show (button); + + gtk_widget_show (dialog); +} + + +static gint +gtk_file_selection_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + GtkFileSelection *fs; + char *text; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + fs = GTK_FILE_SELECTION (user_data); + + if (event->keyval == GDK_Tab) + { + text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + + text = g_strdup (text); + + gtk_file_selection_populate (fs, text, TRUE); + + g_free (text); + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + + return TRUE; + } + if (fs->saved_entry) + { + gtk_clist_unselect_all ((GtkCList *) (fs->dir_list)); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + + + return FALSE; +} + +static void +gtk_file_selection_home_button (GtkWidget *widget, gpointer data){ + GList *list; + + GtkFileSelection *fs=data; + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs,"~/",FALSE); +} + +static void +gtk_file_selection_up_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, "../", FALSE); /*change directories. */ + +} + +static void +gtk_file_selection_prev_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->prev_history; + + if (list && g_list_length(list) > 1) + { + first = list; /* get first element */ + list = list->next; /* pop off current directory */ + + list->prev = NULL; /* make this the new head. */ + + fs->prev_history = list; /* update prev_history list */ + fs->next_history = g_list_prepend(fs->next_history,first->data); /* put it on next_history */ + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + + + path = g_malloc(strlen(list->data)+4); /* plenty of space */ + strcpy(path,list->data); /* get the 2nd path in the history */ + strcat(path,"/"); /* append a '/' */ + gtk_file_selection_populate (fs, path, FALSE); /* change directories. */ + g_free (path); + } +} + +static void +gtk_file_selection_next_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + GList *list; + GList *first; + gchar *path; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + list = fs->next_history; + + if (list && g_list_length(list) > 0) + { + first = list; /*get first element*/ + list = list->next; /*pop off current directory*/ + + if (list) + list->prev = NULL; + + fs->next_history = list; /*update prev_history list*/ + + path = g_malloc(strlen(first->data)+4); /*plenty of space*/ + strcpy(path,first->data); + strcat(path,"/"); /*append a / */ + gtk_file_selection_populate (fs, path, FALSE); /*change directories.*/ + g_free(path); + + first->next = NULL; /* orphan the old first node */ + g_list_free (first); /* free the node (data is now in use by next_history) */ + + } +} + +void static +gtk_file_selection_refresh_button (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_file_selection_populate (fs,"",FALSE); +} + +static void +gtk_file_selection_mask_entry_callback (GtkWidget *widget, gpointer data){ + GtkFileSelection *fs = data; + + if(fs->mask) + g_free (fs->mask); + + fs->mask = g_strdup(gtk_entry_get_text (GTK_ENTRY(fs->mask_entry))); + + if (strlen(fs->mask) == 0) + { + g_free (fs->mask); + fs->mask = NULL; + } + + gtk_file_selection_refresh_button (widget,data); +} + +static gboolean gtk_file_selection_history_combo_list_key_handler(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + /* + g_print("Key pressed! \n"); + */ + + return TRUE; +} + +static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget *thelist, + GdkEventButton *event, + gpointer user_data) +{ + + GtkFileSelection *fs = user_data; + GList *list; + gchar *path; + + list = fs->next_history; + if(list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(GTK_ENTRY (((GtkCombo *)fs->history_combo)->entry)))+4); + strcpy (path,gtk_entry_get_text(GTK_ENTRY( ((GtkCombo *)fs->history_combo)->entry))); + strcat (path,"/"); + + gtk_file_selection_populate (fs,path,TRUE); + + g_free (path); + + return TRUE; +} + +static gboolean +gtk_file_selection_history_combo_callback (GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + GtkEntry *entry=(GtkEntry *)widget; + GtkFileSelection *fs=data; + GList *list; + gchar *path; + + g_return_val_if_fail (fs != NULL,FALSE); + g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs),FALSE); + + + if (event->keyval == GDK_Return) + { + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + path = g_malloc(strlen(gtk_entry_get_text(entry))+4); + strcpy (path,gtk_entry_get_text(entry)); + strcat (path,"/"); + gtk_file_selection_populate (fs,path,TRUE); + g_free (path); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + return TRUE; + } + else + { + return FALSE; + } + +} + +static void +gtk_file_selection_update_history_menu (GtkFileSelection *fs, + gchar *current_directory) +{ + gchar *current_dir; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + g_return_if_fail (current_directory != NULL); + + current_dir = g_strdup (current_directory); + + if(fs->prev_history) + { + if (strcmp((fs->prev_history)->data,current_dir)) + { /*if this item isn't on the top of the list */ + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + } else { + fs->prev_history = g_list_prepend(fs->prev_history,g_strdup(current_dir)); + } + + gtk_combo_set_popdown_strings (GTK_COMBO (fs->history_combo),fs->prev_history); + + g_free (current_dir); +} + +static void +gtk_file_selection_file_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = user_data; + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->file_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + gtk_button_clicked (GTK_BUTTON (fs->ok_button)); + break; + + default: + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_dir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GList *list; + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + case GDK_2BUTTON_PRESS: + list = fs->next_history; + if (list) + { + g_free (list->data); + list = list->next; + } + g_list_free (fs->next_history); + fs->next_history = NULL; + + gtk_file_selection_populate (fs, filename, FALSE); + gtk_entry_set_text(GTK_ENTRY(fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + break; + + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) g_free (fs->saved_entry); + fs->saved_entry=g_strdup(gtk_entry_get_text(GTK_ENTRY (fs->selection_entry))); + + temp=g_strconcat(filename,fs->saved_entry,NULL); + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), temp); + g_free (temp); + + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); + + g_free (filename); + } +} + +static void +gtk_file_selection_undir_button (GtkWidget *widget, + gint row, + gint column, + GdkEventButton *bevent, + gpointer user_data) +{ + GtkFileSelection *fs = NULL; + gchar *filename, *temp = NULL; + + g_return_if_fail (GTK_IS_CLIST (widget)); + + fs = GTK_FILE_SELECTION (user_data); + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); + filename = g_strdup (temp); + + if (filename) + { + if (bevent) + switch (bevent->type) + { + default: + /* here we need to add the "filename" to the beginning of what's already + in the entry. Save what's in the entry, then restore it on the double click + */ + if (fs->saved_entry) + { + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry),fs->saved_entry); + g_free (fs->saved_entry); + fs->saved_entry = NULL; + } + break; + } + else + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); //????? + + g_free (filename); + } +} + +static void +gtk_file_selection_populate (GtkFileSelection *fs, + gchar *rel_path, + gint try_complete) +{ + CompletionState *cmpl_state; + PossibleCompletion* poss; + gchar* filename; + gint row; + gchar* rem_path = rel_path; + gchar* sel_text; + gchar* text[2]; + gint did_recurse = FALSE; + gint possible_count = 0; + gint selection_index = -1; + gint file_list_width; + gint dir_list_width; + + g_return_if_fail (fs != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); + + cmpl_state = (CompletionState*) fs->cmpl_state; + poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state); + + if (!cmpl_state_okay (cmpl_state)) + { + /* Something went wrong. */ + gtk_file_selection_abort (fs); + return; + } + + g_assert (cmpl_state->reference_dir); + + gtk_clist_freeze (GTK_CLIST (fs->dir_list)); + gtk_clist_clear (GTK_CLIST (fs->dir_list)); + gtk_clist_freeze (GTK_CLIST (fs->file_list)); + gtk_clist_clear (GTK_CLIST (fs->file_list)); + + /* Set the dir_list to include ./ and ../ */ + text[1] = NULL; + text[0] = "./"; + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + + text[0] = "../"; + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + + /*reset the max widths of the lists*/ + dir_list_width = gdk_string_width(fs->dir_list->style->font,"../"); + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width); + file_list_width = 1; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width); + + while (poss) + { + if (cmpl_is_a_completion (poss)) + { + possible_count += 1; + + filename = cmpl_this_completion (poss); + + text[0] = filename; + + if (cmpl_is_directory (poss)) + { + if (strcmp (filename, "./") != 0 && + strcmp (filename, "../") != 0) + { + int width = gdk_string_width(fs->dir_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); + if(width > dir_list_width) + { + dir_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0, + width); + } + } + } + else + { + if(fs->mask) + { + if (gtk_file_selection_match_mask(filename,fs->mask)) + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + else + { + int width = gdk_string_width(fs->file_list->style->font, + filename); + row = gtk_clist_append (GTK_CLIST (fs->file_list), text); + if(width > file_list_width) + { + file_list_width = width; + gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0, + width); + } + } + } + } + + poss = cmpl_next_completion (cmpl_state); + } + + gtk_clist_thaw (GTK_CLIST (fs->dir_list)); + gtk_clist_thaw (GTK_CLIST (fs->file_list)); + + /* File lists are set. */ + + g_assert (cmpl_state->reference_dir); + + if (try_complete) + { + + /* User is trying to complete filenames, so advance the user's input + * string to the updated_text, which is the common leading substring + * of all possible completions, and if its a directory attempt + * attempt completions in it. */ + + if (cmpl_updated_text (cmpl_state)[0]) + { + + if (cmpl_updated_dir (cmpl_state)) + { + gchar* dir_name = g_strdup (cmpl_updated_text (cmpl_state)); + + did_recurse = TRUE; + + gtk_file_selection_populate (fs, dir_name, TRUE); + + g_free (dir_name); + } + else + { + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), + cmpl_updated_text (cmpl_state)); + } + } + else + { + selection_index = cmpl_last_valid_char (cmpl_state) - + (strlen (rel_path) - strlen (rem_path)); + if (fs->selection_entry) + gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); + } + } + else + { + if (fs->selection_entry) + /* Here we need to take the old filename and keep it!*/ + /*gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), "");*/ + ; + } + + if (!did_recurse) + { + if (fs->selection_entry) + gtk_entry_set_position (GTK_ENTRY (fs->selection_entry), selection_index); + + if (fs->selection_entry) + { + sel_text = g_strconcat (_("Selection: "), + cmpl_reference_position (cmpl_state), + NULL); + + gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text); + g_free (sel_text); + } + + gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state)); + + } +} + +static void +gtk_file_selection_abort (GtkFileSelection *fs) +{ + gchar err_buf[256]; + + sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); + + /* BEEP gdk_beep(); */ + + if (fs->selection_entry) + gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf); +} + +/**********************************************************************/ +/* External Interface */ +/**********************************************************************/ + +/* The four completion state selectors + */ +static gchar* +cmpl_updated_text (CompletionState* cmpl_state) +{ + return cmpl_state->updated_text; +} + +static gint +cmpl_updated_dir (CompletionState* cmpl_state) +{ + return cmpl_state->re_complete; +} + +static gchar* +cmpl_reference_position (CompletionState* cmpl_state) +{ + return cmpl_state->reference_dir->fullname; +} + +static gint +cmpl_last_valid_char (CompletionState* cmpl_state) +{ + return cmpl_state->last_valid_char; +} + +static gchar* +cmpl_completion_fullname (gchar* text, CompletionState* cmpl_state) +{ + static char nothing[2] = ""; + + if (!cmpl_state_okay (cmpl_state)) + { + return nothing; + } + else if (text[0] == '/') + { + strcpy (cmpl_state->updated_text, text); + } + else if (text[0] == '~') + { + CompletionDir* dir; + char* slash; + + dir = open_user_dir (text, cmpl_state); + + if (!dir) + { + /* spencer says just return ~something, so + * for now just do it. */ + strcpy (cmpl_state->updated_text, text); + } + else + { + + strcpy (cmpl_state->updated_text, dir->fullname); + + slash = strchr (text, '/'); + + if (slash) + strcat (cmpl_state->updated_text, slash); + } + } + else + { + strcpy (cmpl_state->updated_text, cmpl_state->reference_dir->fullname); + if (strcmp (cmpl_state->reference_dir->fullname, "/") != 0) + strcat (cmpl_state->updated_text, "/"); + strcat (cmpl_state->updated_text, text); + } + + return cmpl_state->updated_text; +} + +/* The three completion selectors + */ +static gchar* +cmpl_this_completion (PossibleCompletion* pc) +{ + return pc->text; +} + +static gint +cmpl_is_directory (PossibleCompletion* pc) +{ + return pc->is_directory; +} + +static gint +cmpl_is_a_completion (PossibleCompletion* pc) +{ + return pc->is_a_completion; +} + +/**********************************************************************/ +/* Construction, deletion */ +/**********************************************************************/ + +static CompletionState* +cmpl_init_state (void) +{ + gchar getcwd_buf[2*MAXPATHLEN]; + CompletionState *new_state; + + new_state = g_new (CompletionState, 1); + + /* We don't use getcwd() on SUNOS, because, it does a popen("pwd") + * and, if that wasn't bad enough, hangs in doing so. + */ +#if defined(sun) && !defined(__SVR4) + if (!getwd (getcwd_buf)) +#else + if (!getcwd (getcwd_buf, MAXPATHLEN)) +#endif + { + /* Oh joy, we can't get the current directory. Um..., we should have + * a root directory, right? Right? (Probably not portable to non-Unix) + */ + strcpy (getcwd_buf, "/"); + } + +tryagain: + + new_state->reference_dir = NULL; + new_state->completion_dir = NULL; + new_state->active_completion_dir = NULL; + new_state->directory_storage = NULL; + new_state->directory_sent_storage = NULL; + new_state->last_valid_char = 0; + new_state->updated_text = g_new (gchar, MAXPATHLEN); + new_state->updated_text_alloc = MAXPATHLEN; + new_state->the_completion.text = g_new (gchar, MAXPATHLEN); + new_state->the_completion.text_alloc = MAXPATHLEN; + new_state->user_dir_name_buffer = NULL; + new_state->user_directories = NULL; + + new_state->reference_dir = open_dir (getcwd_buf, new_state); + + if (!new_state->reference_dir) + { + /* Directories changing from underneath us, grumble */ + strcpy (getcwd_buf, "/"); + goto tryagain; + } + + return new_state; +} + +static void +cmpl_free_dir_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_dir_sent_list(GList* dp0) +{ + GList *dp = dp0; + + while (dp) { + free_dir_sent (dp->data); + dp = dp->next; + } + + g_list_free(dp0); +} + +static void +cmpl_free_state (CompletionState* cmpl_state) +{ + cmpl_free_dir_list (cmpl_state->directory_storage); + cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage); + + if (cmpl_state->user_dir_name_buffer) + g_free (cmpl_state->user_dir_name_buffer); + if (cmpl_state->user_directories) + g_free (cmpl_state->user_directories); + if (cmpl_state->the_completion.text) + g_free (cmpl_state->the_completion.text); + if (cmpl_state->updated_text) + g_free (cmpl_state->updated_text); + + g_free (cmpl_state); +} + +static void +free_dir(CompletionDir* dir) +{ + g_free(dir->fullname); + g_free(dir); +} + +static void +free_dir_sent(CompletionDirSent* sent) +{ + g_free(sent->name_buffer); + g_free(sent->entries); + g_free(sent); +} + +static void +prune_memory_usage(CompletionState *cmpl_state) +{ + GList* cdsl = cmpl_state->directory_sent_storage; + GList* cdl = cmpl_state->directory_storage; + GList* cdl0 = cdl; + gint len = 0; + + for(; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1) + cdsl = cdsl->next; + + if (cdsl) { + cmpl_free_dir_sent_list(cdsl->next); + cdsl->next = NULL; + } + + cmpl_state->directory_storage = NULL; + while (cdl) { + if (cdl->data == cmpl_state->reference_dir) + cmpl_state->directory_storage = g_list_prepend(NULL, cdl->data); + else + free_dir (cdl->data); + cdl = cdl->next; + } + + g_list_free(cdl0); +} + +/**********************************************************************/ +/* The main entrances. */ +/**********************************************************************/ + +static PossibleCompletion* +cmpl_completion_matches (gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + PossibleCompletion *poss; + + prune_memory_usage(cmpl_state); + + g_assert (text_to_complete != NULL); + + cmpl_state->user_completion_index = -1; + cmpl_state->last_completion_text = text_to_complete; + cmpl_state->the_completion.text[0] = 0; + cmpl_state->last_valid_char = 0; + cmpl_state->updated_text_len = -1; + cmpl_state->updated_text[0] = 0; + cmpl_state->re_complete = FALSE; + + first_slash = strchr (text_to_complete, '/'); + + if (text_to_complete[0] == '~' && !first_slash) + { + /* Text starts with ~ and there is no slash, show all the + * home directory completions. + */ + poss = attempt_homedir_completion (text_to_complete, cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; + } + + cmpl_state->reference_dir = + open_ref_dir (text_to_complete, remaining_text, cmpl_state); + + if(!cmpl_state->reference_dir) + return NULL; + + cmpl_state->completion_dir = + find_completion_dir (*remaining_text, remaining_text, cmpl_state); + + cmpl_state->last_valid_char = *remaining_text - text_to_complete; + + if(!cmpl_state->completion_dir) + return NULL; + + cmpl_state->completion_dir->cmpl_index = -1; + cmpl_state->completion_dir->cmpl_parent = NULL; + cmpl_state->completion_dir->cmpl_text = *remaining_text; + + cmpl_state->active_completion_dir = cmpl_state->completion_dir; + + cmpl_state->reference_dir = cmpl_state->completion_dir; + + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +static PossibleCompletion* +cmpl_next_completion (CompletionState* cmpl_state) +{ + PossibleCompletion* poss = NULL; + + cmpl_state->the_completion.text[0] = 0; + + if(cmpl_state->user_completion_index >= 0) + poss = attempt_homedir_completion(cmpl_state->last_completion_text, cmpl_state); + else + poss = attempt_file_completion(cmpl_state); + + update_cmpl(poss, cmpl_state); + + return poss; +} + +/**********************************************************************/ +/* Directory Operations */ +/**********************************************************************/ + +/* Open the directory where completion will begin from, if possible. */ +static CompletionDir* +open_ref_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash; + CompletionDir *new_dir; + + first_slash = strchr(text_to_complete, '/'); + + if (text_to_complete[0] == '~') + { + new_dir = open_user_dir(text_to_complete, cmpl_state); + + if(new_dir) + { + if(first_slash) + *remaining_text = first_slash + 1; + else + *remaining_text = text_to_complete + strlen(text_to_complete); + } + else + { + return NULL; + } + } + else if (text_to_complete[0] == '/' || !cmpl_state->reference_dir) + { + gchar *tmp = g_strdup(text_to_complete); + gchar *p; + + p = tmp; + while (*p && *p != '*' && *p != '?') + p++; + + *p = '\0'; + p = strrchr(tmp, '/'); + if (p) + { + if (p == tmp) + p++; + + *p = '\0'; + + new_dir = open_dir(tmp, cmpl_state); + + if(new_dir) + *remaining_text = text_to_complete + + ((p == tmp + 1) ? (p - tmp) : (p + 1 - tmp)); + } + else + { + /* If no possible candidates, use the cwd */ + gchar *curdir = g_get_current_dir (); + + new_dir = open_dir(curdir, cmpl_state); + + if (new_dir) + *remaining_text = text_to_complete; + + g_free (curdir); + } + + g_free (tmp); + } + else + { + *remaining_text = text_to_complete; + + new_dir = open_dir(cmpl_state->reference_dir->fullname, cmpl_state); + } + + if(new_dir) + { + new_dir->cmpl_index = -1; + new_dir->cmpl_parent = NULL; + } + + return new_dir; +} + +/* open a directory by user name */ +static CompletionDir* +open_user_dir(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gchar *first_slash; + gint cmp_len; + + g_assert(text_to_complete && text_to_complete[0] == '~'); + + first_slash = strchr(text_to_complete, '/'); + + if (first_slash) + cmp_len = first_slash - text_to_complete - 1; + else + cmp_len = strlen(text_to_complete + 1); + + if(!cmp_len) + { + /* ~/ */ + gchar *homedir = g_get_home_dir (); + + if (homedir) + return open_dir(homedir, cmpl_state); + else + return NULL; + } + else + { + /* ~user/ */ + char* copy = g_new(char, cmp_len + 1); + struct passwd *pwd; + strncpy(copy, text_to_complete + 1, cmp_len); + copy[cmp_len] = 0; + pwd = getpwnam(copy); + g_free(copy); + if (!pwd) + { + cmpl_errno = errno; + return NULL; + } + + return open_dir(pwd->pw_dir, cmpl_state); + } +} + +/* open a directory relative the the current relative directory */ +static CompletionDir* +open_relative_dir(gchar* dir_name, + CompletionDir* dir, + CompletionState *cmpl_state) +{ + gchar path_buf[2*MAXPATHLEN]; + + if(dir->fullname_len + strlen(dir_name) + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir->fullname); + + if(dir->fullname_len > 1) + { + path_buf[dir->fullname_len] = '/'; + strcpy(path_buf + dir->fullname_len + 1, dir_name); + } + else + { + strcpy(path_buf + dir->fullname_len, dir_name); + } + + return open_dir(path_buf, cmpl_state); +} + +/* after the cache lookup fails, really open a new directory */ +static CompletionDirSent* +open_new_dir(gchar* dir_name, struct stat* sbuf, gboolean stat_subdirs) +{ + CompletionDirSent* sent; + DIR* directory; + gchar *buffer_ptr; + struct dirent *dirent_ptr; + gint buffer_size = 0; + gint entry_count = 0; + gint i; + struct stat ent_sbuf; + char path_buf[MAXPATHLEN*2]; + gint path_buf_len; + + sent = g_new(CompletionDirSent, 1); + sent->mtime = sbuf->st_mtime; + sent->inode = sbuf->st_ino; + sent->device = sbuf->st_dev; + + path_buf_len = strlen(dir_name); + + if (path_buf_len > MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + return NULL; + } + + strcpy(path_buf, dir_name); + + directory = opendir(dir_name); + + if(!directory) + { + cmpl_errno = errno; + return NULL; + } + + while((dirent_ptr = readdir(directory)) != NULL) + { + int entry_len = strlen(dirent_ptr->d_name); + buffer_size += entry_len + 1; + entry_count += 1; + + if(path_buf_len + entry_len + 2 >= MAXPATHLEN) + { + cmpl_errno = CMPL_ERRNO_TOO_LONG; + closedir(directory); + return NULL; + } + } + + sent->name_buffer = g_new(gchar, buffer_size); + sent->entries = g_new(CompletionDirEntry, entry_count); + sent->entry_count = entry_count; + + buffer_ptr = sent->name_buffer; + + rewinddir(directory); + + for(i = 0; i < entry_count; i += 1) + { + dirent_ptr = readdir(directory); + + if(!dirent_ptr) + { + cmpl_errno = errno; + closedir(directory); + return NULL; + } + + strcpy(buffer_ptr, dirent_ptr->d_name); + sent->entries[i].entry_name = buffer_ptr; + buffer_ptr += strlen(dirent_ptr->d_name); + *buffer_ptr = 0; + buffer_ptr += 1; + + path_buf[path_buf_len] = '/'; + strcpy(path_buf + path_buf_len + 1, dirent_ptr->d_name); + + if (stat_subdirs) + { + if(stat(path_buf, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) + sent->entries[i].is_dir = 1; + else + /* stat may fail, and we don't mind, since it could be a + * dangling symlink. */ + sent->entries[i].is_dir = 0; + } + else + sent->entries[i].is_dir = 1; + } + + qsort(sent->entries, sent->entry_count, sizeof(CompletionDirEntry), compare_cmpl_dir); + + closedir(directory); + + return sent; +} + +static gboolean +check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) +{ + /* A list of directories that we know only contain other directories. + * Trying to stat every file in these directories would be very + * expensive. + */ + + static struct { + gchar *name; + gboolean present; + struct stat statbuf; + } no_stat_dirs[] = { + { "/afs", FALSE, { 0 } }, + { "/net", FALSE, { 0 } } + }; + + static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]); + static gboolean initialized = FALSE; + + gint i; + + if (!initialized) + { + initialized = TRUE; + for (i = 0; i < n_no_stat_dirs; i++) + { + if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) + no_stat_dirs[i].present = TRUE; + } + } + + if(stat(dir_name, result) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + *stat_subdirs = TRUE; + for (i=0; ist_dev) && + (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) + { + *stat_subdirs = FALSE; + break; + } + } + + return TRUE; +} + +/* open a directory by absolute pathname */ +static CompletionDir* +open_dir(gchar* dir_name, CompletionState* cmpl_state) +{ + struct stat sbuf; + gboolean stat_subdirs; + CompletionDirSent *sent; + GList* cdsl; + + if (!check_dir (dir_name, &sbuf, &stat_subdirs)) + return NULL; + + cdsl = cmpl_state->directory_sent_storage; + + while (cdsl) + { + sent = cdsl->data; + + if(sent->inode == sbuf.st_ino && + sent->mtime == sbuf.st_mtime && + sent->device == sbuf.st_dev) + return attach_dir(sent, dir_name, cmpl_state); + + cdsl = cdsl->next; + } + + sent = open_new_dir(dir_name, &sbuf, stat_subdirs); + + if (sent) { + cmpl_state->directory_sent_storage = + g_list_prepend(cmpl_state->directory_sent_storage, sent); + + return attach_dir(sent, dir_name, cmpl_state); + } + + return NULL; +} + +static CompletionDir* +attach_dir(CompletionDirSent* sent, gchar* dir_name, CompletionState *cmpl_state) +{ + CompletionDir* new_dir; + + new_dir = g_new(CompletionDir, 1); + + cmpl_state->directory_storage = + g_list_prepend(cmpl_state->directory_storage, new_dir); + + new_dir->sent = sent; + new_dir->fullname = g_strdup(dir_name); + new_dir->fullname_len = strlen(dir_name); + + return new_dir; +} + +static gint +correct_dir_fullname(CompletionDir* cmpl_dir) +{ + gint length = strlen(cmpl_dir->fullname); + struct stat sbuf; + + if (strcmp(cmpl_dir->fullname + length - 2, "/.") == 0) + { + if (length == 2) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } else { + cmpl_dir->fullname[length - 2] = 0; + } + } + else if (strcmp(cmpl_dir->fullname + length - 3, "/./") == 0) + cmpl_dir->fullname[length - 2] = 0; + else if (strcmp(cmpl_dir->fullname + length - 3, "/..") == 0) + { + if(length == 3) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 2] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + else if (strcmp(cmpl_dir->fullname + length - 4, "/../") == 0) + { + if(length == 4) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } + + if(stat(cmpl_dir->fullname, &sbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + cmpl_dir->fullname[length - 3] = 0; + + if(!correct_parent(cmpl_dir, &sbuf)) + return FALSE; + } + + cmpl_dir->fullname_len = strlen(cmpl_dir->fullname); + + return TRUE; +} + +static gint +correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf) +{ + struct stat parbuf; + gchar *last_slash; + gchar *new_name; + gchar c = 0; + + last_slash = strrchr(cmpl_dir->fullname, '/'); + + g_assert(last_slash); + + if(last_slash != cmpl_dir->fullname) + { /* last_slash[0] = 0; */ } + else + { + c = last_slash[1]; + last_slash[1] = 0; + } + + if (stat(cmpl_dir->fullname, &parbuf) < 0) + { + cmpl_errno = errno; + return FALSE; + } + + if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev) + /* it wasn't a link */ + return TRUE; + + if(c) + last_slash[1] = c; + /* else + last_slash[0] = '/'; */ + + /* it was a link, have to figure it out the hard way */ + + new_name = find_parent_dir_fullname(cmpl_dir->fullname); + + if (!new_name) + return FALSE; + + g_free(cmpl_dir->fullname); + + cmpl_dir->fullname = new_name; + + return TRUE; +} + +static gchar* +find_parent_dir_fullname(gchar* dirname) +{ + gchar buffer[MAXPATHLEN]; + gchar buffer2[MAXPATHLEN]; + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer)) +#else + if(!getcwd(buffer, MAXPATHLEN)) +#endif + { + cmpl_errno = errno; + return NULL; + } + + if(chdir(dirname) != 0 || chdir("..") != 0) + { + cmpl_errno = errno; + return NULL; + } + +#if defined(sun) && !defined(__SVR4) + if(!getwd(buffer2)) +#else + if(!getcwd(buffer2, MAXPATHLEN)) +#endif + { + chdir(buffer); + cmpl_errno = errno; + + return NULL; + } + + if(chdir(buffer) != 0) + { + cmpl_errno = errno; + return NULL; + } + + return g_strdup(buffer2); +} + +/**********************************************************************/ +/* Completion Operations */ +/**********************************************************************/ + +static PossibleCompletion* +attempt_homedir_completion(gchar* text_to_complete, + CompletionState *cmpl_state) +{ + gint index, length; + + if (!cmpl_state->user_dir_name_buffer && + !get_pwdb(cmpl_state)) + return NULL; + length = strlen(text_to_complete) - 1; + + cmpl_state->user_completion_index += 1; + + while(cmpl_state->user_completion_index < cmpl_state->user_directories_len) + { + index = first_diff_index(text_to_complete + 1, + cmpl_state->user_directories + [cmpl_state->user_completion_index].login); + + switch(index) + { + case PATTERN_MATCH: + break; + default: + if(cmpl_state->last_valid_char < (index + 1)) + cmpl_state->last_valid_char = index + 1; + cmpl_state->user_completion_index += 1; + continue; + } + + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + append_completion_text("~", cmpl_state); + + append_completion_text(cmpl_state-> + user_directories[cmpl_state->user_completion_index].login, + cmpl_state); + + return append_completion_text("/", cmpl_state); + } + + if(text_to_complete[1] || + cmpl_state->user_completion_index > cmpl_state->user_directories_len) + { + cmpl_state->user_completion_index = -1; + return NULL; + } + else + { + cmpl_state->user_completion_index += 1; + cmpl_state->the_completion.is_a_completion = 1; + cmpl_state->the_completion.is_directory = 1; + + return append_completion_text("~/", cmpl_state); + } +} + +/* returns the index (>= 0) of the first differing character, + * PATTERN_MATCH if the completion matches */ +static gint +first_diff_index(gchar* pat, gchar* text) +{ + gint diff = 0; + + while(*pat && *text && *text == *pat) + { + pat += 1; + text += 1; + diff += 1; + } + + if(*pat) + return diff; + + return PATTERN_MATCH; +} + +static PossibleCompletion* +append_completion_text(gchar* text, CompletionState* cmpl_state) +{ + gint len, i = 1; + + if(!cmpl_state->the_completion.text) + return NULL; + + len = strlen(text) + strlen(cmpl_state->the_completion.text) + 1; + + if(cmpl_state->the_completion.text_alloc > len) + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } + + while(i < len) { i <<= 1; } + + cmpl_state->the_completion.text_alloc = i; + + cmpl_state->the_completion.text = (gchar*)g_realloc(cmpl_state->the_completion.text, i); + + if(!cmpl_state->the_completion.text) + return NULL; + else + { + strcat(cmpl_state->the_completion.text, text); + return &cmpl_state->the_completion; + } +} + +static CompletionDir* +find_completion_dir(gchar* text_to_complete, + gchar** remaining_text, + CompletionState* cmpl_state) +{ + gchar* first_slash = strchr(text_to_complete, '/'); + CompletionDir* dir = cmpl_state->reference_dir; + CompletionDir* next; + *remaining_text = text_to_complete; + + while(first_slash) + { + gint len = first_slash - *remaining_text; + gint found = 0; + gchar *found_name = NULL; /* Quiet gcc */ + gint i; + gchar* pat_buf = g_new (gchar, len + 1); + + strncpy(pat_buf, *remaining_text, len); + pat_buf[len] = 0; + + for(i = 0; i < dir->sent->entry_count; i += 1) + { + if(dir->sent->entries[i].is_dir && + fnmatch(pat_buf, dir->sent->entries[i].entry_name, + FNMATCH_FLAGS)!= FNM_NOMATCH) + { + if(found) + { + g_free (pat_buf); + return dir; + } + else + { + found = 1; + found_name = dir->sent->entries[i].entry_name; + } + } + } + + if (!found) + { + /* Perhaps we are trying to open an automount directory */ + found_name = pat_buf; + } + + next = open_relative_dir(found_name, dir, cmpl_state); + + if(!next) + { + g_free (pat_buf); + return NULL; + } + + next->cmpl_parent = dir; + + dir = next; + + if(!correct_dir_fullname(dir)) + { + g_free(pat_buf); + return NULL; + } + + *remaining_text = first_slash + 1; + first_slash = strchr(*remaining_text, '/'); + + g_free (pat_buf); + } + + return dir; +} + +static void +update_cmpl(PossibleCompletion* poss, CompletionState* cmpl_state) +{ + gint cmpl_len; + + if(!poss || !cmpl_is_a_completion(poss)) + return; + + cmpl_len = strlen(cmpl_this_completion(poss)); + + if(cmpl_state->updated_text_alloc < cmpl_len + 1) + { + cmpl_state->updated_text = + (gchar*)g_realloc(cmpl_state->updated_text, + cmpl_state->updated_text_alloc); + cmpl_state->updated_text_alloc = 2*cmpl_len; + } + + if(cmpl_state->updated_text_len < 0) + { + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + cmpl_state->updated_text_len = cmpl_len; + cmpl_state->re_complete = cmpl_is_directory(poss); + } + else if(cmpl_state->updated_text_len == 0) + { + cmpl_state->re_complete = FALSE; + } + else + { + gint first_diff = + first_diff_index(cmpl_state->updated_text, + cmpl_this_completion(poss)); + + cmpl_state->re_complete = FALSE; + + if(first_diff == PATTERN_MATCH) + return; + + if(first_diff > cmpl_state->updated_text_len) + strcpy(cmpl_state->updated_text, cmpl_this_completion(poss)); + + cmpl_state->updated_text_len = first_diff; + cmpl_state->updated_text[first_diff] = 0; + } +} + +static PossibleCompletion* +attempt_file_completion(CompletionState *cmpl_state) +{ + gchar *pat_buf, *first_slash; + CompletionDir *dir = cmpl_state->active_completion_dir; + + dir->cmpl_index += 1; + + if(dir->cmpl_index == dir->sent->entry_count) + { + if(dir->cmpl_parent == NULL) + { + cmpl_state->active_completion_dir = NULL; + + return NULL; + } + else + { + cmpl_state->active_completion_dir = dir->cmpl_parent; + + return attempt_file_completion(cmpl_state); + } + } + + g_assert(dir->cmpl_text); + + first_slash = strchr(dir->cmpl_text, '/'); + + if(first_slash) + { + gint len = first_slash - dir->cmpl_text; + + pat_buf = g_new (gchar, len + 1); + strncpy(pat_buf, dir->cmpl_text, len); + pat_buf[len] = 0; + } + else + { + gint len = strlen(dir->cmpl_text); + + pat_buf = g_new (gchar, len + 2); + strcpy(pat_buf, dir->cmpl_text); + strcpy(pat_buf + len, "*"); + } + + if(first_slash) + { + if(dir->sent->entries[dir->cmpl_index].is_dir) + { + if(fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH) + { + CompletionDir* new_dir; + + new_dir = open_relative_dir(dir->sent->entries[dir->cmpl_index].entry_name, + dir, cmpl_state); + + if(!new_dir) + { + g_free (pat_buf); + return NULL; + } + + new_dir->cmpl_parent = dir; + + new_dir->cmpl_index = -1; + new_dir->cmpl_text = first_slash + 1; + + cmpl_state->active_completion_dir = new_dir; + + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + g_free (pat_buf); + return attempt_file_completion(cmpl_state); + } + } + else + { + if(dir->cmpl_parent != NULL) + { + append_completion_text(dir->fullname + + strlen(cmpl_state->completion_dir->fullname) + 1, + cmpl_state); + append_completion_text("/", cmpl_state); + } + + append_completion_text(dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); + + cmpl_state->the_completion.is_a_completion = + (fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, + FNMATCH_FLAGS) != FNM_NOMATCH); + + cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; + if(dir->sent->entries[dir->cmpl_index].is_dir) + append_completion_text("/", cmpl_state); + + g_free (pat_buf); + return &cmpl_state->the_completion; + } +} + + +static gint +get_pwdb(CompletionState* cmpl_state) +{ + struct passwd *pwd_ptr; + gchar* buf_ptr; + gint len = 0, i, count = 0; + + if(cmpl_state->user_dir_name_buffer) + return TRUE; + setpwent (); + + while ((pwd_ptr = getpwent()) != NULL) + { + len += strlen(pwd_ptr->pw_name); + len += strlen(pwd_ptr->pw_dir); + len += 2; + count += 1; + } + + setpwent (); + + cmpl_state->user_dir_name_buffer = g_new(gchar, len); + cmpl_state->user_directories = g_new(CompletionUserDir, count); + cmpl_state->user_directories_len = count; + + buf_ptr = cmpl_state->user_dir_name_buffer; + + for(i = 0; i < count; i += 1) + { + pwd_ptr = getpwent(); + if(!pwd_ptr) + { + cmpl_errno = errno; + goto error; + } + + strcpy(buf_ptr, pwd_ptr->pw_name); + cmpl_state->user_directories[i].login = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + strcpy(buf_ptr, pwd_ptr->pw_dir); + cmpl_state->user_directories[i].homedir = buf_ptr; + buf_ptr += strlen(buf_ptr); + buf_ptr += 1; + } + + qsort(cmpl_state->user_directories, + cmpl_state->user_directories_len, + sizeof(CompletionUserDir), + compare_user_dir); + + endpwent(); + + return TRUE; + +error: + + if(cmpl_state->user_dir_name_buffer) + g_free(cmpl_state->user_dir_name_buffer); + if(cmpl_state->user_directories) + g_free(cmpl_state->user_directories); + + cmpl_state->user_dir_name_buffer = NULL; + cmpl_state->user_directories = NULL; + + return FALSE; +} + +static gint +compare_user_dir(const void* a, const void* b) +{ + return strcmp((((CompletionUserDir*)a))->login, + (((CompletionUserDir*)b))->login); +} + +static gint +compare_cmpl_dir(const void* a, const void* b) +{ + return strcmp((((CompletionDirEntry*)a))->entry_name, + (((CompletionDirEntry*)b))->entry_name); +} + +static gint +cmpl_state_okay(CompletionState* cmpl_state) +{ + return cmpl_state && cmpl_state->reference_dir; +} + +static gchar* +cmpl_strerror(gint err) +{ + if(err == CMPL_ERRNO_TOO_LONG) + return "Name too long"; + else + return g_strerror (err); +} + + +/* Testing area */ +#ifdef TORRIE_DEBUG + +/* Get the selected filename and print it to the console */ +void file_ok_sel( GtkWidget *w, + GtkFileSelection *fs ) +{ + g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); +} + +void destroy( GtkWidget *widget, + gpointer data ) +{ + gtk_main_quit (); +} + +int main( int argc, + char *argv[] ) +{ + GtkWidget *filew; + + gtk_init (&argc, &argv); + + /* Create a new file selection widget */ + filew = gtk_file_selection_new ("Michael's Glorious File Selector"); +// gtk_file_selection_complete(GTK_FILE_SELECTION(filew),"bob"); + + + gtk_signal_connect (GTK_OBJECT (filew), "destroy", + (GtkSignalFunc) destroy, &filew); + /* Connect the ok_button to file_ok_sel function */ + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), + "clicked", (GtkSignalFunc) file_ok_sel, filew ); + + /* Connect the cancel_button to destroy the widget */ + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION + (filew)->cancel_button), + "clicked", (GtkSignalFunc) gtk_widget_destroy, + GTK_OBJECT (filew)); + + + gtk_widget_show(filew); + +/* + g_print("%d",gtk_file_selection_match_mask("mask.c","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m???.c")); + g_print("%d",gtk_file_selection_match_mask("mask.c","m??*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c*")); + g_print("%d",gtk_file_selection_match_mask("mask.cout","n*.c???")); + g_print("%d",gtk_file_selection_match_mask("mask.c","[mn]*")); + g_print("%d",gtk_file_selection_match_mask("COPYING","*.xpm")); +*/ + gtk_main (); + + return 0; +} +/* example-end */ +#endif diff --git a/radiant/gtkfilesel.h b/radiant/gtkfilesel.h new file mode 100644 index 00000000..098cf27d --- /dev/null +++ b/radiant/gtkfilesel.h @@ -0,0 +1,143 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_FILESEL_H__ +#define __GTK_FILESEL_H__ + + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) +#define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) +#define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) +#define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) +#define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) + + +typedef struct _GtkFileSelection GtkFileSelection; +typedef struct _GtkFileSelectionClass GtkFileSelectionClass; + +struct _GtkFileSelection +{ + GtkWindow window; + + GtkWidget *dir_list; + GtkWidget *file_list; + GtkWidget *selection_entry; + GtkWidget *selection_text; + GtkWidget *main_vbox; + GtkWidget *ok_button; + GtkWidget *cancel_button; + GtkWidget *help_button; + + /* These are not used. Just fillers in the class structure */ + GtkWidget *history_pulldown; + GtkWidget *history_menu; + GList *history_list; + /* ***************** */ + + GtkWidget *fileop_dialog; + GtkWidget *fileop_entry; + gchar *fileop_file; + gpointer cmpl_state; + + GtkWidget *fileop_c_dir; + GtkWidget *fileop_del_file; + GtkWidget *fileop_ren_file; + + GtkWidget *button_area; + GtkWidget *action_area; + + GtkWidget *history_combo; + GList *prev_history; + GList *next_history; + GtkWidget *mask_entry; + gchar *mask; + gchar *saved_entry; + +}; + +struct _GtkFileSelectionClass +{ + GtkWindowClass parent_class; +}; + + +GtkType gtk_file_selection_get_type (void); +GtkWidget* gtk_file_selection_new (const gchar *title); +void gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename); +gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); +void gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern); +void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); +void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GTK_FILESEL_H__ */ + + + + + + + + + + diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index f3175259..bf173199 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -32,78 +32,1478 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Small functions to help with GTK // -#include "gtkmisc.h" +#include -#include -#include +#if defined (__linux__) || defined (__APPLE__) +#include +#endif -#include "math/vector.h" -#include "os/path.h" +#include -#include "gtkutil/dialog.h" -#include "gtkutil/filechooser.h" -#include "gtkutil/menu.h" -#include "gtkutil/toolbar.h" -#include "commands.h" +#ifdef _WIN32 +#include +#define WIN32_LEAN_AND_MEAN +#include +#endif + + + +#ifdef _WIN32 +#include +#include +#define R_OK 04 +#endif +#include "stdafx.h" // ============================================================================= // Misc stuff -void command_connect_accelerator(const char* name) +// NOTE TTimo window position saving has always been tricky +// it doesn't work the same between win32 and linux .. see below that code is fairly different +// it's also very poorly done, the save calls are a bit randomly disctributed in the OnDestroy + +void save_window_pos (GtkWidget *wnd, window_position_t& pos) { - const Command& command = GlobalCommands_find(name); - GlobalShortcuts_register(name); - global_accel_group_connect(command.m_accelerator, command.m_callback); + if ((wnd == NULL) || (wnd->window == NULL)) + return; + + get_window_pos(wnd, &pos.x, &pos.y); + + pos.w = wnd->allocation.width; + pos.h = wnd->allocation.height; + +#ifdef DBG_WINDOWPOS + //Sys_Printf("save_window_pos 'Window %s'\n",buf); +#endif } -void command_disconnect_accelerator(const char* name) +#ifdef _WIN32 +void win32_get_window_pos(GtkWidget *widget, gint *x, gint *y) { - const Command& command = GlobalCommands_find(name); - global_accel_group_disconnect(command.m_accelerator, command.m_callback); + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=913 + if ( g_PrefsDlg.m_bStartOnPrimMon ) { + RECT rc; + POINT point; + HWND xwnd = (HWND)GDK_WINDOW_HWND (widget->window); + const GdkRectangle primaryMonitorRect = g_pParentWnd->GetPrimaryMonitorRect(); + + GetClientRect(xwnd,&rc); + point.x=rc.left; + point.y=rc.top; + ClientToScreen(xwnd,&point); + + *x=point.x; + *y=point.y; + + *x=max(*x,-widget->allocation.width+10); + *x=min(*x,primaryMonitorRect.width-10); + *y=max(*y,-widget->allocation.height+10); + *y=min(*y,primaryMonitorRect.height-10); + } else { + // this is the same as the unix version of get_window_pos + gdk_window_get_root_origin (widget->window, x, y); + } +#ifdef DBG_WINDOWPOS + Sys_Printf("win32_get_window_pos %p %d,%d\n",widget,*x,*y); +#endif +} +#endif + +void load_window_pos (GtkWidget *wnd, window_position_t& pos) +{ +#ifdef _WIN32 + const GdkRectangle primaryMonitorRect = g_pParentWnd->GetPrimaryMonitorRect(); + + if(pos.x < primaryMonitorRect.x + || pos.y < primaryMonitorRect.y + || pos.x > primaryMonitorRect.x + primaryMonitorRect.width + || pos.y > primaryMonitorRect.y + primaryMonitorRect.height) + gtk_window_set_position(GTK_WINDOW(wnd), GTK_WIN_POS_CENTER_ON_PARENT); +#else + // FIXME: not multihead safe + if(pos.x < 0 + || pos.y < 0 + || pos.x > gdk_screen_width () + || pos.y > gdk_screen_height ()) + gtk_window_set_position(GTK_WINDOW(wnd), GTK_WIN_POS_CENTER_ON_PARENT); +#endif + else + gtk_window_move(GTK_WINDOW(wnd), pos.x, pos.y); + + gtk_window_set_default_size (GTK_WINDOW (wnd), pos.w, pos.h); +#ifdef DBG_WINDOWPOS + Sys_Printf("load_window_pos %p 'Window,%s'\n",wnd,windowData); +#endif } -void toggle_add_accelerator(const char* name) +gint widget_delete_hide (GtkWidget *widget) { - const Toggle& toggle = GlobalToggles_find(name); - GlobalShortcuts_register(name); - global_accel_group_connect(toggle.m_command.m_accelerator, toggle.m_command.m_callback); + gtk_widget_hide (widget); + + return TRUE; } -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const char* commandName) + +// Thanks to Mercury, Fingolfin - ETG +int readLongLE(FILE *file, unsigned long *m_bytesRead, int *value) { - GlobalShortcuts_register(commandName); - const Toggle& toggle = GlobalToggles_find(commandName); - global_accel_group_connect(toggle.m_command.m_accelerator, toggle.m_command.m_callback); - return create_check_menu_item_with_mnemonic(menu, mnemonic, toggle); + byte buf[4]; + int len = fread(buf, 4, 1, file); + *m_bytesRead += 4; + if (len != 1) + return -1; + + *value = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; + return 0; } -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char *mnemonic, const char* commandName) +short readShortLE(FILE *file, unsigned long *m_bytesRead, short unsigned *value) { - GlobalShortcuts_register(commandName); - const Command& command = GlobalCommands_find(commandName); - global_accel_group_connect(command.m_accelerator, command.m_callback); - return create_menu_item_with_mnemonic(menu, mnemonic, command); + byte buf[2]; + int len = fread(buf, 2, 1, file); + *m_bytesRead += 2; + if (len != 1) + return -1; + + *value = buf[0] | buf[1] << 8; + return 0; } -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName) +unsigned char *load_bitmap_file (const char* filename, guint16 *width, guint16 *height) { - return toolbar_append_button(toolbar, description, icon, GlobalCommands_find(commandName)); + int bmWidth, bmHeight; + short unsigned bmPlanes, bmBitsPixel; + typedef struct { + unsigned char rgbBlue; + unsigned char rgbGreen; + unsigned char rgbRed; + unsigned char rgbReserved; + } RGBQUAD; + unsigned char m1,m2; + int sizeimage; + short unsigned res1,res2; + int filesize, pixoff; + int bmisize, compression; + int xscale, yscale; + int colors, impcol; + unsigned long m_bytesRead = 0; + unsigned char *imagebits = NULL; + FILE *fp; + + *width = *height = 0; + + fp = fopen(filename,"rb"); + if (fp == NULL) + { + return NULL; + } + + size_t rc; + rc = fread(&m1, 1, 1, fp); + m_bytesRead++; + if (rc == -1) + { + fclose(fp); + return NULL; + } + + rc = fread(&m2, 1, 1, fp); + m_bytesRead++; + if ((m1!='B') || (m2!='M')) + { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&filesize)) { + fclose(fp); + return NULL; + } + + if (readShortLE(fp,&m_bytesRead,&res1)) { + fclose(fp); + return NULL; + } + + if (readShortLE(fp,&m_bytesRead,&res2)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&pixoff)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&bmisize)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&bmWidth)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&bmHeight)) { + fclose(fp); + return NULL; + } + + if (readShortLE(fp,&m_bytesRead,&bmPlanes)) { + fclose(fp); + return NULL; + } + + if (readShortLE(fp,&m_bytesRead,&bmBitsPixel)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&compression)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&sizeimage)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&xscale)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&yscale)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&colors)) { + fclose(fp); + return NULL; + } + + if (readLongLE(fp,&m_bytesRead,&impcol)) { + fclose(fp); + return NULL; + } + + if (colors == 0) + colors = 1 << bmBitsPixel; + + RGBQUAD *colormap = NULL; + if (bmBitsPixel != 24) + { + colormap = new RGBQUAD[colors]; + if (colormap == NULL) + { + fclose(fp); + return NULL; + } + + int i; + for (i = 0; i < colors; i++) + { + unsigned char r ,g, b, dummy; + + rc = fread(&b, 1, 1, fp); + m_bytesRead++; + if (rc!=1) + { + delete [] colormap; + fclose(fp); + return NULL; + } + + rc = fread(&g, 1, 1, fp); + m_bytesRead++; + if (rc!=1) + { + delete [] colormap; + fclose(fp); + return NULL; + } + + rc = fread(&r, 1, 1, fp); + m_bytesRead++; + if (rc != 1) + { + delete [] colormap; + fclose(fp); + return NULL; + } + + rc = fread(&dummy, 1, 1, fp); + m_bytesRead++; + if (rc != 1) + { + delete [] colormap; + fclose(fp); + return NULL; + } + + colormap[i].rgbRed=r; + colormap[i].rgbGreen=g; + colormap[i].rgbBlue=b; + } + } + + if ((long)m_bytesRead > pixoff) + { + delete [] colormap; + fclose(fp); + return NULL; + } + + while ((long)m_bytesRead < pixoff) + { + char dummy; + fread(&dummy,1,1,fp); + m_bytesRead++; + } + + int w = bmWidth; + int h = bmHeight; + + // set the output params + imagebits = (unsigned char *)malloc(w * h * 3); + long row_size = w * 3; + + if (imagebits != NULL) + { + *width = w; + *height = h; + unsigned char *outbuf = imagebits; + long row = 0; + long rowOffset = 0; + + if (compression == 0) // BI_RGB + { + // read rows in reverse order + for (row = bmHeight - 1; row >= 0; row--) + { + // which row are we working on? + rowOffset = (long unsigned)row * row_size; + + if (bmBitsPixel == 24) + { + for (int col=0;col> bit_count) & mask; + + // lookup the color from the colormap - stuff it in our buffer + // swap red and blue + *(outbuf + rowOffset + col * 3 + 2) = colormap[pix].rgbBlue; + *(outbuf + rowOffset + col * 3 + 1) = colormap[pix].rgbGreen; + *(outbuf + rowOffset + col * 3 + 0) = colormap[pix].rgbRed; + } + + // read DWORD padding + while ((m_bytesRead - pixoff) & 3) + { + char dummy; + if (fread(&dummy,1,1,fp)!=1) + { + free(imagebits); + if (colormap) + delete [] colormap; + fclose(fp); + return NULL; + } + m_bytesRead++; + } + } + } + } + else + { + int i, x = 0; + unsigned char c, c1 = 0, *pp; + row = 0; + pp = outbuf + (bmHeight - 1) * bmWidth * 3; + + if (bmBitsPixel == 8) + { + while (row < bmHeight) + { + c = getc(fp); + + if (c) + { + // encoded mode + c1 = getc(fp); + for (i = 0; i < c; x++, i++) + { + *pp = colormap[c1].rgbRed; pp++; + *pp = colormap[c1].rgbGreen; pp++; + *pp = colormap[c1].rgbBlue; pp++; + } + } + else + { + // c==0x00, escape codes + c = getc(fp); + if (c == 0x00) // end of line + { + row++; + x = 0; + pp = outbuf + (bmHeight - row - 1) * bmWidth * 3; + } + else if (c == 0x01) + break; // end of pic + else if (c == 0x02) // delta + { + c = getc(fp); + x += c; + c = getc(fp); + row += c; + pp = outbuf + x*3 + (bmHeight - row - 1) * bmWidth * 3; + } + else // absolute mode + { + for (i = 0; i < c; x++, i++) + { + c1 = getc(fp); + *pp = colormap[c1].rgbRed; pp++; + *pp = colormap[c1].rgbGreen; pp++; + *pp = colormap[c1].rgbBlue; pp++; + } + + if (c & 1) + getc(fp); // odd length run: read an extra pad byte + } + } + } + } + else if (bmBitsPixel == 4) + { + while (row < bmHeight) + { + c = getc(fp); + + if (c) + { + // encoded mode + c1 = getc(fp); + for (i = 0; i < c; x++, i++) + { + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbRed; pp++; + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbGreen; pp++; + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbBlue; pp++; + } + } + else + { + // c==0x00, escape codes + c = getc(fp); + + if (c == 0x00) // end of line + { + row++; + x = 0; + pp = outbuf + (bmHeight - row - 1) * bmWidth * 3; + } + else if (c == 0x01) + break; // end of pic + else if (c == 0x02) // delta + { + c = getc(fp); + x += c; + c = getc(fp); + row += c; + pp = outbuf + x * 3 + (bmHeight - row - 1) * bmWidth * 3; + } + else // absolute mode + { + for (i = 0; i < c; x++, i++) + { + if ((i&1) == 0) + c1 = getc(fp); + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbRed; pp++; + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbGreen; pp++; + *pp = colormap[(i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f)].rgbBlue; pp++; + } + + if (((c & 3) == 1) || ((c & 3) == 2)) + getc(fp); // odd length run: read an extra pad byte + } + } + } + } + } + if (colormap) + delete [] colormap; + + fclose(fp); + } + return imagebits; } -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName) +void bmp_to_pixmap (const char* filename, GdkPixmap **pixmap, GdkBitmap **mask) { - return toolbar_append_toggle_button(toolbar, description, icon, GlobalToggles_find(commandName)); + guint16 width, height; + unsigned char *buf; + GdkWindow *window = gdk_get_default_root_window(); + GdkColormap *colormap; + GdkGC* gc = gdk_gc_new (window); + int i, j; + bool hasMask = false; + + *pixmap = *mask = NULL; + buf = load_bitmap_file (filename, &width, &height); + if (!buf) + return; + + colormap = gdk_drawable_get_colormap (window); + *pixmap = gdk_pixmap_new (window, width, height, -1); + + typedef struct + { + GdkColor c; + unsigned char *p; + } PAL; + + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + unsigned char *p = &buf[(i * width + j) * 3]; + PAL pe; + + pe.c.red = (gushort)(p[0] * 0xFF); + pe.c.green = (gushort)(p[1] * 0xFF); + pe.c.blue = (gushort)(p[2] * 0xFF); + gdk_colormap_alloc_color(colormap, &pe.c, FALSE, TRUE); + gdk_gc_set_foreground(gc, &pe.c); + gdk_draw_point(*pixmap, gc, j, i); + + if (p[0] == 0xFF && p[1] == 0x00 && p[2] == 0xFF) + hasMask = true; + } + } + + gdk_gc_unref (gc); + *mask = gdk_pixmap_new (window, width, height, 1); + gc = gdk_gc_new (*mask); + if (hasMask) + { + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + GdkColor mask_pattern; + + // pink is transparent + if ((buf[(i*width+j)*3] == 0xff) && + (buf[(i*width+j)*3+1] == 0x00) && + (buf[(i*width+j)*3+2] == 0xff)) + mask_pattern.pixel = 0; + else + mask_pattern.pixel = 1; + + gdk_gc_set_foreground (gc, &mask_pattern); + // possible Win32 Gtk bug here + //gdk_draw_point (*mask, gc, j, i); + gdk_draw_line (*mask, gc, j, i, j + 1, i); + } + } + } + else + { + GdkColor mask_pattern; + mask_pattern.pixel = 1; + gdk_gc_set_foreground (gc, &mask_pattern); + gdk_draw_rectangle (*mask, gc, 1, 0, 0, width, height); + } + gdk_gc_unref(gc); + free (buf); +} + +void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap, GdkBitmap **mask) +{ + CString str; + + str = g_strBitmapsPath; + str += filename; + + bmp_to_pixmap (str.GetBuffer (), gdkpixmap, mask); + if (*gdkpixmap == NULL) + { + printf("gdkpixmap was null\n"); + char *dummy[] = { "1 1 1 1", " c None", " " }; + printf("calling gdk_pixmap_create_from_xpm_d\n"); + *gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), mask, NULL, dummy); + } +} + +// this is the same as above but used by the plugins +// GdkPixmap **gdkpixmap, GdkBitmap **mask +bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **mask) +{ + CString str; + + str = g_strGameToolsPath; + str += g_strPluginsDir; + str += "bitmaps/"; + str += filename; + bmp_to_pixmap (str.GetBuffer (), (GdkPixmap **)gdkpixmap, (GdkBitmap **)mask); + + if (*gdkpixmap == NULL) + { + // look in the core plugins + str = g_strAppPath; + str += g_strPluginsDir; + str += "bitmaps/"; + str += filename; + bmp_to_pixmap (str.GetBuffer (), (GdkPixmap **)gdkpixmap, (GdkBitmap **)mask); + + if (*gdkpixmap == NULL) + { + + // look in core modules + str = g_strAppPath; + str += g_strModulesDir; + str += "bitmaps/"; + str += filename; + bmp_to_pixmap (str.GetBuffer (), (GdkPixmap **)gdkpixmap, (GdkBitmap **)mask); + + if (*gdkpixmap == NULL) + { + char *dummy[] = { "1 1 1 1", " c None", " " }; + *gdkpixmap = gdk_pixmap_create_from_xpm_d (gdk_get_default_root_window(), (GdkBitmap **)mask, NULL, dummy); + return false; + } + } + } + return true; +} + +// Load a xpm file and return a pixmap widget. +GtkWidget* new_pixmap (GtkWidget* widget, char* filename) +{ + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + GtkWidget *pixmap; + + load_pixmap (filename, widget, &gdkpixmap, &mask); + pixmap = gtk_pixmap_new (gdkpixmap, mask); + + gdk_drawable_unref (gdkpixmap); + gdk_drawable_unref (mask); + + return pixmap; +} + +// ============================================================================= +// Menu stuff + +GtkWidget* menu_separator (GtkWidget *menu) +{ + GtkWidget *menu_item = gtk_menu_item_new (); + gtk_menu_append (GTK_MENU (menu), menu_item); + gtk_widget_set_sensitive (menu_item, FALSE); + gtk_widget_show (menu_item); + return menu_item; +} + +GtkWidget* menu_tearoff (GtkWidget *menu) +{ + GtkWidget *menu_item = gtk_tearoff_menu_item_new (); + gtk_menu_append (GTK_MENU (menu), menu_item); +// gtk_widget_set_sensitive (menu_item, FALSE); -- controls whether menu is detachable + gtk_widget_show (menu_item); + return menu_item; +} + +GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, gchar *mnemonic) +{ + GtkWidget *item, *sub_menu; + + item = gtk_menu_item_new_with_mnemonic (mnemonic); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (bar), item); + + sub_menu = gtk_menu_new (); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), sub_menu); + + return sub_menu; +} + +extern void AddMenuItem (GtkWidget* menu, unsigned int id); + +GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id) +{ + GtkWidget *item; + + item = gtk_menu_item_new_with_mnemonic (mnemonic); + + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (func), GINT_TO_POINTER (id)); + + AddMenuItem (item, id); + return item; +} + +GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id, gboolean active) +{ + GtkWidget *item; + + item = gtk_check_menu_item_new_with_mnemonic(mnemonic); + + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), active); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (func), GINT_TO_POINTER (id)); + + AddMenuItem (item, id); + return item; +} + +GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, gchar *mnemonic, GtkSignalFunc func, int id, gboolean state) +{ + GtkWidget *item; + GSList *group = (GSList*)NULL; + + if (last != NULL) + group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (last)); + item = gtk_radio_menu_item_new_with_mnemonic (group, mnemonic); + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (item), state); + + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (func), GINT_TO_POINTER (id)); + + AddMenuItem (item, id); + return item; +} + +GtkWidget* create_menu_in_menu_with_mnemonic (GtkWidget *menu, const gchar *mnemonic) +{ + GtkWidget *item, *submenu; + + item = gtk_menu_item_new_with_mnemonic(mnemonic); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + + submenu = gtk_menu_new (); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu); + + return submenu; +} + +// ============================================================================= +// Message Boxes + +void dialog_button_callback( GtkWidget *widget, gpointer data ) { + GtkWidget *parent; + int *loop, *ret; + + parent = gtk_widget_get_toplevel( widget ); + loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" ); + ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" ); + + *loop = 0; + *ret = (int)data; +} + +gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + int *loop; + + gtk_widget_hide (widget); + loop = (int*)g_object_get_data (G_OBJECT (widget), "loop"); + *loop = 0; + + return TRUE; +} + +gint dialog_url_callback (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + OpenURL((const char *)g_object_get_data (G_OBJECT (widget), "URL")); + + return TRUE; +} + +int WINAPI gtk_MessageBox (void *parent, const char* lpText, const char* lpCaption, guint32 uType, const char* URL) +{ + GtkWidget *window, *w, *vbox, *hbox; + GtkAccelGroup *accel; + int mode = (uType & MB_TYPEMASK), ret, loop = 1; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_signal_connect (GTK_OBJECT (window), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + gtk_window_set_title (GTK_WINDOW (window), lpCaption); + gtk_container_border_width (GTK_CONTAINER (window), 10); + g_object_set_data (G_OBJECT (window), "loop", &loop); + g_object_set_data (G_OBJECT (window), "ret", &ret); + gtk_widget_realize (window); + + gtk_window_set_policy(GTK_WINDOW (window),FALSE,FALSE,TRUE); + + if (parent != NULL) + gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent)); + + accel = gtk_accel_group_new (); + gtk_window_add_accel_group (GTK_WINDOW (window), accel); + + vbox = gtk_vbox_new (FALSE, 10); + gtk_container_add (GTK_CONTAINER (window), vbox); + gtk_widget_show (vbox); + + w = gtk_label_new (lpText); + gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); + gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT); + gtk_widget_show (w); + + w = gtk_hseparator_new (); + gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2); + gtk_widget_show (w); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); + gtk_widget_show (hbox); + + if (mode == MB_OK) + { + w = gtk_button_new_with_label ("Ok"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_add_accelerator (w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); + gtk_widget_add_accelerator (w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + ret = IDOK; + } + else if (mode == MB_OKCANCEL) + { + w = gtk_button_new_with_label ("Ok"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_widget_add_accelerator (w, "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("Cancel"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_add_accelerator (w, "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); + gtk_widget_show (w); + ret = IDCANCEL; + } + else if (mode == MB_YESNOCANCEL) + { + w = gtk_button_new_with_label ("Yes"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("No"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("Cancel"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_widget_show (w); + ret = IDCANCEL; + } + else /* if (mode == MB_YESNO) */ + { + w = gtk_button_new_with_label ("Yes"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES)); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + + w = gtk_button_new_with_label ("No"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO)); + gtk_widget_show (w); + ret = IDNO; + } + + if (URL) + { + w = gtk_button_new_with_label ("Go to URL"); + gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (w), "clicked", + GTK_SIGNAL_FUNC (dialog_url_callback), NULL); + g_object_set_data (G_OBJECT (w), "URL", (void *)URL); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + gtk_widget_show (w); + } + + + gtk_widget_show (window); + gtk_grab_add (window); + + while (loop) + gtk_main_iteration (); + + gtk_grab_remove (window); + gtk_widget_destroy (window); + + return ret; } // ============================================================================= // File dialog -bool color_dialog (GtkWidget *parent, Vector3& color, const char* title) +// fenris #3078 WHENHELLISFROZENOVER + +//#define FILEDLG_DBG + +static void file_sel_callback (GtkWidget *widget, gpointer data) +{ + GtkWidget *parent; + int *loop; + bool *success; + + parent = gtk_widget_get_toplevel (widget); + loop = (int*)g_object_get_data (G_OBJECT (parent), "loop"); + success = (bool*)g_object_get_data (G_OBJECT (parent), "success"); + + if ((int)data == IDOK) + *success = true; + +#ifdef FILEDLG_DBG + else + Sys_Printf("file_sel_callback != IDOK\n"); +#endif + + *loop = 0; +} + +#ifdef _WIN32 +#include +static OPENFILENAME ofn; /* common dialog box structure */ +static char szDirName[MAX_PATH]; /* directory string */ +static char szFile[MAX_PATH]; /* filename string */ +static char szFileTitle[MAX_PATH]; /* file title string */ +static int i, cbString; /* integer count variables */ +static HANDLE hf; /* file handle */ +#else +static char szFile[QER_MAX_NAMELEN]; +#endif + +#define FILEDLG_CUSTOM_FILTER_LENGTH 64 +// to be used with the advanced file selector + +class CFileType : public IFileTypeList +{ + struct filetype_copy_t + { + void operator=(const filetype_t& other) + { + m_name = other.name; + m_pattern = other.pattern; + } + string_t m_name; + string_t m_pattern; + }; +public: + CFileType() + { + m_nTypes = 0; + m_pTypes = NULL; + m_strWin32Filters = NULL; + m_pstrGTKMasks = NULL; + } + + virtual ~CFileType() + { + delete[] m_pTypes; + DestroyWin32Filters(); + DestroyGTKMasks(); + } + + void addType(filetype_t type) + { + filetype_copy_t* newTypes = new filetype_copy_t [m_nTypes+1]; + if(m_nTypes > 0) + { + for(int i=0; igetTypeList(pattern, &typelist); + +#ifdef FILEDLG_DBG + Sys_Printf("file_dialog: open = %d title = %s path = %s\n", open, title, path); + if (pattern) + { + Sys_Printf("Patterns:\n"); + char** p = typelist.m_pstrGTKMasks; + while(*p!=NULL) + Sys_Printf("%s\n", *p++); + } + else + Sys_Printf("no patterns\n"); +#endif + +#ifdef _WIN32 + // win32 dialog stores the selected "save as type" extension in the second null-terminated string + char customfilter[FILEDLG_CUSTOM_FILTER_LENGTH]; + + if (g_PrefsDlg.m_bNativeGUI) + { +#ifdef FILEDLG_DBG + Sys_Printf("Doing win32 file dialog..."); +#endif + // do that the native way + /* Place the terminating null character in the szFile. */ + szFile[0] = '\0'; + customfilter[0] = customfilter[1] = customfilter[2] = '\0'; + + /* Set the members of the OPENFILENAME structure. */ + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = (HWND)GDK_WINDOW_HWND (g_pParentWnd->m_pWidget->window); + if (pattern) + { + ofn.nFilterIndex = 0; + ofn.lpstrFilter = typelist.m_strWin32Filters; + } + else ofn.nFilterIndex = 1; + ofn.lpstrCustomFilter = customfilter; + ofn.nMaxCustFilter = sizeof(customfilter); + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFileTitle = NULL; // we don't need to get the name of the file + if(path) + { + // szDirName: Radiant uses unix convention for paths internally + // Win32 (of course) and Gtk (who would have thought) expect the '\\' convention + // copy path, replacing dir separators as appropriate + for(r=path, w=szDirName; *r!='\0'; r++) + *w++ = (*r=='/') ? '\\' : *r; + // terminate string + *w = '\0'; + ofn.lpstrInitialDir = szDirName; + } + else ofn.lpstrInitialDir = NULL; + ofn.lpstrTitle = title; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + + /* Display the Open dialog box. */ + // it's open or close depending on 'open' parameter + if (open) + { + if (!GetOpenFileName(&ofn)) + return NULL; // canceled + } + else + { + if (!GetSaveFileName(&ofn)) + return NULL; // canceled + } + + if(pattern != NULL) + type = typelist.GetTypeForWin32Filter(customfilter+1); + +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + } + else + { +#endif + // do that the Gtk way + if (title == NULL) + title = open ? "Open File" : "Save File"; + +#ifdef FILEDLG_DBG + Sys_Printf("Doing Gtk file dialog:\nBuilding new_path.."); +#endif + // we expect an actual path below, if the path is NULL we might crash + if (!path || path[0] == '\0') + { +#ifdef _WIN32 + path = "C:\\"; +#elif defined (__linux__) || defined (__APPLE__) + path = "/"; +#else + path = "/"; +#endif + } + + // alloc new path with extra char for dir separator + new_path = new char[strlen(path)+1+1]; + // copy path, replacing dir separators as appropriate + for(r=path, w=new_path; *r!='\0'; r++) + *w++ = (*r=='/') ? G_DIR_SEPARATOR : *r; + // add dir separator to end of path if required + if(*(w-1) != G_DIR_SEPARATOR) *w++ = G_DIR_SEPARATOR; + // terminate string + *w = '\0'; + +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); + Sys_Printf("Calling gtk_file_selection_new with title: %s...", title); +#endif + + file_sel = gtk_file_selection_new (title); + +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); + Sys_Printf("Set the masks..."); +#endif + +#if 0 //!\todo Add masks to GtkFileSelection in gtk-2.0 + // set the masks + if (pattern) + { + gtk_file_selection_clear_masks (GTK_FILE_SELECTION (file_sel)); + gtk_file_selection_set_masks (GTK_FILE_SELECTION (file_sel), const_cast(typelist.m_pstrGTKMasks)); + } +#endif + +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->ok_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDOK)); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->cancel_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_signal_connect (GTK_OBJECT (file_sel), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (file_sel)); + + if (parent != NULL) + gtk_window_set_transient_for (GTK_WINDOW (file_sel), GTK_WINDOW (parent)); + +#ifdef FILEDLG_DBG + Sys_Printf("set_data..."); +#endif + bool success = false; + g_object_set_data (G_OBJECT (file_sel), "loop", &loop); + g_object_set_data (G_OBJECT (file_sel), "success", &success); +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + + if (!open) + { +#ifdef FILEDLG_DBG + Sys_Printf("set_data \"overwrite\" ..."); +#endif + g_object_set_data (G_OBJECT (file_sel), "overwrite", GINT_TO_POINTER (1)); +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + } + + if (new_path != NULL) + { +#ifdef FILEDLG_DBG + Sys_Printf("gtk_file_selection_set_filename... %p", file_sel); +#endif + gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_sel), new_path); + delete[] new_path; +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + } + + gtk_grab_add (file_sel); +#ifdef FILEDLG_DBG + Sys_Printf("gtk_widget_show... %p", file_sel); +#endif + gtk_widget_show (file_sel); +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + +#ifdef FILEDLG_DBG + Sys_Printf("gtk_main_iteration..."); +#endif + while (loop) + gtk_main_iteration (); + if(success) + { +#if 0 //!\todo Add masks to GtkFileSelection in gtk2 + if(pattern!=NULL) + type = typelist.GetTypeForGTKMask(GTK_FILE_SELECTION (file_sel)->mask); +#endif + strcpy(szFile, gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_sel))); + } +#ifdef FILEDLG_DBG + Sys_Printf("Done.\n"); +#endif + + gtk_grab_remove (file_sel); + gtk_widget_destroy (file_sel); +#ifdef _WIN32 + } +#endif + + // don't return an empty filename + if(szFile[0] == '\0') return NULL; + + // convert back to unix format + for(w=szFile; *w!='\0'; w++) + if(*w=='\\') + *w = '/'; + +#if defined(WIN32) + if (g_PrefsDlg.m_bNativeGUI) // filetype mask not supported in gtk dialog yet + { + // when saving, force an extension depending on filetype + /* \todo SPoG - file_dialog should return filetype information separately.. not force file extension.. */ + if(!open && pattern != NULL) + { + // last ext separator + w = strrchr(szFile, '.'); + // no extension + w = (w!=NULL) ? w : szFile+strlen(szFile); + strcpy(w, type.pattern+1); + } + } +#endif + + // prompt to overwrite existing files + if (!open) + if (access (szFile, R_OK) == 0) + if (gtk_MessageBox (parent, "File already exists.\nOverwrite?", "GtkRadiant", MB_YESNO) == IDNO) + return NULL; + +#ifdef FILEDLG_DBG + // ... let's use a static filename + Sys_Printf("filename: %p\n", szFile); +#endif + + return szFile; +} + +char* WINAPI dir_dialog (void *parent, const char* title, const char* path) +{ + GtkWidget* file_sel; + char* filename = (char*)NULL; + int loop = 1; + bool success = false; + + file_sel = gtk_file_selection_new (title); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->ok_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDOK)); + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->cancel_button), "clicked", + GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDCANCEL)); + gtk_signal_connect (GTK_OBJECT (file_sel), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (file_sel)); + + if (parent != NULL) + gtk_window_set_transient_for (GTK_WINDOW (file_sel), GTK_WINDOW (parent)); + + gtk_widget_hide (GTK_FILE_SELECTION (file_sel)->file_list->parent); + + g_object_set_data (G_OBJECT (file_sel), "loop", &loop); + g_object_set_data (G_OBJECT (file_sel), "success", &success); + + if (path != NULL) + gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_sel), path); + + gtk_grab_add (file_sel); + gtk_widget_show (file_sel); + + while (loop) + gtk_main_iteration (); + + filename = g_strdup(gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_sel))); + + gtk_grab_remove (file_sel); + gtk_widget_destroy (file_sel); + + return filename; +} + +bool WINAPI color_dialog (void *parent, float *color, const char* title) { GtkWidget* dlg; double clr[3]; - ModalDialog dialog; + int loop = 1, ret = IDCANCEL; clr[0] = color[0]; clr[1] = color[1]; @@ -111,54 +1511,98 @@ bool color_dialog (GtkWidget *parent, Vector3& color, const char* title) dlg = gtk_color_selection_dialog_new (title); gtk_color_selection_set_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), clr); - g_signal_connect(G_OBJECT(dlg), "delete_event", G_CALLBACK(dialog_delete_callback), &dialog); - g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(dlg)->ok_button), "clicked", G_CALLBACK(dialog_button_ok), &dialog); - g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(dlg)->cancel_button), "clicked", G_CALLBACK(dialog_button_cancel), &dialog); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", + GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); + gtk_signal_connect (GTK_OBJECT (dlg), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->ok_button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK)); + gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->cancel_button), "clicked", + GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL)); + g_object_set_data (G_OBJECT (dlg), "loop", &loop); + g_object_set_data (G_OBJECT (dlg), "ret", &ret); - if (parent != 0) + if (parent != NULL) gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (parent)); - bool ok = modal_dialog_show(GTK_WINDOW(dlg), dialog) == eIDOK; - if(ok) - { - GdkColor gdkcolor; - gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), &gdkcolor); - clr[0] = gdkcolor.red / 65535.0; - clr[1] = gdkcolor.green / 65535.0; - clr[2] = gdkcolor.blue / 65535.0; + gtk_widget_show (dlg); + gtk_grab_add (dlg); + while (loop) + gtk_main_iteration (); + + GdkColor gdkcolor; + gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), &gdkcolor); + clr[0] = gdkcolor.red / 65535.0; + clr[1] = gdkcolor.green / 65535.0; + clr[2] = gdkcolor.blue / 65535.0; + + gtk_grab_remove (dlg); + gtk_widget_destroy (dlg); + + if (ret == IDOK) + { color[0] = (float)clr[0]; color[1] = (float)clr[1]; color[2] = (float)clr[2]; + + return true; } - gtk_widget_destroy(dlg); - - return ok; + return false; } -void button_clicked_entry_browse_file(GtkWidget* widget, GtkEntry* entry) +void OpenURL(const char *url) { - const char *filename = file_dialog(gtk_widget_get_toplevel(widget), TRUE, "Choose File", gtk_entry_get_text(entry)); - - if(filename != 0) - { - gtk_entry_set_text(entry, filename); - } + // let's put a little comment + Sys_Printf("OpenURL: %s\n", url); +#ifdef __linux__ + // \todo FIXME: the way we open URLs on *nix should be improved. A script is good (see how I do on RTCW) + char command[2*PATH_MAX]; + snprintf( command, sizeof(command), "%s/openurl.sh \"%s\" &", g_strAppPath.GetBuffer(), url ); + if (system (command) != 0) + gtk_MessageBox (g_pParentWnd->m_pWidget, "Failed to launch Netscape!"); +#endif +#ifdef __APPLE__ + char command[2*PATH_MAX]; + snprintf (command, sizeof(command), + "open \"%s\" &", url, url); + if (system (command) != 0) + gtk_MessageBox (g_pParentWnd->m_pWidget, "Unable to launch browser!"); +#endif +#ifdef _WIN32 + ShellExecute( (HWND)GDK_WINDOW_HWND (g_pParentWnd->m_pWidget->window), "open", url, NULL, NULL, SW_SHOW ); +#endif } -void button_clicked_entry_browse_directory(GtkWidget* widget, GtkEntry* entry) +void CheckMenuSplitting (GtkWidget *&menu) { - const char* text = gtk_entry_get_text(entry); - char *dir = dir_dialog(gtk_widget_get_toplevel(widget), "Choose Directory", path_is_absolute(text) ? text : "" ); - - if(dir != 0) + GtkWidget *item,*menu2; + + GtkRequisition requisition; + gint screen_height; + + gtk_widget_size_request (GTK_WIDGET (menu), &requisition); + screen_height = gdk_screen_height (); + + if ((screen_height - requisition.height) < 20) { - gchar* converted = g_filename_to_utf8(dir, -1, 0, 0, 0); - gtk_entry_set_text(entry, converted); - g_free(dir); - g_free(converted); + menu2 = gtk_menu_new (); + + // move the last 2 items to a submenu (3 because of win32) + for (int i = 0; i < 3; i++) + { + item = GTK_WIDGET (g_list_last (gtk_container_children (GTK_CONTAINER (menu)))->data); + gtk_widget_ref (item); + gtk_container_remove (GTK_CONTAINER (menu), item); + gtk_menu_append (GTK_MENU (menu2), item); + gtk_widget_unref (item); + } + + item = gtk_menu_item_new_with_label ("--------"); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu2); + menu = menu2; } } - - diff --git a/radiant/gtkmisc.h b/radiant/gtkmisc.h index 4dbe3b6a..c8446d6f 100644 --- a/radiant/gtkmisc.h +++ b/radiant/gtkmisc.h @@ -28,48 +28,73 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_GTKMISC_H) -#define INCLUDED_GTKMISC_H +#ifndef _GTK_MISC_H_ +#define _GTK_MISC_H_ -#include +#ifdef _WIN32 -inline void process_gui() +void win32_get_window_pos(GtkWidget *widget, gint *x, gint *y); + +inline void get_window_pos(GtkWidget *wnd, int* x, int* y) { - while(gtk_events_pending()) - { - gtk_main_iteration(); - } + win32_get_window_pos(wnd, x, y); } -void command_connect_accelerator(const char* commandName); -void command_disconnect_accelerator(const char* commandName); -void toggle_add_accelerator(const char* commandName); +#else -typedef struct _GtkMenu GtkMenu; -typedef struct _GtkMenuItem GtkMenuItem; -typedef struct _GtkCheckMenuItem GtkCheckMenuItem; - -// this also sets up the shortcut using command_connect_accelerator -GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu *menu, const char *mnemonic, const char* commandName); -// this also sets up the shortcut using command_connect_accelerator -GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const char* commandName); - -typedef struct _GtkButton GtkButton; -typedef struct _GtkToggleButton GtkToggleButton; -typedef struct _GtkToolbar GtkToolbar; - -// this DOES NOT set up the shortcut using command_connect_accelerator -GtkButton* toolbar_append_button(GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName); -// this DOES NOT set up the shortcut using command_connect_accelerator -GtkToggleButton* toolbar_append_toggle_button(GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName); - - -template class BasicVector3; -typedef BasicVector3 Vector3; -bool color_dialog (GtkWidget *parent, Vector3& color, const char* title = "Choose Color"); - -typedef struct _GtkEntry GtkEntry; -void button_clicked_entry_browse_file(GtkWidget* widget, GtkEntry* entry); -void button_clicked_entry_browse_directory(GtkWidget* widget, GtkEntry* entry); +inline void get_window_pos(GtkWidget *wnd, int* x, int* y) +{ + gdk_window_get_root_origin (wnd->window, x, y); +} #endif + + +struct window_position_t +{ + int x, y, w, h; +}; + +void save_window_pos (GtkWidget *wnd, window_position_t& pos); +void load_window_pos (GtkWidget *wnd, window_position_t& pos); +gint widget_delete_hide (GtkWidget *widget); + +// GdkPixmap **gdkpixmap, GdkBitmap **mask +bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **mask); +void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap, GdkBitmap **mask); +GtkWidget* new_pixmap (GtkWidget* widget, char* filename); + +GtkWidget* menu_separator (GtkWidget *menu); +GtkWidget* menu_tearoff (GtkWidget *menu); +GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, char *mnemonic); +GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id); +GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id, gboolean active); +GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, gchar *mnemonic, GtkSignalFunc func, int id, gboolean state); +GtkWidget* create_menu_in_menu_with_mnemonic (GtkWidget *menu, const gchar *mnemonic); + + +/*! +\fn gtk_MessageBox +do various message boxes, IDOK .. IDNO +URL adds an optional 'go to URL' button +*/ +int WINAPI gtk_MessageBox (void *parent, const char* lpText, const char* lpCaption = "Radiant", guint32 uType = MB_OK, const char* URL = NULL); +// NOTE: the returned filename is allocated with g_malloc and MUST be freed with g_free (both for win32 and Gtk dialogs) +// GtkWidget *parent +const char* file_dialog (void *parent, gboolean open, const char* title, const char* path = (char*)NULL, const char* pattern = NULL); + +/*! +\fn dir_dialog, prompts for a directory +*/ +char* WINAPI dir_dialog (void *parent, const char* title = "Choose Directory", const char* path = (char*)NULL); +// GtkWidget *parent +bool WINAPI color_dialog (void *parent, float *color, const char* title = "Choose Color"); + +void dialog_button_callback (GtkWidget *widget, gpointer data); +gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data); + +void OpenURL(const char *url); + +void CheckMenuSplitting (GtkWidget *&menu); + +#endif // _GTK_MISC_H_ diff --git a/radiant/help.cpp b/radiant/help.cpp deleted file mode 100644 index 363b1f0a..00000000 --- a/radiant/help.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "help.h" - -#include "debugging/debugging.h" - -#include -#include - -#include "libxml/parser.h" -#include "generic/callback.h" -#include "gtkutil/menu.h" -#include "stream/stringstream.h" -#include "os/file.h" - -#include "url.h" -#include "preferences.h" -#include "mainframe.h" - -/*! -the urls to fire up in the game packs help menus -*/ -namespace -{ - std::list mHelpURLs; -} - -/*! -needed for hooking in Gtk+ -*/ -void HandleHelpCommand(CopiedString& str) -{ - OpenURL(str.c_str()); -} - -void process_xlink(const char* filename, const char *menu_name, const char *base_url, GtkMenu *menu) -{ - if(file_exists(filename)) - { - xmlDocPtr pDoc = xmlParseFile(filename); - if (pDoc) - { - globalOutputStream() << "Processing .xlink file '" << filename << "'\n"; - // create sub menu - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic(menu, menu_name); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - // start walking the nodes, find the 'links' one - xmlNodePtr pNode = pDoc->children; - while (pNode && strcmp((const char*)pNode->name, "links")) - pNode=pNode->next; - if (pNode) - { - pNode = pNode->children; - while(pNode) - { - if(!strcmp((const char*)pNode->name, "item")) - { - // process the URL - CopiedString url; - - xmlChar* prop = xmlGetProp(pNode, reinterpret_cast("url")); - ASSERT_NOTNULL(prop); - if(strstr(reinterpret_cast(prop), "http://")) - { - // complete URL - url = reinterpret_cast(prop); - } - else - { - // relative URL - StringOutputStream full(256); - full << base_url << reinterpret_cast(prop); - url = full.c_str(); - } - - mHelpURLs.push_back(url); - - xmlFree(prop); - - prop = xmlGetProp(pNode, reinterpret_cast("name")); - ASSERT_NOTNULL(prop); - create_menu_item_with_mnemonic(menu_in_menu, reinterpret_cast(prop), ReferenceCaller(mHelpURLs.back())); - xmlFree(prop); - } - pNode=pNode->next; - } - } - xmlFreeDoc(pDoc); - } - else - { - globalOutputStream() << "'" << filename << "' parse failed\n"; - } - } - else - { - globalOutputStream() << "'" << filename << "' not found\n"; - } -} - -void create_game_help_menu(GtkMenu *menu) -{ - StringOutputStream filename(256); - filename << AppPath_get() << "global.xlink"; - process_xlink(filename.c_str(), "General", AppPath_get(), menu); - -#if 1 - filename.clear(); - filename << g_pGameDescription->mGameToolsPath.c_str() << "game.xlink"; - process_xlink(filename.c_str(), g_pGameDescription->getRequiredKeyValue("name"), g_pGameDescription->mGameToolsPath.c_str(), menu); -#else - for(std::list::iterator iGame = g_GamesDialog.mGames.begin(); iGame != g_GamesDialog.mGames.end(); ++iGame) - { - filename.clear(); - filename << (*iGame)->mGameToolsPath.c_str() << "game.xlink"; - process_xlink(filename.c_str(), (*iGame)->getRequiredKeyValue("name"), (*iGame)->mGameToolsPath.c_str(), menu); - } -#endif -} - diff --git a/radiant/help.h b/radiant/help.h deleted file mode 100644 index 02c6b14c..00000000 --- a/radiant/help.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_HELP_H) -#define INCLUDED_HELP_H - -typedef struct _GtkMenu GtkMenu; -void create_game_help_menu(GtkMenu *menu); - -#endif diff --git a/radiant/image.cpp b/radiant/image.cpp deleted file mode 100644 index 7495db68..00000000 --- a/radiant/image.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "image.h" - -#include "modulesystem.h" -#include "iimage.h" -#include "ifilesystem.h" -#include "iarchive.h" - -#include "generic/reference.h" -#include "os/path.h" -#include "stream/stringstream.h" - - -typedef Modules<_QERPlugImageTable> ImageModules; -ImageModules& Textures_getImageModules(); - -/// \brief Returns a new image for the first file matching \p name in one of the available texture formats, or 0 if no file is found. -Image* QERApp_LoadImage(void* environment, const char* name) -{ - Image* image = 0; - class LoadImageVisitor : public ImageModules::Visitor - { - const char* m_name; - Image*& m_image; - public: - LoadImageVisitor(const char* name, Image*& image) - : m_name(name), m_image(image) - { - } - void visit(const char* name, const _QERPlugImageTable& table) const - { - if(m_image == 0) - { - StringOutputStream fullname(256); - fullname << m_name << '.' << name; - ArchiveFile* file = GlobalFileSystem().openFile(fullname.c_str()); - if(file != 0) - { - m_image = table.loadImage(*file); - file->release(); - } - } - } - }; - - Textures_getImageModules().foreachModule(LoadImageVisitor(name, image)); - - return image; -} - diff --git a/radiant/image.h b/radiant/image.h deleted file mode 100644 index 3607c071..00000000 --- a/radiant/image.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_IMAGE_H) -#define INCLUDED_IMAGE_H - -class Image; -Image* QERApp_LoadImage(void* environment, const char* name); - -#endif diff --git a/radiant/main.cpp b/radiant/main.cpp index a1e39bad..82fab216 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,78 +19,310 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/*! \mainpage GtkRadiant Documentation Index +#if defined (__linux__) || defined (__APPLE__) + #include + #include + #include + #ifdef __linux__ + #include + #endif + #include + #include + #include + #include + #include +#endif -\section intro_sec Introduction +#include +#include "stdafx.h" +#include +#include +#include -This documentation is generated from comments in the source code. +#include -\section links_sec Useful Links +#include "watchbsp.h" +#include "filters.h" -\link include/itextstream.h include/itextstream.h \endlink - Global output and error message streams, similar to std::cout and std::cerr. \n +bool g_bBuildList = false; +int g_argc; +char** g_argv; -FileInputStream - similar to std::ifstream (binary mode) \n -FileOutputStream - similar to std::ofstream (binary mode) \n -TextFileInputStream - similar to std::ifstream (text mode) \n -TextFileOutputStream - similar to std::ofstream (text mode) \n -StringOutputStream - similar to std::stringstream \n +// ============================================================================= +// Splash screen -\link string/string.h string/string.h \endlink - C-style string comparison and memory management. \n -\link os/path.h os/path.h \endlink - Path manipulation for radiant's standard path format \n -\link os/file.h os/file.h \endlink - OS file-system access. \n +// get rid of it when debugging +#if defined (_DEBUG) + #define SKIP_SPLASH +#endif -::CopiedString - automatic string memory management \n -Array - automatic array memory management \n -HashTable - generic hashtable, similar to std::hash_map \n +static GtkWidget *splash_screen; -\link math/vector.h math/vector.h \endlink - Vectors \n -\link math/matrix.h math/matrix.h \endlink - Matrices \n -\link math/quaternion.h math/quaternion.h \endlink - Quaternions \n -\link math/plane.h math/plane.h \endlink - Planes \n -\link math/aabb.h math/aabb.h \endlink - AABBs \n +// called based on a timer, or in particular cases when we don't want to keep it around +gint try_destroy_splash (gpointer data) +{ + if (splash_screen) + { + gtk_widget_destroy (splash_screen); + splash_screen = NULL; + } + return FALSE; +} -Callback MemberCaller FunctionCaller - callbacks similar to using boost::function with boost::bind \n -SmartPointer SmartReference - smart-pointer and smart-reference similar to Loki's SmartPtr \n +static void create_splash () +{ + GtkWidget *alert_frame, *alert_frame1, *pixmap; -\link generic/bitfield.h generic/bitfield.h \endlink - Type-safe bitfield \n -\link generic/enumeration.h generic/enumeration.h \endlink - Type-safe enumeration \n + splash_screen = gtk_window_new (GTK_WINDOW_POPUP); + gtk_window_position (GTK_WINDOW (splash_screen), GTK_WIN_POS_CENTER); + gtk_widget_realize (splash_screen); -DefaultAllocator - Memory allocation using new/delete, compliant with std::allocator interface \n + alert_frame1 = gtk_frame_new (NULL); + gtk_widget_show (alert_frame1); + gtk_container_add (GTK_CONTAINER (splash_screen), alert_frame1); + gtk_frame_set_shadow_type (GTK_FRAME (alert_frame1), GTK_SHADOW_OUT); -\link debugging/debugging.h debugging/debugging.h \endlink - Debugging macros \n + alert_frame = gtk_frame_new (NULL); + gtk_widget_show (alert_frame); + gtk_container_add (GTK_CONTAINER (alert_frame1), alert_frame); + gtk_frame_set_shadow_type (GTK_FRAME (alert_frame), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (alert_frame), 3); + + pixmap = gtk_preview_new (GTK_PREVIEW_COLOR); + gtk_widget_show (pixmap); + gtk_container_add (GTK_CONTAINER (alert_frame), pixmap); + + CString str; + guint16 width, height; + unsigned char *buf; + + str = g_strGameToolsPath; + str += "bitmaps/splash.bmp"; + + unsigned char* load_bitmap_file (const char* filename, guint16* width, guint16* height); + buf = load_bitmap_file (str.GetBuffer (), &width, &height); + + if (!buf) + { + str = g_strBitmapsPath; + str += "splash.bmp"; + + buf = load_bitmap_file (str.GetBuffer (), &width, &height); + } + + if (buf) + { + GtkPreview *preview = GTK_PREVIEW (pixmap); + gtk_preview_size (preview, width, height); + for (int y = 0; y < height; y++) + gtk_preview_draw_row (preview, buf+y*width*3, 0, y, width); + } + + gtk_widget_show_all (splash_screen); + + while (gtk_events_pending ()) + gtk_main_iteration (); +} + +// ============================================================================= +// Loki stuff + +#if defined (__linux__) || defined (__APPLE__) + +/* A short game name, could be used as argv[0] */ +static char game_name[100] = ""; + +/* The directory where the data files can be found (run directory) */ +static char datapath[PATH_MAX]; + +char *loki_gethomedir(void) +{ + char *home = NULL; + + home = getenv("HOME"); + if ( home == NULL ) + { + uid_t id = getuid(); + struct passwd *pwd; + + setpwent(); + while ( (pwd = getpwent()) != NULL ) + { + if ( pwd->pw_uid == id ) + { + home = pwd->pw_dir; + break; + } + } + endpwent(); + } + return home; +} + +/* Must be called BEFORE loki_initialize */ +void loki_setgamename(const char *n) +{ + strncpy(game_name, n, sizeof(game_name)); +} + + #ifdef __linux__ +/* Code to determine the mount point of a CD-ROM */ +int loki_getmountpoint(const char *device, char *mntpt, int max_size) +{ + char devpath[PATH_MAX], mntdevpath[PATH_MAX]; + FILE * mountfp; + struct mntent *mntent; + int mounted; + + /* Nothing to do with no device file */ + if ( device == NULL ) + { + *mntpt = '\0'; + return -1; + } + + /* Get the fully qualified path of the CD-ROM device */ + if ( realpath(device, devpath) == NULL ) + { + perror("realpath() on your CD-ROM failed"); + return(-1); + } + + /* Get the mount point */ + mounted = -1; + memset(mntpt, 0, max_size); + mountfp = setmntent( _PATH_MNTTAB, "r" ); + if ( mountfp != NULL ) + { + mounted = 0; + while ( (mntent = getmntent( mountfp )) != NULL ) + { + char *tmp, mntdev[1024]; + + strcpy(mntdev, mntent->mnt_fsname); + if ( strcmp(mntent->mnt_type, "supermount") == 0 ) + { + tmp = strstr(mntent->mnt_opts, "dev="); + if ( tmp ) + { + strcpy(mntdev, tmp+strlen("dev=")); + tmp = strchr(mntdev, ','); + if ( tmp ) + { + *tmp = '\0'; + } + } + } + if ( strncmp(mntdev, "/dev", 4) || + realpath(mntdev, mntdevpath) == NULL ) + { + continue; + } + if ( strcmp( mntdevpath, devpath ) == 0 ) + { + mounted = 1; + assert((int)strlen( mntent->mnt_dir ) < max_size); + strncpy( mntpt, mntent->mnt_dir, max_size-1); + mntpt[max_size-1] = '\0'; + break; + } + } + endmntent( mountfp ); + } + return(mounted); +} + #endif + +/* + This function gets the directory containing the running program. + argv0 - the 0'th argument to the program */ +// FIXME TTimo +// I don't understand this function. It looks like something cut from another piece of software +// we somehow get the g_strAppPath from it, but it's done through a weird scan across $PATH env. var. +// even worse, it doesn't behave the same in all cases .. works well when ran through gdb and borks when ran from a shell +void loki_initpaths(char *argv0) +{ + char temppath[PATH_MAX]; //, env[100]; + char *home; //, *ptr, *data_env; -#include "main.h" + home = loki_gethomedir(); + if ( home == NULL ) + { + home = "."; + } -#include "version.h" + if (*game_name == 0) /* Game name defaults to argv[0] */ + loki_setgamename(argv0); -#include "debugging/debugging.h" + strcpy(temppath, argv0); /* If this overflows, it's your own fault :) */ + if ( ! strrchr(temppath, '/') ) + { + char *path; + char *last; + int found; -#include "iundo.h" + found = 0; + path = getenv("PATH"); + do + { + /* Initialize our filename variable */ + temppath[0] = '\0'; -#include + /* Get next entry from path variable */ + last = strchr(path, ':'); + if ( ! last ) + last = path+strlen(path); -#include "cmdlib.h" -#include "os/file.h" -#include "os/path.h" -#include "stream/stringstream.h" -#include "stream/textfilestream.h" + /* Perform tilde expansion */ + if ( *path == '~' ) + { + strcpy(temppath, home); + ++path; + } -#include "gtkutil/messagebox.h" -#include "gtkutil/image.h" -#include "console.h" -#include "texwindow.h" -#include "map.h" -#include "mainframe.h" -#include "commands.h" -#include "preferences.h" -#include "environment.h" -#include "referencecache.h" -#include "stacktrace.h" + /* Fill in the rest of the filename */ + if ( last > (path+1) ) + { + strncat(temppath, path, (last-path)); + strcat(temppath, "/"); + } + strcat(temppath, "./"); + strcat(temppath, argv0); -void show_splash(); -void hide_splash(); + /* See if it exists, and update path */ + if ( access(temppath, X_OK) == 0 ) + { + ++found; + } + path = last+1; + + } while ( *last && !found ); + + } else + { + /* Increment argv0 to the basename */ + argv0 = strrchr(argv0, '/')+1; + } + + /* Now canonicalize it to a full pathname for the data path */ + if ( realpath(temppath, datapath) ) + { + /* There should always be '/' in the path */ + *(strrchr(datapath, '/')) = '\0'; + } +} + +char *loki_getdatapath(void) +{ + return(datapath); +} + +#endif + +// end of Loki stuff +// ============================================================================= void error_redirect (const gchar *domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { @@ -103,7 +335,7 @@ void error_redirect (const gchar *domain, GLogLevelFlags log_level, const gchar log_level = (GLogLevelFlags) (log_level & G_LOG_LEVEL_MASK); if (!message) - message = "(0) message"; + message = "(NULL) message"; if (domain) strcpy (buf, domain); @@ -182,225 +414,165 @@ void error_redirect (const gchar *domain, GLogLevelFlags log_level, const gchar strcat (buf, "\n"); printf ("%s\n", buf); - - ERROR_MESSAGE("GTK+ error: " << buf); + Sys_FPrintf (SYS_WRN, buf); + // TTimo NOTE: in some cases it may be handy to log only to the file +// Sys_FPrintf (SYS_NOCON, buf); } -#if defined (_DEBUG) && defined (WIN32) && defined (_MSC_VER) -#include "crtdbg.h" +int main( int argc, char* argv[] ) { + char *libgl, *ptr; + int i, j, k; + +#ifdef _WIN32 + libgl = "opengl32.dll"; #endif -void crt_init() -{ -#if defined (_DEBUG) && defined (WIN32) && defined (_MSC_VER) - _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); +#if defined (__linux__) + libgl = "libGL.so.1"; #endif -} -class Lock -{ - bool m_locked; -public: - Lock() : m_locked(false) - { - } - void lock() - { - m_locked = true; - } - void unlock() - { - m_locked = false; - } - bool locked() const - { - return m_locked; - } -}; +#ifdef __APPLE__ + libgl = "/usr/X11R6/lib/libGL.1.dylib"; +#endif -class ScopedLock -{ - Lock& m_lock; -public: - ScopedLock(Lock& lock) : m_lock(lock) - { - m_lock.lock(); +#if defined (__linux__) || defined (__APPLE__) + // Give away unnecessary root privileges. + // Important: must be done before calling gtk_init(). + char *loginname; + struct passwd *pw; + seteuid(getuid()); + if ( geteuid() == 0 && ( loginname = getlogin() ) != NULL && ( pw = getpwnam(loginname) ) != NULL ) { + setuid(pw->pw_uid); } - ~ScopedLock() - { - m_lock.unlock(); - } -}; +#endif -class LineLimitedTextOutputStream : public TextOutputStream -{ - TextOutputStream& outputStream; - std::size_t count; -public: - LineLimitedTextOutputStream(TextOutputStream& outputStream, std::size_t count) - : outputStream(outputStream), count(count) + gtk_disable_setlocale(); + + gtk_init(&argc, &argv); + + if ((ptr = getenv ("Q3R_LIBGL")) != NULL) + libgl = ptr; + + for (i = 1; i < argc; i++) { - } - std::size_t write(const char* buffer, std::size_t length) - { - if(count != 0) + char* param = argv[i]; + + if (param[0] == '-' && param[1] == '-') { - const char* p = buffer; - const char* end = buffer+length; - for(;;) + param += 2; + + if ((strcmp (param, "libgl") == 0) && (i != argc)) { - p = std::find(p, end, '\n'); - if(p == end) - { - break; - } - ++p; - if(--count == 0) - { - length = p - buffer; - break; - } + libgl = argv[i+1]; + argv[i] = argv[i+1] = NULL; + i++; + } else if (strcmp (param, "builddefs") == 0) + { + g_bBuildList = true; + argv[i] = NULL; } - outputStream.write(buffer, length); } - return length; } -}; -class PopupDebugMessageHandler : public DebugMessageHandler -{ - StringOutputStream m_buffer; - Lock m_lock; -public: - TextOutputStream& getOutputStream() + for (i = 1; i < argc; i++) { - if(!m_lock.locked()) + for (k = i; k < argc; k++) + if (argv[k] != NULL) + break; + + if (k > i) { - return m_buffer; + k -= i; + for (j = i + k; j < argc; j++) + argv[j-k] = argv[j]; + argc -= k; } - return globalErrorStream(); } - bool handleMessage() - { - getOutputStream() << "----------------\n"; - LineLimitedTextOutputStream outputStream(getOutputStream(), 24); - write_stack_trace(outputStream); - getOutputStream() << "----------------\n"; - globalErrorStream() << m_buffer.c_str(); - if(!m_lock.locked()) + + g_argc = argc; + g_argv = argv; + + g_strPluginsDir = "plugins/"; + g_strModulesDir = "modules/"; + +#ifdef _WIN32 + // get path to the editor + char* pBuffer = g_strAppPath.GetBufferSetLength(_MAX_PATH + 1); + GetModuleFileName(NULL, pBuffer, _MAX_PATH); + pBuffer[g_strAppPath.ReverseFind('\\') + 1] = '\0'; + QE_ConvertDOSToUnixName(pBuffer, pBuffer); + g_strAppPath.ReleaseBuffer(); + + g_strBitmapsPath = g_strAppPath; + g_strBitmapsPath += "bitmaps/"; + + CGameDialog::UpdateNetrun(false); // read the netrun configuration + + if ( CGameDialog::GetNetrun() ) { + // we have to find a per-user g_strTempPath + // this behaves the same as on Linux + g_strTempPath = getenv("USERPROFILE"); + if (!g_strTempPath.GetLength()) { - ScopedLock lock(m_lock); -#if defined _DEBUG - m_buffer << "Break into the debugger?\n"; - bool handled = gtk_MessageBox(0, m_buffer.c_str(), "Radiant - Runtime Error", eMB_YESNO, eMB_ICONERROR) == eIDNO; - m_buffer.clear(); - return handled; -#else - m_buffer << "Please report this error to the developers\n"; - gtk_MessageBox(0, m_buffer.c_str(), "Radiant - Runtime Error", eMB_OK, eMB_ICONERROR); - m_buffer.clear(); + CString msg; + msg = "Radiant is configured to run from a network installation.\n"; + msg += "I couldn't find the environement variable USERPROFILE\n"; + msg += "I'm going to use C:\\RadiantSettings. Please set USERPROFILE\n"; + gtk_MessageBox (NULL, msg, "Radiant - Network mode", MB_OK); + g_strTempPath = "C:\\"; + } + g_strTempPath += "\\RadiantSettings\\"; + Q_mkdir(g_strTempPath.GetBuffer(), 0755); + g_strTempPath += RADIANT_VERSION; + g_strTempPath += "\\"; + Q_mkdir(g_strTempPath.GetBuffer(), 0755); + } + else + { + // use the core path as temp (to save commandlist.txt, and do the .pid files) + g_strTempPath = g_strAppPath; + } + #endif - } - return true; - } -}; -typedef Static GlobalPopupDebugMessageHandler; +#if defined (__linux__) || defined (__APPLE__) + Str home; + home = g_get_home_dir (); + AddSlash (home); + home += ".radiant/"; + Q_mkdir (home.GetBuffer (), 0775); + home += RADIANT_VERSION; + Q_mkdir (home.GetBuffer (), 0775); + g_strTempPath = home.GetBuffer (); + AddSlash (g_strTempPath); -void streams_init() -{ - GlobalErrorStream::instance().setOutputStream(getSysPrintErrorStream()); - GlobalOutputStream::instance().setOutputStream(getSysPrintOutputStream()); -} + loki_initpaths(argv[0]); -void paths_init() -{ - const char* home = environment_get_home_path(); - Q_mkdir(home); + // NOTE: we build g_strAppPath with a '/' (or '\' on WIN32) + // it's a general convention in Radiant to have the slash at the end of directories + char real[PATH_MAX]; + realpath (loki_getdatapath(), real); + if (real[strlen(real)-1] != '/') + strcat(real, "/"); - { - StringOutputStream path(256); - path << home << RADIANT_VERSION << '/'; - g_strSettingsPath = path.c_str(); - } - - Q_mkdir(g_strSettingsPath.c_str()); - - g_strAppPath = environment_get_app_path(); + g_strAppPath = real; // radiant is installed in the parent dir of "tools/" // NOTE: this is not very easy for debugging // maybe add options to lookup in several places? // (for now I had to create symlinks) - { - StringOutputStream path(256); - path << g_strAppPath.c_str() << "bitmaps/"; - BitmapsPath_set(path.c_str()); - } - + g_strBitmapsPath = g_strAppPath; + g_strBitmapsPath += "bitmaps/"; + // we will set this right after the game selection is done g_strGameToolsPath = g_strAppPath; -} -bool check_version_file(const char* filename, const char* version) -{ - TextFileInputStream file(filename); - if(!file.failed()) - { - char buf[10]; - buf[file.read(buf, 9)] = '\0'; - - // chomp it (the hard way) - int chomp = 0; - while(buf[chomp] >= '0' && buf[chomp] <= '9') - chomp++; - buf[chomp] = '\0'; - - return string_equal(buf, version); - } - return false; -} - -bool check_version() -{ - // a safe check to avoid people running broken installations - // (otherwise, they run it, crash it, and blame us for not forcing them hard enough to pay attention while installing) - // make something idiot proof and someone will make better idiots, this may be overkill - // let's leave it disabled in debug mode in any case - // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431 -#ifndef _DEBUG -#define CHECK_VERSION #endif -#ifdef CHECK_VERSION - // locate and open RADIANT_MAJOR and RADIANT_MINOR - bool bVerIsGood = true; - { - StringOutputStream ver_file_name(256); - ver_file_name << AppPath_get() << "RADIANT_MAJOR"; - bVerIsGood = check_version_file(ver_file_name.c_str(), RADIANT_MAJOR_VERSION); - } - { - StringOutputStream ver_file_name(256); - ver_file_name << AppPath_get() << "RADIANT_MINOR"; - bVerIsGood = check_version_file(ver_file_name.c_str(), RADIANT_MINOR_VERSION); - } - if (!bVerIsGood) - { - StringOutputStream msg(256); - msg << "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n" - "Make sure you run the right/latest editor binary you installed\n" - << AppPath_get(); - gtk_MessageBox(0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONDEFAULT); - } - return bVerIsGood; -#else - return true; -#endif -} + // init the DTD path + g_strDTDPath = g_strAppPath; + g_strDTDPath += "dtds/"; -void create_global_pid() -{ /*! the global prefs loading / game selection dialog might fail for any reason we don't know about we need to catch when it happens, to cleanup the stateful prefs which might be killing it @@ -408,249 +580,644 @@ void create_global_pid() this is the first part of the two step .pid system http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 */ - StringOutputStream g_pidFile(256); ///< the global .pid file (only for global part of the startup) - - g_pidFile << SettingsPath_get() << "radiant.pid"; + g_pidFile = g_strTempPath.GetBuffer (); + g_pidFile += "radiant.pid"; FILE *pid; - pid = fopen (g_pidFile.c_str(), "r"); - if (pid != 0) - { + pid = fopen( g_pidFile.GetBuffer(), "r" ); + if ( pid != NULL ) { fclose (pid); + CString msg; - if (remove (g_pidFile.c_str()) == -1) + if (remove (g_pidFile.GetBuffer ()) == -1) { - StringOutputStream msg(256); - msg << "WARNING: Could not delete " << g_pidFile.c_str(); - gtk_MessageBox (0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONERROR ); + msg = "WARNING: Could not delete "; msg += g_pidFile; + gtk_MessageBox (NULL, msg, "Radiant", MB_OK | MB_ICONERROR ); } // in debug, never prompt to clean registry, turn console logging auto after a failed start #if !defined(_DEBUG) - StringOutputStream msg(256); - msg << "Radiant failed to start properly the last time it was run.\n" - "The failure may be related to current global preferences.\n" - "Do you want to reset global preferences to defaults?"; + msg = "Found the file "; + msg += g_pidFile; + msg += ".\nThis indicates that Radiant failed during the game selection startup last time it was run.\n" + "Choose YES to clean Radiant's registry settings and shut down Radiant.\n" + "WARNING: the global prefs will be lost if you choose YES."; - if (gtk_MessageBox (0, msg.c_str(), "Radiant - Startup Failure", eMB_YESNO, eMB_ICONQUESTION) == eIDYES) + if (gtk_MessageBox (NULL, msg, "Radiant - Reset global startup?", MB_YESNO | MB_ICONQUESTION) == IDYES) { - g_GamesDialog.Reset(); + // remove global prefs and shutdown + g_PrefsDlg.mGamesDialog.Reset(); + // remove the prefs file (like a full reset of the registry) + //remove (g_PrefsDlg.m_inipath->str); + gtk_MessageBox(NULL, "Removed global settings, choose OK to close Radiant.", "Radiant", MB_OK ); + _exit(-1); } + msg = "Logging console output to "; + msg += g_strTempPath; + msg += "radiant.log\nRefer to the log if Radiant fails to start again."; - msg.clear(); - msg << "Logging console output to " << SettingsPath_get() << "radiant.log\nRefer to the log if Radiant fails to start again."; - - gtk_MessageBox (0, msg.c_str(), "Radiant - Console Log", eMB_OK); + gtk_MessageBox (NULL, msg, "Radiant - Console Log", MB_OK); #endif // set without saving, the class is not in a coherent state yet // just do the value change and call to start logging, CGamesDialog will pickup when relevant - g_GamesDialog.m_bForceLogConsole = true; - Sys_LogFile(true); + g_PrefsDlg.mGamesDialog.m_bLogConsole = true; + g_PrefsDlg.mGamesDialog.m_bForceLogConsole = true; + Sys_LogFile(); } // create a primary .pid for global init run - pid = fopen (g_pidFile.c_str(), "w"); - if (pid) - fclose (pid); -} - -void remove_global_pid() -{ - StringOutputStream g_pidFile(256); - g_pidFile << SettingsPath_get() << "radiant.pid"; + pid = fopen( g_pidFile.GetBuffer(), "w" ); + if ( pid ) { + fclose( pid ); + } + + // a safe check to avoid people running broken installations + // (otherwise, they run it, crash it, and blame us for not forcing them hard enough to pay attention while installing) + // make something idiot proof and someone will make better idiots, this may be overkill + // let's leave it disabled in debug mode in any case + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=431 +#ifndef _DEBUG + //#define CHECK_VERSION +#endif +#ifdef CHECK_VERSION + // locate and open RADIANT_MAJOR and RADIANT_MINOR + qboolean bVerIsGood = true; + Str ver_file_name; + ver_file_name = g_strAppPath; + ver_file_name += "RADIANT_MAJOR"; + FILE *ver_file = fopen (ver_file_name.GetBuffer(), "r"); + if (ver_file) + { + char buf[10]; + int chomp; + fread(buf, 1, 10, ver_file); + // chomp it (the hard way) + chomp = 0; + while(buf[chomp] >= '0' && buf[chomp] <= '9') + chomp++; + buf[chomp] = '\0'; + if (strcmp(buf, RADIANT_MAJOR_VERSION)) + { + Sys_Printf("ERROR: file RADIANT_MAJOR doesn't match ('%s')\n", buf); + bVerIsGood = false; + } + } + else + { + Sys_Printf("ERROR: can't find RADIANT_MAJOR in '%s'\n", ver_file_name.GetBuffer()); + bVerIsGood = false; + } + ver_file_name = g_strAppPath; + ver_file_name += "RADIANT_MINOR"; + ver_file = fopen (ver_file_name.GetBuffer(), "r"); + if (ver_file) + { + char buf[10]; + int chomp; + fread(buf, 1, 10, ver_file); + // chomp it (the hard way) + chomp = 0; + while(buf[chomp] >= '0' && buf[chomp] <= '9') + chomp++; + buf[chomp] = '\0'; + if (strcmp(buf, RADIANT_MINOR_VERSION)) + { + Sys_Printf("ERROR: file RADIANT_MINOR doesn't match ('%s')\n", buf); + bVerIsGood = false; + } + } + else + { + Sys_Printf("ERROR: can't find RADIANT_MINOR in '%s'\n", ver_file_name.GetBuffer()); + bVerIsGood = false; + } + if (!bVerIsGood) + { + CString msg; + msg = "This editor binary (" RADIANT_VERSION ") doesn't match what the latest setup has configured in this directory\n"; + msg += "Make sure you run the right/latest editor binary you installed\n"; + msg += g_strAppPath; msg += "\n"; + msg += "Check http://www.qeradiant.com/faq/index.cgi?file=219 for more information"; + gtk_MessageBox(NULL, msg.GetBuffer(), "Radiant", MB_OK, "http://www.qeradiant.com/faq/index.cgi?file=219"); + _exit(-1); + } +#endif + + g_qeglobals.disable_ini = false; + g_PrefsDlg.Init(); // close the primary - if (remove (g_pidFile.c_str()) == -1) - { - StringOutputStream msg(256); - msg << "WARNING: Could not delete " << g_pidFile.c_str(); - gtk_MessageBox (0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONERROR ); + if ( remove( g_pidFile.GetBuffer () ) == -1 ) { + CString msg; + msg = "WARNING: Could not delete "; msg += g_pidGameFile; + gtk_MessageBox (NULL, msg, "Radiant", MB_OK | MB_ICONERROR ); } -} + + /*! + now the secondary game dependant .pid file + http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 + */ + g_pidGameFile = g_PrefsDlg.m_rc_path->str; + g_pidGameFile += "radiant-game.pid"; -/*! -now the secondary game dependant .pid file -http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 -*/ -void create_local_pid() -{ - StringOutputStream g_pidGameFile(256); ///< the game-specific .pid file - g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/radiant-game.pid"; - - FILE *pid = fopen (g_pidGameFile.c_str(), "r"); - if (pid != 0) + pid = fopen (g_pidGameFile.GetBuffer(), "r"); + if (pid != NULL) { fclose (pid); - if (remove (g_pidGameFile.c_str()) == -1) + CString msg; + if (remove (g_pidGameFile.GetBuffer ()) == -1) { - StringOutputStream msg; - msg << "WARNING: Could not delete " << g_pidGameFile.c_str(); - gtk_MessageBox (0, msg.c_str(), "Radiant", eMB_OK, eMB_ICONERROR ); + msg = "WARNING: Could not delete "; msg += g_pidGameFile; + gtk_MessageBox (NULL, msg, "Radiant", MB_OK | MB_ICONERROR ); } + msg = "Found the file "; + msg += g_pidGameFile; + msg += ".\nThis indicates that Radiant failed to load the last time it was run.\n" + "Choose YES to clean Radiant's registry settings and shut down Radiant.\n" + "WARNING: preferences will be lost if you choose YES."; + // in debug, never prompt to clean registry, turn console logging auto after a failed start #if !defined(_DEBUG) - StringOutputStream msg; - msg << "Radiant failed to start properly the last time it was run.\n" - "The failure may be caused by current preferences.\n" - "Do you want to reset all preferences to defaults?"; - - if (gtk_MessageBox (0, msg.c_str(), "Radiant - Startup Failure", eMB_YESNO, eMB_ICONQUESTION) == eIDYES) + //bleh + if (gtk_MessageBox (NULL, msg, "Radiant - Clean Registry?", MB_YESNO | MB_ICONQUESTION) == IDYES) { - Preferences_Reset(); + // remove the game prefs files + remove (g_PrefsDlg.m_inipath->str); + char buf[PATH_MAX]; + sprintf(buf, "%sSavedInfo.bin", g_PrefsDlg.m_rc_path->str); + remove(buf); + // remove the global pref too + g_PrefsDlg.mGamesDialog.Reset(); + gtk_MessageBox(NULL, "Cleaned registry settings, choose OK to close Radiant.\nThe next time Radiant runs it will use default settings.", "Radiant", MB_OK ); + _exit(-1); } + msg = "Logging console output to "; + msg += g_strTempPath; + msg += "radiant.log\nRefer to the log if Radiant fails to start again."; - msg.clear(); - msg << "Logging console output to " << SettingsPath_get() << "radiant.log\nRefer to the log if Radiant fails to start again."; - - gtk_MessageBox (0, msg.c_str(), "Radiant - Console Log", eMB_OK); + gtk_MessageBox (NULL, msg, "Radiant - Console Log", MB_OK); #endif // force console logging on! (will go in prefs too) - g_GamesDialog.m_bForceLogConsole = true; - Sys_LogFile(true); - } - else + g_PrefsDlg.mGamesDialog.m_bLogConsole = true; + g_PrefsDlg.mGamesDialog.SavePrefs(); + Sys_LogFile(); + + g_PrefsDlg.LoadPrefs(); + + } else { // create one, will remove right after entering message loop - pid = fopen (g_pidGameFile.c_str(), "w"); + pid = fopen (g_pidGameFile.GetBuffer(), "w"); if (pid) fclose (pid); + + g_PrefsDlg.LoadPrefs(); + +#ifndef _DEBUG // I can't be arsed about that prompt in debug mode + // if console logging is on in the prefs, warn about performance hit + if (g_PrefsDlg.mGamesDialog.m_bLogConsole) + { + if (gtk_MessageBox (NULL, "Preferences indicate that console logging is on. This affects performance.\n" + "Turn it off?", "Radiant", MB_YESNO | MB_ICONQUESTION) == IDYES) + { + g_PrefsDlg.mGamesDialog.m_bLogConsole = false; + g_PrefsDlg.mGamesDialog.SavePrefs(); + } + } +#endif + // toggle console logging if necessary + Sys_LogFile(); } -} - -/*! -now the secondary game dependant .pid file -http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 -*/ -void remove_local_pid() -{ - StringOutputStream g_pidGameFile(256); - g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/radiant-game.pid"; - remove(g_pidGameFile.c_str()); -} - -void user_shortcuts_init() -{ - StringOutputStream path(256); - path << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << '/'; - LoadCommandMap(path.c_str()); - SaveCommandMap(path.c_str()); -} - -int main (int argc, char* argv[]) -{ - crt_init(); - - streams_init(); - - gtk_disable_setlocale(); - gtk_init(&argc, &argv); - - // redirect Gtk warnings to the console - g_log_set_handler ("Gdk", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| - G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, 0); - g_log_set_handler ("Gtk", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| - G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, 0); - g_log_set_handler ("GtkGLExt", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| - G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, 0); - g_log_set_handler ("GLib", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| - G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, 0); - g_log_set_handler (0, (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| - G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, 0); - - GlobalDebugMessageHandler::instance().setHandler(GlobalPopupDebugMessageHandler::instance()); - - environment_init(argc, argv); - - paths_init(); - - if(!check_version()) + // FIXME http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=639 + // we should search in g_strTempPath, then move over to look at g_strAppPath? +#ifdef _WIN32 + // fine tune the look of the app using a gtk rc file + // we try to load an RC file placed in the application directory + // build the full path + Str sRCFile; + sRCFile = g_strAppPath; + sRCFile += "radiantgtkrc"; + // we load that file with g_new in gtk_rc_parse_file (gtkrc.c), change the '/' into '\\' + pBuffer = (char *)sRCFile.GetBuffer(); + for (i=0; imGameToolsPath; - - remove_global_pid(); - - g_Preferences.Init(); // must occur before create_local_pid() to allow preferences to be reset - - create_local_pid(); - - // in a very particular post-.pid startup - // we may have the console turned on and want to keep it that way - // so we use a latching system - if (g_GamesDialog.m_bForceLogConsole) - { - Sys_LogFile(true); - g_Console_enableLogging = true; - g_GamesDialog.m_bForceLogConsole = false; - } - - - Radiant_Initialise(); - - global_accel_init(); - - user_shortcuts_init(); - - g_pParentWnd = 0; - g_pParentWnd = new MainFrame(); - - hide_splash(); - - if (g_bLoadLastMap && !g_strLastMap.empty()) - { - Map_LoadFile(g_strLastMap.c_str()); + if (pBuffer[i]=='/') + { + pBuffer[i] = '\\'; + } } + // check the file exists + if (access(sRCFile.GetBuffer(), R_OK) != 0) + Sys_Printf("RC file %s not found\n", sRCFile.GetBuffer()); else { - Map_New(); + Sys_Printf ("Attemping to load RC file %s\n", sRCFile.GetBuffer()); + gtk_rc_parse (sRCFile.GetBuffer()); + } +#endif + +#ifndef SKIP_SPLASH + create_splash(); +#endif + + if (!QGL_Init(libgl, "")) + { + Sys_FPrintf (SYS_ERR, "Failed to load OpenGL libraries\n"); + _exit (1); + return 1; + } + +#if defined (__linux__) || defined (__APPLE__) + if ((qglXQueryExtension == NULL) || (qglXQueryExtension(GDK_DISPLAY(),NULL,NULL) != True)) + { + Sys_FPrintf (SYS_ERR, "glXQueryExtension failed\n"); + _exit (1); + return 1; + } +#endif + + // redirect Gtk warnings to the console + g_log_set_handler( "Gdk", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| + G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, NULL); + g_log_set_handler( "Gtk", (GLogLevelFlags)(G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING| + G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG), error_redirect, NULL); + + // spog - creates new filters list for the first time + g_qeglobals.d_savedinfo.filters = NULL; + g_qeglobals.d_savedinfo.filters = FilterUpdate(g_qeglobals.d_savedinfo.filters); + + g_pParentWnd = new MainFrame(); + + if ( g_PrefsDlg.m_bLoadLastMap && g_PrefsDlg.m_strLastMap.GetLength() > 0 ) { + Map_LoadFile(g_PrefsDlg.m_strLastMap.GetBuffer()); + } else { + Map_New(); } // load up shaders now that we have the map loaded // eviltypeguy - TextureBrowser_ShowStartupShaders(GlobalTextureBrowser()); + Texture_ShowStartupShaders(); +#ifndef SKIP_SPLASH + gdk_window_raise(splash_screen->window); + gtk_window_set_transient_for( GTK_WINDOW( splash_screen ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); + gtk_timeout_add( 1000, try_destroy_splash, NULL ); +#endif + + g_pParentWnd->GetSynapseServer().DumpActiveClients(); - remove_local_pid(); + //++timo: temporary debug + g_pParentWnd->DoWatchBSP(); gtk_main(); - // avoid saving prefs when the app is minimized - if (g_pParentWnd->IsSleeping()) - { - globalOutputStream() << "Shutdown while sleeping, not saving prefs\n"; - g_preferences_globals.disable_ini = true; - } - - Map_Free(); - - if (!Map_Unnamed(g_map)) - { - g_strLastMap = Map_Name(g_map); - } - - delete g_pParentWnd; - - global_accel_destroy(); - - Radiant_Shutdown(); - // close the log file if any - Sys_LogFile(false); + // NOTE: don't save prefs past this point! + g_PrefsDlg.mGamesDialog.m_bLogConsole = false; + // set the console window to NULL to avoid Sys_Printf crashing + g_qeglobals_gui.d_edit = NULL; + Sys_LogFile(); - return EXIT_SUCCESS; + // NOTE TTimo not sure what this _exit(0) call is worth + // restricting it to linux build +#ifdef __linux__ + _exit( 0 ); +#endif + return 0; } +// ydnar: quick and dirty fix, just make the buffer bigger +#define BIG_PATH_MAX 4096 + +// TTimo: decompose the BSP command into several steps so we can monitor them eventually +void QE_ExpandBspString (char *bspaction, GPtrArray *out_array, char *mapname) +{ + const char *in; + char *out; + char src[BIG_PATH_MAX]; + char rsh[BIG_PATH_MAX]; + char base[BIG_PATH_MAX]; + + strcpy(src, mapname); + strlwr(src); + in = strstr(src, "maps/"); + if (!in) + { + in = strstr(src, "maps/"); + } + if (in) + { + in += 5; + strcpy(base, in); + out = base; + while (*out) + { + if (*out == '\\') + { + *out = '/'; + } + out++; + } + } else + { + ExtractFileName (mapname, base); + } + + // this important step alters the map name to add fs_game + // NOTE: it used to add fs_basepath too + // the fs_basepath addition moved to being in the project file during the bug fixing rush + // but it may not have been the right thing to do + + // HACK: halflife compiler tools don't support -fs_game + // HACK: neither does JKII/SoF2/ etc.. + // do we use & have fs_game? + + if (g_pGameDescription->mGameFile != "hl.game" && + *ValueForKey(g_qeglobals.d_project_entity,"gamename") != '\0') + { + // set with fs_game + sprintf(src, "-fs_game %s \"%s\"", ValueForKey(g_qeglobals.d_project_entity,"gamename"), mapname); + } + else + { + sprintf(src, "\"%s\"", mapname); + } + + rsh[0] = 0; + + QE_ConvertDOSToUnixName(src, src); + + // initialise the first step + out = new char[BIG_PATH_MAX]; //% PATH_MAX + g_ptr_array_add( out_array, out ); + + in = ValueForKey( g_qeglobals.d_project_entity, bspaction ); + while (*in) + { + if (in[0] == '!') + { + strcpy (out, rsh); + out += strlen(rsh); + in++; + continue; + } + if (in[0] == '#') + { + char tmp[2048]; + // we process these only if monitoring + if (g_PrefsDlg.m_bWatchBSP) + { + // -connect global option (the only global option so far anyway) + strcpy (tmp, " -connect 127.0.0.1:39000 "); + strcpy (out, tmp); + out += strlen(tmp); + } + in++; + continue; + } + if (in[0] == '$') + { + // $ expansion + strcpy (out, src); + out += strlen(src); + in++; + continue; + } + if (in[0] == '@') + { + *out++ = '"'; + in++; + continue; + } + if (in[0] == '&') + if (in[1] == '&') + { + // start a new step + *out = 0; + in = in + 2; + out = new char[BIG_PATH_MAX]; //% PATH_MAX + g_ptr_array_add( out_array, out ); + } + *out++ = *in++; + } + *out = 0; +} + +void FindReplace(CString& strContents, const char* pTag, const char* pValue) +{ + if (strcmp(pTag, pValue) == 0) + return; + for (int nPos = strContents.Find(pTag); nPos >= 0; nPos = strContents.Find(pTag)) + { + int nRightLen = strContents.GetLength() - strlen(pTag) - nPos; + CString strLeft = strContents.Left(nPos); + CString strRight = strContents.Right(nRightLen); + strLeft += pValue; + strLeft += strRight; + strContents = strLeft; + } +} + +// save the map, deals with regioning +void SaveWithRegion(char *name) +{ + strcpy (name, currentmap); + if (region_active) + { + // temporary cut the region to save regular map + region_active = false; + Map_SaveFile (name, false); + region_active = true; + StripExtension (name); + strcat (name, ".reg"); + } + + Map_SaveFile (name, region_active); +} + +void RunBsp (char *command) +{ + GPtrArray *sys; + char batpath[BIG_PATH_MAX]; //% PATH_MAX + char temppath[BIG_PATH_MAX]; //% PATH_MAX + char name[BIG_PATH_MAX]; //% PATH_MAX + char cWork[BIG_PATH_MAX]; //% PATH_MAX + FILE *hFile; + unsigned int i; + + SetInspectorMode(W_CONSOLE); + + strcpy (temppath, g_strTempPath.GetBuffer ()); + + SaveWithRegion(name); + + const char *rsh = ValueForKey(g_qeglobals.d_project_entity, "rshcmd"); + if (rsh == NULL) + { + CString strPath, strFile; + + ExtractPath_and_Filename(name, strPath, strFile); + AddSlash(strPath); + strncpy(cWork, strPath, 1024); + strcat(cWork, strFile); + } else + { + strcpy(cWork, name); + } + + // get the array ready + //++timo TODO: free the array, free the strings ourselves with delete[] + sys = g_ptr_array_new(); + + QE_ExpandBspString (command, sys, cWork); + + if (g_PrefsDlg.m_bWatchBSP) + { + // grab the file name for engine running + char *bspname = new char[1024]; + ExtractFileName( currentmap, bspname ); + StripExtension( bspname ); + g_pParentWnd->GetWatchBSP()->DoMonitoringLoop( sys, bspname ); + } else + { + // write all the steps in a single BAT / .sh file and run it, don't bother monitoring it + CString strSys; + for (i=0; i < sys->len; i++ ) + { + strSys += (char *)g_ptr_array_index( sys, i); +#ifdef _WIN32 // write temp\junk.txt in win32... NOTE: stops output to shell prompt window + if (i==0) + strSys += " >"; + else + strSys += " >>"; + strSys += "\""; + strSys += temppath; + strSys += "junk.txt\""; +#endif + strSys += "\n"; + }; + +#if defined (__linux__) || defined (__APPLE__) + + // write qe3bsp.sh + sprintf (batpath, "%sqe3bsp.sh", temppath); + Sys_Printf("Writing the compile script to '%s'\n", batpath); + Sys_Printf("The build output will be saved in '%sjunk.txt'\n", temppath); + hFile = fopen(batpath, "w"); + if (!hFile) + Error ("Can't write to %s", batpath); + fprintf (hFile, "#!/bin/sh \n\n"); + fprintf (hFile, strSys.GetBuffer()); + fclose (hFile); + chmod (batpath, 0744); +#endif + +#ifdef _WIN32 + sprintf (batpath, "%sqe3bsp.bat", temppath); + Sys_Printf("Writing the compile script to '%s'\n", batpath); + Sys_Printf("The build output will be saved in '%sjunk.txt'\n", temppath); + hFile = fopen(batpath, "w"); + if (!hFile) + Error ("Can't write to %s", batpath); + fprintf (hFile, strSys.GetBuffer()); + fclose (hFile); +#endif + + Pointfile_Delete (); + +#if defined (__linux__) || defined (__APPLE__) + + pid_t pid; + + pid = fork (); + switch (pid) + { + case -1: + Error ("CreateProcess failed"); + break; + case 0: + execlp (batpath, batpath, NULL); + printf ("execlp error !"); + _exit (0); + break; + default: + break; + } +#endif + +#ifdef _WIN32 + Sys_Printf ("Running bsp command...\n"); + Sys_Printf ("\n%s\n", strSys.GetBuffer()); + + WinExec( batpath, SW_SHOWNORMAL ); +#endif + } +#ifdef _DEBUG + // yeah, do it .. but not now right before 1.1-TA-beta release + Sys_Printf("TODO: erase GPtrArray\n"); +#endif +} + +#if 0 + +#ifdef _WIN32 + +int WINAPI QEW_SetupPixelFormat(HDC hDC, qboolean zbuffer ) +{ + static PIXELFORMATDESCRIPTOR pfd = { + sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd + 1, // version number + PFD_DRAW_TO_WINDOW | // support window + PFD_SUPPORT_OPENGL | // support OpenGL + PFD_DOUBLEBUFFER, // double buffered + PFD_TYPE_RGBA, // RGBA type + 24, // 24-bit color depth + 0, 0, 0, 0, 0, 0, // color bits ignored + 0, // no alpha buffer + 0, // shift bit ignored + 0, // no accumulation buffer + 0, 0, 0, 0, // accum bits ignored + 32, // depth bits + 0, // no stencil buffer + 0, // no auxiliary buffer + PFD_MAIN_PLANE, // main layer + 0, // reserved + 0, 0, 0 // layer masks ignored + }; // + int pixelformat = 0; + + zbuffer = true; + if ( !zbuffer ) + pfd.cDepthBits = 0; + + if ( (pixelformat = ChoosePixelFormat(hDC, &pfd)) == 0 ) + { + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + Sys_FPrintf (SYS_WRN, "GetLastError: %s", lpMsgBuf); + Error ("ChoosePixelFormat failed"); + } + + if (!SetPixelFormat(hDC, pixelformat, &pfd)) + Error ("SetPixelFormat failed"); + + return pixelformat; +} + +#endif + +#endif diff --git a/radiant/main.h b/radiant/main.h deleted file mode 100644 index bda8f3da..00000000 --- a/radiant/main.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MAIN_H) -#define INCLUDED_MAIN_H - -#endif diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index ad0035eb..d347d7b7 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,2750 +25,3050 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "mainframe.h" - -#include "debugging/debugging.h" -#include "version.h" - -#include "ifilesystem.h" -#include "iundo.h" -#include "ifilter.h" -#include "itoolbar.h" -#include "editable.h" -#include "ientity.h" -#include "ishaders.h" -#include "igl.h" -#include "moduleobserver.h" - -#include - +#include "stdafx.h" +#ifdef _WIN32 +extern "C" { +#include +#define COMPILE_MULTIMON_STUBS +#include +} +#endif +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "cmdlib.h" -#include "scenelib.h" -#include "stream/stringstream.h" -#include "signal/isignal.h" -#include "os/path.h" -#include "os/file.h" -#include "eclasslib.h" -#include "moduleobservers.h" - -#include "gtkutil/clipboard.h" -#include "gtkutil/container.h" -#include "gtkutil/frame.h" -#include "gtkutil/glfont.h" -#include "gtkutil/glwidget.h" -#include "gtkutil/image.h" -#include "gtkutil/menu.h" -#include "gtkutil/paned.h" -#include "gtkutil/widget.h" - -#include "autosave.h" -#include "build.h" -#include "brushmanip.h" -#include "brushmodule.h" -#include "camwindow.h" -#include "csg.h" -#include "commands.h" -#include "console.h" -#include "entity.h" -#include "entityinspector.h" -#include "entitylist.h" -#include "filters.h" -#include "findtexturedialog.h" -#include "grid.h" -#include "groupdialog.h" -#include "gtkdlgs.h" +#include +#include +#if defined (__linux__) || defined (__APPLE__) + #include +#endif #include "gtkmisc.h" -#include "help.h" -#include "map.h" -#include "mru.h" -#include "multimon.h" +#include "groupdialog.h" #include "patchdialog.h" -#include "patchmanip.h" -#include "plugin.h" -#include "pluginmanager.h" -#include "pluginmenu.h" -#include "plugintoolbar.h" -#include "points.h" -#include "preferences.h" -#include "qe3.h" -#include "qgl.h" -#include "select.h" -#include "server.h" -#include "surfacedialog.h" -#include "textures.h" -#include "texwindow.h" -#include "url.h" -#include "xywindow.h" -#include "windowobservers.h" -#include "renderstate.h" -#include "feedback.h" -#include "referencecache.h" +#include "filters.h" - - -struct layout_globals_t -{ - WindowPosition m_position; - - - int nXYHeight; - int nXYWidth; - int nCamWidth; - int nCamHeight; - int nState; - - layout_globals_t() : - m_position(-1, -1, 640, 480), - - nXYHeight(300), - nXYWidth(300), - nCamWidth(200), - nCamHeight(200), - nState(GDK_WINDOW_STATE_MAXIMIZED) - { - } -}; - -layout_globals_t g_layout_globals; -glwindow_globals_t g_glwindow_globals; - - -// VFS -class VFSModuleObserver : public ModuleObserver -{ - std::size_t m_unrealised; -public: - VFSModuleObserver() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - QE_InitVFS(); - GlobalFileSystem().initialise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - GlobalFileSystem().shutdown(); - } - } -}; - -VFSModuleObserver g_VFSModuleObserver; - -void VFS_Construct() -{ - Radiant_attachHomePathsObserver(g_VFSModuleObserver); -} -void VFS_Destroy() -{ - Radiant_detachHomePathsObserver(g_VFSModuleObserver); -} - -// Home Paths - -void HomePaths_Realise() -{ -#if defined(POSIX) - const char* prefix = g_pGameDescription->getKeyValue("prefix"); - if(!string_empty(prefix)) - { - StringOutputStream path(256); - path << DirectoryCleaned(g_get_home_dir()) << prefix << "/"; - g_qeglobals.m_userEnginePath = path.c_str(); - Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); - } - else -#endif - { - g_qeglobals.m_userEnginePath = EnginePath_get(); - } - - { - StringOutputStream path(256); - path << g_qeglobals.m_userEnginePath.c_str() << gamename_get() << '/'; - g_qeglobals.m_userGamePath = path.c_str(); - } - ASSERT_MESSAGE(!string_empty(g_qeglobals.m_userGamePath.c_str()), "HomePaths_Realise: user-game-path is empty"); - Q_mkdir(g_qeglobals.m_userGamePath.c_str()); -} - -ModuleObservers g_homePathObservers; - -void Radiant_attachHomePathsObserver(ModuleObserver& observer) -{ - g_homePathObservers.attach(observer); -} - -void Radiant_detachHomePathsObserver(ModuleObserver& observer) -{ - g_homePathObservers.detach(observer); -} - -class HomePathsModuleObserver : public ModuleObserver -{ - std::size_t m_unrealised; -public: - HomePathsModuleObserver() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - HomePaths_Realise(); - g_homePathObservers.realise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - g_homePathObservers.unrealise(); - } - } -}; - -HomePathsModuleObserver g_HomePathsModuleObserver; - -void HomePaths_Construct() -{ - Radiant_attachEnginePathObserver(g_HomePathsModuleObserver); -} -void HomePaths_Destroy() -{ - Radiant_detachEnginePathObserver(g_HomePathsModuleObserver); -} - - -// Engine Path - -CopiedString g_strEnginePath; -ModuleObservers g_enginePathObservers; -std::size_t g_enginepath_unrealised = 1; - -void Radiant_attachEnginePathObserver(ModuleObserver& observer) -{ - g_enginePathObservers.attach(observer); -} - -void Radiant_detachEnginePathObserver(ModuleObserver& observer) -{ - g_enginePathObservers.detach(observer); -} - - -void EnginePath_Realise() -{ - if(--g_enginepath_unrealised == 0) - { - g_enginePathObservers.realise(); - } -} - - -const char* EnginePath_get() -{ - ASSERT_MESSAGE(g_enginepath_unrealised == 0, "EnginePath_get: engine path not realised"); - return g_strEnginePath.c_str(); -} - -void EnginePath_Unrealise() -{ - if(++g_enginepath_unrealised == 1) - { - g_enginePathObservers.unrealise(); - } -} - -void setEnginePath(const char* path) -{ - StringOutputStream buffer(256); - buffer << DirectoryCleaned(path); - if(!path_equal(buffer.c_str(), g_strEnginePath.c_str())) - { -#if 0 - while(!ConfirmModified("Paths Changed")) - { - if(Map_Unnamed(g_map)) - { - Map_SaveAs(); - } - else - { - Map_Save(); - } - } - Map_RegionOff(); +// use this to verbose what happens with the beyboard +#ifdef _DEBUG +// #define DBG_KBD #endif - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Changing Engine Path"); - - EnginePath_Unrealise(); - - g_strEnginePath = buffer.c_str(); - - EnginePath_Realise(); - } -} - - -// App Path - -CopiedString g_strAppPath; ///< holds the full path of the executable - -const char* AppPath_get() -{ - return g_strAppPath.c_str(); -} - -/// the path to the local rc-dir -const char* LocalRcPath_get(void) -{ - static CopiedString rc_path; - if(rc_path.empty()) - { - StringOutputStream stream(256); - stream << GlobalRadiant().getSettingsPath() << g_pGameDescription->mGameFile.c_str() << "/"; - rc_path = stream.c_str(); - } - return rc_path.c_str(); -} - -/// directory for temp files -/// NOTE: on *nix this is were we check for .pid -CopiedString g_strSettingsPath; -const char* SettingsPath_get() -{ - return g_strSettingsPath.c_str(); -} - +// globals +CString g_strAppPath; ///< holds the full path of the executable +CString g_strDTDPath; ///< path to the DTD files +/*! +see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 for the two below +*/ +CString g_pidFile; ///< the global .pid file (only for global part of the startup) +CString g_pidGameFile; ///< the game-specific .pid file +CString g_strBitmapsPath; // directory where the bitmaps are stored /*! points to the game tools directory, for instance -C:/Program Files/Quake III Arena/GtkRadiant +C:\Program Files\Quake III Arena\GtkRadiant (or other games) this is one of the main variables that are configured by the game selection on startup -[GameToolsPath]/plugins -[GameToolsPath]/modules +/plugins +/modules and also q3map, bspc */ -CopiedString g_strGameToolsPath; ///< this is set by g_GamesDialog +CString g_strGameToolsPath; ///< this is set by g_PrefsDlg.mGamesDialog +CGameDescription *g_pGameDescription; ///< shortcut to g_PrefsDlg.mGamesDialog.m_pCurrentDescription +CString g_strPluginsDir; ///< name of plugins directory, always sub-directory of toolspath +CString g_strModulesDir; ///< name of modules directory, always sub-directory of toolspath -const char* GameToolsPath_get() +/*! +directory for temp files +NOTE: on *nix this is were we check for .pid +*/ +CString g_strTempPath; +MainFrame* g_pParentWnd = NULL; // used to precast to CMainFrame +PrefsDlg g_Preferences; // global prefs instance +PrefsDlg& g_PrefsDlg = g_Preferences; // reference used throughout +int g_nUpdateBits = 0; // window update flags +bool g_bScreenUpdates = true; // whether window painting is active, used in a few places + // to disable updates for speed reasons + // both of the above should be made members of CMainFrame +int g_bIgnoreCommands; // Used to ignore commands when checking menus/toolbars +GSList *g_BSPFrontendCommands; // List of commands in the BSP menu + +const int CMD_TEXTUREWAD_END = CMD_TEXTUREWAD + MAX_TEXTUREDIRS - 1; +const int CMD_BSPCOMMAND_END = CMD_BSPCOMMAND + 127; + +extern bool g_bCrossHairs; +extern int g_argc; +extern char** g_argv; +extern PatchDialog g_PatchDialog; + +GtkAccelGroup* global_accel; + +void Select_Ungroup (); + +// command mapping stuff +// +// m_strCommand is the command string +// m_nKey is the GDK_??? equivelant +// m_nModifiers are key states as follows +// bit +// 1 - shift +// 2 - alt +// 4 - control +// 8 - press only +// +#define SPEED_MOVE 32 +#define SPEED_TURN 22.5 + +// NOTE: the menu item field is REQUIRED, Gtk uses it to bind the keyboard shortcut +// - if you add a command here and you don't want a menu item, use the "hidden" menu +// - if you decide to add a menu item, check if it's not in the "hidden" menu already +SCommandInfo g_Commands[] = { - return g_strGameToolsPath.c_str(); -} - -void EnginePathImport(CopiedString& self, const char* value) -{ - setEnginePath(value); -} -typedef ReferenceCaller1 EnginePathImportCaller; - -void Paths_constructPreferences(PreferencesPage& page) -{ - page.appendPathEntry("Engine Path", true, - StringImportCallback(EnginePathImportCaller(g_strEnginePath)), - StringExportCallback(StringExportCaller(g_strEnginePath)) - ); -} -void Paths_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Paths", "Path Settings")); - Paths_constructPreferences(page); -} -void Paths_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - - -class PathsDialog : public Dialog -{ -public: - GtkWindow* BuildDialog() - { - GtkFrame* frame = create_dialog_frame("Path settings", GTK_SHADOW_ETCHED_IN); - - GtkVBox* vbox2 = create_dialog_vbox(0, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox2)); - - { - PreferencesPage preferencesPage(*this, GTK_WIDGET(vbox2)); - Paths_constructPreferences(preferencesPage); - } - - return create_simple_modal_dialog_window("Engine Path Not Found", m_modal, GTK_WIDGET(frame)); - } + {"CycleOutlineStyle", 'J', 0x00, ID_SELECTION_OUTLINESTYLE, "menu_selection_outlinestyle"}, + {"CSGMerge", 'U', 0x04, ID_SELECTION_CSGMERGE, "menu_selection_csgmerge"}, + {"CSGSubtract", 'U', 0x01, ID_SELECTION_CSGSUBTRACT, "menu_selection_csgsubstract"}, + // {"ViewGroups", 'G', 0x00, ID_VIEW_GROUPS, "menu_view_groups"}, (temporary disabled) + {"HideSelected", 'H', 0x00, ID_VIEW_HIDESHOW_HIDESELECTED, "menu_view_hideshow_hideselected"}, + {"ShowHidden", 'H', 0x01, ID_VIEW_HIDESHOW_SHOWHIDDEN, "menu_view_hideshow_showhidden"}, + {"BendMode", 'B', 0x00, ID_PATCH_BEND, "menu_patch_bend"}, + {"FitTexture", 'B', 0x01, IDC_BTN_FACEFIT, "menu_idc_btn_facefit"}, + {"ViewTextures", 'T', 0, ID_VIEW_TEXTURE, "menu_view_texture"}, + {"ThickenPatch", 'T', 0x04, ID_CURVE_THICKEN, "menu_curve_thicken"}, + {"MakeOverlayPatch", 'Y', 0, ID_CURVE_OVERLAY_SET, "menu_curve_overlay_set"}, + {"ClearPatchOverlays", 'L', 0x04, ID_CURVE_OVERLAY_CLEAR, "menu_curve_overlay_clear"}, + {"SurfaceInspector", 'S', 0, ID_TEXTURES_INSPECTOR, "menu_textures_inspector"}, + {"PatchInspector", 'S', 0x01, ID_PATCH_INSPECTOR, "menu_patch_inspector"}, + {"RedisperseRows", 'E', 0x04, ID_CURVE_REDISPERSE_ROWS, "menu_curve_redisperse_rows"}, + {"RedisperseIntermediateCols", 'E', 0x05, ID_CURVE_REDISPERSE_INTERMEDIATE_COLS, "menu_curve_redisperse_cols"}, + {"InvertCurveTextureX", 'I', 0x05, ID_CURVE_NEGATIVETEXTUREY, "menu_curve_negativetexturey"}, + {"InvertCurveTextureY", 'I', 0x01, ID_CURVE_NEGATIVETEXTUREX, "menu_curve_negativetexturex"}, + {"InvertCurve", 'I', 0x04, ID_CURVE_NEGATIVE, "menu_curve_negative"}, + {"IncPatchColumn", GDK_KP_Add, 0x05, ID_CURVE_INSERTCOLUMN, "menu_curve_insertcolumn"}, + {"IncPatchRow", GDK_KP_Add, 0x04, ID_CURVE_INSERTROW, "menu_curve_insertrow"}, + {"DecPatchColumn", GDK_KP_Subtract, 0x05, ID_CURVE_DELETECOLUMN, "menu_curve_deletecolumn"}, + {"DecPatchRow", GDK_KP_Subtract, 0x04, ID_CURVE_DELETEROW, "menu_curve_deleterow"}, + {"Patch TAB", GDK_Tab, 0x00, ID_PATCH_TAB, "menu_patch_tab"}, + {"Patch TAB", GDK_Tab, 0x01, ID_PATCH_TAB, "menu_patch_tab"}, + {"SelectNudgeDown", GDK_Down, 0x02, ID_SELECTION_SELECT_NUDGEDOWN, "menu_selection_select_nudgedown"}, + {"EntityColor",'K', 0, ID_MISC_SELECTENTITYCOLOR, "menu_misc_select_entitycolor"}, + {"CameraForward", GDK_Up, 0, ID_CAMERA_FORWARD, "menu_camera_forward"}, + {"CameraBack", GDK_Down, 0, ID_CAMERA_BACK, "menu_camera_back"}, + {"CameraLeft", GDK_Left, 0, ID_CAMERA_LEFT, "menu_camera_left"}, + {"CameraRight", GDK_Right, 0, ID_CAMERA_RIGHT, "menu_camera_right"}, + {"CameraUp", 'D', 0, ID_CAMERA_UP, "menu_camera_up"}, + {"CameraDown", 'C', 0, ID_CAMERA_DOWN, "menu_camera_down"}, + {"CameraAngleUp", 'A', 0, ID_CAMERA_ANGLEUP, "menu_camera_angleup"}, + {"CameraAngleDown", 'Z', 0, ID_CAMERA_ANGLEDOWN, "menu_camera_angledown"}, + {"CameraStrafeRight", GDK_period, 0, ID_CAMERA_STRAFERIGHT, "menu_camera_straferight"}, + {"CameraStrafeLeft", GDK_comma, 0, ID_CAMERA_STRAFELEFT, "menu_camera_strafeleft"}, + {"ToggleGrid", '0', 0, ID_GRID_TOGGLE, "menu_grid_toggle"}, + {"SetGrid1", '1', 0, ID_GRID_1, "menu_grid_1"}, + {"SetGrid2", '2', 0, ID_GRID_2, "menu_grid_2"}, + {"SetGrid4", '3', 0, ID_GRID_4, "menu_grid_4"}, + {"SetGrid8", '4', 0, ID_GRID_8, "menu_grid_8"}, + {"SetGrid16", '5', 0, ID_GRID_16, "menu_grid_16"}, + {"SetGrid32", '6', 0, ID_GRID_32, "menu_grid_32"}, + {"SetGrid64", '7', 0, ID_GRID_64, "menu_grid_64"}, + {"SetGrid128", '8', 0, ID_GRID_128, "menu_grid_128"}, + {"SetGrid256", '9', 0, ID_GRID_256, "menu_grid_256"}, + {"DragEdges", 'E', 0, ID_SELECTION_DRAGEDGES, "menu_selection_dragedges"}, + {"DragVertices", 'V', 0, ID_SELECTION_DRAGVERTECIES, "menu_selection_dragvertecies"}, + {"ViewEntityInfo", 'N', 0, ID_VIEW_ENTITY, "menu_view_entity"}, + // {"ViewConsole", 'O', 0, ID_VIEW_CONSOLE, "menu_0,"}, + {"CloneSelection", GDK_space, 0, ID_SELECTION_CLONE, "menu_selection_clone"}, + {"DeleteSelection", GDK_BackSpace, 0, ID_SELECTION_DELETE, "menu_selection_delete"}, + {"UnSelectSelection", GDK_Escape, 0, ID_SELECTION_DESELECT, "menu_selection_deselect"}, + {"CenterView", GDK_End, 0, ID_VIEW_CENTER, "menu_view_center"}, + {"ZoomOut", GDK_Insert, 0, ID_VIEW_ZOOMOUT, "menu_view_zoomout"}, + {"ZoomIn", GDK_Delete, 0, ID_VIEW_ZOOMIN, "menu_view_zoomin"}, + {"UpFloor", GDK_Prior, 0, ID_VIEW_UPFLOOR, "menu_view_upfloor"}, + {"DownFloor", GDK_Next, 0, ID_VIEW_DOWNFLOOR, "menu_view_downfloor"}, + {"ToggleClipper", 'X', 0, ID_VIEW_CLIPPER, "menu_view_clipper"}, + {"ToggleCrosshairs", 'X', 0x01, ID_VIEW_CROSSHAIR, "menu_view_crosshair"}, + {"TogTexLock", 'T', 0x01, ID_TOGGLE_LOCK, "menu_toggle_lock"}, + {"TogTexRotLock", 'R', 0x01, ID_TOGGLE_ROTATELOCK, "menu_toggle_rotatelock"}, + {"ToggleRealtime", 'R', 0x04, ID_VIEW_CAMERAUPDATE, "menu_view_cameraupdate"}, + {"EntityList", 'L', 0, ID_EDIT_ENTITYINFO, "menu_edit_entityinfo"}, + {"Preferences", 'P', 0, ID_PREFS, "menu_prefs"}, + {"ToggleCamera", 'C', 0x05, ID_TOGGLECAMERA, "menu_togglecamera"}, + {"ToggleConsole", 'O', 0, ID_TOGGLECONSOLE, "menu_toggleconsole"}, + {"ToggleView", 'V', 0x05, ID_TOGGLEVIEW, "menu_toggleview"}, + {"ToggleZ", 'Z', 0x05, ID_TOGGLEZ, "menu_togglez"}, + {"ConnectSelection", 'K', 0x04, ID_SELECTION_CONNECT, "menu_selection_connect"}, + {"Brush3Sided", '3', 0x04, ID_BRUSH_3SIDED, "menu_brush_3sided"}, + {"Brush4Sided", '4', 0x04, ID_BRUSH_4SIDED, "menu_brush_4sided"}, + {"Brush5Sided", '5', 0x04, ID_BRUSH_5SIDED, "menu_brush_5sided"}, + {"Brush6Sided", '6', 0x04, ID_BRUSH_6SIDED, "menu_brush_6sided"}, + {"Brush7Sided", '7', 0x04, ID_BRUSH_7SIDED, "menu_brush_7sided"}, + {"Brush8Sided", '8', 0x04, ID_BRUSH_8SIDED, "menu_brush_8sided"}, + {"Brush9Sided", '9', 0x04, ID_BRUSH_9SIDED, "menu_brush_9sided"}, + {"MatrixTranspose", 'M', 0x05, ID_CURVE_MATRIX_TRANSPOSE, "menu_curve_matrix_transpose"}, + {"MakeDetail", 'M', 0x04, ID_SELECTION_MAKE_DETAIL, "menu_selection_make_detail"}, + {"MapInfo", 'M', 0, ID_EDIT_MAPINFO, "menu_edit_mapinfo"}, + {"NextLeakSpot", 'K', 0x05, ID_MISC_NEXTLEAKSPOT, "menu_misc_nextleakspot"}, + {"PrevLeakSpot", 'L', 0x05, ID_MISC_PREVIOUSLEAKSPOT, "menu_misc_previousleakspot"}, + {"FileOpen", 'O', 0x04, ID_FILE_OPEN, "menu_file_open"}, + {"FileSave", 'S', 0x04, ID_FILE_SAVE, "menu_file_save"}, + //% {"Exit", 'X', 0x04, ID_FILE_EXIT, "menu_file_exit"}, // ydnar: Ctrl+X should be cut + {"CenterXYView", GDK_Tab, 0x05, ID_VIEW_CENTERVIEW, "menu_view_centerview"}, + {"NextView", GDK_Tab, 0x04, ID_VIEW_NEXTVIEW, "menu_view_nextview"}, + {"ClipSelected", GDK_Return, 0x00, ID_CLIP_SELECTED, "menu_clip_selected"}, + {"SplitSelected", GDK_Return, 0x01, ID_SPLIT_SELECTED, "menu_split_selected"}, + {"FlipClip", GDK_Return, 0x04, ID_FLIP_CLIP, "menu_flip_clip"}, + {"MouseRotate", 'R', 0x00, ID_SELECT_MOUSEROTATE, "menu_select_mouserotate"}, + {"Copy", 'C', 0x04, ID_EDIT_COPYBRUSH, "menu_edit_copybrush"}, + {"Paste", 'V', 0x04, ID_EDIT_PASTEBRUSH, "menu_edit_pastebrush"}, + {"PasteToCamera", 'V', RAD_ALT, ID_EDIT_PASTEBRUSHTOCAMERA, "menu_edit_pastebrushtocamera"}, + {"Undo", 'Z', 0x04, ID_EDIT_UNDO, "menu_edit_undo"}, + {"Redo", 'Y', 0x04, ID_EDIT_REDO, "menu_edit_redo"}, + {"ZZoomOut", GDK_Insert, 0x04, ID_VIEW_ZZOOMOUT, "menu_view_zzoomout"}, + {"ZZoomIn", GDK_Delete, 0x04, ID_VIEW_ZZOOMIN, "menu_view_zzoomin"}, + {"TexRotateClock", GDK_Next, 0x01, ID_SELECTION_TEXTURE_ROTATECLOCK, "menu_selection_texture_rotateclock"}, + {"TexRotateCounter", GDK_Prior, 0x01, ID_SELECTION_TEXTURE_ROTATECOUNTER, "menu_selection_texture_rotatecounter"}, + {"TexScaleUp", GDK_Up, 0x04, ID_SELECTION_TEXTURE_SCALEUP, "menu_selection_texture_scaleup"}, + {"TexScaleDown", GDK_Down, 0x04, ID_SELECTION_TEXTURE_SCALEDOWN, "menu_selection_texture_scaledown"}, + {"TexShiftLeft", GDK_Left, 0x01, ID_SELECTION_TEXTURE_SHIFTLEFT, "menu_selection_texture_shiftleft"}, + {"TexShiftRight", GDK_Right, 0x01, ID_SELECTION_TEXTURE_SHIFTRIGHT, "menu_selection_texture_shiftright"}, + {"TexShiftUp", GDK_Up, 0x01, ID_SELECTION_TEXTURE_SHIFTUP, "menu_selection_texture_shiftup"}, + {"TexShiftDown", GDK_Down, 0x01, ID_SELECTION_TEXTURE_SHIFTDOWN, "menu_selection_texture_shiftdown"}, + {"GridDown", '[', 0x00, ID_GRID_PREV, "menu_grid_prev"}, + {"GridUp", ']', 0x00, ID_GRID_NEXT, "menu_grid_next"}, + {"TexScaleLeft", GDK_Left, 0x04, ID_SELECTION_TEXTURE_SCALELEFT, "menu_selection_texture_scaleleft"}, + {"TexScaleRight", GDK_Right, 0x04, ID_SELECTION_TEXTURE_SCALERIGHT, "menu_selection_texture_scaleright"}, + {"CubicClipZoomOut", ']', 0x04, ID_VIEW_CUBEOUT, "menu_view_cubeout"}, + {"CubicClipZoomIn", '[', 0x04, ID_VIEW_CUBEIN, "menu_view_cubein"}, + {"ToggleCubicClip", '\\', 0x04, ID_VIEW_CUBICCLIPPING, "menu_view_cubicclipping"}, + {"MoveSelectionDOWN", GDK_KP_Subtract, 0x00, ID_SELECTION_MOVEDOWN, "menu_selection_movedown"}, + {"MoveSelectionUP", GDK_KP_Add, 0x00, ID_SELECTION_MOVEUP, "menu_selection_moveup"}, + {"DumpSelectedBrush", 'D', 0x01, ID_SELECTION_PRINT, "menu_selection_print"}, + {"ToggleSizePaint", 'Q', 0x00, ID_SELECTION_TOGGLESIZEPAINT, "menu_selection_togglesizepaint"}, + {"SelectNudgeLeft", GDK_Left, 0x02, ID_SELECTION_SELECT_NUDGELEFT, "menu_selection_select_nudgeleft"}, + {"SelectNudgeRight", GDK_Right, 0x02, ID_SELECTION_SELECT_NUDGERIGHT, "menu_selection_select_nudgeright"}, + {"SelectNudgeUp", GDK_Up, 0x02, ID_SELECTION_SELECT_NUDGEUP, "menu_selection_select_nudgeup"}, + {"CycleCapTexturePatch", 'N', 0x05, ID_CURVE_CYCLECAP, "menu_curve_cyclecap"}, + {"NaturalizePatch", 'N', 0x04, ID_PATCH_NATURALIZE, "menu_patch_naturalize"}, + {"SnapToGrid", 'G', 0x04, ID_SELECT_SNAPTOGRID, "menu_select_snaptogrid"}, + {"ShowAllTextures", 'A', 0x04, ID_TEXTURES_SHOWALL, "menu_textures_showall"}, + {"SelectAllOfType", 'A', 0x01, ID_SELECT_ALL, "menu_select_all"}, + {"CapCurrentCurve", 'C', 0x01, ID_CURVE_CAP, "menu_curve_cap"}, + {"MakeStructural", 'S', 0x05, ID_SELECTION_MAKE_STRUCTURAL, "menu_selection_make_structural"}, + {"RegionSetSelection", 'R', 0x05, ID_REGION_SETSELECTION, "menu_region_setselection"}, + {"ShowInUse", 'U', 0, ID_TEXTURES_SHOWINUSE, "menu_textures_showinuse"}, + {"InvertSelection", 'I', 0, ID_SELECTION_INVERT, "menu_selection_invert"}, + {"Sleep", 'P', 0x05, ID_FILE_SLEEP, "menu_file_sleep"}, + {"SimplePatchMesh", 'P', 0x01, ID_CURVE_SIMPLEPATCHMESH, "menu_simplepatchmesh"}, + {"FilterWorldBrushes", '1', RAD_ALT, ID_FILTER_WORLD, "menu_filter_world"}, + {"FilterEntities", '2', RAD_ALT, ID_FILTER_ENTITIES, "menu_filter_entities"}, + {"FilterAreaportals", '3', RAD_ALT, ID_FILTER_AREAPORTALS, "menu_filter_areaportals"}, + {"FilterTranslucent", '4', RAD_ALT, ID_FILTER_TRANSLUCENT, "menu_filter_translucent"}, + {"FilterLiquids", '5', RAD_ALT, ID_FILTER_LIQUIDS, "menu_filter_liquids"}, + {"FilterCaulk", '6', RAD_ALT , ID_FILTER_CAULK, "menu_filter_caulk"}, + {"FilterClips", '7', RAD_ALT, ID_FILTER_CLIPS, "menu_filter_clips"}, + {"FilterBotClips", 'M', RAD_ALT, ID_FILTER_BOTCLIPS, "menu_filter_botclips"}, + {"FilterPaths", '8', RAD_ALT, ID_FILTER_PATHS, "menu_filter_paths"}, + {"FilterClusterportals", '9', RAD_ALT, ID_FILTER_CLUSTERPORTALS, "menu_filter_clusterportals"}, + {"FilterLights", '0', RAD_ALT, ID_FILTER_LIGHTS, "menu_filter_lights"}, + {"FilterPatches", 'P', RAD_CONTROL, ID_FILTER_PATCHES, "menu_filter_patches"}, + {"FilterDetails", 'D', RAD_CONTROL, ID_FILTER_DETAILS, "menu_filter_details"}, + {"FilterStructural", 'D', RAD_CONTROL|RAD_SHIFT, ID_FILTER_STRUCTURAL, "menu_filter_structural"}, + {"FilterHintsSkips", 'H', RAD_CONTROL, ID_FILTER_HINTSSKIPS, "menu_filter_hintsskips"}, + {"FilterModels", 'M', RAD_SHIFT, ID_FILTER_MODELS, "menu_filter_models"}, + {"FilterTriggers", 'T', RAD_CONTROL|RAD_SHIFT, ID_FILTER_TRIGGERS, "menu_filter_triggers"}, + {"LoadPointfile", 'L', RAD_SHIFT, ID_FILE_POINTFILE, "menu_load_pointfile"}, + {"TextureWindowScaledown", GDK_Insert, RAD_ALT, ID_TEXTUREWINDOW_SCALEDOWN, "menu_texturewindow_scaledown"}, + {"TextureWindowScaleup", GDK_Delete, RAD_ALT, ID_TEXTUREWINDOW_SCALEUP, "menu_texturewindow_scaleup"}, }; -PathsDialog g_PathsDialog; +int g_nCommandCount = sizeof(g_Commands) / sizeof(SCommandInfo); -void EnginePath_verify() +SKeyInfo g_Keys[] = { - if(!file_exists(g_strEnginePath.c_str())) - { - g_PathsDialog.Create(); - g_PathsDialog.DoModal(); - g_PathsDialog.Destroy(); - } -} - -namespace -{ - CopiedString g_gamename; - CopiedString g_gamemode; - ModuleObservers g_gameNameObservers; - ModuleObservers g_gameModeObservers; -} - -void Radiant_attachGameNameObserver(ModuleObserver& observer) -{ - g_gameNameObservers.attach(observer); -} - -void Radiant_detachGameNameObserver(ModuleObserver& observer) -{ - g_gameNameObservers.detach(observer); -} - -const char* basegame_get() -{ - return g_pGameDescription->getRequiredKeyValue("basegame"); -} - -const char* gamename_get() -{ - const char* gamename = g_gamename.c_str(); - if(string_empty(gamename)) - { - return basegame_get(); - } - return gamename; -} - -void gamename_set(const char* gamename) -{ - if(!string_equal(gamename, g_gamename.c_str())) - { - g_gameNameObservers.unrealise(); - g_gamename = gamename; - g_gameNameObservers.realise(); - } -} - -void Radiant_attachGameModeObserver(ModuleObserver& observer) -{ - g_gameModeObservers.attach(observer); -} - -void Radiant_detachGameModeObserver(ModuleObserver& observer) -{ - g_gameModeObservers.detach(observer); -} - -const char* gamemode_get() -{ - return g_gamemode.c_str(); -} - -void gamemode_set(const char* gamemode) -{ - if(!string_equal(gamemode, g_gamemode.c_str())) - { - g_gameModeObservers.unrealise(); - g_gamemode = gamemode; - g_gameModeObservers.realise(); - } -} - -#include "os/dir.h" - -class CLoadModule -{ - const char* m_path; -public: - CLoadModule(const char* path) : m_path(path) - { - } - void operator()(const char* name) const - { - char fullname[1024]; - ASSERT_MESSAGE(strlen(m_path) + strlen(name) < 1024, ""); - strcpy(fullname, m_path); - strcat(fullname, name); - globalOutputStream() << "Found '" << fullname << "'\n"; - GlobalModuleServer_loadModule(fullname); - } + {"Space", GDK_space}, + {"Backspace", GDK_BackSpace}, + {"Escape", GDK_Escape}, + {"End", GDK_End}, + {"Insert", GDK_Insert}, + {"Delete", GDK_Delete}, + {"PageUp", GDK_Prior}, + {"PageDown", GDK_Next}, + {"Up", GDK_Up}, + {"Down", GDK_Down}, + {"Left", GDK_Left}, + {"Right", GDK_Right}, + {"F1", GDK_F1}, + {"F2", GDK_F2}, + {"F3", GDK_F3}, + {"F4", GDK_F4}, + {"F5", GDK_F5}, + {"F6", GDK_F6}, + {"F7", GDK_F7}, + {"F8", GDK_F8}, + {"F9", GDK_F9}, + {"F10", GDK_F10}, + {"F11", GDK_F11}, + {"F12", GDK_F12}, + {"Tab", GDK_Tab}, + {"Return", GDK_Return}, + {"Comma", GDK_comma}, + {"Period", GDK_period}, + {"Plus", GDK_KP_Add}, + {"Multiply", GDK_multiply}, + {"Subtract", GDK_KP_Subtract}, + {"NumPad0", GDK_KP_0}, + {"NumPad1", GDK_KP_1}, + {"NumPad2", GDK_KP_2}, + {"NumPad3", GDK_KP_3}, + {"NumPad4", GDK_KP_4}, + {"NumPad5", GDK_KP_5}, + {"NumPad6", GDK_KP_6}, + {"NumPad7", GDK_KP_7}, + {"NumPad8", GDK_KP_8}, + {"NumPad9", GDK_KP_9}, + {"[", 219}, + {"]", 221}, + {"\\", 220}, + {"Home", GDK_Home} }; -const char* const c_library_extension = -#if defined(WIN32) -"dll" -#elif defined (__APPLE__) -"dylib" -#elif defined(__linux__) || defined (__FreeBSD__) -"so" +int g_nKeyCount = sizeof(g_Keys) / sizeof(SKeyInfo); + +// ============================================================================= +// global functions + +void WINAPI Sys_UpdateWindows (int nBits) +{ + g_nUpdateBits |= nBits; +} + +// ============================================================================= +// Static functions + +// Gef: Separate handling for keyup events +void HandleKeyUp (GtkWidget *widget, gpointer data) +{ + int id = GPOINTER_TO_INT (data); +#ifdef DBG_KBD + Sys_Printf("HandleKeyUp: %d\n", id); #endif -; - -void Radiant_loadModules(const char* path) -{ - Directory_forEach(path, MatchFileExtension(c_library_extension, CLoadModule(path))); -} - -void Radiant_loadModulesFromRoot(const char* directory) -{ - { - StringOutputStream path(256); - path << directory << g_pluginsDir; - Radiant_loadModules(path.c_str()); - } - - if(!string_equal(g_pluginsDir, g_modulesDir)) - { - StringOutputStream path(256); - path << directory << g_modulesDir; - Radiant_loadModules(path.c_str()); - } -} - -//! Make COLOR_BRUSHES override worldspawn eclass colour. -void SetWorldspawnColour(const Vector3& colour) -{ - EntityClass* worldspawn = GlobalEntityClassManager().findOrInsert("worldspawn", true); - eclass_release_state(worldspawn); - worldspawn->color = colour; - eclass_capture_state(worldspawn); -} - - -class WorldspawnColourEntityClassObserver : public ModuleObserver -{ - std::size_t m_unrealised; -public: - WorldspawnColourEntityClassObserver() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - SetWorldspawnColour(g_xywindow_globals.color_brushes); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - } - } -}; - -WorldspawnColourEntityClassObserver g_WorldspawnColourEntityClassObserver; - - -ModuleObservers g_gameToolsPathObservers; - -void Radiant_attachGameToolsPathObserver(ModuleObserver& observer) -{ - g_gameToolsPathObservers.attach(observer); -} - -void Radiant_detachGameToolsPathObserver(ModuleObserver& observer) -{ - g_gameToolsPathObservers.detach(observer); -} - -void Radiant_Initialise() -{ - GlobalModuleServer_Initialise(); - Radiant_loadModulesFromRoot(AppPath_get()); - - Preferences_Load(); - - bool success = Radiant_Construct(GlobalModuleServer_get()); - ASSERT_MESSAGE(success, "module system failed to initialise - see radiant.log for error messages"); - - g_gameToolsPathObservers.realise(); - g_gameModeObservers.realise(); - g_gameNameObservers.realise(); -} - -void Radiant_Shutdown() -{ - g_gameNameObservers.unrealise(); - g_gameModeObservers.unrealise(); - g_gameToolsPathObservers.unrealise(); - - if (!g_preferences_globals.disable_ini) + if(g_bIgnoreCommands) + return; + + switch (id) { - globalOutputStream() << "Start writing prefs\n"; - Preferences_Save(); - globalOutputStream() << "Done prefs\n"; - } - - Radiant_Destroy(); - - GlobalModuleServer_Shutdown(); -} - -void Exit() -{ - if(ConfirmModified("Exit Radiant")) - { - gtk_main_quit(); + case ID_CAMERA_FORWARD: g_pParentWnd->OnCameraForward (FALSE); break; + case ID_CAMERA_BACK: g_pParentWnd->OnCameraBack (FALSE); break; + case ID_CAMERA_LEFT: g_pParentWnd->OnCameraLeft (FALSE); break; + case ID_CAMERA_RIGHT: g_pParentWnd->OnCameraRight (FALSE); break; + case ID_CAMERA_STRAFELEFT: g_pParentWnd->OnCameraStrafeleft (FALSE); break; + case ID_CAMERA_STRAFERIGHT: g_pParentWnd->OnCameraStraferight (FALSE); break; } } - -void Undo() +gint HandleCommand (GtkWidget *widget, gpointer data) { - GlobalUndoSystem().undo(); - SceneChangeNotify(); -} + int id = GPOINTER_TO_INT (data); +#ifdef DBG_KBD + Sys_Printf("HandleCommand %d\n", id); +#endif -void Redo() -{ - GlobalUndoSystem().redo(); - SceneChangeNotify(); -} - -void deleteSelection() -{ - UndoableCommand undo("deleteSelected"); - Select_Delete(); -} - -void Map_ExportSelected(TextOutputStream& ostream) -{ - Map_ExportSelected(ostream, Map_getFormat(g_map)); -} - -void Map_ImportSelected(TextInputStream& istream) -{ - Map_ImportSelected(istream, Map_getFormat(g_map)); -} - -void Selection_Copy() -{ - clipboard_copy(Map_ExportSelected); -} - -void Selection_Paste() -{ - clipboard_paste(Map_ImportSelected); -} - -void Copy() -{ - if(SelectedFaces_empty()) - { - Selection_Copy(); + if ( g_bIgnoreCommands ) { +#ifdef DBG_KBD + Sys_Printf( "g_bIgnoreCommands %d, returning FALSE\n", g_bIgnoreCommands ); +#endif + return FALSE; } - else + + if (id >= CMD_TEXTUREWAD && id <= CMD_TEXTUREWAD_END) g_pParentWnd->OnTextureWad (id); + else if (id >= CMD_BSPCOMMAND && id <= CMD_BSPCOMMAND_END) g_pParentWnd->OnBspCommand (id); + else if (id >= ID_FILE_RECENT1 && id <= ID_FILE_RECENT4) g_pParentWnd->OnMru (id); + else if (id >= ID_VIEW_NEAREST && id <= ID_TEXTURES_FLATSHADE) { - SelectedFaces_copyTexture(); + if (GTK_CHECK_MENU_ITEM (widget)->active) + g_pParentWnd->OnViewNearest (id); + } else if (id >= ID_GRID_025 && id <= ID_GRID_256) g_pParentWnd->OnGrid (id); + else if (id >= ID_PLUGIN_START && id <= ID_PLUGIN_END) + { + char *str; + gtk_label_get (GTK_LABEL (GTK_BIN (widget)->child), &str); + g_pParentWnd->OnPlugIn (id, str); + } else if (id >= ID_ENTITY_START && id <= ID_ENTITY_END) + { + char *str; + gtk_label_get (GTK_LABEL (GTK_BIN (widget)->child), &str); + g_pParentWnd->ActiveXY()->OnEntityCreate (str); } + else switch (id) + { + case ID_FILE_NEW: g_pParentWnd->OnFileNew (); break; + case ID_FILE_SLEEP: g_pParentWnd->OnSleep(); break; + case ID_FILE_OPEN: g_pParentWnd->OnFileOpen (); break; + case ID_FILE_SAVE: g_pParentWnd->OnFileSave (); break; + case ID_FILE_SAVEAS: g_pParentWnd->OnFileSaveas (); break; + case ID_FILE_EXPORTMAP: g_pParentWnd->OnFileExportmap (); break; + case ID_FILE_SAVEREGION: g_pParentWnd->OnFileSaveregion (); break; + case ID_FILE_NEWPROJECT: g_pParentWnd->OnFileNewproject (); break; + case ID_FILE_LOADPROJECT: g_pParentWnd->OnFileLoadproject (); break; + case ID_FILE_PROJECTSETTINGS: g_pParentWnd->OnFileProjectsettings (); break; + case ID_FILE_POINTFILE: g_pParentWnd->OnFilePointfile (); break; + case ID_FILE_CHECKUPDATE: g_pParentWnd->OnFileCheckUpdate (); break; + case ID_FILE_EXIT: g_pParentWnd->OnFileExit (); break; + case ID_FILE_IMPORTMAP: g_pParentWnd->OnFileImportmap (); break; + case ID_EDIT_UNDO: g_pParentWnd->OnEditUndo (); break; + case ID_EDIT_REDO: g_pParentWnd->OnEditRedo (); break; + case ID_EDIT_COPYBRUSH: g_pParentWnd->OnEditCopybrush (); break; + case ID_EDIT_PASTEBRUSH: g_pParentWnd->OnEditPastebrush (); break; + case ID_EDIT_PASTEBRUSHTOCAMERA: g_pParentWnd->OnEditPastebrushToCamera (); break; + case ID_SELECTION_DELETE: g_pParentWnd->OnSelectionDelete (); break; + case ID_EDIT_MAPINFO: g_pParentWnd->OnEditMapinfo (); break; + case ID_EDIT_ENTITYINFO: g_pParentWnd->OnEditEntityinfo (); break; + case ID_BRUSH_SCRIPTS: g_pParentWnd->OnBrushScripts (); break; + case ID_EDIT_LOADPREFAB: g_pParentWnd->OnEditLoadprefab (); break; + case ID_EDIT_SAVEPREFAB: g_pParentWnd->OnEditSaveprefab (); break; + case ID_PREFS: g_pParentWnd->OnPrefs (); break; + case ID_TOGGLECAMERA: g_pParentWnd->OnTogglecamera (); break; + case ID_TOGGLECONSOLE: g_pParentWnd->OnToggleconsole (); break; + case ID_VIEW_ENTITY: g_pParentWnd->OnViewEntity (); break; + case ID_VIEW_GROUPS: g_pParentWnd->OnViewGroups (); break; + case ID_TOGGLEVIEW: g_pParentWnd->OnToggleview (); break; + case ID_TOGGLEVIEW_YZ: g_pParentWnd->OnToggleviewYz (); break; + case ID_TOGGLEVIEW_XZ: g_pParentWnd->OnToggleviewXz (); break; + case ID_TOGGLEZ: g_pParentWnd->OnTogglez (); break; + case ID_VIEW_CENTER: g_pParentWnd->OnViewCenter (); break; + case ID_VIEW_UPFLOOR: g_pParentWnd->OnViewUpfloor (); break; + case ID_VIEW_DOWNFLOOR: g_pParentWnd->OnViewDownfloor (); break; + case ID_VIEW_CENTERVIEW: g_pParentWnd->OnViewCenterview (); break; + case ID_VIEW_NEXTVIEW: g_pParentWnd->OnViewNextview (); break; + case ID_VIEW_XY: g_pParentWnd->OnViewXy (); break; + case ID_VIEW_SIDE: g_pParentWnd->OnViewSide (); break; + case ID_VIEW_FRONT: g_pParentWnd->OnViewFront (); break; + case ID_VIEW_100: g_pParentWnd->OnView100 (); break; + case ID_VIEW_ZOOMIN: g_pParentWnd->OnViewZoomin (); break; + case ID_VIEW_ZOOMOUT: g_pParentWnd->OnViewZoomout (); break; + case ID_VIEW_Z100: g_pParentWnd->OnViewZ100 (); break; + case ID_VIEW_ZZOOMIN: g_pParentWnd->OnViewZzoomin (); break; + case ID_VIEW_ZZOOMOUT: g_pParentWnd->OnViewZzoomout (); break; + case ID_VIEW_CUBEIN: g_pParentWnd->OnViewCubein (); break; + case ID_VIEW_CUBEOUT: g_pParentWnd->OnViewCubeout (); break; + case ID_VIEW_SHOWNAMES: g_pParentWnd->OnViewShownames (); break; + case ID_VIEW_SHOWBLOCKS: g_pParentWnd->OnViewShowblocks (); break; + case ID_VIEW_SHOWCOORDINATES: g_pParentWnd->OnViewShowcoordinates (); break; + case ID_VIEW_SHOWOUTLINE: g_pParentWnd->OnViewShowOutline (); break; + case ID_VIEW_SHOWAXES: g_pParentWnd->OnViewShowAxes (); break; + case ID_VIEW_SHOWWORKZONE: g_pParentWnd->OnViewShowWorkzone (); break; + case ID_VIEW_SHOWANGLES: g_pParentWnd->OnViewShowAngles (); break; + case ID_VIEW_HIDESHOW_HIDESELECTED: g_pParentWnd->OnViewHideshowHideselected (); break; + case ID_VIEW_HIDESHOW_SHOWHIDDEN: g_pParentWnd->OnViewHideshowShowhidden (); break; + case ID_VIEW_ENTITIESAS_BOUNDINGBOX: + case ID_VIEW_ENTITIESAS_WIREFRAME: + case ID_VIEW_ENTITIESAS_SELECTEDWIREFRAME: + case ID_VIEW_ENTITIESAS_SELECTEDSKINNED: + case ID_VIEW_ENTITIESAS_SKINNED: + case ID_VIEW_ENTITIESAS_SKINNEDANDBOXED: + g_pParentWnd->OnEntitiesSetViewAs(id); + break; + case ID_VIEW_CUBICCLIPPING: g_pParentWnd->OnViewCubicclipping (); break; + case ID_VIEW_OPENGLLIGHTING: g_pParentWnd->OnViewOpengllighting (); break; + case ID_SELECTION_DRAGEDGES: g_pParentWnd->OnSelectionDragedges (); break; + case ID_SELECTION_DRAGVERTECIES: g_pParentWnd->OnSelectionDragvertecies (); break; + case ID_SELECTION_CLONE: g_pParentWnd->OnSelectionClone (); break; + case ID_SELECTION_DESELECT: g_pParentWnd->OnSelectionDeselect (); break; + case ID_BRUSH_FLIPX: g_pParentWnd->OnBrushFlipx (); break; + case ID_BRUSH_FLIPY: g_pParentWnd->OnBrushFlipy (); break; + case ID_BRUSH_FLIPZ: g_pParentWnd->OnBrushFlipz (); break; + case ID_BRUSH_ROTATEX: g_pParentWnd->OnBrushRotatex (); break; + case ID_BRUSH_ROTATEY: g_pParentWnd->OnBrushRotatey (); break; + case ID_BRUSH_ROTATEZ: g_pParentWnd->OnBrushRotatez (); break; + case ID_SELECTION_ARBITRARYROTATION: g_pParentWnd->OnSelectionArbitraryrotation (); break; + case ID_SELECT_SCALE: g_pParentWnd->OnSelectScale (); break; + case ID_SELECTION_MAKEHOLLOW: g_pParentWnd->OnSelectionMakehollow (); break; + case ID_SELECTION_CSGSUBTRACT: g_pParentWnd->OnSelectionCsgsubtract (); break; + case ID_SELECTION_CSGMERGE: g_pParentWnd->OnSelectionCsgmerge (); break; + case ID_SELECTION_NOOUTLINE: g_pParentWnd->OnSelectionNoOutline (); break; + case ID_SELECTION_OUTLINESTYLE: g_pParentWnd->OnSelectionOutlineStyle (); break; + case ID_SELECTION_SELECTCOMPLETETALL: g_pParentWnd->OnSelectionSelectcompletetall (); break; + case ID_SELECTION_SELECTTOUCHING: g_pParentWnd->OnSelectionSelecttouching (); break; + case ID_SELECTION_SELECTPARTIALTALL: g_pParentWnd->OnSelectionSelectpartialtall (); break; + case ID_SELECTION_SELECTINSIDE: g_pParentWnd->OnSelectionSelectinside (); break; + case ID_SELECTION_SELECT_NUDGELEFT: g_pParentWnd->OnSelectionSelectNudgeleft (); break; + case ID_SELECTION_SELECT_NUDGERIGHT: g_pParentWnd->OnSelectionSelectNudgeright (); break; + case ID_SELECTION_SELECT_NUDGEUP: g_pParentWnd->OnSelectionSelectNudgeup (); break; + case ID_SELECTION_SELECT_NUDGEDOWN: g_pParentWnd->OnSelectionSelectNudgedown (); break; + case ID_VIEW_CLIPPER: g_pParentWnd->OnViewClipper (); break; + case ID_CLIP_SELECTED: g_pParentWnd->OnClipSelected (); break; + case ID_SPLIT_SELECTED: g_pParentWnd->OnSplitSelected (); break; + case ID_FLIP_CLIP: g_pParentWnd->OnFlipClip (); break; + case ID_SELECTION_CONNECT: g_pParentWnd->OnSelectionConnect (); break; + case ID_SELECTION_UNGROUPENTITY: g_pParentWnd->OnSelectionUngroupentity (); break; + case ID_SELECTION_MERGE: Select_MergeEntity(); break; + case ID_SELECTION_SEPERATE: Select_Seperate(); break; + case ID_SELECTION_MAKE_DETAIL: g_pParentWnd->OnSelectionMakeDetail (); break; + case ID_SELECTION_MAKE_STRUCTURAL: g_pParentWnd->OnSelectionMakeStructural (); break; + case ID_SNAPTOGRID: g_pParentWnd->OnSnaptogrid (); break; + case ID_TEXTURES_SHOWINUSE: g_pParentWnd->OnTexturesShowinuse (); break; + case ID_TEXTURES_SHOWALL: g_pParentWnd->OnTexturesShowall (); break; + case ID_TEXTURES_INSPECTOR: g_pParentWnd->OnTexturesInspector (); break; + case ID_TEXTURE_REPLACEALL: g_pParentWnd->OnTextureReplaceall (); break; + case ID_TOGGLE_LOCK: g_pParentWnd->OnToggleLock (); break; + case ID_TOGGLE_ROTATELOCK: g_pParentWnd->OnToggleRotatelock (); break; + case ID_TEXTURES_LOAD: g_pParentWnd->OnTexturesLoad (); break; + case ID_TEXTURES_RELOADSHADERS: g_pParentWnd->OnTexturesReloadshaders (); break; + case ID_TEXTURES_SHADERS_SHOW: g_pParentWnd->OnTexturesShadersShow (); break; + case ID_TEXTURES_TEXTUREWINDOWSCALE_200: + case ID_TEXTURES_TEXTUREWINDOWSCALE_100: + case ID_TEXTURES_TEXTUREWINDOWSCALE_50: + case ID_TEXTURES_TEXTUREWINDOWSCALE_25: + case ID_TEXTURES_TEXTUREWINDOWSCALE_10: + g_pParentWnd->SetTextureScale (id); + break; + case ID_TEXTURES_LOADLIST: g_pParentWnd->OnTexturesLoadlist (); break; + case ID_TEXTURES_SHADERLISTONLY: g_pParentWnd->OnTexturesShaderlistonly (); break; + case ID_TEXTUREWINDOW_SCALEUP: g_pParentWnd->OnTexturewindowScaleup (); break; + case ID_TEXTUREWINDOW_SCALEDOWN: g_pParentWnd->OnTexturewindowScaledown (); break; + case ID_MISC_BENCHMARK: g_pParentWnd->OnMiscBenchmark (); break; + case ID_COLOR_SETORIGINAL: g_pParentWnd->OnColorSetoriginal (); break; + case ID_COLOR_SETQER: g_pParentWnd->OnColorSetqer (); break; + case ID_COLOR_SETBLACK: g_pParentWnd->OnColorSetblack (); break; + case ID_COLOR_SETYDNAR: g_pParentWnd->OnColorSetydnar (); break; /* ydnar */ + case ID_TEXTUREBK: g_pParentWnd->OnTexturebk (); break; + case ID_COLORS_XYBK: g_pParentWnd->OnColorsXybk (); break; + case ID_COLORS_MAJOR: g_pParentWnd->OnColorsMajor (); break; + case ID_COLORS_MINOR: g_pParentWnd->OnColorsMinor (); break; + case ID_COLORS_GRIDTEXT: g_pParentWnd->OnColorsGridtext (); break; + case ID_COLORS_GRIDBLOCK: g_pParentWnd->OnColorsGridblock (); break; + case ID_COLORS_CAMERABACK: g_pParentWnd->OnColorsCameraBack (); break; + case ID_COLORS_BRUSH: g_pParentWnd->OnColorsBrush (); break; + case ID_COLORS_SELECTEDBRUSH: g_pParentWnd->OnColorsSelectedbrush (); break; + case ID_COLORS_SELECTEDBRUSH3D: g_pParentWnd->OnColorsSelectedbrush3D (); break; + case ID_COLORS_CLIPPER: g_pParentWnd->OnColorsClipper (); break; + case ID_COLORS_VIEWNAME: g_pParentWnd->OnColorsViewname (); break; + case ID_MISC_GAMMA: g_pParentWnd->OnMiscGamma (); break; + case ID_MISC_FINDBRUSH: g_pParentWnd->OnMiscFindbrush (); break; + case ID_MISC_NEXTLEAKSPOT: g_pParentWnd->OnMiscNextleakspot (); break; + case ID_MISC_PREVIOUSLEAKSPOT: g_pParentWnd->OnMiscPreviousleakspot (); break; + case ID_MISC_PRINTXY: g_pParentWnd->OnMiscPrintxy (); break; + case ID_MISC_SELECTENTITYCOLOR: g_pParentWnd->OnMiscSelectentitycolor (); break; + case ID_CONVERTCURVES: g_pParentWnd->OnConvertcurves (); break; + case ID_REGION_OFF: g_pParentWnd->OnRegionOff (); break; + case ID_REGION_SETXY: g_pParentWnd->OnRegionSetxy (); break; + case ID_REGION_SETTALLBRUSH: g_pParentWnd->OnRegionSettallbrush (); break; + case ID_REGION_SETBRUSH: g_pParentWnd->OnRegionSetbrush (); break; + case ID_REGION_SETSELECTION: g_pParentWnd->OnRegionSetselection (); break; + case ID_BRUSH_3SIDED: g_pParentWnd->OnBrush3sided (); break; + case ID_BRUSH_4SIDED: g_pParentWnd->OnBrush4sided (); break; + case ID_BRUSH_5SIDED: g_pParentWnd->OnBrush5sided (); break; + case ID_BRUSH_6SIDED: g_pParentWnd->OnBrush6sided (); break; + case ID_BRUSH_7SIDED: g_pParentWnd->OnBrush7sided (); break; + case ID_BRUSH_8SIDED: g_pParentWnd->OnBrush8sided (); break; + case ID_BRUSH_9SIDED: g_pParentWnd->OnBrush9sided (); break; + case ID_BRUSH_ARBITRARYSIDED: g_pParentWnd->OnBrushArbitrarysided (); break; + case ID_BRUSH_MAKECONE: g_pParentWnd->OnBrushMakecone (); break; + case ID_BRUSH_PRIMITIVES_SPHERE: g_pParentWnd->OnBrushPrimitivesSphere (); break; + case ID_CURVE_PATCHTUBE: g_pParentWnd->OnCurvePatchtube (); break; + case ID_CURVE_PATCHDENSETUBE: g_pParentWnd->OnCurvePatchdensetube (); break; + case ID_CURVE_PATCHVERYDENSETUBE: g_pParentWnd->OnCurvePatchverydensetube (); break; + case ID_CURVE_PATCHSQUARE: g_pParentWnd->OnCurvePatchsquare (); break; + case ID_CURVE_PATCHENDCAP: g_pParentWnd->OnCurvePatchendcap (); break; + case ID_CURVE_PATCHBEVEL: g_pParentWnd->OnCurvePatchbevel (); break; + case ID_CURVE_MOREENDCAPSBEVELS_SQUAREBEVEL: g_pParentWnd->OnCurveMoreendcapsbevelsSquarebevel (); break; + case ID_CURVE_MOREENDCAPSBEVELS_SQUAREENDCAP: g_pParentWnd->OnCurveMoreendcapsbevelsSquareendcap();break; + case ID_CURVE_PATCHCONE: g_pParentWnd->OnCurvePatchcone (); break; + case ID_CURVE_SIMPLEPATCHMESH: g_pParentWnd->OnCurveSimplepatchmesh (); break; + case ID_CURVE_INSERT_INSERTCOLUMN: g_pParentWnd->OnCurveInsertInsertcolumn (); break; + case ID_CURVE_INSERT_ADDCOLUMN: g_pParentWnd->OnCurveInsertAddcolumn (); break; + case ID_CURVE_INSERT_INSERTROW: g_pParentWnd->OnCurveInsertInsertrow (); break; + case ID_CURVE_INSERT_ADDROW: g_pParentWnd->OnCurveInsertAddrow (); break; + case ID_CURVE_DELETE_FIRSTCOLUMN: g_pParentWnd->OnCurveDeleteFirstcolumn (); break; + case ID_CURVE_DELETE_LASTCOLUMN: g_pParentWnd->OnCurveDeleteLastcolumn (); break; + case ID_CURVE_DELETE_FIRSTROW: g_pParentWnd->OnCurveDeleteFirstrow (); break; + case ID_CURVE_DELETE_LASTROW: g_pParentWnd->OnCurveDeleteLastrow (); break; + case ID_CURVE_NEGATIVE: g_pParentWnd->OnCurveNegative (); break; + case ID_CURVE_REDISPERSE_ROWS: g_pParentWnd->OnCurveRedisperseRows (); break; + case ID_CURVE_REDISPERSE_INTERMEDIATE_COLS: g_pParentWnd->OnCurveRedisperseIntermediateCols (); break; + case ID_CURVE_REDISPERSE_INTERMEDIATE_ROWS: g_pParentWnd->OnCurveRedisperseIntermediateRows (); break; + case ID_CURVE_MATRIX_TRANSPOSE: g_pParentWnd->OnCurveMatrixTranspose (); break; + case ID_CURVE_CAP: g_pParentWnd->OnCurveCap (); break; + case ID_CURVE_CYCLECAP: g_pParentWnd->OnCurveCyclecap (); break; + case ID_CURVE_OVERLAY_SET: g_pParentWnd->OnCurveOverlaySet (); break; + case ID_CURVE_OVERLAY_CLEAR: g_pParentWnd->OnCurveOverlayClear (); break; + case ID_CURVE_THICKEN: g_pParentWnd->OnCurveThicken (); break; + case ID_PLUGINS_REFRESH: g_pParentWnd->OnPluginsRefresh (); break; + case ID_HELP: g_pParentWnd->OnHelp (); break; + case ID_HELP_LINKS: g_pParentWnd->OnHelpLinks(); break; + case ID_HELP_BUGREPORT: g_pParentWnd->OnHelpBugreport(); break; + case ID_HELP_COMMANDLIST: g_pParentWnd->OnHelpCommandlist (); break; + case ID_HELP_ABOUT: g_pParentWnd->OnHelpAbout (); break; + case ID_DONTSELECTMODEL: g_pParentWnd->OnDontselectmodel (); break; + case ID_FILTER_AREAPORTALS: g_pParentWnd->OnFilterAreaportals (); break; + case ID_FILTER_CAULK: g_pParentWnd->OnFilterCaulk (); break; + case ID_FILTER_STRUCTURAL: g_pParentWnd->OnFilterStructural (); break; + case ID_FILTER_CLIPS: g_pParentWnd->OnFilterClips (); break; + case ID_FILTER_BOTCLIPS: g_pParentWnd->OnFilterBotClips (); break; + case ID_FILTER_DETAILS: g_pParentWnd->OnFilterDetails (); break; + case ID_FILTER_ENTITIES: g_pParentWnd->OnFilterEntities (); break; + case ID_FILTER_HINTSSKIPS: g_pParentWnd->OnFilterHintsskips (); break; + case ID_FILTER_LIGHTS: g_pParentWnd->OnFilterLights (); break; + case ID_FILTER_LIQUIDS: g_pParentWnd->OnFilterLiquids (); break; + case ID_FILTER_MODELS: g_pParentWnd->OnFilterModels (); break; + case ID_FILTER_PATCHES: g_pParentWnd->OnFilterPatches (); break; + case ID_FILTER_TRANSLUCENT: g_pParentWnd->OnFilterTranslucent (); break; + case ID_FILTER_TRIGGERS: g_pParentWnd->OnFilterTriggers (); break; + case ID_FILTER_WORLD: g_pParentWnd->OnFilterWorld (); break; + case ID_FILTER_PATHS: g_pParentWnd->OnFilterPaths (); break; + case ID_FILTER_CLUSTERPORTALS: g_pParentWnd->OnFilterClusterportals (); break; + case ID_FILTER_LIGHTGRID: g_pParentWnd->OnFilterLightgrid (); break; + + case ID_POPUP_SELECTION: g_pParentWnd->OnPopupSelection (); break; + case ID_VIEW_CHANGE: g_pParentWnd->OnViewChange (); break; + case ID_TEXTURES_POPUP: g_pParentWnd->OnTexturesPopup (); break; + case ID_VIEW_CAMERATOGGLE: g_pParentWnd->ToggleCamera (); break; + case ID_VIEW_CAMERAUPDATE: g_pParentWnd->OnViewCameraupdate (); break; + case ID_SELECT_MOUSEROTATE: g_pParentWnd->OnSelectMouserotate (); break; + case ID_SELECT_MOUSESCALE: g_pParentWnd->OnSelectMousescale (); break; + case ID_SCALELOCKX: g_pParentWnd->OnScalelockx (); break; + case ID_SCALELOCKY: g_pParentWnd->OnScalelocky (); break; + case ID_SCALELOCKZ: g_pParentWnd->OnScalelockz (); break; + case ID_DONTSELECTCURVE: g_pParentWnd->OnDontselectcurve (); break; + case ID_PATCH_SHOWBOUNDINGBOX: g_pParentWnd->OnPatchToggleBox (); break; + case ID_PATCH_WIREFRAME: g_pParentWnd->OnPatchWireframe (); break; + case ID_PATCH_BEND: g_pParentWnd->OnPatchBend (); break; + case ID_PATCH_WELD: g_pParentWnd->OnPatchWeld (); break; + case ID_PATCH_DRILLDOWN: g_pParentWnd->OnPatchDrilldown (); break; + case ID_DROP_GROUP_NAME: g_pParentWnd->OnDropGroupName (); break; + case ID_DROP_GROUP_NEWGROUP: g_pParentWnd->OnDropGroupNewgroup (); break; + case ID_DROP_GROUP_REMOVE: g_pParentWnd->OnDropGroupRemove (); break; + case ID_SHOW_ENTITIES: g_pParentWnd->OnShowEntities (); break; + + case IDC_BTN_FACEFIT: g_pParentWnd->OnFaceFit (); break; + case ID_VIEW_TEXTURE: g_pParentWnd->OnViewTexture (); break; + case ID_PATCH_INSPECTOR: g_pParentWnd->OnPatchInspector (); break; + case ID_CURVE_NEGATIVETEXTUREX: g_pParentWnd->OnCurveNegativeTextureX (); break; + case ID_CURVE_NEGATIVETEXTUREY: g_pParentWnd->OnCurveNegativeTextureY (); break; + case ID_CURVE_INSERTCOLUMN: g_pParentWnd->OnCurveInsertcolumn (); break; + case ID_CURVE_INSERTROW: g_pParentWnd->OnCurveInsertrow (); break; + case ID_CURVE_DELETECOLUMN: g_pParentWnd->OnCurveDeletecolumn (); break; + case ID_CURVE_DELETEROW: g_pParentWnd->OnCurveDeleterow (); break; + case ID_PATCH_TAB: g_pParentWnd->OnPatchTab (); break; + case ID_CAMERA_FORWARD: g_pParentWnd->OnCameraForward (TRUE); break; + case ID_CAMERA_BACK: g_pParentWnd->OnCameraBack (TRUE); break; + case ID_CAMERA_LEFT: g_pParentWnd->OnCameraLeft (TRUE); break; + case ID_CAMERA_RIGHT: g_pParentWnd->OnCameraRight (TRUE); break; + case ID_CAMERA_UP: g_pParentWnd->OnCameraUp (); break; + case ID_CAMERA_DOWN: g_pParentWnd->OnCameraDown (); break; + case ID_CAMERA_ANGLEUP: g_pParentWnd->OnCameraAngleup (); break; + case ID_CAMERA_ANGLEDOWN: g_pParentWnd->OnCameraAngledown (); break; + case ID_CAMERA_STRAFELEFT: g_pParentWnd->OnCameraStrafeleft (TRUE); break; + case ID_CAMERA_STRAFERIGHT: g_pParentWnd->OnCameraStraferight (TRUE); break; + case ID_GRID_TOGGLE: g_pParentWnd->OnGridToggle (); break; + case ID_VIEW_CONSOLE: g_pParentWnd->OnViewConsole (); break; + case ID_VIEW_CROSSHAIR: g_pParentWnd->OnViewCrosshair (); break; + case ID_SELECTION_TEXTURE_FIT: g_pParentWnd->OnSelectionTextureFit (); break; + case ID_SELECTION_TEXTURE_ROTATECLOCK: g_pParentWnd->OnSelectionTextureRotateclock (); break; + case ID_SELECTION_TEXTURE_ROTATECOUNTER: g_pParentWnd->OnSelectionTextureRotatecounter (); break; + case ID_SELECTION_TEXTURE_SCALEUP: g_pParentWnd->OnSelectionTextureScaleup (); break; + case ID_SELECTION_TEXTURE_SCALEDOWN: g_pParentWnd->OnSelectionTextureScaledown (); break; + case ID_SELECTION_TEXTURE_SHIFTLEFT: g_pParentWnd->OnSelectionTextureShiftleft (); break; + case ID_SELECTION_TEXTURE_SHIFTRIGHT: g_pParentWnd->OnSelectionTextureShiftright (); break; + case ID_SELECTION_TEXTURE_SHIFTUP: g_pParentWnd->OnSelectionTextureShiftup (); break; + case ID_SELECTION_TEXTURE_SHIFTDOWN: g_pParentWnd->OnSelectionTextureShiftdown (); break; + case ID_GRID_PREV: g_pParentWnd->OnGridPrev (); break; + case ID_GRID_NEXT: g_pParentWnd->OnGridNext (); break; + case ID_SELECTION_TEXTURE_SCALELEFT: g_pParentWnd->OnSelectionTextureScaleLeft (); break; + case ID_SELECTION_TEXTURE_SCALERIGHT: g_pParentWnd->OnSelectionTextureScaleRight (); break; + case ID_SELECTION_MOVEDOWN: g_pParentWnd->OnSelectionMovedown (); break; + case ID_SELECTION_MOVEUP: g_pParentWnd->OnSelectionMoveup (); break; + case ID_SELECTION_PRINT: g_pParentWnd->OnSelectionPrint (); break; + case ID_SELECTION_TOGGLESIZEPAINT: g_pParentWnd->OnSelectionTogglesizepaint (); break; + case ID_PATCH_NATURALIZE: g_pParentWnd->OnPatchNaturalize (); break; + case ID_SELECT_SNAPTOGRID: g_pParentWnd->OnSnapToGrid (); break; + case ID_SELECT_ALL: g_pParentWnd->OnSelectAll (); break; + case ID_SELECTION_INVERT: g_pParentWnd->OnSelectionInvert (); break; + } + + return TRUE; } -void Paste() +static gint timer (gpointer data) { - if(SelectedFaces_empty()) + MainFrame *wnd = (MainFrame*)data; + wnd->OnTimer (); + return TRUE; +} + +static gint mainframe_delete (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + MainFrame *wnd = (MainFrame*)data; + + wnd->OnDelete(); + + if (ConfirmModified()) + return FALSE; + + g_qeglobals_gui.d_edit = NULL; + + return TRUE; +} + +static void mainframe_destroy (GtkWidget *widget, gpointer data) +{ + MainFrame *wnd = (MainFrame*)data; + + // avoid saving prefs when the app is minimized + if (g_pParentWnd->IsSleeping()) { - UndoableCommand undo("paste"); + Sys_Printf("Shutdown while sleeping, not saving prefs\n"); + g_qeglobals.disable_ini = true; + } + + // NOTE TTimo this is very clumsy, in MainFrame::OnDestroy we might call SavePrefs again + // we will do more stuff in OnDestroy for window position saving too, so I guess this call is still relevant? + g_PrefsDlg.SavePrefs (); + + wnd->OnDestroy (); + + // shutdown modules + // NOTE: I've decided to do this before SavePrefs in case we broadcast some shutdown info + // and modules / plugins decide to save some stuff + g_pParentWnd->GetPlugInMgr().Shutdown(); - GlobalSelectionSystem().setSelectedAll(false); - Selection_Paste(); - } - else - { - SelectedFaces_pasteTexture(); - } + delete wnd; + + QGL_Shutdown(); + g_PrefsDlg.Destroy (); + g_dlgSurface.Destroy (); + g_dlgFind.Destroy (); + g_PatchDialog.Destroy (); + + gtk_main_quit (); } -void PasteToCamera() +static gint mainframe_keypress (GtkWidget* widget, GdkEventKey* event, gpointer data) { - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - GlobalSelectionSystem().setSelectedAll(false); + unsigned int code = gdk_keyval_to_upper(event->keyval); + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=924 + if(code == GDK_ISO_Left_Tab) { + code = GDK_Tab; + } - UndoableCommand undo("pasteToCamera"); - - Selection_Paste(); - - // Work out the delta - Vector3 mid; - Select_GetMid(mid); - Vector3 delta = vector3_subtracted(vector3_snapped(Camera_getOrigin(camwnd), GetGridSize()), mid); - - // Move to camera - GlobalSelectionSystem().translateSelected(delta); -} - - -void ColorScheme_Original() -{ - TextureBrowser_setBackgroundColour(GlobalTextureBrowser(), Vector3(0.25f, 0.25f, 0.25f)); - - g_camwindow_globals.color_selbrushes3d = Vector3(1.0f, 0.0f, 0.0f); - g_camwindow_globals.color_cameraback = Vector3(0.25f, 0.25f, 0.25f); - CamWnd_Update(*g_pParentWnd->GetCamWnd()); - - g_xywindow_globals.color_gridback = Vector3(1.0f, 1.0f, 1.0f); - g_xywindow_globals.color_gridminor = Vector3(0.75f, 0.75f, 0.75f); - g_xywindow_globals.color_gridmajor = Vector3(0.5f, 0.5f, 0.5f); - g_xywindow_globals.color_gridminor_alt = Vector3(0.5f, 0.0f, 0.0f); - g_xywindow_globals.color_gridmajor_alt = Vector3(1.0f, 0.0f, 0.0f); - g_xywindow_globals.color_gridblock = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_gridtext = Vector3(0.0f, 0.0f, 0.0f); - g_xywindow_globals.color_selbrushes = Vector3(1.0f, 0.0f, 0.0f); - g_xywindow_globals.color_clipper = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_brushes = Vector3(0.0f, 0.0f, 0.0f); - SetWorldspawnColour(g_xywindow_globals.color_brushes); - g_xywindow_globals.color_viewname = Vector3(0.5f, 0.0f, 0.75f); - XY_UpdateAllWindows(); -} - -void ColorScheme_QER() -{ - TextureBrowser_setBackgroundColour(GlobalTextureBrowser(), Vector3(0.25f, 0.25f, 0.25f)); - - g_camwindow_globals.color_cameraback = Vector3(0.25f, 0.25f, 0.25f); - g_camwindow_globals.color_selbrushes3d = Vector3(1.0f, 0.0f, 0.0f); - CamWnd_Update(*g_pParentWnd->GetCamWnd()); - - g_xywindow_globals.color_gridback = Vector3(1.0f, 1.0f, 1.0f); - g_xywindow_globals.color_gridminor = Vector3(1.0f, 1.0f, 1.0f); - g_xywindow_globals.color_gridmajor = Vector3(0.5f, 0.5f, 0.5f); - g_xywindow_globals.color_gridblock = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_gridtext = Vector3(0.0f, 0.0f, 0.0f); - g_xywindow_globals.color_selbrushes = Vector3(1.0f, 0.0f, 0.0f); - g_xywindow_globals.color_clipper = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_brushes = Vector3(0.0f, 0.0f, 0.0f); - SetWorldspawnColour(g_xywindow_globals.color_brushes); - g_xywindow_globals.color_viewname = Vector3(0.5f, 0.0f, 0.75f); - XY_UpdateAllWindows(); -} - -void ColorScheme_Black() -{ - TextureBrowser_setBackgroundColour(GlobalTextureBrowser(), Vector3(0.25f, 0.25f, 0.25f)); - - g_camwindow_globals.color_cameraback = Vector3(0.25f, 0.25f, 0.25f); - g_camwindow_globals.color_selbrushes3d = Vector3(1.0f, 0.0f, 0.0f); - CamWnd_Update(*g_pParentWnd->GetCamWnd()); - - g_xywindow_globals.color_gridback = Vector3(0.0f, 0.0f, 0.0f); - g_xywindow_globals.color_gridminor = Vector3(0.2f, 0.2f, 0.2f); - g_xywindow_globals.color_gridmajor = Vector3(0.3f, 0.5f, 0.5f); - g_xywindow_globals.color_gridblock = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_gridtext = Vector3(1.0f, 1.0f, 1.0f); - g_xywindow_globals.color_selbrushes = Vector3(1.0f, 0.0f, 0.0f); - g_xywindow_globals.color_clipper = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_brushes = Vector3(1.0f, 1.0f, 1.0f); - SetWorldspawnColour(g_xywindow_globals.color_brushes); - g_xywindow_globals.color_viewname = Vector3(0.7f, 0.7f, 0.0f); - XY_UpdateAllWindows(); -} - -/* ydnar: to emulate maya/max/lightwave color schemes */ -void ColorScheme_Ydnar() -{ - TextureBrowser_setBackgroundColour(GlobalTextureBrowser(), Vector3(0.25f, 0.25f, 0.25f)); - - g_camwindow_globals.color_cameraback = Vector3(0.25f, 0.25f, 0.25f); - g_camwindow_globals.color_selbrushes3d = Vector3(1.0f, 0.0f, 0.0f); - CamWnd_Update(*g_pParentWnd->GetCamWnd()); - - g_xywindow_globals.color_gridback = Vector3(0.77f, 0.77f, 0.77f); - g_xywindow_globals.color_gridminor = Vector3(0.83f, 0.83f, 0.83f); - g_xywindow_globals.color_gridmajor = Vector3(0.89f, 0.89f, 0.89f); - g_xywindow_globals.color_gridblock = Vector3(1.0f, 1.0f, 1.0f); - g_xywindow_globals.color_gridtext = Vector3(0.0f, 0.0f, 0.0f); - g_xywindow_globals.color_selbrushes = Vector3(1.0f, 0.0f, 0.0f); - g_xywindow_globals.color_clipper = Vector3(0.0f, 0.0f, 1.0f); - g_xywindow_globals.color_brushes = Vector3(0.0f, 0.0f, 0.0f); - SetWorldspawnColour(g_xywindow_globals.color_brushes); - g_xywindow_globals.color_viewname = Vector3(0.5f, 0.0f, 0.75f); - XY_UpdateAllWindows(); -} - -typedef Callback1 GetColourCallback; -typedef Callback1 SetColourCallback; - -class ChooseColour -{ - GetColourCallback m_get; - SetColourCallback m_set; -public: - ChooseColour(const GetColourCallback& get, const SetColourCallback& set) - : m_get(get), m_set(set) - { - } - void operator()() - { - Vector3 colour; - m_get(colour); - color_dialog(GTK_WIDGET(MainFrame_getWindow()), colour); - m_set(colour); - } -}; - - - -void Colour_get(const Vector3& colour, Vector3& other) -{ - other = colour; -} -typedef ConstReferenceCaller1 ColourGetCaller; - -void Colour_set(Vector3& colour, const Vector3& other) -{ - colour = other; - SceneChangeNotify(); -} -typedef ReferenceCaller1 ColourSetCaller; - -void BrushColour_set(const Vector3& other) -{ - g_xywindow_globals.color_brushes = other; - SetWorldspawnColour(g_xywindow_globals.color_brushes); - SceneChangeNotify(); -} -typedef FreeCaller1 BrushColourSetCaller; - -void ClipperColour_set(const Vector3& other) -{ - g_xywindow_globals.color_clipper = other; - Brush_clipperColourChanged(); - SceneChangeNotify(); -} -typedef FreeCaller1 ClipperColourSetCaller; - -void TextureBrowserColour_get(Vector3& other) -{ - other = TextureBrowser_getBackgroundColour(GlobalTextureBrowser()); -} -typedef FreeCaller1 TextureBrowserColourGetCaller; - -void TextureBrowserColour_set(const Vector3& other) -{ - TextureBrowser_setBackgroundColour(GlobalTextureBrowser(), other); -} -typedef FreeCaller1 TextureBrowserColourSetCaller; - - -class ColoursMenu -{ -public: - ChooseColour m_textureback; - ChooseColour m_xyback; - ChooseColour m_gridmajor; - ChooseColour m_gridminor; - ChooseColour m_gridmajor_alt; - ChooseColour m_gridminor_alt; - ChooseColour m_gridtext; - ChooseColour m_gridblock; - ChooseColour m_cameraback; - ChooseColour m_brush; - ChooseColour m_selectedbrush; - ChooseColour m_selectedbrush3d; - ChooseColour m_clipper; - ChooseColour m_viewname; - - ColoursMenu() : - m_textureback(TextureBrowserColourGetCaller(), TextureBrowserColourSetCaller()), - m_xyback(ColourGetCaller(g_xywindow_globals.color_gridback), ColourSetCaller(g_xywindow_globals.color_gridback)), - m_gridmajor(ColourGetCaller(g_xywindow_globals.color_gridmajor), ColourSetCaller(g_xywindow_globals.color_gridmajor)), - m_gridminor(ColourGetCaller(g_xywindow_globals.color_gridminor), ColourSetCaller(g_xywindow_globals.color_gridminor)), - m_gridmajor_alt(ColourGetCaller(g_xywindow_globals.color_gridmajor_alt), ColourSetCaller(g_xywindow_globals.color_gridmajor_alt)), - m_gridminor_alt(ColourGetCaller(g_xywindow_globals.color_gridminor_alt), ColourSetCaller(g_xywindow_globals.color_gridminor_alt)), - m_gridtext(ColourGetCaller(g_xywindow_globals.color_gridtext), ColourSetCaller(g_xywindow_globals.color_gridtext)), - m_gridblock(ColourGetCaller(g_xywindow_globals.color_gridblock), ColourSetCaller(g_xywindow_globals.color_gridblock)), - m_cameraback(ColourGetCaller(g_camwindow_globals.color_cameraback), ColourSetCaller(g_camwindow_globals.color_cameraback)), - m_brush(ColourGetCaller(g_xywindow_globals.color_brushes), BrushColourSetCaller()), - m_selectedbrush(ColourGetCaller(g_xywindow_globals.color_selbrushes), ColourSetCaller(g_xywindow_globals.color_selbrushes)), - m_selectedbrush3d(ColourGetCaller(g_camwindow_globals.color_selbrushes3d), ColourSetCaller(g_camwindow_globals.color_selbrushes3d)), - m_clipper(ColourGetCaller(g_xywindow_globals.color_clipper), ClipperColourSetCaller()), - m_viewname(ColourGetCaller(g_xywindow_globals.color_viewname), ColourSetCaller(g_xywindow_globals.color_viewname)) - { - } -}; - -ColoursMenu g_ColoursMenu; - -GtkMenuItem* create_colours_menu() -{ - GtkMenuItem* colours_menu_item = new_sub_menu_item_with_mnemonic("Colors"); - GtkMenu* menu_in_menu = GTK_MENU(gtk_menu_item_get_submenu(colours_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - - GtkMenu* menu_3 = create_sub_menu_with_mnemonic(menu_in_menu, "Themes"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_3); - - create_menu_item_with_mnemonic(menu_3, "QE4 Original", "ColorSchemeOriginal"); - create_menu_item_with_mnemonic(menu_3, "Q3Radiant Original", "ColorSchemeQER"); - create_menu_item_with_mnemonic(menu_3, "Black and Green", "ColorSchemeBlackAndGreen"); - create_menu_item_with_mnemonic(menu_3, "Maya/Max/Lightwave Emulation", "ColorSchemeYdnar"); - - menu_separator(menu_in_menu); - - create_menu_item_with_mnemonic(menu_in_menu, "_Texture Background...", "ChooseTextureBackgroundColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Background...", "ChooseGridBackgroundColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Major...", "ChooseGridMajorColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Minor...", "ChooseGridMinorColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Major Small...", "ChooseSmallGridMajorColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Minor Small...", "ChooseSmallGridMinorColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Text...", "ChooseGridTextColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Grid Block...", "ChooseGridBlockColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Default Brush...", "ChooseBrushColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Camera Background...", "ChooseCameraBackgroundColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Selected Brush...", "ChooseSelectedBrushColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Selected Brush (Camera)...", "ChooseCameraSelectedBrushColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Clipper...", "ChooseClipperColor"); - create_menu_item_with_mnemonic(menu_in_menu, "Active View name...", "ChooseOrthoViewNameColor"); - - return colours_menu_item; -} - - -void Restart() -{ - PluginsMenu_clear(); - PluginToolbar_clear(); - - Radiant_Shutdown(); - Radiant_Initialise(); - - PluginsMenu_populate(); - - PluginToolbar_populate(); -} - - -void thunk_OnSleep() -{ - g_pParentWnd->OnSleep(); -} - -void OpenUpdateURL() -{ - // build the URL - StringOutputStream URL(256); - URL << "http://www.qeradiant.com/index.php?data=dlupdate&query_dlup=1"; -#ifdef WIN32 - URL << "&OS_dlup=1"; -#else - URL << "&OS_dlup=2"; -#endif - URL << "&Version_dlup=" RADIANT_VERSION; - g_GamesDialog.AddPacksURL(URL); - OpenURL(URL.c_str()); -} - -// open the Q3Rad manual -void OpenHelpURL() -{ - // at least on win32, AppPath + "Q3Rad_Manual/index.htm" - StringOutputStream help(256); - help << AppPath_get() << "Q3Rad_Manual/index.htm"; - OpenURL(help.c_str()); -} - -void OpenBugReportURL() -{ - OpenURL("http://www.qeradiant.com/?data=bugreport"); -} - - -GtkWidget* g_page_console; - -void Console_ToggleShow() -{ - GroupDialog_showPage(g_page_console); -} - -GtkWidget* g_page_entity; - -void EntityInspector_ToggleShow() -{ - GroupDialog_showPage(g_page_entity); -} - - - -void SetClipMode(bool enable); -void ModeChangeNotify(); - -typedef void(*ToolMode)(); -ToolMode g_currentToolMode = 0; -bool g_currentToolModeSupportsComponentEditing = false; -ToolMode g_defaultToolMode = 0; - - - -void SelectionSystem_DefaultMode() -{ - GlobalSelectionSystem().SetMode(SelectionSystem::ePrimitive); - GlobalSelectionSystem().SetComponentMode(SelectionSystem::eDefault); - ModeChangeNotify(); -} - - -bool EdgeMode() -{ - return GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eEdge; -} - -bool VertexMode() -{ - return GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex; -} - -bool FaceMode() -{ - return GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace; -} - -template -class BoolFunctionExport -{ -public: - static void apply(const BoolImportCallback& importCallback) - { - importCallback(BoolFunction()); - } -}; - -typedef FreeCaller1::apply> EdgeModeApplyCaller; -EdgeModeApplyCaller g_edgeMode_button_caller; -BoolExportCallback g_edgeMode_button_callback(g_edgeMode_button_caller); -ToggleItem g_edgeMode_button(g_edgeMode_button_callback); - -typedef FreeCaller1::apply> VertexModeApplyCaller; -VertexModeApplyCaller g_vertexMode_button_caller; -BoolExportCallback g_vertexMode_button_callback(g_vertexMode_button_caller); -ToggleItem g_vertexMode_button(g_vertexMode_button_callback); - -typedef FreeCaller1::apply> FaceModeApplyCaller; -FaceModeApplyCaller g_faceMode_button_caller; -BoolExportCallback g_faceMode_button_callback(g_faceMode_button_caller); -ToggleItem g_faceMode_button(g_faceMode_button_callback); - -void ComponentModeChanged() -{ - g_edgeMode_button.update(); - g_vertexMode_button.update(); - g_faceMode_button.update(); -} - -void ComponentMode_SelectionChanged(const Selectable& selectable) -{ - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && GlobalSelectionSystem().countSelected() == 0) - { - SelectionSystem_DefaultMode(); - ComponentModeChanged(); - } -} - -void SelectEdgeMode() -{ -#if 0 - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - GlobalSelectionSystem().Select(false); - } +#ifdef DBG_KBD + Sys_Printf("key: %d (keyval: %d) (ctrl: %d)\n", code, event->keyval, event->state & GDK_CONTROL_MASK); #endif - if(EdgeMode()) - { - SelectionSystem_DefaultMode(); - } - else if(GlobalSelectionSystem().countSelected() != 0) - { - if(!g_currentToolModeSupportsComponentEditing) - { - g_defaultToolMode(); - } + // BUG: http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=865 + // return only if Texture Viewport is in main window, otherwise if Tex viewport is in it's own window + // the Filter GtkEntry won't release focus + if ( g_pParentWnd->GetTexWnd()->m_pFilter == gtk_window_get_focus(GTK_WINDOW(widget)) ) + if ( gtk_widget_is_focus( g_pParentWnd->GetTexWnd()->m_pFilter ) ) + return FALSE; - GlobalSelectionSystem().SetMode(SelectionSystem::eComponent); - GlobalSelectionSystem().SetComponentMode(SelectionSystem::eEdge); - } - - ComponentModeChanged(); - - ModeChangeNotify(); -} - -void SelectVertexMode() -{ -#if 0 - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - GlobalSelectionSystem().Select(false); - } +#ifdef DBG_KBD + Sys_Printf("mainframe_keypress processing into a command\n"); #endif - - if(VertexMode()) + for (int i = 0; i < g_nCommandCount; i++) { - SelectionSystem_DefaultMode(); - } - else if(GlobalSelectionSystem().countSelected() != 0) - { - if(!g_currentToolModeSupportsComponentEditing) + if (g_Commands[i].m_nKey == code) // find a match? { - g_defaultToolMode(); - } - - GlobalSelectionSystem().SetMode(SelectionSystem::eComponent); - GlobalSelectionSystem().SetComponentMode(SelectionSystem::eVertex); - } - - ComponentModeChanged(); - - ModeChangeNotify(); -} - -void SelectFaceMode() -{ -#if 0 - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - GlobalSelectionSystem().Select(false); - } -#endif - - if(FaceMode()) - { - SelectionSystem_DefaultMode(); - } - else if(GlobalSelectionSystem().countSelected() != 0) - { - if(!g_currentToolModeSupportsComponentEditing) - { - g_defaultToolMode(); - } - - GlobalSelectionSystem().SetMode(SelectionSystem::eComponent); - GlobalSelectionSystem().SetComponentMode(SelectionSystem::eFace); - } - - ComponentModeChanged(); - - ModeChangeNotify(); -} - - -class CloneSelected : public scene::Graph::Walker -{ -public: - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.size() == 1) - return true; - - if(!path.top().get().isRoot()) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) + // check modifiers + unsigned int nState = 0; + if (Sys_AltDown ()) + nState |= RAD_ALT; + if ((event->state & GDK_CONTROL_MASK) != 0) + nState |= RAD_CONTROL; + if ((event->state & GDK_SHIFT_MASK) != 0) + nState |= RAD_SHIFT; + if ((g_Commands[i].m_nModifiers & 0x7) == nState) { - return false; + HandleCommand (NULL, GINT_TO_POINTER (g_Commands[i].m_nCommand)); + gtk_signal_emit_stop_by_name (GTK_OBJECT(widget), "key_press_event"); + return FALSE; } } - - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(path.size() == 1) - return; - - if(!path.top().get().isRoot()) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) - { - NodeSmartReference clone(Node_Clone(path.top())); - Map_gatherNamespaced(clone); - Node_getTraversable(path.parent().get())->insert(clone); - } - } - } -}; - -void Scene_Clone_Selected(scene::Graph& graph) -{ - graph.traverse(CloneSelected()); - - Map_mergeClonedNames(); -} - -enum ENudgeDirection -{ - eNudgeUp = 1, - eNudgeDown = 3, - eNudgeLeft = 0, - eNudgeRight = 2, -}; - -struct AxisBase -{ - Vector3 x; - Vector3 y; - Vector3 z; - AxisBase(const Vector3& x_, const Vector3& y_, const Vector3& z_) - : x(x_), y(y_), z(z_) - { - } -}; - -AxisBase AxisBase_forViewType(VIEWTYPE viewtype) -{ - switch(viewtype) - { - case XY: - return AxisBase(g_vector3_axis_x, g_vector3_axis_y, g_vector3_axis_z); - case XZ: - return AxisBase(g_vector3_axis_x, g_vector3_axis_z, g_vector3_axis_y); - case YZ: - return AxisBase(g_vector3_axis_y, g_vector3_axis_z, g_vector3_axis_x); - } - - ERROR_MESSAGE("invalid viewtype"); - return AxisBase(Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, 0, 0)); -} - -Vector3 AxisBase_axisForDirection(const AxisBase& axes, ENudgeDirection direction) -{ - switch (direction) - { - case eNudgeLeft: - return vector3_negated(axes.x); - case eNudgeUp: - return axes.y; - case eNudgeRight: - return axes.x; - case eNudgeDown: - return vector3_negated(axes.y); - } - - ERROR_MESSAGE("invalid direction"); - return Vector3(0, 0, 0); -} - -void NudgeSelection(ENudgeDirection direction, float fAmount, VIEWTYPE viewtype) -{ - AxisBase axes(AxisBase_forViewType(viewtype)); - Vector3 view_direction(vector3_negated(axes.z)); - Vector3 nudge(vector3_scaled(AxisBase_axisForDirection(axes, direction), fAmount)); - GlobalSelectionSystem().NudgeManipulator(nudge, view_direction); -} - -void Selection_Clone() -{ - if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) - { - UndoableCommand undo("cloneSelected"); - - Scene_Clone_Selected(GlobalSceneGraph()); - - //NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType()); - //NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType()); - } -} - -// called when the escape key is used (either on the main window or on an inspector) -void Selection_Deselect() -{ - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - if(GlobalSelectionSystem().countSelectedComponents() != 0) - { - GlobalSelectionSystem().setSelectedAllComponents(false); - } - else - { - SelectionSystem_DefaultMode(); - ComponentModeChanged(); - } - } - else - { - if(GlobalSelectionSystem().countSelectedComponents() != 0) - { - GlobalSelectionSystem().setSelectedAllComponents(false); - } - else - { - GlobalSelectionSystem().setSelectedAll(false); - } - } -} - - -void Selection_NudgeUp() -{ - UndoableCommand undo("nudgeSelectedUp"); - NudgeSelection(eNudgeUp, GetGridSize(), GlobalXYWnd_getCurrentViewType()); -} - -void Selection_NudgeDown() -{ - UndoableCommand undo("nudgeSelectedDown"); - NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType()); -} - -void Selection_NudgeLeft() -{ - UndoableCommand undo("nudgeSelectedLeft"); - NudgeSelection(eNudgeLeft, GetGridSize(), GlobalXYWnd_getCurrentViewType()); -} - -void Selection_NudgeRight() -{ - UndoableCommand undo("nudgeSelectedRight"); - NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType()); -} - - -void TranslateToolExport(const BoolImportCallback& importCallback) -{ - importCallback(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eTranslate); -} - -void RotateToolExport(const BoolImportCallback& importCallback) -{ - importCallback(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eRotate); -} - -void ScaleToolExport(const BoolImportCallback& importCallback) -{ - importCallback(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eScale); -} - -void DragToolExport(const BoolImportCallback& importCallback) -{ - importCallback(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eDrag); -} - -void ClipperToolExport(const BoolImportCallback& importCallback) -{ - importCallback(GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip); -} - -FreeCaller1 g_translatemode_button_caller; -BoolExportCallback g_translatemode_button_callback(g_translatemode_button_caller); -ToggleItem g_translatemode_button(g_translatemode_button_callback); - -FreeCaller1 g_rotatemode_button_caller; -BoolExportCallback g_rotatemode_button_callback(g_rotatemode_button_caller); -ToggleItem g_rotatemode_button(g_rotatemode_button_callback); - -FreeCaller1 g_scalemode_button_caller; -BoolExportCallback g_scalemode_button_callback(g_scalemode_button_caller); -ToggleItem g_scalemode_button(g_scalemode_button_callback); - -FreeCaller1 g_dragmode_button_caller; -BoolExportCallback g_dragmode_button_callback(g_dragmode_button_caller); -ToggleItem g_dragmode_button(g_dragmode_button_callback); - -FreeCaller1 g_clipper_button_caller; -BoolExportCallback g_clipper_button_callback(g_clipper_button_caller); -ToggleItem g_clipper_button(g_clipper_button_callback); - -void ToolChanged() -{ - g_translatemode_button.update(); - g_rotatemode_button.update(); - g_scalemode_button.update(); - g_dragmode_button.update(); - g_clipper_button.update(); -} - -const char* const c_ResizeMode_status = "QE4 Drag Tool: move and resize objects"; - -void DragMode() -{ - if(g_currentToolMode == DragMode && g_defaultToolMode != DragMode) - { - g_defaultToolMode(); - } - else - { - g_currentToolMode = DragMode; - g_currentToolModeSupportsComponentEditing = true; - - OnClipMode(false); - - Sys_Status(c_ResizeMode_status); - GlobalSelectionSystem().SetManipulatorMode(SelectionSystem::eDrag); - ToolChanged(); - ModeChangeNotify(); - } -} - - -const char* const c_TranslateMode_status = "Translate Tool: translate objects and components"; - -void TranslateMode() -{ - if(g_currentToolMode == TranslateMode && g_defaultToolMode != TranslateMode) - { - g_defaultToolMode(); - } - else - { - g_currentToolMode = TranslateMode; - g_currentToolModeSupportsComponentEditing = true; - - OnClipMode(false); - - Sys_Status(c_TranslateMode_status); - GlobalSelectionSystem().SetManipulatorMode(SelectionSystem::eTranslate); - ToolChanged(); - ModeChangeNotify(); - } -} - -const char* const c_RotateMode_status = "Rotate Tool: rotate objects and components"; - -void RotateMode() -{ - if(g_currentToolMode == RotateMode && g_defaultToolMode != RotateMode) - { - g_defaultToolMode(); - } - else - { - g_currentToolMode = RotateMode; - g_currentToolModeSupportsComponentEditing = true; - - OnClipMode(false); - - Sys_Status(c_RotateMode_status); - GlobalSelectionSystem().SetManipulatorMode(SelectionSystem::eRotate); - ToolChanged(); - ModeChangeNotify(); - } -} - -const char* const c_ScaleMode_status = "Scale Tool: scale objects and components"; - -void ScaleMode() -{ - if(g_currentToolMode == ScaleMode && g_defaultToolMode != ScaleMode) - { - g_defaultToolMode(); - } - else - { - g_currentToolMode = ScaleMode; - g_currentToolModeSupportsComponentEditing = true; - - OnClipMode(false); - - Sys_Status(c_ScaleMode_status); - GlobalSelectionSystem().SetManipulatorMode(SelectionSystem::eScale); - ToolChanged(); - ModeChangeNotify(); - } -} - - -const char* const c_ClipperMode_status = "Clipper Tool: apply clip planes to objects"; - - -void ClipperMode() -{ - if(g_currentToolMode == ClipperMode && g_defaultToolMode != ClipperMode) - { - g_defaultToolMode(); - } - else - { - g_currentToolMode = ClipperMode; - g_currentToolModeSupportsComponentEditing = false; - - SelectionSystem_DefaultMode(); - - OnClipMode(true); - - Sys_Status(c_ClipperMode_status); - GlobalSelectionSystem().SetManipulatorMode(SelectionSystem::eClip); - ToolChanged(); - ModeChangeNotify(); - } -} - - -void Texdef_Rotate(float angle) -{ - StringOutputStream command; - command << "brushRotateTexture -angle " << angle; - UndoableCommand undo(command.c_str()); - Select_RotateTexture(angle); -} - -void Texdef_RotateClockwise() -{ - Texdef_Rotate(static_cast(fabs(g_si_globals.rotate))); -} - -void Texdef_RotateAntiClockwise() -{ - Texdef_Rotate(static_cast(-fabs(g_si_globals.rotate))); -} - -void Texdef_Scale(float x, float y) -{ - StringOutputStream command; - command << "brushScaleTexture -x " << x << " -y " << y; - UndoableCommand undo(command.c_str()); - Select_ScaleTexture(x, y); -} - -void Texdef_ScaleUp() -{ - Texdef_Scale(0, g_si_globals.scale[1]); -} - -void Texdef_ScaleDown() -{ - Texdef_Scale(0, -g_si_globals.scale[1]); -} - -void Texdef_ScaleLeft() -{ - Texdef_Scale(-g_si_globals.scale[0],0); -} - -void Texdef_ScaleRight() -{ - Texdef_Scale(g_si_globals.scale[0],0); -} - -void Texdef_Shift(float x, float y) -{ - StringOutputStream command; - command << "brushShiftTexture -x " << x << " -y " << y; - UndoableCommand undo(command.c_str()); - Select_ShiftTexture(x, y); -} - -void Texdef_ShiftLeft() -{ - Texdef_Shift(-g_si_globals.shift[0], 0); -} - -void Texdef_ShiftRight() -{ - Texdef_Shift(g_si_globals.shift[0], 0); -} - -void Texdef_ShiftUp() -{ - Texdef_Shift(0, g_si_globals.shift[1]); -} - -void Texdef_ShiftDown() -{ - Texdef_Shift(0, -g_si_globals.shift[1]); -} - - - -class SnappableSnapToGridSelected : public scene::Graph::Walker -{ - float m_snap; -public: - SnappableSnapToGridSelected(float snap) - : m_snap(snap) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Snappable* snappable = Node_getSnappable(path.top()); - if(snappable != 0 - && Instance_getSelectable(instance)->isSelected()) - { - snappable->snapto(m_snap); - } - } - return true; - } -}; - -void Scene_SnapToGrid_Selected(scene::Graph& graph, float snap) -{ - graph.traverse(SnappableSnapToGridSelected(snap)); -} - -class ComponentSnappableSnapToGridSelected : public scene::Graph::Walker -{ - float m_snap; -public: - ComponentSnappableSnapToGridSelected(float snap) - : m_snap(snap) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - ComponentSnappable* componentSnappable = Instance_getComponentSnappable(instance); - if(componentSnappable != 0 - && Instance_getSelectable(instance)->isSelected()) - { - componentSnappable->snapComponents(m_snap); - } - } - return true; - } -}; - -void Scene_SnapToGrid_Component_Selected(scene::Graph& graph, float snap) -{ - graph.traverse(ComponentSnappableSnapToGridSelected(snap)); -} - -void Selection_SnapToGrid() -{ - StringOutputStream command; - command << "snapSelected -grid " << GetGridSize(); - UndoableCommand undo(command.c_str()); - - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - Scene_SnapToGrid_Component_Selected(GlobalSceneGraph(), GetGridSize()); - } - else - { - Scene_SnapToGrid_Selected(GlobalSceneGraph(), GetGridSize()); - } -} - - -static gint qe_every_second(gpointer data) -{ - GdkModifierType mask; - - gdk_window_get_pointer (0, 0, 0, &mask); - - if ((mask & (GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK)) == 0) - { - QE_CheckAutoSave(); } return TRUE; } -guint s_qe_every_second_id = 0; - -void EverySecondTimer_enable() +static gint mainframe_keyrelease (GtkWidget* widget, GdkEventKey* event, gpointer data) { - if(s_qe_every_second_id == 0) + unsigned int code = gdk_keyval_to_upper(event->keyval); + + if (gtk_accelerator_valid (event->keyval, (GdkModifierType)0)) + return TRUE; + + for (int i = 0; i < g_nCommandCount; i++) { - s_qe_every_second_id = gtk_timeout_add(1000, qe_every_second, 0); - } -} - -void EverySecondTimer_disable() -{ - if(s_qe_every_second_id != 0) - { - gtk_timeout_remove(s_qe_every_second_id); - s_qe_every_second_id = 0; - } -} - -gint window_realize_remove_decoration(GtkWidget* widget, gpointer data) -{ - gdk_window_set_decorations(widget->window, (GdkWMDecoration)(GDK_DECOR_ALL|GDK_DECOR_MENU|GDK_DECOR_MINIMIZE|GDK_DECOR_MAXIMIZE)); - return FALSE; -} - -class WaitDialog -{ -public: - GtkWindow* m_window; - GtkLabel* m_label; -}; - -WaitDialog create_wait_dialog(const char* title, const char* text) -{ - WaitDialog dialog; - - dialog.m_window = create_floating_window(title, MainFrame_getWindow()); - gtk_window_set_resizable(dialog.m_window, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(dialog.m_window), 0); - gtk_window_set_position(dialog.m_window, GTK_WIN_POS_CENTER_ON_PARENT); - - g_signal_connect(G_OBJECT(dialog.m_window), "realize", G_CALLBACK(window_realize_remove_decoration), 0); - - { - dialog.m_label = GTK_LABEL(gtk_label_new(text)); - gtk_misc_set_alignment(GTK_MISC(dialog.m_label), 0.0, 0.5); - gtk_label_set_justify(dialog.m_label, GTK_JUSTIFY_LEFT); - gtk_widget_show(GTK_WIDGET(dialog.m_label)); - gtk_widget_set_size_request(GTK_WIDGET(dialog.m_label), 200, -1); - - gtk_container_add(GTK_CONTAINER(dialog.m_window), GTK_WIDGET(dialog.m_label)); - } - return dialog; -} - -namespace -{ - clock_t g_lastRedrawTime = 0; - const clock_t c_redrawInterval = clock_t(CLOCKS_PER_SEC / 10); - - bool redrawRequired() - { - clock_t currentTime = std::clock(); - if(currentTime - g_lastRedrawTime >= c_redrawInterval) + if (g_Commands[i].m_nKey == code) // find a match? { - g_lastRedrawTime = currentTime; - return true; - } - return false; - } -} + if(!g_Commands[i].m_nModifiers) + { + // Gef: Only call the handler if it's a key that needs keyup events + switch (g_Commands[i].m_nCommand) + { + case ID_CAMERA_FORWARD: + case ID_CAMERA_BACK: + case ID_CAMERA_LEFT: + case ID_CAMERA_RIGHT: + case ID_CAMERA_STRAFELEFT: + case ID_CAMERA_STRAFERIGHT: + { + HandleKeyUp (NULL, GINT_TO_POINTER (g_Commands[i].m_nCommand)); + gtk_signal_emit_stop_by_name (GTK_OBJECT(widget), "key_release_event"); + } -bool MainFrame_isActiveApp() -{ - //globalOutputStream() << "listing\n"; - GList* list = gtk_window_list_toplevels(); - for(GList* i = list; i != 0; i = g_list_next(i)) - { - //globalOutputStream() << "toplevel.. "; - if(gtk_window_is_active(GTK_WINDOW(i->data))) - { - //globalOutputStream() << "is active\n"; - return true; - } - //globalOutputStream() << "not active\n"; - } - return false; -} - -typedef std::list StringStack; -StringStack g_wait_stack; -WaitDialog g_wait; - -bool ScreenUpdates_Enabled() -{ - return g_wait_stack.empty(); -} - -void ScreenUpdates_process() -{ - if(redrawRequired() && GTK_WIDGET_VISIBLE(g_wait.m_window)) - { - process_gui(); - } -} - - -void ScreenUpdates_Disable(const char* message, const char* title) -{ - if(g_wait_stack.empty()) - { - EverySecondTimer_disable(); - - process_gui(); - - bool isActiveApp = MainFrame_isActiveApp(); - - g_wait = create_wait_dialog(title, message); - gtk_grab_add(GTK_WIDGET(g_wait.m_window)); - - if(isActiveApp) - { - gtk_widget_show(GTK_WIDGET(g_wait.m_window)); - ScreenUpdates_process(); + } + return FALSE; + } } } - else if(GTK_WIDGET_VISIBLE(g_wait.m_window)) - { - gtk_label_set_text(g_wait.m_label, message); - ScreenUpdates_process(); - } - g_wait_stack.push_back(message); + + return TRUE; } -void ScreenUpdates_Enable() + +// ============================================================================= +// Window creation functions + +void AddMenuItem (GtkWidget* item, unsigned int id) { - ASSERT_MESSAGE(!ScreenUpdates_Enabled(), "screen updates already enabled"); - g_wait_stack.pop_back(); - if(g_wait_stack.empty()) + for (int i = 0; i < g_nCommandCount; i++) + if (g_Commands[i].m_nCommand == id) + { + g_object_set_data (G_OBJECT (g_pParentWnd->m_pWidget), g_Commands[i].m_strMenu, item); + break; + } +} + +void MainFrame::handle_help_command(int id) +{ + OpenURL(mHelpURLs[id]->GetBuffer()); +} + +/*! +needed for hooking in Gtk+ +*/ +void HandleHelpCommand (GtkWidget *widget, gpointer data) +{ + int id = GPOINTER_TO_INT (data); + g_pParentWnd->handle_help_command(id); +} + +void MainFrame::process_xlink (Str &FileName, char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel) +{ + xmlDocPtr pDoc; + pDoc = xmlParseFile(FileName.GetBuffer()); + if (pDoc) { - EverySecondTimer_enable(); - //gtk_widget_set_sensitive(GTK_WIDGET(MainFrame_getWindow()), TRUE); - - gtk_grab_remove(GTK_WIDGET(g_wait.m_window)); - destroy_floating_window(g_wait.m_window); - g_wait.m_window = 0; - - //gtk_window_present(MainFrame_getWindow()); + Sys_Printf("Processing .xlink file '%s'\n", FileName.GetBuffer()); + // create sub menu + GtkWidget* menu_in_menu = create_menu_in_menu_with_mnemonic(menu, menu_name); + // start walking the nodes, find the 'links' one + xmlNodePtr pNode = pDoc->children; + while (pNode && strcmp((const char*)pNode->name, "links")) + pNode=pNode->next; + if (pNode) + { + pNode = pNode->children; + while(pNode) + { + if (!strcmp((const char*)pNode->name, "item")) + { + // process the URL + Str *url; + if (strstr((char *)xmlGetProp(pNode, (xmlChar *)"url"), "http://")) + { + // complete URL + url = new Str; + *url = (char *)xmlGetProp(pNode, (xmlChar *)"url"); + } + else + { + // relative URL + url = new Str; + *url = base_url; + *url += (char *)xmlGetProp(pNode, (xmlChar *)"url"); + } + mHelpURLs.push_back(url); + create_menu_item_with_mnemonic (menu_in_menu, (char *)xmlGetProp(pNode, (xmlChar *)"name"), GTK_SIGNAL_FUNC(HandleHelpCommand), mHelpURLs.size()-1); + } + pNode=pNode->next; + } + } + xmlFreeDoc(pDoc); } - else if(GTK_WIDGET_VISIBLE(g_wait.m_window)) + else { - gtk_label_set_text(g_wait.m_label, g_wait_stack.back().c_str()); - ScreenUpdates_process(); + Sys_Printf("'%s' not found / parse failed\n", FileName.GetBuffer()); } } - - -void GlobalCamera_UpdateWindow() +void MainFrame::create_game_help_menu (GtkWidget *menu, GtkAccelGroup *accel) { - if(g_pParentWnd != 0) + Str FileName; + list::iterator iGame; + + // start in the global dir + FileName = g_strAppPath; + FileName += "global.xlink"; + process_xlink(FileName, "General", g_strAppPath.GetBuffer(), menu, accel); + + for (iGame = g_PrefsDlg.mGamesDialog.mGames.begin(); iGame != g_PrefsDlg.mGamesDialog.mGames.end(); iGame++) { - CamWnd_Update(*g_pParentWnd->GetCamWnd()); + FileName = (*iGame)->mGameToolsPath; + FileName += "game.xlink"; + process_xlink(FileName, (*iGame)->mGameName, (*iGame)->mGameToolsPath.GetBuffer(), menu, accel); } } -void XY_UpdateWindow(MainFrame& mainframe) +void MainFrame::create_main_menu (GtkWidget *window, GtkWidget *vbox) { - if(mainframe.GetXYWnd() != 0) - { - XYWnd_Update(*mainframe.GetXYWnd()); - } -} + GtkWidget *handle_box, *menu_bar, *menu, *menu_in_menu, *menu_3, *item; + GtkAccelGroup *accel; -void XZ_UpdateWindow(MainFrame& mainframe) -{ - if(mainframe.GetXZWnd() != 0) - { - XYWnd_Update(*mainframe.GetXZWnd()); - } -} + g_bIgnoreCommands++; + accel = gtk_accel_group_new (); + global_accel = accel; + gtk_window_add_accel_group (GTK_WINDOW (window), accel); -void YZ_UpdateWindow(MainFrame& mainframe) -{ - if(mainframe.GetYZWnd() != 0) - { - XYWnd_Update(*mainframe.GetYZWnd()); - } -} + handle_box = gtk_handle_box_new (); + gtk_box_pack_start (GTK_BOX (vbox), handle_box, FALSE, FALSE, 0); + gtk_widget_show (handle_box); -void XY_UpdateAllWindows(MainFrame& mainframe) -{ - XY_UpdateWindow(mainframe); - XZ_UpdateWindow(mainframe); - YZ_UpdateWindow(mainframe); -} + menu_bar = gtk_menu_bar_new (); + gtk_container_add (GTK_CONTAINER (handle_box), menu_bar); + gtk_widget_show (menu_bar); -void XY_UpdateAllWindows() -{ - if(g_pParentWnd != 0) - { - XY_UpdateAllWindows(*g_pParentWnd); - } -} - -void UpdateAllWindows() -{ - GlobalCamera_UpdateWindow(); - XY_UpdateAllWindows(); -} - - -void ModeChangeNotify() -{ - SceneChangeNotify(); -} - -void ClipperChangeNotify() -{ - GlobalCamera_UpdateWindow(); - XY_UpdateAllWindows(); -} - - -LatchedInt g_Layout_viewStyle(0, "Window Layout"); -LatchedBool g_Layout_enableDetachableMenus(true, "Detachable Menus"); -LatchedBool g_Layout_enablePatchToolbar(true, "Patch Toolbar"); -LatchedBool g_Layout_enablePluginToolbar(true, "Plugin Toolbar"); - - - -GtkMenuItem* create_file_menu() -{ // File menu - GtkMenuItem* file_menu_item = new_sub_menu_item_with_mnemonic("_File"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(file_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_File"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - create_menu_item_with_mnemonic(menu, "_New Map", "NewMap"); - menu_separator(menu); + create_menu_item_with_mnemonic (menu, "_New Map", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_NEW); + menu_separator (menu); -#if 0 //++timo temporary experimental stuff for sleep mode.. - create_menu_item_with_mnemonic(menu, "_Sleep", "Sleep"); - menu_separator(menu); + item = create_menu_item_with_mnemonic (menu, "_Sleep", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_SLEEP); + g_object_set_data (G_OBJECT (window), "menu_file_sleep", item ); + menu_separator (menu); // end experimental -#endif - create_menu_item_with_mnemonic(menu, "_Open...", "OpenMap"); + item = create_menu_item_with_mnemonic (menu, "_Open...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_OPEN); + g_object_set_data (G_OBJECT (window), "menu_file_open", item); + create_menu_item_with_mnemonic (menu, "_Import...", // Hydra: give it it's proper name + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_IMPORTMAP); + item = create_menu_item_with_mnemonic (menu, "_Save", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_SAVE); + g_object_set_data (G_OBJECT (window), "menu_file_save", item); + create_menu_item_with_mnemonic (menu, "Save _as...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_SAVEAS); + create_menu_item_with_mnemonic (menu, "Save s_elected...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_EXPORTMAP); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "Save re_gion...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_SAVEREGION); + g_object_set_data (G_OBJECT (window), "menu_file_saveregion", item); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "New p_roject...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_NEWPROJECT); + create_menu_item_with_mnemonic (menu, "Load _project...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_LOADPROJECT); + create_menu_item_with_mnemonic (menu, "Pro_ject settings...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_PROJECTSETTINGS); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "_Pointfile...", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_POINTFILE); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "Recent Files", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_RECENT1); + g_object_set_data (G_OBJECT (item), "accel", accel); + gtk_widget_set_sensitive (item, FALSE); + MRU_AddWidget (item, 0); + item = create_menu_item_with_mnemonic (menu, "2", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_RECENT2); + gtk_widget_hide (item); + MRU_AddWidget (item, 1); + item = create_menu_item_with_mnemonic (menu, "3", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_RECENT3); + gtk_widget_hide (item); + MRU_AddWidget (item, 2); + item = create_menu_item_with_mnemonic (menu, "4", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_RECENT4); + gtk_widget_hide (item); + MRU_AddWidget (item, 3); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "Check for GtkRadiant update (web)", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_CHECKUPDATE); + // disable, the functionality is no longer available + gtk_widget_set_sensitive( item, FALSE ); + + create_menu_item_with_mnemonic (menu, "E_xit", + GTK_SIGNAL_FUNC (HandleCommand), ID_FILE_EXIT); - create_menu_item_with_mnemonic(menu, "_Import...", "ImportMap"); - create_menu_item_with_mnemonic(menu, "_Save", "SaveMap"); - create_menu_item_with_mnemonic(menu, "Save _as...", "SaveMapAs"); - create_menu_item_with_mnemonic(menu, "Save s_elected...", "SaveSelected"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Save re_gion...", "SaveRegion"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "_Refresh models", "RefreshReferences"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Pro_ject settings...", "ProjectSettings"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "_Pointfile...", "TogglePointfile"); - menu_separator(menu); - MRU_constructMenu(menu); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Check for GtkRadiant update (web)", "CheckForUpdate"); - create_menu_item_with_mnemonic(menu, "E_xit", "Exit"); - - return file_menu_item; -} - -GtkMenuItem* create_edit_menu() -{ // Edit menu - GtkMenuItem* edit_menu_item = new_sub_menu_item_with_mnemonic("_Edit"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(edit_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_Edit"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - create_menu_item_with_mnemonic(menu, "_Undo", "Undo"); - create_menu_item_with_mnemonic(menu, "_Redo", "Redo"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "_Copy", "Copy"); - create_menu_item_with_mnemonic(menu, "_Paste", "Paste"); - create_menu_item_with_mnemonic(menu, "P_aste To Camera", "PasteToCamera"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "_Duplicate", "CloneSelection"); - create_menu_item_with_mnemonic(menu, "D_elete", "DeleteSelection"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Pa_rent", "ParentSelection"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "C_lear Selection", "UnSelectSelection"); - create_menu_item_with_mnemonic(menu, "_Invert Selection", "InvertSelection"); - create_menu_item_with_mnemonic(menu, "Select i_nside", "SelectInside"); - create_menu_item_with_mnemonic(menu, "Select _touching", "SelectTouching"); + item = create_menu_item_with_mnemonic (menu, "_Undo", + GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_UNDO); + g_object_set_data (G_OBJECT (window), "menu_edit_undo", item); + item = create_menu_item_with_mnemonic (menu, "_Redo", + GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_REDO); + g_object_set_data (G_OBJECT (window), "menu_edit_redo", item); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "_Copy", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_COPYBRUSH); + item = create_menu_item_with_mnemonic (menu, "_Paste", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_PASTEBRUSH); + item = create_menu_item_with_mnemonic (menu, "P_aste To Camera", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_PASTEBRUSHTOCAMERA); + item = create_menu_item_with_mnemonic (menu, "_Delete", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_DELETE); + g_object_set_data (G_OBJECT (window), "menu_selection_delete", item); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Map Info...", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_MAPINFO); + create_menu_item_with_mnemonic (menu, "Entity Info...", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_ENTITYINFO); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Brush Scripts...", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_SCRIPTS); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Load Pre_fab...", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_LOADPREFAB); + create_menu_item_with_mnemonic (menu, "Save Selection as Prefab...", GTK_SIGNAL_FUNC (HandleCommand), ID_EDIT_SAVEPREFAB); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Preferences...", GTK_SIGNAL_FUNC (HandleCommand), ID_PREFS); - GtkMenu* convert_menu = create_sub_menu_with_mnemonic(menu, "E_xpand Selection"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (convert_menu); - create_menu_item_with_mnemonic(convert_menu, "To Whole _Entities", "ExpandSelectionToEntities"); - - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Pre_ferences...", "Preferences"); - - return edit_menu_item; -} - -void fill_view_xy_top_menu(GtkMenu* menu) -{ - create_check_menu_item_with_mnemonic(menu, "XY (Top) View", "ToggleView"); -} - - -void fill_view_yz_side_menu(GtkMenu* menu) -{ - create_check_menu_item_with_mnemonic(menu, "YZ (Side) View", "ToggleSideView"); -} - - -void fill_view_xz_front_menu(GtkMenu* menu) -{ - create_check_menu_item_with_mnemonic(menu, "XZ (Front) View", "ToggleFrontView"); -} - - -GtkWidget* g_toggle_z_item = 0; -GtkWidget* g_toggle_console_item = 0; -GtkWidget* g_toggle_entity_item = 0; -GtkWidget* g_toggle_entitylist_item = 0; - -GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) -{ // View menu - GtkMenuItem* view_menu_item = new_sub_menu_item_with_mnemonic("Vie_w"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(view_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_View"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - if(style == MainFrame::eFloating) - { - fill_view_camera_menu(menu); - fill_view_xy_top_menu(menu); - fill_view_yz_side_menu(menu); - fill_view_xz_front_menu(menu); - } - if(style == MainFrame::eFloating || style == MainFrame::eSplit) - { - create_menu_item_with_mnemonic(menu, "Console View", "ToggleConsole"); - create_menu_item_with_mnemonic(menu, "Texture Browser", "ToggleTextures"); - create_menu_item_with_mnemonic(menu, "Entity Inspector", "ToggleEntityInspector"); - } - else - { - create_menu_item_with_mnemonic(menu, "Entity Inspector", "ViewEntityInfo"); - } - create_menu_item_with_mnemonic(menu, "_Surface Inspector", "SurfaceInspector"); - create_menu_item_with_mnemonic(menu, "Entity List", "EntityList"); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Toggle"); + create_menu_item_with_mnemonic (menu_in_menu, "Camera View", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLECAMERA); + create_menu_item_with_mnemonic (menu_in_menu, "Console View", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLECONSOLE); + item = create_menu_item_with_mnemonic (menu_in_menu, "Entity View", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITY); + g_object_set_data (G_OBJECT (window), "menu_view_entity", item); + // create_menu_item_with_mnemonic (menu_in_menu, "Groups View", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_GROUPS); + create_menu_item_with_mnemonic (menu_in_menu, "XY (Top)", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLEVIEW); + create_menu_item_with_mnemonic (menu_in_menu, "YZ (Side)", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLEVIEW_YZ); + create_menu_item_with_mnemonic (menu_in_menu, "XZ (Front)", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLEVIEW_XZ); + create_menu_item_with_mnemonic (menu_in_menu, "Z View", GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLEZ); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "_Center", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CENTER); + item = create_menu_item_with_mnemonic (menu, "_Center 2d", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CENTERVIEW); + item = create_menu_item_with_mnemonic (menu, "_Up Floor", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_UPFLOOR); + item = create_menu_item_with_mnemonic (menu, "_Down Floor", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_DOWNFLOOR); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "_Next (XY, YZ, XY)", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_NEXTVIEW); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Layout"); + create_menu_item_with_mnemonic (menu_in_menu, "XY (Top)", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_XY); + create_menu_item_with_mnemonic (menu_in_menu, "YZ", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SIDE); + create_menu_item_with_mnemonic (menu_in_menu, "XZ", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_FRONT); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Zoom"); + create_menu_item_with_mnemonic (menu_in_menu, "_XY 100%", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_100); + item = create_menu_item_with_mnemonic (menu_in_menu, "XY Zoom _In", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ZOOMIN); + item = create_menu_item_with_mnemonic (menu_in_menu, "XY Zoom _Out", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ZOOMOUT); + menu_separator (menu_in_menu); + create_menu_item_with_mnemonic (menu_in_menu, "_Z 100%", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_Z100); + item = create_menu_item_with_mnemonic (menu_in_menu, "Z Zoo_m In", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ZZOOMIN); + g_object_set_data (G_OBJECT (window), "menu_view_zzoomin", item); + item = create_menu_item_with_mnemonic (menu_in_menu, "Z Zoom O_ut", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ZZOOMOUT); + g_object_set_data (G_OBJECT (window), "menu_view_zzoomout", item); + menu_separator (menu_in_menu); + item = create_menu_item_with_mnemonic (menu_in_menu, "Cubic Clip Zoom In", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CUBEIN); + item = create_menu_item_with_mnemonic (menu_in_menu, "Cubic Clip Zoom Out", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CUBEOUT); + menu_separator (menu); - menu_separator(menu); - { - GtkMenu* camera_menu = create_sub_menu_with_mnemonic (menu, "Camera"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (camera_menu); - create_menu_item_with_mnemonic(camera_menu, "_Center", "CenterView"); - create_menu_item_with_mnemonic(camera_menu, "_Up Floor", "UpFloor"); - create_menu_item_with_mnemonic(camera_menu, "_Down Floor", "DownFloor"); - menu_separator(camera_menu); - create_menu_item_with_mnemonic(camera_menu, "Far Clip Plane In", "CubicClipZoomIn"); - create_menu_item_with_mnemonic(camera_menu, "Far Clip Plane Out", "CubicClipZoomOut"); - menu_separator(camera_menu); - create_menu_item_with_mnemonic(camera_menu, "Next leak spot", "NextLeakSpot"); - create_menu_item_with_mnemonic(camera_menu, "Previous leak spot", "PrevLeakSpot"); - menu_separator(camera_menu); - create_menu_item_with_mnemonic(camera_menu, "Look Through Selected", "LookThroughSelected"); - create_menu_item_with_mnemonic(camera_menu, "Look Through Camera", "LookThroughCamera"); - } - menu_separator(menu); - { - GtkMenu* orthographic_menu = create_sub_menu_with_mnemonic(menu, "Orthographic"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (orthographic_menu); - if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating) - { - create_menu_item_with_mnemonic(orthographic_menu, "_Next (XY, YZ, XY)", "NextView"); - create_menu_item_with_mnemonic(orthographic_menu, "XY (Top)", "ViewTop"); - create_menu_item_with_mnemonic(orthographic_menu, "YZ", "ViewSide"); - create_menu_item_with_mnemonic(orthographic_menu, "XZ", "ViewFront"); - menu_separator(orthographic_menu); - } + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Show"); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show _Angles", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWANGLES, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_showangles", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show _Names", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWNAMES, TRUE); + g_object_set_data (G_OBJECT (window), "menu_view_shownames", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show Blocks", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWBLOCKS, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_showblocks", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show C_oordinates", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWCOORDINATES, TRUE); + g_object_set_data (G_OBJECT (window), "menu_view_showcoordinates", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show Window Outline", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWOUTLINE, TRUE); + g_object_set_data (G_OBJECT (window), "menu_view_showoutline", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show ZBuffered Outline", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_NOOUTLINE, TRUE); + g_object_set_data (G_OBJECT (window), "menu_selection_nooutline", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show Axes", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWAXES, TRUE); + g_object_set_data (G_OBJECT (window), "menu_view_showaxes", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Show Workzone", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_SHOWWORKZONE, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_showworkzone", item); - create_menu_item_with_mnemonic(orthographic_menu, "_XY 100%", "Zoom100"); - create_menu_item_with_mnemonic(orthographic_menu, "XY Zoom _In", "ZoomIn"); - create_menu_item_with_mnemonic(orthographic_menu, "XY Zoom _Out", "ZoomOut"); - } + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Filter"); + create_check_menu_item_with_mnemonic (menu_in_menu, "World", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_WORLD, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Entities", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_ENTITIES, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Areaportals", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_AREAPORTALS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Translucent", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_TRANSLUCENT, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Liquids", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_LIQUIDS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Caulk", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_CAULK, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Clips", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_CLIPS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Paths", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_PATHS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Clusterportals", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_CLUSTERPORTALS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Lights", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_LIGHTS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Structural", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_STRUCTURAL, FALSE); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Lightgrid", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_LIGHTGRID, FALSE); + g_object_set_data (G_OBJECT (window), "menu_filter_lightgrid", item); + create_check_menu_item_with_mnemonic (menu_in_menu, "Patches", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_PATCHES, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Details", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_DETAILS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Hints", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_HINTSSKIPS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Models", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_MODELS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Triggers", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_TRIGGERS, FALSE); + create_check_menu_item_with_mnemonic (menu_in_menu, "Botclips", GTK_SIGNAL_FUNC (HandleCommand), ID_FILTER_BOTCLIPS, FALSE); - menu_separator(menu); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Hide/Show"); + create_menu_item_with_mnemonic (menu_in_menu, "Hide Selected", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_HIDESHOW_HIDESELECTED); + create_menu_item_with_mnemonic (menu_in_menu, "Show Hidden", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_HIDESHOW_SHOWHIDDEN); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Entities as"); + g_object_set_data (G_OBJECT (window), "view_entitiesas_menu", menu_in_menu); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, NULL, "Bounding box", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITIESAS_BOUNDINGBOX,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_boundingbox", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Wireframe", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITIESAS_WIREFRAME,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_wireframe", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Selected Wireframe", + GTK_SIGNAL_FUNC (HandleCommand),ID_VIEW_ENTITIESAS_SELECTEDWIREFRAME,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_selectedwireframe", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Selected Skinned", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITIESAS_SELECTEDSKINNED,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_selectedskinned", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Skinned", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITIESAS_SKINNED,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_skinned", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Skinned and Boxed", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_ENTITIESAS_SKINNEDANDBOXED,FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_entitiesas_skinnedandboxed", item); + menu_separator (menu); + item = create_check_menu_item_with_mnemonic (menu, "Cubic Clipping", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CUBICCLIPPING, TRUE); + g_object_set_data (G_OBJECT (window), "menu_view_cubicclipping", item); + menu_separator (menu); + item = create_check_menu_item_with_mnemonic (menu, "OpenGL Lighting", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_OPENGLLIGHTING, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_opengllighting", item); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Show"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show _Angles", "ShowAngles"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show _Names", "ShowNames"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show Blocks", "ShowBlocks"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show C_oordinates", "ShowCoordinates"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show Window Outline", "ShowWindowOutline"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show Axes", "ShowAxes"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show Workzone", "ShowWorkzone"); - create_check_menu_item_with_mnemonic(menu_in_menu, "Show Stats", "ShowStats"); - } - - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Filter"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - Filters_constructMenu(menu_in_menu); - } - menu_separator(menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Hide/Show"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Hide Selected", "HideSelected"); - create_menu_item_with_mnemonic(menu_in_menu, "Show Hidden", "ShowHidden"); - } - menu_separator(menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Region"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "_Off", "RegionOff"); - create_menu_item_with_mnemonic(menu_in_menu, "_Set XY", "RegionSetXY"); - create_menu_item_with_mnemonic(menu_in_menu, "Set _Brush", "RegionSetBrush"); - create_menu_item_with_mnemonic(menu_in_menu, "Set Se_lected Brushes", "RegionSetSelection"); - } - - if(style == MainFrame::eSplit || style == MainFrame::eFloating) - { - command_connect_accelerator("CenterXYViews"); - } - else - { - command_connect_accelerator("CenterXYView"); - } - - return view_menu_item; -} - -GtkMenuItem* create_selection_menu() -{ // Selection menu - GtkMenuItem* selection_menu_item = new_sub_menu_item_with_mnemonic("M_odify"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(selection_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_Selection"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Components"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_check_menu_item_with_mnemonic(menu_in_menu, "_Edges", "DragEdges"); - create_check_menu_item_with_mnemonic(menu_in_menu, "_Vertices", "DragVertices"); - create_check_menu_item_with_mnemonic(menu_in_menu, "_Faces", "DragFaces"); - } - - menu_separator(menu); - - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic(menu, "Nudge"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Nudge Left", "SelectNudgeLeft"); - create_menu_item_with_mnemonic(menu_in_menu, "Nudge Right", "SelectNudgeRight"); - create_menu_item_with_mnemonic(menu_in_menu, "Nudge Up", "SelectNudgeUp"); - create_menu_item_with_mnemonic(menu_in_menu, "Nudge Down", "SelectNudgeDown"); - } - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Rotate"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Rotate X", "RotateSelectionX"); - create_menu_item_with_mnemonic(menu_in_menu, "Rotate Y", "RotateSelectionY"); - create_menu_item_with_mnemonic(menu_in_menu, "Rotate Z", "RotateSelectionZ"); - } - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Flip"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Flip _X", "MirrorSelectionX"); - create_menu_item_with_mnemonic(menu_in_menu, "Flip _Y", "MirrorSelectionY"); - create_menu_item_with_mnemonic(menu_in_menu, "Flip _Z", "MirrorSelectionZ"); - } - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Arbitrary rotation...", "ArbitraryRotation"); - create_menu_item_with_mnemonic(menu, "Arbitrary scale...", "ArbitraryScale"); - - return selection_menu_item; -} - -GtkMenuItem* create_bsp_menu() -{ - // BSP menu - GtkMenuItem* bsp_menu_item = new_sub_menu_item_with_mnemonic("_Build"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(bsp_menu_item)); - - if (g_Layout_enableDetachableMenus.m_value) - { - menu_tearoff(menu); - } - - create_menu_item_with_mnemonic(menu, "Customize...", "BuildMenuCustomize"); - - menu_separator(menu); - - Build_constructMenu(menu); - - g_bsp_menu = menu; - - return bsp_menu_item; -} - -GtkMenuItem* create_grid_menu() -{ - // Grid menu - GtkMenuItem* grid_menu_item = new_sub_menu_item_with_mnemonic("_Grid"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(grid_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu); - - Grid_constructMenu(menu); - - return grid_menu_item; -} - -GtkMenuItem* create_misc_menu() -{ - // Misc menu - GtkMenuItem* misc_menu_item = new_sub_menu_item_with_mnemonic("M_isc"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(misc_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu); - -#if 0 - create_menu_item_with_mnemonic(menu, "_Benchmark", FreeCaller()); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Drag"); + create_menu_item_with_mnemonic (menu_in_menu, "Drag _Edges", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_DRAGEDGES); + create_menu_item_with_mnemonic (menu_in_menu, "Drag _Vertices", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_DRAGVERTECIES); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "_Clone", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_CLONE); + item = create_menu_item_with_mnemonic (menu, "Deselect", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_DESELECT); + item = create_menu_item_with_mnemonic (menu, "Invert", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_INVERT); +#ifndef QUAKE3 + create_menu_item_with_mnemonic (menu, "_Delete", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_DELETE); #endif - gtk_container_add(GTK_CONTAINER(menu), GTK_WIDGET(create_colours_menu())); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Flip"); + create_menu_item_with_mnemonic (menu_in_menu, "Flip _X", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_FLIPX); + create_menu_item_with_mnemonic (menu_in_menu, "Flip _Y", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_FLIPY); + create_menu_item_with_mnemonic (menu_in_menu, "Flip _Z", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_FLIPZ); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Rotate"); + create_menu_item_with_mnemonic (menu_in_menu, "Rotate X", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_ROTATEX); + create_menu_item_with_mnemonic (menu_in_menu, "Rotate Y", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_ROTATEY); + create_menu_item_with_mnemonic (menu_in_menu, "Rotate Z", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_ROTATEZ); + create_menu_item_with_mnemonic (menu_in_menu, "Arbitrary rotation...", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_ARBITRARYROTATION); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Scale...", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_SCALE); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "CSG"); + create_menu_item_with_mnemonic (menu_in_menu, "Make _Hollow", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MAKEHOLLOW); + create_menu_item_with_mnemonic (menu_in_menu, "CSG _Subtract", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_CSGSUBTRACT); + create_menu_item_with_mnemonic (menu_in_menu, "CSG _Merge", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_CSGMERGE); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Select"); + create_menu_item_with_mnemonic (menu_in_menu, "Select Complete _Tall", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTCOMPLETETALL); + create_menu_item_with_mnemonic (menu_in_menu, "Select T_ouching", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTTOUCHING); + create_menu_item_with_mnemonic (menu_in_menu, "Select _Partial Tall", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTPARTIALTALL); + create_menu_item_with_mnemonic (menu_in_menu, "Select _Inside", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTINSIDE); +#ifndef QUAKE3 + create_menu_item_with_mnemonic (menu_in_menu, "Nudge Left", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGELEFT); + create_menu_item_with_mnemonic (menu_in_menu, "Nudge Right", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGERIGHT); + create_menu_item_with_mnemonic (menu_in_menu, "Nudge Up", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGEUP); + create_menu_item_with_mnemonic (menu_in_menu, "Nudge Down", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGEDOWN); +#endif + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Clipper"); + create_menu_item_with_mnemonic (menu_in_menu, "Toggle Clipper", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CLIPPER); + menu_separator (menu_in_menu); + create_menu_item_with_mnemonic (menu_in_menu, "Clip selection", + GTK_SIGNAL_FUNC (HandleCommand), ID_CLIP_SELECTED); + create_menu_item_with_mnemonic (menu_in_menu, "Split selection", + GTK_SIGNAL_FUNC (HandleCommand), ID_SPLIT_SELECTED); + create_menu_item_with_mnemonic (menu_in_menu, "Flip Clip orientation", + GTK_SIGNAL_FUNC (HandleCommand), ID_FLIP_CLIP); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Connect entities", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_CONNECT); + create_menu_item_with_mnemonic (menu, "Ungroup entity", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_UNGROUPENTITY); + create_menu_item_with_mnemonic (menu, "Make detail", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MAKE_DETAIL); + create_menu_item_with_mnemonic (menu, "Make structural", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MAKE_STRUCTURAL); - create_menu_item_with_mnemonic(menu, "Find brush...", "FindBrush"); - create_menu_item_with_mnemonic(menu, "Map Info...", "MapInfo"); + // BSP menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Bsp"); + + menu_separator (menu); + g_object_set_data (G_OBJECT (window), "menu_bsp", menu); + + // Grid menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Grid"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + item = create_radio_menu_item_with_mnemonic (menu, NULL, "Grid0.25", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_025, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_025", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid0.5", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_05, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_05", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid1", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_1, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_1", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid2", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_2, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_2", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid4", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_4, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_4", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid8", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_8, TRUE); + g_object_set_data (G_OBJECT (window), "menu_grid_8", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid16", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_16, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_16", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid32", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_32, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_32", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid64", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_64, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_64", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid128", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_128, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_128", item); + item = create_radio_menu_item_with_mnemonic (menu, item, "Grid256", + GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_256, FALSE); + g_object_set_data (G_OBJECT (window), "menu_grid_256", item); + menu_separator (menu); + item = create_check_menu_item_with_mnemonic (menu, "Snap to grid", + GTK_SIGNAL_FUNC (HandleCommand), ID_SNAPTOGRID, TRUE); + g_object_set_data (G_OBJECT (window), "menu_snaptogrid", item); + + // Textures menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Textures"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + item = create_check_menu_item_with_mnemonic (menu, "Show In _Use", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_SHOWINUSE, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_showinuse", item); + item = create_check_menu_item_with_mnemonic (menu, "Show _All", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_SHOWALL, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_showall", item); + menu_separator (menu); + item = create_check_menu_item_with_mnemonic (menu, "Show shaders", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_SHADERS_SHOW, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_shaders_show", item); + item = create_menu_item_with_mnemonic (menu, "Flush & Reload Shaders", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_RELOADSHADERS); + g_object_set_data (G_OBJECT (window), "menu_textures_reloadshaders", item); + item = create_menu_item_with_mnemonic (menu, "Load directory...", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_LOAD); + g_object_set_data (G_OBJECT (window), "menu_textures_load", item); + item = create_menu_item_with_mnemonic (menu, "Directory list...", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_LOADLIST); + menu_separator (menu); + + item = create_menu_item_with_mnemonic (menu, "_Surface Inspector", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_INSPECTOR); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Render Quality"); + g_object_set_data (G_OBJECT (window), "render_quality_menu", menu_in_menu); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, NULL, "_Wireframe", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_WIREFRAME, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_wireframe", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "_Flat shade", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_FLATSHADE, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_flatshade", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "_Nearest", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_NEAREST, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_nearest", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "Nearest _Mipmap", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_NEARESTMIPMAP, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_nearestmipmap", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "_Linear", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_LINEAR, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_linear", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "_Bilinear", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_BILINEAR, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_bilinear", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "B_ilinear Mipmap", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_BILINEARMIPMAP, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_bilinearmipmap", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "T_rilinear", + GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_TRILINEAR, FALSE); + g_object_set_data (G_OBJECT (window), "menu_view_trilinear", item); + create_menu_item_with_mnemonic (menu, "Find / Replace...", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURE_REPLACEALL); + + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Texture Lock"); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Moves", + GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLE_LOCK, TRUE); + g_object_set_data (G_OBJECT (window), "menu_toggle_lock", item); + item = create_check_menu_item_with_mnemonic (menu_in_menu, "Rotations", + GTK_SIGNAL_FUNC (HandleCommand), ID_TOGGLE_ROTATELOCK, TRUE); + g_object_set_data (G_OBJECT (window), "menu_toggle_rotatelock", item); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Texture Window Scale"); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, NULL, "200%", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_TEXTUREWINDOWSCALE_200, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_texturewindowscale_200", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "100%", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_TEXTUREWINDOWSCALE_100, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_texturewindowscale_100", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "50%", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_TEXTUREWINDOWSCALE_50, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_texturewindowscale_50", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "25%", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_TEXTUREWINDOWSCALE_25, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_texturewindowscale_25", item); + item = create_radio_menu_item_with_mnemonic (menu_in_menu, item, "10%", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_TEXTUREWINDOWSCALE_10, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_texturewindowscale_10", item); + item = menu_separator (menu); + item = create_check_menu_item_with_mnemonic (menu, "shaderlist.txt only", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTURES_SHADERLISTONLY, FALSE); + g_object_set_data (G_OBJECT (window), "menu_textures_shaderlistonly", item); + item = menu_separator (menu); + g_object_set_data (G_OBJECT (window), "menu_textures_separator", item); + g_object_set_data (G_OBJECT (window), "menu_textures", menu); + + // Misc menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Misc"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + create_menu_item_with_mnemonic (menu, "_Benchmark", GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_BENCHMARK); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Colors"); + menu_3 = create_menu_in_menu_with_mnemonic (menu_in_menu, "Themes"); + create_menu_item_with_mnemonic (menu_3, "QE4 Original", GTK_SIGNAL_FUNC (HandleCommand), ID_COLOR_SETORIGINAL); + create_menu_item_with_mnemonic (menu_3, "Q3Radiant Original", GTK_SIGNAL_FUNC (HandleCommand), ID_COLOR_SETQER); + create_menu_item_with_mnemonic (menu_3, "Black and Green", GTK_SIGNAL_FUNC (HandleCommand), ID_COLOR_SETBLACK); + create_menu_item_with_mnemonic (menu_3, "Maya/Max/Lightwave Emulation", GTK_SIGNAL_FUNC (HandleCommand), ID_COLOR_SETYDNAR); + + menu_separator (menu_in_menu); + create_menu_item_with_mnemonic (menu_in_menu, "_Texture Background...", + GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTUREBK); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Background...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_XYBK); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Major...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_MAJOR); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Minor...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_MINOR); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Major Small...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_MAJOR_ALT); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Minor Small...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_MINOR_ALT); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Text...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_GRIDTEXT); + create_menu_item_with_mnemonic (menu_in_menu, "Grid Block...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_GRIDBLOCK); + create_menu_item_with_mnemonic (menu_in_menu, "Default Brush...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_BRUSH); + create_menu_item_with_mnemonic (menu_in_menu, "Camera Background...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_CAMERABACK); + create_menu_item_with_mnemonic (menu_in_menu, "Selected Brush...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_SELECTEDBRUSH); + create_menu_item_with_mnemonic (menu_in_menu, "Selected Brush (Camera)...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_SELECTEDBRUSH3D); + create_menu_item_with_mnemonic (menu_in_menu, "Clipper...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_CLIPPER); + create_menu_item_with_mnemonic (menu_in_menu, "Active View name...", + GTK_SIGNAL_FUNC (HandleCommand), ID_COLORS_VIEWNAME); + + create_menu_item_with_mnemonic (menu, "_Gamma...", + GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_GAMMA); + create_menu_item_with_mnemonic (menu, "Find brush...", + GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_FINDBRUSH); + item = create_menu_item_with_mnemonic (menu, "Next leak spot", + GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_NEXTLEAKSPOT); + item = create_menu_item_with_mnemonic (menu, "Previous leak spot", + GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_PREVIOUSLEAKSPOT); // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 -// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller()); +// create_menu_item_with_mnemonic (menu, "_Print XY View", GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_PRINTXY); + item = create_menu_item_with_mnemonic (menu, "_Select Entity Color...", + GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_SELECTENTITYCOLOR); + g_object_set_data (G_OBJECT (window), "menu_misc_selectentitycolor", item); - return misc_menu_item; -} - -GtkMenuItem* create_entity_menu() -{ - // Brush menu - GtkMenuItem* entity_menu_item = new_sub_menu_item_with_mnemonic("E_ntity"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(entity_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + // Region menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Region"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - Entity_constructMenu(menu); + create_menu_item_with_mnemonic (menu, "_Off", + GTK_SIGNAL_FUNC (HandleCommand), ID_REGION_OFF); + create_menu_item_with_mnemonic (menu, "_Set XY", + GTK_SIGNAL_FUNC (HandleCommand), ID_REGION_SETXY); + create_menu_item_with_mnemonic (menu, "Set _Tall Brush", + GTK_SIGNAL_FUNC (HandleCommand), ID_REGION_SETTALLBRUSH); + create_menu_item_with_mnemonic (menu, "Set _Brush", + GTK_SIGNAL_FUNC (HandleCommand), ID_REGION_SETBRUSH); + create_menu_item_with_mnemonic (menu, "Set Se_lected Brushes", + GTK_SIGNAL_FUNC (HandleCommand), ID_REGION_SETSELECTION); - return entity_menu_item; -} - -GtkMenuItem* create_brush_menu() -{ // Brush menu - GtkMenuItem* brush_menu_item = new_sub_menu_item_with_mnemonic("B_rush"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(brush_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_Brush"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - Brush_constructMenu(menu); + item = create_menu_item_with_mnemonic (menu, "3 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_3SIDED); + item = create_menu_item_with_mnemonic (menu, "4 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_4SIDED); + item = create_menu_item_with_mnemonic (menu, "5 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_5SIDED); + item = create_menu_item_with_mnemonic (menu, "6 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_6SIDED); + item = create_menu_item_with_mnemonic (menu, "7 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_7SIDED); + item = create_menu_item_with_mnemonic (menu, "8 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_8SIDED); + item = create_menu_item_with_mnemonic (menu, "9 sided", GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_9SIDED); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Arbitrary sided...", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_ARBITRARYSIDED); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Primitives"); + create_menu_item_with_mnemonic (menu_in_menu, "Cone...", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_MAKECONE); + create_menu_item_with_mnemonic (menu_in_menu, "Sphere...", + GTK_SIGNAL_FUNC (HandleCommand), ID_BRUSH_PRIMITIVES_SPHERE); - return brush_menu_item; -} - -GtkMenuItem* create_patch_menu() -{ // Curve menu - GtkMenuItem* patch_menu_item = new_sub_menu_item_with_mnemonic("_Curve"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(patch_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + if (!g_pGameDescription->mNoPatch) { - menu_tearoff(menu); - } - - Patch_constructMenu(menu); - - return patch_menu_item; -} - -GtkMenuItem* create_help_menu() -{ - // Help menu - GtkMenuItem* help_menu_item = new_sub_menu_item_with_mnemonic("_Help"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(help_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) + menu = create_sub_menu_with_mnemonic (menu_bar, "_Curve"); + if (g_PrefsDlg.m_bDetachableMenus) menu_tearoff (menu); - create_menu_item_with_mnemonic(menu, "Manual", "OpenManual"); + create_menu_item_with_mnemonic (menu, "Cylinder", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHTUBE); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "More Cylinders"); + create_menu_item_with_mnemonic (menu_in_menu, "Dense Cylinder", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHDENSETUBE); + create_menu_item_with_mnemonic (menu_in_menu, "Very Dense Cylinder", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHVERYDENSETUBE); + create_menu_item_with_mnemonic (menu_in_menu, "Square Cylinder", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHSQUARE); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "End cap", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHENDCAP); + create_menu_item_with_mnemonic (menu, "Bevel", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHBEVEL); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "More End caps, Bevels"); + create_menu_item_with_mnemonic (menu_in_menu, "Square Endcap", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_MOREENDCAPSBEVELS_SQUAREBEVEL); + create_menu_item_with_mnemonic (menu_in_menu, "Square Bevel", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_MOREENDCAPSBEVELS_SQUAREENDCAP); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Cone", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PATCHCONE); + item = create_menu_item_with_mnemonic (menu, "Sphere", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_PRIMITIVES_SPHERE); + gtk_widget_set_sensitive (item, FALSE); + menu_separator (menu); + item = create_menu_item_with_mnemonic (menu, "Simple Patch Mesh...", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_SIMPLEPATCHMESH); + g_object_set_data (G_OBJECT (window), "menu_simplepatchmesh", item); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Insert"); + create_menu_item_with_mnemonic (menu_in_menu, "Insert (2) Columns", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERT_INSERTCOLUMN); + create_menu_item_with_mnemonic (menu_in_menu, "Add (2) Columns", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERT_ADDCOLUMN); + menu_separator (menu_in_menu); + create_menu_item_with_mnemonic (menu_in_menu, "Insert (2) Rows", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERT_INSERTROW); + create_menu_item_with_mnemonic (menu_in_menu, "Add (2) Rows", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERT_ADDROW); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Delete"); + create_menu_item_with_mnemonic (menu_in_menu, "First (2) Columns", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETE_FIRSTCOLUMN); + create_menu_item_with_mnemonic (menu_in_menu, "Last (2) Columns", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETE_LASTCOLUMN); + menu_separator (menu_in_menu); + create_menu_item_with_mnemonic (menu_in_menu, "First (2) Rows", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETE_FIRSTROW); + create_menu_item_with_mnemonic (menu_in_menu, "Last (2) Rows", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETE_LASTROW); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Matrix"); + create_menu_item_with_mnemonic (menu_in_menu, "Invert", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_NEGATIVE); + menu_3 = create_menu_in_menu_with_mnemonic (menu_in_menu, "Re-disperse"); + create_menu_item_with_mnemonic (menu_3, "Rows", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_REDISPERSE_ROWS); + create_menu_item_with_mnemonic (menu_3, "Cols (Intermediate)", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_REDISPERSE_INTERMEDIATE_COLS); + create_menu_item_with_mnemonic (menu_3, "Rows (Intermediate)", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_REDISPERSE_INTERMEDIATE_ROWS); + create_menu_item_with_mnemonic (menu_in_menu, "Transpose", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_MATRIX_TRANSPOSE); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Cap Selection", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_CAP); + create_menu_item_with_mnemonic (menu, "Cycle Cap Texture", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_CYCLECAP); + menu_separator (menu); + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Overlay"); + create_menu_item_with_mnemonic (menu_in_menu, "Set", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_OVERLAY_SET); + create_menu_item_with_mnemonic (menu_in_menu, "Clear", + GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_OVERLAY_CLEAR); + menu_separator (menu); + create_menu_item_with_mnemonic (menu, "Thicken...", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_THICKEN); + } + // Plugins menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Plugins"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + /* + create_menu_item_with_mnemonic (menu, "Refresh", GTK_SIGNAL_FUNC (HandleCommand), ID_PLUGINS_REFRESH); + */ + // NOTE: the seperator is used when doing a refresh of the list, everything past the seperator is removed + item = menu_separator (menu); + g_object_set_data (G_OBJECT (window), "menu_plugin_separator", item); + g_object_set_data (G_OBJECT (window), "menu_plugin", menu); + + // Help menu + menu = create_sub_menu_with_mnemonic (menu_bar, "_Help"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + item = create_menu_item_with_mnemonic (menu, "Manual", + GTK_SIGNAL_FUNC (HandleCommand), ID_HELP); + gtk_widget_add_accelerator (item, "activate", accel, GDK_F1, (GdkModifierType)0, GTK_ACCEL_VISIBLE); // this creates all the per-game drop downs for the game pack helps // it will take care of hooking the Sys_OpenURL calls etc. - create_game_help_menu(menu); + create_game_help_menu(menu, accel); - create_menu_item_with_mnemonic(menu, "Bug report", FreeCaller()); - create_menu_item_with_mnemonic(menu, "Shortcuts list", FreeCaller()); - create_menu_item_with_mnemonic(menu, "_About", FreeCaller()); + // TTimo: this is in global.xlink now + //create_menu_item_with_mnemonic (menu, "Links", + // GTK_SIGNAL_FUNC (HandleCommand), ID_HELP_LINKS); + create_menu_item_with_mnemonic (menu, "Bug report", + GTK_SIGNAL_FUNC (HandleCommand), ID_HELP_BUGREPORT); + create_menu_item_with_mnemonic (menu, "Shortcuts list", + GTK_SIGNAL_FUNC (HandleCommand), ID_HELP_COMMANDLIST); + create_menu_item_with_mnemonic (menu, "_About", + GTK_SIGNAL_FUNC (HandleCommand), ID_HELP_ABOUT); - return help_menu_item; + + // leo: Hidden menu to make the accelerators work, + // this is a hack that needs to be changed later if someone has a better idea. + // NOTE TTimo + // maybe the better idea would be NOT to use any such accelerator scheme and do all key listening and interpret ourselves + menu = create_sub_menu_with_mnemonic (menu_bar, "Hidden"); + if (g_PrefsDlg.m_bDetachableMenus) + menu_tearoff (menu); + + gtk_widget_hide (gtk_menu_get_attach_widget (GTK_MENU (menu))); + + create_menu_item_with_mnemonic (menu, "BendMode", GTK_SIGNAL_FUNC (HandleCommand), ID_PATCH_BEND); + create_menu_item_with_mnemonic (menu, "FitTexture", GTK_SIGNAL_FUNC (HandleCommand), IDC_BTN_FACEFIT); + create_menu_item_with_mnemonic (menu, "ViewTextures", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_TEXTURE); + create_menu_item_with_mnemonic (menu, "PatchInspector", GTK_SIGNAL_FUNC (HandleCommand), ID_PATCH_INSPECTOR); + create_menu_item_with_mnemonic (menu, "InvertCurveTextureX", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_NEGATIVETEXTUREY); + create_menu_item_with_mnemonic (menu, "InvertCurveTextureY", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_NEGATIVETEXTUREX); + create_menu_item_with_mnemonic (menu, "IncPatchColumn", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERTCOLUMN); + create_menu_item_with_mnemonic (menu, "IncPatchRow", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_INSERTROW); + create_menu_item_with_mnemonic (menu, "DecPatchColumn", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETECOLUMN); + create_menu_item_with_mnemonic (menu, "DecPatchRow", GTK_SIGNAL_FUNC (HandleCommand), ID_CURVE_DELETEROW); + create_menu_item_with_mnemonic (menu, "Patch TAB", GTK_SIGNAL_FUNC (HandleCommand), ID_PATCH_TAB); + create_menu_item_with_mnemonic (menu, "Patch TAB", GTK_SIGNAL_FUNC (HandleCommand), ID_PATCH_TAB); + create_menu_item_with_mnemonic (menu, "SelectNudgeDown", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGEDOWN); + create_menu_item_with_mnemonic (menu, "CameraForward", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_FORWARD); + create_menu_item_with_mnemonic (menu, "CameraBack", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_BACK); + create_menu_item_with_mnemonic (menu, "CameraLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_LEFT); + create_menu_item_with_mnemonic (menu, "CameraRight", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_RIGHT); + create_menu_item_with_mnemonic (menu, "CameraUp", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_UP); + create_menu_item_with_mnemonic (menu, "CameraDown", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_DOWN); + create_menu_item_with_mnemonic (menu, "CameraAngleUp", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_ANGLEUP); + create_menu_item_with_mnemonic (menu, "CameraAngleDown", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_ANGLEDOWN); + create_menu_item_with_mnemonic (menu, "CameraStrafeRight", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_STRAFERIGHT); + create_menu_item_with_mnemonic (menu, "CameraStrafeLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_CAMERA_STRAFELEFT); + create_menu_item_with_mnemonic (menu, "ToggleGrid", GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_TOGGLE); + create_menu_item_with_mnemonic (menu, "ToggleCrosshairs", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CROSSHAIR); + create_menu_item_with_mnemonic (menu, "ToggleRealtime", GTK_SIGNAL_FUNC (HandleCommand), ID_VIEW_CAMERAUPDATE); + create_menu_item_with_mnemonic (menu, "MouseRotate", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_MOUSEROTATE); + create_menu_item_with_mnemonic (menu, "TexRotateClock", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECLOCK); + create_menu_item_with_mnemonic (menu, "TexRotateCounter", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECOUNTER); + create_menu_item_with_mnemonic (menu, "TexScaleUp", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALEUP); + create_menu_item_with_mnemonic (menu, "TexScaleDown", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALEDOWN); + create_menu_item_with_mnemonic (menu, "TexShiftLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SHIFTLEFT); + create_menu_item_with_mnemonic (menu, "TexShiftRight", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SHIFTRIGHT); + create_menu_item_with_mnemonic (menu, "TexShiftUp", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SHIFTUP); + create_menu_item_with_mnemonic (menu, "TexShiftDown", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SHIFTDOWN); + create_menu_item_with_mnemonic (menu, "GridDown", GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_PREV); + create_menu_item_with_mnemonic (menu, "GridUp", GTK_SIGNAL_FUNC (HandleCommand), ID_GRID_NEXT); + create_menu_item_with_mnemonic (menu, "TexScaleLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALELEFT); + create_menu_item_with_mnemonic (menu, "TexScaleRight", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALERIGHT); + create_menu_item_with_mnemonic (menu, "MoveSelectionDOWN", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MOVEDOWN); + create_menu_item_with_mnemonic (menu, "MoveSelectionUP", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MOVEUP); + create_menu_item_with_mnemonic (menu, "DumpSelectedBrush", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_PRINT); + create_menu_item_with_mnemonic (menu, "ToggleSizePaint", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TOGGLESIZEPAINT); + create_menu_item_with_mnemonic (menu, "SelectNudgeLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGELEFT); + create_menu_item_with_mnemonic (menu, "SelectNudgeRight", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGERIGHT); + create_menu_item_with_mnemonic (menu, "SelectNudgeUp", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGEUP); + create_menu_item_with_mnemonic (menu, "NaturalizePatch", GTK_SIGNAL_FUNC (HandleCommand), ID_PATCH_NATURALIZE); + create_menu_item_with_mnemonic (menu, "SnapPatchToGrid", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_SNAPTOGRID); + create_menu_item_with_mnemonic (menu, "SelectAllOfType", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_ALL); + create_menu_item_with_mnemonic (menu, "CycleOutlineStyle", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_OUTLINESTYLE); + create_menu_item_with_mnemonic (menu, "TextureWindowScaleup", GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTUREWINDOW_SCALEUP); + create_menu_item_with_mnemonic (menu, "TextureWindowScaledown", GTK_SIGNAL_FUNC (HandleCommand), ID_TEXTUREWINDOW_SCALEDOWN); + + g_bIgnoreCommands--; } -GtkMenuBar* create_main_menu(MainFrame::EViewStyle style) +void MainFrame::create_main_toolbar (GtkWidget *window, GtkWidget *vbox) { - GtkMenuBar* menu_bar = GTK_MENU_BAR(gtk_menu_bar_new()); - gtk_widget_show(GTK_WIDGET(menu_bar)); + GtkWidget *handle_box, *toolbar, *w; - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_file_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_edit_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_view_menu(style))); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_selection_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_bsp_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_grid_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_misc_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_entity_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_brush_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_patch_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_plugins_menu())); - gtk_container_add(GTK_CONTAINER(menu_bar), GTK_WIDGET(create_help_menu())); + handle_box = gtk_handle_box_new (); + gtk_box_pack_start (GTK_BOX (vbox), handle_box, FALSE, FALSE, 0); + gtk_widget_show (handle_box); + g_object_set_data (G_OBJECT (window), "tb_handle_box", handle_box); - return menu_bar; -} + toolbar = gtk_toolbar_new (); + gtk_toolbar_set_orientation (GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL); + gtk_toolbar_set_style (GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); + // gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), user_rc.toolbar_style); + gtk_container_add (GTK_CONTAINER (handle_box), toolbar); + gtk_widget_show (toolbar); -void PatchInspector_registerShortcuts() -{ - command_connect_accelerator("PatchInspector"); -} + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Open", "Open an existing map", "", + new_pixmap (window, "file_open.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_FILE_OPEN)); + g_object_set_data (G_OBJECT (window), "tb_file_open", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Save", "Save the active map", "", + new_pixmap (window, "file_save.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_FILE_SAVE)); + g_object_set_data (G_OBJECT (window), "tb_file_save", w); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "x-axis Flip", "", + new_pixmap (window, "brush_flipx.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_FLIPX)); + g_object_set_data (G_OBJECT (window), "tb_brush_flipx", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "x-axis Rotate", "", + new_pixmap (window, "brush_rotatex.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_ROTATEX)); + g_object_set_data (G_OBJECT (window), "tb_brush_rotatex", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "y-axis Flip", "", + new_pixmap (window, "brush_flipy.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_FLIPY)); + g_object_set_data (G_OBJECT (window), "tb_brush_flipy", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "y-axis Rotate", "", + new_pixmap (window, "brush_rotatey.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_ROTATEY)); + g_object_set_data (G_OBJECT (window), "tb_brush_rotatey", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "z-axis Flip", "", + new_pixmap (window, "brush_flipz.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_FLIPZ)); + g_object_set_data (G_OBJECT (window), "tb_brush_flipz", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "z-axis Rotate", "", + new_pixmap (window, "brush_rotatez.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_BRUSH_ROTATEZ)); + g_object_set_data (G_OBJECT (window), "tb_brush_rotatez", w); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); -void Patch_registerShortcuts() -{ - command_connect_accelerator("InvertCurveTextureX"); - command_connect_accelerator("InvertCurveTextureY"); - command_connect_accelerator("IncPatchColumn"); - command_connect_accelerator("IncPatchRow"); - command_connect_accelerator("DecPatchColumn"); - command_connect_accelerator("DecPatchRow"); - command_connect_accelerator("NaturalizePatch"); - //command_connect_accelerator("CapCurrentCurve"); -} + if (g_PrefsDlg.m_bWideToolbar) + { + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Complete Tall", "", + new_pixmap (window, "selection_selectcompletetall.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_SELECTION_SELECTCOMPLETETALL)); + g_object_set_data (G_OBJECT (window), "tb_selection_selectcompletetall", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Select Touching", "", + new_pixmap (window, "selection_selecttouching.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_SELECTION_SELECTTOUCHING)); + g_object_set_data (G_OBJECT (window), "tb_selection_selecttouching", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Select Partial Tall", "", + new_pixmap (window, "selection_selectpartialtall.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_SELECTION_SELECTPARTIALTALL)); + g_object_set_data (G_OBJECT (window), "tb_selection_selectpartialtall", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Select Inside", "", + new_pixmap (window, "selection_selectinside.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_SELECTION_SELECTINSIDE)); + g_object_set_data (G_OBJECT (window), "tb_selection_selectinside", w); + } else + { + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Selection", "", + new_pixmap (window, "popup_selection.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_POPUP_SELECTION)); + g_object_set_data (G_OBJECT (window), "tb_popup_selection", w); + } + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); -void Manipulators_registerShortcuts() -{ - toggle_add_accelerator("MouseRotate"); - toggle_add_accelerator("MouseTranslate"); - toggle_add_accelerator("MouseScale"); - toggle_add_accelerator("MouseDrag"); - toggle_add_accelerator("ToggleClipper"); -} + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "CSG Subtract", "", + new_pixmap (window, "selection_csgsubtract.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SELECTION_CSGSUBTRACT)); + g_object_set_data (G_OBJECT (window), "tb_selection_csgsubtract", w); -void TexdefNudge_registerShortcuts() -{ - command_connect_accelerator("TexRotateClock"); - command_connect_accelerator("TexRotateCounter"); - command_connect_accelerator("TexScaleUp"); - command_connect_accelerator("TexScaleDown"); - command_connect_accelerator("TexScaleLeft"); - command_connect_accelerator("TexScaleRight"); - command_connect_accelerator("TexShiftUp"); - command_connect_accelerator("TexShiftDown"); - command_connect_accelerator("TexShiftLeft"); - command_connect_accelerator("TexShiftRight"); -} + if (g_PrefsDlg.m_bWideToolbar) + { + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "CSG Merge", "", + new_pixmap (window, "selection_csgmerge.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SELECTION_CSGMERGE)); + g_object_set_data (G_OBJECT (window), "tb_selection_csgmerge", w); + } -void SelectNudge_registerShortcuts() -{ - command_connect_accelerator("MoveSelectionDOWN"); - command_connect_accelerator("MoveSelectionUP"); - //command_connect_accelerator("SelectNudgeLeft"); - //command_connect_accelerator("SelectNudgeRight"); - //command_connect_accelerator("SelectNudgeUp"); - //command_connect_accelerator("SelectNudgeDown"); -} + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Hollow", "", + new_pixmap (window, "selection_makehollow.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SELECTION_MAKEHOLLOW)); + g_object_set_data (G_OBJECT (window), "tb_selection_makehollow", w); -void SnapToGrid_registerShortcuts() -{ - command_connect_accelerator("SnapToGrid"); -} - -void SelectByType_registerShortcuts() -{ - command_connect_accelerator("SelectAllOfType"); -} - -void SurfaceInspector_registerShortcuts() -{ - command_connect_accelerator("FitTexture"); -} - - -void register_shortcuts() -{ - PatchInspector_registerShortcuts(); - Patch_registerShortcuts(); - Grid_registerShortcuts(); - XYWnd_registerShortcuts(); - CamWnd_registerShortcuts(); - Manipulators_registerShortcuts(); - SurfaceInspector_registerShortcuts(); - TexdefNudge_registerShortcuts(); - SelectNudge_registerShortcuts(); - SnapToGrid_registerShortcuts(); - SelectByType_registerShortcuts(); -} - -void File_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "Open an existing map (CTRL + O)", "file_open.bmp", "OpenMap"); - toolbar_append_button(toolbar, "Save the active map (CTRL + S)", "file_save.bmp", "SaveMap"); -} - -void UndoRedo_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "Undo (CTRL + Z)", "undo.bmp", "Undo"); - toolbar_append_button(toolbar, "Redo (CTRL + Y)", "redo.bmp", "Redo"); -} - -void RotateFlip_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "x-axis Flip", "brush_flipx.bmp", "MirrorSelectionX"); - toolbar_append_button(toolbar, "x-axis Rotate", "brush_rotatex.bmp", "RotateSelectionX"); - toolbar_append_button(toolbar, "y-axis Flip", "brush_flipy.bmp", "MirrorSelectionY"); - toolbar_append_button(toolbar, "y-axis Rotate", "brush_rotatey.bmp", "RotateSelectionY"); - toolbar_append_button(toolbar, "z-axis Flip", "brush_flipz.bmp", "MirrorSelectionZ"); - toolbar_append_button(toolbar, "z-axis Rotate", "brush_rotatez.bmp", "RotateSelectionZ"); -} - -void Select_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "Select touching", "selection_selecttouching.bmp", "SelectTouching"); - toolbar_append_button(toolbar, "Select inside", "selection_selectinside.bmp", "SelectInside"); -} - -void CSG_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "CSG Subtract (SHIFT + U)", "selection_csgsubtract.bmp", "CSGSubtract"); - toolbar_append_button(toolbar, "CSG Merge (CTRL + U)", "selection_csgmerge.bmp", "CSGMerge"); - toolbar_append_button(toolbar, "Hollow", "selection_makehollow.bmp", "CSGHollow"); -} - -void ComponentModes_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_toggle_button(toolbar, "Select Vertices (V)", "modify_vertices.bmp", "DragVertices"); - toolbar_append_toggle_button(toolbar, "Select Edges (E)", "modify_edges.bmp", "DragEdges"); - toolbar_append_toggle_button(toolbar, "Select Faces (F)", "modify_faces.bmp", "DragFaces"); -} - -void Clipper_constructToolbar(GtkToolbar* toolbar) -{ - - toolbar_append_toggle_button(toolbar, "Clipper (X)", "view_clipper.bmp", "ToggleClipper"); -} - -void XYWnd_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "Change views", "view_change.bmp", "NextView"); -} - -void Manipulators_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_toggle_button(toolbar, "Translate (W)", "select_mousetranslate.bmp", "MouseTranslate"); - toolbar_append_toggle_button(toolbar, "Rotate (R)", "select_mouserotate.bmp", "MouseRotate"); - toolbar_append_toggle_button(toolbar, "Scale", "select_mousescale.bmp", "MouseScale"); - toolbar_append_toggle_button(toolbar, "Resize (Q)", "select_mouseresize.bmp", "MouseDrag"); - - Clipper_constructToolbar(toolbar); -} - -GtkToolbar* create_main_toolbar(MainFrame::EViewStyle style) -{ - GtkToolbar* toolbar = GTK_TOOLBAR(gtk_toolbar_new()); - gtk_toolbar_set_orientation(toolbar, GTK_ORIENTATION_HORIZONTAL); - gtk_toolbar_set_style(toolbar, GTK_TOOLBAR_ICONS); - - gtk_widget_show(GTK_WIDGET(toolbar)); - - File_constructToolbar(toolbar); + if (g_PrefsDlg.m_bWideToolbar) + { + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Clipper", "", new_pixmap (window, "view_clipper.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_CLIPPER)); + g_object_set_data (G_OBJECT (window), "tb_view_clipper", w); + } gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - UndoRedo_constructToolbar(toolbar); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Change views", "", + new_pixmap (window, "view_change.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_VIEW_CHANGE)); + g_object_set_data (G_OBJECT (window), "tb_view_change", w); - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - RotateFlip_constructToolbar(toolbar); - - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - Select_constructToolbar(toolbar); - - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - CSG_constructToolbar(toolbar); - - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - ComponentModes_constructToolbar(toolbar); - - if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating) + if (!g_PrefsDlg.m_bWideToolbar) { gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + } - XYWnd_constructToolbar(toolbar); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Texture view mode", "", + new_pixmap (window, "textures_popup.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_TEXTURES_POPUP)); + g_object_set_data (G_OBJECT (window), "tb_textures_popup", w); + + if (g_PrefsDlg.m_bWideToolbar) + { + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Cubic clip the camera view", "", + new_pixmap (window, "view_cubicclipping.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_CUBICCLIPPING)); + g_object_set_data (G_OBJECT (window), "tb_view_cubicclipping", w); } gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - CamWnd_constructToolbar(toolbar); + if (!g_PrefsDlg.m_bWideToolbar) + { + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Camera preview", "", new_pixmap (window, "view_cameratoggle.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_CAMERATOGGLE)); + g_object_set_data (G_OBJECT (window), "tb_view_cameratoggle", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Update Camera", "", + new_pixmap (window, "view_cameraupdate.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_VIEW_CAMERAUPDATE)); + g_object_set_data (G_OBJECT (window), "tb_view_cameraupdate", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Cubic clip the camera view", "", + new_pixmap (window, "view_cubicclipping.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_CUBICCLIPPING)); + g_object_set_data (G_OBJECT (window), "tb_view_cubicclipping", w); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Entity inspector", "", new_pixmap (window, "view_entity.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_ENTITY)); + g_object_set_data (G_OBJECT (window), "tb_view_entity", w); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Clipper", "", new_pixmap (window, "view_clipper.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_VIEW_CLIPPER)); + g_object_set_data (G_OBJECT (window), "tb_view_clipper", w); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + } + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Free Rotation", "", new_pixmap (window, "select_mouserotate.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SELECT_MOUSEROTATE)); + g_object_set_data (G_OBJECT (window), "tb_select_mouserotate", w); gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Free Scaling", "", new_pixmap (window, "select_mousescale.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SELECT_MOUSESCALE)); + g_object_set_data (G_OBJECT (window), "tb_select_mousescale", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Scale X", "", new_pixmap (window, "scalelockx.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SCALELOCKX)); + g_object_set_data (G_OBJECT (window), "tb_scalelockx", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Scale Y", "", new_pixmap (window, "scalelocky.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SCALELOCKY)); + g_object_set_data (G_OBJECT (window), "tb_scalelocky", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Scale Z", "", new_pixmap (window, "scalelockz.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_SCALELOCKZ)); + g_object_set_data (G_OBJECT (window), "tb_scalelockz", w); - Manipulators_constructToolbar(toolbar); - - if (g_Layout_enablePatchToolbar.m_value) + if (g_PrefsDlg.m_bWideToolbar) { gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Don't select model brushes", "", + new_pixmap (window, "dontselectmodel.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_DONTSELECTMODEL)); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + g_object_set_data (G_OBJECT (window), "tb_dontselectmodel", w); - Patch_constructToolbar(toolbar); + if (!g_pGameDescription->mNoPatch) + { + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Don't select curved brushes", "", + new_pixmap (window, "dontselectcurve.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_DONTSELECTCURVE)); + g_object_set_data (G_OBJECT (window), "tb_dontselectcurve", w); + } } - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - toolbar_append_toggle_button(toolbar, "Texture Lock (SHIFT +T)", "texture_lock.bmp", "TogTexLock"); - - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - GtkButton* g_view_entities_button = toolbar_append_button(toolbar, "Entities (N)", "entities.bmp", "ToggleEntityInspector"); - GtkButton* g_view_console_button = toolbar_append_button(toolbar, "Console (O)", "console.bmp", "ToggleConsole"); - GtkButton* g_view_textures_button = toolbar_append_button(toolbar, "Texture Browser (T)", "texture_browser.bmp", "ToggleTextures"); - // TODO: call light inspector - //GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.bmp", "ToggleLightInspector"); - - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - GtkButton* g_refresh_models_button = toolbar_append_button(toolbar, "Refresh Models", "refresh_models.bmp", "RefreshReferences"); - - - // disable the console and texture button in the regular layouts - if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft) + // bug #292, patch toolbar option + if (g_PrefsDlg.m_bPatchToolbar) { - gtk_widget_set_sensitive(GTK_WIDGET(g_view_console_button), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(g_view_textures_button), FALSE); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Show patch bounding box", "", + new_pixmap (window, "patch_showboundingbox.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_PATCH_SHOWBOUNDINGBOX)); + g_object_set_data (G_OBJECT (window), "tb_patch_showboundingbox", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Show patches as wireframes", "", + new_pixmap (window, "patch_wireframe.bmp"), + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (ID_PATCH_WIREFRAME)); + g_object_set_data (G_OBJECT (window), "tb_patch_wireframe", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Patch Bend mode", "", + new_pixmap (window, "patch_bend.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_PATCH_BEND)); + g_object_set_data (G_OBJECT (window), "tb_patch_bend", w); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Put caps on the current patch", "", + new_pixmap (window, "curve_cap.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_CURVE_CAP)); + g_object_set_data (G_OBJECT (window), "tb_curve_cap", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Welds equal patch points during moves", "", + new_pixmap (window, "patch_weld.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_PATCH_WELD)); + g_object_set_data (G_OBJECT (window), "tb_patch_weld", w); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, + "", "Selects drill down rows and columns", "", + new_pixmap (window, "patch_drilldown.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_PATCH_DRILLDOWN)); + g_object_set_data (G_OBJECT (window), "tb_patch_drilldown", w); } - return toolbar; + if (g_PrefsDlg.m_bWideToolbar) + { + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + w = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "", "Show Entities as", "", + new_pixmap (window, "show_entities.bmp"), GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ID_SHOW_ENTITIES)); + g_object_set_data (G_OBJECT (window), "tb_show_entities", w); + } + + /* + uh? that is OLD +#ifndef QUAKE3 + w = g_object_get_data (G_OBJECT (window), "tb_dontselectcurve"); + gtk_widget_hide (w); + w = g_object_get_data (G_OBJECT (window), "tb_patch_showboundingbox"); + gtk_widget_hide (w); + w = g_object_get_data (G_OBJECT (window), "tb_patch_weld"); + gtk_widget_hide (w); + w = g_object_get_data (G_OBJECT (window), "tb_patch_wireframe"); + gtk_widget_hide (w); +#endif + */ + + m_bCamPreview = true; + g_nScaleHow = (SCALE_X | SCALE_Y | SCALE_Z); } -GtkWidget* create_main_statusbar(GtkWidget *pStatusLabel[c_count_status]) +void MainFrame::create_plugin_toolbar (GtkWidget *window, GtkWidget *vbox) { - GtkTable* table = GTK_TABLE(gtk_table_new(1, c_count_status, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); + GtkWidget *handle_box, *toolbar; - { - GtkLabel* label = GTK_LABEL(gtk_label_new ("Label")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_misc_set_padding(GTK_MISC(label), 4, 2); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach_defaults(table, GTK_WIDGET(label), 0, 1, 0, 1); - pStatusLabel[c_command_status] = GTK_WIDGET(label); - } + handle_box = gtk_handle_box_new (); + gtk_box_pack_start (GTK_BOX (vbox), handle_box, FALSE, FALSE, 0); + if (g_PrefsDlg.m_bPluginToolbar) + gtk_widget_show (handle_box); + g_object_set_data (G_OBJECT (window), "tb_handle_box", handle_box); - for(int i = 1; i < c_count_status; ++i) - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new(0)); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_table_attach_defaults(table, GTK_WIDGET(frame), i, i + 1, 0, 1); - gtk_frame_set_shadow_type(frame, GTK_SHADOW_IN); - - GtkLabel* label = GTK_LABEL(gtk_label_new ("Label")); - gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_misc_set_padding(GTK_MISC(label), 4, 2); - gtk_widget_show(GTK_WIDGET(label)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(label)); - pStatusLabel[i] = GTK_WIDGET(label); - } - - return GTK_WIDGET(table); + toolbar = gtk_toolbar_new(); + gtk_toolbar_set_orientation (GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL); + gtk_toolbar_set_style (GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); + // gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), user_rc.toolbar_style); + gtk_container_add (GTK_CONTAINER (handle_box), toolbar); + g_object_set_data (G_OBJECT (window), "toolbar_plugin", toolbar); + gtk_widget_show (toolbar); } -#if 0 - - -WidgetFocusPrinter g_mainframeWidgetFocusPrinter("mainframe"); - -class WindowFocusPrinter +void MainFrame::create_main_statusbar (GtkWidget *window, GtkWidget *vbox) { - const char* m_name; + GtkWidget *hbox, *hbox1; + GtkWidget *frame; + GtkWidget *label; - static gboolean frame_event(GtkWidget *widget, GdkEvent* event, WindowFocusPrinter* self) + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + gtk_widget_set_usize (hbox, -1, 24); + gtk_container_border_width (GTK_CONTAINER (hbox), 1); + gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, TRUE, 2); + + frame = gtk_frame_new ((char*)NULL); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (frame), hbox1); + gtk_container_border_width (GTK_CONTAINER (hbox1), 0); + gtk_widget_show (hbox1); + + label = gtk_label_new (" Label "); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_padding (GTK_MISC (label), 3, 0); + m_pStatusLabel[0] = label; + + for (int i = 1; i < 6; i++) { - globalOutputStream() << self->m_name << " frame_event\n"; - return FALSE; + frame = gtk_frame_new ((char*)NULL); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + label = gtk_label_new (" Label "); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (frame), label); + m_pStatusLabel[i] = label; } - static gboolean keys_changed(GtkWidget *widget, WindowFocusPrinter* self) +} + +guint s_idle_id; +static gint mainframe_idle (gpointer user_data) +{ + g_pParentWnd->RoutineProcessing (); + return TRUE; +} + +static void Sys_Iconify (GtkWidget *w); +static void Sys_Restore (GtkWidget *w); + +inline void CHECK_RESTORE(GtkWidget* w) +{ + if (g_object_get_data (G_OBJECT (w), "was_mapped") != NULL) + gtk_widget_show (w); +} + + +// this is called when the window is restored from the iconified state +static void mainframe_map (GtkWidget *widget) +{ + if (g_pParentWnd->IsSleeping ()) + g_pParentWnd->OnSleep (); + + if ((g_pParentWnd->CurrentStyle() == MainFrame::eFloating) && (widget == g_pParentWnd->m_pWidget)) { - globalOutputStream() << self->m_name << " keys_changed\n"; - return FALSE; + // restore previously visible windows + CHECK_RESTORE (g_pParentWnd->GetCamWnd ()->m_pParent); + if (g_PrefsDlg.m_bFloatingZ) + CHECK_RESTORE (g_pParentWnd->GetZWnd ()->m_pParent); + CHECK_RESTORE (g_pParentWnd->GetXYWnd ()->m_pParent); + CHECK_RESTORE (g_pParentWnd->GetXZWnd ()->m_pParent); + CHECK_RESTORE (g_pParentWnd->GetYZWnd ()->m_pParent); + CHECK_RESTORE (g_pGroupDlg->m_pWidget); } - static gboolean notify(GtkWindow* window, gpointer dummy, WindowFocusPrinter* self) +} + +inline void CHECK_MINIMIZE(GtkWidget* w) +{ + g_object_set_data (G_OBJECT (w), "was_mapped", (void*)(GTK_WIDGET_VISIBLE (w) != 0)); + gtk_widget_hide (w); +} + +static void mainframe_unmap (GtkWidget *widget) +{ + + if ((g_pParentWnd->CurrentStyle() == MainFrame::eFloating) && (widget == g_pParentWnd->m_pWidget)) { - if(gtk_window_is_active(window)) - { - globalOutputStream() << self->m_name << " takes toplevel focus\n"; - } - else - { - globalOutputStream() << self->m_name << " loses toplevel focus\n"; - } - return FALSE; + // minimize all other windows when the main window is minimized + CHECK_MINIMIZE (g_pParentWnd->GetCamWnd ()->m_pParent); + if (g_PrefsDlg.m_bFloatingZ) + CHECK_MINIMIZE (g_pParentWnd->GetZWnd ()->m_pParent); + CHECK_MINIMIZE (g_pParentWnd->GetXYWnd ()->m_pParent); + CHECK_MINIMIZE (g_pParentWnd->GetXZWnd ()->m_pParent); + CHECK_MINIMIZE (g_pParentWnd->GetYZWnd ()->m_pParent); + CHECK_MINIMIZE (g_pGroupDlg->m_pWidget); } -public: - WindowFocusPrinter(const char* name) : m_name(name) +} + +static GtkWidget* create_floating (MainFrame* mainframe) +{ + GtkWidget *wnd = gtk_window_new (GTK_WINDOW_TOPLEVEL); + //if (mainframe->CurrentStyle() != MainFrame::eFloating) + gtk_window_set_transient_for (GTK_WINDOW (wnd), GTK_WINDOW (mainframe->m_pWidget)); + gtk_widget_set_events (wnd, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); + gtk_signal_connect (GTK_OBJECT (wnd), "delete_event", GTK_SIGNAL_FUNC (widget_delete_hide), NULL); + gtk_signal_connect (GTK_OBJECT (wnd), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); + gtk_signal_connect (GTK_OBJECT (wnd), "key_press_event", + GTK_SIGNAL_FUNC (mainframe_keypress), mainframe); + gtk_signal_connect (GTK_OBJECT (wnd), "key_release_event", + GTK_SIGNAL_FUNC (mainframe_keyrelease), mainframe); + gtk_signal_connect (GTK_OBJECT (wnd), "map_event", + GTK_SIGNAL_FUNC (mainframe_map), mainframe); + + gtk_window_set_default_size (GTK_WINDOW (wnd), 100, 100); + +#ifdef DBG_WINDOWPOS + Sys_Printf("create_floating: %p, gtk_window_set_default_size 100, 100\n", wnd); +#endif + + return wnd; +} + +void console_populate_popup(GtkTextView* textview, GtkMenu* menu, gpointer user_data) +{ + menu_separator(GTK_WIDGET(menu)); + + GtkWidget* item = gtk_menu_item_new_with_label ("Clear"); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (Sys_ClearPrintf), NULL); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); +} + +void console_construct(GtkWidget* textview) +{ + g_signal_connect(G_OBJECT(textview), "populate-popup", G_CALLBACK(console_populate_popup), NULL); +} + +extern MemStream g_Clipboard; + +void Clipboard_CopyMap() +{ + g_Clipboard.SetLength(0); + Map_Export (&g_Clipboard, "xmap", false, true); +} + +void Clipboard_PasteMap() +{ + if (g_Clipboard.GetLength() > 0) { + g_Clipboard.Seek(0, SEEK_SET); + Map_Import(&g_Clipboard, "xmap", true); } - void connect(GtkWindow* toplevel_window) - { - g_signal_connect(G_OBJECT(toplevel_window), "notify::has_toplevel_focus", G_CALLBACK(notify), this); - g_signal_connect(G_OBJECT(toplevel_window), "notify::is_active", G_CALLBACK(notify), this); - g_signal_connect(G_OBJECT(toplevel_window), "keys_changed", G_CALLBACK(keys_changed), this); - g_signal_connect(G_OBJECT(toplevel_window), "frame_event", G_CALLBACK(frame_event), this); - } +} + +/*! +Platform-independent GTK clipboard support. +\todo Using GDK_SELECTION_CLIPBOARD fails on win32, so we use the win32 API directly for now. +*/ +#if defined (__linux__) || defined (__APPLE__) + +enum +{ + RADIANT_CLIPPINGS = 23, }; -WindowFocusPrinter g_mainframeFocusPrinter("mainframe"); +static const GtkTargetEntry clipboard_targets[] = { + { "RADIANT_CLIPPINGS", 0, RADIANT_CLIPPINGS, }, +}; + +static void clipboard_get (GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer user_data_or_owner) +{ + guchar *buffer; + gint len; + GdkAtom type = GDK_NONE; + + len = g_Clipboard.GetLength(); + + if (!len) + { + buffer = NULL; + } else + { + buffer = g_Clipboard.GetBuffer (); + } + + if(info == clipboard_targets[0].info) + { + type = gdk_atom_intern(clipboard_targets[0].target, FALSE); + } + + gtk_selection_data_set (selection_data, type, 8, buffer, len); +} + +static void clipboard_clear (GtkClipboard *clipboard, gpointer user_data_or_owner) +{ +} + +static void clipboard_received (GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data) +{ + g_Clipboard.SetLength (0); + + if (data->length < 0) + Sys_FPrintf(SYS_ERR, "Error retrieving selection\n"); + else if(strcmp(gdk_atom_name(data->type), clipboard_targets[0].target) == 0) + g_Clipboard.Write (data->data, data->length); + + Clipboard_PasteMap(); +} + +void clipboard_copy() +{ + Clipboard_CopyMap(); + + GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + + gtk_clipboard_set_with_data (clipboard, clipboard_targets, 1, clipboard_get, clipboard_clear, NULL); +} + +void clipboard_paste() +{ + GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + + gtk_clipboard_request_contents (clipboard, gdk_atom_intern(clipboard_targets[0].target, FALSE), clipboard_received, NULL); +} + + +#elif defined(WIN32) + +void clipboard_copy() +{ + Clipboard_CopyMap(); + + bool bClipped = false; + UINT nClipboard = ::RegisterClipboardFormat("RadiantClippings"); + if (nClipboard > 0) + { + if (::OpenClipboard(NULL)) + { + EmptyClipboard(); + long lSize = g_Clipboard.GetLength(); + HANDLE h = ::GlobalAlloc(GMEM_ZEROINIT | GMEM_MOVEABLE | GMEM_DDESHARE, lSize + sizeof(long)); + if (h != NULL) + { + unsigned char *cp = reinterpret_cast(::GlobalLock(h)); + memcpy(cp, &lSize, sizeof(long)); + cp += sizeof(long); + g_Clipboard.Seek(0, SEEK_SET); + g_Clipboard.Read(cp, lSize); + ::GlobalUnlock(h); + ::SetClipboardData(nClipboard, h); + ::CloseClipboard(); + bClipped = true; + } + } + } + + if (!bClipped) + { + Sys_Printf("Unable to register Windows clipboard formats, copy/paste between editors will not be possible\n"); + } +} + +void clipboard_paste() +{ + bool bPasted = false; + UINT nClipboard = ::RegisterClipboardFormat("RadiantClippings"); + if (nClipboard > 0 && ::OpenClipboard(NULL)) + { + if(IsClipboardFormatAvailable(nClipboard)) + { + HANDLE h = ::GetClipboardData(nClipboard); + if (h) + { + g_Clipboard.SetLength(0); + unsigned char *cp = reinterpret_cast(::GlobalLock(h)); + long lSize = 0; + memcpy(&lSize, cp, sizeof(long)); + cp += sizeof(long); + g_Clipboard.Write(cp, lSize); + ::GlobalUnlock(h); + } + } + ::CloseClipboard(); + } + + Clipboard_PasteMap(); +} #endif -class MainWindowActive +void MainFrame::Copy() { - static gboolean notify(GtkWindow* window, gpointer dummy, MainWindowActive* self) + clipboard_copy(); +} + +void MainFrame::Paste() +{ + clipboard_paste(); + UpdateSurfaceDialog(); +} + + +#ifdef DBG_WINDOWPOS +GtkWidget *watchit = NULL; + +void CheckWatchit(char *msg) +{ + static int width = 0; + if ((watchit!=NULL) && (watchit->allocation.width != width)) { - if(g_wait.m_window != 0 && gtk_window_is_active(window) && !GTK_WIDGET_VISIBLE(g_wait.m_window)) - { - gtk_widget_show(GTK_WIDGET(g_wait.m_window)); - } - - return FALSE; - } -public: - void connect(GtkWindow* toplevel_window) - { - g_signal_connect(G_OBJECT(toplevel_window), "notify::is-active", G_CALLBACK(notify), this); + Sys_Printf("CheckWatchit %s: %d\n", msg, watchit->allocation.width); + width = watchit->allocation.width; } +} +#endif + +#ifdef _WIN32 +BOOL CALLBACK m_pCountMonitor (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) +{ + int *n = (int *) dwData; + + (*n)++; + + return TRUE; +} + +struct monitorInfo_s { + GdkRectangle *win_monitors; + int i_win_mon; }; -MainWindowActive g_MainWindowActive; - -SignalHandlerId XYWindowDestroyed_connect(const SignalHandler& handler) +BOOL CALLBACK m_pEnumMonitor (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { - return g_pParentWnd->GetXYWnd()->onDestroyed.connectFirst(handler); + monitorInfo_s *monitorInfo = (monitorInfo_s *) dwData; + GdkRectangle *monitor; + MONITORINFOEX lpmi; + + monitor = monitorInfo->win_monitors + monitorInfo->i_win_mon; + + memset(&lpmi, 0, sizeof(MONITORINFOEX)); + lpmi.cbSize = sizeof(MONITORINFOEX); + + GetMonitorInfo( hMonitor, &lpmi ); + + if( lpmi.dwFlags & MONITORINFOF_PRIMARY ) { + RECT rect; + + SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0); + monitor->x = rect.left; + monitor->y = rect.top; + monitor->width = rect.right - rect.left; + monitor->height = rect.bottom - rect.top; + + if (monitorInfo->i_win_mon != 0) + { + GdkRectangle temp = *monitor; + *monitor = monitorInfo->win_monitors[0]; + monitorInfo->win_monitors[0] = temp; + } + } else { + monitor->x = lpmi.rcMonitor.left; + monitor->y = lpmi.rcMonitor.top; + monitor->width = lpmi.rcMonitor.right - lpmi.rcMonitor.left; + monitor->height = lpmi.rcMonitor.bottom - lpmi.rcMonitor.top; + } + + monitorInfo->i_win_mon++; + + return TRUE; } -void XYWindowDestroyed_disconnect(SignalHandlerId id) +void PositionWindowOnPrimaryScreen(window_position_t& position) { - g_pParentWnd->GetXYWnd()->onDestroyed.disconnect(id); + const GdkRectangle primaryMonitorRect = g_pParentWnd->GetPrimaryMonitorRect(); + + if( position.x <= primaryMonitorRect.x + 6 ) + position.x = primaryMonitorRect.x + 6; + else if( position.x >= ( primaryMonitorRect.x + primaryMonitorRect.width ) - 6 ) + position.x = primaryMonitorRect.x + 6; + + if( position.y <= primaryMonitorRect.y + 6 ) + position.y = primaryMonitorRect.y + 6; + else if( position.y >= ( primaryMonitorRect.y + primaryMonitorRect.height ) - 6 ) + position.y = primaryMonitorRect.y + 6; + + if( position.x + position.w >= ( primaryMonitorRect.x + primaryMonitorRect.width ) - 18 ) + position.w = primaryMonitorRect.width - 18; + if( position.y + position.h >= ( primaryMonitorRect.y + primaryMonitorRect.height ) - 18 ) + position.h = primaryMonitorRect.height - 18; +} +#endif + +GtkWidget* create_framed_widget(GtkWidget* widget) +{ + GtkWidget* frame = gtk_frame_new ((char*)NULL); + gtk_widget_show (frame); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (frame), widget); + gtk_widget_show(widget); + return frame; } -MouseEventHandlerId XYWindowMouseDown_connect(const MouseEventHandler& handler) +gboolean entry_focus_in(GtkWidget *widget, GdkEventFocus *event, gpointer user_data) { - return g_pParentWnd->GetXYWnd()->onMouseDown.connectFirst(handler); + gtk_window_remove_accel_group (GTK_WINDOW (g_pParentWnd->m_pWidget), global_accel); + return FALSE; } -void XYWindowMouseDown_disconnect(MouseEventHandlerId id) +gboolean entry_focus_out(GtkWidget *widget, GdkEventFocus *event, gpointer user_data) { - g_pParentWnd->GetXYWnd()->onMouseDown.disconnect(id); + gtk_window_add_accel_group (GTK_WINDOW (g_pParentWnd->m_pWidget), global_accel); + return FALSE; +} + +GtkWidget* create_framed_texwnd(TexWnd* texwnd) +{ + GtkWidget* frame = gtk_frame_new ((char*)NULL); + gtk_widget_show (frame); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + GtkWidget* hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + gtk_container_add (GTK_CONTAINER (frame), hbox); + + GtkWidget* w = gtk_vscrollbar_new (GTK_ADJUSTMENT (gtk_adjustment_new (0,0,0,1,1,1))); + gtk_widget_show (w); + gtk_box_pack_end (GTK_BOX (hbox), w, FALSE, TRUE, 0); + g_qeglobals_gui.d_texture_scroll = w; + + GtkWidget* texbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (texbox); + gtk_box_pack_start (GTK_BOX (hbox), texbox, TRUE, TRUE, 0); + + w = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (texbox), w, FALSE, FALSE, 0); + texwnd->m_pFilter = w; + g_signal_connect(G_OBJECT(w), "focus_in_event", G_CALLBACK(entry_focus_in), NULL); + g_signal_connect(G_OBJECT(w), "focus_out_event", G_CALLBACK(entry_focus_out), NULL); + + w = texwnd->GetWidget (); + gtk_box_pack_start (GTK_BOX (texbox), w, TRUE, TRUE, 0); + gtk_widget_show (w); + + return frame; +} + +static ZWnd *create_floating_zwnd(MainFrame *mainframe) +{ + ZWnd *pZWnd = new ZWnd (); + GtkWidget* wnd = create_floating (mainframe); + + gtk_window_set_title (GTK_WINDOW (wnd), "Z"); + + pZWnd->m_pParent = wnd; + + { + GtkWidget* frame = create_framed_widget(pZWnd->GetWidget()); + gtk_container_add (GTK_CONTAINER (wnd), frame); + } + + gtk_widget_realize (wnd); + + // turn OFF minimize and maximize boxes. + // Must be *after* realize, or wnd->window is NULL + // should do the right thing on *nix, need to verify. + gdk_window_set_decorations ( wnd->window, + GdkWMDecoration(GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) ); + //TODO 50 by observation, will vary depending on decoration sizes + { + GdkGeometry geometry; + geometry.min_width = 50; + //we only care about width, but have to set this too, or get nasty bugs + geometry.min_height = 10; + gdk_window_set_geometry_hints( wnd->window,&geometry,GDK_HINT_MIN_SIZE); + } + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posZWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posZWnd); + + if (g_PrefsDlg.m_bZVis) + gtk_widget_show (wnd); + + return pZWnd; +} + +static const int gutter = 12; + +void MainFrame::Create () +{ + GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + m_pWidget = window; + gtk_widget_set_events (window, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); + gtk_signal_connect (GTK_OBJECT (window), "delete_event", + GTK_SIGNAL_FUNC (mainframe_delete), this); + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (mainframe_destroy), this); + gtk_signal_connect (GTK_OBJECT (window), "key_press_event", + GTK_SIGNAL_FUNC (mainframe_keypress), this); + gtk_signal_connect (GTK_OBJECT (window), "key_release_event", + GTK_SIGNAL_FUNC (mainframe_keyrelease), this); + gtk_signal_connect (GTK_OBJECT (window), "map_event", + GTK_SIGNAL_FUNC (mainframe_map), this); + gtk_signal_connect (GTK_OBJECT (window), "unmap_event", + GTK_SIGNAL_FUNC (mainframe_unmap), this); + + g_qeglobals_gui.d_main_window = window; + +#ifdef _WIN32 + // calculate gdk offset + int n_win_monitors = 0; + + monitorInfo_s monitorInfo; + + // detect multiple monitors + EnumDisplayMonitors (NULL, NULL, m_pCountMonitor, reinterpret_cast(&n_win_monitors)); + + monitorInfo.win_monitors = new GdkRectangle [ n_win_monitors ]; + monitorInfo.i_win_mon = 0; + EnumDisplayMonitors (NULL, NULL, m_pEnumMonitor, reinterpret_cast(&monitorInfo)); + + gdk_offset_x = G_MININT; + gdk_offset_y = G_MININT; + + // calculate offset + for( monitorInfo.i_win_mon = 0; monitorInfo.i_win_mon < n_win_monitors; monitorInfo.i_win_mon++ ) { + gdk_offset_x = MAX (gdk_offset_x, -monitorInfo.win_monitors[monitorInfo.i_win_mon].x); + gdk_offset_y = MAX (gdk_offset_y, -monitorInfo.win_monitors[monitorInfo.i_win_mon].y); + } + + Sys_Printf( "GDK's coordinate system is offset by %d over the x-axis and %d over the y-axis from Windows' coordinate system.\n", gdk_offset_x, gdk_offset_y ); + + if( g_PrefsDlg.m_bStartOnPrimMon ) + { + // get gdk monitors + GdkDisplay *display; + GdkScreen *screen; + gint n_gdk_monitors = 0; + gint i_mon; + GdkRectangle rect; + + // detect multiple monitors + display = gdk_display_get_default (); + Sys_Printf( "GDK detects that server %s manages %d screens\n", gdk_display_get_name (display), gdk_display_get_n_screens (display) ); + + screen = gdk_display_get_screen( display, 1 ); + n_gdk_monitors = gdk_screen_get_n_monitors( screen ); + + Sys_Printf( "GDK detects that screen 1 has %d monitors\n", n_gdk_monitors ); + + for( i_mon = 0; i_mon < n_gdk_monitors; i_mon++ ) { + memset( &rect, 0, sizeof(rect) ); + gdk_screen_get_monitor_geometry( screen, i_mon, &rect ); + Sys_Printf( " monitor %d: x: %d y: %d w: %d h: %d\n", i_mon, rect.x, rect.y, rect.width, rect.height ); + + if( i_mon == 0 ) { + memcpy( &primaryMonitorRect, &rect, sizeof(primaryMonitorRect) ); + } + } + + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.position ); + } + else { + primaryMonitorRect.x = primaryMonitorRect.y = 0; + primaryMonitorRect.width = gdk_screen_width (); + primaryMonitorRect.height = gdk_screen_height (); + } + +#endif + + load_window_pos(window, g_PrefsDlg.mWindowInfo.position); + + GtkWidget* vbox = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (window), vbox); + gtk_widget_show (vbox); + + create_main_menu (window, vbox); + MRU_Load (); + create_main_toolbar (window, vbox); + create_plugin_toolbar (window,vbox); + + m_nCurrentStyle = g_PrefsDlg.m_nView; + + g_pGroupDlg->Create (); + OnPluginsRefresh(); + + CreateQEChildren(); + + gtk_widget_show (window); + + // not needed on win32, it's in the .rc +#ifndef _WIN32 + { + GdkPixmap *pixmap; + GdkBitmap *mask; + load_pixmap ("icon.bmp", window, &pixmap, &mask); + gdk_window_set_icon (window->window, NULL, pixmap, mask); + } +#endif + + if (CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft) + { + { + GtkWidget* vsplit = gtk_vpaned_new (); + m_pSplits[0] = vsplit; + gtk_box_pack_start (GTK_BOX (vbox), vsplit, TRUE, TRUE, 0); + gtk_widget_show (vsplit); + + { + GtkWidget* hsplit = gtk_hpaned_new (); + m_pSplits[2] = hsplit; + gtk_paned_add1 (GTK_PANED (vsplit), hsplit); + gtk_widget_show (hsplit); + + { + GtkWidget* hsplit2 = gtk_hpaned_new (); + m_pSplits[3] = hsplit2; + gtk_paned_add2 (GTK_PANED (hsplit), hsplit2); + gtk_widget_show (hsplit2); + + { + GtkWidget* vsplit2 = gtk_vpaned_new (); + m_pSplits[1] = vsplit2; + if (CurrentStyle() == eRegular) + gtk_paned_add2 (GTK_PANED (hsplit2), vsplit2); + else + gtk_paned_add1 (GTK_PANED (hsplit), vsplit2); + gtk_widget_show (vsplit2); + + // camera + m_pCamWnd = new CamWnd (); + { + GtkWidget* frame = create_framed_widget(m_pCamWnd->GetWidget()); + gtk_paned_add1 (GTK_PANED (vsplit2), frame); + } + + // xy + m_pXYWnd = new XYWnd (); + m_pXYWnd->SetViewType(XY); + { + GtkWidget* frame = create_framed_widget(m_pXYWnd->GetWidget ()); + gtk_paned_add1 (GTK_PANED (hsplit2), frame); + } + + // z + m_pZWnd = new ZWnd (); + { + GtkWidget* frame = create_framed_widget(m_pZWnd->GetWidget ()); + if (CurrentStyle() == eRegular) + gtk_paned_add1 (GTK_PANED (hsplit), frame); + else + gtk_paned_add2 (GTK_PANED (hsplit2), frame); + } + + // textures + m_pTexWnd = new TexWnd (); + { + GtkWidget* frame = create_framed_texwnd(m_pTexWnd); + gtk_paned_add2 (GTK_PANED (vsplit2), frame); + } + + // console + { + GtkWidget* scr = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scr), GTK_SHADOW_IN); + gtk_widget_show (scr); + gtk_paned_pack2 (GTK_PANED (vsplit), scr, FALSE, TRUE); + + { + GtkWidget* text = gtk_text_view_new (); + gtk_widget_set_size_request(text, 0, -1); // allow shrinking + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD); + gtk_text_view_set_editable (GTK_TEXT_VIEW(text), FALSE); + gtk_container_add (GTK_CONTAINER (scr), text); + gtk_widget_show (text); + g_qeglobals_gui.d_edit = text; + } + } + } + } + } + } + + gtk_paned_set_position (GTK_PANED (m_pSplits[0]), g_PrefsDlg.mWindowInfo.nXYHeight+28); + + if (CurrentStyle() == eRegular) + { + gtk_paned_set_position (GTK_PANED (m_pSplits[2]), g_PrefsDlg.mWindowInfo.nZWidth); + gtk_paned_set_position (GTK_PANED (m_pSplits[3]), g_PrefsDlg.mWindowInfo.nXYWidth); + } + else + { + gtk_paned_set_position (GTK_PANED (m_pSplits[2]), g_PrefsDlg.mWindowInfo.nCamWidth); + while (gtk_events_pending ()) gtk_main_iteration (); + gtk_paned_set_position (GTK_PANED (m_pSplits[3]), g_PrefsDlg.mWindowInfo.nXYWidth); + } + + while (gtk_events_pending ()) gtk_main_iteration (); + + gtk_paned_set_position (GTK_PANED (m_pSplits[1]), g_PrefsDlg.mWindowInfo.nCamHeight); + } + else if (CurrentStyle() == eFloating) + { + { + GtkWidget* wnd = create_floating (this); + gtk_window_set_title (GTK_WINDOW (wnd), "Camera"); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posCamWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posCamWnd); + + gtk_widget_show (wnd); + + m_pCamWnd = new CamWnd (); + + { + GtkWidget* frame = create_framed_widget(m_pCamWnd->GetWidget ()); + gtk_container_add (GTK_CONTAINER (wnd), frame); + } + + m_pCamWnd->m_pParent = wnd; + } + + if (g_PrefsDlg.m_bFloatingZ) + { + m_pZWnd = create_floating_zwnd(this); + + { + GtkWidget* wnd = create_floating (this); + gtk_window_set_title (GTK_WINDOW (wnd), "XY View"); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posXYWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posXYWnd); + + m_pXYWnd = new XYWnd (); + m_pXYWnd->SetViewType(XY); + + { + GtkWidget* frame = create_framed_widget(m_pXYWnd->GetWidget()); + gtk_container_add (GTK_CONTAINER (wnd), frame); + } + + m_pXYWnd->m_pParent = wnd; + + gtk_widget_show (wnd); + } + } + else + { + GtkWidget* wnd = create_floating (this); + gtk_window_set_title (GTK_WINDOW (wnd), "XY View"); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posXYWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posXYWnd); + + m_pZWnd = new ZWnd (); + m_pZWnd->m_pParent = wnd; + + m_pXYWnd = new XYWnd (); + m_pXYWnd->SetViewType(XY); + m_pXYWnd->m_pParent = wnd; + + + { + GtkWidget* hsplit = gtk_hpaned_new (); + m_pSplits[0] = hsplit; + gtk_container_add (GTK_CONTAINER (wnd), hsplit); + gtk_widget_show (hsplit); + + { + GtkWidget* frame = create_framed_widget(m_pZWnd->GetWidget()); + gtk_paned_add1 (GTK_PANED (hsplit), frame); + } + { + GtkWidget* frame = create_framed_widget(m_pXYWnd->GetWidget()); + gtk_paned_add2 (GTK_PANED (hsplit), frame); + } + } + + gtk_widget_show (wnd); + + gtk_paned_set_position (GTK_PANED (m_pSplits[0]), g_PrefsDlg.mWindowInfo.nZFloatWidth); + } + + { + GtkWidget* wnd = create_floating (this); + gtk_window_set_title (GTK_WINDOW (wnd), "XZ View"); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posXZWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posXZWnd); + + m_pXZWnd = new XYWnd (); + m_pXZWnd->m_pParent = wnd; + m_pXZWnd->SetViewType(XZ); + + { + GtkWidget* frame = create_framed_widget(m_pXZWnd->GetWidget()); + gtk_container_add (GTK_CONTAINER (wnd), frame); + } + + if (g_PrefsDlg.m_bXZVis) + gtk_widget_show (wnd); + } + + { + GtkWidget* wnd = create_floating (this); + gtk_window_set_title (GTK_WINDOW (wnd), "YZ View"); + +#ifdef _WIN32 + if( g_PrefsDlg.m_bStartOnPrimMon ) { + PositionWindowOnPrimaryScreen( g_PrefsDlg.mWindowInfo.posYZWnd ); + } +#endif + load_window_pos (wnd, g_PrefsDlg.mWindowInfo.posYZWnd); + + m_pYZWnd = new XYWnd (); + m_pYZWnd->m_pParent = wnd; + m_pYZWnd->SetViewType(YZ); + + { + GtkWidget* frame = create_framed_widget(m_pYZWnd->GetWidget()); + gtk_container_add (GTK_CONTAINER (wnd), frame); + } + + if (g_PrefsDlg.m_bYZVis) + gtk_widget_show (wnd); + } + + m_pTexWnd = new TexWnd (); + { + GtkWidget* frame = create_framed_texwnd(m_pTexWnd); + m_pTexWnd->m_pParent = g_pGroupDlg->m_pWidget; + + { + GtkWidget* w = gtk_label_new ("Textures"); + gtk_widget_show (w); + gtk_notebook_insert_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), frame, w, 1); + } + } + + g_pGroupDlg->Show (); + } + else // 4 way + { + { + GtkWidget* hsplit = gtk_hpaned_new (); + m_pSplits[0] = hsplit; + gtk_box_pack_start (GTK_BOX (vbox), hsplit, TRUE, TRUE, 0); + gtk_widget_show (hsplit); + + { + GtkWidget* vsplit1 = gtk_vpaned_new (); + m_pSplits[1] = vsplit1; + gtk_paned_add1 (GTK_PANED (hsplit), vsplit1); + gtk_widget_show (vsplit1); + + { + GtkWidget* vsplit2 = gtk_vpaned_new (); + m_pSplits[2] = vsplit2; + gtk_paned_add2 (GTK_PANED (hsplit), vsplit2); + gtk_widget_show (vsplit2); + + m_pCamWnd = new CamWnd (); + { + GtkWidget* frame = create_framed_widget(m_pCamWnd->GetWidget()); + gtk_paned_add1 (GTK_PANED (vsplit1), frame); + } + + m_pXYWnd = new XYWnd (); + m_pXYWnd->SetViewType(XY); + { + GtkWidget* frame = create_framed_widget(m_pXYWnd->GetWidget()); + gtk_paned_add1 (GTK_PANED (vsplit2), frame); + } + + m_pYZWnd = new XYWnd (); + m_pYZWnd->SetViewType(YZ); + { + GtkWidget* frame = create_framed_widget(m_pYZWnd->GetWidget()); + gtk_paned_add2 (GTK_PANED (vsplit1), frame); + } + + m_pXZWnd = new XYWnd (); + m_pXZWnd->SetViewType(XZ); + { + GtkWidget* frame = create_framed_widget(m_pXZWnd->GetWidget()); + gtk_paned_add2 (GTK_PANED (vsplit2), frame); + } + } + } + } + + // g_qeglobals_gui.d_edit = NULL; + + { + m_pTexWnd = new TexWnd (); + GtkWidget* frame = create_framed_texwnd(m_pTexWnd); + + { + GtkWidget* w = gtk_label_new ("Textures"); + gtk_widget_show (w); + gtk_notebook_insert_page (GTK_NOTEBOOK (g_pGroupDlg->m_pNotebook), frame, w, 1); + } + } + + m_pTexWnd->m_pParent = g_pGroupDlg->m_pWidget; +// gtk_widget_realize (m_pTexWnd->GetWidget ()); + m_pZWnd = create_floating_zwnd(this); + + while (gtk_events_pending ()) + gtk_main_iteration (); + + { + int x = GTK_PANED (m_pSplits[0])->max_position/2 - gutter; + gtk_paned_set_position (GTK_PANED (m_pSplits[0]), x); + } + + { + int y = GTK_PANED (m_pSplits[1])->max_position/2 - gutter; + gtk_paned_set_position (GTK_PANED (m_pSplits[1]), y); + gtk_paned_set_position (GTK_PANED (m_pSplits[2]), y); + } + } + + if(g_PrefsDlg.mWindowInfo.nState & GDK_WINDOW_STATE_MAXIMIZED) + gtk_window_maximize(GTK_WINDOW(window)); + + gtk_widget_show (window); + + Texture_Init(); + + if (m_pXYWnd) // this is always true? + { + m_pXYWnd->SetActive(true); + } + m_bSplittersOK = true; + Texture_SetMode(g_qeglobals.d_savedinfo.iTexMenu); + + g_pParentWnd->OnEntitiesSetViewAs(0); + +// m_wndTextureBar.Create (vbox); + create_main_statusbar (window, vbox); + + LoadCommandMap(); + ShowMenuItemKeyBindings(window); + + if (g_qeglobals_gui.d_edit != NULL) + console_construct(g_qeglobals_gui.d_edit); + + // bool load_last = FALSE; + + SetGridStatus(); + SetButtonMenuStates(); + + // m_bShowShader and m_bTextureShaderlistOnly have a menu checkbox, update it now + GtkWidget *item; + g_bIgnoreCommands++; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_shaders_show")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bShowShaders ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_shaderlistonly")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bTexturesShaderlistOnly ? TRUE : FALSE); + g_bIgnoreCommands--; + +// if (g_PrefsDlg.m_bTextureBar) +// gtk_widget_show (m_wndTextureBar.m_pWidget); + + SetActiveXY(m_pXYWnd); + + s_idle_id = gtk_timeout_add (25, mainframe_idle, this); + + QGL_InitExtensions (); + + if (g_PrefsDlg.mLocalPrefs.mbEmpty) + { + g_PrefsDlg.mLocalPrefs.mbEmpty = false; + g_PrefsDlg.SavePrefs(); + } + + // remove the pid file + remove (g_pidGameFile.GetBuffer ()); + + Sys_Printf ("Entering message loop\n"); + + m_bDoLoop = true; + + m_nTimer = gtk_timeout_add (1000, timer, this); } // ============================================================================= // MainFrame class -MainFrame* g_pParentWnd = 0; - -GtkWindow* MainFrame_getWindow() +MainFrame::MainFrame() { - if(g_pParentWnd == 0) - { - return 0; - } - return g_pParentWnd->m_window; -} - -std::vector g_floating_windows; - -MainFrame::MainFrame() : m_window(0), m_idleRedrawStatusText(RedrawStatusTextCaller(*this)) -{ - m_pXYWnd = 0; - m_pCamWnd = 0; - m_pZWnd = 0; - m_pYZWnd = 0; - m_pXZWnd = 0; - m_pActiveXY = 0; - - for (int n = 0;n < c_count_status;n++) - { - m_pStatusLabel[n] = 0; - } - + m_bDoLoop = false; + m_bSplittersOK = false; + g_pParentWnd = this; + m_pXYWnd = (XYWnd*)NULL; + m_pCamWnd = NULL; + m_pTexWnd = (TexWnd*)NULL; + m_pZWnd = (ZWnd*)NULL; + m_pYZWnd = (XYWnd*)NULL; + m_pXZWnd = (XYWnd*)NULL; + m_pActiveXY = (XYWnd*)NULL; + m_bCamPreview = true; + m_pWatchBSP = NULL; + for (int n = 0; n < 6; n++) + m_pStatusLabel[n] = NULL; + m_bNeedStatusUpdate = false; + m_nTimer = 0; m_bSleeping = false; - - Create(); + Create (); } MainFrame::~MainFrame() { - SaveWindowInfo(); - - gtk_widget_hide(GTK_WIDGET(m_window)); - - Shutdown(); - - for(std::vector::iterator i = g_floating_windows.begin(); i != g_floating_windows.end(); ++i) + while (g_BSPFrontendCommands) { - gtk_widget_destroy(*i); - } - - gtk_widget_destroy(GTK_WIDGET(m_window)); + free (g_BSPFrontendCommands->data); + g_BSPFrontendCommands = g_slist_remove (g_BSPFrontendCommands, g_BSPFrontendCommands->data); + } } -void MainFrame::SetActiveXY(XYWnd* p) +void MainFrame::ReleaseContexts () { - if (m_pActiveXY) - m_pActiveXY->SetActive(false); - - m_pActiveXY = p; - - if (m_pActiveXY) - m_pActiveXY->SetActive(true); - -} - -void MainFrame::ReleaseContexts() -{ -#if 0 if (m_pXYWnd) - m_pXYWnd->DestroyContext(); + m_pXYWnd->DestroyContext (); if (m_pYZWnd) - m_pYZWnd->DestroyContext(); + m_pYZWnd->DestroyContext (); if (m_pXZWnd) - m_pXZWnd->DestroyContext(); + m_pXZWnd->DestroyContext (); if (m_pCamWnd) - m_pCamWnd->DestroyContext(); + m_pCamWnd->DestroyContext (); if (m_pTexWnd) - m_pTexWnd->DestroyContext(); + m_pTexWnd->DestroyContext (); if (m_pZWnd) - m_pZWnd->DestroyContext(); + m_pZWnd->DestroyContext (); +} + +void MainFrame::CreateContexts () +{ + if (m_pCamWnd) + m_pCamWnd->CreateContext (); + if (m_pXYWnd) + m_pXYWnd->CreateContext (); + if (m_pYZWnd) + m_pYZWnd->CreateContext (); + if (m_pXZWnd) + m_pXZWnd->CreateContext (); + if (m_pTexWnd) + m_pTexWnd->CreateContext (); + if (m_pZWnd) + m_pZWnd->CreateContext (); +} + +static void Sys_Iconify (GtkWidget *w) +{ + // we might not have been realized yet + if (w->window == NULL) + return; + + if (!GTK_WIDGET_MAPPED (w)) + return; + +#if defined (__linux__) || defined (__APPLE__) + Sys_FPrintf(SYS_WRN, "FIXME: Sys_Iconify\n"); +#if 0 + XWindowAttributes xattr; + GdkWindowPrivate *Private; + + Private = (GdkWindowPrivate*)w->window; + g_object_set_data (G_OBJECT (w), "was_mapped", GINT_TO_POINTER (0)); + + if (!Private->destroyed) + { + xattr.map_state = IsUnmapped; + XGetWindowAttributes(Private->xdisplay, Private->xwindow, &xattr); + + if (xattr.map_state != IsUnmapped) + g_object_set_data (G_OBJECT (w), "was_mapped", GINT_TO_POINTER (1)); + + XIconifyWindow (Private->xdisplay, Private->xwindow, 0); + } +#endif +#endif + +#ifdef _WIN32 + ShowWindow ((HWND)GDK_WINDOW_HWND (w->window), SW_MINIMIZE); #endif } -void MainFrame::CreateContexts() +static void Sys_Restore (GtkWidget *w) { -#if 0 - if (m_pCamWnd) - m_pCamWnd->CreateContext(); - if (m_pXYWnd) - m_pXYWnd->CreateContext(); - if (m_pYZWnd) - m_pYZWnd->CreateContext(); - if (m_pXZWnd) - m_pXZWnd->CreateContext(); - if (m_pTexWnd) - m_pTexWnd->CreateContext(); - if (m_pZWnd) - m_pZWnd->CreateContext(); + // we might not have been realized yet + if (w->window == NULL) + return; + + if (!GTK_WIDGET_VISIBLE (w)) + return; + +#if defined (__linux__) || defined (__APPLE__) + Sys_FPrintf(SYS_WRN, "FIXME: Sys_Restore\n"); + #if 0 + XWindowAttributes xattr; + GdkWindowPrivate *Private; + + Private = (GdkWindowPrivate*)w->window; + + xattr.map_state = IsUnmapped; + XGetWindowAttributes(Private->xdisplay, Private->xwindow, &xattr); + + if (xattr.map_state == IsUnmapped) + XMapRaised (Private->xdisplay, Private->xwindow); + #endif +#endif + +#ifdef _WIN32 + ShowWindow ((HWND)GDK_WINDOW_HWND (w->window), SW_RESTORE); #endif } @@ -2776,799 +3076,4716 @@ void MainFrame::CreateContexts() //#define DBG_SLEEP #endif +void RefreshModelSkin (GSList **pModels, entitymodel_t *model) +{ + //++timo FIXME: the are some bogus entitymodel_t that appear in the list cause of buggy HasModel + // so we avoid the fucked up ones, assuming they are at the end + if (!model->strSkin) + { +#ifdef DBG_SLEEP + Sys_Printf("Dropping model %p with empty skin in RefreshModelSkin\n", model); +#endif + + // and also keeping it so we have an actual count of empty models + g_slist_append (*pModels, model); + return; + } + // do we have this model already? + if (g_slist_find (*pModels, model)) + { +#ifdef DBG_SLEEP + + // looks like we don't have the filename for the model, only the skin name and tris.. so we put the adress + Sys_Printf("Already processed model: %p %s\n", model, ((GString *)model->strSkin)->str); +#endif + return; + } + model->nTextureBind = Texture_LoadSkin(((GString *)model->strSkin)->str, &model->nSkinWidth, &model->nSkinHeight ); + if (model->nTextureBind != -1) + Sys_Printf("LOADED SKIN: %s\n", ((GString *)model->strSkin)->str ); + else + Sys_Printf("Load skin failed: %s\n", ((GString *)model->strSkin)->str ); + *pModels = g_slist_append (*pModels, model); +#ifdef DBG_SLEEP + Sys_Printf("Processed model %p %s\n", model, ((GString *)model->strSkin)->str); +#endif +} + void MainFrame::OnSleep() { -#if 0 m_bSleeping ^= 1; if (m_bSleeping) { // useful when trying to debug crashes in the sleep code - globalOutputStream() << "Going into sleep mode..\n"; + Sys_Printf("Going into sleep mode..\n"); - globalOutputStream() << "Dispatching sleep msg..."; + Sys_Printf("Dispatching sleep msg..."); DispatchRadiantMsg (RADIANT_SLEEP); - globalOutputStream() << "Done.\n"; + Sys_Printf("Done.\n"); - gtk_window_iconify(m_window); - GlobalSelectionSystem().setSelectedAll(false); + if (CurrentStyle() == eSplit) + Sys_Iconify (m_pZWnd->m_pParent); - GlobalShaderCache().unrealise(); - Shaders_Free(); - GlobalOpenGL_debugAssertNoErrors(); - ScreenUpdates_Disable(); + Sys_Iconify (m_pWidget); + Select_Deselect(); + QERApp_FreeShaders (); + g_bScreenUpdates = false; // release contexts - globalOutputStream() << "Releasing contexts..."; + Sys_Printf("Releasing contexts..."); ReleaseContexts(); - globalOutputStream() << "Done.\n"; - } - else - { - globalOutputStream() << "Waking up\n"; + Sys_Printf("Done.\n"); - gtk_window_deiconify(m_window); + // free all the skins in the caches + // their GL resources have been freed but the structs are not, so Radiant would think they are still valid + g_lstSkinCache.RemoveAll(); + } else + { + Sys_Printf("Waking up\n"); + if (CurrentStyle() == eSplit) + Sys_Restore (m_pZWnd->m_pParent); + + Sys_Restore (m_pWidget); // create contexts - globalOutputStream() << "Creating contexts..."; + Sys_Printf("Creating contexts..."); CreateContexts(); - globalOutputStream() << "Done.\n"; + Sys_Printf("Done.\n"); - globalOutputStream() << "Making current on camera..."; - m_pCamWnd->MakeCurrent(); - globalOutputStream() << "Done.\n"; + Sys_Printf("Making current on camera..."); + m_pCamWnd->MakeCurrent (); + Sys_Printf("Done.\n"); - globalOutputStream() << "Reloading shaders..."; - Shaders_Load(); - GlobalShaderCache().realise(); - globalOutputStream() << "Done.\n"; + Sys_Printf("Reloading shaders..."); + // reload the shader scripts and textures + QERApp_ReloadShaders (); + // current shader + // NOTE: we are kinda making it loop on itself, it will update the pShader and scroll the texture window + Texture_SetTexture (&g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, false, NULL, false); + Sys_Printf("Done.\n"); - ScreenUpdates_Enable(); - - globalOutputStream() << "Dispatching wake msg..."; - DispatchRadiantMsg (RADIANT_WAKEUP); - globalOutputStream() << "Done\n"; - } -#endif -} - - -GtkWindow* create_splash() -{ - GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); - gtk_window_set_decorated(window, FALSE); - gtk_window_set_resizable(window, FALSE); - gtk_window_set_modal(window, TRUE); - gtk_window_set_default_size(window, -1, -1); - gtk_window_set_position(window, GTK_WIN_POS_CENTER); - gtk_container_set_border_width(GTK_CONTAINER(window), 0); - - GtkImage* image = new_local_image("splash.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(image)); - - gtk_widget_set_size_request(GTK_WIDGET(window), -1, -1); - gtk_widget_show(GTK_WIDGET(window)); - - return window; -} - -static GtkWindow *splash_screen = 0; - -void show_splash() -{ - splash_screen = create_splash(); - - process_gui(); -} - -void hide_splash() -{ - gtk_widget_destroy(GTK_WIDGET(splash_screen)); -} - -WindowPositionTracker g_posCamWnd; -WindowPositionTracker g_posXYWnd; -WindowPositionTracker g_posXZWnd; -WindowPositionTracker g_posYZWnd; - -static gint mainframe_delete (GtkWidget *widget, GdkEvent *event, gpointer data) -{ - if(ConfirmModified("Exit Radiant")) - { - gtk_main_quit(); - } - - return TRUE; -} - -void MainFrame::Create() -{ - GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); - - GlobalWindowObservers_connectTopLevel(window); - - gtk_window_set_transient_for(splash_screen, window); - -#if !defined(WIN32) - { - GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask("bitmaps/icon.bmp"); - if(pixbuf != 0) + // rebuild the patches by setting the bDirty flag on them + for (brush_t* b=active_brushes.next ; b != &active_brushes ; b=b->next) { - gtk_window_set_icon(window, pixbuf); - gdk_pixbuf_unref(pixbuf); + if (b->patchBrush) + b->pPatch->bDirty = true; } - } -#endif - gtk_widget_add_events(GTK_WIDGET(window), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK); - g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(mainframe_delete), this); - - m_position_tracker.connect(window); - -#if 0 - g_mainframeWidgetFocusPrinter.connect(window); - g_mainframeFocusPrinter.connect(window); -#endif - - g_MainWindowActive.connect(window); - - GetPlugInMgr().Init(GTK_WIDGET(window)); - - GtkWidget* vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add(GTK_CONTAINER(window), vbox); - gtk_widget_show(vbox); - - global_accel_connect_window(window); - - m_nCurrentStyle = (EViewStyle)g_Layout_viewStyle.m_value; - - register_shortcuts(); - - GtkMenuBar* main_menu = create_main_menu(CurrentStyle()); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(main_menu), FALSE, FALSE, 0); - - GtkToolbar* main_toolbar = create_main_toolbar(CurrentStyle()); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(main_toolbar), FALSE, FALSE, 0); - - GtkToolbar* plugin_toolbar = create_plugin_toolbar(); - if (!g_Layout_enablePluginToolbar.m_value) - { - gtk_widget_hide(GTK_WIDGET(plugin_toolbar)); - } - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(plugin_toolbar), FALSE, FALSE, 0); - - GtkWidget* main_statusbar = create_main_statusbar(m_pStatusLabel); - gtk_box_pack_end(GTK_BOX(vbox), main_statusbar, FALSE, TRUE, 2); - - GroupDialog_constructWindow(window); - g_page_entity = GroupDialog_addPage("Entities", EntityInspector_constructWindow(GroupDialog_getWindow()), RawStringExportCaller("Entities")); - - if(FloatingGroupDialog()) - { - g_page_console = GroupDialog_addPage("Console", Console_constructWindow(GroupDialog_getWindow()), RawStringExportCaller("Console")); - } - -#ifdef WIN32 - if( g_multimon_globals.m_bStartOnPrimMon ) - { - PositionWindowOnPrimaryScreen(g_layout_globals.m_position); - window_set_position(window, g_layout_globals.m_position); - } - else -#endif - if(g_layout_globals.nState & GDK_WINDOW_STATE_MAXIMIZED) - { - gtk_window_maximize(window); - WindowPosition default_position(-1, -1, 640, 480); - window_set_position(window, default_position); - } - else - { - window_set_position(window, g_layout_globals.m_position); - } - - m_window = window; - - gtk_widget_show(GTK_WIDGET(window)); - - if (CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft) - { + Sys_Printf("Reloading skins..."); + // we have purged all the skins before going to sleep + // to rebuild, go through everything that needs a skin and call Texture_LoadSkin + // namely, all entitymodel_t + // since there's no direct list we go through entities to get the eclass_t and from there the entitymodel_t + // (a single eclass_t can reference several entitymodel_t) + // FIXME: and what's up with md3Class then? what is it used for? +/* + eclass_t *e; + entity_t *ent; + GSList *Models = NULL; + for (ent = entities.next; ent != &entities; ent = ent->next) { - GtkWidget* vsplit = gtk_vpaned_new(); - m_vSplit = vsplit; - gtk_box_pack_start(GTK_BOX(vbox), vsplit, TRUE, TRUE, 0); - gtk_widget_show (vsplit); - - // console - GtkWidget* console_window = Console_constructWindow(window); - gtk_paned_pack2(GTK_PANED(vsplit), console_window, FALSE, TRUE); - + // if it's a model with skin then the fixedsize flag must be on + // only if there IS a model .. we are not trying to load + if (ent->eclass->fixedsize) { - GtkWidget* hsplit = gtk_hpaned_new(); - gtk_widget_show (hsplit); - m_hSplit = hsplit; - gtk_paned_add1(GTK_PANED(vsplit), hsplit); - - // xy - m_pXYWnd = new XYWnd(); - m_pXYWnd->SetViewType(XY); - GtkWidget* xy_window = GTK_WIDGET(create_framed_widget(m_pXYWnd->GetWidget())); - + if (ent->eclass->model) { - GtkWidget* vsplit2 = gtk_vpaned_new(); - gtk_widget_show(vsplit2); - m_vSplit2 = vsplit2; - - if (CurrentStyle() == eRegular) - { - gtk_paned_add1(GTK_PANED(hsplit), xy_window); - gtk_paned_add2(GTK_PANED(hsplit), vsplit2); - } +#ifdef DBG_SLEEP + if (ent->md3Class) + Sys_Printf("WARNING: unexpected ent->md3Class!=NULL with ent->eclass->model!=NULL\n"); +#endif + entitymodel_t *model; + for (model = ent->eclass->model; model; model=model->pNext) + RefreshModelSkin (&Models, model); + } else if (ent->md3Class) + { + entitymodel_t *model; + for (model = ent->md3Class->model; model; model=model->pNext) + RefreshModelSkin (&Models, model); + } +#ifdef DBG_SLEEP + else + Sys_Printf("WARNING: entity %p %s with fixedsize and no model no md3Class\n", ent, ent->eclass->name); +#endif + } + } +#ifdef DBG_SLEEP + for (e = g_md3Cache; e ; e = e->next) + { + entitymodel_t *model; + for (model = e->model; model; model=model->pNext) + if (!g_slist_find (Models, model)) + { + Sys_Printf("model %p ", model); + if (model->strSkin) + Sys_Printf("%s not found in main loop\n", ((GString *)model->strSkin)->str); else + Sys_Printf("not found in main loop (no skin)\n"); + } + } +#endif + // clean the model list + g_slist_free (Models); +*/ + Sys_Printf("Done.\n"); + + // bring back the GL font + gtk_glwidget_create_font (m_pCamWnd->GetWidget ()); + + g_bScreenUpdates = true; + + Sys_Printf("Dispatching wake msg..."); + DispatchRadiantMsg (RADIANT_WAKEUP); + Sys_Printf("Done\n"); + } +} + +void WINAPI QERApp_Sleep() +{ + g_pParentWnd->OnSleep(); +} + +/*! +NOTE TTimo +the exit path is a bit complicated, I guess we have to run the window pos saving in OnDelete +and not in OnDestroy because the info may be lost already? +\todo try sinking OnDelete into OnDestroy and see if it breaks anything +*/ +void MainFrame::OnDelete () +{ + save_window_pos(m_pWidget, g_PrefsDlg.mWindowInfo.position); + + // surface inspector and patch inspector + save_window_pos (g_dlgSurface.GetWidget(), g_PrefsDlg.mWindowInfo.posSurfaceWnd); + save_window_pos (g_PatchDialog.GetWidget(), g_PrefsDlg.mWindowInfo.posPatchWnd); + + // entity inspector / group dialog + // NOTE TTimo do we have to save a different window depending on the view mode? + save_window_pos (g_pGroupDlg->m_pWidget, g_PrefsDlg.mWindowInfo.posEntityWnd); + + if (g_PrefsDlg.m_bFloatingZ) + save_window_pos (m_pZWnd->m_pParent, g_PrefsDlg.mWindowInfo.posZWnd); + else + g_PrefsDlg.mWindowInfo.nZFloatWidth = GTK_PANED (m_pSplits[0])->child1_size; + + if (CurrentStyle() == eFloating) + { + save_window_pos (m_pCamWnd->m_pParent, g_PrefsDlg.mWindowInfo.posCamWnd); + save_window_pos (m_pXYWnd->m_pParent, g_PrefsDlg.mWindowInfo.posXYWnd); + save_window_pos (m_pXZWnd->m_pParent, g_PrefsDlg.mWindowInfo.posXZWnd); + save_window_pos (m_pYZWnd->m_pParent, g_PrefsDlg.mWindowInfo.posYZWnd); + } + + g_PrefsDlg.mWindowInfo.nState = gdk_window_get_state(g_pParentWnd->m_pWidget->window); +} + +void MainFrame::OnDestroy () +{ + // shut down console output first + // (we'll still get the info if we are running a log file anyway) + g_qeglobals_gui.d_edit = NULL; + +#ifdef _DEBUG + Sys_Printf("MainFrame::OnDestroy\n"); +#endif + if (s_idle_id) + gtk_timeout_remove (s_idle_id); + if (m_nTimer) + gtk_timeout_remove (m_nTimer); + + if (!g_qeglobals.disable_ini) + { + Sys_Printf("Start writing prefs\n"); + Sys_Printf("MRU_Save... "); + MRU_Save (); + Sys_Printf("OK\n"); + + gpointer w; + + w = g_object_get_data (G_OBJECT (g_pGroupDlg->m_pWidget), "split1"); + g_PrefsDlg.mWindowInfo.nEntitySplit1 = GTK_PANED (w)->child1_size; + w = g_object_get_data (G_OBJECT (g_pGroupDlg->m_pWidget), "split2"); + g_PrefsDlg.mWindowInfo.nEntitySplit2 = GTK_PANED (w)->child1_size; + + if (!FloatingGroupDialog()) + { + GtkWidget *vsplit, *hsplit, *vsplit2, *hsplit2; + + vsplit = m_pSplits[0]; + vsplit2 = m_pSplits[1]; + hsplit = m_pSplits[2]; + hsplit2 = m_pSplits[3]; + + g_PrefsDlg.mWindowInfo.nXYHeight = GTK_PANED (vsplit)->child1_size; + g_PrefsDlg.mWindowInfo.nXYWidth = GTK_PANED (hsplit2)->child1_size; + + if(CurrentStyle() == eRegular) + g_PrefsDlg.mWindowInfo.nZWidth = GTK_PANED (hsplit)->child1_size; + else + g_PrefsDlg.mWindowInfo.nCamWidth = GTK_PANED (hsplit)->child1_size; + + g_PrefsDlg.mWindowInfo.nCamHeight = GTK_PANED (vsplit2)->child1_size; + } else + { + if (g_PrefsDlg.m_bFloatingZ || CurrentStyle() == eSplit) + { + if (GTK_WIDGET_VISIBLE (m_pZWnd->m_pParent)) + g_PrefsDlg.m_bZVis = TRUE; + else + g_PrefsDlg.m_bZVis = FALSE; + } + } + g_PrefsDlg.SavePrefs(); + Sys_Printf("Done prefs\n"); + } + + // spog - this may be better in another place.. + // deletes filters list and assigns g_qeglobals.d_savedinfo.filters = NULL + g_qeglobals.d_savedinfo.filters = FilterListDelete(g_qeglobals.d_savedinfo.filters); + + delete m_pXYWnd; m_pXYWnd = NULL; + delete m_pYZWnd; m_pYZWnd = NULL; + delete m_pXZWnd; m_pXZWnd = NULL; + delete m_pZWnd; m_pZWnd = NULL; + delete m_pTexWnd; m_pTexWnd = NULL; + delete m_pCamWnd; m_pCamWnd = NULL; + + if (g_pGroupDlg->m_pWidget) + { + //!\todo fix "Gtk-CRITICAL **: file gtknotebook.c: line 4643 (gtk_notebook_get_tab_label): assertion `GTK_IS_WIDGET (child)' failed" + gtk_widget_destroy (g_pGroupDlg->m_pWidget); + g_pGroupDlg->m_pWidget = NULL; + } + + if (strcmpi(currentmap, "unnamed.map") != 0) + { + g_PrefsDlg.m_strLastMap = currentmap; + g_PrefsDlg.SavePrefs (); + } + Sys_Printf("CleanUpEntities..."); + CleanUpEntities(); + Sys_Printf("Done.\n"); + + Sys_Printf("Releasing brushes..."); + while (active_brushes.next != &active_brushes) + Brush_Free (active_brushes.next, false); + while (selected_brushes.next != &selected_brushes) + Brush_Free (selected_brushes.next, false); + while (filtered_brushes.next != &filtered_brushes) + Brush_Free (filtered_brushes.next, false); + Sys_Printf("Done.\n"); + + Sys_Printf("Releasing entities..."); + while (entities.next != &entities) + Entity_Free (entities.next); + Sys_Printf("Done.\n"); + + epair_t* pEPair = g_qeglobals.d_project_entity->epairs; + while (pEPair) + { + epair_t* pNextEPair = pEPair->next; + free (pEPair->key); + free (pEPair->value); + free (pEPair); + pEPair = pNextEPair; + } + + entity_t* pEntity = g_qeglobals.d_project_entity->next; + while (pEntity != NULL && pEntity != g_qeglobals.d_project_entity) + { + entity_t* pNextEntity = pEntity->next; + Entity_Free(pEntity); + pEntity = pNextEntity; + } + + Sys_Printf("Freeing world entity..."); + if (world_entity) + Entity_Free(world_entity); + Sys_Printf("Done.\n"); + + Sys_Printf("Shutdown VFS..."); + vfsShutdown (); + Sys_Printf("Done.\n"); + + Sys_Printf("FreeShaders..."); + QERApp_FreeShaders(); + Sys_Printf("Done.\n"); +} + +// TTimo: now using profile.cpp code +void MainFrame::LoadCommandMap() +{ + FILE *f; + CString strINI; + bool bUserCmdList = false; + int nLen; + // verbose a little: count of user commands we recognized + int iCount = 0; + int iOverrideCount = 0; + int j; + + +#if defined (__linux__) || defined (__APPLE__) + strINI = g_PrefsDlg.m_rc_path->str; +#elif defined(WIN32) + strINI = g_strGameToolsPath; +#else +#error "WTF are you compiling this on" +#endif + AddSlash (strINI); + strINI += "shortcuts.ini"; + + f = fopen (strINI.GetBuffer(), "r"); + if (f != NULL) + { + fclose(f); + // loop through all the commands + for (int i = 0; i < g_nCommandCount; i++) + { + char value[1024]; + if (read_var( strINI.GetBuffer(), "Commands", g_Commands[i].m_strCommand, value )) + { + if (!bUserCmdList) + { + Sys_Printf("Found user's shortcuts list at %s\n", strINI.GetBuffer() ); + bUserCmdList = true; + } + CString strBuff; + strBuff = value; + strBuff.TrimLeft(); + strBuff.TrimRight(); + strBuff.MakeLower(); + int nSpecial = strBuff.Find("+alt"); + g_Commands[i].m_nModifiers = 0; + if (nSpecial >= 0) + { + g_Commands[i].m_nModifiers |= RAD_ALT; + FindReplace(strBuff, "+alt", ""); + } + nSpecial = strBuff.Find("+ctrl"); + if (nSpecial >= 0) + { + g_Commands[i].m_nModifiers |= RAD_CONTROL; + FindReplace(strBuff, "+ctrl", ""); + } + nSpecial = strBuff.Find("+shift"); + if (nSpecial >= 0) + { + g_Commands[i].m_nModifiers |= RAD_SHIFT; + FindReplace(strBuff, "+shift", ""); + } + strBuff.TrimLeft(); + strBuff.TrimRight(); + strBuff.MakeUpper(); + // strBuff has been cleaned of it's modifiers .. switch between a regular key and a virtual one + // based on length + nLen = strBuff.GetLength(); + if (nLen == 1) // most often case.. deal with first + { + g_Commands[i].m_nKey = __toascii(strBuff.GetAt(0)); + iCount++; + } else // special key + { + for (j = 0; j < g_nKeyCount; j++) { - gtk_paned_add1(GTK_PANED(hsplit), vsplit2); - gtk_paned_add2(GTK_PANED(hsplit), xy_window); + if (strBuff.CompareNoCase(g_Keys[j].m_strName) == 0) + { + g_Commands[i].m_nKey = g_Keys[j].m_nVKKey; + iCount++; + break; + } + } + if (j == g_nKeyCount) + { + Sys_Printf("WARNING: failed to parse user command %s\n", value); + continue; + } + } + // maybe this new shortcut is overriding another one + // then we need to disable the other binded key + for (j = 0; j < g_nCommandCount; j++) + { + if (j == i) + continue; + if (g_Commands[i].m_nKey == g_Commands[j].m_nKey && g_Commands[i].m_nModifiers == g_Commands[j].m_nModifiers) + { + // found! + g_Commands[j].m_nKey = 0; + // verbose + iOverrideCount++; + // it's the only one + break; } - - - // camera - m_pCamWnd = NewCamWnd(); - GlobalCamera_setCamWnd(*m_pCamWnd); - CamWnd_setParent(*m_pCamWnd, window); - GtkFrame* camera_window = create_framed_widget(CamWnd_getWidget(*m_pCamWnd)); - - gtk_paned_add1(GTK_PANED(vsplit2), GTK_WIDGET(camera_window)); - - // textures - GtkFrame* texture_window = create_framed_widget(TextureBrowser_constructWindow(window)); - - gtk_paned_add2(GTK_PANED(vsplit2), GTK_WIDGET(texture_window)); } } } - - gtk_paned_set_position(GTK_PANED(m_vSplit), g_layout_globals.nXYHeight); - - if (CurrentStyle() == eRegular) - { - gtk_paned_set_position(GTK_PANED(m_hSplit), g_layout_globals.nXYWidth); - } - else - { - gtk_paned_set_position(GTK_PANED(m_hSplit), g_layout_globals.nCamWidth); - } - - gtk_paned_set_position(GTK_PANED(m_vSplit2), g_layout_globals.nCamHeight); + if (iOverrideCount) + Sys_Printf("User's command list overrides %d default commands\n", iOverrideCount); + Sys_Printf("Parsed %d custom shortcuts\n", iCount ); } - else if (CurrentStyle() == eFloating) - { - { - GtkWindow* window = create_persistent_floating_window("Camera", m_window); - global_accel_connect_window(window); - g_posCamWnd.connect(window); - - gtk_widget_show(GTK_WIDGET(window)); - - m_pCamWnd = NewCamWnd(); - GlobalCamera_setCamWnd(*m_pCamWnd); - - { - GtkFrame* frame = create_framed_widget(CamWnd_getWidget(*m_pCamWnd)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(frame)); - } - CamWnd_setParent(*m_pCamWnd, window); - - g_floating_windows.push_back(GTK_WIDGET(window)); - } - - { - GtkWindow* window = create_persistent_floating_window(ViewType_getTitle(XY), m_window); - global_accel_connect_window(window); - g_posXYWnd.connect(window); - - m_pXYWnd = new XYWnd(); - m_pXYWnd->m_parent = window; - m_pXYWnd->SetViewType(XY); - - - { - GtkFrame* frame = create_framed_widget(m_pXYWnd->GetWidget()); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(frame)); - } - XY_Top_Shown_Construct(window); - - g_floating_windows.push_back(GTK_WIDGET(window)); - } - - { - GtkWindow* window = create_persistent_floating_window(ViewType_getTitle(XZ), m_window); - global_accel_connect_window(window); - g_posXZWnd.connect(window); - - m_pXZWnd = new XYWnd(); - m_pXZWnd->m_parent = window; - m_pXZWnd->SetViewType(XZ); - - { - GtkFrame* frame = create_framed_widget(m_pXZWnd->GetWidget()); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(frame)); - } - - XZ_Front_Shown_Construct(window); - - g_floating_windows.push_back(GTK_WIDGET(window)); - } - - { - GtkWindow* window = create_persistent_floating_window(ViewType_getTitle(YZ), m_window); - global_accel_connect_window(window); - g_posYZWnd.connect(window); - - m_pYZWnd = new XYWnd(); - m_pYZWnd->m_parent = window; - m_pYZWnd->SetViewType(YZ); - - { - GtkFrame* frame = create_framed_widget(m_pYZWnd->GetWidget()); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(frame)); - } - - YZ_Side_Shown_Construct(window); - - g_floating_windows.push_back(GTK_WIDGET(window)); - } - - { - GtkFrame* frame = create_framed_widget(TextureBrowser_constructWindow(GroupDialog_getWindow())); - g_page_textures = GroupDialog_addPage("Textures", GTK_WIDGET(frame), TextureBrowserExportTitleCaller()); - } - - GroupDialog_show(); - } - else // 4 way - { - m_pCamWnd = NewCamWnd(); - GlobalCamera_setCamWnd(*m_pCamWnd); - CamWnd_setParent(*m_pCamWnd, window); - - GtkWidget* camera = CamWnd_getWidget(*m_pCamWnd); - - m_pYZWnd = new XYWnd(); - m_pYZWnd->SetViewType(YZ); - - GtkWidget* yz = m_pYZWnd->GetWidget(); - - m_pXYWnd = new XYWnd(); - m_pXYWnd->SetViewType(XY); - - GtkWidget* xy = m_pXYWnd->GetWidget(); - - m_pXZWnd = new XYWnd(); - m_pXZWnd->SetViewType(XZ); - - GtkWidget* xz = m_pXZWnd->GetWidget(); - - GtkHPaned* split = create_split_views(camera, yz, xy, xz); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(split), TRUE, TRUE, 0); - - { - GtkFrame* frame = create_framed_widget(TextureBrowser_constructWindow(window)); - g_page_textures = GroupDialog_addPage("Textures", GTK_WIDGET(frame), TextureBrowserExportTitleCaller()); - } - } - - EntityList_constructWindow(window); - PreferencesDialog_constructWindow(window); - FindTextureDialog_constructWindow(window); - SurfaceInspector_constructWindow(window); - PatchInspector_constructWindow(window); - - SetActiveXY(m_pXYWnd); - - AddGridChangeCallback(SetGridStatusCaller(*this)); - AddGridChangeCallback(ReferenceCaller(*this)); - - g_defaultToolMode = DragMode; - g_defaultToolMode(); - SetStatusText(m_command_status, c_TranslateMode_status); - - EverySecondTimer_enable(); - - //GlobalShortcuts_reportUnregistered(); + else + Sys_Printf("Looked for a '%s' keyboard shortcuts file, not found\n", strINI.GetBuffer()); } -void MainFrame::SaveWindowInfo() +// TTimo: an m_nKey can be set to zero if there's no shorcut binded +// we also output the count of commands that are not binded .. dunno if it's much use .. +// (non-binded keys are usually keys that were defined by shortcuts overriden by user prefs) +void MainFrame::ShowMenuItemKeyBindings(GtkWidget* window) { - if (!FloatingGroupDialog()) + //!\todo Find a better way to get the global accelerator group.. + GtkAccelGroup *accel = GTK_ACCEL_GROUP(gtk_accel_groups_from_object(G_OBJECT(window))->data); + gpointer item; + guint mods; + int i; + int iCount = 0; + + for (i = 0; i < g_nCommandCount; i++) { - g_layout_globals.nXYHeight = gtk_paned_get_position(GTK_PANED(m_vSplit)); - - if(CurrentStyle() != eRegular) + if (g_Commands[i].m_nKey == 0) { - g_layout_globals.nCamWidth = gtk_paned_get_position(GTK_PANED(m_hSplit)); - } - else - { - g_layout_globals.nXYWidth = gtk_paned_get_position(GTK_PANED(m_hSplit)); + iCount++; + continue; } - g_layout_globals.nCamHeight = gtk_paned_get_position(GTK_PANED(m_vSplit2)); + item = g_object_get_data (G_OBJECT (m_pWidget), g_Commands[i].m_strMenu); + if (item == NULL) + { + Sys_FPrintf (SYS_WRN, "WARNING: keyboard shortcuts init, no menu item found for command: \"%s\"\n", + g_Commands[i].m_strCommand); + continue; + } + + mods = 0; + if (g_Commands[i].m_nModifiers) // are there modifiers present? + { + if (g_Commands[i].m_nModifiers & RAD_SHIFT) + mods |= GDK_SHIFT_MASK; + if (g_Commands[i].m_nModifiers & RAD_ALT) + mods |= GDK_MOD1_MASK; + if (g_Commands[i].m_nModifiers & RAD_CONTROL) + mods |= GDK_CONTROL_MASK; + } + + // GTK won't add accelerators for some keys (ex.: delete), so we have to do it manually + if (gtk_accelerator_valid (g_Commands[i].m_nKey, (GdkModifierType)mods)) + { +#ifdef DBG_KBD + // NOTE TTimo this is the important place where all the shortcuts are binded + Sys_Printf("Calling gtk_widget_add_accelerator on command: %s menu: %s key: %d mods: %d\n", g_Commands[i].m_strCommand, g_Commands[i].m_strMenu, g_Commands[i].m_nKey, mods); +#endif + gtk_widget_add_accelerator (GTK_WIDGET (item), "activate", accel, g_Commands[i].m_nKey, + (GdkModifierType)mods, GTK_ACCEL_VISIBLE); + } else + { + GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (GTK_BIN (item)->child); + GString *gstring; + gboolean had_mod; + + g_free (accel_label->accel_string); + accel_label->accel_string = NULL; + + gstring = g_string_new (accel_label->accel_string); + g_string_append (gstring, " "); + + had_mod = FALSE; + if (mods & GDK_SHIFT_MASK) + { + g_string_append (gstring, "Shft"); + had_mod = TRUE; + } + if (mods & GDK_CONTROL_MASK) + { + if (had_mod) + g_string_append (gstring, "+"); + g_string_append (gstring, "Ctl"); + had_mod = TRUE; + } + if (mods & GDK_MOD1_MASK) + { + if (had_mod) + g_string_append (gstring, "+"); + g_string_append (gstring, "Alt"); + had_mod = TRUE; + } + + if (had_mod) + g_string_append (gstring, "+"); + if (g_Commands[i].m_nKey < 0x80 || (g_Commands[i].m_nKey > 0x80 && g_Commands[i].m_nKey <= 0xff)) + { + switch (g_Commands[i].m_nKey) + { + case ' ': + g_string_append (gstring, "Space"); + break; + case '\\': + g_string_append (gstring, "Backslash"); + break; + default: + g_string_append_c (gstring, toupper (g_Commands[i].m_nKey)); + break; + } + } else + { + gchar *tmp; + + tmp = gtk_accelerator_name (g_Commands[i].m_nKey, (GdkModifierType)0); + if (tmp[0] != 0 && tmp[1] == 0) + tmp[0] = toupper (tmp[0]); + g_string_append (gstring, tmp); + g_free (tmp); + } + + g_free (accel_label->accel_string); + accel_label->accel_string = gstring->str; + g_string_free (gstring, FALSE); + + if (!accel_label->accel_string) + accel_label->accel_string = g_strdup (""); + + gtk_widget_queue_resize (GTK_WIDGET (accel_label)); + } } - g_layout_globals.m_position = m_position_tracker.getPosition(); - - g_layout_globals.nState = gdk_window_get_state(GTK_WIDGET(m_window)->window); + if (iCount) + Sys_Printf("%d commands not bound to a key\n", iCount); } -void MainFrame::Shutdown() +void MainFrame::CreateQEChildren() { - EverySecondTimer_disable(); + // load the project file + if (g_argc > 1) + { + Sys_Printf("loading project file from the command line: %s\n", g_argv[1]); + if (!QE_LoadProject(g_argv[1])) + Error("Unable to load project file %s\n", g_argv[1]); + } + else + { + const char* filename = NULL; + char buf[PATH_MAX]; + const char *r; + bool bTriedTemplate = false; + + if (g_PrefsDlg.m_nLastProjectVer != 0 && g_PrefsDlg.m_nLastProjectVer != PROJECT_VERSION) { + // we need to regenerate from template + Sys_Printf("last project has version %d, this binary wants version %d - regenerating from the template\n", g_PrefsDlg.m_nLastProjectVer, PROJECT_VERSION); + g_PrefsDlg.m_strLastProject = ""; + } + + r = g_PrefsDlg.m_strLastProject.GetBuffer(); + + while(r == NULL || *r == '\0' || access(r, R_OK) != 0 || !QE_LoadProject(r)) + { + if(!bTriedTemplate) + { + // try default project location + bTriedTemplate = true; + // for all OSes, we look for the template in the base installation (no homepath here) + strcpy(buf, g_pGameDescription->mEnginePath.GetBuffer()); + strcat(buf, g_pGameDescription->mBaseGame.GetBuffer()); + strcat(buf, "/scripts/"); + strcat(buf, PROJECT_TEMPLATE_NAME); + r = buf; + } + else + { + gtk_MessageBox (NULL, "Failed to load project file.\nPlease enter a valid project file.", "Load Project"); - EntityList_destroyWindow(); + filename = file_dialog (m_pWidget, TRUE, "Choose Project File", buf, "project"); + if (filename != NULL) + r = filename; + else + Error("Cannot continue without loading a project..."); + } + } + } - delete m_pXYWnd; - m_pXYWnd = 0; - delete m_pYZWnd; - m_pYZWnd = 0; - delete m_pXZWnd; - m_pXZWnd = 0; - - TextureBrowser_destroyWindow(); - - DeleteCamWnd(m_pCamWnd); - m_pCamWnd = 0; - - PreferencesDialog_destroyWindow(); - SurfaceInspector_destroyWindow(); - FindTextureDialog_destroyWindow(); - PatchInspector_destroyWindow(); - - g_DbgDlg.destroyWindow(); - - // destroying group-dialog last because it may contain texture-browser - GroupDialog_destroyWindow(); + QE_Init (); } -void MainFrame::RedrawStatusText() +void MainFrame::OnTimer() { - gtk_label_set_text(GTK_LABEL(m_pStatusLabel[c_command_status]), m_command_status.c_str()); - gtk_label_set_text(GTK_LABEL(m_pStatusLabel[c_position_status]), m_position_status.c_str()); - gtk_label_set_text(GTK_LABEL(m_pStatusLabel[c_brushcount_status]), m_brushcount_status.c_str()); - gtk_label_set_text(GTK_LABEL(m_pStatusLabel[c_texture_status]), m_texture_status.c_str()); - gtk_label_set_text(GTK_LABEL(m_pStatusLabel[c_grid_status]), m_grid_status.c_str()); + GdkModifierType mask; + + gdk_window_get_pointer (NULL, NULL, NULL, &mask); + + if ((mask & (GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK)) == 0) + { + QE_CountBrushesAndUpdateStatusBar(); + QE_CheckAutoSave(); + } + + // see MainFrame::UpdateStatusText below + if (m_bNeedStatusUpdate) + { + for (int n = 0; n < 6; n++) + { + if (m_strStatus[n].GetLength() >= 0 && m_pStatusLabel[n] != NULL) + gtk_label_set_text (GTK_LABEL (m_pStatusLabel[n]), m_strStatus[n]); + } + m_bNeedStatusUpdate = false; + } } void MainFrame::UpdateStatusText() { - m_idleRedrawStatusText.queueDraw(); + m_bNeedStatusUpdate = true; } -void MainFrame::SetStatusText(CopiedString& status_text, const char* pText) +void MainFrame::SetStatusText(int nPane, const char* pText) { - status_text = pText; - UpdateStatusText(); -} - -void Sys_Status(const char* status) -{ - if(g_pParentWnd != 0) + if (pText && nPane <= 5 && nPane >= 0) { - g_pParentWnd->SetStatusText (g_pParentWnd->m_command_status, status); + m_strStatus[nPane] = pText; + UpdateStatusText(); + } +} +void MainFrame::SetButtonMenuStates() +{ + GtkWidget *item; + g_bIgnoreCommands++; + + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showangles")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.d_savedinfo.show_angles); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_shownames")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.d_savedinfo.show_names); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showcoordinates")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.d_savedinfo.show_coordinates); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showoutline")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.d_savedinfo.show_outline); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_selection_nooutline")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF)); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showaxes")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.d_savedinfo.show_axis); + //item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showpath")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_PATHS) ? FALSE : TRUE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_clusterportals")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLUSTERPORTALS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_lightgrid")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIGHTGRID) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_world")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_WORLD) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_entities")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_ENT) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_areaportals")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_AREAPORTALS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_translucent")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_TRANSLUCENT) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_liquids")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIQUIDS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_caulk")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_clips")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLIP) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_botclips")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_BOTCLIP) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_structural")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_STRUCTURAL) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_paths")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_PATHS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_clusterportals")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLUSTERPORTALS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_lightgrid")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIGHTGRID) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_lights")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIGHTS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_patches")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CURVES) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_details")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_DETAILS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_hintsskips")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_HINTSSKIPS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_models")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_MODELS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_triggers")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (g_qeglobals.d_savedinfo.exclude & EXCLUDE_TRIGGERS) != 0); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_toggle_lock")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bTextureLock) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_toggle_rotatelock")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bRotateLock) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_cubicclipping")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bCubicClipping) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_opengllighting")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bGLLighting) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (!g_PrefsDlg.m_bNoClamp) ? TRUE : FALSE); + + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_view_cubicclipping")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bCubicClipping) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_dontselectmodel")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bSelectModels) ? FALSE : TRUE); + + if (!g_pGameDescription->mNoPatch) + { + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_dontselectcurve")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bSelectCurves) ? FALSE : TRUE); + + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_showboundingbox")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchShowBounds) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_weld")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchWeld) ? TRUE : FALSE); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_drilldown")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchDrillDown) ? TRUE : FALSE); + } + + int id, n = g_PrefsDlg.m_nTextureScale; + switch (n) + { + case 10 : id = ID_TEXTURES_TEXTUREWINDOWSCALE_10; break; + case 25 : id = ID_TEXTURES_TEXTUREWINDOWSCALE_25; break; + case 50 : id = ID_TEXTURES_TEXTUREWINDOWSCALE_50; break; + case 200 : id = ID_TEXTURES_TEXTUREWINDOWSCALE_200; break; + default : id = ID_TEXTURES_TEXTUREWINDOWSCALE_100; break; + } + SetTextureScale (id); + + // FIXME TTimo cleaned up .. the right place to do this in QE_LoadProject? +/* + if (g_qeglobals.d_project_entity) + { + FillTextureMenu(); // redundant but i'll clean it up later.. yeah right.. + FillBSPMenu(); + } + */ + g_bIgnoreCommands--; +} + +void MainFrame::UpdateWindows(int nBits) +{ + if (!g_bScreenUpdates) + return; +#ifdef DBG_WINDOWPOS + static int bean_count = 0; + char bean_buf[100]; + sprintf(bean_buf,"UpdateWindows %d",bean_count); + CheckWatchit(bean_buf); + bean_count++; +#endif + + if (nBits & (W_XY | W_XY_OVERLAY)) + { + if (m_pXYWnd) + m_pXYWnd->RedrawWindow (); + if (m_pXZWnd) + m_pXZWnd->RedrawWindow (); + if (m_pYZWnd) + m_pYZWnd->RedrawWindow (); + } + + if (nBits & W_CAMERA || ((nBits & W_CAMERA_IFON) && m_bCamPreview)) + { + if (m_pCamWnd) + m_pCamWnd->RedrawWindow (); + } + + if (nBits & (W_Z | W_Z_OVERLAY)) + { + if (m_pZWnd) + m_pZWnd->RedrawWindow (); + } + + if (nBits & W_TEXTURE) + { + if (m_pTexWnd) + m_pTexWnd->RedrawWindow (); + } +#ifdef DBG_WINDOWPOS + sprintf(bean_buf,"%d (end UpdateWidows)",bean_count); + CheckWatchit(bean_buf); +#endif +} + +void MainFrame::RoutineProcessing() +{ +#ifdef DBG_WINDOWPOS + static int bean_count = 0; + char bean_buf[100]; + sprintf(bean_buf,"RoutineProcessing %d",bean_count); + CheckWatchit(bean_buf); + bean_count++; +#endif + + if (m_bDoLoop) + { + double time = 0.0; + double oldtime = 0.0; + double delta= 0.0; + +/* // checking KeyState works right + static short a1,a2; + a2 = GetKeyState(VK_MENU); + if (a1!=a2) + { + Sys_Printf("VK_MENU: %d\n",a2); + a1 = a2; + } + static short b1,b2; + b2 = GetKeyState(VK_UP); + if (b1!=b2) + { + Sys_Printf("VK_UP: %d\n",b2); + b1 = b2; + } */ + + time = Sys_DoubleTime (); + delta = time - oldtime; + oldtime = time; + if (delta > 0.2) + delta = 0.2; + + // update the BSP process watcher + if (m_pWatchBSP) + m_pWatchBSP->RoutineProcessing(); + + // run time dependant behavior + if (m_pCamWnd) + m_pCamWnd->Cam_MouseControl(delta); + + if (g_nUpdateBits) + { + int nBits = g_nUpdateBits; // this is done to keep this routine from being + g_nUpdateBits = 0; // re-entered due to the paint process.. only + UpdateWindows(nBits); // happens in rare cases but causes a stack overflow + } +/* + // Enable/disable the menu items + GtkWidget *item; + + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_cameraupdate")); + gtk_widget_set_sensitive (item, (m_bCamPreview == false)); + if (!g_PrefsDlg.m_bWideToolbar) + { + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_view_cameraupdate")); + gtk_widget_set_sensitive (item, (m_bCamPreview == false)); + } + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_edit_undo")); + gtk_widget_set_sensitive (item, Undo_UndoAvailable()); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_edit_redo")); + gtk_widget_set_sensitive (item, Undo_RedoAvailable()); + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_file_saveregion")); + gtk_widget_set_sensitive (item, region_active); + g_bIgnoreCommands++; + // update the toolbar before displaying the menu: + // show in use check box + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_showinuse")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), !g_bShowAllShaders); + // show all check box + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_showall")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_bShowAllShaders); + g_bIgnoreCommands--; + */ + } +#ifdef DBG_WINDOWPOS + sprintf(bean_buf,"%d (end RoutineProcessing)",bean_count); + CheckWatchit(bean_buf); +#endif +} + +void MainFrame::DoWatchBSP() +{ + // network monitoring of the BSP process + if (!m_pWatchBSP) + m_pWatchBSP = new CWatchBSP(); +} + +void MainFrame::CleanPlugInMenu() +{ + GtkWidget *menu, *sep; + GList *lst; + + // delete everything after the separator + menu = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_plugin")); + sep = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_plugin_separator")); + m_nNextPlugInID = ID_PLUGIN_START; + + lst = g_list_find (gtk_container_children (GTK_CONTAINER (menu)), sep); + while (lst->next) + { + gtk_container_remove (GTK_CONTAINER (menu), GTK_WIDGET (lst->next->data)); + lst = g_list_find (gtk_container_children (GTK_CONTAINER (menu)), sep); } } -int getRotateIncrement() +void MainFrame::AddPlugInMenuItem(IPlugIn* pPlugIn) { - return static_cast(g_si_globals.rotate); + GtkWidget *menu, *item, *parent; + const char *menuText; + + parent = gtk_menu_item_new_with_label (pPlugIn->getMenuName()); + gtk_widget_show (parent); + gtk_container_add (GTK_CONTAINER (g_object_get_data (G_OBJECT (m_pWidget), "menu_plugin")), parent); + + int nCount = pPlugIn->getCommandCount(); + if (nCount > 0) + { + menu = gtk_menu_new (); + while (nCount > 0) + { + menuText = pPlugIn->getCommand(--nCount); + if (menuText != NULL && strlen(menuText) > 0) + { + if (!strcmp(menuText, "-")) + { + item = gtk_menu_item_new (); + gtk_widget_set_sensitive (item, FALSE); + } else + { + item = gtk_menu_item_new_with_label (menuText); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (m_nNextPlugInID)); + } + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + pPlugIn->addMenuID(m_nNextPlugInID++); + } + } + gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), menu); + } } -int getFarClipDistance() +void MainFrame::OnPlugIn(unsigned int nID, char* str) { - return g_camwindow_globals.m_nCubicScale; + m_PlugInMgr.Dispatch(nID, str); } -float (*GridStatus_getGridSize)() = GetGridSize; -int (*GridStatus_getRotateIncrement)() = getRotateIncrement; -int (*GridStatus_getFarClipDistance)() = getFarClipDistance; -bool (*GridStatus_getTextureLockEnabled)(); +inline GtkToolbarChildType gtktoolbarchildtype_for_toolbarbuttontype(IToolbarButton::EType type) +{ + switch(type) + { + case IToolbarButton::eSpace: + return GTK_TOOLBAR_CHILD_SPACE; + case IToolbarButton::eButton: + return GTK_TOOLBAR_CHILD_BUTTON; + case IToolbarButton::eToggleButton: + return GTK_TOOLBAR_CHILD_TOGGLEBUTTON; + case IToolbarButton::eRadioButton: + return GTK_TOOLBAR_CHILD_RADIOBUTTON; + } + Error("invalid toolbar button type"); + return (GtkToolbarChildType)0; +} + +void toolbar_insert(GtkWidget *toolbar, const char* image, const char* text, const char* tooltip, IToolbarButton::EType type, GtkSignalFunc handler, gpointer data) +{ + GtkWidget *w, *pixmap; + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + + load_plugin_bitmap(image, (void **)&gdkpixmap, (void **)&mask); + pixmap = gtk_pixmap_new (gdkpixmap, mask); + gdk_pixmap_unref (gdkpixmap); + gdk_pixmap_unref (mask); + w = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), gtktoolbarchildtype_for_toolbarbuttontype(type), NULL, text, tooltip, "", GTK_WIDGET (pixmap), handler, data); +} + +void SignalToolbarButton(GtkWidget *widget, gpointer data) +{ + const_cast(reinterpret_cast(data))->activate(); +} + +void MainFrame::AddPlugInToolbarButton(const IToolbarButton* button) +{ + GtkWidget*const toolbar = GTK_WIDGET(g_object_get_data (G_OBJECT (m_pWidget), "toolbar_plugin")); + toolbar_insert(toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), GTK_SIGNAL_FUNC(SignalToolbarButton), reinterpret_cast(const_cast(button))); +} + +void MainFrame::OnSelectionSelectNudgedown() +{ + NudgeSelection(3, g_qeglobals.d_gridsize); +} + +void MainFrame::OnSelectionSelectNudgeleft() +{ + NudgeSelection(0, g_qeglobals.d_gridsize); +} + +void MainFrame::OnSelectionSelectNudgeright() +{ + NudgeSelection(2, g_qeglobals.d_gridsize); +} + +void MainFrame::OnSelectionSelectNudgeup() +{ + NudgeSelection(1, g_qeglobals.d_gridsize); +} + +void MainFrame::NudgeSelection(int nDirection, float fAmount) +{ + if (ActiveXY()->RotateMode()) + { + int nAxis = 0; + if (ActiveXY()->GetViewType() == XY) + { + nAxis = 2; + } else + if (g_pParentWnd->ActiveXY()->GetViewType() == XZ) + { + nAxis = 1; + fAmount = -fAmount; + } + + if (nDirection == 2 || nDirection == 3) + { + fAmount = -fAmount; + } + + float fDeg = -fAmount; + float fAdj = fAmount; + + g_pParentWnd->ActiveXY()->Rotation()[nAxis] += fAdj; + CString strStatus; + strStatus.Format("Rotation x:: %.1f y:: %.1f z:: %.1f", g_pParentWnd->ActiveXY()->Rotation()[0], + g_pParentWnd->ActiveXY()->Rotation()[1], g_pParentWnd->ActiveXY()->Rotation()[2]); + g_pParentWnd->SetStatusText(2, strStatus); + Select_RotateAxis(nAxis, fDeg, false, true); + Sys_UpdateWindows (W_ALL); + } else + if (ActiveXY()->ScaleMode()) + { + if (nDirection == 0 || nDirection == 3) + { + fAmount = -fAmount; + } + vec3_t v; + v[0] = v[1] = v[2] = 1.0; + if (fAmount > 0) + { + v[0] = 1.1f; + v[1] = 1.1f; + v[2] = 1.1f; + } else + { + v[0] = 0.9f; + v[1] = 0.9f; + v[2] = 0.9f; + } + + Select_Scale((g_nScaleHow & SCALE_X) ? v[0] : 1.0, + (g_nScaleHow & SCALE_Y) ? v[1] : 1.0, + (g_nScaleHow & SCALE_Z) ? v[2] : 1.0); + Sys_UpdateWindows (W_ALL); + } else + { + // 0 - left, 1 - up, 2 - right, 3 - down + int nDim; + if (nDirection == 0) + { + nDim = ActiveXY()->GetViewType() == YZ ? 1 : 0; + fAmount = -fAmount; + } else if (nDirection == 1) + { + nDim = ActiveXY()->GetViewType() == XY ? 1 : 2; + } else if (nDirection == 2) + { + nDim = ActiveXY()->GetViewType() == YZ ? 1 : 0; + } else + { + nDim = ActiveXY()->GetViewType() == XY ? 1 : 2; + fAmount = -fAmount; + } + Nudge(nDim, fAmount); + } +} + +void MainFrame::Nudge(int nDim, float fNudge) +{ + vec3_t vMove; + vMove[0] = vMove[1] = vMove[2] = 0; + vMove[nDim] = fNudge; + + if((g_qeglobals.d_select_mode == sel_vertex || + g_qeglobals.d_select_mode == sel_curvepoint) + && g_qeglobals.d_num_move_points) + Select_NudgePoint(vMove, true); + else + Select_Move(vMove, true); + Sys_UpdateWindows (W_ALL); +} void MainFrame::SetGridStatus() { - StringOutputStream status(64); - const char* lock = (GridStatus_getTextureLockEnabled()) ? "ON" : "OFF"; - status << "G:" << GridStatus_getGridSize() - << " R:" << GridStatus_getRotateIncrement() - << " C:" << GridStatus_getFarClipDistance() - << " L:" << lock; - SetStatusText(m_grid_status, status.c_str()); + CString strStatus; + char c1; + char c2; + c1 = (g_PrefsDlg.m_bTextureLock) ? 'M' : ' '; + c2 = (g_PrefsDlg.m_bRotateLock) ? 'R' : ' '; + strStatus.Format("G:%g R:%i C:%i L:%c%c", g_qeglobals.d_gridsize, + g_PrefsDlg.m_nRotation, g_PrefsDlg.m_nCubicScale, c1, c2); + SetStatusText(4, strStatus); } -void GridStatus_onTextureLockEnabledChanged() +void MainFrame::UpdatePatchToolbarButtons() { - if(g_pParentWnd != 0) + GtkWidget *item; + g_bIgnoreCommands++; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_bend")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchBendMode) ? TRUE : FALSE); +// item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_insdel")); +// gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchInsertMode) ? TRUE : FALSE); + g_bIgnoreCommands--; +} + +// ============================================================================= +// Command handlers + +void MainFrame::OnFileNew() +{ + if (ConfirmModified()) + Map_New (); +} + +void MainFrame::OnFileOpen() +{ + if (!ConfirmModified()) + return; + + const char *str; + char buf[NAME_MAX]; + + strcpy(buf, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat(buf, "maps/"); + + str = file_dialog (m_pWidget, TRUE, "Open Map", buf, MAP_MAJOR); + + if (str != NULL) { - g_pParentWnd->SetGridStatus(); + strcpy(currentmap,str); + MRU_AddFile (str); + Map_LoadFile(str); } } -namespace +void MainFrame::OnFileImportmap() { - GLFont g_font(0, 0); + const char *str; + char buf[NAME_MAX]; + + strcpy(buf, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat(buf, "maps/"); + + str = file_dialog (m_pWidget, TRUE, "Import Map", buf, MAP_MAJOR); + + if (str != NULL) + { + Map_ImportFile(str); + } } -void GlobalGL_sharedContextCreated() +void MainFrame::OnFileSave() { - // report OpenGL information - globalOutputStream() << "GL_VENDOR: " << reinterpret_cast(glGetString (GL_VENDOR)) << "\n"; - globalOutputStream() << "GL_RENDERER: " << reinterpret_cast(glGetString (GL_RENDERER)) << "\n"; - globalOutputStream() << "GL_VERSION: " << reinterpret_cast(glGetString (GL_VERSION)) << "\n"; - globalOutputStream() << "GL_EXTENSIONS: " << reinterpret_cast(glGetString (GL_EXTENSIONS)) << "\n"; + if (!strcmp(currentmap, "unnamed.map")) + OnFileSaveas(); + else + Map_SaveFile (currentmap, false); +} - QGL_sharedContextCreated(GlobalOpenGL()); +void MainFrame::OnFileSaveas() +{ + const char* str; + char buf[NAME_MAX]; + + strcpy(buf, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat(buf, "maps/"); - ShaderCache_extensionsInitialised(); + str = file_dialog (g_pParentWnd->m_pWidget, FALSE, "Save Map", buf, MAP_MAJOR); + + if (str != NULL) + { + strcpy (currentmap, str); + MRU_AddFile (str); + Map_SaveFile (str, false); // ignore region + } +} - GlobalShaderCache().realise(); - Textures_Realise(); +void MainFrame::OnFileExportmap() +{ + const char* str; + char buf[NAME_MAX]; -#ifdef __linux__ - g_font = glfont_create("fixed 8"); + strcpy(buf, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat(buf, "maps/"); + + str = file_dialog (m_pWidget, FALSE, "Export Selection", buf, MAP_MAJOR); + + if (str != NULL) + { + Map_SaveSelected (str); + } +} + +void MainFrame::OnFileSaveregion() +{ + const char* str; + char buf[NAME_MAX]; + + strcpy(buf, g_qeglobals.m_strHomeMaps.GetBuffer()); + strcat(buf, "maps/"); + + str = file_dialog (g_pParentWnd->m_pWidget, FALSE, "Export Region", buf, MAP_MAJOR); + + if (str != NULL) + { + Map_SaveFile (str, true); // ignore region + } +} + +void MainFrame::OnFileNewproject() +{ + char* name = DoNewProjectDlg (); + + // create a new project: + // create directories and grab current project, save it in new project tree in scripts/user.qe4 + // on linux we create under ~/.q3a, on win32 under strEnginePath + // NOTE: working on a seperate project file might be broken, never did much experiment with that.. + if ((name != NULL) && (strlen (name) > 0)) + { + CString strNewBasePath; + + // NOTE TTimo this would probably not work right on *nix + strNewBasePath = g_pGameDescription->mEnginePath.GetBuffer(); // assume paths end with '/' + strNewBasePath += name; + strNewBasePath += "/"; + + CString strProjToLoad; + CString strMapToLoad; + + // if the dir exists, ask the user if they want to continue anyway + if (Q_mkdir (strNewBasePath.GetBuffer(), 0755) != 0) + { + CString strMsg; + strMsg.Format("The directory name %s already exists\nContinue anyway ?\n", strNewBasePath.GetBuffer ()); + Sys_Printf(strMsg); + if (gtk_MessageBox(m_pWidget, strMsg, "Error", MB_YESNO) != IDYES) + { + Sys_Printf("New Project cancelled, directory already exists for project\n"); + free (name); + return; + } + } + + CString strDir; + strDir = strNewBasePath; + strDir += "maps/"; + Q_mkdir (strDir.GetBuffer(), 0755); + + strDir = strNewBasePath; + strDir += "textures/"; + Q_mkdir (strDir.GetBuffer(), 0755); + + strDir = strNewBasePath; + strDir += "scripts/"; + Q_mkdir (strDir.GetBuffer(), 0755); + + // print a warning for total conversions, since setting the basepath when required files are + // not there _will_ break things (ie; textures/radiant/notex.tga, scripts/entities.def) + Sys_FPrintf(SYS_WRN, "*** Note: basepath unchanged\n"); + + SetKeyValue( g_qeglobals.d_project_entity, "gamename", name); + + strDir = strNewBasePath; + strDir += "maps/autosave.map"; + SetKeyValue( g_qeglobals.d_project_entity, "autosave", strDir.GetBuffer() ); + + // state that this is a user project file, no templating + SetKeyValue( g_qeglobals.d_project_entity, "user_project", "1" ); + // create the project file + strProjToLoad = strNewBasePath; + strProjToLoad += "scripts/"; + strProjToLoad += name; + strProjToLoad += "."; + strProjToLoad += PROJECT_FILETYPE; + QE_SaveProject(strProjToLoad.GetBuffer()); + free (name); + } +} + +void MainFrame::OnFileLoadproject() +{ + if (ConfirmModified()) + ProjectDialog (); +} + +void MainFrame::OnFileProjectsettings() +{ + DoProjectSettings(); +} + +void MainFrame::OnFilePointfile() +{ + if (g_qeglobals.d_pointfile_display_list) + Pointfile_Clear (); + else + Pointfile_Check (); +} + +void MainFrame::OnMru(unsigned int nID) +{ + if (ConfirmModified()) + MRU_Activate (nID - ID_FILE_RECENT1); +} + +void MainFrame::OnFileExit() +{ + if (ConfirmModified()) + { + // stop printing during shutdown + // NOTE: we should cleanly release GL contexts and stuff when exiting + + OnDelete(); + + g_qeglobals_gui.d_edit = NULL; + gtk_widget_destroy (m_pWidget); + } +} + +void MainFrame::OnFileCheckUpdate() + +{ + // build the URL + Str URL; + URL = "http://www.qeradiant.com/index.php?data=dlupdate&query_dlup=1"; +#ifdef _WIN32 + URL += "&OS_dlup=1"; #else - g_font = glfont_create("courier 8"); + URL += "&OS_dlup=2"; #endif - GlobalOpenGL().m_font = g_font.getDisplayList(); - GlobalOpenGL().m_fontHeight = g_font.getPixelHeight(); + URL += "&Version_dlup=" RADIANT_VERSION; + g_PrefsDlg.mGamesDialog.AddPacksURL(URL); + OpenURL(URL.GetBuffer()); } -void GlobalGL_sharedContextDestroyed() +void MainFrame::OnEditUndo() { - Textures_Unrealise(); - GlobalShaderCache().unrealise(); - - QGL_sharedContextDestroyed(GlobalOpenGL()); + Undo_Undo(); } - -void Layout_constructPreferences(PreferencesPage& page) +void MainFrame::OnEditRedo() { + Undo_Redo(); +} + +void MainFrame::OnEditCopybrush() +{ + Copy(); +} + +void MainFrame::OnEditPastebrush() +{ + Select_Deselect(); + + Undo_Start("paste"); + + Paste(); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnEditPastebrushToCamera() +{ + Select_Deselect(); + if (ActiveXY()) { - const char* layouts[] = { "window1.bmp", "window2.bmp", "window3.bmp", "window4.bmp" }; - page.appendRadioIcons( - "Window Layout", - STRING_ARRAY_RANGE(layouts), - LatchedIntImportCaller(g_Layout_viewStyle), - IntExportCaller(g_Layout_viewStyle.m_latched) - ); + vec3_t mid, camorigin, delta; + + ActiveXY()->Paste(); + + // Work out the delta + Select_GetMid( mid ); + + // Snap camera origin to grid + VectorCopy( m_pCamWnd->Camera()->origin, camorigin ); + camorigin[0] = floor(camorigin[0] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + camorigin[1] = floor(camorigin[1] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + camorigin[2] = floor(camorigin[2] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + + VectorSubtract( camorigin, mid, delta ); + + // Move to camera + Select_Move( delta, false ); + + Undo_Start("paste to camera"); + Undo_EndBrushList(&selected_brushes); + Undo_End(); } - page.appendCheckBox( - "", "Detachable Menus", - LatchedBoolImportCaller(g_Layout_enableDetachableMenus), - BoolExportCaller(g_Layout_enableDetachableMenus.m_latched) - ); - if (!string_empty(g_pGameDescription->getKeyValue("no_patch"))) +} + +void MainFrame::OnSelectionDelete() +{ + brush_t *brush; + //if (ActiveXY()) + // ActiveXY()->UndoCopy(); + Undo_Start("delete"); + Undo_AddBrushList(&selected_brushes); + //add all deleted entities to the undo + for (brush = selected_brushes.next; brush != &selected_brushes; brush = brush->next) { - page.appendCheckBox( - "", "Patch Toolbar", - LatchedBoolImportCaller(g_Layout_enablePatchToolbar), - BoolExportCaller(g_Layout_enablePatchToolbar.m_latched) - ); + Undo_AddEntity(brush->owner); } - page.appendCheckBox( - "", "Plugin Toolbar", - LatchedBoolImportCaller(g_Layout_enablePluginToolbar), - BoolExportCaller(g_Layout_enablePluginToolbar.m_latched) - ); + // NOTE: Select_Delete does NOT delete entities + Select_Delete(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); } -void Layout_constructPage(PreferenceGroup& group) +void MainFrame::OnEditMapinfo() { - PreferencesPage page(group.createPage("Layout", "Layout Preferences")); - Layout_constructPreferences(page); + DoMapInfo (); } -void Layout_registerPreferencesPage() +void MainFrame::OnEditEntityinfo() { - PreferencesDialog_addInterfacePage(FreeCaller1()); + DoEntityList (); } - -#include "preferencesystem.h" -#include "stringio.h" - -void MainFrame_Construct() +void MainFrame::OnBrushScripts() { - GlobalCommands_insert("OpenManual", FreeCaller(), Accelerator(GDK_F1)); + DoScriptsDlg (); +} - GlobalCommands_insert("Sleep", FreeCaller(), Accelerator('P', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("NewMap", FreeCaller()); - GlobalCommands_insert("OpenMap", FreeCaller(), Accelerator('O', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("ImportMap", FreeCaller()); - GlobalCommands_insert("SaveMap", FreeCaller(), Accelerator('S', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("SaveMapAs", FreeCaller()); - GlobalCommands_insert("SaveSelected", FreeCaller()); - GlobalCommands_insert("SaveRegion", FreeCaller()); - GlobalCommands_insert("RefreshReferences", FreeCaller()); - GlobalCommands_insert("ProjectSettings", FreeCaller()); - GlobalCommands_insert("CheckForUpdate", FreeCaller()); - GlobalCommands_insert("Exit", FreeCaller()); - - GlobalCommands_insert("Undo", FreeCaller(), Accelerator('Z', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Redo", FreeCaller(), Accelerator('Y', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Copy", FreeCaller(), Accelerator('C', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("Paste", FreeCaller(), Accelerator('V', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("PasteToCamera", FreeCaller(), Accelerator('V', (GdkModifierType)GDK_MOD1_MASK)); - GlobalCommands_insert("CloneSelection", FreeCaller(), Accelerator(GDK_space)); - GlobalCommands_insert("DeleteSelection", FreeCaller(), Accelerator(GDK_BackSpace)); - GlobalCommands_insert("ParentSelection", FreeCaller()); - GlobalCommands_insert("UnSelectSelection", FreeCaller(), Accelerator(GDK_Escape)); - GlobalCommands_insert("InvertSelection", FreeCaller(), Accelerator('I')); - GlobalCommands_insert("SelectInside", FreeCaller()); - GlobalCommands_insert("SelectTouching", FreeCaller()); - GlobalCommands_insert("ExpandSelectionToEntities", FreeCaller(), Accelerator('E', (GdkModifierType)(GDK_MOD1_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("Preferences", FreeCaller(), Accelerator('P')); - - GlobalCommands_insert("ToggleConsole", FreeCaller(), Accelerator('O')); - GlobalCommands_insert("ToggleEntityInspector", FreeCaller(), Accelerator('N')); - GlobalCommands_insert("EntityList", FreeCaller(), Accelerator('L')); - - GlobalCommands_insert("ShowHidden", FreeCaller(), Accelerator('H', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("HideSelected", FreeCaller(), Accelerator('H')); - - GlobalToggles_insert("DragVertices", FreeCaller(), ToggleItem::AddCallbackCaller(g_vertexMode_button), Accelerator('V')); - GlobalToggles_insert("DragEdges", FreeCaller(), ToggleItem::AddCallbackCaller(g_edgeMode_button), Accelerator('E')); - GlobalToggles_insert("DragFaces", FreeCaller(), ToggleItem::AddCallbackCaller(g_faceMode_button), Accelerator('F')); - - GlobalCommands_insert("MirrorSelectionX", FreeCaller()); - GlobalCommands_insert("RotateSelectionX", FreeCaller()); - GlobalCommands_insert("MirrorSelectionY", FreeCaller()); - GlobalCommands_insert("RotateSelectionY", FreeCaller()); - GlobalCommands_insert("MirrorSelectionZ", FreeCaller()); - GlobalCommands_insert("RotateSelectionZ", FreeCaller()); - - GlobalCommands_insert("ArbitraryRotation", FreeCaller()); - GlobalCommands_insert("ArbitraryScale", FreeCaller()); - - GlobalCommands_insert("BuildMenuCustomize", FreeCaller()); - - GlobalCommands_insert("FindBrush", FreeCaller()); - - GlobalCommands_insert("MapInfo", FreeCaller(), Accelerator('M')); - - - GlobalToggles_insert("ToggleClipper", FreeCaller(), ToggleItem::AddCallbackCaller(g_clipper_button), Accelerator('X')); - - GlobalToggles_insert("MouseTranslate", FreeCaller(), ToggleItem::AddCallbackCaller(g_translatemode_button), Accelerator('W')); - GlobalToggles_insert("MouseRotate", FreeCaller(), ToggleItem::AddCallbackCaller(g_rotatemode_button), Accelerator('R')); - GlobalToggles_insert("MouseScale", FreeCaller(), ToggleItem::AddCallbackCaller(g_scalemode_button)); - GlobalToggles_insert("MouseDrag", FreeCaller(), ToggleItem::AddCallbackCaller(g_dragmode_button), Accelerator('Q')); - - GlobalCommands_insert("ColorSchemeOriginal", FreeCaller()); - GlobalCommands_insert("ColorSchemeQER", FreeCaller()); - GlobalCommands_insert("ColorSchemeBlackAndGreen", FreeCaller()); - GlobalCommands_insert("ColorSchemeYdnar", FreeCaller()); - GlobalCommands_insert("ChooseTextureBackgroundColor", makeCallback(g_ColoursMenu.m_textureback)); - GlobalCommands_insert("ChooseGridBackgroundColor", makeCallback(g_ColoursMenu.m_xyback)); - GlobalCommands_insert("ChooseGridMajorColor", makeCallback(g_ColoursMenu.m_gridmajor)); - GlobalCommands_insert("ChooseGridMinorColor", makeCallback(g_ColoursMenu.m_gridminor)); - GlobalCommands_insert("ChooseSmallGridMajorColor", makeCallback(g_ColoursMenu.m_gridmajor_alt)); - GlobalCommands_insert("ChooseSmallGridMinorColor", makeCallback(g_ColoursMenu.m_gridminor_alt)); - GlobalCommands_insert("ChooseGridTextColor", makeCallback(g_ColoursMenu.m_gridtext)); - GlobalCommands_insert("ChooseGridBlockColor", makeCallback(g_ColoursMenu.m_gridblock)); - GlobalCommands_insert("ChooseBrushColor", makeCallback(g_ColoursMenu.m_brush)); - GlobalCommands_insert("ChooseCameraBackgroundColor", makeCallback(g_ColoursMenu.m_cameraback)); - GlobalCommands_insert("ChooseSelectedBrushColor", makeCallback(g_ColoursMenu.m_selectedbrush)); - GlobalCommands_insert("ChooseCameraSelectedBrushColor", makeCallback(g_ColoursMenu.m_selectedbrush3d)); - GlobalCommands_insert("ChooseClipperColor", makeCallback(g_ColoursMenu.m_clipper)); - GlobalCommands_insert("ChooseOrthoViewNameColor", makeCallback(g_ColoursMenu.m_viewname)); - - - GlobalCommands_insert("CSGSubtract", FreeCaller(), Accelerator('U', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("CSGMerge", FreeCaller(), Accelerator('U', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("CSGHollow", FreeCaller()); - - Grid_registerCommands(); - - GlobalCommands_insert("SnapToGrid", FreeCaller(), Accelerator('G', (GdkModifierType)GDK_CONTROL_MASK)); - - GlobalCommands_insert("SelectAllOfType", FreeCaller(), Accelerator('A', (GdkModifierType)GDK_SHIFT_MASK)); - - GlobalCommands_insert("TexRotateClock", FreeCaller(), Accelerator(GDK_Next, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("TexRotateCounter", FreeCaller(), Accelerator(GDK_Prior, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("TexScaleUp", FreeCaller(), Accelerator(GDK_Up, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("TexScaleDown", FreeCaller(), Accelerator(GDK_Down, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("TexScaleLeft", FreeCaller(), Accelerator(GDK_Left, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("TexScaleRight", FreeCaller(), Accelerator(GDK_Right, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("TexShiftUp", FreeCaller(), Accelerator(GDK_Up, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("TexShiftDown", FreeCaller(), Accelerator(GDK_Down, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("TexShiftLeft", FreeCaller(), Accelerator(GDK_Left, (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("TexShiftRight", FreeCaller(), Accelerator(GDK_Right, (GdkModifierType)GDK_SHIFT_MASK)); - - GlobalCommands_insert("MoveSelectionDOWN", FreeCaller(), Accelerator(GDK_KP_Subtract)); - GlobalCommands_insert("MoveSelectionUP", FreeCaller(), Accelerator(GDK_KP_Add)); - - GlobalCommands_insert("SelectNudgeLeft", FreeCaller(), Accelerator(GDK_Left, (GdkModifierType)GDK_MOD1_MASK)); - GlobalCommands_insert("SelectNudgeRight", FreeCaller(), Accelerator(GDK_Right, (GdkModifierType)GDK_MOD1_MASK)); - GlobalCommands_insert("SelectNudgeUp", FreeCaller(), Accelerator(GDK_Up, (GdkModifierType)GDK_MOD1_MASK)); - GlobalCommands_insert("SelectNudgeDown", FreeCaller(), Accelerator(GDK_Down, (GdkModifierType)GDK_MOD1_MASK)); - - Patch_registerCommands(); - XYShow_registerCommands(); - - typedef FreeCaller1 ComponentModeSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(ComponentModeSelectionChangedCaller()); - - GlobalPreferenceSystem().registerPreference("DetachableMenus", BoolImportStringCaller(g_Layout_enableDetachableMenus.m_latched), BoolExportStringCaller(g_Layout_enableDetachableMenus.m_latched)); - GlobalPreferenceSystem().registerPreference("PatchToolBar", BoolImportStringCaller(g_Layout_enablePatchToolbar.m_latched), BoolExportStringCaller(g_Layout_enablePatchToolbar.m_latched)); - GlobalPreferenceSystem().registerPreference("PluginToolBar", BoolImportStringCaller(g_Layout_enablePluginToolbar.m_latched), BoolExportStringCaller(g_Layout_enablePluginToolbar.m_latched)); - GlobalPreferenceSystem().registerPreference("QE4StyleWindows", IntImportStringCaller(g_Layout_viewStyle.m_latched), IntExportStringCaller(g_Layout_viewStyle.m_latched)); - GlobalPreferenceSystem().registerPreference("XYHeight", IntImportStringCaller(g_layout_globals.nXYHeight), IntExportStringCaller(g_layout_globals.nXYHeight)); - GlobalPreferenceSystem().registerPreference("XYWidth", IntImportStringCaller(g_layout_globals.nXYWidth), IntExportStringCaller(g_layout_globals.nXYWidth)); - GlobalPreferenceSystem().registerPreference("CamWidth", IntImportStringCaller(g_layout_globals.nCamWidth), IntExportStringCaller(g_layout_globals.nCamWidth)); - GlobalPreferenceSystem().registerPreference("CamHeight", IntImportStringCaller(g_layout_globals.nCamHeight), IntExportStringCaller(g_layout_globals.nCamHeight)); - - GlobalPreferenceSystem().registerPreference("State", IntImportStringCaller(g_layout_globals.nState), IntExportStringCaller(g_layout_globals.nState)); - GlobalPreferenceSystem().registerPreference("PositionX", IntImportStringCaller(g_layout_globals.m_position.x), IntExportStringCaller(g_layout_globals.m_position.x)); - GlobalPreferenceSystem().registerPreference("PositionY", IntImportStringCaller(g_layout_globals.m_position.y), IntExportStringCaller(g_layout_globals.m_position.y)); - GlobalPreferenceSystem().registerPreference("Width", IntImportStringCaller(g_layout_globals.m_position.w), IntExportStringCaller(g_layout_globals.m_position.w)); - GlobalPreferenceSystem().registerPreference("Height", IntImportStringCaller(g_layout_globals.m_position.h), IntExportStringCaller(g_layout_globals.m_position.h)); - - GlobalPreferenceSystem().registerPreference("CamWnd", WindowPositionTrackerImportStringCaller(g_posCamWnd), WindowPositionTrackerExportStringCaller(g_posCamWnd)); - GlobalPreferenceSystem().registerPreference("XYWnd", WindowPositionTrackerImportStringCaller(g_posXYWnd), WindowPositionTrackerExportStringCaller(g_posXYWnd)); - GlobalPreferenceSystem().registerPreference("YZWnd", WindowPositionTrackerImportStringCaller(g_posYZWnd), WindowPositionTrackerExportStringCaller(g_posYZWnd)); - GlobalPreferenceSystem().registerPreference("XZWnd", WindowPositionTrackerImportStringCaller(g_posXZWnd), WindowPositionTrackerExportStringCaller(g_posXZWnd)); +void MainFrame::OnEditLoadprefab() +{ + const char *filename; + CString CurPath; + if (g_PrefsDlg.m_strPrefabPath.GetLength() > 0) { - const char* ENGINEPATH_ATTRIBUTE = -#if defined(WIN32) - "enginepath_win32" -#elif defined(__linux__) || defined (__FreeBSD__) - "enginepath_linux" -#elif defined(__APPLE__) - "enginepath_macos" -#else -#error "unknown platform" + CurPath = g_PrefsDlg.m_strPrefabPath; + AddSlash (CurPath); + } + + filename = file_dialog (m_pWidget, TRUE, "Import Prefab", CurPath.GetBuffer(), MAP_MAJOR); + + if (filename != NULL) + { + Map_ImportFile(filename); + } +} + +void MainFrame::OnEditSaveprefab() +{ + const char *filename; + CString CurPath; + + if (g_PrefsDlg.m_strPrefabPath.GetLength() > 0) + { + CurPath = g_PrefsDlg.m_strPrefabPath; + } else + { + char tmp[PATH_MAX]; + getcwd (tmp, PATH_MAX); + CurPath = tmp; + } + AddSlash (CurPath); + + filename = file_dialog (m_pWidget, FALSE, "Export Prefab", CurPath.GetBuffer(), MAP_MAJOR); + if (filename != NULL) + { + Map_SaveSelected(filename); + } +} + +void MainFrame::OnPrefs() +{ + int nView = g_PrefsDlg.m_nView; + bool bToolbar = g_PrefsDlg.m_bWideToolbar; + bool bPluginToolbar = g_PrefsDlg.m_bPluginToolbar; + int nShader = g_PrefsDlg.m_nShader; + int nTextureQuality = g_PrefsDlg.m_nTextureQuality; + int nLightRadiuses = g_PrefsDlg.m_nLightRadiuses; + g_PrefsDlg.LoadPrefs(); + + if (g_PrefsDlg.DoModal() == IDOK) + { + if ((g_PrefsDlg.m_nLatchedView != nView) || + (g_PrefsDlg.m_bLatchedDetachableMenus != g_PrefsDlg.m_bDetachableMenus) || + (g_PrefsDlg.m_bLatchedWideToolbar != bToolbar) || + (g_PrefsDlg.m_bLatchedPatchToolbar != bToolbar) || + (g_PrefsDlg.m_bLatchedPluginToolbar != bPluginToolbar) || + (g_PrefsDlg.m_nLatchedShader != nShader) || + (g_PrefsDlg.m_nLatchedTextureQuality != nTextureQuality) + || (g_PrefsDlg.m_bLatchedFloatingZ != g_PrefsDlg.m_bFloatingZ) + ) + gtk_MessageBox(m_pWidget, "You must restart Radiant for the changes to take effect."); + + // if the view mode was switched to floating, set the Z window on by default + // this was originally intended as a bug fix, but the fix is elsewhere .. anyway making sure we force Z on each time is good + // (and we simply hope there will be a SavePrefs before we die) + if ((g_PrefsDlg.m_nView != nView) && ((EViewStyle)g_PrefsDlg.m_nView == (EViewStyle)eFloating)) + { + g_PrefsDlg.m_bZVis = true; + } + + if (m_pTexWnd) + m_pTexWnd->UpdatePrefs(); + + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + (!g_PrefsDlg.m_bNoClamp) ? TRUE : FALSE); + g_bIgnoreCommands--; + } +} + +void MainFrame::OnTogglecamera() +{ + if (CurrentStyle() == eFloating) // floating views + { + if (m_pCamWnd && m_pCamWnd->m_pParent) + { + if (GTK_WIDGET_VISIBLE (m_pCamWnd->m_pParent)) + widget_delete_hide (m_pCamWnd->m_pParent); + else + gtk_widget_show (m_pCamWnd->m_pParent); + } + } else + { + if (GTK_WIDGET_VISIBLE (m_pCamWnd->GetWidget ())) + gtk_widget_hide (m_pCamWnd->GetWidget ()); + else + gtk_widget_show (m_pCamWnd->GetWidget ()); + } +} + +void MainFrame::OnToggleconsole() +{ + if (FloatingGroupDialog()) // QE4 style + { + if (inspector_mode == W_CONSOLE) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + gtk_widget_show (g_qeglobals_gui.d_entity); + } else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_CONSOLE); + } + } +} + +// trigger the entity inspector on/off +void MainFrame::OnViewEntity() +{ + // make sure we're working with the current selection (bugzilla #436) + if( ! GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + Select_Reselect(); + + if (!FloatingGroupDialog()) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity) && inspector_mode == W_ENTITY) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_ENTITY); + } + } else + { + if (inspector_mode == W_ENTITY) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + gtk_widget_show (g_qeglobals_gui.d_entity); + } else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_ENTITY); + } + } +} + +void MainFrame::OnViewGroups() +{ + if (!FloatingGroupDialog()) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity) && inspector_mode == W_GROUP) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_GROUP); + } + } else + { + if (inspector_mode == W_GROUP && CurrentStyle() != MainFrame::eFloating) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + gtk_widget_show (g_qeglobals_gui.d_entity); + } else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_GROUP); + } + } +} + +void MainFrame::OnToggleview() +{ + if (CurrentStyle() == eFloating) // QE4 style + { + if (m_pXYWnd && m_pXYWnd->m_pParent) + { + if (GTK_WIDGET_VISIBLE (m_pXYWnd->m_pParent)) + widget_delete_hide (m_pXYWnd->m_pParent); + else + gtk_widget_show (m_pXYWnd->m_pParent); + } + } +} + +void MainFrame::OnToggleviewXz() +{ + if (CurrentStyle() == eFloating) // QE4 style + { + if (m_pXZWnd && m_pXZWnd->m_pParent) + { + // get windowplacement doesn't actually save this so we will here + g_PrefsDlg.m_bXZVis = GTK_WIDGET_VISIBLE (m_pXZWnd->m_pParent); + if (g_PrefsDlg.m_bXZVis) + widget_delete_hide (m_pXZWnd->m_pParent); + else + gtk_widget_show (m_pXZWnd->m_pParent); + g_PrefsDlg.m_bXZVis ^= 1; + g_PrefsDlg.SavePrefs (); + } + } +} + +void MainFrame::OnToggleviewYz() +{ + if (CurrentStyle() == eFloating) // QE4 style + { + if (m_pYZWnd && m_pYZWnd->m_pParent) + { + g_PrefsDlg.m_bYZVis = GTK_WIDGET_VISIBLE (m_pYZWnd->m_pParent); + if (g_PrefsDlg.m_bYZVis) + widget_delete_hide (m_pYZWnd->m_pParent); + else + gtk_widget_show (m_pYZWnd->m_pParent); + g_PrefsDlg.m_bYZVis ^= 1; + g_PrefsDlg.SavePrefs (); + } + } +} + +void MainFrame::OnTogglez() +{ + if ( g_pParentWnd->FloatingGroupDialog() ) // QE4 style + { + if (m_pZWnd && m_pZWnd->m_pParent) + { + if (GTK_WIDGET_VISIBLE (m_pZWnd->m_pParent)) + widget_delete_hide (m_pZWnd->m_pParent); + else + gtk_widget_show (m_pZWnd->m_pParent); + g_PrefsDlg.m_bZVis ^= 1; + g_PrefsDlg.SavePrefs (); + } + } else { + Sys_FPrintf( SYS_WRN, "Z view toggle is only valid in floating views\n" ); + } +} + +void MainFrame::OnViewCenter() +{ + m_pCamWnd->Camera()->angles[ROLL] = m_pCamWnd->Camera()->angles[PITCH] = 0; + m_pCamWnd->Camera()->angles[YAW] = 22.5 * floor((m_pCamWnd->Camera()->angles[YAW]+11)/22.5); + Sys_UpdateWindows (W_CAMERA | W_XY_OVERLAY); +} + +void MainFrame::OnViewUpfloor() +{ + m_pCamWnd->Cam_ChangeFloor (true); +} + +void MainFrame::OnViewDownfloor() +{ + m_pCamWnd->Cam_ChangeFloor (false); +} + +void MainFrame::OnViewCenterview() +{ + if(CurrentStyle() == eSplit) + { + GetXYWnd()->PositionView(); + GetXZWnd()->PositionView(); + GetYZWnd()->PositionView(); + Sys_UpdateWindows (W_XY|W_XZ|W_YZ); + } + else { + m_pXYWnd->PositionView(); + Sys_UpdateWindows (W_XY); + } +} + +void MainFrame::OnViewNextview() +{ + if (CurrentStyle() == eSplit) + { + GetXYWnd()->PositionView(); + GetXZWnd()->PositionView(); + GetYZWnd()->PositionView(); + Sys_UpdateWindows (W_XY|W_XZ|W_YZ); + } + else { + if (m_pXYWnd->GetViewType() == XY) + m_pXYWnd->SetViewType(XZ); + else + if (m_pXYWnd->GetViewType() == XZ) + m_pXYWnd->SetViewType(YZ); + else + m_pXYWnd->SetViewType(XY); + m_pXYWnd->PositionView(); + Sys_UpdateWindows (W_XY); + } +} + +void MainFrame::OnViewXy() +{ + if(!FloatingGroupDialog()) + { + m_pXYWnd->SetViewType(XY); + m_pXYWnd->PositionView(); + } + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewSide() +{ + if (!FloatingGroupDialog()) + { + m_pXYWnd->SetViewType(XZ); + m_pXYWnd->PositionView(); + } + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewFront() +{ + if (!FloatingGroupDialog()) + { + m_pXYWnd->SetViewType(YZ); + m_pXYWnd->PositionView(); + } + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnView100() +{ + if (m_pXYWnd) + m_pXYWnd->SetScale(1); + if (m_pXZWnd) + m_pXZWnd->SetScale(1); + if (m_pYZWnd) + m_pYZWnd->SetScale(1); + Sys_UpdateWindows (W_XY|W_XY_OVERLAY); +} + +void MainFrame::OnViewZoomin() +{ + if (m_pXYWnd && m_pXYWnd->Active()) + { + m_pXYWnd->SetScale(m_pXYWnd->Scale() * 5.0 / 4); + if (m_pXYWnd->Scale() > 30) + m_pXYWnd->SetScale(30); + } + + if (m_pXZWnd && m_pXZWnd->Active()) + { + m_pXZWnd->SetScale(m_pXZWnd->Scale() * 5.0 / 4); + if (m_pXZWnd->Scale() > 30) + m_pXZWnd->SetScale(30); + } + + if (m_pYZWnd && m_pYZWnd->Active()) + { + m_pYZWnd->SetScale(m_pYZWnd->Scale() * 5.0 / 4); + if (m_pYZWnd->Scale() > 30) + m_pYZWnd->SetScale(30); + } + + Sys_UpdateWindows (W_XY|W_XY_OVERLAY); +} + +// NOTE: the zoom out factor is 4/5, we could think about customizing it +// we don't go below a zoom factor corresponding to 10% of the max world size +// (this has to be computed against the window size) +void MainFrame::OnViewZoomout() +{ + float min_scale; + if (m_pXYWnd && m_pXYWnd->Active()) + { + m_pXYWnd->SetScale(m_pXYWnd->Scale() * 4.0 / 5); + min_scale = MIN(m_pXYWnd->Width(),m_pXYWnd->Height()) / ( 1.1 * (g_MaxWorldCoord-g_MinWorldCoord)); + if (m_pXYWnd->Scale() < min_scale) m_pXYWnd->SetScale (min_scale); + } + + if (m_pXZWnd && m_pXZWnd->Active()) + { + m_pXZWnd->SetScale(m_pXZWnd->Scale() * 4.0 / 5); + min_scale = MIN(m_pXZWnd->Width(),m_pXZWnd->Height()) / ( 1.1 * (g_MaxWorldCoord-g_MinWorldCoord)); + if (m_pXZWnd->Scale() < min_scale) m_pXZWnd->SetScale (min_scale); + } + + if (m_pYZWnd && m_pYZWnd->Active()) + { + m_pYZWnd->SetScale(m_pYZWnd->Scale() * 4.0 / 5); + min_scale = MIN(m_pYZWnd->Width(),m_pYZWnd->Height()) / ( 1.1 * (g_MaxWorldCoord-g_MinWorldCoord)); + if (m_pYZWnd->Scale() < min_scale) m_pYZWnd->SetScale (min_scale); + } + Sys_UpdateWindows (W_XY|W_XY_OVERLAY); +} + +void MainFrame::OnViewZ100() +{ + z.scale = 1; + Sys_UpdateWindows (W_Z|W_Z_OVERLAY); +} + +void MainFrame::OnViewZzoomin() +{ + z.scale *= 5.0/4; + if (z.scale > 4) + z.scale = 4; + Sys_UpdateWindows (W_Z|W_Z_OVERLAY); +} + +void MainFrame::OnViewZzoomout() +{ + z.scale *= 4.0f/5; + if (z.scale < 0.125) + z.scale = 0.125; + Sys_UpdateWindows (W_Z|W_Z_OVERLAY); +} + +void MainFrame::OnViewCubein() +{ + g_PrefsDlg.m_nCubicScale--; + if (g_PrefsDlg.m_nCubicScale < 1) + g_PrefsDlg.m_nCubicScale = 1; + g_PrefsDlg.SavePrefs (); + Sys_UpdateWindows(W_CAMERA); + SetGridStatus(); +} + +void MainFrame::OnViewCubeout() +{ + g_PrefsDlg.m_nCubicScale++; + if (g_PrefsDlg.m_nCubicScale > 22) + g_PrefsDlg.m_nCubicScale = 22; + g_PrefsDlg.SavePrefs (); + Sys_UpdateWindows(W_CAMERA); + SetGridStatus(); +} + +void MainFrame::OnViewShownames() +{ + g_qeglobals.d_savedinfo.show_names = !g_qeglobals.d_savedinfo.show_names; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_shownames")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + g_qeglobals.d_savedinfo.show_names ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewShowAngles() +{ + g_qeglobals.d_savedinfo.show_angles = !g_qeglobals.d_savedinfo.show_angles; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showangles")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + g_qeglobals.d_savedinfo.show_angles ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewShowblocks() +{ + g_qeglobals.show_blocks ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showblocks")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_qeglobals.show_blocks ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewShowcoordinates() +{ + g_qeglobals.d_savedinfo.show_coordinates ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showcoordinates")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + g_qeglobals.d_savedinfo.show_coordinates ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY|W_Z); +} + +void MainFrame::OnViewShowOutline() +{ + g_qeglobals.d_savedinfo.show_outline ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showoutline")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + g_qeglobals.d_savedinfo.show_outline ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewShowAxes() +{ + g_qeglobals.d_savedinfo.show_axis ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showaxes")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + g_qeglobals.d_savedinfo.show_axis ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewShowWorkzone() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_showworkzone")); + g_bIgnoreCommands++; + if (g_qeglobals.d_show_work) + { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_qeglobals.d_show_work = false; + } else + { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_qeglobals.d_show_work = true; + } + g_bIgnoreCommands--; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnViewHideshowHideselected() +{ + Select_Hide(); + Select_Deselect(); +} + +void MainFrame::OnViewHideshowShowhidden() +{ + Select_ShowAllHidden(); +} + +/** +sets the view mode for the entities +called upon LoadPrefs too +NOTE TTimo previous implementation had a SavePrefs call + .. I don't think it is relevant, removed (the prefs are saved upon exit) +NOTE TTimo we activate the menu item, this is only needed when we are called upon a prefs load + (otherwise we are always called following user action on the widget) +*/ +void MainFrame::OnEntitiesSetViewAs(int mode) +{ + gpointer item = NULL; + if (mode == 0) + { + switch (g_PrefsDlg.m_nEntityShowState) + { + case ENTITY_BOX: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_boundingbox"); + break; + case ENTITY_WIRE: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_wireframe"); + break; + case ENTITY_SELECTED: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_selectedwireframe"); + break; + case ENTITY_SELECTED_SKIN: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_selectedskinned"); + break; + case ENTITY_SKINNED: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_skinned"); + break; + case ENTITY_SKINNED_BOXED: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_skinnedandboxed"); + break; + } + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; + return; + } + + switch (mode) + { + case ID_VIEW_ENTITIESAS_BOUNDINGBOX: + g_PrefsDlg.m_nEntityShowState = ENTITY_BOX; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_boundingbox"); + break; + case ID_VIEW_ENTITIESAS_WIREFRAME: + g_PrefsDlg.m_nEntityShowState = ENTITY_WIRE; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_wireframe"); + break; + case ID_VIEW_ENTITIESAS_SELECTEDWIREFRAME: + g_PrefsDlg.m_nEntityShowState = ENTITY_SELECTED; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_selectedwireframe"); + break; + case ID_VIEW_ENTITIESAS_SELECTEDSKINNED: + g_PrefsDlg.m_nEntityShowState = ENTITY_SELECTED_SKIN; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_selectedskinned"); + break; + case ID_VIEW_ENTITIESAS_SKINNED: + g_PrefsDlg.m_nEntityShowState = ENTITY_SKINNED; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_skinned"); + break; + case ID_VIEW_ENTITIESAS_SKINNEDANDBOXED: + g_PrefsDlg.m_nEntityShowState = ENTITY_SKINNED_BOXED; + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_entitiesas_skinnedandboxed"); + break; + default: + Sys_FPrintf(SYS_ERR, "Entity mode ID_ not found in MainFrame::Entities_SetViewAs\n"); + return; + } + + if (!item) + { + Sys_FPrintf(SYS_ERR, "menu not found in MainFrame::Entities_SetViewAs\n"); + return; + } + + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; + + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnViewCubicclipping() +{ + GtkWidget *w; + + g_PrefsDlg.m_bCubicClipping ^= 1; + g_bIgnoreCommands++; + w = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_cubicclipping")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), g_PrefsDlg.m_bCubicClipping ? TRUE : FALSE); + w = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_view_cubicclipping")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), g_PrefsDlg.m_bCubicClipping ? TRUE : FALSE); + g_bIgnoreCommands--; + g_PrefsDlg.SavePrefs (); + //Map_BuildBrushData (); + Sys_UpdateWindows(W_CAMERA); +} + +void MainFrame::OnViewOpengllighting() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_opengllighting")); + g_PrefsDlg.m_bGLLighting ^= 1; + g_PrefsDlg.SavePrefs (); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bGLLighting ? TRUE : FALSE); + Sys_UpdateWindows (W_XY|W_CAMERA); + g_bIgnoreCommands--; +} + +void MainFrame::OnSelectionDragedges() +{ + if (g_qeglobals.d_select_mode == sel_edge) + { + g_qeglobals.d_select_mode = sel_brush; + Sys_UpdateWindows (W_ALL); + } else + { + SetupVertexSelection (); + if (g_qeglobals.d_numpoints) + g_qeglobals.d_select_mode = sel_edge; + Sys_UpdateWindows (W_ALL); + } +} + +void MainFrame::OnSelectionDragvertecies() +{ + if (g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_curvepoint) + { + g_qeglobals.d_select_mode = sel_brush; + Sys_UpdateWindows (W_ALL); + } else + { + //--if (QE_SingleBrush() && selected_brushes.next->patchBrush) + if (OnlyPatchesSelected()) + { + Patch_EditPatch(); + } else //if (!AnyPatchesSelected()) // allows vertex mode when patches are selected + { + SetupVertexSelection (); + if (g_qeglobals.d_numpoints) + g_qeglobals.d_select_mode = sel_vertex; + } + Sys_UpdateWindows (W_ALL); + } +} + +void MainFrame::OnSelectionClone() +{ + Select_Clone(); +} + +// called when the escape key is used (either on the main window or on an inspector) +void MainFrame::OnSelectionDeselect() +{ + if (g_bClipMode) + OnViewClipper(); + else + if (g_bRotateMode) + OnSelectMouserotate(); + else + if (g_bScaleMode) + OnSelectMousescale(); + else + if (g_bPathMode) + { + if (ActiveXY()) + ActiveXY()->KillPathMode(); + } else + { + if (g_qeglobals.d_select_mode == sel_curvepoint && g_qeglobals.d_num_move_points > 0) + { + g_qeglobals.d_num_move_points = 0; + Sys_UpdateWindows(W_ALL); + } else + { + Select_Deselect (); + SetStatusText(2, " "); + } + } +} + +void MainFrame::OnBrushFlipx() +{ + Undo_Start("flip X"); + Undo_AddBrushList(&selected_brushes); + + Select_FlipAxis (0); + // spog - this does not work - it's a rotate not a flip + /* + for (brush_t *b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if(b->owner->eclass->fixedsize) + { + char buf[16]; + float a = FloatForKey(b->owner, "angle"); + a = div ((int)(180 - a), 180).rem; + sprintf (buf, "%d", (int)a); + SetKeyValue(b->owner, "angle", buf); + Brush_Build(b,true,true,false,false); // don't filter + } + } + */ + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushFlipy() +{ + Undo_Start("flip Y"); + Undo_AddBrushList(&selected_brushes); + + Select_FlipAxis (1); + // spog - this does not work - it's a rotate not a flip + /* + for (brush_t *b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if(b->owner->eclass->fixedsize) + { + float a = FloatForKey(b->owner, "angle"); + if (a == 0 || a == 180 || a == 360) + continue; + if ( a == 90 || a == 270) + { + a += 180; + } + else if (a > 270) + a += 90; + else if (a > 180) + a -= 90; + else if (a > 90) + a += 90; + else + a -= 90; + a = (int)a % 360; + char buf[16]; + sprintf (buf, "%d", (int)a); + SetKeyValue(b->owner, "angle", buf); + Brush_Build(b,true,true,false,false); // don't filter + } + + } + */ + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushFlipz() +{ + Undo_Start("flip Z"); + Undo_AddBrushList(&selected_brushes); + Select_FlipAxis (2); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushRotatex() +{ + Undo_Start("rotate X"); + Undo_AddBrushList(&selected_brushes); + Select_RotateAxis (0, 90); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushRotatey() +{ + Undo_Start("rotate Y"); + Undo_AddBrushList(&selected_brushes); + Select_RotateAxis (1, 90); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushRotatez() +{ + Undo_Start("rotate Z"); + Undo_AddBrushList(&selected_brushes); + Select_RotateAxis (2, 90); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionArbitraryrotation() +{ + Undo_Start("arbitrary rotation"); + Undo_AddBrushList(&selected_brushes); + + DoRotateDlg (); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectScale() +{ + Undo_Start("scale"); + Undo_AddBrushList(&selected_brushes); + DoScaleDlg (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionMakehollow() +{ + //if (ActiveXY()) + // ActiveXY()->UndoCopy(); + Undo_Start("hollow"); + Undo_AddBrushList(&selected_brushes); + CSG_MakeHollow (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionCsgsubtract() +{ + Undo_Start("CSG subtract"); + CSG_Subtract(); + Undo_End(); +} + +void MainFrame::OnSelectionCsgmerge() +{ + Undo_Start("CSG merge"); + Undo_AddBrushList(&selected_brushes); + CSG_Merge(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionNoOutline() +{ + //g_qeglobals.d_savedinfo.bNoSelectedOutlines ^= 1; + g_qeglobals.d_savedinfo.iSelectedOutlinesStyle = (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF) ^ OUTLINE_ZBUF; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_selection_nooutline")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF)); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_CAMERA); +} + +void MainFrame::OnSelectionOutlineStyle() +{ + if ((g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF) && (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_BSEL)) + g_qeglobals.d_savedinfo.iSelectedOutlinesStyle &= ~OUTLINE_ZBUF; + else if (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_BSEL) + g_qeglobals.d_savedinfo.iSelectedOutlinesStyle &= ~OUTLINE_BSEL; + else if (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF) + g_qeglobals.d_savedinfo.iSelectedOutlinesStyle |= OUTLINE_BSEL; + else + g_qeglobals.d_savedinfo.iSelectedOutlinesStyle |= OUTLINE_ZBUF; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_selection_nooutline")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_qeglobals.d_savedinfo.iSelectedOutlinesStyle & OUTLINE_ZBUF)); + g_bIgnoreCommands--; + Sys_UpdateWindows (W_CAMERA); +} + +void MainFrame::OnSelectionSelectcompletetall() +{ + if (ActiveXY()) + ActiveXY()->UndoCopy(); + Select_CompleteTall (); +} + +void MainFrame::OnSelectionSelecttouching() +{ + Select_Touching(); +} + +void MainFrame::OnSelectionSelectpartialtall() +{ + Select_PartialTall(); +} + +void MainFrame::OnSelectionSelectinside() +{ + Select_Inside (); +} + +void MainFrame::OnViewClipper() +{ + GtkWidget *w = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_view_clipper")); + g_bIgnoreCommands++; + + if (ActiveXY()) + { + if (ActiveXY()->ClipMode()) + { + ActiveXY()->SetClipMode(false); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), FALSE); + } else + { + if (ActiveXY()->RotateMode()) + OnSelectMouserotate(); + ActiveXY()->SetClipMode(true); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE); + } + } + g_bIgnoreCommands--; +} + +void MainFrame::OnClipSelected() +{ + if (m_pActiveXY && m_pActiveXY->ClipMode()) + { + Undo_Start("clip selected"); + Undo_AddBrushList(&selected_brushes); + m_pActiveXY->Clip(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + } else + { + if (g_bPatchBendMode) + Patch_BendHandleENTER(); +// else if (g_bPatchBendMode) +// Patch_InsDelHandleENTER(); + } +} + +void MainFrame::OnSplitSelected() +{ + if (m_pActiveXY) + { + Undo_Start("split selected"); + Undo_AddBrushList(&selected_brushes); + m_pActiveXY->SplitClip(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + } +} + +void MainFrame::OnFlipClip() +{ + if (m_pActiveXY) + m_pActiveXY->FlipClip(); +} + +void MainFrame::OnSelectionConnect() +{ + Undo_Start("connect selected entities"); + Undo_AddBrushList(&selected_brushes); + ConnectEntities(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionUngroupentity() +{ + Undo_Start("ungroup selected entities"); + Undo_AddBrushList(&selected_brushes); + Select_Ungroup(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionMergeentity() +{ + Undo_Start("merge entity"); + Undo_AddBrushList(&selected_brushes); + Select_MergeEntity(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionGroupworld() +{ + Undo_Start("group world"); + Undo_AddBrushList(&selected_brushes); + Select_GroupEntity(world_entity); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionMakeDetail() +{ + Undo_Start("make detail"); + Undo_AddBrushList(&selected_brushes); + Select_MakeDetail (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionMakeStructural() +{ + Undo_Start("make structural"); + Undo_AddBrushList(&selected_brushes); + Select_MakeStructural (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBspCommand (unsigned int nID) +{ + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503 + // make sure we don't attempt to region compile a map with the camera outside the region + if (region_active) + { + vec3_t vOrig; + VectorSet(vOrig, + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[0], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[1], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[2]); + + int i; + for (i=0 ; i<3 ; i++) + { + if (vOrig[i] > region_maxs[i] || vOrig[i] < region_mins[i]) + { + Sys_FPrintf(SYS_ERR, "The camera must be in the region to start a region compile.\n"); + return; + } + } + } + + // if the map has not been saved yet we need to handle it now before we start processing the BSP commands + if (stricmp( currentmap, "unnamed.map") == 0) + { + OnFileSaveas(); + } + + if (g_PrefsDlg.m_bSnapShots && (stricmp (currentmap, "unnamed.map") != 0)) + Map_Snapshot(); + + if (g_qeglobals.bBSPFrontendPlugin) + { + char *cmd = (char*)g_slist_nth_data (g_BSPFrontendCommands, nID-CMD_BSPCOMMAND); + g_BSPFrontendTable.m_pfnDispatchBSPCommand (cmd); + } else + { + RunBsp (bsp_commands[nID-CMD_BSPCOMMAND]); + } +} + +void MainFrame::OnGrid (unsigned int nID) +{ + if (nID == ID_GRID_025) + { + g_qeglobals.d_gridsize = 0.25f; + g_qeglobals.d_bSmallGrid = true; + } else if (nID == ID_GRID_05) + { + g_qeglobals.d_gridsize = 0.5f; + g_qeglobals.d_bSmallGrid = true; + } else + { + switch (nID) + { + case ID_GRID_1: g_qeglobals.d_gridsize = 0; break; + case ID_GRID_2: g_qeglobals.d_gridsize = 1; break; + case ID_GRID_4: g_qeglobals.d_gridsize = 2; break; + case ID_GRID_8: g_qeglobals.d_gridsize = 3; break; + case ID_GRID_16: g_qeglobals.d_gridsize = 4; break; + case ID_GRID_32: g_qeglobals.d_gridsize = 5; break; + case ID_GRID_64: g_qeglobals.d_gridsize = 6; break; + case ID_GRID_128: g_qeglobals.d_gridsize = 7; break; + case ID_GRID_256: g_qeglobals.d_gridsize = 8; break; + } + g_qeglobals.d_gridsize = 1 << (int)g_qeglobals.d_gridsize; + g_qeglobals.d_bSmallGrid = false; + } + + SetGridStatus(); + + // SnapTToGrid option: need to check everywhere the grid size is changed + // this is a bit clumsy, have to do in OnGrid OnGridPrev and OnGridNext + if (g_PrefsDlg.m_bSnapTToGrid) + DoSnapTToGrid(); + + Sys_UpdateWindows (W_XY|W_Z); +} + +void MainFrame::OnSnaptogrid() +{ + g_PrefsDlg.m_bNoClamp ^= 1; + g_PrefsDlg.SavePrefs (); + + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bNoClamp ? FALSE : TRUE); + g_bIgnoreCommands--; +} + +void MainFrame::OnTexturesShowinuse() +{ + Sys_BeginWait (); + Texture_ShowInuse (); +#ifdef _DEBUG + if (!g_bShowAllShaders) + Sys_Printf("Already showing only in-use textures.\n"); #endif - ; - StringOutputStream path(256); - path << DirectoryCleaned(g_pGameDescription->getRequiredKeyValue(ENGINEPATH_ATTRIBUTE)); - g_strEnginePath = path.c_str(); + Sys_UpdateWindows( W_TEXTURE ); + Sys_EndWait (); +} + +void MainFrame::OnTexturesShowall() +{ + Texture_ShowAll(); +} + +// do some triggering on/off, if the inspector is already up then hide it +void MainFrame::OnTexturesInspector() +{ + ToggleSurface(); +} + +void MainFrame::OnViewNearest(unsigned int nID) +{ + Texture_SetMode(nID); +} + +void MainFrame::OnTextureReplaceall() +{ + FindTextureDialog::show(); +} + +void MainFrame::OnToggleLock() +{ + g_PrefsDlg.m_bTextureLock = !g_PrefsDlg.m_bTextureLock; + + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_toggle_lock")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bTextureLock ? TRUE : FALSE); + g_bIgnoreCommands--; + g_PrefsDlg.SavePrefs (); + SetGridStatus(); +} + +void MainFrame::OnToggleRotatelock() +{ + g_PrefsDlg.m_bRotateLock ^= 1; + + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_toggle_rotatelock")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bRotateLock ? TRUE : FALSE); + g_bIgnoreCommands--; + g_PrefsDlg.SavePrefs (); + SetGridStatus(); +} + +// use a dialog for direct selection of a texture menu +// the API is a bit crappy, we need to set texture_directory to the directory name in /textures/ +void MainFrame::OnTexturesLoad() +{ + char def_path[NAME_MAX]; + + // FIXME + // check if that works with fs_game (I suspect some more design is needed) + // see how this is done in 1.2? + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=507 + strcpy (def_path, g_pGameDescription->mEnginePath.GetBuffer()); + strcat (def_path, g_pGameDescription->mBaseGame.GetBuffer()); + strcat (def_path, "/"); + + char *dir = dir_dialog (m_pWidget, "Load textures from path", def_path); + + if (dir != NULL) + { + // very uncertain task, let's hope the guy pointed to somewhere below the dir we gave him + Sys_Printf("user select: '%s'\n", dir); + // remove a potential trailing slash? + if (dir[strlen(dir)-1]=='/' || dir[strlen(dir)-1]=='\\') + dir[strlen(dir)-1] = '\0'; + char *pouic = MAX(strrchr(dir, '/'),strrchr(dir, '\\')); + if (pouic) + { + strcpy(texture_directory, pouic+1); + Sys_Printf("Loading '%s'\n", texture_directory); + Texture_ShowDirectory(); + } + else + Sys_FPrintf(SYS_WRN, "Failed to extract the directory\n"); + g_free(dir); + } + else + Sys_FPrintf(SYS_WRN, "texture load dialog cancelled\n"); +} + +void MainFrame::OnTexturesReloadshaders() +{ + Sys_BeginWait (); + QERApp_ReloadShaders(); + // current shader + // NOTE: we are kinda making it loop on itself, it will update the pShader and scroll the texture window + Texture_SetTexture (&g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, false, NULL, false); + Sys_UpdateWindows (W_ALL); + Sys_EndWait(); +} + +void MainFrame::OnTexturesShadersShow() +{ + g_PrefsDlg.m_bShowShaders ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_shaders_show")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bShowShaders ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_TEXTURE); +} + +void MainFrame::SetTextureScale(int id) +{ + GtkWidget *item; + + switch (id) + { + case ID_TEXTURES_TEXTUREWINDOWSCALE_10: + g_PrefsDlg.m_nTextureScale = 10; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_texturewindowscale_10")); + break; + case ID_TEXTURES_TEXTUREWINDOWSCALE_25: + g_PrefsDlg.m_nTextureScale = 25; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_texturewindowscale_25")); + break; + case ID_TEXTURES_TEXTUREWINDOWSCALE_50: + g_PrefsDlg.m_nTextureScale = 50; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_texturewindowscale_50")); + break; + case ID_TEXTURES_TEXTUREWINDOWSCALE_200: + g_PrefsDlg.m_nTextureScale = 200; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_texturewindowscale_200")); + break; + default: + g_PrefsDlg.m_nTextureScale = 100; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_textures_texturewindowscale_100")); + break; } - GlobalPreferenceSystem().registerPreference("EnginePath", CopiedStringImportStringCaller(g_strEnginePath), CopiedStringExportStringCaller(g_strEnginePath)); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; - g_Layout_viewStyle.useLatched(); - g_Layout_enableDetachableMenus.useLatched(); - g_Layout_enablePatchToolbar.useLatched(); - g_Layout_enablePluginToolbar.useLatched(); - - Layout_registerPreferencesPage(); - Paths_registerPreferencesPage(); - - g_brushCount.setCountChangedCallback(FreeCaller()); - g_entityCount.setCountChangedCallback(FreeCaller()); - GlobalEntityCreator().setCounter(&g_entityCount); - - GLWidget_sharedContextCreated = GlobalGL_sharedContextCreated; - GLWidget_sharedContextDestroyed = GlobalGL_sharedContextDestroyed; - - GlobalEntityClassManager().attach(g_WorldspawnColourEntityClassObserver); + Texture_ResetPosition(); } -void MainFrame_Destroy() +void MainFrame::OnTexturewindowScaleup() { - GlobalEntityClassManager().detach(g_WorldspawnColourEntityClassObserver); - - GlobalEntityCreator().setCounter(0); - g_entityCount.setCountChangedCallback(Callback()); - g_brushCount.setCountChangedCallback(Callback()); + switch(g_PrefsDlg.m_nTextureScale) { + // 200, all the way in, don't do anything + case 100: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_200); + break; + case 50: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_100); + break; + case 25: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_50); + break; + case 10: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_25); + break; + } } - -void GLWindow_Construct() +void MainFrame::OnTexturewindowScaledown() { - GlobalPreferenceSystem().registerPreference("MouseButtons", IntImportStringCaller(g_glwindow_globals.m_nMouseType), IntExportStringCaller(g_glwindow_globals.m_nMouseType)); + switch(g_PrefsDlg.m_nTextureScale) { + case 200: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_100); + break; + case 100: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_50); + break; + case 50: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_25); + break; + case 25: + SetTextureScale(ID_TEXTURES_TEXTUREWINDOWSCALE_10); + break; + // 10, all the way out, don't do anything + } } -void GLWindow_Destroy() +void MainFrame::OnTexturesLoadlist() { + DoTextureListDlg (); +} + +void MainFrame::OnTexturesShaderlistonly() +{ + g_PrefsDlg.m_bTexturesShaderlistOnly ^= 1; + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget),"menu_textures_shaderlistonly")); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bTexturesShaderlistOnly ? TRUE : FALSE); + g_bIgnoreCommands--; + FillTextureMenu(); +} + +void MainFrame::OnTextureWad(unsigned int nID) +{ + Sys_BeginWait (); + Texture_ShowDirectory (nID); + Sys_UpdateWindows (W_ALL); + Sys_EndWait (); +} + +void MainFrame::OnMiscBenchmark() +{ + m_pCamWnd->BenchMark(); +} + +void MainFrame::OnColorSetoriginal() +{ + for (int i=0 ; i<3 ; i++) + { + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][i] = 0.25f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][i] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR][i] = 0.75f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][i] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][i] = 0.25f; + } + + //djbob + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR_ALT][0] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR_ALT][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR_ALT][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR_ALT][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR_ALT][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR_ALT][2] = 0.0f; + //-djbob + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][0] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][2] = 0.75f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f; + + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorSetqer() +{ + for (int i=0 ; i<3 ; i++) + { + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][i] = 0.25f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][i] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR][i] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][i] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][i] = 0.25f; + } + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][0] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][2] = 0.75f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f; + + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorSetblack() +{ + for (int i=0 ; i<3 ; i++) + { + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][i] = 0.25f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][i] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR][i] = 0.2f; + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][i] = 0.25f; + } + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][0] = 0.3f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][1] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][2] = 0.5f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][1] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][1] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][0] = 0.7f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][1] = 0.7f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f; + + Sys_UpdateWindows (W_ALL); +} + +/* ydnar: to emulate maya/max/lightwave color schemes */ +void MainFrame::OnColorSetydnar() +{ + for (int i=0 ; i<3 ; i++) + { + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][i] = 0.25f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][i] = 0.77f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR][i] = 0.83f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR][i] = 0.89f; + g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][i] = 0.25f; + } + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][1] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER][2] = 1.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][0] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES][2] = 0.0f; + + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][0] = 0.5f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME][2] = 0.75f; + + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][0] = 1.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f; + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f; + + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnTexturebk() +{ + DoColor(COLOR_TEXTUREBACK); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsXybk() +{ + DoColor(COLOR_GRIDBACK); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsMajor() +{ + DoColor(COLOR_GRIDMAJOR); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsMinor() +{ + DoColor(COLOR_GRIDMINOR); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsMajor_Alt() +{ + DoColor(COLOR_GRIDMAJOR_ALT); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsMinor_Alt() +{ + DoColor(COLOR_GRIDMINOR_ALT); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsGridtext() +{ + DoColor(COLOR_GRIDTEXT); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsGridblock() +{ + DoColor(COLOR_GRIDBLOCK); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsCameraBack() +{ + DoColor(COLOR_CAMERABACK); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsBrush() +{ + DoColor(COLOR_BRUSHES); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsSelectedbrush() +{ + DoColor(COLOR_SELBRUSHES); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsSelectedbrush3D() +{ + DoColor(COLOR_SELBRUSHES3D); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsClipper() +{ + DoColor(COLOR_CLIPPER); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnColorsViewname() +{ + DoColor(COLOR_VIEWNAME); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnMiscGamma() +{ + float fSave = g_qeglobals.d_savedinfo.fGamma; + DoGamma(); + if (fSave != g_qeglobals.d_savedinfo.fGamma) + { + gtk_MessageBox(m_pWidget, "You must restart Radiant for Gamma settings to take effect."); + } +} +void MainFrame::OnMiscFindbrush() +{ + DoFind(); +} + +void MainFrame::OnMiscNextleakspot() +{ + Pointfile_Next(); +} + +void MainFrame::OnMiscPreviousleakspot() +{ + Pointfile_Prev(); +} + +void MainFrame::OnMiscPrintxy() +{ +// WXY_Print(); +} + +void MainFrame::OnMiscSelectentitycolor() +{ + if (edit_entity) + { + CString strColor = ValueForKey(edit_entity, "_color"); + if (strColor.GetLength() > 0) + { + float fR, fG, fB; + int n = sscanf(strColor,"%f %f %f", &fR, &fG, &fB); + if (n == 3) + { + g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][0] = fR; + g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][1] = fG; + g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][2] = fB; + } + } + + if (inspector_mode == W_ENTITY && (DoColor(COLOR_ENTITY))) + { + char buffer[100]; + sprintf(buffer, "%f %f %f", g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][0], + g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][1], + g_qeglobals.d_savedinfo.colors[COLOR_ENTITY][2]); + + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntValueField]), buffer); + gtk_entry_set_text (GTK_ENTRY (EntWidgets[EntKeyField]), "_color"); + AddProp(); + //DK - SOF change to get color to entity quickly + //--::SetWindowText( hwndEnt[EntValueField], buffer ); + //--::SetWindowText( hwndEnt[EntKeyField], "color" ); + //--AddProp(); + } + Sys_UpdateWindows( W_ALL ); + } +} + +void MainFrame::OnConvertcurves() +{ +#if 0 + Select_Deselect(); + for (brush_t* pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + if (pb->curveBrush) + { + for (face_t* f = pb->brush_faces ; f ; f=f->next) + { + if (f->texdef.contents & CONTENTS_LADDER) + { + f->texdef.contents &= ~CONTENTS_LADDER; + f->texdef.contents |= CONTENTS_NEGATIVE_CURVE; + } + } + } + } + Map_BuildBrushData(); +#endif +} + +void MainFrame::OnRegionOff() +{ + Map_RegionOff (); +} + +void MainFrame::OnRegionSetxy() +{ + Map_RegionXY (); +} + +void MainFrame::OnRegionSettallbrush() +{ + Map_RegionTallBrush (); +} + +void MainFrame::OnRegionSetbrush() +{ + Map_RegionBrush (); +} + +void MainFrame::OnRegionSetselection() +{ + Map_RegionSelectedBrushes (); +} + +void MainFrame::OnBrush3sided() +{ + Undo_Start("3 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(3); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush4sided() +{ + Undo_Start("4 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(4); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush5sided() +{ + Undo_Start("5 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(5); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush6sided() +{ + Undo_Start("6 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(6); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush7sided() +{ + Undo_Start("7 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(7); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush8sided() +{ + Undo_Start("8 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(8); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrush9sided() +{ + Undo_Start("9 sided"); + Undo_AddBrushList(&selected_brushes); + Brush_MakeSided(9); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushArbitrarysided() +{ + Undo_Start("arbitrary sided"); + Undo_AddBrushList(&selected_brushes); + DoSides(); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushMakecone() +{ + Undo_Start("make cone"); + Undo_AddBrushList(&selected_brushes); + DoSides(true); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnBrushPrimitivesSphere() +{ + Undo_Start("make sphere"); + Undo_AddBrushList(&selected_brushes); + + DoSides(false, true); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchtube() +{ + Undo_Start("make curve cylinder"); + Undo_AddBrushList(&selected_brushes); + Patch_BrushToMesh(false); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchdensetube() +{ + Undo_Start("dense cylinder"); + Undo_AddBrushList(&selected_brushes); + + Patch_BrushToMesh(false); + OnCurveInsertAddrow(); + Sys_UpdateWindows (W_ALL); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchverydensetube() +{ + Undo_Start("very dense cylinder"); + Undo_AddBrushList(&selected_brushes); + + Patch_BrushToMesh(false); + OnCurveInsertAddrow(); + OnCurveInsertInsertrow(); + OnCurveInsertAddrow(); + Sys_UpdateWindows (W_ALL); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchsquare() +{ + Undo_Start("square cylinder"); + Undo_AddBrushList(&selected_brushes); + + Patch_BrushToMesh(false, false, false, true); + Sys_UpdateWindows (W_ALL); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchendcap() +{ + Undo_Start("make end cap"); + Undo_AddBrushList(&selected_brushes); + Patch_BrushToMesh(false, false, true); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchbevel() +{ + Undo_Start("make bevel"); + Undo_AddBrushList(&selected_brushes); + Patch_BrushToMesh(false, true, false); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveMoreendcapsbevelsSquarebevel() +{ + Undo_Start("square bevel"); + Undo_AddBrushList(&selected_brushes); + + Patch_BrushToMesh(false, true, false, true); + Sys_UpdateWindows (W_ALL); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveMoreendcapsbevelsSquareendcap() +{ + Undo_Start("square endcap"); + Undo_AddBrushList(&selected_brushes); + + Patch_BrushToMesh(false, false, true, true); + Sys_UpdateWindows (W_ALL); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurvePatchcone() +{ + Undo_Start("make curve cone"); + Undo_AddBrushList(&selected_brushes); + Patch_BrushToMesh(true); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveSimplepatchmesh() +{ + Undo_Start("make simpe patch mesh"); + Undo_AddBrushList(&selected_brushes); + DoNewPatchDlg (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveInsertInsertcolumn() +{ + Undo_Start("insert (2) columns"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(true, true, false); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveInsertAddcolumn() +{ + Undo_Start("add (2) columns"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(true, true, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveInsertInsertrow() +{ + Undo_Start("insert (2) rows"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(true, false, false); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveInsertAddrow() +{ + Undo_Start("add (2) rows"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(true, false, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeleteFirstcolumn() +{ + Undo_Start("delete first (2) columns"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, true, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeleteLastcolumn() +{ + Undo_Start("delete last (2) columns"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, true, false); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeleteFirstrow() +{ + Undo_Start("delete first (2) rows"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, false, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeleteLastrow() +{ + Undo_Start("delete last (2) rows"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, false, false); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveNegative() +{ + Patch_ToggleInverted(); + //Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnCurveRedisperseRows() +{ + Undo_Start("redisperse rows"); + Undo_AddBrushList(&selected_brushes); + Patch_DisperseRows(); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveRedisperseIntermediateCols() +{ + Undo_Start("redisperse im cols"); + Undo_AddBrushList(&selected_brushes); + Patch_DisperseIntermediateColumns(); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveRedisperseIntermediateRows() +{ + Undo_Start("redisperse im rows"); + Undo_AddBrushList(&selected_brushes); + Patch_DisperseIntermediateRows(); + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveMatrixTranspose() +{ + Patch_Transpose(); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnCurveCap() +{ + Patch_CapCurrent(); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnCurveCyclecap() +{ + Patch_CycleCapSelected(); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnCurveOverlaySet() +{ + Patch_SetOverlays(); + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnCurveOverlayClear() +{ + Patch_ClearOverlays(); + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnCurveThicken() +{ + Undo_Start("curve thicken"); + Undo_AddBrushList(&selected_brushes); + DoThickenDlg (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +/*! +this can no longer be trigger manually from the menu +happens only once at startup +*/ +void MainFrame::OnPluginsRefresh() +{ + CleanPlugInMenu(); + m_PlugInMgr.Init(); +} + +// open the Q3Rad manual +void MainFrame::OnHelp() +{ + // at least on win32, g_strGameToolsPath + "Q3Rad_Manual/index.htm" + Str help; + help = g_strAppPath; + help += "Q3Rad_Manual/index.htm"; + OpenURL(help.GetBuffer()); +} + +// FIXME: we'll go towards a unified help thing soon +void MainFrame::OnHelpLinks() +{ + Str link; + link = g_strAppPath; + link += "links.htm"; + OpenURL(link.GetBuffer()); +} + +void MainFrame::OnHelpBugreport() +{ + OpenURL("http://www.qeradiant.com/faq/fom-serve/cache/138.html"); +} + +void MainFrame::OnHelpCommandlist() +{ + DoCommandListDlg (); +} + +void MainFrame::OnHelpAbout() +{ + DoAbout(); +} + +void MainFrame::OnPopupSelection() +{ + GtkWidget *menu, *item; + char *labels[] = { "Select Complete Tall", "Select Touching", "Select Partial Tall", "Select Inside"}; + int ids[] = { ID_SELECTION_SELECTCOMPLETETALL, ID_SELECTION_SELECTTOUCHING, + ID_SELECTION_SELECTPARTIALTALL, ID_SELECTION_SELECTINSIDE}; + + menu = gtk_menu_new (); + + for (int i = 0; i < 4; i++) + { + item = gtk_menu_item_new_with_label (labels[i]); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (ids[i])); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); + } + + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); +} + +void MainFrame::OnViewChange() +{ + OnViewNextview(); + //HandlePopup(this, IDR_POPUP_VIEW); +} + +void MainFrame::OnTexturesPopup() +{ + gpointer item = g_object_get_data (G_OBJECT (m_pWidget), "render_quality_menu"); + gtk_menu_popup (GTK_MENU (item), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); +} + +void MainFrame::ToggleCamera() +{ + if (m_bCamPreview) + m_bCamPreview = false; + else + m_bCamPreview = true; +} + +void MainFrame::OnViewCameraupdate() +{ + Sys_UpdateWindows(W_CAMERA); +} + +void MainFrame::OnSelectMouserotate() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_select_mouserotate")); + g_bIgnoreCommands++; + + if (ActiveXY()) + { + if (ActiveXY()->ClipMode()) + OnViewClipper(); + if (ActiveXY()->RotateMode()) + { + // SetRotateMode(false) always works + ActiveXY()->SetRotateMode(false); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } else + { + // may not work if no brush selected, see return value + if (ActiveXY()->SetRotateMode(true)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE); + else + // if MFC called, we need to set back to FALSE ourselves + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } + } + g_bIgnoreCommands--; +} + +void MainFrame::OnSelectMousescale() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_select_mousescale")); + g_bIgnoreCommands++; + + if (ActiveXY()) + { + if (ActiveXY()->ClipMode()) + OnViewClipper(); + if (ActiveXY()->RotateMode()) + { + // SetRotateMode(false) always works + ActiveXY()->SetRotateMode(false); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } + if (ActiveXY()->ScaleMode()) + { + ActiveXY()->SetScaleMode(false); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } else + { + ActiveXY()->SetScaleMode(true); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE); + } + } + g_bIgnoreCommands--; +} + +void MainFrame::OnScalelockx() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_scalelockx")); + g_bIgnoreCommands++; + + if (g_nScaleHow & SCALE_X) + { + g_nScaleHow ^= SCALE_X; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } else + { + g_nScaleHow |= SCALE_X; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE); + } + g_bIgnoreCommands--; +} + +void MainFrame::OnScalelocky() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_scalelocky")); + g_bIgnoreCommands++; + + if (g_nScaleHow & SCALE_Y) + { + g_nScaleHow ^= SCALE_Y; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } else + { + g_nScaleHow |= SCALE_Y; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE); + } + g_bIgnoreCommands--; +} + +void MainFrame::OnScalelockz() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_scalelockz")); + g_bIgnoreCommands++; + + if (g_nScaleHow & SCALE_Z) + { + g_nScaleHow ^= SCALE_Z; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), FALSE); + } else + { + g_nScaleHow |= SCALE_Z; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE); + } + g_bIgnoreCommands--; +} + +void MainFrame::OnDontselectcurve() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_dontselectcurve")); + g_bIgnoreCommands++; + g_PrefsDlg.m_bSelectCurves ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bSelectCurves) ? FALSE : TRUE); + g_bIgnoreCommands--; +} + +void MainFrame::OnPatchToggleBox() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_showboundingbox")); + g_bIgnoreCommands++; + g_bPatchShowBounds ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchShowBounds) ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnPatchWireframe() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_wireframe")); + g_bIgnoreCommands++; + g_bPatchWireFrame ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchWireFrame) ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnPatchBend() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_bend")); + g_bIgnoreCommands++; + Patch_BendToggle(); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchBendMode) ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnPatchWeld() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_weld")); + g_bIgnoreCommands++; + g_bPatchWeld ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchWeld) ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnPatchDrilldown() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_patch_drilldown")); + g_bIgnoreCommands++; + g_bPatchDrillDown ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_bPatchDrillDown) ? TRUE : FALSE); + g_bIgnoreCommands--; + Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnShowEntities() +{ + gpointer item = g_object_get_data (G_OBJECT (m_pWidget), "view_entitiesas_menu"); // use pointer to existing menu object + gtk_menu_popup (GTK_MENU (item), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); +} + +void MainFrame::OnDropGroupName() +{ + /* + char* name = DoNameDlg ("Name Selection"); + + if (name != NULL) + { + Select_Name (name); + Sys_UpdateWindows (W_ALL); + free (name); + } + */ +} + +void MainFrame::OnDropGroupNewgroup() +{ + +} + +void MainFrame::OnDropGroupRemove() +{ + /* + Select_AddToGroup("World"); + Sys_UpdateWindows (W_ALL); + */ +} + +// NOTE: it's called OnFaceFit() but we want to process everything here, faces and patches +void MainFrame::OnFaceFit() +{ + SurfaceDlgFitAll(); +} + +void MainFrame::OnDontselectmodel() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_dontselectmodel")); + g_bIgnoreCommands++; + g_PrefsDlg.m_bSelectModels ^= 1; + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bSelectModels) ? FALSE : TRUE); + g_bIgnoreCommands--; +} + +void MainFrame::OnViewTexture() +{ + if (FloatingGroupDialog()) // QE4 style + { + if (inspector_mode == W_TEXTURE) + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + gtk_widget_show (g_qeglobals_gui.d_entity); + } else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode (W_TEXTURE); + } + } +} + +void MainFrame::OnPatchInspector() +{ + TogglePatchInspector(); +} + +void MainFrame::OnCurveNegativeTextureX() +{ + Patch_InvertTexture(false); + //Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnCurveNegativeTextureY() +{ + Patch_InvertTexture(true); + //Sys_UpdateWindows(W_ALL); +} + +void MainFrame::OnCurveInsertcolumn() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("insert colum"); + Undo_AddBrushList(&selected_brushes); + //Patch_AdjustSelectedRowCols(0, 2); + Patch_AdjustSelected(true, true, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveInsertrow() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("insert row"); + Undo_AddBrushList(&selected_brushes); + //Patch_AdjustSelectedRowCols(2, 0); + Patch_AdjustSelected(true, false, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeletecolumn() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("delete column"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, true, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnCurveDeleterow() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("delete row"); + Undo_AddBrushList(&selected_brushes); + Patch_AdjustSelected(false, false, true); + Sys_UpdateWindows(W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnPatchTab() +{ + if (g_bPatchBendMode) + Patch_BendHandleTAB(); +// else if (g_bPatchInsertMode) +// Patch_InsDelHandleTAB(); + else + { + // check to see if the selected brush is part of a func group + // if it is, deselect everything and reselect the next brush + // in the group + brush_t *b2, *b = selected_brushes.next; + entity_t * e; + if (b != &selected_brushes) + { + if (strcmpi(b->owner->eclass->name, "worldspawn") != 0) + { + e = b->owner; + Select_Deselect(); + for (b2 = e->brushes.onext ; b2 != &e->brushes ; b2 = b2->onext) + { + if (b == b2) + { + b2 = b2->onext; + break; + } + } + if (b2 == &e->brushes) + b2 = b2->onext; + + Select_Brush(b2, false); + Sys_UpdateWindows(W_ALL); + } + } + } +} + +void MainFrame::OnCameraForward(bool keydown) +{ + if (g_PrefsDlg.m_bCamDiscrete && (m_pCamWnd && !m_pCamWnd->m_bFreeMove) ) + { + if(keydown) + { + VectorMA (m_pCamWnd->Camera()->origin, SPEED_MOVE, m_pCamWnd->Camera()->forward, m_pCamWnd->Camera()->origin); + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + } + else { + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_FORWARD; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_FORWARD; + } +} + +void MainFrame::OnCameraBack(bool keydown) +{ + if (g_PrefsDlg.m_bCamDiscrete && (m_pCamWnd && !m_pCamWnd->m_bFreeMove) ) + { + if(keydown) + { + VectorMA (m_pCamWnd->Camera()->origin, -SPEED_MOVE, m_pCamWnd->Camera()->forward, m_pCamWnd->Camera()->origin); + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + } + else { + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_BACK; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_BACK; + } +} + +void MainFrame::OnCameraLeft(bool keydown) +{ + if (m_pCamWnd) + { + if (m_pCamWnd->m_bFreeMove) + { + OnCameraStrafeleft(keydown); + return; + } + } + + if (g_PrefsDlg.m_bCamDiscrete) + { + if(keydown) + { + m_pCamWnd->Camera()->angles[1] += SPEED_TURN; + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + } + else { + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_ROTLEFT; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_ROTLEFT; + } +} + +void MainFrame::OnCameraRight(bool keydown) +{ + if (m_pCamWnd) + { + if (m_pCamWnd->m_bFreeMove) + { + OnCameraStraferight(keydown); + return; + } + } + + if (g_PrefsDlg.m_bCamDiscrete) + { + if(keydown) + { + m_pCamWnd->Camera()->angles[1] -= SPEED_TURN; + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + } + else { + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_ROTRIGHT; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_ROTRIGHT; + } +} + +void MainFrame::OnCameraUp() +{ + m_pCamWnd->Camera()->origin[2] += SPEED_MOVE; + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY | W_Z) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); +} + +void MainFrame::OnCameraDown() +{ + m_pCamWnd->Camera()->origin[2] -= SPEED_MOVE; + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY | W_Z) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); +} + +void MainFrame::OnCameraAngleup() +{ + m_pCamWnd->Camera()->angles[0] += SPEED_TURN; + if (m_pCamWnd->Camera()->angles[0] > 85) + m_pCamWnd->Camera()->angles[0] = 85; + Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY); +} + +void MainFrame::OnCameraAngledown() +{ + m_pCamWnd->Camera()->angles[0] -= SPEED_TURN; + if (m_pCamWnd->Camera()->angles[0] < -85) + m_pCamWnd->Camera()->angles[0] = -85; + Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY); +} + +void MainFrame::OnCameraStrafeleft(bool keydown) +{ + // FIXME: as soon as gtk supports proper keyup/down support, remove this bit + if (m_pCamWnd) + { + if (!m_pCamWnd->m_bFreeMove) + { + if(keydown) + { + VectorMA (m_pCamWnd->Camera()->origin, -SPEED_MOVE, m_pCamWnd->Camera()->right, m_pCamWnd->Camera()->origin); + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + return; + } + } + + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_STRAFELEFT; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_STRAFELEFT; +} + +void MainFrame::OnCameraStraferight(bool keydown) +{ + // FIXME: as soon as gtk supports proper keyup/down support, remove this bit + if (m_pCamWnd) + { + if (!m_pCamWnd->m_bFreeMove) + { + if(keydown) + { + VectorMA (m_pCamWnd->Camera()->origin, SPEED_MOVE, m_pCamWnd->Camera()->right, m_pCamWnd->Camera()->origin); + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + } + return; + } + } + + if (keydown) + m_pCamWnd->Camera()->movementflags |= MOVE_STRAFERIGHT; + else + m_pCamWnd->Camera()->movementflags &= ~MOVE_STRAFERIGHT; +} + +void MainFrame::OnGridToggle() +{ + g_qeglobals.d_showgrid = !g_qeglobals.d_showgrid; + Sys_UpdateWindows (W_XY|W_Z); +} + +void MainFrame::OnViewCrosshair() +{ + g_bCrossHairs ^= 1; + Sys_UpdateWindows (W_XY); +} + +void MainFrame::OnSelectionTextureRotateclock() +{ + Select_RotateTexture(abs(g_PrefsDlg.m_nRotation)); +} + +void MainFrame::OnSelectionTextureRotatecounter() +{ + Select_RotateTexture(-abs(g_PrefsDlg.m_nRotation)); +} + +void MainFrame::OnSelectionTextureScaleup() +{ + Select_ScaleTexture(0, g_qeglobals.d_savedinfo.m_SIIncrement.scale[1]); +} + +void MainFrame::OnSelectionTextureScaledown() +{ + Select_ScaleTexture(0, -g_qeglobals.d_savedinfo.m_SIIncrement.scale[1]); +} + +void MainFrame::OnSelectionTextureScaleLeft() +{ + Select_ScaleTexture(-g_qeglobals.d_savedinfo.m_SIIncrement.scale[0],0); +} + +void MainFrame::OnSelectionTextureScaleRight() +{ + Select_ScaleTexture(g_qeglobals.d_savedinfo.m_SIIncrement.scale[0],0); +} + +void MainFrame::OnSelectionTextureShiftleft() +{ + Select_ShiftTexture((int)-g_qeglobals.d_savedinfo.m_SIIncrement.shift[0], 0); +} + +void MainFrame::OnSelectionTextureShiftright() +{ + Select_ShiftTexture((int)g_qeglobals.d_savedinfo.m_SIIncrement.shift[0], 0); +} + +void MainFrame::OnSelectionTextureShiftup() +{ + Select_ShiftTexture(0, (int)g_qeglobals.d_savedinfo.m_SIIncrement.shift[1]); +} + +void MainFrame::OnSelectionTextureShiftdown() +{ + Select_ShiftTexture(0, (int)-g_qeglobals.d_savedinfo.m_SIIncrement.shift[1]); +} + +void MainFrame::OnGridPrev() +{ + GtkWidget *item; + if (g_qeglobals.d_gridsize == 1) + { + g_qeglobals.d_gridsize = 0.5; + g_qeglobals.d_bSmallGrid = true; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_05")); + } else if (g_qeglobals.d_gridsize == 0.5) + { + g_qeglobals.d_gridsize = 0.25; + g_qeglobals.d_bSmallGrid = true; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_025")); + } else if (g_qeglobals.d_gridsize > 1) + { + g_qeglobals.d_gridsize = (int)g_qeglobals.d_gridsize >> 1; + g_qeglobals.d_bSmallGrid = false; + + switch ((int)g_qeglobals.d_gridsize) + { + case 1: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_1")); break; + case 2: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_2")); break; + case 4: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_4")); break; + case 8: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_8")); break; + case 16: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_16")); break; + case 32: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_32")); break; + case 64: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_64")); break; + case 128: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_128")); break; + case 256: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_256")); break; + } + + } else + return; + + // SnapTToGrid option: need to check everywhere the grid size is changed + // this is a bit clumsy, have to do in OnGrid OnGridPrev and OnGridNext + if (g_PrefsDlg.m_bSnapTToGrid) + DoSnapTToGrid(); + + SetGridStatus(); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; + + Sys_UpdateWindows(W_XY | W_Z); +} + +void MainFrame::OnGridNext() +{ + GtkWidget *item; + if (g_qeglobals.d_gridsize == 0.25) + { + g_qeglobals.d_gridsize = 0.5; + g_qeglobals.d_bSmallGrid = true; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_05")); + } else if (g_qeglobals.d_gridsize == 0.5) + { + g_qeglobals.d_gridsize = 1; + g_qeglobals.d_bSmallGrid = false; + item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_1")); + } else if (g_qeglobals.d_gridsize < 256) + { + g_qeglobals.d_gridsize = (int)g_qeglobals.d_gridsize << 1; + g_qeglobals.d_bSmallGrid = false; + + switch ((int)g_qeglobals.d_gridsize) + { + case 1: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_1")); break; + case 2: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_2")); break; + case 4: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_4")); break; + case 8: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_8")); break; + case 16: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_16")); break; + case 32: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_32")); break; + case 64: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_64")); break; + case 128: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_128")); break; + case 256: item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_grid_256")); break; + } + + } else + return; + + // SnapTToGrid option: need to check everywhere the grid size is changed + // this is a bit clumsy, have to do in OnGrid OnGridPrev and OnGridNext + if (g_PrefsDlg.m_bSnapTToGrid) + DoSnapTToGrid(); + + SetGridStatus(); + g_bIgnoreCommands++; + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; + + Sys_UpdateWindows(W_XY | W_Z); +} + +void MainFrame::OnSelectionMovedown() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("move down"); + Undo_AddBrushList(&selected_brushes); + + vec3_t vAmt; + vAmt[0] = vAmt[1] = 0.0; + vAmt[2] = -g_qeglobals.d_gridsize; + Select_Move (vAmt); + Sys_UpdateWindows(W_CAMERA | W_XY | W_Z); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionMoveup() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("move up"); + Undo_AddBrushList(&selected_brushes); + + vec3_t vAmt; + vAmt[0] = vAmt[1] = 0.0; + vAmt[2] = g_qeglobals.d_gridsize; + Select_Move (vAmt); + Sys_UpdateWindows(W_CAMERA | W_XY | W_Z); + + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectionPrint() +{ + for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + Brush_Print(b); +} + +void MainFrame::OnSelectionTogglesizepaint() +{ + g_PrefsDlg.m_bSizePaint = !g_PrefsDlg.m_bSizePaint; + Sys_UpdateWindows(W_XY); +} + +void MainFrame::OnPatchNaturalize() +{ + Patch_NaturalizeSelected(); + Sys_UpdateWindows (W_ALL); +} + +void MainFrame::OnSnapToGrid() +{ + if (&selected_brushes == selected_brushes.next) + return; + Undo_Start("snap selection to grid"); + Undo_AddBrushList(&selected_brushes); + //Select_SnapToGrid(); + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + Patch_SnapToGrid(pb->pPatch); + else + Brush_SnapToGrid(pb); + } + Sys_UpdateWindows (W_ALL); + Undo_EndBrushList(&selected_brushes); + Undo_End(); +} + +void MainFrame::OnSelectAll() +{ + Select_AllOfType(); +} + +void MainFrame::OnSelectionInvert() +{ + Select_Invert(); + Sys_UpdateWindows(W_XY | W_Z | W_CAMERA); +} + + +void PerformFiltering () +{ + brush_t *brush; + + // mattn - this should be removed - otherwise the filters from the + // plugins are wiped away with each update +#if 0 + // spog - deletes old filters list and creates new one when + // g_qeglobals.d_savedinfo.exclude is updated + g_qeglobals.d_savedinfo.filters = FilterListDelete(g_qeglobals.d_savedinfo.filters); + g_qeglobals.d_savedinfo.filters = FilterUpdate(g_qeglobals.d_savedinfo.filters); +#endif + + for ( brush = active_brushes.next; brush != &active_brushes; brush = brush->next ) + brush->bFiltered = FilterBrush( brush ); + + for ( brush = selected_brushes.next; brush != &selected_brushes; brush = brush->next ) + brush->bFiltered = FilterBrush( brush ); +} + +void MainFrame::OnFilterAreaportals() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_areaportals")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_AREAPORTALS) & EXCLUDE_AREAPORTALS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterCaulk() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_caulk")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_CAULK) & EXCLUDE_CAULK) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterClips() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_clips")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_CLIP) & EXCLUDE_CLIP) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterBotClips() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_botclips")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_BOTCLIP) & EXCLUDE_BOTCLIP) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterStructural() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_structural")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_STRUCTURAL) & EXCLUDE_STRUCTURAL) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterDetails() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_details")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_DETAILS) & EXCLUDE_DETAILS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterEntities() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_entities")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_ENT) & EXCLUDE_ENT) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterHintsskips() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_hintsskips")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_HINTSSKIPS) & EXCLUDE_HINTSSKIPS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterLights() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_lights")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_LIGHTS) & EXCLUDE_LIGHTS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterLiquids() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_liquids")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_LIQUIDS) & EXCLUDE_LIQUIDS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterModels() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_models")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_MODELS) & EXCLUDE_MODELS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterPatches() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_patches")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_CURVES) & EXCLUDE_CURVES) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterPaths() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_paths")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_PATHS) & EXCLUDE_PATHS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterClusterportals() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_clusterportals")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_CLUSTERPORTALS) & EXCLUDE_CLUSTERPORTALS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterLightgrid() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_lightgrid")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_LIGHTGRID) & EXCLUDE_LIGHTGRID) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterTranslucent() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_translucent")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_TRANSLUCENT) & EXCLUDE_TRANSLUCENT) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterTriggers() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_triggers")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_TRIGGERS) & EXCLUDE_TRIGGERS) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + +void MainFrame::OnFilterWorld() +{ + GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_filter_world")); + g_bIgnoreCommands++; + if ((g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_WORLD) & EXCLUDE_WORLD) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + else + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), FALSE); + g_bIgnoreCommands--; + PerformFiltering(); + Sys_UpdateWindows (W_XY|W_CAMERA); +} + + + + + + + + +// ============================================================================= +// leo: Unused functions, not called anywhere from the code (need to check) + +void MainFrame::OnViewConsole() +{ + if (FloatingGroupDialog()) // QE4 style + { + if (inspector_mode == W_CONSOLE && CurrentStyle() != MainFrame::eFloating) // are we in console mode already? + { + if (GTK_WIDGET_VISIBLE (g_qeglobals_gui.d_entity)) + widget_delete_hide (g_qeglobals_gui.d_entity); + else + gtk_widget_show (g_qeglobals_gui.d_entity); + } else + { + gtk_widget_show (g_qeglobals_gui.d_entity); + SetInspectorMode(W_CONSOLE); + } + } +} + +void MainFrame::OnCurveFreeze() +{ + Patch_Freeze(); +} + +void MainFrame::OnCurveUnFreeze() +{ + Patch_UnFreeze(false); +} + +void MainFrame::OnCurveUnFreezeAll() +{ + Patch_UnFreeze(true); +} + +void MainFrame::OnSelectReselect() +{ + Select_Reselect(); +} + +void MainFrame::OnSelectionTextureFit() +{ + // TODO: Add your command handler code here +} + +void MainFrame::OnPatchEnter() +{ + +} + +void MainFrame::OnDropGroupAddtoWorld() +{ + /* + Select_AddToGroup("World"); + Sys_UpdateWindows (W_ALL); + */ } diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 5997abd3..23a42642 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,268 +19,891 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_MAINFRAME_H) -#define INCLUDED_MAINFRAME_H +#ifndef _MAINFRAME_H_ +#define _MAINFRAME_H_ -#include "gtkutil/window.h" -#include "gtkutil/idledraw.h" -#include "gtkutil/widget.h" -#include "string/string.h" +#include "xywindow.h" +#include "texwindow.h" +#include "zwindow.h" +#include "camwindow.h" +#include "watchbsp.h" -#include "qerplugin.h" +#include "pluginmanager.h" +#include "plugin.h" -class IPlugIn; -class IToolbarButton; +#include "gtkr_vector.h" -class XYWnd; -class CamWnd; -class ZWnd; +#ifdef __APPLE__ +#define __toascii(c) ((c) & 0x7f) +#endif -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; +const int RAD_SHIFT = 0x01; +const int RAD_ALT = 0x02; +const int RAD_CONTROL = 0x04; +const int RAD_PRESS = 0x08; -const int c_command_status = 0; -const int c_position_status = 1; -const int c_brushcount_status = 2; -const int c_texture_status = 3; -const int c_grid_status = 4; -const int c_count_status = 5; +struct SCommandInfo +{ + char* m_strCommand; + unsigned int m_nKey; + unsigned int m_nModifiers; + unsigned int m_nCommand; + char* m_strMenu; +}; + +struct SKeyInfo +{ + char* m_strName; + unsigned int m_nVKKey; +}; + +#define ID_FILE_NEW 0xE100 +#define ID_FILE_OPEN 0xE101 +#define ID_FILE_SAVE 0xE103 +#define ID_EDIT_UNDO 0xE12B +#define ID_EDIT_REDO 0xE12C +#define ID_HELP 0xE146 +#define ID_FILE_RECENT1 0xE110 +#define ID_FILE_RECENT2 0xE111 +#define ID_FILE_RECENT3 0xE112 +#define ID_FILE_RECENT4 0xE113 + +#define IDC_BTN_FACEFIT 1143 +#define ID_ENTITY_START 22800 +#define ID_ENTITY_END 32000 //leo +//#define ID_ENTITY_END 33500 +#define ID_VIEW_XY 32772 +#define ID_VIEW_SIDE 32773 +#define ID_VIEW_FRONT 32774 +#define ID_CAMERATOGGLE 32775 +#define ID_VIEW_CAMERATOGGLE 32776 +#define ID_BUTTON32777 32777 +#define ID_BUTTON32778 32778 +#define ID_TEXTURES_POPUP 32780 +#define ID_POPUP_SELECTION 32782 +#define ID_VIEW_CHANGE 32783 +#define ID_VIEW_CAMERAUPDATE 32784 +#define ID_VIEW_CLIPPER 32785 +#define ID_PREFS 32786 +#define ID_TOGGLE_LOCK 32787 +#define ID_EDIT_MAPINFO 32788 +#define ID_EDIT_ENTITYINFO 32789 +#define ID_BRUSH_SCRIPTS 32790 +#define ID_VIEW_NEXTVIEW 32791 +#define ID_HELP_COMMANDLIST 32792 +#define ID_FILE_NEWPROJECT 32793 +#define ID_SNAPTOGRID 32795 +#define ID_VIEW_CENTERVIEW 32796 +#define ID_SPLIT_SELECTED 32823 +#define ID_CLIP_SELECTED 32824 +#define ID_FLIP_CLIP 32825 +#define ID_TOGGLEVIEW_YZ 32831 +#define ID_TOGGLEVIEW_XZ 32832 +#define ID_COLORS_GRIDTEXT 32833 +#define ID_COLORS_BRUSH 32834 +#define ID_COLORS_SELECTEDBRUSH 32835 +#define ID_COLORS_CLIPPER 32836 +#define ID_COLORS_GRIDBLOCK 32837 +#define ID_COLORS_VIEWNAME 32838 +#define ID_COLOR_SETORIGINAL 32839 +#define ID_COLOR_SETQER 32840 +#define ID_COLOR_SETBLACK 32841 +#define ID_COLOR_SETYDNAR 37001 /* ydnar */ +#define ID_BYEBYE 32842 +#define ID_SELECT_SCALE 32843 +#define ID_SELECT_MOUSEROTATE 32844 +#define ID_COLORS_SELECTEDBRUSH3D 32845 +#define ID_COLORS_CAMERABACK 32846 +#define ID_TEXTURE_REPLACESELECTED 32859 +#define ID_TEXTURE_REPLACEALL 32860 +#define ID_SELECT_MOUSESCALE 32866 +#define ID_SCALELOCKX 32867 +#define ID_SCALELOCKY 32868 +#define ID_SCALELOCKZ 32869 +#define ID_VIEW_CUBICCLIPPING 32870 +#define ID_FILE_PROJECTSETTINGS 32875 +#define ID_VIEW_CUBEOUT 32876 +#define ID_VIEW_CUBEIN 32877 +#define ID_NODES_LOADNODES 32878 +#define ID_NODES_SHOWNODES 32879 +#define ID_NODES_SHOWLINKS 32880 +#define ID_NODES_REMOVEALLNODES 32881 +#define ID_NODES_COUNTNODES 32882 +#define ID_NODES_GIVEMONEYTONELNO 32883 +#define ID_FILE_SAVEREGION 32887 +#define ID_FILE_LOADREGION 32888 +#define ID_SELECTION_MOVEDOWN 32890 +#define ID_TOOLBAR_MAIN 32891 +#define ID_SELECTION_MOVEUP 32892 +//#define ID_TOOLBAR_TEXTURE 32892 +#define ID_BRUSH_MAKECONE 32896 +#define ID_TEXTURES_LOAD 32897 +#define ID_TOGGLE_ROTATELOCK 32898 +#define ID_FILE_IMPORTMAP 32911 +#define ID_FILE_EXPORTMAP 32912 +#define ID_EDIT_LOADPREFAB 32913 +#define ID_SELECTION_SELECT_NUDGELEFT 32916 +#define ID_SELECTION_SELECT_NUDGERIGHT 32917 +#define ID_SELECTION_SELECT_NUDGEUP 32918 +#define ID_SELECTION_SELECT_NUDGEDOWN 32919 +#define ID_TEXTURES_LOADLIST 32920 +#define ID_DONTSELECTCURVE 32923 +#define ID_CONVERTCURVES 32924 +#define ID_PATCH_SHOWBOUNDINGBOX 32926 +#define ID_CURVE_SIMPLEPATCHMESH 32927 +#define ID_PATCH_WIREFRAME 32928 +#define ID_PATCH_WELD 32929 +#define ID_CURVE_PATCHTUBE 32930 +#define ID_CURVE_PATCHCONE 32931 +#define ID_CURVE_PATCHENDCAP 32932 +#define ID_CURVE_PATCHBEVEL 32933 +#define ID_PATCH_DRILLDOWN 32936 +#define ID_CURVE_LOADPATCHFILE 32937 +#define ID_CURVE_INSERTROW 32938 +#define ID_CURVE_INSERTCOLUMN 32939 +#define ID_CURVE_DELETEROW 32940 +#define ID_CURVE_DELETECOLUMN 32941 +#define ID_BUTTON32942 32942 +//#define ID_PATCH_INSDEL 32942 +#define ID_CURVE_INSERT_ADDCOLUMN 32943 +#define ID_CURVE_INSERT_INSERTCOLUMN 32944 +#define ID_CURVE_INSERT_ADDROW 32945 +#define ID_CURVE_INSERT_INSERTROW 32946 +#define ID_CURVE_DELETE_FIRSTCOLUMN 32947 +#define ID_CURVE_DELETE_LASTCOLUMN 32948 +#define ID_CURVE_DELETE_FIRSTROW 32949 +#define ID_CURVE_DELETE_LASTROW 32950 +#define ID_CURVE_NEGATIVE 32951 +#define ID_PATCH_BEND 32952 +#define ID_CURVE_PATCHDENSETUBE 32955 +#define ID_CURVE_PATCHVERYDENSETUBE 32956 +#define ID_CURVE_CAP 32957 +#define ID_CURVE_REDISPERSE_ROWS 32961 +#define ID_PATCH_NATURALIZE 32963 +#define ID_CURVE_PATCHSQUARE 32964 +#define ID_BRUSH_PRIMITIVES_SPHERE 32965 +#define ID_BRUSH_PRIMITIVES_TORUS 32966 +#define ID_TEXTURES_TEXTUREWINDOWSCALE_200 32967 +#define ID_TEXTURES_TEXTUREWINDOWSCALE_100 32968 +#define ID_TEXTURES_TEXTUREWINDOWSCALE_50 32969 +#define ID_TEXTURES_TEXTUREWINDOWSCALE_25 32970 +#define ID_TEXTURES_TEXTUREWINDOWSCALE_10 32971 +#define ID_CURVE_NEGATIVETEXTUREX 32972 +#define ID_TEXTURES_FLUSH 32973 +#define ID_CURVE_OVERLAY_SET 32974 +#define ID_CURVE_OVERLAY_CLEAR 32975 +#define ID_CURVE_NEGATIVETEXTUREY 32976 +#define ID_CURVE_THICKEN 32977 +#define ID_CURVE_CYCLECAP 32978 +#define ID_CURVE_MATRIX_TRANSPOSE 32981 +#define ID_PLUGINS_REFRESH 32982 +#define ID_TEXTURES_RELOADSHADERS 32983 +#define ID_VIEW_ENTITIESAS_BOUNDINGBOX 32984 +#define ID_VIEW_ENTITIESAS_WRITEFRAME 32985 +#define ID_VIEW_ENTITIESAS_SELECTEDWIREFRAME 32986 +#define ID_VIEW_ENTITIESAS_SELECTEDSKINNED 32987 +#define ID_VIEW_ENTITIESAS_SKINNED 32988 +#define ID_VIEW_ENTITIESAS_SKINNEDANDBOXED 32989 +#define ID_SHOW_ENTITIES 32990 +#define ID_VIEW_ENTITIESAS_WIREFRAME 32991 +#define ID_VIEW_OPENGLLIGHTING 32998 +#define ID_EDIT_SAVEPREFAB 33001 +#define ID_CURVE_MOREENDCAPSBEVELS_SQUAREENDCAP 33002 +#define ID_CURVE_MOREENDCAPSBEVELS_SQUAREBEVEL 33003 +#define ID_CURVE_PRIMITIVES_SPHERE 33005 +#define ID_VIEW_HIDESHOW_HIDESELECTED 33006 +#define ID_VIEW_HIDESHOW_SHOWHIDDEN 33007 +#define ID_TEXTURES_SHADERS_SHOW 33008 +//#define ID_SELECTION_CSGADD 33009 +#define ID_SELECTION_CSGMERGE 33011 +#define ID_TEXTURES_FLUSH_UNUSED 33014 +#define ID_DROP_GROUP_REMOVE 33016 +#define ID_DROP_GROUP_ADDTO_WORLD 33017 +#define ID_DROP_GROUP_NEWGROUP 33018 +#define ID_DROP_GROUP_NAME 33019 +#define ID_DROP_GROUP_ADDTO 33020 +#define ID_VIEW_SHOWANGLES 33021 +#define ID_VIEW_SHOWWORKZONE 33022 +#define ID_TEXTURE_FLUSH 33023 +#define ID_TEXTURES_SHOWSHADERS 33025 +#define ID_DONTSELECTMODEL 33027 +#define ID_TEXTURES_SHADERLISTONLY 33030 +#define ID_PLUGIN_START 33800 +#define ID_PLUGIN_END 33999 +#define ID_FILE_EXIT 40002 +#define ID_FILE_SAVEAS 40004 +#define ID_VIEW_CENTER 40005 +#define ID_VIEW_UPFLOOR 40006 +#define ID_VIEW_DOWNFLOOR 40007 +#define ID_BRUSH_FLIPX 40008 +#define ID_BRUSH_FLIPY 40009 +#define ID_BRUSH_FLIPZ 40010 +#define ID_BRUSH_ROTATEX 40011 +#define ID_BRUSH_ROTATEY 40012 +#define ID_BRUSH_ROTATEZ 40013 +#define ID_BSP_FULLVIS 40016 +#define ID_BSP_FASTVIS 40017 +#define ID_BSP_NOVIS 40018 +#define ID_BSP_RELIGHT 40019 +#define ID_BSP_ENTITIES 40020 +#define ID_FILE_POINTFILE 40021 +#define ID_VIEW_100 40022 +#define ID_VIEW_75 40023 +#define ID_VIEW_50 40024 +#define ID_VIEW_25 40025 +#define ID_VIEW_12 40026 +#define ID_TEXTURES_SHOWALL 40033 +#define ID_TEXTURES_SHOWINUSE 40034 +#define ID_TEXTURES_TOGGLEVIEW 40037 +#define ID_SELECTION_CREATEENTITY 40039 +#define ID_SELECTION_EDITENTITY 40040 +#define ID_MISC_BENCHMARK 40041 +#define ID_REGION_OFF 40043 +#define ID_REGION_SETXY 40044 +#define ID_REGION_SETBRUSH 40045 +#define ID_SELECTION_MAKEHOLLOW 40046 +#define ID_SELECTION_SELECTPARTIALTALL 40047 +#define ID_SELECTION_SELECTCOMPLETETALL 40048 +#define ID_SELECTION_CSGSUBTRACT 40049 +#define ID_SELECTION_SELECTTOUCHING 40050 +#define ID_VIEW_NEAREST 40052 +#define ID_VIEW_NEARESTMIPMAP 40053 +#define ID_VIEW_LINEAR 40054 +#define ID_VIEW_BILINEAR 40055 +#define ID_VIEW_BILINEARMIPMAP 40056 +#define ID_VIEW_TRILINEAR 40057 +#define ID_TEXTURES_WIREFRAME 40058 +#define ID_TEXTURES_FLATSHADE 40059 +#define ID_VIEW_SHOWNAMES 40060 +#define ID_VIEW_ZOOMIN 40061 +#define ID_VIEW_ZOOMOUT 40062 +#define ID_VIEW_SHOWCOORDINATES 40063 +#define ID_VIEW_Z100 40064 +#define ID_VIEW_ZZOOMIN 40065 +#define ID_VIEW_ZZOOMOUT 40066 +#define ID_SELECTION_CLONE 40067 +#define ID_SELECTION_DESELECT 40068 +#define ID_SELECTION_DELETE 40069 +#define ID_BUTTON40068 40070 +#define ID_SELECTION_DRAGVERTECIES 40074 +#define ID_SELECTION_DRAGEDGES 40075 +#define ID_REGION_SETTALLBRUSH 40076 +#define ID_SELECTION_SELECTINSIDE 40092 +#define ID_PROJECT_RELEAD 40094 +#define ID_PROJECT_CHANGE 40095 +#define ID_MISC_GAMMA 40097 +#define ID_MISC_TEXTUREBACKGROUN 40104 +#define ID_TEXTUREBK 40105 +#define ID_COLORS_XYBK 40106 +#define ID_FILE_ABOUT 40107 +#define ID_VIEW_CONSOLE 40108 +#define ID_VIEW_ENTITY 40109 +#define ID_VIEW_TEXTURE 40110 +#define ID_COLORS_MAJOR 40111 +#define ID_COLORS_MINOR 40113 +#define ID_SELECTION_CONNECT 40114 +#define ID_FILE_LOADPROJECT 40115 +#define ID_MISC_FINDBRUSH 40116 +#define ID_MISC_NEXTLEAKSPOT 40117 +#define ID_MISC_PREVIOUSLEAKSPOT 40118 +#define ID_BRUSH_3SIDED 40119 +#define ID_BRUSH_4SIDED 40120 +#define ID_BRUSH_5SIDED 40121 +#define ID_BRUSH_6SIDED 40122 +#define ID_BRUSH_7SIDED 40123 +#define ID_BRUSH_8SIDED 40124 +#define ID_BRUSH_9SIDED 40125 +#define ID_SELECTION_ARBITRARYROTATION 40126 +#define ID_BRUSH_ARBITRARYSIDED 40127 +#define ID_SELECTION_UNGROUPENTITY 40130 +#define ID_MISC_SELECTENTITYCOLOR 40131 +#define ID_MISC_PRINTXY 40132 +#define ID_HELP_ABOUT 40134 +#define ID_EDIT_COPYBRUSH 40135 +#define ID_EDIT_PASTEBRUSH 40136 +#define ID_TEXTURES_INSPECTOR 40137 +#define ID_SELECTION_MAKE_DETAIL 40139 +#define ID_SELECTION_MAKE_STRUCTURAL 40140 +#define ID_REGION_SETSELECTION 40141 +#define ID_VIEW_SHOWBLOCKS 40142 +#define ID_CAMERA_UP 40152 +#define ID_CAMERA_DOWN 40153 +#define ID_CAMERA_LEFT 40154 +#define ID_CAMERA_RIGHT 40155 +#define ID_CAMERA_FORWARD 40156 +#define ID_CAMERA_BACK 40157 +#define ID_CAMERA_ANGLEUP 40158 +#define ID_CAMERA_ANGLEDOWN 40159 +#define ID_CAMERA_STRAFELEFT 40160 +#define ID_CAMERA_STRAFERIGHT 40161 +#define ID_GRID_TOGGLE 40162 +#define ID_ENTITYLIST 40163 +#define ID_MAPINFO 40164 +#define ID_TOGGLECONSOLE 40165 +#define ID_TOGGLECAMERA 40166 +#define ID_TOGGLEZ 40167 +#define ID_TOGGLEVIEW 40168 +#define ID_SELECTION_TEXTURE_FIT 40171 +#define ID_SELECTION_TEXTURE_ROTATECLOCK 40172 +#define ID_SELECTION_TEXTURE_ROTATECOUNTER 40173 +#define ID_SELECTION_TEXTURE_SCALEUP 40174 +#define ID_SELECTION_TEXTURE_SCALEDOWN 40175 +#define ID_SELECTION_TEXTURE_SHIFTLEFT 40176 +#define ID_SELECTION_TEXTURE_SHIFTRIGHT 40177 +#define ID_SELECTION_TEXTURE_SHIFTUP 40178 +#define ID_SELECTION_TEXTURE_SHIFTDOWN 40179 +#define ID_GRID_NEXT 40180 +#define ID_GRID_PREV 40181 +#define ID_SELECTION_TEXTURE_SCALELEFT 40182 +#define ID_SELECTION_TEXTURE_SCALERIGHT 40183 +#define ID_SELECTION_PRINT 40184 +#define ID_SELECTION_TOGGLESIZEPAINT 40185 +#define ID_PATCH_TAB 40186 +#define ID_PATCH_ENTER 40187 +#define ID_SELECT_SNAPTOGRID 40188 +#define ID_PATCH_INSPECTOR 40189 +#define ID_SELECT_ALL 40190 +#define ID_CURVE_FREEZE 40191 +#define ID_CURVE_UNFREEZE 40192 +#define ID_CURVE_UNFREEZEALL 40193 +#define ID_SELECT_RESELECT 40194 +#define ID_FITFACE 40196 +#define ID_VIEW_CROSSHAIR 40197 +#define ID_SELECTION_INVERT 40198 +#define ID_VIEW_GROUPS 40199 +#define ID_FILE_SLEEP 40200 +#define ID_HELP_LINKS 40201 +#define ID_VIEW_SHOWOUTLINE 40202 // TTimo: outline as in colored outline around the window to quickly guess the orientation +#define ID_VIEW_SHOWAXES 40203 +#define ID_SELECTION_NOOUTLINE 40204 // TTimo: outline as in zbuffered outline toggle on camera view (TA Q3Radiant 200f addition) +#define ID_SELECTION_OUTLINESTYLE 40205 // Arnout: cycles through selection styles (extended 'nooutline') +#define ID_SELECTION_SEPERATE 40206 // TTimo: split brushes out of an entity back into worldspawn +#define ID_SELECTION_MERGE 40207 // TTimo: merge brushes from worldspawn into entity +#define ID_HELP_BUGREPORT 40208 + +#define ID_FILTER_WORLD 40209 +#define ID_FILTER_PATCHES 40210 +#define ID_FILTER_DETAILS 40211 +#define ID_FILTER_ENTITIES 40212 +#define ID_FILTER_MODELS 40213 +#define ID_FILTER_HINTSSKIPS 40214 +#define ID_FILTER_CLIPS 40215 +#define ID_FILTER_LIQUIDS 40216 +#define ID_FILTER_TRIGGERS 40217 +#define ID_FILTER_AREAPORTALS 40218 +#define ID_FILTER_TRANSLUCENT 40219 +#define ID_FILTER_CAULK 40220 +#define ID_FILTER_LIGHTS 40221 +#define ID_FILTER_PATHS 40223 +#define ID_FILTER_CLUSTERPORTALS 40224 +#define ID_FILTER_LIGHTGRID 40225 +#define ID_FILTER_STRUCTURAL 40226 +#define ID_FILTER_BOTCLIPS 40227 + +#define ID_CURVE_REDISPERSE_INTERMEDIATE_COLS 40230 +#define ID_CURVE_REDISPERSE_INTERMEDIATE_ROWS 40231 +#define ID_EDIT_PASTEBRUSHTOCAMERA 40232 + +#define ID_COLORS_MINOR_ALT 40230 +#define ID_COLORS_MAJOR_ALT 40231 + +// those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256 +#define ID_GRID_025 40300 +#define ID_GRID_05 40301 +#define ID_GRID_1 40302 +#define ID_GRID_2 40303 +#define ID_GRID_4 40304 +#define ID_GRID_8 40305 +#define ID_GRID_16 40306 +#define ID_GRID_32 40307 +#define ID_GRID_64 40308 +#define ID_GRID_128 40309 +#define ID_GRID_256 40310 + +#define ID_FILE_CHECKUPDATE 40320 + +#define ID_TEXTUREWINDOW_SCALEUP 40321 +#define ID_TEXTUREWINDOW_SCALEDOWN 40322 + +class CSynapseClientRadiant : public CSynapseClient +{ +public: + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + void ImportMap(IDataStream *in, CPtrArray *ents, const char *type); + void ExportMap(CPtrArray *ents, IDataStream *out, const char *type); + + CSynapseClientRadiant() { } + virtual ~CSynapseClientRadiant() { } +}; class MainFrame { public: enum EViewStyle { - eRegular = 0, - eFloating = 1, - eSplit = 2, - eRegularLeft = 3, + eRegular, + eFloating, + eSplit, + eRegularLeft, }; MainFrame(); - ~MainFrame(); + GtkWidget *m_pWidget; - GtkWindow* m_window; + /*! + called to fire up the help links + */ + void handle_help_command(int id); - CopiedString m_command_status; - CopiedString m_position_status; - CopiedString m_brushcount_status; - CopiedString m_texture_status; - CopiedString m_grid_status; -private: +protected: - void Create(); - void SaveWindowInfo(); - void Shutdown(); + /*! + the urls to fire up in the game packs help menus + */ + vector mHelpURLs; - GtkWidget* m_vSplit; - GtkWidget* m_hSplit; - GtkWidget* m_vSplit2; + /*! + scan the .game files for game install packs + look there for help description nodes + build the corresponding menus in Radiant + */ + void create_game_help_menu (GtkWidget *menu, GtkAccelGroup *accel); + /*! + build the menu once the filename is found + */ + void process_xlink (Str &FileName, char *menu_name, const char *base_url, GtkWidget *menu, GtkAccelGroup *accel); + + void Create (); + void create_main_menu (GtkWidget *window, GtkWidget *vbox); + void create_main_toolbar (GtkWidget *window, GtkWidget *vbox); + void create_plugin_toolbar (GtkWidget *window, GtkWidget *vbox); + void create_main_statusbar (GtkWidget *window, GtkWidget *vbox); + GtkWidget *m_pStatusLabel[6]; + GtkWidget *m_pSplits[4]; XYWnd* m_pXYWnd; XYWnd* m_pYZWnd; XYWnd* m_pXZWnd; CamWnd* m_pCamWnd; + TexWnd* m_pTexWnd; ZWnd* m_pZWnd; - XYWnd* m_pActiveXY; + CWatchBSP* m_pWatchBSP; + XYWnd* m_pActiveXY; + bool m_bCamPreview; + CPlugInManager m_PlugInMgr; + int m_nNextPlugInID; + guint m_nTimer; bool m_bSleeping; - GtkWidget *m_pStatusLabel[c_count_status]; + CString m_strStatus[15]; + bool m_bNeedStatusUpdate; - - EViewStyle m_nCurrentStyle; - WindowPositionTracker m_position_tracker; - - IdleDraw m_idleRedrawStatusText; + /*! + synapse server + deals with dynamically loading the modules, initializing them, requesting the APIs + */ + CSynapseServer m_SynapseServer; + /*! + we are also a synapse client in that we provide and require some APIs as well + */ + CSynapseClientRadiant m_SynapseClient; public: - bool IsSleeping() - { - return m_bSleeping; - } - void OnSleep(); - - void SetStatusText(CopiedString& status_text, const char* pText); - void UpdateStatusText(); - void RedrawStatusText(); - typedef MemberCaller RedrawStatusTextCaller; + // BSP window + // trigger network listen + void DoWatchBSP(); + bool IsSleeping () + { return m_bSleeping; } + void UpdatePatchToolbarButtons(); + // Gef: Changed to float for sub-integer grid size + void NudgeSelection(int nDirection, float nAmount); + void SetButtonMenuStates(); void SetGridStatus(); - typedef MemberCaller SetGridStatusCaller; + void RoutineProcessing(); + XYWnd* ActiveXY() { return m_pActiveXY; }; + void UpdateWindows(int nBits); + void SetStatusText(int nPane, const char* pText); + void UpdateStatusText(); + void SetWindowStyle(int nStyle); + virtual ~MainFrame(); + XYWnd* GetXYWnd() {return m_pXYWnd;} + XYWnd* GetXZWnd() {return m_pXZWnd;} + XYWnd* GetYZWnd() {return m_pYZWnd;} + ZWnd* GetZWnd() {return m_pZWnd;} + CamWnd* GetCamWnd() {return m_pCamWnd;} + TexWnd* GetTexWnd() {return m_pTexWnd;} + CWatchBSP *GetWatchBSP() { return m_pWatchBSP; } + void ReleaseContexts (); + void CreateContexts (); - void SetActiveXY(XYWnd* p); - XYWnd* ActiveXY() + void SetActiveXY(XYWnd* p) { - return m_pActiveXY; + if (m_pActiveXY) + m_pActiveXY->SetActive(false); + + m_pActiveXY = p; + + if (m_pActiveXY) + m_pActiveXY->SetActive(true); + }; - XYWnd* GetXYWnd() - { - return m_pXYWnd; - } - XYWnd* GetXZWnd() - { - return m_pXZWnd; - } - XYWnd* GetYZWnd() - { - return m_pYZWnd; - } - ZWnd* GetZWnd() - { - return m_pZWnd; - } - CamWnd* GetCamWnd() - { - return m_pCamWnd; - } - - void ReleaseContexts(); - void CreateContexts(); EViewStyle CurrentStyle() { return m_nCurrentStyle; }; + bool FloatingGroupDialog() { return CurrentStyle() == eFloating || CurrentStyle() == eSplit; }; -}; - -extern MainFrame* g_pParentWnd; - -GtkWindow* MainFrame_getWindow(); - -enum EMouseButtonMode -{ - ETwoButton = 0, - EThreeButton = 1, -}; - -struct glwindow_globals_t -{ - int m_nMouseType; - - glwindow_globals_t() : - m_nMouseType(EThreeButton) - { - } -}; - -void GLWindow_Construct(); -void GLWindow_Destroy(); - -extern glwindow_globals_t g_glwindow_globals; -template -class LatchedValue; -typedef LatchedValue LatchedBool; -extern LatchedBool g_Layout_enableDetachableMenus; - -void deleteSelection(); - - -void Sys_Status(const char* status); - - -void ScreenUpdates_Disable(const char* message, const char* title); -void ScreenUpdates_Enable(); -bool ScreenUpdates_Enabled(); -void ScreenUpdates_process(); - -class ScopeDisableScreenUpdates -{ -public: - ScopeDisableScreenUpdates(const char* message, const char* title) - { - ScreenUpdates_Disable(message, title); - } - ~ScopeDisableScreenUpdates() - { - ScreenUpdates_Enable(); - } -}; - - -void EnginePath_Realise(); -void EnginePath_Unrealise(); - -class ModuleObserver; - -void Radiant_attachEnginePathObserver(ModuleObserver& observer); -void Radiant_detachEnginePathObserver(ModuleObserver& observer); - -void Radiant_attachGameToolsPathObserver(ModuleObserver& observer); -void Radiant_detachGameToolsPathObserver(ModuleObserver& observer); - -extern CopiedString g_strEnginePath; -void EnginePath_verify(); -const char* EnginePath_get(); -const char* QERApp_GetGamePath(); - -extern CopiedString g_strAppPath; -const char* AppPath_get(); - -extern CopiedString g_strSettingsPath; -const char* SettingsPath_get(); - -const char* LocalRcPath_get(void); - -const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath -const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath - -extern CopiedString g_strGameToolsPath; -const char* GameToolsPath_get(); - -void Radiant_Initialise(); -void Radiant_Shutdown(); - -void SaveMapAs(); - - -void XY_UpdateAllWindows(); -void UpdateAllWindows(); - - -void ClipperChangeNotify(); - -void DefaultMode(); - -const char* basegame_get(); -const char* gamename_get(); -void gamename_set(const char* gamename); -void Radiant_attachGameNameObserver(ModuleObserver& observer); -void Radiant_detachGameNameObserver(ModuleObserver& observer); -const char* gamemode_get(); -void gamemode_set(const char* gamemode); -void Radiant_attachGameModeObserver(ModuleObserver& observer); -void Radiant_detachGameModeObserver(ModuleObserver& observer); - - - -void VFS_Construct(); -void VFS_Destroy(); - -void HomePaths_Construct(); -void HomePaths_Destroy(); -void Radiant_attachHomePathsObserver(ModuleObserver& observer); -void Radiant_detachHomePathsObserver(ModuleObserver& observer); - - -void MainFrame_Construct(); -void MainFrame_Destroy(); - - -extern float (*GridStatus_getGridSize)(); -extern int (*GridStatus_getRotateIncrement)(); -extern int (*GridStatus_getFarClipDistance)(); -extern bool (*GridStatus_getTextureLockEnabled)(); -void GridStatus_onTextureLockEnabledChanged(); - -SignalHandlerId XYWindowDestroyed_connect(const SignalHandler& handler); -void XYWindowDestroyed_disconnect(SignalHandlerId id); -MouseEventHandlerId XYWindowMouseDown_connect(const MouseEventHandler& handler); -void XYWindowMouseDown_disconnect(MouseEventHandlerId id); +#ifdef _WIN32 + const GdkRectangle & GetPrimaryMonitorRect( void ) const { return primaryMonitorRect; } + const int GetGDKOffsetX( void ) const { return gdk_offset_x; } + const int GetGDKOffsetY( void ) const { return gdk_offset_y; } #endif + +protected: + bool m_bDoLoop; + bool m_bSplittersOK; + void CreateQEChildren(); + void LoadCommandMap(); + void ShowMenuItemKeyBindings(GtkWidget* window); + +public: + void Copy(); + void Paste(); + void Nudge(int nDim, float fNudge); + CPlugInManager &GetPlugInMgr() {return m_PlugInMgr;}; + CSynapseServer &GetSynapseServer() {return m_SynapseServer;}; + CSynapseClientRadiant &GetSynapseClient() {return m_SynapseClient;}; + void AddPlugInToolbarButton(const IToolbarButton* button); + void AddPlugInMenuItem(IPlugIn* pPlugIn); + void CleanPlugInMenu(); + + // these are public so i can easily reflect messages + // from child windows.. + void OnTimer(); + void OnDelete(); + void OnDestroy(); + void ToggleCamera(); + + void OnFileExit(); + void OnFileLoadproject(); + void OnFileNew(); + void OnFileOpen(); + void OnFilePointfile(); + void OnFileSave(); + void OnFileSaveas(); + void OnFileCheckUpdate(); + void OnView100(); + void OnViewCenter(); + void OnViewConsole(); + void OnViewDownfloor(); + void OnViewEntity(); + void OnViewFront(); + void OnViewShowblocks(); + void OnViewShowclip(); + void OnViewShowcoordinates(); + void OnViewShowOutline(); + void OnViewShowAxes(); + void OnViewShowdetail(); + void OnViewShowent(); + void OnViewShowlights(); + void OnViewShownames(); + void OnViewShowpath(); + void OnViewShowwater(); + void OnViewShowworld(); + void OnViewTexture(); + void OnViewUpfloor(); + void OnViewXy(); + void OnViewZ100(); + void OnViewZoomin(); + void OnViewZoomout(); + void OnViewZzoomin(); + void OnViewZzoomout(); + void OnViewSide(); + void OnTexturesShowinuse(); + void OnTexturesInspector(); + void OnMiscBenchmark(); + void OnMiscFindbrush(); + void OnMiscGamma(); + void OnMiscNextleakspot(); + void OnMiscPreviousleakspot(); + void OnMiscPrintxy(); + void OnMiscSelectentitycolor(); + void OnTexturebk(); + void OnColorsMajor(); + void OnColorsMinor(); + void OnColorsMajor_Alt(); + void OnColorsMinor_Alt(); + void OnColorsXybk(); + void OnBrush3sided(); + void OnBrush4sided(); + void OnBrush5sided(); + void OnBrush6sided(); + void OnBrush7sided(); + void OnBrush8sided(); + void OnBrush9sided(); + void OnBrushArbitrarysided(); + void OnBrushFlipx(); + void OnBrushFlipy(); + void OnBrushFlipz(); + void OnBrushRotatex(); + void OnBrushRotatey(); + void OnBrushRotatez(); + void OnRegionOff(); + void OnRegionSetbrush(); + void OnRegionSetselection(); + void OnRegionSettallbrush(); + void OnRegionSetxy(); + void OnSelectionArbitraryrotation(); + void OnSelectionClone(); + void OnSelectionConnect(); + void OnSelectionCsgsubtract(); + void OnSelectionCsgmerge(); + void OnSelectionNoOutline(); + void OnSelectionOutlineStyle(); + void OnSelectionDelete(); + void OnSelectionDeselect(); + void OnSelectionDragedges(); + void OnSelectionDragvertecies(); + void OnSelectionMakeDetail(); + void OnSelectionMakeStructural(); + void OnSelectionMakehollow(); + void OnSelectionSelectcompletetall(); + void OnSelectionSelectinside(); + void OnSelectionSelectpartialtall(); + void OnSelectionSelecttouching(); + void OnSelectionUngroupentity(); + void OnSelectionMergeentity(); + void OnSelectionGroupworld(); + void OnTexturesPopup(); + void OnPopupSelection(); + void OnViewChange(); + void OnViewCameraupdate(); + void OnHelpAbout(); + void OnHelp(); + void OnHelpLinks(); + void OnHelpBugreport(); + void OnViewClipper(); + void OnCameraAngledown(); + void OnCameraAngleup(); + void OnCameraBack(bool keydown); + void OnCameraDown(); + void OnCameraForward(bool keydown); + void OnCameraLeft(bool keydown); + void OnCameraRight(bool keydown); + void OnCameraStrafeleft(bool keydown); + void OnCameraStraferight(bool keydown); + void OnCameraUp(); + void OnGridToggle(); + void OnPrefs(); + void OnTogglecamera(); + void OnToggleconsole(); + void OnToggleview(); + void OnTogglez(); + void OnToggleLock(); + void OnEditMapinfo(); + void OnEditEntityinfo(); + void OnBrushScripts(); + void OnViewCenterview(); + void OnViewNextview(); + void OnHelpCommandlist(); + void OnFileNewproject(); + void OnFlipClip(); + void OnClipSelected(); + void OnSplitSelected(); + void OnToggleviewXz(); + void OnToggleviewYz(); + void OnColorsBrush(); + void OnColorsClipper(); + void OnColorsGridtext(); + void OnColorsSelectedbrush(); + void OnColorsSelectedbrush3D(); + void OnColorsCameraBack(); + void OnColorsGridblock(); + void OnColorsViewname(); + void OnColorSetoriginal(); + void OnColorSetqer(); + void OnColorSetblack(); + void OnColorSetydnar(); /* ydnar */ + void OnSnaptogrid(); + void OnSelectScale(); + void OnSelectMouserotate(); + void OnEditCopybrush(); + void OnEditPastebrush(); + void OnEditPastebrushToCamera(); + void OnEditUndo(); + void OnEditRedo(); + void OnSelectionInvert(); +// void OnSelectionTextureDec(); + void OnSelectionTextureFit(); +// void OnSelectionTextureInc(); + void OnSelectionTextureRotateclock(); + void OnSelectionTextureRotatecounter(); + void OnSelectionTextureScaledown(); + void OnSelectionTextureScaleup(); + void OnSelectionTextureShiftdown(); + void OnSelectionTextureShiftleft(); + void OnSelectionTextureShiftright(); + void OnSelectionTextureShiftup(); + void OnGridNext(); + void OnGridPrev(); + void OnSelectionTextureScaleLeft(); + void OnSelectionTextureScaleRight(); + void OnTextureReplaceall(); + void OnScalelockx(); + void OnScalelocky(); + void OnScalelockz(); + void OnSelectMousescale(); + void OnViewCubicclipping(); + void OnFileProjectsettings(); + void OnViewCubein(); + void OnViewCubeout(); + void OnFileSaveregion(); + void OnSelectionMovedown(); + void OnSelectionMoveup(); + void OnToolbarMain(); + void OnToolbarTexture(); + void OnSelectionPrint(); + void OnSelectionTogglesizepaint(); + void OnBrushMakecone(); + void OnTexturesLoad(); + void OnToggleRotatelock(); + void OnFileImportmap(); + void OnFileExportmap(); + void OnEditLoadprefab(); + void OnSelectionSelectNudgedown(); + void OnSelectionSelectNudgeleft(); + void OnSelectionSelectNudgeright(); + void OnSelectionSelectNudgeup(); + void OnTexturesLoadlist(); + void OnDontselectcurve(); + void OnConvertcurves(); + void OnCurveSimplepatchmesh(); + void OnPatchToggleBox(); + void OnPatchWireframe(); + void OnCurvePatchcone(); + void OnCurvePatchtube(); + void OnPatchWeld(); + void OnCurvePatchbevel(); + void OnCurvePatchendcap(); + void OnPatchDrilldown(); + void OnCurveInsertcolumn(); + void OnCurveInsertrow(); + void OnCurveDeletecolumn(); + void OnCurveDeleterow(); + void OnCurveInsertAddcolumn(); + void OnCurveInsertAddrow(); + void OnCurveInsertInsertcolumn(); + void OnCurveInsertInsertrow(); + void OnCurveNegative(); + void OnCurveNegativeTextureX(); + void OnCurveNegativeTextureY(); + void OnCurveDeleteFirstcolumn(); + void OnCurveDeleteFirstrow(); + void OnCurveDeleteLastcolumn(); + void OnCurveDeleteLastrow(); + void OnPatchBend(); +// void OnPatchInsdel(); + void OnPatchEnter(); + void OnPatchTab(); + void OnCurvePatchdensetube(); + void OnCurvePatchverydensetube(); + void OnCurveCap(); + void OnCurveCapInvertedbevel(); + void OnCurveCapInvertedendcap(); + void OnCurveRedisperseRows(); + void OnCurveRedisperseIntermediateCols(); + void OnCurveRedisperseIntermediateRows(); + void OnPatchNaturalize(); + void OnSnapToGrid(); + void OnCurvePatchsquare(); + void OnTexturewindowScaleup(); + void OnTexturewindowScaledown(); + void OnCurveOverlayClear(); + void OnCurveOverlaySet(); + void OnCurveThicken(); + void OnCurveCyclecap(); + void OnCurveMatrixTranspose(); + void OnTexturesReloadshaders(); + void OnShowEntities(); + // will set the view mode right, don't set the value for mode if you only want to update the radio item + void OnEntitiesSetViewAs(int mode = 0); + void OnPluginsRefresh(); + void OnTexturesShowall(); + void OnPatchInspector(); + void OnViewOpengllighting(); + void OnSelectAll(); + void OnCurveFreeze(); + void OnCurveUnFreeze(); + void OnCurveUnFreezeAll(); + void OnSelectReselect(); + void OnEditSaveprefab(); + void OnCurveMoreendcapsbevelsSquarebevel(); + void OnCurveMoreendcapsbevelsSquareendcap(); + void OnBrushPrimitivesSphere(); + void OnViewCrosshair(); + void OnViewHideshowHideselected(); + void OnViewHideshowShowhidden(); + void OnTexturesShadersShow(); + void OnViewGroups(); + void OnDropGroupAddtoWorld(); + void OnDropGroupName(); + void OnDropGroupNewgroup(); + void OnDropGroupRemove(); + void OnViewShowWorkzone(); + void OnViewShowAngles(); + void OnMru(unsigned int nID); + void OnViewNearest(unsigned int nID); + void OnTextureWad(unsigned int nID); + void OnBspCommand(unsigned int nID); + void OnGrid(unsigned int nID); + void OnPlugIn(unsigned int nID, char *str); + void OnFaceFit(); + void SetTextureScale(int id); + void OnDontselectmodel(); + void OnTexturesShaderlistonly(); + void OnSleep(); + void OnFilterAreaportals(); + void OnFilterCaulk(); + void OnFilterStructural(); + void OnFilterClips(); + void OnFilterBotClips(); + void OnFilterDetails(); + void OnFilterEntities(); + void OnFilterHintsskips(); + void OnFilterLights(); + void OnFilterLiquids(); + void OnFilterModels(); + void OnFilterPatches(); + void OnFilterTranslucent(); + void OnFilterTriggers(); + void OnFilterWorld(); + void OnFilterPaths(); + void OnFilterClusterportals(); + void OnFilterLightgrid(); + +private: + EViewStyle m_nCurrentStyle; + +#ifdef _WIN32 + GdkRectangle primaryMonitorRect; + int gdk_offset_x; + int gdk_offset_y; +#endif + +}; + +// some C API to the mainframe functions +void WINAPI QERApp_Sleep(); + +#endif // _MAINFRAME_H_ diff --git a/radiant/map.cpp b/radiant/map.cpp index 91fb5c51..59290f2a 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,432 +19,134 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "map.h" - -#include "debugging/debugging.h" - -#include "imap.h" -#include "iselection.h" -#include "iundo.h" -#include "ibrush.h" -#include "ifilter.h" -#include "ireference.h" -#include "ifiletypes.h" -#include "ieclass.h" -#include "irender.h" -#include "ientity.h" -#include "editable.h" -#include "ifilesystem.h" -#include "namespace.h" -#include "moduleobserver.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "scenelib.h" -#include "transformlib.h" -#include "selectionlib.h" -#include "instancelib.h" -#include "traverselib.h" -#include "maplib.h" -#include "eclasslib.h" -#include "cmdlib.h" -#include "stream/textfilestream.h" -#include "os/path.h" -#include "uniquenames.h" -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" -#include "stream/stringstream.h" -#include "signal/signal.h" - -#include "gtkutil/filechooser.h" -#include "timer.h" -#include "select.h" -#include "plugin.h" -#include "filetypes.h" -#include "gtkdlgs.h" -#include "entityinspector.h" -#include "points.h" -#include "qe3.h" -#include "camwindow.h" -#include "xywindow.h" -#include "mainframe.h" +#include "stdafx.h" +#include +#if defined (__linux__) || defined (__APPLE__) +#include +#endif #include "preferences.h" -#include "referencecache.h" -#include "mru.h" -#include "commands.h" -#include "autosave.h" +#include "mainframe.h" +#include "gtkmisc.h" +#include "filters.h" -class NameObserver +extern MainFrame* g_pParentWnd; + +int modified; // for quit confirmation (0 = clean, 1 = unsaved, + // 2 = autosaved, but not regular saved) + +char currentmap[1024]; + +brush_t active_brushes; // brushes currently being displayed +brush_t selected_brushes; // highlighted + +face_t *selected_face; +brush_t *selected_face_brush; + +brush_t filtered_brushes; // brushes that have been filtered or regioned + +entity_t entities; // head/tail of doubly linked list + +entity_t *world_entity = NULL; // "classname" "worldspawn" ! + +void Map_Init() { - UniqueNames& m_names; - CopiedString m_name; - - void construct() - { - if(!empty()) - { - //globalOutputStream() << "construct " << makeQuoted(c_str()) << "\n"; - m_names.insert(name_read(c_str())); - } - } - void destroy() - { - if(!empty()) - { - //globalOutputStream() << "destroy " << makeQuoted(c_str()) << "\n"; - m_names.erase(name_read(c_str())); - } - } - - NameObserver& operator=(const NameObserver& other); -public: - NameObserver(UniqueNames& names) : m_names(names) - { - construct(); - } - NameObserver(const NameObserver& other) : m_names(other.m_names), m_name(other.m_name) - { - construct(); - } - ~NameObserver() - { - destroy(); - } - bool empty() const - { - return string_empty(c_str()); - } - const char* c_str() const - { - return m_name.c_str(); - } - void nameChanged(const char* name) - { - destroy(); - m_name = name; - construct(); - } - typedef MemberCaller1 NameChangedCaller; -}; - -class BasicNamespace : public Namespace -{ - typedef std::map Names; - Names m_names; - UniqueNames m_uniqueNames; -public: - ~BasicNamespace() - { - ASSERT_MESSAGE(m_names.empty(), "namespace: names still registered at shutdown"); - } - void attach(const NameCallback& setName, const NameCallbackCallback& attachObserver) - { - std::pair result = m_names.insert(Names::value_type(setName, m_uniqueNames)); - ASSERT_MESSAGE(result.second, "cannot attach name"); - attachObserver(NameObserver::NameChangedCaller((*result.first).second)); - //globalOutputStream() << "attach: " << reinterpret_cast(setName) << "\n"; - } - void detach(const NameCallback& setName, const NameCallbackCallback& detachObserver) - { - Names::iterator i = m_names.find(setName); - ASSERT_MESSAGE(i != m_names.end(), "cannot detach name"); - //globalOutputStream() << "detach: " << reinterpret_cast(setName) << "\n"; - detachObserver(NameObserver::NameChangedCaller((*i).second)); - m_names.erase(i); - } - - void makeUnique(const char* name, const NameCallback& setName) const - { - char buffer[1024]; - name_write(buffer, m_uniqueNames.make_unique(name_read(name))); - setName(buffer); - } - - void mergeNames(const BasicNamespace& other) const - { - typedef std::list SetNameCallbacks; - typedef std::map NameGroups; - NameGroups groups; - - UniqueNames uniqueNames(other.m_uniqueNames); - - for(Names::const_iterator i = m_names.begin(); i != m_names.end(); ++i) - { - groups[(*i).second.c_str()].push_back((*i).first); - } - - for(NameGroups::iterator i = groups.begin(); i != groups.end(); ++i) - { - name_t uniqueName(uniqueNames.make_unique(name_read((*i).first.c_str()))); - uniqueNames.insert(uniqueName); - - char buffer[1024]; - name_write(buffer, uniqueName); - - //globalOutputStream() << "renaming " << makeQuoted((*i).first.c_str()) << " to " << makeQuoted(buffer) << "\n"; - - SetNameCallbacks& setNameCallbacks = (*i).second; - - for(SetNameCallbacks::const_iterator j = setNameCallbacks.begin(); j != setNameCallbacks.end(); ++j) - { - (*j)(buffer); - } - } - } -}; - -BasicNamespace g_defaultNamespace; -BasicNamespace g_cloneNamespace; - -class NamespaceAPI -{ - Namespace* m_namespace; -public: - typedef Namespace Type; - STRING_CONSTANT(Name, "*"); - - NamespaceAPI() - { - m_namespace = &g_defaultNamespace; - } - Namespace* getTable() - { - return m_namespace; - } -}; - -typedef SingletonModule NamespaceModule; -typedef Static StaticNamespaceModule; -StaticRegisterModule staticRegisterDefaultNamespace(StaticNamespaceModule::instance()); - - -std::list g_cloned; - -inline Namespaced* Node_getNamespaced(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -void Node_gatherNamespaced(scene::Node& node) -{ - Namespaced* namespaced = Node_getNamespaced(node); - if(namespaced != 0) - { - g_cloned.push_back(namespaced); - } -} - -class GatherNamespaced : public scene::Traversable::Walker -{ -public: - bool pre(scene::Node& node) const - { - Node_gatherNamespaced(node); - return true; - } -}; - -void Map_gatherNamespaced(scene::Node& root) -{ - Node_traverseSubgraph(root, GatherNamespaced()); -} - -void Map_mergeClonedNames() -{ - for(std::list::const_iterator i = g_cloned.begin(); i != g_cloned.end(); ++i) - { - (*i)->setNamespace(g_cloneNamespace); - } - g_cloneNamespace.mergeNames(g_defaultNamespace); - for(std::list::const_iterator i = g_cloned.begin(); i != g_cloned.end(); ++i) - { - (*i)->setNamespace(g_defaultNamespace); - } - - g_cloned.clear(); -} - -class WorldNode -{ - scene::Node* m_node; -public: - WorldNode() - : m_node(0) - { - } - void set(scene::Node* node) - { - if(m_node != 0) - m_node->DecRef(); - m_node = node; - if(m_node != 0) - m_node->IncRef(); - } - scene::Node* get() const - { - return m_node; - } -}; - -class Map; -void Map_SetValid(Map& map, bool valid); -void Map_UpdateTitle(const Map& map); -void Map_SetWorldspawn(Map& map, scene::Node* node); - - -class Map : public ModuleObserver -{ -public: - CopiedString m_name; - Resource* m_resource; - bool m_valid; - - bool m_modified; - void (*m_modified_changed)(const Map&); - - Signal0 m_mapValidCallbacks; - - WorldNode m_world_node; // "classname" "worldspawn" ! - - Map() : m_resource(0), m_valid(false), m_modified_changed(Map_UpdateTitle) - { - } - - void realise() - { - if(m_resource != 0) - { - if(Map_Unnamed(*this)) - { - g_map.m_resource->setNode(NewMapRoot("").get_pointer()); - MapFile* map = Node_getMapFile(*g_map.m_resource->getNode()); - if(map != 0) - { - map->save(); - } - } - else - { - m_resource->load(); - } - - GlobalSceneGraph().insert_root(*m_resource->getNode()); - - AutoSave_clear(); - - Map_SetValid(g_map, true); - } - } - void unrealise() - { - if(m_resource != 0) - { - Map_SetValid(g_map, false); - Map_SetWorldspawn(g_map, 0); - - - GlobalUndoSystem().clear(); - - GlobalSceneGraph().erase_root(); - } - } -}; - -Map g_map; -Map* g_currentMap = 0; - -void Map_addValidCallback(Map& map, const SignalHandler& handler) -{ - map.m_mapValidCallbacks.connectLast(handler); -} - -bool Map_Valid(const Map& map) -{ - return map.m_valid; -} - -void Map_SetValid(Map& map, bool valid) -{ - map.m_valid = valid; - map.m_mapValidCallbacks(); + Map_Free(); } -const char* Map_Name(const Map& map) -{ - return map.m_name.c_str(); -} - -bool Map_Unnamed(const Map& map) -{ - return string_equal(Map_Name(map), "unnamed.map"); -} - -inline const MapFormat& MapFormat_forFile(const char* filename) -{ - const char* moduleName = findModuleName(GetFileTypeRegistry(), MapFormat::Name(), path_get_extension(filename)); - MapFormat* format = Radiant_getMapModules().findModule(moduleName); - ASSERT_MESSAGE(format != 0, "map format not found for file " << makeQuoted(filename)); - return *format; -} - -const MapFormat& Map_getFormat(const Map& map) -{ - return MapFormat_forFile(Map_Name(map)); -} - - -bool Map_Modified(const Map& map) -{ - return map.m_modified; -} - -void Map_SetModified(Map& map, bool modified) -{ - if(map.m_modified ^ modified) - { - map.m_modified = modified; - - map.m_modified_changed(map); - } -} - -void Map_UpdateTitle(const Map& map) -{ - Sys_SetTitle(map.m_name.c_str(), Map_Modified(map)); -} - - - -scene::Node* Map_GetWorldspawn(const Map& map) -{ - return map.m_world_node.get(); -} - -void Map_SetWorldspawn(Map& map, scene::Node* node) -{ - map.m_world_node.set(node); -} - +bool g_bCancel_Map_LoadFile; // Hydra: moved this here // TTimo // need that in a variable, will have to tweak depending on the game -float g_MaxWorldCoord = 64*1024; -float g_MinWorldCoord = -64*1024; +int g_MaxWorldCoord = 64*1024; +int g_MinWorldCoord = -64*1024; + +// the max size we allow on brushes, this is dependant on world coords too +// makes more sense to say smaller I think? +int g_MaxBrushSize = (g_MaxWorldCoord-1)*2; void AddRegionBrushes (void); void RemoveRegionBrushes (void); +/* +============================================================= + + Cross map selection saving + + this could fuck up if you have only part of a complex entity selected... +============================================================= +*/ + +brush_t between_brushes; +entity_t between_entities; + +bool g_bRestoreBetween = false; + +void Map_SaveBetween (void) +{ + if (g_pParentWnd->ActiveXY()) + { + g_bRestoreBetween = true; + g_pParentWnd->ActiveXY()->Copy(); + } + return; +} + +void Map_RestoreBetween (void) +{ + if (g_pParentWnd->ActiveXY() && g_bRestoreBetween) + g_pParentWnd->ActiveXY()->Paste(); +} + +//============================================================================ + +bool CheckForTinyBrush(brush_t* b, int n, float fSize) +{ + bool bTiny = false; + for (int i=0 ; i<3 ; i++) + { + if (b->maxs[i] - b->mins[i] < fSize) + bTiny = true; + } + if (bTiny) + Sys_Printf("Possible problem brush (too small) #%i ", n); + return bTiny; +} + +void Map_BuildBrushData(void) +{ + brush_t *b, *next; + + if (active_brushes.next == NULL) + return; + + Sys_BeginWait (); // this could take a while + + int n = 0; + for (b=active_brushes.next ; b != NULL && b != &active_brushes ; b=next) + { + next = b->next; + Brush_Build( b, true, false, false ); + if (!b->brush_faces || (g_PrefsDlg.m_bCleanTiny && CheckForTinyBrush(b, n++, g_PrefsDlg.m_fTinySize))) + { + Brush_Free (b); + Sys_Printf ("Removed degenerate brush\n"); + } + } + Sys_EndWait(); +} + +entity_t *Map_FindClass (char *cname) +{ + entity_t *ent; + + for (ent = entities.next ; ent != &entities ; ent=ent->next) + { + if (!strcmp(cname, ValueForKey (ent, "classname"))) + return ent; + } + return NULL; +} /* ================ @@ -452,875 +154,690 @@ Map_Free free all map elements, reinitialize the structures that depend on them ================ */ -void Map_Free() +void Map_Free (void) { - Pointfile_Clear(); + g_bRestoreBetween = false; + if (selected_brushes.next && + (selected_brushes.next != &selected_brushes)) + { + if (gtk_MessageBox (g_pParentWnd->m_pWidget, "Copy selection?", " ", MB_YESNO) == IDYES) + Map_SaveBetween (); + } - g_map.m_resource->detach(g_map); - GlobalReferenceCache().release(g_map.m_name.c_str()); - g_map.m_resource = 0; + QERApp_ActiveShaders_SetInUse( false ); + Pointfile_Clear (); + g_qeglobals.d_num_entities = 0; - FlushReferences(); + if (!active_brushes.next) + { + // first map + active_brushes.prev = active_brushes.next = &active_brushes; + selected_brushes.prev = selected_brushes.next = &selected_brushes; + filtered_brushes.prev = filtered_brushes.next = &filtered_brushes; + entities.prev = entities.next = &entities; + } + else + { + // free selected faces array + g_ptrSelectedFaces.RemoveAll(); + g_ptrSelectedFaceBrushes.RemoveAll(); + while (active_brushes.next != &active_brushes) + Brush_Free (active_brushes.next); + while (selected_brushes.next != &selected_brushes) + Brush_Free (selected_brushes.next); + while (filtered_brushes.next != &filtered_brushes) + Brush_Free (filtered_brushes.next); + while (entities.next != &entities) + Entity_Free (entities.next); + } - g_currentMap = 0; + if (world_entity) + Entity_Free(world_entity); + world_entity = NULL; } -class EntityFindByClassname : public scene::Graph::Walker +entity_t *AngledEntity() { - const char* m_name; - Entity*& m_entity; -public: - EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity) + entity_t *ent = Map_FindClass ("info_player_start"); + if (!ent) { - m_entity = 0; + ent = Map_FindClass ("info_player_deathmatch"); } - bool pre(const scene::Path& path, scene::Instance& instance) const + if (!ent) { - if(m_entity == 0) - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && string_equal(m_name, entity->getKeyValue("classname"))) - { - m_entity = entity; - } - } - return true; + ent = Map_FindClass ("info_player_deathmatch"); } -}; - -Entity* Scene_FindEntityByClass(const char* name) -{ - Entity* entity; - GlobalSceneGraph().traverse(EntityFindByClassname(name, entity)); - return entity; -} - -Entity *Scene_FindPlayerStart() -{ - typedef const char* StaticString; - StaticString strings[] = { - "info_player_start", - "info_player_deathmatch", - "team_CTF_redplayer", - "team_CTF_blueplayer", - "team_CTF_redspawn", - "team_CTF_bluespawn", - }; - typedef const StaticString* StaticStringIterator; - for(StaticStringIterator i = strings, end = strings+(sizeof(strings)/sizeof(StaticString)); i != end; ++i) + if (!ent) { - Entity* entity = Scene_FindEntityByClass(*i); - if(entity != 0) - { - return entity; - } + ent = Map_FindClass ("team_CTF_redplayer"); } - return 0; + if (!ent) + { + ent = Map_FindClass ("team_CTF_blueplayer"); + } + if (!ent) + { + ent = Map_FindClass ("team_CTF_redspawn"); + } + if (!ent) + { + ent = Map_FindClass ("team_CTF_bluespawn"); + } + return ent; } // // move the view to a start position // - - -void FocusViews(const Vector3& point, float angle) -{ - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - Camera_setOrigin(camwnd, point); - Vector3 angles(Camera_getAngles(camwnd)); - angles[CAMERA_PITCH] = 0; - angles[CAMERA_YAW] = angle; - Camera_setAngles(camwnd, angles); - - XYWnd* xywnd = g_pParentWnd->GetXYWnd(); - xywnd->SetOrigin(point); -} - -#include "stringio.h" - void Map_StartPosition() { - Entity* entity = Scene_FindPlayerStart(); + entity_t *ent = AngledEntity(); - if (entity) + g_pParentWnd->GetCamWnd()->Camera()->angles[PITCH] = 0; + if (ent) { - Vector3 origin; - string_parse_vector3(entity->getKeyValue("origin"), origin); - FocusViews(origin, string_read_float(entity->getKeyValue("angle"))); + GetVectorForKey (ent, "origin", g_pParentWnd->GetCamWnd()->Camera()->origin); + GetVectorForKey (ent, "origin", g_pParentWnd->GetXYWnd()->GetOrigin()); + g_pParentWnd->GetCamWnd()->Camera()->angles[YAW] = FloatForKey (ent, "angle"); } else { - FocusViews(g_vector3_identity, 0); + g_pParentWnd->GetCamWnd()->Camera()->angles[YAW] = 0; + VectorCopy (vec3_origin, g_pParentWnd->GetCamWnd()->Camera()->origin); + VectorCopy (vec3_origin, g_pParentWnd->GetXYWnd()->GetOrigin()); } } - -inline bool node_is_worldspawn(scene::Node& node) +void Map_FreeEntities(CPtrArray *ents) { - Entity* entity = Node_getEntity(node); - return entity != 0 && string_equal(entity->getKeyValue("classname"), "worldspawn"); + int i, j, num_ents, num_brushes; + entity_t* e; + CPtrArray* brushes; + + num_ents = ents->GetSize(); + for(i=0; iGetAt(i); + brushes = (CPtrArray*)e->pData; + num_brushes = brushes->GetSize(); + for(j=0; jGetAt(j)); + brushes->RemoveAll(); + delete (CPtrArray*)e->pData; + e->pData = NULL; + Entity_Free(e); + } + ents->RemoveAll(); } - -// use first worldspawn -class entity_updateworldspawn : public scene::Traversable::Walker +/*!\todo Possibly make the import Undo-friendly by calling Undo_End for new brushes and ents */ +void Map_ImportEntities(CPtrArray *ents, bool bAddSelected = false) { -public: - bool pre(scene::Node& node) const + int num_ents, num_brushes; + CPtrArray *brushes; + vec3_t mins, maxs; + entity_t *e; + brush_t *b; + face_t *f; + int i,j; + + GPtrArray *new_ents = g_ptr_array_new(); + + g_qeglobals.bPrimitBrushes = false; + + brush_t *pBrushList = (bAddSelected) ? &selected_brushes : &active_brushes; + + bool bDoneBPCheck = false; + g_qeglobals.bNeedConvert = false; + // HACK: find out if this map file was a BP one + // check the first brush in the file that is NOT a patch + // this will not be necessary when we allow both formats in the same file + num_ents = ents->GetSize(); + for(i=0; !bDoneBPCheck && iGetAt(i); + brushes = (CPtrArray*)e->pData; + num_brushes = brushes->GetSize(); + for(j=0; !bDoneBPCheck && jGetAt(j); + if(b->patchBrush) continue; + bDoneBPCheck = true; + int BP_param = -1; + if(b->bBrushDef && !g_qeglobals.m_bBrushPrimitMode) + BP_param = 0; + else if(!b->bBrushDef && g_qeglobals.m_bBrushPrimitMode) + BP_param = 1; + + if(BP_param != -1) { - Map_SetWorldspawn(g_map, &node); + switch(BP_MessageBox(BP_param)) + { + case 0: + Map_FreeEntities(ents); + return; + case 1: + g_qeglobals.bNeedConvert = true; + break; + case 2: + g_qeglobals.bNeedConvert = false; + break; + } } } - return false; } -}; -scene::Node* Map_FindWorldspawn(Map& map) -{ - Map_SetWorldspawn(map, 0); - - Node_getTraversable(GlobalSceneGraph().root())->traverse(entity_updateworldspawn()); - - return Map_GetWorldspawn(map); -} - - -class CollectAllWalker : public scene::Traversable::Walker -{ - scene::Node& m_root; - UnsortedNodeSet& m_nodes; -public: - CollectAllWalker(scene::Node& root, UnsortedNodeSet& nodes) : m_root(root), m_nodes(nodes) + // process the entities into the world geometry + num_ents = ents->GetSize(); + for(i=0; ierase(node); - return false; - } -}; - -void Node_insertChildFirst(scene::Node& parent, scene::Node& child) -{ - UnsortedNodeSet nodes; - Node_getTraversable(parent)->traverse(CollectAllWalker(parent, nodes)); - Node_getTraversable(parent)->insert(child); - - for(UnsortedNodeSet::iterator i = nodes.begin(); i != nodes.end(); ++i) - { - Node_getTraversable(parent)->insert((*i)); - } -} - -scene::Node& createWorldspawn() -{ - NodeSmartReference worldspawn(GlobalEntityCreator().createEntity(GlobalEntityClassManager().findOrInsert("worldspawn", true))); - Node_insertChildFirst(GlobalSceneGraph().root(), worldspawn); - return worldspawn; -} - -void Map_UpdateWorldspawn(Map& map) -{ - if(Map_FindWorldspawn(map) == 0) - { - Map_SetWorldspawn(map, &createWorldspawn()); - } -} - -scene::Node& Map_FindOrInsertWorldspawn(Map& map) -{ - Map_UpdateWorldspawn(map); - return *Map_GetWorldspawn(map); -} - - -class MapMergeAll : public scene::Traversable::Walker -{ - mutable scene::Path m_path; -public: - MapMergeAll(const scene::Path& root) - : m_path(root) - { - } - bool pre(scene::Node& node) const - { - Node_getTraversable(m_path.top())->insert(node); - m_path.push(makeReference(node)); - selectPath(m_path, true); - return false; - } - void post(scene::Node& node) const - { - m_path.pop(); - } -}; - -class MapMergeEntities : public scene::Traversable::Walker -{ - mutable scene::Path m_path; -public: - MapMergeEntities(const scene::Path& root) - : m_path(root) - { - } - bool pre(scene::Node& node) const - { - if(node_is_worldspawn(node)) + num_brushes = 0; + e = (entity_t*)ents->GetAt(i); + brushes = (CPtrArray*)e->pData; + + num_brushes = brushes->GetSize(); + // link brushes into entity + for(j=0; jGetAt(j)); + g_qeglobals.d_parsed_brushes++; + } + brushes->RemoveAll(); + delete brushes; + e->pData = NULL; + + // set entity origin + GetVectorForKey (e, "origin", e->origin); + // set entity eclass + /*!\todo Make SetKeyValue check for "classname" change and assign appropriate eclass */ + e->eclass = Eclass_ForName (ValueForKey (e, "classname"), + (e->brushes.onext != &e->brushes)); + + // go through all parsed brushes and build stuff + for(b = e->brushes.onext; b!=&e->brushes; b=b->onext) + { + for(f = b->brush_faces; f != NULL; f = f->next) { - Map_SetWorldspawn(g_map, &node); - Node_getTraversable(m_path.top().get())->insert(node); - m_path.push(makeReference(node)); - Node_getTraversable(node)->traverse(SelectChildren(m_path)); + f->pShader = QERApp_Shader_ForName(f->texdef.GetName()); + f->d_texture = f->pShader->getTexture(); + } + + // when brushes are in final state, build the planes and windings + // NOTE: also converts BP brushes if g_qeglobals.bNeedConvert is true + Brush_Build(b); + } + +//#define TERRAIN_HACK +#undef TERRAIN_HACK + +#ifdef TERRAIN_HACK + if ((strcmp(ValueForKey(e, "terrain"),"1") == 0 && strcmp(e->eclass->name,"func_group") == 0)) + { + + // two aux pointers to the shaders used in the terrain entity + // we don't keep refcount on them since they are only temporary + // this avoids doing expensive lookups by name for all faces + IShader *pTerrainShader, *pCaulk; + + pTerrainShader = NULL; + pCaulk = QERApp_Shader_ForName(SHADER_CAULK); + + for(b = e->brushes.onext; b!=&e->brushes; b=b->onext) + { + if (pTerrainShader == NULL) + for(f = b->brush_faces; f != NULL; f = f->next) + if (strcmp(f->texdef.GetName(), SHADER_CAULK)!=0) + pTerrainShader = f->pShader; + + if (pTerrainShader) + { + for(f = b->brush_faces; f != NULL; f = f->next) + { + if (strcmp(f->texdef.GetName(), SHADER_CAULK)!=0) // not caulk + Face_SetShader(f, pTerrainShader->getName()); + else + Face_SetShader(f, pCaulk->getName()); + } + } + else + Sys_Printf("WARNING: no terrain shader found for brush\n"); + } + } +#endif + +#define PATCH_HACK +#ifdef PATCH_HACK + for(b = e->brushes.onext; b!=&e->brushes; b=b->onext) + { + // patch hack, to be removed when dependency on brush_faces is removed + if (b->patchBrush) + { + Patch_CalcBounds(b->pPatch, mins, maxs); + for (int i=0; i<3; i++) + { + if ((int)mins[i] == (int)maxs[i]) + { + mins[i] -= 4; + maxs[i] += 4; + } + } + Brush_Resize(b, mins, maxs); + Brush_Build(b); + } + } +#endif + // add brush for fixedsize entity + if (e->eclass->fixedsize) + { + vec3_t mins, maxs; + VectorAdd (e->eclass->mins, e->origin, mins); + VectorAdd (e->eclass->maxs, e->origin, maxs); + b = Brush_Create (mins, maxs, &e->eclass->texdef); + Entity_LinkBrush(e, b); + Brush_Build(b); + } + + for(b = e->brushes.onext; b!=&e->brushes; b=b->onext) + Brush_AddToList(b, pBrushList); + + if (strcmp(e->eclass->name, "worldspawn") == 0) + { + if (world_entity) + { + while(e->brushes.onext != &e->brushes) + { + b = e->brushes.onext; + Entity_UnlinkBrush(b); + Entity_LinkBrush(world_entity, b); + } + Entity_Free(e); } else { - m_path.push(makeReference(*world_node)); - Node_getTraversable(node)->traverse(MapMergeAll(m_path)); + world_entity = e; } } + else if (strcmp(e->eclass->name, "group_info") == 0) + { + // it's a group thing! + Group_Add(e); + Entity_Free(e); + } else { - Node_getTraversable(m_path.top())->insert(node); - m_path.push(makeReference(node)); - if(node_is_group(node)) + // fix target/targetname collisions + if ((g_PrefsDlg.m_bDoTargetFix) && (strcmp(ValueForKey(e, "target"), "") != 0)) { - Node_getTraversable(node)->traverse(SelectChildren(m_path)); - } - else - { - selectPath(m_path, true); - } - } - return false; - } - void post(scene::Node& node) const - { - m_path.pop(); - } -}; - -class BasicContainer : public scene::Node::Symbiot -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeContainedCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - scene::Node m_node; - TraversableNodeSet m_traverse; -public: - - typedef LazyStatic StaticTypeCasts; - - scene::Traversable& get(NullType) - { - return m_traverse; - } - - BasicContainer() : m_node(this, this, StaticTypeCasts::instance().get()) - { - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } -}; - -/// Merges the map graph rooted at \p node into the global scene-graph. -void MergeMap(scene::Node& node) -{ - Node_getTraversable(node)->traverse(MapMergeEntities(scene::Path(makeReference(GlobalSceneGraph().root())))); -} -void Map_ImportSelected(TextInputStream& in, const MapFormat& format) -{ - NodeSmartReference node((new BasicContainer)->node()); - format.readGraph(node, in, GlobalEntityCreator()); - Map_gatherNamespaced(node); - Map_mergeClonedNames(); - MergeMap(node); -} - -inline scene::Cloneable* Node_getCloneable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline scene::Node& node_clone(scene::Node& node) -{ - scene::Cloneable* cloneable = Node_getCloneable(node); - if(cloneable != 0) - { - return cloneable->clone(); - } - - return (new scene::NullNode)->node(); -} - -class CloneAll : public scene::Traversable::Walker -{ - mutable scene::Path m_path; -public: - CloneAll(scene::Node& root) - : m_path(makeReference(root)) - { - } - bool pre(scene::Node& node) const - { - if(node.isRoot()) - { - return false; - } - - m_path.push(makeReference(node_clone(node))); - m_path.top().get().IncRef(); - - return true; - } - void post(scene::Node& node) const - { - if(node.isRoot()) - { - return; - } - - Node_getTraversable(m_path.parent())->insert(m_path.top()); - - m_path.top().get().DecRef(); - m_path.pop(); - } -}; - -scene::Node& Node_Clone(scene::Node& node) -{ - scene::Node& clone = node_clone(node); - scene::Traversable* traversable = Node_getTraversable(node); - if(traversable != 0) - { - traversable->traverse(CloneAll(clone)); - } - return clone; -} - - -typedef std::map EntityBreakdown; - -class EntityBreakdownWalker : public scene::Graph::Walker -{ - EntityBreakdown& m_entitymap; -public: - EntityBreakdownWalker(EntityBreakdown& entitymap) - : m_entitymap(entitymap) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0) - { - const EntityClass& eclass = entity->getEntityClass(); - if(m_entitymap.find(eclass.name()) == m_entitymap.end()) - { - m_entitymap[eclass.name()] = 1; - } - else ++m_entitymap[eclass.name()]; - } - return true; - } -}; - -void Scene_EntityBreakdown(EntityBreakdown& entitymap) -{ - GlobalSceneGraph().traverse(EntityBreakdownWalker(entitymap)); -} - - -WindowPosition g_posMapInfoWnd(c_default_window_pos); - -void DoMapInfo() -{ - ModalDialog dialog; - GtkEntry* brushes_entry; - GtkEntry* entities_entry; - GtkListStore* EntityBreakdownWalker; - - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Map Info", G_CALLBACK(dialog_delete_callback), &dialog); - - window_set_position(window, g_posMapInfoWnd); - - { - GtkVBox* vbox = create_dialog_vbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - - { - GtkHBox* hbox = create_dialog_hbox(4); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, TRUE, 0); - - { - GtkTable* table = create_dialog_table(2, 2, 4, 4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(table), TRUE, TRUE, 0); - - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable(entry, FALSE); - - brushes_entry = entry; - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable(entry, FALSE); - - entities_entry = entry; - } - { - GtkWidget* label = gtk_label_new ("Total Brushes"); - gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkWidget* label = gtk_label_new ("Total Entities"); - gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - } - { - GtkVBox* vbox2 = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox2), FALSE, FALSE, 0); - - { - GtkButton* button = create_dialog_button("Close", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(button), FALSE, FALSE, 0); - } - } - } - { - GtkWidget* label = gtk_label_new ("Entity breakdown"); - gtk_widget_show (label); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, TRUE, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkScrolledWindow* scr = create_scrolled_window(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4); - gtk_box_pack_start(GTK_BOX (vbox), GTK_WIDGET(scr), TRUE, TRUE, 0); - - { - GtkListStore* store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); - - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(view), TRUE); - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Entity", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - gtk_tree_view_column_set_sort_column_id(column, 0); - } - - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Count", renderer, "text", 1, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - gtk_tree_view_column_set_sort_column_id(column, 1); - } - - gtk_widget_show(view); - - gtk_container_add(GTK_CONTAINER(scr), view); + GPtrArray *t_ents = g_ptr_array_new(); + entity_t *e_target; + const char *target = ValueForKey(e, "target"); + qboolean bCollision=FALSE; - EntityBreakdownWalker = store; + // check the current map entities for an actual collision + for (e_target = entities.next; e_target != &entities; e_target = e_target->next) + { + if(!strcmp(target, ValueForKey(e_target, "target"))) + { + bCollision = TRUE; + // make sure the collision is not between two imported entities + for(j=0; j<(int)new_ents->len; j++) + { + if(e_target == g_ptr_array_index(new_ents, j)) + bCollision = FALSE; + } + } + } + + // find the matching targeted entity(s) + if(bCollision) + { + for(j=num_ents-1; j>0; j--) + { + e_target = (entity_t*)ents->GetAt(j); + if(e_target != NULL && e_target != e) + { + const char *targetname = ValueForKey(e_target, "targetname"); + if( (targetname != NULL) && (strcmp(target, targetname) == 0) ) + g_ptr_array_add(t_ents, (gpointer)e_target); + } + } + if(t_ents->len > 0) + { + // link the first to get a unique target/targetname + Entity_Connect(e, (entity_t*)g_ptr_array_index(t_ents,0)); + // set the targetname of the rest of them manually + for(j = 1; j < (int)t_ents->len; j++) + SetKeyValue( (entity_t*)g_ptr_array_index(t_ents, j), "targetname", ValueForKey(e, "target") ); + } + g_ptr_array_free(t_ents, FALSE); + } } + + // add the entity to the end of the entity list + Entity_AddToList(e, &entities); + g_qeglobals.d_num_entities++; + + // keep a list of ents added to avoid testing collisions against them + g_ptr_array_add(new_ents, (gpointer)e); } } + g_ptr_array_free(new_ents, FALSE); + + ents->RemoveAll(); - // Initialize fields - - { - EntityBreakdown entitymap; - Scene_EntityBreakdown(entitymap); - - for(EntityBreakdown::iterator i=entitymap.begin(); i != entitymap.end(); ++i) - { - char tmp[16]; - sprintf (tmp, "%u", Unsigned((*i).second)); - GtkTreeIter iter; - gtk_list_store_append(GTK_LIST_STORE(EntityBreakdownWalker), &iter); - gtk_list_store_set(GTK_LIST_STORE(EntityBreakdownWalker), &iter, 0, (*i).first.c_str(), 1, tmp, -1); - } - } - - g_object_unref(G_OBJECT(EntityBreakdownWalker)); - - char tmp[16]; - sprintf (tmp, "%u", Unsigned(g_brushCount.get())); - gtk_entry_set_text (GTK_ENTRY (brushes_entry), tmp); - sprintf (tmp, "%u", Unsigned(g_entityCount.get())); - gtk_entry_set_text (GTK_ENTRY (entities_entry), tmp); - - modal_dialog_show(window, dialog); - - // save before exit - window_get_position(window, g_posMapInfoWnd); - - gtk_widget_destroy(GTK_WIDGET(window)); + g_qeglobals.bNeedConvert = false; } - - -class ScopeTimer +void Map_Import(IDataStream *in, const char *type, bool bAddSelected) { - Timer m_timer; - const char* m_message; -public: - ScopeTimer(const char* message) - : m_message(message) - { - m_timer.start(); - } - ~ScopeTimer() - { - double elapsed_time = m_timer.elapsed_msec() / 1000.f; - globalOutputStream() << m_message << " timer: " << FloatFormat(elapsed_time, 5, 2) << " second(s) elapsed\n"; - } -}; + CPtrArray ents; + + g_pParentWnd->GetSynapseClient().ImportMap(in, &ents, type); + Map_ImportEntities(&ents, bAddSelected); +} /* ================ Map_LoadFile ================ */ - void Map_LoadFile (const char *filename) { - globalOutputStream() << "Loading map from " << filename << "\n"; - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Loading Map"); + clock_t start, finish; + double elapsed_time; + start = clock(); - g_map.m_name = filename; - Map_UpdateTitle(g_map); + Sys_BeginWait (); + Select_Deselect(); + /*! + \todo FIXME TTimo why is this commented out? + stability issues maybe? or duplicate feature? + forcing to show the console during map load was a good thing IMO + */ + //SetInspectorMode(W_CONSOLE); + Sys_Printf ("Loading map from %s\n", filename ); + Map_Free (); + //++timo FIXME: maybe even easier to have Group_Init called from Map_Free? + Group_Init(); + g_qeglobals.d_num_entities = 0; + g_qeglobals.d_parsed_brushes = 0; + + + // cancel the map loading process + // used when conversion between standard map format and BP format is required and the user cancels the process + g_bCancel_Map_LoadFile = false; + + strcpy (currentmap, filename); + + g_bScreenUpdates = false; // leo: avoid redraws while loading the map (see fenris:1952) + + // prepare to let the map module do the parsing + FileStream file; + const char* type = strrchr(filename,'.'); + if(type!=NULL) type++; + // NOTE TTimo opening has binary doesn't make a lot of sense + // but opening as text confuses the scriptlib parser + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=261 + // this may be a problem if we "rb" and use the XML parser, might have an incompatibility + if (file.Open(filename, "rb")) + Map_Import(&file, type); + else + Sys_FPrintf(SYS_ERR, "ERROR: failed to open %s for read\n", filename); + file.Close(); + + g_bScreenUpdates = true; + + if (g_bCancel_Map_LoadFile) { - ScopeTimer timer("map load"); - - g_map.m_resource = GlobalReferenceCache().capture(g_map.m_name.c_str()); - g_map.m_resource->attach(g_map); - - Node_getTraversable(GlobalSceneGraph().root())->traverse(entity_updateworldspawn()); + Sys_Printf("Map_LoadFile canceled\n"); + Map_New(); + Sys_EndWait(); + return; } - globalOutputStream() << "--- LoadMapFile ---\n"; - globalOutputStream() << g_map.m_name.c_str() << "\n"; - - globalOutputStream() << makeLeftJustified(Unsigned(g_brushCount.get()), 5) << " primitive\n"; - globalOutputStream() << makeLeftJustified(Unsigned(g_entityCount.get()), 5) << " entities\n"; + if (!world_entity) + { + Sys_Printf ("No worldspawn in map.\n"); + Map_New (); + Sys_EndWait(); + return; + } + finish = clock(); + elapsed_time = (double)(finish - start) / CLOCKS_PER_SEC; - //GlobalEntityCreator().printStatistics(); + Sys_Printf ("--- LoadMapFile ---\n"); + Sys_Printf ("%s\n", filename ); + + Sys_Printf ("%5i brushes\n", g_qeglobals.d_parsed_brushes ); + Sys_Printf ("%5i entities\n", g_qeglobals.d_num_entities); + Sys_Printf ("%5.2f second(s) load time\n", elapsed_time ); + + Sys_EndWait(); + + Map_RestoreBetween (); // // move the view to a start position // Map_StartPosition(); - g_currentMap = &g_map; + Map_RegionOff (); + + modified = false; + Sys_SetTitle (filename); + + Texture_ShowInuse (); + QERApp_SortActiveShaders(); + + Sys_UpdateWindows (W_ALL); } -class Excluder +/*! +=========== +Supporting functions for Map_SaveFile, builds a CPtrArray with the filtered / non filtered brushes +=========== +*/ +void CleanFilter(entity_t *ent) { -public: - virtual bool excluded(scene::Node& node) const = 0; -}; - -class ExcludeWalker : public scene::Traversable::Walker -{ - const scene::Traversable::Walker& m_walker; - const Excluder* m_exclude; - mutable bool m_skip; -public: - ExcludeWalker(const scene::Traversable::Walker& walker, const Excluder& exclude) - : m_walker(walker), m_exclude(&exclude), m_skip(false) + if (ent->pData) { + delete static_cast(ent->pData); + ent->pData = NULL; } - bool pre(scene::Node& node) const +} + +/*! +filters out the region brushes if necessary +returns true if this entity as a whole is out of the region +(if all brushes are filtered out, then the entity will be completely dropped .. except if it's worldspawn of course) +*/ +bool FilterChildren(entity_t *ent, bool bRegionOnly = false, bool bSelectedOnly = false) +{ + if(ent->brushes.onext == &ent->brushes) + return false; + // entity without a brush, ignore it... this can be caused by Undo + + // filter fixedsize ents by their eclass bounding box + // don't add their brushes + if (ent->eclass->fixedsize) { - if(m_exclude->excluded(node) || node.isRoot()) - { - m_skip = true; + if(bSelectedOnly && !IsBrushSelected(ent->brushes.onext)) return false; - } - else + + if(bRegionOnly && region_active) { - m_walker.pre(node); + for (int i=0 ; i<3 ; i++) + { + if ((ent->origin[i] + ent->eclass->mins[i]) > region_maxs[i]) + return false; + if ((ent->origin[i] + ent->eclass->maxs[i]) < region_mins[i]) + return false; + } } - return true; - } - void post(scene::Node& node) const - { - if(m_skip) - { - m_skip = false; - } - else - { - m_walker.post(node); - } - } -}; - -class AnyInstanceSelected : public scene::Instantiable::Visitor -{ - bool& m_selected; -public: - AnyInstanceSelected(bool& selected) : m_selected(selected) - { - m_selected = false; - } - void visit(scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) - { - m_selected = true; - } - } -}; - -bool Node_instanceSelected(scene::Node& node) -{ - scene::Instantiable* instantiable = Node_getInstantiable(node); - ASSERT_NOTNULL(instantiable); - bool selected; - instantiable->forEachInstance(AnyInstanceSelected(selected)); - return selected; -} - -class SelectedDescendantWalker : public scene::Traversable::Walker -{ - bool& m_selected; -public: - SelectedDescendantWalker(bool& selected) : m_selected(selected) - { - m_selected = false; - } - - bool pre(scene::Node& node) const - { - if(node.isRoot()) - { - return false; - } - - if(Node_instanceSelected(node)) - { - m_selected = true; - } - - return true; - } -}; - -bool Node_selectedDescendant(scene::Node& node) -{ - bool selected; - Node_traverseSubgraph(node, SelectedDescendantWalker(selected)); - return selected; -} - -class SelectionExcluder : public Excluder -{ -public: - bool excluded(scene::Node& node) const - { - return !Node_selectedDescendant(node); - } -}; - -class IncludeSelectedWalker : public scene::Traversable::Walker -{ - const scene::Traversable::Walker& m_walker; - mutable std::size_t m_selected; - mutable bool m_skip; - - bool selectedParent() const - { - return m_selected != 0; - } -public: - IncludeSelectedWalker(const scene::Traversable::Walker& walker) - : m_walker(walker), m_selected(0), m_skip(false) - { - } - bool pre(scene::Node& node) const - { - // include node if: - // node is not a 'root' AND ( node is selected OR any child of node is selected OR any parent of node is selected ) - if(!node.isRoot() && (Node_selectedDescendant(node) || selectedParent())) - { - if(Node_instanceSelected(node)) - { - ++m_selected; - } - m_walker.pre(node); - return true; - } - else - { - m_skip = true; - return false; - } - } - void post(scene::Node& node) const - { - if(m_skip) - { - m_skip = false; - } - else - { - if(Node_instanceSelected(node)) - { - --m_selected; - } - m_walker.post(node); - } - } -}; - -void Map_Traverse_Selected(scene::Node& root, const scene::Traversable::Walker& walker) -{ - scene::Traversable* traversable = Node_getTraversable(root); - if(traversable != 0) - { -#if 0 - traversable->traverse(ExcludeWalker(walker, SelectionExcluder())); -#else - traversable->traverse(IncludeSelectedWalker(walker)); -#endif - } -} - -void Map_ExportSelected(TextOutputStream& out, const MapFormat& format) -{ - format.writeGraph(GlobalSceneGraph().root(), Map_Traverse_Selected, out); -} - -void Map_Traverse(scene::Node& root, const scene::Traversable::Walker& walker) -{ - scene::Traversable* traversable = Node_getTraversable(root); - if(traversable != 0) - { - traversable->traverse(walker); - } -} - -class RegionExcluder : public Excluder -{ -public: - bool excluded(scene::Node& node) const - { - return node.excluded(); - } -}; - -void Map_Traverse_Region(scene::Node& root, const scene::Traversable::Walker& walker) -{ - scene::Traversable* traversable = Node_getTraversable(root); - if(traversable != 0) - { - traversable->traverse(ExcludeWalker(walker, RegionExcluder())); - } -} - -bool Map_SaveRegion(const char *filename) -{ - AddRegionBrushes(); - - bool success = MapResource_saveFile(MapFormat_forFile(filename), GlobalSceneGraph().root(), Map_Traverse_Region, filename); - - RemoveRegionBrushes(); - - return success; -} - - -void Map_RenameAbsolute(const char* absolute) -{ - Resource* resource = GlobalReferenceCache().capture(absolute); - NodeSmartReference clone(NewMapRoot(path_make_relative(absolute, GlobalFileSystem().findRoot(absolute)))); - resource->setNode(clone.get_pointer()); - - { - //ScopeTimer timer("clone subgraph"); - Node_getTraversable(GlobalSceneGraph().root())->traverse(CloneAll(clone)); - } - - g_map.m_resource->detach(g_map); - GlobalReferenceCache().release(g_map.m_name.c_str()); - - g_map.m_resource = resource; - - g_map.m_name = absolute; - Map_UpdateTitle(g_map); - - g_map.m_resource->attach(g_map); -} - -void Map_Rename(const char* filename) -{ - if(!string_equal(g_map.m_name.c_str(), filename)) - { - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Saving Map"); - - Map_RenameAbsolute(filename); - - SceneChangeNotify(); } else { - SaveReferences(); + for (brush_t *b = ent->brushes.onext ; b != &ent->brushes ; b=b->onext) + { + // set flag to use brushprimit_texdef + if(g_qeglobals.m_bBrushPrimitMode) + b->bBrushDef = true; + else + b->bBrushDef = false; + + // add brush, unless it's excluded by region + if ( !(bRegionOnly && Map_IsBrushFiltered(b)) && + !(bSelectedOnly && !IsBrushSelected(b)) ) + ((CPtrArray*)ent->pData)->Add(b); + } + + if (((CPtrArray*)ent->pData)->GetSize() <= 0) + return false; + } + return true; +} + +entity_t *region_startpoint = NULL; +void Map_ExportEntities(CPtrArray* ents, bool bRegionOnly = false, bool bSelectedOnly = false) +{ + int i; + entity_t *e; + + /*! + \todo the entity_t needs to be reworked and asbtracted some more + + keeping the entity_t as the struct providing access to a list of map objects, a list of epairs and various other info? + but separating some more the data that belongs to the entity_t and the 'sons' data + on a side note, I don't think that doing that with linked list would be a good thing + + for now, we use the blind void* in entity_t casted to a CPtrArray of brush_t* to hand out a list of the brushes for map write + the next step is very likely to be a change of the brush_t* to a more abstract object? + */ + + FilterChildren(world_entity, bRegionOnly, bSelectedOnly); + ents->Add(world_entity); + + for (e=entities.next ; e!=&entities ; e=e->next) + { + // not sure this still happens, probably safe to leave it in + if ((!strcmp(ValueForKey (e, "classname"), "worldspawn")) && (e!=world_entity)) + { + Sys_FPrintf(SYS_ERR, "Dropping parasite worldspawn entity\n"); + continue; + } + + // entities which brushes are completely filtered out by regioning are not printed to the map + if (FilterChildren(e, bRegionOnly, bSelectedOnly)) + ents->Add(e); + } + + if (bRegionOnly && region_active) + { + for(i=0; i<6; i++) + ((CPtrArray*)world_entity->pData)->Add(region_sides[i]); + + ents->Add(region_startpoint); } } -bool Map_Save() +void Map_Export(IDataStream *out, const char *type, bool bRegionOnly, bool bSelectedOnly) { - Pointfile_Clear(); + entity_t *e; - ScopeTimer timer("map save"); - SaveReferences(); - return true; // assume success.. + CPtrArray ents; + + if (bRegionOnly && region_active) + AddRegionBrushes(); + + // create the filters + world_entity->pData = new CPtrArray(); + for(e = entities.next; e != &entities; e = e->next) + e->pData = new CPtrArray(); + + Map_ExportEntities(&ents, bRegionOnly, bSelectedOnly); + + g_pParentWnd->GetSynapseClient().ExportMap(&ents, out, type); + + // cleanup the filters + CleanFilter(world_entity); + for (e=entities.next ; e!=&entities ; e=e->next) + CleanFilter(e); + + if (bRegionOnly && region_active) + RemoveRegionBrushes(); +} + +const char* filename_get_extension(const char* filename) +{ + const char* type = strrchr(filename,'.'); + if(type != NULL) + return ++type; + return ""; +} + +/* +=========== +Map_SaveFile +\todo FIXME remove the use_region, this is broken .. work with a global flag to set region mode or not +=========== +*/ +void Map_SaveFile (const char *filename, qboolean use_region ) +{ + clock_t start, finish; + double elapsed_time; + start = clock(); + Sys_Printf("Saving map to %s\n",filename); + + Pointfile_Clear (); + + if (!use_region) + { + char backup[1024]; + + // rename current to .bak + strcpy (backup, filename); + StripExtension (backup); + strcat (backup, ".bak"); + unlink (backup); + rename (filename, backup); + } + + Sys_Printf ("Map_SaveFile: %s\n", filename); + + // build the out data stream + FileStream file; + if (!file.Open(filename,"w")) + { + Sys_FPrintf(SYS_ERR, "ERROR: couldn't open %s for write\n", filename); + return; + } + + // extract filetype + Map_Export(&file, filename_get_extension(filename), use_region); + + file.Close(); + + finish = clock(); + elapsed_time = (double)(finish - start) / CLOCKS_PER_SEC; + + Sys_Printf ("Saved in %-.2f second(s).\n",elapsed_time); + modified = false; + + if ( !strstr( filename, "autosave" ) ) + Sys_SetTitle (filename); + + if (!use_region) + { + time_t timer; + + time (&timer); + + Sys_Beep (); + + Sys_Status ("Saved.", 0); + } } /* @@ -1329,53 +846,32 @@ Map_New =========== */ -void Map_New() +void Map_New (void) { - //globalOutputStream() << "Map_New\n"; + Sys_Printf ("Map_New\n"); + Map_Free (); - g_map.m_name = "unnamed.map"; - Map_UpdateTitle(g_map); + strcpy (currentmap, "unnamed.map"); + Sys_SetTitle (currentmap); - { - g_map.m_resource = GlobalReferenceCache().capture(g_map.m_name.c_str()); -// ASSERT_MESSAGE(g_map.m_resource->getNode() == 0, "bleh"); - g_map.m_resource->attach(g_map); + world_entity = (entity_s*)qmalloc(sizeof(*world_entity)); + world_entity->brushes.onext = + world_entity->brushes.oprev = &world_entity->brushes; + SetKeyValue (world_entity, "classname", "worldspawn"); + world_entity->eclass = Eclass_ForName ("worldspawn", true); - SceneChangeNotify(); - } + g_pParentWnd->GetCamWnd()->Camera()->angles[YAW] = 0; + g_pParentWnd->GetCamWnd()->Camera()->angles[PITCH] = 0; + VectorCopy (vec3_origin, g_pParentWnd->GetCamWnd()->Camera()->origin); + g_pParentWnd->GetCamWnd()->Camera()->origin[2] = 48; + VectorCopy (vec3_origin, g_pParentWnd->GetXYWnd()->GetOrigin()); - FocusViews(g_vector3_identity, 0); + Map_RestoreBetween (); - g_currentMap = &g_map; -} + Group_Init(); -extern void ConstructRegionBrushes(scene::Node* brushes[6], const Vector3& region_mins, const Vector3& region_maxs); - -void ConstructRegionStartpoint(scene::Node* startpoint, const Vector3& region_mins, const Vector3& region_maxs) -{ - /*! - \todo we need to make sure that the player start IS inside the region and bail out if it's not - the compiler will refuse to compile a map with a player_start somewhere in empty space.. - for now, let's just print an error - */ - - Vector3 vOrig(Camera_getOrigin(*g_pParentWnd->GetCamWnd())); - - for (int i=0 ; i<3 ; i++) - { - if (vOrig[i] > region_maxs[i] || vOrig[i] < region_mins[i]) - { - globalErrorStream() << "Camera is NOT in the region, it's likely that the region won't compile correctly\n"; - break; - } - } - - // write the info_playerstart - char sTmp[1024]; - sprintf(sTmp, "%d %d %d", (int)vOrig[0], (int)vOrig[1], (int)vOrig[2]); - Node_getEntity(*startpoint)->setKeyValue("origin", sTmp); - sprintf(sTmp, "%d", (int)Camera_getAngles(*g_pParentWnd->GetCamWnd())[CAMERA_YAW]); - Node_getEntity(*startpoint)->setKeyValue("angle", sTmp); + Sys_UpdateWindows (W_ALL); + modified = false; } /* @@ -1385,12 +881,11 @@ void ConstructRegionStartpoint(scene::Node* startpoint, const Vector3& region_mi =========================================================== */ -bool region_active; -Vector3 region_mins(g_MinWorldCoord, g_MinWorldCoord, g_MinWorldCoord); -Vector3 region_maxs(g_MaxWorldCoord, g_MaxWorldCoord, g_MaxWorldCoord); +qboolean region_active; +vec3_t region_mins = {g_MinWorldCoord, g_MinWorldCoord, g_MinWorldCoord}; +vec3_t region_maxs = {g_MaxWorldCoord, g_MaxWorldCoord, g_MaxWorldCoord}; -scene::Node* region_sides[6]; -scene::Node* region_startpoint = 0; +brush_t *region_sides[6]; /* =========== @@ -1403,114 +898,98 @@ a regioned map will have temp walls put up at the region boundary */ void AddRegionBrushes (void) { + vec3_t mins, maxs; int i; + texdef_t td; - for(i=0; i<6; i++) + if (!region_active) { - region_sides[i] = &GlobalBrushCreator().createBrush(); - Node_getTraversable(Map_FindOrInsertWorldspawn(g_map))->insert(NodeSmartReference(*region_sides[i])); +#ifdef _DEBUG + Sys_FPrintf( SYS_WRN, "Unexpected AddRegionBrushes call.\n"); +#endif + return; } - region_startpoint = &GlobalEntityCreator().createEntity(GlobalEntityClassManager().findOrInsert("info_player_start", false)); + memset (&td, 0, sizeof(td)); + td.SetName(SHADER_NOT_FOUND); - ConstructRegionBrushes(region_sides, region_mins, region_maxs); - ConstructRegionStartpoint(region_startpoint, region_mins, region_maxs); + // set mins + VectorSet(mins, region_mins[0]-32, region_mins[1]-32, region_mins[2]-32); - Node_getTraversable(GlobalSceneGraph().root())->insert(NodeSmartReference(*region_startpoint)); + // vary maxs + for(i=0; i<3; i++) + { + VectorSet(maxs, region_maxs[0]+32, region_maxs[1]+32, region_maxs[2]+32); + maxs[i] = region_mins[i]; + region_sides[i] = Brush_Create (mins, maxs, &td); + } + + // set maxs + VectorSet(maxs, region_maxs[0]+32, region_maxs[1]+32, region_maxs[2]+32); + + // vary mins + for(i=0; i<3; i++) + { + VectorSet(mins, region_mins[0]-32, region_mins[1]-32, region_mins[2]-32); + mins[i] = region_maxs[i]; + region_sides[i+3] = Brush_Create (mins, maxs, &td); + } + + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503 + // this is a safe check, but it should not really happen anymore + vec3_t vOrig; + VectorSet(vOrig, + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[0], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[1], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[2]); + + for (i=0 ; i<3 ; i++) + { + if (vOrig[i] > region_maxs[i] || vOrig[i] < region_mins[i]) + { + Sys_FPrintf(SYS_ERR, "Camera is NOT in the region, it's likely that the region won't compile correctly\n"); + } + } + + // write the info_playerstart + region_startpoint = Entity_Alloc(); + SetKeyValue(region_startpoint, "classname", "info_player_start"); + region_startpoint->eclass = Eclass_ForName ("info_player_start", false); + char sTmp[1024]; + sprintf(sTmp, "%d %d %d", (int)vOrig[0], (int)vOrig[1], (int)vOrig[2]); + SetKeyValue(region_startpoint, "origin", sTmp); + sprintf(sTmp, "%d", (int)g_pParentWnd->GetCamWnd()->Camera()->angles[YAW]); + SetKeyValue(region_startpoint, "angle", sTmp); + // empty array of children + region_startpoint->pData = new CPtrArray; } void RemoveRegionBrushes (void) { - for(std::size_t i=0; i<6; i++) - { - Node_getTraversable(*Map_GetWorldspawn(g_map))->erase(*region_sides[i]); - } - Node_getTraversable(GlobalSceneGraph().root())->erase(*region_startpoint); + int i; + + if (!region_active) + return; + for (i=0 ; i<6 ; i++) + Brush_Free (region_sides[i]); + + CleanFilter(region_startpoint); + Entity_Free(region_startpoint); } -inline void exclude_node(scene::Node& node, bool exclude) +qboolean Map_IsBrushFiltered (brush_t *b) { - exclude - ? node.enable(scene::Node::eExcluded) - : node.disable(scene::Node::eExcluded); -} + int i; -class ExcludeAllWalker : public scene::Graph::Walker -{ - bool m_exclude; -public: - ExcludeAllWalker(bool exclude) - : m_exclude(exclude) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - exclude_node(path.top(), m_exclude); - - return true; - } -}; - -void Scene_Exclude_All(bool exclude) -{ - GlobalSceneGraph().traverse(ExcludeAllWalker(exclude)); -} - -bool Instance_isSelected(const scene::Instance& instance) -{ - const Selectable* selectable = Instance_getSelectable(instance); - return selectable != 0 && selectable->isSelected(); -} - -class ExcludeSelectedWalker : public scene::Graph::Walker -{ - bool m_exclude; -public: - ExcludeSelectedWalker(bool exclude) - : m_exclude(exclude) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - exclude_node(path.top(), (instance.isSelected() || instance.childSelected() || instance.parentSelected()) == m_exclude); - return true; - } -}; - -void Scene_Exclude_Selected(bool exclude) -{ - GlobalSceneGraph().traverse(ExcludeSelectedWalker(exclude)); -} - -class ExcludeRegionedWalker : public scene::Graph::Walker -{ - bool m_exclude; -public: - ExcludeRegionedWalker(bool exclude) - : m_exclude(exclude) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - exclude_node( - path.top(), - !( - ( - aabb_intersects_aabb( - instance.worldAABB(), - aabb_for_minmax(region_mins, region_maxs) - ) != 0 - ) ^ m_exclude - ) - ); - - return true; - } -}; - -void Scene_Exclude_Region(bool exclude) -{ - GlobalSceneGraph().traverse(ExcludeRegionedWalker(exclude)); + for (i=0 ; i<3 ; i++) + { + if (b->mins[i] > region_maxs[i]) + return true; + if (b->maxs[i] < region_mins[i]) + return true; + } + return false; } /* @@ -1520,25 +999,50 @@ Map_RegionOff Other filtering options may still be on =========== */ -void Map_RegionOff() +void Map_RegionOff (void) { - region_active = false; + brush_t *b, *next; + int i; - region_maxs[0] = g_MaxWorldCoord - 64; - region_mins[0] = g_MinWorldCoord + 64; - region_maxs[1] = g_MaxWorldCoord - 64; - region_mins[1] = g_MinWorldCoord + 64; - region_maxs[2] = g_MaxWorldCoord - 64; - region_mins[2] = g_MinWorldCoord + 64; + region_active = false; + for (i=0 ; i<3 ; i++) + { + region_maxs[i] = g_MaxWorldCoord-64; + region_mins[i] = g_MinWorldCoord+64; + } - Scene_Exclude_All(false); + for (b=filtered_brushes.next ; b != &filtered_brushes ; b=next) + { + next = b->next; + if (Map_IsBrushFiltered (b)) + continue; // still filtered + Brush_RemoveFromList (b); + if (active_brushes.next == NULL || active_brushes.prev == NULL) + { + active_brushes.next = &active_brushes; + active_brushes.prev = &active_brushes; + } + Brush_AddToList (b, &active_brushes); + b->bFiltered = FilterBrush(b); + } + Sys_UpdateWindows (W_ALL); } void Map_ApplyRegion (void) { - region_active = true; + brush_t *b, *next; - Scene_Exclude_Region(false); + region_active = true; + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + if (!Map_IsBrushFiltered (b)) + continue; // still filtered + Brush_RemoveFromList (b); + Brush_AddToList (b, &filtered_brushes); + } + + Sys_UpdateWindows (W_ALL); } @@ -1549,18 +1053,51 @@ Map_RegionSelectedBrushes */ void Map_RegionSelectedBrushes (void) { - Map_RegionOff(); + Map_RegionOff (); - if(GlobalSelectionSystem().countSelected() != 0 - && GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) + if (selected_brushes.next == &selected_brushes) // nothing selected { - region_active = true; - Select_GetBounds (region_mins, region_maxs); - - Scene_Exclude_Selected(false); - - GlobalSelectionSystem().setSelectedAll(false); + Sys_Printf("Tried to region with no selection...\n"); + return; } + region_active = true; + Select_GetBounds (region_mins, region_maxs); + +#ifdef _DEBUG + if (filtered_brushes.next != &filtered_brushes) + Sys_Printf("WARNING: filtered_brushes list may not be empty in Map_RegionSelectedBrushes\n"); +#endif + + if (active_brushes.next == &active_brushes) + { + // just have an empty filtered_brushes list + // this happens if you set region after selecting all the brushes in your map (some weird people do that, ask MrE!) + filtered_brushes.next = filtered_brushes.prev = &filtered_brushes; + } + else + { + // move the entire active_brushes list to filtered_brushes + filtered_brushes.next = active_brushes.next; + filtered_brushes.prev = active_brushes.prev; + filtered_brushes.next->prev = &filtered_brushes; + filtered_brushes.prev->next = &filtered_brushes; + } + + // move the entire selected_brushes list to active_brushes + active_brushes.next = selected_brushes.next; + active_brushes.prev = selected_brushes.prev; + active_brushes.next->prev = &active_brushes; + active_brushes.prev->next = &active_brushes; + + // deselect patches + for (brush_t *b = active_brushes.next; b != &active_brushes; b = b->next) + if (b->patchBrush) + b->pPatch->bSelected = false; + + // clear selected_brushes + selected_brushes.next = selected_brushes.prev = &selected_brushes; + + Sys_UpdateWindows (W_ALL); } @@ -1569,30 +1106,48 @@ void Map_RegionSelectedBrushes (void) Map_RegionXY =========== */ -void Map_RegionXY(float x_min, float y_min, float x_max, float y_max) +void Map_RegionXY (void) { - Map_RegionOff(); + Map_RegionOff (); - region_mins[0] = x_min; - region_maxs[0] = x_max; - region_mins[1] = y_min; - region_maxs[1] = y_max; - region_mins[2] = g_MinWorldCoord + 64; - region_maxs[2] = g_MaxWorldCoord - 64; - - Map_ApplyRegion(); + region_mins[0] = g_pParentWnd->GetXYWnd()->GetOrigin()[0] - 0.5 * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale(); + region_maxs[0] = g_pParentWnd->GetXYWnd()->GetOrigin()[0] + 0.5 * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale(); + region_mins[1] = g_pParentWnd->GetXYWnd()->GetOrigin()[1] - 0.5 * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale(); + region_maxs[1] = g_pParentWnd->GetXYWnd()->GetOrigin()[1] + 0.5 * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale(); + region_mins[2] = g_MinWorldCoord+64; + region_maxs[2] = g_MaxWorldCoord-64; + Map_ApplyRegion (); } -void Map_RegionBounds(const AABB& bounds) +/* +=========== +Map_RegionTallBrush +=========== +*/ +void Map_RegionTallBrush (void) { - Map_RegionOff(); + brush_t *b; - region_mins = vector3_subtracted(bounds.origin, bounds.extents); - region_maxs = vector3_added(bounds.origin, bounds.extents); + if (!QE_SingleBrush ()) + return; - deleteSelection(); + b = selected_brushes.next; - Map_ApplyRegion(); + Map_RegionOff (); + + VectorCopy (b->mins, region_mins); + VectorCopy (b->maxs, region_maxs); + region_mins[2] = g_MinWorldCoord+64; + region_maxs[2] = g_MaxWorldCoord-64; + + Undo_Start("delete"); + Undo_AddBrushList(&selected_brushes); + Undo_AddEntity(b->owner); + Select_Delete (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + + Map_ApplyRegion (); } /* @@ -1602,57 +1157,83 @@ Map_RegionBrush */ void Map_RegionBrush (void) { - if(GlobalSelectionSystem().countSelected() != 0) - { - scene::Instance& instance = GlobalSelectionSystem().ultimateSelected(); - Map_RegionBounds(instance.worldAABB()); - } + brush_t *b; + + if (!QE_SingleBrush ()) + return; + + b = selected_brushes.next; + + Map_RegionOff (); + + VectorCopy (b->mins, region_mins); + VectorCopy (b->maxs, region_maxs); + + Undo_Start("delete"); + Undo_AddBrushList(&selected_brushes); + Undo_AddEntity(b->owner); + Select_Delete (); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + + Map_ApplyRegion (); } +GList *find_string(GList *glist, const char *buf) +{ + while (glist) + { + if (strcmp((char *)glist->data, buf) == 0) + break; // this name is in our list already + glist = glist->next; + } + return glist; +} + +void Map_ImportBuffer(char *buf) +{ + Select_Deselect(); + + Undo_Start("import buffer"); + + MemStream stream; + + stream.Write(buf, strlen(buf)); + Map_Import(&stream, "xmap"); + stream.Close(); + + Sys_UpdateWindows (W_ALL); + Sys_MarkMapModified(); + + Undo_End(); +} + + // //================ //Map_ImportFile //================ // -bool Map_ImportFile(const char* filename) +void Map_ImportFile (const char *filename) { - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Loading Map"); + FileStream file; + Sys_BeginWait (); - bool success = false; - { - Resource* resource = GlobalReferenceCache().capture(filename); - resource->refresh(); // avoid loading old version if map has changed on disk since last import - if(resource->load()) - { - NodeSmartReference clone(NewMapRoot("")); + Sys_Printf("Importing map from %s\n",filename); - { - //ScopeTimer timer("clone subgraph"); - Node_getTraversable(*resource->getNode())->traverse(CloneAll(clone)); - } + const char* type = strrchr(filename,'.'); + if(type!=NULL) type++; + /*!\todo Resolve "r" problem in scriptlib" */ + if(file.Open(filename, "rb")) + Map_Import(&file, type, true); + else + Sys_FPrintf(SYS_ERR, "ERROR: couldn't open %s for read\n", filename); - Map_gatherNamespaced(clone); - Map_mergeClonedNames(); - MergeMap(clone); - success = true; - } - GlobalReferenceCache().release(filename); - } + file.Close(); - SceneChangeNotify(); - - return success; -} - -/* -=========== -Map_SaveFile -=========== -*/ -bool Map_SaveFile(const char* filename) -{ - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Saving Map"); - return MapResource_saveFile(MapFormat_forFile(filename), GlobalSceneGraph().root(), Map_Traverse, filename); + Sys_UpdateWindows (W_ALL); + modified = true; + Sys_EndWait(); } // @@ -1662,665 +1243,80 @@ bool Map_SaveFile(const char* filename) // // Saves selected world brushes and whole entities with partial/full selections // -bool Map_SaveSelected(const char* filename) +void Map_SaveSelected(const char* filename) { - return MapResource_saveFile(MapFormat_forFile(filename), GlobalSceneGraph().root(), Map_Traverse_Selected, filename); -} + FileStream file; + Sys_Printf("Saving selection to %s\n",filename); -class ParentSelectedBrushesToEntityWalker : public scene::Graph::Walker -{ - scene::Node& m_parent; -public: - ParentSelectedBrushesToEntityWalker(scene::Node& parent) : m_parent(parent) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get_pointer() != &m_parent - && Node_isPrimitive(path.top())) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected() - && path.size() > 1) - { - return false; - } - } - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get_pointer() != &m_parent - && Node_isPrimitive(path.top())) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected() - && path.size() > 1) - { - scene::Node& parent = path.parent(); - if(&parent != &m_parent) - { - NodeSmartReference node(path.top().get()); - Node_getTraversable(parent)->erase(node); - Node_getTraversable(m_parent)->insert(node); - } - } - } - } -}; - -void Scene_parentSelectedBrushesToEntity(scene::Graph& graph, scene::Node& parent) -{ - graph.traverse(ParentSelectedBrushesToEntityWalker(parent)); -} - -class CountSelectedBrushes : public scene::Graph::Walker -{ - std::size_t& m_count; - mutable std::size_t m_depth; -public: - CountSelectedBrushes(std::size_t& count) : m_count(count), m_depth(0) - { - m_count = 0; - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(++m_depth != 1 && path.top().get().isRoot()) - { - return false; - } - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected() - && Node_isPrimitive(path.top())) - { - ++m_count; - } - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - --m_depth; - } -}; - -std::size_t Scene_countSelectedBrushes(scene::Graph& graph) -{ - std::size_t count; - graph.traverse(CountSelectedBrushes(count)); - return count; -} - -enum ENodeType -{ - eNodeUnknown, - eNodeMap, - eNodeEntity, - eNodePrimitive, -}; - -const char* nodetype_get_name(ENodeType type) -{ - if(type == eNodeMap) - return "map"; - if(type == eNodeEntity) - return "entity"; - if(type == eNodePrimitive) - return "primitive"; - return "unknown"; -} - -ENodeType node_get_nodetype(scene::Node& node) -{ - if(Node_isEntity(node)) - { - return eNodeEntity; - } - if(Node_isPrimitive(node)) - { - return eNodePrimitive; - } - return eNodeUnknown; -} - -bool contains_entity(scene::Node& node) -{ - return Node_getTraversable(node) != 0 && !Node_isBrush(node) && !Node_isPatch(node) && !Node_isEntity(node); -} - -bool contains_primitive(scene::Node& node) -{ - return Node_isEntity(node) && Node_getTraversable(node) != 0 && Node_getEntity(node)->isContainer(); -} - -ENodeType node_get_contains(scene::Node& node) -{ - if(contains_entity(node)) - { - return eNodeEntity; - } - if(contains_primitive(node)) - { - return eNodePrimitive; - } - return eNodeUnknown; -} - -void Path_parent(const scene::Path& parent, const scene::Path& child) -{ - ENodeType contains = node_get_contains(parent.top()); - ENodeType type = node_get_nodetype(child.top()); - - if(contains != eNodeUnknown && contains == type) - { - NodeSmartReference node(child.top().get()); - Path_deleteTop(child); - Node_getTraversable(parent.top())->insert(node); - SceneChangeNotify(); - } + const char* type = strrchr(filename,'.'); + if(type!=NULL) type++; + if(file.Open(filename, "w")) + Map_Export (&file, type, false, true); else - { - globalErrorStream() << "failed - " << nodetype_get_name(type) << " cannot be parented to " << nodetype_get_name(contains) << " container.\n"; - } + Sys_FPrintf(SYS_ERR, "ERROR: failed to open %s for write\n", filename); + + file.Close(); + } -void Scene_parentSelected() +// +//=========== +//Map_SaveSelected +//=========== +// +// Saves selected world brushes and whole entities with partial/full selections +// +void Map_SaveSelected (MemStream* pMemFile, MemStream* pPatchFile) { - UndoableCommand undo("parentSelected"); + Map_Export (pMemFile, "xmap", false, true); - if(GlobalSelectionSystem().countSelected() > 1) - { - class ParentSelectedBrushesToEntityWalker : public SelectionSystem::Visitor - { - const scene::Path& m_parent; - public: - ParentSelectedBrushesToEntityWalker(const scene::Path& parent) : m_parent(parent) - { - } - void visit(scene::Instance& instance) const - { - if(&m_parent != &instance.path()) - { - Path_parent(m_parent, instance.path()); - } - } - }; - - ParentSelectedBrushesToEntityWalker visitor(GlobalSelectionSystem().ultimateSelected().path()); - GlobalSelectionSystem().foreachSelected(visitor); - } - else - { - globalOutputStream() << "failed - did not find two selected nodes.\n"; - } + /* + // write world entity first + Entity_WriteSelected(world_entity, pMemFile); + + // then write all other ents + count = 1; + for (e=entities.next ; e != &entities ; e=next) + { + MemFile_fprintf(pMemFile, "// entity %i\n", count); + count++; + Entity_WriteSelected(e, pMemFile); + next = e->next; + } + + //if (pPatchFile) + // Patch_WriteFile(pPatchFile); + */ } - -void NewMap() +void MemFile_fprintf(MemStream* pMemFile, const char* pText, ...) { - if (ConfirmModified("New Map")) - { - Map_RegionOff(); - Map_Free(); - Map_New(); - } + char Buffer[4096]; + va_list args; + va_start (args,pText); + vsprintf(Buffer, pText, args); + pMemFile->Write(Buffer, strlen(Buffer)); } -CopiedString g_mapsPath; - -const char* getMapsPath() +/*! +============== +Region_SpawnPoint +push the region spawn point +\todo FIXME TTimo this was in the #1 MAP module implementation (in the core) +not sure it has any use anymore, should prolly drop it +============== +*/ +void Region_SpawnPoint(FILE *f) { - return g_mapsPath.c_str(); -} - -const char* map_open(const char* title) -{ - return file_dialog(GTK_WIDGET(MainFrame_getWindow()), TRUE, title, getMapsPath(), MapFormat::Name()); -} - -const char* map_save(const char* title) -{ - return file_dialog(GTK_WIDGET(MainFrame_getWindow()), FALSE, title, getMapsPath(), MapFormat::Name()); -} - -void OpenMap() -{ - if (!ConfirmModified("Open Map")) - return; - - const char* filename = map_open("Open Map"); - - if (filename != 0) - { - MRU_AddFile(filename); - Map_RegionOff(); - Map_Free(); - Map_LoadFile(filename); - } -} - -void ImportMap() -{ - const char* filename = map_open("Import Map"); - - if(filename != 0) - { - UndoableCommand undo("mapImport"); - Map_ImportFile(filename); - } -} - -bool Map_SaveAs() -{ - const char* filename = map_save("Save Map"); - - if(filename != 0) - { - MRU_AddFile(filename); - Map_Rename(filename); - return Map_Save(); - } - return false; -} - -void SaveMapAs() -{ - Map_SaveAs(); -} - -void SaveMap() -{ - if(Map_Unnamed(g_map)) - { - SaveMapAs(); - } - else if(Map_Modified(g_map)) - { - Map_Save(); - } -} - -void ExportMap() -{ - const char* filename = map_save("Export Selection"); - - if(filename != 0) - { - Map_SaveSelected(filename); - } -} - -void SaveRegion() -{ - const char* filename = map_save("Export Region"); - - if(filename != 0) - { - Map_SaveRegion(filename); - } -} - - -void RegionOff() -{ - Map_RegionOff(); - SceneChangeNotify(); -} - -void RegionXY() -{ - Map_RegionXY( - g_pParentWnd->GetXYWnd()->GetOrigin()[0] - 0.5f * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale(), - g_pParentWnd->GetXYWnd()->GetOrigin()[1] - 0.5f * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale(), - g_pParentWnd->GetXYWnd()->GetOrigin()[0] + 0.5f * g_pParentWnd->GetXYWnd()->Width() / g_pParentWnd->GetXYWnd()->Scale(), - g_pParentWnd->GetXYWnd()->GetOrigin()[1] + 0.5f * g_pParentWnd->GetXYWnd()->Height() / g_pParentWnd->GetXYWnd()->Scale() - ); - SceneChangeNotify(); -} - -void RegionBrush() -{ - Map_RegionBrush(); - SceneChangeNotify(); -} - -void RegionSelected() -{ - Map_RegionSelectedBrushes(); - SceneChangeNotify(); -} - - - - - -class BrushFindByIndexWalker : public scene::Traversable::Walker -{ - mutable std::size_t m_index; - scene::Path& m_path; -public: - BrushFindByIndexWalker(std::size_t index, scene::Path& path) - : m_index(index), m_path(path) - { - } - bool pre(scene::Node& node) const - { - if(Node_isPrimitive(node) && m_index-- == 0) - { - m_path.push(makeReference(node)); - } - return false; - } -}; - -class EntityFindByIndexWalker : public scene::Traversable::Walker -{ - mutable std::size_t m_index; - scene::Path& m_path; -public: - EntityFindByIndexWalker(std::size_t index, scene::Path& path) - : m_index(index), m_path(path) - { - } - bool pre(scene::Node& node) const - { - if(Node_isEntity(node) && m_index-- == 0) - { - m_path.push(makeReference(node)); - } - return false; - } -}; - -void Scene_FindEntityBrush(std::size_t entity, std::size_t brush, scene::Path& path) -{ - path.push(makeReference(GlobalSceneGraph().root())); - { - Node_getTraversable(path.top())->traverse(EntityFindByIndexWalker(entity, path)); - } - if(path.size() == 2) - { - scene::Traversable* traversable = Node_getTraversable(path.top()); - if(traversable != 0) - { - traversable->traverse(BrushFindByIndexWalker(brush, path)); - } - } -} - -inline bool Node_hasChildren(scene::Node& node) -{ - scene::Traversable* traversable = Node_getTraversable(node); - return traversable != 0 && !traversable->empty(); -} - -void SelectBrush (int entitynum, int brushnum) -{ - scene::Path path; - Scene_FindEntityBrush(entitynum, brushnum, path); - if(path.size() == 3 || (path.size() == 2 && !Node_hasChildren(path.top()))) - { - scene::Instance* instance = GlobalSceneGraph().find(path); - ASSERT_MESSAGE(instance != 0, "SelectBrush: path not found in scenegraph"); - Selectable* selectable = Instance_getSelectable(*instance); - ASSERT_MESSAGE(selectable != 0, "SelectBrush: path not selectable"); - selectable->setSelected(true); - g_pParentWnd->GetXYWnd()->PositionView(instance->worldAABB().origin); - } -} - - -class BrushFindIndexWalker : public scene::Graph::Walker -{ - mutable const scene::Node* m_node; - std::size_t& m_count; -public: - BrushFindIndexWalker(const scene::Node& node, std::size_t& count) - : m_node(&node), m_count(count) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(Node_isPrimitive(path.top())) - { - if(m_node == path.top().get_pointer()) - { - m_node = 0; - } - if(m_node) - { - ++m_count; - } - } - return true; - } -}; - -class EntityFindIndexWalker : public scene::Graph::Walker -{ - mutable const scene::Node* m_node; - std::size_t& m_count; -public: - EntityFindIndexWalker(const scene::Node& node, std::size_t& count) - : m_node(&node), m_count(count) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(Node_isEntity(path.top())) - { - if(m_node == path.top().get_pointer()) - { - m_node = 0; - } - if(m_node) - { - ++m_count; - } - } - return true; - } -}; - -static void GetSelectionIndex (int *ent, int *brush) -{ - std::size_t count_brush = 0; - std::size_t count_entity = 0; - if(GlobalSelectionSystem().countSelected() != 0) - { - const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path(); - - GlobalSceneGraph().traverse(BrushFindIndexWalker(path.top(), count_brush)); - GlobalSceneGraph().traverse(EntityFindIndexWalker(path.parent(), count_entity)); - } - *brush = int(count_brush); - *ent = int(count_entity); -} - -void DoFind() -{ - ModalDialog dialog; - GtkEntry* entity; - GtkEntry* brush; - - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Find Brush", G_CALLBACK(dialog_delete_callback), &dialog); - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - { - GtkVBox* vbox = create_dialog_vbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - { - GtkTable* table = create_dialog_table(2, 2, 4, 4); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), TRUE, TRUE, 0); - { - GtkWidget* label = gtk_label_new ("Entity number"); - gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new ("Brush number"); - gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_grab_focus(GTK_WIDGET(entry)); - entity = entry; - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - brush = entry; - } - } - { - GtkHBox* hbox = create_dialog_hbox(4); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), TRUE, TRUE, 0); - { - GtkButton* button = create_dialog_button("Find", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Close", G_CALLBACK(dialog_button_cancel), &dialog); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - } - } - - // Initialize dialog - char buf[16]; - int ent, br; - - GetSelectionIndex (&ent, &br); - sprintf (buf, "%i", ent); - gtk_entry_set_text(entity, buf); - sprintf (buf, "%i", br); - gtk_entry_set_text(brush, buf); - - if(modal_dialog_show(window, dialog) == eIDOK) - { - const char *entstr = gtk_entry_get_text(entity); - const char *brushstr = gtk_entry_get_text(brush); - SelectBrush (atoi(entstr), atoi(brushstr)); - } - - gtk_widget_destroy(GTK_WIDGET(window)); -} - -void Map_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox("", "Load last map on open", g_bLoadLastMap); -} - - -class MapEntityClasses : public ModuleObserver -{ - std::size_t m_unrealised; -public: - MapEntityClasses() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - if(g_map.m_resource != 0) - { - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Loading Map"); - g_map.m_resource->realise(); - } - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - if(g_map.m_resource != 0) - { - g_map.m_resource->flush(); - g_map.m_resource->unrealise(); - } - } - } -}; - -MapEntityClasses g_MapEntityClasses; - - -class MapModuleObserver : public ModuleObserver -{ - std::size_t m_unrealised; -public: - MapModuleObserver() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) - { - ASSERT_MESSAGE(!string_empty(g_qeglobals.m_userGamePath.c_str()), "maps_directory: user-game-path is empty"); - StringOutputStream buffer(256); - buffer << g_qeglobals.m_userGamePath.c_str() << "maps/"; - Q_mkdir(buffer.c_str()); - g_mapsPath = buffer.c_str(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - g_mapsPath = ""; - } - } -}; - -MapModuleObserver g_MapModuleObserver; - -#include "preferencesystem.h" - -CopiedString g_strLastMap; -bool g_bLoadLastMap = false; - -void Map_Construct() -{ - GlobalCommands_insert("RegionOff", FreeCaller()); - GlobalCommands_insert("RegionSetXY", FreeCaller()); - GlobalCommands_insert("RegionSetBrush", FreeCaller()); - GlobalCommands_insert("RegionSetSelection", FreeCaller(), Accelerator('R', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - - GlobalPreferenceSystem().registerPreference("LastMap", CopiedStringImportStringCaller(g_strLastMap), CopiedStringExportStringCaller(g_strLastMap)); - GlobalPreferenceSystem().registerPreference("LoadLastMap", BoolImportStringCaller(g_bLoadLastMap), BoolExportStringCaller(g_bLoadLastMap)); - GlobalPreferenceSystem().registerPreference("MapInfoDlg", WindowPositionImportStringCaller(g_posMapInfoWnd), WindowPositionExportStringCaller(g_posMapInfoWnd)); - - PreferencesDialog_addSettingsPreferences(FreeCaller1()); - - GlobalEntityClassManager().attach(g_MapEntityClasses); - Radiant_attachHomePathsObserver(g_MapModuleObserver); -} - -void Map_Destroy() -{ - Radiant_detachHomePathsObserver(g_MapModuleObserver); - GlobalEntityClassManager().detach(g_MapEntityClasses); + // write the info_player_start, we use the camera position + fprintf (f, "{\n"); + fprintf (f, "\"classname\" \"info_player_start\"\n"); + fprintf (f, "\"origin\" \"%i %i %i\"\n", + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[0], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[1], + (int)g_pParentWnd->GetCamWnd()->Camera()->origin[2]); + fprintf (f, "\"angle\" \"%i\"\n", (int)g_pParentWnd->GetCamWnd()->Camera()->angles[YAW]); + fprintf (f, "}\n"); } diff --git a/radiant/map.h b/radiant/map.h index 2529bd2c..39b96ff5 100644 --- a/radiant/map.h +++ b/radiant/map.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,155 +19,54 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_MAP_H) -#define INCLUDED_MAP_H +// map.h -- the state of the current world that all views are displaying -#include "iscenegraph.h" -#include "generic/callback.h" -#include "signal/signalfwd.h" -#include "string/stringfwd.h" +extern char currentmap[1024]; -class Map; -extern Map g_map; +// head/tail of doubly linked lists +extern brush_t active_brushes; // brushes currently being displayed +extern brush_t selected_brushes; // highlighted -class MapFormat; +extern CPtrArray& g_ptrSelectedFaces; +extern CPtrArray& g_ptrSelectedFaceBrushes; -void Map_addValidCallback(Map& map, const SignalHandler& handler); -bool Map_Valid(const Map& map); +extern brush_t filtered_brushes; // brushes that have been filtered or regioned -class DeferredDraw -{ - Callback m_draw; - bool m_defer; - bool m_deferred; -public: - DeferredDraw(const Callback& draw) : m_draw(draw), m_defer(false), m_deferred(false) - { - } - void defer() - { - m_defer = true; - } - void draw() - { - if(m_defer) - { - m_deferred = true; - } - else - { - m_draw(); - } - } - void flush() - { - if(m_defer && m_deferred) - { - m_draw(); - } - m_deferred = false; - m_defer = false; - } -}; +extern entity_t entities; +extern entity_t *world_entity; // the world entity is NOT included in + // the entities chain -inline void DeferredDraw_onMapValidChanged(DeferredDraw& self) -{ - if(Map_Valid(g_map)) - { - self.flush(); - } - else - { - self.defer(); - } -} -typedef ReferenceCaller DeferredDrawOnMapValidChangedCaller; +extern int modified; // for quit confirmations +extern vec3_t region_mins, region_maxs; +extern qboolean region_active; +extern brush_t *region_sides[6]; -const char* Map_Name(const Map& map); -const MapFormat& Map_getFormat(const Map& map); -bool Map_Unnamed(const Map& map); +void Map_Init(); +void Map_LoadFile (const char *filename); +void Map_SaveFile (const char *filename, qboolean use_region); -namespace scene -{ - class Node; - class Graph; -} +void Map_New (void); +void Map_Free (void); +void Map_BuildBrushData(void); -scene::Node* Map_GetWorldspawn(const Map& map); -scene::Node* Map_FindWorldspawn(Map& map); -scene::Node& Map_FindOrInsertWorldspawn(Map& map); +void Map_RegionOff (void); +void Map_RegionXY (void); +void Map_RegionTallBrush (void); +void Map_RegionBrush (void); +void Map_RegionSelectedBrushes (void); +qboolean Map_IsBrushFiltered (brush_t *b); -template class BasicVector3; -typedef BasicVector3 Vector3; +void Map_ImportFile (const char *filename); +void Map_SaveSelected(const char* filename); +//void Map_SaveSelected(MemStream* pMemFile, MemStream* pPatchFile = NULL); +//void Map_ImportBuffer (char* buf); -extern Vector3 region_mins, region_maxs; -extern bool region_active; +void Map_StartPosition(void); +void Region_SpawnPoint(FILE *f); -// used to be #defines, multiple engine support suggests we should go towards dynamic -extern float g_MaxWorldCoord; -extern float g_MinWorldCoord; +void Map_Import(IDataStream *in, const char* type, bool bAddSelected = false); +void Map_Export(IDataStream *out, const char* type, bool bRegionOnly = false , bool bSelectedOnly = false); -void Map_LoadFile(const char* filename); -bool Map_SaveFile(const char* filename); - -void Map_New(); -void Map_Free(); - -void Map_RegionOff(); - -bool Map_SaveRegion(const char* filename); - -class TextInputStream; -class TextOutputStream; - -void Map_ImportSelected(TextInputStream& in, const MapFormat& format); -void Map_ExportSelected(TextOutputStream& out, const MapFormat& format); - -bool Map_Modified(const Map& map); -void Map_SetModified(Map& map, bool modified); - -bool Map_Save(); -bool Map_SaveAs(); - -scene::Node& Node_Clone(scene::Node& node); - -void DoMapInfo(); - -void Scene_parentSelectedBrushesToEntity(scene::Graph& graph, scene::Node& parent); -std::size_t Scene_countSelectedBrushes(scene::Graph& graph); - -void Scene_parentSelected(); - -void OnUndoSizeChanged(); - -void NewMap(); -void OpenMap(); -void ImportMap(); -void SaveMapAs(); -void SaveMap(); -void ExportMap(); -void SaveRegion(); - - -void Map_Traverse(scene::Node& root, const scene::Traversable::Walker& walker); - - -void SelectBrush (int entitynum, int brushnum); - -extern CopiedString g_strLastMap; -extern bool g_bLoadLastMap; - -void Map_Construct(); -void Map_Destroy(); - - -void Map_gatherNamespaced(scene::Node& root); -void Map_mergeClonedNames(); - - -const char* getMapsPath(); - -#endif diff --git a/radiant/missing.cpp b/radiant/missing.cpp new file mode 100644 index 00000000..0245ec1e --- /dev/null +++ b/radiant/missing.cpp @@ -0,0 +1,259 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// Missing functions +// +// Leonardo Zide (leo@lokigames.com) +// + +#include "missing.h" +#include "qsysprintf.h" + +#if defined (__linux__) || defined (__APPLE__) + +#include +#include +#include +#include +#include +#include +#include + +bool radCopyFile(const char *lpExistingFileName, const char *lpNewFileName) +{ + FILE *src, *dst; + void* buf; + int l; + bool ret = false; + char realsrc[PATH_MAX], realdest[PATH_MAX]; + + realpath (lpExistingFileName, realsrc); + realpath (lpNewFileName, realdest); + + src = fopen (realsrc, "rb"); + if ( !src ) { + return false; + } + dst = fopen (realdest, "wb"); + if (!dst) { + fclose (src); + return false; + } + + fseek (src, 0, SEEK_END); + l = ftell (src); + rewind (src); + buf = g_malloc (l); + + if (buf != NULL) + if (fread (buf, l, 1, src) == 1) + if (fwrite (buf, l, 1, dst) == 1) + ret = true; + + g_free (buf); + fclose (src); + fclose (dst); + + return ret; +} + +bool radCreateDirectory( const char *directory ) { + if ( mkdir( directory, 0777 ) == -1 ) { + Sys_Printf( "mkdir %s failed\n", directory ); + return false; + } + return true; +} + +int GetFullPathName(const char *lpFileName, int nBufferLength, char *lpBuffer, char **lpFilePart) +{ + if (lpFileName[0] == '/') + { + strcpy (lpBuffer, lpFileName); + *lpFilePart = strrchr (lpBuffer, '/'); + return strlen (lpBuffer); + } + + if (getcwd (lpBuffer, nBufferLength) == NULL) + return 0; + + strcat (lpBuffer, "/"); + *lpFilePart = lpBuffer + strlen (lpBuffer); + strcat (lpBuffer, lpFileName); + + char *scr = lpBuffer, *dst = lpBuffer; + for (int i = 0; (i < nBufferLength) && (*scr != 0); i++) + { + if (*scr == '/' && *(scr+1) == '.' && *(scr+2) == '.') + { + scr += 4; + while (dst != lpBuffer && *dst != '/') + { + dst--; + i--; + } + } + + *dst = *scr; + + scr++; dst++; + } + *dst = 0; + + return strlen (lpBuffer); +} + +EPathCheck CheckFile( const char *path ) { + struct stat sbuf; + if ( stat( path, &sbuf ) == -1 ) { + return PATH_FAIL; + } + if ( S_ISDIR( sbuf.st_mode ) ) { + return PATH_DIRECTORY; + } + return PATH_FILE; +} + +FindFiles::FindFiles( const char *_directory ) { + findHandle = opendir( _directory ); +} + +FindFiles::~FindFiles() { + if ( findHandle != NULL ) { + closedir( findHandle ); + } +} + +const char* FindFiles::NextFile() { + struct dirent *d; + + if ( findHandle == NULL ) + return NULL; + + d = readdir( findHandle ); + if ( d ) + return d->d_name; + return NULL; +} + +#else + +FindFiles::FindFiles( const char *_directory ) { + directory = _directory; + directory += '*'; + findHandle = INVALID_HANDLE_VALUE; +} + +FindFiles::~FindFiles() { + if ( findHandle != NULL ) { + FindClose( findHandle ); + } +} + +const char* FindFiles::NextFile() { + if ( findHandle == INVALID_HANDLE_VALUE ) { + findHandle = FindFirstFile( directory.GetBuffer(), &findFileData ); + if ( findHandle == INVALID_HANDLE_VALUE ) { + return NULL; + } + return findFileData.cFileName; + } + if ( FindNextFile( findHandle, &findFileData ) == 0 ) { + FindClose( findHandle ); + return NULL; + } + return findFileData.cFileName; +} + +EPathCheck CheckFile( const char *path ) { + struct _stat sbuf; + if ( _stat( path, &sbuf ) == -1 ) { + return PATH_FAIL; + } + if ( ( sbuf.st_mode & _S_IFDIR ) != 0 ) { + return PATH_DIRECTORY; + } + return PATH_FILE; +} + +bool radCreateDirectory( const char *directory ) { + return CreateDirectory( directory, NULL ); +} + +bool radCopyFile( const char *lpExistingFileName, const char *lpNewFileName ) { + return CopyFile( lpExistingFileName, lpNewFileName, FALSE ); +} + +#endif + +bool CopyTree( const char *source, const char *dest ) { + Str srcEntry; + Str dstEntry; + const char *dirname; + FindFiles fileScan( source ); + + while ( ( dirname = fileScan.NextFile() ) != NULL ) { + if ( strcmp( dirname, "." ) == 0 || strcmp( dirname, ".." ) == 0 ) { + continue; + } + if ( strcmp( dirname, ".svn" ) == 0 ) { + continue; + } + srcEntry = source; + srcEntry += "/"; + srcEntry += dirname; + dstEntry = dest; + dstEntry += "/"; + dstEntry += dirname; + switch ( CheckFile( srcEntry.GetBuffer() ) ) { + case PATH_DIRECTORY: { + if ( CheckFile( dstEntry.GetBuffer() ) == PATH_FAIL ) { + radCreateDirectory( dstEntry.GetBuffer() ); + } + bool ret; + ret = CopyTree( srcEntry.GetBuffer(), dstEntry.GetBuffer() ); + if ( !ret ) { + return false; + } + break; + } + case PATH_FILE: { + Sys_Printf( "copy %s -> %s\n", srcEntry.GetBuffer(), dstEntry.GetBuffer() ); + bool ret = radCopyFile( srcEntry.GetBuffer(), dstEntry.GetBuffer() ); + if ( !ret ) { + return false; + } + break; + } + } + } + return true; +} diff --git a/radiant/mru.cpp b/radiant/mru.cpp deleted file mode 100644 index 7f3fbeeb..00000000 --- a/radiant/mru.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "mru.h" - -#include -#include -#include - -#include "os/file.h" -#include "generic/callback.h" -#include "stream/stringstream.h" -#include "convert.h" - -#include "gtkutil/menu.h" -#include "map.h" -#include "qe3.h" - -#define MRU_MAX 4 -namespace { - GtkMenuItem *MRU_items[MRU_MAX]; - std::size_t MRU_used; - typedef CopiedString MRU_filename_t; - MRU_filename_t MRU_filenames[MRU_MAX]; - typedef const char* MRU_key_t; - MRU_key_t MRU_keys[MRU_MAX] = { "File0", "File1", "File2", "File3" }; -} - -inline const char* MRU_GetText(std::size_t index) -{ - return MRU_filenames[index].c_str(); -} - -class EscapedMnemonic -{ - StringBuffer m_buffer; -public: - EscapedMnemonic(std::size_t capacity) : m_buffer(capacity) - { - m_buffer.push_back('_'); - } - const char* c_str() const - { - return m_buffer.c_str(); - } - void push_back(char c) // not escaped - { - m_buffer.push_back(c); - } - std::size_t write(const char* buffer, std::size_t length) - { - for(const char* end = buffer + length; buffer != end; ++buffer) - { - if(*buffer == '_') - { - m_buffer.push_back('_'); - } - - m_buffer.push_back(*buffer); - } - return length; - } -}; - -template -inline EscapedMnemonic& operator<<(EscapedMnemonic& ostream, const T& t) -{ - return ostream_write(ostream, t); -} - - -void MRU_updateWidget(std::size_t index, const char *filename) -{ - EscapedMnemonic mnemonic(64); - mnemonic << Unsigned(index + 1) << "- " << ConvertLocaleToUTF8(filename); - gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[index]))), mnemonic.c_str()); -} - -void MRU_SetText(std::size_t index, const char *filename) -{ - MRU_filenames[index] = filename; - MRU_updateWidget(index, filename); -} - -void MRU_AddFile (const char *str) -{ - std::size_t i; - const char* text; - - // check if file is already in our list - for (i = 0; i < MRU_used; i++) - { - text = MRU_GetText (i); - - if (strcmp (text, str) == 0) - { - // reorder menu - for(; i > 0; i--) - MRU_SetText(i, MRU_GetText (i-1)); - - MRU_SetText(0, str); - - return; - } - } - - if (MRU_used < MRU_MAX) - MRU_used++; - - // move items down - for (i = MRU_used-1; i > 0; i--) - MRU_SetText (i, MRU_GetText (i-1)); - - MRU_SetText (0, str); - gtk_widget_set_sensitive(GTK_WIDGET(MRU_items[0]), TRUE); - gtk_widget_show(GTK_WIDGET(MRU_items[MRU_used-1])); -} - -void MRU_Init() -{ - if(MRU_used > MRU_MAX) - MRU_used = MRU_MAX; -} - -void MRU_AddWidget(GtkMenuItem *widget, std::size_t pos) -{ - if(pos < MRU_MAX) - { - MRU_items[pos] = widget; - if(pos < MRU_used) - { - MRU_updateWidget(pos, MRU_GetText(pos)); - gtk_widget_set_sensitive(GTK_WIDGET(MRU_items[0]), TRUE); - gtk_widget_show(GTK_WIDGET(MRU_items[pos])); - } - } -} - -void MRU_Activate (std::size_t index) -{ - char text[1024]; - strcpy(text, MRU_GetText(index)); - - if (file_readable(text)) //\todo Test 'map load succeeds' instead of 'file is readable'. - { - MRU_AddFile (text); - Map_RegionOff(); - Map_Free(); - Map_LoadFile (text); - } - else - { - MRU_used--; - - for (std::size_t i = index; i < MRU_used; i++) - MRU_SetText (i, MRU_GetText (i+1)); - - if (MRU_used == 0) - { - gtk_label_set_text(GTK_LABEL(GTK_BIN(MRU_items[0])->child), "Recent Files"); - gtk_widget_set_sensitive(GTK_WIDGET(MRU_items[0]), FALSE); - } - else - { - gtk_widget_hide(GTK_WIDGET(MRU_items[MRU_used])); - } - } -} - - -class LoadMRU -{ - std::size_t m_number; -public: - LoadMRU(std::size_t number) - : m_number(number) - { - } - void load() - { - if (ConfirmModified("Open Map")) - { - MRU_Activate(m_number - 1); - } - } -}; - -typedef MemberCaller LoadMRUCaller; - -LoadMRU g_load_mru1(1); -LoadMRU g_load_mru2(2); -LoadMRU g_load_mru3(3); -LoadMRU g_load_mru4(4); - -void MRU_constructMenu(GtkMenu* menu) -{ - { - GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_1", LoadMRUCaller(g_load_mru1)); - gtk_widget_set_sensitive(GTK_WIDGET(item), FALSE); - MRU_AddWidget(item, 0); - } - { - GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_2", LoadMRUCaller(g_load_mru2)); - gtk_widget_hide(GTK_WIDGET(item)); - MRU_AddWidget(item, 1); - } - { - GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_3", LoadMRUCaller(g_load_mru3)); - gtk_widget_hide(GTK_WIDGET(item)); - MRU_AddWidget(item, 2); - } - { - GtkMenuItem* item = create_menu_item_with_mnemonic(menu, "_4", LoadMRUCaller(g_load_mru4)); - gtk_widget_hide(GTK_WIDGET(item)); - MRU_AddWidget(item, 3); - } -} - -#include "preferencesystem.h" -#include "stringio.h" - -void MRU_Construct() -{ - GlobalPreferenceSystem().registerPreference("Count", SizeImportStringCaller(MRU_used), SizeExportStringCaller(MRU_used)); - - for(std::size_t i = 0; i != MRU_MAX; ++i) - { - GlobalPreferenceSystem().registerPreference(MRU_keys[i], CopiedStringImportStringCaller(MRU_filenames[i]), CopiedStringExportStringCaller(MRU_filenames[i])); - } - - MRU_Init(); -} -void MRU_Destroy() -{ -} diff --git a/radiant/mru.h b/radiant/mru.h deleted file mode 100644 index 010e99b7..00000000 --- a/radiant/mru.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MRU_H) -#define INCLUDED_MRU_H - -void MRU_AddFile (const char *str); - -typedef struct _GtkMenu GtkMenu; -void MRU_constructMenu(GtkMenu* menu); - -void MRU_Construct(); -void MRU_Destroy(); - -#endif diff --git a/radiant/multimon.cpp b/radiant/multimon.cpp deleted file mode 100644 index acc756fd..00000000 --- a/radiant/multimon.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "multimon.h" - -#include "debugging/debugging.h" - -#include "gtkutil/window.h" -#include "preferences.h" - - -multimon_globals_t g_multimon_globals; - -LatchedBool g_Multimon_enableSysMenuPopups(false, "Floating windows sysmenu icons"); - -void MultiMonitor_constructPreferences(PreferencesPage& page) -{ - GtkWidget* primary_monitor = page.appendCheckBox("Multi Monitor", "Start on Primary Monitor", g_multimon_globals.m_bStartOnPrimMon); - GtkWidget* popup = page.appendCheckBox( - "", "Disable system menu on popup windows", - LatchedBoolImportCaller(g_Multimon_enableSysMenuPopups), - BoolExportCaller(g_Multimon_enableSysMenuPopups.m_latched) - ); - Widget_connectToggleDependency(popup, primary_monitor); -} - -#include "preferencesystem.h" -#include "stringio.h" - -#include - -namespace -{ - GdkRectangle primaryMonitor; -} - -void PositionWindowOnPrimaryScreen(WindowPosition& position) -{ - if( position.w >= primaryMonitor.width - 12 ) - { - position.w = primaryMonitor.width - 12; - } - if( position.h >= primaryMonitor.height - 24 ) - { - position.h = primaryMonitor.height - 48; - } - if( position.x <= primaryMonitor.x || position.x + position.w >= (primaryMonitor.x + primaryMonitor.width) - 12 ) - { - position.x = primaryMonitor.x + 6; - } - if( position.y <= primaryMonitor.y || position.y + position.h >= (primaryMonitor.y + primaryMonitor.height) - 48 ) - { - position.y = primaryMonitor.y + 24; - } -} - -void MultiMon_Construct() -{ - // detect multiple monitors - - GdkScreen* screen = gdk_display_get_default_screen(gdk_display_get_default()); - gint m = gdk_screen_get_n_monitors(screen); - globalOutputStream() << "default screen has " << m << " monitors\n"; - for(int j = 0; j != m; ++j) - { - GdkRectangle geom; - gdk_screen_get_monitor_geometry(screen, j, &geom); - globalOutputStream() << "monitor " << j << " geometry: " << geom.x << ", " << geom.y << ", " << geom.width << ", " << geom.height << "\n"; - if(j == 0) - { - // I am making the assumption that monitor 0 is always the primary monitor on win32. Tested on WinXP with gtk+-2.4. - primaryMonitor = geom; - } - } - - if(m > 1) - { - g_multimon_globals.m_bStartOnPrimMon = true; - } - - GlobalPreferenceSystem().registerPreference("StartOnPrimMon", BoolImportStringCaller(g_multimon_globals.m_bStartOnPrimMon), BoolExportStringCaller(g_multimon_globals.m_bStartOnPrimMon)); - GlobalPreferenceSystem().registerPreference("NoSysMenuPopups", BoolImportStringCaller(g_Multimon_enableSysMenuPopups.m_latched), BoolExportStringCaller(g_Multimon_enableSysMenuPopups.m_latched)); - - g_Multimon_enableSysMenuPopups.useLatched(); - - PreferencesDialog_addInterfacePreferences(FreeCaller1()); -} -void MultiMon_Destroy() -{ -} diff --git a/radiant/multimon.h b/radiant/multimon.h deleted file mode 100644 index f14d3633..00000000 --- a/radiant/multimon.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_MULTIMON_H) -#define INCLUDED_MULTIMON_H - -struct WindowPosition; - -void PositionWindowOnPrimaryScreen(WindowPosition& position); - -struct multimon_globals_t -{ - bool m_bStartOnPrimMon; - - multimon_globals_t() : - m_bStartOnPrimMon(false) - { - } -}; - -extern multimon_globals_t g_multimon_globals; - -#if defined(WIN32) -void MultiMon_Construct(); -void MultiMon_Destroy(); -#else -inline void MultiMon_Construct() -{ -} -inline void MultiMon_Destroy() -{ -} -#endif - -#endif diff --git a/radiant/nullmodel.cpp b/radiant/nullmodel.cpp deleted file mode 100644 index ed2333b4..00000000 --- a/radiant/nullmodel.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "nullmodel.h" - -#include "debugging/debugging.h" - -#include "iscenegraph.h" -#include "irender.h" -#include "iselection.h" -#include "iundo.h" -#include "ientity.h" -#include "ireference.h" -#include "igl.h" -#include "cullable.h" -#include "renderable.h" -#include "selectable.h" - -#include "math/frustum.h" -#include "scenelib.h" -#include "instancelib.h" -#include "entitylib.h" - -class NullModel : -public Bounded, -public Cullable -{ - Shader* m_state; - AABB m_aabb_local; - RenderableSolidAABB m_aabb_solid; - RenderableWireframeAABB m_aabb_wire; -public: - NullModel() : m_aabb_local(Vector3(0, 0, 0), Vector3(8, 8, 8)), m_aabb_solid(m_aabb_local), m_aabb_wire(m_aabb_local) - { - m_state = GlobalShaderCache().capture(""); - } - ~NullModel() - { - GlobalShaderCache().release(""); - } - - VolumeIntersectionValue intersectVolume(const VolumeTest& volume, const Matrix4& localToWorld) const - { - return volume.TestAABB(m_aabb_local, localToWorld); - } - - const AABB& localAABB() const - { - return m_aabb_local; - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_state, Renderer::eFullMaterials); - renderer.addRenderable(m_aabb_solid, localToWorld); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.addRenderable(m_aabb_wire, localToWorld); - } - - void testSelect(Selector& selector, SelectionTest& test, const Matrix4& localToWorld) - { - test.BeginMesh(localToWorld); - - SelectionIntersection best; - aabb_testselect(m_aabb_local, test, best); - if(best.valid()) - { - selector.addIntersection(best); - } - } -}; - -class NullModelInstance : public scene::Instance, public Renderable, public SelectionTestable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - NullModel& m_nullmodel; -public: - - typedef LazyStatic StaticTypeCasts; - - Bounded& get(NullType) - { - return m_nullmodel; - } - Cullable& get(NullType) - { - return m_nullmodel; - } - - NullModelInstance(const scene::Path& path, scene::Instance* parent, NullModel& nullmodel) : - Instance(path, parent, this, StaticTypeCasts::instance().get()), - m_nullmodel(nullmodel) - { - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_nullmodel.renderSolid(renderer, volume, Instance::localToWorld()); - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_nullmodel.renderWireframe(renderer, volume, Instance::localToWorld()); - } - - void testSelect(Selector& selector, SelectionTest& test) - { - m_nullmodel.testSelect(selector, test, Instance::localToWorld()); - } -}; - -class NullModelNode : public scene::Node::Symbiot, public scene::Instantiable -{ - class TypeCasts - { - NodeTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - } - NodeTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - NullModel m_nullmodel; -public: - - typedef LazyStatic StaticTypeCasts; - - NullModelNode() : m_node(this, this, StaticTypeCasts::instance().get()) - { - m_node.m_isRoot = true; - } - - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new NullModelInstance(path, parent, m_nullmodel); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - -NodeSmartReference NewNullModel() -{ - return NodeSmartReference((new NullModelNode)->node()); -} - -void NullModel_construct() -{ -} -void NullModel_destroy() -{ -} - diff --git a/radiant/nullmodel.h b/radiant/nullmodel.h deleted file mode 100644 index 2713fb08..00000000 --- a/radiant/nullmodel.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_NULLMODEL_H) -#define INCLUDED_NULLMODEL_H - -namespace scene -{ - class Node; -} - -#include "generic/referencecounted.h" -typedef SmartReference > NodeSmartReference; -NodeSmartReference NewNullModel(); - -void NullModel_construct(); -void NullModel_destroy(); - -#endif diff --git a/radiant/parse.cpp b/radiant/parse.cpp index 8e3fd5c0..3760bf00 100644 --- a/radiant/parse.cpp +++ b/radiant/parse.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,33 +19,202 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "parse.h" +#include "stdafx.h" -#include "script/scripttokeniser.h" -#include "script/scripttokenwriter.h" +char token[MAXTOKEN]; +qboolean unget; +char* script_p; +int scriptline; -class ScriptLibraryAPI +// Hydra: added support for GetTokenExtra() +char *currentdelimiters; +qboolean script_keepdelimiter; + +void StartTokenParsing (char *data) { - _QERScripLibTable m_scriptlibrary; -public: - typedef _QERScripLibTable Type; - STRING_CONSTANT(Name, "*"); + scriptline = 1; + script_p = data; + unget = false; - ScriptLibraryAPI() + // Hydra: added support for GetTokenExtra() + currentdelimiters = NULL; + script_keepdelimiter = true; +} + + +qboolean GetToken (qboolean crossline) +{ + char *token_p; + + if (unget) // is a token already waiting? { - m_scriptlibrary.m_pfnNewScriptTokeniser = &NewScriptTokeniser; - m_scriptlibrary.m_pfnNewSimpleTokeniser = &NewSimpleTokeniser; - m_scriptlibrary.m_pfnNewSimpleTokenWriter = &NewSimpleTokenWriter; + unget = false; + return true; } - _QERScripLibTable* getTable() + + // + // skip space + // +skipspace: + while (*script_p <= 32) { - return &m_scriptlibrary; + if (!*script_p) + { + if (!crossline) + Sys_Printf("Warning: Line %i is incomplete [01]\n",scriptline); + return false; + } + + if (*script_p++ == '\n') + { + if (!crossline) + Sys_Printf("Warning: Line %i is incomplete [02]\n",scriptline); + scriptline++; + } } -}; + + if (script_p[0] == '/' && script_p[1] == '/') // comment field + { + if (!crossline) + Sys_Printf("Warning: Line %i is incomplete [03]\n",scriptline); + while (*script_p++ != '\n') + if (!*script_p) + { + if (!crossline) + Sys_Printf("Warning: Line %i is incomplete [04]\n",scriptline); + return false; + } + scriptline++; // Hydra: fixed bad line numbers problem + goto skipspace; + } + + // + // copy token + // + token_p = token; + + if (*script_p == '"') + { + script_p++; + while ( *script_p != '"' ) + { + if (!*script_p) + Error ("EOF inside quoted token"); + *token_p++ = *script_p++; + if (token_p == &token[MAXTOKEN]) + Error ("Token too large on line %i",scriptline); + } + script_p++; + } + else + while ( *script_p > 32 ) + { + // Hydra: added support for GetTokenExtra(), care was taken to maintain speed + if((currentdelimiters) && (!script_keepdelimiter) && (strchr(currentdelimiters,*(script_p)))) + break; -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" + *token_p++ = *script_p++; + if (token_p == &token[MAXTOKEN]) + Error ("Token too large on line %i",scriptline); -typedef SingletonModule ScriptLibraryModule; -typedef Static StaticScriptLibraryModule; -StaticRegisterModule staticRegisterScriptLibrary(StaticScriptLibraryModule::instance()); + // Hydra: added support for GetTokenExtra() + if((currentdelimiters) && (strchr(currentdelimiters,*(script_p-1)))) + break; + + } + + *token_p = 0; + + return true; +} + +void UngetToken (void) +{ + unget = true; +} + +/* +============== +GetTokenExtra + +This function expands the use of GetToken() so it can be used to parse +more complex file formats. + +Hydra - Notes: +You can use this function to split a string like this + +string1:("string2") + +into two strings, like this: +string1 +string2 + +whilst still checking for the brackets and colons, like this: + +GetTokenExtra(false,":",false);// contains "string1" +GetTokenExtra(false,":",true); // contains ":" +GetTokenExtra(false,"(",true); // contains "(" +GetToken(false); // contains "string2" +GetTokenExtra(false,")",true); // contains ")" + +here's what you get, given the same string, with this code: + +GetToken(false); // contains "string1:("string2")" + +Parsing will end if any character in the script matches any one of the +characters in the "delimiters" string. + +it's also possible to do things like this: + +source strings: +1,2 +1:2 +1-2 +1*2 + +code: +GetTokenExtra(false,",:-*",false); // token contains "1" +GetTokenExtra(false,",:-*",false); // token contains the delimiter that was used +GetToken(false); // contains "2" +============== +*/ +qboolean GetTokenExtra (qboolean crossline,char *delimiters, qboolean keepdelimiter) +{ + qboolean result; + char *olddelimiters = currentdelimiters; // store it + + currentdelimiters = delimiters; // change the delimiters + script_keepdelimiter = keepdelimiter; // change the global flag + + result = GetToken(crossline); + currentdelimiters = olddelimiters; // restore it + return(result); +} + +/* +============== +TokenAvailable + +Returns true if there is another token on the line +============== +*/ +qboolean TokenAvailable (void) +{ + char *search_p; + + search_p = script_p; + + while ( *search_p <= 32) + { + if (*search_p == '\n') + return false; + if (*search_p == 0) + return false; + search_p++; + } + + if (*search_p == ';') + return false; + + return true; +} diff --git a/radiant/parse.h b/radiant/parse.h index 3e64113e..ce9e55ba 100644 --- a/radiant/parse.h +++ b/radiant/parse.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,17 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PARSE_H) -#define INCLUDED_PARSE_H +// parse.h -- text file parsing routines + +#define MAXTOKEN 1024 + +extern char token[MAXTOKEN]; +extern int scriptline; + +// NOTE: added WINAPI call syntax to export these for plugins in _QERScripLibTable +void StartTokenParsing (char *data); +qboolean GetToken (qboolean crossline); +void UngetToken (void); +qboolean TokenAvailable (void); +qboolean GetTokenExtra (qboolean crossline,char *delimiters,qboolean keepdelimiter); // Hydra: added support for GetTokenExtra() -#endif diff --git a/radiant/patch.cpp b/radiant/patch.cpp deleted file mode 100644 index 719e2412..00000000 --- a/radiant/patch.cpp +++ /dev/null @@ -1,2831 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "patch.h" - -#include -#include "preferences.h" -#include "brush_primit.h" -#include "signal/signal.h" - - -Signal0 g_patchTextureChangedCallbacks; - -void Patch_addTextureChangedCallback(const SignalHandler& handler) -{ - g_patchTextureChangedCallbacks.connectLast(handler); -} - -void Patch_textureChanged() -{ - g_patchTextureChangedCallbacks(); -} - - -Shader* PatchInstance::m_state_selpoint; -Shader* Patch::m_state_ctrl; -Shader* Patch::m_state_lattice; -EPatchType Patch::m_type; - - -std::size_t MAX_PATCH_WIDTH = 0; -std::size_t MAX_PATCH_HEIGHT = 0; - -int g_PatchSubdivideThreshold = 4; - -void BezierCurveTree_Delete(BezierCurveTree *pCurve) -{ - if(pCurve) - { - BezierCurveTree_Delete(pCurve->left); - BezierCurveTree_Delete(pCurve->right); - delete pCurve; - } -} - -std::size_t BezierCurveTree_Setup(BezierCurveTree *pCurve, std::size_t index, std::size_t stride) -{ - if(pCurve) - { - if(pCurve->left && pCurve->right) - { - index = BezierCurveTree_Setup(pCurve->left, index, stride); - pCurve->index = index*stride; - index++; - index = BezierCurveTree_Setup(pCurve->right, index, stride); - } - else - { - pCurve->index = BEZIERCURVETREE_MAX_INDEX; - } - } - - return index; -} - -bool BezierCurve_IsCurved(BezierCurve *pCurve) -{ - Vector3 vTemp(vector3_subtracted(pCurve->right, pCurve->left)); - Vector3 v1(vector3_subtracted(pCurve->crd, pCurve->left)); - Vector3 v2(vector3_subtracted(pCurve->right, pCurve->crd)); - - if(vector3_equal(v1, g_vector3_identity) || vector3_equal(vTemp, v1)) // return 0 if 1->2 == 0 or 1->2 == 1->3 - return false; - - vector3_normalise(v1); - vector3_normalise(v2); - if(vector3_equal(v1, v2)) - return false; - - Vector3 v3(vTemp); - const double width = vector3_length(v3); - vector3_scale(v3, 1.0 / width); - - if(vector3_equal(v1, v3) && vector3_equal(v2, v3)) - return false; - - const double angle = acos(vector3_dot(v1, v2)) / c_pi; - - const double index = width * angle; - - if(index > static_cast(g_PatchSubdivideThreshold)) - return true; - return false; -} - -void BezierInterpolate(BezierCurve *pCurve) -{ - pCurve->left = vector3_mid(pCurve->left, pCurve->crd); - pCurve->right = vector3_mid(pCurve->crd, pCurve->right); - pCurve->crd = vector3_mid(pCurve->left, pCurve->right); -} - -const std::size_t PATCH_MAX_SUBDIVISION_DEPTH = 16; - -void BezierCurveTree_FromCurveList(BezierCurveTree *pTree, GSList *pCurveList, std::size_t depth = 0) -{ - GSList *pLeftList = 0; - GSList *pRightList = 0; - BezierCurve *pCurve, *pLeftCurve, *pRightCurve; - bool bSplit = false; - - for (GSList *l = pCurveList; l; l = l->next) - { - pCurve = (BezierCurve *)(l->data); - if(bSplit || BezierCurve_IsCurved(pCurve)) - { - bSplit = true; - pLeftCurve = new BezierCurve; - pRightCurve = new BezierCurve; - pLeftCurve->left = pCurve->left; - pRightCurve->right = pCurve->right; - BezierInterpolate(pCurve); - pLeftCurve->crd = pCurve->left; - pRightCurve->crd = pCurve->right; - pLeftCurve->right = pCurve->crd; - pRightCurve->left = pCurve->crd; - - pLeftList = g_slist_prepend(pLeftList, pLeftCurve); - pRightList = g_slist_prepend(pRightList, pRightCurve); - } - } - - if(pLeftList != 0 && pRightList != 0 && depth != PATCH_MAX_SUBDIVISION_DEPTH) - { - pTree->left = new BezierCurveTree; - pTree->right = new BezierCurveTree; - BezierCurveTree_FromCurveList(pTree->left, pLeftList, depth + 1); - BezierCurveTree_FromCurveList(pTree->right, pRightList, depth + 1); - - for(GSList* l = pLeftList; l != 0; l = g_slist_next(l)) - { - delete (BezierCurve*)l->data; - } - - for(GSList* l = pRightList; l != 0; l = g_slist_next(l)) - { - delete (BezierCurve*)l->data; - } - - g_slist_free(pLeftList); - g_slist_free(pRightList); - } - else - { - pTree->left = 0; - pTree->right = 0; - } -} - - -int Patch::m_CycleCapIndex = 0; - - -void Patch::setDims (std::size_t w, std::size_t h) -{ - if((w%2)==0) - w -= 1; - ASSERT_MESSAGE(w <= MAX_PATCH_WIDTH, "patch too wide"); - if(w > MAX_PATCH_WIDTH) - w = MAX_PATCH_WIDTH; - else if(w < MIN_PATCH_WIDTH) - w = MIN_PATCH_WIDTH; - - if((h%2)==0) - m_height -= 1; - ASSERT_MESSAGE(h <= MAX_PATCH_HEIGHT, "patch too tall"); - if(h > MAX_PATCH_HEIGHT) - h = MAX_PATCH_HEIGHT; - else if(h < MIN_PATCH_HEIGHT) - h = MIN_PATCH_HEIGHT; - - m_width = w; m_height = h; - - if(m_width * m_height != m_ctrl.size()) - { - m_ctrl.resize(m_width * m_height); - onAllocate(m_ctrl.size()); - } -} - -inline const Colour4b& colour_for_index(std::size_t i, std::size_t width) -{ - return (i%2 || (i/width)%2) ? colour_inside : colour_corner; -} - -inline bool float_valid(float f) -{ - return f == f; -} - -bool Patch::isValid() const -{ - if(!m_width || !m_height) - { - return false; - } - - for(const_iterator i = m_ctrl.begin(); i != m_ctrl.end(); ++i) - { - if(!float_valid((*i).m_vertex.x()) - || !float_valid((*i).m_vertex.y()) - || !float_valid((*i).m_vertex.z()) - || !float_valid((*i).m_texcoord.x()) - || !float_valid((*i).m_texcoord.y())) - { - globalErrorStream() << "patch has invalid control points\n"; - return false; - } - } - return true; -} - -void Patch::UpdateCachedData() -{ - m_ctrl_vertices.clear(); - m_lattice_indices.clear(); - - if(!isValid()) - { - m_tess.m_numStrips = 0; - m_tess.m_lenStrips = 0; - m_tess.m_nArrayHeight = 0; - m_tess.m_nArrayWidth = 0; - m_tess.m_curveTreeU.resize(0); - m_tess.m_curveTreeV.resize(0); - m_tess.m_indices.resize(0); - m_tess.m_vertices.resize(0); - m_tess.m_arrayHeight.resize(0); - m_tess.m_arrayWidth.resize(0); - m_aabb_local = AABB(); - return; - } - - BuildTesselationCurves(ROW); - BuildTesselationCurves(COL); - BuildVertexArray(); - AccumulateBBox(); - - IndexBuffer ctrl_indices; - - m_lattice_indices.reserve(((m_width * (m_height - 1)) + (m_height * (m_width - 1))) << 1); - ctrl_indices.reserve(m_ctrlTransformed.size()); - { - UniqueVertexBuffer inserter(m_ctrl_vertices); - for(iterator i = m_ctrlTransformed.begin(); i != m_ctrlTransformed.end(); ++i) - { - ctrl_indices.insert(inserter.insert(pointvertex_quantised(PointVertex(reinterpret_cast((*i).m_vertex), colour_for_index(i - m_ctrlTransformed.begin(), m_width))))); - } - } - { - for(IndexBuffer::iterator i = ctrl_indices.begin(); i != ctrl_indices.end(); ++i) - { - if(std::size_t(i - ctrl_indices.begin()) % m_width) - { - m_lattice_indices.insert(*(i - 1)); - m_lattice_indices.insert(*i); - } - if(std::size_t(i - ctrl_indices.begin()) >= m_width) - { - m_lattice_indices.insert(*(i - m_width)); - m_lattice_indices.insert(*i); - } - } - } - -#if 0 - { - Array::iterator first = m_tess.m_indices.begin(); - for(std::size_t s=0; s::iterator last = first + m_tess.m_lenStrips; - - for(Array::iterator i(first); i+2 != last; i += 2) - { - ArbitraryMeshTriangle_sumTangents(m_tess.m_vertices[*(i+0)], m_tess.m_vertices[*(i+1)], m_tess.m_vertices[*(i+2)]); - ArbitraryMeshTriangle_sumTangents(m_tess.m_vertices[*(i+2)], m_tess.m_vertices[*(i+1)], m_tess.m_vertices[*(i+3)]); - } - - first = last; - } - - for(Array::iterator i = m_tess.m_vertices.begin(); i != m_tess.m_vertices.end(); ++i) - { - vector3_normalise(reinterpret_cast((*i).tangent)); - vector3_normalise(reinterpret_cast((*i).bitangent)); - } - } -#endif - - SceneChangeNotify(); -} - -void Patch::InvertMatrix() -{ - undoSave(); - - PatchControlArray_invert(m_ctrl, m_width, m_height); - - controlPointsChanged(); -} - -void Patch::TransposeMatrix() -{ - undoSave(); - - { - Array tmp(m_width * m_height); - copy_ctrl(tmp.data(), m_ctrl.data(), m_ctrl.data() + m_width * m_height); - - PatchControlIter from = tmp.data(); - for(std::size_t h = 0; h != m_height; ++h) - { - PatchControlIter to = m_ctrl.data() + h; - for(std::size_t w = 0; w != m_width; ++w, ++from, to += m_height) - { - *to = *from; - } - } - } - - { - std::size_t tmp = m_width; - m_width = m_height; - m_height = tmp; - } - - controlPointsChanged(); -} - -void Patch::Redisperse(EMatrixMajor mt) -{ - std::size_t w, h, width, height, row_stride, col_stride; - PatchControl* p1, * p2, * p3; - - undoSave(); - - switch(mt) - { - case COL: - width = (m_width-1)>>1; - height = m_height; - col_stride = 1; - row_stride = m_width; - break; - case ROW: - width = (m_height-1)>>1; - height = m_width; - col_stride = m_width; - row_stride = 1; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - for(h=0;hm_vertex = vector3_mid(p1->m_vertex, p3->m_vertex); - p1 = p3; - } - } - - controlPointsChanged(); -} - -void Patch::InsertRemove(bool bInsert, bool bColumn, bool bFirst) -{ - undoSave(); - - if(bInsert) - { - if(bColumn && (m_width + 2 <= MAX_PATCH_WIDTH)) - InsertPoints(COL, bFirst); - else if(m_height + 2 <= MAX_PATCH_HEIGHT) - InsertPoints(ROW, bFirst); - } - else - { - if(bColumn && (m_width - 2 >= MIN_PATCH_WIDTH)) - RemovePoints(COL, bFirst); - else if(m_height - 2 >= MIN_PATCH_HEIGHT) - RemovePoints(ROW, bFirst); - } - - controlPointsChanged(); -} - -Patch* Patch::MakeCap(Patch* patch, EPatchCap eType, EMatrixMajor mt, bool bFirst) -{ - std::size_t i, width, height; - - switch(mt) - { - case ROW: - width = m_width; - height = m_height; - break; - case COL: - width = m_height; - height = m_width; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return 0; - } - - Array p(width); - - std::size_t nIndex = (bFirst) ? 0 : height-1; - if(mt == ROW) - { - for (i=0; iConstructSeam(eType, p.data(), width); - return patch; -} - -void Patch::FlipTexture(int nAxis) -{ - undoSave(); - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - (*i).m_texcoord[nAxis] = -(*i).m_texcoord[nAxis]; - } - - controlPointsChanged(); -} - -void Patch::TranslateTexture(float s, float t) -{ - undoSave(); - - s = -1 * s / m_state->getTexture().width; - t = t / m_state->getTexture().height; - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - (*i).m_texcoord[0] += s; - (*i).m_texcoord[1] += t; - } - - controlPointsChanged(); -} - -void Patch::ScaleTexture(float s, float t) -{ - undoSave(); - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - (*i).m_texcoord[0] *= s; - (*i).m_texcoord[1] *= t; - } - - controlPointsChanged(); -} - -void Patch::RotateTexture(float angle) -{ - undoSave(); - - const float s = static_cast(sin(degrees_to_radians(angle))); - const float c = static_cast(cos(degrees_to_radians(angle))); - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - const float x = (*i).m_texcoord[0]; - const float y = (*i).m_texcoord[1]; - (*i).m_texcoord[0] = (x * c) - (y * s); - (*i).m_texcoord[1] = (y * c) + (x * s); - } - - controlPointsChanged(); -} - - -void Patch::SetTextureRepeat(float s, float t) -{ - std::size_t w, h; - float si, ti, sc, tc; - PatchControl *pDest; - - undoSave(); - - si = s / (float)(m_width - 1); - ti = t / (float)(m_height - 1); - - pDest = m_ctrl.data(); - for (h=0, tc = 0.0f; hm_texcoord[0] = sc; - pDest->m_texcoord[1] = tc; - pDest++; - } - } - - controlPointsChanged(); -} - -/* -void Patch::SetTextureInfo(texdef_t *pt) -{ - if(pt->getShift()[0] || pt->getShift()[1]) - TranslateTexture (pt->getShift()[0], pt->getShift()[1]); - else if(pt->getScale()[0] || pt->getScale()[1]) - { - if(pt->getScale()[0] == 0.0f) pt->setScale(0, 1.0f); - if(pt->getScale()[1] == 0.0f) pt->setScale(1, 1.0f); - ScaleTexture (pt->getScale()[0], pt->getScale()[1]); - } - else if(pt->rotate) - RotateTexture (pt->rotate); -} -*/ - -inline int texture_axis(const Vector3& normal) -{ - // axis dominance order: Z, X, Y - return (normal.x() >= normal.y()) ? (normal.x() > normal.z()) ? 0 : 2 : (normal.y() > normal.z()) ? 1 : 2; -} - -void Patch::CapTexture() -{ - const PatchControl& p1 = m_ctrl[m_width]; - const PatchControl& p2 = m_ctrl[m_width*(m_height-1)]; - const PatchControl& p3 = m_ctrl[(m_width*m_height)-1]; - - - Vector3 normal(g_vector3_identity); - - { - Vector3 tmp(vector3_cross( - vector3_subtracted(p2.m_vertex, m_ctrl[0].m_vertex), - vector3_subtracted(p3.m_vertex, m_ctrl[0].m_vertex) - )); - if(!vector3_equal(tmp, g_vector3_identity)) - { - vector3_add(normal, tmp); - } - } - { - Vector3 tmp(vector3_cross( - vector3_subtracted(p1.m_vertex, p3.m_vertex), - vector3_subtracted(m_ctrl[0].m_vertex, p3.m_vertex) - )); - if(!vector3_equal(tmp, g_vector3_identity)) - { - vector3_add(normal, tmp); - } - } - - ProjectTexture(texture_axis(normal)); -} - -// uses longest parallel chord to calculate texture coords for each row/col -void Patch::NaturalTexture() -{ - undoSave(); - - { - float fSize = (float)m_state->getTexture().width * Texdef_getDefaultTextureScale(); - - double texBest = 0; - double tex = 0; - PatchControl* pWidth = m_ctrl.data(); - for (std::size_t w=0; wm_texcoord[0] = static_cast(tex); - } - - if(w+1 == m_width) - break; - - { - PatchControl* pHeight = pWidth; - for (std::size_t h=0; hm_vertex, (pHeight+1)->m_vertex)); - double length = tex + (vector3_length(v) / fSize); - if(fabs(length) > texBest) texBest = length; - } - } - - tex=texBest; - } - } - - { - float fSize = -(float)m_state->getTexture().height * Texdef_getDefaultTextureScale(); - - double texBest = 0; - double tex = 0; - PatchControl* pHeight = m_ctrl.data(); - for (std::size_t h=0; hm_texcoord[1] = static_cast(tex); - } - - if(h+1 == m_height) - break; - - { - PatchControl* pWidth = pHeight; - for (std::size_t w=0; wm_vertex, (pWidth+m_width)->m_vertex)); - double length = tex + (vector3_length(v) / fSize); - if(fabs(length) > texBest) texBest = length; - } - } - - tex=texBest; - } - } - - controlPointsChanged(); -} - - - -// private: - -void Patch::AccumulateBBox() -{ - m_aabb_local = AABB(); - - for(PatchControlArray::iterator i = m_ctrlTransformed.begin(); i != m_ctrlTransformed.end(); ++i) - { - aabb_extend_by_point_safe(m_aabb_local, (*i).m_vertex); - } - - m_boundsChanged(); - m_lightsChanged(); -} - -void Patch::InsertPoints(EMatrixMajor mt, bool bFirst) -{ - std::size_t width, height, row_stride, col_stride; - - switch(mt) - { - case ROW: - col_stride = 1; - row_stride = m_width; - width = m_width; - height = m_height; - break; - case COL: - col_stride = m_width; - row_stride = 1; - width = m_height; - height = m_width; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - std::size_t pos = 0; - { - PatchControl* p1 = m_ctrl.data(); - for(std::size_t w = 0; w != width; ++w, p1 += col_stride) - { - { - PatchControl* p2 = p1; - for(std::size_t h = 1; h < height; h += 2, p2 += 2 * row_stride) - { - if(0)//p2->m_selectable.isSelected()) - { - pos = h; - break; - } - } - if(pos != 0) - { - break; - } - } - - { - PatchControl* p2 = p1; - for(std::size_t h = 0; h < height; h += 2, p2 += 2 * row_stride) - { - if(0)//p2->m_selectable.isSelected()) - { - pos = h; - break; - } - } - if(pos != 0) - { - break; - } - } - } - } - - Array tmp(m_ctrl); - - std::size_t row_stride2, col_stride2; - switch(mt) - { - case ROW: - setDims(m_width, m_height+2); - col_stride2 = 1; - row_stride2 = m_width; - break; - case COL: - setDims(m_width+2, m_height); - col_stride2 = m_width; - row_stride2 = 1; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - if(pos >= height) - { - if(bFirst) - { - pos = height - 1; - } - else - { - pos = 2; - } - } - else if(pos == 0) - { - pos = 2; - } - else if(pos % 2) - { - ++pos; - } - - - for(std::size_t w = 0; w != width; ++w) - { - PatchControl* p1 = tmp.data() + (w*col_stride); - PatchControl* p2 = m_ctrl.data() + (w*col_stride2); - for(std::size_t h = 0; h != height; ++h, p2 += row_stride2, p1 += row_stride) - { - if(h == pos) - { - p2 += 2 * row_stride2; - } - *p2 = *p1; - } - - p1 = tmp.data() + (w*col_stride+pos*row_stride); - p2 = m_ctrl.data() + (w*col_stride2+pos*row_stride2); - - PatchControl* r2a = (p2+row_stride2); - PatchControl* r2b = (p2-row_stride2); - PatchControl* c2a = (p1-2*row_stride); - PatchControl* c2b = (p1-row_stride); - - // set two new row points - *(p2+2*row_stride2) = *p1; - *r2a = *c2b; - - for(std::size_t i = 0; i != 3; ++i) - { - r2a->m_vertex[i] = float_mid(c2b->m_vertex[i], p1->m_vertex[i]); - - r2b->m_vertex[i] = float_mid(c2a->m_vertex[i], c2b->m_vertex[i]); - - p2->m_vertex[i] = float_mid(r2a->m_vertex[i], r2b->m_vertex[i]); - } - for(std::size_t i = 0; i != 2; ++i) - { - r2a->m_texcoord[i] = float_mid(c2b->m_texcoord[i], p1->m_texcoord[i]); - - r2b->m_texcoord[i] = float_mid(c2a->m_texcoord[i], c2b->m_texcoord[i]); - - p2->m_texcoord[i] = float_mid(r2a->m_texcoord[i], r2b->m_texcoord[i]); - } - } -} - -void Patch::RemovePoints(EMatrixMajor mt, bool bFirst) -{ - std::size_t width, height, row_stride, col_stride; - - switch(mt) - { - case ROW: - col_stride = 1; - row_stride = m_width; - width = m_width; - height = m_height; - break; - case COL: - col_stride = m_width; - row_stride = 1; - width = m_height; - height = m_width; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - std::size_t pos = 0; - { - PatchControl* p1 = m_ctrl.data(); - for(std::size_t w = 0; w != width; ++w, p1 += col_stride) - { - { - PatchControl* p2 = p1; - for(std::size_t h=1; h < height; h += 2, p2 += 2 * row_stride) - { - if(0)//p2->m_selectable.isSelected()) - { - pos = h; - break; - } - } - if(pos != 0) - { - break; - } - } - - { - PatchControl* p2 = p1; - for(std::size_t h=0; h < height; h += 2, p2 += 2 * row_stride) - { - if(0)//p2->m_selectable.isSelected()) - { - pos = h; - break; - } - } - if(pos != 0) - { - break; - } - } - } - } - - Array tmp(m_ctrl); - - std::size_t row_stride2, col_stride2; - switch(mt) - { - case ROW: - setDims(m_width, m_height-2); - col_stride2 = 1; - row_stride2 = m_width; - break; - case COL: - setDims(m_width-2, m_height); - col_stride2 = m_width; - row_stride2 = 1; - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - if(pos >= height) - { - if(bFirst) - { - pos=height-3; - } - else - { - pos=2; - } - } - else if(pos == 0) - { - pos=2; - } - else if(pos > height - 3) - { - pos = height - 3; - } - else if(pos % 2) - { - ++pos; - } - - for(std::size_t w = 0; w != width; w++) - { - PatchControl* p1 = tmp.data() + (w*col_stride); - PatchControl* p2 = m_ctrl.data() + (w*col_stride2); - for(std::size_t h = 0; h != height; ++h, p2 += row_stride2, p1 += row_stride) - { - if(h == pos) - { - p1 += 2 * row_stride2; h += 2; - } - *p2 = *p1; - } - - p1 = tmp.data() + (w*col_stride+pos*row_stride); - p2 = m_ctrl.data() + (w*col_stride2+pos*row_stride2); - - for(std::size_t i=0; i<3; i++) - { - (p2-row_stride2)->m_vertex[i] = ((p1+2*row_stride)->m_vertex[i]+(p1-2*row_stride)->m_vertex[i]) * 0.5f; - - (p2-row_stride2)->m_vertex[i] = (p2-row_stride2)->m_vertex[i]+(2.0f * ((p1)->m_vertex[i]-(p2-row_stride2)->m_vertex[i])); - } - for(std::size_t i=0; i<2; i++) - { - (p2-row_stride2)->m_texcoord[i] = ((p1+2*row_stride)->m_texcoord[i]+(p1-2*row_stride)->m_texcoord[i]) * 0.5f; - - (p2-row_stride2)->m_texcoord[i] = (p2-row_stride2)->m_texcoord[i]+(2.0f * ((p1)->m_texcoord[i]-(p2-row_stride2)->m_texcoord[i])); - } - } -} - -void Patch::ConstructSeam(EPatchCap eType, Vector3* p, std::size_t width) -{ - switch(eType) - { - case eCapIBevel: - { - setDims(3, 3); - m_ctrl[0].m_vertex = p[0]; - m_ctrl[1].m_vertex = p[1]; - m_ctrl[2].m_vertex = p[1]; - m_ctrl[3].m_vertex = p[1]; - m_ctrl[4].m_vertex = p[1]; - m_ctrl[5].m_vertex = p[1]; - m_ctrl[6].m_vertex = p[2]; - m_ctrl[7].m_vertex = p[1]; - m_ctrl[8].m_vertex = p[1]; - } - break; - case eCapBevel: - { - setDims(3, 3); - Vector3 p3(vector3_added(p[2], vector3_subtracted(p[0], p[1]))); - m_ctrl[0].m_vertex = p3; - m_ctrl[1].m_vertex = p3; - m_ctrl[2].m_vertex = p[2]; - m_ctrl[3].m_vertex = p3; - m_ctrl[4].m_vertex = p3; - m_ctrl[5].m_vertex = p[1]; - m_ctrl[6].m_vertex = p3; - m_ctrl[7].m_vertex = p3; - m_ctrl[8].m_vertex = p[0]; - } - break; - case eCapEndCap: - { - Vector3 p5(vector3_mid(p[0], p[4])); - - setDims(3, 3); - m_ctrl[0].m_vertex = p[0]; - m_ctrl[1].m_vertex = p5; - m_ctrl[2].m_vertex = p[4]; - m_ctrl[3].m_vertex = p[1]; - m_ctrl[4].m_vertex = p[2]; - m_ctrl[5].m_vertex = p[3]; - m_ctrl[6].m_vertex = p[2]; - m_ctrl[7].m_vertex = p[2]; - m_ctrl[8].m_vertex = p[2]; - } - break; - case eCapIEndCap: - { - setDims(5, 3); - m_ctrl[0].m_vertex = p[4]; - m_ctrl[1].m_vertex = p[3]; - m_ctrl[2].m_vertex = p[2]; - m_ctrl[3].m_vertex = p[1]; - m_ctrl[4].m_vertex = p[0]; - m_ctrl[5].m_vertex = p[3]; - m_ctrl[6].m_vertex = p[3]; - m_ctrl[7].m_vertex = p[2]; - m_ctrl[8].m_vertex = p[1]; - m_ctrl[9].m_vertex = p[1]; - m_ctrl[10].m_vertex = p[3]; - m_ctrl[11].m_vertex = p[3]; - m_ctrl[12].m_vertex = p[2]; - m_ctrl[13].m_vertex = p[1]; - m_ctrl[14].m_vertex = p[1]; - } - break; - case eCapCylinder: - { - std::size_t mid = (width - 1) >> 1; - - bool degenerate = (mid % 2) != 0; - - std::size_t newHeight = mid + (degenerate ? 2 : 1); - - setDims(3, newHeight); - - if(degenerate) - { - ++mid; - for(std::size_t i = width; i != width + 2; ++i) - { - p[i] = p[width - 1]; - } - } - - { - PatchControl* pCtrl = m_ctrl.data(); - for(std::size_t i = 0; i != m_height; ++i, pCtrl += m_width) - { - pCtrl->m_vertex = p[i]; - } - } - { - PatchControl* pCtrl = m_ctrl.data() + 2; - std::size_t h = m_height - 1; - for(std::size_t i = 0; i != m_height; ++i, pCtrl += m_width) - { - pCtrl->m_vertex = p[h + (h - i)]; - } - } - - Redisperse(COL); - } - break; - default: - ERROR_MESSAGE("invalid patch-cap type"); - return; - } - CapTexture(); - controlPointsChanged(); -} - -void Patch::ProjectTexture(int nAxis) -{ - undoSave(); - - int s, t; - - switch (nAxis) - { - case 2: - s = 0; - t = 1; - break; - case 0: - s = 1; - t = 2; - break; - case 1: - s = 0; - t = 2; - break; - default: - ERROR_MESSAGE("invalid axis"); - return; - } - - float fWidth = 1 / (m_state->getTexture().width * Texdef_getDefaultTextureScale()); - float fHeight = 1 / (m_state->getTexture().height * -Texdef_getDefaultTextureScale()); - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - (*i).m_texcoord[0] = (*i).m_vertex[s] * fWidth; - (*i).m_texcoord[1] = (*i).m_vertex[t] * fHeight; - } - - controlPointsChanged(); -} - -void Patch::constructPlane(const AABB& aabb, int axis, std::size_t width, std::size_t height) -{ - setDims(width, height); - - int x, y, z; - switch(axis) - { - case 2: x=0; y=1; z=2; break; - case 1: x=0; y=2; z=1; break; - case 0: x=1; y=2; z=0; break; - default: - ERROR_MESSAGE("invalid view-type"); - return; - } - - if(m_width < MIN_PATCH_WIDTH || m_width > MAX_PATCH_WIDTH) m_width = 3; - if(m_height < MIN_PATCH_HEIGHT || m_height > MAX_PATCH_HEIGHT) m_height = 3; - - Vector3 vStart; - vStart[x] = aabb.origin[x] - aabb.extents[x]; - vStart[y] = aabb.origin[y] - aabb.extents[y]; - vStart[z] = aabb.origin[z]; - - float xAdj = fabsf((vStart[x] - (aabb.origin[x] + aabb.extents[x])) / (float)(m_width - 1)); - float yAdj = fabsf((vStart[y] - (aabb.origin[y] + aabb.extents[y])) / (float)(m_height - 1)); - - Vector3 vTmp; - vTmp[z] = vStart[z]; - PatchControl* pCtrl = m_ctrl.data(); - - vTmp[y]=vStart[y]; - for (std::size_t h=0; hm_vertex = vTmp; - vTmp[x]+=xAdj; - } - vTmp[y]+=yAdj; - } - - NaturalTexture(); -} - -void Patch::ConstructPrefab(const AABB& aabb, EPatchPrefab eType, int axis, std::size_t width, std::size_t height) -{ - Vector3 vPos[3]; - - if(eType != ePlane) - { - vPos[0] = vector3_subtracted(aabb.origin, aabb.extents); - vPos[1] = aabb.origin; - vPos[2] = vector3_added(aabb.origin, aabb.extents); - } - - if(eType == ePlane) - { - constructPlane(aabb, axis, width, height); - } - else if(eType == eSqCylinder - || eType == eCylinder - || eType == eDenseCylinder - || eType == eVeryDenseCylinder - || eType == eCone - || eType == eSphere) - { - unsigned char *pIndex; - unsigned char pCylIndex[] = - { - 0, 0, - 1, 0, - 2, 0, - 2, 1, - 2, 2, - 1, 2, - 0, 2, - 0, 1, - 0, 0 - }; - - - PatchControl *pStart; - switch(eType) - { - case eSqCylinder: setDims(9, 3); - pStart = m_ctrl.data(); - break; - case eDenseCylinder: - case eVeryDenseCylinder: - case eCylinder: - setDims(9, 3); - pStart = m_ctrl.data() + 1; - break; - case eCone: setDims(9, 3); - pStart = m_ctrl.data() + 1; - break; - case eSphere: - setDims(9, 5); - pStart = m_ctrl.data() + (9+1); - break; - default: - ERROR_MESSAGE("this should be unreachable"); - return; - } - - for(std::size_t h=0; h<3; h++, pStart+=9) - { - pIndex = pCylIndex; - PatchControl* pCtrl = pStart; - for(std::size_t w=0; w<8; w++, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[pIndex[0]][0]; - pCtrl->m_vertex[1] = vPos[pIndex[1]][1]; - pCtrl->m_vertex[2] = vPos[h][2]; - pIndex+=2; - } - } - - switch(eType) - { - case eSqCylinder: - { - PatchControl* pCtrl=m_ctrl.data(); - for(std::size_t h=0; h<3; h++, pCtrl+=9) - { - pCtrl[8].m_vertex = pCtrl[0].m_vertex; - } - } - break; - case eDenseCylinder: - case eVeryDenseCylinder: - case eCylinder: - { - PatchControl* pCtrl=m_ctrl.data(); - for (std::size_t h=0; h<3; h++, pCtrl+=9) - { - pCtrl[0].m_vertex = pCtrl[8].m_vertex; - } - } - break; - case eCone: - { - PatchControl* pCtrl=m_ctrl.data(); - for (std::size_t h=0; h<2; h++, pCtrl+=9) - { - pCtrl[0].m_vertex = pCtrl[8].m_vertex; - } - } - { - PatchControl* pCtrl=m_ctrl.data()+9*2; - for (std::size_t w=0; w<9; w++, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[1][0]; - pCtrl->m_vertex[1] = vPos[1][1]; - pCtrl->m_vertex[2] = vPos[2][2]; - } - } - break; - case eSphere: - { - PatchControl* pCtrl=m_ctrl.data()+9; - for (std::size_t h=0; h<3; h++, pCtrl+=9) - { - pCtrl[0].m_vertex = pCtrl[8].m_vertex; - } - } - { - PatchControl* pCtrl = m_ctrl.data(); - for (std::size_t w=0; w<9; w++, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[1][0]; - pCtrl->m_vertex[1] = vPos[1][1]; - pCtrl->m_vertex[2] = vPos[2][2]; - } - } - { - PatchControl* pCtrl = m_ctrl.data()+(9*4); - for (std::size_t w=0; w<9; w++, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[1][0]; - pCtrl->m_vertex[1] = vPos[1][1]; - pCtrl->m_vertex[2] = vPos[2][2]; - } - } - default: - ERROR_MESSAGE("this should be unreachable"); - return; - } - } - else if (eType == eBevel) - { - unsigned char *pIndex; - unsigned char pBevIndex[] = - { - 0, 0, - 2, 0, - 2, 2, - }; - - setDims(3, 3); - - PatchControl* pCtrl = m_ctrl.data(); - for(std::size_t h=0; h<3; h++) - { - pIndex=pBevIndex; - for(std::size_t w=0; w<3; w++, pIndex+=2, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[pIndex[0]][0]; - pCtrl->m_vertex[1] = vPos[pIndex[1]][1]; - pCtrl->m_vertex[2] = vPos[h][2]; - } - } - } - else if(eType == eEndCap) - { - unsigned char *pIndex; - unsigned char pEndIndex[] = - { - 2, 0, - 2, 2, - 1, 2, - 0, 2, - 0, 0, - }; - - setDims(5, 3); - - PatchControl* pCtrl = m_ctrl.data(); - for(std::size_t h=0; h<3; h++) - { - pIndex=pEndIndex; - for(std::size_t w=0; w<5; w++, pIndex+=2, pCtrl++) - { - pCtrl->m_vertex[0] = vPos[pIndex[0]][0]; - pCtrl->m_vertex[1] = vPos[pIndex[1]][1]; - pCtrl->m_vertex[2] = vPos[h][2]; - } - } - } - - if(eType == eDenseCylinder) - { - InsertRemove(true, false, true); - } - - if(eType == eVeryDenseCylinder) - { - InsertRemove(true, false, false); - InsertRemove(true, false, true); - } - - NaturalTexture(); -} - -void Patch::RenderDebug(RenderStateFlags state) const -{ - for (std::size_t i = 0; inormal)); - glTexCoord2fv(texcoord2f_to_array((m_tess.m_vertices.data() + m_tess.m_indices[i*m_tess.m_lenStrips+j])->texcoord)); - glVertex3fv(vertex3f_to_array((m_tess.m_vertices.data() + m_tess.m_indices[i*m_tess.m_lenStrips+j])->vertex)); - } - glEnd(); - } -} - -void RenderablePatchSolid::RenderNormals() const -{ - const std::size_t width = m_tess.m_numStrips+1; - const std::size_t height = m_tess.m_lenStrips>>1; - glBegin(GL_LINES); - for(std::size_t i=0;ivertex), - vector3_scaled(normal3f_to_vector3((m_tess.m_vertices.data() + (j*width+i))->normal), 8) - ) - ); - glVertex3fv(vertex3f_to_array((m_tess.m_vertices.data() + (j*width+i))->vertex)); - glVertex3fv(&vNormal[0]); - } - { - Vector3 vNormal( - vector3_added( - vertex3f_to_vector3((m_tess.m_vertices.data() + (j*width+i))->vertex), - vector3_scaled(normal3f_to_vector3((m_tess.m_vertices.data() + (j*width+i))->tangent), 8) - ) - ); - glVertex3fv(vertex3f_to_array((m_tess.m_vertices.data() + (j*width+i))->vertex)); - glVertex3fv(&vNormal[0]); - } - { - Vector3 vNormal( - vector3_added( - vertex3f_to_vector3((m_tess.m_vertices.data() + (j*width+i))->vertex), - vector3_scaled(normal3f_to_vector3((m_tess.m_vertices.data() + (j*width+i))->bitangent), 8) - ) - ); - glVertex3fv(vertex3f_to_array((m_tess.m_vertices.data() + (j*width+i))->vertex)); - glVertex3fv(&vNormal[0]); - } - } - } - glEnd(); -} - -#define DEGEN_0a 0x01 -#define DEGEN_1a 0x02 -#define DEGEN_2a 0x04 -#define DEGEN_0b 0x08 -#define DEGEN_1b 0x10 -#define DEGEN_2b 0x20 -#define SPLIT 0x40 -#define AVERAGE 0x80 - - -unsigned int subarray_get_degen(PatchControlIter subarray, std::size_t strideU, std::size_t strideV) -{ - unsigned int nDegen = 0; - const PatchControl* p1; - const PatchControl* p2; - - p1 = subarray; - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_0a; - p1 = p2; - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_0b; - - p1 = subarray + strideV; - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_1a; - p1 = p2; - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_1b; - - p1 = subarray + (strideV << 1); - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_2a; - p1 = p2; - p2 = p1 + strideU; - if(vector3_equal(p1->m_vertex, p2->m_vertex)) - nDegen |= DEGEN_2b; - - return nDegen; -} - - -inline void deCasteljau3(const Vector3& P0, const Vector3& P1, const Vector3& P2, Vector3& P01, Vector3& P12, Vector3& P012) -{ - P01 = vector3_mid(P0, P1); - P12 = vector3_mid(P1, P2); - P012 = vector3_mid(P01, P12); -} - -inline void BezierInterpolate3( const Vector3& start, Vector3& left, Vector3& mid, Vector3& right, const Vector3& end ) -{ - left = vector3_mid(start, mid); - right = vector3_mid(mid, end); - mid = vector3_mid(left, right); -} - -inline void BezierInterpolate2( const Vector2& start, Vector2& left, Vector2& mid, Vector2& right, const Vector2& end ) -{ - left[0]= float_mid(start[0], mid[0]); - left[1] = float_mid(start[1], mid[1]); - right[0] = float_mid(mid[0], end[0]); - right[1] = float_mid(mid[1], end[1]); - mid[0] = float_mid(left[0], right[0]); - mid[1] = float_mid(left[1], right[1]); -} - - -inline Vector2& texcoord_for_index(Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].texcoord); -} - -inline Vector3& vertex_for_index(Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].vertex); -} - -inline Vector3& normal_for_index(Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].normal); -} - -inline Vector3& tangent_for_index(Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].tangent); -} - -inline Vector3& bitangent_for_index(Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].bitangent); -} - -inline const Vector2& texcoord_for_index(const Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].texcoord); -} - -inline const Vector3& vertex_for_index(const Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].vertex); -} - -inline const Vector3& normal_for_index(const Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].normal); -} - -inline const Vector3& tangent_for_index(const Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].tangent); -} - -inline const Vector3& bitangent_for_index(const Array& vertices, std::size_t index) -{ - return reinterpret_cast(vertices[index].bitangent); -} - -#include "math/curve.h" - -inline PatchControl QuadraticBezier_evaluate(const PatchControl* firstPoint, double t) -{ - PatchControl result = { Vector3(0, 0, 0), Vector2(0, 0) }; - double denominator = 0; - - { - double weight = BernsteinPolynomial::apply(t); - vector3_add(result.m_vertex, vector3_scaled(firstPoint[0].m_vertex, weight)); - vector2_add(result.m_texcoord, vector2_scaled(firstPoint[0].m_texcoord, weight)); - denominator += weight; - } - { - double weight = BernsteinPolynomial::apply(t); - vector3_add(result.m_vertex, vector3_scaled(firstPoint[1].m_vertex, weight)); - vector2_add(result.m_texcoord, vector2_scaled(firstPoint[1].m_texcoord, weight)); - denominator += weight; - } - { - double weight = BernsteinPolynomial::apply(t); - vector3_add(result.m_vertex, vector3_scaled(firstPoint[2].m_vertex, weight)); - vector2_add(result.m_texcoord, vector2_scaled(firstPoint[2].m_texcoord, weight)); - denominator += weight; - } - - vector3_divide(result.m_vertex, denominator); - vector2_divide(result.m_texcoord, denominator); - return result; -} - -inline Vector3 vector3_linear_interpolated(const Vector3& a, const Vector3& b, double t) -{ - return vector3_added(vector3_scaled(a, 1.0 - t), vector3_scaled(b, t)); -} - -inline Vector2 vector2_linear_interpolated(const Vector2& a, const Vector2& b, double t) -{ - return vector2_added(vector2_scaled(a, 1.0 - t), vector2_scaled(b, t)); -} - -void normalise_safe(Vector3& normal) -{ - if(!vector3_equal(normal, g_vector3_identity)) - { - vector3_normalise(normal); - } -} - -inline void QuadraticBezier_evaluate(const PatchControl& a, const PatchControl& b, const PatchControl& c, double t, PatchControl& point, PatchControl& left, PatchControl& right) -{ - left.m_vertex = vector3_linear_interpolated(a.m_vertex, b.m_vertex, t); - left.m_texcoord = vector2_linear_interpolated(a.m_texcoord, b.m_texcoord, t); - right.m_vertex = vector3_linear_interpolated(b.m_vertex, c.m_vertex, t); - right.m_texcoord = vector2_linear_interpolated(b.m_texcoord, c.m_texcoord, t); - point.m_vertex = vector3_linear_interpolated(left.m_vertex, right.m_vertex, t); - point.m_texcoord = vector2_linear_interpolated(left.m_texcoord, right.m_texcoord, t); -} - -void Patch::TesselateSubMatrixFixed(ArbitraryMeshVertex* vertices, std::size_t strideX, std::size_t strideY, unsigned int nFlagsX, unsigned int nFlagsY, PatchControl* subMatrix[3][3]) -{ - double incrementU = 1.0 / m_subdivisions_x; - double incrementV = 1.0 / m_subdivisions_y; - const std::size_t width = m_subdivisions_x + 1; - const std::size_t height = m_subdivisions_y + 1; - - for(std::size_t i = 0; i != width; ++i) - { - double tU = (i + 1 == width) ? 1 : i * incrementU; - PatchControl pointX[3]; - PatchControl leftX[3]; - PatchControl rightX[3]; - QuadraticBezier_evaluate(*subMatrix[0][0], *subMatrix[0][1], *subMatrix[0][2], tU, pointX[0], leftX[0], rightX[0]); - QuadraticBezier_evaluate(*subMatrix[1][0], *subMatrix[1][1], *subMatrix[1][2], tU, pointX[1], leftX[1], rightX[1]); - QuadraticBezier_evaluate(*subMatrix[2][0], *subMatrix[2][1], *subMatrix[2][2], tU, pointX[2], leftX[2], rightX[2]); - - ArbitraryMeshVertex* p = vertices + i * strideX; - for(std::size_t j = 0; j != height; ++j) - { - if((j == 0 || j + 1 == height) && (i == 0 || i + 1 == width)) - { - } - else - { - double tV = (j + 1 == height) ? 1 : j * incrementV; - - PatchControl pointY[3]; - PatchControl leftY[3]; - PatchControl rightY[3]; - QuadraticBezier_evaluate(*subMatrix[0][0], *subMatrix[1][0], *subMatrix[2][0], tV, pointY[0], leftY[0], rightY[0]); - QuadraticBezier_evaluate(*subMatrix[0][1], *subMatrix[1][1], *subMatrix[2][1], tV, pointY[1], leftY[1], rightY[1]); - QuadraticBezier_evaluate(*subMatrix[0][2], *subMatrix[1][2], *subMatrix[2][2], tV, pointY[2], leftY[2], rightY[2]); - - PatchControl point; - PatchControl left; - PatchControl right; - QuadraticBezier_evaluate(pointX[0], pointX[1], pointX[2], tV, point, left, right); - PatchControl up; - PatchControl down; - QuadraticBezier_evaluate(pointY[0], pointY[1], pointY[2], tU, point, up, down); - - vertex3f_to_vector3(p->vertex) = point.m_vertex; - texcoord2f_to_vector2(p->texcoord) = point.m_texcoord; - - ArbitraryMeshVertex a, b, c; - - a.vertex = vertex3f_for_vector3(left.m_vertex); - a.texcoord = texcoord2f_for_vector2(left.m_texcoord); - b.vertex = vertex3f_for_vector3(right.m_vertex); - b.texcoord = texcoord2f_for_vector2(right.m_texcoord); - - if(i != 0) - { - c.vertex = vertex3f_for_vector3(up.m_vertex); - c.texcoord = texcoord2f_for_vector2(up.m_texcoord); - } - else - { - c.vertex = vertex3f_for_vector3(down.m_vertex); - c.texcoord = texcoord2f_for_vector2(down.m_texcoord); - } - - Vector3 normal = vector3_normalised(vector3_cross(right.m_vertex - left.m_vertex, up.m_vertex - down.m_vertex)); - - Vector3 tangent, bitangent; - ArbitraryMeshTriangle_calcTangents(a, b, c, tangent, bitangent); - vector3_normalise(tangent); - vector3_normalise(bitangent); - - if(((nFlagsX & AVERAGE) != 0 && i == 0) || ((nFlagsY & AVERAGE) != 0 && j == 0)) - { - normal3f_to_vector3(p->normal) = vector3_normalised(vector3_added(normal3f_to_vector3(p->normal), normal)); - normal3f_to_vector3(p->tangent) = vector3_normalised(vector3_added(normal3f_to_vector3(p->tangent), tangent)); - normal3f_to_vector3(p->bitangent) = vector3_normalised(vector3_added(normal3f_to_vector3(p->bitangent), bitangent)); - } - else - { - normal3f_to_vector3(p->normal) = normal; - normal3f_to_vector3(p->tangent) = tangent; - normal3f_to_vector3(p->bitangent) = bitangent; - } - } - - p += strideY; - } - } -} - -void Patch::TesselateSubMatrix( const BezierCurveTree *BX, const BezierCurveTree *BY, - std::size_t offStartX, std::size_t offStartY, - std::size_t offEndX, std::size_t offEndY, - std::size_t nFlagsX, std::size_t nFlagsY, - Vector3& left, Vector3& mid, Vector3& right, - Vector2& texLeft, Vector2& texMid, Vector2& texRight, - bool bTranspose ) -{ - int newFlagsX, newFlagsY; - - Vector3 tmp; - Vector3 vertex_0_0, vertex_0_1, vertex_1_0, vertex_1_1, vertex_2_0, vertex_2_1; - Vector2 texTmp; - Vector2 texcoord_0_0, texcoord_0_1, texcoord_1_0, texcoord_1_1, texcoord_2_0, texcoord_2_1; - - { - // texcoords - - BezierInterpolate2( texcoord_for_index(m_tess.m_vertices, offStartX + offStartY), - texcoord_0_0, - texcoord_for_index(m_tess.m_vertices, BX->index + offStartY), - texcoord_0_1, - texcoord_for_index(m_tess.m_vertices, offEndX + offStartY) ); - - - BezierInterpolate2( texcoord_for_index(m_tess.m_vertices, offStartX + offEndY), - texcoord_2_0, - texcoord_for_index(m_tess.m_vertices, BX->index + offEndY), - texcoord_2_1, - texcoord_for_index(m_tess.m_vertices, offEndX + offEndY) ); - - texTmp = texMid; - - BezierInterpolate2(texLeft, - texcoord_1_0, - texTmp, - texcoord_1_1, - texRight); - - if(!BezierCurveTree_isLeaf(BY)) - { - texcoord_for_index(m_tess.m_vertices, BX->index + BY->index) = texTmp; - } - - - if(!BezierCurveTree_isLeaf(BX->left)) - { - texcoord_for_index(m_tess.m_vertices, BX->left->index + offStartY) = texcoord_0_0; - texcoord_for_index(m_tess.m_vertices, BX->left->index + offEndY) = texcoord_2_0; - - if(!BezierCurveTree_isLeaf(BY)) - { - texcoord_for_index(m_tess.m_vertices, BX->left->index + BY->index) = texcoord_1_0; - } - } - if(!BezierCurveTree_isLeaf(BX->right)) - { - texcoord_for_index(m_tess.m_vertices, BX->right->index + offStartY) = texcoord_0_1; - texcoord_for_index(m_tess.m_vertices, BX->right->index + offEndY) = texcoord_2_1; - - if(!BezierCurveTree_isLeaf(BY)) - { - texcoord_for_index(m_tess.m_vertices, BX->right->index + BY->index) = texcoord_1_1; - } - } - - - // verts - - BezierInterpolate3( vertex_for_index(m_tess.m_vertices, offStartX + offStartY), - vertex_0_0, - vertex_for_index(m_tess.m_vertices, BX->index + offStartY), - vertex_0_1, - vertex_for_index(m_tess.m_vertices, offEndX + offStartY) ); - - - BezierInterpolate3( vertex_for_index(m_tess.m_vertices, offStartX + offEndY), - vertex_2_0, - vertex_for_index(m_tess.m_vertices, BX->index + offEndY), - vertex_2_1, - vertex_for_index(m_tess.m_vertices, offEndX + offEndY) ); - - - tmp = mid; - - BezierInterpolate3( left, - vertex_1_0, - tmp, - vertex_1_1, - right ); - - if(!BezierCurveTree_isLeaf(BY)) - { - vertex_for_index(m_tess.m_vertices, BX->index + BY->index) = tmp; - } - - - if(!BezierCurveTree_isLeaf(BX->left)) - { - vertex_for_index(m_tess.m_vertices, BX->left->index + offStartY) = vertex_0_0; - vertex_for_index(m_tess.m_vertices, BX->left->index + offEndY) = vertex_2_0; - - if(!BezierCurveTree_isLeaf(BY)) - { - vertex_for_index(m_tess.m_vertices, BX->left->index + BY->index) = vertex_1_0; - } - } - if(!BezierCurveTree_isLeaf(BX->right)) - { - vertex_for_index(m_tess.m_vertices, BX->right->index + offStartY) = vertex_0_1; - vertex_for_index(m_tess.m_vertices, BX->right->index + offEndY) = vertex_2_1; - - if(!BezierCurveTree_isLeaf(BY)) - { - vertex_for_index(m_tess.m_vertices, BX->right->index + BY->index) = vertex_1_1; - } - } - - // normals - - if(nFlagsX & SPLIT) - { - ArbitraryMeshVertex a, b, c; - Vector3 tangentU; - - if(!(nFlagsX & DEGEN_0a) || !(nFlagsX & DEGEN_0b)) - { - tangentU = vector3_subtracted(vertex_0_1, vertex_0_0); - a.vertex = vertex3f_for_vector3(vertex_0_0); - a.texcoord = texcoord2f_for_vector2(texcoord_0_0); - c.vertex = vertex3f_for_vector3(vertex_0_1); - c.texcoord = texcoord2f_for_vector2(texcoord_0_1); - } - else if(!(nFlagsX & DEGEN_1a) || !(nFlagsX & DEGEN_1b)) - { - tangentU = vector3_subtracted(vertex_1_1, vertex_1_0); - a.vertex = vertex3f_for_vector3(vertex_1_0); - a.texcoord = texcoord2f_for_vector2(texcoord_1_0); - c.vertex = vertex3f_for_vector3(vertex_1_1); - c.texcoord = texcoord2f_for_vector2(texcoord_1_1); - } - else - { - tangentU = vector3_subtracted(vertex_2_1, vertex_2_0); - a.vertex = vertex3f_for_vector3(vertex_2_0); - a.texcoord = texcoord2f_for_vector2(texcoord_2_0); - c.vertex = vertex3f_for_vector3(vertex_2_1); - c.texcoord = texcoord2f_for_vector2(texcoord_2_1); - } - - Vector3 tangentV; - - if((nFlagsY & DEGEN_0a) && (nFlagsY & DEGEN_1a) && (nFlagsY & DEGEN_2a)) - { - tangentV = vector3_subtracted(vertex_for_index(m_tess.m_vertices, BX->index + offEndY), tmp); - b.vertex = vertex3f_for_vector3(tmp);//m_tess.m_vertices[BX->index + offEndY].vertex; - b.texcoord = texcoord2f_for_vector2(texTmp);//m_tess.m_vertices[BX->index + offEndY].texcoord; - } - else - { - tangentV = vector3_subtracted(tmp, vertex_for_index(m_tess.m_vertices, BX->index + offStartY)); - b.vertex = vertex3f_for_vector3(tmp);//m_tess.m_vertices[BX->index + offStartY].vertex; - b.texcoord = texcoord2f_for_vector2(texTmp); //m_tess.m_vertices[BX->index + offStartY].texcoord; - } - - - Vector3 normal, s, t; - ArbitraryMeshVertex& v = m_tess.m_vertices[offStartY + BX->index]; - Vector3& p = normal3f_to_vector3(v.normal); - Vector3& ps = normal3f_to_vector3(v.tangent); - Vector3& pt = normal3f_to_vector3(v.bitangent); - - if(bTranspose) - { - normal = vector3_cross(tangentV, tangentU); - } - else - { - normal = vector3_cross(tangentU, tangentV); - } - normalise_safe(normal); - - ArbitraryMeshTriangle_calcTangents(a, b, c, s, t); - normalise_safe(s); - normalise_safe(t); - - if(nFlagsX & AVERAGE) - { - p = vector3_normalised(vector3_added(p, normal)); - ps = vector3_normalised(vector3_added(ps, s)); - pt = vector3_normalised(vector3_added(pt, t)); - } - else - { - p = normal; - ps = s; - pt = t; - } - } - - { - ArbitraryMeshVertex a, b, c; - Vector3 tangentU; - - if(!(nFlagsX & DEGEN_2a) || !(nFlagsX & DEGEN_2b)) - { - tangentU = vector3_subtracted(vertex_2_1, vertex_2_0); - a.vertex = vertex3f_for_vector3(vertex_2_0); - a.texcoord = texcoord2f_for_vector2(texcoord_2_0); - c.vertex = vertex3f_for_vector3(vertex_2_1); - c.texcoord = texcoord2f_for_vector2(texcoord_2_1); - } - else if(!(nFlagsX & DEGEN_1a) || !(nFlagsX & DEGEN_1b)) - { - tangentU = vector3_subtracted(vertex_1_1, vertex_1_0); - a.vertex = vertex3f_for_vector3(vertex_1_0); - a.texcoord = texcoord2f_for_vector2(texcoord_1_0); - c.vertex = vertex3f_for_vector3(vertex_1_1); - c.texcoord = texcoord2f_for_vector2(texcoord_1_1); - } - else - { - tangentU = vector3_subtracted(vertex_0_1, vertex_0_0); - a.vertex = vertex3f_for_vector3(vertex_0_0); - a.texcoord = texcoord2f_for_vector2(texcoord_0_0); - c.vertex = vertex3f_for_vector3(vertex_0_1); - c.texcoord = texcoord2f_for_vector2(texcoord_0_1); - } - - Vector3 tangentV; - - if((nFlagsY & DEGEN_0b) && (nFlagsY & DEGEN_1b) && (nFlagsY & DEGEN_2b)) - { - tangentV = vector3_subtracted(tmp, vertex_for_index(m_tess.m_vertices, BX->index + offStartY)); - b.vertex = vertex3f_for_vector3(tmp);//m_tess.m_vertices[BX->index + offStartY].vertex; - b.texcoord = texcoord2f_for_vector2(texTmp);//m_tess.m_vertices[BX->index + offStartY].texcoord; - } - else - { - tangentV = vector3_subtracted(vertex_for_index(m_tess.m_vertices, BX->index + offEndY), tmp); - b.vertex = vertex3f_for_vector3(tmp);//m_tess.m_vertices[BX->index + offEndY].vertex; - b.texcoord = texcoord2f_for_vector2(texTmp);//m_tess.m_vertices[BX->index + offEndY].texcoord; - } - - ArbitraryMeshVertex& v = m_tess.m_vertices[offEndY+BX->index]; - Vector3& p = normal3f_to_vector3(v.normal); - Vector3& ps = normal3f_to_vector3(v.tangent); - Vector3& pt = normal3f_to_vector3(v.bitangent); - - if(bTranspose) - { - p = vector3_cross(tangentV, tangentU); - } - else - { - p = vector3_cross(tangentU, tangentV); - } - normalise_safe(p); - - ArbitraryMeshTriangle_calcTangents(a, b, c, ps, pt); - normalise_safe(ps); - normalise_safe(pt); - } - } - - - newFlagsX = newFlagsY = 0; - - if((nFlagsX & DEGEN_0a) && (nFlagsX & DEGEN_0b)) - { - newFlagsX |= DEGEN_0a; - newFlagsX |= DEGEN_0b; - } - if((nFlagsX & DEGEN_1a) && (nFlagsX & DEGEN_1b)) - { - newFlagsX |= DEGEN_1a; - newFlagsX |= DEGEN_1b; - } - if((nFlagsX & DEGEN_2a) && (nFlagsX & DEGEN_2b)) - { - newFlagsX |= DEGEN_2a; - newFlagsX |= DEGEN_2b; - } - if((nFlagsY & DEGEN_0a) && (nFlagsY & DEGEN_1a) && (nFlagsY & DEGEN_2a)) - { - newFlagsY |= DEGEN_0a; - newFlagsY |= DEGEN_1a; - newFlagsY |= DEGEN_2a; - } - if((nFlagsY & DEGEN_0b) && (nFlagsY & DEGEN_1b) && (nFlagsY & DEGEN_2b)) - { - newFlagsY |= DEGEN_0b; - newFlagsY |= DEGEN_1b; - newFlagsY |= DEGEN_2b; - } - - - //if((nFlagsX & DEGEN_0a) && (nFlagsX & DEGEN_1a) && (nFlagsX & DEGEN_2a)) { newFlagsX |= DEGEN_0a; newFlagsX |= DEGEN_1a; newFlagsX |= DEGEN_2a; } - //if((nFlagsX & DEGEN_0b) && (nFlagsX & DEGEN_1b) && (nFlagsX & DEGEN_2b)) { newFlagsX |= DEGEN_0b; newFlagsX |= DEGEN_1b; newFlagsX |= DEGEN_2b; } - - newFlagsX |= (nFlagsX & SPLIT); - newFlagsX |= (nFlagsX & AVERAGE); - - if(!BezierCurveTree_isLeaf(BY)) - { - { - int nTemp = newFlagsY; - - if((nFlagsY & DEGEN_0a) && (nFlagsY & DEGEN_0b)) - { - newFlagsY |= DEGEN_0a; - newFlagsY |= DEGEN_0b; - } - newFlagsY |= (nFlagsY & SPLIT); - newFlagsY |= (nFlagsY & AVERAGE); - - Vector3& p = vertex_for_index(m_tess.m_vertices, BX->index+BY->index); - Vector3 vTemp(p); - - Vector2& p2 = texcoord_for_index(m_tess.m_vertices, BX->index+BY->index); - Vector2 stTemp(p2); - - TesselateSubMatrix( BY, BX->left, - offStartY, offStartX, - offEndY, BX->index, - newFlagsY, newFlagsX, - vertex_0_0, vertex_1_0, vertex_2_0, - texcoord_0_0, texcoord_1_0, texcoord_2_0, - !bTranspose ); - - newFlagsY = nTemp; - p = vTemp; - p2 = stTemp; - } - - if((nFlagsY & DEGEN_2a) && (nFlagsY & DEGEN_2b)) { newFlagsY |= DEGEN_2a; newFlagsY |= DEGEN_2b; } - - TesselateSubMatrix( BY, BX->right, - offStartY, BX->index, - offEndY, offEndX, - newFlagsY, newFlagsX, - vertex_0_1, vertex_1_1, vertex_2_1, - texcoord_0_1, texcoord_1_1, texcoord_2_1, - !bTranspose ); - } - else - { - if(!BezierCurveTree_isLeaf(BX->left)) - { - TesselateSubMatrix( BX->left, BY, - offStartX, offStartY, - BX->index, offEndY, - newFlagsX, newFlagsY, - left, vertex_1_0, tmp, - texLeft, texcoord_1_0, texTmp, - bTranspose ); - } - - if(!BezierCurveTree_isLeaf(BX->right)) - { - TesselateSubMatrix( BX->right, BY, - BX->index, offStartY, - offEndX, offEndY, - newFlagsX, newFlagsY, - tmp, vertex_1_1, right, - texTmp, texcoord_1_1, texRight, - bTranspose ); - } - } - -} - -void Patch::BuildTesselationCurves(EMatrixMajor major) -{ - std::size_t nArrayStride, length, cross, strideU, strideV; - switch(major) - { - case ROW: - nArrayStride = 1; - length = (m_width - 1) >> 1; - cross = m_height; - strideU = 1; - strideV = m_width; - - if(!m_patchDef3) - { - BezierCurveTreeArray_deleteAll(m_tess.m_curveTreeU); - } - - break; - case COL: - nArrayStride = m_tess.m_nArrayWidth; - length = (m_height - 1) >> 1; - cross = m_width; - strideU = m_width; - strideV = 1; - - if(!m_patchDef3) - { - BezierCurveTreeArray_deleteAll(m_tess.m_curveTreeV); - } - - break; - default: - ERROR_MESSAGE("neither row-major nor column-major"); - return; - } - - Array arrayLength(length); - Array pCurveTree(length); - - std::size_t nArrayLength = 1; - - if(m_patchDef3) - { - for(Array::iterator i = arrayLength.begin(); i != arrayLength.end(); ++i) - { - *i = Array::value_type((major == ROW) ? m_subdivisions_x : m_subdivisions_y); - nArrayLength += *i; - } - } - else - { - // create a list of the horizontal control curves in each column of sub-patches - // adaptively tesselate each horizontal control curve in the list - // create a binary tree representing the combined tesselation of the list - for(std::size_t i = 0; i != length; ++i) - { - PatchControl* p1 = m_ctrlTransformed.data() + (i * 2 * strideU); - GSList* pCurveList = 0; - for(std::size_t j = 0; j < cross; j += 2) - { - PatchControl* p2 = p1+strideV; - PatchControl* p3 = p2+strideV; - - // directly taken from one row of control points - { - BezierCurve* pCurve = new BezierCurve; - pCurve->crd = (p1+strideU)->m_vertex; - pCurve->left = p1->m_vertex; - pCurve->right = (p1+(strideU<<1))->m_vertex; - pCurveList = g_slist_prepend(pCurveList, pCurve); - } - - if(j+2 >= cross) - { - break; - } - - // interpolated from three columns of control points - { - BezierCurve* pCurve = new BezierCurve; - pCurve->crd = vector3_mid((p1+strideU)->m_vertex, (p3+strideU)->m_vertex); - pCurve->left = vector3_mid(p1->m_vertex, p3->m_vertex); - pCurve->right = vector3_mid((p1+(strideU<<1))->m_vertex, (p3+(strideU<<1))->m_vertex); - - pCurve->crd = vector3_mid(pCurve->crd, (p2+strideU)->m_vertex); - pCurve->left = vector3_mid(pCurve->left, p2->m_vertex); - pCurve->right = vector3_mid(pCurve->right, (p2+(strideU<<1))->m_vertex); - pCurveList = g_slist_prepend(pCurveList, pCurve); - } - - p1 = p3; - } - - pCurveTree[i] = new BezierCurveTree; - BezierCurveTree_FromCurveList(pCurveTree[i], pCurveList); - for(GSList* l = pCurveList; l != 0; l = g_slist_next(l)) - { - delete static_cast((*l).data); - } - g_slist_free(pCurveList); - - // set up array indices for binary tree - // accumulate subarray width - arrayLength[i] = Array::value_type(BezierCurveTree_Setup(pCurveTree[i], nArrayLength, nArrayStride) - (nArrayLength - 1)); - // accumulate total array width - nArrayLength += arrayLength[i]; - } - } - - switch(major) - { - case ROW: - m_tess.m_nArrayWidth = nArrayLength; - std::swap(m_tess.m_arrayWidth, arrayLength); - - if(!m_patchDef3) - { - std::swap(m_tess.m_curveTreeU, pCurveTree); - } - break; - case COL: - m_tess.m_nArrayHeight = nArrayLength; - std::swap(m_tess.m_arrayHeight, arrayLength); - - if(!m_patchDef3) - { - std::swap(m_tess.m_curveTreeV, pCurveTree); - } - break; - } -} - -inline void vertex_assign_ctrl(ArbitraryMeshVertex& vertex, const PatchControl& ctrl) -{ - vertex.vertex = vertex3f_for_vector3(ctrl.m_vertex); - vertex.texcoord = texcoord2f_for_vector2(ctrl.m_texcoord); -} - -inline void vertex_clear_normal(ArbitraryMeshVertex& vertex) -{ - vertex.normal = Normal3f(0, 0, 0); - vertex.tangent = Normal3f(0, 0, 0); - vertex.bitangent = Normal3f(0, 0, 0); -} - -inline void tangents_remove_degenerate(Vector3 tangents[6], Vector2 textureTangents[6], unsigned int flags) -{ - if(flags & DEGEN_0a) - { - const std::size_t i = - (flags & DEGEN_0b) - ? (flags & DEGEN_1a) - ? (flags & DEGEN_1b) - ? (flags & DEGEN_2a) - ? 5 - : 4 - : 3 - : 2 - : 1; - tangents[0] = tangents[i]; - textureTangents[0] = textureTangents[i]; - } - if(flags & DEGEN_0b) - { - const std::size_t i = - (flags & DEGEN_0a) - ? (flags & DEGEN_1b) - ? (flags & DEGEN_1a) - ? (flags & DEGEN_2b) - ? 4 - : 5 - : 2 - : 3 - : 0; - tangents[1] = tangents[i]; - textureTangents[1] = textureTangents[i]; - } - if(flags & DEGEN_2a) - { - const std::size_t i = - (flags & DEGEN_2b) - ? (flags & DEGEN_1a) - ? (flags & DEGEN_1b) - ? (flags & DEGEN_0a) - ? 1 - : 0 - : 3 - : 2 - : 5; - tangents[4] = tangents[i]; - textureTangents[4] = textureTangents[i]; - } - if(flags & DEGEN_2b) - { - const std::size_t i = - (flags & DEGEN_2a) - ? (flags & DEGEN_1b) - ? (flags & DEGEN_1a) - ? (flags & DEGEN_0b) - ? 0 - : 1 - : 2 - : 3 - : 4; - tangents[5] = tangents[i]; - textureTangents[5] = textureTangents[i]; - } -} - -void bestTangents00(unsigned int degenerateFlags, double dot, double length, std::size_t& index0, std::size_t& index1) -{ - if(fabs(dot + length) < 0.001) // opposing direction = degenerate - { - if(!(degenerateFlags & DEGEN_1a)) // if this tangent is degenerate we cannot use it - { - index0 = 2; - index1 = 0; - } - else if(!(degenerateFlags & DEGEN_0b)) - { - index0 = 0; - index1 = 1; - } - else - { - index0 = 1; - index1 = 0; - } - } - else if(fabs(dot - length) < 0.001) // same direction = degenerate - { - if(degenerateFlags & DEGEN_0b) - { - index0 = 0; - index1 = 1; - } - else - { - index0 = 1; - index1 = 0; - } - } -} - -void bestTangents01(unsigned int degenerateFlags, double dot, double length, std::size_t& index0, std::size_t& index1) -{ - if(fabs(dot - length) < 0.001) // same direction = degenerate - { - if(!(degenerateFlags & DEGEN_1a)) // if this tangent is degenerate we cannot use it - { - index0 = 2; - index1 = 1; - } - else if(!(degenerateFlags & DEGEN_2b)) - { - index0 = 4; - index1 = 0; - } - else - { - index0 = 5; - index1 = 1; - } - } - else if(fabs(dot + length) < 0.001) // opposing direction = degenerate - { - if(degenerateFlags & DEGEN_2b) - { - index0 = 4; - index1 = 0; - } - else - { - index0 = 5; - index1 = 1; - } - } -} - -void bestTangents10(unsigned int degenerateFlags, double dot, double length, std::size_t& index0, std::size_t& index1) -{ - if(fabs(dot - length) < 0.001) // same direction = degenerate - { - if(!(degenerateFlags & DEGEN_1b)) // if this tangent is degenerate we cannot use it - { - index0 = 3; - index1 = 4; - } - else if(!(degenerateFlags & DEGEN_0a)) - { - index0 = 1; - index1 = 5; - } - else - { - index0 = 0; - index1 = 4; - } - } - else if(fabs(dot + length) < 0.001) // opposing direction = degenerate - { - if(degenerateFlags & DEGEN_0a) - { - index0 = 1; - index1 = 5; - } - else - { - index0 = 0; - index1 = 4; - } - } -} - -void bestTangents11(unsigned int degenerateFlags, double dot, double length, std::size_t& index0, std::size_t& index1) -{ - if(fabs(dot + length) < 0.001) // opposing direction = degenerate - { - if(!(degenerateFlags & DEGEN_1b)) // if this tangent is degenerate we cannot use it - { - index0 = 3; - index1 = 5; - } - else if(!(degenerateFlags & DEGEN_2a)) - { - index0 = 5; - index1 = 4; - } - else - { - index0 = 4; - index1 = 5; - } - } - else if(fabs(dot - length) < 0.001) // same direction = degenerate - { - if(degenerateFlags & DEGEN_2a) - { - index0 = 5; - index1 = 4; - } - else - { - index0 = 4; - index1 = 5; - } - } -} - -void Patch::accumulateVertexTangentSpace(std::size_t index, Vector3 tangentX[6], Vector3 tangentY[6], Vector2 tangentS[6], Vector2 tangentT[6], std::size_t index0, std::size_t index1) -{ - { - Vector3 normal(vector3_cross(tangentX[index0], tangentY[index1])); - if(!vector3_equal(normal, g_vector3_identity)) - { - vector3_add(normal_for_index(m_tess.m_vertices, index), vector3_normalised(normal)); - } - } - - { - ArbitraryMeshVertex a, b, c; - a.vertex = Vertex3f(0, 0, 0); - a.texcoord = TexCoord2f(0, 0); - b.vertex = vertex3f_for_vector3(tangentX[index0]); - b.texcoord = texcoord2f_for_vector2(tangentS[index0]); - c.vertex = vertex3f_for_vector3(tangentY[index1]); - c.texcoord = texcoord2f_for_vector2(tangentT[index1]); - - Vector3 s, t; - ArbitraryMeshTriangle_calcTangents(a, b, c, s, t); - if(!vector3_equal(s, g_vector3_identity)) - { - vector3_add(tangent_for_index(m_tess.m_vertices, index), vector3_normalised(s)); - } - if(!vector3_equal(t, g_vector3_identity)) - { - vector3_add(bitangent_for_index(m_tess.m_vertices, index), vector3_normalised(t)); - } - } -} - -const std::size_t PATCH_MAX_VERTEX_ARRAY = 1048576; - -void Patch::BuildVertexArray() -{ - const std::size_t strideU = 1; - const std::size_t strideV = m_width; - - const std::size_t numElems = m_tess.m_nArrayWidth*m_tess.m_nArrayHeight; // total number of elements in vertex array - - const bool bWidthStrips = (m_tess.m_nArrayWidth >= m_tess.m_nArrayHeight); // decide if horizontal strips are longer than vertical - - - // allocate vertex, normal, texcoord and primitive-index arrays - m_tess.m_vertices.resize(numElems); - m_tess.m_indices.resize(m_tess.m_nArrayWidth *2 * (m_tess.m_nArrayHeight - 1)); - - // set up strip indices - if(bWidthStrips) - { - m_tess.m_numStrips = m_tess.m_nArrayHeight-1; - m_tess.m_lenStrips = m_tess.m_nArrayWidth*2; - - for(std::size_t i=0; i>1]); - const std::size_t offMidY = (m_patchDef3) ? 0 : m_tess.m_curveTreeV[j>>1]->index; - const std::size_t widthY = m_tess.m_arrayHeight[j>>1] * m_tess.m_nArrayWidth; - const std::size_t offEndY = offStartY + widthY; - - for(std::size_t i = 0, offStartX = 0; i+1 < m_width; i += 2, pCtrl += (strideU << 1)) - { - const bool leafX = (m_patchDef3) ? false : BezierCurveTree_isLeaf(m_tess.m_curveTreeU[i>>1]); - const std::size_t offMidX = (m_patchDef3) ? 0 : m_tess.m_curveTreeU[i>>1]->index; - const std::size_t widthX = m_tess.m_arrayWidth[i>>1]; - const std::size_t offEndX = offStartX + widthX; - - PatchControl *subMatrix[3][3]; - subMatrix[0][0] = pCtrl; - subMatrix[0][1] = subMatrix[0][0]+strideU; - subMatrix[0][2] = subMatrix[0][1]+strideU; - subMatrix[1][0] = subMatrix[0][0]+strideV; - subMatrix[1][1] = subMatrix[1][0]+strideU; - subMatrix[1][2] = subMatrix[1][1]+strideU; - subMatrix[2][0] = subMatrix[1][0]+strideV; - subMatrix[2][1] = subMatrix[2][0]+strideU; - subMatrix[2][2] = subMatrix[2][1]+strideU; - - // assign on-patch control points to vertex array - if(i == 0 && j == 0) - { - vertex_clear_normal(m_tess.m_vertices[offStartX + offStartY]); - } - vertex_assign_ctrl(m_tess.m_vertices[offStartX + offStartY], *subMatrix[0][0]); - if(j == 0) - { - vertex_clear_normal(m_tess.m_vertices[offEndX + offStartY]); - } - vertex_assign_ctrl(m_tess.m_vertices[offEndX + offStartY], *subMatrix[0][2]); - if(i == 0) - { - vertex_clear_normal(m_tess.m_vertices[offStartX + offEndY]); - } - vertex_assign_ctrl(m_tess.m_vertices[offStartX + offEndY], *subMatrix[2][0]); - - vertex_clear_normal(m_tess.m_vertices[offEndX + offEndY]); - vertex_assign_ctrl(m_tess.m_vertices[offEndX + offEndY], *subMatrix[2][2]); - - if(!m_patchDef3) - { - // assign remaining control points to vertex array - if(!leafX) - { - vertex_assign_ctrl(m_tess.m_vertices[offMidX + offStartY], *subMatrix[0][1]); - vertex_assign_ctrl(m_tess.m_vertices[offMidX + offEndY], *subMatrix[2][1]); - } - if(!leafY) - { - vertex_assign_ctrl(m_tess.m_vertices[offStartX + offMidY], *subMatrix[1][0]); - vertex_assign_ctrl(m_tess.m_vertices[offEndX + offMidY], *subMatrix[1][2]); - - if(!leafX) - { - vertex_assign_ctrl(m_tess.m_vertices[offMidX + offMidY], *subMatrix[1][1]); - } - } - } - - // test all 12 edges for degeneracy - unsigned int nFlagsX = subarray_get_degen(pCtrl, strideU, strideV); - unsigned int nFlagsY = subarray_get_degen(pCtrl, strideV, strideU); - Vector3 tangentX[6], tangentY[6]; - Vector2 tangentS[6], tangentT[6]; - - // set up tangents for each of the 12 edges if they were not degenerate - if(!(nFlagsX & DEGEN_0a)) - { - tangentX[0] = vector3_subtracted(subMatrix[0][1]->m_vertex, subMatrix[0][0]->m_vertex); - tangentS[0] = vector2_subtracted(subMatrix[0][1]->m_texcoord, subMatrix[0][0]->m_texcoord); - } - if(!(nFlagsX & DEGEN_0b)) - { - tangentX[1] = vector3_subtracted(subMatrix[0][2]->m_vertex, subMatrix[0][1]->m_vertex); - tangentS[1] = vector2_subtracted(subMatrix[0][2]->m_texcoord, subMatrix[0][1]->m_texcoord); - } - if(!(nFlagsX & DEGEN_1a)) - { - tangentX[2] = vector3_subtracted(subMatrix[1][1]->m_vertex, subMatrix[1][0]->m_vertex); - tangentS[2] = vector2_subtracted(subMatrix[1][1]->m_texcoord, subMatrix[1][0]->m_texcoord); - } - if(!(nFlagsX & DEGEN_1b)) - { - tangentX[3] = vector3_subtracted(subMatrix[1][2]->m_vertex, subMatrix[1][1]->m_vertex); - tangentS[3] = vector2_subtracted(subMatrix[1][2]->m_texcoord, subMatrix[1][1]->m_texcoord); - } - if(!(nFlagsX & DEGEN_2a)) - { - tangentX[4] = vector3_subtracted(subMatrix[2][1]->m_vertex, subMatrix[2][0]->m_vertex); - tangentS[4] = vector2_subtracted(subMatrix[2][1]->m_texcoord, subMatrix[2][0]->m_texcoord); - } - if(!(nFlagsX & DEGEN_2b)) - { - tangentX[5] = vector3_subtracted(subMatrix[2][2]->m_vertex, subMatrix[2][1]->m_vertex); - tangentS[5] = vector2_subtracted(subMatrix[2][2]->m_texcoord, subMatrix[2][1]->m_texcoord); - } - - if(!(nFlagsY & DEGEN_0a)) - { - tangentY[0] = vector3_subtracted(subMatrix[1][0]->m_vertex, subMatrix[0][0]->m_vertex); - tangentT[0] = vector2_subtracted(subMatrix[1][0]->m_texcoord, subMatrix[0][0]->m_texcoord); - } - if(!(nFlagsY & DEGEN_0b)) - { - tangentY[1] = vector3_subtracted(subMatrix[2][0]->m_vertex, subMatrix[1][0]->m_vertex); - tangentT[1] = vector2_subtracted(subMatrix[2][0]->m_texcoord, subMatrix[1][0]->m_texcoord); - } - if(!(nFlagsY & DEGEN_1a)) - { - tangentY[2] = vector3_subtracted(subMatrix[1][1]->m_vertex, subMatrix[0][1]->m_vertex); - tangentT[2] = vector2_subtracted(subMatrix[1][1]->m_texcoord, subMatrix[0][1]->m_texcoord); - } - if(!(nFlagsY & DEGEN_1b)) - { - tangentY[3] = vector3_subtracted(subMatrix[2][1]->m_vertex, subMatrix[1][1]->m_vertex); - tangentT[3] = vector2_subtracted(subMatrix[2][1]->m_texcoord, subMatrix[1][1]->m_texcoord); - } - if(!(nFlagsY & DEGEN_2a)) - { - tangentY[4] = vector3_subtracted(subMatrix[1][2]->m_vertex, subMatrix[0][2]->m_vertex); - tangentT[4] = vector2_subtracted(subMatrix[1][2]->m_texcoord, subMatrix[0][2]->m_texcoord); - } - if(!(nFlagsY & DEGEN_2b)) - { - tangentY[5] = vector3_subtracted(subMatrix[2][2]->m_vertex, subMatrix[1][2]->m_vertex); - tangentT[5] = vector2_subtracted(subMatrix[2][2]->m_texcoord, subMatrix[1][2]->m_texcoord); - } - - // set up remaining edge tangents by borrowing the tangent from the closest parallel non-degenerate edge - tangents_remove_degenerate(tangentX, tangentS, nFlagsX); - tangents_remove_degenerate(tangentY, tangentT, nFlagsY); - - { - // x=0, y=0 - std::size_t index = offStartX + offStartY; - std::size_t index0 = 0; - std::size_t index1 = 0; - - double dot = vector3_dot(tangentX[index0], tangentY[index1]); - double length = vector3_length(tangentX[index0]) * vector3_length(tangentY[index1]); - - bestTangents00(nFlagsX, dot, length, index0, index1); - - accumulateVertexTangentSpace(index, tangentX, tangentY, tangentS, tangentT, index0, index1); - } - - { - // x=1, y=0 - std::size_t index = offEndX + offStartY; - std::size_t index0 = 1; - std::size_t index1 = 4; - - double dot = vector3_dot(tangentX[index0],tangentY[index1]); - double length = vector3_length(tangentX[index0]) * vector3_length(tangentY[index1]); - - bestTangents10(nFlagsX, dot, length, index0, index1); - - accumulateVertexTangentSpace(index, tangentX, tangentY, tangentS, tangentT, index0, index1); - } - - { - // x=0, y=1 - std::size_t index = offStartX + offEndY; - std::size_t index0 = 4; - std::size_t index1 = 1; - - double dot = vector3_dot(tangentX[index0], tangentY[index1]); - double length = vector3_length(tangentX[index1]) * vector3_length(tangentY[index1]); - - bestTangents01(nFlagsX, dot, length, index0, index1); - - accumulateVertexTangentSpace(index, tangentX, tangentY, tangentS, tangentT, index0, index1); - } - - { - // x=1, y=1 - std::size_t index = offEndX + offEndY; - std::size_t index0 = 5; - std::size_t index1 = 5; - - double dot = vector3_dot(tangentX[index0],tangentY[index1]); - double length = vector3_length(tangentX[index0]) * vector3_length(tangentY[index1]); - - bestTangents11(nFlagsX, dot, length, index0, index1); - - accumulateVertexTangentSpace(index, tangentX, tangentY, tangentS, tangentT, index0, index1); - } - - //normalise normals that won't be accumulated again - if(i!=0 || j!=0) - { - normalise_safe(normal_for_index(m_tess.m_vertices, offStartX + offStartY)); - normalise_safe(tangent_for_index(m_tess.m_vertices, offStartX + offStartY)); - normalise_safe(bitangent_for_index(m_tess.m_vertices, offStartX + offStartY)); - } - if(i+3 == m_width) - { - normalise_safe(normal_for_index(m_tess.m_vertices, offEndX + offStartY)); - normalise_safe(tangent_for_index(m_tess.m_vertices, offEndX + offStartY)); - normalise_safe(bitangent_for_index(m_tess.m_vertices, offEndX + offStartY)); - } - if(j+3 == m_height) - { - normalise_safe(normal_for_index(m_tess.m_vertices, offStartX + offEndY)); - normalise_safe(tangent_for_index(m_tess.m_vertices, offStartX + offEndY)); - normalise_safe(bitangent_for_index(m_tess.m_vertices, offStartX + offEndY)); - } - if(i+3 == m_width && j+3 == m_height) - { - normalise_safe(normal_for_index(m_tess.m_vertices, offEndX + offEndY)); - normalise_safe(tangent_for_index(m_tess.m_vertices, offEndX + offEndY)); - normalise_safe(bitangent_for_index(m_tess.m_vertices, offEndX + offEndY)); - } - - // set flags to average normals between shared edges - if(j != 0) - { - nFlagsX |= AVERAGE; - } - if(i != 0) - { - nFlagsY |= AVERAGE; - } - // set flags to save evaluating shared edges twice - nFlagsX |= SPLIT; - nFlagsY |= SPLIT; - - // if the patch is curved.. tesselate recursively - // use the relevant control curves for this sub-patch - if(m_patchDef3) - { - TesselateSubMatrixFixed(m_tess.m_vertices.data() + offStartX + offStartY, 1, m_tess.m_nArrayWidth, nFlagsX, nFlagsY, subMatrix); - } - else - { - if(!leafX) - { - TesselateSubMatrix( m_tess.m_curveTreeU[i>>1], m_tess.m_curveTreeV[j>>1], - offStartX, offStartY, offEndX, offEndY, // array offsets - nFlagsX, nFlagsY, - subMatrix[1][0]->m_vertex, subMatrix[1][1]->m_vertex, subMatrix[1][2]->m_vertex, - subMatrix[1][0]->m_texcoord, subMatrix[1][1]->m_texcoord, subMatrix[1][2]->m_texcoord, - false ); - } - else if(!leafY) - { - TesselateSubMatrix( m_tess.m_curveTreeV[j>>1], m_tess.m_curveTreeU[i>>1], - offStartY, offStartX, offEndY, offEndX, // array offsets - nFlagsY, nFlagsX, - subMatrix[0][1]->m_vertex, subMatrix[1][1]->m_vertex, subMatrix[2][1]->m_vertex, - subMatrix[0][1]->m_texcoord, subMatrix[1][1]->m_texcoord, subMatrix[2][1]->m_texcoord, - true ); - } - } - - offStartX = offEndX; - } - offStartY = offEndY; - } - } -} - - - -class PatchFilterWrapper : public Filter -{ - bool m_active; - bool m_invert; - PatchFilter& m_filter; -public: - PatchFilterWrapper(PatchFilter& filter, bool invert) : m_invert(invert), m_filter(filter) - { - } - void setActive(bool active) - { - m_active = active; - } - bool active() - { - return m_active; - } - bool filter(const Patch& patch) - { - return m_invert ^ m_filter.filter(patch); - } -}; - - -typedef std::list PatchFilters; -PatchFilters g_patchFilters; - -void add_patch_filter(PatchFilter& filter, int mask, bool invert) -{ - g_patchFilters.push_back(PatchFilterWrapper(filter, invert)); - GlobalFilterSystem().addFilter(g_patchFilters.back(), mask); -} - -bool patch_filtered(Patch& patch) -{ - for(PatchFilters::iterator i = g_patchFilters.begin(); i != g_patchFilters.end(); ++i) - { - if((*i).active() && (*i).filter(patch)) - { - return true; - } - } - return false; -} diff --git a/radiant/patch.h b/radiant/patch.h deleted file mode 100644 index ddbbffbd..00000000 --- a/radiant/patch.h +++ /dev/null @@ -1,2070 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PATCH_H) -#define INCLUDED_PATCH_H - -/// \file -/// \brief The patch primitive. -/// -/// A 2-dimensional matrix of vertices that define a quadratic bezier surface. -/// The Boundary-Representation of this primitive is a triangle mesh. -/// The surface is recursively tesselated until the angle between each triangle -/// edge is smaller than a specified tolerance. - - -#include "nameable.h" -#include "ifilter.h" -#include "imap.h" -#include "ipatch.h" -#include "cullable.h" -#include "renderable.h" -#include "editable.h" -#include "selectable.h" - -#include "debugging/debugging.h" - -#include -#include - -#include "math/frustum.h" -#include "string/string.h" -#include "stream/stringstream.h" -#include "stream/textstream.h" -#include "xml/xmlelement.h" -#include "scenelib.h" -#include "transformlib.h" -#include "instancelib.h" -#include "selectionlib.h" -#include "traverselib.h" -#include "render.h" -#include "stringio.h" -#include "shaderlib.h" -#include "generic/callback.h" -#include "signal/signalfwd.h" -#include "texturelib.h" -#include "xml/ixml.h" -#include "dragplanes.h" - -enum EPatchType -{ - ePatchTypeQuake3, - ePatchTypeDoom3, -}; - -extern int g_PatchSubdivideThreshold; - - -#define MIN_PATCH_WIDTH 3 -#define MIN_PATCH_HEIGHT 3 - -extern std::size_t MAX_PATCH_WIDTH; -extern std::size_t MAX_PATCH_HEIGHT; - -#define MAX_PATCH_ROWCTRL (((MAX_PATCH_WIDTH-1)-1)/2) -#define MAX_PATCH_COLCTRL (((MAX_PATCH_HEIGHT-1)-1)/2) - -enum EPatchCap -{ - eCapBevel, - eCapEndCap, - eCapIBevel, - eCapIEndCap, - eCapCylinder, -}; - -enum EPatchPrefab -{ - ePlane, - eBevel, - eEndCap, - eCylinder, - eDenseCylinder, - eVeryDenseCylinder, - eSqCylinder, - eCone, - eSphere, -}; - -enum EMatrixMajor -{ - ROW, COL, -}; - -struct BezierCurve -{ - Vector3 crd; - Vector3 left; - Vector3 right; -}; - -const std::size_t BEZIERCURVETREE_MAX_INDEX = std::size_t(1) << (std::numeric_limits::digits - 1); - -struct BezierCurveTree -{ - std::size_t index; - BezierCurveTree* left; - BezierCurveTree* right; -}; - -inline bool BezierCurveTree_isLeaf(const BezierCurveTree* node) -{ - return node->left == 0 && node->right == 0; -} - -void BezierCurveTree_Delete(BezierCurveTree *pCurve); - - -inline VertexPointer vertexpointer_arbitrarymeshvertex(const ArbitraryMeshVertex* array) -{ - return VertexPointer(VertexPointer::pointer(&array->vertex), sizeof(ArbitraryMeshVertex)); -} - -typedef PatchControl* PatchControlIter; -typedef const PatchControl* PatchControlConstIter; - -inline void copy_ctrl(PatchControlIter ctrl, PatchControlConstIter begin, PatchControlConstIter end) -{ - std::copy(begin, end, ctrl); -} - -const Colour4b colour_corner(0, 255, 0, 255); -const Colour4b colour_inside(255, 0, 255, 255); - -class Patch; - -class PatchFilter -{ -public: - virtual bool filter(const Patch& patch) const = 0; -}; - -bool patch_filtered(Patch& patch); -void add_patch_filter(PatchFilter& filter, int mask, bool invert = false); - -void Patch_addTextureChangedCallback(const SignalHandler& handler); -void Patch_textureChanged(); - -inline void BezierCurveTreeArray_deleteAll(Array& curveTrees) -{ - for(Array::iterator i = curveTrees.begin(); i != curveTrees.end(); ++i) - { - BezierCurveTree_Delete(*i); - } -} - -inline void PatchControlArray_invert(Array& ctrl, std::size_t width, std::size_t height) -{ - Array tmp(width); - - PatchControlIter from = ctrl.data() + (width * (height - 1)); - PatchControlIter to = ctrl.data(); - for(std::size_t h = 0; h != ((height - 1) >> 1); ++h, to += width, from -= width) - { - copy_ctrl(tmp.data(), to, to + width); - copy_ctrl(to, from, from + width); - copy_ctrl(from, tmp.data(), tmp.data() + width); - } -} - -class PatchTesselation -{ -public: - PatchTesselation() - : m_numStrips(0), m_lenStrips(0), m_nArrayWidth(0), m_nArrayHeight(0) - { - } - Array m_vertices; - Array m_indices; - std::size_t m_numStrips; - std::size_t m_lenStrips; - - Array m_arrayWidth; - std::size_t m_nArrayWidth; - Array m_arrayHeight; - std::size_t m_nArrayHeight; - - Array m_curveTreeU; - Array m_curveTreeV; -}; - -class RenderablePatchWireframe : public OpenGLRenderable -{ - PatchTesselation& m_tess; -public: - RenderablePatchWireframe(PatchTesselation& tess) : m_tess(tess) - { - } - void render(RenderStateFlags state) const - { - { - #if NV_DRIVER_BUG - glVertexPointer(3, GL_FLOAT, 0, 0); - glDrawArrays(GL_TRIANGLE_FAN, 0, 0); - #endif - - std::size_t n = 0; - glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->vertex); - for(std::size_t i = 0; i <= m_tess.m_curveTreeV.size(); ++i) - { - glDrawArrays(GL_LINE_STRIP, GLint(n), GLsizei(m_tess.m_nArrayWidth)); - - if(i == m_tess.m_curveTreeV.size()) break; - - if(!BezierCurveTree_isLeaf(m_tess.m_curveTreeV[i])) - glDrawArrays(GL_LINE_STRIP, GLint(m_tess.m_curveTreeV[i]->index), GLsizei(m_tess.m_nArrayWidth)); - - n += (m_tess.m_arrayHeight[i]*m_tess.m_nArrayWidth); - - } - } - - { - const ArbitraryMeshVertex* p = m_tess.m_vertices.data(); - std::size_t n = m_tess.m_nArrayWidth * sizeof(ArbitraryMeshVertex); - for(std::size_t i = 0; i <= m_tess.m_curveTreeU.size(); ++i) - { - glVertexPointer(3, GL_FLOAT, GLsizei(n), &p->vertex); - glDrawArrays(GL_LINE_STRIP, 0, GLsizei(m_tess.m_nArrayHeight)); - - if(i == m_tess.m_curveTreeU.size()) break; - - if(!BezierCurveTree_isLeaf(m_tess.m_curveTreeU[i])) - { - glVertexPointer(3, GL_FLOAT, GLsizei(n), &(m_tess.m_vertices.data() + (m_tess.m_curveTreeU[i]->index))->vertex); - glDrawArrays(GL_LINE_STRIP, 0, GLsizei(m_tess.m_nArrayHeight)); - } - - p += m_tess.m_arrayWidth[i]; - } - } - } -}; - -class RenderablePatchFixedWireframe : public OpenGLRenderable -{ - PatchTesselation& m_tess; -public: - RenderablePatchFixedWireframe(PatchTesselation& tess) : m_tess(tess) - { - } - void render(RenderStateFlags state) const - { - glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->vertex); - const RenderIndex* strip_indices = m_tess.m_indices.data(); - for(std::size_t i = 0; inormal); - glVertexAttribPointerARB(c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->texcoord); - glVertexAttribPointerARB(c_attr_Tangent, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->tangent); - glVertexAttribPointerARB(c_attr_Binormal, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->bitangent); - } - else - { - glVertexAttribPointerARB(11, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->normal); - glVertexAttribPointerARB(8, 2, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->texcoord); - glVertexAttribPointerARB(9, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->tangent); - glVertexAttribPointerARB(10, 3, GL_FLOAT, 0, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->bitangent); - } - } - else - { - glNormalPointer(GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->normal); - glTexCoordPointer(2, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->texcoord); - } - glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->vertex); - const RenderIndex* strip_indices = m_tess.m_indices.data(); - for(std::size_t i = 0; i m_xml_state; - - typedef Array PatchControlArray; - - class SavedState : public UndoMemento - { - public: - SavedState( - std::size_t width, - std::size_t height, - const PatchControlArray& ctrl, - const char* shader, - bool patchDef3, - std::size_t subdivisions_x, - std::size_t subdivisions_y - ) : - m_width(width), - m_height(height), - m_shader(shader), - m_ctrl(ctrl), - m_patchDef3(patchDef3), - m_subdivisions_x(subdivisions_x), - m_subdivisions_y(subdivisions_y) - { - } - - void release() - { - delete this; - } - - std::size_t m_width, m_height; - CopiedString m_shader; - PatchControlArray m_ctrl; - bool m_patchDef3; - std::size_t m_subdivisions_x; - std::size_t m_subdivisions_y; - }; - -public: - class Observer - { - public: - virtual void allocate(std::size_t size) = 0; - }; - -private: - typedef UniqueSet Observers; - Observers m_observers; - - scene::Node* m_node; - - AABB m_aabb_local; // local bbox - - CopiedString m_shader; - Shader* m_state; - - std::size_t m_width; - std::size_t m_height; -public: - bool m_patchDef3; - std::size_t m_subdivisions_x; - std::size_t m_subdivisions_y; -private: - - UndoObserver* m_undoable_observer; - MapFile* m_map; - - // dynamically allocated array of control points, size is m_width*m_height - PatchControlArray m_ctrl; - PatchControlArray m_ctrlTransformed; - - PatchTesselation m_tess; - RenderablePatchSolid m_render_solid; - RenderablePatchWireframe m_render_wireframe; - RenderablePatchFixedWireframe m_render_wireframe_fixed; - - static Shader* m_state_ctrl; - static Shader* m_state_lattice; - VertexBuffer m_ctrl_vertices; - RenderableVertexBuffer m_render_ctrl; - IndexBuffer m_lattice_indices; - RenderableIndexBuffer m_render_lattice; - - bool m_bOverlay; - - bool m_transformChanged; - Callback m_evaluateTransform; - Callback m_boundsChanged; - - void construct() - { - m_bOverlay = false; - m_width = m_height = 0; - - m_patchDef3 = false; - m_subdivisions_x = 0; - m_subdivisions_y = 0; - - check_shader(); - captureShader(); - - m_xml_state.push_back(xml_state_t::eDefault); - } - -public: - Callback m_lightsChanged; - - static int m_CycleCapIndex;// = 0; - static EPatchType m_type; - - STRING_CONSTANT(Name, "Patch"); - - Patch(scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged) : - m_node(&node), - m_shader(texdef_name_default()), - m_state(0), - m_undoable_observer(0), - m_map(0), - m_render_solid(m_tess), - m_render_wireframe(m_tess), - m_render_wireframe_fixed(m_tess), - m_render_ctrl(GL_POINTS, m_ctrl_vertices), - m_render_lattice(GL_LINES, m_lattice_indices, m_ctrl_vertices), - m_transformChanged(false), - m_evaluateTransform(evaluateTransform), - m_boundsChanged(boundsChanged) - { - construct(); - } - Patch(const Patch& other, scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged) : - m_node(&node), - m_shader(texdef_name_default()), - m_state(0), - m_undoable_observer(0), - m_map(0), - m_render_solid(m_tess), - m_render_wireframe(m_tess), - m_render_wireframe_fixed(m_tess), - m_render_ctrl(GL_POINTS, m_ctrl_vertices), - m_render_lattice(GL_LINES, m_lattice_indices, m_ctrl_vertices), - m_transformChanged(false), - m_evaluateTransform(evaluateTransform), - m_boundsChanged(boundsChanged) - { - construct(); - - m_patchDef3 = other.m_patchDef3; - m_subdivisions_x = other.m_subdivisions_x; - m_subdivisions_y = other.m_subdivisions_y; - setDims(other.m_width, other.m_height); - copy_ctrl(m_ctrl.data(), other.m_ctrl.data(), other.m_ctrl.data()+(m_width*m_height)); - SetShader(other.m_shader.c_str()); - controlPointsChanged(); - } - - Patch(const Patch& other) : - XMLImporter(other), - XMLExporter(other), - TransformNode(other), - Bounded(other), - Cullable(other), - Snappable(), - Undoable(other), - Filterable(other), - Nameable(other), - m_state(0), - m_undoable_observer(0), - m_map(0), - m_render_solid(m_tess), - m_render_wireframe(m_tess), - m_render_wireframe_fixed(m_tess), - m_render_ctrl(GL_POINTS, m_ctrl_vertices), - m_render_lattice(GL_LINES, m_lattice_indices, m_ctrl_vertices), - m_transformChanged(false), - m_evaluateTransform(other.m_evaluateTransform), - m_boundsChanged(other.m_boundsChanged) - { - m_bOverlay = false; - - m_patchDef3 = other.m_patchDef3; - m_subdivisions_x = other.m_subdivisions_x; - m_subdivisions_y = other.m_subdivisions_y; - setDims(other.m_width, other.m_height); - copy_ctrl(m_ctrl.data(), other.m_ctrl.data(), other.m_ctrl.data()+(m_width*m_height)); - SetShader(other.m_shader.c_str()); - controlPointsChanged(); - } - - ~Patch() - { - BezierCurveTreeArray_deleteAll(m_tess.m_curveTreeU); - BezierCurveTreeArray_deleteAll(m_tess.m_curveTreeV); - - releaseShader(); - - ASSERT_MESSAGE(m_observers.empty(), "Patch::~Patch: observers still attached"); - } - - InstanceCounter m_instanceCounter; - void instanceAttach(const scene::Path& path) - { - if(++m_instanceCounter.m_count == 1) - { - m_state->incrementUsed(); - m_map = path_find_mapfile(path.begin(), path.end()); - m_undoable_observer = GlobalUndoSystem().observer(this); - GlobalFilterSystem().registerFilterable(*this); - } - else - { - ASSERT_MESSAGE(path_find_mapfile(path.begin(), path.end()) == m_map, "node is instanced across more than one file"); - } - } - void instanceDetach(const scene::Path& path) - { - if(--m_instanceCounter.m_count == 0) - { - m_map = 0; - m_undoable_observer = 0; - GlobalUndoSystem().release(this); - GlobalFilterSystem().unregisterFilterable(*this); - m_state->decrementUsed(); - } - } - - const char* name() const - { - return "patch"; - } - void attach(const NameCallback& callback) - { - } - void detach(const NameCallback& callback) - { - } - - void attach(Observer* observer) - { - observer->allocate(m_width * m_height); - - m_observers.insert(observer); - } - void detach(Observer* observer) - { - m_observers.erase(observer); - } - - void updateFiltered() - { - if(m_node != 0) - { - if(patch_filtered(*this)) - { - m_node->enable(scene::Node::eFiltered); - } - else - { - m_node->disable(scene::Node::eFiltered); - } - } - } - - void onAllocate(std::size_t size) - { - for(Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i) - { - (*i)->allocate(size); - } - } - - const Matrix4& localToParent() const - { - return g_matrix4_identity; - } - const AABB& localAABB() const - { - return m_aabb_local; - } - VolumeIntersectionValue intersectVolume(const VolumeTest& test, const Matrix4& localToWorld) const - { - return test.TestAABB(m_aabb_local, localToWorld); - } - void render_solid(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_state, Renderer::eFullMaterials); - renderer.addRenderable(m_render_solid, localToWorld); - } - void render_wireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_state, Renderer::eFullMaterials); - if(m_patchDef3) - { - renderer.addRenderable(m_render_wireframe_fixed, localToWorld); - } - else - { - renderer.addRenderable(m_render_wireframe, localToWorld); - } - } - - void render_component(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const - { - renderer.SetState(m_state_lattice, Renderer::eWireframeOnly); - renderer.SetState(m_state_lattice, Renderer::eFullMaterials); - renderer.addRenderable(m_render_lattice, localToWorld); - - renderer.SetState(m_state_ctrl, Renderer::eWireframeOnly); - renderer.SetState(m_state_ctrl, Renderer::eFullMaterials); - renderer.addRenderable(m_render_ctrl, localToWorld); - } - void testSelect(Selector& selector, SelectionTest& test) - { - SelectionIntersection best; - IndexPointer::index_type* pIndex = m_tess.m_indices.data(); - for(std::size_t s=0; s TransformChangedCaller; - - void evaluateTransform() - { - if(m_transformChanged) - { - m_transformChanged = false; - revertTransform(); - m_evaluateTransform(); - } - } - - void revertTransform() - { - m_ctrlTransformed = m_ctrl; - } - void freezeTransform() - { - undoSave(); - evaluateTransform(); - ASSERT_MESSAGE(m_ctrlTransformed.size() == m_ctrl.size(), "Patch::freeze: size mismatch"); - std::copy(m_ctrlTransformed.begin(), m_ctrlTransformed.end(), m_ctrl.begin()); - } - - void controlPointsChanged() - { - transformChanged(); - evaluateTransform(); - UpdateCachedData(); - } - bool isValid() const; - - void snapto(float snap) - { - undoSave(); - - for(PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i) - { - vector3_snap((*i).m_vertex, snap); - } - - controlPointsChanged(); - } - - - - - void RenderDebug(RenderStateFlags state) const; - void RenderNormals(RenderStateFlags state) const; - - void pushElement(const XMLElement& element) - { - switch(m_xml_state.back().state()) - { - case xml_state_t::eDefault: - ASSERT_MESSAGE(string_equal(element.name(), "patch"), "parse error"); - m_xml_state.push_back(xml_state_t::ePatch); - break; - case xml_state_t::ePatch: - if(string_equal(element.name(), "matrix")) - { - setDims(atoi(element.attribute("width")), atoi(element.attribute("height"))); - m_xml_state.push_back(xml_state_t::eMatrix); - } - else if(string_equal(element.name(), "shader")) - { - m_xml_state.push_back(xml_state_t::eShader); - } - break; - default: - ERROR_MESSAGE("parse error"); - } - - } - void popElement(const char* name) - { - switch(m_xml_state.back().state()) - { - case xml_state_t::eDefault: - ERROR_MESSAGE("parse error"); - break; - case xml_state_t::ePatch: - break; - case xml_state_t::eMatrix: - { - StringTokeniser content(m_xml_state.back().content()); - - for(PatchControlIter i = m_ctrl.data(), end = m_ctrl.data() + m_ctrl.size(); i != end; ++i) - { - (*i).m_vertex[0] = string_read_float(content.getToken()); - (*i).m_vertex[1] = string_read_float(content.getToken()); - (*i).m_vertex[2] = string_read_float(content.getToken()); - (*i).m_texcoord[0] = string_read_float(content.getToken()); - (*i).m_texcoord[1] = string_read_float(content.getToken()); - } - controlPointsChanged(); - } - break; - case xml_state_t::eShader: - { - SetShader(m_xml_state.back().content()); - } - break; - default: - ERROR_MESSAGE("parse error"); - } - - ASSERT_MESSAGE(!m_xml_state.empty(), "popping empty stack"); - m_xml_state.pop_back(); - } - std::size_t write(const char* buffer, std::size_t length) - { - switch(m_xml_state.back().state()) - { - case xml_state_t::eDefault: - break; - case xml_state_t::ePatch: - break; - case xml_state_t::eMatrix: - case xml_state_t::eShader: - return m_xml_state.back().write(buffer, length); - break; - default: - ERROR_MESSAGE("parse error"); - } - return length; - } - - void exportXML(XMLImporter& importer) - { - StaticElement patchElement("patch"); - importer.pushElement(patchElement); - - { - const StaticElement element("shader"); - importer.pushElement(element); - importer.write(m_shader.c_str(), strlen(m_shader.c_str())); - importer.popElement(element.name()); - } - - { - char width[16], height[16]; - sprintf(width, "%u", Unsigned(m_width)); - sprintf(height, "%u", Unsigned(m_height)); - StaticElement element("matrix"); - element.insertAttribute("width", width); - element.insertAttribute("height", height); - - importer.pushElement(element); - { - for(PatchControlIter i = m_ctrl.data(), end = m_ctrl.data() + m_ctrl.size(); i != end; ++i) - { - importer << (*i).m_vertex[0] - << ' ' << (*i).m_vertex[1] - << ' ' << (*i).m_vertex[2] - << ' ' << (*i).m_texcoord[0] - << ' ' << (*i).m_texcoord[1]; - } - } - importer.popElement(element.name()); - } - - importer.popElement(patchElement.name()); - } - - void UpdateCachedData(); - - const char *GetShader() const - { - return m_shader.c_str(); - } - void SetShader(const char* name) - { - ASSERT_NOTNULL(name); - - if(shader_equal(m_shader.c_str(), name)) - return; - - undoSave(); - - if(m_instanceCounter.m_count != 0) - { - m_state->decrementUsed(); - } - releaseShader(); - m_shader = name; - captureShader(); - if(m_instanceCounter.m_count != 0) - { - m_state->incrementUsed(); - } - - check_shader(); - Patch_textureChanged(); - } - int getShaderFlags() const - { - if(m_state != 0) - { - return m_state->getFlags(); - } - return 0; - } - - typedef PatchControl* iterator; - typedef const PatchControl* const_iterator; - - iterator begin() - { - return m_ctrl.data(); - } - const_iterator begin() const - { - return m_ctrl.data(); - } - iterator end() - { - return m_ctrl.data() + m_ctrl.size(); - } - const_iterator end() const - { - return m_ctrl.data() + m_ctrl.size(); - } - - PatchControlArray& getControlPoints() - { - return m_ctrl; - } - PatchControlArray& getControlPointsTransformed() - { - return m_ctrlTransformed; - } - - void setDims (std::size_t w, std::size_t h); - std::size_t getWidth() const - { - return m_width; - } - std::size_t getHeight() const - { - return m_height; - } - PatchControl& ctrlAt(std::size_t row, std::size_t col) - { - return m_ctrl[row*m_width+col]; - } - const PatchControl& ctrlAt(std::size_t row, std::size_t col) const - { - return m_ctrl[row*m_width+col]; - } - - void ConstructPrefab(const AABB& aabb, EPatchPrefab eType, int axis, std::size_t width = 3, std::size_t height = 3); - void constructPlane(const AABB& aabb, int axis, std::size_t width, std::size_t height); - void InvertMatrix(); - void TransposeMatrix(); - void Redisperse(EMatrixMajor mt); - void InsertRemove(bool bInsert, bool bColumn, bool bFirst); - Patch* MakeCap(Patch* patch, EPatchCap eType, EMatrixMajor mt, bool bFirst); - void ConstructSeam(EPatchCap eType, Vector3* p, std::size_t width); - - void FlipTexture(int nAxis); - void TranslateTexture(float s, float t); - void ScaleTexture(float s, float t); - void RotateTexture(float angle); - void SetTextureRepeat(float s, float t); // call with s=1 t=1 for FIT - void CapTexture(); - void NaturalTexture(); - void ProjectTexture(int nAxis); - - void undoSave() - { - if(m_map != 0) - { - m_map->changed(); - } - if(m_undoable_observer != 0) - { - m_undoable_observer->save(this); - } - } - - UndoMemento* exportState() const - { - return new SavedState(m_width, m_height, m_ctrl, m_shader.c_str(), m_patchDef3, m_subdivisions_x, m_subdivisions_y); - } - void importState(const UndoMemento* state) - { - undoSave(); - - const SavedState& other = *(static_cast(state)); - - // begin duplicate of SavedState copy constructor, needs refactoring - - // copy construct - { - m_width = other.m_width; - m_height = other.m_height; - SetShader(other.m_shader.c_str()); - m_ctrl = other.m_ctrl; - onAllocate(m_ctrl.size()); - m_patchDef3 = other.m_patchDef3; - m_subdivisions_x = other.m_subdivisions_x; - m_subdivisions_y = other.m_subdivisions_y; - } - - // end duplicate code - - Patch_textureChanged(); - - controlPointsChanged(); - } - - static void constructStatic(EPatchType type) - { - Patch::m_type = type; - Patch::m_state_ctrl = GlobalShaderCache().capture("$POINT"); - Patch::m_state_lattice = GlobalShaderCache().capture("$LATTICE"); - } - - static void destroyStatic() - { - GlobalShaderCache().release("$LATTICE"); - GlobalShaderCache().release("$POINT"); - } -private: - void captureShader() - { - m_state = GlobalShaderCache().capture(m_shader.c_str()); - } - - void releaseShader() - { - GlobalShaderCache().release(m_shader.c_str()); - } - - void check_shader() - { - if(!shader_valid(GetShader())) - { - globalErrorStream() << "patch has invalid texture name: '" << GetShader() << "'\n"; - } - } - - void InsertPoints(EMatrixMajor mt, bool bFirst); - void RemovePoints(EMatrixMajor mt, bool bFirst); - - void AccumulateBBox(); - - void TesselateSubMatrixFixed(ArbitraryMeshVertex* vertices, std::size_t strideX, std::size_t strideY, unsigned int nFlagsX, unsigned int nFlagsY, PatchControl* subMatrix[3][3]); - - // uses binary trees representing bezier curves to recursively tesselate a bezier sub-patch - void TesselateSubMatrix( const BezierCurveTree *BX, const BezierCurveTree *BY, - std::size_t offStartX, std::size_t offStartY, - std::size_t offEndX, std::size_t offEndY, - std::size_t nFlagsX, std::size_t nFlagsY, - Vector3& left, Vector3& mid, Vector3& right, - Vector2& texLeft, Vector2& texMid, Vector2& texRight, - bool bTranspose ); - - // tesselates the entire surface - void BuildTesselationCurves(EMatrixMajor major); - void accumulateVertexTangentSpace(std::size_t index, Vector3 tangentX[6], Vector3 tangentY[6], Vector2 tangentS[6], Vector2 tangentT[6], std::size_t index0, std::size_t index1); - void BuildVertexArray(); -}; - -inline bool Patch_importHeader(Patch& patch, Tokeniser& tokeniser) -{ - tokeniser.nextLine(); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "{")); - return true; -} - -inline bool Patch_importShader(Patch& patch, Tokeniser& tokeniser) -{ - // parse shader name - tokeniser.nextLine(); - const char* texture = tokeniser.getToken(); - if(texture == 0) - { - Tokeniser_unexpectedError(tokeniser, texture, "#texture-name"); - return false; - } - if(string_equal(texture, "NULL")) - { - patch.SetShader(texdef_name_default()); - } - else - { - StringOutputStream shader(string_length(GlobalTexturePrefix_get()) + string_length(texture)); - shader << GlobalTexturePrefix_get() << texture; - patch.SetShader(shader.c_str()); - } - return true; -} - -inline bool PatchDoom3_importShader(Patch& patch, Tokeniser& tokeniser) -{ - // parse shader name - tokeniser.nextLine(); - const char *shader = tokeniser.getToken(); - if(shader == 0) - { - Tokeniser_unexpectedError(tokeniser, shader, "#shader-name"); - return false; - } - if(string_equal(shader, "_emptyname")) - { - shader = texdef_name_default(); - } - patch.SetShader(shader); - return true; -} - -inline bool Patch_importParams(Patch& patch, Tokeniser& tokeniser) -{ - tokeniser.nextLine(); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - - // parse matrix dimensions - { - std::size_t c, r; - RETURN_FALSE_IF_FAIL(Tokeniser_getSize(tokeniser, c)); - RETURN_FALSE_IF_FAIL(Tokeniser_getSize(tokeniser, r)); - - patch.setDims(c, r); - } - - if(patch.m_patchDef3) - { - RETURN_FALSE_IF_FAIL(Tokeniser_getSize(tokeniser, patch.m_subdivisions_x)); - RETURN_FALSE_IF_FAIL(Tokeniser_getSize(tokeniser, patch.m_subdivisions_y)); - } - - // ignore contents/flags/value - int tmp; - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, tmp)); - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, tmp)); - RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, tmp)); - - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")")); - return true; -} - -inline bool Patch_importMatrix(Patch& patch, Tokeniser& tokeniser) -{ - // parse matrix - tokeniser.nextLine(); - RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "(")); - { - for(std::size_t c=0; cm_vertex, best); - if(best.valid()) - { - Selector_add(selector, m_selectable, best); - } - } - void snapto(float snap) - { - vector3_snap(m_ctrl->m_vertex, snap); - } -}; - - -class PatchInstance : -public Patch::Observer, -public scene::Instance, -public Selectable, -public Renderable, -public SelectionTestable, -public ComponentSelectionTestable, -public ComponentEditable, -public ComponentSnappable, -public PlaneSelectable, -public LightCullable -{ - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - InstanceStaticCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceContainedCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceStaticCast::install(m_casts); - InstanceIdentityCast::install(m_casts); - InstanceContainedCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - - Patch& m_patch; - typedef std::vector PatchControlInstances; - PatchControlInstances m_ctrl_instances; - - ObservedSelectable m_selectable; - - DragPlanes m_dragPlanes; - - mutable RenderablePointVector m_render_selected; - mutable AABB m_aabb_component; - - static Shader* m_state_selpoint; - - const LightList* m_lightList; - - TransformModifier m_transform; -public: - - typedef LazyStatic StaticTypeCasts; - - void lightsChanged() - { - m_lightList->lightsChanged(); - } - typedef MemberCaller LightsChangedCaller; - - STRING_CONSTANT(Name, "PatchInstance"); - - PatchInstance(const scene::Path& path, scene::Instance* parent, Patch& patch) : - Instance(path, parent, this, StaticTypeCasts::instance().get()), - m_patch(patch), - m_selectable(SelectedChangedCaller(*this)), - m_dragPlanes(SelectedChangedComponentCaller(*this)), - m_render_selected(GL_POINTS), - m_transform(Patch::TransformChangedCaller(m_patch), ApplyTransformCaller(*this)) - { - m_patch.instanceAttach(Instance::path()); - m_patch.attach(this); - - m_lightList = &GlobalShaderCache().attach(*this); - m_patch.m_lightsChanged = LightsChangedCaller(*this); - - Instance::setTransformChangedCallback(LightsChangedCaller(*this)); - } - ~PatchInstance() - { - Instance::setTransformChangedCallback(Callback()); - - m_patch.m_lightsChanged = Callback(); - GlobalShaderCache().detach(*this); - - m_patch.detach(this); - m_patch.instanceDetach(Instance::path()); - } - - void selectedChanged(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::ePrimitive)(selectable); - GlobalSelectionSystem().onSelectedChanged(*this, selectable); - - Instance::selectedChanged(); - } - typedef MemberCaller1 SelectedChangedCaller; - - void selectedChangedComponent(const Selectable& selectable) - { - GlobalSelectionSystem().getObserver(SelectionSystem::eComponent)(selectable); - GlobalSelectionSystem().onComponentSelection(*this, selectable); - } - typedef MemberCaller1 SelectedChangedComponentCaller; - - Patch& getPatch() - { - return m_patch; - } - Bounded& get(NullType) - { - return m_patch; - } - Cullable& get(NullType) - { - return m_patch; - } - Transformable& get(NullType) - { - return m_transform; - } - - static void constructStatic() - { - m_state_selpoint = GlobalShaderCache().capture("$SELPOINT"); - } - - static void destroyStatic() - { - GlobalShaderCache().release("$SELPOINT"); - } - - - void allocate(std::size_t size) - { - m_ctrl_instances.clear(); - m_ctrl_instances.reserve(size); - for(Patch::iterator i = m_patch.begin(); i != m_patch.end(); ++i) - { - m_ctrl_instances.push_back(PatchControlInstance(&(*i), SelectedChangedComponentCaller(*this))); - } - } - - void setSelected(bool select) - { - m_selectable.setSelected(select); - } - bool isSelected() const - { - return m_selectable.isSelected(); - } - - - void update_selected() const - { - m_render_selected.clear(); - Patch::iterator ctrl = m_patch.getControlPointsTransformed().begin(); - for(PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i, ++ctrl) - { - if((*i).m_selectable.isSelected()) - { - const Colour4b colour_selected(0, 0, 255, 255); - m_render_selected.push_back(PointVertex(reinterpret_cast((*ctrl).m_vertex), colour_selected)); - } - } - } - -#if 0 - void render(Renderer& renderer, const VolumeTest& volume) const - { - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && m_selectable.isSelected()) - { - renderer.Highlight(Renderer::eFace, false); - - m_patch.render(renderer, volume, localToWorld()); - - if(GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex) - { - renderer.Highlight(Renderer::ePrimitive, false); - - m_patch.render_component(renderer, volume, localToWorld()); - - renderComponentsSelected(renderer, volume); - } - } - else - m_patch.render(renderer, volume, localToWorld()); - } -#endif - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - m_patch.evaluateTransform(); - renderer.setLights(*m_lightList); - m_patch.render_solid(renderer, volume, localToWorld()); - - renderComponentsSelected(renderer, volume); - } - - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - m_patch.evaluateTransform(); - m_patch.render_wireframe(renderer, volume, localToWorld()); - - renderComponentsSelected(renderer, volume); - } - - void renderComponentsSelected(Renderer& renderer, const VolumeTest& volume) const - { - m_patch.evaluateTransform(); - update_selected(); - if(!m_render_selected.empty()) - { - renderer.Highlight(Renderer::ePrimitive, false); - renderer.SetState(m_state_selpoint, Renderer::eWireframeOnly); - renderer.SetState(m_state_selpoint, Renderer::eFullMaterials); - renderer.addRenderable(m_render_selected, localToWorld()); - } - } - void renderComponents(Renderer& renderer, const VolumeTest& volume) const - { - m_patch.evaluateTransform(); - if(GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex) - { - m_patch.render_component(renderer, volume, localToWorld()); - } - } - - void testSelect(Selector& selector, SelectionTest& test) - { - test.BeginMesh(localToWorld(), true); - m_patch.testSelect(selector, test); - } - - void selectCtrl(bool select) - { - for(PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - (*i).m_selectable.setSelected(select); - } - } - bool isSelectedComponents() const - { - for(PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - if((*i).m_selectable.isSelected()) - { - return true; - } - } - return false; - } - void setSelectedComponents(bool select, SelectionSystem::EComponentMode mode) - { - if(mode == SelectionSystem::eVertex) - { - selectCtrl(select); - } - else if(mode == SelectionSystem::eFace) - { - m_dragPlanes.setSelected(select); - } - } - const AABB& getSelectedComponentsBounds() const - { - m_aabb_component = AABB(); - - for(PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - if((*i).m_selectable.isSelected()) - { - aabb_extend_by_point_safe(m_aabb_component, (*i).m_ctrl->m_vertex); - } - } - - return m_aabb_component; - } - - void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - { - test.BeginMesh(localToWorld()); - - switch(mode) - { - case SelectionSystem::eVertex: - { - for(PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - (*i).testSelect(selector, test); - } - } - break; - default: - break; - } - } - - bool selectedVertices() - { - for(PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - if((*i).m_selectable.isSelected()) - { - return true; - } - } - return false; - } - - void transformComponents(const Matrix4& matrix) - { - if(selectedVertices()) - { - PatchControlIter ctrl = m_patch.getControlPointsTransformed().begin(); - for(PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i, ++ctrl) - { - if((*i).m_selectable.isSelected()) - { - matrix4_transform_point(matrix, (*ctrl).m_vertex); - } - } - m_patch.UpdateCachedData(); - } - - if(m_dragPlanes.isSelected()) // this should only be true when the transform is a pure translation. - { - m_patch.transform(m_dragPlanes.evaluateTransform(vector4_to_vector3(matrix.t()))); - } - } - - - void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) - { - test.BeginMesh(localToWorld()); - - m_dragPlanes.selectPlanes(m_patch.localAABB(), selector, test, selectedPlaneCallback); - } - void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) - { - m_dragPlanes.selectReversedPlanes(m_patch.localAABB(), selector, selectedPlanes); - } - - - void snapComponents(float snap) - { - if(selectedVertices()) - { - m_patch.undoSave(); - for(PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i) - { - if((*i).m_selectable.isSelected()) - { - (*i).snapto(snap); - } - } - m_patch.controlPointsChanged(); - } - } - - void evaluateTransform() - { - Matrix4 matrix(m_transform.calculateTransform()); - - if(m_transform.getType() == TRANSFORM_PRIMITIVE) - { - m_patch.transform(matrix); - } - else - { - transformComponents(matrix); - } - } - void applyTransform() - { - m_patch.revertTransform(); - evaluateTransform(); - m_patch.freezeTransform(); - } - typedef MemberCaller ApplyTransformCaller; - - - bool testLight(const RendererLight& light) const - { - return light.testAABB(worldAABB()); - } -}; - - -template -class PatchNode : - public scene::Node::Symbiot, - public scene::Instantiable, - public scene::Cloneable -{ - typedef PatchNode Self; - - class TypeCasts - { - InstanceTypeCastTable m_casts; - public: - TypeCasts() - { - NodeStaticCast::install(m_casts); - NodeStaticCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - NodeContainedCast::install(m_casts); - } - InstanceTypeCastTable& get() - { - return m_casts; - } - }; - - - scene::Node m_node; - InstanceSet m_instances; - Patch m_patch; - TokenImporter m_importMap; - TokenExporter m_exportMap; - -public: - - typedef LazyStatic StaticTypeCasts; - - Snappable& get(NullType) - { - return m_patch; - } - TransformNode& get(NullType) - { - return m_patch; - } - Patch& get(NullType) - { - return m_patch; - } - XMLImporter& get(NullType) - { - return m_patch; - } - XMLExporter& get(NullType) - { - return m_patch; - } - MapImporter& get(NullType) - { - return m_importMap; - } - MapExporter& get(NullType) - { - return m_exportMap; - } - Nameable& get(NullType) - { - return m_patch; - } - - PatchNode(bool patchDef3 = false) : - m_node(this, this, StaticTypeCasts::instance().get()), - m_patch(m_node, InstanceSetEvaluateTransform::Caller(m_instances), InstanceSet::BoundsChangedCaller(m_instances)), - m_importMap(m_patch), - m_exportMap(m_patch) - { - m_patch.m_patchDef3 = patchDef3; - } - PatchNode(const PatchNode& other) : - scene::Node::Symbiot(other), - scene::Instantiable(other), - scene::Cloneable(other), - m_node(this, this, StaticTypeCasts::instance().get()), - m_patch(other.m_patch, m_node, InstanceSetEvaluateTransform::Caller(m_instances), InstanceSet::BoundsChangedCaller(m_instances)), - m_importMap(m_patch), - m_exportMap(m_patch) - { - } - void release() - { - delete this; - } - scene::Node& node() - { - return m_node; - } - Patch& get() - { - return m_patch; - } - const Patch& get() const - { - return m_patch; - } - - scene::Node& clone() const - { - return (new PatchNode(*this))->node(); - } - - scene::Instance* create(const scene::Path& path, scene::Instance* parent) - { - return new PatchInstance(path, parent, m_patch); - } - void forEachInstance(const scene::Instantiable::Visitor& visitor) - { - m_instances.forEachInstance(visitor); - } - void insert(scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance) - { - m_instances.insert(observer, path, instance); - } - scene::Instance* erase(scene::Instantiable::Observer* observer, const scene::Path& path) - { - return m_instances.erase(observer, path); - } -}; - - - -typedef PatchNode PatchNodeQuake3; -typedef PatchNode PatchNodeDoom3; - -inline Patch* Node_getPatch(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -inline PatchInstance* Instance_getPatch(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -template -class PatchSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - PatchSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - PatchInstance* patch = Instance_getPatch(instance); - if(patch != 0) - { - m_functor(*patch); - } - } -}; - -template -inline void Scene_forEachSelectedPatch(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(PatchSelectedVisitor(functor)); -} - - -template -class PatchVisibleSelectedVisitor : public SelectionSystem::Visitor -{ - const Functor& m_functor; -public: - PatchVisibleSelectedVisitor(const Functor& functor) : m_functor(functor) - { - } - void visit(scene::Instance& instance) const - { - PatchInstance* patch = Instance_getPatch(instance); - if(patch != 0 - && instance.path().top().get().visible()) - { - m_functor(*patch); - } - } -}; - -template -inline void Scene_forEachVisibleSelectedPatchInstance(const Functor& functor) -{ - GlobalSelectionSystem().foreachSelected(PatchVisibleSelectedVisitor(functor)); -} - -template -class PatchForEachWalker : public scene::Graph::Walker -{ - const Functor& m_functor; -public: - PatchForEachWalker(const Functor& functor) : m_functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Patch* patch = Node_getPatch(path.top()); - if(patch != 0) - { - m_functor(*patch); - } - } - return true; - } -}; - -template -inline void Scene_forEachVisiblePatch(const Functor& functor) -{ - GlobalSceneGraph().traverse(PatchForEachWalker(functor)); -} - -template -class PatchForEachSelectedWalker : public scene::Graph::Walker -{ - const Functor& m_functor; -public: - PatchForEachSelectedWalker(const Functor& functor) : m_functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Patch* patch = Node_getPatch(path.top()); - if(patch != 0 - && Instance_getSelectable(instance)->isSelected()) - { - m_functor(*patch); - } - } - return true; - } -}; - -template -inline void Scene_forEachVisibleSelectedPatch(const Functor& functor) -{ - GlobalSceneGraph().traverse(PatchForEachSelectedWalker(functor)); -} - -template -class PatchForEachInstanceWalker : public scene::Graph::Walker -{ - const Functor& m_functor; -public: - PatchForEachInstanceWalker(const Functor& functor) : m_functor(functor) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - PatchInstance* patch = Instance_getPatch(instance); - if(patch != 0) - { - m_functor(*patch); - } - } - return true; - } -}; - -template -inline void Scene_forEachVisiblePatchInstance(const Functor& functor) -{ - GlobalSceneGraph().traverse(PatchForEachInstanceWalker(functor)); -} - -#endif diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 6765ceeb..e3d6c794 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,490 +25,98 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // +#include +#include "stdafx.h" #include "patchdialog.h" -#include "itexdef.h" - -#include "debugging/debugging.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtkutil/idledraw.h" -#include "gtkutil/entry.h" -#include "gtkutil/button.h" -#include "gtkutil/nonmodal.h" -#include "dialog.h" -#include "gtkdlgs.h" -#include "mainframe.h" -#include "patchmanip.h" -#include "patch.h" -#include "commands.h" -#include "preferences.h" -#include "signal/isignal.h" - - -#include - +PatchDialog g_PatchDialog; +// is the patch inspector currently displayed/active? +bool l_bIsActive = false; // the increment we are using for the patch inspector (this is saved in the prefs) -struct pi_globals_t -{ - float shift[2]; - float scale[2]; - float rotate; - - pi_globals_t() - { - shift[0] = 8.0f; - shift[1] = 8.0f; - scale[0] = 0.5f; - scale[1] = 0.5f; - rotate = 45.0f; - } -}; - -pi_globals_t g_pi_globals; - -class PatchFixedSubdivisions -{ -public: - PatchFixedSubdivisions() : m_enabled(false), m_x(0), m_y(0) - { - } - PatchFixedSubdivisions(bool enabled, std::size_t x, std::size_t y) : m_enabled(enabled), m_x(x), m_y(y) - { - } - bool m_enabled; - std::size_t m_x; - std::size_t m_y; -}; - -void Patch_getFixedSubdivisions(const Patch& patch, PatchFixedSubdivisions& subdivisions) -{ - subdivisions.m_enabled = patch.m_patchDef3; - subdivisions.m_x = patch.m_subdivisions_x; - subdivisions.m_y = patch.m_subdivisions_y; -} - -const std::size_t MAX_PATCH_SUBDIVISIONS = 32; - -void Patch_setFixedSubdivisions(Patch& patch, const PatchFixedSubdivisions& subdivisions) -{ - patch.undoSave(); - - patch.m_patchDef3 = subdivisions.m_enabled; - patch.m_subdivisions_x = subdivisions.m_x; - patch.m_subdivisions_y = subdivisions.m_y; - - if(patch.m_subdivisions_x == 0) - { - patch.m_subdivisions_x = 4; - } - else if(patch.m_subdivisions_x > MAX_PATCH_SUBDIVISIONS) - { - patch.m_subdivisions_x = MAX_PATCH_SUBDIVISIONS; - } - if(patch.m_subdivisions_y == 0) - { - patch.m_subdivisions_y = 4; - } - else if(patch.m_subdivisions_y > MAX_PATCH_SUBDIVISIONS) - { - patch.m_subdivisions_y = MAX_PATCH_SUBDIVISIONS; - } - - SceneChangeNotify(); - Patch_textureChanged(); - patch.controlPointsChanged(); -} - -class PatchGetFixedSubdivisions -{ - PatchFixedSubdivisions& m_subdivisions; -public: - PatchGetFixedSubdivisions(PatchFixedSubdivisions& subdivisions) : m_subdivisions(subdivisions) - { - } - void operator()(Patch& patch) - { - Patch_getFixedSubdivisions(patch, m_subdivisions); - SceneChangeNotify(); - } -}; - -void Scene_PatchGetFixedSubdivisions(PatchFixedSubdivisions& subdivisions) -{ -#if 1 - if(GlobalSelectionSystem().countSelected() != 0) - { - Patch* patch = Node_getPatch(GlobalSelectionSystem().ultimateSelected().path().top()); - if(patch != 0) - { - Patch_getFixedSubdivisions(*patch, subdivisions); - } - } -#else - Scene_forEachVisibleSelectedPatch(PatchGetFixedSubdivisions(subdivisions)); -#endif -} - -class PatchSetFixedSubdivisions -{ - const PatchFixedSubdivisions& m_subdivisions; -public: - PatchSetFixedSubdivisions(const PatchFixedSubdivisions& subdivisions) : m_subdivisions(subdivisions) - { - } - void operator()(Patch& patch) const - { - Patch_setFixedSubdivisions(patch, m_subdivisions); - } -}; - -void Scene_PatchSetFixedSubdivisions(const PatchFixedSubdivisions& subdivisions) -{ - UndoableCommand command("patchSetFixedSubdivisions"); - Scene_forEachVisibleSelectedPatch(PatchSetFixedSubdivisions(subdivisions)); -} - -typedef struct _GtkCheckButton GtkCheckButton; - -class Subdivisions -{ -public: - GtkCheckButton* m_enabled; - GtkEntry* m_horizontal; - GtkEntry* m_vertical; - Subdivisions() : m_enabled(0), m_horizontal(0), m_vertical(0) - { - } - void update() - { - PatchFixedSubdivisions subdivisions; - Scene_PatchGetFixedSubdivisions(subdivisions); - - toggle_button_set_active_no_signal(GTK_TOGGLE_BUTTON(m_enabled), subdivisions.m_enabled); - - if(subdivisions.m_enabled) - { - entry_set_int(m_horizontal, static_cast(subdivisions.m_x)); - entry_set_int(m_vertical, static_cast(subdivisions.m_y)); - gtk_widget_set_sensitive(GTK_WIDGET(m_horizontal), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(m_vertical), TRUE); - } - else - { - gtk_entry_set_text(m_horizontal, ""); - gtk_entry_set_text(m_vertical, ""); - gtk_widget_set_sensitive(GTK_WIDGET(m_horizontal), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(m_vertical), FALSE); - } - } - void cancel() - { - update(); - } - typedef MemberCaller CancelCaller; - void apply() - { - Scene_PatchSetFixedSubdivisions( - PatchFixedSubdivisions( - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_enabled)) != FALSE, - static_cast(entry_get_int(m_horizontal)), - static_cast(entry_get_int(m_vertical)) - ) - ); - } - typedef MemberCaller ApplyCaller; - static void applyGtk(GtkToggleButton* toggle, Subdivisions* self) - { - self->apply(); - } -}; - -class PatchInspector : public Dialog -{ - GtkWindow* BuildDialog(); - Subdivisions m_subdivisions; - NonModalEntry m_horizontalSubdivisionsEntry; - NonModalEntry m_verticalSubdivisionsEntry; -public: - IdleDraw m_idleDraw; - WindowPositionTracker m_position_tracker; - - Patch *m_Patch; - - CopiedString m_strName; - float m_fS; - float m_fT; - float m_fX; - float m_fY; - float m_fZ; -/* float m_fHScale; - float m_fHShift; - float m_fRotate; - float m_fVScale; - float m_fVShift; */ - int m_nCol; - int m_nRow; - GtkComboBox *m_pRowCombo; - GtkComboBox *m_pColCombo; - std::size_t m_countRows; - std::size_t m_countCols; - - // turn on/off processing of the "changed" "value_changed" messages - // (need to turn off when we are feeding data in) - // NOTE: much more simple than blocking signals - bool m_bListenChanged; - - PatchInspector() : - m_horizontalSubdivisionsEntry(Subdivisions::ApplyCaller(m_subdivisions), Subdivisions::CancelCaller(m_subdivisions)), - m_verticalSubdivisionsEntry(Subdivisions::ApplyCaller(m_subdivisions), Subdivisions::CancelCaller(m_subdivisions)), - m_idleDraw(MemberCaller(*this)) - { - m_fS = 0.0f; - m_fT = 0.0f; - m_fX = 0.0f; - m_fY = 0.0f; - m_fZ = 0.0f; - m_nCol = 0; - m_nRow = 0; - m_countRows = 0; - m_countCols = 0; - m_Patch = 0; - m_bListenChanged = true; - - m_position_tracker.setPosition(c_default_window_pos); - } - - bool visible() - { - return GTK_WIDGET_VISIBLE(GetWidget()); - } - -// void UpdateInfo(); -// void SetPatchInfo(); - void GetPatchInfo(); - void UpdateSpinners(bool bUp, int nID); - // read the current patch on map and initialize m_fX m_fY accordingly - void UpdateRowColInfo(); - // sync the dialog our internal data structures - // depending on the flag it will read or write - // we use m_nCol m_nRow m_fX m_fY m_fZ m_fS m_fT m_strName - // (NOTE: this doesn't actually commit stuff to the map or read from it) - void importData(); - void exportData(); -}; - -PatchInspector g_PatchInspector; - -void PatchInspector_constructWindow(GtkWindow* main_window) -{ - g_PatchInspector.m_parent = main_window; - g_PatchInspector.Create(); -} -void PatchInspector_destroyWindow() -{ - g_PatchInspector.Destroy(); -} - -void PatchInspector_queueDraw() -{ - if(g_PatchInspector.visible()) - { - g_PatchInspector.m_idleDraw.queueDraw(); - } -} - -void DoPatchInspector() -{ - g_PatchInspector.GetPatchInfo(); - if (!g_PatchInspector.visible()) - g_PatchInspector.ShowDlg(); -} - -void PatchInspector_toggleShown() -{ - if (g_PatchInspector.visible()) - { - g_PatchInspector.m_Patch = 0; - g_PatchInspector.HideDlg(); - } - else - DoPatchInspector(); -} - +texdef_t *l_pPIIncrement = &g_qeglobals.d_savedinfo.m_PIIncrement; // ============================================================================= // static functions +static void OnDone (GtkWidget *widget, gpointer data) +{ + g_PatchDialog.m_Patch = NULL; + g_PatchDialog.HideDlg (); +} + // memorize the current state (that is don't try to undo our do before changing something else) static void OnApply (GtkWidget *widget, gpointer data) { - g_PatchInspector.exportData(); - if (g_PatchInspector.m_Patch != 0) + g_PatchDialog.UpdateData(TRUE); + if (g_PatchDialog.m_Patch != NULL) { - UndoableCommand command("patchSetTexture"); - g_PatchInspector.m_Patch->undoSave(); - - if (!texdef_name_valid(g_PatchInspector.m_strName.c_str())) - { - globalErrorStream() << "invalid texture name '" << g_PatchInspector.m_strName.c_str() << "'\n"; - g_PatchInspector.m_strName = texdef_name_default(); - } - g_PatchInspector.m_Patch->SetShader(g_PatchInspector.m_strName.c_str()); - - std::size_t r = g_PatchInspector.m_nRow; - std::size_t c = g_PatchInspector.m_nCol; - if(r < g_PatchInspector.m_Patch->getHeight() - && c < g_PatchInspector.m_Patch->getWidth()) + int r = g_PatchDialog.m_nRow; + int c = g_PatchDialog.m_nCol; + if (r >= 0 && r < g_PatchDialog.m_Patch->height && c >= 0 && c < g_PatchDialog.m_Patch->width) { - PatchControl& p = g_PatchInspector.m_Patch->ctrlAt(r,c); - p.m_vertex[0] = g_PatchInspector.m_fX; - p.m_vertex[1] = g_PatchInspector.m_fY; - p.m_vertex[2] = g_PatchInspector.m_fZ; - p.m_texcoord[0] = g_PatchInspector.m_fS; - p.m_texcoord[1] = g_PatchInspector.m_fT; - g_PatchInspector.m_Patch->controlPointsChanged(); + if (g_PatchDialog.m_Patch->pShader) + g_PatchDialog.m_Patch->pShader->DecRef(); + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=467 + if (g_PatchDialog.m_strName.Find(' ') >= 0) + { + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, dropping '%s'\n", g_PatchDialog.m_strName.GetBuffer()); + g_PatchDialog.m_strName = SHADER_NOT_FOUND; + } + g_PatchDialog.m_Patch->pShader = QERApp_Shader_ForName(g_PatchDialog.m_strName); + g_PatchDialog.m_Patch->d_texture = g_PatchDialog.m_Patch->pShader->getTexture(); + g_PatchDialog.m_Patch->ctrl[c][r].xyz[0] = g_PatchDialog.m_fX; + g_PatchDialog.m_Patch->ctrl[c][r].xyz[1] = g_PatchDialog.m_fY; + g_PatchDialog.m_Patch->ctrl[c][r].xyz[2] = g_PatchDialog.m_fZ; + g_PatchDialog.m_Patch->ctrl[c][r].st[0] = g_PatchDialog.m_fS; + g_PatchDialog.m_Patch->ctrl[c][r].st[1] = g_PatchDialog.m_fT; + g_PatchDialog.m_Patch->bDirty = true; + Sys_UpdateWindows(W_ALL); } } } static void OnSelchangeComboColRow (GtkWidget *widget, gpointer data) { - if (!g_PatchInspector.m_bListenChanged) + if (!g_PatchDialog.m_bListenChanged) return; +#ifdef DBG_PI + Sys_Printf("OnSelchangeComboColRow\n"); +#endif // retrieve the current m_nRow and m_nCol, other params are not relevant - g_PatchInspector.exportData(); + // (NOTE: UpdateData has a mechanism to avoid inifinite looping) + g_PatchDialog.UpdateData(TRUE); // read the changed values ourselves - g_PatchInspector.UpdateRowColInfo(); + g_PatchDialog.UpdateRowColInfo(); // now reflect our changes - g_PatchInspector.importData(); -} - -class PatchSetTextureRepeat -{ - float m_s, m_t; -public: - PatchSetTextureRepeat(float s, float t) : m_s(s), m_t(t) - { - } - void operator()(Patch& patch) const - { - patch.SetTextureRepeat(m_s, m_t); - } -}; - -void Scene_PatchTileTexture_Selected(scene::Graph& graph, float s, float t) -{ - Scene_forEachVisibleSelectedPatch(PatchSetTextureRepeat(s, t)); - SceneChangeNotify(); + g_PatchDialog.UpdateData(FALSE); } static void OnBtnPatchdetails (GtkWidget *widget, gpointer data) { - UndoableCommand command("patchCapTexture"); - - Scene_PatchCapTexture_Selected(GlobalSceneGraph()); + Patch_NaturalizeSelected(true); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchfit (GtkWidget *widget, gpointer data) { - UndoableCommand command("patchFitTexture"); - - Scene_PatchTileTexture_Selected(GlobalSceneGraph(), 1, 1); + Patch_ResetTexturing(1.0, 1.0); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchnatural (GtkWidget *widget, gpointer data) { - UndoableCommand command("patchNaturalTexture"); - - Scene_PatchNaturalTexture_Selected(GlobalSceneGraph()); + Patch_NaturalizeSelected(); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchreset (GtkWidget *widget, gpointer data) { float fx, fy; - if (DoTextureLayout (&fx, &fy) == eIDOK) + if (DoTextureLayout (&fx, &fy) == IDOK) { - UndoableCommand command("patchTileTexture"); - Scene_PatchTileTexture_Selected(GlobalSceneGraph(), fx, fy); + Patch_ResetTexturing(fx, fy); } -} - -struct PatchRotateTexture -{ - float m_angle; -public: - PatchRotateTexture(float angle) : m_angle(angle) - { - } - void operator()(Patch& patch) const - { - patch.RotateTexture(m_angle); - } -}; - -void Scene_PatchRotateTexture_Selected(scene::Graph& graph, float angle) -{ - Scene_forEachVisibleSelectedPatch(PatchRotateTexture(angle)); -} - -class PatchScaleTexture -{ - float m_s, m_t; -public: - PatchScaleTexture(float s, float t) : m_s(s), m_t(t) - { - } - void operator()(Patch& patch) const - { - patch.ScaleTexture(m_s, m_t); - } -}; - -float Patch_convertScale(float scale) -{ - if(scale > 0) - { - return scale; - } - if(scale < 0) - { - return -1 / scale; - } - return 1; -} - -void Scene_PatchScaleTexture_Selected(scene::Graph& graph, float s, float t) -{ - Scene_forEachVisibleSelectedPatch(PatchScaleTexture(Patch_convertScale(s), Patch_convertScale(t))); -} - -class PatchTranslateTexture -{ - float m_s, m_t; -public: - PatchTranslateTexture(float s, float t) - : m_s(s), m_t(t) - { - } - void operator()(Patch& patch) const - { - patch.TranslateTexture(m_s, m_t); - } -}; - -void Scene_PatchTranslateTexture_Selected(scene::Graph& graph, float s, float t) -{ - Scene_forEachVisibleSelectedPatch(PatchTranslateTexture(s, t)); + Sys_UpdateWindows(W_ALL); } static void OnSpinChanged (GtkAdjustment *adj, gpointer data) @@ -518,701 +126,620 @@ static void OnSpinChanged (GtkAdjustment *adj, gpointer data) td.rotate = 0; td.scale[0] = td.scale[1] = 0; td.shift[0] = td.shift[1] = 0; + td.contents = 0; + td.flags = 0; + td.value = 0; if (adj->value == 0) return; - if (adj == g_object_get_data (G_OBJECT (g_PatchInspector.GetWidget()), "hshift_adj")) + if (adj == g_object_get_data (G_OBJECT (g_PatchDialog.GetWidget ()), "hshift_adj")) { - g_pi_globals.shift[0] = static_cast(atof (gtk_entry_get_text (GTK_ENTRY (data)))); + l_pPIIncrement->shift[0] = atof (gtk_entry_get_text (GTK_ENTRY (data))); if (adj->value > 0) - td.shift[0] = g_pi_globals.shift[0]; + td.shift[0] = l_pPIIncrement->shift[0]; else - td.shift[0] = -g_pi_globals.shift[0]; + td.shift[0] = -l_pPIIncrement->shift[0]; } - else if (adj == g_object_get_data (G_OBJECT (g_PatchInspector.GetWidget()), "vshift_adj")) + else if (adj == g_object_get_data (G_OBJECT (g_PatchDialog.GetWidget ()), "vshift_adj")) { - g_pi_globals.shift[1] = static_cast(atof (gtk_entry_get_text (GTK_ENTRY (data)))); + l_pPIIncrement->shift[1] = atof (gtk_entry_get_text (GTK_ENTRY (data))); if (adj->value > 0) - td.shift[1] = g_pi_globals.shift[1]; + td.shift[1] = l_pPIIncrement->shift[1]; else - td.shift[1] = -g_pi_globals.shift[1]; + td.shift[1] = -l_pPIIncrement->shift[1]; } - else if (adj == g_object_get_data (G_OBJECT (g_PatchInspector.GetWidget()), "hscale_adj")) + else if (adj == g_object_get_data (G_OBJECT (g_PatchDialog.GetWidget ()), "hscale_adj")) { - g_pi_globals.scale[0] = static_cast(atof (gtk_entry_get_text (GTK_ENTRY (data)))); - if (g_pi_globals.scale[0] == 0.0f) - return; + l_pPIIncrement->scale[0] = atof (gtk_entry_get_text (GTK_ENTRY (data))); + if (l_pPIIncrement->scale[0] == 0.0f) + return; + // make sure scale factor is always >1 for increases and <1 for decreases if (adj->value > 0) - td.scale[0] = g_pi_globals.scale[0]; + { + if (l_pPIIncrement->scale[0] < 1) + td.scale[0] = l_pPIIncrement->scale[0]; + else + td.scale[0] = 1.0f / l_pPIIncrement->scale[0]; + } else - td.scale[0] = -g_pi_globals.scale[0]; + { + if (l_pPIIncrement->scale[0] < 1) + td.scale[0] = 1.0f / l_pPIIncrement->scale[0]; + else + td.scale[0] = l_pPIIncrement->scale[0]; + } } - else if (adj == g_object_get_data (G_OBJECT (g_PatchInspector.GetWidget()), "vscale_adj")) + else if (adj == g_object_get_data (G_OBJECT (g_PatchDialog.GetWidget ()), "vscale_adj")) { - g_pi_globals.scale[1] = static_cast(atof (gtk_entry_get_text (GTK_ENTRY (data)))); - if (g_pi_globals.scale[1] == 0.0f) - return; + l_pPIIncrement->scale[1] = atof (gtk_entry_get_text (GTK_ENTRY (data))); + if (l_pPIIncrement->scale[1] == 0.0f) + return; + // make sure scale factor is always >1 for increases and <1 for decreases if (adj->value > 0) - td.scale[1] = g_pi_globals.scale[1]; + { + if (l_pPIIncrement->scale[1] < 1) + td.scale[1] = l_pPIIncrement->scale[1]; + else + td.scale[1] = 1.0f / l_pPIIncrement->scale[1]; + } else - td.scale[1] = -g_pi_globals.scale[1]; + { + if (l_pPIIncrement->scale[1] < 1) + td.scale[1] = 1.0f / l_pPIIncrement->scale[1]; + else + td.scale[1] = l_pPIIncrement->scale[1]; + } } - else if (adj == g_object_get_data (G_OBJECT (g_PatchInspector.GetWidget()), "rotate_adj")) + else if (adj == g_object_get_data (G_OBJECT (g_PatchDialog.GetWidget ()), "rotate_adj")) { - g_pi_globals.rotate = static_cast(atof (gtk_entry_get_text (GTK_ENTRY (data)))); + l_pPIIncrement->rotate = atof (gtk_entry_get_text (GTK_ENTRY (data))); if (adj->value > 0) - td.rotate = g_pi_globals.rotate; + td.rotate = l_pPIIncrement->rotate; else - td.rotate = -g_pi_globals.rotate; + td.rotate = -l_pPIIncrement->rotate; } adj->value = 0; +#ifdef DBG_PI + Sys_Printf("Patch_SetTextureInfo: %g %g %g %g %g\n", td.shift[0], td.shift[1],td.scale[0],td.scale[1],td.rotate ); +#endif // will scale shift rotate the patch accordingly - - - if (td.shift[0] || td.shift[1]) - { - UndoableCommand command("patchTranslateTexture"); - Scene_PatchTranslateTexture_Selected (GlobalSceneGraph(), td.shift[0], td.shift[1]); - } - else if (td.scale[0] || td.scale[1]) - { - UndoableCommand command("patchScaleTexture"); - Scene_PatchScaleTexture_Selected (GlobalSceneGraph(), td.scale[0], td.scale[1]); - } - else if (td.rotate) - { - UndoableCommand command("patchRotateTexture"); - Scene_PatchRotateTexture_Selected (GlobalSceneGraph(), td.rotate); - } - + Patch_SetTextureInfo (&td); // update the point-by-point view - OnSelchangeComboColRow(0,0); + OnSelchangeComboColRow(NULL,NULL); + Sys_UpdateWindows (W_CAMERA); } static gint OnDialogKey (GtkWidget* widget, GdkEventKey* event, gpointer data) { +#ifdef DBG_PI + Sys_Printf("OnDialogKey\n"); +#endif if (event->keyval == GDK_Return) { - OnApply (0, 0); + OnApply (NULL, NULL); return TRUE; } else if (event->keyval == GDK_Escape) { - g_PatchInspector.GetPatchInfo(); + OnDone (NULL, NULL); return TRUE; } return FALSE; } // ============================================================================= -// PatchInspector class +// Global Functions -GtkWindow* PatchInspector::BuildDialog() +void DoPatchInspector() { - GtkWindow* window = create_floating_window("Patch Properties", m_parent); - - m_position_tracker.connect(window); - - global_accel_connect_window(window); - - window_connect_focus_in_clear_focus_widget(window); - - + // do we need to create the dialog? + if (g_PatchDialog.GetWidget() == NULL) { - GtkVBox* vbox = GTK_VBOX(gtk_vbox_new(FALSE, 5)); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); - gtk_widget_show(GTK_WIDGET(vbox)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - { - GtkHBox* hbox = GTK_HBOX(gtk_hbox_new(FALSE, 5)); - gtk_widget_show(GTK_WIDGET(hbox)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), TRUE, TRUE, 0); - { - GtkVBox* vbox2 = GTK_VBOX(gtk_vbox_new(FALSE, 0)); - gtk_container_set_border_width(GTK_CONTAINER(vbox2), 0); - gtk_widget_show(GTK_WIDGET(vbox2)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox2), TRUE, TRUE, 0); - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Details")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox3 = GTK_VBOX(gtk_vbox_new(FALSE, 5)); - gtk_container_set_border_width(GTK_CONTAINER(vbox3), 5); - gtk_widget_show(GTK_WIDGET(vbox3)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox3)); - { - GtkTable* table = GTK_TABLE(gtk_table_new(2, 2, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 5); - gtk_table_set_col_spacings(table, 5); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Row:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Column:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 1, 2, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(OnSelchangeComboColRow), this); - AddDialogData(*combo, m_nRow); - - gtk_widget_show(GTK_WIDGET(combo)); - gtk_table_attach(table, GTK_WIDGET(combo), 0, 1, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(combo), 60, -1); - m_pRowCombo = combo; - } - - { - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(OnSelchangeComboColRow), this); - AddDialogData(*combo, m_nCol); - - gtk_widget_show(GTK_WIDGET(combo)); - gtk_table_attach(table, GTK_WIDGET(combo), 1, 2, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(combo), 60, -1); - m_pColCombo = combo; - } - } - GtkTable* table = GTK_TABLE(gtk_table_new(5, 2, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 5); - gtk_table_set_col_spacings(table, 5); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("X:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Y:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Z:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 2, 3, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("S:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 3, 4, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("T:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 4, 5, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - AddDialogData(*entry, m_fX); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - AddDialogData(*entry, m_fY); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 2, 3, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - AddDialogData(*entry, m_fZ); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 3, 4, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - AddDialogData(*entry, m_fS); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 4, 5, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - AddDialogData(*entry, m_fT); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - } - } - if(g_pGameDescription->mGameType == "doom3") - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Tesselation")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox3 = GTK_VBOX(gtk_vbox_new(FALSE, 5)); - gtk_container_set_border_width(GTK_CONTAINER(vbox3), 5); - gtk_widget_show(GTK_WIDGET(vbox3)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox3)); - { - GtkTable* table = GTK_TABLE(gtk_table_new(3, 2, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 5); - gtk_table_set_col_spacings(table, 5); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Fixed")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkCheckButton* check = GTK_CHECK_BUTTON(gtk_check_button_new()); - gtk_widget_show(GTK_WIDGET(check)); - gtk_table_attach(table, GTK_WIDGET(check), 1, 2, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - m_subdivisions.m_enabled = check; - guint handler_id = g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(&Subdivisions::applyGtk), &m_subdivisions); - g_object_set_data(G_OBJECT(check), "handler", gint_to_pointer(handler_id)); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Horizontal")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 1, 2, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - m_subdivisions.m_horizontal = entry; - m_horizontalSubdivisionsEntry.connect(entry); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Vertical")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 2, 3, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 1, 2, 2, 3, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - m_subdivisions.m_vertical = entry; - m_verticalSubdivisionsEntry.connect(entry); - } - } - } - } - } - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Texturing")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox2 = GTK_VBOX(gtk_vbox_new(FALSE, 5)); - gtk_widget_show(GTK_WIDGET(vbox2)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox2)); - gtk_container_set_border_width(GTK_CONTAINER(vbox2), 5); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Name:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(label), TRUE, TRUE, 0); - gtk_label_set_justify(label, GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - // gtk_entry_set_editable (GTK_ENTRY (entry), false); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(entry), TRUE, TRUE, 0); - AddDialogData(*entry, m_strName); - - g_signal_connect(G_OBJECT(entry), "key_press_event", G_CALLBACK(OnDialogKey), 0); - } - { - GtkTable* table = GTK_TABLE(gtk_table_new(5, 3, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 5); - gtk_table_set_col_spacings(table, 5); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Horizontal Shift Step")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 2, 3, 0, 1, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Vertical Shift Step")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 2, 3, 1, 2, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Horizontal Stretch Step")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 2, 3, 2, 3, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Vertical Stretch Step")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 2, 3, 3, 4, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Rotate Step")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 2, 3, 4, 5, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 0, 1, 0, 1, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - g_object_set_data(G_OBJECT(window), "hshift_entry", entry); - // we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised - // so we need to have at least one initialisation somewhere - entry_set_float(entry, g_pi_globals.shift[0]); - - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 1, 1, 1)); - g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(OnSpinChanged), entry); - g_object_set_data(G_OBJECT(window), "hshift_adj", adj); - - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 0, 1, - (GtkAttachOptions)(0), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 10, -2); - GTK_WIDGET_UNSET_FLAGS(spin, GTK_CAN_FOCUS); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 0, 1, 1, 2, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - entry_set_float(entry, g_pi_globals.shift[1]); - - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 1, 1, 1)); - g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(OnSpinChanged), entry); - g_object_set_data(G_OBJECT(window), "vshift_adj", adj); - - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 1, 2, - (GtkAttachOptions)(0), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 10, -2); - GTK_WIDGET_UNSET_FLAGS(spin, GTK_CAN_FOCUS); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 0, 1, 2, 3, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - entry_set_float(entry, g_pi_globals.scale[0]); - - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -1000, 1000, 1, 1, 1)); - g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(OnSpinChanged), entry); - g_object_set_data(G_OBJECT(window), "hscale_adj", adj); - - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 2, 3, - (GtkAttachOptions)(0), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 10, -2); - GTK_WIDGET_UNSET_FLAGS(spin, GTK_CAN_FOCUS); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 0, 1, 3, 4, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - entry_set_float(entry, g_pi_globals.scale[1]); - - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -1000, 1000, 1, 1, 1)); - g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(OnSpinChanged), entry); - g_object_set_data(G_OBJECT(window), "vscale_adj", adj); - - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 3, 4, - (GtkAttachOptions)(0), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 10, -2); - GTK_WIDGET_UNSET_FLAGS(spin, GTK_CAN_FOCUS); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(table, GTK_WIDGET(entry), 0, 1, 4, 5, - (GtkAttachOptions)(GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - entry_set_float(entry, g_pi_globals.rotate); - - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -1000, 1000, 1, 1, 1)); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps - g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(OnSpinChanged), entry); - g_object_set_data(G_OBJECT(window), "rotate_adj", adj); - - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 4, 5, - (GtkAttachOptions)(0), - (GtkAttachOptions)(0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 10, -2); - GTK_WIDGET_UNSET_FLAGS(spin, GTK_CAN_FOCUS); - } - } - GtkHBox* hbox2 = GTK_HBOX(gtk_hbox_new(TRUE, 5)); - gtk_widget_show(GTK_WIDGET(hbox2)); - gtk_box_pack_start(GTK_BOX(vbox2), GTK_WIDGET(hbox2), TRUE, FALSE, 0); - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("CAP")); - gtk_widget_show(GTK_WIDGET(button)); - gtk_box_pack_end(GTK_BOX(hbox2), GTK_WIDGET(button), TRUE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(OnBtnPatchdetails), 0); - gtk_widget_set_usize(GTK_WIDGET(button), 60, -1); - } - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("Set...")); - gtk_widget_show(GTK_WIDGET(button)); - gtk_box_pack_end(GTK_BOX(hbox2), GTK_WIDGET(button), TRUE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(OnBtnPatchreset), 0); - gtk_widget_set_usize(GTK_WIDGET(button), 60, -1); - } - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("Natural")); - gtk_widget_show(GTK_WIDGET(button)); - gtk_box_pack_end(GTK_BOX(hbox2), GTK_WIDGET(button), TRUE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(OnBtnPatchnatural), 0); - gtk_widget_set_usize(GTK_WIDGET(button), 60, -1); - } - { - GtkButton* button = GTK_BUTTON(gtk_button_new_with_label("Fit")); - gtk_widget_show(GTK_WIDGET(button)); - gtk_box_pack_end(GTK_BOX(hbox2), GTK_WIDGET(button), TRUE, FALSE, 0); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(OnBtnPatchfit), 0); - gtk_widget_set_usize(GTK_WIDGET(button), 60, -1); - } - } - } - } + g_PatchDialog.Create(); + g_PatchDialog.UpdateData (FALSE); } + g_PatchDialog.GetPatchInfo(); + if (!l_bIsActive) + g_PatchDialog.ShowDlg (); +} - return window; +void UpdatePatchInspector() +{ + if (l_bIsActive) + g_PatchDialog.GetPatchInfo(); +} + +void TogglePatchInspector() +{ + if (l_bIsActive) + OnDone(NULL,NULL); + else + DoPatchInspector(); +} + +// ============================================================================= +// PatchDialog class + +PatchDialog::PatchDialog () +{ + m_strName = ""; + m_fS = 0.0f; + m_fT = 0.0f; + m_fX = 0.0f; + m_fY = 0.0f; + m_fZ = 0.0f; + m_nCol = 0; + m_nRow = 0; + m_Patch = NULL; + m_bListenChanged = true; +} + +void PatchDialog::InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName(SHADER_NOT_FOUND); + tex->scale[0] = 0.5f; + tex->scale[1] = 0.5f; + tex->rotate = 45; + tex->shift[0] = 8.0f; + tex->shift[1] = 8.0f; +} + +// we plug into HideDlg and ShowDlg to maintain the l_bIsActive flag +void PatchDialog::HideDlg() +{ + l_bIsActive = false; + Dialog::HideDlg(); +} + +void PatchDialog::ShowDlg() +{ + l_bIsActive = true; + Dialog::ShowDlg(); +} + +void PatchDialog::BuildDialog () +{ + GtkWidget *dlg, *vbox, *vbox2, *hbox, *hbox2, *frame, *table, *label; + GtkWidget *button, *entry, *spin, *combo; + GtkObject *adj; + char buf[32]; + + dlg = m_pWidget; + + load_window_pos (dlg, g_PrefsDlg.mWindowInfo.posPatchWnd); + + gtk_window_set_title (GTK_WINDOW (dlg), "Patch Properties"); + gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", GTK_SIGNAL_FUNC (OnDone), NULL); + // catch 'Esc' and 'Enter' + gtk_signal_connect (GTK_OBJECT (dlg), "key_press_event", GTK_SIGNAL_FUNC (OnDialogKey), NULL); + gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (g_pParentWnd->m_pWidget)); + + + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); + + frame = gtk_frame_new ("Details"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5); + + table = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Row:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Column:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + combo = gtk_combo_new (); + gtk_widget_show (combo); + gtk_table_attach (GTK_TABLE (table), combo, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (combo, 60, -1); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed", + GTK_SIGNAL_FUNC (OnSelchangeComboColRow), this); + AddDialogData (combo, &m_nRow, DLG_COMBO_INT); + m_pRowCombo = combo; + + combo = gtk_combo_new (); + gtk_widget_show (combo); + gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (combo, 60, -1); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed", + GTK_SIGNAL_FUNC (OnSelchangeComboColRow), this); + AddDialogData (combo, &m_nCol, DLG_COMBO_INT); + m_pColCombo = combo; + + table = gtk_table_new (5, 2, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("X:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Y:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Z:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("S:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("T:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_fX, DLG_ENTRY_FLOAT); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_fY, DLG_ENTRY_FLOAT); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_fZ, DLG_ENTRY_FLOAT); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_fS, DLG_ENTRY_FLOAT); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_fT, DLG_ENTRY_FLOAT); + + frame = gtk_frame_new ("Texturing"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); + + vbox2 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5); + + label = gtk_label_new ("Name:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox2), label, TRUE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + entry = gtk_entry_new (); +// gtk_entry_set_editable (GTK_ENTRY (entry), false); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (vbox2), entry, TRUE, TRUE, 0); + AddDialogData (entry, &m_strName, DLG_ENTRY_TEXT); + + table = gtk_table_new (5, 3, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Horizontal Shift Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Vertical Shift Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Horizontal Stretch Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Vertical Stretch Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + label = gtk_label_new ("Rotate Step"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); + g_object_set_data (G_OBJECT (m_pWidget), "hshift_entry", entry); + // we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised + // so we need to have at least one initialisation somewhere + sprintf (buf, "%g", l_pPIIncrement->shift[0]); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + adj = gtk_adjustment_new (0, -8192, 8192, 1, 1, 1); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnSpinChanged), entry); + g_object_set_data (G_OBJECT (m_pWidget), "hshift_adj", adj); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 10, -2); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); + sprintf (buf, "%g", l_pPIIncrement->shift[1]); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + adj = gtk_adjustment_new (0, -8192, 8192, 1, 1, 1); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnSpinChanged), entry); + g_object_set_data (G_OBJECT (m_pWidget), "vshift_adj", adj); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 10, -2); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); + sprintf (buf, "%g", l_pPIIncrement->scale[0]); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + adj = gtk_adjustment_new (0, -1000, 1000, 1, 1, 1); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnSpinChanged), entry); + g_object_set_data (G_OBJECT (m_pWidget), "hscale_adj", adj); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 2, 3, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 10, -2); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); + sprintf (buf, "%g", l_pPIIncrement->scale[1]); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + adj = gtk_adjustment_new (0, -1000, 1000, 1, 1, 1); + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnSpinChanged), entry); + g_object_set_data (G_OBJECT (m_pWidget), "vscale_adj", adj); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 3, 4, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 10, -2); + + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); + sprintf (buf, "%g", l_pPIIncrement->rotate); + gtk_entry_set_text (GTK_ENTRY (entry), buf); + + adj = gtk_adjustment_new (0, -1000, 1000, 1, 1, 1); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps + gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnSpinChanged), entry); + g_object_set_data (G_OBJECT (m_pWidget), "rotate_adj", adj); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 4, 5, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 10, -2); + + hbox2 = gtk_hbox_new (TRUE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, FALSE, 0); + + button = gtk_button_new_with_label ("CAP"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox2), button, TRUE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnPatchdetails), NULL); + gtk_widget_set_usize (button, 60, -1); + + button = gtk_button_new_with_label ("Set..."); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox2), button, TRUE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnPatchreset), NULL); + gtk_widget_set_usize (button, 60, -1); + + button = gtk_button_new_with_label ("Natural"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox2), button, TRUE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnPatchnatural), NULL); + gtk_widget_set_usize (button, 60, -1); + + button = gtk_button_new_with_label ("Fit"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox2), button, TRUE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnPatchfit), NULL); + gtk_widget_set_usize (button, 60, -1); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, FALSE, 0); + + button = gtk_button_new_with_label ("Done"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnDone), NULL); + gtk_widget_set_usize (button, 60, -1); + + button = gtk_button_new_with_label ("Apply"); + gtk_widget_show (button); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnApply), NULL); + gtk_widget_set_usize (button, 60, -1); } // sync the dialog our internal data structures -void PatchInspector::exportData() +void PatchDialog::UpdateData (bool retrieve) { + if (m_pWidget == NULL) + return; + m_bListenChanged = false; - Dialog::exportData(); - m_bListenChanged = true; -} -void PatchInspector::importData() -{ - m_bListenChanged = false; - Dialog::importData(); + Dialog::UpdateData (retrieve); m_bListenChanged = true; } // read the map and feed in the stuff to the dialog box -void PatchInspector::GetPatchInfo() +void PatchDialog::GetPatchInfo() { - if(g_pGameDescription->mGameType == "doom3") + m_Patch = SinglePatchSelected(); + if (m_Patch != NULL) { - m_subdivisions.update(); - } - - if(GlobalSelectionSystem().countSelected() == 0) - { - m_Patch = 0; - } - else - { - m_Patch = Node_getPatch(GlobalSelectionSystem().ultimateSelected().path().top()); - } - - if (m_Patch != 0) - { - m_strName = m_Patch->GetShader(); + m_strName = m_Patch->pShader->getName(); + GList *combo_list = NULL; + int i; + // fill in the numbers for Row / Col selection m_bListenChanged = false; + for (i = 0; i < m_Patch->height; i++) + combo_list = g_list_append (combo_list, g_strdup_printf ("%i", i)); // NOTE: leaving the g_strdup cause we free with g_free later on + gtk_combo_set_popdown_strings (GTK_COMBO (m_pRowCombo), combo_list); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (m_pRowCombo)->entry), "0"); + + while (combo_list) { - gtk_combo_box_set_active(m_pRowCombo, 0); - - for (std::size_t i = 0; i < m_countRows; ++i) - { - gtk_combo_box_remove_text(m_pRowCombo, gint(m_countRows - i - 1)); - } - - m_countRows = m_Patch->getHeight(); - for (std::size_t i = 0; i < m_countRows; ++i) - { - char buffer[16]; - sprintf(buffer, "%u", Unsigned(i)); - gtk_combo_box_append_text(m_pRowCombo, buffer); - } - - gtk_combo_box_set_active(m_pRowCombo, 0); + g_free (combo_list->data); + combo_list = g_list_remove (combo_list, combo_list->data); } + for (i = 0; i < m_Patch->width; i++) + combo_list = g_list_append (combo_list, g_strdup_printf ("%i", i)); + gtk_combo_set_popdown_strings (GTK_COMBO (m_pColCombo), combo_list); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (m_pColCombo)->entry), "0"); + + while (combo_list) { - gtk_combo_box_set_active(m_pColCombo, 0); - - for (std::size_t i = 0; i < m_countCols; ++i) - { - gtk_combo_box_remove_text(m_pColCombo, gint(m_countCols - i - 1)); - } - - m_countCols = m_Patch->getWidth(); - for (std::size_t i = 0; i < m_countCols; ++i) - { - char buffer[16]; - sprintf(buffer, "%u", Unsigned(i)); - gtk_combo_box_append_text(m_pColCombo, buffer); - } - - gtk_combo_box_set_active(m_pColCombo, 0); + g_free (combo_list->data); + combo_list = g_list_remove (combo_list, combo_list->data); } m_bListenChanged = true; } else - { - //globalOutputStream() << "WARNING: no patch\n"; - } + Sys_Printf("WARNING: no patch\n"); // fill in our internal structs m_nRow = 0; m_nCol = 0; UpdateRowColInfo(); // now update the dialog box - importData(); + UpdateData(false); } // read the current patch on map and initialize m_fX m_fY accordingly // NOTE: don't call UpdateData in there, it's not meant for -void PatchInspector::UpdateRowColInfo() +void PatchDialog::UpdateRowColInfo() { m_fX = m_fY = m_fZ = m_fS = m_fT = 0.0; - if (m_Patch != 0) + if (m_Patch != NULL) { // we rely on whatever active row/column has been set before we get called - std::size_t r = m_nRow; - std::size_t c = m_nCol; - if(r < m_Patch->getHeight() - && c < m_Patch->getWidth()) + int r = m_nRow; + int c = m_nCol; + if (r >= 0 && r < m_Patch->height && c >= 0 && c < m_Patch->width) { - const PatchControl& p = m_Patch->ctrlAt(r,c); - m_fX = p.m_vertex[0]; - m_fY = p.m_vertex[1]; - m_fZ = p.m_vertex[2]; - m_fS = p.m_texcoord[0]; - m_fT = p.m_texcoord[1]; + m_fX = m_Patch->ctrl[c][r].xyz[0]; + m_fY = m_Patch->ctrl[c][r].xyz[1]; + m_fZ = m_Patch->ctrl[c][r].xyz[2]; + m_fS = m_Patch->ctrl[c][r].st[0]; + m_fT = m_Patch->ctrl[c][r].st[1]; } } } - -void PatchInspector_SelectionChanged(const Selectable& selectable) -{ - PatchInspector_queueDraw(); -} - - -#include "preferencesystem.h" - - -void PatchInspector_Construct() -{ - GlobalCommands_insert("PatchInspector", FreeCaller(), Accelerator('S', (GdkModifierType)GDK_SHIFT_MASK)); - - GlobalPreferenceSystem().registerPreference("PatchWnd", WindowPositionTrackerImportStringCaller(g_PatchInspector.m_position_tracker), WindowPositionTrackerExportStringCaller(g_PatchInspector.m_position_tracker)); - GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Scale1", FloatImportStringCaller(g_pi_globals.scale[0]), FloatExportStringCaller(g_pi_globals.scale[0])); - GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Scale2", FloatImportStringCaller(g_pi_globals.scale[1]), FloatExportStringCaller(g_pi_globals.scale[1])); - GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Shift1", FloatImportStringCaller(g_pi_globals.shift[0]), FloatExportStringCaller(g_pi_globals.shift[0])); - GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Shift2", FloatImportStringCaller(g_pi_globals.shift[1]), FloatExportStringCaller(g_pi_globals.shift[1])); - GlobalPreferenceSystem().registerPreference("SI_PatchTexdef_Rotate", FloatImportStringCaller(g_pi_globals.rotate), FloatExportStringCaller(g_pi_globals.rotate)); - - typedef FreeCaller1 PatchInspectorSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(PatchInspectorSelectionChangedCaller()); - typedef FreeCaller PatchInspectorQueueDrawCaller; - Patch_addTextureChangedCallback(PatchInspectorQueueDrawCaller()); -} -void PatchInspector_Destroy() -{ -} diff --git a/radiant/patchdialog.h b/radiant/patchdialog.h index 61bcb07b..7316b88c 100644 --- a/radiant/patchdialog.h +++ b/radiant/patchdialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,25 +19,67 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PATCHDIALOG_H) -#define INCLUDED_PATCHDIALOG_H - -void PatchInspector_Construct(); -void PatchInspector_Destroy(); - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -void PatchInspector_constructWindow(GtkWindow* main_window); -void PatchInspector_destroyWindow(); - -namespace scene -{ - class Graph; -} - -void Scene_PatchTranslateTexture_Selected(scene::Graph& graph, float s, float t); -void Scene_PatchRotateTexture_Selected(scene::Graph& graph, float angle); -void Scene_PatchScaleTexture_Selected(scene::Graph& graph, float s, float t); +#ifndef _PATCHDIALOG_H_ +#define _PATCHDIALOG_H_ +#include "dialog.h" +#ifdef _DEBUG +//#define DBG_PI #endif + +class PatchDialog : public Dialog +{ + public: + // overrides from Dialog + void HideDlg(); + void ShowDlg(); + +// void UpdateInfo(); +// void SetPatchInfo(); + void GetPatchInfo(); + void UpdateSpinners(bool bUp, int nID); + // read the current patch on map and initialize m_fX m_fY accordingly + void UpdateRowColInfo(); + // sync the dialog our internal data structures + // depending on the flag it will read or write + // we use m_nCol m_nRow m_fX m_fY m_fZ m_fS m_fT m_strName + // (NOTE: this doesn't actually commit stuff to the map or read from it) + void UpdateData (bool retrieve); + + void InitDefaultIncrement(texdef_t *); + + PatchDialog(); + patchMesh_t *m_Patch; + + Str m_strName; + float m_fS; + float m_fT; + float m_fX; + float m_fY; + float m_fZ; +/* float m_fHScale; + float m_fHShift; + float m_fRotate; + float m_fVScale; + float m_fVShift; */ + int m_nCol; + int m_nRow; + GtkWidget *m_pRowCombo; + GtkWidget *m_pColCombo; + + GtkWidget *GetWidget () { return m_pWidget; } + + // 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for +// int m_nUndoId; + + // turn on/off processing of the "changed" "value_changed" messages + // (need to turn off when we are feeding data in) + // NOTE: much more simple than blocking signals + bool m_bListenChanged; + +protected: + void BuildDialog (); +}; + +#endif // _PATCHDIALOG_H_ diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp deleted file mode 100644 index 42129065..00000000 --- a/radiant/patchmanip.cpp +++ /dev/null @@ -1,1085 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "patchmanip.h" - -#include "debugging/debugging.h" - - -#include "iselection.h" -#include "ipatch.h" - -#include "math/vector.h" -#include "math/aabb.h" -#include "generic/callback.h" - -#include "gtkutil/menu.h" -#include "gtkutil/image.h" -#include "map.h" -#include "mainframe.h" -#include "commands.h" -#include "gtkmisc.h" -#include "gtkdlgs.h" -#include "texwindow.h" -#include "xywindow.h" -#include "select.h" -#include "patch.h" -#include "grid.h" - -PatchCreator* g_patchCreator = 0; - -void Scene_PatchConstructPrefab(scene::Graph& graph, const AABB aabb, const char* shader, EPatchPrefab eType, int axis, std::size_t width = 3, std::size_t height = 3) -{ - Select_Delete(); - GlobalSelectionSystem().setSelectedAll(false); - - NodeSmartReference node(g_patchCreator->createPatch()); - Node_getTraversable(Map_FindOrInsertWorldspawn(g_map))->insert(node); - - Patch* patch = Node_getPatch(node); - patch->SetShader(shader); - - patch->ConstructPrefab(aabb, eType, axis, width, height); - patch->controlPointsChanged(); - - { - scene::Path patchpath(makeReference(GlobalSceneGraph().root())); - patchpath.push(makeReference(*Map_GetWorldspawn(g_map))); - patchpath.push(makeReference(node.get())); - Instance_getSelectable(*graph.find(patchpath))->setSelected(true); - } -} - - -void Patch_makeCaps(Patch& patch, scene::Instance& instance, EPatchCap type, const char* shader) -{ - if((type == eCapEndCap || type == eCapIEndCap) - && patch.getWidth() != 5) - { - globalErrorStream() << "cannot create end-cap - patch width != 5\n"; - return; - } - if((type == eCapBevel || type == eCapIBevel) - && patch.getWidth() != 3 && patch.getWidth() != 5) - { - globalErrorStream() << "cannot create bevel-cap - patch width != 3\n"; - return; - } - if(type == eCapCylinder - && patch.getWidth() != 9) - { - globalErrorStream() << "cannot create cylinder-cap - patch width != 9\n"; - return; - } - - { - NodeSmartReference cap(g_patchCreator->createPatch()); - Node_getTraversable(instance.path().parent())->insert(cap); - - patch.MakeCap(Node_getPatch(cap), type, ROW, true); - Node_getPatch(cap)->SetShader(shader); - - scene::Path path(instance.path()); - path.pop(); - path.push(makeReference(cap.get())); - selectPath(path, true); - } - - { - NodeSmartReference cap(g_patchCreator->createPatch()); - Node_getTraversable(instance.path().parent())->insert(cap); - - patch.MakeCap(Node_getPatch(cap), type, ROW, false); - Node_getPatch(cap)->SetShader(shader); - - scene::Path path(instance.path()); - path.pop(); - path.push(makeReference(cap.get())); - selectPath(path, true); - } -} - -typedef std::vector InstanceVector; - -class PatchStoreInstance -{ - InstanceVector& m_instances; -public: - PatchStoreInstance(InstanceVector& instances) : m_instances(instances) - { - } - void operator()(PatchInstance& patch) const - { - m_instances.push_back(&patch); - } -}; - -enum ECapDialog { - PATCHCAP_BEVEL = 0, - PATCHCAP_ENDCAP, - PATCHCAP_INVERTED_BEVEL, - PATCHCAP_INVERTED_ENDCAP, - PATCHCAP_CYLINDER -}; - -EMessageBoxReturn DoCapDlg(ECapDialog *type); - -void Scene_PatchDoCap_Selected(scene::Graph& graph, const char* shader) -{ - ECapDialog nType; - - if(DoCapDlg(&nType) == eIDOK) - { - EPatchCap eType; - switch(nType) - { - case PATCHCAP_INVERTED_BEVEL: - eType = eCapIBevel; - break; - case PATCHCAP_BEVEL: - eType = eCapBevel; - break; - case PATCHCAP_INVERTED_ENDCAP: - eType = eCapIEndCap; - break; - case PATCHCAP_ENDCAP: - eType = eCapEndCap; - break; - case PATCHCAP_CYLINDER: - eType = eCapCylinder; - break; - default: - ERROR_MESSAGE("invalid patch cap type"); - return; - } - - InstanceVector instances; - Scene_forEachVisibleSelectedPatchInstance(PatchStoreInstance(instances)); - for(InstanceVector::const_iterator i = instances.begin(); i != instances.end(); ++i) - { - Patch_makeCaps(* Node_getPatch((*i)->path().top()), *(*i), eType, shader); - } - } -} - -Patch* Scene_GetUltimateSelectedVisiblePatch() -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - scene::Node& node = GlobalSelectionSystem().ultimateSelected().path().top(); - if(node.visible()) - { - return Node_getPatch(node); - } - } - return 0; -} - - -class PatchCapTexture -{ -public: - void operator()(Patch& patch) const - { - patch.ProjectTexture(Patch::m_CycleCapIndex); - } -}; - -void Scene_PatchCapTexture_Selected(scene::Graph& graph) -{ - Scene_forEachVisibleSelectedPatch(PatchCapTexture()); - Patch::m_CycleCapIndex = (Patch::m_CycleCapIndex == 0) ? 1 : (Patch::m_CycleCapIndex == 1) ? 2 : 0; - SceneChangeNotify(); -} - -class PatchFlipTexture -{ - int m_axis; -public: - PatchFlipTexture(int axis) : m_axis(axis) - { - } - void operator()(Patch& patch) const - { - patch.FlipTexture(m_axis); - } -}; - -void Scene_PatchFlipTexture_Selected(scene::Graph& graph, int axis) -{ - Scene_forEachVisibleSelectedPatch(PatchFlipTexture(axis)); -} - -class PatchNaturalTexture -{ -public: - void operator()(Patch& patch) const - { - patch.NaturalTexture(); - } -}; - -void Scene_PatchNaturalTexture_Selected(scene::Graph& graph) -{ - Scene_forEachVisibleSelectedPatch(PatchNaturalTexture()); - SceneChangeNotify(); -} - - -class PatchInsertRemove -{ - bool m_insert, m_column, m_first; -public: - PatchInsertRemove(bool insert, bool column, bool first) : m_insert(insert), m_column(column), m_first(first) - { - } - void operator()(Patch& patch) const - { - patch.InsertRemove(m_insert, m_column, m_first); - } -}; - -void Scene_PatchInsertRemove_Selected(scene::Graph& graph, bool bInsert, bool bColumn, bool bFirst) -{ - Scene_forEachVisibleSelectedPatch(PatchInsertRemove(bInsert, bColumn, bFirst)); -} - -class PatchInvertMatrix -{ -public: - void operator()(Patch& patch) const - { - patch.InvertMatrix(); - } -}; - -void Scene_PatchInvert_Selected(scene::Graph& graph) -{ - Scene_forEachVisibleSelectedPatch(PatchInvertMatrix()); -} - -class PatchRedisperse -{ - EMatrixMajor m_major; -public: - PatchRedisperse(EMatrixMajor major) : m_major(major) - { - } - void operator()(Patch& patch) const - { - patch.Redisperse(m_major); - } -}; - -void Scene_PatchRedisperse_Selected(scene::Graph& graph, EMatrixMajor major) -{ - Scene_forEachVisibleSelectedPatch(PatchRedisperse(major)); -} - -class PatchTransposeMatrix -{ -public: - void operator()(Patch& patch) const - { - patch.TransposeMatrix(); - } -}; - -void Scene_PatchTranspose_Selected(scene::Graph& graph) -{ - Scene_forEachVisibleSelectedPatch(PatchTransposeMatrix()); -} - -class PatchSetShader -{ - const char* m_name; -public: - PatchSetShader(const char* name) - : m_name(name) - { - } - void operator()(Patch& patch) const - { - patch.SetShader(m_name); - } -}; - -void Scene_PatchSetShader_Selected(scene::Graph& graph, const char* name) -{ - Scene_forEachVisibleSelectedPatch(PatchSetShader(name)); - SceneChangeNotify(); -} - -void Scene_PatchGetShader_Selected(scene::Graph& graph, CopiedString& name) -{ - Patch* patch = Scene_GetUltimateSelectedVisiblePatch(); - if(patch != 0) - { - name = patch->GetShader(); - } -} - -class PatchSelectByShader -{ - const char* m_name; -public: - inline PatchSelectByShader(const char* name) - : m_name(name) - { - } - void operator()(PatchInstance& patch) const - { - if(shader_equal(patch.getPatch().GetShader(), m_name)) - { - patch.setSelected(true); - } - } -}; - -void Scene_PatchSelectByShader(scene::Graph& graph, const char* name) -{ - Scene_forEachVisiblePatchInstance(PatchSelectByShader(name)); -} - - -class PatchFindReplaceShader -{ - const char* m_find; - const char* m_replace; -public: - PatchFindReplaceShader(const char* find, const char* replace) : m_find(find), m_replace(replace) - { - } - void operator()(Patch& patch) const - { - if(shader_equal(patch.GetShader(), m_find)) - { - patch.SetShader(m_replace); - } - } -}; - -void Scene_PatchFindReplaceShader(scene::Graph& graph, const char* find, const char* replace) -{ - Scene_forEachVisiblePatch(PatchFindReplaceShader(find, replace)); -} - -void Scene_PatchFindReplaceShader_Selected(scene::Graph& graph, const char* find, const char* replace) -{ - Scene_forEachVisibleSelectedPatch(PatchFindReplaceShader(find, replace)); -} - - -AABB PatchCreator_getBounds() -{ - AABB aabb(aabb_for_minmax(Select_getWorkZone().d_work_min, Select_getWorkZone().d_work_max)); - - float gridSize = GetGridSize(); - - if(aabb.extents[0] == 0) - { - aabb.extents[0] = gridSize; - } - if(aabb.extents[1] == 0) - { - aabb.extents[1] = gridSize; - } - if(aabb.extents[2] == 0) - { - aabb.extents[2] = gridSize; - } - - if(aabb_valid(aabb)) - { - return aabb; - } - return AABB(Vector3(0, 0, 0), Vector3(64, 64, 64)); -} - -void Patch_Cylinder() -{ - UndoableCommand undo("patchCreateCylinder"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eCylinder, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_DenseCylinder() -{ - UndoableCommand undo("patchCreateDenseCylinder"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eDenseCylinder, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_VeryDenseCylinder() -{ - UndoableCommand undo("patchCreateVeryDenseCylinder"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eVeryDenseCylinder, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_SquareCylinder() -{ - UndoableCommand undo("patchCreateSquareCylinder"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eSqCylinder, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_Endcap() -{ - UndoableCommand undo("patchCreateCaps"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eEndCap, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_Bevel() -{ - UndoableCommand undo("patchCreateBevel"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eBevel, GlobalXYWnd_getCurrentViewType()); -} - -void Patch_SquareBevel() -{ -} - -void Patch_SquareEndcap() -{ -} - -void Patch_Cone() -{ - UndoableCommand undo("patchCreateCone"); - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), eCone, GlobalXYWnd_getCurrentViewType()); -} - -void DoNewPatchDlg(); - -void Patch_Plane() -{ - UndoableCommand undo("patchCreatePlane"); - - DoNewPatchDlg(); -} - -void Patch_InsertInsertColumn() -{ - UndoableCommand undo("patchInsertColumns"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), true, true, false); -} - -void Patch_InsertAddColumn() -{ - UndoableCommand undo("patchAddColumns"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), true, true, true); -} - -void Patch_InsertInsertRow() -{ - UndoableCommand undo("patchInsertRows"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), true, false, false); -} - -void Patch_InsertAddRow() -{ - UndoableCommand undo("patchAddRows"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), true, false, true); -} - -void Patch_DeleteFirstColumn() -{ - UndoableCommand undo("patchDeleteFirstColumns"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), false, true, true); -} - -void Patch_DeleteLastColumn() -{ - UndoableCommand undo("patchDeleteLastColumns"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), false, true, false); -} - -void Patch_DeleteFirstRow() -{ - UndoableCommand undo("patchDeleteFirstRows"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), false, false, true); -} - -void Patch_DeleteLastRow() -{ - UndoableCommand undo("patchDeleteLastRows"); - - Scene_PatchInsertRemove_Selected(GlobalSceneGraph(), false, false, false); -} - -void Patch_Invert() -{ - UndoableCommand undo("patchInvert"); - - Scene_PatchInvert_Selected(GlobalSceneGraph()); -} - -void Patch_RedisperseRows() -{ - UndoableCommand undo("patchRedisperseRows"); - - Scene_PatchRedisperse_Selected(GlobalSceneGraph(), COL); -} - -void Patch_RedisperseCols() -{ - UndoableCommand undo("patchRedisperseColumns"); - - Scene_PatchRedisperse_Selected(GlobalSceneGraph(), COL); -} - -void Patch_Transpose() -{ - UndoableCommand undo("patchTranspose"); - - Scene_PatchTranspose_Selected(GlobalSceneGraph()); -} - -void Patch_Cap() -{ - // FIXME: add support for patch cap creation - // Patch_CapCurrent(); - UndoableCommand undo("patchCreateCaps"); - - Scene_PatchDoCap_Selected(GlobalSceneGraph(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); -} - -void Patch_CycleProjection() -{ - UndoableCommand undo("patchCycleUVProjectionAxis"); - - Scene_PatchCapTexture_Selected(GlobalSceneGraph()); -} - -///\todo Unfinished. -void Patch_OverlayOn() -{ -} - -///\todo Unfinished. -void Patch_OverlayOff() -{ -} - -void Patch_FlipTextureX() -{ - UndoableCommand undo("patchFlipTextureU"); - - Scene_PatchFlipTexture_Selected(GlobalSceneGraph(), 0); -} - -void Patch_FlipTextureY() -{ - UndoableCommand undo("patchFlipTextureV"); - - Scene_PatchFlipTexture_Selected(GlobalSceneGraph(), 1); -} - -void Patch_NaturalTexture() -{ - UndoableCommand undo("patchNaturalTexture"); - - Scene_PatchNaturalTexture_Selected(GlobalSceneGraph()); -} - - - - -#include "ifilter.h" - - -class filter_patch_all : public PatchFilter -{ -public: - bool filter(const Patch& patch) const - { - return true; - } -}; - -class filter_patch_shader : public PatchFilter -{ - const char* m_shader; -public: - filter_patch_shader(const char* shader) : m_shader(shader) - { - } - bool filter(const Patch& patch) const - { - return shader_equal(patch.GetShader(), m_shader); - } -}; - -class filter_patch_flags : public PatchFilter -{ - int m_flags; -public: - filter_patch_flags(int flags) : m_flags(flags) - { - } - bool filter(const Patch& patch) const - { - return (patch.getShaderFlags() & m_flags) != 0; - } -}; - - -filter_patch_all g_filter_patch_all; -filter_patch_shader g_filter_patch_clip("textures/common/clip"); -filter_patch_shader g_filter_patch_weapclip("textures/common/weapclip"); -filter_patch_flags g_filter_patch_translucent(QER_TRANS); - -void PatchFilters_construct() -{ - add_patch_filter(g_filter_patch_all, EXCLUDE_CURVES); - add_patch_filter(g_filter_patch_clip, EXCLUDE_CLIP); - add_patch_filter(g_filter_patch_weapclip, EXCLUDE_CLIP); - add_patch_filter(g_filter_patch_translucent, EXCLUDE_TRANSLUCENT); -} - - -#include "preferences.h" - -void Patch_constructPreferences(PreferencesPage& page) -{ - page.appendEntry("Patch Subdivide Threshold", g_PatchSubdivideThreshold); -} -void Patch_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Patches", "Patch Display Preferences")); - Patch_constructPreferences(page); -} -void Patch_registerPreferencesPage() -{ - PreferencesDialog_addDisplayPage(FreeCaller1()); -} - - -#include "preferencesystem.h" - -void PatchPreferences_construct() -{ - GlobalPreferenceSystem().registerPreference("Subdivisions", IntImportStringCaller(g_PatchSubdivideThreshold), IntExportStringCaller(g_PatchSubdivideThreshold)); -} - - -#include "generic/callback.h" - -void Patch_registerCommands() -{ - GlobalCommands_insert("InvertCurveTextureX", FreeCaller(), Accelerator('I', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("InvertCurveTextureY", FreeCaller(), Accelerator('I', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("IncPatchColumn", FreeCaller(), Accelerator(GDK_KP_Add, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("IncPatchRow", FreeCaller(), Accelerator(GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("DecPatchColumn", FreeCaller(), Accelerator(GDK_KP_Subtract, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("DecPatchRow", FreeCaller(), Accelerator(GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("NaturalizePatch", FreeCaller(), Accelerator('N', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("PatchCylinder", FreeCaller()); - GlobalCommands_insert("PatchDenseCylinder", FreeCaller()); - GlobalCommands_insert("PatchVeryDenseCylinder", FreeCaller()); - GlobalCommands_insert("PatchSquareCylinder", FreeCaller()); - GlobalCommands_insert("PatchEndCap", FreeCaller()); - GlobalCommands_insert("PatchBevel", FreeCaller()); - GlobalCommands_insert("PatchSquareBevel", FreeCaller()); - GlobalCommands_insert("PatchSquareEndcap", FreeCaller()); - GlobalCommands_insert("PatchCone", FreeCaller()); - GlobalCommands_insert("SimplePatchMesh", FreeCaller(), Accelerator('P', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("PatchInsertInsertColumn", FreeCaller()); - GlobalCommands_insert("PatchInsertAddColumn", FreeCaller()); - GlobalCommands_insert("PatchInsertInsertRow", FreeCaller()); - GlobalCommands_insert("PatchInsertAddRow", FreeCaller()); - GlobalCommands_insert("PatchDeleteFirstColumn", FreeCaller()); - GlobalCommands_insert("PatchDeleteLastColumn", FreeCaller()); - GlobalCommands_insert("PatchDeleteFirstRow", FreeCaller()); - GlobalCommands_insert("PatchDeleteLastRow", FreeCaller()); - GlobalCommands_insert("InvertCurve", FreeCaller(), Accelerator('I', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("RedisperseRows", FreeCaller(), Accelerator('E', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("RedisperseCols", FreeCaller(), Accelerator('E', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("MatrixTranspose", FreeCaller(), Accelerator('M', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("CapCurrentCurve", FreeCaller(), Accelerator('C', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("CycleCapTexturePatch", FreeCaller(), Accelerator('N', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("MakeOverlayPatch", FreeCaller(), Accelerator('Y')); - GlobalCommands_insert("ClearPatchOverlays", FreeCaller(), Accelerator('L', (GdkModifierType)GDK_CONTROL_MASK)); -} - -void Patch_constructToolbar(GtkToolbar* toolbar) -{ - toolbar_append_button(toolbar, "Put caps on the current patch (SHIFT + C)", "curve_cap.bmp", "CapCurrentCurve"); -} - -void Patch_constructMenu(GtkMenu* menu) -{ - create_menu_item_with_mnemonic(menu, "Cylinder", "PatchCylinder"); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More Cylinders"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Dense Cylinder", "PatchDenseCylinder"); - create_menu_item_with_mnemonic(menu_in_menu, "Very Dense Cylinder", "PatchVeryDenseCylinder"); - create_menu_item_with_mnemonic(menu_in_menu, "Square Cylinder", "PatchSquareCylinder"); - } - menu_separator (menu); - create_menu_item_with_mnemonic(menu, "End cap", "PatchEndCap"); - create_menu_item_with_mnemonic(menu, "Bevel", "PatchBevel"); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More End caps, Bevels"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Square Endcap", "PatchSquareBevel"); - create_menu_item_with_mnemonic(menu_in_menu, "Square Bevel", "PatchSquareEndcap"); - } - menu_separator (menu); - create_menu_item_with_mnemonic(menu, "Cone", "PatchCone"); - menu_separator (menu); - create_menu_item_with_mnemonic(menu, "Simple Patch Mesh...", "SimplePatchMesh"); - menu_separator (menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Insert"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Columns", "PatchInsertInsertColumn"); - create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Columns", "PatchInsertAddColumn"); - menu_separator (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Rows", "PatchInsertInsertRow"); - create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Rows", "PatchInsertAddRow"); - } - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Delete"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "First (2) Columns", "PatchDeleteFirstColumn"); - create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Columns", "PatchDeleteLastColumn"); - menu_separator (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "First (2) Rows", "PatchDeleteFirstRow"); - create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Rows", "PatchDeleteLastRow"); - } - menu_separator (menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Matrix"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Invert", "InvertCurve"); - GtkMenu* menu_3 = create_sub_menu_with_mnemonic (menu_in_menu, "Re-disperse"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_3); - create_menu_item_with_mnemonic(menu_3, "Rows", "RedisperseRows"); - create_menu_item_with_mnemonic(menu_3, "Columns", "RedisperseCols"); - create_menu_item_with_mnemonic(menu_in_menu, "Transpose", "MatrixTranspose"); - } - menu_separator (menu); - create_menu_item_with_mnemonic(menu, "Cap Selection", "CapCurrentCurve"); - create_menu_item_with_mnemonic(menu, "Cycle Cap Texture", "CycleCapTexturePatch"); - menu_separator (menu); - { - GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Overlay"); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu_in_menu); - create_menu_item_with_mnemonic(menu_in_menu, "Set", "MakeOverlayPatch"); - create_menu_item_with_mnemonic(menu_in_menu, "Clear", "ClearPatchOverlays"); - } -} - - -#include -#include -#include -#include -#include -#include -#include "gtkutil/dialog.h" -#include "gtkutil/widget.h" - -void DoNewPatchDlg() -{ - ModalDialog dialog; - GtkComboBox* width; - GtkComboBox* height; - - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Patch density", G_CALLBACK(dialog_delete_callback), &dialog); - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkTable* table = create_dialog_table(2, 2, 4, 4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(table), TRUE, TRUE, 0); - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Width:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - { - GtkLabel* label = GTK_LABEL(gtk_label_new("Height:")); - gtk_widget_show(GTK_WIDGET(label)); - gtk_table_attach(table, GTK_WIDGET(label), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - } - - { - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - gtk_combo_box_append_text(combo, "3"); - gtk_combo_box_append_text(combo, "5"); - gtk_combo_box_append_text(combo, "7"); - gtk_combo_box_append_text(combo, "9"); - gtk_combo_box_append_text(combo, "11"); - gtk_combo_box_append_text(combo, "13"); - gtk_combo_box_append_text(combo, "15"); - gtk_widget_show(GTK_WIDGET(combo)); - gtk_table_attach(table, GTK_WIDGET(combo), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - width = combo; - } - { - GtkComboBox* combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - gtk_combo_box_append_text(combo, "3"); - gtk_combo_box_append_text(combo, "5"); - gtk_combo_box_append_text(combo, "7"); - gtk_combo_box_append_text(combo, "9"); - gtk_combo_box_append_text(combo, "11"); - gtk_combo_box_append_text(combo, "13"); - gtk_combo_box_append_text(combo, "15"); - gtk_widget_show(GTK_WIDGET(combo)); - gtk_table_attach(table, GTK_WIDGET(combo), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - height = combo; - } - } - - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_grab_focus(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - } - } - - // Initialize dialog - gtk_combo_box_set_active(width, 0); - gtk_combo_box_set_active(height, 0); - - if(modal_dialog_show(window, dialog) == eIDOK) - { - int w = gtk_combo_box_get_active(width) * 2 + 3; - int h = gtk_combo_box_get_active(height) * 2 + 3; - - Scene_PatchConstructPrefab(GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser()), ePlane, GlobalXYWnd_getCurrentViewType(), w, h); - } - - gtk_widget_destroy(GTK_WIDGET(window)); -} - - - - -EMessageBoxReturn DoCapDlg(ECapDialog* type) -{ - ModalDialog dialog; - ModalDialogButton ok_button(dialog, eIDOK); - ModalDialogButton cancel_button(dialog, eIDCANCEL); - GtkWidget* bevel; - GtkWidget* ibevel; - GtkWidget* endcap; - GtkWidget* iendcap; - GtkWidget* cylinder; - - GtkWindow* window = create_modal_dialog_window(MainFrame_getWindow(), "Cap", dialog); - - GtkAccelGroup *accel_group = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel_group); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - - { - // Gef: Added a vbox to contain the toggle buttons - GtkVBox* radio_vbox = create_dialog_vbox(4); - gtk_container_add(GTK_CONTAINER(hbox), GTK_WIDGET(radio_vbox)); - - { - GtkTable* table = GTK_TABLE(gtk_table_new(5, 2, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(radio_vbox), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 5); - gtk_table_set_col_spacings(table, 5); - - { - GtkImage* image = new_local_image("cap_bevel.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(table, GTK_WIDGET(image), 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkImage* image = new_local_image("cap_endcap.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(table, GTK_WIDGET(image), 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkImage* image = new_local_image("cap_ibevel.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(table, GTK_WIDGET(image), 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkImage* image = new_local_image("cap_iendcap.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(table, GTK_WIDGET(image), 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkImage* image = new_local_image("cap_cylinder.bmp"); - gtk_widget_show(GTK_WIDGET(image)); - gtk_table_attach(table, GTK_WIDGET(image), 0, 1, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - - GSList* group = 0; - { - GtkWidget* button = gtk_radio_button_new_with_label (group, "Bevel"); - gtk_widget_show (button); - gtk_table_attach(table, button, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), - (GtkAttachOptions) (0), 0, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); - - bevel = button; - } - { - GtkWidget* button = gtk_radio_button_new_with_label (group, "Endcap"); - gtk_widget_show (button); - gtk_table_attach(table, button, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), - (GtkAttachOptions) (0), 0, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); - - endcap = button; - } - { - GtkWidget* button = gtk_radio_button_new_with_label (group, "Inverted Bevel"); - gtk_widget_show (button); - gtk_table_attach(table, button, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), - (GtkAttachOptions) (0), 0, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); - - ibevel = button; - } - { - GtkWidget* button = gtk_radio_button_new_with_label (group, "Inverted Endcap"); - gtk_widget_show (button); - gtk_table_attach(table, button, 1, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), - (GtkAttachOptions) (0), 0, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); - - iendcap = button; - } - { - GtkWidget* button = gtk_radio_button_new_with_label (group, "Cylinder"); - gtk_widget_show (button); - gtk_table_attach(table, button, 1, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), - (GtkAttachOptions) (0), 0, 0); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); - - cylinder = button; - } - } - } - - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, FALSE, 0); - { - GtkButton* button = create_modal_dialog_button("OK", ok_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - { - GtkButton* button = create_modal_dialog_button("Cancel", cancel_button); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE); - } - } - } - - // Initialize dialog - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bevel), TRUE); - - EMessageBoxReturn ret = modal_dialog_show(window, dialog); - if (ret == eIDOK) - { - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (bevel))) - *type = PATCHCAP_BEVEL; - else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(endcap))) - *type = PATCHCAP_ENDCAP; - else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ibevel))) - *type = PATCHCAP_INVERTED_BEVEL; - else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(iendcap))) - *type = PATCHCAP_INVERTED_ENDCAP; - else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cylinder))) - *type = PATCHCAP_CYLINDER; - } - - gtk_widget_destroy(GTK_WIDGET(window)); - - return ret; -} diff --git a/radiant/patchmanip.h b/radiant/patchmanip.h deleted file mode 100644 index e4d372e1..00000000 --- a/radiant/patchmanip.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_PATCHMANIP_H) -#define INCLUDED_PATCHMANIP_H - -#include "string/stringfwd.h" - -void Patch_registerCommands(); -typedef struct _GtkToolbar GtkToolbar; -typedef struct _GtkMenu GtkMenu; -void Patch_constructToolbar(GtkToolbar* toolbar); -void Patch_constructMenu(GtkMenu* menu); - -namespace scene -{ - class Graph; -} - -void Scene_PatchSetShader_Selected(scene::Graph& graph, const char* name); -void Scene_PatchGetShader_Selected(scene::Graph& graph, CopiedString& name); -void Scene_PatchSelectByShader(scene::Graph& graph, const char* name); -void Scene_PatchFindReplaceShader(scene::Graph& graph, const char* find, const char* replace); -void Scene_PatchFindReplaceShader_Selected(scene::Graph& graph, const char* find, const char* replace); - -void Scene_PatchCapTexture_Selected(scene::Graph& graph); -void Scene_PatchNaturalTexture_Selected(scene::Graph& graph); -void Scene_PatchTileTexture_Selected(scene::Graph& graph, float s, float t); - -void PatchFilters_construct(); - -void PatchPreferences_construct(); - -void Patch_registerPreferencesPage(); - -class PatchCreator; -extern PatchCreator* g_patchCreator; - -#endif diff --git a/radiant/patchmodule.cpp b/radiant/patchmodule.cpp deleted file mode 100644 index 713d2122..00000000 --- a/radiant/patchmodule.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "patchmodule.h" - -#include "qerplugin.h" -#include "ipatch.h" - -#include "patch.h" -#include "patchmanip.h" - -namespace -{ - std::size_t g_patchModuleCount = 0; -} - -void Patch_Construct(EPatchType type) -{ - if(++g_patchModuleCount != 1) - { - return; - } - - PatchFilters_construct(); - - PatchPreferences_construct(); - - Patch_registerPreferencesPage(); - - Patch::constructStatic(type); - PatchInstance::constructStatic(); - - if(type == ePatchTypeDoom3) - { - MAX_PATCH_WIDTH = MAX_PATCH_HEIGHT = 99; - } - else - { - MAX_PATCH_WIDTH = MAX_PATCH_HEIGHT = 15; - } -} - -void Patch_Destroy() -{ - if(--g_patchModuleCount != 0) - { - return; - } - - Patch::destroyStatic(); - PatchInstance::destroyStatic(); -} - -class CommonPatchCreator : public PatchCreator -{ -public: - void Patch_undoSave(scene::Node& patch) const - { - Node_getPatch(patch)->undoSave(); - } - void Patch_resize(scene::Node& patch, std::size_t width, std::size_t height) const - { - Node_getPatch(patch)->setDims(width, height); - } - PatchControlMatrix Patch_getControlPoints(scene::Node& node) const - { - Patch& patch = *Node_getPatch(node); - return PatchControlMatrix(patch.getHeight(), patch.getWidth(), patch.getControlPoints().data()); - } - void Patch_controlPointsChanged(scene::Node& patch) const - { - return Node_getPatch(patch)->controlPointsChanged(); - } - const char* Patch_getShader(scene::Node& patch) const - { - return Node_getPatch(patch)->GetShader(); - } - void Patch_setShader(scene::Node& patch, const char* shader) const - { - Node_getPatch(patch)->SetShader(shader); - } -}; - -class Quake3PatchCreator : public CommonPatchCreator -{ -public: - scene::Node& createPatch() - { - return (new PatchNodeQuake3())->node(); - } -}; - -Quake3PatchCreator g_Quake3PatchCreator; - -PatchCreator& GetQuake3PatchCreator() -{ - return g_Quake3PatchCreator; -} - -class Doom3PatchCreator : public CommonPatchCreator -{ -public: - scene::Node& createPatch() - { - return (new PatchNodeDoom3(true))->node(); - } -}; - -Doom3PatchCreator g_Doom3PatchCreator; - -PatchCreator& GetDoom3PatchCreator() -{ - return g_Doom3PatchCreator; -} - -class Doom3PatchDef2Creator : public CommonPatchCreator -{ -public: - scene::Node& createPatch() - { - return (new PatchNodeDoom3())->node(); - } -}; - -Doom3PatchDef2Creator g_Doom3PatchDef2Creator; - -PatchCreator& GetDoom3PatchDef2Creator() -{ - return g_Doom3PatchDef2Creator; -} - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class PatchDependencies : - public GlobalRadiantModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalFilterModuleRef -{ -}; - -class PatchQuake3API : public TypeSystemRef -{ - PatchCreator* m_patchquake3; -public: - typedef PatchCreator Type; - STRING_CONSTANT(Name, "quake3"); - - PatchQuake3API() - { - Patch_Construct(ePatchTypeQuake3); - - m_patchquake3 = &GetQuake3PatchCreator(); - g_patchCreator = m_patchquake3; - } - ~PatchQuake3API() - { - Patch_Destroy(); - } - PatchCreator* getTable() - { - return m_patchquake3; - } -}; - -typedef SingletonModule PatchQuake3Module; -typedef Static StaticPatchQuake3Module; -StaticRegisterModule staticRegisterPatchQuake3(StaticPatchQuake3Module::instance()); - - - -class PatchDoom3API : public TypeSystemRef -{ - PatchCreator* m_patchdoom3; -public: - typedef PatchCreator Type; - STRING_CONSTANT(Name, "doom3"); - - PatchDoom3API() - { - Patch_Construct(ePatchTypeDoom3); - - m_patchdoom3 = &GetDoom3PatchCreator(); - } - ~PatchDoom3API() - { - Patch_Destroy(); - } - PatchCreator* getTable() - { - return m_patchdoom3; - } -}; - -typedef SingletonModule PatchDoom3Module; -typedef Static StaticPatchDoom3Module; -StaticRegisterModule staticRegisterPatchDoom3(StaticPatchDoom3Module::instance()); - - -class PatchDef2Doom3API : public TypeSystemRef -{ - PatchCreator* m_patchdef2doom3; -public: - typedef PatchCreator Type; - STRING_CONSTANT(Name, "def2doom3"); - - PatchDef2Doom3API() - { - Patch_Construct(ePatchTypeDoom3); - - m_patchdef2doom3 = &GetDoom3PatchDef2Creator(); - g_patchCreator = m_patchdef2doom3; - } - ~PatchDef2Doom3API() - { - Patch_Destroy(); - } - PatchCreator* getTable() - { - return m_patchdef2doom3; - } -}; - -typedef SingletonModule PatchDef2Doom3Module; -typedef Static StaticPatchDef2Doom3Module; -StaticRegisterModule staticRegisterPatchDef2Doom3(StaticPatchDef2Doom3Module::instance()); - - - diff --git a/radiant/patchmodule.h b/radiant/patchmodule.h deleted file mode 100644 index 074d5947..00000000 --- a/radiant/patchmodule.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PATCHMODULE_H) -#define INCLUDED_PATCHMODULE_H - -#endif diff --git a/radiant/plugin.cpp b/radiant/plugin.cpp deleted file mode 100644 index fad47ea2..00000000 --- a/radiant/plugin.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugin.h" - -#include "debugging/debugging.h" - -#include "qerplugin.h" -#include "ifilesystem.h" -#include "ishaders.h" -#include "ientity.h" -#include "ieclass.h" -#include "irender.h" -#include "iscenegraph.h" -#include "iselection.h" -#include "ifilter.h" -#include "iscriplib.h" -#include "igl.h" -#include "iundo.h" -#include "itextures.h" -#include "ireference.h" -#include "ifiletypes.h" -#include "preferencesystem.h" -#include "ibrush.h" -#include "ipatch.h" -#include "iimage.h" -#include "itoolbar.h" -#include "iplugin.h" -#include "imap.h" -#include "namespace.h" - -#include "gtkutil/messagebox.h" -#include "gtkutil/filechooser.h" -#include "maplib.h" - -#include "error.h" -#include "map.h" -#include "qe3.h" -#include "entityinspector.h" -#include "entitylist.h" -#include "points.h" -#include "gtkmisc.h" -#include "texwindow.h" -#include "mainframe.h" -#include "build.h" -#include "mru.h" -#include "multimon.h" -#include "surfacedialog.h" -#include "groupdialog.h" -#include "patchdialog.h" -#include "camwindow.h" -#include "watchbsp.h" -#include "xywindow.h" -#include "entity.h" -#include "select.h" -#include "preferences.h" -#include "autosave.h" -#include "plugintoolbar.h" -#include "findtexturedialog.h" -#include "nullmodel.h" -#include "grid.h" - -#include "modulesystem/modulesmap.h" -#include "modulesystem/singletonmodule.h" - -#include "generic/callback.h" - -const char* GameDescription_getKeyValue(const char* key) -{ - return g_pGameDescription->getKeyValue(key); -} - -const char* GameDescription_getRequiredKeyValue(const char* key) -{ - return g_pGameDescription->getRequiredKeyValue(key); -} - -const char* getMapName() -{ - return Map_Name(g_map); -} - -scene::Node& getMapWorldEntity() -{ - return Map_FindOrInsertWorldspawn(g_map); -} - -VIEWTYPE XYWindow_getViewType() -{ - return g_pParentWnd->GetXYWnd()->GetViewType(); -} - -Vector3 XYWindow_windowToWorld(const WindowVector& position) -{ - Vector3 result(0, 0, 0); - g_pParentWnd->GetXYWnd()->XY_ToPoint(static_cast(position.x()), static_cast(position.y()), result); - return result; -} - -const char* TextureBrowser_getSelectedShader() -{ - return TextureBrowser_GetSelectedShader(GlobalTextureBrowser()); -} - -class RadiantCoreAPI -{ - _QERFuncTable_1 m_radiantcore; -public: - typedef _QERFuncTable_1 Type; - STRING_CONSTANT(Name, "*"); - - RadiantCoreAPI() - { - m_radiantcore.getEnginePath = &EnginePath_get; - m_radiantcore.getLocalRcPath = &LocalRcPath_get; - m_radiantcore.getAppPath = &AppPath_get; - m_radiantcore.getGameToolsPath = &GameToolsPath_get; - m_radiantcore.getSettingsPath = &SettingsPath_get; - m_radiantcore.getMapsPath = &getMapsPath; - - m_radiantcore.getGameName = &gamename_get; - m_radiantcore.getGameMode = &gamemode_get; - - m_radiantcore.getMapName = &getMapName; - m_radiantcore.getMapWorldEntity = getMapWorldEntity; - m_radiantcore.getGridSize = GetGridSize; - - m_radiantcore.getGameDescriptionKeyValue = &GameDescription_getKeyValue; - m_radiantcore.getRequiredGameDescriptionKeyValue = &GameDescription_getRequiredKeyValue; - - m_radiantcore.attachGameToolsPathObserver = Radiant_attachGameToolsPathObserver; - m_radiantcore.detachGameToolsPathObserver = Radiant_detachGameToolsPathObserver; - m_radiantcore.attachEnginePathObserver = Radiant_attachEnginePathObserver; - m_radiantcore.detachEnginePathObserver = Radiant_detachEnginePathObserver; - m_radiantcore.attachGameNameObserver = Radiant_attachGameNameObserver; - m_radiantcore.detachGameNameObserver = Radiant_detachGameNameObserver; - m_radiantcore.attachGameModeObserver = Radiant_attachGameModeObserver; - m_radiantcore.detachGameModeObserver = Radiant_detachGameModeObserver; - - m_radiantcore.XYWindowDestroyed_connect = XYWindowDestroyed_connect; - m_radiantcore.XYWindowDestroyed_disconnect = XYWindowDestroyed_disconnect; - m_radiantcore.XYWindowMouseDown_connect = XYWindowMouseDown_connect; - m_radiantcore.XYWindowMouseDown_disconnect = XYWindowMouseDown_disconnect; - m_radiantcore.XYWindow_getViewType = XYWindow_getViewType; - m_radiantcore.XYWindow_windowToWorld = XYWindow_windowToWorld; - m_radiantcore.TextureBrowser_getSelectedShader = TextureBrowser_getSelectedShader; - - m_radiantcore.m_pfnMessageBox = >k_MessageBox; - m_radiantcore.m_pfnFileDialog = &file_dialog; - m_radiantcore.m_pfnColorDialog = &color_dialog; - m_radiantcore.m_pfnDirDialog = &dir_dialog; - m_radiantcore.m_pfnNewImage = &new_plugin_image; - } - _QERFuncTable_1* getTable() - { - return &m_radiantcore; - } -}; - -typedef SingletonModule RadiantCoreModule; -typedef Static StaticRadiantCoreModule; -StaticRegisterModule staticRegisterRadiantCore(StaticRadiantCoreModule::instance()); - - -class RadiantDependencies : - public GlobalRadiantModuleRef, - public GlobalFileSystemModuleRef, - public GlobalEntityModuleRef, - public GlobalShadersModuleRef, - public GlobalBrushModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalFiletypesModuleRef, - public GlobalSelectionModuleRef, - public GlobalReferenceModuleRef, - public GlobalOpenGLModuleRef, - public GlobalEntityClassManagerModuleRef, - public GlobalUndoModuleRef, - public GlobalScripLibModuleRef, - public GlobalNamespaceModuleRef -{ - ImageModulesRef m_image_modules; - MapModulesRef m_map_modules; - ToolbarModulesRef m_toolbar_modules; - PluginModulesRef m_plugin_modules; - -public: - RadiantDependencies() : - GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities")), - GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders")), - GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")), - GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")), - m_image_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("texturetypes")), - m_map_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("maptypes")), - m_toolbar_modules("*"), - m_plugin_modules("*") - { - } - - ImageModules& getImageModules() - { - return m_image_modules.get(); - } - MapModules& getMapModules() - { - return m_map_modules.get(); - } - ToolbarModules& getToolbarModules() - { - return m_toolbar_modules.get(); - } - PluginModules& getPluginModules() - { - return m_plugin_modules.get(); - } -}; - -class Radiant : public TypeSystemRef -{ -public: - Radiant() - { - Preferences_Init(); - - GlobalFiletypes().addType("sound", "wav", filetype_t("PCM sound files", "*.wav")); - - Selection_construct(); - HomePaths_Construct(); - VFS_Construct(); - Grid_construct(); - MultiMon_Construct(); - MRU_Construct(); - Pointfile_Construct(); - GLWindow_Construct(); - BuildMenu_Construct(); - Map_Construct(); - EntityList_Construct(); - MainFrame_Construct(); - GroupDialog_Construct(); - SurfaceInspector_Construct(); - PatchInspector_Construct(); - CamWnd_Construct(); - XYWindow_Construct(); - BuildMonitor_Construct(); - TextureBrowser_Construct(); - Entity_Construct(); - Autosave_Construct(); - EntityInspector_construct(); - FindTextureDialog_Construct(); - NullModel_construct(); - MapRoot_construct(); - - EnginePath_verify(); - EnginePath_Realise(); - } - ~Radiant() - { - EnginePath_Unrealise(); - - MapRoot_destroy(); - NullModel_destroy(); - FindTextureDialog_Destroy(); - EntityInspector_destroy(); - Autosave_Destroy(); - Entity_Destroy(); - TextureBrowser_Destroy(); - BuildMonitor_Destroy(); - XYWindow_Destroy(); - CamWnd_Destroy(); - PatchInspector_Destroy(); - SurfaceInspector_Destroy(); - GroupDialog_Destroy(); - MainFrame_Destroy(); - EntityList_Destroy(); - Map_Destroy(); - BuildMenu_Destroy(); - GLWindow_Destroy(); - Pointfile_Destroy(); - MRU_Destroy(); - MultiMon_Destroy(); - Grid_destroy(); - VFS_Destroy(); - HomePaths_Destroy(); - Selection_destroy(); - } -}; - -namespace -{ - bool g_RadiantInitialised = false; - RadiantDependencies* g_RadiantDependencies; - Radiant* g_Radiant; -} - - - -bool Radiant_Construct(ModuleServer& server) -{ - GlobalModuleServer::instance().set(server); - StaticModuleRegistryList().instance().registerModules(); - - g_RadiantDependencies = new RadiantDependencies(); - - g_RadiantInitialised = !server.getError(); - - if(g_RadiantInitialised) - { - g_Radiant = new Radiant; - } - - return g_RadiantInitialised; -} -void Radiant_Destroy() -{ - if(g_RadiantInitialised) - { - delete g_Radiant; - } - - delete g_RadiantDependencies; -} - -ImageModules& Radiant_getImageModules() -{ - return g_RadiantDependencies->getImageModules(); -} -MapModules& Radiant_getMapModules() -{ - return g_RadiantDependencies->getMapModules(); -} -ToolbarModules& Radiant_getToolbarModules() -{ - return g_RadiantDependencies->getToolbarModules(); -} -PluginModules& Radiant_getPluginModules() -{ - return g_RadiantDependencies->getPluginModules(); -} - - diff --git a/radiant/plugin.h b/radiant/plugin.h index e4d2493d..060ddb56 100644 --- a/radiant/plugin.h +++ b/radiant/plugin.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,29 +19,27 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PLUGIN_H) -#define INCLUDED_PLUGIN_H +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ -class ModuleServer; -bool Radiant_Construct(ModuleServer& server); -void Radiant_Destroy(); +/*! +\class IPlugin +pure virtual interface for a plugin +temporary solution for migration from old plugin tech to synapse plugins +FIXME/TODO: plugin toolbar +*/ +class IPlugIn +{ +public: + IPlugIn() { } + virtual ~IPlugIn() { } + + virtual const char* getMenuName() = 0; + virtual int getCommandCount() = 0; + virtual const char* getCommand(int) = 0; + virtual void addMenuID(int) = 0; + virtual bool ownsCommandID(int n) = 0; +}; -template -class Modules; - -struct _QERPlugImageTable; -typedef Modules<_QERPlugImageTable> ImageModules; -ImageModules& Radiant_getImageModules(); -class MapFormat; -typedef Modules MapModules; -MapModules& Radiant_getMapModules(); -struct _QERPlugToolbarTable; -typedef Modules<_QERPlugToolbarTable> ToolbarModules; -ToolbarModules& Radiant_getToolbarModules(); -struct _QERPluginTable; -typedef Modules<_QERPluginTable> PluginModules; -PluginModules& Radiant_getPluginModules(); - - -#endif +#endif // _PLUGIN_H_ diff --git a/radiant/pluginapi.cpp b/radiant/pluginapi.cpp deleted file mode 100644 index be91b9a6..00000000 --- a/radiant/pluginapi.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pluginapi.h" - -#include "modulesystem.h" -#include "qerplugin.h" - -#include "generic/callback.h" -#include "math/vector.h" - -#include "gtkmisc.h" - -#include "camwindow.h" - -#include "mainframe.h" - - -// camera API -void QERApp_GetCamera( Vector3& origin, Vector3& angles ) -{ - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - origin = Camera_getOrigin(camwnd); - angles = Camera_getAngles(camwnd); -} - -void QERApp_SetCamera( const Vector3& origin, const Vector3& angles ) -{ - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - Camera_setOrigin(camwnd, origin); - Camera_setAngles(camwnd, angles); -} - -void QERApp_GetCamWindowExtents( int *x, int *y, int *width, int *height ) -{ -#if 0 - CamWnd* camwnd = g_pParentWnd->GetCamWnd(); - - gtk_window_get_position(GTK_WINDOW(camwnd->m_window), x, y); - - *width = camwnd->Camera()->width; - *height = camwnd->Camera()->height; -#endif -} - -#include "icamera.h" - -class CameraAPI -{ - _QERCameraTable m_camera; -public: - typedef _QERCameraTable Type; - STRING_CONSTANT(Name, "*"); - - CameraAPI() - { - m_camera.m_pfnGetCamera = &QERApp_GetCamera; - m_camera.m_pfnSetCamera = &QERApp_SetCamera; - m_camera.m_pfnGetCamWindowExtents = &QERApp_GetCamWindowExtents; - } - _QERCameraTable* getTable() - { - return &m_camera; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule CameraModule; -typedef Static StaticCameraModule; -StaticRegisterModule staticRegisterCamera(StaticCameraModule::instance()); - - diff --git a/radiant/pluginapi.h b/radiant/pluginapi.h deleted file mode 100644 index 267b0d7a..00000000 --- a/radiant/pluginapi.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGINAPI_H) -#define INCLUDED_PLUGINAPI_H - -template class BasicVector3; -typedef BasicVector3 Vector3; - -// camera API -void QERApp_GetCamera( Vector3& origin, Vector3& angles ); -void QERApp_SetCamera( const Vector3& origin, const Vector3& angles ); -void QERApp_GetCamWindowExtents( int *x, int *y, int *width, int *height ); - -#endif diff --git a/radiant/pluginentities.cpp b/radiant/pluginentities.cpp new file mode 100644 index 00000000..153a61fb --- /dev/null +++ b/radiant/pluginentities.cpp @@ -0,0 +1,74 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// implementation of IPluginEntities specific interface +// + +#ifdef USEPLUGINENTITIES + +#include "stdafx.h" +#if defined (__linux__) || defined (__APPLE__) +#include +#endif +//#include "qe3.h" + +int QERApp_EClassScanDir (char *path, void* hPlug) +{ + char temp[NAME_MAX]; + char filebase[NAME_MAX]; + char filename[NAME_MAX]; + char *s; + eclass_t *e; + DIR *dir; + struct dirent *dirlist; + + QE_ConvertDOSToUnixName( temp, path ); + strcpy (filebase, path); + s = filebase + strlen(filebase)-1; + while (*s != '\\' && *s != '/' && s!=filebase) + s--; + *s = 0; + + dir = opendir (path); + if (dir != NULL) + { + while ((dirlist = readdir (dir)) != NULL) + { + sprintf (filename, "%s/%s", filebase, dirlist->d_name); + Eclass_ScanFile (filename); + + if (eclass_found) + { + e = eclass_e; + e->modelpath = strdup(dirlist->d_name); + e->nShowFlags |= ECLASS_PLUGINENTITY; + e->hPlug = hPlug; + } + } + closedir (dir); + } + return 0; +} + +#endif // USEPLUGINENTITIES diff --git a/radiant/pluginmanager.cpp b/radiant/pluginmanager.cpp index 35933014..021531ac 100644 --- a/radiant/pluginmanager.cpp +++ b/radiant/pluginmanager.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -23,121 +23,556 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // ////////////////////////////////////////////////////////////////////// +#include "stdafx.h" +#if defined (__linux__) || defined (__APPLE__) + #include + #include +#endif +#ifdef __APPLE__ + #ifdef __cplusplus + extern "C" { + #endif + #include + #ifdef __cplusplus + } + #endif +#endif +#ifdef _WIN32 + #include "objbase.h" +#endif #include "pluginmanager.h" - -#include "modulesystem.h" -#include "qerplugin.h" -#include "iplugin.h" - -#include "math/vector.h" -#include "string/string.h" - -#include "error.h" -#include "select.h" #include "plugin.h" +#include "missing.h" +#include "filters.h" -#include "modulesystem.h" +#include "version.h" -#include +CRadiantImageManager g_ImageManager; +CRadiantPluginManager g_PluginsManager; -/* plugin manager --------------------------------------- */ -class CPluginSlot : public IPlugIn +_QERPlugSurfaceTable g_SurfaceTable; +_QERFileSystemTable g_FileSystemTable; +_QERShadersTable g_ShadersTable; +_QERPlugMapTable g_MapTable; +_QERPlugMapTable g_MapTable2; +_QEREntityTable g_EntityTable; +_EClassTable g_EClassDefTable; + +/*! + extending entity class formats + this approach only allows a single additional format, but it is enough for now +*/ +bool g_bHaveEClassExt = false; +_EClassTable g_EClassExtTable; + + +filetype_t g_pattern_all("all files", "*.*"); +filetype_t g_pattern_projqe4v2("qe4 v2 project files", "*.qe4"); +filetype_t g_pattern_projxml("xml project files", "*.proj"); +filetype_t g_pattern_mapq3("quake3 maps", "*.map"); +filetype_t g_pattern_mapxml("xml quake3 maps", "*.xmap"); +filetype_t g_pattern_modelmd3("md3 models", "*.md3"); +filetype_t g_pattern_modelmdc("mdc models", "*.mdc"); +filetype_t g_pattern_modelmd2("md2 models", "*.md2"); +filetype_t g_pattern_modelmdl("mdl models", "*.mdl"); +//filetype_t g_pattern_modelea3("EA3 models", "*.ea3"); +filetype_t g_pattern_soundwav("PCM sound files", "*.wav"); +filetype_t g_pattern_regq3("quake3 region", "*.reg"); + +#include + +class RadiantFileTypeRegistry : public IFileTypeRegistry { - CopiedString m_menu_name; - const _QERPluginTable *mpTable; - std::list m_CommandStrings; - std::list m_CommandTitleStrings; - std::list m_CommandIDs; - public: - /*! - build directly from a SYN_PROVIDE interface - */ - CPluginSlot(GtkWidget* main_window, const char* name, const _QERPluginTable& table); - /*! - dispatching a command by name to the plugin - */ - void Dispatch(const char *p); - - // IPlugIn ------------------------------------------------------------ - const char* getMenuName(); - std::size_t getCommandCount(); - const char* getCommand(std::size_t n); - const char* getCommandTitle(std::size_t n); - void addMenuID(std::size_t n); - bool ownsCommandID(std::size_t n); - + virtual ~RadiantFileTypeRegistry() {} + virtual void addType(const char* key, filetype_t type) + { + m_typelists[key].push_back(type); + } + virtual void getTypeList(const char* key, IFileTypeList* typelist) + { + filetype_list_t& list_ref = m_typelists[key]; + for(unsigned int i=0; iaddType(list_ref[i].getType()); + } +private: + struct filetype_copy_t + { + inline filetype_copy_t(const filetype_t other) + : m_name(other.name), m_pattern(other.pattern) + {} + inline filetype_t getType() const + { + return filetype_t(m_name.c_str(), m_pattern.c_str()); + } + private: + string_t m_name; + string_t m_pattern; + }; + typedef vector filetype_list_t; + map m_typelists; }; -CPluginSlot::CPluginSlot(GtkWidget* main_window, const char* name, const _QERPluginTable& table) +static RadiantFileTypeRegistry g_patterns; + +IFileTypeRegistry* GetFileTypeRegistry() { - mpTable = &table; - m_menu_name = name; + return &g_patterns; +} - const char* commands = mpTable->m_pfnQERPlug_GetCommandList(); - const char* titles = mpTable->m_pfnQERPlug_GetCommandTitleList(); +void InitFileTypes() +{ + //GetFileTypeRegistry()->addType("project", g_pattern_projqe4v2); + GetFileTypeRegistry()->addType("project", g_pattern_projxml); - StringTokeniser commandTokeniser(commands, ",;"); - StringTokeniser titleTokeniser(titles, ",;"); + GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapq3); + GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapxml); - const char* cmdToken = commandTokeniser.getToken(); - const char *titleToken = titleTokeniser.getToken(); - while (!string_empty(cmdToken)) + GetFileTypeRegistry()->addType("region", g_pattern_regq3); +/* + GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmd3); + GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmd2); + GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmdl); + GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmdc); + //GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelea3); + */ + + GetFileTypeRegistry()->addType("sound", g_pattern_soundwav); +} + + +class CRadiantModelModuleManager : public CSynapseAPIManager +{ + typedef list APIDescriptorList; + + APIDescriptorList mAPIs; +public: + CRadiantModelModuleManager() { - if(string_empty(titleToken)) + SetMatchAPI(MODEL_MAJOR, "*"); + } + virtual ~CRadiantModelModuleManager() + { + APIDescriptorList::iterator i; + for(i=mAPIs.begin(); i!=mAPIs.end(); i++) { - m_CommandStrings.push_back(cmdToken); - m_CommandTitleStrings.push_back(cmdToken); - cmdToken = commandTokeniser.getToken(); - titleToken = ""; + delete (_QERPlugModelTable*)(*i)->mpTable; + delete *i; + *i = NULL; } - else + mAPIs.clear(); + } + + // CSynapseAPIManager interface ------------------- + APIDescriptor_t* BuildRequireAPI(APIDescriptor_t* pAPI) + { + APIDescriptor_t* pRequireAPI = CSynapseAPIManager::PrepareRequireAPI(pAPI); + pRequireAPI->mpTable = new _QERPlugModelTable; + ((_QERPlugModelTable*)pRequireAPI->mpTable)->m_nSize = sizeof(_QERPlugModelTable); + pRequireAPI->mSize = sizeof(_QERPlugModelTable); + mAPIs.push_front(pRequireAPI); + return pRequireAPI; + } + + // Model Manager specific + const _QERPlugModelTable* GetModelTable(const char* version) + { + APIDescriptorList::iterator i; + for(i=mAPIs.begin(); i!=mAPIs.end(); i++) + if(strcmp(version, (*i)->minor_name) == 0) + return ((_QERPlugModelTable*)(*i)->mpTable); + return NULL; + } +}; + +CRadiantModelModuleManager g_ModelManager; + +/*! One of these exists for each unique model ID in use */ +class CModelWrapper +{ + friend class CModelManager; +public: + CModelWrapper (const char *id, const char* version) : refcount(1) + { + copy(id, version); + construct(); + } + void Refresh() + { + destroy(); + construct(); + } + ~CModelWrapper () + { + destroy(); + } +private: + void copy(const char* id, const char* version) + { + m_id = id; + m_version = version; + } + void construct() + { + m_model.pRender = NULL; + m_model.pSelect = NULL; + m_model.pEdit = NULL; + + const _QERPlugModelTable* pTable = g_ModelManager.GetModelTable(m_version.c_str()); + + if(pTable != NULL) + pTable->m_pfnLoadModel(&m_model, m_id.c_str()); + } + void destroy() + { + if (m_model.pRender) m_model.pRender->DecRef(); + if (m_model.pSelect) m_model.pSelect->DecRef(); + if (m_model.pEdit) m_model.pEdit->DecRef(); + } + string_t m_id; + string_t m_version; + entity_interfaces_t m_model; + int refcount; +}; + +/*! Creates and tracks CModelWrapper instances. +Creates a new instance for each unique ID requested, keeps count of the number of +times an ID is being referenced, and destroys any instance that is no longer in use */ +class CModelManager : public IModelCache +{ +public: + CModelManager() + { + m_ptrs = g_ptr_array_new (); + } + virtual ~CModelManager() + { + g_ptr_array_free(m_ptrs, FALSE); + } + + virtual void DeleteByID(const char *id, const char* version) + { + unsigned int i; + CModelWrapper *elem; + for(i=0; ilen; i++) { - m_CommandStrings.push_back(cmdToken); - m_CommandTitleStrings.push_back(titleToken); - cmdToken = commandTokeniser.getToken(); - titleToken = titleTokeniser.getToken(); + elem = (CModelWrapper*)m_ptrs->pdata[i]; + if(strcmp(elem->m_version.c_str(), version) == 0 + && strcmp(elem->m_id.c_str(), id) == 0 + && --elem->refcount == 0) + { + g_ptr_array_remove_index_fast(m_ptrs, i); + delete elem; + return; + } } } - mpTable->m_pfnQERPlug_Init(0, (void*)main_window); + + virtual entity_interfaces_t *GetByID(const char *id, const char* version) + { + unsigned int i; + CModelWrapper *elem; + for(i=0; ilen; i++) + { + elem = (CModelWrapper*)m_ptrs->pdata[i]; + if(strcmp(elem->m_version.c_str(), version) == 0 + && strcmp(elem->m_id.c_str(), id) == 0) + { + elem->refcount++; + return &elem->m_model; + } + } + + elem = new CModelWrapper(id, version); + g_ptr_array_add(m_ptrs, elem); + + return &elem->m_model; + } + + virtual void RefreshAll() + { + for(unsigned int i=0; ilen; ++i) + ((CModelWrapper*)m_ptrs->pdata[i])->Refresh(); + } +private: + GPtrArray *m_ptrs; // array of CModelWrapper* +}; + +CModelManager g_model_cache; + +IModelCache* GetModelCache() +{ + return &g_model_cache; +} + +// toolbar manager +class CRadiantToolbarModuleManager : public CSynapseAPIManager +{ + typedef list APIDescriptorList; + + APIDescriptorList mAPIs; +public: + CRadiantToolbarModuleManager() + { + SetMatchAPI(TOOLBAR_MAJOR, "*"); + } + virtual ~CRadiantToolbarModuleManager() + { + APIDescriptorList::iterator i; + for(i=mAPIs.begin(); i!=mAPIs.end(); i++) + { + delete (_QERPlugToolbarTable*)(*i)->mpTable; + delete *i; + *i = NULL; + } + mAPIs.clear(); + } + + // CSynapseAPIManager interface ------------------- + APIDescriptor_t* BuildRequireAPI(APIDescriptor_t* pAPI) + { + APIDescriptor_t* pRequireAPI = CSynapseAPIManager::PrepareRequireAPI(pAPI); + pRequireAPI->mpTable = new _QERPlugToolbarTable; + ((_QERPlugToolbarTable*)pRequireAPI->mpTable)->m_nSize = sizeof(_QERPlugToolbarTable); + pRequireAPI->mSize = sizeof(_QERPlugToolbarTable); + mAPIs.push_front(pRequireAPI); + return pRequireAPI; + } + + // Toolbar Manager specific + void ConstructToolbar() + { + APIDescriptorList::iterator i; + for(i=mAPIs.begin(); i!=mAPIs.end(); i++) + AddItem((_QERPlugToolbarTable*)(*i)->mpTable); + } + +private: + + void AddItem(_QERPlugToolbarTable* pTable) + { + const unsigned int count = pTable->m_pfnToolbarButtonCount(); + for(unsigned int i=0; im_pfnGetToolbarButton(i); + g_pParentWnd->AddPlugInToolbarButton(button); + } + } +}; + +CRadiantToolbarModuleManager g_ToolbarModuleManager; + + +/* image manager ---------------------------------------- */ + +CRadiantImageManager::~CRadiantImageManager() +{ + list::iterator iSlot; + for(iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++) + { + delete *iSlot; + *iSlot = NULL; + } +} + +void CImageTableSlot::InitForFillAPITable(APIDescriptor_t *pAPI) +{ + mpAPI = pAPI; + mpTable = new _QERPlugImageTable; + mpTable->m_nSize = sizeof(_QERPlugImageTable); + mpAPI->mSize = sizeof(_QERPlugImageTable); + mpAPI->mpTable = mpTable; +} + +void CRadiantImageManager::FillAPITable(APIDescriptor_t *pAPI) +{ + CImageTableSlot *pSlot = new CImageTableSlot(); + pSlot->InitForFillAPITable(pAPI); + mSlots.push_front(pSlot); +} + +/*! + Loads an image by calling the module that handles the extension extracted from the filename + \param name The filename to load. If no extension is provided, we walk the list of supported extensions. + \param pic The returned image data + \param width The returned width of the image + \param height The returned height of the image +*/ +void CRadiantImageManager::LoadImage(const char *name, byte **pic, int *width, int *height) +{ + const char *ext = NULL; + int len; + + // extract extension + len = strlen (name); + if ((len > 5) && (name[len-4] == '.')) + ext = &name[len-3]; + + if (ext == NULL) + { + // if no extension is provided, start walking through the list + Str fullname; + list::iterator iSlot; + for(iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++) + { + APIDescriptor_t *pAPI = (*iSlot)->GetDescriptor(); + fullname.Format("%s.%s", name, pAPI->minor_name); + (*iSlot)->GetTable()->m_pfnLoadImage(fullname.GetBuffer(), pic, width, height); + if (*pic) + return; // this was the right extension, we loaded + } + return; + } + + // start walking the interfaces + list::iterator iSlot; + for(iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++) + { + APIDescriptor_t *pAPI = (*iSlot)->GetDescriptor(); + if (!strcmp(pAPI->minor_name, ext)) + { + (*iSlot)->GetTable()->m_pfnLoadImage(name, pic, width, height); + return; + } + } + Sys_FPrintf(SYS_WRN, "WARNING: no image table for extension '%s'\n", ext); +} + +void CRadiantImageManager::BeginExtensionsScan() +{ + mExtScanSlot = mSlots.begin(); +} + +const char* CRadiantImageManager::GetNextExtension() +{ + if (mExtScanSlot != mSlots.end()) + { + char *ext = (*mExtScanSlot)->GetDescriptor()->minor_name; + mExtScanSlot++; + return ext; + } + return NULL; +} + +/* plugin manager --------------------------------------- */ +APIDescriptor_t* CRadiantPluginManager::BuildRequireAPI(APIDescriptor_t *pAPI) +{ + CPluginSlot *pSlot = new CPluginSlot(pAPI); + mSlots.push_front(pSlot); + return pSlot->GetDescriptor(); +} + +void CRadiantPluginManager::PopulateMenu() +{ + list::iterator iPlug; + for(iPlug=mSlots.begin(); iPlug != mSlots.end(); iPlug++) + { + g_pParentWnd->AddPlugInMenuItem(*iPlug); + } +} + +void CSynapseClientRadiant::ImportMap(IDataStream *in, CPtrArray *ents, const char *type) +{ + if (strcmp(type,"map")==0) + { + g_MapTable.m_pfnMap_Read(in, ents); + } + else if (strcmp(type,"xmap")==0) + { + g_MapTable2.m_pfnMap_Read(in, ents); + } + else + Sys_FPrintf(SYS_WRN, "WARNING: no module found for map interface type '%s'\n", type); +} + +void CSynapseClientRadiant::ExportMap(CPtrArray *ents, IDataStream *out, const char *type) +{ + if (strcmp(type,"map")==0) + { + g_MapTable.m_pfnMap_Write(ents, out); + } + else if (strcmp(type,"xmap")==0) + { + g_MapTable2.m_pfnMap_Write(ents, out); + } + else + Sys_FPrintf(SYS_WRN, "WARNING: no module found for map interface type '%s'\n", type); +} + +CPluginSlot::CPluginSlot(APIDescriptor_t *pAPI) +{ + mpAPI = CSynapseAPIManager::PrepareRequireAPI(pAPI); + mpTable = new _QERPluginTable; + mpTable->m_nSize = sizeof(_QERPluginTable); + mpAPI->mSize = sizeof(_QERPluginTable); + mpAPI->mpTable = mpTable; + m_CommandStrings = NULL; + m_CommandIDs = NULL; + m_bReady = false; +} + +CPluginSlot::~CPluginSlot() +{ + delete mpAPI; + delete mpTable; + while (m_CommandStrings) + { + ::free (m_CommandStrings->data); + m_CommandStrings = g_slist_remove (m_CommandStrings, m_CommandStrings->data); + } +} + +void CPluginSlot::Init() +{ + CString str = mpTable->m_pfnQERPlug_GetCommandList(); + char cTemp[1024]; + strcpy(cTemp, str); + char* token = strtok(cTemp, ",;"); + if (token && *token == ' ') + { + while (*token == ' ') + token++; + } + while (token != NULL) + { + m_CommandStrings = g_slist_append (m_CommandStrings, strdup (token)); + token = strtok(NULL, ",;"); + } + mpTable->m_pfnQERPlug_Init(NULL, (void*)g_pParentWnd->m_pWidget); + m_bReady = true; } const char* CPluginSlot::getMenuName() { - return m_menu_name.c_str(); + return mpAPI->minor_name; } -std::size_t CPluginSlot::getCommandCount() +int CPluginSlot::getCommandCount() { - return m_CommandStrings.size(); + if (!m_bReady) + Init(); + return g_slist_length (m_CommandStrings); } -const char* CPluginSlot::getCommand(std::size_t n) +const char* CPluginSlot::getCommand(int n) { - std::list::iterator i = m_CommandStrings.begin(); - while(n-- != 0) - ++i; - return (*i).c_str(); + if (!m_bReady) + Init(); + return (char*)g_slist_nth_data (m_CommandStrings, n); } -const char* CPluginSlot::getCommandTitle(std::size_t n) +void CPluginSlot::addMenuID(int n) { - std::list::iterator i = m_CommandTitleStrings.begin(); - while(n-- != 0) - ++i; - return (*i).c_str(); + m_CommandIDs = g_slist_append (m_CommandIDs, GINT_TO_POINTER (n)); } -void CPluginSlot::addMenuID(std::size_t n) +bool CPluginSlot::ownsCommandID(int n) { - m_CommandIDs.push_back(n); -} + GSList* lst; -bool CPluginSlot::ownsCommandID(std::size_t n) -{ - for(std::list::iterator i = m_CommandIDs.begin(); i != m_CommandIDs.end(); ++i) + for (lst = m_CommandIDs; lst != NULL; lst = g_slist_next (lst)) { - if (*i == n) + if (GPOINTER_TO_INT (lst->data) == n) return true; } return false; @@ -145,50 +580,32 @@ bool CPluginSlot::ownsCommandID(std::size_t n) void CPluginSlot::Dispatch(const char *p) { - Vector3 vMin, vMax; - Select_GetBounds (vMin, vMax); - mpTable->m_pfnQERPlug_Dispatch(p, reinterpret_cast(&vMin), reinterpret_cast(&vMax), true);//QE_SingleBrush(true)); + vec3_t vMin, vMax; + if (selected_brushes.next == &selected_brushes) + { + vMin[0] = vMin[1] = vMin[2] = 0; + VectorCopy(vMin, vMax); + } else + { + Select_GetBounds (vMin, vMax); + } + mpTable->m_pfnQERPlug_Dispatch(p, vMin, vMax, QE_SingleBrush(true)); } - -class CPluginSlots +CRadiantPluginManager::~CRadiantPluginManager() { - std::list mSlots; -public: - virtual ~CPluginSlots(); - - void AddPluginSlot(GtkWidget* main_window, const char* name, const _QERPluginTable& table) - { - mSlots.push_back(new CPluginSlot(main_window, name, table)); - } - - void PopulateMenu(PluginsVisitor& menu); - bool Dispatch(std::size_t n, const char* p); -}; - -CPluginSlots::~CPluginSlots() -{ - std::list::iterator iSlot; - for(iSlot=mSlots.begin(); iSlot!=mSlots.end(); ++iSlot) + list::iterator iSlot; + for(iSlot=mSlots.begin(); iSlot!=mSlots.end(); iSlot++) { delete *iSlot; - *iSlot = 0; + *iSlot = NULL; } } -void CPluginSlots::PopulateMenu(PluginsVisitor& menu) +bool CRadiantPluginManager::Dispatch(int n, const char* p) { - std::list::iterator iPlug; - for(iPlug=mSlots.begin(); iPlug != mSlots.end(); ++iPlug) - { - menu.visit(*(*iPlug)); - } -} - -bool CPluginSlots::Dispatch(std::size_t n, const char* p) -{ - std::list::iterator iPlug; - for(iPlug=mSlots.begin(); iPlug!=mSlots.end(); ++iPlug) + list::iterator iPlug; + for(iPlug=mSlots.begin(); iPlug!=mSlots.end(); iPlug++) { CPluginSlot *pPlug = *iPlug; if (pPlug->ownsCommandID(n)) @@ -200,54 +617,1909 @@ bool CPluginSlots::Dispatch(std::size_t n, const char* p) return false; } -CPluginSlots g_plugin_slots; +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// - -void FillPluginSlots(CPluginSlots& slots, GtkWidget* main_window) +CPlugInManager::CPlugInManager() { - class AddPluginVisitor : public PluginModules::Visitor + PatchesMode = EActivePatches; + m_PlugIns = NULL; +} + +CPlugInManager::~CPlugInManager() +{ + Cleanup(); +} + +void CPlugInManager::InitForDir(const Str &dir) +{ + Str path; + + path = dir; + path += g_strPluginsDir; + // SYNAPSE + g_pParentWnd->GetSynapseServer().AddSearchPath(path); + + if (strcmp(g_strPluginsDir.GetBuffer(), g_strModulesDir.GetBuffer()) != 0) { - CPluginSlots& m_slots; - GtkWidget* m_main_window; - public: - AddPluginVisitor(CPluginSlots& slots, GtkWidget* main_window) - : m_slots(slots), m_main_window(main_window) - { - } - void visit(const char* name, const _QERPluginTable& table) const - { - m_slots.AddPluginSlot(m_main_window, name, table); - } - } visitor(slots, main_window); - - Radiant_getPluginModules().foreachModule(visitor); + path = dir; + path += g_strModulesDir; + // SYNAPSE + g_pParentWnd->GetSynapseServer().AddSearchPath(path); + } } +static const XMLConfigEntry_t manager_entries[] = + { + { VFS_MAJOR, SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable }, + { SHADERS_MAJOR, SYN_REQUIRE, sizeof(g_ShadersTable), &g_ShadersTable }, + { MAP_MAJOR, SYN_REQUIRE, sizeof(g_MapTable), &g_MapTable }, + { ECLASS_MAJOR, SYN_REQUIRE, sizeof(g_EClassDefTable), &g_EClassDefTable }, + { SURFACEDIALOG_MAJOR, SYN_REQUIRE, sizeof(g_SurfaceTable), &g_SurfaceTable }, + { NULL, SYN_UNKNOWN, 0, NULL } }; -#include "pluginmanager.h" - -CPlugInManager g_PlugInMgr; - -CPlugInManager& GetPlugInMgr() +void CPlugInManager::Init() { - return g_PlugInMgr; -} + Str synapse_config; + + Cleanup(); + + // set some globals + g_qeglobals.bBSPFrontendPlugin = false; -void CPlugInManager::Dispatch(std::size_t n, const char * p) -{ - g_plugin_slots.Dispatch(n, p); -} + InitForDir(g_strGameToolsPath); + InitForDir(g_strAppPath); -void CPlugInManager::Init(GtkWidget* main_window) -{ - FillPluginSlots(g_plugin_slots, main_window); -} - -void CPlugInManager::constructMenu(PluginsVisitor& menu) -{ - g_plugin_slots.PopulateMenu(menu); + synapse_config = g_strGameToolsPath; + synapse_config += "synapse.config"; + if (!g_pParentWnd->GetSynapseServer().Initialize(synapse_config.GetBuffer(), &Sys_Printf_VA)) + Error("Synpase server initialization failed (see console)\n"); + + // builtin modules + g_pParentWnd->GetSynapseServer().EnumerateBuiltinModule(&eclass_def); + + // APIs we provide + g_pParentWnd->GetSynapseClient().AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1)); + g_pParentWnd->GetSynapseClient().AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(_QERScripLibTable)); + g_pParentWnd->GetSynapseClient().AddAPI(BRUSH_MAJOR, NULL, sizeof(_QERBrushTable)); + g_pParentWnd->GetSynapseClient().AddAPI(APPSHADERS_MAJOR, NULL, sizeof(_QERAppShadersTable)); + g_pParentWnd->GetSynapseClient().AddAPI(QGL_MAJOR, NULL, sizeof(_QERQglTable)); + g_pParentWnd->GetSynapseClient().AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable)); + g_pParentWnd->GetSynapseClient().AddAPI(PATCH_MAJOR, NULL, sizeof(_QERPatchTable)); + g_pParentWnd->GetSynapseClient().AddAPI(ECLASSMANAGER_MAJOR, NULL, sizeof(_EClassManagerTable)); + g_pParentWnd->GetSynapseClient().AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable)); + g_pParentWnd->GetSynapseClient().AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable)); + g_pParentWnd->GetSynapseClient().AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable)); + g_pParentWnd->GetSynapseClient().AddAPI(UI_MAJOR, NULL, sizeof(_QERUITable)); + g_pParentWnd->GetSynapseClient().AddAPI(UIGTK_MAJOR, NULL, sizeof(_QERUIGtkTable)); + g_pParentWnd->GetSynapseClient().AddAPI(CAMERA_MAJOR, NULL, sizeof(_QERCameraTable)); + + // modules configured by XML + if ( !g_pParentWnd->GetSynapseClient().ConfigXML( &g_pParentWnd->GetSynapseServer(), "core", manager_entries ) ) { + Error("Synapse server initialization failed (see console)\n"); + } + + // adding a manager is a special case that ConfigXML doesn't take care of + g_pParentWnd->GetSynapseServer().SelectClientConfig( "core" ); + char *minor; + if ( !g_pParentWnd->GetSynapseServer().GetConfigForAPI( IMAGE_MAJOR, &minor ) ) { + Syn_Printf( "GetConfigForAPI '%s' failed - invalid XML config file?\n", IMAGE_MAJOR ); + Error("Synapse server initialization failed (see console)\n"); + } + g_ImageManager.SetMatchAPI( IMAGE_MAJOR, minor ); + g_pParentWnd->GetSynapseClient().AddManager( &g_ImageManager ); + + // SYN_REQUIRE entries which are still hardcoded + g_pParentWnd->GetSynapseClient().AddAPI(MAP_MAJOR, "mapxml", sizeof(g_MapTable2), SYN_REQUIRE, &g_MapTable2); + g_pParentWnd->GetSynapseClient().AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable); + + // plugins: load anything that claims to be a plugin + // minor becomes some kind of matching pattern + // g_PluginsManager is an API any class, it receives several function tables as needed + // you can't do a SYN_PROVIDE with that, has to be a SYN_REQUIRE ? + g_PluginsManager.SetMatchAPI(PLUGIN_MAJOR, "*"); + g_pParentWnd->GetSynapseClient().AddManager(&g_PluginsManager); + g_pParentWnd->GetSynapseClient().AddManager(&g_ToolbarModuleManager); + g_pParentWnd->GetSynapseClient().AddManager(&g_ModelManager); + if (!g_pParentWnd->GetSynapseServer().Resolve(&g_pParentWnd->GetSynapseClient())) + { + Error("synapse initialization fail (see console)"); + } + g_PluginsManager.PopulateMenu(); + g_ToolbarModuleManager.ConstructToolbar(); + InitFileTypes(); } void CPlugInManager::Shutdown() { + g_pParentWnd->GetSynapseServer().Shutdown(); +} + +void CPlugInManager::Cleanup() +{ + int i; + + for (i = 0; i < m_BrushHandles.GetSize(); i++) + { + brush_t *pb = reinterpret_cast(m_BrushHandles.GetAt(i)); + Brush_Free(pb); + } + m_BrushHandles.RemoveAll(); + + for (i = 0; i < m_EntityHandles.GetSize(); i++) + { + entity_t *pe = reinterpret_cast(m_EntityHandles.GetAt(i)); + Entity_Free(pe); + } + m_EntityHandles.RemoveAll(); + + // patches + // these are linked into the map + m_PatchesHandles.RemoveAll(); + // these patches were allocated by Radiant on plugin request + // if the list is not empty, it means either the plugin asked for allocation and never commited them to the map + // in which case we are supposed to delete them + // or it commited them but never called m_pfnReleasePatchHandles, in case the patches may have already been + // erased and we are trying a second time, therefore crashing .. + //++timo FIXME: for now I leave a leak warning, we'd need a table to keep track of commited patches +#ifdef _DEBUG + if (m_PluginPatches.GetSize() != 0) + Sys_Printf("WARNING: m_PluginPatches.GetSize() != 0 in CPlugInManager::Cleanup, possible leak\n"); +#endif + +/* for (i = 0; i < m_PluginPatches.GetSize(); i++) + { + patchMesh_t *pMesh = reinterpret_cast(m_PluginPatches.GetAt(i)); + if (pMesh->pSymbiot) + delete pMesh; + } + m_PluginPatches.RemoveAll(); */ +} + +void CPlugInManager::Dispatch(int n, const char * p) +{ + g_PluginsManager.Dispatch(n, p); +} + +void WINAPI QERApp_GetDispatchParams(vec3_t vMin, vec3_t vMax, bool *bSingleBrush) +{ + if (selected_brushes.next == &selected_brushes) + { + vMin[0] = vMin[1] = vMin[2] = 0; + VectorCopy(vMin, vMax); + } else + { + Select_GetBounds (vMin, vMax); + } + + if( bSingleBrush ) + *bSingleBrush = QE_SingleBrush(true); +} + + +// creates a dummy brush in the active brushes list +// FIXME : is this one really USED ? +void WINAPI QERApp_CreateBrush(vec3_t vMin, vec3_t vMax) +{ + + brush_t* pBrush = Brush_Create(vMin, vMax, &g_qeglobals.d_texturewin.texdef); + Entity_LinkBrush (world_entity, pBrush); + Brush_Build(pBrush); + Brush_AddToList (pBrush, &active_brushes); + Select_Brush(pBrush); + Sys_UpdateWindows(W_ALL); +} + +void* CPlugInManager::CreateBrushHandle() +{ + brush_t *pb = Brush_Alloc(); + pb->numberId = g_nBrushId++; + m_BrushHandles.Add(pb); + return(void*)pb; +} + +void CPlugInManager::DeleteBrushHandle(void * vp) +{ + CPtrArray* pHandles[3]; + pHandles[0] = &m_SelectedBrushHandles; + pHandles[1] = &m_ActiveBrushHandles; + pHandles[2] = &m_BrushHandles; + + for (int j = 0; j < 3; j++) + { + for (int i = 0; i < pHandles[j]->GetSize(); i++) + { + brush_t *pb = reinterpret_cast(pHandles[j]->GetAt(i)); + if (pb == reinterpret_cast(vp)) + { + if (j == 2) + { + // only remove it from the list if it is work area + // this allows the selected and active list indexes to remain constant + // throughout a session (i.e. between an allocate and release) + pHandles[j]->RemoveAt(i); + } + Brush_Free(pb); + Sys_MarkMapModified(); // PGM + return; + } + } + } +} + +void CPlugInManager::CommitBrushHandleToMap(void * vp) +{ + g_bScreenUpdates = false; + for (int i = 0; i < m_BrushHandles.GetSize(); i++) + { + brush_t *pb = reinterpret_cast(m_BrushHandles.GetAt(i)); + if (pb == reinterpret_cast(vp)) + { + m_BrushHandles.RemoveAt(i); + Entity_LinkBrush (world_entity, pb); + Brush_Build(pb); + Brush_AddToList (pb, &active_brushes); + Select_Brush(pb); + } + } + g_bScreenUpdates = true; + Sys_UpdateWindows(W_ALL); +} + +void CPlugInManager::AddFaceToBrushHandle(void * vp, vec3_t v1, vec3_t v2, vec3_t v3) +{ + brush_t *bp = FindBrushHandle(vp); + if (bp != NULL) + { + face_t *f = Face_Alloc(); + f->texdef = g_qeglobals.d_texturewin.texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; + f->next = bp->brush_faces; + bp->brush_faces = f; + VectorCopy (v1, f->planepts[0]); + VectorCopy (v2, f->planepts[1]); + VectorCopy (v3, f->planepts[2]); + } +} + +brush_t* CPlugInManager::FindBrushHandle(void * vp) +{ + CPtrArray* pHandles[4]; + pHandles[0] = &m_SelectedBrushHandles; + pHandles[1] = &m_ActiveBrushHandles; + pHandles[2] = &m_BrushHandles; + pHandles[3] = &m_EntityBrushHandles; + + for (int j = 0; j < 4; j++) + { + for (int i = 0; i < pHandles[j]->GetSize(); i++) + { + brush_t *pb = reinterpret_cast(pHandles[j]->GetAt(i)); + if (pb == reinterpret_cast(vp)) + { + return pb; + } + } + } + return NULL; +} + +patchMesh_t* CPlugInManager::FindPatchHandle(int index) +{ + switch (PatchesMode) + { + case EActivePatches: + case ESelectedPatches: + if ( index < m_PatchesHandles.GetSize() ) + { + brush_t *pb = reinterpret_cast(m_PatchesHandles.GetAt(index)); + return pb->pPatch; + } +#ifdef _DEBUG + Sys_Printf("WARNING: out of bounds in CPlugInManager::FindPatchHandle\n"); +#endif + break; + case EAllocatedPatches: + if ( index < m_PluginPatches.GetSize() ) + { + patchMesh_t *pPatch = reinterpret_cast(m_PluginPatches.GetAt(index)); + return pPatch; + } +#ifdef _DEBUG + Sys_Printf("WARNING: out of bounds in CPlugInManager::FindPatchHandle\n"); +#endif + break; + } + return NULL; +} + +void* WINAPI QERApp_CreateBrushHandle() +{ + return g_pParentWnd->GetPlugInMgr().CreateBrushHandle(); +} + +void WINAPI QERApp_DeleteBrushHandle(void* vp) +{ + g_pParentWnd->GetPlugInMgr().DeleteBrushHandle(vp); +} + +void WINAPI QERApp_CommitBrushHandleToMap(void* vp) +{ + g_pParentWnd->GetPlugInMgr().CommitBrushHandleToMap(vp); +} + +void WINAPI QERApp_AddFace(void* vp, vec3_t v1, vec3_t v2, vec3_t v3) +{ + g_pParentWnd->GetPlugInMgr().AddFaceToBrushHandle(vp, v1, v2, v3); +} + +void WINAPI QERApp_DeleteSelection() +{ + Select_Delete(); +} + +void QERApp_GetCamera( vec3_t origin, vec3_t angles ) +{ + VectorCopy( g_pParentWnd->GetCamWnd()->Camera()->origin, origin ); + VectorCopy( g_pParentWnd->GetCamWnd()->Camera()->angles, angles ); +} + +void QERApp_SetCamera( vec3_t origin, vec3_t angles ) +{ + VectorCopy( origin, g_pParentWnd->GetCamWnd()->Camera()->origin ); + VectorCopy( angles, g_pParentWnd->GetCamWnd()->Camera()->angles ); + + Sys_UpdateWindows( W_ALL ); // specify + g_pParentWnd->OnTimer(); +} + +void QERApp_GetCamWindowExtents( int *x, int *y, int *width, int *height ) +{ + GtkWidget *widget; + + if (g_pParentWnd->CurrentStyle() == MainFrame::eFloating) + widget = g_pParentWnd->GetCamWnd()->m_pParent; + else + widget = g_pParentWnd->GetCamWnd()->GetWidget(); + + get_window_pos (widget, x, y); + + *width = g_pParentWnd->GetCamWnd()->Camera()->width; + *height = g_pParentWnd->GetCamWnd()->Camera()->height; +} + +//FIXME: this AcquirePath stuff is pretty much a mess and needs cleaned up +bool g_bPlugWait = false; +bool g_bPlugOK = false; +int g_nPlugCount = 0; + +void _PlugDone(bool b, int n) +{ + g_bPlugWait = false; + g_bPlugOK = b; + g_nPlugCount = n; +} + +void WINAPI QERApp_GetPoints(int nMax, _QERPointData *pData, char* pMsg) +{ + ShowInfoDialog(pMsg); + g_bPlugWait = true; + g_bPlugOK = false; + g_nPlugCount = 0; +// g_nPlugCount=nMax-1; + AcquirePath(nMax, &_PlugDone); + + while (g_bPlugWait) + gtk_main_iteration (); + + HideInfoDialog(); + + pData->m_nCount = 0; + pData->m_pVectors = NULL; + + if (g_bPlugOK && g_nPlugCount > 0) + { + pData->m_nCount = g_nPlugCount; + pData->m_pVectors = reinterpret_cast(qmalloc(g_nPlugCount * sizeof(vec3_t))); + vec3_t *pOut = pData->m_pVectors; + for (int i = 0; i < g_nPlugCount; i++) + { + memcpy(pOut, &g_PathPoints[i],sizeof(vec3_t)); + pOut++; + } + } +} + +//#define DBG_PAPI + +void CheckTexture(face_t *f) +{ + if (!f->d_texture) + { +#ifdef DBG_PAPI + Sys_Printf("CheckTexture: requesting %s\n", f->texdef.name); +#endif + f->pShader = QERApp_Shader_ForName (f->texdef.GetName()); + f->pShader->IncRef(); + f->d_texture = f->pShader->getTexture(); + } +} + +// expects pData->m_TextureName to be relative to "textures/" +void WINAPI QERApp_AddFaceData(void* pv, _QERFaceData *pData) +{ +#ifdef DBG_PAPI + Sys_Printf("FindBrushHandle..."); +#endif + brush_t* pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); +#ifdef DBG_PAPI + Sys_Printf("Done\n"); +#endif + if (pBrush != NULL) + { + face_t *f = Face_Alloc(); + f->texdef = g_qeglobals.d_texturewin.texdef; + f->texdef.flags = pData->m_nFlags; + f->texdef.contents = pData->m_nContents; + f->texdef.value = pData->m_nValue; + f->texdef.SetName(pData->m_TextureName); + f->next = pBrush->brush_faces; + pBrush->brush_faces = f; + VectorCopy (pData->m_v1, f->planepts[0]); + VectorCopy (pData->m_v2, f->planepts[1]); + VectorCopy (pData->m_v3, f->planepts[2]); + // we might need to convert one way or the other if the input and the brush coordinates setting don't match + if (pData->m_bBPrimit == true) + { + f->brushprimit_texdef = pData->brushprimit_texdef; + if (!g_qeglobals.m_bBrushPrimitMode) + { + // before calling into the conversion, make sure we have a texture! + CheckTexture (f); +#ifdef DBG_PAPI + Sys_Printf("BrushPrimitFaceToFace..."); +#endif + + // convert BP to regular + BrushPrimitFaceToFace (f); +#ifdef DBG_PAPI + Sys_Printf("Done\n"); +#endif + } + } else + { +#ifdef _DEBUG + if (pData->m_bBPrimit != false) + Sys_FPrintf (SYS_WRN, "non-initialized pData->m_bBPrimit in QERApp_AddFaceData\n"); +#endif + f->texdef.rotate = pData->m_fRotate; + f->texdef.shift[0] = pData->m_fShift[0]; + f->texdef.shift[1] = pData->m_fShift[1]; + f->texdef.scale[0] = pData->m_fScale[0]; + f->texdef.scale[1] = pData->m_fScale[1]; + if (g_qeglobals.m_bBrushPrimitMode) + { + CheckTexture (f); +#ifdef DBG_PAPI + Sys_Printf("FaceToBrushPrimitFace..."); +#endif + + // convert regular to BP + FaceToBrushPrimitFace (f); +#ifdef DBG_PAPI + Sys_Printf("Done\n"); +#endif + } + } + Sys_MarkMapModified(); // PGM + } +} + +int WINAPI QERApp_GetFaceCount(void* pv) +{ + int n = 0; + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + for (face_t *f = pBrush->brush_faces ; f; f = f->next) + { + n++; + } + } + return n; +} + +_QERFaceData* WINAPI QERApp_GetFaceData(void* pv, int nFaceIndex) +{ + static _QERFaceData face; + int n = 0; + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + + if (pBrush != NULL) + { + for (face_t *f = pBrush->brush_faces ; f; f = f->next) + { + +#ifdef _DEBUG + if (!pBrush->brush_faces) + { + Sys_Printf( "Warning : pBrush->brush_faces is NULL in QERApp_GetFaceData\n" ); + return NULL; + } +#endif + + if (n == nFaceIndex) + { + face.m_nContents = f->texdef.contents; + face.m_nFlags = f->texdef.flags; + face.m_nValue = f->texdef.value; + if (g_qeglobals.m_bBrushPrimitMode) + { + //++timo NOTE: we may want to convert back to old format for backward compatibility with some old plugins? + face.m_bBPrimit = true; + face.brushprimit_texdef = f->brushprimit_texdef; + } else + { + face.m_fRotate = f->texdef.rotate; + face.m_fScale[0] = f->texdef.scale[0]; + face.m_fScale[1] = f->texdef.scale[1]; + face.m_fShift[0] = f->texdef.shift[0]; + face.m_fShift[1] = f->texdef.shift[1]; + } + strcpy(face.m_TextureName, f->texdef.GetName()); + VectorCopy(f->planepts[0], face.m_v1); + VectorCopy(f->planepts[1], face.m_v2); + VectorCopy(f->planepts[2], face.m_v3); + return &face; + } + n++; + } + } + return NULL; +} + +void WINAPI QERApp_SetFaceData(void* pv, int nFaceIndex, _QERFaceData *pData) +{ + int n = 0; + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + + if (pBrush != NULL) + { + for (face_t *f = pBrush->brush_faces ; f; f = f->next) + { + if (n == nFaceIndex) + { + f->texdef.flags = pData->m_nFlags; + f->texdef.contents = pData->m_nContents; + f->texdef.value = pData->m_nValue; + f->texdef.rotate = pData->m_fRotate; + f->texdef.shift[0] = pData->m_fShift[0]; + f->texdef.shift[1] = pData->m_fShift[1]; + f->texdef.scale[0] = pData->m_fScale[0]; + f->texdef.scale[1] = pData->m_fScale[1]; + //strcpy(f->texdef.name, pData->m_TextureName); + f->texdef.SetName(pData->m_TextureName); + VectorCopy(pData->m_v1, f->planepts[0]); + VectorCopy(pData->m_v2, f->planepts[1]); + VectorCopy(pData->m_v3, f->planepts[2]); + Sys_MarkMapModified(); // PGM + return; // PGM + } + n++; + } + } +} + +void WINAPI QERApp_DeleteFace(void* pv, int nFaceIndex) +{ + int n = 0; + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + face_t *pPrev = pBrush->brush_faces; + for (face_t *f = pBrush->brush_faces; f; f = f->next) + { + if (n == nFaceIndex) + { + pPrev->next = f->next; + Face_Free (f); + Sys_MarkMapModified(); // PGM + return; + } + n++; + pPrev = f; + } + } +} + +//========== +//PGM +void WINAPI QERApp_BuildBrush (void* pv) +{ + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + Brush_Build(pBrush); + Sys_UpdateWindows(W_ALL); + } +} + +//Timo : another version with bConvert flag +//++timo since 1.7 is not compatible with earlier plugin versions, remove this one and update QERApp_BuildBrush +void WINAPI QERApp_BuildBrush2 (void* pv, int bConvert) +{ + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + Brush_Build( pBrush, true, true, bConvert ); + Sys_UpdateWindows(W_ALL); + } +} + +void WINAPI QERApp_SelectBrush (void* pv) +{ + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + Select_Brush(pBrush, false); + Sys_UpdateWindows(W_ALL); + } + +} + +void WINAPI QERApp_DeselectBrush (void* pv) +{ + // FIXME - implement this! +} + +void WINAPI QERApp_ResetPlugins() +{ + g_pParentWnd->OnPluginsRefresh(); +} + +void WINAPI QERApp_DeselectAllBrushes () +{ + Select_Deselect(); + Sys_UpdateWindows(W_ALL); +} +//PGM +//========== + +void WINAPI QERApp_TextureBrush(void* pv, char* pName) +{ + brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv); + if (pBrush != NULL) + { + for (face_t *f = pBrush->brush_faces ; f; f = f->next) + { + //strcpy(f->texdef.name, pName); + f->texdef.SetName(pName); + } + Sys_MarkMapModified(); // PGM + } +} + +int WINAPI QERApp_SelectedBrushCount() +{ + int n = 0; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + n++; + } + return n; +} + +int WINAPI QERApp_ActiveBrushCount() +{ + int n = 0; + for (brush_t *pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + n++; + } + return n; +} + +int WINAPI QERApp_AllocateSelectedBrushHandles() +{ + int n = 0; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + n++; + g_pParentWnd->GetPlugInMgr().GetSelectedHandles().Add(pb); + } + return n; +} + +int WINAPI QERApp_AllocateActiveBrushHandles() +{ + int n = 0; + for (brush_t *pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + n++; + g_pParentWnd->GetPlugInMgr().GetActiveHandles().Add(pb); + } + return n; +} + +void WINAPI QERApp_ReleaseSelectedBrushHandles() +{ + g_pParentWnd->GetPlugInMgr().GetSelectedHandles().RemoveAll(); + Sys_UpdateWindows(W_ALL); +} + +void WINAPI QERApp_ReleaseActiveBrushHandles() +{ + g_pParentWnd->GetPlugInMgr().GetActiveHandles().RemoveAll(); + Sys_UpdateWindows(W_ALL); +} + +void* WINAPI QERApp_GetActiveBrushHandle(int nIndex) +{ + if (nIndex < g_pParentWnd->GetPlugInMgr().GetActiveHandles().GetSize()) + { + return reinterpret_cast(g_pParentWnd->GetPlugInMgr().GetActiveHandles().GetAt(nIndex)); + } + return NULL; +} + +void* WINAPI QERApp_GetSelectedBrushHandle(int nIndex) +{ + if (nIndex < g_pParentWnd->GetPlugInMgr().GetSelectedHandles().GetSize()) + { + return reinterpret_cast(g_pParentWnd->GetPlugInMgr().GetSelectedHandles().GetAt(nIndex)); + } + return NULL; +} + +int WINAPI QERApp_TextureCount() +{ + //++timo TODO: replace by QERApp_GetActiveShaderCount and verify + Texture_StartPos (); + int x, y; + int n = 0; + while (1) + { + IShader *pShader = Texture_NextPos (&x, &y); + if (!pShader) + break; + n++; + } + return n; +} + +char* WINAPI QERApp_GetTexture(int nIndex) +{ + //++timo TODO: replace by QERApp_ActiveShader_ForIndex + // these funcs would end up being provided for backward compatibility + static char name[QER_MAX_NAMELEN]; + Texture_StartPos (); + int x, y; + int n = 0; + while (1) + { + IShader *pShader = Texture_NextPos (&x, &y); + if (!pShader) + break; + if (n == nIndex) + { + strcpy(name, pShader->getName()); + return name; + } + n++; + } + return NULL; +} + +char* WINAPI QERApp_GetCurrentTexture() +{ + static char current_tex[1024]; + strcpy(current_tex,g_qeglobals.d_texturewin.texdef.GetName()); + return current_tex; +} + +void WINAPI QERApp_SetCurrentTexture(char* strName) +{ + //++timo hu ?? tex is not initialized ?? can be any value .. + texdef_t tex; + //++timo added a brushprimit_texdef .. + // smthg to be done here + brushprimit_texdef_t brushprimit_tex; + //strcpy(tex.name, strName); + tex.SetName(strName); + Texture_SetTexture(&tex,&brushprimit_tex); +} + +int WINAPI QERApp_GetEClassCount() +{ + int n = 0; + for (eclass_t *e = eclass ; e ; e = e->next) + { + n++; + } + return n; +} + +char* WINAPI QERApp_GetEClass(int nIndex) +{ + int n = 0; + for (eclass_t *e = eclass ; e ; e = e->next) + { + if (n == nIndex) + { + return e->name; + } + } + return NULL; +} + +// v1.70 code +// world_entity holds the worldspawn and is indexed as 0 +// other entities are in the entities doubly linked list +// QERApp_GetEntityCount counts the entities like in any C array: [0..length-1] +int WINAPI QERApp_GetEntityCount() +{ + int n = 1; + for (entity_t *pe = entities.next ; pe != &entities ; pe = pe->next) + { + n++; + } + return n; +} + +// We don't store entities in CPtrArray, we need to walk the list +void* WINAPI QERApp_GetEntityHandle(int nIndex) +{ + if (nIndex==0) + // looks for the worldspawn + return static_cast(world_entity); + entity_t *pe = &entities; + int n = 0; + while ( n < nIndex ) + { + pe = pe->next; + n++; + } + return static_cast(pe); +} + +epair_t* WINAPI QERApp_AllocateEpair( char *key, char *val ) +{ + epair_t *e = (epair_t*)qmalloc (sizeof(*e)); + e->key = (char*)qmalloc(strlen(key)+1); + strcpy (e->key, key); + e->value = (char*)qmalloc(strlen(val)+1); + strcpy (e->value, val); + return e; +} + +/* +IEpair* WINAPI QERApp_IEpairForEntityHandle(void *vp) +{ + entity_t *pe = static_cast(vp); + CEpairsWrapper *pEp = new CEpairsWrapper(pe); + pEp->IncRef(); + return pEp; +} + +IEpair* WINAPI QERApp_IEpairForProjectKeys() +{ + CEpairsWrapper *pEp = new CEpairsWrapper(g_qeglobals.d_project_entity); + pEp->IncRef(); + return pEp; +} +*/ + +int WINAPI QERApp_AllocateEntityBrushHandles(void* vp) +{ + entity_t *pe = static_cast(vp); + int n = 0; + if (!pe->brushes.onext) + return 0; + g_pParentWnd->GetPlugInMgr().GetEntityBrushHandles().RemoveAll(); + for (brush_t *pb = pe->brushes.onext ; pb != &pe->brushes ; pb=pb->onext) + { + n++; + g_pParentWnd->GetPlugInMgr().GetEntityBrushHandles().Add(pb); + } + return n; +} + +void WINAPI QERApp_ReleaseEntityBrushHandles() +{ + g_pParentWnd->GetPlugInMgr().GetEntityBrushHandles().RemoveAll(); +} + +void* WINAPI QERApp_GetEntityBrushHandle(int nIndex) +{ + if (nIndex < g_pParentWnd->GetPlugInMgr().GetEntityBrushHandles().GetSize()) + return g_pParentWnd->GetPlugInMgr().GetEntityBrushHandles().GetAt(nIndex); + return NULL; +} + +// FIXME TTimo that entity handles thing sucks .. we should get rid of it .. + +void* WINAPI QERApp_CreateEntityHandle() +{ + entity_t *pe = reinterpret_cast(qmalloc(sizeof(entity_t))); + pe->brushes.onext = pe->brushes.oprev = &pe->brushes; + g_pParentWnd->GetPlugInMgr().GetEntityHandles().Add(static_cast(pe)); + return static_cast(pe); +} + +// the vpBrush needs to be in m_BrushHandles +//++timo we don't have allocation nor storage for vpEntity, no checks for this one +void WINAPI QERApp_CommitBrushHandleToEntity(void* vpBrush, void* vpEntity) +{ + g_pParentWnd->GetPlugInMgr().CommitBrushHandleToEntity(vpBrush, vpEntity); + return; +} + +const char* QERApp_ReadProjectKey(const char* key) +{ + return ValueForKey(g_qeglobals.d_project_entity, key); +} + +#ifdef USEPLUGINENTITIES + +int WINAPI QERApp_ScanFileForEClass(char *filename ) +{ + // set single class parsing + parsing_single = true; + Eclass_ScanFile(filename); + if (eclass_found) + { + eclass_e->nShowFlags |= ECLASS_PLUGINENTITY; + return 1; + } + return 0; +} +#endif // USEPLUGINENTITIES + +// the vpBrush needs to be in m_BrushHandles +//++timo add a debug check to see if we found the brush handle +// NOTE : seems there's no way to check vpEntity is valid .. this is dangerous +// links the brush to its entity, everything else is done when commiting the entity to the map +void CPlugInManager::CommitBrushHandleToEntity(void* vpBrush, void* vpEntity) +{ + brush_t* pb; + entity_t* pe; + for (int i=0 ; i < m_BrushHandles.GetSize() ; i++) + { + if (vpBrush == m_BrushHandles.GetAt(i)) + { + m_BrushHandles.RemoveAt(i); + pb = reinterpret_cast(vpBrush); + pe = reinterpret_cast(vpEntity); + Entity_LinkBrush (pe, pb); + } + } + Sys_UpdateWindows(W_ALL); +} + +// the vpEntity must be in m_EntityHandles +void WINAPI QERApp_CommitEntityHandleToMap(void* vpEntity) +{ + g_pParentWnd->GetPlugInMgr().CommitEntityHandleToMap(vpEntity); + return; +} + +int WINAPI QERApp_LoadFile( const char *pLocation, void ** buffer ) +{ + int nSize = vfsLoadFile(pLocation, buffer, 0); + return nSize; +} + +char * WINAPI QERApp_ExpandReletivePath (char *p) +{ + return ExpandReletivePath(p); +} + +qtexture_t* WINAPI QERApp_Texture_ForName (const char *name) +{ + // if the texture is not loaded yet, this call will get it loaded + // but: when we assign a GL bind number, we need to be in the g_qeglobals.d_xxxBase GL context + // the plugin may set the GL context to whatever he likes, but then load would fail + // NOTE: is context switching time-consuming? then maybe the plugin could handle the context + // switch and only add a sanity check in debug mode here + // read current context + gtk_glwidget_make_current (g_qeglobals_gui.d_glBase); + + //++timo debugging + Sys_Printf("WARNING: QERApp_Texture_ForName ... don't call that!!\n"); + qtexture_t* qtex = QERApp_Texture_ForName2( name ); + return qtex; +} + +char* QERApp_Token() +{ + return token; +} + +int QERApp_ScriptLine() +{ + return scriptline; +} + +// we save the map and return the name .. either .map or .reg to support region compiling +char* QERApp_GetMapName() +{ + static char name[PATH_MAX]; + SaveWithRegion (name); + return name; +} + +void CPlugInManager::CommitEntityHandleToMap(void* vpEntity) +{ + entity_t *pe; + eclass_t *e; + brush_t *b; + vec3_t mins,maxs; + bool has_brushes; + for (int i=0 ; i < m_EntityHandles.GetSize() ; i++ ) + { + if (vpEntity == m_EntityHandles.GetAt(i)) + { + m_EntityHandles.RemoveAt(i); + pe = reinterpret_cast(vpEntity); + // fill additional fields + // straight copy from Entity_Parse + // entity_t::origin + GetVectorForKey (pe, "origin", pe->origin); + // entity_t::eclass + if (pe->brushes.onext == &pe->brushes) + has_brushes = false; + else + has_brushes = true; + e = Eclass_ForName (ValueForKey (pe, "classname"), has_brushes); + pe->eclass = e; + // fixedsize + if (e->fixedsize) + { + if (pe->brushes.onext != &pe->brushes) + { + Sys_Printf("Warning : Fixed size entity with brushes in CPlugInManager::CommitEntityHandleToMap\n"); + } + // create a custom brush + VectorAdd(e->mins, pe->origin, mins); + VectorAdd(e->maxs, pe->origin, maxs); +/* + float a = 0; + if (e->nShowFlags & ECLASS_MISCMODEL) + { + char* p = ValueForKey(pe, "model"); + if (p != NULL && strlen(p) > 0) + { + vec3_t vMin, vMax; + a = FloatForKey (pe, "angle"); + if (GetCachedModel(pe, p, vMin, vMax)) + { + // create a custom brush + VectorAdd (pe->md3Class->mins, pe->origin, mins); + VectorAdd (pe->md3Class->maxs, pe->origin, maxs); + } + } + } +*/ + b = Brush_Create (mins, maxs, &e->texdef); +/* + if (a) + { + vec3_t vAngle; + vAngle[0] = vAngle[1] = 0; + vAngle[2] = a; + Brush_Rotate(b, vAngle, pe->origin, false); + } +*/ + b->owner = pe; + + b->onext = pe->brushes.onext; + b->oprev = &pe->brushes; + pe->brushes.onext->oprev = b; + pe->brushes.onext = b; + } else + { // brush entity + if (pe->brushes.next == &pe->brushes) + Sys_Printf ("Warning: Brush entity with no brushes in CPlugInManager::CommitEntityHandleToMap\n"); + } + + // add brushes to the active brushes list + // and build them along the way + for (b=pe->brushes.onext ; b != &pe->brushes ; b=b->onext) + { + // convert between old brushes and brush primitive + if (g_qeglobals.m_bBrushPrimitMode) + { + // we only filled the shift scale rot fields, needs conversion + Brush_Build( b, true, true, true ); + } else + { + // we are using old brushes + Brush_Build( b ); + } + b->next = active_brushes.next; + active_brushes.next->prev = b; + b->prev = &active_brushes; + active_brushes.next = b; + } + + // handle worldspawn entities + // if worldspawn has no brushes, use the new one + if (!strcmp(ValueForKey (pe, "classname"), "worldspawn")) + { + if ( world_entity && ( world_entity->brushes.onext != &world_entity->brushes ) ) + { + // worldspawn already has brushes + Sys_Printf ("Commiting worldspawn as func_group\n"); + SetKeyValue(pe, "classname", "func_group"); + // add the entity to the end of the entity list + pe->next = &entities; + pe->prev = entities.prev; + entities.prev->next = pe; + entities.prev = pe; + g_qeglobals.d_num_entities++; + } else + { + // there's a worldspawn with no brushes, we assume the map is empty + if ( world_entity ) + { + Entity_Free( world_entity ); + world_entity = pe; + } else + Sys_Printf("Warning : unexpected world_entity == NULL in CommitEntityHandleToMap\n"); + } + } else + { + // add the entity to the end of the entity list + pe->next = &entities; + pe->prev = entities.prev; + entities.prev->next = pe; + entities.prev = pe; + g_qeglobals.d_num_entities++; + } + } + } +} + +void WINAPI QERApp_SetScreenUpdate(int bScreenUpdates) +{ + g_bScreenUpdates = bScreenUpdates; +} + +texturewin_t* QERApp_QeglobalsTexturewin() +{ + return &g_qeglobals.d_texturewin; +} + +texdef_t* QERApp_QeglobalsSavedinfo_SIInc() +{ + return &g_qeglobals.d_savedinfo.m_SIIncrement; +} + +patchMesh_t* QERApp_GetSelectedPatch( ) +{ + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + return pb->pPatch; + } + } +#ifdef _DEBUG + Sys_Printf("WARNING: QERApp_GetSelectedPatchTexdef called with no patch selected\n"); +#endif + return NULL; +} + +const char* WINAPI QERApp_GetGamePath() +{ + return g_pGameDescription->mEnginePath.GetBuffer(); +} + +/*! +\todo the name of this API should prolly be changed +would also need to prompt g_strAppPath / g_strGameToolsPath independently? +*/ +// SPoG +// changed g_strGameToolsPath to g_strAppPath +const char* WINAPI QERApp_GetQERPath() +{ + return g_strAppPath.GetBuffer(); +} + +const char* WINAPI QERApp_GetGameFile() +{ + // FIXME: Arnout: temp solution, need proper 'which game is this' indicator or a different solution for plugins/modules + return g_pGameDescription->mGameFile.GetBuffer(); +} + +// patches in/out ----------------------------------- +int WINAPI QERApp_AllocateActivePatchHandles() +{ + return g_pParentWnd->GetPlugInMgr().AllocateActivePatchHandles(); +} + +// Grid Size +float QERApp_QeglobalsGetGridSize() +{ + return g_qeglobals.d_gridsize; +} + +int CPlugInManager::AllocateActivePatchHandles() +{ + int n = 0; + for (brush_t *pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + n++; + m_PatchesHandles.Add(pb); + } + } + return n; +} + +int WINAPI QERApp_AllocateSelectedPatchHandles() +{ + return g_pParentWnd->GetPlugInMgr().AllocateSelectedPatchHandles(); +} + +int CPlugInManager::AllocateSelectedPatchHandles() +{ + int n = 0; + // change mode + PatchesMode = ESelectedPatches; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + n++; + m_PatchesHandles.Add(pb); + } + } + return n; +} + +void WINAPI QERApp_ReleasePatchHandles() +{ + g_pParentWnd->GetPlugInMgr().ReleasePatchesHandles(); +} + +patchMesh_t* WINAPI QERApp_GetPatchData(int index) +{ + static patchMesh_t patch; + patchMesh_t *pPatch = g_pParentWnd->GetPlugInMgr().FindPatchHandle(index); + if (pPatch) + { + memcpy( &patch, pPatch, sizeof(patchMesh_t) ); + return &patch; + } + return NULL; +} + +patchMesh_t* WINAPI QERApp_GetPatchHandle(int index) +{ + return g_pParentWnd->GetPlugInMgr().FindPatchHandle(index); +} + +void WINAPI QERApp_DeletePatch(int index) +{ + patchMesh_t *pPatch = g_pParentWnd->GetPlugInMgr().FindPatchHandle(index); + if (pPatch) + { + brush_t *pb = pPatch->pSymbiot; + Patch_Delete( pPatch ); + if (pb) + Brush_Free( pb ); + } +#ifdef _DEBUG + Sys_Printf("Warning: QERApp_DeletePatch: FindPatchHandle failed\n"); +#endif +} + +int WINAPI QERApp_CreatePatchHandle() +{ + return g_pParentWnd->GetPlugInMgr().CreatePatchHandle(); +} + +int CPlugInManager::CreatePatchHandle() +{ + // NOTE: we can't call the AddBrushForPatch until we have filled the patchMesh_t structure + patchMesh_t *pPatch = MakeNewPatch(); + m_PluginPatches.Add( pPatch ); + // change mode + PatchesMode = EAllocatedPatches; + return m_PluginPatches.GetSize()-1; +} + +void WINAPI QERApp_CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName) +{ +#ifdef DBG_PAPI + Sys_Printf ("QERApp_CommitPatchHandleToMap %i..", index); +#endif + g_pParentWnd->GetPlugInMgr().CommitPatchHandleToMap(index, pMesh, texName); +#ifdef DBG_PAPI + Sys_Printf ("Done\n"); +#endif +} + +void WINAPI QERApp_CommitPatchHandleToEntity(int index, patchMesh_t *pMesh, char *texName, void* vpEntity) +{ +#ifdef DBG_PAPI + Sys_Printf ("QERApp_CommitPatchHandleToEntity %i..", index); +#endif + g_pParentWnd->GetPlugInMgr().CommitPatchHandleToEntity(index, pMesh, texName, vpEntity); +#ifdef DBG_PAPI + Sys_Printf ("Done\n"); +#endif +} + +void CPlugInManager::CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName) +{ + if (PatchesMode==EAllocatedPatches) + { + patchMesh_t *pPatch = reinterpret_cast( m_PluginPatches.GetAt(index) ); + memcpy( pPatch, pMesh, sizeof( patchMesh_t ) ); + // patch texturing, if none given use current texture + if (texName) + pPatch->pShader = QERApp_Shader_ForName (texName); + else + pPatch->pShader = QERApp_Shader_ForName(g_qeglobals.d_texturewin.texdef.GetName()); + pPatch->d_texture = pPatch->pShader->getTexture(); + pPatch->pShader->IncRef(); + g_bScreenUpdates = false; + // the bLinkToWorld flag in AddBrushForPatch takes care of Brush_AddToList Entity_linkBrush and Brush_Build + brush_t *pb = AddBrushForPatch( pPatch, true ); + Select_Brush( pb ); + g_bScreenUpdates = true; + Sys_UpdateWindows(W_ALL); + } else + { + brush_t *pBrush = reinterpret_cast( m_PatchesHandles.GetAt(index) ); + patchMesh_t *pPatch = pBrush->pPatch; + pPatch->width = pMesh->width; + pPatch->height = pMesh->height; + pPatch->contents = pMesh->contents; + pPatch->flags = pMesh->flags; + pPatch->value = pMesh->value; + pPatch->type = pMesh->type; + memcpy( pPatch->ctrl, pMesh->ctrl, sizeof(drawVert_t)*MAX_PATCH_HEIGHT*MAX_PATCH_WIDTH ); + pPatch->bDirty = true; + } +} + +void CPlugInManager::CommitPatchHandleToEntity(int index, patchMesh_t *pMesh, char *texName, void *vpEntity) +{ + entity_t* pe = reinterpret_cast(vpEntity); + + if (PatchesMode==EAllocatedPatches) + { + patchMesh_t *pPatch = reinterpret_cast( m_PluginPatches.GetAt(index) ); + memcpy( pPatch, pMesh, sizeof( patchMesh_t ) ); + // patch texturing, if none given use current texture + if (texName) + pPatch->pShader = QERApp_Shader_ForName (texName); + else + pPatch->pShader = QERApp_Shader_ForName(g_qeglobals.d_texturewin.texdef.GetName()); + pPatch->d_texture = pPatch->pShader->getTexture(); + pPatch->pShader->IncRef(); + g_bScreenUpdates = false; + brush_t *pb = AddBrushForPatch( pPatch, false ); // false, sp have to do the brush building/entity linking ourself + Brush_AddToList (pb, &active_brushes); + Entity_LinkBrush (pe, pb); + Brush_Build( pb ); + g_bScreenUpdates = true; + Sys_UpdateWindows(W_ALL); + } else + { + brush_t *pBrush = reinterpret_cast( m_PatchesHandles.GetAt(index) ); + patchMesh_t *pPatch = pBrush->pPatch; + pPatch->width = pMesh->width; + pPatch->height = pMesh->height; + pPatch->contents = pMesh->contents; + pPatch->flags = pMesh->flags; + pPatch->value = pMesh->value; + pPatch->type = pMesh->type; + memcpy( pPatch->ctrl, pMesh->ctrl, sizeof(drawVert_t)*MAX_PATCH_HEIGHT*MAX_PATCH_WIDTH ); + pPatch->bDirty = true; + } +} + +#if 0 + +#if defined (__linux__) || defined (__APPLE__) + #include + +XVisualInfo* QEX_ChooseVisual (bool zbuffer) +{ + int attrlist_z[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, 0}; + int attrlist[] = { GLX_RGBA, GLX_DOUBLEBUFFER, 0}; + XVisualInfo *vi; + Display *dpy; + + dpy = GDK_DISPLAY(); + if (dpy == NULL) + Error ("OpenGL fatal error: Cannot get display.\n"); + vi = qglXChooseVisual(dpy, DefaultScreen(dpy), zbuffer ? attrlist_z : attrlist); + if (vi == NULL) + Error ("OpenGL fatal error: glXChooseVisual failed.\n"); + + return vi; +} +#endif + +#endif + +/*! +\todo FIXME TTimo broken most likely +actually .. that's not enough, you have to go down for the game pack specific? +*/ +const char* WINAPI QERApp_ProfileGetDirectory () +{ + return g_strTempPath; +} + +GtkWidget* WINAPI QERApp_GetQeGlobalsGLWidget () +{ + return g_qeglobals_gui.d_glBase; +} + +qboolean WINAPI BrushPrimitMode () +{ + return g_qeglobals.m_bBrushPrimitMode; +} + +brush_t* WINAPI QERApp_ActiveBrushes() +{ + return &active_brushes; +} + +brush_t* WINAPI QERApp_SelectedBrushes() +{ + return &selected_brushes; +} + +brush_t* WINAPI QERApp_FilteredBrushes() +{ + return &filtered_brushes; +} + +CPtrArray* WINAPI QERApp_LstSkinCache() +{ + return &g_lstSkinCache; +} + +qtexture_t** WINAPI QERApp_QTextures() +{ + return &g_qeglobals.d_qtextures; +} + +GHashTable* WINAPI QERApp_QTexmap() +{ + return g_qeglobals.d_qtexmap; +} + +// a simplified version of Texture_SetTexture +void WINAPI QERApp_Texture_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef) +{ + Texture_SetTexture (texdef, brushprimit_texdef); +} + +void QERApp_LoadImage (const char *name, unsigned char **pic, int *width, int *height) +{ + g_ImageManager.LoadImage(name, pic, width, height); +} + +unsigned long QERApp_GetTickCount() +{ +#ifdef _WIN32 + return GetTickCount(); +#else + struct timeval tp; + struct timezone tzp; + static int basetime=0; + + gettimeofday(&tp, &tzp); + if (!basetime) + basetime = tp.tv_sec; + return (tp.tv_sec-basetime) + tp.tv_usec/1000; +#endif +} + +bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI) +{ + if (!strcmp(pAPI->major_name, RADIANT_MAJOR)) + { + _QERFuncTable_1* pTable= static_cast<_QERFuncTable_1*>(pAPI->mpTable); + pTable->m_pfnCreateBrush = &QERApp_CreateBrush; + pTable->m_pfnCreateBrushHandle = &QERApp_CreateBrushHandle; + pTable->m_pfnDeleteBrushHandle = &QERApp_DeleteBrushHandle; + pTable->m_pfnCommitBrushHandle = &QERApp_CommitBrushHandleToMap; + pTable->m_pfnAddFace = &QERApp_AddFace; + pTable->m_pfnAddFaceData = &QERApp_AddFaceData; + pTable->m_pfnGetFaceData = &QERApp_GetFaceData; + pTable->m_pfnGetFaceCount = &QERApp_GetFaceCount; + pTable->m_pfnSetFaceData = &QERApp_SetFaceData; + pTable->m_pfnDeleteFace = &QERApp_DeleteFace; + pTable->m_pfnTextureBrush = &QERApp_TextureBrush; + pTable->m_pfnBuildBrush = &QERApp_BuildBrush; // PGM + pTable->m_pfnSelectBrush = &QERApp_SelectBrush; // PGM + pTable->m_pfnDeselectBrush = &QERApp_DeselectBrush; // PGM + pTable->m_pfnDeselectAllBrushes = &QERApp_DeselectAllBrushes; // PGM + pTable->m_pfnDeleteSelection = &QERApp_DeleteSelection; + pTable->m_pfnGetPoints = &QERApp_GetPoints; + pTable->m_pfnSelectedBrushCount = &QERApp_SelectedBrushCount; + pTable->m_pfnAllocateSelectedBrushHandles = &QERApp_AllocateSelectedBrushHandles; + pTable->m_pfnReleaseSelectedBrushHandles = &QERApp_ReleaseSelectedBrushHandles; + pTable->m_pfnGetSelectedBrushHandle = &QERApp_GetSelectedBrushHandle; + pTable->m_pfnActiveBrushCount = &QERApp_ActiveBrushCount; + pTable->m_pfnAllocateActiveBrushHandles = &QERApp_AllocateActiveBrushHandles; + pTable->m_pfnReleaseActiveBrushHandles = &QERApp_ReleaseActiveBrushHandles; + pTable->m_pfnGetActiveBrushHandle = &QERApp_GetActiveBrushHandle; + pTable->m_pfnTextureCount = &QERApp_TextureCount; + pTable->m_pfnGetTexture = &QERApp_GetTexture; + pTable->m_pfnGetCurrentTexture = &QERApp_GetCurrentTexture; + pTable->m_pfnSetCurrentTexture = &QERApp_SetCurrentTexture; + pTable->m_pfnGetEClassCount = &QERApp_GetEClassCount; + pTable->m_pfnGetEClass = &QERApp_GetEClass; + pTable->m_pfnResetPlugins = &QERApp_ResetPlugins; + pTable->m_pfnLoadTextureRGBA = &QERApp_LoadTextureRGBA; + pTable->m_pfnGetEntityCount = &QERApp_GetEntityCount; + pTable->m_pfnGetEntityHandle = &QERApp_GetEntityHandle; + pTable->m_pfnAllocateEpair = &QERApp_AllocateEpair; + pTable->m_pfnAllocateEntityBrushHandles = &QERApp_AllocateEntityBrushHandles; + pTable->m_pfnReleaseEntityBrushHandles = &QERApp_ReleaseEntityBrushHandles; + pTable->m_pfnGetEntityBrushHandle = &QERApp_GetEntityBrushHandle; + pTable->m_pfnCreateEntityHandle = &QERApp_CreateEntityHandle; + pTable->m_pfnCommitBrushHandleToEntity = &QERApp_CommitBrushHandleToEntity; + pTable->m_pfnCommitEntityHandleToMap = &QERApp_CommitEntityHandleToMap; + pTable->m_pfnSetScreenUpdate = &QERApp_SetScreenUpdate; + pTable->m_pfnBuildBrush2 = &QERApp_BuildBrush2; + pTable->m_pfnGetDispatchParams = &QERApp_GetDispatchParams; +// pTable->m_pfnRequestInterface = &QERApp_RequestInterface; + pTable->m_pfnError = &Error; + pTable->m_pfnLoadFile = &QERApp_LoadFile; + pTable->m_pfnExpandReletivePath = &QERApp_ExpandReletivePath; + pTable->m_pfnQE_ConvertDOSToUnixName = &QE_ConvertDOSToUnixName; + pTable->m_pfnHasShader = QERApp_HasShader; + pTable->m_pfnTexture_LoadSkin = &Texture_LoadSkin; + pTable->m_pfnGetGamePath = &QERApp_GetGamePath; + pTable->m_pfnGetQERPath = &QERApp_GetQERPath; + pTable->m_pfnGetGameFile = &QERApp_GetGameFile; + pTable->m_pfnAllocateActivePatchHandles = &QERApp_AllocateActivePatchHandles; + pTable->m_pfnAllocateSelectedPatchHandles = &QERApp_AllocateSelectedPatchHandles; + pTable->m_pfnReleasePatchHandles = &QERApp_ReleasePatchHandles; + pTable->m_pfnGetPatchData = &QERApp_GetPatchData; + pTable->m_pfnGetPatchHandle = &QERApp_GetPatchHandle; + pTable->m_pfnDeletePatch = &QERApp_DeletePatch; + pTable->m_pfnCreatePatchHandle = &QERApp_CreatePatchHandle; + pTable->m_pfnCommitPatchHandleToMap = &QERApp_CommitPatchHandleToMap; + pTable->m_pfnLoadImage = &QERApp_LoadImage; + pTable->m_pfnMessageBox = >k_MessageBox; + pTable->m_pfnFileDialog = &file_dialog; + pTable->m_pfnColorDialog = &color_dialog; + pTable->m_pfnDirDialog = &dir_dialog; + pTable->m_pfnLoadBitmap = &load_plugin_bitmap; + pTable->m_pfnProfileGetDirectory = &QERApp_ProfileGetDirectory; + pTable->m_pfnProfileSaveInt = &profile_save_int; + pTable->m_pfnProfileSaveString = &profile_save_string; + pTable->m_pfnProfileLoadInt = &profile_load_int; + pTable->m_pfnProfileLoadString = &profile_load_string; + pTable->m_pfnSysUpdateWindows = &Sys_UpdateWindows; + pTable->m_pfnSysPrintf = &Sys_Printf; + pTable->m_pfnSysFPrintf = &Sys_FPrintf; + pTable->m_pfnSysBeginWait = &Sys_BeginWait; + pTable->m_pfnSysEndWait = &Sys_EndWait; + pTable->m_pfnSys_SetTitle = &Sys_SetTitle; + pTable->m_pfnSysBeep = &Sys_Beep; + pTable->m_pfnSys_Status = &Sys_Status; + pTable->m_pfnMapFree = &Map_Free; + pTable->m_pfnMapNew = &Map_New; + pTable->m_pfnMapBuildBrushData = &Map_BuildBrushData; + pTable->m_pfnMap_IsBrushFiltered = &Map_IsBrushFiltered; + pTable->m_pfnMapStartPosition = &Map_StartPosition; + pTable->m_pfnMapRegionOff = &Map_RegionOff; + pTable->m_pfnSetBuildWindingsNoTexBuild = &Brush_SetBuildWindingsNoTexBuild; + pTable->m_pfnPointFileClear = &Pointfile_Clear; + pTable->m_pfnCSG_MakeHollow = &CSG_MakeHollow; + pTable->m_pfnRegionSpawnPoint = &Region_SpawnPoint; + pTable->m_pfnQGetTickCount = &QERApp_GetTickCount; + pTable->m_pfnGetModelCache = &GetModelCache; + pTable->m_pfnGetFileTypeRegistry = &GetFileTypeRegistry; + pTable->m_pfnReadProjectKey = &QERApp_ReadProjectKey; + pTable->m_pfnGetMapName = &QERApp_GetMapName; + pTable->m_pfnFilterAdd = &FilterCreate; + pTable->m_pfnFiltersActivate = &FiltersActivate; + + return true; + } + if (!strcmp(pAPI->major_name, SCRIPLIB_MAJOR)) + { + _QERScripLibTable *pScripLibTable = static_cast<_QERScripLibTable *>(pAPI->mpTable); + pScripLibTable->m_pfnGetToken = &GetToken; + pScripLibTable->m_pfnGetTokenExtra = &GetTokenExtra; + pScripLibTable->m_pfnToken = &QERApp_Token; + pScripLibTable->m_pfnUnGetToken = &UngetToken; + pScripLibTable->m_pfnStartTokenParsing = &StartTokenParsing; + pScripLibTable->m_pfnScriptLine = &QERApp_ScriptLine; + pScripLibTable->m_pfnTokenAvailable = &TokenAvailable; + pScripLibTable->m_pfnCOM_Parse = &COM_Parse; + pScripLibTable->m_pfnGet_COM_Token = &Get_COM_Token; + + return true; + } + if (!strcmp(pAPI->major_name, BRUSH_MAJOR)) + { + _QERBrushTable *pBrushTable = static_cast<_QERBrushTable *>(pAPI->mpTable); + pBrushTable->m_pfnBP_MessageBox = &BP_MessageBox; + pBrushTable->m_pfnBrush_AddToList = &Brush_AddToList; + pBrushTable->m_pfnBrush_Build = &Brush_Build; + pBrushTable->m_pfnBrush_Create = &Brush_Create; + pBrushTable->m_pfnBrush_Free = &Brush_Free; + pBrushTable->m_pfnBrush_Rotate = &Brush_Rotate; + pBrushTable->m_pfnBrushAlloc = &Brush_Alloc; + pBrushTable->m_pfnFace_Alloc = &Face_Alloc; + pBrushTable->m_pfnHasModel = NULL;// &HasModel; + + return true; + } + if (!strcmp(pAPI->major_name, APPSHADERS_MAJOR)) + { + _QERAppShadersTable *pShadersTable = static_cast<_QERAppShadersTable*>(pAPI->mpTable); + pShadersTable->m_pfnQTextures = QERApp_QTextures; + pShadersTable->m_pfnQTexmap = QERApp_QTexmap; + pShadersTable->m_pfnQeglobalsTexturewin = QERApp_QeglobalsTexturewin; + pShadersTable->m_pfnTexture_SetTexture = QERApp_Texture_SetTexture; + pShadersTable->m_pfnTexture_ShowInuse = Texture_ShowInuse; + pShadersTable->m_pfnBuildShaderList = &BuildShaderList; + pShadersTable->m_pfnPreloadShaders = &PreloadShaders; + + return true; + } + if (!strcmp(pAPI->major_name, QGL_MAJOR)) + { + _QERQglTable *pQglTable = static_cast<_QERQglTable *>(pAPI->mpTable); + pQglTable->m_pfn_qglAlphaFunc = qglAlphaFunc; + pQglTable->m_pfn_qglBegin = qglBegin; + pQglTable->m_pfn_qglBindTexture = qglBindTexture; + pQglTable->m_pfn_qglBlendFunc = qglBlendFunc; + pQglTable->m_pfn_qglCallList = qglCallList; + pQglTable->m_pfn_qglCallLists = qglCallLists; + pQglTable->m_pfn_qglClear = qglClear; + pQglTable->m_pfn_qglClearColor = qglClearColor; + pQglTable->m_pfn_qglClearDepth = qglClearDepth; + pQglTable->m_pfn_qglColor3f = qglColor3f; + pQglTable->m_pfn_qglColor3fv = qglColor3fv; + pQglTable->m_pfn_qglColor4f = qglColor4f; + pQglTable->m_pfn_qglColor4fv = qglColor4fv; + pQglTable->m_pfn_qglColor4ubv = qglColor4ubv; + pQglTable->m_pfn_qglColorPointer = qglColorPointer; + pQglTable->m_pfn_qglCullFace = qglCullFace; + pQglTable->m_pfn_qglDepthFunc = qglDepthFunc; + pQglTable->m_pfn_qglDepthMask = qglDepthMask; + pQglTable->m_pfn_qglDisable = qglDisable; + pQglTable->m_pfn_qglDisableClientState = qglDisableClientState; + pQglTable->m_pfn_qglDeleteLists = qglDeleteLists; + pQglTable->m_pfn_qglDeleteTextures = qglDeleteTextures; + pQglTable->m_pfn_qglDrawElements = qglDrawElements; + pQglTable->m_pfn_qglEnable = qglEnable; + pQglTable->m_pfn_qglEnableClientState = qglEnableClientState; + pQglTable->m_pfn_qglEnd = qglEnd; + pQglTable->m_pfn_qglEndList = qglEndList; + pQglTable->m_pfn_qglFogf = qglFogf; + pQglTable->m_pfn_qglFogfv = qglFogfv; + pQglTable->m_pfn_qglFogi = qglFogi; + pQglTable->m_pfn_qglGenLists = qglGenLists; + pQglTable->m_pfn_qglGenTextures = qglGenTextures; + pQglTable->m_pfn_qglGetDoublev = qglGetDoublev; + pQglTable->m_pfn_qglGetIntegerv = qglGetIntegerv; + pQglTable->m_pfn_qglHint = qglHint; + pQglTable->m_pfn_qglLightfv = qglLightfv; + pQglTable->m_pfn_qglLineStipple = qglLineStipple; + pQglTable->m_pfn_qglLineWidth = qglLineWidth; + pQglTable->m_pfn_qglListBase = qglListBase; + pQglTable->m_pfn_qglLoadIdentity = qglLoadIdentity; + pQglTable->m_pfn_qglMaterialf = qglMaterialf; + pQglTable->m_pfn_qglMaterialfv = qglMaterialfv; + pQglTable->m_pfn_qglMatrixMode = qglMatrixMode; + pQglTable->m_pfn_qglMultMatrixf = qglMultMatrixf; + pQglTable->m_pfn_qglNewList = qglNewList; + pQglTable->m_pfn_qglNormal3f = qglNormal3f; + pQglTable->m_pfn_qglNormal3fv = qglNormal3fv; + pQglTable->m_pfn_qglNormalPointer = qglNormalPointer; + pQglTable->m_pfn_qglOrtho = qglOrtho; + pQglTable->m_pfn_qglPointSize = qglPointSize; + pQglTable->m_pfn_qglPolygonMode = qglPolygonMode; + pQglTable->m_pfn_qglPopAttrib = qglPopAttrib; + pQglTable->m_pfn_qglPopMatrix = qglPopMatrix; + pQglTable->m_pfn_qglPushAttrib = qglPushAttrib; + pQglTable->m_pfn_qglPushMatrix = qglPushMatrix; + pQglTable->m_pfn_qglRasterPos3fv = qglRasterPos3fv; + pQglTable->m_pfn_qglRotated = qglRotated; + pQglTable->m_pfn_qglRotatef = qglRotatef; + pQglTable->m_pfn_qglScalef = qglScalef; + pQglTable->m_pfn_qglScissor = qglScissor; + pQglTable->m_pfn_qglShadeModel = qglShadeModel; + pQglTable->m_pfn_qglTexCoord2f = qglTexCoord2f; + pQglTable->m_pfn_qglTexCoord2fv = qglTexCoord2fv; + pQglTable->m_pfn_qglTexCoordPointer = qglTexCoordPointer; + pQglTable->m_pfn_qglTexEnvf = qglTexEnvf; + pQglTable->m_pfn_qglTexGenf = qglTexGenf; + pQglTable->m_pfn_qglTexImage1D = qglTexImage1D; + pQglTable->m_pfn_qglTexImage2D = qglTexImage2D; + pQglTable->m_pfn_qglTexParameterf = qglTexParameterf; + pQglTable->m_pfn_qglTexParameterfv = qglTexParameterfv; + pQglTable->m_pfn_qglTexParameteri = qglTexParameteri; + pQglTable->m_pfn_qglTexParameteriv = qglTexParameteriv; + pQglTable->m_pfn_qglTexSubImage1D = qglTexSubImage1D; + pQglTable->m_pfn_qglTexSubImage2D = qglTexSubImage2D; + pQglTable->m_pfn_qglTranslated = qglTranslated; + pQglTable->m_pfn_qglTranslatef = qglTranslatef; + pQglTable->m_pfn_qglVertex2f = qglVertex2f; + pQglTable->m_pfn_qglVertex3f = qglVertex3f; + pQglTable->m_pfn_qglVertex3fv = qglVertex3fv; + pQglTable->m_pfn_qglVertexPointer = qglVertexPointer; + pQglTable->m_pfn_qglViewport = qglViewport; + + pQglTable->m_pfn_QE_CheckOpenGLForErrors = &QE_CheckOpenGLForErrors; + + pQglTable->m_pfn_qgluPerspective = qgluPerspective; + pQglTable->m_pfn_qgluLookAt = qgluLookAt; + pQglTable->m_pfnHookGL2DWindow = QERApp_HookGL2DWindow; + pQglTable->m_pfnUnHookGL2DWindow = QERApp_UnHookGL2DWindow; + pQglTable->m_pfnHookGL3DWindow = QERApp_HookGL3DWindow; + pQglTable->m_pfnUnHookGL3DWindow = QERApp_UnHookGL3DWindow; + + return true; + } + if (!strcmp(pAPI->major_name, DATA_MAJOR)) + { + _QERAppDataTable *pDataTable = static_cast<_QERAppDataTable *>(pAPI->mpTable); + pDataTable->m_pfnActiveBrushes = QERApp_ActiveBrushes; + pDataTable->m_pfnSelectedBrushes = QERApp_SelectedBrushes; + pDataTable->m_pfnFilteredBrushes = QERApp_FilteredBrushes; + pDataTable->m_pfnLstSkinCache = QERApp_LstSkinCache; + + return true; + } + if (!strcmp(pAPI->major_name, PATCH_MAJOR)) + { + _QERPatchTable *pPatchTable = static_cast<_QERPatchTable *>(pAPI->mpTable); + pPatchTable->m_pfnPatch_Alloc = &Patch_Alloc; + pPatchTable->m_pfnAddBrushForPatch = &AddBrushForPatch; + pPatchTable->m_pfnMakeNewPatch = &MakeNewPatch; + + return true; + } + if (!strcmp(pAPI->major_name, ECLASSMANAGER_MAJOR)) + { + _EClassManagerTable *pEClassManTable = static_cast<_EClassManagerTable *>(pAPI->mpTable); + + pEClassManTable->m_pfnEclass_InsertAlphabetized = &Eclass_InsertAlphabetized; + pEClassManTable->m_pfnGet_Eclass_E = &Get_EClass_E; + pEClassManTable->m_pfnSet_Eclass_Found = &Set_Eclass_Found; + pEClassManTable->m_pfnGet_Parsing_Single = &Get_Parsing_Single; + pEClassManTable->m_pfnEClass_Create = &EClass_Create; + pEClassManTable->m_pfnEclass_ForName = &Eclass_ForName; + + return true; + } + if (!strcmp(pAPI->major_name, SELECTEDFACE_MAJOR)) + { + _QERSelectedFaceTable *pSelectedFaceTable = static_cast<_QERSelectedFaceTable *>(pAPI->mpTable); + + pSelectedFaceTable->m_pfnGetSelectedFaceCount = &QERApp_GetSelectedFaceCount; + pSelectedFaceTable->m_pfnGetFaceBrush = &QERApp_GetSelectedFaceBrush; + pSelectedFaceTable->m_pfnGetFace = &QERApp_GetSelectedFace; + pSelectedFaceTable->m_pfnGetFaceInfo = &QERApp_GetFaceInfo; + pSelectedFaceTable->m_pfnSetFaceInfo = &QERApp_SetFaceInfo; + pSelectedFaceTable->m_pfnGetTextureNumber = &QERApp_ISelectedFace_GetTextureNumber; + pSelectedFaceTable->m_pfnGetTextureSize = &QERApp_GetTextureSize; + pSelectedFaceTable->m_pfnSelect_SetTexture = &Select_SetTexture; + return true; + } + if (!strcmp(pAPI->major_name, APPSURFACEDIALOG_MAJOR)) + { + _QERAppSurfaceTable *pSurfDialogTable = static_cast<_QERAppSurfaceTable *>(pAPI->mpTable); + pSurfDialogTable->m_pfnOnlyPatchesSelected = &OnlyPatchesSelected; + pSurfDialogTable->m_pfnAnyPatchesSelected = &AnyPatchesSelected; + pSurfDialogTable->m_pfnGetSelectedPatch = &QERApp_GetSelectedPatch; + pSurfDialogTable->m_pfnGetTwoSelectedPatch = &QERApp_GetTwoSelectedPatch; + pSurfDialogTable->m_pfnTexMatToFakeTexCoords = &TexMatToFakeTexCoords; + pSurfDialogTable->m_pfnConvertTexMatWithQTexture = &ConvertTexMatWithQTexture; + pSurfDialogTable->m_pfnFakeTexCoordsToTexMat = &FakeTexCoordsToTexMat; + pSurfDialogTable->m_pfnPatch_ResetTexturing = &Patch_ResetTexturing; + pSurfDialogTable->m_pfnPatch_FitTexturing = &Patch_FitTexturing; + pSurfDialogTable->m_pfnPatch_NaturalizeSelected = &Patch_NaturalizeSelected; + pSurfDialogTable->m_pfnPatch_GetTextureName = &Patch_GetTextureName; + pSurfDialogTable->m_pfnQE_SingleBrush = &QE_SingleBrush; + pSurfDialogTable->m_pfnIsBrushPrimitMode = &IsBrushPrimitMode; + pSurfDialogTable->m_pfnComputeAxisBase = &ComputeAxisBase; + pSurfDialogTable->m_pfnBPMatMul = &BPMatMul; + pSurfDialogTable->m_pfnEmitBrushPrimitTextureCoordinates = &EmitBrushPrimitTextureCoordinates; + pSurfDialogTable->m_pfnQeglobalsTexturewin = &QERApp_QeglobalsTexturewin; + pSurfDialogTable->m_pfnSelect_FitTexture = &Select_FitTexture; + pSurfDialogTable->m_pfnQERApp_QeglobalsSavedinfo_SIInc = &QERApp_QeglobalsSavedinfo_SIInc; + pSurfDialogTable->m_pfnQeglobalsGetGridSize = &QERApp_QeglobalsGetGridSize; + pSurfDialogTable->m_pfnFaceList_FitTexture = &SI_FaceList_FitTexture; + pSurfDialogTable->m_pfnGetMainWindow = &SI_GetMainWindow; + pSurfDialogTable->m_pfnSetWinPos_From_Prefs = &SI_SetWinPos_from_Prefs; + pSurfDialogTable->m_pfnGetSelectedFaceCountfromBrushes = &SI_GetSelectedFaceCountfromBrushes; + pSurfDialogTable->m_pfnGetSelFacesTexdef = &SI_GetSelFacesTexdef; + pSurfDialogTable->m_pfnSetTexdef_FaceList = &SI_SetTexdef_FaceList; + + return true; + } + if (!strcmp(pAPI->major_name, UNDO_MAJOR)) + { + _QERUndoTable *pUndoTable = static_cast<_QERUndoTable *>(pAPI->mpTable); + + pUndoTable->m_pfnUndo_Start = &Undo_Start; + pUndoTable->m_pfnUndo_End = &Undo_End; + pUndoTable->m_pfnUndo_AddBrush = &Undo_AddBrush; + pUndoTable->m_pfnUndo_EndBrush = &Undo_EndBrush; + pUndoTable->m_pfnUndo_AddBrushList = &Undo_AddBrushList; + pUndoTable->m_pfnUndo_EndBrushList = &Undo_EndBrushList; + pUndoTable->m_pfnUndo_AddEntity = &Undo_AddEntity; + pUndoTable->m_pfnUndo_EndEntity = &Undo_EndEntity; + pUndoTable->m_pfnUndo_Undo = &Undo_Undo; // Nurail + pUndoTable->m_pfnUndo_Redo = &Undo_Redo; // Nurail + pUndoTable->m_pfnUndo_GetUndoId = &Undo_GetUndoId; // Nurail + pUndoTable->m_pfnUndo_UndoAvailable = &Undo_UndoAvailable; // Nurail + pUndoTable->m_pfnUndo_RedoAvailable = &Undo_RedoAvailable; // Nurail + + return true; + } + if (!strcmp(pAPI->major_name, CAMERA_MAJOR)) + { + _QERCameraTable *pCameraTable = static_cast<_QERCameraTable *>(pAPI->mpTable); + + pCameraTable->m_pfnGetCamera = &QERApp_GetCamera; + pCameraTable->m_pfnSetCamera = &QERApp_SetCamera; + pCameraTable->m_pfnGetCamWindowExtents = &QERApp_GetCamWindowExtents; + + return true; + } + if (!strcmp(pAPI->major_name, UI_MAJOR)) + { + _QERUITable *pUITable = static_cast<_QERUITable *>(pAPI->mpTable); + + pUITable->m_pfnCreateGLWindow = QERApp_CreateGLWindow; + pUITable->m_pfnHookWindow = QERApp_HookWindow; + pUITable->m_pfnUnHookWindow = QERApp_UnHookWindow; + pUITable->m_pfnGetXYWndWrapper = QERApp_GetXYWndWrapper; + pUITable->m_pfnHookListener = QERApp_HookListener; + pUITable->m_pfnUnHookListener = QERApp_UnHookListener; + + return true; + } + if (!strcmp(pAPI->major_name, UIGTK_MAJOR)) + { + _QERUIGtkTable *pUIGtkTable = static_cast<_QERUIGtkTable *>(pAPI->mpTable); + + pUIGtkTable->m_pfn_GetQeglobalsGLWidget = &QERApp_GetQeGlobalsGLWidget; + pUIGtkTable->m_pfn_glwidget_new = >k_glwidget_new; + pUIGtkTable-> m_pfn_glwidget_swap_buffers = >k_glwidget_swap_buffers; + pUIGtkTable->m_pfn_glwidget_make_current = >k_glwidget_make_current; + pUIGtkTable->m_pfn_glwidget_destroy_context = >k_glwidget_destroy_context; + pUIGtkTable->m_pfn_glwidget_create_context = >k_glwidget_create_context; +#if 0 + pUIGtkTable->m_pfn_glwidget_get_context = >k_glwidget_get_context; +#endif + + return true; + } + + return false; +} + +const char* CSynapseClientRadiant::GetInfo() +{ + return "Radiant - synapse core built " __DATE__ " " RADIANT_VERSION; +} + +const char* CSynapseClientRadiant::GetName() +{ + return "core"; } diff --git a/radiant/pluginmanager.h b/radiant/pluginmanager.h index cf148bb5..96e2ac98 100644 --- a/radiant/pluginmanager.h +++ b/radiant/pluginmanager.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,47 +19,194 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_PLUGINMANAGER_H) -#define INCLUDED_PLUGINMANAGER_H +#ifndef _PLUGINMANAGER_H_ +#define _PLUGINMANAGER_H_ -#include +#include "plugin.h" -typedef struct _GtkWidget GtkWidget; - -/*! -\class IPlugin -pure virtual interface for a plugin -temporary solution for migration from old plugin tech to synapse plugins -*/ -class IPlugIn -{ -public: - IPlugIn() { } - virtual ~IPlugIn() { } - - virtual const char* getMenuName() = 0; - virtual std::size_t getCommandCount() = 0; - virtual const char* getCommand(std::size_t) = 0; - virtual const char* getCommandTitle(std::size_t) = 0; - virtual void addMenuID(std::size_t) = 0; - virtual bool ownsCommandID(std::size_t n) = 0; -}; - -class PluginsVisitor -{ -public: - virtual void visit(IPlugIn& plugin) = 0; -}; +// global interfaces we are using +extern _QERShadersTable g_ShadersTable; +// NOTE: it's actually a module manager, the name should change to ModuleManager.. class CPlugInManager { +private: + GSList* m_PlugIns; + CPtrArray m_BrushHandles; + CPtrArray m_SelectedBrushHandles; + CPtrArray m_ActiveBrushHandles; + + // v1.70 + //! brushes of the current entity ( see m_SelectedBrushHandles and m_ActiveBrushHandles ) + CPtrArray m_EntityBrushHandles; + //! allocated entities, not commited yet ( see m_BrushHandles ) + CPtrArray m_EntityHandles; + + //! tells in which array to look when given a patch index + enum EPatchesMode { EActivePatches, ESelectedPatches, EAllocatedPatches } PatchesMode; + //! patches handles (brush_t*) + CPtrArray m_PatchesHandles; + //! plugin-allocated patches, not commited yet (patchMesh_t*) + CPtrArray m_PluginPatches; + + void InitForDir(const Str &dir); ///< init for plguins/modules below this directory + public: - void Dispatch(std::size_t n, const char *p); - void Init(GtkWidget* main_window); - void constructMenu(PluginsVisitor& menu); - void Shutdown(); + CPtrArray& GetActiveHandles() {return m_ActiveBrushHandles; }; + CPtrArray& GetSelectedHandles() {return m_SelectedBrushHandles; }; + CPtrArray& GetPluginPatches() {return m_PluginPatches; }; + brush_t* FindBrushHandle(void *vp); + patchMesh_t* FindPatchHandle(int index); + int CreatePatchHandle(); + int AllocateActivePatchHandles(); + int AllocateSelectedPatchHandles(); + void CommitPatchHandleToMap(int index, patchMesh_t *pMesh, char *texName); + void CommitPatchHandleToEntity(int index, patchMesh_t *pMesh, char *texName, void *vpEntity); + void ReleasePatchesHandles() { m_PatchesHandles.RemoveAll(); m_PluginPatches.RemoveAll(); } + void AddFaceToBrushHandle(void *vp, vec3_t v1, vec3_t v2, vec3_t v3); + void CommitBrushHandleToMap(void *vp); + void DeleteBrushHandle(void* vp); + void* CreateBrushHandle(); + void Dispatch(int n, const char *p); + void Cleanup(); ///< cleanup of data structures allocated for plugins, not a plugin reload + void Init(); ///< go through the path where we will find modules and plugins + void LoadImage (const char *name, unsigned char **pic, int *width, int *height); + void ImportMap (IDataStream *in, CPtrArray *ents, const char *type); + void ExportMap (CPtrArray *ents, IDataStream *out, const char *type); + void Shutdown(); ///< shutdown all the plugins/module subsystem + CPlugInManager(); + virtual ~CPlugInManager(); + + /*! + the texture manager front ends the single load + addins (texture, model, map formats.. etc.) + */ + _QERTextureInfo* GetTextureInfo(); + void LoadTexture(const char *pFilename); + +void* GetSurfaceFlags(); + + // v1.70 + CPtrArray& GetEntityBrushHandles() {return m_EntityBrushHandles; }; + CPtrArray& GetEntityHandles() {return m_EntityHandles; }; + //! the vpBrush needs to be in m_BrushHandles + void CommitBrushHandleToEntity(void* vpBrush, void* vpEntity ); + //! the vpEntity needs to be in m_EntityHandles + void CommitEntityHandleToMap( void* vpEntity ); + +protected: + //! read the interfaces this plugin implements + void LoadFromPath(const char *path); ///< load all modules/plugins in specified path + void RegisterInterfaces(); }; -CPlugInManager& GetPlugInMgr(); +class CPluginSlot : public IPlugIn +{ + APIDescriptor_t *mpAPI; + _QERPluginTable *mpTable; + /*! + is false until Init() happened + */ + bool m_bReady; + /*! + below is valid only if m_bReady = true + */ + GSList *m_CommandStrings; + GSList *m_CommandIDs; + +public: + /*! + build directly from a SYN_PROVIDE interface + */ + CPluginSlot(APIDescriptor_t *pAPI); + virtual ~CPluginSlot(); + + APIDescriptor_t* GetDescriptor() { return mpAPI; } + /*! + initialize some management data after the synapse interfaces have been hooked up + */ + void Init(); + /*! + dispatching a command by name to the plugin + */ + void Dispatch(const char *p); + + // IPlugIn ------------------------------------------------------------ + const char* getMenuName(); + int getCommandCount(); + const char* getCommand(int n); + void addMenuID(int n); + bool ownsCommandID(int n); + +}; -#endif +class CRadiantPluginManager : public CSynapseAPIManager +{ + list mSlots; +public: + CRadiantPluginManager() {} + virtual ~CRadiantPluginManager(); + + // CSynapseAPIManager interface ------------------- + APIDescriptor_t *BuildRequireAPI(APIDescriptor_t *pAPI); + + // CRadiantPluginManager -------------------------- + void PopulateMenu(); + bool Dispatch(int n, const char* p); +}; + +class CImageTableSlot +{ + /*! + \todo this is a duplicate from the APIDescriptor_t* list that privately stored inside CSynapseAPIManager + this is probably useless to us in here? + */ + APIDescriptor_t *mpAPI; + /*! + shortcut to mpAPI->mpTable, with correct typing + this is what we allocate and should free locally + */ + _QERPlugImageTable *mpTable; +public: + CImageTableSlot() { } + virtual ~CImageTableSlot() { } ///\ \todo need to correctly free and release still.. + + APIDescriptor_t* GetDescriptor() { return mpAPI; } + _QERPlugImageTable* GetTable() { return mpTable; } + + /*! + don't go through PrepareRequireAPI for init, just get this API and add the table info + */ + void InitForFillAPITable(APIDescriptor_t *pAPI); +}; + +class CRadiantImageManager : public CSynapseAPIManager +{ + list mSlots; + + list::iterator mExtScanSlot; +public: + CRadiantImageManager() {} + virtual ~CRadiantImageManager(); + + // CSynapseAPIManager interface -------------------- + void FillAPITable(APIDescriptor_t *pAPI); + + // CRadiantImageManager ---------------------------- + /*! + extract the extension, go through the list of image interfaces, and load + */ + void LoadImage(const char *name, byte **pic, int *width, int *height); + + /*! + we often need to walk through the extensions + this used to be hardcoded in texwindow.cpp + the two functions are related, they use a static to go through the list + */ + void BeginExtensionsScan(); + const char* GetNextExtension(); ///< \return NULL when the list has been completely scanned +}; + +extern CRadiantImageManager g_ImageManager; + +#endif // _PLUGINMANAGER_H_ diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp deleted file mode 100644 index 0fe758ed..00000000 --- a/radiant/pluginmenu.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pluginmenu.h" - -#include "stream/textstream.h" - -#include -#include - -#include "gtkutil/pointer.h" -#include "gtkutil/menu.h" - -#include "pluginmanager.h" -#include "mainframe.h" -#include "preferences.h" - - -int m_nNextPlugInID = 0; - -void plugin_activated(GtkWidget* widget, gpointer data) -{ - const char* str = (const char*)g_object_get_data(G_OBJECT(widget),"command"); - GetPlugInMgr().Dispatch(gpointer_to_int(data), str); -} - -#include -typedef std::stack WidgetStack; - -void PlugInMenu_Add(GtkMenu* plugin_menu, IPlugIn* pPlugIn) -{ - GtkWidget *menu, *item, *parent, *subMenu; - const char *menuText, *menuCommand; - WidgetStack menuStack; - - parent = gtk_menu_item_new_with_label (pPlugIn->getMenuName()); - gtk_widget_show (parent); - gtk_container_add (GTK_CONTAINER (plugin_menu), parent); - - std::size_t nCount = pPlugIn->getCommandCount(); - if (nCount > 0) - { - menu = gtk_menu_new(); - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (GTK_MENU(menu)); - while (nCount > 0) - { - menuText = pPlugIn->getCommandTitle(--nCount); - menuCommand = pPlugIn->getCommand(nCount); - - if (menuText != 0 && strlen(menuText) > 0) - { - if (!strcmp(menuText, "-")) - { - item = gtk_menu_item_new(); - gtk_widget_set_sensitive (item, FALSE); - } - else if (!strcmp(menuText, ">")) - { - menuText = pPlugIn->getCommandTitle(--nCount); - menuCommand = pPlugIn->getCommand(nCount); - if (!strcmp(menuText, "-") || !strcmp(menuText, ">") || !strcmp(menuText, "<")) - { - globalErrorStream() << pPlugIn->getMenuName() << " Invalid title (" << menuText << ") for submenu.\n"; - continue; - } - - item = gtk_menu_item_new_with_label(menuText); - gtk_widget_show (item); - gtk_container_add (GTK_CONTAINER (menu), item); - - subMenu = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), subMenu); - menuStack.push(menu); - menu = subMenu; - continue; - } - else if (!strcmp(menuText, "<")) - { - if (!menuStack.empty()) - { - menu = menuStack.top(); - menuStack.pop(); - } - else - { - globalErrorStream() << pPlugIn->getMenuName() << ": Attempt to end non-existent submenu ignored.\n"; - } - continue; - } - else - { - item = gtk_menu_item_new_with_label (menuText); - g_object_set_data(G_OBJECT(item),"command", const_cast(static_cast(menuCommand))); - g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(plugin_activated), gint_to_pointer(m_nNextPlugInID)); - } - gtk_widget_show (item); - gtk_container_add (GTK_CONTAINER (menu), item); - pPlugIn->addMenuID(m_nNextPlugInID++); - } - } - if (!menuStack.empty()) - { - std::size_t size = menuStack.size(); - if (size != 0) - { - globalErrorStream() << pPlugIn->getMenuName() << " mismatched > <. " << Unsigned(size) << " submenu(s) not closed.\n"; - } - for (std::size_t i = 0; i < (size -1); i++) - { - menuStack.pop(); - } - menu = menuStack.top(); - menuStack.pop(); - } - gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), menu); - } -} - -GtkMenu* g_plugins_menu = 0; -GtkMenuItem* g_plugins_menu_separator = 0; - -void PluginsMenu_populate() -{ - class PluginsMenuConstructor : public PluginsVisitor - { - GtkMenu* m_menu; - public: - PluginsMenuConstructor(GtkMenu* menu) : m_menu(menu) - { - } - void visit(IPlugIn& plugin) - { - PlugInMenu_Add(m_menu, &plugin); - } - }; - - PluginsMenuConstructor constructor(g_plugins_menu); - GetPlugInMgr().constructMenu(constructor); -} - -void PluginsMenu_clear() -{ - m_nNextPlugInID = 0; - - GList* lst = g_list_find (gtk_container_children(GTK_CONTAINER(g_plugins_menu)), GTK_WIDGET(g_plugins_menu_separator)); - while (lst->next) - { - gtk_container_remove (GTK_CONTAINER(g_plugins_menu), GTK_WIDGET (lst->next->data)); - lst = g_list_find (gtk_container_children(GTK_CONTAINER(g_plugins_menu)), GTK_WIDGET(g_plugins_menu_separator)); - } -} - -GtkMenuItem* create_plugins_menu() -{ - // Plugins menu - GtkMenuItem* plugins_menu_item = new_sub_menu_item_with_mnemonic("_Plugins"); - GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(plugins_menu_item)); - if (g_Layout_enableDetachableMenus.m_value) - { - menu_tearoff(menu); - } - - g_plugins_menu = menu; - - //TODO: some modules/plugins do not yet support refresh -#if 0 - create_menu_item_with_mnemonic(menu, "Refresh", FreeCaller()); - - // NOTE: the seperator is used when doing a refresh of the list, everything past the seperator is removed - g_plugins_menu_separator = menu_separator(menu); -#endif - - PluginsMenu_populate(); - - return plugins_menu_item; -} - diff --git a/radiant/pluginmenu.h b/radiant/pluginmenu.h deleted file mode 100644 index f843bcb4..00000000 --- a/radiant/pluginmenu.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PLUGINMENU_H) -#define INCLUDED_PLUGINMENU_H - -typedef struct _GtkMenuItem GtkMenuItem; -GtkMenuItem* create_plugins_menu(); - -typedef struct _GtkMenu GtkMenu; -typedef struct _GtkMenuItem GtkMenuItem; -void PluginsMenu_populate(); -void PluginsMenu_clear(); - -#endif diff --git a/radiant/plugintoolbar.cpp b/radiant/plugintoolbar.cpp deleted file mode 100644 index 4612fbd4..00000000 --- a/radiant/plugintoolbar.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "plugintoolbar.h" - - -#include "itoolbar.h" -#include "modulesystem.h" - -#include - -#include "stream/stringstream.h" -#include "gtkutil/image.h" -#include "gtkutil/container.h" - -#include "mainframe.h" -#include "plugin.h" - -GtkImage* new_plugin_image(const char* filename) -{ - { - StringOutputStream fullpath(256); - fullpath << GameToolsPath_get() << g_pluginsDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask(fullpath.c_str()); - if(image != 0) - { - return image; - } - } - - { - StringOutputStream fullpath(256); - fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask(fullpath.c_str()); - if(image != 0) - { - return image; - } - } - - { - StringOutputStream fullpath(256); - fullpath << AppPath_get() << g_modulesDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask(fullpath.c_str()); - if(image != 0) - { - return image; - } - } - - return image_new_missing(); -} - -inline GtkToolbarChildType gtktoolbarchildtype_for_toolbarbuttontype(IToolbarButton::EType type) -{ - switch(type) - { - case IToolbarButton::eSpace: - return GTK_TOOLBAR_CHILD_SPACE; - case IToolbarButton::eButton: - return GTK_TOOLBAR_CHILD_BUTTON; - case IToolbarButton::eToggleButton: - return GTK_TOOLBAR_CHILD_TOGGLEBUTTON; - case IToolbarButton::eRadioButton: - return GTK_TOOLBAR_CHILD_RADIOBUTTON; - } - ERROR_MESSAGE("invalid toolbar button type"); - return (GtkToolbarChildType)0; -} - -void toolbar_insert(GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GtkSignalFunc handler, gpointer data) -{ - gtk_toolbar_append_element(toolbar, gtktoolbarchildtype_for_toolbarbuttontype(type), 0, text, tooltip, "", GTK_WIDGET(new_plugin_image(icon)), handler, data); -} - -void ActivateToolbarButton(GtkWidget *widget, gpointer data) -{ - const_cast(reinterpret_cast(data))->activate(); -} - -void PlugInToolbar_AddButton(GtkToolbar* toolbar, const IToolbarButton* button) -{ - toolbar_insert(toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), GTK_SIGNAL_FUNC(ActivateToolbarButton), reinterpret_cast(const_cast(button))); -} - -GtkToolbar* g_plugin_toolbar = 0; - -void PluginToolbar_populate() -{ - class AddToolbarItemVisitor : public ToolbarModules::Visitor - { - GtkToolbar* m_toolbar; - public: - AddToolbarItemVisitor(GtkToolbar* toolbar) - : m_toolbar(toolbar) - { - } - void visit(const char* name, const _QERPlugToolbarTable& table) const - { - const std::size_t count = table.m_pfnToolbarButtonCount(); - for(std::size_t i=0;irowLOD[i] = NULL; + int colcount = ((MAX_PATCH_HEIGHT-1)/2) * MAX_PATCH_WIDTH; + for (i=0; icolLOD[i] = NULL; +} + +patchMesh_t* Patch_Alloc() +{ + patchMesh_t *pPatch = (patchMesh_t *)malloc(sizeof(patchMesh_t)); + pPatch->pShader = NULL; + pPatch->pSymbiot = NULL; // Hydra: added missing initialiser. + // spog - initialise patch LOD pointers + Patch_InitialiseLODPointers(pPatch); + pPatch->drawLists = NULL; + pPatch->bDirty = true; + pPatch->nListID = -1; + pPatch->bSelected = false; + pPatch->bOverlay = false; + pPatch->bDirty = true; + pPatch->LODUpdated = false; + + int i; + for (i=0; i<(((MAX_PATCH_WIDTH-1)-1)/2); i++) + pPatch->rowDirty[i] = false; + for (i=0; i<(((MAX_PATCH_HEIGHT-1)-1)/2); i++) + pPatch->colDirty[i] = false; + + return pPatch; +} + +patchMesh_t* MakeNewPatch() +{ + patchMesh_t *pm = reinterpret_cast(qmalloc(sizeof(patchMesh_t))); + + // spog - initialise patch LOD pointers + Patch_InitialiseLODPointers(pm); + pm->drawLists = NULL; + pm->bDirty = true; + + return pm; +} + +// FIXME: this needs to be dynamic +//#define MAX_PATCH_MESHES 4096 +//patchMesh_t patchMeshes[MAX_PATCH_MESHES]; +//int numPatchMeshes = 0; + +// used for a save spot +patchMesh_t patchSave; + +// Tracks the selected patch for point manipulation/update. FIXME: Need to revert back to a generalized +// brush approach +//--int g_nSelectedPatch = -1; + +// HACK: for tracking which view generated the click +// as we dont want to deselect a point on a same point +// click if it is from a different view +int g_nPatchClickedView = -1; +bool g_bSameView = false; + +//typedef enum XFormType { TRANSLATE, SCALE, ROTATE }; + + +// globals +bool g_bPatchShowBounds = true; +bool g_bPatchWireFrame = false; +bool g_bPatchWeld = true; +bool g_bPatchDrillDown = true; +//bool g_bPatchInsertMode = false; +bool g_bPatchBendMode = false; +int g_nPatchBendState = -1; +int g_nPatchInsertState = -1; +int g_nBendOriginIndex = 0; +vec3_t g_vBendOrigin; + +bool g_bPatchAxisOnRow = true; +int g_nPatchAxisIndex = 0; +bool g_bPatchLowerEdge = true; + +vec3_t g_vCycleCapNormal; +// cycles when we use Patch_CycleCapSelected +VIEWTYPE g_nCycleCapIndex = XY; + +// BEND states +enum +{ + BEND_SELECT_ROTATION = 0, + BEND_SELECT_ORIGIN, + BEND_SELECT_EDGE, + BEND_BENDIT, + BEND_STATE_COUNT +}; + +const char *g_pBendStateMsg[] = +{ + "Use TAB to cycle through available bend axis. Press ENTER when the desired one is highlighted.", + "Use TAB to cycle through available rotation axis. This will LOCK around that point. You may also use Shift + Middle Click to select an arbitrary point. Press ENTER when the desired one is highlighted", + "Use TAB to choose which side to bend. Press ENTER when the desired one is highlighted.", + "Use the MOUSE to bend the patch. It uses the same ui rules as Free Rotation. Press ENTER to accept the bend, press ESC to abandon it and exit Bend mode", + "" +}; + +// INSERT states +enum +{ + INSERT_SELECT_EDGE = 0, + INSERT_STATE_COUNT +}; + +const char* g_pInsertStateMsg[] = +{ + "Use TAB to cycle through available rows/columns for insertion/deletion. Press INS to insert at the highlight, DEL to remove the pair" +}; + + +float *g_InversePoints[1024]; + +const float fFullBright = 1.0; +const float fLowerLimit = .50; +const float fDec = .05f; +void _SetColor(face_t* f, float fColor[3]) +{ + return; + fColor[0] = f->d_color[0]; + fColor[1] = f->d_color[1]; + fColor[2] = f->d_color[2]; + qglColor3fv(fColor); +} + + +void _DecColor(float fColor[3]) +{ + return; + fColor[0] -= fDec; + fColor[1] -= fDec ; + fColor[2] -= fDec; + for (int i = 0; i < 3; i++) + { + if (fColor[i] <= fLowerLimit) + { + fColor[0] = fFullBright; + fColor[1] = fFullBright; + fColor[2] = fFullBright; + break; + } + } + qglColor3fv(fColor); +} + +vec_t __VectorNormalize (vec3_t in, vec3_t out) +{ + vec_t length, ilength; + + length = sqrt (in[0]*in[0] + in[1]*in[1] + in[2]*in[2]); + if (length == 0) + { + VectorClear (out); + return 0; + } + + ilength = 1.0/length; + out[0] = in[0]*ilength; + out[1] = in[1]*ilength; + out[2] = in[2]*ilength; + + return length; +} + + +void Patch_SetType(patchMesh_t *p, int nType) +{ + p->type = (p->type & PATCH_STYLEMASK) | nType; +} + +void Patch_SetStyle(patchMesh_t *p, int nStyle) +{ + p->type = (p->type & PATCH_TYPEMASK) | nStyle; +} + +/* +================== +Patch_MemorySize +================== +*/ +int Patch_MemorySize(patchMesh_t *p) +{ + // return _msize(p); + return 0; +} + + +/* +=============== +InterpolateInteriorPoints +=============== +*/ +void InterpolateInteriorPoints( patchMesh_t *p ) +{ + int i, j, k; + int next, prev; + + for ( i = 0 ; i < p->width ; i += 2 ) + { + + next = ( i == p->width - 1 ) ? 1 : ( i + 1 ) % p->width; + prev = ( i == 0 ) ? p->width - 2 : i - 1; + +#if 0 + if ( i == 0 ) + { + next = ( i + 1 ) % p->width; + prev = p->width - 2; // joined wrap case + } + else if ( i == p->width - 1 ) + { + next = 1; + prev = i - 1; + } + else + { + next = ( i + 1 ) % p->width; + prev = i - 1; + } +#endif + + for ( j = 0 ; j < p->height ; j++ ) + { + for ( k = 0 ; k < 3 ; k++ ) + { + p->ctrl[i][j].xyz[k] = ( p->ctrl[next][j].xyz[k] + p->ctrl[prev][j].xyz[k] ) * 0.5; + } + } + } +} + +/* +================= +MakeMeshNormals + +================= +*/ +int neighbors[8][2] = { + {0,1}, {1,1}, {1,0}, {1,-1}, {0,-1}, {-1,-1}, {-1,0}, {-1,1} +}; + +void Patch_MeshNormals(patchMesh_t *in ) +{ + int i, j, k, dist; + vec3_t normal; + vec3_t sum; + int count; + vec3_t base; + vec3_t delta; + int x, y; + drawVert_t *dv; + vec3_t around[8], temp; + qboolean good[8]; + qboolean wrapWidth, wrapHeight; + float len; + + wrapWidth = false; + for ( i = 0 ; i < in->height ; i++ ) + { + + VectorSubtract( in->ctrl[0][i].xyz, + in->ctrl[in->width-1][i].xyz, delta ); + len = VectorLength( delta ); + if ( len > 1.0 ) + { + break; + } + } + if ( i == in->height ) + { + wrapWidth = true; + } + + wrapHeight = false; + for ( i = 0 ; i < in->width ; i++ ) + { + VectorSubtract( in->ctrl[i][0].xyz, + in->ctrl[i][in->height-1].xyz, delta ); + len = VectorLength( delta ); + if ( len > 1.0 ) + { + break; + } + } + if ( i == in->width) + { + wrapHeight = true; + } + + + for ( i = 0 ; i < in->width ; i++ ) + { + for ( j = 0 ; j < in->height ; j++ ) + { + count = 0; + //--dv = reinterpret_cast(in.ctrl[j*in.width+i]); + dv = &in->ctrl[i][j]; + VectorCopy( dv->xyz, base ); + for ( k = 0 ; k < 8 ; k++ ) + { + VectorClear( around[k] ); + good[k] = false; + + for ( dist = 1 ; dist <= 3 ; dist++ ) + { + x = i + neighbors[k][0] * dist; + y = j + neighbors[k][1] * dist; + if ( wrapWidth ) + { + if ( x < 0 ) + { + x = in->width - 1 + x; + } + else if ( x >= in->width ) + { + x = 1 + x - in->width; + } + } + if ( wrapHeight ) + { + if ( y < 0 ) + { + y = in->height - 1 + y; + } + else if ( y >= in->height ) + { + y = 1 + y - in->height; + } + } + + if ( x < 0 || x >= in->width || y < 0 || y >= in->height ) + { + break; // edge of patch + } + //--VectorSubtract( in.ctrl[y*in.width+x]->xyz, base, temp ); + VectorSubtract( in->ctrl[x][y].xyz, base, temp ); + if ( __VectorNormalize( temp, temp ) == 0 ) + { + continue; // degenerate edge, get more dist + } + else + { + good[k] = true; + VectorCopy( temp, around[k] ); + break; // good edge + } + } + } + + VectorClear( sum ); + for ( k = 0 ; k < 8 ; k++ ) + { + if ( !good[k] || !good[(k+1)&7] ) + { + continue; // didn't get two points + } + CrossProduct( around[(k+1)&7], around[k], normal ); + if ( __VectorNormalize( normal, normal ) == 0 ) + { + continue; + } + VectorAdd( normal, sum, sum ); + count++; + } + if ( count == 0 ) + { + //printf("bad normal\n"); + count = 1; + //continue; + } + __VectorNormalize( sum, dv->normal ); + } + } +} + + + + +/* +================== +Patch_CalcBounds +================== +*/ +void Patch_CalcBounds(patchMesh_t *p, vec3_t& vMin, vec3_t& vMax) +{ + vMin[0] = vMin[1] = vMin[2] = 99999; + vMax[0] = vMax[1] = vMax[2] = -99999; + + p->bDirty = true; + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + for (int j = 0; j < 3; j++) + { + float f = p->ctrl[w][h].xyz[j]; + if (f < vMin[j]) + vMin[j] = f; + if (f > vMax[j]) + vMax[j] = f; + } + } + } +} + +/* +================== +Brush_RebuildBrush +================== +*/ +void Brush_RebuildBrush(brush_t *b, vec3_t vMins, vec3_t vMaxs) +{ + // + // Total hack job + // Rebuilds a brush + int i, j; + face_t *f, *next; + vec3_t pts[4][2]; + texdef_t texdef; + // free faces + + for (j = 0; j < 3; j++) + { + if ((int)vMins[j] == (int)vMaxs[j]) + { + vMins[j] -= 4; + vMaxs[j] += 4; + } + } + + + for (f=b->brush_faces ; f ; f=next) + { + next = f->next; + if (f) + texdef = f->texdef; + Face_Free( f ); + } + + b->brush_faces = NULL; + + // left the last face so we can use its texdef + + for (i=0 ; i<3 ; i++) + if (vMaxs[i] < vMins[i]) + Error ("Brush_RebuildBrush: backwards"); + + pts[0][0][0] = vMins[0]; + pts[0][0][1] = vMins[1]; + + pts[1][0][0] = vMins[0]; + pts[1][0][1] = vMaxs[1]; + + pts[2][0][0] = vMaxs[0]; + pts[2][0][1] = vMaxs[1]; + + pts[3][0][0] = vMaxs[0]; + pts[3][0][1] = vMins[1]; + + for (i=0 ; i<4 ; i++) + { + pts[i][0][2] = vMins[2]; + pts[i][1][0] = pts[i][0][0]; + pts[i][1][1] = pts[i][0][1]; + pts[i][1][2] = vMaxs[2]; + } + + for (i=0 ; i<4 ; i++) + { + f = Face_Alloc(); + f->texdef = texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; +// f->texdef.flags |= SURF_PATCH; + f->next = b->brush_faces; + b->brush_faces = f; + j = (i+1)%4; + + VectorCopy (pts[j][1], f->planepts[0]); + VectorCopy (pts[i][1], f->planepts[1]); + VectorCopy (pts[i][0], f->planepts[2]); + } + + f = Face_Alloc(); + f->texdef = texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; +// f->texdef.flags |= SURF_PATCH; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorCopy (pts[0][1], f->planepts[0]); + VectorCopy (pts[1][1], f->planepts[1]); + VectorCopy (pts[2][1], f->planepts[2]); + + f = Face_Alloc(); + f->texdef = texdef; + f->texdef.flags &= ~SURF_KEEP; + f->texdef.contents &= ~CONTENTS_KEEP; +// f->texdef.flags |= SURF_PATCH; + f->next = b->brush_faces; + b->brush_faces = f; + + VectorCopy (pts[2][0], f->planepts[0]); + VectorCopy (pts[1][0], f->planepts[1]); + VectorCopy (pts[0][0], f->planepts[2]); + + Brush_Build(b); +} + +void WINAPI Patch_Rebuild(patchMesh_t *p) +{ + vec3_t vMin, vMax; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); + p->bDirty = true; +} + +/* +================== +AddBrushForPatch +================== + adds a patch brush and ties it to this patch id +*/ +brush_t* AddBrushForPatch(patchMesh_t *pm, bool bLinkToWorld ) +{ + // find the farthest points in x,y,z + vec3_t vMin, vMax; + Patch_CalcBounds(pm, vMin, vMax); + + for (int j = 0; j < 3; j++) + { + if (vMin[j] == vMax[j]) + { + vMin[j] -= 4; + vMax[j] += 4; + } + } + + brush_t *b = Brush_Create(vMin, vMax, &g_qeglobals.d_texturewin.texdef); + + // FIXME: this entire type of linkage needs to be fixed + b->patchBrush = true; + b->pPatch = pm; + pm->pSymbiot = b; + pm->bSelected = false; + pm->bOverlay = false; + pm->bDirty = true; + pm->nListID = -1; + + if (bLinkToWorld) + { + Brush_AddToList (b, &active_brushes); + Entity_LinkBrush (world_entity, b); + Brush_Build(b); + } + + return b; +} + +void Patch_SetPointIntensities(int n) +{ +#if 0 + patchMesh_t *p = patchMeshes[n]; + for (int i = 0; i < p->width; i++) + { + for (int j = 0; j < p->height; j++) + { + + } + } +#endif +} + +// very approximate widths and heights + +/* +================== +Patch_Width +================== +*/ +float Patch_Width(patchMesh_t *p) +{ + float f = 0; + for (int i = 0; i < p->width-1; i++) + { + vec3_t vTemp; + VectorSubtract(p->ctrl[i][0].xyz, p->ctrl[i+1][0].xyz, vTemp); + f += VectorLength(vTemp); + } + return f; +} + +float Patch_WidthDistanceTo(patchMesh_t *p, int j) +{ + float f = 0; + for (int i = 0; i < j; i++) + { + vec3_t vTemp; + VectorSubtract(p->ctrl[i][0].xyz, p->ctrl[i+1][0].xyz, vTemp); + f += VectorLength(vTemp); + } + return f; +} + + + +/* +================== +Patch_Height +================== +*/ +float Patch_Height(patchMesh_t *p) +{ + float f = 0; + for (int i = 0; i < p->height-1; i++) + { + vec3_t vTemp; + VectorSubtract(p->ctrl[0][i].xyz, p->ctrl[0][i+1].xyz, vTemp); + f += VectorLength(vTemp); + } + return f; +} + +float Patch_HeightDistanceTo(patchMesh_t *p, int j) +{ + float f = 0; + for (int i = p->height-1; i > j; i--) + { + vec3_t vTemp; + VectorSubtract(p->ctrl[0][i].xyz, p->ctrl[0][i-1].xyz, vTemp); // reverse order for T coords + f += VectorLength(vTemp); + } + return f; +} + + + +/* +================== +Patch_Naturalize +================== +texture = TotalTexture * LengthToThisControlPoint / TotalControlPointLength + +dist( this control point to first control point ) / dist ( last control pt to first) +*/ +void WINAPI Patch_Naturalize(patchMesh_t *p) +{ + int nWidth = (int)(p->d_texture->width * g_pGameDescription->mTextureDefaultScale); + int nHeight = (int)(p->d_texture->height * g_pGameDescription->mTextureDefaultScale); + float fPWidth = Patch_Width(p); + float fPHeight = Patch_Height(p); + float xAccum = 0.0f; + + for ( int i = 0; i < p->width ; i++ ) + { + float yAccum = 0.0f; + for ( int j = p->height-1; j >= 0 ; j-- ) + { + p->ctrl[i][j].st[0] = (fPWidth / nWidth) * xAccum / fPWidth; + p->ctrl[i][j].st[1] = (fPHeight / nHeight) * yAccum / fPHeight; + yAccum = Patch_HeightDistanceTo(p,j-1); + //p->ctrl[i][j][3] = (fPWidth / nWidth) * (float)i / (p->width - 1); + //p->ctrl[i][j][4] = (fPHeight/ nHeight) * (float)j / (p->height - 1); + } + xAccum = Patch_WidthDistanceTo(p,i+1); + } + p->bDirty = true; +} + +/* + if (bIBevel) + { + VectorCopy(p->ctrl[1][0], p->ctrl[1][1]); + } + + if (bIEndcap) + { + VectorCopy(p->ctrl[3][0], p->ctrl[4][1]); + VectorCopy(p->ctrl[2][0], p->ctrl[3][1]); + VectorCopy(p->ctrl[2][0], p->ctrl[2][1]); + VectorCopy(p->ctrl[2][0], p->ctrl[1][1]); + VectorCopy(p->ctrl[1][0], p->ctrl[0][1]); + VectorCopy(p->ctrl[1][0], p->ctrl[0][2]); + VectorCopy(p->ctrl[1][0], p->ctrl[1][2]); + VectorCopy(p->ctrl[2][0], p->ctrl[2][2]); + VectorCopy(p->ctrl[3][0], p->ctrl[3][2]); + VectorCopy(p->ctrl[3][0], p->ctrl[4][2]); + } +*/ + +int Index3By[][2] = +{ + {0,0}, + {1,0}, + {2,0}, + {2,1}, + {2,2}, + {1,2}, + {0,2}, + {0,1}, + {0,0}, + {0,0}, + {0,0}, + {0,0}, + {0,0}, + {0,0}, + {0,0} +}; + +int Index5By[][2] = +{ + {0,0}, + {1,0}, + {2,0}, + {3,0}, + {4,0}, + {4,1}, + {4,2}, + {4,3}, + {4,4}, + {3,4}, + {2,4}, + {1,4}, + {0,4}, + {0,3}, + {0,2}, + {0,1} +}; + + + +int Interior3By[][2] = +{ + {1,1} +}; + +int Interior5By[][2] = +{ + {1,1}, + {2,1}, + {3,1}, + {1,2}, + {2,2}, + {3,2}, + {1,3}, + {2,3}, + {3,3} +}; + +int Interior3ByCount = sizeof(Interior3By) / sizeof(int[2]); +int Interior5ByCount = sizeof(Interior5By) / sizeof(int[2]); + +extern int Plane_FromPoints(vec3_t p1, vec3_t p2, vec3_t p3, plane_t *plane); +// the bFaceCycle only means we are going through a patch cycling loop +// then we rely on g_vCycleCapNormal to compute the cap + +void Patch_CapTexture(patchMesh_t *p, bool bFaceCycle = false) +{ + vec3_t vProjection, vX, vY; + qtexture_t *texture = p->pShader->getTexture(); + plane_t Plane1, Plane2, Plane3; + bool bThing=true; + + if (bFaceCycle) + VectorCopy (g_vCycleCapNormal, vProjection); + + else + { + VectorClear ( vProjection ); + + // find normal for plane from first 3 corner points + if (!Plane_FromPoints(p->ctrl[0][0].xyz,p->ctrl[0][p->height-1].xyz,p->ctrl[p->width-1][p->height-1].xyz,&Plane1)) + { + VectorClear ( Plane3.normal ); + bThing = false; + } + + // find normal for plane from next 3 corner points + if (!Plane_FromPoints(p->ctrl[p->width-1][p->height-1].xyz,p->ctrl[p->width-1][0].xyz,p->ctrl[0][0].xyz,&Plane2)) + { + if (bThing) + { + VectorCopy ( Plane1.normal, Plane3.normal ); + Plane3.dist = Plane1.dist; + } + } + + else + { + if (bThing) + // find average plane for all 4 corner points + { + for (int n = 0; n <= 2; n++) + { + Plane3.normal[n] = (Plane1.normal[n] + Plane2.normal[n]) / 2; + } + Plane3.dist = (Plane1.dist + Plane2.dist) / 2; + } + else + { + VectorCopy ( Plane2.normal, Plane3.normal ); + Plane3.dist = Plane2.dist; + } + } + + // get best axis for projection from average plane + //Sys_Printf("surface normal1: (%f,%f,%f)\n",Plane1.normal[0],Plane1.normal[1],Plane1.normal[0]); + //Sys_Printf("surface normal2: (%f,%f,%f)\n",Plane2.normal[0],Plane2.normal[1],Plane2.normal[0]); + //Sys_Printf("surface normal3: (%f,%f,%f)\n",Plane3.normal[0],Plane3.normal[1],Plane3.normal[0]); + TextureAxisFromPlane(&Plane3, vX, vY); + } + + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + if (vProjection[2] == 1.0f || (vX[0] == 1.0f && vY[1] == -1.0f)) + { + p->ctrl[w][h].st[0] = p->ctrl[w][h].xyz[0] / (texture->width * g_pGameDescription->mTextureDefaultScale); + p->ctrl[w][h].st[1] = p->ctrl[w][h].xyz[1] / (texture->height * g_pGameDescription->mTextureDefaultScale) * -1; + } + else if (vProjection[0] == 1.0f || (vX[1] == 1.0f && vY[2] == -1.0f)) + { + p->ctrl[w][h].st[0] = p->ctrl[w][h].xyz[1] / (texture->width * g_pGameDescription->mTextureDefaultScale); + p->ctrl[w][h].st[1] = p->ctrl[w][h].xyz[2] / (texture->height * g_pGameDescription->mTextureDefaultScale) * -1; + } + else if (vProjection[1] == 1.0f || (vX[0] == 1.0f && vY[2] == -1.0f)) + { + p->ctrl[w][h].st[0] = p->ctrl[w][h].xyz[0] / (texture->width * g_pGameDescription->mTextureDefaultScale); + p->ctrl[w][h].st[1] = p->ctrl[w][h].xyz[2] / (texture->height * g_pGameDescription->mTextureDefaultScale) * -1; + } + //Sys_Printf("(%i,%i) (%f,%f,%f) (%f,%f) %f\n",w,h, + // p->ctrl[w][h].xyz[0],p->ctrl[w][h].xyz[1],p->ctrl[w][h].xyz[2], + // p->ctrl[w][h].st[0],p->ctrl[w][h].st[1],p->ctrl[w][h].normal); + } + } + // make sure it will rebuild + p->bDirty = true; +} + +void FillPatch(patchMesh_t *p, vec3_t v) +{ + for (int i = 0; i < p->width; i++) + { + for (int j = 0; j < p->height; j++) + { + VectorCopy(v, p->ctrl[i][j].xyz); + } + } +} + +// temporarily moved function to allow use in Cap() and CapSpecial() +void patchInvert(patchMesh_t *p) +{ + drawVert_t vertTemp; + p->bDirty = true; + for ( int i = 0 ; i < p->width ; i++ ) + { + for (int j = 0; j < p->height / 2; j++) + { + memcpy(&vertTemp, &p->ctrl[i][p->height - 1- j], sizeof (drawVert_t)); + memcpy(&p->ctrl[i][p->height - 1 - j], &p->ctrl[i][j], sizeof(drawVert_t)); + memcpy(&p->ctrl[i][j], &vertTemp, sizeof(drawVert_t)); + } + } +} + +brush_t* Cap(patchMesh_t *pParent, bool bByColumn, bool bFirst) +{ + brush_t *b; + patchMesh_t *p; + vec3_t vMin, vMax; + int i, j; + + bool bSmall = true; + // make a generic patch + if (pParent->width <= 9) + { + b = Patch_GenericMesh(3, 3, 2, false); + } + else + { + b = Patch_GenericMesh(5, 5, 2, false); + bSmall = false; + } + + if (!b) + { + Sys_Printf("Unable to cap. You may need to ungroup the patch.\n"); + return NULL; + } + + p = b->pPatch; + p->type |= PATCH_CAP; + + vMin[0] = vMin[1] = vMin[2] = 9999; + vMax[0] = vMax[1] = vMax[2] = -9999; + + // we seam the column edge, FIXME: this might need to be able to seem either edge + // + int nSize = (bByColumn) ? pParent->width : pParent->height; + int nIndex = (bFirst) ? 0 : (bByColumn) ? pParent->height-1 : pParent->width-1; + + FillPatch(p, pParent->ctrl[0][nIndex].xyz); + + for (i = 0; i < nSize; i++) + { + if (bByColumn) + { + if (bSmall) + { + VectorCopy(pParent->ctrl[i][nIndex].xyz, p->ctrl[Index3By[i][0]][Index3By[i][1]].xyz); + } + else + { + VectorCopy(pParent->ctrl[i][nIndex].xyz, p->ctrl[Index5By[i][0]][Index5By[i][1]].xyz); + } + } + else + { + if (bSmall) + { + VectorCopy(pParent->ctrl[nIndex][i].xyz, p->ctrl[Index3By[i][0]][Index3By[i][1]].xyz); + } + else + { + VectorCopy(pParent->ctrl[nIndex][i].xyz, p->ctrl[Index5By[i][0]][Index5By[i][1]].xyz); + } + } + + for (j = 0; j < 3; j++) + { + float f = (bSmall) ? p->ctrl[Index3By[i][0]][Index3By[i][1]].xyz[j] : p->ctrl[Index5By[i][0]][Index5By[i][1]].xyz[j]; + if (f < vMin[j]) + vMin[j] = f; + if (f > vMax[j]) + vMax[j] = f; + } + } + + vec3_t vTemp; + for (j = 0; j < 3; j++) + { + vTemp[j] = vMin[j] + fabs((vMax[j] - vMin[j]) * 0.5); + } + int nCount = (bSmall) ? Interior3ByCount : Interior5ByCount; + for (j = 0; j < nCount; j++) + { + if (bSmall) + { + VectorCopy(vTemp, p->ctrl[Interior3By[j][0]][Interior3By[j][1]].xyz); + } + else + { + VectorCopy(vTemp, p->ctrl[Interior5By[j][0]][Interior5By[j][1]].xyz); + } + } + + if (bFirst) + patchInvert(p); + /* + { + drawVert_t vertTemp; + for (i = 0; i < p->width; i++) + { + for (j = 0; j < p->height / 2; j++) + { + memcpy(&vertTemp, &p->ctrl[i][p->height - 1- j], sizeof (drawVert_t)); + memcpy(&p->ctrl[i][p->height - 1 - j], &p->ctrl[i][j], sizeof(drawVert_t)); + memcpy(&p->ctrl[i][j], &vertTemp, sizeof(drawVert_t)); + } + } + } + */ + + Patch_Rebuild(p); + Patch_CapTexture(p); + return p->pSymbiot; +} + +brush_t* CapSpecial(patchMesh_t *pParent, int nType, bool bFirst) +{ + + brush_t *b; + patchMesh_t *p; + vec3_t vMin, vMax, vTemp; + int i, j; + + if (nType == IENDCAP) + b = Patch_GenericMesh(5, 3, 2, false); + else + b = Patch_GenericMesh(3, 3, 2, false); + + if (!b) + { + Sys_Printf("Unable to cap. Make sure you ungroup before re-capping."); + return NULL; + } + + p = b->pPatch; + p->type |= PATCH_CAP; + + vMin[0] = vMin[1] = vMin[2] = 9999; + vMax[0] = vMax[1] = vMax[2] = -9999; + + // int nSize = pParent->width; + int nIndex = (bFirst) ? 0 : pParent->height-1; + + // parent bounds are used for some things + Patch_CalcBounds(pParent, vMin, vMax); + + for (j = 0; j < 3; j++) + { + vTemp[j] = vMin[j] + fabs((vMax[j] - vMin[j]) * 0.5); + } + + if (nType == IBEVEL) + { + VectorCopy(pParent->ctrl[0][nIndex].xyz, p->ctrl[0][0].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[0][2].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[0][1].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[2][2].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[1][0].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[1][1].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[1][2].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[2][0].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[2][1].xyz); + } + else if (nType == BEVEL) + { + vec3_t p1, p2, p3, p4; //, temp, dir; + + VectorCopy(pParent->ctrl[0][nIndex].xyz, p3); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p1); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p2); + + //Sys_Printf("CapSpecial() p1: %f %f %f\n",p1[0],p1[1],p1[2]); + //Sys_Printf("CapSpecial() p2: %f %f %f\n",p2[0],p2[1],p2[2]); + //Sys_Printf("CapSpecial() p3: %f %f %f\n",p3[0],p3[1],p3[2]); + + VectorSubtract(p2, p1, p4); + VectorAdd(p3, p4, p4); + // spog - use opposite-point-on-parallelogram to find p4 + /* + VectorSubtract(p3, p2, dir); + VectorNormalize(dir); + VectorSubtract(p1, p2, temp); + vec_t dist = _DotProduct(temp, dir); + VectorScale(dir, dist, temp); + VectorAdd(p2, temp, temp); + VectorSubtract(temp, p1, temp); + VectorScale(temp, 2, temp); + VectorAdd(p1, temp, p4); + */ + + //Sys_Printf("CapSpecial() p1: %f %f %f\n",p1[0],p1[1],p1[2]); + //Sys_Printf("CapSpecial() p2: %f %f %f\n",p2[0],p2[1],p2[2]); + //Sys_Printf("CapSpecial() p3: %f %f %f\n",p3[0],p3[1],p3[2]); + //Sys_Printf("CapSpecial() p4: %f %f %f\n",p4[0],p4[1],p4[2]); + + VectorCopy(p4, p->ctrl[0][0].xyz); + VectorCopy(p4, p->ctrl[1][0].xyz); + VectorCopy(p4, p->ctrl[0][1].xyz); + VectorCopy(p4, p->ctrl[1][1].xyz); + VectorCopy(p4, p->ctrl[0][2].xyz); + VectorCopy(p4, p->ctrl[1][2].xyz); + VectorCopy(p2, p->ctrl[2][0].xyz); + VectorCopy(p1, p->ctrl[2][1].xyz); + VectorCopy(p3, p->ctrl[2][2].xyz); + + } + else if (nType == ENDCAP) + { + VectorAdd(pParent->ctrl[4][nIndex].xyz, pParent->ctrl[0][nIndex].xyz, vTemp); + VectorScale(vTemp, 0.5, vTemp); + VectorCopy(pParent->ctrl[0][nIndex].xyz, p->ctrl[0][0].xyz); + VectorCopy(vTemp, p->ctrl[1][0].xyz); + VectorCopy(pParent->ctrl[4][nIndex].xyz, p->ctrl[2][0].xyz); + + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[0][2].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[1][2].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[2][2].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[1][1].xyz); + + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[0][1].xyz); + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[2][1].xyz); + } + else + { + VectorCopy(pParent->ctrl[4][nIndex].xyz, p->ctrl[0][0].xyz); + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[1][0].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[2][0].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[3][0].xyz); + VectorCopy(pParent->ctrl[0][nIndex].xyz, p->ctrl[4][0].xyz); + + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[0][1].xyz); + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[1][1].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[2][1].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[3][1].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[4][1].xyz); + + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[0][2].xyz); + VectorCopy(pParent->ctrl[3][nIndex].xyz, p->ctrl[1][2].xyz); + VectorCopy(pParent->ctrl[2][nIndex].xyz, p->ctrl[2][2].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[3][2].xyz); + VectorCopy(pParent->ctrl[1][nIndex].xyz, p->ctrl[4][2].xyz); + } + + + if (!bFirst) + { + drawVert_t vertTemp; + for (i = 0; i < p->width; i++) + { + for (j = 0; j < p->height / 2; j++) + { + memcpy(&vertTemp, &p->ctrl[i][p->height - 1- j], sizeof (drawVert_t)); + memcpy(&p->ctrl[i][p->height - 1 - j], &p->ctrl[i][j], sizeof(drawVert_t)); + memcpy(&p->ctrl[i][j], &vertTemp, sizeof(drawVert_t)); + } + } + } + + //--Patch_CalcBounds(p, vMin, vMax); + //--Brush_RebuildBrush(p->pSymbiot, vMin, vMax); + Patch_Rebuild(p); + Patch_CapTexture(p); + return p->pSymbiot; +} + +void Patch_CapCurrent() +{ + patchMesh_t *pParent = NULL; + brush_t *b[4]; + brush_t *pCap = NULL; + b[0] = b[1] = b[2] = b[3] = NULL; + int nIndex = 0; + bool b_GroupResult = TRUE; + + if (!QE_SingleBrush(true)) + { + Sys_Printf("Patch_CapCurrent: you must have a single patch selected\n"); + return; + } + + + for (brush_t *pb = selected_brushes.next ; pb != NULL && pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pParent = pb->pPatch; + // decide which if any ends we are going to cap + // if any of these compares hit, it is a closed patch and as such + // the generic capping will work.. if we do not find a closed edge + // then we need to ask which kind of cap to add + if (VectorCompare(pParent->ctrl[0][0].xyz, pParent->ctrl[pParent->width-1][0].xyz)) + { + pCap = Cap(pParent, true, false); + if (pCap != NULL) + { + b[nIndex++] = pCap; + } + } + if (VectorCompare(pParent->ctrl[0][pParent->height-1].xyz, pParent->ctrl[pParent->width-1][pParent->height-1].xyz)) + { + pCap = Cap(pParent, true, true); + if (pCap != NULL) + { + b[nIndex++] = pCap; + } + } + if (VectorCompare(pParent->ctrl[0][0].xyz, pParent->ctrl[0][pParent->height-1].xyz)) + { + pCap = Cap(pParent, false, false); + if (pCap != NULL) + { + b[nIndex++] = pCap; + } + } + if (VectorCompare(pParent->ctrl[pParent->width-1][0].xyz, pParent->ctrl[pParent->width-1][pParent->height-1].xyz)) + { + pCap = Cap(pParent, false, true); + if (pCap != NULL) + { + b[nIndex++] = pCap; + } + } + } + } + + if (pParent) + { + // if we did not cap anything with the above tests + if (nIndex == 0) + { + int type; + + if (DoCapDlg (&type, &b_GroupResult) == IDOK) + { + b[nIndex++] = CapSpecial(pParent, type, false); + b[nIndex++] = CapSpecial(pParent, type, true); + } + } + + if (nIndex > 0) + { + while (nIndex > 0) + { + nIndex--; + if (b[nIndex]) + { + Select_Brush(b[nIndex]); + } + } + // Gef: Added toggle for capped patch func_group + if(b_GroupResult) { + entity_t *e = Entity_Alloc(); + SetKeyValue(e, "classname", "func_group"); + SetKeyValue(e, "type", "patchCapped"); + Select_GroupEntity(e); + Entity_AddToList(e, &entities); + } + } + } +} + +/* +=============== +BrushToPatchMesh +=============== +*/ +void Patch_BrushToMesh(bool bCone, bool bBevel, bool bEndcap, bool bSquare, int nHeight) +{ + brush_t *b; + patchMesh_t *p; + int i,j; + + if (!QE_SingleBrush()) + return; + + b = selected_brushes.next; + + p = MakeNewPatch(); + + p->d_texture = b->brush_faces->d_texture; + p->pShader = b->brush_faces->pShader; + + p->height = nHeight; + + p->type = PATCH_CYLINDER; + if (bBevel & !bSquare) + { + p->type = PATCH_BEVEL; + p->width = 3; + int nStep = (int)((b->maxs[2] - b->mins[2]) / (p->height-1)); + int nStart = (int)(b->mins[2]); + for (i = 0; i < p->height; i++) + { + p->ctrl[0][i].xyz[0] = b->mins[0]; + p->ctrl[0][i].xyz[1] = b->mins[1]; + p->ctrl[0][i].xyz[2] = nStart; + + p->ctrl[1][i].xyz[0] = b->maxs[0]; + p->ctrl[1][i].xyz[1] = b->mins[1]; + p->ctrl[1][i].xyz[2] = nStart; + + p->ctrl[2][i].xyz[0] = b->maxs[0]; + p->ctrl[2][i].xyz[1] = b->maxs[1]; + p->ctrl[2][i].xyz[2] = nStart; + nStart += nStep; + } + } + else if (bEndcap & !bSquare) + { + p->type = PATCH_ENDCAP; + p->width = 5; + int nStep = (int)((b->maxs[2] - b->mins[2]) / (p->height-1)); + int nStart = (int)(b->mins[2]); + for (i = 0; i < p->height; i++) + { + p->ctrl[0][i].xyz[0] = b->mins[0]; + p->ctrl[0][i].xyz[1] = b->mins[1]; + p->ctrl[0][i].xyz[2] = nStart; + + p->ctrl[1][i].xyz[0] = b->mins[0]; + p->ctrl[1][i].xyz[1] = b->maxs[1]; + p->ctrl[1][i].xyz[2] = nStart; + + p->ctrl[2][i].xyz[0] = b->mins[0] + ((b->maxs[0] - b->mins[0]) * 0.5); + p->ctrl[2][i].xyz[1] = b->maxs[1]; + p->ctrl[2][i].xyz[2] = nStart; + + p->ctrl[3][i].xyz[0] = b->maxs[0]; + p->ctrl[3][i].xyz[1] = b->maxs[1]; + p->ctrl[3][i].xyz[2] = nStart; + + p->ctrl[4][i].xyz[0] = b->maxs[0]; + p->ctrl[4][i].xyz[1] = b->mins[1]; + p->ctrl[4][i].xyz[2] = nStart; + nStart += nStep; + } + } + else + { + p->width = 9; + p->ctrl[1][0].xyz[0] = b->mins[0]; + p->ctrl[1][0].xyz[1] = b->mins[1]; + + p->ctrl[3][0].xyz[0] = b->maxs[0]; + p->ctrl[3][0].xyz[1] = b->mins[1]; + + p->ctrl[5][0].xyz[0] = b->maxs[0]; + p->ctrl[5][0].xyz[1] = b->maxs[1]; + + p->ctrl[7][0].xyz[0] = b->mins[0]; + p->ctrl[7][0].xyz[1] = b->maxs[1]; + + for ( i = 1 ; i < p->width - 1 ; i += 2 ) + { + + p->ctrl[i][0].xyz[2] = b->mins[2]; + + VectorCopy( p->ctrl[i][0].xyz, p->ctrl[i][2].xyz ); + + p->ctrl[i][2].xyz[2] = b->maxs[2]; + + p->ctrl[i][1].xyz[0] = ( p->ctrl[i][0].xyz[0] + p->ctrl[i][2].xyz[0] ) * 0.5; + p->ctrl[i][1].xyz[1] = ( p->ctrl[i][0].xyz[1] + p->ctrl[i][2].xyz[1] ) * 0.5; + p->ctrl[i][1].xyz[2] = ( p->ctrl[i][0].xyz[2] + p->ctrl[i][2].xyz[2] ) * 0.5; + } + InterpolateInteriorPoints( p ); + + if (bSquare) + { + if (bBevel || bEndcap) + { + if (bBevel) + { + for (i = 0; i < p->height; i++) + { + VectorCopy(p->ctrl[1][i].xyz, p->ctrl[2][i].xyz); + VectorCopy(p->ctrl[7][i].xyz, p->ctrl[6][i].xyz); + } + } + else + { + for (i = 0; i < p->height; i++) + { + VectorCopy(p->ctrl[5][i].xyz, p->ctrl[4][i].xyz); + VectorCopy(p->ctrl[1][i].xyz, p->ctrl[2][i].xyz); + VectorCopy(p->ctrl[7][i].xyz, p->ctrl[6][i].xyz); + VectorCopy(p->ctrl[8][i].xyz, p->ctrl[7][i].xyz); + } + } + } + else + { + for (i = 0; i < p->width-1; i ++) + { + for (j = 0; j < p->height; j++) + { + VectorCopy(p->ctrl[i+1][j].xyz, p->ctrl[i][j].xyz); + } + } + for (j = 0; j < p->height; j++) + { + VectorCopy(p->ctrl[0][j].xyz, p->ctrl[8][j].xyz); + } + } + } + } + + + Patch_Naturalize(p); + + if (bCone) + { + p->type = PATCH_CONE; + float xc = (b->maxs[0] + b->mins[0]) * 0.5; + float yc = (b->maxs[1] + b->mins[1]) * 0.5; + + for ( i = 0 ; i < p->width ; i ++) + { + p->ctrl[i][2].xyz[0] = xc; + p->ctrl[i][2].xyz[1] = yc; + } + } + + b = AddBrushForPatch(p); + + Select_Delete(); + Select_Brush(b); + +} + +/* +================== +Patch_GenericMesh +================== +*/ +brush_t* Patch_GenericMesh(int nWidth, int nHeight, int nOrientation, bool bDeleteSource, bool bOverride) +{ + int i,j; + + if (nHeight < 3 || nHeight > 15 || nWidth < 3 || nWidth > 15) + { + Sys_Printf("Invalid patch width or height.\n"); + return NULL; + } + + if (! bOverride && !QE_SingleBrush()) + { + Sys_Printf("Error: you must have a single brush selected\n"); + return NULL; + } + + patchMesh_t* p = MakeNewPatch(); + p->pShader = g_qeglobals.d_texturewin.pShader; + p->d_texture = g_qeglobals.d_texturewin.pShader->getTexture(); + + p->width = nWidth; + p->height = nHeight; + p->type = PATCH_GENERIC; + + int nFirst = 0; + int nSecond = 1; + if (nOrientation == 0) + { + nFirst = 1; + nSecond = 2; + } + else if (nOrientation == 1) + { + nSecond = 2; + } + + brush_t *b = selected_brushes.next; + // set the workzone to this brush, use it later to create the patch points + UpdateWorkzone_ForBrush( b ); + + int xStep = (int)(b->mins[nFirst]); + float xAdj = fabs((b->maxs[nFirst] - b->mins[nFirst]) / (nWidth - 1)); + float yAdj = fabs((b->maxs[nSecond] - b->mins[nSecond]) / (nHeight - 1)); + + for (i = 0; i < nWidth; i++) + { + int yStep = (int)(b->mins[nSecond]); + for (j = 0; j < nHeight; j++) + { + p->ctrl[i][j].xyz[nFirst] = xStep; + p->ctrl[i][j].xyz[nSecond] = yStep; + // create patch based on workzone + p->ctrl[i][j].xyz[nOrientation] = g_qeglobals.d_work_max[nOrientation]; + yStep += (int)yAdj; + } + xStep += (int)xAdj; + } + + Patch_Naturalize(p); + + b = AddBrushForPatch(p); + if (bDeleteSource) + { + Select_Delete(); + Select_Brush(b); + } + + return b; + //g_qeglobals.d_select_mode = sel_curvepoint; +} + +/* +================== +PointInMoveList +================== +*/ +int PointInMoveList(float *pf) +{ + for (int i = 0; i < g_qeglobals.d_num_move_points; i++) + { + if (pf == &g_qeglobals.d_move_points[i][0]) + return i; + } + return -1; +} + +/* +================== +PointValueInMoveList +================== +*/ +int PointValueInMoveList(vec3_t v) +{ + for (int i = 0; i < g_qeglobals.d_num_move_points; i++) + { + if (VectorCompare(v, g_qeglobals.d_move_points[i])) + return i; + } + return -1; +} + + +/* +================== +RemovePointFromMoveList +================== +*/ +void RemovePointFromMoveList(vec3_t v) +{ + int n; + while ( (n = PointValueInMoveList(v)) >= 0) + { + for (int i = n; i < g_qeglobals.d_num_move_points-1; i++) + { + g_qeglobals.d_move_points[i] = g_qeglobals.d_move_points[i+1]; + } + g_qeglobals.d_num_move_points--; + } +} + +/* +================== +ColumnSelected +================== +*/ +bool ColumnSelected(patchMesh_t* p, int nCol) +{ + for (int i = 0; i < p->height; i++) + { + if (PointInMoveList(p->ctrl[nCol][i].xyz) == -1) + return false; + } + return true; +} + +/* +================== +AddPoint +================== +*/ +void AddPoint(patchMesh_t* p, vec3_t v, bool bWeldOrDrill = true) +{ + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = v; + if ((g_bPatchWeld || g_bPatchDrillDown) && bWeldOrDrill) + { + for ( int i = 0 ; i < p->width ; i++ ) + { + for ( int j = 0 ; j < p->height ; j++ ) + { + if (g_bPatchWeld) + { + if ( VectorCompare(v, p->ctrl[i][j].xyz) + && PointInMoveList(p->ctrl[i][j].xyz) == -1) + { + g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = p->ctrl[i][j].xyz; + continue; + } + } + if (g_bPatchDrillDown && g_nPatchClickedView != W_CAMERA) + { + if ( (fabs(v[nDim1] - p->ctrl[i][j].xyz[nDim1]) <= EQUAL_EPSILON) + &&(fabs(v[nDim2] - p->ctrl[i][j].xyz[nDim2]) <= EQUAL_EPSILON)) + { + if (PointInMoveList(p->ctrl[i][j].xyz) == -1) + { + g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = p->ctrl[i][j].xyz; + continue; + } + } + } + } + } + } +} + +/* +================== +SelectRow +================== +*/ +void SelectRow(patchMesh_t* p, int nRow, bool bMulti) +{ + if (!bMulti) + g_qeglobals.d_num_move_points = 0; + for (int i = 0; i < p->width; i++) + { + AddPoint(p, p->ctrl[i][nRow].xyz, false); + } + //Sys_Printf("Selected Row %d\n", nRow); +} + +/* +================== +SelectColumn +================== +*/ +void SelectColumn(patchMesh_t* p, int nCol, bool bMulti) +{ + if (!bMulti) + g_qeglobals.d_num_move_points = 0; + for (int i = 0; i < p->height; i++) + { + AddPoint(p, p->ctrl[nCol][i].xyz, false); + } + //Sys_Printf("Selected Col %d\n", nCol); +} + + +/* +================== +AddPatchMovePoint +================== +*/ +void AddPatchMovePoint(vec3_t v, bool bMulti, bool bFull) +{ + if (!g_bSameView && !bMulti && !bFull) + { + g_bSameView = true; + //return; // was causing odd behaviour on patch vertex selection + } + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t* p = pb->pPatch; + for ( int i = 0 ; i < p->width ; i++ ) + { + for ( int j = 0 ; j < p->height ; j++ ) + { + if (VectorCompare(v, p->ctrl[i][j].xyz)) + { + if (PointInMoveList(p->ctrl[i][j].xyz) == -1) + { + if (bFull) // if we want the full row/col this is on + { + SelectColumn(p, i, bMulti); + } + else + { + if (!bMulti) + g_qeglobals.d_num_move_points = 0; + AddPoint(p, p->ctrl[i][j].xyz); + //Sys_Printf("Selected col:row %d:%d\n", i, j); + } + //--if (!bMulti) + return; + } + else + { + if (bFull) + { + if (ColumnSelected(p, i)) + { + SelectRow(p, j, bMulti); + } + else + { + SelectColumn(p, i, bMulti); + } + return; + } + //if (!bMulti) + //{ + // g_qeglobals.d_num_move_points = 0; + // AddPoint(p, p->ctrl[i][j].xyz); + //} + if (bMulti)// if (g_bSameView) // this is not having desired effect + { + RemovePointFromMoveList(v); + return; + } + } + } + } + } + } + } +} + +/* +================== +Patch_UpdateSelected +================== +*/ +void Patch_UpdateSelected(vec3_t vMove) +{ + int i;//, j; + for (i=0 ; i < g_qeglobals.d_num_move_points ; i++) + { + VectorAdd (g_qeglobals.d_move_points[i], vMove, g_qeglobals.d_move_points[i]); + if (g_qeglobals.d_num_move_points == 1) + { + } + } + + //--patchMesh_t* p = &patchMeshes[g_nSelectedPatch]; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t* p = pb->pPatch; + +#if 0 //moving to SelectCurvePointByRay + g_qeglobals.d_numpoints = 0; + for (i = 0 ; i < p->width ; i++ ) + { + for ( j = 0 ; j < p->height ; j++ ) + { + VectorCopy (p->ctrl[i][j].xyz, g_qeglobals.d_points[g_qeglobals.d_numpoints]); + if (g_qeglobals.d_numpoints < MAX_POINTS-1) + { + g_qeglobals.d_numpoints++; + } + } + } +#endif + vec3_t vMin, vMax; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); + } + } + //Brush_Free(p->pSymbiot); + //Select_Brush(AddBrushForPatch(g_nSelectedPatch)); +} + + + +/* +=============== +SampleSinglePatch +=============== +*/ +void SampleSinglePatch (float ctrl[3][3][5], float u, float v, float out[5]) { + float vCtrl[3][5]; + int vPoint; + int axis; + + // find the control points for the v coordinate + for (vPoint = 0 ; vPoint < 3 ; vPoint++) + { + for (axis = 0 ; axis < 5 ; axis++) + { + float a, b, c; + float qA, qB, qC; + + a = ctrl[0][vPoint][axis]; + b = ctrl[1][vPoint][axis]; + c = ctrl[2][vPoint][axis]; + qA = a - 2 * b + c; + qB = 2 * b - 2 * a; + qC = a; + + vCtrl[vPoint][axis] = qA * u * u + qB * u + qC; + } + } + + // interpolate the v value + for (axis = 0 ; axis < 5 ; axis++) + { + float a, b, c; + float qA, qB, qC; + + a = vCtrl[0][axis]; + b = vCtrl[1][axis]; + c = vCtrl[2][axis]; + qA = a - 2 * b + c; + qB = 2 * b - 2 * a; + qC = a; + + out[axis] = qA * v * v + qB * v + qC; + } +} + +//spog - Curve LOD stuff starts + +float ShadeForNormal(vec3_t normal) +{ + float f; + + vec3_t L; + L[0] = 1.0f; + L[1] = 1.0f; + L[2] = 1.0f; + + + // quick diffuse shading + f = DotProduct(L, normal); + + // range 0.5 to 1.0 + f = (f+1)/4.0f; + //if (f < 0.0f) f = 0.0f; + + f += 0.5f; + + return f; +} + +void ShadeVertex (drawVert_t &p) +{ + p.lightmap[0] = ShadeForNormal(p.normal); +} + + +void Patch_DrawNormals(patchMesh_t *patch) +{ + int row, col; + vec3_t vNormal; + + qglBegin (GL_LINES); + for (col=0; colwidth; col++) + { + for (row=0; rowheight; row++) + { + VectorAdd(patch->ctrl[col][row].xyz, patch->ctrl[col][row].normal, vNormal); + qglVertex3fv (patch->ctrl[col][row].xyz); + qglVertex3fv (vNormal); + } + } + qglEnd (); +} + + +// take an array of three drawVerts, and the addresses of three more drawVerts +// interpolate new XYZST values from the three drawVerts, these are: +// the left sub-control-point, the right sub-control-point and the midpoint of the curve respectively +// store these values in the drawVerts passed to the function +void Patch_CurveSplit(drawVert_t *vCurve[3], drawVert_t &pLeft, drawVert_t &pRight, drawVert_t &pMid, float u) +{ + int i; + //float u = 0.5f; +// float a, b; + drawVert_t v1, v2, v3; +// vec3_t v4; + + for (i=0; i<3; i++) + { + // xyz + v1.xyz[i] = vCurve[1]->xyz[i] - vCurve[0]->xyz[i]; + v2.xyz[i] = vCurve[2]->xyz[i] - vCurve[1]->xyz[i]; + v1.xyz[i] *= u; + v2.xyz[i] *= u; + pLeft.xyz[i] = vCurve[0]->xyz[i] + v1.xyz[i]; + pRight.xyz[i] = vCurve[1]->xyz[i] + v2.xyz[i]; + + v3.xyz[i] = pRight.xyz[i] - pLeft.xyz[i]; + v3.xyz[i] *= u; + pMid.xyz[i] = pLeft.xyz[i] + v3.xyz[i]; + + // normal (weighted average) // no, that's b0rked + //a = 1 / u; // total + //b = u * a; // component 2 + //a = u - b; // component 1 + //pMid.normal[i] = u * ((vCurve[0]->normal[i] * b) + (vCurve[2]->normal[i] * a)); + + if (i==2) continue; + + // st + v1.st[i] = vCurve[1]->st[i] - vCurve[0]->st[i]; + v2.st[i] = vCurve[2]->st[i] - vCurve[1]->st[i]; + v1.st[i] *= u; + v2.st[i] *= u; + pLeft.st[i] = vCurve[0]->st[i] + v1.st[i]; + pRight.st[i] = vCurve[1]->st[i] + v2.st[i]; + + v3.st[i] = pRight.st[i] - pLeft.st[i]; + v3.st[i] *= u; + pMid.st[i] = pLeft.st[i] + v3.st[i]; + } +} + +// take an array of three points, return an index representing the curvature of those three points +// return zero if the curve is a straight line, unless the midpoint is not between the endpoints +float Patch_CurveIndex(vec3_t vCurve[]) +{ + vec3_t vTemp, v1, v2, v3, vClear; +// int i; + float width, angle; + float index, dot; + + VectorClear(vClear); + + VectorSubtract(vCurve[2], vCurve[0], vTemp); + VectorSubtract(vCurve[1], vCurve[0], v1); + VectorSubtract(vCurve[2], vCurve[1], v2); + + if (VectorCompare(v1, vClear) || VectorCompare(vTemp, v1)) // return 0 if 1->2 == 0 or 1->2 == 1->3 + return 0.0f; + + VectorNormalize(v1, v1); + VectorNormalize(v2, v2); + if (VectorCompare(v1, v2)) + return 0.0f; + + VectorCopy(vTemp, v3); + width = VectorNormalize(v3, v3); + + if (VectorCompare(v1, v3) && VectorCompare(v2, v3)) + return 0.0f; + + dot = DotProduct(v1, v2); + + angle = acos(dot) / Q_PI; + + index = width * angle; + + return index; +} + + +// create a new tree root, give it the coordinate values of the drawVert +// return a pointer to the new tree root +BTNode_t *BTree_Create(drawVert_t info) +{ + BTNode_t *BTree = new BTNode_t; + BTree->left = BTree->right = NULL; + VectorCopy(info.xyz, BTree->info.xyz); + VectorCopy(info.xyz, BTree->vMid.xyz); + for (int i=0; i<2; i++) + { + BTree->info.st[i] = info.st[i]; + BTree->vMid.st[i] = info.st[i]; + } + return BTree; +} + +// take ownership of the subtree +// delete the entire subtree +// return a NULL pointer +BTNode_t *BTree_Delete(BTNode_t *pBT) +{ + if (pBT != NULL) + { + BTree_Delete(pBT->left); + BTree_Delete(pBT->right); + delete pBT; + } + return NULL; +} + +// NOT currently used +BTNode_t *BTree_Clear(BTNode_t *pBT, bool bFirst = true) +{ + if (pBT != NULL) + { + BTree_Clear(pBT->left, false); + BTree_Clear(pBT->right, false); + if (!bFirst) delete pBT; + } + return pBT; +} + +// take a pointer to the last item added to the list (this can also be a NULL pointer) +// take a pointer to the root of a subtree, and the patch points to the left and right of it +// add a new item to the subtree list, and add the subtree and its adjacent points to the new item +// return a pointer to the last item added to the subtree list +BTreeList_t *BTree_AddToList(BTreeList_t *pBTList, BTNode_t *pBT, drawVert_t &pLeft, drawVert_t &pRight) +{ + BTreeList_t *newBTList = new BTreeList_t; + newBTList->next = pBTList; + newBTList->pBT = pBT; + VectorCopy(pLeft.xyz, newBTList->vLeft.xyz); + VectorCopy(pRight.xyz, newBTList->vRight.xyz); + VectorCopy(pLeft.normal, newBTList->vLeft.normal); + VectorCopy(pRight.normal, newBTList->vRight.normal); + for (int i=0; i<2; i++) + { + newBTList->vLeft.st[i] = pLeft.st[i]; + newBTList->vRight.st[i] = pRight.st[i]; + } + return newBTList; +} + +// NOT currently used, subtrees are now stored on the patch +// take ownership of the subtree list +// delete the entire list and the subtrees it points to +// return a NULL pointer +BTreeList_t *BTree_DeleteList(BTreeList_t *pBTList) +{ + if (pBTList != NULL) + { + BTree_DeleteList(pBTList->next); + pBTList->pBT = BTree_Delete(pBTList->pBT); + delete pBTList; + } + return NULL; +} + +// take ownership of the subtree list +// delete the entire subtree list, but not the subtrees themselves +// return a NULL pointer +BTreeList_t *BTree_DeletePointerList(BTreeList_t *pBTList) +{ + if (pBTList != NULL) + { + BTree_DeletePointerList(pBTList->next); + delete pBTList; + } + return NULL; +} + +// take a pointer to the last item added to the list of subtree lists +// add a subtree list to the list +// return a pointer to the last item added +BTListList_t *BTree_AddListToList(BTListList_t *pBTListList, BTreeList_t *pBTList) +{ + BTListList_t *newBTListList = new BTListList_t; + newBTListList->next = pBTListList; + newBTListList->list = pBTList; + return newBTListList; +} + + +// take ownership of the list of subtree lists +// delete the entire list of lists, but not the subtrees themselves +// return a NULL pointer +BTListList_t *BTree_DeleteListFromList(BTListList_t *pBTListList) +{ + if (pBTListList != NULL) + { + BTree_DeleteListFromList(pBTListList->next); + pBTListList->list = BTree_DeletePointerList(pBTListList->list); + delete pBTListList; + } + return NULL; +} + +// take a pointer to the last item in the list +// add a NULL linker subtree to the list, setting the "flipped" flag using the left curvepoint normal .. er.. hacky? +BTreeList_t *BTree_AddLinkToList(BTreeList_t *pBTList, bool bFlipped = false) +{ + BTreeList_t *linkBTList = new BTreeList_t; + linkBTList->pBT = NULL; + linkBTList->next = pBTList; + linkBTList->vLeft.normal[0] = (bFlipped) ? 1.0f : 0.0f; + return linkBTList; +} + + +// take an array of three points and the address of a vector +// store midpoint of the bezier curve formed by the three points, in the vector +void Patch_BezierInterpolate(vec3_t vCurve[], vec3_t &pMid) +{ + vec3_t vTemp; + int i; + VectorSubtract(vCurve[2], vCurve[0], vTemp); // Start->End + for (i=0; i<3; i++) + vTemp[i] /= 2; + VectorAdd(vCurve[0], vTemp, vTemp); // midpoint of Start->End + + VectorSubtract(vTemp, vCurve[1], vTemp); // Mid->(midpoint of Start->End) + for (i=0; i<3; i++) + vTemp[i] /= 2; + VectorAdd(vCurve[1], vTemp, pMid); // midpoint of Mid->(midpoint of Start->End) +} + + +// take a pointer to the list of subtrees, and a threshold value +// generate REAL surface curvature for the subtree curves, using bezier interpolation +// if any of the real curves has an index greater than the threshold, return true +bool Patch_MostCurvedRow(BTreeList_t *pBTList, int threshold) +{ + BTreeList_t *p; + float index;//, bestindex = 0; + vec3_t vCurve[3]; + vec3_t vRow[3]; +// int i; + + for (p = pBTList; p != NULL; p = p->next->next) + { + // this row + VectorCopy(p->vLeft.xyz, vCurve[0]); + VectorCopy(p->pBT->info.xyz, vCurve[1]); + VectorCopy(p->vRight.xyz, vCurve[2]); + + index = Patch_CurveIndex(vCurve); + if (index > threshold) + return true; + + if (p->next == NULL) + break; + + if (p->next->pBT == NULL) continue; + + VectorCopy(p->vLeft.xyz, vCurve[0]); + VectorCopy(p->next->vLeft.xyz, vCurve[1]); + VectorCopy(p->next->next->vLeft.xyz, vCurve[2]); + Patch_BezierInterpolate(vCurve, vRow[0]); + + VectorCopy(p->pBT->info.xyz, vCurve[0]); + VectorCopy(p->next->pBT->info.xyz, vCurve[1]); + VectorCopy(p->next->next->pBT->info.xyz, vCurve[2]); + Patch_BezierInterpolate(vCurve, vRow[1]); + + VectorCopy(p->vRight.xyz, vCurve[0]); + VectorCopy(p->next->vRight.xyz, vCurve[1]); + VectorCopy(p->next->next->vRight.xyz, vCurve[2]); + Patch_BezierInterpolate(vCurve, vRow[2]); + + index = Patch_CurveIndex(vRow); + if (index > threshold) + return true; + } + return false; +} + + +// take a pointer to a list of subtrees.. each subtree in the list is a 3-point bezier curve formed by two endpoints owned by the list, and a midpoint subtree node owned by a patch. +// if any of the subtrees are curved above a threshold, create a left and right subsubtree for each subtree in the list. +// if a NULL linker subtree is found, check for an orientation flip - ie. an inverted LOD-match - and create a NULL subsubtree with the same orientation flip +// this effectively generates trees for multiple patches at the same time.. the subtrees are always owned by their respective patches though +void BTree_ListCurveRecurse(BTreeList_t *pBTList) +{ + BTreeList_t *p; + BTreeList_t *leftBTList, *rightBTList; + //drawVert_t pLeft, pRight, pMid; + drawVert_t *vCurve[3]; + int threshold; + //int i; + bool bFlipped = false; + + if (g_PrefsDlg.m_nSubdivisions >= 1) + threshold = g_PrefsDlg.m_nSubdivisions; + + leftBTList = rightBTList = NULL; + + if (Patch_MostCurvedRow(pBTList, threshold)) // split all subtrees in list if any subtree is above threshold + { + //Sys_Printf("| "); + // traverse nodes in list + for (p = pBTList; p != NULL; p=p->next) + { + if (p->pBT == NULL) + { + leftBTList = BTree_AddLinkToList(leftBTList, (p->vLeft.normal[0] == 1.0f)); + rightBTList = BTree_AddLinkToList(rightBTList, (p->vLeft.normal[0] == 1.0f)); + if (p->vLeft.normal[0] == 1.0f) bFlipped = (!bFlipped) ? true : false; // switch bFlipped if true + continue; + } + + // create left node for this subtree + BTNode_t *newLeft = new BTNode_t; + p->pBT->left = newLeft; + newLeft->left = newLeft->right = NULL; + + // create right node for this subtree + BTNode_t *newRight = new BTNode_t; + p->pBT->right = newRight; + newRight->left = newRight->right = NULL; + + // split this node + vCurve[0] = &p->vLeft; + vCurve[1] = &p->pBT->info; + vCurve[2] = &p->vRight; + Patch_CurveSplit(vCurve, newLeft->info, newRight->info, p->pBT->vMid, 0.5); + + memcpy(&newLeft->vMid, &newLeft->info, sizeof(drawVert_t)); + memcpy(&newRight->vMid, &newRight->info, sizeof(drawVert_t)); + + + if (!bFlipped) + { + // add new left subtree to left subtree list + leftBTList = BTree_AddToList(leftBTList, newLeft, p->vLeft, p->pBT->vMid); + + // add new right subtree to right subtree list + rightBTList = BTree_AddToList(rightBTList, newRight, p->pBT->vMid, p->vRight); + } + else + { + // add new left subtree to right subtree list + rightBTList = BTree_AddToList(rightBTList, newLeft, p->vLeft, p->pBT->vMid); + + // add new right subtree to left subtree list + leftBTList = BTree_AddToList(leftBTList, newRight, p->pBT->vMid, p->vRight); + } + } + + // continue tree left + BTree_ListCurveRecurse(leftBTList); + leftBTList = BTree_DeletePointerList(leftBTList); + + // continue tree right + BTree_ListCurveRecurse(rightBTList); + rightBTList = BTree_DeletePointerList(rightBTList); + } +} + +// take mins and maxs values from two brushes +// return true if they intersect on every axis +bool TouchingAABBs(vec3_t mins1, vec3_t maxs1, vec3_t mins2, vec3_t maxs2) +{ + //bool xyz[3]; + vec3_t v1, v2, p1, p2, T; + for (int i=0; i<3; i++) + { + v1[i] = maxs1[i] - mins1[i]; + v2[i] = maxs2[i] - mins2[i]; + v1[i] /=2; + v2[i] /=2; + p1[i] = mins1[i] + v1[i]; + p2[i] = mins2[i] + v2[i]; + // p1 == origin of aabb1 + // p2 == origin of aabb1 + // v1 == displacement of aabb1 + // v1 == displacement of aabb2 + T[i] = p2[i] - p1[i]; // T == vector from aabb1 to aabb2 + if ( fabs(T[i]) > (fabs(v1[i]) + fabs(v2[i])) ) + return false; + } + return true; +} + +// take a pointer to the last item added to pBTList, a pointer to the patch, a row index (start) and a column index +// generate a row of row-curve tree roots, owned by the patch and add the entire column of row-curves to the list, using the row index to decide the order to add +// return a pointer to the last item added to the list +BTreeList_t *Patch_CreateBTListForRows(BTreeList_t *pBTList, patchMesh_t *patch, int start, int col) +{ + int row, pos; + patch->colDirty[(col-1)/2] = true; + + if (start == 0) + { + for (row=0; rowheight; row++) + { + pos = (((col-1)/2)*patch->height)+row; + patch->rowLOD[pos] = BTree_Delete(patch->rowLOD[pos]); + patch->rowLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->rowLOD[pos], patch->ctrl[col-1][row], patch->ctrl[col+1][row]); + } + } + else + { + for (row=patch->height-1; row>=0; row--) + { + pos = (((col-1)/2)*patch->height)+row; + patch->rowLOD[pos] = BTree_Delete(patch->rowLOD[pos]); + patch->rowLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->rowLOD[pos], patch->ctrl[col-1][row], patch->ctrl[col+1][row]); + } + } + return pBTList; +} + +// take a pointer to the last item added to pBTList, a pointer to the patch, a row index and a column index (start) +// generate a row of column-curve tree roots, owned by the patch and add the entire row of column-curves to the list, using the column index to decide the order to add +// return a pointer to the last item added to the list +BTreeList_t *Patch_CreateBTListForCols(BTreeList_t *pBTList, patchMesh_t *patch, int row, int start) +{ + int col, pos; + patch->rowDirty[(row-1)/2] = true; + + if (start == 0) + { + for (col=0; colwidth; col++) + { + pos = (((row-1)/2)*patch->width)+col; + patch->colLOD[pos] = BTree_Delete(patch->colLOD[pos]); + patch->colLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->colLOD[pos], patch->ctrl[col][row-1], patch->ctrl[col][row+1]); + } + } + else + { + for (col=patch->width-1; col>=0; col--) + { + pos = (((row-1)/2)*patch->width)+col; + patch->colLOD[pos] = BTree_Delete(patch->colLOD[pos]); + patch->colLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->colLOD[pos], patch->ctrl[col][row-1], patch->ctrl[col][row+1]); + } + + } + return pBTList; +} + +bool BTree_IsInList(BTreeList_t *pBTList, BTNode_t *pBT) +{ + BTreeList_t *p; + if (pBTList == NULL) return false; + + for (p=pBTList; p != NULL; p=p->next) + { + if (p->pBT != NULL) + { + if (p->pBT == pBT) + return true; + } + } + return false; +} + +int Patch_DegenCurve(vec3_t &start, vec3_t &mid, vec3_t &end) +{ + if (VectorCompare(start, mid) || VectorCompare(end, mid)) + { + if (VectorCompare(start, end)) return 2; + else return 1; + } + else return 0; +} + +// take a pointer to the last item added to the list, and a pointer to a patch (this patch is the owner of the three drawverts) +// take the addresses of three drawVerts, and compare them with the edges of all patches that touch the patch +// if they match an edge, add the tree roots for that section of the matched patch to the list, and recurse for the opposite edge of that patch section. Also, set the matched patch Dirty, so that its drawlists will be rebuilt +// return a pointer to the last item added +BTreeList_t *Patch_FindLODMatches(patchMesh_t *patch, BTreeList_t *pBTList, drawVert_t &pMid, drawVert_t &pLeft, drawVert_t &pRight) +{ + brush_t *pb, *brushlist; + int row, col, i;//, pos; + vec3_t vTemp, v1, v2;//, vClear; + bool bAlreadyAdded; + + //Sys_Printf("Patch_FindLODMatches: called\n"); + + if (VectorCompare(pMid.xyz, pLeft.xyz) && VectorCompare(pMid.xyz, pRight.xyz)) + return pBTList; + + //VectorClear(vClear); + VectorSubtract(pRight.xyz, pLeft.xyz, vTemp); + VectorSubtract(pMid.xyz, pLeft.xyz, v1); + VectorSubtract(pRight.xyz, pMid.xyz, v2); + + //if (VectorCompare(v1, vClear) || VectorCompare(vTemp, v1)) // return null if 1->2 == 0 or 1->2 == 1->3 + // return pBTList; + + VectorNormalize(v1, v1); + VectorNormalize(v2, v2); + if (VectorCompare(v1, v2)) + return pBTList; + + VectorNormalize(vTemp, vTemp); + if (VectorCompare(v1, vTemp) && VectorCompare(v2, vTemp)) + return pBTList; + + brushlist = &active_brushes; + for (i=0; i<2; i++) + { + for (pb = brushlist->next; pb != brushlist; pb=pb->next) + { + if (!pb->patchBrush || pb->pPatch == patch) + continue; + + // ignore this patch if its AABB does not touch the subject patch + if (!TouchingAABBs(patch->pSymbiot->maxs, patch->pSymbiot->mins, pb->maxs, pb->mins)) + continue; + + // all columns of curves + for (col=1; colpPatch->width; col+=2) + { + if (pb->pPatch->colDirty[(col-1)/2]) continue; + + bAlreadyAdded = false; + + // top and bottom curves of this column + for (row=0; rowpPatch->height; row+=pb->pPatch->height-1) + { + if (bAlreadyAdded) + continue; + //if (!BTree_IsInList(pBTList, pb->pPatch->rowLOD[(((col-1)/2)*patch->height)+row])) + // continue; + // ignore this curve if it shares no mid ctrl point with the test curve + if (!VectorCompare (pb->pPatch->ctrl[col][row].xyz, pMid.xyz)) + continue; + // ignore this curve if it is degenerate + if (VectorCompare (pb->pPatch->ctrl[col][row].xyz, pb->pPatch->ctrl[col-1][row].xyz) || VectorCompare (pb->pPatch->ctrl[col][row].xyz, pb->pPatch->ctrl[col+1][row].xyz)) + continue; + // if curve matches the test curve directly + if (VectorCompare (pb->pPatch->ctrl[col-1][row].xyz, pLeft.xyz) && VectorCompare (pb->pPatch->ctrl[col+1][row].xyz, pRight.xyz)) + { + // add a blank link as separator + pBTList = BTree_AddLinkToList(pBTList); + // add this entire column, if top, top-to-bottom, else bottom to top + pBTList = Patch_CreateBTListForRows(pBTList, pb->pPatch, row, col); + // continue checking from last curve added to list + pBTList = Patch_FindLODMatches(pb->pPatch, pBTList, pBTList->pBT->info, pBTList->vLeft, pBTList->vRight); + // set flag + pb->pPatch->LODUpdated = true; + bAlreadyAdded = true; + } + // if curve matches test curve but flipped + else if (VectorCompare (pb->pPatch->ctrl[col-1][row].xyz, pRight.xyz) && VectorCompare (pb->pPatch->ctrl[col+1][row].xyz, pLeft.xyz)) + { + pBTList = BTree_AddLinkToList(pBTList, true); // flip + pBTList = Patch_CreateBTListForRows(pBTList, pb->pPatch, row, col); + pBTList = Patch_FindLODMatches(pb->pPatch, pBTList, pBTList->pBT->info, pBTList->vLeft, pBTList->vRight); + pb->pPatch->LODUpdated = true; + bAlreadyAdded = true; + } + } + } + + // all rows of curves + for (row=1; rowpPatch->height; row+=2) + { + if (pb->pPatch->rowDirty[(row-1)/2]) continue; + + bAlreadyAdded = false; + + for (col=0; colpPatch->width; col+=pb->pPatch->width-1) + { + if (bAlreadyAdded) + continue; + //if (BTree_IsInList(pBTList, pb->pPatch->colLOD[(((row-1)/2)*patch->width)+col])) + // continue; + if (!VectorCompare (pb->pPatch->ctrl[col][row].xyz, pMid.xyz)) + continue; + if (VectorCompare (pb->pPatch->ctrl[col][row].xyz, pb->pPatch->ctrl[col][row-1].xyz) || VectorCompare (pb->pPatch->ctrl[col][row].xyz, pb->pPatch->ctrl[col][row+1].xyz)) + continue; + if (VectorCompare (pb->pPatch->ctrl[col][row-1].xyz, pLeft.xyz) && VectorCompare (pb->pPatch->ctrl[col][row+1].xyz, pRight.xyz)) + { + pBTList = BTree_AddLinkToList(pBTList); + pBTList = Patch_CreateBTListForCols(pBTList, pb->pPatch, row, col); + pBTList = Patch_FindLODMatches(pb->pPatch, pBTList, pBTList->pBT->info, pBTList->vLeft, pBTList->vRight); + pb->pPatch->LODUpdated = true; + bAlreadyAdded = true; + } + else if (VectorCompare (pb->pPatch->ctrl[col][row-1].xyz, pRight.xyz) && VectorCompare (pb->pPatch->ctrl[col][row+1].xyz, pLeft.xyz)) + { + pBTList = BTree_AddLinkToList(pBTList, true); // flip + pBTList = Patch_CreateBTListForCols(pBTList, pb->pPatch, row, col); + pBTList = Patch_FindLODMatches(pb->pPatch, pBTList, pBTList->pBT->info, pBTList->vLeft, pBTList->vRight); + pb->pPatch->LODUpdated = true; + bAlreadyAdded = true; + } + } + } + } + brushlist = &selected_brushes; + } + return pBTList; +} + +// take a pointer to a patch +// create tree roots for all the rows and columns of curves in the patch, the patch takes ownership of these new tree roots +// generate lists of pointers to all the trees in all the patches in the map which need to match the LOD of trees owned by this patch +// store all the lists in a list of lists +// recursively generate the rest of every tree in each list in the list +void Patch_CreateLODTrees(patchMesh_t *patch) +{ + BTreeList_t *pBTList; + int col, row, pos;//, rowcount, colcount; + BTListList_t *pLists; + + //Sys_Printf("Patch_CreateMatchedLODTrees: called\n"); + + BTListList_t *LODLists; + LODLists = NULL; + + pBTList = NULL; + + patch->bDirty = false; + patch->LODUpdated = true; + + for(col=1; colwidth; col+=2) + { + if (patch->colDirty[(col-1)/2]) continue; + else patch->colDirty[(col-1)/2] = true; + + // create list for rows of current patch + for(row=0; rowheight; row++) + { + pos = (((col-1)/2)*patch->height)+row; + patch->rowLOD[pos] = BTree_Delete(patch->rowLOD[pos]); + patch->rowLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->rowLOD[pos], patch->ctrl[col-1][row], patch->ctrl[col+1][row]); + } + + //create connection list for first row + pBTList = Patch_FindLODMatches(patch, pBTList, patch->ctrl[col][0], patch->ctrl[col-1][0], patch->ctrl[col+1][0]); + //create connection list for last row + pBTList = Patch_FindLODMatches(patch, pBTList, patch->ctrl[col][row-1], patch->ctrl[col-1][row-1], patch->ctrl[col+1][row-1]); + + LODLists = BTree_AddListToList(LODLists, pBTList); + pBTList = NULL; + } + + pBTList = NULL; + for(row=1; rowheight; row+=2) + { + if (patch->rowDirty[(row-1)/2]) continue; + else patch->rowDirty[(row-1)/2] = true; + + // create list for cols of current patch + for(col=0; colwidth; col++) + { + pos = (((row-1)/2)*patch->width)+col; + patch->colLOD[pos] = BTree_Delete(patch->colLOD[pos]); + patch->colLOD[pos] = BTree_Create(patch->ctrl[col][row]); + pBTList = BTree_AddToList(pBTList, patch->colLOD[pos], patch->ctrl[col][row-1], patch->ctrl[col][row+1]); + } + + //create connection list for first col + pBTList = Patch_FindLODMatches(patch, pBTList, patch->ctrl[0][row], patch->ctrl[0][row-1], patch->ctrl[0][row+1]); + //create connection list for last col + pBTList = Patch_FindLODMatches(patch, pBTList, patch->ctrl[col-1][row], patch->ctrl[col-1][row-1], patch->ctrl[col-1][row+1]); + + LODLists = BTree_AddListToList(LODLists, pBTList); + pBTList = NULL; + } + + for (pLists = LODLists; pLists != NULL; pLists=pLists->next) + BTree_ListCurveRecurse(pLists->list); + LODLists = BTree_DeleteListFromList(LODLists); +} + +int Patch_GetCVTangent(vec3_t &v1, vec3_t &p1, vec3_t &p2, vec3_t &p3) +{ + if (VectorCompare(p1, p2)) + { + if (VectorCompare(p1, p3)) + { + return 2; + } + else VectorSubtract(p3, p1, v1); + return 1; + } + else VectorSubtract(p2, p1, v1); + return 0; +} + +void Patch_CVNormal(vec3_t ctrl[3][3], vec3_t &normal) +{ + vec3_t v1, v2, vTemp1, vTemp2; + int a, b; + + a = Patch_GetCVTangent(v1, ctrl[0][0], ctrl[1][0], ctrl[2][0]); + b = Patch_GetCVTangent(v2, ctrl[0][0], ctrl[0][1], ctrl[0][2]); + + //Sys_Printf("p1: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f) p2: (%1.1f %1.1f %1.1f)\n", + // ctrl[0][0][0], ctrl[0][0][1], ctrl[0][0][2], ctrl[0][2][0], ctrl[0][2][1], ctrl[0][2][2], ctrl[2][0][0], ctrl[2][0][1], ctrl[2][0][2]); + + if (a == 2) + { + a = Patch_GetCVTangent(v1, ctrl[0][0], ctrl[1][1], ctrl[1][2]); + } + if (b == 2) + { + b = Patch_GetCVTangent(v2, ctrl[0][0], ctrl[1][1], ctrl[2][1]); + } + + if (a == 2) + { + a = Patch_GetCVTangent(v1, ctrl[0][0], ctrl[2][1], ctrl[2][2]); + } + if (b == 2) + { + b = Patch_GetCVTangent(v2, ctrl[0][0], ctrl[1][2], ctrl[2][2]); + } + + CrossProduct(v1, v2, normal); + + + if (normal[0] == 0.0f && normal[1] == 0.0f && normal[2] == 0.0f) + { + // more degenerate cases + vec3_t pMid; + vec3_t vCurve[3]; + /* + if (VectorCompare(ctrl[0][0], ctrl[2][0])) // endcap left + { + if (VectorCompare(ctrl[0][2], ctrl[1][2])) + { + VectorSubtract(ctrl[2][2], ctrl[0][0], v2); + } + else if (VectorCompare(ctrl[1][2], ctrl[2][2])) + { + VectorSubtract(ctrl[0][2], ctrl[0][0], v2); + } + else + a = Patch_DegenCurve(ctrl[0][2], ctrl[1][2], ctrl[2][2]); + if (a == 0) + { + VectorCopy(ctrl[0][2], vCurve[0]); + VectorCopy(ctrl[1][2], vCurve[1]); + VectorCopy(ctrl[2][2], vCurve[2]); + Patch_BezierInterpolate(vCurve, pMid); + VectorSubtract(pMid, ctrl[0][0], v1); + } + + + } + else if (VectorCompare(ctrl[0][0], ctrl[0][2])) // endcap right + { + + if (VectorCompare(ctrl[2][0], ctrl[2][1])) + { + VectorSubtract(ctrl[2][2], ctrl[0][0], v2); + } + else if (VectorCompare(ctrl[2][1], ctrl[2][2])) + { + VectorSubtract(ctrl[2][0], ctrl[0][0], v2); + } + else + + b = Patch_DegenCurve(ctrl[2][0], ctrl[2][1], ctrl[2][2]); + if (b == 0) + { + VectorCopy(ctrl[2][0], vCurve[0]); + VectorCopy(ctrl[2][1], vCurve[1]); + VectorCopy(ctrl[2][2], vCurve[2]); + Patch_BezierInterpolate(vCurve, pMid); + VectorSubtract(pMid, ctrl[0][0], v2); + } + + } + */ + if (VectorCompare(ctrl[0][0], ctrl[2][0])) // bottom degen + { + Patch_GetCVTangent(v1, ctrl[0][0], ctrl[2][1], ctrl[2][2]); + } + else if (VectorCompare(ctrl[0][0], ctrl[0][2])) // left degen + { + Patch_GetCVTangent(v2, ctrl[0][0], ctrl[1][2], ctrl[2][2]); + } + else if (VectorCompare(ctrl[0][2], ctrl[2][2])) // top degen + { + VectorSubtract(ctrl[2][0], ctrl[0][0], v1); + } + else if (VectorCompare(ctrl[2][0], ctrl[2][2])) // right degen + { + VectorSubtract(ctrl[0][2], ctrl[0][0], v2); + } + else // tangents parallel + { + VectorCopy(v1, vTemp1); + VectorCopy(v2, vTemp2); + VectorNormalize(vTemp1, vTemp1); + VectorNormalize(vTemp2, vTemp2); + if (VectorCompare(vTemp1, vTemp2)) // parallel same way + { + VectorSubtract(ctrl[2][0], ctrl[0][0], vTemp1); + VectorNormalize(vTemp1, vTemp1); + if (VectorCompare(vTemp1, vTemp2)) + { + VectorSubtract(ctrl[0][2], ctrl[0][0], v2); + } + else + { + VectorCopy(vTemp1, v1); + } + } + else // parallel opposite way + { + VectorCopy(ctrl[2][0], vCurve[0]); + VectorCopy(ctrl[1][1], vCurve[1]); + VectorCopy(ctrl[0][2], vCurve[2]); + Patch_BezierInterpolate(vCurve, pMid); + VectorSubtract(pMid, ctrl[0][0], v2); + } + } + + CrossProduct(v1, v2, normal); + } +} + +void Patch_CalcCVNormals(patchMesh_t *patch) +{ + int row, col, i, j, n; + vec3_t ctrl[3][3]; + vec3_t normals[4]; + + for (col=0; colwidth; col+=2) + { + for (row=0; rowheight; row+=2) + { + n=0; + if (col+1 != patch->width && row+1 != patch->height) + { + for (i=0; i<3; i++) + for (j=0; j<3; j++) + VectorCopy (patch->ctrl[col+i][row+j].xyz, ctrl[i][j]); + + Patch_CVNormal(ctrl, normals[n]); + VectorNormalize(normals[n], normals[n]); + n++; + } + + if (col-1 >= 0 && row-1 >= 0) + { + for (i=0; i<3; i++) + for (j=0; j<3; j++) + VectorCopy (patch->ctrl[col-i][row-j].xyz, ctrl[i][j]); + + Patch_CVNormal(ctrl, normals[n]); + VectorNormalize(normals[n], normals[n]); + n++; + } + if (col-1 >= 0 && row+1 != patch->height) + { + for (i=0; i<3; i++) + for (j=0; j<3; j++) + VectorCopy (patch->ctrl[col-i][row+j].xyz, ctrl[j][i]); + + Patch_CVNormal(ctrl, normals[n]); + VectorNormalize(normals[n], normals[n]); + n++; + } + if (col+1 != patch->width && row-1 >= 0) + { + for (i=0; i<3; i++) + for (j=0; j<3; j++) + VectorCopy (patch->ctrl[col+i][row-j].xyz, ctrl[j][i]); + + Patch_CVNormal(ctrl, normals[n]); + VectorNormalize(normals[n], normals[n]); + n++; + } + + for (i=0; i<3; i++) + { + if (n == 1) patch->ctrl[col][row].normal[i] = normals[0][i]; + if (n == 2) patch->ctrl[col][row].normal[i] = (normals[0][i] + normals[1][i]) / n; + //if (n == 3) patch->ctrl[col][row].normal[i] = (normals[0][i] + normals[1][i] + normals[2][i]) / n; + if (n == 4) patch->ctrl[col][row].normal[i] = (normals[0][i] + normals[1][i] + normals[2][i] + normals[3][i]) / n; + } + VectorNormalize(patch->ctrl[col][row].normal, patch->ctrl[col][row].normal); + //if (!g_PrefsDlg.m_bGLLighting) + // ShadeVertex(patch->ctrl[col][row]); + } + } +} + + +void BTree_SetNormals(BTNode_t *pBT, vec3_t &normal) +{ + if (pBT != NULL) + { + if (pBT->left != NULL && pBT->right != NULL) + { + VectorCopy(normal, pBT->vMid.normal); + //if (!g_PrefsDlg.m_bGLLighting) + // ShadeVertex(pBT->vMid); + } + BTree_SetNormals(pBT->left, normal); + BTree_SetNormals(pBT->right, normal); + } +} + + +void NormalFromPoints(vec3_t p1, vec3_t p2, vec3_t p3, vec3_t &normal, bool flip = false) +{ + vec3_t v1, v2; + + if (flip) + { + VectorSubtract(p2, p3, v1); //p3->p2 + VectorSubtract(p1, p2, v2); //p2->p1 + } + else + { + VectorSubtract(p2, p1, v1); //p1->p2 + VectorSubtract(p3, p2, v2); //p2->p3 + } + CrossProduct(v1, v2, normal); +} + + +void BTree_GenerateNormals(BTNode_t *pBTMid, BTNode_t *pBTLeft, BTNode_t *pBTRight, bool avg, bool flat, bool nomid, bool noleft, bool noright, /*bool endcap, vec3_t &n1, vec3_t &n2,*/ bool flip) +{ + if (pBTMid != NULL) + { + if (pBTMid->left != NULL && pBTMid->right != NULL) + { + vec3_t normal; + + if (noleft) // left curve is degenerate + { + if (nomid) // mid curve is degenerate + { + NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + } + //else if (endcap) + //{ + // VectorCopy(n1, normal); + // NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + //} + else + { + NormalFromPoints(pBTMid->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + } + } + else if (noright) // right curve is degenerate + { + if (nomid) // mid curve is degenerate + { + NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + } + //else if (endcap) + //{ + // NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + // VectorCopy(n2, pBTRight->vMid.normal); + //} + else + { + NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + NormalFromPoints(pBTMid->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + } + } + else + { + if (flat) // all curves are semi-degenerate (flat) or degenerate + { + NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTRight->vMid.xyz, normal, flip); + NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTLeft->vMid.xyz, pBTRight->vMid.normal, flip); + } + else + { + NormalFromPoints(pBTLeft->left->info.xyz, pBTLeft->vMid.xyz, pBTMid->vMid.xyz, normal, flip); + NormalFromPoints(pBTRight->right->info.xyz, pBTRight->vMid.xyz, pBTMid->vMid.xyz, pBTRight->vMid.normal, flip); + } + } + + VectorNormalize(normal, normal); + if (avg) + for (int i=0; i<3; i++) + pBTLeft->vMid.normal[i] = (normal[i] + pBTLeft->vMid.normal[i]) / 2.0f; + else VectorCopy(normal, pBTLeft->vMid.normal); + + VectorNormalize(pBTLeft->vMid.normal, pBTLeft->vMid.normal); + VectorNormalize(pBTRight->vMid.normal, pBTRight->vMid.normal); + + } + BTree_GenerateNormals(pBTMid->left, pBTLeft->left, pBTRight->left, avg, flat, nomid, noleft, noright, /*endcap, n1, n2,*/ flip); + BTree_GenerateNormals(pBTMid->right, pBTLeft->right, pBTRight->right, avg, flat, nomid, noleft, noright, /*endcap, n1, n2,*/ flip); + } +} + + + +void Patch_GenerateLODNormals(patchMesh_t *patch) +{ + int col, row, rowpos, colpos, i; + BTNode_t *tree[2][3]; + int degen[2][3]; + bool rowAvg, colAvg; + + for(col=0; col+2width; col+=2) + { + for(row=0; row+2height; row+=2) + { + if (!patch->colDirty[col/2] && !patch->rowDirty[row/2]) continue; + + rowpos = ((col/2)*patch->height)+row; + colpos = ((row/2)*patch->width)+col; + + if (row==0) rowAvg = false; + else rowAvg = true; + if (col==0) colAvg = false; + else colAvg = true; + + for (i=0; i<3; i++) + { + tree[0][i] = patch->rowLOD[rowpos+i]; + tree[1][i] = patch->colLOD[colpos+i]; + + degen[0][i] = Patch_DegenCurve(patch->ctrl[col][row+i].xyz, patch->ctrl[col+1][row+i].xyz, patch->ctrl[col+2][row+i].xyz); + degen[1][i] = Patch_DegenCurve(patch->ctrl[col+i][row].xyz, patch->ctrl[col+i][row+1].xyz, patch->ctrl[col+i][row+2].xyz); + } + + BTree_GenerateNormals(tree[0][1], tree[0][0], tree[0][2], rowAvg, (degen[1][0] && degen[1][1] && degen[1][2]), degen[0][1] == 2, degen[0][0] == 2, degen[0][2] == 2, /*degen[1][1], patch->ctrl[col][row].normal, patch->ctrl[col][row+2].normal,*/ false); + BTree_GenerateNormals(tree[1][1], tree[1][0], tree[1][2], colAvg, (degen[0][0] && degen[0][1] && degen[0][2]), degen[1][1] == 2, degen[1][0] == 2, degen[1][2] == 2, /*degen[0][1], patch->ctrl[col][row].normal, patch->ctrl[col+2][row].normal,*/ true); + } + } +} + + +void Patch_ClearLODFlags(patchMesh_t *p) +{ + int i; + + for (i=0;i<(p->width-1)/2; i++) + p->colDirty[i] = false; + + for (i=0;i<(p->height-1)/2; i++) + p->rowDirty[i] = false; +} + +// reset the lodDirty flags owned by all patches in the map +// create new LOD trees for all dirty patches, matched with all other patches in the map +void Patch_LODMatchAll() +{ + brush_t *pb, *brushlist; + int i; + + // create LOD tree roots and LOD tree lists for all patches that are dirty + + brushlist = &active_brushes; + for (i=0; i<2; i++) + { + for (pb = brushlist->next; pb && (pb != brushlist); pb=pb->next) + { + // create lod for selected patches when patches are filtered + if (pb->bFiltered && (pb->patchBrush && !pb->pPatch->bSelected)) + continue; + if (!pb->patchBrush) + continue; + if (!pb->pPatch->bDirty) + continue; + + Patch_CalcCVNormals(pb->pPatch); + Patch_CreateLODTrees(pb->pPatch); + } + brushlist = &selected_brushes; + } + + brushlist = &active_brushes; + for (i=0; i<2; i++) + { + for (pb = brushlist->next; pb && (pb != brushlist); pb=pb->next) + { + if (!pb->patchBrush) + continue; + + if (pb->pPatch->LODUpdated) + Patch_GenerateLODNormals(pb->pPatch); + + Patch_ClearLODFlags(pb->pPatch); + } + brushlist = &selected_brushes; + } + +} + +void Vertex_TransformTexture(drawVert_t *pVert, float fx, float fy, transformtype xform) +{ + switch(xform) + { + case TRANSLATE: + pVert->st[0] += fx; + pVert->st[1] += fy; + break; + case SCALE: + pVert->st[0] *= fx; + pVert->st[1] *= fy; + break; + case ROTATE: + float x = pVert->st[0]; + float y = pVert->st[1]; + pVert->st[0] = x * fx - y * fy; + pVert->st[1] = y * fx + x * fy; + } +} + +void BTree_TransformTexture(BTNode_t *pBT, float fx, float fy, transformtype xform) +{ + if (pBT != NULL) + { // PreOrder traversal + Vertex_TransformTexture(&pBT->info, fx, fy, xform); + Vertex_TransformTexture(&pBT->vMid, fx, fy, xform); + BTree_TransformTexture(pBT->left, fx, fy, xform); + BTree_TransformTexture(pBT->right, fx, fy, xform); + } +} + +void Patch_TransformLODTexture(patchMesh_t *p, float fx, float fy, transformtype xform) +{ + int col, row; + + for(col=1; colwidth; col+=2) + for(row=0; rowheight; row++) + BTree_TransformTexture(p->rowLOD[(((col-1)/2)*p->height)+row], fx, fy, xform); + + for(row=1; rowheight; row+=2) + for(col=0; colwidth; col++) + BTree_TransformTexture(p->colLOD[(((row-1)/2)*p->width)+col], fx, fy, xform); +} + +void Patch_AddBTreeToDrawListInOrder(list *drawList, BTNode_t *pBT) +{ + if (pBT != NULL) //traverse InOrder + { + Patch_AddBTreeToDrawListInOrder(drawList, pBT->left); + if (pBT->left != NULL && pBT->right != NULL) + drawList->push_back(pBT->vMid); + Patch_AddBTreeToDrawListInOrder(drawList, pBT->right); + } +} + +void Patch_InterpolateListFromRowBT(list *drawList, BTNode_t *rowBT, BTNode_t *rowBTLeft, drawVert_t *vCurve[], float u, float n, float v) +{ + if (rowBT != NULL) + { + Patch_InterpolateListFromRowBT(drawList, rowBT->left, rowBTLeft->left, vCurve, u-n, n*0.5f, v); + if (rowBT->left != NULL && rowBT->right != NULL) + { + vec3_t v1, v2; + drawVert_t newVert, vTemp1, vTemp2; + Patch_CurveSplit(vCurve, vTemp1, vTemp2, newVert, u); + for (int i=0; i<3; i++) + { + v1[i] = rowBT->vMid.xyz[i] - rowBTLeft->vMid.xyz[i]; // left -> mid + v1[i] = rowBTLeft->vMid.xyz[i] + (v1[i] * v); + v1[i] = newVert.xyz[i] - v1[i]; + } + VectorSubtract(vTemp1.xyz, newVert.xyz, v2); + CrossProduct(v1, v2, newVert.normal); + VectorNormalize(newVert.normal, newVert.normal); + //if (!g_PrefsDlg.m_bGLLighting) + // ShadeVertex(newVert); + drawList->push_back(newVert); + } + Patch_InterpolateListFromRowBT(drawList, rowBT->right, rowBTLeft->right, vCurve, u+n, n*0.5f, v); + } +} + +void Patch_TraverseColBTInOrder(list*>::iterator& iter, BTNode_t *colBTLeft, BTNode_t *colBT, BTNode_t *colBTRight, BTNode_t *rowBT, BTNode_t *rowBTLeft, float v, float n) +{ + if (colBT != NULL) + { + //traverse subtree In Order + Patch_TraverseColBTInOrder(iter, colBTLeft->left, colBT->left, colBTRight->left, rowBT, rowBTLeft, v-n, n*0.5f); + if (colBT->left != NULL && colBT->right != NULL) + { + drawVert_t *vCurve[3]; + vCurve[0] = &colBTLeft->vMid; + vCurve[1] = &colBT->vMid; + vCurve[2] = &colBTRight->vMid; + Patch_InterpolateListFromRowBT((*iter), rowBT, rowBTLeft, vCurve, 0.5f, 0.25f, v); + + (*iter)->push_back(colBTRight->vMid); + iter++; + } + Patch_TraverseColBTInOrder(iter, colBTLeft->right, colBT->right, colBTRight->right, rowBT, rowBTLeft, v+n, n*0.5f); + } +} + + +void Patch_StartDrawLists(list*> *drawLists, BTNode_t *colBT) +{ + if (colBT != NULL) + { + //traverse subtree In Order + Patch_StartDrawLists(drawLists, colBT->left); + if (colBT->left != NULL && colBT->right != NULL) + { + list *newList = new list; + drawLists->push_back(newList); // add empty list to back + drawLists->back()->push_back(colBT->vMid); + } + Patch_StartDrawLists(drawLists, colBT->right); + } +} + +typedef list drawList_t; +typedef list*> drawLists_t; + +void Patch_CreateDrawLists(patchMesh_t *patch) +{ + int col, row, colpos, rowpos; + + drawLists_t *drawLists = new drawLists_t; + + drawLists_t::iterator iter1, iter2; + + for (row=0; rowheight; row+=2) + { + colpos = (row/2)*patch->width; + drawList_t *newList = new drawList_t; + drawLists->push_back(newList); // add a new empty list to back + drawLists->back()->push_back(patch->ctrl[0][row]); // fill list at back + + if (row+1 == patch->height) + continue; + Patch_StartDrawLists(drawLists, patch->colLOD[colpos]); + } + + iter1 = drawLists->begin(); + for (row=0; rowheight; row+=2) + { + iter2 = iter1; + for (col=0; col+1width; col+=2) + { + iter1 = iter2; + colpos = ((row/2)*patch->width)+col; + rowpos = ((col/2)*patch->height)+row; + + Patch_AddBTreeToDrawListInOrder((*iter1), patch->rowLOD[rowpos]); + (*iter1)->push_back(patch->ctrl[col+2][row]); + + if (row+1 == patch->height) + continue; + + iter1++; + + Patch_TraverseColBTInOrder(iter1, patch->colLOD[colpos], patch->colLOD[colpos+1], patch->colLOD[colpos+2], patch->rowLOD[rowpos+1], patch->rowLOD[rowpos], 0.5, 0.25); + } + } + + patch->drawLists = drawLists; +} + + +void Patch_DeleteDrawLists(patchMesh_t *patch) +{ + drawLists_t *drawLists; + drawLists_t::iterator iter; + + if (patch->drawLists == NULL) + return; + + drawLists = (drawLists_t *)patch->drawLists; + + for (iter=drawLists->begin(); iter != drawLists->end(); iter++) + { + delete (*iter); + } + + delete drawLists; + patch->drawLists = NULL; +} + + +void Patch_DrawLODPatchMesh(patchMesh_t *patch) +{ + drawLists_t *drawLists; + + drawLists_t::iterator iterLists, iterListsNext; + drawList_t::iterator iterList, iterListNext; + + //int nGLState = g_pParentWnd->GetCamera()->Camera()->draw_glstate; + + if (patch->drawLists == NULL) + return; + + drawLists = (drawLists_t *)patch->drawLists; + + iterListsNext=drawLists->begin(); + iterListsNext++; + for (iterLists=drawLists->begin(); iterLists != drawLists->end() && iterListsNext != drawLists->end(); iterLists++, iterListsNext++) + { + // traverse two drawlists at once to draw a strip + //if (nGLState & DRAW_GL_LINE) + qglBegin(GL_QUAD_STRIP); + //else + // qglBegin(GL_TRIANGLE_STRIP); + for (iterList=(*iterLists)->begin(), iterListNext=(*iterListsNext)->begin(); iterList != (*iterLists)->end() && iterListNext != (*iterListsNext)->end(); iterList++, iterListNext++) + { + //if (g_PrefsDlg.m_bGLLighting) + qglNormal3fv((*iterList).normal); + //else if (bShade && !g_PrefsDlg.m_bDisplayLists) + // qglColor3f((*iterList).lightmap[0], (*iterList).lightmap[0], (*iterList).lightmap[0]); + + qglTexCoord2fv((*iterList).st); + qglVertex3fv((*iterList).xyz); + + //if (g_PrefsDlg.m_bGLLighting) + qglNormal3fv((*iterListNext).normal); + //else if (bShade && !g_PrefsDlg.m_bDisplayLists) + // qglColor3f((*iterListNext).lightmap[0], (*iterListNext).lightmap[0], (*iterListNext).lightmap[0]); + + qglTexCoord2fv((*iterListNext).st); + qglVertex3fv((*iterListNext).xyz); + } + qglEnd(); + } +/* +#ifdef _DEBUG + vec3_t vNormal; + for (iterLists=drawLists->begin(); iterLists != drawLists->end(); iterLists++) + { + qglBegin (GL_LINES); // draw normals + //qglColor3f(1,1,1); + for (iterList=(*iterLists)->begin(); iterList != (*iterLists)->end(); iterList++) + { + VectorAdd((*iterList).xyz, (*iterList).normal, vNormal); + qglVertex3fv ((*iterList).xyz); + qglVertex3fv (vNormal); + } + qglEnd (); + } + + Patch_DrawNormals(patch); + +#endif + */ +} + +/* +// fast memory-efficient ray-triangle intersection - MollerTrumbore97 + +#define EPSILON 0.000001 +#define CROSS(dest,v1,v2) {dest[0]=v1[1]*v2[2]-v1[2]*v2[1];dest[1]=v1[2]*v2[0]-v1[0]*v2[2];dest[2]=v1[0]*v2[1]-v1[1]*v2[0];} +#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) +#define SUB(dest,v1,v2) {dest[0]=v1[0]-v2[0];dest[1]=v1[1]-v2[1];dest[2]=v1[2]-v2[2];} + +int intersect_triangle(float orig[3], float dir[3], + float vert0[3], float vert1[3], float vert2[3], + double *t, double *u, double *v) +{ + double edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; + double det,inv_det; + + // find vectors for two edges sharing vert0 + SUB(edge1, vert1, vert0); + SUB(edge2, vert2, vert0); + + // begin calculating determinant - also used to calculate U parameter + CROSS(pvec, dir, edge2); + + // if determinant is near zero, ray lies in plane of triangle + det = DOT(edge1, pvec); + +#ifdef TEST_CULL // define TEST_CULL if culling is desired + if (det < EPSILON) + return 0; + + // calculate distance from vert0 to ray origin + SUB(tvec, orig, vert0); + + // calculate U parameter and test bounds + *u = DOT(tvec, pvec); + if (*u < 0.0 || *u > det) + return 0; + + // prepare to test V parameter + CROSS(qvec, tvec, edge1); + + // calculate V parameter and test bounds + *v = DOT(dir, qvec); + if (*v < 0.0 || *u + *v > det) + return 0; + + // calculate t, scale parameters, ray intersects triangle + *t = DOT(edge2, qvec); + inv_det = 1.0 / det; + *t *= inv_det; + *u *= inv_det; + *v *= inv_det; +#else // the non-culling branch + if (det > -EPSILON && det < EPSILON) + return 0; + inv_det = 1.0 / det; + + // calculate distance from vert0 to ray origin + SUB(tvec, orig, vert0); + + // calculate U parameter and test bounds + *u = DOT(tvec, pvec) * inv_det; + if (*u < 0.0 || *u > 1.0) + return 0; + + // prepare to test V parameter + CROSS(qvec, tvec, edge1); + + // calculate V parameter and test bounds + *v = DOT(dir, qvec) * inv_det; + if (*v < 0.0 || *u + *v > 1.0) + return 0; + + // calculate t, ray intersects triangle + *t = DOT(edge2, qvec) * inv_det; +#endif + return 1; +} +*/ + +int Triangle_Ray(float orig[3], float dir[3], bool bCullBack, + float vert0[3], float vert1[3], float vert2[3], + double *t, double *u, double *v) +{ + float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; + double det,inv_det; + + /* find vectors for two edges sharing vert0 */ + VectorSubtract(vert1, vert0, edge1); + VectorSubtract(vert2, vert0, edge2); + + /* begin calculating determinant - also used to calculate U parameter */ + CrossProduct(dir, edge2, pvec); + + /* if determinant is near zero, ray lies in plane of triangle */ + det = DotProduct(edge1, pvec); + + if (bCullBack) + { + if (det < 0.000001) + return 0; + + // calculate distance from vert0 to ray origin + VectorSubtract(orig, vert0, tvec); + + // calculate U parameter and test bounds + *u = DotProduct(tvec, pvec); + if (*u < 0.0 || *u > det) + return 0; + + // prepare to test V parameter + CrossProduct(tvec, edge1, qvec); + + // calculate V parameter and test bounds + *v = DotProduct(dir, qvec); + if (*v < 0.0 || *u + *v > det) + return 0; + + // calculate t, scale parameters, ray intersects triangle + *t = DotProduct(edge2, qvec); + inv_det = 1.0 / det; + *t *= inv_det; + *u *= inv_det; + *v *= inv_det; + } + else + { + /* the non-culling branch */ + if (det > -0.000001 && det < 0.000001) + return 0; + inv_det = 1.0 / det; + + /* calculate distance from vert0 to ray origin */ + VectorSubtract(orig, vert0, tvec); + + /* calculate U parameter and test bounds */ + *u = DotProduct(tvec, pvec) * inv_det; + if (*u < 0.0 || *u > 1.0) + return 0; + + /* prepare to test V parameter */ + CrossProduct(tvec, edge1, qvec); + + /* calculate V parameter and test bounds */ + *v = DotProduct(dir, qvec) * inv_det; + if (*v < 0.0 || *u + *v > 1.0) + return 0; + + /* calculate t, ray intersects triangle */ + *t = DotProduct(edge2, qvec) * inv_det; + } + return 1; +} + +bool Patch_Ray(patchMesh_t *patch, vec3_t origin, vec3_t dir, double *t, double *u, double *v) +{ + drawLists_t *drawLists; + + drawLists_t::iterator iterLists, iterListsNext; + drawList_t::iterator i1, i2, i3, i4; + +// vec3_t tris[2][3]; + bool bIntersect = false; + float tBest = FLT_MAX; + + if (patch->drawLists == NULL) + return false; + + drawLists = (drawLists_t *)patch->drawLists; + + iterListsNext=drawLists->begin(); + iterListsNext++; + for (iterLists=drawLists->begin(); iterLists != drawLists->end() && iterListsNext != drawLists->end(); iterLists++, iterListsNext++) + { + // traverse two drawlists at once with two iterators each to triangulate + i1 = i3 = (*iterLists)->begin(); + i2 = i4 = (*iterListsNext)->begin(); + i3++; + i4++; + while (i3 != (*iterLists)->end() && i4 != (*iterListsNext)->end()) + { + if (Triangle_Ray(origin, dir, false, (*i1).xyz, (*i2).xyz, (*i3).xyz, t, u, v)) + { + bIntersect = true; + if (*t < tBest) + tBest = *t; + } + if (Triangle_Ray(origin, dir, false, (*i3).xyz, (*i4).xyz, (*i2).xyz, t, u, v)) + { + bIntersect = true; + if (*t < tBest) + tBest = *t; + } + i1++; + i2++; + i3++; + i4++; + } + } + if (bIntersect) + { + *t = tBest; + return true; + } + else + { + *t = 0; + return false; + } +} + +// spog - curve LOD stuff ends + +/* +================= +DrawPatchMesh +================= +*/ +void DrawPatchMesh(patchMesh_t *pm) +{ + if (g_PrefsDlg.m_bDisplayLists) + { + if (pm->bDirty || pm->nListID <= 0 || pm->LODUpdated) + { + if (pm->nListID <= 0) + pm->nListID = qglGenLists(1); + if (pm->nListID > 0) + { + qglNewList(pm->nListID, GL_COMPILE_AND_EXECUTE); + } + + Patch_DeleteDrawLists(pm); + Patch_CreateDrawLists(pm); + + Patch_DrawLODPatchMesh(pm); + + if (pm->nListID > 0) + { + qglEndList(); + } + + pm->bDirty = false; + pm->LODUpdated = false; + } + else + { + qglCallList(pm->nListID); + } + } + else + { + if (pm->bDirty || pm->LODUpdated) + { + Patch_DeleteDrawLists(pm); + Patch_CreateDrawLists(pm); + pm->bDirty = false; + pm->LODUpdated = false; + } + Patch_DrawLODPatchMesh(pm); + } +} + +/* +================= +DrawPatchControls +================= +*/ +void DrawPatchControls(patchMesh_t *pm) +{ + int i, j; + bool bSelectedPoints[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT]; + + bool bOverlay = pm->bOverlay; + + // bending + if (g_bPatchBendMode) + { + qglPointSize(6); + if (g_bPatchAxisOnRow) + { + qglColor3f(1, 0, 1); + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglBegin(GL_POINTS); + for (i = 0; i < pm->width; i++) + { + qglVertex3fv(pm->ctrl[i][g_nPatchAxisIndex].xyz); + } + qglEnd(); + } + else + { + qglLineWidth(2.0); + qglBegin(GL_LINES); + for(i = 0; i < pm->width; i++) + { + DrawAlternatePoint(pm->ctrl[i][g_nPatchAxisIndex].xyz, 0); + } + qglEnd(); + qglLineWidth(1.0); + } + + if (g_nPatchBendState == BEND_SELECT_EDGE || g_nPatchBendState == BEND_BENDIT || g_nPatchBendState == BEND_SELECT_ORIGIN) + { + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglColor3f(0, 0, 1); + qglBegin(GL_POINTS); + if (g_nPatchBendState == BEND_SELECT_ORIGIN) + { + qglVertex3fv(g_vBendOrigin); + } + else + { + for (i = 0; i < pm->width; i++) + { + if (g_bPatchLowerEdge) + { + for (j = 0; j < g_nPatchAxisIndex; j++) + qglVertex3fv(pm->ctrl[i][j].xyz); + } + else + { + for (j = pm->height-1; j > g_nPatchAxisIndex; j--) + qglVertex3fv(pm->ctrl[i][j].xyz); + } + } + } + qglEnd(); + } + else { + qglColor3f(0, 0, 1); + qglLineWidth(2.0); + qglBegin(GL_LINES); + if(g_nPatchBendState == BEND_SELECT_ORIGIN) + { + DrawAlternatePoint(g_vBendOrigin, 0); + } + else + { + for(i = 0; i < pm->width; i++) + { + if(g_bPatchLowerEdge) + { + for(j = 0; j < g_nPatchAxisIndex; j++) + { + DrawAlternatePoint(pm->ctrl[i][j].xyz, 0); + } + } + else + { + for (j = pm->height-1; j > g_nPatchAxisIndex; j--) + { + DrawAlternatePoint(pm->ctrl[i][j].xyz, 0); + } + } + } + } + qglEnd(); + qglLineWidth(1.0); + } + } + } + else + { + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglColor3f(1, 0, 1); + qglBegin(GL_POINTS); + for (i = 0; i < pm->height; i++) + { + qglVertex3fv(pm->ctrl[g_nPatchAxisIndex][i].xyz); + } + qglEnd(); + } + else { + qglColor3f(1, 0, 1); + qglLineWidth(2.0); + qglBegin(GL_LINES); + for(i = 0; i < pm->height; i++) + { + DrawAlternatePoint(pm->ctrl[g_nPatchAxisIndex][i].xyz, 0); + } + qglEnd(); + qglLineWidth(1.0); + } + + if (g_nPatchBendState == BEND_SELECT_EDGE || g_nPatchBendState == BEND_BENDIT || g_nPatchBendState == BEND_SELECT_ORIGIN) + { + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglColor3f(0, 0, 1); + qglBegin(GL_POINTS); + for (i = 0; i < pm->height; i++) + { + if (g_nPatchBendState == BEND_SELECT_ORIGIN) + { + qglVertex3fv(pm->ctrl[g_nBendOriginIndex][i].xyz); + } + else + { + if (g_bPatchLowerEdge) + { + for (j = 0; j < g_nPatchAxisIndex; j++) + qglVertex3fv(pm->ctrl[j][i].xyz); + } + else + { + for (j = pm->width-1; j > g_nPatchAxisIndex; j--) + qglVertex3fv(pm->ctrl[j][i].xyz); + } + } + } + qglEnd(); + } + else { + qglColor3f(0, 0, 1); + qglLineWidth(2.0); + qglBegin(GL_LINES); + for(i = 0; i < pm->height; i++) + { + if(g_nPatchBendState == BEND_SELECT_ORIGIN) + { + DrawAlternatePoint(pm->ctrl[g_nBendOriginIndex][i].xyz, 0); + } + else + { + if(g_bPatchLowerEdge) + { + for(j = 0; j < g_nPatchAxisIndex; j++) + { + DrawAlternatePoint(pm->ctrl[j][i].xyz, 0); + } + } + else + { + for(j = pm->width-1; j > g_nPatchAxisIndex; j--) + { + DrawAlternatePoint(pm->ctrl[j][i].xyz, 0); + } + } + } + } + qglEnd(); + qglLineWidth(1.0); + } + } + } + } + else + { + //qglDisable(GL_TEXTURE_2D); // stops point colours being multiplied by texture colour.. + //draw CV lattice - could be made optional + //qglDisable( GL_CULL_FACE ); + // qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglEnable (GL_POLYGON_OFFSET_LINE); + if (g_PrefsDlg.m_bNoStipple == FALSE) + qglDisable (GL_LINE_STIPPLE); + qglLineWidth (1); + qglColor3f(1.0f, 0.75f, 0.0f); + for ( i = 0 ; i+1 < pm->width ; i++ ) + { + qglBegin(GL_QUAD_STRIP); + for ( j = 0 ; j < pm->height ; j++ ) + { + qglVertex3fv(pm->ctrl[i][j].xyz); + qglVertex3fv(pm->ctrl[i+1][j].xyz); + } + qglEnd(); + } + qglDisable (GL_POLYGON_OFFSET_LINE); + //if (g_PrefsDlg.m_bNoStipple == FALSE) + // qglEnable (GL_LINE_STIPPLE); + + // draw selection handles + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglPointSize(6); + qglBegin(GL_POINTS); + for ( i = 0 ; i < pm->width ; i++ ) + { + for ( j = 0 ; j < pm->height ; j++ ) + { + if (PointInMoveList(pm->ctrl[i][j].xyz) != -1) + { + bSelectedPoints[i][j] = true; + } + else + { + bSelectedPoints[i][j] = false; + if (i & 0x01 || j & 0x01) + qglColor3f(1, 0, 1); + else + qglColor3f(0, 1, 0); + + qglVertex3fv(pm->ctrl[i][j].xyz); + } + } + } + qglColor3f(0, 0, 1); + for ( i = 0 ; i < pm->width ; i++ ) + { + for ( j = 0 ; j < pm->height ; j++ ) + { + if (bSelectedPoints[i][j]) + qglVertex3fv(pm->ctrl[i][j].xyz); + } + } + qglEnd(); + } + else + { + qglLineWidth(2.0); + qglBegin(GL_LINES); + for(i = 0; i < pm->width; i++) + { + for(j = 0; j < pm->height; j++) + { + if(PointInMoveList(pm->ctrl[i][j].xyz) != -1) + { + bSelectedPoints[i][j] = true; + } + else + { + bSelectedPoints[i][j] = false; + if(i & 0x01 || j & 0x01) + qglColor3f(1, 0, 1); + else + qglColor3f(0, 1, 0); + + // draw verts + DrawAlternatePoint(pm->ctrl[i][j].xyz, 0); + } + } + } + qglColor3f(0, 0, 1); + for(i = 0; i < pm->width; i++) + { + for(j = 0; j < pm->height; j++) + { + if(bSelectedPoints[i][j]) + { + // draw verts + DrawAlternatePoint(pm->ctrl[i][j].xyz, 0); + } + } + } + qglEnd(); + qglLineWidth(1.0); + } + } + if (bOverlay) + { + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglPointSize(6); + qglBegin(GL_POINTS); + for ( i = 0 ; i < pm->width ; i++ ) + { + for ( j = 0 ; j < pm->height ; j++ ) + { + if (i & 0x01 || j & 0x01) + qglColor3f(1, 0, 1); + else + qglColor3f(0, 1, 0); + qglVertex3fv(pm->ctrl[i][j].xyz); + } + } + qglEnd(); + } + else + { + qglLineWidth(2.0); + qglBegin(GL_LINES); + for ( i = 0 ; i < pm->width ; i++ ) + { + for ( j = 0 ; j < pm->height ; j++ ) + { + if (i & 0x01 || j & 0x01) + qglColor3f(1, 0, 1); + else + qglColor3f(0, 1, 0); + // draw verts + DrawAlternatePoint(pm->ctrl[i][j].xyz, 0); + } + } + qglEnd(); + qglLineWidth(1.0); + } + } + //qglPopAttrib(); +} + +/* +================== +Patch_DrawXY +================== +*/ +void Patch_DrawXY(patchMesh_t *pm) +{ + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + + if (pm->bSelected) + { + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES]); + if (g_PrefsDlg.m_bNoStipple == FALSE) + qglEnable (GL_LINE_STIPPLE); + qglLineWidth (2); + } + + DrawPatchMesh(pm); + + if ( (pm->bSelected && (g_qeglobals.d_select_mode == sel_curvepoint + || g_qeglobals.d_select_mode == sel_area + || g_bPatchBendMode)) + || pm->bOverlay ) + DrawPatchControls(pm); +} + +/* +================== +Patch_DrawCam +================== +*/ +void Patch_DrawCam(patchMesh_t *pm) +{ + qglPushAttrib(GL_ALL_ATTRIB_BITS); // save the current state + + if (g_bPatchWireFrame) + { + qglDisable( GL_CULL_FACE ); + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglDisable(GL_TEXTURE_2D); + if (g_PrefsDlg.m_bGLLighting) + qglDisable(GL_LIGHTING); + + DrawPatchMesh(pm); + + //if (g_PrefsDlg.m_bGLLighting) + // qglEnable(GL_LIGHTING); + //qglEnable( GL_CULL_FACE ); + } + else + { + qglDisable(GL_CULL_FACE); + qglBindTexture (GL_TEXTURE_2D, pm->d_texture->texture_number); + qglPolygonMode (GL_FRONT, GL_FILL); + qglPolygonMode (GL_BACK, GL_LINE); + + if (pm->pShader->getTrans() < 1.0f) + { + qglEnable(GL_BLEND); + qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglColor4f(pm->d_texture->color[0], pm->d_texture->color[1], pm->d_texture->color[2], pm->pShader->getTrans()); + } + + DrawPatchMesh(pm); // both sides + } + + qglPopAttrib(); // restore saved state +} + +void ConvexHullForSection( float section[2][4][7] ) { +} + +void BrushesForSection( float section[2][4][7] ) { +} + +/* +================ +Patch_BuildPoints +================ +*/ +void Patch_BuildPoints (brush_t *b) +{ + face_t *f; + b->patchBrush = false; + for (f=b->brush_faces ; f ; f=f->next) + { + if (f->texdef.flags & SURF_PATCH) + { + b->patchBrush = true; + //vec3_t vMin, vMax; + //Patch_CalcBounds(&patchMeshes[b->nPatchID], vMin, vMax); + //VectorCopy(vMin, b->mins); + //VectorCopy(vMax, b->maxs); + break; + } + } +} + +/* +================== +Patch_Move +================== +*/ +void Patch_Move(patchMesh_t *pm, const vec3_t vMove, bool bRebuild) +{ + pm->bDirty = true; + for (int w = 0; w < pm->width; w++) + { + for (int h = 0; h < pm->height; h++) + { + VectorAdd(pm->ctrl[w][h].xyz, vMove, pm->ctrl[w][h].xyz); + } + } + // bRebuild is never true + if (bRebuild) + { + vec3_t vMin, vMax; + Patch_CalcBounds(pm, vMin, vMax); + //Brush_RebuildBrush(patchMeshes[n].pSymbiot, vMin, vMax); + } + UpdatePatchInspector(); + +} + +/* +================== +Patch_ApplyMatrix +================== +*/ +void Patch_ApplyMatrix(patchMesh_t *p, const vec3_t vOrigin, const vec3_t vMatrix[3], bool bSnap) +{ + vec3_t vTemp; + + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + if (((g_qeglobals.d_select_mode == sel_curvepoint && g_qeglobals.d_num_move_points != 0) || g_bPatchBendMode) + && PointInMoveList(p->ctrl[w][h].xyz) == -1) // snap selected points only, if selected + continue; + VectorSubtract (p->ctrl[w][h].xyz, vOrigin, vTemp); + for (int j = 0; j < 3; j++) + { + p->ctrl[w][h].xyz[j] = DotProduct(vTemp, vMatrix[j]) + vOrigin[j]; + if (bSnap) + { + p->ctrl[w][h].xyz[j] = floor(p->ctrl[w][h].xyz[j] + 0.5); + } + } + } + } + vec3_t vMin, vMax; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); +} + +/* +================== +Patch_EditPatch +================== +*/ +void Patch_EditPatch() +{ + //--patchMesh_t* p = &patchMeshes[n]; + g_qeglobals.d_numpoints = 0; + g_qeglobals.d_num_move_points = 0; + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t* p = pb->pPatch; + for ( int i = 0 ; i < p->width ; i++ ) + { + for ( int j = 0 ; j < p->height ; j++ ) + { + VectorCopy (p->ctrl[i][j].xyz, g_qeglobals.d_points[g_qeglobals.d_numpoints]); + if (g_qeglobals.d_numpoints < MAX_POINTS-1) + { + g_qeglobals.d_numpoints++; + } + } + } + } + } + g_qeglobals.d_select_mode = sel_curvepoint; + //--g_nSelectedPatch = n; +} + + + +/* +================== +Patch_Deselect +================== +*/ +//FIXME: need all sorts of asserts throughout a lot of this crap +void Patch_Deselect() +{ + //--g_nSelectedPatch = -1; + g_qeglobals.d_select_mode = sel_brush; + + for (brush_t *b = selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if (b->patchBrush) + { + b->pPatch->bSelected = false; + } + } + + //for (int i = 0; i < numPatchMeshes; i++) + // patchMeshes[i].bSelected = false; + + if (g_bPatchBendMode) + Patch_BendToggle(); +// if (g_bPatchInsertMode) +// Patch_InsDelToggle(); +} + + +/* +================== +Patch_Select +================== +*/ +void Patch_Select(patchMesh_t *p) +{ + // maintained for point manip.. which i need to fix as this + // is pf error prone + //--g_nSelectedPatch = n; + p->bSelected = true; +} + + +/* +================== +Patch_Deselect +================== +*/ +void Patch_Deselect(patchMesh_t *p) +{ + p->bSelected = false; +} + + +/* +================== +Patch_Delete +================== +*/ +extern BTNode_t *BTree_Delete(BTNode_t *pBT); +extern BTListList_t *BTree_DeleteListFromList(BTListList_t *pBTListList); + +void Patch_Delete(patchMesh_t *p) +{ + if (p->pSymbiot) // Hydra - added a check to prevent access violations. + { + p->pSymbiot->pPatch = NULL; + p->pSymbiot->patchBrush = false; + } + + // spog - free dynamically allocated memory used by LODs + int rowcount = ((MAX_PATCH_WIDTH-1)/2) * MAX_PATCH_HEIGHT; + int colcount = ((MAX_PATCH_HEIGHT-1)/2) * MAX_PATCH_WIDTH; + int i; + for (i=0; irowLOD[i] = BTree_Delete(p->rowLOD[i]); + for (i=0; icolLOD[i] = BTree_Delete(p->colLOD[i]); + + // delete display list associated with patch + if (p->nListID != -1) + qglDeleteLists (p->nListID, 1); // list#, number of lists + + // delete LOD drawLists + Patch_DeleteDrawLists(p); + + + free(p); + p = NULL; + + + UpdatePatchInspector(); +} + + +/* +================== +Patch_Scale +================== +*/ +void Patch_Scale(patchMesh_t *p, const vec3_t vOrigin, const vec3_t vAmt, bool bRebuild) +{ + + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + if (g_qeglobals.d_select_mode == sel_curvepoint && PointInMoveList(p->ctrl[w][h].xyz) == -1) + continue; + for (int i=0 ; i<3 ; i++) + { + p->ctrl[w][h].xyz[i] -= vOrigin[i]; + p->ctrl[w][h].xyz[i] *= vAmt[i]; + p->ctrl[w][h].xyz[i] += vOrigin[i]; + } + } + } + if (bRebuild) + { + vec3_t vMin, vMax; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); + } + UpdatePatchInspector(); +} + + +/* +================== +Patch_SetView +================== +*/ +void Patch_SetView(int n) +{ + g_bSameView = (n == g_nPatchClickedView); + g_nPatchClickedView = n; +} + + +/* +================== +Patch_SetTexture +================== +*/ +// FIXME: need array validation throughout +void Patch_SetTexture(patchMesh_t *p, texdef_t *tex_def, IPluginTexdef* pPlugTexdef) +{ + // NOTE: I don't know for sure if this happens + if (p->pShader) + p->pShader->DecRef(); + p->pShader = QERApp_Shader_ForName(tex_def->GetName()); + p->pShader->IncRef(); + p->d_texture = p->pShader->getTexture(); + + UpdatePatchInspector(); +} + + +/* +================== +Patch_DragScale +================== +*/ +bool Patch_DragScale(patchMesh_t *p, vec3_t vAmt, vec3_t vMove) +{ + vec3_t vMin, vMax, vScale, vTemp, vMid; + int i; + + Patch_CalcBounds(p, vMin, vMax); + + VectorSubtract(vMax, vMin, vTemp); + + // if we are scaling in the same dimension the patch has no depth + for (i = 0; i < 3; i ++) + { + if (vTemp[i] == 0 && vMove[i] != 0) + { + //Patch_Move(n, vMove, true); + return false; + } + } + + for (i=0 ; i<3 ; i++) + vMid[i] = (vMin[i] + ((vMax[i] - vMin[i]) / 2)); + + for (i = 0; i < 3; i++) + { + if (vAmt[i] != 0) + { + vScale[i] = 1.0 + vAmt[i] / vTemp[i]; + } + else + { + vScale[i] = 1.0; + } + } + + Patch_Scale(p, vMid, vScale, false); + + VectorSubtract(vMax, vMin, vTemp); + + Patch_CalcBounds(p, vMin, vMax); + + VectorSubtract(vMax, vMin, vMid); + + VectorSubtract(vMid, vTemp, vTemp); + + VectorScale(vTemp, 0.5, vTemp); + + // abs of both should always be equal + if (!VectorCompare(vMove, vAmt)) + { + for (i = 0; i < 3; i++) + { + if (vMove[i] != vAmt[i]) + vTemp[i] = -(vTemp[i]); + } + } + + Patch_Move(p, vTemp); + return true; +} + +/* +================== +Patch_InsertColumn +================== +*/ +void Patch_InsertColumn(patchMesh_t *p, bool bAdd) +{ + int w, h, i, width; + vec3_t vTemp; + float stTemp[2]; + + if (p->width + 2 >= MAX_PATCH_WIDTH) + return; + + // check for selected column points + for (h = 0; h < p->height; h++) + { + for (w = 1; w < p->width; w+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (w < p->width) + break; + for (w = 0; w < p->width; w+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (w < p->width) + break; + } + + if (w >= p->width) + { + if (bAdd) w=p->width-1; + else w=2; + } + else if (w==0) w=2; + else if (w%2) w++; + + // add columns at w + for (h = 0; h < p->height; h++) + { + for (width = p->width-1; width > w; width--) + memcpy(&p->ctrl[width+2][h],&p->ctrl[width][h], sizeof(drawVert_t)); + + // set two new column points + memcpy(&p->ctrl[w+2][h],&p->ctrl[w][h], sizeof(drawVert_t)); + memcpy(&p->ctrl[w+1][h],&p->ctrl[w-1][h], sizeof(drawVert_t)); + + for (i=0; i<3; i++) // xyz + { + vTemp[i] = p->ctrl[w][h].xyz[i] - p->ctrl[w-1][h].xyz[i]; + p->ctrl[w+1][h].xyz[i] = p->ctrl[w+1][h].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w-2][h].xyz[i] - p->ctrl[w-1][h].xyz[i]; + p->ctrl[w-1][h].xyz[i] = p->ctrl[w-1][h].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w+1][h].xyz[i] - p->ctrl[w-1][h].xyz[i]; + p->ctrl[w][h].xyz[i] = p->ctrl[w-1][h].xyz[i] + (vTemp[i] / 2); + } + for (i=0; i<2; i++) // st + { + stTemp[i] = p->ctrl[w][h].st[i] - p->ctrl[w-1][h].st[i]; + p->ctrl[w+1][h].st[i] = p->ctrl[w+1][h].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w-2][h].st[i] - p->ctrl[w-1][h].st[i]; + p->ctrl[w-1][h].st[i] = p->ctrl[w-1][h].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w+1][h].st[i] - p->ctrl[w-1][h].st[i]; + p->ctrl[w][h].st[i] = p->ctrl[w-1][h].st[i] + (stTemp[i] / 2); + } + } + + p->width += 2; + // deselect all points to keep things neat + if (g_qeglobals.d_select_mode == sel_curvepoint) + Patch_EditPatch(); + + UpdatePatchInspector(); +} + +/* +================== +Patch_InsertRow +================== +*/ + +void Patch_InsertRow(patchMesh_t *p, bool bAdd) +{ + int h, w, i, height; + vec3_t vTemp; + float stTemp[2]; + + if (p->height + 2 >= MAX_PATCH_HEIGHT) + return; + + // check for selected row points + for (w = 0; w < p->width; w++) + { + for (h = 1; h < p->height; h+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (h < p->height) + break; + for (h = 0; h < p->height; h+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (h < p->height) + break; + } + if (h >= p->height) + { + if (bAdd) h=p->height-1; + else h=2; + } + else if (h==0) h=2; + else if (h%2) h++; + + // add rows at h + for (w = 0; w < p->width; w++) + { + for (height = p->height-1; height > h; height--) + memcpy(&p->ctrl[w][height+2],&p->ctrl[w][height], sizeof(drawVert_t)); + + // set two new row points + memcpy(&p->ctrl[w][h+2],&p->ctrl[w][h], sizeof(drawVert_t)); + memcpy(&p->ctrl[w][h+1],&p->ctrl[w][h-1], sizeof(drawVert_t)); + + for (i=0; i<3; i++) // xyz + { + vTemp[i] = p->ctrl[w][h].xyz[i] - p->ctrl[w][h-1].xyz[i]; + p->ctrl[w][h+1].xyz[i] = p->ctrl[w][h+1].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w][h-2].xyz[i] - p->ctrl[w][h-1].xyz[i]; + p->ctrl[w][h-1].xyz[i] = p->ctrl[w][h-1].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w][h+1].xyz[i] - p->ctrl[w][h-1].xyz[i]; + p->ctrl[w][h].xyz[i] = p->ctrl[w][h-1].xyz[i] + (vTemp[i] / 2); + } + for (i=0; i<2; i++) // st + { + stTemp[i] = p->ctrl[w][h].st[i] - p->ctrl[w][h-1].st[i]; + p->ctrl[w][h+1].st[i] = p->ctrl[w][h+1].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w][h-2].st[i] - p->ctrl[w][h-1].st[i]; + p->ctrl[w][h-1].st[i] = p->ctrl[w][h-1].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w][h+1].st[i] - p->ctrl[w][h-1].st[i]; + p->ctrl[w][h].st[i] = p->ctrl[w][h-1].st[i] + (stTemp[i] / 2); + } + } + + p->height += 2; + // deselect all points to keep things neat + if (g_qeglobals.d_select_mode == sel_curvepoint) + Patch_EditPatch(); + + UpdatePatchInspector(); +} + +/* +================== +Patch_RemoveRow +================== +*/ +void Patch_RemoveRow(patchMesh_t *p, bool bFirst) +{ + int w, h, i, height; + vec3_t vTemp; + float stTemp[2]; + bool bExtrapolate = true; + + if (p->height <= MIN_PATCH_HEIGHT) + return; + + for (w = 0; w < p->width; w++) + { + for (h = 0; h < p->height; h+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (h < p->height) + break; + for (h = 1; h < p->height; h+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (h < p->height) + break; + } + + if (h >= p->height) + { + bExtrapolate = false; + if (bFirst) h=p->height-3; + else h=2; + } + else if (h <= 0) h=2; + else if (h > p->height-3) h = p->height-3; + else if (h%2) h++; + + p->height -= 2; + + for (w = 0; w < p->width; w++) + { + if (bExtrapolate) + { + for (i = 0; i < 3; i++) // xyz + { + vTemp[i] = p->ctrl[w][h+2].xyz[i] - p->ctrl[w][h-2].xyz[i]; + p->ctrl[w][h-1].xyz[i] = p->ctrl[w][h-2].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w][h].xyz[i] - p->ctrl[w][h-1].xyz[i]; + p->ctrl[w][h-1].xyz[i] = p->ctrl[w][h-1].xyz[i] + (vTemp[i] * 2); + } + + for (i = 0; i < 2; i++) // st + { + stTemp[i] = p->ctrl[w][h+2].st[i] - p->ctrl[w][h-2].st[i]; + p->ctrl[w][h-1].st[i] = p->ctrl[w][h-2].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w][h].st[i] - p->ctrl[w][h-1].st[i]; + p->ctrl[w][h-1].st[i] = p->ctrl[w][h-1].st[i] + (stTemp[i] * 2); + } + } + else + { + if (!bFirst) + continue; + else h=0; + } + for (height = h; height < p->height; height++) + memcpy(&p->ctrl[w][height], &p->ctrl[w][height+2], sizeof(drawVert_t)); + } + // deselect all points to keep things neat + if (g_qeglobals.d_select_mode == sel_curvepoint) + Patch_EditPatch(); + + UpdatePatchInspector(); +} + +/* +================== +Patch_RemoveColumn +================== +*/ +void Patch_RemoveColumn(patchMesh_t *p, bool bFirst) +{ + int w, h, i, width; + vec3_t vTemp; + float stTemp[2]; + bool bExtrapolate = true; + + if (p->width <= MIN_PATCH_WIDTH) + return; + + for (h = 0; h < p->height; h++) + { + for (w = 0; w < p->width; w+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (w < p->width) + break; + for (w = 1; w < p->width; w+=2) + if (PointInMoveList(p->ctrl[w][h].xyz) != -1) + break; + if (w < p->width) + break; + } + + if (w >= p->width) + { + bExtrapolate = false; + if (bFirst) w=p->width-3; + else w=2; + } + else if (w<=0) w=2; + else if (w > p->width-3) w = p->width-3; + else if (w%2) w++; + + p->width -= 2; + + for (h = 0; h < p->height; h++) + { + if (bExtrapolate) + { + for (i = 0; i < 3; i++) // xyz + { + vTemp[i] = p->ctrl[w+2][h].xyz[i] - p->ctrl[w-2][h].xyz[i]; + p->ctrl[w-1][h].xyz[i] = p->ctrl[w-2][h].xyz[i] + (vTemp[i] / 2); + + vTemp[i] = p->ctrl[w][h].xyz[i] - p->ctrl[w-1][h].xyz[i]; + p->ctrl[w-1][h].xyz[i] = p->ctrl[w-1][h].xyz[i] + (vTemp[i] * 2); + } + + for (i = 0; i < 2; i++) // st + { + stTemp[i] = p->ctrl[w+2][h].st[i] - p->ctrl[w-2][h].st[i]; + p->ctrl[w-1][h].st[i] = p->ctrl[w-2][h].st[i] + (stTemp[i] / 2); + + stTemp[i] = p->ctrl[w][h].st[i] - p->ctrl[w-1][h].st[i]; + p->ctrl[w-1][h].st[i] = p->ctrl[w-1][h].st[i] + (stTemp[i] * 2); + } + } + else + { + if (!bFirst) + continue; + else w=0; + } + + for (width = w; width < p->width; width++) + memcpy(&p->ctrl[width][h], &p->ctrl[width+2][h], sizeof(drawVert_t)); + } + // deselect all points to keep things neat + if (g_qeglobals.d_select_mode == sel_curvepoint) + Patch_EditPatch(); + + UpdatePatchInspector(); +} + +/* +================== +Patch_AdjustColumns +================== +*/ +/* +void Patch_AdjustColumns(patchMesh_t *p, int nCols) +{ + vec3_t vTemp, vTemp2; + int i, w, h; + + if (nCols & 0x01 || p->width + nCols < 3 || p->width + nCols > MAX_PATCH_WIDTH) + return; + + // add in column adjustment + p->width += nCols; + + for (h = 0; h < p->height; h++) + { + // for each column, we need to evenly disperse p->width number + // of points across the old bounds + + // calc total distance to interpolate + VectorSubtract(p->ctrl[p->width - 1 - nCols][h].xyz, p->ctrl[0][h].xyz, vTemp); + + // amount per cycle + for (i = 0; i < 3; i ++) + { + vTemp2[i] = vTemp[i] / (p->width - 1); + } + + // move along + for (w = 0; w < p->width-1; w++) + { + VectorAdd(p->ctrl[w][h].xyz, vTemp2, p->ctrl[w+1][h].xyz); + } + + } + for ( w = 0 ; w < p->width ; w++ ) + { + for ( h = 0 ; h < p->height ; h++ ) + { + p->ctrl[w][h].st[0] = 4 * (float)w / (p->width - 1); + p->ctrl[w][h].st[1] = 4 * (float)h / (p->height - 1); + } + } + UpdatePatchInspector(); +} +*/ + +/* +================== +Patch_AdjustRows +================== +*/ +/* +void Patch_AdjustRows(patchMesh_t *p, int nRows) +{ + vec3_t vTemp, vTemp2; + int i, w, h; + + if (nRows & 0x01 || p->height + nRows < 3 || p->height + nRows > MAX_PATCH_HEIGHT) + return; + + // add in column adjustment + p->height += nRows; + + for (w = 0; w < p->width; w++) + { + // for each row, we need to evenly disperse p->height number + // of points across the old bounds + + // calc total distance to interpolate + VectorSubtract(p->ctrl[w][p->height - 1 - nRows].xyz, p->ctrl[w][0].xyz, vTemp); + + //vTemp[0] = vTemp[1] = vTemp[2] = 0; + //for (h = 0; h < p->height - nRows; h ++) + //{ + // VectorAdd(vTemp, p->ctrl[w][h], vTemp); + //} + + // amount per cycle + for (i = 0; i < 3; i ++) + { + vTemp2[i] = vTemp[i] / (p->height - 1); + } + + // move along + for (h = 0; h < p->height-1; h++) + { + VectorAdd(p->ctrl[w][h].xyz, vTemp2, p->ctrl[w][h+1].xyz); + } + + } + for ( w = 0 ; w < p->width ; w++ ) + { + for ( h = 0 ; h < p->height ; h++ ) + { + p->ctrl[w][h].st[0] = 4 * (float)w / (p->width - 1); + p->ctrl[w][h].st[1] = 4 * (float)h / (p->height - 1); + } + } + UpdatePatchInspector(); +} +*/ + +/* +================== +Patch_DisperseRows +================== +*/ + +void Patch_DisperseRows() +{ + vec3_t vTemp, vTemp2; + int i, w, h; + + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + Patch_Rebuild(p); + for (w = 0; w < p->width; w++) + { + // for each row, we need to evenly disperse p->height number + // of points across the old bounds + + // calc total distance to interpolate + VectorSubtract(p->ctrl[w][p->height - 1].xyz, p->ctrl[w][0].xyz, vTemp); + + //vTemp[0] = vTemp[1] = vTemp[2] = 0; + //for (h = 0; h < p->height - nRows; h ++) + //{ + // VectorAdd(vTemp, p->ctrl[w][h], vTemp); + //} + + // amount per cycle + for (i = 0; i < 3; i ++) + { + vTemp2[i] = vTemp[i] / (p->height - 1); + } + + // move along + for (h = 0; h < p->height-1; h++) + { + VectorAdd(p->ctrl[w][h].xyz, vTemp2, p->ctrl[w][h+1].xyz); + } + Patch_Naturalize(p); + + } + } + } + UpdatePatchInspector(); +} + +/* +================== +Patch_DisperseIntermediateRows +================== +*/ + +void Patch_DisperseIntermediateRows() +{ + vec3_t vTemp, vTemp2; + int i, w, h; + + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + Patch_Rebuild(p); + for (w = 0; w < p->width; w++) + { + // move along + for (h = 0; h < p->height; h+=2) + { + // calc distance to interpolate + VectorSubtract(p->ctrl[w][h+2].xyz, p->ctrl[w][h].xyz, vTemp); + + // halve distance + for (i = 0; i < 3; i ++) + { + vTemp2[i] = vTemp[i] / 2; + } + + // move control points + VectorAdd(p->ctrl[w][h].xyz, vTemp2, p->ctrl[w][h+1].xyz); + } + } + } + } + UpdatePatchInspector(); +} + +/* +================== +Patch_DisperseIntermediateColumns +================== +*/ +void Patch_DisperseIntermediateColumns() +{ + vec3_t vTemp, vTemp2; + int i, w, h; + + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + Patch_Rebuild(p); + for (h = 0; h < p->height; h++) + { + // move along + for (w = 0; w < p->width; w+=2) + { + // calc distance to interpolate + VectorSubtract(p->ctrl[w+2][h].xyz, p->ctrl[w][h].xyz, vTemp); + + // halve distance + for (i = 0; i < 3; i ++) + { + vTemp2[i] = vTemp[i] / 2; + } + + // move control points + VectorAdd(p->ctrl[w][h].xyz, vTemp2, p->ctrl[w+1][h].xyz); + } + } + } + } + UpdatePatchInspector(); +} + + + +/* +================== +Patch_AdjustSelected +================== +*/ +void Patch_AdjustSelected(bool bInsert, bool bColumn, bool bFlag) +{ + bool bUpdate = false; + for (brush_t* pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + if (bInsert) + { + if (bColumn) + { + Patch_InsertColumn(pb->pPatch, bFlag); + } + else + { + Patch_InsertRow(pb->pPatch, bFlag); + } + } + else + { + if (bColumn) + { + Patch_RemoveColumn(pb->pPatch, bFlag); + } + else + { + Patch_RemoveRow(pb->pPatch, bFlag); + } + } + bUpdate = true; + vec3_t vMin, vMax; + patchMesh_t *p = pb->pPatch; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); + pb->pPatch->bDirty = true; // rebuild LOD trees and their normals + } + } + if (bUpdate) + { + Sys_UpdateWindows(W_ALL); + } +} + + +/* +================== +Patch_AdjustSelectedRowCols +================== +*/ +/* +void Patch_AdjustSelectedRowCols(int nRows, int nCols) +{ + for (brush_t* pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + Patch_InsertColumn(pb->pPatch, false); + if (nRows != 0) + { + Patch_AdjustRows(pb->pPatch, nRows); + } + + if (nCols != 0) + { + Patch_AdjustColumns(pb->pPatch, nCols); + } + } + } + UpdatePatchInspector(); +} +*/ + +/* +================= +CheckName +temporary stuff, detect potential problems when saving the texture name +will correct the patch on the fly if problem detected +================= +*/ +/*! +\todo performance issue with CheckName calls +don't call this too much, only when absolutely necessary +strategies that call here too much are known to be slow +patch 84 to bug 253 adds an additionnal check for textures/ +*/ +void CheckName( patchMesh_t *p, char *pname ) +{ + if(strncmp(p->pShader->getName(), "textures/", 9) != 0) + p->pShader = QERApp_Shader_ForName(SHADER_NOT_FOUND); + + // some manage to get long filename textures (with spaces) in their maps + if (strchr( p->pShader->getName(), ' ' )) + { + char Msg1[1024]; + sprintf( Msg1, "Can't save texture with spaces in name. Rename %s\nNOTE: This message may popup several times .. once for each buggy face detected.", p->pShader->getName() ); + Sys_Printf("%s\n", Msg1 ); + gtk_MessageBox(g_pParentWnd->m_pWidget, Msg1, "Error saving map", MB_OK ); + strcpy( pname, SHADER_NOT_FOUND ); + p->pShader = QERApp_Shader_ForName(SHADER_NOT_FOUND); + p->d_texture = p->pShader->getTexture(); + return; + } + strcpy( pname, p->pShader->getName()+9 ); // remove "textures/" +} + +/* +================== +Patch_Write +================== +*/ +void Patch_Write (patchMesh_t *p, MemStream *file) +{ + char pname[1024]; + + MemFile_fprintf(file, " {\n patchDef2\n {\n"); + + CheckName( p, pname ); + MemFile_fprintf(file, " %s\n", pname ); + MemFile_fprintf(file, " ( %i %i %i %i %i ) \n", p->width, p->height, p->contents, p->flags, p->value); + + + float ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT][5]; + + int w, h; + for (w = 0; w < p->width; w++) + { + for (h = 0; h < p->height; h++) + { + ctrl[w][h][0] = p->ctrl[w][h].xyz[0]; + ctrl[w][h][1] = p->ctrl[w][h].xyz[1]; + ctrl[w][h][2] = p->ctrl[w][h].xyz[2]; + ctrl[w][h][3] = p->ctrl[w][h].st[0]; + ctrl[w][h][4] = p->ctrl[w][h].st[1]; + } + } + + _Write3DMatrix(file, p->width, p->height, 5, reinterpret_cast(&ctrl)); + + if (g_qeglobals.m_bBrushPrimitMode) + { + if (p->epairs) + { + for (epair_t *ep = p->epairs ; ep ; ep=ep->next) + { + MemFile_fprintf (file, "\"%s\" \"%s\"\n", ep->key, ep->value); + } + } + } + + MemFile_fprintf(file, " }\n }\n"); +} + +void Patch_Write (patchMesh_t *p, FILE *file) +{ + char pname[1024]; + + fprintf(file, " {\n patchDef2\n {\n"); + { + CheckName( p, pname ); + fprintf(file, " %s\n", pname ); + fprintf(file, " ( %i %i %i %i %i ) \n", p->width, p->height, p->contents, p->flags, p->value); + } + + float ctrl[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT][5]; + + int w, h; + for (w = 0; w < p->width; w++) + { + for (h = 0; h < p->height; h++) + { + ctrl[w][h][0] = p->ctrl[w][h].xyz[0]; + ctrl[w][h][1] = p->ctrl[w][h].xyz[1]; + ctrl[w][h][2] = p->ctrl[w][h].xyz[2]; + ctrl[w][h][3] = p->ctrl[w][h].st[0]; + ctrl[w][h][4] = p->ctrl[w][h].st[1]; + } + } + + _Write3DMatrix(file, p->width, p->height, 5, reinterpret_cast(&ctrl)); + + if (g_qeglobals.m_bBrushPrimitMode) + { + if (p->epairs) + { + for (epair_t *ep = p->epairs ; ep ; ep=ep->next) + { + fprintf (file, "\"%s\" \"%s\"\n", ep->key, ep->value); + } + } + } + + fprintf(file, " }\n }\n"); +} + + +/* +================== +Patch_RotateTexture +================== +*/ +void Patch_RotateTexture(patchMesh_t *p, float fAngle) +{ + p->bDirty = true; + float c = cos(fAngle * Q_PI / 180); + float s = sin(fAngle * Q_PI / 180); + + Patch_TransformLODTexture(p, c, s, ROTATE); + + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + //if (g_qeglobals.d_select_mode == sel_curvepoint && PointInMoveList(p->ctrl[w][h].xyz) == -1) + // continue; + + float x = p->ctrl[w][h].st[0]; + float y = p->ctrl[w][h].st[1]; + p->ctrl[w][h].st[0] = x * c - y * s; + p->ctrl[w][h].st[1] = y * c + x * s; + } + } +} + + +/* +================== +Patch_ScaleTexture +================== +*/ +void Patch_ScaleTexture(patchMesh_t *p, float fx, float fy, bool bFixup) +{ + // FIXME: + // this hack turns scales into 1.1 or 0.9 + if (bFixup) + { + fx = (fx == 0) ? 1.0 : (fx > 0) ? 0.9 : 1.10; + fy = (fy == 0) ? 1.0 : (fy > 0) ? 0.9 : 1.10; + } + else + { + if (fx == 0) + fx = 1.0; + if (fy == 0) + fy = 1.0; + } + + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + if (g_qeglobals.d_select_mode == sel_curvepoint && PointInMoveList(p->ctrl[w][h].xyz) == -1) + continue; + + p->ctrl[w][h].st[0] *= fx; + p->ctrl[w][h].st[1] *= fy; + } + } + if (g_qeglobals.d_select_mode == sel_curvepoint) + { + p->bDirty = true; + Patch_LODMatchAll(); + } + else + { + Patch_TransformLODTexture(p, fx, fy, SCALE); + p->LODUpdated = true; + } +} + + +/* +================== +Patch_ShiftTexture +shift a texture given a pixel count +================== +*/ +void Patch_ShiftTexture(patchMesh_t *p, float fx, float fy) +{ + qtexture_t *pTex; + pTex = p->pShader->getTexture(); + fx = -1 * fx / pTex->width; + fy = fy / pTex->height; + Patch_ShiftTextureST(p, fx, fy); +} + +/* +==================== +Patch_ShiftTextureST +shift a patch texture given an ST increment +==================== +*/ +void Patch_ShiftTextureST(patchMesh_t *p, float fx, float fy) +{ +#ifdef _DEBUG + // NOTE: when called by Patch_ShiftTexture this warning may be bogus + if ((ABS(fx) >= 1) || (ABS(fy) >= 1)) + Sys_Printf("WARNING: increments exceed 1 in Patch_ShiftTextureST\n"); +#endif + for (int w = 0; w < p->width; w++) + { + for (int h = 0; h < p->height; h++) + { + if (g_qeglobals.d_select_mode == sel_curvepoint && PointInMoveList(p->ctrl[w][h].xyz) == -1) + continue; + + p->ctrl[w][h].st[0] += fx; + p->ctrl[w][h].st[1] += fy; + } + } + if (g_qeglobals.d_select_mode == sel_curvepoint) + { + p->bDirty = true; + Patch_LODMatchAll(); + } + else + { + Patch_TransformLODTexture(p, fx, fy, TRANSLATE); + p->LODUpdated = true; + } +} + +/* +================== +Patch_ToggleInverted +================== +*/ +void Patch_ToggleInverted() +{ + bool bUpdate = false; + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + bUpdate = true; + patchInvert(pb->pPatch); + } + } + + if (bUpdate) + { + Sys_UpdateWindows(W_ALL); + } + UpdatePatchInspector(); +} + +/* +================== +Patch_ToggleInverted +================== +*/ +void Patch_InvertTexture(bool bY) +{ + bool bUpdate = false; + + float fTemp[2]; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + bUpdate = true; + patchMesh_t *p = pb->pPatch; + p->bDirty = true; + if (bY) + { + for ( int i = 0 ; i < p->height ; i++ ) + { + for (int j = 0; j < p->width / 2; j++) + { + memcpy(fTemp, &p->ctrl[p->width - 1- j][i].st[0], sizeof (float[2])); + memcpy(&p->ctrl[p->width - 1- j][i].st[0], &p->ctrl[j][i].st[0], sizeof(float[2])); + memcpy(&p->ctrl[j][i].st[0], fTemp, sizeof(float[2])); + } + } + } + else + { + for ( int i = 0 ; i < p->width ; i++ ) + { + for (int j = 0; j < p->height / 2; j++) + { + memcpy(fTemp, &p->ctrl[i][p->height - 1- j].st[0], sizeof (float[2])); + memcpy(&p->ctrl[i][p->height - 1 - j].st[0], &p->ctrl[i][j].st[0], sizeof(float[2])); + memcpy(&p->ctrl[i][j].st[0], fTemp, sizeof(float[2])); + } + } + } + } + } + + if (bUpdate) + { + Sys_UpdateWindows(W_ALL); + } + UpdatePatchInspector(); +} + + + + +/* +================== +Patch_Save +================== + Saves patch ctrl info (originally to deal with a + cancel in the surface dialog +*/ +void Patch_Save(patchMesh_t *p) +{ + patchSave.width = p->width; + patchSave.height = p->height; + memcpy(patchSave.ctrl, p->ctrl, sizeof(p->ctrl)); +} + + +/* +================== +Patch_Restore +================== +*/ +void Patch_Restore(patchMesh_t *p) +{ + p->width = patchSave.width; + p->height = patchSave.height; + memcpy(p->ctrl, patchSave.ctrl, sizeof(p->ctrl)); +} + +void Patch_ResetTexturing(float fx, float fy) +{ + for (brush_t* pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + p->bDirty = true; + for ( int i = 0 ; i < p->width ; i++ ) + { + for ( int j = 0 ; j < p->height ; j++ ) + { + p->ctrl[i][j].st[0] = fx * (float)i / (p->width - 1); + p->ctrl[i][j].st[1] = 1 - fy * (float)j / (p->height - 1); + } + } + } + } +} + +// NOTE TTimo stub! +void Patch_FitTexturing() +{ + Patch_ResetTexturing(1.0f, 1.0f); +} + +void Patch_SetTextureInfo(texdef_t *pt) +{ + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + if (pt->rotate) + Patch_RotateTexture(pb->pPatch, pt->rotate); + + if (pt->shift[0] || pt->shift[1]) + Patch_ShiftTexture(pb->pPatch, pt->shift[0], pt->shift[1]); + + if (pt->scale[0] || pt->scale[1]) + Patch_ScaleTexture(pb->pPatch, pt->scale[0], pt->scale[1], false); + + patchMesh_t *p = pb->pPatch; + p->contents = pt->contents; + p->flags = pt->flags; + p->value = pt->value; + } + } +} + +bool OnlyPatchesSelected() +{ + if (g_ptrSelectedFaces.GetSize() > 0 || selected_brushes.next == &selected_brushes) + return false; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (!pb->patchBrush) + { + return false; + } + } + return true; +} + +bool AnyPatchesSelected() +{ + if (g_ptrSelectedFaces.GetSize() > 0 || selected_brushes.next == &selected_brushes) + return false; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + return true; + } + } + return false; +} + +patchMesh_t* SinglePatchSelected() +{ + if (selected_brushes.next->patchBrush) + { + return selected_brushes.next->pPatch; + } + return NULL; +} + +void Patch_BendToggle() +{ + if (g_bPatchBendMode) + { + g_bPatchBendMode = false; + HideInfoDialog(); + g_pParentWnd->UpdatePatchToolbarButtons() ; + return; + } + + brush_t* b = selected_brushes.next; + + if (!QE_SingleBrush(true) || !b->patchBrush) + { + Sys_Printf("Patch_BendToggle: you must have a single patch selected\n"); + return; + } + + Patch_Save(b->pPatch); + g_bPatchBendMode = true; + g_nPatchBendState = BEND_SELECT_ROTATION; + g_bPatchAxisOnRow = true; + g_nPatchAxisIndex = 1; + ShowInfoDialog(g_pBendStateMsg[BEND_SELECT_ROTATION]); +} + +void Patch_BendHandleTAB() +{ + if (!g_bPatchBendMode) + { + return; + } + + brush_t* b = selected_brushes.next; + if (!QE_SingleBrush() || !b->patchBrush) + { + Patch_BendToggle(); + Sys_Printf("No patch to bend!"); + return; + } + + patchMesh_t *p = b->pPatch; + + bool bShift = Sys_ShiftDown (); + + if (g_nPatchBendState == BEND_SELECT_ROTATION) + { + // only able to deal with odd numbered rows/cols + g_nPatchAxisIndex += (bShift) ? -2 : 2; + if (g_bPatchAxisOnRow) + { + if ((bShift) ? g_nPatchAxisIndex <= 0 : g_nPatchAxisIndex >= p->height) + { + g_bPatchAxisOnRow = false; + g_nPatchAxisIndex = (bShift) ? p->width-1 : 1; + } + } + else + { + if ((bShift) ? g_nPatchAxisIndex <= 0 : g_nPatchAxisIndex >= p->width) + { + g_bPatchAxisOnRow = true; + g_nPatchAxisIndex = (bShift) ? p->height-1 : 1; + } + } + } + else + if (g_nPatchBendState == BEND_SELECT_ORIGIN) + { + g_nBendOriginIndex += (bShift) ? -1 : 1; + if (g_bPatchAxisOnRow) + { + if (bShift) + { + if (g_nBendOriginIndex < 0) + g_nBendOriginIndex = p->width-1; + } + else + { + if (g_nBendOriginIndex > p->width-1) + g_nBendOriginIndex = 0; + } + VectorCopy(p->ctrl[g_nBendOriginIndex][g_nPatchAxisIndex].xyz, g_vBendOrigin); + } + else + { + if (bShift) + { + if (g_nBendOriginIndex < 0) + g_nBendOriginIndex = p->height-1; + } + else + { + if (g_nBendOriginIndex > p->height-1) + g_nBendOriginIndex = 0; + } + VectorCopy(p->ctrl[g_nPatchAxisIndex][g_nBendOriginIndex].xyz, g_vBendOrigin); + } + } + else + if (g_nPatchBendState == BEND_SELECT_EDGE) + { + g_bPatchLowerEdge ^= 1; + } + Sys_UpdateWindows(W_ALL); +} + +void Patch_BendHandleENTER() +{ + if (!g_bPatchBendMode) + { + return; + } + + if (g_nPatchBendState < BEND_BENDIT) + { + g_nPatchBendState++; + ShowInfoDialog(g_pBendStateMsg[g_nPatchBendState]); + if (g_nPatchBendState == BEND_SELECT_ORIGIN) + { + g_vBendOrigin[0] = g_vBendOrigin[1] = g_vBendOrigin[2] = 0; + g_nBendOriginIndex = 0; + Patch_BendHandleTAB(); + } + else + if (g_nPatchBendState == BEND_SELECT_EDGE) + { + g_bPatchLowerEdge = true; + } + else + if (g_nPatchBendState == BEND_BENDIT) + { + // basically we go into rotation mode, set the axis to the center of the + } + } + else + { + // done + Patch_BendToggle(); + } + Sys_UpdateWindows(W_ALL); + +} + + +void Patch_BendHandleESC() +{ + if (!g_bPatchBendMode) + { + return; + } + Patch_BendToggle(); + brush_t* b = selected_brushes.next; + if (QE_SingleBrush() && b->patchBrush) + { + Patch_Restore(b->pPatch); + } + Sys_UpdateWindows(W_ALL); +} + +void Patch_SetBendRotateOrigin(patchMesh_t *p) +{ +#if 1 + int nType = g_pParentWnd->ActiveXY()->GetViewType(); + int nDim3 = (nType == XY) ? 2 : (nType == YZ) ? 0 : 1; + + g_vBendOrigin[nDim3] = 0; + VectorCopy(g_vBendOrigin, g_pParentWnd->ActiveXY()->RotateOrigin()); + return; +#else + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + + float fxLo, fyLo, fxHi, fyHi; + fxLo = fyLo = 9999; + fxHi = fyHi = -9999; + + if (g_bPatchAxisOnRow) + { + for (int i = 0; i < p->width; i++) + { + if (p->ctrl[i][g_nPatchAxisIndex].xyz[nDim1] < fxLo) + fxLo = p->ctrl[i][g_nPatchAxisIndex].xyz[nDim1]; + + if (p->ctrl[i][g_nPatchAxisIndex].xyz[nDim1] > fxHi) + fxHi = p->ctrl[i][g_nPatchAxisIndex].xyz[nDim1]; + + if (p->ctrl[i][g_nPatchAxisIndex].xyz[nDim2] < fyLo) + fyLo = p->ctrl[i][g_nPatchAxisIndex].xyz[nDim2]; + + if (p->ctrl[i][g_nPatchAxisIndex].xyz[nDim2] > fyHi) + fyHi = p->ctrl[i][g_nPatchAxisIndex].xyz[nDim2]; + } + } + else + { + for (int i = 0; i < p->height; i++) + { + if (p->ctrl[g_nPatchAxisIndex][i].xyz[nDim1] < fxLo) + fxLo = p->ctrl[g_nPatchAxisIndex][i].xyz[nDim1]; + + if (p->ctrl[g_nPatchAxisIndex][i].xyz[nDim1] > fxHi) + fxHi = p->ctrl[g_nPatchAxisIndex][i].xyz[nDim1]; + + if (p->ctrl[g_nPatchAxisIndex][i].xyz[nDim2] < fyLo) + fyLo = p->ctrl[g_nPatchAxisIndex][i].xyz[nDim2]; + + if (p->ctrl[g_nPatchAxisIndex][i].xyz[nDim2] > fyHi) + fyHi = p->ctrl[g_nPatchAxisIndex][i].xyz[nDim2]; + } + } + + g_pParentWnd->ActiveXY()->RotateOrigin()[0] = g_pParentWnd->ActiveXY()->RotateOrigin()[1] = g_pParentWnd->ActiveXY()->RotateOrigin()[2] = 0.0; + g_pParentWnd->ActiveXY()->RotateOrigin()[nDim1] = (fxLo + fxHi) * 0.5; + g_pParentWnd->ActiveXY()->RotateOrigin()[nDim2] = (fyLo + fyHi) * 0.5; +#endif +} + +// also sets the rotational origin +void Patch_SelectBendAxis() +{ + brush_t* b = selected_brushes.next; + if (!QE_SingleBrush() || !b->patchBrush) + { + // should not ever happen + Patch_BendToggle(); + return; + } + + patchMesh_t *p = b->pPatch; + if (g_bPatchAxisOnRow) + { + SelectRow(p, g_nPatchAxisIndex, false); + } + else + { + SelectColumn(p, g_nPatchAxisIndex, false); + } + + //FIXME: this only needs to be set once... + Patch_SetBendRotateOrigin(p); + +} + +void Patch_SelectBendNormal() +{ + brush_t* b = selected_brushes.next; + if (!QE_SingleBrush() || !b->patchBrush) + { + // should not ever happen + Patch_BendToggle(); + return; + } + + patchMesh_t *p = b->pPatch; + + g_qeglobals.d_num_move_points = 0; + if (g_bPatchAxisOnRow) + { + if (g_bPatchLowerEdge) + { + for (int j = 0; j < g_nPatchAxisIndex; j++) + SelectRow(p, j, true); + } + else + { + for (int j = p->height-1; j > g_nPatchAxisIndex; j--) + SelectRow(p, j, true); + } + } + else + { + if (g_bPatchLowerEdge) + { + for (int j = 0; j < g_nPatchAxisIndex; j++) + SelectColumn(p, j, true); + } + else + { + for (int j = p->width-1; j > g_nPatchAxisIndex; j--) + SelectColumn(p, j, true); + } + } + Patch_SetBendRotateOrigin(p); +} + + + +/* +void Patch_InsDelToggle() +{ + if (g_bPatchInsertMode) + { + g_bPatchInsertMode = false; + HideInfoDialog(); + g_pParentWnd->UpdatePatchToolbarButtons() ; + return; + } + + brush_t* b = selected_brushes.next; + + if (!QE_SingleBrush(true) || !b->patchBrush) + { + Sys_Printf("Patch_InsDelToggle: you must have a single patch selected\n"); + return; + } + + Patch_Save(b->pPatch); + g_bPatchInsertMode = true; + g_nPatchInsertState = INSERT_SELECT_EDGE; + g_bPatchAxisOnRow = true; + g_nPatchAxisIndex = 0; + ShowInfoDialog(g_pInsertStateMsg[INSERT_SELECT_EDGE]); + +} + +void Patch_InsDelESC() +{ + if (!g_bPatchInsertMode) + { + return; + } + Patch_InsDelToggle(); + Sys_UpdateWindows(W_ALL); +} + + +void Patch_InsDelHandleENTER() +{ +} + +void Patch_InsDelHandleTAB() +{ + if (!g_bPatchInsertMode) + { + Patch_InsDelToggle(); + return; + } + + brush_t* b = selected_brushes.next; + if (!QE_SingleBrush() || !b->patchBrush) + { + Patch_BendToggle(); + Sys_Printf("No patch to bend!"); + return; + } + + patchMesh_t *p = b->pPatch; + + // only able to deal with odd numbered rows/cols + g_nPatchAxisIndex += 2; + if (g_bPatchAxisOnRow) + { + if (g_nPatchAxisIndex >= p->height-1) + { + g_bPatchAxisOnRow = false; + g_nPatchAxisIndex = 0; + } + } + else + { + if (g_nPatchAxisIndex >= p->width-1) + { + g_bPatchAxisOnRow = true; + g_nPatchAxisIndex = 0; + } + } + Sys_UpdateWindows(W_ALL); +} +*/ + + +void _Write1DMatrix (FILE *f, int x, float *m) { + int i; + + fprintf (f, "( "); + for (i = 0 ; i < x ; i++) { + if (m[i] == (int)m[i] ) { + fprintf (f, "%i ", (int)m[i]); + } else { + fprintf (f, "%f ", m[i]); + } + } + fprintf (f, ")"); +} + +void _Write2DMatrix (FILE *f, int y, int x, float *m) { + int i; + + fprintf (f, "( "); + for (i = 0 ; i < y ; i++) { + _Write1DMatrix (f, x, m + i*x); + fprintf (f, " "); + } + fprintf (f, ")\n"); +} + + +void _Write3DMatrix (FILE *f, int z, int y, int x, float *m) { + int i; + + fprintf (f, "(\n"); + for (i = 0 ; i < z ; i++) { + _Write2DMatrix (f, y, x, m + i*(x*MAX_PATCH_HEIGHT) ); + } + fprintf (f, ")\n"); +} + +void _Write1DMatrix (MemStream *f, int x, float *m) { + int i; + + MemFile_fprintf (f, "( "); + for (i = 0 ; i < x ; i++) { + if (m[i] == (int)m[i] ) { + MemFile_fprintf (f, "%i ", (int)m[i]); + } else { + MemFile_fprintf (f, "%f ", m[i]); + } + } + MemFile_fprintf (f, ")"); +} + +void _Write2DMatrix (MemStream *f, int y, int x, float *m) { + int i; + + MemFile_fprintf (f, "( "); + for (i = 0 ; i < y ; i++) { + _Write1DMatrix (f, x, m + i*x); + MemFile_fprintf (f, " "); + } + MemFile_fprintf (f, ")\n"); +} + + +void _Write3DMatrix (MemStream *f, int z, int y, int x, float *m) { + int i; + + MemFile_fprintf (f, "(\n"); + for (i = 0 ; i < z ; i++) { + _Write2DMatrix (f, y, x, m + i*(x*MAX_PATCH_HEIGHT) ); + } + MemFile_fprintf (f, ")\n"); +} + +// NOTE: why the hell is this called Naturalize? +// we dispatch either to Patch+Naturalize or Patch_CapTexture.. +void Patch_NaturalizeSelected(bool bCap) +{ + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + if (bCap) + Patch_CapTexture(pb->pPatch);//, bCycleCap); + else + Patch_Naturalize(pb->pPatch); + } + } +} + +// go through the selected patches and call Patch_CapTexture +// deal with cycling +void Patch_CycleCapSelected() +{ + // compute the g_vCycleCapNormal according to g_nCycleCapIndex + VectorClear (g_vCycleCapNormal); + g_vCycleCapNormal[g_nCycleCapIndex] = 1.0f; // cf VIEWTYPE defintion: enum VIEWTYPE {YZ, XZ, XY}; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + Patch_CapTexture(pb->pPatch, true); + } + } + switch (g_nCycleCapIndex) + { + case YZ: + g_nCycleCapIndex = XZ; + break; + case XZ: + g_nCycleCapIndex = XY; + break; + case XY: + g_nCycleCapIndex = YZ; + break; + } +} + +bool within(vec3_t vTest, vec3_t vTL, vec3_t vBR) +{ + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + if ((vTest[nDim1] > vTL[nDim1] && vTest[nDim1] < vBR[nDim1]) || + (vTest[nDim1] < vTL[nDim1] && vTest[nDim1] > vBR[nDim1])) + { + if ((vTest[nDim2] > vTL[nDim2] && vTest[nDim2] < vBR[nDim2]) || + (vTest[nDim2] < vTL[nDim2] && vTest[nDim2] > vBR[nDim2])) + return true; + } + return false; +} + + +void Patch_SelectAreaPoints(bool bMulti) +{ + if (!bMulti) + g_qeglobals.d_num_move_points = 0; + + if( g_nPatchClickedView == W_CAMERA ) { + // Clip against a pyramid + // Create our 5 normals (that are pointing to the inside) + camera_t *m_pCamera = g_pParentWnd->GetCamWnd()->Camera(); + vec3_t norm[5]; + float r[2], u[2], hh, hw; + int idx; + vec_t corners[2][2]; + vec3_t ray[4]; + vec3_t check; + + VectorCopy( m_pCamera->vpn, norm[0] ); // only points in front of the camera + + // get our rectangle + corners[0][0] = MIN( g_qeglobals.d_vAreaTL[0], g_qeglobals.d_vAreaBR[0] ); + corners[0][1] = MAX( g_qeglobals.d_vAreaTL[1], g_qeglobals.d_vAreaBR[1] ); + corners[1][0] = MAX( g_qeglobals.d_vAreaTL[0], g_qeglobals.d_vAreaBR[0] ); + corners[1][1] = MIN( g_qeglobals.d_vAreaTL[1], g_qeglobals.d_vAreaBR[1] ); + + // calculate our four ray vectors + hh = m_pCamera->height/2; + hw = m_pCamera->width/2; + u[0] = (float)(corners[0][1] - hh) / (hw); + r[0] = (float)(corners[0][0] - hw) / (hw); + u[1] = (float)(corners[1][1] - hh) / (hw); + r[1] = (float)(corners[1][0] - hw) / (hw); + + for (idx=0 ; idx<3; idx++) + ray[0][idx] = m_pCamera->vpn[idx] + m_pCamera->vright[idx] * r[0] + m_pCamera->vup[idx] * u[0]; + for (idx=0 ; idx<3; idx++) + ray[1][idx] = m_pCamera->vpn[idx] + m_pCamera->vright[idx] * r[1] + m_pCamera->vup[idx] * u[0]; + for (idx=0 ; idx<3; idx++) + ray[2][idx] = m_pCamera->vpn[idx] + m_pCamera->vright[idx] * r[1] + m_pCamera->vup[idx] * u[1]; + for (idx=0 ; idx<3; idx++) + ray[3][idx] = m_pCamera->vpn[idx] + m_pCamera->vright[idx] * r[0] + m_pCamera->vup[idx] * u[1]; + + // Create our four other directions from these + CrossProduct( ray[0], ray[1], norm[1] ); VectorNormalize( norm[1], norm[1] ); + CrossProduct( ray[1], ray[2], norm[2] ); VectorNormalize( norm[2], norm[2] ); + CrossProduct( ray[2], ray[3], norm[3] ); VectorNormalize( norm[3], norm[3] ); + CrossProduct( ray[3], ray[0], norm[4] ); VectorNormalize( norm[4], norm[4] ); + + // 3D clipping + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + for (int i = 0; i < p->width; i++) + { + for (int j = 0; j < p->height; j++) + { + VectorSubtract( m_pCamera->origin, p->ctrl[i][j].xyz, check ); + VectorNormalize( check, check ); + for (idx=0 ; idx<5; idx++) + { + if (DotProduct(check, norm[idx])>=0) + break; + } + if (idx == 5) // all test were good + { + if (bMulti && PointInMoveList(p->ctrl[i][j].xyz) != -1) + RemovePointFromMoveList(p->ctrl[i][j].xyz); + else + g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = p->ctrl[i][j].xyz; + } + } + } + } + } + } else + { + // Simple 2D clipping + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + for (int i = 0; i < p->width; i++) + { + for (int j = 0; j < p->height; j++) + { + if (within(p->ctrl[i][j].xyz, g_qeglobals.d_vAreaTL, g_qeglobals.d_vAreaBR)) + { + if (bMulti && PointInMoveList(p->ctrl[i][j].xyz) != -1) + RemovePointFromMoveList(p->ctrl[i][j].xyz); + else + g_qeglobals.d_move_points[g_qeglobals.d_num_move_points++] = p->ctrl[i][j].xyz; + } + } + } + } + } + } + + g_nPatchClickedView = -1; +} + +// TTimo: return the shader name for a patch +const char* Patch_GetTextureName() +{ + brush_t* b = selected_brushes.next; + if (b->patchBrush) + { + patchMesh_t *p = b->pPatch; + return p->pShader->getName(); + } + return ""; +} + +patchMesh_t* Patch_Duplicate(patchMesh_t *pFrom) +{ + patchMesh_t* p = MakeNewPatch(); + memcpy(p, pFrom , sizeof(patchMesh_t)); + + // spog - initialise patch LOD pointers (again) + Patch_InitialiseLODPointers(p); + p->drawLists = NULL; + + p->bSelected = false; + p->bDirty = true; + p->bOverlay = false; + p->nListID = -1; + AddBrushForPatch(p); + + return p; +} + + +void Patch_Thicken(int nAmount, bool bSeam, qboolean bGroupResult) +{ + int i, j, h, w; + brush_t *b; + patchMesh_t *pSeam; + vec3_t vMin, vMax; + CPtrArray brushes; + + nAmount = -nAmount; + + + if (!QE_SingleBrush()) + { + Sys_Printf("Cannot thicken multiple patches. Please select a single patch.\n"); + return; + } + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + Patch_MeshNormals(p); + patchMesh_t *pNew = Patch_Duplicate(p); + for (i = 0; i < p->width; i++) + { + for (j = 0; j < p->height; j++) + { + VectorMA (p->ctrl[i][j].xyz, nAmount, p->ctrl[i][j].normal, pNew->ctrl[i][j].xyz); + } + } + + Patch_Rebuild(pNew); + pNew->type |= PATCH_THICK; + brushes.Add(pNew->pSymbiot); + + if (bSeam) + { + + // FIXME: this should detect if any edges of the patch are closed and act appropriately + // + if (!(p->type & PATCH_CYLINDER)) + { + b = Patch_GenericMesh(3, p->height, 2, false, true); + pSeam = b->pPatch; + pSeam->type |= PATCH_SEAM; + for (i = 0; i < p->height; i++) + { + VectorCopy(p->ctrl[0][i].xyz, pSeam->ctrl[0][i].xyz); + VectorCopy(pNew->ctrl[0][i].xyz, pSeam->ctrl[2][i].xyz); + VectorAdd(pSeam->ctrl[0][i].xyz, pSeam->ctrl[2][i].xyz, pSeam->ctrl[1][i].xyz); + VectorScale(pSeam->ctrl[1][i].xyz, 0.5, pSeam->ctrl[1][i].xyz); + } + + + Patch_CalcBounds(pSeam, vMin, vMax); + Brush_RebuildBrush(pSeam->pSymbiot, vMin, vMax); + //--Patch_CapTexture(pSeam); + Patch_Naturalize(pSeam); + patchInvert(pSeam); + brushes.Add(b); + + w = p->width - 1; + b = Patch_GenericMesh(3, p->height, 2, false, true); + pSeam = b->pPatch; + pSeam->type |= PATCH_SEAM; + for (i = 0; i < p->height; i++) + { + VectorCopy(p->ctrl[w][i].xyz, pSeam->ctrl[0][i].xyz); + VectorCopy(pNew->ctrl[w][i].xyz, pSeam->ctrl[2][i].xyz); + VectorAdd(pSeam->ctrl[0][i].xyz, pSeam->ctrl[2][i].xyz, pSeam->ctrl[1][i].xyz); + VectorScale(pSeam->ctrl[1][i].xyz, 0.5, pSeam->ctrl[1][i].xyz); + } + Patch_CalcBounds(pSeam, vMin, vMax); + Brush_RebuildBrush(pSeam->pSymbiot, vMin, vMax); + //--Patch_CapTexture(pSeam); + Patch_Naturalize(pSeam); + brushes.Add(b); + } + + //--{ + // otherwise we will add one per end + b = Patch_GenericMesh(p->width, 3, 2, false, true); + pSeam = b->pPatch; + pSeam->type |= PATCH_SEAM; + for (i = 0; i < p->width; i++) + { + VectorCopy(p->ctrl[i][0].xyz, pSeam->ctrl[i][0].xyz); + VectorCopy(pNew->ctrl[i][0].xyz, pSeam->ctrl[i][2].xyz); + VectorAdd(pSeam->ctrl[i][0].xyz, pSeam->ctrl[i][2].xyz, pSeam->ctrl[i][1].xyz); + VectorScale(pSeam->ctrl[i][1].xyz, 0.5, pSeam->ctrl[i][1].xyz); + } + + + Patch_CalcBounds(pSeam, vMin, vMax); + Brush_RebuildBrush(pSeam->pSymbiot, vMin, vMax); + //--Patch_CapTexture(pSeam); + Patch_Naturalize(pSeam); + patchInvert(pSeam); + brushes.Add(b); + + h = p->height - 1; + b = Patch_GenericMesh(p->width, 3, 2, false, true); + pSeam = b->pPatch; + pSeam->type |= PATCH_SEAM; + for (i = 0; i < p->width; i++) + { + VectorCopy(p->ctrl[i][h].xyz, pSeam->ctrl[i][0].xyz); + VectorCopy(pNew->ctrl[i][h].xyz, pSeam->ctrl[i][2].xyz); + VectorAdd(pSeam->ctrl[i][0].xyz, pSeam->ctrl[i][2].xyz, pSeam->ctrl[i][1].xyz); + VectorScale(pSeam->ctrl[i][1].xyz, 0.5, pSeam->ctrl[i][1].xyz); + } + Patch_CalcBounds(pSeam, vMin, vMax); + Brush_RebuildBrush(pSeam->pSymbiot, vMin, vMax); + //--Patch_CapTexture(pSeam); + Patch_Naturalize(pSeam); + brushes.Add(b); + + } + patchInvert(pNew); + } + } + + for (i = 0; i < brushes.GetSize(); i++) + { + Select_Brush(reinterpret_cast(brushes.GetAt(i))); + } + + if(bGroupResult) + { + entity_t *e = Entity_Alloc(); + SetKeyValue(e, "classname", "func_group"); + SetKeyValue(e, "type", "patchThick"); + Select_GroupEntity(e); + Entity_AddToList(e, &entities); + } + + UpdatePatchInspector(); +} + + +/* +lets get another list together as far as necessities.. + +*snapping stuff to the grid (i will only snap movements by the mouse to the grid.. snapping the rotational bend stuff will fubar everything) + +capping bevels/endcaps + +hot keys + +texture fix for caps + +clear clipboard + +*region fix + +*surface dialog + +*/ + +void Patch_SetOverlays() +{ + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pb->pPatch->bOverlay = true; + } + } +} + + + +void Patch_ClearOverlays() +{ + brush_t *pb; + for (pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pb->pPatch->bOverlay = false; + } + } + + for (pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pb->pPatch->bOverlay = false; + } + } + +} + +// FIXME: spog - er, someone forgot to finish their patch point freezing feature? +// freezes selected vertices +void Patch_Freeze() +{ + brush_t *pb; + for (pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pb->pPatch->bOverlay = false; + } + } + + for (pb = active_brushes.next ; pb != &active_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + pb->pPatch->bOverlay = false; + } + } + +} + +void Patch_UnFreeze(bool bAll) +{ +} + +void Patch_Transpose() +{ + int i, j, w; + drawVert_t dv; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + + if ( p->width > p->height ) + { + for ( i = 0 ; i < p->height ; i++ ) + { + for ( j = i + 1 ; j < p->width ; j++ ) + { + if ( j < p->height ) + { + // swap the value + memcpy(&dv,&p->ctrl[j][i],sizeof(drawVert_t)); + memcpy(&p->ctrl[j][i],&p->ctrl[i][j], sizeof(drawVert_t)); + memcpy(&p->ctrl[i][j],&dv, sizeof(drawVert_t)); + } + else + { + // just copy + memcpy(&p->ctrl[i][j],&p->ctrl[j][i], sizeof(drawVert_t)); + } + } + } + } + else + { + for ( i = 0 ; i < p->width ; i++ ) + { + for ( j = i + 1 ; j < p->height ; j++ ) + { + if ( j < p->width ) + { + // swap the value + memcpy(&dv,&p->ctrl[i][j], sizeof(drawVert_t)); + memcpy(&p->ctrl[i][j],&p->ctrl[j][i], sizeof(drawVert_t)); + memcpy(&p->ctrl[j][i],&dv, sizeof(drawVert_t)); + } + else + { + // just copy + memcpy(&p->ctrl[j][i],&p->ctrl[i][j], sizeof(drawVert_t)); + } + } + } + } + + w = p->width; + p->width = p->height; + p->height = w; + patchInvert(p); + Patch_Rebuild(p); + } + } +} + + + +void Patch_SnapToGrid(patchMesh_t *p) +{ + int i,j,k; + + // if patch points selected, snap only selected points + if (g_qeglobals.d_select_mode == sel_curvepoint && g_qeglobals.d_num_move_points != 0) + for (i=0; iwidth; i++) + for (j = 0; j < p->height; j++) + for (k = 0; k < 3; k++) + p->ctrl[i][j].xyz[k] = floor(p->ctrl[i][j].xyz[k] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + + vec3_t vMin, vMax; + Patch_CalcBounds(p, vMin, vMax); + Brush_RebuildBrush(p->pSymbiot, vMin, vMax); +} + + +void Patch_FindReplaceTexture(brush_t *pb, const char *pFind, const char *pReplace, bool bForce) +{ + if (pb->patchBrush) + { + patchMesh_t *p = pb->pPatch; + if (bForce || strcmpi(p->pShader->getName(), pFind) == 0) + { + p->pShader->DecRef(); + p->pShader = QERApp_Shader_ForName(pReplace); + p->d_texture = p->pShader->getTexture(); + } + } +} + +/* uncomment if necessary, currently not used +void Patch_FromTriangle(vec5_t vx, vec5_t vy, vec5_t vz) +{ + patchMesh_t* p = MakeNewPatch(); + p->pShader = g_qeglobals.d_texturewin.pShader; + p->d_texture = g_qeglobals.d_texturewin.pShader->getTexture(); + p->width = 3; + p->height = 3; + p->type = PATCH_TRIANGLE; + + // 0 0 goes to x + // 0 1 goes to x + // 0 2 goes to x + + // 1 0 goes to mid of x and z + // 1 1 goes to mid of x y and z + // 1 2 goes to mid of x and y + + // 2 0 goes to z + // 2 1 goes to mid of y and z + // 2 2 goes to y + + vec5_t vMidXZ; + vec5_t vMidXY; + vec5_t vMidYZ; + int j; + + for (j = 0; j < 3; j++) + { + _Vector5Add(vx, vz, vMidXZ); + _Vector5Scale(vMidXZ, 0.5, vMidXZ); + //vMidXZ[j] = vx[j] + abs((vx[j] - vz[j]) * 0.5); + } + + for (j = 0; j < 3; j++) + { + _Vector5Add(vx, vy, vMidXY); + _Vector5Scale(vMidXY, 0.5, vMidXY); + //vMidXY[j] = vx[j] + abs((vx[j] - vy[j]) * 0.5); + } + + for (j = 0; j < 3; j++) + { + _Vector5Add(vy, vz, vMidYZ); + _Vector5Scale(vMidYZ, 0.5, vMidYZ); + //vMidYZ[j] = vy[j] + abs((vy[j] - vz[j]) * 0.5); + } + + _Vector53Copy(vx, p->ctrl[0][0].xyz); + _Vector53Copy(vx, p->ctrl[0][1].xyz); + _Vector53Copy(vx, p->ctrl[0][2].xyz); + p->ctrl[0][0].st[0] = vx[3]; + p->ctrl[0][0].st[1] = vx[4]; + p->ctrl[0][1].st[0] = vx[3]; + p->ctrl[0][1].st[1] = vx[4]; + p->ctrl[0][2].st[0] = vx[3]; + p->ctrl[0][2].st[1] = vx[4]; + + _Vector53Copy(vMidXY, p->ctrl[1][0].xyz); + _Vector53Copy(vx, p->ctrl[1][1].xyz); + _Vector53Copy(vMidXZ, p->ctrl[1][2].xyz); + p->ctrl[1][0].st[0] = vMidXY[3]; + p->ctrl[1][0].st[1] = vMidXY[4]; + p->ctrl[1][1].st[0] = vx[3]; + p->ctrl[1][1].st[1] = vx[4]; + p->ctrl[1][2].st[0] = vMidXZ[3]; + p->ctrl[1][2].st[1] = vMidXZ[4]; + + _Vector53Copy(vy, p->ctrl[2][0].xyz); + _Vector53Copy(vMidYZ, p->ctrl[2][1].xyz); + _Vector53Copy(vz, p->ctrl[2][2].xyz); + p->ctrl[2][0].st[0] = vy[3]; + p->ctrl[2][0].st[1] = vy[4]; + p->ctrl[2][1].st[0] = vMidYZ[3]; + p->ctrl[2][1].st[1] = vMidYZ[4]; + p->ctrl[2][2].st[0] = vz[3]; + p->ctrl[2][2].st[1] = vz[4]; + + + //Patch_Naturalize(p); + + // brush_t *b = + AddBrushForPatch(p); + +} +*/ + +#ifdef ENABLE_GROUPS +/* +============== +Patch_SetEpair +sets an epair for the given patch +============== +*/ +void Patch_SetEpair(patchMesh_t *p, const char *pKey, const char *pValue) +{ + if (g_qeglobals.m_bBrushPrimitMode) + { + SetKeyValue(p->epairs, pKey, pValue); + } +} + +/* +================= +Patch_GetKeyValue +================= +*/ +const char* Patch_GetKeyValue(patchMesh_t *p, const char *pKey) +{ + if (g_qeglobals.m_bBrushPrimitMode) + { + return ValueForKey(p->epairs, pKey); + } + return ""; +} +#endif + + +//Real nitpicky, but could you make CTRL-S save the current map with the current name? (ie: File/Save) +/* +Feature addition. +When reading in textures, please check for the presence of a file called "textures.link" or something, which contains one line such as; + +g:\quake3\baseq3\textures\common + + So that, when I'm reading in, lets say, my \eerie directory, it goes through and adds my textures to the palette, along with everything in common. + + Don't forget to add "Finer texture alignment" to the list. I'd like to be able to move in 0.1 increments using the Shift-Arrow Keys. + + No. Sometimes textures are drawn the wrong way on patches. We'd like the ability to flip a texture. Like the way X/Y scale -1 used to worked. + + 1) Easier way of deleting rows, columns +2) Fine tuning of textures on patches (X/Y shifts other than with the surface dialog) +2) Patch matrix transposition + + 1) Actually, bump texture flipping on patches to the top of the list of things to do. +2) When you select a patch, and hit S, it should read in the selected patch texture. Should not work if you multiselect patches and hit S +3) Brandon has a wierd anomoly. He fine-tunes a patch with caps. It looks fine when the patch is selected, but as soon as he escapes out, it reverts to it's pre-tuned state. When he selects the patch again, it looks tuned + + +*1) Flipping textures on patches +*2) When you select a patch, and hit S, it should read in the selected patch texture. Should not work if you multiselect patches and hit S +3) Easier way of deleting rows columns +*4) Thick Curves +5) Patch matrix transposition +6) Inverted cylinder capping +*7) bugs +*8) curve speed + + Have a new feature request. "Compute Bounding Box" for mapobjects (md3 files). This would be used for misc_mapobject (essentially, drop in 3DS Max models into our maps) + + Ok, Feature Request. Load and draw MD3's in the Camera view with proper bounding boxes. This should be off misc_model + + Feature Addition: View/Hide Hint Brushes -- This should be a specific case. +*/ diff --git a/radiant/points.cpp b/radiant/points.cpp index b93e4278..2da92976 100644 --- a/radiant/points.cpp +++ b/radiant/points.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,294 +19,147 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* -The following source code is licensed by Id Software and subject to the terms of -its LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with -GtkRadiant. If you did not receive a LIMITED USE SOFTWARE LICENSE AGREEMENT, -please contact Id Software immediately at info@idsoftware.com. -*/ +#include "stdafx.h" -#include "points.h" +#define MAX_POINTFILE 8192 +static vec3_t s_pointvecs[MAX_POINTFILE]; +static int s_num_points, s_check_point; -#include "debugging/debugging.h" +CPointfile g_pointfile; -#include "irender.h" -#include "igl.h" -#include "renderable.h" - -#include "stream/stringstream.h" -#include "os/path.h" -#include "os/file.h" -#include "cmdlib.h" - -#include "map.h" -#include "qe3.h" -#include "camwindow.h" -#include "xywindow.h" -#include "xmlstuff.h" -#include "mainframe.h" -#include "watchbsp.h" -#include "commands.h" - - -class CPointfile; -void Pointfile_Parse(CPointfile& pointfile); - - -class CPointfile : public ISAXHandler, public Renderable, public OpenGLRenderable -{ - enum - { - MAX_POINTFILE = 8192, - }; - Vector3 s_pointvecs[MAX_POINTFILE]; - std::size_t s_num_points; - int m_displaylist; - static Shader* m_renderstate; - StringOutputStream m_characters; -public: - CPointfile() - { - } - ~CPointfile() - { - } - void Init(); - void PushPoint (const Vector3& v); - void GenerateDisplayList(); - // SAX interface - void Release() - { - // blank because not heap-allocated - } - void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs); - void saxEndElement (message_info_t *ctx, const xmlChar *name); - void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len); - const char* getName(); - - typedef const Vector3* const_iterator; - - const_iterator begin() const - { - return &s_pointvecs[0]; - } - const_iterator end() const - { - return &s_pointvecs[s_num_points]; - } - - bool shown() const - { - return m_displaylist != 0; - } - void show(bool show) - { - if(show && !shown()) - { - Pointfile_Parse(*this); - GenerateDisplayList(); - SceneChangeNotify(); - } - else if(!show && shown()) - { - glDeleteLists (m_displaylist, 1); - m_displaylist = 0; - SceneChangeNotify(); - } - } - - void render(RenderStateFlags state) const - { - glCallList(m_displaylist); - } - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const - { - if(shown()) - { - renderer.SetState(m_renderstate, Renderer::eWireframeOnly); - renderer.SetState(m_renderstate, Renderer::eFullMaterials); - renderer.addRenderable(*this, g_matrix4_identity); - } - } - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } - - static void constructStatic() - { - m_renderstate = GlobalShaderCache().capture("$POINTFILE"); - } - - static void destroyStatic() - { - GlobalShaderCache().release("$POINTFILE"); - } -}; - -Shader* CPointfile::m_renderstate = 0; - -namespace -{ - CPointfile s_pointfile; -} - -ISAXHandler& g_pointfile = s_pointfile; - -static CPointfile::const_iterator s_check_point; +// CPointfile routine used by the standard code --------------------------------- void CPointfile::Init() { s_num_points = 0; - m_displaylist = 0; } -void CPointfile::PushPoint(const Vector3& v) +void CPointfile::PushPoint (vec3_t v) { if (s_num_points < MAX_POINTFILE) { - s_pointvecs[s_num_points] = v; - ++s_num_points; + VectorCopy (v, s_pointvecs[s_num_points]); + s_num_points++; } } // create the display list at the end void CPointfile::GenerateDisplayList() { - m_displaylist = glGenLists(1); + int i; - glNewList (m_displaylist, GL_COMPILE); + if (!g_qeglobals.d_pointfile_display_list) + g_qeglobals.d_pointfile_display_list = qglGenLists(1); - glBegin(GL_LINE_STRIP); - for(std::size_t i=0;i= s_num_points-2) { - globalOutputStream() << "End of pointfile\n"; + Sys_Status ("End of pointfile", 0); return; } + s_check_point++; + VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamWnd()->Camera()->origin); + VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin()); + VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamWnd()->Camera()->origin, dir); + VectorNormalize (dir, dir); + g_pParentWnd->GetCamWnd()->Camera()->angles[1] = atan2 (dir[1], dir[0])*180/3.14159; + g_pParentWnd->GetCamWnd()->Camera()->angles[0] = asin (dir[2])*180/3.14159; - CPointfile::const_iterator i = ++s_check_point; - - - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - Camera_setOrigin(camwnd, *i); - g_pParentWnd->GetXYWnd()->SetOrigin(*i); - { - Vector3 dir(vector3_normalised(vector3_subtracted(*(++i), Camera_getOrigin(camwnd)))); - Vector3 angles(Camera_getAngles(camwnd)); - angles[CAMERA_YAW] = static_cast(radians_to_degrees(atan2(dir[1], dir[0]))); - angles[CAMERA_PITCH] = static_cast(radians_to_degrees(asin(dir[2]))); - Camera_setAngles(camwnd, angles); - } + Sys_UpdateWindows (W_ALL); } // advance camera to previous point void Pointfile_Prev (void) { - if(!s_pointfile.shown()) - return; + vec3_t dir; - if (s_check_point == s_pointfile.begin()) + if ( s_check_point == 0) { - globalOutputStream() << "Start of pointfile\n"; + Sys_Status ("Start of pointfile", 0); return; } + s_check_point--; + VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetCamWnd()->Camera()->origin); + VectorCopy (s_pointvecs[s_check_point], g_pParentWnd->GetXYWnd()->GetOrigin()); + VectorSubtract (s_pointvecs[s_check_point+1], g_pParentWnd->GetCamWnd()->Camera()->origin, dir); + VectorNormalize (dir, dir); + g_pParentWnd->GetCamWnd()->Camera()->angles[1] = atan2 (dir[1], dir[0])*180/3.14159; + g_pParentWnd->GetCamWnd()->Camera()->angles[0] = asin (dir[2])*180/3.14159; - CPointfile::const_iterator i = --s_check_point; - - CamWnd& camwnd = *g_pParentWnd->GetCamWnd(); - Camera_setOrigin(camwnd, *i); - g_pParentWnd->GetXYWnd()->SetOrigin(*i); - { - Vector3 dir(vector3_normalised(vector3_subtracted(*(++i), Camera_getOrigin(camwnd)))); - Vector3 angles(Camera_getAngles(camwnd)); - angles[CAMERA_YAW] = static_cast(radians_to_degrees(atan2(dir[1], dir[0]))); - angles[CAMERA_PITCH] = static_cast(radians_to_degrees(asin(dir[2]))); - Camera_setAngles(camwnd, angles); - } + Sys_UpdateWindows (W_ALL); } -int LoadFile (const char *filename, void **bufferptr) -{ - FILE *f; - long len; - - f = fopen (filename, "rb"); - if (f == 0) - return -1; - - fseek (f, 0, SEEK_END); - len = ftell (f); - rewind (f); - - *bufferptr = malloc (len+1); - if (*bufferptr == 0) - return -1; - - fread (*bufferptr, 1, len, f); - fclose (f); - - // we need to end the buffer with a 0 - ((char*) (*bufferptr))[len] = 0; - - return len; -} - -void Pointfile_Parse(CPointfile& pointfile) +void WINAPI Pointfile_Check (void) { + char name[1024]; int size; char *data; char *text; int line = 1; + vec3_t v; - const char* mapname = Map_Name(g_map); - StringOutputStream name(256); - name << StringRange(mapname, path_get_filename_base_end(mapname)) << ".lin"; + strcpy (name, currentmap); + StripExtension (name); + strcat (name, ".lin"); - size = LoadFile (name.c_str(), (void**)&data); - if (size == -1) + size = vfsLoadFullPathFile (name, (void**)&data); + if (size <= 0) { - globalErrorStream() << "Pointfile " << name.c_str() << " not found\n"; + Sys_FPrintf (SYS_ERR, "Pointfile %s not found\n", name); return; } // store a pointer text = data; - globalOutputStream() << "Reading pointfile " << name.c_str() << "\n"; + Sys_Printf ("Reading pointfile %s\n", name); - pointfile.Init(); + g_pointfile.Init(); while (*data) { - Vector3 v; if (sscanf(data,"%f %f %f", &v[0], &v[1], &v[2]) != 3) { - globalOutputStream() << "Corrupt point file, line " << line << "\n"; + Sys_Printf("Corrupt point file, line %d\n",line); break; } @@ -321,7 +174,7 @@ void Pointfile_Parse(CPointfile& pointfile) { if (sscanf(data,"- %f %f %f", &v[0], &v[1], &v[2]) != 3) { - globalOutputStream() << "Corrupt point file, line " << line << "\n"; + Sys_Printf("Corrupt point file, line %d\n",line); break; } @@ -334,81 +187,63 @@ void Pointfile_Parse(CPointfile& pointfile) data++; // skip the \n line++; } - pointfile.PushPoint (v); + g_pointfile.PushPoint (v); } g_free(text); + + g_pointfile.GenerateDisplayList(); + + Sys_UpdateWindows (W_ALL); } -void Pointfile_Clear() +void Pointfile_Draw( void ) { - s_pointfile.show(false); + qglCallList (g_qeglobals.d_pointfile_display_list); } -void Pointfile_Toggle() +void Pointfile_Clear (void) { - s_pointfile.show(!s_pointfile.shown()); + if (!g_qeglobals.d_pointfile_display_list) + return; - s_check_point = s_pointfile.begin(); + qglDeleteLists (g_qeglobals.d_pointfile_display_list, 1); + g_qeglobals.d_pointfile_display_list = 0; + Sys_UpdateWindows (W_ALL); } -void Pointfile_Construct() -{ - CPointfile::constructStatic(); - - GlobalShaderCache().attachRenderable(s_pointfile); - - GlobalCommands_insert("TogglePointfile", FreeCaller()); - GlobalCommands_insert("NextLeakSpot", FreeCaller(), Accelerator('K', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("PrevLeakSpot", FreeCaller(), Accelerator('L', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); -} - -void Pointfile_Destroy() -{ - GlobalShaderCache().detachRenderable(s_pointfile); - - CPointfile::destroyStatic(); -} - - - -// CPointfile implementation for SAX-specific stuff ------------------------------- +// CPointfile implementation for SAX speicific stuff ------------------------------- void CPointfile::saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs) { - if(string_equal(reinterpret_cast(name), "polyline")) + if (strcmp ((char *)name, "polyline")==0) { Init(); // there's a prefs setting to avoid stopping on leak - if (!g_WatchBSP_LeakStop) + if (!g_PrefsDlg.m_bLeakStop) ctx->stop_depth = 0; } } void CPointfile::saxEndElement (message_info_t *ctx, const xmlChar *name) { - if(string_equal(reinterpret_cast(name), "polyline")) + if (strcmp ((char *)name, "polyline")==0) { // we are done GenerateDisplayList(); - SceneChangeNotify(); - s_check_point = begin(); - } - else if(string_equal(reinterpret_cast(name), "point")) - { - Vector3 v; - sscanf(m_characters.c_str(), "%f %f %f\n", &v[0], &v[1], &v[2]); - PushPoint(v); - m_characters.clear(); + ctx->bGeometry = false; } } // only "point" is expected to have characters around here void CPointfile::saxCharacters (message_info_t *ctx, const xmlChar *ch, int len) { - m_characters.write(reinterpret_cast(ch), len); + vec3_t v; + + sscanf ((char *)ch, "%f %f %f\n", &v[0], &v[1], &v[2]); + PushPoint (v); } -const char* CPointfile::getName() +char * CPointfile::getName() { - return "Map leaked"; + return "Map is leaked"; } diff --git a/radiant/points.h b/radiant/points.h index 63665b78..f9e6d966 100644 --- a/radiant/points.h +++ b/radiant/points.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,16 +25,36 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // header for Pointfile stuff (adding a C++ class to wrap the pointfile thing in the SAX parser) // -#if !defined(INCLUDED_POINTS_H) -#define INCLUDED_POINTS_H +#ifndef __POINTS__ +#define __POINTS__ -void Pointfile_Clear(); void Pointfile_Delete (void); +void WINAPI Pointfile_Check (void); +void Pointfile_Next (void); +void Pointfile_Prev (void); +void Pointfile_Clear (void); +void Pointfile_Draw( void ); +void Pointfile_Load( void ); -void Pointfile_Construct(); -void Pointfile_Destroy(); +class CPointfile : public ISAXHandler +{ +public: + CPointfile() { } + void Init(); + void PushPoint( vec3_t v ); + void GenerateDisplayList(); + // SAX interface + void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); + void saxEndElement( message_info_t *ctx, const xmlChar *name ); + void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); + char *getName(); -class ISAXHandler; -extern ISAXHandler& g_pointfile; + // class is only used for g_pointfile and we should not attempt to free it + bool ShouldDelete() { return false; } +}; + +// instead of using Pointfile_Load you can do it by hand through g_pointfile +// but the usual pointfile mechanism remains the same, use Pointfile_Draw etc. +extern CPointfile g_pointfile; #endif diff --git a/radiant/preferencedictionary.cpp b/radiant/preferencedictionary.cpp deleted file mode 100644 index 598190eb..00000000 --- a/radiant/preferencedictionary.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "preferencedictionary.h" - diff --git a/radiant/preferencedictionary.h b/radiant/preferencedictionary.h deleted file mode 100644 index 35a281ad..00000000 --- a/radiant/preferencedictionary.h +++ /dev/null @@ -1,295 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_PREFERENCEDICTIONARY_H) -#define INCLUDED_PREFERENCEDICTIONARY_H - -#include "preferencesystem.h" -#include "xml/ixml.h" -#include "stream/stringstream.h" -#include "generic/callback.h" -#include "versionlib.h" -#include - -class PreferenceDictionary : public PreferenceSystem -{ - class PreferenceEntry - { - StringImportCallback m_importer; - StringExportCallback m_exporter; - public: - PreferenceEntry(const StringImportCallback& importer, const StringExportCallback& exporter) - : m_importer(importer), m_exporter(exporter) - { - } - void importString(const char* string) - { - m_importer(string); - } - void exportString(const StringImportCallback& importer) - { - m_exporter(importer); - } - }; - - typedef std::map PreferenceEntries; - PreferenceEntries m_preferences; - - typedef std::map PreferenceCache; - PreferenceCache m_cache; - -public: - typedef PreferenceEntries::iterator iterator; - - iterator begin() - { - return m_preferences.begin(); - } - iterator end() - { - return m_preferences.end(); - } - iterator find(const char* name) - { - return m_preferences.find(name); - } - - void registerPreference(const char* name, const StringImportCallback& importer, const StringExportCallback& exporter) - { - m_preferences.insert(PreferenceEntries::value_type(name, PreferenceEntry(importer, exporter))); - PreferenceCache::iterator i = m_cache.find(name); - if(i != m_cache.end()) - { - importer((*i).second.c_str()); - m_cache.erase(i); - } - } - - void importPref(const char* name, const char* value) - { - PreferenceEntries::iterator i = m_preferences.find(name); - if(i != m_preferences.end()) - { - (*i).second.importString(value); - } - else - { - m_cache.insert(PreferenceCache::value_type(name, value)); - } - } -}; - -inline void XMLPreference_importString(XMLImporter& importer, const char* value) -{ - importer.write(value, string_length(value)); -} -typedef ReferenceCaller1 XMLPreferenceImportStringCaller; - -class XMLPreferenceDictionaryExporter : public XMLExporter -{ - class XMLQPrefElement : public XMLElement - { - const char* m_version; - public: - XMLQPrefElement(const char* version) : m_version(version) - { - } - const char* name() const - { - return "qpref"; - } - const char* attribute(const char* name) const - { - if(string_equal(name, "version")) - { - return m_version; - } - return ""; - } - void forEachAttribute(XMLAttrVisitor& visitor) const - { - visitor.visit("version", m_version); - } - }; - - class XMLPreferenceElement : public XMLElement - { - const char* m_name; - public: - XMLPreferenceElement(const char* name) - : m_name(name) - { - } - const char* name() const - { - return "epair"; - } - const char* attribute(const char* name) const - { - if(string_equal(name, "name")) - return m_name; - return ""; - } - void forEachAttribute(XMLAttrVisitor& visitor) const - { - visitor.visit("name", m_name); - } - }; - - typedef PreferenceDictionary PreferenceEntries; - PreferenceEntries& m_preferences; - const char* m_version; -public: - XMLPreferenceDictionaryExporter(PreferenceDictionary& preferences, const char* version) - : m_preferences(preferences), m_version(version) - { - } - - void exportXML(XMLImporter& importer) - { - importer.write("\n", 1); - - XMLQPrefElement qpref_element(m_version); - importer.pushElement(qpref_element); - importer.write("\n", 1); - - for(PreferenceEntries::iterator i = m_preferences.begin(); i != m_preferences.end(); ++i) - { - XMLPreferenceElement epair_element((*i).first.c_str()); - - importer.pushElement(epair_element); - - (*i).second.exportString(XMLPreferenceImportStringCaller(importer)); - - importer.popElement(epair_element.name()); - importer.write("\n", 1); - } - - importer.popElement(qpref_element.name()); - importer.write("\n", 1); - } -}; - -class XMLPreferenceDictionaryImporter : public XMLImporter -{ - struct xml_state_t - { - enum ETag - { - tag_qpref, - tag_qpref_ignore, - tag_epair, - tag_epair_ignore - }; - - xml_state_t(ETag tag) - : m_tag(tag) - { - } - - ETag m_tag; - CopiedString m_name; - StringOutputStream m_ostream; - }; - - typedef std::vector xml_stack_t; - xml_stack_t m_xml_stack; - - typedef PreferenceDictionary PreferenceEntries; - PreferenceEntries& m_preferences; - Version m_version; -public: - XMLPreferenceDictionaryImporter(PreferenceDictionary& preferences, const char* version) - : m_preferences(preferences), m_version(version_parse(version)) - { - } - - void pushElement(const XMLElement& element) - { - if(m_xml_stack.empty()) - { - if(string_equal(element.name(), "qpref")) - { - Version dataVersion(version_parse(element.attribute("version"))); - if(!version_compatible(m_version, dataVersion)) - { - globalOutputStream() << "qpref import: data version " << dataVersion << " is not compatible with code version " << m_version << "\n"; - m_xml_stack.push_back(xml_state_t::tag_qpref_ignore); - } - else - { - globalOutputStream() << "qpref import: data version " << dataVersion << " is compatible with code version " << m_version << "\n"; - m_xml_stack.push_back(xml_state_t::tag_qpref); - } - } - else - { - // not valid - } - } - else - { - switch(m_xml_stack.back().m_tag) - { - case xml_state_t::tag_qpref: - if(string_equal(element.name(), "epair")) - { - m_xml_stack.push_back(xml_state_t::tag_epair); - m_xml_stack.back().m_name = element.attribute("name"); - } - else - { - // not valid - } - break; - case xml_state_t::tag_qpref_ignore: - if(string_equal(element.name(), "epair")) - { - m_xml_stack.push_back(xml_state_t::tag_epair_ignore); - } - else - { - // not valid - } - break; - case xml_state_t::tag_epair: - case xml_state_t::tag_epair_ignore: - // not valid - break; - } - } - - } - void popElement(const char* name) - { - if(m_xml_stack.back().m_tag == xml_state_t::tag_epair) - { - m_preferences.importPref(m_xml_stack.back().m_name.c_str(), m_xml_stack.back().m_ostream.c_str()); - } - m_xml_stack.pop_back(); - } - std::size_t write(const char* buffer, std::size_t length) - { - return m_xml_stack.back().m_ostream.write(buffer, length); - } -}; - -#endif diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 38693611..df20d71d 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,518 +25,1391 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "preferences.h" +#include "stdafx.h" +#include +#include +#if defined (__linux__) || defined (__APPLE__) +#include +#include +#include +#include +#include +#endif +#include "missing.h" +#include "gtkmisc.h" -#include "debugging/debugging.h" +#ifdef _WIN32 +#include +#define X_OK 0 +#include +#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#define PREF_SECTION "Prefs" +#define INTERNAL_SECTION "Internals" +#define MOUSE_KEY "MouseButtons" +#define WINDOW_KEY "QE4StyleWindows" +#define LAYOUT_KEY "WindowLayout" +#define RUNQ2_KEY "RunQuake2Run" +#define TLOCK_KEY "TextureLock" +#define RLOCK_KEY "RotateLock" +#define LOADLAST_KEY "LoadLast" +#define LOADLASTMAP_KEY "LoadLastMap" +#define LASTPROJ_KEY "LastProject" +#define LASTPROJVER_KEY "LastProjectKey" +#define LASTMAP_KEY "LastMap" +#define FACE_KEY "NewFaceGrab" +#define BSP_KEY "InternalBSP" +#define RCLICK_KEY "NewRightClick" +#define VERTEX_KEY "NewVertex" +#define AUTOSAVE_KEY "Autosave" +#define AUTOSAVETIME_KEY "AutosaveMinutes" +#define PAK_KEY "UsePAK" +#define NEWAPPLY_KEY "ApplyDismissesSurface" +#define HACK_KEY "Gatewayescapehack" +#define TEXTURE_KEY "NewTextureWindowStuff" +#define TINYBRUSH_KEY "CleanTinyBrushes" +#define TINYSIZE_KEY "CleanTinyBrusheSize" +#define SNAPSHOT_KEY "Snapshots" +#define MOVESPEED_KEY "MoveSpeed" +#define ANGLESPEED_KEY "AngleSpeed" +#define SETGAME_KEY "UseSetGame" +#define CAMXYUPDATE_KEY "CamXYUpdate" +#define CAMDRAGMULTISELECT_KEY "CamDragMultiSelect" +#define CAMFREELOOK_KEY "CamFreeLook" +#define CAMINVERSEMOUSE_KEY "CamInverseMouse" +#define CAMDISCRETE_KEY "CamDiscrete" +#define LIGHTDRAW_KEY "NewLightStyle" +#define WHATGAME_KEY "WhichGame" +#define CUBICCLIP_KEY "CubicClipping" +#define CUBICSCALE_KEY "CubicScale" +#define ALTEDGE_KEY "ALTEdgeDrag" +#define FACECOLORS_KEY "FaceColors" +#define SNAPT_KEY "SnapT" +#define XZVIS_KEY "XZVIS" +#define YZVIS_KEY "YZVIS" +#define ZVIS_KEY "ZVIS" +#define SIZEPAINT_KEY "SizePainting" +#define DLLENTITIES_KEY "DLLEntities" +#define DETACHABLEMENUS_KEY "DetachableMenus" +#define PATCHTOOLBAR_KEY "PatchToolBar" +#define WIDETOOLBAR_KEY "WideToolBar" +#define PLUGINTOOLBAR_KEY "PluginToolBar" +#define NOCLAMP_KEY "NoClamp" +#define PREFAB_KEY "PrefabPath" +#define USERINI_KEY "UserINIPath" +#define ROTATION_KEY "Rotation" +#define BUGGYICD_KEY "BuggyICD" +#define CHASEMOUSE_KEY "ChaseMouse" +#define ENTITYSHOW_KEY "EntityShow" +#define TEXTURESCALE_KEY "TextureScale" +#define TEXTURESCROLLBAR_KEY "TextureScrollbar" +#define DISPLAYLISTS_KEY "UseDisplayLists" +#define ANTIALIASEDLINES_KEY "UseAntialiasedPointsAndLines" // Fishman - Add antialiazed points and lines support. 09/03/00 +#define NORMALIZECOLORS_KEY "NormalizeColors" +#define SHADERS_KEY "UseShaders" +#define SWITCHCLIP_KEY "SwitchClipKey" +#define SELWHOLEENTS_KEY "SelectWholeEntitiesKey" +#define TEXTURESUBSET_KEY "UseTextureSubsetLoading" +#define TEXTUREQUALITY_KEY "TextureQuality" +#define SHOWSHADERS_KEY "ShowShaders" +#define SHADERTEST_KEY "ShaderTest" +#define GLLIGHTING_KEY "UseGLLighting" +#define LOADSHADERS_KEY "LoadShaders" +#define NOSTIPPLE_KEY "NoStipple" +#define UNDOLEVELS_KEY "UndoLevels" +#define VERTEXMODE_KEY "VertexSplit" +#define ENGINEPATH_KEY "EnginePath" +#define ENGINE_KEY "Engine" +#define LOGCONSOLE_KEY "LogConsole" +#define SELECTCURVES_KEY "SelectCurves" +#define SELECTMODELS_KEY "SelectModels" +#define SHADERLISTONLY_KEY "ShowShaderlistOnly" +#define WATCHBSP_KEY "WatchBSP" +#define LEAKSTOP_KEY "LeakStop" +#define DOSLEEP_KEY "SleepMode" +#define SUBDIVISIONS_KEY "Subdivisions" +#define CLIPCAULK_KEY "ClipCaulk" +#define PATCHSHOWBOUNDS_KEY "PatchShowBounds" +#define NATIVEGUI_KEY "NativeGUI" +#define STARTONPRIMMON_KEY "StartOnPrimMon" +#define NOSYSMENUPOPUPS_KEY "NoSysMenuPopups" +#define SNAPTTOGRID_KEY "SnapTToGrid" +#define FLOATINGZ_KEY "FloatingZ" +#define TARGETFIX_KEY "TargetFix" +#define GLPOINTWORKAROUND_KEY "GlPointWorkaround" // Gef: Workaround for broken Kyro * gl driver 25-aug-2001 +#define WHEELINC_KEY "WheelMouseInc" +#define PATCHBBOXSEL_KEY "PatchBBoxSel" +#define LASTLIGHTINTENSITY_KEY "LastLightIntensity" +#define CUSTOMSHADEREDITOR_KEY "UseCustomShaderEditor" +#define CUSTOMSHADEREDITORCOMMAND_KEY "CustomShaderEditorCommand" +#define TEXTURECOMPRESSIONFORMAT_KEY "TextureCompressionFormat" +#define LIGHTRADIUS_KEY "LightRadiuses" +#define Q3MAP2TEX_KEY "Q3Map2Tex" +#define ATIHACK_KEY "ATIHack" -#include "generic/callback.h" -#include "math/vector.h" -#include "string/string.h" -#include "stream/stringstream.h" -#include "os/file.h" -#include "os/path.h" -#include "os/dir.h" -#include "gtkutil/filechooser.h" -#include "gtkutil/messagebox.h" -#include "cmdlib.h" +// window stuff +#define ENTITYSPLIT1_KEY "EntitySplit1" +#define ENTITYSPLIT2_KEY "EntitySplit2" +#define POSITIONX_KEY "PositionX" +#define POSITIONY_KEY "PositionY" +#define ENTITYWND_KEY "EntityWnd" +#define MAPINFOWND_KEY "MapInfoDlg" +#define CAMWND_KEY "CamWnd" +#define ZWND_KEY "ZWnd" +#define XYWND_KEY "XYWnd" +#define XZWND_KEY "XZWnd" +#define YZWND_KEY "YZWnd" +#define PATCHWND_KEY "PatchWnd" +#define SURFACEWND_KEY "SurfaceWnd" +#define ENTITYINFOWND_KEY "EntityInfoDlg" +#define WIDTH_KEY "Width" +#define HEIGHT_KEY "Height" +#define ZWIDTH_KEY "ZWidth" +#define XYHEIGHT_KEY "XYHeight" +#define XYWIDTH_KEY "XYWidth" +#define CAMWIDTH_KEY "CamWidth" +#define CAMHEIGHT_KEY "CamHeight" +#define ZFLOATWIDTH_KEY "ZWidthFloating" +#define STATE_KEY "State" -#include "error.h" -#include "console.h" -#include "xywindow.h" -#include "mainframe.h" -#include "qe3.h" -#include "gtkdlgs.h" +// menu stuff +#define COUNT_KEY "Count" +#define FILE_KEY "File" +//saved info +#define SI_TEXMENU_KEY "SI_TexMenu" +#define SI_GAMMA_KEY "SI_Gamma" +#define SI_COLORS_KEY "SI_Colors" +#define SI_EXCLUDE_KEY "SI_Exclude" +#define SI_INCLUDE_KEY "SI_Include" +#define SI_SURFACE_TEXDEF_KEY "SI_SurfaceTexdef" +#define SI_PATCH_TEXDEF_KEY "SI_PatchTexdef" +#define SI_AXISCOLORS_KEY "SI_AxisColors" +#define SI_SHOWNAMES_KEY "SI_ShowNames" +#define SI_SHOWCOORDS_KEY "SI_ShowCoords" +#define SI_SHOWANGLES_KEY "SI_ShowAngles" +#define SI_SHOWOUTLINES_KEY "SI_ShowOutlines" +#define SI_SHOWAXIS_KEY "SI_ShowAxis" +#define SI_NOSELOUTLINES_KEY "SI_NoSelectedOutlines" +#define SI_OUTLINESTYLE_KEY "SI_OutLineStyle" +//for texdefs +#define TD_SCALE1_KEY "_Scale1" +#define TD_SCALE2_KEY "_Scale2" +#define TD_SHIFT1_KEY "_Shift1" +#define TD_SHIFT2_KEY "_Shift2" +#define TD_ROTATE_KEY "_Rotate" -void Global_constructPreferences(PreferencesPage& page) +#define MOUSE_DEF 1 +#define WINDOW_DEF 0 +#define RUNQ2_DEF 0 +#define WATCHBSP_DEF 1 +#define TLOCK_DEF 1 +#define LOADLAST_DEF 1 +#define RUN_DEF 0 +#define SUBDIVISIONS_DEF 4 + +void WindowPosition_Parse(window_position_t& m_value, const CString& value) { - page.appendCheckBox("Console", "Enable Logging", g_Console_enableLogging); + if(sscanf(value.GetBuffer(), "%d %d %d %d", &m_value.x, &m_value.y, &m_value.w, &m_value.h) != 4) + m_value.x = m_value.y = m_value.w = m_value.h = -1; } -void Interface_constructPreferences(PreferencesPage& page) +void WindowPosition_Write(const window_position_t& m_value, CString& value) { -#ifdef WIN32 - page.appendCheckBox("", "Default Text Editor", g_TextEditor_useWin32Editor); -#else + char buffer[64]; + sprintf(buffer, "%d %d %d %d", m_value.x, m_value.y, m_value.w, m_value.h); + value = buffer; +} + + +CXMLPropertyBag::CXMLPropertyBag() { + mStrFilename = ""; + mpDoc = NULL; + mbEmpty = false; +} + +// generic preference functions + +void CXMLPropertyBag::PushAssignment(char *name, PrefTypes_t type, void *pV) +{ + list::iterator iAssign; + for(iAssign=mPrefAssignments.begin(); iAssign!=mPrefAssignments.end(); iAssign++) { - GtkWidget* use_custom = page.appendCheckBox("Text Editor", "Custom", g_TextEditor_useCustomEditor); - GtkWidget* custom_editor = page.appendPathEntry("Text Editor Command", g_TextEditor_editorCommand, true); - Widget_connectToggleDependency(custom_editor, use_custom); + if ((*iAssign).mName == name) + { + // we have it already, check anyway + if (pV != (*iAssign).mVal) + { + Sys_FPrintf(SYS_ERR, "PushAssignment, '%s' has different mVal\n", name); + return; + } + } } + // ok, it's not in our list yet + mPrefAssignments.push_front(CPrefAssignment(name, type, pV)); +} + +xmlNodePtr CXMLPropertyBag::EpairForName(const char *name) +{ + xmlNodePtr ret = NULL; + + xmlNodePtr pNode = mpDocNode->children; + while (pNode != NULL) + { + if(pNode->type == XML_ELEMENT_NODE) + { + xmlAttrPtr tmp_attr_ptr = xmlHasProp(pNode, (xmlChar *)"name"); + if (tmp_attr_ptr != NULL && !strcmp(name, (char *)tmp_attr_ptr->children->content)) + { + if ( ret ) { + Sys_FPrintf( SYS_WRN, "WARNING: dupe property in CXMLPropertyBag::EpairForName '%s'\n", name ); + } else { + ret = pNode; + } + } + } + pNode = pNode->next; + } + return ret; +} + +void CXMLPropertyBag::GetPref(char *name, Str *pV, char *V) +{ + xmlNodePtr pNode = EpairForName( name ); + if ( pNode ) + { + if ( pNode->children && pNode->children->content ) { + *pV = pNode->children->content; + } else { + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=427 + // means the pref exists, and that the value is "" + *pV = ""; + } + } + else + { + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)V); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + } + // push the pref assignment if needed + PushAssignment(name, PREF_STR, pV); +} + +void CXMLPropertyBag::GetPref(char *name, int *pV, int V) +{ + xmlNodePtr pNode; + if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) + { + *pV = atoi((char *)pNode->children->content); + } + else + { + char s[10]; + sprintf(s, "%d", V); + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)s); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + *pV=V; + } + // push the pref assignment if needed + PushAssignment(name, PREF_INT, pV); +} + +void CXMLPropertyBag::GetPref(char *name, bool *pV, bool V) +{ + xmlNodePtr pNode; + if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) + { + if (!strcmp((char *)pNode->children->content, "true")) + { + *pV = true; + } + else + { + *pV = false; + } + } + else + { + char s[10]; + V ? strcpy(s, "true") : strcpy(s, "false"); + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)s); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + *pV=V; + } + // push the pref assignment + PushAssignment(name, PREF_BOOL, pV); +} + +void CXMLPropertyBag::GetPref(char *name, float *pV, float V) +{ + xmlNodePtr pNode; + if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) + { + *pV = atof((char *)pNode->children->content); + } + else + { + char s[10]; + sprintf(s, "%f", V); + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)s); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + *pV=V; + } + // push the pref assignment if needed + PushAssignment(name, PREF_FLOAT, pV); +} + +void CXMLPropertyBag::GetPref(char *name, float* pV, float* V) +{ + xmlNodePtr pNode; + if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) + { + sscanf((char *)pNode->children->content, "%f %f %f", &pV[0], &pV[1], &pV[2]); + } + else + { + char s[128]; + sprintf(s, "%f %f %f", V[0], V[1], V[2]); + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)s); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + pV[0] = V[0]; + pV[1] = V[1]; + pV[2] = V[2]; + } + // push the pref assignment if needed + PushAssignment(name, PREF_VEC3, pV); +} + +void CXMLPropertyBag::GetPref(char *name, window_position_t* pV, window_position_t V) +{ + xmlNodePtr pNode; + if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content) + { + WindowPosition_Parse(*pV, CString((xmlChar *)pNode->children->content)); + } + else + { + CString str; + WindowPosition_Write(V, str); + pNode = xmlNewChild(mpDocNode, NULL, (xmlChar *)"epair", (xmlChar *)str.GetBuffer()); + xmlSetProp(pNode, (xmlChar *)"name", (xmlChar *)name); + *pV = V; + } + // push the pref assignment if needed + PushAssignment(name, PREF_WNDPOS, pV); +} + +void CXMLPropertyBag::UpdatePrefTree() +{ + // read the assignments and update the tree + list::iterator iPref; + for(iPref = mPrefAssignments.begin(); iPref != mPrefAssignments.end(); iPref++) + { + CPrefAssignment *pPref = &(*iPref); + // look for the node + xmlNodePtr pNode; + char s[64]; + + pNode = EpairForName(pPref->mName.GetBuffer()); + // we never expect that the node could not be found, because this is supposed to happen + // after the tree was built with GetPref calls, never on a blank tree + if (!pNode) + { + Sys_FPrintf(SYS_ERR, "Unexpected EpairForName '%s' not found in UpdatePrefTree\n", pPref->mName.GetBuffer()); + return; + } + switch ((*iPref).mType) + { + case PREF_STR: + xmlNodeSetContent(pNode, (const xmlChar *)((Str *)pPref->mVal)->GetBuffer()); + break; + case PREF_INT: + sprintf(s, "%d", *(int *)pPref->mVal); + xmlNodeSetContent(pNode, (xmlChar *)s); + break; + case PREF_FLOAT: + sprintf(s, "%f", *(float *)pPref->mVal); + xmlNodeSetContent(pNode, (xmlChar *)s); + break; + case PREF_BOOL: + *(bool *)pPref->mVal ? strcpy(s, "true") : strcpy(s, "false"); + xmlNodeSetContent(pNode, (xmlChar *)s); + break; + case PREF_VEC3: + { + float* v = (float*)pPref->mVal; + sprintf(s, "%f %f %f", v[0], v[1], v[2]); + xmlNodeSetContent(pNode, (xmlChar *)s); + } + break; + case PREF_WNDPOS: + { + CString str; + WindowPosition_Write(*(window_position_t*)pPref->mVal, str); + xmlNodeSetContent(pNode, (xmlChar*)str.GetBuffer()); + } + break; + } + } +} + +void CXMLPropertyBag::Clear() +{ + if(!InUse()) + return; + + xmlFreeDoc(mpDoc); + mpDoc = NULL; + mpDocNode = NULL; + mbEmpty = false; +} + +void CXMLPropertyBag::ReadXMLFile(const char* pFilename) +{ + mpDoc = xmlParseFile(pFilename); + + // basic checks + if (mpDoc) + { + mpDocNode = mpDoc->children; + xmlAttrPtr tmp_attr_ptr = xmlHasProp(mpDocNode, (xmlChar *)"version"); + if (strcmp((char *)mpDocNode->name, "qpref")) + { + Sys_FPrintf(SYS_ERR, "Unrecognized node '%s' in '%s'\n", mpDocNode->name, mpDoc->URL); + xmlFreeDoc(mpDoc); + mpDoc = NULL; + } + else if (tmp_attr_ptr != NULL && strcmp((char*)tmp_attr_ptr->children->content, "1")) + { + Sys_FPrintf(SYS_ERR, "Wrong version '%s' in node for '%s'\n", (char*)tmp_attr_ptr->children->content, mpDoc->URL); + xmlFreeDoc(mpDoc); + mpDoc = NULL; + } + Sys_Printf("Opened XML property file: '%s'\n", pFilename); + } + + if (!mpDoc) + { + mbEmpty = true; + // no document, create one + mpDoc = xmlNewDoc((xmlChar *)"1.0"); + mpDocNode = xmlNewDocNode(mpDoc, NULL, (xmlChar *)"qpref", NULL); + xmlDocSetRootElement(mpDoc, mpDocNode); + xmlSetProp(mpDocNode, (xmlChar *)"version", (xmlChar *)"1"); + Sys_Printf("XML property file '%s' invalid/not found, creating blank properties tree\n", pFilename); + } +} + +qboolean CXMLPropertyBag::WriteXMLFile(const char* pFilename) +{ + int res = xmlSaveFormatFile(pFilename, mpDoc, 1); + + if(res == -1) + return false; + + Sys_Printf("Wrote XML property file '%s'\n", pFilename); + return true; +} + +// ============================================================================= +// Widget callbacks for PrefsDlg + +#if !defined(WIN32) +// browse for custom editor executable +static void OnBtnBrowseEditor (GtkWidget *widget, gpointer data) +{ + PrefsDlg *dlg = (PrefsDlg*)data; + + const char *filename = file_dialog(g_PrefsDlg.GetWidget(), TRUE, "Executable for Custom Editor"); + + if(filename != NULL) + { + dlg->m_strEditorCommand = filename; + dlg->UpdateData(FALSE); + } +} +#endif + +static void OnBtnBrowseprefab (GtkWidget *widget, gpointer data) +{ + PrefsDlg *dlg = (PrefsDlg*)data; + char *path = dlg->m_strPrefabPath; + if (strlen (path) == 0) + path = g_strGameToolsPath; + char *dir = dir_dialog (g_PrefsDlg.GetWidget (), "Set prefab path", path); + dlg->UpdateData(TRUE); + + if (dir != NULL) + { + CString strPath; + strPath = dir; + AddSlash(strPath); + dlg->m_strPrefabPath = strPath; + dlg->UpdateData(FALSE); + free (dir); + } +} + +static void OnBtnBrowseuserini (GtkWidget *widget, gpointer data) +{ + PrefsDlg *dlg = (PrefsDlg*)data; + char *path = dlg->m_strUserPath; + if (strlen (path) == 0) + path = g_strGameToolsPath; + // TODO: INI filter? + const char *filename = file_dialog (g_PrefsDlg.GetWidget(), TRUE, "Find INI file", path); + + if (filename != NULL) + { + dlg->UpdateData(TRUE); + dlg->m_strUserPath = filename; + dlg->UpdateData(FALSE); + } +} + +static void OnButtonClean (GtkWidget *widget, gpointer data) +{ + // make sure this is what the user wants + if (gtk_MessageBox (g_PrefsDlg.GetWidget (), "This will close Radiant and clean the corresponding registry entries.\n" + "Next time you start Radiant it will be good as new. Do you wish to continue?", + "Reset Registry", MB_YESNO) == IDYES) + { + PrefsDlg *dlg = (PrefsDlg*)data; + dlg->EndModal (IDCANCEL); + + g_qeglobals.disable_ini = true; + remove (dlg->m_inipath->str); + char buf[PATH_MAX]; + sprintf(buf, "%sSavedInfo.bin", dlg->m_rc_path->str); + remove(buf); + HandleCommand (NULL, GINT_TO_POINTER (ID_FILE_EXIT)); + _exit (0); + } +} + +// ============================================================================= +// PrefsDlg class + +// IMPORTANT NOTE: the values here don't matter very much +// the actual intialization if you start with an empty .ini is done when loading the prefs for the first time +// profile_load_int takes an argument to use if the value is not found +PrefsDlg::PrefsDlg () +{ + m_bWarn = TRUE; + m_nMouse = 1; + m_nView = MainFrame::eRegular; + m_bLoadLast = FALSE; + m_bInternalBSP = FALSE; + m_bRightClick = FALSE; + m_bSetGame = FALSE; + m_bAutoSave = TRUE; + m_nAutoSave = 5; + m_bLoadLastMap = FALSE; + m_bTextureWindow = FALSE; + m_bSnapShots = FALSE; + m_fTinySize = 0.5; + m_bCleanTiny = FALSE; + m_bCamXYUpdate = TRUE; + m_bCamDragMultiSelect = FALSE; + m_bCamFreeLook = TRUE; + m_bCamFreeLookStrafe = FALSE; + m_bCamInverseMouse = FALSE; + m_bCamDiscrete = TRUE; + m_bNewLightDraw = FALSE; + m_strPrefabPath = ""; + m_nWhatGame = 0; + m_bALTEdge = FALSE; + m_bFaceColors = FALSE; + m_bXZVis = FALSE; + m_bYZVis = FALSE; + m_bZVis = FALSE; + m_bSizePaint = FALSE; + m_bDLLEntities = FALSE; +#ifdef _WIN32 + m_bDetachableMenus = FALSE; // Most win32 users will find detachable menus annoying +#else + m_bDetachableMenus = TRUE; // Linux/Apple users are used to them... +#endif + m_bPatchToolbar = TRUE; + m_bWideToolbar = TRUE; + m_bPluginToolbar = TRUE; + m_bNoClamp = FALSE; + m_strUserPath = ""; + m_nRotation = 0; + m_bChaseMouse = FALSE; + m_bTextureScrollbar = TRUE; + m_bDisplayLists = TRUE; + m_bAntialiasedPointsAndLines = FALSE; // Fishman - Add antialiazed points and lines support. 09/03/00 + m_bShowShaders = FALSE; + m_nShader = -1; + m_bNoStipple = FALSE; + m_bVertexSplit = FALSE; + m_bSelectCurves = TRUE; + m_bSelectModels = TRUE; + m_nEntityShowState = ENTITY_SKINNED_BOXED; + m_nTextureScale = 2; + m_bSwitchClip = FALSE; + m_bSelectWholeEntities = TRUE; + m_nTextureQuality = 3; + m_bShowShaders = TRUE; + m_bGLLighting = FALSE; + m_nShader = 0; + m_nUndoLevels = 30; + m_bTexturesShaderlistOnly = FALSE; + // paths to ini files + m_rc_path = NULL; + m_inipath = NULL; + m_bWatchBSP = TRUE; + m_bLeakStop = TRUE; + m_iTimeout = 15; + m_bRunQuake = TRUE; + m_bDoSleep = FALSE; + m_nSubdivisions = 4; + // not prefs + m_bFloatingZ = FALSE; + m_bGlPtWorkaround = FALSE; // Gef: Kyro/GL_POINTS workaround 25-aug-2001 +#ifdef _WIN32 + m_bNativeGUI = FALSE; + m_bStartOnPrimMon = FALSE; +#endif + m_global_rc_path = NULL; +#ifdef _WIN32 + m_bUseWin32Editor = TRUE; +#else + // custom shader editor options + m_bUseCustomEditor = FALSE; + m_strEditorCommand = ""; +#endif + m_nLightRadiuses = 1; + m_bQ3Map2Texturing = TRUE; +#ifdef ATIHACK_812 + m_bGlATIHack = FALSE; #endif } -void Mouse_constructPreferences(PreferencesPage& page) -{ - { - const char* buttons[] = { "2 button", "3 button", }; - page.appendRadio("Mouse Type", g_glwindow_globals.m_nMouseType, STRING_ARRAY_RANGE(buttons)); - } - page.appendCheckBox("Right Button", "Activates Context Menu", g_xywindow_globals.m_bRightClick); -} -void Mouse_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Mouse", "Mouse Preferences")); - Mouse_constructPreferences(page); -} -void Mouse_registerPreferencesPage() -{ - PreferencesDialog_addInterfacePage(FreeCaller1()); -} - - /*! ========================================================= Games selection dialog ========================================================= */ -#include - -inline const char* xmlAttr_getName(xmlAttrPtr attr) -{ - return reinterpret_cast(attr->name); -} - -inline const char* xmlAttr_getValue(xmlAttrPtr attr) -{ - return reinterpret_cast(attr->children->content); -} - -CGameDescription::CGameDescription(xmlDocPtr pDoc, const CopiedString& gameFile) +CGameDescription::CGameDescription(xmlDocPtr pDoc, const Str &GameFile) { + char *p, *prop; + mpDoc = pDoc; // read the user-friendly game name - xmlNodePtr pNode = pDoc->children; + xmlNodePtr pNode = mpDoc->children; - while (strcmp((const char*)pNode->name, "game") && pNode != 0) - { - pNode=pNode->next; - } + while (strcmp((const char*)pNode->name, "game") && pNode != NULL) pNode=pNode->next; if (!pNode) { + ///< \todo add the file name (this node and gametools should all be part of CGameDescription anyway) Error("Didn't find 'game' node in the game description file '%s'\n", pDoc->URL); } - - for(xmlAttrPtr attr = pNode->properties; attr != 0; attr = attr->next) - { - m_gameDescription.insert(GameDescription::value_type(xmlAttr_getName(attr), xmlAttr_getValue(attr))); + // on win32, game tools path can now be specified relative to the exe's cwd + prop = (char*)xmlGetProp( pNode, (xmlChar*)"gametools" ); + if ( prop == NULL ) { + Error( "Didn't find 'gametools' node in the game description file '%s'\n", pDoc->URL ); } - { - StringOutputStream path(256); - path << AppPath_get() << gameFile.c_str() << "/"; - mGameToolsPath = path.c_str(); - } - - ASSERT_MESSAGE(file_exists(mGameToolsPath.c_str()), "game directory not found: " << makeQuoted(mGameToolsPath.c_str())); - - mGameFile = gameFile; - - { - GameDescription::iterator i = m_gameDescription.find("type"); - if(i == m_gameDescription.end()) - { - globalErrorStream() << "Warning, 'type' attribute not found in '" << reinterpret_cast(pDoc->URL) << "'\n"; - // default - mGameType = "q3"; - } - else - { - mGameType = (*i).second.c_str(); + char full[PATH_MAX]; +#ifdef _WIN32 + _fullpath( full, prop, PATH_MAX ); +#else + strncpy( full, prop, PATH_MAX ); +#endif + xmlFree( prop ); + prop = NULL; + for ( p = full; *p != '\0'; p++ ) { + if ( *p == '\\' ) { + *p = '/'; + } + mGameToolsPath = full; + if ( p != full && *(p-1) != '/' ) { + mGameToolsPath += "/"; + } } } + + prop = (char*)xmlGetProp(pNode, (xmlChar*)"name"); + if (prop == NULL) + { + Sys_FPrintf(SYS_WRN, "Warning, 'name' attribute not found in '%s'\n", pDoc->URL); + mGameName = pDoc->URL; + } + else + { + mGameName = prop; + xmlFree(prop); + } + + mGameFile = GameFile; + + prop = (char*)xmlGetProp(pNode, (xmlChar*)"quake2"); + if (prop == NULL) + { + // default + quake2 = false; + } + else + { + quake2 = true; + xmlFree(prop); + } + + prop = (char*)xmlGetProp(pNode, (xmlChar*)"basegame"); + if (prop == NULL) + { + // default + mBaseGame = "baseq3"; + } + else + { + mBaseGame = prop; + xmlFree(prop); + } + + // on win32, engine path can now be specified relative to the exe's cwd + prop = (char*)xmlGetProp(pNode, (const xmlChar *)"enginepath"); + if ( prop != NULL ) { + char full[PATH_MAX]; +#ifdef _WIN32 + _fullpath( full, prop, PATH_MAX ); +#else + strncpy( full, prop, PATH_MAX ); +#endif + xmlFree( prop ); + prop = NULL; + // process seperators + for ( p = full; *p != '\0'; p++ ) { + if ( *p == '\\' ) { + *p = '/'; + } + } + mEnginePath = full; + if ( p != full && *(p-1) != '/' ) { + mEnginePath += "/"; + } + } + else + { + // if engine path was not specified in the .game, it implies we can guess it from the gametools path + // on win32, and for most game package, the gametools are installed with the game + char aux_path[PATH_MAX]; // aux + strcpy( aux_path, mGameToolsPath.GetBuffer() ); + if ( ( aux_path[ strlen(aux_path)-1 ] == '/' ) || ( aux_path[ strlen(aux_path)-1 ] == '\\' ) ) { + aux_path[strlen(aux_path)-1] = '\0'; // strip ending '/' if any + } + char up_path[PATH_MAX]; // up one level + ExtractFilePath( aux_path, up_path ); + mEnginePath = up_path; + } + + prop = (char*)xmlGetProp(pNode, (xmlChar*)"engine"); + if (prop == NULL) + { +#ifdef _WIN32 + mEngine = "quake3.exe"; +#elif __linux__ + mEngine = "quake3"; +#elif __APPLE__ + mEngine = "Quake3.app"; +#endif + } + else + { + mEngine = prop; + xmlFree(prop); + } + +#if defined (__linux__) || defined (__APPLE__) + // *nix specific + prop = (char*)xmlGetProp(pNode, (const xmlChar *)"prefix"); + if(prop != NULL) + { + mUserPathPrefix = prop; + xmlFree(prop); + } +#endif + mShaderPath = xmlGetProp(pNode, (const xmlChar *)"shaderpath"); + if (!mShaderPath.GetLength()) + { + mShaderPath = "scripts/"; + mShaderlist = "scripts/shaderlist.txt"; + } + else + { + AddSlash(mShaderPath); + mShaderlist = mShaderPath; + mShaderlist += "shaderlist.txt"; + } + xmlChar* default_scale = xmlGetProp(pNode, (const xmlChar *)"default_scale"); + if (default_scale) + { + mTextureDefaultScale = atof((const char *)default_scale); + xmlFree(default_scale); + } + else + mTextureDefaultScale = 0.5f; + xmlChar* eclass_singleload = xmlGetProp(pNode, (const xmlChar*)"eclass_singleload"); + if (eclass_singleload) + { + mEClassSingleLoad = true; + xmlFree(eclass_singleload); + } + else + mEClassSingleLoad = false; + xmlChar* no_patch = xmlGetProp(pNode, (const xmlChar *)"no_patch"); + if (no_patch) + { + mNoPatch = true; + xmlFree(no_patch); + } + else + mNoPatch = false; + xmlChar* caulk_shader = xmlGetProp(pNode, (const xmlChar *)"caulk_shader"); + if (caulk_shader) + { + mCaulkShader = caulk_shader; + xmlFree(caulk_shader); + } + else + mCaulkShader = "textures/common/caulk"; } void CGameDescription::Dump() { - globalOutputStream() << "game description file: " << makeQuoted(mGameFile.c_str()) << "\n"; - for(GameDescription::iterator i = m_gameDescription.begin(); i != m_gameDescription.end(); ++i) +#ifdef _WIN32 + if (CGameDialog::GetNetrun()) + Sys_Printf("Running in network mode, prefs path set to '%s'\n", g_strTempPath.GetBuffer()); +#endif + Sys_Printf("game name : '%s'\n", mGameName.GetBuffer()); + Sys_Printf("game file : '%s'\n", mGameFile.GetBuffer()); + Sys_Printf("game path : '%s'\n", mGameToolsPath.GetBuffer()); + Sys_Printf("base game : '%s'\n", mBaseGame.GetBuffer()); + Sys_Printf("engine path : '%s'\n", mEnginePath.GetBuffer()); + Sys_Printf("engine : '%s'\n", mEngine.GetBuffer()); + Sys_Printf("shaderlist : '%s'\n", mShaderlist.GetBuffer()); + Sys_Printf("caulk shader: '%s'\n", mCaulkShader.GetBuffer()); +#if defined (__linux__) || defined (__APPLE__) + Sys_Printf("prefix : '%s'\n", mUserPathPrefix.GetBuffer()); +#endif + Sys_Printf("default texture scale: %g\n", mTextureDefaultScale); + Sys_Printf("single eclass load : %s\n", mEClassSingleLoad ? "Yes" : "No"); + Sys_Printf("patches supported : %s\n", mNoPatch ? "No" : "Yes"); +} + +CPrefAssignment& CPrefAssignment::operator = (const CPrefAssignment& ass) +{ + if (&ass != this) { - globalOutputStream() << (*i).first.c_str() << " = " << makeQuoted((*i).second.c_str()) << "\n"; + mName = ass.mName; + mType = ass.mType; + mVal = ass.mVal; } + return *this; } -CGameDescription *g_pGameDescription; ///< shortcut to g_GamesDialog.m_pCurrentDescription - - -#include "warnings.h" -#include "stream/textfilestream.h" -#include "container/array.h" -#include "xml/ixml.h" -#include "xml/xmlparser.h" -#include "xml/xmlwriter.h" - -#include "preferencedictionary.h" -#include "stringio.h" - -const char* const PREFERENCES_VERSION = "1.0"; - -bool Preferences_Load(PreferenceDictionary& preferences, const char* filename) +CPrefAssignment::CPrefAssignment(const CPrefAssignment& ass) { - TextFileInputStream file(filename); - if(!file.failed()) - { - XMLStreamParser parser(file); - XMLPreferenceDictionaryImporter importer(preferences, PREFERENCES_VERSION); - parser.exportXML(importer); - return true; - } - return false; -} - -bool Preferences_Save(PreferenceDictionary& preferences, const char* filename) -{ - TextFileOutputStream file(filename); - if(!file.failed()) - { - XMLStreamWriter writer(file); - XMLPreferenceDictionaryExporter exporter(preferences, PREFERENCES_VERSION); - exporter.exportXML(writer); - return true; - } - return false; -} - -bool Preferences_Save_Safe(PreferenceDictionary& preferences, const char* filename) -{ - Array tmpName(filename, filename + strlen(filename) + 1 + 3); - *(tmpName.end() - 4) = 'T'; - *(tmpName.end() - 3) = 'M'; - *(tmpName.end() - 2) = 'P'; - *(tmpName.end() - 1) = '\0'; - - return Preferences_Save(preferences, tmpName.data()) - && (!file_exists(filename) || file_remove(filename)) - && file_move(tmpName.data(), filename); -} - - - -void LogConsole_importString(const char* string) -{ - g_Console_enableLogging = string_equal(string, "true"); - Sys_LogFile(g_Console_enableLogging); -} -typedef FreeCaller1 LogConsoleImportStringCaller; - - -void RegisterGlobalPreferences(PreferenceSystem& preferences) -{ - preferences.registerPreference("gamefile", CopiedStringImportStringCaller(g_GamesDialog.m_sGameFile), CopiedStringExportStringCaller(g_GamesDialog.m_sGameFile)); - preferences.registerPreference("gamePrompt", BoolImportStringCaller(g_GamesDialog.m_bGamePrompt), BoolExportStringCaller(g_GamesDialog.m_bGamePrompt)); - preferences.registerPreference("log console", LogConsoleImportStringCaller(), BoolExportStringCaller(g_Console_enableLogging)); -} - - -PreferenceDictionary g_global_preferences; - -void GlobalPreferences_Init() -{ - RegisterGlobalPreferences(g_global_preferences); + *this = ass; } void CGameDialog::LoadPrefs() { - // load global .pref file - StringOutputStream strGlobalPref(256); - strGlobalPref << g_Preferences.m_global_rc_path->str << "global.pref"; + bool bEmpty = false; - globalOutputStream() << "loading global preferences from " << makeQuoted(strGlobalPref.c_str()) << "\n"; - - if(!Preferences_Load(g_global_preferences, strGlobalPref.c_str())) + // if we already have a document loaded, we will free and reload from file + if (mGlobalPrefs.InUse()) { - globalOutputStream() << "failed to load global preferences from " << strGlobalPref.c_str() << "\n"; + Sys_Printf("Reloading global prefs from file\n"); + mGlobalPrefs.Clear(); + } + + // load global .pref file + CString strGlobalPref = g_PrefsDlg.m_global_rc_path->str; + strGlobalPref += "global.pref"; + + mGlobalPrefs.ReadXMLFile(strGlobalPref.GetBuffer()); + + mGlobalPrefs.GetPref("gamefile", &m_sGameFile, ""); // NOTE: there's no default, user HAS to select something + mGlobalPrefs.GetPref("autoload", &m_bAutoLoadGame, false); + mGlobalPrefs.GetPref("log console", &m_bLogConsole, false); + // in a very particular post-.pid startup + // we may have the console turned on and want to keep it that way + // so we use a latching system + if (m_bForceLogConsole) + { + m_bLogConsole = true; + Sys_Printf("console logging has been latched on, saving prefs\n"); + SavePrefs(); + m_bForceLogConsole = false; + } + + // console logging: call Sys_LogConsole to check console logging status + // it is important that we would log console as early as possible to make it useful + Sys_LogFile(); + + if (mGlobalPrefs.mbEmpty) + { + Sys_Printf("Saving global.pref with default pref values\n"); + SavePrefs(); } } void CGameDialog::SavePrefs() { - StringOutputStream strGlobalPref(256); - strGlobalPref << g_Preferences.m_global_rc_path->str << "global.pref"; - - globalOutputStream() << "saving global preferences to " << strGlobalPref.c_str() << "\n"; - - if(!Preferences_Save_Safe(g_global_preferences, strGlobalPref.c_str())) - { - globalOutputStream() << "failed to save global preferences to " << strGlobalPref.c_str() << "\n"; + // update the tree and save it + mGlobalPrefs.UpdatePrefTree(); + + CString strGlobalPref = g_PrefsDlg.m_global_rc_path->str; + strGlobalPref += "global.pref"; + + if ( !mGlobalPrefs.WriteXMLFile( strGlobalPref.GetBuffer() ) ) { + Sys_FPrintf(SYS_ERR, "Error occured while saving global prefs file '%s'\n", strGlobalPref.GetBuffer()); } } -void CGameDialog::DoGameDialog() -{ - // show the UI - DoModal(); - - // we save the prefs file - SavePrefs(); +void CGameDialog::DoGameInstall() { + // make sure console logging is on whenever we enter the installation loop + g_PrefsDlg.mGamesDialog.m_bLogConsole = true; + Sys_LogFile(); + mGameInstall.Run(); } -void CGameDialog::GameFileImport(int value) +void CGameDialog::DoGameDialog() { + // allow looping the game selection dialog with calls to the game configure dialog in between + while ( m_bDoGameInstall ) { + + m_bDoGameInstall = false; + + if ( DoModal() == IDCANCEL ) { + Error( "game selection dialog canceled, cannot continue" ); + return; + } + + if ( m_bDoGameInstall ) { + DoGameInstall(); + ScanForGames(); + // and we will loop to do another DoModal dialog + } + } + + // unhook so we can use in other places + // we manually incref'ed it when creating, it won't be freed (destructor) + gtk_container_remove( GTK_CONTAINER( mTopBox ), GetGlobalFrame() ); + + // we save the prefs file + SavePrefs(); +} + +GtkWidget* CGameDialog::GetGlobalFrame() { - m_nComboSelect = value; - // use value to set m_sGameFile - std::list::iterator iGame = mGames.begin(); - int i; - for(i=0; imGameFile; + + mFrame = gtk_frame_new( NULL ); + gtk_container_set_border_width( GTK_CONTAINER( mFrame ), 5 ); + gtk_widget_show( mFrame ); + + vbox = gtk_vbox_new( FALSE, 6 ); + gtk_widget_show( vbox ); + gtk_container_add( GTK_CONTAINER( mFrame ), vbox ); + gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); + + text = gtk_label_new( "Select the game:" ); + gtk_widget_show( text ); + gtk_box_pack_start( GTK_BOX( vbox ), text, FALSE, FALSE, 0 ); + + combo = gtk_combo_box_new_text(); + gtk_widget_show( combo ); + gtk_box_pack_start( GTK_BOX( vbox ), combo, FALSE, FALSE, 0 ); + AddDialogData( combo, &m_nComboSelect, DLG_COMBO_BOX_INT ); + mGameCombo = GTK_COMBO_BOX( combo ); + + UpdateGameCombo(); + + check = gtk_check_button_new_with_label( "Auto load selected game on startup" ); + gtk_widget_show(check); + gtk_box_pack_start (GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bAutoLoadGame, DLG_CHECK_BOOL); + + text = gtk_label_new("(this frame is available in the prefs menu if you set auto-select)"); + gtk_widget_show(text); + gtk_box_pack_start (GTK_BOX(vbox), text, FALSE, FALSE, 0); + +#ifdef _WIN32 + check = gtk_check_button_new_with_label( "Networked install - per-user settings" ); + gtk_widget_show( check ); + gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); + AddDialogData( check, &m_bNetRun, DLG_CHECK_BOOL ); +#endif + + check = gtk_check_button_new_with_label( "Log the console to radiant.log" ); + gtk_widget_show( check ); + gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); + AddDialogData( check, &m_bLogConsole, DLG_CHECK_BOOL ); + + // incref it so we can pass it around + gtk_widget_ref( GTK_WIDGET( mFrame ) ); + + return mFrame; } -void CGameDialog::GameFileExport(const IntImportCallback& importCallback) const -{ - // use m_sGameFile to set value - std::list::const_iterator iGame; - int i = 0; - for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame) +void CGameDialog::UpdateData( bool retrieve ) { + if (!retrieve) { - if ((*iGame)->mGameFile == m_sGameFile) + // use m_sGameFile to set m_nComboSelect + list::iterator iGame; + int i = 0; + for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++) { - m_nComboSelect = i; - break; + if ((*iGame)->mGameFile == m_sGameFile) + { + m_nComboSelect = i; + break; + } + i++; } - i++; +#ifdef _WIN32 + UpdateNetrun(false); +#endif } - importCallback(m_nComboSelect); -} - -void CGameDialog_GameFileImport(CGameDialog& self, int value) -{ - self.GameFileImport(value); -} - -void CGameDialog_GameFileExport(CGameDialog& self, const IntImportCallback& importCallback) -{ - self.GameFileExport(importCallback); -} - -void CGameDialog::CreateGlobalFrame(PreferencesPage& page) -{ - std::vector games; - games.reserve(mGames.size()); - for(std::list::iterator i = mGames.begin(); i != mGames.end(); ++i) + Dialog::UpdateData(retrieve); + if (retrieve) { - games.push_back((*i)->getRequiredKeyValue("name")); - } - page.appendCombo( - "Select the game", - StringArrayRange(&(*games.begin()), &(*games.end())), - ReferenceCaller1(*this), - ReferenceCaller1(*this) - ); - page.appendCheckBox("Startup", "Show Global Preferences", m_bGamePrompt); -} - -GtkWindow* CGameDialog::BuildDialog() -{ - GtkFrame* frame = create_dialog_frame("Game settings", GTK_SHADOW_ETCHED_IN); - - GtkVBox* vbox2 = create_dialog_vbox(0, 4); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox2)); - - { - PreferencesPage preferencesPage(*this, GTK_WIDGET(vbox2)); - Global_constructPreferences(preferencesPage); - CreateGlobalFrame(preferencesPage); - } - - return create_simple_modal_dialog_window("Global Preferences", m_modal, GTK_WIDGET(frame)); -} - -class LoadGameFile -{ - std::list& mGames; - const char* mPath; -public: - LoadGameFile(std::list& games, const char* path) : mGames(games), mPath(path) - { - } - void operator()(const char* name) const - { - if(!extension_equal(path_get_extension(name), "game")) + // use m_nComboSelect to set m_sGameFile + list::iterator iGame = mGames.begin(); + int i; + for(i=0; imGameFile; +#ifdef _WIN32 + UpdateNetrun(true); +#endif } -}; +} + +void CGameDialog::SInstallCallback( GtkWidget *widget, gpointer data ) { + CGameDialog *d = static_cast< CGameDialog* >( data ); + d->m_bDoGameInstall = true; + d->EndModal( 0 ); +} + +void CGameDialog::BuildDialog() { + GtkWidget *dlg, *vbox1, *button, *setup_button; + + dlg = m_pWidget; + gtk_window_set_title( GTK_WINDOW( dlg ), "Select Game" ); + + vbox1 = gtk_vbox_new( FALSE, 0 ); + gtk_widget_show( vbox1 ); + gtk_container_add( GTK_CONTAINER( dlg ), vbox1 ); + + gtk_container_add( GTK_CONTAINER( vbox1 ), GetGlobalFrame() ); + mTopBox = vbox1; + + setup_button = gtk_button_new_with_label( "Configure more games" ); + gtk_widget_show( setup_button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked", + GTK_SIGNAL_FUNC( SInstallCallback ), this ); + + button = gtk_button_new_with_label( "OK" ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); + AddModalButton( button, IDOK ); + + button = gtk_button_new_with_label( "Cancel" ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); + AddModalButton( button, IDCANCEL ); + + gtk_widget_set_usize( button, 60, -2 ); +} + +void CGameDialog::UpdateGameCombo() { + // fill in with the game descriptions + list::iterator iGame; + + if ( mGameCombo == NULL ) { + Sys_Printf( "mGameCombo == NULL\n" ); + return; + } + + // clear whatever is in - wtf no way to know how many text entries? + // use set/get active to track + gtk_combo_box_set_active( mGameCombo, 0 ); + while ( gtk_combo_box_get_active( mGameCombo ) == 0 ) { + gtk_combo_box_remove_text( mGameCombo, 0 ); + gtk_combo_box_set_active( mGameCombo, 0 ); + } + + for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { + gtk_combo_box_append_text( mGameCombo, (*iGame)->mGameName.GetBuffer() ); + } + gtk_combo_box_set_active( mGameCombo, 0 ); +} void CGameDialog::ScanForGames() { - StringOutputStream strGamesPath(256); - strGamesPath << AppPath_get() << "games/"; - const char *path = strGamesPath.c_str(); + CString strPath; + char *dirlist; + GDir *dir; + CString strGamesPath = g_strAppPath.GetBuffer(); + strGamesPath += "games"; + const char *path = strGamesPath.GetBuffer(); - globalOutputStream() << "Scanning for game description files: " << path << '\n'; + if ( !mGames.empty() ) { + Sys_Printf( "Clearing game list\n" ); + list::iterator iGame; + for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { + delete (*iGame); + } + mGames.clear(); + } + + Sys_Printf( "Scanning for game description files: %s\n", path ); /*! \todo FIXME LINUX: - do we put game description files below AppPath, or in ~/.radiant + do we put game description files below g_strAppPath, or in ~/.radiant i.e. read only or read/write? my guess .. readonly cause it's an install we will probably want to add ~/.radiant//games/ scanning on top of that for developers (if that's really needed) */ - Directory_forEach(path, LoadGameFile(mGames, path)); + // FIXME need to catch the 'no game description' situation and exit with a clean error + + dir = g_dir_open(path, 0, NULL); + + if (dir != NULL) + { + while (1) + { + const gchar* name = g_dir_read_name(dir); + if(name == NULL) + break; + + dirlist = g_strdup(name); +#ifdef _WIN32 + strlwr (dirlist); +#endif + char *ext = strrchr (dirlist, '.'); + if ((ext == NULL) || (strcmp (ext, ".game") != 0)) + continue; + strPath.Format("%s/%s", path, dirlist); + Sys_Printf("%s\n", strPath.GetBuffer()); + // got one, load it + xmlDocPtr pDoc = xmlParseFile(strPath.GetBuffer()); + if (pDoc) + { + mGames.push_front( new CGameDescription( pDoc, dirlist ) ); + } + else + { + Sys_FPrintf(SYS_ERR, "XML parser failed on '%s'\n", strPath.GetBuffer()); + } + + g_free( dirlist ); + } + g_dir_close( dir ); + } + + // entries in the combo need to be updated + UpdateGameCombo(); } CGameDescription* CGameDialog::GameDescriptionForComboItem() { - std::list::iterator iGame; + list::iterator iGame; int i=0; - for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame,i++) - { - if (i == m_nComboSelect) - { + for( iGame = mGames.begin(); iGame != mGames.end(); iGame++,i++ ) { + if ( i == m_nComboSelect ) { return (*iGame); } } - return 0; // not found + return NULL; // not found } void CGameDialog::InitGlobalPrefPath() { - g_Preferences.m_global_rc_path = g_string_new(SettingsPath_get()); + GString *global_rc_path; + // configure m_global_rc_path + // this is the g_strTempPath, and it has already been mkdir'ed + global_rc_path = g_string_new(g_strTempPath.GetBuffer()); + g_PrefsDlg.m_global_rc_path = global_rc_path; } void CGameDialog::Reset() { - if (!g_Preferences.m_global_rc_path) + if (!g_PrefsDlg.m_global_rc_path) InitGlobalPrefPath(); - StringOutputStream strGlobalPref(256); - strGlobalPref << g_Preferences.m_global_rc_path->str << "global.pref"; - file_remove(strGlobalPref.c_str()); + CString strGlobalPref = g_PrefsDlg.m_global_rc_path->str; + strGlobalPref += "global.pref"; + remove(strGlobalPref.GetBuffer()); } void CGameDialog::Init() { InitGlobalPrefPath(); - LoadPrefs(); ScanForGames(); - if (mGames.empty()) - { - Error("Didn't find any valid game file descriptions, aborting\n"); + if ( mGames.empty() ) { + DoGameInstall(); + ScanForGames(); + if ( mGames.empty() ) { + Error( "No games setup, aborting\n" ); + } } - - CGameDescription* currentGameDescription = 0; - - if (!m_bGamePrompt) - { + LoadPrefs(); + if ( m_bAutoLoadGame ) { // search by .game name - std::list::iterator iGame; - for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame) + list::iterator iGame; + for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++) { if ((*iGame)->mGameFile == m_sGameFile) { - currentGameDescription = (*iGame); + m_pCurrentGameDescription = (*iGame); break; } } } - if (m_bGamePrompt || !currentGameDescription) - { - Create(); + if ( !m_bAutoLoadGame || !m_pCurrentGameDescription ) { DoGameDialog(); // use m_nComboSelect to identify the game to run as and set the globals - currentGameDescription = GameDescriptionForComboItem(); - ASSERT_NOTNULL(currentGameDescription); + m_pCurrentGameDescription = GameDescriptionForComboItem(); + if ( !m_pCurrentGameDescription ) { + Error("Lookup of game description object failed, can't continue\n"); + } } - g_pGameDescription = currentGameDescription; + g_pGameDescription = m_pCurrentGameDescription; + g_strGameToolsPath = g_pGameDescription->mGameToolsPath; + + // NOTE TTimo: this is moved from QE_LoadProject in 1.2 + // (probably broken) + // NOTE Hydra: was broken for win32, we don't use m_strHomeGame or m_strFSBasePath +#if defined (__linux__) || defined (__APPLE__) + g_qeglobals.m_strHomeGame = g_get_home_dir(); + g_qeglobals.m_strHomeGame += "/"; + g_qeglobals.m_strHomeGame += m_pCurrentGameDescription->mUserPathPrefix.GetBuffer(); + g_qeglobals.m_strHomeGame += "/"; +#else + g_qeglobals.m_strHomeGame = g_pGameDescription->mEnginePath.GetBuffer(); +#endif + g_pGameDescription->Dump(); } CGameDialog::~CGameDialog() { + if (mFrame) + { + // NOTE I'm not too sure how reliable this is + gtk_widget_unref(GTK_WIDGET(mFrame)); + } // free all the game descriptions - std::list::iterator iGame; - for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame) + list::iterator iGame; + for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++) { delete (*iGame); - *iGame = 0; - } - if(GetWidget() != 0) - { - Destroy(); + *iGame = NULL; } } -inline const char* GameDescription_getIdentifier(const CGameDescription& gameDescription) -{ - const char* identifier = gameDescription.getKeyValue("index"); - if(string_empty(identifier)) - { - identifier = "1"; - } - return identifier; -} - -void CGameDialog::AddPacksURL(StringOutputStream &URL) +void CGameDialog::AddPacksURL(Str &URL) { // add the URLs for the list of game packs installed // FIXME: this is kinda hardcoded for now.. - std::list::iterator iGame; - for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame) - { - URL << "&Games_dlup%5B%5D=" << GameDescription_getIdentifier(*(*iGame)); + list::iterator iGame; + for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++) + { + if ((*iGame)->mGameFile == "q3.game") + URL += "&Games_dlup%5B%5D=1"; + else if ((*iGame)->mGameFile == "wolf.game") + URL += "&Games_dlup%5B%5D=2"; + else if ((*iGame)->mGameFile == "wolf.game") + URL += "&Games_dlup%5B%5D=3"; + else if ((*iGame)->mGameFile == "jk2.game") + URL += "&Games_dlup%5B%5D=4"; + else if ((*iGame)->mGameFile == "stvef.game") + URL += "&Games_dlup%5B%5D=5"; + else if ((*iGame)->mGameFile == "sof2.game") + URL += "&Games_dlup%5B%5D=6"; + else if ((*iGame)->mGameFile == "ja.game") + URL += "&Games_dlup%5B%5D=7"; } } -CGameDialog g_GamesDialog; +#ifdef _WIN32 +#define NETRUN_FILENAME "netrun.conf" -// ============================================================================= -// Widget callbacks for PrefsDlg +bool CGameDialog::m_bNetRun; -static void OnButtonClean (GtkWidget *widget, gpointer data) +void CGameDialog::UpdateNetrun(bool retrieve) { - // make sure this is what the user wants - if (gtk_MessageBox(GTK_WIDGET(g_Preferences.GetWidget()), "This will close Radiant and clean the corresponding registry entries.\n" - "Next time you start Radiant it will be good as new. Do you wish to continue?", - "Reset Registry", eMB_YESNO, eMB_ICONASTERISK) == eIDYES) + FILE *f_netrun; + CString strNetrun; + strNetrun = g_strAppPath; strNetrun += NETRUN_FILENAME; + if (!retrieve) { - PrefsDlg *dlg = (PrefsDlg*)data; - dlg->EndModal (eIDCANCEL); - - g_preferences_globals.disable_ini = true; - Preferences_Reset(); - gtk_main_quit(); + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=639 + // now check if we are running from a network installation + // use a dummy file as the flag + f_netrun = fopen(strNetrun.GetBuffer(), "r"); + if (f_netrun) + { + fclose(f_netrun); + m_bNetRun = true; + } + else + m_bNetRun = false; + } + else + { + if (m_bNetRun) + { + f_netrun = fopen(strNetrun.GetBuffer(), "w"); + if (!f_netrun) + { + Sys_FPrintf(SYS_ERR, "ERROR: Failed to create netrun file '%s'\n", strNetrun.GetBuffer()); + m_bNetRun = false; + } + else + { + fclose(f_netrun); + Sys_Printf("Created/Checked '%s'\n", strNetrun.GetBuffer()); + } + } + else + { + if (remove(strNetrun.GetBuffer()) == -1) + { + if (errno != ENOENT) + Sys_FPrintf(SYS_ERR, "Failed to remove netrun file '%s'\n", strNetrun.GetBuffer()); + m_bNetRun = true; + } + else + { + Sys_Printf("Netrun mode is disabled\n"); + } + } } } -// ============================================================================= -// PrefsDlg class +bool CGameDialog::GetNetrun() +{ + return m_bNetRun; +} +#endif /* ======== @@ -547,6 +1420,10 @@ then we can load .ini stuff using prefs / ini settings: those are per-game +win32: +look in g_strGameToolsPath for .ini + +linux: look in ~/.radiant//gamename ======== */ @@ -555,35 +1432,69 @@ look in ~/.radiant//gamename void PrefsDlg::Init() { - // m_global_rc_path has been set above - // m_rc_path is for game specific preferences - // takes the form: global-pref-path/gamename/prefs-file + mGamesDialog.Init(); + // m_global_rc_path has been set above, do m_rc_path with game specific stuff now + // the win32 and linux versions have been unified for network mode +#ifdef _WIN32 + if (!CGameDialog::GetNetrun()) + { + // legacy prefs settings, this goes where the game pack is installed + m_rc_path = g_string_new (g_strGameToolsPath.GetBuffer() ); + m_inipath = g_string_new (m_rc_path->str); + g_string_append (m_inipath, PREFS_LOCAL_FILENAME); + return; + } +#endif // this is common to win32 and Linux init now m_rc_path = g_string_new (m_global_rc_path->str); // game sub-dir - g_string_append (m_rc_path, g_pGameDescription->mGameFile.c_str()); + g_string_append (m_rc_path, g_pGameDescription->mGameFile.GetBuffer()); g_string_append (m_rc_path, "/"); - Q_mkdir (m_rc_path->str); + Q_mkdir (m_rc_path->str, 0775); // then the ini file m_inipath = g_string_new (m_rc_path->str); g_string_append (m_inipath, PREFS_LOCAL_FILENAME); + } -void notebook_set_page(GtkWidget* notebook, GtkWidget* page) +void PrefsDlg::UpdateData (bool retrieve) { - int pagenum = gtk_notebook_page_num(GTK_NOTEBOOK(notebook), page); - if(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)) != pagenum) - { - gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), pagenum); - } + // leo: the "changed" signal confuses the update function + if (m_pWidget == NULL) + return; + mGamesDialog.UpdateData (retrieve); + Dialog::UpdateData (retrieve); } -void PrefsDlg::showPrefPage(GtkWidget* prefpage) +#ifdef _WIN32 +#define PREFSHSPACE 5 +#else +#define PREFSHSPACE 0 +#endif + +static void UpdateSensitivity( GtkWidget *widget, gpointer data ) { - notebook_set_page(m_notebook, prefpage); + PrefsDlg *dlg = (PrefsDlg*)data; + dlg->DoSensitivity(); +} + +static void UpdateEditorSensitivity(GtkWidget *widget, gpointer data) +{ + PrefsDlg *dlg = (PrefsDlg*)data; + dlg->DoEditorSensitivity(); +} + +// start new prefs dialog + +/*! Utility function for swapping notebook pages for tree list selections */ +void PrefsDlg::showPrefPage(int prefpage) +{ + if(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)) != prefpage) + gtk_notebook_set_page(GTK_NOTEBOOK(notebook), prefpage); + return; } @@ -595,461 +1506,1940 @@ static void treeSelection(GtkTreeSelection* selection, gpointer data) GtkTreeIter selected; if(gtk_tree_selection_get_selected(selection, &model, &selected)) { - GtkWidget* prefpage; + int prefpage; gtk_tree_model_get(model, &selected, 1, (gpointer*)&prefpage, -1); dlg->showPrefPage(prefpage); } } -typedef std::list PreferenceGroupCallbacks; - -inline void PreferenceGroupCallbacks_constructGroup(const PreferenceGroupCallbacks& callbacks, PreferenceGroup& group) +void PrefsDlg::BuildDialog () { - for(PreferenceGroupCallbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i) + // Main Preferences dialog + GtkWidget *dialog, *mainvbox, *hbox, *sc_win, *preflabel; + + // Widgets on notebook pages + GtkWidget *check, *label, *scale, *hbox2, *combo, + *table, *spin, *entry, *pixmap, + *radio, *button, *pageframe, *vbox; + + GList *combo_list = (GList*)NULL; + + GtkObject *adj; + + dialog = m_pWidget; + gtk_window_set_title(GTK_WINDOW(dialog), "GtkRadiant Preferences"); + gtk_widget_realize(dialog); + + mainvbox = gtk_vbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(dialog), mainvbox); + gtk_container_set_border_width(GTK_CONTAINER(mainvbox), 5); + gtk_widget_show(mainvbox); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_widget_show(hbox); + gtk_box_pack_end(GTK_BOX(mainvbox), hbox, FALSE, TRUE, 0); + + button = gtk_button_new_with_label("OK"); + gtk_widget_show(button); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize(button, 60, -2); + AddModalButton(button, IDOK); + + button = gtk_button_new_with_label("Cancel"); + gtk_widget_show(button); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize(button, 60, -2); + AddModalButton(button, IDCANCEL); + + button = gtk_button_new_with_label ("Clean"); + gtk_widget_show(button); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(OnButtonClean), this); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); + gtk_widget_set_usize (button, 60, -2); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 0); + gtk_widget_show(hbox); + + sc_win = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sc_win), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start(GTK_BOX(hbox), sc_win, FALSE, FALSE, 0); + gtk_widget_show(sc_win); + + // prefs pages notebook + notebook = gtk_notebook_new(); + // hide the notebook tabs since its not supposed to look like a notebook + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE); + gtk_box_pack_start(GTK_BOX(hbox), notebook, TRUE, TRUE, 0); + gtk_widget_show(notebook); + + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sc_win), GTK_SHADOW_IN); + { - (*i)(group); + GtkTreeStore* store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); + + GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + + { + GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Preferences", renderer, "text", 0, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); + } + + { + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(treeSelection), this); + } + + gtk_widget_show(view); + + gtk_container_add(GTK_CONTAINER (sc_win), view); + + { + /********************************************************************/ + /* Add preference tree options */ + /********************************************************************/ + { + GtkTreeIter group; + gtk_tree_store_append(store, &group, NULL); + gtk_tree_store_set(store, &group, 0, "Globals", 1, PTAB_FRONT, -1); + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Game settings", 1, (gpointer)PTAB_GAME_SETTINGS, -1); + } + } + + { + GtkTreeIter group; + gtk_tree_store_append(store, &group, NULL); + gtk_tree_store_set(store, &group, 0, "Display", 1, PTAB_FRONT, -1); + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "2D Display/Rendering", 1, (gpointer)PTAB_2D, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "3D View", 1, (gpointer)PTAB_CAMERA, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Texture Settings", 1, (gpointer)PTAB_TEXTURE, -1); + } + } + + { + GtkTreeIter group; + gtk_tree_store_append(store, &group, NULL); + gtk_tree_store_set(store, &group, 0, "Interface", 1, PTAB_FRONT, -1); + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Layout", 1, (gpointer)PTAB_LAYOUT, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Mouse", 1, (gpointer)PTAB_MOUSE, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Editing", 1, (gpointer)PTAB_EDITING, -1); + } + } + + { + GtkTreeIter group; + gtk_tree_store_append(store, &group, NULL); + gtk_tree_store_set(store, &group, 0, "Other", 1, PTAB_FRONT, -1); + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Startup/Auto save", 1, (gpointer)PTAB_STARTUP, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Paths", 1, (gpointer)PTAB_PATHS, -1); + } + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "Misc", 1, (gpointer)PTAB_MISC, -1); + } + if (!g_qeglobals.bBSPFrontendPlugin) + { + GtkTreeIter tab; + gtk_tree_store_append(store, &tab, &group); + gtk_tree_store_set(store, &tab, 0, "BSP Monitoring", 1, (gpointer)PTAB_BSPMONITOR, -1); + } + } + } + + gtk_tree_view_expand_all(GTK_TREE_VIEW(view)); + + g_object_unref(G_OBJECT(store)); } -} + + /**********************************************************************/ + /* build the prefs pages */ + /**********************************************************************/ + + // Front page... + // todo : add something interesting here + // NOTE TTimo: tip of the day? or a logo? + preflabel = gtk_label_new("Front Page"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new(NULL); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_widget_set_usize(GTK_WIDGET(vbox), 350, -2); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); - -inline void PreferenceGroupCallbacks_pushBack(PreferenceGroupCallbacks& callbacks, const PreferenceGroupCallback& callback) -{ - callbacks.push_back(callback); -} - -typedef std::list PreferencesPageCallbacks; - -inline void PreferencesPageCallbacks_constructPage(const PreferencesPageCallbacks& callbacks, PreferencesPage& page) -{ - for(PreferencesPageCallbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i) - { - (*i)(page); - } -} - -inline void PreferencesPageCallbacks_pushBack(PreferencesPageCallbacks& callbacks, const PreferencesPageCallback& callback) -{ - callbacks.push_back(callback); -} - -PreferencesPageCallbacks g_interfacePreferences; -void PreferencesDialog_addInterfacePreferences(const PreferencesPageCallback& callback) -{ - PreferencesPageCallbacks_pushBack(g_interfacePreferences, callback); -} -PreferenceGroupCallbacks g_interfaceCallbacks; -void PreferencesDialog_addInterfacePage(const PreferenceGroupCallback& callback) -{ - PreferenceGroupCallbacks_pushBack(g_interfaceCallbacks, callback); -} - -PreferencesPageCallbacks g_displayPreferences; -void PreferencesDialog_addDisplayPreferences(const PreferencesPageCallback& callback) -{ - PreferencesPageCallbacks_pushBack(g_displayPreferences, callback); -} -PreferenceGroupCallbacks g_displayCallbacks; -void PreferencesDialog_addDisplayPage(const PreferenceGroupCallback& callback) -{ - PreferenceGroupCallbacks_pushBack(g_displayCallbacks, callback); -} - -PreferencesPageCallbacks g_settingsPreferences; -void PreferencesDialog_addSettingsPreferences(const PreferencesPageCallback& callback) -{ - PreferencesPageCallbacks_pushBack(g_settingsPreferences, callback); -} -PreferenceGroupCallbacks g_settingsCallbacks; -void PreferencesDialog_addSettingsPage(const PreferenceGroupCallback& callback) -{ - PreferenceGroupCallbacks_pushBack(g_settingsCallbacks, callback); -} - -void Widget_updateDependency(GtkWidget* self, GtkWidget* toggleButton) -{ - gtk_widget_set_sensitive(self, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggleButton)) && GTK_WIDGET_IS_SENSITIVE(toggleButton)); -} - -void ToggleButton_toggled_Widget_updateDependency(GtkWidget *toggleButton, GtkWidget* self) -{ - Widget_updateDependency(self, toggleButton); -} - -void ToggleButton_state_changed_Widget_updateDependency(GtkWidget* toggleButton, GtkStateType state, GtkWidget* self) -{ - if(state == GTK_STATE_INSENSITIVE) - { - Widget_updateDependency(self, toggleButton); - } -} - -void Widget_connectToggleDependency(GtkWidget* self, GtkWidget* toggleButton) -{ - g_signal_connect(G_OBJECT(toggleButton), "state_changed", G_CALLBACK(ToggleButton_state_changed_Widget_updateDependency), self); - g_signal_connect(G_OBJECT(toggleButton), "toggled", G_CALLBACK(ToggleButton_toggled_Widget_updateDependency), self); - Widget_updateDependency(self, toggleButton); -} - - -inline GtkWidget* getVBox(GtkWidget* page) -{ - return gtk_bin_get_child(GTK_BIN(page)); -} - -GtkTreeIter PreferenceTree_appendPage(GtkTreeStore* store, GtkTreeIter* parent, const char* name, GtkWidget* page) -{ - GtkTreeIter group; - gtk_tree_store_append(store, &group, parent); - gtk_tree_store_set(store, &group, 0, name, 1, page, -1); - return group; -} - -GtkWidget* PreferencePages_addPage(GtkWidget* notebook, const char* name) -{ - GtkWidget* preflabel = gtk_label_new(name); + /******** global preferences group ****************************/ + preflabel = gtk_label_new("Globals"); gtk_widget_show(preflabel); - GtkWidget* pageframe = gtk_frame_new(name); - gtk_container_set_border_width(GTK_CONTAINER(pageframe), 4); + pageframe = mGamesDialog.GetGlobalFrame(); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** 2D prefs group (xy views/rendering options) *********/ + preflabel = gtk_label_new("2D Display"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("2D Display"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); gtk_widget_show(pageframe); - - GtkWidget* vbox = gtk_vbox_new(FALSE, 4); + vbox = gtk_vbox_new(FALSE, 5); gtk_widget_show(vbox); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // OpenGL Display Lists + check = gtk_check_button_new_with_label("OpenGL Display Lists"); + gtk_widget_show(check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData(check, &m_bDisplayLists, DLG_CHECK_BOOL); + + // Antialiased points & lines + // Fishman - Add antialiazed points and lines support. 09/03/00 + check = gtk_check_button_new_with_label ("OpenGL antialiased points and lines"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bAntialiasedPointsAndLines, DLG_CHECK_BOOL); + + // Solid selection boxes + check = gtk_check_button_new_with_label ("Solid selection boxes"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bNoStipple, DLG_CHECK_BOOL); + + // Display size info + check = gtk_check_button_new_with_label ("Display size info"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bSizePaint, DLG_CHECK_BOOL); + + // Alternate vertex/edge handles + // Gef: Kyro GL_POINT work around 25-aug-2001 + check = gtk_check_button_new_with_label ("Alternate vertex/edge handles"); + gtk_widget_show(check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData(check, &m_bGlPtWorkaround, DLG_CHECK_BOOL); + + g_list_free (combo_list); + +#ifdef ATIHACK_812 + // ATI bugs + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=812 + check = gtk_check_button_new_with_label ("ATI cards with broken drivers - bug #802"); + gtk_widget_show(check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData(check, &m_bGlATIHack, DLG_CHECK_BOOL); +#endif + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** 3D Camera view group *********/ + preflabel = gtk_label_new("3D View"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("3D View"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // Directional velocity (Movement Velocity) + // label container + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0); + + // label + label = gtk_label_new("Movement Velocity"); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0); + + // adjustment + adj = gtk_adjustment_new(100, 50, 300, 1, 10, 10); + AddDialogData(adj, &m_nMoveSpeed, DLG_ADJ_INT); + + // scale + scale = gtk_hscale_new(GTK_ADJUSTMENT(adj)); + gtk_widget_show(scale); + gtk_box_pack_start(GTK_BOX (vbox), scale, FALSE, TRUE, 2); + + gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); + + // Angular velocity (Rotational Velocity) + // label container + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0); + + // label + label = gtk_label_new ("Rotational Velocity"); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_widget_show (label); + gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0); + + // adjustment + adj = gtk_adjustment_new (3, 1, 180, 1, 10, 10); // value, low, high, step, page_step, page_size + AddDialogData (adj, &m_nAngleSpeed, DLG_ADJ_INT); + + // scale + scale = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (scale); + gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 2); + gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); + + // Text under the velocity sliders + // container + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0); + + // label + label = gtk_label_new ("slow"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + + // label + label = gtk_label_new ("fast"); + gtk_widget_show (label); + gtk_box_pack_end (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + + // Allow drag to select multiple faces/brushes + // container + table = gtk_table_new(2, 1, FALSE); + gtk_widget_show(table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Use paint-select in camera view:"); + gtk_widget_show (label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)"No"); + combo_list = g_list_append (combo_list, (void *)"Yes"); + combo_list = g_list_append (combo_list, (void *)"Yes (Classic Key Setup)"); + + combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + AddDialogData (combo, &m_nCamDragMultiSelect, DLG_COMBO_INT); + + // Freelook in Camera view + check = gtk_check_button_new_with_label ("Freelook in Camera view"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (check)->child), GTK_JUSTIFY_LEFT); + AddDialogData (check, &m_bCamFreeLook, DLG_CHECK_BOOL); + + // Freelook in Camera view w/ forward & back strafing instead of up and down looking + check = gtk_check_button_new_with_label ("Freelook strafes Forward and Back"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (check)->child), GTK_JUSTIFY_LEFT); + AddDialogData (check, &m_bCamFreeLookStrafe, DLG_CHECK_BOOL); + + // Invert mouse in freelook + check = gtk_check_button_new_with_label ("Invert mouse in freelook"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (check)->child), GTK_JUSTIFY_LEFT); + AddDialogData (check, &m_bCamInverseMouse, DLG_CHECK_BOOL); + + // Discrete movement + check = gtk_check_button_new_with_label ("Discrete movement"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (check)->child), GTK_JUSTIFY_LEFT); + AddDialogData (check, &m_bCamDiscrete, DLG_CHECK_BOOL); + + // Update XY views on camera move + check = gtk_check_button_new_with_label ("Update XY views on camera move"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (GTK_BIN (check)->child), GTK_JUSTIFY_LEFT); + AddDialogData (check, &m_bCamXYUpdate, DLG_CHECK_BOOL); // Add the page to the notebook gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); - return pageframe; -} - -class PreferenceTreeGroup : public PreferenceGroup -{ - Dialog& m_dialog; - GtkWidget* m_notebook; - GtkTreeStore* m_store; - GtkTreeIter m_group; -public: - PreferenceTreeGroup(Dialog& dialog, GtkWidget* notebook, GtkTreeStore* store, GtkTreeIter group) : - m_dialog(dialog), - m_notebook(notebook), - m_store(store), - m_group(group) - { - } - PreferencesPage createPage(const char* treeName, const char* frameName) - { - GtkWidget* page = PreferencePages_addPage(m_notebook, frameName); - PreferenceTree_appendPage(m_store, &m_group, treeName, page); - return PreferencesPage(m_dialog, getVBox(page)); - } -}; - -GtkWindow* PrefsDlg::BuildDialog() -{ - PreferencesDialog_addInterfacePreferences(FreeCaller1()); - Mouse_registerPreferencesPage(); - - GtkWindow* dialog = create_floating_window("GtkRadiant Preferences", m_parent); - - { - GtkWidget* mainvbox = gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(dialog), mainvbox); - gtk_container_set_border_width(GTK_CONTAINER(mainvbox), 5); - gtk_widget_show(mainvbox); + /******** Texture group *********/ + preflabel = gtk_label_new("Textures"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Textures"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 6); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); - { - GtkWidget* hbox = gtk_hbox_new(FALSE, 5); - gtk_widget_show(hbox); - gtk_box_pack_end(GTK_BOX(mainvbox), hbox, FALSE, TRUE, 0); - - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &m_modal); - gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &m_modal); - gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - { - GtkButton* button = create_dialog_button("Clean", G_CALLBACK(OnButtonClean), this); - gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - } + // Texture quality slider + // label + label = gtk_label_new ("Texture quality"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); - { - GtkWidget* hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 0); - gtk_widget_show(hbox); + // adjustment + adj = gtk_adjustment_new (0, 0, 4, 1, 1, 1); + AddDialogData (adj, &m_nLatchedTextureQuality, DLG_ADJ_INT); - { - GtkWidget* sc_win = gtk_scrolled_window_new(0, 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sc_win), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start(GTK_BOX(hbox), sc_win, FALSE, FALSE, 0); - gtk_widget_show(sc_win); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sc_win), GTK_SHADOW_IN); + // scale + scale = gtk_hscale_new (GTK_ADJUSTMENT (adj)); + gtk_widget_show (scale); + gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0); + gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE); - // prefs pages notebook - m_notebook = gtk_notebook_new(); - // hide the notebook tabs since its not supposed to look like a notebook - gtk_notebook_set_show_tabs(GTK_NOTEBOOK(m_notebook), FALSE); - gtk_box_pack_start(GTK_BOX(hbox), m_notebook, TRUE, TRUE, 0); - gtk_widget_show(m_notebook); + // text under the texture slider + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0); + label = gtk_label_new ("low"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + label = gtk_label_new ("high"); + gtk_widget_show (label); + gtk_box_pack_end (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + // texture subsets + check = gtk_check_button_new_with_label ("Texture subsets"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bTextureWindow, DLG_CHECK_BOOL); + + // texture scrollbar + check = gtk_check_button_new_with_label ("Texture scrollbar"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bTextureScrollbar, DLG_CHECK_BOOL); - { - GtkTreeStore* store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); + // texture increment matches grid + check = gtk_check_button_new_with_label ("Tex increment matches grid"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bSnapTToGrid, DLG_CHECK_BOOL); - GtkWidget* view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); + // RIANT + // Texture compression choice label + // container + table = gtk_table_new(2, 1, FALSE); + gtk_widget_show(table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); - { - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("Preferences", renderer, "text", 0, 0); - gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); - } + label = gtk_label_new ("Texture Compression (if available):"); + gtk_widget_show (label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - { - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); - g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(treeSelection), this); - } + // Texture compression choice label + combo_list = NULL; + // NONE will always be in pos 0 + combo_list = g_list_append (combo_list, (void *)"None"); - gtk_widget_show(view); - - gtk_container_add(GTK_CONTAINER (sc_win), view); - - { - /********************************************************************/ - /* Add preference tree options */ - /********************************************************************/ - // Front page... - //GtkWidget* front = - PreferencePages_addPage(m_notebook, "Front Page"); - - { - GtkWidget* global = PreferencePages_addPage(m_notebook, "Global Preferences"); - { - PreferencesPage preferencesPage(*this, getVBox(global)); - Global_constructPreferences(preferencesPage); - } - GtkTreeIter group = PreferenceTree_appendPage(store, 0, "Global", global); - { - GtkWidget* game = PreferencePages_addPage(m_notebook, "Game"); - PreferencesPage preferencesPage(*this, getVBox(game)); - g_GamesDialog.CreateGlobalFrame(preferencesPage); - - PreferenceTree_appendPage(store, &group, "Game", game); - } - } - - { - GtkWidget* interfacePage = PreferencePages_addPage(m_notebook, "Interface Preferences"); - { - PreferencesPage preferencesPage(*this, getVBox(interfacePage)); - PreferencesPageCallbacks_constructPage(g_interfacePreferences, preferencesPage); - } - - GtkTreeIter group = PreferenceTree_appendPage(store, 0, "Interface", interfacePage); - PreferenceTreeGroup preferenceGroup(*this, m_notebook, store, group); - - PreferenceGroupCallbacks_constructGroup(g_interfaceCallbacks, preferenceGroup); - } - - { - GtkWidget* display = PreferencePages_addPage(m_notebook, "Display Preferences"); - { - PreferencesPage preferencesPage(*this, getVBox(display)); - PreferencesPageCallbacks_constructPage(g_displayPreferences, preferencesPage); - } - GtkTreeIter group = PreferenceTree_appendPage(store, 0, "Display", display); - PreferenceTreeGroup preferenceGroup(*this, m_notebook, store, group); - - PreferenceGroupCallbacks_constructGroup(g_displayCallbacks, preferenceGroup); - } - - { - GtkWidget* settings = PreferencePages_addPage(m_notebook, "General Settings"); - { - PreferencesPage preferencesPage(*this, getVBox(settings)); - PreferencesPageCallbacks_constructPage(g_settingsPreferences, preferencesPage); - } - - GtkTreeIter group = PreferenceTree_appendPage(store, 0, "Settings", settings); - PreferenceTreeGroup preferenceGroup(*this, m_notebook, store, group); - - PreferenceGroupCallbacks_constructGroup(g_settingsCallbacks, preferenceGroup); - } - } - - gtk_tree_view_expand_all(GTK_TREE_VIEW(view)); - - g_object_unref(G_OBJECT(store)); - } - } - } - } - - gtk_notebook_set_page(GTK_NOTEBOOK(m_notebook), 0); - - return dialog; -} - -preferences_globals_t g_preferences_globals; - -PrefsDlg g_Preferences; // global prefs instance - - -void PreferencesDialog_constructWindow(GtkWindow* main_window) -{ - g_Preferences.m_parent = main_window; - g_Preferences.Create(); -} -void PreferencesDialog_destroyWindow() -{ - g_Preferences.Destroy(); -} - - -PreferenceDictionary g_preferences; - -PreferenceSystem& GetPreferenceSystem() -{ - return g_preferences; -} - -class PreferenceSystemAPI -{ - PreferenceSystem* m_preferencesystem; -public: - typedef PreferenceSystem Type; - STRING_CONSTANT(Name, "*"); - - PreferenceSystemAPI() + // if OpenGL compression is enabled it will always be + // in pos 1 + if (g_qeglobals.m_bOpenGLCompressionSupported) { - m_preferencesystem = &GetPreferenceSystem(); + combo_list = g_list_append (combo_list, (void *)"OpenGL ARB"); } - PreferenceSystem* getTable() + + // If S3 is enabled offer all 3 valid compression schemes in RGBA + if (g_qeglobals.m_bS3CompressionSupported) { - return m_preferencesystem; + combo_list = g_list_append (combo_list, (void *)"S3TC DXT1"); + combo_list = g_list_append (combo_list, (void *)"S3TC DXT3"); + combo_list = g_list_append (combo_list, (void *)"S3TC DXT5"); } -}; -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" + combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + AddDialogData (combo, &m_nTextureCompressionFormat, DLG_COMBO_INT); + g_list_free (combo_list); -typedef SingletonModule PreferenceSystemModule; -typedef Static StaticPreferenceSystemModule; -StaticRegisterModule staticRegisterPreferenceSystem(StaticPreferenceSystemModule::instance()); + // container + table = gtk_table_new(2, 1, FALSE); + gtk_widget_show(table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); -void Preferences_Load() -{ - g_GamesDialog.LoadPrefs(); + // Startup shaders + // label + label = gtk_label_new ("Startup Shaders:"); + gtk_widget_show (label); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + // combo list + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)"None"); + if (g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game") + combo_list = g_list_append (combo_list, (void *)"System"); + else if (g_pGameDescription->mGameFile == "sof2.game") + combo_list = g_list_append (combo_list, (void *)"Tools"); + else + combo_list = g_list_append (combo_list, (void *)"Common"); + combo_list = g_list_append (combo_list, (void *)"All"); + combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + AddDialogData (combo, &m_nLatchedShader, DLG_COMBO_INT); + g_list_free (combo_list); + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Layout group *********/ + preflabel = gtk_label_new("Layout"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Layout"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); - globalOutputStream() << "loading local preferences from " << g_Preferences.m_inipath->str << "\n"; + // View types + // table + table = gtk_table_new (2, 4, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); - if(!Preferences_Load(g_preferences, g_Preferences.m_inipath->str)) + // view type 1 + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "window1.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 2 + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "window2.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 3 + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "window3.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 2, 3, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 4 + pixmap = new_pixmap (g_pParentWnd->m_pWidget, "window4.bmp"); + gtk_widget_show (pixmap); + gtk_table_attach (GTK_TABLE (table), pixmap, 3, 4, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 1 selector + radio = gtk_radio_button_new (NULL); + gtk_widget_show (radio); + gtk_table_attach (GTK_TABLE (table), radio, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 2 selector + radio = gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio)); + gtk_widget_show (radio); + gtk_table_attach (GTK_TABLE (table), radio, 1, 2, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 3 selector + radio = gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio)); + gtk_widget_show (radio); + gtk_table_attach (GTK_TABLE (table), radio, 2, 3, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // view type 4 selector + radio = gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (radio)); + gtk_widget_show (radio); + gtk_table_attach (GTK_TABLE (table), radio, 3, 4, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (radio, &m_nLatchedView, DLG_RADIO_INT); + + // Floating Z window + check = gtk_check_button_new_with_label ("Floating Z Window"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLatchedFloatingZ, DLG_CHECK_BOOL); + + // show menu tear-off seperators + check = gtk_check_button_new_with_label ("Detachable Menus"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLatchedDetachableMenus, DLG_CHECK_BOOL); + + if (!g_pGameDescription->mNoPatch) { - globalOutputStream() << "failed to load local preferences from " << g_Preferences.m_inipath->str << "\n"; + // show patch toolbar + check = gtk_check_button_new_with_label ("Patch Toolbar"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_patchtoolbar", check); // Allow to be disabled for Q1/Q2 + AddDialogData (check, &m_bLatchedPatchToolbar, DLG_CHECK_BOOL); } -} -void Preferences_Save() -{ - if (g_preferences_globals.disable_ini) - return; + // use wide toolbar + check = gtk_check_button_new_with_label ("Wide Toolbar"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLatchedWideToolbar, DLG_CHECK_BOOL); - g_GamesDialog.SavePrefs(); + // use plugin toolbar + check = gtk_check_button_new_with_label ("Plugin Toolbar"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLatchedPluginToolbar, DLG_CHECK_BOOL); - globalOutputStream() << "saving local preferences to " << g_Preferences.m_inipath->str << "\n"; +#ifdef _WIN32 + // win32 file dialog + check = gtk_check_button_new_with_label ("Use win32 file load dialog"); + gtk_widget_show (check); + // gtk_container_add (GTK_CONTAINER (vbox), check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bNativeGUI, DLG_CHECK_BOOL); - if(!Preferences_Save_Safe(g_preferences, g_Preferences.m_inipath->str)) - { - globalOutputStream() << "failed to save local preferences to " << g_Preferences.m_inipath->str << "\n"; - } -} + // position on primary monitor + check = gtk_check_button_new_with_label ("Start on Primary Monitor"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_startonprimary", check); + gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateSensitivity), this ); + AddDialogData (check, &m_bStartOnPrimMon, DLG_CHECK_BOOL); +#endif -void Preferences_Reset() -{ - file_remove(g_Preferences.m_inipath->str); -} + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Mouse group *********/ + preflabel = gtk_label_new("Mouse"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Mouse"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // Buttons + // container + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0); + // 2 button radio + radio = gtk_radio_button_new_with_label (NULL, "2 button"); + gtk_widget_show (radio); + gtk_box_pack_start (GTK_BOX (hbox2), radio, FALSE, FALSE, 0); -void PrefsDlg::PostModal (EMessageBoxReturn code) -{ - if (code == eIDOK) - { - Preferences_Save(); - UpdateAllWindows(); - } -} + // 3 button radio + radio = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio), "3 button"); + gtk_widget_show (radio); + gtk_box_pack_start (GTK_BOX (hbox2), radio, FALSE, FALSE, 0); + AddDialogData (radio, &m_nMouse, DLG_RADIO_INT); -std::vector g_restart_required; + // right click to drop entity + check = gtk_check_button_new_with_label ("Right click to drop entities"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bRightClick, DLG_CHECK_BOOL); -void PreferencesDialog_restartRequired(const char* staticName) -{ - g_restart_required.push_back(staticName); -} + // Mouse chaser (and this does what?) + check = gtk_check_button_new_with_label ("Mouse chaser"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bChaseMouse, DLG_CHECK_BOOL); -void PreferencesDialog_showDialog() -{ - if(ConfirmModified("Edit Preferences") && g_Preferences.DoModal() == eIDOK) - { - if(!g_restart_required.empty()) - { - StringOutputStream message(256); - message << "Preference changes require a restart:\n"; - for(std::vector::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i) - { - message << (*i) << '\n'; - } - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), message.c_str()); - g_restart_required.clear(); - } - } -} + // Alt + multi-drag + check = gtk_check_button_new_with_label ("ALT + multi-drag"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bALTEdge, DLG_CHECK_BOOL); + // Mouse wheel increments + // container + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0); + + // label + label = gtk_label_new ("Wheel Mouse inc:"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + + // entry + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_widget_set_usize (entry, 40, -2); + gtk_box_pack_start (GTK_BOX (hbox2), entry, FALSE, FALSE, 0); + AddDialogData (entry, &m_nWheelInc, DLG_ENTRY_INT); + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Editing group *********/ + preflabel = gtk_label_new("Editing"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Editing"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // Vertex editing splits faces + check = gtk_check_button_new_with_label ("Vertex editing splits face"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bVertexSplit, DLG_CHECK_BOOL); + // Fix target/targetname collisions + check = gtk_check_button_new_with_label ("Fix target/targetname collisions"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bDoTargetFix, DLG_CHECK_BOOL); + + // Clipper tool uses caulk + check = gtk_check_button_new_with_label ("Clipper tool uses caulk"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bClipCaulk, DLG_CHECK_BOOL); + // Don't clamp plane points + check = gtk_check_button_new_with_label ("Don't clamp plane points"); + gtk_widget_show (check); + gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bNoClamp, DLG_CHECK_BOOL); -void GameName_importString(const char* value) -{ - gamename_set(value); -} -typedef FreeCaller1 GameNameImportStringCaller; -void GameName_exportString(const StringImportCallback& importer) -{ - importer(gamename_get()); -} -typedef FreeCaller1 GameNameExportStringCaller; + // Select patch by bounding box + check = gtk_check_button_new_with_label ("Select patches by bounding box"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bPatchBBoxSelect, DLG_CHECK_BOOL); + + // Rotation increment + // container + table = gtk_table_new (2, 3, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + // label + label = gtk_label_new ("Rotation increment:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // entry + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_widget_set_usize (entry, 60, -2); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_nRotation, DLG_ENTRY_INT); + + // Undo levels + // label + label = gtk_label_new ("Undo Levels:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // spinner (allows undo levels to be set to zero) + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 64, 1, 10, 10)), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + AddDialogData (spin, &m_nUndoLevels, DLG_SPIN_INT); -void GameMode_importString(const char* value) -{ - gamemode_set(value); -} -typedef FreeCaller1 GameModeImportStringCaller; -void GameMode_exportString(const StringImportCallback& importer) -{ - importer(gamemode_get()); -} -typedef FreeCaller1 GameModeExportStringCaller; + // Patch subdivisions + // label + label = gtk_label_new ("Patch subdivisions:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // entry (spinner perhaps? [2-16]) + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_widget_set_usize (entry, 60, -2); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + AddDialogData (entry, &m_nSubdivisions, DLG_ENTRY_INT); + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Save/Load group *********/ + preflabel = gtk_label_new("Startup/Auto save"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Startup/Auto save"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); -void RegisterPreferences(PreferenceSystem& preferences) -{ -#ifdef WIN32 - preferences.registerPreference("UseCustomShaderEditor", BoolImportStringCaller(g_TextEditor_useWin32Editor), BoolExportStringCaller(g_TextEditor_useWin32Editor)); -#else - preferences.registerPreference("UseCustomShaderEditor", BoolImportStringCaller(g_TextEditor_useCustomEditor), BoolExportStringCaller(g_TextEditor_useCustomEditor)); - preferences.registerPreference("CustomShaderEditorCommand", CopiedStringImportStringCaller(g_TextEditor_editorCommand), CopiedStringExportStringCaller(g_TextEditor_editorCommand)); + // Snapshots + check = gtk_check_button_new_with_label ("Snapshots"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bSnapShots, DLG_CHECK_BOOL); + + // load last project on open + check = gtk_check_button_new_with_label ("Load last project on open"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLoadLast, DLG_CHECK_BOOL); + + // load last map on open + check = gtk_check_button_new_with_label ("Load last map on open"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bLoadLastMap, DLG_CHECK_BOOL); + + // Auto save.. + // container + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox2), 0); + + // label + check = gtk_check_button_new_with_label ("Auto save every"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (hbox2), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bAutoSave, DLG_CHECK_BOOL); + + // spinner + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 60, 1, 10, 10)), 1, 0); + gtk_widget_show (spin); + gtk_box_pack_start (GTK_BOX (hbox2), spin, FALSE, FALSE, 0); + gtk_widget_set_usize (spin, 60, -2); + AddDialogData (spin, &m_nAutoSave, DLG_SPIN_INT); + + // label + label = gtk_label_new ("minutes"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Paths group *********/ + preflabel = gtk_label_new("Paths"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Paths"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // prefab path + // table + table = gtk_table_new (3, 3, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + // label + label = gtk_label_new ("Prefab path:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + // path entry + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_widget_set_usize(GTK_WIDGET(entry), 240, -2); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 1, 0); + AddDialogData (entry, &m_strPrefabPath, DLG_ENTRY_TEXT); + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=805 +#if 0 + // browse button + button = gtk_button_new_with_label ("..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnBrowseprefab), this); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); #endif - preferences.registerPreference("GameName", GameNameImportStringCaller(), GameNameExportStringCaller()); - preferences.registerPreference("GameMode", GameModeImportStringCaller(), GameModeExportStringCaller()); + // User ini path + // label + label = gtk_label_new ("User INI path:"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + + // user ini path entry + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 1, 0); + AddDialogData (entry, &m_strUserPath, DLG_ENTRY_TEXT); + + // user ini browse button + button = gtk_button_new_with_label ("..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnBrowseuserini), this); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** Misc group *********/ + preflabel = gtk_label_new("Misc"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("Misc"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // Light drawing + check = gtk_check_button_new_with_label ("Light drawing"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &m_bNewLightDraw, DLG_CHECK_BOOL); + + // Light radiuses + // container + table = gtk_table_new(2, 1, FALSE); + gtk_widget_show(table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Light radiuses:"); + gtk_widget_show (label); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + combo_list = NULL; + combo_list = g_list_append (combo_list, (void *)"Disabled"); + combo_list = g_list_append (combo_list, (void *)"True Q3Map2 Style"); + combo_list = g_list_append (combo_list, (void *)"Classic Style"); + + combo = gtk_combo_new (); + gtk_combo_set_popdown_strings (GTK_COMBO (combo), combo_list); + gtk_widget_show (combo); + gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE); + AddDialogData (combo, &m_nLightRadiuses, DLG_COMBO_INT); + +#ifdef _WIN32 + check = gtk_check_button_new_with_label ("Use win32 file associations to open text files instead of builtin editor"); + gtk_widget_show(check); + gtk_box_pack_start(GTK_BOX (vbox), check, FALSE, FALSE, 0); + AddDialogData (check, &g_PrefsDlg.m_bUseWin32Editor, DLG_CHECK_BOOL); +#else + // use custom shader editor + check = gtk_check_button_new_with_label ("Use Custom Shader Editor"); + gtk_widget_show(check); + gtk_box_pack_start(GTK_BOX (vbox), check, FALSE, FALSE, 0); + gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateEditorSensitivity), this); + g_object_set_data (G_OBJECT(dialog), "check_customeditor", check); + AddDialogData (check, &g_PrefsDlg.m_bUseCustomEditor, DLG_CHECK_BOOL); + + // custom shader editor executable + // table + table = gtk_table_new (3, 1, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + // label + label = gtk_label_new("Custom Editor Command"); + gtk_widget_show(label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); + g_object_set_data (G_OBJECT(dialog), "label_customeditor", label); + gtk_widget_set_sensitive (label, g_PrefsDlg.m_bUseCustomEditor); + + // custom editor command entry + entry = gtk_entry_new (); + gtk_widget_show (entry); + gtk_widget_set_usize(GTK_WIDGET(entry), 240, -2); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 1, 0); + AddDialogData (entry, &m_strEditorCommand, DLG_ENTRY_TEXT); + gtk_widget_set_sensitive (entry, g_PrefsDlg.m_bUseCustomEditor); + g_object_set_data (G_OBJECT(dialog), "entry_customeditor", entry); + + // browse button + button = gtk_button_new_with_label ("..."); + gtk_widget_show (button); + gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnBtnBrowseEditor), this); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + g_object_set_data (G_OBJECT(dialog), "button_customeditor", button); + gtk_widget_set_sensitive (button, g_PrefsDlg.m_bUseCustomEditor); +#endif + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + /******** BSP Monitoring group *********/ + // this is never displayed if the plugin isn't available + preflabel = gtk_label_new("BSP Monitoring"); + gtk_widget_show(preflabel); + pageframe = gtk_frame_new("BSP Monitoring"); + gtk_container_set_border_width(GTK_CONTAINER(pageframe), 5); + gtk_widget_show(pageframe); + vbox = gtk_vbox_new(FALSE, 5); + gtk_widget_show(vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(pageframe), vbox); + + // Enable BSP process monitoring + check = gtk_check_button_new_with_label ("Enable BSP process monitoring"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_monitorbsp", check); + gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateSensitivity), this ); + AddDialogData (check, &g_PrefsDlg.m_bWatchBSP, DLG_CHECK_BOOL); + + // Stop on leak + check = gtk_check_button_new_with_label ("Stop compilation on leak"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_leakstop", check); + AddDialogData (check, &g_PrefsDlg.m_bLeakStop, DLG_CHECK_BOOL); + + // engine after compile + check = gtk_check_button_new_with_label ("Run engine after compile"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_runengine", check); + gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateSensitivity), this ); + AddDialogData( check, &g_PrefsDlg.m_bRunQuake, DLG_CHECK_BOOL ); + + // sleep mode when running engine + check = gtk_check_button_new_with_label ("Activate sleep mode when running the engine"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_sleep", check); + AddDialogData( check, &g_PrefsDlg.m_bDoSleep, DLG_CHECK_BOOL ); + + // use q3map2's texture projection + check = gtk_check_button_new_with_label ("Texturing compatible with q3map2"); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + g_object_set_data (G_OBJECT (dialog), "check_q3map2", check); + AddDialogData( check, &g_PrefsDlg.m_bQ3Map2Texturing, DLG_CHECK_BOOL ); + + // Add the page to the notebook + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel); + + gtk_notebook_set_page(GTK_NOTEBOOK(notebook), PTAB_FRONT); + + return; } -void Preferences_Init() +// end new prefs dialog + +void PrefsDlg::LoadTexdefPref(texdef_t* pTexdef, char* pName) { - RegisterPreferences(GetPreferenceSystem()); + char buffer[256]; + + memset(pTexdef, 0, sizeof(texdef_t)); + + sprintf(buffer, "%s%s", pName, TD_SCALE1_KEY); + mLocalPrefs.GetPref(buffer, &pTexdef->scale[0], 0.5f); + + sprintf(buffer, "%s%s", pName, TD_SCALE2_KEY); + mLocalPrefs.GetPref(buffer, &pTexdef->scale[1], 0.5f); + + sprintf(buffer, "%s%s", pName, TD_SHIFT1_KEY); + mLocalPrefs.GetPref(buffer, &pTexdef->shift[0], 8.f); + + sprintf(buffer, "%s%s", pName, TD_SHIFT2_KEY); + mLocalPrefs.GetPref(buffer, &pTexdef->shift[1], 8.f); + + sprintf(buffer, "%s%s", pName, TD_ROTATE_KEY); + mLocalPrefs.GetPref(buffer, &pTexdef->rotate, 45); } + +void PrefsDlg::UpdateTextureCompression() +{ + // if OpenGL is not ready yet, don't do anything + if (!g_qeglobals.m_bOpenGLReady) { + Sys_Printf("OpenGL not ready - postpone texture compression capability check\n"); + return; + } + + if (g_qeglobals.bTextureCompressionSupported) + { + if (m_nTextureCompressionFormat >= 2 && !g_qeglobals.m_bS3CompressionSupported) + { + Sys_Printf("Inconsistant pref setting for texture compression (%d), rolling back\n", m_nTextureCompressionFormat); + m_nTextureCompressionFormat = 1; // if this is not supported either, see below + } + if (m_nTextureCompressionFormat == 1 && !g_qeglobals.m_bOpenGLCompressionSupported) + { + Sys_Printf("Inconsistant pref setting for texture compression (GL_COMPRESSED_RGBA), rolling back\n"); + m_nTextureCompressionFormat = 0; + } + switch (m_nTextureCompressionFormat) + { + case (0): + { + g_qeglobals.texture_components = GL_RGBA; + Sys_Printf("texture compression disabled by preferences settings\n"); + break; + } + case (1): + { + g_qeglobals.texture_components = GL_COMPRESSED_RGBA; + Sys_Printf("OpenGL texture compression enabled\n"); + break; + } + case (2): + { + g_qeglobals.texture_components = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + Sys_Printf("S3TC DXT1 texture compression enabled\n"); + break; + } + case (3): + { + g_qeglobals.texture_components = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + Sys_Printf("S3TC DXT3 texture compression enabled\n"); + break; + } + case (4): + { + g_qeglobals.texture_components = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + Sys_Printf("S3TC DXT5 texture compression enabled\n"); + break; + } + } + } + else + { + Sys_Printf("texture compression is not supported by your current graphic card/drivers\n"); + g_qeglobals.texture_components = GL_RGBA; + m_nTextureCompressionFormat = 0; + } +} + +#ifdef ATIHACK_812 +void PrefsDlg::UpdateATIHack() { + // if OpenGL is not ready yet, don't do anything + if (!g_qeglobals.m_bOpenGLReady) { + Sys_Printf("OpenGL not ready - postpone ATI bug workaround setup\n"); + return; + } + + if (m_bGlATIHack) { + qglCullFace = &qglCullFace_ATIHack; + qglDisable = &qglDisable_ATIHack; + qglEnable = &qglEnable_ATIHack; + qglPolygonMode = &qglPolygonMode_ATIHack; + Sys_Printf("ATI bug workaround enabled\n"); + } else { + qglCullFace = qglCullFace_real; + qglDisable = qglDisable_real; + qglEnable = qglEnable_real; + qglPolygonMode = qglPolygonMode_real; + Sys_Printf("ATI bug workaround disabled\n"); + } +} +#endif + +// TTimo: m_strEnginePath has a special status, if not found in registry we need to +// initiliaze it for sure. It is not totally failsafe but we can use the same +// code than in q3map, expecting to find some "quake" above us. If not, we prompt +// for the engine executable path +void PrefsDlg::LoadPrefs () +{ + int i; + + // first things first, load prefs from global prefs + mGamesDialog.LoadPrefs(); + + // if we already have a document loaded, we will free and reload from file + if (mLocalPrefs.InUse()) { + mLocalPrefs.Clear(); + } + + // load local.pref file + mLocalPrefs.ReadXMLFile(m_inipath->str); + + mLocalPrefs.GetPref(PATCHSHOWBOUNDS_KEY, &g_bPatchShowBounds, FALSE); + mLocalPrefs.GetPref(MOUSE_KEY, &m_nMouse, MOUSE_DEF); + m_nMouseButtons = m_nMouse ? 3 : 2; + + // project file + // if it's not found here, mainframe.cpp will take care of finding one + mLocalPrefs.GetPref(LASTPROJ_KEY, &m_strLastProject, ""); + mLocalPrefs.GetPref(LASTPROJVER_KEY, &m_nLastProjectVer, -1); + + // prefab path + // NOTE TTimo: I'm not sure why this is in prefs + // should probably be a project setting + // and I'm not sure that we really have a way to set this reliably either + CString strPrefab; + strPrefab = g_qeglobals.m_strHomeGame.GetBuffer(); + strPrefab += g_pGameDescription->mBaseGame.GetBuffer(); + strPrefab += "/prefabs/"; + mLocalPrefs.GetPref(PREFAB_KEY, &m_strPrefabPath, strPrefab); + + mLocalPrefs.GetPref(LASTLIGHTINTENSITY_KEY, &m_iLastLightIntensity, 300); + mLocalPrefs.GetPref(TLOCK_KEY, &m_bTextureLock, TLOCK_DEF); + mLocalPrefs.GetPref(RLOCK_KEY, &m_bRotateLock, TLOCK_DEF); + mLocalPrefs.GetPref(LASTMAP_KEY, &m_strLastMap, ""); + mLocalPrefs.GetPref(LOADLAST_KEY, &m_bLoadLast, LOADLAST_DEF); + mLocalPrefs.GetPref(BSP_KEY, &m_bInternalBSP, FALSE); + mLocalPrefs.GetPref(RCLICK_KEY, &m_bRightClick, TRUE); + mLocalPrefs.GetPref(AUTOSAVE_KEY, &m_bAutoSave, TRUE); + mLocalPrefs.GetPref(LOADLASTMAP_KEY, &m_bLoadLastMap, FALSE); + mLocalPrefs.GetPref(TINYBRUSH_KEY, &m_bCleanTiny, FALSE); + mLocalPrefs.GetPref(TINYSIZE_KEY, &m_fTinySize, 0.5f); + mLocalPrefs.GetPref(AUTOSAVETIME_KEY, &m_nAutoSave, 5); + mLocalPrefs.GetPref(SNAPSHOT_KEY, &m_bSnapShots, FALSE); + mLocalPrefs.GetPref(MOVESPEED_KEY, &m_nMoveSpeed, 100); + mLocalPrefs.GetPref(ANGLESPEED_KEY, &m_nAngleSpeed, 3); + mLocalPrefs.GetPref(SETGAME_KEY, &m_bSetGame, FALSE); + mLocalPrefs.GetPref(CAMXYUPDATE_KEY, &m_bCamXYUpdate, TRUE); + mLocalPrefs.GetPref(CAMDRAGMULTISELECT_KEY, &m_nCamDragMultiSelect, TRUE); + mLocalPrefs.GetPref(CAMFREELOOK_KEY, &m_bCamFreeLook, TRUE); + mLocalPrefs.GetPref(CAMINVERSEMOUSE_KEY, &m_bCamInverseMouse, FALSE); + mLocalPrefs.GetPref(CAMDISCRETE_KEY, &m_bCamDiscrete, TRUE); + mLocalPrefs.GetPref(LIGHTDRAW_KEY, &m_bNewLightDraw, TRUE); + mLocalPrefs.GetPref(CUBICCLIP_KEY, &m_bCubicClipping, TRUE); + mLocalPrefs.GetPref(CUBICSCALE_KEY, &m_nCubicScale, 13); + mLocalPrefs.GetPref(ALTEDGE_KEY, &m_bALTEdge, FALSE); + mLocalPrefs.GetPref(FACECOLORS_KEY, &m_bFaceColors, FALSE); + mLocalPrefs.GetPref(XZVIS_KEY, &m_bXZVis, FALSE); + mLocalPrefs.GetPref(YZVIS_KEY, &m_bYZVis, FALSE); + mLocalPrefs.GetPref(ZVIS_KEY, &m_bZVis, FALSE); + mLocalPrefs.GetPref(SIZEPAINT_KEY, &m_bSizePaint, FALSE); + mLocalPrefs.GetPref(DLLENTITIES_KEY, &m_bDLLEntities, FALSE); + + mLocalPrefs.GetPref(DETACHABLEMENUS_KEY, &m_bLatchedDetachableMenus, TRUE); + m_bDetachableMenus = m_bLatchedDetachableMenus; + + if (g_pGameDescription->mNoPatch) + { + m_bPatchToolbar = false; + } + else + { + mLocalPrefs.GetPref(PATCHTOOLBAR_KEY, &m_bLatchedPatchToolbar, TRUE); + m_bPatchToolbar = m_bLatchedPatchToolbar; + } + + mLocalPrefs.GetPref(WIDETOOLBAR_KEY, &m_bLatchedWideToolbar, TRUE); + m_bWideToolbar = m_bLatchedWideToolbar; + + mLocalPrefs.GetPref(PLUGINTOOLBAR_KEY, &m_bLatchedPluginToolbar, TRUE); + m_bPluginToolbar = m_bLatchedPluginToolbar; + + mLocalPrefs.GetPref(WINDOW_KEY, (int*)&m_nLatchedView, WINDOW_DEF); + m_nView = m_nLatchedView; + + mLocalPrefs.GetPref(FLOATINGZ_KEY, &m_bLatchedFloatingZ, FALSE); + m_bFloatingZ = m_bLatchedFloatingZ; + + mLocalPrefs.GetPref(TEXTUREQUALITY_KEY, &m_nLatchedTextureQuality, 3); + m_nTextureQuality = m_nLatchedTextureQuality; + + mLocalPrefs.GetPref(LOADSHADERS_KEY, &m_nLatchedShader, 0); + m_nShader = m_nLatchedShader; + + mLocalPrefs.GetPref(NOCLAMP_KEY, &m_bNoClamp, FALSE); + mLocalPrefs.GetPref(USERINI_KEY, &m_strUserPath, ""); + mLocalPrefs.GetPref(ROTATION_KEY, &m_nRotation, 45); + mLocalPrefs.GetPref(CHASEMOUSE_KEY, &m_bChaseMouse, TRUE); + mLocalPrefs.GetPref(ENTITYSHOW_KEY, &m_nEntityShowState, ENTITY_SKINNED_BOXED); + + // this will probably need to be 75 or 100 for Q1. + mLocalPrefs.GetPref(TEXTURESCALE_KEY, &m_nTextureScale, 50); + + // FIXME: Hydra - actually, this stuff is Q1,Q2 and HL specific. + if ( (g_pGameDescription->mGameFile == "hl.game") ) + { + // No BSP monitoring in the default compiler tools for Half-life (yet) + mLocalPrefs.GetPref(WATCHBSP_KEY, &m_bWatchBSP, FALSE); + + // Texture subset on by default (HL specific really, because of halflife.wad's size) + mLocalPrefs.GetPref(TEXTURE_KEY, &m_bTextureWindow, TRUE); + } + else if ( ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ) ) + { + // BSP monitoring is implemented in Quake2 and Heretic2 tools + mLocalPrefs.GetPref(WATCHBSP_KEY, &m_bWatchBSP, TRUE); + + // Texture subset on by default (HL specific really, because of halflife.wad's size) + mLocalPrefs.GetPref(TEXTURE_KEY, &m_bTextureWindow, TRUE); + } + else + { + mLocalPrefs.GetPref(WATCHBSP_KEY, &m_bWatchBSP, WATCHBSP_DEF); + mLocalPrefs.GetPref(TEXTURE_KEY, &m_bTextureWindow, FALSE); + } + + + mLocalPrefs.GetPref(TEXTURESCROLLBAR_KEY, &m_bTextureScrollbar, TRUE); + mLocalPrefs.GetPref(DISPLAYLISTS_KEY, &m_bDisplayLists, TRUE); + mLocalPrefs.GetPref(ANTIALIASEDLINES_KEY, &m_bAntialiasedPointsAndLines, FALSE); + mLocalPrefs.GetPref(SWITCHCLIP_KEY, &m_bSwitchClip, TRUE); + mLocalPrefs.GetPref(SELWHOLEENTS_KEY, &m_bSelectWholeEntities, TRUE); + mLocalPrefs.GetPref(SHOWSHADERS_KEY, &m_bShowShaders, TRUE); + mLocalPrefs.GetPref(GLLIGHTING_KEY, &m_bGLLighting, FALSE); + mLocalPrefs.GetPref(NOSTIPPLE_KEY, &m_bNoStipple, FALSE); + mLocalPrefs.GetPref(UNDOLEVELS_KEY, &m_nUndoLevels, 30); + mLocalPrefs.GetPref(VERTEXMODE_KEY, &m_bVertexSplit, TRUE); + mLocalPrefs.GetPref(RUNQ2_KEY, &m_bRunQuake, RUNQ2_DEF); + mLocalPrefs.GetPref(LEAKSTOP_KEY, &m_bLeakStop, TRUE); + mLocalPrefs.GetPref(DOSLEEP_KEY, &m_bDoSleep, FALSE); + mLocalPrefs.GetPref(SELECTCURVES_KEY, &m_bSelectCurves, TRUE); + mLocalPrefs.GetPref(SELECTMODELS_KEY, &m_bSelectModels, TRUE); + mLocalPrefs.GetPref(SHADERLISTONLY_KEY, &m_bTexturesShaderlistOnly, FALSE); + mLocalPrefs.GetPref(SUBDIVISIONS_KEY, &m_nSubdivisions, SUBDIVISIONS_DEF); + mLocalPrefs.GetPref(CLIPCAULK_KEY, &m_bClipCaulk, FALSE); + mLocalPrefs.GetPref(SNAPTTOGRID_KEY, &m_bSnapTToGrid, FALSE); + mLocalPrefs.GetPref(TARGETFIX_KEY, &m_bDoTargetFix, TRUE); + mLocalPrefs.GetPref(WHEELINC_KEY, &m_nWheelInc, 64); + mLocalPrefs.GetPref(PATCHBBOXSEL_KEY, &m_bPatchBBoxSelect, FALSE); + + // Gef: Kyro GL_POINT workaround + mLocalPrefs.GetPref(GLPOINTWORKAROUND_KEY, &m_bGlPtWorkaround, FALSE); + + // window positioning + mLocalPrefs.GetPref(ENTITYSPLIT1_KEY, &mWindowInfo.nEntitySplit1, -1); + mLocalPrefs.GetPref(ENTITYSPLIT2_KEY, &mWindowInfo.nEntitySplit2, -1); + + mLocalPrefs.GetPref(POSITIONX_KEY, &mWindowInfo.position.x, -1); + mLocalPrefs.GetPref(POSITIONY_KEY, &mWindowInfo.position.y, -1); + mLocalPrefs.GetPref(WIDTH_KEY, &mWindowInfo.position.w, -1); + mLocalPrefs.GetPref(HEIGHT_KEY, &mWindowInfo.position.h, 450); + + const window_position_t default_window_pos = { 0, 0, 200, 200, }; + + mLocalPrefs.GetPref(ENTITYWND_KEY, &mWindowInfo.posEntityWnd, default_window_pos); + mLocalPrefs.GetPref(MAPINFOWND_KEY, &mWindowInfo.posMapInfoWnd, default_window_pos); + mLocalPrefs.GetPref(CAMWND_KEY, &mWindowInfo.posCamWnd, default_window_pos); + mLocalPrefs.GetPref(ZWND_KEY, &mWindowInfo.posZWnd, default_window_pos); + mLocalPrefs.GetPref(XYWND_KEY, &mWindowInfo.posXYWnd, default_window_pos); + mLocalPrefs.GetPref(YZWND_KEY, &mWindowInfo.posYZWnd, default_window_pos); + mLocalPrefs.GetPref(XZWND_KEY, &mWindowInfo.posXZWnd, default_window_pos); + mLocalPrefs.GetPref(PATCHWND_KEY, &mWindowInfo.posPatchWnd, default_window_pos); + mLocalPrefs.GetPref(SURFACEWND_KEY, &mWindowInfo.posSurfaceWnd, default_window_pos); + mLocalPrefs.GetPref(ENTITYINFOWND_KEY, &mWindowInfo.posEntityInfoWnd, default_window_pos); + + mLocalPrefs.GetPref(ZWIDTH_KEY, &mWindowInfo.nZWidth, 30); + mLocalPrefs.GetPref(XYHEIGHT_KEY, &mWindowInfo.nXYHeight, 300); + mLocalPrefs.GetPref(XYWIDTH_KEY, &mWindowInfo.nXYWidth, 300); + mLocalPrefs.GetPref(CAMWIDTH_KEY, &mWindowInfo.nCamWidth, 200); + mLocalPrefs.GetPref(CAMHEIGHT_KEY, &mWindowInfo.nCamHeight, 200); + mLocalPrefs.GetPref(ZFLOATWIDTH_KEY, &mWindowInfo.nZFloatWidth, 300); +#ifdef _WIN32 + mLocalPrefs.GetPref(STATE_KEY, &mWindowInfo.nState, SW_SHOW); +#endif + + // menu stuff + mLocalPrefs.GetPref(COUNT_KEY, &m_nMRUCount, 0); + for(i = 0; i < 4; i++) + { + char buf[64]; + sprintf (buf, "%s%d", FILE_KEY, i); + mLocalPrefs.GetPref(buf, &m_strMRUFiles[i], ""); + } + + // some platform specific prefs +#ifdef _WIN32 + mLocalPrefs.GetPref(NATIVEGUI_KEY, &m_bNativeGUI, TRUE); + mLocalPrefs.GetPref(STARTONPRIMMON_KEY, &m_bStartOnPrimMon, FALSE); +#endif + + mLocalPrefs.GetPref(SI_TEXMENU_KEY, &g_qeglobals.d_savedinfo.iTexMenu, ID_VIEW_BILINEARMIPMAP); + mLocalPrefs.GetPref(SI_GAMMA_KEY, &g_qeglobals.d_savedinfo.fGamma, 1.0f); + mLocalPrefs.GetPref(SI_EXCLUDE_KEY, &g_qeglobals.d_savedinfo.exclude, 0); // nothing filtered by default + mLocalPrefs.GetPref(SI_INCLUDE_KEY, &g_qeglobals.d_savedinfo.include, INCLUDE_NAMES | INCLUDE_COORDS | INCLUDE_ANGLES | INCLUDE_CAMERATINT); + mLocalPrefs.GetPref(SI_SHOWNAMES_KEY, &g_qeglobals.d_savedinfo.show_names, FALSE); + mLocalPrefs.GetPref(SI_SHOWCOORDS_KEY, &g_qeglobals.d_savedinfo.show_coordinates, TRUE); + mLocalPrefs.GetPref(SI_SHOWANGLES_KEY, &g_qeglobals.d_savedinfo.show_angles, TRUE); + mLocalPrefs.GetPref(SI_SHOWOUTLINES_KEY, &g_qeglobals.d_savedinfo.show_outline, FALSE); + mLocalPrefs.GetPref(SI_SHOWAXIS_KEY, &g_qeglobals.d_savedinfo.show_axis, TRUE); + mLocalPrefs.GetPref(SI_NOSELOUTLINES_KEY, &g_qeglobals.d_savedinfo.bNoSelectedOutlines, FALSE); + + mLocalPrefs.GetPref(SI_OUTLINESTYLE_KEY, &g_qeglobals.d_savedinfo.iSelectedOutlinesStyle, OUTLINE_ZBUF|OUTLINE_BSEL); + + LoadTexdefPref(&g_qeglobals.d_savedinfo.m_SIIncrement, SI_SURFACE_TEXDEF_KEY); + LoadTexdefPref(&g_qeglobals.d_savedinfo.m_PIIncrement, SI_PATCH_TEXDEF_KEY); + + // text editor binding +#ifdef _WIN32 + mLocalPrefs.GetPref(CUSTOMSHADEREDITOR_KEY, &m_bUseWin32Editor, TRUE); +#else + mLocalPrefs.GetPref(CUSTOMSHADEREDITOR_KEY, &m_bUseCustomEditor, FALSE); + mLocalPrefs.GetPref(CUSTOMSHADEREDITORCOMMAND_KEY, &m_strEditorCommand, ""); +#endif + + + vec3_t vDefaultAxisColours[3] = { + {0.f, 0.5f, 0.f}, + {0.f, 0.f, 1.f}, + {1.f, 0.f, 0.f}, + }; + + for(i = 0; i < 3; i++) { + char buf[64]; + sprintf(buf, "%s%d", SI_AXISCOLORS_KEY, i); + mLocalPrefs.GetPref(buf, g_qeglobals.d_savedinfo.AxisColors[i], vDefaultAxisColours[i]); + } + + vec3_t vDefaultColours[COLOR_LAST] = { + {0.25f, 0.25f, 0.25f}, + {1.f, 1.f, 1.f}, + {0.75f, 0.75f, 0.75f}, + {0.5f, 0.5f, 0.5f}, + {0.25f, 0.25f, 0.25f}, + {0.0f, 0.0f, 0.0f}, + {0.f, 0.f, 1.f}, + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + {1.f, 0.f, 0.f}, + {0.f, 0.f, 1.f}, + {0.5f, 0.f, 0.75f}, + {1.0f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + }; + + for(i = 0; i < COLOR_LAST; i++) { + char buf[64]; + sprintf(buf, "%s%d", SI_COLORS_KEY, i); + mLocalPrefs.GetPref(buf, g_qeglobals.d_savedinfo.colors[i], vDefaultColours[i]); + } + + mLocalPrefs.GetPref(TEXTURECOMPRESSIONFORMAT_KEY, &m_nTextureCompressionFormat, 1); + + mLocalPrefs.GetPref(LIGHTRADIUS_KEY, &m_nLightRadiuses, TRUE); + + mLocalPrefs.GetPref(Q3MAP2TEX_KEY, &m_bQ3Map2Texturing, TRUE); + +#ifdef ATIHACK_812 + mLocalPrefs.GetPref(ATIHACK_KEY, &m_bGlATIHack, FALSE); +#endif + + Undo_SetMaxSize(m_nUndoLevels); // set it internally as well / FIXME: why not just have one global value? + + UpdateTextureCompression(); + +#ifdef ATIHACK_812 + UpdateATIHack(); +#endif + + if (mLocalPrefs.mbEmpty) + { + mLocalPrefs.mbEmpty = false; + Sys_Printf("Saving local.pref with default pref values\n"); + SavePrefs(); + } +} + +void PrefsDlg::SavePrefs () +{ + if (g_qeglobals.disable_ini) + return; + +#ifdef _DEBUG + Sys_Printf("PrefsDlg::SavePrefs\n"); +#endif + + // this will take care of copying back from the dialog to the variables + // NOTE: it may be overkill to call systematically before a SavePrefs, but it's safer + // this will also cause an UpdateData for the mGamesDialog + UpdateData(TRUE); + + mGamesDialog.SavePrefs(); + + // update the tree and save it + mLocalPrefs.UpdatePrefTree(); + if (!mLocalPrefs.WriteXMLFile(m_inipath->str)) + Sys_FPrintf(SYS_ERR, "Error occured while saving local prefs file '%s'\n", m_inipath->str); + + if ( m_nMouse == 0 ) { + m_nMouseButtons = 2; + } else { + m_nMouseButtons = 3; + } + +} + +void PrefsDlg::PostModal (int code) +{ + if (code == IDOK) + { + SavePrefs(); + // make sure the logfile is ok + Sys_LogFile(); + #ifdef ATIHACK_812 + UpdateATIHack(); + #endif + if (g_pParentWnd) + g_pParentWnd->SetGridStatus(); + Sys_UpdateWindows(W_ALL); + if (m_nUndoLevels != 0) + Undo_SetMaxSize(m_nUndoLevels); + } +} + +void PrefsDlg::DoEditorSensitivity() +{ + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_object_get_data (G_OBJECT(m_pWidget), "check_customeditor")))) + { + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "label_customeditor")), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "entry_customeditor")), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "button_customeditor")), TRUE); + } + else + { + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "label_customeditor")), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "entry_customeditor")), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g_object_get_data (G_OBJECT(m_pWidget), "button_customeditor")), FALSE); + } +} + +void PrefsDlg::DoSensitivity() +{ +#if 0 + // first, look at the project file version ... will monitoring work? + // project files now XML, guaranteed to be at least version 2 + if (0)//IntForKey( g_qeglobals.d_project_entity, "version" ) < 2) + { + if (m_bWarn) + { + Str Msg; + Msg = "The current project file ("; + Msg += g_PrefsDlg.m_strLastProject; + Msg += ") is not at least version 2.\nI need version 2 or above to setup BSP monitoring correctly."; + gtk_MessageBox(m_pWidget, Msg.GetBuffer(), MB_OK ); + + m_bWarn = false; + } + + // go ahead, disable everybuddy + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_leakstop" )), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_monitorbsp" )), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_runengine" )), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_sleep" )), FALSE ); + } + else + { +#endif +// m_bWarn = true; + + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_leakstop" )), TRUE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_monitorbsp" )), TRUE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_runengine" )), TRUE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_sleep" )), TRUE ); + + if ( ! gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT(m_pWidget), "check_monitorbsp" ) ) ) ) + { + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_leakstop" )), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_runengine" )), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_sleep" )), FALSE ); + } else if (! gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT(m_pWidget), "check_runengine" ) ) ) ) + { + gtk_widget_set_sensitive( GTK_WIDGET(g_object_get_data( G_OBJECT(m_pWidget), "check_sleep" )), FALSE ); + } +} + +/* +============================================================ +CGameInstall +============================================================ +*/ + +CGameInstall::CGameInstall() { + memset( m_availGames, 0, sizeof( m_availGames ) ); +} + +void CGameInstall::OnBtnBrowseEngine( GtkWidget *widget, gpointer data ) { + Sys_Printf( "OnBtnBrowseEngine\n" ); + + CGameInstall* i = static_cast( data ); + char *dir = dir_dialog( widget, "Select game directory", NULL ); + + i->UpdateData( TRUE ); + + if ( dir != NULL ) { + i->m_strEngine = dir; + i->UpdateData( FALSE ); + free( dir ); + } +} + +void CGameInstall::OnGameSelectChanged( GtkWidget *widget, gpointer data ) { + Sys_Printf( "OnGameSelectChanged\n" ); + + CGameInstall* i = static_cast( data ); + i->UpdateData( TRUE ); + i->m_strName = gtk_combo_box_get_active_text( GTK_COMBO_BOX( widget ) ); + i->UpdateData( FALSE ); +} + +void CGameInstall::BuildDialog() { + GtkWidget *dlg, *vbox1, *button, *text, *combo, *entry, *hbox; + + dlg = m_pWidget; + gtk_window_set_title( GTK_WINDOW( dlg ), "Configure games" ); + + vbox1 = gtk_vbox_new( FALSE, 0 ); + gtk_widget_show( vbox1 ); + gtk_container_add( GTK_CONTAINER( dlg ), vbox1 ); + + text = gtk_label_new( "Select the game to configure" ); + gtk_widget_show( text ); + gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 ); + + combo = gtk_combo_box_new_text(); + gtk_widget_show( combo ); + gtk_box_pack_start( GTK_BOX( vbox1 ), combo, FALSE, FALSE, 0 ); + + // GList *combo_list = NULL; + int iGame = 0; + while ( m_availGames[ iGame ] != GAME_NONE ) { + switch ( m_availGames[ iGame ] ) { + case GAME_Q2: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake II" ); + break; + case GAME_Q3: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake III Arena and mods" ); + break; + case GAME_URT: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Urban Terror (standalone)" ); + break; + case GAME_UFOAI: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "UFO: Alien Invasion" ); + break; + case GAME_Q2W: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake2World" ); + break; + case GAME_WARSOW: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Warsow" ); + break; + case GAME_NEXUIZ: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Nexuiz" ); + break; + } + iGame++; + } + AddDialogData( combo, &m_nComboSelect, DLG_COMBO_BOX_INT ); + gtk_signal_connect( GTK_OBJECT( combo ), "changed", G_CALLBACK( OnGameSelectChanged ), this ); + gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), 0 ); // NOTE: will trigger signal + + text = gtk_label_new( "Name:" ); + gtk_widget_show( text ); + gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 ); + + entry = gtk_entry_new(); + gtk_widget_show( entry ); + gtk_box_pack_start( GTK_BOX( vbox1 ), entry, FALSE, FALSE, 0 ); + AddDialogData( entry, &m_strName, DLG_ENTRY_TEXT ); + + text = gtk_label_new( "Engine directory:" ); + gtk_widget_show( text ); + gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 ); + + hbox = gtk_hbox_new( FALSE, 0 ); + gtk_widget_show( hbox ); + gtk_box_pack_start( GTK_BOX( vbox1 ), hbox, FALSE, FALSE, 0 ); + + entry = gtk_entry_new(); + gtk_widget_show( entry ); + gtk_box_pack_start( GTK_BOX( hbox ), entry, FALSE, FALSE, 0 ); + AddDialogData( entry, &m_strEngine, DLG_ENTRY_TEXT ); + + button = gtk_button_new_with_label ("..."); + gtk_widget_show( button ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseEngine ), this ); + gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); + + // this gets done in the project stuff atm +#if 0 + text = gtk_label_new( "Mod subdirectory:" ); + gtk_widget_show( text ); + gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 ); + + entry = gtk_entry_new(); + gtk_widget_show( entry ); + gtk_box_pack_start( GTK_BOX( vbox1 ), entry, FALSE, FALSE, 0 ); + AddDialogData( entry, &m_strMod, DLG_ENTRY_TEXT ); +#endif + + button = gtk_button_new_with_label( "OK" ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); + AddModalButton( button, IDOK ); + + button = gtk_button_new_with_label( "Cancel" ); + gtk_widget_show( button ); + gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 ); + AddModalButton( button, IDCANCEL ); + + gtk_widget_set_usize( button, 60, -2 ); +} + +void CGameInstall::Run() { + ScanGames(); + if ( DoModal() == IDCANCEL ) { + Sys_Printf( "game dialog cancelled\n" ); + return; + } + Sys_Printf( "combo: %d name: %s engine: %s mod: %s\n", m_nComboSelect, m_strName.GetBuffer(), m_strEngine.GetBuffer(), m_strMod.GetBuffer() ); + + // write out the game file + Str gameFilePath = g_strAppPath.GetBuffer(); + gameFilePath += "games/"; + gameFilePath += m_strName.GetBuffer(); + gameFilePath += ".game"; + Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() ); + + FILE *fg = fopen( gameFilePath.GetBuffer(), "w" ); + if ( fg == NULL ) { + Error( "Failed to open %s for writing\n", gameFilePath.GetBuffer() ); + } + fprintf( fg, "\n\n" ); + fclose( fg ); +} + +/* +=============== +CGameInstall::ScanGames +scan for active games that can be installed, based on the presence +=============== +*/ +void CGameInstall::ScanGames() { + Str pakPaths = g_strAppPath.GetBuffer(); + int iGame = 0; + const char *dirname; + + pakPaths += "installs/"; + FindFiles fileScan( pakPaths.GetBuffer() ); + while ( ( dirname = fileScan.NextFile() ) != NULL ) { + if ( stricmp( dirname, Q3_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_Q3; + } + if ( stricmp( dirname, URT_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_URT; + } + if ( stricmp( dirname, UFOAI_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_UFOAI; + } + if ( stricmp( dirname, Q2W_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_Q2W; + } + if ( stricmp( dirname, WARSOW_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_WARSOW; + } + if ( stricmp( dirname, NEXUIZ_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_NEXUIZ; + } + if ( stricmp( dirname, Q2_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_Q2; + } + } +} + diff --git a/radiant/preferences.h b/radiant/preferences.h index 497f183c..7042aa1b 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,163 +19,136 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* -The following source code is licensed by Id Software and subject to the terms of -its LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with -GtkRadiant. If you did not receive a LIMITED USE SOFTWARE LICENSE AGREEMENT, -please contact Id Software immediately at info@idsoftware.com. -*/ +#ifndef _PREFERENCES_H_ +#define _PREFERENCES_H_ -#if !defined(INCLUDED_PREFERENCES_H) -#define INCLUDED_PREFERENCES_H - -#include "libxml/parser.h" #include "dialog.h" -#include -#include +#include "gtkr_list.h" +//#include "profile.h" -void Widget_connectToggleDependency(GtkWidget* self, GtkWidget* toggleButton); +#define MAX_TEXTURE_QUALITY 3 -class PreferencesPage +enum PrefTypes_t { - Dialog& m_dialog; - GtkWidget* m_vbox; -public: - PreferencesPage(Dialog& dialog, GtkWidget* vbox) : m_dialog(dialog), m_vbox(vbox) - { - } - GtkWidget* appendCheckBox(const char* name, const char* flag, bool& data) - { - return m_dialog.addCheckBox(m_vbox, name, flag, data); - } - GtkWidget* appendCheckBox(const char* name, const char* flag, const BoolImportCallback& importCallback, const BoolExportCallback& exportCallback) - { - return m_dialog.addCheckBox(m_vbox, name, flag, importCallback, exportCallback); - } - void appendCombo(const char* name, StringArrayRange values, const IntImportCallback& importCallback, const IntExportCallback& exportCallback) - { - m_dialog.addCombo(m_vbox, name, values, importCallback, exportCallback); - } - void appendCombo(const char* name, int& data, StringArrayRange values) - { - m_dialog.addCombo(m_vbox, name, data, values); - } - void appendSlider(const char* name, int& data, gboolean draw_value, const char* low, const char* high, double value, double lower, double upper, double step_increment, double page_increment, double page_size) - { - m_dialog.addSlider(m_vbox, name, data, draw_value, low, high, value, lower, upper, step_increment, page_increment, page_size); - } - void appendRadio(const char* name, StringArrayRange names, const IntImportCallback& importCallback, const IntExportCallback& exportCallback) - { - m_dialog.addRadio(m_vbox, name, names, importCallback, exportCallback); - } - void appendRadio(const char* name, int& data, StringArrayRange names) - { - m_dialog.addRadio(m_vbox, name, data, names); - } - void appendRadioIcons(const char* name, StringArrayRange icons, const IntImportCallback& importCallback, const IntExportCallback& exportCallback) - { - m_dialog.addRadioIcons(m_vbox, name, icons, importCallback, exportCallback); - } - void appendRadioIcons(const char* name, int& data, StringArrayRange icons) - { - m_dialog.addRadioIcons(m_vbox, name, data, icons); - } - GtkWidget* appendEntry(const char* name, const IntImportCallback& importCallback, const IntExportCallback& exportCallback) - { - return m_dialog.addIntEntry(m_vbox, name, importCallback, exportCallback); - } - GtkWidget* appendEntry(const char* name, int& data) - { - return m_dialog.addEntry(m_vbox, name, data); - } - GtkWidget* appendEntry(const char* name, const SizeImportCallback& importCallback, const SizeExportCallback& exportCallback) - { - return m_dialog.addSizeEntry(m_vbox, name, importCallback, exportCallback); - } - GtkWidget* appendEntry(const char* name, std::size_t& data) - { - return m_dialog.addEntry(m_vbox, name, data); - } - GtkWidget* appendEntry(const char* name, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback) - { - return m_dialog.addFloatEntry(m_vbox, name, importCallback, exportCallback); - } - GtkWidget* appendEntry(const char* name, float& data) - { - return m_dialog.addEntry(m_vbox, name, data); - } - GtkWidget* appendPathEntry(const char* name, bool browse_directory, const StringImportCallback& importCallback, const StringExportCallback& exportCallback) - { - return m_dialog.addPathEntry(m_vbox, name, browse_directory, importCallback, exportCallback); - } - GtkWidget* appendPathEntry(const char* name, CopiedString& data, bool directory) - { - return m_dialog.addPathEntry(m_vbox, name, data, directory); - } - GtkWidget* appendSpinner(const char* name, int& data, double value, double lower, double upper) - { - return m_dialog.addSpinner(m_vbox, name, data, value, lower, upper); - } - GtkWidget* appendSpinner(const char* name, double value, double lower, double upper, const IntImportCallback& importCallback, const IntExportCallback& exportCallback) - { - return m_dialog.addSpinner(m_vbox, name, value, lower, upper, importCallback, exportCallback); - } - GtkWidget* appendSpinner(const char* name, double value, double lower, double upper, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback) - { - return m_dialog.addSpinner(m_vbox, name, value, lower, upper, importCallback, exportCallback); - } + PREF_STR, + PREF_INT, + PREF_BOOL, + PREF_FLOAT, + PREF_VEC3, + PREF_WNDPOS, }; -typedef Callback1 PreferencesPageCallback; - -class PreferenceGroup +/*! +a preference assignment, name, type and pointer to value +we don't store the xmlNodePtr because the document itself can be thrown away upon any LoadPref +(see CGameDialog::UpdatePrefTree) +*/ +class CPrefAssignment { public: - virtual PreferencesPage createPage(const char* treeName, const char* frameName) = 0; + Str mName; + PrefTypes_t mType; + void *mVal; + + CPrefAssignment(char *name, PrefTypes_t Type, void *Val) + { + mName = name; mType = Type; mVal = Val; + } + CPrefAssignment() { mVal = NULL; } + CPrefAssignment(const CPrefAssignment& ass); + virtual ~CPrefAssignment() { } + virtual CPrefAssignment& operator =(const CPrefAssignment& ass); }; -typedef Callback1 PreferenceGroupCallback; -void PreferencesDialog_addInterfacePreferences(const PreferencesPageCallback& callback); -void PreferencesDialog_addInterfacePage(const PreferenceGroupCallback& callback); -void PreferencesDialog_addDisplayPreferences(const PreferencesPageCallback& callback); -void PreferencesDialog_addDisplayPage(const PreferenceGroupCallback& callback); -void PreferencesDialog_addSettingsPreferences(const PreferencesPageCallback& callback); -void PreferencesDialog_addSettingsPage(const PreferenceGroupCallback& callback); - -void PreferencesDialog_restartRequired(const char* staticName); - -template -class LatchedValue +/*! +generic preferences storage class, using xml files +*/ +class CXMLPropertyBag { +private: + /*! + local prefs file + */ + xmlDocPtr mpDoc; + xmlNodePtr mpDocNode; + + /*! + prefs assignments (what pref name, what type, what variable) + */ + list mPrefAssignments; + + /*! + name of file to load/save as + */ + Str mStrFilename; + + /*! + store assignment in the property list if not already there + */ + void PushAssignment(char *name, PrefTypes_t type, void *pV); + + /*! + find the xmlnode relating to the epair name + */ + xmlNodePtr EpairForName(const char *name); + public: - Value m_value; - Value m_latched; - const char* m_description; + CXMLPropertyBag(); + virtual ~CXMLPropertyBag() + { + if (InUse()) + Clear(); + }; - LatchedValue(Value value, const char* description) : m_latched(value), m_description(description) - { - } - void useLatched() - { - m_value = m_latched; - } - void import(Value value) - { - m_latched = value; - if(m_latched != m_value) - { - PreferencesDialog_restartRequired(m_description); - } - } + /*! + read a pref setting, if doesn't exist, will add it to the xml tree (using default value provided) + \arg name the name of the pref + \arg pV pointer to the value + \arg V default value + those functions will fill in the list of preferences assignments + (name, type and pointer to value) + this is used in UpdatePrefTree + */ + void GetPref(char *name, Str *pV, char *V); + void GetPref(char *name, int *pV, int V); + void GetPref(char *name, bool *pV, bool V); + void GetPref(char *name, float *pV, float V); + void GetPref(char *name, float *pV, float* V); + void GetPref(char *name, window_position_t* pV, window_position_t V); + + /*! + returns whether or not the property bag is already open + */ + qboolean InUse() { return (mpDoc != NULL); }; + + /*! + unload the xml doc, and free the tree + */ + void Clear(); + + /*| + read data from our XML file + */ + void ReadXMLFile(const char* pFilename); + + /*| + write out the property bag to an XML data file + return is success/fail + */ + qboolean WriteXMLFile(const char* pFilename); + + /*! + update the xml tree with data form the property list, usually in preparation for a write + */ + void UpdatePrefTree(); + + /*! + did the file have any data or not? + */ + qboolean mbEmpty; }; -typedef LatchedValue LatchedBool; -typedef MemberCaller1 LatchedBoolImportCaller; - -typedef LatchedValue LatchedInt; -typedef MemberCaller1 LatchedIntImportCaller; - /*! holds information for a given game I'm a bit unclear on that still @@ -190,57 +163,113 @@ else (i.e. not generated, copied over during setup .. for instance in the game t */ class CGameDescription { -typedef std::map GameDescription; - public: - CopiedString mGameFile; ///< the .game file that describes this game - GameDescription m_gameDescription; + xmlDocPtr mpDoc; ///< the game description xml tree + Str mGameToolsPath; ///< the explicit path to the game-dependent modules + Str mGameName; ///< name of the game used in dialogs + Str mGameFile; ///< the .game file that describes this game + Str mBaseGame; ///< basegame directory + Str mEnginePath; ///< path to the engine + Str mEngine; ///< engine name +#if defined (__linux__) || defined (__APPLE__) + Str mUserPathPrefix; ///< prefix for ~/.q3a ~/.wolf init, only on *nix +#endif + Str mShaderPath; ///< the path in which to look for shaders + Str mShaderlist; ///< shaderlist file + float mTextureDefaultScale; ///< default scale (0.5 in q3, 1.0 in q1/q2, 0.25 in JK2 ..) + bool mEClassSingleLoad; ///< only load a single eclass definition file + bool mNoPatch; ///< this game doesn't support patch technology + Str mCaulkShader; ///< the shader to use for caulking + bool quake2; ///< set this to true to get quake2 - CopiedString mGameToolsPath; ///< the explicit path to the game-dependent modules - CopiedString mGameType; ///< the type of the engine - - const char* getKeyValue(const char* key) const - { - GameDescription::const_iterator i = m_gameDescription.find(key); - if(i != m_gameDescription.end()) - { - return (*i).second.c_str(); - } - return ""; - } - const char* getRequiredKeyValue(const char* key) const - { - GameDescription::const_iterator i = m_gameDescription.find(key); - if(i != m_gameDescription.end()) - { - return (*i).second.c_str(); - } - ERROR_MESSAGE("game attribute " << makeQuoted(key) << " not found in " << makeQuoted(mGameFile.c_str())); - return ""; - } - - CGameDescription(xmlDocPtr pDoc, const CopiedString &GameFile); + CGameDescription() { mpDoc = NULL; } + /*! + \todo parse basic info from the node + user-friendly name of the game + essential parameters (such as the start dir) + */ + CGameDescription(xmlDocPtr pDoc, const Str &GameFile); + virtual ~CGameDescription() { xmlFreeDoc(mpDoc); } void Dump(); }; -extern CGameDescription *g_pGameDescription; +/*! +select games, copy editing assets and write out configuration files + */ -typedef struct _GtkWidget GtkWidget; -class PrefsDlg; +#define Q3_PACK "Q3Pack" +#define URT_PACK "UrTPack" +#define UFOAI_PACK "UFOAIPack" +#define Q2W_PACK "Q2WPack" +#define WARSOW_PACK "WarsowPack" +#define NEXUIZ_PACK "NexuizPack" +#define Q2_PACK "Q2Pack" -class PreferencesPage; +class CGameInstall : public Dialog { +public: + CGameInstall(); + void ScanGames(); + void Run(); + void BuildDialog(); -class StringOutputStream; + static void OnBtnBrowseEngine( GtkWidget *widget, gpointer data ); + static void OnGameSelectChanged( GtkWidget *widget, gpointer data ); + + enum gameType_e { + GAME_NONE = 0, + GAME_Q3 = 1, + GAME_URT, + GAME_UFOAI, + GAME_Q2W, + GAME_WARSOW, + GAME_NEXUIZ, + GAME_Q2, + GAME_COUNT + }; + +protected: + Str m_strName; + Str m_strMod; + Str m_strEngine; + int m_nComboSelect; + + // maps from m_nComboSelect to the games + int m_availGames[GAME_COUNT]; +}; /*! standalone dialog for games selection, and more generally global settings */ class CGameDialog : public Dialog { + GtkWidget *mFrame; ///< this is built on-demand first time it's used + GtkWidget *mTopBox; ///< top level box used to store the dialog frame, must unhook after modal use + + GtkComboBox *mGameCombo; // combo box holds the selection of available game + + /*! + global prefs storage + */ + CXMLPropertyBag mGlobalPrefs; + +#ifdef _WIN32 + /*! + run from a network share + this one is not being saved out in prefs, since we need to know before we load prefs + we use a dummy file NETRUN_FILENAME as flag + all done with static stuff + */ + static bool m_bNetRun; +#endif + + bool m_bDoGameInstall; + + CGameInstall mGameInstall; + protected: - mutable int m_nComboSelect; ///< intermediate int value for combo in dialog box + int m_nComboSelect; ///< intermediate int value for combo in dialog box public: @@ -255,32 +284,41 @@ public: what game has been selected this is the name of the .game file */ - CopiedString m_sGameFile; + Str m_sGameFile; /*! - prompt which game to load on startup + auto-load the game on startup + this is linked to auto-load checkbox */ - bool m_bGamePrompt; + bool m_bAutoLoadGame; /*! log console to radiant.log m_bForceLogConsole is an obscure forced latching situation */ + bool m_bLogConsole; bool m_bForceLogConsole; /*@}*/ + /*! + points somewhere in mGames, set once at startup + */ + CGameDescription *m_pCurrentGameDescription; + /*! the list of game descriptions we scanned from the game/ dir */ - std::list mGames; + list mGames; - CGameDialog() : - m_sGameFile(""), - m_bGamePrompt(true), - m_bForceLogConsole(false) - { + CGameDialog() { + mFrame = NULL; + m_pCurrentGameDescription = NULL; + m_bLogConsole = false; + m_bForceLogConsole = false; + m_bDoGameInstall = true; // go through DoModal at least once + mGameCombo = NULL; } virtual ~CGameDialog(); - void AddPacksURL(StringOutputStream &s); + void AddPacksURL( Str &s ); /*! intialize the game dialog, called at CPrefsDlg::Init @@ -298,14 +336,17 @@ public: */ void DoGameDialog(); + /*! + call out to the game installation dialog + */ + void DoGameInstall(); + /*! Dialog API this is only called when the dialog is built at startup for main engine select */ - GtkWindow* BuildDialog(); - - void GameFileImport(int value); - void GameFileExport(const IntImportCallback& importCallback) const; + void BuildDialog(); + void UpdateData( bool retrieve ); /*! construction of the dialog frame @@ -314,7 +355,7 @@ public: for prefs, we hook the frame in the main notebook build the frame on-demand (only once) */ - void CreateGlobalFrame(PreferencesPage& page); + GtkWidget *GetGlobalFrame(); /*! global preferences subsystem @@ -328,6 +369,19 @@ public: void SavePrefs(); ///< save pref variables to file /*@}*/ + /*! + read or set netrun (check file) + \param retrieve + if false, will check if netrun file is present and will set m_bNetRun + if true, will create/erase the netrun file depending on m_bNetRun + NOTE: this is not backwards, 'retrieve' means 'retrieve from settings dialog' - in terms of UI + */ + static void UpdateNetrun(bool retrieve); + /*! + get current netrun setting + */ + static bool GetNetrun(); + private: /*! scan for .game files, load them @@ -335,7 +389,7 @@ private: void ScanForGames(); /*! - inits g_Preferences.m_global_rc_path + inits g_PrefsDlg.m_global_rc_path */ void InitGlobalPrefPath(); @@ -343,27 +397,92 @@ private: uses m_nComboItem to find the right mGames */ CGameDescription *GameDescriptionForComboItem(); + + /*! + callback for the game install button + */ + static void SInstallCallback( GtkWidget *widget, gpointer data ); + + void UpdateGameCombo(); }; -/*! -this holds global level preferences -*/ -extern CGameDialog g_GamesDialog; +typedef struct { + int nEntitySplit1; + int nEntitySplit2; + + window_position_t position; + window_position_t posEntityWnd; + window_position_t posMapInfoWnd; + window_position_t posCamWnd; + window_position_t posZWnd; + window_position_t posXYWnd; + window_position_t posXZWnd; + window_position_t posYZWnd; + window_position_t posPatchWnd; + window_position_t posSurfaceWnd; + window_position_t posEntityInfoWnd; -class texdef_t; + int nXYHeight; + int nZWidth; + int nXYWidth; + int nCamWidth; + int nCamHeight; + int nZFloatWidth; + int nState; +} windowPosInfo_t; class PrefsDlg : public Dialog { -public: -protected: - std::list mGames; public: - - GtkWidget *m_notebook; + /*! + local prefs file + */ + CXMLPropertyBag mLocalPrefs; - virtual ~PrefsDlg() + // will enable/disable stuff according to the situation + void DoSensitivity(); + void PreModal() { DoSensitivity(); } + + // enable/disable custom editor entry + void DoEditorSensitivity(); + + /*! + this holds global level preferences + */ + CGameDialog mGamesDialog; +protected: + // warning about old project files + bool m_bWarn; + list mGames; + +public: + // last light intensity used in the CLightPrompt dialog, stored in registry + int m_iLastLightIntensity; + // these mirror what goes in the combo box + // see PrefDlg::m_nShader, tells wether to load NONE / COMMON or ALL shaders at parsing stage + enum {SHADER_NONE = 0, SHADER_COMMON, SHADER_ALL}; + + // Gef: updated preferences dialog + /*! Preference notebook page numbers */ + enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_LAYOUT, PTAB_MOUSE, + PTAB_EDITING, PTAB_STARTUP, PTAB_PATHS, PTAB_MISC, PTAB_BSPMONITOR} pref_tabs; + + GtkWidget *notebook; + + void UpdateTextureCompression(); + +#ifdef ATIHACK_812 + void UpdateATIHack(); +#endif + + void LoadPrefs(); + void SavePrefs(); + void LoadTexdefPref(texdef_t* pTexdef, char* pName); + + PrefsDlg (); + virtual ~PrefsDlg () { g_string_free (m_rc_path, true ); g_string_free (m_inipath, true ); @@ -371,16 +490,16 @@ public: /*! path for global settings - win32: AppPath - linux: ~/.radiant/[version]/ + win32: g_strAppPath + linux: ~/.radiant// */ GString *m_global_rc_path; /*! path to per-game settings used for various game dependant storage - win32: GameToolsPath - linux: ~/.radiant/[version]/[gamename]/ + win32: g_strGameToolsPath + linux: ~/.radiant/// */ GString *m_rc_path; @@ -394,41 +513,185 @@ public: // initialize the above paths void Init(); +#if 0 + // DEPRECATED: use engine path from the current game description instead + // path to the top-level installation + Str m_strEnginePath; + // name of executable + // quake2 quake3 etc + Str m_strEngine; + // we use this Str to store the full path to the engine: m_strEnginePath + m_strEngine + // it's not stored in the registry or anything, just ued for display in prefs + Str m_strPrefsDlgEngine; +#endif + + // Dialog Data + int m_nMouse; + MainFrame::EViewStyle m_nView; + bool m_bTextureLock; + bool m_bLoadLast; + // path to the project loaded at startup + // if g_PrefsDlg can't find the information in the ini file + // it will try to guess and eventually ask the user + Str m_strLastProject; + /*! + version of last loaded project file + says -1 if there's no version loaded + if it's a manually constructed project file, will be 0 + otherwise the actual 'version' epair + */ + int m_nLastProjectVer; + Str m_strLastMap; + bool m_bInternalBSP; + bool m_bRightClick; + bool m_bSetGame; + bool m_bAutoSave; + bool m_bLoadLastMap; + bool m_bTextureWindow; + bool m_bSnapShots; + float m_fTinySize; + bool m_bCleanTiny; + bool m_bCamXYUpdate; + int m_nCamDragMultiSelect; + bool m_bCamDragMultiSelect; + bool m_bCamFreeLook; + bool m_bCamFreeLookStrafe; + bool m_bCamInverseMouse; + bool m_bCamDiscrete; + bool m_bNewLightDraw; + Str m_strPrefabPath; + int m_nWhatGame; + bool m_bALTEdge; + bool m_bFaceColors; + bool m_bXZVis; + bool m_bYZVis; + bool m_bZVis; + bool m_bSizePaint; + bool m_bDLLEntities; + bool m_bRotateLock; + bool m_bDetachableMenus; + bool m_bPatchToolbar; + bool m_bWideToolbar; + bool m_bPluginToolbar; + bool m_bNoClamp; + //++timo this is most likely broken, I don't know what it's supposed to do + Str m_strUserPath; + int m_nRotation; + bool m_bChaseMouse; + bool m_bTextureScrollbar; + bool m_bDisplayLists; + bool m_bAntialiasedPointsAndLines; // Fishman - Add antialiazed points and lines support. 09/03/00 + bool m_bShowShaders; + int m_nShader; + bool m_bNoStipple; + int m_nUndoLevels; + bool m_bVertexSplit; + + int m_nMouseButtons; + int m_nAngleSpeed; + int m_nMoveSpeed; + int m_nAutoSave; + bool m_bCubicClipping; + int m_nCubicScale; + bool m_bSelectCurves; + bool m_bSelectModels; + int m_nEntityShowState; + int m_nTextureScale; + bool m_bNormalizeColors; + bool m_bSwitchClip; + bool m_bSelectWholeEntities; + int m_nTextureQuality; + bool m_bGLLighting; + bool m_bTexturesShaderlistOnly; + int m_nSubdivisions; + bool m_bFloatingZ; + bool m_bLatchedFloatingZ; + // Gef: Kyro GL_POINT workaround + bool m_bGlPtWorkaround; + + // how many menus in the texture thing before we split? + int m_nTextureMenuSplit; + + // watch the BSP process through network connections + // true: trigger the BSP steps one by one and monitor them through the network + // false: create a BAT / .sh file and execute it. don't bother monitoring it. + bool m_bWatchBSP; + // do we stop the compilation process if we come accross a leak? + bool m_bLeakStop; + // timeout when beginning a step (in seconds) + // if we don't get a connection quick enough we assume something failed and go back to idling + int m_iTimeout; + bool m_bRunQuake; + // store prefs setting for automatic sleep mode activation + bool m_bDoSleep; + + bool m_bClipCaulk; + + // make the texture increments match the grid changes + bool m_bSnapTToGrid; + + // try to fix the target/targetname conflicts when importing a map (default true) + bool m_bDoTargetFix; + + // the increment step we use against the wheel mouse + int m_nWheelInc; + +#ifdef _WIN32 + // use the file associations to open files instead of builtin Gtk editor + bool m_bUseWin32Editor; +#else + // custom shader editor + bool m_bUseCustomEditor; + Str m_strEditorCommand; // this is the command executed +#endif + +#ifdef _WIN32 + bool m_bNativeGUI; + bool m_bStartOnPrimMon; +#endif + + bool m_bPatchBBoxSelect; + + // RR2DO2: latched data, for settings that require a restart. We don't want to set + // these directly in case users set them under preferences and then continue working + // with the editor. + MainFrame::EViewStyle m_nLatchedView; + int m_nMRUCount; + Str m_strMRUFiles[4]; + + windowPosInfo_t mWindowInfo; + + bool m_bLatchedDetachableMenus; + bool m_bLatchedPatchToolbar; + bool m_bLatchedWideToolbar; + bool m_bLatchedPluginToolbar; + int m_nLatchedShader; + int m_nLatchedTextureQuality; + + // RIANT + // texture compression format + int m_nTextureCompressionFormat; + + int m_nLightRadiuses; + + bool m_bQ3Map2Texturing; + +#ifdef ATIHACK_812 + bool m_bGlATIHack; +#endif + + void UpdateData (bool retrieve); + /*! Utility function for swapping notebook pages for tree list selections */ - void showPrefPage(GtkWidget* prefpage); + void showPrefPage(int prefpage); protected: + /*! Scan for game description files and build a list */ + void ScanForGames(); /*! Dialog API */ - GtkWindow* BuildDialog(); - void PostModal (EMessageBoxReturn code); + void BuildDialog (); + void PostModal (int code); }; -extern PrefsDlg g_Preferences; - -struct preferences_globals_t -{ - // disabled all INI / registry read write .. used when shutting down after registry cleanup - bool disable_ini; - preferences_globals_t() : disable_ini(false) - { - } -}; -extern preferences_globals_t g_preferences_globals; - -typedef struct _GtkWindow GtkWindow; -void PreferencesDialog_constructWindow(GtkWindow* main_window); -void PreferencesDialog_destroyWindow(); - -void PreferencesDialog_showDialog(); - -void GlobalPreferences_Init(); -void Preferences_Init(); - -void Preferences_Load(); -void Preferences_Save(); - -void Preferences_Reset(); - - -#endif +#endif // _PREFERENCES_H_ diff --git a/libs/profile/profile.cpp b/radiant/profile.cpp similarity index 83% rename from libs/profile/profile.cpp rename to radiant/profile.cpp index 7fcedbb9..bbd5bd24 100644 --- a/libs/profile/profile.cpp +++ b/radiant/profile.cpp @@ -34,18 +34,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Leonardo Zide (leo@lokigames.com) // -#include "profile.h" - -#include -#include -#include - -#include "file.h" - +#include "stdafx.h" +#include #include - +#include +#include +#include #include "str.h" - +#include "file.h" // ============================================================================= // Static functions @@ -105,7 +101,7 @@ bool read_var (const char *filename, const char *section, const char *key, char return false; } -bool save_var (const char *filename, const char *section, const char *key, const char *value) +static bool save_var (const char *filename, const char *section, const char *key, const char *value) { char line[1024], *ptr; MemStream old_rc; @@ -116,15 +112,15 @@ bool save_var (const char *filename, const char *section, const char *key, const if (rc != NULL) { - unsigned int len; + guint32 len; void *buf; fseek (rc, 0, SEEK_END); len = ftell (rc); rewind (rc); - buf = malloc (len); + buf = qmalloc (len); fread (buf, len, 1, rc); - old_rc.write (reinterpret_cast(buf), len); + old_rc.Write (buf, len); free (buf); fclose (rc); old_rc.Seek (0, SEEK_SET); @@ -194,29 +190,29 @@ bool save_var (const char *filename, const char *section, const char *key, const // ============================================================================= // Global functions -bool profile_save_int (const char *filename, const char *section, const char *key, int value) +bool WINAPI profile_save_int (const char *filename, const char *section, const char *key, int value) { char buf[16]; sprintf (buf, "%d", value); return save_var (filename, section, key, buf); } -bool profile_save_float (const char *filename, const char *section, const char *key, float value) +bool WINAPI profile_save_float (const char *filename, const char *section, const char *key, float value) { char buf[16]; sprintf (buf, "%f", value); return save_var (filename, section, key, buf); } -bool profile_save_string (const char * filename, const char *section, const char *key, const char *value) +bool WINAPI profile_save_string (const char * filename, const char *section, const char *key, const char *value) { return save_var (filename, section, key, value); } -bool profile_save_buffer (const char * rc_path, const char *name, void *buffer, unsigned int size) +bool profile_save_buffer (const char * rc_path, const char *name, void *buffer, guint32 size) { bool ret = false; - char filename[1024]; + char filename[PATH_MAX]; sprintf (filename, "%s/%s.bin", rc_path, name); FILE *f; @@ -233,12 +229,12 @@ bool profile_save_buffer (const char * rc_path, const char *name, void *buffer, return ret; } -bool profile_load_buffer (const char * rc_path, const char *name, void *buffer, unsigned int *plSize) +bool profile_load_buffer (const char * rc_path, const char *name, void *buffer, guint32 *plSize) { - char filename[1024]; + char filename[PATH_MAX]; sprintf (filename, "%s/%s.bin", rc_path, name); bool ret = false; - unsigned int len; + guint32 len; FILE *f; f = fopen (filename, "rb"); @@ -263,7 +259,7 @@ bool profile_load_buffer (const char * rc_path, const char *name, void *buffer, return true; } -int profile_load_int (const char *filename, const char *section, const char *key, int default_value) +int WINAPI profile_load_int (const char *filename, const char *section, const char *key, int default_value) { char value[1024]; @@ -273,17 +269,17 @@ int profile_load_int (const char *filename, const char *section, const char *key return default_value; } -float profile_load_float (const char *filename, const char *section, const char *key, float default_value) +float WINAPI profile_load_float (const char *filename, const char *section, const char *key, float default_value) { char value[1024]; if (read_var (filename, section, key, value)) - return static_cast(atof(value)); + return atof (value); else return default_value; } -char* profile_load_string (const char *filename, const char *section, const char *key, const char *default_value) +char* WINAPI profile_load_string (const char *filename, const char *section, const char *key, const char *default_value) { static Str ret; char value[1024]; @@ -293,5 +289,5 @@ char* profile_load_string (const char *filename, const char *section, const char else ret = default_value; - return (char*)ret.GetBuffer(); + return (char*)ret.GetBuffer (); } diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index a526c608..71bb374b 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,376 +19,1774 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* -The following source code is licensed by Id Software and subject to the terms of -its LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with -GtkRadiant. If you did not receive a LIMITED USE SOFTWARE LICENSE AGREEMENT, -please contact Id Software immediately at info@idsoftware.com. -*/ - // // Linux stuff // // Leonardo Zide (leo@lokigames.com) // -#include "qe3.h" - -#include "debugging/debugging.h" - -#include "ifilesystem.h" -//#include "imap.h" - -#include - -#include - -#include "stream/textfilestream.h" -#include "cmdlib.h" -#include "stream/stringstream.h" -#include "os/path.h" -#include "scenelib.h" - -#include "gtkutil/messagebox.h" -#include "error.h" -#include "map.h" -#include "build.h" -#include "points.h" -#include "camwindow.h" -#include "mainframe.h" -#include "preferences.h" -#include "watchbsp.h" -#include "autosave.h" -#include "convert.h" +#include "stdafx.h" +#include +#include +#include "gtkmisc.h" +#if defined (__linux__) || defined (__APPLE__) +#include +#include +#include +#include +#endif +// for the logging part +#include +#include QEGlobals_t g_qeglobals; +QEGlobals_GUI_t g_qeglobals_gui; +// leo: Track memory allocations for debugging +// NOTE TTimo this was never used and probably not relevant +// there are tools to do that +#ifdef MEM_DEBUG -#if defined(WIN32) -#define PATH_MAX 260 -#endif +static GList *memblocks; - -void QE_InitVFS() +void* debug_malloc (size_t size, const char* file, int line) { - // VFS initialization ----------------------- - // we will call GlobalFileSystem().initDirectory, giving the directories to look in (for files in pk3's and for standalone files) - // we need to call in order, the mod ones first, then the base ones .. they will be searched in this order - // *nix systems have a dual filesystem in ~/.q3a, which is searched first .. so we need to add that too + void *buf = g_malloc (size + 8); - const char* gamename = gamename_get(); - const char* basegame = basegame_get(); -#if defined(POSIX) - const char* userRoot = g_qeglobals.m_userEnginePath.c_str(); -#endif - const char* globalRoot = EnginePath_get(); + *((const char**)buf) = file; + buf = (char*)buf + 4; + *((int*)buf) = line; + buf = (char*)buf + 4; - // if we have a mod dir - if(!string_equal(gamename, basegame)) + memblocks = g_list_append (memblocks, buf); + + return buf; +} + +void debug_free (void *buf, const char* file, int line) +{ + const char *f; + int l; + + if (g_list_find (memblocks, buf)) { -#if defined(POSIX) - // ~/./ - { - StringOutputStream userGamePath(256); - userGamePath << userRoot << gamename << '/'; - GlobalFileSystem().initDirectory(userGamePath.c_str()); - } + memblocks = g_list_remove (memblocks, buf); + + buf = (char*)buf - 4; + l = *((int*)buf); + buf = (char*)buf - 4; + f = *((const char**)buf); + + Sys_FPrintf (SYS_DBG, "free: %s %d", file, line); + Sys_FPrintf (SYS_DBG, " allocated: %s %d\n", f, l); + + g_free (buf); + } +// else +// free (buf); // from qmalloc, will leak unless we add this same hack to cmdlib +} + #endif - // / +vec_t Rad_rint (vec_t in) +{ + if (g_PrefsDlg.m_bNoClamp) + return in; + else + return (float)floor (in + 0.5); +} + +void WINAPI QE_CheckOpenGLForErrors(void) +{ + char strMsg[1024]; + int i = qglGetError(); + if (i != GL_NO_ERROR) + { + if (i == GL_OUT_OF_MEMORY) + { + sprintf(strMsg, "OpenGL out of memory error %s\nDo you wish to save before exiting?", qgluErrorString((GLenum)i)); + if (gtk_MessageBox(g_pParentWnd->m_pWidget, strMsg, "Radiant Error", MB_YESNO) == IDYES) + { + Map_SaveFile(NULL, false); + } + _exit(1); + } + else { - StringOutputStream globalGamePath(256); - globalGamePath << globalRoot << gamename << '/'; - GlobalFileSystem().initDirectory(globalGamePath.c_str()); + Sys_Printf ("Warning: OpenGL Error %s\n", qgluErrorString((GLenum)i)); } } +} -#if defined(POSIX) - // ~/./ +// NOTE: don't this function, use VFS instead +char *ExpandReletivePath (char *p) +{ + static char temp[1024]; + const char *base; + + if (!p || !p[0]) + return NULL; + if (p[0] == '/' || p[0] == '\\') + return p; + + base = ValueForKey(g_qeglobals.d_project_entity, "basepath"); + sprintf (temp, "%s/%s", base, p); + return temp; +} + +char *copystring (char *s) +{ + char *b; + b = (char*)malloc(strlen(s)+1); + strcpy (b,s); + return b; +} + + +bool DoesFileExist(const char* pBuff, long& lSize) +{ + FileStream file; + if (file.Open(pBuff, "r")) { - StringOutputStream userBasePath(256); - userBasePath << userRoot << basegame << '/'; - GlobalFileSystem().initDirectory(userBasePath.c_str()); - } -#endif - - // / - { - StringOutputStream globalBasePath(256); - globalBasePath << globalRoot << basegame << '/'; - GlobalFileSystem().initDirectory(globalBasePath.c_str()); - } -} - -int g_numbrushes = 0; -int g_numentities = 0; - -void QE_UpdateStatusBar() -{ - char buffer[128]; - sprintf(buffer, "Brushes: %d Entities: %d", g_numbrushes, g_numentities); - g_pParentWnd->SetStatusText(g_pParentWnd->m_brushcount_status, buffer); -} - -SimpleCounter g_brushCount; - -void QE_brushCountChanged() -{ - g_numbrushes = int(g_brushCount.get()); - QE_UpdateStatusBar(); -} - -SimpleCounter g_entityCount; - -void QE_entityCountChanged() -{ - g_numentities = int(g_entityCount.get()); - QE_UpdateStatusBar(); -} - -bool ConfirmModified(const char* title) -{ - if (!Map_Modified(g_map)) + lSize += file.GetLength(); + file.Close(); return true; - - EMessageBoxReturn result = gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, eMB_YESNOCANCEL, eMB_ICONQUESTION); - if(result == eIDCANCEL) - { - return false; } - if(result == eIDYES) - { - if(Map_Unnamed(g_map)) - { - return Map_SaveAs(); - } - else - { - return Map_Save(); - } - } - return true; + return false; } -const char* const EXECUTABLE_TYPE = -#if defined(__linux__) || defined (__FreeBSD__) -"x86" -#elif defined(__APPLE__) -"ppc" -#elif defined(WIN32) -"exe" -#else -#error "unknown platform" +void Map_Snapshot() +{ + CString strMsg; + + // I hope the modified flag is kept correctly up to date + if (!modified) + return; + + // we need to do the following + // 1. make sure the snapshot directory exists (create it if it doesn't) + // 2. find out what the lastest save is based on number + // 3. inc that and save the map + CString strOrgPath, strOrgFile; + ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile); + AddSlash(strOrgPath); + strOrgPath += "snapshots"; + bool bGo = true; + struct stat Stat; + if (stat(strOrgPath, &Stat) == -1) + { +#ifdef _WIN32 + bGo = (_mkdir(strOrgPath) != -1); #endif -; -void bsp_init() -{ - build_set_variable("RadiantPath", AppPath_get()); - build_set_variable("ExecutableType", EXECUTABLE_TYPE); - build_set_variable("EnginePath", EnginePath_get()); - build_set_variable("MonitorAddress", (g_WatchBSP_Enabled) ? "127.0.0.1:39000" : ""); - build_set_variable("GameName", gamename_get()); - - build_set_variable("MapFile", Map_Name(g_map)); -} - -void bsp_shutdown() -{ - build_clear_variables(); -} - -class ArrayCommandListener : public CommandListener -{ - GPtrArray* m_array; -public: - ArrayCommandListener() - { - m_array = g_ptr_array_new(); +#if defined (__linux__) || defined (__APPLE__) + bGo = (mkdir(strOrgPath,0755) != -1); +#endif } - ~ArrayCommandListener() + AddSlash(strOrgPath); + if (bGo) { - g_ptr_array_free(m_array, TRUE); - } - - void execute(const char* command) - { - g_ptr_array_add(m_array, g_strdup(command)); - } - - GPtrArray* array() const - { - return m_array; - } -}; - -class BatchCommandListener : public CommandListener -{ - TextOutputStream& m_file; - std::size_t m_commandCount; - const char* m_outputRedirect; -public: - BatchCommandListener(TextOutputStream& file, const char* outputRedirect) : m_file(file), m_commandCount(0), m_outputRedirect(outputRedirect) - { - } - - void execute(const char* command) - { - m_file << command; - if (m_commandCount == 0) + int nCount = 0; + long lSize = 0; + CString strNewPath; + strNewPath = strOrgPath; + strNewPath += strOrgFile; + CString strFile; + while (bGo) { - m_file << " > "; + char buf[PATH_MAX]; + sprintf( buf, "%s.%i", strNewPath.GetBuffer(), nCount ); + strFile = buf; + bGo = DoesFileExist(strFile, lSize); + nCount++; } - else + // strFile has the next available slot + Map_SaveFile(strFile, false); + // it is still a modified map (we enter this only if this is a modified map) + Sys_SetTitle (currentmap); + Sys_MarkMapModified(); + if (lSize > 12 * 1024 * 1024) // total size of saves > 4 mb { - m_file << " >> "; + Sys_Printf("The snapshot files in %s total more than 4 megabytes. You might consider cleaning up.", strOrgPath.GetBuffer()); } - m_file << "\"" << m_outputRedirect << "\""; - m_file << "\n"; - ++m_commandCount; - } -}; - -bool Region_cameraValid() -{ - Vector3 vOrig(vector3_snapped(Camera_getOrigin(*g_pParentWnd->GetCamWnd()))); - - for (int i=0 ; i<3 ; i++) - { - if (vOrig[i] > region_maxs[i] || vOrig[i] < region_mins[i]) - { - return false; - } - } - return true; -} - - -void RunBSP(const char* name) -{ - // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503 - // make sure we don't attempt to region compile a map with the camera outside the region - if (region_active && !Region_cameraValid()) - { - globalErrorStream() << "The camera must be in the region to start a region compile.\n"; - return; - } - - SaveMap(); - - if(Map_Unnamed(g_map)) - { - globalOutputStream() << "build cancelled\n"; - return; - } - - if (g_SnapShots_Enabled && !Map_Unnamed(g_map) && Map_Modified(g_map)) - { - Map_Snapshot(); - } - - if (region_active) - { - const char* mapname = Map_Name(g_map); - StringOutputStream name(256); - name << StringRange(mapname, path_get_filename_base_end(mapname)) << ".reg"; - Map_SaveRegion(name.c_str()); - } - - Pointfile_Delete(); - - bsp_init(); - - if (g_WatchBSP_Enabled) - { - ArrayCommandListener listener; - build_run(name, listener); - // grab the file name for engine running - const char* fullname = Map_Name(g_map); - StringOutputStream bspname(64); - bspname << StringRange(path_get_filename_start(fullname), path_get_filename_base_end(fullname)); - BuildMonitor_Run( listener.array(), bspname.c_str() ); } else { - char junkpath[PATH_MAX]; - strcpy(junkpath, SettingsPath_get()); - strcat(junkpath, "junk.txt"); + strMsg.Format("Snapshot save failed.. unabled to create directory\n%s", strOrgPath.GetBuffer()); + gtk_MessageBox(g_pParentWnd->m_pWidget, strMsg); + } + strOrgPath = ""; + strOrgFile = ""; +} +/* +=============== +QE_CheckAutoSave - char batpath[PATH_MAX]; -#if defined(POSIX) - strcpy(batpath, SettingsPath_get()); - strcat(batpath, "qe3bsp.sh"); -#elif defined(WIN32) - strcpy(batpath, SettingsPath_get()); - strcat(batpath, "qe3bsp.bat"); -#else -#error "unsupported platform" -#endif - bool written = false; - { - TextFileOutputStream batchFile(batpath); - if(!batchFile.failed()) - { -#if defined (POSIX) - batchFile << "#!/bin/sh \n\n"; -#endif - BatchCommandListener listener(batchFile, junkpath); - build_run(name, listener); - written = true; - } - } - if(written) - { -#if defined (POSIX) - chmod (batpath, 0744); -#endif - globalOutputStream() << "Writing the compile script to '" << batpath << "'\n"; - globalOutputStream() << "The build output will be saved in '" << junkpath << "'\n"; - Q_Exec(batpath, NULL, NULL, true); - } +If five minutes have passed since making a change +and the map hasn't been saved, save it out. +=============== +*/ + + +void QE_CheckAutoSave( void ) +{ + static time_t s_start; + time_t now; + time (&now); + + if (modified != 1 || !s_start) + { + s_start = now; + return; } - bsp_shutdown(); + if ((now - s_start) > (60 * g_PrefsDlg.m_nAutoSave)) + { + if (g_PrefsDlg.m_bAutoSave) + { + CString strMsg; + strMsg = g_PrefsDlg.m_bSnapShots ? "Autosaving snapshot..." : "Autosaving..."; + Sys_Printf(strMsg); + Sys_Printf("\n"); + Sys_Status (strMsg,0); + + // only snapshot if not working on a default map + if (g_PrefsDlg.m_bSnapShots && stricmp(currentmap, "unnamed.map") != 0) + { + Map_Snapshot(); + } + else + { + Map_SaveFile (ValueForKey(g_qeglobals.d_project_entity, "autosave"), false); + } + + Sys_Status ("Autosaving...Saved.", 0 ); + modified = 2; + } + else + { + Sys_Printf ("Autosave skipped...\n"); + Sys_Status ("Autosave skipped...", 0 ); + } + s_start = now; + } } + +// NOTE TTimo we don't like that BuildShortPathName too much +// the VFS provides a vfsCleanFileName which should perform the cleanup tasks +// in the long run I'd like to completely get rid of this + +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=144 +// used to be disabled, but caused problems + +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=291 +// can't work with long win32 names until the BSP commands are not working differently +#ifdef _WIN32 +int BuildShortPathName(const char* pPath, char* pBuffer, int nBufferLen) +{ + char *pFile = NULL; + int nResult = GetFullPathName(pPath, nBufferLen, pBuffer, &pFile); + nResult = GetShortPathName(pPath, pBuffer, nBufferLen); + if (nResult == 0) + strcpy(pBuffer, pPath); // Use long filename + return nResult; +} +#endif + +#if defined (__linux__) || defined (__APPLE__) +int BuildShortPathName(const char* pPath, char* pBuffer, int nBufferLen) +{ + // remove /../ from directories + const char *scr = pPath; char *dst = pBuffer; + for (int i = 0; (i < nBufferLen) && (*scr != 0); i++) + { + if (*scr == '/' && *(scr+1) == '.' && *(scr+2) == '.') + { + scr += 3; + while (dst != pBuffer && *(--dst) != '/') + { + i--; + } + } + + *dst = *scr; + + scr++; dst++; + } + *dst = 0; + + return strlen (pBuffer); +} +#endif + +/* +const char *g_pPathFixups[]= +{ + "basepath", + "autosave", +}; + +const int g_nPathFixupCount = sizeof(g_pPathFixups) / sizeof(const char*); + +void QE_CheckProjectEntity() +{ + char *pFile; + char pBuff[PATH_MAX]; + char pNewPath[PATH_MAX]; + for (int i = 0; i < g_nPathFixupCount; i++) + { + char *pPath = ValueForKey (g_qeglobals.d_project_entity, g_pPathFixups[i]); + + strcpy (pNewPath, pPath); + if (pPath[0] != '\\' && pPath[0] != '/') + if (GetFullPathName(pPath, PATH_MAX, pBuff, &pFile)) + strcpy (pNewPath, pBuff); + + BuildShortPathName (pNewPath, pBuff, PATH_MAX); + + // check it's not ending with a filename seperator + if (pBuff[strlen(pBuff)-1] == '/' || pBuff[strlen(pBuff)-1] == '\\') + { + Sys_FPrintf(SYS_WRN, "WARNING: \"%s\" path in the project file has an ending file seperator, fixing.\n", g_pPathFixups[i]); + pBuff[strlen(pBuff)-1]=0; + } + + SetKeyValue(g_qeglobals.d_project_entity, g_pPathFixups[i], pBuff); + } +} +*/ + +void HandleXMLError( void* ctxt, const char* text, ... ) +{ + va_list argptr; + static char buf[32768]; + + va_start (argptr,text); + vsprintf (buf, text, argptr); + Sys_FPrintf (SYS_ERR, "XML %s\n", buf); + va_end (argptr); +} + +#define DTD_BUFFER_LENGTH 1024 +xmlDocPtr ParseXMLStream(IDataStream *stream, bool validate = false) +{ + xmlDocPtr doc = NULL; + bool wellFormed = false, valid = false; + int res, size = 1024; + char chars[1024]; + xmlParserCtxtPtr ctxt; + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=433 + //if(validate) + // xmlDoValidityCheckingDefaultValue = 1; + //else + xmlDoValidityCheckingDefaultValue = 0; + xmlSetGenericErrorFunc(NULL, HandleXMLError); + + // SPoG + // HACK: use AppPath to resolve DTD location + // do a buffer-safe string copy and concatenate + int i; + char* w; + const char* r; + char buf[DTD_BUFFER_LENGTH]; + + w = buf; + i = 0; + // copy + //assert(g_strAppPath.GetBuffer() != NULL); + for(r = g_strAppPath.GetBuffer(); iRead(chars, 4); + if (res > 0) + { + ctxt = xmlCreatePushParserCtxt(NULL, NULL, chars, res, buf); + + while ((res = stream->Read(chars, size)) > 0) + { + xmlParseChunk(ctxt, chars, res, 0); + } + xmlParseChunk(ctxt, chars, 0, 1); + doc = ctxt->myDoc; + + wellFormed = (ctxt->wellFormed == 1); + valid = (ctxt->valid == 1); + + xmlFreeParserCtxt(ctxt); + } + + if(wellFormed && (!validate || (validate && valid))) + return doc; + + if(doc != NULL) + xmlFreeDoc(doc); + + return NULL; +} + +xmlDocPtr ParseXMLFile(const char* filename, bool validate = false) +{ + FileStream stream; + if (stream.Open(filename, "r")) + return ParseXMLStream(&stream, validate); + + Sys_FPrintf(SYS_ERR, "Failed to open file: %s\n",filename); + return NULL; +} + +// copy a string r to a buffer w +// replace $string as appropriate +void ReplaceTemplates(char* w, const char* r) +{ + const char *p; + const char *__ENGINEPATH = "TEMPLATEenginepath"; + const char *__USERHOMEPATH = "TEMPLATEuserhomepath"; + const char *__TOOLSPATH = "TEMPLATEtoolspath"; + const char *__BASEDIR = "TEMPLATEbasedir"; + const char *__APPPATH = "TEMPLATEapppath"; + + // iterate through string r + while(*r!='\0') + { + // check for special character + if(*r=='$') + { + if(strncmp(r+1, __ENGINEPATH, strlen(__ENGINEPATH)) == 0) + { + r+=strlen(__ENGINEPATH)+1; + p = g_pGameDescription->mEnginePath.GetBuffer(); + } + else if(strncmp(r+1, __USERHOMEPATH, strlen(__USERHOMEPATH)) == 0) + { + r+=strlen(__USERHOMEPATH)+1; + p = g_qeglobals.m_strHomeGame.GetBuffer(); + } + else if(strncmp(r+1, __BASEDIR, strlen(__BASEDIR)) == 0) + { + r+=strlen(__BASEDIR)+1; + p = g_pGameDescription->mBaseGame; + } + else if(strncmp(r+1, __TOOLSPATH, strlen(__TOOLSPATH)) == 0) + { + r+=strlen(__TOOLSPATH)+1; + p = g_strGameToolsPath.GetBuffer(); + } + else if(strncmp(r+1, __APPPATH, strlen(__APPPATH)) == 0) + { + r+=strlen(__APPPATH)+1; + p = g_strAppPath.GetBuffer(); + } + else + { + r++; + p = "$"; + } + + while(*p!='\0') *w++ = *p++; + } + else *w++ = *r++; + } + *w = '\0'; +} + +/* +=========== +QE_LoadProject +TODO TODO TODO (don't think this got fully merged in) +TTimo: added project file "version", version 2 adds '#' chars to the BSP command strings +version 3 was .. I don't remember .. version 4 adds q3map2 commands +TTimo: when QE_LoadProject is called, the prefs are updated with path to the latest project and saved on disk +=========== +*/ +/*\todo decide on a sensible location/name for project files.*/ +bool QE_LoadProject (const char *projectfile) +{ + char buf[1024]; + xmlDocPtr doc; + xmlNodePtr node, project; + + Sys_Printf("Loading project file: \"%s\"\n", projectfile); + doc = ParseXMLFile(projectfile, true); + + if(doc == NULL) return false; + + node=doc->children; + while(node != NULL && node->type != XML_DTD_NODE) node=node->next; + if(node == NULL || strcmp((char*)node->name, "project") != 0) + { + Sys_FPrintf(SYS_ERR, "ERROR: invalid file type\n"); + return false; + } + + while(node->type != XML_ELEMENT_NODE) node=node->next; + // + project = node; + + if(g_qeglobals.d_project_entity != NULL) Entity_Free(g_qeglobals.d_project_entity); + g_qeglobals.d_project_entity = Entity_Alloc(); + + for(node = project->children; node != NULL; node=node->next) + { + if(node->type != XML_ELEMENT_NODE) continue; + + // + ReplaceTemplates(buf, (char*)node->properties->next->children->content); + + SetKeyValue(g_qeglobals.d_project_entity, (char*)node->properties->children->content, buf); + } + + xmlFreeDoc(doc); + + // project file version checking + // add a version checking to avoid people loading later versions of the project file and bitching + int ver = IntForKey( g_qeglobals.d_project_entity, "version" ); + if (ver > PROJECT_VERSION) + { + char strMsg[1024]; + sprintf (strMsg, "This is a version %d project file. This build only supports <=%d project files.\n" + "Please choose another project file or upgrade your version of Radiant.", ver, PROJECT_VERSION); + gtk_MessageBox (g_pParentWnd->m_pWidget, strMsg, "Can't load project file", MB_ICONERROR | MB_OK); + // set the project file to nothing so we are sure we'll ask next time? + g_PrefsDlg.m_strLastProject = ""; + g_PrefsDlg.SavePrefs(); + return false; + } + + // set here some default project settings you need + if ( strlen( ValueForKey( g_qeglobals.d_project_entity, "brush_primit" ) ) == 0 ) + { + SetKeyValue( g_qeglobals.d_project_entity, "brush_primit", "0" ); + } + + g_qeglobals.m_bBrushPrimitMode = IntForKey( g_qeglobals.d_project_entity, "brush_primit" ); + + g_qeglobals.m_strHomeMaps = g_qeglobals.m_strHomeGame; + const char* str = ValueForKey(g_qeglobals.d_project_entity, "gamename"); + if(str[0] == '\0') str = g_pGameDescription->mBaseGame.GetBuffer(); + g_qeglobals.m_strHomeMaps += str; + g_qeglobals.m_strHomeMaps += '/'; + + // don't forget to create the dirs + Q_mkdir(g_qeglobals.m_strHomeGame.GetBuffer(), 0775); + Q_mkdir(g_qeglobals.m_strHomeMaps.GetBuffer(), 0775); + + // usefull for the log file and debuggin fucked up configurations from users: + // output the basic information of the .qe4 project file + // SPoG + // all these paths should be unix format, with a trailing slash at the end + // if not.. to debug, check that the project file paths are set up correctly + Sys_Printf("basepath : %s\n", ValueForKey( g_qeglobals.d_project_entity, "basepath") ); + Sys_Printf("entitypath : %s\n", ValueForKey( g_qeglobals.d_project_entity, "entitypath" ) ); + + + // check whether user_project key exists.. + // if not, save the current project under a new name + if (ValueForKey(g_qeglobals.d_project_entity, "user_project")[0] == '\0') + { + Sys_Printf("Loaded a template project file\n"); + + // create the user_project key + SetKeyValue( g_qeglobals.d_project_entity, "user_project", "1" ); + + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=672 + if (IntForKey( g_qeglobals.d_project_entity, "version" ) != PROJECT_VERSION) + { + char strMsg[2048]; + sprintf(strMsg, + "The template project '%s' has version %d. The editor binary is configured for version %d.\n" + "This indicates a problem in your setup. See http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=672\n" + "I will keep going with this project till you fix this", + projectfile, IntForKey( g_qeglobals.d_project_entity, "version" ), PROJECT_VERSION); + gtk_MessageBox (g_pParentWnd->m_pWidget, strMsg, "Can't load project file", MB_ICONERROR | MB_OK); + } + + // create the writable project file path + strcpy(buf, g_qeglobals.m_strHomeGame.GetBuffer()); + strcat(buf, g_pGameDescription->mBaseGame.GetBuffer()); + strcat(buf, "/scripts/"); + // while the filename is already in use, increment the number we add to the end + int counter = 0; + char pUser[PATH_MAX]; + while (1) + { + sprintf( pUser, "%suser%d." PROJECT_FILETYPE, buf, counter ); + counter++; + if (access( pUser, R_OK) != 0) + { + // this is the one + strcpy( buf, pUser ); + break; + } + } + // saving project will cause a save prefs + g_PrefsDlg.m_strLastProject = buf; + g_PrefsDlg.m_nLastProjectVer = IntForKey( g_qeglobals.d_project_entity, "version" ); + QE_SaveProject(buf); + } + else + { + // update preferences::LastProject with path of this successfully-loaded project + // save preferences + Sys_Printf("Setting current project in prefs to \"%s\"\n", g_PrefsDlg.m_strLastProject.GetBuffer() ); + g_PrefsDlg.m_strLastProject = projectfile; + g_PrefsDlg.SavePrefs(); + } + + return true; +} + +/* +=========== +QE_SaveProject +TTimo: whenever QE_SaveProject is called, prefs are updated and saved with the path to the project +=========== +*/ +qboolean QE_SaveProject (const char* filename) +{ + Sys_Printf("Save project file '%s'\n", filename); + + xmlNodePtr node; + xmlDocPtr doc = xmlNewDoc((xmlChar *)"1.0"); + // create DTD node + xmlCreateIntSubset(doc, (xmlChar *)"project", NULL, (xmlChar *)"project.dtd"); + // create project node + doc->children->next = xmlNewDocNode(doc, NULL, (xmlChar *)"project", NULL); + + for(epair_t* epair = g_qeglobals.d_project_entity->epairs; epair != NULL; epair = epair->next) + { + node = xmlNewChild(doc->children->next, NULL, (xmlChar *)"key", NULL); + xmlSetProp(node, (xmlChar*)"name", (xmlChar*)epair->key); + xmlSetProp(node, (xmlChar*)"value", (xmlChar*)epair->value); + } + + CreateDirectoryPath(filename); + if (xmlSaveFormatFile(filename, doc, 1) != -1) + { + xmlFreeDoc(doc); + Sys_Printf("Setting current project in prefs to \"%s\"\n", filename ); + g_PrefsDlg.m_strLastProject = filename; + g_PrefsDlg.SavePrefs(); + return TRUE; + } + else + { + xmlFreeDoc(doc); + Sys_FPrintf(SYS_ERR, "failed to save project file: \"%s\"\n", filename); + return FALSE; + } +} + + + +/* +=========== +QE_KeyDown +=========== +*/ +#define SPEED_MOVE 32 +#define SPEED_TURN 22.5 + + +/* +=============== +ConnectEntities + +Sets target / targetname on the two entities selected +from the first selected to the secon +=============== +*/ +void ConnectEntities (void) +{ + entity_t *e1, *e2; + const char *target; + char *newtarg = NULL; + + if (g_qeglobals.d_select_count != 2) + { + Sys_Status ("Must have two brushes selected", 0); + Sys_Beep (); + return; + } + + e1 = g_qeglobals.d_select_order[0]->owner; + e2 = g_qeglobals.d_select_order[1]->owner; + + if (e1 == world_entity || e2 == world_entity) + { + Sys_Status ("Can't connect to the world", 0); + Sys_Beep (); + return; + } + + if (e1 == e2) + { + Sys_Status ("Brushes are from same entity", 0); + Sys_Beep (); + return; + } + + target = ValueForKey (e1, "target"); + if (target && target[0]) + newtarg = g_strdup(target); + else + { + target = ValueForKey(e2, "targetname"); + if(target && target[0]) + newtarg = g_strdup(target); + else + Entity_Connect(e1, e2); + } + + if(newtarg != NULL) + { + SetKeyValue(e1, "target", newtarg); + SetKeyValue(e2, "targetname", newtarg); + g_free(newtarg); + } + + Sys_UpdateWindows (W_XY | W_CAMERA); + + Select_Deselect(); + Select_Brush (g_qeglobals.d_select_order[1]); +} + +qboolean QE_SingleBrush (bool bQuiet) +{ + if ( (selected_brushes.next == &selected_brushes) + || (selected_brushes.next->next != &selected_brushes) ) + { + if (!bQuiet) + { + Sys_Printf ("Error: you must have a single brush selected\n"); + } + return false; + } + if (selected_brushes.next->owner->eclass->fixedsize) + { + if (!bQuiet) + { + Sys_Printf ("Error: you cannot manipulate fixed size entities\n"); + } + return false; + } + + return true; +} + +void QE_InitVFS (void) +{ + // VFS initialization ----------------------- + // we will call vfsInitDirectory, giving the directories to look in (for files in pk3's and for standalone files) + // we need to call in order, the mod ones first, then the base ones .. they will be searched in this order + // *nix systems have a dual filesystem in ~/.q3a, which is searched first .. so we need to add that too + Str directory,prefabs; + + // TTimo: let's leave this to HL mode for now + if (g_pGameDescription->mGameFile == "hl.game") + { + // Hydra: we search the "gametools" path first so that we can provide editor + // specific pk3's wads and misc files for use by the editor. + // the relevant map compiler tools will NOT use this directory, so this helps + // to ensure that editor files are not used/required in release versions of maps + // it also helps keep your editor files all in once place, with the editor modules, + // plugins, scripts and config files. + // it also helps when testing maps, as you'll know your files won't/can't be used + // by the game engine itself. + + // + directory = g_pGameDescription->mGameToolsPath; + vfsInitDirectory(directory.GetBuffer()); + } + + // NOTE TTimo about the mymkdir calls .. this is a bit dirty, but a safe thing on *nix + + // if we have a mod dir + if (*ValueForKey(g_qeglobals.d_project_entity, "gamename") != '\0') + { + +#if defined (__linux__) || defined (__APPLE__) + // ~/./ + directory = g_qeglobals.m_strHomeGame.GetBuffer(); + Q_mkdir (directory.GetBuffer (), 0775); + directory += ValueForKey(g_qeglobals.d_project_entity, "gamename"); + Q_mkdir (directory.GetBuffer (), 0775); + vfsInitDirectory(directory.GetBuffer()); + AddSlash (directory); + prefabs = directory; + // also create the maps dir, it will be used as prompt for load/save + directory += "/maps"; + Q_mkdir (directory, 0775); + // and the prefabs dir + prefabs += "/prefabs"; + Q_mkdir (prefabs, 0775); + +#endif + + // / + directory = g_pGameDescription->mEnginePath; + directory += ValueForKey(g_qeglobals.d_project_entity, "gamename"); + Q_mkdir (directory.GetBuffer (), 0775); + vfsInitDirectory(directory.GetBuffer()); + AddSlash(directory); + prefabs = directory; + // also create the maps dir, it will be used as prompt for load/save + directory += "/maps"; + Q_mkdir (directory.GetBuffer (), 0775); + // and the prefabs dir + prefabs += "/prefabs"; + Q_mkdir (prefabs, 0775); + } + +#if defined (__linux__) || defined (__APPLE__) + // ~/./ + directory = g_qeglobals.m_strHomeGame.GetBuffer(); + directory += g_pGameDescription->mBaseGame; + vfsInitDirectory (directory.GetBuffer ()); +#endif + + // / + directory = g_pGameDescription->mEnginePath; + directory += g_pGameDescription->mBaseGame; + vfsInitDirectory(directory.GetBuffer()); +} + +void QE_Init (void) +{ + /* + ** initialize variables + */ + g_qeglobals.d_gridsize = 8; + g_qeglobals.d_showgrid = true; + + QE_InitVFS(); + + Eclass_Init(); + FillClassList(); // list in entity window + Map_Init(); + + FillTextureMenu(); + FillBSPMenu(); + + /* + ** other stuff + */ + Z_Init (); +} + +void WINAPI QE_ConvertDOSToUnixName( char *dst, const char *src ) +{ + while ( *src ) + { + if ( *src == '\\' ) + *dst = '/'; + else + *dst = *src; + dst++; src++; + } + *dst = 0; +} + +int g_numbrushes, g_numentities; + +void QE_CountBrushesAndUpdateStatusBar( void ) +{ + static int s_lastbrushcount, s_lastentitycount; + static qboolean s_didonce; + + //entity_t *e; + brush_t *b, *next; + + g_numbrushes = 0; + g_numentities = 0; + + if ( active_brushes.next != NULL ) + { + for ( b = active_brushes.next ; b != NULL && b != &active_brushes ; b=next) + { + next = b->next; + if (b->brush_faces ) + { + if ( !b->owner->eclass->fixedsize) + g_numbrushes++; + else + g_numentities++; + } + } + } +/* + if ( entities.next != NULL ) + { + for ( e = entities.next ; e != &entities && g_numentities != MAX_MAP_ENTITIES ; e = e->next) + { + g_numentities++; + } + } +*/ + if ( ( ( g_numbrushes != s_lastbrushcount ) || ( g_numentities != s_lastentitycount ) ) || ( !s_didonce ) ) + { + Sys_UpdateStatusBar(); + + s_lastbrushcount = g_numbrushes; + s_lastentitycount = g_numentities; + s_didonce = true; + } +} + +char com_token[1024]; +qboolean com_eof; + +/* +================ +I_FloatTime +================ +*/ +double I_FloatTime (void) +{ + time_t t; + + time (&t); + + return t; +#if 0 +// more precise, less portable + struct timeval tp; + struct timezone tzp; + static int secbase; + + gettimeofday(&tp, &tzp); + + if (!secbase) + { + secbase = tp.tv_sec; + return tp.tv_usec/1000000.0; + } + + return (tp.tv_sec - secbase) + tp.tv_usec/1000000.0; +#endif +} + + +/* +============== +COM_Parse + +Parse a token out of a string +============== +*/ +char *COM_Parse (char *data) +{ + int c; + int len; + + len = 0; + com_token[0] = 0; + + if (!data) + return NULL; + +// skip whitespace +skipwhite: + while ( (c = *data) <= ' ') + { + if (c == 0) + { + com_eof = true; + return NULL; // end of file; + } + data++; + } + +// skip // comments + if (c=='/' && data[1] == '/') + { + while (*data && *data != '\n') + data++; + goto skipwhite; + } + + +// handle quoted strings specially + if (c == '\"') + { + data++; + do + { + c = *data++; + if (c=='\"') + { + com_token[len] = 0; + return data; + } + com_token[len] = c; + len++; + } while (1); + } + +// parse single characters + if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':') + { + com_token[len] = c; + len++; + com_token[len] = 0; + return data+1; + } + +// parse a regular word + do + { + com_token[len] = c; + data++; + len++; + c = *data; + if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' || c==':') + break; + } while (c>32); + + com_token[len] = 0; + return data; +} + +char* Get_COM_Token() +{ + return com_token; +} + +/* +============================================================================= + + MISC FUNCTIONS + +============================================================================= +*/ + + +int argc; +char *argv[MAX_NUM_ARGVS]; + +/* +============ +ParseCommandLine +============ +*/ +void ParseCommandLine (char *lpCmdLine) +{ + argc = 1; + argv[0] = "programname"; + + while (*lpCmdLine && (argc < MAX_NUM_ARGVS)) + { + while (*lpCmdLine && ((*lpCmdLine <= 32) || (*lpCmdLine > 126))) + lpCmdLine++; + + if (*lpCmdLine) + { + argv[argc] = lpCmdLine; + argc++; + + while (*lpCmdLine && ((*lpCmdLine > 32) && (*lpCmdLine <= 126))) + lpCmdLine++; + + if (*lpCmdLine) + { + *lpCmdLine = 0; + lpCmdLine++; + } + + } + } +} + + + +/* +================= +CheckParm + +Checks for the given parameter in the program's command line arguments +Returns the argument number (1 to argc-1) or 0 if not present +================= +*/ +int CheckParm (char *check) +{ + int i; + + for (i = 1;i= '0' && *str <= '9') + num += *str-'0'; + else if (*str >= 'a' && *str <= 'f') + num += 10 + *str-'a'; + else if (*str >= 'A' && *str <= 'F') + num += 10 + *str-'A'; + else + Error ("Bad hex number: %s",hex); + str++; + } + + return num; +} + + +int ParseNum (char *str) +{ + if (str[0] == '$') + return ParseHex (str+1); + if (str[0] == '0' && str[1] == 'x') + return ParseHex (str+2); + return atol (str); +} + +// BSP frontend plugin +// global flag for BSP frontend plugin is g_qeglobals.bBSPFrontendPlugin +_QERPlugBSPFrontendTable g_BSPFrontendTable; + // ============================================================================= // Sys_ functions -void Sys_SetTitle(const char *text, bool modified) +bool Sys_AltDown () { - StringOutputStream title; - title << ConvertLocaleToUTF8(text); +#ifdef _WIN32 + return (GetKeyState(VK_MENU) & 0x8000) != 0; +#endif - if(modified) +#if defined (__linux__) || defined (__APPLE__) + char keys[32]; + int x; + + XQueryKeymap(GDK_DISPLAY(), keys); + + x = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L); + if (keys[x/8] & (1 << (x % 8))) + return true; + + x = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_R); + if (keys[x/8] & (1 << (x % 8))) + return true; + + return false; +#endif +} + +bool Sys_ShiftDown () +{ +#ifdef _WIN32 + return (GetKeyState(VK_SHIFT) & 0x8000) != 0; +#endif + +#if defined (__linux__) || defined (__APPLE__) + char keys[32]; + int x; + + XQueryKeymap(GDK_DISPLAY(), keys); + + x = XKeysymToKeycode (GDK_DISPLAY(), XK_Shift_L); + if (keys[x/8] & (1 << (x % 8))) + return true; + + x = XKeysymToKeycode (GDK_DISPLAY(), XK_Shift_R); + if (keys[x/8] & (1 << (x % 8))) + return true; + + return false; +#endif +} + +void Sys_MarkMapModified (void) +{ + char title[PATH_MAX]; + + if (modified != 1) { - title << " *"; - } + modified = true; // mark the map as changed + sprintf (title, "%s *", currentmap); - gtk_window_set_title(MainFrame_getWindow(), title.c_str()); + QE_ConvertDOSToUnixName( title, title ); + Sys_SetTitle (title); + } +} + +void Sys_SetTitle (const char *text) +{ + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_main_window), text); } bool g_bWaitCursor = false; -void Sys_BeginWait (void) +void WINAPI Sys_BeginWait (void) { - ScreenUpdates_Disable("Processing...", "Please Wait"); GdkCursor *cursor = gdk_cursor_new (GDK_WATCH); - gdk_window_set_cursor(GTK_WIDGET(MainFrame_getWindow())->window, cursor); + gdk_window_set_cursor (g_pParentWnd->m_pWidget->window, cursor); gdk_cursor_unref (cursor); g_bWaitCursor = true; } -void Sys_EndWait (void) +void WINAPI Sys_EndWait (void) { - ScreenUpdates_Enable(); - gdk_window_set_cursor(GTK_WIDGET(MainFrame_getWindow())->window, 0); + GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR); + gdk_window_set_cursor (g_pParentWnd->m_pWidget->window, cursor); + gdk_cursor_unref (cursor); g_bWaitCursor = false; } +void Sys_GetCursorPos (int *x, int *y) +{ + // FIXME: not multihead safe + gdk_window_get_pointer (NULL, x, y, NULL); +} + +void Sys_SetCursorPos (int x, int y) +{ + // NOTE: coordinates are in GDK space, not OS space +#ifdef _WIN32 + int sys_x = x - g_pParentWnd->GetGDKOffsetX(); + int sys_y = y - g_pParentWnd->GetGDKOffsetY(); + + SetCursorPos (sys_x, sys_y); +#endif + +#if defined (__linux__) || defined (__APPLE__) + XWarpPointer (GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, x, y); +#endif +} + void Sys_Beep (void) { - gdk_beep(); +#if defined (__linux__) || defined (__APPLE__) + gdk_beep (); +#else + MessageBeep (MB_ICONASTERISK); +#endif } +double Sys_DoubleTime (void) +{ + return clock()/ 1000.0; +} + +/* +=============================================================== + + STATUS WINDOW + +=============================================================== +*/ + +void Sys_UpdateStatusBar( void ) +{ + extern int g_numbrushes, g_numentities; + + char numbrushbuffer[100]=""; + + sprintf( numbrushbuffer, "Brushes: %d Entities: %d", g_numbrushes, g_numentities ); + g_pParentWnd->SetStatusText(2, numbrushbuffer); + //Sys_Status( numbrushbuffer, 2 ); +} + +void Sys_Status(const char *psz, int part ) +{ + g_pParentWnd->SetStatusText (part, psz); +} + +// ============================================================================= +// MRU + +#define MRU_MAX 4 +static GtkWidget *MRU_items[MRU_MAX]; +static int MRU_used; +typedef char MRU_filename_t[PATH_MAX]; +MRU_filename_t MRU_filenames[MRU_MAX]; + +static char* MRU_GetText (int index) +{ + return MRU_filenames[index]; +} + +void buffer_write_escaped_mnemonic(char* buffer, const char* string) +{ + while(*string != '\0') + { + if(*string == '_') + { + *buffer++ = '_'; + } + + *buffer++ = *string++; + } + *buffer = '\0'; +} + +static void MRU_SetText (int index, const char *filename) +{ + strcpy(MRU_filenames[index], filename); + + char mnemonic[PATH_MAX * 2 + 4]; + mnemonic[0] = '_'; + sprintf(mnemonic+1, "%d", index+1); + mnemonic[2] = '-'; + mnemonic[3] = ' '; + buffer_write_escaped_mnemonic(mnemonic+4, filename); + gtk_label_set_text_with_mnemonic(GTK_LABEL (GTK_BIN (MRU_items[index])->child), mnemonic); +} + +void MRU_Load () +{ + int i = g_PrefsDlg.m_nMRUCount; + + if(i > 4) + i = 4; //FIXME: make this a define + + for (; i > 0; i--) + MRU_AddFile (g_PrefsDlg.m_strMRUFiles[i-1].GetBuffer()); +} + +void MRU_Save () +{ + g_PrefsDlg.m_nMRUCount = MRU_used; + + for (int i = 0; i < MRU_used; i++) + g_PrefsDlg.m_strMRUFiles[i] = MRU_GetText (i); +} + +void MRU_AddWidget (GtkWidget *widget, int pos) +{ + if (pos < MRU_MAX) + MRU_items[pos] = widget; +} + +void MRU_AddFile (const char *str) +{ + int i; + char* text; + + // check if file is already in our list + for (i = 0; i < MRU_used; i++) + { + text = MRU_GetText (i); + + if (strcmp (text, str) == 0) + { + // reorder menu + for (; i > 0; i--) + MRU_SetText (i, MRU_GetText (i-1)); + + MRU_SetText (0, str); + + return; + } + } + + if (MRU_used < MRU_MAX) + MRU_used++; + + // move items down + for (i = MRU_used-1; i > 0; i--) + MRU_SetText (i, MRU_GetText (i-1)); + + MRU_SetText (0, str); + gtk_widget_set_sensitive (MRU_items[0], TRUE); + gtk_widget_show (MRU_items[MRU_used-1]); +} + +void MRU_Activate (int index) +{ + char *text = MRU_GetText (index); + + if (access (text, R_OK) == 0) + { + text = strdup (text); + MRU_AddFile (text); + Map_LoadFile (text); + free (text); + } + else + { + MRU_used--; + + for (int i = index; i < MRU_used; i++) + MRU_SetText (i, MRU_GetText (i+1)); + + if (MRU_used == 0) + { + gtk_label_set_text (GTK_LABEL (GTK_BIN (MRU_items[0])->child), "Recent Files"); + gtk_widget_set_sensitive (MRU_items[0], FALSE); + } + else + { + gtk_widget_hide (MRU_items[MRU_used]); + } + } +} + +/* +====================================================================== + +FILE DIALOGS + +====================================================================== +*/ + +qboolean ConfirmModified () +{ + if (!modified) + return true; + + if (gtk_MessageBox (g_pParentWnd->m_pWidget, "This will lose changes to the map", "warning", MB_OKCANCEL) == IDCANCEL) + return false; + return true; +} + +void ProjectDialog () +{ + const char *filename; + char buffer[NAME_MAX]; + + /* + * Obtain the system directory name and + * store it in buffer. + */ + + strcpy(buffer, g_qeglobals.m_strHomeGame.GetBuffer()); + strcat(buffer, g_pGameDescription->mBaseGame.GetBuffer()); + strcat (buffer, "/scripts/"); + + // Display the Open dialog box + filename = file_dialog (NULL, TRUE, "Open File", buffer, "project"); + + if (filename == NULL) + return; // canceled + + // Open the file. + // NOTE: QE_LoadProject takes care of saving prefs with new path to the project file + if (!QE_LoadProject(filename)) + Sys_Printf ("Failed to load project from file: %s\n", filename); + else + // FIXME TTimo QE_Init is probably broken if you don't call it during startup right now .. + QE_Init(); +} + +/* +======================================================= + +Menu modifications + +======================================================= +*/ + +/* +================== +FillBSPMenu + +================== +*/ +char *bsp_commands[256]; + +void FillBSPMenu () +{ + GtkWidget *item, *menu; // menu points to a GtkMenu (not an item) + epair_t *ep; + GList *lst; + int i; + + menu = GTK_WIDGET (g_object_get_data (G_OBJECT (g_qeglobals_gui.d_main_window), "menu_bsp")); + + while ((lst = gtk_container_children (GTK_CONTAINER (menu))) != NULL) + gtk_container_remove (GTK_CONTAINER (menu), GTK_WIDGET (lst->data)); + + if (g_PrefsDlg.m_bDetachableMenus) { + item = gtk_tearoff_menu_item_new (); + gtk_menu_append (GTK_MENU (menu), item); + gtk_widget_set_sensitive (item, TRUE); + gtk_widget_show (item); + } + + if (g_qeglobals.bBSPFrontendPlugin) + { + CString str = g_BSPFrontendTable.m_pfnGetBSPMenu(); + char cTemp[1024]; + strcpy(cTemp, str); + char* token = strtok(cTemp, ",;"); + if (token && *token == ' ') + { + while (*token == ' ') + token++; + } + i = 0; + + // first token is menu name + item = gtk_menu_get_attach_widget (GTK_MENU (menu)); + gtk_label_set_text (GTK_LABEL (GTK_BIN (item)->child), token); + + token = strtok(NULL, ",;"); + while (token != NULL) + { + g_BSPFrontendCommands = g_slist_append (g_BSPFrontendCommands, g_strdup (token)); + item = gtk_menu_item_new_with_label (token); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (CMD_BSPCOMMAND+i)); + token = strtok(NULL, ",;"); + i++; + } + } + else + { + i = 0; + for (ep = g_qeglobals.d_project_entity->epairs; ep; ep = ep->next) + { + if (strncmp(ep->key, "bsp_", 4)==0) + { + bsp_commands[i] = ep->key; + item = gtk_menu_item_new_with_label (ep->key+4); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (HandleCommand), GINT_TO_POINTER (CMD_BSPCOMMAND+i)); + i++; + } + } + } +} + +//============================================== + +void AddSlash(CString& strPath) +{ + if (strPath.GetLength() > 0) + { + if ((strPath.GetAt(strPath.GetLength()-1) != '/') && + (strPath.GetAt(strPath.GetLength()-1) != '\\')) + strPath += '/'; + } +} + +bool ExtractPath_and_Filename(const char* pPath, CString& strPath, CString& strFilename) +{ + CString strPathName; + strPathName = pPath; + int nSlash = strPathName.ReverseFind('\\'); + if (nSlash == -1) + // TTimo: try forward slash, some are using forward + nSlash = strPathName.ReverseFind('/'); + if (nSlash >= 0) + { + strPath = strPathName.Left(nSlash+1); + strFilename = strPathName.Right(strPathName.GetLength() - nSlash - 1); + } + // TTimo: try forward slash, some are using forward + else + strFilename = pPath; + return true; +} + +//=========================================== + +//++timo FIXME: no longer used .. remove! +char *TranslateString (char *buf) +{ + static char buf2[32768]; + int i, l; + char *out; + + l = strlen(buf); + out = buf2; + for (i=0 ; i +#include +#include + +#include + +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=672 +// this is the version to expect from template projects +#define PROJECT_VERSION 2 + +//#define MEM_DEBUG +#ifdef MEM_DEBUG + +#define malloc(a) debug_malloc(a, __FILE__, __LINE__) +#define free(a) debug_free(a, __FILE__, __LINE__) + +void* debug_malloc (size_t size, const char* file, int line); +void debug_free (void *buf, const char* file, int line); + +#endif + +#ifdef _DEBUG +//#define DBG_WINDOWPOS +#endif + +#ifdef DBG_WINDOWPOS +void CheckWatchit(char *msg); +#endif + +// those two files are generated +// if they are missing, you NEED to run makeversion.sh +// NOTE: for win32 users, cygwin installation is REQUIRED to run makeversion.sh +// NOTE TTimo if any of those changes (they might change a lot), then the whole app is rebuilt. +// very often it's not necessary +#include "version.h" +#include "aboutmsg.h" + +// synapse is our utility lib for dynamic shared objects management +#include "synapse.h" + +#include "qertypes.h" +#include "cmdlib.h" +#include "mathlib.h" +#include "parse.h" + +#include "qedefs.h" +#include "qfiles.h" +#include "textures.h" +#include "brush.h" +//#include "entity.h" +#define USE_ENTITYTABLE_DEFINE +#include "ientity.h" +extern _QEREntityTable __ENTITYTABLENAME; +// wrappers for brush access +#include "ibrush.h" +// wrappers for patch access +#include "ipatch.h" + +#include "imodel.h" + +#include "imap.h" + +#include "iundo.h" + +extern _QERPlugMapTable g_MapTable; + +//++timo for BP conversion escaping FIXME: remove when mixing two formats! +extern bool g_bCancel_Map_LoadFile; +// used to be #defines, multiple engine support suggests we should go towards dynamic +extern int g_MaxWorldCoord; +extern int g_MinWorldCoord; +extern int g_MaxBrushSize; +/* +// set to true when we are parsing a terrain entity +extern bool g_bParseTerrain; +extern IShader *g_pTerrainShader, *g_pCaulk; +*/ +#include "map.h" + +#include "select.h" + +#include "camera.h" +#include "z.h" + +#include "undo.h" +#include "glwidget.h" + +// the dec offsetof macro doesn't work very well... +#define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier) + +// set these before calling CheckParm +extern int myargc; +extern char **myargv; + +// our own implementation of Q_int, clamping can be disabled on prefs +vec_t Rad_rint (vec_t in); + +double I_FloatTime (void); + +void Error (char *error, ...); +int CheckParm (char *check); +void ParseCommandLine (char *lpCmdLine); + +int ParseNum (char *str); + +char* COM_Parse (char *data); +char* Get_COM_Token(); + +extern char com_token[1024]; +extern qboolean com_eof; + +#define MAX_NUM_ARGVS 32 +extern int argc; +extern char *argv[MAX_NUM_ARGVS]; // // system functions // -void Sys_SetTitle (const char *text, bool modified); +// TTimo NOTE: WINAPI funcs can be accessed by plugins +void Sys_UpdateStatusBar( void ); +void WINAPI Sys_UpdateWindows (int bits); +void Sys_Beep (void); +void Sys_ClearPrintf (void); +double Sys_DoubleTime (void); +void Sys_GetCursorPos (int *x, int *y); +void Sys_SetCursorPos (int x, int y); +void Sys_SetTitle (const char *text); +void WINAPI Sys_BeginWait (void); +void WINAPI Sys_EndWait (void); +void Sys_Status(const char *psz, int part); +bool Sys_AltDown (); +bool Sys_ShiftDown (); +// will open/close/check the log file based on the following globals: +// g_PrefsDlg.m_bLogConsole g_qeglobals.hLogFile +void Sys_LogFile (void); +extern qboolean verbose; +#include "qsysprintf.h" -void RunBSP(const char* name); - - -void QE_InitVFS(); - -void QE_brushCountChanged(); -void QE_entityCountChanged(); - -bool ConfirmModified(const char* title); - - -// most of the QE globals are stored in this structure +// NOTE TTimo I split out the GUI-depependant stuff from QEGlobals_t into a seperate struct typedef struct { - /*! - win32: engine full path. - unix: user home full path + engine dir. - */ - CopiedString m_userEnginePath; - /*! - cache for m_userEnginePath + mod subdirectory. - */ - CopiedString m_userGamePath; + // GL widget of the camera view + // all textures are binded in this context and shared with the others + GtkWidget *d_glBase; -} QEGlobals_t; + GtkWidget *d_main_window; // d_hwndMain + GtkWidget *d_edit; // d_hwndEdit + GtkWidget *d_entity; // d_hwndEntity + GtkWidget *d_camera; // d_hwndCamera; + GtkWidget *d_texture; // d_hwndTexture; + GtkWidget *d_texture_scroll; + GtkWidget *d_z; // d_hwndZ; -extern QEGlobals_t g_qeglobals; +} QEGlobals_GUI_t; -class SimpleCounter; -extern SimpleCounter g_brushCount; -extern SimpleCounter g_entityCount; +// usefull portability stuff +//++timo move them somewhere +bool DoesFileExist(const char* pBuff, long& lSize); +char *copystring (char *s); +char *ExpandReletivePath (char *p); + +#include "xmlstuff.h" +#include "points.h" + +// +// drag.c +// +void Drag_Begin (int x, int y, int buttons, vec3_t xaxis, vec3_t yaxis, vec3_t origin, vec3_t dir, bool sf_camera = false); +void Drag_MouseMoved (int x, int y, int buttons); +void Drag_MouseUp (int nButtons = 0); + +// +// csg.c +// +void CSG_MakeHollow (void); +void CSG_Subtract (void); +void CSG_Merge (void); + +// +// vertsel.c +// + +void SetupVertexSelection (void); +void SelectEdgeByRay (vec3_t org, vec3_t dir); +void SelectVertexByRay (vec3_t org, vec3_t dir); + +void ConnectEntities (void); + +extern int update_bits; + +extern int screen_width; +extern int screen_height; + +char *TranslateString (char *buf); + +// +// linux_qe3.cc +// +//void OpenDialog (); +//void SaveAsDialog (bool bRegion); +void ProjectDialog (void); +void MRU_Load (); +void MRU_Save (); +void MRU_AddWidget (GtkWidget *widget, int pos); +void MRU_AddFile (const char *str); +void MRU_Activate (int index); + + +void FillTextureMenu (GSList** pArray = NULL); +void FillBSPMenu (void); + +// profile functions - kind of utility lib +// they are kind of dumb, they expect to get the path to the .ini file or to the prefs directory when called +// load_buffer and save_buffer expect the path only, theyll build a $(pszName).bin file +bool WINAPI profile_save_int (const char *filename, const char *section, const char *key, int value); +bool WINAPI profile_save_float (const char *filename, const char *section, const char *key, float value); +bool WINAPI profile_save_string (const char *filename, const char *section, const char *key, const char *value); +bool profile_save_buffer (const char *rc_path, const char *pszName, void *pvBuf, guint32 lSize); +bool profile_load_buffer (const char *rc_path, const char *pszName, void *pvBuf, guint32 *plSize); +int WINAPI profile_load_int (const char *filename, const char *section, const char *key, int default_value); +float WINAPI profile_load_float (const char *filename, const char *section, const char *key, float default_value); +char* WINAPI profile_load_string (const char *filename, const char *section, const char *key, const char *default_value); +// used in the command map code +bool read_var (const char *filename, const char *section, const char *key, char *value); + +// +// entityw.c +// +void FillClassList (void); +bool UpdateEntitySel(eclass_t *pec); +void SetInspectorMode(int iType); +void SetSpawnFlags(void); +void GetSpawnFlags(void); +void SetKeyValuePairs(bool bClearMD3 = false); +extern void BuildGammaTable(float g); +bool GetSelectAllCriteria(CString &strKey, CString &strVal); + +// linux_dlg.c + +typedef enum { + BEVEL = 0, + ENDCAP, + IBEVEL, + IENDCAP +} CapDialog; + +int DoCapDlg (int *type, bool *b_GroupResul); +int DoBSInputDlg (const char *fields[5], float values[5]); +int DoTextureLayout (float *fx, float *fy); +char* DoNameDlg (const char* title); +char* DoNewProjectDlg (); +/* +text editor, open filename at given line +opening at line works only for win32 / editpad and builtin Gtk editor + +we only allow one instance of the Gtk editor widget opened at a given time +if we get called with an existing instance, switch to new file .. +*/ +void DoTextEditor (const char* filename, int cursorpos); +int DoLightIntensityDlg (int *intensity); + +void DoMapInfo (); +void DoEntityList (); +void DoGamma(); +void DoFind(); +void DoRotateDlg (); +void DoSides(bool bCone = false, bool bSphere = false, bool bTorus = false); +void DoAbout(); +void DoSnapTToGrid(float hscale = 0.0f, float vscale = 0.0f); +void DoSurface(); +void ToggleSurface(); // will show/hide depending on the current state +void DoNewPatchDlg (); +void DoThickenDlg (); +void DoCommandListDlg (); +void DoScaleDlg ();; +void DoTextureListDlg (); +void DoScriptsDlg (); + +// QE function declarations +void QE_CheckAutoSave( void ); +void WINAPI QE_ConvertDOSToUnixName( char *dst, const char *src ); +void QE_CountBrushesAndUpdateStatusBar( void ); +void WINAPI QE_CheckOpenGLForErrors(void); +void QE_ExpandBspString (char *bspaction, GPtrArray & out, char *mapname); +// initialise the VFS from current project settings +void QE_InitVFS(); +// do all initialisations that should happen after a project is load (during startup or project change) +void QE_Init (void); +qboolean QE_KeyDown (int key, int nFlags = 0); +// does some sanity checks on the project entity, such as removing ending filename seperators from paths +// (this usually gets propagated to the actual project file since most of the time we save right after calling the check) +void QE_CheckProjectEntity(); +// this will load a new project entity in memory, and potentially process it from a template +// NOTE TTimo calling QE_LoadProject won't take care of the various initialisation that are performed depending on the project settings +// you should then call QE_Init for that +#define PROJECT_TEMPLATE_NAME "default_project.proj" +#define PROJECT_USER_NAME "user_project.proj" +#define PROJECT_FILETYPE "proj" +qboolean QE_LoadProject (const char *projectfile); +qboolean QE_SingleBrush (bool bQuiet = false); + + +// sys stuff +void Sys_MarkMapModified (void); + +#if 0 // no longer used + +// QE Win32 function declarations +#ifdef _WIN32 +int WINAPI QEW_SetupPixelFormat(HDC hDC, qboolean zbuffer ); +void QEW_StopGL( HWND hWnd, HGLRC hGLRC, HDC hDC ); +#endif #endif + +// extern declarations +extern QEGlobals_t g_qeglobals; +extern QEGlobals_GUI_t g_qeglobals_gui; + +qboolean IsBrushSelected(brush_t* bSel); + +// curve brushes + +void Curve_MakeCurvedBrush (qboolean negative, qboolean top, qboolean bottom, + qboolean s1, qboolean s2, qboolean s3, qboolean s4); + +void Curve_Invert (void); + +void Curve_AddFakePlanes( brush_t *B ); +void Curve_StripFakePlanes( brush_t *B ); +void Curve_BuildPoints (brush_t *b); +void Curve_XYDraw (brush_t *b); +void Curve_CameraDraw (brush_t *b); + +void Curve_WriteFile (char *name); + + +// patch stuff +patchMesh_t *Patch_Alloc(); +patchMesh_t* MakeNewPatch(); +brush_t* AddBrushForPatch(patchMesh_t *pm, bool bLinkToWorld = true); +brush_t* Patch_GenericMesh(int nWidth, int nHeight, int nOrientation = 2, bool bDeleteSource = true, bool bOverride = false); +//void Patch_ReadFile (char *name); +//void Patch_WriteFile (char *name); +void Patch_BuildPoints (brush_t *b); +void Patch_Move(patchMesh_t *p, const vec3_t vMove, bool bRebuild = false); +//++timo had to add a default value for bSnap (see Patch_ApplyMatrix call from Select_ApplyMatrix in select.cpp) +void Patch_ApplyMatrix(patchMesh_t *p, const vec3_t vOrigin, const vec3_t vMatrix[3], bool bSnap = false); +void Patch_EditPatch(); +void Patch_Deselect(); +void Patch_Deselect(patchMesh_t *p); +void Patch_Delete(patchMesh_t *p); +int Patch_MemorySize(patchMesh_t *p); +void Patch_Select(patchMesh_t *p); +void Patch_Scale(patchMesh_t *p, const vec3_t vOrigin, const vec3_t vAmt, bool bRebuilt = true); +void Patch_Cleanup(); +void Patch_SetView(int n); +void Patch_SetTexture(patchMesh_t *p, texdef_t *tex_def, IPluginTexdef* pPlugTexdef = NULL); +void Patch_BrushToMesh(bool bCone = false, bool bBevel = false, bool bEndcap = false, bool bSquare = false, int nHeight = 3); +bool Patch_DragScale(patchMesh_t *p, vec3_t vAmt, vec3_t vMove); +//void Patch_ReadBuffer(char* pBuff, bool bSelect = false); +//void Patch_WriteFile (MemStream* pMemFile); +void Patch_UpdateSelected(vec3_t vMove); +//brush_t* Patch_Parse(bool bOld); +//void Patch_Write (patchMesh_t *p, FILE *f); +//void Patch_Write (patchMesh_t *p, MemStream *file); +//void Patch_AdjustColumns(patchMesh_t *p, int nCols); +//void Patch_AdjustRows(patchMesh_t *p, int nRows); +void Patch_AdjustSelected(bool bInsert, bool bColumn, bool bFlag); +patchMesh_t* Patch_Duplicate(patchMesh_t *pFrom); +void Patch_RotateTexture(patchMesh_t *p, float fAngle); +void Patch_ScaleTexture(patchMesh_t *p, float fx, float fy, bool bFixup = true); +// shift of some pixel amount +void Patch_ShiftTexture(patchMesh_t *p, float fx, float fy); +// shift of ST increments +void Patch_ShiftTextureST(patchMesh_t *p, float fx, float fy); +void Patch_DrawCam(patchMesh_t *p); +void Patch_DrawXY(patchMesh_t *p); +void Patch_InsertColumn(patchMesh_t *p, bool bAdd); +void Patch_InsertRow(patchMesh_t *p, bool bAdd); +void Patch_RemoveRow(patchMesh_t *p, bool bFirst); +void Patch_RemoveColumn(patchMesh_t *p, bool bFirst); +void Patch_ToggleInverted(); +void Patch_Restore(patchMesh_t *p); +void Patch_Save(patchMesh_t *p); +void Patch_SetTextureInfo(texdef_t* pt); +void Patch_NaturalTexturing(); +void Patch_ResetTexturing(float fx, float fy); +void Patch_FitTexturing(); +void Patch_BendToggle(); +//void Patch_StartInsDel(); +void Patch_BendHandleTAB(); +void Patch_BendHandleENTER(); +void Patch_SelectBendNormal(); +void Patch_SelectBendAxis(); +bool OnlyPatchesSelected(); +bool AnyPatchesSelected(); +patchMesh_t* SinglePatchSelected(); +void Patch_CapCurrent(); +void Patch_DisperseRows(); +void Patch_DisperseIntermediateRows(); +void Patch_DisperseIntermediateColumns(); +void Patch_CycleCapSelected(); +void Patch_NaturalizeSelected(bool bCap = false);//, bool bCycleCap = false); +void Patch_SelectAreaPoints(bool bMulti); +void Patch_InvertTexture(bool bY); +void patchInvert(patchMesh_t *p); +//void Patch_InsDelToggle(); +//void Patch_InsDelHandleTAB(); +//void Patch_InsDelHandleENTER(); +void Patch_SetOverlays(); +void Patch_ClearOverlays(); +void Patch_Thicken(int nAmount, bool bSeam, qboolean bGroupResult); +void Patch_Transpose(); +void Patch_Freeze(); +void Patch_UnFreeze(bool bAll); +const char* Patch_GetTextureName(); +void Patch_FindReplaceTexture(brush_t *pb, const char *pFind, const char *pReplace, bool bForce); +void Patch_SnapToGrid(patchMesh_t *p); +extern bool g_bPatchShowBounds; +extern bool g_bPatchWireFrame; +extern bool g_bPatchWeld; +extern bool g_bPatchDrillDown; +//extern bool g_bPatchInsertMode; +extern bool g_bPatchBendMode; +extern vec3_t g_vBendOrigin; +//void Patch_FromTriangle(vec5_t vx, vec5_t vy, vec5_t vz); +const char* Patch_GetKeyValue(patchMesh_t *p, const char *pKey); +void Patch_SetEpair(patchMesh_t *p, const char *pKey, const char *pValue); +void Patch_LODMatchAll(); +void Patch_CalcBounds(patchMesh_t *p, vec3_t& vMin, vec3_t& vMax); + + + + +// group stuff +// group_t are loaded / saved through "group_info" entities +// they hold epairs for group settings and additionnal access info (tree nodes) +typedef struct group_s +{ + struct group_s *next; + epair_t *epairs; +#if 0 //! Deprecated in gtk 2.x. + GtkCTreeNode *itemOwner; +#endif +} group_t; + +// NOTES: grouping only enabled in brush primitives mode +// grouping works by naming brushes and setting display properties +// the group hierarchy is not related with the map hierarchy (entity list, brushes etc.) +// brushes with no group are under the "world" node (default for all brushes) +// void Group_GetListFromWorld(CStringArray *pArray); +void Group_RemoveListFromWorld(); +// void Group_SetListToWorld(CStringArray *pArray); +// void Group_BuildTree(CTreeCtrl *pTree); +// void Group_DecomposeTree(CTreeCtrl *pTree); +// save group_t as "classname" "group_info" things +void Group_Save(FILE *f); +// clean the brushes ownerItem, clean the treeview and rebuild everything +// is usually called when loading a new map, but may be called anytime +void Group_Init(); +void Group_Add(entity_t *e); + +// remove a brush from it's current group, will erase the "group" epair if any, and delete the tree control node +void Group_RemoveBrush(brush_t *b); +void Group_AddToWorld(brush_t *b); +// will remove brush of it's current group if any, and will add it wherever needed according to it's "group" key +void Group_AddToProperGroup(brush_t *b); +void Group_AddToSelected(brush_t *b); +// allocate a new group, set name +group_t* Group_Alloc(const char *name); +// we use entities to store information about the groups +// these entities are not linked into the world, and they have no brushes +// only loaded / saved in map file +group_t* Group_ForName(const char *name); + +// TTimo +// new brush primitive stuff + +#ifdef _DEBUG +//#define DBG_BP +#endif + +// get the relative axes of the current texturing +void BrushPrimit_GetRelativeAxes(face_t *f, vec3_t vecS, vec3_t vecT); +// brush primitive stuff +void ComputeAxisBase(vec3_t normal, vec3_t texS, vec3_t texT ); +void FaceToBrushPrimitFace(face_t *f); +void BrushPrimitFaceToFace(face_t *f); +void EmitBrushPrimitTextureCoordinates(face_t *, winding_t *); +// EmitTextureCoordinates, is old code used for brush to brush primitive conversion +void EmitTextureCoordinates ( float *xyzst, qtexture_t *q, face_t *f); +//void BrushPrimit_Parse(brush_t *); +// compute a fake shift scale rot representation from the texture matrix +void TexMatToFakeTexCoords( vec_t texMat[2][3], float shift[2], float *rot, float scale[2] ); +void FakeTexCoordsToTexMat( float shift[2], float rot, float scale[2], vec_t texMat[2][3] ); +void ConvertTexMatWithQTexture( vec_t texMat1[2][3], qtexture_t *qtex1, vec_t texMat2[2][3], qtexture_t *qtex2 ); +// NOTE: this is a wrapper over the vec_t mat[2][3] version +void ConvertTexMatWithQTexture( brushprimit_texdef_t *texMat1, qtexture_t *qtex1, brushprimit_texdef_t *texMat2, qtexture_t *qtex2 ); +// texture locking +void ShiftTextureGeometric_BrushPrimit(face_t *f, vec3_t delta); +void ShiftTextureRelative_BrushPrimit( face_t *f, float x, float y ); +void RotateFaceTexture_BrushPrimit(face_t *f, int nAxis, float fDeg, vec3_t vOrigin ); +// used in CCamWnd::ShiftTexture_BrushPrimit +void ComputeBest2DVector( vec3_t v, vec3_t X, vec3_t Y, int &x, int &y ); +void Face_FitTexture_BrushPrimit( face_t *face, vec3_t minx, vec3_t maxs, int nHeight, int nWidth ); +// lock textures on a random transformation +void ApplyMatrix_BrushPrimit(face_t *f, vec3_t matrix[3], vec3_t origin); +// low level functions .. put in mathlib? +#define BPMatCopy(a,b) {b[0][0] = a[0][0]; b[0][1] = a[0][1]; b[0][2] = a[0][2]; b[1][0] = a[1][0]; b[1][1] = a[1][1]; b[1][2] = a[1][2];} +// apply a scale transformation to the BP matrix +#define BPMatScale(m,sS,sT) {m[0][0]*=sS; m[1][0]*=sS; m[0][1]*=sT; m[1][1]*=sT;} +// apply a translation transformation to a BP matrix +#define BPMatTranslate(m,s,t) {m[0][2] += m[0][0]*s + m[0][1]*t; m[1][2] += m[1][0]*s+m[1][1]*t;} +// 2D homogeneous matrix product C = A*B +void BPMatMul(vec_t A[2][3], vec_t B[2][3], vec_t C[2][3]); +// apply a rotation (degrees) +void BPMatRotate(vec_t A[2][3], float theta); +#ifdef _DEBUG +void BPMatDump(vec_t A[2][3]); +#endif +// GL matrix product +void GLMatMul(vec_t M[4][4], vec_t A[4], vec_t B[4]); +qboolean IsBrushPrimitMode(); +// +// eclass.cpp +// +#include "ieclass.h" + +/*! + \todo those are at the eclass manager level, but some documentation about what they do will be helpful +*/ +extern qboolean parsing_single; +extern qboolean eclass_found; +extern eclass_t *eclass_e; +extern eclass_t *g_md3Cache; + +/*! +eclass manager API +*/ +void Eclass_InsertAlphabetized(eclass_t *e); +eclass_t** Get_EClass_E(); +void Set_Eclass_Found(qboolean); +qboolean Get_Parsing_Single(); + +// .def loading, builtin module +#include "eclass_def.h" +extern CSynapseBuiltinClientDef eclass_def; + +/*! +global table to .def entity class description +this is a builtin module, even if we rely on fgd, we still use this one in cases such as entities not found etc. +*/ +extern _EClassTable g_EClassDefTable; + +/*! +support for one additional/optional entity format +*/ +extern bool g_bHaveEClassExt; +extern _EClassTable g_EClassExtTable; + + +#include "iplugin.h" +// for interfaces, we require main plugin header included +#include "qerplugin.h" + +// +// SurfaceDlg.cpp and surface properties plugin +// +//++timo some patch in/out stuff is in there, needs to be moved out in a dedicated interface +#include "isurfaceplugin.h" +#include "surfaceplugin.h" +void WINAPI Patch_Rebuild(patchMesh_t *p); +#include "isurfaceplugin.h" +extern _QERPlugSurfaceTable g_SurfaceTable; +void SurfaceDlgFitAll(); + +// +// OpenGL interface +// +#include "igl.h" + +GtkWidget* WINAPI QERApp_GetQeglobalsGLWidget(); +void WINAPI QERApp_HookGL2DWindow(IGL2DWindow* pGLW); +void WINAPI QERApp_UnHookGL2DWindow(IGL2DWindow* pGLW); +void WINAPI QERApp_HookGL3DWindow(IGL3DWindow* pGLW); +void WINAPI QERApp_UnHookGL3DWindow(IGL3DWindow* pGLW); +void Draw2DPluginEntities( VIEWTYPE vt ); +void Draw3DPluginEntities(); + +// +// IShaders interface +// +#define USE_SHADERSTABLE_DEFINE +#include "ishaders.h" +extern _QERShadersTable g_ShadersTable; + +// +// ISelectedFace interface +// +#include "iselectedface.h" +int WINAPI QERApp_GetSelectedFaceCount(); +// NOTE: it's the brush corresponding to the selected face below! +brush_t* WINAPI QERApp_GetSelectedFaceBrush(int iface); +face_t* WINAPI QERApp_GetSelectedFace(int iface); +int WINAPI QERApp_GetFaceInfo(int iface, _QERFaceData *pFaceData, winding_t *pWinding); +int WINAPI QERApp_SetFaceInfo(int iface, _QERFaceData *pFaceData); +int WINAPI QERApp_ISelectedFace_GetTextureNumber(int iface); +void WINAPI QERApp_GetTextureSize(int iface, int Size[2]); + +// +// IEpairs interface +// +//#include "iepairs.h" +//#include "epairswrapper.h" + +// +// IImage interface +// +#include "iimage.h" + +// +// IFileSystem interface +// +#define USE_VFSTABLE_DEFINE +#include "ifilesystem.h" + +extern _QERFileSystemTable g_FileSystemTable; + +// +// TexWnd.cpp +// +extern qboolean g_bShowAllShaders; + +// +// texwindow.cpp +// +//++timo TODO: we can probably raise the MAX_TEXTUREDIRS limit? +#define MAX_TEXTUREDIRS 256 + +extern CPtrArray g_lstSkinCache; +qtexture_t *QERApp_LoadTextureRGBA(unsigned char* pPixels, int nWidth, int nHeight); + +// +// IScripLib interface +// GetToken, UnGetToken, etc. +#include "iscriplib.h" +extern FILE *g_File; +void WINAPI QERApp_MapPrintf_FILE( char *text, ... ); + +// +// ISurfacePlugin interface +// +void QERApp_GetTwoSelectedPatch( patchMesh_t **p1, patchMesh_t **p2 ); + +// +// IBSPFrontend interface +// +#include "ibspfrontend.h" +extern _QERPlugBSPFrontendTable g_BSPFrontendTable; +extern GSList *g_BSPFrontendCommands; + +// +// IToolbar +// +#include "itoolbar.h" + +// +// IMessaging interface +#include "iui.h" +#include "iui_gtk.h" +#include "ui.h" +IWindow* WINAPI QERApp_CreateGLWindow(); +void WINAPI QERApp_HookWindow(IWindowListener* pListen); +void WINAPI QERApp_UnHookWindow(IWindowListener* pListen); +IXYWndWrapper* WINAPI QERApp_GetXYWndWrapper(); +void WINAPI QERApp_HookListener(IListener* pListen, int Msg); +int WINAPI QERApp_UnHookListener(IListener* pListen); +void DispatchRadiantMsg( int Msg ); +// dispatch for IWindowListener entities +void DispatchOnMouseMove(guint32 nFlags, int x, int y); +bool DispatchOnLButtonDown(guint32 nFlags, int x, int y); +bool DispatchOnLButtonUp(guint32 nFlags, int x, int y); + +// +// IData interface +// +#include "idata.h" + +// +// ICamera interface +// +#include "icamera.h" + +// Some declarations that were in stdafx.h + +// main.cpp +extern gint try_destroy_splash(gpointer); + +#include "mainframe.h" +#include "preferences.h" +#include "findtexturedialog.h" +#include "surfacedialog.h" +#include "patchdialog.h" + +class MainFrame; +class ClipPoint; + +extern MainFrame* g_pParentWnd; +extern CString g_strAppPath; +extern CString g_strDTDPath; +extern CString g_pidFile; +extern CString g_pidGameFile; +extern CString g_strBitmapsPath; +extern CString g_strPluginsDir; +extern CString g_strModulesDir; + +extern CGameDescription *g_pGameDescription; +extern CString g_strGameToolsPath; + +extern CString g_strTempPath; +extern PrefsDlg& g_PrefsDlg; +extern FindTextureDialog& g_dlgFind; +extern SurfaceDlg g_dlgSurface; +extern PatchDialog g_PatchDialog; + +extern int g_bIgnoreCommands; + +void HideInfoDialog(); +void ShowInfoDialog(const char* pText); + +// externs +//extern void HandleCommand (GtkWidget *widget, gpointer data, bool keydown); +extern gint HandleCommand (GtkWidget *widget, gpointer data); +extern void AddSlash(CString&); +extern void DLLBuildDone(); +extern void CleanUpEntities(); +extern void FindReplace(CString& strContents, const char* pTag, const char* pValue); +extern void CheckBspProcess(); +extern void QE_CountBrushesAndUpdateStatusBar(); +extern void QE_CheckAutoSave(); +extern qtexture_t *current_texture; +extern void SaveWithRegion(char *name); // save the current map, sets the map name in the name buffer (deals with regioning) +extern void RunBsp (char *command); +extern void Map_Snapshot(); +//extern void WXY_Print(); +extern void AddProp( void ); +extern qboolean DoColor(int iIndex); +extern entity_t *edit_entity; +extern int inspector_mode; +extern bool g_bRotateMode; +extern bool g_bClipMode; +extern bool g_bScaleMode; +extern int g_nScaleHow; +extern bool g_bPathMode; +extern void RunScript(char* pBuffer); +extern bool ExtractPath_and_Filename(const char* pPath, CString& strPath, CString& strFilename); +extern void Select_Scale(float x, float y, float z); +extern void Select_RotateTexture(int amt); +extern void Select_ScaleTexture(float x, float y); +extern void Select_ShiftTexture(int x, int y); +extern void FindReplaceTextures(const char* pFind, const char* pReplace, bool bSelected, bool bForce, bool bSelectMatchingFaces); +/*! +\fn DoProjectSettings shows the dialog for per-game configurable settings by the user +typically this sets up things like mod editing configuration +those a per-project, not the same thing as preferences which are global to the game conf +this is still being worked on, as we have several issues with how things are configured +we also have a number of behaviours defined in the .game, which can't be edited graphically +we dump those properties to the console when the project settings dialog shows up +*/ +extern void DoProjectSettings(); +extern qboolean region_active; +extern void Brush_Print(brush_t* b); +extern void Texture_ShowStartupShaders(); +extern void Map_ImportFile (char *filename); +extern void Map_SaveSelected(char* pFilename); +extern void UpdateSurfaceDialog(); +extern void Select_GetTrueMid (vec3_t mid); +extern bool g_bSwitch; +extern brush_t g_brFrontSplits; +extern brush_t g_brBackSplits; +extern ClipPoint g_Clip1; +extern ClipPoint g_Clip2; +extern brush_t* g_pSplitList; +extern ClipPoint g_PathPoints[256]; +extern void AcquirePath(int nCount, PFNPathCallback* pFunc); +extern bool g_bScreenUpdates; +extern SCommandInfo g_Commands[]; +extern int g_nCommandCount; +extern SKeyInfo g_Keys[]; +extern int g_nKeyCount; +extern int inspector_mode; +extern char *bsp_commands[256]; +extern void RunScriptByName(char*, bool); +extern void DoNewColor(int* i1, int* i2, int* i3); +extern void UpdateSurfaceDialog(); +extern void CSG_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back); +//extern void HandlePopup(CWnd* pWindow, unsigned int uId); +extern z_t z; +extern void Select_Scale(float x, float y, float z); +extern void TextureAxisFromPlane(plane_t *pln, vec3_t xv, vec3_t yv); +//extern void VectorRotate (vec3_t va, vec3_t vb, vec3_t out); +//extern void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out); +extern qboolean QE_SaveProject (const char* pProjectFile); +//extern void NewBSP(char* pCommandLine, HWND); +//extern void NewVIS(char* pCommandLine, HWND); +//extern void NewRAD(char* pCommandLine, HWND); +extern void RunTools(char* pCommandLine, GtkWidget* hwnd, const char* pPAKFile); +extern void Clamp(float& f, int nClamp); +extern void MemFile_fprintf(MemStream* pMemFile, const char* pText, ...); +//extern void SaveWindowPlacement(HWND hwnd, const char* pName); +//extern bool LoadWindowPlacement(HWND hwnd, const char* pName); +extern qboolean ConfirmModified (void); +extern void DoPatchInspector(); +extern void TogglePatchInspector(); +void UpdatePatchInspector(); +extern int BuildShortPathName(const char* pPath, char* pBuffer, int nBufferLen); +extern int g_nBrushId; + +// defined in gtkdlgs.cpp, we might want to move declaration and implementatin with other Select_ stuff.. +// NOTE: there's also a Select_Brush(brush_t *b) function.. unrelated +extern void SelectBrush (int entitynum, int brushnum); + +// bp_dlg.cpp +// ret: 0 = abort, 1 = load and convert, 2 = changed project settings, load and don't convert +// the user might decide to switch the BP mode in project settings +// status: 0 = loading regular, got conflict 1 = loading BP, got conflict +extern int BP_MessageBox (int status); + +// main.cpp +extern gint try_destroy_splash(gpointer); + +// SPoG +// targetname.cpp +void Entity_Connect(entity_t *e1, entity_t *e2); +int GetUniqueTargetId(int iHint); + +// xywindow.cpp +void CreateEntityFromName(const char* name, const vec3_t origin); + +// eclass.cpp +/*! +\brief initialization of the eclass manager +general guidelines about eclass.cpp implementation: +- we don't support unlimited number of eclass file formats together + currently limited to two + support for .def is builtin to the core, but you may choose not to activate it +- search and load of the files: + the manager is in charge of scanning for eclass definition files to load + there is a general configuration setting for games which use a different set of + entities between single player mode and multiplayer mode (TODO: the code doing + this needs to be abstracted some more) +- duplicate files / multiple files: + if two files with the same name exist (for instance in the basegame, and in fs_game) + then only the first one found in the scan order is loaded + if several files are found, they are all loaded + this allows mods to either replace or extend the list of eclass +- if eclass_singleload prop is used in the .game, then there is no multiple files check + the first file found is loaded, and there is no further search for the given extension + (this was an addition for HL support) +*/ +void Eclass_Init (); +eclass_t *Eclass_ForName (const char *name, qboolean has_brushes); +eclass_t * EClass_Create( const char *name, float col1, float col2, float col3, const vec3_t *mins, const vec3_t *maxs, const char *comments ); + +#endif // _QE3_H_ diff --git a/radiant/qedefs.h b/radiant/qedefs.h new file mode 100644 index 00000000..23a3d28b --- /dev/null +++ b/radiant/qedefs.h @@ -0,0 +1,128 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __QEDEFS_H__ +#define __QEDEFS_H__ + +#define _3DFXCAMERA_WINDOW_CLASS "Q3DFXCamera" +#define CAMERA_WINDOW_CLASS "QCamera" +#define XY_WINDOW_CLASS "QXY" +#define Z_WINDOW_CLASS "QZ" +#define ENT_WINDOW_CLASS "QENT" +#define TEXTURE_WINDOW_CLASS "QTEX" + +#define ZWIN_WIDTH 40 +#define CWIN_SIZE (0.4) + +#define MAX_EDGES 512 +#define MAX_POINTS 1024 + +#define CMD_TEXTUREWAD 60000 +#define CMD_BSPCOMMAND 61000 + +#define PITCH 0 +#define YAW 1 +#define ROLL 2 + +#define QE_TIMER0 1 + +#define PLANE_X 0 +#define PLANE_Y 1 +#define PLANE_Z 2 +#define PLANE_ANYX 3 +#define PLANE_ANYY 4 +#define PLANE_ANYZ 5 + +#define ON_EPSILON 0.01 + +#define KEY_FORWARD 1 +#define KEY_BACK 2 +#define KEY_TURNLEFT 4 +#define KEY_TURNRIGHT 8 +#define KEY_LEFT 16 +#define KEY_RIGHT 32 +#define KEY_LOOKUP 64 +#define KEY_LOOKDOWN 128 +#define KEY_UP 256 +#define KEY_DOWN 512 + +// xy.c +#define EXCLUDE_WORLD 0x00000001 +#define EXCLUDE_ENT 0x00000002 +#define EXCLUDE_CURVES 0x00000004 +#define EXCLUDE_TRANSLUCENT 0x00000008 +#define EXCLUDE_LIQUIDS 0x00000010 +#define EXCLUDE_CAULK 0x00000020 +#define EXCLUDE_CLIP 0x00000040 +#define EXCLUDE_PATHS 0x00000080 +#define EXCLUDE_LIGHTS 0x00000100 +#define EXCLUDE_DETAILS 0x00000200 +#define EXCLUDE_HINTSSKIPS 0x00000400 +#define EXCLUDE_MODELS 0x00000800 +#define EXCLUDE_AREAPORTALS 0x00001000 +#define EXCLUDE_TRIGGERS 0x00002000 +#define EXCLUDE_CLUSTERPORTALS 0x00004000 +#define EXCLUDE_TERRAIN 0x00008000 +#define EXCLUDE_LIGHTGRID 0x00010000 +#define EXCLUDE_STRUCTURAL 0x00020000 +#define EXCLUDE_BOTCLIP 0x00040000 + +#define INCLUDE_EASY 0x00000001 +#define INCLUDE_NORMAL 0x00000002 +#define INCLUDE_HARD 0x00000004 +#define INCLUDE_DEATHMATCH 0x00000008 +#define INCLUDE_NAMES 0x00000010 +#define INCLUDE_COORDS 0x00000020 +#define INCLUDE_BLOCKS 0x00000040 +#define INCLUDE_ANGLES 0x00000080 +#define INCLUDE_PATCHBBOXES 0x00000100 +#define INCLUDE_PATCHWIREFRAME 0x00000200 +#define INCLUDE_CAMERATINT 0x00000400 +#define INCLUDE_MODELBOXONLY 0x00000800 + +// +// menu indexes for modifying menus +// +#define MENU_VIEW 2 +#define MENU_BSP 4 +#define MENU_TEXTURE 6 +#define MENU_PLUGIN 11 + +// odd things not in windows header... +#define VK_COMMA 188 +#define VK_PERIOD 190 + +// ShowEntitiesAs flags +// used in camera code, not menus +#define ENTITY_WIREFRAME 0x00001 +#define ENTITY_SKIN_MODEL 0x00010 +#define ENTITY_SELECTED_ONLY 0x00100 +#define ENTITY_BOXED 0x01000 + +// ShowEntitiesAs menu settings .. combinations of the above settings +#define ENTITY_BOX 0x01000 +#define ENTITY_WIRE 0x00001 +#define ENTITY_SELECTED 0x00101 +#define ENTITY_SKINNED 0x00010 +#define ENTITY_SKINNED_BOXED 0x01010 +#define ENTITY_SELECTED_SKIN 0x00110 + +#endif diff --git a/radiant/qfiles.h b/radiant/qfiles.h new file mode 100644 index 00000000..c602ec84 --- /dev/null +++ b/radiant/qfiles.h @@ -0,0 +1,480 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +// +// qfiles.h: quake file formats +// This file must be identical in the quake and utils directories +// + +/* +======================================================================== + +.MD2 triangle model file format + +======================================================================== +*/ + +#define IDALIASHEADER (('2'<<24)+('P'<<16)+('D'<<8)+'I') +#define ALIAS_VERSION 8 + +#define MAX_TRIANGLES 4096 +#define MAX_VERTS 2048 +#define MAX_FRAMES 512 +#define MAX_MD2SKINS 32 +#define MAX_SKINNAME 64 + +typedef struct +{ + short s; + short t; +} dstvert_t; + +typedef struct +{ + short index_xyz[3]; + short index_st[3]; +} dtriangle_t; + +typedef struct +{ + byte v[3]; // scaled byte to fit in frame mins/maxs + byte lightnormalindex; +} dtrivertx_t; + +typedef struct +{ + float scale[3]; // multiply byte verts by this + float translate[3]; // then add this + char name[16]; // frame name from grabbing + dtrivertx_t verts[1]; // variable sized +} daliasframe_t; + + +// the glcmd format: +// a positive integer starts a tristrip command, followed by that many +// vertex structures. +// a negative integer starts a trifan command, followed by -x vertexes +// a zero indicates the end of the command list. +// a vertex consists of a floating point s, a floating point t, +// and an integer vertex index. + + +typedef struct +{ + int ident; + int version; + + int skinwidth; + int skinheight; + int framesize; // byte size of each frame + + int num_skins; + int num_xyz; + int num_st; // greater than num_xyz for seams + int num_tris; + int num_glcmds; // dwords in strip/fan command list + int num_frames; + + int ofs_skins; // each skin is a MAX_SKINNAME string + int ofs_st; // byte offset from start for stverts + int ofs_tris; // offset for dtriangles + int ofs_frames; // offset for first frame + int ofs_glcmds; + int ofs_end; // end of file + +} dmdl_t; + +#define MD3_IDENT (('3'<<24)+('P'<<16)+('D'<<8)+'I') +#define MAX_QPATH 64 // max length of a quake game pathname +#define MD3_XYZ_SCALE (1.0/64) + +typedef struct { + int ident; + int version; + + char name[MAX_QPATH]; // model name + + int flags; + + int numFrames; + int numTags; + int numSurfaces; + + int numSkins; + + int ofsFrames; // offset for first frame + int ofsTags; // numFrames * numTags + int ofsSurfaces; // first surface, others follow + + int ofsEnd; // end of file +} md3Header_t; + +typedef struct { + int ident; // + + char name[MAX_QPATH]; // polyset name + + int flags; + int numFrames; // all surfaces in a model should have the same + + int numShaders; // all surfaces in a model should have the same + int numVerts; + + int numTriangles; + int ofsTriangles; + + int ofsShaders; // offset from start of md3Surface_t + int ofsSt; // texture coords are common for all frames + int ofsXyzNormals; // numVerts * numFrames + + int ofsEnd; // next surface follows + +} md3Surface_t; + +typedef struct { + char name[MAX_QPATH]; + int shaderIndex; // for in-game use +} md3Shader_t; + +typedef struct { + int indexes[3]; +} md3Triangle_t; + +typedef struct { + float st[2]; +} md3St_t; + +typedef struct { + short xyz[3]; + short normal; +} md3XyzNormal_t; + + +typedef struct +{ + float st[2]; + int nVertIndex; +} glst_t; + +typedef struct +{ + int nCount; + int ObjectIndex; + glst_t GlSt; +} gl_t; + +/* +======================================================================== + +.SP2 sprite file format + +======================================================================== +*/ + +#define IDSPRITEHEADER (('2'<<24)+('S'<<16)+('D'<<8)+'I') + // little-endian "IDS2" +#define SPRITE_VERSION 2 + +typedef struct +{ + int width, height; + int origin_x, origin_y; // raster coordinates inside pic + char name[MAX_SKINNAME]; // name of pcx file +} dsprframe_t; + +typedef struct { + int ident; + int version; + int numframes; + dsprframe_t frames[1]; // variable sized +} dsprite_t; + +/* +============================================================================== + + .WAL texture file format + +============================================================================== +*/ + + +#define MIPLEVELS 4 +#ifndef __MIPTEX_S_ +#define __MIPTEX_S_ +typedef struct miptex_s +{ + char name[32]; + unsigned width, height; + unsigned offsets[MIPLEVELS]; // four mip maps stored + char animname[32]; // next frame in animation chain + int flags; + int contents; + int value; +} miptex_t; +#endif + + +/* +============================================================================== + + .BSP file format + +============================================================================== +*/ + +#define IDBSPHEADER (('P'<<24)+('S'<<16)+('B'<<8)+'I') + // little-endian "IBSP" + +#define BSPVERSION 36 + + +// upper design bounds +// leaffaces, leafbrushes, planes, and verts are still bounded by +// 16 bit short limits +#define MAX_MAP_MODELS 1024 +#define MAX_MAP_BRUSHES 8192 +#define MAX_MAP_ENTITIES 2048 +#define MAX_MAP_ENTSTRING 0x20000 +#define MAX_MAP_TEXINFO 8192 + +#define MAX_MAP_PLANES 65536 +#define MAX_MAP_NODES 65536 +#define MAX_MAP_BRUSHSIDES 65536 +#define MAX_MAP_LEAFS 65536 +#define MAX_MAP_VERTS 65536 +#define MAX_MAP_FACES 65536 +#define MAX_MAP_LEAFFACES 65536 +#define MAX_MAP_LEAFBRUSHES 65536 +#define MAX_MAP_PORTALS 65536 +#define MAX_MAP_EDGES 128000 +#define MAX_MAP_SURFEDGES 256000 +#define MAX_MAP_LIGHTING 0x200000 +#define MAX_MAP_VISIBILITY 0x100000 + +// we are using g_MaxBrushSize now, cleanme +/* #define MAX_BRUSH_SIZE 8192 */ + +// key / value pair sizes + +#define MAX_KEY 32 +#define MAX_VALUE 1024 + +//============================================================================= + +typedef struct +{ + int fileofs, filelen; +} lump_t; + +#define LUMP_ENTITIES 0 +#define LUMP_PLANES 1 +#define LUMP_VERTEXES 2 +#define LUMP_VISIBILITY 3 +#define LUMP_NODES 4 +#define LUMP_TEXINFO 5 +#define LUMP_FACES 6 +#define LUMP_LIGHTING 7 +#define LUMP_LEAFS 8 +#define LUMP_LEAFFACES 9 +#define LUMP_LEAFBRUSHES 10 +#define LUMP_EDGES 11 +#define LUMP_SURFEDGES 12 +#define LUMP_MODELS 13 +#define LUMP_BRUSHES 14 +#define LUMP_BRUSHSIDES 15 +#define LUMP_POP 16 + +#define HEADER_LUMPS 17 + +typedef struct +{ + int ident; + int version; + lump_t lumps[HEADER_LUMPS]; +} dheader_t; + +typedef struct +{ + float mins[3], maxs[3]; + float origin[3]; // for sounds or lights + int headnode; + int firstface, numfaces; // submodels just draw faces + // without walking the bsp tree +} dmodel_t; + + +typedef struct +{ + float point[3]; +} dvertex_t; + + +// 0-2 are axial planes +#define PLANE_X 0 +#define PLANE_Y 1 +#define PLANE_Z 2 + +// 3-5 are non-axial planes snapped to the nearest +#define PLANE_ANYX 3 +#define PLANE_ANYY 4 +#define PLANE_ANYZ 5 + +// planes (x&~1) and (x&~1)+1 are allways opposites + +typedef struct +{ + float normal[3]; + float dist; + int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate +} dplane_t; + + +// contents flags are seperate bits +// a given brush can contribute multiple content bits +// multiple brushes can be in a single leaf + +// lower bits are stronger, and will eat weaker brushes completely +#define CONTENTS_SOLID 1 // an eye is never valid in a solid +#define CONTENTS_WINDOW 2 // translucent, but not watery +#define CONTENTS_AUX 4 +#define CONTENTS_LAVA 8 +#define CONTENTS_SLIME 16 +#define CONTENTS_WATER 32 +#define CONTENTS_MIST 64 +#define LAST_VISIBLE_CONTENTS 64 + +// remaining contents are non-visible, and don't eat brushes +#define CONTENTS_PLAYERCLIP 0x10000 +#define CONTENTS_MONSTERCLIP 0x20000 + +// currents can be added to any other contents, and may be mixed +#define CONTENTS_CURRENT_0 0x40000 +#define CONTENTS_CURRENT_90 0x80000 +#define CONTENTS_CURRENT_180 0x100000 +#define CONTENTS_CURRENT_270 0x200000 +#define CONTENTS_CURRENT_UP 0x400000 +#define CONTENTS_CURRENT_DOWN 0x800000 + +#define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity + +#define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game +#define CONTENTS_DEADMONSTER 0x4000000 // corpse +#define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs +#define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans +#define CONTENTS_LADDER 0x20000000 // ladder +#define CONTENTS_NEGATIVE_CURVE 0x40000000 // reverse inside / outside + +#define CONTENTS_KEEP (CONTENTS_DETAIL | CONTENTS_NEGATIVE_CURVE) + + +typedef struct +{ + int planenum; + int children[2]; // negative numbers are -(leafs+1), not nodes + short mins[3]; // for frustom culling + short maxs[3]; + unsigned short firstface; + unsigned short numfaces; // counting both sides +} dnode_t; + + +typedef struct texinfo_s +{ + float vecs[2][4]; // [s/t][xyz offset] + int flags; // miptex flags + overrides + int value; // light emission, etc + char texture[32]; // texture name (textures/*.wal) + int nexttexinfo; // for animations, -1 = end of chain +} texinfo_t; + + +#define SURF_LIGHT 0x1 // value will hold the light strength + +#define SURF_SLICK 0x2 // effects game physics + +#define SURF_SKY 0x4 // don't draw, but add to skybox +#define SURF_WARP 0x8 // turbulent water warp +#define SURF_TRANS33 0x10 +#define SURF_TRANS66 0x20 +#define SURF_FLOWING 0x40 // scroll towards angle +#define SURF_NODRAW 0x80 // don't bother referencing the texture + +#define SURF_PATCH 0x20000000 +#define SURF_CURVE_FAKE 0x40000000 +#define SURF_CURVE 0x80000000 +#define SURF_KEEP (SURF_CURVE | SURF_CURVE_FAKE | SURF_PATCH) + +// note that edge 0 is never used, because negative edge nums are used for +// counterclockwise use of the edge in a face +typedef struct +{ + unsigned short v[2]; // vertex numbers +} dedge_t; + +#define MAXLIGHTMAPS 4 +typedef struct +{ + unsigned short planenum; + short side; + + int firstedge; // we must support > 64k edges + short numedges; + short texinfo; + +// lighting info + byte styles[MAXLIGHTMAPS]; + int lightofs; // start of [numstyles*surfsize] samples +} dface_t; + +typedef struct +{ + int contents; // OR of all brushes (not needed?) + + int pvsofs; // -1 = no info + int phsofs; // -1 = no info + + short mins[3]; // for frustum culling + short maxs[3]; + + unsigned short firstleafface; + unsigned short numleaffaces; + + unsigned short firstleafbrush; + unsigned short numleafbrushes; +} dleaf_t; + +typedef struct +{ + unsigned short planenum; // facing out of the leaf + short texinfo; +} dbrushside_t; + +typedef struct +{ + int firstside; + int numsides; + int contents; +} dbrush_t; + +#define ANGLE_UP -1 +#define ANGLE_DOWN -2 + diff --git a/radiant/qgl-mac.c b/radiant/qgl-mac.c new file mode 100644 index 00000000..105f21e3 --- /dev/null +++ b/radiant/qgl-mac.c @@ -0,0 +1,1775 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* +** QGL_WIN.C +** +** This file implements the operating system binding of GL to QGL function +** pointers. When doing a port of Quake2 you must implement the following +** two functions: +** +** QGL_Init() - loads libraries, assigns function pointers, etc. +** QGL_Shutdown() - unloads libraries, NULLs function pointers +*/ +#include +#include +#include +#if defined (__linux__) || defined (__APPLE__) +//#include +#endif +#ifdef _WIN32 +#include +#endif +#include "qgl.h" +#include +void Sys_Printf(const char *format, ...); + +#ifdef _WIN32 +HMODULE g_hGLDLL = NULL; + +#pragma warning (disable : 4113 4133 4047 4018 ) + +int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *); +int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +int ( WINAPI * qwglGetPixelFormat)(HDC); +BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); +BOOL ( WINAPI * qwglSwapBuffers)(HDC); + +BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); +HGLRC ( WINAPI * qwglCreateContext)(HDC); +HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int); +BOOL ( WINAPI * qwglDeleteContext)(HGLRC); +HGLRC ( WINAPI * qwglGetCurrentContext)(VOID); +HDC ( WINAPI * qwglGetCurrentDC)(VOID); +PROC ( WINAPI * qwglGetProcAddress)(LPCSTR); +BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC); +BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC); +BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD); + +BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR); +int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int, CONST COLORREF *); +int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int, COLORREF *); +BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL); +BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT); + +BOOL ( WINAPI * qwglGetDeviceGammaRampEXT)( unsigned char *, unsigned char *, unsigned char * ); +BOOL ( WINAPI * qwglSetDeviceGammaRampEXT)( const unsigned char *, const unsigned char *, + const unsigned char * ); +BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval ); + +#else +#define WINAPI +#endif + +#if defined (__linux__) || defined (__APPLE__) +void* g_hGLDLL; + +XVisualInfo* (*qglXChooseVisual)(Display *dpy, int screen, int *attribList); +GLXContext (*qglXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +void (*qglXDestroyContext)(Display *dpy, GLXContext ctx); +Bool (*qglXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); +void (*qglXCopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); +void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); +GLXPixmap (*qglXCreateGLXPixmap)( Display *dpy, XVisualInfo *visual, Pixmap pixmap ); +void (*qglXDestroyGLXPixmap)( Display *dpy, GLXPixmap pixmap ); +Bool (*qglXQueryExtension)( Display *dpy, int *errorb, int *event ); +Bool (*qglXQueryVersion)( Display *dpy, int *maj, int *min ); +Bool (*qglXIsDirect)( Display *dpy, GLXContext ctx ); +int (*qglXGetConfig)( Display *dpy, XVisualInfo *visual, int attrib, int *value ); +GLXContext (*qglXGetCurrentContext)( void ); +GLXDrawable (*qglXGetCurrentDrawable)( void ); +void (*qglXWaitGL)( void ); +void (*qglXWaitX)( void ); +void (*qglXUseXFont)( Font font, int first, int count, int list ); +void* (*qglXGetProcAddressARB) (const GLubyte *procName); +#endif + +void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); +void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); +GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences); +void ( APIENTRY * qglArrayElement )(GLint i); +void ( APIENTRY * qglBegin )(GLenum mode); +void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture); +void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor); +void ( APIENTRY * qglCallList )(GLuint list); +void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists); +void ( APIENTRY * qglClear )(GLbitfield mask); +void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +void ( APIENTRY * qglClearDepth )(GLclampd depth); +void ( APIENTRY * qglClearIndex )(GLfloat c); +void ( APIENTRY * qglClearStencil )(GLint s); +void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation); +void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue); +void ( APIENTRY * qglColor3bv )(const GLbyte *v); +void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue); +void ( APIENTRY * qglColor3dv )(const GLdouble *v); +void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue); +void ( APIENTRY * qglColor3fv )(const GLfloat *v); +void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue); +void ( APIENTRY * qglColor3iv )(const GLint *v); +void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue); +void ( APIENTRY * qglColor3sv )(const GLshort *v); +void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue); +void ( APIENTRY * qglColor3ubv )(const GLubyte *v); +void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue); +void ( APIENTRY * qglColor3uiv )(const GLuint *v); +void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue); +void ( APIENTRY * qglColor3usv )(const GLushort *v); +void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +void ( APIENTRY * qglColor4bv )(const GLbyte *v); +void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +void ( APIENTRY * qglColor4dv )(const GLdouble *v); +void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglColor4fv )(const GLfloat *v); +void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha); +void ( APIENTRY * qglColor4iv )(const GLint *v); +void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha); +void ( APIENTRY * qglColor4sv )(const GLshort *v); +void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +void ( APIENTRY * qglColor4ubv )(const GLubyte *v); +void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha); +void ( APIENTRY * qglColor4uiv )(const GLuint *v); +void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha); +void ( APIENTRY * qglColor4usv )(const GLushort *v); +void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode); +void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglCullFace )(GLenum mode); +void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range); +void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures); +void ( APIENTRY * qglDepthFunc )(GLenum func); +void ( APIENTRY * qglDepthMask )(GLboolean flag); +void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar); +void ( APIENTRY * qglDisable )(GLenum cap); +void ( APIENTRY * qglDisableClientState )(GLenum array); +void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count); +void ( APIENTRY * qglDrawBuffer )(GLenum mode); +void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglEdgeFlag )(GLboolean flag); +void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag); +void ( APIENTRY * qglEnable )(GLenum cap); +void ( APIENTRY * qglEnableClientState )(GLenum array); +void ( APIENTRY * qglEnd )(void); +void ( APIENTRY * qglEndList )(void); +void ( APIENTRY * qglEvalCoord1d )(GLdouble u); +void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord1f )(GLfloat u); +void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u); +void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v); +void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v); +void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u); +void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2); +void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +void ( APIENTRY * qglEvalPoint1 )(GLint i); +void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j); +void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer); +void ( APIENTRY * qglFinish )(void); +void ( APIENTRY * qglFlush )(void); +void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglFogi )(GLenum pname, GLint param); +void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglFrontFace )(GLenum mode); +void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLuint ( APIENTRY * qglGenLists )(GLsizei range); +void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures); +void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params); +void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation); +void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params); +GLenum ( APIENTRY * qglGetError )(void); +void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params); +void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params); +void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v); +void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v); +void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v); +void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params); +void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values); +void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values); +void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values); +void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params); +void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask); +const GLubyte * ( APIENTRY * qglGetString )(GLenum name); +void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params); +void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglHint )(GLenum target, GLenum mode); +void ( APIENTRY * qglIndexMask )(GLuint mask); +void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglIndexd )(GLdouble c); +void ( APIENTRY * qglIndexdv )(const GLdouble *c); +void ( APIENTRY * qglIndexf )(GLfloat c); +void ( APIENTRY * qglIndexfv )(const GLfloat *c); +void ( APIENTRY * qglIndexi )(GLint c); +void ( APIENTRY * qglIndexiv )(const GLint *c); +void ( APIENTRY * qglIndexs )(GLshort c); +void ( APIENTRY * qglIndexsv )(const GLshort *c); +void ( APIENTRY * qglIndexub )(GLubyte c); +void ( APIENTRY * qglIndexubv )(const GLubyte *c); +void ( APIENTRY * qglInitNames )(void); +void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer); +GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap); +GLboolean ( APIENTRY * qglIsList )(GLuint list); +GLboolean ( APIENTRY * qglIsTexture )(GLuint texture); +void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param); +void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param); +void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param); +void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params); +void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern); +void ( APIENTRY * qglLineWidth )(GLfloat width); +void ( APIENTRY * qglListBase )(GLuint base); +void ( APIENTRY * qglLoadIdentity )(void); +void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m); +void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m); +void ( APIENTRY * qglLoadName )(GLuint name); +void ( APIENTRY * qglLogicOp )(GLenum opcode); +void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2); +void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2); +void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param); +void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param); +void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params); +void ( APIENTRY * qglMatrixMode )(GLenum mode); +void ( APIENTRY * qglMultMatrixd )(const GLdouble *m); +void ( APIENTRY * qglMultMatrixf )(const GLfloat *m); +void ( APIENTRY * qglNewList )(GLuint list, GLenum mode); +void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz); +void ( APIENTRY * qglNormal3bv )(const GLbyte *v); +void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz); +void ( APIENTRY * qglNormal3dv )(const GLdouble *v); +void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz); +void ( APIENTRY * qglNormal3fv )(const GLfloat *v); +void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz); +void ( APIENTRY * qglNormal3iv )(const GLint *v); +void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz); +void ( APIENTRY * qglNormal3sv )(const GLshort *v); +void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +void ( APIENTRY * qglPassThrough )(GLfloat token); +void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values); +void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values); +void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values); +void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor); +void ( APIENTRY * qglPointSize )(GLfloat size); +void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode); +void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units); +void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask); +void ( APIENTRY * qglPopAttrib )(void); +void ( APIENTRY * qglPopClientAttrib )(void); +void ( APIENTRY * qglPopMatrix )(void); +void ( APIENTRY * qglPopName )(void); +void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities); +void ( APIENTRY * qglPushAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushMatrix )(void); +void ( APIENTRY * qglPushName )(GLuint name); +void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y); +void ( APIENTRY * qglRasterPos2iv )(const GLint *v); +void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y); +void ( APIENTRY * qglRasterPos2sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglRasterPos3iv )(const GLint *v); +void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglRasterPos3sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglRasterPos4iv )(const GLint *v); +void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglRasterPos4sv )(const GLshort *v); +void ( APIENTRY * qglReadBuffer )(GLenum mode); +void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2); +void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2); +void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2); +void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2); +void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2); +GLint ( APIENTRY * qglRenderMode )(GLenum mode); +void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer); +void ( APIENTRY * qglShadeModel )(GLenum mode); +void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask); +void ( APIENTRY * qglStencilMask )(GLuint mask); +void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass); +void ( APIENTRY * qglTexCoord1d )(GLdouble s); +void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord1f )(GLfloat s); +void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord1i )(GLint s); +void ( APIENTRY * qglTexCoord1iv )(const GLint *v); +void ( APIENTRY * qglTexCoord1s )(GLshort s); +void ( APIENTRY * qglTexCoord1sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t); +void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t); +void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t); +void ( APIENTRY * qglTexCoord2iv )(const GLint *v); +void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t); +void ( APIENTRY * qglTexCoord2sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r); +void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r); +void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r); +void ( APIENTRY * qglTexCoord3iv )(const GLint *v); +void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r); +void ( APIENTRY * qglTexCoord3sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q); +void ( APIENTRY * qglTexCoord4iv )(const GLint *v); +void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q); +void ( APIENTRY * qglTexCoord4sv )(const GLshort *v); +void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param); +void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params); +void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param); +void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglVertex2dv )(const GLdouble *v); +void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglVertex2fv )(const GLfloat *v); +void ( APIENTRY * qglVertex2i )(GLint x, GLint y); +void ( APIENTRY * qglVertex2iv )(const GLint *v); +void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y); +void ( APIENTRY * qglVertex2sv )(const GLshort *v); +void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglVertex3dv )(const GLdouble *v); +void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex3fv )(const GLfloat *v); +void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglVertex3iv )(const GLint *v); +void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglVertex3sv )(const GLshort *v); +void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglVertex4dv )(const GLdouble *v); +void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglVertex4fv )(const GLfloat *v); +void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglVertex4iv )(const GLint *v); +void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglVertex4sv )(const GLshort *v); +void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height); + +void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value ); +void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); +void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); +void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); +void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); + +void ( APIENTRY * qglActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglClientActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglMultiTexCoord1dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord1dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord1fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord1fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord1iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord1ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord1sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord1svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord2dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord2dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord2fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord2fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord2iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord2ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord2sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord2svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord3dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord3dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord3fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord3fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord3iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord3ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord3sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord3svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord4dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord4dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord4fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord4fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord4iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord4ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord4sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord4svARB) (GLenum target, const GLshort *v); + +// glu stuff +void (APIENTRY * qgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +int (APIENTRY * qgluBuild2DMipmaps) (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data); +// added for plugins +void (APIENTRY * qgluLookAt)( + GLdouble eyex, + GLdouble eyey, + GLdouble eyez, + GLdouble centerx, + GLdouble centery, + GLdouble centerz, + GLdouble upx, + GLdouble upy, + GLdouble upz); +const GLubyte* (APIENTRY * qgluErrorString) (GLenum errCode ); + +/* +** QGL_Shutdown +** +** Unloads the specified DLL then nulls out all the proc pointers. +*/ +void QGL_Shutdown() +{ + Sys_Printf("Shutting down GL ..."); + + if (g_hGLDLL) + { +#ifdef _WIN32 + FreeLibrary(g_hGLDLL); +#endif + +//#if defined (__linux__) || defined (__APPLE__) +// dlclose (g_hGLDLL); +//#endif + + g_hGLDLL = NULL; + } + + Sys_Printf("Done.\n"); + + qglAccum = NULL; + qglAlphaFunc = NULL; + qglAreTexturesResident = NULL; + qglArrayElement = NULL; + qglBegin = NULL; + qglBindTexture = NULL; + qglBitmap = NULL; + qglBlendFunc = NULL; + qglCallList = NULL; + qglCallLists = NULL; + qglClear = NULL; + qglClearAccum = NULL; + qglClearColor = NULL; + qglClearDepth = NULL; + qglClearIndex = NULL; + qglClearStencil = NULL; + qglClipPlane = NULL; + qglColor3b = NULL; + qglColor3bv = NULL; + qglColor3d = NULL; + qglColor3dv = NULL; + qglColor3f = NULL; + qglColor3fv = NULL; + qglColor3i = NULL; + qglColor3iv = NULL; + qglColor3s = NULL; + qglColor3sv = NULL; + qglColor3ub = NULL; + qglColor3ubv = NULL; + qglColor3ui = NULL; + qglColor3uiv = NULL; + qglColor3us = NULL; + qglColor3usv = NULL; + qglColor4b = NULL; + qglColor4bv = NULL; + qglColor4d = NULL; + qglColor4dv = NULL; + qglColor4f = NULL; + qglColor4fv = NULL; + qglColor4i = NULL; + qglColor4iv = NULL; + qglColor4s = NULL; + qglColor4sv = NULL; + qglColor4ub = NULL; + qglColor4ubv = NULL; + qglColor4ui = NULL; + qglColor4uiv = NULL; + qglColor4us = NULL; + qglColor4usv = NULL; + qglColorMask = NULL; + qglColorMaterial = NULL; + qglColorPointer = NULL; + qglCopyPixels = NULL; + qglCopyTexImage1D = NULL; + qglCopyTexImage2D = NULL; + qglCopyTexSubImage1D = NULL; + qglCopyTexSubImage2D = NULL; + qglCullFace = NULL; + qglDeleteLists = NULL; + qglDeleteTextures = NULL; + qglDepthFunc = NULL; + qglDepthMask = NULL; + qglDepthRange = NULL; + qglDisable = NULL; + qglDisableClientState = NULL; + qglDrawArrays = NULL; + qglDrawBuffer = NULL; + qglDrawElements = NULL; + qglDrawPixels = NULL; + qglEdgeFlag = NULL; + qglEdgeFlagPointer = NULL; + qglEdgeFlagv = NULL; + qglEnable = NULL; + qglEnableClientState = NULL; + qglEnd = NULL; + qglEndList = NULL; + qglEvalCoord1d = NULL; + qglEvalCoord1dv = NULL; + qglEvalCoord1f = NULL; + qglEvalCoord1fv = NULL; + qglEvalCoord2d = NULL; + qglEvalCoord2dv = NULL; + qglEvalCoord2f = NULL; + qglEvalCoord2fv = NULL; + qglEvalMesh1 = NULL; + qglEvalMesh2 = NULL; + qglEvalPoint1 = NULL; + qglEvalPoint2 = NULL; + qglFeedbackBuffer = NULL; + qglFinish = NULL; + qglFlush = NULL; + qglFogf = NULL; + qglFogfv = NULL; + qglFogi = NULL; + qglFogiv = NULL; + qglFrontFace = NULL; + qglFrustum = NULL; + qglGenLists = NULL; + qglGenTextures = NULL; + qglGetBooleanv = NULL; + qglGetClipPlane = NULL; + qglGetDoublev = NULL; + qglGetError = NULL; + qglGetFloatv = NULL; + qglGetIntegerv = NULL; + qglGetLightfv = NULL; + qglGetLightiv = NULL; + qglGetMapdv = NULL; + qglGetMapfv = NULL; + qglGetMapiv = NULL; + qglGetMaterialfv = NULL; + qglGetMaterialiv = NULL; + qglGetPixelMapfv = NULL; + qglGetPixelMapuiv = NULL; + qglGetPixelMapusv = NULL; + qglGetPointerv = NULL; + qglGetPolygonStipple = NULL; + qglGetString = NULL; + qglGetTexEnvfv = NULL; + qglGetTexEnviv = NULL; + qglGetTexGendv = NULL; + qglGetTexGenfv = NULL; + qglGetTexGeniv = NULL; + qglGetTexImage = NULL; + qglGetTexLevelParameterfv = NULL; + qglGetTexLevelParameteriv = NULL; + qglGetTexParameterfv = NULL; + qglGetTexParameteriv = NULL; + qglHint = NULL; + qglIndexMask = NULL; + qglIndexPointer = NULL; + qglIndexd = NULL; + qglIndexdv = NULL; + qglIndexf = NULL; + qglIndexfv = NULL; + qglIndexi = NULL; + qglIndexiv = NULL; + qglIndexs = NULL; + qglIndexsv = NULL; + qglIndexub = NULL; + qglIndexubv = NULL; + qglInitNames = NULL; + qglInterleavedArrays = NULL; + qglIsEnabled = NULL; + qglIsList = NULL; + qglIsTexture = NULL; + qglLightModelf = NULL; + qglLightModelfv = NULL; + qglLightModeli = NULL; + qglLightModeliv = NULL; + qglLightf = NULL; + qglLightfv = NULL; + qglLighti = NULL; + qglLightiv = NULL; + qglLineStipple = NULL; + qglLineWidth = NULL; + qglListBase = NULL; + qglLoadIdentity = NULL; + qglLoadMatrixd = NULL; + qglLoadMatrixf = NULL; + qglLoadName = NULL; + qglLogicOp = NULL; + qglMap1d = NULL; + qglMap1f = NULL; + qglMap2d = NULL; + qglMap2f = NULL; + qglMapGrid1d = NULL; + qglMapGrid1f = NULL; + qglMapGrid2d = NULL; + qglMapGrid2f = NULL; + qglMaterialf = NULL; + qglMaterialfv = NULL; + qglMateriali = NULL; + qglMaterialiv = NULL; + qglMatrixMode = NULL; + qglMultMatrixd = NULL; + qglMultMatrixf = NULL; + qglNewList = NULL; + qglNormal3b = NULL; + qglNormal3bv = NULL; + qglNormal3d = NULL; + qglNormal3dv = NULL; + qglNormal3f = NULL; + qglNormal3fv = NULL; + qglNormal3i = NULL; + qglNormal3iv = NULL; + qglNormal3s = NULL; + qglNormal3sv = NULL; + qglNormalPointer = NULL; + qglOrtho = NULL; + qglPassThrough = NULL; + qglPixelMapfv = NULL; + qglPixelMapuiv = NULL; + qglPixelMapusv = NULL; + qglPixelStoref = NULL; + qglPixelStorei = NULL; + qglPixelTransferf = NULL; + qglPixelTransferi = NULL; + qglPixelZoom = NULL; + qglPointSize = NULL; + qglPolygonMode = NULL; + qglPolygonOffset = NULL; + qglPolygonStipple = NULL; + qglPopAttrib = NULL; + qglPopClientAttrib = NULL; + qglPopMatrix = NULL; + qglPopName = NULL; + qglPrioritizeTextures = NULL; + qglPushAttrib = NULL; + qglPushClientAttrib = NULL; + qglPushMatrix = NULL; + qglPushName = NULL; + qglRasterPos2d = NULL; + qglRasterPos2dv = NULL; + qglRasterPos2f = NULL; + qglRasterPos2fv = NULL; + qglRasterPos2i = NULL; + qglRasterPos2iv = NULL; + qglRasterPos2s = NULL; + qglRasterPos2sv = NULL; + qglRasterPos3d = NULL; + qglRasterPos3dv = NULL; + qglRasterPos3f = NULL; + qglRasterPos3fv = NULL; + qglRasterPos3i = NULL; + qglRasterPos3iv = NULL; + qglRasterPos3s = NULL; + qglRasterPos3sv = NULL; + qglRasterPos4d = NULL; + qglRasterPos4dv = NULL; + qglRasterPos4f = NULL; + qglRasterPos4fv = NULL; + qglRasterPos4i = NULL; + qglRasterPos4iv = NULL; + qglRasterPos4s = NULL; + qglRasterPos4sv = NULL; + qglReadBuffer = NULL; + qglReadPixels = NULL; + qglRectd = NULL; + qglRectdv = NULL; + qglRectf = NULL; + qglRectfv = NULL; + qglRecti = NULL; + qglRectiv = NULL; + qglRects = NULL; + qglRectsv = NULL; + qglRenderMode = NULL; + qglRotated = NULL; + qglRotatef = NULL; + qglScaled = NULL; + qglScalef = NULL; + qglScissor = NULL; + qglSelectBuffer = NULL; + qglShadeModel = NULL; + qglStencilFunc = NULL; + qglStencilMask = NULL; + qglStencilOp = NULL; + qglTexCoord1d = NULL; + qglTexCoord1dv = NULL; + qglTexCoord1f = NULL; + qglTexCoord1fv = NULL; + qglTexCoord1i = NULL; + qglTexCoord1iv = NULL; + qglTexCoord1s = NULL; + qglTexCoord1sv = NULL; + qglTexCoord2d = NULL; + qglTexCoord2dv = NULL; + qglTexCoord2f = NULL; + qglTexCoord2fv = NULL; + qglTexCoord2i = NULL; + qglTexCoord2iv = NULL; + qglTexCoord2s = NULL; + qglTexCoord2sv = NULL; + qglTexCoord3d = NULL; + qglTexCoord3dv = NULL; + qglTexCoord3f = NULL; + qglTexCoord3fv = NULL; + qglTexCoord3i = NULL; + qglTexCoord3iv = NULL; + qglTexCoord3s = NULL; + qglTexCoord3sv = NULL; + qglTexCoord4d = NULL; + qglTexCoord4dv = NULL; + qglTexCoord4f = NULL; + qglTexCoord4fv = NULL; + qglTexCoord4i = NULL; + qglTexCoord4iv = NULL; + qglTexCoord4s = NULL; + qglTexCoord4sv = NULL; + qglTexCoordPointer = NULL; + qglTexEnvf = NULL; + qglTexEnvfv = NULL; + qglTexEnvi = NULL; + qglTexEnviv = NULL; + qglTexGend = NULL; + qglTexGendv = NULL; + qglTexGenf = NULL; + qglTexGenfv = NULL; + qglTexGeni = NULL; + qglTexGeniv = NULL; + qglTexImage1D = NULL; + qglTexImage2D = NULL; + qglTexParameterf = NULL; + qglTexParameterfv = NULL; + qglTexParameteri = NULL; + qglTexParameteriv = NULL; + qglTexSubImage1D = NULL; + qglTexSubImage2D = NULL; + qglTranslated = NULL; + qglTranslatef = NULL; + qglVertex2d = NULL; + qglVertex2dv = NULL; + qglVertex2f = NULL; + qglVertex2fv = NULL; + qglVertex2i = NULL; + qglVertex2iv = NULL; + qglVertex2s = NULL; + qglVertex2sv = NULL; + qglVertex3d = NULL; + qglVertex3dv = NULL; + qglVertex3f = NULL; + qglVertex3fv = NULL; + qglVertex3i = NULL; + qglVertex3iv = NULL; + qglVertex3s = NULL; + qglVertex3sv = NULL; + qglVertex4d = NULL; + qglVertex4dv = NULL; + qglVertex4f = NULL; + qglVertex4fv = NULL; + qglVertex4i = NULL; + qglVertex4iv = NULL; + qglVertex4s = NULL; + qglVertex4sv = NULL; + qglVertexPointer = NULL; + qglViewport = NULL; + + qglActiveTextureARB = NULL; + qglClientActiveTextureARB = NULL; + qglMultiTexCoord1dARB = NULL; + qglMultiTexCoord1dvARB = NULL; + qglMultiTexCoord1fARB = NULL; + qglMultiTexCoord1fvARB = NULL; + qglMultiTexCoord1iARB = NULL; + qglMultiTexCoord1ivARB = NULL; + qglMultiTexCoord1sARB = NULL; + qglMultiTexCoord1svARB = NULL; + qglMultiTexCoord2dARB = NULL; + qglMultiTexCoord2dvARB = NULL; + qglMultiTexCoord2fARB = NULL; + qglMultiTexCoord2fvARB = NULL; + qglMultiTexCoord2iARB = NULL; + qglMultiTexCoord2ivARB = NULL; + qglMultiTexCoord2sARB = NULL; + qglMultiTexCoord2svARB = NULL; + qglMultiTexCoord3dARB = NULL; + qglMultiTexCoord3dvARB = NULL; + qglMultiTexCoord3fARB = NULL; + qglMultiTexCoord3fvARB = NULL; + qglMultiTexCoord3iARB = NULL; + qglMultiTexCoord3ivARB = NULL; + qglMultiTexCoord3sARB = NULL; + qglMultiTexCoord3svARB = NULL; + qglMultiTexCoord4dARB = NULL; + qglMultiTexCoord4dvARB = NULL; + qglMultiTexCoord4fARB = NULL; + qglMultiTexCoord4fvARB = NULL; + qglMultiTexCoord4iARB = NULL; + qglMultiTexCoord4ivARB = NULL; + qglMultiTexCoord4sARB = NULL; + qglMultiTexCoord4svARB = NULL; + +#ifdef _WIN32 + qwglCopyContext = NULL; + qwglCreateContext = NULL; + qwglCreateLayerContext = NULL; + qwglDeleteContext = NULL; + qwglDescribeLayerPlane = NULL; + qwglGetCurrentContext = NULL; + qwglGetCurrentDC = NULL; + qwglGetLayerPaletteEntries = NULL; + qwglGetProcAddress = NULL; + qwglMakeCurrent = NULL; + qwglRealizeLayerPalette = NULL; + qwglSetLayerPaletteEntries = NULL; + qwglShareLists = NULL; + qwglSwapLayerBuffers = NULL; + qwglUseFontBitmaps = NULL; + qwglUseFontOutlines = NULL; + + qwglChoosePixelFormat = NULL; + qwglDescribePixelFormat = NULL; + qwglGetPixelFormat = NULL; + qwglSetPixelFormat = NULL; + qwglSwapBuffers = NULL; + + qwglSwapIntervalEXT = NULL; + + qwglGetDeviceGammaRampEXT = NULL; + qwglSetDeviceGammaRampEXT = NULL; +#endif + +#if defined (__linux__) || defined (__APPLE__) + qglXChooseVisual = NULL; + qglXCreateContext = NULL; + qglXDestroyContext = NULL; + qglXMakeCurrent = NULL; + qglXCopyContext = NULL; + qglXSwapBuffers = NULL; + qglXCreateGLXPixmap = NULL; + qglXDestroyGLXPixmap = NULL; + qglXQueryExtension = NULL; + qglXQueryVersion = NULL; + qglXIsDirect = NULL; + qglXGetConfig = NULL; + qglXGetCurrentContext = NULL; + qglXGetCurrentDrawable = NULL; + qglXWaitGL = NULL; + qglXWaitX = NULL; + qglXUseXFont = NULL; + qglXGetProcAddressARB = NULL; +#endif + + qgluPerspective = NULL; + qgluBuild2DMipmaps = NULL; + qgluErrorString = NULL; + qgluLookAt = NULL; +} + +/* +** QGL_Init +** +** This is responsible for binding our qgl function pointers to +** the appropriate GL stuff. In Windows this means doing a +** LoadLibrary and a bunch of calls to GetProcAddress. On other +** operating systems we need to do the right thing, whatever that +** might be. +** +*/ +static int init_error; + +//static void* safe_dlsym (void *handle, char *symbol) +//{ +//#ifdef _WIN32 +// return GetProcAddress (handle, symbol); +//#endif + +//#if defined (__linux__) || defined (__APPLE__) +// void* ret = dlsym (handle, symbol); +// char *err = dlerror(); +// if (err) +//{ +// init_error = 1; +// printf ("Error loading OpenGL libraries: %s %s\n", err, symbol); +// } +// return ret; +//#endif +//} + +#include +#include +#ifdef _WIN32 +#define M_PI 3.14159 +#endif + +void WINAPI gluLookAt2 (GLdouble ex, GLdouble ey, GLdouble ez, GLdouble cx, GLdouble cy, GLdouble cz, + GLdouble ux, GLdouble uy, GLdouble uz) +{ + GLdouble x[3], y[3], z[3] = { ex-cx, ey-cy, ez-cz }; + GLdouble inv; + + inv = sqrt (z[0]*z[0] + z[1]*z[1] + z[2]*z[2]); + if (inv) + { + inv = 1.0/inv; + z[0] *= inv; + z[1] *= inv; + z[2] *= inv; + } + + x[0] = uy*z[2] - uz*z[1]; + x[1] = -ux*z[2] + uz*z[0]; + x[2] = ux*z[1] - uy*z[0]; + + y[0] = z[1]*x[2] - z[2]*x[1]; + y[1] = -z[0]*x[2] + z[2]*x[0]; + y[2] = z[0]*x[1] - z[1]*x[0]; + + inv = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]); + if (inv) + { + x[0] *= inv; + x[1] *= inv; + x[2] *= inv; + } + + inv = sqrt(y[0]*y[0] + y[1]*y[1] + y[2]*y[2]); + if (inv) + { + y[0] *= inv; + y[1] *= inv; + y[2] *= inv; + } + + { + GLdouble m[16] = { x[0], y[0], z[0], 0, x[1], y[1], z[1], 0, x[2], y[2], z[2], 0, 0, 0, 0, 1 }; + qglMultMatrixd(m); + qglTranslated(-ex, -ey, -ez); + } +} + +void WINAPI gluPerspective2 (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble y = zNear * tan (fovy * M_PI / 360.0); + qglFrustum (-y*aspect, y*aspect, -y, y, zNear, zFar); +} + +static void* WINAPI ResizeImage (GLubyte* old_image, int srcw, int srch, int destw, int desth) +{ + int i, j; + float sx, sy; + + GLubyte* new_image = malloc (destw*desth*4*sizeof(GLubyte)); + if (new_image == NULL) + return NULL; + + if (destw > 1) + sx = (GLfloat) (srcw-1) / (GLfloat) (destw-1); + else + sx = (GLfloat) (srcw-1); + if (desth > 1) + sy = (GLfloat) (srch-1) / (GLfloat) (desth-1); + else + sy = (GLfloat) (srch-1); + + for (i = 0; i < desth; i++) + { + GLint ii = (GLint)(i * sy); + for (j = 0; j < destw; j++) + { + GLint jj = (GLint)(j * sx); + GLubyte *src = old_image + (ii * srcw + jj) * 4; + GLubyte *dst = new_image + (i * destw + j) * 4; + + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } + } + + return new_image; +} + +#define CEILING(A, B) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) + +// NOTE: only supports RGBA, UNSIGNED_BYTE images. +GLint WINAPI gluBuild2DMipmaps2 (GLenum target, GLint components, GLsizei width, GLsizei height, GLenum format, + GLenum type, const void *data) +{ + GLint w, h, level, maxsize, sizein = 1; + GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; + GLint packrowlength, packalignment, packskiprows, packskippixels; + GLint rowstride, rowlen; + GLuint i, j, k, pow2; + GLubyte *image, *tmp; + + if (width < 1 || height < 1) + return GLU_INVALID_VALUE; + + qglGetIntegerv (GL_UNPACK_ROW_LENGTH, &unpackrowlength); + qglGetIntegerv (GL_UNPACK_ALIGNMENT, &unpackalignment); + qglGetIntegerv (GL_UNPACK_SKIP_ROWS, &unpackskiprows); + qglGetIntegerv (GL_UNPACK_SKIP_PIXELS, &unpackskippixels); + qglGetIntegerv (GL_PACK_ROW_LENGTH, &packrowlength); + qglGetIntegerv (GL_PACK_ALIGNMENT, &packalignment); + qglGetIntegerv (GL_PACK_SKIP_ROWS, &packskiprows); + qglGetIntegerv (GL_PACK_SKIP_PIXELS, &packskippixels); + qglGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxsize); + + for (pow2 = 1; pow2 < width; pow2 = pow2 << 1); + w = (pow2 == width) ? width : (pow2 << 1); + + for (pow2 = 1; pow2 < height; pow2 = pow2 << 1); + h = (pow2 == height) ? height : (pow2 << 1); + + if (w > maxsize) w = maxsize; + if (h > maxsize) h = maxsize; + + // Build RGBA packed image + image = malloc (width*height*4); + if (image == NULL) + return GLU_OUT_OF_MEMORY; + + if ((format != GL_RGBA) || (type != GL_UNSIGNED_BYTE)) + return GLU_INVALID_ENUM; + + rowlen = (unpackrowlength > 0) ? unpackrowlength : width; + + if (sizein >= unpackalignment) + rowstride = components * rowlen; + else + rowstride = unpackalignment/sizein * CEILING (components * rowlen * sizein, unpackalignment); + + k = 0; + for (i = 0; i < height; i++) + { + GLubyte *ubptr = (GLubyte*)data + i * rowstride + + unpackskiprows * rowstride + unpackskippixels * components; + + for (j = 0; j < width*components; j++) + image[k++] = *ubptr++; + } + + if (w != width || h != height) + { + tmp = ResizeImage (image, width, height, w, h); + free (image); + image = tmp; + + if (image == NULL) + return GLU_OUT_OF_MEMORY; + } + + qglPixelStorei (GL_PACK_ROW_LENGTH, 0); + qglPixelStorei (GL_PACK_ALIGNMENT, 1); + qglPixelStorei (GL_PACK_SKIP_ROWS, 0); + qglPixelStorei (GL_PACK_SKIP_PIXELS, 0); + qglPixelStorei (GL_UNPACK_ROW_LENGTH, 0); + qglPixelStorei (GL_UNPACK_ALIGNMENT, 1); + qglPixelStorei (GL_UNPACK_SKIP_ROWS, 0); + qglPixelStorei (GL_UNPACK_SKIP_PIXELS, 0); + + qglTexImage2D (target, 0, components, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); + + for (level = 1; ((w != 1) || (h != 1)); level++) + { + GLubyte *out, *in; + int row; + + row = w * 4; + if (w != 1) w >>= 1; + if (h != 1) h >>= 1; + in = out = image; + + for (i = 0; i < h; i++, in+=row) + for (j = 0; j < w; j++, out+=4, in+=8) + { + out[0] = (in[0] + in[4] + in[row+0] + in[row+4])>>2; + out[1] = (in[1] + in[5] + in[row+1] + in[row+5])>>2; + out[2] = (in[2] + in[6] + in[row+2] + in[row+6])>>2; + out[3] = (in[3] + in[7] + in[row+3] + in[row+7])>>2; + } + + qglTexImage2D (target, level, components, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); + } + + free (image); + qglPixelStorei (GL_UNPACK_ROW_LENGTH, unpackrowlength); + qglPixelStorei (GL_UNPACK_ALIGNMENT, unpackalignment); + qglPixelStorei (GL_UNPACK_SKIP_ROWS, unpackskiprows); + qglPixelStorei (GL_UNPACK_SKIP_PIXELS, unpackskippixels); + qglPixelStorei (GL_PACK_ROW_LENGTH, packrowlength); + qglPixelStorei (GL_PACK_ALIGNMENT, packalignment); + qglPixelStorei (GL_PACK_SKIP_ROWS, packskiprows); + qglPixelStorei (GL_PACK_SKIP_PIXELS, packskippixels); + + return 0; +} + +typedef struct glu_error_struct +{ + int errnum; + const char *errstr; +} GLU_ERROR_STRUCT; + +GLU_ERROR_STRUCT glu_errlist[] = { + {GL_NO_ERROR, "GL_NO_ERROR - no error"}, + {GL_INVALID_ENUM, "GL_INVALID_ENUM - An unacceptable value is specified for an enumerated argument."}, + {GL_INVALID_VALUE, "GL_INVALID_VALUE - A numeric argument is out of range."}, + {GL_INVALID_OPERATION, "GL_INVALID_OPERATION - The specified operation is not allowed in the current state."}, + {GL_STACK_OVERFLOW, "GL_STACK_OVERFLOW - Function would cause a stack overflow."}, + {GL_STACK_UNDERFLOW, "GL_STACK_UNDERFLOW - Function would cause a stack underflow."}, + {GL_OUT_OF_MEMORY, "GL_OUT_OF_MEMORY - There is not enough memory left to execute the function."}, + {-1, NULL} +}; + +const GLubyte* WINAPI gluErrorString(GLenum errCode ) +{ + int search = 0; + for (search = 0; glu_errlist[search].errstr; search++) + { + if (errCode == glu_errlist[search].errnum) + return (const char *)glu_errlist[search].errstr; + } //end for + return "Unknown error"; +} + +int QGL_Init(const char *dllname, const char* gluname) +{ +#ifdef _WIN32 + g_hGLDLL = LoadLibrary(dllname); +#endif + +#if defined (__linux__) + char* err; + + g_hGLDLL = dlopen(dllname, RTLD_LAZY|RTLD_GLOBAL); + err = dlerror(); + if (err) + printf ("Error loading GL lib:\n%s\n", err); +#endif + init_error = 0; + +#ifndef __APPLE__ + if (g_hGLDLL == NULL) + return 0; +#endif + + Sys_Printf("Loading GL library: %s ...", dllname); + + qgluPerspective = &gluPerspective2; + qgluBuild2DMipmaps = &gluBuild2DMipmaps2; + qgluLookAt = &gluLookAt2; + qgluErrorString = &gluErrorString; + + qglAccum = glAccum; + qglAlphaFunc = glAlphaFunc; + qglAreTexturesResident = glAreTexturesResident; + qglArrayElement = glArrayElement; + qglBegin = glBegin; + qglBindTexture = glBindTexture; + qglBitmap = glBitmap; + qglBlendFunc = glBlendFunc; + qglCallList = glCallList; + qglCallLists = glCallLists; + qglClear = glClear; + qglClearAccum = glClearAccum; + qglClearColor = glClearColor; + qglClearDepth = glClearDepth; + qglClearIndex = glClearIndex; + qglClearStencil = glClearStencil; + qglClipPlane = glClipPlane; + qglColor3b = glColor3b; + qglColor3bv = glColor3bv; + qglColor3d = glColor3d; + qglColor3dv = glColor3dv; + qglColor3f = glColor3f; + qglColor3fv = glColor3fv; + qglColor3i = glColor3i; + qglColor3iv = glColor3iv; + qglColor3s = glColor3s; + qglColor3sv = glColor3sv; + qglColor3ub = glColor3ub; + qglColor3ubv = glColor3ubv; + qglColor3ui = glColor3ui; + qglColor3uiv = glColor3uiv; + qglColor3us = glColor3us; + qglColor3usv = glColor3usv; + qglColor4b = glColor4b; + qglColor4bv = glColor4bv; + qglColor4d = glColor4d; + qglColor4dv = glColor4dv; + qglColor4f = glColor4f; + qglColor4fv = glColor4fv; + qglColor4i = glColor4i; + qglColor4iv = glColor4iv; + qglColor4s = glColor4s; + qglColor4sv = glColor4sv; + qglColor4ub = glColor4ub; + qglColor4ubv = glColor4ubv; + qglColor4ui = glColor4ui; + qglColor4uiv = glColor4uiv; + qglColor4us = glColor4us; + qglColor4usv = glColor4usv; + qglColorMask = glColorMask; + qglColorMaterial = glColorMaterial; + qglColorPointer = glColorPointer; + qglCopyPixels = glCopyPixels; + qglCopyTexImage1D = glCopyTexImage1D; + qglCopyTexImage2D = glCopyTexImage2D; + qglCopyTexSubImage1D = glCopyTexSubImage1D; + qglCopyTexSubImage2D = glCopyTexSubImage2D; + qglCullFace = glCullFace; + qglDeleteLists = glDeleteLists; + qglDeleteTextures = glDeleteTextures; + qglDepthFunc = glDepthFunc; + qglDepthMask = glDepthMask; + qglDepthRange = glDepthRange; + qglDisable = glDisable; + qglDisableClientState = glDisableClientState; + qglDrawArrays = glDrawArrays; + qglDrawBuffer = glDrawBuffer; + qglDrawElements = glDrawElements; + qglDrawPixels = glDrawPixels; + qglEdgeFlag = glEdgeFlag; + qglEdgeFlagPointer = glEdgeFlagPointer; + qglEdgeFlagv = glEdgeFlagv; + qglEnable = glEnable; + qglEnableClientState = glEnableClientState; + qglEnd = glEnd; + qglEndList = glEndList; + qglEvalCoord1d = glEvalCoord1d; + qglEvalCoord1dv = glEvalCoord1dv; + qglEvalCoord1f = glEvalCoord1f; + qglEvalCoord1fv = glEvalCoord1fv; + qglEvalCoord2d = glEvalCoord2d; + qglEvalCoord2dv = glEvalCoord2dv; + qglEvalCoord2f = glEvalCoord2f; + qglEvalCoord2fv = glEvalCoord2fv; + qglEvalMesh1 = glEvalMesh1; + qglEvalMesh2 = glEvalMesh2; + qglEvalPoint1 = glEvalPoint1; + qglEvalPoint2 = glEvalPoint2; + qglFeedbackBuffer = glFeedbackBuffer; + qglFinish = glFinish; + qglFlush = glFlush; + qglFogf = glFogf; + qglFogfv = glFogfv; + qglFogi = glFogi; + qglFogiv = glFogiv; + qglFrontFace = glFrontFace; + qglFrustum = glFrustum; + qglGenLists = glGenLists; + qglGenTextures = glGenTextures; + qglGetBooleanv = glGetBooleanv; + qglGetClipPlane = glGetClipPlane; + qglGetDoublev = glGetDoublev; + qglGetError = glGetError; + qglGetFloatv = glGetFloatv; + qglGetIntegerv = glGetIntegerv; + qglGetLightfv = glGetLightfv; + qglGetLightiv = glGetLightiv; + qglGetMapdv = glGetMapdv; + qglGetMapfv = glGetMapfv; + qglGetMapiv = glGetMapiv; + qglGetMaterialfv = glGetMaterialfv; + qglGetMaterialiv = glGetMaterialiv; + qglGetPixelMapfv = glGetPixelMapfv; + qglGetPixelMapuiv = glGetPixelMapuiv; + qglGetPixelMapusv = glGetPixelMapusv; + qglGetPointerv = glGetPointerv; + qglGetPolygonStipple = glGetPolygonStipple; + qglGetString = glGetString; + qglGetTexEnvfv = glGetTexEnvfv; + qglGetTexEnviv = glGetTexEnviv; + qglGetTexGendv = glGetTexGendv; + qglGetTexGenfv = glGetTexGenfv; + qglGetTexGeniv = glGetTexGeniv; + qglGetTexImage = glGetTexImage; + qglGetTexLevelParameterfv = glGetTexLevelParameterfv; + qglGetTexLevelParameteriv = glGetTexLevelParameteriv; + qglGetTexParameterfv = glGetTexParameterfv; + qglGetTexParameteriv = glGetTexParameteriv; + qglHint = glHint; + qglIndexMask = glIndexMask; + qglIndexPointer = glIndexPointer; + qglIndexd = glIndexd; + qglIndexdv = glIndexdv; + qglIndexf = glIndexf; + qglIndexfv = glIndexfv; + qglIndexi = glIndexi; + qglIndexiv = glIndexiv; + qglIndexs = glIndexs; + qglIndexsv = glIndexsv; + qglIndexub = glIndexub; + qglIndexubv = glIndexubv; + qglInitNames = glInitNames; + qglInterleavedArrays = glInterleavedArrays; + qglIsEnabled = glIsEnabled; + qglIsList = glIsList; + qglIsTexture = glIsTexture; + qglLightModelf = glLightModelf; + qglLightModelfv = glLightModelfv; + qglLightModeli = glLightModeli; + qglLightModeliv = glLightModeliv; + qglLightf = glLightf; + qglLightfv = glLightfv; + qglLighti = glLighti; + qglLightiv = glLightiv; + qglLineStipple = glLineStipple; + qglLineWidth = glLineWidth; + qglListBase = glListBase; + qglLoadIdentity = glLoadIdentity; + qglLoadMatrixd = glLoadMatrixd; + qglLoadMatrixf = glLoadMatrixf; + qglLoadName = glLoadName; + qglLogicOp = glLogicOp; + qglMap1d = glMap1d; + qglMap1f = glMap1f; + qglMap2d = glMap2d; + qglMap2f = glMap2f; + qglMapGrid1d = glMapGrid1d; + qglMapGrid1f = glMapGrid1f; + qglMapGrid2d = glMapGrid2d; + qglMapGrid2f = glMapGrid2f; + qglMaterialf = glMaterialf; + qglMaterialfv = glMaterialfv; + qglMateriali = glMateriali; + qglMaterialiv = glMaterialiv; + qglMatrixMode = glMatrixMode; + qglMultMatrixd = glMultMatrixd; + qglMultMatrixf = glMultMatrixf; + qglNewList = glNewList; + qglNormal3b = glNormal3b; + qglNormal3bv = glNormal3bv; + qglNormal3d = glNormal3d; + qglNormal3dv = glNormal3dv; + qglNormal3f = glNormal3f; + qglNormal3fv = glNormal3fv; + qglNormal3i = glNormal3i; + qglNormal3iv = glNormal3iv; + qglNormal3s = glNormal3s; + qglNormal3sv = glNormal3sv; + qglNormalPointer = glNormalPointer; + qglOrtho = glOrtho; + qglPassThrough = glPassThrough; + qglPixelMapfv = glPixelMapfv; + qglPixelMapuiv = glPixelMapuiv; + qglPixelMapusv = glPixelMapusv; + qglPixelStoref = glPixelStoref; + qglPixelStorei = glPixelStorei; + qglPixelTransferf = glPixelTransferf; + qglPixelTransferi = glPixelTransferi; + qglPixelZoom = glPixelZoom; + qglPointSize = glPointSize; + qglPolygonMode = glPolygonMode; + qglPolygonOffset = glPolygonOffset; + qglPolygonStipple = glPolygonStipple; + qglPopAttrib = glPopAttrib; + qglPopClientAttrib = glPopClientAttrib; + qglPopMatrix = glPopMatrix; + qglPopName = glPopName; + qglPrioritizeTextures = glPrioritizeTextures; + qglPushAttrib = glPushAttrib; + qglPushClientAttrib = glPushClientAttrib; + qglPushMatrix = glPushMatrix; + qglPushName = glPushName; + qglRasterPos2d = glRasterPos2d; + qglRasterPos2dv = glRasterPos2dv; + qglRasterPos2f = glRasterPos2f; + qglRasterPos2fv = glRasterPos2fv; + qglRasterPos2i = glRasterPos2i; + qglRasterPos2iv = glRasterPos2iv; + qglRasterPos2s = glRasterPos2s; + qglRasterPos2sv = glRasterPos2sv; + qglRasterPos3d = glRasterPos3d; + qglRasterPos3dv = glRasterPos3dv; + qglRasterPos3f = glRasterPos3f; + qglRasterPos3fv = glRasterPos3fv; + qglRasterPos3i = glRasterPos3i; + qglRasterPos3iv = glRasterPos3iv; + qglRasterPos3s = glRasterPos3s; + qglRasterPos3sv = glRasterPos3sv; + qglRasterPos4d = glRasterPos4d; + qglRasterPos4dv = glRasterPos4dv; + qglRasterPos4f = glRasterPos4f; + qglRasterPos4fv = glRasterPos4fv; + qglRasterPos4i = glRasterPos4i; + qglRasterPos4iv = glRasterPos4iv; + qglRasterPos4s = glRasterPos4s; + qglRasterPos4sv = glRasterPos4sv; + qglReadBuffer = glReadBuffer; + qglReadPixels = glReadPixels; + qglRectd = glRectd; + qglRectdv = glRectdv; + qglRectf = glRectf; + qglRectfv = glRectfv; + qglRecti = glRecti; + qglRectiv = glRectiv; + qglRects = glRects; + qglRectsv = glRectsv; + qglRenderMode = glRenderMode; + qglRotated = glRotated; + qglRotatef = glRotatef; + qglScaled = glScaled; + qglScalef = glScalef; + qglScissor = glScissor; + qglSelectBuffer = glSelectBuffer; + qglShadeModel = glShadeModel; + qglStencilFunc = glStencilFunc; + qglStencilMask = glStencilMask; + qglStencilOp = glStencilOp; + qglTexCoord1d = glTexCoord1d; + qglTexCoord1dv = glTexCoord1dv; + qglTexCoord1f = glTexCoord1f; + qglTexCoord1fv = glTexCoord1fv; + qglTexCoord1i = glTexCoord1i; + qglTexCoord1iv = glTexCoord1iv; + qglTexCoord1s = glTexCoord1s; + qglTexCoord1sv = glTexCoord1sv; + qglTexCoord2d = glTexCoord2d; + qglTexCoord2dv = glTexCoord2dv; + qglTexCoord2f = glTexCoord2f; + qglTexCoord2fv = glTexCoord2fv; + qglTexCoord2i = glTexCoord2i; + qglTexCoord2iv = glTexCoord2iv; + qglTexCoord2s = glTexCoord2s; + qglTexCoord2sv = glTexCoord2sv; + qglTexCoord3d = glTexCoord3d; + qglTexCoord3dv = glTexCoord3dv; + qglTexCoord3f = glTexCoord3f; + qglTexCoord3fv = glTexCoord3fv; + qglTexCoord3i = glTexCoord3i; + qglTexCoord3iv = glTexCoord3iv; + qglTexCoord3s = glTexCoord3s; + qglTexCoord3sv = glTexCoord3sv; + qglTexCoord4d = glTexCoord4d; + qglTexCoord4dv = glTexCoord4dv; + qglTexCoord4f = glTexCoord4f; + qglTexCoord4fv = glTexCoord4fv; + qglTexCoord4i = glTexCoord4i; + qglTexCoord4iv = glTexCoord4iv; + qglTexCoord4s = glTexCoord4s; + qglTexCoord4sv = glTexCoord4sv; + qglTexCoordPointer = glTexCoordPointer; + qglTexEnvf = glTexEnvf; + qglTexEnvfv = glTexEnvfv; + qglTexEnvi = glTexEnvi; + qglTexEnviv = glTexEnviv; + qglTexGend = glTexGend; + qglTexGendv = glTexGendv; + qglTexGenf = glTexGenf; + qglTexGenfv = glTexGenfv; + qglTexGeni = glTexGeni; + qglTexGeniv = glTexGeniv; + qglTexImage1D = glTexImage1D; + qglTexImage2D = glTexImage2D; + qglTexParameterf = glTexParameterf; + qglTexParameterfv = glTexParameterfv; + qglTexParameteri = glTexParameteri; + qglTexParameteriv = glTexParameteriv; + qglTexSubImage1D = glTexSubImage1D; + qglTexSubImage2D = glTexSubImage2D; + qglTranslated = glTranslated; + qglTranslatef = glTranslatef; + qglVertex2d = glVertex2d; + qglVertex2dv = glVertex2dv; + qglVertex2f = glVertex2f; + qglVertex2fv = glVertex2fv; + qglVertex2i = glVertex2i; + qglVertex2iv = glVertex2iv; + qglVertex2s = glVertex2s; + qglVertex2sv = glVertex2sv; + qglVertex3d = glVertex3d; + qglVertex3dv = glVertex3dv; + qglVertex3f = glVertex3f; + qglVertex3fv = glVertex3fv; + qglVertex3i = glVertex3i; + qglVertex3iv = glVertex3iv; + qglVertex3s = glVertex3s; + qglVertex3sv = glVertex3sv; + qglVertex4d = glVertex4d; + qglVertex4dv = glVertex4dv; + qglVertex4f = glVertex4f; + qglVertex4fv = glVertex4fv; + qglVertex4i = glVertex4i; + qglVertex4iv = glVertex4iv; + qglVertex4s = glVertex4s; + qglVertex4sv = glVertex4sv; + qglVertexPointer = glVertexPointer; + qglViewport = glViewport; + + // must be init with an active context + qglActiveTextureARB = NULL; + qglClientActiveTextureARB = NULL; + qglMultiTexCoord1dARB = NULL; + qglMultiTexCoord1dvARB = NULL; + qglMultiTexCoord1fARB = NULL; + qglMultiTexCoord1fvARB = NULL; + qglMultiTexCoord1iARB = NULL; + qglMultiTexCoord1ivARB = NULL; + qglMultiTexCoord1sARB = NULL; + qglMultiTexCoord1svARB = NULL; + qglMultiTexCoord2dARB = NULL; + qglMultiTexCoord2dvARB = NULL; + qglMultiTexCoord2fARB = NULL; + qglMultiTexCoord2fvARB = NULL; + qglMultiTexCoord2iARB = NULL; + qglMultiTexCoord2ivARB = NULL; + qglMultiTexCoord2sARB = NULL; + qglMultiTexCoord2svARB = NULL; + qglMultiTexCoord3dARB = NULL; + qglMultiTexCoord3dvARB = NULL; + qglMultiTexCoord3fARB = NULL; + qglMultiTexCoord3fvARB = NULL; + qglMultiTexCoord3iARB = NULL; + qglMultiTexCoord3ivARB = NULL; + qglMultiTexCoord3sARB = NULL; + qglMultiTexCoord3svARB = NULL; + qglMultiTexCoord4dARB = NULL; + qglMultiTexCoord4dvARB = NULL; + qglMultiTexCoord4fARB = NULL; + qglMultiTexCoord4fvARB = NULL; + qglMultiTexCoord4iARB = NULL; + qglMultiTexCoord4ivARB = NULL; + qglMultiTexCoord4sARB = NULL; + qglMultiTexCoord4svARB = NULL; + +#ifdef _WIN32 + qwglCopyContext = safe_dlsym(g_hGLDLL, "wglCopyContext" ); + qwglCreateContext = safe_dlsym(g_hGLDLL, "wglCreateContext"); + qwglCreateLayerContext = safe_dlsym(g_hGLDLL, "wglCreateLayerContext" ); + qwglDeleteContext = safe_dlsym(g_hGLDLL, "wglDeleteContext"); + qwglDescribeLayerPlane = safe_dlsym(g_hGLDLL, "wglDescribeLayerPlane" ); + qwglGetCurrentContext = safe_dlsym(g_hGLDLL, "wglGetCurrentContext" ); + qwglGetCurrentDC = safe_dlsym(g_hGLDLL, "wglGetCurrentDC" ); + qwglGetLayerPaletteEntries = safe_dlsym(g_hGLDLL, "wglGetLayerPaletteEntries" ); + qwglGetProcAddress = safe_dlsym(g_hGLDLL, "wglGetProcAddress" ); + qwglMakeCurrent = safe_dlsym(g_hGLDLL, "wglMakeCurrent" ); + qwglRealizeLayerPalette = safe_dlsym(g_hGLDLL, "wglRealizeLayerPalette" ); + qwglSetLayerPaletteEntries = safe_dlsym(g_hGLDLL, "wglSetLayerPaletteEntries" ); + qwglShareLists = safe_dlsym(g_hGLDLL, "wglShareLists" ); + qwglSwapLayerBuffers = safe_dlsym(g_hGLDLL, "wglSwapLayerBuffers" ); + qwglUseFontBitmaps = safe_dlsym(g_hGLDLL, "wglUseFontBitmapsA" ); + qwglUseFontOutlines = safe_dlsym(g_hGLDLL, "wglUseFontOutlinesA" ); + + qwglChoosePixelFormat = safe_dlsym(g_hGLDLL, "wglChoosePixelFormat" ); + qwglDescribePixelFormat = safe_dlsym(g_hGLDLL, "wglDescribePixelFormat" ); + qwglGetPixelFormat = safe_dlsym(g_hGLDLL, "wglGetPixelFormat" ); + qwglSetPixelFormat = safe_dlsym(g_hGLDLL, "wglSetPixelFormat" ); + qwglSwapBuffers = safe_dlsym(g_hGLDLL, "wglSwapBuffers" ); + + qwglSwapIntervalEXT = 0; + qglPointParameterfEXT = 0; + qglPointParameterfvEXT = 0; + qglColorTableEXT = 0; + qglSelectTextureSGIS = 0; + qglMTexCoord2fSGIS = 0; +#endif + +#if defined (__linux__) || defined (__APPLE__) + qglXChooseVisual = glXChooseVisual; + qglXCreateContext = glXCreateContext; + qglXDestroyContext = glXDestroyContext; + qglXMakeCurrent = glXMakeCurrent; + qglXCopyContext = glXCopyContext; + qglXSwapBuffers = glXSwapBuffers; + qglXCreateGLXPixmap = glXCreateGLXPixmap; + qglXDestroyGLXPixmap = glXDestroyGLXPixmap; + qglXQueryExtension = glXQueryExtension; + qglXQueryVersion = glXQueryVersion; + qglXIsDirect = glXIsDirect; + qglXGetConfig = glXGetConfig; + qglXGetCurrentContext = glXGetCurrentContext; + qglXGetCurrentDrawable = glXGetCurrentDrawable; + qglXWaitGL = glXWaitGL; + qglXWaitX = glXWaitX; + qglXUseXFont = glXUseXFont; + qglXGetProcAddressARB = glXGetProcAddressARB; // Utah-GLX fix +#endif + + qglPointParameterfEXT = 0; + qglPointParameterfvEXT = 0; + qglColorTableEXT = 0; + qglSelectTextureSGIS = 0; + qglMTexCoord2fSGIS = 0; + + Sys_Printf("Done.\n"); + + if (init_error == 1) + return 0; + + return 1; +} + +static int GL_ExtensionSupported (const char *extension) +{ + const GLubyte *extensions = NULL; + const GLubyte *start; + GLubyte *where, *terminator; + + // Extension names should not have spaces. + where = (GLubyte *) strchr (extension, ' '); + if (where || *extension == '\0') + return 0; + + extensions = qglGetString (GL_EXTENSIONS); + + // It takes a bit of care to be fool-proof about parsing the + // OpenGL extensions string. Don't be fooled by sub-strings, etc. + for (start = extensions; ;) + { + where = (GLubyte *) strstr ((const char *) start, extension); + if (!where) + break; + + terminator = where + strlen (extension); + if (where == start || *(where - 1) == ' ') + if (*terminator == ' ' || *terminator == '\0') + return 1; + + start = terminator; + } + + return 0; +} + +void* Sys_GLGetExtension (const char *symbol) +{ +#if defined (__linux__) || defined (__APPLE__) + if (qglXGetProcAddressARB == NULL) + return NULL; + else + return qglXGetProcAddressARB ((GLubyte*)symbol); +#else + return qwglGetProcAddress (symbol); +#endif +} + +void QGL_InitExtensions () +{ + if (GL_ExtensionSupported ("GL_ARB_multitexture")) + { + qglActiveTextureARB = Sys_GLGetExtension ("glActiveTextureARB"); + qglClientActiveTextureARB = Sys_GLGetExtension ("glClientActiveTextureARB"); + qglMultiTexCoord1dARB = Sys_GLGetExtension ("glMultiTexCoord1dARB"); + qglMultiTexCoord1dvARB = Sys_GLGetExtension ("glMultiTexCoord1dvARB"); + qglMultiTexCoord1fARB = Sys_GLGetExtension ("glMultiTexCoord1fARB"); + qglMultiTexCoord1fvARB = Sys_GLGetExtension ("glMultiTexCoord1fvARB"); + qglMultiTexCoord1iARB = Sys_GLGetExtension ("glMultiTexCoord1iARB"); + qglMultiTexCoord1ivARB = Sys_GLGetExtension ("glMultiTexCoord1ivARB"); + qglMultiTexCoord1sARB = Sys_GLGetExtension ("glMultiTexCoord1sARB"); + qglMultiTexCoord1svARB = Sys_GLGetExtension ("glMultiTexCoord1svARB"); + qglMultiTexCoord2dARB = Sys_GLGetExtension ("glMultiTexCoord2dARB"); + qglMultiTexCoord2dvARB = Sys_GLGetExtension ("glMultiTexCoord2dvARB"); + qglMultiTexCoord2fARB = Sys_GLGetExtension ("glMultiTexCoord2fARB"); + qglMultiTexCoord2fvARB = Sys_GLGetExtension ("glMultiTexCoord2fvARB"); + qglMultiTexCoord2iARB = Sys_GLGetExtension ("glMultiTexCoord2iARB"); + qglMultiTexCoord2ivARB = Sys_GLGetExtension ("glMultiTexCoord2ivARB"); + qglMultiTexCoord2sARB = Sys_GLGetExtension ("glMultiTexCoord2sARB"); + qglMultiTexCoord2svARB = Sys_GLGetExtension ("glMultiTexCoord2svARB"); + qglMultiTexCoord3dARB = Sys_GLGetExtension ("glMultiTexCoord3dARB"); + qglMultiTexCoord3dvARB = Sys_GLGetExtension ("glMultiTexCoord3dvARB"); + qglMultiTexCoord3fARB = Sys_GLGetExtension ("glMultiTexCoord3fARB"); + qglMultiTexCoord3fvARB = Sys_GLGetExtension ("glMultiTexCoord3fvARB"); + qglMultiTexCoord3iARB = Sys_GLGetExtension ("glMultiTexCoord3iARB"); + qglMultiTexCoord3ivARB = Sys_GLGetExtension ("glMultiTexCoord3ivARB"); + qglMultiTexCoord3sARB = Sys_GLGetExtension ("glMultiTexCoord3sARB"); + qglMultiTexCoord3svARB = Sys_GLGetExtension ("glMultiTexCoord3svARB"); + qglMultiTexCoord4dARB = Sys_GLGetExtension ("glMultiTexCoord4dARB"); + qglMultiTexCoord4dvARB = Sys_GLGetExtension ("glMultiTexCoord4dvARB"); + qglMultiTexCoord4fARB = Sys_GLGetExtension ("glMultiTexCoord4fARB"); + qglMultiTexCoord4fvARB = Sys_GLGetExtension ("glMultiTexCoord4fvARB"); + qglMultiTexCoord4iARB = Sys_GLGetExtension ("glMultiTexCoord4iARB"); + qglMultiTexCoord4ivARB = Sys_GLGetExtension ("glMultiTexCoord4ivARB"); + qglMultiTexCoord4sARB = Sys_GLGetExtension ("glMultiTexCoord4sARB"); + qglMultiTexCoord4svARB = Sys_GLGetExtension ("glMultiTexCoord4svARB"); + } +} diff --git a/radiant/qgl.c b/radiant/qgl.c new file mode 100644 index 00000000..d7fd7ce9 --- /dev/null +++ b/radiant/qgl.c @@ -0,0 +1,1797 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* +** QGL_WIN.C +** +** This file implements the operating system binding of GL to QGL function +** pointers. When doing a port of Quake2 you must implement the following +** two functions: +** +** QGL_Init() - loads libraries, assigns function pointers, etc. +** QGL_Shutdown() - unloads libraries, NULLs function pointers +*/ + +/* + * This causes glDisable(), glEnable(), glCullFace() and glPolygonMode() to + * be wrapped in order to get around a bug in ATI's FireGL drivers. + */ +#include +#include +#include +#if defined (__linux__) || defined (__APPLE__) +#include +#endif + +#ifdef _WIN32 +#include +#endif + +#include "qgl.h" +void Sys_Printf(const char *format, ...); + +#ifdef _WIN32 +HMODULE g_hGLDLL = NULL; + +#pragma warning (disable : 4113 4133 4047 4018 ) + +int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *); +int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +int ( WINAPI * qwglGetPixelFormat)(HDC); +BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); +BOOL ( WINAPI * qwglSwapBuffers)(HDC); + +BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); +HGLRC ( WINAPI * qwglCreateContext)(HDC); +HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int); +BOOL ( WINAPI * qwglDeleteContext)(HGLRC); +HGLRC ( WINAPI * qwglGetCurrentContext)(VOID); +HDC ( WINAPI * qwglGetCurrentDC)(VOID); +PROC ( WINAPI * qwglGetProcAddress)(LPCSTR); +BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC); +BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC); +BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD); + +BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR); +int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int, CONST COLORREF *); +int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int, COLORREF *); +BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL); +BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT); + +BOOL ( WINAPI * qwglGetDeviceGammaRampEXT)( unsigned char *, unsigned char *, unsigned char * ); +BOOL ( WINAPI * qwglSetDeviceGammaRampEXT)( const unsigned char *, const unsigned char *, + const unsigned char * ); +BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval ); + +#else +#define WINAPI +#endif + +#if defined (__linux__) || defined (__APPLE__) +void* g_hGLDLL; + +XVisualInfo* (*qglXChooseVisual)(Display *dpy, int screen, int *attribList); +GLXContext (*qglXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +void (*qglXDestroyContext)(Display *dpy, GLXContext ctx); +Bool (*qglXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); +void (*qglXCopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); +void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); +GLXPixmap (*qglXCreateGLXPixmap)( Display *dpy, XVisualInfo *visual, Pixmap pixmap ); +void (*qglXDestroyGLXPixmap)( Display *dpy, GLXPixmap pixmap ); +Bool (*qglXQueryExtension)( Display *dpy, int *errorb, int *event ); +Bool (*qglXQueryVersion)( Display *dpy, int *maj, int *min ); +Bool (*qglXIsDirect)( Display *dpy, GLXContext ctx ); +int (*qglXGetConfig)( Display *dpy, XVisualInfo *visual, int attrib, int *value ); +GLXContext (*qglXGetCurrentContext)( void ); +GLXDrawable (*qglXGetCurrentDrawable)( void ); +void (*qglXWaitGL)( void ); +void (*qglXWaitX)( void ); +void (*qglXUseXFont)( Font font, int first, int count, int list ); +void* (*qglXGetProcAddressARB) (const GLubyte *procName); +#endif + +void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); +void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); +GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences); +void ( APIENTRY * qglArrayElement )(GLint i); +void ( APIENTRY * qglBegin )(GLenum mode); +void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture); +void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor); +void ( APIENTRY * qglCallList )(GLuint list); +void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists); +void ( APIENTRY * qglClear )(GLbitfield mask); +void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +void ( APIENTRY * qglClearDepth )(GLclampd depth); +void ( APIENTRY * qglClearIndex )(GLfloat c); +void ( APIENTRY * qglClearStencil )(GLint s); +void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation); +void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue); +void ( APIENTRY * qglColor3bv )(const GLbyte *v); +void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue); +void ( APIENTRY * qglColor3dv )(const GLdouble *v); +void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue); +void ( APIENTRY * qglColor3fv )(const GLfloat *v); +void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue); +void ( APIENTRY * qglColor3iv )(const GLint *v); +void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue); +void ( APIENTRY * qglColor3sv )(const GLshort *v); +void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue); +void ( APIENTRY * qglColor3ubv )(const GLubyte *v); +void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue); +void ( APIENTRY * qglColor3uiv )(const GLuint *v); +void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue); +void ( APIENTRY * qglColor3usv )(const GLushort *v); +void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +void ( APIENTRY * qglColor4bv )(const GLbyte *v); +void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +void ( APIENTRY * qglColor4dv )(const GLdouble *v); +void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +void ( APIENTRY * qglColor4fv )(const GLfloat *v); +void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha); +void ( APIENTRY * qglColor4iv )(const GLint *v); +void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha); +void ( APIENTRY * qglColor4sv )(const GLshort *v); +void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +void ( APIENTRY * qglColor4ubv )(const GLubyte *v); +void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha); +void ( APIENTRY * qglColor4uiv )(const GLuint *v); +void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha); +void ( APIENTRY * qglColor4usv )(const GLushort *v); +void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode); +void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglCullFace )(GLenum mode); +void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range); +void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures); +void ( APIENTRY * qglDepthFunc )(GLenum func); +void ( APIENTRY * qglDepthMask )(GLboolean flag); +void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar); +void ( APIENTRY * qglDisable )(GLenum cap); +void ( APIENTRY * qglDisableClientState )(GLenum array); +void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count); +void ( APIENTRY * qglDrawBuffer )(GLenum mode); +void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglEdgeFlag )(GLboolean flag); +void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag); +void ( APIENTRY * qglEnable )(GLenum cap); +void ( APIENTRY * qglEnableClientState )(GLenum array); +void ( APIENTRY * qglEnd )(void); +void ( APIENTRY * qglEndList )(void); +void ( APIENTRY * qglEvalCoord1d )(GLdouble u); +void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord1f )(GLfloat u); +void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u); +void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v); +void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u); +void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v); +void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u); +void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2); +void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +void ( APIENTRY * qglEvalPoint1 )(GLint i); +void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j); +void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer); +void ( APIENTRY * qglFinish )(void); +void ( APIENTRY * qglFlush )(void); +void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglFogi )(GLenum pname, GLint param); +void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglFrontFace )(GLenum mode); +void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLuint ( APIENTRY * qglGenLists )(GLsizei range); +void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures); +void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params); +void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation); +void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params); +GLenum ( APIENTRY * qglGetError )(void); +void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params); +void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params); +void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v); +void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v); +void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v); +void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params); +void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values); +void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values); +void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values); +void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params); +void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask); +const GLubyte * ( APIENTRY * qglGetString )(GLenum name); +void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params); +void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params); +void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params); +void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params); +void ( APIENTRY * qglHint )(GLenum target, GLenum mode); +void ( APIENTRY * qglIndexMask )(GLuint mask); +void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglIndexd )(GLdouble c); +void ( APIENTRY * qglIndexdv )(const GLdouble *c); +void ( APIENTRY * qglIndexf )(GLfloat c); +void ( APIENTRY * qglIndexfv )(const GLfloat *c); +void ( APIENTRY * qglIndexi )(GLint c); +void ( APIENTRY * qglIndexiv )(const GLint *c); +void ( APIENTRY * qglIndexs )(GLshort c); +void ( APIENTRY * qglIndexsv )(const GLshort *c); +void ( APIENTRY * qglIndexub )(GLubyte c); +void ( APIENTRY * qglIndexubv )(const GLubyte *c); +void ( APIENTRY * qglInitNames )(void); +void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer); +GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap); +GLboolean ( APIENTRY * qglIsList )(GLuint list); +GLboolean ( APIENTRY * qglIsTexture )(GLuint texture); +void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param); +void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params); +void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param); +void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param); +void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params); +void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern); +void ( APIENTRY * qglLineWidth )(GLfloat width); +void ( APIENTRY * qglListBase )(GLuint base); +void ( APIENTRY * qglLoadIdentity )(void); +void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m); +void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m); +void ( APIENTRY * qglLoadName )(GLuint name); +void ( APIENTRY * qglLogicOp )(GLenum opcode); +void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2); +void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2); +void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param); +void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param); +void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params); +void ( APIENTRY * qglMatrixMode )(GLenum mode); +void ( APIENTRY * qglMultMatrixd )(const GLdouble *m); +void ( APIENTRY * qglMultMatrixf )(const GLfloat *m); +void ( APIENTRY * qglNewList )(GLuint list, GLenum mode); +void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz); +void ( APIENTRY * qglNormal3bv )(const GLbyte *v); +void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz); +void ( APIENTRY * qglNormal3dv )(const GLdouble *v); +void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz); +void ( APIENTRY * qglNormal3fv )(const GLfloat *v); +void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz); +void ( APIENTRY * qglNormal3iv )(const GLint *v); +void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz); +void ( APIENTRY * qglNormal3sv )(const GLshort *v); +void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +void ( APIENTRY * qglPassThrough )(GLfloat token); +void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values); +void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values); +void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values); +void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param); +void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param); +void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor); +void ( APIENTRY * qglPointSize )(GLfloat size); +void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode); +void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units); +void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask); +void ( APIENTRY * qglPopAttrib )(void); +void ( APIENTRY * qglPopClientAttrib )(void); +void ( APIENTRY * qglPopMatrix )(void); +void ( APIENTRY * qglPopName )(void); +void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities); +void ( APIENTRY * qglPushAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask); +void ( APIENTRY * qglPushMatrix )(void); +void ( APIENTRY * qglPushName )(GLuint name); +void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y); +void ( APIENTRY * qglRasterPos2iv )(const GLint *v); +void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y); +void ( APIENTRY * qglRasterPos2sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglRasterPos3iv )(const GLint *v); +void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglRasterPos3sv )(const GLshort *v); +void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v); +void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v); +void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglRasterPos4iv )(const GLint *v); +void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglRasterPos4sv )(const GLshort *v); +void ( APIENTRY * qglReadBuffer )(GLenum mode); +void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2); +void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2); +void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2); +void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2); +void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2); +GLint ( APIENTRY * qglRenderMode )(GLenum mode); +void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height); +void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer); +void ( APIENTRY * qglShadeModel )(GLenum mode); +void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask); +void ( APIENTRY * qglStencilMask )(GLuint mask); +void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass); +void ( APIENTRY * qglTexCoord1d )(GLdouble s); +void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord1f )(GLfloat s); +void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord1i )(GLint s); +void ( APIENTRY * qglTexCoord1iv )(const GLint *v); +void ( APIENTRY * qglTexCoord1s )(GLshort s); +void ( APIENTRY * qglTexCoord1sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t); +void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t); +void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t); +void ( APIENTRY * qglTexCoord2iv )(const GLint *v); +void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t); +void ( APIENTRY * qglTexCoord2sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r); +void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r); +void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r); +void ( APIENTRY * qglTexCoord3iv )(const GLint *v); +void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r); +void ( APIENTRY * qglTexCoord3sv )(const GLshort *v); +void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v); +void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v); +void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q); +void ( APIENTRY * qglTexCoord4iv )(const GLint *v); +void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q); +void ( APIENTRY * qglTexCoord4sv )(const GLshort *v); +void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param); +void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params); +void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param); +void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param); +void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params); +void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param); +void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params); +void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y); +void ( APIENTRY * qglVertex2dv )(const GLdouble *v); +void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y); +void ( APIENTRY * qglVertex2fv )(const GLfloat *v); +void ( APIENTRY * qglVertex2i )(GLint x, GLint y); +void ( APIENTRY * qglVertex2iv )(const GLint *v); +void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y); +void ( APIENTRY * qglVertex2sv )(const GLshort *v); +void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z); +void ( APIENTRY * qglVertex3dv )(const GLdouble *v); +void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z); +void ( APIENTRY * qglVertex3fv )(const GLfloat *v); +void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z); +void ( APIENTRY * qglVertex3iv )(const GLint *v); +void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z); +void ( APIENTRY * qglVertex3sv )(const GLshort *v); +void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +void ( APIENTRY * qglVertex4dv )(const GLdouble *v); +void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +void ( APIENTRY * qglVertex4fv )(const GLfloat *v); +void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w); +void ( APIENTRY * qglVertex4iv )(const GLint *v); +void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w); +void ( APIENTRY * qglVertex4sv )(const GLshort *v); +void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height); + +void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value ); +void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); +void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); +void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); +void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); + +void ( APIENTRY * qglActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglClientActiveTextureARB) (GLenum texture); +void ( APIENTRY * qglMultiTexCoord1dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord1dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord1fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord1fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord1iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord1ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord1sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord1svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord2dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord2dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord2fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord2fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord2iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord2ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord2sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord2svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord3dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord3dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord3fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord3fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord3iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord3ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord3sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord3svARB) (GLenum target, const GLshort *v); +void ( APIENTRY * qglMultiTexCoord4dARB) (GLenum target, GLdouble s); +void ( APIENTRY * qglMultiTexCoord4dvARB) (GLenum target, const GLdouble *v); +void ( APIENTRY * qglMultiTexCoord4fARB) (GLenum target, GLfloat s); +void ( APIENTRY * qglMultiTexCoord4fvARB) (GLenum target, const GLfloat *v); +void ( APIENTRY * qglMultiTexCoord4iARB) (GLenum target, GLint s); +void ( APIENTRY * qglMultiTexCoord4ivARB) (GLenum target, const GLint *v); +void ( APIENTRY * qglMultiTexCoord4sARB) (GLenum target, GLshort s); +void ( APIENTRY * qglMultiTexCoord4svARB) (GLenum target, const GLshort *v); + +// glu stuff +void (APIENTRY * qgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); + +// added for plugins +void (APIENTRY * qgluLookAt)( + GLdouble eyex, + GLdouble eyey, + GLdouble eyez, + GLdouble centerx, + GLdouble centery, + GLdouble centerz, + GLdouble upx, + GLdouble upy, + GLdouble upz); +const GLubyte* (APIENTRY * qgluErrorString) (GLenum errCode ); + +#ifdef ATIHACK_812 +void ( APIENTRY * qglCullFace_real )(GLenum mode); +void ( APIENTRY * qglDisable_real )(GLenum cap); +void ( APIENTRY * qglEnable_real )(GLenum cap); +void ( APIENTRY * qglPolygonMode_real )(GLenum face, GLenum mode); +#endif + +/* +** QGL_Shutdown +** +** Unloads the specified DLL then nulls out all the proc pointers. +*/ +void QGL_Shutdown() +{ + Sys_Printf("Shutting down GL ..."); + + if (g_hGLDLL) + { +#ifdef _WIN32 + FreeLibrary(g_hGLDLL); +#endif + +#if defined (__linux__) || defined (__APPLE__) + dlclose (g_hGLDLL); +#endif + + g_hGLDLL = NULL; + } + + Sys_Printf("Done.\n"); + + qglAccum = NULL; + qglAlphaFunc = NULL; + qglAreTexturesResident = NULL; + qglArrayElement = NULL; + qglBegin = NULL; + qglBindTexture = NULL; + qglBitmap = NULL; + qglBlendFunc = NULL; + qglCallList = NULL; + qglCallLists = NULL; + qglClear = NULL; + qglClearAccum = NULL; + qglClearColor = NULL; + qglClearDepth = NULL; + qglClearIndex = NULL; + qglClearStencil = NULL; + qglClipPlane = NULL; + qglColor3b = NULL; + qglColor3bv = NULL; + qglColor3d = NULL; + qglColor3dv = NULL; + qglColor3f = NULL; + qglColor3fv = NULL; + qglColor3i = NULL; + qglColor3iv = NULL; + qglColor3s = NULL; + qglColor3sv = NULL; + qglColor3ub = NULL; + qglColor3ubv = NULL; + qglColor3ui = NULL; + qglColor3uiv = NULL; + qglColor3us = NULL; + qglColor3usv = NULL; + qglColor4b = NULL; + qglColor4bv = NULL; + qglColor4d = NULL; + qglColor4dv = NULL; + qglColor4f = NULL; + qglColor4fv = NULL; + qglColor4i = NULL; + qglColor4iv = NULL; + qglColor4s = NULL; + qglColor4sv = NULL; + qglColor4ub = NULL; + qglColor4ubv = NULL; + qglColor4ui = NULL; + qglColor4uiv = NULL; + qglColor4us = NULL; + qglColor4usv = NULL; + qglColorMask = NULL; + qglColorMaterial = NULL; + qglColorPointer = NULL; + qglCopyPixels = NULL; + qglCopyTexImage1D = NULL; + qglCopyTexImage2D = NULL; + qglCopyTexSubImage1D = NULL; + qglCopyTexSubImage2D = NULL; + qglCullFace = NULL; + qglDeleteLists = NULL; + qglDeleteTextures = NULL; + qglDepthFunc = NULL; + qglDepthMask = NULL; + qglDepthRange = NULL; + qglDisable = NULL; + qglDisableClientState = NULL; + qglDrawArrays = NULL; + qglDrawBuffer = NULL; + qglDrawElements = NULL; + qglDrawPixels = NULL; + qglEdgeFlag = NULL; + qglEdgeFlagPointer = NULL; + qglEdgeFlagv = NULL; + qglEnable = NULL; + qglEnableClientState = NULL; + qglEnd = NULL; + qglEndList = NULL; + qglEvalCoord1d = NULL; + qglEvalCoord1dv = NULL; + qglEvalCoord1f = NULL; + qglEvalCoord1fv = NULL; + qglEvalCoord2d = NULL; + qglEvalCoord2dv = NULL; + qglEvalCoord2f = NULL; + qglEvalCoord2fv = NULL; + qglEvalMesh1 = NULL; + qglEvalMesh2 = NULL; + qglEvalPoint1 = NULL; + qglEvalPoint2 = NULL; + qglFeedbackBuffer = NULL; + qglFinish = NULL; + qglFlush = NULL; + qglFogf = NULL; + qglFogfv = NULL; + qglFogi = NULL; + qglFogiv = NULL; + qglFrontFace = NULL; + qglFrustum = NULL; + qglGenLists = NULL; + qglGenTextures = NULL; + qglGetBooleanv = NULL; + qglGetClipPlane = NULL; + qglGetDoublev = NULL; + qglGetError = NULL; + qglGetFloatv = NULL; + qglGetIntegerv = NULL; + qglGetLightfv = NULL; + qglGetLightiv = NULL; + qglGetMapdv = NULL; + qglGetMapfv = NULL; + qglGetMapiv = NULL; + qglGetMaterialfv = NULL; + qglGetMaterialiv = NULL; + qglGetPixelMapfv = NULL; + qglGetPixelMapuiv = NULL; + qglGetPixelMapusv = NULL; + qglGetPointerv = NULL; + qglGetPolygonStipple = NULL; + qglGetString = NULL; + qglGetTexEnvfv = NULL; + qglGetTexEnviv = NULL; + qglGetTexGendv = NULL; + qglGetTexGenfv = NULL; + qglGetTexGeniv = NULL; + qglGetTexImage = NULL; + qglGetTexLevelParameterfv = NULL; + qglGetTexLevelParameteriv = NULL; + qglGetTexParameterfv = NULL; + qglGetTexParameteriv = NULL; + qglHint = NULL; + qglIndexMask = NULL; + qglIndexPointer = NULL; + qglIndexd = NULL; + qglIndexdv = NULL; + qglIndexf = NULL; + qglIndexfv = NULL; + qglIndexi = NULL; + qglIndexiv = NULL; + qglIndexs = NULL; + qglIndexsv = NULL; + qglIndexub = NULL; + qglIndexubv = NULL; + qglInitNames = NULL; + qglInterleavedArrays = NULL; + qglIsEnabled = NULL; + qglIsList = NULL; + qglIsTexture = NULL; + qglLightModelf = NULL; + qglLightModelfv = NULL; + qglLightModeli = NULL; + qglLightModeliv = NULL; + qglLightf = NULL; + qglLightfv = NULL; + qglLighti = NULL; + qglLightiv = NULL; + qglLineStipple = NULL; + qglLineWidth = NULL; + qglListBase = NULL; + qglLoadIdentity = NULL; + qglLoadMatrixd = NULL; + qglLoadMatrixf = NULL; + qglLoadName = NULL; + qglLogicOp = NULL; + qglMap1d = NULL; + qglMap1f = NULL; + qglMap2d = NULL; + qglMap2f = NULL; + qglMapGrid1d = NULL; + qglMapGrid1f = NULL; + qglMapGrid2d = NULL; + qglMapGrid2f = NULL; + qglMaterialf = NULL; + qglMaterialfv = NULL; + qglMateriali = NULL; + qglMaterialiv = NULL; + qglMatrixMode = NULL; + qglMultMatrixd = NULL; + qglMultMatrixf = NULL; + qglNewList = NULL; + qglNormal3b = NULL; + qglNormal3bv = NULL; + qglNormal3d = NULL; + qglNormal3dv = NULL; + qglNormal3f = NULL; + qglNormal3fv = NULL; + qglNormal3i = NULL; + qglNormal3iv = NULL; + qglNormal3s = NULL; + qglNormal3sv = NULL; + qglNormalPointer = NULL; + qglOrtho = NULL; + qglPassThrough = NULL; + qglPixelMapfv = NULL; + qglPixelMapuiv = NULL; + qglPixelMapusv = NULL; + qglPixelStoref = NULL; + qglPixelStorei = NULL; + qglPixelTransferf = NULL; + qglPixelTransferi = NULL; + qglPixelZoom = NULL; + qglPointSize = NULL; + qglPolygonMode = NULL; + qglPolygonOffset = NULL; + qglPolygonStipple = NULL; + qglPopAttrib = NULL; + qglPopClientAttrib = NULL; + qglPopMatrix = NULL; + qglPopName = NULL; + qglPrioritizeTextures = NULL; + qglPushAttrib = NULL; + qglPushClientAttrib = NULL; + qglPushMatrix = NULL; + qglPushName = NULL; + qglRasterPos2d = NULL; + qglRasterPos2dv = NULL; + qglRasterPos2f = NULL; + qglRasterPos2fv = NULL; + qglRasterPos2i = NULL; + qglRasterPos2iv = NULL; + qglRasterPos2s = NULL; + qglRasterPos2sv = NULL; + qglRasterPos3d = NULL; + qglRasterPos3dv = NULL; + qglRasterPos3f = NULL; + qglRasterPos3fv = NULL; + qglRasterPos3i = NULL; + qglRasterPos3iv = NULL; + qglRasterPos3s = NULL; + qglRasterPos3sv = NULL; + qglRasterPos4d = NULL; + qglRasterPos4dv = NULL; + qglRasterPos4f = NULL; + qglRasterPos4fv = NULL; + qglRasterPos4i = NULL; + qglRasterPos4iv = NULL; + qglRasterPos4s = NULL; + qglRasterPos4sv = NULL; + qglReadBuffer = NULL; + qglReadPixels = NULL; + qglRectd = NULL; + qglRectdv = NULL; + qglRectf = NULL; + qglRectfv = NULL; + qglRecti = NULL; + qglRectiv = NULL; + qglRects = NULL; + qglRectsv = NULL; + qglRenderMode = NULL; + qglRotated = NULL; + qglRotatef = NULL; + qglScaled = NULL; + qglScalef = NULL; + qglScissor = NULL; + qglSelectBuffer = NULL; + qglShadeModel = NULL; + qglStencilFunc = NULL; + qglStencilMask = NULL; + qglStencilOp = NULL; + qglTexCoord1d = NULL; + qglTexCoord1dv = NULL; + qglTexCoord1f = NULL; + qglTexCoord1fv = NULL; + qglTexCoord1i = NULL; + qglTexCoord1iv = NULL; + qglTexCoord1s = NULL; + qglTexCoord1sv = NULL; + qglTexCoord2d = NULL; + qglTexCoord2dv = NULL; + qglTexCoord2f = NULL; + qglTexCoord2fv = NULL; + qglTexCoord2i = NULL; + qglTexCoord2iv = NULL; + qglTexCoord2s = NULL; + qglTexCoord2sv = NULL; + qglTexCoord3d = NULL; + qglTexCoord3dv = NULL; + qglTexCoord3f = NULL; + qglTexCoord3fv = NULL; + qglTexCoord3i = NULL; + qglTexCoord3iv = NULL; + qglTexCoord3s = NULL; + qglTexCoord3sv = NULL; + qglTexCoord4d = NULL; + qglTexCoord4dv = NULL; + qglTexCoord4f = NULL; + qglTexCoord4fv = NULL; + qglTexCoord4i = NULL; + qglTexCoord4iv = NULL; + qglTexCoord4s = NULL; + qglTexCoord4sv = NULL; + qglTexCoordPointer = NULL; + qglTexEnvf = NULL; + qglTexEnvfv = NULL; + qglTexEnvi = NULL; + qglTexEnviv = NULL; + qglTexGend = NULL; + qglTexGendv = NULL; + qglTexGenf = NULL; + qglTexGenfv = NULL; + qglTexGeni = NULL; + qglTexGeniv = NULL; + qglTexImage1D = NULL; + qglTexImage2D = NULL; + qglTexParameterf = NULL; + qglTexParameterfv = NULL; + qglTexParameteri = NULL; + qglTexParameteriv = NULL; + qglTexSubImage1D = NULL; + qglTexSubImage2D = NULL; + qglTranslated = NULL; + qglTranslatef = NULL; + qglVertex2d = NULL; + qglVertex2dv = NULL; + qglVertex2f = NULL; + qglVertex2fv = NULL; + qglVertex2i = NULL; + qglVertex2iv = NULL; + qglVertex2s = NULL; + qglVertex2sv = NULL; + qglVertex3d = NULL; + qglVertex3dv = NULL; + qglVertex3f = NULL; + qglVertex3fv = NULL; + qglVertex3i = NULL; + qglVertex3iv = NULL; + qglVertex3s = NULL; + qglVertex3sv = NULL; + qglVertex4d = NULL; + qglVertex4dv = NULL; + qglVertex4f = NULL; + qglVertex4fv = NULL; + qglVertex4i = NULL; + qglVertex4iv = NULL; + qglVertex4s = NULL; + qglVertex4sv = NULL; + qglVertexPointer = NULL; + qglViewport = NULL; + + qglActiveTextureARB = NULL; + qglClientActiveTextureARB = NULL; + qglMultiTexCoord1dARB = NULL; + qglMultiTexCoord1dvARB = NULL; + qglMultiTexCoord1fARB = NULL; + qglMultiTexCoord1fvARB = NULL; + qglMultiTexCoord1iARB = NULL; + qglMultiTexCoord1ivARB = NULL; + qglMultiTexCoord1sARB = NULL; + qglMultiTexCoord1svARB = NULL; + qglMultiTexCoord2dARB = NULL; + qglMultiTexCoord2dvARB = NULL; + qglMultiTexCoord2fARB = NULL; + qglMultiTexCoord2fvARB = NULL; + qglMultiTexCoord2iARB = NULL; + qglMultiTexCoord2ivARB = NULL; + qglMultiTexCoord2sARB = NULL; + qglMultiTexCoord2svARB = NULL; + qglMultiTexCoord3dARB = NULL; + qglMultiTexCoord3dvARB = NULL; + qglMultiTexCoord3fARB = NULL; + qglMultiTexCoord3fvARB = NULL; + qglMultiTexCoord3iARB = NULL; + qglMultiTexCoord3ivARB = NULL; + qglMultiTexCoord3sARB = NULL; + qglMultiTexCoord3svARB = NULL; + qglMultiTexCoord4dARB = NULL; + qglMultiTexCoord4dvARB = NULL; + qglMultiTexCoord4fARB = NULL; + qglMultiTexCoord4fvARB = NULL; + qglMultiTexCoord4iARB = NULL; + qglMultiTexCoord4ivARB = NULL; + qglMultiTexCoord4sARB = NULL; + qglMultiTexCoord4svARB = NULL; + +#ifdef _WIN32 + qwglCopyContext = NULL; + qwglCreateContext = NULL; + qwglCreateLayerContext = NULL; + qwglDeleteContext = NULL; + qwglDescribeLayerPlane = NULL; + qwglGetCurrentContext = NULL; + qwglGetCurrentDC = NULL; + qwglGetLayerPaletteEntries = NULL; + qwglGetProcAddress = NULL; + qwglMakeCurrent = NULL; + qwglRealizeLayerPalette = NULL; + qwglSetLayerPaletteEntries = NULL; + qwglShareLists = NULL; + qwglSwapLayerBuffers = NULL; + qwglUseFontBitmaps = NULL; + qwglUseFontOutlines = NULL; + + qwglChoosePixelFormat = NULL; + qwglDescribePixelFormat = NULL; + qwglGetPixelFormat = NULL; + qwglSetPixelFormat = NULL; + qwglSwapBuffers = NULL; + + qwglSwapIntervalEXT = NULL; + + qwglGetDeviceGammaRampEXT = NULL; + qwglSetDeviceGammaRampEXT = NULL; +#endif + +#if defined (__linux__) || defined (__APPLE__) + qglXChooseVisual = NULL; + qglXCreateContext = NULL; + qglXDestroyContext = NULL; + qglXMakeCurrent = NULL; + qglXCopyContext = NULL; + qglXSwapBuffers = NULL; + qglXCreateGLXPixmap = NULL; + qglXDestroyGLXPixmap = NULL; + qglXQueryExtension = NULL; + qglXQueryVersion = NULL; + qglXIsDirect = NULL; + qglXGetConfig = NULL; + qglXGetCurrentContext = NULL; + qglXGetCurrentDrawable = NULL; + qglXWaitGL = NULL; + qglXWaitX = NULL; + qglXUseXFont = NULL; + qglXGetProcAddressARB = NULL; +#endif + + qgluPerspective = NULL; + qgluErrorString = NULL; + qgluLookAt = NULL; + +#ifdef ATIHACK_812 + qglCullFace_real = NULL; + qglDisable_real = NULL; + qglEnable_real = NULL; + qglPolygonMode_real = NULL; +#endif +} + +/* +** QGL_Init +** +** This is responsible for binding our qgl function pointers to +** the appropriate GL stuff. In Windows this means doing a +** LoadLibrary and a bunch of calls to GetProcAddress. On other +** operating systems we need to do the right thing, whatever that +** might be. +** +*/ +static int init_error; + +static void* safe_dlsym (void *handle, char *symbol) +{ +#ifdef _WIN32 + return GetProcAddress (handle, symbol); +#endif + +#if defined (__linux__) || defined (__APPLE__) + void* ret = dlsym (handle, symbol); + const char *err = dlerror(); + if (err) + { + init_error = 1; +#ifndef __APPLE__ + printf ("Error loading OpenGL libraries: %s\n", err); +#else + printf ("Error loading OpenGL libraries: %s %s\n", err, symbol); +#endif + } + return ret; +#endif +} + +#include +#include +#ifdef _WIN32 +#define M_PI 3.14159 +#endif + +void WINAPI gluLookAt2 (GLdouble ex, GLdouble ey, GLdouble ez, GLdouble cx, GLdouble cy, GLdouble cz, + GLdouble ux, GLdouble uy, GLdouble uz) +{ + GLdouble x[3], y[3], z[3] = { ex-cx, ey-cy, ez-cz }; + GLdouble inv; + + inv = sqrt (z[0]*z[0] + z[1]*z[1] + z[2]*z[2]); + if (inv) + { + inv = 1.0/inv; + z[0] *= inv; + z[1] *= inv; + z[2] *= inv; + } + + x[0] = uy*z[2] - uz*z[1]; + x[1] = -ux*z[2] + uz*z[0]; + x[2] = ux*z[1] - uy*z[0]; + + y[0] = z[1]*x[2] - z[2]*x[1]; + y[1] = -z[0]*x[2] + z[2]*x[0]; + y[2] = z[0]*x[1] - z[1]*x[0]; + + inv = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]); + if (inv) + { + x[0] *= inv; + x[1] *= inv; + x[2] *= inv; + } + + inv = sqrt(y[0]*y[0] + y[1]*y[1] + y[2]*y[2]); + if (inv) + { + y[0] *= inv; + y[1] *= inv; + y[2] *= inv; + } + + { + GLdouble m[16] = { x[0], y[0], z[0], 0, x[1], y[1], z[1], 0, x[2], y[2], z[2], 0, 0, 0, 0, 1 }; + qglMultMatrixd(m); + qglTranslated(-ex, -ey, -ez); + } +} + +void WINAPI gluPerspective2 (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble y = zNear * tan (fovy * M_PI / 360.0); + qglFrustum (-y*aspect, y*aspect, -y, y, zNear, zFar); +} + +static void* WINAPI ResizeImage (GLubyte* old_image, int srcw, int srch, int destw, int desth) +{ + int i, j; + float sx, sy; + GLubyte* new_image = (GLubyte *)malloc (destw*desth*4*sizeof(GLubyte)); + if (new_image == NULL) + return NULL; + + if (destw > 1) + sx = (GLfloat) (srcw-1) / (GLfloat) (destw-1); + else + sx = (GLfloat) (srcw-1); + if (desth > 1) + sy = (GLfloat) (srch-1) / (GLfloat) (desth-1); + else + sy = (GLfloat) (srch-1); + + for (i = 0; i < desth; i++) + { + GLint ii = (GLint)(i * sy); + for (j = 0; j < destw; j++) + { + GLint jj = (GLint)(j * sx); + GLubyte *src = old_image + (ii * srcw + jj) * 4; + GLubyte *dst = new_image + (i * destw + j) * 4; + + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } + } + + return new_image; +} + +#define CEILING(A, B) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) + +typedef struct glu_error_struct +{ + int errnum; + const char *errstr; +} GLU_ERROR_STRUCT; + +GLU_ERROR_STRUCT glu_errlist[] = { + {GL_NO_ERROR, "GL_NO_ERROR - no error"}, + {GL_INVALID_ENUM, "GL_INVALID_ENUM - An unacceptable value is specified for an enumerated argument."}, + {GL_INVALID_VALUE, "GL_INVALID_VALUE - A numeric argument is out of range."}, + {GL_INVALID_OPERATION, "GL_INVALID_OPERATION - The specified operation is not allowed in the current state."}, + {GL_STACK_OVERFLOW, "GL_STACK_OVERFLOW - Function would cause a stack overflow."}, + {GL_STACK_UNDERFLOW, "GL_STACK_UNDERFLOW - Function would cause a stack underflow."}, + {GL_OUT_OF_MEMORY, "GL_OUT_OF_MEMORY - There is not enough memory left to execute the function."}, + {-1, NULL} +}; + +const GLubyte* WINAPI gluErrorString(GLenum errCode ) +{ + int search = 0; + for (search = 0; glu_errlist[search].errstr; search++) + { + if (errCode == glu_errlist[search].errnum) + return (const char *)glu_errlist[search].errstr; + } //end for + return "Unknown error"; +} + +#ifdef ATIHACK_812 +int ATIhack_culling; +GLenum ATIhack_cullmode; +GLenum ATIhack_backmode; +GLenum ATIhack_frontmode; + +static void ATIhack_update(void) +{ + if(!ATIhack_culling || (GL_FRONT_AND_BACK == ATIhack_cullmode)) + { + qglPolygonMode_real(GL_FRONT, ATIhack_frontmode); + qglPolygonMode_real(GL_BACK, ATIhack_backmode); + } + else + switch(ATIhack_cullmode) + { + case GL_FRONT: + qglPolygonMode_real(GL_FRONT_AND_BACK, ATIhack_backmode); + break; + case GL_BACK: + qglPolygonMode_real(GL_FRONT_AND_BACK, ATIhack_frontmode); + default: + break; + } +} + +void APIENTRY qglEnable_ATIHack(GLenum cap) +{ + qglEnable_real(cap); + if(GL_CULL_FACE != cap) + return; + if(ATIhack_culling) + return; + ATIhack_culling = 1; + ATIhack_update(); +} + +void APIENTRY qglDisable_ATIHack(GLenum cap) +{ + qglDisable_real(cap); + if(GL_CULL_FACE != cap) + return; + if(!ATIhack_culling) + return; + ATIhack_culling = 0; + ATIhack_update(); +} + +void APIENTRY qglCullFace_ATIHack(GLenum mode) +{ + if(ATIhack_cullmode == mode) + return; + qglCullFace_real(mode); + ATIhack_cullmode = mode; + ATIhack_update(); +} + +void APIENTRY qglPolygonMode_ATIHack(GLenum face, GLenum mode) +{ + switch(face) + { + case GL_FRONT: + if(ATIhack_frontmode == mode) + return; + ATIhack_frontmode = mode; + break; + case GL_BACK: + if(ATIhack_backmode == mode) + return; + ATIhack_backmode = mode; + break; + case GL_FRONT_AND_BACK: + if((ATIhack_frontmode == mode) && (ATIhack_backmode == mode)) + return; + ATIhack_frontmode = ATIhack_backmode = mode; + default: + break; + } + ATIhack_update(); +} +#endif + +int QGL_Init(const char *dllname, const char* gluname) +{ +#ifdef _WIN32 + g_hGLDLL = LoadLibrary(dllname); +#endif + +#if defined (__linux__) || (__APPLE__) + const char *err; + + // NOTE TTimo + // I don't like RTLD_LAZY|RTLD_GLOBAL too much .. it's dangerous + // maybe try RTLD_NOW? or would that break compatibility .. you never know when that stuff is going to explode + g_hGLDLL = dlopen(dllname, RTLD_LAZY|RTLD_GLOBAL); + err = dlerror(); + if (err) + printf ("Error loading GL lib:\n%s\n", err); +#endif + init_error = 0; + + if (g_hGLDLL == NULL) + return 0; + + Sys_Printf ("Loading GL library: %s ...", dllname); + + qgluPerspective = &gluPerspective2; + + qgluLookAt = &gluLookAt2; + qgluErrorString = &gluErrorString; + qglAccum = safe_dlsym (g_hGLDLL, "glAccum" ); + qglAlphaFunc = safe_dlsym (g_hGLDLL, "glAlphaFunc" ); + qglAreTexturesResident = safe_dlsym (g_hGLDLL, "glAreTexturesResident" ); + qglArrayElement = safe_dlsym (g_hGLDLL, "glArrayElement" ); + qglBegin = safe_dlsym (g_hGLDLL, "glBegin" ); + qglBindTexture = safe_dlsym (g_hGLDLL, "glBindTexture" ); + qglBitmap = safe_dlsym (g_hGLDLL, "glBitmap" ); + qglBlendFunc = safe_dlsym (g_hGLDLL, "glBlendFunc" ); + qglCallList = safe_dlsym (g_hGLDLL, "glCallList" ); + qglCallLists = safe_dlsym (g_hGLDLL, "glCallLists" ); + qglClear = safe_dlsym (g_hGLDLL, "glClear" ); + qglClearAccum = safe_dlsym (g_hGLDLL, "glClearAccum" ); + qglClearColor = safe_dlsym (g_hGLDLL, "glClearColor" ); + qglClearDepth = safe_dlsym (g_hGLDLL, "glClearDepth" ); + qglClearIndex = safe_dlsym (g_hGLDLL, "glClearIndex" ); + qglClearStencil = safe_dlsym (g_hGLDLL, "glClearStencil" ); + qglClipPlane = safe_dlsym (g_hGLDLL, "glClipPlane" ); + qglColor3b = safe_dlsym (g_hGLDLL, "glColor3b" ); + qglColor3bv = safe_dlsym (g_hGLDLL, "glColor3bv" ); + qglColor3d = safe_dlsym (g_hGLDLL, "glColor3d" ); + qglColor3dv = safe_dlsym (g_hGLDLL, "glColor3dv" ); + qglColor3f = safe_dlsym (g_hGLDLL, "glColor3f" ); + qglColor3fv = safe_dlsym (g_hGLDLL, "glColor3fv" ); + qglColor3i = safe_dlsym (g_hGLDLL, "glColor3i" ); + qglColor3iv = safe_dlsym (g_hGLDLL, "glColor3iv" ); + qglColor3s = safe_dlsym (g_hGLDLL, "glColor3s" ); + qglColor3sv = safe_dlsym (g_hGLDLL, "glColor3sv" ); + qglColor3ub = safe_dlsym (g_hGLDLL, "glColor3ub" ); + qglColor3ubv = safe_dlsym (g_hGLDLL, "glColor3ubv" ); + qglColor3ui = safe_dlsym (g_hGLDLL, "glColor3ui" ); + qglColor3uiv = safe_dlsym (g_hGLDLL, "glColor3uiv" ); + qglColor3us = safe_dlsym (g_hGLDLL, "glColor3us" ); + qglColor3usv = safe_dlsym (g_hGLDLL, "glColor3usv" ); + qglColor4b = safe_dlsym (g_hGLDLL, "glColor4b" ); + qglColor4bv = safe_dlsym (g_hGLDLL, "glColor4bv" ); + qglColor4d = safe_dlsym (g_hGLDLL, "glColor4d" ); + qglColor4dv = safe_dlsym (g_hGLDLL, "glColor4dv" ); + qglColor4f = safe_dlsym (g_hGLDLL, "glColor4f" ); + qglColor4fv = safe_dlsym (g_hGLDLL, "glColor4fv" ); + qglColor4i = safe_dlsym (g_hGLDLL, "glColor4i" ); + qglColor4iv = safe_dlsym (g_hGLDLL, "glColor4iv" ); + qglColor4s = safe_dlsym (g_hGLDLL, "glColor4s" ); + qglColor4sv = safe_dlsym (g_hGLDLL, "glColor4sv" ); + qglColor4ub = safe_dlsym (g_hGLDLL, "glColor4ub" ); + qglColor4ubv = safe_dlsym (g_hGLDLL, "glColor4ubv" ); + qglColor4ui = safe_dlsym (g_hGLDLL, "glColor4ui" ); + qglColor4uiv = safe_dlsym (g_hGLDLL, "glColor4uiv" ); + qglColor4us = safe_dlsym (g_hGLDLL, "glColor4us" ); + qglColor4usv = safe_dlsym (g_hGLDLL, "glColor4usv" ); + qglColorMask = safe_dlsym (g_hGLDLL, "glColorMask" ); + qglColorMaterial = safe_dlsym (g_hGLDLL, "glColorMaterial" ); + qglColorPointer = safe_dlsym (g_hGLDLL, "glColorPointer" ); + qglCopyPixels = safe_dlsym (g_hGLDLL, "glCopyPixels" ); + qglCopyTexImage1D = safe_dlsym (g_hGLDLL, "glCopyTexImage1D" ); + qglCopyTexImage2D = safe_dlsym (g_hGLDLL, "glCopyTexImage2D" ); + qglCopyTexSubImage1D = safe_dlsym (g_hGLDLL, "glCopyTexSubImage1D" ); + qglCopyTexSubImage2D = safe_dlsym (g_hGLDLL, "glCopyTexSubImage2D" ); +#ifdef ATIHACK_812 + qglCullFace_real = safe_dlsym (g_hGLDLL, "glCullFace" ); + qglCullFace = qglCullFace_real; +#else + qglCullFace = safe_dlsym (g_hGLDLL, "glCullFace" ); +#endif + qglDeleteLists = safe_dlsym (g_hGLDLL, "glDeleteLists" ); + qglDeleteTextures = safe_dlsym (g_hGLDLL, "glDeleteTextures" ); + qglDepthFunc = safe_dlsym (g_hGLDLL, "glDepthFunc" ); + qglDepthMask = safe_dlsym (g_hGLDLL, "glDepthMask" ); + qglDepthRange = safe_dlsym (g_hGLDLL, "glDepthRange" ); +#ifdef ATIHACK_812 + qglDisable_real = safe_dlsym (g_hGLDLL, "glDisable" ); + qglDisable = qglDisable_real; +#else + qglDisable = safe_dlsym (g_hGLDLL, "glDisable" ); +#endif + qglDisableClientState = safe_dlsym (g_hGLDLL, "glDisableClientState" ); + qglDrawArrays = safe_dlsym (g_hGLDLL, "glDrawArrays" ); + qglDrawBuffer = safe_dlsym (g_hGLDLL, "glDrawBuffer" ); + qglDrawElements = safe_dlsym (g_hGLDLL, "glDrawElements" ); + qglDrawPixels = safe_dlsym (g_hGLDLL, "glDrawPixels" ); + qglEdgeFlag = safe_dlsym (g_hGLDLL, "glEdgeFlag" ); + qglEdgeFlagPointer = safe_dlsym (g_hGLDLL, "glEdgeFlagPointer" ); + qglEdgeFlagv = safe_dlsym (g_hGLDLL, "glEdgeFlagv" ); +#ifdef ATIHACK_812 + qglEnable_real = safe_dlsym (g_hGLDLL, "glEnable" ); + qglEnable = qglEnable_real; +#else + qglEnable = safe_dlsym (g_hGLDLL, "glEnable" ); +#endif + qglEnableClientState = safe_dlsym (g_hGLDLL, "glEnableClientState" ); + qglEnd = safe_dlsym (g_hGLDLL, "glEnd" ); + qglEndList = safe_dlsym (g_hGLDLL, "glEndList" ); + qglEvalCoord1d = safe_dlsym (g_hGLDLL, "glEvalCoord1d" ); + qglEvalCoord1dv = safe_dlsym (g_hGLDLL, "glEvalCoord1dv" ); + qglEvalCoord1f = safe_dlsym (g_hGLDLL, "glEvalCoord1f" ); + qglEvalCoord1fv = safe_dlsym (g_hGLDLL, "glEvalCoord1fv" ); + qglEvalCoord2d = safe_dlsym (g_hGLDLL, "glEvalCoord2d" ); + qglEvalCoord2dv = safe_dlsym (g_hGLDLL, "glEvalCoord2dv" ); + qglEvalCoord2f = safe_dlsym (g_hGLDLL, "glEvalCoord2f" ); + qglEvalCoord2fv = safe_dlsym (g_hGLDLL, "glEvalCoord2fv" ); + qglEvalMesh1 = safe_dlsym (g_hGLDLL, "glEvalMesh1" ); + qglEvalMesh2 = safe_dlsym (g_hGLDLL, "glEvalMesh2" ); + qglEvalPoint1 = safe_dlsym (g_hGLDLL, "glEvalPoint1" ); + qglEvalPoint2 = safe_dlsym (g_hGLDLL, "glEvalPoint2" ); + qglFeedbackBuffer = safe_dlsym (g_hGLDLL, "glFeedbackBuffer" ); + qglFinish = safe_dlsym (g_hGLDLL, "glFinish" ); + qglFlush = safe_dlsym (g_hGLDLL, "glFlush" ); + qglFogf = safe_dlsym (g_hGLDLL, "glFogf" ); + qglFogfv = safe_dlsym (g_hGLDLL, "glFogfv" ); + qglFogi = safe_dlsym (g_hGLDLL, "glFogi" ); + qglFogiv = safe_dlsym (g_hGLDLL, "glFogiv" ); + qglFrontFace = safe_dlsym (g_hGLDLL, "glFrontFace" ); + qglFrustum = safe_dlsym (g_hGLDLL, "glFrustum" ); + qglGenLists = safe_dlsym (g_hGLDLL, "glGenLists" ); + qglGenTextures = safe_dlsym (g_hGLDLL, "glGenTextures" ); + qglGetBooleanv = safe_dlsym (g_hGLDLL, "glGetBooleanv" ); + qglGetClipPlane = safe_dlsym (g_hGLDLL, "glGetClipPlane" ); + qglGetDoublev = safe_dlsym (g_hGLDLL, "glGetDoublev" ); + qglGetError = safe_dlsym (g_hGLDLL, "glGetError" ); + qglGetFloatv = safe_dlsym (g_hGLDLL, "glGetFloatv" ); + qglGetIntegerv = safe_dlsym (g_hGLDLL, "glGetIntegerv" ); + qglGetLightfv = safe_dlsym (g_hGLDLL, "glGetLightfv" ); + qglGetLightiv = safe_dlsym (g_hGLDLL, "glGetLightiv" ); + qglGetMapdv = safe_dlsym (g_hGLDLL, "glGetMapdv" ); + qglGetMapfv = safe_dlsym (g_hGLDLL, "glGetMapfv" ); + qglGetMapiv = safe_dlsym (g_hGLDLL, "glGetMapiv" ); + qglGetMaterialfv = safe_dlsym (g_hGLDLL, "glGetMaterialfv" ); + qglGetMaterialiv = safe_dlsym (g_hGLDLL, "glGetMaterialiv" ); + qglGetPixelMapfv = safe_dlsym (g_hGLDLL, "glGetPixelMapfv" ); + qglGetPixelMapuiv = safe_dlsym (g_hGLDLL, "glGetPixelMapuiv" ); + qglGetPixelMapusv = safe_dlsym (g_hGLDLL, "glGetPixelMapusv" ); + qglGetPointerv = safe_dlsym (g_hGLDLL, "glGetPointerv" ); + qglGetPolygonStipple = safe_dlsym (g_hGLDLL, "glGetPolygonStipple" ); + qglGetString = safe_dlsym (g_hGLDLL, "glGetString" ); + qglGetTexEnvfv = safe_dlsym (g_hGLDLL, "glGetTexEnvfv" ); + qglGetTexEnviv = safe_dlsym (g_hGLDLL, "glGetTexEnviv" ); + qglGetTexGendv = safe_dlsym (g_hGLDLL, "glGetTexGendv" ); + qglGetTexGenfv = safe_dlsym (g_hGLDLL, "glGetTexGenfv" ); + qglGetTexGeniv = safe_dlsym (g_hGLDLL, "glGetTexGeniv" ); + qglGetTexImage = safe_dlsym (g_hGLDLL, "glGetTexImage" ); + qglGetTexLevelParameterfv = safe_dlsym (g_hGLDLL, "glGetTexLevelParameterfv" ); + qglGetTexLevelParameteriv = safe_dlsym (g_hGLDLL, "glGetTexLevelParameteriv" ); + qglGetTexParameterfv = safe_dlsym (g_hGLDLL, "glGetTexParameterfv" ); + qglGetTexParameteriv = safe_dlsym (g_hGLDLL, "glGetTexParameteriv" ); + qglHint = safe_dlsym (g_hGLDLL, "glHint" ); + qglIndexMask = safe_dlsym (g_hGLDLL, "glIndexMask" ); + qglIndexPointer = safe_dlsym (g_hGLDLL, "glIndexPointer" ); + qglIndexd = safe_dlsym (g_hGLDLL, "glIndexd" ); + qglIndexdv = safe_dlsym (g_hGLDLL, "glIndexdv" ); + qglIndexf = safe_dlsym (g_hGLDLL, "glIndexf" ); + qglIndexfv = safe_dlsym (g_hGLDLL, "glIndexfv" ); + qglIndexi = safe_dlsym (g_hGLDLL, "glIndexi" ); + qglIndexiv = safe_dlsym (g_hGLDLL, "glIndexiv" ); + qglIndexs = safe_dlsym (g_hGLDLL, "glIndexs" ); + qglIndexsv = safe_dlsym (g_hGLDLL, "glIndexsv" ); + qglIndexub = safe_dlsym (g_hGLDLL, "glIndexub" ); + qglIndexubv = safe_dlsym (g_hGLDLL, "glIndexubv" ); + qglInitNames = safe_dlsym (g_hGLDLL, "glInitNames" ); + qglInterleavedArrays = safe_dlsym (g_hGLDLL, "glInterleavedArrays" ); + qglIsEnabled = safe_dlsym (g_hGLDLL, "glIsEnabled" ); + qglIsList = safe_dlsym (g_hGLDLL, "glIsList" ); + qglIsTexture = safe_dlsym (g_hGLDLL, "glIsTexture" ); + qglLightModelf = safe_dlsym (g_hGLDLL, "glLightModelf" ); + qglLightModelfv = safe_dlsym (g_hGLDLL, "glLightModelfv" ); + qglLightModeli = safe_dlsym (g_hGLDLL, "glLightModeli" ); + qglLightModeliv = safe_dlsym (g_hGLDLL, "glLightModeliv" ); + qglLightf = safe_dlsym (g_hGLDLL, "glLightf" ); + qglLightfv = safe_dlsym (g_hGLDLL, "glLightfv" ); + qglLighti = safe_dlsym (g_hGLDLL, "glLighti" ); + qglLightiv = safe_dlsym (g_hGLDLL, "glLightiv" ); + qglLineStipple = safe_dlsym (g_hGLDLL, "glLineStipple" ); + qglLineWidth = safe_dlsym (g_hGLDLL, "glLineWidth" ); + qglListBase = safe_dlsym (g_hGLDLL, "glListBase" ); + qglLoadIdentity = safe_dlsym (g_hGLDLL, "glLoadIdentity" ); + qglLoadMatrixd = safe_dlsym (g_hGLDLL, "glLoadMatrixd" ); + qglLoadMatrixf = safe_dlsym (g_hGLDLL, "glLoadMatrixf" ); + qglLoadName = safe_dlsym (g_hGLDLL, "glLoadName" ); + qglLogicOp = safe_dlsym (g_hGLDLL, "glLogicOp" ); + qglMap1d = safe_dlsym (g_hGLDLL, "glMap1d" ); + qglMap1f = safe_dlsym (g_hGLDLL, "glMap1f" ); + qglMap2d = safe_dlsym (g_hGLDLL, "glMap2d" ); + qglMap2f = safe_dlsym (g_hGLDLL, "glMap2f" ); + qglMapGrid1d = safe_dlsym (g_hGLDLL, "glMapGrid1d" ); + qglMapGrid1f = safe_dlsym (g_hGLDLL, "glMapGrid1f" ); + qglMapGrid2d = safe_dlsym (g_hGLDLL, "glMapGrid2d" ); + qglMapGrid2f = safe_dlsym (g_hGLDLL, "glMapGrid2f" ); + qglMaterialf = safe_dlsym (g_hGLDLL, "glMaterialf" ); + qglMaterialfv = safe_dlsym (g_hGLDLL, "glMaterialfv" ); + qglMateriali = safe_dlsym (g_hGLDLL, "glMateriali" ); + qglMaterialiv = safe_dlsym (g_hGLDLL, "glMaterialiv" ); + qglMatrixMode = safe_dlsym (g_hGLDLL, "glMatrixMode" ); + qglMultMatrixd = safe_dlsym (g_hGLDLL, "glMultMatrixd" ); + qglMultMatrixf = safe_dlsym (g_hGLDLL, "glMultMatrixf" ); + qglNewList = safe_dlsym (g_hGLDLL, "glNewList" ); + qglNormal3b = safe_dlsym (g_hGLDLL, "glNormal3b" ); + qglNormal3bv = safe_dlsym (g_hGLDLL, "glNormal3bv" ); + qglNormal3d = safe_dlsym (g_hGLDLL, "glNormal3d" ); + qglNormal3dv = safe_dlsym (g_hGLDLL, "glNormal3dv" ); + qglNormal3f = safe_dlsym (g_hGLDLL, "glNormal3f" ); + qglNormal3fv = safe_dlsym (g_hGLDLL, "glNormal3fv" ); + qglNormal3i = safe_dlsym (g_hGLDLL, "glNormal3i" ); + qglNormal3iv = safe_dlsym (g_hGLDLL, "glNormal3iv" ); + qglNormal3s = safe_dlsym (g_hGLDLL, "glNormal3s" ); + qglNormal3sv = safe_dlsym (g_hGLDLL, "glNormal3sv" ); + qglNormalPointer = safe_dlsym (g_hGLDLL, "glNormalPointer" ); + qglOrtho = safe_dlsym (g_hGLDLL, "glOrtho" ); + qglPassThrough = safe_dlsym (g_hGLDLL, "glPassThrough" ); + qglPixelMapfv = safe_dlsym (g_hGLDLL, "glPixelMapfv" ); + qglPixelMapuiv = safe_dlsym (g_hGLDLL, "glPixelMapuiv" ); + qglPixelMapusv = safe_dlsym (g_hGLDLL, "glPixelMapusv" ); + qglPixelStoref = safe_dlsym (g_hGLDLL, "glPixelStoref" ); + qglPixelStorei = safe_dlsym (g_hGLDLL, "glPixelStorei" ); + qglPixelTransferf = safe_dlsym (g_hGLDLL, "glPixelTransferf" ); + qglPixelTransferi = safe_dlsym (g_hGLDLL, "glPixelTransferi" ); + qglPixelZoom = safe_dlsym (g_hGLDLL, "glPixelZoom" ); + qglPointSize = safe_dlsym (g_hGLDLL, "glPointSize" ); +#ifdef ATIHACK_812 + qglPolygonMode_real = safe_dlsym (g_hGLDLL, "glPolygonMode" ); + qglPolygonMode = qglPolygonMode_real; +#else + qglPolygonMode = safe_dlsym (g_hGLDLL, "glPolygonMode" ); +#endif + qglPolygonOffset = safe_dlsym (g_hGLDLL, "glPolygonOffset" ); + qglPolygonStipple = safe_dlsym (g_hGLDLL, "glPolygonStipple" ); + qglPopAttrib = safe_dlsym (g_hGLDLL, "glPopAttrib" ); + qglPopClientAttrib = safe_dlsym (g_hGLDLL, "glPopClientAttrib" ); + qglPopMatrix = safe_dlsym (g_hGLDLL, "glPopMatrix" ); + qglPopName = safe_dlsym (g_hGLDLL, "glPopName" ); + qglPrioritizeTextures = safe_dlsym (g_hGLDLL, "glPrioritizeTextures" ); + qglPushAttrib = safe_dlsym (g_hGLDLL, "glPushAttrib" ); + qglPushClientAttrib = safe_dlsym (g_hGLDLL, "glPushClientAttrib" ); + qglPushMatrix = safe_dlsym (g_hGLDLL, "glPushMatrix" ); + qglPushName = safe_dlsym (g_hGLDLL, "glPushName" ); + qglRasterPos2d = safe_dlsym (g_hGLDLL, "glRasterPos2d" ); + qglRasterPos2dv = safe_dlsym (g_hGLDLL, "glRasterPos2dv" ); + qglRasterPos2f = safe_dlsym (g_hGLDLL, "glRasterPos2f" ); + qglRasterPos2fv = safe_dlsym (g_hGLDLL, "glRasterPos2fv" ); + qglRasterPos2i = safe_dlsym (g_hGLDLL, "glRasterPos2i" ); + qglRasterPos2iv = safe_dlsym (g_hGLDLL, "glRasterPos2iv" ); + qglRasterPos2s = safe_dlsym (g_hGLDLL, "glRasterPos2s" ); + qglRasterPos2sv = safe_dlsym (g_hGLDLL, "glRasterPos2sv" ); + qglRasterPos3d = safe_dlsym (g_hGLDLL, "glRasterPos3d" ); + qglRasterPos3dv = safe_dlsym (g_hGLDLL, "glRasterPos3dv" ); + qglRasterPos3f = safe_dlsym (g_hGLDLL, "glRasterPos3f" ); + qglRasterPos3fv = safe_dlsym (g_hGLDLL, "glRasterPos3fv" ); + qglRasterPos3i = safe_dlsym (g_hGLDLL, "glRasterPos3i" ); + qglRasterPos3iv = safe_dlsym (g_hGLDLL, "glRasterPos3iv" ); + qglRasterPos3s = safe_dlsym (g_hGLDLL, "glRasterPos3s" ); + qglRasterPos3sv = safe_dlsym (g_hGLDLL, "glRasterPos3sv" ); + qglRasterPos4d = safe_dlsym (g_hGLDLL, "glRasterPos4d" ); + qglRasterPos4dv = safe_dlsym (g_hGLDLL, "glRasterPos4dv" ); + qglRasterPos4f = safe_dlsym (g_hGLDLL, "glRasterPos4f" ); + qglRasterPos4fv = safe_dlsym (g_hGLDLL, "glRasterPos4fv" ); + qglRasterPos4i = safe_dlsym (g_hGLDLL, "glRasterPos4i" ); + qglRasterPos4iv = safe_dlsym (g_hGLDLL, "glRasterPos4iv" ); + qglRasterPos4s = safe_dlsym (g_hGLDLL, "glRasterPos4s" ); + qglRasterPos4sv = safe_dlsym (g_hGLDLL, "glRasterPos4sv" ); + qglReadBuffer = safe_dlsym (g_hGLDLL, "glReadBuffer" ); + qglReadPixels = safe_dlsym (g_hGLDLL, "glReadPixels" ); + qglRectd = safe_dlsym (g_hGLDLL, "glRectd" ); + qglRectdv = safe_dlsym (g_hGLDLL, "glRectdv" ); + qglRectf = safe_dlsym (g_hGLDLL, "glRectf" ); + qglRectfv = safe_dlsym (g_hGLDLL, "glRectfv" ); + qglRecti = safe_dlsym (g_hGLDLL, "glRecti" ); + qglRectiv = safe_dlsym (g_hGLDLL, "glRectiv" ); + qglRects = safe_dlsym (g_hGLDLL, "glRects" ); + qglRectsv = safe_dlsym (g_hGLDLL, "glRectsv" ); + qglRenderMode = safe_dlsym (g_hGLDLL, "glRenderMode" ); + qglRotated = safe_dlsym (g_hGLDLL, "glRotated" ); + qglRotatef = safe_dlsym (g_hGLDLL, "glRotatef" ); + qglScaled = safe_dlsym (g_hGLDLL, "glScaled" ); + qglScalef = safe_dlsym (g_hGLDLL, "glScalef" ); + qglScissor = safe_dlsym (g_hGLDLL, "glScissor" ); + qglSelectBuffer = safe_dlsym (g_hGLDLL, "glSelectBuffer" ); + qglShadeModel = safe_dlsym (g_hGLDLL, "glShadeModel" ); + qglStencilFunc = safe_dlsym (g_hGLDLL, "glStencilFunc" ); + qglStencilMask = safe_dlsym (g_hGLDLL, "glStencilMask" ); + qglStencilOp = safe_dlsym (g_hGLDLL, "glStencilOp" ); + qglTexCoord1d = safe_dlsym (g_hGLDLL, "glTexCoord1d" ); + qglTexCoord1dv = safe_dlsym (g_hGLDLL, "glTexCoord1dv" ); + qglTexCoord1f = safe_dlsym (g_hGLDLL, "glTexCoord1f" ); + qglTexCoord1fv = safe_dlsym (g_hGLDLL, "glTexCoord1fv" ); + qglTexCoord1i = safe_dlsym (g_hGLDLL, "glTexCoord1i" ); + qglTexCoord1iv = safe_dlsym (g_hGLDLL, "glTexCoord1iv" ); + qglTexCoord1s = safe_dlsym (g_hGLDLL, "glTexCoord1s" ); + qglTexCoord1sv = safe_dlsym (g_hGLDLL, "glTexCoord1sv" ); + qglTexCoord2d = safe_dlsym (g_hGLDLL, "glTexCoord2d" ); + qglTexCoord2dv = safe_dlsym (g_hGLDLL, "glTexCoord2dv" ); + qglTexCoord2f = safe_dlsym (g_hGLDLL, "glTexCoord2f" ); + qglTexCoord2fv = safe_dlsym (g_hGLDLL, "glTexCoord2fv" ); + qglTexCoord2i = safe_dlsym (g_hGLDLL, "glTexCoord2i" ); + qglTexCoord2iv = safe_dlsym (g_hGLDLL, "glTexCoord2iv" ); + qglTexCoord2s = safe_dlsym (g_hGLDLL, "glTexCoord2s" ); + qglTexCoord2sv = safe_dlsym (g_hGLDLL, "glTexCoord2sv" ); + qglTexCoord3d = safe_dlsym (g_hGLDLL, "glTexCoord3d" ); + qglTexCoord3dv = safe_dlsym (g_hGLDLL, "glTexCoord3dv" ); + qglTexCoord3f = safe_dlsym (g_hGLDLL, "glTexCoord3f" ); + qglTexCoord3fv = safe_dlsym (g_hGLDLL, "glTexCoord3fv" ); + qglTexCoord3i = safe_dlsym (g_hGLDLL, "glTexCoord3i" ); + qglTexCoord3iv = safe_dlsym (g_hGLDLL, "glTexCoord3iv" ); + qglTexCoord3s = safe_dlsym (g_hGLDLL, "glTexCoord3s" ); + qglTexCoord3sv = safe_dlsym (g_hGLDLL, "glTexCoord3sv" ); + qglTexCoord4d = safe_dlsym (g_hGLDLL, "glTexCoord4d" ); + qglTexCoord4dv = safe_dlsym (g_hGLDLL, "glTexCoord4dv" ); + qglTexCoord4f = safe_dlsym (g_hGLDLL, "glTexCoord4f" ); + qglTexCoord4fv = safe_dlsym (g_hGLDLL, "glTexCoord4fv" ); + qglTexCoord4i = safe_dlsym (g_hGLDLL, "glTexCoord4i" ); + qglTexCoord4iv = safe_dlsym (g_hGLDLL, "glTexCoord4iv" ); + qglTexCoord4s = safe_dlsym (g_hGLDLL, "glTexCoord4s" ); + qglTexCoord4sv = safe_dlsym (g_hGLDLL, "glTexCoord4sv" ); + qglTexCoordPointer = safe_dlsym (g_hGLDLL, "glTexCoordPointer" ); + qglTexEnvf = safe_dlsym (g_hGLDLL, "glTexEnvf" ); + qglTexEnvfv = safe_dlsym (g_hGLDLL, "glTexEnvfv" ); + qglTexEnvi = safe_dlsym (g_hGLDLL, "glTexEnvi" ); + qglTexEnviv = safe_dlsym (g_hGLDLL, "glTexEnviv" ); + qglTexGend = safe_dlsym (g_hGLDLL, "glTexGend" ); + qglTexGendv = safe_dlsym (g_hGLDLL, "glTexGendv" ); + qglTexGenf = safe_dlsym (g_hGLDLL, "glTexGenf" ); + qglTexGenfv = safe_dlsym (g_hGLDLL, "glTexGenfv" ); + qglTexGeni = safe_dlsym (g_hGLDLL, "glTexGeni" ); + qglTexGeniv = safe_dlsym (g_hGLDLL, "glTexGeniv" ); + qglTexImage1D = safe_dlsym (g_hGLDLL, "glTexImage1D" ); + qglTexImage2D = safe_dlsym (g_hGLDLL, "glTexImage2D" ); + qglTexParameterf = safe_dlsym (g_hGLDLL, "glTexParameterf" ); + qglTexParameterfv = safe_dlsym (g_hGLDLL, "glTexParameterfv" ); + qglTexParameteri = safe_dlsym (g_hGLDLL, "glTexParameteri" ); + qglTexParameteriv = safe_dlsym (g_hGLDLL, "glTexParameteriv" ); + qglTexSubImage1D = safe_dlsym (g_hGLDLL, "glTexSubImage1D" ); + qglTexSubImage2D = safe_dlsym (g_hGLDLL, "glTexSubImage2D" ); + qglTranslated = safe_dlsym (g_hGLDLL, "glTranslated" ); + qglTranslatef = safe_dlsym (g_hGLDLL, "glTranslatef" ); + qglVertex2d = safe_dlsym (g_hGLDLL, "glVertex2d" ); + qglVertex2dv = safe_dlsym (g_hGLDLL, "glVertex2dv" ); + qglVertex2f = safe_dlsym (g_hGLDLL, "glVertex2f" ); + qglVertex2fv = safe_dlsym (g_hGLDLL, "glVertex2fv" ); + qglVertex2i = safe_dlsym (g_hGLDLL, "glVertex2i" ); + qglVertex2iv = safe_dlsym (g_hGLDLL, "glVertex2iv" ); + qglVertex2s = safe_dlsym (g_hGLDLL, "glVertex2s" ); + qglVertex2sv = safe_dlsym (g_hGLDLL, "glVertex2sv" ); + qglVertex3d = safe_dlsym (g_hGLDLL, "glVertex3d" ); + qglVertex3dv = safe_dlsym (g_hGLDLL, "glVertex3dv" ); + qglVertex3f = safe_dlsym (g_hGLDLL, "glVertex3f" ); + qglVertex3fv = safe_dlsym (g_hGLDLL, "glVertex3fv" ); + qglVertex3i = safe_dlsym (g_hGLDLL, "glVertex3i" ); + qglVertex3iv = safe_dlsym (g_hGLDLL, "glVertex3iv" ); + qglVertex3s = safe_dlsym (g_hGLDLL, "glVertex3s" ); + qglVertex3sv = safe_dlsym (g_hGLDLL, "glVertex3sv" ); + qglVertex4d = safe_dlsym (g_hGLDLL, "glVertex4d" ); + qglVertex4dv = safe_dlsym (g_hGLDLL, "glVertex4dv" ); + qglVertex4f = safe_dlsym (g_hGLDLL, "glVertex4f" ); + qglVertex4fv = safe_dlsym (g_hGLDLL, "glVertex4fv" ); + qglVertex4i = safe_dlsym (g_hGLDLL, "glVertex4i" ); + qglVertex4iv = safe_dlsym (g_hGLDLL, "glVertex4iv" ); + qglVertex4s = safe_dlsym (g_hGLDLL, "glVertex4s" ); + qglVertex4sv = safe_dlsym (g_hGLDLL, "glVertex4sv" ); + qglVertexPointer = safe_dlsym (g_hGLDLL, "glVertexPointer" ); + qglViewport = safe_dlsym (g_hGLDLL, "glViewport" ); + + // must be init with an active context + qglActiveTextureARB = NULL; + qglClientActiveTextureARB = NULL; + qglMultiTexCoord1dARB = NULL; + qglMultiTexCoord1dvARB = NULL; + qglMultiTexCoord1fARB = NULL; + qglMultiTexCoord1fvARB = NULL; + qglMultiTexCoord1iARB = NULL; + qglMultiTexCoord1ivARB = NULL; + qglMultiTexCoord1sARB = NULL; + qglMultiTexCoord1svARB = NULL; + qglMultiTexCoord2dARB = NULL; + qglMultiTexCoord2dvARB = NULL; + qglMultiTexCoord2fARB = NULL; + qglMultiTexCoord2fvARB = NULL; + qglMultiTexCoord2iARB = NULL; + qglMultiTexCoord2ivARB = NULL; + qglMultiTexCoord2sARB = NULL; + qglMultiTexCoord2svARB = NULL; + qglMultiTexCoord3dARB = NULL; + qglMultiTexCoord3dvARB = NULL; + qglMultiTexCoord3fARB = NULL; + qglMultiTexCoord3fvARB = NULL; + qglMultiTexCoord3iARB = NULL; + qglMultiTexCoord3ivARB = NULL; + qglMultiTexCoord3sARB = NULL; + qglMultiTexCoord3svARB = NULL; + qglMultiTexCoord4dARB = NULL; + qglMultiTexCoord4dvARB = NULL; + qglMultiTexCoord4fARB = NULL; + qglMultiTexCoord4fvARB = NULL; + qglMultiTexCoord4iARB = NULL; + qglMultiTexCoord4ivARB = NULL; + qglMultiTexCoord4sARB = NULL; + qglMultiTexCoord4svARB = NULL; + +#ifdef _WIN32 + qwglCopyContext = safe_dlsym(g_hGLDLL, "wglCopyContext" ); + qwglCreateContext = safe_dlsym(g_hGLDLL, "wglCreateContext"); + qwglCreateLayerContext = safe_dlsym(g_hGLDLL, "wglCreateLayerContext" ); + qwglDeleteContext = safe_dlsym(g_hGLDLL, "wglDeleteContext"); + qwglDescribeLayerPlane = safe_dlsym(g_hGLDLL, "wglDescribeLayerPlane" ); + qwglGetCurrentContext = safe_dlsym(g_hGLDLL, "wglGetCurrentContext" ); + qwglGetCurrentDC = safe_dlsym(g_hGLDLL, "wglGetCurrentDC" ); + qwglGetLayerPaletteEntries = safe_dlsym(g_hGLDLL, "wglGetLayerPaletteEntries" ); + qwglGetProcAddress = safe_dlsym(g_hGLDLL, "wglGetProcAddress" ); + qwglMakeCurrent = safe_dlsym(g_hGLDLL, "wglMakeCurrent" ); + qwglRealizeLayerPalette = safe_dlsym(g_hGLDLL, "wglRealizeLayerPalette" ); + qwglSetLayerPaletteEntries = safe_dlsym(g_hGLDLL, "wglSetLayerPaletteEntries" ); + qwglShareLists = safe_dlsym(g_hGLDLL, "wglShareLists" ); + qwglSwapLayerBuffers = safe_dlsym(g_hGLDLL, "wglSwapLayerBuffers" ); + qwglUseFontBitmaps = safe_dlsym(g_hGLDLL, "wglUseFontBitmapsA" ); + qwglUseFontOutlines = safe_dlsym(g_hGLDLL, "wglUseFontOutlinesA" ); + + qwglChoosePixelFormat = safe_dlsym(g_hGLDLL, "wglChoosePixelFormat" ); + qwglDescribePixelFormat = safe_dlsym(g_hGLDLL, "wglDescribePixelFormat" ); + qwglGetPixelFormat = safe_dlsym(g_hGLDLL, "wglGetPixelFormat" ); + qwglSetPixelFormat = safe_dlsym(g_hGLDLL, "wglSetPixelFormat" ); + qwglSwapBuffers = safe_dlsym(g_hGLDLL, "wglSwapBuffers" ); + + qwglSwapIntervalEXT = 0; + qglPointParameterfEXT = 0; + qglPointParameterfvEXT = 0; + qglColorTableEXT = 0; + qglSelectTextureSGIS = 0; + qglMTexCoord2fSGIS = 0; +#endif + +#if defined (__linux__) || defined (__APPLE__) + qglXChooseVisual = safe_dlsym (g_hGLDLL, "glXChooseVisual"); + qglXCreateContext = safe_dlsym (g_hGLDLL, "glXCreateContext"); + qglXDestroyContext = safe_dlsym (g_hGLDLL, "glXDestroyContext"); + qglXMakeCurrent = safe_dlsym (g_hGLDLL, "glXMakeCurrent"); + qglXCopyContext = safe_dlsym (g_hGLDLL, "glXCopyContext"); + qglXSwapBuffers = safe_dlsym (g_hGLDLL, "glXSwapBuffers"); + qglXCreateGLXPixmap = safe_dlsym (g_hGLDLL, "glXCreateGLXPixmap"); + qglXDestroyGLXPixmap = safe_dlsym (g_hGLDLL, "glXDestroyGLXPixmap"); + qglXQueryExtension = safe_dlsym (g_hGLDLL, "glXQueryExtension"); + qglXQueryVersion = safe_dlsym (g_hGLDLL, "glXQueryVersion"); + qglXIsDirect = safe_dlsym (g_hGLDLL, "glXIsDirect"); + qglXGetConfig = safe_dlsym (g_hGLDLL, "glXGetConfig"); + qglXGetCurrentContext = safe_dlsym (g_hGLDLL, "glXGetCurrentContext"); + qglXGetCurrentDrawable = safe_dlsym (g_hGLDLL, "glXGetCurrentDrawable"); + qglXWaitGL = safe_dlsym (g_hGLDLL, "glXWaitGL"); + qglXWaitX = safe_dlsym (g_hGLDLL, "glXWaitX"); + qglXUseXFont = safe_dlsym (g_hGLDLL, "glXUseXFont"); +// qglXGetProcAddressARB = dlsym (g_hGLDLL, "glXGetProcAddressARB"); // Utah-GLX fix +#endif + + qglPointParameterfEXT = 0; + qglPointParameterfvEXT = 0; + qglColorTableEXT = 0; + qglSelectTextureSGIS = 0; + qglMTexCoord2fSGIS = 0; + + // texture compression + Sys_Printf ("Done.\n"); + +#ifdef ATIHACK_812 + ATIhack_culling = 0; + ATIhack_cullmode = GL_BACK; + ATIhack_backmode = GL_FILL; + ATIhack_frontmode = GL_FILL; +#endif + + if (init_error == 1) + return 0; + + return 1; +} + +int GL_ExtensionSupported (const char *extension) +{ + const GLubyte *extensions = NULL; + const GLubyte *start; + GLubyte *where, *terminator; + + // Extension names should not have spaces. + where = (GLubyte *) strchr (extension, ' '); + if (where || *extension == '\0') + return 0; + + extensions = qglGetString (GL_EXTENSIONS); +#ifndef __APPLE__ + if (!extensions) + return 0; +#endif + + // It takes a bit of care to be fool-proof about parsing the + // OpenGL extensions string. Don't be fooled by sub-strings, etc. + for (start = extensions; ;) + { + where = (GLubyte *) strstr ((const char *) start, extension); + if (!where) + break; + + terminator = where + strlen (extension); + if (where == start || *(where - 1) == ' ') + if (*terminator == ' ' || *terminator == '\0') + return 1; + + start = terminator; + } + + return 0; +} + +void* Sys_GLGetExtension (const char *symbol) +{ +#if defined (__linux__) || defined (__APPLE__) + if (qglXGetProcAddressARB == NULL) + return NULL; + else + return qglXGetProcAddressARB ((GLubyte*)symbol); +#else + return qwglGetProcAddress (symbol); +#endif +} + +void QGL_InitExtensions () +{ + if (GL_ExtensionSupported ("GL_ARB_multitexture")) + { + qglActiveTextureARB = Sys_GLGetExtension ("glActiveTextureARB"); + qglClientActiveTextureARB = Sys_GLGetExtension ("glClientActiveTextureARB"); + qglMultiTexCoord1dARB = Sys_GLGetExtension ("glMultiTexCoord1dARB"); + qglMultiTexCoord1dvARB = Sys_GLGetExtension ("glMultiTexCoord1dvARB"); + qglMultiTexCoord1fARB = Sys_GLGetExtension ("glMultiTexCoord1fARB"); + qglMultiTexCoord1fvARB = Sys_GLGetExtension ("glMultiTexCoord1fvARB"); + qglMultiTexCoord1iARB = Sys_GLGetExtension ("glMultiTexCoord1iARB"); + qglMultiTexCoord1ivARB = Sys_GLGetExtension ("glMultiTexCoord1ivARB"); + qglMultiTexCoord1sARB = Sys_GLGetExtension ("glMultiTexCoord1sARB"); + qglMultiTexCoord1svARB = Sys_GLGetExtension ("glMultiTexCoord1svARB"); + qglMultiTexCoord2dARB = Sys_GLGetExtension ("glMultiTexCoord2dARB"); + qglMultiTexCoord2dvARB = Sys_GLGetExtension ("glMultiTexCoord2dvARB"); + qglMultiTexCoord2fARB = Sys_GLGetExtension ("glMultiTexCoord2fARB"); + qglMultiTexCoord2fvARB = Sys_GLGetExtension ("glMultiTexCoord2fvARB"); + qglMultiTexCoord2iARB = Sys_GLGetExtension ("glMultiTexCoord2iARB"); + qglMultiTexCoord2ivARB = Sys_GLGetExtension ("glMultiTexCoord2ivARB"); + qglMultiTexCoord2sARB = Sys_GLGetExtension ("glMultiTexCoord2sARB"); + qglMultiTexCoord2svARB = Sys_GLGetExtension ("glMultiTexCoord2svARB"); + qglMultiTexCoord3dARB = Sys_GLGetExtension ("glMultiTexCoord3dARB"); + qglMultiTexCoord3dvARB = Sys_GLGetExtension ("glMultiTexCoord3dvARB"); + qglMultiTexCoord3fARB = Sys_GLGetExtension ("glMultiTexCoord3fARB"); + qglMultiTexCoord3fvARB = Sys_GLGetExtension ("glMultiTexCoord3fvARB"); + qglMultiTexCoord3iARB = Sys_GLGetExtension ("glMultiTexCoord3iARB"); + qglMultiTexCoord3ivARB = Sys_GLGetExtension ("glMultiTexCoord3ivARB"); + qglMultiTexCoord3sARB = Sys_GLGetExtension ("glMultiTexCoord3sARB"); + qglMultiTexCoord3svARB = Sys_GLGetExtension ("glMultiTexCoord3svARB"); + qglMultiTexCoord4dARB = Sys_GLGetExtension ("glMultiTexCoord4dARB"); + qglMultiTexCoord4dvARB = Sys_GLGetExtension ("glMultiTexCoord4dvARB"); + qglMultiTexCoord4fARB = Sys_GLGetExtension ("glMultiTexCoord4fARB"); + qglMultiTexCoord4fvARB = Sys_GLGetExtension ("glMultiTexCoord4fvARB"); + qglMultiTexCoord4iARB = Sys_GLGetExtension ("glMultiTexCoord4iARB"); + qglMultiTexCoord4ivARB = Sys_GLGetExtension ("glMultiTexCoord4ivARB"); + qglMultiTexCoord4sARB = Sys_GLGetExtension ("glMultiTexCoord4sARB"); + qglMultiTexCoord4svARB = Sys_GLGetExtension ("glMultiTexCoord4svARB"); + } +} diff --git a/radiant/qgl.cpp b/radiant/qgl.cpp deleted file mode 100644 index 18fe0532..00000000 --- a/radiant/qgl.cpp +++ /dev/null @@ -1,1658 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "qgl.h" - -#include "debugging/debugging.h" - -#include -#include -#include - -#if defined(_WIN32) -#define WINGDIAPI __declspec(dllimport) -#define APIENTRY __stdcall -#endif - -#include - -#if defined(_WIN32) -#undef WINGDIAPI -#undef APIENTRY -#endif - -#include "igl.h" - - - - -#if defined(_WIN32) - -#include - -int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *); -int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); -int ( WINAPI * qwglGetPixelFormat)(HDC); -BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); -BOOL ( WINAPI * qwglSwapBuffers)(HDC); - -BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); -HGLRC ( WINAPI * qwglCreateContext)(HDC); -HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int); -BOOL ( WINAPI * qwglDeleteContext)(HGLRC); -HGLRC ( WINAPI * qwglGetCurrentContext)(VOID); -HDC ( WINAPI * qwglGetCurrentDC)(VOID); -PROC ( WINAPI * qwglGetProcAddress)(LPCSTR); -BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC); -BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC); -BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD); - -BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT, - FLOAT, int, LPGLYPHMETRICSFLOAT); - -BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR); -int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int, CONST COLORREF *); -int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int, COLORREF *); -BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL); -BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT); - -#elif defined (XWINDOWS) - -#include -#include -#include - -XVisualInfo* (*qglXChooseVisual)(Display *dpy, int screen, int *attribList); -GLXContext (*qglXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); -void (*qglXDestroyContext)(Display *dpy, GLXContext ctx); -Bool (*qglXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); -void (*qglXCopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); -void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); -GLXPixmap (*qglXCreateGLXPixmap)( Display *dpy, XVisualInfo *visual, Pixmap pixmap ); -void (*qglXDestroyGLXPixmap)( Display *dpy, GLXPixmap pixmap ); -Bool (*qglXQueryExtension)( Display *dpy, int *errorb, int *event ); -Bool (*qglXQueryVersion)( Display *dpy, int *maj, int *min ); -Bool (*qglXIsDirect)( Display *dpy, GLXContext ctx ); -int (*qglXGetConfig)( Display *dpy, XVisualInfo *visual, int attrib, int *value ); -GLXContext (*qglXGetCurrentContext)( void ); -GLXDrawable (*qglXGetCurrentDrawable)( void ); -void (*qglXWaitGL)( void ); -void (*qglXWaitX)( void ); -void (*qglXUseXFont)( Font font, int first, int count, int list ); -void* (*qglXGetProcAddressARB) (const GLubyte *procName); -typedef void* (*glXGetProcAddressARBProc) (const GLubyte *procName); - -#else -#error "unsupported platform" -#endif - - -void QGL_Shutdown(OpenGLBinding& table) -{ - globalOutputStream() << "Shutting down OpenGL module..."; - -#if defined(WIN32) - qwglCopyContext = 0; - qwglCreateContext = 0; - qwglCreateLayerContext = 0; - qwglDeleteContext = 0; - qwglDescribeLayerPlane = 0; - qwglGetCurrentContext = 0; - qwglGetCurrentDC = 0; - qwglGetLayerPaletteEntries = 0; - qwglGetProcAddress = 0; - qwglMakeCurrent = 0; - qwglRealizeLayerPalette = 0; - qwglSetLayerPaletteEntries = 0; - qwglShareLists = 0; - qwglSwapLayerBuffers = 0; - qwglUseFontBitmaps = 0; - qwglUseFontOutlines = 0; - - qwglChoosePixelFormat = 0; - qwglDescribePixelFormat = 0; - qwglGetPixelFormat = 0; - qwglSetPixelFormat = 0; - qwglSwapBuffers = 0; -#elif defined(XWINDOWS) - qglXChooseVisual = 0; - qglXCreateContext = 0; - qglXDestroyContext = 0; - qglXMakeCurrent = 0; - qglXCopyContext = 0; - qglXSwapBuffers = 0; - qglXCreateGLXPixmap = 0; - qglXDestroyGLXPixmap = 0; - qglXQueryExtension = 0; - qglXQueryVersion = 0; - qglXIsDirect = 0; - qglXGetConfig = 0; - qglXGetCurrentContext = 0; - qglXGetCurrentDrawable = 0; - qglXWaitGL = 0; - qglXWaitX = 0; - qglXUseXFont = 0; - qglXGetProcAddressARB = 0; -#else -#error "unsupported platform" -#endif - - globalOutputStream() << "Done.\n"; -} - - -typedef struct glu_error_struct -{ - GLenum errnum; - const char *errstr; -} GLU_ERROR_STRUCT; - -GLU_ERROR_STRUCT glu_errlist[] = { - {GL_NO_ERROR, "GL_NO_ERROR - no error"}, - {GL_INVALID_ENUM, "GL_INVALID_ENUM - An unacceptable value is specified for an enumerated argument."}, - {GL_INVALID_VALUE, "GL_INVALID_VALUE - A numeric argument is out of range."}, - {GL_INVALID_OPERATION, "GL_INVALID_OPERATION - The specified operation is not allowed in the current state."}, - {GL_STACK_OVERFLOW, "GL_STACK_OVERFLOW - Function would cause a stack overflow."}, - {GL_STACK_UNDERFLOW, "GL_STACK_UNDERFLOW - Function would cause a stack underflow."}, - {GL_OUT_OF_MEMORY, "GL_OUT_OF_MEMORY - There is not enough memory left to execute the function."}, - {0, 0} -}; - -const GLubyte* qgluErrorString(GLenum errCode ) -{ - int search = 0; - for (search = 0; glu_errlist[search].errstr; search++) - { - if (errCode == glu_errlist[search].errnum) - return (const GLubyte *)glu_errlist[search].errstr; - } //end for - return (const GLubyte *)"Unknown error"; -} - - -void glInvalidFunction() -{ - ERROR_MESSAGE("calling an invalid OpenGL function"); -} - -#define EXTENSIONS_ENABLED 1 - -bool QGL_ExtensionSupported(const char* extension) -{ -#if EXTENSIONS_ENABLED - const GLubyte *extensions = 0; - const GLubyte *start; - GLubyte *where, *terminator; - - // Extension names should not have spaces. - where = (GLubyte *) strchr (extension, ' '); - if (where || *extension == '\0') - return false; - - extensions = GlobalOpenGL().m_glGetString (GL_EXTENSIONS); -#ifndef __APPLE__ - if (!extensions) - return false; -#endif - - // It takes a bit of care to be fool-proof about parsing the - // OpenGL extensions string. Don't be fooled by sub-strings, etc. - for (start = extensions; ;) - { - where = (GLubyte *) strstr ((const char *) start, extension); - if (!where) - break; - - terminator = where + strlen (extension); - if (where == start || *(where - 1) == ' ') - if (*terminator == ' ' || *terminator == '\0') - return true; - - start = terminator; - } -#endif - - return false; -} - -typedef int (QGL_DLLEXPORT *QGLFunctionPointer)(); - -QGLFunctionPointer QGL_getExtensionFunc(const char* symbol) -{ -#if defined(XWINDOWS) - //ASSERT_NOTNULL(qglXGetProcAddressARB); - if (qglXGetProcAddressARB == 0) - { - return reinterpret_cast(glInvalidFunction); - } - else - { - return (QGLFunctionPointer)qglXGetProcAddressARB(reinterpret_cast(symbol)); - } -#elif defined(WIN32) - ASSERT_NOTNULL(qwglGetProcAddress); - return qwglGetProcAddress(symbol); -#else -#error "unsupported platform" -#endif -} - - -template -bool QGL_constructExtensionFunc(Func& func, const char* symbol) -{ - func = reinterpret_cast(QGL_getExtensionFunc(symbol)); - return func != 0; -} - -template -void QGL_invalidateExtensionFunc(Func& func) -{ - func = reinterpret_cast(glInvalidFunction); -} - -void QGL_clear(OpenGLBinding& table) -{ - QGL_invalidateExtensionFunc(table.m_glAccum); - QGL_invalidateExtensionFunc(table.m_glAlphaFunc); - QGL_invalidateExtensionFunc(table.m_glAreTexturesResident); - QGL_invalidateExtensionFunc(table.m_glArrayElement); - QGL_invalidateExtensionFunc(table.m_glBegin); - QGL_invalidateExtensionFunc(table.m_glBindTexture); - QGL_invalidateExtensionFunc(table.m_glBitmap); - QGL_invalidateExtensionFunc(table.m_glBlendFunc); - QGL_invalidateExtensionFunc(table.m_glCallList); - QGL_invalidateExtensionFunc(table.m_glCallLists); - QGL_invalidateExtensionFunc(table.m_glClear); - QGL_invalidateExtensionFunc(table.m_glClearAccum); - QGL_invalidateExtensionFunc(table.m_glClearColor); - QGL_invalidateExtensionFunc(table.m_glClearDepth); - QGL_invalidateExtensionFunc(table.m_glClearIndex); - QGL_invalidateExtensionFunc(table.m_glClearStencil); - QGL_invalidateExtensionFunc(table.m_glClipPlane); - QGL_invalidateExtensionFunc(table.m_glColor3b); - QGL_invalidateExtensionFunc(table.m_glColor3bv); - QGL_invalidateExtensionFunc(table.m_glColor3d); - QGL_invalidateExtensionFunc(table.m_glColor3dv); - QGL_invalidateExtensionFunc(table.m_glColor3f); - QGL_invalidateExtensionFunc(table.m_glColor3fv); - QGL_invalidateExtensionFunc(table.m_glColor3i); - QGL_invalidateExtensionFunc(table.m_glColor3iv); - QGL_invalidateExtensionFunc(table.m_glColor3s); - QGL_invalidateExtensionFunc(table.m_glColor3sv); - QGL_invalidateExtensionFunc(table.m_glColor3ub); - QGL_invalidateExtensionFunc(table.m_glColor3ubv); - QGL_invalidateExtensionFunc(table.m_glColor3ui); - QGL_invalidateExtensionFunc(table.m_glColor3uiv); - QGL_invalidateExtensionFunc(table.m_glColor3us); - QGL_invalidateExtensionFunc(table.m_glColor3usv); - QGL_invalidateExtensionFunc(table.m_glColor4b); - QGL_invalidateExtensionFunc(table.m_glColor4bv); - QGL_invalidateExtensionFunc(table.m_glColor4d); - QGL_invalidateExtensionFunc(table.m_glColor4dv); - QGL_invalidateExtensionFunc(table.m_glColor4f); - QGL_invalidateExtensionFunc(table.m_glColor4fv); - QGL_invalidateExtensionFunc(table.m_glColor4i); - QGL_invalidateExtensionFunc(table.m_glColor4iv); - QGL_invalidateExtensionFunc(table.m_glColor4s); - QGL_invalidateExtensionFunc(table.m_glColor4sv); - QGL_invalidateExtensionFunc(table.m_glColor4ub); - QGL_invalidateExtensionFunc(table.m_glColor4ubv); - QGL_invalidateExtensionFunc(table.m_glColor4ui); - QGL_invalidateExtensionFunc(table.m_glColor4uiv); - QGL_invalidateExtensionFunc(table.m_glColor4us); - QGL_invalidateExtensionFunc(table.m_glColor4usv); - QGL_invalidateExtensionFunc(table.m_glColorMask); - QGL_invalidateExtensionFunc(table.m_glColorMaterial); - QGL_invalidateExtensionFunc(table.m_glColorPointer); - QGL_invalidateExtensionFunc(table.m_glCopyPixels); - QGL_invalidateExtensionFunc(table.m_glCopyTexImage1D); - QGL_invalidateExtensionFunc(table.m_glCopyTexImage2D); - QGL_invalidateExtensionFunc(table.m_glCopyTexSubImage1D); - QGL_invalidateExtensionFunc(table.m_glCopyTexSubImage2D); - QGL_invalidateExtensionFunc(table.m_glCullFace); - QGL_invalidateExtensionFunc(table.m_glDeleteLists); - QGL_invalidateExtensionFunc(table.m_glDeleteTextures); - QGL_invalidateExtensionFunc(table.m_glDepthFunc); - QGL_invalidateExtensionFunc(table.m_glDepthMask); - QGL_invalidateExtensionFunc(table.m_glDepthRange); - QGL_invalidateExtensionFunc(table.m_glDisable); - QGL_invalidateExtensionFunc(table.m_glDisableClientState); - QGL_invalidateExtensionFunc(table.m_glDrawArrays); - QGL_invalidateExtensionFunc(table.m_glDrawBuffer); - QGL_invalidateExtensionFunc(table.m_glDrawElements); - QGL_invalidateExtensionFunc(table.m_glDrawPixels); - QGL_invalidateExtensionFunc(table.m_glEdgeFlag); - QGL_invalidateExtensionFunc(table.m_glEdgeFlagPointer); - QGL_invalidateExtensionFunc(table.m_glEdgeFlagv); - QGL_invalidateExtensionFunc(table.m_glEnable); - QGL_invalidateExtensionFunc(table.m_glEnableClientState); - QGL_invalidateExtensionFunc(table.m_glEnd); - QGL_invalidateExtensionFunc(table.m_glEndList); - QGL_invalidateExtensionFunc(table.m_glEvalCoord1d); - QGL_invalidateExtensionFunc(table.m_glEvalCoord1dv); - QGL_invalidateExtensionFunc(table.m_glEvalCoord1f); - QGL_invalidateExtensionFunc(table.m_glEvalCoord1fv); - QGL_invalidateExtensionFunc(table.m_glEvalCoord2d); - QGL_invalidateExtensionFunc(table.m_glEvalCoord2dv); - QGL_invalidateExtensionFunc(table.m_glEvalCoord2f); - QGL_invalidateExtensionFunc(table.m_glEvalCoord2fv); - QGL_invalidateExtensionFunc(table.m_glEvalMesh1); - QGL_invalidateExtensionFunc(table.m_glEvalMesh2); - QGL_invalidateExtensionFunc(table.m_glEvalPoint1); - QGL_invalidateExtensionFunc(table.m_glEvalPoint2); - QGL_invalidateExtensionFunc(table.m_glFeedbackBuffer); - QGL_invalidateExtensionFunc(table.m_glFinish); - QGL_invalidateExtensionFunc(table.m_glFlush); - QGL_invalidateExtensionFunc(table.m_glFogf); - QGL_invalidateExtensionFunc(table.m_glFogfv); - QGL_invalidateExtensionFunc(table.m_glFogi); - QGL_invalidateExtensionFunc(table.m_glFogiv); - QGL_invalidateExtensionFunc(table.m_glFrontFace); - QGL_invalidateExtensionFunc(table.m_glFrustum); - QGL_invalidateExtensionFunc(table.m_glGenLists); - QGL_invalidateExtensionFunc(table.m_glGenTextures); - QGL_invalidateExtensionFunc(table.m_glGetBooleanv); - QGL_invalidateExtensionFunc(table.m_glGetClipPlane); - QGL_invalidateExtensionFunc(table.m_glGetDoublev); - QGL_invalidateExtensionFunc(table.m_glGetError); - QGL_invalidateExtensionFunc(table.m_glGetFloatv); - QGL_invalidateExtensionFunc(table.m_glGetIntegerv); - QGL_invalidateExtensionFunc(table.m_glGetLightfv); - QGL_invalidateExtensionFunc(table.m_glGetLightiv); - QGL_invalidateExtensionFunc(table.m_glGetMapdv); - QGL_invalidateExtensionFunc(table.m_glGetMapfv); - QGL_invalidateExtensionFunc(table.m_glGetMapiv); - QGL_invalidateExtensionFunc(table.m_glGetMaterialfv); - QGL_invalidateExtensionFunc(table.m_glGetMaterialiv); - QGL_invalidateExtensionFunc(table.m_glGetPixelMapfv); - QGL_invalidateExtensionFunc(table.m_glGetPixelMapuiv); - QGL_invalidateExtensionFunc(table.m_glGetPixelMapusv); - QGL_invalidateExtensionFunc(table.m_glGetPointerv); - QGL_invalidateExtensionFunc(table.m_glGetPolygonStipple); - table.m_glGetString = glGetString; - QGL_invalidateExtensionFunc(table.m_glGetTexEnvfv); - QGL_invalidateExtensionFunc(table.m_glGetTexEnviv); - QGL_invalidateExtensionFunc(table.m_glGetTexGendv); - QGL_invalidateExtensionFunc(table.m_glGetTexGenfv); - QGL_invalidateExtensionFunc(table.m_glGetTexGeniv); - QGL_invalidateExtensionFunc(table.m_glGetTexImage); - QGL_invalidateExtensionFunc(table.m_glGetTexLevelParameterfv); - QGL_invalidateExtensionFunc(table.m_glGetTexLevelParameteriv); - QGL_invalidateExtensionFunc(table.m_glGetTexParameterfv); - QGL_invalidateExtensionFunc(table.m_glGetTexParameteriv); - QGL_invalidateExtensionFunc(table.m_glHint); - QGL_invalidateExtensionFunc(table.m_glIndexMask); - QGL_invalidateExtensionFunc(table.m_glIndexPointer); - QGL_invalidateExtensionFunc(table.m_glIndexd); - QGL_invalidateExtensionFunc(table.m_glIndexdv); - QGL_invalidateExtensionFunc(table.m_glIndexf); - QGL_invalidateExtensionFunc(table.m_glIndexfv); - QGL_invalidateExtensionFunc(table.m_glIndexi); - QGL_invalidateExtensionFunc(table.m_glIndexiv); - QGL_invalidateExtensionFunc(table.m_glIndexs); - QGL_invalidateExtensionFunc(table.m_glIndexsv); - QGL_invalidateExtensionFunc(table.m_glIndexub); - QGL_invalidateExtensionFunc(table.m_glIndexubv); - QGL_invalidateExtensionFunc(table.m_glInitNames); - QGL_invalidateExtensionFunc(table.m_glInterleavedArrays); - QGL_invalidateExtensionFunc(table.m_glIsEnabled); - QGL_invalidateExtensionFunc(table.m_glIsList); - QGL_invalidateExtensionFunc(table.m_glIsTexture); - QGL_invalidateExtensionFunc(table.m_glLightModelf); - QGL_invalidateExtensionFunc(table.m_glLightModelfv); - QGL_invalidateExtensionFunc(table.m_glLightModeli); - QGL_invalidateExtensionFunc(table.m_glLightModeliv); - QGL_invalidateExtensionFunc(table.m_glLightf); - QGL_invalidateExtensionFunc(table.m_glLightfv); - QGL_invalidateExtensionFunc(table.m_glLighti); - QGL_invalidateExtensionFunc(table.m_glLightiv); - QGL_invalidateExtensionFunc(table.m_glLineStipple); - QGL_invalidateExtensionFunc(table.m_glLineWidth); - QGL_invalidateExtensionFunc(table.m_glListBase); - QGL_invalidateExtensionFunc(table.m_glLoadIdentity); - QGL_invalidateExtensionFunc(table.m_glLoadMatrixd); - QGL_invalidateExtensionFunc(table.m_glLoadMatrixf); - QGL_invalidateExtensionFunc(table.m_glLoadName); - QGL_invalidateExtensionFunc(table.m_glLogicOp); - QGL_invalidateExtensionFunc(table.m_glMap1d); - QGL_invalidateExtensionFunc(table.m_glMap1f); - QGL_invalidateExtensionFunc(table.m_glMap2d); - QGL_invalidateExtensionFunc(table.m_glMap2f); - QGL_invalidateExtensionFunc(table.m_glMapGrid1d); - QGL_invalidateExtensionFunc(table.m_glMapGrid1f); - QGL_invalidateExtensionFunc(table.m_glMapGrid2d); - QGL_invalidateExtensionFunc(table.m_glMapGrid2f); - QGL_invalidateExtensionFunc(table.m_glMaterialf); - QGL_invalidateExtensionFunc(table.m_glMaterialfv); - QGL_invalidateExtensionFunc(table.m_glMateriali); - QGL_invalidateExtensionFunc(table.m_glMaterialiv); - QGL_invalidateExtensionFunc(table.m_glMatrixMode); - QGL_invalidateExtensionFunc(table.m_glMultMatrixd); - QGL_invalidateExtensionFunc(table.m_glMultMatrixf); - QGL_invalidateExtensionFunc(table.m_glNewList); - QGL_invalidateExtensionFunc(table.m_glNormal3b); - QGL_invalidateExtensionFunc(table.m_glNormal3bv); - QGL_invalidateExtensionFunc(table.m_glNormal3d); - QGL_invalidateExtensionFunc(table.m_glNormal3dv); - QGL_invalidateExtensionFunc(table.m_glNormal3f); - QGL_invalidateExtensionFunc(table.m_glNormal3fv); - QGL_invalidateExtensionFunc(table.m_glNormal3i); - QGL_invalidateExtensionFunc(table.m_glNormal3iv); - QGL_invalidateExtensionFunc(table.m_glNormal3s); - QGL_invalidateExtensionFunc(table.m_glNormal3sv); - QGL_invalidateExtensionFunc(table.m_glNormalPointer); - QGL_invalidateExtensionFunc(table.m_glOrtho); - QGL_invalidateExtensionFunc(table.m_glPassThrough); - QGL_invalidateExtensionFunc(table.m_glPixelMapfv); - QGL_invalidateExtensionFunc(table.m_glPixelMapuiv); - QGL_invalidateExtensionFunc(table.m_glPixelMapusv); - QGL_invalidateExtensionFunc(table.m_glPixelStoref); - QGL_invalidateExtensionFunc(table.m_glPixelStorei); - QGL_invalidateExtensionFunc(table.m_glPixelTransferf); - QGL_invalidateExtensionFunc(table.m_glPixelTransferi); - QGL_invalidateExtensionFunc(table.m_glPixelZoom); - QGL_invalidateExtensionFunc(table.m_glPointSize); - QGL_invalidateExtensionFunc(table.m_glPolygonMode); - QGL_invalidateExtensionFunc(table.m_glPolygonOffset); - QGL_invalidateExtensionFunc(table.m_glPolygonStipple); - QGL_invalidateExtensionFunc(table.m_glPopAttrib); - QGL_invalidateExtensionFunc(table.m_glPopClientAttrib); - QGL_invalidateExtensionFunc(table.m_glPopMatrix); - QGL_invalidateExtensionFunc(table.m_glPopName); - QGL_invalidateExtensionFunc(table.m_glPrioritizeTextures); - QGL_invalidateExtensionFunc(table.m_glPushAttrib); - QGL_invalidateExtensionFunc(table.m_glPushClientAttrib); - QGL_invalidateExtensionFunc(table.m_glPushMatrix); - QGL_invalidateExtensionFunc(table.m_glPushName); - QGL_invalidateExtensionFunc(table.m_glRasterPos2d); - QGL_invalidateExtensionFunc(table.m_glRasterPos2dv); - QGL_invalidateExtensionFunc(table.m_glRasterPos2f); - QGL_invalidateExtensionFunc(table.m_glRasterPos2fv); - QGL_invalidateExtensionFunc(table.m_glRasterPos2i); - QGL_invalidateExtensionFunc(table.m_glRasterPos2iv); - QGL_invalidateExtensionFunc(table.m_glRasterPos2s); - QGL_invalidateExtensionFunc(table.m_glRasterPos2sv); - QGL_invalidateExtensionFunc(table.m_glRasterPos3d); - QGL_invalidateExtensionFunc(table.m_glRasterPos3dv); - QGL_invalidateExtensionFunc(table.m_glRasterPos3f); - QGL_invalidateExtensionFunc(table.m_glRasterPos3fv); - QGL_invalidateExtensionFunc(table.m_glRasterPos3i); - QGL_invalidateExtensionFunc(table.m_glRasterPos3iv); - QGL_invalidateExtensionFunc(table.m_glRasterPos3s); - QGL_invalidateExtensionFunc(table.m_glRasterPos3sv); - QGL_invalidateExtensionFunc(table.m_glRasterPos4d); - QGL_invalidateExtensionFunc(table.m_glRasterPos4dv); - QGL_invalidateExtensionFunc(table.m_glRasterPos4f); - QGL_invalidateExtensionFunc(table.m_glRasterPos4fv); - QGL_invalidateExtensionFunc(table.m_glRasterPos4i); - QGL_invalidateExtensionFunc(table.m_glRasterPos4iv); - QGL_invalidateExtensionFunc(table.m_glRasterPos4s); - QGL_invalidateExtensionFunc(table.m_glRasterPos4sv); - QGL_invalidateExtensionFunc(table.m_glReadBuffer); - QGL_invalidateExtensionFunc(table.m_glReadPixels); - QGL_invalidateExtensionFunc(table.m_glRectd); - QGL_invalidateExtensionFunc(table.m_glRectdv); - QGL_invalidateExtensionFunc(table.m_glRectf); - QGL_invalidateExtensionFunc(table.m_glRectfv); - QGL_invalidateExtensionFunc(table.m_glRecti); - QGL_invalidateExtensionFunc(table.m_glRectiv); - QGL_invalidateExtensionFunc(table.m_glRects); - QGL_invalidateExtensionFunc(table.m_glRectsv); - QGL_invalidateExtensionFunc(table.m_glRenderMode); - QGL_invalidateExtensionFunc(table.m_glRotated); - QGL_invalidateExtensionFunc(table.m_glRotatef); - QGL_invalidateExtensionFunc(table.m_glScaled); - QGL_invalidateExtensionFunc(table.m_glScalef); - QGL_invalidateExtensionFunc(table.m_glScissor); - QGL_invalidateExtensionFunc(table.m_glSelectBuffer); - QGL_invalidateExtensionFunc(table.m_glShadeModel); - QGL_invalidateExtensionFunc(table.m_glStencilFunc); - QGL_invalidateExtensionFunc(table.m_glStencilMask); - QGL_invalidateExtensionFunc(table.m_glStencilOp); - QGL_invalidateExtensionFunc(table.m_glTexCoord1d); - QGL_invalidateExtensionFunc(table.m_glTexCoord1dv); - QGL_invalidateExtensionFunc(table.m_glTexCoord1f); - QGL_invalidateExtensionFunc(table.m_glTexCoord1fv); - QGL_invalidateExtensionFunc(table.m_glTexCoord1i); - QGL_invalidateExtensionFunc(table.m_glTexCoord1iv); - QGL_invalidateExtensionFunc(table.m_glTexCoord1s); - QGL_invalidateExtensionFunc(table.m_glTexCoord1sv); - QGL_invalidateExtensionFunc(table.m_glTexCoord2d); - QGL_invalidateExtensionFunc(table.m_glTexCoord2dv); - QGL_invalidateExtensionFunc(table.m_glTexCoord2f); - QGL_invalidateExtensionFunc(table.m_glTexCoord2fv); - QGL_invalidateExtensionFunc(table.m_glTexCoord2i); - QGL_invalidateExtensionFunc(table.m_glTexCoord2iv); - QGL_invalidateExtensionFunc(table.m_glTexCoord2s); - QGL_invalidateExtensionFunc(table.m_glTexCoord2sv); - QGL_invalidateExtensionFunc(table.m_glTexCoord3d); - QGL_invalidateExtensionFunc(table.m_glTexCoord3dv); - QGL_invalidateExtensionFunc(table.m_glTexCoord3f); - QGL_invalidateExtensionFunc(table.m_glTexCoord3fv); - QGL_invalidateExtensionFunc(table.m_glTexCoord3i); - QGL_invalidateExtensionFunc(table.m_glTexCoord3iv); - QGL_invalidateExtensionFunc(table.m_glTexCoord3s); - QGL_invalidateExtensionFunc(table.m_glTexCoord3sv); - QGL_invalidateExtensionFunc(table.m_glTexCoord4d); - QGL_invalidateExtensionFunc(table.m_glTexCoord4dv); - QGL_invalidateExtensionFunc(table.m_glTexCoord4f); - QGL_invalidateExtensionFunc(table.m_glTexCoord4fv); - QGL_invalidateExtensionFunc(table.m_glTexCoord4i); - QGL_invalidateExtensionFunc(table.m_glTexCoord4iv); - QGL_invalidateExtensionFunc(table.m_glTexCoord4s); - QGL_invalidateExtensionFunc(table.m_glTexCoord4sv); - QGL_invalidateExtensionFunc(table.m_glTexCoordPointer); - QGL_invalidateExtensionFunc(table.m_glTexEnvf); - QGL_invalidateExtensionFunc(table.m_glTexEnvfv); - QGL_invalidateExtensionFunc(table.m_glTexEnvi); - QGL_invalidateExtensionFunc(table.m_glTexEnviv); - QGL_invalidateExtensionFunc(table.m_glTexGend); - QGL_invalidateExtensionFunc(table.m_glTexGendv); - QGL_invalidateExtensionFunc(table.m_glTexGenf); - QGL_invalidateExtensionFunc(table.m_glTexGenfv); - QGL_invalidateExtensionFunc(table.m_glTexGeni); - QGL_invalidateExtensionFunc(table.m_glTexGeniv); - QGL_invalidateExtensionFunc(table.m_glTexImage1D); - QGL_invalidateExtensionFunc(table.m_glTexImage2D); - QGL_invalidateExtensionFunc(table.m_glTexParameterf); - QGL_invalidateExtensionFunc(table.m_glTexParameterfv); - QGL_invalidateExtensionFunc(table.m_glTexParameteri); - QGL_invalidateExtensionFunc(table.m_glTexParameteriv); - QGL_invalidateExtensionFunc(table.m_glTexSubImage1D); - QGL_invalidateExtensionFunc(table.m_glTexSubImage2D); - QGL_invalidateExtensionFunc(table.m_glTranslated); - QGL_invalidateExtensionFunc(table.m_glTranslatef); - QGL_invalidateExtensionFunc(table.m_glVertex2d); - QGL_invalidateExtensionFunc(table.m_glVertex2dv); - QGL_invalidateExtensionFunc(table.m_glVertex2f); - QGL_invalidateExtensionFunc(table.m_glVertex2fv); - QGL_invalidateExtensionFunc(table.m_glVertex2i); - QGL_invalidateExtensionFunc(table.m_glVertex2iv); - QGL_invalidateExtensionFunc(table.m_glVertex2s); - QGL_invalidateExtensionFunc(table.m_glVertex2sv); - QGL_invalidateExtensionFunc(table.m_glVertex3d); - QGL_invalidateExtensionFunc(table.m_glVertex3dv); - QGL_invalidateExtensionFunc(table.m_glVertex3f); - QGL_invalidateExtensionFunc(table.m_glVertex3fv); - QGL_invalidateExtensionFunc(table.m_glVertex3i); - QGL_invalidateExtensionFunc(table.m_glVertex3iv); - QGL_invalidateExtensionFunc(table.m_glVertex3s); - QGL_invalidateExtensionFunc(table.m_glVertex3sv); - QGL_invalidateExtensionFunc(table.m_glVertex4d); - QGL_invalidateExtensionFunc(table.m_glVertex4dv); - QGL_invalidateExtensionFunc(table.m_glVertex4f); - QGL_invalidateExtensionFunc(table.m_glVertex4fv); - QGL_invalidateExtensionFunc(table.m_glVertex4i); - QGL_invalidateExtensionFunc(table.m_glVertex4iv); - QGL_invalidateExtensionFunc(table.m_glVertex4s); - QGL_invalidateExtensionFunc(table.m_glVertex4sv); - QGL_invalidateExtensionFunc(table.m_glVertexPointer); - QGL_invalidateExtensionFunc(table.m_glViewport); -} - -int QGL_Init(OpenGLBinding& table) -{ - QGL_clear(table); - -#if defined(WIN32) - qwglCopyContext = wglCopyContext; - qwglCreateContext = wglCreateContext; - qwglCreateLayerContext = wglCreateLayerContext; - qwglDeleteContext = wglDeleteContext; - qwglDescribeLayerPlane = wglDescribeLayerPlane; - qwglGetCurrentContext = wglGetCurrentContext; - qwglGetCurrentDC = wglGetCurrentDC; - qwglGetLayerPaletteEntries = wglGetLayerPaletteEntries; - qwglGetProcAddress = wglGetProcAddress; - qwglMakeCurrent = wglMakeCurrent; - qwglRealizeLayerPalette = wglRealizeLayerPalette; - qwglSetLayerPaletteEntries = wglSetLayerPaletteEntries; - qwglShareLists = wglShareLists; - qwglSwapLayerBuffers = wglSwapLayerBuffers; - qwglUseFontBitmaps = wglUseFontBitmapsA; - qwglUseFontOutlines = wglUseFontOutlinesA; - - qwglChoosePixelFormat = ChoosePixelFormat; - qwglDescribePixelFormat = DescribePixelFormat; - qwglGetPixelFormat = GetPixelFormat; - qwglSetPixelFormat = SetPixelFormat; - qwglSwapBuffers = SwapBuffers; -#elif defined(XWINDOWS) - qglXChooseVisual = glXChooseVisual; - qglXCreateContext = glXCreateContext; - qglXDestroyContext = glXDestroyContext; - qglXMakeCurrent = glXMakeCurrent; - //qglXCopyContext = glXCopyContext; - qglXSwapBuffers = glXSwapBuffers; - qglXCreateGLXPixmap = glXCreateGLXPixmap; - qglXDestroyGLXPixmap = glXDestroyGLXPixmap; - qglXQueryExtension = glXQueryExtension; - qglXQueryVersion = glXQueryVersion; - qglXIsDirect = glXIsDirect; - qglXGetConfig = glXGetConfig; - qglXGetCurrentContext = glXGetCurrentContext; - qglXGetCurrentDrawable = glXGetCurrentDrawable; - qglXWaitGL = glXWaitGL; - qglXWaitX = glXWaitX; - qglXUseXFont = glXUseXFont; -// qglXGetProcAddressARB = glXGetProcAddressARB; // Utah-GLX fix - - qglXGetProcAddressARB = (glXGetProcAddressARBProc)dlsym(RTLD_DEFAULT, "glXGetProcAddressARB"); - if ((qglXQueryExtension == 0) || (qglXQueryExtension(GDK_DISPLAY(),0,0) != True)) - return 0; -#else -#error "unsupported platform" -#endif - - return 1; -} - -int g_qglMajorVersion = 0; -int g_qglMinorVersion = 0; - -// requires a valid gl context -void QGL_InitVersion() -{ -#if EXTENSIONS_ENABLED - const std::size_t versionSize = 256; - char version[versionSize]; - strncpy(version, reinterpret_cast(GlobalOpenGL().m_glGetString(GL_VERSION)), versionSize - 1); - version[versionSize - 1] = '\0'; - char* firstDot = strchr(version, '.'); - ASSERT_NOTNULL(firstDot); - *firstDot = '\0'; - g_qglMajorVersion = atoi(version); - char* secondDot = strchr(firstDot + 1, '.'); - if(secondDot != 0) - { - *secondDot = '\0'; - } - g_qglMinorVersion = atoi(firstDot + 1); -#else - g_qglMajorVersion = 1; - g_qglMinorVersion = 1; -#endif -} - - -inline void extension_not_implemented(const char* extension) -{ - globalErrorStream() << "WARNING: OpenGL driver reports support for " << extension << " but does not implement it\n"; -} - -float g_maxTextureAnisotropy; - -float QGL_maxTextureAnisotropy() -{ - return g_maxTextureAnisotropy; -} - -void QGL_sharedContextCreated(OpenGLBinding& table) -{ - QGL_InitVersion(); - - table.major_version = g_qglMajorVersion; - table.minor_version = g_qglMinorVersion; - - table.m_glAccum = glAccum; - table.m_glAlphaFunc = glAlphaFunc; - table.m_glAreTexturesResident = glAreTexturesResident; - table.m_glArrayElement = glArrayElement; - table.m_glBegin = glBegin; - table.m_glBindTexture = glBindTexture; - table.m_glBitmap = glBitmap; - table.m_glBlendFunc = glBlendFunc; - table.m_glCallList = glCallList; - table.m_glCallLists = glCallLists; - table.m_glClear = glClear; - table.m_glClearAccum = glClearAccum; - table.m_glClearColor = glClearColor; - table.m_glClearDepth = glClearDepth; - table.m_glClearIndex = glClearIndex; - table.m_glClearStencil = glClearStencil; - table.m_glClipPlane = glClipPlane; - table.m_glColor3b = glColor3b; - table.m_glColor3bv = glColor3bv; - table.m_glColor3d = glColor3d; - table.m_glColor3dv = glColor3dv; - table.m_glColor3f = glColor3f; - table.m_glColor3fv = glColor3fv; - table.m_glColor3i = glColor3i; - table.m_glColor3iv = glColor3iv; - table.m_glColor3s = glColor3s; - table.m_glColor3sv = glColor3sv; - table.m_glColor3ub = glColor3ub; - table.m_glColor3ubv = glColor3ubv; - table.m_glColor3ui = glColor3ui; - table.m_glColor3uiv = glColor3uiv; - table.m_glColor3us = glColor3us; - table.m_glColor3usv = glColor3usv; - table.m_glColor4b = glColor4b; - table.m_glColor4bv = glColor4bv; - table.m_glColor4d = glColor4d; - table.m_glColor4dv = glColor4dv; - table.m_glColor4f = glColor4f; - table.m_glColor4fv = glColor4fv; - table.m_glColor4i = glColor4i; - table.m_glColor4iv = glColor4iv; - table.m_glColor4s = glColor4s; - table.m_glColor4sv = glColor4sv; - table.m_glColor4ub = glColor4ub; - table.m_glColor4ubv = glColor4ubv; - table.m_glColor4ui = glColor4ui; - table.m_glColor4uiv = glColor4uiv; - table.m_glColor4us = glColor4us; - table.m_glColor4usv = glColor4usv; - table.m_glColorMask = glColorMask; - table.m_glColorMaterial = glColorMaterial; - table.m_glColorPointer = glColorPointer; - table.m_glCopyPixels = glCopyPixels; - table.m_glCopyTexImage1D = glCopyTexImage1D; - table.m_glCopyTexImage2D = glCopyTexImage2D; - table.m_glCopyTexSubImage1D = glCopyTexSubImage1D; - table.m_glCopyTexSubImage2D = glCopyTexSubImage2D; - table.m_glCullFace = glCullFace; - table.m_glDeleteLists = glDeleteLists; - table.m_glDeleteTextures = glDeleteTextures; - table.m_glDepthFunc = glDepthFunc; - table.m_glDepthMask = glDepthMask; - table.m_glDepthRange = glDepthRange; - table.m_glDisable = glDisable; - table.m_glDisableClientState = glDisableClientState; - table.m_glDrawArrays = glDrawArrays; - table.m_glDrawBuffer = glDrawBuffer; - table.m_glDrawElements = glDrawElements; - table.m_glDrawPixels = glDrawPixels; - table.m_glEdgeFlag = glEdgeFlag; - table.m_glEdgeFlagPointer = glEdgeFlagPointer; - table.m_glEdgeFlagv = glEdgeFlagv; - table.m_glEnable = glEnable; - table.m_glEnableClientState = glEnableClientState; - table.m_glEnd = glEnd; - table.m_glEndList = glEndList; - table.m_glEvalCoord1d = glEvalCoord1d; - table.m_glEvalCoord1dv = glEvalCoord1dv; - table.m_glEvalCoord1f = glEvalCoord1f; - table.m_glEvalCoord1fv = glEvalCoord1fv; - table.m_glEvalCoord2d = glEvalCoord2d; - table.m_glEvalCoord2dv = glEvalCoord2dv; - table.m_glEvalCoord2f = glEvalCoord2f; - table.m_glEvalCoord2fv = glEvalCoord2fv; - table.m_glEvalMesh1 = glEvalMesh1; - table.m_glEvalMesh2 = glEvalMesh2; - table.m_glEvalPoint1 = glEvalPoint1; - table.m_glEvalPoint2 = glEvalPoint2; - table.m_glFeedbackBuffer = glFeedbackBuffer; - table.m_glFinish = glFinish; - table.m_glFlush = glFlush; - table.m_glFogf = glFogf; - table.m_glFogfv = glFogfv; - table.m_glFogi = glFogi; - table.m_glFogiv = glFogiv; - table.m_glFrontFace = glFrontFace; - table.m_glFrustum = glFrustum; - table.m_glGenLists = glGenLists; - table.m_glGenTextures = glGenTextures; - table.m_glGetBooleanv = glGetBooleanv; - table.m_glGetClipPlane = glGetClipPlane; - table.m_glGetDoublev = glGetDoublev; - table.m_glGetError = glGetError; - table.m_glGetFloatv = glGetFloatv; - table.m_glGetIntegerv = glGetIntegerv; - table.m_glGetLightfv = glGetLightfv; - table.m_glGetLightiv = glGetLightiv; - table.m_glGetMapdv = glGetMapdv; - table.m_glGetMapfv = glGetMapfv; - table.m_glGetMapiv = glGetMapiv; - table.m_glGetMaterialfv = glGetMaterialfv; - table.m_glGetMaterialiv = glGetMaterialiv; - table.m_glGetPixelMapfv = glGetPixelMapfv; - table.m_glGetPixelMapuiv = glGetPixelMapuiv; - table.m_glGetPixelMapusv = glGetPixelMapusv; - table.m_glGetPointerv = glGetPointerv; - table.m_glGetPolygonStipple = glGetPolygonStipple; - table.m_glGetString = glGetString; - table.m_glGetTexEnvfv = glGetTexEnvfv; - table.m_glGetTexEnviv = glGetTexEnviv; - table.m_glGetTexGendv = glGetTexGendv; - table.m_glGetTexGenfv = glGetTexGenfv; - table.m_glGetTexGeniv = glGetTexGeniv; - table.m_glGetTexImage = glGetTexImage; - table.m_glGetTexLevelParameterfv = glGetTexLevelParameterfv; - table.m_glGetTexLevelParameteriv = glGetTexLevelParameteriv; - table.m_glGetTexParameterfv = glGetTexParameterfv; - table.m_glGetTexParameteriv = glGetTexParameteriv; - table.m_glHint = glHint; - table.m_glIndexMask = glIndexMask; - table.m_glIndexPointer = glIndexPointer; - table.m_glIndexd = glIndexd; - table.m_glIndexdv = glIndexdv; - table.m_glIndexf = glIndexf; - table.m_glIndexfv = glIndexfv; - table.m_glIndexi = glIndexi; - table.m_glIndexiv = glIndexiv; - table.m_glIndexs = glIndexs; - table.m_glIndexsv = glIndexsv; - table.m_glIndexub = glIndexub; - table.m_glIndexubv = glIndexubv; - table.m_glInitNames = glInitNames; - table.m_glInterleavedArrays = glInterleavedArrays; - table.m_glIsEnabled = glIsEnabled; - table.m_glIsList = glIsList; - table.m_glIsTexture = glIsTexture; - table.m_glLightModelf = glLightModelf; - table.m_glLightModelfv = glLightModelfv; - table.m_glLightModeli = glLightModeli; - table.m_glLightModeliv = glLightModeliv; - table.m_glLightf = glLightf; - table.m_glLightfv = glLightfv; - table.m_glLighti = glLighti; - table.m_glLightiv = glLightiv; - table.m_glLineStipple = glLineStipple; - table.m_glLineWidth = glLineWidth; - table.m_glListBase = glListBase; - table.m_glLoadIdentity = glLoadIdentity; - table.m_glLoadMatrixd = glLoadMatrixd; - table.m_glLoadMatrixf = glLoadMatrixf; - table.m_glLoadName = glLoadName; - table.m_glLogicOp = glLogicOp; - table.m_glMap1d = glMap1d; - table.m_glMap1f = glMap1f; - table.m_glMap2d = glMap2d; - table.m_glMap2f = glMap2f; - table.m_glMapGrid1d = glMapGrid1d; - table.m_glMapGrid1f = glMapGrid1f; - table.m_glMapGrid2d = glMapGrid2d; - table.m_glMapGrid2f = glMapGrid2f; - table.m_glMaterialf = glMaterialf; - table.m_glMaterialfv = glMaterialfv; - table.m_glMateriali = glMateriali; - table.m_glMaterialiv = glMaterialiv; - table.m_glMatrixMode = glMatrixMode; - table.m_glMultMatrixd = glMultMatrixd; - table.m_glMultMatrixf = glMultMatrixf; - table.m_glNewList = glNewList; - table.m_glNormal3b = glNormal3b; - table.m_glNormal3bv = glNormal3bv; - table.m_glNormal3d = glNormal3d; - table.m_glNormal3dv = glNormal3dv; - table.m_glNormal3f = glNormal3f; - table.m_glNormal3fv = glNormal3fv; - table.m_glNormal3i = glNormal3i; - table.m_glNormal3iv = glNormal3iv; - table.m_glNormal3s = glNormal3s; - table.m_glNormal3sv = glNormal3sv; - table.m_glNormalPointer = glNormalPointer; - table.m_glOrtho = glOrtho; - table.m_glPassThrough = glPassThrough; - table.m_glPixelMapfv = glPixelMapfv; - table.m_glPixelMapuiv = glPixelMapuiv; - table.m_glPixelMapusv = glPixelMapusv; - table.m_glPixelStoref = glPixelStoref; - table.m_glPixelStorei = glPixelStorei; - table.m_glPixelTransferf = glPixelTransferf; - table.m_glPixelTransferi = glPixelTransferi; - table.m_glPixelZoom = glPixelZoom; - table.m_glPointSize = glPointSize; - table.m_glPolygonMode = glPolygonMode; - table.m_glPolygonOffset = glPolygonOffset; - table.m_glPolygonStipple = glPolygonStipple; - table.m_glPopAttrib = glPopAttrib; - table.m_glPopClientAttrib = glPopClientAttrib; - table.m_glPopMatrix = glPopMatrix; - table.m_glPopName = glPopName; - table.m_glPrioritizeTextures = glPrioritizeTextures; - table.m_glPushAttrib = glPushAttrib; - table.m_glPushClientAttrib = glPushClientAttrib; - table.m_glPushMatrix = glPushMatrix; - table.m_glPushName = glPushName; - table.m_glRasterPos2d = glRasterPos2d; - table.m_glRasterPos2dv = glRasterPos2dv; - table.m_glRasterPos2f = glRasterPos2f; - table.m_glRasterPos2fv = glRasterPos2fv; - table.m_glRasterPos2i = glRasterPos2i; - table.m_glRasterPos2iv = glRasterPos2iv; - table.m_glRasterPos2s = glRasterPos2s; - table.m_glRasterPos2sv = glRasterPos2sv; - table.m_glRasterPos3d = glRasterPos3d; - table.m_glRasterPos3dv = glRasterPos3dv; - table.m_glRasterPos3f = glRasterPos3f; - table.m_glRasterPos3fv = glRasterPos3fv; - table.m_glRasterPos3i = glRasterPos3i; - table.m_glRasterPos3iv = glRasterPos3iv; - table.m_glRasterPos3s = glRasterPos3s; - table.m_glRasterPos3sv = glRasterPos3sv; - table.m_glRasterPos4d = glRasterPos4d; - table.m_glRasterPos4dv = glRasterPos4dv; - table.m_glRasterPos4f = glRasterPos4f; - table.m_glRasterPos4fv = glRasterPos4fv; - table.m_glRasterPos4i = glRasterPos4i; - table.m_glRasterPos4iv = glRasterPos4iv; - table.m_glRasterPos4s = glRasterPos4s; - table.m_glRasterPos4sv = glRasterPos4sv; - table.m_glReadBuffer = glReadBuffer; - table.m_glReadPixels = glReadPixels; - table.m_glRectd = glRectd; - table.m_glRectdv = glRectdv; - table.m_glRectf = glRectf; - table.m_glRectfv = glRectfv; - table.m_glRecti = glRecti; - table.m_glRectiv = glRectiv; - table.m_glRects = glRects; - table.m_glRectsv = glRectsv; - table.m_glRenderMode = glRenderMode; - table.m_glRotated = glRotated; - table.m_glRotatef = glRotatef; - table.m_glScaled = glScaled; - table.m_glScalef = glScalef; - table.m_glScissor = glScissor; - table.m_glSelectBuffer = glSelectBuffer; - table.m_glShadeModel = glShadeModel; - table.m_glStencilFunc = glStencilFunc; - table.m_glStencilMask = glStencilMask; - table.m_glStencilOp = glStencilOp; - table.m_glTexCoord1d = glTexCoord1d; - table.m_glTexCoord1dv = glTexCoord1dv; - table.m_glTexCoord1f = glTexCoord1f; - table.m_glTexCoord1fv = glTexCoord1fv; - table.m_glTexCoord1i = glTexCoord1i; - table.m_glTexCoord1iv = glTexCoord1iv; - table.m_glTexCoord1s = glTexCoord1s; - table.m_glTexCoord1sv = glTexCoord1sv; - table.m_glTexCoord2d = glTexCoord2d; - table.m_glTexCoord2dv = glTexCoord2dv; - table.m_glTexCoord2f = glTexCoord2f; - table.m_glTexCoord2fv = glTexCoord2fv; - table.m_glTexCoord2i = glTexCoord2i; - table.m_glTexCoord2iv = glTexCoord2iv; - table.m_glTexCoord2s = glTexCoord2s; - table.m_glTexCoord2sv = glTexCoord2sv; - table.m_glTexCoord3d = glTexCoord3d; - table.m_glTexCoord3dv = glTexCoord3dv; - table.m_glTexCoord3f = glTexCoord3f; - table.m_glTexCoord3fv = glTexCoord3fv; - table.m_glTexCoord3i = glTexCoord3i; - table.m_glTexCoord3iv = glTexCoord3iv; - table.m_glTexCoord3s = glTexCoord3s; - table.m_glTexCoord3sv = glTexCoord3sv; - table.m_glTexCoord4d = glTexCoord4d; - table.m_glTexCoord4dv = glTexCoord4dv; - table.m_glTexCoord4f = glTexCoord4f; - table.m_glTexCoord4fv = glTexCoord4fv; - table.m_glTexCoord4i = glTexCoord4i; - table.m_glTexCoord4iv = glTexCoord4iv; - table.m_glTexCoord4s = glTexCoord4s; - table.m_glTexCoord4sv = glTexCoord4sv; - table.m_glTexCoordPointer = glTexCoordPointer; - table.m_glTexEnvf = glTexEnvf; - table.m_glTexEnvfv = glTexEnvfv; - table.m_glTexEnvi = glTexEnvi; - table.m_glTexEnviv = glTexEnviv; - table.m_glTexGend = glTexGend; - table.m_glTexGendv = glTexGendv; - table.m_glTexGenf = glTexGenf; - table.m_glTexGenfv = glTexGenfv; - table.m_glTexGeni = glTexGeni; - table.m_glTexGeniv = glTexGeniv; - table.m_glTexImage1D = glTexImage1D; - table.m_glTexImage2D = glTexImage2D; - table.m_glTexParameterf = glTexParameterf; - table.m_glTexParameterfv = glTexParameterfv; - table.m_glTexParameteri = glTexParameteri; - table.m_glTexParameteriv = glTexParameteriv; - table.m_glTexSubImage1D = glTexSubImage1D; - table.m_glTexSubImage2D = glTexSubImage2D; - table.m_glTranslated = glTranslated; - table.m_glTranslatef = glTranslatef; - table.m_glVertex2d = glVertex2d; - table.m_glVertex2dv = glVertex2dv; - table.m_glVertex2f = glVertex2f; - table.m_glVertex2fv = glVertex2fv; - table.m_glVertex2i = glVertex2i; - table.m_glVertex2iv = glVertex2iv; - table.m_glVertex2s = glVertex2s; - table.m_glVertex2sv = glVertex2sv; - table.m_glVertex3d = glVertex3d; - table.m_glVertex3dv = glVertex3dv; - table.m_glVertex3f = glVertex3f; - table.m_glVertex3fv = glVertex3fv; - table.m_glVertex3i = glVertex3i; - table.m_glVertex3iv = glVertex3iv; - table.m_glVertex3s = glVertex3s; - table.m_glVertex3sv = glVertex3sv; - table.m_glVertex4d = glVertex4d; - table.m_glVertex4dv = glVertex4dv; - table.m_glVertex4f = glVertex4f; - table.m_glVertex4fv = glVertex4fv; - table.m_glVertex4i = glVertex4i; - table.m_glVertex4iv = glVertex4iv; - table.m_glVertex4s = glVertex4s; - table.m_glVertex4sv = glVertex4sv; - table.m_glVertexPointer = glVertexPointer; - table.m_glViewport = glViewport; - - if(QGL_ExtensionSupported("GL_ARB_multitexture")) - { - table.support_ARB_multitexture = - QGL_constructExtensionFunc(table.m_glActiveTextureARB, "glActiveTextureARB") - && QGL_constructExtensionFunc(table.m_glClientActiveTextureARB, "glClientActiveTextureARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1dARB, "glMultiTexCoord1dARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1fARB, "glMultiTexCoord1fARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1iARB, "glMultiTexCoord1iARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1sARB, "glMultiTexCoord1sARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1svARB, "glMultiTexCoord1svARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2dARB, "glMultiTexCoord2dARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2fARB, "glMultiTexCoord2fARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2iARB, "glMultiTexCoord2iARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2sARB, "glMultiTexCoord2sARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2svARB, "glMultiTexCoord2svARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3dARB, "glMultiTexCoord3dARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3fARB, "glMultiTexCoord3fARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3iARB, "glMultiTexCoord3iARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3sARB, "glMultiTexCoord3sARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3svARB, "glMultiTexCoord3svARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4dARB, "glMultiTexCoord4dARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4fARB, "glMultiTexCoord4fARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4iARB, "glMultiTexCoord4iARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4sARB, "glMultiTexCoord4sARB") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4svARB, "glMultiTexCoord4svARB"); - - if(!table.support_ARB_multitexture) - { - extension_not_implemented("GL_ARB_multitexture"); - } - } - else - { - table.support_ARB_multitexture = false; - } - - if(QGL_ExtensionSupported("GL_ARB_texture_compression")) - { - table.support_ARB_texture_compression = - QGL_constructExtensionFunc(table.m_glCompressedTexImage3DARB, "glCompressedTexImage3DARB") - && QGL_constructExtensionFunc(table.m_glCompressedTexImage2DARB, "glCompressedTexImage2DARB") - && QGL_constructExtensionFunc(table.m_glCompressedTexImage1DARB, "glCompressedTexImage1DARB") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage3DARB, "glCompressedTexSubImage3DARB") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage2DARB, "glCompressedTexSubImage2DARB") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage1DARB, "glCompressedTexSubImage1DARB") - && QGL_constructExtensionFunc(table.m_glGetCompressedTexImageARB, "glGetCompressedTexImageARB"); - - if(!table.support_ARB_texture_compression) - { - extension_not_implemented("GL_ARB_texture_compression"); - } - } - else - { - table.support_ARB_texture_compression = false; - } - - table.support_EXT_texture_compression_s3tc = QGL_ExtensionSupported("GL_EXT_texture_compression_s3tc"); - - // GL 1.2 - if(table.major_version > 1 || table.minor_version >= 2) - { - table.support_GL_1_2 = - QGL_constructExtensionFunc(table.m_glCopyTexSubImage3D, "glCopyTexSubImage3D") - && QGL_constructExtensionFunc(table.m_glDrawRangeElements, "glDrawRangeElements") - && QGL_constructExtensionFunc(table.m_glTexImage3D, "glTexImage3D") - && QGL_constructExtensionFunc(table.m_glTexSubImage3D, "glTexSubImage3D"); - - if(!table.support_GL_1_2) - { - extension_not_implemented("GL_VERSION_1_2"); - } - } - else - { - table.support_GL_1_2 = false; - } - - // GL 1.3 - if(table.major_version > 1 || table.minor_version >= 3) - { - table.support_GL_1_3 = - QGL_constructExtensionFunc(table.m_glActiveTexture, "glActiveTexture") - && QGL_constructExtensionFunc(table.m_glClientActiveTexture, "glClientActiveTexture") - && QGL_constructExtensionFunc(table.m_glCompressedTexImage1D, "glCompressedTexImage1D") - && QGL_constructExtensionFunc(table.m_glCompressedTexImage2D, "glCompressedTexImage2D") - && QGL_constructExtensionFunc(table.m_glCompressedTexImage3D, "glCompressedTexImage3D") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage1D, "glCompressedTexSubImage1D") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage2D, "glCompressedTexSubImage2D") - && QGL_constructExtensionFunc(table.m_glCompressedTexSubImage3D, "glCompressedTexSubImage3D") - && QGL_constructExtensionFunc(table.m_glGetCompressedTexImage, "glGetCompressedTexImage") - && QGL_constructExtensionFunc(table.m_glLoadTransposeMatrixd, "glLoadTransposeMatrixd") - && QGL_constructExtensionFunc(table.m_glLoadTransposeMatrixf, "glLoadTransposeMatrixf") - && QGL_constructExtensionFunc(table.m_glMultTransposeMatrixd, "glMultTransposeMatrixd") - && QGL_constructExtensionFunc(table.m_glMultTransposeMatrixf, "glMultTransposeMatrixf") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1d, "glMultiTexCoord1d") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1dv, "glMultiTexCoord1dv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1f, "glMultiTexCoord1f") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1fv, "glMultiTexCoord1fv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1i, "glMultiTexCoord1i") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1iv, "glMultiTexCoord1iv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1s, "glMultiTexCoord1s") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord1sv, "glMultiTexCoord1sv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2d, "glMultiTexCoord2d") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2dv, "glMultiTexCoord2dv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2f, "glMultiTexCoord2f") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2fv, "glMultiTexCoord2fv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2i, "glMultiTexCoord2i") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2iv, "glMultiTexCoord2iv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2s, "glMultiTexCoord2s") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord2sv, "glMultiTexCoord2sv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3d, "glMultiTexCoord3d") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3dv, "glMultiTexCoord3dv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3f, "glMultiTexCoord3f") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3fv, "glMultiTexCoord3fv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3i, "glMultiTexCoord3i") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3iv, "glMultiTexCoord3iv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3s, "glMultiTexCoord3s") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord3sv, "glMultiTexCoord3sv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4d, "glMultiTexCoord4d") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4dv, "glMultiTexCoord4dv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4f, "glMultiTexCoord4f") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4fv, "glMultiTexCoord4fv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4i, "glMultiTexCoord4i") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4iv, "glMultiTexCoord4iv") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4s, "glMultiTexCoord4s") - && QGL_constructExtensionFunc(table.m_glMultiTexCoord4sv, "glMultiTexCoord4sv") - && QGL_constructExtensionFunc(table.m_glSampleCoverage, "glSampleCoverage"); - - if(!table.support_GL_1_3) - { - extension_not_implemented("GL_VERSION_1_3"); - } - } - else - { - table.support_GL_1_3 = false; - } - - // GL 1.4 - if(table.major_version > 1 || table.minor_version >= 4) - { - table.support_GL_1_4 = - QGL_constructExtensionFunc(table.m_glBlendColor, "glBlendColor") - && QGL_constructExtensionFunc(table.m_glBlendEquation, "glBlendEquation") - && QGL_constructExtensionFunc(table.m_glBlendFuncSeparate, "glBlendFuncSeparate") - && QGL_constructExtensionFunc(table.m_glFogCoordPointer, "glFogCoordPointer") - && QGL_constructExtensionFunc(table.m_glFogCoordd, "glFogCoordd") - && QGL_constructExtensionFunc(table.m_glFogCoorddv, "glFogCoorddv") - && QGL_constructExtensionFunc(table.m_glFogCoordf, "glFogCoordf") - && QGL_constructExtensionFunc(table.m_glFogCoordfv, "glFogCoordfv") - && QGL_constructExtensionFunc(table.m_glMultiDrawArrays, "glMultiDrawArrays") - && QGL_constructExtensionFunc(table.m_glMultiDrawElements, "glMultiDrawElements") - && QGL_constructExtensionFunc(table.m_glPointParameterf, "glPointParameterf") - && QGL_constructExtensionFunc(table.m_glPointParameterfv, "glPointParameterfv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3b, "glSecondaryColor3b") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3bv, "glSecondaryColor3bv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3d, "glSecondaryColor3d") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3dv, "glSecondaryColor3dv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3f, "glSecondaryColor3f") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3fv, "glSecondaryColor3fv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3i, "glSecondaryColor3i") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3iv, "glSecondaryColor3iv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3s, "glSecondaryColor3s") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3sv, "glSecondaryColor3sv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3ub, "glSecondaryColor3ub") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3ubv, "glSecondaryColor3ubv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3ui, "glSecondaryColor3ui") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3uiv, "glSecondaryColor3uiv") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3us, "glSecondaryColor3us") - && QGL_constructExtensionFunc(table.m_glSecondaryColor3usv, "glSecondaryColor3usv") - && QGL_constructExtensionFunc(table.m_glSecondaryColorPointer, "glSecondaryColorPointer") - && QGL_constructExtensionFunc(table.m_glWindowPos2d, "glWindowPos2d") - && QGL_constructExtensionFunc(table.m_glWindowPos2dv, "glWindowPos2dv") - && QGL_constructExtensionFunc(table.m_glWindowPos2f, "glWindowPos2f") - && QGL_constructExtensionFunc(table.m_glWindowPos2fv, "glWindowPos2fv") - && QGL_constructExtensionFunc(table.m_glWindowPos2i, "glWindowPos2i") - && QGL_constructExtensionFunc(table.m_glWindowPos2iv, "glWindowPos2iv") - && QGL_constructExtensionFunc(table.m_glWindowPos2s, "glWindowPos2s") - && QGL_constructExtensionFunc(table.m_glWindowPos2sv, "glWindowPos2sv") - && QGL_constructExtensionFunc(table.m_glWindowPos3d, "glWindowPos3d") - && QGL_constructExtensionFunc(table.m_glWindowPos3dv, "glWindowPos3dv") - && QGL_constructExtensionFunc(table.m_glWindowPos3f, "glWindowPos3f") - && QGL_constructExtensionFunc(table.m_glWindowPos3fv, "glWindowPos3fv") - && QGL_constructExtensionFunc(table.m_glWindowPos3i, "glWindowPos3i") - && QGL_constructExtensionFunc(table.m_glWindowPos3iv, "glWindowPos3iv") - && QGL_constructExtensionFunc(table.m_glWindowPos3s, "glWindowPos3s") - && QGL_constructExtensionFunc(table.m_glWindowPos3sv, "glWindowPos3sv"); - - if(!table.support_GL_1_4) - { - extension_not_implemented("GL_VERSION_1_4"); - } - } - else - { - table.support_GL_1_4 = false; - } - - // GL 1.5 - if(table.major_version > 1 || table.minor_version >= 5) - { - table.support_GL_1_5 = - QGL_constructExtensionFunc(table.m_glBeginQuery, "glBeginQuery") - && QGL_constructExtensionFunc(table.m_glBindBuffer, "glBindBuffer") - && QGL_constructExtensionFunc(table.m_glBufferData, "glBufferData") - && QGL_constructExtensionFunc(table.m_glBufferSubData, "glBufferSubData") - && QGL_constructExtensionFunc(table.m_glDeleteBuffers, "glDeleteBuffers") - && QGL_constructExtensionFunc(table.m_glDeleteQueries, "glDeleteQueries") - && QGL_constructExtensionFunc(table.m_glEndQuery, "glEndQuery") - && QGL_constructExtensionFunc(table.m_glGenBuffers, "glGenBuffers") - && QGL_constructExtensionFunc(table.m_glGenQueries, "glGenQueries") - && QGL_constructExtensionFunc(table.m_glGetBufferParameteriv, "glGetBufferParameteriv") - && QGL_constructExtensionFunc(table.m_glGetBufferPointerv, "glGetBufferPointerv") - && QGL_constructExtensionFunc(table.m_glGetBufferSubData, "glGetBufferSubData") - && QGL_constructExtensionFunc(table.m_glGetQueryObjectiv, "glGetQueryObjectiv") - && QGL_constructExtensionFunc(table.m_glGetQueryObjectuiv, "glGetQueryObjectuiv") - && QGL_constructExtensionFunc(table.m_glGetQueryiv, "glGetQueryiv") - && QGL_constructExtensionFunc(table.m_glIsBuffer, "glIsBuffer") - && QGL_constructExtensionFunc(table.m_glIsQuery, "glIsQuery") - && QGL_constructExtensionFunc(table.m_glMapBuffer, "glMapBuffer") - && QGL_constructExtensionFunc(table.m_glUnmapBuffer, "glUnmapBuffer"); - - if(!table.support_GL_1_5) - { - extension_not_implemented("GL_VERSION_1_5"); - } - } - else - { - table.support_GL_1_5 = false; - } - - - if(QGL_ExtensionSupported("GL_ARB_vertex_program")) - { - table.support_ARB_vertex_program = - QGL_constructExtensionFunc(table.m_glVertexAttrib1sARB, "glVertexAttrib1sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1fARB, "glVertexAttrib1fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1dARB, "glVertexAttrib1dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2sARB, "glVertexAttrib2sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fARB, "glVertexAttrib2fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2dARB, "glVertexAttrib2dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3sARB, "glVertexAttrib3sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fARB, "glVertexAttrib3fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3dARB, "glVertexAttrib3dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4sARB, "glVertexAttrib4sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fARB, "glVertexAttrib4fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4dARB, "glVertexAttrib4dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NubARB, "glVertexAttrib4NubARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1svARB, "glVertexAttrib1svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1fvARB, "glVertexAttrib1fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1dvARB, "glVertexAttrib1dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2svARB, "glVertexAttrib2svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fvARB, "glVertexAttrib2fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2dvARB, "glVertexAttrib2dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3svARB, "glVertexAttrib3svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fvARB, "glVertexAttrib3fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3dvARB, "glVertexAttrib3dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4bvARB, "glVertexAttrib4bvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4svARB, "glVertexAttrib4svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4ivARB, "glVertexAttrib4ivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4ubvARB, "glVertexAttrib4ubvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4usvARB, "glVertexAttrib4usvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4uivARB, "glVertexAttrib4uivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fvARB, "glVertexAttrib4fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4dvARB, "glVertexAttrib4dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NbvARB, "glVertexAttrib4NbvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NsvARB, "glVertexAttrib4NsvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NivARB, "glVertexAttrib4NivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NubvARB, "glVertexAttrib4NubvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NusvARB, "glVertexAttrib4NusvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NuivARB, "glVertexAttrib4NuivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttribPointerARB, "glVertexAttribPointerARB") - && QGL_constructExtensionFunc(table.m_glEnableVertexAttribArrayARB, "glEnableVertexAttribArrayARB") - && QGL_constructExtensionFunc(table.m_glDisableVertexAttribArrayARB, "glDisableVertexAttribArrayARB") - && QGL_constructExtensionFunc(table.m_glProgramStringARB, "glProgramStringARB") - && QGL_constructExtensionFunc(table.m_glBindProgramARB, "glBindProgramARB") - && QGL_constructExtensionFunc(table.m_glDeleteProgramsARB, "glDeleteProgramsARB") - && QGL_constructExtensionFunc(table.m_glGenProgramsARB, "glGenProgramsARB") - && QGL_constructExtensionFunc(table.m_glProgramEnvParameter4dARB, "glProgramEnvParameter4dARB") - && QGL_constructExtensionFunc(table.m_glProgramEnvParameter4dvARB, "glProgramEnvParameter4dvARB") - && QGL_constructExtensionFunc(table.m_glProgramEnvParameter4fARB, "glProgramEnvParameter4fARB") - && QGL_constructExtensionFunc(table.m_glProgramEnvParameter4fvARB, "glProgramEnvParameter4fvARB") - && QGL_constructExtensionFunc(table.m_glProgramLocalParameter4dARB, "glProgramLocalParameter4dARB") - && QGL_constructExtensionFunc(table.m_glProgramLocalParameter4dvARB, "glProgramLocalParameter4dvARB") - && QGL_constructExtensionFunc(table.m_glProgramLocalParameter4fARB, "glProgramLocalParameter4fARB") - && QGL_constructExtensionFunc(table.m_glProgramLocalParameter4fvARB, "glProgramLocalParameter4fvARB") - && QGL_constructExtensionFunc(table.m_glGetProgramEnvParameterdvARB, "glGetProgramEnvParameterdvARB") - && QGL_constructExtensionFunc(table.m_glGetProgramEnvParameterfvARB, "glGetProgramEnvParameterfvARB") - && QGL_constructExtensionFunc(table.m_glGetProgramLocalParameterdvARB, "glGetProgramLocalParameterdvARB") - && QGL_constructExtensionFunc(table.m_glGetProgramLocalParameterfvARB, "glGetProgramLocalParameterfvARB") - && QGL_constructExtensionFunc(table.m_glGetProgramivARB, "glGetProgramivARB") - && QGL_constructExtensionFunc(table.m_glGetProgramStringARB, "glGetProgramStringARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribdvARB, "glGetVertexAttribdvARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribfvARB, "glGetVertexAttribfvARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribivARB, "glGetVertexAttribivARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribPointervARB, "glGetVertexAttribPointervARB") - && QGL_constructExtensionFunc(table.m_glIsProgramARB, "glIsProgramARB"); - - if(!table.support_ARB_vertex_program) - { - extension_not_implemented("GL_ARB_vertex_program"); - } - } - else - { - table.support_ARB_vertex_program = false; - } - - - table.support_ARB_fragment_program = QGL_ExtensionSupported("GL_ARB_fragment_program"); - - if(QGL_ExtensionSupported("GL_ARB_shader_objects")) - { - table.support_ARB_shader_objects = - QGL_constructExtensionFunc(table.m_glDeleteObjectARB, "glDeleteObjectARB") - && QGL_constructExtensionFunc(table.m_glGetHandleARB, "glGetHandleARB") - && QGL_constructExtensionFunc(table.m_glDetachObjectARB, "glDetachObjectARB") - && QGL_constructExtensionFunc(table.m_glCreateShaderObjectARB, "glCreateShaderObjectARB") - && QGL_constructExtensionFunc(table.m_glShaderSourceARB, "glShaderSourceARB") - && QGL_constructExtensionFunc(table.m_glCompileShaderARB, "glCompileShaderARB") - && QGL_constructExtensionFunc(table.m_glCreateProgramObjectARB, "glCreateProgramObjectARB") - && QGL_constructExtensionFunc(table.m_glAttachObjectARB, "glAttachObjectARB") - && QGL_constructExtensionFunc(table.m_glLinkProgramARB, "glLinkProgramARB") - && QGL_constructExtensionFunc(table.m_glUseProgramObjectARB, "glUseProgramObjectARB") - && QGL_constructExtensionFunc(table.m_glValidateProgramARB, "glValidateProgramARB") - && QGL_constructExtensionFunc(table.m_glUniform1fARB, "glUniform1fARB") - && QGL_constructExtensionFunc(table.m_glUniform2fARB, "glUniform2fARB") - && QGL_constructExtensionFunc(table.m_glUniform3fARB, "glUniform3fARB") - && QGL_constructExtensionFunc(table.m_glUniform4fARB, "glUniform4fARB") - && QGL_constructExtensionFunc(table.m_glUniform1iARB, "glUniform1iARB") - && QGL_constructExtensionFunc(table.m_glUniform2iARB, "glUniform2iARB") - && QGL_constructExtensionFunc(table.m_glUniform3iARB, "glUniform3iARB") - && QGL_constructExtensionFunc(table.m_glUniform4iARB, "glUniform4iARB") - && QGL_constructExtensionFunc(table.m_glUniform1fvARB, "glUniform1fvARB") - && QGL_constructExtensionFunc(table.m_glUniform2fvARB, "glUniform2fvARB") - && QGL_constructExtensionFunc(table.m_glUniform3fvARB, "glUniform3fvARB") - && QGL_constructExtensionFunc(table.m_glUniform4fvARB, "glUniform4fvARB") - && QGL_constructExtensionFunc(table.m_glUniform1ivARB, "glUniform1ivARB") - && QGL_constructExtensionFunc(table.m_glUniform2ivARB, "glUniform2ivARB") - && QGL_constructExtensionFunc(table.m_glUniform3ivARB, "glUniform3ivARB") - && QGL_constructExtensionFunc(table.m_glUniform4ivARB, "glUniform4ivARB") - && QGL_constructExtensionFunc(table.m_glUniformMatrix2fvARB, "glUniformMatrix2fvARB") - && QGL_constructExtensionFunc(table.m_glUniformMatrix3fvARB, "glUniformMatrix3fvARB") - && QGL_constructExtensionFunc(table.m_glUniformMatrix4fvARB, "glUniformMatrix4fvARB") - && QGL_constructExtensionFunc(table.m_glGetObjectParameterfvARB, "glGetObjectParameterfvARB") - && QGL_constructExtensionFunc(table.m_glGetObjectParameterivARB, "glGetObjectParameterivARB") - && QGL_constructExtensionFunc(table.m_glGetInfoLogARB, "glGetInfoLogARB") - && QGL_constructExtensionFunc(table.m_glGetAttachedObjectsARB, "glGetAttachedObjectsARB") - && QGL_constructExtensionFunc(table.m_glGetUniformLocationARB, "glGetUniformLocationARB") - && QGL_constructExtensionFunc(table.m_glGetActiveUniformARB, "glGetActiveUniformARB") - && QGL_constructExtensionFunc(table.m_glGetUniformfvARB, "glGetUniformfvARB") - && QGL_constructExtensionFunc(table.m_glGetUniformivARB, "glGetUniformivARB") - && QGL_constructExtensionFunc(table.m_glGetShaderSourceARB, "glGetShaderSourceARB"); - - if(!table.support_ARB_shader_objects) - { - extension_not_implemented("GL_ARB_shader_objects"); - } - } - else - { - table.support_ARB_shader_objects = false; - } - - if(QGL_ExtensionSupported("GL_ARB_vertex_shader")) - { - table.support_ARB_vertex_shader = - QGL_constructExtensionFunc(table.m_glVertexAttrib1fARB, "glVertexAttrib1fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1sARB, "glVertexAttrib1sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1dARB, "glVertexAttrib1dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fARB, "glVertexAttrib2fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2sARB, "glVertexAttrib2sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2dARB, "glVertexAttrib2dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fARB, "glVertexAttrib3fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3sARB, "glVertexAttrib3sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3dARB, "glVertexAttrib3dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fARB, "glVertexAttrib4fARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4sARB, "glVertexAttrib4sARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4dARB, "glVertexAttrib4dARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NubARB, "glVertexAttrib4NubARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1fvARB, "glVertexAttrib1fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1svARB, "glVertexAttrib1svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1dvARB, "glVertexAttrib1dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fvARB, "glVertexAttrib2fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2svARB, "glVertexAttrib2svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2dvARB, "glVertexAttrib2dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fvARB, "glVertexAttrib3fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3svARB, "glVertexAttrib3svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3dvARB, "glVertexAttrib3dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fvARB, "glVertexAttrib4fvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4svARB, "glVertexAttrib4svARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4dvARB, "glVertexAttrib4dvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4ivARB, "glVertexAttrib4ivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4bvARB, "glVertexAttrib4bvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4ubvARB, "glVertexAttrib4ubvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4usvARB, "glVertexAttrib4usvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4uivARB, "glVertexAttrib4uivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NbvARB, "glVertexAttrib4NbvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NsvARB, "glVertexAttrib4NsvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NivARB, "glVertexAttrib4NivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NubvARB, "glVertexAttrib4NubvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NusvARB, "glVertexAttrib4NusvARB") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4NuivARB, "glVertexAttrib4NuivARB") - && QGL_constructExtensionFunc(table.m_glVertexAttribPointerARB, "glVertexAttribPointerARB") - && QGL_constructExtensionFunc(table.m_glEnableVertexAttribArrayARB, "glEnableVertexAttribArrayARB") - && QGL_constructExtensionFunc(table.m_glDisableVertexAttribArrayARB, "glDisableVertexAttribArrayARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribdvARB, "glGetVertexAttribdvARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribfvARB, "glGetVertexAttribfvARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribivARB, "glGetVertexAttribivARB") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribPointervARB, "glGetVertexAttribPointervARB") - && QGL_constructExtensionFunc(table.m_glBindAttribLocationARB, "glBindAttribLocationARB") - && QGL_constructExtensionFunc(table.m_glGetActiveAttribARB, "glGetActiveAttribARB") - && QGL_constructExtensionFunc(table.m_glGetAttribLocationARB, "glGetAttribLocationARB"); - - if(!table.support_ARB_vertex_shader) - { - extension_not_implemented("GL_ARB_vertex_shader"); - } - } - else - { - table.support_ARB_vertex_shader = false; - } - - if(QGL_ExtensionSupported("GL_NV_vertex_program2")) - { - table.support_NV_vertex_program2 = - QGL_constructExtensionFunc(table.m_glAreProgramsResidentNV, "glAreProgramsResidentNV") - && QGL_constructExtensionFunc(table.m_glBindProgramNV, "glBindProgramNV") - && QGL_constructExtensionFunc(table.m_glDeleteProgramsNV, "glDeleteProgramsNV") - && QGL_constructExtensionFunc(table.m_glExecuteProgramNV, "glExecuteProgramNV") - && QGL_constructExtensionFunc(table.m_glGenProgramsNV, "glGenProgramsNV") - && QGL_constructExtensionFunc(table.m_glGetProgramParameterdvNV, "glGetProgramParameterdvNV") - && QGL_constructExtensionFunc(table.m_glGetProgramParameterfvNV, "glGetProgramParameterfvNV") - && QGL_constructExtensionFunc(table.m_glGetProgramivNV, "glGetProgramivNV") - && QGL_constructExtensionFunc(table.m_glGetProgramStringNV, "glGetProgramStringNV") - && QGL_constructExtensionFunc(table.m_glGetTrackMatrixivNV, "glGetTrackMatrixivNV") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribdvNV, "glGetVertexAttribdvNV") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribfvNV, "glGetVertexAttribfvNV") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribivNV, "glGetVertexAttribivNV") - && QGL_constructExtensionFunc(table.m_glGetVertexAttribPointervNV, "glGetVertexAttribPointervNV") - && QGL_constructExtensionFunc(table.m_glIsProgramNV, "glIsProgramNV") - && QGL_constructExtensionFunc(table.m_glLoadProgramNV, "glLoadProgramNV") - && QGL_constructExtensionFunc(table.m_glProgramParameter4fNV, "glProgramParameter4fNV") - && QGL_constructExtensionFunc(table.m_glProgramParameter4fvNV, "glProgramParameter4fvNV") - && QGL_constructExtensionFunc(table.m_glProgramParameters4fvNV, "glProgramParameters4fvNV") - && QGL_constructExtensionFunc(table.m_glRequestResidentProgramsNV, "glRequestResidentProgramsNV") - && QGL_constructExtensionFunc(table.m_glTrackMatrixNV, "glTrackMatrixNV") - && QGL_constructExtensionFunc(table.m_glVertexAttribPointerNV, "glVertexAttribPointerNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1fNV, "glVertexAttrib1fNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib1fvNV, "glVertexAttrib1fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fNV, "glVertexAttrib2fNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib2fvNV, "glVertexAttrib2fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fNV, "glVertexAttrib3fNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib3fvNV, "glVertexAttrib3fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fNV, "glVertexAttrib4fNV") - && QGL_constructExtensionFunc(table.m_glVertexAttrib4fvNV, "glVertexAttrib4fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttribs1fvNV, "glVertexAttribs1fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttribs2fvNV, "glVertexAttribs2fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttribs3fvNV, "glVertexAttribs3fvNV") - && QGL_constructExtensionFunc(table.m_glVertexAttribs4fvNV, "glVertexAttribs4fvNV"); - - if(!table.support_NV_vertex_program2) - { - extension_not_implemented("GL_NV_vertex_program2"); - } - } - else - { - table.support_NV_vertex_program2 = false; - QGL_invalidateExtensionFunc(table.m_glAreProgramsResidentNV); - QGL_invalidateExtensionFunc(table.m_glBindProgramNV); - QGL_invalidateExtensionFunc(table.m_glDeleteProgramsNV); - QGL_invalidateExtensionFunc(table.m_glExecuteProgramNV); - QGL_invalidateExtensionFunc(table.m_glGenProgramsNV); - QGL_invalidateExtensionFunc(table.m_glGetProgramParameterdvNV); - QGL_invalidateExtensionFunc(table.m_glGetProgramParameterfvNV); - QGL_invalidateExtensionFunc(table.m_glGetProgramivNV); - QGL_invalidateExtensionFunc(table.m_glGetProgramStringNV); - QGL_invalidateExtensionFunc(table.m_glGetTrackMatrixivNV); - QGL_invalidateExtensionFunc(table.m_glGetVertexAttribdvNV); - QGL_invalidateExtensionFunc(table.m_glGetVertexAttribfvNV); - QGL_invalidateExtensionFunc(table.m_glGetVertexAttribivNV); - QGL_invalidateExtensionFunc(table.m_glGetVertexAttribPointervNV); - QGL_invalidateExtensionFunc(table.m_glIsProgramNV); - QGL_invalidateExtensionFunc(table.m_glLoadProgramNV); - QGL_invalidateExtensionFunc(table.m_glProgramParameter4fNV); - QGL_invalidateExtensionFunc(table.m_glProgramParameter4fvNV); - QGL_invalidateExtensionFunc(table.m_glProgramParameters4fvNV); - QGL_invalidateExtensionFunc(table.m_glRequestResidentProgramsNV); - QGL_invalidateExtensionFunc(table.m_glTrackMatrixNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttribPointerNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib1fNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib1fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib2fNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib2fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib3fNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib3fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib4fNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttrib4fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttribs1fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttribs2fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttribs3fvNV); - QGL_invalidateExtensionFunc(table.m_glVertexAttribs4fvNV); - } - - if(QGL_ExtensionSupported("GL_NV_fragment_program")) - { - table.support_NV_fragment_program = - QGL_constructExtensionFunc(table.m_glProgramNamedParameter4fNV, "glProgramNamedParameter4fNV") - && QGL_constructExtensionFunc(table.m_glProgramNamedParameter4fvNV, "glProgramNamedParameter4fvNV") - && QGL_constructExtensionFunc(table.m_glGetProgramNamedParameterfvNV, "glGetProgramNamedParameterfvNV"); - - if(!table.support_NV_fragment_program) - { - extension_not_implemented("GL_NV_fragment_program"); - } - } - else - { - table.support_NV_fragment_program = false; - } - - table.support_ARB_fragment_shader = QGL_ExtensionSupported("GL_ARB_fragment_shader"); - table.support_ARB_shading_language_100 = QGL_ExtensionSupported("GL_ARB_shading_language_100"); - - if(QGL_ExtensionSupported("GL_EXT_texture_filter_anisotropic")) - { - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &g_maxTextureAnisotropy); - globalOutputStream() << "Anisotropic filtering possible (max " << g_maxTextureAnisotropy << "x)\n"; - } - else - { - globalOutputStream() << "No Anisotropic filtering available\n"; - } -} - -void QGL_sharedContextDestroyed(OpenGLBinding& table) -{ - QGL_clear(table); -} - - -void QGL_assertNoErrors() -{ - GLenum error = GlobalOpenGL().m_glGetError(); - while (error != GL_NO_ERROR) - { - const char* errorString = reinterpret_cast(qgluErrorString(error)); - if (error == GL_OUT_OF_MEMORY) - { - ERROR_MESSAGE("OpenGL out of memory error: " << errorString); - } - else - { - ERROR_MESSAGE("OpenGL error: " << errorString); - } - error = GlobalOpenGL().m_glGetError(); - } -} - - -class QglAPI -{ - OpenGLBinding m_qgl; -public: - typedef OpenGLBinding Type; - STRING_CONSTANT(Name, "*"); - - QglAPI() - { - QGL_Init(m_qgl); - - m_qgl.assertNoErrors = &QGL_assertNoErrors; - } - ~QglAPI() - { - QGL_Shutdown(m_qgl); - } - OpenGLBinding* getTable() - { - return &m_qgl; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule QglModule; -typedef Static StaticQglModule; -StaticRegisterModule staticRegisterQgl(StaticQglModule::instance()); diff --git a/radiant/qgl.h b/radiant/qgl.h index 55d1570e..faccdb2f 100644 --- a/radiant/qgl.h +++ b/radiant/qgl.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,15 +19,582 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_QGL_H) -#define INCLUDED_QGL_H +/* +** QGL.H +*/ -struct OpenGLBinding; -void QGL_sharedContextCreated(OpenGLBinding& table); -void QGL_sharedContextDestroyed(OpenGLBinding& table); +#ifndef __QGL_H__ +#define __QGL_H__ -bool QGL_ExtensionSupported(const char* extension); +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=812 +#define ATIHACK_812 -float QGL_maxTextureAnisotropy(); +#include + +#if defined (__linux__) || defined (__APPLE__) +#include +#endif + +#if defined (__APPLE__) +#include +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_VERSION_1_3 +// this is hacky, I'd recommend people having GL 1.3 headers instead +#define GL_COMPRESSED_RGBA 0x84EE +// RIANT +// this would be the appropriate place for this +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +int QGL_Init( const char *dllname, const char* pGluName ); +void QGL_InitExtensions (); +void QGL_Shutdown(); + +// silent query, see Sys_QGL_ExtensionSupported +int GL_ExtensionSupported (const char *extension); + +#ifndef APIENTRY +# define APIENTRY +#endif + +extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value); +extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref); +extern GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences); +extern void ( APIENTRY * qglArrayElement )(GLint i); +extern void ( APIENTRY * qglBegin )(GLenum mode); +extern void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture); +extern void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +extern void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor); +extern void ( APIENTRY * qglCallList )(GLuint list); +extern void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists); +extern void ( APIENTRY * qglClear )(GLbitfield mask); +extern void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +extern void ( APIENTRY * qglClearDepth )(GLclampd depth); +extern void ( APIENTRY * qglClearIndex )(GLfloat c); +extern void ( APIENTRY * qglClearStencil )(GLint s); +extern void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation); +extern void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue); +extern void ( APIENTRY * qglColor3bv )(const GLbyte *v); +extern void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue); +extern void ( APIENTRY * qglColor3dv )(const GLdouble *v); +extern void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue); +extern void ( APIENTRY * qglColor3fv )(const GLfloat *v); +extern void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue); +extern void ( APIENTRY * qglColor3iv )(const GLint *v); +extern void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue); +extern void ( APIENTRY * qglColor3sv )(const GLshort *v); +extern void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue); +extern void ( APIENTRY * qglColor3ubv )(const GLubyte *v); +extern void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue); +extern void ( APIENTRY * qglColor3uiv )(const GLuint *v); +extern void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue); +extern void ( APIENTRY * qglColor3usv )(const GLushort *v); +extern void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +extern void ( APIENTRY * qglColor4bv )(const GLbyte *v); +extern void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +extern void ( APIENTRY * qglColor4dv )(const GLdouble *v); +extern void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern void ( APIENTRY * qglColor4fv )(const GLfloat *v); +extern void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha); +extern void ( APIENTRY * qglColor4iv )(const GLint *v); +extern void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha); +extern void ( APIENTRY * qglColor4sv )(const GLshort *v); +extern void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +extern void ( APIENTRY * qglColor4ubv )(const GLubyte *v); +extern void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha); +extern void ( APIENTRY * qglColor4uiv )(const GLuint *v); +extern void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha); +extern void ( APIENTRY * qglColor4usv )(const GLushort *v); +extern void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +extern void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode); +extern void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +extern void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +extern void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +extern void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +extern void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +extern void ( APIENTRY * qglCullFace )(GLenum mode); +extern void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range); +extern void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures); +extern void ( APIENTRY * qglDepthFunc )(GLenum func); +extern void ( APIENTRY * qglDepthMask )(GLboolean flag); +extern void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar); +extern void ( APIENTRY * qglDisable )(GLenum cap); +extern void ( APIENTRY * qglDisableClientState )(GLenum array); +extern void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count); +extern void ( APIENTRY * qglDrawBuffer )(GLenum mode); +extern void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +extern void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +extern void ( APIENTRY * qglEdgeFlag )(GLboolean flag); +extern void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag); +extern void ( APIENTRY * qglEnable )(GLenum cap); +extern void ( APIENTRY * qglEnableClientState )(GLenum array); +extern void ( APIENTRY * qglEnd )(void); +extern void ( APIENTRY * qglEndList )(void); +extern void ( APIENTRY * qglEvalCoord1d )(GLdouble u); +extern void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u); +extern void ( APIENTRY * qglEvalCoord1f )(GLfloat u); +extern void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u); +extern void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v); +extern void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u); +extern void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v); +extern void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u); +extern void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2); +extern void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +extern void ( APIENTRY * qglEvalPoint1 )(GLint i); +extern void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j); +extern void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer); +extern void ( APIENTRY * qglFinish )(void); +extern void ( APIENTRY * qglFlush )(void); +extern void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param); +extern void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglFogi )(GLenum pname, GLint param); +extern void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params); +extern void ( APIENTRY * qglFrontFace )(GLenum mode); +extern void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +extern GLuint ( APIENTRY * qglGenLists )(GLsizei range); +extern void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures); +extern void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params); +extern void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation); +extern void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params); +extern GLenum ( APIENTRY * qglGetError )(void); +extern void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v); +extern void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v); +extern void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v); +extern void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values); +extern void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values); +extern void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values); +extern void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params); +extern void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask); +extern const GLubyte * ( APIENTRY * qglGetString )(GLenum name); +extern void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params); +extern void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +extern void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params); +extern void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params); +extern void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params); +extern void ( APIENTRY * qglHint )(GLenum target, GLenum mode); +extern void ( APIENTRY * qglIndexMask )(GLuint mask); +extern void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglIndexd )(GLdouble c); +extern void ( APIENTRY * qglIndexdv )(const GLdouble *c); +extern void ( APIENTRY * qglIndexf )(GLfloat c); +extern void ( APIENTRY * qglIndexfv )(const GLfloat *c); +extern void ( APIENTRY * qglIndexi )(GLint c); +extern void ( APIENTRY * qglIndexiv )(const GLint *c); +extern void ( APIENTRY * qglIndexs )(GLshort c); +extern void ( APIENTRY * qglIndexsv )(const GLshort *c); +extern void ( APIENTRY * qglIndexub )(GLubyte c); +extern void ( APIENTRY * qglIndexubv )(const GLubyte *c); +extern void ( APIENTRY * qglInitNames )(void); +extern void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer); +extern GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap); +extern GLboolean ( APIENTRY * qglIsList )(GLuint list); +extern GLboolean ( APIENTRY * qglIsTexture )(GLuint texture); +extern void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param); +extern void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param); +extern void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params); +extern void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param); +extern void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param); +extern void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params); +extern void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern); +extern void ( APIENTRY * qglLineWidth )(GLfloat width); +extern void ( APIENTRY * qglListBase )(GLuint base); +extern void ( APIENTRY * qglLoadIdentity )(void); +extern void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m); +extern void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m); +extern void ( APIENTRY * qglLoadName )(GLuint name); +extern void ( APIENTRY * qglLogicOp )(GLenum opcode); +extern void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +extern void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +extern void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +extern void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +extern void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2); +extern void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2); +extern void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +extern void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +extern void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param); +extern void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param); +extern void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params); +extern void ( APIENTRY * qglMatrixMode )(GLenum mode); +extern void ( APIENTRY * qglMultMatrixd )(const GLdouble *m); +extern void ( APIENTRY * qglMultMatrixf )(const GLfloat *m); +extern void ( APIENTRY * qglNewList )(GLuint list, GLenum mode); +extern void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz); +extern void ( APIENTRY * qglNormal3bv )(const GLbyte *v); +extern void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz); +extern void ( APIENTRY * qglNormal3dv )(const GLdouble *v); +extern void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz); +extern void ( APIENTRY * qglNormal3fv )(const GLfloat *v); +extern void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz); +extern void ( APIENTRY * qglNormal3iv )(const GLint *v); +extern void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz); +extern void ( APIENTRY * qglNormal3sv )(const GLshort *v); +extern void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +extern void ( APIENTRY * qglPassThrough )(GLfloat token); +extern void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values); +extern void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values); +extern void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values); +extern void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param); +extern void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param); +extern void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param); +extern void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param); +extern void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor); +extern void ( APIENTRY * qglPointSize )(GLfloat size); +extern void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode); +extern void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units); +extern void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask); +extern void ( APIENTRY * qglPopAttrib )(void); +extern void ( APIENTRY * qglPopClientAttrib )(void); +extern void ( APIENTRY * qglPopMatrix )(void); +extern void ( APIENTRY * qglPopName )(void); +extern void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities); +extern void ( APIENTRY * qglPushAttrib )(GLbitfield mask); +extern void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask); +extern void ( APIENTRY * qglPushMatrix )(void); +extern void ( APIENTRY * qglPushName )(GLuint name); +extern void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y); +extern void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v); +extern void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y); +extern void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v); +extern void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y); +extern void ( APIENTRY * qglRasterPos2iv )(const GLint *v); +extern void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y); +extern void ( APIENTRY * qglRasterPos2sv )(const GLshort *v); +extern void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z); +extern void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v); +extern void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z); +extern void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v); +extern void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z); +extern void ( APIENTRY * qglRasterPos3iv )(const GLint *v); +extern void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z); +extern void ( APIENTRY * qglRasterPos3sv )(const GLshort *v); +extern void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v); +extern void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v); +extern void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w); +extern void ( APIENTRY * qglRasterPos4iv )(const GLint *v); +extern void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w); +extern void ( APIENTRY * qglRasterPos4sv )(const GLshort *v); +extern void ( APIENTRY * qglReadBuffer )(GLenum mode); +extern void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +extern void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +extern void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2); +extern void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +extern void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2); +extern void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2); +extern void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2); +extern void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +extern void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2); +extern GLint ( APIENTRY * qglRenderMode )(GLenum mode); +extern void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +extern void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +extern void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z); +extern void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z); +extern void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height); +extern void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer); +extern void ( APIENTRY * qglShadeModel )(GLenum mode); +extern void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask); +extern void ( APIENTRY * qglStencilMask )(GLuint mask); +extern void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass); +extern void ( APIENTRY * qglTexCoord1d )(GLdouble s); +extern void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v); +extern void ( APIENTRY * qglTexCoord1f )(GLfloat s); +extern void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v); +extern void ( APIENTRY * qglTexCoord1i )(GLint s); +extern void ( APIENTRY * qglTexCoord1iv )(const GLint *v); +extern void ( APIENTRY * qglTexCoord1s )(GLshort s); +extern void ( APIENTRY * qglTexCoord1sv )(const GLshort *v); +extern void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t); +extern void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v); +extern void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t); +extern void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v); +extern void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t); +extern void ( APIENTRY * qglTexCoord2iv )(const GLint *v); +extern void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t); +extern void ( APIENTRY * qglTexCoord2sv )(const GLshort *v); +extern void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r); +extern void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v); +extern void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r); +extern void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v); +extern void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r); +extern void ( APIENTRY * qglTexCoord3iv )(const GLint *v); +extern void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r); +extern void ( APIENTRY * qglTexCoord3sv )(const GLshort *v); +extern void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +extern void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v); +extern void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +extern void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v); +extern void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q); +extern void ( APIENTRY * qglTexCoord4iv )(const GLint *v); +extern void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q); +extern void ( APIENTRY * qglTexCoord4sv )(const GLshort *v); +extern void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param); +extern void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param); +extern void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params); +extern void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param); +extern void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params); +extern void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param); +extern void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param); +extern void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params); +extern void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +extern void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +extern void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param); +extern void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params); +extern void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param); +extern void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params); +extern void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +extern void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +extern void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z); +extern void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z); +extern void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y); +extern void ( APIENTRY * qglVertex2dv )(const GLdouble *v); +extern void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y); +extern void ( APIENTRY * qglVertex2fv )(const GLfloat *v); +extern void ( APIENTRY * qglVertex2i )(GLint x, GLint y); +extern void ( APIENTRY * qglVertex2iv )(const GLint *v); +extern void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y); +extern void ( APIENTRY * qglVertex2sv )(const GLshort *v); +extern void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z); +extern void ( APIENTRY * qglVertex3dv )(const GLdouble *v); +extern void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z); +extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v); +extern void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z); +extern void ( APIENTRY * qglVertex3iv )(const GLint *v); +extern void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z); +extern void ( APIENTRY * qglVertex3sv )(const GLshort *v); +extern void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +extern void ( APIENTRY * qglVertex4dv )(const GLdouble *v); +extern void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +extern void ( APIENTRY * qglVertex4fv )(const GLfloat *v); +extern void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w); +extern void ( APIENTRY * qglVertex4iv )(const GLint *v); +extern void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w); +extern void ( APIENTRY * qglVertex4sv )(const GLshort *v); +extern void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +extern void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height); + +extern void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value ); +extern void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value ); +extern void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * ); + +extern void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat ); +extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum ); + +extern void ( APIENTRY * qglActiveTextureARB) (GLenum texture); +extern void ( APIENTRY * qglClientActiveTextureARB) (GLenum texture); +extern void ( APIENTRY * qglMultiTexCoord1dARB) (GLenum target, GLdouble s); +extern void ( APIENTRY * qglMultiTexCoord1dvARB) (GLenum target, const GLdouble *v); +extern void ( APIENTRY * qglMultiTexCoord1fARB) (GLenum target, GLfloat s); +extern void ( APIENTRY * qglMultiTexCoord1fvARB) (GLenum target, const GLfloat *v); +extern void ( APIENTRY * qglMultiTexCoord1iARB) (GLenum target, GLint s); +extern void ( APIENTRY * qglMultiTexCoord1ivARB) (GLenum target, const GLint *v); +extern void ( APIENTRY * qglMultiTexCoord1sARB) (GLenum target, GLshort s); +extern void ( APIENTRY * qglMultiTexCoord1svARB) (GLenum target, const GLshort *v); +extern void ( APIENTRY * qglMultiTexCoord2dARB) (GLenum target, GLdouble s); +extern void ( APIENTRY * qglMultiTexCoord2dvARB) (GLenum target, const GLdouble *v); +extern void ( APIENTRY * qglMultiTexCoord2fARB) (GLenum target, GLfloat s); +extern void ( APIENTRY * qglMultiTexCoord2fvARB) (GLenum target, const GLfloat *v); +extern void ( APIENTRY * qglMultiTexCoord2iARB) (GLenum target, GLint s); +extern void ( APIENTRY * qglMultiTexCoord2ivARB) (GLenum target, const GLint *v); +extern void ( APIENTRY * qglMultiTexCoord2sARB) (GLenum target, GLshort s); +extern void ( APIENTRY * qglMultiTexCoord2svARB) (GLenum target, const GLshort *v); +extern void ( APIENTRY * qglMultiTexCoord3dARB) (GLenum target, GLdouble s); +extern void ( APIENTRY * qglMultiTexCoord3dvARB) (GLenum target, const GLdouble *v); +extern void ( APIENTRY * qglMultiTexCoord3fARB) (GLenum target, GLfloat s); +extern void ( APIENTRY * qglMultiTexCoord3fvARB) (GLenum target, const GLfloat *v); +extern void ( APIENTRY * qglMultiTexCoord3iARB) (GLenum target, GLint s); +extern void ( APIENTRY * qglMultiTexCoord3ivARB) (GLenum target, const GLint *v); +extern void ( APIENTRY * qglMultiTexCoord3sARB) (GLenum target, GLshort s); +extern void ( APIENTRY * qglMultiTexCoord3svARB) (GLenum target, const GLshort *v); +extern void ( APIENTRY * qglMultiTexCoord4dARB) (GLenum target, GLdouble s); +extern void ( APIENTRY * qglMultiTexCoord4dvARB) (GLenum target, const GLdouble *v); +extern void ( APIENTRY * qglMultiTexCoord4fARB) (GLenum target, GLfloat s); +extern void ( APIENTRY * qglMultiTexCoord4fvARB) (GLenum target, const GLfloat *v); +extern void ( APIENTRY * qglMultiTexCoord4iARB) (GLenum target, GLint s); +extern void ( APIENTRY * qglMultiTexCoord4ivARB) (GLenum target, const GLint *v); +extern void ( APIENTRY * qglMultiTexCoord4sARB) (GLenum target, GLshort s); +extern void ( APIENTRY * qglMultiTexCoord4svARB) (GLenum target, const GLshort *v); + + + +#ifdef _WIN32 + +extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *); +extern int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +extern int ( WINAPI * qwglGetPixelFormat)(HDC); +extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); +extern BOOL ( WINAPI * qwglSwapBuffers)(HDC); + +extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); +extern HGLRC ( WINAPI * qwglCreateContext)(HDC); +extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int); +extern BOOL ( WINAPI * qwglDeleteContext)(HGLRC); +extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID); +extern HDC ( WINAPI * qwglGetCurrentDC)(VOID); +extern PROC ( WINAPI * qwglGetProcAddress)(LPCSTR); +extern BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC); +extern BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC); +extern BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD); + +extern BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT, + FLOAT, int, LPGLYPHMETRICSFLOAT); + +extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT, + LPLAYERPLANEDESCRIPTOR); +extern int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int, + CONST COLORREF *); +extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int, + COLORREF *); +extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL); +extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT); + +extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval ); + +extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue ); +extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue ); + +#endif + +#if defined (__linux__) || defined (__APPLE__) +extern XVisualInfo* (*qglXChooseVisual)(Display *dpy, int screen, int *attribList); +extern GLXContext (*qglXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void (*qglXDestroyContext)(Display *dpy, GLXContext ctx); +extern Bool (*qglXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern void (*qglXCopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); +extern void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); +extern GLXPixmap (*qglXCreateGLXPixmap)( Display *dpy, XVisualInfo *visual, Pixmap pixmap ); +extern void (*qglXDestroyGLXPixmap)( Display *dpy, GLXPixmap pixmap ); +extern Bool (*qglXQueryExtension)( Display *dpy, int *errorb, int *event ); +extern Bool (*qglXQueryVersion)( Display *dpy, int *maj, int *min ); +extern Bool (*qglXIsDirect)( Display *dpy, GLXContext ctx ); +extern int (*qglXGetConfig)( Display *dpy, XVisualInfo *visual, int attrib, int *value ); +extern GLXContext (*qglXGetCurrentContext)( void ); +extern GLXDrawable (*qglXGetCurrentDrawable)( void ); +extern void (*qglXWaitGL)( void ); +extern void (*qglXWaitX)( void ); +extern void (*qglXUseXFont)( Font font, int first, int count, int list ); +extern void* (*qglXGetProcAddressARB) (const GLubyte *procName); +#endif + +#ifdef ATIHACK_812 +extern void ( APIENTRY * qglCullFace_real )(GLenum mode); +extern void ( APIENTRY * qglDisable_real )(GLenum cap); +extern void ( APIENTRY * qglEnable_real )(GLenum cap); +extern void ( APIENTRY * qglPolygonMode_real )(GLenum face, GLenum mode); + +extern void APIENTRY qglCullFace_ATIHack(GLenum mode); +extern void APIENTRY qglDisable_ATIHack(GLenum cap); +extern void APIENTRY qglEnable_ATIHack(GLenum cap); +extern void APIENTRY qglPolygonMode_ATIHack(GLenum face, GLenum mode); +#endif + +// glu stuff.. radiant only uses a couple +extern void (APIENTRY* qgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +extern void (APIENTRY* qgluLookAt)( + GLdouble eyex, + GLdouble eyey, + GLdouble eyez, + GLdouble centerx, + GLdouble centery, + GLdouble centerz, + GLdouble upx, + GLdouble upy, + GLdouble upz); +extern const GLubyte * (APIENTRY * qgluErrorString) (GLenum errCode ); + + +// end of glu stuff + + +/* +** extension constants +*/ +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GL_TEXTURE0_SGIS 0x835E +#define GL_TEXTURE1_SGIS 0x835F + + +#ifdef __cplusplus +} +#endif // extern "C" + +// ------------------------------------------------------------------------------------------- +// qgl_ext.cpp API +// ------------------------------------------------------------------------------------------- + +int Sys_QGL_ExtensionSupported (const char *extension); #endif diff --git a/radiant/qgl_ext.cpp b/radiant/qgl_ext.cpp new file mode 100644 index 00000000..5befc176 --- /dev/null +++ b/radiant/qgl_ext.cpp @@ -0,0 +1,46 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* +** qgl_ext.cpp +** +** TTimo +** I wanted a C++ file for some new qgl stuff +*/ + +#include "stdafx.h" + +int Sys_QGL_ExtensionSupported (const char *extension) +{ + int ret; + + Sys_Printf("Checking for extension '%s'...", extension); + ret = GL_ExtensionSupported(extension); + if (ret) + { + Sys_Printf("Found\n"); + } + else + { + Sys_Printf("Not Found\n"); + } + return ret; +} diff --git a/radiant/queuedraw.cpp b/radiant/queuedraw.cpp new file mode 100644 index 00000000..5e61169e --- /dev/null +++ b/radiant/queuedraw.cpp @@ -0,0 +1,158 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Try to sort the faces by texture and make rendering faster +// +// Leonardo Zide (leo@lokigames.com) +// + +#include "stdafx.h" + +typedef struct +{ + qtexture_t* texture; + GPtrArray* faces; +} windingsort_t; + +static windingsort_t* sort; +static guint32 alloc, len; +static GPtrArray* notex_faces; + +void QueueClear () +{ + len = 0; + + if (notex_faces == NULL) + notex_faces = g_ptr_array_new (); + g_ptr_array_set_size (notex_faces, 0); +} + +void QueueFace (face_t *face) +{ + guint32 i; + + if (face->d_texture->name[0] == '(') + { + g_ptr_array_add (notex_faces, face); + return; + } + + for (i = 0; i < len; i++) + if (sort[i].texture == face->d_texture) + { + g_ptr_array_add (sort[i].faces, face); + return; + } + + if (len == alloc) + { + alloc += 8; + sort = (windingsort_t*)realloc (sort, alloc*sizeof(windingsort_t)); + + for (i = len; i < alloc; i++) + sort[i].faces = g_ptr_array_new (); + } + g_ptr_array_set_size (sort[len].faces, 0); + g_ptr_array_add (sort[len].faces, face); + sort[len].texture = face->d_texture; + len++; +} + +void QueueDraw () +{ + guint32 i, k; + face_t *face; + winding_t *w; + int j, nDrawMode = g_pParentWnd->GetCamera().draw_mode; + + if (notex_faces->len) + { + qglDisable (GL_TEXTURE_2D); + + for (i = 0; i < notex_faces->len; i++) + { + face = (face_t*)notex_faces->pdata[i]; + w = face->face_winding; + + qglBegin (GL_POLYGON); + + /* + if (b->patchBrush) + //++timo FIXME: find a use case for this?? + qglColor4f (face->d_color[0], face->d_color[1], face->d_color[2], 0.13); + else + */ + qglColor4f (face->d_color[0], face->d_color[1], face->d_color[2], face->pShader->getTrans ()); + + if (g_PrefsDlg.m_bGLLighting) + qglNormal3fv (face->plane.normal); + + for (j = 0; j < w->numpoints; j++) + { + if (nDrawMode == cd_texture || nDrawMode == cd_light) + qglTexCoord2fv( &w->points[j][3] ); + qglVertex3fv(w->points[j]); + } + + qglEnd (); + } + } + + if (!len) + return; + + if (nDrawMode == cd_texture || nDrawMode == cd_light) + qglEnable (GL_TEXTURE_2D); + + for (k = 0; k < len; k++) + { + qglBindTexture (GL_TEXTURE_2D, sort[k].texture->texture_number); + + for (i = 0; i < sort[k].faces->len; i++) + { + face = (face_t*)sort[k].faces->pdata[i]; + w = face->face_winding; + + qglBegin (GL_POLYGON); + /* + if (b->patchBrush) + //++timo FIXME: find a use case for this?? + qglColor4f (face->d_color[0], face->d_color[1], face->d_color[2], 0.13); + else + */ + qglColor4f (face->d_color[0], face->d_color[1], face->d_color[2], face->pShader->getTrans ()); + + if (g_PrefsDlg.m_bGLLighting) + qglNormal3fv (face->plane.normal); + + for (j = 0; j < w->numpoints; j++) + { + if (nDrawMode == cd_texture || nDrawMode == cd_light) + qglTexCoord2fv( &w->points[j][3] ); + qglVertex3fv(w->points[j]); + } + + qglEnd (); + } + } + qglBindTexture (GL_TEXTURE_2D, 0); +} diff --git a/radiant/radiant.ico b/radiant/radiant.ico index 45e8258e..cca8503f 100644 Binary files a/radiant/radiant.ico and b/radiant/radiant.ico differ diff --git a/radiant/radiant.rc b/radiant/radiant.rc index 51087c04..b38337f7 100644 --- a/radiant/radiant.rc +++ b/radiant/radiant.rc @@ -1,72 +1,72 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -//#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -//#ifdef _WIN32 -//LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -//#pragma code_page(1252) -//#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_RADIANT ICON DISCARDABLE "radiant.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "//#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_RADIANT ICON DISCARDABLE "radiant.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/radiant/radiant.vcproj b/radiant/radiant.vcproj new file mode 100644 index 00000000..2dbf2999 --- /dev/null +++ b/radiant/radiant.vcproj @@ -0,0 +1,2460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/radiant/radiant_old.ico b/radiant/radiant_old.ico deleted file mode 100644 index b45ef36a..00000000 Binary files a/radiant/radiant_old.ico and /dev/null differ diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp deleted file mode 100644 index d41b9344..00000000 --- a/radiant/referencecache.cpp +++ /dev/null @@ -1,846 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "referencecache.h" - -#include "debugging/debugging.h" - -#include "iscenegraph.h" -#include "iselection.h" -#include "iundo.h" -#include "imap.h" -MapModules& ReferenceAPI_getMapModules(); -#include "imodel.h" -ModelModules& ReferenceAPI_getModelModules(); -#include "ifilesystem.h" -#include "iarchive.h" -#include "ifiletypes.h" -#include "ireference.h" -#include "ientity.h" -#include "qerplugin.h" - -#include - -#include "container/cache.h" -#include "container/hashfunc.h" -#include "os/path.h" -#include "stream/textfilestream.h" -#include "nullmodel.h" -#include "maplib.h" -#include "stream/stringstream.h" -#include "os/file.h" -#include "moduleobserver.h" -#include "moduleobservers.h" - -#include "mainframe.h" -#include "map.h" -#include "filetypes.h" - - -bool References_Saved(); - -void MapChanged() -{ - Map_SetModified(g_map, !References_Saved()); -} - - -EntityCreator* g_entityCreator = 0; - -bool MapResource_loadFile(const MapFormat& format, scene::Node& root, const char* filename) -{ - globalOutputStream() << "Open file " << filename << " for read..."; - TextFileInputStream file(filename); - if(!file.failed()) - { - globalOutputStream() << "success\n"; - ScopeDisableScreenUpdates disableScreenUpdates(path_get_filename_start(filename), "Loading Map"); - ASSERT_NOTNULL(g_entityCreator); - format.readGraph(root, file, *g_entityCreator); - return true; - } - else - { - globalErrorStream() << "failure\n"; - return false; - } -} - -NodeSmartReference MapResource_load(const MapFormat& format, const char* path, const char* name) -{ - NodeSmartReference root(NewMapRoot(name)); - - StringOutputStream fullpath(256); - fullpath << path << name; - - if(path_is_absolute(fullpath.c_str())) - { - MapResource_loadFile(format, root, fullpath.c_str()); - } - else - { - globalErrorStream() << "map path is not fully qualified: " << makeQuoted(fullpath.c_str()) << "\n"; - } - - return root; -} - -bool MapResource_saveFile(const MapFormat& format, scene::Node& root, GraphTraversalFunc traverse, const char* filename) -{ - //ASSERT_MESSAGE(path_is_absolute(filename), "MapResource_saveFile: path is not absolute: " << makeQuoted(filename)); - globalOutputStream() << "Open file " << filename << " for write..."; - TextFileOutputStream file(filename); - if(!file.failed()) - { - globalOutputStream() << "success\n"; - ScopeDisableScreenUpdates disableScreenUpdates(path_get_filename_start(filename), "Saving Map"); - format.writeGraph(root, traverse, file); - return true; - } - - globalErrorStream() << "failure\n"; - return false; -} - -bool file_saveBackup(const char* path) -{ - if(file_writeable(path)) - { - StringOutputStream backup(256); - backup << StringRange(path, path_get_extension(path)) << "bak"; - - return (!file_exists(backup.c_str()) || file_remove(backup.c_str())) // remove backup - && file_move(path, backup.c_str()); // rename current to backup - } - - globalErrorStream() << "map path is not writeable: " << makeQuoted(path) << "\n"; - return false; -} - -bool MapResource_save(const MapFormat& format, scene::Node& root, const char* path, const char* name) -{ - StringOutputStream fullpath(256); - fullpath << path << name; - - if(path_is_absolute(fullpath.c_str())) - { - if(!file_exists(fullpath.c_str()) || file_saveBackup(fullpath.c_str())) - { - return MapResource_saveFile(format, root, Map_Traverse, fullpath.c_str()); - } - - globalErrorStream() << "failed to save a backup map file: " << makeQuoted(fullpath.c_str()) << "\n"; - return false; - } - - globalErrorStream() << "map path is not fully qualified: " << makeQuoted(fullpath.c_str()) << "\n"; - return false; -} - -namespace -{ - NodeSmartReference g_nullNode(NewNullNode()); - NodeSmartReference g_nullModel(g_nullNode); -} - -class NullModelLoader : public ModelLoader -{ -public: - scene::Node& loadModel(ArchiveFile& file) - { - return g_nullModel; - } -}; - -namespace -{ - NullModelLoader g_NullModelLoader; -} - - -/// \brief Returns the model loader for the model \p type or 0 if the model \p type has no loader module -ModelLoader* ModelLoader_forType(const char* type) -{ - const char* moduleName = findModuleName(&GlobalFiletypes(), ModelLoader::Name(), type); - if(string_not_empty(moduleName)) - { - ModelLoader* table = ReferenceAPI_getModelModules().findModule(moduleName); - if(table != 0) - { - return table; - } - else - { - globalErrorStream() << "ERROR: Model type incorrectly registered: \"" << moduleName << "\"\n"; - return &g_NullModelLoader; - } - } - return 0; -} - -NodeSmartReference ModelResource_load(ModelLoader* loader, const char* name) -{ - ScopeDisableScreenUpdates disableScreenUpdates(path_get_filename_start(name), "Loading Model"); - - NodeSmartReference model(g_nullModel); - - { - ArchiveFile* file = GlobalFileSystem().openFile(name); - - if(file != 0) - { - globalOutputStream() << "Loaded Model: \"" << name << "\"\n"; - model = loader->loadModel(*file); - file->release(); - } - else - { - globalErrorStream() << "Model load failed: \"" << name << "\"\n"; - } - } - - model.get().m_isRoot = true; - - return model; -} - - -inline hash_t path_hash(const char* path, hash_t previous = 0) -{ -#if defined(WIN32) - return string_hash_nocase(path, previous); -#else // UNIX - return string_hash(path, previous); -#endif -} - -struct PathEqual -{ - bool operator()(const CopiedString& path, const CopiedString& other) const - { - return path_equal(path.c_str(), other.c_str()); - } -}; - -struct PathHash -{ - typedef hash_t hash_type; - hash_type operator()(const CopiedString& path) const - { - return path_hash(path.c_str()); - } -}; - -typedef std::pair ModelKey; - -struct ModelKeyEqual -{ - bool operator()(const ModelKey& key, const ModelKey& other) const - { - return path_equal(key.first.c_str(), other.first.c_str()) && path_equal(key.second.c_str(), other.second.c_str()); - } -}; - -struct ModelKeyHash -{ - typedef hash_t hash_type; - hash_type operator()(const ModelKey& key) const - { - return hash_combine(path_hash(key.first.c_str()), path_hash(key.second.c_str())); - } -}; - -typedef HashTable ModelCache; -ModelCache g_modelCache; -bool g_modelCache_enabled = true; - -ModelCache::iterator ModelCache_find(const char* path, const char* name) -{ - if(g_modelCache_enabled) - { - return g_modelCache.find(ModelKey(path, name)); - } - return g_modelCache.end(); -} - -ModelCache::iterator ModelCache_insert(const char* path, const char* name, scene::Node& node) -{ - if(g_modelCache_enabled) - { - return g_modelCache.insert(ModelKey(path, name), NodeSmartReference(node)); - } - return g_modelCache.insert(ModelKey("", ""), g_nullModel); -} - -void ModelCache_flush(const char* path, const char* name) -{ - ModelCache::iterator i = g_modelCache.find(ModelKey(path, name)); - if(i != g_modelCache.end()) - { - //ASSERT_MESSAGE((*i).value.getCount() == 0, "resource flushed while still in use: " << (*i).key.first.c_str() << (*i).key.second.c_str()); - g_modelCache.erase(i); - } -} - -void ModelCache_clear() -{ - g_modelCache_enabled = false; - g_modelCache.clear(); - g_modelCache_enabled = true; -} - -NodeSmartReference Model_load(ModelLoader* loader, const char* path, const char* name, const char* type) -{ - if(loader != 0) - { - return ModelResource_load(loader, name); - } - else - { - const char* moduleName = findModuleName(&GlobalFiletypes(), MapFormat::Name(), type); - if(string_not_empty(moduleName)) - { - const MapFormat* format = ReferenceAPI_getMapModules().findModule(moduleName); - if(format != 0) - { - return MapResource_load(*format, path, name); - } - else - { - globalErrorStream() << "ERROR: Map type incorrectly registered: \"" << moduleName << "\"\n"; - return g_nullModel; - } - } - else - { - if(string_not_empty(type)) - { - globalErrorStream() << "Model type not supported: \"" << name << "\"\n"; - } - return g_nullModel; - } - } -} - -namespace -{ - bool g_realised = false; - - // name may be absolute or relative - const char* rootPath(const char* name) - { - return GlobalFileSystem().findRoot( - path_is_absolute(name) - ? name - : GlobalFileSystem().findFile(name) - ); - } -} - -struct ModelResource : public Resource -{ - NodeSmartReference m_model; - const CopiedString m_originalName; - CopiedString m_path; - CopiedString m_name; - CopiedString m_type; - ModelLoader* m_loader; - ModuleObservers m_observers; - std::time_t m_modified; - std::size_t m_unrealised; - - ModelResource(const CopiedString& name) : - m_model(g_nullModel), - m_originalName(name), - m_type(path_get_extension(name.c_str())), - m_loader(0), - m_modified(0), - m_unrealised(1) - { - m_loader = ModelLoader_forType(m_type.c_str()); - - if(g_realised) - { - realise(); - } - } - ~ModelResource() - { - if(realised()) - { - unrealise(); - } - ASSERT_MESSAGE(!realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted(m_name.c_str())); - } - // NOT COPYABLE - ModelResource(const ModelResource&); - // NOT ASSIGNABLE - ModelResource& operator=(const ModelResource&); - - void setModel(const NodeSmartReference& model) - { - m_model = model; - } - void clearModel() - { - m_model = g_nullModel; - } - - void loadCached() - { - if(g_modelCache_enabled) - { - // cache lookup - ModelCache::iterator i = ModelCache_find(m_path.c_str(), m_name.c_str()); - if(i == g_modelCache.end()) - { - i = ModelCache_insert( - m_path.c_str(), - m_name.c_str(), - Model_load(m_loader, m_path.c_str(), m_name.c_str(), m_type.c_str()) - ); - } - - setModel((*i).value); - } - else - { - setModel(Model_load(m_loader, m_path.c_str(), m_name.c_str(), m_type.c_str())); - } - } - - void loadModel() - { - loadCached(); - connectMap(); - mapSave(); - } - - bool load() - { - ASSERT_MESSAGE(realised(), "resource not realised"); - if(m_model == g_nullModel) - { - loadModel(); - } - - return m_model != g_nullModel; - } - bool save() - { - if(!mapSaved()) - { - const char* moduleName = findModuleName(GetFileTypeRegistry(), MapFormat::Name(), m_type.c_str()); - if(string_not_empty(moduleName)) - { - const MapFormat* format = ReferenceAPI_getMapModules().findModule(moduleName); - if(format != 0 && MapResource_save(*format, m_model.get(), m_path.c_str(), m_name.c_str())) - { - mapSave(); - return true; - } - } - } - return false; - } - void flush() - { - if(realised()) - { - ModelCache_flush(m_path.c_str(), m_name.c_str()); - } - } - scene::Node* getNode() - { - //if(m_model != g_nullModel) - { - return m_model.get_pointer(); - } - //return 0; - } - void setNode(scene::Node* node) - { - ModelCache::iterator i = ModelCache_find(m_path.c_str(), m_name.c_str()); - if(i != g_modelCache.end()) - { - (*i).value = NodeSmartReference(*node); - } - setModel(NodeSmartReference(*node)); - - connectMap(); - } - void attach(ModuleObserver& observer) - { - if(realised()) - { - observer.realise(); - } - m_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - if(realised()) - { - observer.unrealise(); - } - m_observers.detach(observer); - } - bool realised() - { - return m_unrealised == 0; - } - void realise() - { - ASSERT_MESSAGE(m_unrealised != 0, "ModelResource::realise: already realised"); - if(--m_unrealised == 0) - { - m_path = rootPath(m_originalName.c_str()); - m_name = path_make_relative(m_originalName.c_str(), m_path.c_str()); - - //globalOutputStream() << "ModelResource::realise: " << m_path.c_str() << m_name.c_str() << "\n"; - - m_observers.realise(); - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - m_observers.unrealise(); - - //globalOutputStream() << "ModelResource::unrealise: " << m_path.c_str() << m_name.c_str() << "\n"; - clearModel(); - } - } - bool isMap() const - { - return Node_getMapFile(m_model) != 0; - } - void connectMap() - { - MapFile* map = Node_getMapFile(m_model); - if(map != 0) - { - map->setChangedCallback(FreeCaller()); - } - } - std::time_t modified() const - { - StringOutputStream fullpath(256); - fullpath << m_path.c_str() << m_name.c_str(); - return file_modified(fullpath.c_str()); - } - void mapSave() - { - m_modified = modified(); - MapFile* map = Node_getMapFile(m_model); - if(map != 0) - { - map->save(); - } - } - bool mapSaved() const - { - MapFile* map = Node_getMapFile(m_model); - if(map != 0) - { - return m_modified == modified() && map->saved(); - } - return true; - } - bool isModified() const - { - return ((!string_empty(m_path.c_str()) // had or has an absolute path - && m_modified != modified()) // AND disk timestamp changed - || !path_equal(rootPath(m_originalName.c_str()), m_path.c_str())); // OR absolute vfs-root changed - } - void refresh() - { - if(isModified()) - { - flush(); - unrealise(); - realise(); - } - } -}; - -class HashtableReferenceCache : public ReferenceCache, public ModuleObserver -{ - typedef HashedCache ModelReferences; - ModelReferences m_references; - std::size_t m_unrealised; - - class ModelReferencesSnapshot - { - ModelReferences& m_references; - typedef std::list Iterators; - Iterators m_iterators; - public: - typedef Iterators::iterator iterator; - ModelReferencesSnapshot(ModelReferences& references) : m_references(references) - { - for(ModelReferences::iterator i = m_references.begin(); i != m_references.end(); ++i) - { - m_references.capture(i); - m_iterators.push_back(i); - } - } - ~ModelReferencesSnapshot() - { - for(Iterators::iterator i = m_iterators.begin(); i != m_iterators.end(); ++i) - { - m_references.release(*i); - } - } - iterator begin() - { - return m_iterators.begin(); - } - iterator end() - { - return m_iterators.end(); - } - }; - -public: - - typedef ModelReferences::iterator iterator; - - HashtableReferenceCache() : m_unrealised(1) - { - } - - iterator begin() - { - return m_references.begin(); - } - iterator end() - { - return m_references.end(); - } - - void clear() - { - m_references.clear(); - } - - Resource* capture(const char* path) - { - //globalOutputStream() << "capture: \"" << path << "\"\n"; - return m_references.capture(CopiedString(path)).get(); - } - void release(const char* path) - { - m_references.release(CopiedString(path)); - //globalOutputStream() << "release: \"" << path << "\"\n"; - } - - void setEntityCreator(EntityCreator& entityCreator) - { - g_entityCreator = &entityCreator; - } - - bool realised() const - { - return m_unrealised == 0; - } - void realise() - { - ASSERT_MESSAGE(m_unrealised != 0, "HashtableReferenceCache::realise: already realised"); - if(--m_unrealised == 0) - { - g_realised = true; - - { - ModelReferencesSnapshot snapshot(m_references); - for(ModelReferencesSnapshot::iterator i = snapshot.begin(); i != snapshot.end(); ++i) - { - ModelReferences::value_type& value = *(*i); - if(value.value.count() != 1) - { - value.value.get()->realise(); - } - } - } - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - g_realised = false; - - { - ModelReferencesSnapshot snapshot(m_references); - for(ModelReferencesSnapshot::iterator i = snapshot.begin(); i != snapshot.end(); ++i) - { - ModelReferences::value_type& value = *(*i); - if(value.value.count() != 1) - { - value.value.get()->unrealise(); - } - } - } - - ModelCache_clear(); - } - } - void refresh() - { - ModelReferencesSnapshot snapshot(m_references); - for(ModelReferencesSnapshot::iterator i = snapshot.begin(); i != snapshot.end(); ++i) - { - ModelResource* resource = (*(*i)).value.get(); - if(!resource->isMap()) - { - resource->refresh(); - } - } - } -}; - -namespace -{ - HashtableReferenceCache g_referenceCache; -} - -#if 0 -class ResourceVisitor -{ -public: - virtual void visit(const char* name, const char* path, const -}; -#endif - -void SaveReferences() -{ - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Saving Map"); - for(HashtableReferenceCache::iterator i = g_referenceCache.begin(); i != g_referenceCache.end(); ++i) - { - (*i).value->save(); - } - MapChanged(); -} - -bool References_Saved() -{ - for(HashtableReferenceCache::iterator i = g_referenceCache.begin(); i != g_referenceCache.end(); ++i) - { - scene::Node* node = (*i).value->getNode(); - if(node != 0) - { - MapFile* map = Node_getMapFile(*node); - if(map != 0 && !map->saved()) - { - return false; - } - } - } - return true; -} - -void RefreshReferences() -{ - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Refreshing Models"); - g_referenceCache.refresh(); -} - - -void FlushReferences() -{ - ModelCache_clear(); - - g_referenceCache.clear(); -} - -ReferenceCache& GetReferenceCache() -{ - return g_referenceCache; -} - - -#include "modulesystem/modulesmap.h" -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class ReferenceDependencies : - public GlobalRadiantModuleRef, - public GlobalFileSystemModuleRef, - public GlobalFiletypesModuleRef -{ - ModelModulesRef m_model_modules; - MapModulesRef m_map_modules; -public: - ReferenceDependencies() : - m_model_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("modeltypes")), - m_map_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("maptypes")) - { - } - ModelModules& getModelModules() - { - return m_model_modules.get(); - } - MapModules& getMapModules() - { - return m_map_modules.get(); - } -}; - -class ReferenceAPI : public TypeSystemRef -{ - ReferenceCache* m_reference; -public: - typedef ReferenceCache Type; - STRING_CONSTANT(Name, "*"); - - ReferenceAPI() - { - g_nullModel = NewNullModel(); - - GlobalFileSystem().attach(g_referenceCache); - - m_reference = &GetReferenceCache(); - } - ~ReferenceAPI() - { - GlobalFileSystem().detach(g_referenceCache); - - g_nullModel = g_nullNode; - } - ReferenceCache* getTable() - { - return m_reference; - } -}; - -typedef SingletonModule ReferenceModule; -typedef Static StaticReferenceModule; -StaticRegisterModule staticRegisterReference(StaticReferenceModule::instance()); - -ModelModules& ReferenceAPI_getModelModules() -{ - return StaticReferenceModule::instance().getDependencies().getModelModules(); -} -MapModules& ReferenceAPI_getMapModules() -{ - return StaticReferenceModule::instance().getDependencies().getMapModules(); -} diff --git a/radiant/referencecache.h b/radiant/referencecache.h deleted file mode 100644 index 32d121e7..00000000 --- a/radiant/referencecache.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_REFERENCECACHE_H) -#define INCLUDED_REFERENCECACHE_H - -/// \brief Saves all open resource references if they differ from the version on disk. -void SaveReferences(); -/// \brief Flushes the cache of resource references. All resource references must be released before calling this. -void FlushReferences(); -/// \brief Reloads all resource references that differ from the version on disk. -void RefreshReferences(); - -#include "iscenegraph.h" -namespace scene -{ - class Node; -} -class MapFormat; -typedef void(*GraphTraversalFunc)(scene::Node& root, const scene::Traversable::Walker& walker); - -bool MapResource_saveFile(const MapFormat& format, scene::Node& root, GraphTraversalFunc traverse, const char* filename); - -#endif diff --git a/radiant/renderer.cpp b/radiant/renderer.cpp deleted file mode 100644 index 386653b9..00000000 --- a/radiant/renderer.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "renderer.h" - diff --git a/radiant/renderer.h b/radiant/renderer.h deleted file mode 100644 index 71865d62..00000000 --- a/radiant/renderer.h +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_RENDERER_H) -#define INCLUDED_RENDERER_H - -#include "irender.h" -#include "renderable.h" -#include "iselection.h" -#include "cullable.h" -#include "scenelib.h" -#include "math/frustum.h" -#include - -inline Cullable* Instance_getCullable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -inline Renderable* Instance_getRenderable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -inline VolumeIntersectionValue Cullable_testVisible(scene::Instance& instance, const VolumeTest& volume, VolumeIntersectionValue parentVisible) -{ - if(parentVisible == c_volumePartial) - { - Cullable* cullable = Instance_getCullable(instance); - if(cullable != 0) - { - return cullable->intersectVolume(volume, instance.localToWorld()); - } - } - return parentVisible; -} - -template -class CullingWalker -{ - const VolumeTest& m_volume; - const _Walker& m_walker; -public: - CullingWalker(const VolumeTest& volume, const _Walker& walker) - : m_volume(volume), m_walker(walker) - { - } - bool pre(const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible) const - { - VolumeIntersectionValue visible = Cullable_testVisible(instance, m_volume, parentVisible); - if(visible != c_volumeOutside) - { - return m_walker.pre(path, instance); - } - return true; - } - void post(const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible) const - { - return m_walker.post(path, instance); - } -}; - -template -class ForEachVisible : public scene::Graph::Walker -{ - const VolumeTest& m_volume; - const Walker_& m_walker; - mutable std::vector m_state; -public: - ForEachVisible(const VolumeTest& volume, const Walker_& walker) - : m_volume(volume), m_walker(walker) - { - m_state.push_back(c_volumePartial); - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - VolumeIntersectionValue visible = (path.top().get().visible()) ? m_state.back() : c_volumeOutside; - - if(visible == c_volumePartial) - { - visible = m_volume.TestAABB(instance.worldAABB()); - } - - m_state.push_back(visible); - - if(visible == c_volumeOutside) - { - return false; - } - else - { - return m_walker.pre(path, instance, m_state.back()); - } - } - void post(const scene::Path& path, scene::Instance& instance) const - { - if(m_state.back() != c_volumeOutside) - { - m_walker.post(path, instance, m_state.back()); - } - - m_state.pop_back(); - } -}; - -template -inline void Scene_forEachVisible(scene::Graph& graph, const VolumeTest& volume, const Functor& functor) -{ - graph.traverse(ForEachVisible< CullingWalker >(volume, CullingWalker(volume, functor))); -} - -class RenderHighlighted -{ - Renderer& m_renderer; - const VolumeTest& m_volume; -public: - RenderHighlighted(Renderer& renderer, const VolumeTest& volume) - : m_renderer(renderer), m_volume(volume) - { - } - void render(const Renderable& renderable) const - { - switch(m_renderer.getStyle()) - { - case Renderer::eFullMaterials: - renderable.renderSolid(m_renderer, m_volume); - break; - case Renderer::eWireframeOnly: - renderable.renderWireframe(m_renderer, m_volume); - break; - } - } - typedef ConstMemberCaller1 RenderCaller; - - bool pre(const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible) const - { - m_renderer.PushState(); - - if(Cullable_testVisible(instance, m_volume, parentVisible) != c_volumeOutside) - { - Renderable* renderable = Instance_getRenderable(instance); - if(renderable) - { - renderable->viewChanged(); - } - - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 && selectable->isSelected()) - { - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - m_renderer.Highlight(Renderer::eFace); - } - else if(renderable) - { - renderable->renderComponents(m_renderer, m_volume); - } - m_renderer.Highlight(Renderer::ePrimitive); - } - - if(renderable) - { - render(*renderable); - } - } - - return true; - } - void post(const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible) const - { - m_renderer.PopState(); - } -}; - -inline void Scene_Render(Renderer& renderer, const VolumeTest& volume) -{ - GlobalSceneGraph().traverse(ForEachVisible(volume, RenderHighlighted(renderer, volume))); - GlobalShaderCache().forEachRenderable(RenderHighlighted::RenderCaller(RenderHighlighted(renderer, volume))); -} - -#endif diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp deleted file mode 100644 index 2f5596d1..00000000 --- a/radiant/renderstate.cpp +++ /dev/null @@ -1,2693 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "renderstate.h" - -#include "debugging/debugging.h" -#include "warnings.h" - -#include "ishaders.h" -#include "irender.h" -#include "itextures.h" -#include "igl.h" -#include "iglrender.h" -#include "renderable.h" -#include "qerplugin.h" - -#include -#include -#include -#include - -#include "math/matrix.h" -#include "math/aabb.h" -#include "generic/callback.h" -#include "texturelib.h" -#include "string/string.h" -#include "container/hashfunc.h" -#include "container/cache.h" -#include "generic/reference.h" -#include "moduleobservers.h" -#include "stream/filestream.h" -#include "stream/stringstream.h" -#include "os/file.h" -#include "preferences.h" - -#include "xywindow.h" - - - -#define DEBUG_RENDER 0 - -inline void debug_string(const char* string) -{ -#if(DEBUG_RENDER) - globalOutputStream() << string << "\n"; -#endif -} - -inline void debug_int(const char* comment, int i) -{ -#if(DEBUG_RENDER) - globalOutputStream() << comment << " " << i << "\n"; -#endif -} - -inline void debug_colour(const char* comment) -{ -#if(DEBUG_RENDER) - Vector4 v; - glGetFloatv(GL_CURRENT_COLOR, reinterpret_cast(&v)); - globalOutputStream() << comment << " colour: " - << v[0] << " " - << v[1] << " " - << v[2] << " " - << v[3]; - if(glIsEnabled(GL_COLOR_ARRAY)) - { - globalOutputStream() << " ARRAY"; - } - if(glIsEnabled(GL_COLOR_MATERIAL)) - { - globalOutputStream() << " MATERIAL"; - } - globalOutputStream() << "\n"; -#endif -} - -#include "timer.h" - -StringOutputStream g_renderer_stats; -std::size_t g_count_prims; -std::size_t g_count_states; -std::size_t g_count_transforms; -Timer g_timer; - -inline void count_prim() -{ - ++g_count_prims; -} - -inline void count_state() -{ - ++g_count_states; -} - -inline void count_transform() -{ - ++g_count_transforms; -} - -void Renderer_ResetStats() -{ - g_count_prims = 0; - g_count_states = 0; - g_count_transforms = 0; - g_timer.start(); -} - -const char* Renderer_GetStats() -{ - g_renderer_stats.clear(); - g_renderer_stats << "prims: " << Unsigned(g_count_prims) - << " | states: " << Unsigned(g_count_states) - << " | transforms: " << Unsigned(g_count_transforms) - << " | msec: " << g_timer.elapsed_msec(); - return g_renderer_stats.c_str(); -} - - -void printShaderLog(GLhandleARB object) -{ - GLint log_length = 0; - glGetObjectParameterivARB(object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length); - - Array log(log_length); - glGetInfoLogARB(object, log_length, &log_length, log.data()); - - globalErrorStream() << StringRange(log.begin(), log.begin() + log_length) << "\n"; -} - -void createShader(GLhandleARB program, const char* filename, GLenum type) -{ - GLhandleARB shader = glCreateShaderObjectARB(type); - GlobalOpenGL_debugAssertNoErrors(); - - // load shader - { - std::size_t size = file_size(filename); - FileInputStream file(filename); - ASSERT_MESSAGE(!file.failed(), "failed to open " << makeQuoted(filename)); - Array buffer(size); - size = file.read(reinterpret_cast(buffer.data()), size); - - const GLcharARB* string = buffer.data(); - GLint length = GLint(size); - glShaderSourceARB(shader, 1, &string, &length); - } - - // compile shader - { - glCompileShaderARB(shader); - - GLint compiled = 0; - glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &compiled); - - if(!compiled) - { - printShaderLog(shader); - } - - ASSERT_MESSAGE(compiled, "shader compile failed: " << makeQuoted(filename)); - } - - // attach shader - glAttachObjectARB(program, shader); - - glDeleteObjectARB(shader); - - GlobalOpenGL_debugAssertNoErrors(); -} - -void GLSLProgram_link(GLhandleARB program) -{ - glLinkProgramARB(program); - - GLint linked = false; - glGetObjectParameterivARB(program, GL_OBJECT_LINK_STATUS_ARB, &linked); - - if(!linked) - { - printShaderLog(program); - } - - ASSERT_MESSAGE(linked, "program link failed"); -} - -void GLSLProgram_validate(GLhandleARB program) -{ - glValidateProgramARB(program); - - GLint validated = false; - glGetObjectParameterivARB(program, GL_OBJECT_VALIDATE_STATUS_ARB, &validated); - - if(!validated) - { - printShaderLog(program); - } - - ASSERT_MESSAGE(validated, "program validation failed"); -} - -bool g_bumpGLSLPass_enabled = false; -bool g_depthfillPass_enabled = false; - -class GLSLBumpProgram : public GLProgram -{ -public: - GLhandleARB m_program; - qtexture_t* m_light_attenuation_xy; - qtexture_t* m_light_attenuation_z; - GLint u_view_origin; - GLint u_light_origin; - GLint u_light_color; - GLint u_bump_scale; - GLint u_specular_exponent; - - GLSLBumpProgram() : m_program(0), m_light_attenuation_xy(0), m_light_attenuation_z(0) - { - } - - void create() - { - // create program - m_program = glCreateProgramObjectARB(); - - // create shader - { - StringOutputStream filename(256); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glsl"; - createShader(m_program, filename.c_str(), GL_VERTEX_SHADER_ARB); - filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glsl"; - createShader(m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB); - } - - GLSLProgram_link(m_program); - GLSLProgram_validate(m_program); - - glUseProgramObjectARB(m_program); - - glBindAttribLocationARB(m_program, c_attr_TexCoord0, "attr_TexCoord0"); - glBindAttribLocationARB(m_program, c_attr_Tangent, "attr_Tangent"); - glBindAttribLocationARB(m_program, c_attr_Binormal, "attr_Binormal"); - - glUniform1iARB(glGetUniformLocationARB(m_program, "u_diffusemap"), 0); - glUniform1iARB(glGetUniformLocationARB(m_program, "u_bumpmap"), 1); - glUniform1iARB(glGetUniformLocationARB(m_program, "u_specularmap"), 2); - glUniform1iARB(glGetUniformLocationARB(m_program, "u_attenuationmap_xy"), 3); - glUniform1iARB(glGetUniformLocationARB(m_program, "u_attenuationmap_z"), 4); - - u_view_origin = glGetUniformLocationARB(m_program, "u_view_origin"); - u_light_origin = glGetUniformLocationARB(m_program, "u_light_origin"); - u_light_color = glGetUniformLocationARB(m_program, "u_light_color"); - u_bump_scale = glGetUniformLocationARB(m_program, "u_bump_scale"); - u_specular_exponent = glGetUniformLocationARB(m_program, "u_specular_exponent"); - - glUseProgramObjectARB(0); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void destroy() - { - glDeleteObjectARB(m_program); - m_program = 0; - } - - void enable() - { - glUseProgramObjectARB(m_program); - - glEnableVertexAttribArrayARB(c_attr_TexCoord0); - glEnableVertexAttribArrayARB(c_attr_Tangent); - glEnableVertexAttribArrayARB(c_attr_Binormal); - - GlobalOpenGL_debugAssertNoErrors(); - - debug_string("enable bump"); - g_bumpGLSLPass_enabled = true; - } - - void disable() - { - glUseProgramObjectARB(0); - - glDisableVertexAttribArrayARB(c_attr_TexCoord0); - glDisableVertexAttribArrayARB(c_attr_Tangent); - glDisableVertexAttribArrayARB(c_attr_Binormal); - - GlobalOpenGL_debugAssertNoErrors(); - - debug_string("disable bump"); - g_bumpGLSLPass_enabled = false; - } - - void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) - { - Matrix4 world2local(localToWorld); - matrix4_affine_invert(world2local); - - Vector3 localLight(origin); - matrix4_transform_point(world2local, localLight); - - Vector3 localViewer(viewer); - matrix4_transform_point(world2local, localViewer); - - Matrix4 local2light(world2light); - matrix4_multiply_by_matrix4(local2light, localToWorld); // local->world->light - - glUniform3fARB(u_view_origin, localViewer.x(), localViewer.y(), localViewer.z()); - glUniform3fARB(u_light_origin, localLight.x(), localLight.y(), localLight.z()); - glUniform3fARB(u_light_color, colour.x(), colour.y(), colour.z()); - glUniform1fARB(u_bump_scale, 1.0); - glUniform1fARB(u_specular_exponent, 32.0); - - glActiveTexture(GL_TEXTURE3); - glClientActiveTexture(GL_TEXTURE3); - - glMatrixMode(GL_TEXTURE); - glLoadMatrixf(reinterpret_cast(&local2light)); - glMatrixMode(GL_MODELVIEW); - - GlobalOpenGL_debugAssertNoErrors(); - } -}; - -GLSLBumpProgram g_bumpGLSL; - - -class GLSLDepthFillProgram : public GLProgram -{ -public: - GLhandleARB m_program; - - void create() - { - // create program - m_program = glCreateProgramObjectARB(); - - // create shader - { - StringOutputStream filename(256); - filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glsl"; - createShader(m_program, filename.c_str(), GL_VERTEX_SHADER_ARB); - filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glsl"; - createShader(m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB); - } - - GLSLProgram_link(m_program); - GLSLProgram_validate(m_program); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void destroy() - { - glDeleteObjectARB(m_program); - m_program = 0; - } - void enable() - { - glUseProgramObjectARB(m_program); - GlobalOpenGL_debugAssertNoErrors(); - debug_string("enable depthfill"); - g_depthfillPass_enabled = true; - } - void disable() - { - glUseProgramObjectARB(0); - GlobalOpenGL_debugAssertNoErrors(); - debug_string("disable depthfill"); - g_depthfillPass_enabled = false; - } - void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) - { - } -}; - -GLSLDepthFillProgram g_depthFillGLSL; - - -// ARB path - -void createProgram(const char* filename, GLenum type) -{ - std::size_t size = file_size(filename); - FileInputStream file(filename); - ASSERT_MESSAGE(!file.failed(), "failed to open " << makeQuoted(filename)); - Array buffer(size); - size = file.read(reinterpret_cast(buffer.data()), size); - - glProgramStringARB(type, GL_PROGRAM_FORMAT_ASCII_ARB, GLsizei(size), buffer.data()); - - if(GL_INVALID_OPERATION == glGetError()) - { - GLint errPos; - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); - const GLubyte* errString = glGetString(GL_PROGRAM_ERROR_STRING_ARB); - - globalErrorStream() << reinterpret_cast(filename) << ":" << errPos << "\n" << reinterpret_cast(errString); - - ERROR_MESSAGE("error in gl program"); - } -} - -class ARBBumpProgram : public GLProgram -{ -public: - GLuint m_vertex_program; - GLuint m_fragment_program; - - void create() - { - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - { - glGenProgramsARB(1, &m_vertex_program); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program); - StringOutputStream filename(256); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glp"; - createProgram(filename.c_str(), GL_VERTEX_PROGRAM_ARB); - - glGenProgramsARB(1, &m_fragment_program); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program); - filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glp"; - createProgram(filename.c_str(), GL_FRAGMENT_PROGRAM_ARB); - } - - glDisable(GL_VERTEX_PROGRAM_ARB); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void destroy() - { - glDeleteProgramsARB(1, &m_vertex_program); - glDeleteProgramsARB(1, &m_fragment_program); - GlobalOpenGL_debugAssertNoErrors(); - } - - void enable() - { - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program); - - glEnableVertexAttribArrayARB(8); - glEnableVertexAttribArrayARB(9); - glEnableVertexAttribArrayARB(10); - glEnableVertexAttribArrayARB(11); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void disable() - { - glDisable(GL_VERTEX_PROGRAM_ARB); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - - glDisableVertexAttribArrayARB(8); - glDisableVertexAttribArrayARB(9); - glDisableVertexAttribArrayARB(10); - glDisableVertexAttribArrayARB(11); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) - { - Matrix4 world2local(localToWorld); - matrix4_affine_invert(world2local); - - Vector3 localLight(origin); - matrix4_transform_point(world2local, localLight); - - Vector3 localViewer(viewer); - matrix4_transform_point(world2local, localViewer); - - Matrix4 local2light(world2light); - matrix4_multiply_by_matrix4(local2light, localToWorld); // local->world->light - - // view origin - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 4, localViewer.x(), localViewer.y(), localViewer.z(), 0); - - // light origin - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 2, localLight.x(), localLight.y(), localLight.z(), 1); - - // light colour - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 3, colour.x(), colour.y(), colour.z(), 0); - - // bump scale - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 1, 0, 0, 0); - - // specular exponent - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 5, 32, 0, 0, 0); - - - glActiveTexture(GL_TEXTURE3); - glClientActiveTexture(GL_TEXTURE3); - - glMatrixMode(GL_TEXTURE); - glLoadMatrixf(reinterpret_cast(&local2light)); - glMatrixMode(GL_MODELVIEW); - - GlobalOpenGL_debugAssertNoErrors(); - } -}; - -class ARBDepthFillProgram : public GLProgram -{ -public: - GLuint m_vertex_program; - GLuint m_fragment_program; - - void create() - { - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - { - glGenProgramsARB(1, &m_vertex_program); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program); - StringOutputStream filename(256); - filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glp"; - createProgram(filename.c_str(), GL_VERTEX_PROGRAM_ARB); - - glGenProgramsARB(1, &m_fragment_program); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program); - filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glp"; - createProgram(filename.c_str(), GL_FRAGMENT_PROGRAM_ARB); - } - - glDisable(GL_VERTEX_PROGRAM_ARB); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void destroy() - { - glDeleteProgramsARB(1, &m_vertex_program); - glDeleteProgramsARB(1, &m_fragment_program); - GlobalOpenGL_debugAssertNoErrors(); - } - - void enable() - { - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void disable() - { - glDisable(GL_VERTEX_PROGRAM_ARB); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - - GlobalOpenGL_debugAssertNoErrors(); - } - - void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) - { - } -}; - -ARBBumpProgram g_bumpARB; -ARBDepthFillProgram g_depthFillARB; - - -#if 0 -// NV20 path (unfinished) - -void createProgram(GLint program, const char* filename, GLenum type) -{ - std::size_t size = file_size(filename); - FileInputStream file(filename); - ASSERT_MESSAGE(!file.failed(), "failed to open " << makeQuoted(filename)); - Array buffer(size); - size = file.read(reinterpret_cast(buffer.data()), size); - - glLoadProgramNV(type, program, GLsizei(size), buffer.data()); - - if(GL_INVALID_OPERATION == glGetError()) - { - GLint errPos; - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_NV, &errPos); - const GLubyte* errString = glGetString(GL_PROGRAM_ERROR_STRING_NV); - - globalErrorStream() << filename << ":" << errPos << "\n" << errString; - - ERROR_MESSAGE("error in gl program"); - } -} - -GLuint m_vertex_program; -GLuint m_fragment_program; -qtexture_t* g_cube = 0; -qtexture_t* g_specular_lookup = 0; -qtexture_t* g_attenuation_xy = 0; -qtexture_t* g_attenuation_z = 0; - -void createVertexProgram() -{ - { - glGenProgramsNV(1, &m_vertex_program); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, m_vertex_program); - StringOutputStream filename(256); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.nv30"; - createProgram(m_vertex_program, filename.c_str(), GL_VERTEX_PROGRAM_NV); - - glGenProgramsNV(1, &m_fragment_program); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, m_fragment_program); - filename.clear(); - filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.nv30"; - createProgram(m_fragment_program, filename.c_str(), GL_FRAGMENT_PROGRAM_NV); - } - - g_cube = GlobalTexturesCache().capture("generated/cube"); - g_specular_lookup = GlobalTexturesCache().capture("generated/specular"); - - g_attenuation_xy = GlobalTexturesCache().capture("lights/squarelight1"); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, g_attenuation_xy->texture_number); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - - g_attenuation_z = GlobalTexturesCache().capture("lights/squarelight1a"); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, g_attenuation_z->texture_number); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - GlobalOpenGL_debugAssertNoErrors(); -} - -void destroyVertexProgram() -{ - glDeleteProgramsNV(1, &m_vertex_program); - glDeleteProgramsNV(1, &m_fragment_program); - GlobalOpenGL_debugAssertNoErrors(); - - GlobalTexturesCache().release(g_cube); - GlobalTexturesCache().release(g_specular_lookup); - GlobalTexturesCache().release(g_attenuation_xy); - GlobalTexturesCache().release(g_attenuation_z); -} - -bool g_vertexProgram_enabled = false; - -void enableVertexProgram() -{ - //set up the register combiners - //two general combiners - glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 2); - - //combiner 0 does tex0+tex1 -> spare0 - glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0_ARB, - GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, - GL_UNSIGNED_INVERT_NV, GL_RGB); - glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE1_ARB, - GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, - GL_UNSIGNED_INVERT_NV, GL_RGB); - glCombinerOutputNV(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_SPARE0_NV, - GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE); - - //combiner 1 does tex2 dot tex3 -> spare1 - glCombinerInputNV(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE2_ARB, - GL_EXPAND_NORMAL_NV, GL_RGB); - glCombinerInputNV(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_TEXTURE3_ARB, - GL_EXPAND_NORMAL_NV, GL_RGB); - glCombinerOutputNV(GL_COMBINER1_NV, GL_RGB, GL_SPARE1_NV, GL_DISCARD_NV, GL_DISCARD_NV, - GL_NONE, GL_NONE, GL_TRUE, GL_FALSE, GL_FALSE); - - - - //final combiner outputs (1-spare0)*constant color 0*spare1 - //do constant color 0*spare1 in the EF multiplier - glFinalCombinerInputNV(GL_VARIABLE_E_NV, GL_SPARE1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glFinalCombinerInputNV(GL_VARIABLE_F_NV, GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - - //now do (1-spare0)*EF - glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_E_TIMES_F_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB); - - glEnable(GL_VERTEX_PROGRAM_NV); - glEnable(GL_REGISTER_COMBINERS_NV); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, m_vertex_program); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, m_fragment_program); - - glActiveTexture(GL_TEXTURE0); - glEnable(GL_TEXTURE_2D); - glActiveTexture(GL_TEXTURE1); - glEnable(GL_TEXTURE_1D); - glActiveTexture(GL_TEXTURE2); - glEnable(GL_TEXTURE_2D); - glActiveTexture(GL_TEXTURE3); - glEnable(GL_TEXTURE_2D); - - glEnableClientState(GL_VERTEX_ATTRIB_ARRAY8_NV); - glEnableClientState(GL_VERTEX_ATTRIB_ARRAY9_NV); - glEnableClientState(GL_VERTEX_ATTRIB_ARRAY10_NV); - glEnableClientState(GL_VERTEX_ATTRIB_ARRAY11_NV); - - GlobalOpenGL_debugAssertNoErrors(); - g_vertexProgram_enabled = true; -} - -void disableVertexProgram() -{ - glDisable(GL_VERTEX_PROGRAM_NV); - glDisable(GL_REGISTER_COMBINERS_NV); - - glActiveTexture(GL_TEXTURE0); - glDisable(GL_TEXTURE_2D); - glActiveTexture(GL_TEXTURE1); - glDisable(GL_TEXTURE_1D); - glActiveTexture(GL_TEXTURE2); - glDisable(GL_TEXTURE_2D); - glActiveTexture(GL_TEXTURE3); - glDisable(GL_TEXTURE_2D); - - glDisableClientState(GL_VERTEX_ATTRIB_ARRAY8_NV); - glDisableClientState(GL_VERTEX_ATTRIB_ARRAY9_NV); - glDisableClientState(GL_VERTEX_ATTRIB_ARRAY10_NV); - glDisableClientState(GL_VERTEX_ATTRIB_ARRAY11_NV); - - GlobalOpenGL_debugAssertNoErrors(); - g_vertexProgram_enabled = false; -} - -class GLstringNV -{ -public: - const GLubyte* m_string; - const GLint m_length; - GLstringNV(const char* string) : m_string(reinterpret_cast(string)), m_length(GLint(string_length(string))) - { - } -}; - -GLstringNV g_light_origin("light_origin"); -GLstringNV g_view_origin("view_origin"); -GLstringNV g_light_color("light_color"); -GLstringNV g_bumpGLSL_scale("bump_scale"); -GLstringNV g_specular_exponent("specular_exponent"); - -void setVertexProgramEnvironment(const Vector3& localViewer) -{ - Matrix4 local2light(g_matrix4_identity); - matrix4_translate_by_vec3(local2light, Vector3(0.5, 0.5, 0.5)); - matrix4_scale_by_vec3(local2light, Vector3(0.5, 0.5, 0.5)); - matrix4_scale_by_vec3(local2light, Vector3(1.0 / 512.0, 1.0 / 512.0, 1.0 / 512.0)); - matrix4_translate_by_vec3(local2light, vector3_negated(localViewer)); - - glActiveTexture(GL_TEXTURE3); - glClientActiveTexture(GL_TEXTURE3); - - glMatrixMode(GL_TEXTURE); - glLoadMatrixf(reinterpret_cast(&local2light)); - glMatrixMode(GL_MODELVIEW); - - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_TEXTURE0_ARB, GL_IDENTITY_NV); - - // view origin - //qglProgramNamedParameter4fNV(m_fragment_program, g_view_origin.m_length, g_view_origin.m_string, localViewer.x(), localViewer.y(), localViewer.z(), 0); - - // light origin - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 8, localViewer.x(), localViewer.y(), localViewer.z(), 1.0f); - - // light colour - glCombinerParameterfNV(GL_CONSTANT_COLOR0_NV, 1, 1, 1, 1) - - // bump scale - //qglProgramNamedParameter4fNV(m_fragment_program, g_bumpGLSL_scale.m_length, g_bumpGLSL_scale.m_string, 1, 0, 0, 0); - - // specular exponent - //qglProgramNamedParameter4fNV(m_fragment_program, g_specular_exponent.m_length, g_specular_exponent.m_string, 32, 0, 0, 0); - - GlobalOpenGL_debugAssertNoErrors(); -} - -#endif - - -bool g_vertexArray_enabled = false; -bool g_normalArray_enabled = false; -bool g_texcoordArray_enabled = false; -bool g_colorArray_enabled = false; - -inline bool OpenGLState_less(const OpenGLState& self, const OpenGLState& other) -{ - //! Sort by sort-order override. - if(self.m_sort != other.m_sort) - { - return self.m_sort < other.m_sort; - } - //! Sort by texture handle. - if(self.m_texture != other.m_texture) - { - return self.m_texture < other.m_texture; - } - if(self.m_texture1 != other.m_texture1) - { - return self.m_texture1 < other.m_texture1; - } - if(self.m_texture2 != other.m_texture2) - { - return self.m_texture2 < other.m_texture2; - } - if(self.m_texture3 != other.m_texture3) - { - return self.m_texture3 < other.m_texture3; - } - if(self.m_texture4 != other.m_texture4) - { - return self.m_texture4 < other.m_texture4; - } - if(self.m_texture5 != other.m_texture5) - { - return self.m_texture5 < other.m_texture5; - } - if(self.m_texture6 != other.m_texture6) - { - return self.m_texture6 < other.m_texture6; - } - if(self.m_texture7 != other.m_texture7) - { - return self.m_texture7 < other.m_texture7; - } - //! Sort by state bit-vector. - if(self.m_state != other.m_state) - { - return self.m_state < other.m_state; - } - //! Comparing address makes sure states are never equal. - return &self < &other; -} - -void OpenGLState_constructDefault(OpenGLState& state) -{ - state.m_state = RENDER_DEFAULT; - - state.m_texture = 0; - state.m_texture1 = 0; - state.m_texture2 = 0; - state.m_texture3 = 0; - state.m_texture4 = 0; - state.m_texture5 = 0; - state.m_texture6 = 0; - state.m_texture7 = 0; - - state.m_colour[0] = 1; - state.m_colour[1] = 1; - state.m_colour[2] = 1; - state.m_colour[3] = 1; - - state.m_depthfunc = GL_LESS; - - state.m_blend_src = GL_SRC_ALPHA; - state.m_blend_dst = GL_ONE_MINUS_SRC_ALPHA; - - state.m_alphafunc = GL_ALWAYS; - state.m_alpharef = 0; - - state.m_linewidth = 1; - state.m_pointsize = 1; - - state.m_linestipple_factor = 1; - state.m_linestipple_pattern = 0xaaaa; - - state.m_fog = OpenGLFogState(); -} - - - - -/// \brief A container of Renderable references. -/// May contain the same Renderable multiple times, with different transforms. -class OpenGLStateBucket -{ -public: - struct RenderTransform - { - const Matrix4* m_transform; - const OpenGLRenderable *m_renderable; - const RendererLight* m_light; - - RenderTransform(const OpenGLRenderable& renderable, const Matrix4& transform, const RendererLight* light) - : m_transform(&transform), m_renderable(&renderable), m_light(light) - { - } - }; - - typedef std::vector Renderables; - -private: - - OpenGLState m_state; - Renderables m_renderables; - -public: - OpenGLStateBucket() - { - } - void addRenderable(const OpenGLRenderable& renderable, const Matrix4& modelview, const RendererLight* light = 0) - { - m_renderables.push_back(RenderTransform(renderable, modelview, light)); - } - - OpenGLState& state() - { - return m_state; - } - - void render(OpenGLState& current, unsigned int globalstate, const Vector3& viewer); -}; - -#define LIGHT_SHADER_DEBUG 0 - -#if LIGHT_SHADER_DEBUG -typedef std::vector LightDebugShaders; -LightDebugShaders g_lightDebugShaders; -#endif - -class OpenGLStateLess -{ -public: - bool operator()(const OpenGLState& self, const OpenGLState& other) const - { - return OpenGLState_less(self, other); - } -}; - -typedef ConstReference OpenGLStateReference; -typedef std::map OpenGLStates; -OpenGLStates g_state_sorted; - -class OpenGLStateBucketAdd -{ - OpenGLStateBucket& m_bucket; - const OpenGLRenderable& m_renderable; - const Matrix4& m_modelview; -public: - typedef const RendererLight& first_argument_type; - - OpenGLStateBucketAdd(OpenGLStateBucket& bucket, const OpenGLRenderable& renderable, const Matrix4& modelview) : - m_bucket(bucket), m_renderable(renderable), m_modelview(modelview) - { - } - void operator()(const RendererLight& light) - { - m_bucket.addRenderable(m_renderable, m_modelview, &light); - } -}; - -class CountLights -{ - std::size_t m_count; -public: - typedef RendererLight& first_argument_type; - - CountLights() : m_count(0) - { - } - void operator()(const RendererLight& light) - { - ++m_count; - } - std::size_t count() const - { - return m_count; - } -}; - -class OpenGLShader : public Shader -{ - typedef std::list Passes; - Passes m_passes; - IShader* m_shader; - std::size_t m_used; - ModuleObservers m_observers; -public: - OpenGLShader() : m_shader(0), m_used(0) - { - } - ~OpenGLShader() - { - } - void construct(const char* name); - void destroy() - { - if(m_shader) - { - m_shader->DecRef(); - } - m_shader = 0; - - for(Passes::iterator i = m_passes.begin(); i != m_passes.end(); ++i) - { - delete *i; - } - m_passes.clear(); - } - void addRenderable(const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights) - { - for(Passes::iterator i = m_passes.begin(); i != m_passes.end(); ++i) - { -#if LIGHT_SHADER_DEBUG - if(((*i)->state().m_state & RENDER_BUMP) != 0) - { - if(lights != 0) - { - CountLights counter; - lights->forEachLight(makeCallback1(counter)); - globalOutputStream() << "count = " << counter.count() << "\n"; - for(std::size_t i = 0; i < counter.count(); ++i) - { - g_lightDebugShaders[counter.count()]->addRenderable(renderable, modelview); - } - } - } - else -#else - if(((*i)->state().m_state & RENDER_BUMP) != 0) - { - if(lights != 0) - { - OpenGLStateBucketAdd add(*(*i), renderable, modelview); - lights->forEachLight(makeCallback1(add)); - } - } - else -#endif - { - (*i)->addRenderable(renderable, modelview); - } - } - } - void incrementUsed() - { - if(++m_used == 1 && m_shader != 0) - { - m_shader->SetInUse(true); - } - } - void decrementUsed() - { - if(--m_used == 0 && m_shader != 0) - { - m_shader->SetInUse(false); - } - } - bool realised() const - { - return m_shader != 0; - } - void attach(ModuleObserver& observer) - { - if(realised()) - { - observer.realise(); - } - m_observers.attach(observer); - } - void detach(ModuleObserver& observer) - { - if(realised()) - { - observer.unrealise(); - } - m_observers.detach(observer); - } - void realise(const CopiedString& name) - { - construct(name.c_str()); - - if(m_used != 0 && m_shader != 0) - { - m_shader->SetInUse(true); - } - - for(Passes::iterator i = m_passes.begin(); i != m_passes.end(); ++i) - { - g_state_sorted.insert(OpenGLStates::value_type(OpenGLStateReference((*i)->state()), *i)); - } - - m_observers.realise(); - } - void unrealise() - { - m_observers.unrealise(); - - for(Passes::iterator i = m_passes.begin(); i != m_passes.end(); ++i) - { - g_state_sorted.erase(OpenGLStateReference((*i)->state())); - } - - destroy(); - } - qtexture_t& getTexture() const - { - ASSERT_NOTNULL(m_shader); - return *m_shader->getTexture(); - } - unsigned int getFlags() const - { - ASSERT_NOTNULL(m_shader); - return m_shader->getFlags(); - } - IShader& getShader() const - { - ASSERT_NOTNULL(m_shader); - return *m_shader; - } - OpenGLState& appendDefaultPass() - { - m_passes.push_back(new OpenGLStateBucket); - OpenGLState& state = m_passes.back()->state(); - OpenGLState_constructDefault(state); - return state; - } -}; - - -inline bool lightEnabled(const RendererLight& light, const LightCullable& cullable) -{ - return cullable.testLight(light); -} - -typedef std::set RendererLights; - -#define DEBUG_LIGHT_SYNC 0 - -class LinearLightList : public LightList -{ - LightCullable& m_cullable; - RendererLights& m_allLights; - Callback m_evaluateChanged; - - typedef std::list Lights; - mutable Lights m_lights; - mutable bool m_lightsChanged; -public: - LinearLightList(LightCullable& cullable, RendererLights& lights, const Callback& evaluateChanged) : - m_cullable(cullable), m_allLights(lights), m_evaluateChanged(evaluateChanged) - { - m_lightsChanged = true; - } - void evaluateLights() const - { - m_evaluateChanged(); - if(m_lightsChanged) - { - m_lightsChanged = false; - - m_lights.clear(); - m_cullable.clearLights(); - for(RendererLights::const_iterator i = m_allLights.begin(); i != m_allLights.end(); ++i) - { - if(lightEnabled(*(*i), m_cullable)) - { - m_lights.push_back(*i); - m_cullable.insertLight(*(*i)); - } - } - } -#if(DEBUG_LIGHT_SYNC) - else - { - Lights lights; - for(RendererLights::const_iterator i = m_allLights.begin(); i != m_allLights.end(); ++i) - { - if(lightEnabled(*(*i), m_cullable)) - { - lights.push_back(*i); - } - } - ASSERT_MESSAGE( - !std::lexicographical_compare(lights.begin(), lights.end(), m_lights.begin(), m_lights.end()) - && !std::lexicographical_compare(m_lights.begin(), m_lights.end(), lights.begin(), lights.end()), - "lights out of sync" - ); - } -#endif - } - void forEachLight(const RendererLightCallback& callback) const - { - evaluateLights(); - - for(Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i) - { - callback(*(*i)); - } - } - void lightsChanged() const - { - m_lightsChanged = true; - } -}; - -inline void setFogState(const OpenGLFogState& state) -{ - glFogi(GL_FOG_MODE, state.mode); - glFogf(GL_FOG_DENSITY, state.density); - glFogf(GL_FOG_START, state.start); - glFogf(GL_FOG_END, state.end); - glFogi(GL_FOG_INDEX, state.index); - glFogfv(GL_FOG_COLOR, vector4_to_array(state.colour)); -} - -#define DEBUG_SHADERS 0 - -class OpenGLShaderCache : public ShaderCache, public TexturesCacheObserver, public ModuleObserver -{ - class CreateOpenGLShader - { - OpenGLShaderCache* m_cache; - public: - explicit CreateOpenGLShader(OpenGLShaderCache* cache = 0) - : m_cache(cache) - { - } - OpenGLShader* construct(const CopiedString& name) - { - OpenGLShader* shader = new OpenGLShader; - if(m_cache->realised()) - { - shader->realise(name); - } - return shader; - } - void destroy(OpenGLShader* shader) - { - if(m_cache->realised()) - { - shader->unrealise(); - } - delete shader; - } - }; - - typedef HashedCache, CreateOpenGLShader> Shaders; - Shaders m_shaders; - std::size_t m_unrealised; - - bool m_lightingEnabled; - bool m_lightingSupported; - bool m_useShaderLanguage; - -public: - OpenGLShaderCache() - : m_shaders(CreateOpenGLShader(this)), - m_unrealised(3), // wait until shaders, gl-context and textures are realised before creating any render-states - m_lightingEnabled(true), - m_lightingSupported(false), - m_useShaderLanguage(false), - m_lightsChanged(true), - m_traverseRenderablesMutex(false) - { - } - ~OpenGLShaderCache() - { - for(Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) - { - globalOutputStream() << "leaked shader: " << makeQuoted((*i).key.c_str()) << "\n"; - } - } - Shader* capture(const char* name) - { - ASSERT_MESSAGE(name[0] == '$' - || *name == '[' - || *name == '<' - || *name == '(' - || strchr(name, '\\') == 0, "shader name contains invalid characters: \"" << name << "\""); -#if DEBUG_SHADERS - globalOutputStream() << "shaders capture: " << makeQuoted(name) << '\n'; -#endif - return m_shaders.capture(name).get(); - } - void release(const char *name) - { -#if DEBUG_SHADERS - globalOutputStream() << "shaders release: " << makeQuoted(name) << '\n'; -#endif - m_shaders.release(name); - } - void render(RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer) - { - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(reinterpret_cast(&projection)); - #if 0 - //qglGetFloatv(GL_PROJECTION_MATRIX, reinterpret_cast(&projection)); - #endif - - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(reinterpret_cast(&modelview)); - #if 0 - //qglGetFloatv(GL_MODELVIEW_MATRIX, reinterpret_cast(&modelview)); - #endif - - ASSERT_MESSAGE(realised(), "render states are not realised"); - - // global settings that are not set in renderstates - glFrontFace(GL_CW); - glCullFace(GL_BACK); - glPolygonOffset(-1, 1); - { - const GLubyte pattern[132] = { - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, - 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55 - }; - glPolygonStipple(pattern); - } - glEnableClientState(GL_VERTEX_ARRAY); - g_vertexArray_enabled = true; - glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); - - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - glClientActiveTexture(GL_TEXTURE0); - } - - if(GlobalOpenGL().ARB_shader_objects()) - { - glUseProgramObjectARB(0); - glDisableVertexAttribArrayARB(c_attr_TexCoord0); - glDisableVertexAttribArrayARB(c_attr_Tangent); - glDisableVertexAttribArrayARB(c_attr_Binormal); - } - - if(globalstate & RENDER_TEXTURE) - { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - } - - OpenGLState current; - OpenGLState_constructDefault(current); - current.m_sort = OpenGLState::eSortFirst; - - // default renderstate settings - glLineStipple(current.m_linestipple_factor, current.m_linestipple_pattern); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glDisable(GL_LIGHTING); - glDisable(GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - g_texcoordArray_enabled = false; - glDisableClientState(GL_COLOR_ARRAY); - g_colorArray_enabled = false; - glDisableClientState(GL_NORMAL_ARRAY); - g_normalArray_enabled = false; - glDisable(GL_BLEND); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_CULL_FACE); - glShadeModel(GL_FLAT); - glDisable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); - glDisable(GL_ALPHA_TEST); - glDisable(GL_LINE_STIPPLE); - glDisable(GL_POLYGON_STIPPLE); - glDisable(GL_POLYGON_OFFSET_LINE); - - glBindTexture(GL_TEXTURE_2D, 0); - glColor4f(1,1,1,1); - glDepthFunc(GL_LESS); - glAlphaFunc(GL_ALWAYS, 0); - glLineWidth(1); - glPointSize(1); - - glHint(GL_FOG_HINT, GL_NICEST); - glDisable(GL_FOG); - setFogState(OpenGLFogState()); - - GlobalOpenGL_debugAssertNoErrors(); - - debug_string("begin rendering"); - for(OpenGLStates::iterator i = g_state_sorted.begin(); i != g_state_sorted.end(); ++i) - { - (*i).second->render(current, globalstate, viewer); - } - debug_string("end rendering"); - } - void realise() - { - if(--m_unrealised == 0) - { - if(lightingSupported() && lightingEnabled()) - { - if(useShaderLanguage()) - { - g_bumpGLSL.create(); - g_depthFillGLSL.create(); - } - else - { - g_bumpARB.create(); - g_depthFillARB.create(); - } - } - - for(Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) - { - if(!(*i).value.empty()) - { - (*i).value->realise(i->key); - } - } - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - for(Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) - { - if(!(*i).value.empty()) - { - (*i).value->unrealise(); - } - } - if(GlobalOpenGL().contextValid && lightingSupported() && lightingEnabled()) - { - if(useShaderLanguage()) - { - g_bumpGLSL.destroy(); - g_depthFillGLSL.destroy(); - } - else - { - g_bumpARB.destroy(); - g_depthFillARB.destroy(); - } - } - } - } - bool realised() - { - return m_unrealised == 0; - } - - - bool lightingEnabled() const - { - return m_lightingEnabled; - } - bool lightingSupported() const - { - return m_lightingSupported; - } - bool useShaderLanguage() const - { - return m_useShaderLanguage; - } - void setLighting(bool supported, bool enabled) - { - bool refresh = (m_lightingSupported && m_lightingEnabled) != (supported && enabled); - - if(refresh) - { - unrealise(); - GlobalShaderSystem().setLightingEnabled(supported && enabled); - } - - m_lightingSupported = supported; - m_lightingEnabled = enabled; - - if(refresh) - { - realise(); - } - } - void extensionsInitialised() - { - setLighting(GlobalOpenGL().GL_1_3() - && GlobalOpenGL().ARB_vertex_program() - && GlobalOpenGL().ARB_fragment_program() - && GlobalOpenGL().ARB_shader_objects() - && GlobalOpenGL().ARB_vertex_shader() - && GlobalOpenGL().ARB_fragment_shader() - && GlobalOpenGL().ARB_shading_language_100(), - m_lightingEnabled - ); - - if(!lightingSupported()) - { - globalOutputStream() << "Lighting mode requires OpenGL features not supported by your graphics drivers:\n"; - if(!GlobalOpenGL().GL_1_3()) - { - globalOutputStream() << " GL version 1.3 or better\n"; - } - if(!GlobalOpenGL().ARB_vertex_program()) - { - globalOutputStream() << " GL_ARB_vertex_program\n"; - } - if(!GlobalOpenGL().ARB_fragment_program()) - { - globalOutputStream() << " GL_ARB_fragment_program\n"; - } - if(!GlobalOpenGL().ARB_shader_objects()) - { - globalOutputStream() << " GL_ARB_shader_objects\n"; - } - if(!GlobalOpenGL().ARB_vertex_shader()) - { - globalOutputStream() << " GL_ARB_vertex_shader\n"; - } - if(!GlobalOpenGL().ARB_fragment_shader()) - { - globalOutputStream() << " GL_ARB_fragment_shader\n"; - } - if(!GlobalOpenGL().ARB_shading_language_100()) - { - globalOutputStream() << " GL_ARB_shading_language_100\n"; - } - } - } - void setLightingEnabled(bool enabled) - { - setLighting(m_lightingSupported, enabled); - } - - // light culling - - RendererLights m_lights; - bool m_lightsChanged; - typedef std::map LightLists; - LightLists m_lightLists; - - const LightList& attach(LightCullable& cullable) - { - return (*m_lightLists.insert(LightLists::value_type(&cullable, LinearLightList(cullable, m_lights, EvaluateChangedCaller(*this)))).first).second; - } - void detach(LightCullable& cullable) - { - m_lightLists.erase(&cullable); - } - void changed(LightCullable& cullable) - { - LightLists::iterator i = m_lightLists.find(&cullable); - ASSERT_MESSAGE(i != m_lightLists.end(), "cullable not attached"); - (*i).second.lightsChanged(); - } - void attach(RendererLight& light) - { - ASSERT_MESSAGE(m_lights.find(&light) == m_lights.end(), "light could not be attached"); - m_lights.insert(&light); - changed(light); - } - void detach(RendererLight& light) - { - ASSERT_MESSAGE(m_lights.find(&light) != m_lights.end(), "light could not be detached"); - m_lights.erase(&light); - changed(light); - } - void changed(RendererLight& light) - { - m_lightsChanged = true; - } - void evaluateChanged() - { - if(m_lightsChanged) - { - m_lightsChanged = false; - for(LightLists::iterator i = m_lightLists.begin(); i != m_lightLists.end(); ++i) - { - (*i).second.lightsChanged(); - } - } - } - typedef MemberCaller EvaluateChangedCaller; - - typedef std::set Renderables; - Renderables m_renderables; - mutable bool m_traverseRenderablesMutex; - - // renderables - void attachRenderable(const Renderable& renderable) - { - ASSERT_MESSAGE(!m_traverseRenderablesMutex, "attaching renderable during traversal"); - ASSERT_MESSAGE(m_renderables.find(&renderable) == m_renderables.end(), "renderable could not be attached"); - m_renderables.insert(&renderable); - } - void detachRenderable(const Renderable& renderable) - { - ASSERT_MESSAGE(!m_traverseRenderablesMutex, "detaching renderable during traversal"); - ASSERT_MESSAGE(m_renderables.find(&renderable) != m_renderables.end(), "renderable could not be detached"); - m_renderables.erase(&renderable); - } - void forEachRenderable(const RenderableCallback& callback) const - { - ASSERT_MESSAGE(!m_traverseRenderablesMutex, "for-each during traversal"); - m_traverseRenderablesMutex = true; - for(Renderables::const_iterator i = m_renderables.begin(); i != m_renderables.end(); ++i) - { - callback(*(*i)); - } - m_traverseRenderablesMutex = false; - } -}; - -static OpenGLShaderCache* g_ShaderCache; - -void ShaderCache_extensionsInitialised() -{ - g_ShaderCache->extensionsInitialised(); -} - -void ShaderCache_setBumpEnabled(bool enabled) -{ - g_ShaderCache->setLightingEnabled(enabled); -} - - -Vector3 g_DebugShaderColours[256]; -Shader* g_defaultPointLight = 0; - -void ShaderCache_Construct() -{ - g_ShaderCache = new OpenGLShaderCache; - GlobalTexturesCache().attach(*g_ShaderCache); - GlobalShaderSystem().attach(*g_ShaderCache); - - if(g_pGameDescription->mGameType == "doom3") - { - g_defaultPointLight = g_ShaderCache->capture("lights/defaultPointLight"); - //Shader* overbright = - g_ShaderCache->capture("$OVERBRIGHT"); - -#if LIGHT_SHADER_DEBUG - for(std::size_t i = 0; i < 256; ++i) - { - g_DebugShaderColours[i] = Vector3(i / 256.0, i / 256.0, i / 256.0); - } - - g_DebugShaderColours[0] = Vector3(1, 0, 0); - g_DebugShaderColours[1] = Vector3(1, 0.5, 0); - g_DebugShaderColours[2] = Vector3(1, 1, 0); - g_DebugShaderColours[3] = Vector3(0.5, 1, 0); - g_DebugShaderColours[4] = Vector3(0, 1, 0); - g_DebugShaderColours[5] = Vector3(0, 1, 0.5); - g_DebugShaderColours[6] = Vector3(0, 1, 1); - g_DebugShaderColours[7] = Vector3(0, 0.5, 1); - g_DebugShaderColours[8] = Vector3(0, 0, 1); - g_DebugShaderColours[9] = Vector3(0.5, 0, 1); - g_DebugShaderColours[10] = Vector3(1, 0, 1); - g_DebugShaderColours[11] = Vector3(1, 0, 0.5); - - g_lightDebugShaders.reserve(256); - StringOutputStream buffer(256); - for(std::size_t i = 0; i < 256; ++i) - { - buffer << "(" << g_DebugShaderColours[i].x() << " " << g_DebugShaderColours[i].y() << " " << g_DebugShaderColours[i].z() << ")"; - g_lightDebugShaders.push_back(g_ShaderCache->capture(buffer.c_str())); - buffer.clear(); - } -#endif - } -} - -void ShaderCache_Destroy() -{ - if(g_pGameDescription->mGameType == "doom3") - { - g_ShaderCache->release("lights/defaultPointLight"); - g_ShaderCache->release("$OVERBRIGHT"); - g_defaultPointLight = 0; - -#if LIGHT_SHADER_DEBUG - g_lightDebugShaders.clear(); - StringOutputStream buffer(256); - for(std::size_t i = 0; i < 256; ++i) - { - buffer << "(" << g_DebugShaderColours[i].x() << " " << g_DebugShaderColours[i].y() << " " << g_DebugShaderColours[i].z() << ")"; - g_ShaderCache->release(buffer.c_str()); - } -#endif - } - - GlobalShaderSystem().detach(*g_ShaderCache); - GlobalTexturesCache().detach(*g_ShaderCache); - delete g_ShaderCache; -} - -ShaderCache* GetShaderCache() -{ - return g_ShaderCache; -} - -inline void setTextureState(GLint& current, const GLint& texture, GLenum textureUnit) -{ - if(texture != current) - { - glActiveTexture(textureUnit); - glClientActiveTexture(textureUnit); - glBindTexture(GL_TEXTURE_2D, texture); - GlobalOpenGL_debugAssertNoErrors(); - current = texture; - } -} - -inline void setTextureState(GLint& current, const GLint& texture) -{ - if(texture != current) - { - glBindTexture(GL_TEXTURE_2D, texture); - GlobalOpenGL_debugAssertNoErrors(); - current = texture; - } -} - -inline void setState(unsigned int state, unsigned int delta, unsigned int flag, GLenum glflag) -{ - if(delta & state & flag) - { - glEnable(glflag); - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & flag) - { - glDisable(glflag); - GlobalOpenGL_debugAssertNoErrors(); - } -} - -void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned int globalstate) -{ - debug_int("sort", int(self.m_sort)); - debug_int("texture", self.m_texture); - debug_int("state", self.m_state); - debug_int("address", int(std::size_t(&self))); - - count_state(); - - if(self.m_state & RENDER_OVERRIDE) - { - globalstate |= RENDER_FILL | RENDER_DEPTHWRITE; - } - - const unsigned int state = self.m_state & globalstate; - const unsigned int delta = state ^ current.m_state; - - GlobalOpenGL_debugAssertNoErrors(); - - GLProgram* program = (state & RENDER_PROGRAM) != 0 ? self.m_program : 0; - - if(program != current.m_program) - { - if(current.m_program != 0) - { - current.m_program->disable(); - glColor4fv(vector4_to_array(current.m_colour)); - debug_colour("cleaning program"); - } - - current.m_program = program; - - if(current.m_program != 0) - { - current.m_program->enable(); - } - } - - if(delta & state & RENDER_FILL) - { - //qglPolygonMode (GL_BACK, GL_LINE); - //qglPolygonMode (GL_FRONT, GL_FILL); - glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & RENDER_FILL) - { - glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); - GlobalOpenGL_debugAssertNoErrors(); - } - - setState(state, delta, RENDER_OFFSETLINE, GL_POLYGON_OFFSET_LINE); - - if(delta & state & RENDER_LIGHTING) - { - glEnable(GL_LIGHTING); - glEnable(GL_COLOR_MATERIAL); - //qglEnable(GL_RESCALE_NORMAL); - glEnableClientState(GL_NORMAL_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - g_normalArray_enabled = true; - } - else if(delta & ~state & RENDER_LIGHTING) - { - glDisable(GL_LIGHTING); - glDisable(GL_COLOR_MATERIAL); - //qglDisable(GL_RESCALE_NORMAL); - glDisableClientState(GL_NORMAL_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - g_normalArray_enabled = false; - } - - if(delta & state & RENDER_TEXTURE) - { - GlobalOpenGL_debugAssertNoErrors(); - - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - glClientActiveTexture(GL_TEXTURE0); - } - - glEnable(GL_TEXTURE_2D); - - glColor4f(1,1,1,self.m_colour[3]); - debug_colour("setting texture"); - - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - g_texcoordArray_enabled = true; - } - else if(delta & ~state & RENDER_TEXTURE) - { - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - glClientActiveTexture(GL_TEXTURE0); - } - - glDisable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - - GlobalOpenGL_debugAssertNoErrors(); - g_texcoordArray_enabled = false; - } - - if(delta & state & RENDER_BLEND) - { -// FIXME: some .TGA are buggy, have a completely empty alpha channel -// if such brushes are rendered in this loop they would be totally transparent with GL_MODULATE -// so I decided using GL_DECAL instead -// if an empty-alpha-channel or nearly-empty texture is used. It will be blank-transparent. -// this could get better if you can get glTexEnviv (GL_TEXTURE_ENV, to work .. patches are welcome - - glEnable(GL_BLEND); - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - } - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & RENDER_BLEND) - { - glDisable(GL_BLEND); - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - } - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - GlobalOpenGL_debugAssertNoErrors(); - } - - setState(state, delta, RENDER_CULLFACE, GL_CULL_FACE); - - if(delta & state & RENDER_SMOOTH) - { - glShadeModel(GL_SMOOTH); - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & RENDER_SMOOTH) - { - glShadeModel(GL_FLAT); - GlobalOpenGL_debugAssertNoErrors(); - } - - setState(state, delta, RENDER_SCALED, GL_NORMALIZE); // not GL_RESCALE_NORMAL - - setState(state, delta, RENDER_DEPTHTEST, GL_DEPTH_TEST); - - if(delta & state & RENDER_DEPTHWRITE) - { - glDepthMask(GL_TRUE); - -#if DEBUG_RENDER - GLboolean depthEnabled; - glGetBooleanv(GL_DEPTH_WRITEMASK, &depthEnabled); - ASSERT_MESSAGE(depthEnabled, "failed to set depth buffer mask bit"); -#endif - debug_string("enabled depth-buffer writing"); - - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & RENDER_DEPTHWRITE) - { - glDepthMask(GL_FALSE); - -#if DEBUG_RENDER - GLboolean depthEnabled; - glGetBooleanv(GL_DEPTH_WRITEMASK, &depthEnabled); - ASSERT_MESSAGE(!depthEnabled, "failed to set depth buffer mask bit"); -#endif - debug_string("disabled depth-buffer writing"); - - GlobalOpenGL_debugAssertNoErrors(); - } - - if(delta & state & RENDER_COLOURWRITE) - { - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - GlobalOpenGL_debugAssertNoErrors(); - } - else if(delta & ~state & RENDER_COLOURWRITE) - { - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - GlobalOpenGL_debugAssertNoErrors(); - } - - setState(state, delta, RENDER_ALPHATEST, GL_ALPHA_TEST); - - if(delta & state & RENDER_COLOURARRAY) - { - glEnableClientState(GL_COLOR_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - debug_colour("enabling color_array"); - g_colorArray_enabled = true; - } - else if(delta & ~state & RENDER_COLOURARRAY) - { - glDisableClientState(GL_COLOR_ARRAY); - glColor4fv(vector4_to_array(self.m_colour)); - debug_colour("cleaning color_array"); - GlobalOpenGL_debugAssertNoErrors(); - g_colorArray_enabled = false; - } - - if(delta & ~state & RENDER_COLOURCHANGE) - { - glColor4fv(vector4_to_array(self.m_colour)); - GlobalOpenGL_debugAssertNoErrors(); - } - - setState(state, delta, RENDER_LINESTIPPLE, GL_LINE_STIPPLE); - setState(state, delta, RENDER_LINESMOOTH, GL_LINE_SMOOTH); - - setState(state, delta, RENDER_POLYGONSTIPPLE, GL_POLYGON_STIPPLE); - setState(state, delta, RENDER_POLYGONSMOOTH, GL_POLYGON_SMOOTH); - - setState(state, delta, RENDER_FOG, GL_FOG); - - if((state & RENDER_FOG) != 0) - { - setFogState(self.m_fog); - GlobalOpenGL_debugAssertNoErrors(); - current.m_fog = self.m_fog; - } - - if(state & RENDER_DEPTHTEST && self.m_depthfunc != current.m_depthfunc) - { - glDepthFunc(self.m_depthfunc); - GlobalOpenGL_debugAssertNoErrors(); - current.m_depthfunc = self.m_depthfunc; - } - - if(state & RENDER_LINESTIPPLE - && (self.m_linestipple_factor != current.m_linestipple_factor - || self.m_linestipple_pattern != current.m_linestipple_pattern)) - { - glLineStipple(self.m_linestipple_factor, self.m_linestipple_pattern); - GlobalOpenGL_debugAssertNoErrors(); - current.m_linestipple_factor = self.m_linestipple_factor; - current.m_linestipple_pattern = self.m_linestipple_pattern; - } - - - if(state & RENDER_ALPHATEST - && ( self.m_alphafunc != current.m_alphafunc - || self.m_alpharef != current.m_alpharef ) ) - { - glAlphaFunc(self.m_alphafunc, self.m_alpharef); - GlobalOpenGL_debugAssertNoErrors(); - current.m_alphafunc = self.m_alphafunc; - current.m_alpharef = self.m_alpharef; - } - - { - GLint texture0 = 0; - GLint texture1 = 0; - GLint texture2 = 0; - GLint texture3 = 0; - GLint texture4 = 0; - GLint texture5 = 0; - GLint texture6 = 0; - GLint texture7 = 0; - //if(state & RENDER_TEXTURE) != 0) - { - texture0 = self.m_texture; - texture1 = self.m_texture1; - texture2 = self.m_texture2; - texture3 = self.m_texture3; - texture4 = self.m_texture4; - texture5 = self.m_texture5; - texture6 = self.m_texture6; - texture7 = self.m_texture7; - } - - if(GlobalOpenGL().GL_1_3()) - { - setTextureState(current.m_texture, texture0, GL_TEXTURE0); - setTextureState(current.m_texture1, texture1, GL_TEXTURE1); - setTextureState(current.m_texture2, texture2, GL_TEXTURE2); - setTextureState(current.m_texture3, texture3, GL_TEXTURE3); - setTextureState(current.m_texture4, texture4, GL_TEXTURE4); - setTextureState(current.m_texture5, texture5, GL_TEXTURE5); - setTextureState(current.m_texture6, texture6, GL_TEXTURE6); - setTextureState(current.m_texture7, texture7, GL_TEXTURE7); - } - else - { - setTextureState(current.m_texture, texture0); - } - } - - - if(state & RENDER_TEXTURE && self.m_colour[3] != current.m_colour[3]) - { - debug_colour("setting alpha"); - glColor4f(1,1,1,self.m_colour[3]); - GlobalOpenGL_debugAssertNoErrors(); - } - - if(!(state & RENDER_TEXTURE) - && (self.m_colour[0] != current.m_colour[0] - || self.m_colour[1] != current.m_colour[1] - || self.m_colour[2] != current.m_colour[2] - || self.m_colour[3] != current.m_colour[3])) - { - glColor4fv(vector4_to_array(self.m_colour)); - debug_colour("setting non-texture"); - GlobalOpenGL_debugAssertNoErrors(); - } - current.m_colour = self.m_colour; - - if(state & RENDER_BLEND - && (self.m_blend_src != current.m_blend_src || self.m_blend_dst != current.m_blend_dst)) - { - glBlendFunc(self.m_blend_src, self.m_blend_dst); - GlobalOpenGL_debugAssertNoErrors(); - current.m_blend_src = self.m_blend_src; - current.m_blend_dst = self.m_blend_dst; - } - - if(!(state & RENDER_FILL) - && self.m_linewidth != current.m_linewidth) - { - glLineWidth(self.m_linewidth); - GlobalOpenGL_debugAssertNoErrors(); - current.m_linewidth = self.m_linewidth; - } - - if(!(state & RENDER_FILL) - && self.m_pointsize != current.m_pointsize) - { - glPointSize(self.m_pointsize); - GlobalOpenGL_debugAssertNoErrors(); - current.m_pointsize = self.m_pointsize; - } - - current.m_state = state; - - GlobalOpenGL_debugAssertNoErrors(); -} - -void Renderables_flush(OpenGLStateBucket::Renderables& renderables, OpenGLState& current, unsigned int globalstate, const Vector3& viewer) -{ - const Matrix4* transform = 0; - glPushMatrix(); - for(OpenGLStateBucket::Renderables::const_iterator i = renderables.begin(); i != renderables.end(); ++i) - { - //qglLoadMatrixf(i->m_transform); - if(!transform || (transform != (*i).m_transform && !matrix4_affine_equal(*transform, *(*i).m_transform))) - { - count_transform(); - transform = (*i).m_transform; - glPopMatrix(); - glPushMatrix(); - glMultMatrixf(reinterpret_cast(transform)); - glFrontFace(((current.m_state & RENDER_CULLFACE) != 0 && matrix4_handedness(*transform) == MATRIX4_RIGHTHANDED) ? GL_CW : GL_CCW); - } - - count_prim(); - - if(current.m_program != 0 && (*i).m_light != 0) - { - const IShader& lightShader = static_cast((*i).m_light->getShader())->getShader(); - if(lightShader.firstLayer() != 0) - { - GLuint attenuation_xy = lightShader.firstLayer()->texture()->texture_number; - GLuint attenuation_z = lightShader.lightFalloffImage() != 0 - ? lightShader.lightFalloffImage()->texture_number - : static_cast(g_defaultPointLight)->getShader().lightFalloffImage()->texture_number; - - setTextureState(current.m_texture3, attenuation_xy, GL_TEXTURE3); - glActiveTexture(GL_TEXTURE3); - glBindTexture(GL_TEXTURE_2D, attenuation_xy); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - - setTextureState(current.m_texture4, attenuation_z, GL_TEXTURE4); - glActiveTexture(GL_TEXTURE4); - glBindTexture(GL_TEXTURE_2D, attenuation_z); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - - AABB lightBounds((*i).m_light->aabb()); - - Matrix4 world2light(g_matrix4_identity); - - if((*i).m_light->isProjected()) - { - world2light = (*i).m_light->projection(); - matrix4_multiply_by_matrix4(world2light, matrix4_transposed((*i).m_light->rotation())); - matrix4_translate_by_vec3(world2light, vector3_negated(lightBounds.origin)); // world->lightBounds - } - if(!(*i).m_light->isProjected()) - { - matrix4_translate_by_vec3(world2light, Vector3(0.5f, 0.5f, 0.5f)); - matrix4_scale_by_vec3(world2light, Vector3(0.5f, 0.5f, 0.5f)); - matrix4_scale_by_vec3(world2light, Vector3(1.0f / lightBounds.extents.x(), 1.0f / lightBounds.extents.y(), 1.0f / lightBounds.extents.z())); - matrix4_multiply_by_matrix4(world2light, matrix4_transposed((*i).m_light->rotation())); - matrix4_translate_by_vec3(world2light, vector3_negated(lightBounds.origin)); // world->lightBounds - } - - current.m_program->setParameters(viewer, *(*i).m_transform, lightBounds.origin + (*i).m_light->offset(), (*i).m_light->colour(), world2light); - debug_string("set lightBounds parameters"); - } - } - - (*i).m_renderable->render(current.m_state); - } - glPopMatrix(); - renderables.clear(); -} - -void OpenGLStateBucket::render(OpenGLState& current, unsigned int globalstate, const Vector3& viewer) -{ - if((globalstate & m_state.m_state & RENDER_SCREEN) != 0) - { - OpenGLState_apply(m_state, current, globalstate); - debug_colour("screen fill"); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixf(reinterpret_cast(&g_matrix4_identity)); - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadMatrixf(reinterpret_cast(&g_matrix4_identity)); - - glBegin(GL_QUADS); - glVertex3f(-1, -1, 0); - glVertex3f(1, -1, 0); - glVertex3f(1, 1, 0); - glVertex3f(-1, 1, 0); - glEnd(); - - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - } - else if(!m_renderables.empty()) - { - OpenGLState_apply(m_state, current, globalstate); - Renderables_flush(m_renderables, current, globalstate, viewer); - } -} - - -class OpenGLStateMap : public OpenGLStateLibrary -{ - typedef std::map States; - States m_states; -public: - ~OpenGLStateMap() - { - ASSERT_MESSAGE(m_states.empty(), "OpenGLStateMap::~OpenGLStateMap: not empty"); - } - - typedef States::iterator iterator; - iterator begin() - { - return m_states.begin(); - } - iterator end() - { - return m_states.end(); - } - - void getDefaultState(OpenGLState& state) const - { - OpenGLState_constructDefault(state); - } - - void insert(const char* name, const OpenGLState& state) - { - bool inserted = m_states.insert(States::value_type(name, state)).second; - ASSERT_MESSAGE(inserted, "OpenGLStateMap::insert: " << name << " already exists"); - } - void erase(const char* name) - { - std::size_t count = m_states.erase(name); - ASSERT_MESSAGE(count == 1, "OpenGLStateMap::erase: " << name << " does not exist"); - } - - iterator find(const char* name) - { - return m_states.find(name); - } -}; - -OpenGLStateMap* g_openglStates = 0; - -inline GLenum convertBlendFactor(BlendFactor factor) -{ - switch(factor) - { - case BLEND_ZERO: - return GL_ZERO; - case BLEND_ONE: - return GL_ONE; - case BLEND_SRC_COLOUR: - return GL_SRC_COLOR; - case BLEND_ONE_MINUS_SRC_COLOUR: - return GL_ONE_MINUS_SRC_COLOR; - case BLEND_SRC_ALPHA: - return GL_SRC_ALPHA; - case BLEND_ONE_MINUS_SRC_ALPHA: - return GL_ONE_MINUS_SRC_ALPHA; - case BLEND_DST_COLOUR: - return GL_DST_COLOR; - case BLEND_ONE_MINUS_DST_COLOUR: - return GL_ONE_MINUS_DST_COLOR; - case BLEND_DST_ALPHA: - return GL_DST_ALPHA; - case BLEND_ONE_MINUS_DST_ALPHA: - return GL_ONE_MINUS_DST_ALPHA; - case BLEND_SRC_ALPHA_SATURATE: - return GL_SRC_ALPHA_SATURATE; - } - return GL_ZERO; -} - -/// \todo Define special-case shaders in a data file. -void OpenGLShader::construct(const char* name) -{ - OpenGLState& state = appendDefaultPass(); - switch(name[0]) - { - case '(': - sscanf(name, "(%g %g %g)", &state.m_colour[0], &state.m_colour[1], &state.m_colour[2]); - state.m_colour[3] = 1.0f; - state.m_state = RENDER_FILL|RENDER_LIGHTING|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFullbright; - break; - - case '[': - sscanf(name, "[%g %g %g]", &state.m_colour[0], &state.m_colour[1], &state.m_colour[2]); - state.m_colour[3] = 0.5f; - state.m_state = RENDER_FILL|RENDER_LIGHTING|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_BLEND; - state.m_sort = OpenGLState::eSortTranslucent; - break; - - case '<': - sscanf(name, "<%g %g %g>", &state.m_colour[0], &state.m_colour[1], &state.m_colour[2]); - state.m_colour[3] = 1; - state.m_state = RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFullbright; - state.m_depthfunc = GL_LESS; - state.m_linewidth = 1; - state.m_pointsize = 1; - break; - - case '$': - { - OpenGLStateMap::iterator i = g_openglStates->find(name); - if(i != g_openglStates->end()) - { - state = (*i).second; - break; - } - } - if(string_equal(name+1, "POINT")) - { - state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortControlFirst; - state.m_pointsize = 4; - } - else if(string_equal(name+1, "SELPOINT")) - { - state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortControlFirst + 1; - state.m_pointsize = 4; - } - else if(string_equal(name+1, "BIGPOINT")) - { - state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortControlFirst; - state.m_pointsize = 6; - } - else if(string_equal(name+1, "PIVOT")) - { - state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortGUI1; - state.m_linewidth = 2; - state.m_depthfunc = GL_LEQUAL; - - OpenGLState& hiddenLine = appendDefaultPass(); - hiddenLine.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_LINESTIPPLE; - hiddenLine.m_sort = OpenGLState::eSortGUI0; - hiddenLine.m_linewidth = 2; - hiddenLine.m_depthfunc = GL_GREATER; - } - else if(string_equal(name+1, "LATTICE")) - { - state.m_colour[0] = 1; - state.m_colour[1] = 0.5; - state.m_colour[2] = 0; - state.m_colour[3] = 1; - state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortControlFirst; - } - else if(string_equal(name+1, "WIREFRAME")) - { - state.m_state = RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFullbright; - } - else if(string_equal(name+1, "CAM_HIGHLIGHT")) - { - state.m_colour[0] = 1; - state.m_colour[1] = 0; - state.m_colour[2] = 0; - state.m_colour[3] = 0.3f; - state.m_state = RENDER_FILL|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortHighlight; - state.m_depthfunc = GL_LEQUAL; - } - else if(string_equal(name+1, "CAM_OVERLAY")) - { -#if 0 - state.m_state = RENDER_CULLFACE|RENDER_COLOURWRITE|RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortOverlayFirst; -#else - state.m_state = RENDER_CULLFACE|RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_OFFSETLINE; - state.m_sort = OpenGLState::eSortOverlayFirst + 1; - state.m_depthfunc = GL_LEQUAL; - - OpenGLState& hiddenLine = appendDefaultPass(); - hiddenLine.m_colour[0] = 0.75; - hiddenLine.m_colour[1] = 0.75; - hiddenLine.m_colour[2] = 0.75; - hiddenLine.m_colour[3] = 1; - hiddenLine.m_state = RENDER_CULLFACE|RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_OFFSETLINE|RENDER_LINESTIPPLE; - hiddenLine.m_sort = OpenGLState::eSortOverlayFirst; - hiddenLine.m_depthfunc = GL_GREATER; - hiddenLine.m_linestipple_factor = 2; -#endif - } - else if(string_equal(name+1, "XY_OVERLAY")) - { - state.m_colour[0] = g_xywindow_globals.color_selbrushes[0]; - state.m_colour[1] = g_xywindow_globals.color_selbrushes[1]; - state.m_colour[2] = g_xywindow_globals.color_selbrushes[2]; - state.m_colour[3] = 1; - state.m_state = RENDER_COLOURWRITE | RENDER_LINESTIPPLE; - state.m_sort = OpenGLState::eSortOverlayFirst; - state.m_linewidth = 2; - state.m_linestipple_factor = 3; - } - else if(string_equal(name+1, "DEBUG_CLIPPED")) - { - state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortLast; - } - else if(string_equal(name+1, "POINTFILE")) - { - state.m_colour[0] = 1; - state.m_colour[1] = 0; - state.m_colour[2] = 0; - state.m_colour[3] = 1; - state.m_state = RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFullbright; - state.m_linewidth = 4; - } - else if(string_equal(name+1, "LIGHT_SPHERE")) - { - state.m_colour[0] = .15f * .95f; - state.m_colour[1] = .15f * .95f; - state.m_colour[2] = .15f * .95f; - state.m_colour[3] = 1; - state.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_BLEND | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE; - state.m_blend_src = GL_ONE; - state.m_blend_dst = GL_ONE; - state.m_sort = OpenGLState::eSortTranslucent; - } - else if(string_equal(name+1, "Q3MAP2_LIGHT_SPHERE")) - { - state.m_colour[0] = .05f; - state.m_colour[1] = .05f; - state.m_colour[2] = .05f; - state.m_colour[3] = 1; - state.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_BLEND | RENDER_FILL; - state.m_blend_src = GL_ONE; - state.m_blend_dst = GL_ONE; - state.m_sort = OpenGLState::eSortTranslucent; - } - else if(string_equal(name+1, "WIRE_OVERLAY")) - { -#if 0 - state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE; - state.m_sort = OpenGLState::eSortOverlayFirst; -#else - state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE; - state.m_sort = OpenGLState::eSortGUI1; - state.m_depthfunc = GL_LEQUAL; - - OpenGLState& hiddenLine = appendDefaultPass(); - hiddenLine.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_LINESTIPPLE; - hiddenLine.m_sort = OpenGLState::eSortGUI0; - hiddenLine.m_depthfunc = GL_GREATER; -#endif - } - else if(string_equal(name+1, "FLATSHADE_OVERLAY")) - { - state.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOURARRAY | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE; - state.m_sort = OpenGLState::eSortGUI1; - state.m_depthfunc = GL_LEQUAL; - - OpenGLState& hiddenLine = appendDefaultPass(); - hiddenLine.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOURARRAY | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_POLYGONSTIPPLE; - hiddenLine.m_sort = OpenGLState::eSortGUI0; - hiddenLine.m_depthfunc = GL_GREATER; - } - else if(string_equal(name+1, "CLIPPER_OVERLAY")) - { - state.m_colour[0] = g_xywindow_globals.color_clipper[0]; - state.m_colour[1] = g_xywindow_globals.color_clipper[1]; - state.m_colour[2] = g_xywindow_globals.color_clipper[2]; - state.m_colour[3] = 1; - state.m_state = RENDER_CULLFACE | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_FILL | RENDER_POLYGONSTIPPLE; - state.m_sort = OpenGLState::eSortOverlayFirst; - } - else if(string_equal(name+1, "OVERBRIGHT")) - { - const float lightScale = 2; - state.m_colour[0] = lightScale * 0.5f; - state.m_colour[1] = lightScale * 0.5f; - state.m_colour[2] = lightScale * 0.5f; - state.m_colour[3] = 0.5; - state.m_state = RENDER_FILL|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_SCREEN; - state.m_sort = OpenGLState::eSortOverbrighten; - state.m_blend_src = GL_DST_COLOR; - state.m_blend_dst = GL_SRC_COLOR; - } - else - { - // default to something recognisable.. =) - ERROR_MESSAGE("hardcoded renderstate not found"); - state.m_colour[0] = 1; - state.m_colour[1] = 0; - state.m_colour[2] = 1; - state.m_colour[3] = 1; - state.m_state = RENDER_COLOURWRITE | RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFirst; - } - break; - default: - // construction from IShader - m_shader = QERApp_Shader_ForName(name); - - if(g_ShaderCache->lightingSupported() && g_ShaderCache->lightingEnabled() && m_shader->getBump() != 0 && m_shader->getBump()->texture_number != 0) // is a bump shader - { - state.m_state = RENDER_FILL | RENDER_CULLFACE | RENDER_TEXTURE | RENDER_DEPTHTEST | RENDER_DEPTHWRITE | RENDER_COLOURWRITE | RENDER_PROGRAM; - state.m_colour[0] = 0; - state.m_colour[1] = 0; - state.m_colour[2] = 0; - state.m_colour[3] = 1; - state.m_sort = OpenGLState::eSortOpaque; - - if(g_ShaderCache->useShaderLanguage()) - { - state.m_program = &g_depthFillGLSL; - } - else - { - state.m_program = &g_depthFillARB; - } - - OpenGLState& bumpPass = appendDefaultPass(); - bumpPass.m_texture = m_shader->getDiffuse()->texture_number; - bumpPass.m_texture1 = m_shader->getBump()->texture_number; - bumpPass.m_texture2 = m_shader->getSpecular()->texture_number; - - bumpPass.m_state = RENDER_BLEND|RENDER_FILL|RENDER_CULLFACE|RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_SMOOTH|RENDER_BUMP|RENDER_PROGRAM; - - if(g_ShaderCache->useShaderLanguage()) - { - bumpPass.m_state |= RENDER_LIGHTING; - bumpPass.m_program = &g_bumpGLSL; - } - else - { - bumpPass.m_program = &g_bumpARB; - } - - bumpPass.m_depthfunc = GL_LEQUAL; - bumpPass.m_sort = OpenGLState::eSortMultiFirst; - bumpPass.m_blend_src = GL_ONE; - bumpPass.m_blend_dst = GL_ONE; - } - else - { - state.m_texture = m_shader->getTexture()->texture_number; - - state.m_state = RENDER_FILL|RENDER_TEXTURE|RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_LIGHTING|RENDER_SMOOTH; - if((m_shader->getFlags() & QER_CULL) != 0) - { - if(m_shader->getCull() == IShader::eCullBack) - { - state.m_state |= RENDER_CULLFACE; - } - } - else - { - state.m_state |= RENDER_CULLFACE; - } - if((m_shader->getFlags() & QER_ALPHATEST) != 0) - { - state.m_state |= RENDER_ALPHATEST; - IShader::EAlphaFunc alphafunc; - m_shader->getAlphaFunc(&alphafunc, &state.m_alpharef); - switch(alphafunc) - { - case IShader::eAlways: - state.m_alphafunc = GL_ALWAYS; - case IShader::eEqual: - state.m_alphafunc = GL_EQUAL; - case IShader::eLess: - state.m_alphafunc = GL_LESS; - case IShader::eGreater: - state.m_alphafunc = GL_GREATER; - case IShader::eLEqual: - state.m_alphafunc = GL_LEQUAL; - case IShader::eGEqual: - state.m_alphafunc = GL_GEQUAL; - } - } - reinterpret_cast(state.m_colour) = m_shader->getTexture()->color; - state.m_colour[3] = 1.0f; - - if((m_shader->getFlags() & QER_TRANS) != 0) - { - state.m_state |= RENDER_BLEND; - state.m_colour[3] = m_shader->getTrans(); - state.m_sort = OpenGLState::eSortTranslucent; - BlendFunc blendFunc = m_shader->getBlendFunc(); - state.m_blend_src = convertBlendFactor(blendFunc.m_src); - state.m_blend_dst = convertBlendFactor(blendFunc.m_dst); - if(state.m_blend_src == GL_SRC_ALPHA || state.m_blend_dst == GL_SRC_ALPHA) - { - state.m_state |= RENDER_DEPTHWRITE; - } - } - else - { - state.m_state |= RENDER_DEPTHWRITE; - state.m_sort = OpenGLState::eSortFullbright; - } - } - } -} - - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class OpenGLStateLibraryAPI -{ - OpenGLStateMap m_stateMap; -public: - typedef OpenGLStateLibrary Type; - STRING_CONSTANT(Name, "*"); - - OpenGLStateLibraryAPI() - { - g_openglStates = &m_stateMap; - } - ~OpenGLStateLibraryAPI() - { - g_openglStates = 0; - } - OpenGLStateLibrary* getTable() - { - return &m_stateMap; - } -}; - -typedef SingletonModule OpenGLStateLibraryModule; -typedef Static StaticOpenGLStateLibraryModule; -StaticRegisterModule staticRegisterOpenGLStateLibrary(StaticOpenGLStateLibraryModule::instance()); - -class ShaderCacheDependencies : public GlobalShadersModuleRef, public GlobalTexturesModuleRef, public GlobalOpenGLStateLibraryModuleRef -{ -public: - ShaderCacheDependencies() : - GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders")) - { - } -}; - -class ShaderCacheAPI -{ - ShaderCache* m_shaderCache; -public: - typedef ShaderCache Type; - STRING_CONSTANT(Name, "*"); - - ShaderCacheAPI() - { - ShaderCache_Construct(); - - m_shaderCache = GetShaderCache(); - } - ~ShaderCacheAPI() - { - ShaderCache_Destroy(); - } - ShaderCache* getTable() - { - return m_shaderCache; - } -}; - -typedef SingletonModule ShaderCacheModule; -typedef Static StaticShaderCacheModule; -StaticRegisterModule staticRegisterShaderCache(StaticShaderCacheModule::instance()); - - diff --git a/radiant/renderstate.h b/radiant/renderstate.h deleted file mode 100644 index 9bbd2918..00000000 --- a/radiant/renderstate.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_RENDERSTATE_H) -#define INCLUDED_RENDERSTATE_H - -void ShaderCache_setBumpEnabled(bool enabled); -void ShaderCache_extensionsInitialised(); - -#endif diff --git a/radiant/resource.h b/radiant/resource.h index dc86a878..17099dac 100644 --- a/radiant/resource.h +++ b/radiant/resource.h @@ -1,16 +1,35 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. -// Used by radiant.rc +// Used by Q3Radiant.rc // #define IDI_RADIANT 101 -#define IDR_MENU1 102 -#define IDD_DIALOG1 103 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/radiant/scenegraph.cpp b/radiant/scenegraph.cpp deleted file mode 100644 index cb83691e..00000000 --- a/radiant/scenegraph.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "scenegraph.h" - -#include "debugging/debugging.h" - -#include -#include -#include - -#include "string/string.h" -#include "signal/signal.h" -#include "scenelib.h" -#include "instancelib.h" -#include "treemodel.h" - -class StringEqualPredicate -{ - const char* m_string; -public: - StringEqualPredicate(const char* string) : m_string(string) - { - } - bool operator()(const char* other) const - { - return string_equal(m_string, other); - } -}; - -template -class TypeIdMap -{ - typedef const char* TypeName; - typedef TypeName TypeNames[SIZE]; - TypeNames m_typeNames; - TypeName* m_typeNamesEnd; - -public: - TypeIdMap() : m_typeNamesEnd(m_typeNames) - { - } - TypeId getTypeId(const char* name) - { - TypeName* i = std::find_if(m_typeNames, m_typeNamesEnd, StringEqualPredicate(name)); - if(i == m_typeNamesEnd) - { - ASSERT_MESSAGE(m_typeNamesEnd != m_typeNames + SIZE, "reached maximum number of type names supported (" << Unsigned(SIZE) << ")"); - *m_typeNamesEnd++ = name; - } - return i - m_typeNames; - } -}; - -class CompiledGraph : public scene::Graph, public scene::Instantiable::Observer -{ - typedef std::map InstanceMap; - - InstanceMap m_instances; - scene::Instantiable::Observer* m_observer; - Signal0 m_boundsChanged; - scene::Path m_rootpath; - Signal0 m_sceneChangedCallbacks; - - TypeIdMap m_nodeTypeIds; - TypeIdMap m_instanceTypeIds; - -public: - - CompiledGraph(scene::Instantiable::Observer* observer) - : m_observer(observer) - { - } - - void addSceneChangedCallback(const SignalHandler& handler) - { - m_sceneChangedCallbacks.connectLast(handler); - } - void sceneChanged() - { - m_sceneChangedCallbacks(); - } - - scene::Node& root() - { - ASSERT_MESSAGE(!m_rootpath.empty(), "scenegraph root does not exist"); - return m_rootpath.top(); - } - void insert_root(scene::Node& root) - { - //globalOutputStream() << "insert_root\n"; - - ASSERT_MESSAGE(m_rootpath.empty(), "scenegraph root already exists"); - - root.IncRef(); - - Node_traverseSubgraph(root, InstanceSubgraphWalker(this, scene::Path(), 0)); - - m_rootpath.push(makeReference(root)); - } - void erase_root() - { - //globalOutputStream() << "erase_root\n"; - - ASSERT_MESSAGE(!m_rootpath.empty(), "scenegraph root does not exist"); - - scene::Node& root = m_rootpath.top(); - - m_rootpath.pop(); - - Node_traverseSubgraph(root, UninstanceSubgraphWalker(this, scene::Path())); - - root.DecRef(); - } - void boundsChanged() - { - m_boundsChanged(); - } - - void traverse(const Walker& walker) - { - traverse_subgraph(walker, m_instances.begin()); - } - - void traverse_subgraph(const Walker& walker, const scene::Path& start) - { - if(!m_instances.empty()) - { - traverse_subgraph(walker, m_instances.find(PathConstReference(start))); - } - } - - scene::Instance* find(const scene::Path& path) - { - InstanceMap::iterator i = m_instances.find(PathConstReference(path)); - if(i == m_instances.end()) - { - return 0; - } - return (*i).second; - } - - void insert(scene::Instance* instance) - { - m_instances.insert(InstanceMap::value_type(PathConstReference(instance->path()), instance)); - - m_observer->insert(instance); - } - void erase(scene::Instance* instance) - { - m_observer->erase(instance); - - m_instances.erase(PathConstReference(instance->path())); - } - - SignalHandlerId addBoundsChangedCallback(const SignalHandler& boundsChanged) - { - return m_boundsChanged.connectLast(boundsChanged); - } - void removeBoundsChangedCallback(SignalHandlerId id) - { - m_boundsChanged.disconnect(id); - } - - TypeId getNodeTypeId(const char* name) - { - return m_nodeTypeIds.getTypeId(name); - } - - TypeId getInstanceTypeId(const char* name) - { - return m_instanceTypeIds.getTypeId(name); - } - -private: - - bool pre(const Walker& walker, const InstanceMap::iterator& i) - { - return walker.pre(i->first, *i->second); - } - - void post(const Walker& walker, const InstanceMap::iterator& i) - { - walker.post(i->first, *i->second); - } - - void traverse_subgraph(const Walker& walker, InstanceMap::iterator i) - { - Stack stack; - if(i != m_instances.end()) - { - const std::size_t startSize = (*i).first.get().size(); - do - { - if(i != m_instances.end() - && stack.size() < ((*i).first.get().size() - startSize + 1)) - { - stack.push(i); - ++i; - if(!pre(walker, stack.top())) - { - // skip subgraph - while(i != m_instances.end() - && stack.size() < ((*i).first.get().size() - startSize + 1)) - { - ++i; - } - } - } - else - { - post(walker, stack.top()); - stack.pop(); - } - } - while(!stack.empty()); - } - } -}; - -namespace -{ - CompiledGraph* g_sceneGraph; - GraphTreeModel* g_tree_model; -} - -GraphTreeModel* scene_graph_get_tree_model() -{ - return g_tree_model; -} - - -class SceneGraphObserver : public scene::Instantiable::Observer -{ -public: - void insert(scene::Instance* instance) - { - g_sceneGraph->sceneChanged(); - graph_tree_model_insert(g_tree_model, *instance); - } - void erase(scene::Instance* instance) - { - g_sceneGraph->sceneChanged(); - graph_tree_model_erase(g_tree_model, *instance); - } -}; - -SceneGraphObserver g_SceneGraphObserver; - -void SceneGraph_Construct() -{ - g_tree_model = graph_tree_model_new(); - - g_sceneGraph = new CompiledGraph(&g_SceneGraphObserver); -} - -void SceneGraph_Destroy() -{ - delete g_sceneGraph; - - graph_tree_model_delete(g_tree_model); -} - - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class SceneGraphAPI -{ - scene::Graph* m_scenegraph; -public: - typedef scene::Graph Type; - STRING_CONSTANT(Name, "*"); - - SceneGraphAPI() - { - SceneGraph_Construct(); - - m_scenegraph = g_sceneGraph; - } - ~SceneGraphAPI() - { - SceneGraph_Destroy(); - } - scene::Graph* getTable() - { - return m_scenegraph; - } -}; - -typedef SingletonModule SceneGraphModule; -typedef Static StaticSceneGraphModule; -StaticRegisterModule staticRegisterSceneGraph(StaticSceneGraphModule::instance()); - diff --git a/radiant/scenegraph.h b/radiant/scenegraph.h deleted file mode 100644 index d269f8b4..00000000 --- a/radiant/scenegraph.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDEDE_SCENEGRAPH_H) -#define INCLUDED_SCENEGRAPH_H - -#endif diff --git a/radiant/select.cpp b/radiant/select.cpp index 70e815d1..f563d2de 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,1196 +19,2107 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "select.h" +// select.c +#include "stdafx.h" +#include +#include "filters.h" -#include "debugging/debugging.h" +// externs +CPtrArray g_SelectedFaces; +CPtrArray g_SelectedFaceBrushes; +CPtrArray& g_ptrSelectedFaces = g_SelectedFaces; +CPtrArray& g_ptrSelectedFaceBrushes = g_SelectedFaceBrushes; -#include "ientity.h" -#include "iselection.h" -#include "iundo.h" - -#include - -#include "stream/stringstream.h" -#include "signal/isignal.h" -#include "shaderlib.h" -#include "scenelib.h" - -#include "gtkutil/idledraw.h" -#include "gtkutil/dialog.h" -#include "gtkutil/widget.h" -#include "brushmanip.h" -#include "brush.h" -#include "patchmanip.h" -#include "patchdialog.h" -#include "selection.h" -#include "texwindow.h" -#include "gtkmisc.h" -#include "mainframe.h" -#include "grid.h" -#include "map.h" - - - -select_workzone_t g_select_workzone; - - -/** - Loops over all selected brushes and stores their - world AABBs in the specified array. +/* +=========== +Test_Ray +=========== */ -class CollectSelectedBrushesBounds : public SelectionSystem::Visitor +#define DIST_START 999999 +trace_t Test_Ray (vec3_t origin, vec3_t dir, int flags) { - AABB* m_bounds; // array of AABBs - Unsigned m_max; // max AABB-elements in array - Unsigned& m_count;// count of valid AABBs stored in array + brush_t *brush; + face_t *face; + float dist; + trace_t t; -public: - CollectSelectedBrushesBounds(AABB* bounds, Unsigned max, Unsigned& count) - : m_bounds(bounds), - m_max(max), - m_count(count) + memset (&t, 0, sizeof(t)); + t.dist = DIST_START; + + if (flags & SF_CYCLE) + { + CPtrArray array; + brush_t *pToSelect = (selected_brushes.next != &selected_brushes) ? selected_brushes.next : NULL; + Select_Deselect(); + + // go through active brushes and accumulate all "hit" brushes + for (brush = active_brushes.next ; brush != &active_brushes ; brush=brush->next) + { + //if ( (flags & SF_ENTITIES_FIRST) && brush->owner == world_entity) + // continue; + + if (brush->bFiltered) + continue; + + if (!g_PrefsDlg.m_bSelectCurves && brush->patchBrush) + continue; + + if (!g_PrefsDlg.m_bSelectModels && (brush->owner->eclass->nShowFlags & ECLASS_MISCMODEL)) + continue; + + //if (!g_bShowPatchBounds && brush->patchBrush) + // continue; + + face = Brush_Ray (origin, dir, brush, &dist, flags); + + if (face) + array.Add(brush); + } + + int nSize = array.GetSize(); + if (nSize > 0) + { + bool bFound = false; + for (int i = 0; i < nSize; i++) + { + brush_t *b = reinterpret_cast(array.GetAt(i)); + // did we hit the last one selected yet ? + if (b == pToSelect) + { + // yes we want to select the next one in the list + int n = (i > 0) ? i-1 : nSize-1; + pToSelect = reinterpret_cast(array.GetAt(n)); + bFound = true; + break; + } + } + if (!bFound) + pToSelect = reinterpret_cast(array.GetAt(0)); + } + if (pToSelect) + { + face = Brush_Ray (origin, dir, pToSelect, &dist, flags); + t.dist = dist; + t.brush = pToSelect; + t.face = face; + t.selected = false; + return t; + } + } + + if (! (flags & SF_SELECTED_ONLY) ) { - m_count = 0; + for (brush = active_brushes.next ; brush != &active_brushes ; brush=brush->next) + { + if ( (flags & SF_ENTITIES_FIRST) && (brush->owner == world_entity || !brush->owner->eclass->fixedsize)) + continue; + + if (brush->bFiltered) + continue; + + if (!g_PrefsDlg.m_bSelectCurves && brush->patchBrush) + continue; + + if (!g_PrefsDlg.m_bSelectModels && (brush->owner->eclass->nShowFlags & ECLASS_MISCMODEL)) + continue; + + //if (!g_bShowPatchBounds && brush->patchBrush) + // continue; + + face = Brush_Ray (origin, dir, brush, &dist, flags); + if (face && dist > 0 && dist < t.dist) + { + t.dist = dist; + t.brush = brush; + t.face = face; + t.selected = false; + } + } } - void visit(scene::Instance& instance) const + + for (brush = selected_brushes.next ; brush != &selected_brushes ; brush=brush->next) + { + if ( (flags & SF_ENTITIES_FIRST) && (brush->owner == world_entity || !brush->owner->eclass->fixedsize)) + continue; + + if (brush->bFiltered) + continue; + + if (!g_PrefsDlg.m_bSelectCurves && brush->patchBrush) + continue; + + if (!g_PrefsDlg.m_bSelectModels && (brush->owner->eclass->nShowFlags & ECLASS_MISCMODEL)) + continue; + + face = Brush_Ray (origin, dir, brush, &dist, flags); + if (dist > 0 && dist < t.dist) + { + t.dist = dist; + t.brush = brush; + t.face = face; + t.selected = true; + } + } + + // if entites first, but didn't find any, check regular + + if ( (flags & SF_ENTITIES_FIRST) && t.brush == NULL) + return Test_Ray (origin, dir, flags & ~SF_ENTITIES_FIRST); + + return t; + +} + + +/* +============ +Select_Brush + +============ +*/ +void Select_Brush (brush_t *brush, bool bComplete, bool bStatus) +{ + brush_t *b; + entity_t *e; + + g_ptrSelectedFaces.RemoveAll(); + g_ptrSelectedFaceBrushes.RemoveAll(); + if (g_qeglobals.d_select_count < 2) + g_qeglobals.d_select_order[g_qeglobals.d_select_count] = brush; + g_qeglobals.d_select_count++; + + e = brush->owner; + if (e) + { + // select complete entity on first click + if (e != world_entity && bComplete == true) + { + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + if (b->owner == e) + goto singleselect; + for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext) + { + if( b == brush ) // make sure we add the actual selected brush last, mainly for cycle select + continue; + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + Brush_RemoveFromList (brush); + Brush_AddToList (brush, &selected_brushes); + } + else + { + singleselect: + Brush_RemoveFromList (brush); + Brush_AddToList (brush, &selected_brushes); + UpdatePatchInspector(); + } + + if (e->eclass) + { + UpdateEntitySel(brush->owner->eclass); + } + + UpdateSurfaceDialog(); + } + + if (bStatus) { - ASSERT_MESSAGE(m_count <= m_max, "Invalid m_count in CollectSelectedBrushesBounds"); + vec3_t vMin, vMax, vSize; + Select_GetBounds (vMin, vMax); + VectorSubtract(vMax, vMin, vSize); + CString strStatus; + strStatus.Format("Selection X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2]); + g_pParentWnd->SetStatusText(2, strStatus); + } +} - // stop if the array is already full - if(m_count == m_max) - return; +/* +============= +Select_FaceInSelectedBrushes +============= +*/ +bool Select_FaceInSelectedBrushes( face_t *face ) +{ + brush_t *brush; + face_t *tface; - Selectable* selectable = Instance_getSelectable(instance); - if((selectable != 0) - && instance.isSelected()) + for(brush = selected_brushes.next; brush != &selected_brushes; brush = brush->next) + { + for(tface = brush->brush_faces; tface; tface = tface->next) { - // brushes only - if(Instance_getBrush(instance) != 0) + if(tface == face) { - m_bounds[m_count] = instance.worldAABB(); - ++m_count; + return true; } } } -}; -/** - Selects all objects that intersect one of the bounding AABBs. - The exact intersection-method is specified through TSelectionPolicy + return false; +} + +/* +============ +Select_Ray + +If the origin is inside a brush, that brush will be ignored. +============ */ -template -class SelectByBounds : public scene::Graph::Walker +void Select_Ray (vec3_t origin, vec3_t dir, int flags) { - AABB* m_aabbs; // selection aabbs - Unsigned m_count; // number of aabbs in m_aabbs - TSelectionPolicy policy; // type that contains a custom intersection method aabb<->aabb + trace_t t; + face_t *tface; + bool bOk; + static trace_t lastTrace = { + NULL, // brush + NULL, // face + 0, // dist + false // selected + }; -public: - SelectByBounds(AABB* aabbs, Unsigned count) - : m_aabbs(aabbs), - m_count(count) + t = Test_Ray (origin, dir, flags); + if (!t.brush) + return; + + if (flags & SF_SINGLEFACE) { - } - - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - - // ignore worldspawn - Entity* entity = Node_getEntity(path.top()); - if(entity) + if( flags & SF_DRAG ) { - if(string_equal(entity->getKeyValue("classname"), "worldspawn")) - return true; - } - - if( (path.size() > 1) && - (!path.top().get().isRoot()) && - (selectable != 0) - ) + if ( t.brush == lastTrace.brush && t.face == lastTrace.face ) + return; + } + lastTrace = t; + + if(Select_FaceInSelectedBrushes(t.face)) { - for(Unsigned i = 0; i < m_count; ++i) + // Deselect the brush + Brush_RemoveFromList (t.brush); + Brush_AddToList (t.brush, &active_brushes); + UpdatePatchInspector(); + + // Select all of the brush's faces except the one we are pointing at + for( tface = t.brush->brush_faces; tface; tface = tface->next ) { - if(policy.Evaluate(m_aabbs[i], instance)) + if( tface == t.face ) + continue; + + bOk = true; + // NOTE: keep the size check in the loop, we remove stuff inside + for (int i = 0; i < g_SelectedFaces.GetSize(); i++) { - selectable->setSelected(true); + if (tface == reinterpret_cast(g_SelectedFaces.GetAt(i))) + bOk = false; + } + + if(bOk) + { + g_SelectedFaces.Add(tface); + g_SelectedFaceBrushes.Add(t.brush); } } + g_qeglobals.d_select_mode = sel_facets_off; } - - return true; - } - - /** - Performs selection operation on the global scenegraph. - If delete_bounds_src is true, then the objects which were - used as source for the selection aabbs will be deleted. -*/ - static void DoSelection(bool delete_bounds_src = true) - { - if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) + else { - // we may not need all AABBs since not all selected objects have to be brushes - const Unsigned max = (Unsigned)GlobalSelectionSystem().countSelected(); - AABB* aabbs = new AABB[max]; - - Unsigned count; - CollectSelectedBrushesBounds collector(aabbs, max, count); - GlobalSelectionSystem().foreachSelected(collector); + bOk = true; + // NOTE: keep the size check in the loop, we remove stuff inside + for (int i = 0; i < g_SelectedFaces.GetSize(); i++) + { + if (t.face == reinterpret_cast(g_SelectedFaces.GetAt(i))) + { + bOk = false; + if( flags & SF_DRAG_ON ) + continue; - // nothing usable in selection - if(!count) - { - delete[] aabbs; - return; - } - - // delete selected objects - if(delete_bounds_src)// see deleteSelection - { - UndoableCommand undo("deleteSelected"); - Select_Delete(); + g_qeglobals.d_select_mode = sel_facets_off; + // need to remove i'th entry + g_SelectedFaces.RemoveAt(i, 1); + g_SelectedFaceBrushes.RemoveAt(i, 1); + } } - // select objects with bounds - GlobalSceneGraph().traverse(SelectByBounds(aabbs, count)); - - SceneChangeNotify(); - delete[] aabbs; - } - } -}; - -/** - SelectionPolicy for SelectByBounds - Returns true if box and the AABB of instance intersect -*/ -class SelectionPolicy_Touching -{ -public: - bool Evaluate(const AABB& box, scene::Instance& instance) const - { - const AABB& other(instance.worldAABB()); - for(Unsigned i = 0; i < 3; ++i) - { - if(fabsf(box.origin[i] - other.origin[i]) > (box.extents[i] + other.extents[i])) - return false; - } - return true; - } -}; - -/** - SelectionPolicy for SelectByBounds - Returns true if the AABB of instance is inside box -*/ -class SelectionPolicy_Inside -{ -public: - bool Evaluate(const AABB& box, scene::Instance& instance) const - { - const AABB& other(instance.worldAABB()); - for(Unsigned i = 0; i < 3; ++i) - { - if(fabsf(box.origin[i] - other.origin[i]) > (box.extents[i] - other.extents[i])) - return false; - } - return true; - } -}; - -class DeleteSelected : public scene::Graph::Walker -{ - mutable bool m_remove; - mutable bool m_removedChild; -public: - DeleteSelected() - : m_remove(false), m_removedChild(false) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - m_removedChild = false; - - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected() - && path.size() > 1 - && !path.top().get().isRoot()) - { - m_remove = true; - - return false;// dont traverse into child elements - } - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - - if(m_removedChild) - { - m_removedChild = false; - - // delete empty entities - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && path.top().get_pointer() != Map_FindWorldspawn(g_map) - && Node_getTraversable(path.top())->empty()) + if (bOk && !(flags & SF_DRAG_OFF)) { - Path_deleteTop(path); + g_SelectedFaces.Add(t.face); + g_SelectedFaceBrushes.Add(t.brush); + g_qeglobals.d_select_mode = sel_facets_on; } } - - // node should be removed - if(m_remove) - { - if(Node_isEntity(path.parent()) != 0) - { - m_removedChild = true; - } - - m_remove = false; - Path_deleteTop(path); - } + UpdateSurfaceDialog(); + Sys_UpdateWindows (W_ALL); + //g_qeglobals.d_select_mode = sel_brush; + // Texture_SetTexture requires a brushprimit_texdef fitted to the default width=2 height=2 texture + brushprimit_texdef_t brushprimit_texdef; + ConvertTexMatWithQTexture ( &t.face->brushprimit_texdef, t.face->d_texture, &brushprimit_texdef, NULL ); + Texture_SetTexture ( &t.face->texdef, &brushprimit_texdef, false, NULL, false ); + return; } -}; -void Scene_DeleteSelected(scene::Graph& graph) -{ - graph.traverse(DeleteSelected()); - SceneChangeNotify(); + // move the brush to the other list + if (t.selected) + { + if( flags & SF_DRAG_ON ) + return; + + g_qeglobals.d_select_mode = sel_brush_off; + Brush_RemoveFromList (t.brush); + Brush_AddToList (t.brush, &active_brushes); + + UpdatePatchInspector(); + } + else + { + if( flags & SF_DRAG_OFF ) + return; + + g_qeglobals.d_select_mode = sel_brush_on; + Select_Brush (t.brush, g_PrefsDlg.m_nCamDragMultiSelect == 1 ? Sys_AltDown () : !Sys_AltDown ()); + } + UpdateSurfaceDialog(); + Sys_UpdateWindows (W_ALL); } + void Select_Delete (void) { - Scene_DeleteSelected(GlobalSceneGraph()); + brush_t *brush; + entity_t *e; + + g_ptrSelectedFaces.RemoveAll(); + g_ptrSelectedFaceBrushes.RemoveAll(); + + g_qeglobals.d_select_mode = sel_brush; + + g_qeglobals.d_select_count = 0; + g_qeglobals.d_num_move_points = 0; + while (selected_brushes.next != &selected_brushes) + { + brush = selected_brushes.next; + if (brush->patchBrush) + { + Patch_Delete(brush->pPatch); + } + e = brush->owner; + Brush_Free (brush); + // remove if no brushes + if (e != world_entity && e->brushes.onext == &e->brushes) + Entity_Free(e); + } + + Sys_MarkMapModified (); + UpdateSurfaceDialog(); + Sys_UpdateWindows (W_ALL); } -class InvertSelectionWalker : public scene::Graph::Walker +// update the workzone to a given brush +void UpdateWorkzone_ForBrush( brush_t* b ) { - SelectionSystem::EMode m_mode; - mutable Selectable* m_selectable; -public: - InvertSelectionWalker(SelectionSystem::EMode mode) - : m_mode(mode), m_selectable(0) + VectorCopy( b->mins, g_qeglobals.d_work_min ); + VectorCopy( b->maxs, g_qeglobals.d_work_max ); + //++timo clean +#if 0 + // will update the workzone to the given brush + // g_pParentWnd->ActiveXY()->GetViewType() + // cf VIEWTYPE defintion: enum VIEWTYPE {YZ, XZ, XY}; + // we fit our work zone to the last brush on the list (b) + int nViewType = g_pParentWnd->ActiveXY()->GetViewType(); + int nDim1 = (nViewType == YZ) ? 1 : 0; + int nDim2 = (nViewType == XY) ? 1 : 2; + g_qeglobals.d_work_min[nDim1] = b->mins[nDim1]; + g_qeglobals.d_work_max[nDim1] = b->maxs[nDim1]; + g_qeglobals.d_work_min[nDim2] = b->mins[nDim2]; + g_qeglobals.d_work_max[nDim2] = b->maxs[nDim2]; +#endif +} + +// here to filter new brushes once unselected +extern void PerformFiltering(); + +void Select_Deselect (bool bDeselectFaces) +{ + brush_t *b; + + Patch_Deselect(); + + g_pParentWnd->ActiveXY()->UndoClear(); + + g_qeglobals.d_workcount++; + g_qeglobals.d_select_count = 0; + g_qeglobals.d_num_move_points = 0; + b = selected_brushes.next; + + if (b == &selected_brushes) + { + if (bDeselectFaces) + { + g_ptrSelectedFaces.RemoveAll(); + g_ptrSelectedFaceBrushes.RemoveAll(); + } + PerformFiltering(); + UpdateSurfaceDialog(); + Sys_UpdateWindows (W_ALL); + return; + } + + if (bDeselectFaces) { + g_ptrSelectedFaces.RemoveAll(); + g_ptrSelectedFaceBrushes.RemoveAll(); } - bool pre(const scene::Path& path, scene::Instance& instance) const + + g_qeglobals.d_select_mode = sel_brush; + + UpdateWorkzone_ForBrush(b); + + selected_brushes.next->prev = &active_brushes; + selected_brushes.prev->next = active_brushes.next; + active_brushes.next->prev = selected_brushes.prev; + active_brushes.next = selected_brushes.next; + selected_brushes.prev = selected_brushes.next = &selected_brushes; + + // filter newly created stuff once it's unselected + PerformFiltering(); + UpdateSurfaceDialog(); + Sys_UpdateWindows (W_ALL); +} + +/* +============ +Select_Move +============ +*/ +/*! Moves the currently selected brush/patch + \param delta How far to move the selection (x,y,z) + \param bSnap If the move should snap to grid points +*/ +void Select_Move (vec3_t delta, bool bSnap) +{ + brush_t *b; + + // actually move the selected brushes + for (b = selected_brushes.next ; b != &selected_brushes ; b=b->next) + Brush_Move (b, delta, bSnap); + + vec3_t vMin, vMax; + Select_GetBounds (vMin, vMax); + CString strStatus; + strStatus.Format("Origin X:: %.1f Y:: %.1f Z:: %.1f", vMin[0], vMax[1], vMax[2]); + g_pParentWnd->SetStatusText(2, strStatus); + + //Sys_UpdateWindows (W_ALL); +} + +/* +================= +Select_NudgeVerts +================= +*/ +/*! Moves the currently selected brush/patch vertices + \param delta How far to move the vertices (x,y,z) + \param bSnap If the move should snap to grid points +*/ +void Select_NudgePoint(vec3_t delta, qboolean bSnap) +{ + if (g_qeglobals.d_select_mode == sel_vertex) { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable) + // move selected verts + brush_t *b; + vec3_t end; + qboolean success = true; + for (b = selected_brushes.next; b != &selected_brushes; b = b->next) { - switch(m_mode) - { - case SelectionSystem::eEntity: - if(Node_isEntity(path.top()) != 0) - { - m_selectable = path.top().get().visible() ? selectable : 0; - } - break; - case SelectionSystem::ePrimitive: - m_selectable = path.top().get().visible() ? selectable : 0; - break; - case SelectionSystem::eComponent: - break; - } + success &= (qboolean)Brush_MoveVertex(b, g_qeglobals.d_move_points[0], delta, end, bSnap); } - return true; + if (success) + VectorCopy(end, g_qeglobals.d_move_points[0]); } - void post(const scene::Path& path, scene::Instance& instance) const + else if (g_qeglobals.d_select_mode == sel_curvepoint) { - if(m_selectable != 0) - { - m_selectable->setSelected(!m_selectable->isSelected()); - m_selectable = 0; - } + // move selected patch control points + Patch_UpdateSelected(delta); } +} + +/* +============ +Select_Clone + +Creates an exact duplicate of the selection in place, then moves +the selected brushes off of their old positions +============ +*/ +void Select_Clone (void) +{ + g_bScreenUpdates = false; + g_pParentWnd->Copy(); + Select_Deselect(); + g_pParentWnd->Paste(); + g_pParentWnd->NudgeSelection(2, g_qeglobals.d_gridsize); + g_pParentWnd->NudgeSelection(3, g_qeglobals.d_gridsize); + Undo_Start("clone"); + Undo_EndBrushList(&selected_brushes); + Undo_End(); + g_bScreenUpdates = true; + Sys_UpdateWindows(W_ALL); +} + +//++timo clean +#if 0 +/* +============ +Select_SetTexture +Timo : bFitScale to compute scale on the plane and counteract plane / axial plane snapping +Timo : brush primitive texturing + the brushprimit_texdef given must be understood as a qtexture_t width=2 height=2 ( HiRes ) +Timo : texture plugin, added an IPluginTexdef* parameter + must be casted to an IPluginTexdef! + if not NULL, get ->Copy() of it into each face or brush ( and remember to hook ) + if NULL, means we have no information, ask for a default +TTimo - shader code cleanup + added IShader* parameter +============ +*/ +void WINAPI Select_SetTexture2 (IShader* pShader, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef ) +{ + brush_t *b; + int nCount = g_ptrSelectedFaces.GetSize(); + if (nCount > 0) + { + Undo_Start("set face textures"); + ASSERT(g_ptrSelectedFaces.GetSize() == g_ptrSelectedFaceBrushes.GetSize()); + for (int i = 0; i < nCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + Undo_AddBrush(selBrush); + //++timo TODO: propagate the IShader* .. + SetFaceTexdef (selFace, texdef, brushprimit_texdef, bFitScale, static_cast(pPlugTexdef) ); + Brush_Build(selBrush, bFitScale); + Undo_EndBrush(selBrush); + } + Undo_End(); + } + else if (selected_brushes.next != &selected_brushes) + { + Undo_Start("set brush textures"); + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + if (!b->owner->eclass->fixedsize) + { + Undo_AddBrush(b); + Brush_SetTexture2 (b, pShader, texdef, brushprimit_texdef, bFitScale, static_cast(pPlugTexdef) ); + Undo_EndBrush(b); + } + Undo_End(); + } + Sys_UpdateWindows (W_ALL); +} +#endif + +/* +============ +Select_SetTexture +Timo : bFitScale to compute scale on the plane and counteract plane / axial plane snapping +Timo : brush primitive texturing + the brushprimit_texdef given must be understood as a qtexture_t width=2 height=2 ( HiRes ) +Timo : texture plugin, added an IPluginTexdef* parameter + must be casted to an IPluginTexdef! + if not NULL, get ->Copy() of it into each face or brush ( and remember to hook ) + if NULL, means we have no information, ask for a default +============ +*/ +void WINAPI Select_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, void* pPlugTexdef ) +{ + /* +#ifdef _DEBUG + static int count = 0; +#endif + */ + brush_t *b; + /* +#ifdef _DEBUG + count++; + Sys_Printf("count: %d\n", count); + if(count==4) + Sys_Printf("break!\n"); +#endif + */ + int nCount = g_ptrSelectedFaces.GetSize(); + if (nCount > 0) + { + Undo_Start("set face textures"); + assert(g_ptrSelectedFaces.GetSize() == g_ptrSelectedFaceBrushes.GetSize()); + for (int i = 0; i < nCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + Undo_AddBrush(selBrush); + SetFaceTexdef (selFace, texdef, brushprimit_texdef, bFitScale, static_cast(pPlugTexdef) ); + Brush_Build(selBrush, bFitScale); + Undo_EndBrush(selBrush); + } + Undo_End(); + } + else if (selected_brushes.next != &selected_brushes) + { + Undo_Start("set brush textures"); + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + if (!b->owner->eclass->fixedsize) + { + Undo_AddBrush(b); + Brush_SetTexture (b, texdef, brushprimit_texdef, bFitScale, static_cast(pPlugTexdef) ); + Undo_EndBrush(b); + } + Undo_End(); + } + //++timo FIXME: not necessary in every cases, write a message defering / move one level up + Sys_UpdateWindows (W_ALL); +} + + +/* +================================================================ + + TRANSFORMATIONS + +================================================================ +*/ + +void Select_GetBounds (vec3_t mins, vec3_t maxs) +{ + brush_t *b; + int i; + + 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]; + } + } + } +} + +void Select_GetTrueMid (vec3_t mid) +{ + vec3_t mins, maxs; + Select_GetBounds (mins, maxs); + + for (int i=0 ; i<3 ; i++) + mid[i] = (mins[i] + ((maxs[i] - mins[i]) / 2)); +} + +void Select_GetMid (vec3_t mid) +{ + vec3_t mins, maxs; + int i; + + if (g_PrefsDlg.m_bNoClamp) + { + Select_GetTrueMid(mid); + return; + } + + Select_GetBounds (mins, maxs); + + for (i=0 ; i<3 ; i++) + mid[i] = g_qeglobals.d_gridsize*floor ( ( (mins[i] + maxs[i])*0.5 )/g_qeglobals.d_gridsize ); +} + +vec3_t select_origin; +vec3_t select_matrix[3]; +qboolean select_fliporder; + +// FIXME: bApplyBPrimit is supposed to be temporary +// TODO: manage Brush_Build calls, too many of them with the texture processing +// FIXME: the undo doesn't seem to work correctly on texturing and flip/rotate operations?? this is not supposed to be related to the texture locking code, so what is happening? +// FIXME: ApplyMatrix works on flipping operation, b0rks on Rotations (so does the "regular" rotation code??) +// FIXME: what is getting called in free rotation mode? that used to work right? +void Select_ApplyMatrix (bool bSnap, bool bRotation, int nAxis, float fDeg)//, qboolean bApplyBPrimit) +{ + brush_t *b; + face_t *f; + int i, j; + vec3_t temp, tmporigin; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if(b->owner->eclass->fixedsize) + { + VectorCopy (b->owner->origin, tmporigin); + // transform the origin point + VectorSubtract (b->owner->origin, select_origin, temp); + for (j=0 ; j<3 ; j++) + b->owner->origin[j] = DotProduct(temp, select_matrix[j]) + select_origin[j]; + + // update the origin key + char text[64]; + sprintf (text, "%i %i %i", + (int)b->owner->origin[0], (int)b->owner->origin[1], (int)b->owner->origin[2]); + SetKeyValue(b->owner, "origin", text); + + /*\todo remove brush-based bounding box for fixedsize entities */ + VectorSubtract (b->owner->origin, tmporigin, temp); + for (f=b->brush_faces ; f ; f=f->next) + { + // move fixedsize bbox to new origin + for (i=0 ; i<3 ; i++) + VectorAdd (f->planepts[i], temp, f->planepts[i]); + } + Brush_Build(b, bSnap,true,false,false); // don't filter + + } + else if (b->patchBrush) + { + if (!bRotation && !((g_qeglobals.d_select_mode == sel_curvepoint && g_qeglobals.d_num_move_points != 0) || g_bPatchBendMode)) + // invert patch if this is a mirroring operation, unless points are selected or bendmode is active + patchInvert(b->pPatch); + // NOTE: does not clamp points to integers + Patch_ApplyMatrix(b->pPatch, select_origin, select_matrix, false); + } + else + { + for (f=b->brush_faces ; f ; f=f->next) + { + // FIXME: only in BP mode! + // if we are using Brush Primitives texturing, we need to compute the texture matrix after the geometric transformation + // (with the default texturing you don't need to compute anything for flipping and mirroring operations) + // if (bApplyBPrimit) { + // ApplyMatrix_BrushPrimit (f, select_matrix, select_origin, select_fliporder); + // } + for (i=0 ; i<3 ; i++) + { + VectorSubtract (f->planepts[i], select_origin, temp); + for (j=0 ; j<3 ; j++) + f->planepts[i][j] = DotProduct(temp, select_matrix[j]) + select_origin[j]; + } + if (select_fliporder) + { + VectorCopy (f->planepts[0], temp); + VectorCopy (f->planepts[2], f->planepts[0]); + VectorCopy (temp, f->planepts[2]); + } + } + Brush_Build(b, bSnap,true,false,false); // don't filter + } + } +} + +void ProjectOnPlane(vec3_t& normal,float dist,vec3_t& ez, vec3_t& p) +{ + if (fabs(ez[0]) == 1) + p[0] = (dist - normal[1] * p[1] - normal[2] * p[2]) / normal[0]; + else if (fabs(ez[1]) == 1) + p[1] = (dist - normal[0] * p[0] - normal[2] * p[2]) / normal[1]; + else + p[2] = (dist - normal[0] * p[0] - normal[1] * p[1]) / normal[2]; +} + +void Back(vec3_t& dir, vec3_t& p) +{ + if (fabs(dir[0]) == 1) + p[0] = 0; + else if (fabs(dir[1]) == 1) + p[1] = 0; + else p[2] = 0; +} + + + +// using scale[0] and scale[1] +void ComputeScale(vec3_t& rex, vec3_t& rey, vec3_t& p, face_t* f) +{ + float px = DotProduct(rex, p); + float py = DotProduct(rey, p); + px *= f->texdef.scale[0]; + py *= f->texdef.scale[1]; + vec3_t aux; + VectorCopy(rex, aux); + VectorScale(aux, px, aux); + VectorCopy(aux, p); + VectorCopy(rey, aux); + VectorScale(aux, py, aux); + VectorAdd(p, aux, p); +} + +void ComputeAbsolute(face_t* f, vec3_t& p1, vec3_t& p2, vec3_t& p3) +{ + vec3_t ex,ey,ez; // local axis base + +#ifdef _DEBUG + if (g_qeglobals.m_bBrushPrimitMode) + Sys_Printf("Warning : illegal call of ComputeAbsolute in brush primitive mode\n"); +#endif + + // compute first local axis base + TextureAxisFromPlane(&f->plane, ex, ey); + CrossProduct(ex, ey, ez); + + vec3_t aux; + VectorCopy(ex, aux); + VectorScale(aux, -f->texdef.shift[0], aux); + VectorCopy(aux, p1); + VectorCopy(ey, aux); + VectorScale(aux, -f->texdef.shift[1], aux); + VectorAdd(p1, aux, p1); + VectorCopy(p1, p2); + VectorAdd(p2, ex, p2); + VectorCopy(p1, p3); + VectorAdd(p3, ey, p3); + VectorCopy(ez, aux); + VectorScale(aux, -f->texdef.rotate, aux); + VectorRotate(p1, aux, p1); + VectorRotate(p2, aux, p2); + VectorRotate(p3, aux, p3); + // computing rotated local axis base + vec3_t rex,rey; + VectorCopy(ex, rex); + VectorRotate(rex, aux, rex); + VectorCopy(ey, rey); + VectorRotate(rey, aux, rey); + + ComputeScale(rex,rey,p1,f); + ComputeScale(rex,rey,p2,f); + ComputeScale(rex,rey,p3,f); + + // project on normal plane + // along ez + // assumes plane normal is normalized + ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p1); + ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p2); + ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p3); }; -void Scene_Invert_Selection(scene::Graph& graph) + +void AbsoluteToLocal(plane_t normal2, face_t* f, vec3_t& p1, vec3_t& p2, vec3_t& p3) { - graph.traverse(InvertSelectionWalker(GlobalSelectionSystem().Mode())); + vec3_t ex,ey,ez; + +#ifdef _DEBUG + if (g_qeglobals.m_bBrushPrimitMode) + Sys_Printf("Warning : illegal call of AbsoluteToLocal in brush primitive mode\n"); +#endif + + // computing new local axis base + TextureAxisFromPlane(&normal2, ex, ey); + CrossProduct(ex, ey, ez); + + // projecting back on (ex,ey) + Back(ez,p1); + Back(ez,p2); + Back(ez,p3); + + vec3_t aux; + // rotation + VectorCopy(p2, aux); + VectorSubtract(aux, p1,aux); + + float x = DotProduct(aux,ex); + float y = DotProduct(aux,ey); + f->texdef.rotate = 180 * atan2(y,x) / Q_PI; + + vec3_t rex,rey; + // computing rotated local axis base + VectorCopy(ez, aux); + VectorScale(aux, f->texdef.rotate, aux); + VectorCopy(ex, rex); + VectorRotate(rex, aux, rex); + VectorCopy(ey, rey); + VectorRotate(rey, aux, rey); + + // scale + VectorCopy(p2, aux); + VectorSubtract(aux, p1, aux); + f->texdef.scale[0] = DotProduct(aux, rex); + VectorCopy(p3, aux); + VectorSubtract(aux, p1, aux); + f->texdef.scale[1] = DotProduct(aux, rey); + + // shift + // only using p1 + x = DotProduct(rex,p1); + y = DotProduct(rey,p1); + x /= f->texdef.scale[0]; + y /= f->texdef.scale[1]; + + VectorCopy(rex, p1); + VectorScale(p1, x, p1); + VectorCopy(rey, aux); + VectorScale(aux, y, aux); + VectorAdd(p1, aux, p1); + VectorCopy(ez, aux); + VectorScale(aux, -f->texdef.rotate, aux); + VectorRotate(p1, aux, p1); + f->texdef.shift[0] = -DotProduct(p1, ex); + f->texdef.shift[1] = -DotProduct(p1, ey); + + // stored rot is good considering local axis base + // change it if necessary + f->texdef.rotate = -f->texdef.rotate; + + Clamp(f->texdef.shift[0], f->d_texture->width); + Clamp(f->texdef.shift[1], f->d_texture->height); + Clamp(f->texdef.rotate, 360); + } -void Select_Invert() +void RotateFaceTexture(face_t* f, int nAxis, float fDeg) { - Scene_Invert_Selection(GlobalSceneGraph()); + vec3_t p1,p2,p3, rota; + p1[0] = p1[1] = p1[2] = 0; + VectorCopy(p1, p2); + VectorCopy(p1, p3); + VectorCopy(p1, rota); + ComputeAbsolute(f, p1, p2, p3); + + rota[nAxis] = fDeg; + VectorRotateOrigin (p1, rota, select_origin, p1); + VectorRotateOrigin (p2, rota, select_origin, p2); + VectorRotateOrigin (p3, rota, select_origin, p3); + + plane_t normal2; + vec3_t vNormal; + vNormal[0] = f->plane.normal[0]; + vNormal[1] = f->plane.normal[1]; + vNormal[2] = f->plane.normal[2]; + VectorRotate(vNormal, rota, vNormal); + normal2.normal[0] = vNormal[0]; + normal2.normal[1] = vNormal[1]; + normal2.normal[2] = vNormal[2]; + AbsoluteToLocal(normal2, f, p1, p2 ,p3); + } -class ExpandSelectionToEntitiesWalker : public scene::Graph::Walker +void RotateTextures(int nAxis, float fDeg, vec3_t vOrigin) { - mutable std::size_t m_depth; -public: - ExpandSelectionToEntitiesWalker() : m_depth(0) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - ++m_depth; - if(m_depth == 2) // entity depth - { - // traverse and select children if any one is selected - return Node_getEntity(path.top())->isContainer() && instance.childSelected(); - } - else if(m_depth == 3) // primitive depth - { - Instance_setSelected(instance, true); - return false; - } - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - --m_depth; - } -}; - -void Scene_ExpandSelectionToEntities() -{ - GlobalSceneGraph().traverse(ExpandSelectionToEntitiesWalker()); + for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (face_t* f=b->brush_faces ; f ; f=f->next) + { + if (g_qeglobals.m_bBrushPrimitMode) + RotateFaceTexture_BrushPrimit (f, nAxis, fDeg, vOrigin); + else + RotateFaceTexture (f, nAxis, fDeg); + } + Brush_Build(b, false,true,false,false); // don't filter + } } - -namespace +void Select_ApplyMatrix_BrushPrimit() { - void Selection_UpdateWorkzone() - { - if(GlobalSelectionSystem().countSelected() != 0) - { - Select_GetBounds(g_select_workzone.d_work_min, g_select_workzone.d_work_max); + #ifdef _DEBUG + if (!g_qeglobals.m_bBrushPrimitMode) { + Sys_FPrintf(SYS_ERR,"ERROR: Select_ApplyMatrix_BrushPrimit called in non-BP mode\n"); + } + #endif + for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (face_t* f=b->brush_faces ; f ; f=f->next) + { + ApplyMatrix_BrushPrimit (f, select_matrix, select_origin); } } - typedef FreeCaller SelectionUpdateWorkzoneCaller; - - IdleDraw g_idleWorkzone = IdleDraw(SelectionUpdateWorkzoneCaller()); } -const select_workzone_t& Select_getWorkZone() -{ - g_idleWorkzone.flush(); - return g_select_workzone; -} - -void UpdateWorkzone_ForSelection() -{ - g_idleWorkzone.queueDraw(); -} - -// update the workzone to the current selection -void UpdateWorkzone_ForSelectionChanged(const Selectable& selectable) -{ - if(selectable.isSelected()) - { - UpdateWorkzone_ForSelection(); - } -} - -void Select_SetShader(const char* shader) -{ - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushSetShader_Selected(GlobalSceneGraph(), shader); - Scene_PatchSetShader_Selected(GlobalSceneGraph(), shader); - } - Scene_BrushSetShader_Component_Selected(GlobalSceneGraph(), shader); -} - -void Select_SetTexdef(const TextureProjection& projection) -{ - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushSetTexdef_Selected(GlobalSceneGraph(), projection); - } - Scene_BrushSetTexdef_Component_Selected(GlobalSceneGraph(), projection); -} - -void Select_SetFlags(const ContentsFlagsValue& flags) -{ - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushSetFlags_Selected(GlobalSceneGraph(), flags); - } - Scene_BrushSetFlags_Component_Selected(GlobalSceneGraph(), flags); -} - -void Select_GetBounds (Vector3& mins, Vector3& maxs) -{ - AABB bounds; - Scene_BoundsSelected(GlobalSceneGraph(), bounds); - maxs = vector3_added(bounds.origin, bounds.extents); - mins = vector3_subtracted(bounds.origin, bounds.extents); -} - -void Select_GetMid (Vector3& mid) -{ - AABB bounds; - Scene_BoundsSelected(GlobalSceneGraph(), bounds); - mid = vector3_snapped(bounds.origin); -} - - void Select_FlipAxis (int axis) { - Vector3 flip(1, 1, 1); - flip[axis] = -1; - GlobalSelectionSystem().scaleSelected(flip); + int i; + + Select_GetMid (select_origin); + for (i=0 ; i<3 ; i++) + { + VectorCopy (vec3_origin, select_matrix[i]); + select_matrix[i][i] = 1; + } + select_matrix[axis][axis] = -1; + select_fliporder = true; + + // texture locking + if (g_PrefsDlg.m_bRotateLock) { + // axis flipping inverts space orientation, we have to use a general texture locking algorithm instead of the RotateFaceTexture + if (g_qeglobals.m_bBrushPrimitMode) { + Select_ApplyMatrix_BrushPrimit(); + } + else + { + // there's never been flip locking for non BP mode, this would be tricky to write and there's not much interest for it with the coming of BP format + // what could be done is converting regular to BP, locking, then back to regular :) + Sys_FPrintf(SYS_WRN, "WARNING: regular texturing doesn't have texture lock on flipping operations\n"); + } + } + // geometric transformation + Select_ApplyMatrix (true, false, 0, 0); + Sys_UpdateWindows (W_ALL); } void Select_Scale(float x, float y, float z) { - GlobalSelectionSystem().scaleSelected(Vector3(x, y, z)); + Select_GetMid (select_origin); + for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + // ignore fixedsize entities + if(b->owner->eclass->fixedsize) continue; + for (face_t* f=b->brush_faces ; f ; f=f->next) + { + for (int i=0 ; i<3 ; i++) + { + f->planepts[i][0] -= select_origin[0]; + f->planepts[i][1] -= select_origin[1]; + f->planepts[i][2] -= select_origin[2]; + f->planepts[i][0] *= x; + f->planepts[i][1] *= y; + f->planepts[i][2] *= z; + + f->planepts[i][0] += select_origin[0]; + f->planepts[i][1] += select_origin[1]; + f->planepts[i][2] += select_origin[2]; + } + } + Brush_Build(b, false,true,false,false); // don't filter + if (b->patchBrush) + { + vec3_t v; + v[0] = x; + v[1] = y; + v[2] = z; + Patch_Scale(b->pPatch, select_origin, v); + } + } } -enum axis_t +void Select_RotateAxis (int axis, float deg, bool bPaint, bool bMouse) { - eAxisX = 0, - eAxisY = 1, - eAxisZ = 2, -}; + int i; + vec_t c, s; -enum sign_t -{ - eSignPositive = 1, - eSignNegative = -1, -}; - -inline Matrix4 matrix4_rotation_for_axis90(axis_t axis, sign_t sign) -{ - switch(axis) + if (deg == 0) { - case eAxisX: - if(sign == eSignPositive) - { - return matrix4_rotation_for_sincos_x(1, 0); - } - else - { - return matrix4_rotation_for_sincos_x(-1, 0); - } - case eAxisY: - if(sign == eSignPositive) - { - return matrix4_rotation_for_sincos_y(1, 0); - } - else - { - return matrix4_rotation_for_sincos_y(-1, 0); - } - default://case eAxisZ: - if(sign == eSignPositive) - { - return matrix4_rotation_for_sincos_z(1, 0); - } - else - { - return matrix4_rotation_for_sincos_z(-1, 0); - } + return; } -} -inline void matrix4_rotate_by_axis90(Matrix4& matrix, axis_t axis, sign_t sign) -{ - matrix4_multiply_by_matrix4(matrix, matrix4_rotation_for_axis90(axis, sign)); -} - -inline void matrix4_pivoted_rotate_by_axis90(Matrix4& matrix, axis_t axis, sign_t sign, const Vector3& pivotpoint) -{ - matrix4_translate_by_vec3(matrix, pivotpoint); - matrix4_rotate_by_axis90(matrix, axis, sign); - matrix4_translate_by_vec3(matrix, vector3_negated(pivotpoint)); -} - -inline Quaternion quaternion_for_axis90(axis_t axis, sign_t sign) -{ -#if 1 - switch(axis) + if (bMouse) { - case eAxisX: - if(sign == eSignPositive) - { - return Quaternion(c_half_sqrt2f, 0, 0, c_half_sqrt2f); - } - else - { - return Quaternion(-c_half_sqrt2f, 0, 0, -c_half_sqrt2f); - } - case eAxisY: - if(sign == eSignPositive) - { - return Quaternion(0, c_half_sqrt2f, 0, c_half_sqrt2f); - } - else - { - return Quaternion(0, -c_half_sqrt2f, 0, -c_half_sqrt2f); - } - default://case eAxisZ: - if(sign == eSignPositive) - { - return Quaternion(0, 0, c_half_sqrt2f, c_half_sqrt2f); - } - else - { - return Quaternion(0, 0, -c_half_sqrt2f, -c_half_sqrt2f); - } - } -#else - quaternion_for_matrix4_rotation(matrix4_rotation_for_axis90((axis_t)axis, (deg > 0) ? eSignPositive : eSignNegative)); -#endif -} - -void Select_RotateAxis (int axis, float deg) -{ - if(fabs(deg) == 90.f) - { - GlobalSelectionSystem().rotateSelected(quaternion_for_axis90((axis_t)axis, (deg > 0) ? eSignPositive : eSignNegative)); + VectorCopy(g_pParentWnd->ActiveXY()->RotateOrigin(), select_origin); } else { - switch(axis) + Select_GetMid (select_origin); + } + + /* + if(axis == 2) + { + vec3_t rotation; + VectorSet(rotation, 0, 0, 360 - deg); + for(brush_t *b = selected_brushes.next; b != &selected_brushes; b = b->next) + if(b->owner->model.pEdit) + b->owner->model.pEdit->Rotate(select_origin, rotation); + } + */ + + select_fliporder = false; + + // the "90" degrees algorithm is mostly used on axis rotate as a speedup and possibly avoiding rounding errors as much as possible + // previous implementation was doing an indirect-oriented rotation over the plane whereas the general algo below was doing a direct-oriented rotation + // this was confusing the texture locking algorithms, fixed it to be direct-oriented (side consequence is that the axis rotate toolbar button rotates the other way now) + // NOTE: previous algo was using vec3_origin in the matrix computation.. + // I don't see what an origin does in linear transformations (3x3 matrixes always relate to a (0,0,0) origin) + // in Radiant it's initialized as (0,0,0) and never set to another value + // so I got rid of it when it's not used for initialisation tasks (and even if it's not (0,0,0) it should not matter + if (deg == 90) + { + c = 0; + s = 1; + } + else + { + c = cos(deg * Q_PI / 180.0); + s = sin(deg * Q_PI / 180.0); + } + + for (i=0 ; i<3 ; i++) + { + VectorCopy (vec3_origin, select_matrix[i]); + select_matrix[i][i] = 1; + } + + switch (axis) + { + case 0: + select_matrix[1][1] = c; + select_matrix[1][2] = s; + select_matrix[2][1] = -s; + select_matrix[2][2] = c; + break; + case 1: + select_matrix[0][0] = c; + select_matrix[0][2] = s; + select_matrix[2][0] = -s; + select_matrix[2][2] = c; + break; + case 2: + select_matrix[0][0] = c; + select_matrix[0][1] = s; + select_matrix[1][0] = -s; + select_matrix[1][1] = c; + break; + } + + + // texture locking + if (g_PrefsDlg.m_bRotateLock) + { + // Terrible hack, reversing input rotation angle to correct + // texture rotation direction for X and Z axes. + // RotateTextures needs to be changed to fix this properly? + if (axis == 1) + RotateTextures(axis, deg, select_origin); + else + RotateTextures(axis, deg * -1, select_origin); + } + // geometric transformation + Select_ApplyMatrix(!bMouse, true, axis, deg);//, false); + + if (bPaint) + Sys_UpdateWindows (W_ALL); +} + +/* +================================================================ + +GROUP SELECTIONS + +================================================================ +*/ + +void Select_RealCompleteTall(vec3_t mins, vec3_t maxs) +{ + brush_t *b, *next; + + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + + g_qeglobals.d_select_mode = sel_brush; + + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + + if (b->bFiltered) + continue; + + if ( (b->maxs[nDim1] > maxs[nDim1] || b->mins[nDim1] < mins[nDim1]) + || (b->maxs[nDim2] > maxs[nDim2] || b->mins[nDim2] < mins[nDim2]) ) + continue; + + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } +} + +void Select_CompleteTall (void) +{ + vec3_t mins, maxs; + + if (!QE_SingleBrush ()) + return; + + Undo_Start ("select complete tall"); + Undo_AddBrushList (&selected_brushes); + Undo_End(); + + VectorCopy (selected_brushes.next->mins, mins); + VectorCopy (selected_brushes.next->maxs, maxs); + Select_Delete (); + + Select_RealCompleteTall(mins, maxs); + Sys_UpdateWindows (W_ALL); +} + +void Select_PartialTall (void) +{ + brush_t *b, *next; + vec3_t mins, maxs; + + if (!QE_SingleBrush ()) + return; + + Undo_Start ("select complete tall"); + Undo_AddBrushList (&selected_brushes); + Undo_End(); + + g_qeglobals.d_select_mode = sel_brush; + + VectorCopy (selected_brushes.next->mins, mins); + VectorCopy (selected_brushes.next->maxs, maxs); + Select_Delete (); + + int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2; + + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + + if (b->bFiltered) + continue; + + if ( (b->mins[nDim1] > maxs[nDim1] || b->maxs[nDim1] < mins[nDim1]) + || (b->mins[nDim2] > maxs[nDim2] || b->maxs[nDim2] < mins[nDim2]) ) + continue; + + + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + + Sys_UpdateWindows (W_ALL); +} + +void Select_Touching (void) +{ + brush_t *b, *next; + int i; + vec3_t mins, maxs; + + if (!QE_SingleBrush ()) + return; + + g_qeglobals.d_select_mode = sel_brush; + + VectorCopy (selected_brushes.next->mins, mins); + VectorCopy (selected_brushes.next->maxs, maxs); + + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + + if (b->bFiltered) + continue; + + for (i=0 ; i<3 ; i++) + if (b->mins[i] > maxs[i]+1 || b->maxs[i] < mins[i]-1) + break; + + if (i == 3) + { + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + } + + Sys_UpdateWindows (W_ALL); +} + +void Select_Inside (void) +{ + brush_t *b, *next; + int i; + vec3_t mins, maxs; + + if (!QE_SingleBrush ()) + return; + + Undo_Start ("select inside"); + Undo_AddBrushList (&selected_brushes); + Undo_End(); + + g_qeglobals.d_select_mode = sel_brush; + + VectorCopy (selected_brushes.next->mins, mins); + VectorCopy (selected_brushes.next->maxs, maxs); + Select_Delete (); + + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + + if (b->bFiltered) + continue; + + for (i=0 ; i<3 ; i++) + if (b->maxs[i] > maxs[i] || b->mins[i] < mins[i]) + break; + if (i == 3) + { + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + } + + Sys_UpdateWindows (W_ALL); +} + +void Select_Ungroup(void) +{ + int numselectedgroups; + entity_t *e; + brush_t *b,* sb; + + numselectedgroups = 0; + for (sb = selected_brushes.next; sb != &selected_brushes; sb = sb->next) + { + e = sb->owner; + + if (e == world_entity || e->eclass->fixedsize) + { + continue; + } + + for (b = e->brushes.onext; b != &e->brushes; b = e->brushes.onext) + { + Entity_UnlinkBrush (b); + Entity_LinkBrush (world_entity, b); + } + Entity_Free (e); + numselectedgroups++; + } + + if (numselectedgroups <= 0) + { + Sys_Printf("No grouped entities selected.\n"); + return; + } + Sys_Printf("Ungrouped %d entit%s.\n", numselectedgroups, (numselectedgroups == 1)?"y":"ies"); + Sys_UpdateWindows (W_ALL); +} + +/*! +group selected brushes into specified entity +if an entity is empty afterwards, destroy it +*/ +void Select_GroupEntity(entity_t* group) +{ + entity_t* e; + brush_t *b; + + if(group->eclass->fixedsize) + { + Sys_FPrintf (SYS_ERR, "Select_GroupEntity: can't group anything to a fixedsize entity\n"); + return; + } + + for (b = selected_brushes.next; b != &selected_brushes; b = b->next) + { + if(b->owner->eclass->fixedsize) continue; + e = b->owner; + Entity_UnlinkBrush(b); + Entity_LinkBrush(group, b); + if(e != world_entity && e->brushes.onext == &e->brushes) { - case 0: - GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_x_degrees(deg))); - break; - case 1: - GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_y_degrees(deg))); - break; - case 2: - GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_z_degrees(deg))); - break; + Undo_AddEntity(e); + Entity_Free(e); } } } - -void Select_ShiftTexture(float x, float y) +/*! +merge all selected entities together into the first one selected +NOTE: makes use of order of selected_brushes list +can be used to move world brushes in an entity, or to merge several ents together +NOTE: didn't devise a strategy on the epairs, we merge into the first entity and use those +*/ +void Select_MergeEntity() { - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) + entity_t* e = NULL; + brush_t* b; + for (b = selected_brushes.next; b != &selected_brushes; b = b->next) { - Scene_BrushShiftTexdef_Selected(GlobalSceneGraph(), x, y); - Scene_PatchTranslateTexture_Selected(GlobalSceneGraph(), x, y); + if(!b->owner->eclass->fixedsize) + { + e = b->owner; + break; + } + } + + if(e != NULL) + { + Select_GroupEntity(e); + + int count = 0; + for(b = e->brushes.onext; b != &e->brushes; b=b->onext) + { + //Brush_RemoveFromList (b); + //Brush_AddToList(b, &active_brushes); + count++; + } + Sys_Printf ("Merged %d brushes into %s entity\n", count, ValueForKey (e, "classname")); } - //globalOutputStream() << "shift selected face textures: s=" << x << " t=" << y << '\n'; - Scene_BrushShiftTexdef_Component_Selected(GlobalSceneGraph(), x, y); } +/* +==================== +Select_Seperate +==================== +*/ +void Select_Seperate( void ) { + Select_GroupEntity( world_entity ); +} + +/* +==================== +Select_MakeStructural +==================== +*/ +void Select_MakeStructural (void) +{ + brush_t *b; + face_t *f; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + f->texdef.contents &= ~CONTENTS_DETAIL; + b->bFiltered = FilterBrush(b); + } + Select_Deselect (); + Sys_UpdateWindows (W_ALL); +} + +void Select_MakeDetail (void) +{ + brush_t *b; + face_t *f; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + f->texdef.contents |= CONTENTS_DETAIL; + b->bFiltered = FilterBrush(b); + } + Select_Deselect (); + Sys_UpdateWindows (W_ALL); +} + +// brush primitive texture adjustments, use the camera view to map adjustments +// ShiftTextureRelative_BrushPrimit ( s , t ) will shift relative to the texture +void ShiftTextureRelative_Camera(face_t *f, int x, int y) +{ + vec3_t vecS, vecT; + vec_t XY[2]; // the values we are going to send for translation + vec_t sgn[2]; // +1 or -1 + int axis[2]; + CamWnd* pCam; + + // get the two relative texture axes for the current texturing + BrushPrimit_GetRelativeAxes(f, vecS, vecT); + + // center point of the face, project it on the camera space + vec3_t C; + VectorClear(C); + int i; + for (i=0; iface_winding->numpoints; i++) + { + VectorAdd(C,f->face_winding->points[i],C); + } + VectorScale(C,1.0/f->face_winding->numpoints,C); + + pCam = g_pParentWnd->GetCamWnd(); + pCam->MatchViewAxes(C, vecS, axis[0], sgn[0]); + pCam->MatchViewAxes(C, vecT, axis[1], sgn[1]); + + // this happens when the two directions can't be mapped on two different directions on the screen + // then the move will occur against a single axis + // (i.e. the user is not positioned well enough to send understandable shift commands) + // NOTE: in most cases this warning is not very relevant because the user would use one of the two axes + // for which the solution is easy (the other one being unknown) + // so this warning could be removed + if (axis[0] == axis[1]) + Sys_FPrintf(SYS_WRN, "Warning: degenerate in ShiftTextureRelative_Camera\n"); + + // compute the X Y geometric increments + // those geometric increments will be applied along the texture axes (the ones we computed above) + XY[0] = 0; + XY[1] = 0; + if (x!=0) + { + // moving right/left + XY[axis[0]] += sgn[0]*x; + } + if (y!=0) + { + XY[axis[1]] += sgn[1]*y; + } + // we worked out a move along vecS vecT, and we now it's geometric amplitude + // apply it + ShiftTextureRelative_BrushPrimit(f, XY[0], XY[1]); +} + +void Select_ShiftTexture(int x, int y) +{ + brush_t *b; + face_t *f; + + int nFaceCount = g_ptrSelectedFaces.GetSize(); + + if(selected_brushes.next == &selected_brushes && nFaceCount == 0) + return; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + { + if (g_qeglobals.m_bBrushPrimitMode) + { + ShiftTextureRelative_Camera( f, x, y ); + } + else + { + f->texdef.shift[0] += x; + f->texdef.shift[1] += y; + } + } + Brush_Build(b,true,true,false,false); // don't filter + if (b->patchBrush) + { + Patch_ShiftTexture(b->pPatch, x, y); + } + } + + if (nFaceCount > 0) + { + for (int i = 0; i < nFaceCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + if (g_qeglobals.m_bBrushPrimitMode) + { + ShiftTextureRelative_Camera( selFace, x, y ); + } + else + { + selFace->texdef.shift[0] += x; + selFace->texdef.shift[1] += y; + } + Brush_Build(selBrush,true,true,false,false); // don't filter + } + } + + Sys_UpdateWindows (W_CAMERA); +} + +// setting float as input void Select_ScaleTexture(float x, float y) { - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushScaleTexdef_Selected(GlobalSceneGraph(), x, y); - Scene_PatchScaleTexture_Selected(GlobalSceneGraph(), x, y); - } - Scene_BrushScaleTexdef_Component_Selected(GlobalSceneGraph(), x, y); + brush_t *b; + face_t *f; + + int nFaceCount = g_ptrSelectedFaces.GetSize(); + + if(selected_brushes.next == &selected_brushes && nFaceCount == 0) + { + return; + } + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + { + if (g_qeglobals.m_bBrushPrimitMode) + { + // apply same scale as the spinner button of the surface inspector + float shift[2]; + float rotate; + float scale[2]; + brushprimit_texdef_t bp; + // compute normalized texture matrix + ConvertTexMatWithQTexture( &f->brushprimit_texdef, f->d_texture, &bp, NULL ); + // compute fake shift scale rot + TexMatToFakeTexCoords( bp.coords, shift, &rotate, scale ); + // update + scale[0]+=static_cast(x)*0.1; + scale[1]+=static_cast(y)*0.1; + // compute new normalized texture matrix + FakeTexCoordsToTexMat( shift, rotate, scale, bp.coords ); + // apply to face texture matrix + ConvertTexMatWithQTexture( &bp, NULL, &f->brushprimit_texdef, f->d_texture ); + } + else + { + f->texdef.scale[0] += x; + f->texdef.scale[1] += y; + } + } + Brush_Build(b,true,true,false,false); // don't filter + if (b->patchBrush) + { + Patch_ScaleTexture(b->pPatch, x, y); + } + } + + if (nFaceCount > 0) + { + for (int i = 0; i < nFaceCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + if (g_qeglobals.m_bBrushPrimitMode) + { + float shift[2]; + float rotate; + float scale[2]; + brushprimit_texdef_t bp; + ConvertTexMatWithQTexture( &selFace->brushprimit_texdef, selFace->d_texture, &bp, NULL ); + TexMatToFakeTexCoords( bp.coords, shift, &rotate, scale ); + scale[0]+=static_cast(x)*0.1; + scale[1]+=static_cast(y)*0.1; + FakeTexCoordsToTexMat( shift, rotate, scale, bp.coords ); + ConvertTexMatWithQTexture( &bp, NULL, &selFace->brushprimit_texdef, selFace->d_texture ); + } + else + { + selFace->texdef.scale[0] += x; + selFace->texdef.scale[1] += y; + } + Brush_Build(selBrush,true,true,false,false); // don't filter + } + } + + Sys_UpdateWindows (W_CAMERA); } -void Select_RotateTexture(float amt) +void Select_RotateTexture(int amt) { - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushRotateTexdef_Selected(GlobalSceneGraph(), amt); - Scene_PatchRotateTexture_Selected(GlobalSceneGraph(), amt); - } - Scene_BrushRotateTexdef_Component_Selected(GlobalSceneGraph(), amt); + brush_t *b; + face_t *f; + + int nFaceCount = g_ptrSelectedFaces.GetSize(); + + if(selected_brushes.next == &selected_brushes && nFaceCount == 0) + { + return; + } + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + { + if (g_qeglobals.m_bBrushPrimitMode) + { + // apply same scale as the spinner button of the surface inspector + float shift[2]; + float rotate; + float scale[2]; + brushprimit_texdef_t bp; + // compute normalized texture matrix + ConvertTexMatWithQTexture( &f->brushprimit_texdef, f->d_texture, &bp, NULL ); + // compute fake shift scale rot + TexMatToFakeTexCoords( bp.coords, shift, &rotate, scale ); + // update + rotate += amt; + // compute new normalized texture matrix + FakeTexCoordsToTexMat( shift, rotate, scale, bp.coords ); + // apply to face texture matrix + ConvertTexMatWithQTexture( &bp, NULL, &f->brushprimit_texdef, f->d_texture ); + } + else + { + f->texdef.rotate += amt; + f->texdef.rotate = static_cast(f->texdef.rotate) % 360; + } + } + Brush_Build(b,true,true,false,false); // don't filter + if (b->patchBrush) + { + //Patch_RotateTexture(b->nPatchID, amt); + Patch_RotateTexture(b->pPatch, amt); + } + } + + if (nFaceCount > 0) + { + for (int i = 0; i < nFaceCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + if (g_qeglobals.m_bBrushPrimitMode) + { + float shift[2]; + float rotate; + float scale[2]; + brushprimit_texdef_t bp; + ConvertTexMatWithQTexture( &selFace->brushprimit_texdef, selFace->d_texture, &bp, NULL ); + TexMatToFakeTexCoords( bp.coords, shift, &rotate, scale ); + rotate += amt; + FakeTexCoordsToTexMat( shift, rotate, scale, bp.coords ); + ConvertTexMatWithQTexture( &bp, NULL, &selFace->brushprimit_texdef, selFace->d_texture ); + } + else + { + selFace->texdef.rotate += amt; + selFace->texdef.rotate = static_cast(selFace->texdef.rotate) % 360; + } + Brush_Build(selBrush,true,true,false,false); // don't filter + } + } + + Sys_UpdateWindows (W_CAMERA); } // TTimo modified to handle shader architecture: // expects shader names at input, comparison relies on shader names .. texture names no longer relevant -void FindReplaceTextures(const char* pFind, const char* pReplace, bool bSelected) +void FindReplaceTextures(const char* pFind, const char* pReplace, bool bSelected, bool bForce, bool bSelectMatchingFaces) { - if(!texdef_name_valid(pFind)) + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=391 + if (strchr(pFind, ' ') || strchr(pReplace, ' ')) { - globalErrorStream() << "FindReplaceTextures: invalid texture name: '" << pFind << "', aborted\n"; - return; - } - if(!texdef_name_valid(pReplace)) - { - globalErrorStream() << "FindReplaceTextures: invalid texture name: '" << pReplace << "', aborted\n"; + Sys_FPrintf(SYS_WRN, "FindReplaceTextures: '%s' or '%s' have spaces, aborted\n", pFind, pReplace); return; } + + brush_t* pList = (bSelected) ? &selected_brushes : &active_brushes; + if (!bSelected) + Select_Deselect(); - StringOutputStream command; - command << "textureFindReplace -find " << pFind << " -replace " << pReplace; - UndoableCommand undo(command.c_str()); + //++timo BP mode: replacing a texture in BP mode is not that easy, you need to recompute the texture matrix + // if the size of the replacing texture differs, otherwise you get wrong scaling + if (g_qeglobals.m_bBrushPrimitMode) + Sys_Printf("TODO: finalize find/replace code for brush primitives"); - if(bSelected) + CPtrArray mFaces; + for (brush_t* pBrush = pList->next ; pBrush != pList; pBrush = pBrush->next) { - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) + if (!bSelectMatchingFaces && pBrush->patchBrush) { - Scene_BrushFindReplaceShader_Selected(GlobalSceneGraph(), pFind, pReplace); - Scene_PatchFindReplaceShader_Selected(GlobalSceneGraph(), pFind, pReplace); + Patch_FindReplaceTexture(pBrush, pFind, pReplace, bForce); } - Scene_BrushFindReplaceShader_Component_Selected(GlobalSceneGraph(), pFind, pReplace); - } - else - { - Scene_BrushFindReplaceShader(GlobalSceneGraph(), pFind, pReplace); - Scene_PatchFindReplaceShader(GlobalSceneGraph(), pFind, pReplace); - } -} - -typedef std::vector Classnames; - -bool classnames_match_entity(const Classnames& classnames, Entity* entity) -{ - for(Classnames::const_iterator i = classnames.begin(); i != classnames.end(); ++i) - { - if(string_equal(entity->getKeyValue("classname"), *i)) + + bool found = false; //spog + for (face_t* pFace = pBrush->brush_faces; pFace; pFace = pFace->next) { - return true; - } - } - return false; -} - -class EntityFindByClassnameWalker : public scene::Graph::Walker -{ - const Classnames& m_classnames; -public: - EntityFindByClassnameWalker(const Classnames& classnames) - : m_classnames(classnames) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0 - && classnames_match_entity(m_classnames, entity)) - { - Instance_getSelectable(instance)->setSelected(true); - } - return true; - } -}; - -void Scene_EntitySelectByClassnames(scene::Graph& graph, const Classnames& classnames) -{ - graph.traverse(EntityFindByClassnameWalker(classnames)); -} - -class EntityGetSelectedClassnamesWalker : public scene::Graph::Walker -{ - Classnames& m_classnames; -public: - EntityGetSelectedClassnamesWalker(Classnames& classnames) - : m_classnames(classnames) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) - { - Entity* entity = Node_getEntity(path.top()); - if(entity != 0) + if(bForce || strcmpi(pFace->pShader->getName(), pFind) == 0) { - m_classnames.push_back(entity->getKeyValue("classname")); + if (!bSelectMatchingFaces) { + pFace->pShader->DecRef(); + pFace->pShader = QERApp_Shader_ForName( pReplace ); + pFace->pShader->IncRef(); + pFace->d_texture = pFace->pShader->getTexture(); + pFace->texdef.SetName(pReplace); + found = true; + } else if (bSelectMatchingFaces) { + mFaces.Add(pFace); + } } } - return true; - } -}; -void Scene_EntityGetClassnames(scene::Graph& graph, Classnames& classnames) -{ - graph.traverse(EntityGetSelectedClassnamesWalker(classnames)); + if (found) // spog - speed increase, only build brushes that changed + Brush_Build(pBrush); + + } + + if (bSelectMatchingFaces) { + if (bSelected) + Select_Deselect(); + + int nSize = mFaces.GetSize(); + for (int i = 0; i < nSize; i++) { + g_SelectedFaces.Add(reinterpret_cast(mFaces.GetAt(i))); + } + } + + Sys_UpdateWindows (W_CAMERA); } void Select_AllOfType() { - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - if(GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace) + brush_t *b, *next; + entity_t *e; + // if no brush selected, we will select based on texture + // the first selected face's texture if any, or the current texture + // if a brush is selected, we will select entities (first non-worldspawn owner in selected brushes) + if (selected_brushes.next == &selected_brushes) + { + + CString strName; + if (g_ptrSelectedFaces.GetSize() == 0) { - GlobalSelectionSystem().setSelectedAllComponents(false); - Scene_BrushSelectByShader_Component(GlobalSceneGraph(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); - } - } - else - { - Classnames classnames; - Scene_EntityGetClassnames(GlobalSceneGraph(), classnames); - GlobalSelectionSystem().setSelectedAll(false); - if(!classnames.empty()) - { - Scene_EntitySelectByClassnames(GlobalSceneGraph(), classnames); + strName = g_qeglobals.d_texturewin.texdef.GetName(); } else { - Scene_BrushSelectByShader(GlobalSceneGraph(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); - Scene_PatchSelectByShader(GlobalSceneGraph(), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(0)); + strName = selFace->texdef.GetName(); } - } -} -void Select_Inside(void) -{ - SelectByBounds::DoSelection(); -} + Sys_Printf("Selecting all brushes with the texture %s\n", strName.GetBuffer()); -void Select_Touching(void) -{ - SelectByBounds::DoSelection(false); -} - -void Select_FitTexture(float horizontal, float vertical) -{ - if(GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) - { - Scene_BrushFitTexture_Selected(GlobalSceneGraph(), horizontal, vertical); - } - Scene_BrushFitTexture_Component_Selected(GlobalSceneGraph(), horizontal, vertical); - - SceneChangeNotify(); -} - -inline void hide_node(scene::Node& node, bool hide) -{ - hide - ? node.enable(scene::Node::eHidden) - : node.disable(scene::Node::eHidden); -} - -class HideSelectedWalker : public scene::Graph::Walker -{ - bool m_hide; -public: - HideSelectedWalker(bool hide) - : m_hide(hide) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) + Select_Deselect(); + for (b=active_brushes.next ; b != &active_brushes ; b=next) { - hide_node(path.top(), m_hide); - } - return true; - } -}; + next = b->next; + + if (b->bFiltered) + continue; -void Scene_Hide_Selected(bool hide) + if (b->patchBrush) + { + if (strcmpi(strName, b->pPatch->pShader->getName()) == 0) + { + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + } + else + { + for (face_t* pFace = b->brush_faces; pFace; pFace = pFace->next) + { + if (strcmpi(strName, pFace->texdef.GetName()) == 0) + { + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + } + } + } + Sys_UpdateWindows(W_ALL); + return; + } + + + b = selected_brushes.next; + e = b->owner; + + if (e != NULL) + { + if (e != world_entity) + { + CString strName = e->eclass->name; + CString strKey, strVal; + bool bCriteria = GetSelectAllCriteria(strKey, strVal); + Sys_Printf("Selecting all %s entities\n", strName.GetBuffer()); + Select_Deselect(); + + for (b=active_brushes.next ; b != &active_brushes ; b=next) + { + next = b->next; + + if (b->bFiltered) + continue; + + e = b->owner; + if (e != NULL) + { + if (strcmpi(e->eclass->name, strName) == 0) + { + bool doIt = true; + if (bCriteria) { + CString str = ValueForKey (e, strKey); + if (str.CompareNoCase(strVal) != 0) { + doIt = false; + } + } + if (doIt) { + Brush_RemoveFromList (b); + Brush_AddToList (b, &selected_brushes); + } + } + } + } + } + } + Sys_UpdateWindows (W_ALL); + +} + +void Select_Reselect() { - GlobalSceneGraph().traverse(HideSelectedWalker(hide)); + Select_Brush(selected_brushes.next); + Sys_UpdateWindows (W_ALL); +} + + +void Select_FitTexture(int nHeight, int nWidth) +{ + brush_t *b; + + int nFaceCount = g_ptrSelectedFaces.GetSize(); + + if(selected_brushes.next == &selected_brushes && nFaceCount == 0) + return; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + Brush_FitTexture(b, nHeight, nWidth); + Brush_Build(b,true,true,false,false); // don't filter + } + + if (nFaceCount > 0) + { + for (int i = 0; i < nFaceCount; i++) + { + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(i)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(i)); + Face_FitTexture(selFace, nHeight, nWidth); + Brush_Build(selBrush,true,true,false,false); // don't filter + } + } + + Sys_UpdateWindows (W_CAMERA); } void Select_Hide() { - Scene_Hide_Selected(true); - SceneChangeNotify(); -} - -void HideSelected() -{ - Select_Hide(); - GlobalSelectionSystem().setSelectedAll(false); -} - - -class HideAllWalker : public scene::Graph::Walker -{ - bool m_hide; -public: - HideAllWalker(bool hide) - : m_hide(hide) + for (brush_t* b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next) { + b->hiddenBrush = true; + b->bFiltered = true; } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - hide_node(path.top(), m_hide); - return true; - } -}; - -void Scene_Hide_All(bool hide) -{ - GlobalSceneGraph().traverse(HideAllWalker(hide)); + Sys_UpdateWindows (W_ALL); } void Select_ShowAllHidden() { - Scene_Hide_All(false); - SceneChangeNotify(); + brush_t* b; + for (b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next) + { + if (b->hiddenBrush) + { + b->hiddenBrush = false; + b->bFiltered = FilterBrush(b); + } + } + for (b=active_brushes.next ; b && b != &active_brushes ; b=b->next) + { + if (b->hiddenBrush) + { + b->hiddenBrush = false; + b->bFiltered = FilterBrush(b); + } + } + Sys_UpdateWindows (W_ALL); } - -void Selection_Flipx() +/* +============ +Select_Invert +============ +*/ +void Select_Invert(void) { - UndoableCommand undo("mirrorSelected -axis x"); - Select_FlipAxis(0); -} + brush_t *next, *prev, *b; -void Selection_Flipy() -{ - UndoableCommand undo("mirrorSelected -axis y"); - Select_FlipAxis(1); -} + Sys_Printf("inverting selection...\n"); -void Selection_Flipz() -{ - UndoableCommand undo("mirrorSelected -axis z"); - Select_FlipAxis(2); -} + next = active_brushes.next; + prev = active_brushes.prev; + if (selected_brushes.next != &selected_brushes) + { + active_brushes.next = selected_brushes.next; + active_brushes.prev = selected_brushes.prev; + active_brushes.next->prev = &active_brushes; + active_brushes.prev->next = &active_brushes; + } + else + { + active_brushes.next = &active_brushes; + active_brushes.prev = &active_brushes; + } + if (next != &active_brushes) + { + selected_brushes.next = next; + selected_brushes.prev = prev; + selected_brushes.next->prev = &selected_brushes; + selected_brushes.prev->next = &selected_brushes; + } + else + { + selected_brushes.next = &selected_brushes; + selected_brushes.prev = &selected_brushes; + } -void Selection_Rotatex() -{ - UndoableCommand undo("rotateSelected -axis x -angle -90"); - Select_RotateAxis(0,-90); -} + // now check if any hidden brush is selected + for (b = selected_brushes.next; b != &selected_brushes; ) + { + if (b->patchBrush) + b->pPatch->bSelected = true; -void Selection_Rotatey() -{ - UndoableCommand undo("rotateSelected -axis y -angle 90"); - Select_RotateAxis(1, 90); -} + if (b->bFiltered) + { + brush_t *pb = b; + b = b->next; + Brush_RemoveFromList (pb); + Brush_AddToList (pb, &active_brushes); + } + else b = b->next; -void Selection_Rotatez() -{ - UndoableCommand undo("rotateSelected -axis z -angle -90"); - Select_RotateAxis(2,-90); -} - - - -void Nudge(int nDim, float fNudge) -{ - Vector3 translate(0, 0, 0); - translate[nDim] = fNudge; + } - GlobalSelectionSystem().translateSelected(translate); + for (b = active_brushes.next; b != &active_brushes; b = b->next) + { + if (b->patchBrush) + { + b->pPatch->bSelected = false; + } + } + + // since invert selection only works at the brush level, + // set g_qeglobals.d_select_mode accordingly + g_qeglobals.d_select_mode = sel_brush; + + // since invert selection only works at the brush level, + // set g_qeglobals.d_select_mode accordingly + g_qeglobals.d_select_mode = sel_brush; + + Sys_UpdateWindows(W_ALL); + + Sys_Printf("done.\n"); } -void Selection_NudgeZ(float amount) +#ifdef ENABLE_GROUPS +/* +=========== +Select_Name +=========== +*/ +void Select_Name(const char *pName) { - StringOutputStream command; - command << "nudgeSelected -axis z -amount " << amount; - UndoableCommand undo(command.c_str()); - - Nudge(2, amount); + if (g_qeglobals.m_bBrushPrimitMode) + { + for (brush_t* b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next) + { + Brush_SetEpair(b, "Name", pName); + } + } } -void Selection_MoveDown() +/* +================= +Select_AddToGroup +add selected brushes to a group, update the tree +================= +*/ +void Select_AddToGroup(const char *pName) { - Selection_NudgeZ(-GetGridSize()); + if (g_qeglobals.m_bBrushPrimitMode) + { + for (brush_t* b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next) + { + Brush_SetEpair(b, "group", pName); + Group_AddToProperGroup(b); + } + } } - -void Selection_MoveUp() -{ - Selection_NudgeZ(GetGridSize()); -} - -void SceneSelectionChange(const Selectable& selectable) -{ - SceneChangeNotify(); -} - -SignalHandlerId Selection_boundsChanged; - -void Selection_construct() -{ - typedef FreeCaller1 SceneSelectionChangeCaller; - GlobalSelectionSystem().addSelectionChangeCallback(SceneSelectionChangeCaller()); - typedef FreeCaller1 UpdateWorkzoneForSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(UpdateWorkzoneForSelectionChangedCaller()); - typedef FreeCaller UpdateWorkzoneForSelectionCaller; - Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(UpdateWorkzoneForSelectionCaller()); -} - -void Selection_destroy() -{ - GlobalSceneGraph().removeBoundsChangedCallback(Selection_boundsChanged); -} - - -#include "gtkdlgs.h" -#include -#include -#include -#include -#include - - -inline Quaternion quaternion_for_euler_xyz_degrees(const Vector3& eulerXYZ) -{ -#if 0 - return quaternion_for_matrix4_rotation(matrix4_rotation_for_euler_xyz_degrees(eulerXYZ)); -#elif 0 - return quaternion_multiplied_by_quaternion( - quaternion_multiplied_by_quaternion( - quaternion_for_z(degrees_to_radians(eulerXYZ[2])), - quaternion_for_y(degrees_to_radians(eulerXYZ[1])) - ), - quaternion_for_x(degrees_to_radians(eulerXYZ[0])) - ); -#elif 1 - double cx = cos(degrees_to_radians(eulerXYZ[0] * 0.5)); - double sx = sin(degrees_to_radians(eulerXYZ[0] * 0.5)); - double cy = cos(degrees_to_radians(eulerXYZ[1] * 0.5)); - double sy = sin(degrees_to_radians(eulerXYZ[1] * 0.5)); - double cz = cos(degrees_to_radians(eulerXYZ[2] * 0.5)); - double sz = sin(degrees_to_radians(eulerXYZ[2] * 0.5)); - - return Quaternion( - cz * cy * sx - sz * sy * cx, - cz * sy * cx + sz * cy * sx, - sz * cy * cx - cz * sy * sx, - cz * cy * cx + sz * sy * sx - ); #endif -} - -struct RotateDialog -{ - GtkSpinButton* x; - GtkSpinButton* y; - GtkSpinButton* z; -}; - -static void rotatedlg_apply (GtkWidget *widget, RotateDialog* rotateDialog) -{ - Vector3 eulerXYZ; - - eulerXYZ[0] = static_cast(gtk_spin_button_get_value(rotateDialog->x)); - gtk_spin_button_set_value(rotateDialog->x, 0.0f); // reset to 0 on Apply - - eulerXYZ[1] = static_cast(gtk_spin_button_get_value(rotateDialog->y)); - gtk_spin_button_set_value(rotateDialog->y, 0.0f); - - eulerXYZ[2] = static_cast(gtk_spin_button_get_value(rotateDialog->z)); - gtk_spin_button_set_value(rotateDialog->z, 0.0f); - - StringOutputStream command; - command << "rotateSelectedEulerXYZ -x " << eulerXYZ[0] << " -y " << eulerXYZ[1] << " -z " << eulerXYZ[2]; - UndoableCommand undo(command.c_str()); - - GlobalSelectionSystem().rotateSelected(quaternion_for_euler_xyz_degrees(eulerXYZ)); -} - -void DoRotateDlg() -{ - ModalDialog dialog; - RotateDialog rotateDialog; - - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Arbitrary rotation", G_CALLBACK(dialog_delete_callback), &dialog); - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkTable* table = create_dialog_table(3, 2, 4, 4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(table), TRUE, TRUE, 0); - { - GtkWidget* label = gtk_label_new (" X "); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 0, 1, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new (" Y "); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 1, 2, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new (" Z "); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 2, 3, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -359, 359, 1, 10, 10)); - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request(GTK_WIDGET(spin), 64, -1); - gtk_spin_button_set_wrap(spin, TRUE); - - gtk_widget_grab_focus(GTK_WIDGET(spin)); - - rotateDialog.x = spin; - } - { - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -359, 359, 1, 10, 10)); - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request(GTK_WIDGET(spin), 64, -1); - gtk_spin_button_set_wrap(spin, TRUE); - - rotateDialog.y = spin; - } - { - GtkAdjustment* adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -359, 359, 1, 10, 10)); - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(adj, 1, 0)); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(table, GTK_WIDGET(spin), 1, 2, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request(GTK_WIDGET(spin), 64, -1); - gtk_spin_button_set_wrap(spin, TRUE); - - rotateDialog.z = spin; - } - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Apply", G_CALLBACK(rotatedlg_apply), &rotateDialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - } - } - } - - if(modal_dialog_show(window, dialog) == eIDOK) - { - rotatedlg_apply(0, &rotateDialog); - } - - gtk_widget_destroy(GTK_WIDGET(window)); -} - -void DoScaleDlg() -{ - ModalDialog dialog; - GtkWidget* x; - GtkWidget* y; - GtkWidget* z; - - GtkWindow* window = create_dialog_window(MainFrame_getWindow(), "Scale", G_CALLBACK(dialog_delete_callback), &dialog); - - GtkAccelGroup* accel = gtk_accel_group_new(); - gtk_window_add_accel_group(window, accel); - - { - GtkHBox* hbox = create_dialog_hbox(4, 4); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(hbox)); - { - GtkTable* table = create_dialog_table(3, 2, 4, 4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(table), TRUE, TRUE, 0); - { - GtkWidget* label = gtk_label_new ("X:"); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - } - { - GtkWidget* label = gtk_label_new ("Y:"); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - } - { - GtkWidget* label = gtk_label_new ("Z:"); - gtk_widget_show (label); - gtk_table_attach(table, label, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - } - { - GtkWidget* entry = gtk_entry_new(); - gtk_widget_show (entry); - gtk_table_attach(table, entry, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - gtk_widget_grab_focus(entry); - - x = entry; - } - { - GtkWidget* entry = gtk_entry_new(); - gtk_widget_show (entry); - gtk_table_attach(table, entry, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - y = entry; - } - { - GtkWidget* entry = gtk_entry_new(); - gtk_widget_show (entry); - gtk_table_attach(table, entry, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - z = entry; - } - } - { - GtkVBox* vbox = create_dialog_vbox(4); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), TRUE, TRUE, 0); - { - GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - widget_make_default(GTK_WIDGET(button)); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0); - } - { - GtkButton* button = create_dialog_button("Cancel", G_CALLBACK(dialog_button_cancel), &dialog); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(button), FALSE, FALSE, 0); - gtk_widget_add_accelerator(GTK_WIDGET(button), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0); - } - } - } - - // Initialize dialog - gtk_entry_set_text (GTK_ENTRY (x), "1.0"); - gtk_entry_set_text (GTK_ENTRY (y), "1.0"); - gtk_entry_set_text (GTK_ENTRY (z), "1.0"); - - if(modal_dialog_show(window, dialog) == eIDOK) - { - float sx, sy, sz; - sx = static_cast(atof(gtk_entry_get_text (GTK_ENTRY (x)))); - sy = static_cast(atof(gtk_entry_get_text (GTK_ENTRY (y)))); - sz = static_cast(atof(gtk_entry_get_text (GTK_ENTRY (z)))); - - if (sx > 0 && sy > 0 && sz > 0) - { - StringOutputStream command; - command << "scaleSelected -x " << sx << " -y " << sy << " -z " << sz; - UndoableCommand undo(command.c_str()); - - Select_Scale(sx, sy, sz); - } - else - { - globalOutputStream() << "Warning.. Tried to scale by a zero value."; - } - } - - gtk_widget_destroy(GTK_WIDGET(window)); -} diff --git a/radiant/select.h b/radiant/select.h index 5a019f7c..42718162 100644 --- a/radiant/select.h +++ b/radiant/select.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,73 +19,64 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_SELECT_H) -#define INCLUDED_SELECT_H +typedef struct +{ + brush_t *brush; + face_t *face; + float dist; + qboolean selected; +} trace_t; -#include "math/vector.h" +#define SF_SELECTED_ONLY 0x0001 +#define SF_ENTITIES_FIRST 0x0002 +#define SF_SINGLEFACE 0x0004 +#define SF_IGNORECURVES 0x0008 +#define SF_IGNOREGROUPS 0x0010 +#define SF_CYCLE 0x0020 +#define SF_CAMERA 0x0040 // set when the operation happens through camera view, otherwise XY +#define SF_DRAG_ON 0x0080 +#define SF_DRAG_OFF 0x0100 +#define SF_DRAG (SF_DRAG_ON | SF_DRAG_OFF) -void Select_GetBounds(Vector3& mins, Vector3& maxs); -void Select_GetMid(Vector3& mid); - -void Select_Delete(); -void Select_Invert(); -void Select_Inside(); -void Select_Touching(); -void Scene_ExpandSelectionToEntities(); - -void Selection_Flipx(); -void Selection_Flipy(); -void Selection_Flipz(); -void Selection_Rotatex(); -void Selection_Rotatey(); -void Selection_Rotatez(); - - -void Selection_MoveDown(); -void Selection_MoveUp(); +trace_t Test_Ray (vec3_t origin, vec3_t dir, int flags); +void Select_GetBounds (vec3_t mins, vec3_t maxs); +void Select_GetMid (vec3_t mid); +void Select_Brush (brush_t *b, bool bComplete = true, bool bStatus = true); +void Select_Ray (vec3_t origin, vec3_t dir, int flags); +void Select_Delete (void); +void Select_Deselect (bool bDeselectFaces = true); +void Select_Invert(void); +void Select_Clone (void); +void Select_Move (vec3_t delta, bool bSnap = true); +void Select_NudgePoint(vec3_t delta, qboolean bSnap = true); +void WINAPI Select_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, void* pPlugTexdef = NULL); +void Select_FlipAxis (int axis); +void Select_RotateAxis (int axis, float deg, bool bPaint = true, bool bMouse = false); +void Select_RealCompleteTall(vec3_t mins, vec3_t maxs); +void Select_CompleteTall (void); +void Select_PartialTall (void); +void Select_Touching (void); +void Select_Inside (void); +void Select_Seperate (void); +void Select_MakeStructural (void); +void Select_MakeDetail (void); void Select_AllOfType(); +void Select_Reselect(); +void Select_FitTexture(int nHeight = 1, int nWidth = 1); -void DoRotateDlg(); -void DoScaleDlg(); - - -void Select_SetShader(const char* shader); - -class TextureProjection; -void Select_SetTexdef(const TextureProjection& projection); - -class ContentsFlagsValue; -void Select_SetFlags(const ContentsFlagsValue& flags); - -void Select_RotateTexture(float amt); -void Select_ScaleTexture(float x, float y); -void Select_ShiftTexture(float x, float y); -void Select_FitTexture(float horizontal = 1, float vertical = 1); -void FindReplaceTextures(const char* pFind, const char* pReplace, bool bSelected); - -void HideSelected(); +// absolute texture coordinates +// TTimo NOTE: this is stuff for old brushes format and rotation texture lock .. sort of in-between with bush primitives +void ComputeAbsolute(face_t* f, vec3_t& p1, vec3_t& p2, vec3_t& p3); +void AbsoluteToLocal(plane_t normal2, face_t* f, vec3_t& p1, vec3_t& p2, vec3_t& p3); +void Select_Hide(); void Select_ShowAllHidden(); +// add selected brushes to a group, update the tree +//void Select_AddToGroup(const char *pName); +//void Select_Name(const char *pName); // updating workzone to a given brush (depends on current view) +void UpdateWorkzone_ForBrush( brush_t* b ); -void Selection_construct(); -void Selection_destroy(); - - -struct select_workzone_t -{ - // defines the boundaries of the current work area - // is used to guess brushes and drop points third coordinate when creating from 2D view - Vector3 d_work_min, d_work_max; - - select_workzone_t() : - d_work_min(-64.0f,-64.0f,-64.0f), - d_work_max( 64.0f, 64.0f, 64.0f) - { - } -}; - -const select_workzone_t& Select_getWorkZone(); - -#endif +void Select_GroupEntity(entity_t* e); +void Select_MergeEntity(); diff --git a/radiant/selectedface.cpp b/radiant/selectedface.cpp new file mode 100644 index 00000000..b325df59 --- /dev/null +++ b/radiant/selectedface.cpp @@ -0,0 +1,128 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// Quick interface hack for selected face interface +// this one really needs more work, but I'm in a hurry with TexTool + +#include "stdafx.h" + +int WINAPI QERApp_GetSelectedFaceCount() +{ + return g_ptrSelectedFaces.GetSize(); +} + +face_t* WINAPI QERApp_GetSelectedFace(int iface) +{ + if (iface>=g_ptrSelectedFaces.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_GetFace: selected faces count exceeded\n"); + return NULL; + } + return reinterpret_cast(g_ptrSelectedFaces.GetAt(iface)); +} + +brush_t* WINAPI QERApp_GetSelectedFaceBrush(int iface) +{ + if (iface>=g_ptrSelectedFaceBrushes.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_GetFace: selected faces count exceeded\n"); + return NULL; + } + return reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(iface)); +} + +// NOTE: we expect pWinding to have MAX_POINTS_ON_WINDING points ready for writing +int WINAPI QERApp_GetFaceInfo(int iface, _QERFaceData *pFaceData, winding_t *pWinding) +{ + int size; + + if (iface>=g_ptrSelectedFaces.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_GetFaceInfo: selected faces count exceeded\n"); + return 0; + } + if (!g_qeglobals.m_bBrushPrimitMode) + { + Sys_Printf("Warning: unexpected QERApp_GetFaceInfo out of brush primitive mode\n"); + return 0; + } + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(iface)); + strcpy( pFaceData->m_TextureName, selFace->texdef.GetName() ); + VectorCopy( selFace->planepts[0], pFaceData->m_v1 ); + VectorCopy( selFace->planepts[1], pFaceData->m_v2 ); + VectorCopy( selFace->planepts[2], pFaceData->m_v3 ); + pFaceData->m_bBPrimit = true; + memcpy( &pFaceData->brushprimit_texdef, &selFace->brushprimit_texdef, sizeof(brushprimit_texdef_t) ); + size = (int)((winding_t *)0)->points[selFace->face_winding->numpoints]; + memcpy( pWinding, selFace->face_winding, size ); + return 1; +} + +int WINAPI QERApp_SetFaceInfo(int iface, _QERFaceData *pFaceData) +{ + if (iface>=g_ptrSelectedFaces.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_SetFaceInfo: selected faces count exceeded\n"); + return 0; + } + if (!g_qeglobals.m_bBrushPrimitMode) + { + Sys_Printf("Warning: unexpected QERApp_SetFaceInfo out of brush primitive mode\n"); + return 0; + } + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(iface)); + brush_t *selBrush = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(iface)); + //strcpy( selected_face->texdef.name, pFaceData->m_TextureName ); + selFace->texdef.SetName(pFaceData->m_TextureName); + VectorCopy( pFaceData->m_v1, selFace->planepts[0] ); + VectorCopy( pFaceData->m_v2, selFace->planepts[1] ); + VectorCopy( pFaceData->m_v3, selFace->planepts[2] ); + memcpy( &selFace->brushprimit_texdef, &pFaceData->brushprimit_texdef, sizeof(brushprimit_texdef_t) ); + Brush_Build( selBrush ); + Sys_UpdateWindows(W_ALL); + return 1; +} + +int WINAPI QERApp_ISelectedFace_GetTextureNumber(int iface) +{ + if (iface>=g_ptrSelectedFaces.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_ISelectedFace_GetTextureNumber: selected faces count exceeded\n"); + return 0; + } + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(iface)); + return selFace->d_texture->texture_number; +} + +void WINAPI QERApp_GetTextureSize (int iface, int Size[2]) +{ + if (iface>=g_ptrSelectedFaces.GetSize()) + { + Sys_FPrintf (SYS_ERR, "QERApp_GetTextureSize: selected faces count exceeded\n"); + return; + } + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(iface)); + Size[0] = selFace->d_texture->width; + Size[1] = selFace->d_texture->height; +} diff --git a/radiant/selection.cpp b/radiant/selection.cpp deleted file mode 100644 index d3995312..00000000 --- a/radiant/selection.cpp +++ /dev/null @@ -1,4141 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "selection.h" - -#include "debugging/debugging.h" - -#include -#include -#include - -#include "windowobserver.h" -#include "iundo.h" -#include "ientity.h" -#include "cullable.h" -#include "renderable.h" -#include "selectable.h" -#include "editable.h" - -#include "math/frustum.h" -#include "signal/signal.h" -#include "generic/object.h" -#include "selectionlib.h" -#include "render.h" -#include "view.h" -#include "renderer.h" -#include "stream/stringstream.h" -#include "eclasslib.h" -#include "generic/bitfield.h" -#include "generic/static.h" -#include "pivot.h" -#include "stringio.h" -#include "container/container.h" - -#include "grid.h" - -struct Pivot2World -{ - Matrix4 m_worldSpace; - Matrix4 m_viewpointSpace; - Matrix4 m_viewplaneSpace; - Vector3 m_axis_screen; - - void update(const Matrix4& pivot2world, const Matrix4& modelview, const Matrix4& projection, const Matrix4& viewport) - { - Pivot2World_worldSpace(m_worldSpace, pivot2world, modelview, projection, viewport); - Pivot2World_viewpointSpace(m_viewpointSpace, m_axis_screen, pivot2world, modelview, projection, viewport); - Pivot2World_viewplaneSpace(m_viewplaneSpace, pivot2world, modelview, projection, viewport); - } -}; - - -void point_for_device_point(Vector3& point, const Matrix4& device2object, const float x, const float y, const float z) -{ - // transform from normalised device coords to object coords - point = vector4_projected(matrix4_transformed_vector4(device2object, Vector4(x, y, z, 1))); -} - -void ray_for_device_point(Ray& ray, const Matrix4& device2object, const float x, const float y) -{ - // point at x, y, zNear - point_for_device_point(ray.origin, device2object, x, y, -1); - - // point at x, y, zFar - point_for_device_point(ray.direction, device2object, x, y, 1); - - // construct ray - vector3_subtract(ray.direction, ray.origin); - vector3_normalise(ray.direction); -} - -bool sphere_intersect_ray(const Vector3& origin, float radius, const Ray& ray, Vector3& intersection) -{ - intersection = vector3_subtracted(origin, ray.origin); - const double a = vector3_dot(intersection, ray.direction); - const double d = radius * radius - (vector3_dot(intersection, intersection) - a * a); - - if(d > 0) - { - intersection = vector3_added(ray.origin, vector3_scaled(ray.direction, a - sqrt(d))); - return true; - } - else - { - intersection = vector3_added( ray.origin, vector3_scaled(ray.direction, a)); - return false; - } -} - -void ray_intersect_ray(const Ray& ray, const Ray& other, Vector3& intersection) -{ - intersection = vector3_subtracted(ray.origin, other.origin); - //float a = 1;//vector3_dot(ray.direction, ray.direction); // always >= 0 - double dot = vector3_dot(ray.direction, other.direction); - //float c = 1;//vector3_dot(other.direction, other.direction); // always >= 0 - double d = vector3_dot(ray.direction, intersection); - double e = vector3_dot(other.direction, intersection); - double D = 1 - dot*dot;//a*c - dot*dot; // always >= 0 - - if (D < 0.000001) - { - // the lines are almost parallel - intersection = vector3_added(other.origin, vector3_scaled(other.direction, e)); - } - else - { - intersection = vector3_added(other.origin, vector3_scaled(other.direction, (e - dot*d) / D)); - } -} - -const Vector3 g_origin(0, 0, 0); -const float g_radius = 64; - -void point_on_sphere(Vector3& point, const Matrix4& device2object, const float x, const float y) -{ - Ray ray; - ray_for_device_point(ray, device2object, x, y); - sphere_intersect_ray(g_origin, g_radius, ray, point); -} - -void point_on_axis(Vector3& point, const Vector3& axis, const Matrix4& device2object, const float x, const float y) -{ - Ray ray; - ray_for_device_point(ray, device2object, x, y); - ray_intersect_ray(ray, Ray(Vector3(0, 0, 0), axis), point); -} - -void point_on_plane(Vector3& point, const Matrix4& device2object, const float x, const float y) -{ - Matrix4 object2device(matrix4_full_inverse(device2object)); - point = vector4_projected(matrix4_transformed_vector4(device2object, Vector4(x, y, object2device[14] / object2device[15], 1))); -} - -//! a and b are unit vectors .. returns angle in radians -inline float angle_between(const Vector3& a, const Vector3& b) -{ - return static_cast(2.0 * atan2( - vector3_length(vector3_subtracted(a, b)), - vector3_length(vector3_added(a, b)) - )); -} - - -#if defined(_DEBUG) -class test_quat -{ -public: - test_quat(const Vector3& from, const Vector3& to) - { - Vector4 quaternion(quaternion_for_unit_vectors(from, to)); - Matrix4 matrix(matrix4_rotation_for_quaternion(quaternion_multiplied_by_quaternion(quaternion, c_quaternion_identity))); - } -private: -}; - -static test_quat bleh(g_vector3_axis_x, g_vector3_axis_y); -#endif - -//! axis is a unit vector -inline void constrain_to_axis(Vector3& vec, const Vector3& axis) -{ - vec = vector3_normalised(vector3_added(vec, vector3_scaled(axis, -vector3_dot(vec, axis)))); -} - -//! a and b are unit vectors .. a and b must be orthogonal to axis .. returns angle in radians -float angle_for_axis(const Vector3& a, const Vector3& b, const Vector3& axis) -{ - if(vector3_dot(axis, vector3_cross(a, b)) > 0.0) - return angle_between(a, b); - else - return -angle_between(a, b); -} - -float distance_for_axis(const Vector3& a, const Vector3& b, const Vector3& axis) -{ - return static_cast(vector3_dot(b, axis) - vector3_dot(a, axis)); -} - -class Manipulatable -{ -public: - virtual void Construct(const Matrix4& device2manip, const float x, const float y) = 0; - virtual void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) = 0; -}; - -void transform_local2object(Matrix4& object, const Matrix4& local, const Matrix4& local2object) -{ - object = matrix4_multiplied_by_matrix4( - matrix4_multiplied_by_matrix4(local2object, local), - matrix4_full_inverse(local2object) - ); -} - -class Rotatable -{ -public: - virtual void rotate(const Quaternion& rotation) = 0; -}; - -class RotateFree : public Manipulatable -{ - Vector3 m_start; - Rotatable& m_rotatable; -public: - RotateFree(Rotatable& rotatable) - : m_rotatable(rotatable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_sphere(m_start, device2manip, x, y); - vector3_normalise(m_start); - } - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - - point_on_sphere(current, device2manip, x, y); - vector3_normalise(current); - - m_rotatable.rotate(quaternion_for_unit_vectors(m_start, current)); - } -}; - -class RotateAxis : public Manipulatable -{ - Vector3 m_axis; - Vector3 m_start; - Rotatable& m_rotatable; -public: - RotateAxis(Rotatable& rotatable) - : m_rotatable(rotatable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_sphere(m_start, device2manip, x, y); - constrain_to_axis(m_start, m_axis); - } - /// \brief Converts current position to a normalised vector orthogonal to axis. - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - point_on_sphere(current, device2manip, x, y); - constrain_to_axis(current, m_axis); - - m_rotatable.rotate(quaternion_for_axisangle(m_axis, angle_for_axis(m_start, current, m_axis))); - } - - void SetAxis(const Vector3& axis) - { - m_axis = axis; - } -}; - -void translation_local2object(Vector3& object, const Vector3& local, const Matrix4& local2object) -{ - object = matrix4_get_translation_vec3( - matrix4_multiplied_by_matrix4( - matrix4_translated_by_vec3(local2object, local), - matrix4_full_inverse(local2object) - ) - ); -} - -class Translatable -{ -public: - virtual void translate(const Vector3& translation) = 0; -}; - -class TranslateAxis : public Manipulatable -{ - Vector3 m_start; - Vector3 m_axis; - Translatable& m_translatable; -public: - TranslateAxis(Translatable& translatable) - : m_translatable(translatable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_axis(m_start, m_axis, device2manip, x, y); - } - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - point_on_axis(current, m_axis, device2manip, x, y); - current = vector3_scaled(m_axis, distance_for_axis(m_start, current, m_axis)); - - translation_local2object(current, current, manip2object); - vector3_snap(current, GetGridSize()); - - m_translatable.translate(current); - } - - void SetAxis(const Vector3& axis) - { - m_axis = axis; - } -}; - -class TranslateFree : public Manipulatable -{ -private: - Vector3 m_start; - Translatable& m_translatable; -public: - TranslateFree(Translatable& translatable) - : m_translatable(translatable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_plane(m_start, device2manip, x, y); - } - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - point_on_plane(current, device2manip, x, y); - current = vector3_subtracted(current, m_start); - - translation_local2object(current, current, manip2object); - vector3_snap(current, GetGridSize()); - - m_translatable.translate(current); - } -}; - - -class Scalable -{ -public: - virtual void scale(const Vector3& scaling) = 0; -}; - - -class ScaleAxis : public Manipulatable -{ -private: - Vector3 m_start; - Vector3 m_axis; - Scalable& m_scalable; -public: - ScaleAxis(Scalable& scalable) - : m_scalable(scalable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_axis(m_start, m_axis, device2manip, x, y); - } - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - point_on_axis(current, m_axis, device2manip, x, y); - Vector3 delta = vector3_subtracted(current, m_start); - - translation_local2object(delta, delta, manip2object); - vector3_snap(delta, GetGridSize()); - - Vector3 start(vector3_snapped(m_start, GetGridSize())); - Vector3 scale( - start[0] == 0 ? 1 : 1 + delta[0] / start[0], - start[1] == 0 ? 1 : 1 + delta[1] / start[1], - start[2] == 0 ? 1 : 1 + delta[2] / start[2] - ); - m_scalable.scale(scale); - } - - void SetAxis(const Vector3& axis) - { - m_axis = axis; - } -}; - -class ScaleFree : public Manipulatable -{ -private: - Vector3 m_start; - Scalable& m_scalable; -public: - ScaleFree(Scalable& scalable) - : m_scalable(scalable) - { - } - void Construct(const Matrix4& device2manip, const float x, const float y) - { - point_on_plane(m_start, device2manip, x, y); - } - void Transform(const Matrix4& manip2object, const Matrix4& device2manip, const float x, const float y) - { - Vector3 current; - point_on_plane(current, device2manip, x, y); - Vector3 delta = vector3_subtracted(current, m_start); - - translation_local2object(delta, delta, manip2object); - vector3_snap(delta, GetGridSize()); - - Vector3 start(vector3_snapped(m_start, GetGridSize())); - Vector3 scale( - start[0] == 0 ? 1 : 1 + delta[0] / start[0], - start[1] == 0 ? 1 : 1 + delta[1] / start[1], - start[2] == 0 ? 1 : 1 + delta[2] / start[2] - ); - m_scalable.scale(scale); - } -}; - - - - - - - - - - -class RenderableClippedPrimitive : public OpenGLRenderable -{ - struct primitive_t - { - PointVertex m_points[9]; - std::size_t m_count; - }; - Matrix4 m_inverse; - std::vector m_primitives; -public: - Matrix4 m_world; - - void render(RenderStateFlags state) const - { - for(std::size_t i=0; i P[1])) // an upward crossing - || (((*prev)[1] > P[1]) && ((*cur)[1] <= P[1]))) - { // a downward crossing - // compute the actual edge-ray intersect x-coordinate - float vt = (float)(P[1] - (*prev)[1]) / ((*cur)[1] - (*prev)[1]); - if (P[0] < (*prev)[0] + vt * ((*cur)[0] - (*prev)[0])) // P[0] < intersect - { - ++crossings; // a valid crossing of y=P[1] right of P[0] - } - } - } - return (crossings & 0x1) != 0; // 0 if even (out), and 1 if odd (in) -} - -inline double triangle_signed_area_XY(const Vector3& p0, const Vector3& p1, const Vector3& p2) -{ - return ((p1[0] - p0[0]) * (p2[1] - p0[1])) - ((p2[0] - p0[0]) * (p1[1] - p0[1])); -} - -enum clipcull_t -{ - eClipCullNone, - eClipCullCW, - eClipCullCCW, -}; - - -inline SelectionIntersection select_point_from_clipped(Vector4& clipped) -{ - return SelectionIntersection(clipped[2] / clipped[3], static_cast(vector3_length_squared(Vector3(clipped[0] / clipped[3], clipped[1] / clipped[3], 0)))); -} - -void BestPoint(std::size_t count, Vector4 clipped[9], SelectionIntersection& best, clipcull_t cull) -{ - Vector3 normalised[9]; - - { - for(std::size_t i=0; i 2) - { - double signed_area = triangle_signed_area_XY(normalised[0], normalised[1], normalised[2]); - - if((cull == eClipCullCW && signed_area > 0) - || (cull == eClipCullCCW && signed_area < 0)) - return; - } - - if(count == 2) - { - Segment3D segment(normalised[0], normalised[1]); - Point3D point = segment_closest_point_to_point(segment, Vector3(0, 0, 0)); - assign_if_closer(best, SelectionIntersection(point.z(), 0)); - } - else if(count > 2 && !point_test_polygon_2d(Vector3(0, 0, 0), normalised, normalised + count)) - { - point_iterator_t end = normalised + count; - for(point_iterator_t previous = end-1, current = normalised; current != end; previous = current, ++current) - { - Segment3D segment(*previous, *current); - Point3D point = segment_closest_point_to_point(segment, Vector3(0, 0, 0)); - float depth = point.z(); - point.z() = 0; - float distance = static_cast(vector3_length_squared(point)); - - assign_if_closer(best, SelectionIntersection(depth, distance)); - } - } - else if(count > 2) - { - assign_if_closer( - best, - SelectionIntersection( - static_cast(ray_distance_to_plane( - Ray(Vector3(0, 0, 0), Vector3(0, 0, 1)), - plane3_for_points(normalised[0], normalised[1], normalised[2]) - )), - 0 - ) - ); - } - -#if defined(DEBUG_SELECTION) - if(count >= 2) - g_render_clipped.insert(clipped, count); -#endif -} - -void LineStrip_BestPoint(const Matrix4& local2view, const PointVertex* vertices, const std::size_t size, SelectionIntersection& best) -{ - Vector4 clipped[2]; - for(std::size_t i = 0; (i + 1) < size; ++i) - { - const std::size_t count = matrix4_clip_line(local2view, vertex3f_to_vector3(vertices[i].vertex), vertex3f_to_vector3(vertices[i + 1].vertex), clipped); - BestPoint(count, clipped, best, eClipCullNone); - } -} - -void LineLoop_BestPoint(const Matrix4& local2view, const PointVertex* vertices, const std::size_t size, SelectionIntersection& best) -{ - Vector4 clipped[2]; - for(std::size_t i = 0; i < size; ++i) - { - const std::size_t count = matrix4_clip_line(local2view, vertex3f_to_vector3(vertices[i].vertex), vertex3f_to_vector3(vertices[(i+1)%size].vertex), clipped); - BestPoint(count, clipped, best, eClipCullNone); - } -} - -void Line_BestPoint(const Matrix4& local2view, const PointVertex vertices[2], SelectionIntersection& best) -{ - Vector4 clipped[2]; - const std::size_t count = matrix4_clip_line(local2view, vertex3f_to_vector3(vertices[0].vertex), vertex3f_to_vector3(vertices[1].vertex), clipped); - BestPoint(count, clipped, best, eClipCullNone); -} - -void Circle_BestPoint(const Matrix4& local2view, clipcull_t cull, const PointVertex* vertices, const std::size_t size, SelectionIntersection& best) -{ - Vector4 clipped[9]; - for(std::size_t i=0; i((*x).vertex), - reinterpret_cast((*y).vertex), - reinterpret_cast((*z).vertex), - clipped - ), - clipped, - best, - cull - ); - } -} - - -typedef std::multimap SelectableSortedSet; - -class SelectionPool : public Selector -{ - SelectableSortedSet m_pool; - SelectionIntersection m_intersection; - Selectable* m_selectable; - -public: - void pushSelectable(Selectable& selectable) - { - m_intersection = SelectionIntersection(); - m_selectable = &selectable; - } - void popSelectable() - { - addSelectable(m_intersection, m_selectable); - m_intersection = SelectionIntersection(); - } - void addIntersection(const SelectionIntersection& intersection) - { - assign_if_closer(m_intersection, intersection); - } - void addSelectable(const SelectionIntersection& intersection, Selectable* selectable) - { - if(intersection.valid()) - { - m_pool.insert(SelectableSortedSet::value_type(intersection, selectable)); - } - } - - typedef SelectableSortedSet::iterator iterator; - - iterator begin() - { - return m_pool.begin(); - } - iterator end() - { - return m_pool.end(); - } - - bool failed() - { - return m_pool.empty(); - } -}; - - -const Colour4b g_colour_sphere(0, 0, 0, 255); -const Colour4b g_colour_screen(0, 255, 255, 255); -const Colour4b g_colour_selected(255, 255, 0, 255); - -inline const Colour4b& colourSelected(const Colour4b& colour, bool selected) -{ - return (selected) ? g_colour_selected : colour; -} - -template -inline void draw_semicircle(const std::size_t segments, const float radius, PointVertex* vertices, remap_policy remap) -{ - const double increment = c_pi / double(segments << 2); - - std::size_t count = 0; - float x = radius; - float y = 0; - remap_policy::set(vertices[segments << 2].vertex, -radius, 0, 0); - while(count < segments) - { - PointVertex* i = vertices + count; - PointVertex* j = vertices + ((segments << 1) - (count + 1)); - - PointVertex* k = i + (segments << 1); - PointVertex* l = j + (segments << 1); - -#if 0 - PointVertex* m = i + (segments << 2); - PointVertex* n = j + (segments << 2); - PointVertex* o = k + (segments << 2); - PointVertex* p = l + (segments << 2); -#endif - - remap_policy::set(i->vertex, x,-y, 0); - remap_policy::set(k->vertex,-y,-x, 0); -#if 0 - remap_policy::set(m->vertex,-x, y, 0); - remap_policy::set(o->vertex, y, x, 0); -#endif - - ++count; - - { - const double theta = increment * count; - x = static_cast(radius * cos(theta)); - y = static_cast(radius * sin(theta)); - } - - remap_policy::set(j->vertex, y,-x, 0); - remap_policy::set(l->vertex,-x,-y, 0); -#if 0 - remap_policy::set(n->vertex,-y, x, 0); - remap_policy::set(p->vertex, x, y, 0); -#endif - } -} - -class Manipulator -{ -public: - virtual Manipulatable* GetManipulatable() = 0; - virtual void testSelect(const View& view, const Matrix4& pivot2world) - { - } - virtual void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& pivot2world) - { - } - virtual void setSelected(bool select) = 0; - virtual bool isSelected() const = 0; -}; - - -inline Vector3 normalised_safe(const Vector3& self) -{ - if(vector3_equal(self, g_vector3_identity)) - { - return g_vector3_identity; - } - return vector3_normalised(self); -} - - -class RotateManipulator : public Manipulator -{ - struct RenderableCircle : public OpenGLRenderable - { - Array m_vertices; - - RenderableCircle(std::size_t size) : m_vertices(size) - { - } - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices.data()->colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices.data()->vertex); - glDrawArrays(GL_LINE_LOOP, 0, GLsizei(m_vertices.size())); - } - void setColour(const Colour4b& colour) - { - for(Array::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - (*i).colour = colour; - } - } - }; - - struct RenderableSemiCircle : public OpenGLRenderable - { - Array m_vertices; - - RenderableSemiCircle(std::size_t size) : m_vertices(size) - { - } - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices.data()->colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices.data()->vertex); - glDrawArrays(GL_LINE_STRIP, 0, GLsizei(m_vertices.size())); - } - void setColour(const Colour4b& colour) - { - for(Array::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - (*i).colour = colour; - } - } - }; - - RotateFree m_free; - RotateAxis m_axis; - Vector3 m_axis_screen; - RenderableSemiCircle m_circle_x; - RenderableSemiCircle m_circle_y; - RenderableSemiCircle m_circle_z; - RenderableCircle m_circle_screen; - RenderableCircle m_circle_sphere; - SelectableBool m_selectable_x; - SelectableBool m_selectable_y; - SelectableBool m_selectable_z; - SelectableBool m_selectable_screen; - SelectableBool m_selectable_sphere; - Pivot2World m_pivot; - Matrix4 m_local2world_x; - Matrix4 m_local2world_y; - Matrix4 m_local2world_z; - bool m_circle_x_visible; - bool m_circle_y_visible; - bool m_circle_z_visible; -public: - static Shader* m_state_outer; - - RotateManipulator(Rotatable& rotatable, std::size_t segments, float radius) : - m_free(rotatable), - m_axis(rotatable), - m_circle_x((segments << 2) + 1), - m_circle_y((segments << 2) + 1), - m_circle_z((segments << 2) + 1), - m_circle_screen(segments<<3), - m_circle_sphere(segments<<3) - { - draw_semicircle(segments, radius, m_circle_x.m_vertices.data(), RemapYZX()); - draw_semicircle(segments, radius, m_circle_y.m_vertices.data(), RemapZXY()); - draw_semicircle(segments, radius, m_circle_z.m_vertices.data(), RemapXYZ()); - - draw_circle(segments, radius * 1.15f, m_circle_screen.m_vertices.data(), RemapXYZ()); - draw_circle(segments, radius, m_circle_sphere.m_vertices.data(), RemapXYZ()); - } - - - void UpdateColours() - { - m_circle_x.setColour(colourSelected(g_colour_x, m_selectable_x.isSelected())); - m_circle_y.setColour(colourSelected(g_colour_y, m_selectable_y.isSelected())); - m_circle_z.setColour(colourSelected(g_colour_z, m_selectable_z.isSelected())); - m_circle_screen.setColour(colourSelected(g_colour_screen, m_selectable_screen.isSelected())); - m_circle_sphere.setColour(colourSelected(g_colour_sphere, false)); - } - - void updateCircleTransforms() - { - Vector3 localViewpoint(matrix4_transformed_direction(matrix4_transposed(m_pivot.m_worldSpace), vector4_to_vector3(m_pivot.m_viewpointSpace.z()))); - - m_circle_x_visible = !vector3_equal_epsilon(g_vector3_axis_x, localViewpoint, 1e-6f); - if(m_circle_x_visible) - { - m_local2world_x = g_matrix4_identity; - vector4_to_vector3(m_local2world_x.y()) = normalised_safe( - vector3_cross(g_vector3_axis_x, localViewpoint) - ); - vector4_to_vector3(m_local2world_x.z()) = normalised_safe( - vector3_cross(vector4_to_vector3(m_local2world_x.x()), vector4_to_vector3(m_local2world_x.y())) - ); - matrix4_premultiply_by_matrix4(m_local2world_x, m_pivot.m_worldSpace); - } - - m_circle_y_visible = !vector3_equal_epsilon(g_vector3_axis_y, localViewpoint, 1e-6f); - if(m_circle_y_visible) - { - m_local2world_y = g_matrix4_identity; - vector4_to_vector3(m_local2world_y.z()) = normalised_safe( - vector3_cross(g_vector3_axis_y, localViewpoint) - ); - vector4_to_vector3(m_local2world_y.x()) = normalised_safe( - vector3_cross(vector4_to_vector3(m_local2world_y.y()), vector4_to_vector3(m_local2world_y.z())) - ); - matrix4_premultiply_by_matrix4(m_local2world_y, m_pivot.m_worldSpace); - } - - m_circle_z_visible = !vector3_equal_epsilon(g_vector3_axis_z, localViewpoint, 1e-6f); - if(m_circle_z_visible) - { - m_local2world_z = g_matrix4_identity; - vector4_to_vector3(m_local2world_z.x()) = normalised_safe( - vector3_cross(g_vector3_axis_z, localViewpoint) - ); - vector4_to_vector3(m_local2world_z.y()) = normalised_safe( - vector3_cross(vector4_to_vector3(m_local2world_z.z()), vector4_to_vector3(m_local2world_z.x())) - ); - matrix4_premultiply_by_matrix4(m_local2world_z, m_pivot.m_worldSpace); - } - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, volume.GetModelview(), volume.GetProjection(), volume.GetViewport()); - updateCircleTransforms(); - - // temp hack - UpdateColours(); - - renderer.SetState(m_state_outer, Renderer::eWireframeOnly); - renderer.SetState(m_state_outer, Renderer::eFullMaterials); - - renderer.addRenderable(m_circle_screen, m_pivot.m_viewpointSpace); - renderer.addRenderable(m_circle_sphere, m_pivot.m_viewpointSpace); - - if(m_circle_x_visible) - { - renderer.addRenderable(m_circle_x, m_local2world_x); - } - if(m_circle_y_visible) - { - renderer.addRenderable(m_circle_y, m_local2world_y); - } - if(m_circle_z_visible) - { - renderer.addRenderable(m_circle_z, m_local2world_z); - } - } - void testSelect(const View& view, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, view.GetModelview(), view.GetProjection(), view.GetViewport()); - updateCircleTransforms(); - - SelectionPool selector; - - { - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_local2world_x)); - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(view.GetViewMatrix()); -#endif - - SelectionIntersection best; - LineStrip_BestPoint(local2view, m_circle_x.m_vertices.data(), m_circle_x.m_vertices.size(), best); - selector.addSelectable(best, &m_selectable_x); - } - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_local2world_y)); - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(view.GetViewMatrix()); -#endif - - SelectionIntersection best; - LineStrip_BestPoint(local2view, m_circle_y.m_vertices.data(), m_circle_y.m_vertices.size(), best); - selector.addSelectable(best, &m_selectable_y); - } - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_local2world_z)); - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(view.GetViewMatrix()); -#endif - - SelectionIntersection best; - LineStrip_BestPoint(local2view, m_circle_z.m_vertices.data(), m_circle_z.m_vertices.size(), best); - selector.addSelectable(best, &m_selectable_z); - } - } - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_pivot.m_viewpointSpace)); - - { - SelectionIntersection best; - LineLoop_BestPoint(local2view, m_circle_screen.m_vertices.data(), m_circle_screen.m_vertices.size(), best); - selector.addSelectable(best, &m_selectable_screen); - } - - { - SelectionIntersection best; - Circle_BestPoint(local2view, eClipCullCW, m_circle_sphere.m_vertices.data(), m_circle_sphere.m_vertices.size(), best); - selector.addSelectable(best, &m_selectable_sphere); - } - } - - m_axis_screen = m_pivot.m_axis_screen; - - if(!selector.failed()) - { - (*selector.begin()).second->setSelected(true); - } - } - - Manipulatable* GetManipulatable() - { - if(m_selectable_x.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_x); - return &m_axis; - } - else if(m_selectable_y.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_y); - return &m_axis; - } - else if(m_selectable_z.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_z); - return &m_axis; - } - else if(m_selectable_screen.isSelected()) - { - m_axis.SetAxis(m_axis_screen); - return &m_axis; - } - else - return &m_free; - } - - void setSelected(bool select) - { - m_selectable_x.setSelected(select); - m_selectable_y.setSelected(select); - m_selectable_z.setSelected(select); - m_selectable_screen.setSelected(select); - } - bool isSelected() const - { - return m_selectable_x.isSelected() - | m_selectable_y.isSelected() - | m_selectable_z.isSelected() - | m_selectable_screen.isSelected() - | m_selectable_sphere.isSelected(); - } -}; - -Shader* RotateManipulator::m_state_outer; - - -const float arrowhead_length = 16; -const float arrowhead_radius = 4; - -inline void draw_arrowline(const float length, PointVertex* line, const std::size_t axis) -{ - (*line++).vertex = vertex3f_identity; - (*line).vertex = vertex3f_identity; - vertex3f_to_array((*line).vertex)[axis] = length - arrowhead_length; -} - -template -inline void draw_arrowhead(const std::size_t segments, const float length, FlatShadedVertex* vertices, VertexRemap, NormalRemap) -{ - std::size_t head_tris = (segments << 3); - const double head_segment = c_2pi / head_tris; - for(std::size_t i = 0; i < head_tris; ++i) - { - { - FlatShadedVertex& point = vertices[i*6+0]; - VertexRemap::x(point.vertex) = length - arrowhead_length; - VertexRemap::y(point.vertex) = arrowhead_radius * static_cast(cos(i * head_segment)); - VertexRemap::z(point.vertex) = arrowhead_radius * static_cast(sin(i * head_segment)); - NormalRemap::x(point.normal) = arrowhead_radius / arrowhead_length; - NormalRemap::y(point.normal) = static_cast(cos(i * head_segment)); - NormalRemap::z(point.normal) = static_cast(sin(i * head_segment)); - } - { - FlatShadedVertex& point = vertices[i*6+1]; - VertexRemap::x(point.vertex) = length; - VertexRemap::y(point.vertex) = 0; - VertexRemap::z(point.vertex) = 0; - NormalRemap::x(point.normal) = arrowhead_radius / arrowhead_length; - NormalRemap::y(point.normal) = static_cast(cos((i + 0.5) * head_segment)); - NormalRemap::z(point.normal) = static_cast(sin((i + 0.5) * head_segment)); - } - { - FlatShadedVertex& point = vertices[i*6+2]; - VertexRemap::x(point.vertex) = length - arrowhead_length; - VertexRemap::y(point.vertex) = arrowhead_radius * static_cast(cos((i+1) * head_segment)); - VertexRemap::z(point.vertex) = arrowhead_radius * static_cast(sin((i+1) * head_segment)); - NormalRemap::x(point.normal) = arrowhead_radius / arrowhead_length; - NormalRemap::y(point.normal) = static_cast(cos((i+1) * head_segment)); - NormalRemap::z(point.normal) = static_cast(sin((i+1) * head_segment)); - } - - { - FlatShadedVertex& point = vertices[i*6+3]; - VertexRemap::x(point.vertex) = length - arrowhead_length; - VertexRemap::y(point.vertex) = 0; - VertexRemap::z(point.vertex) = 0; - NormalRemap::x(point.normal) = -1; - NormalRemap::y(point.normal) = 0; - NormalRemap::z(point.normal) = 0; - } - { - FlatShadedVertex& point = vertices[i*6+4]; - VertexRemap::x(point.vertex) = length - arrowhead_length; - VertexRemap::y(point.vertex) = arrowhead_radius * static_cast(cos(i * head_segment)); - VertexRemap::z(point.vertex) = arrowhead_radius * static_cast(sin(i * head_segment)); - NormalRemap::x(point.normal) = -1; - NormalRemap::y(point.normal) = 0; - NormalRemap::z(point.normal) = 0; - } - { - FlatShadedVertex& point = vertices[i*6+5]; - VertexRemap::x(point.vertex) = length - arrowhead_length; - VertexRemap::y(point.vertex) = arrowhead_radius * static_cast(cos((i+1) * head_segment)); - VertexRemap::z(point.vertex) = arrowhead_radius * static_cast(sin((i+1) * head_segment)); - NormalRemap::x(point.normal) = -1; - NormalRemap::y(point.normal) = 0; - NormalRemap::z(point.normal) = 0; - } - } -} - -template -class TripleRemapXYZ -{ -public: - static float& x(Triple& triple) - { - return triple.x(); - } - static float& y(Triple& triple) - { - return triple.y(); - } - static float& z(Triple& triple) - { - return triple.z(); - } -}; - -template -class TripleRemapYZX -{ -public: - static float& x(Triple& triple) - { - return triple.y(); - } - static float& y(Triple& triple) - { - return triple.z(); - } - static float& z(Triple& triple) - { - return triple.x(); - } -}; - -template -class TripleRemapZXY -{ -public: - static float& x(Triple& triple) - { - return triple.z(); - } - static float& y(Triple& triple) - { - return triple.x(); - } - static float& z(Triple& triple) - { - return triple.y(); - } -}; - -void vector3_print(const Vector3& v) -{ - globalOutputStream() << "( " << v.x() << " " << v.y() << " " << v.z() << " )"; -} - -class TranslateManipulator : public Manipulator -{ - struct RenderableArrowLine : public OpenGLRenderable - { - PointVertex m_line[2]; - - RenderableArrowLine() - { - } - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_line[0].colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_line[0].vertex); - glDrawArrays(GL_LINES, 0, 2); - } - void setColour(const Colour4b& colour) - { - m_line[0].colour = colour; - m_line[1].colour = colour; - } - }; - struct RenderableArrowHead : public OpenGLRenderable - { - Array m_vertices; - - RenderableArrowHead(std::size_t size) - : m_vertices(size) - { - } - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(FlatShadedVertex), &m_vertices.data()->colour); - glVertexPointer(3, GL_FLOAT, sizeof(FlatShadedVertex), &m_vertices.data()->vertex); - glNormalPointer(GL_FLOAT, sizeof(FlatShadedVertex), &m_vertices.data()->normal); - glDrawArrays(GL_TRIANGLES, 0, GLsizei(m_vertices.size())); - } - void setColour(const Colour4b& colour) - { - for(Array::iterator i = m_vertices.begin(); i != m_vertices.end(); ++i) - { - (*i).colour = colour; - } - } - }; - struct RenderableQuad : public OpenGLRenderable - { - PointVertex m_quad[4]; - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_quad[0].colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_quad[0].vertex); - glDrawArrays(GL_LINE_LOOP, 0, 4); - } - void setColour(const Colour4b& colour) - { - m_quad[0].colour = colour; - m_quad[1].colour = colour; - m_quad[2].colour = colour; - m_quad[3].colour = colour; - } - }; - - TranslateFree m_free; - TranslateAxis m_axis; - RenderableArrowLine m_arrow_x; - RenderableArrowLine m_arrow_y; - RenderableArrowLine m_arrow_z; - RenderableArrowHead m_arrow_head_x; - RenderableArrowHead m_arrow_head_y; - RenderableArrowHead m_arrow_head_z; - RenderableQuad m_quad_screen; - SelectableBool m_selectable_x; - SelectableBool m_selectable_y; - SelectableBool m_selectable_z; - SelectableBool m_selectable_screen; - Pivot2World m_pivot; -public: - static Shader* m_state_wire; - static Shader* m_state_fill; - - TranslateManipulator(Translatable& translatable, std::size_t segments, float length) : - m_free(translatable), - m_axis(translatable), - m_arrow_head_x(3 * 2 * (segments << 3)), - m_arrow_head_y(3 * 2 * (segments << 3)), - m_arrow_head_z(3 * 2 * (segments << 3)) - { - draw_arrowline(length, m_arrow_x.m_line, 0); - draw_arrowhead(segments, length, m_arrow_head_x.m_vertices.data(), TripleRemapXYZ(), TripleRemapXYZ()); - draw_arrowline(length, m_arrow_y.m_line, 1); - draw_arrowhead(segments, length, m_arrow_head_y.m_vertices.data(), TripleRemapYZX(), TripleRemapYZX()); - draw_arrowline(length, m_arrow_z.m_line, 2); - draw_arrowhead(segments, length, m_arrow_head_z.m_vertices.data(), TripleRemapZXY(), TripleRemapZXY()); - - draw_quad(16, m_quad_screen.m_quad); - } - - void UpdateColours() - { - m_arrow_x.setColour(colourSelected(g_colour_x, m_selectable_x.isSelected())); - m_arrow_head_x.setColour(colourSelected(g_colour_x, m_selectable_x.isSelected())); - m_arrow_y.setColour(colourSelected(g_colour_y, m_selectable_y.isSelected())); - m_arrow_head_y.setColour(colourSelected(g_colour_y, m_selectable_y.isSelected())); - m_arrow_z.setColour(colourSelected(g_colour_z, m_selectable_z.isSelected())); - m_arrow_head_z.setColour(colourSelected(g_colour_z, m_selectable_z.isSelected())); - m_quad_screen.setColour(colourSelected(g_colour_screen, m_selectable_screen.isSelected())); - } - - bool manipulator_show_axis(const Pivot2World& pivot, const Vector3& axis) - { - return fabs(vector3_dot(pivot.m_axis_screen, axis)) < 0.95; - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, volume.GetModelview(), volume.GetProjection(), volume.GetViewport()); - - // temp hack - UpdateColours(); - - Vector3 x = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.x())); - bool show_x = manipulator_show_axis(m_pivot, x); - - Vector3 y = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.y())); - bool show_y = manipulator_show_axis(m_pivot, y); - - Vector3 z = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.z())); - bool show_z = manipulator_show_axis(m_pivot, z); - - renderer.SetState(m_state_wire, Renderer::eWireframeOnly); - renderer.SetState(m_state_wire, Renderer::eFullMaterials); - - if(show_x) - { - renderer.addRenderable(m_arrow_x, m_pivot.m_worldSpace); - } - if(show_y) - { - renderer.addRenderable(m_arrow_y, m_pivot.m_worldSpace); - } - if(show_z) - { - renderer.addRenderable(m_arrow_z, m_pivot.m_worldSpace); - } - - renderer.addRenderable(m_quad_screen, m_pivot.m_viewplaneSpace); - - renderer.SetState(m_state_fill, Renderer::eWireframeOnly); - renderer.SetState(m_state_fill, Renderer::eFullMaterials); - - if(show_x) - { - renderer.addRenderable(m_arrow_head_x, m_pivot.m_worldSpace); - } - if(show_y) - { - renderer.addRenderable(m_arrow_head_y, m_pivot.m_worldSpace); - } - if(show_z) - { - renderer.addRenderable(m_arrow_head_z, m_pivot.m_worldSpace); - } - } - void testSelect(const View& view, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, view.GetModelview(), view.GetProjection(), view.GetViewport()); - - SelectionPool selector; - - Vector3 x = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.x())); - bool show_x = manipulator_show_axis(m_pivot, x); - - Vector3 y = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.y())); - bool show_y = manipulator_show_axis(m_pivot, y); - - Vector3 z = vector3_normalised(vector4_to_vector3(m_pivot.m_worldSpace.z())); - bool show_z = manipulator_show_axis(m_pivot, z); - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_pivot.m_viewpointSpace)); - - { - SelectionIntersection best; - Quad_BestPoint(local2view, eClipCullCW, m_quad_screen.m_quad, best); - if(best.valid()) - { - best = SelectionIntersection(0, 0); - selector.addSelectable(best, &m_selectable_screen); - } - } - } - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_pivot.m_worldSpace)); - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(view.GetViewMatrix()); -#endif - - if(show_x) - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_x.m_line, best); - Triangles_BestPoint(local2view, eClipCullCW, m_arrow_head_x.m_vertices.begin(), m_arrow_head_x.m_vertices.end(), best); - selector.addSelectable(best, &m_selectable_x); - } - - if(show_y) - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_y.m_line, best); - Triangles_BestPoint(local2view, eClipCullCW, m_arrow_head_y.m_vertices.begin(), m_arrow_head_y.m_vertices.end(), best); - selector.addSelectable(best, &m_selectable_y); - } - - if(show_z) - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_z.m_line, best); - Triangles_BestPoint(local2view, eClipCullCW, m_arrow_head_z.m_vertices.begin(), m_arrow_head_z.m_vertices.end(), best); - selector.addSelectable(best, &m_selectable_z); - } - } - - if(!selector.failed()) - { - (*selector.begin()).second->setSelected(true); - } - } - - Manipulatable* GetManipulatable() - { - if(m_selectable_x.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_x); - return &m_axis; - } - else if(m_selectable_y.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_y); - return &m_axis; - } - else if(m_selectable_z.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_z); - return &m_axis; - } - else - { - return &m_free; - } - } - - void setSelected(bool select) - { - m_selectable_x.setSelected(select); - m_selectable_y.setSelected(select); - m_selectable_z.setSelected(select); - m_selectable_screen.setSelected(select); - } - bool isSelected() const - { - return m_selectable_x.isSelected() - | m_selectable_y.isSelected() - | m_selectable_z.isSelected() - | m_selectable_screen.isSelected(); - } -}; - -Shader* TranslateManipulator::m_state_wire; -Shader* TranslateManipulator::m_state_fill; - -class ScaleManipulator : public Manipulator -{ - struct RenderableArrow : public OpenGLRenderable - { - PointVertex m_line[2]; - - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_line[0].colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_line[0].vertex); - glDrawArrays(GL_LINES, 0, 2); - } - void setColour(const Colour4b& colour) - { - m_line[0].colour = colour; - m_line[1].colour = colour; - } - }; - struct RenderableQuad : public OpenGLRenderable - { - PointVertex m_quad[4]; - void render(RenderStateFlags state) const - { - glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_quad[0].colour); - glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_quad[0].vertex); - glDrawArrays(GL_QUADS, 0, 4); - } - void setColour(const Colour4b& colour) - { - m_quad[0].colour = colour; - m_quad[1].colour = colour; - m_quad[2].colour = colour; - m_quad[3].colour = colour; - } - }; - - ScaleFree m_free; - ScaleAxis m_axis; - RenderableArrow m_arrow_x; - RenderableArrow m_arrow_y; - RenderableArrow m_arrow_z; - RenderableQuad m_quad_screen; - SelectableBool m_selectable_x; - SelectableBool m_selectable_y; - SelectableBool m_selectable_z; - SelectableBool m_selectable_screen; - Pivot2World m_pivot; -public: - ScaleManipulator(Scalable& scalable, std::size_t segments, float length) : - m_free(scalable), - m_axis(scalable) - { - draw_arrowline(length, m_arrow_x.m_line, 0); - draw_arrowline(length, m_arrow_y.m_line, 1); - draw_arrowline(length, m_arrow_z.m_line, 2); - - draw_quad(16, m_quad_screen.m_quad); - } - - Pivot2World& getPivot() - { - return m_pivot; - } - - void UpdateColours() - { - m_arrow_x.setColour(colourSelected(g_colour_x, m_selectable_x.isSelected())); - m_arrow_y.setColour(colourSelected(g_colour_y, m_selectable_y.isSelected())); - m_arrow_z.setColour(colourSelected(g_colour_z, m_selectable_z.isSelected())); - m_quad_screen.setColour(colourSelected(g_colour_screen, m_selectable_screen.isSelected())); - } - - void render(Renderer& renderer, const VolumeTest& volume, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, volume.GetModelview(), volume.GetProjection(), volume.GetViewport()); - - // temp hack - UpdateColours(); - - renderer.addRenderable(m_arrow_x, m_pivot.m_worldSpace); - renderer.addRenderable(m_arrow_y, m_pivot.m_worldSpace); - renderer.addRenderable(m_arrow_z, m_pivot.m_worldSpace); - - renderer.addRenderable(m_quad_screen, m_pivot.m_viewpointSpace); - } - void testSelect(const View& view, const Matrix4& pivot2world) - { - m_pivot.update(pivot2world, view.GetModelview(), view.GetProjection(), view.GetViewport()); - - SelectionPool selector; - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_pivot.m_worldSpace)); - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(view.GetViewMatrix()); -#endif - - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_x.m_line, best); - selector.addSelectable(best, &m_selectable_x); - } - - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_y.m_line, best); - selector.addSelectable(best, &m_selectable_y); - } - - { - SelectionIntersection best; - Line_BestPoint(local2view, m_arrow_z.m_line, best); - selector.addSelectable(best, &m_selectable_z); - } - } - - { - Matrix4 local2view(matrix4_multiplied_by_matrix4(view.GetViewMatrix(), m_pivot.m_viewpointSpace)); - - { - SelectionIntersection best; - Quad_BestPoint(local2view, eClipCullCW, m_quad_screen.m_quad, best); - selector.addSelectable(best, &m_selectable_screen); - } - } - - if(!selector.failed()) - { - (*selector.begin()).second->setSelected(true); - } - } - - Manipulatable* GetManipulatable() - { - if(m_selectable_x.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_x); - return &m_axis; - } - else if(m_selectable_y.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_y); - return &m_axis; - } - else if(m_selectable_z.isSelected()) - { - m_axis.SetAxis(g_vector3_axis_z); - return &m_axis; - } - else - return &m_free; - } - - void setSelected(bool select) - { - m_selectable_x.setSelected(select); - m_selectable_y.setSelected(select); - m_selectable_z.setSelected(select); - m_selectable_screen.setSelected(select); - } - bool isSelected() const - { - return m_selectable_x.isSelected() - | m_selectable_y.isSelected() - | m_selectable_z.isSelected() - | m_selectable_screen.isSelected(); - } -}; - - -inline PlaneSelectable* Instance_getPlaneSelectable(scene::Instance& instance) -{ - return InstanceTypeCast::cast(instance); -} - -class PlaneSelectableSelectPlanes : public scene::Graph::Walker -{ - Selector& m_selector; - SelectionTest& m_test; - PlaneCallback m_selectedPlaneCallback; -public: - PlaneSelectableSelectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) - : m_selector(selector), m_test(test), m_selectedPlaneCallback(selectedPlaneCallback) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 && selectable->isSelected()) - { - PlaneSelectable* planeSelectable = Instance_getPlaneSelectable(instance); - if(planeSelectable != 0) - { - planeSelectable->selectPlanes(m_selector, m_test, m_selectedPlaneCallback); - } - } - } - return true; - } -}; - -class PlaneSelectableSelectReversedPlanes : public scene::Graph::Walker -{ - Selector& m_selector; - const SelectedPlanes& m_selectedPlanes; -public: - PlaneSelectableSelectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) - : m_selector(selector), m_selectedPlanes(selectedPlanes) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 && selectable->isSelected()) - { - PlaneSelectable* planeSelectable = Instance_getPlaneSelectable(instance); - if(planeSelectable != 0) - { - planeSelectable->selectReversedPlanes(m_selector, m_selectedPlanes); - } - } - } - return true; - } -}; - -void Scene_forEachPlaneSelectable_selectPlanes(scene::Graph& graph, Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) -{ - graph.traverse(PlaneSelectableSelectPlanes(selector, test, selectedPlaneCallback)); -} - -void Scene_forEachPlaneSelectable_selectReversedPlanes(scene::Graph& graph, Selector& selector, const SelectedPlanes& selectedPlanes) -{ - graph.traverse(PlaneSelectableSelectReversedPlanes(selector, selectedPlanes)); -} - - -class PlaneLess -{ -public: - bool operator()(const Plane3& plane, const Plane3& other) const - { - if(plane.a < other.a) - { - return true; - } - if(other.a < plane.a) - { - return false; - } - - if(plane.b < other.b) - { - return true; - } - if(other.b < plane.b) - { - return false; - } - - if(plane.c < other.c) - { - return true; - } - if(other.c < plane.c) - { - return false; - } - - if(plane.d < other.d) - { - return true; - } - if(other.d < plane.d) - { - return false; - } - - return false; - } -}; - -typedef std::set PlaneSet; - -inline void PlaneSet_insert(PlaneSet& self, const Plane3& plane) -{ - self.insert(plane); -} - -inline bool PlaneSet_contains(const PlaneSet& self, const Plane3& plane) -{ - return self.find(plane) != self.end(); -} - - -class SelectedPlaneSet : public SelectedPlanes -{ - PlaneSet m_selectedPlanes; -public: - bool empty() const - { - return m_selectedPlanes.empty(); - } - - void insert(const Plane3& plane) - { - PlaneSet_insert(m_selectedPlanes, plane); - } - bool contains(const Plane3& plane) const - { - return PlaneSet_contains(m_selectedPlanes, plane); - } - typedef MemberCaller1 InsertCaller; -}; - - -bool Scene_forEachPlaneSelectable_selectPlanes(scene::Graph& graph, Selector& selector, SelectionTest& test) -{ - SelectedPlaneSet selectedPlanes; - - Scene_forEachPlaneSelectable_selectPlanes(graph, selector, test, SelectedPlaneSet::InsertCaller(selectedPlanes)); - Scene_forEachPlaneSelectable_selectReversedPlanes(graph, selector, selectedPlanes); - - return !selectedPlanes.empty(); -} - -void Scene_Translate_Component_Selected(scene::Graph& graph, const Vector3& translation); -void Scene_Translate_Selected(scene::Graph& graph, const Vector3& translation); -void Scene_TestSelect_Primitive(Selector& selector, SelectionTest& test, const VolumeTest& volume); -void Scene_TestSelect_Component(Selector& selector, SelectionTest& test, const VolumeTest& volume, SelectionSystem::EComponentMode componentMode); -void Scene_TestSelect_Component_Selected(Selector& selector, SelectionTest& test, const VolumeTest& volume, SelectionSystem::EComponentMode componentMode); -void Scene_SelectAll_Component(bool select, SelectionSystem::EComponentMode componentMode); - -class ResizeTranslatable : public Translatable -{ - void translate(const Vector3& translation) - { - Scene_Translate_Component_Selected(GlobalSceneGraph(), translation); - } -}; - -class DragTranslatable : public Translatable -{ - void translate(const Vector3& translation) - { - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) - { - Scene_Translate_Component_Selected(GlobalSceneGraph(), translation); - } - else - { - Scene_Translate_Selected(GlobalSceneGraph(), translation); - } - } -}; - -class SelectionVolume : public SelectionTest -{ - Matrix4 m_local2view; - const View& m_view; - clipcull_t m_cull; - Vector3 m_near; - Vector3 m_far; -public: - SelectionVolume(const View& view) - : m_view(view) - { - } - - const VolumeTest& getVolume() const - { - return m_view; - } - - const Vector3& getNear() const - { - return m_near; - } - const Vector3& getFar() const - { - return m_far; - } - - void BeginMesh(const Matrix4& localToWorld, bool twoSided) - { - m_local2view = matrix4_multiplied_by_matrix4(m_view.GetViewMatrix(), localToWorld); - - // Cull back-facing polygons based on winding being clockwise or counter-clockwise. - // Don't cull if the view is wireframe and the polygons are two-sided. - m_cull = twoSided && !m_view.fill() ? eClipCullNone : (matrix4_handedness(localToWorld) == MATRIX4_RIGHTHANDED) ? eClipCullCW : eClipCullCCW; - - { - Matrix4 screen2world(matrix4_full_inverse(m_local2view)); - - m_near = vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(0, 0, -1, 1) - ) - ); - - m_far = vector4_projected( - matrix4_transformed_vector4( - screen2world, - Vector4(0, 0, 1, 1) - ) - ); - } - -#if defined(DEBUG_SELECTION) - g_render_clipped.construct(m_view.GetViewMatrix()); -#endif - } - void TestPoint(const Vector3& point, SelectionIntersection& best) - { - Vector4 clipped; - if(matrix4_clip_point(m_local2view, point, clipped) == c_CLIP_PASS) - { - best = select_point_from_clipped(clipped); - } - } - void TestPolygon(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) - { - Vector4 clipped[9]; - for(std::size_t i=0; i+2(vertices[0]), - reinterpret_cast(vertices[i+1]), - reinterpret_cast(vertices[i+2]), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestLineLoop(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) - { - if(count == 0) - return; - Vector4 clipped[9]; - for(VertexPointer::iterator i = vertices.begin(), end = i + count, prev = i + (count-1); i != end; prev = i, ++i) - { - BestPoint( - matrix4_clip_line( - m_local2view, - reinterpret_cast((*prev)), - reinterpret_cast((*i)), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestLineStrip(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) - { - if(count == 0) - return; - Vector4 clipped[9]; - for(VertexPointer::iterator i = vertices.begin(), end = i + count, next = i + 1; next != end; i = next, ++next) - { - BestPoint( - matrix4_clip_line( - m_local2view, - reinterpret_cast((*i)), - reinterpret_cast((*next)), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestLines(const VertexPointer& vertices, std::size_t count, SelectionIntersection& best) - { - if(count == 0) - return; - Vector4 clipped[9]; - for(VertexPointer::iterator i = vertices.begin(), end = i + count; i != end; i += 2) - { - BestPoint( - matrix4_clip_line( - m_local2view, - reinterpret_cast((*i)), - reinterpret_cast((*(i+1))), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestTriangles(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) - { - Vector4 clipped[9]; - for(IndexPointer::iterator i(indices.begin()); i != indices.end(); i += 3) - { - BestPoint( - matrix4_clip_triangle( - m_local2view, - reinterpret_cast(vertices[*i]), - reinterpret_cast(vertices[*(i+1)]), - reinterpret_cast(vertices[*(i+2)]), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestQuads(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) - { - Vector4 clipped[9]; - for(IndexPointer::iterator i(indices.begin()); i != indices.end(); i += 4) - { - BestPoint( - matrix4_clip_triangle( - m_local2view, - reinterpret_cast(vertices[*i]), - reinterpret_cast(vertices[*(i+1)]), - reinterpret_cast(vertices[*(i+3)]), - clipped - ), - clipped, - best, - m_cull - ); - BestPoint( - matrix4_clip_triangle( - m_local2view, - reinterpret_cast(vertices[*(i+1)]), - reinterpret_cast(vertices[*(i+2)]), - reinterpret_cast(vertices[*(i+3)]), - clipped - ), - clipped, - best, - m_cull - ); - } - } - void TestQuadStrip(const VertexPointer& vertices, const IndexPointer& indices, SelectionIntersection& best) - { - Vector4 clipped[9]; - for(IndexPointer::iterator i(indices.begin()); i+2 != indices.end(); i += 2) - { - BestPoint( - matrix4_clip_triangle( - m_local2view, - reinterpret_cast(vertices[*i]), - reinterpret_cast(vertices[*(i+1)]), - reinterpret_cast(vertices[*(i+2)]), - clipped - ), - clipped, - best, - m_cull - ); - BestPoint( - matrix4_clip_triangle( - m_local2view, - reinterpret_cast(vertices[*(i+2)]), - reinterpret_cast(vertices[*(i+1)]), - reinterpret_cast(vertices[*(i+3)]), - clipped - ), - clipped, - best, - m_cull - ); - } - } -}; - -class SelectionCounter -{ -public: - typedef const Selectable& first_argument_type; - - SelectionCounter(const SelectionChangeCallback& onchanged) - : m_count(0), m_onchanged(onchanged) - { - } - void operator()(const Selectable& selectable) - { - if(selectable.isSelected()) - { - ++m_count; - } - else - { - ASSERT_MESSAGE(m_count != 0, "selection counter underflow"); - --m_count; - } - - m_onchanged(selectable); - } - bool empty() const - { - return m_count == 0; - } - std::size_t size() const - { - return m_count; - } -private: - std::size_t m_count; - SelectionChangeCallback m_onchanged; -}; - -inline void ConstructSelectionTest(View& view, const rect_t selection_box) -{ - view.EnableScissor(selection_box.min[0], selection_box.max[0], selection_box.min[1], selection_box.max[1]); -} - -inline const rect_t SelectionBoxForPoint(const float device_point[2], const float device_epsilon[2]) -{ - rect_t selection_box; - selection_box.min[0] = device_point[0] - device_epsilon[0]; - selection_box.min[1] = device_point[1] - device_epsilon[1]; - selection_box.max[0] = device_point[0] + device_epsilon[0]; - selection_box.max[1] = device_point[1] + device_epsilon[1]; - return selection_box; -} - -inline const rect_t SelectionBoxForArea(const float device_point[2], const float device_delta[2]) -{ - rect_t selection_box; - selection_box.min[0] = (device_delta[0] < 0) ? (device_point[0] + device_delta[0]) : (device_point[0]); - selection_box.min[1] = (device_delta[1] < 0) ? (device_point[1] + device_delta[1]) : (device_point[1]); - selection_box.max[0] = (device_delta[0] > 0) ? (device_point[0] + device_delta[0]) : (device_point[0]); - selection_box.max[1] = (device_delta[1] > 0) ? (device_point[1] + device_delta[1]) : (device_point[1]); - return selection_box; -} - -Quaternion construct_local_rotation(const Quaternion& world, const Quaternion& localToWorld) -{ - return quaternion_normalised(quaternion_multiplied_by_quaternion( - quaternion_normalised(quaternion_multiplied_by_quaternion( - quaternion_inverse(localToWorld), - world - )), - localToWorld - )); -} - -inline void matrix4_assign_rotation(Matrix4& matrix, const Matrix4& other) -{ - matrix[0] = other[0]; - matrix[1] = other[1]; - matrix[2] = other[2]; - matrix[4] = other[4]; - matrix[5] = other[5]; - matrix[6] = other[6]; - matrix[8] = other[8]; - matrix[9] = other[9]; - matrix[10] = other[10]; -} - -void matrix4_assign_rotation_for_pivot(Matrix4& matrix, scene::Instance& instance) -{ - Editable* editable = Node_getEditable(instance.path().top()); - if(editable != 0) - { - matrix4_assign_rotation(matrix, matrix4_multiplied_by_matrix4(instance.localToWorld(), editable->getLocalPivot())); - } - else - { - matrix4_assign_rotation(matrix, instance.localToWorld()); - } -} - -inline bool Instance_isSelectedComponents(scene::Instance& instance) -{ - ComponentSelectionTestable* componentSelectionTestable = Instance_getComponentSelectionTestable(instance); - return componentSelectionTestable != 0 - && componentSelectionTestable->isSelectedComponents(); -} - -class TranslateSelected : public SelectionSystem::Visitor -{ - const Vector3& m_translate; -public: - TranslateSelected(const Vector3& translate) - : m_translate(translate) - { - } - void visit(scene::Instance& instance) const - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->setType(TRANSFORM_PRIMITIVE); - transform->setTranslation(m_translate); - } - } -}; - -void Scene_Translate_Selected(scene::Graph& graph, const Vector3& translation) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - GlobalSelectionSystem().foreachSelected(TranslateSelected(translation)); - } -} - -Vector3 get_local_pivot(const Vector3& world_pivot, const Matrix4& localToWorld) -{ - return Vector3( - matrix4_transformed_point( - matrix4_full_inverse(localToWorld), - world_pivot - ) - ); -} - -void translation_for_pivoted_rotation(Vector3& parent_translation, const Quaternion& local_rotation, const Vector3& world_pivot, const Matrix4& localToWorld, const Matrix4& localToParent) -{ - Vector3 local_pivot(get_local_pivot(world_pivot, localToWorld)); - - Vector3 translation( - vector3_added( - local_pivot, - matrix4_transformed_point( - matrix4_rotation_for_quaternion_quantised(local_rotation), - vector3_negated(local_pivot) - ) - ) - ); - - //globalOutputStream() << "translation: " << translation << "\n"; - - translation_local2object(parent_translation, translation, localToParent); - - //globalOutputStream() << "parent_translation: " << parent_translation << "\n"; -} - -void translation_for_pivoted_scale(Vector3& parent_translation, const Vector3& local_scale, const Vector3& world_pivot, const Matrix4& localToWorld, const Matrix4& localToParent) -{ - Vector3 local_pivot(get_local_pivot(world_pivot, localToWorld)); - - Vector3 translation( - vector3_added( - local_pivot, - vector3_scaled( - vector3_negated(local_pivot), - local_scale - ) - ) - ); - - translation_local2object(parent_translation, translation, localToParent); -} - -class rotate_selected : public SelectionSystem::Visitor -{ - const Quaternion& m_rotate; - const Vector3& m_world_pivot; -public: - rotate_selected(const Quaternion& rotation, const Vector3& world_pivot) - : m_rotate(rotation), m_world_pivot(world_pivot) - { - } - void visit(scene::Instance& instance) const - { - TransformNode* transformNode = Node_getTransformNode(instance.path().top()); - if(transformNode != 0) - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->setType(TRANSFORM_PRIMITIVE); - transform->setScale(c_scale_identity); - transform->setTranslation(c_translation_identity); - - transform->setType(TRANSFORM_PRIMITIVE); - transform->setRotation(m_rotate); - - { - Editable* editable = Node_getEditable(instance.path().top()); - const Matrix4& localPivot = editable != 0 ? editable->getLocalPivot() : g_matrix4_identity; - - Vector3 parent_translation; - translation_for_pivoted_rotation( - parent_translation, - m_rotate, - m_world_pivot, - matrix4_multiplied_by_matrix4(instance.localToWorld(), localPivot), - matrix4_multiplied_by_matrix4(transformNode->localToParent(), localPivot) - ); - - transform->setTranslation(parent_translation); - } - } - } - } -}; - -void Scene_Rotate_Selected(scene::Graph& graph, const Quaternion& rotation, const Vector3& world_pivot) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - GlobalSelectionSystem().foreachSelected(rotate_selected(rotation, world_pivot)); - } -} - -class scale_selected : public SelectionSystem::Visitor -{ - const Vector3& m_scale; - const Vector3& m_world_pivot; -public: - scale_selected(const Vector3& scaling, const Vector3& world_pivot) - : m_scale(scaling), m_world_pivot(world_pivot) - { - } - void visit(scene::Instance& instance) const - { - TransformNode* transformNode = Node_getTransformNode(instance.path().top()); - if(transformNode != 0) - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->setType(TRANSFORM_PRIMITIVE); - transform->setScale(c_scale_identity); - transform->setTranslation(c_translation_identity); - - transform->setType(TRANSFORM_PRIMITIVE); - transform->setScale(m_scale); - { - Editable* editable = Node_getEditable(instance.path().top()); - const Matrix4& localPivot = editable != 0 ? editable->getLocalPivot() : g_matrix4_identity; - - Vector3 parent_translation; - translation_for_pivoted_scale( - parent_translation, - m_scale, - m_world_pivot, - matrix4_multiplied_by_matrix4(instance.localToWorld(), localPivot), - matrix4_multiplied_by_matrix4(transformNode->localToParent(), localPivot) - ); - - transform->setTranslation(parent_translation); - } - } - } - } -}; - -void Scene_Scale_Selected(scene::Graph& graph, const Vector3& scaling, const Vector3& world_pivot) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - GlobalSelectionSystem().foreachSelected(scale_selected(scaling, world_pivot)); - } -} - - -class translate_component_selected : public SelectionSystem::Visitor -{ - const Vector3& m_translate; -public: - translate_component_selected(const Vector3& translate) - : m_translate(translate) - { - } - void visit(scene::Instance& instance) const - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->setType(TRANSFORM_COMPONENT); - transform->setTranslation(m_translate); - } - } -}; - -void Scene_Translate_Component_Selected(scene::Graph& graph, const Vector3& translation) -{ - if(GlobalSelectionSystem().countSelected() != 0) - { - GlobalSelectionSystem().foreachSelectedComponent(translate_component_selected(translation)); - } -} - -class rotate_component_selected : public SelectionSystem::Visitor -{ - const Quaternion& m_rotate; - const Vector3& m_world_pivot; -public: - rotate_component_selected(const Quaternion& rotation, const Vector3& world_pivot) - : m_rotate(rotation), m_world_pivot(world_pivot) - { - } - void visit(scene::Instance& instance) const - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - Vector3 parent_translation; - translation_for_pivoted_rotation(parent_translation, m_rotate, m_world_pivot, instance.localToWorld(), Node_getTransformNode(instance.path().top())->localToParent()); - - transform->setType(TRANSFORM_COMPONENT); - transform->setRotation(m_rotate); - transform->setTranslation(parent_translation); - } - } -}; - -void Scene_Rotate_Component_Selected(scene::Graph& graph, const Quaternion& rotation, const Vector3& world_pivot) -{ - if(GlobalSelectionSystem().countSelectedComponents() != 0) - { - GlobalSelectionSystem().foreachSelectedComponent(rotate_component_selected(rotation, world_pivot)); - } -} - -class scale_component_selected : public SelectionSystem::Visitor -{ - const Vector3& m_scale; - const Vector3& m_world_pivot; -public: - scale_component_selected(const Vector3& scaling, const Vector3& world_pivot) - : m_scale(scaling), m_world_pivot(world_pivot) - { - } - void visit(scene::Instance& instance) const - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - Vector3 parent_translation; - translation_for_pivoted_scale(parent_translation, m_scale, m_world_pivot, instance.localToWorld(), Node_getTransformNode(instance.path().top())->localToParent()); - - transform->setType(TRANSFORM_COMPONENT); - transform->setScale(m_scale); - transform->setTranslation(parent_translation); - } - } -}; - -void Scene_Scale_Component_Selected(scene::Graph& graph, const Vector3& scaling, const Vector3& world_pivot) -{ - if(GlobalSelectionSystem().countSelectedComponents() != 0) - { - GlobalSelectionSystem().foreachSelectedComponent(scale_component_selected(scaling, world_pivot)); - } -} - - -class BooleanSelector : public Selector -{ - bool m_selected; - SelectionIntersection m_intersection; - Selectable* m_selectable; -public: - BooleanSelector() : m_selected(false) - { - } - - void pushSelectable(Selectable& selectable) - { - m_intersection = SelectionIntersection(); - m_selectable = &selectable; - } - void popSelectable() - { - if(m_intersection.valid()) - { - m_selected = true; - } - m_intersection = SelectionIntersection(); - } - void addIntersection(const SelectionIntersection& intersection) - { - if(m_selectable->isSelected()) - { - assign_if_closer(m_intersection, intersection); - } - } - - bool isSelected() - { - return m_selected; - } -}; - -class BestSelector : public Selector -{ - SelectionIntersection m_intersection; - Selectable* m_selectable; - SelectionIntersection m_bestIntersection; - std::list m_bestSelectable; -public: - BestSelector() : m_bestIntersection(SelectionIntersection()), m_bestSelectable(0) - { - } - - void pushSelectable(Selectable& selectable) - { - m_intersection = SelectionIntersection(); - m_selectable = &selectable; - } - void popSelectable() - { - if(m_intersection.equalEpsilon(m_bestIntersection, 0.25f, 0.001f)) - { - m_bestSelectable.push_back(m_selectable); - m_bestIntersection = m_intersection; - } - else if(m_intersection < m_bestIntersection) - { - m_bestSelectable.clear(); - m_bestSelectable.push_back(m_selectable); - m_bestIntersection = m_intersection; - } - m_intersection = SelectionIntersection(); - } - void addIntersection(const SelectionIntersection& intersection) - { - assign_if_closer(m_intersection, intersection); - } - - std::list& best() - { - return m_bestSelectable; - } -}; - -class DragManipulator : public Manipulator -{ - TranslateFree m_freeResize; - TranslateFree m_freeDrag; - ResizeTranslatable m_resize; - DragTranslatable m_drag; - SelectableBool m_dragSelectable; -public: - - bool m_selected; - - DragManipulator() : m_freeResize(m_resize), m_freeDrag(m_drag), m_selected(false) - { - } - - Manipulatable* GetManipulatable() - { - return m_dragSelectable.isSelected() ? &m_freeDrag : &m_freeResize; - } - - void testSelect(const View& view, const Matrix4& pivot2world) - { - SelectionPool selector; - - SelectionVolume test(view); - - if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) - { - BooleanSelector booleanSelector; - - Scene_TestSelect_Primitive(booleanSelector, test, view); - - if(booleanSelector.isSelected()) - { - selector.addSelectable(SelectionIntersection(0, 0), &m_dragSelectable); - m_selected = false; - } - else - { - m_selected = Scene_forEachPlaneSelectable_selectPlanes(GlobalSceneGraph(), selector, test); - } - } - else - { - BestSelector bestSelector; - Scene_TestSelect_Component_Selected(bestSelector, test, view, GlobalSelectionSystem().ComponentMode()); - for(std::list::iterator i = bestSelector.best().begin(); i != bestSelector.best().end(); ++i) - { - if(!(*i)->isSelected()) - { - GlobalSelectionSystem().setSelectedAllComponents(false); - } - m_selected = false; - selector.addSelectable(SelectionIntersection(0, 0), (*i)); - m_dragSelectable.setSelected(true); - } - } - - for(SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i) - { - (*i).second->setSelected(true); - } - } - - void setSelected(bool select) - { - m_selected = select; - m_dragSelectable.setSelected(select); - } - bool isSelected() const - { - return m_selected || m_dragSelectable.isSelected(); - } -}; - -class ClipManipulator : public Manipulator -{ -public: - - Manipulatable* GetManipulatable() - { - ERROR_MESSAGE("clipper is not manipulatable"); - return 0; - } - - void setSelected(bool select) - { - } - bool isSelected() const - { - return false; - } -}; - -class select_all : public scene::Graph::Walker -{ - bool m_select; -public: - select_all(bool select) - : m_select(select) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0) - { - selectable->setSelected(m_select); - } - return true; - } -}; - -class select_all_component : public scene::Graph::Walker -{ - bool m_select; - SelectionSystem::EComponentMode m_mode; -public: - select_all_component(bool select, SelectionSystem::EComponentMode mode) - : m_select(select), m_mode(mode) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - ComponentSelectionTestable* componentSelectionTestable = Instance_getComponentSelectionTestable(instance); - if(componentSelectionTestable) - { - componentSelectionTestable->setSelectedComponents(m_select, m_mode); - } - return true; - } -}; - -void Scene_SelectAll_Component(bool select, SelectionSystem::EComponentMode componentMode) -{ - GlobalSceneGraph().traverse(select_all_component(select, componentMode)); -} - - -// RadiantSelectionSystem -class RadiantSelectionSystem : - public SelectionSystem, - public Translatable, - public Rotatable, - public Scalable, - public Renderable -{ - mutable Matrix4 m_pivot2world; - Matrix4 m_pivot2world_start; - Matrix4 m_manip2pivot_start; - Translation m_translation; - Rotation m_rotation; - Scale m_scale; -public: - static Shader* m_state; -private: - EManipulatorMode m_manipulator_mode; - Manipulator* m_manipulator; - - // state - bool m_undo_begun; - EMode m_mode; - EComponentMode m_componentmode; - - SelectionCounter m_count_primitive; - SelectionCounter m_count_component; - - TranslateManipulator m_translate_manipulator; - RotateManipulator m_rotate_manipulator; - ScaleManipulator m_scale_manipulator; - DragManipulator m_drag_manipulator; - ClipManipulator m_clip_manipulator; - - typedef SelectionList selection_t; - selection_t m_selection; - selection_t m_component_selection; - - Signal1 m_selectionChanged_callbacks; - - void ConstructPivot() const; - mutable bool m_pivotChanged; - bool m_pivot_moving; - - void Scene_TestSelect(Selector& selector, SelectionTest& test, const View& view, SelectionSystem::EMode mode, SelectionSystem::EComponentMode componentMode); - - bool nothingSelected() const - { - return (Mode() == eComponent && m_count_component.empty()) - || (Mode() == ePrimitive && m_count_primitive.empty()); - } - - -public: - enum EModifier - { - eManipulator, - eToggle, - eReplace, - eCycle, - }; - - RadiantSelectionSystem() : - m_undo_begun(false), - m_mode(ePrimitive), - m_componentmode(eDefault), - m_count_primitive(SelectionChangedCaller(*this)), - m_count_component(SelectionChangedCaller(*this)), - m_translate_manipulator(*this, 2, 64), - m_rotate_manipulator(*this, 8, 64), - m_scale_manipulator(*this, 0, 64), - m_pivotChanged(false), - m_pivot_moving(false) - { - SetManipulatorMode(eTranslate); - pivotChanged(); - addSelectionChangeCallback(PivotChangedSelectionCaller(*this)); - AddGridChangeCallback(PivotChangedCaller(*this)); - } - void pivotChanged() const - { - m_pivotChanged = true; - SceneChangeNotify(); - } - typedef ConstMemberCaller PivotChangedCaller; - void pivotChangedSelection(const Selectable& selectable) - { - pivotChanged(); - } - typedef MemberCaller1 PivotChangedSelectionCaller; - - void SetMode(EMode mode) - { - if(m_mode != mode) - { - m_mode = mode; - pivotChanged(); - } - } - EMode Mode() const - { - return m_mode; - } - void SetComponentMode(EComponentMode mode) - { - m_componentmode = mode; - } - EComponentMode ComponentMode() const - { - return m_componentmode; - } - void SetManipulatorMode(EManipulatorMode mode) - { - m_manipulator_mode = mode; - switch(m_manipulator_mode) - { - case eTranslate: m_manipulator = &m_translate_manipulator; break; - case eRotate: m_manipulator = &m_rotate_manipulator; break; - case eScale: m_manipulator = &m_scale_manipulator; break; - case eDrag: m_manipulator = &m_drag_manipulator; break; - case eClip: m_manipulator = &m_clip_manipulator; break; - } - pivotChanged(); - } - EManipulatorMode ManipulatorMode() const - { - return m_manipulator_mode; - } - - SelectionChangeCallback getObserver(EMode mode) - { - if(mode == ePrimitive) - { - return makeCallback1(m_count_primitive); - } - else - { - return makeCallback1(m_count_component); - } - } - std::size_t countSelected() const - { - return m_count_primitive.size(); - } - std::size_t countSelectedComponents() const - { - return m_count_component.size(); - } - void onSelectedChanged(scene::Instance& instance, const Selectable& selectable) - { - if(selectable.isSelected()) - { - m_selection.append(instance); - } - else - { - m_selection.erase(instance); - } - - ASSERT_MESSAGE(m_selection.size() == m_count_primitive.size(), "selection-tracking error"); - } - void onComponentSelection(scene::Instance& instance, const Selectable& selectable) - { - if(selectable.isSelected()) - { - m_component_selection.append(instance); - } - else - { - m_component_selection.erase(instance); - } - - ASSERT_MESSAGE(m_component_selection.size() == m_count_component.size(), "selection-tracking error"); - } - scene::Instance& ultimateSelected() const - { - ASSERT_MESSAGE(m_selection.size() > 0, "no instance selected"); - return m_selection.back(); - } - scene::Instance& penultimateSelected() const - { - ASSERT_MESSAGE(m_selection.size() > 1, "only one instance selected"); - return *(*(--(--m_selection.end()))); - } - void setSelectedAll(bool selected) - { - GlobalSceneGraph().traverse(select_all(selected)); - - m_manipulator->setSelected(selected); - } - void setSelectedAllComponents(bool selected) - { - Scene_SelectAll_Component(selected, SelectionSystem::eVertex); - Scene_SelectAll_Component(selected, SelectionSystem::eEdge); - Scene_SelectAll_Component(selected, SelectionSystem::eFace); - - m_manipulator->setSelected(selected); - } - - void foreachSelected(const Visitor& visitor) const - { - selection_t::const_iterator i = m_selection.begin(); - while(i != m_selection.end()) - { - visitor.visit(*(*(i++))); - } - } - void foreachSelectedComponent(const Visitor& visitor) const - { - selection_t::const_iterator i = m_component_selection.begin(); - while(i != m_component_selection.end()) - { - visitor.visit(*(*(i++))); - } - } - - void addSelectionChangeCallback(const SelectionChangeHandler& handler) - { - m_selectionChanged_callbacks.connectLast(handler); - } - void selectionChanged(const Selectable& selectable) - { - m_selectionChanged_callbacks(selectable); - } - typedef MemberCaller1 SelectionChangedCaller; - - - void startMove() - { - m_pivot2world_start = GetPivot2World(); - } - - bool SelectManipulator(const View& view, const float device_point[2], const float device_epsilon[2]) - { - if(!nothingSelected() || (ManipulatorMode() == eDrag && Mode() == eComponent)) - { -#if defined (DEBUG_SELECTION) - g_render_clipped.destroy(); -#endif - - m_manipulator->setSelected(false); - - if(!nothingSelected() || (ManipulatorMode() == eDrag && Mode() == eComponent)) - { - View scissored(view); - ConstructSelectionTest(scissored, SelectionBoxForPoint(device_point, device_epsilon)); - m_manipulator->testSelect(scissored, GetPivot2World()); - } - - startMove(); - - m_pivot_moving = m_manipulator->isSelected(); - - if(m_pivot_moving) - { - Pivot2World pivot; - pivot.update(GetPivot2World(), view.GetModelview(), view.GetProjection(), view.GetViewport()); - - m_manip2pivot_start = matrix4_multiplied_by_matrix4(matrix4_full_inverse(m_pivot2world_start), pivot.m_worldSpace); - - Matrix4 device2manip; - ConstructDevice2Manip(device2manip, m_pivot2world_start, view.GetModelview(), view.GetProjection(), view.GetViewport()); - m_manipulator->GetManipulatable()->Construct(device2manip, device_point[0], device_point[1]); - - m_undo_begun = false; - } - - SceneChangeNotify(); - } - - return m_pivot_moving; - } - - void deselectAll() - { - if(Mode() == eComponent) - { - setSelectedAllComponents(false); - } - else - { - setSelectedAll(false); - } - } - - void SelectPoint(const View& view, const float device_point[2], const float device_epsilon[2], RadiantSelectionSystem::EModifier modifier, bool face) - { - ASSERT_MESSAGE(fabs(device_point[0]) <= 1.0f && fabs(device_point[1]) <= 1.0f, "point-selection error"); - if(modifier == eReplace) - { - if(face) - { - setSelectedAllComponents(false); - } - else - { - deselectAll(); - } - } - - #if defined (DEBUG_SELECTION) - g_render_clipped.destroy(); - #endif - - { - View scissored(view); - ConstructSelectionTest(scissored, SelectionBoxForPoint(device_point, device_epsilon)); - - SelectionVolume volume(scissored); - SelectionPool selector; - if(face) - { - Scene_TestSelect_Component(selector, volume, scissored, eFace); - } - else - { - Scene_TestSelect(selector, volume, scissored, Mode(), ComponentMode()); - } - - if(!selector.failed()) - { - switch(modifier) - { - case RadiantSelectionSystem::eToggle: - { - SelectableSortedSet::iterator best = selector.begin(); - // toggle selection of the object with least depth - if((*best).second->isSelected()) - (*best).second->setSelected(false); - else - (*best).second->setSelected(true); - } - break; - // if cycle mode not enabled, enable it - case RadiantSelectionSystem::eReplace: - { - // select closest - (*selector.begin()).second->setSelected(true); - } - break; - // select the next object in the list from the one already selected - case RadiantSelectionSystem::eCycle: - { - SelectionPool::iterator i = selector.begin(); - while(i != selector.end()) - { - if((*i).second->isSelected()) - { - (*i).second->setSelected(false); - ++i; - if(i != selector.end()) - { - i->second->setSelected(true); - } - else - { - selector.begin()->second->setSelected(true); - } - break; - } - ++i; - } - } - break; - default: - break; - } - } - } - } - - void SelectArea(const View& view, const float device_point[2], const float device_delta[2], RadiantSelectionSystem::EModifier modifier, bool face) - { - if(modifier == eReplace) - { - if(face) - { - setSelectedAllComponents(false); - } - else - { - deselectAll(); - } - } - - #if defined (DEBUG_SELECTION) - g_render_clipped.destroy(); - #endif - - { - View scissored(view); - ConstructSelectionTest(scissored, SelectionBoxForArea(device_point, device_delta)); - - SelectionVolume volume(scissored); - SelectionPool pool; - if(face) - { - Scene_TestSelect_Component(pool, volume, scissored, eFace); - } - else - { - Scene_TestSelect(pool, volume, scissored, Mode(), ComponentMode()); - } - - for(SelectionPool::iterator i = pool.begin(); i != pool.end(); ++i) - { - (*i).second->setSelected(!(modifier == RadiantSelectionSystem::eToggle && (*i).second->isSelected())); - } - } - } - - - void translate(const Vector3& translation) - { - if(!nothingSelected()) - { - //ASSERT_MESSAGE(!m_pivotChanged, "pivot is invalid"); - - m_translation = translation; - - m_pivot2world = m_pivot2world_start; - matrix4_translate_by_vec3(m_pivot2world, translation); - - if(Mode() == eComponent) - { - Scene_Translate_Component_Selected(GlobalSceneGraph(), m_translation); - } - else - { - Scene_Translate_Selected(GlobalSceneGraph(), m_translation); - } - - SceneChangeNotify(); - } - } - void outputTranslation(TextOutputStream& ostream) - { - ostream << " -xyz " << m_translation.x() << " " << m_translation.y() << " " << m_translation.z(); - } - void rotate(const Quaternion& rotation) - { - if(!nothingSelected()) - { - //ASSERT_MESSAGE(!m_pivotChanged, "pivot is invalid"); - - m_rotation = rotation; - - if(Mode() == eComponent) - { - Scene_Rotate_Component_Selected(GlobalSceneGraph(), m_rotation, vector4_to_vector3(m_pivot2world.t())); - - matrix4_assign_rotation_for_pivot(m_pivot2world, m_component_selection.back()); - } - else - { - Scene_Rotate_Selected(GlobalSceneGraph(), m_rotation, vector4_to_vector3(m_pivot2world.t())); - - matrix4_assign_rotation_for_pivot(m_pivot2world, m_selection.back()); - } - - SceneChangeNotify(); - } - } - void outputRotation(TextOutputStream& ostream) - { - ostream << " -eulerXYZ " << m_rotation.x() << " " << m_rotation.y() << " " << m_rotation.z(); - } - void scale(const Vector3& scaling) - { - if(!nothingSelected()) - { - m_scale = scaling; - - if(Mode() == eComponent) - { - Scene_Scale_Component_Selected(GlobalSceneGraph(), m_scale, vector4_to_vector3(m_pivot2world.t())); - } - else - { - Scene_Scale_Selected(GlobalSceneGraph(), m_scale, vector4_to_vector3(m_pivot2world.t())); - } - - SceneChangeNotify(); - } - } - void outputScale(TextOutputStream& ostream) - { - ostream << " -scale " << m_scale.x() << " " << m_scale.y() << " " << m_scale.z(); - } - - void rotateSelected(const Quaternion& rotation) - { - startMove(); - rotate(rotation); - freezeTransforms(); - } - void translateSelected(const Vector3& translation) - { - startMove(); - translate(translation); - freezeTransforms(); - } - void scaleSelected(const Vector3& scaling) - { - startMove(); - scale(scaling); - freezeTransforms(); - } - - void MoveSelected(const View& view, const float device_point[2]) - { - if(m_manipulator->isSelected()) - { - if(!m_undo_begun) - { - m_undo_begun = true; - GlobalUndoSystem().start(); - } - - Matrix4 device2manip; - ConstructDevice2Manip(device2manip, m_pivot2world_start, view.GetModelview(), view.GetProjection(), view.GetViewport()); - m_manipulator->GetManipulatable()->Transform(m_manip2pivot_start, device2manip, device_point[0], device_point[1]); - } - } - - /// \todo Support view-dependent nudge. - void NudgeManipulator(const Vector3& nudge, const Vector3& view) - { - if(ManipulatorMode() == eTranslate || ManipulatorMode() == eDrag) - { - translateSelected(nudge); - } - } - - void endMove(); - void freezeTransforms(); - - void renderSolid(Renderer& renderer, const VolumeTest& volume) const; - void renderWireframe(Renderer& renderer, const VolumeTest& volume) const - { - renderSolid(renderer, volume); - } - - const Matrix4& GetPivot2World() const - { - ConstructPivot(); - return m_pivot2world; - } - - static void constructStatic() - { - m_state = GlobalShaderCache().capture("$POINT"); - #if defined(DEBUG_SELECTION) - g_state_clipped = GlobalShaderCache().capture("$DEBUG_CLIPPED"); - #endif - TranslateManipulator::m_state_wire = GlobalShaderCache().capture("$WIRE_OVERLAY"); - TranslateManipulator::m_state_fill = GlobalShaderCache().capture("$FLATSHADE_OVERLAY"); - RotateManipulator::m_state_outer = GlobalShaderCache().capture("$WIRE_OVERLAY"); - } - - static void destroyStatic() - { - #if defined(DEBUG_SELECTION) - GlobalShaderCache().release("$DEBUG_CLIPPED"); - #endif - GlobalShaderCache().release("$WIRE_OVERLAY"); - GlobalShaderCache().release("$FLATSHADE_OVERLAY"); - GlobalShaderCache().release("$WIRE_OVERLAY"); - GlobalShaderCache().release("$POINT"); - } -}; - -Shader* RadiantSelectionSystem::m_state = 0; - - -namespace -{ - RadiantSelectionSystem* g_RadiantSelectionSystem; - - inline RadiantSelectionSystem& getSelectionSystem() - { - return *g_RadiantSelectionSystem; - } -} - - - -class testselect_entity_visible : public scene::Graph::Walker -{ - Selector& m_selector; - SelectionTest& m_test; -public: - testselect_entity_visible(Selector& selector, SelectionTest& test) - : m_selector(selector), m_test(test) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && Node_isEntity(path.top())) - { - m_selector.pushSelectable(*selectable); - } - - SelectionTestable* selectionTestable = Instance_getSelectionTestable(instance); - if(selectionTestable) - { - selectionTestable->testSelect(m_selector, m_test); - } - - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && Node_isEntity(path.top())) - { - m_selector.popSelectable(); - } - } -}; - -class testselect_primitive_visible : public scene::Graph::Walker -{ - Selector& m_selector; - SelectionTest& m_test; -public: - testselect_primitive_visible(Selector& selector, SelectionTest& test) - : m_selector(selector), m_test(test) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0) - { - m_selector.pushSelectable(*selectable); - } - - SelectionTestable* selectionTestable = Instance_getSelectionTestable(instance); - if(selectionTestable) - { - selectionTestable->testSelect(m_selector, m_test); - } - - return true; - } - void post(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0) - { - m_selector.popSelectable(); - } - } -}; - -class testselect_component_visible : public scene::Graph::Walker -{ - Selector& m_selector; - SelectionTest& m_test; - SelectionSystem::EComponentMode m_mode; -public: - testselect_component_visible(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - : m_selector(selector), m_test(test), m_mode(mode) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - ComponentSelectionTestable* componentSelectionTestable = Instance_getComponentSelectionTestable(instance); - if(componentSelectionTestable) - { - componentSelectionTestable->testSelectComponents(m_selector, m_test, m_mode); - } - - return true; - } -}; - - -class testselect_component_visible_selected : public scene::Graph::Walker -{ - Selector& m_selector; - SelectionTest& m_test; - SelectionSystem::EComponentMode m_mode; -public: - testselect_component_visible_selected(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) - : m_selector(selector), m_test(test), m_mode(mode) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 && selectable->isSelected()) - { - ComponentSelectionTestable* componentSelectionTestable = Instance_getComponentSelectionTestable(instance); - if(componentSelectionTestable) - { - componentSelectionTestable->testSelectComponents(m_selector, m_test, m_mode); - } - } - - return true; - } -}; - -void Scene_TestSelect_Primitive(Selector& selector, SelectionTest& test, const VolumeTest& volume) -{ - Scene_forEachVisible(GlobalSceneGraph(), volume, testselect_primitive_visible(selector, test)); -} - -void Scene_TestSelect_Component_Selected(Selector& selector, SelectionTest& test, const VolumeTest& volume, SelectionSystem::EComponentMode componentMode) -{ - Scene_forEachVisible(GlobalSceneGraph(), volume, testselect_component_visible_selected(selector, test, componentMode)); -} - -void Scene_TestSelect_Component(Selector& selector, SelectionTest& test, const VolumeTest& volume, SelectionSystem::EComponentMode componentMode) -{ - Scene_forEachVisible(GlobalSceneGraph(), volume, testselect_component_visible(selector, test, componentMode)); -} - -void RadiantSelectionSystem::Scene_TestSelect(Selector& selector, SelectionTest& test, const View& view, SelectionSystem::EMode mode, SelectionSystem::EComponentMode componentMode) -{ - switch(mode) - { - case eEntity: - { - Scene_forEachVisible(GlobalSceneGraph(), view, testselect_entity_visible(selector, test)); - } - break; - case ePrimitive: - Scene_TestSelect_Primitive(selector, test, view); - break; - case eComponent: - Scene_TestSelect_Component_Selected(selector, test, view, componentMode); - break; - } -} - -class FreezeTransforms : public scene::Graph::Walker -{ -public: - bool pre(const scene::Path& path, scene::Instance& instance) const - { - TransformNode* transformNode = Node_getTransformNode(path.top()); - if(transformNode != 0) - { - Transformable* transform = Instance_getTransformable(instance); - if(transform != 0) - { - transform->freezeTransform(); - } - } - return true; - } -}; - -void RadiantSelectionSystem::freezeTransforms() -{ - GlobalSceneGraph().traverse(FreezeTransforms()); -} - - -void RadiantSelectionSystem::endMove() -{ - freezeTransforms(); - - if(Mode() == ePrimitive) - { - if(ManipulatorMode() == eDrag) - { - Scene_SelectAll_Component(false, SelectionSystem::eFace); - } - } - - m_pivot_moving = false; - pivotChanged(); - - SceneChangeNotify(); - - if(m_undo_begun) - { - StringOutputStream command; - - if(ManipulatorMode() == eTranslate) - { - command << "translateTool"; - outputTranslation(command); - } - else if(ManipulatorMode() == eRotate) - { - command << "rotateTool"; - outputRotation(command); - } - else if(ManipulatorMode() == eScale) - { - command << "scaleTool"; - outputScale(command); - } - else if(ManipulatorMode() == eDrag) - { - command << "dragTool"; - } - - GlobalUndoSystem().finish(command.c_str()); - } - -} - -inline AABB Instance_getPivotBounds(scene::Instance& instance) -{ - Entity* entity = Node_getEntity(instance.path().top()); - if(entity != 0 - && (entity->getEntityClass().fixedsize - || !node_is_group(instance.path().top()))) - { - Editable* editable = Node_getEditable(instance.path().top()); - if(editable != 0) - { - return AABB(vector4_to_vector3(matrix4_multiplied_by_matrix4(instance.localToWorld(), editable->getLocalPivot()).t()), Vector3(0, 0, 0)); - } - else - { - return AABB(vector4_to_vector3(instance.localToWorld().t()), Vector3(0, 0, 0)); - } - } - - return instance.worldAABB(); -} - -class bounds_selected : public scene::Graph::Walker -{ - AABB& m_bounds; -public: - bounds_selected(AABB& bounds) - : m_bounds(bounds) - { - m_bounds = AABB(); - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) - { - aabb_extend_by_aabb_safe(m_bounds, Instance_getPivotBounds(instance)); - } - return true; - } -}; - -class bounds_selected_component : public scene::Graph::Walker -{ - AABB& m_bounds; -public: - bounds_selected_component(AABB& bounds) - : m_bounds(bounds) - { - m_bounds = AABB(); - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - Selectable* selectable = Instance_getSelectable(instance); - if(selectable != 0 - && selectable->isSelected()) - { - ComponentEditable* componentEditable = Instance_getComponentEditable(instance); - if(componentEditable) - { - aabb_extend_by_aabb_safe(m_bounds, aabb_for_oriented_aabb_safe(componentEditable->getSelectedComponentsBounds(), instance.localToWorld())); - } - } - return true; - } -}; - -void Scene_BoundsSelected(scene::Graph& graph, AABB& bounds) -{ - graph.traverse(bounds_selected(bounds)); -} - -void Scene_BoundsSelectedComponent(scene::Graph& graph, AABB& bounds) -{ - graph.traverse(bounds_selected_component(bounds)); -} - -#if 0 -inline void pivot_for_node(Matrix4& pivot, scene::Node& node, scene::Instance& instance) -{ - ComponentEditable* componentEditable = Instance_getComponentEditable(instance); - if(GlobalSelectionSystem().Mode() == SelectionSystem::eComponent - && componentEditable != 0) - { - pivot = matrix4_translation_for_vec3(componentEditable->getSelectedComponentsBounds().origin); - } - else - { - Bounded* bounded = Instance_getBounded(instance); - if(bounded != 0) - { - pivot = matrix4_translation_for_vec3(bounded->localAABB().origin); - } - else - { - pivot = g_matrix4_identity; - } - } -} -#endif - -void RadiantSelectionSystem::ConstructPivot() const -{ - if(!m_pivotChanged || m_pivot_moving) - return; - m_pivotChanged = false; - - Vector3 m_object_pivot; - - if(!nothingSelected()) - { - { - AABB bounds; - if(Mode() == eComponent) - { - Scene_BoundsSelectedComponent(GlobalSceneGraph(), bounds); - } - else - { - Scene_BoundsSelected(GlobalSceneGraph(), bounds); - } - m_object_pivot = bounds.origin; - } - - vector3_snap(m_object_pivot, GetGridSize()); - m_pivot2world = matrix4_translation_for_vec3(m_object_pivot); - - switch(m_manipulator_mode) - { - case eTranslate: - break; - case eRotate: - if(Mode() == eComponent) - { - matrix4_assign_rotation_for_pivot(m_pivot2world, m_component_selection.back()); - } - else - { - matrix4_assign_rotation_for_pivot(m_pivot2world, m_selection.back()); - } - break; - case eScale: - if(Mode() == eComponent) - { - matrix4_assign_rotation_for_pivot(m_pivot2world, m_component_selection.back()); - } - else - { - matrix4_assign_rotation_for_pivot(m_pivot2world, m_selection.back()); - } - break; - default: - break; - } - } -} - -void RadiantSelectionSystem::renderSolid(Renderer& renderer, const VolumeTest& volume) const -{ - //if(view->TestPoint(m_object_pivot)) - if(!nothingSelected()) - { - renderer.Highlight(Renderer::ePrimitive, false); - renderer.Highlight(Renderer::eFace, false); - - renderer.SetState(m_state, Renderer::eWireframeOnly); - renderer.SetState(m_state, Renderer::eFullMaterials); - - m_manipulator->render(renderer, volume, GetPivot2World()); - } - -#if defined(DEBUG_SELECTION) - renderer.SetState(g_state_clipped, Renderer::eWireframeOnly); - renderer.SetState(g_state_clipped, Renderer::eFullMaterials); - renderer.addRenderable(g_render_clipped, g_render_clipped.m_world); -#endif -} - - -void SelectionSystem_OnBoundsChanged() -{ - getSelectionSystem().pivotChanged(); -} - - -SignalHandlerId SelectionSystem_boundsChanged; - -void SelectionSystem_Construct() -{ - RadiantSelectionSystem::constructStatic(); - - g_RadiantSelectionSystem = new RadiantSelectionSystem; - - SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback(FreeCaller()); - - GlobalShaderCache().attachRenderable(getSelectionSystem()); -} - -void SelectionSystem_Destroy() -{ - GlobalShaderCache().detachRenderable(getSelectionSystem()); - - GlobalSceneGraph().removeBoundsChangedCallback(SelectionSystem_boundsChanged); - - delete g_RadiantSelectionSystem; - - RadiantSelectionSystem::destroyStatic(); -} - - - - -inline float screen_normalised(float pos, std::size_t size) -{ - return ((2.0f * pos) / size) - 1.0f; -} - -typedef Vector2 DeviceVector; - -inline DeviceVector window_to_normalised_device(WindowVector window, std::size_t width, std::size_t height) -{ - return DeviceVector(screen_normalised(window.x(), width), screen_normalised(height - 1 - window.y(), height)); -} - -inline float device_constrained(float pos) -{ - return std::min(1.0f, std::max(-1.0f, pos)); -} - -inline DeviceVector device_constrained(DeviceVector device) -{ - return DeviceVector(device_constrained(device.x()), device_constrained(device.y())); -} - -inline float window_constrained(float pos, std::size_t origin, std::size_t size) -{ - return std::min(static_cast(origin + size), std::max(static_cast(origin), pos)); -} - -inline WindowVector window_constrained(WindowVector window, std::size_t x, std::size_t y, std::size_t width, std::size_t height) -{ - return WindowVector(window_constrained(window.x(), x, width), window_constrained(window.y(), y, height)); -} - -typedef Callback1 MouseEventCallback; - -Single g_mouseMovedCallback; -Single g_mouseUpCallback; - -#if 1 -const ButtonIdentifier c_button_select = c_buttonLeft; -const ModifierFlags c_modifier_manipulator = c_modifierNone; -const ModifierFlags c_modifier_toggle = c_modifierShift; -const ModifierFlags c_modifier_replace = c_modifierShift | c_modifierAlt; -const ModifierFlags c_modifier_face = c_modifierControl; -#else -const ButtonIdentifier c_button_select = c_buttonLeft; -const ModifierFlags c_modifier_manipulator = c_modifierNone; -const ModifierFlags c_modifier_toggle = c_modifierControl; -const ModifierFlags c_modifier_replace = c_modifierNone; -const ModifierFlags c_modifier_face = c_modifierShift; -#endif -const ModifierFlags c_modifier_toggle_face = c_modifier_toggle | c_modifier_face; -const ModifierFlags c_modifier_replace_face = c_modifier_replace | c_modifier_face; - -const ButtonIdentifier c_button_texture = c_buttonMiddle; -const ModifierFlags c_modifier_apply_texture = c_modifierControl | c_modifierShift; -const ModifierFlags c_modifier_copy_texture = c_modifierNone; - -class Selector_ -{ - RadiantSelectionSystem::EModifier modifier_for_state(ModifierFlags state) - { - if(state == c_modifier_toggle || state == c_modifier_toggle_face) - { - return RadiantSelectionSystem::eToggle; - } - if(state == c_modifier_replace || state == c_modifier_replace_face) - { - return RadiantSelectionSystem::eReplace; - } - return RadiantSelectionSystem::eManipulator; - } - - rect_t getDeviceArea() const - { - DeviceVector delta(m_current - m_start); - if(selecting() && fabs(delta.x()) > m_epsilon.x() && fabs(delta.y()) > m_epsilon.y()) - { - return SelectionBoxForArea(&m_start[0], &delta[0]); - } - else - { - rect_t default_area = { { 0, 0, }, { 0, 0, }, }; - return default_area; - } - } - -public: - DeviceVector m_start; - DeviceVector m_current; - DeviceVector m_epsilon; - std::size_t m_unmoved_replaces; - ModifierFlags m_state; - const View* m_view; - RectangleCallback m_window_update; - - Selector_() : m_start(0.0f, 0.0f), m_current(0.0f, 0.0f), m_unmoved_replaces(0), m_state(c_modifierNone) - { - } - - void draw_area() - { - m_window_update(getDeviceArea()); - } - - void testSelect(DeviceVector position) - { - RadiantSelectionSystem::EModifier modifier = modifier_for_state(m_state); - if(modifier != RadiantSelectionSystem::eManipulator) - { - DeviceVector delta(position - m_start); - if(fabs(delta.x()) > m_epsilon.x() && fabs(delta.y()) > m_epsilon.y()) - { - DeviceVector delta(position - m_start); - getSelectionSystem().SelectArea(*m_view, &m_start[0], &delta[0], modifier, (m_state & c_modifier_face) != c_modifierNone); - } - else - { - if(modifier == RadiantSelectionSystem::eReplace && m_unmoved_replaces++ > 0) - { - modifier = RadiantSelectionSystem::eCycle; - } - getSelectionSystem().SelectPoint(*m_view, &position[0], &m_epsilon[0], modifier, (m_state & c_modifier_face) != c_modifierNone); - } - } - - m_start = m_current = DeviceVector(0.0f, 0.0f); - draw_area(); - } - - bool selecting() const - { - return m_state != c_modifier_manipulator; - } - - void setState(ModifierFlags state) - { - bool was_selecting = selecting(); - m_state = state; - if(was_selecting ^ selecting()) - { - draw_area(); - } - } - - ModifierFlags getState() const - { - return m_state; - } - - void modifierEnable(ModifierFlags type) - { - setState(bitfield_enable(getState(), type)); - } - void modifierDisable(ModifierFlags type) - { - setState(bitfield_disable(getState(), type)); - } - - void mouseDown(DeviceVector position) - { - m_start = m_current = device_constrained(position); - } - - void mouseMoved(DeviceVector position) - { - m_current = device_constrained(position); - draw_area(); - } - typedef MemberCaller1 MouseMovedCaller; - - void mouseUp(DeviceVector position) - { - testSelect(device_constrained(position)); - - g_mouseMovedCallback.clear(); - g_mouseUpCallback.clear(); - } - typedef MemberCaller1 MouseUpCaller; -}; - - -class Manipulator_ -{ -public: - DeviceVector m_epsilon; - const View* m_view; - - bool mouseDown(DeviceVector position) - { - return getSelectionSystem().SelectManipulator(*m_view, &position[0], &m_epsilon[0]); - } - - void mouseMoved(DeviceVector position) - { - getSelectionSystem().MoveSelected(*m_view, &position[0]); - } - typedef MemberCaller1 MouseMovedCaller; - - void mouseUp(DeviceVector position) - { - getSelectionSystem().endMove(); - g_mouseMovedCallback.clear(); - g_mouseUpCallback.clear(); - } - typedef MemberCaller1 MouseUpCaller; -}; - -void Scene_copyClosestTexture(SelectionTest& test); -void Scene_applyClosestTexture(SelectionTest& test); - -class RadiantWindowObserver : public SelectionSystemWindowObserver -{ - enum - { - SELECT_EPSILON = 8, - }; - - int m_width; - int m_height; - - bool m_mouse_down; - -public: - Selector_ m_selector; - Manipulator_ m_manipulator; - - RadiantWindowObserver() : m_mouse_down(false) - { - } - void release() - { - delete this; - } - void setView(const View& view) - { - m_selector.m_view = &view; - m_manipulator.m_view = &view; - } - void setRectangleDrawCallback(const RectangleCallback& callback) - { - m_selector.m_window_update = callback; - } - void onSizeChanged(int width, int height) - { - m_width = width; - m_height = height; - DeviceVector epsilon(SELECT_EPSILON / static_cast(m_width), SELECT_EPSILON / static_cast(m_height)); - m_selector.m_epsilon = m_manipulator.m_epsilon = epsilon; - } - void onMouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) - { - if(button == c_button_select) - { - m_mouse_down = true; - - DeviceVector devicePosition(window_to_normalised_device(position, m_width, m_height)); - if(modifiers == c_modifier_manipulator && m_manipulator.mouseDown(devicePosition)) - { - g_mouseMovedCallback.insert(MouseEventCallback(Manipulator_::MouseMovedCaller(m_manipulator))); - g_mouseUpCallback.insert(MouseEventCallback(Manipulator_::MouseUpCaller(m_manipulator))); - } - else - { - m_selector.mouseDown(devicePosition); - g_mouseMovedCallback.insert(MouseEventCallback(Selector_::MouseMovedCaller(m_selector))); - g_mouseUpCallback.insert(MouseEventCallback(Selector_::MouseUpCaller(m_selector))); - } - } - else if(button == c_button_texture) - { - DeviceVector devicePosition(device_constrained(window_to_normalised_device(position, m_width, m_height))); - - View scissored(*m_selector.m_view); - ConstructSelectionTest(scissored, SelectionBoxForPoint(&devicePosition[0], &m_selector.m_epsilon[0])); - SelectionVolume volume(scissored); - - if(modifiers == c_modifier_apply_texture) - { - Scene_applyClosestTexture(volume); - } - else if(modifiers == c_modifier_copy_texture) - { - Scene_copyClosestTexture(volume); - } - } - } - void onMouseMotion(const WindowVector& position, ModifierFlags modifiers) - { - m_selector.m_unmoved_replaces = 0; - - if(m_mouse_down && !g_mouseMovedCallback.empty()) - { - g_mouseMovedCallback.get()(window_to_normalised_device(position, m_width, m_height)); - } - } - void onMouseUp(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) - { - if(button == c_button_select && !g_mouseUpCallback.empty()) - { - m_mouse_down = false; - - g_mouseUpCallback.get()(window_to_normalised_device(position, m_width, m_height)); - } - } - void onModifierDown(ModifierFlags type) - { - m_selector.modifierEnable(type); - } - void onModifierUp(ModifierFlags type) - { - m_selector.modifierDisable(type); - } -}; - - - -SelectionSystemWindowObserver* NewWindowObserver() -{ - return new RadiantWindowObserver; -} - - - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class SelectionDependencies : - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalOpenGLModuleRef -{ -}; - -class SelectionAPI : public TypeSystemRef -{ - SelectionSystem* m_selection; -public: - typedef SelectionSystem Type; - STRING_CONSTANT(Name, "*"); - - SelectionAPI() - { - SelectionSystem_Construct(); - - m_selection = &getSelectionSystem(); - } - ~SelectionAPI() - { - SelectionSystem_Destroy(); - } - SelectionSystem* getTable() - { - return m_selection; - } -}; - -typedef SingletonModule SelectionModule; -typedef Static StaticSelectionModule; -StaticRegisterModule staticRegisterSelection(StaticSelectionModule::instance()); diff --git a/radiant/selection.h b/radiant/selection.h deleted file mode 100644 index 8334ec63..00000000 --- a/radiant/selection.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SELECTION_H) -#define INCLUDED_SELECTION_H - -#include "windowobserver.h" -#include "generic/callbackfwd.h" - -struct rect_t -{ - float min[2]; - float max[2]; -}; - -typedef Callback1 RectangleCallback; - -class View; - -class SelectionSystemWindowObserver : public WindowObserver -{ -public: - virtual void setView(const View& view) = 0; - virtual void setRectangleDrawCallback(const RectangleCallback& callback) = 0; -}; - -SelectionSystemWindowObserver* NewWindowObserver(); - -class AABB; -namespace scene -{ - class Graph; -} -void Scene_BoundsSelected(scene::Graph& graph, AABB& bounds); - -#endif diff --git a/radiant/server.cpp b/radiant/server.cpp deleted file mode 100644 index a4c7b83a..00000000 --- a/radiant/server.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "server.h" - -#include "debugging/debugging.h" -#include "warnings.h" - -#include -#include -#include "os/path.h" - -#include "modulesystem.h" - -class RadiantModuleServer : public ModuleServer -{ - typedef std::pair ModuleType; - typedef std::pair ModuleKey; - typedef std::map Modules_; - Modules_ m_modules; - bool m_error; - -public: - RadiantModuleServer() : m_error(false) - { - } - - void setError(bool error) - { - m_error = error; - } - bool getError() const - { - return m_error; - } - - TextOutputStream& getOutputStream() - { - return globalOutputStream(); - } - TextOutputStream& getErrorStream() - { - return globalErrorStream(); - } - DebugMessageHandler& getDebugMessageHandler() - { - return globalDebugMessageHandler(); - } - - void registerModule(const char* type, int version, const char* name, Module& module) - { - ASSERT_NOTNULL(&module); - if(!m_modules.insert(Modules_::value_type(ModuleKey(ModuleType(type, version), name), &module)).second) - { - globalErrorStream() << "module already registered: type=" << makeQuoted(type) << " name=" << makeQuoted(name) << "\n"; - } - else - { - globalOutputStream() << "Module Registered: type=" << makeQuoted(type) << " version=" << makeQuoted(version) << " name=" << makeQuoted(name) << "\n"; - } - } - - Module* findModule(const char* type, int version, const char* name) const - { - Modules_::const_iterator i = m_modules.find(ModuleKey(ModuleType(type, version), name)); - if(i != m_modules.end()) - { - return (*i).second; - } - return 0; - } - - void foreachModule(const char* type, int version, const Visitor& visitor) - { - for(Modules_::const_iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - if(string_equal((*i).first.first.first.c_str(), type)) - { - visitor.visit((*i).first.second.c_str(), *(*i).second); - } - } - } -}; - - -#if defined(WIN32) - -#include - -#define FORMAT_BUFSIZE 2048 -const char* FormatGetLastError() -{ - static char buf[FORMAT_BUFSIZE]; - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - buf, - FORMAT_BUFSIZE, - NULL - ); - return buf; -} - -class DynamicLibrary -{ - HMODULE m_library; -public: - typedef int (__stdcall* FunctionPointer)(); - - DynamicLibrary(const char* filename) - { - m_library = LoadLibrary(filename); - if(m_library == 0) - { - globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n"; - globalErrorStream() << "GetLastError: " << FormatGetLastError(); - } - } - ~DynamicLibrary() - { - if(!failed()) - { - FreeLibrary(m_library); - } - } - bool failed() - { - return m_library == 0; - } - FunctionPointer findSymbol(const char* symbol) - { - FunctionPointer address = GetProcAddress(m_library, symbol); - if(address == 0) - { - globalErrorStream() << "GetProcAddress failed: '" << symbol << "'\n"; - globalErrorStream() << "GetLastError: " << FormatGetLastError(); - } - return address; - } -}; - -#elif defined(POSIX) - -#include - -class DynamicLibrary -{ - void* m_library; -public: - typedef int (* FunctionPointer)(); - - DynamicLibrary(const char* filename) - { - m_library = dlopen(filename, RTLD_NOW); - } - ~DynamicLibrary() - { - if(!failed()) - dlclose(m_library); - } - bool failed() - { - return m_library == 0; - } - FunctionPointer findSymbol(const char* symbol) - { - FunctionPointer p = (FunctionPointer)dlsym(m_library, symbol); - if(p == 0) - { - const char* error = reinterpret_cast(dlerror()); - if(error != 0) - { - globalErrorStream() << error; - } - } - return p; - } -}; - -#else -#error "unsupported platform" -#endif - -class DynamicLibraryModule -{ - typedef void (RADIANT_DLLEXPORT* RegisterModulesFunc)(ModuleServer& server); - DynamicLibrary m_library; - RegisterModulesFunc m_registerModule; -public: - DynamicLibraryModule(const char* filename) - : m_library(filename), m_registerModule(0) - { - if(!m_library.failed()) - { - m_registerModule = reinterpret_cast(m_library.findSymbol("Radiant_RegisterModules")); - } - } - bool failed() - { - return m_registerModule == 0; - } - void registerModules(ModuleServer& server) - { - m_registerModule(server); - } -}; - - -class Libraries -{ - typedef std::vector libraries_t; - libraries_t m_libraries; - -public: - ~Libraries() - { - release(); - } - void registerLibrary(const char* filename, ModuleServer& server) - { - DynamicLibraryModule* library = new DynamicLibraryModule(filename); - - if(library->failed()) - { - delete library; - } - else - { - m_libraries.push_back(library); - library->registerModules(server); - } - } - void release() - { - for(libraries_t::iterator i = m_libraries.begin(); i != m_libraries.end(); ++i) - { - delete *i; - } - } - void clear() - { - m_libraries.clear(); - } -}; - - -Libraries g_libraries; -RadiantModuleServer g_server; - -ModuleServer& GlobalModuleServer_get() -{ - return g_server; -} - -void GlobalModuleServer_loadModule(const char* filename) -{ - g_libraries.registerLibrary(filename, g_server); -} - -void GlobalModuleServer_Initialise() -{ -} - -void GlobalModuleServer_Shutdown() -{ -} diff --git a/radiant/server.h b/radiant/server.h deleted file mode 100644 index ded73098..00000000 --- a/radiant/server.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SERVER_H) -#define INCLUDED_SERVER_H - -class ModuleServer; -ModuleServer& GlobalModuleServer_get(); -void GlobalModuleServer_loadModule(const char* filename); -void GlobalModuleServer_Initialise(); -void GlobalModuleServer_Shutdown(); - -#endif diff --git a/radiant/shaders.cpp b/radiant/shaders.cpp deleted file mode 100644 index 696ef5ba..00000000 --- a/radiant/shaders.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "shaders.h" - -#include "ifilesystem.h" - -#include "stream/stringstream.h" - -#include "gtkdlgs.h" - -void ViewShader(const char *pFile, const char *pName) -{ - char* pBuff = 0; - //int nSize = - vfsLoadFile(pFile, reinterpret_cast(&pBuff)); - if (pBuff == 0) - { - globalErrorStream() << "Failed to load shader file " << pFile << "\n"; - return; - } - // look for the shader declaration - StringOutputStream strFind(string_length(pName)); - strFind << LowerCase(pName); - StringOutputStream strLook(string_length(pBuff)); - strFind << LowerCase(pBuff); - // offset used when jumping over commented out definitions - std::size_t nOffset = 0; - while (true) - { - const char* substr = strstr(strFind.c_str() + nOffset, strFind.c_str()); - if (substr == 0) - break; - std::size_t nStart = substr - strLook.c_str(); - // we have found something, maybe it's a commented out shader name? - char *strCheck = new char[string_length(strLook.c_str())+1]; - strcpy( strCheck, strLook.c_str() ); - strCheck[nStart] = 0; - char *pCheck = strrchr( strCheck, '\n' ); - // if there's a commentary sign in-between we'll continue - if (pCheck && strstr( pCheck, "//" )) - { - delete[] strCheck; - nOffset = nStart + 1; - continue; - } - delete[] strCheck; - nOffset = nStart; - break; - } - // now close the file - vfsFreeFile(pBuff); - - DoTextEditor (pFile, static_cast(nOffset)); -} diff --git a/radiant/shaders.h b/radiant/shaders.h deleted file mode 100644 index 58b398cf..00000000 --- a/radiant/shaders.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_SHADERS_H) -#define INCLUDED_SHADERS_H - -void ViewShader(const char* file, const char* shader); - -#endif diff --git a/radiant/sockets.cpp b/radiant/sockets.cpp deleted file mode 100644 index e08680be..00000000 --- a/radiant/sockets.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -#include "sockets.h" - -#if defined(WIN32) -#include -#elif defined (POSIX) -#include -#define SOCKET_ERROR -1 -#else -#error "unsupported platform" -#endif - -#ifdef __APPLE__ -#include -#endif - -int Net_Wait(socket_t *sock, long sec, long usec) -{ -// used for select() -#ifdef WIN32 - TIMEVAL tout = { sec, usec }; -#endif -#if defined (POSIX) - timeval tout; - tout.tv_sec = sec; - tout.tv_usec = usec; -#endif - - // select() will identify if the socket needs an update - // if the socket is identified that means there's either a message or the connection has been closed/reset/terminated - fd_set readfds; - FD_ZERO(&readfds); - FD_SET(((unsigned int)sock->socket), &readfds); - // from select man page: - // n is the highest-numbered descriptor in any of the three sets, plus 1 - // (no use on windows) - switch( select( sock->socket + 1, &readfds, 0, 0, &tout ) ) - { - case SOCKET_ERROR: - return -1; - case 0: - return 0; - default: - return 1; - } -} - diff --git a/radiant/sockets.h b/radiant/sockets.h deleted file mode 100644 index 3bc2274d..00000000 --- a/radiant/sockets.h +++ /dev/null @@ -1,14 +0,0 @@ - -#if !defined(INCLUDED_SOCKETS_H) -#define INCLUDED_SOCKETS_H - -#include "l_net/l_net.h" - -// waits for a socket to become ready -// returns -// -1: error -// 0: timeout -// 1: ready -int Net_Wait(socket_t *sock, long sec, long usec); - -#endif diff --git a/radiant/stacktrace.cpp b/radiant/stacktrace.cpp deleted file mode 100644 index 7c75db42..00000000 --- a/radiant/stacktrace.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "stacktrace.h" -#include "stream/textstream.h" - -#include "environment.h" - -#ifdef __linux__ -#include - -void write_stack_trace(TextOutputStream& outputStream) -{ - const unsigned int MAX_SYMBOLS = 256; - void* symbols[MAX_SYMBOLS]; - - // get return addresses - int symbol_count = backtrace(symbols, MAX_SYMBOLS); - - if(!symbol_count) - return; - - // resolve and print names - char** symbol_names = backtrace_symbols(symbols, symbol_count); - if(symbol_names) - { - for(int i = 0; (i < symbol_count); ++i) - outputStream << symbol_names[i] << "\n"; - - // not a memleak, see www.gnu.org/software/libc/manual (Debugging Support, Backtraces) - free(symbol_names); - } -} -#endif - -#if defined (WIN32) && defined (_MSC_VER) && defined (DEBUG) - -#include "windows.h" -#include "winnt.h" -#include "dbghelp.h" - -class Address -{ -public: - void* m_value; - Address(void* value) : m_value(value) - { - } -}; - -/// \brief Writes an address \p p to \p ostream in hexadecimal form. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Address& p) -{ - const std::size_t bufferSize = (sizeof(void*) * 2) + 1; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%0p", p.m_value)); - return ostream; -} - -class Offset -{ -public: - void* m_value; - Offset(void* value) : m_value(value) - { - } -}; - -/// \brief Writes an address \p p to \p ostream in hexadecimal form. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const Offset& p) -{ - const std::size_t bufferSize = (sizeof(void*) * 2) + 1; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%X", p.m_value)); - return ostream; -} - -/// \brief Writes a WCHAR string \p s to \p ostream. -template -inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const WCHAR* s) -{ - const std::size_t bufferSize = 1024; - char buf[bufferSize]; - ostream.write(buf, snprintf(buf, bufferSize, "%ls", s)); - return ostream; -} - -struct EnumerateSymbolsContext -{ - STACKFRAME64& sf; - TextOutputStream& outputStream; - std::size_t count; - EnumerateSymbolsContext(STACKFRAME64& sf, TextOutputStream& outputStream) : sf(sf), outputStream(outputStream), count(0) - { - } -}; - -void write_symbol(PSYMBOL_INFO pSym, STACKFRAME64& sf, TextOutputStream& outputStream, std::size_t& count) -{ -#if 0 - if ( pSym->Flags & SYMFLAG_PARAMETER ) - { - - DWORD basicType; - if ( SymGetTypeInfo( GetCurrentProcess(), pSym->ModBase, pSym->TypeIndex, - TI_GET_BASETYPE, &basicType ) ) - { - int bleh = 0; - } - else - { - DWORD typeId; - if(SymGetTypeInfo( GetCurrentProcess(), pSym->ModBase, pSym->TypeIndex, - TI_GET_TYPEID, &typeId )) - { - if ( SymGetTypeInfo( GetCurrentProcess(), pSym->ModBase, pSym->TypeIndex, - TI_GET_BASETYPE, &basicType ) ) - { - int bleh = 0; - } - else - { - const char* FormatGetLastError(); - const char* error = FormatGetLastError(); - int bleh = 0; - - WCHAR* name; - if(SymGetTypeInfo( GetCurrentProcess(), pSym->ModBase, typeId, - TI_GET_SYMNAME, &name )) - { - outputStream << name << " "; - LocalFree(name); - int bleh = 0; - } - else - { - const char* FormatGetLastError(); - const char* error = FormatGetLastError(); - int bleh = 0; - } - } - } - else - { - const char* FormatGetLastError(); - const char* error = FormatGetLastError(); - int bleh = 0; - } - } - if(count != 0) - { - outputStream << ", "; - } - outputStream << pSym->Name; - ++count; - } -#endif -} - -BOOL CALLBACK -EnumerateSymbolsCallback( - PSYMBOL_INFO pSymInfo, - ULONG SymbolSize, - PVOID UserContext ) -{ - write_symbol( pSymInfo, ((EnumerateSymbolsContext*)UserContext)->sf, ((EnumerateSymbolsContext*)UserContext)->outputStream, ((EnumerateSymbolsContext*)UserContext)->count); - - - return TRUE; -} - -void write_stack_trace(PCONTEXT pContext, TextOutputStream& outputStream) -{ - HANDLE m_hProcess = GetCurrentProcess(); - DWORD dwMachineType = 0; - - CONTEXT context = *pContext; - - // Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag - if ( !SymInitialize( m_hProcess, (PSTR)environment_get_app_path(), TRUE ) ) - { - return; - } - - STACKFRAME64 sf; - memset( &sf, 0, sizeof(sf) ); - sf.AddrPC.Mode = AddrModeFlat; - sf.AddrStack.Mode = AddrModeFlat; - sf.AddrFrame.Mode = AddrModeFlat; - -#ifdef _M_IX86 - // Initialize the STACKFRAME structure for the first call. This is only - // necessary for Intel CPUs, and isn't mentioned in the documentation. - sf.AddrPC.Offset = context.Eip; - sf.AddrStack.Offset = context.Esp; - sf.AddrFrame.Offset = context.Ebp; - - dwMachineType = IMAGE_FILE_MACHINE_I386; -#elif _M_X64 - sf.AddrPC.Offset = context.Rip; - sf.AddrStack.Offset = context.Rsp; - - // MSDN: x64: The frame pointer is RBP or RDI. This value is not always used. - // very funny, we'll try Rdi for now - sf.AddrFrame.Offset = context.Rdi; - - dwMachineType = IMAGE_FILE_MACHINE_AMD64; -#endif - - const unsigned int max_sym_name = 1024;// should be enough - - while ( 1 ) - { - // Get the next stack frame - if ( ! StackWalk64( dwMachineType, - m_hProcess, - GetCurrentThread(), - &sf, - &context, - 0, - SymFunctionTableAccess64, - SymGetModuleBase64, - 0 ) ) - break; - - if ( 0 == sf.AddrFrame.Offset ) // Basic sanity check to make sure - break; // the frame is OK. Bail if not. - - // Get the name of the function for this stack frame entry - BYTE symbolBuffer[ sizeof(SYMBOL_INFO) + max_sym_name ]; - PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbolBuffer; - pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); - pSymbol->MaxNameLen = max_sym_name; - - DWORD64 symDisplacement = 0; // Displacement of the input address, - // relative to the start of the symbol - - IMAGEHLP_MODULE64 module = { sizeof(IMAGEHLP_MODULE64) }; - if(SymGetModuleInfo64(m_hProcess, sf.AddrPC.Offset, &module)) - { - outputStream << module.ModuleName << "!"; - - if ( SymFromAddr(m_hProcess, sf.AddrPC.Offset, &symDisplacement, pSymbol)) - { - char undecoratedName[max_sym_name]; - UnDecorateSymbolName(pSymbol->Name, undecoratedName, max_sym_name, UNDNAME_COMPLETE); - - outputStream << undecoratedName; - - outputStream << "("; - // Use SymSetContext to get just the locals/params for this frame - IMAGEHLP_STACK_FRAME imagehlpStackFrame; - imagehlpStackFrame.InstructionOffset = sf.AddrPC.Offset; - SymSetContext( m_hProcess, &imagehlpStackFrame, 0 ); - - // Enumerate the locals/parameters - EnumerateSymbolsContext context(sf, outputStream); - SymEnumSymbols( m_hProcess, 0, 0, EnumerateSymbolsCallback, &context ); - outputStream << ")"; - - outputStream << " + " << Offset(reinterpret_cast(symDisplacement)); - - // Get the source line for this stack frame entry - IMAGEHLP_LINE64 lineInfo = { sizeof(IMAGEHLP_LINE64) }; - DWORD dwLineDisplacement; - if ( SymGetLineFromAddr64( m_hProcess, sf.AddrPC.Offset, - &dwLineDisplacement, &lineInfo ) ) - { - outputStream << " " << lineInfo.FileName << " line " << Unsigned(lineInfo.LineNumber); - } - } - else - { - outputStream << Address(reinterpret_cast(sf.AddrPC.Offset)); - } - } - - outputStream << "\n"; - } - - SymCleanup(m_hProcess); - - return; -} - -void write_stack_trace(TextOutputStream& outputStream) -{ - __try{ RaiseException(0,0,0,0); } __except(write_stack_trace((GetExceptionInformation())->ContextRecord, outputStream), EXCEPTION_CONTINUE_EXECUTION) {} -} - -#else -#if defined (WIN32) -void write_stack_trace(TextOutputStream& outputStream) -{ - outputStream << "\nStacktrace is disabled in release-builds\n"; -} -#endif -#endif diff --git a/radiant/stacktrace.h b/radiant/stacktrace.h deleted file mode 100644 index 6f2ee0e5..00000000 --- a/radiant/stacktrace.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_STACKTRACE_H) -#define INCLUDED_STACKTRACE_H - -class TextOutputStream; -void write_stack_trace(TextOutputStream& outputStream); - -#endif diff --git a/radiant/xmlstuff.cpp b/radiant/stdafx.cpp similarity index 93% rename from radiant/xmlstuff.cpp rename to radiant/stdafx.cpp index a92a1683..4b7ac630 100644 --- a/radiant/xmlstuff.cpp +++ b/radiant/stdafx.cpp @@ -28,5 +28,8 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "xmlstuff.h" +// TTimo +// precompiled headers stuff +// NOTE: this file is useless on non-MSVC builds +#include "stdafx.h" diff --git a/plugins/image/jpeg.h b/radiant/stdafx.h similarity index 89% rename from plugins/image/jpeg.h rename to radiant/stdafx.h index c34497e7..85d83e1c 100644 --- a/plugins/image/jpeg.h +++ b/radiant/stdafx.h @@ -28,13 +28,12 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined (INCLUDED_JPEG_H) -#define INCLUDED_JPEG_H - -class Image; -class ArchiveFile; - -Image* LoadJPG(ArchiveFile& file); +// TTimo +// included by most files +// on Win32 builds this one is used for precompiled headers +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include #endif - +#include "qe3.h" diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 7b2eb43e..6df9e693 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,371 +25,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // +#include +#include "stdafx.h" #include "surfacedialog.h" -#include "debugging/debugging.h" -#include "warnings.h" - -#include "iscenegraph.h" -#include "itexdef.h" -#include "iundo.h" -#include "iselection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include //Shamus: For Textool - -#include "signal/isignal.h" -#include "generic/object.h" -#include "math/vector.h" -#include "texturelib.h" -#include "shaderlib.h" -#include "stringio.h" - -#include "gtkutil/idledraw.h" -#include "gtkutil/dialog.h" -#include "gtkutil/entry.h" -#include "gtkutil/nonmodal.h" -#include "gtkutil/pointer.h" -#include "gtkutil/glwidget.h" //Shamus: For Textool -#include "gtkutil/button.h" -#include "map.h" -#include "select.h" -#include "patchmanip.h" -#include "brushmanip.h" -#include "patchdialog.h" -#include "preferences.h" -#include "brush_primit.h" -#include "xywindow.h" -#include "mainframe.h" -#include "gtkdlgs.h" -#include "dialog.h" -#include "brush.h" //Shamus: for Textool -#include "patch.h" -#include "commands.h" -#include "stream/stringstream.h" -#include "grid.h" -#include "textureentry.h" - -//NOTE: Proper functioning of Textool currently requires that the "#if 1" lines in -// brush_primit.h be changed to "#if 0". add/removeScale screws this up ATM. :-) -// Plus, Radiant seems to work just fine without that stuff. ;-) - -#define TEXTOOL_ENABLED 0 - -#if TEXTOOL_ENABLED - -namespace TexTool -{ - -//Shamus: Textool function prototypes -gboolean size_allocate(GtkWidget *, GtkAllocation *, gpointer); -gboolean expose(GtkWidget *, GdkEventExpose *, gpointer); -gboolean button_press(GtkWidget *, GdkEventButton *, gpointer); -gboolean button_release(GtkWidget *, GdkEventButton *, gpointer); -gboolean motion(GtkWidget *, GdkEventMotion *, gpointer); -void flipX(GtkToggleButton *, gpointer); -void flipY(GtkToggleButton *, gpointer); - -//End Textool function prototypes - -//Shamus: Textool globals -GtkWidget * g_textoolWin; -//End Textool globals - -void queueDraw() -{ - gtk_widget_queue_draw(g_textoolWin); -} - -} - -#endif - -inline void spin_button_set_step(GtkSpinButton* spin, gfloat step) -{ -#if 1 - gtk_spin_button_get_adjustment(spin)->step_increment = step; -#else - GValue gvalue = GValue_default(); - g_value_init(&gvalue, G_TYPE_DOUBLE); - g_value_set_double(&gvalue, step); - g_object_set(G_OBJECT(gtk_spin_button_get_adjustment(spin)), "step-increment", &gvalue, NULL); -#endif -} - -class Increment -{ - float& m_f; -public: - GtkSpinButton* m_spin; - GtkEntry* m_entry; - Increment(float& f) : m_f(f), m_spin(0), m_entry(0) - { - } - void cancel() - { - entry_set_float(m_entry, m_f); - } - typedef MemberCaller CancelCaller; - void apply() - { - m_f = static_cast(entry_get_float(m_entry)); - spin_button_set_step(m_spin, m_f); - } - typedef MemberCaller ApplyCaller; -}; - -void SurfaceInspector_GridChange(); - -class SurfaceInspector : public Dialog -{ - GtkWindow* BuildDialog(); - - NonModalEntry m_textureEntry; - NonModalSpinner m_hshiftSpinner; - NonModalEntry m_hshiftEntry; - NonModalSpinner m_vshiftSpinner; - NonModalEntry m_vshiftEntry; - NonModalSpinner m_hscaleSpinner; - NonModalEntry m_hscaleEntry; - NonModalSpinner m_vscaleSpinner; - NonModalEntry m_vscaleEntry; - NonModalSpinner m_rotateSpinner; - NonModalEntry m_rotateEntry; - - IdleDraw m_idleDraw; - - GtkCheckButton* m_surfaceFlags[32]; - GtkCheckButton* m_contentFlags[32]; - - NonModalEntry m_valueEntry; - GtkEntry* m_valueEntryWidget; -public: - WindowPositionTracker m_positionTracker; - WindowPositionTrackerImportStringCaller m_importPosition; - WindowPositionTrackerExportStringCaller m_exportPosition; - - // Dialog Data - float m_fitHorizontal; - float m_fitVertical; - - Increment m_hshiftIncrement; - Increment m_vshiftIncrement; - Increment m_hscaleIncrement; - Increment m_vscaleIncrement; - Increment m_rotateIncrement; - GtkEntry* m_texture; - - SurfaceInspector() : - m_textureEntry(ApplyShaderCaller(*this), UpdateCaller(*this)), - m_hshiftSpinner(ApplyTexdefCaller(*this), UpdateCaller(*this)), - m_hshiftEntry(Increment::ApplyCaller(m_hshiftIncrement), Increment::CancelCaller(m_hshiftIncrement)), - m_vshiftSpinner(ApplyTexdefCaller(*this), UpdateCaller(*this)), - m_vshiftEntry(Increment::ApplyCaller(m_vshiftIncrement), Increment::CancelCaller(m_vshiftIncrement)), - m_hscaleSpinner(ApplyTexdefCaller(*this), UpdateCaller(*this)), - m_hscaleEntry(Increment::ApplyCaller(m_hscaleIncrement), Increment::CancelCaller(m_hscaleIncrement)), - m_vscaleSpinner(ApplyTexdefCaller(*this), UpdateCaller(*this)), - m_vscaleEntry(Increment::ApplyCaller(m_vscaleIncrement), Increment::CancelCaller(m_vscaleIncrement)), - m_rotateSpinner(ApplyTexdefCaller(*this), UpdateCaller(*this)), - m_rotateEntry(Increment::ApplyCaller(m_rotateIncrement), Increment::CancelCaller(m_rotateIncrement)), - m_idleDraw(UpdateCaller(*this)), - m_valueEntry(ApplyFlagsCaller(*this), UpdateCaller(*this)), - m_importPosition(m_positionTracker), - m_exportPosition(m_positionTracker), - m_hshiftIncrement(g_si_globals.shift[0]), - m_vshiftIncrement(g_si_globals.shift[1]), - m_hscaleIncrement(g_si_globals.scale[0]), - m_vscaleIncrement(g_si_globals.scale[1]), - m_rotateIncrement(g_si_globals.rotate) - { - m_fitVertical = 1; - m_fitHorizontal = 1; - m_positionTracker.setPosition(c_default_window_pos); - } - - void constructWindow(GtkWindow* main_window) - { - m_parent = main_window; - Create(); - AddGridChangeCallback(FreeCaller()); - } - void destroyWindow() - { - Destroy(); - } - bool visible() const - { - return GTK_WIDGET_VISIBLE(const_cast(GetWidget())); - } - void queueDraw() - { - if(visible()) - { - m_idleDraw.queueDraw(); - } - } - - void Update(); - typedef MemberCaller UpdateCaller; - void ApplyShader(); - typedef MemberCaller ApplyShaderCaller; - void ApplyTexdef(); - typedef MemberCaller ApplyTexdefCaller; - void ApplyFlags(); - typedef MemberCaller ApplyFlagsCaller; -}; - -namespace -{ - SurfaceInspector* g_SurfaceInspector; - - inline SurfaceInspector& getSurfaceInspector() - { - ASSERT_NOTNULL(g_SurfaceInspector); - return *g_SurfaceInspector; - } -} - -void SurfaceInspector_constructWindow(GtkWindow* main_window) -{ - getSurfaceInspector().constructWindow(main_window); -} -void SurfaceInspector_destroyWindow() -{ - getSurfaceInspector().destroyWindow(); -} - -void SurfaceInspector_queueDraw() -{ - getSurfaceInspector().queueDraw(); -} - -namespace -{ - CopiedString g_selectedShader; - TextureProjection g_selectedTexdef; - ContentsFlagsValue g_selectedFlags; - size_t g_selectedShaderSize[2]; -} - -void SurfaceInspector_SetSelectedShader(const char* shader) -{ - g_selectedShader = shader; - SurfaceInspector_queueDraw(); -} - -void SurfaceInspector_SetSelectedTexdef(const TextureProjection& projection) -{ - g_selectedTexdef = projection; - SurfaceInspector_queueDraw(); -} - -void SurfaceInspector_SetSelectedFlags(const ContentsFlagsValue& flags) -{ - g_selectedFlags = flags; - SurfaceInspector_queueDraw(); -} - -static bool s_texture_selection_dirty = false; - -void SurfaceInspector_updateSelection() -{ - s_texture_selection_dirty = true; - SurfaceInspector_queueDraw(); - -#if TEXTOOL_ENABLED - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - TexTool::queueDraw(); - //globalOutputStream() << "textool texture changed..\n"; - } -#endif -} - -void SurfaceInspector_SelectionChanged(const Selectable& selectable) -{ - SurfaceInspector_updateSelection(); -} - -void SurfaceInspector_SetCurrent_FromSelected() -{ - if(s_texture_selection_dirty == true) - { - s_texture_selection_dirty = false; - if(!g_SelectedFaceInstances.empty()) - { - TextureProjection projection; -//This *may* be the point before it fucks up... Let's see! -//Yep, there was a call to removeScale in there... - Scene_BrushGetTexdef_Component_Selected(GlobalSceneGraph(), projection); - - SurfaceInspector_SetSelectedTexdef(projection); - - Scene_BrushGetShaderSize_Component_Selected(GlobalSceneGraph(), g_selectedShaderSize[0], g_selectedShaderSize[1]); - g_selectedTexdef.m_brushprimit_texdef.coords[0][2] = float_mod(g_selectedTexdef.m_brushprimit_texdef.coords[0][2], (float)g_selectedShaderSize[0]); - g_selectedTexdef.m_brushprimit_texdef.coords[1][2] = float_mod(g_selectedTexdef.m_brushprimit_texdef.coords[1][2], (float)g_selectedShaderSize[1]); - - CopiedString name; - Scene_BrushGetShader_Component_Selected(GlobalSceneGraph(), name); - if(string_not_empty(name.c_str())) - { - SurfaceInspector_SetSelectedShader(name.c_str()); - } - - ContentsFlagsValue flags; - Scene_BrushGetFlags_Component_Selected(GlobalSceneGraph(), flags); - SurfaceInspector_SetSelectedFlags(flags); - } - else - { - TextureProjection projection; - Scene_BrushGetTexdef_Selected(GlobalSceneGraph(), projection); - SurfaceInspector_SetSelectedTexdef(projection); - - CopiedString name; - Scene_BrushGetShader_Selected(GlobalSceneGraph(), name); - if(string_empty(name.c_str())) - { - Scene_PatchGetShader_Selected(GlobalSceneGraph(), name); - } - if(string_not_empty(name.c_str())) - { - SurfaceInspector_SetSelectedShader(name.c_str()); - } - - ContentsFlagsValue flags(0, 0, 0, false); - Scene_BrushGetFlags_Selected(GlobalSceneGraph(), flags); - SurfaceInspector_SetSelectedFlags(flags); - } - } -} - -const char* SurfaceInspector_GetSelectedShader() -{ - SurfaceInspector_SetCurrent_FromSelected(); - return g_selectedShader.c_str(); -} - -const TextureProjection& SurfaceInspector_GetSelectedTexdef() -{ - SurfaceInspector_SetCurrent_FromSelected(); - return g_selectedTexdef; -} - -const ContentsFlagsValue& SurfaceInspector_GetSelectedFlags() -{ - SurfaceInspector_SetCurrent_FromSelected(); - return g_selectedFlags; -} - +SurfaceDlg g_dlgSurface; +///////////////////////////////////////////////////////////////////////////// +// surface properties plugin /* =================================================== @@ -399,14 +42,321 @@ const ContentsFlagsValue& SurfaceInspector_GetSelectedFlags() =================================================== */ -si_globals_t g_si_globals; +// the texdef to switch back to when the OnCancel is called +texdef_t g_old_texdef; +// when != NULL, this thing means the surface inspector is currently being displayed +// NOTE a boolean flag would have been more explicit, this is totally so ugly +GtkWidget* g_surfwin = NULL; +// turn on/off processing of the "changed" "value_changed" messages +// (need to turn off when we are feeding data in) +bool g_bListenChanged = true; +// the struct used to store the increments (saved in registry) +texdef_t *l_pIncrement = &g_qeglobals.d_savedinfo.m_SIIncrement; +// turn on/off listening of the update messages +bool g_bListenUpdate = true; +#ifdef _DEBUG +// experimental stuff, work directly on BP +static void OnTest(GtkWidget *widget, gpointer data) +{ + if (!g_qeglobals.m_bBrushPrimitMode) + { + Sys_FPrintf(SYS_WRN, "BP mode required\n"); + return; + } + if (g_ptrSelectedFaces.GetSize() != 1) + { + Sys_FPrintf(SYS_WRN, "Expected single face selection\n"); + return; + } + brush_t *b = reinterpret_cast(g_ptrSelectedFaceBrushes.GetAt(0)); + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(0)); + // get the ST axis base for the face + vec3_t texS,texT; + ComputeAxisBase(selFace->plane.normal, texS, texT); + // find ST coordinates for the center of the face + float Os=0,Ot=0; + int i; + for (i=0; iface_winding->numpoints; i++) + { + Os += DotProduct(selFace->face_winding->points[i],texS); + Ot += DotProduct(selFace->face_winding->points[i],texT); + } + Os /= selFace->face_winding->numpoints; + Ot /= selFace->face_winding->numpoints; + brushprimit_texdef_t *pBP = &selFace->brushprimit_texdef; + + // (FIXME: initial version, before axis base change optimize) + + // we need to compute our BP matrix in this new axis base (O,texS,texT) + // the general case if BPO = M * BP * M^-1 + // where BPO is transformation expressed in (O,texS,texT) + // M is the axis base change from (origin,texS,texT) to (O,texS,texT) + // here we have a special case, M is a translation and it's inverse is easy + vec_t BPO[2][3]; + vec_t aux[2][3]; + vec_t m[2][3]; + memset(&m, 0, sizeof(vec_t)*6); + m[0][0] = 1; m[1][1] = 1; m[0][2] = -Os; m[1][2] = -Ot; + BPMatMul(m, pBP->coords, aux); + m[0][2] = Os; m[1][2] = Ot; // now M^-1 + BPMatMul(aux, m, BPO); + +#if 0 + // apply a scaling + // scale factors against S and T axis, we apply on top of the existing matrix + // <1 will decrease the texel/world resolution, >1 will increase + float sS = 1.025,sT = 1.025; + BPMatScale(BPO,sS,sT); +#endif +#if 0 + // apply a rotation + float theta = 5; + BPMatRotate(BPO,theta); +#endif +#if 0 + // read the scale + ConvertTexMatWithQTexture(BPO, selFace->d_texture, aux, NULL); + // reset the scale (normalize the matrix) + vec_t v1,v2; + v1 = sqrt(aux[0][0]*aux[0][0]+aux[1][0]*aux[1][0]); + v2 = sqrt(aux[0][1]*aux[0][1]+aux[1][1]*aux[1][1]); + // if reading the scale values, we have them here: + Sys_Printf("Current Scale: S: %g T: %g\n", v1, v2); + return; +#endif +#if 1 + // apply a given scale (on S and T) + ConvertTexMatWithQTexture(BPO, selFace->d_texture, aux, NULL); + // reset the scale (normalize the matrix) + vec_t v1,v2; + v1 = sqrt(aux[0][0]*aux[0][0]+aux[1][0]*aux[1][0]); + v2 = sqrt(aux[0][1]*aux[0][1]+aux[1][1]*aux[1][1]); + vec_t sS,sT; + // put the values for scale on S and T here: + sS = 1.2 / v1; + sT = 0.8 / v2; + aux[0][0] *= sS; aux[1][0] *= sS; + aux[0][1] *= sT; aux[1][1] *= sT; + ConvertTexMatWithQTexture(aux, NULL, BPO, selFace->d_texture); +#endif + + // now BPO must be expressed back in (origin,texS,texT) axis base BP = M^-1 * BPO * M + BPMatMul(m, BPO, aux); // m is M^-1 + m[0][2] = -Os; m[1][2] = -Ot; + BPMatMul(aux, m, pBP->coords); + + // now emit the coordinates on the winding + EmitBrushPrimitTextureCoordinates(selFace, selFace->face_winding); + Sys_UpdateWindows(W_CAMERA); +} + +/* + FIXME: try again, there must be a silly mistake in the formula expansion + // we need to compute our BP matrix in this new axis base (O,texS,texT) + // the general case is BPO = M * BP * M^-1 + // where BPO is transformation expressed in (O,texS,texT) + // M is the axis base change from (origin,texS,texT) to (O,texS,texT) + // here we have a special case, M is a translation and it's inverse is easy + // the M * BP * M^-1 formula can be expanded and simplified + vec_t BPO[2][3]; + memcpy(&BPO, &pBP->coords, sizeof(vec_t)*6); + BPO[0][2] = Os*(pBP->coords[0][0]-1.0) + Ot*pBP->coords[0][1] + pBP->coords[0][2]; + BPO[1][2] = Os*pBP->coords[1][0] + Ot*(pBP->coords[1][1]-1.0) + Ot*pBP->coords[1][2]; + + // apply a scaling + // scale factors against S and T axis, we apply on top of the existing matrix + // <1 will decrease the texel/world resolution, >1 will increase + float sS = 1.025,sT = 1.025; + BPMatScale(BPO,sS,sT); + + // now BPO must be expressed back in (origin,texS,texT) axis base BP = M^-1 * BPO * M + // same expanded formula as above + memcpy(&pBP->coords, &BPO, sizeof(vec_t)*6); + pBP->coords[0][2] = Os*(1.0-BPO[0][0]) - Ot*BPO[0][1] + BPO[0][2]; + pBP->coords[1][2] = -Os*BPO[1][0] + Ot*(1.0-BPO[1][1]) + BPO[1][2]; +*/ + +/* + // initial version, before axis base change optimize + + // we need to compute our BP matrix in this new axis base (O,texS,texT) + // the general case if BPO = M * BP * M^-1 + // where BPO is transformation expressed in (O,texS,texT) + // M is the axis base change from (origin,texS,texT) to (O,texS,texT) + // here we have a special case, M is a translation and it's inverse is easy + vec_t BPO[2][3]; + vec_t aux[2][3]; + vec_t m[2][3]; + memset(&m, 0, sizeof(vec_t)*6); + m[0][0] = 1; m[1][1] = 1; m[0][2] = -Os; m[1][2] = -Ot; + BPMatMul(m, pBP->coords, aux); + m[0][2] = Os; m[1][2] = Ot; // now M^-1 + BPMatMul(aux, m, BPO); + + // apply a scaling + // scale factors against S and T axis, we apply on top of the existing matrix + // <1 will decrease the texel/world resolution, >1 will increase + float sS = 1.025,sT = 1.025; + BPMatScale(BPO,sS,sT); + + // now BPO must be expressed back in (origin,texS,texT) axis base BP = M^-1 * BPO * M + BPMatMul(m, BPO, aux); // m is M^-1 + m[0][2] = -Os; m[1][2] = -Ot; + BPMatMul(aux, m, pBP->coords); +*/ +#endif + +static void OnDone(GtkWidget *widget, gpointer data) +{ + g_dlgSurface.GetTexMods(); + g_dlgSurface.HideDlg (); + Sys_UpdateWindows(W_ALL); +} + +// OnUpdate is called when something is changed in the dialog +// and must be reflected in the views. But it's not a change +// so important, so the system will try to undo our last do before applying the new changes +static void OnUpdate (GtkWidget *widget, gpointer data) +{ + if (!g_bListenChanged) + return; + + if (OnlyPatchesSelected()) + { + //++timo possible bug or misfeature in our gtk_MessageBox here.. +// gtk_MessageBox("The surface inspector doesn't work for patches, use the patch inspector instead (Shift+S)", "Surface Inspector", MB_OK ); + Sys_Printf("The surface inspector doesn't work for patches, use the patch inspector instead (Shift+S)\n"); + return; + } + + // avoid long delays on slow computers + while (gtk_events_pending ()) + gtk_main_iteration (); + + g_dlgSurface.GetTexMods (); + Sys_UpdateWindows(W_CAMERA); +} + +// reflect the current changes in the views, and make sure +// the changes are stored in the undo. +static void OnApply (GtkWidget *widget, gpointer data) +{ + if (!g_bListenChanged) + return; + + g_dlgSurface.GetTexMods (); + g_dlgSurface.m_nUndoId = 0; // that way we are sure we won't call undo + Sys_UpdateWindows(W_CAMERA); +} + +// we use OnTextureKey to detect when the user edits something in the texture widget +// in which case next 'Enter' will be interpreted as a OnApply instead of a OnDone +static gint OnTextureKey (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ +#ifdef DBG_SI + Sys_Printf("OnTextureKey\n"); +#endif + if (event->keyval != GDK_Return) + g_dlgSurface.m_bEditingTextureWidget = true; + return FALSE; +} + +static void OnCancel(GtkWidget *widget, gpointer data) +{ + g_qeglobals.d_texturewin.texdef = g_old_texdef; + // cancel the last do if we own it + if (g_dlgSurface.m_nUndoId == Undo_GetUndoId()) + { +#ifdef DBG_SI + Sys_Printf("OnCancel calling Undo_Undo\n"); +#endif + g_bListenUpdate = false; + Undo_Undo(); + g_bListenUpdate = true; + g_dlgSurface.m_nUndoId = 0; + } + g_dlgSurface.HideDlg (); +} + +static gint OnDialogKey (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ + if (g_surfwin) + { + if (event->keyval == GDK_Return) + { + if (g_dlgSurface.m_bEditingTextureWidget) + { + OnApply (NULL, NULL); + g_dlgSurface.m_bEditingTextureWidget = false; + } + else + { + OnDone (NULL, NULL); + } + return TRUE; + } + if (event->keyval == GDK_Escape) + { + OnCancel (NULL, NULL); + return TRUE; + } + } + return FALSE; +} + +// the widget can be one of hshift, vshift, hscale, vscale, rotate +// we use the g_bListenChanged flag to ignore when changing stuff ourselves +static void OnIncrementChanged(GtkWidget *widget, gpointer data) +{ + if (!g_bListenChanged) + return; + +#ifdef DBG_SI + Sys_Printf("OnIncrementChanged\n"); +#endif + + gfloat val = 0; + sscanf( gtk_entry_get_text (GTK_ENTRY (widget)), "%g", &val); + // now push it into the appropriate spin button + GtkAdjustment * adjust; + if (widget == g_dlgSurface.GetDlgWidget ("hshift_inc")) + { + l_pIncrement->shift[0] = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("hshift"))); + adjust->step_increment = l_pIncrement->shift[0]; + } + else if (widget == g_dlgSurface.GetDlgWidget ("vshift_inc")) + { + l_pIncrement->shift[1] = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("vshift"))); + adjust->step_increment = l_pIncrement->shift[1]; + } + else if (widget == g_dlgSurface.GetDlgWidget ("hscale_inc")) + { + l_pIncrement->scale[0] = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("hscale"))); + adjust->step_increment = l_pIncrement->scale[0]; + } + else if (widget == g_dlgSurface.GetDlgWidget ("vscale_inc")) + { + l_pIncrement->scale[1] = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("vscale"))); + adjust->step_increment = l_pIncrement->scale[1]; + } + else if (widget == g_dlgSurface.GetDlgWidget ("rotate_inc")) + { + l_pIncrement->rotate = val; + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("rotate"))); + adjust->step_increment = l_pIncrement->rotate; + } +} // make the shift increments match the grid settings // the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size // this depends on a scale value if you have selected a particular texture on which you want it to work: // we move the textures in pixels, not world units. (i.e. increment values are in pixel) -// depending on the texture scale it doesn't take the same amount of pixels to move of GetGridSize() +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize // increment * scale = gridsize // hscale and vscale are optional parameters, if they are zero they will be set to the default scale // NOTE: the default scale depends if you are using BP mode or regular. @@ -414,746 +364,545 @@ si_globals_t g_si_globals; // see fenris #2810 void DoSnapTToGrid(float hscale, float vscale) { - g_si_globals.shift[0] = static_cast(float_to_integer(static_cast(GetGridSize()) / hscale)); - g_si_globals.shift[1] = static_cast(float_to_integer(static_cast(GetGridSize()) / vscale)); - getSurfaceInspector().queueDraw(); -} - -void SurfaceInspector_GridChange() -{ - if (g_si_globals.m_bSnapTToGrid) - DoSnapTToGrid(Texdef_getDefaultTextureScale(), Texdef_getDefaultTextureScale()); + if (hscale == 0.0f) + { + (g_qeglobals.m_bBrushPrimitMode) ? hscale = 1.0f : hscale = 0.5f; + } + if (vscale == 0.0f) + { + (g_qeglobals.m_bBrushPrimitMode) ? vscale = 1.0f : vscale = 0.5f; + } +#ifdef _DEBUG + Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale); +#endif + l_pIncrement->shift[0] = (int) ( (float)g_qeglobals.d_gridsize / hscale ); + l_pIncrement->shift[1] = (int) ( (float)g_qeglobals.d_gridsize / vscale ); + // now some update work + // FIXME: doesn't look good here, seems to be called several times + g_dlgSurface.SetTexMods(); } // make the shift increments match the grid settings // the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size // this depends on the current texture scale used? // we move the textures in pixels, not world units. (i.e. increment values are in pixel) -// depending on the texture scale it doesn't take the same amount of pixels to move of GetGridSize() +// depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize // increment * scale = gridsize static void OnBtnMatchGrid(GtkWidget *widget, gpointer data) { float hscale, vscale; - hscale = static_cast(gtk_spin_button_get_value_as_float(getSurfaceInspector().m_hscaleIncrement.m_spin)); - vscale = static_cast(gtk_spin_button_get_value_as_float(getSurfaceInspector().m_vscaleIncrement.m_spin)); - + hscale = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("hscale"))); + vscale = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (g_dlgSurface.GetDlgWidget ("vscale"))); if (hscale == 0.0f || vscale == 0.0f) { - globalOutputStream() << "ERROR: unexpected scale == 0.0f\n"; + Sys_Printf("ERROR: unexpected scale == 0.0f\n"); return; } - DoSnapTToGrid (hscale, vscale); } +void UpdateSurfaceDialog() +{ + if (!g_bListenUpdate) + return; + + g_SurfaceTable.m_pfnUpdateSurfaceDialog(); +} + // DoSurface will always try to show the surface inspector // or update it because something new has been selected -// Shamus: It does get called when the SI is hidden, but not when you select something new. ;-) void DoSurface (void) { - if(getSurfaceInspector().GetWidget() == 0) - { - getSurfaceInspector().Create(); - - } - getSurfaceInspector().Update(); - getSurfaceInspector().importData(); - getSurfaceInspector().ShowDlg(); +#ifdef DBG_SI + Sys_Printf("DoSurface\n"); +#endif + g_SurfaceTable.m_pfnDoSurface(); + return; } -void SurfaceInspector_toggleShown() +void ToggleSurface() { - if (getSurfaceInspector().visible()) - { - getSurfaceInspector().HideDlg(); - } - else - { - DoSurface(); - } + g_SurfaceTable.m_pfnToggleSurface(); + return; } -void SurfaceInspector_FitTexture() +// NOTE: will raise and show the Surface inspector and exec fit for patches and brushes +void SurfaceDlgFitAll() { - UndoableCommand undo("textureAutoFit"); - Select_FitTexture(getSurfaceInspector().m_fitHorizontal, getSurfaceInspector().m_fitVertical); + g_SurfaceTable.m_pfnSurfaceDlgFitAll(); + return; } static void OnBtnPatchdetails(GtkWidget *widget, gpointer data) { - Scene_PatchCapTexture_Selected(GlobalSceneGraph()); + Patch_NaturalizeSelected(true); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchnatural(GtkWidget *widget, gpointer data) { - Scene_PatchNaturalTexture_Selected(GlobalSceneGraph()); + Patch_NaturalizeSelected(); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchreset(GtkWidget *widget, gpointer data) { float fx, fy; - if (DoTextureLayout (&fx, &fy) == eIDOK) - { - Scene_PatchTileTexture_Selected(GlobalSceneGraph(), fx, fy); - } + if (DoTextureLayout (&fx, &fy) == IDOK) + Patch_ResetTexturing (fx, fy); + Sys_UpdateWindows(W_ALL); } static void OnBtnPatchFit(GtkWidget *widget, gpointer data) { - Scene_PatchTileTexture_Selected(GlobalSceneGraph(), 1, 1); + Patch_ResetTexturing(1.0, 1.0); + Sys_UpdateWindows(W_ALL); } static void OnBtnAxial(GtkWidget *widget, gpointer data) { -//globalOutputStream() << "--> [OnBtnAxial]...\n"; - UndoableCommand undo("textureDefault"); - TextureProjection projection; -//globalOutputStream() << " TexDef_Construct_Default()...\n"; - TexDef_Construct_Default(projection); -//globalOutputStream() << " Select_SetTexdef()...\n"; - -#if TEXTOOL_ENABLED - - //Shamus: - if (g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) - { - // Scale up texture width/height if in BP mode... -//NOTE: This may not be correct any more! :-P - if (!g_SelectedFaceInstances.empty()) - { - Face & face = g_SelectedFaceInstances.last().getFace(); - float x = face.getShader().m_state->getTexture().width; - float y = face.getShader().m_state->getTexture().height; - projection.m_brushprimit_texdef.coords[0][0] /= x; - projection.m_brushprimit_texdef.coords[0][1] /= y; - projection.m_brushprimit_texdef.coords[1][0] /= x; - projection.m_brushprimit_texdef.coords[1][1] /= y; - } - } -#endif - - Select_SetTexdef(projection); + Select_SetTexture (&g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, true); + g_dlgSurface.SetTexMods(); + Sys_UpdateWindows(W_ALL); } static void OnBtnFaceFit(GtkWidget *widget, gpointer data) { - getSurfaceInspector().exportData(); - SurfaceInspector_FitTexture(); -} - -typedef const char* FlagName; - -const FlagName surfaceflagNamesDefault[32] = { - "surf1", - "surf2", - "surf3", - "surf4", - "surf5", - "surf6", - "surf7", - "surf8", - "surf9", - "surf10", - "surf11", - "surf12", - "surf13", - "surf14", - "surf15", - "surf16", - "surf17", - "surf18", - "surf19", - "surf20", - "surf21", - "surf22", - "surf23", - "surf24", - "surf25", - "surf26", - "surf27", - "surf28", - "surf29", - "surf30", - "surf31", - "surf32" -}; - -const FlagName contentflagNamesDefault[32] = { - "cont1", - "cont2", - "cont3", - "cont4", - "cont5", - "cont6", - "cont7", - "cont8", - "cont9", - "cont10", - "cont11", - "cont12", - "cont13", - "cont14", - "cont15", - "cont16", - "cont17", - "cont18", - "cont19", - "cont20", - "cont21", - "cont22", - "cont23", - "cont24", - "cont25", - "cont26", - "cont27", - "cont28", - "cont29", - "cont30", - "cont31", - "cont32" -}; - -const char* getSurfaceFlagName(std::size_t bit) -{ - const char* value = g_pGameDescription->getKeyValue(surfaceflagNamesDefault[bit]); - if(string_empty(value)) + g_dlgSurface.UpdateData(TRUE); + if (g_ptrSelectedFaces.GetSize() == 0) { - return surfaceflagNamesDefault[bit]; + brush_t *b; + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (face_t* pFace = b->brush_faces; pFace; pFace = pFace->next) + { + g_ptrSelectedFaces.Add(pFace); + g_ptrSelectedFaceBrushes.Add(b); + } + } + Select_FitTexture(g_dlgSurface.m_nHeight, g_dlgSurface.m_nWidth); + g_dlgSurface.SetTexMods(); + g_ptrSelectedFaces.RemoveAll(); } - return value; -} - -const char* getContentFlagName(std::size_t bit) -{ - const char* value = g_pGameDescription->getKeyValue(contentflagNamesDefault[bit]); - if(string_empty(value)) + else { - return contentflagNamesDefault[bit]; + Select_FitTexture(g_dlgSurface.m_nHeight, g_dlgSurface.m_nWidth); + g_dlgSurface.SetTexMods(); } - return value; + Sys_UpdateWindows(W_ALL); } - // ============================================================================= -// SurfaceInspector class +// SurfaceDialog class -guint togglebutton_connect_toggled(GtkToggleButton* button, const Callback& callback) +SurfaceDlg::SurfaceDlg () { - return g_signal_connect_swapped(G_OBJECT(button), "toggled", G_CALLBACK(callback.getThunk()), callback.getEnvironment()); + m_nHeight = 1; + m_nWidth = 1; + m_nUndoId = 0; } -GtkWindow* SurfaceInspector::BuildDialog() +void SurfaceDlg::ShowDlg() { - GtkWindow* window = create_floating_window("Surface Inspector", m_parent); + Dialog::ShowDlg(); + if(GetWidget() == NULL) + Create(); + g_surfwin = GetWidget (); +} +void SurfaceDlg::HideDlg() +{ + g_surfwin = NULL; + Dialog::HideDlg(); +} - m_positionTracker.connect(window); +GtkWidget* SurfaceDlg::GetWidget() +{ + return g_SurfaceTable.m_pfnGet_SI_Module_Widget(); +} - global_accel_connect_window(window); +// set default values for increments (shift scale and rot) +// this is called by the prefs code if can't find the values +void SurfaceDlg::InitDefaultIncrement(texdef_t *tex) +{ + tex->SetName("foo"); + tex->shift[0] = 8; + tex->shift[1] = 8; + tex->scale[0] = 0.25; + tex->scale[1] = 0.25; + tex->rotate = 10; +} - window_connect_focus_in_clear_focus_widget(window); +void SurfaceDlg::BuildDialog () +{ + GtkWidget *dlg, *vbox, *hbox2, *frame, *table, *label; + GtkWidget *button, *entry, *spin; + + dlg = m_pWidget; + + load_window_pos (dlg, g_PrefsDlg.mWindowInfo.posSurfaceWnd); + + gtk_window_set_title (GTK_WINDOW (dlg), "Surface inspector"); + //g_signal_connect (G_OBJECT (dlg), "delete_event", G_CALLBACK (OnCancel), NULL); + // we catch 'Enter' and interpret is as OnDone + gtk_signal_connect (GTK_OBJECT (dlg), "key_press_event", GTK_SIGNAL_FUNC (OnDialogKey), NULL); + gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (g_pParentWnd->m_pWidget)); + + // replaced by only the vbox: + vbox = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (dlg), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0); + + label = gtk_label_new ("Texture"); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, TRUE, 0); + + entry = gtk_entry_new (); + gtk_signal_connect (GTK_OBJECT (entry), "key_press_event", GTK_SIGNAL_FUNC (OnTextureKey), NULL); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (hbox2), entry, TRUE, TRUE, 0); + g_object_set_data (G_OBJECT (m_pWidget), "texture", entry); + +// table = gtk_table_new (5, 4, FALSE); + table = gtk_table_new (6, 4, FALSE); + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new ("Horizontal shift"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -8192, 8192, 2, 8, 8)), 0, 0); + g_object_set_data (G_OBJECT (dlg), "hshift", spin); + gtk_signal_connect (GTK_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin))), "value_changed", + GTK_SIGNAL_FUNC (OnUpdate), NULL); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + entry = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "hshift_inc", entry); + gtk_signal_connect (GTK_OBJECT (entry), "changed", + GTK_SIGNAL_FUNC (OnIncrementChanged), NULL); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); - { - // replaced by only the vbox: - GtkWidget* vbox = gtk_vbox_new (FALSE, 5); - gtk_widget_show (vbox); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); + label = gtk_label_new ("Vertical shift"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - { - GtkWidget* hbox2 = gtk_hbox_new (FALSE, 5); - gtk_widget_show (hbox2); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox2), FALSE, FALSE, 0); + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -8192, 8192, 2, 8, 8)), 0, 0); + g_object_set_data (G_OBJECT (dlg), "vshift", spin); + gtk_signal_connect (GTK_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin))), "value_changed", + GTK_SIGNAL_FUNC (OnUpdate), NULL); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + entry = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "vshift_inc", entry); + gtk_signal_connect (GTK_OBJECT (entry), "changed", + GTK_SIGNAL_FUNC (OnIncrementChanged), NULL); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); - { - GtkWidget* label = gtk_label_new ("Texture"); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, TRUE, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(hbox2), GTK_WIDGET(entry), TRUE, TRUE, 0); - m_texture = entry; - m_textureEntry.connect(entry); - GlobalTextureEntryCompletion::instance().connect(entry); - } - } + label = gtk_label_new ("Horizontal stretch"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -1000, 1000, 1, 10, 10)), 0, 0); + g_object_set_data (G_OBJECT (dlg), "hscale", spin); + gtk_signal_connect (GTK_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin))), "value_changed", + GTK_SIGNAL_FUNC (OnUpdate), NULL); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); - { - GtkWidget* table = gtk_table_new (6, 4, FALSE); - gtk_widget_show (table); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), FALSE, FALSE, 0); - gtk_table_set_row_spacings(GTK_TABLE(table), 5); - gtk_table_set_col_spacings(GTK_TABLE(table), 5); - { - GtkWidget* label = gtk_label_new ("Horizontal shift"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 2, 8, 8)), 0, 2)); - m_hshiftIncrement.m_spin = spin; - m_hshiftSpinner.connect(spin); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach (GTK_TABLE(table), GTK_WIDGET(spin), 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 60, -2); - } - { - GtkWidget* label = gtk_label_new ("Step"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(entry), 3, 4, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - m_hshiftIncrement.m_entry = entry; - m_hshiftEntry.connect(entry); - } - { - GtkWidget* label = gtk_label_new ("Vertical shift"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 2, 8, 8)), 0, 2)); - m_vshiftIncrement.m_spin = spin; - m_vshiftSpinner.connect(spin); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(spin), 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 60, -2); - } - { - GtkWidget* label = gtk_label_new ("Step"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(entry), 3, 4, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - m_vshiftIncrement.m_entry = entry; - m_vshiftEntry.connect(entry); - } - { - GtkWidget* label = gtk_label_new ("Horizontal stretch"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 2, 8, 8)), 0, 5)); - m_hscaleIncrement.m_spin = spin; - m_hscaleSpinner.connect(spin); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(spin), 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 60, -2); - } - { - GtkWidget* label = gtk_label_new ("Step"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 2, 3); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(entry), 3, 4, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 2, 3); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - m_hscaleIncrement.m_entry = entry; - m_hscaleEntry.connect(entry); - } - { - GtkWidget* label = gtk_label_new ("Vertical stretch"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 2, 8, 8)), 0, 5)); - m_vscaleIncrement.m_spin = spin; - m_vscaleSpinner.connect(spin); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(spin), 1, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 60, -2); - } - { - GtkWidget* label = gtk_label_new ("Step"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(entry), 3, 4, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - m_vscaleIncrement.m_entry = entry; - m_vscaleEntry.connect(entry); - } - { - GtkWidget* label = gtk_label_new ("Rotate"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkSpinButton* spin = GTK_SPIN_BUTTON(gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, -8192, 8192, 2, 8, 8)), 0, 2)); - m_rotateIncrement.m_spin = spin; - m_rotateSpinner.connect(spin); - gtk_widget_show(GTK_WIDGET(spin)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(spin), 1, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(spin), 60, -2); - gtk_spin_button_set_wrap(spin, TRUE); - } - { - GtkWidget* label = gtk_label_new ("Step"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(entry), 3, 4, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize(GTK_WIDGET(entry), 50, -2); - m_rotateIncrement.m_entry = entry; - m_rotateEntry.connect(entry); - } - { - // match grid button - GtkWidget* button = gtk_button_new_with_label ("Match Grid"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 2, 4, 5, 6, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(OnBtnMatchGrid), 0); - } - } + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 2, 3); + + entry = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "hscale_inc", entry); + gtk_signal_connect (GTK_OBJECT (entry), "changed", + GTK_SIGNAL_FUNC (OnIncrementChanged), NULL); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 2, 3); + gtk_widget_set_usize (entry, 50, -2); - { - GtkWidget* frame = gtk_frame_new ("Texturing"); - gtk_widget_show (frame); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), FALSE, FALSE, 0); - { - GtkWidget* table = gtk_table_new (4, 4, FALSE); - gtk_widget_show (table); - gtk_container_add (GTK_CONTAINER (frame), table); - gtk_table_set_row_spacings(GTK_TABLE(table), 5); - gtk_table_set_col_spacings(GTK_TABLE(table), 5); - gtk_container_set_border_width (GTK_CONTAINER (table), 5); - { - GtkWidget* label = gtk_label_new ("Brush"); - gtk_widget_show (label); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new ("Patch"); - gtk_widget_show (label); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new ("Width"); - gtk_widget_show (label); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* label = gtk_label_new ("Height"); - gtk_widget_show (label); - gtk_table_attach(GTK_TABLE(table), label, 3, 4, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - } - { - GtkWidget* button = gtk_button_new_with_label ("Axial"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnAxial), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* button = gtk_button_new_with_label ("Fit"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnFaceFit), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* button = gtk_button_new_with_label ("CAP"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnPatchdetails), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* button = gtk_button_new_with_label ("Set..."); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 1, 2, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnPatchreset), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* button = gtk_button_new_with_label ("Natural"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 2, 3, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnPatchnatural), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* button = gtk_button_new_with_label ("Fit"); - gtk_widget_show (button); - gtk_table_attach(GTK_TABLE(table), button, 3, 4, 3, 4, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(OnBtnPatchFit), 0); - gtk_widget_set_usize (button, 60, -2); - } - { - GtkWidget* spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 1 << 16, 1, 10, 10)), 0, 6); - gtk_widget_show (spin); - gtk_table_attach(GTK_TABLE(table), spin, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize (spin, 60, -2); - AddDialogData(*GTK_SPIN_BUTTON(spin), m_fitHorizontal); - } - { - GtkWidget* spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 1 << 16, 1, 10, 10)), 0, 6); - gtk_widget_show (spin); - gtk_table_attach(GTK_TABLE(table), spin, 3, 4, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_usize (spin, 60, -2); - AddDialogData(*GTK_SPIN_BUTTON(spin), m_fitVertical); - } - } - } - if(!string_empty(g_pGameDescription->getKeyValue("si_flags"))) - { - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Surface Flags")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox3 = GTK_VBOX(gtk_vbox_new(FALSE, 4)); - //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); - gtk_widget_show(GTK_WIDGET(vbox3)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox3)); - { - GtkTable* table = GTK_TABLE(gtk_table_new(8, 4, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 0); - gtk_table_set_col_spacings(table, 0); + label = gtk_label_new ("Vertical stretch"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - GtkCheckButton** p = m_surfaceFlags; + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -1000, 1000, 1, 10, 10)), 0, 0); + g_object_set_data (G_OBJECT (dlg), "vscale", spin); + gtk_signal_connect (GTK_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin))), "value_changed", + GTK_SIGNAL_FUNC (OnUpdate), NULL); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + entry = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "vscale_inc", entry); + gtk_signal_connect (GTK_OBJECT (entry), "changed", + GTK_SIGNAL_FUNC (OnIncrementChanged), NULL); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); - for(int c = 0; c != 4; ++c) - { - for(int r = 0; r != 8; ++r) - { - GtkCheckButton* check = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(getSurfaceFlagName(c * 8 + r))); - gtk_widget_show(GTK_WIDGET(check)); - gtk_table_attach(table, GTK_WIDGET(check), c, c+1, r, r+1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - *p++ = check; - guint handler_id = togglebutton_connect_toggled(GTK_TOGGLE_BUTTON(check), ApplyFlagsCaller(*this)); - g_object_set_data(G_OBJECT(check), "handler", gint_to_pointer(handler_id)); - } - } - } - } - } - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Content Flags")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox3 = GTK_VBOX(gtk_vbox_new(FALSE, 4)); - //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); - gtk_widget_show(GTK_WIDGET(vbox3)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox3)); - { + label = gtk_label_new ("Rotate"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - GtkTable* table = GTK_TABLE(gtk_table_new(8, 4, FALSE)); - gtk_widget_show(GTK_WIDGET(table)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(table), TRUE, TRUE, 0); - gtk_table_set_row_spacings(table, 0); - gtk_table_set_col_spacings(table, 0); + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -360, 360, 1, 10, 10)), 1, 0); + g_object_set_data (G_OBJECT (dlg), "rotate", spin); + gtk_signal_connect (GTK_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin))), "value_changed", + GTK_SIGNAL_FUNC (OnUpdate), NULL); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spin), TRUE); - GtkCheckButton** p = m_contentFlags; + label = gtk_label_new ("Step"); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + entry = gtk_entry_new (); + g_object_set_data (G_OBJECT (dlg), "rotate_inc", entry); + gtk_signal_connect (GTK_OBJECT (entry), "changed", + GTK_SIGNAL_FUNC (OnIncrementChanged), NULL); + gtk_widget_show (entry); + gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (entry, 50, -2); - for(int c = 0; c != 4; ++c) - { - for(int r = 0; r != 8; ++r) - { - GtkCheckButton* check = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(getContentFlagName(c * 8 + r))); - gtk_widget_show(GTK_WIDGET(check)); - gtk_table_attach(table, GTK_WIDGET(check), c, c+1, r, r+1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(0), 0, 0); - *p++ = check; - guint handler_id = togglebutton_connect_toggled(GTK_TOGGLE_BUTTON(check), ApplyFlagsCaller(*this)); - g_object_set_data(G_OBJECT(check), "handler", gint_to_pointer(handler_id)); - } - } + // match grid button + button = gtk_button_new_with_label ("Match Grid"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 2, 4, 5, 6, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnMatchGrid), NULL); - // not allowed to modify detail flag using Surface Inspector - gtk_widget_set_sensitive(GTK_WIDGET(m_contentFlags[BRUSH_DETAIL_FLAG]), FALSE); - } - } - } - { - GtkFrame* frame = GTK_FRAME(gtk_frame_new("Value")); - gtk_widget_show(GTK_WIDGET(frame)); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), TRUE, TRUE, 0); - { - GtkVBox* vbox3 = GTK_VBOX(gtk_vbox_new(FALSE, 4)); - gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); - gtk_widget_show(GTK_WIDGET(vbox3)); - gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(vbox3)); + frame = gtk_frame_new ("Texturing"); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); - { - GtkEntry* entry = GTK_ENTRY(gtk_entry_new()); - gtk_widget_show(GTK_WIDGET(entry)); - gtk_box_pack_start(GTK_BOX(vbox3), GTK_WIDGET(entry), TRUE, TRUE, 0); - m_valueEntryWidget = entry; - m_valueEntry.connect(entry); - } - } - } - } + table = gtk_table_new (4, 4, FALSE); + gtk_widget_show (table); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + gtk_table_set_col_spacings (GTK_TABLE (table), 5); + gtk_container_set_border_width (GTK_CONTAINER (table), 5); -#if TEXTOOL_ENABLED - if(g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES) -// Shamus: Textool goodies... - { - GtkWidget * frame = gtk_frame_new("Textool"); - gtk_widget_show(frame); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), FALSE, FALSE, 0); - { - //Prolly should make this a member or global var, so the SI can draw on it... - TexTool::g_textoolWin = glwidget_new(FALSE); - // --> Dunno, but this stuff may be necessary... (Looks like it!) - gtk_widget_ref(TexTool::g_textoolWin); - gtk_widget_set_events(TexTool::g_textoolWin, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK); - GTK_WIDGET_SET_FLAGS(TexTool::g_textoolWin, GTK_CAN_FOCUS); - // <-- end stuff... - gtk_widget_show(TexTool::g_textoolWin); - gtk_widget_set_usize(TexTool::g_textoolWin, -1, 240); //Yeah! - gtk_container_add(GTK_CONTAINER(frame), TexTool::g_textoolWin); + label = gtk_label_new ("Brush"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - g_signal_connect(G_OBJECT(TexTool::g_textoolWin), "size_allocate", G_CALLBACK(TexTool::size_allocate), NULL); - g_signal_connect(G_OBJECT(TexTool::g_textoolWin), "expose_event", G_CALLBACK(TexTool::expose), NULL); - g_signal_connect(G_OBJECT(TexTool::g_textoolWin), "button_press_event", G_CALLBACK(TexTool::button_press), NULL); - g_signal_connect(G_OBJECT(TexTool::g_textoolWin), "button_release_event", G_CALLBACK(TexTool::button_release), NULL); - g_signal_connect(G_OBJECT(TexTool::g_textoolWin), "motion_notify_event", G_CALLBACK(TexTool::motion), NULL); - } - { - GtkWidget * hbox = gtk_hbox_new(FALSE, 5); - gtk_widget_show(hbox); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, FALSE, 0); - // Checkboxes go here... (Flip X/Y) - GtkWidget * flipX = gtk_check_button_new_with_label("Flip X axis"); - GtkWidget * flipY = gtk_check_button_new_with_label("Flip Y axis"); - gtk_widget_show(flipX); - gtk_widget_show(flipY); - gtk_box_pack_start(GTK_BOX(hbox), flipX, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox), flipY, FALSE, FALSE, 0); - -//Instead of this, we probably need to create a vbox to put into the frame, then the -//window, then the hbox. !!! FIX !!! -// gtk_container_add(GTK_CONTAINER(frame), hbox); + label = gtk_label_new ("Patch"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); -//Hmm. Do we really need g_object_set_data? Mebbe not... And we don't! :-) -// g_object_set_data(G_OBJECT(flipX), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipX), "toggled", G_CALLBACK(TexTool::flipX), 0))); -// g_object_set_data(G_OBJECT(flipY), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipY), "toggled", G_CALLBACK(TexTool::flipY), 0))); -//Instead, just do: - g_signal_connect(G_OBJECT(flipX), "toggled", G_CALLBACK(TexTool::flipX), NULL); - g_signal_connect(G_OBJECT(flipY), "toggled", G_CALLBACK(TexTool::flipY), NULL); - } - } + label = gtk_label_new ("Width"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label = gtk_label_new ("Height"); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 3, 4, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + button = gtk_button_new_with_label ("Axial"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnAxial), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Fit"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnFaceFit), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("CAP"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnPatchdetails), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Set..."); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnPatchreset), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Natural"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnPatchnatural), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Fit"); + gtk_widget_show (button); + gtk_table_attach (GTK_TABLE (table), button, 3, 4, 3, 4, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnBtnPatchFit), NULL); + gtk_widget_set_usize (button, 60, -2); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 32, 1, 10, 10)), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + AddDialogData (spin, &m_nWidth, DLG_SPIN_INT); + + spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 32, 1, 10, 10)), 1, 0); + gtk_widget_show (spin); + gtk_table_attach (GTK_TABLE (table), spin, 3, 4, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_widget_set_usize (spin, 60, -2); + AddDialogData (spin, &m_nHeight, DLG_SPIN_INT); + + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0); + + button = gtk_button_new_with_label ("Done"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnDone), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Apply"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnApply), NULL); + gtk_widget_set_usize (button, 60, -2); + + button = gtk_button_new_with_label ("Cancel"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnCancel), NULL); + gtk_widget_set_usize (button, 60, -2); + + // that's a bit of trashy stuff from Textool-v2 branch +#ifdef _DEBUG + // FIXME: testing only, scaling in BP mode + button = gtk_button_new_with_label ("Test"); + gtk_widget_show (button); + gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (OnTest), NULL); + gtk_widget_set_usize (button, 60, -2); #endif - } - return window; + // Initialize + SetTexMods (); } /* ============== -Update +SetTexMods Set the fields to the current texdef (i.e. map/texdef -> dialog widgets) if faces selected (instead of brushes) -> will read this face texdef, else current texdef @@ -1161,1290 +910,225 @@ if only patches selected, will read the patch texdef =============== */ -void spin_button_set_value_no_signal(GtkSpinButton* spin, gdouble value) +void SurfaceDlg::SetTexMods() { - guint handler_id = gpointer_to_int(g_object_get_data(G_OBJECT(spin), "handler")); - g_signal_handler_block(G_OBJECT(gtk_spin_button_get_adjustment(spin)), handler_id); - gtk_spin_button_set_value(spin, value); - g_signal_handler_unblock(G_OBJECT(gtk_spin_button_get_adjustment(spin)), handler_id); -} + texdef_t *pt; + brushprimit_texdef_t *bpt; + // local copy if a width=2 height=2 qtetxture_t is needed + brushprimit_texdef_t local_bp; -void spin_button_set_step_increment(GtkSpinButton* spin, gdouble value) -{ - GtkAdjustment* adjust = gtk_spin_button_get_adjustment(spin); - adjust->step_increment = value; -} +#ifdef DBG_SI + Sys_Printf("SurfaceDlg::SetTexMods\n"); +#endif -void SurfaceInspector::Update() -{ - const char * name = SurfaceInspector_GetSelectedShader(); + if (!g_surfwin) + return; - if(shader_is_texture(name)) + if (g_ptrSelectedFaces.GetSize() > 0) { - gtk_entry_set_text(m_texture, shader_get_textureName(name)); + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(0)); + pt = &selFace->texdef; + if (g_qeglobals.m_bBrushPrimitMode) + { + // compute a texture matrix related to the default matrix width=2 height=2 + ConvertTexMatWithQTexture( &selFace->brushprimit_texdef, selFace->d_texture, &local_bp, NULL ); + bpt = &local_bp; + } } else { - gtk_entry_set_text(m_texture, ""); - } - - texdef_t shiftScaleRotate; -//Shamus: This is where we get into trouble--the BP code tries to convert to a "faked" -//shift, rotate & scale values from the brush face, which seems to screw up for some reason. -//!!! FIX !!! -/*globalOutputStream() << "--> SI::Update. About to do ShiftScaleRotate_fromFace()...\n"; -SurfaceInspector_GetSelectedBPTexdef(); -globalOutputStream() << "BP: (" << g_selectedBrushPrimitTexdef.coords[0][0] << ", " << g_selectedBrushPrimitTexdef.coords[0][1] << ")(" - << g_selectedBrushPrimitTexdef.coords[1][0] << ", " << g_selectedBrushPrimitTexdef.coords[1][1] << ")(" - << g_selectedBrushPrimitTexdef.coords[0][2] << ", " << g_selectedBrushPrimitTexdef.coords[1][2] << ") SurfaceInspector::Update\n";//*/ -//Ok, it's screwed up *before* we get here... - ShiftScaleRotate_fromFace(shiftScaleRotate, SurfaceInspector_GetSelectedTexdef()); - - // normalize again to hide the ridiculously high scale values that get created when using texlock - shiftScaleRotate.shift[0] = float_mod(shiftScaleRotate.shift[0], (float)g_selectedShaderSize[0]); - shiftScaleRotate.shift[1] = float_mod(shiftScaleRotate.shift[1], (float)g_selectedShaderSize[1]); - - { - spin_button_set_value_no_signal(m_hshiftIncrement.m_spin, shiftScaleRotate.shift[0]); - spin_button_set_step_increment(m_hshiftIncrement.m_spin, g_si_globals.shift[0]); - entry_set_float(m_hshiftIncrement.m_entry, g_si_globals.shift[0]); - } - - { - spin_button_set_value_no_signal(m_vshiftIncrement.m_spin, shiftScaleRotate.shift[1]); - spin_button_set_step_increment(m_vshiftIncrement.m_spin, g_si_globals.shift[1]); - entry_set_float(m_vshiftIncrement.m_entry, g_si_globals.shift[1]); - } - - { - spin_button_set_value_no_signal(m_hscaleIncrement.m_spin, shiftScaleRotate.scale[0]); - spin_button_set_step_increment(m_hscaleIncrement.m_spin, g_si_globals.scale[0]); - entry_set_float(m_hscaleIncrement.m_entry, g_si_globals.scale[0]); - } - - { - spin_button_set_value_no_signal(m_vscaleIncrement.m_spin, shiftScaleRotate.scale[1]); - spin_button_set_step_increment(m_vscaleIncrement.m_spin, g_si_globals.scale[1]); - entry_set_float(m_vscaleIncrement.m_entry, g_si_globals.scale[1]); - } - - { - spin_button_set_value_no_signal(m_rotateIncrement.m_spin, shiftScaleRotate.rotate); - spin_button_set_step_increment(m_rotateIncrement.m_spin, g_si_globals.rotate); - entry_set_float(m_rotateIncrement.m_entry, g_si_globals.rotate); - } - - if(!string_empty(g_pGameDescription->getKeyValue("si_flags"))) - { - ContentsFlagsValue flags(SurfaceInspector_GetSelectedFlags()); - - entry_set_int(m_valueEntryWidget, flags.m_value); - - for(GtkCheckButton** p = m_surfaceFlags; p != m_surfaceFlags + 32; ++p) + pt = &g_qeglobals.d_texturewin.texdef; + if (g_qeglobals.m_bBrushPrimitMode) { - toggle_button_set_active_no_signal(GTK_TOGGLE_BUTTON(*p), flags.m_surfaceFlags & (1 << (p - m_surfaceFlags))); - } - - for(GtkCheckButton** p = m_contentFlags; p != m_contentFlags + 32; ++p) - { - toggle_button_set_active_no_signal(GTK_TOGGLE_BUTTON(*p), flags.m_contentFlags & (1 << (p - m_contentFlags))); + bpt = &g_qeglobals.d_texturewin.brushprimit_texdef; } } + // brush primitive mode : compute fake shift scale rot representation + if (g_qeglobals.m_bBrushPrimitMode) + TexMatToFakeTexCoords( bpt->coords, m_shift, &m_rotate, m_scale ); + + g_bListenChanged = false; + + if(strncmp(pt->GetName(), "textures/", 9) != 0) + pt->SetName(SHADER_NOT_FOUND); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("texture")), pt->GetName()+9); + + GtkSpinButton *spin; + spin = GTK_SPIN_BUTTON (GetDlgWidget ("hshift")); + gtk_spin_button_set_digits (spin, 2); + if (g_qeglobals.m_bBrushPrimitMode) + gtk_spin_button_set_value (spin, m_shift[0]); + else + gtk_spin_button_set_value (spin, pt->shift[0]); + GtkAdjustment *adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[0]; + char buf[10]; // got into snprintf paranoia after BoundChecker detected a stack overrun +#ifdef _WIN32 + // TTimo: THIS IS UGLY +#define snprintf _snprintf +#endif + snprintf (buf, 10, "%g", l_pIncrement->shift[0]); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("hshift_inc")), buf); + + spin = GTK_SPIN_BUTTON (GetDlgWidget ("vshift")); + gtk_spin_button_set_digits (spin, 2); + if (g_qeglobals.m_bBrushPrimitMode) + gtk_spin_button_set_value (spin, m_shift[1]); + else + gtk_spin_button_set_value (spin, pt->shift[1]); + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->shift[1]; + snprintf (buf, 10, "%g", l_pIncrement->shift[1]); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("vshift_inc")), buf); + + spin = GTK_SPIN_BUTTON (GetDlgWidget ("hscale")); + gtk_spin_button_set_digits (spin, 5); + gtk_spin_button_set_value (spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0]); + + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[0]; + snprintf (buf, 10, "%g", l_pIncrement->scale[0]); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("hscale_inc")), buf); + + spin = GTK_SPIN_BUTTON (GetDlgWidget ("vscale")); + gtk_spin_button_set_digits (spin, 5); + gtk_spin_button_set_value (spin, g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1]); + + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->scale[1]; + snprintf (buf, 10, "%g", l_pIncrement->scale[1]); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("vscale_inc")), buf); + + //++timo compute BProtate as int .. + spin = GTK_SPIN_BUTTON (GetDlgWidget ("rotate")); + gtk_spin_button_set_digits (spin, 2); + gtk_spin_button_set_value (spin, g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate); + + adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin)); + adjust->step_increment = l_pIncrement->rotate; + snprintf (buf, 10, "%g", l_pIncrement->rotate); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("rotate_inc")), buf); + + g_bListenChanged = true; + + // undo tricks: set the undo id to zero so we don't attempt to undo something that does not belong to us + m_nUndoId = 0; + // store the current texdef as our escape route if user hits OnCancel + g_old_texdef = g_qeglobals.d_texturewin.texdef; + // reset the Enter key behaviour flag + m_bEditingTextureWidget = false; } /* ============== -Apply +GetTexMods Reads the fields to get the current texdef (i.e. widgets -> MAP) in brush primitive mode, grab the fake shift scale rot and compute a new texture matrix =============== */ -void SurfaceInspector::ApplyShader() +void SurfaceDlg::GetTexMods() { - StringOutputStream name(256); - name << GlobalTexturePrefix_get() << gtk_entry_get_text(m_texture); + char buffer[1024]; + texdef_t *pt; +#ifdef DBG_SI + Sys_Printf("SurfaceDlg::GetTexMods\n"); +#endif + + if (g_ptrSelectedFaces.GetSize() > 0) + { + //++timo just a test, we disable the undo when working on selected faces + m_nUndoId=0; + face_t *selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(0)); + g_qeglobals.d_texturewin.texdef = selFace->texdef; +#ifdef DBG_SI + Sys_Printf("g_qeglobals.d_texturewin.texdef = selFace->texdef\n"); +#endif + } +// else +// { + pt = &g_qeglobals.d_texturewin.texdef; +#ifdef DBG_SI + Sys_Printf("pt = &g_qeglobals.d_texturewin.texdef\n"); +#endif +// } + + const char* text = gtk_entry_get_text (GTK_ENTRY (GetDlgWidget ("texture"))); + +#ifdef DBG_SI + Sys_Printf("pt->SetName(%s)\n", text ); +#endif + // TTimo: detect and refuse invalid texture names (at least the ones with spaces) - if(!texdef_name_valid(name.c_str())) + if (text[0] <= ' ' || strchr(text, ' ')) { - globalErrorStream() << "invalid texture name '" << name.c_str() << "'\n"; - SurfaceInspector_queueDraw(); - return; + Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text); + pt->SetName(SHADER_NOT_FOUND); + gtk_entry_set_text (GTK_ENTRY (GetDlgWidget ("texture")), pt->GetName()); + } + else + { + strcpy(buffer, "textures/"); + strcpy(buffer+9, text); + pt->SetName(buffer); } - UndoableCommand undo("textureNameSetSelected"); - Select_SetShader(name.c_str()); -} -void SurfaceInspector::ApplyTexdef() -{ - texdef_t shiftScaleRotate; + (g_qeglobals.m_bBrushPrimitMode ? m_shift[0] : pt->shift[0]) = + gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (GetDlgWidget ("hshift"))); + (g_qeglobals.m_bBrushPrimitMode ? m_shift[1] : pt->shift[1]) = + gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (GetDlgWidget ("vshift"))); + (g_qeglobals.m_bBrushPrimitMode ? m_scale[0] : pt->scale[0]) = + gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (GetDlgWidget ("hscale"))); + (g_qeglobals.m_bBrushPrimitMode ? m_scale[1] : pt->scale[1]) = + gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (GetDlgWidget ("vscale"))); + (g_qeglobals.m_bBrushPrimitMode ? m_rotate : pt->rotate) = + gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (GetDlgWidget ("rotate"))); - shiftScaleRotate.shift[0] = static_cast(gtk_spin_button_get_value_as_float(m_hshiftIncrement.m_spin)); - shiftScaleRotate.shift[1] = static_cast(gtk_spin_button_get_value_as_float(m_vshiftIncrement.m_spin)); - shiftScaleRotate.scale[0] = static_cast(gtk_spin_button_get_value_as_float(m_hscaleIncrement.m_spin)); - shiftScaleRotate.scale[1] = static_cast(gtk_spin_button_get_value_as_float(m_vscaleIncrement.m_spin)); - shiftScaleRotate.rotate = static_cast(gtk_spin_button_get_value_as_float(m_rotateIncrement.m_spin)); - - TextureProjection projection; -//Shamus: This is the other place that screws up, it seems, since it doesn't seem to do the -//conversion from the face (I think) and so bogus values end up in the thing... !!! FIX !!! -//This is actually OK. :-P - ShiftScaleRotate_toFace(shiftScaleRotate, projection); - - UndoableCommand undo("textureProjectionSetSelected"); - Select_SetTexdef(projection); -} - -void SurfaceInspector::ApplyFlags() -{ - unsigned int surfaceflags = 0; - for(GtkCheckButton** p = m_surfaceFlags; p != m_surfaceFlags + 32; ++p) + // a local copy of the texture matrix, given for a qtexture_t with width=2 height=2 + brushprimit_texdef_t local_bp; + brushprimit_texdef_t *bpt; + if (g_qeglobals.m_bBrushPrimitMode) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(*p))) + face_t *selFace = NULL; + if (g_ptrSelectedFaces.GetSize() > 0) { - surfaceflags |= (1 << (p - m_surfaceFlags)); - } - } - - unsigned int contentflags = 0; - for(GtkCheckButton** p = m_contentFlags; p != m_contentFlags + 32; ++p) - { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(*p))) - { - contentflags |= (1 << (p - m_contentFlags)); - } - } - - int value = entry_get_int(m_valueEntryWidget); - - UndoableCommand undo("flagsSetSelected"); - Select_SetFlags(ContentsFlagsValue(surfaceflags, contentflags, value, true)); -} - - -void Face_getTexture(Face& face, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags) -{ - shader = face.GetShader(); - face.GetTexdef(projection); - flags = face.getShader().m_flags; -} -typedef Function4 FaceGetTexture; - -void Face_setTexture(Face& face, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags) -{ - face.SetShader(shader); - face.SetTexdef(projection); - face.SetFlags(flags); -} -typedef Function4 FaceSetTexture; - - -void Patch_getTexture(Patch& patch, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags) -{ - shader = patch.GetShader(); - projection = TextureProjection(texdef_t(), brushprimit_texdef_t(), Vector3(0, 0, 0), Vector3(0, 0, 0)); - flags = ContentsFlagsValue(0, 0, 0, false); -} -typedef Function4 PatchGetTexture; - -void Patch_setTexture(Patch& patch, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags) -{ - patch.SetShader(shader); -} -typedef Function4 PatchSetTexture; - - -typedef Callback3 GetTextureCallback; -typedef Callback3 SetTextureCallback; - -struct Texturable -{ - GetTextureCallback getTexture; - SetTextureCallback setTexture; -}; - - -void Face_getClosest(Face& face, SelectionTest& test, SelectionIntersection& bestIntersection, Texturable& texturable) -{ - SelectionIntersection intersection; - face.testSelect(test, intersection); - if(intersection.valid() - && SelectionIntersection_closer(intersection, bestIntersection)) - { - bestIntersection = intersection; - texturable.setTexture = makeCallback3(FaceSetTexture(), face); - texturable.getTexture = makeCallback3(FaceGetTexture(), face); - } -} - - -class OccludeSelector : public Selector -{ - SelectionIntersection& m_bestIntersection; - bool& m_occluded; -public: - OccludeSelector(SelectionIntersection& bestIntersection, bool& occluded) : m_bestIntersection(bestIntersection), m_occluded(occluded) - { - m_occluded = false; - } - void pushSelectable(Selectable& selectable) - { - } - void popSelectable() - { - } - void addIntersection(const SelectionIntersection& intersection) - { - if(SelectionIntersection_closer(intersection, m_bestIntersection)) - { - m_bestIntersection = intersection; - m_occluded = true; - } - } -}; - -class BrushGetClosestFaceVisibleWalker : public scene::Graph::Walker -{ - SelectionTest& m_test; - Texturable& m_texturable; - mutable SelectionIntersection m_bestIntersection; -public: - BrushGetClosestFaceVisibleWalker(SelectionTest& test, Texturable& texturable) : m_test(test), m_texturable(texturable) - { - } - bool pre(const scene::Path& path, scene::Instance& instance) const - { - if(path.top().get().visible()) - { - BrushInstance* brush = Instance_getBrush(instance); - if(brush != 0) - { - m_test.BeginMesh(brush->localToWorld()); - - for(Brush::const_iterator i = brush->getBrush().begin(); i != brush->getBrush().end(); ++i) - { - Face_getClosest(*(*i), m_test, m_bestIntersection, m_texturable); - } - } - else - { - SelectionTestable* selectionTestable = Instance_getSelectionTestable(instance); - if(selectionTestable) - { - bool occluded; - OccludeSelector selector(m_bestIntersection, occluded); - selectionTestable->testSelect(selector, m_test); - if(occluded) - { - Patch* patch = Node_getPatch(path.top()); - if(patch != 0) - { - m_texturable.setTexture = makeCallback3(PatchSetTexture(), *patch); - m_texturable.getTexture = makeCallback3(PatchGetTexture(), *patch); - } - else - { - m_texturable = Texturable(); - } - } - } - } - } - return true; - } -}; - -Texturable Scene_getClosestTexturable(scene::Graph& graph, SelectionTest& test) -{ - Texturable texturable; - graph.traverse(BrushGetClosestFaceVisibleWalker(test, texturable)); - return texturable; -} - -bool Scene_getClosestTexture(scene::Graph& graph, SelectionTest& test, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags) -{ - Texturable texturable = Scene_getClosestTexturable(graph, test); - if(texturable.getTexture != GetTextureCallback()) - { - texturable.getTexture(shader, projection, flags); - return true; - } - return false; -} - -void Scene_setClosestTexture(scene::Graph& graph, SelectionTest& test, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags) -{ - Texturable texturable = Scene_getClosestTexturable(graph, test); - if(texturable.setTexture != SetTextureCallback()) - { - texturable.setTexture(shader, projection, flags); - } -} - - -class FaceTexture -{ -public: - TextureProjection m_projection; - ContentsFlagsValue m_flags; -}; - -FaceTexture g_faceTextureClipboard; - -void FaceTextureClipboard_setDefault() -{ - g_faceTextureClipboard.m_flags = ContentsFlagsValue(0, 0, 0, false); - TexDef_Construct_Default(g_faceTextureClipboard.m_projection); -} - -void TextureClipboard_textureSelected(const char* shader) -{ - FaceTextureClipboard_setDefault(); -} - -class TextureBrowser; -extern TextureBrowser g_TextureBrowser; -void TextureBrowser_SetSelectedShader(TextureBrowser& textureBrowser, const char* shader); -const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser); - -void Scene_copyClosestTexture(SelectionTest& test) -{ - CopiedString shader; - if(Scene_getClosestTexture(GlobalSceneGraph(), test, shader, g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags)) - { - TextureBrowser_SetSelectedShader(g_TextureBrowser, shader.c_str()); - } -} - -void Scene_applyClosestTexture(SelectionTest& test) -{ - UndoableCommand command("facePaintTexture"); - - Scene_setClosestTexture(GlobalSceneGraph(), test, TextureBrowser_GetSelectedShader(g_TextureBrowser), g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags); - - SceneChangeNotify(); -} - - - - - -void SelectedFaces_copyTexture() -{ - if(!g_SelectedFaceInstances.empty()) - { - Face& face = g_SelectedFaceInstances.last().getFace(); - face.GetTexdef(g_faceTextureClipboard.m_projection); - g_faceTextureClipboard.m_flags = face.getShader().m_flags; - - TextureBrowser_SetSelectedShader(g_TextureBrowser, face.getShader().getShader()); - } -} - -void FaceInstance_pasteTexture(FaceInstance& faceInstance) -{ - faceInstance.getFace().SetTexdef(g_faceTextureClipboard.m_projection); - faceInstance.getFace().SetShader(TextureBrowser_GetSelectedShader(g_TextureBrowser)); - faceInstance.getFace().SetFlags(g_faceTextureClipboard.m_flags); - SceneChangeNotify(); -} - -bool SelectedFaces_empty() -{ - return g_SelectedFaceInstances.empty(); -} - -void SelectedFaces_pasteTexture() -{ - UndoableCommand command("facePasteTexture"); - g_SelectedFaceInstances.foreach(FaceInstance_pasteTexture); -} - - - -void SurfaceInspector_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox("", "Surface Inspector Increments Match Grid", g_si_globals.m_bSnapTToGrid); -} -void SurfaceInspector_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Surface Inspector", "Surface Inspector Preferences")); - SurfaceInspector_constructPreferences(page); -} -void SurfaceInspector_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - -void SurfaceInspector_registerCommands() -{ - GlobalCommands_insert("FitTexture", FreeCaller(), Accelerator('B', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("SurfaceInspector", FreeCaller(), Accelerator('S')); - - GlobalCommands_insert("FaceCopyTexture", FreeCaller()); - GlobalCommands_insert("FacePasteTexture", FreeCaller()); -} - - -#include "preferencesystem.h" - - -void SurfaceInspector_Construct() -{ - g_SurfaceInspector = new SurfaceInspector; - - SurfaceInspector_registerCommands(); - - FaceTextureClipboard_setDefault(); - - GlobalPreferenceSystem().registerPreference("SurfaceWnd", getSurfaceInspector().m_importPosition, getSurfaceInspector().m_exportPosition); - GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Scale1", FloatImportStringCaller(g_si_globals.scale[0]), FloatExportStringCaller(g_si_globals.scale[0])); - GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Scale2", FloatImportStringCaller(g_si_globals.scale[1]), FloatExportStringCaller(g_si_globals.scale[1])); - GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Shift1", FloatImportStringCaller(g_si_globals.shift[0]), FloatExportStringCaller(g_si_globals.shift[0])); - GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Shift2", FloatImportStringCaller(g_si_globals.shift[1]), FloatExportStringCaller(g_si_globals.shift[1])); - GlobalPreferenceSystem().registerPreference("SI_SurfaceTexdef_Rotate", FloatImportStringCaller(g_si_globals.rotate), FloatExportStringCaller(g_si_globals.rotate)); - GlobalPreferenceSystem().registerPreference("SnapTToGrid", BoolImportStringCaller(g_si_globals.m_bSnapTToGrid), BoolExportStringCaller(g_si_globals.m_bSnapTToGrid)); - - typedef FreeCaller1 SurfaceInspectorSelectionChangedCaller; - GlobalSelectionSystem().addSelectionChangeCallback(SurfaceInspectorSelectionChangedCaller()); - typedef FreeCaller SurfaceInspectorUpdateSelectionCaller; - Brush_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller()); - Patch_addTextureChangedCallback(SurfaceInspectorUpdateSelectionCaller()); - - SurfaceInspector_registerPreferencesPage(); -} -void SurfaceInspector_Destroy() -{ - delete g_SurfaceInspector; -} - - - -#if TEXTOOL_ENABLED - -namespace TexTool { // namespace hides these symbols from other object-files -// -//Shamus: Textool functions, including GTK+ callbacks -// - -//NOTE: Black screen when TT first comes up is caused by an uninitialized Extent... !!! FIX !!! -// But... You can see down below that it *is* initialized! WTF? -struct Extent -{ - float minX, minY, maxX, maxY; - float width(void) { return fabs(maxX - minX); } - float height(void) { return fabs(maxY - minY); } -}; - -//This seems to control the texture scale... (Yep! ;-) -Extent extents = { -2.0f, -2.0f, +2.0f, +2.0f }; -brushprimit_texdef_t tm; // Texture transform matrix -Vector2 pts[c_brush_maxFaces]; -Vector2 center; -int numPts; -int textureNum; -Vector2 textureSize; -Vector2 windowSize; -#define VP_PADDING 1.2 -#define PI 3.14159265358979 -bool lButtonDown = false; -bool rButtonDown = false; -//int dragPoint; -//int anchorPoint; -bool haveAnchor = false; -brushprimit_texdef_t currentBP; -brushprimit_texdef_t origBP; // Original brush primitive (before we muck it up) -float controlRadius = 5.0f; -float rotationAngle = 0.0f; -float rotationAngle2 = 0.0f; -float oldRotationAngle; -Vector2 rotationPoint; -bool translatingX = false; // Widget state variables -bool translatingY = false; -bool scalingX = false; -bool scalingY = false; -bool rotating = false; -bool resizingX = false; // Not sure what this means... :-/ -bool resizingY = false; -float origAngle, origScaleX, origScaleY; -Vector2 oldCenter; - - -// Function prototypes (move up to top later...) - -void DrawCircularArc(Vector2 ctr, float startAngle, float endAngle, float radius); - - -void CopyPointsFromSelectedFace(void) -{ - // Make sure that there's a face and winding to get! - - if (g_SelectedFaceInstances.empty()) - { - numPts = 0; - return; - } - - Face & face = g_SelectedFaceInstances.last().getFace(); - textureNum = face.getShader().m_state->getTexture().texture_number; - textureSize.x() = face.getShader().m_state->getTexture().width; - textureSize.y() = face.getShader().m_state->getTexture().height; -//globalOutputStream() << "--> Texture #" << textureNum << ": " << textureSize.x() << " x " << textureSize.y() << "...\n"; - - currentBP = SurfaceInspector_GetSelectedTexdef().m_brushprimit_texdef; - - face.EmitTextureCoordinates(); - Winding & w = face.getWinding(); - int count = 0; - - for(Winding::const_iterator i=w.begin(); i!=w.end(); i++) - { - //globalOutputStream() << (*i).texcoord.x() << " " << (*i).texcoord.y() << ", "; - pts[count].x() = (*i).texcoord.x(); - pts[count].y() = (*i).texcoord.y(); - count++; - } - - numPts = count; - - //globalOutputStream() << " ..copied points\n"; -} - - brushprimit_texdef_t bp; -//This approach is probably wrongheaded and just not right anyway. So, !!! FIX !!! [DONE] -void CommitChanges(void) -{ - texdef_t t; // Throwaway, since this is BP only - - bp.coords[0][0] = tm.coords[0][0] * origBP.coords[0][0] + tm.coords[0][1] * origBP.coords[1][0]; - bp.coords[0][1] = tm.coords[0][0] * origBP.coords[0][1] + tm.coords[0][1] * origBP.coords[1][1]; - bp.coords[0][2] = tm.coords[0][0] * origBP.coords[0][2] + tm.coords[0][1] * origBP.coords[1][2] + tm.coords[0][2]; -//Ok, this works for translation... -// bp.coords[0][2] = tm.coords[0][0] * origBP.coords[0][2] + tm.coords[0][1] * origBP.coords[1][2] + tm.coords[0][2] * textureSize.x(); - bp.coords[1][0] = tm.coords[1][0] * origBP.coords[0][0] + tm.coords[1][1] * origBP.coords[1][0]; - bp.coords[1][1] = tm.coords[1][0] * origBP.coords[0][1] + tm.coords[1][1] * origBP.coords[1][1]; - bp.coords[1][2] = tm.coords[1][0] * origBP.coords[0][2] + tm.coords[1][1] * origBP.coords[1][2] + tm.coords[1][2]; -// bp.coords[1][2] = tm.coords[1][0] * origBP.coords[0][2] + tm.coords[1][1] * origBP.coords[1][2] + tm.coords[1][2] * textureSize.y(); - -//This doesn't work: g_brush_texture_changed(); -// Let's try this: -//Note: We should only set an undo *after* the button has been released... !!! FIX !!! -//Definitely *should* have an undo, though! -// UndoableCommand undo("textureProjectionSetSelected"); - Select_SetTexdef(TextureProjection(t, bp, Vector3(0, 0, 0), Vector3(0, 0, 0))); -//This is working, but for some reason the translate is causing the rest of the SI -//widgets to yield bad readings... !!! FIX !!! -//I.e., click on textool window, translate face wireframe, then controls go crazy. Dunno why. -//It's because there were some uncommented out add/removeScale functions in brush.h and a -//removeScale in brushmanip.cpp... :-/ -//Translate isn't working at all now... :-( -//It's because we need to multiply in some scaling factor (prolly the texture width/height) -//Yep. :-P -} - -void UpdateControlPoints(void) -{ - CommitChanges(); - - // Init texture transform matrix - - tm.coords[0][0] = 1.0f; tm.coords[0][1] = 0.0f; tm.coords[0][2] = 0.0f; - tm.coords[1][0] = 0.0f; tm.coords[1][1] = 1.0f; tm.coords[1][2] = 0.0f; -} - - -/* -For shifting we have: -*/ -/* -The code that should provide reasonable defaults, but doesn't for some reason: -It's scaling the BP by 128 for some reason, between the time it's created and the -time we get back to the SI widgets: - -static void OnBtnAxial(GtkWidget *widget, gpointer data) -{ - UndoableCommand undo("textureDefault"); - TextureProjection projection; - TexDef_Construct_Default(projection); - Select_SetTexdef(projection); -} - -Select_SetTexdef() calls Scene_BrushSetTexdef_Component_Selected(GlobalSceneGraph(), projection) -which is in brushmanip.h: This eventually calls -Texdef_Assign(m_texdef, texdef, m_brushprimit_texdef, brushprimit_texdef) in class Face... -which just copies from brushpr to m_brushpr... -*/ - -//Small problem with this thing: It's scaled to the texture which is all screwed up... !!! FIX !!! [DONE] -//Prolly should separate out the grid drawing so that we can draw it behind the polygon. -const float gridWidth = 1.3f;// Let's try an absolute height... WORKS!!! -// NOTE that 2.0 is the height of the viewport. Dunno why... Should make collision -// detection easier... -const float gridRadius = gridWidth * 0.5f; - -typedef const float WidgetColor[3]; -const WidgetColor widgetColor[10] = { - { 1.0000f, 0.2000f, 0.0000f }, // Red - { 0.9137f, 0.9765f, 0.4980f }, // Yellow - { 0.0000f, 0.6000f, 0.3216f }, // Green - { 0.6157f, 0.7726f, 0.8196f }, // Cyan - { 0.4980f, 0.5000f, 0.4716f }, // Grey - - // Highlight colors - { 1.0000f, 0.6000f, 0.4000f }, // Light Red - { 1.0000f, 1.0000f, 0.8980f }, // Light Yellow - { 0.4000f, 1.0000f, 0.7216f }, // Light Green - { 1.0000f, 1.0000f, 1.0000f }, // Light Cyan - { 0.8980f, 0.9000f, 0.8716f } // Light Grey -}; - -#define COLOR_RED 0 -#define COLOR_YELLOW 1 -#define COLOR_GREEN 2 -#define COLOR_CYAN 3 -#define COLOR_GREY 4 -#define COLOR_LT_RED 5 -#define COLOR_LT_YELLOW 6 -#define COLOR_LT_GREEN 7 -#define COLOR_LT_CYAN 8 -#define COLOR_LT_GREY 9 - -void DrawControlWidgets(void) -{ -//Note that the grid should go *behind* the face outline... !!! FIX !!! - // Grid - float xStart = center.x() - (gridWidth / 2.0f); - float yStart = center.y() - (gridWidth / 2.0f); - float xScale = (extents.height() / extents.width()) * (textureSize.y() / textureSize.x()); - - glPushMatrix(); -//Small problem with this approach: Changing the center point in the TX code doesn't seem to -//change anything here--prolly because we load a new identity matrix. A couple of ways to fix -//this would be to get rid of that code, or change the center to a new point by taking into -//account the transforms that we toss with the new identity matrix. Dunno which is better. - glLoadIdentity(); - glScalef(xScale, 1.0, 1.0); // Will that square it up? Yup. - glRotatef(static_cast(radians_to_degrees(atan2(-currentBP.coords[0][1], currentBP.coords[0][0]))), 0.0, 0.0, -1.0); - glTranslatef(-center.x(), -center.y(), 0.0); - - // Circle - glColor3fv(translatingX && translatingY ? widgetColor[COLOR_LT_YELLOW] : widgetColor[COLOR_YELLOW]); - glBegin(GL_LINE_LOOP); - DrawCircularArc(center, 0, 2.0f * PI, gridRadius * 0.16); - - glEnd(); - - // Axes - glBegin(GL_LINES); - glColor3fv(translatingY && !translatingX ? widgetColor[COLOR_LT_GREEN] : widgetColor[COLOR_GREEN]); - glVertex2f(center.x(), center.y() + (gridRadius * 0.16)); - glVertex2f(center.x(), center.y() + (gridRadius * 1.00)); - glColor3fv(translatingX && !translatingY ? widgetColor[COLOR_LT_RED] : widgetColor[COLOR_RED]); - glVertex2f(center.x() + (gridRadius * 0.16), center.y()); - glVertex2f(center.x() + (gridRadius * 1.00), center.y()); - glEnd(); - - // Arrowheads - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glBegin(GL_TRIANGLES); - glColor3fv(translatingY && !translatingX ? widgetColor[COLOR_LT_GREEN] : widgetColor[COLOR_GREEN]); - glVertex2f(center.x(), center.y() + (gridRadius * 1.10)); - glVertex2f(center.x() + (gridRadius * 0.06), center.y() + (gridRadius * 0.94)); - glVertex2f(center.x() - (gridRadius * 0.06), center.y() + (gridRadius * 0.94)); - glColor3fv(translatingX && !translatingY ? widgetColor[COLOR_LT_RED] : widgetColor[COLOR_RED]); - glVertex2f(center.x() + (gridRadius * 1.10), center.y()); - glVertex2f(center.x() + (gridRadius * 0.94), center.y() + (gridRadius * 0.06)); - glVertex2f(center.x() + (gridRadius * 0.94), center.y() - (gridRadius * 0.06)); - glEnd(); - - // Arc - glBegin(GL_LINE_STRIP); - glColor3fv(rotating ? widgetColor[COLOR_LT_CYAN] : widgetColor[COLOR_CYAN]); - DrawCircularArc(center, 0.03f * PI, 0.47f * PI, gridRadius * 0.90); - glEnd(); - - // Boxes - glColor3fv(scalingY && !scalingX ? widgetColor[COLOR_LT_GREEN] : widgetColor[COLOR_GREEN]); - glBegin(GL_LINES); - glVertex2f(center.x() + (gridRadius * 0.20), center.y() + (gridRadius * 1.50)); - glVertex2f(center.x() - (gridRadius * 0.20), center.y() + (gridRadius * 1.50)); - glEnd(); - glBegin(GL_LINE_LOOP); - glVertex2f(center.x() + (gridRadius * 0.10), center.y() + (gridRadius * 1.40)); - glVertex2f(center.x() - (gridRadius * 0.10), center.y() + (gridRadius * 1.40)); - glVertex2f(center.x() - (gridRadius * 0.10), center.y() + (gridRadius * 1.20)); - glVertex2f(center.x() + (gridRadius * 0.10), center.y() + (gridRadius * 1.20)); - glEnd(); - - glColor3fv(scalingX && !scalingY ? widgetColor[COLOR_LT_RED] : widgetColor[COLOR_RED]); - glBegin(GL_LINES); - glVertex2f(center.x() + (gridRadius * 1.50), center.y() + (gridRadius * 0.20)); - glVertex2f(center.x() + (gridRadius * 1.50), center.y() - (gridRadius * 0.20)); - glEnd(); - glBegin(GL_LINE_LOOP); - glVertex2f(center.x() + (gridRadius * 1.40), center.y() + (gridRadius * 0.10)); - glVertex2f(center.x() + (gridRadius * 1.40), center.y() - (gridRadius * 0.10)); - glVertex2f(center.x() + (gridRadius * 1.20), center.y() - (gridRadius * 0.10)); - glVertex2f(center.x() + (gridRadius * 1.20), center.y() + (gridRadius * 0.10)); - glEnd(); - - glColor3fv(scalingX && scalingY ? widgetColor[COLOR_LT_CYAN] : widgetColor[COLOR_CYAN]); - glBegin(GL_LINE_STRIP); - glVertex2f(center.x() + (gridRadius * 1.50), center.y() + (gridRadius * 1.10)); - glVertex2f(center.x() + (gridRadius * 1.50), center.y() + (gridRadius * 1.50)); - glVertex2f(center.x() + (gridRadius * 1.10), center.y() + (gridRadius * 1.50)); - glEnd(); - glBegin(GL_LINE_LOOP); - glVertex2f(center.x() + (gridRadius * 1.40), center.y() + (gridRadius * 1.40)); - glVertex2f(center.x() + (gridRadius * 1.40), center.y() + (gridRadius * 1.20)); - glVertex2f(center.x() + (gridRadius * 1.20), center.y() + (gridRadius * 1.20)); - glVertex2f(center.x() + (gridRadius * 1.20), center.y() + (gridRadius * 1.40)); - glEnd(); - - glPopMatrix(); -} - -void DrawControlPoints(void) -{ - glColor3f(1, 1, 1); - glBegin(GL_LINE_LOOP); - - for(int i=0; i extents.maxX) - extents.maxX = pts[i].x(); - if (pts[i].y() < extents.minY) - extents.minY = pts[i].y(); - if (pts[i].y() > extents.maxY) - extents.maxY = pts[i].y(); - } - - // Do some viewport fitting stuff... - -//globalOutputStream() << "--> Center: " << center.x() << ", " << center.y() << "\n"; -//globalOutputStream() << "--> Extents (stage 1): " << extents.minX << ", " -// << extents.maxX << ", " << extents.minY << ", " << extents.maxY << "\n"; - // TTimo: Apply a ratio to get the area we'll draw. - center.x() = 0.5f * (extents.minX + extents.maxX), - center.y() = 0.5f * (extents.minY + extents.maxY); - extents.minX = center.x() + VP_PADDING * (extents.minX - center.x()), - extents.minY = center.y() + VP_PADDING * (extents.minY - center.y()), - extents.maxX = center.x() + VP_PADDING * (extents.maxX - center.x()), - extents.maxY = center.y() + VP_PADDING * (extents.maxY - center.y()); -//globalOutputStream() << "--> Extents (stage 2): " << extents.minX << ", " -// << extents.maxX << ", " << extents.minY << ", " << extents.maxY << "\n"; - - // TTimo: We want a texture with the same X / Y ratio. - // TTimo: Compute XY space / window size ratio. - float SSize = extents.width(), TSize = extents.height(); - float ratioX = textureSize.x() * extents.width() / windowSize.x(), - ratioY = textureSize.y() * extents.height() / windowSize.y(); -//globalOutputStream() << "--> Texture size: " << textureSize.x() << ", " << textureSize.y() << "\n"; -//globalOutputStream() << "--> Window size: " << windowSize.x() << ", " << windowSize.y() << "\n"; - - if (ratioX > ratioY) - { - TSize = (windowSize.y() * ratioX) / textureSize.y(); -// TSize = extents.width() * (windowSize.y() / windowSize.x()) * (textureSize.x() / textureSize.y()); - } - else - { - SSize = (windowSize.x() * ratioY) / textureSize.x(); -// SSize = extents.height() * (windowSize.x() / windowSize.y()) * (textureSize.y() / textureSize.x()); - } - - extents.minX = center.x() - 0.5f * SSize, extents.maxX = center.x() + 0.5f * SSize, - extents.minY = center.y() - 0.5f * TSize, extents.maxY = center.y() + 0.5f * TSize; -//globalOutputStream() << "--> Extents (stage 3): " << extents.minX << ", " -// << extents.maxX << ", " << extents.minY << ", " << extents.maxY << "\n"; -} - -gboolean size_allocate(GtkWidget * win, GtkAllocation * a, gpointer) -{ - windowSize.x() = a->width; - windowSize.y() = a->height; - queueDraw(); - return false; -} - -gboolean expose(GtkWidget * win, GdkEventExpose * e, gpointer) -{ -// globalOutputStream() << "--> Textool Window was exposed!\n"; -// globalOutputStream() << " (window width/height: " << cc << "/" << e->area.height << ")\n"; - -// windowSize.x() = e->area.width, windowSize.y() = e->area.height; -//This needs to go elsewhere... -// InitTextool(); - - if (glwidget_make_current(win) == FALSE) - { - globalOutputStream() << " FAILED to make current! Oh, the agony! :-(\n"; - return true; - } - - CopyPointsFromSelectedFace(); - - if(!lButtonDown) - { - focus(); - } - - // Probably should init button/anchor states here as well... -// rotationAngle = 0.0f; - glClearColor(0, 0, 0, 0); - glViewport(0, 0, e->area.width, e->area.height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - -//??? - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glDisable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - - glOrtho(extents.minX, extents.maxX, extents.maxY, extents.minY, -1, 1); - - glColor3f(1, 1, 1); - // draw the texture background - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glBindTexture(GL_TEXTURE_2D, textureNum); - - glEnable(GL_TEXTURE_2D); - glBegin(GL_QUADS); - glTexCoord2f(extents.minX, extents.minY); - glVertex2f(extents.minX, extents.minY); - glTexCoord2f(extents.maxX, extents.minY); - glVertex2f(extents.maxX, extents.minY); - glTexCoord2f(extents.maxX, extents.maxY); - glVertex2f(extents.maxX, extents.maxY); - glTexCoord2f(extents.minX, extents.maxY); - glVertex2f(extents.minX, extents.maxY); - glEnd(); - glDisable(GL_TEXTURE_2D); - - // draw the texture-space grid - glColor3fv(widgetColor[COLOR_GREY]); - glBegin(GL_LINES); - - const int gridSubdivisions = 8; - const float gridExtents = 4.0f; - - for(int i = 0; i < gridSubdivisions + 1; ++i) - { - float y = i * (gridExtents / float(gridSubdivisions)); - float x = i * (gridExtents / float(gridSubdivisions)); - glVertex2f(0, y); - glVertex2f(gridExtents, y); - glVertex2f(x, 0); - glVertex2f(x, gridExtents); - } - - glEnd(); - - DrawControlPoints(); - DrawControlWidgets(); -//??? - // reset the current texture -// glBindTexture(GL_TEXTURE_2D, 0); -// glFinish(); - glwidget_swap_buffers(win); - - return false; -} - -/*int FindSelectedPoint(int x, int y) -{ - for(int i=0; i Textool button press...\n"; - - if (e->button == 1) - { - lButtonDown = true; - GlobalUndoSystem().start(); - - origBP = currentBP; - - //globalOutputStream() << "--> Original BP: [" << origBP.coords[0][0] << "][" << origBP.coords[0][1] << "][" << origBP.coords[0][2] << "]\n"; - //globalOutputStream() << " [" << origBP.coords[1][0] << "][" << origBP.coords[1][1] << "][" << origBP.coords[1][2] << "]\n"; - //float angle = atan2(origBP.coords[0][1], origBP.coords[0][0]) * 180.0f / 3.141592653589f; - origAngle = (origBP.coords[0][1] > 0 ? PI : -PI); // Could also be -PI... !!! FIX !!! [DONE] - - if (origBP.coords[0][0] != 0.0f) - origAngle = atan(origBP.coords[0][1] / origBP.coords[0][0]); - - origScaleX = origBP.coords[0][0] / cos(origAngle); - origScaleY = origBP.coords[1][1] / cos(origAngle); - rotationAngle = origAngle; - oldCenter[0] = oldCenter[1] = 0; - - //globalOutputStream() << "--> BP stats: ang=" << origAngle * RAD_TO_DEG << ", scale=" << origScaleX << "/" << origScaleY << "\n"; - //Should also set the Flip X/Y checkboxes here as well... !!! FIX !!! - //Also: should reverse texture left/right up/down instead of flipping the points... - -//disnowok -//float nx = windowSize.x() * (e->x - extents.minX) / (extents.maxX - extents.minX); -//float ny = windowSize.y() * (e->y - extents.minY) / (extents.maxY - extents.minY); -//disdoes... -//But I want it to scroll the texture window, not the points... !!! FIX !!! -//Actually, should scroll the texture window only when mouse is down on no widgets... - float nx = e->x / windowSize.x() * extents.width() + extents.minX; - float ny = e->y / windowSize.y() * extents.height() + extents.minY; - trans.x() = -tm.coords[0][0] * nx - tm.coords[0][1] * ny; - trans.y() = -tm.coords[1][0] * nx - tm.coords[1][1] * ny; - - dragPoint.x() = e->x, dragPoint.y() = e->y; - trans2.x() = nx, trans2.y() = ny; - oldRotationAngle = rotationAngle; -// oldTrans.x() = tm.coords[0][2] - nx * textureSize.x(); -// oldTrans.y() = tm.coords[1][2] - ny * textureSize.y(); - oldTrans.x() = tm.coords[0][2]; - oldTrans.y() = tm.coords[1][2]; - oldCenter.x() = center.x(); - oldCenter.y() = center.y(); - - queueDraw(); - - return true; - } -/* else if (e->button == 3) - { - rButtonDown = true; - }//*/ - -//globalOutputStream() << "(" << (haveAnchor ? "anchor" : "released") << ")\n"; - - return false; -} - -gboolean button_release(GtkWidget * win, GdkEventButton * e, gpointer) -{ -// globalOutputStream() << "--> Textool button release...\n"; - - if (e->button == 1) - { -/* float ptx = e->x / windowSize.x() * extents.width() + extents.minX; - float pty = e->y / windowSize.y() * extents.height() + extents.minY; - -//This prolly should go into the mouse move code... -//Doesn't work correctly anyway... - if (translatingX || translatingY) - center.x() = ptx, center.y() = pty;//*/ - - lButtonDown = false; - - if(translatingX || translatingY) - { - GlobalUndoSystem().finish("translateTexture"); - } - else if(rotating) - { - GlobalUndoSystem().finish("rotateTexture"); - } - else if(scalingX || scalingY) - { - GlobalUndoSystem().finish("scaleTexture"); - } - else if(resizingX || resizingY) - { - GlobalUndoSystem().finish("resizeTexture"); + selFace = reinterpret_cast(g_ptrSelectedFaces.GetAt(0)); + bpt = &selFace->brushprimit_texdef; } else { - GlobalUndoSystem().finish("textoolUnknown"); + bpt = &g_qeglobals.d_texturewin.brushprimit_texdef; } + // compute texture matrix + // the matrix returned must be understood as a qtexture_t with width=2 height=2 + FakeTexCoordsToTexMat( m_shift, m_rotate, m_scale, local_bp.coords ); + // copy the texture matrix in the global struct + // fit the qtexture if we have a face selected, otherwise g_qeglobals.d_texturewin.brushprimit_texdef uses the basic qtexture_t with width=2 height=2 - rotating = translatingX = translatingY = scalingX = scalingY - = resizingX = resizingY = false; - - queueDraw(); - } - else if (e->button == 3) - { - rButtonDown = false; - } - - return true; -} - -/* -void C2DView::GridForWindow( float c[2], int x, int y) -{ - SpaceForWindow( c, x, y ); - if ( !m_bDoGrid ) - return; - c[0] /= m_GridStep[0]; - c[1] /= m_GridStep[1]; - c[0] = (float)floor( c[0] + 0.5f ); - c[1] = (float)floor( c[1] + 0.5f ); - c[0] *= m_GridStep[0]; - c[1] *= m_GridStep[1]; -} -void C2DView::SpaceForWindow( float c[2], int x, int y) -{ - c[0] = ((float)(x))/((float)(m_rect.right-m_rect.left))*(m_Maxs[0]-m_Mins[0])+m_Mins[0]; - c[1] = ((float)(y))/((float)(m_rect.bottom-m_rect.top))*(m_Maxs[1]-m_Mins[1])+m_Mins[1]; -} -*/ -gboolean motion(GtkWidget * win, GdkEventMotion * e, gpointer) -{ -// globalOutputStream() << "--> Textool motion...\n"; - - if (lButtonDown) - { - if (translatingX || translatingY) - { - float ptx = e->x / windowSize.x() * extents.width() + extents.minX; - float pty = e->y / windowSize.y() * extents.height() + extents.minY; - -//Need to fix this to take the rotation angle into account, so that it moves along -//the rotated X/Y axis... - if (translatingX) - { -// tm.coords[0][2] = (trans.x() + ptx) * textureSize.x(); -//This works, but only when the angle is zero. !!! FIX !!! [DONE] -// tm.coords[0][2] = oldCenter.x() + (ptx * textureSize.x()); - tm.coords[0][2] = oldTrans.x() + (ptx - trans2.x()) * textureSize.x(); -// center.x() = oldCenter.x() + (ptx - trans2.x()); - } - - if (translatingY) - { -// tm.coords[1][2] = (trans.y() + pty) * textureSize.y(); -// tm.coords[1][2] = oldCenter.y() + (pty * textureSize.y()); - tm.coords[1][2] = oldTrans.y() + (pty - trans2.y()) * textureSize.y(); -// center.y() = oldCenter.y() + (pty - trans2.y()); - } - -//Need to update center.x/y() so that the widget translates as well. Also, oldCenter -//is badly named... Should be oldTrans or something like that... !!! FIX !!! -//Changing center.x/y() here doesn't seem to change anything... :-/ - UpdateControlPoints(); - } - else if (rotating) - { - // Shamus: New rotate code - int cx = (int)(windowSize.x() * (center.x() - extents.minX) / extents.width()); - int cy = (int)(windowSize.y() * (center.y() - extents.minY) / extents.height()); - Vector3 v1(dragPoint.x() - cx, dragPoint.y() - cy, 0), v2(e->x - cx, e->y - cy, 0); - - vector3_normalise(v1); - vector3_normalise(v2); - float c = vector3_dot(v1, v2); - Vector3 cross = vector3_cross(v1, v2); - float s = vector3_length(cross); - - if (cross[2] > 0) - s = -s; - -// Problem with this: arcsin/cos seems to only return -90 to 90 and 0 to 180... -// Can't derive angle from that! - -//rotationAngle = asin(s);// * 180.0f / 3.141592653589f; -rotationAngle = acos(c); -//rotationAngle2 = asin(s); -if (cross[2] < 0) - rotationAngle = -rotationAngle; - -//NO! DOESN'T WORK! rotationAngle -= 45.0f * DEG_TO_RAD; -//Let's try this: -//No wok. -/*c = cos(rotationAngle - oldRotationAngle); -s = sin(rotationAngle - oldRotationAngle); -rotationAngle += oldRotationAngle; -//c += cos(oldRotationAngle); -//s += sin(oldRotationAngle); -//rotationAngle += oldRotationAngle; -//c %= 2.0 * PI; -//s %= 2.0 * PI; -//rotationAngle %= 2.0 * PI;//*/ - -//This is wrong... Hmm... -//It seems to shear the texture instead of rotating it... !!! FIX !!! -// Now it rotates correctly. Seems TTimo was overcomplicating things here... ;-) - -// Seems like what needs to happen here is multiplying these rotations by tm... !!! FIX !!! - -// See brush_primit.cpp line 244 (Texdef_EmitTextureCoordinates()) for where texcoords come from... - - tm.coords[0][0] = c; - tm.coords[0][1] = s; - tm.coords[1][0] = -s; - tm.coords[1][1] = c; -//It doesn't work anymore... Dunno why... -//tm.coords[0][2] = -trans.x(); // This works!!! Yeah!!! -//tm.coords[1][2] = -trans.y(); -//nope. -//tm.coords[0][2] = rotationPoint.x(); // This works, but strangely... -//tm.coords[1][2] = rotationPoint.y(); -//tm.coords[0][2] = 0;// center.x() / 2.0f; -//tm.coords[1][2] = 0;// center.y() / 2.0f; -//No. -//tm.coords[0][2] = -(center.x() * textureSize.x()); -//tm.coords[1][2] = -(center.y() * textureSize.y()); -//Eh? No, but seems to be getting closer... -/*float ptx = e->x / windowSize.x() * extents.width() + extents.minX; -float pty = e->y / windowSize.y() * extents.height() + extents.minY; -tm.coords[0][2] = -c * center.x() - s * center.y() + ptx; -tm.coords[1][2] = s * center.x() - c * center.x() + pty;//*/ -//Kinda works, but center drifts around on non-square textures... -/*tm.coords[0][2] = (-c * center.x() - s * center.y()) * textureSize.x(); -tm.coords[1][2] = ( s * center.x() - c * center.y()) * textureSize.y();//*/ -//Rotates correctly, but not around the actual center of the face's points... -/*tm.coords[0][2] = -c * center.x() * textureSize.x() - s * center.y() * textureSize.y(); -tm.coords[1][2] = s * center.x() * textureSize.x() - c * center.y() * textureSize.y();//*/ -//Yes!!! - tm.coords[0][2] = (-c * center.x() * textureSize.x() - s * center.y() * textureSize.y()) + center.x() * textureSize.x(); - tm.coords[1][2] = ( s * center.x() * textureSize.x() - c * center.y() * textureSize.y()) + center.y() * textureSize.y();//*/ -//This doesn't work... -//And this is the wrong place for this anyway (I'm pretty sure). -/*tm.coords[0][2] += oldCenter.x(); -tm.coords[1][2] += oldCenter.y();//*/ - UpdateControlPoints(); // will cause a redraw - } - - return true; - } - else // Check for widget mouseovers - { - Vector2 tran; - float nx = e->x / windowSize.x() * extents.width() + extents.minX; - float ny = e->y / windowSize.y() * extents.height() + extents.minY; - // Translate nx/y to the "center" point... - nx -= center.x(); - ny -= center.y(); - ny = -ny; // Flip Y-axis so that increasing numbers move up - - tran.x() = tm.coords[0][0] * nx + tm.coords[0][1] * ny; - tran.y() = tm.coords[1][0] * nx + tm.coords[1][1] * ny; -//This doesn't seem to generate a valid distance from the center--for some reason it -//calculates a fixed number every time -//Look at nx/y above: they're getting fixed there! !!! FIX !!! [DONE] - float dist = sqrt((nx * nx) + (ny * ny)); - // Normalize to the 2.0 = height standard (for now) -//globalOutputStream() << "--> Distance before: " << dist; - dist = dist * 2.0f / extents.height(); -//globalOutputStream() << ". After: " << dist; - tran.x() = tran.x() * 2.0f / extents.height(); - tran.y() = tran.y() * 2.0f / extents.height(); -//globalOutputStream() << ". Trans: " << tran.x() << ", " << tran.y() << "\n"; - -//Let's try this instead... -//Interesting! It seems that e->x/y are rotated -//(no, they're not--the TM above is what's doing it...) -nx = ((e->x / windowSize.y()) * 2.0f) - (windowSize.x() / windowSize.y()); -ny = ((e->y / windowSize.y()) * 2.0f) - (windowSize.y() / windowSize.y()); -ny = -ny; -//Cool! It works! Now just need to do rotation... - - rotating = translatingX = translatingY = scalingX = scalingY - = resizingX = resizingY = false; - - if (dist < (gridRadius * 0.16f)) - { - translatingX = translatingY = true; - } - else if (dist > (gridRadius * 0.16f) && dist < (gridRadius * 1.10f) - && fabs(ny) < (gridRadius * 0.05f) && nx > 0) - { - translatingX = true; - } - else if (dist > (gridRadius * 0.16f) && dist < (gridRadius * 1.10f) - && fabs(nx) < (gridRadius * 0.05f) && ny > 0) - { - translatingY = true; - } - // Should tighten up the angle on this, or put this test after the axis tests... - else if (tran.x() > 0 && tran.y() > 0 - && (dist > (gridRadius * 0.82f) && dist < (gridRadius * 0.98f))) - { - rotating = true; - } - - queueDraw(); - - return true; - } - - return false; -} - -//It seems the fake tex coords conversion is screwing this stuff up... !!! FIX !!! -//This is still wrong... Prolly need to do something with the oldScaleX/Y stuff... -void flipX(GtkToggleButton *, gpointer) -{ -// globalOutputStream() << "--> Flip X...\n"; - //Shamus: -// SurfaceInspector_GetSelectedBPTexdef(); // Refresh g_selectedBrushPrimitTexdef... -// tm.coords[0][0] = -tm.coords[0][0]; -// tm.coords[1][0] = -tm.coords[1][0]; -// tm.coords[0][0] = -tm.coords[0][0]; // This should be correct now...Nope. -// tm.coords[1][1] = -tm.coords[1][1]; - tm.coords[0][0] = -tm.coords[0][0]; // This should be correct now... - tm.coords[1][0] = -tm.coords[1][0]; -// tm.coords[2][0] = -tm.coords[2][0];//wil wok? no. - UpdateControlPoints(); -} - -void flipY(GtkToggleButton *, gpointer) -{ -// globalOutputStream() << "--> Flip Y...\n"; -// tm.coords[0][1] = -tm.coords[0][1]; -// tm.coords[1][1] = -tm.coords[1][1]; -// tm.coords[0][1] = -tm.coords[0][1]; // This should be correct now...Nope. -// tm.coords[1][0] = -tm.coords[1][0]; - tm.coords[0][1] = -tm.coords[0][1]; // This should be correct now... - tm.coords[1][1] = -tm.coords[1][1]; -// tm.coords[2][1] = -tm.coords[2][1];//wil wok? no. - UpdateControlPoints(); -} - -} // end namespace TexTool - + ConvertTexMatWithQTexture( &local_bp, NULL, bpt, ( (selFace) ? selFace->d_texture : NULL ) ); + } + // we are gonna do stuff, if we own the last do we undo it first + if (m_nUndoId != 0) + { + // check the do we're about to undo is the one we pushed earlier + if (m_nUndoId == Undo_GetUndoId()) + { +#ifdef DBG_SI + Sys_Printf("GetTexMods calling Undo_Undo (silent)\n"); #endif + g_bListenUpdate=false; + Undo_Undo(true); + g_bListenUpdate=true; + } + } + Select_SetTexture(pt,&local_bp); + m_nUndoId = Undo_GetUndoId(); +} + +void SurfaceDlg::FitAll() +{ + OnBtnFaceFit(NULL, NULL); + OnBtnPatchFit(NULL, NULL); +} diff --git a/radiant/surfacedialog.h b/radiant/surfacedialog.h index 034cf1d6..71741b9e 100644 --- a/radiant/surfacedialog.h +++ b/radiant/surfacedialog.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,42 +19,51 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_SURFACEDIALOG_H) -#define INCLUDED_SURFACEDIALOG_H +#ifndef _SURFACEDIALOG_H_ +#define _SURFACEDIALOG_H_ +#include "dialog.h" -void SurfaceInspector_Construct(); -void SurfaceInspector_Destroy(); - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -void SurfaceInspector_constructWindow(GtkWindow* widget); -void SurfaceInspector_destroyWindow(); - -bool SelectedFaces_empty(); -void SelectedFaces_copyTexture(); -void SelectedFaces_pasteTexture(); -void FaceTextureClipboard_setDefault(); - - -// the increment we are using for the surface inspector (this is saved in the prefs) -struct si_globals_t -{ - float shift[2]; - float scale[2]; - float rotate; - - bool m_bSnapTToGrid; - - si_globals_t() : m_bSnapTToGrid(false) - { - shift[0] = 8.0f; - shift[1] = 8.0f; - scale[0] = 0.5f; - scale[1] = 0.5f; - rotate = 45.0f; - } -}; -extern si_globals_t g_si_globals; - +#ifdef _DEBUG +//#define DBG_SI 1 #endif + +class SurfaceDlg : public Dialog +{ + bool m_bPatchMode; + // brush primitive fake shift scale rot coords + float m_shift[2]; + float m_rotate; + float m_scale[2]; + +public: + SurfaceDlg (); + + virtual void ShowDlg(); + virtual void HideDlg(); + void SetTexMods(); + void GetTexMods(); + + void InitDefaultIncrement(texdef_t *); + + // Dialog Data + int m_nHeight; + int m_nWidth; + + // 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for + int m_nUndoId; + + // is the user editing the texture widget (that changes the behaviour of 'Enter' key from OnDone to OnApply + // reset to false at each SetTexMods or when dealing with Enter key + bool m_bEditingTextureWidget; + +protected: + void BuildDialog (); + +public: + // called to perform a fitting from the outside (shortcut key) + void FitAll(); + GtkWidget *GetWidget (); // { return m_pWidget; } +}; + +#endif // _SURFACEDIALOG_H_ diff --git a/radiant/surfaceplugin.cpp b/radiant/surfaceplugin.cpp new file mode 100644 index 00000000..320ee86c --- /dev/null +++ b/radiant/surfaceplugin.cpp @@ -0,0 +1,259 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// implementation of isurfaceplugin-interface specifics + +#include "stdafx.h" + +void QERApp_GetTwoSelectedPatch( patchMesh_t **p1, patchMesh_t **p2 ) +{ + *p1 = NULL; *p2 = NULL; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + if (!(*p1)) + *p1 = pb->pPatch; + else if (!(*p2)) + { + *p2 = pb->pPatch; + return; + } + } + } +#ifdef _DEBUG + Sys_Printf("WARNING: QERApp_GetTwoSelectedPatch failed (did not find two patches)\n"); +#endif + return; +} + +// Nurail: The following functions are used by the Surface Inspector module + +// Queries the number of faces from selected brushes +int SI_GetSelectedFaceCountfromBrushes(void) +{ + face_t *f; + brush_t *b; + int num_of_faces = 0; + + if(selected_brushes.next == &selected_brushes) + return(0); + + for(b=selected_brushes.next; b!=&selected_brushes; b=b->next) + if (!(b->patchBrush)) + for(f=b->brush_faces; f ; f=f->next, num_of_faces++); + + return num_of_faces; +} + +void SI_GetSelFacesTexdef(texdef_to_face_t *allocd_block_texdef) +{ + int i; + face_t *f; + brush_t *b; + texdef_to_face_t *position, *prev_pos; + + if(selected_brushes.next != &selected_brushes) + { + prev_pos = position = allocd_block_texdef; + for(b=selected_brushes.next; b!=&selected_brushes; b=b->next) + { + if ( !(b->patchBrush) ) + { + for(f=b->brush_faces; f ; f = f->next) + { + position->face = f; + position->brush = b; + position->texdef = f->texdef; + position->orig_texdef = f->texdef; + prev_pos->next = position; + prev_pos = position; + position++; + } + prev_pos->next = NULL; + } + } + } + else if(g_ptrSelectedFaces.GetSize() != 0) + { + f = (face_t *) g_ptrSelectedFaces.GetAt(0); + b = (brush_t *) g_ptrSelectedFaceBrushes.GetAt(0); + position = (texdef_to_face_t*) allocd_block_texdef; + position->face = f; + position->brush = b; + position->texdef = f->texdef; + position->orig_texdef = f->texdef; + prev_pos = position; + for(i=1; iface = f; + position->brush = b; + position->texdef = f->texdef; + position->orig_texdef = f->texdef; + prev_pos->next = position; + prev_pos = position; + } + position->next = NULL; + } + +} + +/* +SetFaceTexdef_Q2 + +This doesn't mess with CONTENTS_DETAIL needed for Quake2 content flag + +*/ +void SetFaceTexdef_Q2 (face_t *f, texdef_t *texdef, bool bFitScale) +{ + + if(strcmp(f->texdef.GetName(), texdef->GetName()) != 0) // set shader here instead of Brush_Build + Face_SetShader(f, texdef->GetName()); + + if (bFitScale) + { + f->texdef = *texdef; + // fit the scaling of the texture on the actual plane + vec3_t p1,p2,p3; // absolute coordinates + // compute absolute coordinates + ComputeAbsolute(f,p1,p2,p3); + // compute the scale + vec3_t vx,vy; + VectorSubtract(p2,p1,vx); + VectorNormalize(vx, vx); + VectorSubtract(p3,p1,vy); + VectorNormalize(vy, vy); + // assign scale + VectorScale(vx,texdef->scale[0],vx); + VectorScale(vy,texdef->scale[1],vy); + VectorAdd(p1,vx,p2); + VectorAdd(p1,vy,p3); + // compute back shift scale rot + AbsoluteToLocal(f->plane,f,p1,p2,p3); + } + else + { + f->texdef = *texdef; + } + } + + + +void SI_SetTexdef_FaceList(texdef_to_face_t* texdef_face_list, bool b_SetUndoPoint, bool bFit_to_Scale) +{ + texdef_to_face_t* texdef_to_face; + bool b_isQuake2; + + if ( ( g_pGameDescription->quake2 ) || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ) ) + b_isQuake2 = true; + else + b_isQuake2 = false; + + if (!texdef_face_list) + return; + + if (b_SetUndoPoint) + { + if(g_ptrSelectedFaces.GetSize() > 1) + Sys_FPrintf(SYS_WRN, "WARNING: Undo NOT supported for multiple face selections\n"); + else if( (selected_brushes.next != &selected_brushes) || (g_ptrSelectedFaces.GetSize() == 1)) + { + // Give something to undo to + for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next) + if (b_isQuake2) + SetFaceTexdef_Q2(texdef_to_face->face, &texdef_to_face->orig_texdef, bFit_to_Scale); + else + SetFaceTexdef(texdef_to_face->face, &texdef_to_face->orig_texdef, NULL); + + Undo_Start("set facelist texdefs"); + + if( selected_brushes.next != &selected_brushes ) + Undo_AddBrushList(&selected_brushes); + else + Undo_AddBrush(texdef_face_list->brush); + + } + } + + for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next) + { + if (b_isQuake2) + SetFaceTexdef_Q2(texdef_to_face->face, &texdef_to_face->texdef, bFit_to_Scale); + else + SetFaceTexdef(texdef_to_face->face, &texdef_to_face->texdef, NULL , bFit_to_Scale); + Brush_Build(texdef_to_face->brush); + if(bFit_to_Scale) + texdef_to_face->texdef = texdef_to_face->face->texdef; + } + + if ( b_SetUndoPoint ) + { + if( (selected_brushes.next != &selected_brushes) || (g_ptrSelectedFaces.GetSize() == 1) ) + { + if(selected_brushes.next != &selected_brushes) + Undo_EndBrushList(&selected_brushes); + else + Undo_EndBrush(texdef_face_list->brush); + + Undo_End(); + // Over-write the orig_texdef list, cementing the change. + for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next) + texdef_to_face->orig_texdef = texdef_to_face->texdef; + } + } + + Sys_UpdateWindows (W_ALL); +} + +void SI_FaceList_FitTexture(texdef_to_face_t* si_texdef_face_list, int nHeight, int nWidth) +{ + texdef_to_face_t* temp_texdef_face_list; + + if (!si_texdef_face_list) + return; + + for (temp_texdef_face_list = si_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next) + { + Face_FitTexture(temp_texdef_face_list->face, nHeight, nWidth); + Brush_Build(temp_texdef_face_list->brush,true,true,false,false); + // Write changes to our working Texdef list + temp_texdef_face_list->texdef = temp_texdef_face_list->face->texdef; + } + + Sys_UpdateWindows (W_CAMERA); + +} + +GtkWindow* SI_GetMainWindow(void) +{ + return GTK_WINDOW(g_qeglobals_gui.d_main_window); +} + +void SI_SetWinPos_from_Prefs(GtkWidget *win) +{ + load_window_pos (win, g_PrefsDlg.mWindowInfo.posSurfaceWnd); +} diff --git a/radiant/surfaceplugin.h b/radiant/surfaceplugin.h new file mode 100644 index 00000000..4e32e92f --- /dev/null +++ b/radiant/surfaceplugin.h @@ -0,0 +1,11 @@ +#ifndef _SURFACEPLUGIN_H +#define _SURFACEPLUGIN_H + +int SI_GetSelectedFaceCountfromBrushes(void); +void SI_GetSelFacesTexdef(texdef_to_face_t *allocd_block_texdef); +void SI_SetTexdef_FaceList(texdef_to_face_t* texdef_face_list, bool b_SetUndoPoint = FALSE, bool bFit_to_Scale = FALSE); +void SI_FaceList_FitTexture(texdef_to_face_t* si_texdef_face_list, int nHeight, int nWidth); +GtkWindow* SI_GetMainWindow(void); +void SI_SetWinPos_from_Prefs(GtkWidget *win); + +#endif // _SURFACEPLUGIN_H diff --git a/radiant/targetname.cpp b/radiant/targetname.cpp new file mode 100644 index 00000000..7a5e3c9b --- /dev/null +++ b/radiant/targetname.cpp @@ -0,0 +1,90 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "stdafx.h" + +/*! +connects two entities creating a unique target/targetname value +*/ +void Entity_Connect(entity_t *e1, entity_t *e2) +{ + const char *maptarget; + char newtarget[16]; + int maxtarget=0; // highest t# value in the map + entity_t *e; // map entities + + if (e1 == e2) + { +#ifdef _DEBUG + Sys_Status ("Entity_Connect: Brushes are from same entity.", 0); +#endif + return; + } + + for (e=entities.next ; e != &entities ; e=e->next) + { + maptarget = ValueForKey (e, "target"); + if (maptarget && maptarget[0]) + { + int targetnum = atoi(maptarget+1); + if (targetnum > maxtarget) + maxtarget = targetnum; + } + } + sprintf (newtarget, "t%i", maxtarget+1); + +#ifdef _DEBUG + Sys_Printf("Connecting entities with new target/targetname: %s\n", newtarget); +#endif + + SetKeyValue (e1, "target", newtarget); + SetKeyValue (e2, "targetname", newtarget); +} + +int GetUniqueTargetId(int iHint) +{ + int iMin, iMax, i; + bool fFound; + entity_t *pe; + + fFound = FALSE; + pe = entities.next; + iMin = 0; + iMax = 0; + + for (; pe != NULL && pe != &entities ; pe = pe->next) + { + i = IntForKey(pe, "target"); + if (i) + { + iMin = MIN(i, iMin); + iMax = MAX(i, iMax); + if (i == iHint) + fFound = TRUE; + } + } + + if (fFound) + return iMax + 1; + else + return iHint; +} + diff --git a/radiant/texmanip.cpp b/radiant/texmanip.cpp index 8fa88ca2..53c3b788 100644 --- a/radiant/texmanip.cpp +++ b/radiant/texmanip.cpp @@ -29,15 +29,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "texmanip.h" - -#include -#include "stream/textstream.h" +#include "stdafx.h" +#include "str.h" static byte *row1 = NULL, *row2 = NULL; static int rowsize = 0; -void R_ResampleTextureLerpLine (const byte *in, byte *out, int inwidth, int outwidth, int bytesperpixel) +void R_ResampleTextureLerpLine (byte *in, byte *out, int inwidth, int outwidth, int bytesperpixel) { int j, xi, oldx = 0, f, fstep, endx, lerp; #define LERPBYTE(i) out[i] = (byte) ((((row2[i] - row1[i]) * lerp) >> 16) + row1[i]) @@ -99,9 +97,7 @@ void R_ResampleTextureLerpLine (const byte *in, byte *out, int inwidth, int outw } } else - { - globalOutputStream() << "R_ResampleTextureLerpLine: unsupported bytesperpixel " << bytesperpixel << "\n"; - } + Sys_Printf("R_ResampleTextureLerpLine: unsupported bytesperpixel %i\n", bytesperpixel); } /* @@ -109,7 +105,7 @@ void R_ResampleTextureLerpLine (const byte *in, byte *out, int inwidth, int outw R_ResampleTexture ================ */ -void R_ResampleTexture (const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel) +void R_ResampleTexture (void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel) { if (rowsize < outwidth * bytesperpixel) { @@ -125,8 +121,8 @@ void R_ResampleTexture (const void *indata, int inwidth, int inheight, void *out if (bytesperpixel == 4) { - int i, j, yi, oldy, f, fstep, lerp, endy = (inheight-1), inwidth4 = inwidth*4, outwidth4 = outwidth*4; - byte *inrow, *out; + int i, j, yi, oldy, f, fstep, lerp, endy = (inheight-1), inwidth4 = inwidth*4, outwidth4 = outwidth*4; + byte *inrow, *out; out = (byte *)outdata; fstep = (int) (inheight * 65536.0f / outheight); #define LERPBYTE(i) out[i] = (byte) ((((row2[i] - row1[i]) * lerp) >> 16) + row1[i]) @@ -222,8 +218,8 @@ void R_ResampleTexture (const void *indata, int inwidth, int inheight, void *out } else if (bytesperpixel == 3) { - int i, j, yi, oldy, f, fstep, lerp, endy = (inheight-1), inwidth3 = inwidth * 3, outwidth3 = outwidth * 3; - byte *inrow, *out; + int i, j, yi, oldy, f, fstep, lerp, endy = (inheight-1), inwidth3 = inwidth * 3, outwidth3 = outwidth * 3; + byte *inrow, *out; out = (byte *)outdata; fstep = (int) (inheight*65536.0f/outheight); #define LERPBYTE(i) out[i] = (byte) ((((row2[i] - row1[i]) * lerp) >> 16) + row1[i]) @@ -310,9 +306,7 @@ void R_ResampleTexture (const void *indata, int inwidth, int inheight, void *out } } else - { - globalOutputStream() << "R_ResampleTexture: unsupported bytesperpixel " << bytesperpixel << "\n"; - } + Sys_Printf("R_ResampleTexture: unsupported bytesperpixel %i\n", bytesperpixel); } // in can be the same as out @@ -381,8 +375,6 @@ void GL_MipReduce(byte *in, byte *out, int width, int height, int destwidth, int } } else - { - globalOutputStream() << "GL_MipReduce: desired size already achieved\n"; - } + Sys_Printf("GL_MipReduce: desired size already achieved\n"); } } diff --git a/radiant/texmanip.h b/radiant/texmanip.h index 3cca3ce2..07548700 100644 --- a/radiant/texmanip.h +++ b/radiant/texmanip.h @@ -29,12 +29,11 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_TEXMANIP_H) -#define INCLUDED_TEXMANIP_H +#ifndef _TEXMANIP_H_ +#define _TEXMANIP_H_ -typedef unsigned char byte; - -void R_ResampleTexture (const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel); +void R_ResampleTextureLerpLine (byte *in, byte *out, int inwidth, int outwidth, int bytesperpixel); +void R_ResampleTexture (void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel); void GL_MipReduce(byte *in, byte *out, int width, int height, int destwidth, int destheight); -#endif +#endif // _TEXMANIP_H_ diff --git a/radiant/textureentry.cpp b/radiant/textureentry.cpp deleted file mode 100644 index 615143c1..00000000 --- a/radiant/textureentry.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "textureentry.h" - diff --git a/radiant/textureentry.h b/radiant/textureentry.h deleted file mode 100644 index 3965fe29..00000000 --- a/radiant/textureentry.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_TEXTUREENTRY_H) -#define INCLUDED_TEXTUREENTRY_H - - -#include -#include -#include "gtkutil/idledraw.h" - -#include "generic/static.h" -#include "signal/isignal.h" -#include "shaderlib.h" - -#include "texwindow.h" - -template -class EntryCompletion -{ - GtkListStore* m_store; - IdleDraw m_idleUpdate; -public: - EntryCompletion() : m_store(0), m_idleUpdate(UpdateCaller(*this)) - { - } - - void connect(GtkEntry* entry) - { - if(m_store == 0) - { - m_store = gtk_list_store_new(1, G_TYPE_STRING); - - fill(); - - StringList().connect(IdleDraw::QueueDrawCaller(m_idleUpdate)); - } - - GtkEntryCompletion* completion = gtk_entry_completion_new(); - gtk_entry_set_completion(entry, completion); - gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(m_store)); - gtk_entry_completion_set_text_column(completion, 0); - } - - void append(const char* string) - { - GtkTreeIter iter; - gtk_list_store_append(m_store, &iter); - gtk_list_store_set(m_store, &iter, 0, string, -1); - } - typedef MemberCaller1 AppendCaller; - - void fill() - { - StringList().forEach(AppendCaller(*this)); - } - - void clear() - { - gtk_list_store_clear(m_store); - } - - void update() - { - clear(); - fill(); - } - typedef MemberCaller UpdateCaller; -}; - -class TextureNameList -{ -public: - void forEach(const ShaderNameCallback& callback) const - { - for(QERApp_ActiveShaders_IteratorBegin(); !QERApp_ActiveShaders_IteratorAtEnd(); QERApp_ActiveShaders_IteratorIncrement()) - { - IShader *shader = QERApp_ActiveShaders_IteratorCurrent(); - - if(shader_equal_prefix(shader->getName(), "textures/")) - { - callback(shader->getName() + 9); - } - } - } - void connect(const SignalHandler& update) const - { - TextureBrowser_addActiveShadersChangedCallback(update); - } -}; - -typedef Static< EntryCompletion > GlobalTextureEntryCompletion; - - -class ShaderList -{ -public: - void forEach(const ShaderNameCallback& callback) const - { - GlobalShaderSystem().foreachShaderName(callback); - } - void connect(const SignalHandler& update) const - { - TextureBrowser_addShadersRealiseCallback(update); - } -}; - -typedef Static< EntryCompletion > GlobalShaderEntryCompletion; - - -#endif diff --git a/radiant/textures.cpp b/radiant/textures.cpp deleted file mode 100644 index 76a79704..00000000 --- a/radiant/textures.cpp +++ /dev/null @@ -1,899 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "textures.h" - -#include "debugging/debugging.h" -#include "warnings.h" - -#include "itextures.h" -#include "igl.h" -#include "preferencesystem.h" -#include "qgl.h" - -#include "texturelib.h" -#include "container/hashfunc.h" -#include "container/cache.h" -#include "generic/callback.h" -#include "stringio.h" - -#include "image.h" -#include "texmanip.h" -#include "preferences.h" - - - -enum ETexturesMode -{ - eTextures_NEAREST = 0, - eTextures_NEAREST_MIPMAP_NEAREST = 1, - eTextures_NEAREST_MIPMAP_LINEAR = 2, - eTextures_LINEAR = 3, - eTextures_LINEAR_MIPMAP_NEAREST = 4, - eTextures_LINEAR_MIPMAP_LINEAR = 5, - eTextures_MAX_ANISOTROPY = 6, -}; - -enum TextureCompressionFormat -{ - TEXTURECOMPRESSION_NONE = 0, - TEXTURECOMPRESSION_RGBA = 1, - TEXTURECOMPRESSION_RGBA_S3TC_DXT1 = 2, - TEXTURECOMPRESSION_RGBA_S3TC_DXT3 = 3, - TEXTURECOMPRESSION_RGBA_S3TC_DXT5 = 4, -}; - -struct texture_globals_t -{ - // RIANT - // texture compression format - TextureCompressionFormat m_nTextureCompressionFormat; - - float fGamma; - - bool bTextureCompressionSupported; // is texture compression supported by hardware? - GLint texture_components; - - // temporary values that should be initialised only once at run-time - bool m_bOpenGLCompressionSupported; - bool m_bS3CompressionSupported; - - texture_globals_t(GLint components) : - m_nTextureCompressionFormat(TEXTURECOMPRESSION_NONE), - fGamma(1.0f), - bTextureCompressionSupported(false), - texture_components(components), - m_bOpenGLCompressionSupported(false), - m_bS3CompressionSupported(false) - { - } -}; - -texture_globals_t g_texture_globals(GL_RGBA); - -void SetTexParameters(ETexturesMode mode) -{ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); - - switch (mode) - { - case eTextures_NEAREST: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - break; - case eTextures_NEAREST_MIPMAP_NEAREST: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - break; - case eTextures_NEAREST_MIPMAP_LINEAR: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - break; - case eTextures_LINEAR: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - break; - case eTextures_LINEAR_MIPMAP_NEAREST: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - break; - case eTextures_LINEAR_MIPMAP_LINEAR: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR ); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - break; - case eTextures_MAX_ANISOTROPY: - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, QGL_maxTextureAnisotropy()); - break; - default: - globalOutputStream() << "invalid texture mode\n"; - } -} - -ETexturesMode g_texture_mode = eTextures_LINEAR_MIPMAP_LINEAR; - - - - -byte g_gammatable[256]; -void ResampleGamma(float fGamma) -{ - int i,inf; - if (fGamma == 1.0) - { - for (i = 0; i < 256; i++) - g_gammatable[i] = i; - } else - { - for (i = 0; i < 256; i++) - { - inf = (int)(255 * pow ( static_cast((i + 0.5) / 255.5) , static_cast(fGamma) ) + 0.5); - if (inf < 0) - inf = 0; - if (inf > 255) - inf = 255; - g_gammatable[i] = inf; - } - } -} - -inline const int& min_int(const int& left, const int& right) -{ - return std::min(left, right); -} - -int max_tex_size = 0; -const int max_texture_quality = 3; -LatchedInt g_Textures_textureQuality(3, "Texture Quality"); - -/// \brief This function does the actual processing of raw RGBA data into a GL texture. -/// It will also resample to power-of-two dimensions, generate the mipmaps and adjust gamma. -void LoadTextureRGBA(qtexture_t* q, unsigned char* pPixels, int nWidth, int nHeight) -{ - static float fGamma = -1; - float total[3]; - byte *outpixels = 0; - int nCount = nWidth * nHeight; - - if (fGamma != g_texture_globals.fGamma) - { - fGamma = g_texture_globals.fGamma; - ResampleGamma(fGamma); - } - - q->width = nWidth; - q->height = nHeight; - - total[0] = total[1] = total[2] = 0.0f; - - // resample texture gamma according to user settings - for (int i = 0; i < (nCount * 4); i += 4) - { - for (int j = 0; j < 3; j++) - { - total[j] += (pPixels + i)[j]; - byte b = (pPixels + i)[j]; - (pPixels + i)[j] = g_gammatable[b]; - } - } - - q->color[0] = total[0] / (nCount * 255); - q->color[1] = total[1] / (nCount * 255); - q->color[2] = total[2] / (nCount * 255); - - glGenTextures (1, &q->texture_number); - - glBindTexture( GL_TEXTURE_2D, q->texture_number ); - - SetTexParameters(g_texture_mode); - - int gl_width = 1; - while(gl_width < nWidth) - gl_width <<= 1; - - int gl_height = 1; - while(gl_height < nHeight) - gl_height <<= 1; - - bool resampled = false; - if (!(gl_width == nWidth && gl_height == nHeight)) - { - resampled = true; - outpixels = (byte *)malloc(gl_width * gl_height * 4); - R_ResampleTexture(pPixels, nWidth, nHeight, outpixels, gl_width, gl_height, 4); - } - else - { - outpixels = pPixels; - } - - int quality_reduction = max_texture_quality - g_Textures_textureQuality.m_value; - int target_width = min_int(gl_width >> quality_reduction, max_tex_size); - int target_height = min_int(gl_height >> quality_reduction, max_tex_size); - - while (gl_width > target_width || gl_height > target_height) - { - GL_MipReduce(outpixels, outpixels, gl_width, gl_height, target_width, target_height); - - if (gl_width > target_width) - gl_width >>= 1; - if (gl_height > target_height) - gl_height >>= 1; - } - - int mip = 0; - glTexImage2D(GL_TEXTURE_2D, mip++, g_texture_globals.texture_components, gl_width, gl_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, outpixels); - while (gl_width > 1 || gl_height > 1) - { - GL_MipReduce(outpixels, outpixels, gl_width, gl_height, 1, 1); - - if (gl_width > 1) - gl_width >>= 1; - if (gl_height > 1) - gl_height >>= 1; - - glTexImage2D(GL_TEXTURE_2D, mip++, g_texture_globals.texture_components, gl_width, gl_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, outpixels); - } - - glBindTexture(GL_TEXTURE_2D, 0); - if (resampled) - free(outpixels); -} - -#if 0 -/* -============== -Texture_InitPalette -============== -*/ -void Texture_InitPalette (byte *pal) -{ - int r,g,b; - int i; - int inf; - byte gammatable[256]; - float gamma; - - gamma = g_texture_globals.fGamma; - - if (gamma == 1.0) - { - for (i=0 ; i<256 ; i++) - gammatable[i] = i; - } else - { - for (i=0 ; i<256 ; i++) - { - inf = (int)(255 * pow ( (i+0.5)/255.5 , gamma ) + 0.5); - if (inf < 0) - inf = 0; - if (inf > 255) - inf = 255; - gammatable[i] = inf; - } - } - - for (i=0 ; i<256 ; i++) - { - r = gammatable[pal[0]]; - g = gammatable[pal[1]]; - b = gammatable[pal[2]]; - pal += 3; - - //v = (r<<24) + (g<<16) + (b<<8) + 255; - //v = BigLong (v); - - //tex_palette[i] = v; - tex_palette[i*3+0] = r; - tex_palette[i*3+1] = g; - tex_palette[i*3+2] = b; - } -} -#endif - -#if 0 -class TestHashtable -{ -public: - TestHashtable() - { - HashTable strings; - strings["Monkey"] = "bleh"; - strings["MonkeY"] = "blah"; - } -}; - -const TestHashtable g_testhashtable; - -#endif - -typedef std::pair TextureKey; - -void qtexture_realise(qtexture_t& texture, const TextureKey& key) -{ - texture.texture_number = 0; - if(!string_empty(key.second.c_str())) - { - Image* image = key.first.loadImage(key.second.c_str()); - if(image != 0) - { - LoadTextureRGBA(&texture, image->getRGBAPixels(), image->getWidth(), image->getHeight()); - texture.surfaceFlags = image->getSurfaceFlags(); - texture.contentFlags = image->getContentFlags(); - texture.value = image->getValue(); - image->release(); - globalOutputStream() << "Loaded Texture: \"" << key.second.c_str() << "\"\n"; - GlobalOpenGL_debugAssertNoErrors(); - } - else - { - globalErrorStream() << "Texture load failed: \"" << key.second.c_str() << "\"\n"; - } - } -} - -void qtexture_unrealise(qtexture_t& texture) -{ - if(GlobalOpenGL().contextValid && texture.texture_number != 0) - { - glDeleteTextures(1, &texture.texture_number); - GlobalOpenGL_debugAssertNoErrors(); - } -} - -class TextureKeyEqualNoCase -{ -public: - bool operator()(const TextureKey& key, const TextureKey& other) const - { - return key.first == other.first && string_equal_nocase(key.second.c_str(), other.second.c_str()); - } -}; - -class TextureKeyHashNoCase -{ -public: - typedef hash_t hash_type; - hash_t operator()(const TextureKey& key) const - { - return hash_combine(string_hash_nocase(key.second.c_str()), pod_hash(key.first)); - } -}; - -#define DEBUG_TEXTURES 0 - -class TexturesMap : public TexturesCache -{ - class TextureConstructor - { - TexturesMap* m_cache; - public: - explicit TextureConstructor(TexturesMap* cache) - : m_cache(cache) - { - } - qtexture_t* construct(const TextureKey& key) - { - qtexture_t* texture = new qtexture_t(key.first, key.second.c_str()); - if(m_cache->realised()) - { - qtexture_realise(*texture, key); - } - return texture; - } - void destroy(qtexture_t* texture) - { - if(m_cache->realised()) - { - qtexture_unrealise(*texture); - } - delete texture; - } - }; - - typedef HashedCache qtextures_t; - qtextures_t m_qtextures; - TexturesCacheObserver* m_observer; - std::size_t m_unrealised; - -public: - TexturesMap() : m_qtextures(TextureConstructor(this)), m_observer(0), m_unrealised(1) - { - } - typedef qtextures_t::iterator iterator; - - iterator begin() - { - return m_qtextures.begin(); - } - iterator end() - { - return m_qtextures.end(); - } - - LoadImageCallback defaultLoader() const - { - return LoadImageCallback(0, QERApp_LoadImage); - } - Image* loadImage(const char* name) - { - return defaultLoader().loadImage(name); - } - qtexture_t* capture(const char* name) - { - return capture(defaultLoader(), name); - } - qtexture_t* capture(const LoadImageCallback& loader, const char* name) - { -#if DEBUG_TEXTURES - globalOutputStream() << "textures capture: " << makeQuoted(name) << '\n'; -#endif - return m_qtextures.capture(TextureKey(loader, name)).get(); - } - void release(qtexture_t* texture) - { -#if DEBUG_TEXTURES - globalOutputStream() << "textures release: " << makeQuoted(texture->name) << '\n'; -#endif - m_qtextures.release(TextureKey(texture->load, texture->name)); - } - void attach(TexturesCacheObserver& observer) - { - ASSERT_MESSAGE(m_observer == 0, "TexturesMap::attach: cannot attach observer"); - m_observer = &observer; - } - void detach(TexturesCacheObserver& observer) - { - ASSERT_MESSAGE(m_observer == &observer, "TexturesMap::detach: cannot detach observer"); - m_observer = 0; - } - void realise() - { - if(--m_unrealised == 0) - { - g_texture_globals.bTextureCompressionSupported = false; - - if(GlobalOpenGL().ARB_texture_compression()) - { - g_texture_globals.bTextureCompressionSupported = true; - g_texture_globals.m_bOpenGLCompressionSupported = true; - } - - if(GlobalOpenGL().EXT_texture_compression_s3tc()) - { - g_texture_globals.bTextureCompressionSupported = true; - g_texture_globals.m_bS3CompressionSupported = true; - } - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_tex_size); - if(max_tex_size == 0) - { - max_tex_size = 1024; - } - - for(qtextures_t::iterator i = m_qtextures.begin(); i != m_qtextures.end(); ++i) - { - if(!(*i).value.empty()) - { - qtexture_realise(*(*i).value, (*i).key); - } - } - if(m_observer != 0) - { - m_observer->realise(); - } - } - } - void unrealise() - { - if(++m_unrealised == 1) - { - if(m_observer != 0) - { - m_observer->unrealise(); - } - for(qtextures_t::iterator i = m_qtextures.begin(); i != m_qtextures.end(); ++i) - { - if(!(*i).value.empty()) - { - qtexture_unrealise(*(*i).value); - } - } - } - } - bool realised() - { - return m_unrealised == 0; - } -}; - -TexturesMap* g_texturesmap; - -TexturesCache& GetTexturesCache() -{ - return *g_texturesmap; -} - - -void Textures_Realise() -{ - g_texturesmap->realise(); -} - -void Textures_Unrealise() -{ - g_texturesmap->unrealise(); -} - - -Callback g_texturesModeChangedNotify; - -void Textures_setModeChangedNotify(const Callback& notify) -{ - g_texturesModeChangedNotify = notify; -} - -void Textures_ModeChanged() -{ - if(g_texturesmap->realised()) - { - SetTexParameters(g_texture_mode); - - for(TexturesMap::iterator i = g_texturesmap->begin(); i != g_texturesmap->end(); ++i) - { - glBindTexture (GL_TEXTURE_2D, (*i).value->texture_number); - SetTexParameters(g_texture_mode); - } - - glBindTexture( GL_TEXTURE_2D, 0 ); - } - g_texturesModeChangedNotify(); -} - -void Textures_SetMode(ETexturesMode mode) -{ - if(g_texture_mode != mode) - { - g_texture_mode = mode; - - Textures_ModeChanged(); - } -} - -void Textures_setTextureComponents(GLint texture_components) -{ - if(g_texture_globals.texture_components != texture_components) - { - Textures_Unrealise(); - g_texture_globals.texture_components = texture_components; - Textures_Realise(); - } -} - -void Textures_UpdateTextureCompressionFormat() -{ - GLint texture_components = GL_RGBA; - - if(!g_texturesmap->realised()) - { - texture_components = g_texture_globals.m_nTextureCompressionFormat; - if(texture_components == TEXTURECOMPRESSION_NONE) - texture_components = GL_RGBA; - } - else - { - if (g_texture_globals.bTextureCompressionSupported) - { - if(g_texture_globals.m_nTextureCompressionFormat != TEXTURECOMPRESSION_NONE - && g_texture_globals.m_nTextureCompressionFormat != TEXTURECOMPRESSION_RGBA - && !g_texture_globals.m_bS3CompressionSupported) - { - globalOutputStream() << "OpenGL extension GL_EXT_texture_compression_s3tc not supported by current graphics drivers\n"; - g_texture_globals.m_nTextureCompressionFormat = TEXTURECOMPRESSION_RGBA; // if this is not supported either, see below - } - if (g_texture_globals.m_nTextureCompressionFormat == TEXTURECOMPRESSION_RGBA && !g_texture_globals.m_bOpenGLCompressionSupported) - { - globalOutputStream() << "OpenGL extension GL_ARB_texture_compression not supported by current graphics drivers\n"; - g_texture_globals.m_nTextureCompressionFormat = TEXTURECOMPRESSION_NONE; - } - - switch (g_texture_globals.m_nTextureCompressionFormat) - { - case (TEXTURECOMPRESSION_NONE): - { - texture_components = GL_RGBA; - break; - } - case (TEXTURECOMPRESSION_RGBA): - { - texture_components = GL_COMPRESSED_RGBA_ARB; - break; - } - case (TEXTURECOMPRESSION_RGBA_S3TC_DXT1): - { - texture_components = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; - } - case (TEXTURECOMPRESSION_RGBA_S3TC_DXT3): - { - texture_components = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; - } - case (TEXTURECOMPRESSION_RGBA_S3TC_DXT5): - { - texture_components = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; - } - } - } - else - { - texture_components = GL_RGBA; - g_texture_globals.m_nTextureCompressionFormat = TEXTURECOMPRESSION_NONE; - } - } - - Textures_setTextureComponents(texture_components); -} - -void TextureCompressionImport(TextureCompressionFormat& self, int value) -{ - if(!g_texture_globals.m_bOpenGLCompressionSupported - && g_texture_globals.m_bS3CompressionSupported - && value >= 1) - { - ++value; - } - switch(value) - { - case 0: - self = TEXTURECOMPRESSION_NONE; - break; - case 1: - self = TEXTURECOMPRESSION_RGBA; - break; - case 2: - self = TEXTURECOMPRESSION_RGBA_S3TC_DXT1; - break; - case 3: - self = TEXTURECOMPRESSION_RGBA_S3TC_DXT3; - break; - case 4: - self = TEXTURECOMPRESSION_RGBA_S3TC_DXT5; - break; - } - Textures_UpdateTextureCompressionFormat(); -} -typedef ReferenceCaller1 TextureCompressionImportCaller; - -void TextureGammaImport(float& self, float value) -{ - if(self != value) - { - Textures_Unrealise(); - self = value; - Textures_Realise(); - } -} -typedef ReferenceCaller1 TextureGammaImportCaller; - -void TextureModeImport(ETexturesMode& self, int value) -{ - switch(value) - { - case 0: - Textures_SetMode(eTextures_NEAREST); - break; - case 1: - Textures_SetMode(eTextures_NEAREST_MIPMAP_NEAREST); - break; - case 2: - Textures_SetMode(eTextures_LINEAR); - break; - case 3: - Textures_SetMode(eTextures_NEAREST_MIPMAP_LINEAR); - break; - case 4: - Textures_SetMode(eTextures_LINEAR_MIPMAP_NEAREST); - break; - case 5: - Textures_SetMode(eTextures_LINEAR_MIPMAP_LINEAR); - break; - case 6: - Textures_SetMode(eTextures_MAX_ANISOTROPY); - } -} -typedef ReferenceCaller1 TextureModeImportCaller; - -void TextureModeExport(ETexturesMode& self, const IntImportCallback& importer) -{ - switch(self) - { - case eTextures_NEAREST: - importer(0); - break; - case eTextures_NEAREST_MIPMAP_NEAREST: - importer(1); - break; - case eTextures_LINEAR: - importer(2); - break; - case eTextures_NEAREST_MIPMAP_LINEAR: - importer(3); - break; - case eTextures_LINEAR_MIPMAP_NEAREST: - importer(4); - break; - case eTextures_LINEAR_MIPMAP_LINEAR: - importer(5); - break; - case eTextures_MAX_ANISOTROPY: - importer(6); - break; - default: - importer(4); - } -} -typedef ReferenceCaller1 TextureModeExportCaller; - -void Textures_constructPreferences(PreferencesPage& page) -{ - { - const char* percentages[] = { "12.5%", "25%", "50%", "100%", }; - page.appendRadio( - "Texture Quality", - STRING_ARRAY_RANGE(percentages), - LatchedIntImportCaller(g_Textures_textureQuality), - IntExportCaller(g_Textures_textureQuality.m_latched) - ); - } - page.appendSpinner( - "Texture Gamma", - 1.0, - 0.0, - 1.0, - FloatImportCallback(TextureGammaImportCaller(g_texture_globals.fGamma)), - FloatExportCallback(FloatExportCaller(g_texture_globals.fGamma)) - ); - { - const char* texture_mode[] = { "Nearest", "Nearest Mipmap", "Linear", "Bilinear", "Bilinear Mipmap", "Trilinear", "Anisotropy" }; - page.appendCombo( - "Texture Render Mode", - STRING_ARRAY_RANGE(texture_mode), - IntImportCallback(TextureModeImportCaller(g_texture_mode)), - IntExportCallback(TextureModeExportCaller(g_texture_mode)) - ); - } - { - const char* compression_none[] = { "None" }; - const char* compression_opengl[] = { "None", "OpenGL ARB" }; - const char* compression_s3tc[] = { "None", "S3TC DXT1", "S3TC DXT3", "S3TC DXT5" }; - const char* compression_opengl_s3tc[] = { "None", "OpenGL ARB", "S3TC DXT1", "S3TC DXT3", "S3TC DXT5" }; - StringArrayRange compression( - (g_texture_globals.m_bOpenGLCompressionSupported) - ? (g_texture_globals.m_bS3CompressionSupported) - ? STRING_ARRAY_RANGE(compression_opengl_s3tc) - : STRING_ARRAY_RANGE(compression_opengl) - : (g_texture_globals.m_bS3CompressionSupported) - ? STRING_ARRAY_RANGE(compression_s3tc) - : STRING_ARRAY_RANGE(compression_none) - ); - page.appendCombo( - "Hardware Texture Compression", - compression, - TextureCompressionImportCaller(g_texture_globals.m_nTextureCompressionFormat), - IntExportCaller(reinterpret_cast(g_texture_globals.m_nTextureCompressionFormat)) - ); - } -} -void Textures_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Textures", "Texture Settings")); - Textures_constructPreferences(page); -} -void Textures_registerPreferencesPage() -{ - PreferencesDialog_addDisplayPage(FreeCaller1()); -} - -void TextureCompression_importString(const char* string) -{ - g_texture_globals.m_nTextureCompressionFormat = static_cast(atoi(string)); - Textures_UpdateTextureCompressionFormat(); -} -typedef FreeCaller1 TextureCompressionImportStringCaller; - - -void Textures_Construct() -{ - g_texturesmap = new TexturesMap; - - GlobalPreferenceSystem().registerPreference("TextureCompressionFormat", TextureCompressionImportStringCaller(), IntExportStringCaller(reinterpret_cast(g_texture_globals.m_nTextureCompressionFormat))); - GlobalPreferenceSystem().registerPreference("TextureFiltering", IntImportStringCaller(reinterpret_cast(g_texture_mode)), IntExportStringCaller(reinterpret_cast(g_texture_mode))); - GlobalPreferenceSystem().registerPreference("TextureQuality", IntImportStringCaller(g_Textures_textureQuality.m_latched), IntExportStringCaller(g_Textures_textureQuality.m_latched)); - GlobalPreferenceSystem().registerPreference("SI_Gamma", FloatImportStringCaller(g_texture_globals.fGamma), FloatExportStringCaller(g_texture_globals.fGamma)); - - g_Textures_textureQuality.useLatched(); - - Textures_registerPreferencesPage(); - - Textures_ModeChanged(); -} -void Textures_Destroy() -{ - delete g_texturesmap; -} - - -#include "modulesystem/modulesmap.h" -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -class TexturesDependencies : - public GlobalRadiantModuleRef, - public GlobalOpenGLModuleRef, - public GlobalPreferenceSystemModuleRef -{ - ImageModulesRef m_image_modules; -public: - TexturesDependencies() : - m_image_modules(GlobalRadiant().getRequiredGameDescriptionKeyValue("texturetypes")) - { - } - ImageModules& getImageModules() - { - return m_image_modules.get(); - } -}; - -class TexturesAPI -{ - TexturesCache* m_textures; -public: - typedef TexturesCache Type; - STRING_CONSTANT(Name, "*"); - - TexturesAPI() - { - Textures_Construct(); - - m_textures = &GetTexturesCache(); - } - ~TexturesAPI() - { - Textures_Destroy(); - } - TexturesCache* getTable() - { - return m_textures; - } -}; - -typedef SingletonModule TexturesModule; -typedef Static StaticTexturesModule; -StaticRegisterModule staticRegisterTextures(StaticTexturesModule::instance()); - -ImageModules& Textures_getImageModules() -{ - return StaticTexturesModule::instance().getDependencies().getImageModules(); -} - - - diff --git a/radiant/textures.h b/radiant/textures.h index 0a570b7d..2261053a 100644 --- a/radiant/textures.h +++ b/radiant/textures.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,15 +19,34 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined (INCLUDED_TEXTURES_H) -#define INCLUDED_TEXTURES_H -#include "generic/callbackfwd.h" +// a texturename of the form (0 0 0) will +// create a solid color texture -void Textures_Realise(); -void Textures_Unrealise(); -void Textures_sharedContextDestroyed(); +void Texture_Init(); +void Texture_ShowDirectory (int menunum); +void Texture_ShowDirectory (); +void Texture_ShowAll(); +void WINAPI Texture_ShowInuse(); +extern char texture_directory[]; -void Textures_setModeChangedNotify(const Callback& notify); +// Timo +// added an optional IPluginTexdef when one is available +// we need a forward declaration, this is crap +class IPluginTexdef; +//++timo clean +void Texture_SetTexture2 (IShader *pShader, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef *pTexdef = NULL, bool bSetSelection = true); +void WINAPI Texture_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef *pTexdef = (IPluginTexdef*)NULL, bool bSetSelection = true); + +void Texture_SetMode(int iMenu); // GL_TEXTURE_NEAREST, etc.. +void Texture_ResetPosition(); + +// build the list of shader files used by PreloadShaders +void BuildShaderList(); +// preload the shaders: build a list of shader names and properties .. don't load their assets +void PreloadShaders(); +int WINAPI Texture_LoadSkin(char *pName, int *pnWidth, int *pnHeight); +qtexture_t* Texture_LoadFromPlugIn(void* vp); +void Texture_StartPos (void); +IShader* Texture_NextPos (int *x, int *y); -#endif diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 810fc195..0d7e54c1 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,656 +25,704 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "texwindow.h" - -#include "debugging/debugging.h" -#include "warnings.h" - -#include "ifilesystem.h" -#include "iundo.h" -#include "igl.h" -#include "iarchive.h" -#include "moduleobserver.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "signal/signal.h" -#include "math/vector.h" -#include "texturelib.h" -#include "string/string.h" -#include "shaderlib.h" -#include "os/file.h" -#include "os/path.h" -#include "stream/memstream.h" -#include "stream/textfilestream.h" -#include "stream/stringstream.h" -#include "cmdlib.h" -#include "texmanip.h" -#include "textures.h" -#include "convert.h" - -#include "gtkutil/menu.h" -#include "gtkutil/nonmodal.h" -#include "gtkutil/cursor.h" -#include "gtkutil/widget.h" -#include "gtkutil/glwidget.h" -#include "gtkutil/messagebox.h" - -#include "error.h" -#include "map.h" -#include "qgl.h" -#include "select.h" -#include "brush_primit.h" -#include "brushmanip.h" -#include "patchmanip.h" -#include "plugin.h" -#include "qe3.h" -#include "gtkdlgs.h" -#include "gtkmisc.h" -#include "mainframe.h" -#include "findtexturedialog.h" -#include "surfacedialog.h" -#include "patchdialog.h" -#include "groupdialog.h" -#include "preferences.h" -#include "shaders.h" -#include "commands.h" - -bool TextureBrowser_showWads() -{ - return !string_empty(g_pGameDescription->getKeyValue("show_wads")); -} - -void TextureBrowser_queueDraw(TextureBrowser& textureBrowser); - -bool string_equal_start(const char* string, StringRange start) -{ - return string_equal_n(string, start.first, start.last - start.first); -} - -typedef std::set TextureGroups; - -void TextureGroups_addWad(TextureGroups& groups, const char* archive) -{ - if(extension_equal(path_get_extension(archive), "wad")) - { -#if 1 - groups.insert(archive); -#else - CopiedString archiveBaseName(path_get_filename_start(archive), path_get_filename_base_end(archive)); - groups.insert(archiveBaseName); -#endif - } -} -typedef ReferenceCaller1 TextureGroupsAddWadCaller; - -void TextureGroups_addShader(TextureGroups& groups, const char* shaderName) -{ - const char* texture = path_make_relative(shaderName, "textures/"); - if(texture != shaderName) - { - const char* last = path_remove_directory(texture); - if(!string_empty(last)) - { - groups.insert(CopiedString(StringRange(texture, --last))); - } - } -} -typedef ReferenceCaller1 TextureGroupsAddShaderCaller; - -void TextureGroups_addDirectory(TextureGroups& groups, const char* directory) -{ - groups.insert(directory); -} -typedef ReferenceCaller1 TextureGroupsAddDirectoryCaller; - -namespace -{ - bool g_TextureBrowser_shaderlistOnly = false; - bool g_TextureBrowser_fixedSize = false; - bool g_TextureBrowser_filterNotex = false; -} - -class DeferredAdjustment -{ - gdouble m_value; - guint m_handler; - typedef void (*ValueChangedFunction)(void* data, gdouble value); - ValueChangedFunction m_function; - void* m_data; - - static gboolean deferred_value_changed(gpointer data) - { - reinterpret_cast(data)->m_function( - reinterpret_cast(data)->m_data, - reinterpret_cast(data)->m_value - ); - reinterpret_cast(data)->m_handler = 0; - reinterpret_cast(data)->m_value = 0; - return FALSE; - } -public: - DeferredAdjustment(ValueChangedFunction function, void* data) : m_value(0), m_handler(0), m_function(function), m_data(data) - { - } - void flush() - { - if(m_handler != 0) - { - g_source_remove(m_handler); - deferred_value_changed(this); - } - } - void value_changed(gdouble value) - { - m_value = value; - if(m_handler == 0) - { - m_handler = g_idle_add(deferred_value_changed, this); - } - } - static void adjustment_value_changed(GtkAdjustment *adjustment, DeferredAdjustment* self) - { - self->value_changed(adjustment->value); - } -}; - - - -class TextureBrowser; - -typedef ReferenceCaller TextureBrowserQueueDrawCaller; - -void TextureBrowser_scrollChanged(void* data, gdouble value); - - -enum StartupShaders -{ - STARTUPSHADERS_NONE = 0, - STARTUPSHADERS_COMMON, -}; - -void TextureBrowser_hideUnusedExport(const BoolImportCallback& importer); -typedef FreeCaller1 TextureBrowserHideUnusedExport; - -void TextureBrowser_showShadersExport(const BoolImportCallback& importer); -typedef FreeCaller1 TextureBrowserShowShadersExport; - -void TextureBrowser_showShaderlistOnly(const BoolImportCallback& importer); -typedef FreeCaller1 TextureBrowserShowShaderlistOnlyExport; - -void TextureBrowser_fixedSize(const BoolImportCallback& importer); -typedef FreeCaller1 TextureBrowserFixedSizeExport; - -void TextureBrowser_filterNotex(const BoolImportCallback& importer); -typedef FreeCaller1 TextureBrowserFilterNotexExport; - -class TextureBrowser -{ -public: - int width, height; - int originy; - int m_nTotalHeight; - - CopiedString shader; - - GtkWindow* m_parent; - GtkWidget* m_gl_widget; - GtkWidget* m_texture_scroll; - GtkWidget* m_treeViewTree; - GtkWidget* m_treeViewTags; - GtkWidget* m_tag_frame; - GtkListStore* m_assigned_store; - GtkListStore* m_available_store; - GtkWidget* m_assigned_tree; - GtkWidget* m_available_tree; - GtkWidget* m_scr_win_tree; - GtkWidget* m_scr_win_tags; - GtkWidget* m_tag_notebook; - GtkWidget* m_search_button; - GtkWidget* m_shader_info_item; - - std::set m_all_tags; - GtkListStore* m_all_tags_list; - std::vector m_copied_tags; - std::set m_found_shaders; - - ToggleItem m_hideunused_item; - ToggleItem m_showshaders_item; - ToggleItem m_showshaderlistonly_item; - ToggleItem m_fixedsize_item; - ToggleItem m_filternotex_item; - - guint m_sizeHandler; - guint m_exposeHandler; - - bool m_heightChanged; - bool m_originInvalid; - - DeferredAdjustment m_scrollAdjustment; - FreezePointer m_freezePointer; - - Vector3 color_textureback; - // the increment step we use against the wheel mouse - std::size_t m_mouseWheelScrollIncrement; - std::size_t m_textureScale; - // make the texture increments match the grid changes - bool m_showShaders; - bool m_showTextureScrollbar; - StartupShaders m_startupShaders; - // if true, the texture window will only display in-use shaders - // if false, all the shaders in memory are displayed - bool m_hideUnused; - bool m_rmbSelected; - bool m_searchedTags; - bool m_tags; - // The uniform size (in pixels) that textures are resized to when m_resizeTextures is true. - int m_uniformTextureSize; - // Return the display width of a texture in the texture browser - int getTextureWidth(qtexture_t* tex) - { - int width; - if (!g_TextureBrowser_fixedSize) - { - // Don't use uniform size - width = (int)(tex->width * ((float)m_textureScale / 100)); - } else if - (tex->width >= tex->height) - { - // Texture is square, or wider than it is tall - width = m_uniformTextureSize; - } else { - // Otherwise, preserve the texture's aspect ratio - width = (int)(m_uniformTextureSize * ((float)tex->width / tex->height)); - } - return width; - } - // Return the display height of a texture in the texture browser - int getTextureHeight(qtexture_t* tex) - { - int height; - if (!g_TextureBrowser_fixedSize) - { - // Don't use uniform size - height = (int)(tex->height * ((float)m_textureScale / 100)); - } else if (tex->height >= tex->width) - { - // Texture is square, or taller than it is wide - height = m_uniformTextureSize; - } else { - // Otherwise, preserve the texture's aspect ratio - height = (int)(m_uniformTextureSize * ((float)tex->height / tex->width)); - } - return height; - } - - TextureBrowser() : - m_texture_scroll(0), - m_hideunused_item(TextureBrowserHideUnusedExport()), - m_showshaders_item(TextureBrowserShowShadersExport()), - m_showshaderlistonly_item(TextureBrowserShowShaderlistOnlyExport()), - m_fixedsize_item(TextureBrowserFixedSizeExport()), - m_filternotex_item(TextureBrowserFilterNotexExport()), - m_heightChanged(true), - m_originInvalid(true), - m_scrollAdjustment(TextureBrowser_scrollChanged, this), - color_textureback(0.25f, 0.25f, 0.25f), - m_mouseWheelScrollIncrement(64), - m_textureScale(50), - m_showShaders(true), - m_showTextureScrollbar(true), - m_startupShaders(STARTUPSHADERS_NONE), - m_hideUnused(false), - m_rmbSelected(false), - m_searchedTags(false), - m_tags(false), - m_uniformTextureSize(128) - { - } -}; - -void(*TextureBrowser_textureSelected)(const char* shader); - - -void TextureBrowser_updateScroll(TextureBrowser& textureBrowser); - - -const char* TextureBrowser_getComonShadersName() -{ - const char* value = g_pGameDescription->getKeyValue("common_shaders_name"); - if(!string_empty(value)) - { - return value; - } - return "Common"; -} - -const char* TextureBrowser_getComonShadersDir() -{ - const char* value = g_pGameDescription->getKeyValue("common_shaders_dir"); - if(!string_empty(value)) - { - return value; - } - return "common/"; -} - -inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser) -{ - return GlobalOpenGL().m_fontHeight; -} - -const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser) -{ - return textureBrowser.shader.c_str(); -} - -void TextureBrowser_SetStatus(TextureBrowser& textureBrowser, const char* name) -{ - IShader* shader = QERApp_Shader_ForName( name); - qtexture_t* q = shader->getTexture(); - StringOutputStream strTex(256); - strTex << name << " W: " << Unsigned(q->width) << " H: " << Unsigned(q->height); - shader->DecRef(); - g_pParentWnd->SetStatusText(g_pParentWnd->m_texture_status, strTex.c_str()); -} - -void TextureBrowser_Focus(TextureBrowser& textureBrowser, const char* name); - -void TextureBrowser_SetSelectedShader(TextureBrowser& textureBrowser, const char* shader) -{ - textureBrowser.shader = shader; - TextureBrowser_SetStatus(textureBrowser, shader); - TextureBrowser_Focus(textureBrowser, shader); - - if(FindTextureDialog_isOpen()) - { - FindTextureDialog_selectTexture(shader); - } - - // disable the menu item "shader info" if no shader was selected - IShader* ishader = QERApp_Shader_ForName(shader); - CopiedString filename = ishader->getShaderFileName(); - - if(filename.empty()) - { - if(textureBrowser.m_shader_info_item != NULL) - { - gtk_widget_set_sensitive(textureBrowser.m_shader_info_item, FALSE); - } - } else { - gtk_widget_set_sensitive(textureBrowser.m_shader_info_item, TRUE); - } - - ishader->DecRef(); -} - - -CopiedString g_TextureBrowser_currentDirectory; - -/* -============================================================================ - -TEXTURE LAYOUT - -TTimo: now based on a rundown through all the shaders -NOTE: we expect the Active shaders count doesn't change during a Texture_StartPos .. Texture_NextPos cycle - otherwise we may need to rely on a list instead of an array storage -============================================================================ +/*!\todo +Clean up texture menu. +- Remove all global variables and use some objects instead. +- Create an interface for a plugin to add texture menu items. +- Make sure the interface is not dependent on gtk. */ -class TextureLayout +#ifdef _WIN32 +//#include +#include +#endif +#if defined (__linux__) || defined (__APPLE__) +#include +#include +#endif +#include +#include +#include +#include "stdafx.h" +#include "texwindow.h" +#include "str.h" +#include "missing.h" +#include "texmanip.h" + +#define TYP_MIPTEX 68 +static unsigned tex_palette[256]; + +#define FONT_HEIGHT 10 + +//int texture_mode = GL_NEAREST; +//int texture_mode = GL_NEAREST_MIPMAP_NEAREST; +//int texture_mode = GL_NEAREST_MIPMAP_LINEAR; +//int texture_mode = GL_LINEAR; +//int texture_mode = GL_LINEAR_MIPMAP_NEAREST; +int texture_mode = GL_LINEAR_MIPMAP_LINEAR; + +int g_nTextureOffset = 0; + +// current active texture directory +//++timo FIXME: I'm not sure this is used anymore +char texture_directory[128]; +// if true, the texture window will only display in-use shaders +// if false, all the shaders in memory are displayed +qboolean g_bShowAllShaders; + +bool g_bFilterEnabled = false; +CString g_strFilter; + +// texture layout functions +// TTimo: now based on shaders +int nActiveShadersCount; +int nCurrentShader; +IShader* pCurrentShader; +qtexture_t *current_texture = NULL; +int current_x, current_y, current_row; + +// globals for textures +int texture_nummenus; +char texture_menunames[MAX_TEXTUREDIRS][128]; + +// the list of scripts/*.shader files we need to work with +// those are listed in shaderlist file +// FIXME TTimo I get the feeling that those would need to move to the shaders module +// for now it's still more simple to just keep it here +GSList *l_shaderfiles = NULL; + +void SelectTexture (int mx, int my, bool bShift, bool bFitScale=false); + +void Texture_MouseDown (int x, int y, int buttons); +void Texture_MouseMoved (int x, int y, int buttons); + +CPtrArray g_lstSkinCache; + +// TTimo: modifed to add a qtexture_t, Texture_LoadSkin loads using the shader API / QERApp_TryTexture_ForName +// m_strName is a copy of qtex->name +struct SkinInfo { -public: - // texture layout functions - // TTimo: now based on shaders - int current_x, current_y, current_row; + CString m_strName; + int m_nTextureBind; + qtexture_t *m_qtex; + SkinInfo(const char *pName, int n, qtexture_t *qtex) + { + m_strName = pName; + m_nTextureBind = n; + m_qtex = qtex; + }; + SkinInfo(){}; }; -void Texture_StartPos(TextureLayout& layout) +// ============================================================================= +// global functions + +// gets active texture extension +// +// FIXME: fix this to be generic from project file +// +int GetTextureExtensionCount() { - layout.current_x = 8; - layout.current_y = -8; - layout.current_row = 0; + // hardcoded hack for png support + if (g_pGameDescription->mGameFile == "sof2.game") + return 3; + else + return 2; } -void Texture_NextPos(TextureBrowser& textureBrowser, TextureLayout& layout, qtexture_t* current_texture, int *x, int *y) +const char* GetTextureExtension(int nIndex) { - qtexture_t* q = current_texture; - - int nWidth = textureBrowser.getTextureWidth(q); - int nHeight = textureBrowser.getTextureHeight(q); - if (layout.current_x + nWidth > textureBrowser.width-8 && layout.current_row) - { // go to the next row unless the texture is the first on the row - layout.current_x = 8; - layout.current_y -= layout.current_row + TextureBrowser_fontHeight(textureBrowser) + 4; - layout.current_row = 0; - } - - *x = layout.current_x; - *y = layout.current_y; - - // Is our texture larger than the row? If so, grow the - // row height to match it - - if (layout.current_row < nHeight) - layout.current_row = nHeight; - - // never go less than 96, or the names get all crunched up - layout.current_x += nWidth < 96 ? 96 : nWidth; - layout.current_x += 8; -} - -bool TextureSearch_IsShown(const char* name) -{ - std::set::iterator iter; - - iter = GlobalTextureBrowser().m_found_shaders.find(name); - - if(iter == GlobalTextureBrowser().m_found_shaders.end()) + switch(nIndex) { - return false; - } else { - return true; + case 0: + return "tga"; + break; + case 1: + return "jpg"; + break; + case 2: + return "png"; + break; + default: + return NULL; } } -CopiedString g_notex; -CopiedString g_shadernotex; - -// if texture_showinuse jump over non in-use textures -bool Texture_IsShown(IShader* shader, bool show_shaders, bool hideUnused) -{ - // filter notex / shadernotex images - if(g_TextureBrowser_filterNotex && (string_equal(g_notex.c_str(), shader->getTexture()->name) || string_equal(g_shadernotex.c_str(), shader->getTexture()->name))) - { - return false; - } - - if(g_TextureBrowser_currentDirectory == "Untagged") - { - std::set::iterator iter; - - iter = GlobalTextureBrowser().m_found_shaders.find(shader->getName()); - - if(iter == GlobalTextureBrowser().m_found_shaders.end()) - { - return false; - } else { - return true; - } - } - - if(!shader_equal_prefix(shader->getName(), "textures/")) - return false; - - if (!show_shaders && !shader->IsDefault()) - return false; - - if(hideUnused && !shader->IsInUse()) - return false; - - if(GlobalTextureBrowser().m_searchedTags) - { - if(!TextureSearch_IsShown(shader->getName())) - { - return false; - } else { - return true; - } - } else { - if(!shader_equal_prefix(shader_get_textureName(shader->getName()), g_TextureBrowser_currentDirectory.c_str())) - { - return false; - } - } - - return true; -} - -void TextureBrowser_heightChanged(TextureBrowser& textureBrowser) -{ - textureBrowser.m_heightChanged = true; - - TextureBrowser_updateScroll(textureBrowser); - TextureBrowser_queueDraw(textureBrowser); -} - -void TextureBrowser_evaluateHeight(TextureBrowser& textureBrowser) -{ - if(textureBrowser.m_heightChanged) - { - textureBrowser.m_heightChanged = false; - - textureBrowser.m_nTotalHeight = 0; - - TextureLayout layout; - Texture_StartPos(layout); - for(QERApp_ActiveShaders_IteratorBegin(); !QERApp_ActiveShaders_IteratorAtEnd(); QERApp_ActiveShaders_IteratorIncrement()) - { - IShader* shader = QERApp_ActiveShaders_IteratorCurrent(); - - if(!Texture_IsShown(shader, textureBrowser.m_showShaders, textureBrowser.m_hideUnused)) - continue; - - int x, y; - Texture_NextPos(textureBrowser, layout, shader->getTexture(), &x, &y); - textureBrowser.m_nTotalHeight = std::max(textureBrowser.m_nTotalHeight, abs(layout.current_y) + TextureBrowser_fontHeight(textureBrowser) + textureBrowser.getTextureHeight(shader->getTexture()) + 4); - } - } -} - -int TextureBrowser_TotalHeight(TextureBrowser& textureBrowser) -{ - TextureBrowser_evaluateHeight(textureBrowser); - return textureBrowser.m_nTotalHeight; -} - -inline const int& min_int(const int& left, const int& right) -{ - return std::min(left, right); -} - -void TextureBrowser_clampOriginY(TextureBrowser& textureBrowser) -{ - if(textureBrowser.originy > 0) - { - textureBrowser.originy = 0; - } - int lower = min_int(textureBrowser.height - TextureBrowser_TotalHeight(textureBrowser), 0); - if(textureBrowser.originy < lower) - { - textureBrowser.originy = lower; - } -} - -int TextureBrowser_getOriginY(TextureBrowser& textureBrowser) -{ - if(textureBrowser.m_originInvalid) - { - textureBrowser.m_originInvalid = false; - TextureBrowser_clampOriginY(textureBrowser); - TextureBrowser_updateScroll(textureBrowser); - } - return textureBrowser.originy; -} - -void TextureBrowser_setOriginY(TextureBrowser& textureBrowser, int originy) -{ - textureBrowser.originy = originy; - TextureBrowser_clampOriginY(textureBrowser); - TextureBrowser_updateScroll(textureBrowser); - TextureBrowser_queueDraw(textureBrowser); -} - - -Signal0 g_activeShadersChangedCallbacks; - -void TextureBrowser_addActiveShadersChangedCallback(const SignalHandler& handler) -{ - g_activeShadersChangedCallbacks.connectLast(handler); -} - -class ShadersObserver : public ModuleObserver -{ - Signal0 m_realiseCallbacks; -public: - void realise() - { - m_realiseCallbacks(); - } - void unrealise() - { - } - void insert(const SignalHandler& handler) - { - m_realiseCallbacks.connectLast(handler); - } -}; - -namespace -{ - ShadersObserver g_ShadersObserver; -} - -void TextureBrowser_addShadersRealiseCallback(const SignalHandler& handler) -{ - g_ShadersObserver.insert(handler); -} - -void TextureBrowser_activeShadersChanged(TextureBrowser& textureBrowser) -{ - TextureBrowser_heightChanged(textureBrowser); - textureBrowser.m_originInvalid = true; - - g_activeShadersChangedCallbacks(); -} - -void TextureBrowser_importShowScrollbar(TextureBrowser& textureBrowser, bool value) -{ - textureBrowser.m_showTextureScrollbar = value; - if(textureBrowser.m_texture_scroll != 0) - { - widget_set_visible(textureBrowser.m_texture_scroll, textureBrowser.m_showTextureScrollbar); - TextureBrowser_updateScroll(textureBrowser); - } -} -typedef ReferenceCaller1 TextureBrowserImportShowScrollbarCaller; - - /* ============== -TextureBrowser_ShowDirectory +Texture_InitPalette +============== +*/ +void Texture_InitPalette (byte *pal) +{ + int r,g,b; + int i; + int inf; + byte gammatable[256]; + float gamma; + + gamma = g_qeglobals.d_savedinfo.fGamma; + + if (gamma == 1.0) + { + for (i=0 ; i<256 ; i++) + gammatable[i] = i; + } else + { + for (i=0 ; i<256 ; i++) + { + inf = (int)( 255.0f * pow( ( i + 0.5f ) / 255.5f , gamma ) + 0.5f ); + if (inf < 0) + inf = 0; + if (inf > 255) + inf = 255; + gammatable[i] = inf; + } + } + + for (i=0 ; i<256 ; i++) + { + r = gammatable[pal[0]]; + g = gammatable[pal[1]]; + b = gammatable[pal[2]]; + pal += 3; + + //v = (r<<24) + (g<<16) + (b<<8) + 255; + //v = BigLong (v); + + //tex_palette[i] = v; + tex_palette[i*3+0] = r; + tex_palette[i*3+1] = g; + tex_palette[i*3+2] = b; + } +} + +void SetTexParameters (void) +{ + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texture_mode ); + + switch ( texture_mode ) + { + case GL_NEAREST: + case GL_NEAREST_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); + break; + case GL_LINEAR: + case GL_LINEAR_MIPMAP_NEAREST: + case GL_LINEAR_MIPMAP_LINEAR: + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + break; + } +} + +/* +============ +Texture_SetMode +============ +*/ +void Texture_SetMode(int iMenu) +{ + int iMode; + qboolean texturing = true; + gpointer item = NULL; + + switch (iMenu) + { + case ID_VIEW_NEAREST: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_nearest"); + iMode = GL_NEAREST; + break; + case ID_VIEW_NEARESTMIPMAP: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_nearestmipmap"); + iMode = GL_NEAREST_MIPMAP_NEAREST; + break; + case ID_VIEW_LINEAR: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_linear"); + iMode = GL_LINEAR; + break; + case ID_VIEW_BILINEAR: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_bilinear"); + iMode = GL_NEAREST_MIPMAP_LINEAR; + break; + case ID_VIEW_BILINEARMIPMAP: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_bilinearmipmap"); + iMode = GL_LINEAR_MIPMAP_NEAREST; + break; + case ID_VIEW_TRILINEAR: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_trilinear"); + iMode = GL_LINEAR_MIPMAP_LINEAR; + break; + case ID_TEXTURES_WIREFRAME: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_wireframe"); + iMode = -1; + texturing = false; + break; + case ID_TEXTURES_FLATSHADE: + item = g_object_get_data (G_OBJECT (g_pParentWnd->m_pWidget), "menu_view_flatshade"); + iMode = -1; + texturing = false; + break; + } + + g_qeglobals.d_savedinfo.iTexMenu = iMenu; + // NOTE: texture_mode is a GLenum used directly in glTexParameter + if(iMode!=-1) texture_mode = iMode; + + g_bIgnoreCommands++; + if (item != NULL) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); + g_bIgnoreCommands--; + + if (texturing) + SetTexParameters (); + + if ( !texturing && iMenu == ID_TEXTURES_WIREFRAME) + { + g_pParentWnd->GetCamWnd()->Camera()->draw_mode = cd_wire; + Map_BuildBrushData(); + Sys_UpdateWindows (W_ALL); + return; + } else if ( !texturing && iMenu == ID_TEXTURES_FLATSHADE) + { + g_pParentWnd->GetCamWnd()->Camera()->draw_mode = cd_solid; + Map_BuildBrushData(); + Sys_UpdateWindows (W_ALL); + return; + } + + for (qtexture_t *q = g_qeglobals.d_qtextures; q; q = q->next) + { + qglBindTexture (GL_TEXTURE_2D, q->texture_number); + SetTexParameters (); + } + + // select the default texture + qglBindTexture( GL_TEXTURE_2D, 0 ); + + qglFinish(); + + if (g_pParentWnd->GetCamWnd()->Camera()->draw_mode != cd_texture) + { + g_pParentWnd->GetCamWnd()->Camera()->draw_mode = cd_texture; + Map_BuildBrushData(); + } + + Sys_UpdateWindows (W_ALL); +} + +/*! +gamma correction stuff +took out of QERApp_LoadTextureRGBA for clarity +*/ +byte g_gammatable[256]; +void ResampleGamma(float fGamma) +{ + int i,inf; + if (fGamma == 1.0) + { + for (i = 0; i < 256; i++) + g_gammatable[i] = i; + } else + { + for (i = 0; i < 256; i++) + { + inf = (int)( 255.0f * pow( (i + 0.5f) / 255.5f , fGamma ) + 0.5f ); + if (inf < 0) + inf = 0; + if (inf > 255) + inf = 255; + g_gammatable[i] = inf; + } + } +} + +/*! +this function does the actual processing of raw RGBA data into a GL texture +it will also generate the mipmaps +it looks like pPixels nWidth nHeight are the only relevant parameters +*/ +qtexture_t *QERApp_LoadTextureRGBA(unsigned char* pPixels, int nWidth, int nHeight) +{ + static float fGamma = -1; + float total[3]; + byte *outpixels = NULL; + int i, j, resampled, width2, height2, width3, height3; + int max_tex_size = 0, mip = 0; + int nCount = nWidth * nHeight; + + if (fGamma != g_qeglobals.d_savedinfo.fGamma) + { + fGamma = g_qeglobals.d_savedinfo.fGamma; + ResampleGamma(fGamma); + } + + qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_tex_size); + if (!max_tex_size) + max_tex_size = 1024; + + qtexture_t *q = (qtexture_t*)g_malloc(sizeof(*q)); + q->width = nWidth; + q->height = nHeight; + + total[0] = total[1] = total[2] = 0.0f; + + // resample texture gamma according to user settings + for (i = 0; i < (nCount * 4); i += 4) + { + for (j = 0; j < 3; j++) + { + total[j] += (pPixels + i)[j]; + byte b = (pPixels + i)[j]; + (pPixels + i)[j] = g_gammatable[b]; + } + } + + q->color[0] = total[0] / (nCount * 255); + q->color[1] = total[1] / (nCount * 255); + q->color[2] = total[2] / (nCount * 255); + + qglGenTextures (1, &q->texture_number); + + qglBindTexture( GL_TEXTURE_2D, q->texture_number ); + + SetTexParameters(); + + width2 = 1; while (width2 < nWidth) width2 <<= 1; + height2 = 1; while (height2 < nHeight) height2 <<= 1; + + width3 = width2; + height3 = height2; + while (width3 > max_tex_size) width3 >>= 1; + while (height3 > max_tex_size) height3 >>= 1; + if (width3 < 1) width3 = 1; + if (height3 < 1) height3 = 1; + + if (!(width2 == nWidth && height2 == nHeight)) { + resampled = 1; + outpixels = (byte *)malloc(width2 * height2 * 4); + R_ResampleTexture(pPixels, nWidth, nHeight, outpixels, width2, height2, 4); + } else { + resampled = 0; + outpixels = pPixels; + } + + while (width2 > width3 || height2 > height3) + { + GL_MipReduce(outpixels, outpixels, width2, height2, width3, height3); + + if (width2 > width3) + width2 >>= 1; + if (height2 > height3) + height2 >>= 1; + } + + qglTexImage2D(GL_TEXTURE_2D, mip++, g_qeglobals.texture_components, width2, height2, 0, GL_RGBA, GL_UNSIGNED_BYTE, outpixels); + while (width2 > 1 || height2 > 1) + { + GL_MipReduce(outpixels, outpixels, width2, height2, 1, 1); + + if (width2 > 1) + width2 >>= 1; + if (height2 > 1) + height2 >>= 1; + + qglTexImage2D(GL_TEXTURE_2D, mip++, g_qeglobals.texture_components, width2, height2, 0, GL_RGBA, GL_UNSIGNED_BYTE, outpixels); + } + + qglBindTexture(GL_TEXTURE_2D, 0); + if (resampled) + free(outpixels); + + return q; +} + +/* +================== +DumpUnreferencedShaders +usefull function: dumps the list of .shader files that are not referenced to the console +================== +*/ +void DumpUnreferencedShaders() +{ + GSList *lst, *sh, *files; + bool bFound = false; + + files = vfsGetFileList ("scripts", "shader"); + for (lst = files; lst; lst = lst->next) + { + bool listed = false; + + for (sh = l_shaderfiles; sh != NULL; sh = g_slist_next (sh)) + if (!strcmp ((char*)sh->data, (char*)lst->data)) + { + listed = true; + break; + } + + if (!listed) + { + if (!bFound) + { + bFound = true; + Sys_FPrintf (SYS_WRN, "Following shader files are not referenced in shaderlist.txt:\n"); + } + Sys_FPrintf (SYS_WRN, "%s\n", (char*)lst->data); + } + } + + vfsClearFileDirList (&files); +} + +/* +================== +BuildShaderList +build a CStringList of shader names +================== +*/ +void BuildShaderList() +{ + int count; + char filename[1024]; + char *pBuff; + char dirstring[NAME_MAX]; + int nLen; + if (l_shaderfiles!=NULL) + { + g_slist_free(l_shaderfiles); + l_shaderfiles = NULL; + } + + if (g_pGameDescription->mGameFile != "hl.game") + { + strcpy(filename, g_pGameDescription->mShaderlist.GetBuffer()); + count = vfsGetFileCount(filename, 0 ); + if (count==0) + { + Sys_FPrintf(SYS_ERR, "Couldn't find '%s'\n", g_pGameDescription->mShaderlist.GetBuffer()); + return; + } + // NOTE TTimo we use vfsGetFullPath solely to get the full path of the shader list we are gonna load + // but we actually send the relative path to vfsLoadFile + // so let's hope there is no disparity between the two functions + if (!vfsGetFullPath(filename, 0, 0)) + { + Sys_FPrintf(SYS_ERR, "Couldn't find full path for '%s'\n", g_pGameDescription->mShaderlist.GetBuffer()); + Sys_FPrintf(SYS_ERR, "did you hit bug http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 ?\n"); + return; + } + Sys_Printf("Parsing shader files from %s\n", vfsGetFullPath(filename, 0, 0)); + nLen = vfsLoadFile (filename, reinterpret_cast(&pBuff), 0); + if (nLen > 0) + { + StartTokenParsing(pBuff); + nLen = 0; + while (GetToken(true)) + { + GSList *tmp; + bool found = false; + + // each token should be a shader filename + sprintf(dirstring, "%s.shader", token); + + for (tmp = l_shaderfiles; tmp != NULL; tmp = tmp->next) + { + if (!strcmp (dirstring, (char*)tmp->data)) + { + found = true; + Sys_FPrintf(SYS_WRN, "duplicate entry \"%s\" in shaderlist.txt\n", (char*)tmp->data); + break; + } + } + + if (!found) + { + l_shaderfiles = g_slist_append (l_shaderfiles, strdup (dirstring)); + nLen++; + } + } + g_free(pBuff); + } + } +} + +/* +================== +FillTextureMenu + +================== +*/ +void ClearGSList (GSList* lst) +{ + GSList *p = lst; + while (p) + { + free (p->data); + p = g_slist_remove (p, p->data); + } +} + +void FillTextureMenu (GSList** pArray) +{ + GtkWidget *menu, *sep, *item; // point to the Textures GtkMenu and to the last separator + GList *lst; + GSList *texdirs = NULL; + GSList *texdirs_tmp = NULL; + GSList *p; + char dirRoot[NAME_MAX]; + // this is an index used to count the number of texture items (for splitting/avoiding to get out of window) + // we start with a != 0 value to compensate for the initial number of items in the texture menu + int nMenuCount = 12; + + // delete everything + menu = GTK_WIDGET (g_object_get_data (G_OBJECT (g_qeglobals_gui.d_main_window), "menu_textures")); + sep = GTK_WIDGET (g_object_get_data (G_OBJECT (g_qeglobals_gui.d_main_window), "menu_textures_separator")); + lst = g_list_find (gtk_container_children (GTK_CONTAINER (menu)), sep); + while (lst->next) + { + // these delete functions are recursive, it's gonna free all submenus + gtk_widget_destroy (GTK_WIDGET (lst->next->data)); + // lst is no longer relevant, need to get it again + lst = g_list_find (gtk_container_children (GTK_CONTAINER (menu)), sep); + } + + texture_nummenus = 0; + + // add everything + if (!g_qeglobals.d_project_entity) + return; + + // scan texture dirs and pak files only if not restricting to shaderlist + if (!g_PrefsDlg.m_bTexturesShaderlistOnly) + { + texdirs_tmp = vfsGetDirList ("textures/"); + for (p=texdirs_tmp; p; p=g_slist_next(p)) + { + // Hydra: erm, this didn't used to do anything except leak memory... + // For Halflife support this is required to work however. + // g_slist_append(texdirs, p->data); + texdirs = g_slist_append(texdirs, strdup((char *)p->data)); + } + vfsClearFileDirList (&texdirs_tmp); + } + + // scan the shaders in shaderlist.txt + BuildShaderList (); + PreloadShaders (); + DumpUnreferencedShaders (); + while (l_shaderfiles != NULL) + { + char shaderfile[PATH_MAX]; + gboolean found = FALSE; + + ExtractFileName ((char*)l_shaderfiles->data, shaderfile); + StripExtension (shaderfile); + g_strdown (shaderfile); + + for (GSList *tmp = texdirs; tmp; tmp = g_slist_next (tmp)) + if (!strcasecmp ((char*)tmp->data, shaderfile)) + { + found = TRUE; + break; + } + + if (!found) + texdirs = g_slist_prepend (texdirs, strdup (shaderfile)); + + free (l_shaderfiles->data); + l_shaderfiles = g_slist_remove (l_shaderfiles, l_shaderfiles->data); + } + + // sort the list + texdirs = g_slist_sort (texdirs, (GCompareFunc)strcmp); + + GSList *temp = texdirs; + while (temp) + { + char* ptr = strchr ((char*)temp->data, '_'); + + // do we shrink the menus? + if (ptr != NULL) + { + // extract the root + strcpy (dirRoot, (char*)temp->data); + dirRoot[ptr - (char*)temp->data + 1] = 0; + + // we shrink only if we have at least two things to shrink :-) + if (temp->next && (strstr ((char*)temp->next->data, dirRoot) == (char*)temp->next->data)) + { + GtkWidget *pSubMenu = gtk_menu_new (); + GtkWidget *pSubMenuRef = pSubMenu; + // keep going... + do + { + item = gtk_menu_item_new_with_label ((char*)temp->data); + gtk_widget_show (item); + CheckMenuSplitting (pSubMenu); + gtk_container_add (GTK_CONTAINER (pSubMenu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (CMD_TEXTUREWAD+texture_nummenus)); + + strcpy (texture_menunames[texture_nummenus], (char*)temp->data); + strcat (texture_menunames[texture_nummenus], "/"); + if (pArray) + *pArray = g_slist_append (*pArray, strdup ((char*)temp->data)); + if (++texture_nummenus == MAX_TEXTUREDIRS) + { + Sys_Printf("WARNING: max texture directories count has been reached!\n"); + // push submenu and get out + item = gtk_menu_item_new_with_label (dirRoot); + gtk_widget_show (item); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), pSubMenu); + ClearGSList (texdirs); + return; + } + temp = temp->next; + } + while (temp && (strstr((char*)temp->data, dirRoot)==temp->data)); + + ptr = strchr (dirRoot, '_'); + *ptr = 0; + item = gtk_menu_item_new_with_label (dirRoot); + gtk_widget_show (item); + CheckMenuSplitting (menu); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), pSubMenuRef); + continue; + } + } + + item = gtk_menu_item_new_with_label ((char*)temp->data); + gtk_widget_show (item); + CheckMenuSplitting (menu); + gtk_container_add (GTK_CONTAINER (menu), item); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (CMD_TEXTUREWAD+texture_nummenus)); + + strcpy (texture_menunames[texture_nummenus], (char*)temp->data); + strcat (texture_menunames[texture_nummenus], "/"); + if (pArray) + *pArray = g_slist_append (*pArray, strdup ((char*)temp->data)); + if (++texture_nummenus == MAX_TEXTUREDIRS) + { + Sys_Printf("WARNING: max texture directories count has been reached!\n"); + ClearGSList (texdirs); + return; + } + + temp = temp->next; + } + ClearGSList (texdirs); +} + +/* +============== +Texture_ShowDirectory relies on texture_directory global for the directory to use +called by + void Texture_ShowDirectory (int menunum, bool bLinked) + void Texture_ShowDirectory (char* pPath, bool bLinked) 1) Load the shaders for the given directory 2) Scan the remaining texture, load them and assign them a default shader (the "noshader" shader) NOTE: when writing a texture plugin, or some texture extensions, this function may need to be overriden, and made @@ -685,336 +733,445 @@ NOTE: for texture window layout: ( the GL textures are not flushed though) ============== */ -bool texture_name_ignore(const char* name) +void Texture_ShowDirectory () { - StringOutputStream strTemp(string_length(name)); - strTemp << LowerCase(name); + char name[1024]; + char dirstring[1024]; + CString strTemp; + int shaders_count = 0; + int textures_count = 0; + GSList *files = NULL, *temp; - return strstr(strTemp.c_str(), ".specular") != 0 || - strstr(strTemp.c_str(), ".glow") != 0 || - strstr(strTemp.c_str(), ".bump") != 0 || - strstr(strTemp.c_str(), ".diffuse") != 0 || - strstr(strTemp.c_str(), ".blend") != 0 || - strstr(strTemp.c_str(), ".alpha") != 0; -} + g_bScreenUpdates = false; -class LoadShaderVisitor : public Archive::Visitor -{ -public: - void visit(const char* name) - { - IShader* shader = QERApp_Shader_ForName(CopiedString(StringRange(name, path_get_filename_base_end(name))).c_str()); - shader->DecRef(); - } -}; - -void TextureBrowser_SetHideUnused(TextureBrowser& textureBrowser, bool hideUnused); - -GtkWidget* g_page_textures; - -void TextureBrowser_toggleShow() -{ - GroupDialog_showPage(g_page_textures); -} - - -void TextureBrowser_updateTitle() -{ - GroupDialog_updatePageTitle(g_page_textures); -} - - - -class TextureCategoryLoadShader -{ - const char* m_directory; - std::size_t& m_count; -public: - typedef const char* first_argument_type; - - TextureCategoryLoadShader(const char* directory, std::size_t& count) - : m_directory(directory), m_count(count) - { - m_count = 0; - } - void operator()(const char* name) const - { - if(shader_equal_prefix(name, "textures/") - && shader_equal_prefix(name + string_length("textures/"), m_directory)) - { - ++m_count; - // request the shader, this will load the texture if needed - // this Shader_ForName call is a kind of hack - IShader *pFoo = QERApp_Shader_ForName(name); - pFoo->DecRef(); - } - } -}; - -void TextureDirectory_loadTexture(const char* directory, const char* texture) -{ - StringOutputStream name(256); - name << directory << StringRange(texture, path_get_filename_base_end(texture)); - - if(texture_name_ignore(name.c_str())) - { - return; - } - - if (!shader_valid(name.c_str())) - { - globalOutputStream() << "Skipping invalid texture name: [" << name.c_str() << "]\n"; - return; - } + // refresh the in-use textures: that will clear the IsDisplayed flag on unused stuff + // and leave it on in-use so they'll still be displayed + Texture_ShowInuse(); + // and textures loaded in the following lines will be displayed as well... + // NOTE: shaders that are not in use but have been loaded previously are still in memory. But they don't get displayed. + g_qeglobals.d_texturewin.originy = 0; + // load texture_directory.shader + // NOTE: because of above call to Texture_ClearInuse, g_ActiveShaders will have the newly loaded shaders only + // we'll use that later to check if textures have a shader associated or not + // NOTE: all shaders loaded through QERApp_LoadShadersFromDir will get their InUse flag to True, we'll need a call to Texture_ShowInUse for later cleanup/adjustment + // NOTE: QERApp_LoadShadersFromDir has two criterions for loading a shader: + // the shaderfile is texture_directory (like "museum" will load everything in museum.shader) + // the shader name contains texture_directory (like "base_floor" will load museum.shader::base_floor/concfloor_rain) + shaders_count = QERApp_LoadShadersFromDir(texture_directory); + // load remaining texture files // if a texture is already in use to represent a shader, ignore it - IShader* shader = QERApp_Shader_ForName(name.c_str()); - shader->DecRef(); -} -typedef ConstPointerCaller1 TextureDirectoryLoadTextureCaller; -class LoadTexturesByTypeVisitor : public ImageModules::Visitor -{ - const char* m_dirstring; -public: - LoadTexturesByTypeVisitor(const char* dirstring) - : m_dirstring(dirstring) - { - } - void visit(const char* minor, const _QERPlugImageTable& table) const - { - GlobalFileSystem().forEachFile(m_dirstring, minor, TextureDirectoryLoadTextureCaller(m_dirstring)); - } -}; - -void TextureBrowser_ShowDirectory(TextureBrowser& textureBrowser, const char* directory) -{ - if(TextureBrowser_showWads()) - { - Archive* archive = GlobalFileSystem().getArchive(directory); - ASSERT_NOTNULL(archive); - LoadShaderVisitor visitor; - archive->forEachFile(Archive::VisitorFunc(visitor, Archive::eFiles, 0), "textures/"); - } - else - { - g_TextureBrowser_currentDirectory = directory; - TextureBrowser_heightChanged(textureBrowser); - - std::size_t shaders_count; - GlobalShaderSystem().foreachShaderName(makeCallback1(TextureCategoryLoadShader(directory, shaders_count))); - globalOutputStream() << "Showing " << Unsigned(shaders_count) << " shaders.\n"; - - if(g_pGameDescription->mGameType != "doom3") - { - // load remaining texture files - - StringOutputStream dirstring(64); - dirstring << "textures/" << directory; - - Radiant_getImageModules().foreachModule(LoadTexturesByTypeVisitor(dirstring.c_str())); - } - } - - // we'll display the newly loaded textures + all the ones already in use - TextureBrowser_SetHideUnused(textureBrowser, false); - - TextureBrowser_updateTitle(); -} - -void TextureBrowser_ShowTagSearchResult(TextureBrowser& textureBrowser, const char* directory) -{ - g_TextureBrowser_currentDirectory = directory; - TextureBrowser_heightChanged(textureBrowser); - - std::size_t shaders_count; - GlobalShaderSystem().foreachShaderName(makeCallback1(TextureCategoryLoadShader(directory, shaders_count))); - globalOutputStream() << "Showing " << Unsigned(shaders_count) << " shaders.\n"; - - if(g_pGameDescription->mGameType != "doom3") - { - // load remaining texture files - StringOutputStream dirstring(64); - dirstring << "textures/" << directory; - - { - LoadTexturesByTypeVisitor visitor(dirstring.c_str()); - Radiant_getImageModules().foreachModule(visitor); - } - } - - // we'll display the newly loaded textures + all the ones already in use - TextureBrowser_SetHideUnused(textureBrowser, false); -} - - -bool TextureBrowser_hideUnused(); - -void TextureBrowser_hideUnusedExport(const BoolImportCallback& importer) -{ - importer(TextureBrowser_hideUnused()); -} -typedef FreeCaller1 TextureBrowserHideUnusedExport; - -void TextureBrowser_showShadersExport(const BoolImportCallback& importer) -{ - importer(GlobalTextureBrowser().m_showShaders); -} -typedef FreeCaller1 TextureBrowserShowShadersExport; - -void TextureBrowser_showShaderlistOnly(const BoolImportCallback& importer) -{ - importer(g_TextureBrowser_shaderlistOnly); -} -typedef FreeCaller1 TextureBrowserShowShaderlistOnlyExport; - -void TextureBrowser_fixedSize(const BoolImportCallback& importer) -{ - importer(g_TextureBrowser_fixedSize); -} -typedef FreeCaller1 TextureBrowser_FixedSizeExport; - -void TextureBrowser_filterNotex(const BoolImportCallback& importer) -{ - importer(g_TextureBrowser_filterNotex); -} -typedef FreeCaller1 TextureBrowser_filterNotexExport; - -void TextureBrowser_SetHideUnused(TextureBrowser& textureBrowser, bool hideUnused) -{ - if(hideUnused) - { - textureBrowser.m_hideUnused = true; - } - else - { - textureBrowser.m_hideUnused = false; - } - - textureBrowser.m_hideunused_item.update(); - - TextureBrowser_heightChanged(textureBrowser); - textureBrowser.m_originInvalid = true; -} - -void TextureBrowser_ShowStartupShaders(TextureBrowser& textureBrowser) -{ - if(textureBrowser.m_startupShaders == STARTUPSHADERS_COMMON) - { - TextureBrowser_ShowDirectory(textureBrowser, TextureBrowser_getComonShadersDir()); - } -} - - -//++timo NOTE: this is a mix of Shader module stuff and texture explorer -// it might need to be split in parts or moved out .. dunno -// scroll origin so the specified texture is completely on screen -// if current texture is not displayed, nothing is changed -void TextureBrowser_Focus(TextureBrowser& textureBrowser, const char* name) -{ - TextureLayout layout; - // scroll origin so the texture is completely on screen - Texture_StartPos(layout); + // need this function "GSList *lst SynapseServer::GetMinorList(char *major_name);" - for(QERApp_ActiveShaders_IteratorBegin(); !QERApp_ActiveShaders_IteratorAtEnd(); QERApp_ActiveShaders_IteratorIncrement()) + sprintf (dirstring, "textures/%s", texture_directory); + g_ImageManager.BeginExtensionsScan(); + const char* ext; + while(ext=g_ImageManager.GetNextExtension()) { - IShader* shader = QERApp_ActiveShaders_IteratorCurrent(); - - if(!Texture_IsShown(shader, textureBrowser.m_showShaders, textureBrowser.m_hideUnused)) - continue; - - int x, y; - Texture_NextPos(textureBrowser, layout, shader->getTexture(), &x, &y); - qtexture_t* q = shader->getTexture(); - if (!q) - break; - - // we have found when texdef->name and the shader name match - // NOTE: as everywhere else for our comparisons, we are not case sensitive - if (shader_equal(name, shader->getName())) - { - int textureHeight = (int)(q->height * ((float)textureBrowser.m_textureScale / 100)) - + 2 * TextureBrowser_fontHeight(textureBrowser); - - int originy = TextureBrowser_getOriginY(textureBrowser); - if (y > originy) - { - originy = y; - } - - if (y - textureHeight < originy - textureBrowser.height) - { - originy = (y - textureHeight) + textureBrowser.height; - } - - TextureBrowser_setOriginY(textureBrowser, originy); - return; - } + files = g_slist_concat(files, vfsGetFileList (dirstring, ext)); } -} -IShader* Texture_At(TextureBrowser& textureBrowser, int mx, int my) -{ - my += TextureBrowser_getOriginY(textureBrowser) - textureBrowser.height; - - TextureLayout layout; - Texture_StartPos(layout); - for(QERApp_ActiveShaders_IteratorBegin(); !QERApp_ActiveShaders_IteratorAtEnd(); QERApp_ActiveShaders_IteratorIncrement()) + for (temp = files; temp; temp = temp->next) { - IShader* shader = QERApp_ActiveShaders_IteratorCurrent(); + sprintf(name, "%s%s", texture_directory, (char*)temp->data); - if(!Texture_IsShown(shader, textureBrowser.m_showShaders, textureBrowser.m_hideUnused)) - continue; + StripExtension (name); + strTemp = name; + strTemp.MakeLower(); - int x, y; - Texture_NextPos(textureBrowser, layout, shader->getTexture(), &x, &y); - qtexture_t *q = shader->getTexture(); - if (!q) - break; - - int nWidth = textureBrowser.getTextureWidth(q); - int nHeight = textureBrowser.getTextureHeight(q); - if (mx > x && mx - x < nWidth - && my < y && y - my < nHeight + TextureBrowser_fontHeight(textureBrowser)) + if (strTemp.Find(".specular") >= 0 || + strTemp.Find(".glow") >= 0 || + strTemp.Find(".bump") >= 0 || + strTemp.Find(".diffuse") >= 0 || + strTemp.Find(".blend") >= 0 || + strTemp.Find(".alpha") >= 0) + continue; + + // avoid ever loading a texture name with spaces + if (strTemp.Find(" ") >= 0) { - return shader; + Sys_FPrintf(SYS_WRN, "WARNING: Skipping texture name with spaces [%s]\n", strTemp.GetBuffer()); + continue; + } + + // build a texture name that fits the conventions for qtexture_t::name + char stdName[1024]; + sprintf( stdName, "textures/%s", name ); + // check if this texture doesn't have a shader + if (!QERApp_ActiveShader_ForTextureName( stdName )) + { + QERApp_CreateShader_ForTextureName (stdName); + textures_count++; } } - return 0; + Sys_Printf("Loaded %d shaders and created default shader for %d orphan textures.\n", + shaders_count, textures_count ); + + vfsClearFileDirList (&files); + + // sort for displaying + QERApp_SortActiveShaders(); + + sprintf (name, "Textures: %s", texture_directory); + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), name); + + // select the first texture in the list + if (!g_qeglobals.d_texturewin.texdef.GetName()[0]) + SelectTexture (16, g_qeglobals.d_texturewin.height -16, false); + + g_bScreenUpdates = true; + + Sys_UpdateWindows (W_TEXTURE); } /* ============== -SelectTexture - - By mouse click +Texture_ShowDirectory +1) Load the shaders for the given directory +2) Scan the remaining texture, load them and assign them a default shader (the "noshader" shader) +NOTE: when writing a texture plugin, or some texture extensions, this function may need to be overriden, and made + available through the IShaders interface ============== */ -void SelectTexture(TextureBrowser& textureBrowser, int mx, int my, bool bShift) +void Texture_ShowDirectory (int menunum) { - IShader* shader = Texture_At(textureBrowser, mx, my); - if(shader != 0) - { - if (bShift) - { - if (shader->IsDefault()) - globalOutputStream() << "ERROR: " << shader->getName() << " is not a shader, it's a texture.\n"; - else - ViewShader( shader->getShaderFileName(), shader->getName() ); - } - else - { - TextureBrowser_SetSelectedShader(textureBrowser, shader->getName()); - TextureBrowser_textureSelected(shader->getName()); + strcpy (texture_directory, texture_menunames[menunum-CMD_TEXTUREWAD]); + Texture_ShowDirectory(); +} - if (!FindTextureDialog_isOpen() && !textureBrowser.m_rmbSelected) +// scroll origin so the current texture is completely on screen +// if current texture is not displayed, nothing is changed +void Texture_ResetPosition() +{ + qtexture_t *q; + int x,y; + + //this shouldn't ever happen, we startup with notex + if (!g_qeglobals.d_texturewin.texdef.GetName()[0]) { + return; + } + + // otherwise position with current texture shown + // this used to be in Texture_SetTexture + Texture_StartPos (); + while (1) + { + // NOTE: return value is == pCurrentShader and pCurrentShader->getTexture == current_texture + Texture_NextPos (&x, &y); + q = current_texture; + // if the current texture never found (because // 'show shaders' is off, + // for example), do nothing + if (!q) + break; + + int nHeight = (int)(q->height * ((float)g_PrefsDlg.m_nTextureScale / 100)); + // we have found when texdef->name and the shader name match + // NOTE: as everywhere else for our comparisons, we are not case sensitive + if (!strcmpi( g_qeglobals.d_texturewin.texdef.GetName(), pCurrentShader->getName() )) + { + // take care of calls before initialized + if ( !g_qeglobals.d_texturewin.height) { + g_qeglobals.d_texturewin.originy = 0; + break; + } + // if the bottom of our selected texture will fit with origin 0, use that + // to prevent scrolling uglyness (stuff scrolled off screen when + // everything would fit) + if ( -(y -nHeight-2*FONT_HEIGHT) < g_qeglobals.d_texturewin.height) { + g_qeglobals.d_texturewin.originy = 0; + break; + } + // if current is off the top of the window, move it to the top + if (y > g_qeglobals.d_texturewin.originy) { - UndoableCommand undo("textureNameSetSelected"); - Select_SetShader(shader->getName()); + g_qeglobals.d_texturewin.originy = y; + break; + } + + // if current is off the bottom, put it on the bottom + if (y-nHeight-2*FONT_HEIGHT < g_qeglobals.d_texturewin.originy-g_qeglobals.d_texturewin.height) + { + g_qeglobals.d_texturewin.originy = y-nHeight-2*FONT_HEIGHT+g_qeglobals.d_texturewin.height; + break; + } + // if we made it here, it should already be in view + break; + } + } + Sys_UpdateWindows (W_TEXTURE); +} + +/* +============== +Texture_ShowAll +will set the IsDisplayed flag on all the active shaders, so we see everything that's currently in memory +============== +*/ +void Texture_ShowAll() +{ + char name[1024]; + +#ifdef _DEBUG + if (g_bShowAllShaders) + Sys_Printf("WARNING: already showing all shaders\n"); +#endif + QERApp_ActiveShaders_SetDisplayed(true); + g_bShowAllShaders = true; + // put some information in the texture window title? + sprintf (name, "Textures: in use"); + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), name); + Sys_UpdateWindows (W_TEXTURE); +} + +/* +============== +Texture_ShowInuse +clear all IsDisplayed flags +scan the map, set IsInUse (will set IsDisplayed on the way) +NOTE: don't sort the textures, don't update the windows (it's used in several contexts, not always necessary to do either) +============== +*/ +void WINAPI Texture_ShowInuse (void) +{ + face_t *f; + brush_t *b; + char name[1024]; + + g_qeglobals.d_texturewin.originy = 0; + + // purge + QERApp_ActiveShaders_SetDisplayed(false); + // scan and only display in-use stuff + Sys_Status("Selecting active textures", 0); + + for (b=active_brushes.next ; b != NULL && b != &active_brushes ; b=b->next) + { + if (b->patchBrush) + { + b->pPatch->pShader->SetInUse(true); + } else + { + for (f=b->brush_faces ; f ; f=f->next) + { + f->pShader->SetInUse(true); } } } + for (b=selected_brushes.next ; b != NULL && b != &selected_brushes ; b=b->next) + { + if (b->patchBrush) + { + b->pPatch->pShader->SetInUse(true); + } else + { + for (f=b->brush_faces ; f ; f=f->next) + { + f->pShader->SetInUse(true); + } + } + } + + // we are no longer showing everything + g_bShowAllShaders = false; + // put some information in the texture window title? + sprintf (name, "Textures: in use"); + gtk_window_set_title (GTK_WINDOW (g_qeglobals_gui.d_entity), name); + + + // select the first texture in the list + if (!g_qeglobals.d_texturewin.texdef.GetName()[0]) + { + SelectTexture (16, g_qeglobals.d_texturewin.height -16, false); + } +} + +void Texture_ShowStartupShaders() +{ + if (g_PrefsDlg.m_nShader == PrefsDlg::SHADER_COMMON) + { + // RIANT + // HACK FOR JK2 SUPPORT + if (g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game") + { + strcpy (texture_directory, "system/"); + } + // RIANT + // HACK FOR SOF2 SUPPORT + else if (g_pGameDescription->mGameFile == "sof2.game") + { + strcpy (texture_directory, "tools/"); + } + else strcpy (texture_directory, "common/"); + Texture_ShowDirectory (); + } + + if (g_PrefsDlg.m_nShader == PrefsDlg::SHADER_ALL) { + int count; + char filename[1024]; + char *pBuff; + char dirstring[NAME_MAX]; + int nLen; + GSList *shaderfiles = NULL; + + strcpy(filename, g_pGameDescription->mShaderlist.GetBuffer()); + count = vfsGetFileCount(filename, 0); + if (count == 0) + { + Sys_FPrintf(SYS_ERR, "Couldn't find '%s'\n", g_pGameDescription->mShaderlist.GetBuffer()); + return; + } + + if (!vfsGetFullPath(filename, 0, 0)) + { + Sys_FPrintf(SYS_ERR, "Couldn't find full path for '%s'\n", g_pGameDescription->mShaderlist.GetBuffer()); + Sys_FPrintf(SYS_ERR, "did you hit bug http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=130 ?\n"); + return; + } + + Sys_Printf("Parsing shader files from %s\n", vfsGetFullPath(filename, 0, 0)); + nLen = vfsLoadFile (filename, reinterpret_cast(&pBuff), 0); + if (nLen > 0) + { + StartTokenParsing(pBuff); + nLen = 0; + while (GetToken(true)) + { + GSList *tmp; + bool found = false; + + // each token should be a shader filename + sprintf(dirstring, "%s.shader", token); + + for (tmp = shaderfiles; tmp != NULL; tmp = tmp->next) + { + if (!strcmp (dirstring, (char*)tmp->data)) + { + found = true; + Sys_FPrintf(SYS_WRN, "duplicate entry \"%s\" in shaderlist.txt\n", (char*)tmp->data); + break; + } + } + + if (!found) + { + shaderfiles = g_slist_append (l_shaderfiles, strdup (dirstring)); + strcpy (texture_directory, dirstring); + Texture_ShowDirectory (); + nLen++; + } + } + g_free(pBuff); + } + } +} + +/* +============================================================================ + +TEXTURE LAYOUT + +TTimo: now based on a rundown through all the shaders +nActiveShadersCount: number of shader that have a qtexture_t and may be displayed in the tex window +nCurrentShader: index of active shader that has the current_texture +pCurrentShader: IShader* for current shader +NOTE: we expect the Active shaders count doesn't change during a Texture_StartPos .. Texture_NextPos cycle + otherwise we may need to rely on a list instead of an array storage +============================================================================ +*/ + +void Texture_StartPos (void) +{ + //++timo TODO: check use of current_texture and current_row? + current_x = 8; + current_y = -8; + current_row = 0; + nActiveShadersCount = QERApp_GetActiveShaderCount(); + nCurrentShader = -1; + current_texture = NULL; + pCurrentShader = NULL; +} + +// if texture_showinuse jump over non in-use textures +// it's not very clear what should be done here and what in Texture_Draw .. maybe merging the two would do good +IShader* Texture_NextPos (int *x, int *y) +{ + qtexture_t* q; + while (1) + { + if (nCurrentShader >= nActiveShadersCount - 1) + { + // no more shaders + current_texture = NULL; + pCurrentShader = NULL; + return NULL; + } + nCurrentShader++; + pCurrentShader = QERApp_ActiveShader_ForIndex(nCurrentShader); + if (pCurrentShader == NULL) + { + Sys_Printf("ERROR: unexpected pCurrentShader == NULL in Texture_NextPos\n"); + return NULL; + } + current_texture = pCurrentShader->getTexture(); + q = current_texture; + + if (!q) + { + Sys_Printf("WARNING: found an IShader without qtexture_t in Texture_NextPos\n"); + return NULL; + } + + /* + Never show anything other than "textures/" path, + This is for q1/q2/q3 .map format, which expects "textures/" path on everything we apply + */ + if(strncmp(pCurrentShader->getName(), "textures/", 9) != 0) + continue; + + // don't show shaders? + if (!(g_PrefsDlg.m_bShowShaders || pCurrentShader->IsDefault())) + continue; + + if (g_PrefsDlg.m_bTextureWindow) + { + // some basic filtering + if (!g_pParentWnd->GetTexWnd()->CheckFilter( pCurrentShader->getName() )) + continue; + } + + //++timo FIXME: texture_showinuse is useless? with the menu and reload we just refresh the IsDisplayed flag + // but the IsInUse is only relevant to draw the green outline + if (pCurrentShader->IsDisplayed()) + break; + + continue; + } + + int nWidth = (int)(q->width * ((float)g_PrefsDlg.m_nTextureScale / 100)); + int nHeight = (int)(q->height * ((float)g_PrefsDlg.m_nTextureScale / 100)); + if (current_x + nWidth > g_qeglobals.d_texturewin.width-8 && current_row) + { // go to the next row unless the texture is the first on the row + current_x = 8; + current_y -= current_row + FONT_HEIGHT + 4; + current_row = 0; + } + + *x = current_x; + *y = current_y; + + // Is our texture larger than the row? If so, grow the + // row height to match it + + if (current_row < nHeight) + current_row = nHeight; + + // never go less than 64, or the names get all crunched up + current_x += nWidth < 64 ? 64 : nWidth; + current_x += 8; + + return pCurrentShader; } /* @@ -1025,35 +1182,250 @@ void SelectTexture(TextureBrowser& textureBrowser, int mx, int my, bool bShift) ============================================================================ */ -void TextureBrowser_trackingDelta(int x, int y, unsigned int state, void* data) +static int textures_cursorx, textures_cursory; + +/* +============ +Texture_SetTexture + +brushprimit_texdef must be understood as a qtexture_t with width=2 height=2 ( the default one ) +============ +*/ + +//++timo NOTE: this is a mix of Shader module stuff and texture explorer +// it might need to be split in parts or moved out .. dunno +void WINAPI Texture_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, IPluginTexdef *pTexdef, bool bSetSelection ) { - TextureBrowser& textureBrowser = *reinterpret_cast(data); - if(y != 0) + if (texdef->GetName()[0] == '(') { - int scale = 1; + Sys_Status("Can't select an entity texture", 0); + return; + } + g_qeglobals.d_texturewin.texdef = *texdef; + g_qeglobals.d_texturewin.texdef.flags &= ~SURF_KEEP; + g_qeglobals.d_texturewin.texdef.contents &= ~CONTENTS_KEEP; + // store the shader pointer + // NOTE: maybe passing the shader pointer would help? + g_qeglobals.d_texturewin.pShader->DecRef(); + g_qeglobals.d_texturewin.pShader = QERApp_Shader_ForName(texdef->GetName()); + g_qeglobals.d_texturewin.pShader->IncRef(); + // set this shader as in use + g_qeglobals.d_texturewin.pShader->SetInUse( true ); + // store the texture coordinates for new brush primitive mode + // be sure that all the callers are using the default 2x2 texture + if (g_qeglobals.m_bBrushPrimitMode) + { + g_qeglobals.d_texturewin.brushprimit_texdef = *brushprimit_texdef; + } - if(state & GDK_SHIFT_MASK) - scale = 4; + g_dlgFind.updateTextures(texdef->GetName()); + if (!g_dlgFind.isOpen() && bSetSelection) + { + Select_SetTexture(texdef,brushprimit_texdef,bFitScale); + } - int originy = TextureBrowser_getOriginY(textureBrowser); - originy += y * scale; - TextureBrowser_setOriginY(textureBrowser, originy); + //plugins: send a message telling that the selected texture may have changed + DispatchRadiantMsg( RADIANT_TEXTURE ); + + // scroll origin so the texture is completely on screen + // takes texdef from g_qeglobals.d_texturewin.texdef, set above + Texture_ResetPosition(); +} + +void ViewShader(const char *pFile, const char *pName) +{ + // ask the vfs to build the full path to the file + // (i.e. the first one found) + char *fullName = vfsGetFullPath(pFile,0,0); + if (fullName == NULL) + { + Sys_FPrintf (SYS_ERR, "Couldn't get a full path to the shader file: %s\n", pFile); + return; + } + + char* pBuff = NULL; + int nSize = vfsLoadFullPathFile(fullName, reinterpret_cast(&pBuff)); + if (nSize <= 0) + { + Sys_FPrintf (SYS_ERR, "Failed to load shader file %s\n", fullName); + return; + } + // look for the shader declaration + int nStart; + CString strFind = pName; + CString strLook = pBuff; + strLook.MakeLower(); + strFind.MakeLower(); + // offset used when jumping over commented out definitions + int nOffset = 0; + while (true) + { + nStart = strLook.Find(strFind, nOffset); + if (nStart == -1) + break; + // we have found something, maybe it's a commented out shader name? + char *strCheck = new char[strLook.GetLength()+1]; + strcpy( strCheck, strLook.GetBuffer() ); + strCheck[nStart] = 0; + char *pCheck = strrchr( strCheck, '\n' ); + // if there's a commentary sign in-between we'll continue + if (pCheck && strstr( pCheck, "//" )) + { + delete[] strCheck; + nOffset = nStart + 1; + continue; + } + delete[] strCheck; + nOffset = nStart; + break; + } + // now close the file + g_free(pBuff); + + DoTextEditor (fullName, nOffset); +} + +/* +============== +SelectTexture + + By mouse click +============== +*/ +void SelectTexture (int mx, int my, bool bShift, bool bFitScale) +{ + int x, y; + qtexture_t *q; + texdef_t tex; + brushprimit_texdef_t brushprimit_tex; + + my += g_qeglobals.d_texturewin.originy-g_qeglobals.d_texturewin.height; + + Texture_StartPos (); + while (1) + { + // NOTE: return value is == pCurrentShader and pCurrentShader->getTexture == current_texture + Texture_NextPos (&x, &y); + q = current_texture; + if (!q) + break; + int nWidth = (int)(q->width * ((float)g_PrefsDlg.m_nTextureScale / 100)); + int nHeight = (int)(q->height * ((float)g_PrefsDlg.m_nTextureScale / 100)); + if (mx > x && mx - x < nWidth + && my < y && y - my < nHeight + FONT_HEIGHT) + { + if (bShift) + { + if (pCurrentShader->IsDefault()) + Sys_Printf("ERROR: %s is not a shader, it's a texture.\n", pCurrentShader->getName() ); + else + ViewShader( pCurrentShader->getShaderFileName(), pCurrentShader->getName() ); + } + else + { + memset (&tex, 0, sizeof(tex)); + memset (&brushprimit_tex, 0, sizeof(brushprimit_tex)); + if (g_qeglobals.m_bBrushPrimitMode) + { + // brushprimit fitted to a 2x2 texture + brushprimit_tex.coords[0][0] = 1.0f; + brushprimit_tex.coords[1][1] = 1.0f; + } + else + { + tex.scale[0] = g_pGameDescription->mTextureDefaultScale; + tex.scale[1] = g_pGameDescription->mTextureDefaultScale; + } + tex.flags = pCurrentShader->getFlags(); + // TTimo - shader code cleanup + // texdef.name is the name of the shader, not the name of the actual texture file + tex.SetName(pCurrentShader->getName()); + // NOTE WARNING: Texture_SetTexture uses Texture_NextPos stuff to move the window position on to the texture + // if there's some kind of fuckup in Texture_SetTexture you may end up with different pCurrentShader or even pCurrentShader == NULL + // so we just consider pCurrentShader and current_texture are not valid after this point + IShader *pAuxShader = pCurrentShader; + Texture_SetTexture ( &tex, &brushprimit_tex, bFitScale, NULL); // Nurail + CString strTex; + CString strName; + // if shader, print shader name, otherwise texture name + //++timo FIXME: maybe CShader needs some properties between color / default / actual shader +#ifdef _DEBUG + // this one is never supposed to be set as current one + if (pAuxShader->IsColor()) + Sys_Printf("ERROR: unexpected pCurrentShader->IsColor() in SelectTexture\n"); +#endif + // NOTE: IsColor is false, IsDefault the only remaining property + if (pAuxShader->IsDefault()) + { + strName = q->name; + // remove the "textures/" if needed + if (strName.Find("textures/")!=-1) + strName = strName.Mid(9); + } + else + { + strName = pAuxShader->getName(); + } + strTex.Format("%s W: %i H: %i", strName.GetBuffer(), q->width, q->height); + g_pParentWnd->SetStatusText(3, strTex); + } + return; + } + } + + Sys_Status("Did not select a texture", 0); +} + +/* +============== +Texture_MouseDown +============== +*/ +void Texture_MouseDown (int x, int y, int buttons) +{ + Sys_GetCursorPos (&textures_cursorx, &textures_cursory); + + // lbutton = select texture + if (buttons == MK_LBUTTON || buttons == (MK_LBUTTON | MK_SHIFT) || buttons == (MK_LBUTTON | MK_CONTROL)) + { + SelectTexture (x, g_qeglobals.d_texturewin.height - 1 - y, buttons & MK_SHIFT, buttons & MK_CONTROL); + UpdateSurfaceDialog(); + UpdatePatchInspector(); } } -void TextureBrowser_Tracking_MouseDown(TextureBrowser& textureBrowser) -{ - textureBrowser.m_freezePointer.freeze_pointer(textureBrowser.m_parent, TextureBrowser_trackingDelta, &textureBrowser); -} +/* +============== +Texture_MouseMoved +============== +*/ -void TextureBrowser_Tracking_MouseUp(TextureBrowser& textureBrowser) +void Texture_MouseMoved (int x, int y, int buttons) { - textureBrowser.m_freezePointer.unfreeze_pointer(textureBrowser.m_parent); -} + int scale = 1; -void TextureBrowser_Selection_MouseDown(TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy) -{ - SelectTexture(textureBrowser, pointx, textureBrowser.height - 1 - pointy, (flags & GDK_SHIFT_MASK) != 0); + if ( buttons & MK_SHIFT ) + scale = 4; + + // rbutton = drag texture origin + if (buttons & MK_RBUTTON) + { + Sys_GetCursorPos (&x, &y); + if ( y != textures_cursory) + { + g_qeglobals.d_texturewin.originy += ( y-textures_cursory) * scale; + if (g_qeglobals.d_texturewin.originy > 0) + g_qeglobals.d_texturewin.originy = 0; + Sys_SetCursorPos (textures_cursorx, textures_cursory); + + // (g_PrefsDlg.m_bTextureScrollbar && g_qeglobals_gui.d_texture_scroll != NULL) + // fixes broken texture scrolling when scrollbar is disabled + GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_qeglobals_gui.d_texture_scroll)); + gtk_adjustment_set_value (vadjustment, abs(g_qeglobals.d_texturewin.originy)); + // + } + return; + } } /* @@ -1064,6 +1436,8 @@ DRAWING ============================================================================ */ +int imax(int iFloor, int i) { if (i>iFloor) return iFloor;return i;} + /* ============ Texture_Draw @@ -1072,1632 +1446,520 @@ we must query all qtexture_t* to manage and display through the IShaders interfa this allows a plugin to completely override the texture system ============ */ -void Texture_Draw(TextureBrowser& textureBrowser) +void Texture_Draw (int width, int height) { - int originy = TextureBrowser_getOriginY(textureBrowser); + int x, y, last_y = 0, last_height = 0, nWidth, nHeight; + qtexture_t *q; + char *name; - glClearColor(textureBrowser.color_textureback[0], - textureBrowser.color_textureback[1], - textureBrowser.color_textureback[2], - 0); - glViewport(0, 0, textureBrowser.width, textureBrowser.height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + qglClearColor (g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][0], + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][1], + g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][2], 0); + qglViewport (0,0,width,height); + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity (); - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glDisable (GL_DEPTH_TEST); - glDisable(GL_BLEND); - glOrtho (0, textureBrowser.width, originy-textureBrowser.height, originy, -100, 100); - glEnable (GL_TEXTURE_2D); + qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + qglDisable (GL_DEPTH_TEST); + qglDisable(GL_BLEND); + qglOrtho (0, width, g_qeglobals.d_texturewin.originy-height, g_qeglobals.d_texturewin.originy, -100, 100); + qglEnable (GL_TEXTURE_2D); - glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + g_qeglobals.d_texturewin.width = width; + g_qeglobals.d_texturewin.height = height; - int last_y = 0, last_height = 0; - - TextureLayout layout; - Texture_StartPos(layout); - for(QERApp_ActiveShaders_IteratorBegin(); !QERApp_ActiveShaders_IteratorAtEnd(); QERApp_ActiveShaders_IteratorIncrement()) + Texture_StartPos(); + for (;;) { - IShader* shader = QERApp_ActiveShaders_IteratorCurrent(); - - if(!Texture_IsShown(shader, textureBrowser.m_showShaders, textureBrowser.m_hideUnused)) - continue; - - int x, y; - Texture_NextPos(textureBrowser, layout, shader->getTexture(), &x, &y); - qtexture_t *q = shader->getTexture(); + // NOTE: return value is == pCurrentShader and pCurrentShader->getTexture == current_texture + Texture_NextPos (&x, &y); + q = current_texture; if (!q) break; - int nWidth = textureBrowser.getTextureWidth(q); - int nHeight = textureBrowser.getTextureHeight(q); + nWidth = (int)(q->width * ((float)g_PrefsDlg.m_nTextureScale / 100)); + nHeight = (int)(q->height * ((float)g_PrefsDlg.m_nTextureScale / 100)); if (y != last_y) { last_y = y; last_height = 0; } - last_height = std::max (nHeight, last_height); + last_height = MAX (nHeight, last_height); // Is this texture visible? - if ((y-nHeight-TextureBrowser_fontHeight(textureBrowser) < originy) - && (y > originy - textureBrowser.height)) + if ((y-nHeight-FONT_HEIGHT < g_qeglobals.d_texturewin.originy) + && (y > g_qeglobals.d_texturewin.originy - height)) { // borders rules: // if it's the current texture, draw a thick red line, else: // shaders have a white border, simple textures don't // if !texture_showinuse: (some textures displayed may not be in use) // draw an additional square around with 0.5 1 0.5 color - if (shader_equal(TextureBrowser_GetSelectedShader(textureBrowser), shader->getName())) + if (!strcmpi(g_qeglobals.d_texturewin.texdef.GetName(), pCurrentShader->getName())) { - glLineWidth (3); - if(textureBrowser.m_rmbSelected) - { - glColor3f (0,0,1); - } else { - glColor3f (1,0,0); - } - glDisable (GL_TEXTURE_2D); + qglLineWidth (3); + qglColor3f (1,0,0); + qglDisable (GL_TEXTURE_2D); - glBegin (GL_LINE_LOOP); - glVertex2i (x-4,y-TextureBrowser_fontHeight(textureBrowser)+4); - glVertex2i (x-4,y-TextureBrowser_fontHeight(textureBrowser)-nHeight-4); - glVertex2i (x+4+nWidth,y-TextureBrowser_fontHeight(textureBrowser)-nHeight-4); - glVertex2i (x+4+nWidth,y-TextureBrowser_fontHeight(textureBrowser)+4); - glEnd(); + qglBegin (GL_LINE_LOOP); + qglVertex2f (x-4,y-FONT_HEIGHT+4); + qglVertex2f (x-4,y-FONT_HEIGHT-nHeight-4); + qglVertex2f (x+4+nWidth,y-FONT_HEIGHT-nHeight-4); + qglVertex2f (x+4+nWidth,y-FONT_HEIGHT+4); + qglEnd (); - glEnable (GL_TEXTURE_2D); - glLineWidth (1); + qglEnable (GL_TEXTURE_2D); + qglLineWidth (1); } else { - glLineWidth (1); + qglLineWidth (1); // shader border: - if (!shader->IsDefault()) + if (!pCurrentShader->IsDefault()) { - glColor3f (1,1,1); - glDisable (GL_TEXTURE_2D); + qglColor3f (1,1,1); + qglDisable (GL_TEXTURE_2D); - glBegin (GL_LINE_LOOP); - glVertex2i (x-1,y+1-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x-1,y-nHeight-1-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x+1+nWidth,y-nHeight-1-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x+1+nWidth,y+1-TextureBrowser_fontHeight(textureBrowser)); - glEnd(); - glEnable (GL_TEXTURE_2D); + qglBegin (GL_LINE_LOOP); + qglVertex2f (x-1,y+1-FONT_HEIGHT); + qglVertex2f (x-1,y-nHeight-1-FONT_HEIGHT); + qglVertex2f (x+1+nWidth,y-nHeight-1-FONT_HEIGHT); + qglVertex2f (x+1+nWidth,y+1-FONT_HEIGHT); + qglEnd (); + qglEnable (GL_TEXTURE_2D); } // highlight in-use textures - if (!textureBrowser.m_hideUnused && shader->IsInUse()) + if (pCurrentShader->IsInUse()) { - glColor3f (0.5,1,0.5); - glDisable (GL_TEXTURE_2D); - glBegin (GL_LINE_LOOP); - glVertex2i (x-3,y+3-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x-3,y-nHeight-3-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x+3+nWidth,y-nHeight-3-TextureBrowser_fontHeight(textureBrowser)); - glVertex2i (x+3+nWidth,y+3-TextureBrowser_fontHeight(textureBrowser)); - glEnd(); - glEnable (GL_TEXTURE_2D); + qglColor3f (0.5,1,0.5); + qglDisable (GL_TEXTURE_2D); + qglBegin (GL_LINE_LOOP); + qglVertex2f (x-3,y+3-FONT_HEIGHT); + qglVertex2f (x-3,y-nHeight-3-FONT_HEIGHT); + qglVertex2f (x+3+nWidth,y-nHeight-3-FONT_HEIGHT); + qglVertex2f (x+3+nWidth,y+3-FONT_HEIGHT); + qglEnd (); + qglEnable (GL_TEXTURE_2D); } } // Draw the texture - glBindTexture (GL_TEXTURE_2D, q->texture_number); - GlobalOpenGL_debugAssertNoErrors(); - glColor3f (1,1,1); - glBegin (GL_QUADS); - glTexCoord2i (0,0); - glVertex2i (x,y-TextureBrowser_fontHeight(textureBrowser)); - glTexCoord2i (1,0); - glVertex2i (x+nWidth,y-TextureBrowser_fontHeight(textureBrowser)); - glTexCoord2i (1,1); - glVertex2i (x+nWidth,y-TextureBrowser_fontHeight(textureBrowser)-nHeight); - glTexCoord2i (0,1); - glVertex2i (x,y-TextureBrowser_fontHeight(textureBrowser)-nHeight); - glEnd(); + qglBindTexture (GL_TEXTURE_2D, q->texture_number); + QE_CheckOpenGLForErrors(); + qglColor3f (1,1,1); + qglBegin (GL_QUADS); + qglTexCoord2f (0,0); + qglVertex2f (x,y-FONT_HEIGHT); + qglTexCoord2f (1,0); + qglVertex2f (x+nWidth,y-FONT_HEIGHT); + qglTexCoord2f (1,1); + qglVertex2f (x+nWidth,y-FONT_HEIGHT-nHeight); + qglTexCoord2f (0,1); + qglVertex2f (x,y-FONT_HEIGHT-nHeight); + qglEnd (); // draw the texture name - glDisable (GL_TEXTURE_2D); - glColor3f (1,1,1); - - glRasterPos2i (x, y-TextureBrowser_fontHeight(textureBrowser)+5); - + qglDisable (GL_TEXTURE_2D); + qglColor3f (1,1,1); + + qglRasterPos2f (x, y-FONT_HEIGHT+2); + // don't draw the directory name - const char* name = shader->getName(); + name = (char*)pCurrentShader->getName(); name += strlen(name); - while(name != shader->getName() && *(name-1) != '/' && *(name-1) != '\\') + while(name != (char*)pCurrentShader->getName() && *(name-1) != '/' && *(name-1) != '\\') name--; - GlobalOpenGL().drawString(name); - glEnable (GL_TEXTURE_2D); + gtk_glwidget_print_string(name); + qglEnable (GL_TEXTURE_2D); } - - //int totalHeight = abs(y) + last_height + TextureBrowser_fontHeight(textureBrowser) + 4; } + g_qeglobals.d_texturewin.m_nTotalHeight = abs(y) + last_height + FONT_HEIGHT + 4; // reset the current texture - glBindTexture(GL_TEXTURE_2D, 0); - //qglFinish(); + qglBindTexture(GL_TEXTURE_2D, 0); + qglFinish(); } -void TextureBrowser_queueDraw(TextureBrowser& textureBrowser) +//++timo seems we only know hard inits now.. +//void Texture_Init (bool bHardInit) +void Texture_Init() { - if(textureBrowser.m_gl_widget != 0) + g_qeglobals.d_qtextures = NULL; + // initialize the qtexture map + if (g_qeglobals.d_qtexmap) { - gtk_widget_queue_draw(textureBrowser.m_gl_widget); + Sys_FPrintf(SYS_ERR, "TODO: delete g_qeglobals.d_qtexmap in Texture_Init\n"); + } + g_qeglobals.d_qtexmap = g_hash_table_new (g_str_hash, g_str_equal); + // initialize .. in some cases if no default texture / project loaded it crashes + memset( &g_qeglobals.d_texturewin.texdef, 0, sizeof(g_qeglobals.d_texturewin.texdef) ); + g_qeglobals.d_texturewin.texdef.SetName(SHADER_NOT_FOUND); + g_qeglobals.d_texturewin.pShader = QERApp_Shader_ForName(SHADER_NOT_FOUND); +} + +// FIXME TTimo this needs to move to the shader module along with l_shaderlist move +// preload shader files that have been listed in shaderlist.txt +void PreloadShaders() +{ + GSList *lst = l_shaderfiles; + Str shadername; + while (lst) + { + shadername = g_pGameDescription->mShaderPath; + shadername += (char*)lst->data; + QERApp_LoadShaderFile(shadername.GetBuffer()); + lst = lst->next; } } - -void TextureBrowser_setScale(TextureBrowser& textureBrowser, std::size_t scale) +// TTimo: modified to expect the reletive path to the skin as input +// will look into pak files if necessary +// uses the shader code to load the texture Try_Texture_ForName +// modified SkinInfo accordingly to store the qtexture_t and shader name (reletive version) +// the .md3 have bundled filetype extension, but they don't fit with the actual data +// ex: models/mapobjects/gargoyle.tga doesn't exist, but models/mapobjects/gargoyle.jpg can be used instead +// so we remove the extension before load attempt +int WINAPI Texture_LoadSkin(char *pName, int *pnWidth, int *pnHeight) { - textureBrowser.m_textureScale = scale; + // byte *pic = NULL; + // byte *pic32 = NULL; + int nTex = -1; + qtexture_t *qtex; + SkinInfo *pInfo; + const char *pCleanName; - TextureBrowser_queueDraw(textureBrowser); + int nSize = g_lstSkinCache.GetSize(); + pCleanName = QERApp_CleanTextureName( pName, false ); + for (int i = 0; i < nSize; i++) + { + SkinInfo *pInfo = reinterpret_cast(g_lstSkinCache.GetAt(i)); + if (pInfo) + { + if (stricmp(pCleanName, pInfo->m_strName) == 0) + { + return pInfo->m_nTextureBind; + } + } + } + + // if the load is successfull, we get back a qtexture_t + // we don't need to free it, it's in g_qeglobals.d_qtextures + // NOTE: we need to free the SkinInfo though.. + qtex = QERApp_Try_Texture_ForName( pCleanName ); + if (qtex) + { + nTex = qtex->texture_number; + pInfo = new SkinInfo(qtex->name, nTex, qtex); + } else + { + pInfo = new SkinInfo(pCleanName, -1, NULL); + } + g_lstSkinCache.Add(pInfo); + + return nTex; } - -void TextureBrowser_MouseWheel(TextureBrowser& textureBrowser, bool bUp) +bool TexWnd::CheckFilter( const char* name ) { - int originy = TextureBrowser_getOriginY(textureBrowser); + const char* buf = gtk_entry_get_text (GTK_ENTRY (m_pFilter)); + if (strstr( name, buf ) != 0) + return true; + return false; +} - if (bUp) - { - originy += int(textureBrowser.m_mouseWheelScrollIncrement); - } +// ============================================================================= +// static functions + +static void vertical_scroll (GtkWidget *widget, gpointer data) +{ + ((TexWnd*)data)->OnVScroll (); +} + +static void filter_changed (GtkWidget *widget, gpointer data) +{ + CString str; + str = gtk_entry_get_text (GTK_ENTRY (widget)); + ((TexWnd*)data)->UpdateFilter (str); +} + +// ============================================================================= +// TexWnd class + +TexWnd::TexWnd() +: GLWindow (FALSE) +{ + m_pFilter = NULL; + m_bNeedRange = true; +} + +TexWnd::~TexWnd() +{ +} + +void TexWnd::OnCreate () +{ + if (!MakeCurrent ()) + Error ("glMakeCurrent in TexWnd::OnCreate failed"); + + g_qeglobals_gui.d_texture = m_pWidget; + g_nTextureOffset = 0; + + GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_qeglobals_gui.d_texture_scroll)); + gtk_signal_connect (GTK_OBJECT (vadjustment), "value_changed", GTK_SIGNAL_FUNC (vertical_scroll), this); + + if (g_PrefsDlg.m_bTextureScrollbar) + gtk_widget_show (g_qeglobals_gui.d_texture_scroll); else + gtk_widget_hide (g_qeglobals_gui.d_texture_scroll); + m_bNeedRange = true; + + gtk_signal_connect (GTK_OBJECT (m_pFilter), "changed", GTK_SIGNAL_FUNC (filter_changed), this); + if (g_PrefsDlg.m_bTextureWindow) + gtk_widget_show (m_pFilter); +} + +void TexWnd::UpdateFilter(const char* pFilter) +{ + g_bFilterEnabled = false; + if (pFilter) { - originy -= int(textureBrowser.m_mouseWheelScrollIncrement); + g_strFilter = pFilter; + if (g_strFilter.GetLength() > 0) + g_bFilterEnabled = true; + QERApp_SortActiveShaders(); } - - TextureBrowser_setOriginY(textureBrowser, originy); + Sys_UpdateWindows (W_TEXTURE); } -XmlTagBuilder TagBuilder; - -enum +void TexWnd::OnSize (int cx, int cy) { - TAG_COLUMN, - N_COLUMNS -}; + m_bNeedRange = true; +} -void BuildStoreAssignedTags(GtkListStore* store, const char* shader, TextureBrowser* textureBrowser) +void TexWnd::OnExpose () { - GtkTreeIter iter; - - gtk_list_store_clear(store); - - std::vector assigned_tags; - TagBuilder.GetShaderTags(shader, assigned_tags); - - for (size_t i = 0; i < assigned_tags.size(); i++) + int nOld = g_qeglobals.d_texturewin.m_nTotalHeight; + if (!MakeCurrent ()) { - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, TAG_COLUMN, assigned_tags[i].c_str(), -1); + Sys_Printf("ERROR: glXMakeCurrent failed..\n "); + Sys_Printf("Please restart Radiant if the Texture view is not working\n"); + } else + { + QE_CheckOpenGLForErrors(); + Texture_Draw (m_pWidget->allocation.width, m_pWidget->allocation.height - g_nTextureOffset); + QE_CheckOpenGLForErrors(); + SwapBuffers (); } -} - -void BuildStoreAvailableTags( GtkListStore* storeAvailable, - GtkListStore* storeAssigned, - const std::set& allTags, - TextureBrowser* textureBrowser) -{ - GtkTreeIter iterAssigned; - GtkTreeIter iterAvailable; - std::set::const_iterator iterAll; - gchar* tag_assigned; - - gtk_list_store_clear(storeAvailable); - - bool row = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(storeAssigned), &iterAssigned) != 0; - - if(!row) // does the shader have tags assigned? + if (g_PrefsDlg.m_bTextureScrollbar && (m_bNeedRange || g_qeglobals.d_texturewin.m_nTotalHeight != nOld)) { - for (iterAll = allTags.begin(); iterAll != allTags.end(); ++iterAll) - { - gtk_list_store_append (storeAvailable, &iterAvailable); - gtk_list_store_set (storeAvailable, &iterAvailable, TAG_COLUMN, (*iterAll).c_str(), -1); - } - } - else - { - while(row) // available tags = all tags - assigned tags - { - gtk_tree_model_get(GTK_TREE_MODEL(storeAssigned), &iterAssigned, TAG_COLUMN, &tag_assigned, -1); + GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_qeglobals_gui.d_texture_scroll)); - for (iterAll = allTags.begin(); iterAll != allTags.end(); ++iterAll) - { - if(strcmp((char*)tag_assigned, (*iterAll).c_str()) != 0) - { - gtk_list_store_append (storeAvailable, &iterAvailable); - gtk_list_store_set (storeAvailable, &iterAvailable, TAG_COLUMN, (*iterAll).c_str(), -1); - } - else - { - row = gtk_tree_model_iter_next(GTK_TREE_MODEL(storeAssigned), &iterAssigned) != 0; - - if(row) - { - gtk_tree_model_get(GTK_TREE_MODEL(storeAssigned), &iterAssigned, TAG_COLUMN, &tag_assigned, -1); - } - } - } - } - } -} - -gboolean TextureBrowser_button_press(GtkWidget* widget, GdkEventButton* event, TextureBrowser* textureBrowser) -{ - if(event->type == GDK_BUTTON_PRESS) - { - if(event->button == 3) - { - if(GlobalTextureBrowser().m_tags) - { - textureBrowser->m_rmbSelected = true; - TextureBrowser_Selection_MouseDown (*textureBrowser, event->state, static_cast(event->x), static_cast(event->y)); - - BuildStoreAssignedTags(textureBrowser->m_assigned_store, textureBrowser->shader.c_str(), textureBrowser); - BuildStoreAvailableTags(textureBrowser->m_available_store, textureBrowser->m_assigned_store, textureBrowser->m_all_tags, textureBrowser); - textureBrowser->m_heightChanged = true; - gtk_widget_show(textureBrowser->m_tag_frame); - - process_gui(); - - TextureBrowser_Focus(*textureBrowser, textureBrowser->shader.c_str()); - } - else - { - TextureBrowser_Tracking_MouseDown(*textureBrowser); - } - } - else if(event->button == 1) - { - TextureBrowser_Selection_MouseDown(*textureBrowser, event->state, static_cast(event->x), static_cast(event->y)); - - if(GlobalTextureBrowser().m_tags) - { - textureBrowser->m_rmbSelected = false; - gtk_widget_hide(textureBrowser->m_tag_frame); - } - } - } - return FALSE; -} - -gboolean TextureBrowser_button_release(GtkWidget* widget, GdkEventButton* event, TextureBrowser* textureBrowser) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - if(event->button == 3) - { - if(!GlobalTextureBrowser().m_tags) - { - TextureBrowser_Tracking_MouseUp(*textureBrowser); - } - } - } - return FALSE; -} - -gboolean TextureBrowser_motion(GtkWidget *widget, GdkEventMotion *event, TextureBrowser* textureBrowser) -{ - return FALSE; -} - -gboolean TextureBrowser_scroll(GtkWidget* widget, GdkEventScroll* event, TextureBrowser* textureBrowser) -{ - if(event->direction == GDK_SCROLL_UP) - { - TextureBrowser_MouseWheel(*textureBrowser, true); - } - else if(event->direction == GDK_SCROLL_DOWN) - { - TextureBrowser_MouseWheel(*textureBrowser, false); - } - return FALSE; -} - -void TextureBrowser_scrollChanged(void* data, gdouble value) -{ - //globalOutputStream() << "vertical scroll\n"; - TextureBrowser_setOriginY(*reinterpret_cast(data), -(int)value); -} - -static void TextureBrowser_verticalScroll(GtkAdjustment *adjustment, TextureBrowser* textureBrowser) -{ - textureBrowser->m_scrollAdjustment.value_changed(adjustment->value); -} - -void TextureBrowser_updateScroll(TextureBrowser& textureBrowser) -{ - if(textureBrowser.m_showTextureScrollbar) - { - int totalHeight = TextureBrowser_TotalHeight(textureBrowser); - - totalHeight = std::max(totalHeight, textureBrowser.height); - - GtkAdjustment *vadjustment = gtk_range_get_adjustment(GTK_RANGE(textureBrowser.m_texture_scroll)); - - vadjustment->value = -TextureBrowser_getOriginY(textureBrowser); - vadjustment->page_size = textureBrowser.height; - vadjustment->page_increment = textureBrowser.height/2; + vadjustment->value = -g_qeglobals.d_texturewin.originy; + vadjustment->page_size = m_pWidget->allocation.height; + vadjustment->page_increment = m_pWidget->allocation.height/2; vadjustment->step_increment = 20; vadjustment->lower = 0; - vadjustment->upper = totalHeight; + vadjustment->upper = g_qeglobals.d_texturewin.m_nTotalHeight; - g_signal_emit_by_name(G_OBJECT (vadjustment), "changed"); + gtk_signal_emit_by_name (GTK_OBJECT (vadjustment), "changed"); + + m_bNeedRange = false; } } -gboolean TextureBrowser_size_allocate(GtkWidget* widget, GtkAllocation* allocation, TextureBrowser* textureBrowser) +void TexWnd::OnLButtonDown (guint32 flags, int pointx, int pointy) { - textureBrowser->width = allocation->width; - textureBrowser->height = allocation->height; - TextureBrowser_heightChanged(*textureBrowser); - textureBrowser->m_originInvalid = true; - TextureBrowser_queueDraw(*textureBrowser); - return FALSE; + SetCapture (); + Texture_MouseDown (pointx, pointy - g_nTextureOffset, flags); } -gboolean TextureBrowser_expose(GtkWidget* widget, GdkEventExpose* event, TextureBrowser* textureBrowser) +void TexWnd::OnRButtonDown (guint32 flags, int pointx, int pointy) { - if(glwidget_make_current(textureBrowser->m_gl_widget) != FALSE) - { - GlobalOpenGL_debugAssertNoErrors(); - TextureBrowser_evaluateHeight(*textureBrowser); - Texture_Draw(*textureBrowser); - GlobalOpenGL_debugAssertNoErrors(); - glwidget_swap_buffers(textureBrowser->m_gl_widget); - } - return FALSE; + SetCapture (); + Texture_MouseDown (pointx, pointy - g_nTextureOffset, flags); } - -TextureBrowser g_TextureBrowser; - -TextureBrowser& GlobalTextureBrowser() +void TexWnd::OnMButtonDown (guint32 flags, int pointx, int pointy) { - return g_TextureBrowser; + SetCapture (); + Texture_MouseDown (pointx, pointy - g_nTextureOffset, flags); } -bool TextureBrowser_hideUnused() +void TexWnd::OnLButtonUp (guint32 flags, int pointx, int pointy) { - return g_TextureBrowser.m_hideUnused; + ReleaseCapture (); + // NOTE TTimo http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 + DragDropTexture (flags, pointx, pointy); } -void TextureBrowser_ToggleHideUnused() +void TexWnd::OnRButtonUp (guint32 flags, int pointx, int pointy) { - if(g_TextureBrowser.m_hideUnused) - { - TextureBrowser_SetHideUnused(g_TextureBrowser, false); - } + ReleaseCapture (); +} + +void TexWnd::OnMButtonUp (guint32 flags, int pointx, int pointy) +{ + ReleaseCapture (); +} + +void TexWnd::OnMouseMove (guint32 flags, int pointx, int pointy) +{ + Texture_MouseMoved (pointx, pointy - g_nTextureOffset, flags); + // if scrollbar is hidden, we don't seem to get an update + if( !g_PrefsDlg.m_bTextureScrollbar ) + RedrawWindow (); +} + +void TexWnd::OnVScroll () +{ + GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_qeglobals_gui.d_texture_scroll)); + + g_qeglobals.d_texturewin.originy = - (int)vadjustment->value; + RedrawWindow (); +} + +void TexWnd::UpdatePrefs() +{ + if (g_PrefsDlg.m_bTextureWindow) + gtk_widget_show (m_pFilter); else - { - TextureBrowser_SetHideUnused(g_TextureBrowser, true); - } -} + gtk_widget_hide (m_pFilter); -void TextureGroups_constructTreeModel(TextureGroups groups, GtkTreeStore* store) -{ - // put the information from the old textures menu into a treeview - GtkTreeIter iter, child; - - TextureGroups::const_iterator i = groups.begin(); - while (i != groups.end()) - { - const char* dirName = (*i).c_str(); - const char* firstUnderscore = strchr(dirName, '_'); - StringRange dirRoot (dirName, (firstUnderscore == 0) ? dirName : firstUnderscore + 1); - - TextureGroups::const_iterator next = i; - ++next; - if(firstUnderscore != 0 - && next != groups.end() - && string_equal_start((*next).c_str(), dirRoot)) - { - gtk_tree_store_append(store, &iter, NULL); - gtk_tree_store_set (store, &iter, 0, CopiedString(StringRange(dirName, firstUnderscore)).c_str(), -1); - - // keep going... - while (i != groups.end() && string_equal_start((*i).c_str(), dirRoot)) - { - gtk_tree_store_append(store, &child, &iter); - gtk_tree_store_set (store, &child, 0, (*i).c_str(), -1); - ++i; - } - } - else - { - gtk_tree_store_append(store, &iter, NULL); - gtk_tree_store_set (store, &iter, 0, dirName, -1); - ++i; - } - } -} - -TextureGroups TextureGroups_constructTreeView() -{ - TextureGroups groups; - - if (TextureBrowser_showWads()) - { - GlobalFileSystem().forEachArchive (TextureGroupsAddWadCaller (groups)); - } + if (g_PrefsDlg.m_bTextureScrollbar) + gtk_widget_show (g_qeglobals_gui.d_texture_scroll); else + gtk_widget_hide (g_qeglobals_gui.d_texture_scroll); + m_bNeedRange = true; + RedrawWindow (); +} + +void TexWnd::FocusEdit() +{ + if (GTK_WIDGET_VISIBLE (m_pFilter)) + gtk_window_set_focus (GTK_WINDOW (g_pParentWnd->m_pWidget), m_pFilter); +} + +void TexWnd::OnMouseWheel(bool bUp) +{ + if (bUp) { - // scan texture dirs and pak files only if not restricting to shaderlist - if (g_pGameDescription->mGameType != "doom3" && !g_TextureBrowser_shaderlistOnly) - { - GlobalFileSystem().forEachDirectory ("textures/", TextureGroupsAddDirectoryCaller(groups)); - } - - GlobalShaderSystem().foreachShaderName(TextureGroupsAddShaderCaller(groups)); - } - - return groups; -} - -void TextureBrowser_constructTreeStore() -{ - TextureGroups groups = TextureGroups_constructTreeView(); - GtkTreeStore* store = gtk_tree_store_new(1, G_TYPE_STRING); - TextureGroups_constructTreeModel(groups, store); - std::set::iterator iter; - - GtkTreeModel* model = GTK_TREE_MODEL(store); - - gtk_tree_view_set_model(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTree), model); - - g_object_unref(G_OBJECT(store)); -} - -void TextureBrowser_constructTreeStoreTags() -{ - TextureGroups groups; - GtkTreeStore* store = gtk_tree_store_new(1, G_TYPE_STRING); - GtkTreeModel* model = GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list); - - gtk_tree_view_set_model(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), model); - - g_object_unref(G_OBJECT(store)); -} - -void TreeView_onRowActivated(GtkTreeView* treeview, GtkTreePath* path, GtkTreeViewColumn* col, gpointer userdata) -{ - GtkTreeIter iter; - - GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)); - - if (gtk_tree_model_get_iter (model, &iter, path)) - { - gchar dirName[1024]; - - gchar* buffer; - gtk_tree_model_get(model, &iter, 0, &buffer, -1); - strcpy(dirName, buffer); - g_free(buffer); - - g_TextureBrowser.m_searchedTags = false; - - if(!TextureBrowser_showWads()) - strcat(dirName, "/"); - - ScopeDisableScreenUpdates disableScreenUpdates(dirName, "Loading Textures"); - TextureBrowser_ShowDirectory(GlobalTextureBrowser (), dirName); - TextureBrowser_queueDraw(GlobalTextureBrowser ()); - } -} - -void TextureBrowser_createTreeViewTree() -{ - GtkCellRenderer* renderer; - g_TextureBrowser.m_treeViewTree = GTK_WIDGET(gtk_tree_view_new()); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTree), FALSE); - - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTree), FALSE); - g_signal_connect(g_TextureBrowser.m_treeViewTree, "row-activated", (GCallback) TreeView_onRowActivated, NULL); - - renderer = gtk_cell_renderer_text_new(); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTree), -1, "", renderer, "text", 0, NULL); - - TextureBrowser_constructTreeStore(); -} - -void TextureBrowser_addTag(); -void TextureBrowser_renameTag(); -void TextureBrowser_deleteTag(); - -void TextureBrowser_createContextMenu(GtkWidget *treeview, GdkEventButton *event) -{ - GtkWidget* menu = gtk_menu_new(); - - GtkWidget* menuitem = gtk_menu_item_new_with_label("Add tag"); - g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_addTag, treeview); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - - menuitem = gtk_menu_item_new_with_label("Rename tag"); - g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_renameTag, treeview); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - - menuitem = gtk_menu_item_new_with_label("Delete tag"); - g_signal_connect(menuitem, "activate", (GCallback)TextureBrowser_deleteTag, treeview); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - - gtk_widget_show_all(menu); - - gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, - (event != NULL) ? event->button : 0, - gdk_event_get_time((GdkEvent*)event)); -} - -gboolean TreeViewTags_onButtonPressed(GtkWidget *treeview, GdkEventButton *event) -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) - { - GtkTreePath *path; - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); - - if(gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), event->x, event->y, &path, NULL, NULL, NULL)) - { - gtk_tree_selection_unselect_all(selection); - gtk_tree_selection_select_path(selection, path); - gtk_tree_path_free(path); - } - - TextureBrowser_createContextMenu(treeview, event); - return TRUE; - } - return FALSE; -} - -void TextureBrowser_createTreeViewTags() -{ - GtkCellRenderer* renderer; - g_TextureBrowser.m_treeViewTags = GTK_WIDGET(gtk_tree_view_new()); - gtk_tree_view_set_enable_search(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), FALSE); - - g_signal_connect(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL); - - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), FALSE); - - renderer = gtk_cell_renderer_text_new(); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags), -1, "", renderer, "text", 0, NULL); - - TextureBrowser_constructTreeStoreTags(); -} - -GtkMenuItem* TextureBrowser_constructViewMenu(GtkMenu* menu) -{ - GtkMenuItem* textures_menu_item = new_sub_menu_item_with_mnemonic("_View"); - - if(g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu); - - create_check_menu_item_with_mnemonic(menu, "Hide _Unused", "ShowInUse"); - if(string_empty(g_pGameDescription->getKeyValue("show_wads"))) - { - create_check_menu_item_with_mnemonic(menu, "Hide Image Missing", "FilterNotex"); - } - menu_separator(menu); - - create_menu_item_with_mnemonic(menu, "Show All", "ShowAllTextures"); - - // we always want to show shaders but don't want a "Show Shaders" menu for doom3 and .wad file games - if(g_pGameDescription->mGameType == "doom3" || !string_empty(g_pGameDescription->getKeyValue("show_wads"))) - { - g_TextureBrowser.m_showShaders = true; - } - else - { - create_check_menu_item_with_mnemonic(menu, "Show shaders", "ToggleShowShaders"); - } - - if(g_pGameDescription->mGameType != "doom3" && string_empty(g_pGameDescription->getKeyValue("show_wads"))) - { - create_check_menu_item_with_mnemonic (menu, "Shaders Only", "ToggleShowShaderlistOnly"); - } - if(g_TextureBrowser.m_tags) - { - create_menu_item_with_mnemonic(menu, "Show Untagged", "ShowUntagged"); - } - - create_check_menu_item_with_mnemonic(menu, "Fixed Size", "FixedSize"); - - if(string_empty(g_pGameDescription->getKeyValue("show_wads"))) - { - menu_separator(menu); - g_TextureBrowser.m_shader_info_item = GTK_WIDGET(create_menu_item_with_mnemonic(menu, "Shader Info", "ShaderInfo")); - gtk_widget_set_sensitive(g_TextureBrowser.m_shader_info_item, FALSE); - } - - return textures_menu_item; -} - -GtkMenuItem* TextureBrowser_constructToolsMenu(GtkMenu* menu) -{ - GtkMenuItem* textures_menu_item = new_sub_menu_item_with_mnemonic("_Tools"); - - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu); - - create_menu_item_with_mnemonic(menu, "Flush & Reload Shaders", "RefreshShaders"); - create_menu_item_with_mnemonic(menu, "Find / Replace...", "FindReplaceTextures"); - - return textures_menu_item; -} - -GtkMenuItem* TextureBrowser_constructTagsMenu(GtkMenu* menu) -{ - GtkMenuItem* textures_menu_item = new_sub_menu_item_with_mnemonic("T_ags"); - - if (g_Layout_enableDetachableMenus.m_value) - menu_tearoff (menu); - - create_menu_item_with_mnemonic(menu, "Add tag", "AddTag"); - create_menu_item_with_mnemonic(menu, "Rename tag", "RenameTag"); - create_menu_item_with_mnemonic(menu, "Delete tag", "DeleteTag"); - menu_separator(menu); - create_menu_item_with_mnemonic(menu, "Copy tags from selected", "CopyTag"); - create_menu_item_with_mnemonic(menu, "Paste tags to selected", "PasteTag"); - - return textures_menu_item; -} - -gboolean TextureBrowser_tagMoveHelper(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, GSList** selected) -{ - g_assert(selected != NULL); - - GtkTreeRowReference* rowref = gtk_tree_row_reference_new (model, path); - *selected = g_slist_append(*selected, rowref); - - return FALSE; -} - -void TextureBrowser_assignTags() -{ - GSList* selected = NULL; - GSList* node; - gchar* tag_assigned; - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_available_tree)); - - gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected); - - if(selected != NULL) - { - for (node = selected; node != NULL; node = node->next) - { - GtkTreePath* path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)node->data); - - if(path) - { - GtkTreeIter iter; - - if (gtk_tree_model_get_iter(GTK_TREE_MODEL(g_TextureBrowser.m_available_store), &iter, path)) - { - gtk_tree_model_get(GTK_TREE_MODEL(g_TextureBrowser.m_available_store), &iter, TAG_COLUMN, &tag_assigned, -1); - if(!TagBuilder.CheckShaderTag(g_TextureBrowser.shader.c_str())) - { - // create a custom shader/texture entry - IShader* ishader = QERApp_Shader_ForName(g_TextureBrowser.shader.c_str()); - CopiedString filename = ishader->getShaderFileName(); - - if(filename.empty()) - { - // it's a texture - TagBuilder.AddShaderNode(g_TextureBrowser.shader.c_str(), CUSTOM, TEXTURE); - } else { - // it's a shader - TagBuilder.AddShaderNode(g_TextureBrowser.shader.c_str(), CUSTOM, SHADER); - } - ishader->DecRef(); - } - TagBuilder.AddShaderTag(g_TextureBrowser.shader.c_str(), (char*)tag_assigned, TAG); - - gtk_list_store_remove(g_TextureBrowser.m_available_store, &iter); - gtk_list_store_append (g_TextureBrowser.m_assigned_store, &iter); - gtk_list_store_set (g_TextureBrowser.m_assigned_store, &iter, TAG_COLUMN, (char*)tag_assigned, -1); - } - } - } - - g_slist_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL); - - // Save changes - TagBuilder.SaveXmlDoc(); - } - g_slist_free(selected); -} - -void TextureBrowser_removeTags() -{ - GSList* selected = NULL; - GSList* node; - gchar* tag; - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_assigned_tree)); - - gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected); - - if(selected != NULL) - { - for (node = selected; node != NULL; node = node->next) - { - GtkTreePath* path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)node->data); - - if (path) - { - GtkTreeIter iter; - - if (gtk_tree_model_get_iter(GTK_TREE_MODEL(g_TextureBrowser.m_assigned_store), &iter, path)) - { - gtk_tree_model_get(GTK_TREE_MODEL(g_TextureBrowser.m_assigned_store), &iter, TAG_COLUMN, &tag, -1); - TagBuilder.DeleteShaderTag(g_TextureBrowser.shader.c_str(), tag); - gtk_list_store_remove(g_TextureBrowser.m_assigned_store, &iter); - } - } - } - - g_slist_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL); - - // Update the "available tags list" - BuildStoreAvailableTags(g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser); - - // Save changes - TagBuilder.SaveXmlDoc(); - } - g_slist_free(selected); -} - -void TextureBrowser_buildTagList() -{ - GtkTreeIter treeIter; - gtk_list_store_clear(g_TextureBrowser.m_all_tags_list); - - std::set::iterator iter; - - for (iter = g_TextureBrowser.m_all_tags.begin(); iter != g_TextureBrowser.m_all_tags.end(); ++iter) - { - gtk_list_store_append(g_TextureBrowser.m_all_tags_list, &treeIter); - gtk_list_store_set(g_TextureBrowser.m_all_tags_list, &treeIter, TAG_COLUMN, (*iter).c_str(), -1); - } -} - -void TextureBrowser_searchTags() -{ - GSList* selected = NULL; - GSList* node; - gchar* tag; - char buffer[256]; - char tags_searched[256]; - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags)); - - gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected); - - if(selected != NULL) - { - strcpy(buffer, "/root/*/*[tag='"); - strcpy(tags_searched, "[TAGS] "); - - for (node = selected; node != NULL; node = node->next) - { - GtkTreePath* path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)node->data); - - if (path) - { - GtkTreeIter iter; - - if (gtk_tree_model_get_iter(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iter, path)) - { - gtk_tree_model_get(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iter, TAG_COLUMN, &tag, -1); - - strcat(buffer, tag); - strcat(tags_searched, tag); - if(node != g_slist_last(node)) - { - strcat(buffer, "' and tag='"); - strcat(tags_searched, ", "); - } - } - } - } - - strcat(buffer, "']"); - - g_slist_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL); - - g_TextureBrowser.m_found_shaders.clear(); // delete old list - TagBuilder.TagSearch(buffer, g_TextureBrowser.m_found_shaders); - - if(!g_TextureBrowser.m_found_shaders.empty()) // found something - { - size_t shaders_found = g_TextureBrowser.m_found_shaders.size(); - - globalOutputStream() << "Found " << shaders_found << " textures and shaders with " << tags_searched << "\n"; - ScopeDisableScreenUpdates disableScreenUpdates("Searching...", "Loading Textures"); - - std::set::iterator iter; - - for(iter = g_TextureBrowser.m_found_shaders.begin(); iter != g_TextureBrowser.m_found_shaders.end(); iter++) - { - std::string path = (*iter).c_str(); - size_t pos = path.find_last_of("/", path.size()); - std::string name = path.substr(pos + 1, path.size()); - path = path.substr(0, pos + 1); - TextureDirectory_loadTexture(path.c_str(), name.c_str()); - } - } - g_TextureBrowser.m_searchedTags = true; - g_TextureBrowser_currentDirectory = tags_searched; - - g_TextureBrowser.m_nTotalHeight = 0; - TextureBrowser_setOriginY(g_TextureBrowser, 0); - TextureBrowser_heightChanged(g_TextureBrowser); - TextureBrowser_updateTitle(); - } - g_slist_free(selected); -} - -void TextureBrowser_toggleSearchButton() -{ - gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook)); - - if(page == 0) // tag page - { - gtk_widget_show_all(g_TextureBrowser.m_search_button); - } else { - gtk_widget_hide_all(g_TextureBrowser.m_search_button); - } -} - -void TextureBrowser_constructTagNotebook() -{ - g_TextureBrowser.m_tag_notebook = gtk_notebook_new(); - GtkWidget* labelTags = gtk_label_new("Tags"); - GtkWidget* labelTextures = gtk_label_new("Textures"); - - gtk_notebook_append_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook), g_TextureBrowser.m_scr_win_tree, labelTextures); - gtk_notebook_append_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook), g_TextureBrowser.m_scr_win_tags, labelTags); - - g_signal_connect(G_OBJECT(g_TextureBrowser.m_tag_notebook), "switch-page", G_CALLBACK(TextureBrowser_toggleSearchButton), NULL); - - gtk_widget_show_all(g_TextureBrowser.m_tag_notebook); -} - -void TextureBrowser_constructSearchButton() -{ - GtkTooltips* tooltips = gtk_tooltips_new(); - - GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR); - g_TextureBrowser.m_search_button = gtk_button_new(); - g_signal_connect(G_OBJECT(g_TextureBrowser.m_search_button), "clicked", G_CALLBACK(TextureBrowser_searchTags), NULL); - gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags"); - gtk_container_add(GTK_CONTAINER(g_TextureBrowser.m_search_button), image); -} - -void TextureBrowser_checkTagFile() -{ - const char SHADERTAG_FILE[] = "shadertags.xml"; - CopiedString default_filename, rc_filename; - StringOutputStream stream(256); - - stream << LocalRcPath_get(); - stream << SHADERTAG_FILE; - rc_filename = stream.c_str(); - - if(file_exists(rc_filename.c_str())) - { - g_TextureBrowser.m_tags = TagBuilder.OpenXmlDoc(rc_filename.c_str()); - - if(g_TextureBrowser.m_tags) - { - globalOutputStream() << "Loading tag file " << rc_filename.c_str() << ".\n"; - } - } - else - { - // load default tagfile - stream.clear(); - stream << g_pGameDescription->mGameToolsPath.c_str(); - stream << SHADERTAG_FILE; - default_filename = stream.c_str(); - - if(file_exists(default_filename.c_str())) - { - g_TextureBrowser.m_tags = TagBuilder.OpenXmlDoc(default_filename.c_str(), rc_filename.c_str()); - - if(g_TextureBrowser.m_tags) - { - globalOutputStream() << "Loading default tag file " << default_filename.c_str() << ".\n"; - } - } - else - { - globalErrorStream() << "Unable to find default tag file " << default_filename.c_str() << ". No tag support.\n"; - } - } -} - -void TextureBrowser_SetNotex() -{ - StringOutputStream name(256); - name << GlobalRadiant().getAppPath() << "bitmaps/notex.bmp"; - g_notex = name.c_str(); - - name = NULL; - name << GlobalRadiant().getAppPath() << "bitmaps/shadernotex.bmp"; - g_shadernotex = name.c_str(); -} - -GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel) -{ - // The gl_widget and the tag assignment frame should be packed into a GtkVPaned with the slider - // position stored in local.pref. gtk_paned_get_position() and gtk_paned_set_position() don't - // seem to work in gtk 2.4 and the arrow buttons don't handle GTK_FILL, so here's another thing - // for the "once-the-gtk-libs-are-updated-TODO-list" :x - - TextureBrowser_checkTagFile(); - TextureBrowser_SetNotex(); - - GlobalShaderSystem().setActiveShadersChangedNotify(ReferenceCaller(g_TextureBrowser)); - - g_TextureBrowser.m_parent = toplevel; - - GtkWidget* table = gtk_table_new(3, 3, FALSE); - GtkWidget* frame_table = NULL; - GtkWidget* vbox = gtk_vbox_new(FALSE, 0); - gtk_table_attach(GTK_TABLE(table), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0); - gtk_widget_show(vbox); - - GtkWidget* menu_bar; - - { // menu bar - menu_bar = gtk_menu_bar_new(); - GtkWidget* menu_view = gtk_menu_new(); - GtkWidget* view_item = (GtkWidget*)TextureBrowser_constructViewMenu(GTK_MENU(menu_view)); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(view_item), menu_view); - gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), view_item); - - GtkWidget* menu_tools = gtk_menu_new(); - GtkWidget* tools_item = (GtkWidget*)TextureBrowser_constructToolsMenu(GTK_MENU(menu_tools)); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(tools_item), menu_tools); - gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), tools_item); - - gtk_table_attach(GTK_TABLE (table), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0); - gtk_widget_show(menu_bar); - } - { // Texture TreeView - g_TextureBrowser.m_scr_win_tree = gtk_scrolled_window_new(NULL, NULL); - gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tree), 0); - - // vertical only scrolling for treeview - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - gtk_widget_show(g_TextureBrowser.m_scr_win_tree); - - TextureBrowser_createTreeViewTree(); - - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tree), GTK_WIDGET(g_TextureBrowser.m_treeViewTree)); - gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTree)); - } - { // gl_widget scrollbar - GtkWidget* w = gtk_vscrollbar_new(GTK_ADJUSTMENT(gtk_adjustment_new (0,0,0,1,1,1))); - gtk_table_attach(GTK_TABLE (table), w, 2, 3, 1, 2, GTK_SHRINK, GTK_FILL, 0, 0); - gtk_widget_show(w); - g_TextureBrowser.m_texture_scroll = w; - - GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_TextureBrowser.m_texture_scroll)); - g_signal_connect(G_OBJECT(vadjustment), "value_changed", G_CALLBACK(TextureBrowser_verticalScroll), &g_TextureBrowser); - - widget_set_visible(g_TextureBrowser.m_texture_scroll, g_TextureBrowser.m_showTextureScrollbar); - } - { // gl_widget - g_TextureBrowser.m_gl_widget = glwidget_new(FALSE); - gtk_widget_ref(g_TextureBrowser.m_gl_widget); - - gtk_widget_set_events(g_TextureBrowser.m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK); - GTK_WIDGET_SET_FLAGS(g_TextureBrowser.m_gl_widget, GTK_CAN_FOCUS); - - gtk_table_attach_defaults(GTK_TABLE(table), g_TextureBrowser.m_gl_widget, 1, 2, 1, 2); - gtk_widget_show(g_TextureBrowser.m_gl_widget); - - g_TextureBrowser.m_sizeHandler = g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "size_allocate", G_CALLBACK(TextureBrowser_size_allocate), &g_TextureBrowser); - g_TextureBrowser.m_exposeHandler = g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "expose_event", G_CALLBACK(TextureBrowser_expose), &g_TextureBrowser); - - g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "button_press_event", G_CALLBACK(TextureBrowser_button_press), &g_TextureBrowser); - g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "button_release_event", G_CALLBACK(TextureBrowser_button_release), &g_TextureBrowser); - g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "motion_notify_event", G_CALLBACK(TextureBrowser_motion), &g_TextureBrowser); - g_signal_connect(G_OBJECT(g_TextureBrowser.m_gl_widget), "scroll_event", G_CALLBACK(TextureBrowser_scroll), &g_TextureBrowser); - } - - // tag stuff - if(g_TextureBrowser.m_tags) - { - { // fill tag GtkListStore - g_TextureBrowser.m_all_tags_list = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING); - GtkTreeSortable* sortable = GTK_TREE_SORTABLE(g_TextureBrowser.m_all_tags_list); - gtk_tree_sortable_set_sort_column_id(sortable, TAG_COLUMN, GTK_SORT_ASCENDING); - - TagBuilder.GetAllTags(g_TextureBrowser.m_all_tags); - TextureBrowser_buildTagList(); - } - { // tag menu bar - GtkWidget* menu_tags = gtk_menu_new(); - GtkWidget* tags_item = (GtkWidget*)TextureBrowser_constructTagsMenu(GTK_MENU(menu_tags)); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(tags_item), menu_tags); - gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), tags_item); - } - { // Tag TreeView - g_TextureBrowser.m_scr_win_tags = gtk_scrolled_window_new(NULL, NULL); - gtk_container_set_border_width(GTK_CONTAINER(g_TextureBrowser.m_scr_win_tags), 0); - - // vertical only scrolling for treeview - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(g_TextureBrowser.m_scr_win_tags), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - TextureBrowser_createTreeViewTags(); - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags)); - gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); - - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (g_TextureBrowser.m_scr_win_tags), GTK_WIDGET (g_TextureBrowser.m_treeViewTags)); - gtk_widget_show(GTK_WIDGET(g_TextureBrowser.m_treeViewTags)); - } - { // Texture/Tag notebook - TextureBrowser_constructTagNotebook(); - gtk_box_pack_start(GTK_BOX(vbox), g_TextureBrowser.m_tag_notebook, TRUE, TRUE, 0); - } - { // Tag search button - TextureBrowser_constructSearchButton(); - gtk_box_pack_end(GTK_BOX(vbox), g_TextureBrowser.m_search_button, FALSE, FALSE, 0); - } - { // Tag frame - frame_table = gtk_table_new(3, 3, FALSE); - - g_TextureBrowser.m_tag_frame = gtk_frame_new("Tag assignment"); - gtk_frame_set_label_align(GTK_FRAME(g_TextureBrowser.m_tag_frame), 0.5, 0.5); - gtk_frame_set_shadow_type(GTK_FRAME(g_TextureBrowser.m_tag_frame), GTK_SHADOW_NONE); - - gtk_table_attach(GTK_TABLE(table), g_TextureBrowser.m_tag_frame, 1, 3, 2, 3, GTK_FILL, GTK_SHRINK, 0, 0); - - gtk_widget_show(frame_table); - - gtk_container_add (GTK_CONTAINER(g_TextureBrowser.m_tag_frame), frame_table); - } - { // assigned tag list - GtkWidget* scrolled_win = gtk_scrolled_window_new(NULL, NULL); - gtk_container_set_border_width(GTK_CONTAINER (scrolled_win), 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - g_TextureBrowser.m_assigned_store = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING); - - GtkTreeSortable* sortable = GTK_TREE_SORTABLE(g_TextureBrowser.m_assigned_store); - gtk_tree_sortable_set_sort_column_id(sortable, TAG_COLUMN, GTK_SORT_ASCENDING); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); - - g_TextureBrowser.m_assigned_tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL (g_TextureBrowser.m_assigned_store)); - g_object_unref(G_OBJECT (g_TextureBrowser.m_assigned_store)); - g_signal_connect(g_TextureBrowser.m_assigned_tree, "row-activated", (GCallback) TextureBrowser_removeTags, NULL); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW (g_TextureBrowser.m_assigned_tree), FALSE); - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_assigned_tree)); - gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); - - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes("", renderer, "text", TAG_COLUMN, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW (g_TextureBrowser.m_assigned_tree), column); - gtk_widget_show(g_TextureBrowser.m_assigned_tree); - - gtk_widget_show(scrolled_win); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (scrolled_win), GTK_WIDGET (g_TextureBrowser.m_assigned_tree)); - - gtk_table_attach(GTK_TABLE(frame_table), scrolled_win, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0); - } - { // available tag list - GtkWidget* scrolled_win = gtk_scrolled_window_new (NULL, NULL); - gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - g_TextureBrowser.m_available_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING); - GtkTreeSortable* sortable = GTK_TREE_SORTABLE(g_TextureBrowser.m_available_store); - gtk_tree_sortable_set_sort_column_id(sortable, TAG_COLUMN, GTK_SORT_ASCENDING); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new (); - - g_TextureBrowser.m_available_tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (g_TextureBrowser.m_available_store)); - g_object_unref (G_OBJECT (g_TextureBrowser.m_available_store)); - g_signal_connect(g_TextureBrowser.m_available_tree, "row-activated", (GCallback) TextureBrowser_assignTags, NULL); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (g_TextureBrowser.m_available_tree), FALSE); - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_available_tree)); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); - - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes ("", renderer, "text", TAG_COLUMN, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (g_TextureBrowser.m_available_tree), column); - gtk_widget_show (g_TextureBrowser.m_available_tree); - - gtk_widget_show (scrolled_win); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), GTK_WIDGET (g_TextureBrowser.m_available_tree)); - - gtk_table_attach (GTK_TABLE (frame_table), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0); - } - { // tag arrow buttons - GtkWidget* m_btn_left = gtk_button_new(); - GtkWidget* m_btn_right = gtk_button_new(); - GtkWidget* m_arrow_left = gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_OUT); - GtkWidget* m_arrow_right = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_OUT); - gtk_container_add(GTK_CONTAINER(m_btn_left), m_arrow_left); - gtk_container_add(GTK_CONTAINER(m_btn_right), m_arrow_right); - - // workaround. the size of the tag frame depends of the requested size of the arrow buttons. - gtk_widget_set_size_request(m_arrow_left, -1, 68); - gtk_widget_set_size_request(m_arrow_right, -1, 68); - - gtk_table_attach(GTK_TABLE(frame_table), m_btn_left, 1, 2, 1, 2, GTK_SHRINK, GTK_EXPAND, 0, 0); - gtk_table_attach(GTK_TABLE(frame_table), m_btn_right, 1, 2, 2, 3, GTK_SHRINK, GTK_EXPAND, 0, 0); - - g_signal_connect(G_OBJECT (m_btn_left), "clicked", G_CALLBACK(TextureBrowser_assignTags), NULL); - g_signal_connect(G_OBJECT (m_btn_right), "clicked", G_CALLBACK(TextureBrowser_removeTags), NULL); - - gtk_widget_show(m_btn_left); - gtk_widget_show(m_btn_right); - gtk_widget_show(m_arrow_left); - gtk_widget_show(m_arrow_right); - } - { // tag fram labels - GtkWidget* m_lbl_assigned = gtk_label_new ("Assigned"); - GtkWidget* m_lbl_unassigned = gtk_label_new ("Available"); - - gtk_table_attach (GTK_TABLE (frame_table), m_lbl_assigned, 0, 1, 0, 1, GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_table_attach (GTK_TABLE (frame_table), m_lbl_unassigned, 2, 3, 0, 1, GTK_EXPAND, GTK_SHRINK, 0, 0); - - gtk_widget_show (m_lbl_assigned); - gtk_widget_show (m_lbl_unassigned); - } - } else { // no tag support, show the texture tree only - gtk_box_pack_start(GTK_BOX(vbox), g_TextureBrowser.m_scr_win_tree, TRUE, TRUE, 0); - } - - // TODO do we need this? - //gtk_container_set_focus_chain(GTK_CONTAINER(hbox_table), NULL); - - return table; -} - -void TextureBrowser_destroyWindow() -{ - GlobalShaderSystem().setActiveShadersChangedNotify(Callback()); - - g_signal_handler_disconnect(G_OBJECT(g_TextureBrowser.m_gl_widget), g_TextureBrowser.m_sizeHandler); - g_signal_handler_disconnect(G_OBJECT(g_TextureBrowser.m_gl_widget), g_TextureBrowser.m_exposeHandler); - - gtk_widget_unref(g_TextureBrowser.m_gl_widget); -} - -const Vector3& TextureBrowser_getBackgroundColour(TextureBrowser& textureBrowser) -{ - return textureBrowser.color_textureback; -} - -void TextureBrowser_setBackgroundColour(TextureBrowser& textureBrowser, const Vector3& colour) -{ - textureBrowser.color_textureback = colour; - TextureBrowser_queueDraw(textureBrowser); -} - -void TextureBrowser_selectionHelper(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, GSList** selected) -{ - g_assert(selected != NULL); - - gchar* name; - gtk_tree_model_get(model, iter, TAG_COLUMN, &name, -1); - *selected = g_slist_append(*selected, name); -} - -void TextureBrowser_shaderInfo() -{ - const char* name = TextureBrowser_GetSelectedShader(g_TextureBrowser); - IShader* shader = QERApp_Shader_ForName(name); - - DoShaderInfoDlg(name, shader->getShaderFileName(), "Shader Info"); - - shader->DecRef(); -} - -void TextureBrowser_addTag() -{ - CopiedString tag; - - EMessageBoxReturn result = DoShaderTagDlg(&tag, "Add shader tag"); - - if (result == eIDOK && !tag.empty()) - { - GtkTreeIter iter, iter2; - g_TextureBrowser.m_all_tags.insert(tag.c_str()); - gtk_list_store_append(g_TextureBrowser.m_available_store, &iter); - gtk_list_store_set(g_TextureBrowser.m_available_store, &iter, TAG_COLUMN, tag.c_str(), -1); - - // Select the currently added tag in the available list - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_available_tree)); - gtk_tree_selection_select_iter(selection, &iter); - - gtk_list_store_append(g_TextureBrowser.m_all_tags_list, &iter2); - gtk_list_store_set(g_TextureBrowser.m_all_tags_list, &iter2, TAG_COLUMN, tag.c_str(), -1); - } -} - -void TextureBrowser_renameTag() -{ - /* WORKAROUND: The tag treeview is set to GTK_SELECTION_MULTIPLE. Because - gtk_tree_selection_get_selected() doesn't work with GTK_SELECTION_MULTIPLE, - we need to count the number of selected rows first and use - gtk_tree_selection_selected_foreach() then to go through the list of selected - rows (which always containins a single row). - */ - - GSList* selected = NULL; - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags)); - gtk_tree_selection_selected_foreach(selection, GtkTreeSelectionForeachFunc(TextureBrowser_selectionHelper), &selected); - - if(g_slist_length(selected) == 1) // we only rename a single tag - { - CopiedString newTag; - EMessageBoxReturn result = DoShaderTagDlg(&newTag, "Rename shader tag"); - - if (result == eIDOK && !newTag.empty()) - { - GtkTreeIter iterList; - gchar* rowTag; - gchar* oldTag = (char*)selected->data; - - bool row = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterList) != 0; - - while(row) - { - gtk_tree_model_get(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterList, TAG_COLUMN, &rowTag, -1); - - if(strcmp(rowTag, oldTag) == 0) - { - gtk_list_store_set(g_TextureBrowser.m_all_tags_list, &iterList, TAG_COLUMN, newTag.c_str(), -1); - } - row = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterList) != 0; - } - - TagBuilder.RenameShaderTag(oldTag, newTag.c_str()); - - g_TextureBrowser.m_all_tags.erase((CopiedString)oldTag); - g_TextureBrowser.m_all_tags.insert(newTag); - - BuildStoreAssignedTags(g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser); - BuildStoreAvailableTags(g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser); - } - } - else - { - gtk_MessageBox(GTK_WIDGET(g_TextureBrowser.m_parent), "Select a single tag for renaming."); - } -} - -void TextureBrowser_deleteTag() -{ - GSList* selected = NULL; - - GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_TextureBrowser.m_treeViewTags)); - gtk_tree_selection_selected_foreach(selection, GtkTreeSelectionForeachFunc(TextureBrowser_selectionHelper), &selected); - - if(g_slist_length(selected) == 1) // we only delete a single tag - { - EMessageBoxReturn result = gtk_MessageBox(GTK_WIDGET(g_TextureBrowser.m_parent), "Are you sure you want to delete the selected tag?", "Delete Tag", eMB_YESNO, eMB_ICONQUESTION); - - if(result == eIDYES) - { - GtkTreeIter iterSelected; - gchar *rowTag; - - gchar* tagSelected = (char*)selected->data; - - bool row = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterSelected) != 0; - - while(row) - { - gtk_tree_model_get(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterSelected, TAG_COLUMN, &rowTag, -1); - - if(strcmp(rowTag, tagSelected) == 0) - { - gtk_list_store_remove(g_TextureBrowser.m_all_tags_list, &iterSelected); - break; - } - row = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_TextureBrowser.m_all_tags_list), &iterSelected) != 0; - } - - TagBuilder.DeleteTag(tagSelected); - g_TextureBrowser.m_all_tags.erase((CopiedString)tagSelected); - - BuildStoreAssignedTags(g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser); - BuildStoreAvailableTags(g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser); - } - } else { - gtk_MessageBox(GTK_WIDGET(g_TextureBrowser.m_parent), "Select a single tag for deletion."); - } -} - -void TextureBrowser_copyTag() -{ - g_TextureBrowser.m_copied_tags.clear(); - TagBuilder.GetShaderTags(g_TextureBrowser.shader.c_str(), g_TextureBrowser.m_copied_tags); -} - -void TextureBrowser_pasteTag() -{ - IShader* ishader = QERApp_Shader_ForName(g_TextureBrowser.shader.c_str()); - CopiedString shader = g_TextureBrowser.shader.c_str(); - - if(!TagBuilder.CheckShaderTag(shader.c_str())) - { - CopiedString shaderFile = ishader->getShaderFileName(); - if(shaderFile.empty()) - { - // it's a texture - TagBuilder.AddShaderNode(shader.c_str(), CUSTOM, TEXTURE); - } - else - { - // it's a shader - TagBuilder.AddShaderNode(shader.c_str(), CUSTOM, SHADER); - } - - for(size_t i = 0; i < g_TextureBrowser.m_copied_tags.size(); ++i) - { - TagBuilder.AddShaderTag(shader.c_str(), g_TextureBrowser.m_copied_tags[i].c_str(), TAG); - } - } - else - { - for(size_t i = 0; i < g_TextureBrowser.m_copied_tags.size(); ++i) - { - if(!TagBuilder.CheckShaderTag(shader.c_str(), g_TextureBrowser.m_copied_tags[i].c_str())) - { - // the tag doesn't exist - let's add it - TagBuilder.AddShaderTag(shader.c_str(), g_TextureBrowser.m_copied_tags[i].c_str(), TAG); + if(g_qeglobals.d_texturewin.originy < 0) { + g_qeglobals.d_texturewin.originy += g_PrefsDlg.m_nWheelInc; + // clamp so we don't get jiggle if moved by less than scrollwheel increment + if(g_qeglobals.d_texturewin.originy > 0) { + g_qeglobals.d_texturewin.originy = 0; } } } - - ishader->DecRef(); - - TagBuilder.SaveXmlDoc(); - BuildStoreAssignedTags(g_TextureBrowser.m_assigned_store, shader.c_str(), &g_TextureBrowser); - BuildStoreAvailableTags (g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser); -} - -void RefreshShaders() -{ - ScopeDisableScreenUpdates disableScreenUpdates("Processing...", "Loading Shaders"); - GlobalShaderSystem().refresh(); - UpdateAllWindows(); -} - -void TextureBrowser_ToggleShowShaders() -{ - g_TextureBrowser.m_showShaders ^= 1; - g_TextureBrowser.m_showshaders_item.update(); - TextureBrowser_queueDraw(g_TextureBrowser); -} - -void TextureBrowser_ToggleShowShaderListOnly() -{ - g_TextureBrowser_shaderlistOnly ^= 1; - g_TextureBrowser.m_showshaderlistonly_item.update(); - - TextureBrowser_constructTreeStore(); -} - -void TextureBrowser_showAll() -{ - g_TextureBrowser_currentDirectory = ""; - g_TextureBrowser.m_searchedTags = false; - TextureBrowser_heightChanged(g_TextureBrowser); - TextureBrowser_updateTitle(); -} - -void TextureBrowser_showUntagged() -{ - EMessageBoxReturn result = gtk_MessageBox(GTK_WIDGET(g_TextureBrowser.m_parent), "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", eMB_YESNO, eMB_ICONWARNING); - - if(result == eIDYES) - { - g_TextureBrowser.m_found_shaders.clear(); - TagBuilder.GetUntagged(g_TextureBrowser.m_found_shaders); - std::set::iterator iter; - - ScopeDisableScreenUpdates disableScreenUpdates("Searching untagged textures...", "Loading Textures"); - - for(iter = g_TextureBrowser.m_found_shaders.begin(); iter != g_TextureBrowser.m_found_shaders.end(); iter++) - { - std::string path = (*iter).c_str(); - size_t pos = path.find_last_of("/", path.size()); - std::string name = path.substr(pos + 1, path.size()); - path = path.substr(0, pos + 1); - TextureDirectory_loadTexture(path.c_str(), name.c_str()); - globalErrorStream() << path.c_str() << name.c_str() << "\n"; - } - - g_TextureBrowser_currentDirectory = "Untagged"; - TextureBrowser_queueDraw(GlobalTextureBrowser()); - TextureBrowser_heightChanged(g_TextureBrowser); - TextureBrowser_updateTitle(); - } -} - -void TextureBrowser_FixedSize() -{ - g_TextureBrowser_fixedSize ^= 1; - GlobalTextureBrowser().m_fixedsize_item.update(); - TextureBrowser_activeShadersChanged(GlobalTextureBrowser()); -} - -void TextureBrowser_FilterNotex() -{ - g_TextureBrowser_filterNotex ^= 1; - GlobalTextureBrowser().m_filternotex_item.update(); - TextureBrowser_activeShadersChanged(GlobalTextureBrowser()); -} - -void TextureBrowser_exportTitle(const StringImportCallback& importer) -{ - StringOutputStream buffer(64); - buffer << "Textures: "; - if(!string_empty(g_TextureBrowser_currentDirectory.c_str())) - { - buffer << g_TextureBrowser_currentDirectory.c_str(); - } else { - buffer << "all"; + if(g_qeglobals.d_texturewin.originy > (-g_qeglobals.d_texturewin.m_nTotalHeight + g_qeglobals.d_texturewin.height)) + g_qeglobals.d_texturewin.originy -= g_PrefsDlg.m_nWheelInc; } - importer(buffer.c_str()); + GtkAdjustment *vadjustment = gtk_range_get_adjustment (GTK_RANGE (g_qeglobals_gui.d_texture_scroll)); + gtk_adjustment_set_value (vadjustment, abs(g_qeglobals.d_texturewin.originy)); + + RedrawWindow(); } - -void TextureScaleImport(TextureBrowser& textureBrowser, int value) +// NOTE TTimo +// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=23 +void TexWnd::DragDropTexture (guint32 flags, int pointx, int pointy) { - switch(value) + // This gets called from leftmouse up event. We see if the mouseup is above + // the camwindow. If this is the case do a trace for a surface. If we hit a + // surface, texture it with the current texture. + + int m_ptXcheck, m_ptYcheck; + int m_ptX, m_ptY; + GtkWidget *widget; + gint x, y; + vec3_t dir; + float f, r, u; + int i; + + // we only want to catch a plain mouseevent + if (flags) + return; + + // see if we are above the camwindow + Sys_GetCursorPos (&m_ptX, &m_ptY); + + if (g_pParentWnd->CurrentStyle() == MainFrame::eFloating) + widget = g_pParentWnd->GetCamWnd()->m_pParent; + else + widget = g_pParentWnd->GetCamWnd()->GetWidget(); + + get_window_pos (widget, &x, &y); + + if (m_ptX < x || m_ptY < y || + m_ptX > x + widget->allocation.width || + m_ptY > y + widget->allocation.height) + return; + + // check if the camwindow isn't being partially hidden by another window at this point + // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=187 + m_ptXcheck = m_ptX; + m_ptYcheck = m_ptY; + + if( g_pParentWnd->GetCamWnd()->GetWidget()->window != gdk_window_at_pointer( &m_ptXcheck, &m_ptYcheck ) ) + return; + + // calc ray direction + x = m_ptX - x; + y = g_pParentWnd->GetCamWnd()->Camera()->height - 1 - (m_ptY - y); + u = (float)( y - ( g_pParentWnd->GetCamWnd()->Camera()->height * .5f ) ) / ( g_pParentWnd->GetCamWnd()->Camera()->height * .5f ); + r = (float)( x - ( g_pParentWnd->GetCamWnd()->Camera()->width * .5f ) ) / ( g_pParentWnd->GetCamWnd()->Camera()->width * .5f ); + f = 1; + + for (i=0 ; i<3 ; i++) + dir[i] = g_pParentWnd->GetCamWnd()->Camera()->vpn[i] * f + + g_pParentWnd->GetCamWnd()->Camera()->vright[i] * r + + g_pParentWnd->GetCamWnd()->Camera()->vup[i] * u; + VectorNormalize (dir, dir); + + // do a trace for a surface + trace_t t; + + t = Test_Ray (g_pParentWnd->GetCamWnd()->Camera()->origin, dir, SF_SINGLEFACE); + + if (t.brush) { - case 0: - TextureBrowser_setScale(textureBrowser, 10); - break; - case 1: - TextureBrowser_setScale(textureBrowser, 25); - break; - case 2: - TextureBrowser_setScale(textureBrowser, 50); - break; - case 3: - TextureBrowser_setScale(textureBrowser, 100); - break; - case 4: - TextureBrowser_setScale(textureBrowser, 200); - break; + texdef_t tex; + brushprimit_texdef_t brushprimit_tex; + + memset (&tex, 0, sizeof(tex)); + memset (&brushprimit_tex, 0, sizeof(brushprimit_tex)); + if (g_qeglobals.m_bBrushPrimitMode) + { + // brushprimit fitted to a 2x2 texture + brushprimit_tex.coords[0][0] = 1.0f; + brushprimit_tex.coords[1][1] = 1.0f; + } else + { + tex.scale[0] = g_pGameDescription->mTextureDefaultScale; + tex.scale[1] = g_pGameDescription->mTextureDefaultScale; + } + tex.flags = g_qeglobals.d_texturewin.texdef.flags; + tex.value = g_qeglobals.d_texturewin.texdef.value; + tex.contents = g_qeglobals.d_texturewin.texdef.contents; + // TTimo - shader code cleanup + // texdef.name is the name of the shader, not the name of the actual texture file + tex.SetName(g_qeglobals.d_texturewin.texdef.GetName()); + + Undo_Start("set face textures"); + Undo_AddBrush(t.brush); + SetFaceTexdef (t.face, &tex, &brushprimit_tex, false, NULL ); + Brush_Build(t.brush, false); + Undo_EndBrush(t.brush); + Undo_End(); + + Sys_UpdateWindows (W_CAMERA); + g_pParentWnd->OnTimer (); } } -typedef ReferenceCaller1 TextureScaleImportCaller; - -void TextureScaleExport(TextureBrowser& textureBrowser, const IntImportCallback& importer) -{ - switch(textureBrowser.m_textureScale) - { - case 10: - importer(0); - break; - case 25: - importer(1); - break; - case 50: - importer(2); - break; - case 100: - importer(3); - break; - case 200: - importer(4); - break; - } -} -typedef ReferenceCaller1 TextureScaleExportCaller; - -void TextureBrowser_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox( - "", "Texture scrollbar", - TextureBrowserImportShowScrollbarCaller(GlobalTextureBrowser()), - BoolExportCaller(GlobalTextureBrowser().m_showTextureScrollbar) - ); - { - const char* texture_scale[] = { "10%", "25%", "50%", "100%", "200%" }; - page.appendCombo( - "Texture Thumbnail Scale", - STRING_ARRAY_RANGE(texture_scale), - IntImportCallback(TextureScaleImportCaller(GlobalTextureBrowser())), - IntExportCallback(TextureScaleExportCaller(GlobalTextureBrowser())) - ); - } - page.appendEntry("Mousewheel Increment", GlobalTextureBrowser().m_mouseWheelScrollIncrement); - { - const char* startup_shaders[] = { "None", TextureBrowser_getComonShadersName() }; - page.appendCombo("Load Shaders at Startup", reinterpret_cast(GlobalTextureBrowser().m_startupShaders), STRING_ARRAY_RANGE(startup_shaders)); - } -} -void TextureBrowser_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Texture Browser", "Texture Browser Preferences")); - TextureBrowser_constructPreferences(page); -} -void TextureBrowser_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - - -#include "preferencesystem.h" -#include "stringio.h" - -typedef ReferenceCaller1 TextureBrowserSetScaleCaller; - - - -void TextureClipboard_textureSelected(const char* shader); - -void TextureBrowser_Construct() -{ - GlobalCommands_insert("ShaderInfo", FreeCaller()); - GlobalCommands_insert("ShowUntagged", FreeCaller()); - GlobalCommands_insert("AddTag", FreeCaller()); - GlobalCommands_insert("RenameTag", FreeCaller()); - GlobalCommands_insert("DeleteTag", FreeCaller()); - GlobalCommands_insert("CopyTag", FreeCaller()); - GlobalCommands_insert("PasteTag", FreeCaller()); - GlobalCommands_insert("RefreshShaders", FreeCaller()); - GlobalToggles_insert("ShowInUse", FreeCaller(), ToggleItem::AddCallbackCaller(g_TextureBrowser.m_hideunused_item), Accelerator('U')); - GlobalCommands_insert("ShowAllTextures", FreeCaller(), Accelerator('A', (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("ToggleTextures", FreeCaller(), Accelerator('T')); - GlobalToggles_insert("ToggleShowShaders", FreeCaller(), ToggleItem::AddCallbackCaller(g_TextureBrowser.m_showshaders_item)); - GlobalToggles_insert("ToggleShowShaderlistOnly", FreeCaller(), ToggleItem::AddCallbackCaller(g_TextureBrowser.m_showshaderlistonly_item)); - GlobalToggles_insert("FixedSize", FreeCaller(), ToggleItem::AddCallbackCaller(g_TextureBrowser.m_fixedsize_item)); - GlobalToggles_insert("FilterNotex", FreeCaller(), ToggleItem::AddCallbackCaller(g_TextureBrowser.m_filternotex_item)); - - GlobalPreferenceSystem().registerPreference("TextureScale", - makeSizeStringImportCallback(TextureBrowserSetScaleCaller(g_TextureBrowser)), - SizeExportStringCaller(g_TextureBrowser.m_textureScale) - ); - GlobalPreferenceSystem().registerPreference("TextureScrollbar", - makeBoolStringImportCallback(TextureBrowserImportShowScrollbarCaller(g_TextureBrowser)), - BoolExportStringCaller(GlobalTextureBrowser().m_showTextureScrollbar) - ); - GlobalPreferenceSystem().registerPreference("ShowShaders", BoolImportStringCaller(GlobalTextureBrowser().m_showShaders), BoolExportStringCaller(GlobalTextureBrowser().m_showShaders)); - GlobalPreferenceSystem().registerPreference("ShowShaderlistOnly", BoolImportStringCaller(g_TextureBrowser_shaderlistOnly), BoolExportStringCaller(g_TextureBrowser_shaderlistOnly)); - GlobalPreferenceSystem().registerPreference("FixedSize", BoolImportStringCaller(g_TextureBrowser_fixedSize), BoolExportStringCaller(g_TextureBrowser_fixedSize)); - GlobalPreferenceSystem().registerPreference("FilterNotex", BoolImportStringCaller(g_TextureBrowser_filterNotex), BoolExportStringCaller(g_TextureBrowser_filterNotex)); - GlobalPreferenceSystem().registerPreference("LoadShaders", IntImportStringCaller(reinterpret_cast(GlobalTextureBrowser().m_startupShaders)), IntExportStringCaller(reinterpret_cast(GlobalTextureBrowser().m_startupShaders))); - GlobalPreferenceSystem().registerPreference("WheelMouseInc", SizeImportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement), SizeExportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement)); - GlobalPreferenceSystem().registerPreference("SI_Colors0", Vector3ImportStringCaller(GlobalTextureBrowser().color_textureback), Vector3ExportStringCaller(GlobalTextureBrowser().color_textureback)); - - g_TextureBrowser.shader = texdef_name_default(); - - Textures_setModeChangedNotify(ReferenceCaller(g_TextureBrowser)); - - TextureBrowser_registerPreferencesPage(); - - GlobalShaderSystem().attach(g_ShadersObserver); - - TextureBrowser_textureSelected = TextureClipboard_textureSelected; -} -void TextureBrowser_Destroy() -{ - GlobalShaderSystem().detach(g_ShadersObserver); - - Textures_setModeChangedNotify(Callback()); -} diff --git a/radiant/texwindow.h b/radiant/texwindow.h index c5dbf33c..f0f03daf 100644 --- a/radiant/texwindow.h +++ b/radiant/texwindow.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,44 +19,44 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_TEXWINDOW_H) -#define INCLUDED_TEXWINDOW_H +#ifndef _TEXWINDOW_H_ +#define _TEXWINDOW_H_ -#include "math/vector.h" -#include "generic/callbackfwd.h" -#include "signal/signalfwd.h" -#include "xml/xmltextags.h" +#include "glwindow.h" -typedef struct _GtkWidget GtkWidget; +class TexWnd : public GLWindow +{ +public: + TexWnd(); + void UpdateFilter(const char* pFilter); + void UpdatePrefs(); + void FocusEdit(); + bool CheckFilter( const char* ); + virtual ~TexWnd(); -class TextureBrowser; -TextureBrowser& GlobalTextureBrowser(); + GtkWidget *m_pFilter; -typedef struct _GtkWindow GtkWindow; -GtkWidget* TextureBrowser_constructWindow(GtkWindow* toplevel); -void TextureBrowser_destroyWindow(); +protected: + bool m_bNeedRange; + void OnCreate (); + void OnExpose (); + void OnLButtonDown (guint32 flags, int x, int y); + void OnRButtonDown (guint32 flags, int x, int y); + void OnMButtonDown (guint32 flags, int x, int y); + void OnLButtonUp (guint32 flags, int pointx, int pointy); + void OnRButtonUp (guint32 flags, int pointx, int pointy); + void OnMButtonUp (guint32 flags, int pointx, int pointy); + void OnMouseMove (guint32 flags, int pointx, int pointy); + void OnSize (int cx, int cy); -void TextureBrowser_ShowDirectory(TextureBrowser& textureBrowser, const char* name); -void TextureBrowser_ShowStartupShaders(TextureBrowser& textureBrowser); + void OnMouseWheel(bool bUp); -const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrower); + public: + void OnVScroll (); -void TextureBrowser_Construct(); -void TextureBrowser_Destroy(); + private: + void DragDropTexture (guint32 flags, int pointx, int pointy); +}; -typedef Callback1 StringImportCallback; -template -class FreeCaller1; - -extern GtkWidget* g_page_textures; -void TextureBrowser_exportTitle(const StringImportCallback& importer); -typedef FreeCaller1 TextureBrowserExportTitleCaller; - -const Vector3& TextureBrowser_getBackgroundColour(TextureBrowser& textureBrowser); -void TextureBrowser_setBackgroundColour(TextureBrowser& textureBrowser, const Vector3& colour); - -void TextureBrowser_addActiveShadersChangedCallback(const SignalHandler& handler); -void TextureBrowser_addShadersRealiseCallback(const SignalHandler& handler); - -#endif +#endif // _TEXWINDOW_H_ diff --git a/radiant/timer.cpp b/radiant/timer.cpp deleted file mode 100644 index 617112e1..00000000 --- a/radiant/timer.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "timer.h" - - -#if defined(WIN32) - -#include - -MillisecondTime MillisecondTime::current() -{ - static class Cached - { - LONGLONG m_frequency; - LONGLONG m_base; - public: - Cached() - { - QueryPerformanceFrequency((LARGE_INTEGER *) &m_frequency); - QueryPerformanceCounter((LARGE_INTEGER *) &m_base); - } - LONGLONG frequency() - { - return m_frequency; - } - LONGLONG base() - { - return m_base; - } - } cached; - - if(cached.frequency() > 0) - { - LONGLONG count; - QueryPerformanceCounter((LARGE_INTEGER *) &count); - return time_from_ticks(count - cached.base(), cached.frequency()); - } - else - { -#if 1 - return MillisecondTime(); -#else - return time_from_ticks(timeGetTime(), 1000); -#endif - } -} - - - - -#elif defined(POSIX) - -#include -#include "sys/time.h" - -MillisecondTime MillisecondTime::current() -{ - static class Cached - { - time_t m_base; - public: - Cached() - { - time(&m_base); - } - time_t base() - { - return m_base; - } - } cached; - - timeval time; - gettimeofday(&time, 0); - return MillisecondTime((time.tv_sec - cached.base()) * 1000 + time.tv_usec / 1000); -} - - - -#else - -#include - -MillisecondTime MillisecondTime::current() -{ - return time_from_ticks(std::clock(), CLOCKS_PER_SEC); -} - - - -#endif diff --git a/radiant/timer.h b/radiant/timer.h deleted file mode 100644 index a8945200..00000000 --- a/radiant/timer.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined (INCLUDED_TIMER_H) -#define INCLUDED_TIMER_H - -#if 1 - -const int msec_per_sec = 1000; - -class MillisecondTime -{ - unsigned int m_milliseconds; -public: - MillisecondTime(unsigned int milliseconds) - : m_milliseconds(milliseconds) - { - } - MillisecondTime() - { - } - static MillisecondTime current(); - - unsigned int milliseconds_since(const MillisecondTime& other) const - { - return m_milliseconds - other.m_milliseconds; - } -}; - -template -inline MillisecondTime time_from_ticks(tick_type tick_count, tick_type ticks_per_sec) -{ - return MillisecondTime(static_cast(tick_count / static_cast(ticks_per_sec / msec_per_sec))); -} - -#else - -const unsigned int usec_per_sec = 1000000; - -class MillisecondTime -{ - unsigned int m_sec; - unsigned int m_usec; -public: - MillisecondTime(unsigned int sec, unsigned int usec) - : m_sec(sec), m_usec(usec) - { - } - MillisecondTime() - { - } - staticMillisecondTime current(); - - unsigned int milliseconds_since(const MillisecondTime& other) const - { - return static_cast((m_sec * static_cast(usec_per_sec) + m_usec) - - (other.m_sec * static_cast(usec_per_sec) + other.m_usec)) / 1000; - } -}; - -template -inline MillisecondTime time_from_ticks(tick_type tick_count, tick_type ticks_per_sec) -{ - return MillisecondTime(static_cast(tick_count / ticks_per_sec), - static_cast((tick_count % ticks_per_sec) * (usec_per_sec / static_cast(ticks_per_sec)))); -} - -#endif - -class Timer -{ - MillisecondTime m_start; - -public: - void start() - { - m_start = MillisecondTime::current(); - } - unsigned int elapsed_msec() - { - return MillisecondTime::current().milliseconds_since(m_start); - } -}; - -#endif diff --git a/radiant/treemodel.cpp b/radiant/treemodel.cpp deleted file mode 100644 index cd13ecff..00000000 --- a/radiant/treemodel.cpp +++ /dev/null @@ -1,1551 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "treemodel.h" - -#include "debugging/debugging.h" - -#include -#include -#include -#include - -#include "iscenegraph.h" -#include "nameable.h" - -#include "generic/callback.h" -#include "scenelib.h" -#include "string/string.h" -#include "generic/reference.h" - -inline Nameable* Node_getNameable(scene::Node& node) -{ - return NodeTypeCast::cast(node); -} - -#if 0 - -#include "gtkutil/gtktreestore.h" - -template -inline void gtk_tree_model_get_pointer(GtkTreeModel* model, GtkTreeIter* iter, gint column, value_type** pointer) -{ - GValue value = GValue_default(); - gtk_tree_model_get_value(model, iter, column, &value); - *pointer = (value_type*)g_value_get_pointer(&value); -} - - -typedef GtkTreeStore GraphTreeModel; - -GtkTreeStore* graph_tree_model_new(graph_type* graph) -{ - return gtk_tree_store_new(2, G_TYPE_POINTER, G_TYPE_POINTER); -} - -void graph_tree_model_delete(GraphTreeModel* model) -{ - g_object_unref(G_OBJECT(model)); -} - - -bool graph_tree_model_subtree_find_node(GraphTreeModel* model, GtkTreeIter* parent, const scene::Node& node, GtkTreeIter* iter) -{ - for(gboolean success = gtk_tree_model_iter_children(GTK_TREE_MODEL(model), iter, parent); - success != FALSE; - success = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), iter)) - { - scene::Node* current; - gtk_tree_model_get_pointer(GTK_TREE_MODEL(model), iter, 0, ¤t); - if(current == node) - { - return true; - } - } - return false; -} - -typedef GtkTreeIter DoubleGtkTreeIter[2]; - -bool graph_tree_model_find_top(GraphTreeModel* model, const scene::Path& path, GtkTreeIter& iter) -{ - int swap = 0; - GtkTreeIter* parent_pointer = NULL; - GtkTreeIter parent; - for(scene::Path::const_iterator i = path.begin(); i != path.end(); ++i) - { - if(!graph_tree_model_subtree_find_node(model, parent_pointer, *i, &iter)) - { - return false; - } - parent = iter; - parent_pointer = &parent; - } - return true; -} - -bool graph_tree_model_find_parent(GraphTreeModel* model, const scene::Path& path, GtkTreeIter& iter) -{ - int swap = 0; - GtkTreeIter* parent_pointer = NULL; - ASSERT_MESSAGE(path.size() > 1, "path too short"); - for(scene::Path::const_iterator i = path.begin(); i != path.end()-1; ++i) - { - GtkTreeIter child; - if(!graph_tree_model_subtree_find_node(model, parent_pointer, *i, &child)) - { - return false; - } - iter = child; - parent_pointer = &iter; - } - return true; -} - -void node_attach_name_changed_callback(scene::Node& node, const Callback& callback) -{ - if(node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->attach(callback); - } - } -} -void node_detach_name_changed_callback(scene::Node& node, const Callback& callback) -{ - if(node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->detach(callback); - } - } -} - -GraphTreeModel* scene_graph_get_tree_model(); // temp hack - -void graph_tree_model_row_changed(const scene::Instance& instance) -{ - GraphTreeModel* model = scene_graph_get_tree_model(); - - GtkTreeIter child; - ASSERT_MESSAGE(graph_tree_model_find_top(model, instance.path(), child), "RUNTIME ERROR"); - - gtk_tree_store_set(GTK_TREE_STORE(model), &child, 0, instance.path().top(), -1); -} - -void graph_tree_model_row_inserted(GraphTreeModel* model, const scene::Instance& instance) -{ - GtkTreeIter parent; - GtkTreeIter* parent_pointer = NULL; - if(instance.path().size() != 1) - { - ASSERT_MESSAGE(graph_tree_model_find_parent(model, instance.path(), parent), "RUNTIME ERROR"); - parent_pointer = &parent; - } - - gpointer node = instance.path().top(); - gconstpointer selectable = Instance_getSelectable(instance); - - GtkTreeIter child; - gtk_tree_store_append(GTK_TREE_STORE(model), &child, parent_pointer); - gtk_tree_store_set(GTK_TREE_STORE(model), &child, 0, node, 1, selectable, -1); - - node_attach_name_changed_callback(instance.path().top(), ConstReferenceCaller(instance)); -} - -void graph_tree_model_row_deleted(GraphTreeModel* model, const scene::Instance& instance) -{ - GtkTreeIter child; - ASSERT_MESSAGE(graph_tree_model_find_top(model, instance.path(), child), "RUNTIME ERROR"); - - node_detach_name_changed_callback(instance.path().top(), ConstReferenceCaller(instance)); - - gtk_tree_store_remove(GTK_TREE_STORE(model), &child); -} - -#elif 0 - -const char* node_get_name(scene::Node& node); - -typedef scene::Node* NodePointer; - -class NodeNameLess -{ -public: - bool operator()(const NodePointer& self, const NodePointer& other) const - { - if(self == 0) - { - return true; - } - if(other == 0) - { - return false; - } - int result = string_compare(node_get_name(self), node_get_name(other)); - if(result == 0) - { - return self < other; - } - return result < 0; - } -}; - -class PathNameLess -{ -public: - bool operator()(const PathConstReference& self, const PathConstReference& other) const - { - return std::lexicographical_compare(self.get().begin(), self.get().end(), other.get().begin(), other.get().end(), NodeNameLess()); - } -}; - -typedef std::map graph_type; - -struct GraphTreeModel -{ - GObject parent; - - graph_type* graph; -}; - -struct GraphTreeModelClass -{ - GObjectClass parent_class; -}; - -#define GRAPH_TREE_MODEL(p) (reinterpret_cast(p)) - -static GtkTreeModelFlags graph_tree_model_get_flags (GtkTreeModel* tree_model) -{ - return GTK_TREE_MODEL_ITERS_PERSIST; -} - -static gint graph_tree_model_get_n_columns (GtkTreeModel* tree_model) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeModel* graph_tree_model = (GraphTreeModel*) tree_model; - - return 2; -} - -static const gint c_stamp = 0xabcdef; - -inline graph_type::iterator graph_iterator_read_tree_iter(GtkTreeIter* iter) -{ - ASSERT_MESSAGE(iter != 0, "tree model error"); - ASSERT_MESSAGE(iter->user_data != 0, "tree model error"); - ASSERT_MESSAGE(iter->stamp == c_stamp, "tree model error"); - return *reinterpret_cast(&iter->user_data); -} - -inline void graph_iterator_write_tree_iter(graph_type::iterator i, GtkTreeIter* iter) -{ - ASSERT_MESSAGE(iter != 0, "tree model error"); - iter->stamp = c_stamp; - *reinterpret_cast(&iter->user_data) = i; - ASSERT_MESSAGE(iter->user_data != 0, "tree model error"); -} - -static GType graph_tree_model_get_column_type (GtkTreeModel *tree_model, gint index) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeModel *graph_tree_model = (GraphTreeModel *) tree_model; - - return G_TYPE_POINTER; -} - -static gboolean graph_tree_model_get_iter(GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - gint* indices = gtk_tree_path_get_indices (path); - gint depth = gtk_tree_path_get_depth (path); - - g_return_val_if_fail (depth > 0, FALSE); - - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - - if(graph.empty()) - return FALSE; - - GtkTreeIter tmp; - GtkTreeIter* parent = 0; - - for(gint i = 0; i < depth; i++) - { - if (! gtk_tree_model_iter_nth_child (tree_model, iter, parent, indices[i])) - return FALSE; - tmp = *iter; - parent = &tmp; - } - - return TRUE; -} - -static GtkTreePath* graph_tree_model_get_path(GtkTreeModel* tree_model, GtkTreeIter* iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = graph_iterator_read_tree_iter(iter); - - GtkTreePath* path = gtk_tree_path_new(); - - for(std::size_t depth = (*i).first.get().size(); depth != 0; --depth) - { - std::size_t index = 0; - - while(i != graph.begin() && (*i).first.get().size() >= depth) - { - --i; - if((*i).first.get().size() == depth) - ++index; - } - - gtk_tree_path_prepend_index(path, index); - } - - return path; -} - - -static void graph_tree_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - ASSERT_MESSAGE(column == 0 || column == 1, "tree model error"); - - graph_type::iterator i = graph_iterator_read_tree_iter(iter); - - g_value_init (value, G_TYPE_POINTER); - - if(column == 0) - g_value_set_pointer(value, reinterpret_cast((*i).first.get().top())); - else - g_value_set_pointer(value, reinterpret_cast(Instance_getSelectable(*(*i).second))); -} - -static gboolean graph_tree_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = graph_iterator_read_tree_iter(iter); - std::size_t depth = (*i).first.get().size(); - - ++i; - - while(i != graph.end() && (*i).first.get().size() > depth) - { - ++i; - } - - if(i == graph.end() || (*i).first.get().size() != depth) - { - return FALSE; - } - - graph_iterator_write_tree_iter(i, iter); - - return TRUE; -} - -static gboolean graph_tree_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = (parent == 0) ? graph.begin() : graph_iterator_read_tree_iter(parent); - std::size_t depth = (parent == 0) ? 1 : (*i).first.get().size() + 1; - - if(parent != 0) - ++i; - - if(i != graph.end() && (*i).first.get().size() == depth) - { - graph_iterator_write_tree_iter(i, iter); - return TRUE; - } - - return FALSE; -} - -static gboolean graph_tree_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = graph_iterator_read_tree_iter(iter); - std::size_t depth = (*i).first.get().size() + 1; - - return ++i != graph.end() && (*i).first.get().size() == depth; -} - -static gint graph_tree_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *parent) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = (parent == 0) ? graph.begin() : graph_iterator_read_tree_iter(parent); - std::size_t depth = (parent == 0) ? 1 : (*i).first.get().size() + 1; - - if(parent != 0) - ++i; - - gint count = 0; - while(i != graph.end() && (*i).first.get().size() >= depth) - { - ++count; - ++i; - } - - return count; -} - -static gboolean graph_tree_model_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = (parent == 0) ? graph.begin() : graph_iterator_read_tree_iter(parent); - std::size_t depth = (parent == 0) ? 1 : (*i).first.get().size() + 1; - - if(parent != 0) - ++i; - - while(i != graph.end() && (*i).first.get().size() >= depth) - { - if((*i).first.get().size() == depth && n-- == 0) - { - graph_iterator_write_tree_iter(i, iter); - return TRUE; - } - ++i; - } - - return FALSE; -} - -static gboolean graph_tree_model_iter_parent(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - graph_type& graph = *GRAPH_TREE_MODEL(tree_model)->graph; - graph_type::iterator i = graph_iterator_read_tree_iter(child); - std::size_t depth = (*i).first.get().size(); - if(depth == 1) - { - return FALSE; - } - else - { - do - { - --i; - } - while((*i).first.get().size() >= depth); - graph_iterator_write_tree_iter(i, iter); - return TRUE; - } -} - -static GObjectClass *g_parent_class = 0; - -static void graph_tree_model_init (GraphTreeModel *graph_tree_model) -{ - graph_tree_model->graph = 0; -} - -static void graph_tree_model_finalize(GObject* object) -{ - GraphTreeModel* graph_tree_model = GRAPH_TREE_MODEL(object); - - /* must chain up */ - (* g_parent_class->finalize) (object); -} - -static void graph_tree_model_class_init (GraphTreeModelClass *class_) -{ - GObjectClass *object_class; - - g_parent_class = (GObjectClass*)g_type_class_peek_parent (class_); - object_class = (GObjectClass *) class_; - - object_class->finalize = graph_tree_model_finalize; -} - -static void graph_tree_model_tree_model_init (GtkTreeModelIface *iface) -{ - iface->get_flags = graph_tree_model_get_flags; - iface->get_n_columns = graph_tree_model_get_n_columns; - iface->get_column_type = graph_tree_model_get_column_type; - iface->get_iter = graph_tree_model_get_iter; - iface->get_path = graph_tree_model_get_path; - iface->get_value = graph_tree_model_get_value; - iface->iter_next = graph_tree_model_iter_next; - iface->iter_children = graph_tree_model_iter_children; - iface->iter_has_child = graph_tree_model_iter_has_child; - iface->iter_n_children = graph_tree_model_iter_n_children; - iface->iter_nth_child = graph_tree_model_iter_nth_child; - iface->iter_parent = graph_tree_model_iter_parent; -} - -static gboolean graph_tree_model_row_draggable(GtkTreeDragSource *drag_source, GtkTreePath *path) -{ -#ifdef _DEBUG - gint depth = gtk_tree_path_get_depth(path); -#endif - return gtk_tree_path_get_depth(path) > 1; -} - -static gboolean graph_tree_model_drag_data_delete(GtkTreeDragSource *drag_source, GtkTreePath *path) -{ - GtkTreeIter iter; - - if(gtk_tree_model_get_iter(GTK_TREE_MODEL(drag_source), &iter, path)) - { - graph_type::iterator i = graph_iterator_read_tree_iter(&iter); - Path_deleteTop((*i).first); - return TRUE; - } - else - { - return FALSE; - } -} - -static gboolean graph_tree_model_drag_data_get (GtkTreeDragSource *drag_source, GtkTreePath *path, GtkSelectionData *selection_data) -{ - if(gtk_tree_set_row_drag_data(selection_data, GTK_TREE_MODEL(drag_source), path)) - { - return TRUE; - } - else - { - /* FIXME handle text targets at least. */ - } - - return FALSE; -} - -static void graph_tree_model_drag_source_init (GtkTreeDragSourceIface *iface) -{ - iface->row_draggable = graph_tree_model_row_draggable; - iface->drag_data_delete = graph_tree_model_drag_data_delete; - iface->drag_data_get = graph_tree_model_drag_data_get; -} - -static gboolean graph_tree_model_drag_data_received (GtkTreeDragDest *drag_dest, GtkTreePath *dest, GtkSelectionData *selection_data) -{ - GtkTreeModel *tree_model = GTK_TREE_MODEL (drag_dest); - - GtkTreeModel *src_model = 0; - GtkTreePath *src_path = 0; - if(gtk_tree_get_row_drag_data(selection_data, &src_model, &src_path) - && src_model == tree_model) - { - /* Copy the given row to a new position */ - GtkTreeIter iter; - - if(gtk_tree_model_get_iter(src_model, &iter, src_path)) - { - int bleh = 0; - } - } - else - { - /* FIXME maybe add some data targets eventually, or handle text - * targets in the simple case. - */ - } - - return FALSE; -} - -static gboolean graph_tree_model_row_drop_possible(GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection_data) -{ - gboolean retval = FALSE; - - GtkTreeModel *src_model = 0; - GtkTreePath *src_path = 0; - if(gtk_tree_get_row_drag_data(selection_data, &src_model, &src_path) != FALSE) - { - /* can only drag to ourselves */ - if(src_model == GTK_TREE_MODEL(drag_dest)) - { - /* Can't drop into ourself. */ - if(!gtk_tree_path_is_ancestor(src_path, dest_path)) - { - /* Can't drop if dest_path's parent doesn't exist */ - if (gtk_tree_path_get_depth (dest_path) > 1) - { - GtkTreePath* tmp = gtk_tree_path_copy (dest_path); - gtk_tree_path_up (tmp); - - GtkTreeIter iter; - retval = gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_dest), &iter, tmp); - - gtk_tree_path_free (tmp); - } - } - } - - gtk_tree_path_free (src_path); - } - - return retval; -} - -static void graph_tree_model_drag_dest_init (GtkTreeDragDestIface *iface) -{ - iface->drag_data_received = graph_tree_model_drag_data_received; - iface->row_drop_possible = graph_tree_model_row_drop_possible; -} - -GType graph_tree_model_get_type (void) -{ - static GType graph_tree_model_type = 0; - - if (!graph_tree_model_type) - { - static const GTypeInfo graph_tree_model_info = - { - sizeof (GraphTreeModelClass), - 0, /* base_init */ - 0, /* base_finalize */ - (GClassInitFunc) graph_tree_model_class_init, - 0, /* class_finalize */ - 0, /* class_data */ - sizeof (GraphTreeModel), - 0, /* n_preallocs */ - (GInstanceInitFunc) graph_tree_model_init - }; - - static const GInterfaceInfo tree_model_info = - { - (GInterfaceInitFunc) graph_tree_model_tree_model_init, - 0, - 0 - }; - - static const GInterfaceInfo drag_source_info = - { - (GInterfaceInitFunc) graph_tree_model_drag_source_init, - 0, - 0 - }; - - static const GInterfaceInfo drag_dest_info = - { - (GInterfaceInitFunc) graph_tree_model_drag_dest_init, - 0, - 0 - }; - - graph_tree_model_type = g_type_register_static (G_TYPE_OBJECT, "GraphTreeModel", - &graph_tree_model_info, (GTypeFlags)0); - - g_type_add_interface_static (graph_tree_model_type, - GTK_TYPE_TREE_MODEL, - &tree_model_info); - g_type_add_interface_static (graph_tree_model_type, - GTK_TYPE_TREE_DRAG_SOURCE, - &drag_source_info); - g_type_add_interface_static (graph_tree_model_type, - GTK_TYPE_TREE_DRAG_DEST, - &drag_dest_info); - } - - return graph_tree_model_type; -} - -GraphTreeModel* graph_tree_model_new() -{ - GraphTreeModel* graph_tree_model = GRAPH_TREE_MODEL(g_object_new (graph_tree_model_get_type(), 0)); - - graph_tree_model->graph = new graph_type; - - return graph_tree_model; -} - -void graph_tree_model_delete(GraphTreeModel* model) -{ - delete model->graph; - g_object_unref(G_OBJECT(model)); -} - - -class TempNameable : public Nameable -{ - const char* m_name; -public: - TempNameable(const char* name) : m_name(name) - { - } - const char* name() const - { - return m_name; - } - void attach(const NameCallback& callback) - { - } - void detach(const NameCallback& callback) - { - } -}; - -void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback) -{ - if(&node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->attach(callback); - } - } -} -void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback) -{ - if(&node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->detach(callback); - } - } -} - -GraphTreeModel* scene_graph_get_tree_model(); // temp hack - -void graph_tree_model_row_inserted(GraphTreeModel* model, graph_type::iterator i) -{ - GtkTreeIter iter; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* tree_path = graph_tree_model_get_path(GTK_TREE_MODEL(model), &iter); - - gint depth = gtk_tree_path_get_depth(tree_path); - gint* indices = gtk_tree_path_get_indices(tree_path); - - gtk_tree_model_row_inserted(GTK_TREE_MODEL(model), tree_path, &iter); - - gtk_tree_path_free(tree_path); -} - -void graph_tree_model_row_deleted(GraphTreeModel* model, graph_type::iterator i) -{ - GtkTreeIter iter; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* tree_path = graph_tree_model_get_path(GTK_TREE_MODEL(model), &iter); - - gtk_tree_model_row_deleted(GTK_TREE_MODEL(model), tree_path); - - gtk_tree_path_free(tree_path); -} - -#include "generic/referencecounted.h" - -void graph_tree_model_set_name(const scene::Instance& instance, const char* name) -{ - GraphTreeModel* model = scene_graph_get_tree_model(); - - if(string_empty(name)) // hack! - { - graph_type::iterator i = model->graph->find(PathConstReference(instance.path())); - ASSERT_MESSAGE(i != model->graph->end(), "ERROR"); - - graph_tree_model_row_deleted(model, i); - - model->graph->erase(i); - } - else - { - graph_type::iterator i = model->graph->insert(graph_type::value_type(PathConstReference(instance.path()), &const_cast(instance))).first; - - graph_tree_model_row_inserted(model, i); - } -} - -void graph_tree_model_insert(GraphTreeModel* model, const scene::Instance& instance) -{ - graph_type::iterator i = model->graph->insert(graph_type::value_type(PathConstReference(instance.path()), &const_cast(instance))).first; - - graph_tree_model_row_inserted(model, i); - - node_attach_name_changed_callback(instance.path().top(), ConstReferenceCaller1(instance)); -} - -void graph_tree_model_erase(GraphTreeModel* model, const scene::Instance& instance) -{ - node_detach_name_changed_callback(instance.path().top(), ConstReferenceCaller1(instance)); - - graph_type::iterator i = model->graph->find(PathConstReference(instance.path())); - ASSERT_MESSAGE(i != model->graph->end(), "ERROR"); - - graph_tree_model_row_deleted(model, i); - - model->graph->erase(i); -} - -#elif 1 - -class GraphTreeNode; -void graph_tree_model_row_changed(GraphTreeNode& node); - -class GraphTreeNode -{ - typedef std::map, GraphTreeNode*> ChildNodes; - ChildNodes m_childnodes; -public: - Reference m_instance; - GraphTreeNode* m_parent; - - typedef ChildNodes::iterator iterator; - typedef ChildNodes::key_type key_type; - typedef ChildNodes::value_type value_type; - typedef ChildNodes::size_type size_type; - - GraphTreeNode(scene::Instance& instance) : m_instance(instance), m_parent(0) - { - m_instance.get().setChildSelectedChangedCallback(RowChangedCaller(*this)); - } - ~GraphTreeNode() - { - m_instance.get().setChildSelectedChangedCallback(Callback()); - ASSERT_MESSAGE(empty(), "GraphTreeNode::~GraphTreeNode: memory leak"); - } - - iterator begin() - { - return m_childnodes.begin(); - } - iterator end() - { - return m_childnodes.end(); - } - - size_type size() const - { - return m_childnodes.size(); - } - bool empty() const - { - return m_childnodes.empty(); - } - - iterator insert(const value_type& value) - { - iterator i = m_childnodes.insert(value).first; - (*i).second->m_parent = this; - return i; - } - void erase(iterator i) - { - m_childnodes.erase(i); - } - iterator find(const key_type& key) - { - return m_childnodes.find(key); - } - - void swap(GraphTreeNode& other) - { - std::swap(m_parent, other.m_parent); - std::swap(m_childnodes, other.m_childnodes); - std::swap(m_instance, other.m_instance); - } - - void rowChanged() - { - graph_tree_model_row_changed(*this); - } - typedef MemberCaller RowChangedCaller; -}; - -struct GraphTreeModel -{ - GObject parent; - - GraphTreeNode* m_graph; -}; - -struct GraphTreeModelClass -{ - GObjectClass parent_class; -}; - -#define GRAPH_TREE_MODEL(p) (reinterpret_cast(p)) - -static GtkTreeModelFlags graph_tree_model_get_flags (GtkTreeModel* tree_model) -{ - return GTK_TREE_MODEL_ITERS_PERSIST; -} - -static gint graph_tree_model_get_n_columns (GtkTreeModel* tree_model) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - //GraphTreeModel* graph_tree_model = (GraphTreeModel*) tree_model; - - return 2; -} - -static const gint c_stamp = 0xabcdef; - -inline GraphTreeNode::iterator graph_iterator_read_tree_iter(GtkTreeIter* iter) -{ - ASSERT_MESSAGE(iter != 0, "tree model error"); - ASSERT_MESSAGE(iter->user_data != 0, "tree model error"); - ASSERT_MESSAGE(iter->stamp == c_stamp, "tree model error"); - return *reinterpret_cast(&iter->user_data); -} - -inline void graph_iterator_write_tree_iter(GraphTreeNode::iterator i, GtkTreeIter* iter) -{ - ASSERT_MESSAGE(iter != 0, "tree model error"); - iter->stamp = c_stamp; - *reinterpret_cast(&iter->user_data) = i; - ASSERT_MESSAGE(iter->user_data != 0, "tree model error"); -} - -static GType graph_tree_model_get_column_type (GtkTreeModel *tree_model, gint index) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - //GraphTreeModel *graph_tree_model = (GraphTreeModel *) tree_model; - - return G_TYPE_POINTER; -} - -static gboolean graph_tree_model_get_iter(GtkTreeModel* tree_model, GtkTreeIter* iter, GtkTreePath* path) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - gint* indices = gtk_tree_path_get_indices (path); - gint depth = gtk_tree_path_get_depth (path); - - g_return_val_if_fail (depth > 0, FALSE); - - GraphTreeNode* graph = GRAPH_TREE_MODEL(tree_model)->m_graph; - - if(graph->empty()) - return FALSE; - - GtkTreeIter tmp; - GtkTreeIter* parent = 0; - - for(gint i = 0; i < depth; i++) - { - if (! gtk_tree_model_iter_nth_child (tree_model, iter, parent, indices[i])) - return FALSE; - tmp = *iter; - parent = &tmp; - } - - return TRUE; -} - -static GtkTreePath* graph_tree_model_get_path(GtkTreeModel* tree_model, GtkTreeIter* iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode* graph = GRAPH_TREE_MODEL(tree_model)->m_graph; - - GtkTreePath* path = gtk_tree_path_new(); - - for(GraphTreeNode* node = (*graph_iterator_read_tree_iter(iter)).second; node != graph; node = node->m_parent) - { - std::size_t index = 0; - for(GraphTreeNode::iterator i = node->m_parent->begin(); i != node->m_parent->end(); ++i, ++index) - { - if((*i).second == node) - { - gtk_tree_path_prepend_index(path, gint(index)); - break; - } - } - ASSERT_MESSAGE(index != node->m_parent->size(), "error resolving tree path"); - } - - return path; -} - - -static void graph_tree_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - ASSERT_MESSAGE(column == 0 || column == 1, "tree model error"); - - GraphTreeNode::iterator i = graph_iterator_read_tree_iter(iter); - - g_value_init (value, G_TYPE_POINTER); - - if(column == 0) - { - g_value_set_pointer(value, reinterpret_cast((*i).first.second)); - } - else - { - g_value_set_pointer(value, reinterpret_cast(&(*i).second->m_instance.get())); - } -} - -static gboolean graph_tree_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode::iterator i = graph_iterator_read_tree_iter(iter); - GraphTreeNode& parent = *(*i).second->m_parent; - - ASSERT_MESSAGE(i != parent.end(), "RUNTIME ERROR"); - - if(++i == parent.end()) - { - return FALSE; - } - - graph_iterator_write_tree_iter(i, iter); - - return TRUE; -} - -static gboolean graph_tree_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode& node = (parent == 0) ? *GRAPH_TREE_MODEL(tree_model)->m_graph : *(*graph_iterator_read_tree_iter(parent)).second; - if(!node.empty()) - { - graph_iterator_write_tree_iter(node.begin(), iter); - return TRUE; - } - - return FALSE; -} - -static gboolean graph_tree_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode& node = *(*graph_iterator_read_tree_iter(iter)).second; - return !node.empty(); -} - -static gint graph_tree_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *parent) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode& node = (parent == 0) ? *GRAPH_TREE_MODEL(tree_model)->m_graph : *(*graph_iterator_read_tree_iter(parent)).second; - return static_cast(node.size()); -} - -static gboolean graph_tree_model_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode& node = (parent == 0) ? *GRAPH_TREE_MODEL(tree_model)->m_graph : *(*graph_iterator_read_tree_iter(parent)).second; - if(static_cast(n) < node.size()) - { - GraphTreeNode::iterator i = node.begin(); - std::advance(i, n); - graph_iterator_write_tree_iter(i, iter); - return TRUE; - } - - return FALSE; -} - -static gboolean graph_tree_model_iter_parent(GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child) -{ - ASSERT_MESSAGE(tree_model != 0, "RUNTIME ERROR"); - GraphTreeNode& node = *(*graph_iterator_read_tree_iter(child)).second; - if(node.m_parent != GRAPH_TREE_MODEL(tree_model)->m_graph) - { - GraphTreeNode& parentParent = *node.m_parent->m_parent; - for(GraphTreeNode::iterator i = parentParent.begin(); i != parentParent.end(); ++i) - { - if((*i).second == node.m_parent) - { - graph_iterator_write_tree_iter(i, iter); - return TRUE; - } - } - } - return FALSE; -} - -static GObjectClass *g_parent_class = 0; - -namespace -{ - scene::Node* g_null_node = 0; -} - -class NullInstance : public scene::Instance -{ -public: - NullInstance() : scene::Instance(scene::Path(makeReference(*g_null_node)), 0, 0, Static::instance()) - { - } -}; - -namespace -{ - NullInstance g_null_instance; -} - -static void graph_tree_model_init (GraphTreeModel *graph_tree_model) -{ - graph_tree_model->m_graph = new GraphTreeNode(g_null_instance); -} - -static void graph_tree_model_finalize(GObject* object) -{ - GraphTreeModel* graph_tree_model = GRAPH_TREE_MODEL(object); - - delete graph_tree_model->m_graph; - - /* must chain up */ - (* g_parent_class->finalize) (object); -} - -static void graph_tree_model_class_init (GraphTreeModelClass *class_) -{ - GObjectClass *object_class; - - g_parent_class = (GObjectClass*)g_type_class_peek_parent (class_); - object_class = (GObjectClass *) class_; - - object_class->finalize = graph_tree_model_finalize; -} - -static void graph_tree_model_tree_model_init (GtkTreeModelIface *iface) -{ - iface->get_flags = graph_tree_model_get_flags; - iface->get_n_columns = graph_tree_model_get_n_columns; - iface->get_column_type = graph_tree_model_get_column_type; - iface->get_iter = graph_tree_model_get_iter; - iface->get_path = graph_tree_model_get_path; - iface->get_value = graph_tree_model_get_value; - iface->iter_next = graph_tree_model_iter_next; - iface->iter_children = graph_tree_model_iter_children; - iface->iter_has_child = graph_tree_model_iter_has_child; - iface->iter_n_children = graph_tree_model_iter_n_children; - iface->iter_nth_child = graph_tree_model_iter_nth_child; - iface->iter_parent = graph_tree_model_iter_parent; -} - -GType graph_tree_model_get_type (void) -{ - static GType graph_tree_model_type = 0; - - if (!graph_tree_model_type) - { - static const GTypeInfo graph_tree_model_info = - { - sizeof (GraphTreeModelClass), - 0, /* base_init */ - 0, /* base_finalize */ - (GClassInitFunc) graph_tree_model_class_init, - 0, /* class_finalize */ - 0, /* class_data */ - sizeof (GraphTreeModel), - 0, /* n_preallocs */ - (GInstanceInitFunc) graph_tree_model_init, - 0 - }; - - static const GInterfaceInfo tree_model_info = - { - (GInterfaceInitFunc) graph_tree_model_tree_model_init, - 0, - 0 - }; - - graph_tree_model_type = g_type_register_static (G_TYPE_OBJECT, "GraphTreeModel", - &graph_tree_model_info, (GTypeFlags)0); - - g_type_add_interface_static (graph_tree_model_type, - GTK_TYPE_TREE_MODEL, - &tree_model_info); - } - - return graph_tree_model_type; -} - -GraphTreeModel* graph_tree_model_new() -{ - GraphTreeModel* graph_tree_model = GRAPH_TREE_MODEL(g_object_new (graph_tree_model_get_type(), 0)); - - return graph_tree_model; -} - -void graph_tree_model_delete(GraphTreeModel* model) -{ - g_object_unref(G_OBJECT(model)); -} - -void graph_tree_model_row_changed(GraphTreeModel* model, GraphTreeNode::iterator i) -{ - GtkTreeIter iter; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* tree_path = graph_tree_model_get_path(GTK_TREE_MODEL(model), &iter); - - gtk_tree_model_row_changed(GTK_TREE_MODEL(model), tree_path, &iter); - - gtk_tree_path_free(tree_path); -} - -void graph_tree_model_row_inserted(GraphTreeModel* model, GraphTreeNode::iterator i) -{ - GtkTreeIter iter; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* tree_path = graph_tree_model_get_path(GTK_TREE_MODEL(model), &iter); - - gtk_tree_model_row_inserted(GTK_TREE_MODEL(model), tree_path, &iter); - - gtk_tree_path_free(tree_path); -} - -void graph_tree_model_row_deleted(GraphTreeModel* model, GraphTreeNode::iterator i) -{ - GtkTreeIter iter; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* tree_path = graph_tree_model_get_path(GTK_TREE_MODEL(model), &iter); - - gtk_tree_model_row_deleted(GTK_TREE_MODEL(model), tree_path); - - gtk_tree_path_free(tree_path); -} - -void graph_tree_model_row_inserted(GraphTreeModel& model, GraphTreeNode::iterator i) -{ - graph_tree_model_row_inserted(&model, i); -} - -void graph_tree_model_row_deleted(GraphTreeModel& model, GraphTreeNode::iterator i) -{ - graph_tree_model_row_deleted(&model, i); -} - -const char* node_get_name(scene::Node& node); - -const char* node_get_name_safe(scene::Node& node) -{ - if(&node == 0) - { - return ""; - } - return node_get_name(node); -} - -GraphTreeNode* graph_tree_model_find_parent(GraphTreeModel* model, const scene::Path& path) -{ - GraphTreeNode* parent = model->m_graph; - for(scene::Path::const_iterator i = path.begin(); i != path.end()-1; ++i) - { - GraphTreeNode::iterator child = parent->find(GraphTreeNode::key_type(node_get_name_safe((*i).get()), (*i).get_pointer())); - ASSERT_MESSAGE(child != parent->end(), "ERROR"); - parent = (*child).second; - } - return parent; -} - -void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback) -{ - if(&node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->attach(callback); - } - } -} -void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback) -{ - if(&node != 0) - { - Nameable* nameable = Node_getNameable(node); - if(nameable != 0) - { - nameable->detach(callback); - } - } -} - -GraphTreeModel* scene_graph_get_tree_model(); // temp hack - -void graph_tree_node_foreach_pre(GraphTreeNode::iterator root, const Callback1& callback) -{ - callback(root); - for(GraphTreeNode::iterator i = (*root).second->begin(); i != (*root).second->end(); ++i) - { - graph_tree_node_foreach_pre(i, callback); - } -} - -void graph_tree_node_foreach_post(GraphTreeNode::iterator root, const Callback1& callback) -{ - for(GraphTreeNode::iterator i = (*root).second->begin(); i != (*root).second->end(); ++i) - { - graph_tree_node_foreach_post(i, callback); - } - callback(root); -} - -void graph_tree_model_row_changed(GraphTreeNode& node) -{ - GraphTreeModel* model = scene_graph_get_tree_model(); - const scene::Instance& instance = node.m_instance.get(); - - GraphTreeNode::iterator i = node.m_parent->find(GraphTreeNode::key_type(node_get_name_safe(instance.path().top().get()), instance.path().top().get_pointer())); - - graph_tree_model_row_changed(model, i); -} - -void graph_tree_model_set_name(const scene::Instance& instance, const char* name) -{ - GraphTreeModel* model = scene_graph_get_tree_model(); - GraphTreeNode* parent = graph_tree_model_find_parent(model, instance.path()); - - GraphTreeNode::iterator oldNode = parent->find(GraphTreeNode::key_type(node_get_name_safe(instance.path().top().get()), instance.path().top().get_pointer())); - graph_tree_node_foreach_post(oldNode, ReferenceCaller1(*model)); - GraphTreeNode* node((*oldNode).second); - parent->erase(oldNode); - - GraphTreeNode::iterator newNode = parent->insert(GraphTreeNode::value_type(GraphTreeNode::key_type(name, &instance.path().top().get()), node)); - graph_tree_node_foreach_pre(newNode, ReferenceCaller1(*model)); -} - -void graph_tree_model_insert(GraphTreeModel* model, const scene::Instance& instance) -{ - GraphTreeNode* parent = graph_tree_model_find_parent(model, instance.path()); - - GraphTreeNode::iterator i = parent->insert(GraphTreeNode::value_type(GraphTreeNode::key_type(node_get_name_safe(instance.path().top().get()), instance.path().top().get_pointer()), new GraphTreeNode(const_cast(instance)))); - - graph_tree_model_row_inserted(model, i); - - node_attach_name_changed_callback(instance.path().top(), ConstReferenceCaller1(instance)); -} - -void graph_tree_model_erase(GraphTreeModel* model, const scene::Instance& instance) -{ - node_detach_name_changed_callback(instance.path().top(), ConstReferenceCaller1(instance)); - - GraphTreeNode* parent = graph_tree_model_find_parent(model, instance.path()); - - GraphTreeNode::iterator i = parent->find(GraphTreeNode::key_type(node_get_name_safe(instance.path().top().get()), instance.path().top().get_pointer())); - - graph_tree_model_row_deleted(model, i); - - GraphTreeNode* node((*i).second); - parent->erase(i); - delete node; -} - - - -#endif - - - - -#if 0 -class TestGraphTreeModel -{ -public: - TestGraphTreeModel() - { - gtk_init(0, 0); - - graph_type graph; - - scene::Node* root = *(scene::Node*)0xa0000000; - scene::Node* node1 = (scene::Node*)0xa0000001; - scene::Node* node2 = (scene::Node*)0xa0000002; - scene::Node* node3 = (scene::Node*)0xa0000003; - scene::Node* node4 = (scene::Node*)0xa0000004; - scene::Instance* instance = (scene::Instance*)0xaaaaaaaa; - - scene::Path rootpath(root); - - graph.insert(graph_type::value_type(rootpath, instance)); - - rootpath.push(node1); - graph.insert(graph_type::value_type(rootpath, instance)); - rootpath.pop(); - - rootpath.push(node2); - graph.insert(graph_type::value_type(rootpath, instance)); - rootpath.push(node3); - graph.insert(graph_type::value_type(rootpath, instance)); - rootpath.pop(); - rootpath.push(node4); - graph.insert(graph_type::value_type(rootpath, instance)); - rootpath.pop(); - rootpath.pop(); - - GtkTreeModel* model = GTK_TREE_MODEL(graph_tree_model_new(&graph)); - - { - gint n_columns = gtk_tree_model_get_n_columns(model); - ASSERT_MESSAGE(n_columns == 2, "test failed!"); - } - - { - GType type = gtk_tree_model_get_column_type(model, 0); - ASSERT_MESSAGE(type == G_TYPE_POINTER, "test failed!"); - } - - { - GType type = gtk_tree_model_get_column_type(model, 1); - ASSERT_MESSAGE(type == G_TYPE_POINTER, "test failed!"); - } - - - { - GtkTreeIter iter; - gtk_tree_model_get_iter_first(model, &iter); - - graph_type::iterator i = graph_iterator_read_tree_iter(&iter); - ASSERT_MESSAGE((*i).first.get().size() == 2 && (*i).first.get().top() == node1, "test failed!"); - } - - { - GtkTreeIter iter; - gtk_tree_model_get_iter_first(model, &iter); - - ASSERT_MESSAGE(gtk_tree_model_iter_has_child(model, &iter) == FALSE, "test failed!"); - - ASSERT_MESSAGE(gtk_tree_model_iter_n_children(model, &iter) == 0, "test failed!"); - - gtk_tree_model_iter_next(model, &iter); - - ASSERT_MESSAGE(gtk_tree_model_iter_has_child(model, &iter) != FALSE, "test failed!"); - - ASSERT_MESSAGE(gtk_tree_model_iter_n_children(model, &iter) == 2, "test failed!"); - - { - GtkTreeIter child; - gtk_tree_model_iter_nth_child(model, &child, &iter, 0); - - scene::Node* test; - gtk_tree_model_get_value(model, &child, 0, (GValue*)&test); - ASSERT_MESSAGE(test == node3, "test failed!"); - - { - GtkTreeIter parent; - gtk_tree_model_iter_parent(model, &parent, &child); - - scene::Node* test; - gtk_tree_model_get_value(model, &parent, 0, (GValue*)&test); - ASSERT_MESSAGE(test == node2, "test failed!"); - } - } - - { - GtkTreeIter child; - gtk_tree_model_iter_nth_child(model, &child, &iter, 1); - - scene::Node* test; - gtk_tree_model_get_value(model, &child, 0, (GValue*)&test); - ASSERT_MESSAGE(test == node4, "test failed!"); - } - } - - { - GtkTreeIter iter; - std::size_t count = 0; - for(gboolean good = gtk_tree_model_get_iter_first(model, &iter); good; good = gtk_tree_model_iter_next(model, &iter)) - { - scene::Node* test; - gtk_tree_model_get_value(model, &iter, 0, (GValue*)&test); - - ASSERT_MESSAGE((count == 0 && test == node1) || (count == 1 && test == node2), "test failed!"); - ++count; - } - - ASSERT_MESSAGE(count == 2, "test failed!"); - - } - - { - GtkTreeIter iter; - gtk_tree_model_get_iter_first(model, &iter); - - scene::Node* test; - gtk_tree_model_get_value(model, &iter, 0, (GValue*)&test); - ASSERT_MESSAGE(test == node1, "test failed!"); - } - - { - GtkTreeIter iter; - GtkTreePath* path = gtk_tree_path_new_from_string("0"); - gtk_tree_model_get_iter(model, &iter, path); - gtk_tree_path_free(path); - - graph_type::iterator i = graph_iterator_read_tree_iter(&iter); - ASSERT_MESSAGE((*i).first.get().size() == 2 && (*i).first.get().top() == node1, "test failed!"); - } - - { - GtkTreeIter iter; - GtkTreePath* path = gtk_tree_path_new_from_string("1"); - gtk_tree_model_get_iter(model, &iter, path); - gtk_tree_path_free(path); - - graph_type::iterator i = graph_iterator_read_tree_iter(&iter); - ASSERT_MESSAGE((*i).first.get().size() == 2 && (*i).first.get().top() == node2, "test failed!"); - } - - { - GtkTreeIter iter; - graph_type::iterator i = graph.begin(); - ++i; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - - gint depth = gtk_tree_path_get_depth(path); - gint* indices = gtk_tree_path_get_indices(path); - - ASSERT_MESSAGE(depth == 1 && indices[0] == 0, "test failed!"); - - gtk_tree_path_free(path); - } - - { - GtkTreeIter iter; - graph_type::iterator i = graph.begin(); - ++i; - ++i; - graph_iterator_write_tree_iter(i, &iter); - - GtkTreePath* path = gtk_tree_model_get_path(model, &iter); - - gint depth = gtk_tree_path_get_depth(path); - gint* indices = gtk_tree_path_get_indices(path); - - ASSERT_MESSAGE(depth == 1 && indices[0] == 1, "test failed!"); - - gtk_tree_path_free(path); - } - } -}; - - -TestGraphTreeModel g_TestGraphTreeModel; - -#endif diff --git a/radiant/treemodel.h b/radiant/treemodel.h deleted file mode 100644 index 7c33485b..00000000 --- a/radiant/treemodel.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_TREEMODEL_H) -#define INCLUDED_TREEMODEL_H - -struct GraphTreeModel; - -GraphTreeModel* graph_tree_model_new(); -void graph_tree_model_delete(GraphTreeModel* model); - -namespace scene -{ - class Instance; -} -void graph_tree_model_insert(GraphTreeModel* model, const scene::Instance& instance); -void graph_tree_model_erase(GraphTreeModel* model, const scene::Instance& instance); - -#endif diff --git a/radiant/ui.cpp b/radiant/ui.cpp new file mode 100644 index 00000000..83966dd9 --- /dev/null +++ b/radiant/ui.cpp @@ -0,0 +1,268 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// implementation of IMessaging specific interface +// + +#include "stdafx.h" + +CPtrArray l_Listeners[RADIANT_MSGCOUNT]; +CPtrArray l_WindowListeners; +CXYWndWrapper l_XYWndWrapper; + +// CGtkWindow implementation ------------------------------------- + +static void button_press (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + IWindowListener *pListen = static_cast(data); + switch (event->button) + { + case 1: + pListen->OnLButtonDown(event->state, event->x, event->y); break; + case 3: + pListen->OnRButtonDown(event->state, event->x, event->y); break; + } +} + +static void button_release (GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + IWindowListener *pListen = static_cast(data); + switch (event->button) + { + case 1: + pListen->OnLButtonUp(event->state, event->x, event->y); break; + case 3: + pListen->OnRButtonUp(event->state, event->x, event->y); break; + } +} + +static void motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) +{ + IWindowListener *pListen = static_cast(data); + pListen->OnMouseMove(event->state, event->x, event->y); +} + +static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) +{ + if (event->count > 0) + return TRUE; + + CGtkWindow *pWindow = static_cast(data); + pWindow->DoExpose(); + + return TRUE; +} + +// we use the string versions of the keys for now.. +static gint keypress (GtkWidget* widget, GdkEventKey* event, gpointer data) +{ + gint ret; + + IWindowListener *pListen = static_cast(data); + ret = pListen->OnKeyPressed(gdk_keyval_name(event->keyval)); + if (ret) + { + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + } + return ret; +} + +// close_widget is not hooked on the listener but on the CGtkWindow object to handle the closure +static gint close_widget (GtkWidget *widget, GdkEvent* event, gpointer data) +{ + CGtkWindow *pWindow = static_cast(data); + pWindow->Close(); + + return TRUE; +} + +void CGtkWindow::DoExpose() +{ + gtk_glwidget_make_current(m_pGLWidget); + if (m_pListen->Paint()) + gtk_glwidget_swap_buffers(m_pGLWidget); +} + +void CGtkWindow::Redraw() +{ + gtk_widget_queue_draw(m_pGLWidget); +} + +void CGtkWindow::Close() +{ + // similar to a destructor, except we warn first + m_pListen->Close(); + m_pListen->DecRef(); m_pListen = NULL; + gtk_widget_destroy(m_pWnd); m_pWnd = NULL; +} + +bool CGtkWindow::Show() +{ + // check we got everything and are reading to instanciate + if (m_nWidthParam == 0 || m_nHeightParam == 0) + { + Sys_FPrintf(SYS_ERR, "Height and Width params not set in CGtkWindow::Show\n"); + return false; + } + if (!m_pListen) + { + Sys_FPrintf(SYS_ERR, "No listener set in CGtkWindow::Show\n"); + return false; + } + + // seems all good, here we go + m_pWnd = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (m_pWnd), m_Name.GetBuffer()); + gtk_window_set_default_size (GTK_WINDOW (m_pWnd), m_nWidthParam, m_nHeightParam); + gtk_widget_show (m_pWnd); + + // GL widget creation + m_pGLWidget = gtk_glwidget_new(FALSE, g_qeglobals_gui.d_glBase); + + gtk_widget_set_events (m_pGLWidget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK); + + // Connect signal handlers + gtk_signal_connect (GTK_OBJECT (m_pGLWidget), "expose_event", GTK_SIGNAL_FUNC (expose), this); + gtk_signal_connect (GTK_OBJECT (m_pGLWidget), "motion_notify_event", + GTK_SIGNAL_FUNC (motion), m_pListen); + gtk_signal_connect (GTK_OBJECT (m_pGLWidget), "button_press_event", + GTK_SIGNAL_FUNC (button_press), m_pListen); + gtk_signal_connect (GTK_OBJECT (m_pGLWidget), "button_release_event", + GTK_SIGNAL_FUNC (button_release), m_pListen); + + gtk_signal_connect (GTK_OBJECT (m_pWnd), "delete_event", GTK_SIGNAL_FUNC (close_widget), this); + gtk_signal_connect (GTK_OBJECT (m_pWnd), "key_press_event", + GTK_SIGNAL_FUNC (keypress), m_pListen); + + gtk_widget_show (m_pGLWidget); + gtk_container_add (GTK_CONTAINER (m_pWnd), m_pGLWidget); + + return true; +} + +IWindow* WINAPI QERApp_CreateGLWindow() +{ + return new CGtkWindow; +} + +void WINAPI QERApp_HookWindow(IWindowListener* pListen) +{ + l_WindowListeners.Add( pListen ); + pListen->IncRef(); +} + +void WINAPI QERApp_UnHookWindow(IWindowListener* pListen) +{ + for ( int i = 0; i < l_WindowListeners.GetSize(); i++ ) + { + if (l_WindowListeners.GetAt(i) == pListen) + { + l_WindowListeners.RemoveAt(i); + pListen->DecRef(); + return; + } + } +#ifdef _DEBUG + Sys_Printf("WARNING: IWindowListener not found in QERApp_UnHookWindow\n"); +#endif +} + +void DispatchOnMouseMove(guint32 nFlags, int x, int y) +{ + for( int i = 0; i < l_WindowListeners.GetSize(); i++ ) + static_cast(l_WindowListeners.GetAt(i))->OnMouseMove( nFlags, x, y ); +} + +bool DispatchOnLButtonDown(guint32 nFlags, int x, int y) +{ + for( int i = 0; i < l_WindowListeners.GetSize(); i++ ) + if (static_cast(l_WindowListeners.GetAt(i))->OnLButtonDown( nFlags, x, y )) + return true; + return false; +} + +bool DispatchOnLButtonUp(guint32 nFlags, int x, int y) +{ + for( int i = 0; i < l_WindowListeners.GetSize(); i++ ) + if (static_cast(l_WindowListeners.GetAt(i))->OnLButtonUp( nFlags, x, y )) + return true; + return false; +} + +void WINAPI QERApp_HookListener(IListener* pListen, int Msg) +{ +#ifdef _DEBUG + if (Msg >= RADIANT_MSGCOUNT) + { + Sys_Printf("ERROR: bad index in QERApp_HookListener\n"); + return; + } +#endif + l_Listeners[Msg].Add( pListen ); + pListen->IncRef(); +} + +int WINAPI QERApp_UnHookListener(IListener* pListen) +{ + int count = 0; + for( int i = 0; iDecRef(); + count++; + } + return count; +} + +void DispatchRadiantMsg( int Msg ) +{ +#ifdef _DEBUG + if (Msg >= RADIANT_MSGCOUNT) + { + Sys_Printf("ERROR: bad index in DispatchRadiantMsg\n"); + return; + } +#endif + for(int i = 0; i(l_Listeners[Msg].GetAt(i))->DispatchRadiantMsg(Msg); +} + +void CXYWndWrapper::SnapToGrid( int x1, int y1, vec3_t pt ) +{ + int height = g_pParentWnd->ActiveXY()->GetWidget()->allocation.height; + g_pParentWnd->ActiveXY()->SnapToPoint( x1, height - 1 - y1, pt ); +} + +VIEWTYPE CXYWndWrapper::GetViewType( void ) +{ + return (VIEWTYPE)g_pParentWnd->ActiveXY()->GetViewType(); +} + +IXYWndWrapper* WINAPI QERApp_GetXYWndWrapper() +{ + return &l_XYWndWrapper; +} diff --git a/radiant/ui.h b/radiant/ui.h new file mode 100644 index 00000000..192c29d3 --- /dev/null +++ b/radiant/ui.h @@ -0,0 +1,85 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// headers for internal classes used in Messaging.cpp +// + +#ifndef __MESSAGING_H_ +#define __MESSAGING_H_ + +class CXYWndWrapper : public IXYWndWrapper +{ +public: + virtual ~CXYWndWrapper() {} + void SnapToGrid( int x1, int y1, vec3_t pt ); + VIEWTYPE GetViewType( void ); +}; + +// implementation of the IWindow API +class CGtkWindow : public IWindow +{ + int refCount; + GtkWidget *m_pWnd; + GtkWidget *m_pGLWidget; + int m_nWidthParam,m_nHeightParam; + IWindowListener *m_pListen; + Str m_Name; +public: + CGtkWindow() { refCount = 0; m_pWnd = NULL; m_pGLWidget = NULL; m_nWidthParam = 0; m_nHeightParam = 0; m_pListen = 0; m_Name = "CGtkWindow"; } + virtual ~CGtkWindow() + { + if (m_pListen) { m_pListen->DecRef(); m_pListen = NULL; } + if (m_pWnd) { gtk_widget_destroy(m_pWnd); m_pWnd = NULL; } + } + // refcounting ---------------------------------------- + // Increment the number of references to this object + void IncRef () { refCount++; } + // Decrement the reference count + void DecRef () + { if ( --refCount <= 0 ) + delete this; + } + // IWindow -------------------------------------------- + // get pixel size + int getHeight() { return m_pWnd->allocation.height; } + int getWidth() { return m_pWnd->allocation.width; } + // set pixel size and other parameters before showing it + void setSizeParm(int width, int height) { m_nWidthParam = width; m_nHeightParam = height; } + // set the IWindowListener (implemented by the plugin using this window) + void setListener(IWindowListener * pListen) { m_pListen = pListen; m_pListen->IncRef(); } + // set the name (optional) + void setName(char *name) { m_Name = name; } + // will actually create the GL and the window based on the parameters + bool Show(); + // CGtkWindow ----------------------------------------- + // called upon a closure of the widget + void Close(); + // called to manage GL context and buffer swapping before display + void DoExpose(); + // commands ------------------------------------------- + // call this to ask for a Redraw + void Redraw(); +}; + +#endif diff --git a/radiant/undo.cpp b/radiant/undo.cpp index aa75d950..41bad9d8 100644 --- a/radiant/undo.cpp +++ b/radiant/undo.cpp @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,572 +19,955 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "undo.h" -#include "debugging/debugging.h" -#include "warnings.h" +/* -#include "iundo.h" -#include "preferencesystem.h" -#include "string/string.h" -#include "generic/callback.h" -#include "preferences.h" -#include "stringio.h" + QERadiant Undo/Redo -#include -#include -#include -#include "timer.h" +basic setup: -class DebugScopeTimer +<-g_undolist---------g_lastundo> <---map data---> <-g_lastredo---------g_redolist-> + + + undo/redo on the world_entity is special, only the epair changes are remembered + and the world entity never gets deleted. + + FIXME: maybe reset the Undo system at map load + maybe also reset the entityId at map load +*/ + +#include "stdafx.h" + +typedef struct undo_s { - Timer m_timer; - const char* m_operation; -public: - DebugScopeTimer(const char* operation) - : m_operation(operation) - { - m_timer.start(); - } - ~DebugScopeTimer() - { - unsigned int elapsed = m_timer.elapsed_msec(); - if(elapsed > 0) - { - globalOutputStream() << m_operation << ": " << elapsed << " msec\n"; - } - } -}; + double time; //time operation was performed + int id; //every undo has an unique id + int done; //true when undo is build + char *operation; //name of the operation + brush_t brushlist; //deleted brushes + entity_t entitylist; //deleted entities + struct undo_s *prev, *next; //next and prev undo in list +} undo_t; +undo_t *g_undolist; //first undo in the list +undo_t *g_lastundo; //last undo in the list +undo_t *g_redolist; //first redo in the list +undo_t *g_lastredo; //last undo in list +int g_undoMaxSize = 64; //maximum number of undos +int g_undoSize = 0; //number of undos in the list +int g_undoMaxMemorySize = 2*1024*1024; //maximum undo memory (default 2 MB) +int g_undoMemorySize = 0; //memory size of undo buffer +int g_undoId = 1; //current undo ID (zero is invalid id) +int g_redoId = 1; //current redo ID (zero is invalid id) -class RadiantUndoSystem : public UndoSystem +/* +============= +Undo_MemorySize +============= +*/ +int Undo_MemorySize(void) { - INTEGER_CONSTANT(MAX_UNDO_LEVELS, 1024); - - class Snapshot - { - class StateApplicator - { - public: - Undoable* m_undoable; - private: - UndoMemento* m_data; - public: - - StateApplicator(Undoable* undoable, UndoMemento* data) - : m_undoable(undoable), m_data(data) - { - } - void restore() - { - m_undoable->importState(m_data); - } - void release() - { - m_data->release(); - } - }; - - typedef std::list states_t; - states_t m_states; - - public: - bool empty() const - { - return m_states.empty(); - } - std::size_t size() const - { - return m_states.size(); - } - void save(Undoable* undoable) - { - m_states.push_front(StateApplicator(undoable, undoable->exportState())); - } - void restore() - { - for(states_t::iterator i = m_states.begin(); i != m_states.end(); ++i) - { - (*i).restore(); - } - } - void release() - { - for(states_t::iterator i = m_states.begin(); i != m_states.end(); ++i) - { - (*i).release(); - } - } - }; - - struct Operation - { - Snapshot m_snapshot; - CopiedString m_command; - - Operation(const char* command) - : m_command(command) - { - } - ~Operation() - { - m_snapshot.release(); - } - }; - - - class UndoStack - { - //! Note: using std::list instead of vector/deque, to avoid copying of undos - typedef std::list Operations; - - Operations m_stack; - Operation* m_pending; - - public: - UndoStack() : m_pending(0) - { - } - ~UndoStack() - { - clear(); - } - bool empty() const - { - return m_stack.empty(); - } - std::size_t size() const - { - return m_stack.size(); - } - Operation* back() - { - return m_stack.back(); - } - const Operation* back() const - { - return m_stack.back(); - } - Operation* front() - { - return m_stack.front(); - } - const Operation* front() const - { - return m_stack.front(); - } - void pop_front() - { - delete m_stack.front(); - m_stack.pop_front(); - } - void pop_back() - { - delete m_stack.back(); - m_stack.pop_back(); - } - void clear() - { - if(!m_stack.empty()) - { - for(Operations::iterator i = m_stack.begin(); i != m_stack.end(); ++i) - { - delete *i; - } - m_stack.clear(); - } - } - void start(const char* command) - { - if(m_pending != 0) - { - delete m_pending; - } - m_pending = new Operation(command); - } - bool finish(const char* command) - { - if(m_pending != 0) - { - delete m_pending; - m_pending = 0; - return false; - } - else - { - ASSERT_MESSAGE(!m_stack.empty(), "undo stack empty"); - m_stack.back()->m_command = command; - return true; - } - } - void save(Undoable* undoable) - { - if(m_pending != 0) - { - m_stack.push_back(m_pending); - m_pending = 0; - } - back()->m_snapshot.save(undoable); - } - }; - - UndoStack m_undo_stack; - UndoStack m_redo_stack; - - class UndoStackFiller : public UndoObserver - { - UndoStack* m_stack; - public: - - UndoStackFiller() - : m_stack(0) - { - } - void save(Undoable* undoable) - { - ASSERT_NOTNULL(undoable); - - if(m_stack != 0) - { - m_stack->save(undoable); - m_stack = 0; - } - } - void setStack(UndoStack* stack) - { - m_stack = stack; - } - }; - - typedef std::map undoables_t; - undoables_t m_undoables; - - void mark_undoables(UndoStack* stack) - { - for(undoables_t::iterator i = m_undoables.begin(); i != m_undoables.end(); ++i) - { - (*i).second.setStack(stack); - } - } - - std::size_t m_undo_levels; - - typedef std::set Trackers; - Trackers m_trackers; -public: - RadiantUndoSystem() - : m_undo_levels(64) - { - } - ~RadiantUndoSystem() - { - clear(); - } - UndoObserver* observer(Undoable* undoable) - { - ASSERT_NOTNULL(undoable); - - return &m_undoables[undoable]; - } - void release(Undoable* undoable) - { - ASSERT_NOTNULL(undoable); - - m_undoables.erase(undoable); - } - void setLevels(std::size_t levels) - { - if(levels > MAX_UNDO_LEVELS()) - { - levels = MAX_UNDO_LEVELS(); - } - - while(m_undo_stack.size() > levels) - { - m_undo_stack.pop_front(); - } - m_undo_levels = levels; - } - std::size_t getLevels() const - { - return m_undo_levels; - } - std::size_t size() const - { - return m_undo_stack.size(); - } - void startUndo() - { - m_undo_stack.start("unnamedCommand"); - mark_undoables(&m_undo_stack); - } - bool finishUndo(const char* command) - { - bool changed = m_undo_stack.finish(command); - mark_undoables(0); - return changed; - } - void startRedo() - { - m_redo_stack.start("unnamedCommand"); - mark_undoables(&m_redo_stack); - } - bool finishRedo(const char* command) - { - bool changed = m_redo_stack.finish(command); - mark_undoables(0); - return changed; - } - void start() - { - m_redo_stack.clear(); - if(m_undo_stack.size() == m_undo_levels) - { - m_undo_stack.pop_front(); - } - startUndo(); - trackersBegin(); - } - void finish(const char* command) - { - if(finishUndo(command)) - { - globalOutputStream() << command << '\n'; - } - } - void undo() - { - if(m_undo_stack.empty()) - { - globalOutputStream() << "Undo: no undo available\n"; - } - else - { - Operation* operation = m_undo_stack.back(); - globalOutputStream() << "Undo: " << operation->m_command.c_str() << "\n"; - - startRedo(); - trackersUndo(); - operation->m_snapshot.restore(); - finishRedo(operation->m_command.c_str()); - m_undo_stack.pop_back(); - } - } - void redo() - { - if(m_redo_stack.empty()) - { - globalOutputStream() << "Redo: no redo available\n"; - } - else - { - Operation* operation = m_redo_stack.back(); - globalOutputStream() << "Redo: " << operation->m_command.c_str() << "\n"; - - startUndo(); - trackersRedo(); - operation->m_snapshot.restore(); - finishUndo(operation->m_command.c_str()); - m_redo_stack.pop_back(); - } - } - void clear() - { - mark_undoables(0); - m_undo_stack.clear(); - m_redo_stack.clear(); - trackersClear(); - } - void trackerAttach(UndoTracker& tracker) - { - ASSERT_MESSAGE(m_trackers.find(&tracker) == m_trackers.end(), "undo tracker already attached"); - m_trackers.insert(&tracker); - } - void trackerDetach(UndoTracker& tracker) - { - ASSERT_MESSAGE(m_trackers.find(&tracker) != m_trackers.end(), "undo tracker cannot be detached"); - m_trackers.erase(&tracker); - } - void trackersClear() const - { - for(Trackers::const_iterator i = m_trackers.begin(); i != m_trackers.end(); ++i) - { - (*i)->clear(); - } - } - void trackersBegin() const - { - for(Trackers::const_iterator i = m_trackers.begin(); i != m_trackers.end(); ++i) - { - (*i)->begin(); - } - } - void trackersUndo() const - { - for(Trackers::const_iterator i = m_trackers.begin(); i != m_trackers.end(); ++i) - { - (*i)->undo(); - } - } - void trackersRedo() const - { - for(Trackers::const_iterator i = m_trackers.begin(); i != m_trackers.end(); ++i) - { - (*i)->redo(); - } - } -}; - - - -void UndoLevels_importString(RadiantUndoSystem& undo, const char* value) -{ - int levels; - Int_importString(levels, value); - undo.setLevels(levels); -} -typedef ReferenceCaller1 UndoLevelsImportStringCaller; -void UndoLevels_exportString(const RadiantUndoSystem& undo, const StringImportCallback& importer) -{ - Int_exportString(static_cast(undo.getLevels()), importer); -} -typedef ConstReferenceCaller1 UndoLevelsExportStringCaller; - -#include "generic/callback.h" - -void UndoLevelsImport(RadiantUndoSystem& self, int value) -{ - self.setLevels(value); -} -typedef ReferenceCaller1 UndoLevelsImportCaller; -void UndoLevelsExport(const RadiantUndoSystem& self, const IntImportCallback& importCallback) -{ - importCallback(static_cast(self.getLevels())); -} -typedef ConstReferenceCaller1 UndoLevelsExportCaller; - - -void Undo_constructPreferences(RadiantUndoSystem& undo, PreferencesPage& page) -{ - page.appendSpinner("Undo Queue Size", 64, 0, 1024, IntImportCallback(UndoLevelsImportCaller(undo)), IntExportCallback(UndoLevelsExportCaller(undo))); -} -void Undo_constructPage(RadiantUndoSystem& undo, PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Undo", "Undo Queue Settings")); - Undo_constructPreferences(undo, page); -} -void Undo_registerPreferencesPage(RadiantUndoSystem& undo) -{ - PreferencesDialog_addSettingsPage(ReferenceCaller1(undo)); + return g_undoMemorySize; } -class UndoSystemDependencies : public GlobalPreferenceSystemModuleRef +/* +============= +Undo_ClearRedo +============= +*/ +void Undo_ClearRedo(void) { -}; + undo_t *redo, *nextredo; + brush_t *pBrush, *pNextBrush; + entity_t *pEntity, *pNextEntity; -class UndoSystemAPI + for (redo = g_redolist; redo; redo = nextredo) + { + nextredo = redo->next; + for (pBrush = redo->brushlist.next ; pBrush != NULL && pBrush != &redo->brushlist ; pBrush = pNextBrush) + { + pNextBrush = pBrush->next; + Brush_Free(pBrush); + } + for (pEntity = redo->entitylist.next; pEntity != NULL && pEntity != &redo->entitylist; pEntity = pNextEntity) + { + pNextEntity = pEntity->next; + Entity_Free(pEntity); + } + free(redo); + } + g_redolist = NULL; + g_lastredo = NULL; + g_redoId = 1; +} + +/* +============= +Undo_Clear + + Clears the undo buffer. +============= +*/ +void Undo_Clear(void) { - RadiantUndoSystem m_undosystem; -public: - typedef UndoSystem Type; - STRING_CONSTANT(Name, "*"); + undo_t *undo, *nextundo; + brush_t *pBrush, *pNextBrush; + entity_t *pEntity, *pNextEntity; - UndoSystemAPI() - { - GlobalPreferenceSystem().registerPreference("UndoLevels", makeIntStringImportCallback(UndoLevelsImportCaller(m_undosystem)), makeIntStringExportCallback(UndoLevelsExportCaller(m_undosystem))); + Undo_ClearRedo(); + for (undo = g_undolist; undo; undo = nextundo) + { + nextundo = undo->next; + for (pBrush = undo->brushlist.next ; pBrush != NULL && pBrush != &undo->brushlist ; pBrush = pNextBrush) + { + pNextBrush = pBrush->next; + g_undoMemorySize -= Brush_MemorySize(pBrush); + Brush_Free(pBrush); + } + for (pEntity = undo->entitylist.next; pEntity != NULL && pEntity != &undo->entitylist; pEntity = pNextEntity) + { + pNextEntity = pEntity->next; + g_undoMemorySize -= Entity_MemorySize(pEntity); + Entity_Free(pEntity); + } + g_undoMemorySize -= sizeof(undo_t); + free(undo); + } + g_undolist = NULL; + g_lastundo = NULL; + g_undoSize = 0; + g_undoMemorySize = 0; + g_undoId = 1; +} - Undo_registerPreferencesPage(m_undosystem); - } - UndoSystem* getTable() - { - return &m_undosystem; - } -}; - -#include "modulesystem/singletonmodule.h" -#include "modulesystem/moduleregistry.h" - -typedef SingletonModule UndoSystemModule; -typedef Static StaticUndoSystemModule; -StaticRegisterModule staticRegisterUndoSystem(StaticUndoSystemModule::instance()); - - - - - - - - - - -class undoable_test : public Undoable +/* +============= +Undo_SetMaxSize +============= +*/ +void Undo_SetMaxSize(int size) { - struct state_type : public UndoMemento - { - state_type() : test_data(0) - { - } - state_type(const state_type& other) : UndoMemento(other), test_data(other.test_data) - { - } - void release() - { - delete this; - } + Undo_Clear(); + if (size < 1) g_undoMaxSize = 1; + else g_undoMaxSize = size; +} - int test_data; - }; - state_type m_state; - UndoObserver* m_observer; -public: - undoable_test() - : m_observer(GlobalUndoSystem().observer(this)) - { - } - ~undoable_test() - { - GlobalUndoSystem().release(this); - } - UndoMemento* exportState() const - { - return new state_type(m_state); - } - void importState(const UndoMemento* state) - { - ASSERT_NOTNULL(state); - - m_observer->save(this); - m_state = *(static_cast(state)); - } - - void mutate(unsigned int data) - { - m_observer->save(this); - m_state.test_data = data; - } -}; - -#if 0 - -class TestUndo +/* +============= +Undo_GetMaxSize +============= +*/ +int Undo_GetMaxSize(void) { -public: - TestUndo() - { - undoable_test test; - GlobalUndoSystem().begin("bleh"); - test.mutate(3); - GlobalUndoSystem().begin("blah"); - test.mutate(4); - GlobalUndoSystem().undo(); - GlobalUndoSystem().undo(); - GlobalUndoSystem().redo(); - GlobalUndoSystem().redo(); - } -}; + return g_undoMaxSize; +} -TestUndo g_TestUndo; +/* +============= +Undo_SetMaxMemorySize +============= +*/ +void Undo_SetMaxMemorySize(int size) +{ + Undo_Clear(); + if (size < 1024) g_undoMaxMemorySize = 1024; + else g_undoMaxMemorySize = size; +} +/* +============= +Undo_GetMaxMemorySize +============= +*/ +int Undo_GetMaxMemorySize(void) +{ + return g_undoMaxMemorySize; +} + +/* +============= +Undo_FreeFirstUndo +============= +*/ +void Undo_FreeFirstUndo(void) +{ + undo_t *undo; + brush_t *pBrush, *pNextBrush; + entity_t *pEntity, *pNextEntity; + + //remove the oldest undo from the undo buffer + undo = g_undolist; + g_undolist = g_undolist->next; + g_undolist->prev = NULL; + // + for (pBrush = undo->brushlist.next ; pBrush != NULL && pBrush != &undo->brushlist ; pBrush = pNextBrush) + { + pNextBrush = pBrush->next; + g_undoMemorySize -= Brush_MemorySize(pBrush); + Brush_Free(pBrush); + } + for (pEntity = undo->entitylist.next; pEntity != NULL && pEntity != &undo->entitylist; pEntity = pNextEntity) + { + pNextEntity = pEntity->next; + g_undoMemorySize -= Entity_MemorySize(pEntity); + Entity_Free(pEntity); + } + g_undoMemorySize -= sizeof(undo_t); + free(undo); + g_undoSize--; +} + +/* +============= +Undo_GeneralStart +============= +*/ +void Undo_GeneralStart(char *operation) +{ + undo_t *undo; + brush_t *pBrush; + entity_t *pEntity; + + + if (g_lastundo) + { + if (!g_lastundo->done) + { + Sys_Printf("Undo_Start: WARNING last undo not finished.\n"); + } + } + + undo = (undo_t *) malloc(sizeof(undo_t)); + if (!undo) + return; + memset(undo, 0, sizeof(undo_t)); + undo->brushlist.next = &undo->brushlist; + undo->brushlist.prev = &undo->brushlist; + undo->entitylist.next = &undo->entitylist; + undo->entitylist.prev = &undo->entitylist; + if (g_lastundo) + g_lastundo->next = undo; + else + g_undolist = undo; + undo->prev = g_lastundo; + undo->next = NULL; + g_lastundo = undo; + + undo->time = Sys_DoubleTime(); + // + if (g_undoId > g_undoMaxSize * 2) g_undoId = 1; + if (g_undoId <= 0) g_undoId = 1; + undo->id = g_undoId++; + undo->done = false; + undo->operation = operation; + //reset the undo IDs of all brushes using the new ID + for (pBrush = active_brushes.next; pBrush != NULL && pBrush != &active_brushes; pBrush = pBrush->next) + { + if (pBrush->undoId == undo->id) + { + pBrush->undoId = 0; + } + } + for (pBrush = selected_brushes.next; pBrush != NULL && pBrush != &selected_brushes; pBrush = pBrush->next) + { + if (pBrush->undoId == undo->id) + { + pBrush->undoId = 0; + } + } + //reset the undo IDs of all entities using thew new ID + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pEntity->next) + { + if (pEntity->undoId == undo->id) + { + pEntity->undoId = 0; + } + } + g_undoMemorySize += sizeof(undo_t); + g_undoSize++; + //undo buffer is bound to a max + if (g_undoSize > g_undoMaxSize) + { + Undo_FreeFirstUndo(); + } +} + +/* +============= +Undo_BrushInUndo +============= +*/ +int Undo_BrushInUndo(undo_t *undo, brush_t *brush) +{ +/* brush_t *b; + + for (b = undo->brushlist.next; b != &undo->brushlist; b = b->next) + { + // Arnout: NOTE - can't do a pointer compare as the brushes get cloned into the undo brushlist, and not just referenced from it + // For entities we have a unique ID, for brushes we have numberID - but brush full clone increases that anyway so it's useless right now. + if (b == brush) return true; + }*/ + // Arnout: function is pointless right now, see above explanation + return false; +} + +/* +============= +Undo_EntityInUndo +============= +*/ +int Undo_EntityInUndo(undo_t *undo, entity_t *ent) +{ + entity_t *e; + + for (e = undo->entitylist.next; e != &undo->entitylist; e = e->next) + { + // Arnout: NOTE - can't do a pointer compare as the entities get cloned into the undo entitylist, and not just referenced from it + //if (e == ent) return true; + if( e->entityId == ent->entityId ) return true; + } + return false; +} + +/* +============= +Undo_Start +============= +*/ +void Undo_Start(char *operation) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_Start: undo is disabled.\n"); #endif + return; + } + + Undo_ClearRedo(); + Undo_GeneralStart(operation); +} +/* +============= +Undo_AddBrush +============= +*/ +void Undo_AddBrush(brush_t *pBrush) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_AddBrush: undo is disabled.\n"); +#endif + return; + } + + if (!g_lastundo) + { + Sys_Printf("Undo_AddBrushList: no last undo.\n"); + return; + } + if (g_lastundo->entitylist.next != &g_lastundo->entitylist) + { + Sys_Printf("Undo_AddBrushList: WARNING adding brushes after entity.\n"); + } + //if the brush is already in the undo + if (Undo_BrushInUndo(g_lastundo, pBrush)) + return; + //clone the brush + brush_t* pClone = Brush_FullClone(pBrush); + //save the ID of the owner entity + pClone->ownerId = pBrush->owner->entityId; + //save the old undo ID for previous undos + pClone->undoId = pBrush->undoId; + Brush_AddToList (pClone, &g_lastundo->brushlist); + // + g_undoMemorySize += Brush_MemorySize(pClone); +} + +/* +============= +Undo_AddBrushList +TTimo: some brushes are just there for UI, and the information is somewhere else +for patches it's in the patchMesh_t structure, so when we clone the brush we get that information (brush_t::pPatch) +but: models are stored in pBrush->owner->md3Class, and owner epairs and origin parameters are important + so, we detect models and push the entity in the undo session (as well as it's BBox brush) + same for other items like weapons and ammo etc. +============= +*/ +void Undo_AddBrushList(brush_t *brushlist) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_AddBrushList: undo is disabled.\n"); +#endif + return; + } + + brush_t *pBrush; + + if (!g_lastundo) + { + Sys_Printf("Undo_AddBrushList: no last undo.\n"); + return; + } + if (g_lastundo->entitylist.next != &g_lastundo->entitylist) + { + Sys_Printf("Undo_AddBrushList: WARNING adding brushes after entity.\n"); + } + //copy the brushes to the undo + for (pBrush = brushlist->next ; pBrush != NULL && pBrush != brushlist; pBrush=pBrush->next) + { + //if the brush is already in the undo + //++timo FIXME: when does this happen? + if (Undo_BrushInUndo(g_lastundo, pBrush)) + continue; + // do we need to store this brush's entity in the undo? + // if it's a fixed size entity, the brush that reprents it is not really relevant, it's used for selecting and moving around + // what we want to store for undo is the owner entity, epairs and origin/angle stuff + //++timo FIXME: if the entity is not fixed size I don't know, so I don't do it yet + if (pBrush->owner->eclass->fixedsize == 1) + Undo_AddEntity( pBrush->owner ); + // clone the brush + brush_t* pClone = Brush_FullClone(pBrush); + // save the ID of the owner entity + pClone->ownerId = pBrush->owner->entityId; + // save the old undo ID from previous undos + pClone->undoId = pBrush->undoId; + Brush_AddToList (pClone, &g_lastundo->brushlist); + // track memory size used by undo + g_undoMemorySize += Brush_MemorySize(pClone); + } +} + +/* +============= +Undo_EndBrush +============= +*/ +void Undo_EndBrush(brush_t *pBrush) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_EndBrush: undo is disabled.\n"); +#endif + return; + } + + + if (!g_lastundo) + { + //Sys_Printf("Undo_End: no last undo.\n"); + return; + } + if (g_lastundo->done) + { + //Sys_Printf("Undo_End: last undo already finished.\n"); + return; + } + pBrush->undoId = g_lastundo->id; +} + +/* +============= +Undo_EndBrushList +============= +*/ +void Undo_EndBrushList(brush_t *brushlist) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_EndBrushList: undo is disabled.\n"); +#endif + return; + } + + + if (!g_lastundo) + { + //Sys_Printf("Undo_End: no last undo.\n"); + return; + } + if (g_lastundo->done) + { + //Sys_Printf("Undo_End: last undo already finished.\n"); + return; + } + for (brush_t* pBrush = brushlist->next; pBrush != NULL && pBrush != brushlist; pBrush=pBrush->next) + { + pBrush->undoId = g_lastundo->id; + } +} + +/* +============= +Undo_AddEntity +============= +*/ +void Undo_AddEntity(entity_t *entity) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_AddEntity: undo is disabled.\n"); +#endif + return; + } + + + entity_t* pClone; + + if (!g_lastundo) + { + Sys_Printf("Undo_AddEntity: no last undo.\n"); + return; + } + //if the entity is already in the undo + if (Undo_EntityInUndo(g_lastundo, entity)) + return; + //clone the entity + pClone = Entity_Clone(entity); + //save the old undo ID for previous undos + pClone->undoId = entity->undoId; + //save the entity ID (we need a full clone) + pClone->entityId = entity->entityId; + // + Entity_AddToList(pClone, &g_lastundo->entitylist); + // + g_undoMemorySize += Entity_MemorySize(pClone); +} + +/* +============= +Undo_EndEntity +============= +*/ +void Undo_EndEntity(entity_t *entity) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_EndEntity: undo is disabled.\n"); +#endif + return; + } + + + if (!g_lastundo) + { +#ifdef _DEBUG + Sys_Printf("Undo_End: no last undo.\n"); +#endif + return; + } + if (g_lastundo->done) + { +#ifdef _DEBUG + Sys_Printf("Undo_End: last undo already finished.\n"); +#endif + return; + } + if (entity == world_entity) + { + //Sys_Printf("Undo_AddEntity: undo on world entity.\n"); + //NOTE: we never delete the world entity when undoing an operation + // we only transfer the epairs + return; + } + entity->undoId = g_lastundo->id; +} + +/* +============= +Undo_End +============= +*/ +void Undo_End(void) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { +#ifdef DBG_UNDO + Sys_Printf("Undo_End: undo is disabled.\n"); +#endif + return; + } + + + if (!g_lastundo) + { + //Sys_Printf("Undo_End: no last undo.\n"); + return; + } + if (g_lastundo->done) + { + //Sys_Printf("Undo_End: last undo already finished.\n"); + return; + } + g_lastundo->done = true; + + //undo memory size is bound to a max + while (g_undoMemorySize > g_undoMaxMemorySize) + { + //always keep one undo + if (g_undolist == g_lastundo) break; + Undo_FreeFirstUndo(); + } + // + //Sys_Printf("undo size = %d, undo memory = %d\n", g_undoSize, g_undoMemorySize); +} + +/* +============= +Undo_Undo +============= +*/ +void Undo_Undo(boolean bSilent) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { + Sys_Printf("Undo_Undo: undo is disabled.\n"); + return; + } + + undo_t *undo, *redo; + brush_t *pBrush, *pNextBrush; + entity_t *pEntity, *pNextEntity, *pUndoEntity; + + if (!g_lastundo) + { + Sys_Printf("Nothing left to undo.\n"); + return; + } + if (!g_lastundo->done) + { + Sys_Printf("Undo_Undo: WARNING: last undo not yet finished!\n"); + } + // get the last undo + undo = g_lastundo; + if (g_lastundo->prev) g_lastundo->prev->next = NULL; + else g_undolist = NULL; + g_lastundo = g_lastundo->prev; + + //allocate a new redo + redo = (undo_t *) malloc(sizeof(undo_t)); + if (!redo) return; + memset(redo, 0, sizeof(undo_t)); + redo->brushlist.next = &redo->brushlist; + redo->brushlist.prev = &redo->brushlist; + redo->entitylist.next = &redo->entitylist; + redo->entitylist.prev = &redo->entitylist; + if (g_lastredo) g_lastredo->next = redo; + else g_redolist = redo; + redo->prev = g_lastredo; + redo->next = NULL; + g_lastredo = redo; + redo->time = Sys_DoubleTime(); + redo->id = g_redoId++; + redo->done = true; + redo->operation = undo->operation; + + //reset the redo IDs of all brushes using the new ID + for (pBrush = active_brushes.next; pBrush != NULL && pBrush != &active_brushes; pBrush = pBrush->next) + { + if (pBrush->redoId == redo->id) + { + pBrush->redoId = 0; + } + } + for (pBrush = selected_brushes.next; pBrush != NULL && pBrush != &selected_brushes; pBrush = pBrush->next) + { + if (pBrush->redoId == redo->id) + { + pBrush->redoId = 0; + } + } + //reset the redo IDs of all entities using thew new ID + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pEntity->next) + { + if (pEntity->redoId == redo->id) + { + pEntity->redoId = 0; + } + } + + // deselect current sutff + Select_Deselect(); + // move "created" brushes to the redo + for (pBrush = active_brushes.next; pBrush != NULL && pBrush != &active_brushes; pBrush=pNextBrush) + { + pNextBrush = pBrush->next; + if (pBrush->undoId == undo->id) + { + //Brush_Free(pBrush); + //move the brush to the redo + Brush_RemoveFromList(pBrush); + Brush_AddToList(pBrush, &redo->brushlist); + //make sure the ID of the owner is stored + pBrush->ownerId = pBrush->owner->entityId; + //unlink the brush from the owner entity + Entity_UnlinkBrush(pBrush); + } + } + // move "created" entities to the redo + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pNextEntity) + { + pNextEntity = pEntity->next; + if (pEntity->undoId == undo->id) + { + // check if this entity is in the undo + for (pUndoEntity = undo->entitylist.next; pUndoEntity != NULL && pUndoEntity != &undo->entitylist; pUndoEntity = pUndoEntity->next) + { + // move brushes to the undo entity + if (pUndoEntity->entityId == pEntity->entityId) + { + pUndoEntity->brushes.next = pEntity->brushes.next; + pUndoEntity->brushes.prev = pEntity->brushes.prev; + pEntity->brushes.next = &pEntity->brushes; + pEntity->brushes.prev = &pEntity->brushes; + } + } + // + //Entity_Free(pEntity); + //move the entity to the redo + Entity_RemoveFromList(pEntity); + Entity_AddToList(pEntity, &redo->entitylist); + } + } + // add the undo entities back into the entity list + for (pEntity = undo->entitylist.next; pEntity != NULL && pEntity != &undo->entitylist; pEntity = undo->entitylist.next) + { + g_undoMemorySize -= Entity_MemorySize(pEntity); + //if this is the world entity + if (pEntity->entityId == world_entity->entityId) + { + epair_t* tmp = world_entity->epairs; + world_entity->epairs = pEntity->epairs; + pEntity->epairs = tmp; + Entity_Free(pEntity); + } + else + { + Entity_RemoveFromList(pEntity); + Entity_AddToList(pEntity, &entities); + pEntity->redoId = redo->id; + } + } + // add the undo brushes back into the selected brushes + for (pBrush = undo->brushlist.next; pBrush != NULL && pBrush != &undo->brushlist; pBrush = undo->brushlist.next) + { + //Sys_Printf("Owner ID: %i\n",pBrush->ownerId); + g_undoMemorySize -= Brush_MemorySize(pBrush); + Brush_RemoveFromList(pBrush); + Brush_AddToList(pBrush, &active_brushes); + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pEntity->next) // fixes broken undo on entities + { + //Sys_Printf("Entity ID: %i\n",pEntity->entityId); + if (pEntity->entityId == pBrush->ownerId) + { + Entity_LinkBrush(pEntity, pBrush); + break; + } + } + //if the brush is not linked then it should be linked into the world entity + //++timo FIXME: maybe not, maybe we've lost this entity's owner! + if (pEntity == NULL || pEntity == &entities) + { + Entity_LinkBrush(world_entity, pBrush); + } + //build the brush + //Brush_Build(pBrush); + Select_Brush(pBrush); + pBrush->redoId = redo->id; + } + if (!bSilent) + Sys_Printf("%s undone.\n", undo->operation); + // free the undo + g_undoMemorySize -= sizeof(undo_t); + free(undo); + g_undoSize--; + g_undoId--; + if (g_undoId <= 0) g_undoId = 2 * g_undoMaxSize; + // + g_bScreenUpdates = true; + UpdateSurfaceDialog(); + Sys_UpdateWindows(W_ALL); +} + +/* +============= +Undo_Redo +============= +*/ +void Undo_Redo(void) +{ + // spog - disable undo if undo levels = 0 + if (g_PrefsDlg.m_nUndoLevels == 0) + { + Sys_Printf("Undo_Redo: undo is disabled.\n"); + return; + } + + undo_t *redo; + brush_t *pBrush, *pNextBrush; + entity_t *pEntity, *pNextEntity, *pRedoEntity; + + if (!g_lastredo) + { + Sys_Printf("Nothing left to redo.\n"); + return; + } + if (g_lastundo) + { + if (!g_lastundo->done) + { + Sys_Printf("WARNING: last undo not finished.\n"); + } + } + // get the last redo + redo = g_lastredo; + if (g_lastredo->prev) g_lastredo->prev->next = NULL; + else g_redolist = NULL; + g_lastredo = g_lastredo->prev; + // + Undo_GeneralStart(redo->operation); + // remove current selection + Select_Deselect(); + // move "created" brushes back to the last undo + for (pBrush = active_brushes.next; pBrush != NULL && pBrush != &active_brushes; pBrush = pNextBrush) + { + pNextBrush = pBrush->next; + if (pBrush->redoId == redo->id) + { + //move the brush to the undo + Brush_RemoveFromList(pBrush); + Brush_AddToList(pBrush, &g_lastundo->brushlist); + g_undoMemorySize += Brush_MemorySize(pBrush); + pBrush->ownerId = pBrush->owner->entityId; + Entity_UnlinkBrush(pBrush); + } + } + // move "created" entities back to the last undo + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pNextEntity) + { + pNextEntity = pEntity->next; + if (pEntity->redoId == redo->id) + { + // check if this entity is in the redo + for (pRedoEntity = redo->entitylist.next; pRedoEntity != NULL && pRedoEntity != &redo->entitylist; pRedoEntity = pRedoEntity->next) + { + // move brushes to the redo entity + if (pRedoEntity->entityId == pEntity->entityId) + { + pRedoEntity->brushes.next = pEntity->brushes.next; + pRedoEntity->brushes.prev = pEntity->brushes.prev; + pEntity->brushes.next = &pEntity->brushes; + pEntity->brushes.prev = &pEntity->brushes; + } + } + // + //Entity_Free(pEntity); + //move the entity to the redo + Entity_RemoveFromList(pEntity); + Entity_AddToList(pEntity, &g_lastundo->entitylist); + g_undoMemorySize += Entity_MemorySize(pEntity); + } + } + // add the undo entities back into the entity list + for (pEntity = redo->entitylist.next; pEntity != NULL && pEntity != &redo->entitylist; pEntity = redo->entitylist.next) + { + //if this is the world entity + if (pEntity->entityId == world_entity->entityId) + { + epair_t* tmp = world_entity->epairs; + world_entity->epairs = pEntity->epairs; + pEntity->epairs = tmp; + Entity_Free(pEntity); + } + else + { + Entity_RemoveFromList(pEntity); + Entity_AddToList(pEntity, &entities); + } + } + // add the redo brushes back into the selected brushes + for (pBrush = redo->brushlist.next; pBrush != NULL && pBrush != &redo->brushlist; pBrush = redo->brushlist.next) + { + Brush_RemoveFromList(pBrush); + Brush_AddToList(pBrush, &active_brushes); + for (pEntity = entities.next; pEntity != NULL && pEntity != &entities; pEntity = pEntity->next) // fixes broken undo on entities + { + if (pEntity->entityId == pBrush->ownerId) + { + Entity_LinkBrush(pEntity, pBrush); + break; + } + } + //if the brush is not linked then it should be linked into the world entity + if (pEntity == NULL || pEntity == &entities) + { + Entity_LinkBrush(world_entity, pBrush); + } + //build the brush + //Brush_Build(pBrush); + Select_Brush(pBrush); + } + // + Undo_End(); + // + Sys_Printf("%s redone.\n", redo->operation); + // + g_redoId--; + // free the undo + free(redo); + // + g_bScreenUpdates = true; + UpdateSurfaceDialog(); + Sys_UpdateWindows(W_ALL); +} + +/* +============= +Undo_RedoAvailable +============= +*/ +int Undo_RedoAvailable(void) +{ + if (g_lastredo) return true; + return false; +} + +int Undo_GetUndoId(void) +{ + if (g_lastundo) + return g_lastundo->id; + return 0; +} + +/* +============= +Undo_UndoAvailable +============= +*/ +int Undo_UndoAvailable(void) +{ + if (g_lastundo) + { + if (g_lastundo->done) + return true; + } + return false; +} diff --git a/radiant/undo.h b/radiant/undo.h index 171af8cf..5973202a 100644 --- a/radiant/undo.h +++ b/radiant/undo.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,48 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_UNDO_H) -#define INCLUDED_UNDO_H +// +// +// QERadiant Multilevel Undo/Redo +// +// + +//start operation +void Undo_Start(char *operation); +//end operation +void Undo_End(void); +//add brush to the undo +void Undo_AddBrush(brush_t *pBrush); +//add a list with brushes to the undo +void Undo_AddBrushList(brush_t *brushlist); +//end a brush after the operation is performed +void Undo_EndBrush(brush_t *pBrush); +//end a list with brushes after the operation is performed +void Undo_EndBrushList(brush_t *brushlist); +//add entity to undo +void Undo_AddEntity(entity_t *entity); +//end an entity after the operation is performed +void Undo_EndEntity(entity_t *entity); +//undo last operation (bSilent == true -> will not print the "undone blah blah message") +void Undo_Undo(boolean bSilent = false); +//redo last undone operation +void Undo_Redo(void); +//get the undo Id of the next undo (0 if none available) +int Undo_GetUndoId(void); +//returns true if there is something to be undone available +int Undo_UndoAvailable(void); +//returns true if there is something to redo available +int Undo_RedoAvailable(void); +//clear the undo buffer +void Undo_Clear(void); +//set maximum undo size (default 64) +void Undo_SetMaxSize(int size); +//get maximum undo size +int Undo_GetMaxSize(void); +//set maximum undo memory in bytes (default 2 MB) +void Undo_SetMaxMemorySize(int size); +//get maximum undo memory in bytes +int Undo_GetMaxMemorySize(void); +//returns the amount of memory used by undo +int Undo_MemorySize(void); -#endif diff --git a/radiant/url.cpp b/radiant/url.cpp deleted file mode 100644 index 382dcd90..00000000 --- a/radiant/url.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "url.h" - -#include "mainframe.h" -#include "gtkutil/messagebox.h" - -#ifdef WIN32 -#include -#include -bool open_url(const char* url) -{ - return ShellExecute( (HWND)GDK_WINDOW_HWND (GTK_WIDGET(MainFrame_getWindow())->window), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32; -} -#endif - -#if defined(__linux__) || defined(__FreeBSD__) -#include -bool open_url(const char* url) -{ - // \todo FIXME: the way we open URLs on *nix should be improved. A script is good (see how I do on RTCW) - char command[2*PATH_MAX]; - snprintf (command, sizeof(command), - "netscape -remote \"openURL(%s,new-window)\" || netscape \"%s\" &", url, url); - return system(command) == 0; -} -#endif - -#ifdef __APPLE__ -#include -bool open_url(const char* url) -{ - char command[2*PATH_MAX]; - snprintf (command, sizeof(command), "open \"%s\" &", url); - return system(command) == 0; -} -#endif - -void OpenURL(const char *url) -{ - // let's put a little comment - globalOutputStream() << "OpenURL: " << url << "\n"; - if(!open_url(url)) - { - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), "Failed to launch browser!"); - } -} diff --git a/radiant/url.h b/radiant/url.h deleted file mode 100644 index 38d50b51..00000000 --- a/radiant/url.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_URL_H) -#define INCLUDED_URL_H - -void OpenURL(const char *url); - -#endif diff --git a/radiant/vertsel.cpp b/radiant/vertsel.cpp new file mode 100644 index 00000000..ae7d5362 --- /dev/null +++ b/radiant/vertsel.cpp @@ -0,0 +1,386 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "stdafx.h" +//#include "qe3.h" +#include "winding.h" + +int FindPoint (vec3_t point) +{ + int i, j; + + for (i=0 ; i 0.1) + break; + if (j == 3) + return i; + } + + VectorCopy (point, g_qeglobals.d_points[g_qeglobals.d_numpoints]); + //qeglobals.d_points[g_qeglobals.d_numpoints] = point; + if (g_qeglobals.d_numpoints < MAX_POINTS-1) + { + g_qeglobals.d_numpoints++; + } + + return g_qeglobals.d_numpoints-1; +} + +//#define DBG_WNDG +int FindEdge (int p1, int p2, face_t *f) +{ + int i; + + for (i=0 ; inumpoints ; i++) + pnum[i] = FindPoint (w->points[i]); + for (i=0 ; inumpoints ; i++) + FindEdge (pnum[i], pnum[(i+1)%w->numpoints], f); + + free (w); +} + +void SetupVertexSelection (void) +{ + face_t *f; + brush_t *b; + + g_qeglobals.d_numpoints = 0; + g_qeglobals.d_numedges = 0; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + if (b->patchBrush || b->owner->eclass->fixedsize) + continue; // don't make edge and vertex handles for patchbrushes + for (f=b->brush_faces ; f ; f=f->next) + MakeFace (b,f); + } +} + +void SelectFaceEdge (brush_t* b, face_t *f, int p1, int p2) +{ + winding_t *w; + int i, j, k; + int pnum[128]; + +#ifdef DBG_WNDG + if (f==NULL) + Sys_Printf("SelectFaceEdge %p %p\n", b, f); +#endif + + w = Winding_Clone(f->face_winding);//Brush_MakeFaceWinding (b, f); + if (!w) + return; + for (i=0 ; inumpoints ; i++) + pnum[i] = FindPoint (w->points[i]); + + for (i=0 ; inumpoints ; i++) + if (pnum[i] == p1 && pnum[(i+1)%w->numpoints] == p2) + { + VectorCopy (g_qeglobals.d_points[pnum[i]], f->planepts[0]); + VectorCopy (g_qeglobals.d_points[pnum[(i+1)%w->numpoints]], f->planepts[1]); + VectorCopy (g_qeglobals.d_points[pnum[(i+2)%w->numpoints]], f->planepts[2]); + for (j=0 ; j<3 ; j++) + { + for (k=0 ; k<3 ; k++) + { + f->planepts[j][k] = floor(f->planepts[j][k]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize; + } + } + + AddPlanept (f->planepts[0]); + AddPlanept (f->planepts[1]); + break; + } + + if (i == w->numpoints) + Sys_Printf ("SelectFaceEdge: failed\n"); + Winding_Free (w); +} + + +void SelectVertex (int p1) +{ + brush_t *b; + winding_t *w; + int i; + face_t *f; + + for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + for (f=b->brush_faces ; f ; f=f->next) + { + w = Brush_MakeFaceWinding (b, f); + if (!w) + continue; + for (i=0 ; inumpoints ; i++) + { + if (FindPoint (w->points[i]) == p1) + { + VectorCopy (w->points[(i+w->numpoints-1)%w->numpoints], f->planepts[0]); + VectorCopy (w->points[i], f->planepts[1]); + VectorCopy (w->points[(i+1)%w->numpoints], f->planepts[2]); + // NOTE: used to be a planepts clamping to grid here + + AddPlanept (f->planepts[1]); + + break; + } + } + free (w); + } + } +} + +#define SELECT_EPSILON 8 + +void SelectVertexByRay (vec3_t org, vec3_t dir) +{ + int i, besti; + float d, bestd = VEC_MAX; + vec_t epsilon, divergence; + ray_t ray; + ray_construct_for_vec3(&ray, org, dir); + + // find the point closest to the ray + besti = -1; + if ((fabs(org[0]) == g_MaxWorldCoord || fabs(org[1]) == g_MaxWorldCoord || fabs(org[2]) == g_MaxWorldCoord) + && (fabs(dir[0]) == 1.0f || fabs(dir[1]) == 1.0f || fabs(dir[2]) == 1.0f)) // very unlikely unless 2d view + { + divergence = 0; + epsilon = SELECT_EPSILON / g_pParentWnd->GetXYWnd()->Scale(); // compensate for zoom level + } + else + { + divergence = SELECT_EPSILON / (g_pParentWnd->GetCamWnd()->Camera()->width*0.5); // radius / focal length + epsilon = 0; + } + + for (i=0 ; iGetXYWnd()->Scale(); // compensate for zoom level + } + else + { + divergence = SELECT_EPSILON / (g_pParentWnd->GetCamWnd()->Camera()->width*0.5); // radius / focal length + epsilon = 0; + } + + + g_qeglobals.d_numpoints = 0; + + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = pb->next) + { + if (pb->patchBrush) + { + patchMesh_t* p = pb->pPatch; + + for (i = 0 ; i < p->width ; i++ ) + { + for ( j = 0 ; j < p->height ; j++ ) + { + d = ray_intersect_point(&ray, p->ctrl[i][j].xyz, epsilon, divergence); + + if (d >= bestd) + continue; + + bestd = d; + + if (PointInMoveList(*pPointBest) != -1 && PointInMoveList(p->ctrl[i][j].xyz) == -1) + continue; // choose selected points with preference over unselected + + pPointBest = &p->ctrl[i][j].xyz; + + } + } + } + } + + if (pPointBest == NULL) + { + if (g_pParentWnd->ActiveXY()->AreaSelectOK()) + { + g_qeglobals.d_select_mode = sel_area; + VectorCopy(org, g_qeglobals.d_vAreaTL); + VectorCopy(org, g_qeglobals.d_vAreaBR); + } + return; + } + else + AddPatchMovePoint(pPointBest[0], buttons & MK_CONTROL, buttons & MK_SHIFT); +} + +// optimization bug: +// had to use the #define DBG_WNDG to identify +// the first loop that checks the best edge is broken in release-optimized build +// unrolled the mid[] loop and forced floating consistency on seems to fix +#ifdef _WIN32 +#pragma optimize( "p", on ) +#endif +void SelectEdgeByRay (vec3_t org, vec3_t dir) +{ + int i, besti; + float d, bestd = VEC_MAX; + vec3_t mid; + pedge_t *e; + vec_t epsilon, divergence; + ray_t ray; + ray_construct_for_vec3(&ray, org, dir); + + // find the edge closest to the ray + besti = -1; + if ((fabs(org[0]) == g_MaxWorldCoord || fabs(org[1]) == g_MaxWorldCoord || fabs(org[2]) == g_MaxWorldCoord) + && (fabs(dir[0]) == 1.0f || fabs(dir[1]) == 1.0f || fabs(dir[2]) == 1.0f)) // very unlikely unless 2d view + { + divergence = 0; + epsilon = SELECT_EPSILON / g_pParentWnd->GetXYWnd()->Scale(); // compensate for zoom level + } + else + { + divergence = SELECT_EPSILON / (g_pParentWnd->GetCamWnd()->Camera()->width*0.5); // radius / focal length + epsilon = 0; + } + + for (i=0 ; if1 == NULL) + { + Sys_Printf ("e->f1 == NULL e->f2 %p\n", e->f2); + } + if (e->f2 == NULL) + { + Sys_Printf ("e->f1 %p e->f2 == NULL\n",e->f1); + } +#endif + for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next) + { + SelectFaceEdge (b, e->f1, e->p1, e->p2); + SelectFaceEdge (b, e->f2, e->p2, e->p1); + } +} diff --git a/radiant/view.cpp b/radiant/view.cpp deleted file mode 100644 index 5282eb0f..00000000 --- a/radiant/view.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "view.h" - -#if defined(DEBUG_CULLING) - -#include - -char g_cull_stats[1024]; -int g_count_dots; -int g_count_planes; -int g_count_oriented_planes; -int g_count_bboxs; -int g_count_oriented_bboxs; - -#endif - -void Cull_ResetStats() -{ -#if defined(DEBUG_CULLING) - g_count_dots = 0; - g_count_planes = 0; - g_count_oriented_planes = 0; - g_count_bboxs = 0; - g_count_oriented_bboxs = 0; -#endif -} - - -const char* Cull_GetStats() -{ -#if defined(DEBUG_CULLING) - sprintf(g_cull_stats, "dots: %d | planes %d + %d | bboxs %d + %d", g_count_dots, g_count_planes, g_count_oriented_planes, g_count_bboxs, g_count_oriented_bboxs); - return g_cull_stats; -#else - return ""; -#endif -} diff --git a/radiant/view.h b/radiant/view.h deleted file mode 100644 index b6dc414a..00000000 --- a/radiant/view.h +++ /dev/null @@ -1,211 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_VIEW_H) -#define INCLUDED_VIEW_H - -#include "cullable.h" -#include "math/frustum.h" - - -#if defined(_DEBUG) -#define DEBUG_CULLING -#endif - - -#if defined(DEBUG_CULLING) - -extern int g_count_dots; -extern int g_count_planes; -extern int g_count_oriented_planes; -extern int g_count_bboxs; -extern int g_count_oriented_bboxs; - -#endif - -inline void debug_count_dot() -{ -#if defined(DEBUG_CULLING) - ++g_count_dots; -#endif -} - -inline void debug_count_plane() -{ -#if defined(DEBUG_CULLING) - ++g_count_planes; -#endif -} - -inline void debug_count_oriented_plane() -{ -#if defined(DEBUG_CULLING) - ++g_count_oriented_planes; -#endif -} - -inline void debug_count_bbox() -{ -#if defined(DEBUG_CULLING) - ++g_count_bboxs; -#endif -} - -inline void debug_count_oriented_bbox() -{ -#if defined(DEBUG_CULLING) - ++g_count_oriented_bboxs; -#endif -} - - - - -/// \brief View-volume culling and transformations. -class View : public VolumeTest -{ - /// modelview matrix - Matrix4 m_modelview; - /// projection matrix - Matrix4 m_projection; - /// device-to-screen transform - Matrix4 m_viewport; - - Matrix4 m_scissor; - - /// combined modelview and projection matrix - Matrix4 m_viewproj; - /// camera position in world space - Vector4 m_viewer; - /// view frustum in world space - Frustum m_frustum; - - bool m_fill; - - void construct() - { - m_viewproj = matrix4_multiplied_by_matrix4(matrix4_multiplied_by_matrix4(m_scissor, m_projection), m_modelview); - - m_frustum = frustum_from_viewproj(m_viewproj); - m_viewer = viewer_from_viewproj(m_viewproj); - } -public: - View(bool fill = false) : - m_modelview(g_matrix4_identity), - m_projection(g_matrix4_identity), - m_scissor(g_matrix4_identity), - m_fill(fill) - { - } - void Construct(const Matrix4& projection, const Matrix4& modelview, std::size_t width, std::size_t height) - { - // modelview - m_modelview = modelview; - - // projection - m_projection = projection; - - // viewport - m_viewport = g_matrix4_identity; - m_viewport[0] = float(width/2); - m_viewport[5] = float(height/2); - if(fabs(m_projection[11]) > 0.0000001) - m_viewport[10] = m_projection[0] * m_viewport[0]; - else - m_viewport[10] = 1 / m_projection[10]; - - construct(); - } - void EnableScissor(float min_x, float max_x, float min_y, float max_y) - { - m_scissor = g_matrix4_identity; - m_scissor[0] = static_cast((max_x - min_x) * 0.5); - m_scissor[5] = static_cast((max_y - min_y) * 0.5); - m_scissor[12] = static_cast((min_x + max_x) * 0.5); - m_scissor[13] = static_cast((min_y + max_y) * 0.5); - matrix4_full_invert(m_scissor); - - construct(); - } - void DisableScissor() - { - m_scissor = g_matrix4_identity; - - construct(); - } - - bool TestPoint(const Vector3& point) const - { - return viewproj_test_point(m_viewproj, point); - } - bool TestLine(const Segment& segment) const - { - return frustum_test_line(m_frustum, segment); - } - bool TestPlane(const Plane3& plane) const - { - debug_count_plane(); - return viewer_test_plane(m_viewer, plane); - } - bool TestPlane(const Plane3& plane, const Matrix4& localToWorld) const - { - debug_count_oriented_plane(); - return viewer_test_transformed_plane(m_viewer, plane, localToWorld); - } - VolumeIntersectionValue TestAABB(const AABB& aabb) const - { - debug_count_bbox(); - return frustum_test_aabb(m_frustum, aabb); - } - VolumeIntersectionValue TestAABB(const AABB& aabb, const Matrix4& localToWorld) const - { - debug_count_oriented_bbox(); - return frustum_intersects_transformed_aabb(m_frustum, aabb, localToWorld); - } - - const Matrix4& GetViewMatrix() const - { - return m_viewproj; - } - const Matrix4& GetViewport() const - { - return m_viewport; - }; - const Matrix4& GetModelview() const - { - return m_modelview; - } - const Matrix4& GetProjection() const - { - return m_projection; - } - - bool fill() const - { - return m_fill; - } - const Vector3& getViewer() const - { - return vector4_to_vector3(m_viewer); - } -}; - -#endif diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index e2cc86c3..2c85e57a 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -33,221 +33,34 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // DESCRIPTION: // monitoring window for running BSP processes (and possibly various other stuff) +#include "stdafx.h" #include "watchbsp.h" - -#include -#include - -#include "cmdlib.h" -#include "convert.h" -#include "string/string.h" -#include "stream/stringstream.h" - -#include "gtkutil/messagebox.h" -#include "xmlstuff.h" -#include "console.h" -#include "preferences.h" -#include "points.h" #include "feedback.h" -#include "mainframe.h" -#include "sockets.h" -void message_flush(message_info_t* self) -{ - Sys_Print(self->msg_level, self->m_buffer, self->m_length); - self->m_length = 0; -} +#ifdef _WIN32 +#include +#endif -void message_print(message_info_t* self, const char* characters, std::size_t length) -{ - const char* end = characters + length; - while(characters != end) - { - std::size_t space = message_info_t::bufsize - 1 - self->m_length; - if(space == 0) - { - message_flush(self); - } - else - { - std::size_t size = std::min(space, std::size_t(end - characters)); - memcpy(self->m_buffer + self->m_length, characters, size); - self->m_length += size; - characters += size; - } - } -} +#if defined (__linux__) || defined (__APPLE__) +#include +#define SOCKET_ERROR -1 +#endif +#ifdef __APPLE__ +#include +#endif -#include -#include -#include "xmlstuff.h" - -class CWatchBSP -{ -private: - // a flag we have set to true when using an external BSP plugin - // the resulting code with that is a bit dirty, cleaner solution would be to seperate the succession of commands from the listening loop - // (in two seperate classes probably) - bool m_bBSPPlugin; - - // EIdle: we are not listening - // DoMonitoringLoop will change state to EBeginStep - // EBeginStep: the socket is up for listening, we are expecting incoming connection - // incoming connection will change state to EWatching - // EWatching: we have a connection, monitor it - // connection closed will see if we start a new step (EBeginStep) or launch Quake3 and end (EIdle) - enum EWatchBSPState { EIdle, EBeginStep, EWatching } m_eState; - socket_t *m_pListenSocket; - socket_t *m_pInSocket; - netmessage_t msg; - GPtrArray *m_pCmd; - // used to timeout EBeginStep - GTimer *m_pTimer; - std::size_t m_iCurrentStep; - // name of the map so we can run the engine - char *m_sBSPName; - // buffer we use in push mode to receive data directly from the network - xmlParserInputBufferPtr m_xmlInputBuffer; - xmlParserInputPtr m_xmlInput; - xmlParserCtxtPtr m_xmlParserCtxt; - // call this to switch the set listening mode - bool SetupListening(); - // start a new EBeginStep - void DoEBeginStep(); - // the xml and sax parser state - char m_xmlBuf[MAX_NETMESSAGE]; - bool m_bNeedCtxtInit; - message_info_t m_message_info; - -public: - CWatchBSP() - { - m_pCmd = 0; - m_bBSPPlugin = false; - m_pListenSocket = NULL; - m_pInSocket = NULL; - m_eState = EIdle; - m_pTimer = g_timer_new(); - m_sBSPName = NULL; - m_xmlInputBuffer = NULL; - m_bNeedCtxtInit = true; - } - virtual ~CWatchBSP() - { - EndMonitoringLoop(); - Net_Shutdown(); - - g_timer_destroy(m_pTimer); - } - - bool HasBSPPlugin() const - { return m_bBSPPlugin; } - - // called regularly to keep listening - void RoutineProcessing(); - // start a monitoring loop with the following steps - void DoMonitoringLoop( GPtrArray *pCmd, const char *sBSPName ); - void EndMonitoringLoop() - { - Reset(); - if (m_sBSPName) - { - string_release(m_sBSPName, string_length(m_sBSPName)); - m_sBSPName = 0; - } - if(m_pCmd) - { - g_ptr_array_free(m_pCmd, TRUE); - m_pCmd = 0; - } - } - // close everything - may be called from the outside to abort the process - void Reset(); - // start a listening loop for an external process, possibly a BSP plugin - void ExternalListen(); -}; - -CWatchBSP* g_pWatchBSP; - - // watch the BSP process through network connections - // true: trigger the BSP steps one by one and monitor them through the network - // false: create a BAT / .sh file and execute it. don't bother monitoring it. -bool g_WatchBSP_Enabled = true; - // do we stop the compilation process if we come accross a leak? -bool g_WatchBSP_LeakStop = true; -bool g_WatchBSP_RunQuake = false; - // store prefs setting for automatic sleep mode activation -bool g_WatchBSP_DoSleep = true; - // timeout when beginning a step (in seconds) - // if we don't get a connection quick enough we assume something failed and go back to idling -int g_WatchBSP_Timeout = 10; - - -void Build_constructPreferences(PreferencesPage& page) -{ - GtkWidget* monitorbsp = page.appendCheckBox("", "Enable Build Process Monitoring", g_WatchBSP_Enabled); - GtkWidget* leakstop = page.appendCheckBox("", "Stop Compilation on Leak", g_WatchBSP_LeakStop); - GtkWidget* runengine = page.appendCheckBox("", "Run Engine After Compile", g_WatchBSP_RunQuake); - GtkWidget* sleep = page.appendCheckBox("", "Sleep When Running the Engine", g_WatchBSP_DoSleep); - Widget_connectToggleDependency(leakstop, monitorbsp); - Widget_connectToggleDependency(runengine, monitorbsp); - Widget_connectToggleDependency(sleep, runengine); -} -void Build_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Build", "Build Preferences")); - Build_constructPreferences(page); -} -void Build_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - -#include "preferencesystem.h" -#include "stringio.h" - -void BuildMonitor_Construct() -{ - g_pWatchBSP = new CWatchBSP(); - - g_WatchBSP_Enabled = !string_equal(g_pGameDescription->getKeyValue("no_bsp_monitor"), "1"); - - GlobalPreferenceSystem().registerPreference("WatchBSP", BoolImportStringCaller(g_WatchBSP_Enabled), BoolExportStringCaller(g_WatchBSP_Enabled)); - GlobalPreferenceSystem().registerPreference("RunQuake2Run", BoolImportStringCaller(g_WatchBSP_RunQuake), BoolExportStringCaller(g_WatchBSP_RunQuake)); - GlobalPreferenceSystem().registerPreference("LeakStop", BoolImportStringCaller(g_WatchBSP_LeakStop), BoolExportStringCaller(g_WatchBSP_LeakStop)); - GlobalPreferenceSystem().registerPreference("SleepMode", BoolImportStringCaller(g_WatchBSP_DoSleep), BoolExportStringCaller(g_WatchBSP_DoSleep)); - - Build_registerPreferencesPage(); -} - -void BuildMonitor_Destroy() -{ - delete g_pWatchBSP; -} - -CWatchBSP *GetWatchBSP() -{ - return g_pWatchBSP; -} - -void BuildMonitor_Run(GPtrArray* commands, const char* mapName) -{ - GetWatchBSP()->DoMonitoringLoop(commands, mapName); -} - +#include // Static functions for the SAX callbacks ------------------------------------------------------- // utility for saxStartElement below static void abortStream(message_info_t *data) { - GetWatchBSP()->EndMonitoringLoop(); + g_pParentWnd->GetWatchBSP()->Reset(); // tell there has been an error -#if 0 - if (GetWatchBSP()->HasBSPPlugin()) + if (g_pParentWnd->GetWatchBSP()->HasBSPPlugin ()) g_BSPFrontendTable.m_pfnEndListen(2); -#endif // yeah this doesn't look good.. but it's needed so that everything will be ignored until the stream goes out data->ignore_depth = -1; data->recurse++; @@ -257,91 +70,72 @@ static void abortStream(message_info_t *data) static void saxStartElement(message_info_t *data, const xmlChar *name, const xmlChar **attrs) { -#if 0 - globalOutputStream() << "<" << name; - if(attrs != 0) - { - for(const xmlChar** p = attrs; *p != 0; p += 2) - { - globalOutputStream() << " " << p[0] << "=" << makeQuoted(p[1]); - } - } - globalOutputStream() << ">\n"; -#endif - if (data->ignore_depth == 0) { - if(data->pGeometry != 0) + if (data->bGeometry) // we have a handler { data->pGeometry->saxStartElement (data, name, attrs); } else { - if (strcmp(reinterpret_cast(name), "q3map_feedback") == 0) + if (strcmp ((char *)name, "q3map_feedback") == 0) { // check the correct version // old q3map don't send a version attribute // the ones we support .. send Q3MAP_STREAM_VERSION - if (!attrs[0] || !attrs[1] || (strcmp(reinterpret_cast(attrs[0]), "version") != 0)) + if (!attrs[0] || !attrs[1] || (strcmp((char*)attrs[0],"version") != 0)) { - message_flush(data); - globalErrorStream() << "No stream version given in the feedback stream, this is an old q3map version.\n" - "Please turn off monitored compiling if you still wish to use this q3map executable\n"; + Sys_FPrintf(SYS_ERR, "No stream version given in the feedback stream, this is an old q3map version.\n" + "Please turn off monitored compiling if you still wish to use this q3map executable\n"); abortStream(data); return; } - else if (strcmp(reinterpret_cast(attrs[1]), Q3MAP_STREAM_VERSION) != 0) + else if (strcmp((char*)attrs[1],Q3MAP_STREAM_VERSION) != 0) { - message_flush(data); - globalErrorStream() << - "This version of Radiant reads version " Q3MAP_STREAM_VERSION " debug streams, I got an incoming connection with version " << reinterpret_cast(attrs[1]) << "\n" - "Please make sure your versions of Radiant and q3map are matching.\n"; + Sys_FPrintf(SYS_ERR, + "This version of Radiant reads version %s debug streams, I got an incoming connection with version %s\n" + "Please make sure your versions of Radiant and q3map are matching.\n", Q3MAP_STREAM_VERSION, (char*)attrs[1]); abortStream(data); return; } } // we don't treat locally - else if (strcmp(reinterpret_cast(name), "message") == 0) + else if (strcmp ((char *)name, "message") == 0) { - int msg_level = atoi(reinterpret_cast(attrs[1])); - if(msg_level != data->msg_level) - { - message_flush(data); - data->msg_level = msg_level; - } + data->msg_level = atoi ((char *)attrs[1]); } - else if (strcmp(reinterpret_cast(name), "polyline") == 0) + else if (strcmp ((char *)name, "polyline") == 0) // polyline has a particular status .. right now we only use it for leakfile .. { - data->geometry_depth = data->recurse; + data->bGeometry = true; data->pGeometry = &g_pointfile; - data->pGeometry->saxStartElement (data, name, attrs); + data->pGeometry->saxStartElement( data, name, attrs ); } - else if (strcmp(reinterpret_cast(name), "select") == 0) + else if (strcmp ((char *)name, "select") == 0) { CSelectMsg *pSelect = new CSelectMsg(); - data->geometry_depth = data->recurse; + data->bGeometry = true; data->pGeometry = pSelect; - data->pGeometry->saxStartElement (data, name, attrs); + data->pGeometry->saxStartElement( data, name, attrs ); } - else if (strcmp(reinterpret_cast(name), "pointmsg") == 0) + else if (strcmp ((char *)name, "pointmsg") == 0) { CPointMsg *pPoint = new CPointMsg(); - data->geometry_depth = data->recurse; + data->bGeometry = true; data->pGeometry = pPoint; - data->pGeometry->saxStartElement (data, name, attrs); + data->pGeometry->saxStartElement( data, name, attrs ); } - else if (strcmp(reinterpret_cast(name), "windingmsg") == 0) + else if (strcmp ((char *)name, "windingmsg") == 0) { CWindingMsg *pWinding = new CWindingMsg(); - data->geometry_depth = data->recurse; + data->bGeometry = true; data->pGeometry = pWinding; - data->pGeometry->saxStartElement (data, name, attrs); + data->pGeometry->saxStartElement( data, name, attrs ); } else { - globalErrorStream() << "Warning: ignoring unrecognized node in XML stream (" << reinterpret_cast(name) << ")\n"; + Sys_FPrintf (SYS_WRN, "WARNING: ignoring unrecognized node in XML stream (%s)\n", name); // we don't recognize this node, jump over it // (NOTE: the ignore mechanism is a bit screwed, only works when starting an ignore at the highest level) data->ignore_depth = data->recurse; @@ -351,92 +145,60 @@ static void saxStartElement(message_info_t *data, const xmlChar *name, const xml data->recurse++; } -static void saxEndElement(message_info_t *data, const xmlChar *name) -{ -#if 0 - globalOutputStream() << "<" << name << "/>\n"; -#endif - - data->recurse--; - // we are out of an ignored chunk - if(data->recurse == data->ignore_depth) - { - data->ignore_depth = 0; - return; - } - if(data->pGeometry != 0) - { - data->pGeometry->saxEndElement (data, name); - // we add the object to the debug window - if(data->geometry_depth == data->recurse) - { - g_DbgDlg.Push(data->pGeometry); - data->pGeometry = 0; - } - } - if (data->recurse == data->stop_depth) - { - message_flush(data); +static void saxEndElement(message_info_t *data, const xmlChar *name) { + data->recurse--; + // we are out of an ignored chunk + if ( data->recurse == data->ignore_depth ) { + data->ignore_depth = 0; + return; + } + if ( data->bGeometry ) { + data->pGeometry->saxEndElement( data, name ); + // we add the object to the debug window + if ( !data->bGeometry ) { + g_DbgDlg.Push( data->pGeometry ); + } + } + if ( data->recurse == data->stop_depth ) { #ifdef _DEBUG - globalOutputStream() << "Received error msg .. shutting down..\n"; + Sys_Printf ("Received error msg .. shutting down..\n"); #endif - GetWatchBSP()->EndMonitoringLoop(); - // tell there has been an error -#if 0 - if (GetWatchBSP()->HasBSPPlugin()) - g_BSPFrontendTable.m_pfnEndListen(2); -#endif - return; - } -} - -class MessageOutputStream : public TextOutputStream -{ - message_info_t* m_data; -public: - MessageOutputStream(message_info_t* data) : m_data(data) - { - } - std::size_t write(const char* buffer, std::size_t length) - { - if(m_data->pGeometry != 0) - { - m_data->pGeometry->saxCharacters(m_data, reinterpret_cast(buffer), int(length)); - } - else - { - if (m_data->ignore_depth == 0) - { - // output the message using the level - message_print(m_data, buffer, length); - // if this message has error level flag, we mark the depth to stop the compilation when we get out - // we don't set the msg level if we don't stop on leak - if (m_data->msg_level == 3) - { - m_data->stop_depth = m_data->recurse-1; - } - } - } - - return length; - } -}; - -template -inline MessageOutputStream& operator<<(MessageOutputStream& ostream, const T& t) -{ - return ostream_write(ostream, t); + g_pParentWnd->GetWatchBSP()->Reset(); + // tell there has been an error + if ( g_pParentWnd->GetWatchBSP()->HasBSPPlugin() ) { + g_BSPFrontendTable.m_pfnEndListen( 2 ); + } + return; + } } static void saxCharacters(message_info_t *data, const xmlChar *ch, int len) { - MessageOutputStream ostream(data); - ostream << ConvertUTF8ToLocale(StringRange(reinterpret_cast(ch), reinterpret_cast(ch + len))); + if (data->bGeometry) + { + data->pGeometry->saxCharacters (data, ch, len); + } + else + { + if (data->ignore_depth != 0) + return; + // output the message using the level + char buf[1024]; + memcpy( buf, ch, len ); + buf[len] = '\0'; + Sys_FPrintf (data->msg_level, "%s", buf); + // if this message has error level flag, we mark the depth to stop the compilation when we get out + // we don't set the msg level if we don't stop on leak + if (data->msg_level == 3) + { + data->stop_depth = data->recurse-1; + } + } } static void saxComment(void *ctx, const xmlChar *msg) { - globalOutputStream() << "XML comment: " << reinterpret_cast(msg) << "\n"; + Sys_Printf("XML comment: %s\n", msg); } static void saxWarning(void *ctx, const char *msg, ...) @@ -447,7 +209,7 @@ static void saxWarning(void *ctx, const char *msg, ...) va_start(args, msg); vsprintf (saxMsgBuffer, msg, args); va_end(args); - globalOutputStream() << "XML warning: " << saxMsgBuffer << "\n"; + Sys_FPrintf(SYS_WRN, "XML warning: %s\n", saxMsgBuffer); } static void saxError(void *ctx, const char *msg, ...) @@ -458,7 +220,7 @@ static void saxError(void *ctx, const char *msg, ...) va_start(args, msg); vsprintf (saxMsgBuffer, msg, args); va_end(args); - globalErrorStream() << "XML error: " << saxMsgBuffer << "\n"; + Sys_FPrintf(SYS_ERR, "XML error: %s\n", saxMsgBuffer); } static void saxFatal(void *ctx, const char *msg, ...) @@ -470,7 +232,7 @@ static void saxFatal(void *ctx, const char *msg, ...) va_start(args, msg); vsprintf (buffer, msg, args); va_end(args); - globalErrorStream() << "XML fatal error: " << buffer << "\n"; + Sys_FPrintf(SYS_ERR, "XML fatal error: %s\n", buffer); } static xmlSAXHandler saxParser = { @@ -498,24 +260,19 @@ static xmlSAXHandler saxParser = { (warningSAXFunc)saxWarning, /* warning */ (errorSAXFunc)saxError, /* error */ (fatalErrorSAXFunc)saxFatal, /* fatalError */ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 }; // ------------------------------------------------------------------------------------------------ - -guint s_routine_id; -static gint watchbsp_routine(gpointer data) +CWatchBSP::~CWatchBSP() { - reinterpret_cast(data)->RoutineProcessing(); - return TRUE; + Reset(); + if (m_sBSPName) + { + delete[] m_sBSPName; + m_sBSPName = NULL; + } + Net_Shutdown(); } void CWatchBSP::Reset() @@ -536,8 +293,6 @@ void CWatchBSP::Reset() m_xmlInputBuffer = NULL; } m_eState = EIdle; - if (s_routine_id) - gtk_timeout_remove(s_routine_id); } bool CWatchBSP::SetupListening() @@ -545,148 +300,87 @@ bool CWatchBSP::SetupListening() #ifdef _DEBUG if (m_pListenSocket) { - globalOutputStream() << "ERROR: m_pListenSocket != NULL in CWatchBSP::SetupListening\n"; + Sys_Printf("ERROR: m_pListenSocket != NULL in CWatchBSP::SetupListening\n"); return false; } #endif - globalOutputStream() << "Setting up\n"; - Net_Setup(); - m_pListenSocket = Net_ListenSocket(39000); + Sys_Printf("Setting up\n"); + if( !Net_Setup() ) + return false; + + m_pListenSocket = Net_ListenSocket(39000); if (m_pListenSocket == NULL) return false; - globalOutputStream() << "Listening...\n"; + + Sys_Printf("Listening...\n"); return true; } -void CWatchBSP::DoEBeginStep() -{ - Reset(); - if (SetupListening() == false) - { - const char* msg = "Failed to get a listening socket on port 39000.\nTry running with Build monitoring disabled if you can't fix this.\n"; - globalOutputStream() << msg; - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), msg, "Build monitoring", eMB_OK, eMB_ICONERROR); - return; - } - // set the timer for timeouts and step cancellation - g_timer_reset( m_pTimer ); - g_timer_start( m_pTimer ); +void CWatchBSP::DoEBeginStep() { + Reset(); + if ( !SetupListening() ) { + CString msg; + msg = "Failed to get a listening socket on port 39000.\nTry running with BSP monitoring disabled if you can't fix this.\n"; + Sys_Printf( msg ); + gtk_MessageBox( g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR ); + return; + } + // set the timer for timeouts and step cancellation + g_timer_reset( m_pTimer ); + g_timer_start( m_pTimer ); - if (!m_bBSPPlugin) - { - globalOutputStream() << "=== running build command ===\n" - << static_cast(g_ptr_array_index( m_pCmd, m_iCurrentStep )) << "\n"; - - if (!Q_Exec(NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true )) - { - StringOutputStream msg(256); - msg << "Failed to execute the following command: "; - msg << reinterpret_cast(g_ptr_array_index(m_pCmd, m_iCurrentStep)); - msg << "\nCheck that the file exists and that you don't run out of system resources.\n"; - globalOutputStream() << msg.c_str(); - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), msg.c_str(), "Build monitoring", eMB_OK, eMB_ICONERROR ); - return; - } - // re-initialise the debug window - if (m_iCurrentStep == 0) - g_DbgDlg.Init(); - } - m_eState = EBeginStep; - s_routine_id = gtk_timeout_add(25, watchbsp_routine, this); + if ( !m_bBSPPlugin ) { + Sys_Printf( "=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) ); + + if ( !Q_Exec( NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true ) ) { + CString msg; + msg = "Failed to execute the following command: "; + msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ); + msg += "\nCheck that the file exists and that you don't run out of system resources.\n"; + Sys_Printf( msg ); + gtk_MessageBox( g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR ); + return; + } + // re-initialise the debug window + if ( m_iCurrentStep == 0 ) { + g_DbgDlg.Init(); + } + } + m_eState = EBeginStep; } - -#if defined(WIN32) -#define ENGINE_ATTRIBUTE "engine_win32" -#define MP_ENGINE_ATTRIBUTE "mp_engine_win32" -#elif defined(__linux__) || defined (__FreeBSD__) -#define ENGINE_ATTRIBUTE "engine_linux" -#define MP_ENGINE_ATTRIBUTE "mp_engine_linux" -#elif defined(__APPLE__) -#define ENGINE_ATTRIBUTE "engine_macos" -#define MP_ENGINE_ATTRIBUTE "mp_engine_macos" -#else -#error "unsupported platform" -#endif - -class RunEngineConfiguration -{ -public: - const char* executable; - const char* mp_executable; - bool do_sp_mp; - - RunEngineConfiguration() : - executable(g_pGameDescription->getRequiredKeyValue(ENGINE_ATTRIBUTE)), - mp_executable(g_pGameDescription->getKeyValue(MP_ENGINE_ATTRIBUTE)) - { - do_sp_mp = !string_empty(mp_executable); - } -}; - -inline void GlobalGameDescription_string_write_mapparameter(StringOutputStream& string, const char* mapname) -{ - if(g_pGameDescription->mGameType == "q2" - || g_pGameDescription->mGameType == "heretic2") - { - string << ". +exec radiant.cfg +map " << mapname; - } - else - { - string << "+set sv_pure 0 "; - // TTimo: a check for vm_* but that's all fine - //cmdline = "+set sv_pure 0 +set vm_ui 0 +set vm_cgame 0 +set vm_game 0 "; - const char* fs_game = gamename_get(); - if (!string_equal(fs_game, basegame_get())) - { - string << "+set fs_game " << fs_game << " "; - } - if(g_pGameDescription->mGameType == "wolf" - || g_pGameDescription->mGameType == "et") - { - if (string_equal(gamemode_get(), "mp")) - { - // MP - string << "+devmap " << mapname; - } - else - { - // SP - string << "+set nextmap \"spdevmap " << mapname << "\""; - } - } - else - { - string << "+devmap " << mapname; - } - } -} - - void CWatchBSP::RoutineProcessing() { + // used for select() +#ifdef _WIN32 + TIMEVAL tout = { 0, 0 }; +#endif +#if defined (__linux__) || defined (__APPLE__) + timeval tout; + tout.tv_sec = 0; + tout.tv_usec = 0; +#endif + switch (m_eState) { case EBeginStep: // timeout: if we don't get an incoming connection fast enough, go back to idle - if ( g_timer_elapsed( m_pTimer, NULL ) > g_WatchBSP_Timeout ) + if ( g_timer_elapsed( m_pTimer, NULL ) > g_PrefsDlg.m_iTimeout ) { - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), "The connection timed out, assuming the build process failed\nMake sure you are using a networked version of Q3Map?\nOtherwise you need to disable BSP Monitoring in prefs.", "BSP process monitoring", eMB_OK ); - EndMonitoringLoop(); -#if 0 + gtk_MessageBox(g_pParentWnd->m_pWidget, "The connection timed out, assuming the BSP process failed\nMake sure you are using a networked version of Q3Map?\nOtherwise you need to disable BSP Monitoring in prefs.", "BSP process monitoring", MB_OK ); + Reset(); if (m_bBSPPlugin) { // status == 1 : didn't get the connection g_BSPFrontendTable.m_pfnEndListen(1); } -#endif return; } #ifdef _DEBUG // some debug checks if (!m_pListenSocket) { - globalErrorStream() << "ERROR: m_pListenSocket == NULL in CWatchBSP::RoutineProcessing EBeginStep state\n"; + Sys_Printf("ERROR: m_pListenSocket == NULL in CWatchBSP::RoutineProcessing EBeginStep state\n"); return; } #endif @@ -694,34 +388,50 @@ void CWatchBSP::RoutineProcessing() m_pInSocket = Net_Accept(m_pListenSocket); if (m_pInSocket) { - globalOutputStream() << "Connected.\n"; + Sys_Printf("Connected.\n"); // prepare the message info struct for diving in - memset (&m_message_info, 0, sizeof(message_info_t)); + memset (&m_message_info, 0, sizeof(message_info_s)); // a dumb flag to make sure we init the push parser context when first getting a msg m_bNeedCtxtInit = true; m_eState = EWatching; } break; case EWatching: - { #ifdef _DEBUG // some debug checks if (!m_pInSocket) { - globalErrorStream() << "ERROR: m_pInSocket == NULL in CWatchBSP::RoutineProcessing EWatching state\n"; + Sys_Printf("ERROR: m_pInSocket == NULL in CWatchBSP::RoutineProcessing EWatching state\n"); return; } #endif - - int ret = Net_Wait(m_pInSocket, 0, 0); - if (ret == -1) + // select() will identify if the socket needs an update + // if the socket is identified that means there's either a message or the connection has been closed/reset/terminated + fd_set readfds; + int ret; + FD_ZERO(&readfds); + FD_SET(((unsigned int)m_pInSocket->socket), &readfds); + // from select man page: + // n is the highest-numbered descriptor in any of the three sets, plus 1 + // (no use on windows) + ret = select( m_pInSocket->socket + 1, &readfds, NULL, NULL, &tout ); + if (ret == SOCKET_ERROR) { - globalOutputStream() << "WARNING: SOCKET_ERROR in CWatchBSP::RoutineProcessing\n"; - globalOutputStream() << "Terminating the connection.\n"; - EndMonitoringLoop(); + Sys_Printf("WARNING: SOCKET_ERROR in CWatchBSP::RoutineProcessing\n"); + Sys_Printf("Terminating the connection.\n"); + Reset(); return; } - +#ifdef _DEBUG + if (ret == -1) + { + // we are non-blocking?? we should never get timeout errors + Sys_Printf("WARNING: unexpected timeout expired in CWatchBSP::Processing\n"); + Sys_Printf("Terminating the connection.\n"); + Reset(); + return; + } +#endif if (ret == 1) { // the socket has been identified, there's something (message or disconnection) @@ -734,37 +444,33 @@ void CWatchBSP::RoutineProcessing() if (m_bNeedCtxtInit) { m_xmlParserCtxt = NULL; - m_xmlParserCtxt = xmlCreatePushParserCtxt (&saxParser, &m_message_info, m_xmlBuf, static_cast(strlen(m_xmlBuf)), NULL); - + m_xmlParserCtxt = xmlCreatePushParserCtxt (&saxParser, &m_message_info, m_xmlBuf, strlen(m_xmlBuf), NULL); if (m_xmlParserCtxt == NULL) { - globalErrorStream() << "Failed to create the XML parser (incoming stream began with: " << m_xmlBuf << ")\n"; - EndMonitoringLoop(); + Sys_FPrintf (SYS_ERR, "Failed to create the XML parser (incoming stream began with: %s)\n", m_xmlBuf); + Reset(); } m_bNeedCtxtInit = false; } else { - xmlParseChunk(m_xmlParserCtxt, m_xmlBuf, static_cast(strlen(m_xmlBuf)), 0); + xmlParseChunk (m_xmlParserCtxt, m_xmlBuf, strlen(m_xmlBuf), 0); } } else { - message_flush(&m_message_info); // error or connection closed/reset // NOTE: if we get an error down the XML stream we don't reach here Net_Disconnect( m_pInSocket ); m_pInSocket = NULL; - globalOutputStream() << "Connection closed.\n"; -#if 0 + Sys_Printf("Connection closed.\n"); if (m_bBSPPlugin) { - EndMonitoringLoop(); + Reset(); // let the BSP plugin know that the job is done g_BSPFrontendTable.m_pfnEndListen(0); return; } -#endif // move to next step or finish m_iCurrentStep++; if (m_iCurrentStep < m_pCmd->len ) @@ -773,92 +479,277 @@ void CWatchBSP::RoutineProcessing() } else { - // launch the engine .. OMG - if (g_WatchBSP_RunQuake) + // release the GPtrArray and the strings + if (m_pCmd != NULL) { -#if 0 - // do we enter sleep mode before? - if (g_WatchBSP_DoSleep) + for (m_iCurrentStep=0; m_iCurrentStep < m_pCmd->len; m_iCurrentStep++ ) { - globalOutputStream() << "Going into sleep mode..\n"; + delete[] (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ); + } + g_ptr_array_free( m_pCmd, false ); + } + m_pCmd = NULL; + // launch the engine .. OMG + if (g_PrefsDlg.m_bRunQuake) + { + // do we enter sleep mode before? + if (g_PrefsDlg.m_bDoSleep) + { + Sys_Printf("Going into sleep mode..\n"); g_pParentWnd->OnSleep(); } -#endif - globalOutputStream() << "Running engine...\n"; - StringOutputStream cmd(256); + Sys_Printf("Running engine...\n"); + Str cmd; // build the command line - cmd << EnginePath_get(); + cmd = g_pGameDescription->mEnginePath.GetBuffer(); // this is game dependant - - RunEngineConfiguration engineConfig; - - if(engineConfig.do_sp_mp) + //!\todo Read the engine binary name from a config file. + if (g_pGameDescription->mGameFile == "wolf.game") { - if (string_equal(gamemode_get(), "mp")) + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) { - cmd << engineConfig.mp_executable; + // MP +#if defined(WIN32) + cmd += "WolfMP.exe"; +#elif defined(__linux__) + cmd += "wolfmp"; +#elif defined(__APPLE__) + cmd += "wolfmp.app"; +#else +#error "WTF are you compiling on" +#endif } else { - cmd << engineConfig.executable; + // SP +#if defined(WIN32) + cmd += "WolfSP.exe"; +#elif defined(__linux__) + cmd += "wolfsp"; +#elif defined(__APPLE__) + cmd += "wolfsp.app"; +#else +#error "WTF are you compiling on" +#endif + } + } else if (g_pGameDescription->mGameFile == "et.game") + { +#if defined(WIN32) + cmd += "et.exe"; +#elif defined(__linux__) + cmd += "et"; +#elif defined(__APPLE__) + cmd += "et.app"; +#else +#error "WTF are you compiling on" +#endif + } + // RIANT + // JK2 HACK + else if (g_pGameDescription->mGameFile == "jk2.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) + { + // MP +#if defined(WIN32) + cmd += "jk2MP.exe"; +#elif defined(__linux__) + cmd += "jk2mp"; +#elif defined(__APPLE__) + cmd += "jk2mp.app"; +#else +#error "WTF are you compiling on" +#endif + } + else + { + // SP +#if defined(WIN32) + cmd += "jk2SP.exe"; +#elif defined(__linux__) + cmd += "jk2sp"; +#elif defined(__APPLE__) + cmd += "jk2sp.app"; +#else +#error "WTF are you compiling on" +#endif + } + } + // TTimo + // JA HACK + else if (g_pGameDescription->mGameFile == "ja.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) + { + // MP +#if defined(WIN32) + cmd += "jamp.exe"; +#elif !defined(__linux__) && !defined(__APPLE__) +#error "WTF are you compiling on" +#endif + } + else + { + // SP +#if defined(WIN32) + cmd += "jasp.exe"; +#elif !defined(__linux__) && !defined(__APPLE__) +#error "WTF are you compiling on" +#endif + } + } + // RIANT + // STVEF HACK + else if (g_pGameDescription->mGameFile == "stvef.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) + { + // MP +#if defined(WIN32) + cmd += "stvoyHM.exe"; +#elif defined(__linux__) + cmd += "stvoyHM"; +#elif defined(__APPLE__) + cmd += "stvoyHM.app"; +#else +#error "WTF are you compiling on" +#endif + } + else + { + // SP +#if defined(WIN32) + cmd += "stvoy.exe"; +#elif defined(__linux__) + cmd += "stvoy"; +#elif defined(__APPLE__) + cmd += "stvoy.app"; +#else +#error "WTF are you compiling on" +#endif + } + } + // RIANT + // SOF2 HACK + else if (g_pGameDescription->mGameFile == "sof2.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) + { + // MP +#if defined(WIN32) + cmd += "sof2MP.exe"; +#elif defined(__linux__) + cmd += "b00gus"; +#elif defined(__APPLE__) + cmd += "sof2MP.app"; +#else +#error "WTF are you compiling on" +#endif + } + else + { + // SP +#if defined(WIN32) + cmd += "sof2.exe"; +#elif defined(__linux__) + cmd += "b00gus"; +#elif defined(__APPLE__) + cmd += "sof2.app"; +#else +#error "WTF are you compiling on" +#endif } } else { - cmd << engineConfig.executable; + cmd += g_pGameDescription->mEngine.GetBuffer(); + } +#ifdef _WIN32 + // NOTE: we are using unix pathnames and CreateProcess doesn't like / in the program path + FindReplace( cmd, "/", "\\" ); +#endif + Str cmdline; + if ( (g_pGameDescription->mGameFile == "q2.game") || (g_pGameDescription->mGameFile == "heretic2.game") ) + { + cmdline = ". +exec radiant.cfg +map "; + cmdline += m_sBSPName; + } + else + { + cmdline = "+set sv_pure 0 "; + // TTimo: a check for vm_* but that's all fine + //cmdline = "+set sv_pure 0 +set vm_ui 0 +set vm_cgame 0 +set vm_game 0 "; + if (*ValueForKey(g_qeglobals.d_project_entity, "gamename") != '\0') + { + cmdline += "+set fs_game "; + cmdline += ValueForKey(g_qeglobals.d_project_entity, "gamename"); + cmdline += " "; + } + //!\todo Read the start-map args from a config file. + if (g_pGameDescription->mGameFile == "wolf.game") + { + if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) + { + // MP + cmdline += "+devmap "; + cmdline += m_sBSPName; + } + else + { + // SP + cmdline += "+set nextmap \"spdevmap "; + cmdline += m_sBSPName; + cmdline += "\""; + } + } + else + { + cmdline += "+devmap "; + cmdline += m_sBSPName; + } } - StringOutputStream cmdline; - - GlobalGameDescription_string_write_mapparameter(cmdline, m_sBSPName); - - globalOutputStream() << cmd.c_str() << " " << cmdline.c_str() << "\n"; + Sys_Printf("%s %s\n", cmd.GetBuffer(), cmdline.GetBuffer()); // execute now - if (!Q_Exec(cmd.c_str(), (char *)cmdline.c_str(), EnginePath_get(), false)) + if (!Q_Exec(cmd.GetBuffer(), (char *)cmdline.GetBuffer(), g_pGameDescription->mEnginePath.GetBuffer(), false)) { - StringOutputStream msg; - msg << "Failed to execute the following command: " << cmd.c_str() << cmdline.c_str(); - globalOutputStream() << msg.c_str(); - gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), msg.c_str(), "Build monitoring", eMB_OK, eMB_ICONERROR ); + CString msg; + msg = "Failed to execute the following command: "; + msg += cmd; msg += cmdline; + Sys_Printf(msg); + gtk_MessageBox(g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR ); } } - EndMonitoringLoop(); + Reset(); } } } - } break; default: break; } } -GPtrArray* str_ptr_array_clone(GPtrArray* array) +void CWatchBSP::DoMonitoringLoop( GPtrArray *pCmd, char *sBSPName ) { - GPtrArray* cloned = g_ptr_array_sized_new(array->len); - for(guint i = 0; i < array->len; ++i) + if (m_sBSPName) { - g_ptr_array_add(cloned, g_strdup((char*)g_ptr_array_index(array, i))); + delete[] m_sBSPName; } - return cloned; -} - -void CWatchBSP::DoMonitoringLoop( GPtrArray *pCmd, const char *sBSPName ) -{ - m_sBSPName = string_clone(sBSPName); + m_sBSPName = sBSPName; if (m_eState != EIdle) { - globalOutputStream() << "WatchBSP got a monitoring request while not idling...\n"; + Sys_Printf("WatchBSP got a monitoring request while not idling...\n"); // prompt the user, should we cancel the current process and go ahead? - if (gtk_MessageBox(GTK_WIDGET(MainFrame_getWindow()), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?", - "Build process monitoring", eMB_YESNO ) == eIDYES) + if (gtk_MessageBox(g_pParentWnd->m_pWidget, "I am already monitoring a BSP process.\nDo you want me to override and start a new compilation?", + "BSP process monitoring", MB_YESNO ) == IDYES) { // disconnect and set EIdle state Reset(); } } - m_pCmd = str_ptr_array_clone(pCmd); + m_pCmd = pCmd; m_iCurrentStep = 0; DoEBeginStep(); } @@ -866,14 +757,14 @@ void CWatchBSP::DoMonitoringLoop( GPtrArray *pCmd, const char *sBSPName ) void CWatchBSP::ExternalListen() { m_bBSPPlugin = true; - DoEBeginStep(); + DoEBeginStep (); } // the part of the watchbsp interface we export to plugins // NOTE: in the long run, the whole watchbsp.cpp interface needs to go out and be handled at the BSP plugin level // for now we provide something really basic and limited, the essential is to have something that works fine and fast (for 1.1 final) -void QERApp_Listen() +void WINAPI QERApp_Listen() { // open the listening socket - GetWatchBSP()->ExternalListen(); + g_pParentWnd->GetWatchBSP()->ExternalListen(); } diff --git a/radiant/watchbsp.h b/radiant/watchbsp.h index ac6a2b22..dcf7dea5 100644 --- a/radiant/watchbsp.h +++ b/radiant/watchbsp.h @@ -28,16 +28,64 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(INCLUDED_WATCHBSP_H) -#define INCLUDED_WATCHBSP_H +#ifndef _BSPWINDOW_H_ +#define _BSPWINDOW_H_ -void BuildMonitor_Construct(); -void BuildMonitor_Destroy(); +#include "l_net/l_net.h" -typedef struct _GPtrArray GPtrArray; -void BuildMonitor_Run(GPtrArray* commands, const char* mapName); +class CWatchBSP +{ +private: + // a flag we have set to true when using an external BSP plugin + // the resulting code with that is a bit dirty, cleaner solution would be to seperate the succession of commands from the listening loop + // (in two seperate classes probably) + bool m_bBSPPlugin; -extern bool g_WatchBSP_Enabled; -extern bool g_WatchBSP_LeakStop; + // EIdle: we are not listening + // DoMonitoringLoop will change state to EBeginStep + // EBeginStep: the socket is up for listening, we are expecting incoming connection + // incoming connection will change state to EWatching + // EWatching: we have a connection, monitor it + // connection closed will see if we start a new step (EBeginStep) or launch Quake3 and end (EIdle) + enum EWatchBSPState { EIdle, EBeginStep, EWatching } m_eState; + socket_t *m_pListenSocket; + socket_t *m_pInSocket; + netmessage_t msg; + GPtrArray *m_pCmd; + // used to timeout EBeginStep + GTimer *m_pTimer; + unsigned int m_iCurrentStep; + // name of the map so we can run the engine + char *m_sBSPName; + // buffer we use in push mode to receive data directly from the network + xmlParserInputBufferPtr m_xmlInputBuffer; + xmlParserInputPtr m_xmlInput; + xmlParserCtxtPtr m_xmlParserCtxt; + // call this to switch the set listening mode + bool SetupListening(); + // start a new EBeginStep + void DoEBeginStep(); + // the xml and sax parser state + char m_xmlBuf[MAX_NETMESSAGE]; + bool m_bNeedCtxtInit; + message_info_s m_message_info; + +public: + CWatchBSP() { m_bBSPPlugin = false; m_pListenSocket = NULL; m_pInSocket = NULL; m_eState = EIdle; m_pTimer = g_timer_new(); m_sBSPName = NULL; m_xmlInputBuffer = NULL; m_bNeedCtxtInit = true; } + virtual ~CWatchBSP(); + bool HasBSPPlugin () const + { return m_bBSPPlugin; } + + // called regularly to keep listening + void RoutineProcessing(); + // start a monitoring loop with the following steps + void DoMonitoringLoop( GPtrArray *pCmd, char *sBSPName ); + // close everything - may be called from the outside to abort the process + void Reset(); + // start a listening loop for an external process, possibly a BSP plugin + void ExternalListen(); +}; + +void WINAPI QERApp_Listen(); #endif diff --git a/radiant/winding.cpp b/radiant/winding.cpp index bba89501..6fc608ca 100644 --- a/radiant/winding.cpp +++ b/radiant/winding.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,328 +19,804 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + + +#include "stdafx.h" +#include #include "winding.h" -#include +#define BOGUS_RANGE (g_MaxWorldCoord+1) -#include "math/line.h" +/* +============= +Plane_Equal +============= +*/ +#define NORMAL_EPSILON 0.0001 +#define DIST_EPSILON 0.02 - -inline double plane3_distance_to_point(const Plane3& plane, const DoubleVector3& point) +int Plane_Equal(plane_t *a, plane_t *b, int flip) { - return vector3_dot(point, plane.normal()) - plane.dist(); + vec3_t normal; + float dist; + + if (flip) { + normal[0] = - b->normal[0]; + normal[1] = - b->normal[1]; + normal[2] = - b->normal[2]; + dist = - b->dist; + } + else { + normal[0] = b->normal[0]; + normal[1] = b->normal[1]; + normal[2] = b->normal[2]; + dist = b->dist; + } + if ( + fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON + && fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON + && fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON + && fabs(a->dist - dist) < DIST_EPSILON ) + return true; + return false; } -inline double plane3_distance_to_point(const Plane3& plane, const Vector3& point) +/* +============ +Plane_FromPoints +============ +*/ +int Plane_FromPoints(vec3_t p1, vec3_t p2, vec3_t p3, plane_t *plane) { - return vector3_dot(point, plane.normal()) - plane.dist(); + vec3_t v1, v2; + + VectorSubtract(p2, p1, v1); + VectorSubtract(p3, p1, v2); + //CrossProduct(v2, v1, plane->normal); + CrossProduct(v1, v2, plane->normal); + if (VectorNormalize(plane->normal, plane->normal) < 0.1) return false; + plane->dist = DotProduct(p1, plane->normal); + return true; } -/// \brief Returns the point at which \p line intersects \p plane, or an undefined value if there is no intersection. -inline DoubleVector3 line_intersect_plane(const DoubleLine& line, const Plane3& plane) +/* +================= +Point_Equal +================= +*/ +int Point_Equal(vec3_t p1, vec3_t p2, float epsilon) { - return line.origin + vector3_scaled( - line.direction, - -plane3_distance_to_point(plane, line.origin) - / vector3_dot(line.direction, plane.normal()) - ); -} + int i; -inline bool float_is_largest_absolute(double axis, double other) -{ - return fabs(axis) > fabs(other); -} - -/// \brief Returns the index of the component of \p v that has the largest absolute value. -inline int vector3_largest_absolute_component_index(const DoubleVector3& v) -{ - return (float_is_largest_absolute(v[1], v[0])) - ? (float_is_largest_absolute(v[1], v[2])) - ? 1 - : 2 - : (float_is_largest_absolute(v[0], v[2])) - ? 0 - : 2; -} - -/// \brief Returns the infinite line that is the intersection of \p plane and \p other. -inline DoubleLine plane3_intersect_plane3(const Plane3& plane, const Plane3& other) -{ - DoubleLine line; - line.direction = vector3_cross(plane.normal(), other.normal()); - switch(vector3_largest_absolute_component_index(line.direction)) - { - case 0: - line.origin.x() = 0; - line.origin.y() = (-other.dist() * plane.normal().z() - -plane.dist() * other.normal().z()) / line.direction.x(); - line.origin.z() = (-plane.dist() * other.normal().y() - -other.dist() * plane.normal().y()) / line.direction.x(); - break; - case 1: - line.origin.x() = (-plane.dist() * other.normal().z() - -other.dist() * plane.normal().z()) / line.direction.y(); - line.origin.y() = 0; - line.origin.z() = (-other.dist() * plane.normal().x() - -plane.dist() * other.normal().x()) / line.direction.y(); - break; - case 2: - line.origin.x() = (-other.dist() * plane.normal().y() - -plane.dist() * other.normal().y()) / line.direction.z(); - line.origin.y() = (-plane.dist() * other.normal().x() - -other.dist() * plane.normal().x()) / line.direction.z(); - line.origin.z() = 0; - break; - default: - break; - } - - return line; + for (i = 0; i < 3; i++) + { + if (fabs(p1[i] - p2[i]) > epsilon) return false; + } + return true; } -/// \brief Keep the value of \p infinity as small as possible to improve precision in Winding_Clip. -void Winding_createInfinite(FixedWinding& winding, const Plane3& plane, double infinity) +/* +================= +Winding_BaseForPlane +================= +*/ +//#define DBG_WNDG +winding_t *Winding_BaseForPlane (plane_t *p) { - double max = -infinity; - int x = -1; - for (int i=0 ; i<3; i++) - { - double d = fabs(plane.normal()[i]); - if (d > max) - { - x = i; - max = d; - } - } - if(x == -1) - { - globalErrorStream() << "invalid plane\n"; - return; - } - - DoubleVector3 vup = g_vector3_identity; - switch (x) - { - case 0: - case 1: - vup[2] = 1; - break; - case 2: - vup[0] = 1; - break; - } + int i, x; + vec_t max, v; + vec3_t org, vright, vup; + winding_t *w; + + // find the major axis +#ifdef DBG_WNDG + Sys_Printf("Winding_BaseForPlane %p\n",p); +#endif + + max = -BOGUS_RANGE; + x = -1; + for (i=0 ; i<3; i++) + { + v = fabs(p->normal[i]); + if (v > max) + { + x = i; + max = v; + } + } + if (x==-1) + Error ("Winding_BaseForPlane: no axis found"); + + VectorCopy (vec3_origin, vup); + switch (x) + { + case 0: + case 1: + vup[2] = 1; + break; + case 2: + vup[0] = 1; + break; + } - vector3_add(vup, vector3_scaled(plane.normal(), -vector3_dot(vup, plane.normal()))); - vector3_normalise(vup); - - DoubleVector3 org = vector3_scaled(plane.normal(), plane.dist()); - - DoubleVector3 vright = vector3_cross(vup, plane.normal()); - - vector3_scale(vup, infinity); - vector3_scale(vright, infinity); + v = DotProduct (vup, p->normal); + VectorMA (vup, -v, p->normal, vup); + VectorNormalize (vup, vup); + + VectorScale (p->normal, p->dist, org); + + CrossProduct (vup, p->normal, vright); + + VectorScale (vup, BOGUS_RANGE, vup); + VectorScale (vright, BOGUS_RANGE, vright); - // project a really big axis aligned box onto the plane - - DoubleLine r1, r2, r3, r4; - r1.origin = vector3_added(vector3_subtracted(org, vright), vup); - r1.direction = vector3_normalised(vright); - winding.push_back(FixedWindingVertex(r1.origin, r1, c_brush_maxFaces)); - r2.origin = vector3_added(vector3_added(org, vright), vup); - r2.direction = vector3_normalised(vector3_negated(vup)); - winding.push_back(FixedWindingVertex(r2.origin, r2, c_brush_maxFaces)); - r3.origin = vector3_subtracted(vector3_added(org, vright), vup); - r3.direction = vector3_normalised(vector3_negated(vright)); - winding.push_back(FixedWindingVertex(r3.origin, r3, c_brush_maxFaces)); - r4.origin = vector3_subtracted(vector3_subtracted(org, vright), vup); - r4.direction = vector3_normalised(vup); - winding.push_back(FixedWindingVertex(r4.origin, r4, c_brush_maxFaces)); + // project a really big axis aligned box onto the plane + w = Winding_Alloc (4); + + VectorSubtract (org, vright, w->points[0]); + VectorAdd (w->points[0], vup, w->points[0]); + + VectorAdd (org, vright, w->points[1]); + VectorAdd (w->points[1], vup, w->points[1]); + + VectorAdd (org, vright, w->points[2]); + VectorSubtract (w->points[2], vup, w->points[2]); + + VectorSubtract (org, vright, w->points[3]); + VectorSubtract (w->points[3], vup, w->points[3]); + + w->numpoints = 4; + + return w; +} + +// macro to compute winding size +#define WINDING_SIZE(pt) (sizeof(int)*2+sizeof(float)*5*(pt)) + +/* +================== +Winding_Alloc +================== +*/ +winding_t *Winding_Alloc (int points) +{ + winding_t *w; + int size; + + if (points > MAX_POINTS_ON_WINDING) + Error ("Winding_Alloc: %i points", points); + +// size = (int)((winding_t *)0)->points[points]; + size = WINDING_SIZE(points); + w = (winding_t*) malloc (size); + memset (w, 0, size); + w->maxpoints = points; + + return w; +} + +void Winding_Free (winding_t *w) +{ + free(w); +} + +/* +================== +Winding_Clone +================== +*/ +winding_t *Winding_Clone(winding_t *w) +{ + int size; + winding_t *c; + +// size = (int)((winding_t *)0)->points[w->numpoints]; + size = WINDING_SIZE(w->numpoints); + c = (winding_t*)qmalloc (size); + memcpy (c, w, size); + return c; +} + +/* +================== +ReverseWinding +================== +*/ +winding_t *Winding_Reverse(winding_t *w) +{ + int i; + winding_t *c; + + c = Winding_Alloc(w->numpoints); + for (i = 0; i < w->numpoints; i++) + { + VectorCopy (w->points[w->numpoints-1-i], c->points[i]); + } + c->numpoints = w->numpoints; + return c; +} + +/* +============== +Winding_RemovePoint +============== +*/ +void Winding_RemovePoint(winding_t *w, int point) +{ + if (point < 0 || point >= w->numpoints) + Error("Winding_RemovePoint: point out of range"); + + if (point < w->numpoints-1) + { + memmove(&w->points[point], &w->points[point+1], (int)((winding_t *)0)->points[w->numpoints - point - 1]); + } + w->numpoints--; +} + +/* +============= +Winding_InsertPoint +============= +*/ +winding_t *Winding_InsertPoint(winding_t *w, vec3_t point, int spot) +{ + int i, j; + winding_t *neww; + + if (spot > w->numpoints) + { + Error("Winding_InsertPoint: spot > w->numpoints"); + } //end if + if (spot < 0) + { + Error("Winding_InsertPoint: spot < 0"); + } //end if + neww = Winding_Alloc(w->numpoints + 1); + neww->numpoints = w->numpoints + 1; + for (i = 0, j = 0; i < neww->numpoints; i++) + { + if (i == spot) + { + VectorCopy(point, neww->points[i]); + } + else + { + VectorCopy(w->points[j], neww->points[i]); + j++; + } + } + return neww; +} + +/* +============== +Winding_IsTiny +============== +*/ +#define EDGE_LENGTH 0.2 + +int Winding_IsTiny (winding_t *w) +{ + int i, j; + vec_t len; + vec3_t delta; + int edges; + + edges = 0; + for (i=0 ; inumpoints ; i++) + { + j = i == w->numpoints - 1 ? 0 : i+1; + VectorSubtract (w->points[j], w->points[i], delta); + len = VectorLength (delta); + if (len > EDGE_LENGTH) + { + if (++edges == 3) + return false; + } + } + return true; +} + +/* +============== +Winding_IsHuge +============== +*/ +int Winding_IsHuge(winding_t *w) +{ + int i, j; + + for (i=0 ; inumpoints ; i++) + { + for (j=0 ; j<3 ; j++) + if (w->points[i][j] < -BOGUS_RANGE+1 || w->points[i][j] > BOGUS_RANGE-1) + return true; + } + return false; +} + +/* +============= +Winding_PlanesConcave +============= +*/ +#define WCONVEX_EPSILON 0.2 + +int Winding_PlanesConcave(winding_t *w1, winding_t *w2, + vec3_t normal1, vec3_t normal2, + float dist1, float dist2) +{ + int i; + + if (!w1 || !w2) return false; + + // check if one of the points of winding 1 is at the back of the plane of winding 2 + for (i = 0; i < w1->numpoints; i++) + { + if (DotProduct(normal2, w1->points[i]) - dist2 > WCONVEX_EPSILON) return true; + } + // check if one of the points of winding 2 is at the back of the plane of winding 1 + for (i = 0; i < w2->numpoints; i++) + { + if (DotProduct(normal1, w2->points[i]) - dist1 > WCONVEX_EPSILON) return true; + } + + return false; +} + +/* +================== +Winding_Clip + +Clips the winding to the plane, returning the new winding on the positive side +Frees the input winding. +If keepon is true, an exactly on-plane winding will be saved, otherwise +it will be clipped away. +================== +*/ +winding_t *Winding_Clip (winding_t *in, plane_t *split, qboolean keepon) +{ + vec_t dists[MAX_POINTS_ON_WINDING]; + int sides[MAX_POINTS_ON_WINDING]; + int counts[3]; + vec_t dot; + int i, j; + vec_t *p1, *p2; + vec3_t mid; + winding_t *neww; + int maxpts; + + counts[0] = counts[1] = counts[2] = 0; + + // determine sides for each point + for (i=0 ; inumpoints ; i++) + { + dot = DotProduct (in->points[i], split->normal); + dot -= split->dist; + dists[i] = dot; + if (dot > ON_EPSILON) + sides[i] = SIDE_FRONT; + else if (dot < -ON_EPSILON) + sides[i] = SIDE_BACK; + else + { + sides[i] = SIDE_ON; + } + counts[sides[i]]++; + } + sides[i] = sides[0]; + dists[i] = dists[0]; + + if (keepon && !counts[0] && !counts[1]) + return in; + + if (!counts[0]) + { + Winding_Free (in); + return NULL; + } + if (!counts[1]) + return in; + + maxpts = in->numpoints+4; // can't use counts[0]+2 because + // of fp grouping errors + neww = Winding_Alloc (maxpts); + + for (i=0 ; inumpoints ; i++) + { + p1 = in->points[i]; + + if (sides[i] == SIDE_ON) + { + VectorCopy (p1, neww->points[neww->numpoints]); + neww->numpoints++; + continue; + } + + if (sides[i] == SIDE_FRONT) + { + VectorCopy (p1, neww->points[neww->numpoints]); + neww->numpoints++; + } + + if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i]) + continue; + + // generate a split point + p2 = in->points[(i+1)%in->numpoints]; + + dot = dists[i] / (dists[i]-dists[i+1]); + for (j=0 ; j<3 ; j++) + { // avoid round off error when possible + if (split->normal[j] == 1) + mid[j] = split->dist; + else if (split->normal[j] == -1) + mid[j] = -split->dist; + else + mid[j] = p1[j] + dot*(p2[j]-p1[j]); + } + + VectorCopy (mid, neww->points[neww->numpoints]); + neww->numpoints++; + } + + if (neww->numpoints > maxpts) + Error ("Winding_Clip: points exceeded estimate"); + + // free the original winding + Winding_Free (in); + + return neww; +} + +/* +============= +Winding_SplitEpsilon + + split the input winding with the plane + the input winding stays untouched +============= +*/ +void Winding_SplitEpsilon (winding_t *in, vec3_t normal, double dist, + vec_t epsilon, winding_t **front, winding_t **back) +{ + vec_t dists[MAX_POINTS_ON_WINDING+4]; + int sides[MAX_POINTS_ON_WINDING+4]; + int counts[3]; + vec_t dot; + int i, j; + vec_t *p1, *p2; + vec3_t mid; + winding_t *f, *b; + int maxpts; + + counts[0] = counts[1] = counts[2] = 0; + + // determine sides for each point + for (i = 0; i < in->numpoints; i++) + { + dot = DotProduct (in->points[i], normal); + dot -= dist; + dists[i] = dot; + if (dot > epsilon) + sides[i] = SIDE_FRONT; + else if (dot < -epsilon) + sides[i] = SIDE_BACK; + else + { + sides[i] = SIDE_ON; + } + counts[sides[i]]++; + } + sides[i] = sides[0]; + dists[i] = dists[0]; + + *front = *back = NULL; + + if (!counts[0]) + { + *back = Winding_Clone(in); + return; + } + if (!counts[1]) + { + *front = Winding_Clone(in); + return; + } + + maxpts = in->numpoints+4; // cant use counts[0]+2 because + // of fp grouping errors + + *front = f = Winding_Alloc (maxpts); + *back = b = Winding_Alloc (maxpts); + + for (i = 0; i < in->numpoints; i++) + { + p1 = in->points[i]; + + if (sides[i] == SIDE_ON) + { + VectorCopy (p1, f->points[f->numpoints]); + f->numpoints++; + VectorCopy (p1, b->points[b->numpoints]); + b->numpoints++; + continue; + } + + if (sides[i] == SIDE_FRONT) + { + VectorCopy (p1, f->points[f->numpoints]); + f->numpoints++; + } + if (sides[i] == SIDE_BACK) + { + VectorCopy (p1, b->points[b->numpoints]); + b->numpoints++; + } + + if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i]) + continue; + + // generate a split point + p2 = in->points[(i+1)%in->numpoints]; + + dot = dists[i] / (dists[i]-dists[i+1]); + for (j = 0; j < 3; j++) + { + // avoid round off error when possible + if (normal[j] == 1) + mid[j] = dist; + else if (normal[j] == -1) + mid[j] = -dist; + else + mid[j] = p1[j] + dot*(p2[j]-p1[j]); + } + + VectorCopy (mid, f->points[f->numpoints]); + f->numpoints++; + VectorCopy (mid, b->points[b->numpoints]); + b->numpoints++; + } + + if (f->numpoints > maxpts || b->numpoints > maxpts) + Error ("Winding_Clip: points exceeded estimate"); + if (f->numpoints > MAX_POINTS_ON_WINDING || b->numpoints > MAX_POINTS_ON_WINDING) + Error ("Winding_Clip: MAX_POINTS_ON_WINDING"); +} + +/* +============= +Winding_TryMerge + +If two windings share a common edge and the edges that meet at the +common points are both inside the other polygons, merge them + +Returns NULL if the windings couldn't be merged, or the new winding. +The originals will NOT be freed. + +if keep is true no points are ever removed +============= +*/ +#define CONTINUOUS_EPSILON 0.005 + +winding_t *Winding_TryMerge(winding_t *f1, winding_t *f2, vec3_t planenormal, int keep) +{ + vec_t *p1, *p2, *p3, *p4, *back; + winding_t *newf; + int i, j, k, l; + vec3_t normal, delta; + vec_t dot; + qboolean keep1, keep2; + + + // + // find a common edge + // + p1 = p2 = NULL; // stop compiler warning + j = 0; // + + for (i = 0; i < f1->numpoints; i++) + { + p1 = f1->points[i]; + p2 = f1->points[(i+1) % f1->numpoints]; + for (j = 0; j < f2->numpoints; j++) + { + p3 = f2->points[j]; + p4 = f2->points[(j+1) % f2->numpoints]; + for (k = 0; k < 3; k++) + { + if (fabs(p1[k] - p4[k]) > 0.1)//EQUAL_EPSILON) //ME + break; + if (fabs(p2[k] - p3[k]) > 0.1)//EQUAL_EPSILON) //ME + break; + } //end for + if (k==3) + break; + } //end for + if (j < f2->numpoints) + break; + } //end for + + if (i == f1->numpoints) + return NULL; // no matching edges + + // + // check slope of connected lines + // if the slopes are colinear, the point can be removed + // + back = f1->points[(i+f1->numpoints-1)%f1->numpoints]; + VectorSubtract (p1, back, delta); + CrossProduct (planenormal, delta, normal); + VectorNormalize (normal, normal); + + back = f2->points[(j+2)%f2->numpoints]; + VectorSubtract (back, p1, delta); + dot = DotProduct (delta, normal); + if (dot > CONTINUOUS_EPSILON) + return NULL; // not a convex polygon + keep1 = (qboolean)(dot < -CONTINUOUS_EPSILON); + + back = f1->points[(i+2)%f1->numpoints]; + VectorSubtract (back, p2, delta); + CrossProduct (planenormal, delta, normal); + VectorNormalize (normal, normal); + + back = f2->points[(j+f2->numpoints-1)%f2->numpoints]; + VectorSubtract (back, p2, delta); + dot = DotProduct (delta, normal); + if (dot > CONTINUOUS_EPSILON) + return NULL; // not a convex polygon + keep2 = (qboolean)(dot < -CONTINUOUS_EPSILON); + + // + // build the new polygon + // + newf = Winding_Alloc (f1->numpoints + f2->numpoints); + + // copy first polygon + for (k=(i+1)%f1->numpoints ; k != i ; k=(k+1)%f1->numpoints) + { + if (!keep && k==(i+1)%f1->numpoints && !keep2) + continue; + + VectorCopy (f1->points[k], newf->points[newf->numpoints]); + newf->numpoints++; + } + + // copy second polygon + for (l= (j+1)%f2->numpoints ; l != j ; l=(l+1)%f2->numpoints) + { + if (!keep && l==(j+1)%f2->numpoints && !keep1) + continue; + VectorCopy (f2->points[l], newf->points[newf->numpoints]); + newf->numpoints++; + } + + return newf; +} + +/* +============ +Winding_Plane +============ +*/ +void Winding_Plane (winding_t *w, vec3_t normal, double *dist) +{ + vec3_t v1, v2; + int i; + + //find two vectors each longer than 0.5 units + for (i = 0; i < w->numpoints; i++) + { + VectorSubtract(w->points[(i+1) % w->numpoints], w->points[i], v1); + VectorSubtract(w->points[(i+2) % w->numpoints], w->points[i], v2); + if (VectorLength(v1) > 0.5 && VectorLength(v2) > 0.5) break; + } + CrossProduct(v2, v1, normal); + VectorNormalize(normal, normal); + *dist = DotProduct(w->points[0], normal); +} + +/* +============= +Winding_Area +============= +*/ +float Winding_Area (winding_t *w) +{ + int i; + vec3_t d1, d2, cross; + float total; + + total = 0; + for (i=2 ; inumpoints ; i++) + { + VectorSubtract (w->points[i-1], w->points[0], d1); + VectorSubtract (w->points[i], w->points[0], d2); + CrossProduct (d1, d2, cross); + total += 0.5 * VectorLength ( cross ); + } + return total; +} + +/* +============= +Winding_Bounds +============= +*/ +void Winding_Bounds (winding_t *w, vec3_t mins, vec3_t maxs) +{ + vec_t v; + int i,j; + + mins[0] = mins[1] = mins[2] = 99999; + maxs[0] = maxs[1] = maxs[2] = -99999; + + for (i=0 ; inumpoints ; i++) + { + for (j=0 ; j<3 ; j++) + { + v = w->points[i][j]; + if (v < mins[j]) + mins[j] = v; + if (v > maxs[j]) + maxs[j] = v; + } + } } -inline PlaneClassification Winding_ClassifyDistance(const double distance, const double epsilon) +/* +================= +Winding_PointInside +================= +*/ +int Winding_PointInside(winding_t *w, plane_t *plane, vec3_t point, float epsilon) { - if(distance > epsilon) - { - return ePlaneFront; - } - if(distance < -epsilon) - { - return ePlaneBack; - } - return ePlaneOn; + int i; + vec3_t dir, normal, pointvec; + + for (i = 0; i < w->numpoints; i++) + { + VectorSubtract(w->points[(i+1) % w->numpoints], w->points[i], dir); + VectorSubtract(point, w->points[i], pointvec); + // + CrossProduct(dir, plane->normal, normal); + // + if (DotProduct(pointvec, normal) < -epsilon) return false; + } + return true; } -/// \brief Returns true if -/// !flipped && winding is completely BACK or ON -/// or flipped && winding is completely FRONT or ON -bool Winding_TestPlane(const Winding& winding, const Plane3& plane, bool flipped) +/* +================= +Winding_VectorIntersect +================= +*/ +int Winding_VectorIntersect(winding_t *w, plane_t *plane, vec3_t p1, vec3_t p2, float epsilon) { - const int test = (flipped) ? ePlaneBack : ePlaneFront; - for(Winding::const_iterator i = winding.begin(); i != winding.end(); ++i) - { - if(test == Winding_ClassifyDistance(plane3_distance_to_point(plane, (*i).vertex), ON_EPSILON)) - { - return false; - } - } - return true; + float front, back, frac; + vec3_t mid; + + front = DotProduct(p1, plane->normal) - plane->dist; + back = DotProduct(p2, plane->normal) - plane->dist; + //if both points at the same side of the plane + if (front < -epsilon && back < -epsilon) return false; + if (front > epsilon && back > epsilon) return false; + //get point of intersection with winding plane + if (fabs(front-back) < 0.001) + { + VectorCopy(p2, mid); + } + else + { + frac = front/(front-back); + mid[0] = p1[0] + (p2[0] - p1[0]) * frac; + mid[1] = p1[1] + (p2[1] - p1[1]) * frac; + mid[2] = p1[2] + (p2[2] - p1[2]) * frac; + } + return Winding_PointInside(w, plane, mid, epsilon); } -/// \brief Returns true if any point in \p w1 is in front of plane2, or any point in \p w2 is in front of plane1 -bool Winding_PlanesConcave(const Winding& w1, const Winding& w2, const Plane3& plane1, const Plane3& plane2) -{ - return !Winding_TestPlane(w1, plane2, false) || !Winding_TestPlane(w2, plane1, false); -} - -brushsplit_t Winding_ClassifyPlane(const Winding& winding, const Plane3& plane) -{ - brushsplit_t split; - for(Winding::const_iterator i = winding.begin(); i != winding.end(); ++i) - { - ++split.counts[Winding_ClassifyDistance(plane3_distance_to_point(plane, (*i).vertex), ON_EPSILON)]; - } - return split; -} - - -#define DEBUG_EPSILON ON_EPSILON -const double DEBUG_EPSILON_SQUARED = DEBUG_EPSILON * DEBUG_EPSILON; - -#define WINDING_DEBUG 0 - -/// \brief Clip \p winding which lies on \p plane by \p clipPlane, resulting in \p clipped. -/// If \p winding is completely in front of the plane, \p clipped will be identical to \p winding. -/// If \p winding is completely in back of the plane, \p clipped will be empty. -/// If \p winding intersects the plane, the edge of \p clipped which lies on \p clipPlane will store the value of \p adjacent. -void Winding_Clip(const FixedWinding& winding, const Plane3& plane, const Plane3& clipPlane, std::size_t adjacent, FixedWinding& clipped) -{ - PlaneClassification classification = Winding_ClassifyDistance(plane3_distance_to_point(clipPlane, winding.back().vertex), ON_EPSILON); - PlaneClassification nextClassification; - // for each edge - for(std::size_t next = 0, i = winding.size()-1; next != winding.size(); i = next, ++next, classification = nextClassification) - { - nextClassification = Winding_ClassifyDistance(plane3_distance_to_point(clipPlane, winding[next].vertex), ON_EPSILON); - const FixedWindingVertex& vertex = winding[i]; - - // if first vertex of edge is ON - if(classification == ePlaneOn) - { - // append first vertex to output winding - if(nextClassification == ePlaneBack) - { - // this edge lies on the clip plane - clipped.push_back(FixedWindingVertex(vertex.vertex, plane3_intersect_plane3(plane, clipPlane), adjacent)); - } - else - { - clipped.push_back(vertex); - } - continue; - } - - // if first vertex of edge is FRONT - if(classification == ePlaneFront) - { - // add first vertex to output winding - clipped.push_back(vertex); - } - // if second vertex of edge is ON - if(nextClassification == ePlaneOn) - { - continue; - } - // else if second vertex of edge is same as first - else if(nextClassification == classification) - { - continue; - } - // else if first vertex of edge is FRONT and there are only two edges - else if(classification == ePlaneFront && winding.size() == 2) - { - continue; - } - // else first vertex is FRONT and second is BACK or vice versa - else - { - // append intersection point of line and plane to output winding - DoubleVector3 mid(line_intersect_plane(vertex.edge, clipPlane)); - - if(classification == ePlaneFront) - { - // this edge lies on the clip plane - clipped.push_back(FixedWindingVertex(mid, plane3_intersect_plane3(plane, clipPlane), adjacent)); - } - else - { - clipped.push_back(FixedWindingVertex(mid, vertex.edge, vertex.adjacent)); - } - } - } -} - -std::size_t Winding_FindAdjacent(const Winding& winding, std::size_t face) -{ - for(std::size_t i=0; i dist_best) - { - dist_best = dist_squared; - index_best = i; - } - } - return index_best; -} - -std::size_t Winding_Opposite(const Winding& winding, const std::size_t index) -{ - return Winding_Opposite(winding, index, Winding_next(winding, index)); -} - -/// \brief Calculate the \p centroid of the polygon defined by \p winding which lies on plane \p plane. -void Winding_Centroid(const Winding& winding, const Plane3& plane, Vector3& centroid) -{ - double area2 = 0, x_sum = 0, y_sum = 0; - const ProjectionAxis axis = projectionaxis_for_normal(plane.normal()); - const indexremap_t remap = indexremap_for_projectionaxis(axis); - for(std::size_t i = winding.numpoints-1, j = 0; j < winding.numpoints; i = j, ++j) - { - const double ai = winding[i].vertex[remap.x] * winding[j].vertex[remap.y] - winding[j].vertex[remap.x] * winding[i].vertex[remap.y]; - area2 += ai; - x_sum += (winding[j].vertex[remap.x] + winding[i].vertex[remap.x]) * ai; - y_sum += (winding[j].vertex[remap.y] + winding[i].vertex[remap.y]) * ai; - } - - centroid[remap.x] = static_cast(x_sum / (3 * area2)); - centroid[remap.y] = static_cast(y_sum / (3 * area2)); - { - Ray ray(Vector3(0, 0, 0), Vector3(0, 0, 0)); - ray.origin[remap.x] = centroid[remap.x]; - ray.origin[remap.y] = centroid[remap.y]; - ray.direction[remap.z] = 1; - centroid[remap.z] = static_cast(ray_distance_to_plane(ray, plane)); - } -} diff --git a/radiant/winding.h b/radiant/winding.h index 233a9c82..426cad9b 100644 --- a/radiant/winding.h +++ b/radiant/winding.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,304 +19,52 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_WINDING_H) -#define INCLUDED_WINDING_H - -#include "debugging/debugging.h" - -#include - -#include "math/vector.h" -#include "container/array.h" - -enum ProjectionAxis -{ - eProjectionAxisX = 0, - eProjectionAxisY = 1, - eProjectionAxisZ = 2, -}; - -const float ProjectionAxisEpsilon = static_cast(0.0001); - -inline bool projectionaxis_better(float axis, float other) -{ - return fabs(axis) > fabs(other) + ProjectionAxisEpsilon; -} - -/// \brief Texture axis precedence: Z > X > Y -inline ProjectionAxis projectionaxis_for_normal(const Vector3& normal) -{ - return (projectionaxis_better(normal[eProjectionAxisY], normal[eProjectionAxisX])) - ? (projectionaxis_better(normal[eProjectionAxisY], normal[eProjectionAxisZ])) - ? eProjectionAxisY - : eProjectionAxisZ - : (projectionaxis_better(normal[eProjectionAxisX], normal[eProjectionAxisZ])) - ? eProjectionAxisX - : eProjectionAxisZ; -} - - -struct indexremap_t -{ - indexremap_t(std::size_t _x, std::size_t _y, std::size_t _z) - : x(_x), y(_y), z(_z) - { - } - std::size_t x, y, z; -}; - -inline indexremap_t indexremap_for_projectionaxis(const ProjectionAxis axis) -{ - switch(axis) - { - case eProjectionAxisX: return indexremap_t(1, 2, 0); - case eProjectionAxisY: return indexremap_t(2, 0, 1); - default: return indexremap_t(0, 1, 2); - } -} - -enum PlaneClassification -{ - ePlaneFront = 0, - ePlaneBack = 1, - ePlaneOn = 2, -}; - -#define MAX_POINTS_ON_WINDING 64 -const std::size_t c_brush_maxFaces = 1024; - - -class WindingVertex -{ -public: - Vector3 vertex; - Vector2 texcoord; - Vector3 tangent; - Vector3 bitangent; - std::size_t adjacent; -}; -struct Winding -{ - typedef Array container_type; +//returns true if the planes are equal +int Plane_Equal(plane_t *a, plane_t *b, int flip); +//returns false if the points are colinear +int Plane_FromPoints(vec3_t p1, vec3_t p2, vec3_t p3, plane_t *plane); +//returns true if the points are equal +int Point_Equal(vec3_t p1, vec3_t p2, float epsilon); - std::size_t numpoints; - container_type points; - - typedef container_type::iterator iterator; - typedef container_type::const_iterator const_iterator; - - Winding() : numpoints(0) - { - } - Winding(std::size_t size) : numpoints(0), points(size) - { - } - void resize(std::size_t size) - { - points.resize(size); - numpoints = 0; - } - - iterator begin() - { - return points.begin(); - } - const_iterator begin() const - { - return points.begin(); - } - iterator end() - { - return points.begin() + numpoints; - } - const_iterator end() const - { - return points.begin() + numpoints; - } - - WindingVertex& operator[](std::size_t index) - { - ASSERT_MESSAGE(index < points.size(), "winding: index out of bounds"); - return points[index]; - } - const WindingVertex& operator[](std::size_t index) const - { - ASSERT_MESSAGE(index < points.size(), "winding: index out of bounds"); - return points[index]; - } - - void push_back(const WindingVertex& point) - { - points[numpoints] = point; - ++numpoints; - } - void erase(iterator point) - { - for(iterator i = point + 1; i != end(); point = i, ++i) - { - *point = *i; - } - --numpoints; - } -}; - -typedef BasicVector3 DoubleVector3; - -class DoubleLine -{ -public: - DoubleVector3 origin; - DoubleVector3 direction; -}; - -class FixedWindingVertex -{ -public: - DoubleVector3 vertex; - DoubleLine edge; - std::size_t adjacent; - - FixedWindingVertex(const DoubleVector3& vertex_, const DoubleLine& edge_, std::size_t adjacent_) - : vertex(vertex_), edge(edge_), adjacent(adjacent_) - { - } -}; - -struct FixedWinding -{ - typedef std::vector Points; - Points points; - - FixedWinding() - { - points.reserve(MAX_POINTS_ON_WINDING); - } - - FixedWindingVertex& front() - { - return points.front(); - } - const FixedWindingVertex& front() const - { - return points.front(); - } - FixedWindingVertex& back() - { - return points.back(); - } - const FixedWindingVertex& back() const - { - return points.back(); - } - - void clear() - { - points.clear(); - } - - void push_back(const FixedWindingVertex& point) - { - points.push_back(point); - } - std::size_t size() const - { - return points.size(); - } - - FixedWindingVertex& operator[](std::size_t index) - { - //ASSERT_MESSAGE(index < MAX_POINTS_ON_WINDING, "winding: index out of bounds"); - return points[index]; - } - const FixedWindingVertex& operator[](std::size_t index) const - { - //ASSERT_MESSAGE(index < MAX_POINTS_ON_WINDING, "winding: index out of bounds"); - return points[index]; - } - -}; - - -inline void Winding_forFixedWinding(Winding& winding, const FixedWinding& fixed) -{ - winding.resize(fixed.size()); - winding.numpoints = fixed.size(); - for(std::size_t i = 0; i < fixed.size(); ++i) - { - winding[i].vertex[0] = static_cast(fixed[i].vertex[0]); - winding[i].vertex[1] = static_cast(fixed[i].vertex[1]); - winding[i].vertex[2] = static_cast(fixed[i].vertex[2]); - winding[i].adjacent = fixed[i].adjacent; - } -} - -inline std::size_t Winding_wrap(const Winding& winding, std::size_t i) -{ - ASSERT_MESSAGE(winding.numpoints != 0, "Winding_wrap: empty winding"); - return i % winding.numpoints; -} - -inline std::size_t Winding_next(const Winding& winding, std::size_t i) -{ - return Winding_wrap(winding, ++i); -} - - -class Plane3; - -void Winding_createInfinite(FixedWinding& w, const Plane3& plane, double infinity); - -const double ON_EPSILON = 1.0 / (1 << 8); - -/// \brief Returns true if edge (\p x, \p y) is smaller than the epsilon used to classify winding points against a plane. -inline bool Edge_isDegenerate(const Vector3& x, const Vector3& y) -{ - return vector3_length_squared(y - x) < (ON_EPSILON * ON_EPSILON); -} - -void Winding_Clip(const FixedWinding& winding, const Plane3& plane, const Plane3& clipPlane, std::size_t adjacent, FixedWinding& clipped); - -struct brushsplit_t -{ - brushsplit_t() - { - counts[0] = 0; - counts[1] = 0; - counts[2] = 0; - } - brushsplit_t& operator+=(const brushsplit_t& other) - { - counts[0] += other.counts[0]; - counts[1] += other.counts[1]; - counts[2] += other.counts[2]; - return *this; - } - std::size_t counts[3]; -}; - -brushsplit_t Winding_ClassifyPlane(const Winding& w, const Plane3& plane); - -bool Winding_PlanesConcave(const Winding& w1, const Winding& w2, const Plane3& plane1, const Plane3& plane2); -bool Winding_TestPlane(const Winding& w, const Plane3& plane, bool flipped); - -std::size_t Winding_FindAdjacent(const Winding& w, std::size_t face); - -std::size_t Winding_Opposite(const Winding& w, const std::size_t index, const std::size_t other); -std::size_t Winding_Opposite(const Winding& w, std::size_t index); - -void Winding_Centroid(const Winding& w, const Plane3& plane, Vector3& centroid); - - -inline void Winding_printConnectivity(Winding& winding) -{ - for(Winding::iterator i = winding.begin(); i != winding.end(); ++i) - { - std::size_t vertexIndex = std::distance(winding.begin(), i); - globalOutputStream() << "vertex: " << Unsigned(vertexIndex) << " adjacent: " << Unsigned((*i).adjacent) << "\n"; - } -} - -#endif +//allocate a winding +winding_t* Winding_Alloc(int points); +//free the winding +void Winding_Free(winding_t *w); +//create a base winding for the plane +winding_t* Winding_BaseForPlane (plane_t *p); +//make a winding clone +winding_t* Winding_Clone(winding_t *w ); +//creates the reversed winding +winding_t* Winding_Reverse(winding_t *w); +//remove a point from the winding +void Winding_RemovePoint(winding_t *w, int point); +//inserts a point to a winding, creating a new winding +winding_t* Winding_InsertPoint(winding_t *w, vec3_t point, int spot); +//returns true if the planes are concave +int Winding_PlanesConcave(winding_t *w1, winding_t *w2, + vec3_t normal1, vec3_t normal2, + float dist1, float dist2); +//returns true if the winding is tiny +int Winding_IsTiny(winding_t *w); +//returns true if the winding is huge +int Winding_IsHuge(winding_t *w); +//clip the winding with the plane +winding_t* Winding_Clip(winding_t *in, plane_t *split, qboolean keepon); +//split the winding with the plane +void Winding_SplitEpsilon(winding_t *in, vec3_t normal, double dist, + vec_t epsilon, winding_t **front, winding_t **back); +//try to merge the windings, returns the new merged winding or NULL +winding_t *Winding_TryMerge(winding_t *f1, winding_t *f2, vec3_t planenormal, int keep); +//create a plane for the winding +void Winding_Plane(winding_t *w, vec3_t normal, double *dist); +//returns the winding area +float Winding_Area(winding_t *w); +//returns the bounds of the winding +void Winding_Bounds(winding_t *w, vec3_t mins, vec3_t maxs); +//returns true if the point is inside the winding +int Winding_PointInside(winding_t *w, plane_t *plane, vec3_t point, float epsilon); +//returns true if the vector intersects with the winding +int Winding_VectorIntersect(winding_t *w, plane_t *plane, vec3_t p1, vec3_t p2, float epsilon); diff --git a/radiant/windowobservers.cpp b/radiant/windowobservers.cpp deleted file mode 100644 index 481f6998..00000000 --- a/radiant/windowobservers.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "windowobservers.h" - -#include -#include -#include "generic/bitfield.h" - -namespace -{ - ModifierFlags g_modifier_state = c_modifierNone; -} - -typedef std::vector WindowObservers; - -inline void WindowObservers_OnModifierDown(WindowObservers& observers, ModifierFlags type) -{ - g_modifier_state = bitfield_enable(g_modifier_state, type); - for(WindowObservers::iterator i = observers.begin(); i != observers.end(); ++i) - { - (*i)->onModifierDown(type); - } -} - -inline void WindowObservers_OnModifierUp(WindowObservers& observers, ModifierFlags type) -{ - g_modifier_state = bitfield_disable(g_modifier_state, type); - for(WindowObservers::iterator i = observers.begin(); i != observers.end(); ++i) - { - (*i)->onModifierUp(type); - } -} - -#include - -gboolean selection_modifier_key_press(GtkWidget* widget, GdkEventKey* event, WindowObservers& observers) -{ - switch(event->keyval) - { - case GDK_Alt_L: - case GDK_Alt_R: - //globalOutputStream() << "Alt PRESSED\n"; - WindowObservers_OnModifierDown(observers, c_modifierAlt); - break; - case GDK_Shift_L: - case GDK_Shift_R: - //globalOutputStream() << "Shift PRESSED\n"; - WindowObservers_OnModifierDown(observers, c_modifierShift); - break; - case GDK_Control_L: - case GDK_Control_R: - //globalOutputStream() << "Control PRESSED\n"; - WindowObservers_OnModifierDown(observers, c_modifierControl); - break; - } - return FALSE; -} - -gboolean selection_modifier_key_release(GtkWidget* widget, GdkEventKey* event, WindowObservers& observers) -{ - switch(event->keyval) - { - case GDK_Alt_L: - case GDK_Alt_R: - //globalOutputStream() << "Alt RELEASED\n"; - WindowObservers_OnModifierUp(observers, c_modifierAlt); - break; - case GDK_Shift_L: - case GDK_Shift_R: - //globalOutputStream() << "Shift RELEASED\n"; - WindowObservers_OnModifierUp(observers, c_modifierShift); - break; - case GDK_Control_L: - case GDK_Control_R: - //globalOutputStream() << "Control RELEASED\n"; - WindowObservers_OnModifierUp(observers, c_modifierControl); - break; - } - return FALSE; -} - -void WindowObservers_UpdateModifier(WindowObservers& observers, ModifierFlags modifiers, ModifierFlags modifier) -{ - if(!bitfield_enabled(g_modifier_state, modifier) && bitfield_enabled(modifiers, modifier)) - { - WindowObservers_OnModifierDown(observers, modifier); - } - if(bitfield_enabled(g_modifier_state, modifier) && !bitfield_enabled(modifiers, modifier)) - { - WindowObservers_OnModifierUp(observers, modifier); - } -} - -void WindowObservers_UpdateModifiers(WindowObservers& observers, ModifierFlags modifiers) -{ - WindowObservers_UpdateModifier(observers, modifiers, c_modifierAlt); - WindowObservers_UpdateModifier(observers, modifiers, c_modifierShift); - WindowObservers_UpdateModifier(observers, modifiers, c_modifierControl); -} - -gboolean modifiers_button_press(GtkWidget* widget, GdkEventButton* event, WindowObservers* observers) -{ - if(event->type == GDK_BUTTON_PRESS) - { - WindowObservers_UpdateModifiers(*observers, modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean modifiers_button_release(GtkWidget* widget, GdkEventButton* event, WindowObservers* observers) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - WindowObservers_UpdateModifiers(*observers, modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean modifiers_motion(GtkWidget *widget, GdkEventMotion *event, WindowObservers* observers) -{ - WindowObservers_UpdateModifiers(*observers, modifiers_for_state(event->state)); - return FALSE; -} - - -WindowObservers g_window_observers; - -void GlobalWindowObservers_updateModifiers(ModifierFlags modifiers) -{ - WindowObservers_UpdateModifiers(g_window_observers, modifiers); -} - -void GlobalWindowObservers_add(WindowObserver* observer) -{ - g_window_observers.push_back(observer); -} - -void GlobalWindowObservers_connectTopLevel(GtkWindow* window) -{ - g_signal_connect(G_OBJECT(window), "key_press_event", G_CALLBACK(selection_modifier_key_press), &g_window_observers); - g_signal_connect(G_OBJECT(window), "key_release_event", G_CALLBACK(selection_modifier_key_release), &g_window_observers); -} - -void GlobalWindowObservers_connectWidget(GtkWidget* widget) -{ - g_signal_connect(G_OBJECT(widget), "button_press_event", G_CALLBACK(modifiers_button_press), &g_window_observers); - g_signal_connect(G_OBJECT(widget), "button_release_event", G_CALLBACK(modifiers_button_release), &g_window_observers); - g_signal_connect(G_OBJECT(widget), "motion_notify_event", G_CALLBACK(modifiers_motion), &g_window_observers); -} - - diff --git a/radiant/windowobservers.h b/radiant/windowobservers.h deleted file mode 100644 index 7a47a936..00000000 --- a/radiant/windowobservers.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if !defined(INCLUDED_WINDOWOBSERVERS_H) -#define INCLUDED_WINDOWOBSERVERS_H - -#include "windowobserver.h" - -#include - -#include "math/vector.h" - -class WindowObserver; -void GlobalWindowObservers_add(WindowObserver* observer); -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkWindow GtkWindow; -void GlobalWindowObservers_connectWidget(GtkWidget* widget); -void GlobalWindowObservers_connectTopLevel(GtkWindow* window); - -inline ButtonIdentifier button_for_button(unsigned int button) -{ - switch(button) - { - case 1: - return c_buttonLeft; - case 2: - return c_buttonMiddle; - case 3: - return c_buttonRight; - } - return c_buttonInvalid; -} - -inline ModifierFlags modifiers_for_state(unsigned int state) -{ - ModifierFlags modifiers = c_modifierNone; - if(state & GDK_SHIFT_MASK) - modifiers |= c_modifierShift; - if(state & GDK_CONTROL_MASK) - modifiers |= c_modifierControl; - if(state & GDK_MOD1_MASK) - modifiers |= c_modifierAlt; - return modifiers; -} - -inline WindowVector WindowVector_forDouble(double x, double y) -{ - return WindowVector(static_cast(x), static_cast(y)); -} - -#endif diff --git a/radiant/xmlstuff.h b/radiant/xmlstuff.h index 0ffb8e2b..9d8a514a 100644 --- a/radiant/xmlstuff.h +++ b/radiant/xmlstuff.h @@ -39,9 +39,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "libxml/parser.h" -#include +struct message_info_s; -class ISAXHandler; +class ISAXHandler +{ +public: + virtual ~ISAXHandler() { } + virtual void saxStartElement( struct message_info_s *ctx, const xmlChar *name, const xmlChar **attrs ) = 0; + virtual void saxEndElement( struct message_info_s *ctx, const xmlChar *name ) = 0; + virtual void saxCharacters( struct message_info_s *ctx, const xmlChar *ch, int len ) = 0; + virtual char *getName() { return NULL; } + virtual void Highlight() { } + virtual void DropHighlight() { } + virtual bool ShouldDelete() { return true; } // should the handler be deleted when the feedback dialog is cleared? +}; // a 'user data' structure we pass along in the SAX callbacks to represent the current state // the recurse value tracks the current depth in the tree @@ -49,42 +60,13 @@ class ISAXHandler; // if msg_level == SYS_ERR, then we will reset the listening at the end of the current node // the level for stopping the feed is stored in stop_depth // unkown nodes are ignored, we use ignore_depth to track the level we start ignoring from -struct message_info_t -{ - int msg_level; // current message level (SYS_MSG, SYS_WRN, SYS_ERR) - int recurse; // current recursion depth (used to track various things) - int ignore_depth; // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring) - int stop_depth; // the depth we need to stop at the end - int geometry_depth; // are we parsing some geometry information (i.e. do we forward the SAX calls?) - ISAXHandler* pGeometry; // the handler - - enum unnamed0 { bufsize = 1024 }; - char m_buffer[bufsize]; - std::size_t m_length; -}; - -class IGL2DWindow; - -class ISAXHandler -{ -public: - virtual void Release() - { - } - virtual void saxStartElement(message_info_t* ctx, const xmlChar* name, const xmlChar** attrs) = 0; - virtual void saxEndElement(message_info_t* ctx, const xmlChar* name) = 0; - virtual void saxCharacters(message_info_t* ctx, const xmlChar* ch, int len) = 0; - virtual const char* getName() - { - return NULL; - } - virtual IGL2DWindow* Highlight() - { - return 0; - } - virtual void DropHighlight() - { - } -}; +typedef struct message_info_s { + int msg_level; // current message level (SYS_MSG, SYS_WRN, SYS_ERR) + int recurse; // current recursion depth (used to track various things) + int ignore_depth; // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring) + int stop_depth; // the depth we need to stop at the end + bool bGeometry; // are we parsing some geometry information (i.e. do we forward the SAX calls?) + ISAXHandler *pGeometry; // the handler +} message_info_t; #endif diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 4f545cb5..b24cdc80 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -25,541 +25,106 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Leonardo Zide (leo@lokigames.com) // -#include "xywindow.h" - -#include "debugging/debugging.h" - -#include "ientity.h" -#include "igl.h" -#include "ibrush.h" -#include "iundo.h" - -#include -#include - -#include "generic/callback.h" -#include "string/string.h" -#include "stream/stringstream.h" - -#include "scenelib.h" -#include "eclasslib.h" -#include "renderer.h" -#include "moduleobserver.h" - -#include "gtkutil/menu.h" -#include "gtkutil/container.h" -#include "gtkutil/widget.h" -#include "gtkutil/glwidget.h" -#include "gtkmisc.h" -#include "select.h" -#include "csg.h" -#include "brushmanip.h" -#include "selection.h" -#include "entity.h" -#include "camwindow.h" -#include "texwindow.h" -#include "mainframe.h" -#include "preferences.h" -#include "commands.h" -#include "feedback.h" -#include "grid.h" -#include "windowobservers.h" - - -// d1223m -extern bool g_brush_always_caulk; - -//!\todo Rewrite. -class ClipPoint -{ -public: - Vector3 m_ptClip; // the 3d point - bool m_bSet; - - ClipPoint() - { - Reset(); - }; - void Reset() - { - m_ptClip[0] = m_ptClip[1] = m_ptClip[2] = 0.0; - m_bSet = false; - } - bool Set() - { - return m_bSet; - } - void Set(bool b) - { - m_bSet = b; - } - operator Vector3&() - { - return m_ptClip; - }; - - /*! Draw clip/path point with rasterized number label */ - void Draw(int num, float scale); - /*! Draw clip/path point with rasterized string label */ - void Draw(const char *label, float scale); -}; - -VIEWTYPE g_clip_viewtype; -bool g_bSwitch = true; -bool g_clip_useCaulk = false; -ClipPoint g_Clip1; -ClipPoint g_Clip2; -ClipPoint g_Clip3; -ClipPoint* g_pMovingClip = 0; - -/* Drawing clip points */ -void ClipPoint::Draw(int num, float scale) -{ - StringOutputStream label(4); - label << num; - Draw(label.c_str(), scale); -} - -void ClipPoint::Draw(const char *label, float scale) -{ - // draw point - glPointSize (4); - glColor3fv(vector3_to_array(g_xywindow_globals.color_clipper)); - glBegin (GL_POINTS); - glVertex3fv(vector3_to_array(m_ptClip)); - glEnd(); - glPointSize (1); - - float offset = 2.0f / scale; - - // draw label - glRasterPos3f (m_ptClip[0] + offset, m_ptClip[1] + offset, m_ptClip[2] + offset); - glCallLists (GLsizei(strlen(label)), GL_UNSIGNED_BYTE, label); -} - -float fDiff(float f1, float f2) -{ - if (f1 > f2) - return f1 - f2; - else - return f2 - f1; -} - -inline double ClipPoint_Intersect(const ClipPoint& clip, const Vector3& point, VIEWTYPE viewtype, float scale) -{ - int nDim1 = (viewtype == YZ) ? 1 : 0; - int nDim2 = (viewtype == XY) ? 1 : 2; - double screenDistanceSquared(vector2_length_squared(Vector2(fDiff(clip.m_ptClip[nDim1], point[nDim1]) * scale, fDiff(clip.m_ptClip[nDim2], point[nDim2]) * scale))); - if(screenDistanceSquared < 8*8) - { - return screenDistanceSquared; - } - return FLT_MAX; -} - -inline void ClipPoint_testSelect(ClipPoint& clip, const Vector3& point, VIEWTYPE viewtype, float scale, double& bestDistance, ClipPoint*& bestClip) -{ - if(clip.Set()) - { - double distance = ClipPoint_Intersect(clip, point, viewtype, scale); - if(distance < bestDistance) - { - bestDistance = distance; - bestClip = &clip; - } - } -} - -inline ClipPoint* GlobalClipPoints_Find(const Vector3& point, VIEWTYPE viewtype, float scale) -{ - double bestDistance = FLT_MAX; - ClipPoint* bestClip = 0; - ClipPoint_testSelect(g_Clip1, point, viewtype, scale, bestDistance, bestClip); - ClipPoint_testSelect(g_Clip2, point, viewtype, scale, bestDistance, bestClip); - ClipPoint_testSelect(g_Clip3, point, viewtype, scale, bestDistance, bestClip); - return bestClip; -} - -inline void GlobalClipPoints_Draw(float scale) -{ - // Draw clip points - if (g_Clip1.Set()) - g_Clip1.Draw(1, scale); - if (g_Clip2.Set()) - g_Clip2.Draw(2, scale); - if (g_Clip3.Set()) - g_Clip3.Draw(3, scale); -} - -inline bool GlobalClipPoints_valid() -{ - return g_Clip1.Set() && g_Clip2.Set(); -} - -void PlanePointsFromClipPoints(Vector3 planepts[3], const AABB& bounds, int viewtype) -{ - ASSERT_MESSAGE(GlobalClipPoints_valid(), "clipper points not initialised"); - planepts[0] = g_Clip1.m_ptClip; - planepts[1] = g_Clip2.m_ptClip; - planepts[2] = g_Clip3.m_ptClip; - Vector3 maxs(vector3_added(bounds.origin, bounds.extents)); - Vector3 mins(vector3_subtracted(bounds.origin, bounds.extents)); - if(!g_Clip3.Set()) - { - int n = (viewtype == XY) ? 2 : (viewtype == YZ) ? 0 : 1; - int x = (n == 0) ? 1 : 0; - int y = (n == 2) ? 1 : 2; - - if (n == 1) // on viewtype XZ, flip clip points - { - planepts[0][n] = maxs[n]; - planepts[1][n] = maxs[n]; - planepts[2][x] = g_Clip1.m_ptClip[x]; - planepts[2][y] = g_Clip1.m_ptClip[y]; - planepts[2][n] = mins[n]; - } - else - { - planepts[0][n] = mins[n]; - planepts[1][n] = mins[n]; - planepts[2][x] = g_Clip1.m_ptClip[x]; - planepts[2][y] = g_Clip1.m_ptClip[y]; - planepts[2][n] = maxs[n]; - } - } -} - -void Clip_Update() -{ - Vector3 planepts[3]; - if(!GlobalClipPoints_valid()) - { - planepts[0] = Vector3(0, 0, 0); - planepts[1] = Vector3(0, 0, 0); - planepts[2] = Vector3(0, 0, 0); - Scene_BrushSetClipPlane(GlobalSceneGraph(), Plane3(0, 0, 0, 0)); - } - else - { - AABB bounds(Vector3(0, 0, 0), Vector3(64, 64, 64)); - PlanePointsFromClipPoints(planepts, bounds, g_clip_viewtype); - if(g_bSwitch) - { - std::swap(planepts[0], planepts[1]); - } - Scene_BrushSetClipPlane(GlobalSceneGraph(), plane3_for_points(planepts[0], planepts[1], planepts[2])); - } - ClipperChangeNotify(); -} - -const char* Clip_getShader() -{ - return g_clip_useCaulk ? "textures/common/caulk" : TextureBrowser_GetSelectedShader(GlobalTextureBrowser()); -} - -void Clip() -{ - if (ClipMode() && GlobalClipPoints_valid()) - { - Vector3 planepts[3]; - AABB bounds(Vector3(0, 0, 0), Vector3(64, 64, 64)); - PlanePointsFromClipPoints(planepts, bounds, g_clip_viewtype); - Scene_BrushSplitByPlane(GlobalSceneGraph(), planepts[0], planepts[1], planepts[2], Clip_getShader(), (!g_bSwitch) ? eFront : eBack); - g_Clip1.Reset(); - g_Clip2.Reset(); - g_Clip3.Reset(); - Clip_Update(); - ClipperChangeNotify(); - } -} - -void SplitClip() -{ - if (ClipMode() && GlobalClipPoints_valid()) - { - Vector3 planepts[3]; - AABB bounds(Vector3(0, 0, 0), Vector3(64, 64, 64)); - PlanePointsFromClipPoints(planepts, bounds, g_clip_viewtype); - Scene_BrushSplitByPlane(GlobalSceneGraph(), planepts[0], planepts[1], planepts[2], Clip_getShader(), eFrontAndBack); - g_Clip1.Reset(); - g_Clip2.Reset(); - g_Clip3.Reset(); - Clip_Update(); - ClipperChangeNotify(); - } -} - -void FlipClip() -{ - g_bSwitch = !g_bSwitch; - Clip_Update(); - ClipperChangeNotify(); -} - -void OnClipMode(bool enabled) -{ - g_Clip1.Reset(); - g_Clip2.Reset(); - g_Clip3.Reset(); - - if(!enabled && g_pMovingClip) - { - g_pMovingClip = 0; - } - - Clip_Update(); - ClipperChangeNotify(); -} - -bool ClipMode() -{ - return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip; -} - -void NewClipPoint(const Vector3& point) -{ - if (g_Clip1.Set() == false) - { - g_Clip1.m_ptClip = point; - g_Clip1.Set(true); - } - else if (g_Clip2.Set() == false) - { - g_Clip2.m_ptClip = point; - g_Clip2.Set(true); - } - else if (g_Clip3.Set() == false) - { - g_Clip3.m_ptClip = point; - g_Clip3.Set(true); - } - else - { - g_Clip1.Reset(); - g_Clip2.Reset(); - g_Clip3.Reset(); - g_Clip1.m_ptClip = point; - g_Clip1.Set(true); - } - - Clip_Update(); - ClipperChangeNotify(); -} - - - -struct xywindow_globals_private_t -{ - bool d_showgrid; - - // these are in the View > Show menu with Show coordinates - bool show_names; - bool show_coordinates; - bool show_angles; - bool show_outline; - bool show_axis; - - bool d_show_work; - - bool show_blocks; - int blockSize; - - bool m_bCamXYUpdate; - bool m_bChaseMouse; - bool m_bSizePaint; - - xywindow_globals_private_t() : - d_showgrid(true), - - show_names(false), - show_coordinates(true), - show_angles(true), - show_outline(false), - show_axis(true), - - d_show_work(false), - - show_blocks(false), - - m_bCamXYUpdate(true), - m_bChaseMouse(true), - m_bSizePaint(false) - { - } - -}; - -xywindow_globals_t g_xywindow_globals; -xywindow_globals_private_t g_xywindow_globals_private; - -const unsigned int RAD_NONE = 0x00; -const unsigned int RAD_SHIFT = 0x01; -const unsigned int RAD_ALT = 0x02; -const unsigned int RAD_CONTROL = 0x04; -const unsigned int RAD_PRESS = 0x08; -const unsigned int RAD_LBUTTON = 0x10; -const unsigned int RAD_MBUTTON = 0x20; -const unsigned int RAD_RBUTTON = 0x40; - -inline ButtonIdentifier button_for_flags(unsigned int flags) -{ - if(flags & RAD_LBUTTON) - return c_buttonLeft; - if(flags & RAD_RBUTTON) - return c_buttonRight; - if(flags & RAD_MBUTTON) - return c_buttonMiddle; - return c_buttonInvalid; -} - -inline ModifierFlags modifiers_for_flags(unsigned int flags) -{ - ModifierFlags modifiers = c_modifierNone; - if(flags & RAD_SHIFT) - modifiers |= c_modifierShift; - if(flags & RAD_CONTROL) - modifiers |= c_modifierControl; - if(flags & RAD_ALT) - modifiers |= c_modifierAlt; - return modifiers; -} - -inline unsigned int buttons_for_button_and_modifiers(ButtonIdentifier button, ModifierFlags flags) -{ - unsigned int buttons = 0; - - switch (button.get()) - { - case ButtonEnumeration::LEFT: buttons |= RAD_LBUTTON; break; - case ButtonEnumeration::MIDDLE: buttons |= RAD_MBUTTON; break; - case ButtonEnumeration::RIGHT: buttons |= RAD_RBUTTON; break; - } - - if(bitfield_enabled(flags, c_modifierControl)) - buttons |= RAD_CONTROL; - - if(bitfield_enabled(flags, c_modifierShift)) - buttons |= RAD_SHIFT; - - if(bitfield_enabled(flags, c_modifierAlt)) - buttons |= RAD_ALT; - - return buttons; -} - -inline unsigned int buttons_for_event_button(GdkEventButton* event) -{ - unsigned int flags = 0; - - switch (event->button) - { - case 1: flags |= RAD_LBUTTON; break; - case 2: flags |= RAD_MBUTTON; break; - case 3: flags |= RAD_RBUTTON; break; - } - - if ((event->state & GDK_CONTROL_MASK) != 0) - flags |= RAD_CONTROL; - - if ((event->state & GDK_SHIFT_MASK) != 0) - flags |= RAD_SHIFT; - - if((event->state & GDK_MOD1_MASK) != 0) - flags |= RAD_ALT; - - return flags; -} - -inline unsigned int buttons_for_state(guint state) -{ - unsigned int flags = 0; - - if ((state & GDK_BUTTON1_MASK) != 0) - flags |= RAD_LBUTTON; - - if ((state & GDK_BUTTON2_MASK) != 0) - flags |= RAD_MBUTTON; - - if ((state & GDK_BUTTON3_MASK) != 0) - flags |= RAD_RBUTTON; - - if ((state & GDK_CONTROL_MASK) != 0) - flags |= RAD_CONTROL; - - if ((state & GDK_SHIFT_MASK) != 0) - flags |= RAD_SHIFT; - - if ((state & GDK_MOD1_MASK) != 0) - flags |= RAD_ALT; - - return flags; -} - - -void XYWnd::SetScale(float f) -{ - m_fScale = f; - updateProjection(); - updateModelview(); - XYWnd_Update(*this); -} - -void XYWnd_ZoomIn(XYWnd* xy) -{ - float max_scale = 64; - float scale = xy->Scale() * 5.0f / 4.0f; - if(scale > max_scale) - { - if(xy->Scale() != max_scale) - { - xy->SetScale (max_scale); - } - } - else - { - xy->SetScale(scale); - } -} - - -// NOTE: the zoom out factor is 4/5, we could think about customizing it -// we don't go below a zoom factor corresponding to 10% of the max world size -// (this has to be computed against the window size) -void XYWnd_ZoomOut(XYWnd* xy) -{ - float min_scale = MIN(xy->Width(),xy->Height()) / ( 1.1f * (g_MaxWorldCoord-g_MinWorldCoord)); - float scale = xy->Scale() * 4.0f / 5.0f; - if(scale < min_scale) - { - if(xy->Scale() != min_scale) - { - xy->SetScale (min_scale); - } - } - else - { - xy->SetScale(scale); - } -} - -VIEWTYPE GlobalXYWnd_getCurrentViewType() -{ - ASSERT_NOTNULL(g_pParentWnd); - ASSERT_NOTNULL(g_pParentWnd->ActiveXY()); - return g_pParentWnd->ActiveXY()->GetViewType(); -} +#include "stdafx.h" +#include +#include +#include + +#ifdef _WIN32 +#include +#endif // ============================================================================= // variables -bool g_bCrossHairs = false; +#define PAGEFLIPS 2 -GtkMenu* XYWnd::m_mnuDrop = 0; +CString g_strStatus; +bool g_bCrossHairs = false; +bool g_bScaleMode; +int g_nScaleHow; +bool g_bRotateMode; +bool g_bClipMode; +bool g_bRogueClipMode; +bool g_bSwitch; +ClipPoint g_Clip1; +ClipPoint g_Clip2; +ClipPoint g_Clip3; +ClipPoint* g_pMovingClip; +brush_t g_brFrontSplits; +brush_t g_brBackSplits; + +brush_t g_brClipboard; +brush_t g_brUndo; +entity_t g_enClipboard; + +vec3_t g_vRotateOrigin; +vec3_t g_vRotation; + +bool g_bPathMode; +ClipPoint g_PathPoints[256]; // this limit isn't enforced? +ClipPoint* g_pMovingPath; +int g_nPathCount; +int g_nPathLimit; + +bool g_bSmartGo; + +bool g_bPointMode; +ClipPoint g_PointPoints[512]; +ClipPoint* g_pMovingPoint; +int g_nPointCount; +int g_nPointLimit; + +const int XY_LEFT = 0x01; +const int XY_RIGHT = 0x02; +const int XY_UP = 0x04; +const int XY_DOWN = 0x08; + +PFNPathCallback* g_pPathFunc = NULL; + +static unsigned s_stipple[32] = +{ + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, + 0xaaaaaaaa, 0x55555555,0xaaaaaaaa, 0x55555555, +}; + +void AcquirePath(int nCount, PFNPathCallback* pFunc) +{ + g_nPathCount = 0; + g_nPathLimit = nCount; + g_pPathFunc = pFunc; + g_bPathMode = true; +} + + +CPtrArray g_ptrMenus; + +MemStream g_Clipboard(4096); +MemStream g_PatchClipboard(4096); + +extern int pressx; +extern int pressy; +extern bool g_bWaitCursor; + +vec3_t tdp; + +GtkWidget* XYWnd::m_mnuDrop = NULL; + +extern int g_nPatchClickedView; + +// ============================================================================= +// global functions // this is disabled, and broken // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394 #if 0 -void WXY_Print() +void WXY_Print () { long width, height; width = g_pParentWnd->ActiveXY()->Width(); @@ -567,13 +132,13 @@ void WXY_Print() unsigned char* img; const char* filename; - filename = file_dialog(GTK_WIDGET(MainFrame_getWindow()), FALSE, "Save Image", 0, FILTER_BMP); + filename = file_dialog (g_pParentWnd->m_pWidget, FALSE, "Save Image", NULL, FILTER_BMP); if (!filename) return; g_pParentWnd->ActiveXY()->MakeCurrent(); img = (unsigned char*)malloc (width*height*3); - glReadPixels (0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,img); + qglReadPixels (0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,img); FILE *fp; fp = fopen(filename, "wb"); @@ -614,7 +179,7 @@ void WXY_Print() unsigned long widthDW = (((width*24) + 31) / 32 * 4); long row, row_size = width*3; - for (row = 0; row < height; row++) + for (row = 0; row < height; row++) { unsigned char* buf = img+row*row_size; @@ -643,402 +208,1445 @@ void WXY_Print() } #endif - -#include "timer.h" - -Timer g_chasemouse_timer; - -void XYWnd::ChaseMouse() +float ptSum(vec3_t pt) { - float multiplier = g_chasemouse_timer.elapsed_msec() / 10.0f; - Scroll(float_to_integer(multiplier * m_chasemouse_delta_x), float_to_integer(multiplier * -m_chasemouse_delta_y)); - - //globalOutputStream() << "chasemouse: multiplier=" << multiplier << " x=" << m_chasemouse_delta_x << " y=" << m_chasemouse_delta_y << '\n'; - - XY_MouseMoved(m_chasemouse_current_x, m_chasemouse_current_y , getButtonState()); - g_chasemouse_timer.start(); + return pt[0] + pt[1] + pt[2]; } -gboolean xywnd_chasemouse(gpointer data) +float Betwixt(float f1, float f2) { - reinterpret_cast(data)->ChaseMouse(); - return TRUE; + if (f1 > f2) + return f2 + ((f1 - f2) / 2); + else + return f1 + ((f2 - f1) / 2); } -inline const int& min_int(const int& left, const int& right) +void CleanList(brush_t* pList) { - return std::min(left, right); -} - -bool XYWnd::chaseMouseMotion(int pointx, int pointy) -{ - m_chasemouse_delta_x = 0; - m_chasemouse_delta_y = 0; - - if (g_xywindow_globals_private.m_bChaseMouse && getButtonState() == RAD_LBUTTON) + brush_t* pBrush = pList->next; + while (pBrush != NULL && pBrush != pList) { - const int epsilon = 16; + brush_t* pNext = pBrush->next; + Brush_Free(pBrush); + pBrush = pNext; + } +} - if (pointx < epsilon) - { - m_chasemouse_delta_x = std::max(pointx, 0) - epsilon; - } - else if ((pointx - m_nWidth) > -epsilon) - { - m_chasemouse_delta_x = min_int((pointx - m_nWidth), 0) + epsilon; - } +void Brush_CopyList (brush_t* pFrom, brush_t* pTo) +{ + brush_t* pBrush = pFrom->next; + while (pBrush != NULL && pBrush != pFrom) + { + brush_t* pNext = pBrush->next; + Brush_RemoveFromList(pBrush); + Brush_AddToList(pBrush, pTo); + pBrush = pNext; + } +} - if (pointy < epsilon) - { - m_chasemouse_delta_y = std::max(pointy, 0) - epsilon; - } - else if ((pointy - m_nHeight) > -epsilon) - { - m_chasemouse_delta_y = min_int((pointy - m_nHeight), 0) + epsilon; - } +float fDiff(float f1, float f2) +{ + if (f1 > f2) + return f1 - f2; + else + return f2 - f1; +} - if(m_chasemouse_delta_y != 0 || m_chasemouse_delta_x != 0) +/* +============================================================= + + PATH LINES + +============================================================= +*/ + +/* +================== +DrawPathLines + +Draws connections between entities. +Needs to consider all entities, not just ones on screen, +because the lines can be visible when neither end is. +Called for both camera view and xy view. +================== +*/ +void DrawPathLines (void) +{ + int i, j, k; + vec3_t mid, mid1; + entity_t *se, *te; + brush_t *sb, *tb; + const char *psz; + vec3_t dir, s1, s2; + vec_t len, f; + int arrows; + int num_entities; + const char *ent_target[MAX_MAP_ENTITIES]; + entity_t *ent_entity[MAX_MAP_ENTITIES]; + + if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_PATHS) + { + return; + } + + num_entities = 0; + for (te = entities.next ; te != &entities && num_entities != MAX_MAP_ENTITIES ; te = te->next) + { + ent_target[num_entities] = ValueForKey (te, "target"); + if (ent_target[num_entities][0]) { - //globalOutputStream() << "chasemouse motion: x=" << pointx << " y=" << pointy << "... "; - m_chasemouse_current_x = pointx; - m_chasemouse_current_y = pointy; - if(m_chasemouse_handler == 0) + ent_entity[num_entities] = te; + num_entities++; + } + } + + for (se = entities.next ; se != &entities ; se = se->next) + { + psz = ValueForKey(se, "targetname"); + + if (psz == NULL || psz[0] == '\0') + continue; + + sb = se->brushes.onext; + if (sb == &se->brushes) + continue; + + for (k=0 ; kbrushes.onext; + if (tb == &te->brushes) + continue; + + for (i=0 ; i<3 ; i++) + mid[i] = (sb->mins[i] + sb->maxs[i])*0.5; + + for (i=0 ; i<3 ; i++) + mid1[i] = (tb->mins[i] + tb->maxs[i])*0.5; + + VectorSubtract (mid1, mid, dir); + len = VectorNormalize (dir, dir); + s1[0] = -dir[1]*8 + dir[0]*8; + s2[0] = dir[1]*8 + dir[0]*8; + s1[1] = dir[0]*8 + dir[1]*8; + s2[1] = -dir[0]*8 + dir[1]*8; + + qglColor3f (se->eclass->color[0], se->eclass->color[1], se->eclass->color[2]); + + qglBegin(GL_LINES); + qglVertex3fv(mid); + qglVertex3fv(mid1); + + arrows = (int)(len / 256) + 1; + + for (i=0 ; im_pWidget, "Can't create an entity with worldspawn.", "info", 0); + return; + } + + e = Entity_Alloc(); + SetKeyValue(e, "classname", name); + + if(e->eclass->fixedsize) + { + Select_Delete(); + b = Brush_Create(e->eclass->mins, e->eclass->maxs, &e->eclass->texdef); + Entity_LinkBrush(e, b); + Brush_AddToList(b, &active_brushes); + Select_Brush(b); + Brush_Move(b, origin, true); + } + else + { + Select_GroupEntity(e); + if(e->brushes.onext == &e->brushes) { - if(m_chasemouse_handler != 0) + Sys_FPrintf(SYS_ERR, "CreateEntityFromName: selection could not be grouped\n"); + Entity_Free(e); + return; + } + } + + Entity_AddToList(e, &entities); + Undo_EndEntity(e); + + Select_Deselect (); + + // tweaking: when right clic dropping a light entity, ask for light value in a custom dialog box + // see SF bug 105383 + + if (g_pGameDescription->mGameFile == "hl.game") + { + // FIXME - Hydra: really we need a combined light AND color dialog for halflife. + if ((stricmp(name, "light") == 0) || + (stricmp(name, "light_environment") == 0) || + (stricmp(name, "light_spot") == 0) ) + { + int intensity = g_PrefsDlg.m_iLastLightIntensity; + + // Create and show the dialog box + // CWnd *pWnd; + // pWnd = prompt.GetDlgItem( IDC_EDIT1 ); + // prompt.GotoDlgCtrl( pWnd ); + if (DoLightIntensityDlg (&intensity) == IDOK) { - //globalOutputStream() << "chasemouse cancel\n"; - g_source_remove(m_chasemouse_handler); - m_chasemouse_handler = 0; + g_PrefsDlg.m_iLastLightIntensity = intensity; + char buf[30]; + sprintf( buf, "255 255 255 %d", intensity ); + SetKeyValue(e, "_light", buf); } } } else { - if(m_chasemouse_handler != 0) + if (stricmp(name, "light") == 0) + { + int intensity = g_PrefsDlg.m_iLastLightIntensity; + + // Create and show the dialog box + // CWnd *pWnd; + // pWnd = prompt.GetDlgItem( IDC_EDIT1 ); + // prompt.GotoDlgCtrl( pWnd ); + if (DoLightIntensityDlg (&intensity) == IDOK) { - //globalOutputStream() << "chasemouse cancel\n"; - g_source_remove(m_chasemouse_handler); - m_chasemouse_handler = 0; + g_PrefsDlg.m_iLastLightIntensity = intensity; + char buf[10]; + sprintf( buf, "%d", intensity ); + SetKeyValue(e, "light", buf); } } + } + Select_Brush (e->brushes.onext); + + if ( (stricmp(name, "misc_model") == 0) || (stricmp(name, "misc_gamemodel") == 0) || (strcmpi(name, "model_static") == 0) ) + { + SetInspectorMode(W_ENTITY); + AssignModel(); + } +} + +void CreateRightClickEntity(XYWnd* pWnd, int x, int y, char* pName) +{ + int height = pWnd->GetWidget()->allocation.height; + vec3_t point; + pWnd->SnapToPoint (x, height - 1 - y, point); + + int nDim = (pWnd->GetViewType() == XY) ? 2 : (pWnd->GetViewType() == YZ) ? 0 : 1; + float fWorkMid = (g_qeglobals.d_work_min[nDim] + g_qeglobals.d_work_max[nDim]) * 0.5; + point[nDim] = g_qeglobals.d_gridsize * ((int)(fWorkMid/g_qeglobals.d_gridsize)); + + CreateEntityFromName(pName, point); +} + + +brush_t* CreateSmartBrush(vec3_t v) +{ + vec3_t mins, maxs; + int i; + brush_t *n; + + for (i=0 ; i<3 ; i++) + { + mins[i] = v[i] - 16; + maxs[i] = v[i] + 16; + } + + n = Brush_Create (mins, maxs, &g_qeglobals.d_texturewin.texdef); + if (!n) + return NULL; + + Brush_AddToList(n, &selected_brushes); + //Entity_LinkBrush(world_entity, n); + Brush_Build(n); + return n; +} + +CString g_strSmartEntity; +int g_nSmartX; +int g_nSmartY; +bool g_bSmartWaiting; +void _SmartPointDone(bool b, int n) +{ + g_bSmartWaiting = false; +} + +void CreateSmartEntity(XYWnd* pWnd, int x, int y, const char* pName) +{ + g_nSmartX = x; + g_nSmartY = y; + g_strSmartEntity = pName; + if (g_strSmartEntity.Find("Smart_Train") >= 0) + { + ShowInfoDialog("Select the path of the train by left clicking in XY, YZ and/or XZ views. You can move an already dropped point by grabbing and moving it. When you are finished, press ENTER to accept and create the entity and path(s), press ESC to abandon the creation"); + g_bPathMode = true; + g_nPathLimit = 0; + g_nPathCount = 0; + g_bSmartGo = true; + } + else + if (g_strSmartEntity.Find("Smart_Monster...") >= 0) + { + g_bPathMode = true; + g_nPathLimit = 0; + g_nPathCount = 0; + } + else + if (g_strSmartEntity.Find("Smart_Rotating") >= 0) + { + g_bSmartWaiting = true; + ShowInfoDialog("Left click to specify the rotation origin"); + AcquirePath(1, &_SmartPointDone); + while (g_bSmartWaiting) + gtk_main_iteration (); + HideInfoDialog(); + CPtrArray array; + g_bScreenUpdates = false; + CreateRightClickEntity(g_pParentWnd->ActiveXY(), g_nSmartX, g_nSmartY, "func_rotating"); + array.Add(reinterpret_cast(selected_brushes.next)); + Select_Deselect(); + brush_t* pBrush = CreateSmartBrush(g_PathPoints[0]); + array.Add(pBrush); + Select_Deselect(); + Select_Brush(reinterpret_cast(array.GetAt(0))); + Select_Brush(reinterpret_cast(array.GetAt(1))); + ConnectEntities(); + g_bScreenUpdates = true; + } +} + +void FinishSmartCreation() +{ + CPtrArray array; + HideInfoDialog(); + // brush_t* pEntities = NULL; + int n; + + if (g_strSmartEntity.Find("Smart_Train") >= 0) + { + g_bScreenUpdates = false; + CreateRightClickEntity(g_pParentWnd->ActiveXY(), g_nSmartX, g_nSmartY, "func_train"); + array.Add(reinterpret_cast(selected_brushes.next)); + for (n = 0; n < g_nPathCount; n++) + { + Select_Deselect(); + CreateRightClickEntity(g_pParentWnd->ActiveXY(), g_PathPoints[n].m_ptScreenX, + g_PathPoints[n].m_ptScreenY, "path_corner"); + array.Add(reinterpret_cast(selected_brushes.next)); + } + + for (n = 0; n < g_nPathCount; n++) + { + Select_Deselect(); + Select_Brush(reinterpret_cast(array.GetAt(n))); + Select_Brush(reinterpret_cast(array.GetAt(n+1))); + ConnectEntities(); + } + g_bScreenUpdates = true; + + } + g_nPathCount = 0; + g_bPathMode = false; + Sys_UpdateWindows(W_ALL); +} + +void CleanCopyEntities() +{ + entity_t* pe = g_enClipboard.next; + while (pe != NULL && pe != &g_enClipboard) + { + entity_t* next = pe->next; + epair_t* enext = NULL; + for (epair_t* ep = pe->epairs ; ep ; ep=enext) + { + enext = ep->next; + free (ep->key); + free (ep->value); + free (ep); + } + free (pe); + pe = next; + } + g_enClipboard.next = g_enClipboard.prev = &g_enClipboard; +} + +entity_t *Entity_CopyClone (entity_t *e) +{ + entity_t *n; + epair_t *ep, *np; + + n = (entity_t*)qmalloc(sizeof(*n)); + n->brushes.onext = n->brushes.oprev = &n->brushes; + n->eclass = e->eclass; + + // add the entity to the entity list + n->next = g_enClipboard.next; + g_enClipboard.next = n; + n->next->prev = n; + n->prev = &g_enClipboard; + + for (ep = e->epairs ; ep ; ep=ep->next) + { + np = (epair_t*)qmalloc(sizeof(*np)); + np->key = copystring(ep->key); + np->value = copystring(ep->value); + np->next = n->epairs; + n->epairs = np; + } + return n; +} + +bool OnList(entity_t* pFind, CPtrArray* pList) +{ + int nSize = pList->GetSize(); + while (nSize-- > 0) + { + entity_t* pEntity = reinterpret_cast(pList->GetAt(nSize)); + if (pEntity == pFind) + return true; + } return false; } // ============================================================================= // XYWnd class -Shader* XYWnd::m_state_selected = 0; -void xy_update_xor_rectangle(XYWnd& self, rect_t area) -{ - if(GTK_WIDGET_VISIBLE(self.GetWidget())) - { - self.m_XORRectangle.set(rectangle_from_area(area.min, area.max, self.Width(), self.Height())); - } -} - -gboolean xywnd_button_press(GtkWidget* widget, GdkEventButton* event, XYWnd* xywnd) -{ - if(event->type == GDK_BUTTON_PRESS) - { - g_pParentWnd->SetActiveXY(xywnd); - - xywnd->ButtonState_onMouseDown(buttons_for_event_button(event)); - - xywnd->onMouseDown(WindowVector(event->x, event->y), button_for_button(event->button), modifiers_for_state(event->state)); - } - return FALSE; -} - -gboolean xywnd_button_release(GtkWidget* widget, GdkEventButton* event, XYWnd* xywnd) -{ - if(event->type == GDK_BUTTON_RELEASE) - { - xywnd->XY_MouseUp(static_cast(event->x), static_cast(event->y), buttons_for_event_button(event)); - - xywnd->ButtonState_onMouseUp(buttons_for_event_button(event)); - } - return FALSE; -} - -void xywnd_motion(gdouble x, gdouble y, guint state, void* data) -{ - if(reinterpret_cast(data)->chaseMouseMotion(static_cast(x), static_cast(y))) - { - return; - } - reinterpret_cast(data)->XY_MouseMoved(static_cast(x), static_cast(y), buttons_for_state(state)); -} - -gboolean xywnd_wheel_scroll(GtkWidget* widget, GdkEventScroll* event, XYWnd* xywnd) -{ - if(event->direction == GDK_SCROLL_UP) - { - XYWnd_ZoomIn(xywnd); - } - else if(event->direction == GDK_SCROLL_DOWN) - { - XYWnd_ZoomOut(xywnd); - } - return FALSE; -} - -gboolean xywnd_size_allocate(GtkWidget* widget, GtkAllocation* allocation, XYWnd* xywnd) -{ - xywnd->m_nWidth = allocation->width; - xywnd->m_nHeight = allocation->height; - xywnd->updateProjection(); - xywnd->m_window_observer->onSizeChanged(xywnd->Width(), xywnd->Height()); - return FALSE; -} - -gboolean xywnd_expose(GtkWidget* widget, GdkEventExpose* event, XYWnd* xywnd) -{ - if(glwidget_make_current(xywnd->GetWidget()) != FALSE) - { - if(Map_Valid(g_map) && ScreenUpdates_Enabled()) - { - GlobalOpenGL_debugAssertNoErrors(); - xywnd->XY_Draw(); - GlobalOpenGL_debugAssertNoErrors(); - - xywnd->m_XORRectangle.set(rectangle_t()); - } - glwidget_swap_buffers(xywnd->GetWidget()); - } - return FALSE; -} - - -void XYWnd_CameraMoved(XYWnd& xywnd) -{ - if(g_xywindow_globals_private.m_bCamXYUpdate) - { - XYWnd_Update(xywnd); - } -} - -XYWnd::XYWnd() : - m_gl_widget(glwidget_new(FALSE)), - m_deferredDraw(WidgetQueueDrawCaller(*m_gl_widget)), - m_deferred_motion(xywnd_motion, this), - m_parent(0), - m_window_observer(NewWindowObserver()), - m_XORRectangle(m_gl_widget), - m_chasemouse_handler(0) +XYWnd::XYWnd () + : GLWindow (FALSE), m_XORRectangle(m_pWidget) { + g_brClipboard.next = &g_brClipboard; + g_brUndo.next = &g_brUndo; + g_nScaleHow = 0; + g_bRotateMode = false; + g_bClipMode = false; + g_bRogueClipMode = false; + g_bSwitch = true; + g_pMovingClip = (ClipPoint*)NULL; + g_pMovingPath = (ClipPoint*)NULL; + g_brFrontSplits.next = &g_brFrontSplits; + g_brBackSplits.next = &g_brBackSplits; m_bActive = false; - m_buttonstate = 0; - - m_bNewBrushDrag = false; - m_move_started = false; - m_zoom_started = false; - - m_nWidth = 0; - m_nHeight = 0; - - m_vOrigin[0] = 0; - m_vOrigin[1] = 20; - m_vOrigin[2] = 46; - m_fScale = 1; - m_viewType = XY; - - m_entityCreate = false; - - m_mnuDrop = 0; - - GlobalWindowObservers_add(m_window_observer); - GlobalWindowObservers_connectWidget(m_gl_widget); - - m_window_observer->setRectangleDrawCallback(ReferenceCaller1(*this)); - m_window_observer->setView(m_view); - - gtk_widget_ref(m_gl_widget); - - gtk_widget_set_events(m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK); - GTK_WIDGET_SET_FLAGS(m_gl_widget, GTK_CAN_FOCUS); - - m_sizeHandler = g_signal_connect(G_OBJECT(m_gl_widget), "size_allocate", G_CALLBACK(xywnd_size_allocate), this); - m_exposeHandler = g_signal_connect(G_OBJECT(m_gl_widget), "expose_event", G_CALLBACK(xywnd_expose), this); - - g_signal_connect(G_OBJECT(m_gl_widget), "button_press_event", G_CALLBACK(xywnd_button_press), this); - g_signal_connect(G_OBJECT(m_gl_widget), "button_release_event", G_CALLBACK(xywnd_button_release), this); - g_signal_connect(G_OBJECT(m_gl_widget), "motion_notify_event", G_CALLBACK(DeferredMotion::gtk_motion), &m_deferred_motion); - - g_signal_connect(G_OBJECT(m_gl_widget), "scroll_event", G_CALLBACK(xywnd_wheel_scroll), this); - - Map_addValidCallback(g_map, DeferredDrawOnMapValidChangedCaller(m_deferredDraw)); - - updateProjection(); - updateModelview(); - - AddSceneChangeCallback(ReferenceCaller(*this)); - AddCameraMovedCallback(ReferenceCaller(*this)); - - PressedButtons_connect(g_pressedButtons, m_gl_widget); - - onMouseDown.connectLast(makeSignalHandler3(MouseDownCaller(), *this)); + //m_bTiming = true; + m_bTiming = false; + m_bRButtonDown = false; + m_nUpdateBits = W_XY; + g_bPathMode = false; + g_nPathCount = 0; + g_nPathLimit = 0; + m_nButtonstate = 0; +// m_mnuDrop = (GtkWidget*)NULL; + XY_Init(); } -XYWnd::~XYWnd() +vec3_t& XYWnd::Rotation() { - onDestroyed(); + return g_vRotation; +} - if(m_mnuDrop != 0) +vec3_t& XYWnd::RotateOrigin() +{ + return g_vRotateOrigin; +} + +/* +============== +XY_Overlay +============== +*/ +void XYWnd::XY_Overlay() +{ + int w, h; + int r[4]; + static vec3_t lastz; + static vec3_t lastcamera; + + qglViewport(0, 0, m_nWidth, m_nHeight); + + // + // set up viewpoint + // + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity (); + + w = (int)(m_nWidth / 2 / m_fScale); + h = (int)(m_nHeight / 2 / m_fScale); + + qglOrtho (m_vOrigin[0] - w, m_vOrigin[0] + w , m_vOrigin[1] - h, m_vOrigin[1] + h, g_MinWorldCoord, g_MaxWorldCoord); + // + // erase the old camera and z checker positions + // if the entire xy hasn't been redrawn + // + if (m_bDirty) { - gtk_widget_destroy(GTK_WIDGET(m_mnuDrop)); - m_mnuDrop = 0; + qglReadBuffer (GL_BACK); + qglDrawBuffer (GL_FRONT); + + qglRasterPos2f (lastz[0]-9, lastz[1]-9); + qglGetIntegerv (GL_CURRENT_RASTER_POSITION,r); + qglCopyPixels(r[0], r[1], 18,18, GL_COLOR); + + qglRasterPos2f (lastcamera[0]-50, lastcamera[1]-50); + qglGetIntegerv (GL_CURRENT_RASTER_POSITION,r); + qglCopyPixels(r[0], r[1], 100,100, GL_COLOR); } + m_bDirty = true; - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_sizeHandler); - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_exposeHandler); + // + // save off underneath where we are about to draw + // + VectorCopy (z.origin, lastz); + VectorCopy (g_pParentWnd->GetCamWnd()->Camera()->origin, lastcamera); - gtk_widget_unref(m_gl_widget); + qglReadBuffer (GL_FRONT); + qglDrawBuffer (GL_BACK); - m_window_observer->release(); + qglRasterPos2f (lastz[0]-9, lastz[1]-9); + qglGetIntegerv (GL_CURRENT_RASTER_POSITION,r); + qglCopyPixels(r[0], r[1], 18,18, GL_COLOR); + + qglRasterPos2f (lastcamera[0]-50, lastcamera[1]-50); + qglGetIntegerv (GL_CURRENT_RASTER_POSITION,r); + qglCopyPixels(r[0], r[1], 100,100, GL_COLOR); + + // + // draw the new icons + // + qglDrawBuffer (GL_FRONT); + + qglShadeModel (GL_FLAT); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_DEPTH_TEST); + qglDisable(GL_BLEND); + qglColor3f(0, 0, 0); + + DrawCameraIcon (); + DrawZIcon (); + + qglDrawBuffer (GL_BACK); + qglFinish(); } -void XYWnd::captureStates() -{ - m_state_selected = GlobalShaderCache().capture("$XY_OVERLAY"); -} - -void XYWnd::releaseStates() -{ - GlobalShaderCache().release("$XY_OVERLAY"); -} - -const Vector3& XYWnd::GetOrigin() +vec3_t& XYWnd::GetOrigin() { return m_vOrigin; } -void XYWnd::SetOrigin(const Vector3& origin) +void XYWnd::SetOrigin(vec3_t org) { - m_vOrigin = origin; - updateModelview(); + m_vOrigin[0] = org[0]; + m_vOrigin[1] = org[1]; + m_vOrigin[2] = org[2]; } -void XYWnd::Scroll(int x, int y) +void XYWnd::OnSize(int cx, int cy) { - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; - m_vOrigin[nDim1] += x / m_fScale; - m_vOrigin[nDim2] += y / m_fScale; - updateModelview(); - queueDraw(); + m_nWidth = cx; + m_nHeight = cy; } -unsigned int Clipper_buttons() +brush_t hold_brushes; + +void XYWnd::Clip() { - return RAD_LBUTTON; -} - -void XYWnd::DropClipPoint(int pointx, int pointy) -{ - Vector3 point; - - XY_ToPoint(pointx, pointy, point); - - Vector3 mid; - Select_GetMid(mid); - g_clip_viewtype = static_cast(GetViewType()); - int nDim = (g_clip_viewtype == YZ ) ? nDim = 0 : ( (g_clip_viewtype == XZ) ? nDim = 1 : nDim = 2 ); - point[nDim] = mid[nDim]; - vector3_snap(point, GetGridSize()); - NewClipPoint(point); -} - -void XYWnd::Clipper_OnLButtonDown(int x, int y) -{ - Vector3 mousePosition; - XY_ToPoint(x, y , mousePosition); - g_pMovingClip = GlobalClipPoints_Find(mousePosition, (VIEWTYPE)m_viewType, m_fScale); - if(!g_pMovingClip) + if (ClipMode()) { - DropClipPoint(x, y); + hold_brushes.next = &hold_brushes; + ProduceSplitLists(); + brush_t* pList; + if (g_PrefsDlg.m_bSwitchClip) + pList = (!g_bSwitch) ? &g_brFrontSplits : &g_brBackSplits; + else + pList = (g_bSwitch) ? &g_brFrontSplits : &g_brBackSplits; + + if (pList->next != pList) + { + Brush_CopyList(pList, &hold_brushes); + CleanList(&g_brFrontSplits); + CleanList(&g_brBackSplits); + Select_Delete(); + Brush_CopyList(&hold_brushes, &selected_brushes); + if (RogueClipMode()) + RetainClipMode(false); + else + RetainClipMode(true); + Sys_UpdateWindows(W_ALL); + } + } + else if (PathMode()) + { + FinishSmartCreation(); + if (g_pPathFunc) + g_pPathFunc(true, g_nPathCount); + g_pPathFunc = NULL; + g_nPathCount = 0; + g_bPathMode = false; } } -void XYWnd::Clipper_OnLButtonUp(int x, int y) +void XYWnd::SplitClip() { - if (g_pMovingClip) + ProduceSplitLists(); + if ((g_brFrontSplits.next != &g_brFrontSplits) && + (g_brBackSplits.next != &g_brBackSplits)) { - g_pMovingClip = 0; + Select_Delete(); + Brush_CopyList(&g_brFrontSplits, &selected_brushes); + Brush_CopyList(&g_brBackSplits, &selected_brushes); + CleanList(&g_brFrontSplits); + CleanList(&g_brBackSplits); + if (RogueClipMode()) + RetainClipMode(false); + else + RetainClipMode(true); } } -void XYWnd::Clipper_OnMouseMoved(int x, int y) +void XYWnd::FlipClip() { - if (g_pMovingClip) - { - XY_ToPoint(x, y , g_pMovingClip->m_ptClip); - XY_SnapToGrid(g_pMovingClip->m_ptClip); - Clip_Update(); - ClipperChangeNotify(); - } + g_bSwitch = !g_bSwitch; + Sys_UpdateWindows(XY | W_CAMERA_IFON); } -void XYWnd::Clipper_Crosshair_OnMouseMoved(int x, int y) +// makes sure the selected brush or camera is in view +void XYWnd::PositionView() { - Vector3 mousePosition; - XY_ToPoint(x, y , mousePosition); - if(ClipMode() && GlobalClipPoints_Find(mousePosition, (VIEWTYPE)m_viewType, m_fScale) != 0) + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + brush_t* b = selected_brushes.next; + if (b && b->next != b) { - GdkCursor *cursor; - cursor = gdk_cursor_new (GDK_CROSSHAIR); - gdk_window_set_cursor (m_gl_widget->window, cursor); - gdk_cursor_unref (cursor); + Select_GetMid (m_vOrigin); } else { - gdk_window_set_cursor (m_gl_widget->window, 0); + m_vOrigin[nDim1] = g_pParentWnd->GetCamWnd()->Camera()->origin[nDim1]; + m_vOrigin[nDim2] = g_pParentWnd->GetCamWnd()->Camera()->origin[nDim2]; } } -unsigned int MoveCamera_buttons() +void XYWnd::VectorCopyXY(vec3_t in, vec3_t out) { - return RAD_CONTROL | (g_glwindow_globals.m_nMouseType == ETwoButton ? RAD_RBUTTON : RAD_MBUTTON); -} - -void XYWnd_PositionCamera(XYWnd* xywnd, int x, int y, CamWnd& camwnd) -{ - Vector3 origin(Camera_getOrigin(camwnd)); - xywnd->XY_ToPoint(x, y, origin); - xywnd->XY_SnapToGrid(origin); - Camera_setOrigin(camwnd, origin); -} - -unsigned int OrientCamera_buttons() -{ - if(g_glwindow_globals.m_nMouseType == ETwoButton) - return RAD_RBUTTON | RAD_SHIFT | RAD_CONTROL; - return RAD_MBUTTON; -} - -void XYWnd_OrientCamera(XYWnd* xywnd, int x, int y, CamWnd& camwnd) -{ - Vector3 point = g_vector3_identity; - xywnd->XY_ToPoint(x, y, point); - xywnd->XY_SnapToGrid(point); - vector3_subtract(point, Camera_getOrigin(camwnd)); - - int n1 = (xywnd->GetViewType() == XY) ? 1 : 2; - int n2 = (xywnd->GetViewType() == YZ) ? 1 : 0; - int nAngle = (xywnd->GetViewType() == XY) ? CAMERA_YAW : CAMERA_PITCH; - if (point[n1] || point[n2]) + if (m_nViewType == XY) { - Vector3 angles(Camera_getAngles(camwnd)); - angles[nAngle] = static_cast(radians_to_degrees(atan2 (point[n1], point[n2]))); - Camera_setAngles(camwnd, angles); + out[0] = in[0]; + out[1] = in[1]; } + else if (m_nViewType == XZ) + { + out[0] = in[0]; + out[2] = in[2]; + } + else + { + out[1] = in[1]; + out[2] = in[2]; + } +} + +void XYWnd::RetainClipMode(bool bMode) +{ + bool bSave = g_bRogueClipMode; + SetClipMode(bMode); + if (bMode == true) + g_bRogueClipMode = bSave; + else + g_bRogueClipMode = false; +} + +void XYWnd::SetClipMode(bool bMode) +{ + g_bClipMode = bMode; + g_bRogueClipMode = false; + if (bMode) + { + g_Clip1.Reset(); + g_Clip2.Reset(); + g_Clip3.Reset(); + CleanList(&g_brFrontSplits); + CleanList(&g_brBackSplits); + g_brFrontSplits.next = &g_brFrontSplits; + g_brBackSplits.next = &g_brBackSplits; + + // ydnar: set clipper points based on first selected patch mesh + if( selected_brushes.next != &selected_brushes ) + { + bool found = false; + for( brush_t *pb = selected_brushes.next; pb != &selected_brushes; pb = pb->next ) + { + if( pb->patchBrush ) + { + found = true; + VectorCopy( pb->pPatch->ctrl[ 0 ][ 0 ].xyz, g_Clip1.m_ptClip ); + VectorCopy( pb->pPatch->ctrl[ pb->pPatch->width - 1 ][ pb->pPatch->height - 1 ].xyz, g_Clip2.m_ptClip ); + VectorCopy( pb->pPatch->ctrl[ pb->pPatch->width - 1 ][ 0 ].xyz, g_Clip3.m_ptClip ); + g_Clip1.Set( true ); + g_Clip2.Set( true ); + g_Clip3.Set( true ); + break; + } + } + + if( found ) + { + // SetClipMode( true ); + Sys_UpdateWindows( XY | W_CAMERA_IFON ); + } + } + } + else + { + if (g_pMovingClip) + { + ReleaseCapture(); + g_pMovingClip = NULL; + } + CleanList(&g_brFrontSplits); + CleanList(&g_brBackSplits); + g_brFrontSplits.next = &g_brFrontSplits; + g_brBackSplits.next = &g_brBackSplits; + Sys_UpdateWindows(XY | W_CAMERA_IFON); + } +} + +bool XYWnd::ClipMode() +{ + return g_bClipMode; +} + +bool XYWnd::RogueClipMode() +{ + return g_bRogueClipMode; +} + +bool XYWnd::PathMode() +{ + return g_bPathMode; +} + +bool XYWnd::PointMode() +{ + return g_bPointMode; +} + +void XYWnd::SetPointMode(bool b) +{ + g_bPointMode = b; + if (!b) + g_nPointCount = 0; +} + +void XYWnd::SetViewType(int n) +{ + m_nViewType = n; + if (g_pParentWnd->CurrentStyle() == MainFrame::eFloating) + { + char* str = "YZ Side"; + if (m_nViewType == XY) + str = "XY Top"; + else if (m_nViewType == XZ) + str = "XZ Front"; + + if (m_pParent != NULL) + gtk_window_set_title (GTK_WINDOW (m_pParent), str); + } +} + +void XYWnd::Redraw(unsigned int nBits) +{ + m_nUpdateBits = nBits; + gtk_widget_queue_draw(m_pWidget); + m_nUpdateBits = W_XY; +} + +bool XYWnd::RotateMode() +{ + return g_bRotateMode; +} + +bool XYWnd::ScaleMode() +{ + return g_bScaleMode; +} + +bool XYWnd::SetRotateMode(bool bMode) +{ + if (bMode && selected_brushes.next != &selected_brushes) + { + g_bRotateMode = true; + Select_GetTrueMid(g_vRotateOrigin); + g_vRotation[0] = g_vRotation[1] = g_vRotation[2] = 0.0; + } + else + { + if (bMode) + Sys_Printf("Need a brush selected to turn on Mouse Rotation mode\n"); + g_bRotateMode = false; + } + RedrawWindow(); + return g_bRotateMode; +} + +void XYWnd::SetScaleMode(bool bMode) +{ + g_bScaleMode = bMode; + RedrawWindow(); +} + +rectangle_t rectangle_from_area_xy() +{ + XYWnd* xy = g_pParentWnd->ActiveXY(); + int nDim1 = (xy->GetViewType() == YZ) ? 1 : 0; + int nDim2 = (xy->GetViewType() == XY) ? 1 : 2; + float origin_left = xy->GetOrigin()[nDim1] - (xy->Width() / 2) / xy->Scale(); + float origin_bottom = xy->GetOrigin()[nDim2] - (xy->Height() / 2) / xy->Scale(); + float left = MIN(g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1]) - origin_left; + float top = MAX(g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2]) - origin_bottom; + float right = MAX(g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1]) - origin_left; + float bottom = MIN(g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2]) - origin_bottom; + left *= xy->Scale(); + top *= xy->Scale(); + right *= xy->Scale(); + bottom *= xy->Scale(); + return rectangle_t(left, bottom, right - left, top - bottom); +} + +void update_xor_rectangle_xy(XORRectangle& xor_rectangle) +{ + rectangle_t rectangle; + if ((g_qeglobals.d_select_mode == sel_area)) + rectangle = rectangle_from_area_xy(); + xor_rectangle.set(rectangle); +} + +void XYWnd::OnMouseMove(guint32 nFlags, int pointx, int pointy) +{ + // plugin entities + // TODO TTimo handle return code + DispatchOnMouseMove (nFlags, pointx, pointy); + + m_ptDownX = 0; + m_ptDownY = 0; + + if (g_PrefsDlg.m_bChaseMouse == TRUE && + (pointx < 0 || pointy < 0 || pointx > m_nWidth || pointy > m_nHeight) && + HasCapture ()) + { + float fAdjustment = (g_qeglobals.d_gridsize / 8 * 64) / m_fScale; + //m_ptDrag = point; + m_ptDragAdjX = 0; + m_ptDragAdjY = 0; + + if (pointx < 0) + { + m_ptDragAdjX = (int)(-fAdjustment); + } + else if (pointx > m_nWidth) + { + m_ptDragAdjX = (int)(fAdjustment); + } + + if (pointy < 0) + { + m_ptDragAdjY = (int)(-fAdjustment); + } + else if (pointy > m_nHeight) + { + m_ptDragAdjY = (int)(fAdjustment); + } + + if (!HasTimer ()) + { + SetTimer (50); + m_ptDragX = pointx; + m_ptDragY = pointy; + m_ptDragTotalX = 0; + m_ptDragTotalY = 0; + } + return; + } + + if (HasTimer ()) + { + KillTimer (); + pressx -= m_ptDragTotalX; + pressy += m_ptDragTotalY; + } + + bool bCrossHair = false; + if (!m_bRButtonDown) + { + tdp[0] = tdp[1] = tdp[2] = 0.0; + SnapToPoint (pointx, m_nHeight - 1 - pointy , tdp); + + g_strStatus.Format("x:: %.1f y:: %.1f z:: %.1f", tdp[0], tdp[1], tdp[2]); + g_pParentWnd->SetStatusText(1, g_strStatus); + + // i need to generalize the point code.. having 3 flavors pretty much sucks.. + // once the new curve stuff looks like it is going to stick i will + // rationalize this down to a single interface.. + if (PointMode()) + { + if (g_pMovingPoint && HasCapture ()) + { + bCrossHair = true; + SnapToPoint (pointx, m_nHeight - 1 - pointy , g_pMovingPoint->m_ptClip); + g_pMovingPoint->UpdatePointPtr(); + Sys_UpdateWindows(XY | W_CAMERA_IFON); + } + else + { + g_pMovingPoint = NULL; + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + for (int n = 0; n < g_nPointCount; n++) + { + if ( fDiff(g_PointPoints[n].m_ptClip[nDim1], tdp[nDim1]) < 3 && + fDiff(g_PointPoints[n].m_ptClip[nDim2], tdp[nDim2]) < 3 ) + { + bCrossHair = true; + g_pMovingPoint = &g_PointPoints[n]; + } + } + } + } + else if (ClipMode()) + { + if (g_pMovingClip && HasCapture ()) + { + bCrossHair = true; + SnapToPoint (pointx, m_nHeight - 1 - pointy , g_pMovingClip->m_ptClip); + Sys_UpdateWindows(XY | W_CAMERA_IFON); + } + else + { + g_pMovingClip = NULL; + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + if (g_Clip1.Set()) + { + if ( fDiff(g_Clip1.m_ptClip[nDim1], tdp[nDim1]) < 3 && + fDiff(g_Clip1.m_ptClip[nDim2], tdp[nDim2]) < 3 ) + { + bCrossHair = true; + g_pMovingClip = &g_Clip1; + } + } + if (g_Clip2.Set()) + { + if ( fDiff(g_Clip2.m_ptClip[nDim1], tdp[nDim1]) < 3 && + fDiff(g_Clip2.m_ptClip[nDim2], tdp[nDim2]) < 3 ) + { + bCrossHair = true; + g_pMovingClip = &g_Clip2; + } + } + if (g_Clip3.Set()) + { + if ( fDiff(g_Clip3.m_ptClip[nDim1], tdp[nDim1]) < 3 && + fDiff(g_Clip3.m_ptClip[nDim2], tdp[nDim2]) < 3 ) + { + bCrossHair = true; + g_pMovingClip = &g_Clip3; + } + } + } + if (bCrossHair == false) + XY_MouseMoved (pointx, m_nHeight - 1 - pointy , nFlags); + } + else if (PathMode()) + { + if (g_pMovingPath && HasCapture ()) + { + bCrossHair = true; + SnapToPoint (pointx, m_nHeight - 1 - pointy , g_pMovingPath->m_ptClip); + Sys_UpdateWindows(XY | W_CAMERA_IFON); + } + else + { + g_pMovingPath = NULL; + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + for (int n = 0; n < g_nPathCount; n++) + { + if ( fDiff(g_PathPoints[n].m_ptClip[nDim1], tdp[nDim1]) < 3 && + fDiff(g_PathPoints[n].m_ptClip[nDim2], tdp[nDim2]) < 3 ) + { + bCrossHair = true; + g_pMovingPath = &g_PathPoints[n]; + } + } + } + } + else + { + XY_MouseMoved (pointx, m_nHeight - 1 - pointy , nFlags); + } + } + else + { + XY_MouseMoved (pointx, m_nHeight - 1 - pointy , nFlags); + } + + if ((nFlags & MK_RBUTTON) == 0) + { + if (bCrossHair && !g_bWaitCursor) + { + GdkCursor *cursor; + cursor = gdk_cursor_new (GDK_CROSSHAIR); + gdk_window_set_cursor (m_pWidget->window, cursor); + gdk_cursor_unref (cursor); + } + else + { + gdk_window_set_cursor (m_pWidget->window, NULL); + } + } + + update_xor_rectangle_xy(m_XORRectangle); +} + +void XYWnd::OnMouseWheel(bool bUp) +{ + if (bUp) + g_pParentWnd->OnViewZoomin (); + else + g_pParentWnd->OnViewZoomout (); + + int nUpdate = (g_PrefsDlg.m_bCamXYUpdate) ? (W_CAMERA | W_XY) : (W_CAMERA); + Sys_UpdateWindows (nUpdate); + g_pParentWnd->OnTimer (); +} + +void XYWnd::OnTimer () +{ + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + m_vOrigin[nDim1] += m_ptDragAdjX / m_fScale; + m_vOrigin[nDim2] -= m_ptDragAdjY / m_fScale; + Sys_UpdateWindows(W_XY | W_CAMERA); + m_ptDragX += m_ptDragAdjX; + m_ptDragY += m_ptDragAdjY; + m_ptDragTotalX += m_ptDragAdjX; + m_ptDragTotalY += m_ptDragAdjY; + XY_MouseMoved (m_ptDragX, m_nHeight - 1 - m_ptDragY , m_nScrollFlags); +} + +void XYWnd::OnLButtonDown(guint32 flags, int pointx, int pointy) +{ + g_pParentWnd->SetActiveXY(this); + UndoCopy(); + + // plugin entities + if (DispatchOnLButtonDown(flags, pointx, pointy)) + return; + + if (ClipMode() && !RogueClipMode()) + { + DropClipPoint(flags, pointx, pointy); + } + else if (PathMode()) + { + DropPathPoint(flags, pointx, pointy); + } + else OriginalButtonDown(flags, pointx, pointy); +} + +void XYWnd::OnMButtonDown(guint32 flags, int pointx, int pointy) +{ + OriginalButtonDown(flags, pointx, pointy); +} + +void XYWnd::OnRButtonDown(guint32 flags, int pointx, int pointy) +{ + g_pParentWnd->SetActiveXY(this); + m_ptDownX = pointx; + m_ptDownY = pointy; + m_bRButtonDown = true; + + if (g_PrefsDlg.m_nMouseButtons == 3) // 3 button mouse + { + if (flags & MK_CONTROL) + { + if (ClipMode()) // already there? + DropClipPoint(flags, pointx, pointy); + else + { + SetClipMode(true); + g_bRogueClipMode = true; + DropClipPoint(flags, pointx, pointy); + } + return; + } + } + OriginalButtonDown(flags, pointx, pointy); +} + +void XYWnd::OnLButtonUp(guint32 flags, int pointx, int pointy) +{ + // plugin entities + if (DispatchOnLButtonUp(flags, pointx, pointy)) + return; + + if (ClipMode()) + { + if (g_pMovingClip) + { + ReleaseCapture(); + g_pMovingClip = NULL; + } + } + OriginalButtonUp(flags, pointx, pointy); +} + +void XYWnd::OnMButtonUp(guint32 flags, int pointx, int pointy) +{ + OriginalButtonUp(flags, pointx, pointy); +} + +void XYWnd::OnRButtonUp(guint32 flags, int pointx, int pointy) +{ + m_bRButtonDown = false; + if ((pointx == m_ptDownX) && (pointy == m_ptDownY)) // mouse didn't move + { + bool bGo = true; + if (Sys_AltDown ()) + bGo = false; + if (flags & MK_CONTROL) + bGo = false; + if (flags & MK_SHIFT) + bGo = false; + if (bGo) + HandleDrop(); + } + OriginalButtonUp(flags, pointx, pointy); +} + +void XYWnd::XY_MouseDown (int x, int y, int buttons) +{ + vec3_t point; + vec3_t origin, dir, right, up; + + m_nButtonstate = buttons; + m_nPressx = x; + m_nPressy = y; + VectorCopy (vec3_origin, m_vPressdelta); + + VectorClear(point); + XY_ToPoint (x, y, point); + + VectorCopy (point, origin); + + VectorClear (dir); + if (m_nViewType == XY) // view facing dir = negative Z + { + origin[2] = g_MaxWorldCoord; + dir[2] = -1; + right[0] = 1 / m_fScale; + right[1] = 0; + right[2] = 0; + up[0] = 0; + up[1] = 1 / m_fScale; + up[2] = 0; + } + else if (m_nViewType == XZ) + { + origin[1] = g_MinWorldCoord; // view facing dir = positive Y + dir[1] = 1; + right[0] = 1 / m_fScale; + right[1] = 0; + right[2] = 0; + up[0] = 0; + up[1] = 0; + up[2] = 1 / m_fScale; + } + else // if (m_nViewType == YZ) // view facing dir = negative X + { + origin[0] = g_MaxWorldCoord; + dir[0] = -1; + right[0] = 0; + right[1] = 1 / m_fScale; + right[2] = 0; + up[0] = 0; + up[1] = 0; + up[2] = 1 / m_fScale; + } + + m_bPress_selection = (selected_brushes.next != &selected_brushes); + + Sys_GetCursorPos(&m_ptCursorX, &m_ptCursorY); + + // lbutton = manipulate selection + // shift-LBUTTON = select + if ( (buttons == MK_LBUTTON) + || (buttons == (MK_LBUTTON | MK_SHIFT)) + || (buttons == (MK_LBUTTON | MK_CONTROL)) + || (buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT)) ) + { + Patch_SetView( (m_nViewType == XY) ? W_XY : (m_nViewType == YZ) ? W_YZ : W_XZ); + Drag_Begin (x, y, buttons, right, up, origin, dir); + return; + } + + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + + // control mbutton = move camera + if (m_nButtonstate == (MK_CONTROL|nMouseButton) ) + { + VectorCopyXY(point, g_pParentWnd->GetCamWnd()->Camera()->origin); + Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY); + } + + // mbutton = angle camera + if ((g_PrefsDlg.m_nMouseButtons == 3 && m_nButtonstate == MK_MBUTTON) || + (g_PrefsDlg.m_nMouseButtons == 2 && m_nButtonstate == (MK_SHIFT|MK_CONTROL|MK_RBUTTON))) + { + VectorSubtract (point, g_pParentWnd->GetCamWnd()->Camera()->origin, point); + + int n1 = (m_nViewType == XY) ? 1 : 2; + int n2 = (m_nViewType == YZ) ? 1 : 0; + int nAngle = (m_nViewType == XY) ? YAW : PITCH; + if (point[n1] || point[n2]) + { + g_pParentWnd->GetCamWnd()->Camera()->angles[nAngle] = 180/Q_PI*atan2 (point[n1], point[n2]); + Sys_UpdateWindows (W_CAMERA_IFON|W_XY_OVERLAY); + } + } + + // shift mbutton = move z checker + if (m_nButtonstate == (MK_SHIFT | nMouseButton)) + { + if (RotateMode() || g_bPatchBendMode) + { + SnapToPoint (x, y, point); + VectorCopyXY(point, g_vRotateOrigin); + if (g_bPatchBendMode) + { + VectorCopy(point, g_vBendOrigin); + } + Sys_UpdateWindows (W_XY); + return; + } + else + { + SnapToPoint (x, y, point); + if (m_nViewType == XY) + { + z.origin[0] = point[0]; + z.origin[1] = point[1]; + } + else if (m_nViewType == YZ) + { + z.origin[0] = point[1]; + z.origin[1] = point[2]; + } + else + { + z.origin[0] = point[0]; + z.origin[1] = point[2]; + } + Sys_UpdateWindows (W_XY_OVERLAY|W_Z); + return; + } + } + + update_xor_rectangle_xy(m_XORRectangle); +} + +void XYWnd::XY_MouseUp(int x, int y, int buttons) +{ + Drag_MouseUp (buttons); + if (!m_bPress_selection) + Sys_UpdateWindows (W_ALL); + m_nButtonstate = 0; + + gdk_window_set_cursor (m_pWidget->window, NULL); + + update_xor_rectangle_xy(m_XORRectangle); +} + +qboolean XYWnd::DragDelta (int x, int y, vec3_t move) +{ + vec3_t xvec, yvec, delta; + int i; + + xvec[0] = 1 / m_fScale; + xvec[1] = xvec[2] = 0; + yvec[1] = 1 / m_fScale; + yvec[0] = yvec[2] = 0; + + for (i=0 ; i<3 ; i++) + { + delta[i] = xvec[i] * (x - m_nPressx) + yvec[i] * (y - m_nPressy); + if (!g_PrefsDlg.m_bNoClamp) + { + delta[i] = floor(delta[i] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + } + } + VectorSubtract (delta, m_vPressdelta, move); + VectorCopy (delta, m_vPressdelta); + + if (move[0] || move[1] || move[2]) + return true; + return false; +} + +void XYWnd::HandleDrop() +{ + if (g_PrefsDlg.m_bRightClick == false) + return; + + if (m_mnuDrop == NULL) // first time, load it up + { + int nID = ID_ENTITY_START; + GtkWidget *menu, *menu_in_menu, *item, *submenu, *submenu_root; + + menu = m_mnuDrop = gtk_menu_new (); + + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Select"); + create_menu_item_with_mnemonic (menu_in_menu, "Select Complete Tall", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTCOMPLETETALL); + create_menu_item_with_mnemonic (menu_in_menu, "Select Touching", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTTOUCHING); + create_menu_item_with_mnemonic (menu_in_menu, "Select Partial Tall", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTPARTIALTALL); + create_menu_item_with_mnemonic (menu_in_menu, "Select Inside", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTINSIDE); + menu_separator (menu); nID++; + // NOTE: temporary commented out until we put it back in for good (that is with actual features) + /* + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Group",); + create_menu_item_with_mnemonic (menu_in_menu, "Add to...", + GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_ADDTO); + create_menu_item_with_mnemonic (menu_in_menu, "Remove", + GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_REMOVE); + create_menu_item_with_mnemonic (menu_in_menu, "Name...", + GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_NAME); + menu_separator (menu_in_menu); nID++; + create_menu_item_with_mnemonic (menu_in_menu, "New Group...", + GTK_SIGNAL_FUNC (HandleCommand), ID_DROP_GROUP_NEWGROUP); + */ + create_menu_item_with_mnemonic (menu, "Ungroup Entity", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_UNGROUPENTITY); + + create_menu_item_with_mnemonic (menu, "Move into entity", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MERGE); + create_menu_item_with_mnemonic (menu, "Move into worldspawn", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SEPERATE); + + create_menu_item_with_mnemonic (menu, "Make Detail", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MAKE_DETAIL); + create_menu_item_with_mnemonic (menu, "Make Structural", + GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MAKE_STRUCTURAL); + menu_separator (menu); nID++; + + menu_in_menu = create_menu_in_menu_with_mnemonic (menu, "Smart Entities"); + create_menu_item_with_mnemonic (menu_in_menu, "Smart__Train", + GTK_SIGNAL_FUNC (HandleCommand), nID++); + menu_separator (menu); nID++; + + submenu = NULL; + submenu_root = NULL; + eclass_t *e; + CString strActive; + CString strLast; + CString strName; + for (e=eclass ; e ; e=e->next) + { + strLast = strName; + strName = e->name; + int n_ = strName.Find("_"); + if (n_ > 0) + { + CString strLeft = strName.Left(n_); + CString strRight = strName.Right(strName.GetLength() - n_ - 1); + if (strLeft == strActive) // this is a child + { + assert (submenu); + item = gtk_menu_item_new_with_label (strName); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (nID++)); + gtk_widget_show (item); + CheckMenuSplitting(submenu); + gtk_menu_append (GTK_MENU (submenu), item); + } + else + { + if (submenu) + { + // this is submenu from previous main_item, hook it back + // we use submenu_root cause we may have been cascading submenu + item = gtk_menu_item_new_with_label (strActive); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu_root); + g_ptrMenus.Add(submenu_root); + submenu = NULL; + submenu_root = NULL; + } + strActive = strLeft; + + submenu = gtk_menu_new (); + submenu_root = submenu; + item = gtk_menu_item_new_with_label (strName); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (nID++)); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (submenu), item); + } + } + else + { + if (submenu) + { + // this is submenu from previous main_item, hook it back + // we use submenu_root cause we may have been cascading submenu + item = gtk_menu_item_new_with_label (strActive); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu_root); + g_ptrMenus.Add(submenu_root); + submenu = NULL; + submenu_root = NULL; + } + strActive = ""; + + item = gtk_menu_item_new_with_label (strName); + gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand), + GINT_TO_POINTER (nID++)); + gtk_widget_show (item); + gtk_menu_append (GTK_MENU (menu), item); + } + } + } + + gtk_menu_popup (GTK_MENU (m_mnuDrop), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); } /* @@ -1046,513 +1654,546 @@ void XYWnd_OrientCamera(XYWnd* xywnd, int x, int y, CamWnd& camwnd) NewBrushDrag ============== */ -unsigned int NewBrushDrag_buttons() +void XYWnd::NewBrushDrag (int x, int y) { - return RAD_LBUTTON; -} + vec3_t mins, maxs, junk; + int i; + float temp; + brush_t *n; -void XYWnd::NewBrushDrag_Begin(int x, int y) -{ - m_NewBrushDrag = 0; - m_nNewBrushPressx = x; - m_nNewBrushPressy = y; + if (!DragDelta (x,y, junk)) + return; - m_bNewBrushDrag = true; - GlobalUndoSystem().start(); -} + // delete the current selection + if (selected_brushes.next != &selected_brushes) + Brush_Free (selected_brushes.next); + + SnapToPoint (m_nPressx, m_nPressy, mins); -void XYWnd::NewBrushDrag_End(int x, int y) -{ - if(m_NewBrushDrag != 0) - { - GlobalUndoSystem().finish("brushDragNew"); - } -} + int nDim = (m_nViewType == XY) ? 2 : (m_nViewType == YZ) ? 0 : 1; -void XYWnd::NewBrushDrag(int x, int y) -{ - Vector3 mins, maxs; - XY_ToPoint(m_nNewBrushPressx, m_nNewBrushPressy, mins); - XY_SnapToGrid(mins); - XY_ToPoint(x, y, maxs); - XY_SnapToGrid(maxs); - - int nDim = (m_viewType == XY) ? 2 : (m_viewType == YZ) ? 0 : 1; - - mins[nDim] = float_snapped(Select_getWorkZone().d_work_min[nDim], GetGridSize()); - maxs[nDim] = float_snapped(Select_getWorkZone().d_work_max[nDim], GetGridSize()); + //++timo clean +// mins[nDim] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_new_brush_bottom_z / g_qeglobals.d_gridsize)); + mins[nDim] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_work_min[nDim]/g_qeglobals.d_gridsize)); + SnapToPoint (x, y, maxs); +// maxs[nDim] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_new_brush_top_z / g_qeglobals.d_gridsize)); + maxs[nDim] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_work_max[nDim]/g_qeglobals.d_gridsize)); if (maxs[nDim] <= mins[nDim]) - maxs[nDim] = mins[nDim] + GetGridSize(); + maxs[nDim] = mins[nDim] + g_qeglobals.d_gridsize; - for(int i=0 ; i<3 ; i++) + for (i=0 ; i<3 ; i++) { if (mins[i] == maxs[i]) - return; // don't create a degenerate brush + return; // don't create a degenerate brush if (mins[i] > maxs[i]) { - float temp = mins[i]; + temp = mins[i]; mins[i] = maxs[i]; maxs[i] = temp; } } - if(m_NewBrushDrag == 0) - { - NodeSmartReference node(GlobalBrushCreator().createBrush()); - Node_getTraversable(Map_FindOrInsertWorldspawn(g_map))->insert(node); - - scene::Path brushpath(makeReference(GlobalSceneGraph().root())); - brushpath.push(makeReference(*Map_GetWorldspawn(g_map))); - brushpath.push(makeReference(node.get())); - selectPath(brushpath, true); - - m_NewBrushDrag = node.get_pointer(); - } - - // d1223m - //Scene_BrushResize_Selected(GlobalSceneGraph(), aabb_for_minmax(mins, maxs), TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); - Scene_BrushResize_Selected(GlobalSceneGraph(), aabb_for_minmax(mins, maxs), - g_brush_always_caulk ? - "textures/common/caulk" : TextureBrowser_GetSelectedShader(GlobalTextureBrowser())); -} - -void entitycreate_activated(GtkWidget* item) -{ - scene::Node* world_node = Map_FindWorldspawn(g_map); - const char* entity_name = gtk_label_get_text(GTK_LABEL(GTK_BIN(item)->child)); - - if(!(world_node && string_equal(entity_name, "worldspawn"))) - { - g_pParentWnd->ActiveXY()->OnEntityCreate(entity_name); - } else { - GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(MainFrame_getWindow()), "There's already a worldspawn in your map!" - "", - "Info", - eMB_OK, - eMB_ICONDEFAULT); - } -} - -void EntityClassMenu_addItem(GtkMenu* menu, const char* name) -{ - GtkMenuItem* item = GTK_MENU_ITEM(gtk_menu_item_new_with_label(name)); - g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(entitycreate_activated), item); - gtk_widget_show(GTK_WIDGET(item)); - menu_add_item(menu, item); -} - -class EntityClassMenuInserter : public EntityClassVisitor -{ - typedef std::pair MenuPair; - typedef std::vector MenuStack; - MenuStack m_stack; - CopiedString m_previous; -public: - EntityClassMenuInserter(GtkMenu* menu) - { - m_stack.reserve(2); - m_stack.push_back(MenuPair(menu, "")); - } - ~EntityClassMenuInserter() - { - if(!string_empty(m_previous.c_str())) - { - addItem(m_previous.c_str(), ""); - } - } - void visit(EntityClass* e) - { - ASSERT_MESSAGE(!string_empty(e->name()), "entity-class has no name"); - if(!string_empty(m_previous.c_str())) - { - addItem(m_previous.c_str(), e->name()); - } - m_previous = e->name(); - } - void pushMenu(const CopiedString& name) - { - GtkMenuItem* item = GTK_MENU_ITEM(gtk_menu_item_new_with_label(name.c_str())); - gtk_widget_show(GTK_WIDGET(item)); - container_add_widget(GTK_CONTAINER(m_stack.back().first), GTK_WIDGET(item)); - - GtkMenu* submenu = GTK_MENU(gtk_menu_new()); - gtk_menu_item_set_submenu(item, GTK_WIDGET(submenu)); - - m_stack.push_back(MenuPair(submenu, name)); - } - void popMenu() - { - m_stack.pop_back(); - } - void addItem(const char* name, const char* next) - { - const char* underscore = strchr(name, '_'); - - if(underscore != 0 && underscore != name) - { - bool nextEqual = string_equal_n(name, next, (underscore + 1) - name); - const char* parent = m_stack.back().second.c_str(); - - if(!string_empty(parent) - && string_length(parent) == std::size_t(underscore - name) - && string_equal_n(name, parent, underscore - name)) // this is a child - { - } - else if(nextEqual) - { - if(m_stack.size() == 2) - { - popMenu(); - } - pushMenu(CopiedString(StringRange(name, underscore))); - } - else if(m_stack.size() == 2) - { - popMenu(); - } - } - else if(m_stack.size() == 2) - { - popMenu(); - } - - EntityClassMenu_addItem(m_stack.back().first, name); - } -}; - -void XYWnd::OnContextMenu() -{ - if (g_xywindow_globals.m_bRightClick == false) + n = Brush_Create (mins, maxs, &g_qeglobals.d_texturewin.texdef); + if (!n) return; - if (m_mnuDrop == 0) // first time, load it up + vec3_t vSize; + VectorSubtract(maxs, mins, vSize); + g_strStatus.Format("Size X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2]); + g_pParentWnd->SetStatusText(2, g_strStatus); + + Brush_AddToList (n, &selected_brushes); + + Entity_LinkBrush (world_entity, n); + + Brush_Build( n ); + + // Sys_UpdateWindows (W_ALL); + Sys_UpdateWindows (W_XY| W_CAMERA); + +} + +/* +============== +XY_MouseMoved +============== +*/ +void XYWnd::XY_MouseMoved (int x, int y, int buttons) +{ + vec3_t point; + + if (!m_nButtonstate) { - GtkMenu* menu = m_mnuDrop = GTK_MENU(gtk_menu_new()); - - EntityClassMenuInserter inserter(menu); - GlobalEntityClassManager().forEach(inserter); - } - - gtk_menu_popup(m_mnuDrop, 0, 0, 0, 0, 1, GDK_CURRENT_TIME); -} - -FreezePointer g_xywnd_freezePointer; - -unsigned int Move_buttons() -{ - return RAD_RBUTTON; -} - -void XYWnd_moveDelta(int x, int y, unsigned int state, void* data) -{ - reinterpret_cast(data)->EntityCreate_MouseMove(x, y); - reinterpret_cast(data)->Scroll(-x, y); -} - -gboolean XYWnd_Move_focusOut(GtkWidget* widget, GdkEventFocus* event, XYWnd* xywnd) -{ - xywnd->Move_End(); - return FALSE; -} - -void XYWnd::Move_Begin() -{ - if(m_move_started) - { - Move_End(); - } - m_move_started = true; - g_xywnd_freezePointer.freeze_pointer(m_parent != 0 ? m_parent : MainFrame_getWindow(), XYWnd_moveDelta, this); - m_move_focusOut = g_signal_connect(G_OBJECT(m_gl_widget), "focus_out_event", G_CALLBACK(XYWnd_Move_focusOut), this); -} - -void XYWnd::Move_End() -{ - m_move_started = false; - g_xywnd_freezePointer.unfreeze_pointer(m_parent != 0 ? m_parent : MainFrame_getWindow()); - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_move_focusOut); -} - -unsigned int Zoom_buttons() -{ - return RAD_RBUTTON | RAD_SHIFT; -} - -int g_dragZoom = 0; - -void XYWnd_zoomDelta(int x, int y, unsigned int state, void* data) -{ - if(y != 0) - { - g_dragZoom += y; - - while(abs(g_dragZoom) > 8) + if (g_bCrossHairs) { - if(g_dragZoom > 0) + Sys_UpdateWindows (W_XY | W_XY_OVERLAY); + } + return; + } + + // lbutton without selection = drag new brush + if (m_nButtonstate == MK_LBUTTON && !m_bPress_selection && g_qeglobals.d_select_mode != sel_curvepoint && g_qeglobals.d_select_mode != sel_areatall) + { + NewBrushDrag (x, y); + return; + } + + // lbutton (possibly with control and or shift) + // with selection = drag selection + if (m_nButtonstate & MK_LBUTTON) + { + Drag_MouseMoved (x, y, buttons); + if(g_qeglobals.d_select_mode != sel_area) + Sys_UpdateWindows (W_XY_OVERLAY | W_CAMERA_IFON | W_Z); + return; + } + + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + // control mbutton = move camera + if (m_nButtonstate == (MK_CONTROL|nMouseButton) ) + { + SnapToPoint (x, y, point); + VectorCopyXY(point, g_pParentWnd->GetCamWnd()->Camera()->origin); + Sys_UpdateWindows (W_XY_OVERLAY | W_CAMERA); + return; + } + + // shift mbutton = move z checker + if (m_nButtonstate == (MK_SHIFT|nMouseButton) ) + { + if (RotateMode() || g_bPatchBendMode) + { + SnapToPoint (x, y, point); + VectorCopyXY(point, g_vRotateOrigin); + if (g_bPatchBendMode) { - XYWnd_ZoomOut(reinterpret_cast(data)); - g_dragZoom -= 8; + VectorCopy(point, g_vBendOrigin); + } + Sys_UpdateWindows (W_XY); + return; + } + else + { + SnapToPoint (x, y, point); + if (m_nViewType == XY) + { + z.origin[0] = point[0]; + z.origin[1] = point[1]; + } + else if (m_nViewType == YZ) + { + z.origin[0] = point[1]; + z.origin[1] = point[2]; } else { - XYWnd_ZoomIn(reinterpret_cast(data)); - g_dragZoom += 8; + z.origin[0] = point[0]; + z.origin[1] = point[2]; } } - } -} - -gboolean XYWnd_Zoom_focusOut(GtkWidget* widget, GdkEventFocus* event, XYWnd* xywnd) -{ - xywnd->Zoom_End(); - return FALSE; -} - -void XYWnd::Zoom_Begin() -{ - if(m_zoom_started) - { - Zoom_End(); - } - m_zoom_started = true; - g_dragZoom = 0; - g_xywnd_freezePointer.freeze_pointer(m_parent != 0 ? m_parent : MainFrame_getWindow(), XYWnd_zoomDelta, this); - m_zoom_focusOut = g_signal_connect(G_OBJECT(m_gl_widget), "focus_out_event", G_CALLBACK(XYWnd_Zoom_focusOut), this); -} - -void XYWnd::Zoom_End() -{ - m_zoom_started = false; - g_xywnd_freezePointer.unfreeze_pointer(m_parent != 0 ? m_parent : MainFrame_getWindow()); - g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_zoom_focusOut); -} - -// makes sure the selected brush or camera is in view -void XYWnd::PositionView(const Vector3& position) -{ - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; - - m_vOrigin[nDim1] = position[nDim1]; - m_vOrigin[nDim2] = position[nDim2]; - - updateModelview(); - - XYWnd_Update(*this); -} - -void XYWnd::SetViewType(VIEWTYPE viewType) -{ - m_viewType = viewType; - updateModelview(); - - if(m_parent != 0) - { - gtk_window_set_title(m_parent, ViewType_getTitle(m_viewType)); - } -} - - -inline WindowVector WindowVector_forInteger(int x, int y) -{ - return WindowVector(static_cast(x), static_cast(y)); -} - -void XYWnd::mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers) -{ - XY_MouseDown(static_cast(position.x()), static_cast(position.y()), buttons_for_button_and_modifiers(button, modifiers)); -} -void XYWnd::XY_MouseDown (int x, int y, unsigned int buttons) -{ - if(buttons == Move_buttons()) - { - Move_Begin(); - EntityCreate_MouseDown(x, y); - } - else if(buttons == Zoom_buttons()) - { - Zoom_Begin(); - } - else if(ClipMode() && buttons == Clipper_buttons()) - { - Clipper_OnLButtonDown(x, y); - } - else if(buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0) - { - NewBrushDrag_Begin(x, y); - } - // control mbutton = move camera - else if (buttons == MoveCamera_buttons()) - { - XYWnd_PositionCamera(this, x, y, *g_pParentWnd->GetCamWnd()); - } - // mbutton = angle camera - else if(buttons == OrientCamera_buttons()) - { - XYWnd_OrientCamera(this, x, y, *g_pParentWnd->GetCamWnd()); - } - else - { - m_window_observer->onMouseDown(WindowVector_forInteger(x, y), button_for_flags(buttons), modifiers_for_flags(buttons)); - } -} - -void XYWnd::XY_MouseUp(int x, int y, unsigned int buttons) -{ - if(m_move_started) - { - Move_End(); - EntityCreate_MouseUp(x, y); - } - else if(m_zoom_started) - { - Zoom_End(); - } - else if (ClipMode() && buttons == Clipper_buttons()) - { - Clipper_OnLButtonUp(x, y); - } - else if (m_bNewBrushDrag) - { - m_bNewBrushDrag = false; - NewBrushDrag_End(x, y); - } - else - { - m_window_observer->onMouseUp(WindowVector_forInteger(x, y), button_for_flags(buttons), modifiers_for_flags(buttons)); - } -} - -void XYWnd::XY_MouseMoved (int x, int y, unsigned int buttons) -{ - // rbutton = drag xy origin - if(m_move_started) - { - } - // zoom in/out - else if(m_zoom_started) - { - } - - else if (ClipMode() && g_pMovingClip != 0) - { - Clipper_OnMouseMoved(x, y); - } - // lbutton without selection = drag new brush - else if (m_bNewBrushDrag) - { - NewBrushDrag(x, y); - } - - // control mbutton = move camera - else if (getButtonState() == MoveCamera_buttons()) - { - XYWnd_PositionCamera(this, x, y, *g_pParentWnd->GetCamWnd()); + Sys_UpdateWindows (W_XY_OVERLAY|W_Z); + return; } // mbutton = angle camera - else if (getButtonState() == OrientCamera_buttons()) - { - XYWnd_OrientCamera(this, x, y, *g_pParentWnd->GetCamWnd()); - } - - else + if ((g_PrefsDlg.m_nMouseButtons == 3 && m_nButtonstate == MK_MBUTTON) || + (g_PrefsDlg.m_nMouseButtons == 2 && m_nButtonstate == (MK_SHIFT|MK_CONTROL|MK_RBUTTON))) { - m_window_observer->onMouseMotion(WindowVector_forInteger(x, y), modifiers_for_flags(buttons)); + SnapToPoint (x, y, point); + VectorSubtract (point, g_pParentWnd->GetCamWnd()->Camera()->origin, point); - m_mousePosition[0] = m_mousePosition[1] = m_mousePosition[2] = 0.0; - XY_ToPoint(x, y , m_mousePosition); - XY_SnapToGrid(m_mousePosition); - - StringOutputStream status(64); - status << "x:: " << FloatFormat(m_mousePosition[0], 6, 1) - << " y:: " << FloatFormat(m_mousePosition[1], 6, 1) - << " z:: " << FloatFormat(m_mousePosition[2], 6, 1); - g_pParentWnd->SetStatusText(g_pParentWnd->m_position_status, status.c_str()); - - if (g_bCrossHairs) + int n1 = (m_nViewType == XY) ? 1 : 2; + int n2 = (m_nViewType == YZ) ? 1 : 0; + int nAngle = (m_nViewType == XY) ? YAW : PITCH; + if (point[n1] || point[n2]) { - XYWnd_Update(*this); + g_pParentWnd->GetCamWnd()->Camera()->angles[nAngle] = 180/Q_PI*atan2 (point[n1], point[n2]); + Sys_UpdateWindows (W_CAMERA_IFON|W_XY_OVERLAY); } - - Clipper_Crosshair_OnMouseMoved(x, y); + return; } -} -void XYWnd::EntityCreate_MouseDown(int x, int y) -{ - m_entityCreate = true; - m_entityCreate_x = x; - m_entityCreate_y = y; -} - -void XYWnd::EntityCreate_MouseMove(int x, int y) -{ - if(m_entityCreate && (m_entityCreate_x != x || m_entityCreate_y != y)) + // rbutton = drag xy origin + if (m_nButtonstate == MK_RBUTTON) { - m_entityCreate = false; - } -} + Sys_GetCursorPos (&x, &y); + if (x != m_ptCursorX || y != m_ptCursorY) + { + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + m_vOrigin[nDim1] -= (x - m_ptCursorX) / m_fScale; + m_vOrigin[nDim2] += (y - m_ptCursorY) / m_fScale; + Sys_SetCursorPos (m_ptCursorX, m_ptCursorY); -void XYWnd::EntityCreate_MouseUp(int x, int y) -{ - if(m_entityCreate) + // create an empty cursor + if (!g_bWaitCursor) + { + GdkPixmap *pixmap; + GdkBitmap *mask; + char buffer [(32 * 32)/8]; + memset (buffer, 0, (32 * 32)/8); + GdkColor white = {0, 0xffff, 0xffff, 0xffff}; + GdkColor black = {0, 0x0000, 0x0000, 0x0000}; + pixmap = gdk_bitmap_create_from_data (NULL, buffer, 32, 32); + mask = gdk_bitmap_create_from_data (NULL, buffer, 32, 32); + GdkCursor *cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &white, &black, 1, 1); + gdk_window_set_cursor (m_pWidget->window, cursor); + gdk_cursor_unref (cursor); + gdk_drawable_unref (pixmap); + gdk_drawable_unref (mask); + } + + Sys_UpdateWindows (W_XY | W_XY_OVERLAY); + } + return; + } + + // zoom in/out + if (m_nButtonstate == (MK_SHIFT | MK_RBUTTON)) { - m_entityCreate = false; - OnContextMenu(); + Sys_GetCursorPos (&x, &y); + if (y != m_ptCursorY) + { + if (abs (m_ptCursorY - y) > 10) + { + if (m_ptCursorY < y) + g_pParentWnd->OnViewZoomout (); + else + g_pParentWnd->OnViewZoomin (); + + Sys_SetCursorPos (m_ptCursorX, m_ptCursorY); + } + } + return; } } -inline float screen_normalised(int pos, unsigned int size) +void XYWnd::OriginalButtonDown(guint32 nFlags, int pointx, int pointy) { - return ((2.0f * pos) / size) - 1.0f; + SetFocus(); + SetCapture(); + XY_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags); + m_nScrollFlags = nFlags; } -inline float normalised_to_world(float normalised, float world_origin, float normalised2world_scale) +void XYWnd::OriginalButtonUp(guint32 nFlags, int pointx, int pointy) { - return world_origin + normalised * normalised2world_scale; + XY_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags); + ReleaseCapture (); } +void XYWnd::DropClipPoint(guint32 nFlags, int pointx, int pointy) +{ + if (g_pMovingClip) + { + SetCapture(); + SnapToPoint (pointx, m_pWidget->allocation.height - 1 - pointy , *g_pMovingClip); + } + else + { + vec3_t* pPt = NULL; + if (g_Clip1.Set() == false) + { + pPt = g_Clip1; + g_Clip1.Set(true); + g_Clip1.m_ptScreenX = pointx; + g_Clip1.m_ptScreenY = pointy; + } + else + if (g_Clip2.Set() == false) + { + pPt = g_Clip2; + g_Clip2.Set(true); + g_Clip2.m_ptScreenX = pointx; + g_Clip2.m_ptScreenY = pointy; + } + else + if (g_Clip3.Set() == false) + { + pPt = g_Clip3; + g_Clip3.Set(true); + g_Clip3.m_ptScreenX = pointx; + g_Clip3.m_ptScreenY = pointy; + } + else + { + RetainClipMode(true); + pPt = g_Clip1; + g_Clip1.Set(true); + g_Clip1.m_ptScreenX = pointx; + g_Clip1.m_ptScreenY = pointy; + } + SnapToPoint (pointx, m_pWidget->allocation.height - 1 - pointy , *pPt); + // third coordinates for clip point: use d_work_max + // Arnout: changed to use center of selection for clipping, saves level designers moving points all over the map + // g_pParentWnd->ActiveXY()->GetViewType() + // cf VIEWTYPE defintion: enum VIEWTYPE {YZ, XZ, XY}; + int nViewType = g_pParentWnd->ActiveXY()->GetViewType(); + int nDim = (nViewType == YZ ) ? nDim = 0 : ( (nViewType == XZ) ? nDim = 1 : nDim = 2 ); + //(*pPt)[nDim] = g_qeglobals.d_work_max[nDim]; + vec3_t mid; + Select_GetMid( mid ); + (*pPt)[nDim] = mid[nDim]; + } + Sys_UpdateWindows(XY | W_CAMERA_IFON); +} + +void XYWnd::DropPathPoint(guint32 nFlags, int pointx, int pointy) +{ + if (g_pMovingPath) + { + SetCapture(); + SnapToPoint (pointx, m_pWidget->allocation.height - 1 - pointy , *g_pMovingPath); + } + else + { + g_PathPoints[g_nPathCount].Set(true); + g_PathPoints[g_nPathCount].m_ptScreenX = pointx; + g_PathPoints[g_nPathCount].m_ptScreenY = pointy; + SnapToPoint(pointx, m_pWidget->allocation.height - 1 - pointy, g_PathPoints[g_nPathCount]); + // third coordinates for dropped point: use d_work_max + // g_pParentWnd->ActiveXY()->GetViewType() + // cf VIEWTYPE definition: enum VIEWTYPE {YZ, XZ, XY}; + int nViewType = g_pParentWnd->ActiveXY()->GetViewType(); + int nDim = (nViewType == YZ ) ? nDim = 0 : ( (nViewType == XZ) ? nDim = 1 : nDim = 2 ); + g_PathPoints[g_nPathCount].m_ptClip[nDim] = g_qeglobals.d_work_max[nDim]; + + g_nPathCount++; + if (g_nPathCount == g_nPathLimit) + { + if (g_pPathFunc) + g_pPathFunc(true, g_nPathCount); + g_nPathCount = 0; + g_bPathMode = false; + g_pPathFunc = NULL; + } + } + Sys_UpdateWindows(XY | W_CAMERA_IFON); +} + +// FIXME: AddPointPoint() redundant function never called +#if 0 +void XYWnd::AddPointPoint(guint32 nFlags, vec3_t* pVec) +{ + g_PointPoints[g_nPointCount].Set(true); + //g_PointPoints[g_nPointCount].m_ptScreen = point; + _VectorCopy(*pVec, g_PointPoints[g_nPointCount]); + g_PointPoints[g_nPointCount].SetPointPtr(pVec); + g_nPointCount++; + Sys_UpdateWindows(XY | W_CAMERA_IFON); +} + +// FIXME: ProduceSplits() redundant function never called +void XYWnd::ProduceSplits(brush_t** pFront, brush_t** pBack) +{ + *pFront = NULL; + *pBack = NULL; + if (ClipMode()) + { + if (g_Clip1.Set() && g_Clip2.Set()) + { + face_t face; + VectorCopy(g_Clip1.m_ptClip,face.planepts[0]); + VectorCopy(g_Clip2.m_ptClip,face.planepts[1]); + VectorCopy(g_Clip3.m_ptClip,face.planepts[2]); + if (selected_brushes.next && (selected_brushes.next->next == &selected_brushes)) + { + if (g_Clip3.Set() == false) + { + if (m_nViewType == XY) + { + face.planepts[0][2] = selected_brushes.next->mins[2]; + face.planepts[1][2] = selected_brushes.next->mins[2]; + face.planepts[2][0] = Betwixt(g_Clip1.m_ptClip[0], g_Clip2.m_ptClip[0]); + face.planepts[2][1] = Betwixt(g_Clip1.m_ptClip[1], g_Clip2.m_ptClip[1]); + face.planepts[2][2] = selected_brushes.next->maxs[2]; + } + else if (m_nViewType == YZ) + { + face.planepts[0][0] = selected_brushes.next->mins[0]; + face.planepts[1][0] = selected_brushes.next->mins[0]; + face.planepts[2][1] = Betwixt(g_Clip1.m_ptClip[1], g_Clip2.m_ptClip[1]); + face.planepts[2][2] = Betwixt(g_Clip1.m_ptClip[2], g_Clip2.m_ptClip[2]); + face.planepts[2][0] = selected_brushes.next->maxs[0]; + } + else + { + face.planepts[0][1] = selected_brushes.next->mins[1]; + face.planepts[1][1] = selected_brushes.next->mins[1]; + face.planepts[2][0] = Betwixt(g_Clip1.m_ptClip[0], g_Clip2.m_ptClip[0]); + face.planepts[2][2] = Betwixt(g_Clip1.m_ptClip[2], g_Clip2.m_ptClip[2]); + face.planepts[2][1] = selected_brushes.next->maxs[1]; + } + } + + Brush_SplitBrushByFace (selected_brushes.next, &face, pFront, pBack); + } + + } + } +} +#endif + +void XYWnd::PlanePointsFromClipPoints(vec3_t planepts[3], brush_t *pBrush) +{ + VectorCopy(g_Clip1.m_ptClip,planepts[0]); + VectorCopy(g_Clip2.m_ptClip,planepts[1]); + VectorCopy(g_Clip3.m_ptClip,planepts[2]); + if (g_Clip3.Set() == false) + { + int n = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 2 : (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 0 : 1; + int x = (n == 0) ? 1 : 0; + int y = (n == 2) ? 1 : 2; + + if (n == 1) // on viewtype XZ, flip clip points + { + planepts[0][n] = pBrush->maxs[n]; + planepts[1][n] = pBrush->maxs[n]; + planepts[2][x] = g_Clip1.m_ptClip[x]; + planepts[2][y] = g_Clip1.m_ptClip[y]; + planepts[2][n] = pBrush->mins[n]; + } + else + { + planepts[0][n] = pBrush->mins[n]; + planepts[1][n] = pBrush->mins[n]; + planepts[2][x] = g_Clip1.m_ptClip[x]; + planepts[2][y] = g_Clip1.m_ptClip[y]; + planepts[2][n] = pBrush->maxs[n]; + } + } +} + +void XYWnd::ProduceSplitLists() +{ + bool bCaulk = false; + int nFlags; + + if (AnyPatchesSelected()) + { + Sys_Printf("Deselecting patches for clip operation.\n"); + brush_t *next; + for (brush_t *pb = selected_brushes.next ; pb != &selected_brushes ; pb = next) + { + next = pb->next; + if (pb->patchBrush) + { + Brush_RemoveFromList (pb); + Brush_AddToList (pb, &active_brushes); + UpdatePatchInspector(); + } + } + // ydnar: update the window if any patches are selected + Sys_UpdateWindows( XY | W_CAMERA_IFON ); + } + + CleanList(&g_brFrontSplits); + CleanList(&g_brBackSplits); + g_brFrontSplits.next = &g_brFrontSplits; + g_brBackSplits.next = &g_brBackSplits; + if (ClipMode() && (g_Clip1.Set() && g_Clip2.Set())) + { + brush_t* pBrush; + for (pBrush = selected_brushes.next ; pBrush != NULL && pBrush != &selected_brushes ; pBrush=pBrush->next) + { + brush_t* pFront = NULL; + brush_t* pBack = NULL; + + face_t face; + memset(&face,0,sizeof(face_t)); + PlanePointsFromClipPoints(face.planepts, pBrush); + + // decide wether caulking should be applied on the splits + // FIXME: hack + // this should take the first brush face, check shader for NODRAW, if it isn't nodraw then find the appropriate + // common/ shader to use, out of solid+nodraw, nonsolid+nodraw, water+nodraw, lava+nodraw, nonsolid+nodraw+trans, water+nodraw+trans, lava+nodraw+trans.. and fog.. etc + // or if none of those apply (unlikely), construct a new shader (shadername_nodraw) based on the shader of the first face, but with surfaceparm nodraw + if (g_PrefsDlg.m_bClipCaulk) + { + nFlags = pBrush->brush_faces->pShader->getFlags(); + if ((nFlags & QER_NODRAW) || (nFlags & QER_NONSOLID) || (nFlags & QER_WATER) || (nFlags & QER_LAVA) || (nFlags & QER_FOG)) // first face shader is anything other than solid AND opaque like caulk + bCaulk = false; // use first face's shader for the splitting face + else + bCaulk = true; // use caulk + } + + Brush_SplitBrushByFace (pBrush, &face, &pFront, &pBack, bCaulk); + if (pBack) + Brush_AddToList(pBack, &g_brBackSplits); + if (pFront) + Brush_AddToList(pFront, &g_brFrontSplits); + + } + } +} + +void XYWnd::XY_Init() +{ + m_vOrigin[0] = 0; + m_vOrigin[1] = 20; + m_vOrigin[2] = 46; + m_fScale = 1; +} + +void XYWnd::SnapToPoint (int x, int y, vec3_t point) +{ + if (g_PrefsDlg.m_bNoClamp) + { + XY_ToPoint(x, y, point); + } + else + { + XY_ToGridPoint(x, y, point); + } +} // TTimo: watch it, this doesn't init one of the 3 coords -void XYWnd::XY_ToPoint (int x, int y, Vector3& point) +void XYWnd::XY_ToPoint (int x, int y, vec3_t point) { - float normalised2world_scale_x = m_nWidth / 2 / m_fScale; - float normalised2world_scale_y = m_nHeight / 2 / m_fScale; - if (m_viewType == XY) + float fx = x; + float fy = y; + float fw = m_nWidth; + float fh = m_nHeight; + if (m_nViewType == XY) { - point[0] = normalised_to_world(screen_normalised(x, m_nWidth), m_vOrigin[0], normalised2world_scale_x); - point[1] = normalised_to_world(-screen_normalised(y, m_nHeight), m_vOrigin[1], normalised2world_scale_y); + point[0] = m_vOrigin[0] + (fx - fw / 2) / m_fScale; + point[1] = m_vOrigin[1] + (fy - fh / 2) / m_fScale; } - else if (m_viewType == YZ) + else if (m_nViewType == YZ) { - point[1] = normalised_to_world(screen_normalised(x, m_nWidth), m_vOrigin[1], normalised2world_scale_x); - point[2] = normalised_to_world(-screen_normalised(y, m_nHeight), m_vOrigin[2], normalised2world_scale_y); + point[1] = m_vOrigin[1] + (fx - fw / 2) / m_fScale; + point[2] = m_vOrigin[2] + (fy - fh / 2 ) / m_fScale; } else { - point[0] = normalised_to_world(screen_normalised(x, m_nWidth), m_vOrigin[0], normalised2world_scale_x); - point[2] = normalised_to_world(-screen_normalised(y, m_nHeight), m_vOrigin[2], normalised2world_scale_y); + point[0] = m_vOrigin[0] + (fx - fw / 2) / m_fScale; + point[2] = m_vOrigin[2] + (fy - fh / 2) / m_fScale; } } -void XYWnd::XY_SnapToGrid(Vector3& point) +void XYWnd::XY_ToGridPoint (int x, int y, vec3_t point) { - if (m_viewType == XY) + if (m_nViewType == XY) { - point[0] = float_snapped(point[0], GetGridSize()); - point[1] = float_snapped(point[1], GetGridSize()); + point[0] = m_vOrigin[0] + (x - m_nWidth / 2) / m_fScale; + point[1] = m_vOrigin[1] + (y - m_nHeight / 2) / m_fScale; + point[0] = floor(point[0] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + point[1] = floor(point[1] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; } - else if (m_viewType == YZ) + else if (m_nViewType == YZ) { - point[1] = float_snapped(point[1], GetGridSize()); - point[2] = float_snapped(point[2], GetGridSize()); + point[1] = m_vOrigin[1] + (x - m_nWidth / 2) / m_fScale; + point[2] = m_vOrigin[2] + (y - m_nHeight / 2) / m_fScale; + point[1] = floor(point[1] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + point[2] = floor(point[2] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; } else { - point[0] = float_snapped(point[0], GetGridSize()); - point[2] = float_snapped(point[2], GetGridSize()); + point[0] = m_vOrigin[0] + (x - m_nWidth / 2) / m_fScale; + point[2] = m_vOrigin[2] + (y - m_nHeight / 2) / m_fScale; + point[0] = floor(point[0] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + point[2] = floor(point[2] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; } } @@ -1569,52 +2210,46 @@ DRAWING XY_DrawGrid ============== */ - -double two_to_the_power(int power) -{ - return pow(2.0f, power); -} - void XYWnd::XY_DrawGrid() { - float x, y, xb, xe, yb, ye; - float w, h; - char text[32]; - float step, minor_step, stepx, stepy; - step = minor_step = stepx = stepy = GetGridSize(); - - int minor_power = Grid_getPower(); - int mask; + float x, y, xb, xe, yb, ye; + float w, h; + char text[32]; + int step, stepx, stepy, colour; + step = stepx = stepy = MAX (64, (int)g_qeglobals.d_gridsize); - while((minor_step * m_fScale) <= 4.0f) // make sure minor grid spacing is at least 4 pixels on the screen + /* + int stepSize = (int)(8 / m_fScale); + if (stepSize > step) { - ++minor_power; - minor_step *= 2; + int i; + for (i = 1; i < stepSize; i <<= 1) + ; + step = i; } - int power = minor_power; - while((power % 3) != 0 || (step * m_fScale) <= 32.0f) // make sure major grid spacing is at least 32 pixels on the screen - { - ++power; - step = float(two_to_the_power(power)); - } - mask = (1 << (power - minor_power)) - 1; - while ((stepx * m_fScale) <= 32.0f) // text step x must be at least 32 + */ + + //Sys_Printf("scale: %f\n", m_fScale); + //Sys_Printf("step before: %i\n", step); + //Sys_Printf("scaled step: %f\n", step * m_fScale); + while ((step * m_fScale) < 4.0f) // make sure major grid spacing is at least 4 pixels on the screen + step *= 8; + //Sys_Printf("step after: %i\n", step); + while ((stepx * m_fScale) < 32.0f) // text step x must be at least 32 stepx *= 2; - while ((stepy * m_fScale) <= 32.0f) // text step y must be at least 32 + while ((stepy * m_fScale) < 32.0f) // text step y must be at least 32 stepy *= 2; - - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_1D); - glDisable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - glLineWidth(1); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_DEPTH_TEST); + qglDisable(GL_BLEND); w = (m_nWidth / 2 / m_fScale); h = (m_nHeight / 2 / m_fScale); - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; xb = m_vOrigin[nDim1] - w; if (xb < region_mins[nDim1]) @@ -1637,142 +2272,153 @@ void XYWnd::XY_DrawGrid() ye = step * ceil (ye/step); #define COLORS_DIFFER(a,b) \ - ((a)[0] != (b)[0] || \ - (a)[1] != (b)[1] || \ - (a)[2] != (b)[2]) + (g_qeglobals.d_savedinfo.colors[a][0] != g_qeglobals.d_savedinfo.colors[b][0] || \ + g_qeglobals.d_savedinfo.colors[a][1] != g_qeglobals.d_savedinfo.colors[b][1] || \ + g_qeglobals.d_savedinfo.colors[a][2] != g_qeglobals.d_savedinfo.colors[b][2]) // djbob // draw minor blocks - if (g_xywindow_globals_private.d_showgrid) + if (m_fScale > .1 && g_qeglobals.d_showgrid && g_qeglobals.d_gridsize * m_fScale >= 4) { - if (COLORS_DIFFER(g_xywindow_globals.color_gridminor, g_xywindow_globals.color_gridback)) + if (g_qeglobals.d_gridsize < 1) + colour = COLOR_GRIDMINOR_ALT; + else + colour = COLOR_GRIDMINOR; + + if (COLORS_DIFFER(colour, COLOR_GRIDBACK)) { - glColor3fv(vector3_to_array(g_xywindow_globals.color_gridminor)); + qglColor3fv(g_qeglobals.d_savedinfo.colors[colour]); - glBegin (GL_LINES); - int i = 0; - for (x = xb ; x < xe ; x += minor_step, ++i) + qglBegin (GL_LINES); + for (x=xb ; xgetKeyValue("_blocksize" ); + const char *value = ValueForKey( world_entity, "_blocksize" ); if (strlen(value)) - sscanf( value, "%i", &g_xywindow_globals_private.blockSize ); + sscanf( value, "%i", &g_qeglobals.blockSize ); - if (!g_xywindow_globals_private.blockSize || g_xywindow_globals_private.blockSize > 65536 || g_xywindow_globals_private.blockSize < 1024) + if (!g_qeglobals.blockSize || g_qeglobals.blockSize > 65536 || g_qeglobals.blockSize < 1024) // don't use custom blocksize if it is less than the default, or greater than the maximum world coordinate - g_xywindow_globals_private.blockSize = 1024; + g_qeglobals.blockSize = 1024; float x, y, xb, xe, yb, ye; float w, h; char text[32]; - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_1D); - glDisable(GL_DEPTH_TEST); - glDisable(GL_BLEND); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_DEPTH_TEST); + qglDisable(GL_BLEND); w = (m_nWidth / 2 / m_fScale); h = (m_nHeight / 2 / m_fScale); - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; xb = m_vOrigin[nDim1] - w; if (xb < region_mins[nDim1]) xb = region_mins[nDim1]; - xb = static_cast(g_xywindow_globals_private.blockSize * floor (xb/g_xywindow_globals_private.blockSize)); + xb = g_qeglobals.blockSize * floor (xb/g_qeglobals.blockSize); xe = m_vOrigin[nDim1] + w; if (xe > region_maxs[nDim1]) xe = region_maxs[nDim1]; - xe = static_cast(g_xywindow_globals_private.blockSize * ceil (xe/g_xywindow_globals_private.blockSize)); + xe = g_qeglobals.blockSize * ceil (xe/g_qeglobals.blockSize); yb = m_vOrigin[nDim2] - h; if (yb < region_mins[nDim2]) yb = region_mins[nDim2]; - yb = static_cast(g_xywindow_globals_private.blockSize * floor (yb/g_xywindow_globals_private.blockSize)); + yb = g_qeglobals.blockSize * floor (yb/g_qeglobals.blockSize); ye = m_vOrigin[nDim2] + h; if (ye > region_maxs[nDim2]) ye = region_maxs[nDim2]; - ye = static_cast(g_xywindow_globals_private.blockSize * ceil (ye/g_xywindow_globals_private.blockSize)); + ye = g_qeglobals.blockSize * ceil (ye/g_qeglobals.blockSize); // draw major blocks - glColor3fv(vector3_to_array(g_xywindow_globals.color_gridblock)); - glLineWidth (2); + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK]); + qglLineWidth (2); - glBegin (GL_LINES); + qglBegin (GL_LINES); - for (x=xb ; x<=xe ; x+=g_xywindow_globals_private.blockSize) + for (x=xb ; x<=xe ; x+=g_qeglobals.blockSize) { - glVertex2f (x, yb); - glVertex2f (x, ye); + qglVertex2f (x, yb); + qglVertex2f (x, ye); } - if (m_viewType == XY) + if (m_nViewType == XY) { - for (y=yb ; y<=ye ; y+=g_xywindow_globals_private.blockSize) + for (y=yb ; y<=ye ; y+=g_qeglobals.blockSize) { - glVertex2f (xb, y); - glVertex2f (xe, y); + qglVertex2f (xb, y); + qglVertex2f (xe, y); } } - glEnd(); - glLineWidth (1); + qglEnd (); + qglLineWidth (1); // draw coordinate text if needed - if (m_viewType == XY && m_fScale > .1) + if (m_nViewType == XY && m_fScale > .1) { - for (x=xb ; xGetCamWnd()->Camera()->origin[0]; + y = g_pParentWnd->GetCamWnd()->Camera()->origin[1]; + a = g_pParentWnd->GetCamWnd()->Camera()->angles[YAW]/180*Q_PI; } - else if (m_viewType == YZ) + else if (m_nViewType == YZ) { - x = origin[1]; - y = origin[2]; - a = degrees_to_radians(angles[CAMERA_PITCH]); + x = g_pParentWnd->GetCamWnd()->Camera()->origin[1]; + y = g_pParentWnd->GetCamWnd()->Camera()->origin[2]; + a = g_pParentWnd->GetCamWnd()->Camera()->angles[PITCH]/180*Q_PI; } else { - x = origin[0]; - y = origin[2]; - a = degrees_to_radians(angles[CAMERA_PITCH]); + x = g_pParentWnd->GetCamWnd()->Camera()->origin[0]; + y = g_pParentWnd->GetCamWnd()->Camera()->origin[2]; + a = g_pParentWnd->GetCamWnd()->Camera()->angles[PITCH]/180*Q_PI; } - glColor3f (0.0, 0.0, 1.0); - glBegin(GL_LINE_STRIP); - glVertex3f (x-box,y,0); - glVertex3f (x,y+(box/2),0); - glVertex3f (x+box,y,0); - glVertex3f (x,y-(box/2),0); - glVertex3f (x-box,y,0); - glVertex3f (x+box,y,0); - glEnd(); + qglColor3f (0.0, 0.0, 1.0); + qglBegin(GL_LINE_STRIP); + qglVertex3f (x-box,y,0); + qglVertex3f (x,y+(box/2),0); + qglVertex3f (x+box,y,0); + qglVertex3f (x,y-(box/2),0); + qglVertex3f (x-box,y,0); + qglVertex3f (x+box,y,0); + qglEnd (); - glBegin(GL_LINE_STRIP); - glVertex3f (x + static_cast(fov*cos(a+c_pi/4)), y + static_cast(fov*sin(a+c_pi/4)), 0); - glVertex3f (x, y, 0); - glVertex3f (x + static_cast(fov*cos(a-c_pi/4)), y + static_cast(fov*sin(a-c_pi/4)), 0); - glEnd(); + qglBegin(GL_LINE_STRIP); + qglVertex3f (x+fov*cos(a+Q_PI/4), y+fov*sin(a+Q_PI/4), 0); + qglVertex3f (x, y, 0); + qglVertex3f (x+fov*cos(a-Q_PI/4), y+fov*sin(a-Q_PI/4), 0); + qglEnd (); } - -float Betwixt(float f1, float f2) +void XYWnd::DrawZIcon (void) { - if (f1 > f2) - return f2 + ((f1 - f2) / 2); - else - return f1 + ((f2 - f1) / 2); -} + if (m_nViewType == XY) + { + float x = z.origin[0]; + float y = z.origin[1]; + float zdim = 8 / m_fScale; + qglEnable (GL_BLEND); + qglDisable (GL_TEXTURE_2D); + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + qglDisable (GL_CULL_FACE); + qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglColor4f (0.0, 0.0, 1.0, 0.25); + qglBegin(GL_QUADS); + qglVertex3f (x-zdim,y-zdim,0); + qglVertex3f (x+zdim,y-zdim,0); + qglVertex3f (x+zdim,y+zdim,0); + qglVertex3f (x-zdim,y+zdim,0); + qglEnd (); + qglDisable (GL_BLEND); + qglColor4f (0.0, 0.0, 1.0, 1); + + qglBegin(GL_LINE_LOOP); + qglVertex3f (x-zdim,y-zdim,0); + qglVertex3f (x+zdim,y-zdim,0); + qglVertex3f (x+zdim,y+zdim,0); + qglVertex3f (x-zdim,y+zdim,0); + qglEnd (); + + qglBegin(GL_LINE_STRIP); + qglVertex3f (x-(zdim/2),y+(zdim/2),0); + qglVertex3f (x+(zdim/2),y+(zdim/2),0); + qglVertex3f (x-(zdim/2),y-(zdim/2),0); + qglVertex3f (x+(zdim/2),y-(zdim/2),0); + qglEnd (); + } +} // can be greatly simplified but per usual i am in a hurry // which is not an excuse, just a fact -void XYWnd::PaintSizeInfo(int nDim1, int nDim2, Vector3& vMinBounds, Vector3& vMaxBounds) +void XYWnd::PaintSizeInfo(int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds) { - if(vector3_equal(vMinBounds, vMaxBounds)) + const char* g_pDimStrings[] = {"x:%.f", "y:%.f", "z:%.f"}; + const char* g_pOrgStrings[] = {"(x:%.f y:%.f)", "(x:%.f z:%.f)", "(y:%.f z:%.f)"}; + + CString g_strDim; + + vec3_t vSize; + VectorSubtract(vMaxBounds, vMinBounds, vSize); + + qglColor3f(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] * .65, + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] * .65, + g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] * .65); + + if (m_nViewType == XY) { - return; - } - const char* g_pDimStrings[] = {"x:", "y:", "z:"}; - typedef const char* OrgStrings[2]; - const OrgStrings g_pOrgStrings[] = { { "x:", "y:", }, { "x:", "z:", }, { "y:", "z:", } }; + qglBegin (GL_LINES); - Vector3 vSize(vector3_subtracted(vMaxBounds, vMinBounds)); + qglVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale, 0.0f); + qglVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - glColor3f(g_xywindow_globals.color_selbrushes[0] * .65f, - g_xywindow_globals.color_selbrushes[1] * .65f, - g_xywindow_globals.color_selbrushes[2] * .65f); + qglVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); + qglVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - StringOutputStream dimensions(16); - - if (m_viewType == XY) - { - glBegin (GL_LINES); - - glVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale, 0.0f); - glVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - - glVertex3f(vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - glVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - - glVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale, 0.0f); - glVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); + qglVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale, 0.0f); + qglVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f); - glVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2], 0.0f); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f); - glVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2], 0.0f); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2], 0.0f); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f); - glEnd(); + qglEnd(); - glRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0f / m_fScale, 0.0f); - dimensions << g_pDimStrings[nDim1] << vSize[nDim1]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0 / m_fScale, 0.0f); + g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (vMaxBounds[nDim1] + 16.0f / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]), 0.0f); - dimensions << g_pDimStrings[nDim2] << vSize[nDim2]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (vMaxBounds[nDim1] + 16.0 / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]), 0.0f); + g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (vMinBounds[nDim1] + 4, vMaxBounds[nDim2] + 8 / m_fScale, 0.0f); - dimensions << "(" << g_pOrgStrings[0][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[0][1] << vMaxBounds[nDim2] << ")"; - GlobalOpenGL().drawString(dimensions.c_str()); + qglRasterPos3f (vMinBounds[nDim1] + 4, vMaxBounds[nDim2] + 8 / m_fScale, 0.0f); + g_strDim.Format(g_pOrgStrings[0], vMinBounds[nDim1], vMaxBounds[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); } - else if (m_viewType == XZ) + else if (m_nViewType == XZ) { - glBegin (GL_LINES); + qglBegin (GL_LINES); - glVertex3f(vMinBounds[nDim1], 0, vMinBounds[nDim2] - 6.0f / m_fScale); - glVertex3f(vMinBounds[nDim1], 0, vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(vMinBounds[nDim1], 0, vMinBounds[nDim2] - 6.0f / m_fScale); + qglVertex3f(vMinBounds[nDim1], 0, vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(vMinBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(vMinBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 6.0f / m_fScale); - glVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 6.0f / m_fScale); + qglVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMinBounds[nDim2]); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMinBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]); - glVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMaxBounds[nDim2]); - glVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMaxBounds[nDim2]); + qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]); - glEnd(); + qglEnd(); - glRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), 0, vMinBounds[nDim2] - 20.0f / m_fScale); - dimensions << g_pDimStrings[nDim1] << vSize[nDim1]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), 0, vMinBounds[nDim2] - 20.0 / m_fScale); + g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (vMaxBounds[nDim1] + 16.0f / m_fScale, 0, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2])); - dimensions << g_pDimStrings[nDim2] << vSize[nDim2]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (vMaxBounds[nDim1] + 16.0 / m_fScale, 0, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2])); + g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (vMinBounds[nDim1] + 4, 0, vMaxBounds[nDim2] + 8 / m_fScale); - dimensions << "(" << g_pOrgStrings[1][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[1][1] << vMaxBounds[nDim2] << ")"; - GlobalOpenGL().drawString(dimensions.c_str()); + qglRasterPos3f (vMinBounds[nDim1] + 4, 0, vMaxBounds[nDim2] + 8 / m_fScale); + g_strDim.Format(g_pOrgStrings[1], vMinBounds[nDim1], vMaxBounds[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); } else { - glBegin (GL_LINES); + qglBegin (GL_LINES); - glVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale); - glVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale); + qglVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(0, vMinBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale); - glVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); + qglVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale); + qglVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale); - glVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2]); - glVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]); - glVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]); - glVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]); - glVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2]); - glVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2]); + qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]); - glEnd(); + qglEnd(); - glRasterPos3f (0, Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0f / m_fScale); - dimensions << g_pDimStrings[nDim1] << vSize[nDim1]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (0, Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0 / m_fScale); + g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (0, vMaxBounds[nDim1] + 16.0f / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2])); - dimensions << g_pDimStrings[nDim2] << vSize[nDim2]; - GlobalOpenGL().drawString(dimensions.c_str()); - dimensions.clear(); + qglRasterPos3f (0, vMaxBounds[nDim1] + 16.0 / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2])); + g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); - glRasterPos3f (0, vMinBounds[nDim1] + 4.0f, vMaxBounds[nDim2] + 8 / m_fScale); - dimensions << "(" << g_pOrgStrings[2][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[2][1] << vMaxBounds[nDim2] << ")"; - GlobalOpenGL().drawString(dimensions.c_str()); + qglRasterPos3f (0, vMinBounds[nDim1] + 4.0, vMaxBounds[nDim2] + 8 / m_fScale); + g_strDim.Format(g_pOrgStrings[2], vMinBounds[nDim1], vMaxBounds[nDim2]); + gtk_glwidget_print_string((char *) g_strDim.GetBuffer()); } } -class XYRenderer: public Renderer -{ - struct state_type - { - state_type() : - m_highlight(0), - m_state(0) - { - } - unsigned int m_highlight; - Shader* m_state; - }; -public: - XYRenderer(RenderStateFlags globalstate, Shader* selected) : - m_globalstate(globalstate), - m_state_selected(selected) - { - ASSERT_NOTNULL(selected); - m_state_stack.push_back(state_type()); - } - - void SetState(Shader* state, EStyle style) - { - ASSERT_NOTNULL(state); - if(style == eWireframeOnly) - m_state_stack.back().m_state = state; - } - const EStyle getStyle() const - { - return eWireframeOnly; - } - void PushState() - { - m_state_stack.push_back(m_state_stack.back()); - } - void PopState() - { - ASSERT_MESSAGE(!m_state_stack.empty(), "popping empty stack"); - m_state_stack.pop_back(); - } - void Highlight(EHighlightMode mode, bool bEnable = true) - { - (bEnable) - ? m_state_stack.back().m_highlight |= mode - : m_state_stack.back().m_highlight &= ~mode; - } - void addRenderable(const OpenGLRenderable& renderable, const Matrix4& localToWorld) - { - if(m_state_stack.back().m_highlight & ePrimitive) - { - m_state_selected->addRenderable(renderable, localToWorld); - } - else - { - m_state_stack.back().m_state->addRenderable(renderable, localToWorld); - } - } - - void render(const Matrix4& modelview, const Matrix4& projection) - { - GlobalShaderCache().render(m_globalstate, modelview, projection); - } -private: - std::vector m_state_stack; - RenderStateFlags m_globalstate; - Shader* m_state_selected; -}; - -void XYWnd::updateProjection() -{ - m_projection[0] = 1.0f / static_cast(m_nWidth / 2); - m_projection[5] = 1.0f / static_cast(m_nHeight / 2); - m_projection[10] = 1.0f / (g_MaxWorldCoord * m_fScale); - - m_projection[12] = 0.0f; - m_projection[13] = 0.0f; - m_projection[14] = -1.0f; - - m_projection[1] = - m_projection[2] = - m_projection[3] = - - m_projection[4] = - m_projection[6] = - m_projection[7] = - - m_projection[8] = - m_projection[9] = - m_projection[11] = 0.0f; - - m_projection[15] = 1.0f; - - m_view.Construct(m_projection, m_modelview, m_nWidth, m_nHeight); -} - -// note: modelview matrix must have a uniform scale, otherwise strange things happen when rendering the rotation manipulator. -void XYWnd::updateModelview() -{ - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; - - // translation - m_modelview[12] = -m_vOrigin[nDim1] * m_fScale; - m_modelview[13] = -m_vOrigin[nDim2] * m_fScale; - m_modelview[14] = g_MaxWorldCoord * m_fScale; - - // axis base - switch(m_viewType) - { - case XY: - m_modelview[0] = m_fScale; - m_modelview[1] = 0; - m_modelview[2] = 0; - - m_modelview[4] = 0; - m_modelview[5] = m_fScale; - m_modelview[6] = 0; - - m_modelview[8] = 0; - m_modelview[9] = 0; - m_modelview[10] = -m_fScale; - break; - case XZ: - m_modelview[0] = m_fScale; - m_modelview[1] = 0; - m_modelview[2] = 0; - - m_modelview[4] = 0; - m_modelview[5] = 0; - m_modelview[6] = m_fScale; - - m_modelview[8] = 0; - m_modelview[9] = m_fScale; - m_modelview[10] = 0; - break; - case YZ: - m_modelview[0] = 0; - m_modelview[1] = 0; - m_modelview[2] = -m_fScale; - - m_modelview[4] = m_fScale; - m_modelview[5] = 0; - m_modelview[6] = 0; - - m_modelview[8] = 0; - m_modelview[9] = m_fScale; - m_modelview[10] = 0; - break; - } - - m_modelview[3] = m_modelview[7] = m_modelview[11] = 0; - m_modelview[15] = 1; - - m_view.Construct(m_projection, m_modelview, m_nWidth, m_nHeight); -} - /* ============== XY_Draw ============== */ +#define ALT_POINT_SIZE 4 +// Alternative to GL_POINTS (for; vertex handles, patch handles, clip points, path points) +void DrawAlternatePoint(vec3_t v, float scale) +{ + if(scale == 0) + { + scale = g_pParentWnd->GetXYWnd()->Scale(); + //scale = g_qeglobals.d_xyOld.scale; + } + + // ugly gl_line cross + qglVertex3f ( v[0]+(ALT_POINT_SIZE/scale), v[1], v[2] ); + qglVertex3f ( v[0]-(ALT_POINT_SIZE/scale), v[1], v[2] ); + qglVertex3f ( v[0], v[1]+(ALT_POINT_SIZE/scale), v[2] ); + qglVertex3f ( v[0], v[1]-(ALT_POINT_SIZE/scale), v[2] ); + qglVertex3f ( v[0], v[1], v[2]+(ALT_POINT_SIZE/scale) ); + qglVertex3f ( v[0], v[1], v[2]-(ALT_POINT_SIZE/scale) ); +} + + +long g_lCount = 0; +long g_lTotal = 0; +extern void DrawBrushEntityName (brush_t *b); //#define DBG_SCENEDUMP void XYWnd::XY_Draw() { +#ifdef DBG_SCENEDUMP + static time_t s_start = 0; // we use that to dump the selected stuff every 2 seconds + time_t now; + time (&now); + bool bDump; + + if ((now - s_start) > 3) + { + bDump = true; + s_start = now; + Sys_FPrintf(SYS_WRN, "Starting scene dump\n"); + } + else bDump = false; +#endif + + brush_t *brush; + float w, h; + entity_t *e; + double start, end; + double start2, end2; + vec3_t mins, maxs; + int drawn, culled; + int i; + + if (!active_brushes.next) + return; // not valid yet + + Patch_LODMatchAll(); // spog + + if (m_bTiming) + start = Sys_DoubleTime(); // // clear // - glViewport(0, 0, m_nWidth, m_nHeight); - glClearColor (g_xywindow_globals.color_gridback[0], - g_xywindow_globals.color_gridback[1], - g_xywindow_globals.color_gridback[2],0); + m_bDirty = false; - glClear(GL_COLOR_BUFFER_BIT); + qglViewport(0, 0, m_nWidth, m_nHeight); + qglClearColor (g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][0], + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][1], + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][2],0); + + qglClear(GL_COLOR_BUFFER_BIT); // // set up viewpoint // + qglMatrixMode(GL_PROJECTION); + qglLoadIdentity (); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(reinterpret_cast(&m_projection)); + w = m_nWidth / 2 / m_fScale; + h = m_nHeight / 2/ m_fScale; - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glScalef(m_fScale, m_fScale, 1); - int nDim1 = (m_viewType == YZ) ? 1 : 0; - int nDim2 = (m_viewType == XY) ? 1 : 2; - glTranslatef(-m_vOrigin[nDim1], -m_vOrigin[nDim2], 0); + // fix GL_INVALID_VALUE error on first time the window is updated (win32) + if (w == 0) + w = 1; - glDisable (GL_LINE_STIPPLE); - glLineWidth(1); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisable(GL_TEXTURE_2D); - glDisable(GL_LIGHTING); - glDisable(GL_COLOR_MATERIAL); - glDisable(GL_DEPTH_TEST); + int nDim1 = (m_nViewType == YZ) ? 1 : 0; + int nDim2 = (m_nViewType == XY) ? 1 : 2; + mins[0] = m_vOrigin[nDim1] - w; + maxs[0] = m_vOrigin[nDim1] + w; + mins[1] = m_vOrigin[nDim2] - h; + maxs[1] = m_vOrigin[nDim2] + h; - XY_DrawGrid(); - if ( g_xywindow_globals_private.show_blocks) - XY_DrawBlockGrid(); + qglOrtho (mins[0], maxs[0], mins[1], maxs[1], g_MinWorldCoord, g_MaxWorldCoord); - glLoadMatrixf(reinterpret_cast(&m_modelview)); + qglMatrixMode(GL_MODELVIEW); + qglLoadIdentity (); - unsigned int globalstate = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_POLYGONSMOOTH | RENDER_LINESMOOTH; - if(!g_xywindow_globals.m_bNoStipple) + // + // now draw the grid + // + XY_DrawGrid (); + + // + // draw block grid + // + if ( g_qeglobals.show_blocks) + XY_DrawBlockGrid (); + + if (m_nViewType != XY) { - globalstate |= RENDER_LINESTIPPLE; + qglPushMatrix(); + if (m_nViewType == YZ) + qglRotatef (-90, 0, 1, 0); // put Z going up + qglRotatef (-90, 1, 0, 0); // put Z going up } + // + // draw stuff + // + qglShadeModel (GL_FLAT); + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_DEPTH_TEST); + qglDisable(GL_BLEND); + qglDisable(GL_CULL_FACE); + qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + qglColor3f(0, 0, 0); + qglEnableClientState(GL_VERTEX_ARRAY); + + // Fishman - Add antialiazed points and lines support. 09/15/00 + if (g_PrefsDlg.m_bAntialiasedPointsAndLines) + { + qglEnable(GL_BLEND); + qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + qglEnable(GL_POINT_SMOOTH); + qglEnable(GL_LINE_SMOOTH); + } + + drawn = culled = 0; + + e = world_entity; + + if (m_bTiming) + start2 = Sys_DoubleTime(); + + for (brush = active_brushes.next ; brush != &active_brushes ; brush=brush->next) { - XYRenderer renderer(globalstate, m_state_selected); + if (brush->bFiltered) + continue; - Scene_Render(renderer, m_view); - - GlobalOpenGL_debugAssertNoErrors(); - renderer.render(m_modelview, m_projection); - GlobalOpenGL_debugAssertNoErrors(); - } - - glDepthMask(GL_FALSE); - - GlobalOpenGL_debugAssertNoErrors(); - - glLoadMatrixf(reinterpret_cast(&m_modelview)); - - GlobalOpenGL_debugAssertNoErrors(); - glDisable(GL_LINE_STIPPLE); - GlobalOpenGL_debugAssertNoErrors(); - glLineWidth(1); - GlobalOpenGL_debugAssertNoErrors(); - if(GlobalOpenGL().GL_1_3()) - { - glActiveTexture(GL_TEXTURE0); - glClientActiveTexture(GL_TEXTURE0); - } - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - glDisableClientState(GL_NORMAL_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - glDisableClientState(GL_COLOR_ARRAY); - GlobalOpenGL_debugAssertNoErrors(); - glDisable(GL_TEXTURE_2D); - GlobalOpenGL_debugAssertNoErrors(); - glDisable(GL_LIGHTING); - GlobalOpenGL_debugAssertNoErrors(); - glDisable(GL_COLOR_MATERIAL); - GlobalOpenGL_debugAssertNoErrors(); - - GlobalOpenGL_debugAssertNoErrors(); - - - // size info - if(g_xywindow_globals_private.m_bSizePaint && GlobalSelectionSystem().countSelected() != 0) - { - Vector3 min, max; - Select_GetBounds(min, max); - PaintSizeInfo(nDim1, nDim2, min, max); - } - - if (g_bCrossHairs) - { - glColor4f(0.2f, 0.9f, 0.2f, 0.8f); - glBegin (GL_LINES); - if (m_viewType == XY) + if (brush->mins[nDim1] > maxs[0] || + brush->mins[nDim2] > maxs[1] || + brush->maxs[nDim1] < mins[0] || + brush->maxs[nDim2] < mins[1]) { - glVertex2f(2.0f * g_MinWorldCoord, m_mousePosition[1]); - glVertex2f(2.0f * g_MaxWorldCoord, m_mousePosition[1]); - glVertex2f(m_mousePosition[0], 2.0f * g_MinWorldCoord); - glVertex2f(m_mousePosition[0], 2.0f * g_MaxWorldCoord); + culled++; + continue; // off screen } - else if (m_viewType == YZ) + + drawn++; + + if (brush->owner != e && brush->owner) { - glVertex3f(m_mousePosition[0], 2.0f * g_MinWorldCoord, m_mousePosition[2]); - glVertex3f(m_mousePosition[0], 2.0f * g_MaxWorldCoord, m_mousePosition[2]); - glVertex3f(m_mousePosition[0], m_mousePosition[1], 2.0f * g_MinWorldCoord); - glVertex3f(m_mousePosition[0], m_mousePosition[1], 2.0f * g_MaxWorldCoord); + qglColor3fv(brush->owner->eclass->color); } else { - glVertex3f (2.0f * g_MinWorldCoord, m_mousePosition[1], m_mousePosition[2]); - glVertex3f (2.0f * g_MaxWorldCoord, m_mousePosition[1], m_mousePosition[2]); - glVertex3f(m_mousePosition[0], m_mousePosition[1], 2.0f * g_MinWorldCoord); - glVertex3f(m_mousePosition[0], m_mousePosition[1], 2.0f * g_MaxWorldCoord); + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES]); } - glEnd(); - } - if (ClipMode()) +#ifdef DBG_SCENEDUMP + if (bDump) + { + Sys_FPrintf(SYS_WRN, "Active brush: %p ", brush); + Sys_FPrintf(SYS_WRN, "owner->eclass: %s\n", brush->owner->eclass->name); + } +#endif + + Brush_DrawXY(brush, m_nViewType); + } + + if (m_bTiming) + end2 = Sys_DoubleTime(); + + DrawPathLines (); + + // + // draw pointfile + // + //++timo why is the display list broken? + if ( g_qeglobals.d_pointfile_display_list) + Pointfile_Draw(); + + // + // now draw selected brushes + // + + if (RotateMode()) + qglColor3f(0.8f, 0.1f, 0.9f); + else + if (ScaleMode()) + qglColor3f(0.1f, 0.8f, 0.1f); + else + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES]); + + + if (g_PrefsDlg.m_bNoStipple == FALSE) { - GlobalClipPoints_Draw(m_fScale); + qglEnable (GL_LINE_STIPPLE); + qglLineStipple (3, 0xaaaa); + } + qglLineWidth (2); + + vec3_t vMinBounds; + vec3_t vMaxBounds; + vMinBounds[0] = vMinBounds[1] = vMinBounds[2] = g_MaxWorldCoord; + vMaxBounds[0] = vMaxBounds[1] = vMaxBounds[2] = g_MinWorldCoord; + + int nSaveDrawn = drawn; + bool bFixedSize = false; + for (brush = selected_brushes.next ; brush != &selected_brushes ; brush=brush->next) + { + // spog - added culling of selected brushes in XY window + if (brush->mins[nDim1] > maxs[0] || + brush->mins[nDim2] > maxs[1] || + brush->maxs[nDim1] < mins[0] || + brush->maxs[nDim2] < mins[1]) + { + culled++; + continue; // off screen + } + drawn++; +#ifdef DBG_SCENEDUMP + if (bDump) + { + Sys_FPrintf(SYS_WRN, "Selected brush: %p ", brush); + Sys_FPrintf(SYS_WRN, "owner->eclass: %s\n", brush->owner->eclass->name); + } +#endif + Brush_DrawXY(brush, m_nViewType); + + if (!bFixedSize) + { + if (brush->owner->eclass->fixedsize) + bFixedSize = true; + if (g_PrefsDlg.m_bSizePaint) + { + for (i = 0; i < 3; i ++) + { + if (brush->mins[i] < vMinBounds[i]) + vMinBounds[i] = brush->mins[i]; + if (brush->maxs[i] > vMaxBounds[i]) + vMaxBounds[i] = brush->maxs[i]; + } + } + } } - GlobalOpenGL_debugAssertNoErrors(); - - // reset modelview - glLoadIdentity(); - glScalef(m_fScale, m_fScale, 1); - glTranslatef(-m_vOrigin[nDim1], -m_vOrigin[nDim2], 0); + if (g_PrefsDlg.m_bNoStipple == FALSE) + { + qglDisable (GL_LINE_STIPPLE); + } + qglLineWidth (1); - DrawCameraIcon (Camera_getOrigin(*g_pParentWnd->GetCamWnd()), Camera_getAngles(*g_pParentWnd->GetCamWnd())); + if (!bFixedSize && !RotateMode() && !ScaleMode() && drawn - nSaveDrawn > 0 && g_PrefsDlg.m_bSizePaint) + PaintSizeInfo(nDim1, nDim2, vMinBounds, vMaxBounds); - Feedback_draw2D( m_viewType ); + // edge / vertex flags + if (g_qeglobals.d_select_mode == sel_vertex) + { + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + // brush verts + qglPointSize (4); + qglColor3f (0,1,0); + qglBegin (GL_POINTS); + for (i=0 ; iCurrentStyle() == MainFrame::eSplit) - glColor3fv(vector3_to_array(g_xywindow_globals.color_viewname)); + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME]); + else + qglColor3fv( g_qeglobals.d_savedinfo.AxisColors[m_nViewType]); + qglBegin (GL_LINE_LOOP); + qglVertex2i (0, 0); + qglVertex2i (m_nWidth-1, 0); + qglVertex2i (m_nWidth-1, m_nHeight-1); + qglVertex2i (0, m_nHeight-1); + qglEnd (); + + qglMatrixMode (GL_PROJECTION); + qglPopMatrix (); + qglMatrixMode (GL_MODELVIEW); + qglPopMatrix (); + } + } + + qglFinish(); + + if (m_bTiming) + { + end = Sys_DoubleTime (); + i = (int)(1000*(end-start)); + int i3 = (int)(1000*(end2-start2)); + g_lCount++; + g_lTotal += i; + int i2 = g_lTotal / g_lCount; + Sys_Printf ("xy: %i ab: %i avg: %i\n", i, i3, i2); + } + + // Fishman - Add antialiazed points and lines support. 09/03/00 + if (g_PrefsDlg.m_bAntialiasedPointsAndLines) + { + qglDisable(GL_POINT_SMOOTH); + qglDisable(GL_LINE_SMOOTH); + qglDisable(GL_BLEND); + } +} + +void XYWnd::Copy() +{ +} + +void XYWnd::Undo() +{ +} + +void XYWnd::UndoClear() +{ +} + +void XYWnd::UndoCopy() +{ +} + +bool XYWnd::UndoAvailable() +{ + return (g_brUndo.next != &g_brUndo); +} + +void XYWnd::Paste() +{ +} + +// should be static as should be the rotate scale stuff +bool XYWnd::AreaSelectOK() +{ + return RotateMode() ? false : ScaleMode() ? false : true; +} + +void XYWnd::OnCreate () +{ + if (!MakeCurrent ()) + Error ("glXMakeCurrent failed"); + + qglPolygonStipple ((unsigned char *)s_stipple); + qglLineStipple (3, 0xaaaa); +} + +void XYWnd::OnExpose () +{ + bool bPaint = true; + if (!MakeCurrent ()) + { + Sys_Printf("ERROR: glXMakeCurrent failed.. Error:%i\n",qglGetError()); + Sys_Printf("Please restart Radiant if the Map view is not working\n"); + bPaint = false; + } + if (bPaint) + { + QE_CheckOpenGLForErrors(); + XY_Draw (); + QE_CheckOpenGLForErrors(); + + if (m_nViewType != XY) + { + qglPushMatrix(); + if (m_nViewType == YZ) + qglRotatef (-90, 0, 1, 0); // put Z going up + qglRotatef (-90, 1, 0, 0); // put Z going up + } + + if (g_bCrossHairs) + { + qglColor4f(0.2f, 0.9f, 0.2f, 0.8f); + qglBegin (GL_LINES); + if (m_nViewType == XY) + { + qglVertex2f(2*g_MinWorldCoord, tdp[1]); + qglVertex2f(2*g_MaxWorldCoord, tdp[1]); + qglVertex2f(tdp[0], 2*g_MinWorldCoord); + qglVertex2f(tdp[0], 2*g_MaxWorldCoord); + } + else if (m_nViewType == YZ) + { + qglVertex3f(tdp[0], 2*g_MinWorldCoord, tdp[2]); + qglVertex3f(tdp[0], 2*g_MaxWorldCoord, tdp[2]); + qglVertex3f(tdp[0], tdp[1], 2*g_MinWorldCoord); + qglVertex3f(tdp[0], tdp[1], 2*g_MaxWorldCoord); + } else { - switch(m_viewType) + qglVertex3f (2*g_MinWorldCoord, tdp[1], tdp[2]); + qglVertex3f (2*g_MaxWorldCoord, tdp[1], tdp[2]); + qglVertex3f(tdp[0], tdp[1], 2*g_MinWorldCoord); + qglVertex3f(tdp[0], tdp[1], 2*g_MaxWorldCoord); + } + qglEnd(); + } + + if (ClipMode()) + { + // Draw clip points + if (g_Clip1.Set()) + g_Clip1.Draw(m_fScale, 1); // qglVertex3fv (g_Clip1); + if (g_Clip2.Set()) + g_Clip2.Draw(m_fScale, 2); // qglVertex3fv (g_Clip2); + if (g_Clip3.Set()) + g_Clip3.Draw(m_fScale, 3); // qglVertex3fv (g_Clip3); + if (g_Clip1.Set() && g_Clip2.Set()) + { + ProduceSplitLists(); + brush_t* pBrush; + brush_t* pList = (g_bSwitch) ? &g_brBackSplits : &g_brFrontSplits; + for (pBrush = pList->next ; pBrush != NULL && pBrush != pList ; pBrush=pBrush->next) { - case YZ: - glColor3fv(vector3_to_array(g_xywindow_globals.AxisColorX)); - break; - case XZ: - glColor3fv(vector3_to_array(g_xywindow_globals.AxisColorY)); - break; - case XY: - glColor3fv(vector3_to_array(g_xywindow_globals.AxisColorZ)); - break; + qglColor3f (1,1,0); + face_t *face; + int order; + for (face = pBrush->brush_faces,order = 0 ; face ; face=face->next, order++) + { + winding_t* w = face->face_winding; + if (!w) + continue; + // draw the polygon + qglBegin(GL_LINE_LOOP); + for (int i=0 ; inumpoints ; i++) + qglVertex3fv(w->points[i]); + qglEnd(); + } } } - glBegin (GL_LINE_LOOP); - glVertex2i (0, 0); - glVertex2i (m_nWidth-1, 0); - glVertex2i (m_nWidth-1, m_nHeight-1); - glVertex2i (0, m_nHeight-1); - glEnd(); } + + if (PathMode()) + { + int n; + for (n = 0; n < g_nPathCount; n++) + g_PathPoints[n].Draw(m_fScale, n+1); // qglVertex3fv(g_PathPoints[n]); + } + if (m_nViewType != XY) + qglPopMatrix(); + + m_XORRectangle.set(rectangle_t()); + SwapBuffers (); } - - GlobalOpenGL_debugAssertNoErrors(); - - glFinish(); } -void XYWnd_MouseToPoint(XYWnd* xywnd, int x, int y, Vector3& point) +void XYWnd::KillPathMode() { - xywnd->XY_ToPoint(x, y, point); - xywnd->XY_SnapToGrid(point); - - int nDim = (xywnd->GetViewType() == XY) ? 2 : (xywnd->GetViewType() == YZ) ? 0 : 1; - float fWorkMid = float_mid(Select_getWorkZone().d_work_min[nDim], Select_getWorkZone().d_work_max[nDim]); - point[nDim] = float_snapped(fWorkMid, GetGridSize()); + g_bSmartGo = false; + g_bPathMode = false; + if (g_pPathFunc) + g_pPathFunc(false, g_nPathCount); + g_nPathCount = 0; + g_pPathFunc = NULL; + Sys_UpdateWindows(W_ALL); } +// gets called for drop down menu messages +// TIP: it's not always about EntityCreate void XYWnd::OnEntityCreate (const char* item) { - StringOutputStream command; - command << "entityCreate -class " << item; - UndoableCommand undo(command.c_str()); - Vector3 point; - XYWnd_MouseToPoint(this, m_entityCreate_x, m_entityCreate_y, point); - Entity_createFromSelection(item, point); -} + Undo_Start("create entity"); + Undo_AddBrushList(&selected_brushes); - - -void GetFocusPosition(Vector3& position) -{ - if(GlobalSelectionSystem().countSelected() != 0) + if (m_mnuDrop != NULL) { - Select_GetMid(position); - } - else - { - position = Camera_getOrigin(*g_pParentWnd->GetCamWnd()); - } -} + CString strItem; + strItem = item; -void XYWnd_Focus(XYWnd* xywnd) -{ - Vector3 position; - GetFocusPosition(position); - xywnd->PositionView(position); -} - -void XY_Split_Focus() -{ - Vector3 position; - GetFocusPosition(position); - g_pParentWnd->GetXYWnd()->PositionView(position); - g_pParentWnd->GetXZWnd()->PositionView(position); - g_pParentWnd->GetYZWnd()->PositionView(position); -} - -void XY_Focus() -{ - XYWnd* xywnd = g_pParentWnd->GetXYWnd(); - XYWnd_Focus(xywnd); -} - -void XY_Top() -{ - XYWnd* xywnd = g_pParentWnd->GetXYWnd(); - xywnd->SetViewType(XY); - XYWnd_Focus(xywnd); -} - -void XY_Side() -{ - XYWnd* xywnd = g_pParentWnd->GetXYWnd(); - xywnd->SetViewType(XZ); - XYWnd_Focus(xywnd); -} - -void XY_Front() -{ - g_pParentWnd->GetXYWnd()->SetViewType(YZ); - XYWnd_Focus(g_pParentWnd->GetXYWnd()); -} - -void XY_Next() -{ - XYWnd* xywnd = g_pParentWnd->GetXYWnd(); - if (xywnd->GetViewType() == XY) - xywnd->SetViewType(XZ); - else if (xywnd->GetViewType() == XZ) - xywnd->SetViewType(YZ); - else - xywnd->SetViewType(XY); - XYWnd_Focus(xywnd); -} - -void XY_Zoom100() -{ - if (g_pParentWnd->GetXYWnd()) - g_pParentWnd->GetXYWnd()->SetScale(1); - if (g_pParentWnd->GetXZWnd()) - g_pParentWnd->GetXZWnd()->SetScale(1); - if (g_pParentWnd->GetYZWnd()) - g_pParentWnd->GetYZWnd()->SetScale(1); -} - -void XY_ZoomIn() -{ - XYWnd_ZoomIn(g_pParentWnd->ActiveXY()); -} - -// NOTE: the zoom out factor is 4/5, we could think about customizing it -// we don't go below a zoom factor corresponding to 10% of the max world size -// (this has to be computed against the window size) -void XY_ZoomOut() -{ - XYWnd_ZoomOut(g_pParentWnd->ActiveXY()); -} - - - -void ToggleShowCrosshair() -{ - g_bCrossHairs ^= 1; - XY_UpdateAllWindows(); -} - -void ToggleShowSizeInfo() -{ - g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint; - XY_UpdateAllWindows(); -} - -void ToggleShowGrid() -{ - g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid; - XY_UpdateAllWindows(); -} - -ToggleShown g_xy_top_shown(true); - -void XY_Top_Shown_Construct(GtkWindow* parent) -{ - g_xy_top_shown.connect(GTK_WIDGET(parent)); -} - -ToggleShown g_yz_side_shown(false); - -void YZ_Side_Shown_Construct(GtkWindow* parent) -{ - g_yz_side_shown.connect(GTK_WIDGET(parent)); -} - -ToggleShown g_xz_front_shown(false); - -void XZ_Front_Shown_Construct(GtkWindow* parent) -{ - g_xz_front_shown.connect(GTK_WIDGET(parent)); -} - - -class EntityClassMenu : public ModuleObserver -{ - std::size_t m_unrealised; -public: - EntityClassMenu() : m_unrealised(1) - { - } - void realise() - { - if(--m_unrealised == 0) + if (strItem.CompareNoCase("Add to...") == 0) { + //++timo TODO: fill the menu with current groups? + // this one is for adding to existing groups only + Sys_Printf("TODO: Add to... in XYWnd::OnEntityCreate\n"); } - } - void unrealise() - { - if(++m_unrealised == 1) + else if (strItem.CompareNoCase("Remove") == 0) { - if(XYWnd::m_mnuDrop != 0) + // remove selected brushes from their current group + brush_t *b; + for( b = selected_brushes.next; b != &selected_brushes; b = b->next ) { - gtk_widget_destroy(GTK_WIDGET(XYWnd::m_mnuDrop)); - XYWnd::m_mnuDrop = 0; + } } + + //++timo FIXME: remove when all hooks are in + if (strItem.CompareNoCase("Add to...") == 0 + || strItem.CompareNoCase("Remove") == 0 + || strItem.CompareNoCase("Name...") == 0 + || strItem.CompareNoCase("New group...") == 0) + { + Sys_Printf("TODO: hook drop down group menu\n"); + return; + } + + if (strItem.Find("Smart_") >= 0) + { + CreateSmartEntity(this, m_ptDownX, m_ptDownY, strItem); + } + else + { + CreateRightClickEntity(this, m_ptDownX, m_ptDownY, (char*)strItem.GetBuffer()); + } + + Sys_UpdateWindows(W_ALL); + //OnLButtonDown((MK_LBUTTON | MK_SHIFT), CPoint(m_ptDown.x+2, m_ptDown.y+2)); } -}; - -EntityClassMenu g_EntityClassMenu; - - - - -void ShowNamesToggle() -{ - GlobalEntityCreator().setShowNames(!GlobalEntityCreator().getShowNames()); - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowNamesToggleCaller; -void ShowNamesExport(const BoolImportCallback& importer) -{ - importer(GlobalEntityCreator().getShowNames()); -} -typedef FreeCaller1 ShowNamesExportCaller; - -void ShowAnglesToggle() -{ - GlobalEntityCreator().setShowAngles(!GlobalEntityCreator().getShowAngles()); - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowAnglesToggleCaller; -void ShowAnglesExport(const BoolImportCallback& importer) -{ - importer(GlobalEntityCreator().getShowAngles()); -} -typedef FreeCaller1 ShowAnglesExportCaller; - -void ShowBlocksToggle() -{ - g_xywindow_globals_private.show_blocks ^= 1; - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowBlocksToggleCaller; -void ShowBlocksExport(const BoolImportCallback& importer) -{ - importer(g_xywindow_globals_private.show_blocks); -} -typedef FreeCaller1 ShowBlocksExportCaller; - -void ShowCoordinatesToggle() -{ - g_xywindow_globals_private.show_coordinates ^= 1; - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowCoordinatesToggleCaller; -void ShowCoordinatesExport(const BoolImportCallback& importer) -{ - importer(g_xywindow_globals_private.show_coordinates); -} -typedef FreeCaller1 ShowCoordinatesExportCaller; - -void ShowOutlineToggle() -{ - g_xywindow_globals_private.show_outline ^= 1; - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowOutlineToggleCaller; -void ShowOutlineExport(const BoolImportCallback& importer) -{ - importer(g_xywindow_globals_private.show_outline); -} -typedef FreeCaller1 ShowOutlineExportCaller; - -void ShowAxesToggle() -{ - g_xywindow_globals_private.show_axis ^= 1; - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowAxesToggleCaller; -void ShowAxesExport(const BoolImportCallback& importer) -{ - importer(g_xywindow_globals_private.show_axis); -} -typedef FreeCaller1 ShowAxesExportCaller; - -void ShowWorkzoneToggle() -{ - g_xywindow_globals_private.d_show_work ^= 1; - XY_UpdateAllWindows(); -} -typedef FreeCaller ShowWorkzoneToggleCaller; -void ShowWorkzoneExport(const BoolImportCallback& importer) -{ - importer(g_xywindow_globals_private.d_show_work); -} -typedef FreeCaller1 ShowWorkzoneExportCaller; - -ShowNamesExportCaller g_show_names_caller; -BoolExportCallback g_show_names_callback(g_show_names_caller); -ToggleItem g_show_names(g_show_names_callback); - -ShowAnglesExportCaller g_show_angles_caller; -BoolExportCallback g_show_angles_callback(g_show_angles_caller); -ToggleItem g_show_angles(g_show_angles_callback); - -ShowBlocksExportCaller g_show_blocks_caller; -BoolExportCallback g_show_blocks_callback(g_show_blocks_caller); -ToggleItem g_show_blocks(g_show_blocks_callback); - -ShowCoordinatesExportCaller g_show_coordinates_caller; -BoolExportCallback g_show_coordinates_callback(g_show_coordinates_caller); -ToggleItem g_show_coordinates(g_show_coordinates_callback); - -ShowOutlineExportCaller g_show_outline_caller; -BoolExportCallback g_show_outline_callback(g_show_outline_caller); -ToggleItem g_show_outline(g_show_outline_callback); - -ShowAxesExportCaller g_show_axes_caller; -BoolExportCallback g_show_axes_callback(g_show_axes_caller); -ToggleItem g_show_axes(g_show_axes_callback); - -ShowWorkzoneExportCaller g_show_workzone_caller; -BoolExportCallback g_show_workzone_callback(g_show_workzone_caller); -ToggleItem g_show_workzone(g_show_workzone_callback); - -void XYShow_registerCommands() -{ - GlobalToggles_insert("ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller(g_show_angles)); - GlobalToggles_insert("ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller(g_show_names)); - GlobalToggles_insert("ShowBlocks", ShowBlocksToggleCaller(), ToggleItem::AddCallbackCaller(g_show_blocks)); - GlobalToggles_insert("ShowCoordinates", ShowCoordinatesToggleCaller(), ToggleItem::AddCallbackCaller(g_show_coordinates)); - GlobalToggles_insert("ShowWindowOutline", ShowOutlineToggleCaller(), ToggleItem::AddCallbackCaller(g_show_outline)); - GlobalToggles_insert("ShowAxes", ShowAxesToggleCaller(), ToggleItem::AddCallbackCaller(g_show_axes)); - GlobalToggles_insert("ShowWorkzone", ShowWorkzoneToggleCaller(), ToggleItem::AddCallbackCaller(g_show_workzone)); + Undo_EndBrushList(&selected_brushes); + Undo_End(); } -void XYWnd_registerShortcuts() +/* Drawing clip points */ +void ClipPoint::Draw(float fScale, int num) { - command_connect_accelerator("ToggleCrosshairs"); - command_connect_accelerator("ToggleSizePaint"); + CString strLabel; + strLabel.Format("%d", num); + Draw(fScale, strLabel.GetBuffer()); } +#define ALT_POINT_VERTS 6 +void ClipPoint::Draw(float fScale, const char *label) +{ + // draw point + if(!g_PrefsDlg.m_bGlPtWorkaround) + { + qglPointSize (4); + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER]); + qglBegin (GL_POINTS); + qglVertex3fv (m_ptClip); + qglEnd(); + qglPointSize (1); + } + else + { + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER]); + qglLineWidth(2.0); + qglBegin (GL_LINES); + DrawAlternatePoint(m_ptClip, fScale); + qglEnd(); + qglLineWidth(1.0); + } -void Orthographic_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox("", "Solid selection boxes", g_xywindow_globals.m_bNoStipple); - page.appendCheckBox("", "Display size info", g_xywindow_globals_private.m_bSizePaint); - page.appendCheckBox("", "Chase mouse during drags", g_xywindow_globals_private.m_bChaseMouse); - page.appendCheckBox("", "Update views on camera move", g_xywindow_globals_private.m_bCamXYUpdate); -} -void Orthographic_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Orthographic", "Orthographic View Preferences")); - Orthographic_constructPreferences(page); -} -void Orthographic_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); + // draw label + qglRasterPos3f (m_ptClip[0]+2, m_ptClip[1]+2, m_ptClip[2]+2); + qglCallLists (strlen(label), GL_UNSIGNED_BYTE, label); } -void Clipper_constructPreferences(PreferencesPage& page) -{ - page.appendCheckBox("", "Clipper tool uses caulk", g_clip_useCaulk); -} -void Clipper_constructPage(PreferenceGroup& group) -{ - PreferencesPage page(group.createPage("Clipper", "Clipper Tool Settings")); - Clipper_constructPreferences(page); -} -void Clipper_registerPreferencesPage() -{ - PreferencesDialog_addSettingsPage(FreeCaller1()); -} - - -#include "preferencesystem.h" -#include "stringio.h" - - - - -void ToggleShown_importBool(ToggleShown& self, bool value) -{ - self.set(value); -} -typedef ReferenceCaller1 ToggleShownImportBoolCaller; -void ToggleShown_exportBool(const ToggleShown& self, const BoolImportCallback& importer) -{ - importer(self.active()); -} -typedef ConstReferenceCaller1 ToggleShownExportBoolCaller; - - -void XYWindow_Construct() -{ - GlobalCommands_insert("ToggleCrosshairs", FreeCaller(), Accelerator('X', (GdkModifierType)GDK_SHIFT_MASK)); - GlobalCommands_insert("ToggleSizePaint", FreeCaller(), Accelerator('J')); - GlobalCommands_insert("ToggleGrid", FreeCaller(), Accelerator('0')); - - GlobalToggles_insert("ToggleView", ToggleShown::ToggleCaller(g_xy_top_shown), ToggleItem::AddCallbackCaller(g_xy_top_shown.m_item), Accelerator('V', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalToggles_insert("ToggleSideView", ToggleShown::ToggleCaller(g_yz_side_shown), ToggleItem::AddCallbackCaller(g_yz_side_shown.m_item)); - GlobalToggles_insert("ToggleFrontView", ToggleShown::ToggleCaller(g_xz_front_shown), ToggleItem::AddCallbackCaller(g_xz_front_shown.m_item)); - GlobalCommands_insert("NextView", FreeCaller(), Accelerator(GDK_Tab, (GdkModifierType)GDK_CONTROL_MASK)); - GlobalCommands_insert("ZoomIn", FreeCaller(), Accelerator(GDK_Delete)); - GlobalCommands_insert("ZoomOut", FreeCaller(), Accelerator(GDK_Insert)); - GlobalCommands_insert("ViewTop", FreeCaller()); - GlobalCommands_insert("ViewSide", FreeCaller()); - GlobalCommands_insert("ViewFront", FreeCaller()); - GlobalCommands_insert("Zoom100", FreeCaller()); - GlobalCommands_insert("CenterXYViews", FreeCaller(), Accelerator(GDK_Tab, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - GlobalCommands_insert("CenterXYView", FreeCaller(), Accelerator(GDK_Tab, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK))); - - GlobalPreferenceSystem().registerPreference("ClipCaulk", BoolImportStringCaller(g_clip_useCaulk), BoolExportStringCaller(g_clip_useCaulk)); - - GlobalPreferenceSystem().registerPreference("NewRightClick", BoolImportStringCaller(g_xywindow_globals.m_bRightClick), BoolExportStringCaller(g_xywindow_globals.m_bRightClick)); - GlobalPreferenceSystem().registerPreference("ChaseMouse", BoolImportStringCaller(g_xywindow_globals_private.m_bChaseMouse), BoolExportStringCaller(g_xywindow_globals_private.m_bChaseMouse)); - GlobalPreferenceSystem().registerPreference("SizePainting", BoolImportStringCaller(g_xywindow_globals_private.m_bSizePaint), BoolExportStringCaller(g_xywindow_globals_private.m_bSizePaint)); - GlobalPreferenceSystem().registerPreference("NoStipple", BoolImportStringCaller(g_xywindow_globals.m_bNoStipple), BoolExportStringCaller(g_xywindow_globals.m_bNoStipple)); - GlobalPreferenceSystem().registerPreference("SI_ShowCoords", BoolImportStringCaller(g_xywindow_globals_private.show_coordinates), BoolExportStringCaller(g_xywindow_globals_private.show_coordinates)); - GlobalPreferenceSystem().registerPreference("SI_ShowOutlines", BoolImportStringCaller(g_xywindow_globals_private.show_outline), BoolExportStringCaller(g_xywindow_globals_private.show_outline)); - GlobalPreferenceSystem().registerPreference("SI_ShowAxis", BoolImportStringCaller(g_xywindow_globals_private.show_axis), BoolExportStringCaller(g_xywindow_globals_private.show_axis)); - GlobalPreferenceSystem().registerPreference("CamXYUpdate", BoolImportStringCaller(g_xywindow_globals_private.m_bCamXYUpdate), BoolExportStringCaller(g_xywindow_globals_private.m_bCamXYUpdate)); - GlobalPreferenceSystem().registerPreference("ShowWorkzone", BoolImportStringCaller(g_xywindow_globals_private.d_show_work), BoolExportStringCaller(g_xywindow_globals_private.d_show_work)); - - GlobalPreferenceSystem().registerPreference("SI_AxisColors0", Vector3ImportStringCaller(g_xywindow_globals.AxisColorX), Vector3ExportStringCaller(g_xywindow_globals.AxisColorX)); - GlobalPreferenceSystem().registerPreference("SI_AxisColors1", Vector3ImportStringCaller(g_xywindow_globals.AxisColorY), Vector3ExportStringCaller(g_xywindow_globals.AxisColorY)); - GlobalPreferenceSystem().registerPreference("SI_AxisColors2", Vector3ImportStringCaller(g_xywindow_globals.AxisColorZ), Vector3ExportStringCaller(g_xywindow_globals.AxisColorZ)); - GlobalPreferenceSystem().registerPreference("SI_Colors1", Vector3ImportStringCaller(g_xywindow_globals.color_gridback), Vector3ExportStringCaller(g_xywindow_globals.color_gridback)); - GlobalPreferenceSystem().registerPreference("SI_Colors2", Vector3ImportStringCaller(g_xywindow_globals.color_gridminor), Vector3ExportStringCaller(g_xywindow_globals.color_gridminor)); - GlobalPreferenceSystem().registerPreference("SI_Colors3", Vector3ImportStringCaller(g_xywindow_globals.color_gridmajor), Vector3ExportStringCaller(g_xywindow_globals.color_gridmajor)); - GlobalPreferenceSystem().registerPreference("SI_Colors6", Vector3ImportStringCaller(g_xywindow_globals.color_gridblock), Vector3ExportStringCaller(g_xywindow_globals.color_gridblock)); - GlobalPreferenceSystem().registerPreference("SI_Colors7", Vector3ImportStringCaller(g_xywindow_globals.color_gridtext), Vector3ExportStringCaller(g_xywindow_globals.color_gridtext)); - GlobalPreferenceSystem().registerPreference("SI_Colors8", Vector3ImportStringCaller(g_xywindow_globals.color_brushes), Vector3ExportStringCaller(g_xywindow_globals.color_brushes)); - GlobalPreferenceSystem().registerPreference("SI_Colors9", Vector3ImportStringCaller(g_xywindow_globals.color_selbrushes), Vector3ExportStringCaller(g_xywindow_globals.color_selbrushes)); - GlobalPreferenceSystem().registerPreference("SI_Colors10", Vector3ImportStringCaller(g_xywindow_globals.color_clipper), Vector3ExportStringCaller(g_xywindow_globals.color_clipper)); - GlobalPreferenceSystem().registerPreference("SI_Colors11", Vector3ImportStringCaller(g_xywindow_globals.color_viewname), Vector3ExportStringCaller(g_xywindow_globals.color_viewname)); - GlobalPreferenceSystem().registerPreference("SI_Colors13", Vector3ImportStringCaller(g_xywindow_globals.color_gridminor_alt), Vector3ExportStringCaller(g_xywindow_globals.color_gridminor_alt)); - GlobalPreferenceSystem().registerPreference("SI_Colors14", Vector3ImportStringCaller(g_xywindow_globals.color_gridmajor_alt), Vector3ExportStringCaller(g_xywindow_globals.color_gridmajor_alt)); - - - GlobalPreferenceSystem().registerPreference("XZVIS", makeBoolStringImportCallback(ToggleShownImportBoolCaller(g_xz_front_shown)), makeBoolStringExportCallback(ToggleShownExportBoolCaller(g_xz_front_shown))); - GlobalPreferenceSystem().registerPreference("YZVIS", makeBoolStringImportCallback(ToggleShownImportBoolCaller(g_yz_side_shown)), makeBoolStringExportCallback(ToggleShownExportBoolCaller(g_yz_side_shown))); - - Orthographic_registerPreferencesPage(); - Clipper_registerPreferencesPage(); - - XYWnd::captureStates(); - GlobalEntityClassManager().attach(g_EntityClassMenu); -} - -void XYWindow_Destroy() -{ - GlobalEntityClassManager().detach(g_EntityClassMenu); - XYWnd::releaseStates(); -} diff --git a/radiant/xywindow.h b/radiant/xywindow.h index bf87ad3f..23aec2c4 100644 --- a/radiant/xywindow.h +++ b/radiant/xywindow.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,284 +19,176 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_XYWINDOW_H) -#define INCLUDED_XYWINDOW_H +#ifndef _XYWINDOW_H_ +#define _XYWINDOW_H_ -#include "math/matrix.h" -#include "signal/signal.h" +#include "qe3.h" +#include "camwindow.h" +#include "glwindow.h" -#include "gtkutil/cursor.h" -#include "gtkutil/window.h" -#include "gtkutil/xorrectangle.h" -#include "view.h" -#include "map.h" +const int SCALE_X = 0x01; +const int SCALE_Y = 0x02; +const int SCALE_Z = 0x04; -#include "qerplugin.h" - -class Shader; -class SelectionSystemWindowObserver; -namespace scene +typedef void (PFNPathCallback)(bool, int); +// as i didn't really encapsulate anything this +// should really be a struct.. +class ClipPoint +{ +public: + ClipPoint(){ Reset(); }; + void Reset(){ m_ptClip[0] = m_ptClip[1] = m_ptClip[2] = 0.0; m_bSet = false; m_pVec3 = NULL;}; + bool Set(){ return m_bSet; }; + void Set(bool b) { m_bSet = b; }; + void UpdatePointPtr() { if (m_pVec3) VectorCopy(m_ptClip, *m_pVec3); }; + void SetPointPtr(vec3_t* p) { m_pVec3 = p; }; + vec3_t m_ptClip; // the 3d point + vec3_t* m_pVec3; // optional ptr for 3rd party updates + int m_ptScreenX, m_ptScreenY; // the onscreen xy point (for mousability) + bool m_bSet; + operator vec3_t&() {return m_ptClip;}; + operator vec3_t*() {return &m_ptClip;}; + + /*! Draw clip/path point with rasterized number label */ + void Draw(float fScale, int num); + /*! Draw clip/path point with rasterized string label */ + void Draw(float fScale, const char *label); +}; + +class XYWnd : public GLWindow { - class Node; -} -typedef struct _GtkWindow GtkWindow; -typedef struct _GtkMenu GtkMenu; - - -void FlipClip(); -void SplitClip(); -void Clip(); -void OnClipMode(bool enabled); -bool ClipMode(); - -inline const char* ViewType_getTitle(VIEWTYPE viewtype) -{ - if(viewtype == XY) - { - return "XY Top"; - } - if(viewtype == XZ) - { - return "XZ Front"; - } - if(viewtype == YZ) - { - return "YZ Side"; - } - return ""; -} - -class XYWnd -{ - GtkWidget* m_gl_widget; - guint m_sizeHandler; - guint m_exposeHandler; - - DeferredDraw m_deferredDraw; - DeferredMotion m_deferred_motion; public: - GtkWindow* m_parent; XYWnd(); - ~XYWnd(); - - void queueDraw() - { - m_deferredDraw.draw(); - } - GtkWidget* GetWidget() - { - return m_gl_widget; - } + virtual ~XYWnd() { } public: - SelectionSystemWindowObserver* m_window_observer; - XORRectangle m_XORRectangle; - WindowPositionTracker m_positionTracker; - - static void captureStates(); - static void releaseStates(); - - void PositionView(const Vector3& position); - const Vector3& GetOrigin(); - void SetOrigin(const Vector3& origin); - void Scroll(int x, int y); - + bool AreaSelectOK(); + vec3_t& RotateOrigin(); + vec3_t& Rotation(); + void UndoClear(); + bool UndoAvailable(); + void KillPathMode(); + void Undo(); + void UndoCopy(); + void Copy(); + void Paste(); + void Redraw(unsigned int nBits); + void VectorCopyXY(vec3_t in, vec3_t out); + void PositionView(); + void FlipClip(); + void SplitClip(); + void Clip(); + vec3_t& GetOrigin(); + void SetOrigin(vec3_t org); // PGM + void XY_Init(); + void XY_Overlay(); void XY_Draw(); - void DrawCameraIcon(const Vector3& origin, const Vector3& angles); + void DrawZIcon(); + void DrawRotateIcon(); + void DrawCameraIcon(); void XY_DrawBlockGrid(); void XY_DrawGrid(); + void XY_MouseMoved (int x, int y, int buttons); +// TTimo: FIXME: was experimental stuff to track possible endless loop issues +// void XY_MouseMovedRec (int x, int y, int buttons); + void NewBrushDrag (int x, int y); + qboolean DragDelta (int x, int y, vec3_t move); + void XY_MouseUp(int x, int y, int buttons); + void XY_MouseDown (int x, int y, int buttons); + void XY_ToGridPoint (int x, int y, vec3_t point); + void XY_ToPoint (int x, int y, vec3_t point); + void SnapToPoint (int x, int y, vec3_t point); + void SetActive(bool b) {m_bActive = b;}; + bool Active() {return m_bActive;}; - void XY_MouseUp(int x, int y, unsigned int buttons); - void XY_MouseDown(int x, int y, unsigned int buttons); - void XY_MouseMoved(int x, int y, unsigned int buttons); + void DropClipPoint(guint32 nFlags, int pointx, int pointy); + bool RogueClipMode(); + bool ClipMode(); + void SetClipMode(bool bMode); + void RetainClipMode(bool bMode); - void NewBrushDrag_Begin(int x, int y); - void NewBrushDrag(int x, int y); - void NewBrushDrag_End(int x, int y); + bool RotateMode(); + bool SetRotateMode(bool bMode); + bool ScaleMode(); + void SetScaleMode(bool bMode); - void XY_ToPoint(int x, int y, Vector3& point); - void XY_SnapToGrid(Vector3& point); + bool PathMode(); + void DropPathPoint(guint32 nFlags, int pointx, int pointy); + bool PointMode(); +// void AddPointPoint(guint32 nFlags, vec3_t* pVec); + void SetPointMode(bool b); - void Move_Begin(); - void Move_End(); - bool m_move_started; - guint m_move_focusOut; - - void Zoom_Begin(); - void Zoom_End(); - bool m_zoom_started; - guint m_zoom_focusOut; - - void SetActive(bool b) - { - m_bActive = b; - }; - bool Active() - { - return m_bActive; - }; - - void Clipper_OnLButtonDown(int x, int y); - void Clipper_OnLButtonUp(int x, int y); - void Clipper_OnMouseMoved(int x, int y); - void Clipper_Crosshair_OnMouseMoved(int x, int y); - void DropClipPoint(int pointx, int pointy); - - void SetViewType(VIEWTYPE n); + void SetViewType(int n); bool m_bActive; - static GtkMenu* m_mnuDrop; - - int m_chasemouse_current_x, m_chasemouse_current_y; - int m_chasemouse_delta_x, m_chasemouse_delta_y; - - - guint m_chasemouse_handler; - void ChaseMouse(); - bool chaseMouseMotion(int pointx, int pointy); - - void updateModelview(); - void updateProjection(); - Matrix4 m_projection; - Matrix4 m_modelview; - +protected: + int m_nUpdateBits; int m_nWidth; int m_nHeight; -private: + bool m_bTiming; float m_fScale; - Vector3 m_vOrigin; - - - View m_view; - static Shader* m_state_selected; + float m_TopClip; + float m_BottomClip; + bool m_bDirty; + vec3_t m_vOrigin; int m_ptCursorX, m_ptCursorY; + bool m_bRButtonDown; - unsigned int m_buttonstate; + int m_nButtonstate; + int m_nPressx; + int m_nPressy; + vec3_t m_vPressdelta; + bool m_bPress_selection; - int m_nNewBrushPressx; - int m_nNewBrushPressy; - scene::Node* m_NewBrushDrag; - bool m_bNewBrushDrag; + friend class CamWnd; - Vector3 m_mousePosition; +private: + // this is unique for all views + static GtkWidget* m_mnuDrop; - VIEWTYPE m_viewType; + int m_nViewType; + + int m_nScrollFlags; + int m_ptDragX, m_ptDragY; + int m_ptDragAdjX, m_ptDragAdjY; + int m_ptDragTotalX, m_ptDragTotalY; void OriginalButtonUp(guint32 nFlags, int point, int pointy); void OriginalButtonDown(guint32 nFlags, int point, int pointy); +// void ProduceSplits(brush_t** pFront, brush_t** pBack); + void PlanePointsFromClipPoints(vec3_t planepts[3], brush_t *pBrush); + void ProduceSplitLists(); + void HandleDrop(); + void PaintSizeInfo(int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds); - void OnContextMenu(); - void PaintSizeInfo(int nDim1, int nDim2, Vector3& vMinBounds, Vector3& vMaxBounds); - - int m_entityCreate_x, m_entityCreate_y; - bool m_entityCreate; + int m_ptDownX, m_ptDownY; public: - void ButtonState_onMouseDown(unsigned int buttons) - { - m_buttonstate |= buttons; - } - void ButtonState_onMouseUp(unsigned int buttons) - { - m_buttonstate &= ~buttons; - } - unsigned int getButtonState() const - { - return m_buttonstate; - } - void EntityCreate_MouseDown(int x, int y); - void EntityCreate_MouseMove(int x, int y); - void EntityCreate_MouseUp(int x, int y); - void OnEntityCreate(const char* item); - VIEWTYPE GetViewType() - { - return m_viewType; - } - void SetScale(float f); - float Scale() - { - return m_fScale; - } - int Width() - { - return m_nWidth; - } - int Height() - { - return m_nHeight; - } + int GetViewType() {return m_nViewType; } + void SetScale(float f) {m_fScale = f;} + float Scale() {return m_fScale;} + int Width() {return m_nWidth;} + int Height() {return m_nHeight;} - Signal0 onDestroyed; - Signal3 onMouseDown; - void mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers); - typedef Member3 MouseDownCaller; +protected: + + void OnCreate (); + void OnExpose (); + void OnLButtonDown(guint32 flags, int pointx, int pointy); + void OnRButtonDown(guint32 flags, int pointx, int pointy); + void OnMButtonDown(guint32 flags, int pointx, int pointy); + void OnLButtonUp(guint32 flags, int pointx, int pointy); + void OnRButtonUp(guint32 flags, int pointx, int pointy); + void OnMButtonUp(guint32 flags, int pointx, int pointy); + void OnMouseMove(guint32 nFlags, int pointx, int pointy); + void OnMouseWheel(bool bUp); + void OnSize (int cx, int cy); + void OnTimer(); + +private: + XORRectangle m_XORRectangle; }; -inline void XYWnd_Update(XYWnd& xywnd) -{ - xywnd.queueDraw(); -} - - -struct xywindow_globals_t -{ - Vector3 color_gridback; - Vector3 color_gridminor; - Vector3 color_gridmajor; - Vector3 color_gridblock; - Vector3 color_gridtext; - Vector3 color_brushes; - Vector3 color_selbrushes; - Vector3 color_clipper; - Vector3 color_viewname; - Vector3 color_gridminor_alt; - Vector3 color_gridmajor_alt; - Vector3 AxisColorX; - Vector3 AxisColorY; - Vector3 AxisColorZ; - - bool m_bRightClick; - bool m_bNoStipple; - - xywindow_globals_t() : - color_gridback(1.f, 1.f, 1.f), - color_gridminor(0.75f, 0.75f, 0.75f), - color_gridmajor(0.5f, 0.5f, 0.5f), - color_gridblock(0.f, 0.f, 1.f), - color_gridtext(0.f, 0.f, 0.f), - color_brushes(0.f, 0.f, 0.f), - color_selbrushes(1.f, 0.f, 0.f), - color_clipper(0.f, 0.f, 1.f), - color_viewname(0.5f, 0.f, 0.75f), - color_gridminor_alt(0.f, 0.f, 0.f), - color_gridmajor_alt(0.f, 0.f, 0.f), - - AxisColorX(1.f, 0.f, 0.f), - AxisColorY(0.f, 1.f, 0.f), - AxisColorZ(0.f, 0.f, 1.f), - m_bRightClick(true), - m_bNoStipple(false) - { - } - -}; - -extern xywindow_globals_t g_xywindow_globals; - - -VIEWTYPE GlobalXYWnd_getCurrentViewType(); - -typedef struct _GtkWindow GtkWindow; -void XY_Top_Shown_Construct(GtkWindow* parent); -void YZ_Side_Shown_Construct(GtkWindow* parent); -void XZ_Front_Shown_Construct(GtkWindow* parent); - -void XYWindow_Construct(); -void XYWindow_Destroy(); - -void XYShow_registerCommands(); -void XYWnd_registerShortcuts(); - -#endif +#endif // _XYWINDOW_H_ diff --git a/radiant/z.cpp b/radiant/z.cpp new file mode 100644 index 00000000..dff40708 --- /dev/null +++ b/radiant/z.cpp @@ -0,0 +1,466 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "stdafx.h" +//#include "qe3.h" + +#define PAGEFLIPS 2 + +z_t z; + +/* +============ +Z_Init +============ +*/ +void Z_Init (void) +{ + z.origin[0] = 0; + z.origin[1] = 20; + z.origin[2] = 46; + + z.scale = 1; +} + + + +/* +============================================================================ + + MOUSE ACTIONS + +============================================================================ +*/ + +static int cursorx, cursory; + +/* +============== +Z_MouseDown +============== +*/ +void Z_MouseDown (int x, int y, int buttons) +{ + vec3_t org, dir, vup, vright; + brush_t *b; + + Sys_GetCursorPos (&cursorx, &cursory); + + vup[0] = 0; vup[1] = 0; vup[2] = 1/z.scale; + + VectorCopy (z.origin, org); + org[2] += (y - (z.height/2))/z.scale; + org[1] = g_MinWorldCoord; + + b = selected_brushes.next; + if (b != &selected_brushes) + { + org[0] = (b->mins[0] + b->maxs[0])/2; + } + + dir[0] = 0; dir[1] = 1; dir[2] = 0; + + vright[0] = 0; vright[1] = 0; vright[2] = 0; + + // LBUTTON = manipulate selection + // shift-LBUTTON = select + // middle button = grab texture + // ctrl-middle button = set entire brush to texture + // ctrl-shift-middle button = set single face to texture + + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + if ( (buttons == MK_LBUTTON) + || (buttons == (MK_LBUTTON | MK_SHIFT)) + || (buttons == MK_MBUTTON) +// || (buttons == (MK_MBUTTON|MK_CONTROL)) + || (buttons == (nMouseButton|MK_SHIFT|MK_CONTROL)) ) + { + Drag_Begin (x, y, buttons, + vright, vup, + org, dir); + return; + } + + // control mbutton = move camera + if ((buttons == (MK_CONTROL|nMouseButton) ) || (buttons == (MK_CONTROL|MK_LBUTTON))) + { + g_pParentWnd->GetCamWnd()->Camera()->origin[2] = org[2] ; + Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY|W_Z); + } + + +} + +/* +============== +Z_MouseUp +============== +*/ +void Z_MouseUp (int x, int y, int buttons) +{ + Drag_MouseUp (); +} + +/* +============== +Z_MouseMoved +============== +*/ +void Z_MouseMoved (int x, int y, int buttons) +{ + if (!buttons) + return; + if (buttons == MK_LBUTTON) + { + Drag_MouseMoved (x, y, buttons); + Sys_UpdateWindows (W_Z|W_CAMERA_IFON|W_XY); + return; + } + // rbutton = drag z origin + if (buttons == MK_RBUTTON) + { + Sys_GetCursorPos (&x, &y); + if ( y != cursory) + { + z.origin[2] += y-cursory; + Sys_SetCursorPos (cursorx, cursory); + Sys_UpdateWindows (W_Z); + } + return; + } + // control mbutton = move camera + int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON; + if ((buttons == (MK_CONTROL|nMouseButton) ) || (buttons == (MK_CONTROL|MK_LBUTTON))) + { + g_pParentWnd->GetCamWnd()->Camera()->origin[2] = (y - (z.height/2))/z.scale; + Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY|W_Z); + } + +} + + +/* +============================================================================ + +DRAWING + +============================================================================ +*/ + + +/* +============== +Z_DrawGrid +============== +*/ +void Z_DrawGrid (void) +{ + float zz, zb, ze; + float w, h; + char text[32]; + + w = (z.width/2 / z.scale); + h = (z.height/2 / z.scale); + + zb = z.origin[2] - h; + if (zb < region_mins[2]) + zb = region_mins[2]; + zb = 64 * floor (zb/64); + + ze = z.origin[2] + h; + if (ze > region_maxs[2]) + ze = region_maxs[2]; + ze = 64 * ceil (ze/64); + + // draw major blocks + + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR]); + + if ( g_qeglobals.d_showgrid ) + { + if (g_qeglobals.d_gridsize < 128) + { + qglBegin (GL_LINES); + + qglVertex2f (0, zb); + qglVertex2f (0, ze); + + for (zz=zb ; zz= 128 .. it's an int for sure + if ( ((int)zz & ((int)g_qeglobals.d_gridsize-1)) != 0 ) + continue; + + qglVertex2f (-w, zz); + qglVertex2f (w, zz); + } + + qglEnd (); + } + } + + // draw minor blocks + if (g_qeglobals.d_showgrid && g_qeglobals.d_gridsize*z.scale >= 4 && + g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR] != g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK]) + { + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR]); + + qglBegin (GL_LINES); + for (zz=zb ; zz 64 ? g_qeglobals.d_gridsize : 64); + zb = z.origin[2] - h; + if (zb < region_mins[2]) + zb = region_mins[2]; + zb = step * floor (zb/step); + + for (zz=zb ; zzGetCamWnd()->Camera()->origin[2]; + + qglColor3f (0.0, 0.0, 1.0); + qglBegin(GL_LINE_STRIP); + qglVertex3f (x-xCam,y,0); + qglVertex3f (x,y+gizmo,0); + qglVertex3f (x+xCam,y,0); + qglVertex3f (x,y-gizmo,0); + qglVertex3f (x-xCam,y,0); + qglVertex3f (x+xCam,y,0); + qglVertex3f (x+xCam,y-height,0); + qglVertex3f (x-xCam,y-height,0); + qglVertex3f (x-xCam,y,0); + qglEnd (); + +} + +GLbitfield glbitClear = GL_COLOR_BUFFER_BIT; //HACK + +/* +============== +Z_Draw +============== +*/ +void Z_Draw (void) +{ +#ifdef DBG_WINDOWPOS + CheckWatchit ("Z_Draw"); +#endif + brush_t *brush; + float w, h; + double start, end; + qtexture_t *q; + float top, bottom; + vec3_t org_top, org_bottom, dir_up, dir_down; + int xCam = z.width/3; + + if (!active_brushes.next) + return; // not valid yet + + if (z.timing) + start = Sys_DoubleTime (); + + // + // clear + // + qglViewport(0, 0, z.width, z.height); + + qglClearColor ( + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][0], + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][1], + g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][2], + 0); + + /* GL Bug */ + /* When not using hw acceleration, gl will fault if we clear the depth + buffer bit on the first pass. The hack fix is to set the GL_DEPTH_BUFFER_BIT + only after Z_Draw() has been called once. Yeah, right. */ + qglClear(glbitClear); + glbitClear |= GL_DEPTH_BUFFER_BIT; + qglMatrixMode(GL_PROJECTION); + + qglLoadIdentity (); + w = z.width/2 / z.scale; + h = z.height/2 / z.scale; + qglOrtho (-w, w, z.origin[2]-h, z.origin[2]+h, -8, 8); + + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_TEXTURE_1D); + qglDisable(GL_DEPTH_TEST); + qglDisable(GL_BLEND); + + + // + // now draw the grid + // + Z_DrawGrid (); + + // + // draw stuff + // + + qglDisable(GL_CULL_FACE); + + qglShadeModel (GL_FLAT); + + qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + + qglDisable(GL_TEXTURE_2D); + qglDisable(GL_BLEND); + qglDisable(GL_DEPTH_TEST); + + + // draw filled interiors and edges + dir_up[0] = 0 ; dir_up[1] = 0; dir_up[2] = 1; + dir_down[0] = 0 ; dir_down[1] = 0; dir_down[2] = -1; + VectorCopy (z.origin, org_top); + org_top[2] = g_MaxWorldCoord; + VectorCopy (z.origin, org_bottom); + org_bottom[2] = g_MinWorldCoord; + + for (brush = active_brushes.next ; brush != &active_brushes ; brush=brush->next) + { + if (brush->bFiltered) + continue; + + if (brush->mins[0] >= z.origin[0] + || brush->maxs[0] <= z.origin[0] + || brush->mins[1] >= z.origin[1] + || brush->maxs[1] <= z.origin[1]) + continue; + + if (!Brush_Ray (org_top, dir_down, brush, &top)) + continue; + top = org_top[2] - top; + if (!Brush_Ray (org_bottom, dir_up, brush, &bottom)) + continue; + bottom = org_bottom[2] + bottom; + + q = brush->brush_faces->pShader->getTexture(); + qglColor3f (q->color[0], q->color[1], q->color[2]); + qglBegin (GL_QUADS); + qglVertex2f (-xCam, bottom); + qglVertex2f (xCam, bottom); + qglVertex2f (xCam, top); + qglVertex2f (-xCam, top); + qglEnd (); + + qglColor3f (1,1,1); + qglBegin (GL_LINE_LOOP); + qglVertex2f (-xCam, bottom); + qglVertex2f (xCam, bottom); + qglVertex2f (xCam, top); + qglVertex2f (-xCam, top); + qglEnd (); + } + + // + // now draw selected brushes + // + for (brush = selected_brushes.next ; brush != &selected_brushes ; brush=brush->next) + { + if ( !(brush->mins[0] >= z.origin[0] + || brush->maxs[0] <= z.origin[0] + || brush->mins[1] >= z.origin[1] + || brush->maxs[1] <= z.origin[1]) ) + { + if (Brush_Ray (org_top, dir_down, brush, &top)) + { + top = org_top[2] - top; + if (Brush_Ray (org_bottom, dir_up, brush, &bottom)) + { + bottom = org_bottom[2] + bottom; + + q = brush->brush_faces->pShader->getTexture(); + qglColor3f (q->color[0], q->color[1], q->color[2]); + qglBegin (GL_QUADS); + qglVertex2f (-xCam, bottom); + qglVertex2f (xCam, bottom); + qglVertex2f (xCam, top); + qglVertex2f (-xCam, top); + qglEnd (); + } + } + } + + qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES]); + qglBegin (GL_LINE_LOOP); + qglVertex2f (-xCam, brush->mins[2]); + qglVertex2f (xCam, brush->mins[2]); + qglVertex2f (xCam, brush->maxs[2]); + qglVertex2f (-xCam, brush->maxs[2]); + qglEnd (); + } + + + ZDrawCameraIcon (); + + qglFinish(); + QE_CheckOpenGLForErrors(); + + if (z.timing) + { + end = Sys_DoubleTime (); + Sys_Printf ("z: %i ms\n", (int)(1000*(end-start))); + } +} + diff --git a/radiant/z.h b/radiant/z.h new file mode 100644 index 00000000..aee8bae2 --- /dev/null +++ b/radiant/z.h @@ -0,0 +1,42 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +// window system independent camera view code + +typedef struct +{ + int width, height; + + qboolean timing; + + vec3_t origin; // at center of window + float scale; +} z_t; + +extern z_t z; + +void Z_Init (void); +void Z_MouseDown (int x, int y, int buttons); +void Z_MouseUp (int x, int y, int buttons); +void Z_MouseMoved (int x, int y, int buttons); +void Z_Draw (void); + diff --git a/radiant/zwindow.cpp b/radiant/zwindow.cpp new file mode 100644 index 00000000..ee7fa898 --- /dev/null +++ b/radiant/zwindow.cpp @@ -0,0 +1,125 @@ +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. +For a list of contributors, see the accompanying CONTRIBUTORS file. + +This file is part of GtkRadiant. + +GtkRadiant is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GtkRadiant is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GtkRadiant; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// +// Z Window +// +// Leonardo Zide (leo@lokigames.com) +// + +#include "stdafx.h" +#include "zwindow.h" + +// ============================================================================= +// ZWnd class + +ZWnd::ZWnd () + : GLWindow (FALSE) +{ +} + +ZWnd::~ZWnd() +{ +} + +void ZWnd::OnCreate () +{ + g_qeglobals_gui.d_z = m_pWidget; + + if (!MakeCurrent()) + Error ("wglMakeCurrent in CZWnd::OnCreate failed"); +} + +void ZWnd::OnLButtonDown(guint32 nFlags, int pointx, int pointy) +{ + SetFocus(); + SetCapture(); + Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags); +} + +void ZWnd::OnMButtonDown(guint32 nFlags, int pointx, int pointy) +{ + SetFocus(); + SetCapture(); + Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags); +} + +void ZWnd::OnRButtonDown(guint32 nFlags, int pointx, int pointy) +{ + SetFocus(); + SetCapture(); + Z_MouseDown (pointx, m_pWidget->allocation.height - 1 - pointy , nFlags); +} + +void ZWnd::OnLButtonUp(guint32 nFlags, int pointx, int pointy) +{ + Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags); + ReleaseCapture (); +} + +void ZWnd::OnMButtonUp(guint32 nFlags, int pointx, int pointy) +{ + Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags); + ReleaseCapture (); +} + +void ZWnd::OnRButtonUp(guint32 nFlags, int pointx, int pointy) +{ + Z_MouseUp (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags); + ReleaseCapture (); +} + +void ZWnd::OnMouseMove(guint32 nFlags, int pointx, int pointy) +{ + float fz = z.origin[2] + ((m_pWidget->allocation.height - 1 - pointy) - (z.height/2)) / z.scale; + fz = floor(fz / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize; + CString strStatus; + strStatus.Format("Z:: %.1f", fz); + g_pParentWnd->SetStatusText(1, strStatus); + Z_MouseMoved (pointx, m_pWidget->allocation.height - 1 - pointy, nFlags); +} + +void ZWnd::OnExpose() +{ + if (!MakeCurrent ()) + { + Sys_Printf("ERROR: wglMakeCurrent failed..\n "); + Sys_Printf("Please restart Radiant if the Z view is not working\n"); + } + else + { + QE_CheckOpenGLForErrors(); + Z_Draw (); + QE_CheckOpenGLForErrors(); + SwapBuffers(); + } +} + +void ZWnd::OnSize(int cx, int cy) +{ + z.width = cx; + z.height = cy; + if (z.width < 10) + z.width = 10; + if (z.height < 10) + z.height = 10; + RedrawWindow (); +} diff --git a/radiant/entity.h b/radiant/zwindow.h similarity index 53% rename from radiant/entity.h rename to radiant/zwindow.h index 3e962178..90f3954b 100644 --- a/radiant/entity.h +++ b/radiant/zwindow.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,24 +19,28 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(INCLUDED_ENTITY_H) -#define INCLUDED_ENTITY_H +#ifndef _ZWINDOW_H_ +#define _ZWINDOW_H_ -template class BasicVector3; -typedef BasicVector3 Vector3; -void Entity_createFromSelection(const char* name, const Vector3& origin); +#include "glwindow.h" -void Scene_EntitySetKeyValue_Selected(const char* key, const char* value); -void Scene_EntitySetClassname_Selected(const char* classname); +class ZWnd : public GLWindow +{ + public: + ZWnd (); + virtual ~ZWnd (); + + void OnCreate (); + void OnExpose (); + void OnLButtonDown (guint32 flags, int x, int y); + void OnRButtonDown (guint32 flags, int x, int y); + void OnMButtonDown (guint32 flags, int x, int y); + void OnLButtonUp (guint32 flags, int pointx, int pointy); + void OnRButtonUp (guint32 flags, int pointx, int pointy); + void OnMButtonUp (guint32 flags, int pointx, int pointy); + void OnMouseMove (guint32 flags, int pointx, int pointy); + void OnSize (int cx, int cy); +}; -typedef struct _GtkWidget GtkWidget; -const char* misc_model_dialog(GtkWidget* parent); - -typedef struct _GtkMenu GtkMenu; -void Entity_constructMenu(GtkMenu* menu); - -void Entity_Construct(); -void Entity_Destroy(); - -#endif +#endif // _ZWINDOW_H_ diff --git a/run_python.bat b/run_python.bat index be3466d2..ac0aebbc 100644 --- a/run_python.bat +++ b/run_python.bat @@ -1,9 +1,9 @@ -python.exe -V -if errorlevel=1 echo please install python and add python.exe to the path (http://www.python.org) -if errorlevel=1 goto end - -echo python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 -rem FIXME: for some wacked reason, output of the python script doesn't get back to VC window .. -python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 - +python.exe -V +if errorlevel=1 echo please install python and add python.exe to the path (http://www.python.org) +if errorlevel=1 goto end + +echo python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 +rem FIXME: for some wacked reason, output of the python script doesn't get back to VC window .. +python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 + :end \ No newline at end of file diff --git a/setup/PluginSDK/BuildGtkSrc b/setup/PluginSDK/BuildGtkSrc deleted file mode 100644 index 5756b64e..00000000 --- a/setup/PluginSDK/BuildGtkSrc +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# temporary.. - -# grab the gtk devel package -# FIXME: for win32 SDK only -echo "Updating src/" -echo "NOTE: check we are using the latest gtk dev packages" -echo "NOTE: we are not putting our patched versions in" -rm -rf src -unzip /cygdrive/c/Download/Gtk-20001023/glib-dev-20001023.zip -unzip /cygdrive/c/Download/Gtk-20001023/gtk+-dev-20000722.zip -unzip /cygdrive/c/Download/Gtk-20001023/libiconv-dev-20001007.zip -unzip /cygdrive/c/Download/Gtk-20001023/extralibs-dev-20001007.zip diff --git a/setup/PluginSDK/BuildSDK b/setup/PluginSDK/BuildSDK deleted file mode 100644 index 882a5cd5..00000000 --- a/setup/PluginSDK/BuildSDK +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# what I use to run this script on my win32 box: -# have cygwin, perl (ActiveState) and the cygwin zip utility -# for zip: http://www.hirmke.de/software/develop/gnuwin32/cygwin/porters/Hirmke_Michael/GNUWin32-links.html#zip-2.3%20(cygwin1.1) - -# FIXME: I'd like to have this same script used for both platforms -# for the SDK we recreate a smaller tree and only put the stuff we want -# what potentially changes across platforms is the binaries and the src/ subtree for gtk stuff - -# proceed in order: - -# include directory for all plugin API -mkdir GtkRadiant -mkdir GtkRadiant/include -rm -rf ./GtkRadiant/include/* -echo "Copying GtkRadiant API headers" -cp ../../include/* ./GtkRadiant/include - -# now fill in the plugins menu: -# copy common, textool and the sample plugin -mkdir GtkRadiant -mkdir GtkRadiant/plugins -mkdir GtkRadiant/plugins/common -mkdir GtkRadiant/plugins/textool -mkdir GtkRadiant/plugins/sample -rm -rf ./GtkRadiant/plugins/* -echo "Copying TexTool" -cp -R ../../plugins/textool ./GtkRadiant/plugins/textool -cp -R ../../plugins/common ./GtkRadiant/plugins/common -echo "Copying Sample plugin" -cp -R ../../plugins/sample ./GtkRadiant/plugins/sample - -# get gtkradiant binary (you know you want it) -# FIXME: for win32 SDK only -#cp ../radiant/Release/Q3Radiant.exe GtkRadiant.exe - -# grab the gtk devel package -# FIXME: for win32 SDK only -echo "Updating src/" -echo "NOTE: check we are using the latest gtk dev packages" -echo "NOTE: we are not putting our patched versions in" -rm -rf src -unzip /cygdrive/c/Download/Gtk-20001023/glib-dev-20001023.zip -unzip /cygdrive/c/Download/Gtk-20001023/gtk+-dev-20000722.zip -unzip /cygdrive/c/Download/Gtk-20001023/libiconv-dev-20001007.zip -unzip /cygdrive/c/Download/Gtk-20001023/extralibs-dev-20001007.zip -# grab the src/build directory, we use it with the cygwin makefiles -cp -R ../../../src/build src - -# build the SDK -#echo "Check the sample/ directory is clean" -#zip -r PluginSDK.zip src private sample README.html GtkRadiant.exe \ No newline at end of file diff --git a/setup/PluginSDK/BuildZip b/setup/PluginSDK/BuildZip deleted file mode 100644 index d6731d4e..00000000 --- a/setup/PluginSDK/BuildZip +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# temporary.. - -# build the SDK zip -rm PluginSDK.zip -zip -r PluginSDK.zip src GtkRadiant README.html \ No newline at end of file diff --git a/setup/PluginSDK/README.html b/setup/PluginSDK/README.html deleted file mode 100644 index 76bb69a5..00000000 --- a/setup/PluginSDK/README.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Q3Radiant plugin SDK - - - - -
GtkRadiant plugin SDK
-
http://www.gtkradiant.com
- -


-

Version: GtkRadiant -1.1-TA-beta -
Last updated: 01/14/2001
- -


-


What do I have? - -
GtkRadiant/include/: Radiant plugin API -headers - -
GtkRadiant/plugins/sample/: an empty plugin nutshell, -handy to start a new one (NOTE: a cygwin makefile for Sample is also -provided) - -
GtkRadiant/plugins/textool/: TexTool plugin -source code - -
src/: Gtk headers and libraries for win32 - -

A Word about Gtk: - -
GtkRadiant is using the Gtk toolkit for all the user interface. There's a specific -page for the Gtk on -win32. If you are going to write a plugin for GtkRadiant, we recommend you -use Gtk, but it's not a required feature. You can write plugins using the native -windows API or even VB. Don't hesitate to ask for help on the plugin mailing list or to drop by on irc.telefragged.com -#qeradiant

- -

Plugin basics: -
main features available to plugins: -

    -
  • -Manipulate MAP data: read and write brushes, patches, epairs and entities
  • - -
  • -Override the BSP menu to process your own building commands
  • - -
  • -Read / Write project settings epairs
  • - -
  • -Use OpenGL to draw in the 2D/3D view, or in your own plugin -windows
  • - -
  • -Use listeners to catch events in Radiant (like a change of -texture or brush select / deselect)
  • - -
  • -Use listeners to listen for window events (for mouse interaction -in the 2D view)
  • - -
  • -Create new plugin entities that show up in the Radiant window, -which you can draw yourself and handle the user interaction
  • - -
  • -Use the Radiant internal parser to hook your own MAP format -changes for plugin entities
  • - -
  • -Access polygon and texture information on the current selected -face
  • - -
  • -Override the texture / shader code to provide your own texture -formats and shader system
  • - -
  • -Add new surface properties, and change the MAP format accordingly
  • -
-overall structure of a plugin: -
A plugin is a DLL (dynamic loading library) that exposes -some API to Radiant. Plugins must be put in the plugins/ directory, they -get loaded at startup by Radiant. Any plugin has a few required entry points -in order to get loaded correctly: -
    -
  • -QERPlug_Init is the first entry point called, used -for initialization and sending back the plugin name that appears in the -console
  • - -
  • -QERPlug_GetName returns the name of the plugin as -it appears in the plugin menu
  • - -
  • -QERPlug_GetCommandList returns a list describing -the items in the plugin submenu
  • - -
  • -QERPlug_GetFuncTable returns the address of the -_QERFuncTable_1 of the plugin. After Radiant got the pointer to the function -table it will fill it and the plugin is able to call into the editor.
  • - -
  • -QERPlug_Dispatch is called when the user hits a -command in the plugin menu. The plugin is then free to process.
  • -
-the function table and interfaces: -
Instead of exporting entry points, Radiant fills in function -pointer tables. The main and required function table is _QERFuncTable_1. -Each plugin must have it and let Radiant fill it. Some additional or specialized -functionalities can be accessed with other tables like _QERQglTable -for GL stuff. These have to be requested to Radiant using _QERFuncTable_1::m_pfnRequestInterface -(see TexTool for an example). Each additional function table has -a "globally unique identifier" (QERQglTable_GUID for GL stuff) -that's used to identify the interface across plugins. -

NOTE: some function tables are used by Radiant and must -be filled by the plugin (ie. they work in reverse compared to usual ones). -In this case the plugin must export an additional entry point int WINAPI -QERPlug_RequestInterface( REFGUID, LPVOID ); -

virtual classes: -
some stuff is better represented by an abstract C++ class. -For those with COM knowledge, it's just a very lightweight COM way of doing -things. These classes have very basic reference counting through IncRef() -and DecRef() .. you are supposed to increment or decrement the -reference count each time you store or release a pointer to these classes, -otherwise they could get unexpectedly erased and you would be very very -sorry. The IListener class in IMessaging.h can be implemented -by the plugin and handed over to Radiant to listen for events. See TexTool -for examples. -
  - -

More stuff: - -
If you need more information or if you want new features for -plugins, see the source code for TexTool and Curry. -TexTool source comes with the plugin SDK, and Curry source is -available from their web site. You -can browse it -online from the -project page. PrtView has neat code -samples on how to draw in the 2D views or camera window. These two plugins are -under GPL licensing. The dedicated place to talk about plugin coding is the plugins-coding mailing -list ... see you there. You may also get an updated list of the plugins for -Radiant on our dedicated web -site.
- -Update: you can also have a look to the pk3man source.
- -

Conclusion: -
this document is intended as a quickstart for potential -plugin writers. I hope it meets it's objective. It's not a complete and -systematic documentation, I doubt there will be one ever unless someone -decides to do it. Feel free to send me contributions to this document. -Send feedback to me. - - diff --git a/setup/PluginSDK/TODO b/setup/PluginSDK/TODO deleted file mode 100644 index 52f801fe..00000000 --- a/setup/PluginSDK/TODO +++ /dev/null @@ -1,33 +0,0 @@ -Plugin SDK for GtkRadiant -TODO list - -win32: -write script to generate the plugin SDK -sample dll -documentation -headers -gtk libs (devel package + our stuff on top) - -linux: -same thing more or less.. -except we rely on the user for his Gtk installation - -put some docs, links to curry and pk3man for source - -[15:23] you don't need to do: -[15:23] #ifdef __linux__ -[15:23] extern "C" char* QERPlug_Init (void* hApp, GtkWidget* pMainWidget) -[15:23] #else -[15:23] //LPCSTR __declspec(dllexport) QERPlug_Init(HMODULE hApp, GtkWidget* pMainWidget) -[15:23] extern "C" LPCSTR WINAPI QERPlug_Init(HMODULE hApp, GtkWidget* pMainWidget) -[15:23] #endif -[15:23] yes that needs cleaning -[15:23] is it yet? -[15:23] extern "C" char* WINAPI QERPlug_Init works -[15:24] way cool -[15:24] some plugins have it -[15:24] just thought I'd mention as you're writing the SDK - -need to put TexTool source in as well.. - -put a f* updated binary of gktradiant in there diff --git a/setup/changelog.txt b/setup/changelog.txt deleted file mode 100644 index 37598624..00000000 --- a/setup/changelog.txt +++ /dev/null @@ -1,1800 +0,0 @@ -GtkRadiant -(c) 2000-2006 Id Software, Inc. -additions by qeradiant.com and Loki Software, see Credits - -GtkRadiant and all associated map/level design tools are unsupported products. Use at your own risk. - -Bug reports and feedback: -http://www.qeradiant.com/bug.shtml - -When submitting bugs, please send a full system/video configuration list -and a detailed duplication sequence. - -NOTE TO NIGHTLY BUILDS USERS: -When nightly builds are released, we don't update this ChangeLog file -systematically. You should be watching the developer ChangeLog instead, which -is available online: -https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk/CHANGES - -GtkRadiant-1.5.0 Changes ------------------------- - - - Games: - Doom3 and Quake4 support with realtime lighting preview. - Added support for the original Quake. - - File formats: - q1/q2 .pak - q1/hl .wad - doom3/quake4/hl .map - doom3 .md5/.def/.mtr - quake4 .guide - - Undo: - Very fast, even with large changes. - Uses minimum memory, allowing very long undo queues. - All scene modifications now undoable, including: - Texture name/shift/scale/rotate on brushes and patches. - Vertex/edge/face manipulation. - Cloning, deleting, pasting, importing. - Entity key/value setting. - - Selection: - Per-polygon selection for all selectables, including: - Vertices, edges, faces, brushes, patches, models, entities. - Per-polygon area-selection for all selectables. - Edge/Vertex/Face mode automatically resets to Object mode when selection is cleared. - - Editing: - Maya-style tools for translate (w) and rotate (r): - Axis-constrained translate/rotate in 2d and 3d views. - Editing uses lazy evaluation to make movements smoother in complex scenes. - QE-style editing tool (q) provides old style editing. - - Renderer: - Fast view-frustum culling, replacing cubic-clipping. - Batched state-sorted rendering: - Fast rendering of large scenes with many textures - Fast rendering of detailed mesh models. - Realtime lighting preview. - - Scene Graph: - Directed Acyclic Graph backend: - Allows Maya-style "instancing" of sub-scenes (aka prefabs). - Edit one instance, other instances show updates in real time. - Maps can be loaded as misc_model. - - Outliner (aka entity lister): - Shows a tree-view of the current scene: - Non-modal window, updates automatically when scene graph changes. - Allows inspection/manipulation of scene graph. - Brushes can be moved between entities, and entities moved between maps. - Sorted by name. - - Entity Inspector: - Non-modal window, updates automatically when selection changes. - Displays GUI to edit certain keys, based on entity-definition. - Light texture key-entry GUI is auto-completed. - - Surface Inspector: - Non-modal window, updates automatically when selection changes. - Editing shortcuts: escape reverts current values to previous state, enter commits current values immediatly. - Applies shader seperately from shift/scale/rotate. - Shortcuts are active when surface inspector is visible/focussed. - Material name-entry is auto-completed based on currently-in-use materials. - - Brush: - Supports selecting and editing multiple vertices per brush. - CSG subtract algorithm does not suffer from false-positive intersection bug. - Face mode: - Selection/manipulation of multiple faces in 2d and 3d views. - Robust and fast B-Rep generation: - Safe manipulation of large brush selections. - Fast updates for brush operations on large maps. - - Patch: - Fast rendering. - - Filters: - Objects are filtered when their filterable attributes change. - - Map Load/Save: - Fast loading of large maps. - Loading of maps without worldspawns. - Quantised plane coordinates. - - Preferences: - Preferences saving is atomic so that it cannot be corrupted by a crash during save. - All user-editable config files and per-user preferences are created in %appdata%/RadiantSettings/ - Engine path stored in per-game preferences file and editable in preferences dialog. - Changing mod-name and engine path does not require a restart. - - GUI: - Instant window updates (used to be 40fps limited). - Fast startup/shutdown. - Automatic repositioning of separators in 4-way-split mode. - Console prints all undoable commands (and parameters) when executed and undone. - Status bar shows mode information. - New preferences layout, unused settings removed. - Rearranged menus: - File = new/open/import/export - Edit = manipulate scene hierarchy and selection - View = toggle entityinspector/entitylist/surfaceinspector/camera/xy - edit camera/xy parameters - filters/hideshow/region - Modify = transform scene elements - Build = bsp menu - Upgraded win32 gtk2 version from 1.3 to 2.4, providing stability/cosmetic improvements. - - 2d view: - Limited scroll speed when mouse moves outside window. - - Textures module: - Fast texture cache lookups. - Gamma change without restarting. - - Installer: - New xml-scripted windows installer using Windows-Installer tech (.msi). - Linux version released as RPM package. - To avoid deletion on uninstall, shaderlist.txt is generated from default data in the application directory and copied to the game directory. - - Saving - The map is only saved if the scene has been modified since the last full save. - Autosave/Snapshots are only saved if map has been modified since last full save. - Autosave saves as .autosave.map. - - Debug - New assert/error messages as popup windows. - Full stack-trace for assert/error on win32. - - - -GtkRadiant-1.3.14 Changes -------------------------- - - ydnar: - - clipper tool: select a patch mesh, and the clipper tool plane will be set to the patch's mesh (default shortcut X) - EvilTypeGuy: - - texture find and replace menu can be used to select faces by matching texture (not only replacing textures anymore) - so you can apply fit and translate commands to the whole set - if you have brushes selected, it will select only within the selected brushes set - SCDS_ReyalP: - - new plugin: background image in the 2D view. scan your layout, use it as a background to build the structure.. - - some fixes to the Z floating window - - added to ET and RTCW: hullcaulk, hintskip, and subtlehint (see below) - - fixed to CenterXYView shortcut, correctly bound to Shift+Control+Tab now - - added shortcuts to change the texture window scale - TextureWindowScaleup (Alt + Delete) - TextureWindowScaledown (Alt + Insert) - also fixed various oddities with the texture window behaviour - Nurail: - - more updates to quake2 and heretic2 support. BSP monitoring supported now. - ydnar: - - q3map2 2.5.11 - - New: added support for _skybox entities to generate "portal sky" - surfaces in games w/o native support (Quake 3). _skybox entities have - 3 keys: _scale (default 64), and angle/angles (for rotation of the - skybox relative to the map) - - New: added -skyfix switch to BSP phase as a workaround hack for - the black GL_CLAMP border on skybox edges on ATI (and newer nvidia) - video cards. Note: unnecessary in ET or JA - - New: Added _anglescale to light entities for scaling angle attenuation. - Use a small value (< 1.0) to lessen the angle attenuation, and a high - value (> 1.0) for sharper, more faceted lighting - - New: Added _lightmapscale support to misc_model entities - - Custom shaders (external lightmaps, styles) will not be generated - if the find/replace text cannot be found - - Tightened up light culling epsilon from 1.0 to 0.125 to stop certain - surface lights from being incorrectly culled (thanks RasputiN!) - - Fixed bug where small 3 and 4 sided brush faces were getting fanned, - adding triangle/vertex counts - - Moved to Visual Studio .NET, with aggressive optimizations enabled - - Cleaned up missing image warnings - - Parsing images out of shader stages if not found explicit/implicitly - - Loads Enemy Territory implicitMap images if editor/light image not found - Raven: - - new sample maps for JA media - - MP SDK had a bunch of editing tools. Packaged those up with our JA media as well - look under Tools/ in the GtkRadiant game pack install - (default location C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\Radiant-1.3) - -common/hullcaulk -This is exactly the same as caulk, just has a different editor image so people -using the 'caulk hull' method of mapping can see at a glance what is part of the -hull and what is part of the detail brushes. It is up to the mapper follow the -convention. - -common/hintskip -This is exactly the same as skip, with 'hint' in the name so brushes with mixed -hint and skiphint faces will filter with the 'hints' filter. I didn't add a new -image for this, since it is functionally identical to skip. - -common/subtlehint -hint without the surfaceparam hint. A lower priority hint which is sometimes -useful if you don't want the splits from your hint spreading out all the way to -block bounderies. You can mix it freely on a brush with normal hint and skip. - -GtkRadiant-1.3.13 Changes -------------------------- - - AstroCreep - - cleaned up shaders scripts for JA - BirdDawg - - ASE submaterial/subobject code - Anders & TTimo - - OSX setups - Nurail - - Heretic 2 support - - Q2 and Her2 tools now have BSP monitoring, and ability to run engine after - compile - SCDS_reyalP - - fix to jpegs having garbaged alpha channel ( + ydnar fixes ) - - update to ET .def - - fix floating window mode startup crash - Spog - - patch for 16 bit GL, win32 16 bit desktops were either crashing or rendering incorrectly - Arnout - - LWO support in picomodel - - support for 'vertical flipped' TGAs - - fixed multiple monitor support, use the 'start on primary monitor' option in prefs - - fixed mouse on win32 going crazy when radiant non-fullscreen or with hidden taskbar - -q3map2 2.5.10 (2003-10-22) - -- New: Lightwave model support (beta) courtesy of RR2DO2 -- New: Heretic 2 FM model support courtesy of Nurail -- Re-enabled vertex cache friendly triangle reordering with fix -- Disabled triangle reordering on certain surfaces, including autosprite - shaders due to visual errors -- Fixed bug in radiosity where sorting of lights by style took forever. - Thanks ReBoOT! -- Fixed bug in sun lighting code where maps too far off the origin would - not be properly it by sun or sky light. Thanks MindLink! -- Entity causing a leak will be printed and selected in Radiant if BSP - monitoring is enabled. Requested by heeen -- Fixed odd bug causing 10x slowdown in lighting in some maps. Should - be back to 2.5.7 performance. Also fixed a couple old bugs related to - autosprite shader (point) lights and backsplash lights not being styled - or setup correctly - - -GtkRadiant-1.3.12 Changes -------------------------- - - SPoG - - Changed gl widget to request maximum available Z buffer precision (fixes artifacts on some cards) - - fix texture subsets - ydnar - - q3map2 2.5.9 http://shaderlab.com/q3map2/ - - fixed long BSP commands causing a crash - - remove Ctrl+X, you have to exit through the File menu now - Anders Gudmundson - - general work on OSX port - TTimo - - make 'move into worldspawn' work again - - fixed bobtoolz plugin causing HL startup failure - - fixed inspector in camera plugin (RTCW/ET) - - support PNG images with an alpha channel for JA - James Monroe, Mike Majernik & TTimo - - Jedi Academy game pack content and win32 installer - Nurail - - Q2 code / Q2 game pack - Hydra - - fixes to HL/CS support - - support for sprites on entities is enabled for all games, not only HL. See the wiki for details: - http://www.qeradiant.com/wikifaq/index.php?Adding%20Sprites%20on%20Entities - -GtkRadiant-1.3.10 Changes -------------------------- - - SplashDamage - - ET game pack merged into trunk - Spog & TTimo - - Gtk2 as seen in 1.3.9-test becomes the official version - TTimo - - ET Linux setup - -GtkRadiant-ET Changes ---------------------- - - SplashDamage - - plugins porting (prtview, bobtoolz) - - ET media and config elements - - custom splash screen per gamepack - TTimo - - ET setup code - -GtkRadiant 1.3.9 Gtk2 Test --------------------------- - - Spog - - update the source to compile against Gtk2 API, corresponding setup updates to install the Gtk2 stuff. - -GtkRadiant 1.3.8 Changes ------------------------- - - David Olofson & TTimo - - fix for buggy ATI drivers. Likely this doesn't fix all ATI issues, but fixes a rendering bug related to polygon backfaces - the workaround has to be enabled in Edit > Preferences, in 2D display/rendering tree node - Riant - - fix to png textures not showing in SoF2 mode. was a bad config file - -GtkRadiant 1.3.7 Changes ------------------------- - - ydnar - - q3map2 2.5.4 - see changelog.q3map2.txt - Riant - - several fixes to the SoF2/JK2 support, added missing files - - working project template - BSP menus working for q3map2 on all games - LordHavoc - - work on q1 support. no gamepack release yet - TTimo - - fix to texture compression support - - fixed models not drawing on win32. was a setup bug - -GtkRadiant 1.2.11 Changes -------------------------- - - ydnar - - added Misc > Colors > Themes > Maya/Max/Lightwave Emulation theme - TTimo - - run GtkRadiant from a network share with multiple users (win32 only): - Preferences > Game Settings allow to configure the editor to save preferences in user directory (on win 2k/XP) - ydnar & TTimo - - q3map2 integration and distribution with GtkRadiant - FIXME: the q3map2 ChangeLog is not included here - q3map2 is installed by default with GtkRadiant 1.2.11 - the BSP menus have new q3map2 options - all current games are supported by q3map2: Q3 RTCW JKII SoF2 STV:EF - BSP monitoring is supported - - fixed rare texturing bug, texture showing fine in editor and broken after compile on angled faces - fix is in q3map2, needs matching code in GtkRadiant - this is toggled by a preference item in BSP Monitoring menu: - http://www.qeradiant.com/wikifaq/index.php?Texturing%20Compatible%20with%20q3map2 - seaw0lf & ydnar & Arnout - - new picomodel library - used in q3map2 and GtkR, provide load and rendering functionality for model formats - EvilTypeGuy & TTimo - - many changes to the Linux build binaries. ABI is different, stdc++ statically linked - we expect the new Linux binaries to be much more compatible on different platforms - - linux build loads libGL.so.1 by default - James Monroe & RR2DO2 & TTimo - - added in-editor light envelope drawing. - Outer circle is max envelope, inner fullbright radius, center is effective light radius - Optional classic mode (see prefs dialog) emulates the similar drawing from Rituals and Ravens tools - (not q3map correct, easier for the level designer to understand/legacy) - Arnout - - area selection in 2d view: - Alt+LMB (LMB=left mouse button): area select - Alt+Ctrl+Shift+LMB : additive area select - NOTE: with Alt+multidrag enabled in preferences, you only have additive - - vertex mode edit, vertex select (reminder: use V for vertex edit): - regular drag for select, Ctrl+drag for additive select. Works both in 2d view and 3d - - added 'angles' support for models misc_model/misc_gamemodel. (yaw-pitch-roll vector angle rotation) - note: this is supported in q3map2 only - - upped MAX_TEXTUREDIRS to 256 (from 128) - - added 'Paste to Camera' which pastes the contents of the clipboard to the current camera origin (shortcut: Alt+V) - - added centerview functionality to 4 window mode. Ctrl+tab will focus on the selection, or if non existant, on the camera. - - added botclip filter (filters *botclip* and *monsterclip*) - - added outline style cycling, cycle between z buffered outlines and selected colour rendering (shortcut: j) - - added menu Misc > Colors > Selected Brush (camera) - configure the color - of selected surfaces in the camera view - - third coordinate for clip points now gets set to the center of the selection - - changed arbitrary rotation dialog to accept negative angles as well - - changed texture alignment dialog to accept values up to 2 decimal points - - changed entity inspector so that tab doesn't clear the epair value field anymore, - so it retains the value while jumping to it. - - paint select in camera view: - press shift and move the mouse over the camera view to paint over brushes you want to select - use the preferences menu to configure: shift key is default, 'classic mode' is Ctrl+Alt - - misc_gamemodel drawing - - new plugin toolbar - TTimo & Arnout - - with clip or caulk filtered out, you could select invisible faces on partly drawn brushes - this is bug #556, there are still some issues with it - TTimo - - added cascading to the entity menus. JKII NPC_* are all showing - - mark map modified on editing entity keys - - guard junk.txt path between " " (non monitored BSP) - - preferences: mouse AngleSpeed setting was getting clobbered. fixed and upped the max values - - RTCW setup: detect GOTY install from registry and use it as default path - Riant - - more work on texture compression, more compression options (S3TC support) - - IS scripts maintenance, media updates for JKII/SoF2/STVEF - Michael Schlueter - - fixes to Linux setup scripts - SCDS_reyalP - - RTCW town_*.shader - EvilTypeGuy - - fixed his very own memory leak in the texture code, great improvement to the memory usage - -GtkRadiant 1.2.10 Changes -------------------------- - - SCDS_reyalP - - misc RTCW .def updates - see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=526 for details - - Michael Schlueter - - misc GL code warnings fixes, improvements to the GL font code - - TTimo - - removed the "light 1" parameter from the shader files (RTCW & Q3) - this is an old/unsupported map compiler flag that was meant for shader flares - recent q3map versions produce .bsp that will crash RTCW/Q3 when used - - pk3 loading is case insensitive (loads .pk3 and .PK3) - - fixed a MAX_POINTS_ON_WINDING overflow situation in q3map (when reporting the error through debug stream) - - don't straffe when using Ctrl+Shift(+Alt) - - Riant && TTimo - - Soldier Of Fortune II support: - - complete game pack for Sof2 editing, latest tools, sample maps from Raven - - png support in GtkRadiant - - texture compression support. This requires OpenGL 1.3 drivers. Can be disabled with a preferences setting - the textures are manipulated in a compressed format on the card, memory bonus is about 1/3 improvement - Sof2 textures are eating up a LOT of memory, texture compression brings an improvement, but it's still very heavy on mem - there are still some potential improvements regarding memory footprint, this will be for later versions - - Riant - - Star Trek Voyager: Elite Forces media/scripts updates - - Jedi Knight II: Jedi Outcast media/scripts updates, contains the new elements from the second official SDK - - RR2DO2 - - camera plugin for RTCW, support for .camera files editing - the plugin allows to manipulate camera paths and splines - - RTCW VFS is filtering the files depending on game mode - Single Player mapping will ignore mp_*.pk3 - Multiplayer mapping will ignore sp_*.pk3 - - djbob - - fix to spawnflags getting corrupted when multiple entities are selected - - -GtkRadiant 1.2.9 (general update + Star Trek Voyager : Elite Forces) Changes ----------------------------------------------------------------------------- - - Riant - - Star Trek Voyager : Elite Forces game pack, STVEF-specific code tweaks - - SCDS_reyalP - - fixed bobtoolz vis viewer to work with RTCW - - RTCW entities update (various fixes, some ents colors, sizes and documentation) - - TTimo - - several fixes to region compiling, should be fully working again - - if a model load fails, the default box is bigger and easier to select - - JKII update: the default texture scale is configured per-game, JKII has correct default now - - Q3 entities update: correct trigger_hurt spawnflags - - RTCW media update: misc .shader updates, and updated some .md3 - there are still things to be looked at, cf. http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=539 - - removed broken print XY view menu item. Use a screen capture tool for now - - fixed broken game spawning after compilation in RTCW mode - - changing texture window scale no longer changes selected brushes texture - - workaround for empty gtk error box on non-english Windows installs (was i18n problem) - -GtkRadiant 1.2.8 (Jedi Knight II release) Changes -------------------------------------------------- - - Riant & TTimo - - improved the editor console logs when compiling in non-monitored mode - - JKII game pack, JKII specific tweaks - -GtkRadiant 1.2.7 Changes ------------------------- - - Spog - - fixed a regioning bug, radiant loosing track of some entities outside the region (#479) - - fixed flush and reload affecting texturing of selected brushes - - added undo for pasted/cloned brushes - - Gef - - fixed bug in velocity sliders (Edit > Preferences > 3D View) (#217) - - fix File/New Project for mods so it doesn't fail if the dir exists (bugzilla: #459) - - add Linux-isms for New Projects & read/write permissions... - note: for a total conversion, basepath needs to be manually set - - prevent opening multiple internal shader editor dialogs - - added preference for using a custom shader editor - - set horizontal scrollbar to be automatic instead of never for entity keyval list (bugzilla: #4) - - added a call to Select_Reselect() in XYWnd->OnViewEntity() to make sure its modifying the - current selection (bugzilla: #436) - - fixed entity dialog passing events through to main window (bugzilla: #454) return values - were backwards - - patching in the .pfb extension adding stuff (bugzilla: #259) - - fixed thickened patches not being grouped (bugzilla: #226). this was supposed to be happening - anyway, the entity create code was called before the patches were selected - - setting the sel_mode accordingly when (i)nverting selection, verts were being drawn when - they shouldn't have been - - fixes to Curry and PrtView (proper prefs load/save, curry logo on Linux) - - fixed patches losing their shader if outside region when calling flush/reload - - added filtering on unselect for newly created brushes/entities - - Gef & TTimo - - made sure textures with spaces in name are never loaded from tex dirs (warning if bad textures detected), - never save them to .map, avoid map corruption situations. - - EvilTypeGuy - - added back brush numbers and entity numbers in the .map (#457) - - RTCW skies.shader update - - TTimo - - correct default prompt location for file operations (map load/save, etc.) .. works for mods again - - some mod setup documentation: http://www.qeradiant.com/faq/fom-serve/cache/220.html (Q3UT2 as example) - - File > Check for update command, sends you to the qeradiant.com website with the version information - the easiest way to check if a new version is available - - cleanup of the project settings dialog. Removed a lot of unused / outdated / confusing settings we had - there - - fixed the Shift+Click shortcut to edit shaders. Fixed crashes and behaviour in the internal shader editor. - on Win32, either use internal editor, or use win32 .shader association to open - on Linux, Gef added prefs to select custom shader command - NOTE: we don't have a free text editor for win32 that allows to jump to a given line after you open - the file. If anyone has this around, please send the info along. - -GtkRadiant 1.2.6 Changes ------------------------- - - TTimo - - fixed the shader scripts so that the sky in escape1 is ok again (new skies.shader) - - safer find and replace (denies malformed shader names) - - shift + middle mouse button works again - - Linux: now distributing a new/experimental bspc for RTCW - please report problems you may have with this version - - ydnar - - fix to q3map vis stage code, should be all good now - see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=417 for details - - Hydra - - improved snap to grid in gensurf plugin - -GtkRadiant 1.2.5 Changes ------------------------- - - TTimo - - drawing dlight and lightjuniors like regular lights with a small shape change - - from RR2DO2 and ydnar: - fixing a q3map vis bug - vis is correct now, but we know that it introduces some instability and potential crashes - see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=417 - - EvilTypeGuy & RR2DO2 - - added the ability to strafe up/down/left/right while freelook is active - - Gef - - fixed target/targetnames collisions - entities being cross-linked when copied have their target/targetname - updated to maintain the links - - find brush dialog window has correct title - - linux setup tweaking - -GtkRadiant 1.2.4 Changes ------------------------- - - ydnar - q3map 1.2.4-y2 - - New features: - - -nopatchfix argument. This disables lightmap patch fixes and makes a map suitable for lighting with -vlight. - - Degenerate patches are treated like broken brushes. They are ignored, warned about, and selected in Radiant if you ran with the -connect option (or from the BSP menu). This was what was causing the "0 valued axis" error some people were experiencing. - - New entity keys: - - "_lightmapscale" key for brush entities (worldspawn, func_*). This lets a mapper scale the lightmap samplesize per-entity. For large constructions, 2.0 or 3.0 is a fine value, and keeps BSP size down and compile times low. For those areas you want to have high-detail shadows, make a func_group and use a value of 0.25 or so. It will scale the samplesize value for the surface's shader (default 16) or the -samplesize argument. - - "modelscale" and "modelscale_vec" keys for misc_models (1.0 = default). This was for proper RTCW support and is available for Quake 3 maps as well. Lets you scale up map models in the world, getting around the MD3 size limitation. The next build of GtkRadiant has SPoG's code to support this in-editor so you can see what effect a scale has. - - Flare surfaces are now supressed from the BSP. They serve no purpose other than add to the vert & surfacecount in a BSP. These surfaces were created silently when a shader has "light 1" or "q3map_flareshader X." Use the new -flares switch when BSPing your map to have them emitted. - - Changes: - - GtkRadiant 1.2.4-nightly version increment. - - Full WolfSDK style lighting enabled with -game wolf, including lightJuniors. This includes linear lights by default (no angle attenuation) and support for the additional RTCW "fade" and "angle" keys, and spawnflag changes, including q3map_nondynamic on light entities. This may require maps being constructed for RTCW with the current toolset to change their light entities. Sorry. :) Note, Wolf-style lighting only works with -light, and not -vlight. - - Vertex light stitching now uses a near-ambient light check for dark vertexes as opposed to lower-than-average fixups. This preserves some shadow detail better while getting the buried verts lit properly. Comments encouraged. - - Surfaces' samplesize are now stored in the BSP. This change makes BSPs generated from this version incompatible with all other q3maps. The upside is that -samplesize N is no longer necessary on the -light or -vlight stage. This feature is necessary to support the "_lightmapscale" key. - - Additional PVS optimizations in lighting. - - Fixes: - - Will compile for RTCW properly (1.2.1-y12 didn't). - - No more sparklies where fog meets brush faces. They're split properly now. - - Crash bug in vlight fixed. - - Vertex light fixups/stitching is considerably faster. - - Vertex light fixups ONLY stitch faces with lightmaps. For pointlight surfaces you're on your own. - - Better snapping logic when merging nearly-coincident vertexes on complex brush windings. - - Bug where the .prt file had some bogus or nearly-borked portals. They're cleaned up like everything else now. - - A few stupid bugs in path initialization. Should work better. Also includes TTimo's fixes to my code so it would work properly on Linux. - - RR2DO2's PCX loading patch for alphamaps. This bug was manifesting itself in the form of offset or incorrect samples being used on terrain entities. - - A ton of other minor little fixes here and there. - - EvilTypeGuy - - fixed broken 'load shaders at startup' preference - - djbob - - EClass_ForName fix if malformed name - - SPoG - - fixed misc_model "modelscale" and "modelscale_vec" support - - TTimo - - ability to do nightly setups again on win32 - -GtkRadiant 1.2.3 Changes ---------------------------- - - djbob -- bobtoolz update - - ydnar - TTimo -- fixes to q3map and radiant's bsp command expansion - support mod directories correctly - - TTimo -- removed the 'refresh' command from plugins menu. it is broken right now -- various fixes to the plugins` - - Hydra -- fixed the loading of texture menu - works correctly if 'shaderlist.txt only' is disabled - - Gef - Michael Schlueter - TTimo -- putting together everything for a linux release (setup scripts) -- fixes to GenSurf texture requests code - - SPoG -- added modelscale key check to misc_model entity -- added angle key check to eclassmodel class -- fixed bugs in BP (brush primitives) writing and reading -- fixed gensurf to create faces/patches with correct textures -- fixed md3 models missing in 2D views - -GtkRadiant 1.2.2 Changes ---------------------------- - -1.2.2 was born dead - -GtkRadiant 1.2.1 Changes ---------------------------- - -General changes: - -Modular architecture. During startup the editor gets configured to load specific modules, -which direct it's functionalities. The immediate consequence is the ability to support -several games in a more easy and clean way. The editor core installs in a central location -(on win32, C:\Program Files\GtkRadiant), and installs it's game specific modules and -programs in 'game packs' folders (C:\Program Files\Return To Castle Wolfenstein\Radiant -and C:\Program Files\Quake III Arena\Radiant typically). - -List of the main modules and their functionalities: -- map module, read/write from/to file and memory -- shaders management module -- filesystem module -- models loading, editing and display (.md3 currently) -- image formats loader - -Return To Castle Wolfenstein is the first additional game supported by the 1.2 architecture, -along with Quake III Arena / Quake III: Team Arena - -Specific changes and fixes: - - AstroCreep -- common shaders, cleaned up wolf shader scripts, and general Wolf pack testing - - djbob -- updated 1.2 plugin API, making bobtoolz compatible with 1.2 -- View > Filter > Structural (hide all except detail brushes) - - Wolfen -- updates to the Q3Radiant manual, links page and setup instructions - - EvilTypeGuy -- general Wolf support (.qe4 template) and bug fixes (on linux also) -- fixed patch toolbar prefs settings -- menus can be configured detachable or not from prefs - - ydnar -- changes to q3map, rough list: - Quake 3 and RTCW support through a -game switch with the same binary - light code speedups and improvements - radiosity! - new common shader 'lightgrid' - NOTE: see the q3map document for more specific info - - MrElusive -- q3map vis code speedup -- radiosity in vlight - - RR2DO2 -- general bug fixes -- q3map terrain blending fix for >5 layers -- View > Filter > LightGrid (hide lightgrid brushes) -- improved multimonitor support - (some preferences options to ensure you get accelerated OpenGL on both monitors) - - SCDS_reyalP -- q3map realloc bug in terrain code - - Gef -- brand new notebook layout for preferences dialog -- general maintenance of the builds on linux -- setup code for 1.2 on linux, corresponding enhancements to Loki Software's setup tool - - Michael Schlueter -- help on the linux setup - - Spog -- improvements to the camera rendering code -- md3 module (load / display / edit of the models) -- q3map uses a protected malloc that will exit cleanly with an error if we run out of mem - (95% of the q3map 'bugs' are just that, running out of mem) -- map module (.map read/write) - - TTimo -- complete rewrite of the win32 setup code to match the 1.2 specifics - building setups on demand, selecting the game packs that should be included -- change of the linux prefs path storage to ~/.radiant// -- BSP monitoring network stream is versioned so that we don't risk - non-matching q3map and radiant connecting to each other. -- RTCW specific project settings dialog -- Wolf spawning, use correct binary depending on SP and MP mapping mode -- game packs can customize the editor's Help menu through game.xlink files - -GtkRadiant 1.1.1 Changes ---------------------------- - - TTimo -- distributing q3data.exe and q3data.qdt in the win32 setup - (q3data is the .ase -> .md3 converter) -- fixed installer problem on win9x -- entity inspector fix, will focus on the current entity in the list -- fixed GDI leak affecting text widgets, specially the console and the entity inspector -- removed some unneeded stuff from Gtk libraries -- nightly build system -- fixed known sleep/wake issues -- .def files are now scanned from the scripts/ directory -- changed the way we handle paths to use long filenames everywhere - (in project settings, misc_model paths ..) -- Fixed -onlyents bug in q3map / origin brushes -- added general mouse wheel code and texture window -- added "notta" and "notq3a" documentation to the TA Mapping manual -- fixed entities.def on shootable doors and buttons -- added targetShaderName documentation to shader manual -- NEW TA Teams manual in the documentation -- fixed select all of type bug (made behaviour more consistent) -- fixed win32 Gtk keyboard bug Ctrl + [ and ] -- texture sub-menu cascading (when they get too big) - - TTimo & MarsMattel -- added general mod support (configured from the project settings) - - SPoG -- rendering improvements: - Added variable LOD for PatchMeshes based on curvature - Added LOD-matching to eliminate gaps between patches with mismatched LOD - Added opengl lighting (three infinite light sources) - Added dynamically calculating vertex normals for PatchMeshes, for gl lighting - Added decoding/transforming md3 vertex normals for gl lighting - Various rendering speedups -- Fixed texture shift/scale on LOD'd PatchMeshes -- Removed Patch_InsertDelete() - not functional -- Added CV lattice to selected patches -- Added Per-polygon patch selection -- Added Per-polygon misc_model selection -- Changed default "patch subdivisions" to 4 -- Fixed .wal texture support, searches for .wal extension if .tga and .jpg fail - NOTE: requires a "pics/colormap.pcx" file to obtain a palette from -- Added variable default texture scale in preferences (ini key: TextureDefaultScale) - - djbob -- fixed Radiant highjacking win32 copy/paste -- proper md3 filtering in misc_model dialog -- better MAX_POINT_ON_WINDING error handling in q3map debug stream -- if you use face selection on a globally selected brush, it will switch - to face selection, and deselect the single face. -- fixed surface inspector "fit" bug -- added patch splitting to bobtoolz -- handling of Node With Unbounded Volume (NWUV) errors in q3map debug stream -- remember last key/pair in entity dialog for easy "apply again" - - Gef -- added a button to use func_group or not in curves cap dialog -- GL extensions getting too long: using a text box in About dialog -- added a prefs switch for Kyro II GL driver bug workaround (point handles) - - RR2DO2 -- noclip-type camera movement: - documented in the section "New functionalities in GtkRadiant" - of the Radiant manual (see local installation or on the website) - - -GtkRadiant 1.1-TA Changes -------------------------- - -djbob: -- bobtoolz plugin is now included in the standard setup - -Spog: -- Fixed "Fix entity-target/targetname collisions" to use next available tN if tN, else use next available name_N -- Fixed ctrl+G SnapToGrid, now never creates degenerate face-planes -- Fixed setting an origin for multiple brushes to use origin point of fixedsize entities -- Fixed mirroring and rotation of fixedsize entities including misc_model -- Fixed undo/redo on multiple entities to link brushes to entities correctly -- Fixed "view > entities as.." menu to display correct default setting -- Fixed "view > entities as.." toolbar button to show menu -- Changed selection-area of edge/vertex control handles to stay constant when zoomed -- Fixed undo on ctrl+G SnapToGrid -- Fixed origin drift on saving misc_model with null md3Class -- Fixed creation of cap for 'Bevel' type patches -- Fixed inverted cap being created for 'Endcap' type patches -- Fixed inverting patches on mirror operations -- Added snap-selected-to-grid affects only the patch points selected -- Fixed texture quality slider adjustment -- Changed Patch Inspector Horizontal/Vertical increment to use pixel values (default 8) -- Changed Patch Inspector Horizontal increment to subtract from S values but not T values -- Changed Patch Inspector Stretch spinner to do something useful -- Changed Patch Inspector Stretch default amount to 0.5 -- Changed Arbitrary Rotation dialog to reset rotation spinner values to 0 on Apply -- non-monitored BSP compiling: sending q3map output to temp/junk.txt !! stops output in console window !! -- Fixed Patch_Naturalize to calculate T values backwards, correcting texture vertical flip -- Changed patch row/column Insert/Remove to interpolate/extrapolate from existing curves -- Fixed point selection on patches when new points are added -- Fixed redundant edge/vertex handles being created for patch brushes and fixedsize brushes -- Fixed refusal to activate brush vertex-drag mode if any patches are selected -- Partly fixed Undo picking up patch point drags when no points are selected -- Fixed behaviour of vertex selection on patches -- Fixed patch point colours in textured mode in cam window -- Changed patch point selection to update selection pool on each selection click -- changed: Curve > matrix > redisperse > rows/columns - treat a patch as independent 3x3 sections when doing redispersal -- rewrote patch cap texturing functions to be more reliable -- fixed clipper-caulker bug -- fix 2pt-clip orientation problems -- overall changes and improvements to the brush filtering and view/hide code -- fixed some grid drawing code, camera widget drawing (2D views), and min/max world coordinates bugs - -Maj: -- new splash screen - -Hydra: -- *.pfb filter in prefab load dialog - -^Fishman/Hydra: -- gtk-gensurf 1.05 - snap to grid - checkbox for adding terrain key to func_group -- gtk-gensurf 1.0 - Now the user is allowed to make terrains bigger than +/-8192 - New Green/Black theme for the preview window. - Line antialiasing for the preview window. - -MrElusive: -- bspc 2.1h - modelskins.txt and headskins.txt files - -Astrocreep: -- clean shaders for Quake III and Quake III: Team Arena - -TTimo: -- brush primitives only: texture adjustments commands (shift+arrows) are interpreted relative to the camera view -- improved the conversion prompt when there's a reguar/BP texturing conflict -- trying to print out more information if parse error occurs while loading a map -- texture locking in BP mode for axis flip and axis rotation -- better undo in BP mode -- fenris #2866, added a pref to turn on/off name conflicts resolution, rewrote the whole algorithm -- fenris #2823, fixed patch and brush dragging in 0.25 0.5 grids -- fenris #2867, limiting the amount of "spawnflags" "0" appearing in entities -- Added back texture increments follow grid -- Raised the brush max size to world size -- Fixed vertex edit prefs broken (Vertex editing splits faces / doesn't) -- New Gtk file selector on win32 (the same as earlier added to linux version) -- Fixed shader blending on terrain maps bug -- Added undo for patch redisperse rows and patch redisperse cols commands - -leo: -- Fixed the minus key on numeric keypad being ignored -- Fixed sleep mode not restoring windows correctly -- Fixed some minimize/restore issues on floating views mode -- Added an option to keep the Z and XY views on the same window in floating views mode -- Fixed elapsed time displayed by q3map -- Fixed q3map is crash if a .shader file is referenced in shaderlist and not found -- Minimize all windows when the main window is minimized in floating views mode -- Added new filter system based on FAKK2 Radiant -- Fixed View/Show/Entities menu not being checked correctly -- Fixed "Invert Selection" command selecting hidden brushes -- Fixed q3map crash when trying to load missing pcx files -- Fixed q3map not finding .bmp files for the terrain alpha map -- Fixed Surface Inspector spin buttons rate (#2776) -- Fixed some shortcuts not appearing on menu items (#2786) - -Jonas: -- Using RC file to tweak the font size on win32 (gtkradiantrc), looks much nicer now! - -GtkRadiant 1.1-TA-beta Changes ------------------------------- - -- moved the game selection to the project settings dialog. You need to set the -game mode to "Quake III: Team Arena" to enable Team Arena support in the editor - -leo: -- Fixed pk3man plugin not finding the toolbar bitmaps -- Fixed double clicks being considered 2 mouse clicks -- added virtual file system to Radiant and q3map (Team Arena support) -- Changed max number of shader files parsed by q3map to 128 -- Updated manual images -- Fixed bug with the texture window scrollbar range -- Fixed crash on Shift-A (Select all of type) -- Fixed texture window not scrolling to the top when a new directory is loaded -- Fixed crash after map compilation if the map leaked - -TTimo: -- fix multiple edge dragging crash -- terrain entity parsing speedup -- fixed some sleep/wake code (crashes and wakeup problems on models) -- fixed the clamping problems when flipping or mirroring patches -- added 0.5 and 0.25 grids -- added undo to Select_CompleteTall Select_PartialTall and Select_Inside -- two new commands in the drop down menu: - "move into worldspawn" will move selected brushes to worldspawn and eventually delete entities which end up with no brushes - "merge brushes" will merge brushes into an entity (from worldspawn or from another entity) -- merged Radiant 200f changes in - bigger map size - added ctrl-alt-LBUTTON: multiple brush select without selecting whole entities -- fixed MAX_NETMESSAGE error in monitoring - -RR2DO2: -- Clusterportal filtering ('View > Show > Show clusterportal' toggle) -- fix to CSG Merge in the menu drop down (menu was there, command not hooked) -- Added bug report link to help menu -- patch to q3map, added option -custinfoparams for custom surface flags (mod makers usage) -this is documented in the Terrain Manual ("New or Revised Q3map Shader Commands") - -leo and MrHyde: -- gtk-based gensurf - -GtkRadiant 1.1 Changes ----------------------- - -leo: -- Fixed copy text from the console (win32) -- inspectors and Z window always floating on top -- Added ungroup command to right click menu -- Fixed GL error on win32 startup -- Added splitters to Entity dialog (customizable layout) -- Fixed shortcuts.ini parsing bug -- Fixed editpad crash if editpad not present (win32) - -TTimo: -- HTML versions of Q3Radiant manual, Shader manual and Model manual -- added Escape key to hide the entity inspector -- S and Shift+S now act as toggles on the inspectors -- fixed DestroyCursor error -- new option in prefs: clipper caulks faces -- more plugin interface for BSP frontends, plugin SDK additions -- fix to the pointfile not drawing in 2D views -- MAX_BUILD_SIDES error reported in q3map debug stream - -GtkRadiant 1.1 beta Changes ---------------------------- - -MrElusive: -- bspc 2.1c, MAX_MAPFILE_PLANES bumped up (needed on big maps) - -G_Dewan: -- fix to BSP menu order getting mixed up -- fix to bogus noshader error message in q3map -- suppressed winsock2 dependency, only requires winsock1 now -- improved q3map, reducing minimal memory footprint by about 45Mb - -leo: -- Fixed q3map crashing if visbytes is greater than the maximum allowed -- fixed texture window not scrolling when last texture is large -- Fixed q3map Makefile -- Fixed +/- numpad keys not working in win32 -- Fixed Alt shortcuts not working in win32 -- fixed prefab path and user ini in preferences dialog -- fixed add/remove bsp items in project settings dialog -- fixed some console not working in view #3 -- fixed warning when exiting in views #2 #3 -- Fixed patch inspector not showing after it has been closed -- Fixed load window position bug (saved pos greater than screen resolution) -- Fixed selection nudge bug -- fixed Z window not shrinking small enough in floating windows mode (win32) -- Improved entity windows layout -- Added 'Reset' button to entity dialog -- added LOD for patches, see in prefs for the LOD you want to display on patches -- no more DOS dialog box under windows, Gtk errors and warnings are -redirected to the console -- remember size/position of the entities dialog -- new 128 and 256 grid - -- added shift+rclick+mouse move to zoom in/out of the view -(way cool feature! check it out!) - -TTimo: -- fixed the Region commands, "Region > Set brush" is working - Region uses the camera as spawn point. -- updated quakev2.qe4 with -vlight options -- added checks in q3map to prevent crashing on allocating a winding too big. -- improved snapshots behaviour, doesn't snapshot non-modified maps -- improved the CycleCapTexturePatch command, now cycle across the 3 planes only -and works on multiple patches in one shot -- fixed the help menu, Help > Help or F1 will try to open the Q3Radiant manual -(if you have office installed) (Help > Links also fixed) -- surface inspector allows to change increments steps and stores them in -registry. General behaviour of the surface inspector has been reworked. Undo -works better on the surface inspector. -- shift+arrows shortcuts now match the increments from the surface inspector -- button 'Match Grid' in the SI to set the increment to current grid - -- debug stream between GtkRadiant 1.1 and q3map: -As with the Alpha version, q3map connects to Q3Radiant to report on it's -progress. The progress reporting code has been enhanced with an XML stream. If -your map has errors that need geometry information to be fixed, Radiant can help -you out. To get a grip on this feature, load baseq3/maps/museum.map and compile -it (with BSP monitoring turned on of course). - -- cleaned the entity inspector window, better layout management - -- two new items in the View > Show menu: -the X, Y and Z axis have been assigned colors (Z: Red, X: Green, Y: Blue) -Show outline draws a colored outline around your view, helping you know what -view is currently active. -Show Axes will draw a small axis base in the upper left corner - -GtkRadiant alpha version Changes --------------------------------- - -MrElusive: --q3map 1.0q: fixed a bug in q3map that sometimes cause mapobjects not to be lit - -G_Dewan: --more arrows drawn on entities with relevant angle information - -Fishman: --antialiased lines - -leo & TTimo: -- based on Q3Radiant 202 -- patched q3map with network code -- shortcut keys are now in shortcuts.ini - the syntax has changed a bit, no spaces between the '=' - see shortcuts.sample -- no longer using the registry, settings are stored in radiant.ini and savedinfo.bin - in Radiant directory -- project settings templates: - the project settings file format has changed a bit. - it has version information now, and the setups come with a new quakev2.qe4 file - the project files are true templates, Radiant will read them and then store actual - project settings it uses in baseq3/scripts/user0.qe4 user1.qe4 etc. -- new compilation monitoring - GtkRadiant comes with a modified version of q3map that reports to GtkRadiant through - the network. You get the output of q3map in the console window. And the compiling - errors can be processed (currently it detects leaks) -- sleep mode: - before running Quake 3 Arena to playtest your maps, you can put Radiant to sleep: - manually with File > Sleep command - automatic if you compile and set "Activate sleep mode when running the engine" - -Q3Radiant 202 Changes ---------------------- - -MrElusive: --q3map 1.0p --Tool options.txt (q3map command-line doc) - -G_Dewan: --added functions to the GL interface for PrtView - GL plugins now get the camera position information - -TTimo: --fixed sound and model assignment. project files are supposed to be written with - short path names. If it's not it might break. Added fixes in sound and model - assignement to go around the problem. Too late before next release to try - adding automatic clamping to short path name of the project file. --high color is always on, it's a remnant from Q2 --some fixes to find the default project file and interpret it when it's a template --proper error handling in the JPEG library, no longer crashes on progressive jpegs --added a "shaderlist.txt only" option to the texture menu, will display only the - .shader files listed in shaderlist. Workaround for the 127 texture count limit. - (saved with prefs) --when building texture menu, Radiant will dump in the console the list of .shader files - that are not referenced in shaderlist.txt --texture menu shows .shader files that don't have an associated texture directory --storing "don't select curves" and "don't select models" from the toolbar in the registry --alpha channel: some buggy textures have a nearly empty alpha channel and they might be - invisible if used in a shader script with qer_trans. Will now show up blank-transparent. - Best is to fix the alpha channel of the texture by saving it as 24bits instead. - Or disable alpha channel support in the prefs (added a new checkbox) - WARNING: disabling alpha channel might break curry on some shaders - about the WARNING: .. has empty alpha message: - this means Radiant detected on these buggy textures, alpha channel will be completely ignored --speed improvements: added hash tables, improves map load (Map_BuildBrushData) and - texture find/replace. More or less evolves in log n with size of the map instead of previous n^2 --fixed some notepad spawning crashes + will be better at finding shader definitions --added "HOME" keyword when parsing user prefs keyboard shortcuts for HOME key (heh) --fixed duplicate HideSelected command in the Help > Command list, added proper ShowHidden to the command list --fixed a crash when max texture directories reached (currently 127) --added a log file, turned on/off from prefs (default is off) - automatically turned on after a startup crash (Radiant.pid) - -Q3Radiant 201 Changes ---------------------- - -MrElusive: --updated q3map, fixes a -vlight bug -TTimo: --fixed a bug in texture submenus --installer defaults to putting an empty registry.ini in the tools directory - (will solve some setup problems) - -Q3Radiant 200 Changes ---------------------- - -Id: --bspc 2.0 --cfgq3.c config file with bspc --q3map 1.0m -Spog: --updated default project file to handle new -vlight param in q3map -TTimo: --added surfaceparm hint to common/hint shader in the editing media --added back the Texture > Directory list... command --collapsing texture directory items into submenus when a common root is found --fixed a Region > Set selected brushes bug (the kind that only happens to MrElusive) --added back Selection > Invert (shortcut I) .. (it disappeared at some point) --fixed U shortcut for Textures > Show in use --fixed the texture subset filtering in the texture window --added Select / Don't select models toggle in the toolbar --FIT command for BP mode --Region > SetSelectedBrushes to shift+ctrl+R - NOTE: ICQ will intercept the shortcut key .. if someone has a solution for this let me know --disabled the qer_nocarve check for CSG-MERGE operations, you can merge hint brushes now --added a temporary Radiant.pid file to intercept crashes during the startup sequence and prompt for a registry cleanup - (some bogus registry settings might cause a crash before entering the interactive mode) --clip filtering works same way as caulk, if hide clip will still display non-clip faces on clip brushes --console keeps scrolling --Ctrl+H shortcut toggles show/hide Hint brushes --199->200 stability fixes: - fixed Shift+A SelectAllOfType on patches - fixed a crash in Flush & Reload shaders - fixed a crash File > New Map with selected faces - fixed Vertex manipulation crash - sanity checks: don't allow textures with spaces into map files, nor color brushes - (reducing the parseEntity: { not found errors) - blocking classname editing from the edit field of the entity inspector --Undo: - fixed Undo crashes - better Undo on fixed size entities (like misc_models and weapons) - some bugs in undo create bogus worldspawn entities that corrupt the map. - Loading several worldspawn will merge them in the primary one. - Radiant will drop supiscious worldspawn entities at save time --find/replace bug fixes (still needs some work in BP mode) --fixed broken View > Show In Use --fixed installer problems -G_Dewan: --hash code in PAK library, speed improvement for Map_BuildAllDisplayLists --fixed a crash on exit (weird MFC bug, see #107030 --fixed crash in vertex editing - -Q3Radiant 199 Changes ---------------------- - -Mickey: --PakMan plugin -G_Dewan: --GL_MODELVIEW in camera rendering for PrtView depth queuing --fixed the texture window raising after a resolution change --PrtView plugin -TTimo: --light intensity prompt when you create a light (Tim Willits feature request) --fixed some crashes in Undo code --engine path lookup, Radiant uses same code as q3map to guess the engine path and the basepath --fixed crash in "vertex editing splits faces" --loading .md3 and skins from .pk3 files, fixed various .md3 loading issues --case sensitivity fixes for shader names --IGL interface allows drawing in the camera view --textures sorted in the texture view --clear patch overlays hooked to Ctrl+L --fixed a Curve > Matrix > Transpose bug on non-square patches --removed some old unused shortcuts --new FitTexture shortcut Shift+B, will raise the surface inspector and perform face and patch fitting --fixed alpha channel bugs, re-enabled qer_trans --CSG Merge shortcut as Shift+M --patch creation uses workzone --fixed sfx/comprscreen/letters loading --textures / shader code rewrite, based on a new CShader class - -texture robbing bug fixed: two shaders relying on the same texture are treated properly - -will provide basis for other games support, and better shader editing functionality - -loading a texture directory will: load all the shaders in that directory, and load all - the remaining textures that have no shader. - -shaders parsing: when several definitions for a shader exist, first is used --better GetLastError message processing on error --fixed Fit command in surface inspector for BP mode --prefs choice "vertex editing splits faces" --3 points clipping and brush creating, third coordinate in 2D view is based on the "work zone" - -q3radiant 182-197 Changes -------------------------- -Editor (TTimo): -+ textures are now loaded with their alpha channel. was a required feature for - the Curry plugin. Some issues have surfaced with 32bit TGA files having an - empty alpha channel. (the textures were totally transparent in the camera view) - these files are buggy and need replacing by either a 24bit TGA, or a proper - alpha channel -+ shortcut keys: - fixed L shortcut for entity list - fixed M shortcut for map info - fixed Ctrl + \ for cubic clipping - fixed Ctrl + Shift + K for next leak spot - fixed R shortcut for mouse rotation -+ brush grouping: not functional yet. Needs Brush Primitives (BP) to be turned on. - basic infrastructure for grouping is done -+ fixed View > Show > Show angles checkbox -+ fixed BP file load / save and loading old format from BP mode. -+ fixed q3map to read BP map format - -Plugins API (TTimo): -+ Patches in/out -+ Entities in/out -+ Added GL bindings to IGL interface -+ New IBSPFrontend interface to override the BSP menus -+ New IMessaging interface for message broadcasting to plugins -+ New IPluginEntities interface to allow plugins to render - and interact in the Radiant windows -+ New IShaders interface for more textures / shaders support -+ Fixed GL context issues, texture binding would fail if binded to a plugin's GL context - -q3radiant 180-181 Changes -------------------------- --q3map will read jpegs from disk --remove junk.txt before very bsp, fixes a crash --fixed gamma changing crash --fixed thickening multiple patch crash --fixed hollowing patch crash --reworked how keys are mapped --key binding should work again --ctf spawn points show angles - -q3map v1.0a changes -------------------- --q3map will read jpegs from disk --fixed crash on texure loads of less than 4K ( jpeg only ) --added version info - -bspc v1.7 changes ------------------ -see the bspc.txt file - - - -Known Problems --------------- --Prefs are NOT retained when moving to 179 (or later) from earlier versions ( than 179 ) --Windows are all stacked when switching to floating window mode. You must manually align them as you like. --You must manually run the bot bsp'r if you want bots to be able to run around --I have not tested plugins extensively with this version but will do so over the next day or so. --Need to clean up several small memory leaks - - - -Info ----- -The editor/tool install MUST be installed in the same directory as Quake 3 Arena. This means if you installed Quake 3 Arena in c:\quake3\ you MUST point the tool installer at that path. - -If you want bot support in your maps, you must manually run the bot bsp tool. It is in the \YourQ3InstallPath\Tools\ directory and is called 'bspc.exe'. After you have produced a bsp, you can execute it like: - -bspc -bsp2aas c:\quake3\baseq3\maps\mymap.bsp - -The editor and included q3map support a new feature called brush primitives. This provides per vertex coordinates for texturing as opposed to per face shift/rotate/scale values. This is a good thing. This is not enabled by default ( you can do so in the project dialog ) but it is still considered experimental AND it changes the map format. A plugin that also supports it will be available soon on www.qeradiant.com. We will be moving to this new format soon but currently use the old format. Consider brush primitives "subject to change" but we are going this direction. - -Once installed properly, you should be able to open q3dm1sample.map, choose "BSP - Fast Vis" and within a few minutes you should be able to run around in that map. Remember you must have sv_pure set to 0 to load up maps that do not exist in the pk3 file. - -If you shift click on a shader ( white framed texture in the texture window ) AND you have EditPad installed and available on the path ( or the Tool directory ) it will open up EditPad and position the cursor on the shader definition within the shader. EditPad can be had at http://www.jgsoft.com/ , it is a nice replacement for Notepad. - - - - -174-179 Changes ---------------- --The color coding for failed texture loading has changed, blue and black for failed textures, red and black for failed shaders. --clip/hint brushes default to NOT shown --default to bilinear display mode --default to 50% texture window scale --bsp text is piped to console and text file --Project dialog tab order is correct --Project dialog no longer truncates entries ( it still needs work ) --Drastically reduced memory consumption --Skins are now cached and only loaded once --Mirroring on X or Y axis properly flips misc_models and angles --PK3 Support --JPG Support --Plugins can now load files from pk3 files ( transparent to the plugin ) --Shaders can now load from pk3 files --Failed shaders no longer load a "notexture" image --Shaders are loaded from shaderlist.txt instead of *.shader --Shader texture loading is deferred based on All, Common or None rules. New Pref based on this. --Models can now load from pk3 files --Fixed Win98 Copy/Paste bug --Fixed Win98 BSP execution bug --Project info dialog sucks less --Properly handle long path names ( embedded spaces mainly ) when calling q3map. --Better bsp execution, output is piped to dos window and console --Q2/Q3 Pref handling works --Finished Installation --Better defaults all around --Better window resizing, defer'd decision to default to floating window resizing. --Fixed crash on loading new projects --Seperated block allocator and actual size allocator to reduce memory overhead --Failed textures only try to load once --Failed MD3's only try to load once --Cleaned up shader loading --Editor loads without requiring information from the user the first time ( assuming it was installed in the right place ) --Fixed case comparision problems with some PK3 file contents --Fixed allocation bug when cleaning out PK3 files on project reload - -Build 173 - -Changed -- Copy/Paste now uses the Win32 mechanism. This greatly speeds up editor to editor copy/paste. - - -Build 172 - -Added -- Hide and Unhide brush(s). Hide ( View Menu and 'H' ), hides the selected brushes. Shift-H shows anything previously hidden. -- Fit functionality in the Surface dialog no longer fubars the FIT exiting the dialog via OK or APPLY. -- Copy/Paste now functions between two open copies of the editor -- Textures | Show In Use now pays attention to Patches. -- The editor will now properly find a default project based on the assumption it lives in the \quake3\q3radiant\ path - - -In Progress -- Pref Dialog now has functioning Q3 and Q2 options. -- ASE Model load. Should be bug free in another evening. -- ZIP support -- Model Plugins for supporting various model types ( MD4, TIKI, MEN, ASE ) This is essentially moving all of the model preview, interaction, and animation to a plugin to clean the code up. - -Deferred -- The new file format changes and new texturing is finished but based on the probable ship date(s), I dont feel comfortable mucking with the map format at this time. This code will be used in the new editor or can be rolled out once Q3 is gone. - - - - -Build 169-171 -Added -- Control + Shift + X toggles crosshairs -- Added Fit functions to surface dialog. These are more test stuff than anything as the new texturing capabilities coming with the new file format will allow much more versatile texturing. - -In Progress --New file format changes, true ST texturing for brushes, automatic conversion. This will happen soon. - - -Build 168 -Added --Control + Texture Click to apply texture applies with proper scale on angled faces. - -Build 167 ---------- -Fixed --Crash when edge dragging brushes with more than 1K points (total) - - -Build 166 changes ------------------ -Added --Shift-C cap current patch --Shift-A will now highlight all patches and caps based on 1. the currently selected face or 2. the current texture if there is no brush or face selected. If a brush is selected it still searches and highlights based on entity class. - -Build 165 changes ------------------ -Added --Texture lock status information, on the right edge status pane, L:move,rotate status. so L:MR means both move and rotate are selected, L: R means just rotate, etc.. Shift-R and Shift-T are hotkeys (always have been) for the locking. Help|Command List has a list of all bound keys. - -Changed --Curve primitives moved from a submenu back to the root. - -Fixed --Crash when pressing 'v' with large number of brushes selected. - - -Build 164 changes ------------------ -Added --Brush | Primitive | Sphere - With grip snapping on, this produces some pretty odd faces, not sure what they will look like in game as I have not run one through the tools. If you turn off grid snapping they are constructed very well but as soon as you turn it on and then save/load everything gets snapped. This shows that the current implementation of grid snapping is pretty useless if used as a toggle. I am looking into some painless ways to deal with this (from a users point of view) - -Changed --The current selection is no longer de-selected when a texture directory is loaded. --The default increment for texture manipulation on patches was change to 0.05 from 0.10. You can also type in much smaller or larger increments into the dialog which will then be used. - -Fixed --Crash when using the clipper on a curve. - - - -Build 161 changes ------------------ -Added --Edit | Load Prefab... This was there but it now uses .pfb as the default extension for prefabs. MAKE SURE and set the full prefab path you want to use in prefs. --Edit | Save selection as Prefab... This saves the current selection as a prefab. Defaults to the pref'd prefab location and .pfb extension. - -I am working on a preview window that will be used for these and misc_models. Look for that in a few days. - -I also discussed grouping (i.e. func_groups) with John a visit or so ago and the current plan is to add key/val pairs to brushes and patches and do away with func_groups. This will allow a lot of flexibility for grouping (hiearchial, named things) as well as other areas too. I will be presenting the overall plan to John soon and if we go with that then this will allow the prefabs to be grouped problem etc. - - - -Build 157 changes ------------------ -Fixed --misc_model bounding box size on intitial creation --copying/pasting a misc_model did not update the active edit entity --misc_models will not continually try to load if the MD3 is not found - -Added --Origin drawing on misc_models, this is what is snapped to grid --Pref to turn off 'Show Shader' checkbox --Show Shader checkbox to prefs --Shift-A with a selected face selects all brushes that 'contain' that faces texture - -Known --Assigning a new model to a rotated misc_model screws the bounding box up - -Build 156 changes ------------------ -Fixed --Texture replacement bug when regioning. - -Build 155 changes ------------------ -MAJOR changes internally with this version. Make sure everything is backed up. There should not be anything destructive in it but this is a good precaution. There may still be some memory leaks from the new patch storage stuff, those will be addressed in 156. - -Changed --Patch storage, no longer fixed size, unlimited patches. - -Fixed --Undo, should now work in many more cases, and with patches. (this has been tested the least) --Cap texturing. Worked in my test cases. If you get a cap that does not texture properly I added -|a key combo for cycling the axis face it textures against. Ctrl+Shift+N does this. - -Added --OpenGL Lighting, turn it on via the view menu. Provides consistent shading/preview between brushes/patches --New vertex handling, not enabled at present. Still tweaking. --SHIFT-A selects all entities based on the current selected entity. - -Build 154 changes ------------------ -Fixed --Another instance of entity copy/crash across maps. - -Build 153 changes ------------------ -Changed --"sound" to "noise" --Show Entities toggle does not fool with func_group'd stuff - -Build 152 changes ------------------ -Fixed --Copy/Paste crash --Copying brushes across a new map load no longer continually copies them on each subsequent new map - - -Build 151 changes ------------------ -Added --Shift clicking a shader in the texture window now spawns "EditPad" and places the cursor at the apporpriated place. - --Patch Inspector (Shift-S) allows access to all patch data and dups surface patch handling. Only works with one patch at a time. If mutliples are selected it uses the latest. This is not quite finished but works. - --Sound player in the Sound Open Dialog (entity window) - -Fixed --Crash when 'Capping' a brush. - -Fun Stuff in progress -- MD3 -> Patches. Drop an entire MD3 as a grouped set of patches. - -Build 150 changes ------------------ -Added --Texture show all command. -|Behaviour is as follows: -| 1. Show in use, shows in use. -| 2. Show all, shows everything. -| 3. Showing a particular path, only shows textures in that path. Show All or In Use -| can be used to un-narrow the view. - -Ctrl-A is the show all hotkey. - - -Build 147-149 changes ---------------------- -Fixed --misc_model entity preview bug --Texture show in use now works properly --a few shader issues - - -Build 146 changes ------------------ -Fixed -- Copy/Paste entities across maps crash -- A ton of memory leaks - -Added -- Shift-TAB works in bend mode -- Pointfile is removed on file saves - -Build 145 changes ------------------ -Fixed -- misc_models no longer shift during save/load -- misc_models copy/paste correctly -- misc_models paint when first assigned -- assigning a new model name to misc_models works - -Added -- Shaders have white border in texture palette -- New shader test code based on the fact that shaders are not directory oriented. On by default, to return -| to the old method, turn "Shader Test" off in prefs and restart. This behaviour loads all of the shaders -| at load time and provides the ability to turn off shader display in the palette. The editor MUST FIND -| qer_editorimage in order to work properly with these (this is true for the old stuff too). This should -| fix the shader xref problems. - - -Build 139 changes ------------------ -Fixed -- MD3's are now origin'd properly with their bounding boxes -- Plugin texture load bug - -Added -- Texture quality slider (prefs). This can drastically reduce memory and increase speed at the expense of visual quality. -- Shader support for MD3's, proper shader is pulled per surface (assuming it is tga) -- Multple MD3's can be assigned on a per entity basis. Seperate them with a ';' -| i.e. model=models/players/medium/visor/head.md3;models/players/medium/visor/lower.md3; etc. -- Added 'frame=' specifier (0 based) to entity preview to use a particular frame for preview -| This is still a bit fubar'd -- Subdirectory map support ala Raven -- 'color' entity setting ala Raven -- Shader 'qer_editorimage' textures are now load deferred until their parent texture directory is loaded -- Full Plugin support -- You can now override surface dialog names with a plugin (not much use for q3) - -Changed -- After assigning a model or sound, focus is given back to XY -- If you right click and add a misc_model, the entity window is automatically -| switched to and the add model dialog is activated -- Models no longer try to load if they fail once -- Prefs layout. Still ugly. - - -Build 138 changes ------------------ -Fixed -- qer_editorimage behaviour - -Build 136-137 Changes ---------------------- -Added -- qer_editorimage flag to shader parsing -- md3 support for entities -- md3 support for misc_model <- this works but it is a cluster fuck of code -| the code tries to pick up the same name for a skin (in the same path) -| grid snapping is not happening, i need to fix this -| some models (like pentagram1.md3) appear to be OFF as far as their constructed origin -| others (all others that i tried) are correct -| Free rotation does not work for these but the entity rotation stuff works fine -- Model... button in entity window for assigning model=value to current entity -- Sound... button in entity window for assigning sound=value to current entity - - -Build 134 Changes ------------------ -Added -- qer_nocarve flag -- qer_trans flag use 'qer_trans sometransvalue' marks a shader as transparent -- patches draw transparent based on shader information -- default fog setting changed from 0.15 to 0.35 -- Plugin menu added (non functional yet) -- Fonts default to standard windows gui font for improved readibility -- Textures associated with a shader have [] around the name -- Shift-clicking a texture associated with a shader brings up the shader in notepad - -Changed --Max brush size bumped to 8192 (Brian Hook for testing), did not test with build tools - -Fixed --Entity dialog lets you type in more than visible space for key/val pairs --Transparent bug when transparent brushes painted in front (visually) of a curve - - -Build 127 Changes ------------------ -Added --Ctrl+Shift+P, this cycles the cap texturing axis on the selected cap. Basically, until -I figure out what the heck is wrong with the auto stuff, use this to correctly texture -a cap that is fubar'd. --CAP texture button in surface dialog. This does the same as above but uses the default -axis finder (which has the bug). --Matrox transposition - -Build 126 Changes ------------------ -Removed --Test code for thickening. It was hooked into overlay clear... oops. - -Changed --csg ignores patch symbiot brushes - - -Build 125 Changes ------------------ -Fixed --Shift vertex (row/col) selection for patches. - -Build 124 Changes ------------------ -Changed -- Temporarily reverted back to patchDef2 .map file format. - -Build 123 Changes ------------------ - -Changed --.map patch format, added 'type' field. not used anywhere except the editor (at least for now) -- Patch vertex manipulation. The editor tries to pick all existing points from other patches as well -|You will want to do area selection (in an XY-type view tp select thick patch points if you want to drag -|everything related to the thick patch - -Added -- ESC will deselect any patch vertex points selected instead of going completely out of vertex mode -|This only happens with patch vertex selection -- Thick patches, Curve | Thicken... or press Ctrl + T. The thickening happens away from the texture -|side of the patch. So if you want something to thicken inwards, make sure the texture is facing out. - - -Build 122 Changes ------------------ - -Added --Texture Flush (forces a new map, then a total texture flush) -|One small nit on this is that if you create a brush before loading a new set of textures it -|will use one of the recently loaded textures instead of the default no texture (blue and black checkerboard) --Patch inverting. -|Ctrl + I invertest the patch, -|Shift + I inverts texture in X, -|Ctrl + Shift + I inverts texture in Y --Overlay function for patches. Turn on|off using menus or press 'Y' to make a patch an overlay and -|ctrl+shift+Y to clear all overlays - -Fixed --Inverted beveles cap and texture properly - - -Build 121 Changes ------------------ -Added --Patch texture inverting. Ctrl + Shift + I. I think this does what you wanted. --'S'urface dialog grabs texture name from a single selected patch - -Better (a little) --Capping bevels makes the cap the right shape but the 3rd point is not on the right plane. -In most cases you can move it and snap it to the right place. Texturing is not all fucked -up anymore either. Once I hear back from John on my math stupidity, I will finish fixing it. -These statements are probably only true for non-bent bevels.. bending will probably screw -stuff up again. - -Build 120 Changes ------------------ -Added --Fine tune texturing for Patches. Using the surface dialog, you can type in very small -(3 decimal places) numbers for fine tuning on both scale and shift. Currently you can -only fine tune with the Surface dialog, I am in the process of adding a fine tune settings -dialog for use with the keypad keys. - -Build 119 Changes ------------------ -Added --TAB cycles through any entity grouped brush --Texture window can now be scaled by 10, 25, 50, 100, 200% --Texture window now has a optional scroll bar, turn it on in prefs - --Texture path linkage -Put a "textureinfo.ini" file in a texture directory and add the following - -[include] -Path0 = e:\games\quake2\plop\textures\24 bit\ - -You can have Path0 - Path9 as inclusive directories. The linked pathes will not -load and process link information to keep someone from linking two paths together -and causing an endless loop - - -Build 116 Changes ------------------ -Added --Ctrl-P Toggle show patches - -Fixed --Gamma correction - -Removed --Model preview load code which was probably causing brandon's crash - - -Build 115 Changes -Tweaked --Cap texturing --Ctrl S was already bound to File | Save --Ctrl C is bound to standard windows Copy - -Added --Ctrl-S Save file - -Build 114 Changes ------------------ -Tweaked --Cap texturing - -Added --ALT + Shift click will cycle through "selectable" brushes along the -line of site from the mouse click. Works in all views. This is cool. --Square cylinders - -Fixed --Show curves works properly - -Pending --Shifting textures on patches should honor scale (cannot dup) --Disperse columns crashes (cannot dup) --Capping bevels is messed up --cap texturing may still be fubar'd --Thick pipe primitive --Scale origin + point scale similar to rotate. Will allow fluted stuff etc.. - -Build 113 Changes ------------------ -Added --Capping (with dialog for Bevels and Endcaps) - -Build 112 Changes ------------------ -Fixed --Yet another surface dialog glitch --Area selection tool paints in all xy oriented views - -Build 111 Changes ------------------ -Fixed --Surface dialog face selection bug - -Build 110 Changes ------------------ -Added --'B' - toggles Bend mode - -Fixed --Naturalized texturing on patches --Bend whackiness on intial drag during start of a bend --Setting bend rotation axis in XY Top view - - -Build 109 Changes ------------------ -Added --Ctrl 'I' - inverts a curve --Ctrl 'Numpad +' adds a row --Ctrl 'Numpad -' removes a row --Ctrl+Shift 'Numpad +' adds a column --Ctrl+Shift 'Numpad -' removes a column --Ctrl 'E' - redisperses rows --Ctrl+Shift 'E' - redisperses columns --Ctrl 'G' snaps patches to the nearest grid --Surface control dialog now allows values to be typed in and applied to patches. - This is working except for shifts which still go in .9 and 1.1 amounts. - -Changed --Regioning no longer puts a top and bottom on the region - -Build 108 Changes ------------------ -Added --Area selection. Works in 3 xy views but only draws in the xy view. I will look into this asap. - -Changed --Selection point size for vertex mode with patches. i.e. The handles for dragging patch points around are bigger. - -Build 107 Changes ------------------ -Changed --Inverted curve options removed from menu --Bevels and endcaps are contsructed properly --Endcaps will not work for bevels and endcaps - -Build 106 Changes ------------------ -Fixed --shift middle clicking a light now adds the correct average color based on .TGA files --display updates properly when using TAB to go between func_group'd brushes --Patch texture rotation is much better. Still not completely perfect but should be usable. - -Build 105 Changes ------------------ - -Added --TAB cycles through func_grouped brushes --textures with a shader have a [] wrapped around the name in the texture window --shift + left clicking on a shader texture in the texture window will bring up notepad with the shader file diff --git a/setup/common/setup.pm b/setup/common/setup.pm deleted file mode 100644 index 73113ccf..00000000 --- a/setup/common/setup.pm +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env perl -# -# Common setup functions for building release packages -# - -# Gef - Jan3 2002 -# - Initial framework for migrating setup/release building to perl - -# TODO: -# Gef - Cleaner handling of cons builds, currently doesn't catch cons errors - -package setup; - -# Package constructor -sub new -{ - my $this = {}; - bless $this; - - return $this; -} - -# Replace in file parm-1; parm-2 with parm-3 -sub replace -{ - shift; - my $file = shift(@_); - my $search = shift(@_); - my $replace_with = shift(@_); - - # need to use | instead of / with sed since the variables will contain /'s which confuse it - system("cat '$file' | sed -e 's|$search|$replace_with|g' > '$file.tmp'"); - system("cp '$file.tmp' '$file'; rm '$file.tmp'"); -} - -# Not exactly common (between win32/linux), but useful here all the same -sub cons_build -{ - shift; - my $BUILD_DIR = shift(@_); - my $BUILD_CMD = shift(@_); - # use a direct system() call since syscmd doesnt catch cons errors - system("cd $BUILD_DIR; $BUILD_CMD"); -} - -# Maintain a list of errors that have occured -sub collate_error -{ - #shift; - my $err_type = shift(@_); # unused - my $err_command = shift(@_); - - @errors[$err_count++] = "$err_command"; -} - -# Output the list of errors stored -sub print_errors -{ - my $count = 0; - - if($err_count gt 0) - { - if($err_count > 25) - { - print("$err_count Errors!! Ouch, looks like something screwed up.\n"); - } - else - { - print("$err_count Error(s) encountered\n"); - } - - for($count; $count lt $err_count; $count++) - { - if(@errors[$count] ne "") - { - print("-> @errors[$count]\n"); - } - } - } - #else - #{ - # print("No errors encountered.\n"); - #} -} - -# A wrapper for system() calls that catches errors -sub syscmd -{ - shift; - my $command_string = shift(@_); - - # todo: identify multiple commands (commands split with ;'s) - # todo: catch cons errors (cons doesn't return a value) - system("$command_string"); - my $sysretval = $?; - - if(($sysretval gt 0) && ($sysretval lt 257)) - { - @cmdlist = split(" ", $command_string); - if(@cmdlist[0] eq "cp") - { - collate_error("copy", $command_string); - } - elsif(@cmdlist[0] eq "mv") - { - collate_error("move", $command_string); - } - elsif(@cmdlist[0] eq "cons") - { - collate_error("cons", $command_string); - } - elsif(@cmdlist[0] eq "cd") - { - collate_error("changed dir", $command_string); - } - elsif(@cmdlist[0] eq "mkdir") - { - collate_error("make dir", $command_string); - } - elsif(@cmdlist[0] eq "cat") - { - collate_error("cat", $command_string); - } - elsif(@cmdlist[0] eq "rm") - { - collate_error("remove", $command_string); - } - else - { - collate_error("unhandled", $command_string); - } - } - - return $sysretval; -} - - -# Close package -1; diff --git a/setup/credits.html b/setup/credits.html deleted file mode 100644 index 4e3c7fd8..00000000 --- a/setup/credits.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Radiant - Credits - - - - -

-
-
- - -
-

Credits

-
-
- -
    -

    - GtkRadiant 1.5 development
    -


    -
      - · Thomas "namespace" Nitschke spam@codecreator.net
      - · Stefan "Shaderman" Greven
      - · "Topsun"
      - · SmallPileofGibs spog@planetquake.com
      - · "Tr3b"
      - · Eric "eb" Barth
      -
    -

    - -
    -
    -

    GtkRadiant 1.4 developement

    -
    - -

    - Loki Games
    - Loki games was the instigator of the project. - Leonardo Zide wrote the initial port to Gtk+, which is based on the win32 version of Q3Radiant by - Id Software. -

    -

    - - -

    - Id software
    - Id software is actively supporting - the project by providing resources, advice and developer time. -

    - - - QERadiant.com
    - QERadiant.com is the main entity - behind the editor. The team has been handling editor developement, website - work and documentation for several years now. Many people on the team have - been involved in several areas, plugin developpement, contributing patches, - doing documentation (.. and fixing my bad html)
    -
    - - -
    - -

    - Thanks to everyone on the beta mailing list and irc.telefragged.com #qeradiant - for testing and feedback. -

    - Updated icons by AstroCreep -
    Bitch-slapping by raYGunn -

    - Special thanks to The Gtk+ project and specially Tor Lillqvist, maintainer of the win32 port of Gtk+. -
- -
- - -
-   -
-
- -
-
- - - diff --git a/setup/data/tools/bitmaps/black.bmp b/setup/data/tools/bitmaps/black.bmp deleted file mode 100644 index 8fc59ba1..00000000 Binary files a/setup/data/tools/bitmaps/black.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/cap_cylinder.bmp b/setup/data/tools/bitmaps/cap_cylinder.bmp deleted file mode 100644 index 2e4d11af..00000000 Binary files a/setup/data/tools/bitmaps/cap_cylinder.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/console.bmp b/setup/data/tools/bitmaps/console.bmp deleted file mode 100644 index c45c6866..00000000 Binary files a/setup/data/tools/bitmaps/console.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/ellipsis.bmp b/setup/data/tools/bitmaps/ellipsis.bmp deleted file mode 100644 index a4360a9e..00000000 Binary files a/setup/data/tools/bitmaps/ellipsis.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/entities.bmp b/setup/data/tools/bitmaps/entities.bmp deleted file mode 100644 index 47e9c249..00000000 Binary files a/setup/data/tools/bitmaps/entities.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/icon.bmp b/setup/data/tools/bitmaps/icon.bmp deleted file mode 100644 index e270952b..00000000 Binary files a/setup/data/tools/bitmaps/icon.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/lightinspector.bmp b/setup/data/tools/bitmaps/lightinspector.bmp deleted file mode 100644 index 00b00a90..00000000 Binary files a/setup/data/tools/bitmaps/lightinspector.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/modify_edges.bmp b/setup/data/tools/bitmaps/modify_edges.bmp deleted file mode 100644 index 620fd324..00000000 Binary files a/setup/data/tools/bitmaps/modify_edges.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/modify_faces.bmp b/setup/data/tools/bitmaps/modify_faces.bmp deleted file mode 100644 index 3eb3838d..00000000 Binary files a/setup/data/tools/bitmaps/modify_faces.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/modify_vertices.bmp b/setup/data/tools/bitmaps/modify_vertices.bmp deleted file mode 100644 index 6299b01e..00000000 Binary files a/setup/data/tools/bitmaps/modify_vertices.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/noFalloff.bmp b/setup/data/tools/bitmaps/noFalloff.bmp deleted file mode 100644 index e86d10c9..00000000 Binary files a/setup/data/tools/bitmaps/noFalloff.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/notex.bmp b/setup/data/tools/bitmaps/notex.bmp deleted file mode 100644 index b06664a7..00000000 Binary files a/setup/data/tools/bitmaps/notex.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/redo.bmp b/setup/data/tools/bitmaps/redo.bmp deleted file mode 100644 index acce54e4..00000000 Binary files a/setup/data/tools/bitmaps/redo.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/refresh_models.bmp b/setup/data/tools/bitmaps/refresh_models.bmp deleted file mode 100644 index a6a0aa5d..00000000 Binary files a/setup/data/tools/bitmaps/refresh_models.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/select_mouseresize.bmp b/setup/data/tools/bitmaps/select_mouseresize.bmp deleted file mode 100644 index 58da27f8..00000000 Binary files a/setup/data/tools/bitmaps/select_mouseresize.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/select_mousetranslate.bmp b/setup/data/tools/bitmaps/select_mousetranslate.bmp deleted file mode 100644 index 68374ffd..00000000 Binary files a/setup/data/tools/bitmaps/select_mousetranslate.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/shadernotex.bmp b/setup/data/tools/bitmaps/shadernotex.bmp deleted file mode 100644 index 6be415e7..00000000 Binary files a/setup/data/tools/bitmaps/shadernotex.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/texture_browser.bmp b/setup/data/tools/bitmaps/texture_browser.bmp deleted file mode 100644 index 40c0c2c5..00000000 Binary files a/setup/data/tools/bitmaps/texture_browser.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/texture_lock.bmp b/setup/data/tools/bitmaps/texture_lock.bmp deleted file mode 100644 index bcc77424..00000000 Binary files a/setup/data/tools/bitmaps/texture_lock.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/undo.bmp b/setup/data/tools/bitmaps/undo.bmp deleted file mode 100644 index 44edbbcd..00000000 Binary files a/setup/data/tools/bitmaps/undo.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/white.bmp b/setup/data/tools/bitmaps/white.bmp deleted file mode 100644 index cbf038f7..00000000 Binary files a/setup/data/tools/bitmaps/white.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/window1.bmp b/setup/data/tools/bitmaps/window1.bmp deleted file mode 100644 index 69444ae9..00000000 Binary files a/setup/data/tools/bitmaps/window1.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/window2.bmp b/setup/data/tools/bitmaps/window2.bmp deleted file mode 100644 index dd890d24..00000000 Binary files a/setup/data/tools/bitmaps/window2.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/window3.bmp b/setup/data/tools/bitmaps/window3.bmp deleted file mode 100644 index c65f2dbb..00000000 Binary files a/setup/data/tools/bitmaps/window3.bmp and /dev/null differ diff --git a/setup/data/tools/bitmaps/window4.bmp b/setup/data/tools/bitmaps/window4.bmp deleted file mode 100644 index 78563e17..00000000 Binary files a/setup/data/tools/bitmaps/window4.bmp and /dev/null differ diff --git a/setup/data/tools/gl/lighting_DBS_XY_Z_arbfp1.cg b/setup/data/tools/gl/lighting_DBS_XY_Z_arbfp1.cg deleted file mode 100644 index f535dbb2..00000000 --- a/setup/data/tools/gl/lighting_DBS_XY_Z_arbfp1.cg +++ /dev/null @@ -1,92 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "AUTHORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -#include "utils.cg" - -struct cg_vertex2fragment -{ - float4 position : TEXCOORD0; - float4 tex_diffuse_bump : TEXCOORD1; - float4 tex_specular : TEXCOORD2; - float4 tex_atten_xy_z : TEXCOORD3; - - float3 tangent : TEXCOORD4; - float3 binormal : TEXCOORD5; - float3 normal : TEXCOORD6; -}; - -struct cg_fragment2final -{ - float4 color : COLOR; -}; - - -cg_fragment2final main(cg_vertex2fragment IN, - uniform sampler2D diffusemap, - uniform sampler2D bumpmap, - uniform sampler2D specularmap, - uniform sampler2D attenuationmap_xy, - uniform sampler2D attenuationmap_z, - uniform float3 view_origin, - uniform float3 light_origin, - uniform float3 light_color, - uniform float bump_scale, - uniform float specular_exponent) -{ - cg_fragment2final OUT; - - // construct object-space-to-tangent-space 3x3 matrix - float3x3 rotation = float3x3(IN.tangent, IN.binormal, IN.normal); - - // compute view direction in tangent space - float3 V = normalize(mul(rotation, view_origin - IN.position.xyz)); - - // compute light direction in tangent space - float3 L = normalize(mul(rotation, (light_origin - IN.position.xyz))); - - // compute half angle in tangent space - float3 H = normalize(L + V); - - // compute normal in tangent space from bumpmap - float3 T = CG_Expand(tex2D(bumpmap, IN.tex_diffuse_bump.zw).xyz); - T.z *= bump_scale; - float3 N = normalize(T); - - // compute the diffuse term - float4 diffuse = tex2D(diffusemap, IN.tex_diffuse_bump.xy); - diffuse.rgb *= light_color * saturate(dot(N, L)); - - // compute the specular term - float3 specular = tex2D(specularmap, IN.tex_specular.xy).rgb * light_color * pow(saturate(dot(N, H)), specular_exponent); - - // compute attenuation - float3 attenuation_xy = tex2Dproj(attenuationmap_xy, float3(IN.tex_atten_xy_z.x, IN.tex_atten_xy_z.y, IN.tex_atten_xy_z.w)).rgb; - float3 attenuation_z = tex2D(attenuationmap_z, float2(IN.tex_atten_xy_z.z, 0)).rgb; - - // compute final color - OUT.color.rgba = diffuse; - OUT.color.rgb += specular; - OUT.color.rgb *= attenuation_xy; - OUT.color.rgb *= attenuation_z; - - return OUT; -} diff --git a/setup/data/tools/gl/lighting_DBS_XY_Z_arbvp1.cg b/setup/data/tools/gl/lighting_DBS_XY_Z_arbvp1.cg deleted file mode 100644 index 59a6fc73..00000000 --- a/setup/data/tools/gl/lighting_DBS_XY_Z_arbvp1.cg +++ /dev/null @@ -1,78 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "AUTHORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - - -struct cg_app2vertex -{ - float4 position : POSITION; - float4 tex0 : ATTR8; - - float3 tangent : ATTR9; - float3 binormal : ATTR10; - float3 normal : ATTR11; -}; - -struct cg_vertex2fragment -{ - float4 hposition : POSITION; - - float4 position : TEXCOORD0; - float4 tex_diffuse_bump : TEXCOORD1; - float4 tex_specular : TEXCOORD2; - float4 tex_atten_xy_z : TEXCOORD3; - - float3 tangent : TEXCOORD4; - float3 binormal : TEXCOORD5; - float3 normal : TEXCOORD6; -}; - - - -cg_vertex2fragment main(cg_app2vertex IN) -{ - cg_vertex2fragment OUT; - - // transform vertex position into homogenous clip-space - OUT.hposition = mul(glstate.matrix.mvp, IN.position); - - // assign position in object space - OUT.position = IN.position; - - // transform texcoords - OUT.tex_diffuse_bump.xy = mul(glstate.matrix.texture[0], IN.tex0).xy; - - // transform texcoords - OUT.tex_diffuse_bump.zw = mul(glstate.matrix.texture[1], IN.tex0).xy; - - // transform texcoords - OUT.tex_specular = mul(glstate.matrix.texture[2], IN.tex0); - - // transform vertex position into light space - OUT.tex_atten_xy_z = mul(glstate.matrix.texture[3], IN.position); - - // assign tangent space vectors - OUT.tangent = IN.tangent; - OUT.binormal = IN.binormal; - OUT.normal = IN.normal; - - return OUT; -} diff --git a/setup/data/tools/gl/lighting_DBS_omni_fp.glp b/setup/data/tools/gl/lighting_DBS_omni_fp.glp deleted file mode 100644 index 88dab8d3..00000000 --- a/setup/data/tools/gl/lighting_DBS_omni_fp.glp +++ /dev/null @@ -1,86 +0,0 @@ -!!ARBfp1.0 -# cgc version 1.3.0001, build date Aug 4 2004 10:01:10 -# command line args: -profile arbfp1 -# source file: ..\..\setup\data\tools\gl\lighting_DBS_XY_Z_arbfp1.cg -# source file: ..\..\setup\data\tools\gl/utils.cg -#vendor NVIDIA Corporation -#version 1.0.02 -#profile arbfp1 -#program main -#semantic main.diffusemap -#semantic main.bumpmap -#semantic main.specularmap -#semantic main.attenuationmap_xy -#semantic main.attenuationmap_z -#semantic main.view_origin -#semantic main.light_origin -#semantic main.light_color -#semantic main.bump_scale -#semantic main.specular_exponent -#var float4 IN.position : $vin.TEX0 : TEX0 : 0 : 1 -#var float4 IN.tex_diffuse_bump : $vin.TEX1 : TEX1 : 0 : 1 -#var float4 IN.tex_specular : $vin.TEX2 : TEX2 : 0 : 1 -#var float4 IN.tex_atten_xy_z : $vin.TEX3 : TEX3 : 0 : 1 -#var float3 IN.tangent : $vin.TEX4 : TEX4 : 0 : 1 -#var float3 IN.binormal : $vin.TEX5 : TEX5 : 0 : 1 -#var float3 IN.normal : $vin.TEX6 : TEX6 : 0 : 1 -#var sampler2D diffusemap : : texunit 0 : 1 : 1 -#var sampler2D bumpmap : : texunit 1 : 2 : 1 -#var sampler2D specularmap : : texunit 2 : 3 : 1 -#var sampler2D attenuationmap_xy : : texunit 3 : 4 : 1 -#var sampler2D attenuationmap_z : : texunit 4 : 5 : 1 -#var float3 view_origin : : c[4] : 6 : 1 -#var float3 light_origin : : c[2] : 7 : 1 -#var float3 light_color : : c[3] : 8 : 1 -#var float bump_scale : : c[1] : 9 : 1 -#var float specular_exponent : : c[5] : 10 : 1 -#var float4 main.color : $vout.COL : COL : -1 : 1 -#const c[0] = 0.5 2 0 -PARAM c[6] = { { 0.5, 2, 0 }, - program.local[1..5] }; -TEMP R0; -TEMP R1; -TEMP R2; -ADD R1.xyz, -fragment.texcoord[0], c[2]; -DP3 R0.z, fragment.texcoord[6], R1; -DP3 R0.x, fragment.texcoord[4], R1; -DP3 R0.y, fragment.texcoord[5], R1; -ADD R1.xyz, -fragment.texcoord[0], c[4]; -DP3 R0.w, R0, R0; -DP3 R2.z, fragment.texcoord[6], R1; -DP3 R2.x, fragment.texcoord[4], R1; -DP3 R2.y, fragment.texcoord[5], R1; -RSQ R0.w, R0.w; -MUL R1.xyz, R0.w, R0; -DP3 R1.w, R2, R2; -RSQ R0.w, R1.w; -MUL R2.xyz, R0.w, R2; -ADD R2.xyz, R1, R2; -DP3 R0.w, R2, R2; -RSQ R2.w, R0.w; -TEX R0.xyz, fragment.texcoord[1].zwzw, texture[1], 2D; -ADD R0.xyz, R0, -c[0].x; -MUL R0.xyz, R0, c[0].y; -MUL R0.z, R0, c[1].x; -DP3 R1.w, R0, R0; -RSQ R0.w, R1.w; -MUL R0.xyz, R0.w, R0; -MUL R2.xyz, R2.w, R2; -DP3_SAT R0.w, R0, R2; -DP3_SAT R0.x, R0, R1; -TEX R2.xyz, fragment.texcoord[2], texture[2], 2D; -MUL R1.xyz, R2, c[3]; -POW R0.w, R0.w, c[5].x; -MUL R2.xyz, R1, R0.w; -MUL R1.xyz, R0.x, c[3]; -TEX R0, fragment.texcoord[1], texture[0], 2D; -MAD R2.xyz, R0, R1, R2; -TXP R0.xyz, fragment.texcoord[3], texture[3], 2D; -MOV R1.y, c[0].z; -MOV R1.x, fragment.texcoord[3].z; -TEX R1.xyz, R1, texture[4], 2D; -MUL R0.xyz, R2, R0; -MUL result.color.xyz, R0, R1; -MOV result.color.w, R0; -END -# 41 instructions, 3 R-regs diff --git a/setup/data/tools/gl/lighting_DBS_omni_fp.glsl b/setup/data/tools/gl/lighting_DBS_omni_fp.glsl deleted file mode 100644 index 7f80fea2..00000000 --- a/setup/data/tools/gl/lighting_DBS_omni_fp.glsl +++ /dev/null @@ -1,73 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "CONTRIBUTORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -uniform sampler2D u_diffusemap; -uniform sampler2D u_bumpmap; -uniform sampler2D u_specularmap; -uniform sampler2D u_attenuationmap_xy; -uniform sampler2D u_attenuationmap_z; -uniform vec3 u_view_origin; -uniform vec3 u_light_origin; -uniform vec3 u_light_color; -uniform float u_bump_scale; -uniform float u_specular_exponent; - -varying vec3 var_vertex; -varying vec4 var_tex_diffuse_bump; -varying vec2 var_tex_specular; -varying vec4 var_tex_atten_xy_z; -varying mat3 var_mat_os2ts; - -void main() -{ - // compute view direction in tangent space - vec3 V = normalize(var_mat_os2ts * (u_view_origin - var_vertex)); - - // compute light direction in tangent space - vec3 L = normalize(var_mat_os2ts * (u_light_origin - var_vertex)); - - // compute half angle in tangent space - vec3 H = normalize(L + V); - - // compute normal in tangent space from bumpmap - vec3 N = 2.0 * (texture2D(u_bumpmap, var_tex_diffuse_bump.pq).xyz - 0.5); - N.z *= u_bump_scale; - N = normalize(N); - - // compute the diffuse term - vec4 diffuse = texture2D(u_diffusemap, var_tex_diffuse_bump.st); - diffuse.rgb *= u_light_color * clamp(dot(N, L), 0.0, 1.0); - - // compute the specular term - vec3 specular = texture2D(u_specularmap, var_tex_specular).rgb * u_light_color * pow(clamp(dot(N, H), 0.0, 1.0), u_specular_exponent); - - // compute attenuation - vec3 attenuation_xy = texture2DProj(u_attenuationmap_xy, vec3(var_tex_atten_xy_z.x, var_tex_atten_xy_z.y, var_tex_atten_xy_z.w)).rgb; - vec3 attenuation_z = texture2D(u_attenuationmap_z, vec2(var_tex_atten_xy_z.z, 0)).rgb; - - // compute final color - gl_FragColor.rgba = diffuse; - gl_FragColor.rgb += specular; - gl_FragColor.rgb *= attenuation_xy; - gl_FragColor.rgb *= attenuation_z; -} - diff --git a/setup/data/tools/gl/lighting_DBS_omni_vp.glp b/setup/data/tools/gl/lighting_DBS_omni_vp.glp deleted file mode 100644 index b4472d70..00000000 --- a/setup/data/tools/gl/lighting_DBS_omni_vp.glp +++ /dev/null @@ -1,410 +0,0 @@ -!!ARBvp1.0 -# cgc version 1.3.0001, build date Aug 4 2004 10:01:10 -# command line args: -profile arbvp1 -# source file: ..\..\setup\data\tools\gl\lighting_DBS_XY_Z_arbvp1.cg -#vendor NVIDIA Corporation -#version 1.0.02 -#profile arbvp1 -#program main -#semantic glstate : STATE -#var float4 glstate.material.ambient : STATE.MATERIAL.AMBIENT : : -1 : 0 -#var float4 glstate.material.diffuse : STATE.MATERIAL.DIFFUSE : : -1 : 0 -#var float4 glstate.material.specular : STATE.MATERIAL.SPECULAR : : -1 : 0 -#var float4 glstate.material.emission : STATE.MATERIAL.EMISSION : : -1 : 0 -#var float4 glstate.material.shininess : STATE.MATERIAL.SHININESS : : -1 : 0 -#var float4 glstate.material.front.ambient : STATE.MATERIAL.FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.material.front.diffuse : STATE.MATERIAL.FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.material.front.specular : STATE.MATERIAL.FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.material.front.emission : STATE.MATERIAL.FRONT.EMISSION : : -1 : 0 -#var float4 glstate.material.front.shininess : STATE.MATERIAL.FRONT.SHININESS : : -1 : 0 -#var float4 glstate.material.back.ambient : STATE.MATERIAL.BACK.AMBIENT : : -1 : 0 -#var float4 glstate.material.back.diffuse : STATE.MATERIAL.BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.material.back.specular : STATE.MATERIAL.BACK.SPECULAR : : -1 : 0 -#var float4 glstate.material.back.emission : STATE.MATERIAL.BACK.EMISSION : : -1 : 0 -#var float4 glstate.material.back.shininess : STATE.MATERIAL.BACK.SHININESS : : -1 : 0 -#var float4 glstate.light[0].ambient : STATE.LIGHT[0].AMBIENT : : -1 : 0 -#var float4 glstate.light[0].diffuse : STATE.LIGHT[0].DIFFUSE : : -1 : 0 -#var float4 glstate.light[0].specular : STATE.LIGHT[0].SPECULAR : : -1 : 0 -#var float4 glstate.light[0].position : STATE.LIGHT[0].POSITION : : -1 : 0 -#var float4 glstate.light[0].attenuation : STATE.LIGHT[0].ATTENUATION : : -1 : 0 -#var float4 glstate.light[0].spot.direction : STATE.LIGHT[0].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[0].half : STATE.LIGHT[0].HALF : : -1 : 0 -#var float4 glstate.light[1].ambient : STATE.LIGHT[1].AMBIENT : : -1 : 0 -#var float4 glstate.light[1].diffuse : STATE.LIGHT[1].DIFFUSE : : -1 : 0 -#var float4 glstate.light[1].specular : STATE.LIGHT[1].SPECULAR : : -1 : 0 -#var float4 glstate.light[1].position : STATE.LIGHT[1].POSITION : : -1 : 0 -#var float4 glstate.light[1].attenuation : STATE.LIGHT[1].ATTENUATION : : -1 : 0 -#var float4 glstate.light[1].spot.direction : STATE.LIGHT[1].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[1].half : STATE.LIGHT[1].HALF : : -1 : 0 -#var float4 glstate.light[2].ambient : STATE.LIGHT[2].AMBIENT : : -1 : 0 -#var float4 glstate.light[2].diffuse : STATE.LIGHT[2].DIFFUSE : : -1 : 0 -#var float4 glstate.light[2].specular : STATE.LIGHT[2].SPECULAR : : -1 : 0 -#var float4 glstate.light[2].position : STATE.LIGHT[2].POSITION : : -1 : 0 -#var float4 glstate.light[2].attenuation : STATE.LIGHT[2].ATTENUATION : : -1 : 0 -#var float4 glstate.light[2].spot.direction : STATE.LIGHT[2].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[2].half : STATE.LIGHT[2].HALF : : -1 : 0 -#var float4 glstate.light[3].ambient : STATE.LIGHT[3].AMBIENT : : -1 : 0 -#var float4 glstate.light[3].diffuse : STATE.LIGHT[3].DIFFUSE : : -1 : 0 -#var float4 glstate.light[3].specular : STATE.LIGHT[3].SPECULAR : : -1 : 0 -#var float4 glstate.light[3].position : STATE.LIGHT[3].POSITION : : -1 : 0 -#var float4 glstate.light[3].attenuation : STATE.LIGHT[3].ATTENUATION : : -1 : 0 -#var float4 glstate.light[3].spot.direction : STATE.LIGHT[3].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[3].half : STATE.LIGHT[3].HALF : : -1 : 0 -#var float4 glstate.light[4].ambient : STATE.LIGHT[4].AMBIENT : : -1 : 0 -#var float4 glstate.light[4].diffuse : STATE.LIGHT[4].DIFFUSE : : -1 : 0 -#var float4 glstate.light[4].specular : STATE.LIGHT[4].SPECULAR : : -1 : 0 -#var float4 glstate.light[4].position : STATE.LIGHT[4].POSITION : : -1 : 0 -#var float4 glstate.light[4].attenuation : STATE.LIGHT[4].ATTENUATION : : -1 : 0 -#var float4 glstate.light[4].spot.direction : STATE.LIGHT[4].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[4].half : STATE.LIGHT[4].HALF : : -1 : 0 -#var float4 glstate.light[5].ambient : STATE.LIGHT[5].AMBIENT : : -1 : 0 -#var float4 glstate.light[5].diffuse : STATE.LIGHT[5].DIFFUSE : : -1 : 0 -#var float4 glstate.light[5].specular : STATE.LIGHT[5].SPECULAR : : -1 : 0 -#var float4 glstate.light[5].position : STATE.LIGHT[5].POSITION : : -1 : 0 -#var float4 glstate.light[5].attenuation : STATE.LIGHT[5].ATTENUATION : : -1 : 0 -#var float4 glstate.light[5].spot.direction : STATE.LIGHT[5].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[5].half : STATE.LIGHT[5].HALF : : -1 : 0 -#var float4 glstate.light[6].ambient : STATE.LIGHT[6].AMBIENT : : -1 : 0 -#var float4 glstate.light[6].diffuse : STATE.LIGHT[6].DIFFUSE : : -1 : 0 -#var float4 glstate.light[6].specular : STATE.LIGHT[6].SPECULAR : : -1 : 0 -#var float4 glstate.light[6].position : STATE.LIGHT[6].POSITION : : -1 : 0 -#var float4 glstate.light[6].attenuation : STATE.LIGHT[6].ATTENUATION : : -1 : 0 -#var float4 glstate.light[6].spot.direction : STATE.LIGHT[6].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[6].half : STATE.LIGHT[6].HALF : : -1 : 0 -#var float4 glstate.light[7].ambient : STATE.LIGHT[7].AMBIENT : : -1 : 0 -#var float4 glstate.light[7].diffuse : STATE.LIGHT[7].DIFFUSE : : -1 : 0 -#var float4 glstate.light[7].specular : STATE.LIGHT[7].SPECULAR : : -1 : 0 -#var float4 glstate.light[7].position : STATE.LIGHT[7].POSITION : : -1 : 0 -#var float4 glstate.light[7].attenuation : STATE.LIGHT[7].ATTENUATION : : -1 : 0 -#var float4 glstate.light[7].spot.direction : STATE.LIGHT[7].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[7].half : STATE.LIGHT[7].HALF : : -1 : 0 -#var float4 glstate.lightmodel.ambient : STATE.LIGHTMODEL.AMBIENT : : -1 : 0 -#var float4 glstate.lightmodel.scenecolor : STATE.LIGHTMODEL.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightmodel.front.scenecolor : STATE.LIGHTMODEL.FRONT.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightmodel.back.scenecolor : STATE.LIGHTMODEL.BACK.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightprod[0].ambient : STATE.LIGHTPROD[0].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].diffuse : STATE.LIGHTPROD[0].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].specular : STATE.LIGHTPROD[0].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[0].front.ambient : STATE.LIGHTPROD[0].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].front.diffuse : STATE.LIGHTPROD[0].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].front.specular : STATE.LIGHTPROD[0].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[0].back.ambient : STATE.LIGHTPROD[0].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].back.diffuse : STATE.LIGHTPROD[0].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].back.specular : STATE.LIGHTPROD[0].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].ambient : STATE.LIGHTPROD[1].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].diffuse : STATE.LIGHTPROD[1].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].specular : STATE.LIGHTPROD[1].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].front.ambient : STATE.LIGHTPROD[1].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].front.diffuse : STATE.LIGHTPROD[1].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].front.specular : STATE.LIGHTPROD[1].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].back.ambient : STATE.LIGHTPROD[1].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].back.diffuse : STATE.LIGHTPROD[1].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].back.specular : STATE.LIGHTPROD[1].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].ambient : STATE.LIGHTPROD[2].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].diffuse : STATE.LIGHTPROD[2].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].specular : STATE.LIGHTPROD[2].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].front.ambient : STATE.LIGHTPROD[2].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].front.diffuse : STATE.LIGHTPROD[2].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].front.specular : STATE.LIGHTPROD[2].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].back.ambient : STATE.LIGHTPROD[2].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].back.diffuse : STATE.LIGHTPROD[2].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].back.specular : STATE.LIGHTPROD[2].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].ambient : STATE.LIGHTPROD[3].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].diffuse : STATE.LIGHTPROD[3].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].specular : STATE.LIGHTPROD[3].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].front.ambient : STATE.LIGHTPROD[3].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].front.diffuse : STATE.LIGHTPROD[3].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].front.specular : STATE.LIGHTPROD[3].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].back.ambient : STATE.LIGHTPROD[3].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].back.diffuse : STATE.LIGHTPROD[3].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].back.specular : STATE.LIGHTPROD[3].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].ambient : STATE.LIGHTPROD[4].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].diffuse : STATE.LIGHTPROD[4].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].specular : STATE.LIGHTPROD[4].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].front.ambient : STATE.LIGHTPROD[4].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].front.diffuse : STATE.LIGHTPROD[4].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].front.specular : STATE.LIGHTPROD[4].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].back.ambient : STATE.LIGHTPROD[4].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].back.diffuse : STATE.LIGHTPROD[4].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].back.specular : STATE.LIGHTPROD[4].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].ambient : STATE.LIGHTPROD[5].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].diffuse : STATE.LIGHTPROD[5].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].specular : STATE.LIGHTPROD[5].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].front.ambient : STATE.LIGHTPROD[5].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].front.diffuse : STATE.LIGHTPROD[5].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].front.specular : STATE.LIGHTPROD[5].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].back.ambient : STATE.LIGHTPROD[5].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].back.diffuse : STATE.LIGHTPROD[5].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].back.specular : STATE.LIGHTPROD[5].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].ambient : STATE.LIGHTPROD[6].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].diffuse : STATE.LIGHTPROD[6].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].specular : STATE.LIGHTPROD[6].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].front.ambient : STATE.LIGHTPROD[6].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].front.diffuse : STATE.LIGHTPROD[6].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].front.specular : STATE.LIGHTPROD[6].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].back.ambient : STATE.LIGHTPROD[6].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].back.diffuse : STATE.LIGHTPROD[6].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].back.specular : STATE.LIGHTPROD[6].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].ambient : STATE.LIGHTPROD[7].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].diffuse : STATE.LIGHTPROD[7].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].specular : STATE.LIGHTPROD[7].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].front.ambient : STATE.LIGHTPROD[7].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].front.diffuse : STATE.LIGHTPROD[7].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].front.specular : STATE.LIGHTPROD[7].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].back.ambient : STATE.LIGHTPROD[7].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].back.diffuse : STATE.LIGHTPROD[7].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].back.specular : STATE.LIGHTPROD[7].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.texgen[0].eye.s : STATE.TEXGEN[0].EYE.S : : -1 : 0 -#var float4 glstate.texgen[0].eye.t : STATE.TEXGEN[0].EYE.T : : -1 : 0 -#var float4 glstate.texgen[0].eye.r : STATE.TEXGEN[0].EYE.R : : -1 : 0 -#var float4 glstate.texgen[0].eye.q : STATE.TEXGEN[0].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[0].object.s : STATE.TEXGEN[0].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[0].object.t : STATE.TEXGEN[0].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[0].object.r : STATE.TEXGEN[0].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[0].object.q : STATE.TEXGEN[0].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[1].eye.s : STATE.TEXGEN[1].EYE.S : : -1 : 0 -#var float4 glstate.texgen[1].eye.t : STATE.TEXGEN[1].EYE.T : : -1 : 0 -#var float4 glstate.texgen[1].eye.r : STATE.TEXGEN[1].EYE.R : : -1 : 0 -#var float4 glstate.texgen[1].eye.q : STATE.TEXGEN[1].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[1].object.s : STATE.TEXGEN[1].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[1].object.t : STATE.TEXGEN[1].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[1].object.r : STATE.TEXGEN[1].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[1].object.q : STATE.TEXGEN[1].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[2].eye.s : STATE.TEXGEN[2].EYE.S : : -1 : 0 -#var float4 glstate.texgen[2].eye.t : STATE.TEXGEN[2].EYE.T : : -1 : 0 -#var float4 glstate.texgen[2].eye.r : STATE.TEXGEN[2].EYE.R : : -1 : 0 -#var float4 glstate.texgen[2].eye.q : STATE.TEXGEN[2].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[2].object.s : STATE.TEXGEN[2].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[2].object.t : STATE.TEXGEN[2].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[2].object.r : STATE.TEXGEN[2].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[2].object.q : STATE.TEXGEN[2].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[3].eye.s : STATE.TEXGEN[3].EYE.S : : -1 : 0 -#var float4 glstate.texgen[3].eye.t : STATE.TEXGEN[3].EYE.T : : -1 : 0 -#var float4 glstate.texgen[3].eye.r : STATE.TEXGEN[3].EYE.R : : -1 : 0 -#var float4 glstate.texgen[3].eye.q : STATE.TEXGEN[3].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[3].object.s : STATE.TEXGEN[3].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[3].object.t : STATE.TEXGEN[3].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[3].object.r : STATE.TEXGEN[3].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[3].object.q : STATE.TEXGEN[3].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[4].eye.s : STATE.TEXGEN[4].EYE.S : : -1 : 0 -#var float4 glstate.texgen[4].eye.t : STATE.TEXGEN[4].EYE.T : : -1 : 0 -#var float4 glstate.texgen[4].eye.r : STATE.TEXGEN[4].EYE.R : : -1 : 0 -#var float4 glstate.texgen[4].eye.q : STATE.TEXGEN[4].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[4].object.s : STATE.TEXGEN[4].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[4].object.t : STATE.TEXGEN[4].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[4].object.r : STATE.TEXGEN[4].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[4].object.q : STATE.TEXGEN[4].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[5].eye.s : STATE.TEXGEN[5].EYE.S : : -1 : 0 -#var float4 glstate.texgen[5].eye.t : STATE.TEXGEN[5].EYE.T : : -1 : 0 -#var float4 glstate.texgen[5].eye.r : STATE.TEXGEN[5].EYE.R : : -1 : 0 -#var float4 glstate.texgen[5].eye.q : STATE.TEXGEN[5].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[5].object.s : STATE.TEXGEN[5].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[5].object.t : STATE.TEXGEN[5].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[5].object.r : STATE.TEXGEN[5].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[5].object.q : STATE.TEXGEN[5].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[6].eye.s : STATE.TEXGEN[6].EYE.S : : -1 : 0 -#var float4 glstate.texgen[6].eye.t : STATE.TEXGEN[6].EYE.T : : -1 : 0 -#var float4 glstate.texgen[6].eye.r : STATE.TEXGEN[6].EYE.R : : -1 : 0 -#var float4 glstate.texgen[6].eye.q : STATE.TEXGEN[6].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[6].object.s : STATE.TEXGEN[6].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[6].object.t : STATE.TEXGEN[6].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[6].object.r : STATE.TEXGEN[6].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[6].object.q : STATE.TEXGEN[6].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[7].eye.s : STATE.TEXGEN[7].EYE.S : : -1 : 0 -#var float4 glstate.texgen[7].eye.t : STATE.TEXGEN[7].EYE.T : : -1 : 0 -#var float4 glstate.texgen[7].eye.r : STATE.TEXGEN[7].EYE.R : : -1 : 0 -#var float4 glstate.texgen[7].eye.q : STATE.TEXGEN[7].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[7].object.s : STATE.TEXGEN[7].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[7].object.t : STATE.TEXGEN[7].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[7].object.r : STATE.TEXGEN[7].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[7].object.q : STATE.TEXGEN[7].OBJECT.Q : : -1 : 0 -#var float4 glstate.fog.color : STATE.FOG.COLOR : : -1 : 0 -#var float4 glstate.fog.params : STATE.FOG.PARAMS : : -1 : 0 -#var float4 glstate.clip[0].plane : STATE.CLIP[0].PLANE : : -1 : 0 -#var float4 glstate.clip[1].plane : STATE.CLIP[1].PLANE : : -1 : 0 -#var float4 glstate.clip[2].plane : STATE.CLIP[2].PLANE : : -1 : 0 -#var float4 glstate.clip[3].plane : STATE.CLIP[3].PLANE : : -1 : 0 -#var float4 glstate.clip[4].plane : STATE.CLIP[4].PLANE : : -1 : 0 -#var float4 glstate.clip[5].plane : STATE.CLIP[5].PLANE : : -1 : 0 -#var float4 glstate.clip[6].plane : STATE.CLIP[6].PLANE : : -1 : 0 -#var float4 glstate.clip[7].plane : STATE.CLIP[7].PLANE : : -1 : 0 -#var float glstate.point.size : STATE.POINT.SIZE : : -1 : 0 -#var float glstate.point.attenuation : STATE.POINT.ATTENUATION : : -1 : 0 -#var float4x4 glstate.matrix.modelview[0] : STATE.MATRIX.MODELVIEW[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[1] : STATE.MATRIX.MODELVIEW[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[2] : STATE.MATRIX.MODELVIEW[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[3] : STATE.MATRIX.MODELVIEW[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[4] : STATE.MATRIX.MODELVIEW[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[5] : STATE.MATRIX.MODELVIEW[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[6] : STATE.MATRIX.MODELVIEW[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[7] : STATE.MATRIX.MODELVIEW[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.projection : STATE.MATRIX.PROJECTION : , 4 : -1 : 0 -#var float4x4 glstate.matrix.mvp : STATE.MATRIX.MVP : c[0], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[0] : STATE.MATRIX.TEXTURE[0] : c[4], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[1] : STATE.MATRIX.TEXTURE[1] : c[8], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[2] : STATE.MATRIX.TEXTURE[2] : c[12], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[3] : STATE.MATRIX.TEXTURE[3] : c[16], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[4] : STATE.MATRIX.TEXTURE[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[5] : STATE.MATRIX.TEXTURE[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[6] : STATE.MATRIX.TEXTURE[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[7] : STATE.MATRIX.TEXTURE[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[0] : STATE.MATRIX.PALETTE[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[1] : STATE.MATRIX.PALETTE[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[2] : STATE.MATRIX.PALETTE[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[3] : STATE.MATRIX.PALETTE[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[4] : STATE.MATRIX.PALETTE[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[5] : STATE.MATRIX.PALETTE[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[6] : STATE.MATRIX.PALETTE[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[7] : STATE.MATRIX.PALETTE[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[0] : STATE.MATRIX.PROGRAM[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[1] : STATE.MATRIX.PROGRAM[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[2] : STATE.MATRIX.PROGRAM[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[3] : STATE.MATRIX.PROGRAM[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[4] : STATE.MATRIX.PROGRAM[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[5] : STATE.MATRIX.PROGRAM[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[6] : STATE.MATRIX.PROGRAM[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[7] : STATE.MATRIX.PROGRAM[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[0] : STATE.MATRIX.MODELVIEW[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[1] : STATE.MATRIX.MODELVIEW[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[2] : STATE.MATRIX.MODELVIEW[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[3] : STATE.MATRIX.MODELVIEW[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[4] : STATE.MATRIX.MODELVIEW[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[5] : STATE.MATRIX.MODELVIEW[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[6] : STATE.MATRIX.MODELVIEW[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[7] : STATE.MATRIX.MODELVIEW[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.projection : STATE.MATRIX.PROJECTION.INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.mvp : STATE.MATRIX.MVP.INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[0] : STATE.MATRIX.TEXTURE[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[1] : STATE.MATRIX.TEXTURE[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[2] : STATE.MATRIX.TEXTURE[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[3] : STATE.MATRIX.TEXTURE[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[4] : STATE.MATRIX.TEXTURE[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[5] : STATE.MATRIX.TEXTURE[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[6] : STATE.MATRIX.TEXTURE[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[7] : STATE.MATRIX.TEXTURE[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[0] : STATE.MATRIX.PALETTE[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[1] : STATE.MATRIX.PALETTE[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[2] : STATE.MATRIX.PALETTE[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[3] : STATE.MATRIX.PALETTE[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[4] : STATE.MATRIX.PALETTE[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[5] : STATE.MATRIX.PALETTE[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[6] : STATE.MATRIX.PALETTE[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[7] : STATE.MATRIX.PALETTE[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[0] : STATE.MATRIX.PROGRAM[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[1] : STATE.MATRIX.PROGRAM[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[2] : STATE.MATRIX.PROGRAM[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[3] : STATE.MATRIX.PROGRAM[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[4] : STATE.MATRIX.PROGRAM[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[5] : STATE.MATRIX.PROGRAM[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[6] : STATE.MATRIX.PROGRAM[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[7] : STATE.MATRIX.PROGRAM[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[0] : STATE.MATRIX.MODELVIEW[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[1] : STATE.MATRIX.MODELVIEW[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[2] : STATE.MATRIX.MODELVIEW[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[3] : STATE.MATRIX.MODELVIEW[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[4] : STATE.MATRIX.MODELVIEW[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[5] : STATE.MATRIX.MODELVIEW[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[6] : STATE.MATRIX.MODELVIEW[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[7] : STATE.MATRIX.MODELVIEW[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.projection : STATE.MATRIX.PROJECTION.TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.mvp : STATE.MATRIX.MVP.TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[0] : STATE.MATRIX.TEXTURE[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[1] : STATE.MATRIX.TEXTURE[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[2] : STATE.MATRIX.TEXTURE[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[3] : STATE.MATRIX.TEXTURE[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[4] : STATE.MATRIX.TEXTURE[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[5] : STATE.MATRIX.TEXTURE[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[6] : STATE.MATRIX.TEXTURE[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[7] : STATE.MATRIX.TEXTURE[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[0] : STATE.MATRIX.PALETTE[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[1] : STATE.MATRIX.PALETTE[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[2] : STATE.MATRIX.PALETTE[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[3] : STATE.MATRIX.PALETTE[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[4] : STATE.MATRIX.PALETTE[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[5] : STATE.MATRIX.PALETTE[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[6] : STATE.MATRIX.PALETTE[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[7] : STATE.MATRIX.PALETTE[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[0] : STATE.MATRIX.PROGRAM[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[1] : STATE.MATRIX.PROGRAM[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[2] : STATE.MATRIX.PROGRAM[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[3] : STATE.MATRIX.PROGRAM[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[4] : STATE.MATRIX.PROGRAM[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[5] : STATE.MATRIX.PROGRAM[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[6] : STATE.MATRIX.PROGRAM[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[7] : STATE.MATRIX.PROGRAM[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[0] : STATE.MATRIX.MODELVIEW[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[1] : STATE.MATRIX.MODELVIEW[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[2] : STATE.MATRIX.MODELVIEW[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[3] : STATE.MATRIX.MODELVIEW[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[4] : STATE.MATRIX.MODELVIEW[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[5] : STATE.MATRIX.MODELVIEW[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[6] : STATE.MATRIX.MODELVIEW[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[7] : STATE.MATRIX.MODELVIEW[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.projection : STATE.MATRIX.PROJECTION.INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.mvp : STATE.MATRIX.MVP.INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[0] : STATE.MATRIX.TEXTURE[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[1] : STATE.MATRIX.TEXTURE[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[2] : STATE.MATRIX.TEXTURE[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[3] : STATE.MATRIX.TEXTURE[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[4] : STATE.MATRIX.TEXTURE[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[5] : STATE.MATRIX.TEXTURE[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[6] : STATE.MATRIX.TEXTURE[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[7] : STATE.MATRIX.TEXTURE[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[0] : STATE.MATRIX.PALETTE[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[1] : STATE.MATRIX.PALETTE[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[2] : STATE.MATRIX.PALETTE[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[3] : STATE.MATRIX.PALETTE[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[4] : STATE.MATRIX.PALETTE[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[5] : STATE.MATRIX.PALETTE[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[6] : STATE.MATRIX.PALETTE[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[7] : STATE.MATRIX.PALETTE[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[0] : STATE.MATRIX.PROGRAM[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[1] : STATE.MATRIX.PROGRAM[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[2] : STATE.MATRIX.PROGRAM[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[3] : STATE.MATRIX.PROGRAM[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[4] : STATE.MATRIX.PROGRAM[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[5] : STATE.MATRIX.PROGRAM[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[6] : STATE.MATRIX.PROGRAM[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[7] : STATE.MATRIX.PROGRAM[7].INVTRANS : , 4 : -1 : 0 -#var float4 IN.position : $vin.POSITION : POSITION : 0 : 1 -#var float4 IN.tex0 : $vin.ATTR8 : ATTR8 : 0 : 1 -#var float3 IN.tangent : $vin.ATTR9 : ATTR9 : 0 : 1 -#var float3 IN.binormal : $vin.ATTR10 : ATTR10 : 0 : 1 -#var float3 IN.normal : $vin.ATTR11 : ATTR11 : 0 : 1 -#var float4 main.hposition : $vout.HPOS : HPOS : -1 : 1 -#var float4 main.position : $vout.TEX0 : TEX0 : -1 : 1 -#var float4 main.tex_diffuse_bump : $vout.TEX1 : TEX1 : -1 : 1 -#var float4 main.tex_specular : $vout.TEX2 : TEX2 : -1 : 1 -#var float4 main.tex_atten_xy_z : $vout.TEX3 : TEX3 : -1 : 1 -#var float3 main.tangent : $vout.TEX4 : TEX4 : -1 : 1 -#var float3 main.binormal : $vout.TEX5 : TEX5 : -1 : 1 -#var float3 main.normal : $vout.TEX6 : TEX6 : -1 : 1 -PARAM c[20] = { state.matrix.mvp, - state.matrix.texture[0], - state.matrix.texture[1], - state.matrix.texture[2], - state.matrix.texture[3] }; -TEMP R0; -DP4 result.position.w, vertex.position, c[3]; -DP4 result.position.z, vertex.position, c[2]; -DP4 result.position.y, vertex.position, c[1]; -DP4 result.position.x, vertex.position, c[0]; -DP4 R0.y, vertex.attrib[8], c[9]; -DP4 R0.x, vertex.attrib[8], c[8]; -MOV result.texcoord[0], vertex.position; -MOV result.texcoord[1].zw, R0.xyxy; -DP4 result.texcoord[1].y, vertex.attrib[8], c[5]; -DP4 result.texcoord[1].x, vertex.attrib[8], c[4]; -DP4 result.texcoord[2].w, vertex.attrib[8], c[15]; -DP4 result.texcoord[2].z, vertex.attrib[8], c[14]; -DP4 result.texcoord[2].y, vertex.attrib[8], c[13]; -DP4 result.texcoord[2].x, vertex.attrib[8], c[12]; -DP4 result.texcoord[3].w, vertex.position, c[19]; -DP4 result.texcoord[3].z, vertex.position, c[18]; -DP4 result.texcoord[3].y, vertex.position, c[17]; -DP4 result.texcoord[3].x, vertex.position, c[16]; -MOV result.texcoord[4].xyz, vertex.attrib[9]; -MOV result.texcoord[5].xyz, vertex.attrib[10]; -MOV result.texcoord[6].xyz, vertex.attrib[11]; -END -# 21 instructions, 1 R-regs diff --git a/setup/data/tools/gl/lighting_DBS_omni_vp.glsl b/setup/data/tools/gl/lighting_DBS_omni_vp.glsl deleted file mode 100644 index 6900b5af..00000000 --- a/setup/data/tools/gl/lighting_DBS_omni_vp.glsl +++ /dev/null @@ -1,58 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "CONTRIBUTORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -attribute vec4 attr_TexCoord0; -attribute vec3 attr_Tangent; -attribute vec3 attr_Binormal; - -varying vec3 var_vertex; -varying vec4 var_tex_diffuse_bump; -varying vec2 var_tex_specular; -varying vec4 var_tex_atten_xy_z; -varying mat3 var_mat_os2ts; - -void main() -{ - // transform vertex position into homogenous clip-space - gl_Position = ftransform(); - - // assign position in object space - var_vertex = gl_Vertex.xyz; - - // transform texcoords into diffusemap texture space - var_tex_diffuse_bump.st = (gl_TextureMatrix[0] * attr_TexCoord0).st; - - // transform texcoords into bumpmap texture space - var_tex_diffuse_bump.pq = (gl_TextureMatrix[1] * attr_TexCoord0).st; - - // transform texcoords into specularmap texture space - var_tex_specular = (gl_TextureMatrix[2] * attr_TexCoord0).st; - - // calc light xy,z attenuation in light space - var_tex_atten_xy_z = gl_TextureMatrix[3] * gl_Vertex; - - - // construct object-space-to-tangent-space 3x3 matrix - var_mat_os2ts = mat3( attr_Tangent.x, attr_Binormal.x, gl_Normal.x, - attr_Tangent.y, attr_Binormal.y, gl_Normal.y, - attr_Tangent.z, attr_Binormal.z, gl_Normal.z ); -} diff --git a/setup/data/tools/gl/utils.cg b/setup/data/tools/gl/utils.cg deleted file mode 100644 index 63bfcb6c..00000000 --- a/setup/data/tools/gl/utils.cg +++ /dev/null @@ -1,36 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "AUTHORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -// fresnel approximation -float fast_fresnel(float3 I, float3 N, float3 fresnel_values) -{ - float power = fresnel_values.x; - float scale = fresnel_values.y; - float bias = fresnel_values.z; - - return bias + pow(1.0 - dot(I, N), power) * scale; -} - -float3 CG_Expand(float3 v) -{ - return (v - 0.5) * 2; // expand a range-compressed vector -} diff --git a/setup/data/tools/gl/zfill_arbfp1.cg b/setup/data/tools/gl/zfill_arbfp1.cg deleted file mode 100644 index c80189c2..00000000 --- a/setup/data/tools/gl/zfill_arbfp1.cg +++ /dev/null @@ -1,47 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2003 Robert Beckebans -Copyright (C) 2003, 2004 contributors of the XreaL project -Please see the file "AUTHORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - - -struct cg_vertex2fragment -{ - float4 position : POSITION; - float4 tex0 : TEXCOORD0; -}; - -struct cg_fragment2final -{ - float4 color : COLOR; -}; - - -cg_fragment2final main(in cg_vertex2fragment IN, - uniform sampler2D colormap) -{ - cg_fragment2final OUT; - - OUT.color.w = tex2D(colormap, IN.tex0.xy).a; - - OUT.color.xyz = 0; - - return OUT; -} diff --git a/setup/data/tools/gl/zfill_arbvp1.cg b/setup/data/tools/gl/zfill_arbvp1.cg deleted file mode 100644 index 4ffc6e27..00000000 --- a/setup/data/tools/gl/zfill_arbvp1.cg +++ /dev/null @@ -1,49 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2003 Robert Beckebans -Copyright (C) 2003, 2004 contributors of the XreaL project -Please see the file "AUTHORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - - -struct cg_app2vertex -{ - float4 position : ATTR0; - float4 texcoord0 : ATTR8; -}; - -struct cg_vertex2fragment -{ - float4 position : POSITION; - float4 tex0 : TEXCOORD0; -}; - - -cg_vertex2fragment main(cg_app2vertex IN) -{ - cg_vertex2fragment OUT; - - // transform vertex position into homogenous clip-space - OUT.position = mul(glstate.matrix.mvp, IN.position); - - // transform texcoords into 1st texture space - OUT.tex0 = mul(glstate.matrix.texture[0], IN.texcoord0); - - return OUT; -} diff --git a/setup/data/tools/gl/zfill_fp.glp b/setup/data/tools/gl/zfill_fp.glp deleted file mode 100644 index 5eb8b129..00000000 --- a/setup/data/tools/gl/zfill_fp.glp +++ /dev/null @@ -1,19 +0,0 @@ -!!ARBfp1.0 -# cgc version 1.3.0001, build date Aug 4 2004 10:01:10 -# command line args: -profile arbfp1 -# source file: ..\..\setup\data\tools\gl\zfill_arbfp1.cg -#vendor NVIDIA Corporation -#version 1.0.02 -#profile arbfp1 -#program main -#semantic main.colormap -#var float4 IN.position : : : 0 : 0 -#var float4 IN.tex0 : $vin.TEX0 : TEX0 : 0 : 1 -#var sampler2D colormap : : texunit 0 : 1 : 1 -#var float4 main.color : $vout.COL : COL : -1 : 1 -#const c[0] = 0 -PARAM c[1] = { { 0 } }; -MOV result.color.xyz, c[0].x; -TEX result.color.w, fragment.texcoord[0], texture[0], 2D; -END -# 2 instructions, 0 R-regs diff --git a/setup/data/tools/gl/zfill_fp.glsl b/setup/data/tools/gl/zfill_fp.glsl deleted file mode 100644 index 537db670..00000000 --- a/setup/data/tools/gl/zfill_fp.glsl +++ /dev/null @@ -1,29 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "CONTRIBUTORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -uniform sampler2D u_colormap; - -void main() -{ - gl_FragColor.a = texture2D(u_colormap, gl_TexCoord[0].st).a; - gl_FragColor.rgb = vec3(0.0, 0.0, 0.0); -} diff --git a/setup/data/tools/gl/zfill_vp.glp b/setup/data/tools/gl/zfill_vp.glp deleted file mode 100644 index f6eda0c0..00000000 --- a/setup/data/tools/gl/zfill_vp.glp +++ /dev/null @@ -1,384 +0,0 @@ -!!ARBvp1.0 -# cgc version 1.3.0001, build date Aug 4 2004 10:01:10 -# command line args: -profile arbvp1 -# source file: ..\..\setup\data\tools\gl\zfill_arbvp1.cg -#vendor NVIDIA Corporation -#version 1.0.02 -#profile arbvp1 -#program main -#semantic glstate : STATE -#var float4 glstate.material.ambient : STATE.MATERIAL.AMBIENT : : -1 : 0 -#var float4 glstate.material.diffuse : STATE.MATERIAL.DIFFUSE : : -1 : 0 -#var float4 glstate.material.specular : STATE.MATERIAL.SPECULAR : : -1 : 0 -#var float4 glstate.material.emission : STATE.MATERIAL.EMISSION : : -1 : 0 -#var float4 glstate.material.shininess : STATE.MATERIAL.SHININESS : : -1 : 0 -#var float4 glstate.material.front.ambient : STATE.MATERIAL.FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.material.front.diffuse : STATE.MATERIAL.FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.material.front.specular : STATE.MATERIAL.FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.material.front.emission : STATE.MATERIAL.FRONT.EMISSION : : -1 : 0 -#var float4 glstate.material.front.shininess : STATE.MATERIAL.FRONT.SHININESS : : -1 : 0 -#var float4 glstate.material.back.ambient : STATE.MATERIAL.BACK.AMBIENT : : -1 : 0 -#var float4 glstate.material.back.diffuse : STATE.MATERIAL.BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.material.back.specular : STATE.MATERIAL.BACK.SPECULAR : : -1 : 0 -#var float4 glstate.material.back.emission : STATE.MATERIAL.BACK.EMISSION : : -1 : 0 -#var float4 glstate.material.back.shininess : STATE.MATERIAL.BACK.SHININESS : : -1 : 0 -#var float4 glstate.light[0].ambient : STATE.LIGHT[0].AMBIENT : : -1 : 0 -#var float4 glstate.light[0].diffuse : STATE.LIGHT[0].DIFFUSE : : -1 : 0 -#var float4 glstate.light[0].specular : STATE.LIGHT[0].SPECULAR : : -1 : 0 -#var float4 glstate.light[0].position : STATE.LIGHT[0].POSITION : : -1 : 0 -#var float4 glstate.light[0].attenuation : STATE.LIGHT[0].ATTENUATION : : -1 : 0 -#var float4 glstate.light[0].spot.direction : STATE.LIGHT[0].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[0].half : STATE.LIGHT[0].HALF : : -1 : 0 -#var float4 glstate.light[1].ambient : STATE.LIGHT[1].AMBIENT : : -1 : 0 -#var float4 glstate.light[1].diffuse : STATE.LIGHT[1].DIFFUSE : : -1 : 0 -#var float4 glstate.light[1].specular : STATE.LIGHT[1].SPECULAR : : -1 : 0 -#var float4 glstate.light[1].position : STATE.LIGHT[1].POSITION : : -1 : 0 -#var float4 glstate.light[1].attenuation : STATE.LIGHT[1].ATTENUATION : : -1 : 0 -#var float4 glstate.light[1].spot.direction : STATE.LIGHT[1].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[1].half : STATE.LIGHT[1].HALF : : -1 : 0 -#var float4 glstate.light[2].ambient : STATE.LIGHT[2].AMBIENT : : -1 : 0 -#var float4 glstate.light[2].diffuse : STATE.LIGHT[2].DIFFUSE : : -1 : 0 -#var float4 glstate.light[2].specular : STATE.LIGHT[2].SPECULAR : : -1 : 0 -#var float4 glstate.light[2].position : STATE.LIGHT[2].POSITION : : -1 : 0 -#var float4 glstate.light[2].attenuation : STATE.LIGHT[2].ATTENUATION : : -1 : 0 -#var float4 glstate.light[2].spot.direction : STATE.LIGHT[2].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[2].half : STATE.LIGHT[2].HALF : : -1 : 0 -#var float4 glstate.light[3].ambient : STATE.LIGHT[3].AMBIENT : : -1 : 0 -#var float4 glstate.light[3].diffuse : STATE.LIGHT[3].DIFFUSE : : -1 : 0 -#var float4 glstate.light[3].specular : STATE.LIGHT[3].SPECULAR : : -1 : 0 -#var float4 glstate.light[3].position : STATE.LIGHT[3].POSITION : : -1 : 0 -#var float4 glstate.light[3].attenuation : STATE.LIGHT[3].ATTENUATION : : -1 : 0 -#var float4 glstate.light[3].spot.direction : STATE.LIGHT[3].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[3].half : STATE.LIGHT[3].HALF : : -1 : 0 -#var float4 glstate.light[4].ambient : STATE.LIGHT[4].AMBIENT : : -1 : 0 -#var float4 glstate.light[4].diffuse : STATE.LIGHT[4].DIFFUSE : : -1 : 0 -#var float4 glstate.light[4].specular : STATE.LIGHT[4].SPECULAR : : -1 : 0 -#var float4 glstate.light[4].position : STATE.LIGHT[4].POSITION : : -1 : 0 -#var float4 glstate.light[4].attenuation : STATE.LIGHT[4].ATTENUATION : : -1 : 0 -#var float4 glstate.light[4].spot.direction : STATE.LIGHT[4].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[4].half : STATE.LIGHT[4].HALF : : -1 : 0 -#var float4 glstate.light[5].ambient : STATE.LIGHT[5].AMBIENT : : -1 : 0 -#var float4 glstate.light[5].diffuse : STATE.LIGHT[5].DIFFUSE : : -1 : 0 -#var float4 glstate.light[5].specular : STATE.LIGHT[5].SPECULAR : : -1 : 0 -#var float4 glstate.light[5].position : STATE.LIGHT[5].POSITION : : -1 : 0 -#var float4 glstate.light[5].attenuation : STATE.LIGHT[5].ATTENUATION : : -1 : 0 -#var float4 glstate.light[5].spot.direction : STATE.LIGHT[5].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[5].half : STATE.LIGHT[5].HALF : : -1 : 0 -#var float4 glstate.light[6].ambient : STATE.LIGHT[6].AMBIENT : : -1 : 0 -#var float4 glstate.light[6].diffuse : STATE.LIGHT[6].DIFFUSE : : -1 : 0 -#var float4 glstate.light[6].specular : STATE.LIGHT[6].SPECULAR : : -1 : 0 -#var float4 glstate.light[6].position : STATE.LIGHT[6].POSITION : : -1 : 0 -#var float4 glstate.light[6].attenuation : STATE.LIGHT[6].ATTENUATION : : -1 : 0 -#var float4 glstate.light[6].spot.direction : STATE.LIGHT[6].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[6].half : STATE.LIGHT[6].HALF : : -1 : 0 -#var float4 glstate.light[7].ambient : STATE.LIGHT[7].AMBIENT : : -1 : 0 -#var float4 glstate.light[7].diffuse : STATE.LIGHT[7].DIFFUSE : : -1 : 0 -#var float4 glstate.light[7].specular : STATE.LIGHT[7].SPECULAR : : -1 : 0 -#var float4 glstate.light[7].position : STATE.LIGHT[7].POSITION : : -1 : 0 -#var float4 glstate.light[7].attenuation : STATE.LIGHT[7].ATTENUATION : : -1 : 0 -#var float4 glstate.light[7].spot.direction : STATE.LIGHT[7].SPOT.DIRECTION : : -1 : 0 -#var float4 glstate.light[7].half : STATE.LIGHT[7].HALF : : -1 : 0 -#var float4 glstate.lightmodel.ambient : STATE.LIGHTMODEL.AMBIENT : : -1 : 0 -#var float4 glstate.lightmodel.scenecolor : STATE.LIGHTMODEL.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightmodel.front.scenecolor : STATE.LIGHTMODEL.FRONT.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightmodel.back.scenecolor : STATE.LIGHTMODEL.BACK.SCENECOLOR : : -1 : 0 -#var float4 glstate.lightprod[0].ambient : STATE.LIGHTPROD[0].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].diffuse : STATE.LIGHTPROD[0].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].specular : STATE.LIGHTPROD[0].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[0].front.ambient : STATE.LIGHTPROD[0].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].front.diffuse : STATE.LIGHTPROD[0].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].front.specular : STATE.LIGHTPROD[0].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[0].back.ambient : STATE.LIGHTPROD[0].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[0].back.diffuse : STATE.LIGHTPROD[0].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[0].back.specular : STATE.LIGHTPROD[0].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].ambient : STATE.LIGHTPROD[1].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].diffuse : STATE.LIGHTPROD[1].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].specular : STATE.LIGHTPROD[1].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].front.ambient : STATE.LIGHTPROD[1].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].front.diffuse : STATE.LIGHTPROD[1].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].front.specular : STATE.LIGHTPROD[1].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[1].back.ambient : STATE.LIGHTPROD[1].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[1].back.diffuse : STATE.LIGHTPROD[1].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[1].back.specular : STATE.LIGHTPROD[1].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].ambient : STATE.LIGHTPROD[2].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].diffuse : STATE.LIGHTPROD[2].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].specular : STATE.LIGHTPROD[2].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].front.ambient : STATE.LIGHTPROD[2].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].front.diffuse : STATE.LIGHTPROD[2].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].front.specular : STATE.LIGHTPROD[2].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[2].back.ambient : STATE.LIGHTPROD[2].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[2].back.diffuse : STATE.LIGHTPROD[2].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[2].back.specular : STATE.LIGHTPROD[2].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].ambient : STATE.LIGHTPROD[3].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].diffuse : STATE.LIGHTPROD[3].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].specular : STATE.LIGHTPROD[3].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].front.ambient : STATE.LIGHTPROD[3].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].front.diffuse : STATE.LIGHTPROD[3].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].front.specular : STATE.LIGHTPROD[3].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[3].back.ambient : STATE.LIGHTPROD[3].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[3].back.diffuse : STATE.LIGHTPROD[3].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[3].back.specular : STATE.LIGHTPROD[3].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].ambient : STATE.LIGHTPROD[4].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].diffuse : STATE.LIGHTPROD[4].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].specular : STATE.LIGHTPROD[4].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].front.ambient : STATE.LIGHTPROD[4].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].front.diffuse : STATE.LIGHTPROD[4].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].front.specular : STATE.LIGHTPROD[4].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[4].back.ambient : STATE.LIGHTPROD[4].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[4].back.diffuse : STATE.LIGHTPROD[4].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[4].back.specular : STATE.LIGHTPROD[4].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].ambient : STATE.LIGHTPROD[5].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].diffuse : STATE.LIGHTPROD[5].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].specular : STATE.LIGHTPROD[5].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].front.ambient : STATE.LIGHTPROD[5].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].front.diffuse : STATE.LIGHTPROD[5].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].front.specular : STATE.LIGHTPROD[5].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[5].back.ambient : STATE.LIGHTPROD[5].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[5].back.diffuse : STATE.LIGHTPROD[5].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[5].back.specular : STATE.LIGHTPROD[5].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].ambient : STATE.LIGHTPROD[6].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].diffuse : STATE.LIGHTPROD[6].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].specular : STATE.LIGHTPROD[6].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].front.ambient : STATE.LIGHTPROD[6].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].front.diffuse : STATE.LIGHTPROD[6].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].front.specular : STATE.LIGHTPROD[6].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[6].back.ambient : STATE.LIGHTPROD[6].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[6].back.diffuse : STATE.LIGHTPROD[6].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[6].back.specular : STATE.LIGHTPROD[6].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].ambient : STATE.LIGHTPROD[7].AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].diffuse : STATE.LIGHTPROD[7].DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].specular : STATE.LIGHTPROD[7].SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].front.ambient : STATE.LIGHTPROD[7].FRONT.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].front.diffuse : STATE.LIGHTPROD[7].FRONT.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].front.specular : STATE.LIGHTPROD[7].FRONT.SPECULAR : : -1 : 0 -#var float4 glstate.lightprod[7].back.ambient : STATE.LIGHTPROD[7].BACK.AMBIENT : : -1 : 0 -#var float4 glstate.lightprod[7].back.diffuse : STATE.LIGHTPROD[7].BACK.DIFFUSE : : -1 : 0 -#var float4 glstate.lightprod[7].back.specular : STATE.LIGHTPROD[7].BACK.SPECULAR : : -1 : 0 -#var float4 glstate.texgen[0].eye.s : STATE.TEXGEN[0].EYE.S : : -1 : 0 -#var float4 glstate.texgen[0].eye.t : STATE.TEXGEN[0].EYE.T : : -1 : 0 -#var float4 glstate.texgen[0].eye.r : STATE.TEXGEN[0].EYE.R : : -1 : 0 -#var float4 glstate.texgen[0].eye.q : STATE.TEXGEN[0].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[0].object.s : STATE.TEXGEN[0].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[0].object.t : STATE.TEXGEN[0].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[0].object.r : STATE.TEXGEN[0].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[0].object.q : STATE.TEXGEN[0].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[1].eye.s : STATE.TEXGEN[1].EYE.S : : -1 : 0 -#var float4 glstate.texgen[1].eye.t : STATE.TEXGEN[1].EYE.T : : -1 : 0 -#var float4 glstate.texgen[1].eye.r : STATE.TEXGEN[1].EYE.R : : -1 : 0 -#var float4 glstate.texgen[1].eye.q : STATE.TEXGEN[1].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[1].object.s : STATE.TEXGEN[1].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[1].object.t : STATE.TEXGEN[1].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[1].object.r : STATE.TEXGEN[1].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[1].object.q : STATE.TEXGEN[1].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[2].eye.s : STATE.TEXGEN[2].EYE.S : : -1 : 0 -#var float4 glstate.texgen[2].eye.t : STATE.TEXGEN[2].EYE.T : : -1 : 0 -#var float4 glstate.texgen[2].eye.r : STATE.TEXGEN[2].EYE.R : : -1 : 0 -#var float4 glstate.texgen[2].eye.q : STATE.TEXGEN[2].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[2].object.s : STATE.TEXGEN[2].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[2].object.t : STATE.TEXGEN[2].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[2].object.r : STATE.TEXGEN[2].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[2].object.q : STATE.TEXGEN[2].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[3].eye.s : STATE.TEXGEN[3].EYE.S : : -1 : 0 -#var float4 glstate.texgen[3].eye.t : STATE.TEXGEN[3].EYE.T : : -1 : 0 -#var float4 glstate.texgen[3].eye.r : STATE.TEXGEN[3].EYE.R : : -1 : 0 -#var float4 glstate.texgen[3].eye.q : STATE.TEXGEN[3].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[3].object.s : STATE.TEXGEN[3].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[3].object.t : STATE.TEXGEN[3].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[3].object.r : STATE.TEXGEN[3].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[3].object.q : STATE.TEXGEN[3].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[4].eye.s : STATE.TEXGEN[4].EYE.S : : -1 : 0 -#var float4 glstate.texgen[4].eye.t : STATE.TEXGEN[4].EYE.T : : -1 : 0 -#var float4 glstate.texgen[4].eye.r : STATE.TEXGEN[4].EYE.R : : -1 : 0 -#var float4 glstate.texgen[4].eye.q : STATE.TEXGEN[4].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[4].object.s : STATE.TEXGEN[4].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[4].object.t : STATE.TEXGEN[4].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[4].object.r : STATE.TEXGEN[4].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[4].object.q : STATE.TEXGEN[4].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[5].eye.s : STATE.TEXGEN[5].EYE.S : : -1 : 0 -#var float4 glstate.texgen[5].eye.t : STATE.TEXGEN[5].EYE.T : : -1 : 0 -#var float4 glstate.texgen[5].eye.r : STATE.TEXGEN[5].EYE.R : : -1 : 0 -#var float4 glstate.texgen[5].eye.q : STATE.TEXGEN[5].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[5].object.s : STATE.TEXGEN[5].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[5].object.t : STATE.TEXGEN[5].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[5].object.r : STATE.TEXGEN[5].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[5].object.q : STATE.TEXGEN[5].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[6].eye.s : STATE.TEXGEN[6].EYE.S : : -1 : 0 -#var float4 glstate.texgen[6].eye.t : STATE.TEXGEN[6].EYE.T : : -1 : 0 -#var float4 glstate.texgen[6].eye.r : STATE.TEXGEN[6].EYE.R : : -1 : 0 -#var float4 glstate.texgen[6].eye.q : STATE.TEXGEN[6].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[6].object.s : STATE.TEXGEN[6].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[6].object.t : STATE.TEXGEN[6].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[6].object.r : STATE.TEXGEN[6].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[6].object.q : STATE.TEXGEN[6].OBJECT.Q : : -1 : 0 -#var float4 glstate.texgen[7].eye.s : STATE.TEXGEN[7].EYE.S : : -1 : 0 -#var float4 glstate.texgen[7].eye.t : STATE.TEXGEN[7].EYE.T : : -1 : 0 -#var float4 glstate.texgen[7].eye.r : STATE.TEXGEN[7].EYE.R : : -1 : 0 -#var float4 glstate.texgen[7].eye.q : STATE.TEXGEN[7].EYE.Q : : -1 : 0 -#var float4 glstate.texgen[7].object.s : STATE.TEXGEN[7].OBJECT.S : : -1 : 0 -#var float4 glstate.texgen[7].object.t : STATE.TEXGEN[7].OBJECT.T : : -1 : 0 -#var float4 glstate.texgen[7].object.r : STATE.TEXGEN[7].OBJECT.R : : -1 : 0 -#var float4 glstate.texgen[7].object.q : STATE.TEXGEN[7].OBJECT.Q : : -1 : 0 -#var float4 glstate.fog.color : STATE.FOG.COLOR : : -1 : 0 -#var float4 glstate.fog.params : STATE.FOG.PARAMS : : -1 : 0 -#var float4 glstate.clip[0].plane : STATE.CLIP[0].PLANE : : -1 : 0 -#var float4 glstate.clip[1].plane : STATE.CLIP[1].PLANE : : -1 : 0 -#var float4 glstate.clip[2].plane : STATE.CLIP[2].PLANE : : -1 : 0 -#var float4 glstate.clip[3].plane : STATE.CLIP[3].PLANE : : -1 : 0 -#var float4 glstate.clip[4].plane : STATE.CLIP[4].PLANE : : -1 : 0 -#var float4 glstate.clip[5].plane : STATE.CLIP[5].PLANE : : -1 : 0 -#var float4 glstate.clip[6].plane : STATE.CLIP[6].PLANE : : -1 : 0 -#var float4 glstate.clip[7].plane : STATE.CLIP[7].PLANE : : -1 : 0 -#var float glstate.point.size : STATE.POINT.SIZE : : -1 : 0 -#var float glstate.point.attenuation : STATE.POINT.ATTENUATION : : -1 : 0 -#var float4x4 glstate.matrix.modelview[0] : STATE.MATRIX.MODELVIEW[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[1] : STATE.MATRIX.MODELVIEW[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[2] : STATE.MATRIX.MODELVIEW[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[3] : STATE.MATRIX.MODELVIEW[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[4] : STATE.MATRIX.MODELVIEW[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[5] : STATE.MATRIX.MODELVIEW[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[6] : STATE.MATRIX.MODELVIEW[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.modelview[7] : STATE.MATRIX.MODELVIEW[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.projection : STATE.MATRIX.PROJECTION : , 4 : -1 : 0 -#var float4x4 glstate.matrix.mvp : STATE.MATRIX.MVP : c[0], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[0] : STATE.MATRIX.TEXTURE[0] : c[4], 4 : -1 : 1 -#var float4x4 glstate.matrix.texture[1] : STATE.MATRIX.TEXTURE[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[2] : STATE.MATRIX.TEXTURE[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[3] : STATE.MATRIX.TEXTURE[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[4] : STATE.MATRIX.TEXTURE[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[5] : STATE.MATRIX.TEXTURE[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[6] : STATE.MATRIX.TEXTURE[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.texture[7] : STATE.MATRIX.TEXTURE[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[0] : STATE.MATRIX.PALETTE[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[1] : STATE.MATRIX.PALETTE[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[2] : STATE.MATRIX.PALETTE[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[3] : STATE.MATRIX.PALETTE[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[4] : STATE.MATRIX.PALETTE[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[5] : STATE.MATRIX.PALETTE[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[6] : STATE.MATRIX.PALETTE[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.palette[7] : STATE.MATRIX.PALETTE[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[0] : STATE.MATRIX.PROGRAM[0] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[1] : STATE.MATRIX.PROGRAM[1] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[2] : STATE.MATRIX.PROGRAM[2] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[3] : STATE.MATRIX.PROGRAM[3] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[4] : STATE.MATRIX.PROGRAM[4] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[5] : STATE.MATRIX.PROGRAM[5] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[6] : STATE.MATRIX.PROGRAM[6] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.program[7] : STATE.MATRIX.PROGRAM[7] : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[0] : STATE.MATRIX.MODELVIEW[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[1] : STATE.MATRIX.MODELVIEW[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[2] : STATE.MATRIX.MODELVIEW[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[3] : STATE.MATRIX.MODELVIEW[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[4] : STATE.MATRIX.MODELVIEW[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[5] : STATE.MATRIX.MODELVIEW[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[6] : STATE.MATRIX.MODELVIEW[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.modelview[7] : STATE.MATRIX.MODELVIEW[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.projection : STATE.MATRIX.PROJECTION.INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.mvp : STATE.MATRIX.MVP.INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[0] : STATE.MATRIX.TEXTURE[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[1] : STATE.MATRIX.TEXTURE[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[2] : STATE.MATRIX.TEXTURE[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[3] : STATE.MATRIX.TEXTURE[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[4] : STATE.MATRIX.TEXTURE[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[5] : STATE.MATRIX.TEXTURE[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[6] : STATE.MATRIX.TEXTURE[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.texture[7] : STATE.MATRIX.TEXTURE[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[0] : STATE.MATRIX.PALETTE[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[1] : STATE.MATRIX.PALETTE[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[2] : STATE.MATRIX.PALETTE[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[3] : STATE.MATRIX.PALETTE[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[4] : STATE.MATRIX.PALETTE[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[5] : STATE.MATRIX.PALETTE[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[6] : STATE.MATRIX.PALETTE[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.palette[7] : STATE.MATRIX.PALETTE[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[0] : STATE.MATRIX.PROGRAM[0].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[1] : STATE.MATRIX.PROGRAM[1].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[2] : STATE.MATRIX.PROGRAM[2].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[3] : STATE.MATRIX.PROGRAM[3].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[4] : STATE.MATRIX.PROGRAM[4].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[5] : STATE.MATRIX.PROGRAM[5].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[6] : STATE.MATRIX.PROGRAM[6].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.inverse.program[7] : STATE.MATRIX.PROGRAM[7].INVERSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[0] : STATE.MATRIX.MODELVIEW[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[1] : STATE.MATRIX.MODELVIEW[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[2] : STATE.MATRIX.MODELVIEW[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[3] : STATE.MATRIX.MODELVIEW[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[4] : STATE.MATRIX.MODELVIEW[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[5] : STATE.MATRIX.MODELVIEW[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[6] : STATE.MATRIX.MODELVIEW[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.modelview[7] : STATE.MATRIX.MODELVIEW[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.projection : STATE.MATRIX.PROJECTION.TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.mvp : STATE.MATRIX.MVP.TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[0] : STATE.MATRIX.TEXTURE[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[1] : STATE.MATRIX.TEXTURE[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[2] : STATE.MATRIX.TEXTURE[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[3] : STATE.MATRIX.TEXTURE[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[4] : STATE.MATRIX.TEXTURE[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[5] : STATE.MATRIX.TEXTURE[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[6] : STATE.MATRIX.TEXTURE[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.texture[7] : STATE.MATRIX.TEXTURE[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[0] : STATE.MATRIX.PALETTE[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[1] : STATE.MATRIX.PALETTE[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[2] : STATE.MATRIX.PALETTE[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[3] : STATE.MATRIX.PALETTE[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[4] : STATE.MATRIX.PALETTE[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[5] : STATE.MATRIX.PALETTE[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[6] : STATE.MATRIX.PALETTE[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.palette[7] : STATE.MATRIX.PALETTE[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[0] : STATE.MATRIX.PROGRAM[0].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[1] : STATE.MATRIX.PROGRAM[1].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[2] : STATE.MATRIX.PROGRAM[2].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[3] : STATE.MATRIX.PROGRAM[3].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[4] : STATE.MATRIX.PROGRAM[4].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[5] : STATE.MATRIX.PROGRAM[5].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[6] : STATE.MATRIX.PROGRAM[6].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.transpose.program[7] : STATE.MATRIX.PROGRAM[7].TRANSPOSE : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[0] : STATE.MATRIX.MODELVIEW[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[1] : STATE.MATRIX.MODELVIEW[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[2] : STATE.MATRIX.MODELVIEW[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[3] : STATE.MATRIX.MODELVIEW[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[4] : STATE.MATRIX.MODELVIEW[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[5] : STATE.MATRIX.MODELVIEW[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[6] : STATE.MATRIX.MODELVIEW[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.modelview[7] : STATE.MATRIX.MODELVIEW[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.projection : STATE.MATRIX.PROJECTION.INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.mvp : STATE.MATRIX.MVP.INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[0] : STATE.MATRIX.TEXTURE[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[1] : STATE.MATRIX.TEXTURE[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[2] : STATE.MATRIX.TEXTURE[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[3] : STATE.MATRIX.TEXTURE[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[4] : STATE.MATRIX.TEXTURE[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[5] : STATE.MATRIX.TEXTURE[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[6] : STATE.MATRIX.TEXTURE[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.texture[7] : STATE.MATRIX.TEXTURE[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[0] : STATE.MATRIX.PALETTE[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[1] : STATE.MATRIX.PALETTE[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[2] : STATE.MATRIX.PALETTE[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[3] : STATE.MATRIX.PALETTE[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[4] : STATE.MATRIX.PALETTE[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[5] : STATE.MATRIX.PALETTE[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[6] : STATE.MATRIX.PALETTE[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.palette[7] : STATE.MATRIX.PALETTE[7].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[0] : STATE.MATRIX.PROGRAM[0].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[1] : STATE.MATRIX.PROGRAM[1].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[2] : STATE.MATRIX.PROGRAM[2].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[3] : STATE.MATRIX.PROGRAM[3].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[4] : STATE.MATRIX.PROGRAM[4].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[5] : STATE.MATRIX.PROGRAM[5].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[6] : STATE.MATRIX.PROGRAM[6].INVTRANS : , 4 : -1 : 0 -#var float4x4 glstate.matrix.invtrans.program[7] : STATE.MATRIX.PROGRAM[7].INVTRANS : , 4 : -1 : 0 -#var float4 IN.position : $vin.ATTR0 : ATTR0 : 0 : 1 -#var float4 IN.texcoord0 : $vin.ATTR8 : ATTR8 : 0 : 1 -#var float4 main.position : $vout.HPOS : HPOS : -1 : 1 -#var float4 main.tex0 : $vout.TEX0 : TEX0 : -1 : 1 -PARAM c[8] = { state.matrix.mvp, - state.matrix.texture[0] }; -DP4 result.position.w, vertex.attrib[0], c[3]; -DP4 result.position.z, vertex.attrib[0], c[2]; -DP4 result.position.y, vertex.attrib[0], c[1]; -DP4 result.position.x, vertex.attrib[0], c[0]; -DP4 result.texcoord[0].w, vertex.attrib[8], c[7]; -DP4 result.texcoord[0].z, vertex.attrib[8], c[6]; -DP4 result.texcoord[0].y, vertex.attrib[8], c[5]; -DP4 result.texcoord[0].x, vertex.attrib[8], c[4]; -END -# 8 instructions, 0 R-regs diff --git a/setup/data/tools/gl/zfill_vp.glsl b/setup/data/tools/gl/zfill_vp.glsl deleted file mode 100644 index 4c81280e..00000000 --- a/setup/data/tools/gl/zfill_vp.glsl +++ /dev/null @@ -1,35 +0,0 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "CONTRIBUTORS" for a list of contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -attribute vec4 attr_TexCoord0; - -void main() -{ - // transform vertex position into homogenous clip-space - gl_Position = ftransform(); - - // transform texcoords - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - // assign color - gl_FrontColor = gl_Color; -} diff --git a/setup/data/tools/global.xlink b/setup/data/tools/global.xlink deleted file mode 100644 index 8fbd0433..00000000 --- a/setup/data/tools/global.xlink +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_caulk.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_caulk.bmp deleted file mode 100644 index 52239503..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_caulk.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_cleanup.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_cleanup.bmp deleted file mode 100644 index 33cc9490..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_cleanup.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_dropent.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_dropent.bmp deleted file mode 100644 index 2fcdcba3..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_dropent.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_merge.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_merge.bmp deleted file mode 100644 index cc5e272c..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_merge.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_poly.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_poly.bmp deleted file mode 100644 index ed720e90..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_poly.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_split.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_split.bmp deleted file mode 100644 index fbb1571c..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_split.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_trainpathplot.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_trainpathplot.bmp deleted file mode 100644 index 66537dc1..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_trainpathplot.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_treeplanter.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_treeplanter.bmp deleted file mode 100644 index 08f55f3c..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_treeplanter.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/bobtoolz_turnedge.bmp b/setup/data/tools/plugins/bitmaps/bobtoolz_turnedge.bmp deleted file mode 100644 index b72cb2aa..00000000 Binary files a/setup/data/tools/plugins/bitmaps/bobtoolz_turnedge.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level1.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level1.bmp deleted file mode 100644 index 80a4b299..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level1.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level2.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level2.bmp deleted file mode 100644 index e84e2544..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level2.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level3.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level3.bmp deleted file mode 100644 index 141c3245..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level3.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level4.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level4.bmp deleted file mode 100644 index 3783a803..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level4.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level5.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level5.bmp deleted file mode 100644 index 8f62851c..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level5.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level6.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level6.bmp deleted file mode 100644 index 418fdd28..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level6.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level7.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level7.bmp deleted file mode 100644 index d82dab61..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level7.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bitmaps/ufoai_level8.bmp b/setup/data/tools/plugins/bitmaps/ufoai_level8.bmp deleted file mode 100644 index c3809538..00000000 Binary files a/setup/data/tools/plugins/bitmaps/ufoai_level8.bmp and /dev/null differ diff --git a/setup/data/tools/plugins/bt/bt-el1.txt b/setup/data/tools/plugins/bt/bt-el1.txt deleted file mode 100644 index ccac5e6e..00000000 --- a/setup/data/tools/plugins/bt/bt-el1.txt +++ /dev/null @@ -1,17 +0,0 @@ -common/areaportal -common/clip -common/clusterportal -common/cushion -common/donotenter -common/full_clip -common/hint -common/missileclip -common/nodraw -common/nodrawnonsolid -common/nodrop -common/noimpact -common/origin -common/trigger -common/weapclip -liquid -fog \ No newline at end of file diff --git a/setup/data/tools/plugins/bt/door-tex-trim.txt b/setup/data/tools/plugins/bt/door-tex-trim.txt deleted file mode 100644 index 5211a98c..00000000 --- a/setup/data/tools/plugins/bt/door-tex-trim.txt +++ /dev/null @@ -1,5 +0,0 @@ -base_support/support1rust -base_support/support1shiny -base_support/support2rust -base_support/wplat1_1 -base_support/plate2_5 \ No newline at end of file diff --git a/setup/data/tools/plugins/bt/door-tex.txt b/setup/data/tools/plugins/bt/door-tex.txt deleted file mode 100644 index 94b352f3..00000000 --- a/setup/data/tools/plugins/bt/door-tex.txt +++ /dev/null @@ -1,10 +0,0 @@ -base_door/shinymetaldoor -base_door/shinymetaldoor_outside -gothic_door/door02_bred -gothic_door/door02_bred2_shiny -gothic_door/door02_eblue2_shiny -gothic_door/door02_i_ornate5_fin -gothic_door/door02_j -gothic_door/door02_j3 -gothic_door/door02_j4 -gothic_door/door02_k2b \ No newline at end of file diff --git a/setup/data/tools/plugins/bt/tp_ent.txt b/setup/data/tools/plugins/bt/tp_ent.txt deleted file mode 100644 index 09488da9..00000000 --- a/setup/data/tools/plugins/bt/tp_ent.txt +++ /dev/null @@ -1,14 +0,0 @@ -{ - "entity" "misc_model" - - "offset" "-16" - - "model" "models/mapobjects/trees_sd/tree_a.md3" - "model" "models/mapobjects/trees_sd/tree_b.md3" - "model" "models/mapobjects/trees_sd/tree_c.md3" - "model" "models/mapobjects/trees_sd/tree_d.md3" - - "pitch" "-5" "5" - "yaw" "0" "360" - "scale" "1" "1.3" -} \ No newline at end of file diff --git a/setup/data/tools/q3data.qdt b/setup/data/tools/q3data.qdt deleted file mode 100644 index ba30ee12..00000000 --- a/setup/data/tools/q3data.qdt +++ /dev/null @@ -1,552 +0,0 @@ -$aseconvert models/mapobjects/spotlamp/spotlamp_x.ase -$exit - - -$aseconvert models/weapons2/machinegun/machinegun.ase -weapon -$aseconvert models/weapons2/bfg/bfg.ase -weapon -$aseconvert models/weapons2/railgun/railgun.ase -weapon -$aseconvert models/weapons2/shotgun/shotgun.ase -weapon - -$aseconvert models/weapons2/meshes/chaingun.ase -weapon -$aseconvert models/weapons2/meshes/flamethrower.ase -weapon -$aseconvert models/weapons2/meshes/grapple.ase -weapon -$aseconvert models/weapons2/meshes/grenadel.ase -weapon -$aseconvert models/weapons2/meshes/lightning.ase -weapon -$aseconvert models/weapons2/meshes/plasma.ase -weapon -$aseconvert models/weapons2/meshes/railgun.ase -weapon -$aseconvert models/weapons2/meshes/ricochet.ase -weapon -$aseconvert models/weapons2/meshes/rocketl.ase -weapon -$aseconvert models/weapons2/meshes/shotgun.ase -weapon - - -$aseconvert models/mapobjects/chain1.ase -$aseconvert models/mapobjects/chain2.ase -$aseconvert models/mapobjects/chain3.ase -$aseconvert models/mapobjects/chain4.ase - -$exit - -$aseanimconvert models/players/light/bandolier/bandolier.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/brandon/4brandon.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/cash/4cash.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/doom/doom.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/shauna/shauna.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/tim/4tim.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/visor/4visor.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/xian/4xian.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/carmack/carmack.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/heavy/paulj/4paulj.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/heavy/brock/brock.ase -origin 0 0 24 -playerparms 75 138 140 1 - -$exit - -// note: playerparms are "skipStart skipEnd maxUpperFrames maxHeadFrames" -$aseanimconvert models/players/medium/visor/4visor.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/visor/4visor.ase -lod 1 0 -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/visor/4visor.ase -lod 2 0 -origin 0 0 24 -playerparms 75 138 140 1 - - - -$aseconvert models/powerups/ammo/backpack.ase - -$aseconvert models/weapons2/meshes/assault.ase -weapon -$aseconvert models/weapons2/meshes/chaingun.ase -weapon -$aseconvert models/weapons2/meshes/flamethrower.ase -weapon -$aseconvert models/weapons2/meshes/grapple.ase -weapon -$aseconvert models/weapons2/meshes/grenadel.ase -weapon -$aseconvert models/weapons2/meshes/lightning.ase -weapon -$aseconvert models/weapons2/meshes/plasma.ase -weapon -$aseconvert models/weapons2/meshes/railgun.ase -weapon -$aseconvert models/weapons2/meshes/ricochet.ase -weapon -$aseconvert models/weapons2/meshes/rocketl.ase -weapon -$aseconvert models/weapons2/meshes/shotgun.ase -weapon - -$aseconvert models/mapobjects/arenalogo.ase - -// -// talk sprite -// -$modelname sprites/balloon -$cd sprites -$spritebase -8 -8 16 16 -$spriteshader sprites/balloon3.tga - -// plasma ball sprite -$modelname sprites/plasma -$cd sprites -$spritebase -16 -16 32 32 -$spriteshader sprites/plasma1.tga -$spriteshader sprites/plasma2.tga - -// -// player models -// note: playerparms are "skipStart skipEnd maxUpperFrames maxHeadFrames" -// -$aseanimconvert models/players/light/bandolier/bandolier.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/brandon/4brandon.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/cash/4cash.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/doom/doom.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/light/shauna/shauna.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/tim/4tim.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/visor/4visor.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/xian/4xian.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/medium/carmack/carmack.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/heavy/paulj/4paulj.ase -origin 0 0 24 -playerparms 75 138 140 1 -$aseanimconvert models/players/heavy/brock/brock.ase -origin 0 0 24 -playerparms 75 138 140 1 - -// -// weaphits -// -$modelname models/weaphits/bullet -$cd models/weaphits -$base bullet01.3ds -$frame bullet01.3ds -$frame bullet02.3ds -$frame bullet03.3ds -$frame bullet04.3ds -$frame bullet05.3ds -$frame bullet06.3ds -$skin bullet01.3ds -$skin bullet03.3ds -$skin bullet05.3ds - -$modelname models/weaphits/ring01 -$cd models/weaphits -$base ring01_1.3ds -$frame ring01_1.3ds -$frame ring01_2.3ds -$frame ring01_3.3ds -$frame ring01_4.3ds -$frame ring01_5.3ds -$frame ring01_6.3ds -$skin ring01_1.3ds -$skin ring01_3.3ds -$skin ring01_5.3ds - -$modelname models/weaphits/ring02 -$cd models/weaphits -$base ring02_1.3ds -$frame ring02_1.3ds -$frame ring02_2.3ds -$frame ring02_3.3ds -$frame ring02_4.3ds -$frame ring02_5.3ds -$frame ring02_6.3ds -$skin ring02_1.3ds -$skin ring02_3.3ds -$skin ring02_5.3ds - -$modelname models/weaphits/boomgra -$cd models/weaphits -$base boomgra1.3ds -$frame boomgra1.3ds -$frame boomgra2.3ds -$frame boomgra3.3ds -$frame boomgra4.3ds -$frame boomgra5.3ds -$frame boomgra6.3ds -$skin boomgra1.3ds -$skin boomgra3.3ds -$skin boomgra5.3ds - -$modelname models/weaphits/boom01 -$cd models/weaphits -$base boom01_1.3ds -$frame boom01_1.3ds -$frame boom01_2.3ds -$frame boom01_3.3ds -$frame boom01_4.3ds -$frame boom01_5.3ds -$frame boom01_6.3ds -$skin boom01_1.3ds -$skin boom01_3.3ds -$skin boom01_5.3ds - -$modelname models/weaphits/boom02 -$cd models/weaphits -$base boom02_1.3ds -$frame boom02_1.3ds -$frame boom02_2.3ds -$frame boom02_3.3ds -$frame boom02_4.3ds -$frame boom02_5.3ds -$frame boom02_6.3ds -$skin boom02_1.3ds -$skin boom02_3.3ds -$skin boom02_5.3ds - -$modelname models/weaphits/boom03 -$cd models/weaphits -$base boom03_1.3ds -$frame boom03_1.3ds -$frame boom03_2.3ds -$frame boom03_3.3ds -$frame boom03_4.3ds -$frame boom03_5.3ds -$frame boom03_6.3ds -$skin boom03_1.3ds -$skin boom03_3.3ds -$skin boom03_5.3ds - -$modelname models/weaphits/boom04 -$cd models/weaphits -$base boom04_1.3ds -$frame boom04_1.3ds -$frame boom04_2.3ds -$frame boom04_3.3ds -$frame boom04_4.3ds -$frame boom04_5.3ds -$frame boom04_6.3ds -$skin boom04_1.3ds -$skin boom04_3.3ds -$skin boom04_5.3ds - -$modelname models/weaphits/boom05 -$cd models/weaphits -$base boom05_1.3ds -$frame boom05_1.3ds -$frame boom05_2.3ds -$frame boom05_3.3ds -$frame boom05_4.3ds -$frame boom05_5.3ds -$frame boom05_6.3ds -$skin boom05_1.3ds -$skin boom05_3.3ds -$skin boom05_5.3ds - -// -// point powerups -// -$aseconvert models/powerups/points/small.ase -$aseconvert models/powerups/points/medium.ase -$aseconvert models/powerups/points/large.ase - -// -// ammo -// -$aseconvert models\powerups\ammo\bfgam.ASE -$aseconvert models\powerups\ammo\bfgam_1.ASE -$aseconvert models\powerups\ammo\bouncyam.ASE -$aseconvert models\powerups\ammo\bouncyam_1.ASE -$aseconvert models\powerups\ammo\carbineam.ASE -$aseconvert models\powerups\ammo\carbineam_1.ASE -$aseconvert models\powerups\ammo\flameam.ASE -$aseconvert models\powerups\ammo\flameam_1.ASE -$aseconvert models\powerups\ammo\grenadeam.ASE -$aseconvert models\powerups\ammo\grenadeam_1.ASE -$aseconvert models\powerups\ammo\lightningam.ASE -$aseconvert models\powerups\ammo\lightningam_1.ASE -$aseconvert models\powerups\ammo\machinegunam.ASE -$aseconvert models\powerups\ammo\machinegunam_1.ASE -$aseconvert models\powerups\ammo\plasmaam.ASE -$aseconvert models\powerups\ammo\plasmaam_1.ASE -$aseconvert models\powerups\ammo\railgunam.ASE -$aseconvert models\powerups\ammo\railgunam_1.ASE -$aseconvert models\powerups\ammo\rocketam.ASE -$aseconvert models\powerups\ammo\rocketam_1.ASE -$aseconvert models\powerups\ammo\shotgunam.ASE -$aseconvert models\powerups\ammo\shotgunam_1.ASE - -$aseconvert models/powerups/ammo/backpack.ase - -// -// missiles -// -$modelname models/ammo/plasma/plasma -$cd models/ammo/plasma -$base plasma1.3ds -$frame plasma1.3ds -$skin plasma1.3ds - -$modelname models/ammo/laser/laser -$cd models/ammo/laser -$base laser1.3ds -$frame laser1.3ds -$skin laser1.3ds - -$modelname models/ammo/rocket/rocket -$cd models/ammo/rocket -$base rocket1.3ds -$frame rocket1.3ds -$skin rocket1.3ds -$skin rocket2.3ds - -$aseconvert models/ammo/grenade1.ase -$aseconvert models/explosions/smoke2.ase - -// -// map objects -// -$aseconvert models/mapobjects/ceilinglamp1.ase -$aseconvert models/mapobjects/ceilinglamp2.ase -$aseconvert models/mapobjects/chain1.ase -$aseconvert models/mapobjects/chain2.ase -$aseconvert models/mapobjects/chain3.ase -$aseconvert models/mapobjects/chain4.ase -$aseconvert models/mapobjects/crux.ase -$aseconvert models/mapobjects/floorlamp1.ase -$aseconvert models/mapobjects/floorlamp2.ase -$aseconvert models/mapobjects/hook.ase -$aseconvert models/mapobjects/impale.ase -$aseconvert models/mapobjects/standinglamp1.ase -$aseconvert models/mapobjects/standinglamp2.ase -$aseconvert models/mapobjects/standinglamp3.ase -$aseconvert models/mapobjects/walllamp1.ase -$aseconvert models/mapobjects/walllamp2.ase -$aseconvert models/mapobjects/walllamp3.ase - - -// -// objects -// -$aseconvert models/objects/dmspot.ase -origin 0 0 24 -$aseconvert models/objects/box01.ase - -// -// weapons -// -$aseconvert models/weapons2/meshes/assault.ase -weapon -$aseconvert models/weapons2/meshes/bfg.ase -weapon -$aseconvert models/weapons2/meshes/chaingun.ase -weapon -$aseconvert models/weapons2/meshes/flamethrower.ase -weapon -$aseconvert models/weapons2/meshes/grapple.ase -weapon -$aseconvert models/weapons2/meshes/grenadel.ase -weapon -$aseconvert models/weapons2/meshes/lightning.ase -weapon -$aseconvert models/weapons2/meshes/plasma.ase -weapon -$aseconvert models/weapons2/meshes/railgun.ase -weapon -$aseconvert models/weapons2/meshes/ricochet.ase -weapon -$aseconvert models/weapons2/meshes/rocketl.ase -weapon -$aseconvert models/weapons2/meshes/shotgun.ase -weapon - -// -// blood -// -$modelname models/weaphits/blood -$cd models/weaphits -$spritebase -16 -16 32 32 -$spriteshader models/weaphits/blood201.tga -$spriteshader models/weaphits/blood202.tga -$spriteshader models/weaphits/blood203.tga -$spriteshader models/weaphits/blood204.tga -$spriteshader models/weaphits/blood205.tga - - -// -// missiles -// -$modelname models/ammo/plasma/plasma -$cd models/ammo/plasma -$base plasma1.3ds -$frame plasma1.3ds -$skin plasma1.3ds - -$modelname models/ammo/laser/laser -$cd models/ammo/laser -$base laser1.3ds -$frame laser1.3ds -$skin laser1.3ds - - -$modelname models/ammo/rocket/rocket -$cd models/ammo/rocket -$base rocket1.3ds -$frame rocket1.3ds -$skin rocket1.3ds -$skin rocket2.3ds - - -// weaphits - -$modelname models/weaphits/bullet -$cd models/weaphits -$base bullet01.3ds -$frame bullet01.3ds -$frame bullet02.3ds -$frame bullet03.3ds -$frame bullet04.3ds -$frame bullet05.3ds -$frame bullet06.3ds -$skin bullet01.3ds -$skin bullet03.3ds -$skin bullet05.3ds - -$modelname models/weaphits/ring01 -$cd models/weaphits -$base ring01_1.3ds -$frame ring01_1.3ds -$frame ring01_2.3ds -$frame ring01_3.3ds -$frame ring01_4.3ds -$frame ring01_5.3ds -$frame ring01_6.3ds -$skin ring01_1.3ds -$skin ring01_3.3ds -$skin ring01_5.3ds - -$modelname models/weaphits/ring02 -$cd models/weaphits -$base ring02_1.3ds -$frame ring02_1.3ds -$frame ring02_2.3ds -$frame ring02_3.3ds -$frame ring02_4.3ds -$frame ring02_5.3ds -$frame ring02_6.3ds -$skin ring02_1.3ds -$skin ring02_3.3ds -$skin ring02_5.3ds - -$modelname models/weaphits/boomgra -$cd models/weaphits -$base boomgra1.3ds -$frame boomgra1.3ds -$frame boomgra2.3ds -$frame boomgra3.3ds -$frame boomgra4.3ds -$frame boomgra5.3ds -$frame boomgra6.3ds -$skin boomgra1.3ds -$skin boomgra3.3ds -$skin boomgra5.3ds - -$modelname models/weaphits/boom01 -$cd models/weaphits -$base boom01_1.3ds -$frame boom01_1.3ds -$frame boom01_2.3ds -$frame boom01_3.3ds -$frame boom01_4.3ds -$frame boom01_5.3ds -$frame boom01_6.3ds -$skin boom01_1.3ds -$skin boom01_3.3ds -$skin boom01_5.3ds - -$modelname models/weaphits/boom02 -$cd models/weaphits -$base boom02_1.3ds -$frame boom02_1.3ds -$frame boom02_2.3ds -$frame boom02_3.3ds -$frame boom02_4.3ds -$frame boom02_5.3ds -$frame boom02_6.3ds -$skin boom02_1.3ds -$skin boom02_3.3ds -$skin boom02_5.3ds - -$modelname models/weaphits/boom03 -$cd models/weaphits -$base boom03_1.3ds -$frame boom03_1.3ds -$frame boom03_2.3ds -$frame boom03_3.3ds -$frame boom03_4.3ds -$frame boom03_5.3ds -$frame boom03_6.3ds -$skin boom03_1.3ds -$skin boom03_3.3ds -$skin boom03_5.3ds - -$modelname models/weaphits/boom04 -$cd models/weaphits -$base boom04_1.3ds -$frame boom04_1.3ds -$frame boom04_2.3ds -$frame boom04_3.3ds -$frame boom04_4.3ds -$frame boom04_5.3ds -$frame boom04_6.3ds -$skin boom04_1.3ds -$skin boom04_3.3ds -$skin boom04_5.3ds - -$modelname models/weaphits/boom05 -$cd models/weaphits -$base boom05_1.3ds -$frame boom05_1.3ds -$frame boom05_2.3ds -$frame boom05_3.3ds -$frame boom05_4.3ds -$frame boom05_5.3ds -$frame boom05_6.3ds -$skin boom05_1.3ds -$skin boom05_3.3ds -$skin boom05_5.3ds - - -// -// armor -// -$aseconvert models/powerups/armor/armor_red.ase -$aseconvert models/powerups/armor/armor_yel.ase -$aseconvert models/powerups/armor/armor_grn.ase -$aseconvert models/powerups/armor/shard.ase -$aseconvert models/powerups/armor/shard_sphere.ase -$aseconvert models/powerups/armor/shard_sphere_1.ase - -// -// health -// -$aseconvert models/powerups/health/small.ase -$aseconvert models/powerups/health/small_1.ase -$aseconvert models/powerups/health/medium.ase -$aseconvert models/powerups/health/medium_1.ase -$aseconvert models/powerups/health/large.ase -$aseconvert models/powerups/health/large_1.ase -$aseconvert models/powerups/health/mega.ase -$aseconvert models/powerups/health/mega_1.ase - -// -// holdable powerups -// -$aseconvert models/powerups/holdable/ringodeth.ase -$aseconvert models/powerups/holdable/medkit.ase -$aseconvert models/powerups/holdable/teleporter.ase - -// -// instant powerups -// -$aseconvert models/powerups/instant/enviro.ase -$aseconvert models/powerups/instant/enviro_1.ase -$aseconvert models/powerups/instant/enviro_ring.ase -$aseconvert models/powerups/instant/enviro_ring_1.ase -$aseconvert models/powerups/instant/flight.ase -$aseconvert models/powerups/instant/flight_1.ase -$aseconvert models/powerups/instant/flight_ring.ase -$aseconvert models/powerups/instant/flight_ring_1.ase -$aseconvert models/powerups/instant/haste.ase -$aseconvert models/powerups/instant/haste_1.ase -$aseconvert models/powerups/instant/haste_ring.ase -$aseconvert models/powerups/instant/haste_ring_1.ase -$aseconvert models/powerups/instant/invis.ase -$aseconvert models/powerups/instant/invis_1.ase -$aseconvert models/powerups/instant/invis_ring.ase -$aseconvert models/powerups/instant/invis_ring_1.ase -$aseconvert models/powerups/instant/scan.ase -$aseconvert models/powerups/instant/scan_1.ase -$aseconvert models/powerups/instant/scan_ring.ase -$aseconvert models/powerups/instant/scan_ring_1.ase -$aseconvert models/powerups/instant/quad.ase -$aseconvert models/powerups/instant/quad_1.ase -$aseconvert models/powerups/instant/quad_ring.ase -$aseconvert models/powerups/instant/quad_ring_1.ase -$aseconvert models/powerups/instant/regen.ase -$aseconvert models/powerups/instant/regen_1.ase -$aseconvert models/powerups/instant/regen_ring.ase -$aseconvert models/powerups/instant/regen_ring_1.ase - -$exit - -// -// maps -// -$maps test_box test_items mirror mirror2 - - -// -// misc -// -$file q3default.cfg - - diff --git a/setup/gpl.rtf b/setup/gpl.rtf deleted file mode 100644 index 3d8e489b..00000000 --- a/setup/gpl.rtf +++ /dev/null @@ -1,126 +0,0 @@ -{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fprq1\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang2057\f0\fs16\pard\qc GNU GENERAL PUBLIC LICENSE\par -Version 2, June 1991\par -\pard\par -\pard\li100Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\par -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par -\pard\par -\pard\qc Preamble\par -\pard\par - The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.\par -\par - When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.\par -\par - To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.\par -\par - For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par -\par - We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.\par -\par - Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.\par -\par - Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.\par -\par - The precise terms and conditions for copying, distribution and modification follow.\par -\par -\pard\qc GNU GENERAL PUBLIC LICENSE\par -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par -\pard\par - 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".\par -\par -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\par -\par - 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\par -\par -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\par -\par - 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\par -\par -\pard\li256a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.\par -\par -b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.\par -\par -c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\par -\pard\par -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\par -\par -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.\par -\par -In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\par -\par - 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\par -\par -\pard\li256a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\par -\par -b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\par -\par -c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\par -\pard\par -The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\par -\par -If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\par -\par - 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\par -\par - 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\par -\par - 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\par -\par - 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\par -\par -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\par -\par -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\par -\par -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\par -\par - 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\par -\par - 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par -\par -Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\par -\par - 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\par -\par -\tab\tab\tab NO WARRANTY\par -\par - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par -\par - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par -\par -\pard\qc END OF TERMS AND CONDITIONS\par -\par -How to Apply These Terms to Your New Programs\par -\pard\par - If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par -\par - To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\par -\par -\pard\li256\par -Copyright (C) \par -\pard\par -\pard\li256This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\par -\pard\par -\pard\li256This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\par -\pard\par -\pard\li256You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\par -\pard\par -\par -Also add information on how to contact you by electronic and paper mail.\par -\par -If the program is interactive, make it output a short notice like this when it starts in an interactive mode:\par -\par -\pard\li256Gnomovision version 69, Copyright (C) year name of author\par -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.\par -\pard\par -The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.\par -\par -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:\par -\par -\pard\li256Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.\par -\pard\par -\pard\li256, 1 April 1989\par -Ty Coon, President of Vice\par -\pard\par -This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.\par -\f1\par -} \ No newline at end of file diff --git a/setup/gpl.txt b/setup/gpl.txt deleted file mode 100644 index 6d45519c..00000000 --- a/setup/gpl.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/setup/license.rtf b/setup/license.rtf deleted file mode 100644 index ca0e8b22..00000000 --- a/setup/license.rtf +++ /dev/null @@ -1,49 +0,0 @@ -{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} -{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\lang2057\f0\fs20\tab LIMITED USE SOFTWARE LICENSE AGREEMENT\par -\par -This Limited Use Software License Agreement (the "Agreement") is a legal agreement between you, the end-user, and Id Software, Inc. ("ID"). BY CONTINUING THE INSTALLATION OF THIS SOFTWARE (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. \par -\par -1.\tab Grant of License. Subject to the terms and provisions of this Agreement, ID grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software. You are not receiving any ownership or proprietary right, title or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device and means the uses permitted in section 3. hereinbelow. You agree that the Software will not be shipped, transferred or exported into any country in violation of the U.S. Export Administration Act (or any other law governing such matters) by you or anyone at your direction and that you will not utilize and will not authorize anyone to utilize, in any other manner, the Software in violation of any applicable law. The Software shall not be downloaded or otherwise exported or reexported into (or to a national or resident of) any country to which the U.S. has embargoed goods or to anyone or into any country who/which are prohibited, by applicable law, from receiving such property.\par -\par -2.\tab Prohibitions. You, whether directly or indirectly, shall not do any of the following acts:\par -\par -a.\tab rent the Software;\par -\par -b.\tab sell the Software;\par -\par -c.\tab lease or lend the Software;\par -\par -d.\tab distribute the Software (except as permitted by section 3. hereinbelow);\par -\par -e.\tab in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose;\par -\par -f.\tab disassemble, reverse engineer, decompile, modify or alter the Software;\par -\par -g.\tab translate the Software;\par -\par -h.\tab reproduce or copy the Software (except as permitted by section 3. hereinbelow);\par -\par -i.\tab publicly display the Software; \par -\par -j.\tab prepare or develop derivative works based upon the Software; or \par -\par -k.\tab remove or alter any legal notices or other markings or legends, such as trademark and copyright notices, affixed on or within the Software.\par -\par -\par -3.\tab Permitted Uses. So long as this Agreement accompanies each copy you make of the Software, and so long as you fully comply, at all times, with this Agreement, ID grants to you the non-exclusive and limited right to distribute copies of the Software free of charge for non-commercial purposes by electronic means only and the non-exclusive and limited right to use the Software to create your own modifications for operation only with the full version of the software game QUAKE III ARENA; provided, however, you shall not make any modifications unless and until you have agreed to be bound by the terms of the LIMITED USE SOFTWARE LICENSE AGREEMENT which accompanies the full version of QUAKE III ARENA. Other than the electronic copies permitted above, you may make only the following copies of the Software: (i) you may copy the Software onto your computer hard drive; (ii) you may copy the Software from your computer hard drive into your computer RAM; and (iii) you may make one (1) "back-up" or archival copy of the Software on one (1) hard disk. You shall not use, copy or distribute the Software in any infringing manner or in any manner which violates any law or third party right and you shall not distribute the Software together with any material which infringes against any third party right or which is libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. ID reserves all rights not granted in this Agreement, including, without limitation, all rights to ID's trademarks. You shall not commercially distribute the Software.\par -\par -4.\tab Intellectual Property Rights. The Software and all copyrights, trademarks and all other conceivable intellectual property rights related to the Software are owned by ID and are protected by United States copyright laws, international treaty provisions and all applicable law, such as the Lanham Act. You must treat the Software like any other copyrighted material, as required by 17 U.S.C. S101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder complies with this Agreement. You agree that you are receiving a copy of the Software by license only and not by sale and that the "first sale" doctrine of 17 U.S.C. S109 does not apply to your receipt or use of the Software.\par -\par -5.\tab NO WARRANTIES. ID DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE. ID DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID AND SHOULD NOT BE RELIED UPON. THIS SECTION 5. SHALL SURVIVE CANCELLATION OR TERMINATION OF THIS AGREEMENT.\par -\par -6.\tab Governing Law, Venue, Indemnity and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas and applicable United States federal law. Copyright and other proprietary matters will be governed by United States laws and international treaties. Exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas and you agree to submit to the jurisdiction of the courts in Dallas, Texas for any such litigation. You agree to indemnify, defend and hold harmless ID and ID's officers, employees, directors, agents, licensees (excluding you), successors and assigns from and against all losses, lawsuits, damages, causes of action and claims relating to and/or arising from your breach of this Agreement and/or your distribution or other use of the Software. You agree that your unauthorized use of the Software, or any part thereof, may immediately and irreparably damage ID such that ID could not be adequately compensated solely by a monetary award and that at ID's option ID shall be entitled to an injunctive order, in addition to all other available remedies including a monetary award, appropriately restraining and/or prohibiting such unauthorized use without the necessity of ID posting bond or other security. IN ANY CASE, ID AND ID'S OFFICERS, EMPLOYEES, DIRECTORS, AGENTS, LICENSEES, SUBLICENSEES, SUCCESSORS AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, PUNITIVE OR OTHER SIMILAR DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID OR ITS AGENTS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This Section 6. shall survive cancellation or termination of this Agreement.\par -\par -7.\tab U.S. Government Restricted Rights. To the extent applicable, the United States Government shall only have those rights to use the Software as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. SS 227.7201 through 227.7204, inclusive.\par -\par -8.\tab General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. ID may assign its rights under this Agreement in ID's sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of ID to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. Immediately upon your failure to comply with or breach of any term or provision of this Agreement, THIS AGREEMENT AND YOUR LICENSE SHALL AUTOMATICALLY TERMINATE, WITHOUT NOTICE, AND ID MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU WHICH ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. In the event this Agreement is terminated, you shall have no right to use the Software, in any manner, and you shall immediately destroy all copies of the Software in your possession, custody or control.\par -\par -YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS BETWEEN ID AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.\par -\par -\par -} - \ No newline at end of file diff --git a/setup/license.txt b/setup/license.txt deleted file mode 100644 index f69c934b..00000000 --- a/setup/license.txt +++ /dev/null @@ -1,45 +0,0 @@ - LIMITED USE SOFTWARE LICENSE AGREEMENT - -This Limited Use Software License Agreement (the "Agreement") is a legal agreement between you, the end-user, and Id Software, Inc. ("ID"). BY CONTINUING THE INSTALLATION OF THIS SOFTWARE (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. - -1. Grant of License. Subject to the terms and provisions of this Agreement, ID grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software. You are not receiving any ownership or proprietary right, title or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device and means the uses permitted in section 3. hereinbelow. You agree that the Software will not be shipped, transferred or exported into any country in violation of the U.S. Export Administration Act (or any other law governing such matters) by you or anyone at your direction and that you will not utilize and will not authorize anyone to utilize, in any other manner, the Software in violation of any applicable law. The Software shall not be downloaded or otherwise exported or reexported into (or to a national or resident of) any country to which the U.S. has embargoed goods or to anyone or into any country who/which are prohibited, by applicable law, from receiving such property. - -2. Prohibitions. You, whether directly or indirectly, shall not do any of the following acts: - -a. rent the Software; - -b. sell the Software; - -c. lease or lend the Software; - -d. distribute the Software (except as permitted by section 3. hereinbelow); - -e. in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose; - -f. disassemble, reverse engineer, decompile, modify or alter the Software; - -g. translate the Software; - -h. reproduce or copy the Software (except as permitted by section 3. hereinbelow); - -i. publicly display the Software; - -j. prepare or develop derivative works based upon the Software; or - -k. remove or alter any legal notices or other markings or legends, such as trademark and copyright notices, affixed on or within the Software. - - -3. Permitted Uses. So long as this Agreement accompanies each copy you make of the Software, and so long as you fully comply, at all times, with this Agreement, ID grants to you the non-exclusive and limited right to distribute copies of the Software free of charge for non-commercial purposes by electronic means only and the non-exclusive and limited right to use the Software to create your own modifications for operation only with the full version of the software game QUAKE III ARENA; provided, however, you shall not make any modifications unless and until you have agreed to be bound by the terms of the LIMITED USE SOFTWARE LICENSE AGREEMENT which accompanies the full version of QUAKE III ARENA. Other than the electronic copies permitted above, you may make only the following copies of the Software: (i) you may copy the Software onto your computer hard drive; (ii) you may copy the Software from your computer hard drive into your computer RAM; and (iii) you may make one (1) "back-up" or archival copy of the Software on one (1) hard disk. You shall not use, copy or distribute the Software in any infringing manner or in any manner which violates any law or third party right and you shall not distribute the Software together with any material which infringes against any third party right or which is libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. ID reserves all rights not granted in this Agreement, including, without limitation, all rights to ID's trademarks. You shall not commercially distribute the Software. - -4. Intellectual Property Rights. The Software and all copyrights, trademarks and all other conceivable intellectual property rights related to the Software are owned by ID and are protected by United States copyright laws, international treaty provisions and all applicable law, such as the Lanham Act. You must treat the Software like any other copyrighted material, as required by 17 U.S.C. §101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder complies with this Agreement. You agree that you are receiving a copy of the Software by license only and not by sale and that the "first sale" doctrine of 17 U.S.C. §109 does not apply to your receipt or use of the Software. - -5. NO WARRANTIES. ID DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE. ID DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID AND SHOULD NOT BE RELIED UPON. THIS SECTION 5. SHALL SURVIVE CANCELLATION OR TERMINATION OF THIS AGREEMENT. - -6. Governing Law, Venue, Indemnity and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas and applicable United States federal law. Copyright and other proprietary matters will be governed by United States laws and international treaties. Exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas and you agree to submit to the jurisdiction of the courts in Dallas, Texas for any such litigation. You agree to indemnify, defend and hold harmless ID and ID's officers, employees, directors, agents, licensees (excluding you), successors and assigns from and against all losses, lawsuits, damages, causes of action and claims relating to and/or arising from your breach of this Agreement and/or your distribution or other use of the Software. You agree that your unauthorized use of the Software, or any part thereof, may immediately and irreparably damage ID such that ID could not be adequately compensated solely by a monetary award and that at ID's option ID shall be entitled to an injunctive order, in addition to all other available remedies including a monetary award, appropriately restraining and/or prohibiting such unauthorized use without the necessity of ID posting bond or other security. IN ANY CASE, ID AND ID'S OFFICERS, EMPLOYEES, DIRECTORS, AGENTS, LICENSEES, SUBLICENSEES, SUCCESSORS AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, PUNITIVE OR OTHER SIMILAR DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID OR ITS AGENTS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This Section 6. shall survive cancellation or termination of this Agreement. - -7. U.S. Government Restricted Rights. To the extent applicable, the United States Government shall only have those rights to use the Software as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, inclusive. - -8. General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. ID may assign its rights under this Agreement in ID's sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of ID to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. Immediately upon your failure to comply with or breach of any term or provision of this Agreement, THIS AGREEMENT AND YOUR LICENSE SHALL AUTOMATICALLY TERMINATE, WITHOUT NOTICE, AND ID MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU WHICH ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. In the event this Agreement is terminated, you shall have no right to use the Software, in any manner, and you shall immediately destroy all copies of the Software in your possession, custody or control. - -YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS BETWEEN ID AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT. - diff --git a/setup/links.htm b/setup/links.htm deleted file mode 100644 index 8c3aac68..00000000 --- a/setup/links.htm +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Related Links - - - - - - - -
-
-
- - -
-

Radiant links, news, tutorials, forums & help

-
-
- -

- General Links -

    - - - GtkRadiant start page - -
    - - GtkRadiant Forum on MapCenter - -
    - - q3map2 support forum - -
    - - Download selector - -
    - - Qeradiant.com Main Website, News and Stuff - -
    - - Qeradiant.com File Section - -
    - - The FAQ - -
-

- -

- Quake III Arena, Quake III: Team Arena -

    - - - Quake 3 section on Qeradiant.com - -
    - - Level Editing Forums on Mapcenter - -
    - - Quake III Level Editing Forum on Quake3World - -
    - - The BFLT .. all the Q3 editing links known to man. -
-

- -

- Return To Castle Wolfenstein -

    - - - Return To Castle Wolfenstein Editing Forum on PlanetWolfenstein - -
    - - Level Editing Forums on Mapcenter - -
-

- Bug reporting, testing, suggestions, flaming and developer information: -

    - - - Zerowing: mailing lists, CVS information, test builds.. - -
    - - GtkRadiant bug tracker (bugzilla) - -
-

- IRC -

    - - - IRC #qeradiant on irc.telefragged.com - -
-

- -

- Plugins -

    - - - BobToolz - multipurpose quake3 mappers tool
    -
    - - PrtView - portal viewer plugin
    -
    - - Curry- shader preview and editing
    -
    - - Pk3Man- easy pk3 file creation
    -
    - - TexTool Documentation -
-

- -

- I forgot something Tell me! -

- -

- - Quake III Arena © 1999 Id Software, Inc. All Rights Reserved. - Quake III Arena ®, QIIIA ®, and the id Software ® name - are trademarks of Id Software, Inc. - in all countries in which this game is distributed. The id ® logo, Q ®, - QII ®, and Quake ®, are registered trademarks of Id Software, Inc. in - the United States. Linux is a registered - trademark of Linus Torvalds. All other trademarks and trade names are properties - of their respective owners. - -

- -
- - -
- Last updated: Jan 21, 2002   -
-
- -
-
- - - diff --git a/setup/linux/Help/DocsArt/toolback.jpg b/setup/linux/Help/DocsArt/toolback.jpg deleted file mode 100644 index fa561227..00000000 Binary files a/setup/linux/Help/DocsArt/toolback.jpg and /dev/null differ diff --git a/setup/linux/Help/Index.html b/setup/linux/Help/Index.html deleted file mode 100644 index b4688ac2..00000000 --- a/setup/linux/Help/Index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -Quake III Arena SDK - - - - -

-See the tools/ directory for documentation files.. this page is outdated. -

- -

- -
README.Q3SDK -
General links page -
-

- -
- -

-Quake III Arena © 1999 Id Software, Inc. All Rights Reserved. -Quake III Arena ®, QIIIA ®, and the id Software ® name are -trademarks of Id Software, Inc. in all countries in which this game is -distributed. The id ® logo, Q ®, QII ®, and Quake ®, are registered trademarks -of Id Software, Inc. in the United States. -Linux is a registered trademark of Linus Torvalds. All other trademarks and trade names are -properties of their respective owners. -

- - - - diff --git a/setup/linux/Help/Q3A_EULA.txt b/setup/linux/Help/Q3A_EULA.txt deleted file mode 100644 index 50e2638e..00000000 --- a/setup/linux/Help/Q3A_EULA.txt +++ /dev/null @@ -1,234 +0,0 @@ - -LIMITED USE SOFTWARE LICENSE AGREEMENT - - - -This Limited Use Software License Agreement (the "Agreement") is a legal -agreement between you, the end-user, and Id Software, Inc. ("ID"). BY -CONTINUING THE INSTALLATION OF THIS GAME DEMO PROGRAM ENTITLED QUAKE III: -ARENA (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING -OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR -OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS -AGREEMENT. - - - -1. Grant of License. Subject to the terms and provisions of this -Agreement, ID grants to you the non-exclusive and limited right to use the -Software only in executable or object code form. The term "Software" -includes all elements of the Software, including, without limitation, data -files and screen displays. You are not receiving any ownership or -proprietary right, title or interest in or to the Software or the -copyright, trademarks, or other rights related thereto. For purposes of -this section, "use" means loading the Software into RAM and/or onto -computer hard drive, as well as installation of the Software on a hard -disk or other storage device and means the uses permitted in section 3. -hereinbelow. You agree that the Software will not be shipped, -transferred or exported into any country in violation of the U.S. Export -Administration Act (or any other law governing such matters) by you or -anyone at your direction and that you will not utilize and will not -authorize anyone to utilize, in any other manner, the Software in -violation of any applicable law. The Software may not be downloaded -or otherwise exported or exported into (or to a national or resident -of) any country to which the U.S. has embargoed goods or to anyone -or into any country who/which are prohibited, by applicable law, from -receiving such property. - - - -2. Prohibitions. You, either directly or indirectly, shall not do -any of the following acts: - - - -a. rent the Software; - - - -b. sell the Software; - - - -c. lease or lend the Software; - - - -d. offer the Software on a "pay-per-play" basis; - - - -e. distribute the Software (except as permitted by section 3. -hereinbelow); - - - -f. in any other manner and through any medium whatsoever -commercially exploit the Software or use the Software for any commercial -purpose; - - - -g. disassemble, reverse engineer, decompile, modify or alter the -Software including, without limitation, creating or developing extra or -add-on levels for the Software; - - - -h. translate the Software; - - - -i. reproduce or copy the Software (except as permitted by section -3. hereinbelow); - - - -j. publicly display the Software; - - - -k. prepare or develop derivative works based upon the Software; or - - - -l. remove or alter any legal notices or other markings or -legends, such as trademark and copyright notices, affixed on or within -the Software. - - - -3. Permitted Distribution and Copying. So long as this Agreement -accompanies each copy you make of the Software, and so long as you fully -comply, at all times, with this Agreement, ID grants to you the -non-exclusive and limited right to copy the Software and to distribute -such copies of the Software free of charge for non-commercial purposes -which shall include the free of charge distribution of copies of the -Software as mounted on the covers of magazines; provided, however, you -shall not copy or distribute the Software in any infringing manner or -in any manner which violates any law or third party right and you shall -not distribute the Software together with any material which is -infringing, libelous, defamatory, obscene, false, misleading, or -otherwise illegal or unlawful. You agree to label conspicuously as -"SHAREWARE" or "DEMO" each CD or other non-electronic copy of the -Software that you make and distribute. ID reserves all rights not -granted in this Agreement. You shall not commercially distribute the -Software unless you first enter into a separate contract with ID, a -copy of which you may request, but which ID may decline to execute. -For more information visit www.quake3arena.com. - - - -4. Intellectual Property Rights. The Software and all copyrights, -trademarks and all other conceivable intellectual property rights related -to the Software are owned by ID and are protected by United States -copyright laws, international treaty provisions and all applicable law, -such as the Lanham Act. You must treat the Software like any other -copyrighted material, as required by 17 U.S.C., §101 et seq. and other -applicable law. You agree to use your best efforts to see that any user -of the Software licensed hereunder complies with this Agreement. You -agree that you are receiving a copy of the Software by license only -and not by sale and that the "first sale" doctrine of 17 U.S.C. §109 -does not apply to your receipt or use of the Software. - - - -5. NO WARRANTIES. ID DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR -IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE -SOFTWARE. ID DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE -UNINTERRUPTED OR ERROR FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC -REQUIREMENTS. ADDITIONAL STATEMENTS SUCH AS PRESENTATIONS, WHETHER ORAL -OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID AND SHOULD NOT BE RELIED -UPON. THIS SECTION 5. SHALL SURVIVE CANCELLATION OR TERMINATION OF THIS -AGREEMENT. - - - -6. Governing Law, Venue, Indemnity and Liability Limitation. This -Agreement shall be construed in accordance with and governed by the -applicable laws of the State of Texas and applicable United States federal -law. Copyright and other proprietary matters will be governed by United -States laws and international treaties. Exclusive venue for all -litigation regarding this Agreement shall be in Dallas County, Texas -and you agree to submit to the jurisdiction of the courts in Dallas, -Texas for any such litigation. You agree to indemnify, defend and hold -harmless ID and ID's officers, employees, directors, agents, licensees -(excluding you), successors and assigns from and against all losses, -lawsuits, damages, causes of action and claims relating to and/or -arising from your breach of this Agreement. You agree that your -unauthorized use of the Software, or any part thereof, may immediately -and irreparably damage ID such that ID could not be adequately -compensated solely by a monetary award and that at ID's option ID shall -be entitled to an injunctive order, in addition to all other available -remedies including a monetary award, appropriately restraining and/or -prohibiting such unauthorized use without the necessity of ID posting -bond or other security. IN ANY CASE, ID AND ID'S OFFICERS, EMPLOYEES, -DIRECTORS, AGENTS, LICENSEES, SUBLICENSEES, SUCCESSORS AND ASSIGNS -SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, -SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, PUNITIVE OR OTHER SIMILAR -DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH -OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL -THEORY EVEN IF ID OR ITS AGENT HAVE BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE -FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow -the exclusion or limitation of incidental or consequential damages, -so the above limitation or exclusion may not apply to you. This -Section 6. shall survive cancellation or termination of this Agreement. - - - -7. U.S. Government Restricted Rights. To the extent applicable, -the United States Government shall only have those rights to use the -Software as expressly stated and expressly limited and restricted in -this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, -inclusive. - - - -8. General Provisions. Neither this Agreement nor any part or -portion hereof shall be assigned or sublicensed by you. ID may assign its -rights under this Agreement in ID's sole discretion. Should any provision -of this Agreement be held to be void, invalid, unenforceable or illegal by -a court of competent jurisdiction, the validity and enforceability of the -other provisions shall not be affected thereby. If any provision is -determined to be unenforceable by a court of competent jurisdiction, you -agree to a modification of such provision to provide for enforcement of -the provision's intent, to the extent permitted by applicable law. -Failure of ID to enforce any provision of this Agreement shall not -constitute or be construed as a waiver of such provision or of the right -to enforce such provision. Immediately upon your failure to comply with -or breach of any term or provision of this Agreement, THIS AGREEMENT -AND YOUR LICENSE SHALL AUTOMATICALLY TERMINATE, WITHOUT NOTICE, AND ID -MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU WHICH ARE AVAILABLE UNDER -APPLICABLE LAW AND/OR THIS AGREEMENT. In the event this Agreement is -terminated, you shall have no right to use the Software, in any manner, -and you shall immediately destroy all copies of the Software in your -possession, custody or control. - - - -YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS -AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE -SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING -THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND -BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, -EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND YOU, THIS -AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND -LIABILITIES OF THE PARTIES HERETO. THIS AGREEMENT SUPERSEDES ALL PRIOR -ORAL AGREEMENTS, PROPOSALS OR UNDERSTANDINGS, AND ANY OTHER -COMMUNICATIONS BETWEEN ID AND YOU RELATING TO THE SUBJECT MATTER OF -THIS AGREEMENT. - - - - - - - - - - - - - - diff --git a/setup/linux/README b/setup/linux/README deleted file mode 100644 index 8199851d..00000000 --- a/setup/linux/README +++ /dev/null @@ -1,35 +0,0 @@ - GtkRadiant Linux - =-=-=-=-=-=-=-=- - - -Installation Instructions -=-=-=-=-=-=-=-=-=-=-=-=-= - -If you are installing a full setup, it is recommended that you install in an empty directory (clear up any previous GtkRadiant installation in the target directory first). If you are installing an update, you need to have a working installation of GtkRadiant already, and point the installer to the right location for the update. - -Requirements -=-=-=-=-=-=- - -There are several required libraries that GtkRadiant and it's tools will try to link against. We try to comply with the Linux Standard Base ABI-wise regarding the binary builds we distribute (http://www.linuxbase.org/). Please let us know if this is not the case. - -- You need to have the full native Linux versions of the games we support. -- Linux 2.4 kernel recommanded (old 2.2 and unstable kernels untested) -- glibc 2.1 or above (2.2 recommended) -- XFree86 4 with hardware accelerated OpenGL support (others untested) - -You need the following dynamic libraries: - - * GTK+ 1.2 http://www.gtk.org - * zlib http://www.cdrom.com/pub/infozip/zlib/ - * libxml2 http://xmlsoft.org/ - * libpng http://www.libpng.org/pub/png/libpng.html - -Any decent distribution should provide packages for those, and in most cases have them installed by default. - -Misc -=-=- - -Once installed, use GtkRadiant's Help menu for ChangeLog, Credits and Links - --- -The GtkRadiant team diff --git a/setup/linux/all.cf b/setup/linux/all.cf deleted file mode 100644 index e5b7938c..00000000 --- a/setup/linux/all.cf +++ /dev/null @@ -1,10 +0,0 @@ -# Linux build config -# all.cf -# -# includes core + wolfpack + q3pack + q2pack + her2pack - -$DO_CORE=1; -$DO_GAME_Q3=1; -$DO_GAME_WOLF=1; -$DO_GAME_Q2=1; -$DO_GAME_HER2=1; diff --git a/setup/linux/bspc b/setup/linux/bspc deleted file mode 100644 index 0d3131f0..00000000 Binary files a/setup/linux/bspc and /dev/null differ diff --git a/setup/linux/bug750/loki_setup.patch b/setup/linux/bug750/loki_setup.patch deleted file mode 100644 index f01adbba..00000000 --- a/setup/linux/bug750/loki_setup.patch +++ /dev/null @@ -1,606 +0,0 @@ -Index: CHANGES -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/CHANGES,v -retrieving revision 1.77 -diff -u -r1.77 CHANGES ---- CHANGES 2003/02/27 06:16:01 1.77 -+++ CHANGES 2003/03/29 10:46:13 -@@ -2,6 +2,10 @@ - Stephane Peter (Codehost) - Tue Feb 11 20:33:32 PST 2003 - * Added the 'environment' tag to store the values of - environment variables. -+TTimo (qeradiant.com) - Mon Feb 10 12:17:08 CET 2003 -+ * Added SETUP_COMPONENT_PATH env to run scripts -+TTimo (qeradiant.com) - Sun Jan 26 23:36:06 CET 2003 -+ * Ported over our subcomponent code - Stephane Peter (Codehost) - Fri Dec 6 16:31:27 PST 2002 - * Do not display the main GTK dialog until we're done with the EULAs. - * Various fixes for menu items -Index: Makefile.in -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/Makefile.in,v -retrieving revision 1.18 -diff -u -r1.18 Makefile.in ---- Makefile.in 2003/03/26 05:45:10 1.18 -+++ Makefile.in 2003/03/29 10:46:13 -@@ -126,7 +126,7 @@ - strip image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo image/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - - install-image: all -@@ -151,7 +151,7 @@ - cp setup.gtk $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc); \ - strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - - # Pretty LPP-specific -@@ -161,7 +161,7 @@ - strip $(IMAGE)/bin/$(os)/$(arch)/check; \ - cp check.glade $(IMAGE)/misc/; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \ - fi - - # Copy loki_uninstall and the required files -@@ -176,7 +176,7 @@ - cp $$file $$path; \ - done; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \ - fi - - install-loki_uninstall: loki_uninstall -@@ -191,7 +191,7 @@ - cp $$file $$path; \ - done; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - @if [ -d $(UPDATES) ]; then \ - rm -rf $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \ -Index: copy.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/copy.c,v -retrieving revision 1.65 -diff -u -r1.65 copy.c ---- copy.c 2003/02/27 06:16:01 1.65 -+++ copy.c 2003/03/29 10:46:16 -@@ -343,7 +343,7 @@ - *slash = '\0'; - } - push_curdir(dir); -- if ( run_script(info, buf, 0) == 0 ) { -+ if ( run_script(info, buf, NULL, 0) == 0 ) { - const char *target = xmlGetProp(node, "target"); - if ( target ) { - char targetpath[PATH_MAX]; -@@ -677,7 +677,7 @@ - if ( ! update(info, _("Running script"), 0, 0, current_option_txt) ) - return 0; - } -- return(run_script(info, script, -1)); -+ return(run_script(info, script, dest, -1)); - } - - ssize_t copy_node(install_info *info, xmlNodePtr node, const char *dest, -@@ -766,6 +766,7 @@ - { - ssize_t size, copied; - char tmppath[PATH_MAX]; -+ const char *component_dest; - - size = 0; - while ( node ) { -@@ -828,6 +829,58 @@ - } - current_component = NULL; /* Out of the component */ - } -+ } -+ /* Parse subcomponents */ -+ else if (!strcmp(node->name, "subcomponent")) { -+ const char *name, *version; -+ xmlNodePtr child; -+ name = xmlGetProp(node, "name"); -+ if (!name) -+ log_fatal(_("SubComponent element must have a name")); -+ version = xmlGetProp(node, "version"); -+ if (!version) -+ { -+ log_warning(_("SubComponent doesn't have a version")); -+ version = strdup("noversion"); -+ } -+ child = node->childs; -+ while(child) -+ { -+ if(!strcmp(child->name, "option")) -+ { -+ /* only run if it has been actually selected for install */ -+ const char *install; -+ install = xmlGetProp(child, "install"); -+ if (install && !strcmp(install,"true")) -+ { -+ /* add this subcomponent as a standard component */ -+ current_component = add_component_entry(info, name, version, -+ (strcmp(xmlGetProp(child, "install"), "true") != 0) ? 0 : 1); -+ if(xmlGetProp(child, "path")) -+ { -+ /* if the path's been changed, use the path it was changed to */ -+ component_dest = xmlGetProp(child, "path"); -+ } -+ else -+ { -+ /* if the path hasn't been changed, install to the default path */ -+ component_dest = xmlGetProp(child, "default_path"); -+ } -+ // TODO: verify the install location ? -+ copied = copy_node(info, child, component_dest, update); -+ if ( copied > 0 ) -+ { -+ size += copied; -+ } -+ copied = copy_tree(info, child->childs, component_dest, update); -+ if(copied > 0) -+ { -+ size += copied; -+ } -+ } -+ } -+ child = child->next; -+ } - } else if ( ! strcmp(node->name, "environment") ) { - const char *prop = xmlGetProp(node, "var"); - if ( prop ) { -Index: gtk_ui.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/gtk_ui.c,v -retrieving revision 1.78 -diff -u -r1.78 gtk_ui.c ---- gtk_ui.c 2003/03/24 00:47:16 1.78 -+++ gtk_ui.c 2003/03/29 10:46:20 -@@ -143,6 +143,7 @@ - static GladeXML *setup_glade = NULL; - static GladeXML *setup_glade_readme = NULL; - static GladeXML *setup_glade_license = NULL; -+static GladeXML *setup_glade_subcomponent = NULL; - static int cur_state; - static install_info *cur_info; - static int diskspace; -@@ -159,6 +160,7 @@ - void setup_destroy_view_readme_slot(GtkWidget*, gpointer); - static yesno_answer gtkui_prompt(const char*, yesno_answer); - static void gtkui_abort(install_info *info); -+static int gtkui_dir_prompt (install_info *info, const char *message, char *path); - - static int iterate_for_state(void) - { -@@ -1189,6 +1191,189 @@ - } - } - -+/*************** subcomponent *********************/ -+ -+void setup_button_subcomponent_browse(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *entry = (GtkWidget *)func_data; -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ char *widget_data = gtk_object_get_data(GTK_OBJECT(widget), "data"); -+ char path[PATH_MAX]; -+ strncpy(path, gtk_entry_get_text(GTK_ENTRY(entry)), PATH_MAX); -+ -+ gtkui_dir_prompt(cur_info, widget_data, path); -+ -+ if(path[strlen(path)-1] != '/') -+ strcat(path, "/"); -+ -+ gtk_entry_set_text(GTK_ENTRY(entry), path); -+ -+ xmlSetProp(node, "path", path); -+} -+ -+void setup_subcomponent_toggle(GtkWidget *widget, gpointer func_data) -+{ -+ int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); -+ GtkWidget *entry = gtk_object_get_data(GTK_OBJECT(widget), "entry"); -+ GtkWidget *button = gtk_object_get_data(GTK_OBJECT(widget), "button"); -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ -+ if(state) -+ { -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), TRUE); -+ gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE); -+ xmlSetProp(node, "install", "true"); -+ xmlSetProp(node, "path", gtk_entry_get_text(GTK_ENTRY(entry))); -+ } -+ else -+ { -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE); -+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); -+ xmlSetProp(node, "install", "false"); -+ xmlSetProp(node, "path", ""); -+ } -+} -+ -+void subcomponent_update_entry(GtkWidget *widget, gpointer func_data) -+{ -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ char *path = malloc(strlen(gtk_entry_get_text(GTK_ENTRY(widget)))+2); -+ strcpy(path, gtk_entry_get_text(GTK_ENTRY(widget))); -+ -+ if (path[strlen(path)-1] != '/') -+ strcat(path, "/"); -+ -+ if(path) -+ xmlSetProp(node, "path", path); -+} -+ -+void setup_button_subcomponent(GtkWidget *widget, gpointer func_data) -+{ -+ xmlNodePtr node; -+ xmlNodePtr child; -+ GtkWidget *window, *frame, *w, *vbox, *hbox, -+ *check, *entry, *button, *sep; -+ const char *text; -+ char name[256]; -+ int count=0; -+ int install=0; -+ -+ install_info *info = (install_info *)func_data; -+ -+ setup_glade_subcomponent = glade_xml_new(SETUP_GLADE, "subcomponent_dialog"); -+ glade_xml_signal_autoconnect(setup_glade_subcomponent); -+ window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ frame = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_frame"); -+ -+ w = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_button_cancel"); -+ gtk_widget_hide(w); -+ -+ gtk_widget_realize(window); -+ gtk_widget_realize(frame); -+ gtk_container_foreach(GTK_CONTAINER(frame), empty_container, frame); -+ -+ w = gtk_vbox_new(TRUE, 2); -+ gtk_container_add(GTK_CONTAINER(frame), w); -+ gtk_widget_show(w); -+ -+ gtk_object_set_data(GTK_OBJECT(window), "data", w); -+ -+ node = info->config->root->childs; -+ while(node != NULL && strcmp(node->name, "subcomponent")) -+ node = node->next; -+ if (!node) -+ log_fatal(_("subcomponent element not found")); -+ child = node->childs; -+ // subcomponent options -+ while(child != NULL) -+ { -+ if(!strcmp(child->name, "option")) -+ { -+ if(!strcmp(xmlGetProp(child, "install"), "true")) -+ install=1; -+ else -+ install=0; -+ -+ vbox = gtk_vbox_new(FALSE, 2); -+ gtk_box_pack_start(GTK_BOX(w), vbox, TRUE, FALSE, 0); -+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); -+ gtk_widget_show(vbox); -+ -+ if(count) -+ { -+ sep = gtk_hseparator_new(); -+ gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); -+ gtk_widget_show(sep); -+ } -+ -+ text = xmlNodeListGetString(info->config, child->childs, 1); -+ parse_line(&text, name, sizeof(name)); -+ -+ check = gtk_check_button_new_with_label(name); -+ gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); -+ if(install) -+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); -+ gtk_signal_connect(GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(setup_subcomponent_toggle), NULL); -+ gtk_object_set_data(GTK_OBJECT(check), "name", name); -+ gtk_object_set_data(GTK_OBJECT(check), "node", child); -+ gtk_widget_show(check); -+ -+ hbox = gtk_hbox_new(FALSE, 2); -+ gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 0); -+ gtk_widget_show(hbox); -+ -+ entry = gtk_entry_new(); -+ //gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, FALSE, 0); -+ gtk_container_add(GTK_CONTAINER(hbox), entry); -+ if(!install) -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE); -+ gtk_signal_connect(GTK_OBJECT(entry), "focus_out_event", GTK_SIGNAL_FUNC(subcomponent_update_entry), NULL); -+ gtk_object_set_data(GTK_OBJECT(entry), "name", name); -+ gtk_object_set_data(GTK_OBJECT(entry), "node", child); -+ gtk_widget_show(entry); -+ -+ if(xmlGetProp(child, "path")) -+ { -+ gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "path")); -+ } -+ else if (xmlGetProp(child, "default_path")) -+ { -+ gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "default_path")); -+ } -+ -+ -+ button = gtk_button_new_with_label("..."); -+ gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); -+ gtk_object_set_data(GTK_OBJECT(button), "data", gtk_entry_get_text(GTK_ENTRY(entry))); -+ gtk_object_set_data(GTK_OBJECT(button), "node", child); -+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent_browse), entry); -+ if(!install) -+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); -+ gtk_widget_show(button); -+ -+ gtk_object_set_data(GTK_OBJECT(check), "entry", entry); -+ gtk_object_set_data(GTK_OBJECT(check), "button", button); -+ -+ count++; -+ } -+ child = child->next; -+ } -+ gtk_widget_show(window); -+ //gtk_window_set_modal(GTK_WINDOW(window), TRUE); -+} -+ -+void setup_button_subcomponent_cancel(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ gtk_widget_hide(window); -+} -+ -+void setup_button_subcomponent_ok(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ gtk_widget_hide(window); -+} -+ - /********** UI functions *************/ - - static install_state gtkui_init(install_info *info, int argc, char **argv, int noninteractive) -@@ -1496,7 +1681,13 @@ - parse_option(info, xmlGetProp(node, "name"), child, window, options, 0, NULL, 0, NULL); - } - } -- } -+ } else if ( ! strcmp(node->name, "subcomponent") ) { -+ GtkWidget *widget = gtk_button_new_with_label(xmlGetProp(node, "name")); -+ gtk_box_pack_start(GTK_BOX(options), GTK_WIDGET(widget), FALSE, FALSE, 5); -+ gtk_object_set_data(GTK_OBJECT(widget), "data", (gpointer)xmlGetProp(node, "name")); -+ gtk_signal_connect(GTK_OBJECT(widget), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent), (gpointer)info); -+ gtk_widget_show(widget); -+ } - node = node->next; - } - init_install_path(); -@@ -1681,6 +1872,63 @@ - gtkui_idle(info); - } - -+static int dirname_loop; -+static int prompt_ret; -+ -+void store_dirname_slot(GtkFileSelection *selector, gpointer user_data) { -+ char *aux; -+ char *selected_dirname = (char *)user_data; -+ GtkWidget *parent; -+ -+ parent = gtk_widget_get_toplevel (GTK_WIDGET(selector)); -+ aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent)); -+ if (strlen(aux)) -+ strcpy(selected_dirname, aux); -+ -+ dirname_loop = 0; -+} -+ -+void abort_slot(GtkFileSelection *selector, gpointer user_data) { -+ dirname_loop = 0; -+ prompt_ret = 0; -+} -+ -+static int gtkui_dir_prompt (install_info *info, const char *message, char *path) -+{ -+ GtkWidget *selector; -+ char *aux; -+ -+ /* Create the selector */ -+ selector = gtk_file_selection_new(message); -+ -+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(selector), path); -+ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION(selector)); -+ -+ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->ok_button), -+ "clicked", GTK_SIGNAL_FUNC (store_dirname_slot), path); -+ -+ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->cancel_button), -+ "clicked", GTK_SIGNAL_FUNC (abort_slot), path); -+ -+ /* Display that dialog */ -+ -+ gtk_grab_add(selector); -+ gtk_widget_show (selector); -+ gtk_grab_remove(selector); -+ -+ dirname_loop = 1; -+ prompt_ret = 1; -+ -+ while (dirname_loop==1) -+ gtk_main_iteration(); -+ -+ aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector)); -+ -+ gtk_widget_destroy(selector); -+ -+ return prompt_ret; -+} -+ - int gtkui_okay(Install_UI *UI, int *argc, char ***argv) - { - extern int force_console; -@@ -1730,7 +1978,3 @@ - #endif - - #endif -- -- -- -- -Index: install.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/install.c,v -retrieving revision 1.102 -diff -u -r1.102 install.c ---- install.c 2003/03/27 04:16:26 1.102 -+++ install.c 2003/03/29 10:46:24 -@@ -999,7 +999,7 @@ - log_fatal(_("XML: 'require' tag doesn't have a mandatory 'command' attribute")); - } else { - /* Launch the command */ -- if ( run_script(info, prop, 0) != 0 ) { -+ if ( run_script(info, prop, NULL, 0) != 0 ) { - /* We failed: print out error message */ - text = xmlNodeListGetString(info->config, node->childs, 1); - if(text) { -@@ -1139,7 +1139,7 @@ - return 0; - - /* Launch the command */ -- return run_script(info, txt, 0) == 0; -+ return run_script(info, txt, NULL, 0) == 0; - } - } - return 1; -@@ -1321,7 +1321,7 @@ - - if (GetPreUnInstall(info) && info->installed_bytes>0) { - snprintf(path, sizeof(path), "sh %s", GetPreUnInstall(info)); -- run_script(info, path, 0); -+ run_script(info, path, NULL, 0); - } - - if ( file_exists(info->install_path) ) { -@@ -1338,7 +1338,7 @@ - /* Do not run scripts if nothing was installed */ - if ( info->installed_bytes>0 ) { - for ( selem = opt->pre_script_list; selem; selem = selem->next ) { /* RPM pre-uninstall */ -- run_script(info, selem->script, 0); -+ run_script(info, selem->script, NULL, 0); - } - } - -@@ -1355,7 +1355,7 @@ - } - if ( info->installed_bytes>0 ) { - for ( selem = opt->post_script_list; selem; selem = selem->next ) { /* RPM post-uninstall */ -- run_script(info, selem->script, 0); -+ run_script(info, selem->script, NULL, 0); - } - } - -@@ -1373,7 +1373,7 @@ - } - if (GetPostUnInstall(info) && info->installed_bytes>0) { - snprintf(path, sizeof(path), "sh %s", GetPostUnInstall(info)); -- run_script(info, path, 0); -+ run_script(info, path, NULL, 0); - } - - if ( uninstall_generated ) { -@@ -1753,7 +1753,7 @@ - if ( ! restoring_corrupt() ) { - script = GetPreInstall(info); - if ( script ) { -- exitval = run_script(info, script, -1); -+ exitval = run_script(info, script, NULL, -1); - } - } - return exitval; -@@ -1766,7 +1766,7 @@ - if ( ! restoring_corrupt() ) { - script = GetPostInstall(info); - if ( script ) { -- exitval = run_script(info, script, -1); -+ exitval = run_script(info, script, NULL, -1); - } - } - return exitval; -@@ -1787,7 +1787,7 @@ - /* Run the command and set it to "true" if the return value is ok */ - str = xmlGetProp(child, "command"); - if ( str ) { -- cmd = run_script(info, str, 0); -+ cmd = run_script(info, str, NULL, 0); - xmlSetProp(child, "install", cmd ? "false" : "true"); - } else { - log_fatal(_("Missing 'command' attribute for an option")); -@@ -2213,12 +2213,15 @@ - } - - /* Run some shell script commands */ --int run_script(install_info *info, const char *script, int arg) -+int run_script(install_info *info, const char *script, const char *dest, int arg) - { - char script_file[PATH_MAX]; - int fd; - int exitval; - char working_dir[PATH_MAX]; -+ -+ if (!dest) -+ dest = ""; - - /* We need to append the working directory onto the script name so - it can always be found. Do this only if the script file exists -@@ -2255,7 +2258,8 @@ - "SETUP_CDROMPATH=\"%s\"\n" - "SETUP_DISTRO=\"%s\"\n" - "SETUP_OPTIONTAGS=\"%s\"\n" -- "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_OPTIONTAGS\n" -+ "SETUP_COMPONENT_PATH=\"%s\"\n" -+ "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_OPTIONTAGS SETUP_COMPONENT_PATH\n" - "%s%s\n", - info->name, info->version, - info->install_path, -@@ -2263,6 +2267,7 @@ - info->cdroms_list ? info->cdroms_list->mounted : "", - info->distro ? distribution_symbol[info->distro] : "", - get_optiontags_string(info), -+ dest, - working_dir, script); - fchmod(fileno(fp),0755); /* Turn on executable bit */ - fclose(fp); -Index: install.h -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/install.h,v -retrieving revision 1.65 -diff -u -r1.65 install.h ---- install.h 2003/02/27 06:16:01 1.65 -+++ install.h 2003/03/29 10:46:25 -@@ -353,7 +353,7 @@ - If 'arg' is >= 0, it is passed to the script as a numeric argument, - otherwise the install path is passed as a command line argument. - */ --extern int run_script(install_info *info, const char *script, int arg); -+extern int run_script(install_info *info, const char *script, const char *dest, int arg); - - /* returns true if any deviant paths are not writable */ - char check_deviant_paths(xmlNodePtr node, install_info *info); -@@ -383,4 +383,3 @@ - - - #endif /* _install_h */ -- diff --git a/setup/linux/gtkradiant-1.5.0.spec b/setup/linux/gtkradiant-1.5.0.spec deleted file mode 100644 index 3f906abd..00000000 --- a/setup/linux/gtkradiant-1.5.0.spec +++ /dev/null @@ -1,206 +0,0 @@ -%define name gtkradiant -%define version 1.5.0 -%define release 5 -%define installdir /opt/%{name} - -Summary: GtkRadiant Level Editor -Name: %{name} -Version: %{version} -Release: %{release} -Group: Applications/Editors -Copyright: Id Software -URL: www.qeradiant.com -Distribution: GtkRadiant -Packager: %{packager} -Prefix: %{installdir} -Source: %{name}-%{version}.tar.gz -Requires: gtk2 >= 2.4.0 , gtkglext >= 1.0.0 , libxml2 >= 2.0.0 , zlib >= 1.2.0 , libpng >= 1.2.0 , mhash >= 0.9.0 -BuildRequires: python >= 2.3.0 , gcc >= 3.0.0 , scons >= 0.96 , gtk2-devel >= 2.4.0 , gtkglext-devel >= 1.0.0 , libxml2-devel >= 2.0.0 , zlib-devel >= 1.2.0 , libpng-devel >= 1.2.0 , mhash-devel >= 0.9.0 - -%description -GtkRadiant is a cross-platform level editor for games based on Id Software -technology. - -%prep -%setup -q - -%build -scons BUILD="release" SETUP="0" - -%install -echo $RPM_BUILD_ROOT/ -rm -rf $RPM_BUILD_ROOT%{installdir} -mkdir -p $RPM_BUILD_ROOT%{installdir} - -cp install/radiant.x86 $RPM_BUILD_ROOT%{installdir} -cp install/q3map2.x86 $RPM_BUILD_ROOT%{installdir} -cp install/q2map $RPM_BUILD_ROOT%{installdir} -cp setup/linux/bspc $RPM_BUILD_ROOT%{installdir} -cp setup/links.htm $RPM_BUILD_ROOT%{installdir} -cp setup/credits.html $RPM_BUILD_ROOT%{installdir} -cp setup/changelog.txt $RPM_BUILD_ROOT%{installdir} -cp setup/license.txt $RPM_BUILD_ROOT%{installdir} -cp setup/data/tools/global.xlink $RPM_BUILD_ROOT%{installdir} -mkdir $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/lighting_DBS_omni_fp.glsl $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/lighting_DBS_omni_vp.glsl $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/zfill_fp.glsl $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/zfill_vp.glsl $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/lighting_DBS_omni_fp.glp $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/lighting_DBS_omni_vp.glp $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/zfill_fp.glp $RPM_BUILD_ROOT%{installdir}/gl -cp setup/data/tools/gl/zfill_vp.glp $RPM_BUILD_ROOT%{installdir}/gl -cp include/RADIANT_MINOR $RPM_BUILD_ROOT%{installdir} -cp include/RADIANT_MAJOR $RPM_BUILD_ROOT%{installdir} -mkdir $RPM_BUILD_ROOT%{installdir}/et.game -mkdir $RPM_BUILD_ROOT%{installdir}/et.game/etmain -cp games/ETPack/et.game/etmain/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/et.game/etmain -cp games/ETPack/et.game/etmain/et_entities.def $RPM_BUILD_ROOT%{installdir}/et.game/etmain -cp games/ETPack/et.game/etmain/et_entities.ent $RPM_BUILD_ROOT%{installdir}/et.game/etmain -cp games/ETPack/et.game/game.xlink $RPM_BUILD_ROOT%{installdir}/et.game -cp games/ETPack/et.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/et.game -mkdir $RPM_BUILD_ROOT%{installdir}/et.game/bitmaps -cp games/ETPack/et.game/bitmaps/splash.bmp $RPM_BUILD_ROOT%{installdir}/et.game/bitmaps -cp games/ETPack/et.game/default_build_menu.txt $RPM_BUILD_ROOT%{installdir}/et.game/bitmaps -mkdir $RPM_BUILD_ROOT%{installdir}/games -cp games/ETPack/games/et.game $RPM_BUILD_ROOT%{installdir}/games -cp games/Q1Pack/games/q1.game $RPM_BUILD_ROOT%{installdir}/games -cp games/Q2Pack/games/q2.game $RPM_BUILD_ROOT%{installdir}/games -cp games/Q3Pack/tools/games/q3.game $RPM_BUILD_ROOT%{installdir}/games -cp games/Doom3Pack/tools/games/doom3.game $RPM_BUILD_ROOT%{installdir}/games -cp games/Q4Pack/tools/games/q4.game $RPM_BUILD_ROOT%{installdir}/games -cp games/JAPack/Tools/games/ja.game $RPM_BUILD_ROOT%{installdir}/games -cp games/NexuizPack/games/nexuiz.game $RPM_BUILD_ROOT%{installdir}/games -cp games/DarkPlacesPack/games/darkplaces.game $RPM_BUILD_ROOT%{installdir}/games -mkdir $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/entity.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/model.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/shaders.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/vfspk3.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/archivepak.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/mapxml.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/md3model.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/image.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/imagehl.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/archivezip.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/imagepng.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/imageq2.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/mapq3.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/modules/archivewad.so $RPM_BUILD_ROOT%{installdir}/modules -cp install/plugins/prtview.so $RPM_BUILD_ROOT%{installdir}/prtview -cp install/plugins/bobtoolz.so $RPM_BUILD_ROOT%{installdir}/plugins -cp install/plugins/bt/*.txt $RPM_BUILD_ROOT%{installdir}/plugins/bt -cp install/plugins/bitmaps/bobtoolz_*.bmp $RPM_BUILD_ROOT%{installdir}/plugins/bitmaps -mkdir $RPM_BUILD_ROOT%{installdir}/q1.game -cp games/Q1Pack/q1.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/q1.game -mkdir $RPM_BUILD_ROOT%{installdir}/q1.game/id1 -cp games/Q1Pack/q1.game/id1/entities.ent $RPM_BUILD_ROOT%{installdir}/q1.game/id1 -mkdir $RPM_BUILD_ROOT%{installdir}/q2.game -cp games/Q2Pack/q2.game/game.xlink $RPM_BUILD_ROOT%{installdir}/q2.game -cp games/Q2Pack/q2.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/q2.game -mkdir $RPM_BUILD_ROOT%{installdir}/q2.game/baseq2 -cp games/Q2Pack/q2.game/baseq2/entities.def $RPM_BUILD_ROOT%{installdir}/q2.game/baseq2 -mkdir $RPM_BUILD_ROOT%{installdir}/q3.game -cp games/Q3Pack/tools/q3.game/game.xlink $RPM_BUILD_ROOT%{installdir}/q3.game -cp games/Q3Pack/tools/q3.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/q3.game -mkdir $RPM_BUILD_ROOT%{installdir}/q3.game/missionpack -cp games/Q3Pack/tools/q3.game/missionpack/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/q3.game/missionpack -cp games/Q3Pack/tools/q3.game/missionpack/entities-ta.def $RPM_BUILD_ROOT%{installdir}/q3.game/missionpack -cp games/Q3Pack/tools/q3.game/missionpack/entities-ta.ent $RPM_BUILD_ROOT%{installdir}/q3.game/missionpack -mkdir $RPM_BUILD_ROOT%{installdir}/q3.game/baseq3 -cp games/Q3Pack/tools/q3.game/baseq3/entities.ent $RPM_BUILD_ROOT%{installdir}/q3.game/baseq3 -cp games/Q3Pack/tools/q3.game/baseq3/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/q3.game/baseq3 -cp games/Q3Pack/tools/q3.game/baseq3/entities.def $RPM_BUILD_ROOT%{installdir}/q3.game/baseq3 -mkdir $RPM_BUILD_ROOT%{installdir}/nexuiz.game -cp games/NexuizPack/nexuiz.game/game.xlink $RPM_BUILD_ROOT%{installdir}/nexuiz.game -cp games/NexuizPack/nexuiz.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/nexuiz.game -mkdir $RPM_BUILD_ROOT%{installdir}/nexuiz.game/data -cp games/NexuizPack/nexuiz.game/data/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/nexuiz.game/data -cp games/NexuizPack/nexuiz.game/data/entities.def $RPM_BUILD_ROOT%{installdir}/nexuiz.game/data -mkdir $RPM_BUILD_ROOT%{installdir}/darkplaces.game -cp games/DarkPlacesPack/darkplaces.game/game.xlink $RPM_BUILD_ROOT%{installdir}/darkplaces.game -cp games/DarkPlacesPack/darkplaces.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/darkplaces.game -mkdir $RPM_BUILD_ROOT%{installdir}/darkplaces.game/id1 -cp games/DarkPlacesPack/darkplaces.game/id1/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/darkplaces.game/id1 -cp games/DarkPlacesPack/darkplaces.game/id1/entities.ent $RPM_BUILD_ROOT%{installdir}/darkplaces.game/id1 -mkdir $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_cubicclipping.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/cap_endcap.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/window4.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/splash.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/show_entities.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_selecttouching.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/cap_iendcap.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_wireframe.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_insdel.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_rotatey.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_cameraupdate.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/dontselectcurve.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/scalelockz.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/file_open.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/ellipsis.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_rotatez.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/scalelocky.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/dontselectmodel.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/modify_vertices.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_rotatex.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_flipy.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_selectinside.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_weld.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_cameratoggle.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/select_mousescale.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_change.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_csgsubtract.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_bend.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/window3.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/scalelockx.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/select_mouseresize.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/window1.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_clipper.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/logo.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_drilldown.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/texture_lock.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/textures_popup.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_selectpartialtall.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_selectcompletetall.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/window2.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/select_mousetranslate.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_flipx.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_makehollow.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/select_mouserotate.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/selection_csgmerge.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/file_save.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/popup_selection.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/cap_bevel.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/brush_flipz.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/cap_ibevel.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/curve_cap.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/modify_faces.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/notex.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/modify_edges.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/icon.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/shadernotex.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/patch_showboundingbox.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/view_entity.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/cap_cylinder.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/white.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/black.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -cp setup/data/tools/bitmaps/noFalloff.bmp $RPM_BUILD_ROOT%{installdir}/bitmaps -mkdir $RPM_BUILD_ROOT%{installdir}/doom3.game -cp games/Doom3Pack/tools/doom3.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/doom3.game -mkdir $RPM_BUILD_ROOT%{installdir}/q4.game -cp games/Q4Pack/tools/q4.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/q4.game -mkdir $RPM_BUILD_ROOT%{installdir}/ja.game -cp games/JAPack/Tools/ja.game/default_build_menu.xml $RPM_BUILD_ROOT%{installdir}/ja.game -cp games/JAPack/Tools/ja.game/game.xlink $RPM_BUILD_ROOT%{installdir}/ja.game -mkdir $RPM_BUILD_ROOT%{installdir}/ja.game/base -cp games/JAPack/Tools/ja.game/base/mp_entities.def $RPM_BUILD_ROOT%{installdir}/ja.game/base -cp games/JAPack/Tools/ja.game/base/sp_entities.def $RPM_BUILD_ROOT%{installdir}/ja.game/base -cp games/JAPack/Tools/ja.game/base/default_shaderlist.txt $RPM_BUILD_ROOT%{installdir}/ja.game/base - - -%clean - -%files -%defattr(-,root,root) -%{installdir} diff --git a/setup/linux/makeself/COPYING b/setup/linux/makeself/COPYING deleted file mode 100644 index a52b16e4..00000000 --- a/setup/linux/makeself/COPYING +++ /dev/null @@ -1,341 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/setup/linux/makeself/README b/setup/linux/makeself/README deleted file mode 100644 index 1f0e8c35..00000000 --- a/setup/linux/makeself/README +++ /dev/null @@ -1,294 +0,0 @@ -The following was generated from http://www.megastep.org/makeself/ ------------------------ - - makeself - Make self-extractible archives on Unix - - [1]makeself.sh is a small shell script that generates a - self-extractible tar.gz archive from a directory. The resulting file - appears as a shell script (many of those have a .run suffix), and can - be launched as is. The archive will then uncompress itself to a - temporary directory and an optional arbitrary command will be executed - (for example an installation script). This is pretty similar to - archives generated with WinZip Self-Extractor in the Windows world. - Makeself archives also include checksums for integrity self-validation - (CRC and/or MD5 checksums). - - The makeself.sh script itself is used only to create the archives from - a directory of files. The resultant archive is actually a compressed - (using gzip, bzip2, or compress) TAR archive, with a small shell - script stub at the beginning. This small stub performs all the steps - of extracting the files, running the embedded command, and removing - the temporary files when it's all over. All what the user has to do to - install the software contained in such an archive is to "run" the - archive, i.e sh nice-software.run. I recommend using the "run" (which - was introduced by some Makeself archives released by Loki Software) or - "sh" suffix for such archives not to confuse the users, since they - it's actually shell scripts (with quite a lot of binary data attached - to it though!). - - I am trying to keep the code of this script as portable as possible, - i.e it's not relying on any bash-specific features and only calls - commands that are installed on any functioning UNIX-compatible system. - This script as well as the archives it generates should run on any - Unix flavor, with any compatible Bourne shell, provided of course that - the compression programs are available. - - As of version 2.1, Makeself has been rewritten and tested on the - following platforms : - * Linux (all distributions) - * Sun Solaris (8 tested) - * HP-UX (tested on 11.0 and 11i on HPPA RISC) - * SCO OpenUnix and OpenServer - * IBM AIX 5.1L - * MacOS X (Darwin) - * SGI IRIX 6.5 - * FreeBSD - * UnicOS / Cray - - If you successfully run Makeself and/or archives created with it on - another system, then [2]let me know! - - Examples of publicly available archives made using makeself are : - * Game patches and installers for [3]Id Software games like Quake 3 - for Linux or Return To Castle Wolfenstien ; - * All game patches released by [4]Loki Software for the Linux - version of popular games ; - * The [5]nVidia drivers for Linux - * The [6]Makeself distribution itself ;-) - * and countless others... - - Important note for Apache users: By default, most Web servers will - think that Makeself archives are regular text files and thus they may - show up as text in a Web browser. The correct way to prevent this is - to add a MIME type for this file format, like so (in httpd.conf) : - AddType application/x-makeself .run - - Important note for recent GNU/Linux distributions: Archives created - with Makeself prior to v2.1.2 were using an old syntax for the head - and tail Unix commands that is being progressively obsoleted in their - GNU forms. Therefore you may have problems uncompressing some of these - archives. A workaround for this is to set the environment variable - $_POSIX2_VERSION to enable the old syntax, i.e. : - export _POSIX2_VERSION=199209 - -Usage - - The syntax of makeself is the following: - - makeself.sh [args] archive_dir file_name label startup_script - [script_args] - * args are optional options for Makeself. The available ones are : - + --version : Prints the version number on stdout, then exits - immediately - + --gzip : Use gzip for compression (is the default on - platforms on which gzip is commonly available, like Linux) - + --bzip2 : Use bzip2 instead of gzip for better compression. - The bzip2 command must be available in the command path. I - recommend that you set the prefix to something like - '.bz2.run' for the archive, so that potential users know that - they'll need bzip2 to extract it. - + --compress : Use the UNIX "compress" command to compress the - data. This should be the default on all platforms that don't - have gzip available. - + --nocomp : Do not use any compression for the archive, which - will then be an uncompressed TAR. - + --notemp : The generated archive will not extract the files - to a temporary directory, but in a new directory created in - the current directory. This is better to distribute software - packages that may extract and compile by themselves (i.e. - launch the compilation through the embedded script). - + --current : Files will be extracted to the current directory, - instead of in a subdirectory. This option implies --notemp - above. - + --follow : Follow the symbolic links inside of the archive - directory, i.e. store the files that are being pointed to - instead of the links themselves. - + --append (new in 2.1.x): Append data to an existing archive, - instead of creating a new one. In this mode, the settings - from the original archive are reused (compression type, - label, embedded script), and thus don't need to be specified - again on the command line. - + --header : Makeself 2.0 uses a separate file to store the - header stub, called "makeself-header.sh". By default, it is - assumed that it is stored in the same location as - makeself.sh. This option can be used to specify its actual - location if it is stored someplace else. - + --copy : Upon extraction, the archive will first extract - itself to a temporary directory. The main application of this - is to allow self-contained installers stored in a Makeself - archive on a CD, when the installer program will later need - to unmount the CD and allow a new one to be inserted. This - prevents "Filesystem busy" errors for installers that span - multiple CDs. - + --nox11 : Disable the automatic spawning of a new terminal in - X11. - + --nowait : When executed from a new X11 terminal, disable the - user prompt at the end of the script execution. - + --lsm file : Provide and LSM file to makeself, that will be - embedded in the generated archive. LSM files are describing a - software package in a way that is easily parseable. The LSM - entry can then be later retrieved using the '-lsm' argument - to the archive. An exemple of a LSM file is provided with - Makeself. - * archive_dir is the name of the directory that contains the files - to be archived - * file_name is the name of the archive to be created - * label is an arbitrary text string describing the package. It will - be displayed while extracting the files. - * startup_script is the command to be executed from within the - directory of extracted files. Thus, if you wish to execute a - program contain in this directory, you must prefix your command - with "./". For example, ./program will be fine. The script_args - are additionnal arguments for this command. - - Here is an example, assuming the user has a package image stored in a - /home/joe/mysoft, and he wants to generate a self-extracting package - named mysoft.sh, which will launch the "setup" script initially stored - in /home/joe/mysoft : - - makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" - ./setup - Here is also how I created the [7]makeself.run archive which contains - the Makeself distribution : - - makeself.sh --notemp makeself makeself.run "Makeself by Stephane - Peter" echo "Makeself has extracted itself" - - Archives generated with Makeself 2.1 can be passed the following - arguments: - - * --keep : Prevent the files to be extracted in a temporary - directory that will be removed after the embedded script's - execution. The files will then be extracted in the current working - directory and will stay here until you remove them. - * --verbose : Will prompt the user before executing the embedded - command - * --target dir : Allows to extract the archive in an arbitrary - place. - * --nox11 : Do not spawn a X11 terminal. - * --confirm : Prompt the user for confirmation before running the - embedded command. - * --info : Print out general information about the archive (does not - extract). - * --lsm : Print out the LSM entry, if it is present. - * --list : List the files in the archive. - * --check : Check the archive for integrity using the embedded - checksums. Does not extract the archive. - * --nochown : By default, a "chown -R" command is run on the target - directory after extraction, so that all files belong to the - current user. This is mostly needed if you are running as root, as - tar will then try to recreate the initial user ownerships. You may - disable this behavior with this flag. - - Any subsequent arguments to the archive will be passed as additional - arguments to the embedded command. You should explicitly use the -- - special command-line construct before any such options to make sure - that Makeself will not try to interpret them. - -License - - Makeself is covered by the [8]GNU General Public License (GPL) version - 2 and above. Archives generated by Makeself don't have to be placed - under this license (although I encourage it ;-)), since the archive - itself is merely data for Makeself. - -Download - - Get the latest official distribution [9]here (version 2.1.2). - - The latest development version can be grabbed from the Loki Setup CVS - module, at [10]cvs.icculus.org. - -Version history - - * v1.0: Initial public release - * v1.1: The archive can be passed parameters that will be passed on - to the embedded script, thanks to John C. Quillan - * v1.2: Cosmetic updates, support for bzip2 compression and - non-temporary archives. Many ideas thanks to Francois Petitjean. - * v1.3: More patches from Bjarni R. Einarsson and Francois - Petitjean: Support for no compression (--nocomp), script is no - longer mandatory, automatic launch in an xterm, optional verbose - output, and -target archive option to indicate where to extract - the files. - * v1.4: Many patches from Francois Petitjean: improved UNIX - compatibility, automatic integrity checking, support of LSM files - to get info on the package at run time.. - * v1.5.x: A lot of bugfixes, and many other patches, including - automatic verification through the usage of checksums. Version - 1.5.5 was the stable release for a long time, even though the Web - page didn't get updated ;-). Makeself was also officially made a - part of the [11]Loki Setup installer, and its source is being - maintained as part of this package. - * v2.0: Complete internal rewrite of Makeself. The command-line - parsing was vastly improved, the overall maintenance of the - package was greatly improved by separating the stub from - makeself.sh. Also Makeself was ported and tested to a variety of - Unix platforms. - * v2.0.1: First public release of the new 2.0 branch. Prior versions - are officially obsoleted. This release introduced the '--copy' - argument that was introduced in response to a need for the - [12]UT2K3 Linux installer. - * v2.1.0: Big change : Makeself can now support multiple embedded - tarballs, each stored separately with their own checksums. An - existing archive can be updated with the --append flag. Checksums - are also better managed, and the --nochown option for archives - appeared. - * v2.1.1: Fixes related to the Unix compression (compress command). - Some Linux distributions made the insane choice to make it - unavailable, even though gzip is capable of uncompressing these - files, plus some more bugfixes in the extraction and checksum - code. - * v2.1.2: Some bug fixes. Use head -n to avoid problems with POSIX - conformance. - -Links - - * Check out the [13]"Loki setup" installer, used to install many - Linux games and other applications, and of which I am the - co-author. Since the demise of Loki, I am now the official - maintainer of the project, and it is now being hosted on - [14]icculus.org, as well as a bunch of other ex-Loki projects (and - a lot of other good stuff!). - * Bjarni R. Einarsson also wrote the setup.sh installer script, - inspired by Makeself. [15]Check it out ! - -Contact - - This script was written by [16]Stéphane Peter (megastep at - megastep.org) I welcome any enhancements and suggestions. - - Contributions were included from John C. Quillan, Bjarni R. Einarsson, - Francois Petitjean, and Ryan C. Gordon, thanks to them! If you think I - forgot your name, don't hesitate to contact me. - - icculus.org also has a [17]Bugzilla server available that allows bug - reports to be submitted for Loki setup, and since Makeself is a part - of Loki setup, you can submit bug reports from there! - _________________________________________________________________ - - - [18]Stéphane Peter - - Last modified: Fri Jul 4 18:32:11 PDT 2003 - -Références - - 1. http://www.megastep.org/makeself/makeself.run - 2. mailto:megastep@REMOVEME.megastep.org - 3. http://www.idsoftware.com/ - 4. http://www.lokigames.com/products/myth2/updates.php3 - 5. http://www.nvidia.com/ - 6. http://www.megastep.org/makeself/makeself.run - 7. http://www.megastep.org/makeself/makeself.run - 8. http://www.gnu.org/copyleft/gpl.html - 9. http://www.megastep.org/makeself/makeself-2.1.2.run - 10. http://cvs.icculus.org/ - 11. http://www.icculus.org/loki_setup/ - 12. http://www.unrealtournament2003.com/ - 13. http://www.icculus.org/loki_setup/ - 14. http://www.icculus.org/ - 15. http://www.mmedia.is/~bre/programs/setup.sh/ - 16. mailto:megastep@@megastep.org - 17. https://bugzilla.icculus.org/ - 18. mailto:megastep@@megastep.org diff --git a/setup/linux/makeself/TODO b/setup/linux/makeself/TODO deleted file mode 100644 index 8bf501b7..00000000 --- a/setup/linux/makeself/TODO +++ /dev/null @@ -1,6 +0,0 @@ -What needs to be done next : - -- Generic compression code (thru a user-defined command) -- Collect names of directories potentially containing md5 program. GUESS_MD5_PATH - -Stéphane Peter diff --git a/setup/linux/makeself/makeself-header.sh b/setup/linux/makeself/makeself-header.sh deleted file mode 100644 index c734b826..00000000 --- a/setup/linux/makeself/makeself-header.sh +++ /dev/null @@ -1,359 +0,0 @@ -cat << EOF > "$archname" -#!/bin/sh -# This script was generated using Makeself $MS_VERSION -CRCsum="$CRCsum" -MD5="$MD5sum" -TMPROOT=\${TMPDIR:=/tmp} - -label="$LABEL" -script="$SCRIPT" -scriptargs="$SCRIPTARGS" -targetdir="$archdirname" -filesizes="$filesizes" -keep=$KEEP - -print_cmd_arg="" -if type printf > /dev/null; then - print_cmd="printf" -elif test -x /usr/ucb/echo; then - print_cmd="/usr/ucb/echo" -else - print_cmd="echo" -fi - -MS_Printf() -{ - \$print_cmd \$print_cmd_arg "\$1" -} - -MS_Progress() -{ - while read a; do - MS_Printf . - done -} - -MS_dd() -{ - blocks=\`expr \$3 / 1024\` - bytes=\`expr \$3 % 1024\` - dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\ - { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\ - test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null -} - -MS_Help() -{ - cat << EOH >&2 -Makeself version $MS_VERSION - 1) Getting help or info about \$0 : - \$0 --help Print this message - \$0 --info Print embedded info : title, default target directory, embedded script ... - \$0 --lsm Print embedded lsm entry (or no LSM) - \$0 --list Print the list of files in the archive - \$0 --check Checks integrity of the archive - - 2) Running \$0 : - \$0 [options] [--] [additional arguments to embedded script] - with following options (in that order) - --confirm Ask before running embedded script - --keep Do not erase target directory after running - the embedded script - --nox11 Do not spawn an xterm - --nochown Do not give the extracted files to the current user - --target NewDirectory Extract in NewDirectory - --tar arg1 [arg2 ...] Access the contents of the archive through the tar command - -- Following arguments will be passed to the embedded script -EOH -} - -MS_Check() -{ - OLD_PATH=\$PATH - PATH=\${GUESS_MD5_PATH:-"\$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} - MD5_PATH=\`exec 2>&-; which md5sum || type md5sum\` - MD5_PATH=\${MD5_PATH:-\`exec 2>&-; which md5 || type md5\`} - PATH=\$OLD_PATH - MS_Printf "Verifying archive integrity..." - offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\` - verb=\$2 - i=1 - for s in \$filesizes - do - crc=\`echo \$CRCsum | cut -d" " -f\$i\` - if test -x "\$MD5_PATH"; then - md5=\`echo \$MD5 | cut -d" " -f\$i\` - if test \$md5 = "00000000000000000000000000000000"; then - test x\$verb = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 - else - md5sum=\`MS_dd "\$1" \$offset \$s | "\$MD5_PATH" | cut -b-32\`; - if test "\$md5sum" != "\$md5"; then - echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2 - exit 2 - else - test x\$verb = xy && MS_Printf " MD5 checksums are OK." >&2 - fi - crc="0000000000"; verb=n - fi - fi - if test \$crc = "0000000000"; then - test x\$verb = xy && echo " \$1 does not contain a CRC checksum." >&2 - else - sum1=\`MS_dd "\$1" \$offset \$s | cksum | awk '{print \$1}'\` - if test "\$sum1" = "\$crc"; then - test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2 - else - echo "Error in checksums: \$sum1 is different from \$crc" - exit 2; - fi - fi - i=\`expr \$i + 1\` - offset=\`expr \$offset + \$s\` - done - echo " All good." -} - -UnTAR() -{ - tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; } -} - -finish=true -xterm_loop= -nox11=$NOX11 -copy=$COPY -ownership=y -verbose=n - -initargs="\$@" - -while true -do - case "\$1" in - -h | --help) - MS_Help - exit 0 - ;; - --info) - echo Identification: "\$label" - echo Target directory: "\$targetdir" - echo Uncompressed size: $USIZE KB - echo Compression: $COMPRESS - echo Date of packaging: $DATE - echo Built with Makeself version $MS_VERSION on $OSTYPE - if test x\$script != x; then - echo Script run after extraction: - echo " " \$script \$scriptargs - fi - if test x"$copy" = xcopy; then - echo "Archive will copy itself to a temporary location" - fi - if test x"$KEEP" = xy; then - echo "directory \$targetdir is permanent" - else - echo "\$targetdir will be removed after extraction" - fi - exit 0 - ;; - --dumpconf) - echo LABEL=\"\$label\" - echo SCRIPT=\"\$script\" - echo SCRIPTARGS=\"\$scriptargs\" - echo archdirname=\"$archdirname\" - echo KEEP=$KEEP - echo COMPRESS=$COMPRESS - echo filesizes=\"\$filesizes\" - echo CRCsum=\"\$CRCsum\" - echo MD5sum=\"\$MD5\" - echo OLDUSIZE=$USIZE - echo OLDSKIP=`expr $SKIP + 1` - exit 0 - ;; - --lsm) -cat << EOLSM -EOF -eval "$LSM_CMD" -cat << EOF >> "$archname" -EOLSM - exit 0 - ;; - --list) - echo Target directory: \$targetdir - offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` - for s in \$filesizes - do - MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | UnTAR t - offset=\`expr \$offset + \$s\` - done - exit 0 - ;; - --tar) - offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` - arg1="\$2" - shift 2 - for s in \$filesizes - do - MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | tar "\$arg1" - \$* - offset=\`expr \$offset + \$s\` - done - exit 0 - ;; - --check) - MS_Check "\$0" y - exit 0 - ;; - --confirm) - verbose=y - shift - ;; - --keep) - keep=y - shift - ;; - --target) - keep=y - targetdir=\${2:-.} - shift 2 - ;; - --nox11) - nox11=y - shift - ;; - --nochown) - ownership=n - shift - ;; - --xwin) - finish="echo Press Return to close this window...; read junk" - xterm_loop=1 - shift - ;; - --phase2) - copy=phase2 - shift - ;; - --) - shift - break ;; - -*) - echo Unrecognized flag : "\$1" >&2 - MS_Help - exit 1 - ;; - *) - break ;; - esac -done - -case "\$copy" in -copy) - SCRIPT_COPY="\$TMPROOT/makeself\$\$" - echo "Copying to a temporary location..." >&2 - cp "\$0" "\$SCRIPT_COPY" - chmod +x "\$SCRIPT_COPY" - cd "\$TMPROOT" - exec "\$SCRIPT_COPY" --phase2 - ;; -phase2) - finish="\$finish ; rm -f \$0" - ;; -esac - -if test "\$nox11" = "n"; then - if tty -s; then # Do we have a terminal? - : - else - if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X? - if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable - GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm" - for a in \$GUESS_XTERMS; do - if type \$a >/dev/null 2>&1; then - XTERM=\$a - break - fi - done - chmod a+x \$0 || echo Please add execution rights on \$0 - if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal! - exec \$XTERM -title "\$label" -e "\$0" --xwin "\$initargs" - else - exec \$XTERM -title "\$label" -e "./\$0" --xwin "\$initargs" - fi - fi - fi - fi -fi - -if test "\$targetdir" = "."; then - tmpdir="." -else - if test "\$keep" = y; then - echo "Creating directory \$targetdir" >&2 - tmpdir="\$targetdir" - else - tmpdir="\$TMPROOT/selfgz\$\$" - fi - mkdir -p \$tmpdir || { - echo 'Cannot create target directory' \$tmpdir >&2 - echo 'You should try option --target OtherDirectory' >&2 - eval \$finish - exit 1 - } -fi - -location="\`pwd\`" -if test x\$SETUP_NOCHECK != x1; then - MS_Check "\$0" -fi -offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` - -if test x"\$verbose" = xy; then - MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] " - read yn - if test x"\$yn" = xn; then - eval \$finish; exit 1 - fi -fi - -MS_Printf "Uncompressing \$label" -res=3 -if test "\$keep" = n; then - trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15 -fi - -for s in \$filesizes -do - if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then - if test x"\$ownership" = xy; then - (PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .) - fi - else - echo - echo "Unable to decompress \$0" >&2 - eval \$finish; exit 1 - fi - offset=\`expr \$offset + \$s\` -done -echo - -cd "\$tmpdir" -res=0 -if test x"\$script" != x; then - if test x"\$verbose" = xy; then - MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " - read yn - if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then - \$script \$scriptargs \$*; res=\$?; - fi - else - \$script \$scriptargs \$*; res=\$? - fi - if test \$res -ne 0; then - test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2 - fi -fi -if test "\$keep" = n; then - cd \$TMPROOT - /bin/rm -rf \$tmpdir -fi -eval \$finish; exit \$res -EOF diff --git a/setup/linux/makeself/makeself.lsm b/setup/linux/makeself/makeself.lsm deleted file mode 100644 index 8f75b5d0..00000000 --- a/setup/linux/makeself/makeself.lsm +++ /dev/null @@ -1,16 +0,0 @@ -Begin3 -Title: makeself.sh -Version: 2.1 -Description: makeself.sh is a shell script that generates a self-extractible - tar.gz archive from a directory. The resulting file appears as a shell - script, and can be launched as is. The archive will then uncompress - itself to a temporary directory and an arbitrary command will be - executed (for example an installation script). This is pretty similar - to archives generated with WinZip Self-Extractor in the Windows world. -Keywords: Installation archive tar winzip -Author: Stéphane Peter (megastep@megastep.org) -Maintained-by: Stéphane Peter (megastep@megastep.org) -Original-site: http://www.megastep.org/makeself/ -Platform: Unix -Copying-policy: GPL -End diff --git a/setup/linux/makeself/makeself.sh b/setup/linux/makeself/makeself.sh deleted file mode 100755 index 053eb1b6..00000000 --- a/setup/linux/makeself/makeself.sh +++ /dev/null @@ -1,334 +0,0 @@ -#!/bin/sh -# -# Makeself version 2.1.x -# by Stephane Peter -# -# $Id: makeself.sh,v 1.40 2003/09/12 02:19:29 megastep Exp $ -# -# Utility to create self-extracting tar.gz archives. -# The resulting archive is a file holding the tar.gz archive with -# a small Shell script stub that uncompresses the archive to a temporary -# directory and then executes a given script from withing that directory. -# -# Makeself home page: http://www.megastep.org/makeself/ -# -# Version 2.0 is a rewrite of version 1.0 to make the code easier to read and maintain. -# -# Version history : -# - 1.0 : Initial public release -# - 1.1 : The archive can be passed parameters that will be passed on to -# the embedded script, thanks to John C. Quillan -# - 1.2 : Package distribution, bzip2 compression, more command line options, -# support for non-temporary archives. Ideas thanks to Francois Petitjean -# - 1.3 : More patches from Bjarni R. Einarsson and Francois Petitjean: -# Support for no compression (--nocomp), script is no longer mandatory, -# automatic launch in an xterm, optional verbose output, and -target -# archive option to indicate where to extract the files. -# - 1.4 : Improved UNIX compatibility (Francois Petitjean) -# Automatic integrity checking, support of LSM files (Francois Petitjean) -# - 1.5 : Many bugfixes. Optionally disable xterm spawning. -# - 1.5.1 : More bugfixes, added archive options -list and -check. -# - 1.5.2 : Cosmetic changes to inform the user of what's going on with big -# archives (Quake III demo) -# - 1.5.3 : Check for validity of the DISPLAY variable before launching an xterm. -# More verbosity in xterms and check for embedded command's return value. -# Bugfix for Debian 2.0 systems that have a different "print" command. -# - 1.5.4 : Many bugfixes. Print out a message if the extraction failed. -# - 1.5.5 : More bugfixes. Added support for SETUP_NOCHECK environment variable to -# bypass checksum verification of archives. -# - 1.6.0 : Compute MD5 checksums with the md5sum command (patch from Ryan Gordon) -# - 2.0 : Brand new rewrite, cleaner architecture, separated header and UNIX ports. -# - 2.0.1 : Added --copy -# - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates. -# Added --nochown for archives -# Stopped doing redundant checksums when not necesary -# - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command -# Cleaned up the code to handle error codes from compress. Simplified the extraction code. -# - 2.1.2 : Some bug fixes. Use head -n to avoid problems. -# - 2.1.3 : Bug fixes with command line when spawning terminals. -# Added --tar for archives, allowing to give arbitrary arguments to tar on the contents of the archive. -# -# (C) 1998-2003 by Stéphane Peter -# -# This software is released under the terms of the GNU GPL -# Please read the license at http://www.gnu.org/copyleft/gpl.html -# - -MS_VERSION=2.1.3 - -# Procedures - -MS_Usage() -{ - echo "Usage: $0 [params] archive_dir file_name label [startup_script] [args]" - echo "params can be one or more of the following :" - echo " --version | -v : Print out Makeself version number and exit" - echo " --help | -h : Print out this help message" - echo " --gzip : Compress using gzip (default if detected)" - echo " --bzip2 : Compress using bzip2 instead of gzip" - echo " --compress : Compress using the UNIX 'compress' command" - echo " --nocomp : Do not compress the data" - echo " --notemp : The archive will create archive_dir in the" - echo " current directory and uncompress in ./archive_dir" - echo " --copy : Upon extraction, the archive will first copy itself to" - echo " a temporary directory" - echo " --append : Append more files to an existing Makeself archive" - echo " The label and startup scripts will then be ignored" - echo " --current : Files will be extracted to the current directory." - echo " Implies --notemp." - echo " --header file : Specify location of the header script" - echo " --follow : Follow the symlinks in the archive" - echo " --nox11 : Disable automatic spawn of a xterm" - echo " --nowait : Do not wait for user input after executing embedded" - echo " program from an xterm" - echo " --lsm file : LSM file describing the package" - echo - echo "Do not forget to give a fully qualified startup script name" - echo "(i.e. with a ./ prefix if inside the archive)." - exit 1 -} - -# Default settings -if type gzip 2>&1 > /dev/null; then - COMPRESS=gzip -else - COMPRESS=Unix -fi -KEEP=n -CURRENT=n -NOX11=n -APPEND=n -COPY=none -TAR_ARGS=cvf -HEADER=`dirname $0`/makeself-header.sh - -# LSM file stuff -LSM_CMD="echo No LSM. >> \"\$archname\"" - -while true -do - case "$1" in - --version | -v) - echo Makeself version $MS_VERSION - exit 0 - ;; - --bzip2) - COMPRESS=bzip2 - shift - ;; - --gzip) - COMPRESS=gzip - shift - ;; - --compress) - COMPRESS=Unix - shift - ;; - --nocomp) - COMPRESS=none - shift - ;; - --notemp) - KEEP=y - shift - ;; - --copy) - COPY=copy - shift - ;; - --current) - CURRENT=y - KEEP=y - shift - ;; - --header) - HEADER="$2" - shift 2 - ;; - --follow) - TAR_ARGS=cvfh - shift - ;; - --nox11) - NOX11=y - shift - ;; - --nowait) - shift - ;; - --append) - APPEND=y - shift - ;; - --lsm) - LSM_CMD="cat \"$2\" >> \"\$archname\"" - shift 2 - ;; - -h | --help) - MS_Usage - ;; - -*) - echo Unrecognized flag : "$1" - MS_Usage - ;; - *) - break - ;; - esac -done - -archdir="$1" -archname="$2" - -if test "$APPEND" = y; then - if test $# -lt 2; then - MS_Usage - fi - - # Gather the info from the original archive - OLDENV=`sh "$archname" --dumpconf` - if test $? -ne 0; then - echo "Unable to update archive: $archname" >&2 - exit 1 - else - eval "$OLDENV" - fi -else - if test "$KEEP" = n -a $# = 3; then - echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2 - echo - MS_Usage - fi - # We don't really want to create an absolute directory... - if test "$CURRENT" = y; then - archdirname="." - else - archdirname=`basename "$1"` - fi - - if test $# -lt 3; then - MS_Usage - fi - - LABEL="$3" - SCRIPT="$4" - test x$SCRIPT = x || shift 1 - shift 3 - SCRIPTARGS="$*" -fi - -if test "$KEEP" = n -a "$CURRENT" = y; then - echo "ERROR: It is A VERY DANGEROUS IDEA to try to combine --notemp and --current." >&2 - exit 1 -fi - -case $COMPRESS in -gzip) - GZIP_CMD="gzip -c9" - GUNZIP_CMD="gzip -cd" - ;; -bzip2) - GZIP_CMD="bzip2 -9" - GUNZIP_CMD="bzip2 -d" - ;; -Unix) - GZIP_CMD="compress -cf" - GUNZIP_CMD="exec 2>&-; uncompress -c || test \\\$? -eq 2 || gzip -cd" - ;; -none) - GZIP_CMD="cat" - GUNZIP_CMD="cat" - ;; -esac - -tmpfile="${TMPDIR:=/tmp}/mkself$$" - -if test -f $HEADER; then - oldarchname="$archname" - archname="$tmpfile" - # Generate a fake header to count its lines - SKIP=0 - . $HEADER - SKIP=`cat "$tmpfile" |wc -l` - # Get rid of any spaces - SKIP=`expr $SKIP` - rm -f "$tmpfile" - echo Header is $SKIP lines long >&2 - - archname="$oldarchname" -else - echo "Unable to open header file: $HEADER" >&2 - exit 1 -fi - -echo - -if test "$APPEND" = n; then - if test -f "$archname"; then - echo "WARNING: Overwriting existing file: $archname" >&2 - fi -fi - -USIZE=`du -ks $archdir | cut -f1` -DATE=`LC_ALL=C date` - -echo About to compress $USIZE KB of data... -echo Adding files to archive named \"$archname\"... -(cd "$archdir"; tar $TAR_ARGS - * | eval "$GZIP_CMD" ) >> "$tmpfile" || { echo Aborting; rm -f "$tmpfile"; exit 1; } -echo >> "$tmpfile" >&- # try to close the archive - -fsize=`cat "$tmpfile" | wc -c | tr -d " "` - -# Compute the checksums - -md5sum=00000000000000000000000000000000 -crcsum=`cat "$tmpfile" | cksum | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1` -echo "CRC: $crcsum" - -# Try to locate a MD5 binary -OLD_PATH=$PATH -PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} -MD5_PATH=`type -p md5sum` -MD5_PATH=${MD5_PATH:-`type -p md5`} -PATH=$OLD_PATH - -if test -x "$MD5_PATH"; then - md5sum=`cat "$tmpfile" | "$MD5_PATH" | cut -b-32`; - echo "MD5: $md5sum" -else - echo "MD5: none, md5sum binary not found" -fi - -if test "$APPEND" = y; then - mv "$archname" "$archname".bak || exit - - # Prepare entry for new archive - filesizes="$filesizes $fsize" - CRCsum="$CRCsum $crcsum" - MD5sum="$MD5sum $md5sum" - USIZE=`expr $USIZE + $OLDUSIZE` - # Generate the header - . $HEADER - # Append the original data - tail -n +$OLDSKIP "$archname".bak >> "$archname" - # Append the new data - cat "$tmpfile" >> "$archname" - - chmod +x "$archname" - rm -f "$archname".bak - echo Self-extractible archive \"$archname\" successfully updated. -else - filesizes="$fsize" - CRCsum="$crcsum" - MD5sum="$md5sum" - - # Generate the header - . $HEADER - - # Append the compressed tar data after the stub - echo - cat "$tmpfile" >> "$archname" - chmod +x "$archname" - echo Self-extractible archive \"$archname\" successfully created. -fi -rm -f "$tmpfile" diff --git a/setup/linux/makeself/update-readme b/setup/linux/makeself/update-readme deleted file mode 100755 index 5c918e6d..00000000 --- a/setup/linux/makeself/update-readme +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# Grab the Makeself web page - -echo The following was generated from http://www.megastep.org/makeself/ > README -echo ----------------------- >> README -echo >> README -lynx -dump http://www.megastep.org/makeself/ >> README diff --git a/setup/linux/nightly.cf b/setup/linux/nightly.cf deleted file mode 100644 index f9fe4abc..00000000 --- a/setup/linux/nightly.cf +++ /dev/null @@ -1,14 +0,0 @@ -# Linux build config -# all.cf -# -# includes core + wolfpack + q3pack - -$DO_CORE=1; -$DO_GAME_Q3=1; -$DO_GAME_WOLF=1; - -$DO_NIGHTLY=1; - -# the nightly is meant to overwrite an existing full installation -# see postinstall.sh, it would be better to have a clear indication of nightly -$GTKRAD_BASE_VERSION="1.2"; diff --git a/setup/linux/q3.cf b/setup/linux/q3.cf deleted file mode 100644 index 0e5de223..00000000 --- a/setup/linux/q3.cf +++ /dev/null @@ -1,8 +0,0 @@ -# Linux build config -# q3.cf -# -# includes core + q3pack - -$DO_CORE=1; -$DO_GAME_Q3=1; -$DO_GAME_WOLF=0; diff --git a/setup/linux/rpm_build.sh b/setup/linux/rpm_build.sh deleted file mode 100644 index 8ca84117..00000000 --- a/setup/linux/rpm_build.sh +++ /dev/null @@ -1 +0,0 @@ -rpmbuild --buildroot=/home/spog/rpmbuild/ -ba ./GtkRadiant/setup/linux/gtkradiant-1.5.0.spec diff --git a/setup/linux/setup.sh b/setup/linux/setup.sh deleted file mode 100644 index 8d920290..00000000 --- a/setup/linux/setup.sh +++ /dev/null @@ -1,124 +0,0 @@ -#! /bin/sh -# -# Product setup script - Loki Entertainment Software - -# TTimo FIXME need a way to configure this easily -critical_error="Please contact Id software technical support at bugs@idsoftware.com" - -# Go to the proper setup directory (if not already there) -cd `dirname $0` - -# Return the appropriate architecture string -DetectARCH() -{ - status=1 - case `uname -m` in - i?86) echo "x86" - status=0;; - *) echo "`uname -m`" - status=0;; - esac - return $status -} - -# Return the appropriate version string -DetectLIBC() -{ - status=1 - if [ `uname -s` != Linux ]; then - echo "glibc-2.1" - return $status - fi - if [ -f `echo /lib/libc.so.6* | tail -1` ]; then - if fgrep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then - echo "glibc-2.1" - status=0 - else - echo "glibc-2.0" - status=0 - fi - elif [ -f /lib/libc.so.5 ]; then - echo "libc5" - status=0 - else - echo "unknown" - fi - return $status -} - -# Detect the Linux environment -arch=`DetectARCH` -libc=`DetectLIBC` -os=`uname -s` - -# Find the installation program -# try_run INSTALLER_NAME [-fatal] [PARAMETERS_PASSED] -# INSTALLER_NAME: setup.gtk or setup -# -fatal option: if you want verbose messages in case -# - the script could not be found -# - it's execution would fail -# PARAMETERS_PASSED: additional arguments passed to the setup script -try_run() -{ - setup=$1 - shift - # added safe check, direct test seems buggy on older bash - if [ "$#" > 0 ]; then - # looks like bash < 2.* don't like == operator, using = instead - if [ "$1" = "-fatal" ]; then - # got fatal - fatal=$1 - shift - fi - fi - - # First find the binary we want to run - failed=0 - setup_bin="setup.data/bin/$os/$arch/$libc/$setup" - # trying $setup_bin - if [ ! -f "$setup_bin" ]; then - setup_bin="setup.data/bin/$os/$arch/$setup" - # libc dependant version failed, trying again - if [ ! -f "$setup_bin" ]; then - failed=1 - fi - fi - if [ "$failed" -eq 1 ]; then - if [ "$fatal" != "" ]; then - cat <<__EOF__ -This installation doesn't support $libc on $os / $arch - -$critical_error -__EOF__ - exit 1 - fi - return $failed - fi - - # Try to run the binary ($setup_bin) - # The executable is here but we can't execute it from CD - setup="$HOME/.setup$$" - cp "$setup_bin" "$setup" - chmod 700 "$setup" - if [ "$fatal" != "" ]; then - "$setup" $* - failed=$? - else - "$setup" $* 2>/dev/null - failed=$? - fi - rm -f "$setup" - return $failed -} - - -# Try to run the setup program -status=0 -rm -f "$setup" -try_run setup.gtk $* || try_run setup -fatal $* || { - echo "The setup program seems to have failed on $arch/$libc" - echo - echo $critical_error - status=1 -} -exit $status diff --git a/setup/linux/setup_image.Linux/setup.data/bin/Linux/x86/glibc-2.1/setup.gtk b/setup/linux/setup_image.Linux/setup.data/bin/Linux/x86/glibc-2.1/setup.gtk deleted file mode 100644 index 1fdeadd2..00000000 Binary files a/setup/linux/setup_image.Linux/setup.data/bin/Linux/x86/glibc-2.1/setup.gtk and /dev/null differ diff --git a/setup/linux/setup_image/setup.data/config.games.sh b/setup/linux/setup_image/setup.data/config.games.sh deleted file mode 100644 index 8a3d509e..00000000 --- a/setup/linux/setup_image/setup.data/config.games.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# Script for generating .game files - -# generate game support files -# Expects params (game, game path_prefix) - -exec >/dev/tty - - if [ $# -lt 2 ] ; then - echo "Incorrect number of params to GenGameFiles"; - return; - fi - - # NOTE: the naming of the vars here doesn't follow attributes names in XML, it can be confusing - game=$1; - INPUT_FILE="games/$game.game"; - game_engine=`grep "enginepath_linux=" $INPUT_FILE | awk -F"\"" '{print $2 }'` - game_engine_path=$SETUP_COMPONENT_PATH; - game_tools=$2; - OUT_FILE="$game_tools/games/$game.game"; - - echo -e "Generating game file '$OUT_FILE' from '$INPUT_FILE' with the following values..."; - echo -e "\tGame :\t $game"; - echo -e "\tGame Engine :\t $game_engine_path/$game_engine"; - echo -e "\tGame Tools :\t $game_tools"; - - if [ -f "$OUT_FILE" ] ; then - rm -f $OUT_FILE; - fi - - if [ ! -d "$game_tools/games" ] ; then - mkdir "$game_tools/games"; - fi - -sed -e 's!enginepath_linux=\".*.\"!enginepath_linux=\"'$game_engine_path'\"\n gametools=\"'$game_tools/$game'\"!g' <$INPUT_FILE >$OUT_FILE - -exit 0; diff --git a/setup/linux/setup_image/setup.data/config.sh.in b/setup/linux/setup_image/setup.data/config.sh.in deleted file mode 100644 index 4854795d..00000000 --- a/setup/linux/setup_image/setup.data/config.sh.in +++ /dev/null @@ -1,15 +0,0 @@ -# -# Use this script to customize the installer bootstrap script -# - -# override some defaults - -# try to get root prior to running setup? -# 0: no -# 1: prompt, but run anyway if fails -# 2: require, abort if root fails -ifdef(`M4_OSX', `GET_ROOT=2') - -FATAL_ERROR="Please report to http://zerowing.idsoftware.com/bugzilla/" - -#XSU_ICON="-i icon.xpm" diff --git a/setup/linux/setup_image/setup.data/postinstall.sh.in b/setup/linux/setup_image/setup.data/postinstall.sh.in deleted file mode 100644 index 9a7f62fc..00000000 --- a/setup/linux/setup_image/setup.data/postinstall.sh.in +++ /dev/null @@ -1,64 +0,0 @@ -dnl `uname -m` quoting is a nightmare -dnl TTimo: You could do: `uname -a` -changequote([, ]) - -#!/bin/sh -# post installation script, finalize everything - -# The install path is the first argument of the script -install_path="$1" - -# Return the appropriate architecture string -function DetectARCH { - status=1 - case `uname -m` in - i?86) echo "x86" - status=0;; - *) case `uname -p` in - powerpc) echo "ppc" - status=0;; - *) echo "unknown" - status=0;; - esac - esac - return $status -} -arch=`DetectARCH` - -# Create a wrapper script -cat <<__EOF__ >"$install_path/radiant" -#!/bin/sh -# Needed to make symlinks/shortcuts work. -# Run map editor with some default arguments - -cd "$install_path" -radiant="./radiant.$arch" -# gcc 3.x, trying to reduce ABI issues -export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH -"\$radiant" \$* -exit \$? -__EOF__ - -chmod 755 "$install_path/radiant" - -# Create a q3map2 wrapper script -cat <<__EOF__ >"$install_path/q3map2" -#!/bin/sh -# Needed to make symlinks/shortcuts work. - -cd "$install_path" -q3map2="./q3map2.$arch" -# gcc 3.x, trying to reduce ABI issues -export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH -"\$q3map2" \$* -exit \$? -__EOF__ - -chmod 755 "$install_path/q3map2" - -# setup the safe guard -echo "M4_VER_MAJOR" > $install_path/RADIANT_MAJOR -echo "M4_VER_MINOR" > $install_path/RADIANT_MINOR - -# why the fuck is openurl.sh not +x by default anyway -chmod 755 "$install_path/openurl.sh" diff --git a/setup/linux/setup_image/setup.data/setup.glade b/setup/linux/setup_image/setup.data/setup.glade deleted file mode 100644 index 3b956a25..00000000 --- a/setup/linux/setup_image/setup.data/setup.glade +++ /dev/null @@ -1,2192 +0,0 @@ - - - - - Setup - setup - - src - pixmaps - C - False - True - False - True - setup.txt - - - - GtkWindow - setup_window - False - - delete_event - setup_button_cancel_slot - Wed, 15 Sep 1999 01:24:58 GMT - - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - - - GtkHBox - hbox1 - False - 0 - - - GtkFrame - image_frame - 5 - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkLabel - label30 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - GtkNotebook - setup_notebook - 5 - False - True - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - - - - GtkVBox - class_continue - True - 0 - - - GtkLabel - label69 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkRadioButton - recommended_but - 9 - This will install the product with the default options and paths - True - - True - True - install_class - - 0 - False - False - - - - - GtkRadioButton - expert_but - 10 - This will allow you to pick the installation paths and options to be installed - True - - False - True - install_class - - 0 - False - False - - - - - GtkHBox - hbox4 - True - 0 - - 0 - True - False - GTK_PACK_END - - - - GtkButton - class_cancel - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_exit_slot - Thu, 13 Sep 2001 23:46:19 GMT - - - GTK_RELIEF_NORMAL - - 0 - False - False - - - - - GtkButton - class_readme - True - True - - 0 - GDK_F1 - clicked - - - clicked - setup_button_view_readme_slot - Thu, 13 Sep 2001 23:23:42 GMT - - - GTK_RELIEF_NORMAL - - 0 - False - False - - - - - GtkButton - class_continue - True - True - True - - 0 - GDK_Return - clicked - - - clicked - on_class_continue_clicked - Thu, 13 Sep 2001 23:39:48 GMT - - - GTK_RELIEF_NORMAL - - 0 - False - False - - - - - - - GtkLabel - Notebook:tab - setup_class - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table11 - 4 - 1 - False - 0 - 0 - - - GtkFrame - global_frame - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - True - True - False - False - True - True - - - - GtkTable - table12 - 5 - 3 - 2 - False - 5 - 5 - - - GtkLabel - label23 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - install_path - False - True - False - True - False - - - 1 - 2 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - GtkEntry - GtkCombo:entry - install_entry - True - - focus_out_event - setup_entry_installpath_slot - Wed, 15 Sep 1999 01:04:39 GMT - - True - True - 0 - - - - - - GtkLabel - binary_label - - GTK_JUSTIFY_RIGHT - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - binary_path - False - True - False - True - False - - - 1 - 2 - 2 - 3 - 0 - 0 - True - False - False - False - True - False - - - - GtkEntry - GtkCombo:entry - binary_entry - Symbolic links to installed binaries are placed here - True - - focus_out_event - setup_entry_binarypath_slot - Wed, 15 Sep 1999 01:06:14 GMT - - True - True - 0 - - - - - - GtkCheckButton - symlink_checkbox - True - True - True - - toggled - on_use_binary_toggled - Thu, 03 Aug 2000 09:53:24 GMT - - - True - True - - 0 - 2 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - - - GtkFrame - frame10 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 1 - 2 - 0 - 0 - False - True - False - False - True - True - - - - GtkTable - table13 - 5 - 4 - 4 - False - 5 - 5 - - - GtkLabel - label_free_space - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 1 - 2 - 2 - 3 - 0 - 0 - False - False - False - False - False - False - - - - - GtkLabel - label_install_size - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 3 - 4 - 2 - 3 - 0 - 0 - False - False - False - False - False - False - - - - - GtkVBox - option_vbox - False - 0 - - 0 - 4 - 0 - 1 - 0 - 0 - True - True - False - False - True - True - - - - GtkLabel - label31 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - - GtkLabel - free_space_label - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - estim_size_label - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 2 - 3 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCheckButton - setup_menuitems_checkbox - True - - toggled - setup_checkbox_menuitems_slot - Thu, 16 Sep 1999 01:16:33 GMT - - - True - True - - 0 - 4 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkHSeparator - install_separator - - 0 - 4 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - - - - - - GtkHButtonBox - hbuttonbox3 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 60 - 27 - 7 - 0 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - - - - GtkButton - button_cancel - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_exit_slot - Tue, 14 Sep 1999 22:58:10 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button_readme - True - True - - 0 - GDK_F1 - clicked - - - clicked - setup_button_view_readme_slot - Wed, 15 Sep 1999 01:10:59 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button_install - True - True - - clicked - setup_button_install_slot - Tue, 14 Sep 1999 22:36:50 GMT - - - GTK_RELIEF_NORMAL - - - - - GtkLabel - options_status - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - - GtkLabel - Notebook:tab - setup_options - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table14 - 2 - 1 - False - 5 - 5 - - - GtkFrame - frame13 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - - - - GtkVBox - vbox10 - 5 - False - 0 - - - GtkLabel - label39 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkVBox - vbox11 - False - 0 - - 0 - True - True - - - - GtkLabel - current_option_label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label50 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - current_file_label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkProgressBar - current_file_progress - 0 - 0 - 100 - GTK_PROGRESS_CONTINUOUS - GTK_PROGRESS_LEFT_TO_RIGHT - False - False - %P %% - 0.5 - 0.5 - - 0 - False - False - - - - - - GtkVBox - vbox12 - False - 0 - - 0 - True - True - - - - GtkLabel - label41 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkProgressBar - total_file_progress - 0 - 0 - 100 - GTK_PROGRESS_CONTINUOUS - GTK_PROGRESS_LEFT_TO_RIGHT - False - False - %P %% - 0.5 - 0.5 - - 0 - False - False - - - - - - - - GtkHButtonBox - hbuttonbox4 - GTK_BUTTONBOX_START - 5 - 60 - 27 - 7 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkButton - button12 - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_cancel_slot - Tue, 14 Sep 1999 19:53:47 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - view_readme_progress_button - True - True - - 0 - GDK_F1 - clicked - - - clicked - setup_button_view_readme_slot - Wed, 15 Sep 1999 01:11:10 GMT - - - GTK_RELIEF_NORMAL - - - - - - GtkLabel - Notebook:tab - setup_install - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table15 - 2 - 1 - False - 5 - 5 - - - GtkHButtonBox - hbuttonbox5 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 60 - 27 - 7 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkButton - button15 - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_exit_slot - Tue, 14 Sep 1999 22:58:23 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - view_readme_end_button - True - True - - 0 - GDK_F1 - clicked - - - clicked - setup_button_view_readme_slot - Wed, 15 Sep 1999 01:11:23 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - play_game_button - True - True - - 0 - GDK_Return - clicked - - - 0 - GDK_space - enter - - - clicked - setup_button_play_slot - Tue, 14 Sep 1999 22:35:17 GMT - - - GTK_RELIEF_NORMAL - - - - - GtkFrame - frame14 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - - - - GtkVBox - vbox15 - 5 - False - 0 - - - GtkLabel - label45 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - setup_complete_label - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label54 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label55 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - install_directory_label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label57 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - play_game_label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - - - - GtkLabel - Notebook:tab - setup_complete - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table16 - 2 - 1 - False - 5 - 5 - - - GtkHButtonBox - hbuttonbox6 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 120 - 27 - 7 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkButton - button18 - True - True - - 0 - GDK_Return - clicked - - - 0 - GDK_Escape - clicked - - - clicked - setup_button_abort_slot - Wed, 06 Feb 2002 01:32:49 GMT - - - GTK_RELIEF_NORMAL - - - - - GtkFrame - frame15 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - - - - GtkVBox - vbox16 - 5 - False - 0 - - - GtkLabel - label48 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label49 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - - - - GtkLabel - Notebook:tab - setup_abort - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table17 - 2 - 1 - False - 5 - 5 - - - GtkHButtonBox - hbuttonbox7 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 60 - 27 - 7 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkButton - button21 - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_warning_cancel_slot - Wed, 29 Sep 1999 21:51:04 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button22 - True - True - True - - 0 - GDK_Return - clicked - - - clicked - setup_button_warning_continue_slot - Wed, 29 Sep 1999 21:50:51 GMT - - - GTK_RELIEF_NORMAL - - - - - GtkFrame - frame16 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - - - - GtkVBox - vbox17 - 5 - False - 0 - - - GtkLabel - warning_label - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 5 - 0 - - 0 - False - False - - - - - - - - GtkLabel - Notebook:tab - setup_warning - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table18 - 2 - 1 - False - 5 - 5 - - - GtkHButtonBox - hbuttonbox10 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 60 - 27 - 7 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - - - GtkButton - button30 - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_exit_slot - Tue, 14 Sep 1999 22:58:23 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button31 - True - True - - 0 - GDK_F1 - clicked - - - clicked - setup_button_view_readme_slot - Wed, 15 Sep 1999 01:11:23 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button32 - True - True - True - - clicked - setup_button_complete_slot - Sat, 11 Dec 1999 04:16:26 GMT - - - GTK_RELIEF_NORMAL - - - - - GtkFrame - frame17 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 0 - 1 - 0 - 0 - False - True - False - False - True - True - - - - GtkVBox - vbox20 - 5 - False - 0 - - - GtkLabel - label60 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkHBox - hbox3 - False - 0 - - 0 - False - False - - - - GtkLabel - label67 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - website_product_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - - GtkLabel - website_text_label - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label63 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label65 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - auto_url_yes - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkHButtonBox - auto_url_no - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button33 - True - True - - clicked - setup_button_browser_slot - Sat, 11 Dec 1999 04:35:32 GMT - - - GTK_RELIEF_NORMAL - - - - - - - - GtkLabel - Notebook:tab - setup_website - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - - GtkDialog - readme_dialog - 480 - 360 - False - - destroy - setup_destroy_view_readme_slot - - Readme File - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - True - False - - - GtkVBox - Dialog:vbox - dialog-vbox1 - False - 0 - - - GtkHBox - Dialog:action_area - dialog-action_area1 - 10 - True - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button20 - True - True - - 0 - GDK_Return - clicked - - - 0 - GDK_Escape - clicked - - - clicked - setup_close_view_readme_slot - Wed, 15 Sep 1999 01:10:31 GMT - - - GTK_RELIEF_NORMAL - - 0 - False - True - - - - - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkText - readme_area - True - False - - - - - - - - GtkDialog - license_dialog - 480 - 360 - False - - destroy - setup_destroy_license_slot - - License Agreement - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - True - True - True - False - - - GtkVBox - Dialog:vbox - vbox19 - False - 0 - - - GtkHBox - Dialog:action_area - hbox2 - 10 - True - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkHButtonBox - hbuttonbox9 - GTK_BUTTONBOX_DEFAULT_STYLE - 5 - 60 - 27 - 7 - 0 - - 0 - False - True - - - - GtkButton - button28 - True - True - - 0 - GDK_Escape - clicked - - - clicked - setup_button_exit_slot - Tue, 14 Sep 1999 22:58:10 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button29 - True - True - - 0 - GDK_Y - clicked - - - 0 - GDK_y - clicked - - - 0 - GDK_Return - clicked - - - clicked - setup_button_license_agree_slot - Tue, 30 Nov 1999 01:28:20 GMT - - - GTK_RELIEF_NORMAL - - - - - - GtkScrolledWindow - scrolledwindow3 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkText - license_area - True - False - - - - - - - - GtkDialog - subcomponent_dialog - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - True - False - - - GtkVBox - Dialog:vbox - vbox21 - False - 2 - - - GtkHBox - Dialog:action_area - hbox5 - 2 - True - 2 - - 2 - False - True - GTK_PACK_END - - - - GtkHButtonBox - hbuttonbox11 - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - subcomponent_button_cancel - True - True - - clicked - setup_button_subcomponent_cancel - Wed, 09 Jan 2002 21:54:50 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - subcomponent_button_ok - True - True - - clicked - setup_button_subcomponent_ok - Wed, 09 Jan 2002 21:54:13 GMT - - - GTK_RELIEF_NORMAL - - - - - - GtkFrame - subcomponent_frame - 2 - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - False - - - - Placeholder - - - - - - diff --git a/setup/linux/setup_image/setup.data/setup.xml.in b/setup/linux/setup_image/setup.data/setup.xml.in deleted file mode 100644 index e8a346f1..00000000 --- a/setup/linux/setup_image/setup.data/setup.xml.in +++ /dev/null @@ -1,139 +0,0 @@ - - -ifdef(`M4_OSX', ` - /sw/games - /Applications - ') - - license.txt - - - README - - - - - - - - ifelse(M4_GAME_ET, `1', ` - - ') - ifelse(M4_GAME_DOOM3, `1', ` - - ') - ifelse(M4_GAME_Q2, `1', ` - - ') - ifdef(`M4_OSX', `',` ') - - diff --git a/setup/linux/setup_image/setup.data/splash.xpm b/setup/linux/setup_image/setup.data/splash.xpm deleted file mode 100644 index 448687ea..00000000 --- a/setup/linux/setup_image/setup.data/splash.xpm +++ /dev/null @@ -1,23719 +0,0 @@ -/* XPM */ -static char * splash_xpm[] = { -"340 294 23422 3", -" c None", -". c #0B090B", -"+ c #09080A", -"@ c #080708", -"# c #050506", -"$ c #030304", -"% c #040404", -"& c #575757", -"* c #E6E6E6", -"= c #FFFFFF", -"- c #DEDEDE", -"; c #535353", -"> c #040304", -", c #060506", -"' c #0A090B", -") c #0C0A0C", -"! c #0C0B0D", -"~ c #0D0B0D", -"{ c #0D0B0E", -"] c #0E0C0E", -"^ c #0E0E0E", -"/ c #0D0D0E", -"( c #0E0C0F", -"_ c #0D0C0E", -": c #0B0A0C", -"< c #0C0A0D", -"[ c #0F0E10", -"} c #1A1F1F", -"| c #191F1F", -"1 c #171C1C", -"2 c #1D201F", -"3 c #171A19", -"4 c #111312", -"5 c #090B0B", -"6 c #C0C0C0", -"7 c #909090", -"8 c #0D1011", -"9 c #141919", -"0 c #161B1B", -"a c #151B1B", -"b c #171C1E", -"c c #1B2022", -"d c #222727", -"e c #1C2120", -"f c #171B1C", -"g c #1A1E1D", -"h c #272C28", -"i c #1D2120", -"j c #15191A", -"k c #131717", -"l c #101314", -"m c #0F1212", -"n c #0B0D0D", -"o c #A8A9A9", -"p c #F1F1F1", -"q c #BABABA", -"r c #6B6B6B", -"s c #181718", -"t c #020203", -"u c #080709", -"v c #0E0D0F", -"w c #0F0D10", -"x c #100E11", -"y c #110F12", -"z c #070608", -"A c #050405", -"B c #F9F9F9", -"C c #575658", -"D c #0B0B0D", -"E c #0A0A0C", -"F c #080809", -"G c #575758", -"H c #666767", -"I c #161819", -"J c #212325", -"K c #2C3032", -"L c #35393C", -"M c #383D41", -"N c #3D4246", -"O c #3F4447", -"P c #454B4B", -"Q c #515757", -"R c #464B4C", -"S c #404246", -"T c #3B3E41", -"U c #474A49", -"V c #4D4F4A", -"W c #393B3C", -"X c #37393D", -"Y c #383D40", -"Z c #303538", -"` c #363B3E", -" . c #3A3F42", -".. c #34393C", -"+. c #373C3F", -"@. c #3B4043", -"#. c #3B4041", -"$. c #3B4141", -"%. c #3F4545", -"&. c #4E5355", -"*. c #6D7373", -"=. c #707674", -"-. c #707877", -";. c #707775", -">. c #767B78", -",. c #7B7E7B", -"'. c #737875", -"). c #69706F", -"!. c #6B726F", -"~. c #6E7471", -"{. c #6F7574", -"]. c #696B6D", -"^. c #1D1E20", -"/. c #100E10", -"(. c #100F10", -"_. c #101010", -":. c #0F0F0F", -"<. c #0F0E0F", -"[. c #0A080A", -"}. c #070607", -"|. c #040405", -"1. c #868687", -"2. c #F8F8F8", -"3. c #F7F7F8", -"4. c #8C8C8C", -"5. c #0C0C0C", -"6. c #0D0D0D", -"7. c #0C0B0C", -"8. c #0A080B", -"9. c #0D0D0F", -"0. c #191E1E", -"a. c #161A19", -"b. c #141716", -"c. c #0E1010", -"d. c #8F9090", -"e. c #080B0B", -"f. c #111515", -"g. c #1D2222", -"h. c #191F20", -"i. c #191F21", -"j. c #222827", -"k. c #262B2A", -"l. c #1D2122", -"m. c #181C1D", -"n. c #1B1F1F", -"o. c #282D29", -"p. c #202424", -"q. c #181B1C", -"r. c #16191A", -"s. c #121515", -"t. c #0D1010", -"u. c #A9A9A9", -"v. c #FEFEFE", -"w. c #E0E0E0", -"x. c #5D5C5D", -"y. c #090809", -"z. c #0B0A0D", -"A. c #656767", -"B. c #151819", -"C. c #212426", -"D. c #2D3133", -"E. c #34383B", -"F. c #404549", -"G. c #44494B", -"H. c #4C5252", -"I. c #505656", -"J. c #43494A", -"K. c #414549", -"L. c #4C5150", -"M. c #37393B", -"N. c #36393C", -"O. c #313538", -"P. c #313639", -"Q. c #353A3D", -"R. c #454A4D", -"S. c #494E50", -"T. c #323739", -"U. c #2E3336", -"V. c #6E7472", -"W. c #727876", -"X. c #787C7A", -"Y. c #7B7E79", -"Z. c #7A7D79", -"`. c #707472", -" + c #6D7370", -".+ c #6D7372", -"++ c #656869", -"@+ c #1E1E20", -"#+ c #0B090C", -"$+ c #09090A", -"%+ c #908F90", -"&+ c #AAAAAA", -"*+ c #121212", -"=+ c #0D0C0D", -"-+ c #0B0B0C", -";+ c #0B0B0B", -">+ c #0A0A0A", -",+ c #0A090A", -"'+ c #141819", -")+ c #181D1D", -"!+ c #151818", -"~+ c #131616", -"{+ c #0F1110", -"]+ c #8F8F90", -"^+ c #090B0C", -"/+ c #141718", -"(+ c #171B1B", -"_+ c #1F2424", -":+ c #1A2020", -"<+ c #1B2122", -"[+ c #1A1F21", -"}+ c #191F1E", -"|+ c #232928", -"1+ c #1B1F20", -"2+ c #191D1E", -"3+ c #1E2221", -"4+ c #212623", -"5+ c #1C2020", -"6+ c #1A1D1E", -"7+ c #AAABAB", -"8+ c #FBFBFB", -"9+ c #8E8E8E", -"0+ c #100F12", -"a+ c #100F11", -"b+ c #0E0D10", -"c+ c #565657", -"d+ c #171A1B", -"e+ c #232628", -"f+ c #383C3F", -"g+ c #404448", -"h+ c #43484B", -"i+ c #43484A", -"j+ c #464C4C", -"k+ c #4D5353", -"l+ c #42494A", -"m+ c #41474A", -"n+ c #444B4C", -"o+ c #454B4C", -"p+ c #3C4145", -"q+ c #3C4143", -"r+ c #3B4042", -"s+ c #33383B", -"t+ c #32373A", -"u+ c #33383A", -"v+ c #32373B", -"w+ c #2E3337", -"x+ c #2C3235", -"y+ c #343A3B", -"z+ c #606664", -"A+ c #828480", -"B+ c #80827C", -"C+ c #7D807C", -"D+ c #6F7472", -"E+ c #697170", -"F+ c #707673", -"G+ c #686B6C", -"H+ c #202022", -"I+ c #060607", -"J+ c #FDFDFD", -"K+ c #B1B1B1", -"L+ c #0B0A0B", -"M+ c #070708", -"N+ c #070707", -"O+ c #060606", -"P+ c #060507", -"Q+ c #080608", -"R+ c #1C2021", -"S+ c #161919", -"T+ c #131516", -"U+ c #0F1111", -"V+ c #0A0B0B", -"W+ c #999999", -"X+ c #0C0E0F", -"Y+ c #272B29", -"Z+ c #212524", -"`+ c #1A1F20", -" @ c #191E1F", -".@ c #171D1E", -"+@ c #171D1D", -"@@ c #1A1E1E", -"#@ c #202423", -"$@ c #1F2323", -"%@ c #191C1D", -"&@ c #161A1A", -"*@ c #0A0C0C", -"=@ c #A9AAAA", -"-@ c #FCFCFC", -";@ c #868586", -">@ c #101012", -",@ c #0F0F11", -"'@ c #0F0E11", -")@ c #666768", -"!@ c #191B1C", -"~@ c #242729", -"{@ c #303336", -"]@ c #3B4044", -"^@ c #3E4347", -"/@ c #42474B", -"(@ c #464B4D", -"_@ c #4E5453", -":@ c #41474B", -"<@ c #42484B", -"[@ c #3B4144", -"}@ c #3A4041", -"|@ c #383E3E", -"1@ c #3C4243", -"2@ c #383E3F", -"3@ c #303539", -"4@ c #31363A", -"5@ c #292E31", -"6@ c #34393B", -"7@ c #696F6E", -"8@ c #787E7C", -"9@ c #777C7A", -"0@ c #787D7D", -"a@ c #6F7575", -"b@ c #6B7171", -"c@ c #707676", -"d@ c #696F70", -"e@ c #1F2022", -"f@ c #111012", -"g@ c #110F11", -"h@ c #100E0F", -"i@ c #080707", -"j@ c #0A0A0B", -"k@ c #5F5E5F", -"l@ c #FAFAFA", -"m@ c #8D8D8D", -"n@ c #363536", -"o@ c #6A6A6A", -"p@ c #6A6A6B", -"q@ c #5B5A5B", -"r@ c #101313", -"s@ c #0E1011", -"t@ c #0A0B0C", -"u@ c #C0C1C1", -"v@ c #9A9B9B", -"w@ c #151918", -"x@ c #232726", -"y@ c #232826", -"z@ c #1F2423", -"A@ c #161A1B", -"B@ c #161C1C", -"C@ c #1B1F21", -"D@ c #222626", -"E@ c #242828", -"F@ c #1E2122", -"G@ c #131617", -"H@ c #121516", -"I@ c #A8A8A8", -"J@ c #4F4F50", -"K@ c #09070A", -"L@ c #121013", -"M@ c #111013", -"N@ c #181A1B", -"O@ c #25282A", -"P@ c #34383A", -"Q@ c #363B3D", -"R@ c #3A3E42", -"S@ c #484D4F", -"T@ c #4F5454", -"U@ c #44494D", -"V@ c #3F4448", -"W@ c #3D4145", -"X@ c #404648", -"Y@ c #444A4A", -"Z@ c #393E40", -"`@ c #33383C", -" # c #373C40", -".# c #383D3F", -"+# c #393E41", -"@# c #2D3235", -"## c #2B3033", -"$# c #464C4D", -"%# c #747A7A", -"&# c #777D7D", -"*# c #757B7B", -"=# c #717777", -"-# c #1E1E21", -";# c #0C0C0F", -"># c #110F10", -",# c #606061", -"'# c #6B6A6B", -")# c #313031", -"!# c #030203", -"~# c #282728", -"{# c #ECECEC", -"]# c #545354", -"^# c #787878", -"/# c #D6D6D6", -"(# c #111314", -"_# c #1A1D1D", -":# c #0F1112", -"<# c #080A0B", -"[# c #0E1111", -"}# c #131718", -"|# c #181D1E", -"1# c #1C2022", -"2# c #232727", -"3# c #212525", -"4# c #1E2223", -"5# c #111415", -"6# c #DBDBDC", -"7# c #1A1C1D", -"8# c #2F3335", -"9# c #484D51", -"0# c #4B5153", -"a# c #3F4347", -"b# c #3C4144", -"c# c #3A3F43", -"d# c #393D41", -"e# c #3E4345", -"f# c #404647", -"g# c #3C4044", -"h# c #3E4346", -"i# c #353A3E", -"j# c #545A5C", -"k# c #72777A", -"l# c #727878", -"m# c #737979", -"n# c #787E7E", -"o# c #767C7C", -"p# c #686F6E", -"q# c #1F1F21", -"r# c #0E0E10", -"s# c #E3E3E3", -"t# c #6C6C6D", -"u# c #0C0C0D", -"v# c #D7D7D7", -"w# c #131314", -"x# c #101213", -"y# c #121415", -"z# c #0C0F10", -"A# c #0F1214", -"B# c #15181A", -"C# c #1F2322", -"D# c #0C0E0D", -"E# c #797879", -"F# c #0F0D0F", -"G# c #050505", -"H# c #585758", -"I# c #676868", -"J# c #1D1F21", -"K# c #272B2D", -"L# c #2D3134", -"M# c #43474B", -"N# c #494E52", -"O# c #494E51", -"P# c #4D5254", -"Q# c #414649", -"R# c #414648", -"S# c #3F4445", -"T# c #35393D", -"U# c #373B3E", -"V# c #373C3D", -"W# c #393F3F", -"X# c #3E4445", -"Y# c #2F3438", -"Z# c #5C6164", -"`# c #777B79", -" $ c #757A79", -".$ c #717779", -"+$ c #73797A", -"@$ c #676B6C", -"#$ c #0E0D0E", -"$$ c #0F0E0E", -"%$ c #0E0E0F", -"&$ c #0D0C0F", -"*$ c #E3E2E3", -"=$ c #6C6C6C", -"-$ c #373737", -";$ c #F6F6F6", -">$ c #6B6B6C", -",$ c #787778", -"'$ c #0D0F0F", -")$ c #0B0C0C", -"!$ c #08090A", -"~$ c #0C0D0F", -"{$ c #0E1012", -"]$ c #101416", -"^$ c #181E1E", -"/$ c #1E2323", -"($ c #202626", -"_$ c #242827", -":$ c #1D2121", -"<$ c #0C0D0D", -"[$ c #DFDFDF", -"}$ c #0F0F10", -"|$ c #585759", -"1$ c #686969", -"2$ c #1E2022", -"3$ c #282B2D", -"4$ c #2F3235", -"5$ c #42464A", -"6$ c #42474A", -"7$ c #4A4F52", -"8$ c #4D5255", -"9$ c #404548", -"0$ c #44494C", -"a$ c #45494C", -"b$ c #3C4142", -"c$ c #393D40", -"d$ c #3A3F40", -"e$ c #303437", -"f$ c #2F3337", -"g$ c #2E3235", -"h$ c #303537", -"i$ c #353B3B", -"j$ c #3A3F3F", -"k$ c #3A3F41", -"l$ c #2F3437", -"m$ c #2C3134", -"n$ c #272C2F", -"o$ c #686C6C", -"p$ c #737878", -"q$ c #757C7C", -"r$ c #6F7577", -"s$ c #6D7274", -"t$ c #656769", -"u$ c #0E0C0D", -"v$ c #080808", -"w$ c #E2E2E2", -"x$ c #6C6B6C", -"y$ c #D0D0D0", -"z$ c #090909", -"A$ c #777778", -"B$ c #111414", -"C$ c #141717", -"D$ c #141617", -"E$ c #131515", -"F$ c #9A9A9B", -"G$ c #0C0D0E", -"H$ c #0D1012", -"I$ c #101315", -"J$ c #191D1F", -"K$ c #212626", -"L$ c #161B1A", -"M$ c #1E2121", -"N$ c #191D1C", -"O$ c #1C201F", -"P$ c #141818", -"Q$ c #111516", -"R$ c #0B0D0E", -"S$ c #414141", -"T$ c #121012", -"U$ c #565656", -"V$ c #0C0B0E", -"W$ c #0A090C", -"X$ c #49484A", -"Y$ c #CECECE", -"Z$ c #CECDCE", -"`$ c #CDCDCD", -" % c #CDCECE", -".% c #CFCFCF", -"+% c #CFD0D0", -"@% c #58595A", -"#% c #191C1E", -"$% c #232629", -"%% c #2C2F33", -"&% c #363A3E", -"*% c #494D50", -"=% c #484C4F", -"-% c #3C4043", -";% c #424648", -">% c #3A3E41", -",% c #363A3B", -"'% c #2A2E31", -")% c #2A2D30", -"!% c #292D30", -"~% c #292C2F", -"{% c #282C2E", -"]% c #2F3434", -"^% c #333838", -"/% c #2B3032", -"(% c #2C3133", -"_% c #2C3034", -":% c #2B3034", -"<% c #2A2F32", -"[% c #262B2E", -"}% c #272C2E", -"|% c #414347", -"1% c #6B7071", -"2% c #737A77", -"3% c #707677", -"4% c #6D7275", -"5% c #686C6F", -"6% c #5F6163", -"7% c #1B1B1D", -"8% c #0C0B0B", -"9% c #0C0C0E", -"0% c #E8E8E8", -"a% c #2C2C2C", -"b% c #777777", -"c% c #050606", -"d% c #111313", -"e% c #121414", -"f% c #070909", -"g% c #0E1212", -"h% c #0F1313", -"i% c #1B1E1F", -"j% c #191D1D", -"k% c #151919", -"l% c #111616", -"m% c #151718", -"n% c #090A0B", -"o% c #848485", -"p% c #555555", -"q% c #020202", -"r% c #060708", -"s% c #0E0F10", -"t% c #141618", -"u% c #222528", -"v% c #3F4348", -"w% c #373B3D", -"x% c #373A3D", -"y% c #35383B", -"z% c #323537", -"A% c #26292B", -"B% c #222527", -"C% c #212527", -"D% c #24282A", -"E% c #25292B", -"F% c #272C2B", -"G% c #2D3131", -"H% c #252A2B", -"I% c #23282A", -"J% c #252A2D", -"K% c #272B2E", -"L% c #2E3335", -"M% c #282D30", -"N% c #2F3436", -"O% c #4E5454", -"P% c #6E7473", -"Q% c #6D7172", -"R% c #6B6E70", -"S% c #636668", -"T% c #494B4C", -"U% c #707070", -"V% c #5D5D5D", -"W% c #AFAFAF", -"X% c #6E6E6E", -"Y% c #030303", -"Z% c #0C0F0F", -"`% c #070808", -" & c #0B0E0E", -".& c #121514", -"+& c #171919", -"@& c #0F1213", -"#& c #0E1112", -"$& c #0B0C0D", -"%& c #080909", -"&& c #BEBEBE", -"*& c #545454", -"=& c #0B090D", -"-& c #060707", -";& c #1B1D1F", -">& c #24282B", -",& c #414647", -"'& c #414547", -")& c #393E42", -"!& c #3B3F42", -"~& c #3A3E40", -"{& c #343839", -"]& c #2C3031", -"^& c #242728", -"/& c #232627", -"(& c #181A1C", -"_& c #1A1C1E", -":& c #17191A", -"<& c #191B1D", -"[& c #181C1C", -"}& c #1C1F1F", -"|& c #1F2122", -"1& c #2A2E30", -"2& c #2B2F32", -"3& c #292E30", -"4& c #313638", -"5& c #555A5B", -"6& c #5F6365", -"7& c #5E6264", -"8& c #3B3D3E", -"9& c #090709", -"0& c #3F3F3F", -"a& c #010101", -"b& c #C2C2C2", -"c& c #A6A6A6", -"d& c #767676", -"e& c #0C0E0E", -"f& c #A5A5A5", -"g& c #060808", -"h& c #080A0A", -"i& c #090C0C", -"j& c #0D0F0E", -"k& c #0E100F", -"l& c #121413", -"m& c #121412", -"n& c #101211", -"o& c #0A0D0D", -"p& c #A7A7A8", -"q& c #E5E5E5", -"r& c #161616", -"s& c #111011", -"t& c #262627", -"u& c #494949", -"v& c #696969", -"w& c #7B7B7B", -"x& c #868686", -"y& c #858586", -"z& c #7C7C7C", -"A& c #525152", -"B& c #2F2E2F", -"C& c #1A1A1A", -"D& c #484848", -"E& c #737373", -"F& c #858485", -"G& c #7F7F7F", -"H& c #626263", -"I& c #323233", -"J& c #09090B", -"K& c #050406", -"L& c #040504", -"M& c #040505", -"N& c #1B1E20", -"O& c #3D4243", -"P& c #4B504F", -"Q& c #484D4D", -"R& c #363A3D", -"S& c #333639", -"T& c #303436", -"U& c #2D3130", -"V& c #2A2D2D", -"W& c #262828", -"X& c #1E2020", -"Y& c #202122", -"Z& c #303233", -"`& c #515253", -" * c #6F7071", -".* c #818282", -"+* c #8C8D8D", -"@* c #8B8C8C", -"#* c #848484", -"$* c #767777", -"%* c #5E5F5F", -"&* c #3B3D3D", -"** c #272828", -"=* c #19191A", -"-* c #181919", -";* c #1B1D1E", -">* c #222426", -",* c #52585A", -"'* c #505657", -")* c #494F50", -"!* c #323435", -"~* c #1D1D1E", -"{* c #4D4D4E", -"]* c #757576", -"^* c #7E7D7E", -"/* c #5F5F5F", -"(* c #2D2D2E", -"_* c #010102", -":* c #090A0A", -"<* c #A6A7A7", -"[* c #080A09", -"}* c #4B4C4B", -"|* c #656665", -"1* c #646665", -"2* c #686968", -"3* c #666766", -"4* c #646565", -"5* c #636564", -"6* c #636464", -"7* c #676869", -"8* c #646566", -"9* c #4C4D4D", -"0* c #0A0C0D", -"a* c #A7A7A7", -"b* c #353535", -"c* c #A1A1A1", -"d* c #252526", -"e* c #3B3B3C", -"f* c #939394", -"g* c #D5D5D5", -"h* c #F7F7F7", -"i* c #B5B5B5", -"j* c #666566", -"k* c #151415", -"l* c #1A1A1B", -"m* c #6D6C6D", -"n* c #616162", -"o* c #605F60", -"p* c #606060", -"q* c #606161", -"r* c #626262", -"s* c #636364", -"t* c #313334", -"u* c #323637", -"v* c #393D3F", -"w* c #434749", -"x* c #2C2F31", -"y* c #26292A", -"z* c #1F2121", -"A* c #1E1F1F", -"B* c #444545", -"C* c #969697", -"D* c #BCBCBC", -"E* c #717272", -"F* c #222324", -"G* c #252829", -"H* c #272A2C", -"I* c #2F3336", -"J* c #303638", -"K* c #2C3436", -"L* c #2D3335", -"M* c #2E3234", -"N* c #474D4D", -"O* c #424747", -"P* c #78797A", -"Q* c #616061", -"R* c #616161", -"S* c #3E3E3F", -"T* c #212121", -"U* c #99999A", -"V* c #EBEBEB", -"W* c #C5C5C5", -"X* c #4E4D4E", -"Y* c #BBBBBB", -"Z* c #020102", -"`* c #E4E4E4", -" = c #060706", -".= c #BFC0C0", -"+= c #0D0E0E", -"@= c #DBDBDB", -"#= c #A7A8A8", -"$= c #ADADAD", -"%= c #3E3E3E", -"&= c #EDEDED", -"*= c #838283", -"== c #464647", -"-= c #D2D2D2", -";= c #343434", -">= c #35393A", -",= c #363B3C", -"'= c #282C2D", -")= c #242628", -"!= c #1D2021", -"~= c #171A1A", -"{= c #454747", -"]= c #BDBEBE", -"^= c #F2F2F2", -"/= c #292B2B", -"(= c #191B1B", -"_= c #25292C", -":= c #272D30", -"<= c #2B3234", -"[= c #2C3234", -"}= c #2F3234", -"|= c #272A2B", -"1= c #323636", -"2= c #3C3E3F", -"3= c #939293", -"4= c #989898", -"5= c #414041", -"6= c #F5F5F5", -"7= c #272727", -"8= c #6F6F6F", -"9= c #D5D6D6", -"0= c #BFBFBF", -"a= c #303131", -"b= c #525353", -"c= c #878787", -"d= c #F3F3F3", -"e= c #CECECF", -"f= c #363636", -"g= c #4B4B4C", -"h= c #F0F0F0", -"i= c #EAEAEA", -"j= c #656667", -"k= c #16181A", -"l= c #313637", -"m= c #303435", -"n= c #323638", -"o= c #292C2E", -"p= c #1B1C1D", -"q= c #838484", -"r= c #D6D7D7", -"s= c #464747", -"t= c #1B1C1E", -"u= c #1E2224", -"v= c #212729", -"w= c #272E2F", -"x= c #2B2E30", -"y= c #232527", -"z= c #2E2F2F", -"A= c #818181", -"B= c #595959", -"C= c #9A9A9A", -"D= c #CACACA", -"E= c #858585", -"F= c #333333", -"G= c #393939", -"H= c #000001", -"I= c #121313", -"J= c #030404", -"K= c #666666", -"L= c #171918", -"M= c #202020", -"N= c #B0B0B0", -"O= c #313131", -"P= c #E9E9E9", -"Q= c #EEEEEE", -"R= c #646666", -"S= c #16191B", -"T= c #232728", -"U= c #2B2F30", -"V= c #2D3233", -"W= c #212425", -"X= c #232525", -"Y= c #ACADAD", -"Z= c #515252", -"`= c #141516", -" - c #1C1F21", -".- c #202526", -"+- c #242829", -"@- c #202323", -"#- c #1F1F1F", -"$- c #3A3A3A", -"%- c #9E9E9E", -"&- c #919091", -"*- c #2B2B2B", -"=- c #4F4F4F", -"-- c #000000", -";- c #101111", -">- c #010202", -",- c #020303", -"'- c #020302", -")- c #050605", -"!- c #151515", -"~- c #353435", -"{- c #626364", -"]- c #262A2B", -"^- c #1F2123", -"/- c #202123", -"(- c #B7B7B8", -"_- c #ECEDED", -":- c #464748", -"<- c #1E2023", -"[- c #1F2224", -"}- c #1F2222", -"|- c #181A1A", -"1- c #181819", -"2- c #656565", -"3- c #D1D1D1", -"4- c #1D1D1D", -"5- c #9D9D9D", -"6- c #898989", -"7- c #242324", -"8- c #A4A4A4", -"9- c #484748", -"0- c #555556", -"a- c #5D5E5E", -"b- c #040606", -"c- c #070809", -"d- c #A0A0A0", -"e- c #D8D9D9", -"f- c #212324", -"g- c #151719", -"h- c #1B1E21", -"i- c #18191A", -"j- c #B9B9B9", -"k- c #747474", -"l- c #1F1F20", -"m- c #717171", -"n- c #292929", -"o- c #4F504F", -"p- c #030403", -"q- c #8A8A8A", -"r- c #08080A", -"s- c #6D6D6D", -"t- c #A2A2A2", -"u- c #989899", -"v- c #181B1D", -"w- c #191A1B", -"x- c #010001", -"y- c #7D7D7D", -"z- c #0E0F0F", -"A- c #676767", -"B- c #222222", -"C- c #212021", -"D- c #E4E3E4", -"E- c #1B1B1C", -"F- c #D4D4D4", -"G- c #5C5C5C", -"H- c #171818", -"I- c #DCDCDC", -"J- c #F4F4F4", -"K- c #2D2E2F", -"L- c #161818", -"M- c #CCCCCC", -"N- c #7D7C7D", -"O- c #1A191A", -"P- c #828282", -"Q- c #040506", -"R- c #040607", -"S- c #040707", -"T- c #111111", -"U- c #89898A", -"V- c #201F20", -"W- c #8F8F8F", -"X- c #DADADA", -"Y- c #C4C4C4", -"Z- c #5C5D5D", -"`- c #5B5B5B", -" ; c #919191", -".; c #0D0E0D", -"+; c #2E2E2E", -"@; c #7B7B7C", -"#; c #B6B6B6", -"$; c #1E1D1E", -"%; c #454546", -"&; c #515151", -"*; c #DDDDDD", -"=; c #252525", -"-; c #3D3D3D", -";; c #ACADAC", -">; c #EFEFEF", -",; c #7A7A7A", -"'; c #757575", -"); c #626162", -"!; c #1C1C1C", -"~; c #A6A7A6", -"{; c #E7E7E7", -"]; c #595859", -"^; c #050504", -"/; c #060705", -"(; c #000100", -"_; c #000101", -":; c #424242", -"<; c #B8B8B8", -"[; c #8A898A", -"}; c #202021", -"|; c #767576", -"1; c #CBCBCB", -"2; c #030504", -"3; c #929293", -"4; c #040403", -"5; c #848584", -"6; c #838383", -"7; c #9A999A", -"8; c #69696A", -"9; c #212122", -"0; c #929292", -"a; c #030405", -"b; c #939393", -"c; c #464546", -"d; c #444344", -"e; c #B7B7B7", -"f; c #262626", -"g; c #D8D8D8", -"h; c #131313", -"i; c #5B5C5B", -"j; c #A9AAA9", -"k; c #010201", -"l; c #1D1C1D", -"m; c #CCCBCC", -"n; c #777677", -"o; c #B3B3B3", -"p; c #545555", -"q; c #040605", -"r; c #2A2A2A", -"s; c #181818", -"t; c #070706", -"u; c #252625", -"v; c #020201", -"w; c #5C5B5C", -"x; c #050706", -"y; c #191819", -"z; c #131213", -"A; c #121112", -"B; c #7C7C7D", -"C; c #A0A1A1", -"D; c #969596", -"E; c #070709", -"F; c #AEAEAE", -"G; c #C1C1C1", -"H; c #4D4D4D", -"I; c #BEBEBF", -"J; c #0A0709", -"K; c #C8C8C8", -"L; c #959595", -"M; c #060807", -"N; c #7F7F80", -"O; c #040303", -"P; c #B0AFB0", -"Q; c #1A1B1A", -"R; c #BDBDBD", -"S; c #444444", -"T; c #C2C1C2", -"U; c #070807", -"V; c #060806", -"W; c #282829", -"X; c #1F1E1F", -"Y; c #545455", -"Z; c #0A070A", -"`; c #242524", -" > c #090A09", -".> c #0A0C0A", -"+> c #080A08", -"@> c #09080B", -"#> c #646464", -"$> c #C3C3C3", -"%> c #030302", -"&> c #D0D1D1", -"*> c #0C0C0B", -"=> c #070806", -"-> c #0B0C0A", -";> c #0C0E0C", -">> c #C9C9C9", -",> c #626363", -"'> c #424142", -")> c #969696", -"!> c #080907", -"~> c #0B0D0C", -"{> c #656566", -"]> c #D3D3D3", -"^> c #555455", -"/> c #565556", -"(> c #191A19", -"_> c #797979", -":> c #E1E1E1", -"<> c #414142", -"[> c #888888", -"}> c #0A0C0B", -"|> c #C7C7C7", -"1> c #3D3D3E", -"2> c #08070A", -"3> c #0E0B0D", -"4> c #0E0B0E", -"5> c #0D0A0D", -"6> c #232223", -"7> c #111211", -"8> c #191919", -"9> c #050404", -"0> c #100E12", -"a> c #1E1E1E", -"b> c #080908", -"c> c #0C0D0C", -"d> c #0E0A0D", -"e> c #0F0B0E", -"f> c #2D2D2D", -"g> c #0F0D11", -"h> c #0E0F0E", -"i> c #0B0C0B", -"j> c #0A0B0A", -"k> c #222122", -"l> c #0F0C0F", -"m> c #646364", -"n> c #5E5E5E", -"o> c #E0E0E1", -"p> c #040503", -"q> c #606160", -"r> c #5F605F", -"s> c #5E5F5E", -"t> c #5D5E5D", -"u> c #070606", -"v> c #B4B4B4", -"w> c #0D0F0D", -"x> c #0C0E0B", -"y> c #0C0D0B", -"z> c #3C3C3D", -"A> c #060605", -"B> c #2F2F2F", -"C> c #0D0F0C", -"D> c #0A0B09", -"E> c #DFDFE0", -"F> c #232324", -"G> c #242424", -"H> c #9C9C9C", -"I> c #5C5D5C", -"J> c #1D1E1E", -"K> c #0D0E0C", -"L> c #A9A9AA", -"M> c #232323", -"N> c #050604", -"O> c #090A08", -"P> c #4F5050", -"Q> c #0F100F", -"R> c #39393A", -"S> c #110F13", -"T> c #060505", -"U> c #090B09", -"V> c #1B1B1B", -"W> c #0E0C10", -"X> c #141515", -"Y> c #7E7E7E", -"Z> c #6D6C6C", -"`> c #100D10", -" , c #131414", -"., c #131413", -"+, c #101110", -"@, c #1C1B1D", -"#, c #555655", -"$, c #131113", -"%, c #141414", -"&, c #111212", -"*, c #373738", -"=, c #ABABAB", -"-, c #151616", -";, c #121113", -">, c #575657", -",, c #707071", -"', c #1C1B1C", -"), c #DEDDDE", -"!, c #808080", -"~, c #D9D9D9", -"{, c #888889", -"], c #8C8D8C", -"^, c #0F100E", -"/, c #6F6E6F", -"(, c #505050", -"_, c #141014", -":, c #A8A7A8", -"<, c #2E2E2F", -"[, c #130F12", -"}, c #0D0E0F", -"|, c #727273", -"1, c #8B8B8B", -"2, c #0E0B0F", -"3, c #120E12", -"4, c #BBBABB", -"5, c #C0BFC0", -"6, c #363736", -"7, c #ACACAC", -"8, c #171717", -"9, c #080609", -"0, c #0C090C", -"a, c #100C10", -"b, c #888788", -"c, c #0C090D", -"d, c #D6D6D7", -"e, c #A8A8A9", -"f, c #8B8A8B", -"g, c #141415", -"h, c #636363", -"i, c #D7D6D7", -"j, c #090B0A", -"k, c #404040", -"l, c #4E4E4E", -"m, c #121114", -"n, c #373837", -"o, c #0D0C10", -"p, c #212221", -"q, c #5F6060", -"r, c #282828", -"s, c #525252", -"t, c #131115", -"u, c #0F1010", -"v, c #515251", -"w, c #8B8B8C", -"x, c #030204", -"y, c #222221", -"z, c #090908", -"A, c #7D7D7C", -"B, c #8A8A8B", -"C, c #D3D3D4", -"D, c #060608", -"E, c #8A8B8B", -"F, c #080807", -"G, c #6E6D6E", -"H, c #171817", -"I, c #545453", -"J, c #D9D8D9", -"K, c #101011", -"L, c #222323", -"M, c #737473", -"N, c #303030", -"O, c #676768", -"P, c #434343", -"Q, c #424243", -"R, c #9F9F9F", -"S, c #141314", -"T, c #3C3B3C", -"U, c #272627", -"V, c #585858", -"W, c #434243", -"X, c #151516", -"Y, c #535453", -"Z, c #5D5D5E", -"`, c #9B9B9B", -" ' c #DEDFDE", -".' c #959695", -"+' c #5A5A5A", -"@' c #747574", -"#' c #B2B2B2", -"$' c #2B2B2C", -"%' c #1E1E1F", -"&' c #585859", -"*' c #BFBEBF", -"=' c #A8A8A7", -"-' c #242425", -";' c #3C3C3C", -">' c #8E8F8F", -",' c #585658", -"'' c #5E5E5F", -")' c #A3A3A3", -"!' c #949393", -"~' c #0C0A0B", -"{' c #323132", -"]' c #989998", -"^' c #6D6D6E", -"/' c #474747", -"(' c #949394", -"_' c #979797", -":' c #3B3B3B", -"<' c #454545", -"[' c #111112", -"}' c #A9A8A9", -"|' c #323232", -"1' c #949494", -"2' c #59595A", -"3' c #C3C2C3", -"4' c #3A393A", -"5' c #949495", -"6' c #8C8C8D", -"7' c #121213", -"8' c #282929", -"9' c #343535", -"0' c #5A5A5B", -"a' c #202121", -"b' c #131214", -"c' c #454445", -"d' c #302F30", -"e' c #C6C6C6", -"f' c #252425", -"g' c #959596", -"h' c #141216", -"i' c #131215", -"j' c #D1D1D2", -"k' c #CFCFD0", -"l' c #8F908F", -"m' c #CCCDCD", -"n' c #0E0F0D", -"o' c #10110F", -"p' c #1D1E1D", -"q' c #B6B7B7", -"r' c #FBFCFB", -"s' c #5B5B5C", -"t' c #141315", -"u' c #5D5C5E", -"v' c #646365", -"w' c #1A1C1C", -"x' c #EEEEED", -"y' c #EDEDEE", -"z' c #4A4A4B", -"A' c #4A4A4A", -"B' c #4A494A", -"C' c #49494A", -"D' c #4A494B", -"E' c #4B4A4C", -"F' c #313032", -"G' c #151317", -"H' c #17161A", -"I' c #161418", -"J' c #151417", -"K' c #141316", -"L' c #1A191B", -"M' c #2C2B2D", -"N' c #383839", -"O' c #4B4A4B", -"P' c #403F40", -"Q' c #4C4B4C", -"R' c #484849", -"S' c #474847", -"T' c #494A49", -"U' c #4A4B4A", -"V' c #2D2E2E", -"W' c #383939", -"X' c #4C4C4C", -"Y' c #4C4D4C", -"Z' c #4A4B4B", -"`' c #484949", -" ) c #494A4A", -".) c #464646", -"+) c #4C4B4D", -"@) c #4D4C4E", -"#) c #4D4C4D", -"$) c #1D1C1E", -"%) c #373637", -"&) c #4D4B4D", -"*) c #4E4C4E", -"=) c #4F4E4F", -"-) c #090907", -";) c #454645", -">) c #4B4C4C", -",) c #4B4B4B", -"') c #2E2F2E", -")) c #111210", -"!) c #131513", -"~) c #141513", -"{) c #131512", -"]) c #434444", -"^) c #484948", -"/) c #474848", -"() c #494948", -"_) c #454544", -":) c #0B0E0D", -"<) c #0A0D0C", -"[) c #090C0B", -"}) c #7A7B7B", -"|) c #050607", -"1) c #464746", -"2) c #454646", -"3) c #171518", -"4) c #161518", -"5) c #151316", -"6) c #282628", -"7) c #514F51", -"8) c #4F4E50", -"9) c #4E4D4F", -"0) c #504E50", -"a) c #29272A", -"b) c #141215", -"c) c #3E3F40", -"d) c #0E0E0D", -"e) c #4B494B", -"f) c #1A1A1C", -"g) c #494849", -"h) c #3D3C3D", -"i) c #131114", -"j) c #4B4A4A", -"k) c #4B4C4A", -"l) c #4A4B49", -"m) c #4A4A49", -"n) c #353635", -"o) c #9B9A9B", -"p) c #171519", -"q) c #19171B", -"r) c #18161A", -"s) c #151418", -"t) c #111113", -"u) c #131013", -"v) c #141114", -"w) c #151215", -"x) c #0B0D0A", -"y) c #0B0C09", -"z) c #151714", -"A) c #181A18", -"B) c #191B18", -"C) c #181917", -"D) c #171816", -"E) c #0E100E", -"F) c #656666", -"G) c #313232", -"H) c #0A0A09", -"I) c #0B0F0E", -"J) c #6C6D6D", -"K) c #373939", -"L) c #070908", -"M) c #1A191C", -"N) c #19161A", -"O) c #191619", -"P) c #171417", -"Q) c #110E11", -"R) c #120F12", -"S) c #151216", -"T) c #18171A", -"U) c #101212", -"V) c #0B0E0F", -"W) c #424343", -"X) c #5B5C5C", -"Y) c #333434", -"Z) c #0B0B0A", -"`) c #0E0E0C", -" ! c #0D0E0B", -".! c #0B0B09", -"+! c #161419", -"@! c #19181C", -"#! c #1B191C", -"$! c #1C1A1E", -"%! c #1B1A1E", -"&! c #1A191D", -"*! c #1A181C", -"=! c #0B0D0B", -"-! c #101210", -";! c #111413", -">! c #1A1B19", -",! c #181918", -"'! c #151716", -")! c #181519", -"!! c #19171A", -"~! c #1A181B", -"{! c #19181B", -"]! c #1B181C", -"^! c #1C191D", -"/! c #1A171B", -"(! c #1A171A", -"_! c #1B181B", -":! c #1B191D", -"~ c #0E120F", -",~ c #0D100D", -"'~ c #0C100D", -")~ c #0D0F10", -"!~ c #0C0C0A", -"~~ c #211E22", -"{~ c #232125", -"]~ c #212024", -"^~ c #1F1E22", -"/~ c #1D1C20", -"(~ c #1D1C1F", -"_~ c #1F1B1F", -":~ c #1D1B1F", -"<~ c #1D1A1F", -"[~ c #1E1A1F", -"}~ c #1F1B20", -"|~ c #1F1B21", -"1~ c #1F1D22", -"2~ c #090A0C", -"3~ c #151817", -"4~ c #0B0D0F", -"5~ c #161417", -"6~ c #171619", -"7~ c #161517", -"8~ c #161519", -"9~ c #121115", -"0~ c #151416", -"a~ c #151517", -"b~ c #161617", -"c~ c #131412", -"d~ c #161614", -"e~ c #050507", -"f~ c #17151A", -"g~ c #18161B", -"h~ c #19171C", -"i~ c #1D1B1D", -"j~ c #1E1C1E", -"k~ c #1F1E21", -"l~ c #201E23", -"m~ c #1E1C21", -"n~ c #1D1B20", -"o~ c #231F24", -"p~ c #221E22", -"q~ c #1C1A1F", -"r~ c #1E1D21", -"s~ c #201E22", -"t~ c #222024", -"u~ c #211F24", -"v~ c #20221F", -"w~ c #20211F", -"x~ c #1A1D1C", -"y~ c #171B1A", -"z~ c #141815", -"A~ c #171B18", -"B~ c #161A18", -"C~ c #262126", -"D~ c #262227", -"E~ c #272328", -"F~ c #242227", -"G~ c #242327", -"H~ c #252327", -"I~ c #262127", -"J~ c #242325", -"K~ c #141613", -"L~ c #1D1F1C", -"M~ c #1B1D1B", -"N~ c #171917", -"O~ c #161717", -"P~ c #191B1A", -"Q~ c #151715", -"R~ c #181C19", -"S~ c #141817", -"T~ c #0E1211", -"U~ c #111512", -"V~ c #121613", -"W~ c #090C0D", -"X~ c #080C0C", -"Y~ c #0C1010", -"Z~ c #0A0A08", -"`~ c #111311", -" { c #10130F", -".{ c #242226", -"+{ c #232226", -"@{ c #232126", -"#{ c #222025", -"${ c #222125", -"%{ c #232025", -"&{ c #241F25", -"*{ c #211F23", -"={ c #221F23", -"-{ c #07080A", -";{ c #101415", -">{ c #111514", -",{ c #131618", -"'{ c #151314", -"){ c #1A181D", -"!{ c #1B191E", -"~{ c #191719", -"{{ c #19181A", -"]{ c #1A181A", -"^{ c #161615", -"/{ c #171716", -"({ c #181817", -"_{ c #1A1A19", -":{ c #1A1A18", -"<{ c #191B19", -"[{ c #181A17", -"}{ c #07090A", -"|{ c #18151A", -"1{ c #1E1D1F", -"2{ c #1F1D20", -"3{ c #201E21", -"4{ c #221F24", -"5{ c #252126", -"6{ c #242025", -"7{ c #232026", -"8{ c #242126", -"9{ c #221F25", -"0{ c #232024", -"a{ c #161516", -"b{ c #171916", -"c{ c #151A19", -"d{ c #151A18", -"e{ c #1A1E1C", -"f{ c #1B201E", -"g{ c #1C201E", -"h{ c #29242A", -"i{ c #2A252B", -"j{ c #2B262C", -"k{ c #2B282D", -"l{ c #2A272D", -"m{ c #2B272C", -"n{ c #2C272D", -"o{ c #2A272B", -"p{ c #1E1E1D", -"q{ c #161915", -"r{ c #191C18", -"s{ c #181916", -"t{ c #151915", -"u{ c #151814", -"v{ c #151615", -"w{ c #1C1E1B", -"x{ c #191A1A", -"y{ c #161816", -"z{ c #131615", -"A{ c #0F1312", -"B{ c #101413", -"C{ c #161917", -"D{ c #161A16", -"E{ c #141714", -"F{ c #131613", -"G{ c #121512", -"H{ c #0C0E10", -"I{ c #141813", -"J{ c #151713", -"K{ c #201F21", -"L{ c #27262A", -"M{ c #272529", -"N{ c #272429", -"O{ c #272329", -"P{ c #262328", -"Q{ c #27242A", -"R{ c #28252A", -"S{ c #282329", -"T{ c #231F25", -"U{ c #221E24", -"V{ c #242127", -"W{ c #181B1B", -"X{ c #121617", -"Y{ c #181B1A", -"Z{ c #1F1C22", -"`{ c #201D23", -" ] c #1F1C21", -".] c #1E1B20", -"+] c #1C1A1C", -"@] c #171617", -"#] c #1B1B19", -"$] c #1E1F1C", -"%] c #1C1D1A", -"&] c #1B1C19", -"*] c #1A1B18", -"=] c #1C1D1B", -"-] c #191A18", -";] c #10120F", -">] c #151513", -",] c #0F0F0D", -"'] c #060A09", -")] c #171517", -"!] c #1A161A", -"~] c #211F22", -"{] c #231E24", -"]] c #252328", -"^] c #272228", -"/] c #262429", -"(] c #28262A", -"_] c #262529", -":] c #262228", -"<] c #1F1C20", -"[] c #212320", -"}] c #1C1F1D", -"|] c #1B201D", -"1] c #1F2320", -"2] c #212622", -"3] c #1A1F1B", -"4] c #282328", -"5] c #2A252A", -"6] c #2A262B", -"7] c #2E292F", -"8] c #2F2A30", -"9] c #302B31", -"0] c #292429", -"a] c #2C282D", -"b] c #312A32", -"c] c #312D32", -"d] c #2B2A2C", -"e] c #1E201B", -"f] c #181A15", -"g] c #1C1E18", -"h] c #20231C", -"i] c #1B1D18", -"j] c #151A16", -"k] c #171C18", -"l] c #161A17", -"m] c #151816", -"n] c #161817", -"o] c #0D1110", -"p] c #151815", -"q] c #161814", -"r] c #171815", -"s] c #0E0F11", -"t] c #0D0E10", -"u] c #252723", -"v] c #262823", -"w] c #282A25", -"x] c #272927", -"y] c #2B292D", -"z] c #29252A", -"A] c #252128", -"B] c #1B1F1E", -"C] c #121517", -"D] c #121618", -"E] c #1C1F1E", -"F] c #131315", -"G] c #252026", -"H] c #221D23", -"I] c #1C1C1B", -"J] c #1D1D1B", -"K] c #1E1E1C", -"L] c #1C1C1A", -"M] c #121310", -"N] c #080B0A", -"O] c #27252A", -"P] c #252228", -"Q] c #252127", -"R] c #28262B", -"S] c #1F2220", -"T] c #1F2421", -"U] c #232824", -"V] c #222723", -"W] c #181D19", -"X] c #262329", -"Y] c #322D33", -"Z] c #2D282E", -"`] c #302D31", -" ^ c #2C2B2C", -".^ c #262725", -"+^ c #262824", -"@^ c #232520", -"#^ c #1E201A", -"$^ c #1C1E19", -"%^ c #191E1A", -"&^ c #1B201C", -"*^ c #1A1D1B", -"=^ c #1A1C18", -"-^ c #1B1D19", -";^ c #181A19", -">^ c #1B1D1C", -",^ c #202221", -"'^ c #242623", -")^ c #2B2D2A", -"!^ c #343631", -"~^ c #30322D", -"{^ c #2F312C", -"]^ c #2D2F2B", -"^^ c #2A2B29", -"/^ c #2D2B2C", -"(^ c #302C31", -"_^ c #2B262B", -":^ c #2E2A2F", -"<^ c #242026", -"[^ c #1F1F22", -"}^ c #14181A", -"|^ c #1C1C1E", -"1^ c #1D1B1E", -"2^ c #1B191B", -"3^ c #1C1D1C", -"4^ c #1F201F", -"5^ c #1F1F1D", -"6^ c #222421", -"7^ c #1F201D", -"8^ c #1D1D1C", -"9^ c #0A0C09", -"0^ c #101112", -"a^ c #0F1011", -"b^ c #1C1B1E", -"c^ c #1D1A20", -"d^ c #282429", -"e^ c #28252B", -"f^ c #252227", -"g^ c #191918", -"h^ c #1E201C", -"i^ c #21231F", -"j^ c #242722", -"k^ c #272B28", -"l^ c #292E2C", -"m^ c #202524", -"n^ c #222624", -"o^ c #262A27", -"p^ c #1D211E", -"q^ c #1A1E1B", -"r^ c #111412", -"s^ c #2A262C", -"t^ c #2B262D", -"u^ c #302B30", -"v^ c #2B292B", -"w^ c #282928", -"x^ c #272A27", -"y^ c #292B28", -"z^ c #2D2F2C", -"A^ c #292B27", -"B^ c #20221C", -"C^ c #1D1F1B", -"D^ c #1C201B", -"E^ c #1C201C", -"F^ c #1F231F", -"G^ c #1C201D", -"H^ c #191C1A", -"I^ c #181B19", -"J^ c #131411", -"K^ c #131416", -"L^ c #161718", -"M^ c #171819", -"N^ c #131415", -"O^ c #121314", -"P^ c #111214", -"Q^ c #0F1013", -"R^ c #0E0F12", -"S^ c #0D0E12", -"T^ c #11130F", -"U^ c #222422", -"V^ c #262827", -"W^ c #2C2E2C", -"X^ c #2D2E2B", -"Y^ c #2F302D", -"Z^ c #31332E", -"`^ c #32342F", -" / c #333530", -"./ c #2F312D", -"+/ c #2B2C29", -"@/ c #222121", -"#/ c #2B282C", -"$/ c #2D292E", -"%/ c #29252B", -"&/ c #28242A", -"*/ c #2C282E", -"=/ c #181C1B", -"-/ c #080706", -";/ c #222023", -">/ c #1D1C1C", -",/ c #222220", -"'/ c #1E1E1B", -")/ c #21211E", -"!/ c #232421", -"~/ c #21221F", -"{/ c #20211E", -"]/ c #1F201E", -"^/ c #20201D", -"// c #1E191F", -"(/ c #29262A", -"_/ c #262822", -":/ c #2C2F29", -"( c #262721", -",( c #2B2C26", -"'( c #252621", -")( c #20211D", -"!( c #242422", -"~( c #21211F", -"{( c #232321", -"]( c #21221D", -"^( c #23241F", -"/( c #222320", -"(( c #191D19", -"_( c #181C18", -":( c #2B272D", -"<( c #252724", -"[( c #353733", -"}( c #292B29", -"|( c #272928", -"1( c #202322", -"2( c #1C1C1D", -"3( c #1C1C1F", -"4( c #2C2A2E", -"5( c #191917", -"6( c #2A2E2A", -"7( c #343632", -"8( c #2C2E2B", -"9( c #292A24", -"0( c #232420", -"a( c #1E231E", -"b( c #1F2420", -"c( c #191D1A", -"d( c #0C0B0F", -"e( c #222127", -"f( c #404148", -"g( c #65666D", -"h( c #808288", -"i( c #8E9196", -"j( c #B3B7BB", -"k( c #BDC1C5", -"l( c #C4C7CB", -"m( c #CED2D5", -"n( c #D5D9DC", -"o( c #D4DBDE", -"p( c #D6DDE0", -"q( c #D6DEE1", -"r( c #D1DCE0", -"s( c #D2DEE2", -"t( c #D5E0E4", -"u( c #CEDCE3", -"v( c #C6DBE2", -"w( c #C9DBE4", -"x( c #D0DDE4", -"y( c #D0DDE3", -"z( c #D1DDE2", -"A( c #D2DEE4", -"B( c #D0DBE3", -"C( c #CAD8E0", -"D( c #C5D4DC", -"E( c #BCCDD6", -"F( c #AABBC5", -"G( c #99A8B4", -"H( c #8A96A4", -"I( c #6E7784", -"J( c #69707A", -"K( c #4C5059", -"L( c #383D42", -"M( c #1D2023", -"N( c #0B0A0A", -"O( c #272926", -"P( c #31322E", -"Q( c #363733", -"R( c #33332F", -"S( c #343633", -"T( c #333532", -"U( c #353734", -"V( c #282529", -"W( c #1C1E20", -"X( c #1C1E1F", -"Y( c #1D211F", -"Z( c #252925", -"`( c #1A1819", -" _ c #262427", -"._ c #1D181E", -"+_ c #1C181E", -"@_ c #20201F", -"#_ c #212120", -"$_ c #262722", -"%_ c #2D2E28", -"&_ c #292A25", -"*_ c #22231F", -"=_ c #242523", -"-_ c #21221E", -";_ c #20211C", -">_ c #29262C", -",_ c #2A272C", -"'_ c #29262B", -")_ c #222321", -"!_ c #181719", -"~_ c #2C282C", -"{_ c #2F2A2F", -"]_ c #2E292E", -"^_ c #28272B", -"/_ c #1D1D20", -"(_ c #222522", -"__ c #292D2A", -":_ c #393B35", -"<_ c #3C3E38", -"[_ c #353731", -"}_ c #242521", -"|_ c #202421", -"1_ c #38383B", -"2_ c #636368", -"3_ c #81838A", -"4_ c #A6AAB2", -"5_ c #B7BFC8", -"6_ c #C4CCD6", -"7_ c #CED6DF", -"8_ c #D4DCE2", -"9_ c #D6DEE4", -"0_ c #DAE0E5", -"a_ c #DCE0E5", -"b_ c #DCE1E5", -"c_ c #DADFE3", -"d_ c #D7E0E2", -"e_ c #D5DFE1", -"f_ c #D5DEE0", -"g_ c #D7DDE2", -"h_ c #D7DDE3", -"i_ c #D6DCE2", -"j_ c #CDDCE4", -"k_ c #C1D8E0", -"l_ c #BED8E4", -"m_ c #C5D9E4", -"n_ c #C8DBE4", -"o_ c #CADDE6", -"p_ c #CCDEE3", -"q_ c #CDDEE3", -"r_ c #CDDDE4", -"s_ c #C9DCE3", -"t_ c #C3DAE1", -"u_ c #BBD6DF", -"v_ c #B3D1DC", -"w_ c #ADCCDA", -"x_ c #A7C3D7", -"y_ c #9CB8CD", -"z_ c #90ADC2", -"A_ c #84A1B6", -"B_ c #809AAE", -"C_ c #7F93A5", -"D_ c #8994A1", -"E_ c #747981", -"F_ c #6C6C71", -"G_ c #3C3B3E", -"H_ c #080A07", -"I_ c #32332E", -"J_ c #363732", -"K_ c #373835", -"L_ c #3C3D3A", -"M_ c #393B38", -"N_ c #2D302D", -"O_ c #171A17", -"P_ c #222123", -"Q_ c #262428", -"R_ c #29272B", -"S_ c #27282C", -"T_ c #26252B", -"U_ c #272227", -"V_ c #181419", -"W_ c #0F0F12", -"X_ c #111213", -"Y_ c #141616", -"Z_ c #1D1F1F", -"`_ c #202422", -" : c #2A2E2B", -".: c #232022", -"+: c #272428", -"@: c #1E1A20", -"#: c #212220", -"$: c #242522", -"%: c #242621", -"&: c #2A2B26", -"*: c #1C1D19", -"=: c #1A1E1A", -"-: c #191C19", -";: c #171715", -">: c #201F23", -",: c #2A282D", -"': c #2D292F", -"): c #030202", -"!: c #010000", -"~: c #171316", -"{: c #1E1A1D", -"]: c #282427", -"^: c #1B1A1B", -"/: c #2A2E2D", -"(: c #2D302C", -"_: c #383A34", -":: c #43463E", -"<: c #42453D", -"[: c #393C35", -"}: c #2F322D", -"|: c #2A2C29", -"1: c #262825", -"2: c #242824", -"3: c #202521", -"4: c #1A1D1A", -"5: c #1F1F1E", -"6: c #57585A", -"7: c #828286", -"8: c #97989E", -"9: c #A8A9B2", -"0: c #AEB0BD", -"a: c #AFB7C2", -"b: c #B0BDC6", -"c: c #B6C2CC", -"d: c #B8C4CE", -"e: c #BAC5CF", -"f: c #C1CCD3", -"g: c #CED7DC", -"h: c #D7DEE2", -"i: c #DCE1E4", -"j: c #DCE1E3", -"k: c #DBE0E2", -"l: c #DADFE2", -"m: c #DADEE1", -"n: c #D8DEE2", -"o: c #D1DBE0", -"p: c #BFD7E3", -"q: c #BFD8E6", -"r: c #C1D8E6", -"s: c #C2D9E6", -"t: c #C4DAE4", -"u: c #C4DAE3", -"v: c #C6DBE4", -"w: c #C6D9E4", -"x: c #C3D8E4", -"y: c #BFD7E4", -"z: c #BED7E4", -"A: c #C1D8E3", -"B: c #C0D5E0", -"C: c #B6CDDC", -"D: c #97B7D0", -"E: c #88ADC7", -"F: c #7FA0B9", -"G: c #8097AD", -"H: c #8996A8", -"I: c #9BA0AC", -"J: c #A3A3AA", -"K: c #979498", -"L: c #706D6F", -"M: c #525154", -"N: c #060609", -"O: c #333531", -"P: c #3D3E39", -"Q: c #42433D", -"R: c #3B3C36", -"S: c #363A35", -"T: c #292D2C", -"U: c #252226", -"V: c #262325", -"W: c #1F1D1E", -"X: c #251F21", -"Y: c #272327", -"Z: c #282527", -"`: c #272427", -" < c #141517", -".< c #1C1D1F", -"+< c #1A1C1B", -"@< c #1E1F20", -"#< c #22241F", -"$< c #252722", -"%< c #272725", -"&< c #1F201C", -"*< c #1E1F1A", -"=< c #0F100D", -"-< c #1A1A1D", -";< c #020101", -">< c #070506", -",< c #272B2A", -"'< c #3A3D35", -")< c #3C3F38", -"!< c #373935", -"~< c #2E302E", -"{< c #2B2F2B", -"]< c #242925", -"^< c #1C1F1C", -"/< c #131316", -"(< c #454547", -"_< c #757778", -":< c #939798", -"<< c #9EA1A5", -"[< c #A5A8AF", -"}< c #A5A6B1", -"|< c #A3A4B1", -"1< c #9FA1AF", -"2< c #9C9FAE", -"3< c #9A9FAE", -"4< c #9CA0AF", -"5< c #A1A8B6", -"6< c #AFBAC6", -"7< c #BDCAD2", -"8< c #CBD6DD", -"9< c #D3DCE1", -"0< c #D9DEE2", -"a< c #DBE0E4", -"b< c #DFE0E4", -"c< c #E0E2E6", -"d< c #DFE1E5", -"e< c #DAE1E4", -"f< c #D9E0E3", -"g< c #D8DFE3", -"h< c #D7DFE3", -"i< c #D6DFE2", -"j< c #C6DAE2", -"k< c #BDD7E4", -"l< c #BCD7E2", -"m< c #BDD9E4", -"n< c #BBD9E6", -"o< c #B3D5E4", -"p< c #ADD3E3", -"q< c #ADD3E5", -"r< c #B4D4E6", -"s< c #BCD7E3", -"t< c #C6D8E2", -"u< c #C9D9E3", -"v< c #C5D5E0", -"w< c #B8CCDB", -"x< c #ADC2D2", -"y< c #A5B8C8", -"z< c #A1B2C1", -"A< c #A3AEBD", -"B< c #A9AEB8", -"C< c #AFB0B8", -"D< c #B1B0B7", -"E< c #B0ADB0", -"F< c #A6A1A3", -"G< c #7E7C7C", -"H< c #4D4C4C", -"I< c #08070C", -"J< c #3F413B", -"K< c #454640", -"L< c #3F403A", -"M< c #292D2B", -"N< c #0F1314", -"O< c #30271B", -"P< c #41362E", -"Q< c #454447", -"R< c #323333", -"S< c #2C2422", -"T< c #2C2626", -"U< c #121015", -"V< c #20221D", -"W< c #272823", -"X< c #252523", -"Y< c #322D32", -"Z< c #060604", -"`< c #2F322E", -" [ c #2F322C", -".[ c #31342D", -"+[ c #333631", -"@[ c #2C2F2D", -"#[ c #272D29", -"$[ c #2A302C", -"%[ c #1F221F", -"&[ c #252628", -"*[ c #555759", -"=[ c #808285", -"-[ c #9A9D9F", -";[ c #9A9EA3", -">[ c #9AA1AB", -",[ c #9BA1AE", -"'[ c #9A9EAD", -")[ c #979AA9", -"![ c #9497A8", -"~[ c #9396A8", -"{[ c #9396A7", -"][ c #9395A7", -"^[ c #9798AA", -"/[ c #9CA2B1", -"([ c #A4AFBD", -"_[ c #ACBCC8", -":[ c #B7C5D0", -"<[ c #C4CFD7", -"[[ c #CFD7DD", -"}[ c #D8DDE1", -"|[ c #D9DFE3", -"1[ c #DADFE4", -"2[ c #D9DFE2", -"3[ c #D8E0E1", -"4[ c #D6DFE3", -"5[ c #D5DEE3", -"6[ c #D7DFE2", -"7[ c #CFDEE3", -"8[ c #C3DAE4", -"9[ c #C1D9E4", -"0[ c #C0D9E3", -"a[ c #BED9E4", -"b[ c #BCD9E4", -"c[ c #BBD9E4", -"d[ c #BBD7E1", -"e[ c #B5D2DE", -"f[ c #B1D2DF", -"g[ c #B4D3E0", -"h[ c #B5D2E0", -"i[ c #AECCDC", -"j[ c #AAC7D5", -"k[ c #ABC6D2", -"l[ c #ABC4D0", -"m[ c #A6BCCA", -"n[ c #9EB3C2", -"o[ c #95ABBB", -"p[ c #8EA3B5", -"q[ c #91A0B1", -"r[ c #9DA7B3", -"s[ c #A8AEB8", -"t[ c #B0B1BA", -"u[ c #AEA9AD", -"v[ c #A69D9E", -"w[ c #A09597", -"x[ c #9D9393", -"y[ c #908A89", -"z[ c #828080", -"A[ c #4B494A", -"B[ c #31332F", -"C[ c #373933", -"D[ c #3D3E38", -"E[ c #3D3F39", -"F[ c #363A36", -"G[ c #282C2A", -"H[ c #1D1B1A", -"I[ c #29241C", -"J[ c #373633", -"K[ c #4E535B", -"L[ c #4E4A48", -"M[ c #35291F", -"N[ c #251F1E", -"O[ c #110F14", -"P[ c #141217", -"Q[ c #222420", -"R[ c #1D1D1A", -"S[ c #1E1F1B", -"T[ c #1C1E1A", -"U[ c #20221E", -"V[ c #1A151B", -"W[ c #2C2A2F", -"X[ c #312B30", -"Y[ c #2C292B", -"Z[ c #030604", -"`[ c #020304", -" } c #030306", -".} c #070805", -"+} c #232524", -"@} c #262B27", -"#} c #2F3430", -"$} c #303531", -"%} c #292E2A", -"&} c #1D211D", -"*} c #09070B", -"=} c #08060B", -"-} c #0F1014", -";} c #282A2B", -">} c #5D5F5F", -",} c #8A8F90", -"'} c #949A9E", -")} c #939AA0", -"!} c #969DA4", -"~} c #9CA3AA", -"{} c #9DA3AC", -"]} c #999FAA", -"^} c #9498A6", -"/} c #9092A3", -"(} c #8E91A1", -"_} c #9091A1", -":} c #8E91A2", -"<} c #9095A6", -"[} c #9098A7", -"}} c #939DAD", -"|} c #9AA6B6", -"1} c #AAB5C4", -"2} c #BCC5CF", -"3} c #C9CFD6", -"4} c #D1D7DC", -"5} c #CDD5DB", -"6} c #CAD3DA", -"7} c #CED6DC", -"8} c #D3DBDF", -"9} c #D6E0E5", -"0} c #D5DFE5", -"a} c #D5DFE4", -"b} c #D6E0E3", -"c} c #D7E1E4", -"d} c #D7E1E5", -"e} c #D1DEE4", -"f} c #D1DEE5", -"g} c #D1DFE5", -"h} c #CCDDE3", -"i} c #C8DCE3", -"j} c #C5DAE1", -"k} c #C0D7DE", -"l} c #BBD4DD", -"m} c #B7D1DB", -"n} c #B0CAD7", -"o} c #A4BDCF", -"p} c #99B3C5", -"q} c #93ADBF", -"r} c #8EA7BC", -"s} c #87A0B4", -"t} c #839BAE", -"u} c #8396A8", -"v} c #8191A5", -"w} c #808EA0", -"x} c #8992A2", -"y} c #969BA8", -"z} c #A4A4AD", -"A} c #AAA8AC", -"B} c #A6A0A0", -"C} c #998F90", -"D} c #8A7E7E", -"E} c #8A7F7D", -"F} c #908885", -"G} c #938E8A", -"H} c #7C7977", -"I} c #07060A", -"J} c #141412", -"K} c #3A3D37", -"L} c #3A3C37", -"M} c #373B37", -"N} c #212624", -"O} c #18181A", -"P} c #1D1D21", -"Q} c #181611", -"R} c #191511", -"S} c #1B171A", -"T} c #191618", -"U} c #141416", -"V} c #232124", -"W} c #171719", -"X} c #242622", -"Y} c #282924", -"Z} c #0C100E", -"`} c #292729", -" | c #2B292C", -".| c #080504", -"+| c #050704", -"@| c #050705", -"#| c #050304", -"$| c #050708", -"%| c #242124", -"&| c #202222", -"*| c #262A29", -"=| c #252928", -"-| c #252A26", -";| c #1F221E", -">| c #39393B", -",| c #6C6E6F", -"'| c #898D8E", -")| c #8C9393", -"!| c #889193", -"~| c #8B9298", -"{| c #9297A1", -"]| c #969BA5", -"^| c #999DA7", -"/| c #9A9DA7", -"(| c #9C9FAB", -"_| c #9D9FAB", -":| c #A1A1AC", -"<| c #A3A4AE", -"[| c #A5A6B0", -"}| c #A4A7AF", -"|| c #9FA3AD", -"1| c #9297A5", -"2| c #898FA1", -"3| c #868DA1", -"4| c #838CA0", -"5| c #9BA5B3", -"6| c #A9B4C0", -"7| c #AEBAC5", -"8| c #AEBAC6", -"9| c #A8B5C2", -"0| c #A6B5C3", -"a| c #AFBCC9", -"b| c #B9C6D1", -"c| c #C6D3DC", -"d| c #CFDCE3", -"e| c #D1DFE6", -"f| c #D3DEE4", -"g| c #D4DFE5", -"h| c #D4DEE5", -"i| c #D3DFE5", -"j| c #CEDDE3", -"k| c #CADDE4", -"l| c #C8DAE2", -"m| c #C6D9E2", -"n| c #C3D8E2", -"o| c #C0D6DF", -"p| c #B4C9D4", -"q| c #A2B6C6", -"r| c #95ABBD", -"s| c #8CA2B6", -"t| c #8399B0", -"u| c #7A92A8", -"v| c #768EA3", -"w| c #778A9F", -"x| c #78879C", -"y| c #798399", -"z| c #7E8497", -"A| c #8A8D9E", -"B| c #9797A4", -"C| c #A3A1A8", -"D| c #A9A4A7", -"E| c #A29B9E", -"F| c #93898A", -"G| c #837978", -"H| c #847B78", -"I| c #898480", -"J| c #918E8A", -"K| c #959490", -"L| c #8D8C88", -"M| c #5E5D59", -"N| c #30322E", -"O| c #373936", -"P| c #343834", -"Q| c #222625", -"R| c #181716", -"S| c #231E16", -"T| c #231F1A", -"U| c #1B191A", -"V| c #232521", -"W| c #242620", -"X| c #2B2D26", -"Y| c #1F201B", -"Z| c #131614", -"`| c #141313", -" 1 c #252324", -".1 c #292529", -"+1 c #2C292F", -"@1 c #222325", -"#1 c #23211C", -"$1 c #352918", -"%1 c #3C2F1A", -"&1 c #43413D", -"*1 c #454749", -"=1 c #302B24", -"-1 c #2B1E11", -";1 c #120D09", -">1 c #232023", -",1 c #1F1E20", -"'1 c #252929", -")1 c #202425", -"!1 c #1E2222", -"~1 c #1E2320", -"{1 c #1D221E", -"]1 c #1C211D", -"^1 c #242926", -"/1 c #202522", -"(1 c #1E211F", -"_1 c #3E4041", -":1 c #686E6C", -"<1 c #7E8884", -"[1 c #808B88", -"}1 c #818B8C", -"|1 c #838C90", -"11 c #879196", -"21 c #8E959D", -"31 c #989AA6", -"41 c #A1A4AF", -"51 c #ABADB8", -"61 c #B1B2BC", -"71 c #B2B3BE", -"81 c #B5B5BF", -"91 c #BEBFC4", -"01 c #CACACF", -"a1 c #CECED3", -"b1 c #CDCFD4", -"c1 c #C4C7CD", -"d1 c #AAB0B8", -"e1 c #9A9FAC", -"f1 c #939AA8", -"g1 c #9AA2B1", -"h1 c #ADBBC8", -"i1 c #A9B9C9", -"j1 c #A1B0C1", -"k1 c #94A5B7", -"l1 c #8D9FB3", -"m1 c #95A8BB", -"n1 c #A4B7C8", -"o1 c #B2C6D4", -"p1 c #BFD0DA", -"q1 c #C8D9E1", -"r1 c #CDDCE2", -"s1 c #D3DEE6", -"t1 c #D3DDE5", -"u1 c #D1DDE4", -"v1 c #CFDEE5", -"w1 c #CBDEE4", -"x1 c #C3D8DE", -"y1 c #BBD3DB", -"z1 c #B7D2DC", -"A1 c #B6D0DC", -"B1 c #ADC5D4", -"C1 c #9CB3C7", -"D1 c #8FA6BA", -"E1 c #8399AE", -"F1 c #778DA5", -"G1 c #6E859D", -"H1 c #6C829A", -"I1 c #6D7E97", -"J1 c #6C7A93", -"K1 c #68728A", -"L1 c #676B81", -"M1 c #6D6F83", -"N1 c #7A798C", -"O1 c #8C8A96", -"P1 c #9E9AA2", -"Q1 c #A9A3A8", -"R1 c #AAA2A4", -"S1 c #A69D9C", -"T1 c #9B9291", -"U1 c #999390", -"V1 c #9E9B96", -"W1 c #A09D97", -"X1 c #9E9B95", -"Y1 c #9C9B94", -"Z1 c #8F8E8A", -"`1 c #61615E", -" 2 c #282827", -".2 c #373B38", -"+2 c #161415", -"@2 c #1D1611", -"#2 c #1F1A14", -"$2 c #242125", -"%2 c #221F22", -"&2 c #1A161B", -"*2 c #222521", -"=2 c #252721", -"-2 c #272921", -";2 c #1F211C", -">2 c #181816", -",2 c #1A1918", -"'2 c #211F20", -")2 c #282629", -"!2 c #242525", -"~2 c #322E2C", -"{2 c #4B3D2C", -"]2 c #59513D", -"^2 c #6C7479", -"/2 c #8D9297", -"(2 c #694D2E", -"_2 c #1B1409", -":2 c #020402", -"<2 c #030502", -"[2 c #252025", -"}2 c #212123", -"|2 c #3D4344", -"12 c #636E6D", -"22 c #76827E", -"32 c #7C8882", -"42 c #7E8985", -"52 c #808B8D", -"62 c #838C93", -"72 c #8A919B", -"82 c #9397A2", -"92 c #9FA2AD", -"02 c #ACAFB8", -"a2 c #B0B3BC", -"b2 c #B3B5BE", -"c2 c #B7B8BF", -"d2 c #BFC0C6", -"e2 c #C9CACF", -"f2 c #D3D4D8", -"g2 c #DAD9DD", -"h2 c #DAD8DB", -"i2 c #D2D1D5", -"j2 c #C9CAD0", -"k2 c #BEC3CA", -"l2 c #B8BFC8", -"m2 c #B8C1CB", -"n2 c #BCC8D2", -"o2 c #B7C7D1", -"p2 c #ABBBCA", -"q2 c #9EAEC2", -"r2 c #98A8BB", -"s2 c #98A9BD", -"t2 c #96AAC0", -"u2 c #91A9C2", -"v2 c #93ACC2", -"w2 c #9EB8CA", -"x2 c #ADC4D3", -"y2 c #BCD0DB", -"z2 c #CADBE1", -"A2 c #CEDFE4", -"B2 c #C4D7DE", -"C2 c #C9DAE1", -"D2 c #C7DBE4", -"E2 c #CADCE4", -"F2 c #CADAE1", -"G2 c #B8CED7", -"H2 c #A8C5D1", -"I2 c #9DBAC8", -"J2 c #93ACBC", -"K2 c #8BA2B5", -"L2 c #849AB0", -"M2 c #7B93AA", -"N2 c #6F88A3", -"O2 c #677D99", -"P2 c #657894", -"Q2 c #647492", -"R2 c #64738F", -"S2 c #647089", -"T2 c #626780", -"U2 c #61637B", -"V2 c #63657C", -"W2 c #6C6D82", -"X2 c #797889", -"Y2 c #8C8693", -"Z2 c #989098", -"`2 c #A0989C", -" 3 c #A79DA1", -".3 c #A99FA2", -"+3 c #ADA5A6", -"@3 c #AFABA7", -"#3 c #ABA9A4", -"$3 c #A5A49F", -"%3 c #A19E98", -"&3 c #9D9A93", -"*3 c #8F8D84", -"=3 c #605F5D", -"-3 c #262525", -";3 c #353939", -">3 c #282D2D", -",3 c #121214", -"'3 c #17191B", -")3 c #151315", -"!3 c #2B262A", -"~3 c #2A2529", -"{3 c #252125", -"]3 c #252326", -"^3 c #0B0C0E", -"/3 c #232723", -"(3 c #262923", -"_3 c #282923", -":3 c #22231E", -"<3 c #161618", -"[3 c #2C292E", -"}3 c #201F24", -"|3 c #202125", -"13 c #232528", -"23 c #262629", -"33 c #2A2929", -"43 c #2D302F", -"53 c #22292F", -"63 c #201D1A", -"73 c #080906", -"83 c #040604", -"93 c #0A0B0D", -"03 c #0B0B0E", -"a3 c #030305", -"b3 c #000002", -"c3 c #5A6564", -"d3 c #6A7C78", -"e3 c #748580", -"f3 c #7F8D87", -"g3 c #889191", -"h3 c #8C9197", -"i3 c #92979F", -"j3 c #9BA1A8", -"k3 c #A4A9AE", -"l3 c #AAADB3", -"m3 c #ACAEB6", -"n3 c #ADB0B9", -"o3 c #AFB2BB", -"p3 c #B2B4BE", -"q3 c #B7B9C3", -"r3 c #C1C3CA", -"s3 c #C6C9CF", -"t3 c #C8CAD0", -"u3 c #D2D2D7", -"v3 c #D8D7DB", -"w3 c #D5D6D8", -"x3 c #CED1D5", -"y3 c #C8CED4", -"z3 c #C0C9D3", -"A3 c #B9C5CF", -"B3 c #B2BECB", -"C3 c #AAB7C5", -"D3 c #A5B2C2", -"E3 c #A8B4C5", -"F3 c #A6B7C7", -"G3 c #A4B7C9", -"H3 c #9FB5C7", -"I3 c #96AEC3", -"J3 c #97AFC3", -"K3 c #A1B8C8", -"L3 c #ADC5D3", -"M3 c #B7D0DC", -"N3 c #B0CCD9", -"O3 c #ADCBDA", -"P3 c #BAD1DC", -"Q3 c #BED2DB", -"R3 c #BFD5DE", -"S3 c #BFD8E2", -"T3 c #B8D3E2", -"U3 c #B6D1E0", -"V3 c #BAD3E0", -"W3 c #C2D8E2", -"X3 c #C0D7E1", -"Y3 c #AFC9D4", -"Z3 c #9FBAC7", -"`3 c #8CA5B5", -" 4 c #8299AC", -".4 c #798DA6", -"+4 c #7384A0", -"@4 c #6D7C98", -"#4 c #687793", -"$4 c #61728D", -"%4 c #5D6C87", -"&4 c #5E6884", -"*4 c #5D647F", -"=4 c #686B85", -"-4 c #676983", -";4 c #676980", -">4 c #6D6E84", -",4 c #727186", -"'4 c #757185", -")4 c #7C7888", -"!4 c #89828B", -"~4 c #93878E", -"{4 c #9A8D90", -"]4 c #A19898", -"^4 c #A7A09F", -"/4 c #AAA4A3", -"(4 c #A8A4A0", -"_4 c #A3A099", -":4 c #9B9890", -"<4 c #959389", -"[4 c #86837C", -"}4 c #5B5853", -"|4 c #312D2B", -"14 c #131112", -"24 c #0A0A0D", -"34 c #1C1E1C", -"44 c #2E3031", -"54 c #27292B", -"64 c #201D17", -"74 c #1E1B19", -"84 c #1A151A", -"94 c #242225", -"04 c #2D282C", -"a4 c #2C272B", -"b4 c #212022", -"c4 c #232623", -"d4 c #2A2D27", -"e4 c #2C2E28", -"f4 c #24251F", -"g4 c #23241E", -"h4 c #1D1E1C", -"i4 c #2F2A31", -"j4 c #1F2024", -"k4 c #1F2226", -"l4 c #1F2228", -"m4 c #222425", -"n4 c #252627", -"o4 c #26262C", -"p4 c #242426", -"q4 c #1A1515", -"r4 c #191816", -"s4 c #17181A", -"t4 c #151617", -"u4 c #241F26", -"v4 c #19181D", -"w4 c #0D0C11", -"x4 c #343438", -"y4 c #495352", -"z4 c #5C6C69", -"A4 c #667B77", -"B4 c #738681", -"C4 c #86948E", -"D4 c #989F9A", -"E4 c #9C9FA0", -"F4 c #9EA0A5", -"G4 c #A4A6AA", -"H4 c #A6A9AF", -"I4 c #A4A7B0", -"J4 c #A5A5AF", -"K4 c #AFB0B9", -"L4 c #B1B3BC", -"M4 c #AFB2BC", -"N4 c #AFB2BD", -"O4 c #AFB3BC", -"P4 c #ADB1B9", -"Q4 c #B4B8C0", -"R4 c #BFC2C8", -"S4 c #C2C4CA", -"T4 c #BBBEC7", -"U4 c #B6BBC4", -"V4 c #BBC1CB", -"W4 c #BAC4CD", -"X4 c #B8C4CF", -"Y4 c #BEC7CF", -"Z4 c #BFC9CF", -"`4 c #BFCAD1", -" 5 c #BAC8D1", -".5 c #B4C2CC", -"+5 c #ABBAC8", -"@5 c #A1AEC1", -"#5 c #9AA7B8", -"$5 c #9DADBF", -"%5 c #A0B4C8", -"&5 c #8FA8BF", -"*5 c #91B3C8", -"=5 c #9FC2CE", -"-5 c #A4C4D1", -";5 c #A0C0D0", -">5 c #96B7CA", -",5 c #90B2C9", -"'5 c #92B3C9", -")5 c #92B2C6", -"!5 c #98B7CA", -"~5 c #9CBACC", -"{5 c #91AFBF", -"]5 c #87A9BB", -"^5 c #7A9BB1", -"/5 c #6D8BA4", -"(5 c #607996", -"_5 c #5C6F8C", -":5 c #596681", -"<5 c #5B637F", -"[5 c #5A5F7D", -"}5 c #555977", -"|5 c #515472", -"15 c #505470", -"25 c #585E78", -"35 c #5E637D", -"45 c #61637E", -"55 c #676A82", -"65 c #72758B", -"75 c #777A8E", -"85 c #6C6D83", -"95 c #68677D", -"05 c #767181", -"a5 c #8A7F89", -"b5 c #928286", -"c5 c #908284", -"d5 c #928788", -"e5 c #999191", -"f5 c #A29E9C", -"g5 c #A7A49F", -"h5 c #A3A09A", -"i5 c #9E9B92", -"j5 c #96928B", -"k5 c #898680", -"l5 c #7C7771", -"m5 c #585453", -"n5 c #1E201E", -"o5 c #2D2F2F", -"p5 c #292A2C", -"q5 c #2C2319", -"r5 c #2E2516", -"s5 c #221E19", -"t5 c #1A1B1D", -"u5 c #16181B", -"v5 c #191A1D", -"w5 c #1B1814", -"x5 c #221A11", -"y5 c #21170C", -"z5 c #120F0E", -"A5 c #0C0D10", -"B5 c #100D11", -"C5 c #312C31", -"D5 c #2E292D", -"E5 c #242024", -"F5 c #1B1A1F", -"G5 c #111014", -"H5 c #212421", -"I5 c #202420", -"J5 c #212521", -"K5 c #232622", -"L5 c #242723", -"M5 c #2A2C27", -"N5 c #23251F", -"O5 c #141612", -"P5 c #151916", -"Q5 c #272729", -"R5 c #2C272E", -"S5 c #2D282F", -"T5 c #212125", -"U5 c #202226", -"V5 c #212225", -"W5 c #212226", -"X5 c #222227", -"Y5 c #32281E", -"Z5 c #2C271D", -"`5 c #1E1F21", -" 6 c #1C1D1E", -".6 c #1F1E1E", -"+6 c #262226", -"@6 c #1E201F", -"#6 c #1C1E1D", -"$6 c #292427", -"%6 c #312C30", -"&6 c #414646", -"*6 c #546562", -"=6 c #59716C", -"-6 c #637A77", -";6 c #6E817E", -">6 c #7B8A83", -",6 c #8B968E", -"'6 c #98A09C", -")6 c #A3A9A7", -"!6 c #A9AEAF", -"~6 c #A5A9AF", -"{6 c #A2A6AE", -"]6 c #A4A7AE", -"^6 c #A9ACB3", -"/6 c #B0B0B7", -"(6 c #B3B3BB", -"_6 c #ADB0BA", -":6 c #A6A9B5", -"<6 c #A0A4AF", -"[6 c #A3A6B1", -"}6 c #ACB0B9", -"|6 c #B7BBC4", -"16 c #BCC3CB", -"26 c #C5CDD4", -"36 c #CAD2D9", -"46 c #CFD5DA", -"56 c #D2D6DB", -"66 c #D2D7DC", -"76 c #D3D8DC", -"86 c #D6DBDE", -"96 c #D9DEE1", -"06 c #D7DCDF", -"a6 c #D2D8DB", -"b6 c #C4D1D7", -"c6 c #A5BCCB", -"d6 c #8BA1BA", -"e6 c #8D9EB3", -"f6 c #98A1B5", -"g6 c #96A2B3", -"h6 c #8694A9", -"i6 c #8093A9", -"j6 c #819AAF", -"k6 c #778EA4", -"l6 c #7289A0", -"m6 c #6B849C", -"n6 c #617994", -"o6 c #637993", -"p6 c #647891", -"q6 c #667C97", -"r6 c #748BA5", -"s6 c #738BA2", -"t6 c #6F8BA3", -"u6 c #67839D", -"v6 c #5C7691", -"w6 c #506682", -"x6 c #4A5A78", -"y6 c #475170", -"z6 c #494C6C", -"A6 c #4F516F", -"B6 c #515371", -"C6 c #4D506E", -"D6 c #484D6B", -"E6 c #515B76", -"F6 c #606A85", -"G6 c #5C617D", -"H6 c #585D76", -"I6 c #5E6279", -"J6 c #696B82", -"K6 c #686A81", -"L6 c #5D6078", -"M6 c #5C5E76", -"N6 c #6C6779", -"O6 c #817681", -"P6 c #877B7F", -"Q6 c #827678", -"R6 c #7E7375", -"S6 c #8A8384", -"T6 c #9D9794", -"U6 c #A39D99", -"V6 c #A19D96", -"W6 c #9F9E96", -"X6 c #9A9891", -"Y6 c #908B84", -"Z6 c #7C766F", -"`6 c #69645F", -" 7 c #3E3B3D", -".7 c #1A171C", -"+7 c #0F0C13", -"@7 c #272824", -"#7 c #292C2A", -"$7 c #1B150F", -"%7 c #1F1B13", -"&7 c #1F2021", -"*7 c #1E1E22", -"=7 c #19191B", -"-7 c #28221C", -";7 c #453317", -">7 c #4E4539", -",7 c #3D4247", -"'7 c #1F1D1D", -")7 c #14130A", -"!7 c #100B10", -"~7 c #2B292E", -"{7 c #222622", -"]7 c #141915", -"^7 c #171B17", -"/7 c #292C28", -"(7 c #2C2C2D", -"_7 c #2A272E", -":7 c #202024", -"<7 c #1E1F23", -"[7 c #1F2225", -"}7 c #1E1C1C", -"|7 c #161316", -"17 c #302B2F", -"27 c #312F32", -"37 c #404344", -"47 c #53615E", -"57 c #586D68", -"67 c #5C746E", -"77 c #627978", -"87 c #667977", -"97 c #73837B", -"07 c #86928A", -"a7 c #969F9A", -"b7 c #A2A8A7", -"c7 c #A5A8AB", -"d7 c #A3A5AD", -"e7 c #A4A6AF", -"f7 c #A7A9B2", -"g7 c #A8ABB2", -"h7 c #A7ABB6", -"i7 c #A0A6B6", -"j7 c #969CAB", -"k7 c #9699A8", -"l7 c #9E9EAB", -"m7 c #ACADB8", -"n7 c #BDBEC7", -"o7 c #C4C7CF", -"p7 c #C5CAD1", -"q7 c #C7CDD4", -"r7 c #DDE2E5", -"s7 c #E0E2E5", -"t7 c #E0E3E6", -"u7 c #E1E4E7", -"v7 c #E1E3E6", -"w7 c #E0E3E4", -"x7 c #E0E2E4", -"y7 c #DDE0E2", -"z7 c #CFDCE1", -"A7 c #B0C9DC", -"B7 c #87AECE", -"C7 c #81A2C4", -"D7 c #95AAC2", -"E7 c #9AA2B0", -"F7 c #9094A8", -"G7 c #7D849A", -"H7 c #747C94", -"I7 c #5A627C", -"J7 c #4D5672", -"K7 c #4D5875", -"L7 c #475070", -"M7 c #454D6B", -"N7 c #4C5370", -"O7 c #465271", -"P7 c #566481", -"Q7 c #596882", -"R7 c #5A6783", -"S7 c #57637F", -"T7 c #525C79", -"U7 c #4A5471", -"V7 c #424C69", -"W7 c #3F4664", -"X7 c #414665", -"Y7 c #444866", -"Z7 c #454967", -"`7 c #424665", -" 8 c #3C4161", -".8 c #3E4866", -"+8 c #505C79", -"@8 c #5A6380", -"#8 c #565B78", -"$8 c #555672", -"%8 c #555771", -"&8 c #575973", -"*8 c #575B75", -"=8 c #535773", -"-8 c #51526A", -";8 c #5F5C71", -">8 c #736A79", -",8 c #776A74", -"'8 c #6B5C61", -")8 c #68595A", -"!8 c #7F706F", -"~8 c #968A87", -"{8 c #978E89", -"]8 c #958F8A", -"^8 c #9B9790", -"/8 c #9D9990", -"(8 c #939087", -"_8 c #7D786F", -":8 c #71675F", -"<8 c #575250", -"[8 c #2E2E31", -"}8 c #272726", -"|8 c #232425", -"18 c #251A10", -"28 c #4B3A26", -"38 c #636361", -"48 c #4C555E", -"58 c #312D29", -"68 c #272520", -"78 c #1E2123", -"88 c #1D1D1F", -"98 c #19191C", -"08 c #221F1A", -"a8 c #2E2C23", -"b8 c #50565F", -"c8 c #646B75", -"d8 c #3E3522", -"e8 c #251A0D", -"f8 c #272528", -"g8 c #080806", -"h8 c #222520", -"i8 c #131510", -"j8 c #171915", -"k8 c #1B1F1C", -"l8 c #262B26", -"m8 c #2C312B", -"n8 c #2E332D", -"o8 c #303530", -"p8 c #2C2C2E", -"q8 c #28262C", -"r8 c #28272D", -"s8 c #26252A", -"t8 c #1D1E22", -"u8 c #1F1F24", -"v8 c #1F2025", -"w8 c #1C1C20", -"x8 c #232426", -"y8 c #202224", -"z8 c #322C32", -"A8 c #332E34", -"B8 c #3A383C", -"C8 c #4F5756", -"D8 c #576B66", -"E8 c #58746D", -"F8 c #5E7771", -"G8 c #607671", -"H8 c #657873", -"I8 c #71817D", -"J8 c #7F8B88", -"K8 c #8B9295", -"L8 c #969BA3", -"M8 c #989AA5", -"N8 c #9696A3", -"O8 c #9897A5", -"P8 c #9F9FAA", -"Q8 c #A2A4AC", -"R8 c #A6A9B0", -"S8 c #A7AAB1", -"T8 c #999DA9", -"U8 c #8F94A5", -"V8 c #9A9CAA", -"W8 c #A3A3B0", -"X8 c #A6A6B3", -"Y8 c #B1B1BD", -"Z8 c #BEBEC7", -"`8 c #C3C4CA", -" 9 c #BEC1C7", -".9 c #BFC4C9", -"+9 c #D3D8DB", -"@9 c #E2E3E4", -"#9 c #E2E3E5", -"$9 c #E3E4E5", -"%9 c #E1E3E2", -"&9 c #DEE1E0", -"*9 c #D9DFE0", -"=9 c #CAD6E0", -"-9 c #AAC8D8", -";9 c #98BFD9", -">9 c #87B2CB", -",9 c #86A5BD", -"'9 c #8E97A9", -")9 c #83889B", -"!9 c #7C7F95", -"~9 c #5F637E", -"{9 c #454B68", -"]9 c #414967", -"^9 c #3F4567", -"/9 c #404464", -"(9 c #494C6A", -"_9 c #464B6C", -":9 c #484E6E", -"<9 c #474D6A", -"[9 c #464B69", -"}9 c #444765", -"|9 c #424564", -"19 c #414664", -"29 c #3F4562", -"39 c #404564", -"49 c #3E4363", -"59 c #393E5E", -"69 c #363B5B", -"79 c #353A5C", -"89 c #3D4767", -"99 c #526482", -"09 c #5E7390", -"a9 c #586583", -"b9 c #505573", -"c9 c #4D4F6B", -"d9 c #4F506D", -"e9 c #565772", -"f9 c #5C5D75", -"g9 c #5D5C74", -"h9 c #5E5D72", -"i9 c #686474", -"j9 c #70656D", -"k9 c #6E5C5F", -"l9 c #644E50", -"m9 c #5D4747", -"n9 c #6B5755", -"o9 c #847672", -"p9 c #8D827D", -"q9 c #827B74", -"r9 c #858377", -"s9 c #8C8A7F", -"t9 c #87857A", -"u9 c #7E786D", -"v9 c #6F675E", -"w9 c #5B534D", -"x9 c #413B3D", -"y9 c #2F2A2E", -"z9 c #211D21", -"A9 c #131116", -"B9 c #0C0807", -"C9 c #20180C", -"D9 c #38342F", -"E9 c #626975", -"F9 c #685D4B", -"G9 c #503C1F", -"H9 c #2D2925", -"I9 c #1C1A20", -"J9 c #18181B", -"K9 c #30303D", -"L9 c #2D2A23", -"M9 c #201A0F", -"N9 c #131716", -"O9 c #121615", -"P9 c #0F1310", -"Q9 c #1A1E19", -"R9 c #191D1B", -"S9 c #313534", -"T9 c #313433", -"U9 c #323430", -"V9 c #2D2F2A", -"W9 c #2E2E2B", -"X9 c #2B2A2A", -"Y9 c #202023", -"Z9 c #1F1F23", -"`9 c #1F1E23", -" 0 c #1A211E", -".0 c #151618", -"+0 c #232325", -"@0 c #151917", -"#0 c #1E1C1D", -"$0 c #252123", -"%0 c #323035", -"&0 c #343137", -"*0 c #352F35", -"=0 c #3D4043", -"-0 c #576765", -";0 c #5E7369", -">0 c #607872", -",0 c #5B7071", -"'0 c #58696C", -")0 c #5D6A6F", -"!0 c #616E75", -"~0 c #67727E", -"{0 c #6D7584", -"]0 c #767A8C", -"^0 c #77798C", -"/0 c #727489", -"(0 c #787A90", -"_0 c #838597", -":0 c #92939F", -"<0 c #A0A2AB", -"[0 c #A6AAB5", -"}0 c #9C9DAA", -"|0 c #A4A3B2", -"10 c #AAA9B7", -"20 c #A2A4B0", -"30 c #A7A9B5", -"40 c #B4B4C0", -"50 c #BCBDC7", -"60 c #B9BEC6", -"70 c #C7CDD2", -"80 c #DEE0E0", -"90 c #E1E3E3", -"00 c #E2E3E3", -"a0 c #E2E4E3", -"b0 c #E3E4E4", -"c0 c #E1E4E3", -"d0 c #DFE2E1", -"e0 c #DBE1DF", -"f0 c #DADFDD", -"g0 c #D3DADF", -"h0 c #B0CDDA", -"i0 c #74A3BF", -"j0 c #6492B4", -"k0 c #7588A3", -"l0 c #8A8FA1", -"m0 c #8A8DA0", -"n0 c #85889C", -"o0 c #6E7088", -"p0 c #4B4F6B", -"q0 c #3D4362", -"r0 c #393F60", -"s0 c #454A68", -"t0 c #51556D", -"u0 c #545775", -"v0 c #545978", -"w0 c #4E5672", -"x0 c #424867", -"y0 c #3B4060", -"z0 c #393D5F", -"A0 c #3B3F61", -"B0 c #3C4163", -"C0 c #3B4062", -"D0 c #373B5E", -"E0 c #323659", -"F0 c #2C3053", -"G0 c #292E50", -"H0 c #2F3456", -"I0 c #404B6C", -"J0 c #576987", -"K0 c #5E6E8D", -"L0 c #535F7E", -"M0 c #4A4E6D", -"N0 c #464967", -"O0 c #464966", -"P0 c #5E5D73", -"Q0 c #706D7D", -"R0 c #74707D", -"S0 c #746C78", -"T0 c #776A76", -"U0 c #6C5D62", -"V0 c #574547", -"W0 c #4E3A39", -"X0 c #58433E", -"Y0 c #75615A", -"Z0 c #7B7064", -"`0 c #706B5E", -" a c #747265", -".a c #757467", -"+a c #727365", -"@a c #7A776A", -"#a c #6B6459", -"$a c #60554D", -"%a c #514948", -"&a c #383239", -"*a c #2E2C31", -"=a c #222022", -"-a c #040406", -";a c #1F1C14", -">a c #362612", -",a c #31271A", -"'a c #1D1E21", -")a c #1B1C1F", -"!a c #1B1B1E", -"~a c #121111", -"{a c #0E0D08", -"]a c #13100E", -"^a c #171914", -"/a c #1A1C17", -"(a c #191B17", -"_a c #21241F", -":a c #202320", -"b c #2A2E51", -",b c #3A4062", -"'b c #4C5A79", -")b c #586685", -"!b c #545B7B", -"~b c #4C506F", -"{b c #494D6B", -"]b c #464A67", -"^b c #484963", -"/b c #58576B", -"(b c #726976", -"_b c #786C76", -":b c #73656F", -"c c #72778D", -",c c #7C7E95", -"'c c #7F8096", -")c c #86889B", -"!c c #8B8EA1", -"~c c #7A7D92", -"{c c #65677F", -"]c c #5C607C", -"^c c #525774", -"/c c #6D7188", -"(c c #757586", -"_c c #76768A", -":c c #6B6D86", -"d c #404363", -",d c #404262", -"'d c #424864", -")d c #4F5470", -"!d c #6C6C83", -"~d c #938E9B", -"{d c #A8A4A8", -"]d c #B0B2B8", -"^d c #AFB3BE", -"/d c #9FA3B0", -"(d c #9295A6", -"_d c #8D919F", -":d c #8A8E9D", -"e c #282227", -",e c #272025", -"'e c #0D1111", -")e c #141611", -"!e c #131511", -"~e c #070906", -"{e c #161813", -"]e c #101410", -"^e c #0D100E", -"/e c #232624", -"(e c #191A15", -"_e c #161713", -":e c #1D1F1E", -"f c #373B5F", -",f c #303458", -"'f c #2E3557", -")f c #3A4162", -"!f c #4C4864", -"~f c #665A69", -"{f c #645760", -"]f c #605257", -"^f c #5F4E4F", -"/f c #583F3C", -"(f c #483337", -"_f c #41333F", -":f c #51393D", -"g c #DBDDDB", -",g c #DADCD9", -"'g c #CFD6DB", -")g c #9AABBB", -"!g c #6D758B", -"~g c #7D8397", -"{g c #86899D", -"]g c #60657F", -"^g c #4B4F6E", -"/g c #595E79", -"(g c #74758F", -"_g c #82869A", -":g c #666B83", -"h c #2D3336", -",h c #2E3D3F", -"'h c #334948", -")h c #506461", -"!h c #4D555F", -"~h c #40425A", -"{h c #454663", -"]h c #4F506C", -"^h c #51506A", -"/h c #64647B", -"(h c #646479", -"_h c #4B4D69", -":h c #4E526D", -"i c #4A4331", -",i c #665C52", -"'i c #5E5251", -")i c #2F272C", -"!i c #0B080A", -"~i c #010302", -"{i c #1C1919", -"]i c #070A0A", -"^i c #13110B", -"/i c #493115", -"(i c #5A4830", -"_i c #677381", -":i c #282B33", -"j c #6D6E88", -",j c #6D6F86", -"'j c #5B5D78", -")j c #535774", -"!j c #3B4061", -"~j c #363B5D", -"{j c #33385A", -"]j c #4E5271", -"^j c #5D627E", -"/j c #626881", -"(j c #505471", -"_j c #4D516F", -":j c #545873", -"k c #6B4C22", -",k c #473117", -"'k c #0B0807", -")k c #2B312F", -"!k c #5E6D69", -"~k c #697774", -"{k c #6A7575", -"]k c #5D646E", -"^k c #4D5068", -"/k c #4B4E6A", -"(k c #484864", -"_k c #44445F", -":k c #5D5A6F", -"l c #363F2C", -",l c #353A25", -"'l c #333521", -")l c #43422F", -"!l c #605D49", -"~l c #6E6956", -"{l c #5E5745", -"]l c #61564B", -"^l c #5A514B", -"/l c #1F1A18", -"(l c #020204", -"_l c #120F0F", -":l c #30353A", -"m c #5E627D", -",m c #585A77", -"'m c #525573", -")m c #4A4D6D", -"!m c #515271", -"~m c #60627F", -"{m c #6F708B", -"]m c #6E7089", -"^m c #868A9C", -"/m c #5C5F7C", -"(m c #414565", -"_m c #474C6A", -":m c #4D5270", -"n c #312D35", -",n c #211F25", -"'n c #222229", -")n c #1E1D22", -"!n c #080C0B", -"~n c #1F2625", -"{n c #3E4C49", -"]n c #6A7573", -"^n c #929899", -"/n c #98989F", -"(n c #717385", -"_n c #4E516B", -":n c #4F5069", -"o c #828675", -",o c #929284", -"'o c #9A998E", -")o c #A4A39A", -"!o c #B0ADA6", -"~o c #A4A398", -"{o c #82796C", -"]o c #755E4F", -"^o c #644937", -"/o c #61493D", -"(o c #594C47", -"_o c #1A1412", -":o c #010203", -"p c #4B4D6C", -",p c #555674", -"'p c #696A86", -")p c #777991", -"!p c #7E8196", -"~p c #8A8C9F", -"{p c #34385C", -"]p c #34395C", -"^p c #3E4364", -"/p c #5E617C", -"(p c #7F8198", -"_p c #84879B", -":p c #8B8E9E", -"

Q c #464C6B", -",Q c #5C617A", -"'Q c #74758B", -")Q c #4E506E", -"!Q c #303356", -"~Q c #252A4F", -"{Q c #292D52", -"]Q c #292D51", -"^Q c #2C3051", -"/Q c #2E3353", -"(Q c #444769", -"_Q c #616580", -":Q c #777C91", -"R c #292629", -",R c #100E15", -"'R c #150F11", -")R c #362C1F", -"!R c #3F3426", -"~R c #5C6973", -"{R c #576069", -"]R c #493D30", -"^R c #474249", -"/R c #40434A", -"(R c #41444B", -"_R c #393C43", -":R c #35393F", -"S c #A0A293", -",S c #A3A495", -"'S c #A5A794", -")S c #8F927D", -"!S c #949582", -"~S c #939485", -"{S c #8C8E7A", -"]S c #969482", -"^S c #827F68", -"/S c #92917D", -"(S c #E4E5DE", -"_S c #F2F0EC", -":S c #EFEAE7", -"T c #2E3257", -",T c #5F647F", -"'T c #A2A5B0", -")T c #BCBEC4", -"!T c #AFB2BE", -"~T c #7E8294", -"{T c #73788F", -"]T c #6F738B", -"^T c #5F637D", -"/T c #484C6B", -"(T c #74758E", -"_T c #2E3253", -":T c #25294D", -"U c #34373C", -",U c #463B2D", -"'U c #7E581E", -")U c #978A77", -"!U c #8896A1", -"~U c #343837", -"{U c #2D272D", -"]U c #211E24", -"^U c #302B32", -"/U c #222322", -"(U c #1E1E25", -"_U c #241F20", -":U c #584127", -"V c #A69D98", -",V c #B0A398", -"'V c #C4BDB2", -")V c #C9CABF", -"!V c #BAB7AC", -"~V c #B6B5A7", -"{V c #B1B7A7", -"]V c #A1A795", -"^V c #909782", -"/V c #8B907A", -"(V c #7C816B", -"_V c #7E836D", -":V c #838671", -"W c #383A4F", -",W c #595965", -"'W c #726B70", -")W c #7E7579", -"!W c #82838E", -"~W c #8F919C", -"{W c #8A8C97", -"]W c #888B95", -"^W c #848693", -"/W c #8D8F9A", -"(W c #9496A2", -"_W c #8B8D9B", -":W c #64667B", -"X c #95816B", -",X c #9E8770", -"'X c #A38C74", -")X c #8D7A65", -"!X c #7D6F5D", -"~X c #796D5E", -"{X c #685B4E", -"]X c #3E3026", -"^X c #493E34", -"/X c #514C41", -"(X c #39383F", -"_X c #39393F", -":X c #3D3E42", -"Y c #797B8F", -",Y c #7D7277", -"'Y c #84736E", -")Y c #74706F", -"!Y c #7B7D8B", -"~Y c #A1A3AB", -"{Y c #91909A", -"]Y c #ABA5A9", -"^Y c #C7C3BE", -"/Y c #C6C1BE", -"(Y c #95908A", -"_Y c #6C6761", -":Y c #444053", -"Z c #343630", -",Z c #30342E", -"'Z c #313730", -")Z c #1C1920", -"!Z c #1D1B21", -"~Z c #25242B", -"{Z c #303038", -"]Z c #3D3D45", -"^Z c #3F4048", -"/Z c #3A3D44", -"(Z c #373A40", -"_Z c #32353A", -":Z c #3C3D41", -"` c #92947D", -",` c #888A73", -"'` c #AAAB9A", -")` c #A0A18F", -"!` c #8C8F7A", -"~` c #9DA18D", -"{` c #BDC1B3", -"]` c #B0B4A5", -"^` c #DADBD3", -"/` c #D4D4CB", -"(` c #CDCBC1", -"_` c #E8E5E1", -":` c #F7F3F0", -"<` c #F2EEEB", -"[` c #E2DCD6", -"}` c #D0C5BB", -"|` c #937B65", -"1` c #795C3F", -"2` c #7A6446", -"3` c #6D6A4A", -"4` c #626D50", -"5` c #647558", -"6` c #6C765D", -"7` c #A3A090", -"8` c #A29A86", -"9` c #9C8E76", -"0` c #7E7165", -"a` c #625649", -"b` c #856D55", -"c` c #9D8066", -"d` c #8A745D", -"e` c #7A6B59", -"f` c #6F6456", -"g` c #41372D", -"h` c #4A423A", -"i` c #585149", -"j` c #4C4A46", -"k` c #3D3B3B", -"l` c #5A4736", -"m` c #885C22", -"n` c #46341A", -"o` c #211F1F", -"p` c #0E0D0D", -"q` c #151313", -"r` c #41423D", -"s` c #434542", -"t` c #3E403D", -"u` c #3F413E", -"v` c #42433F", -"w` c #3A3935", -"x` c #332E30", -"y` c #0E0C11", -"z` c #2F2B2F", -"A` c #2F2E2D", -"B` c #333630", -"C` c #363A32", -"D` c #43473D", -"E` c #363932", -"F` c #303630", -"G` c #2D312F", -"H` c #292C29", -"I` c #18171C", -"J` c #201F25", -"K` c #2B2B31", -"L` c #33333A", -"M` c #37373F", -"N` c #3C3C44", -"O` c #43464D", -"P` c #43454F", -"Q` c #3E404A", -"R` c #3A3B3C", -"S` c #0C0F15", -"T` c #02040F", -"U` c #010313", -"V` c #010415", -"W` c #010417", -"X` c #02041A", -"Y` c #01031B", -"Z` c #02041D", -"`` c #04061F", -" . c #050720", -". . c #040521", -"+ . c #0A0B29", -"@ . c #1F213D", -"# . c #4A4C5E", -"$ . c #69697A", -"% . c #777985", -"& . c #797B87", -"* . c #70727F", -"= . c #727483", -"- . c #7D7F8C", -"; . c #838591", -"> . c #8E9199", -", . c #92959E", -"' . c #8C8E9A", -") . c #8A8B98", -"! . c #7B7D8F", -"~ . c #5B5E75", -"{ . c #373A58", -"] . c #313454", -"^ . c #343756", -"/ . c #313457", -"( . c #333758", -"_ . c #262A4D", -": . c #22264B", -"< . c #202549", -"[ . c #1D2146", -"} . c #333555", -"| . c #818395", -"1 . c #A9ACB4", -"2 . c #A3A6AC", -"3 . c #A3A6B0", -"4 . c #9597A5", -"5 . c #7F8196", -"6 . c #595D79", -"7 . c #1C2044", -"8 . c #101437", -"9 . c #242B4F", -"0 . c #474B64", -"a . c #5C605D", -"b . c #596256", -"c . c #566166", -"d . c #606B6F", -"e . c #5A6072", -"f . c #383B5B", -"g . c #2A2D4F", -"h . c #2A2D4D", -"i . c #25274C", -"j . c #333656", -"k . c #595B74", -"l . c #6E758E", -"m . c #63667F", -"n . c #A6A4A5", -"o . c #B2B4BA", -"p . c #ADADB4", -"q . c #BEB9B8", -"r . c #BDBAB4", -"s . c #818082", -"t . c #5B535B", -"u . c #725D62", -"v . c #37344E", -"w . c #252846", -"x . c #7D8091", -"y . c #403C59", -"z . c #7D716D", -"A . c #A39588", -"B . c #CEC6BC", -"C . c #D8D2CA", -"D . c #CFC8BF", -"E . c #C8C7B8", -"F . c #ADA998", -"G . c #9A9886", -"H . c #919683", -"I . c #A5A796", -"J . c #9EA18C", -"K . c #959880", -"L . c #9DA18B", -"M . c #A4A792", -"N . c #A5A694", -"O . c #989A85", -"P . c #888B75", -"Q . c #AAAC9B", -"R . c #D0D1C7", -"S . c #C7C9BC", -"T . c #DADBD4", -"U . c #DAD9D1", -"V . c #D2CFC5", -"W . c #E9E6E1", -"X . c #F5F2ED", -"Y . c #F3EFEA", -"Z . c #DED8D2", -"` . c #C2B7AD", -" .. c #836A54", -"... c #70512D", -"+.. c #6E512D", -"@.. c #5E502B", -"#.. c #646746", -"$.. c #6C7A5D", -"%.. c #7E8972", -"&.. c #A6A897", -"*.. c #A6A089", -"=.. c #A19178", -"-.. c #7D7066", -";.. c #464344", -">.. c #6C5D51", -",.. c #9F8266", -"'.. c #977C63", -").. c #87725E", -"!.. c #726451", -"~.. c #473F2F", -"{.. c #484038", -"].. c #5D5450", -"^.. c #55524F", -"/.. c #474238", -"(.. c #594A31", -"_.. c #5E4A30", -":.. c #423D39", -"<.. c #37393E", -"[.. c #3A3C40", -"}.. c #323438", -"|.. c #3E413E", -"1.. c #424540", -"2.. c #414340", -"3.. c #42443E", -"4.. c #484843", -"5.. c #43433E", -"6.. c #363433", -"7.. c #332F31", -"8.. c #322E32", -"9.. c #323231", -"0.. c #353631", -"a.. c #343830", -"b.. c #2E322B", -"c.. c #31362F", -"d.. c #393E35", -"e.. c #2F332D", -"f.. c #2D332D", -"g.. c #2A2F2C", -"h.. c #222525", -"i.. c #343439", -"j.. c #35353A", -"k.. c #3C3D45", -"l.. c #42434B", -"m.. c #484A51", -"n.. c #494C54", -"o.. c #4C4F57", -"p.. c #464850", -"q.. c #0F1317", -"r.. c #040710", -"s.. c #010311", -"t.. c #000313", -"u.. c #010416", -"v.. c #020417", -"w.. c #01031C", -"x.. c #03051E", -"y.. c #03041F", -"z.. c #070824", -"A.. c #10122E", -"B.. c #20243D", -"C.. c #4D5260", -"D.. c #6F727F", -"E.. c #737582", -"F.. c #717380", -"G.. c #6A6C78", -"H.. c #757885", -"I.. c #8D9099", -"J.. c #8A8D97", -"K.. c #80828E", -"L.. c #828391", -"M.. c #777989", -"N.. c #6C7181", -"O.. c #53566F", -"P.. c #3B3E5B", -"Q.. c #363A58", -"R.. c #2F3454", -"S.. c #292E4F", -"T.. c #2A2E4F", -"U.. c #202446", -"V.. c #202448", -"W.. c #1E2245", -"X.. c #4E506A", -"Y.. c #A3A5AC", -"Z.. c #A5A7AF", -"`.. c #9A9CA8", -" +. c #7A7C8F", -".+. c #393D5C", -"++. c #15183F", -"@+. c #04082E", -"#+. c #0A0F33", -"$+. c #2A3151", -"%+. c #50536B", -"&+. c #66675F", -"*+. c #585C4F", -"=+. c #5C6755", -"-+. c #6F7769", -";+. c #616575", -">+. c #3F4262", -",+. c #292C4F", -"'+. c #292B50", -")+. c #555875", -"!+. c #878899", -"~+. c #787B8C", -"{+. c #696E84", -"]+. c #5F6169", -"^+. c #7A7873", -"/+. c #9A9CA5", -"(+. c #8F8992", -"_+. c #9A918D", -":+. c #626065", -"<+. c #554E5E", -"[+. c #705A5F", -"}+. c #413C53", -"|+. c #24264B", -"1+. c #2E3051", -"2+. c #64677A", -"3+. c #4A4C6A", -"4+. c #787680", -"5+. c #A1978D", -"6+. c #C2BCB0", -"7+. c #DDDAD4", -"8+. c #D5D1C9", -"9+. c #C4C3B4", -"0+. c #94927E", -"a+. c #82836D", -"b+. c #83866F", -"c+. c #8F8D7A", -"d+. c #938F7A", -"e+. c #8F8D74", -"f+. c #9E9A87", -"g+. c #B1AD9A", -"h+. c #A19F8B", -"i+. c #93957E", -"j+. c #8C8F78", -"k+. c #82856E", -"l+. c #BCBDAE", -"m+. c #DADAD2", -"n+. c #CCCCC2", -"o+. c #CBCBC1", -"p+. c #CFCEC3", -"q+. c #C1BEB4", -"r+. c #E4E1DA", -"s+. c #F7F4EE", -"t+. c #F4F1EA", -"u+. c #DCD6CE", -"v+. c #B0A499", -"w+. c #826954", -"x+. c #6C4B2B", -"y+. c #6E4C29", -"z+. c #634A27", -"A+. c #635B3A", -"B+. c #757B5E", -"C+. c #767E69", -"D+. c #A0A28F", -"E+. c #AAA48A", -"F+. c #A59279", -"G+. c #8C7868", -"H+. c #3E3B42", -"I+. c #474448", -"J+. c #927965", -"K+. c #9C7C63", -"L+. c #90755E", -"M+. c #7C6953", -"N+. c #59503D", -"O+. c #4A4339", -"P+. c #5F5856", -"Q+. c #474444", -"R+. c #3B3B42", -"S+. c #383940", -"T+. c #393741", -"U+. c #35383F", -"V+. c #35383E", -"W+. c #32333A", -"X+. c #2B2931", -"Y+. c #1C1B20", -"Z+. c #404443", -"`+. c #454945", -" @. c #474A47", -".@. c #444743", -"+@. c #424441", -"@@. c #484A42", -"#@. c #45463F", -"$@. c #41403D", -"%@. c #3B3938", -"&@. c #323031", -"*@. c #332E33", -"=@. c #2F2B32", -"-@. c #313132", -";@. c #393B36", -">@. c #33352F", -",@. c #2F322B", -"'@. c #2A2F29", -")@. c #1A191E", -"!@. c #2C2E34", -"~@. c #3B3D43", -"{@. c #3F4148", -"]@. c #44474E", -"^@. c #4E5158", -"/@. c #51545D", -"(@. c #51545C", -"_@. c #090D11", -":@. c #060A12", -"<@. c #000410", -"[@. c #000312", -"}@. c #000314", -"|@. c #020416", -"1@. c #03051F", -"2@. c #0F112B", -"3@. c #1F2139", -"4@. c #3E3F56", -"5@. c #646674", -"6@. c #6D6F7C", -"7@. c #626474", -"8@. c #676979", -"9@. c #616373", -"0@. c #616374", -"a@. c #666978", -"b@. c #7A7C88", -"c@. c #7F8090", -"d@. c #707283", -"e@. c #616576", -"f@. c #62647B", -"g@. c #4B4D68", -"h@. c #353956", -"i@. c #222649", -"j@. c #1F2346", -"k@. c #181D41", -"l@. c #626379", -"m@. c #9D9EA8", -"n@. c #A3A6AD", -"o@. c #A3A4AD", -"p@. c #838595", -"q@. c #62637F", -"r@. c #4A4B69", -"s@. c #3D415D", -"t@. c #61657F", -"u@. c #1A1D41", -"v@. c #070B31", -"w@. c #080C31", -"x@. c #1A1E41", -"y@. c #5F615F", -"z@. c #585A4A", -"A@. c #666C5D", -"B@. c #636A6C", -"C@. c #53556E", -"D@. c #3A3E5D", -"E@. c #2E3153", -"F@. c #323556", -"G@. c #333657", -"H@. c #60647C", -"I@. c #808294", -"J@. c #5F6478", -"K@. c #565969", -"L@. c #53544C", -"M@. c #595A54", -"N@. c #666975", -"O@. c #5F5F75", -"P@. c #655C68", -"Q@. c #786261", -"R@. c #66585E", -"S@. c #44425A", -"T@. c #514E66", -"U@. c #454861", -"V@. c #252A4B", -"W@. c #292D4D", -"X@. c #6E7287", -"Y@. c #7B7A87", -"Z@. c #989385", -"`@. c #B3AEA1", -" #. c #D0D0C7", -".#. c #C2C2B7", -"+#. c #AAA493", -"@#. c #898673", -"##. c #707159", -"$#. c #8C8A71", -"%#. c #97907E", -"&#. c #9E9381", -"*#. c #948F74", -"=#. c #998F7A", -"-#. c #9E9680", -";#. c #8F8A73", -">#. c #85856A", -",#. c #8B8E75", -"'#. c #949782", -")#. c #C3C5B7", -"!#. c #DBDBD4", -"~#. c #C9CABE", -"{#. c #9E9B8A", -"]#. c #C6C2B3", -"^#. c #C4BFB5", -"/#. c #E4E1DB", -"(#. c #FAF7F2", -"_#. c #F4F1EB", -":#. c #D5CCC0", -"<#. c #9F8C7A", -"[#. c #80624B", -"}#. c #6C4A2D", -"|#. c #694721", -"1#. c #6A4821", -"2#. c #755A35", -"3#. c #766B4B", -"4#. c #6E6A57", -"5#. c #867F6E", -"6#. c #AC9E84", -"7#. c #AA9578", -"8#. c #A68D75", -"9#. c #635C5A", -"0#. c #3B3F47", -"a#. c #766860", -"b#. c #93745F", -"c#. c #95775E", -"d#. c #886F5A", -"e#. c #685A47", -"f#. c #524C3E", -"g#. c #574E48", -"h#. c #605956", -"i#. c #4B4B48", -"j#. c #3F3E41", -"k#. c #3B3E45", -"l#. c #3B3D45", -"m#. c #3A3A43", -"n#. c #323338", -"o#. c #1D1D22", -"p#. c #303433", -"q#. c #3D423F", -"r#. c #3D4140", -"s#. c #424644", -"t#. c #444946", -"u#. c #444945", -"v#. c #414541", -"w#. c #474A43", -"x#. c #52554D", -"y#. c #484A44", -"z#. c #42413D", -"A#. c #383734", -"B#. c #353135", -"C#. c #2A252C", -"D#. c #1B1B17", -"E#. c #141410", -"F#. c #2D2A30", -"G#. c #2E2C30", -"H#. c #323532", -"I#. c #313530", -"J#. c #2E322D", -"K#. c #2C302B", -"L#. c #2C312C", -"M#. c #1A171D", -"N#. c #1B191F", -"O#. c #151519", -"P#. c #1F2125", -"Q#. c #1D1F25", -"R#. c #0B0D14", -"S#. c #03060E", -"T#. c #00030D", -"U#. c #000211", -"V#. c #02041C", -"W#. c #090B24", -"X#. c #1A1C33", -"Y#. c #303247", -"Z#. c #525365", -"`#. c #656772", -" $. c #5E606F", -".$. c #515264", -"+$. c #595A6C", -"@$. c #555768", -"#$. c #5D606F", -"$$. c #6C707D", -"%$. c #828490", -"&$. c #848592", -"*$. c #646678", -"=$. c #494C63", -"-$. c #4B4D65", -";$. c #4E4F6A", -">$. c #313653", -",$. c #1F2345", -"'$. c #191D40", -")$. c #1D2144", -"!$. c #171B3E", -"~$. c #1A1F42", -"{$. c #6B6C81", -"]$. c #9D9FA7", -"^$. c #A1A4AB", -"/$. c #A3A6AE", -"($. c #5B5E76", -"_$. c #4C4F69", -":$. c #545570", -"<$. c #5A5B77", -"[$. c #444664", -"}$. c #111539", -"|$. c #2D3252", -"1$. c #383D5C", -"2$. c #474D67", -"3$. c #5C5D5F", -"4$. c #646350", -"5$. c #696D63", -"6$. c #565F6B", -"7$. c #50536C", -"8$. c #383C59", -"9$. c #202545", -"0$. c #353859", -"a$. c #313455", -"b$. c #222748", -"c$. c #222746", -"d$. c #454864", -"e$. c #3D415E", -"f$. c #565A67", -"g$. c #606158", -"h$. c #606164", -"i$. c #494A59", -"j$. c #635967", -"k$. c #5C505B", -"l$. c #5E4E55", -"m$. c #60555F", -"n$. c #3E4059", -"o$. c #6B7086", -"p$. c #3D405A", -"q$. c #5F6177", -"r$. c #89899B", -"s$. c #8E8E9B", -"t$. c #888381", -"u$. c #9D9685", -"v$. c #AAA496", -"w$. c #C3BFB5", -"x$. c #ABA79B", -"y$. c #918674", -"z$. c #857A66", -"A$. c #7C7A65", -"B$. c #ABA694", -"C$. c #ACA492", -"D$. c #9B987D", -"E$. c #8B846C", -"F$. c #847F66", -"G$. c #79765C", -"H$. c #6F6E54", -"I$. c #7D7D67", -"J$. c #ADAE9C", -"K$. c #D0D0C4", -"L$. c #D6D6CD", -"M$. c #BFC0AF", -"N$. c #7A7964", -"O$. c #A2A08E", -"P$. c #C8C5B8", -"Q$. c #E9E7E1", -"R$. c #FAF8F3", -"S$. c #CFC3B4", -"T$. c #8B755F", -"U$. c #7E5E43", -"V$. c #735131", -"W$. c #6E4920", -"X$. c #734920", -"Y$. c #855E2F", -"Z$. c #7D694E", -"`$. c #5C5754", -" %. c #625959", -".%. c #9F8A75", -"+%. c #AA9072", -"@%. c #AD9377", -"#%. c #9B8C79", -"$%. c #615B56", -"%%. c #7A6451", -"&%. c #8D7360", -"*%. c #6D5D49", -"=%. c #645D4A", -"-%. c #60574B", -";%. c #645E59", -">%. c #51514C", -",%. c #40424A", -"'%. c #404048", -")%. c #3D3E44", -"!%. c #393A3E", -"~%. c #37383D", -"{%. c #343836", -"]%. c #3E4241", -"^%. c #424642", -"/%. c #464A43", -"(%. c #50534C", -"_%. c #454841", -":%. c #40413C", -"<%. c #383836", -"[%. c #302E32", -"}%. c #292A2B", -"|%. c #323734", -"1%. c #2D332F", -"2%. c #2B302D", -"3%. c #282E28", -"4%. c #2B302B", -"5%. c #232825", -"6%. c #1D221F", -"7%. c #0B0A0E", -"8%. c #070A0D", -"9%. c #01040C", -"0%. c #00030E", -"a%. c #00020F", -"b%. c #000315", -"c%. c #04071F", -"d%. c #12142B", -"e%. c #292B3F", -"f%. c #3D3F51", -"g%. c #555764", -"h%. c #636670", -"i%. c #545665", -"j%. c #4A4B5E", -"k%. c #58596B", -"l%. c #545566", -"m%. c #575A6A", -"n%. c #616573", -"o%. c #6E727E", -"p%. c #757784", -"q%. c #80818E", -"r%. c #656678", -"s%. c #474963", -"t%. c #3C3D57", -"u%. c #494B65", -"v%. c #333753", -"w%. c #212646", -"x%. c #212547", -"y%. c #25284B", -"z%. c #232649", -"A%. c #1C2042", -"B%. c #181C3F", -"C%. c #161A3D", -"D%. c #868798", -"E%. c #9FA1A9", -"F%. c #9FA2AA", -"G%. c #9FA2A9", -"H%. c #9B9EA6", -"I%. c #787B8F", -"J%. c #4A4D67", -"K%. c #656780", -"L%. c #4A4C68", -"M%. c #343656", -"N%. c #424565", -"O%. c #3D4062", -"P%. c #44476A", -"Q%. c #2C3052", -"R%. c #383D5A", -"S%. c #424962", -"T%. c #4A4F68", -"U%. c #454A65", -"V%. c #525359", -"W%. c #636554", -"X%. c #5F6450", -"Y%. c #656A5D", -"Z%. c #606471", -"`%. c #3C415C", -" &. c #272D4C", -".&. c #343758", -"+&. c #303354", -"@&. c #1D2345", -"#&. c #111639", -"$&. c #171A3E", -"%&. c #2E3252", -"&&. c #4E506C", -"*&. c #59575D", -"=&. c #595453", -"-&. c #4A484E", -";&. c #564D53", -">&. c #4E4756", -",&. c #2D2E4B", -"'&. c #4C4C67", -")&. c #747687", -"!&. c #787A87", -"~&. c #787689", -"{&. c #716F7D", -"]&. c #8E8D90", -"^&. c #AEACB0", -"/&. c #ACA7AD", -"(&. c #ADA49E", -"_&. c #BAB1A7", -":&. c #BBB4A9", -"<&. c #BDB7AC", -"[&. c #9E968A", -"}&. c #958775", -"|&. c #978C77", -"1&. c #9E9D88", -"2&. c #A8A996", -"3&. c #A09D8B", -"4&. c #989280", -"5&. c #8D8B70", -"6&. c #847E64", -"7&. c #7F795E", -"8&. c #737155", -"9&. c #726F57", -"0&. c #8A8874", -"a&. c #C6C3B5", -"b&. c #DCD3CC", -"c&. c #D4CBC2", -"d&. c #AAA390", -"e&. c #666A51", -"f&. c #727760", -"g&. c #DFDED6", -"h&. c #F8F6F0", -"i&. c #F2EFE9", -"j&. c #BFB7A9", -"k&. c #81725F", -"l&. c #755D43", -"m&. c #816140", -"n&. c #956E45", -"o&. c #88582E", -"p&. c #8B612F", -"q&. c #746253", -"r&. c #474858", -"s&. c #474C5C", -"t&. c #9C8D86", -"u&. c #B39681", -"v&. c #AC907A", -"w&. c #B0967E", -"x&. c #A08F82", -"y&. c #797066", -"z&. c #6F614D", -"A&. c #725845", -"B&. c #886C5B", -"C&. c #725E49", -"D&. c #6A6249", -"E&. c #635A48", -"F&. c #676059", -"G&. c #53524D", -"H&. c #3E3D3C", -"I&. c #3C3E43", -"J&. c #36383E", -"K&. c #36373E", -"L&. c #313138", -"M&. c #16161A", -"N&. c #232625", -"O&. c #252926", -"P&. c #3E4240", -"Q&. c #414542", -"R&. c #41443F", -"S&. c #474B44", -"T&. c #454842", -"U&. c #40433E", -"V&. c #41433D", -"W&. c #3B3C3A", -"X&. c #302F33", -"Y&. c #2E2B30", -"Z&. c #201C22", -"`&. c #211D23", -" *. c #2F2930", -".*. c #1C1F20", -"+*. c #232827", -"@*. c #222826", -"#*. c #202624", -"$*. c #1D2220", -"%*. c #07080C", -"&*. c #00020A", -"**. c #00020D", -"=*. c #000310", -"-*. c #0E1128", -";*. c #1E2236", -">*. c #35374A", -",*. c #434454", -"'*. c #575965", -")*. c #626470", -"!*. c #5B5D69", -"~*. c #5A5C6A", -"{*. c #646673", -"]*. c #616370", -"^*. c #656976", -"/*. c #686B78", -"(*. c #626572", -"_*. c #646575", -":*. c #6A6C7B", -"<*. c #6B6D7B", -"[*. c #6C6D7D", -"}*. c #58596E", -"|*. c #54586C", -"1*. c #474B61", -"2*. c #2E314F", -"3*. c #292C4B", -"4*. c #282B4A", -"5*. c #252849", -"6*. c #232647", -"7*. c #202344", -"8*. c #1B1F41", -"9*. c #181D3F", -"0*. c #2F3352", -"a*. c #696B7D", -"b*. c #9C9DA7", -"c*. c #9C9FA8", -"d*. c #9A9DA4", -"e*. c #8E919C", -"f*. c #3D3E5C", -"g*. c #555871", -"h*. c #666A82", -"i*. c #414460", -"j*. c #3B3F5D", -"k*. c #464B68", -"l*. c #696C85", -"m*. c #2E3254", -"n*. c #2C3151", -"o*. c #2B3051", -"p*. c #2A2F50", -"q*. c #2B304F", -"r*. c #4D535F", -"s*. c #6B6E75", -"t*. c #4C5067", -"u*. c #575662", -"v*. c #68655F", -"w*. c #626250", -"x*. c #737461", -"y*. c #717473", -"z*. c #3B425E", -"A*. c #2D3253", -"B*. c #2A2D4E", -"C*. c #1F2243", -"D*. c #1E2241", -"E*. c #191E3D", -"F*. c #0E1234", -"G*. c #242A4A", -"H*. c #2F344E", -"I*. c #464150", -"J*. c #453E3E", -"K*. c #44444B", -"L*. c #4B4B57", -"M*. c #454456", -"N*. c #404159", -"O*. c #757486", -"P*. c #9B9CA5", -"Q*. c #9595A1", -"R*. c #8F8E95", -"S*. c #84837A", -"T*. c #82806F", -"U*. c #A5A299", -"V*. c #BBB6B1", -"W*. c #C1BAB3", -"X*. c #C4BDB4", -"Y*. c #C3BEB4", -"Z*. c #A7A194", -"`*. c #9B9282", -" =. c #A89E8D", -".=. c #A79F8E", -"+=. c #ABA593", -"@=. c #9F9A88", -"#=. c #857E69", -"$=. c #857D65", -"%=. c #7D7359", -"&=. c #7C7154", -"*=. c #747257", -"==. c #79785F", -"-=. c #A5A391", -";=. c #D5D1C5", -">=. c #DBD1C9", -",=. c #D1C5BA", -"'=. c #9D9081", -")=. c #635F48", -"!=. c #64654B", -"~=. c #999C8A", -"{=. c #D7D9CC", -"]=. c #F0EDE5", -"^=. c #B7ADA0", -"/=. c #7F7665", -"(=. c #74644A", -"_=. c #897250", -":=. c #946F4B", -"<=. c #855D35", -"[=. c #89653D", -"}=. c #645858", -"|=. c #3F455D", -"1=. c #495162", -"2=. c #9B9296", -"3=. c #BFA899", -"4=. c #B4977F", -"5=. c #B1967F", -"6=. c #B19A88", -"7=. c #857762", -"8=. c #696047", -"9=. c #74634C", -"0=. c #8A6E5A", -"a=. c #7F6750", -"b=. c #60553C", -"c=. c #615942", -"d=. c #655B51", -"e=. c #58534F", -"f=. c #383631", -"g=. c #221F1E", -"h=. c #1F2324", -"i=. c #2C3030", -"j=. c #323633", -"k=. c #3F4440", -"l=. c #3F423F", -"m=. c #2E282F", -"n=. c #100E13", -"o=. c #090708", -"p=. c #181E1F", -"q=. c #1E221F", -"r=. c #0E0E12", -"s=. c #04060C", -"t=. c #00020C", -"u=. c #00020E", -"v=. c #020517", -"w=. c #0B0D24", -"x=. c #171930", -"y=. c #272B3F", -"z=. c #3D3F52", -"A=. c #49495A", -"B=. c #545562", -"C=. c #60626E", -"D=. c #676974", -"E=. c #6A6D78", -"F=. c #6B6D7A", -"G=. c #656677", -"H=. c #585B6B", -"I=. c #535665", -"J=. c #525564", -"K=. c #4D5063", -"L=. c #414258", -"M=. c #6B6C7E", -"N=. c #6B6C7D", -"O=. c #696B7A", -"P=. c #6F727E", -"Q=. c #56576C", -"R=. c #30324F", -"S=. c #272A49", -"T=. c #272A4A", -"U=. c #282B4C", -"V=. c #1C1F41", -"W=. c #202445", -"X=. c #2A2E4C", -"Y=. c #575A70", -"Z=. c #90939D", -"`=. c #9D9EA5", -" -. c #94969F", -".-. c #9799A4", -"+-. c #6C6D81", -"@-. c #3B3C59", -"#-. c #424361", -"$-. c #5F6279", -"%-. c #585C75", -"&-. c #363A56", -"*-. c #454866", -"=-. c #4A4C69", -"--. c #777A90", -";-. c #777A8F", -">-. c #2C3251", -",-. c #2D3150", -"'-. c #2B2E51", -")-. c #3C4054", -"!-. c #585D58", -"~-. c #7C7566", -"{-. c #797870", -"]-. c #575B69", -"^-. c #4B4C63", -"/-. c #4D4B5C", -"(-. c #5C5C57", -"_-. c #747267", -":-. c #77716A", -"<-. c #535260", -"[-. c #3C3E59", -"}-. c #323555", -"|-. c #1A1D3E", -"1-. c #222745", -"2-. c #1D2240", -"3-. c #0B0F30", -"4-. c #101436", -"5-. c #232944", -"6-. c #3B3B4A", -"7-. c #49453E", -"8-. c #5C595A", -"9-. c #5C5E6C", -"0-. c #5A5A67", -"a-. c #7B7779", -"b-. c #999395", -"c-. c #969199", -"d-. c #A7A79C", -"e-. c #7D7E6B", -"f-. c #74745F", -"g-. c #8E8D7C", -"h-. c #B1ADA1", -"i-. c #C0B9B0", -"j-. c #B1AB9F", -"k-. c #A6A196", -"l-. c #A2A095", -"m-. c #99998A", -"n-. c #969784", -"o-. c #A29F8C", -"p-. c #A8A18F", -"q-. c #A39A89", -"r-. c #9D9887", -"s-. c #8A846F", -"t-. c #837B63", -"u-. c #7F755B", -"v-. c #786D50", -"w-. c #737055", -"x-. c #747159", -"y-. c #A8A392", -"z-. c #D6D1C5", -"A-. c #D7CEC5", -"B-. c #D0C6BB", -"C-. c #A79C8C", -"D-. c #6F6753", -"E-. c #6C6851", -"F-. c #A8A697", -"G-. c #E0DBD3", -"H-. c #F2EBE6", -"I-. c #E4DBD0", -"J-. c #978B78", -"K-. c #766F5B", -"L-. c #6E654A", -"M-. c #918660", -"N-. c #947B56", -"O-. c #896B49", -"P-. c #7D654A", -"Q-. c #5B5664", -"R-. c #555E6B", -"S-. c #99968D", -"T-. c #B7A490", -"U-. c #AC9179", -"V-. c #AC907B", -"W-. c #B8A08E", -"X-. c #6F654C", -"Y-. c #79755A", -"Z-. c #8B7860", -"`-. c #89725A", -" ;. c #65563E", -".;. c #61543B", -"+;. c #655646", -"@;. c #5E5550", -"#;. c #3C3633", -"$;. c #2B2625", -"%;. c #1E1B1D", -"&;. c #2E3231", -"*;. c #333636", -"=;. c #343537", -"-;. c #2C2B2F", -";;. c #14181B", -">;. c #181C1E", -",;. c #0D0D12", -"';. c #02040C", -");. c #00010D", -"!;. c #010319", -"~;. c #0E1026", -"{;. c #17192F", -"];. c #262B3F", -"^;. c #393B4D", -"/;. c #434353", -"(;. c #585A66", -"_;. c #636571", -":;. c #686B76", -"<;. c #696C75", -"[;. c #46475B", -"};. c #424455", -"|;. c #535565", -"1;. c #5F6171", -"2;. c #5B5F6F", -"3;. c #3B3F54", -"4;. c #2B2E49", -"5;. c #3D3E55", -"6;. c #6D6E7C", -"7;. c #42415D", -"8;. c #2A2B4B", -"9;. c #2C2F4D", -"0;. c #2F3250", -"a;. c #1E2042", -"b;. c #2B2D4C", -"c;. c #4D4F66", -"d;. c #7A7D8E", -"e;. c #9396A1", -"f;. c #8B8C98", -"g;. c #6F7084", -"h;. c #4B4C66", -"i;. c #4A4E67", -"j;. c #3A3E5A", -"k;. c #484A68", -"l;. c #52526D", -"m;. c #6C6E82", -"n;. c #313555", -"o;. c #2D3152", -"p;. c #303150", -"q;. c #292A4C", -"r;. c #2E314A", -"s;. c #494F4F", -"t;. c #696A5A", -"u;. c #8C7968", -"v;. c #77706D", -"w;. c #41455F", -"x;. c #373857", -"y;. c #514F5F", -"z;. c #706B64", -"A;. c #756C5B", -"B;. c #6D6053", -"C;. c #4E4E5C", -"D;. c #2A2F4D", -"E;. c #2B2E4E", -"F;. c #2E3251", -"G;. c #262B4A", -"H;. c #15173A", -"I;. c #333650", -"J;. c #434650", -"K;. c #434A37", -"L;. c #5D604E", -"M;. c #67685F", -"N;. c #727069", -"O;. c #877F75", -"P;. c #90867F", -"Q;. c #918B8A", -"R;. c #989892", -"S;. c #A8A89F", -"T;. c #95958C", -"U;. c #848476", -"V;. c #919183", -"W;. c #AFA99F", -"X;. c #A39E91", -"Y;. c #9A978B", -"Z;. c #9A9B8F", -"`;. c #848978", -" >. c #949B85", -".>. c #969A85", -"+>. c #999E88", -"@>. c #888E78", -"#>. c #878B76", -"$>. c #7E8168", -"%>. c #7B7B60", -"&>. c #827A5F", -"*>. c #918669", -"=>. c #878367", -"->. c #746F57", -";>. c #A7A190", -">>. c #D6CFC5", -",>. c #DCD5CC", -"'>. c #CEC7BB", -")>. c #B1A898", -"!>. c #8E8170", -"~>. c #706552", -"{>. c #A49C8E", -"]>. c #D8CDC8", -"^>. c #DACDC7", -"/>. c #BFB2A3", -"(>. c #776850", -"_>. c #6E6850", -":>. c #716D51", -"<>. c #93896C", -"[>. c #A08A6C", -"}>. c #907652", -"|>. c #7C6B53", -"1>. c #575968", -"2>. c #434A66", -"3>. c #5A606E", -"4>. c #877E70", -"5>. c #A38B6C", -"6>. c #A4896E", -"7>. c #A78B76", -"8>. c #A88F7C", -"9>. c #A68F7C", -"0>. c #7A6752", -"a>. c #756850", -"b>. c #88765D", -"c>. c #877058", -"d>. c #705E47", -"e>. c #67563C", -"f>. c #61513B", -"g>. c #61554E", -"h>. c #453C3A", -"i>. c #302928", -"j>. c #211D1F", -"k>. c #222728", -"l>. c #1C181B", -"m>. c #16151A", -"n>. c #100F14", -"o>. c #0A0B12", -"p>. c #01030D", -"q>. c #00010F", -"r>. c #000212", -"s>. c #03051A", -"t>. c #090B20", -"u>. c #111328", -"v>. c #1A1D32", -"w>. c #262A3D", -"x>. c #373949", -"y>. c #494A57", -"z>. c #5C5E68", -"A>. c #646770", -"B>. c #656872", -"C>. c #545765", -"D>. c #3B3D4F", -"E>. c #585968", -"F>. c #686A76", -"G>. c #575A6C", -"H>. c #32354C", -"I>. c #272945", -"J>. c #2E3149", -"K>. c #505265", -"L>. c #636473", -"M>. c #5B5D6D", -"N>. c #44465D", -"O>. c #2B2B4B", -"P>. c #272848", -"Q>. c #2F314F", -"R>. c #2C2D4B", -"S>. c #1E2041", -"T>. c #16193B", -"U>. c #1B1E3D", -"V>. c #2A2E4B", -"W>. c #3F445D", -"X>. c #6D7082", -"Y>. c #898C98", -"Z>. c #9395A0", -"`>. c #8E909D", -" ,. c #888A95", -".,. c #77798A", -"+,. c #52546D", -"@,. c #434761", -"#,. c #383B5A", -"$,. c #474B67", -"%,. c #4C506C", -"&,. c #3B3E5C", -"*,. c #3E425E", -"=,. c #464A64", -"-,. c #5A5C71", -";,. c #76798B", -">,. c #50526B", -",,. c #383B59", -"',. c #2C2F50", -"),. c #2D3051", -"!,. c #2E3151", -"~,. c #2E3152", -"{,. c #242748", -"],. c #2A2F46", -"^,. c #414A4B", -"/,. c #766E61", -"(,. c #8C7A68", -"_,. c #746D6B", -":,. c #40425C", -"<,. c #424760", -"[,. c #373A59", -"},. c #4F5062", -"|,. c #666558", -"1,. c #625A48", -"2,. c #5F543F", -"3,. c #5F5A59", -"4,. c #41445B", -"5,. c #3A3F5B", -"6,. c #3B405C", -"7,. c #323655", -"8,. c #252949", -"9,. c #393852", -"0,. c #454156", -"a,. c #5C575D", -"b,. c #5E5E56", -"c,. c #475341", -"d,. c #505C44", -"e,. c #646854", -"f,. c #6D6C61", -"g,. c #747068", -"h,. c #8D877D", -"i,. c #9A978F", -"j,. c #9FA098", -"k,. c #ABACA5", -"l,. c #A6A19B", -"m,. c #A8A29A", -"n,. c #ABA99E", -"o,. c #ADAAA0", -"p,. c #A2A496", -"q,. c #A0A496", -"r,. c #999E91", -"s,. c #868E78", -"t,. c #868E74", -"u,. c #939983", -"v,. c #9DA08A", -"w,. c #8F907A", -"x,. c #8D927B", -"y,. c #8E9277", -"z,. c #85866A", -"A,. c #918E73", -"B,. c #988B73", -"C,. c #80795D", -"D,. c #77745C", -"E,. c #B6B3A5", -"F,. c #DCDAD4", -"G,. c #E8E6E1", -"H,. c #CBC8BD", -"I,. c #979483", -"J,. c #7E7061", -"K,. c #674E3D", -"L,. c #9A8A79", -"M,. c #C0ADA2", -"N,. c #A78E82", -"O,. c #907D6D", -"P,. c #715943", -"Q,. c #6A6144", -"R,. c #726F50", -"S,. c #8F8669", -"T,. c #A3937B", -"U,. c #9A8467", -"V,. c #8B765F", -"W,. c #5D5A6D", -"X,. c #464D69", -"Y,. c #585D6F", -"Z,. c #7A7066", -"`,. c #8B7350", -" '. c #957F5B", -".'. c #A0836B", -"+'. c #977B65", -"@'. c #967E69", -"#'. c #7E6957", -"$'. c #796550", -"%'. c #837056", -"&'. c #80694E", -"*'. c #766149", -"='. c #685742", -"-'. c #56482F", -";'. c #5F5447", -">'. c #4C423E", -",'. c #36312B", -"''. c #232120", -")'. c #232422", -"!'. c #1F2325", -"~'. c #09070C", -"{'. c #090808", -"]'. c #141318", -"^'. c #08080F", -"/'. c #00010E", -"('. c #06081D", -"_'. c #0C0F24", -":'. c #3E4050", -"<'. c #51525E", -"['. c #5B5E67", -"}'. c #61646D", -"|'. c #3F4252", -"1'. c #3C3F4F", -"2'. c #4F5262", -"3'. c #636774", -"4'. c #535664", -"5'. c #46485A", -"6'. c #414457", -"7'. c #2D2F46", -"8'. c #2A2D47", -"9'. c #3C3E54", -"0'. c #44465B", -"a'. c #252742", -"b'. c #20213F", -"c'. c #222342", -"d'. c #191A39", -"e'. c #121535", -"f'. c #151837", -"g'. c #272B48", -"h'. c #3F435C", -"i'. c #53566A", -"j'. c #7C7D8C", -"k'. c #91939D", -"l'. c #91949E", -"m'. c #828492", -"n'. c #61647A", -"o'. c #373A57", -"p'. c #2B304C", -"q'. c #393D59", -"r'. c #353857", -"s'. c #424662", -"t'. c #5E6176", -"u'. c #707385", -"v'. c #313453", -"w'. c #292C4D", -"x'. c #292C4E", -"y'. c #1D2041", -"z'. c #2C3249", -"A'. c #44504E", -"B'. c #787265", -"C'. c #676760", -"D'. c #3C4157", -"E'. c #4E5268", -"F'. c #545B62", -"G'. c #5A625A", -"H'. c #5D6551", -"I'. c #5E624C", -"J'. c #625B46", -"K'. c #6F6658", -"L'. c #555562", -"M'. c #40435A", -"N'. c #3F425C", -"O'. c #414358", -"P'. c #615A5B", -"Q'. c #6B625A", -"R'. c #68685D", -"S'. c #646B5C", -"T'. c #5C6856", -"U'. c #566048", -"V'. c #636552", -"W'. c #6E6B5F", -"X'. c #6D695D", -"Y'. c #938D7F", -"Z'. c #989182", -"`'. c #857E71", -" ). c #9A988E", -".). c #A7A79F", -"+). c #ABA89F", -"@). c #ACA49B", -"#). c #B1A79C", -"$). c #AEA89A", -"%). c #A8A699", -"&). c #9FA193", -"*). c #8A8F7C", -"=). c #838871", -"-). c #7F846C", -";). c #91927B", -">). c #88876F", -",). c #84886E", -"'). c #888A72", -")). c #8E8D77", -"!). c #A29F8E", -"~). c #958879", -"{). c #8A8371", -"]). c #AFAD9E", -"^). c #DEDDD4", -"/). c #EDEDE8", -"(). c #E7E9E3", -"_). c #BCBDB1", -":). c #7B7C6A", -"<). c #716858", -"[). c #7B6553", -"}). c #938572", -"|). c #A68E7D", -"1). c #87675C", -"2). c #6C553F", -"3). c #6F5338", -"4). c #746142", -"5). c #726B48", -"6). c #7F7956", -"7). c #A4967C", -"8). c #A59177", -"9). c #947F64", -"0). c #6A6166", -"a). c #484D69", -"b). c #4E5062", -"c). c #71665E", -"d). c #786753", -"e). c #81694D", -"f). c #988470", -"g). c #98826C", -"h). c #7F6A58", -"i). c #7F6B56", -"j). c #7B684E", -"k). c #796247", -"l). c #63533F", -"m). c #51432D", -"n). c #574D3C", -"o). c #4C433C", -"p). c #3C352E", -"q). c #272422", -"r). c #232423", -"s). c #222423", -"t). c #121211", -"u). c #282428", -"v). c #05050C", -"w). c #00020B", -"x). c #010316", -"y). c #010317", -"z). c #05081C", -"A). c #1D2034", -"B). c #3B3D4D", -"C). c #52545F", -"D). c #5A5C65", -"E). c #595C66", -"F). c #4F5161", -"G). c #565966", -"H). c #5D616C", -"I). c #4A4F5D", -"J). c #2A2E40", -"K). c #292C44", -"L). c #2A2C43", -"M). c #262843", -"N). c #292C47", -"O). c #393B52", -"P). c #3F4054", -"Q). c #262742", -"R). c #161735", -"S). c #191A38", -"T). c #1A1A3A", -"U). c #161637", -"V). c #121233", -"W). c #111332", -"X). c #1B1F3C", -"Y). c #2F334F", -"Z). c #4E5168", -"`). c #8B8B96", -" !. c #91929C", -".!. c #838590", -"+!. c #797B89", -"@!. c #6F7283", -"#!. c #42455F", -"$!. c #232746", -"%!. c #323553", -"&!. c #3D405D", -"*!. c #323552", -"=!. c #3D405E", -"-!. c #52556F", -";!. c #5F6277", -">!. c #66697B", -",!. c #43465F", -"'!. c #282B4B", -")!. c #292C4C", -"!!. c #252847", -"~!. c #282C43", -"{!. c #374041", -"]!. c #4D5546", -"^!. c #6A675D", -"/!. c #6D6764", -"(!. c #545762", -"_!. c #515366", -":!. c #61635F", -"~. c #1A1718", -",~. c #0C0A0E", -"'~. c #131212", -")~. c #221E20", -"!~. c #252027", -"~~. c #262527", -"{~. c #17181D", -"]~. c #1A1720", -"^~. c #221E1B", -"/~. c #221915", -"(~. c #03040B", -"_~. c #030519", -":~. c #04071B", -"<~. c #04061A", -"[~. c #0F1225", -"}~. c #1E2034", -"|~. c #3F4250", -"1~. c #50545E", -"2~. c #494B57", -"3~. c #4E505B", -"4~. c #595B65", -"5~. c #60626D", -"6~. c #515260", -"7~. c #24263D", -"8~. c #2A2C42", -"9~. c #27293E", -"0~. c #2B2D45", -"a~. c #272943", -"b~. c #22243D", -"c~. c #25273F", -"d~. c #1E1F38", -"e~. c #171835", -"f~. c #111230", -"g~. c #121331", -"h~. c #141531", -"i~. c #121333", -"j~. c #131432", -"k~. c #21243E", -"l~. c #353852", -"m~. c #363952", -"n~. c #585A6C", -"o~. c #7C7E89", -"p~. c #8B8D95", -"q~. c #767885", -"r~. c #656779", -"s~. c #5D5E73", -"t~. c #43455E", -"u~. c #242746", -"v~. c #343553", -"w~. c #333453", -"x~. c #373856", -"y~. c #4A4C66", -"z~. c #54566E", -"A~. c #525569", -"B~. c #626477", -"C~. c #6A6C81", -"D~. c #51536A", -"E~. c #41435D", -"F~. c #2C2D4C", -"G~. c #2C2D4E", -"H~. c #303352", -"I~. c #2C2F4F", -"J~. c #2E3346", -"K~. c #3A433A", -"L~. c #3D433D", -"M~. c #3B3B4F", -"N~. c #37374F", -"O~. c #353754", -"P~. c #4E4F5E", -"Q~. c #65675F", -"R~. c #616453", -"S~. c #595A4E", -"T~. c #5C5D4E", -"U~. c #626152", -"V~. c #524E40", -"W~. c #4D4435", -"X~. c #404044", -"Y~. c #1B2039", -"Z~. c #1D233C", -"`~. c #454D4C", -" {. c #5B5F4E", -".{. c #626A57", -"+{. c #60695B", -"@{. c #5D6354", -"#{. c #535B46", -"${. c #55604A", -"%{. c #777C68", -"&{. c #7E7E6C", -"*{. c #646956", -"={. c #585242", -"-{. c #5D5A4A", -";{. c #726F60", -">{. c #8D8C7F", -",{. c #9E9D92", -"'{. c #A09B90", -"){. c #9B9385", -"!{. c #9A9786", -"~{. c #A3A194", -"{{. c #999586", -"]{. c #606750", -"^{. c #6D715D", -"/{. c #6D6A54", -"({. c #6A6751", -"_{. c #6A6C54", -":{. c #798067", -"<{. c #939882", -"[{. c #A6A695", -"}{. c #B2AF9F", -"|{. c #B1AB9B", -"1{. c #B0AB9F", -"2{. c #D3CFC6", -"3{. c #E4E3DE", -"4{. c #EAE9E4", -"5{. c #E6E5DF", -"6{. c #C1BBB2", -"7{. c #978D82", -"8{. c #827165", -"9{. c #7C5E4D", -"0{. c #5D5448", -"a{. c #5D585F", -"b{. c #6A6667", -"c{. c #806146", -"d{. c #7D5632", -"e{. c #7A5937", -"f{. c #6E603C", -"g{. c #686742", -"h{. c #6F6D4A", -"i{. c #827354", -"j{. c #8C7859", -"k{. c #8B745D", -"l{. c #807778", -"m{. c #54596F", -"n{. c #484E6C", -"o{. c #40455F", -"p{. c #595968", -"q{. c #56546B", -"r{. c #665A57", -"s{. c #776246", -"t{. c #755F4C", -"u{. c #755E4B", -"v{. c #674F3D", -"w{. c #604B38", -"x{. c #52432F", -"y{. c #4B422F", -"z{. c #47402E", -"A{. c #443D30", -"B{. c #42362E", -"C{. c #372D25", -"D{. c #201D1C", -"E{. c #232127", -"F{. c #231A1C", -"G{. c #372D1E", -"H{. c #795622", -"I{. c #B07D22", -"J{. c #3C2C16", -"K{. c #01020D", -"L{. c #010414", -"M{. c #0A0D1F", -"N{. c #16192B", -"O{. c #05081B", -"P{. c #010217", -"Q{. c #06091D", -"R{. c #1D2032", -"S{. c #282B3B", -"T{. c #1F2235", -"U{. c #383B4B", -"V{. c #343746", -"W{. c #313343", -"X{. c #36394A", -"Y{. c #494B5A", -"Z{. c #424556", -"`{. c #2D2F42", -" ]. c #1F2138", -".]. c #2C2E43", -"+]. c #2E3044", -"@]. c #292B40", -"#]. c #21233A", -"$]. c #191B34", -"%]. c #171932", -"&]. c #151633", -"*]. c #0E0F2D", -"=]. c #121232", -"-]. c #25263F", -";]. c #555767", -">]. c #616473", -",]. c #5B5D6C", -"']. c #6B6E7C", -")]. c #67697A", -"!]. c #45485D", -"~]. c #44475F", -"{]. c #1B1E3B", -"]]. c #1C1F3E", -"^]. c #232645", -"/]. c #2A2C4B", -"(]. c #363754", -"_]. c #3C3D58", -":]. c #44465E", -"<]. c #4B4D64", -"[]. c #4F5266", -"}]. c #585B6D", -"|]. c #717485", -"1]. c #6C6F82", -"2]. c #5A5D72", -"3]. c #4C4E65", -"4]. c #333551", -"5]. c #262948", -"6]. c #262A48", -"7]. c #1E223C", -"8]. c #212737", -"9]. c #171A36", -"0]. c #0E1034", -"a]. c #0C0F2F", -"b]. c #0F1333", -"c]. c #1D203C", -"d]. c #383B47", -"e]. c #4D4D48", -"f]. c #515448", -"g]. c #454B45", -"h]. c #5F6052", -"i]. c #656253", -"j]. c #4E493A", -"k]. c #514B40", -"l]. c #333443", -"m]. c #191C3C", -"n]. c #373951", -"o]. c #545953", -"p]. c #5C604C", -"q]. c #595F4A", -"r]. c #535748", -"s]. c #5C5E4E", -"t]. c #4F543F", -"u]. c #4A533E", -"v]. c #606451", -"w]. c #666855", -"x]. c #4B5640", -"y]. c #565443", -"z]. c #636453", -"A]. c #7C7C6D", -"B]. c #8C8E80", -"C]. c #7A7C70", -"D]. c #86857B", -"E]. c #9C9A8E", -"F]. c #9A948A", -"G]. c #8E8A7E", -"H]. c #7D7C68", -"I]. c #807C66", -"J]. c #6F725F", -"K]. c #656555", -"L]. c #766E5C", -"M]. c #7E7967", -"N]. c #868371", -"O]. c #81816E", -"P]. c #959785", -"Q]. c #A6A496", -"R]. c #B4AFA3", -"S]. c #BEB9AD", -"T]. c #CCC8C0", -"U]. c #DBD8D3", -"V]. c #E2DFDA", -"W]. c #E7E4DF", -"X]. c #E1DED8", -"Y]. c #C0B5A8", -"Z]. c #B7A79D", -"`]. c #A6938C", -" ^. c #7B695D", -".^. c #81614A", -"+^. c #64574E", -"@^. c #505264", -"#^. c #595D6E", -"$^. c #74675A", -"%^. c #785638", -"&^. c #745033", -"*^. c #6C583A", -"=^. c #686240", -"-^. c #716F4B", -";^. c #837758", -">^. c #998466", -",^. c #8D7759", -"'^. c #867A61", -")^. c #6D6E70", -"!^. c #52546C", -"~^. c #494A68", -"{^. c #444663", -"]^. c #434561", -"^^. c #4E4F64", -"/^. c #70665A", -"(^. c #7D6A4A", -"_^. c #89745F", -":^. c #6D5844", -"<^. c #5A4635", -"[^. c #534230", -"}^. c #4D412D", -"|^. c #48402D", -"1^. c #423B29", -"2^. c #433D2F", -"3^. c #40342A", -"4^. c #3C2F26", -"5^. c #2A2322", -"6^. c #2D2821", -"7^. c #60472C", -"8^. c #845A25", -"9^. c #D39130", -"0^. c #B6985D", -"a^. c #1D191B", -"b^. c #01020C", -"c^. c #010314", -"d^. c #0E1121", -"e^. c #222535", -"f^. c #101325", -"g^. c #0B0D22", -"h^. c #05071C", -"i^. c #07091D", -"j^. c #0D1023", -"k^. c #2A2C3D", -"l^. c #323544", -"m^. c #1E2133", -"n^. c #191C2F", -"o^. c #15172C", -"p^. c #10142A", -"q^. c #13172D", -"r^. c #181B31", -"s^. c #1C2035", -"t^. c #191D33", -"u^. c #181B33", -"v^. c #1D1F35", -"w^. c #282B3F", -"x^. c #3C3F51", -"y^. c #45485A", -"z^. c #2D3043", -"A^. c #1E2036", -"B^. c #1D1F37", -"C^. c #20223B", -"D^. c #1D1F38", -"E^. c #141532", -"F^. c #0F102E", -"G^. c #0F102F", -"H^. c #151634", -"I^. c #44465A", -"J^. c #636572", -"K^. c #5F606E", -"L^. c #6E6F7D", -"M^. c #696D7B", -"N^. c #535869", -"O^. c #383C54", -"P^. c #2B2F4B", -"Q^. c #252A47", -"R^. c #131737", -"S^. c #0D1131", -"T^. c #191C3B", -"U^. c #1F2241", -"V^. c #2B2D4B", -"W^. c #3E3F5A", -"X^. c #515368", -"Y^. c #535568", -"Z^. c #56586C", -"`^. c #626577", -" /. c #707383", -"./. c #747786", -"+/. c #5F6274", -"@/. c #5A5D70", -"#/. c #4D5066", -"$/. c #353751", -"%/. c #282947", -"&/. c #222443", -"*/. c #232544", -"=/. c #282A49", -"-/. c #151838", -";/. c #0A0D31", -">/. c #030728", -",/. c #030726", -"'/. c #050929", -")/. c #080B2E", -"!/. c #1C1F3B", -"~/. c #3E424A", -"{/. c #575C56", -"]/. c #5E6057", -"^/. c #6E6C60", -"//. c #656053", -"(/. c #524B3F", -"_/. c #504C49", -":/. c #2D3143", -"(. c #825E2B", -",(. c #95744F", -"'(. c #928D89", -")(. c #5F6C7A", -"!(. c #070716", -"~(. c #000210", -"{(. c #030619", -"](. c #0B0E21", -"^(. c #15182A", -"/(. c #16192C", -"((. c #101326", -"_(. c #090C1F", -":(. c #04061B", -"<(. c #121428", -"[(. c #181A2F", -"}(. c #090B22", -"|(. c #03051C", -"1(. c #05071E", -"2(. c #070920", -"3(. c #0A0C23", -"4(. c #0C0F26", -"5(. c #0B0D25", -"6(. c #0F1128", -"7(. c #1A1C32", -"8(. c #35384B", -"9(. c #424458", -"0(. c #292C41", -"a(. c #1E2037", -"b(. c #181A34", -"c(. c #0A0D2A", -"d(. c #22243C", -"e(. c #595B6B", -"f(. c #595A6B", -"g(. c #545664", -"h(. c #676976", -"i(. c #45475B", -"j(. c #31334B", -"k(. c #2A2C47", -"l(. c #1C1F3D", -"m(. c #0F1233", -"n(. c #05082A", -"o(. c #0D1030", -"p(. c #1A1D3C", -"q(. c #262946", -"r(. c #33344F", -"s(. c #4B4D63", -"t(. c #6D717E", -"u(. c #656879", -"v(. c #5A5D6F", -"w(. c #50536A", -"x(. c #3D415C", -"y(. c #282C49", -"z(. c #222542", -"A(. c #222341", -"B(. c #262745", -"C(. c #272847", -"D(. c #06092B", -"E(. c #050827", -"F(. c #030725", -"G(. c #080B29", -"H(. c #111133", -"I(. c #2B2E3D", -"J(. c #4D514C", -"K(. c #545653", -"L(. c #515254", -"M(. c #414049", -"N(. c #33313C", -"O(. c #2D2A35", -"P(. c #2D2637", -"Q(. c #292A41", -"R(. c #3A3F3A", -"S(. c #4D4C35", -"T(. c #44472E", -"U(. c #494B33", -"V(. c #524D39", -"W(. c #494B36", -"X(. c #505542", -"Y(. c #3F422E", -"Z(. c #51523D", -"`(. c #565441", -" _. c #484834", -"._. c #4B503F", -"+_. c #616153", -"@_. c #727063", -"#_. c #8B8D82", -"$_. c #7F8176", -"%_. c #82827A", -"&_. c #8C8A82", -"*_. c #8D8B7D", -"=_. c #7B7B6B", -"-_. c #797B6B", -";_. c #6B6957", -">_. c #65624F", -",_. c #77766A", -"'_. c #807E71", -")_. c #817D69", -"!_. c #928E7E", -"~_. c #A3A291", -"{_. c #A9A999", -"]_. c #B4B1A5", -"^_. c #C6C4BA", -"/_. c #CAC8C2", -"(_. c #D6D3D1", -"__. c #DBD6D3", -":_. c #E0D8D4", -"<_. c #E0D5CF", -"[_. c #DECDC5", -"}_. c #CEBCB5", -"|_. c #957C68", -"1_. c #6A5339", -"2_. c #6D5D4A", -"3_. c #575660", -"4_. c #4F546D", -"5_. c #57586D", -"6_. c #796E6E", -"7_. c #816D58", -"8_. c #74614C", -"9_. c #605337", -"0_. c #5F5539", -"a_. c #666541", -"b_. c #5F5C39", -"c_. c #665A3C", -"d_. c #756542", -"e_. c #8E8160", -"f_. c #988A6D", -"g_. c #958269", -"h_. c #8C7B6F", -"i_. c #706F7C", -"j_. c #4A506D", -"k_. c #414360", -"l_. c #4A4A5C", -"m_. c #5B5550", -"n_. c #715F3F", -"o_. c #755E46", -"p_. c #624F3D", -"q_. c #4A402E", -"r_. c #403927", -"s_. c #3C3321", -"t_. c #3E3A27", -"u_. c #3A3C28", -"v_. c #493F30", -"w_. c #453528", -"x_. c #423227", -"y_. c #423824", -"z_. c #2E271D", -"A_. c #211E25", -"B_. c #2B221A", -"C_. c #614A2D", -"D_. c #917F6B", -"E_. c #CACCCD", -"F_. c #B4B0B1", -"G_. c #03030F", -"H_. c #01030C", -"I_. c #080B1E", -"J_. c #0C0F22", -"K_. c #1B1E31", -"L_. c #0B0E22", -"M_. c #02041B", -"N_. c #0C0E25", -"O_. c #1F2137", -"P_. c #2C2E44", -"Q_. c #191B32", -"R_. c #14152F", -"S_. c #10122C", -"T_. c #151730", -"U_. c #10112D", -"V_. c #080927", -"W_. c #040523", -"X_. c #0A0D29", -"Y_. c #3B3E53", -"Z_. c #656775", -"`_. c #646672", -" :. c #5A5C6B", -".:. c #272843", -"+:. c #1F203D", -"@:. c #101232", -"#:. c #050829", -"$:. c #040627", -"%:. c #171A39", -"&:. c #191C3A", -"*:. c #21223F", -"=:. c #292B45", -"-:. c #3C3E58", -";:. c #54566D", -">:. c #5B5E6F", -",:. c #4B4E63", -"':. c #4B4D62", -"):. c #3B3D56", -"!:. c #2B2F4C", -"~:. c #222643", -"{:. c #232744", -"]:. c #242644", -"^:. c #171A38", -"/:. c #101432", -"(:. c #0C0F2E", -"_:. c #070A29", -"::. c #030625", -"<:. c #111231", -"[:. c #21223C", -"}:. c #272C36", -"|:. c #262D36", -"1:. c #1B2032", -"2:. c #161A36", -"3:. c #0C0F2C", -"4:. c #090C28", -"5:. c #090D29", -"6:. c #090D2B", -"7:. c #242535", -"8:. c #3A3A2B", -"9:. c #46432B", -"0:. c #454A30", -"a:. c #474B32", -"b:. c #40422A", -"c:. c #2B361D", -"d:. c #313C25", -"e:. c #2F341E", -"f:. c #353823", -"g:. c #43432F", -"h:. c #494A36", -"i:. c #636B5A", -"j:. c #777D70", -"k:. c #86887C", -"l:. c #90918A", -"m:. c #888A82", -"n:. c #84847B", -"o:. c #7E7B6F", -"p:. c #848273", -"q:. c #7F7F70", -"r:. c #888A7D", -"s:. c #838074", -"t:. c #5D574A", -"u:. c #646050", -"v:. c #757362", -"w:. c #888878", -"x:. c #9F9E92", -"y:. c #B7B5AA", -"z:. c #C8C6BA", -"A:. c #C4C2B4", -"B:. c #C7C4B6", -"C:. c #C9C2B8", -"D:. c #D0CFC7", -"E:. c #D4D7D1", -"F:. c #D8D4D0", -"G:. c #E0D7D3", -"H:. c #E2D6D1", -"I:. c #CBC3C2", -"J:. c #9A929A", -"K:. c #6F6363", -"L:. c #5D554B", -"M:. c #615946", -"N:. c #5F5D52", -"O:. c #585A61", -"P:. c #5A5D6D", -"Q:. c #6D6870", -"R:. c #796B68", -"S:. c #635844", -"T:. c #544F33", -"U:. c #545834", -"V:. c #626541", -"W:. c #6D6B47", -"X:. c #746D49", -"Y:. c #77754F", -"Z:. c #75744D", -"`:. c #817554", -" <. c #A39179", -".<. c #8C8075", -"+<. c #666878", -"@<. c #404661", -"#<. c #41415A", -"$<. c #3F4058", -"%<. c #595148", -"&<. c #755F43", -"*<. c #695541", -"=<. c #4B402D", -"-<. c #3D3826", -";<. c #433E2B", -"><. c #3C3C27", -",<. c #4E4433", -"'<. c #4D3D2D", -")<. c #45392A", -"!<. c #6F5024", -"~<. c #795524", -"{<. c #524028", -"]<. c #191419", -"^<. c #242027", -"/<. c #1C1A1B", -"(<. c #332B23", -"_<. c #888077", -":<. c #CACDD0", -"<<. c #B8AB83", -"[<. c #C09737", -"}<. c #3C2F18", -"|<. c #02030E", -"1<. c #00030F", -"2<. c #000311", -"3<. c #06091C", -"4<. c #0A0D20", -"5<. c #0E1124", -"6<. c #1D2033", -"7<. c #05071B", -"8<. c #000217", -"9<. c #101327", -"0<. c #0D0F23", -"a<. c #000219", -"b<. c #00021A", -"c<. c #01021D", -"d<. c #04051F", -"e<. c #11132A", -"f<. c #090B25", -"g<. c #060723", -"h<. c #14162F", -"i<. c #12142D", -"j<. c #090A27", -"k<. c #030423", -"l<. c #020321", -"m<. c #0E102A", -"n<. c #46485B", -"o<. c #656771", -"p<. c #6A6C77", -"q<. c #545568", -"r<. c #22233D", -"s<. c #0F102D", -"t<. c #0E0F2E", -"u<. c #070929", -"v<. c #020526", -"w<. c #06092A", -"x<. c #0B0E2D", -"y<. c #090C2B", -"z<. c #0A0C2B", -"A<. c #121332", -"B<. c #242542", -"C<. c #42445D", -"D<. c #55586A", -"E<. c #5E616F", -"F<. c #585A6D", -"G<. c #4E5065", -"H<. c #32344F", -"I<. c #252945", -"J<. c #222642", -"K<. c #242744", -"L<. c #272846", -"M<. c #242543", -"N<. c #202341", -"O<. c #1D213E", -"P<. c #151936", -"Q<. c #080B2A", -"R<. c #141633", -"S<. c #20213C", -"T<. c #121330", -"U<. c #1A1C38", -"V<. c #1A1C37", -"W<. c #131530", -"X<. c #11142D", -"Y<. c #090D25", -"Z<. c #090C26", -"`<. c #15192F", -" [. c #33322F", -".[. c #3F4129", -"+[. c #494A31", -"@[. c #3F462B", -"#[. c #40472C", -"$[. c #42472D", -"%[. c #444D33", -"&[. c #434932", -"*[. c #31351F", -"=[. c #222611", -"-[. c #31331E", -";[. c #545240", -">[. c #7F8277", -",[. c #828476", -"'[. c #7D7F71", -")[. c #757769", -"![. c #686859", -"~[. c #555343", -"{[. c #696759", -"][. c #6D6D5D", -"^[. c #696C58", -"/[. c #575547", -"([. c #4A4337", -"_[. c #625A47", -":[. c #9B9D93", -"<[. c #B8BAB3", -"[[. c #BFBEB8", -"}[. c #C2BFB9", -"|[. c #BEBFB3", -"1[. c #ABAC9B", -"2[. c #AAAB97", -"3[. c #BEBDAF", -"4[. c #D7D5CB", -"5[. c #D8D5CF", -"6[. c #DAD6D2", -"7[. c #DBD1CC", -"8[. c #B2B2BA", -"9[. c #6A6E86", -"0[. c #505269", -"a[. c #5A5862", -"b[. c #665D4B", -"c[. c #6A5F42", -"d[. c #5F5D5B", -"e[. c #5E5F77", -"f[. c #636277", -"g[. c #6F6E74", -"h[. c #7E7E72", -"i[. c #727B60", -"j[. c #A2AA8F", -"k[. c #7D8364", -"l[. c #A7A990", -"m[. c #939A7B", -"n[. c #6D774E", -"o[. c #797356", -"p[. c #907D64", -"q[. c #957B62", -"r[. c #7F6B6B", -"s[. c #494861", -"t[. c #414461", -"u[. c #3B415B", -"v[. c #45434D", -"w[. c #5B4A37", -"x[. c #634D39", -"y[. c #544633", -"z[. c #46422E", -"A[. c #484431", -"B[. c #48412F", -"C[. c #44412D", -"D[. c #514733", -"E[. c #50412F", -"F[. c #6F5838", -"G[. c #C88E33", -"H[. c #CB8A24", -"I[. c #614427", -"J[. c #28232A", -"K[. c #221F26", -"L[. c #231F26", -"M[. c #232027", -"N[. c #474951", -"O[. c #A09B96", -"P[. c #BA9652", -"Q[. c #CC9E2F", -"R[. c #847040", -"S[. c #00030C", -"T[. c #020518", -"U[. c #04071A", -"V[. c #101226", -"W[. c #101227", -"X[. c #080A21", -"Y[. c #02031D", -"Z[. c #02041F", -"`[. c #0C0E27", -" }. c #02061F", -".}. c #020422", -"+}. c #090A26", -"@}. c #2C2D41", -"#}. c #4D505E", -"$}. c #62646D", -"%}. c #575969", -"&}. c #3A3D52", -"*}. c #11132D", -"=}. c #050623", -"-}. c #070826", -";}. c #040624", -">}. c #040524", -",}. c #080928", -"'}. c #0D0F2F", -")}. c #060928", -"!}. c #0A0D2C", -"~}. c #0E102F", -"{}. c #10112F", -"]}. c #2A2C46", -"^}. c #505267", -"/}. c #5C5E6F", -"(}. c #5B5D6F", -"_}. c #4F5165", -":}. c #43455B", -"<}. c #3A3C55", -"[}. c #2D2F49", -"}}. c #242843", -"|}. c #212540", -"1}. c #242842", -"2}. c #252842", -"3}. c #1D1E3C", -"4}. c #21223E", -"5}. c #20233D", -"6}. c #151732", -"7}. c #12132F", -"8}. c #141631", -"9}. c #23253C", -"0}. c #262845", -"a}. c #2A2D46", -"b}. c #22263C", -"c}. c #181A36", -"d}. c #1E1D30", -"e}. c #26272E", -"f}. c #2D2D3A", -"g}. c #3F4130", -"h}. c #43482F", -"i}. c #333A1F", -"j}. c #484E34", -"k}. c #42492E", -"l}. c #62654C", -"m}. c #3E422B", -"n}. c #2D321E", -"o}. c #313520", -"p}. c #393922", -"q}. c #484430", -"r}. c #575646", -"s}. c #686659", -"t}. c #686555", -"u}. c #5B5A49", -"v}. c #545344", -"w}. c #555446", -"x}. c #5D5B4E", -"y}. c #716F60", -"z}. c #6D6D5C", -"A}. c #4C4D3D", -"B}. c #434336", -"C}. c #646257", -"D}. c #89867C", -"E}. c #9E9E93", -"F}. c #B8BAB2", -"G}. c #C0C2BE", -"H}. c #BFC0B9", -"I}. c #A9AAA0", -"J}. c #949B8B", -"K}. c #9EA190", -"L}. c #A2A391", -"M}. c #BCBCAE", -"N}. c #D2CFC4", -"O}. c #D1CBC3", -"P}. c #DBD4D1", -"Q}. c #E1D4D1", -"R}. c #C6C2BE", -"S}. c #555874", -"T}. c #4D4F6D", -"U}. c #51556C", -"V}. c #686553", -"W}. c #5C5F6A", -"X}. c #575B74", -"Y}. c #595C7C", -"Z}. c #5A5E7C", -"`}. c #5D617C", -" |. c #6C6F86", -".|. c #AFB3BA", -"+|. c #A9AFAE", -"@|. c #C6CEC2", -"#|. c #D1D9C6", -"$|. c #EFF4ED", -"%|. c #C2C8B2", -"&|. c #767C57", -"*|. c #979177", -"=|. c #92816B", -"-|. c #9C836A", -";|. c #8D6D5E", -">|. c #515063", -",|. c #3F4358", -"'|. c #403F53", -")|. c #4E4442", -"!|. c #584636", -"~|. c #5F4F3D", -"{|. c #574F3D", -"]|. c #4B4533", -"^|. c #483C2E", -"/|. c #4A3F30", -"(|. c #504732", -"_|. c #4E402B", -":|. c #493A2B", -"<|. c #5C5248", -"[|. c #BEB3A0", -"}|. c #D39F42", -"||. c #CD8C2C", -"1|. c #4B3620", -"2|. c #15141B", -"3|. c #1B1515", -"4|. c #2A2019", -"5|. c #73552F", -"6|. c #C68D2A", -"7|. c #C39430", -"8|. c #6F6656", -"9|. c #494E56", -"0|. c #070912", -"a|. c #00010A", -"b|. c #00010C", -"c|. c #02031E", -"d|. c #01031D", -"e|. c #01061E", -"f|. c #040723", -"g|. c #2B2C42", -"h|. c #565866", -"i|. c #5E606C", -"j|. c #61636E", -"k|. c #5F616C", -"l|. c #2D2F44", -"m|. c #11132E", -"n|. c #060824", -"o|. c #050625", -"p|. c #070827", -"q|. c #040726", -"r|. c #0D102F", -"s|. c #161937", -"t|. c #35374F", -"u|. c #4C4E63", -"v|. c #41445A", -"w|. c #2E2F4A", -"x|. c #262844", -"y|. c #222641", -"z|. c #242742", -"A|. c #252741", -"B|. c #232441", -"C|. c #20213D", -"D|. c #252740", -"E|. c #272942", -"F|. c #292B44", -"G|. c #292A44", -"H|. c #1E203B", -"I|. c #2B2F40", -"J|. c #202534", -"K|. c #10142B", -"L|. c #1B1D2D", -"M|. c #3D3930", -"N|. c #4B4534", -"O|. c #42412F", -"P|. c #40432E", -"Q|. c #454A32", -"R|. c #3C4127", -"S|. c #2F331A", -"T|. c #42472E", -"U|. c #465035", -"V|. c #4F563E", -"W|. c #2D351E", -"X|. c #323924", -"Y|. c #393B27", -"Z|. c #3E3B28", -"`|. c #464231", -" 1. c #4D4D3F", -".1. c #605F52", -"+1. c #615F53", -"@1. c #605F53", -"#1. c #5E5D53", -"$1. c #6C6A62", -"%1. c #7D7A71", -"&1. c #817F73", -"*1. c #7D7C6F", -"=1. c #727267", -"-1. c #7E7E76", -";1. c #9D9C95", -">1. c #B5B3AD", -",1. c #BDBDB6", -"'1. c #C0C1BB", -")1. c #C0C0BC", -"!1. c #BDBDB5", -"~1. c #9C9C90", -"{1. c #828979", -"]1. c #9C9E8D", -"^1. c #A09F8E", -"/1. c #B9B6AA", -"(1. c #C3BEB2", -"_1. c #BCB5A8", -":1. c #D6CFC8", -"<1. c #CEC6C2", -"[1. c #A29E9E", -"}1. c #626479", -"|1. c #4B4C6B", -"11. c #4E4F6C", -"21. c #595B72", -"31. c #65656C", -"41. c #5B5E72", -"51. c #595D78", -"61. c #5E627F", -"71. c #60647F", -"81. c #7B7F97", -"91. c #B9BDCA", -"01. c #A9ADB7", -"a1. c #B0B6B8", -"b1. c #E7ECE5", -"c1. c #FBFDFA", -"d1. c #E2E4D4", -"e1. c #919170", -"f1. c #ABA388", -"g1. c #A09079", -"h1. c #9C856D", -"i1. c #8E6F5C", -"j1. c #5C5661", -"k1. c #464760", -"l1. c #414559", -"m1. c #424057", -"n1. c #524848", -"o1. c #554335", -"p1. c #64543E", -"q1. c #5D523E", -"r1. c #4D4433", -"s1. c #43392A", -"t1. c #443A2C", -"u1. c #4B4230", -"v1. c #473927", -"w1. c #47372B", -"x1. c #45382B", -"y1. c #929599", -"z1. c #C4C1B9", -"A1. c #BC914A", -"B1. c #A87324", -"C1. c #322C1F", -"D1. c #221E25", -"E1. c #201E24", -"F1. c #1E1910", -"G1. c #93621D", -"H1. c #DE962A", -"I1. c #A57E43", -"J1. c #5D5B57", -"K1. c #505459", -"L1. c #3E4049", -"M1. c #050710", -"N1. c #00010B", -"O1. c #010511", -"P1. c #01021E", -"Q1. c #02041E", -"R1. c #01051E", -"S1. c #0E1129", -"T1. c #484B59", -"U1. c #555762", -"V1. c #63656F", -"W1. c #696B73", -"X1. c #4A4B59", -"Y1. c #12122C", -"Z1. c #030522", -"`1. c #030422", -" 2. c #060726", -".2. c #030524", -"+2. c #1A1C3A", -"@2. c #2C2D48", -"#2. c #414359", -"$2. c #373C54", -"%2. c #2D314B", -"&2. c #2B2D47", -"*2. c #262743", -"=2. c #232442", -"-2. c #232641", -";2. c #23253E", -">2. c #171834", -",2. c #090A28", -"'2. c #10112E", -")2. c #161831", -"!2. c #1D1F36", -"~2. c #1C1D35", -"{2. c #11132C", -"]2. c #0B0C26", -"^2. c #1E212F", -"/2. c #38372E", -"(2. c #32302E", -"_2. c #383332", -":2. c #524333", -"<2. c #4F4832", -"[2. c #3E4028", -"}2. c #3F432B", -"|2. c #41462F", -"12. c #33361E", -"22. c #44462E", -"32. c #474C35", -"42. c #3D3F2A", -"52. c #3E422F", -"62. c #4A4F3A", -"72. c #454532", -"82. c #4B4639", -"92. c #595448", -"02. c #5E6052", -"a2. c #64665A", -"b2. c #66665E", -"c2. c #6D6E69", -"d2. c #757672", -"e2. c #807F7B", -"f2. c #8A8783", -"g2. c #8D8B84", -"h2. c #96948D", -"i2. c #A1A19B", -"j2. c #B4B2AF", -"k2. c #B9B7B3", -"l2. c #BCBCB8", -"m2. c #C0C0BB", -"n2. c #BDBCB7", -"o2. c #ADAAA1", -"p2. c #807E72", -"q2. c #757869", -"r2. c #919080", -"s2. c #A19E8F", -"t2. c #B1ACA1", -"u2. c #AEA799", -"v2. c #A09785", -"w2. c #C6C0B5", -"x2. c #AFADA6", -"y2. c #716D72", -"z2. c #494A66", -"A2. c #4A4A6B", -"B2. c #555974", -"C2. c #5E627C", -"D2. c #5F6480", -"E2. c #6D718A", -"F2. c #ABAFB9", -"G2. c #BEC1CB", -"H2. c #BCC1C7", -"I2. c #E6E9E9", -"J2. c #F9FAF7", -"K2. c #EDEDE0", -"L2. c #AAA487", -"M2. c #93876B", -"N2. c #908167", -"O2. c #968069", -"P2. c #957B64", -"Q2. c #756A6B", -"R2. c #4D4C64", -"S2. c #444258", -"T2. c #5B5052", -"U2. c #614C3E", -"V2. c #6B583F", -"W2. c #5F513B", -"X2. c #4C4030", -"Y2. c #3F3728", -"Z2. c #463D2C", -"`2. c #423424", -" 3. c #443425", -".3. c #3E3125", -"+3. c #596066", -"@3. c #707582", -"#3. c #77562D", -"$3. c #775326", -"%3. c #271E18", -"&3. c #15161A", -"*3. c #100E0E", -"=3. c #432E11", -"-3. c #AB7227", -";3. c #816C4B", -">3. c #5B595D", -",3. c #4F515A", -"'3. c #4F535A", -")3. c #2D2F37", -"!3. c #080A1F", -"~3. c #04051E", -"{3. c #27283B", -"]3. c #5A5A64", -"^3. c #64646B", -"/3. c #5E5F69", -"(3. c #24253A", -"_3. c #040522", -":3. c #030421", -"<3. c #030420", -"[3. c #0A0B26", -"}3. c #151632", -"|3. c #050624", -"13. c #2E304A", -"23. c #31334C", -"33. c #282A46", -"43. c #242541", -"53. c #222340", -"63. c #20243F", -"73. c #1F233E", -"83. c #20233E", -"93. c #1E1F3A", -"03. c #0B0C28", -"a3. c #080926", -"b3. c #060722", -"c3. c #070924", -"d3. c #070823", -"e3. c #050620", -"f3. c #322F33", -"g3. c #37342D", -"h3. c #373426", -"i3. c #3E372B", -"j3. c #5A4536", -"k3. c #504837", -"l3. c #3E412B", -"m3. c #363922", -"n3. c #31361F", -"o3. c #252C15", -"p3. c #3C412B", -"q3. c #3C3E28", -"r3. c #3E402B", -"s3. c #3D4230", -"t3. c #4F5342", -"u3. c #4C4E3F", -"v3. c #4B4B41", -"w3. c #555347", -"x3. c #5E5D51", -"y3. c #575B55", -"z3. c #5C6365", -"A3. c #6C7377", -"B3. c #848483", -"C3. c #8A8784", -"D3. c #93928F", -"E3. c #9D9B99", -"F3. c #A4A2A0", -"G3. c #A9A8A6", -"H3. c #ADACA8", -"I3. c #B1AFAB", -"J3. c #B4B2AE", -"K3. c #B8B7B3", -"L3. c #BCBAB6", -"M3. c #B1AEA8", -"N3. c #8D8A82", -"O3. c #656358", -"P3. c #757365", -"Q3. c #938F80", -"R3. c #9E998A", -"S3. c #A29989", -"T3. c #968978", -"U3. c #A49B8E", -"V3. c #87837B", -"W3. c #57555E", -"X3. c #484C68", -"Y3. c #4D516B", -"Z3. c #515570", -"`3. c #565A74", -" 4. c #5A5F7B", -".4. c #5C607E", -"+4. c #5E637E", -"@4. c #5E647D", -"#4. c #606580", -"$4. c #686C85", -"%4. c #84869C", -"&4. c #B0B1BE", -"*4. c #E9E8EC", -"=4. c #DCE2E2", -"-4. c #BCC9C6", -";4. c #BEC5B5", -">4. c #BAB79E", -",4. c #A4977D", -"'4. c #9C8D72", -")4. c #928567", -"!4. c #B3A394", -"~4. c #A49893", -"{4. c #736566", -"]4. c #635A5E", -"^4. c #615B61", -"/4. c #746966", -"(4. c #6C5440", -"_4. c #70593D", -":4. c #60523C", -"<4. c #4E4130", -"[4. c #423A2B", -"}4. c #332D1F", -"|4. c #3D3527", -"14. c #413426", -"24. c #413022", -"34. c #3F3125", -"44. c #383532", -"54. c #1A1C1F", -"64. c #302515", -"74. c #322A1F", -"84. c #2C2A30", -"94. c #1D160A", -"04. c #6C5130", -"a4. c #63564C", -"b4. c #4C515A", -"c4. c #4A4D54", -"d4. c #4D5057", -"e4. c #292B33", -"f4. c #0B0D16", -"g4. c #070812", -"h4. c #080A1E", -"i4. c #272839", -"j4. c #545461", -"k4. c #65676E", -"l4. c #5F5E67", -"m4. c #5F6068", -"n4. c #3C3E4E", -"o4. c #080923", -"p4. c #1A1C36", -"q4. c #1E203A", -"r4. c #0C0D2B", -"s4. c #0B0C2A", -"t4. c #1D1E3B", -"u4. c #22233E", -"v4. c #1F203B", -"w4. c #1F203C", -"x4. c #252642", -"y4. c #191A36", -"z4. c #1B1D39", -"A4. c #1E223D", -"B4. c #1A1D39", -"C4. c #131430", -"D4. c #02031F", -"E4. c #060821", -"F4. c #14132C", -"G4. c #1E1C2E", -"H4. c #22202B", -"I4. c #302F28", -"J4. c #564839", -"K4. c #5A5440", -"L4. c #484933", -"M4. c #393B25", -"N4. c #353923", -"O4. c #383D27", -"P4. c #393E28", -"Q4. c #393D27", -"R4. c #414430", -"S4. c #373B29", -"T4. c #353B2A", -"U4. c #45493C", -"V4. c #45473E", -"W4. c #494B46", -"X4. c #52514E", -"Y4. c #4A4948", -"Z4. c #4F5154", -"`4. c #5D6266", -" 5. c #787C7E", -".5. c #90908E", -"+5. c #969491", -"@5. c #9E9D9B", -"#5. c #A6A5A3", -"$5. c #A7A6A4", -"%5. c #A5A4A1", -"&5. c #A2A19C", -"*5. c #A6A59F", -"=5. c #ABA8A3", -"-5. c #ADABA5", -";5. c #ACA9A3", -">5. c #8A867D", -",5. c #726B62", -"'5. c #60584C", -")5. c #525141", -"!5. c #5F5C4C", -"~5. c #786B5F", -"{5. c #928278", -"]5. c #A39185", -"^5. c #958173", -"/5. c #847669", -"(5. c #665E54", -"_5. c #565358", -":5. c #484C65", -"<5. c #4D516A", -"[5. c #52566F", -"}5. c #5C6079", -"|5. c #5F657D", -"15. c #60667C", -"25. c #636781", -"35. c #898C9E", -"45. c #C5C7CF", -"55. c #B4B7BE", -"65. c #E5E5E6", -"75. c #E6EBE9", -"85. c #A5B3A4", -"95. c #7E8366", -"05. c #8B7E5E", -"a5. c #A08D70", -"b5. c #97876B", -"c5. c #94856A", -"d5. c #A99C89", -"e5. c #A69C91", -"f5. c #B0A196", -"g5. c #937E6B", -"h5. c #938474", -"i5. c #96897F", -"j5. c #7F6D60", -"k5. c #775F48", -"l5. c #6F573C", -"m5. c #5D4C37", -"n5. c #4D402F", -"o5. c #484031", -"p5. c #3F382B", -"q5. c #362E20", -"r5. c #3F3224", -"s5. c #3B2C1D", -"t5. c #3A2C22", -"u5. c #423E3E", -"v5. c #414449", -"w5. c #151213", -"x5. c #1E191D", -"y5. c #000201", -"z5. c #101013", -"A5. c #43434A", -"B5. c #45454C", -"C5. c #4F5056", -"D5. c #404046", -"E5. c #363332", -"F5. c #4C4D4F", -"G5. c #494A4E", -"H5. c #4B4951", -"I5. c #4B4E56", -"J5. c #4C4F56", -"K5. c #474A51", -"L5. c #23252D", -"M5. c #0A0C15", -"N5. c #23252E", -"O5. c #161721", -"P5. c #01030F", -"Q5. c #00021B", -"R5. c #242736", -"S5. c #5B5B64", -"T5. c #69696F", -"U5. c #65646A", -"V5. c #5B5C64", -"W5. c #50535D", -"X5. c #13152F", -"Y5. c #11122D", -"Z5. c #060725", -"`5. c #050724", -" 6. c #0A0B28", -".6. c #1B1C38", -"+6. c #1C203B", -"@6. c #161935", -"#6. c #0C0D28", -"$6. c #080925", -"%6. c #080A23", -"&6. c #010520", -"*6. c #040620", -"=6. c #0D0E25", -"-6. c #4D4135", -";6. c #5A4D3B", -">6. c #4B4732", -",6. c #474732", -"'6. c #3B3D27", -")6. c #41422D", -"!6. c #3B422C", -"~6. c #373C29", -"{6. c #363A2A", -"]6. c #484D40", -"^6. c #474C43", -"/6. c #3D413F", -"(6. c #4A4D4F", -"_6. c #484A4B", -":6. c #444445", -"<6. c #656466", -"[6. c #818180", -"}6. c #90928E", -"|6. c #989994", -"16. c #9E9E9A", -"26. c #A3A3A1", -"36. c #A3A29F", -"46. c #9D9C97", -"56. c #97978F", -"66. c #939188", -"76. c #98958C", -"86. c #96928A", -"96. c #99968C", -"06. c #686558", -"a6. c #594D41", -"b6. c #5A493C", -"c6. c #4C4333", -"d6. c #50543F", -"e6. c #6C6455", -"f6. c #8E7B74", -"g6. c #806E64", -"h6. c #736255", -"i6. c #625044", -"j6. c #635749", -"k6. c #5D5757", -"l6. c #464A5F", -"m6. c #494E64", -"n6. c #4D5268", -"o6. c #51566C", -"p6. c #565B71", -"q6. c #5B6076", -"r6. c #5F657A", -"s6. c #636A7D", -"t6. c #6A7181", -"u6. c #747985", -"v6. c #EFF1F2", -"w6. c #C5C8C5", -"x6. c #CFCAC1", -"y6. c #BFB9AE", -"z6. c #999685", -"A6. c #827C5E", -"B6. c #837455", -"C6. c #9D8A6B", -"D6. c #8D7B5E", -"E6. c #8A7960", -"F6. c #9E8E79", -"G6. c #958A7A", -"H6. c #AFA297", -"I6. c #A69081", -"J6. c #9E8879", -"K6. c #8E7866", -"L6. c #775E45", -"M6. c #7A6249", -"N6. c #654E36", -"O6. c #59452F", -"P6. c #4F4231", -"Q6. c #463E2F", -"R6. c #453E31", -"S6. c #3A3224", -"T6. c #3C3022", -"U6. c #3A2A1C", -"V6. c #34261E", -"W6. c #3E3A3C", -"X6. c #47494F", -"Y6. c #111115", -"Z6. c #0F0C10", -"`6. c #1C1B1B", -" 7. c #0A0D0F", -".7. c #171A1C", -"+7. c #25282C", -"@7. c #2A2D32", -"#7. c #2D3035", -"$7. c #33353C", -"%7. c #3D3F45", -"&7. c #43464C", -"*7. c #46484F", -"=7. c #4A4C53", -"-7. c #4A4E56", -";7. c #47484E", -">7. c #474A50", -",7. c #4C4E55", -"'7. c #4B4C53", -")7. c #13161D", -"!7. c #01040B", -"~7. c #38393B", -"{7. c #040711", -"]7. c #0C0E24", -"^7. c #454851", -"/7. c #66696D", -"(7. c #626469", -"_7. c #585A5F", -":7. c #55595E", -"<7. c #383B4A", -"[7. c #090A25", -"}7. c #050722", -"|7. c #070923", -"17. c #050622", -"27. c #0B0D26", -"37. c #191B35", -"47. c #11122E", -"57. c #161834", -"67. c #111330", -"77. c #080A24", -"87. c #24263E", -"97. c #25273E", -"07. c #181A31", -"a7. c #1D1E35", -"b7. c #212339", -"c7. c #2C2F42", -"d7. c #26293E", -"e7. c #0C0E26", -"f7. c #03061F", -"g7. c #02051D", -"h7. c #05081F", -"i7. c #1F1E25", -"j7. c #362B24", -"k7. c #413227", -"l7. c #46402F", -"m7. c #4D4D3A", -"n7. c #4C4F3C", -"o7. c #4E513C", -"p7. c #494C3A", -"q7. c #444A37", -"r7. c #3A3F2B", -"s7. c #4B4E41", -"t7. c #5E625B", -"u7. c #4A4C4E", -"v7. c #3E3E41", -"w7. c #343433", -"x7. c #525251", -"y7. c #8F908D", -"z7. c #959691", -"A7. c #939391", -"B7. c #9A9797", -"C7. c #A09E9B", -"D7. c #9C9C98", -"E7. c #9B9C97", -"F7. c #94948E", -"G7. c #8D8B82", -"H7. c #858278", -"I7. c #807D74", -"J7. c #706B60", -"K7. c #747064", -"L7. c #505143", -"M7. c #504A3B", -"N7. c #655247", -"O7. c #6C5B50", -"P7. c #6B6757", -"Q7. c #757364", -"R7. c #847570", -"S7. c #6F5E54", -"T7. c #5D5243", -"U7. c #514434", -"V7. c #5F4C36", -"W7. c #524D4E", -"X7. c #44495E", -"Y7. c #484D63", -"Z7. c #50566B", -"`7. c #545B6F", -" 8. c #5B6274", -".8. c #656F7D", -"+8. c #758187", -"@8. c #808C90", -"#8. c #8E9897", -"$8. c #D0D3D2", -"%8. c #E6EAE8", -"&8. c #B6B7AF", -"*8. c #9E9382", -"=8. c #8C7A66", -"-8. c #7F6E55", -";8. c #857353", -">8. c #7D6A49", -",8. c #847253", -"'8. c #8E7F63", -")8. c #8E7D63", -"!8. c #82705B", -"~8. c #887966", -"{8. c #9A8870", -"]8. c #8A6F56", -"^8. c #8A6E56", -"/8. c #7D6447", -"(8. c #755F42", -"_8. c #6C583F", -":8. c #614B34", -"<8. c #57422E", -"[8. c #524332", -"}8. c #463C2C", -"|8. c #3F382A", -"18. c #3A3327", -"28. c #372D22", -"38. c #36281F", -"48. c #2E211C", -"58. c #383637", -"68. c #484B52", -"78. c #45474E", -"88. c #2F3036", -"98. c #13110F", -"08. c #131111", -"a8. c #17181C", -"b8. c #313439", -"c8. c #303339", -"d8. c #32353C", -"e8. c #383B42", -"f8. c #373A41", -"g8. c #44464D", -"h8. c #25272B", -"i8. c #303235", -"j8. c #44474C", -"k8. c #464950", -"l8. c #0E1018", -"m8. c #03050C", -"n8. c #28282B", -"o8. c #343639", -"p8. c #060914", -"q8. c #0B0D1F", -"r8. c #3C3E4C", -"s8. c #626369", -"t8. c #62646A", -"u8. c #50535A", -"v8. c #484C54", -"w8. c #171A2E", -"x8. c #1A1C35", -"y8. c #1B1D36", -"z8. c #161832", -"A8. c #0D0E2A", -"B8. c #0C0D29", -"C8. c #292B42", -"D8. c #1B1D32", -"E8. c #222439", -"F8. c #3F4251", -"G8. c #434756", -"H8. c #262939", -"I8. c #03051D", -"J8. c #0C0D24", -"K8. c #241C24", -"L8. c #362B22", -"M8. c #3F3B29", -"N8. c #4E4F3D", -"O8. c #4A4F3D", -"P8. c #535846", -"Q8. c #686B61", -"R8. c #5B6256", -"S8. c #575D50", -"T8. c #6C6F6A", -"U8. c #616266", -"V8. c #535155", -"W8. c #454242", -"X8. c #423F3B", -"Y8. c #706E6C", -"Z8. c #898886", -"`8. c #8E8D8C", -" 9. c #949390", -".9. c #848382", -"+9. c #68686D", -"@9. c #7A787D", -"#9. c #8A8586", -"$9. c #7D7874", -"%9. c #7E7970", -"&9. c #737066", -"*9. c #706B61", -"=9. c #676056", -"-9. c #60564D", -";9. c #564A40", -">9. c #534A3D", -",9. c #494A39", -"'9. c #534E40", -")9. c #66534A", -"!9. c #736056", -"~9. c #6D6156", -"{9. c #6D665A", -"]9. c #6A5B57", -"^9. c #5F4D47", -"/9. c #564B41", -"(9. c #54493B", -"_9. c #564832", -":9. c #4A4847", -"<9. c #43485B", -"[9. c #474C60", -"}9. c #4B5064", -"|9. c #505569", -"19. c #535C6D", -"29. c #5C6977", -"39. c #6D7B85", -"49. c #75847D", -"59. c #828E7F", -"69. c #A7B0A0", -"79. c #C1C2B3", -"89. c #9C9F8C", -"99. c #808069", -"09. c #807256", -"a9. c #867054", -"b9. c #866C52", -"c9. c #8D7352", -"d9. c #8A7150", -"e9. c #8C7A5A", -"f9. c #A19479", -"g9. c #8C7B60", -"h9. c #897865", -"i9. c #8D7D6A", -"j9. c #7C6847", -"k9. c #866E47", -"l9. c #846A47", -"m9. c #72583B", -"n9. c #6F563D", -"o9. c #665038", -"p9. c #604B35", -"q9. c #584531", -"r9. c #534433", -"s9. c #453B2B", -"t9. c #393227", -"u9. c #342B20", -"v9. c #32281F", -"w9. c #251D19", -"x9. c #353436", -"y9. c #42474E", -"z9. c #3C3D3F", -"A9. c #2F251D", -"B9. c #1E1410", -"C9. c #2D2A2F", -"D9. c #49494F", -"E9. c #313235", -"F9. c #08090B", -"G9. c #141512", -"H9. c #303036", -"I9. c #323339", -"J9. c #303138", -"K9. c #30333B", -"L9. c #31343C", -"M9. c #363940", -"N9. c #46494F", -"O9. c #36393D", -"P9. c #43464B", -"Q9. c #404349", -"R9. c #41444D", -"S9. c #454850", -"T9. c #42454C", -"U9. c #0F1119", -"V9. c #06080F", -"W9. c #2F3033", -"X9. c #36383B", -"Y9. c #070A14", -"Z9. c #0A0C20", -"`9. c #30323F", -" 0. c #5D5F62", -".0. c #626266", -"+0. c #4E5059", -"@0. c #40434D", -"#0. c #484B55", -"$0. c #353946", -"%0. c #070921", -"&0. c #1A1C34", -"*0. c #191B33", -"=0. c #23253D", -"-0. c #1E2039", -";0. c #0F112A", -">0. c #0A0C26", -",0. c #13152E", -"'0. c #28293F", -")0. c #16182D", -"!0. c #0D0F24", -"~0. c #0F1126", -"{0. c #14172C", -"]0. c #232537", -"^0. c #14172B", -"/0. c #03051B", -"(0. c #03071D", -"_0. c #1B1625", -":0. c #312A22", -"<0. c #41412E", -"[0. c #414532", -"}0. c #262E1B", -"|0. c #444B38", -"10. c #656C5F", -"20. c #616A5C", -"30. c #4D5748", -"40. c #504E52", -"50. c #403B3A", -"60. c #35312B", -"70. c #605C57", -"80. c #86827E", -"90. c #8F8C89", -"00. c #928F8C", -"a0. c #908B8A", -"b0. c #6E6A6F", -"c0. c #2E2F3C", -"d0. c #3F434F", -"e0. c #484A57", -"f0. c #423E44", -"g0. c #4C473B", -"h0. c #453E2F", -"i0. c #463C31", -"j0. c #4D4339", -"k0. c #4F463B", -"l0. c #4B4033", -"m0. c #564F43", -"n0. c #5D4843", -"o0. c #5B473E", -"p0. c #503F35", -"q0. c #53453A", -"r0. c #55473C", -"s0. c #615046", -"t0. c #574B41", -"u0. c #4B4237", -"v0. c #4E4735", -"w0. c #454A5A", -"x0. c #464C5E", -"y0. c #4C5163", -"z0. c #515668", -"A0. c #576270", -"B0. c #657880", -"C0. c #63766F", -"D0. c #576652", -"E0. c #707761", -"F0. c #A9AC98", -"G0. c #8B8771", -"H0. c #706F51", -"I0. c #777455", -"J0. c #857455", -"K0. c #957B60", -"L0. c #90735B", -"M0. c #998260", -"N0. c #A08E6B", -"O0. c #998969", -"P0. c #94876B", -"Q0. c #8F7E63", -"R0. c #827257", -"S0. c #7A6A51", -"T0. c #7C664A", -"U0. c #8F7859", -"V0. c #866D4E", -"W0. c #7A5E42", -"X0. c #765840", -"Y0. c #6C513B", -"Z0. c #624D37", -"`0. c #655440", -" a. c #5F503F", -".a. c #4A4030", -"+a. c #3B3425", -"@a. c #3B3429", -"#a. c #32291F", -"$a. c #2E261D", -"%a. c #1F1B18", -"&a. c #4E4E58", -"*a. c #4B4E55", -"=a. c #44474D", -"-a. c #524A44", -";a. c #5E4729", -">a. c #483216", -",a. c #484D52", -"'a. c #494C53", -")a. c #3D4046", -"!a. c #35383D", -"~a. c #18191D", -"{a. c #2B2B32", -"]a. c #2C2D33", -"^a. c #31343B", -"/a. c #33363D", -"(a. c #41424A", -"_a. c #45464C", -":a. c #303237", -"b. c #3F3729", -",b. c #413D2A", -"'b. c #4C4D3B", -")b. c #51585B", -"!b. c #495163", -"~b. c #4C5864", -"{b. c #505F6B", -"]b. c #586B78", -"^b. c #607372", -"/b. c #50634C", -"(b. c #4F5B40", -"_b. c #83866D", -":b. c #776D54", -"c. c #606169", -",c. c #2B2D41", -"'c. c #2F3142", -")c. c #515361", -"!c. c #50525D", -"~c. c #39394A", -"{c. c #16172C", -"]c. c #22222E", -"^c. c #5E5D5A", -"/c. c #696961", -"(c. c #484B40", -"_c. c #505548", -":c. c #54594B", -"d. c #5B4F49", -",d. c #41474F", -"'d. c #44444D", -")d. c #36373F", -"!d. c #303137", -"~d. c #18191C", -"{d. c #2D2E35", -"]d. c #2F3239", -"^d. c #35373E", -"/d. c #363840", -"(d. c #404248", -"_d. c #04060D", -":d. c #38383A", -"e. c #4D574A", -",e. c #556560", -"'e. c #62726C", -")e. c #5C6F60", -"!e. c #616E58", -"~e. c #787C62", -"{e. c #8A866B", -"]e. c #91846A", -"^e. c #8B7A5D", -"/e. c #968566", -"(e. c #948264", -"_e. c #908161", -":e. c #817050", -"f. c #3A3F4A", -",f. c #68696B", -"'f. c #717276", -")f. c #68696E", -"!f. c #3A3C4B", -"~f. c #101127", -"{f. c #0E0F22", -"]f. c #7D7C7C", -"^f. c #7C7D79", -"/f. c #7D7F7A", -"(f. c #7F827C", -"_f. c #7F7F7D", -":f. c #797877", -"g. c #5F4E38", -",g. c #5B4834", -"'g. c #403F44", -")g. c #3C3D43", -"!g. c #2E2F36", -"~g. c #2E3138", -"{g. c #3B3C42", -"]g. c #323439", -"^g. c #1D1F26", -"/g. c #0A0B15", -"(g. c #13141D", -"_g. c #0F121B", -":g. c #0E101C", -"h. c #5D624F", -",h. c #706D55", -"'h. c #8A7F65", -")h. c #908266", -"!h. c #97886B", -"~h. c #8D7E61", -"{h. c #988569", -"]h. c #806E52", -"^h. c #66563C", -"/h. c #5B543A", -"(h. c #7A6C4E", -"_h. c #998261", -":h. c #9A8465", -"i. c #54545B", -",i. c #31313E", -"'i. c #131525", -")i. c #17192B", -"!i. c #2C2D3E", -"~i. c #4F4F59", -"{i. c #58575C", -"]i. c #474651", -"^i. c #2E2F3E", -"/i. c #262833", -"(i. c #494945", -"_i. c #48453A", -":i. c #483B30", -"j. c #131425", -",j. c #020519", -"'j. c #04071C", -")j. c #202235", -"!j. c #000419", -"~j. c #070A1F", -"{j. c #131529", -"]j. c #3E414E", -"^j. c #46454D", -"/j. c #534B47", -"(j. c #554A45", -"_j. c #3A2E28", -":j. c #271D15", -"k. c #655443", -",k. c #655445", -"'k. c #584F45", -")k. c #2A2C34", -"!k. c #1D2031", -"~k. c #0F0F1F", -"{k. c #0A0A18", -"]k. c #141421", -"^k. c #36383F", -"/k. c #32363B", -"(k. c #34353C", -"_k. c #34363B", -":k. c #241F27", -"l. c #594935", -",l. c #4F3F2B", -"'l. c #5E4B35", -")l. c #766147", -"!l. c #937E67", -"~l. c #958E87", -"{l. c #777C84", -"]l. c #796C55", -"^l. c #AC9880", -"/l. c #A19378", -"(l. c #A08F76", -"_l. c #958069", -":l. c #95816D", -"m. c #232436", -",m. c #242839", -"'m. c #3A353C", -")m. c #4D3A39", -"!m. c #503D38", -"~m. c #503B34", -"{m. c #55413B", -"]m. c #49464C", -"^m. c #353748", -"/m. c #38394B", -"(m. c #3B3E4C", -"_m. c #3D424E", -":m. c #464F57", -"n. c #473B39", -",n. c #4A4645", -"'n. c #4A4B51", -")n. c #3F404A", -"!n. c #363743", -"~n. c #3B3B48", -"{n. c #4D4F57", -"]n. c #54575C", -"^n. c #595B61", -"/n. c #4F5159", -"(n. c #30313E", -"_n. c #12111C", -":n. c #13121C", -"o. c #020313", -",o. c #06081A", -"'o. c #000214", -")o. c #010214", -"!o. c #010215", -"~o. c #0C0F20", -"{o. c #1B1E2D", -"]o. c #2F323C", -"^o. c #2E313B", -"/o. c #141527", -"(o. c #131427", -"_o. c #1C1E2D", -":o. c #232533", -"p. c #2A2D3E", -",p. c #282937", -"'p. c #545042", -")p. c #5C5340", -"!p. c #4C453B", -"~p. c #15141C", -"{p. c #111321", -"]p. c #373639", -"^p. c #44403A", -"/p. c #393F45", -"(p. c #373332", -"_p. c #65491E", -":p. c #765622", -"q. c #89755D", -",q. c #86705C", -"'q. c #84705E", -")q. c #998675", -"!q. c #AF9E8E", -"~q. c #A89788", -"{q. c #A49286", -"]q. c #B7A59B", -"^q. c #AA9A8E", -"/q. c #988877", -"(q. c #908270", -"_q. c #877A5D", -":q. c #716545", -"r. c #181826", -",r. c #26212A", -"'r. c #3A3137", -")r. c #231F2F", -"!r. c #1D1F33", -"~r. c #1F2132", -"{r. c #212333", -"]r. c #252535", -"^r. c #272736", -"/r. c #292C38", -"(r. c #3C363B", -"_r. c #4C3D3B", -":r. c #4A3F3F", -"s. c #362118", -",s. c #301D10", -"'s. c #2F1F19", -")s. c #251914", -"!s. c #372821", -"~s. c #57443A", -"{s. c #594537", -"]s. c #5A462F", -"^s. c #503A24", -"/s. c #331F10", -"(s. c #2A1910", -"_s. c #372D28", -":s. c #3D3E43", -"t. c #45464D", -",t. c #43444B", -"'t. c #121011", -")t. c #141211", -"!t. c #403F46", -"~t. c #16161B", -"{t. c #060811", -"]t. c #050915", -"^t. c #080A18", -"/t. c #141523", -"(t. c #161624", -"_t. c #0D0F1D", -":t. c #1A151C", -"u. c #33333C", -",u. c #242526", -"'u. c #38383C", -")u. c #38393E", -"!u. c #11110D", -"~u. c #404047", -"{u. c #3F4248", -"]u. c #4B4E59", -"^u. c #4B4950", -"/u. c #292525", -"(u. c #141113", -"_u. c #111114", -":u. c #080A11", -"v. c #72624C", -",v. c #6E5F47", -"'v. c #453F39", -")v. c #0E0E1A", -"!v. c #201F2B", -"~v. c #4A4A4F", -"{v. c #7E602F", -"]v. c #D78D22", -"^v. c #DB8F20", -"/v. c #8D6D40", -"(v. c #4C4D53", -"_v. c #33373E", -":v. c #373840", -"w. c #897666", -",w. c #7E6B59", -"'w. c #7E6D55", -")w. c #807057", -"!w. c #7E7054", -"~w. c #796B4F", -"{w. c #766955", -"]w. c #736453", -"^w. c #6E6149", -"/w. c #393333", -"(w. c #0A0C19", -"_w. c #202029", -":w. c #484B53", -"x. c #816F5F", -",x. c #806D5E", -"'x. c #8F7C6D", -")x. c #867364", -"!x. c #7B6858", -"~x. c #85735D", -"{x. c #82725B", -"]x. c #7C6E56", -"^x. c #7A6B55", -"/x. c #7C6F5F", -"(x. c #7B6E60", -"_x. c #6F6450", -":x. c #2F2A2D", -"y. c #474957", -",y. c #4B4C5B", -"'y. c #4F4F5E", -")y. c #515262", -"!y. c #525568", -"~y. c #56596E", -"{y. c #656875", -"]y. c #70736E", -"^y. c #737362", -"/y. c #7B705A", -"(y. c #766750", -"_y. c #7A6858", -":y. c #7E6A59", -"z. c #121421", -",z. c #161825", -"'z. c #2A2C39", -")z. c #2D2F3C", -"!z. c #313340", -"~z. c #343643", -"{z. c #393B47", -"]z. c #3E404D", -"^z. c #414350", -"/z. c #454754", -"(z. c #4E4D5B", -"_z. c #515161", -":z. c #525467", -"A. c #101220", -",A. c #151724", -"'A. c #212330", -")A. c #282A37", -"!A. c #2F323D", -"~A. c #31343E", -"{A. c #333641", -"]A. c #373A46", -"^A. c #40424F", -"/A. c #424451", -"(A. c #474955", -"_A. c #4B4C58", -":A. c #525161", -"B. c #443728", -",B. c #574B38", -"'B. c #554831", -")B. c #504233", -"!B. c #231D22", -"~B. c #0C101D", -"{B. c #0F111F", -"]B. c #111320", -"^B. c #1A1C28", -"/B. c #1C1E2A", -"(B. c #1F212D", -"_B. c #272835", -":B. c #31333C", -"C. c #301C12", -",C. c #231413", -"'C. c #2D2421", -")C. c #36322C", -"!C. c #292728", -"~C. c #42413C", -"{C. c #443D2D", -"]C. c #423422", -"^C. c #38281A", -"/C. c #473829", -"(C. c #594A36", -"_C. c #564733", -":C. c #5B513F", -"D. c #E3EBF1", -",D. c #8C919D", -"'D. c #3B3027", -")D. c #262420", -"!D. c #5A5B5D", -"~D. c #BC8B38", -"{D. c #CA9225", -"]D. c #9B948F", -"^D. c #EAF0F0", -"/D. c #6D5530", -"(D. c #674823", -"_D. c #191A22", -":D. c #141520", -"E. c #80899D", -",E. c #161515", -"'E. c #424348", -")E. c #424347", -"!E. c #4D4E53", -"~E. c #9D7339", -"{E. c #D9891B", -"]E. c #7F6242", -"^E. c #A7B1C1", -"/E. c #626265", -"(E. c #28231C", -"_E. c #17130F", -":E. c #221F21", -"F. c #605646", -",F. c #776D60", -"'F. c #6D6354", -")F. c #6E6456", -"!F. c #776C5F", -"~F. c #8A7D72", -"{F. c #8E8177", -"]F. c #7E7167", -"^F. c #7E7166", -"/F. c #7C6C5F", -"(F. c #796C60", -"_F. c #867E77", -":F. c #757879", -"G. c #2B180F", -",G. c #271509", -"'G. c #271408", -")G. c #301A10", -"!G. c #3A281F", -"~G. c #4B3F37", -"{G. c #4B4238", -"]G. c #4B4437", -"^G. c #4F4B3B", -"/G. c #535044", -"(G. c #555243", -"_G. c #524E3B", -":G. c #544935", -"H. c #4C4E57", -",H. c #866B43", -"'H. c #D9951E", -")H. c #866736", -"!H. c #BFC3CA", -"~H. c #C8CED0", -"{H. c #60544A", -"]H. c #4F3A1E", -"^H. c #2E251B", -"/H. c #312A1F", -"(H. c #5A431F", -"_H. c #654822", -":H. c #6E6E6C", -"I. c #988D82", -",I. c #7F7468", -"'I. c #81766A", -")I. c #807266", -"!I. c #786B5B", -"~I. c #7F7169", -"{I. c #7F7977", -"]I. c #697174", -"^I. c #58656C", -"/I. c #56606B", -"(I. c #676971", -"_I. c #857B77", -":I. c #85776D", -"J. c #52443B", -",J. c #52473D", -"'J. c #51473C", -")J. c #53493E", -"!J. c #554B41", -"~J. c #574F46", -"{J. c #5A544C", -"]J. c #5A554F", -"^J. c #5B5652", -"/J. c #5B5653", -"(J. c #5B5852", -"_J. c #5C5953", -":J. c #5C5753", -"K. c #D2D9E0", -",K. c #8D8684", -"'K. c #B87B20", -")K. c #D38C22", -"!K. c #5A5146", -"~K. c #4F525A", -"{K. c #46484D", -"]K. c #727B8B", -"^K. c #CBD3DB", -"/K. c #836F56", -"(K. c #E0921C", -"_K. c #C47C20", -":K. c #4C3928", -"L. c #737477", -",L. c #5B606C", -"'L. c #555866", -")L. c #565968", -"!L. c #5B606A", -"~L. c #726D67", -"{L. c #6A5A4F", -"]L. c #7B6961", -"^L. c #6F5D52", -"/L. c #756055", -"(L. c #786456", -"_L. c #7E6B5B", -":L. c #8F7D6A", -"M. c #514035", -",M. c #504034", -"'M. c #4C3F31", -")M. c #483D2E", -"!M. c #4C4132", -"~M. c #514A3B", -"{M. c #5D564A", -"]M. c #5A544A", -"^M. c #5A5851", -"/M. c #615D54", -"(M. c #675F51", -"_M. c #5C523F", -":M. c #5A5037", -"N. c #352C23", -",N. c #3C3429", -"'N. c #443B2F", -")N. c #453C30", -"!N. c #42382D", -"~N. c #453B30", -"{N. c #4B4339", -"]N. c #4C433A", -"^N. c #51483F", -"/N. c #524A42", -"(N. c #534C44", -"_N. c #524D44", -":N. c #535048", -"O. c #2F251E", -",O. c #855B21", -"'O. c #CD8619", -")O. c #835D2C", -"!O. c #3F4145", -"~O. c #141213", -"{O. c #302317", -"]O. c #392C1A", -"^O. c #1C1D22", -"/O. c #0C0E21", -"(O. c #040817", -"_O. c #030407", -":O. c #181810", -"P. c #141F2B", -",P. c #0B0F20", -"'P. c #0F101F", -")P. c #1E150C", -"!P. c #3F311F", -"~P. c #676469", -"{P. c #CCD6E0", -"]P. c #726863", -"^P. c #E3A020", -"/P. c #D99D2D", -"(P. c #635F59", -"_P. c #44484E", -":P. c #474B4F", -"Q. c #4B4958", -",Q. c #615B5D", -"'Q. c #675A50", -")Q. c #6A584B", -"!Q. c #746151", -"~Q. c #7E6955", -"{Q. c #7B6856", -"]Q. c #453F3F", -"^Q. c #1D2430", -"/Q. c #212A34", -"(Q. c #0F101A", -"_Q. c #12110F", -":Q. c #24221E", -"R. c #7E7569", -",R. c #877E73", -"'R. c #948B84", -")R. c #968B84", -"!R. c #94877F", -"~R. c #93887F", -"{R. c #887A70", -"]R. c #87796F", -"^R. c #816F68", -"/R. c #796860", -"(R. c #6F5F5A", -"_R. c #826E69", -":R. c #756963", -"S. c #544D46", -",S. c #554D48", -"'S. c #524A43", -")S. c #50473E", -"!S. c #514840", -"~S. c #50443D", -"{S. c #4F4039", -"]S. c #493A33", -"^S. c #473832", -"/S. c #473732", -"(S. c #483B35", -"_S. c #4A3F37", -":S. c #4D4239", -"T. c #000008", -",T. c #020307", -"'T. c #07070B", -")T. c #1C1C17", -"!T. c #1C1913", -"~T. c #1E1A13", -"{T. c #201C15", -"]T. c #27231C", -"^T. c #302D27", -"/T. c #363029", -"(T. c #362D26", -"_T. c #383129", -":T. c #3A332B", -"U. c #3E4047", -",U. c #141312", -"'U. c #281C0F", -")U. c #332617", -"!U. c #18110D", -"~U. c #33373C", -"{U. c #363A40", -"]U. c #34373B", -"^U. c #585354", -"/U. c #AF7930", -"(U. c #5B3D17", -"_U. c #110F0B", -":U. c #4C4D52", -"V. c #262934", -",V. c #120E10", -"'V. c #19130E", -")V. c #644017", -"!V. c #B38033", -"~V. c #5A5656", -"{V. c #50525C", -"]V. c #3F4047", -"^V. c #2B2C2D", -"/V. c #0D0C0C", -"(V. c #28292C", -"_V. c #4A4A50", -":V. c #64594D", -"W. c #76655D", -",W. c #6E5F53", -"'W. c #595153", -")W. c #4B485A", -"!W. c #5D5866", -"~W. c #686671", -"{W. c #4F4C51", -"]W. c #595454", -"^W. c #2C313E", -"/W. c #8B7665", -"(W. c #2E2E33", -"_W. c #100F0D", -":W. c #17130D", -"X. c #98867A", -",X. c #988378", -"'X. c #927D71", -")X. c #937E73", -"!X. c #79645B", -"~X. c #745E53", -"{X. c #6C564A", -"]X. c #635653", -"^X. c #777476", -"/X. c #817C7D", -"(X. c #55525B", -"_X. c #3B3B45", -":X. c #353745", -"Y. c #817469", -",Y. c #9D8F84", -"'Y. c #998B80", -")Y. c #948478", -"!Y. c #917E72", -"~Y. c #A08A7D", -"{Y. c #947E71", -"]Y. c #887167", -"^Y. c #796052", -"/Y. c #6C5145", -"(Y. c #726058", -"_Y. c #867C71", -":Y. c #6C5E53", -"Z. c #5D554A", -",Z. c #60564C", -"'Z. c #685D51", -")Z. c #665B4F", -"!Z. c #63574C", -"~Z. c #686054", -"{Z. c #675D4B", -"]Z. c #69604E", -"^Z. c #81776F", -"/Z. c #8F857C", -"(Z. c #938780", -"_Z. c #86796E", -":Z. c #847568", -"`. c #4E433A", -",`. c #524942", -"'`. c #59524B", -")`. c #534B44", -"!`. c #4C4339", -"~`. c #473F35", -"{`. c #51493F", -"]`. c #5C5549", -"^`. c #63584C", -"/`. c #5B5238", -"(`. c #5F533B", -"_`. c #7D7368", -":`. c #887D74", -"<`. c #948881", -"[`. c #877A6E", -"}`. c #817164", -"|`. c #8E7D71", -"1`. c #837265", -"2`. c #8B786D", -"3`. c #857166", -"4`. c #8C786E", -"5`. c #8A7468", -"6`. c #786154", -"7`. c #654A3B", -"8`. c #6D5142", -"9`. c #745A4C", -"0`. c #675241", -"a`. c #5B4836", -"b`. c #614E40", -"c`. c #6D5C4F", -"d`. c #7D614B", -"e`. c #7A665A", -"f`. c #5F595C", -"g`. c #35363C", -"h`. c #44454A", -"i`. c #494950", -"j`. c #3F4046", -"k`. c #45474F", -"l`. c #524734", -"m`. c #342411", -"n`. c #0A0B0E", -"o`. c #1B1E1D", -"p`. c #3F4045", -"q`. c #2A2A2C", -"r`. c #3A3A41", -"s`. c #544A42", -"t`. c #855D23", -"u`. c #604E37", -"v`. c #23282C", -"w`. c #040820", -"x`. c #07081D", -"y`. c #000307", -"z`. c #080B0C", -"A`. c #30312C", -"B`. c #2F2F2A", -"C`. c #302D29", -"D`. c #2E2A24", -"E`. c #2D2520", -"F`. c #2F2722", -"G`. c #302924", -"H`. c #342C27", -"I`. c #392F2A", -"J`. c #3E3B36", -"K`. c #403D37", -"L`. c #433E35", -"M`. c #423A31", -"N`. c #40362F", -"O`. c #372D27", -"P`. c #433A33", -"Q`. c #3B322B", -"R`. c #393029", -"S`. c #39312B", -"T`. c #352D28", -"U`. c #382F2A", -"V`. c #433A34", -"W`. c #443B34", -"X`. c #443D38", -"Y`. c #4B4540", -"Z`. c #47423C", -"``. c #46443B", -" + c #4B453B", -". + c #483F36", -"+ + c #4D443B", -"@ + c #59534C", -"# + c #4D443A", -"$ + c #483F35", -"% + c #3F392F", -"& + c #565045", -"* + c #595146", -"= + c #5C5247", -"- + c #605448", -"; + c #6B5F54", -"> + c #6A5E51", -", + c #5F533C", -"' + c #645641", -") + c #746A5A", -"! + c #766C5C", -"~ + c #6F6755", -"{ + c #81776B", -"] + c #968982", -"^ + c #8A7C70", -"/ + c #847265", -"( + c #8C796D", -"_ + c #907D71", -": + c #948075", -"< + c #8B776C", -"[ + c #89756A", -"} + c #89756B", -"| + c #968075", -"1 + c #70594C", -"2 + c #604334", -"3 + c #6A4C3D", -"4 + c #6F5345", -"5 + c #71594D", -"6 + c #6A5345", -"7 + c #7F644D", -"8 + c #82644B", -"9 + c #806855", -"0 + c #6D625F", -"a + c #555257", -"b + c #2A292F", -"c + c #333438", -"d + c #37373E", -"e + c #494951", -"f + c #454449", -"g + c #3A3B41", -"h + c #48443F", -"i + c #724F22", -"j + c #271E0C", -"k + c #3B3B44", -"l + c #191A16", -"m + c #070A0B", -"n + c #33343A", -"o + c #4F443A", -"p + c #604826", -"q + c #3B3B3D", -"r + c #33363C", -"s + c #32343C", -"t + c #242A2A", -"u + c #0B1025", -"v + c #03040A", -"w + c #04040A", -"x + c #2A2A23", -"y + c #30302B", -"z + c #2F2F29", -"A + c #322F2A", -"B + c #312B29", -"C + c #302A27", -"D + c #2D2422", -"E + c #2C221F", -"F + c #2D251F", -"G + c #2E2620", -"H + c #2F261F", -"I + c #312820", -"J + c #3E3C35", -"K + c #403E37", -"L + c #3F3D36", -"M + c #403D36", -"N + c #403832", -"O + c #3F352F", -"P + c #3C322C", -"Q + c #413934", -"R + c #413A34", -"S + c #403A34", -"T + c #403A35", -"U + c #423C38", -"V + c #423C37", -"W + c #3E3833", -"X + c #3F3834", -"Y + c #413935", -"Z + c #423B35", -"` + c #48423C", -" .+ c #4A473E", -"..+ c #47443B", -"+.+ c #494137", -"@.+ c #554E44", -"#.+ c #504B42", -"$.+ c #4C463E", -"%.+ c #3B362B", -"&.+ c #443D31", -"*.+ c #544C40", -"=.+ c #5E5247", -"-.+ c #605348", -";.+ c #5D5246", -">.+ c #786D62", -",.+ c #73675B", -"'.+ c #645944", -").+ c #655945", -"!.+ c #675C48", -"~.+ c #6B614E", -"{.+ c #74695A", -"].+ c #84786E", -"^.+ c #87786C", -"/.+ c #877769", -"(.+ c #917F72", -"_.+ c #937E71", -":.+ c #8E7769", -"<.+ c #8B7267", -"[.+ c #928176", -"}.+ c #A5988F", -"|.+ c #A2938D", -"1.+ c #70594B", -"2.+ c #5D402E", -"3.+ c #664C3B", -"4.+ c #705444", -"5.+ c #674E3F", -"6.+ c #6A4E3B", -"7.+ c #785B43", -"8.+ c #7A604A", -"9.+ c #7B5F44", -"0.+ c #636165", -"a.+ c #3E4144", -"b.+ c #745429", -"c.+ c #6C4712", -"d.+ c #3C3E41", -"e.+ c #333638", -"f.+ c #080C0D", -"g.+ c #5C4B30", -"h.+ c #4C4138", -"i.+ c #37363F", -"j.+ c #171C1D", -"k.+ c #171C2A", -"l.+ c #080A10", -"m.+ c #0B0B12", -"n.+ c #292521", -"o.+ c #2F2C26", -"p.+ c #302B27", -"q.+ c #2F2A27", -"r.+ c #2D2522", -"s.+ c #29211F", -"t.+ c #2D261F", -"u.+ c #332D25", -"v.+ c #352F25", -"w.+ c #38332A", -"x.+ c #3B372E", -"y.+ c #3C3830", -"z.+ c #3E3B33", -"A.+ c #3F3B34", -"B.+ c #3E3B34", -"C.+ c #403B35", -"D.+ c #3E3631", -"E.+ c #3A302A", -"F.+ c #403630", -"G.+ c #38312C", -"H.+ c #352E28", -"I.+ c #423A33", -"J.+ c #3F3831", -"K.+ c #453E37", -"L.+ c #463F38", -"M.+ c #463F39", -"N.+ c #433C36", -"O.+ c #464239", -"P.+ c #49453C", -"Q.+ c #4B473E", -"R.+ c #48423A", -"S.+ c #4D433B", -"T.+ c #4A4237", -"U.+ c #474239", -"V.+ c #504A42", -"W.+ c #433B33", -"X.+ c #302820", -"Y.+ c #322D22", -"Z.+ c #554C40", -"`.+ c #5B5145", -" ++ c #5E5045", -".++ c #655B4F", -"+++ c #6F6559", -"@++ c #6B6155", -"#++ c #685E52", -"$++ c #675D4D", -"%++ c #6C634F", -"&++ c #685E49", -"*++ c #746957", -"=++ c #7C7064", -"-++ c #867A6F", -";++ c #87796D", -">++ c #7E6E5F", -",++ c #877567", -"'++ c #947F72", -")++ c #887263", -"!++ c #876F63", -"~++ c #9C8C81", -"{++ c #A1948A", -"]++ c #947F73", -"^++ c #735541", -"/++ c #5F412C", -"(++ c #6C513E", -"_++ c #6B4D3C", -":++ c #624433", -"<++ c #765640", -"[++ c #755740", -"}++ c #705842", -"|++ c #816A53", -"1++ c #796C64", -"2++ c #58565A", -"3++ c #343338", -"4++ c #363B3F", -"5++ c #5D482F", -"6++ c #925E18", -"7++ c #574124", -"8++ c #373A43", -"9++ c #2D2F33", -"0++ c #07090B", -"a++ c #080B0D", -"b++ c #080A0C", -"c++ c #2A2B31", -"d++ c #2B2C32", -"e++ c #3A3A40", -"f++ c #2D3037", -"g++ c #3F3C36", -"h++ c #38373D", -"i++ c #363A41", -"j++ c #3A3C43", -"k++ c #1E222A", -"l++ c #090B21", -"m++ c #03041C", -"n++ c #02031C", -"o++ c #12151A", -"p++ c #0E1015", -"q++ c #0A0B10", -"r++ c #2B2724", -"s++ c #312C28", -"t++ c #322D29", -"u++ c #312E29", -"v++ c #2B2521", -"w++ c #29241F", -"x++ c #2A251F", -"y++ c #2B2320", -"z++ c #28211E", -"A++ c #251D1A", -"B++ c #261E1B", -"C++ c #2A2521", -"D++ c #312D25", -"E++ c #332F28", -"F++ c #343128", -"G++ c #353328", -"H++ c #36362C", -"I++ c #39372E", -"J++ c #3B362E", -"K++ c #3D3731", -"L++ c #3D3832", -"M++ c #3E3832", -"N++ c #3C3831", -"O++ c #3E3933", -"P++ c #3F3832", -"Q++ c #3C342D", -"R++ c #3F372F", -"S++ c #3B332B", -"T++ c #413931", -"U++ c #443D35", -"V++ c #453E36", -"W++ c #463F37", -"X++ c #47403A", -"Y++ c #453E38", -"Z++ c #48443B", -"`++ c #473E36", -" @+ c #463E33", -".@+ c #494239", -"+@+ c #363229", -"@@+ c #363128", -"#@+ c #2D251D", -"$@+ c #2A221A", -"%@+ c #2F2A1F", -"&@+ c #473F33", -"*@+ c #5A5144", -"=@+ c #5C5246", -"-@+ c #5D5145", -";@+ c #63564B", -">@+ c #6A6054", -",@+ c #6F6558", -"'@+ c #6D6457", -")@+ c #746B5E", -"!@+ c #756C62", -"~@+ c #6E6752", -"{@+ c #695F49", -"]@+ c #726755", -"^@+ c #7A6E61", -"/@+ c #867A6C", -"(@+ c #7D7061", -"_@+ c #857566", -":@+ c #89796A", -"<@+ c #8D7B6C", -"[@+ c #776353", -"}@+ c #A09286", -"|@+ c #827061", -"1@+ c #6E5341", -"2@+ c #654F41", -"3@+ c #5F4838", -"4@+ c #6E513C", -"5@+ c #694936", -"6@+ c #75533F", -"7@+ c #7B5741", -"8@+ c #7C5E49", -"9@+ c #78604A", -"0@+ c #7D6B5C", -"a@+ c #777070", -"b@+ c #2D2C2D", -"c@+ c #434349", -"d@+ c #3E3F45", -"e@+ c #414349", -"f@+ c #433C3A", -"g@+ c #94641B", -"h@+ c #725428", -"i@+ c #3A3C3C", -"j@+ c #393C42", -"k@+ c #242625", -"l@+ c #252726", -"m@+ c #06090B", -"n@+ c #090B0D", -"o@+ c #0E1013", -"p@+ c #1C1D21", -"q@+ c #323137", -"r@+ c #181B1E", -"s@+ c #131829", -"t@+ c #030521", -"u@+ c #05041B", -"v@+ c #03041D", -"w@+ c #000215", -"x@+ c #01020B", -"y@+ c #0A0A13", -"z@+ c #080911", -"A@+ c #020409", -"B@+ c #252221", -"C@+ c #2F2A26", -"D@+ c #2C2622", -"E@+ c #2C2721", -"F@+ c #302C27", -"G@+ c #302C28", -"H@+ c #2E2A25", -"I@+ c #2D2824", -"J@+ c #2B2622", -"K@+ c #2B2421", -"L@+ c #27201D", -"M@+ c #28221E", -"N@+ c #302A25", -"O@+ c #322B22", -"P@+ c #322F24", -"Q@+ c #333027", -"R@+ c #36332B", -"S@+ c #36352D", -"T@+ c #37362D", -"U@+ c #39372F", -"V@+ c #3C3832", -"W@+ c #3D3933", -"X@+ c #3D3934", -"Y@+ c #403C37", -"Z@+ c #413C37", -"`@+ c #413A33", -" #+ c #3E362E", -".#+ c #3F3630", -"+#+ c #3A312B", -"@#+ c #352B25", -"##+ c #3B312B", -"$#+ c #3C332D", -"%#+ c #3D342E", -"&#+ c #3D332D", -"*#+ c #433B34", -"=#+ c #484139", -"-#+ c #4A433B", -";#+ c #484039", -">#+ c #473F38", -",#+ c #4B453C", -"'#+ c #413B33", -")#+ c #49453D", -"!#+ c #2C2A22", -"~#+ c #28231B", -"{#+ c #2B261D", -"]#+ c #363227", -"^#+ c #514A3E", -"/#+ c #5F5549", -"(#+ c #655A4E", -"_#+ c #665E51", -":#+ c #675F50", -"<#+ c #6D6556", -"[#+ c #787063", -"}#+ c #7E7668", -"|#+ c #6D644F", -"1#+ c #7D7463", -"2#+ c #7E7363", -"3#+ c #7D7060", -"4#+ c #867566", -"5#+ c #837160", -"6#+ c #877363", -"7#+ c #766053", -"8#+ c #736254", -"9#+ c #8D7E70", -"0#+ c #745C4C", -"a#+ c #745F56", -"b#+ c #675042", -"c#+ c #705039", -"d#+ c #7A523B", -"e#+ c #79543D", -"f#+ c #7F5E4A", -"g#+ c #896B55", -"h#+ c #866D54", -"i#+ c #504C4F", -"j#+ c #38383E", -"k#+ c #414148", -"l#+ c #3A393E", -"m#+ c #765523", -"n#+ c #7A5624", -"o#+ c #3B3C3D", -"p#+ c #37393F", -"q#+ c #34363E", -"r#+ c #27292E", -"s#+ c #1F2020", -"t#+ c #070B0B", -"u#+ c #060A0B", -"v#+ c #070B0C", -"w#+ c #090B0E", -"x#+ c #16171B", -"y#+ c #31323A", -"z#+ c #25262B", -"A#+ c #3F3F47", -"B#+ c #25252B", -"C#+ c #1F252F", -"D#+ c #080D24", -"E#+ c #04040B", -"F#+ c #06060D", -"G#+ c #02030A", -"H#+ c #03050A", -"I#+ c #1F1B1C", -"J#+ c #312B27", -"K#+ c #34312C", -"L#+ c #35332E", -"M#+ c #34302C", -"N#+ c #2E2925", -"O#+ c #2C2824", -"P#+ c #302B23", -"Q#+ c #30281E", -"R#+ c #31291E", -"S#+ c #332F21", -"T#+ c #353125", -"U#+ c #363127", -"V#+ c #37332A", -"W#+ c #38342C", -"X#+ c #3A372E", -"Y#+ c #3B3831", -"Z#+ c #3D3A32", -"`#+ c #413D38", -" $+ c #3D342F", -".$+ c #382F29", -"+$+ c #423932", -"@$+ c #423933", -"#$+ c #413833", -"$$+ c #463E37", -"%$+ c #474038", -"&$+ c #494039", -"*$+ c #493F38", -"=$+ c #4B443A", -"-$+ c #524D43", -";$+ c #4D463E", -">$+ c #4D483F", -",$+ c #2B271E", -"'$+ c #2A261D", -")$+ c #333024", -"!$+ c #51493E", -"~$+ c #5C5145", -"{$+ c #665C50", -"]$+ c #675D51", -"^$+ c #62594C", -"/$+ c #686052", -"($+ c #686152", -"_$+ c #6C6555", -":$+ c #7B7466", -"<$+ c #7C7564", -"[$+ c #6C6651", -"}$+ c #6F6750", -"|$+ c #756D57", -"1$+ c #7A715D", -"2$+ c #776B57", -"3$+ c #847462", -"4$+ c #7E6C5A", -"5$+ c #7F6A5A", -"6$+ c #7A6356", -"7$+ c #6F594E", -"8$+ c #7E7063", -"9$+ c #908376", -"0$+ c #88786C", -"a$+ c #9E8A7D", -"b$+ c #846A59", -"c$+ c #6F523F", -"d$+ c #75533A", -"e$+ c #7D5A3E", -"f$+ c #72573D", -"g$+ c #866955", -"h$+ c #8B6B58", -"i$+ c #867060", -"j$+ c #837A77", -"k$+ c #48484F", -"l$+ c #303037", -"m$+ c #584429", -"n$+ c #745124", -"o$+ c #090D0E", -"p$+ c #121418", -"q$+ c #2E2F32", -"r$+ c #373A3E", -"s$+ c #100F15", -"t$+ c #1A1E20", -"u$+ c #1A2130", -"v$+ c #040721", -"w$+ c #12131A", -"x$+ c #0A0B0F", -"y$+ c #1B1718", -"z$+ c #35322D", -"A$+ c #373530", -"B$+ c #35342F", -"C$+ c #34322D", -"D$+ c #33322D", -"E$+ c #34322F", -"F$+ c #2D2B27", -"G$+ c #2B2823", -"H$+ c #2D2A25", -"I$+ c #332E2A", -"J$+ c #302E28", -"K$+ c #302B26", -"L$+ c #2F2A20", -"M$+ c #312A1E", -"N$+ c #342C1E", -"O$+ c #352E1D", -"P$+ c #352E1F", -"Q$+ c #362F22", -"R$+ c #373126", -"S$+ c #383329", -"T$+ c #3B362C", -"U$+ c #3B382F", -"V$+ c #3D3A31", -"W$+ c #3F3C33", -"X$+ c #413E39", -"Y$+ c #3C332E", -"Z$+ c #473E39", -"`$+ c #463E36", -" %+ c #464037", -".%+ c #4C433B", -"+%+ c #4E473D", -"@%+ c #524C42", -"#%+ c #4D473D", -"$%+ c #433E34", -"%%+ c #38342A", -"&%+ c #373328", -"*%+ c #50483C", -"=%+ c #5E5448", -"-%+ c #62584B", -";%+ c #736B5D", -">%+ c #6D6656", -",%+ c #716959", -"'%+ c #797164", -")%+ c #776F5F", -"!%+ c #726C57", -"~%+ c #716956", -"{%+ c #78705B", -"]%+ c #716950", -"^%+ c #7A6D55", -"/%+ c #7E6D57", -"(%+ c #76634E", -"_%+ c #7E6B58", -":%+ c #8A7565", -"<%+ c #866E61", -"[%+ c #836F65", -"}%+ c #9B8F83", -"|%+ c #8F8277", -"1%+ c #927D6E", -"2%+ c #67503C", -"3%+ c #71523E", -"4%+ c #78553A", -"5%+ c #785E3D", -"6%+ c #766046", -"7%+ c #896954", -"8%+ c #7B6252", -"9%+ c #867B75", -"0%+ c #4F4D4C", -"a%+ c #0E0B12", -"b%+ c #3C3C41", -"c%+ c #45454B", -"d%+ c #47474F", -"e%+ c #4A4A52", -"f%+ c #484850", -"g%+ c #4D4D55", -"h%+ c #343538", -"i%+ c #393D43", -"j%+ c #49403C", -"k%+ c #634823", -"l%+ c #3A3B3E", -"m%+ c #313236", -"n%+ c #2E2E36", -"o%+ c #38383D", -"p%+ c #44464E", -"q%+ c #35353B", -"r%+ c #18181C", -"s%+ c #22282C", -"t%+ c #0C1226", -"u%+ c #01041B", -"v%+ c #01051B", -"w%+ c #02020D", -"x%+ c #0B0B14", -"y%+ c #2B2C2B", -"z%+ c #2A282B", -"A%+ c #2C2B27", -"B%+ c #36342E", -"C%+ c #393633", -"D%+ c #373632", -"E%+ c #363531", -"F%+ c #33322C", -"G%+ c #302F29", -"H%+ c #2D2C26", -"I%+ c #2D2B26", -"J%+ c #32312B", -"K%+ c #343029", -"L%+ c #333029", -"M%+ c #33302A", -"N%+ c #323029", -"O%+ c #322F29", -"P%+ c #332E29", -"Q%+ c #322D28", -"R%+ c #322D26", -"S%+ c #322C20", -"T%+ c #332C1F", -"U%+ c #342C1C", -"V%+ c #342D1C", -"W%+ c #332C1C", -"X%+ c #362F20", -"Y%+ c #3A3125", -"Z%+ c #3C3529", -"`%+ c #3D362C", -" &+ c #3D3A30", -".&+ c #3E3C32", -"+&+ c #3F3E34", -"@&+ c #403D33", -"#&+ c #423C34", -"$&+ c #403931", -"%&+ c #403731", -"&&+ c #453C36", -"*&+ c #403831", -"=&+ c #443D36", -"-&+ c #48403A", -";&+ c #473F36", -">&+ c #463F36", -",&+ c #4C453E", -"'&+ c #50493F", -")&+ c #564F45", -"!&+ c #585449", -"~&+ c #59554A", -"{&+ c #514C42", -"]&+ c #524A40", -"^&+ c #574E43", -"/&+ c #5D5247", -"(&+ c #5E5346", -"_&+ c #5B5042", -":&+ c #675B4E", -"<&+ c #665C4C", -"[&+ c #696150", -"}&+ c #686150", -"|&+ c #736D5E", -"1&+ c #706954", -"2&+ c #7A7161", -"3&+ c #7C725D", -"4&+ c #6F6247", -"5&+ c #78654C", -"6&+ c #7A664E", -"7&+ c #836C57", -"8&+ c #8D7663", -"9&+ c #8B7565", -"0&+ c #A29387", -"a&+ c #A6998E", -"b&+ c #907E72", -"c&+ c #8C7768", -"d&+ c #745F4D", -"e&+ c #67523C", -"f&+ c #70533D", -"g&+ c #765B3D", -"h&+ c #6F5D3D", -"i&+ c #806A52", -"j&+ c #856852", -"k&+ c #806F63", -"l&+ c #747171", -"m&+ c #4B4C52", -"n&+ c #4D4F54", -"o&+ c #4A4D51", -"p&+ c #46474D", -"q&+ c #3A3E46", -"r&+ c #363641", -"s&+ c #353940", -"t&+ c #3D3A3A", -"u&+ c #513F26", -"v&+ c #37363D", -"w&+ c #36383C", -"x&+ c #0B0C10", -"y&+ c #13171A", -"z&+ c #232935", -"A&+ c #0A0E23", -"B&+ c #15172A", -"C&+ c #0C0D1F", -"D&+ c #03040E", -"E&+ c #0F0F18", -"F&+ c #343536", -"G&+ c #262728", -"H&+ c #2E2D30", -"I&+ c #393731", -"J&+ c #393834", -"K&+ c #34332E", -"L&+ c #33322E", -"M&+ c #35342E", -"N&+ c #363530", -"O&+ c #36342F", -"P&+ c #36332C", -"Q&+ c #35322B", -"R&+ c #35302A", -"S&+ c #342F29", -"T&+ c #342E25", -"U&+ c #342E22", -"V&+ c #342F21", -"W&+ c #353022", -"X&+ c #373125", -"Y&+ c #383225", -"Z&+ c #3A3326", -"`&+ c #3C362A", -" *+ c #3C382D", -".*+ c #3E3B31", -"+*+ c #3F3B31", -"@*+ c #3E3A30", -"#*+ c #3F382E", -"$*+ c #423931", -"%*+ c #473E35", -"&*+ c #443A32", -"**+ c #474137", -"=*+ c #4A443B", -"-*+ c #4E4740", -";*+ c #524B41", -">*+ c #534B41", -",*+ c #585147", -"'*+ c #5A564B", -")*+ c #5C574D", -"!*+ c #5F584E", -"~*+ c #675D53", -"{*+ c #655C52", -"]*+ c #6B6156", -"^*+ c #6A5F52", -"/*+ c #605548", -"(*+ c #615649", -"_*+ c #665B4D", -":*+ c #706758", -"<*+ c #726B5C", -"[*+ c #756E5F", -"}*+ c #746C5A", -"|*+ c #716752", -"1*+ c #6C624B", -"2*+ c #6B5D43", -"3*+ c #716041", -"4*+ c #756145", -"5*+ c #78634A", -"6*+ c #78634B", -"7*+ c #7D6551", -"8*+ c #826B59", -"9*+ c #847060", -"0*+ c #97897C", -"a*+ c #8D7F72", -"b*+ c #7B6A5C", -"c*+ c #847160", -"d*+ c #68543E", -"e*+ c #644F36", -"f*+ c #72583E", -"g*+ c #6F5E40", -"h*+ c #726045", -"i*+ c #8D735D", -"j*+ c #918680", -"k*+ c #3C3A3C", -"l*+ c #4E4E56", -"m*+ c #505157", -"n*+ c #494C50", -"o*+ c #484952", -"p*+ c #4B4541", -"q*+ c #45494B", -"r*+ c #33343B", -"s*+ c #36343B", -"t*+ c #423628", -"u*+ c #353538", -"v*+ c #35383C", -"w*+ c #2F2F36", -"x*+ c #1B1C20", -"y*+ c #28282E", -"z*+ c #0D0C12", -"A*+ c #0C0D11", -"B*+ c #2A2D2C", -"C*+ c #1D202C", -"D*+ c #353645", -"E*+ c #3B3B46", -"F*+ c #1B1D2F", -"G*+ c #01020E", -"H*+ c #141720", -"I*+ c #1C1F27", -"J*+ c #04070F", -"K*+ c #02050D", -"L*+ c #070A11", -"M*+ c #070A10", -"N*+ c #15171C", -"O*+ c #282A2C", -"P*+ c #3C3A37", -"Q*+ c #3C3B37", -"R*+ c #3B3A36", -"S*+ c #373531", -"T*+ c #383430", -"U*+ c #37342F", -"V*+ c #36322B", -"W*+ c #353229", -"X*+ c #363228", -"Y*+ c #39352B", -"Z*+ c #3A362B", -"`*+ c #3B3629", -" =+ c #3C382B", -".=+ c #3D3B2F", -"+=+ c #3F3B2F", -"@=+ c #3F3A2E", -"#=+ c #3E392E", -"$=+ c #3E3A2F", -"%=+ c #40392F", -"&=+ c #42382F", -"*=+ c #463D34", -"==+ c #473E34", -"-=+ c #433931", -";=+ c #483E35", -">=+ c #4C463D", -",=+ c #514A41", -"'=+ c #534C42", -")=+ c #544D43", -"!=+ c #5C544A", -"~=+ c #5A554A", -"{=+ c #655C53", -"]=+ c #675D54", -"^=+ c #696156", -"/=+ c #676054", -"(=+ c #6F685C", -"_=+ c #6A6156", -":=+ c #6C6459", -"<=+ c #6F665A", -"[=+ c #6F6458", -"}=+ c #73695C", -"|=+ c #786F62", -"1=+ c #6E6558", -"2=+ c #7B705F", -"3=+ c #736651", -"4=+ c #6B5C43", -"5=+ c #726147", -"6=+ c #765F46", -"7=+ c #765F47", -"8=+ c #725A44", -"9=+ c #78614F", -"0=+ c #776659", -"a=+ c #817263", -"b=+ c #847564", -"c=+ c #6D5C48", -"d=+ c #6C5841", -"e=+ c #675237", -"f=+ c #685A40", -"g=+ c #7A634D", -"h=+ c #928075", -"i=+ c #666161", -"j=+ c #47484C", -"k=+ c #4E4F53", -"l=+ c #4F5055", -"m=+ c #4E4F55", -"n=+ c #504F56", -"o=+ c #4D4A44", -"p=+ c #655536", -"q=+ c #46464A", -"r=+ c #302F38", -"s=+ c #3E372D", -"t=+ c #34363C", -"u=+ c #242626", -"v=+ c #333740", -"w=+ c #443F35", -"x=+ c #454241", -"y=+ c #313234", -"z=+ c #484B50", -"A=+ c #494D54", -"B=+ c #191A17", -"C=+ c #353B35", -"D=+ c #0A0C21", -"E=+ c #333242", -"F=+ c #4D4A53", -"G=+ c #222335", -"H=+ c #010519", -"I=+ c #25262C", -"J=+ c #111118", -"K=+ c #030510", -"L=+ c #00040B", -"M=+ c #00040A", -"N=+ c #01040A", -"O=+ c #0A0D12", -"P=+ c #1C1E21", -"Q=+ c #2A2823", -"R=+ c #39352D", -"S=+ c #3E3C37", -"T=+ c #3E3D39", -"U=+ c #3D3C38", -"V=+ c #3A3934", -"W=+ c #3A3834", -"X=+ c #3A3734", -"Y=+ c #383533", -"Z=+ c #3A3632", -"`=+ c #393531", -" -+ c #38352F", -".-+ c #37342E", -"+-+ c #37352E", -"@-+ c #3A372F", -"#-+ c #3A372D", -"$-+ c #3D392F", -"%-+ c #40392D", -"&-+ c #40372B", -"*-+ c #40382C", -"=-+ c #40352D", -"--+ c #3F332B", -";-+ c #3D332B", -">-+ c #413930", -",-+ c #453A31", -"'-+ c #3E342B", -")-+ c #484138", -"!-+ c #4B453D", -"~-+ c #544D45", -"{-+ c #575048", -"]-+ c #585148", -"^-+ c #595248", -"/-+ c #5D554C", -"(-+ c #585246", -"_-+ c #595345", -":-+ c #5F574D", -"<-+ c #62594F", -"[-+ c #685E53", -"}-+ c #6C685E", -"|-+ c #676155", -"1-+ c #685F52", -"2-+ c #6F675A", -"3-+ c #70685A", -"4-+ c #6C6353", -"5-+ c #7C705E", -"6-+ c #71634F", -"7-+ c #74624D", -"8-+ c #7C6753", -"9-+ c #775F4C", -"0-+ c #755D48", -"a-+ c #735C49", -"b-+ c #897767", -"c-+ c #8D7C6D", -"d-+ c #7A6A5B", -"e-+ c #938576", -"f-+ c #766856", -"g-+ c #695942", -"h-+ c #6B583C", -"i-+ c #695A3A", -"j-+ c #69553D", -"k-+ c #7C624F", -"l-+ c #957F6E", -"m-+ c #89807C", -"n-+ c #4A4950", -"o-+ c #4C4C54", -"p-+ c #4F4F57", -"q-+ c #505058", -"r-+ c #515158", -"s-+ c #4F4D53", -"t-+ c #524635", -"u-+ c #695129", -"v-+ c #48474B", -"w-+ c #3C3C45", -"x-+ c #35363F", -"y-+ c #383735", -"z-+ c #3B3C3B", -"A-+ c #35373F", -"B-+ c #4B3F2D", -"C-+ c #3E3C3B", -"D-+ c #424447", -"E-+ c #404346", -"F-+ c #161619", -"G-+ c #303439", -"H-+ c #060822", -"I-+ c #242437", -"J-+ c #504D57", -"K-+ c #2F2E3D", -"L-+ c #1D1F30", -"M-+ c #090B1D", -"N-+ c #11111A", -"O-+ c #212129", -"P-+ c #00040D", -"Q-+ c #03060B", -"R-+ c #111417", -"S-+ c #2A2723", -"T-+ c #3C372D", -"U-+ c #3F3E37", -"V-+ c #403F3B", -"W-+ c #3D3C37", -"X-+ c #3C3B36", -"Y-+ c #3B3934", -"Z-+ c #3A3733", -"`-+ c #3A3633", -" ;+ c #3B3833", -".;+ c #3A3732", -"+;+ c #393631", -"@;+ c #3A3830", -"#;+ c #39352C", -"$;+ c #39352A", -"%;+ c #403B34", -"&;+ c #40392E", -"*;+ c #40382B", -"=;+ c #41362D", -"-;+ c #42352D", -";;+ c #42372E", -">;+ c #484035", -",;+ c #473B31", -"';+ c #443B32", -");+ c #443D34", -"!;+ c #544D42", -"~;+ c #555047", -"{;+ c #57524B", -"];+ c #59524A", -"^;+ c #575047", -"/;+ c #5B554A", -"(;+ c #5B5449", -"_;+ c #5B5448", -":;+ c #60584D", -"<;+ c #61594E", -"[;+ c #655C50", -"};+ c #6A6155", -"|;+ c #665F50", -"1;+ c #665C4D", -"2;+ c #6B6052", -"3;+ c #726B5F", -"4;+ c #766B5C", -"5;+ c #746857", -"6;+ c #736553", -"7;+ c #776451", -"8;+ c #786350", -"9;+ c #705947", -"0;+ c #6F5947", -"a;+ c #8E8071", -"b;+ c #8E8070", -"c;+ c #8D7E6F", -"d;+ c #96897B", -"e;+ c #847767", -"f;+ c #5E4F3B", -"g;+ c #665A41", -"h;+ c #64593C", -"i;+ c #6C5E40", -"j;+ c #6F5A3F", -"k;+ c #795D46", -"l;+ c #917965", -"m;+ c #8F807E", -"n;+ c #514A54", -"o;+ c #333238", -"p;+ c #53535B", -"q;+ c #5F5349", -"r;+ c #785629", -"s;+ c #805C2A", -"t;+ c #464447", -"u;+ c #3C3C3F", -"v;+ c #4B3927", -"w;+ c #37373C", -"x;+ c #3A3F48", -"y;+ c #151412", -"z;+ c #424448", -"A;+ c #2C2F2A", -"B;+ c #292C35", -"C;+ c #080924", -"D;+ c #040621", -"E;+ c #040824", -"F;+ c #11112A", -"G;+ c #444350", -"H;+ c #413F4B", -"I;+ c #484856", -"J;+ c #2A2C3B", -"K;+ c #090C14", -"L;+ c #12141D", -"M;+ c #070915", -"N;+ c #010409", -"O;+ c #06090E", -"P;+ c #0C0F14", -"Q;+ c #111316", -"R;+ c #282520", -"S;+ c #3E392F", -"T;+ c #403F38", -"U;+ c #3E3D38", -"V;+ c #3B3832", -"W;+ c #3C3933", -"X;+ c #3C3934", -"Y;+ c #393832", -"Z;+ c #3D392E", -"`;+ c #403C34", -" >+ c #403B30", -".>+ c #403A2F", -"+>+ c #413B31", -"@>+ c #433C32", -"#>+ c #433A31", -"$>+ c #443930", -"%>+ c #43382F", -"&>+ c #463E34", -"*>+ c #473F34", -"=>+ c #453930", -"->+ c #3D3229", -";>+ c #473D33", -">>+ c #534D44", -",>+ c #56534C", -"'>+ c #58544E", -")>+ c #59534B", -"!>+ c #5C564A", -"~>+ c #585144", -"{>+ c #5A5448", -"]>+ c #5F584F", -"^>+ c #625A4F", -"/>+ c #675F54", -"(>+ c #6B665A", -"_>+ c #625D50", -":>+ c #615643", -"<>+ c #65584A", -"[>+ c #6C5F51", -"}>+ c #6E6054", -"|>+ c #786D64", -"1>+ c #75685C", -"2>+ c #685A4B", -"3>+ c #6F5F4D", -"4>+ c #715F4B", -"5>+ c #715C49", -"6>+ c #715B48", -"7>+ c #665342", -"8>+ c #7B6C5C", -"9>+ c #7D7266", -"0>+ c #908476", -"a>+ c #958878", -"b>+ c #998D7D", -"c>+ c #8D8171", -"d>+ c #695D4A", -"e>+ c #5A4B35", -"f>+ c #5F5238", -"g>+ c #6B5E42", -"h>+ c #706143", -"i>+ c #957A63", -"j>+ c #958581", -"k>+ c #615E6A", -"l>+ c #1E1921", -"m>+ c #5B5B63", -"n>+ c #5A5A62", -"o>+ c #57575F", -"p>+ c #56575F", -"q>+ c #94682F", -"r>+ c #BB7819", -"s>+ c #9E6A26", -"t>+ c #4B4A49", -"u>+ c #3E4348", -"v>+ c #3C3B42", -"w>+ c #373A3F", -"x>+ c #1C1D20", -"y>+ c #1E1D1D", -"z>+ c #222424", -"A>+ c #4C423B", -"B>+ c #634B2B", -"C>+ c #383B43", -"D>+ c #29282A", -"E>+ c #333534", -"F>+ c #1E1F32", -"G>+ c #060724", -"H>+ c #1D1E31", -"I>+ c #41434E", -"J>+ c #343741", -"K>+ c #313443", -"L>+ c #242532", -"M>+ c #2A2A36", -"N>+ c #040415", -"O>+ c #00040C", -"P>+ c #01050B", -"Q>+ c #070B0E", -"R>+ c #15181B", -"S>+ c #36302B", -"T>+ c #403A2E", -"U>+ c #403C30", -"V>+ c #423E36", -"W>+ c #3F3D38", -"X>+ c #3D3B35", -"Y>+ c #3C3931", -"Z>+ c #3C3A32", -"`>+ c #3C3B32", -" ,+ c #3A3931", -".,+ c #3A3833", -"+,+ c #3C3A35", -"@,+ c #3C3731", -"#,+ c #3D3830", -"$,+ c #3F3931", -"%,+ c #3F3A30", -"&,+ c #403D35", -"*,+ c #413E35", -"=,+ c #3F3C32", -"-,+ c #453F36", -";,+ c #443C32", -">,+ c #473E33", -",,+ c #463B30", -"',+ c #45382D", -"),+ c #42352C", -"!,+ c #3F332A", -"~,+ c #4A3D32", -"{,+ c #4A3F34", -"],+ c #4F483E", -"^,+ c #555249", -"/,+ c #59554D", -"(,+ c #5A534A", -"_,+ c #585245", -":,+ c #575142", -"<,+ c #595446", -"[,+ c #666156", -"},+ c #655E53", -"|,+ c #60594E", -"1,+ c #686155", -"2,+ c #5B5444", -"3,+ c #645846", -"4,+ c #695C4D", -"5,+ c #695B4F", -"6,+ c #76695D", -"7,+ c #7C6E63", -"8,+ c #756559", -"9,+ c #665649", -"0,+ c #5F4E3E", -"a,+ c #6B5A48", -"b,+ c #705E4A", -"c,+ c #6F5A48", -"d,+ c #786352", -"e,+ c #766353", -"f,+ c #6A5A4C", -"g,+ c #7C6E60", -"h,+ c #84786B", -"i,+ c #95897B", -"j,+ c #827464", -"k,+ c #60523B", -"l,+ c #63543A", -"m,+ c #6E5C42", -"n,+ c #79654F", -"o,+ c #7B634A", -"p,+ c #987E5E", -"q,+ c #9D8F80", -"r,+ c #5F5B6A", -"s,+ c #212227", -"t,+ c #56585E", -"u,+ c #5A5D64", -"v,+ c #5D5F68", -"w,+ c #5D5D65", -"x,+ c #5C5B61", -"y,+ c #745E47", -"z,+ c #D18728", -"A,+ c #E39118", -"B,+ c #AF7425", -"C,+ c #4C4749", -"D,+ c #474B52", -"E,+ c #414149", -"F,+ c #46464B", -"G,+ c #6D4F2F", -"H,+ c #6F5228", -"I,+ c #3D404A", -"J,+ c #3E3B3A", -"K,+ c #1F1D2E", -"L,+ c #050626", -"M,+ c #181A30", -"N,+ c #2C2E40", -"O,+ c #181B30", -"P,+ c #22212F", -"Q,+ c #504F53", -"R,+ c #595658", -"S,+ c #514E50", -"T,+ c #343238", -"U,+ c #1B1B25", -"V,+ c #070817", -"W,+ c #030411", -"X,+ c #050712", -"Y,+ c #01050C", -"Z,+ c #0B0D13", -"`,+ c #15171A", -" '+ c #2D2B2A", -".'+ c #2C2522", -"+'+ c #41392D", -"@'+ c #433C31", -"#'+ c #433D34", -"$'+ c #413E37", -"%'+ c #3C362D", -"&'+ c #3C342B", -"*'+ c #3D352C", -"='+ c #3B342B", -"-'+ c #3A362C", -";'+ c #3C392F", -">'+ c #3C382F", -",'+ c #3D3A33", -"''+ c #3C3A33", -")'+ c #403932", -"!'+ c #413A32", -"~'+ c #403E36", -"{'+ c #413D35", -"]'+ c #423D35", -"^'+ c #433C34", -"/'+ c #403930", -"('+ c #423B32", -"_'+ c #453E33", -":'+ c #433B30", -"<'+ c #474036", -"['+ c #453B31", -"}'+ c #44392D", -"|'+ c #423429", -"1'+ c #413329", -"2'+ c #3E3127", -"3'+ c #3B2D23", -"4'+ c #46382D", -"5'+ c #4A3E32", -"6'+ c #524C41", -"7'+ c #544F44", -"8'+ c #585349", -"9'+ c #5B564C", -"0'+ c #585348", -"a'+ c #554F42", -"b'+ c #565041", -"c'+ c #5B5546", -"d'+ c #605A4E", -"e'+ c #625C51", -"f'+ c #625C4F", -"g'+ c #625C4C", -"h'+ c #615C4B", -"i'+ c #655F4E", -"j'+ c #605847", -"k'+ c #655A4A", -"l'+ c #645747", -"m'+ c #77695C", -"n'+ c #7B6C61", -"o'+ c #716154", -"p'+ c #675648", -"q'+ c #665344", -"r'+ c #6C5949", -"s'+ c #73604F", -"t'+ c #725F4B", -"u'+ c #6E5847", -"v'+ c #746150", -"w'+ c #6D5D4E", -"x'+ c #6D6052", -"y'+ c #84786A", -"z'+ c #95887A", -"A'+ c #8C7F70", -"B'+ c #716454", -"C'+ c #5A4B39", -"D'+ c #5C4B39", -"E'+ c #67553E", -"F'+ c #6B5943", -"G'+ c #76634D", -"H'+ c #80684F", -"I'+ c #8F7857", -"J'+ c #A38F78", -"K'+ c #6E6572", -"L'+ c #575B60", -"M'+ c #5E616A", -"N'+ c #5B5C63", -"O'+ c #8B6227", -"P'+ c #EC981E", -"Q'+ c #E89918", -"R'+ c #BC7F27", -"S'+ c #4E494A", -"T'+ c #515359", -"U'+ c #504A3E", -"V'+ c #9D651F", -"W'+ c #685133", -"X'+ c #41444E", -"Y'+ c #121010", -"Z'+ c #524745", -"`'+ c #1D182E", -" )+ c #050525", -".)+ c #0B0D2A", -"+)+ c #26283D", -"@)+ c #0F1127", -"#)+ c #03041B", -"$)+ c #010518", -"%)+ c #040519", -"&)+ c #46454B", -"*)+ c #686360", -"=)+ c #65615E", -"-)+ c #5B5859", -";)+ c #3D3C40", -">)+ c #151520", -",)+ c #14141F", -"')+ c #0A0B17", -"))+ c #060712", -"!)+ c #181822", -"~)+ c #14141B", -"{)+ c #05070D", -"])+ c #07090F", -"^)+ c #302F2E", -"/)+ c #37332B", -"()+ c #372F24", -"_)+ c #40372A", -":)+ c #433D35", -"<)+ c #3D3128", -"[)+ c #3B2F26", -"})+ c #393127", -"|)+ c #3C3329", -"1)+ c #3D352B", -"2)+ c #3D352D", -"3)+ c #3D352E", -"4)+ c #3E3930", -"5)+ c #3E3A32", -"6)+ c #3F3A32", -"7)+ c #403B32", -"8)+ c #403B33", -"9)+ c #413A31", -"0)+ c #413A30", -"a)+ c #403A32", -"b)+ c #413B30", -"c)+ c #443C31", -"d)+ c #453D32", -"e)+ c #474035", -"f)+ c #443B2E", -"g)+ c #473D31", -"h)+ c #43382C", -"i)+ c #43362A", -"j)+ c #46372C", -"k)+ c #433427", -"l)+ c #4A3C30", -"m)+ c #4B4135", -"n)+ c #4D4638", -"o)+ c #524B3E", -"p)+ c #544B41", -"q)+ c #544E43", -"r)+ c #544F43", -"s)+ c #554F43", -"t)+ c #575045", -"u)+ c #565042", -"v)+ c #565040", -"w)+ c #595346", -"x)+ c #5F584D", -"y)+ c #615A4F", -"z)+ c #635C50", -"A)+ c #666051", -"B)+ c #635545", -"C)+ c #6C5E50", -"D)+ c #7A6C5F", -"E)+ c #726458", -"F)+ c #685749", -"G)+ c #604D3D", -"H)+ c #6C5746", -"I)+ c #725C4D", -"J)+ c #715C4A", -"K)+ c #65503E", -"L)+ c #5C4735", -"M)+ c #5C4B3A", -"N)+ c #625544", -"O)+ c #7E7464", -"P)+ c #918779", -"Q)+ c #8F8576", -"R)+ c #6E6150", -"S)+ c #5D4E3C", -"T)+ c #5C4B37", -"U)+ c #5F4B39", -"V)+ c #6F5B45", -"W)+ c #7B6655", -"X)+ c #9A8668", -"Y)+ c #7A7475", -"Z)+ c #282635", -"`)+ c #434549", -" !+ c #656870", -".!+ c #5B5B62", -"+!+ c #472B11", -"@!+ c #C2811C", -"#!+ c #D98D1E", -"$!+ c #CE8A29", -"%!+ c #585555", -"&!+ c #50535C", -"*!+ c #303134", -"=!+ c #40414A", -"-!+ c #74532F", -";!+ c #BC771D", -">!+ c #635039", -",!+ c #4C4F59", -"'!+ c #484545", -")!+ c #2C2016", -"!!+ c #10110C", -"~!+ c #110E0F", -"{!+ c #262526", -"]!+ c #574C4A", -"^!+ c #1A182E", -"/!+ c #040527", -"(!+ c #050723", -"_!+ c #17192E", -":!+ c #1A1D2E", -"~+ c #544535", -",~+ c #786C5D", -"'~+ c #92877B", -")~+ c #685E4E", -"!~+ c #574937", -"~~+ c #5D4C38", -"{~+ c #624F39", -"]~+ c #66503A", -"^~+ c #755946", -"/~+ c #8A6F5F", -"(~+ c #7D6652", -"_~+ c #8F7253", -":~+ c #847372", -"<~+ c #2C2D3B", -"[~+ c #4C4C52", -"}~+ c #624215", -"|~+ c #C4811F", -"1~+ c #CE8C2C", -"2~+ c #625F60", -"3~+ c #4F535C", -"4~+ c #383A3E", -"5~+ c #2D2F36", -"6~+ c #44464B", -"7~+ c #A17123", -"8~+ c #C47F1B", -"9~+ c #675539", -"0~+ c #4E5259", -"a~+ c #4F535E", -"b~+ c #5B544F", -"c~+ c #9E6C28", -"d~+ c #4F3511", -"e~+ c #16100C", -"f~+ c #0D0C0B", -"g~+ c #0F0F0C", -"h~+ c #51453B", -"i~+ c #624F47", -"j~+ c #1D1327", -"k~+ c #040625", -"l~+ c #0E0F29", -"m~+ c #2D2E42", -"n~+ c #1E1F33", -"o~+ c #15162A", -"p~+ c #1B1B32", -"q~+ c #42444E", -"r~+ c #3B3B47", -"s~+ c #38373E", -"t~+ c #5B595B", -"u~+ c #605E5F", -"v~+ c #535255", -"w~+ c #3A383E", -"x~+ c #36353D", -"y~+ c #2F2E39", -"z~+ c #1E1D2A", -"A~+ c #2C2933", -"B~+ c #454448", -"C~+ c #1C1C28", -"D~+ c #25252E", -"E~+ c #2A2A31", -"F~+ c #28282F", -"G~+ c #201F26", -"H~+ c #353534", -"I~+ c #2C2C2A", -"J~+ c #24201A", -"K~+ c #352D22", -"L~+ c #3E362B", -"M~+ c #484137", -"N~+ c #362A21", -"O~+ c #382C24", -"P~+ c #3A3027", -"Q~+ c #3D2F25", -"R~+ c #3D3027", -"S~+ c #3D3028", -"T~+ c #3A3028", -"U~+ c #3E382E", -"V~+ c #3C352B", -"W~+ c #3D342B", -"X~+ c #3D352A", -"Y~+ c #3E362A", -"Z~+ c #3F382D", -"`~+ c #3F392E", -" {+ c #443B31", -".{+ c #41392E", -"+{+ c #3F372C", -"@{+ c #3F352B", -"#{+ c #40362C", -"${+ c #44382C", -"%{+ c #43372A", -"&{+ c #44392B", -"*{+ c #473D2E", -"={+ c #463C2D", -"-{+ c #463B2E", -";{+ c #4B3F33", -">{+ c #504438", -",{+ c #4D4337", -"'{+ c #4F473A", -"){+ c #4F463A", -"!{+ c #585045", -"~{+ c #554D44", -"{{+ c #534B42", -"]{+ c #564E41", -"^{+ c #635D51", -"/{+ c #6A665D", -"({+ c #696256", -"_{+ c #6A6358", -":{+ c #6F685F", -"<{+ c #716963", -"[{+ c #736A62", -"}{+ c #726860", -"|{+ c #736A60", -"1{+ c #706459", -"2{+ c #6F6256", -"3{+ c #786A60", -"4{+ c #75665A", -"5{+ c #5C4B3B", -"6{+ c #413020", -"7{+ c #403221", -"8{+ c #524232", -"9{+ c #67584A", -"0{+ c #897D6F", -"a{+ c #9A8D81", -"b{+ c #736556", -"c{+ c #554634", -"d{+ c #584430", -"e{+ c #654E39", -"f{+ c #6D543E", -"g{+ c #6E523B", -"h{+ c #74543F", -"i{+ c #836450", -"j{+ c #917058", -"k{+ c #887164", -"l{+ c #3E3A44", -"m{+ c #101217", -"n{+ c #11100F", -"o{+ c #20170D", -"p{+ c #93641F", -"q{+ c #BD8233", -"r{+ c #605C5E", -"s{+ c #4B5155", -"t{+ c #4E5057", -"u{+ c #292C30", -"v{+ c #37383C", -"w{+ c #323336", -"x{+ c #C38320", -"y{+ c #BA7A22", -"z{+ c #554B45", -"A{+ c #4A5157", -"B{+ c #585553", -"C{+ c #D18C29", -"D{+ c #A46A1B", -"E{+ c #68461E", -"F{+ c #372311", -"G{+ c #201916", -"H{+ c #6D5645", -"I{+ c #70534A", -"J{+ c #1E172A", -"K{+ c #15172F", -"L{+ c #2F2D44", -"M{+ c #4C4B5D", -"N{+ c #40404E", -"O{+ c #292A3D", -"P{+ c #3D3D49", -"Q{+ c #44424C", -"R{+ c #3F3E48", -"S{+ c #282732", -"T{+ c #101121", -"U{+ c #101020", -"V{+ c #444448", -"W{+ c #525150", -"X{+ c #3E3D40", -"Y{+ c #494847", -"Z{+ c #403F3F", -"`{+ c #2A292C", -" ]+ c #333334", -".]+ c #181813", -"+]+ c #2B281B", -"@]+ c #362E23", -"#]+ c #423F34", -"$]+ c #403A33", -"%]+ c #3C352C", -"&]+ c #3B332E", -"*]+ c #3D3530", -"=]+ c #3B342E", -"-]+ c #39312A", -";]+ c #392D24", -">]+ c #3A2D24", -",]+ c #3B2E25", -"']+ c #3B3228", -")]+ c #3F362D", -"!]+ c #3E352B", -"~]+ c #3F3529", -"{]+ c #41382F", -"]]+ c #433A30", -"^]+ c #483E34", -"/]+ c #443A30", -"(]+ c #463A30", -"_]+ c #43372C", -":]+ c #473A2D", -"<]+ c #473A2C", -"[]+ c #493C2E", -"}]+ c #4E4134", -"|]+ c #514539", -"1]+ c #4E4438", -"2]+ c #51483B", -"3]+ c #51493A", -"4]+ c #544D3E", -"5]+ c #575040", -"6]+ c #564E40", -"7]+ c #58554D", -"8]+ c #636059", -"9]+ c #6B675F", -"0]+ c #6C655C", -"a]+ c #5F544A", -"b]+ c #594E43", -"c]+ c #64584F", -"d]+ c #6E625B", -"e]+ c #716961", -"f]+ c #746B64", -"g]+ c #766D66", -"h]+ c #746C63", -"i]+ c #746A61", -"j]+ c #7E746A", -"k]+ c #776A60", -"l]+ c #6B5C51", -"m]+ c #58483A", -"n]+ c #4B3D2E", -"o]+ c #5A4E3E", -"p]+ c #6D5E4E", -"q]+ c #726455", -"r]+ c #8A7E70", -"s]+ c #817464", -"t]+ c #574432", -"u]+ c #5A412D", -"v]+ c #664833", -"w]+ c #6F4F39", -"x]+ c #77553D", -"y]+ c #7B593F", -"z]+ c #775A3F", -"A]+ c #907059", -"B]+ c #987664", -"C]+ c #131619", -"D]+ c #13110E", -"E]+ c #3B2C11", -"F]+ c #A57834", -"G]+ c #5D5758", -"H]+ c #51565F", -"I]+ c #52555D", -"J]+ c #2E3135", -"K]+ c #323538", -"L]+ c #3C4149", -"M]+ c #40444C", -"N]+ c #454B4F", -"O]+ c #775E37", -"P]+ c #C7811A", -"Q]+ c #B07824", -"R]+ c #4B4747", -"S]+ c #52555C", -"T]+ c #50555B", -"U]+ c #5C5C5D", -"V]+ c #D3902D", -"W]+ c #EB9A1E", -"X]+ c #D58D28", -"Y]+ c #956624", -"Z]+ c #2E2616", -"`]+ c #0E0F13", -" ^+ c #866857", -".^+ c #785952", -"+^+ c #1B132B", -"@^+ c #0C0C29", -"#^+ c #13122C", -"$^+ c #24243A", -"%^+ c #3B3C4D", -"&^+ c #383847", -"*^+ c #272838", -"=^+ c #373443", -"-^+ c #3D3A47", -";^+ c #423E4A", -">^+ c #131225", -",^+ c #121226", -"'^+ c #0A0B1B", -")^+ c #11111F", -"!^+ c #434245", -"~^+ c #5B5955", -"{^+ c #5A5754", -"]^+ c #4F4D4B", -"^^+ c #4A4745", -"/^+ c #504E4B", -"(^+ c #504F4C", -"_^+ c #4C4B4A", -":^+ c #383838", -"<^+ c #151511", -"[^+ c #212017", -"}^+ c #2E2A1E", -"|^+ c #2F2B1F", -"1^+ c #333025", -"2^+ c #3C3930", -"3^+ c #38332C", -"4^+ c #37322C", -"5^+ c #38332E", -"6^+ c #3B3630", -"7^+ c #3B352F", -"8^+ c #312720", -"9^+ c #30251C", -"0^+ c #34281F", -"a^+ c #382B22", -"b^+ c #3B3026", -"c^+ c #3C3126", -"d^+ c #3E3328", -"e^+ c #40352A", -"f^+ c #41382E", -"g^+ c #43392F", -"h^+ c #42392F", -"i^+ c #473E32", -"j^+ c #494035", -"k^+ c #4F4239", -"l^+ c #4B3E34", -"m^+ c #4E4137", -"n^+ c #524439", -"o^+ c #4F4136", -"p^+ c #504235", -"q^+ c #51463A", -"r^+ c #50453A", -"s^+ c #53493C", -"t^+ c #544B3D", -"u^+ c #544B3E", -"v^+ c #554B3E", -"w^+ c #574C3D", -"x^+ c #584F3F", -"y^+ c #584E3F", -"z^+ c #595043", -"A^+ c #5D5A55", -"B^+ c #65645F", -"C^+ c #6A6762", -"D^+ c #6B665F", -"E^+ c #675C53", -"F^+ c #63584E", -"G^+ c #584C42", -"H^+ c #6A5F56", -"I^+ c #6F685E", -"J^+ c #746D63", -"K^+ c #766F66", -"L^+ c #787067", -"M^+ c #756A5F", -"N^+ c #786C62", -"O^+ c #6D6055", -"P^+ c #64564B", -"Q^+ c #5E5043", -"R^+ c #65584B", -"S^+ c #726558", -"T^+ c #514535", -"U^+ c #4D3E2F", -"V^+ c #736253", -"W^+ c #5D4C3B", -"X^+ c #5F4733", -"Y^+ c #664532", -"Z^+ c #6E4C36", -"`^+ c #7B543A", -" /+ c #815D43", -"./+ c #815E44", -"+/+ c #85694C", -"@/+ c #95735D", -"#/+ c #64504A", -"$/+ c #1E1B22", -"%/+ c #3C3C3E", -"&/+ c #161612", -"*/+ c #141411", -"=/+ c #13120B", -"-/+ c #574326", -";/+ c #5B5658", -">/+ c #53565D", -",/+ c #33363A", -"'/+ c #2D3033", -")/+ c #40454C", -"!/+ c #444850", -"~/+ c #484A52", -"{/+ c #454B50", -"]/+ c #573E1C", -"^/+ c #A76E18", -"//+ c #9F6C27", -"(/+ c #494647", -"_/+ c #57585B", -":/+ c #BE8B37", -"(+ c #685D4E", -",(+ c #403523", -"'(+ c #473624", -")(+ c #533D2A", -"!(+ c #5C462F", -"~(+ c #664C35", -"{(+ c #724E37", -"](+ c #7E5238", -"^(+ c #745640", -"/(+ c #735A47", -"((+ c #845F48", -"_(+ c #8D674D", -":(+ c #74574B", -"<(+ c #282224", -"[(+ c #3D312C", -"}(+ c #3E3B40", -"|(+ c #1F1C1B", -"1(+ c #585660", -"2(+ c #50545C", -"3(+ c #3F4146", -"4(+ c #36393E", -"5(+ c #303337", -"6(+ c #202126", -"7(+ c #34373A", -"8(+ c #4C4F55", -"9(+ c #4B4D55", -"0(+ c #484B51", -"a(+ c #18150B", -"b(+ c #7D541D", -"c(+ c #825F2F", -"d(+ c #47464C", -"e(+ c #5E6168", -"f(+ c #B28B48", -"g(+ c #FDAF1F", -"h(+ c #EC9F24", -"i(+ c #624E31", -"j(+ c #8492A3", -"k(+ c #777E96", -"l(+ c #4B3E31", -"m(+ c #4E3D2A", -"n(+ c #2A1E11", -"o(+ c #161210", -"p(+ c #43382E", -"q(+ c #9C7B67", -"r(+ c #674F4F", -"s(+ c #0F0E27", -"t(+ c #050526", -"u(+ c #080A27", -"v(+ c #0E0E28", -"w(+ c #16162C", -"x(+ c #2C2C3D", -"y(+ c #323141", -"z(+ c #212132", -"A(+ c #121326", -"B(+ c #06091B", -"C(+ c #06091A", -"D(+ c #161824", -"E(+ c #141521", -"F(+ c #151422", -"G(+ c #23232F", -"H(+ c #2E2E35", -"I(+ c #22222A", -"J(+ c #494846", -"K(+ c #474644", -"L(+ c #4C4B48", -"M(+ c #3D3B37", -"N(+ c #33322B", -"O(+ c #2F2D26", -"P(+ c #38332D", -"Q(+ c #2C2821", -"R(+ c #322C26", -"S(+ c #332A24", -"T(+ c #2F261E", -"U(+ c #342920", -"V(+ c #362921", -"W(+ c #372920", -"X(+ c #3A2C23", -"Y(+ c #403229", -"Z(+ c #3E3225", -"`(+ c #433328", -" _+ c #433329", -"._+ c #433429", -"+_+ c #44342A", -"@_+ c #47392D", -"#_+ c #4B3E32", -"$_+ c #4B3D31", -"%_+ c #4B3F31", -"&_+ c #4A3E30", -"*_+ c #514436", -"=_+ c #514337", -"-_+ c #514435", -";_+ c #554838", -">_+ c #564939", -",_+ c #554837", -"'_+ c #574B39", -")_+ c #574B3A", -"!_+ c #56493A", -"~_+ c #5A4E41", -"{_+ c #584C40", -"]_+ c #5C5043", -"^_+ c #5B5045", -"/_+ c #5D534A", -"(_+ c #5F574F", -"__+ c #625C55", -":_+ c #67615B", -"<_+ c #635C54", -"[_+ c #554B42", -"}_+ c #696159", -"|_+ c #6A645C", -"1_+ c #6A645B", -"2_+ c #746D65", -"3_+ c #766F67", -"4_+ c #706961", -"5_+ c #776E65", -"6_+ c #6D6358", -"7_+ c #413626", -"8_+ c #372D1C", -"9_+ c #382F1E", -"0_+ c #3A3422", -"a_+ c #47422F", -"b_+ c #413B28", -"c_+ c #453723", -"d_+ c #4F3A25", -"e_+ c #573C26", -"f_+ c #674D34", -"g_+ c #68503D", -"h_+ c #77513B", -"i_+ c #7B5543", -"j_+ c #5A4B47", -"k_+ c #71584B", -"l_+ c #8A644E", -"m_+ c #8B6757", -"n_+ c #403430", -"o_+ c #2E251F", -"p_+ c #905F29", -"q_+ c #503414", -"r_+ c #1B1917", -"s_+ c #5B5B67", -"t_+ c #555964", -"u_+ c #54585F", -"v_+ c #3F4147", -"w_+ c #323639", -"x_+ c #0C0D0A", -"y_+ c #484A50", -"z_+ c #090D0D", -"A_+ c #452B12", -"B_+ c #725738", -"C_+ c #43454B", -"D_+ c #5F6269", -"E_+ c #AB8946", -"F_+ c #FBAE1E", -"G_+ c #ECA11E", -"H_+ c #66513A", -"I_+ c #C4CBD3", -"J_+ c #CAD0D9", -"K_+ c #5F5852", -"L_+ c #62462C", -"M_+ c #594326", -"N_+ c #40311C", -"O_+ c #373330", -"P_+ c #473C35", -"Q_+ c #8F7364", -"R_+ c #513F46", -"S_+ c #0A0A29", -"T_+ c #040626", -"U_+ c #020622", -"V_+ c #020621", -"W_+ c #02051E", -"X_+ c #03061D", -"Y_+ c #090A20", -"Z_+ c #0A0B21", -"`_+ c #07081F", -" :+ c #02061A", -".:+ c #020619", -"+:+ c #030417", -"@:+ c #141524", -"#:+ c #262832", -"$:+ c #2A2A34", -"%:+ c #22222C", -"&:+ c #202028", -"*:+ c #37383A", -"=:+ c #474846", -"-:+ c #444544", -";:+ c #474647", -">:+ c #424140", -",:+ c #44433D", -"':+ c #45443F", -"):+ c #36332D", -"!:+ c #38342E", -"~:+ c #39362F", -"{:+ c #2A261F", -"]:+ c #221C14", -"^:+ c #271E17", -"/:+ c #292017", -"(:+ c #33261E", -"_:+ c #36281E", -"::+ c #3A2D23", -"<:+ c #392D22", -"[:+ c #372C1F", -"}:+ c #3A2D20", -"|:+ c #37281E", -"1:+ c #3B2B21", -"2:+ c #3F2F24", -"3:+ c #433426", -"4:+ c #453628", -"5:+ c #47382A", -"6:+ c #4B3C2F", -"7:+ c #4C3E31", -"8:+ c #4B3F2F", -"9:+ c #4D4030", -"0:+ c #4C3F2F", -"a:+ c #4E3F31", -"b:+ c #504234", -"c:+ c #4D3E30", -"d:+ c #514333", -"e:+ c #4F4131", -"f:+ c #554736", -"g:+ c #564737", -"h:+ c #564735", -"i:+ c #574936", -"j:+ c #564936", -"k:+ c #5E5146", -"l:+ c #5D544B", -"m:+ c #655E57", -"n:+ c #655F57", -"o:+ c #675F57", -"p:+ c #6A6158", -"q:+ c #6B645D", -"r:+ c #706A64", -"s:+ c #757068", -"t:+ c #777269", -"u:+ c #787269", -"v:+ c #756D65", -"w:+ c #716861", -"x:+ c #786F67", -"y:+ c #70665D", -"z:+ c #574F43", -"A:+ c #3D3627", -"B:+ c #312C19", -"C:+ c #332E1B", -"D:+ c #37321F", -"E:+ c #36341F", -"F:+ c #393521", -"G:+ c #423A27", -"H:+ c #523F28", -"I:+ c #563E25", -"J:+ c #664A30", -"K:+ c #674E37", -"L:+ c #694E44", -"M:+ c #6E4E43", -"N:+ c #473A40", -"O:+ c #695756", -"P:+ c #8C6A57", -"Q:+ c #8F715D", -"R:+ c #51423D", -"S:+ c #151112", -"T:+ c #695036", -"U:+ c #DA8F27", -"V:+ c #B2761D", -"W:+ c #261E11", -"X:+ c #171714", -"Y:+ c #5F616B", -"Z:+ c #565A61", -"`:+ c #52565C", -" <+ c #4D4F55", -".<+ c #494B54", -"+<+ c #19110C", -"@<+ c #40444A", -"#<+ c #4E5157", -"$<+ c #91784D", -"%<+ c #F4AF24", -"&<+ c #EDA821", -"*<+ c #6A5841", -"=<+ c #D0D3DF", -"-<+ c #EDF0F3", -";<+ c #828086", -"><+ c #835E2D", -",<+ c #75542C", -"'<+ c #755025", -")<+ c #664A25", -"!<+ c #423622", -"~<+ c #433933", -"{<+ c #474045", -"]<+ c #0C0E2B", -"^<+ c #030626", -"/<+ c #030623", -"(<+ c #030622", -"_<+ c #030720", -":<+ c #20202B", -"<<+ c #2A2B32", -"[<+ c #27272E", -"}<+ c #1A1C25", -"|<+ c #21232B", -"1<+ c #373839", -"2<+ c #444542", -"3<+ c #494A46", -"4<+ c #4D4C48", -"5<+ c #4D4B46", -"6<+ c #474641", -"7<+ c #464540", -"8<+ c #45443E", -"9<+ c #434039", -"0<+ c #322F27", -"a<+ c #241A11", -"b<+ c #261B12", -"c<+ c #291C14", -"d<+ c #302218", -"e<+ c #362A1F", -"f<+ c #362C20", -"g<+ c #352B20", -"h<+ c #33291D", -"i<+ c #2E2419", -"j<+ c #2D2117", -"k<+ c #33251A", -"l<+ c #392A1D", -"m<+ c #3F3022", -"n<+ c #413224", -"o<+ c #48382B", -"p<+ c #4C3D2F", -"q<+ c #493D2F", -"r<+ c #493C2D", -"s<+ c #4A3D2D", -"t<+ c #483B2B", -"u<+ c #48392A", -"v<+ c #4A3B2C", -"w<+ c #463728", -"x<+ c #4C3C2D", -"y<+ c #4D3E2E", -"z<+ c #4E3F2F", -"A<+ c #4E402F", -"B<+ c #554635", -"C<+ c #524234", -"D<+ c #564636", -"E<+ c #554633", -"F<+ c #534432", -"G<+ c #534434", -"H<+ c #514237", -"I<+ c #594C43", -"J<+ c #625951", -"K<+ c #67625A", -"L<+ c #68635D", -"M<+ c #69645E", -"N<+ c #6A645D", -"O<+ c #6D665D", -"P<+ c #6A625A", -"Q<+ c #6D6660", -"R<+ c #766F69", -"S<+ c #79726C", -"T<+ c #777068", -"U<+ c #6A6359", -"V<+ c #6D645D", -"W<+ c #797169", -"X<+ c #393626", -"Y<+ c #2B2C1A", -"Z<+ c #2D2F1A", -"`<+ c #30321D", -" [+ c #333520", -".[+ c #3D3924", -"+[+ c #4F4532", -"@[+ c #695746", -"#[+ c #644833", -"$[+ c #63472F", -"%[+ c #695034", -"&[+ c #6A4E3A", -"*[+ c #6A4C40", -"=[+ c #3E333D", -"-[+ c #5E4D51", -";[+ c #886C58", -">[+ c #846B57", -",[+ c #4D403A", -"'[+ c #110E10", -")[+ c #B67C2D", -"![+ c #EF9E25", -"~[+ c #DB9225", -"{[+ c #624520", -"][+ c #231E1F", -"^[+ c #191617", -"/[+ c #5D5F6A", -"([+ c #5D6069", -"_[+ c #4B4E54", -":[+ c #2A2A2F", -"<[+ c #0D0C09", -"[[+ c #36373A", -"}[+ c #42444A", -"|[+ c #4A4C51", -"1[+ c #100D0D", -"2[+ c #54575E", -"3[+ c #55585F", -"4[+ c #595C63", -"5[+ c #53565C", -"6[+ c #555862", -"7[+ c #776752", -"8[+ c #F0B428", -"9[+ c #E9A91F", -"0[+ c #6F5B41", -"a[+ c #CED2DF", -"b[+ c #F7FAF8", -"c[+ c #97A3B5", -"d[+ c #6D5131", -"e[+ c #7D5727", -"f[+ c #7A5426", -"g[+ c #775422", -"h[+ c #634E29", -"i[+ c #272219", -"j[+ c #0D0D11", -"k[+ c #786B5D", -"l[+ c #474047", -"m[+ c #030624", -"n[+ c #030723", -"o[+ c #040720", -"p[+ c #050715", -"q[+ c #0C0F1B", -"r[+ c #11151E", -"s[+ c #22252B", -"t[+ c #27282E", -"u[+ c #464744", -"v[+ c #4E4D48", -"w[+ c #504F4A", -"x[+ c #4F4E49", -"y[+ c #4E4B44", -"z[+ c #4B4841", -"A[+ c #45423B", -"B[+ c #2F2920", -"C[+ c #231B12", -"D[+ c #22170E", -"E[+ c #281B13", -"F[+ c #2D1E16", -"G[+ c #31241B", -"H[+ c #362C22", -"I[+ c #31291F", -"J[+ c #2B2218", -"K[+ c #2A2016", -"L[+ c #2D2216", -"M[+ c #332719", -"N[+ c #36291C", -"O[+ c #36291D", -"P[+ c #403124", -"Q[+ c #453A2A", -"R[+ c #403625", -"S[+ c #423525", -"T[+ c #413525", -"U[+ c #463A2A", -"V[+ c #4B3E2E", -"W[+ c #463A2B", -"X[+ c #463A2D", -"Y[+ c #4A3C2F", -"Z[+ c #493A2D", -"`[+ c #493A2F", -" }+ c #4D3F35", -".}+ c #554A41", -"+}+ c #625C53", -"@}+ c #68645C", -"#}+ c #6A655F", -"$}+ c #6B6660", -"%}+ c #6C6760", -"&}+ c #6D6960", -"*}+ c #6C685F", -"=}+ c #6C675F", -"-}+ c #756E68", -";}+ c #7B746E", -">}+ c #79726B", -",}+ c #3E382C", -"'}+ c #4F493C", -")}+ c #686156", -"!}+ c #726C61", -"~}+ c #6F695E", -"{}+ c #5C584C", -"]}+ c #3A3B2A", -"^}+ c #2B311D", -"/}+ c #2D311B", -"(}+ c #323520", -"_}+ c #363823", -":}+ c #534A34", -"<}+ c #72624F", -"[}+ c #765F4E", -"}}+ c #7A5F4A", -"|}+ c #795E47", -"1}+ c #6B4E35", -"2}+ c #735138", -"3}+ c #5F4643", -"4}+ c #625154", -"5}+ c #8A6952", -"6}+ c #7A5F47", -"7}+ c #362B23", -"8}+ c #0B0A09", -"9}+ c #211E1F", -"0}+ c #7E5E35", -"a}+ c #E59B28", -"b}+ c #FAAF24", -"c}+ c #E9A324", -"d}+ c #625140", -"e}+ c #646E88", -"f}+ c #3C404F", -"g}+ c #191718", -"h}+ c #5B5E69", -"i}+ c #4A4C55", -"j}+ c #2B2B2E", -"k}+ c #212528", -"l}+ c #110F0E", -"m}+ c #242627", -"n}+ c #5B5E65", -"o}+ c #5B5E64", -"p}+ c #5A5D65", -"q}+ c #5C5E67", -"r}+ c #83755F", -"s}+ c #F2B726", -"t}+ c #EEB31C", -"u}+ c #6E5C3D", -"v}+ c #CAD1DD", -"w}+ c #F8FAF8", -"x}+ c #A9B5CD", -"y}+ c #7F613E", -"z}+ c #A46B24", -"A}+ c #6E4720", -"B}+ c #644420", -"C}+ c #5E4B2F", -"D}+ c #26221B", -"E}+ c #0E0B11", -"F}+ c #75675C", -"G}+ c #3D353E", -"H}+ c #060927", -"I}+ c #020727", -"J}+ c #040722", -"K}+ c #010517", -"L}+ c #060A15", -"M}+ c #0F141C", -"N}+ c #11171E", -"O}+ c #101320", -"P}+ c #10141C", -"Q}+ c #3A3C36", -"R}+ c #474743", -"S}+ c #4F4D47", -"T}+ c #4F4C45", -"U}+ c #39332B", -"V}+ c #2A2319", -"W}+ c #21190F", -"X}+ c #251C12", -"Y}+ c #2B1F16", -"Z}+ c #2B1D16", -"`}+ c #2D2118", -" |+ c #352B21", -".|+ c #362E24", -"+|+ c #322B20", -"@|+ c #2A2217", -"#|+ c #261E13", -"$|+ c #342A1D", -"%|+ c #32271C", -"&|+ c #34281D", -"*|+ c #3A2D22", -"=|+ c #38291D", -"-|+ c #382B1D", -";|+ c #413526", -">|+ c #433A29", -",|+ c #3E3624", -"'|+ c #39301F", -")|+ c #382E1E", -"!|+ c #3A2F20", -"~|+ c #3F3424", -"{|+ c #463C2B", -"]|+ c #473D2C", -"^|+ c #433729", -"/|+ c #3C3123", -"(|+ c #3B3023", -"_|+ c #342B1C", -":|+ c #31291B", -"<|+ c #322B1F", -"[|+ c #4F463C", -"}|+ c #5C534B", -"||+ c #625B52", -"1|+ c #6A665E", -"2|+ c #6B6761", -"3|+ c #6D6862", -"4|+ c #6E6963", -"5|+ c #6E6962", -"6|+ c #6F6B63", -"7|+ c #6F6961", -"8|+ c #6E685F", -"9|+ c #5C564D", -"0|+ c #3F392D", -"a|+ c #464234", -"b|+ c #494839", -"c|+ c #5A584A", -"d|+ c #595748", -"e|+ c #5D6051", -"f|+ c #494E3D", -"g|+ c #2F3522", -"h|+ c #363523", -"i|+ c #393623", -"j|+ c #433D2A", -"k|+ c #544431", -"l|+ c #5D4936", -"m|+ c #745C49", -"n|+ c #7F6953", -"o|+ c #79523E", -"p|+ c #7A5641", -"q|+ c #7B604E", -"r|+ c #987357", -"s|+ c #805E45", -"t|+ c #37291E", -"u|+ c #100D0B", -"v|+ c #534839", -"w|+ c #BC8636", -"x|+ c #F7B224", -"y|+ c #FCBF23", -"z|+ c #D89E2A", -"A|+ c #D5DCE9", -"B|+ c #788395", -"C|+ c #505358", -"D|+ c #60636D", -"E|+ c #53565F", -"F|+ c #100F0E", -"G|+ c #4E5159", -"H|+ c #26282C", -"I|+ c #585B62", -"J|+ c #565960", -"K|+ c #746C61", -"L|+ c #DBA52E", -"M|+ c #E4AA21", -"N|+ c #6A5C37", -"O|+ c #9BA9C0", -"P|+ c #A6B0BB", -"Q|+ c #6B788F", -"R|+ c #8B7450", -"S|+ c #DE931D", -"T|+ c #D1891D", -"U|+ c #C47F1E", -"V|+ c #7C5A32", -"W|+ c #232020", -"X|+ c #363131", -"Y|+ c #5D5251", -"Z|+ c #2B2538", -"`|+ c #020626", -" 1+ c #040724", -".1+ c #040622", -"+1+ c #030712", -"@1+ c #040813", -"#1+ c #010612", -"$1+ c #020912", -"%1+ c #0E1417", -"&1+ c #242721", -"*1+ c #383930", -"=1+ c #403F36", -"-1+ c #48443D", -";1+ c #48443C", -">1+ c #434038", -",1+ c #4A463D", -"'1+ c #2D291F", -")1+ c #241F13", -"!1+ c #2A2318", -"~1+ c #2C2419", -"{1+ c #2B2117", -"]1+ c #30261A", -"^1+ c #2A2418", -"/1+ c #262015", -"(1+ c #231D11", -"_1+ c #211B10", -":1+ c #272014", -"<1+ c #282116", -"[1+ c #342A20", -"}1+ c #33261D", -"|1+ c #2E2217", -"11+ c #2C2114", -"21+ c #34291A", -"31+ c #3A3222", -"41+ c #362F1E", -"51+ c #2C2514", -"61+ c #2B2416", -"71+ c #2F2519", -"81+ c #352A1E", -"91+ c #3C3323", -"01+ c #423928", -"a1+ c #3F3625", -"b1+ c #372D1F", -"c1+ c #32281D", -"d1+ c #4B463C", -"e1+ c #5A534B", -"f1+ c #625B53", -"g1+ c #655F58", -"h1+ c #67625C", -"i1+ c #6B6861", -"j1+ c #6C6962", -"k1+ c #6E6A64", -"l1+ c #5E594F", -"m1+ c #403D31", -"n1+ c #363326", -"o1+ c #393627", -"p1+ c #585447", -"q1+ c #4A493B", -"r1+ c #303021", -"s1+ c #3D402D", -"t1+ c #555644", -"u1+ c #5A5F4F", -"v1+ c #545748", -"w1+ c #4A4B3C", -"x1+ c #45422E", -"y1+ c #473F2A", -"z1+ c #4F412C", -"A1+ c #594835", -"B1+ c #7C6452", -"C1+ c #7E5F4D", -"D1+ c #73533E", -"E1+ c #77523D", -"F1+ c #7C513C", -"G1+ c #84573D", -"H1+ c #9A6C4E", -"I1+ c #86614A", -"J1+ c #3B2A1F", -"K1+ c #0F0C0E", -"L1+ c #3C3227", -"M1+ c #876B44", -"N1+ c #E19D29", -"O1+ c #FCB823", -"P1+ c #FABF23", -"Q1+ c #B58A3C", -"R1+ c #A3A8C1", -"S1+ c #F6F8FA", -"T1+ c #94A0BA", -"U1+ c #1E2025", -"V1+ c #5F636C", -"W1+ c #545861", -"X1+ c #4D5157", -"Y1+ c #404348", -"Z1+ c #1C1F18", -"`1+ c #5D6067", -" 2+ c #64676E", -".2+ c #5E6167", -"+2+ c #5E6064", -"@2+ c #C08E39", -"#2+ c #C88528", -"$2+ c #725939", -"%2+ c #5C7095", -"&2+ c #8491A4", -"*2+ c #A8B3C3", -"=2+ c #8D827E", -"-2+ c #E49F26", -";2+ c #FCA51F", -">2+ c #E0901C", -",2+ c #815D2E", -"'2+ c #322936", -")2+ c #13132E", -"!2+ c #040629", -"~2+ c #030628", -"{2+ c #000611", -"]2+ c #020710", -"^2+ c #05090F", -"/2+ c #0A0E0E", -"(2+ c #1F221A", -"_2+ c #2F3024", -":2+ c #3D3B31", -"<2+ c #312D23", -"[2+ c #272418", -"}2+ c #2D281C", -"|2+ c #2E291D", -"12+ c #252317", -"22+ c #29271A", -"32+ c #282718", -"42+ c #252416", -"52+ c #212012", -"62+ c #212013", -"72+ c #221E13", -"82+ c #221E14", -"92+ c #241E13", -"02+ c #2F281C", -"a2+ c #332A1F", -"b2+ c #352B22", -"c2+ c #2A2116", -"d2+ c #30271A", -"e2+ c #302A1C", -"f2+ c #2C2617", -"g2+ c #2E281A", -"h2+ c #312B1D", -"i2+ c #322B1E", -"j2+ c #342B1F", -"k2+ c #3B3222", -"l2+ c #362D1C", -"m2+ c #34281B", -"n2+ c #35281D", -"o2+ c #35281C", -"p2+ c #3C372B", -"q2+ c #49443A", -"r2+ c #615C54", -"s2+ c #6B6760", -"t2+ c #4E4C40", -"u2+ c #38372A", -"v2+ c #333324", -"w2+ c #262615", -"x2+ c #3A3B28", -"y2+ c #484938", -"z2+ c #2F3120", -"A2+ c #232815", -"B2+ c #353B27", -"C2+ c #525643", -"D2+ c #5A5B49", -"E2+ c #6C6B5A", -"F2+ c #6B6758", -"G2+ c #5E5949", -"H2+ c #5F5643", -"I2+ c #5D4E3B", -"J2+ c #624E3A", -"K2+ c #816351", -"L2+ c #78503F", -"M2+ c #754E3B", -"N2+ c #7A4F38", -"O2+ c #814F34", -"P2+ c #935C3E", -"Q2+ c #89624D", -"R2+ c #3B2C25", -"S2+ c #100C11", -"T2+ c #5F4B2C", -"U2+ c #805E35", -"V2+ c #A37224", -"W2+ c #E9A721", -"X2+ c #F6BB21", -"Y2+ c #998656", -"Z2+ c #CBD4E6", -"`2+ c #F9FAFC", -" 3+ c #95A1BC", -".3+ c #1C1F24", -"+3+ c #50535B", -"@3+ c #535760", -"#3+ c #575B64", -"$3+ c #4A4C54", -"%3+ c #424247", -"&3+ c #474A4F", -"*3+ c #4F5257", -"=3+ c #4D5055", -"-3+ c #070B09", -";3+ c #151712", -">3+ c #191C15", -",3+ c #6C6F76", -"'3+ c #676A71", -")3+ c #5A585C", -"!3+ c #B07F33", -"~3+ c #B1762C", -"{3+ c #684E31", -"]3+ c #7283AA", -"^3+ c #E6ECF5", -"/3+ c #F4F6F6", -"(3+ c #C78F2C", -"_3+ c #FDA820", -":3+ c #E7921F", -"<3+ c #7E5428", -"[3+ c #10101D", -"}3+ c #050729", -"|3+ c #030627", -"13+ c #030727", -"23+ c #000412", -"33+ c #090C19", -"43+ c #070B15", -"53+ c #26271D", -"63+ c #2C2C1E", -"73+ c #343324", -"83+ c #363428", -"93+ c #322F25", -"03+ c #29271D", -"a3+ c #242216", -"b3+ c #2F2C20", -"c3+ c #302D21", -"d3+ c #252619", -"e3+ c #2C2E20", -"f3+ c #282A1A", -"g3+ c #252718", -"h3+ c #222416", -"i3+ c #212115", -"j3+ c #1F1E13", -"k3+ c #242217", -"l3+ c #272317", -"m3+ c #292418", -"n3+ c #241E12", -"o3+ c #2E281D", -"p3+ c #2D271C", -"q3+ c #282217", -"r3+ c #231F13", -"s3+ c #272417", -"t3+ c #292518", -"u3+ c #2E2A1C", -"v3+ c #2A2417", -"w3+ c #292115", -"x3+ c #292212", -"y3+ c #2F2616", -"z3+ c #332919", -"A3+ c #34271B", -"B3+ c #382E23", -"C3+ c #413A2F", -"D3+ c #4B463B", -"E3+ c #5B554D", -"F3+ c #6A6760", -"G3+ c #69675E", -"H3+ c #65635B", -"I3+ c #626056", -"J3+ c #313022", -"K3+ c #575748", -"L3+ c #444634", -"M3+ c #232512", -"N3+ c #262915", -"O3+ c #222814", -"P3+ c #1F2712", -"Q3+ c #212B15", -"R3+ c #2A311C", -"S3+ c #3A3C29", -"T3+ c #595645", -"U3+ c #797263", -"V3+ c #776F61", -"W3+ c #706659", -"X3+ c #6E5E51", -"Y3+ c #695446", -"Z3+ c #826757", -"`3+ c #916F5D", -" 4+ c #8D6752", -".4+ c #7B5745", -"+4+ c #6C4638", -"@4+ c #784A33", -"#4+ c #8A5B3F", -"$4+ c #86644E", -"%4+ c #392E28", -"&4+ c #100C0D", -"*4+ c #514228", -"=4+ c #956A2D", -"-4+ c #795124", -";4+ c #B67626", -">4+ c #EAA629", -",4+ c #9B8F7D", -"'4+ c #E0E8F5", -")4+ c #FAFBFA", -"!4+ c #9BA3C1", -"~4+ c #5D6068", -"{4+ c #565A63", -"]4+ c #4A4B53", -"^4+ c #3B3124", -"/4+ c #393C3F", -"(4+ c #505457", -"_4+ c #060906", -":4+ c #070A06", -"<4+ c #4D4F5B", -"[4+ c #4F525B", -"}4+ c #4D5059", -"|4+ c #4B4F58", -"14+ c #575A61", -"24+ c #58473A", -"34+ c #533C20", -"44+ c #4E3F26", -"54+ c #525A72", -"64+ c #D9E0EE", -"74+ c #A5ABBE", -"84+ c #AA7C35", -"94+ c #FAAC20", -"04+ c #E29220", -"a4+ c #865D25", -"b4+ c #151110", -"c4+ c #0C0C17", -"d4+ c #050920", -"e4+ c #020728", -"f4+ c #020726", -"g4+ c #040725", -"h4+ c #050816", -"i4+ c #0E121E", -"j4+ c #070B16", -"k4+ c #050911", -"l4+ c #1E1F17", -"m4+ c #2F2E20", -"n4+ c #302E20", -"o4+ c #2F2B1D", -"p4+ c #2B2619", -"q4+ c #2F291E", -"r4+ c #3A3429", -"s4+ c #373227", -"t4+ c #323121", -"u4+ c #353426", -"v4+ c #313024", -"w4+ c #292B22", -"x4+ c #272A1F", -"y4+ c #222517", -"z4+ c #212314", -"A4+ c #1F2113", -"B4+ c #242517", -"C4+ c #242014", -"D4+ c #211D11", -"E4+ c #262416", -"F4+ c #1F1E12", -"G4+ c #211D16", -"H4+ c #28261D", -"I4+ c #2F2C22", -"J4+ c #322D21", -"K4+ c #2F291C", -"L4+ c #292313", -"M4+ c #2B2414", -"N4+ c #2F2617", -"O4+ c #312519", -"P4+ c #362B21", -"Q4+ c #393025", -"R4+ c #454034", -"S4+ c #464337", -"T4+ c #3C392D", -"U4+ c #383428", -"V4+ c #5D5A4F", -"W4+ c #555548", -"X4+ c #56574A", -"Y4+ c #444538", -"Z4+ c #3E3E32", -"`4+ c #3E3F31", -" 5+ c #3F4030", -".5+ c #525343", -"+5+ c #4D4F3D", -"@5+ c #2A2F19", -"#5+ c #242913", -"$5+ c #242A14", -"%5+ c #232A15", -"&5+ c #262E19", -"*5+ c #2C331F", -"=5+ c #41422E", -"-5+ c #635E4E", -";5+ c #807669", -">5+ c #877B6E", -",5+ c #86796D", -"'5+ c #7F7165", -")5+ c #7A6557", -"!5+ c #7A5E4C", -"~5+ c #7F5C46", -"{5+ c #81573F", -"]5+ c #8A5F47", -"^5+ c #6D5146", -"/5+ c #694E46", -"(5+ c #846351", -"_5+ c #867061", -":5+ c #3E342E", -"<5+ c #130F0E", -"[5+ c #45413D", -"}5+ c #8B6430", -"|5+ c #92682E", -"15+ c #9F6C2D", -"25+ c #C3842E", -"35+ c #878482", -"45+ c #BCC9D5", -"55+ c #EBF2F4", -"65+ c #95A1BF", -"75+ c #342E2B", -"85+ c #626671", -"95+ c #636772", -"05+ c #565A64", -"a5+ c #4D4F58", -"b5+ c #504E56", -"c5+ c #57575C", -"d5+ c #87622E", -"e5+ c #22180A", -"f5+ c #2D2F32", -"g5+ c #4E515A", -"h5+ c #565962", -"i5+ c #50545D", -"j5+ c #4A4E57", -"k5+ c #4D5159", -"l5+ c #48474C", -"m5+ c #191411", -"n5+ c #201912", -"o5+ c #282C33", -"p5+ c #A3ABC1", -"q5+ c #F7FBFA", -"r5+ c #AEB7CE", -"s5+ c #8A693D", -"t5+ c #F1A325", -"u5+ c #D88C27", -"v5+ c #765528", -"w5+ c #0C0D13", -"x5+ c #090A1E", -"y5+ c #050823", -"z5+ c #010725", -"A5+ c #040727", -"B5+ c #030620", -"C5+ c #121524", -"D5+ c #040815", -"E5+ c #030714", -"F5+ c #080B13", -"G5+ c #22201A", -"H5+ c #352B19", -"I5+ c #392F22", -"J5+ c #3E3427", -"K5+ c #41382A", -"L5+ c #413B2B", -"M5+ c #3D3729", -"N5+ c #3A342A", -"O5+ c #343431", -"P5+ c #32332B", -"Q5+ c #2F3224", -"R5+ c #27281A", -"S5+ c #232416", -"T5+ c #262618", -"U5+ c #272015", -"V5+ c #2F271C", -"W5+ c #342C21", -"X5+ c #2F281D", -"Y5+ c #312C23", -"Z5+ c #32302A", -"`5+ c #2E2D25", -" 6+ c #363329", -".6+ c #3D382C", -"+6+ c #484135", -"@6+ c #363120", -"#6+ c #2F2919", -"$6+ c #2E2717", -"%6+ c #352D1E", -"&6+ c #312B1C", -"*6+ c #332F20", -"=6+ c #312F20", -"-6+ c #373628", -";6+ c #39382A", -">6+ c #2F2D1E", -",6+ c #2E2B1C", -"'6+ c #2C2919", -")6+ c #2F2C1C", -"!6+ c #302E1D", -"~6+ c #313120", -"{6+ c #383928", -"]6+ c #434435", -"^6+ c #565748", -"/6+ c #616253", -"(6+ c #636454", -"_6+ c #424333", -":6+ c #272917", -"<6+ c #232812", -"[6+ c #252A14", -"}6+ c #282E18", -"|6+ c #313823", -"16+ c #404330", -"26+ c #514F3D", -"36+ c #6F6757", -"46+ c #847A6C", -"56+ c #8E8478", -"66+ c #928477", -"76+ c #8F7767", -"86+ c #836551", -"96+ c #845C45", -"06+ c #804E35", -"a6+ c #7E4D2F", -"b6+ c #85573E", -"c6+ c #775D56", -"d6+ c #917D73", -"e6+ c #553F29", -"f6+ c #82622A", -"g6+ c #8E642C", -"h6+ c #846038", -"i6+ c #7A8393", -"j6+ c #737F96", -"k6+ c #8493AD", -"l6+ c #6D80A9", -"m6+ c #554532", -"n6+ c #3D2E1B", -"o6+ c #606470", -"p6+ c #5A5E69", -"q6+ c #53575F", -"r6+ c #4F4E56", -"s6+ c #5A585B", -"t6+ c #B47B2D", -"u6+ c #593C13", -"v6+ c #272220", -"w6+ c #313337", -"x6+ c #525560", -"y6+ c #555861", -"z6+ c #4C5058", -"A6+ c #4C5258", -"B6+ c #120F11", -"C6+ c #575F74", -"D6+ c #DCE5EB", -"E6+ c #B0BED2", -"F6+ c #68533B", -"G6+ c #CE881E", -"H6+ c #E4931F", -"I6+ c #805A21", -"J6+ c #0A0C16", -"K6+ c #050922", -"L6+ c #03062A", -"M6+ c #020725", -"N6+ c #030722", -"O6+ c #030616", -"P6+ c #0B111F", -"Q6+ c #0B0F1C", -"R6+ c #0A0E1A", -"S6+ c #0A0D15", -"T6+ c #1F1E1A", -"U6+ c #342F22", -"V6+ c #3D3325", -"W6+ c #433725", -"X6+ c #433A28", -"Y6+ c #423929", -"Z6+ c #43392B", -"`6+ c #443D2E", -" 7+ c #3A3228", -".7+ c #3A3127", -"+7+ c #352D23", -"@7+ c #382B20", -"#7+ c #382B21", -"$7+ c #3D3A34", -"%7+ c #3E3C36", -"&7+ c #33312B", -"*7+ c #302B2B", -"=7+ c #2E292A", -"-7+ c #2A2523", -";7+ c #25221A", -">7+ c #292517", -",7+ c #332C1D", -"'7+ c #352F1F", -")7+ c #312E1D", -"!7+ c #32311E", -"~7+ c #2A2A19", -"{7+ c #2D2C1D", -"]7+ c #323120", -"^7+ c #2D2C19", -"/7+ c #2C2A1A", -"(7+ c #252413", -"_7+ c #272615", -":7+ c #3D3B2D", -"<7+ c #454637", -"[7+ c #3D3E2E", -"}7+ c #343625", -"|7+ c #343624", -"17+ c #383A28", -"27+ c #3C3E2E", -"37+ c #303322", -"47+ c #232715", -"57+ c #2A311A", -"67+ c #2A311D", -"77+ c #373B28", -"87+ c #555141", -"97+ c #6D6555", -"07+ c #908276", -"a7+ c #93867A", -"b7+ c #9B887A", -"c7+ c #987C6C", -"d7+ c #85634E", -"e7+ c #7E573E", -"f7+ c #804D32", -"g7+ c #824429", -"h7+ c #8A492D", -"i7+ c #8D5E41", -"j7+ c #958372", -"k7+ c #6B615C", -"l7+ c #272324", -"m7+ c #0E0D0C", -"n7+ c #2D2215", -"o7+ c #74542F", -"p7+ c #926835", -"q7+ c #BAC5D7", -"r7+ c #E5E7ED", -"s7+ c #9FAABE", -"t7+ c #5D6780", -"u7+ c #8E6835", -"v7+ c #835C2E", -"w7+ c #484542", -"x7+ c #626672", -"y7+ c #626670", -"z7+ c #5E6169", -"A7+ c #53565E", -"B7+ c #505057", -"C7+ c #5F5755", -"D7+ c #C28127", -"E7+ c #80561A", -"F7+ c #21180A", -"G7+ c #151111", -"H7+ c #150F0E", -"I7+ c #603F19", -"J7+ c #22180E", -"K7+ c #222120", -"L7+ c #5A5D66", -"M7+ c #545760", -"N7+ c #575A62", -"O7+ c #555860", -"P7+ c #2A2B2D", -"Q7+ c #222630", -"R7+ c #7F879C", -"S7+ c #7886A1", -"T7+ c #45362C", -"U7+ c #85571B", -"V7+ c #B66F19", -"W7+ c #7A5025", -"X7+ c #161214", -"Y7+ c #0E0D16", -"Z7+ c #02062B", -"`7+ c #030827", -" 8+ c #080C1B", -".8+ c #090C1B", -"+8+ c #0C0F1E", -"@8+ c #090C1A", -"#8+ c #0D1119", -"$8+ c #2F2D29", -"%8+ c #3C362C", -"&8+ c #454038", -"*8+ c #46403B", -"=8+ c #504841", -"-8+ c #4F4842", -";8+ c #423A36", -">8+ c #463C37", -",8+ c #463E39", -"'8+ c #413A37", -")8+ c #3C3839", -"!8+ c #3C393F", -"~8+ c #121323", -"{8+ c #0E0E1D", -"]8+ c #181925", -"^8+ c #332C21", -"/8+ c #362F26", -"(8+ c #322E26", -"_8+ c #2D2B25", -":8+ c #2C2825", -"<8+ c #2C2822", -"[8+ c #2C291F", -"}8+ c #262616", -"|8+ c #1E2013", -"18+ c #202313", -"28+ c #252813", -"38+ c #2A2B19", -"48+ c #252714", -"58+ c #232611", -"68+ c #222510", -"78+ c #252713", -"88+ c #303321", -"98+ c #272C1C", -"08+ c #232818", -"a8+ c #282C18", -"b8+ c #2B331C", -"c8+ c #384030", -"d8+ c #525041", -"e8+ c #6F6556", -"f8+ c #736959", -"g8+ c #7A695E", -"h8+ c #8D7B6F", -"i8+ c #9B8577", -"j8+ c #94705D", -"k8+ c #835741", -"l8+ c #764C31", -"m8+ c #7F4D30", -"n8+ c #844E2F", -"o8+ c #804F33", -"p8+ c #896047", -"q8+ c #806C5C", -"r8+ c #171110", -"s8+ c #523A22", -"t8+ c #7D5931", -"u8+ c #7D746A", -"v8+ c #FAFCF9", -"w8+ c #BEC9DF", -"x8+ c #D09430", -"y8+ c #D39331", -"z8+ c #8A775F", -"A8+ c #616570", -"B8+ c #656974", -"C8+ c #696D78", -"D8+ c #62656E", -"E8+ c #54575F", -"F8+ c #66574E", -"G8+ c #D28C23", -"H8+ c #B37620", -"I8+ c #523716", -"J8+ c #110E0C", -"K8+ c #3B2815", -"L8+ c #BA771A", -"M8+ c #533B1E", -"N8+ c #484E65", -"O8+ c #1D1C26", -"P8+ c #171513", -"Q8+ c #595C65", -"R8+ c #585B64", -"S8+ c #60646A", -"T8+ c #404145", -"U8+ c #2C200F", -"V8+ c #030828", -"W8+ c #040623", -"X8+ c #0A0D1C", -"Y8+ c #080C19", -"Z8+ c #0F131F", -"`8+ c #11151F", -" 9+ c #0C111A", -".9+ c #0A0F16", -"+9+ c #0C1018", -"@9+ c #11151C", -"#9+ c #151820", -"$9+ c #2D2E36", -"%9+ c #3E3E44", -"&9+ c #555355", -"*9+ c #565457", -"=9+ c #444247", -"-9+ c #35343B", -";9+ c #32313A", -">9+ c #2D2D37", -",9+ c #2E2F39", -"'9+ c #242634", -")9+ c #2D2E3C", -"!9+ c #302F3D", -"~9+ c #292834", -"{9+ c #282631", -"]9+ c #4D4C51", -"^9+ c #5B595C", -"/9+ c #565251", -"(9+ c #403D43", -"_9+ c #161421", -":9+ c #0B0B1E", -"<9+ c #0F0F1A", -"[9+ c #161620", -"}9+ c #1F2016", -"|9+ c #222110", -"19+ c #272512", -"29+ c #2C2918", -"39+ c #2F2C1B", -"49+ c #393725", -"59+ c #363622", -"69+ c #3E3D2A", -"79+ c #4E4C39", -"89+ c #433F2D", -"99+ c #2C2A19", -"09+ c #2A2A1A", -"a9+ c #303120", -"b9+ c #474638", -"c9+ c #666254", -"d9+ c #7E7465", -"e9+ c #6E5A4B", -"f9+ c #775B4C", -"g9+ c #886A5A", -"h9+ c #967461", -"i9+ c #815238", -"j9+ c #794228", -"k9+ c #7E4A2F", -"l9+ c #805036", -"m9+ c #7A5437", -"n9+ c #6E5941", -"o9+ c #131011", -"p9+ c #372C1D", -"q9+ c #6E5234", -"r9+ c #79777C", -"s9+ c #E8EDF4", -"t9+ c #F4F6F8", -"u9+ c #8F96AD", -"v9+ c #867025", -"w9+ c #E2B82C", -"x9+ c #E3B131", -"y9+ c #8B7B63", -"z9+ c #6B6F7A", -"A9+ c #6E727D", -"B9+ c #60646F", -"C9+ c #5C5F68", -"D9+ c #575A63", -"E9+ c #52545D", -"F9+ c #E29820", -"G9+ c #EF9B1F", -"H9+ c #A86F26", -"I9+ c #332310", -"J9+ c #6E4A1D", -"K9+ c #D48921", -"L9+ c #6D502F", -"M9+ c #7C8AA2", -"N9+ c #A8B9CD", -"O9+ c #2B3340", -"P9+ c #50545A", -"Q9+ c #5D6169", -"R9+ c #575964", -"S9+ c #494A50", -"T9+ c #1A1616", -"U9+ c #1B1818", -"V9+ c #45464A", -"W9+ c #0F0E0D", -"X9+ c #030729", -"Y9+ c #05071A", -"Z9+ c #010617", -"`9+ c #000617", -" 0+ c #000616", -".0+ c #010717", -"+0+ c #030919", -"@0+ c #060C1C", -"#0+ c #0C121F", -"$0+ c #161D26", -"%0+ c #242731", -"&0+ c #262834", -"*0+ c #222330", -"=0+ c #20202E", -"-0+ c #191828", -";0+ c #171627", -">0+ c #181C2A", -",0+ c #3D3D47", -"'0+ c #555156", -")0+ c #605B5E", -"!0+ c #666264", -"~0+ c #646062", -"{0+ c #5F5D5E", -"]0+ c #191A2A", -"^0+ c #010615", -"/0+ c #2A2512", -"(0+ c #2A2413", -"_0+ c #2B2514", -":0+ c #423C2A", -"<0+ c #393421", -"[0+ c #352E1C", -"}0+ c #433F2E", -"|0+ c #585346", -"10+ c #666058", -"20+ c #766A5E", -"30+ c #8A7A6B", -"40+ c #897968", -"50+ c #856A5A", -"60+ c #83614F", -"70+ c #916853", -"80+ c #875841", -"90+ c #7C462D", -"00+ c #824E38", -"a0+ c #755942", -"b0+ c #5A4937", -"c0+ c #2E2A20", -"d0+ c #120F14", -"e0+ c #19170E", -"f0+ c #55442C", -"g0+ c #767982", -"h0+ c #F0F4F6", -"i0+ c #D5DCE8", -"j0+ c #676263", -"k0+ c #C3A120", -"l0+ c #F7D825", -"m0+ c #DCBA3A", -"n0+ c #777377", -"o0+ c #6D717B", -"p0+ c #5E626D", -"q0+ c #61656F", -"r0+ c #62666F", -"s0+ c #5E6069", -"t0+ c #776957", -"u0+ c #EA9F25", -"v0+ c #FBA61F", -"w0+ c #D79029", -"x0+ c #785322", -"y0+ c #1A130B", -"z0+ c #080605", -"A0+ c #A26D27", -"B0+ c #DA8F23", -"C0+ c #6A573E", -"D0+ c #B8C3D2", -"E0+ c #DBE3ED", -"F0+ c #434D5E", -"G0+ c #646872", -"H0+ c #575B61", -"I0+ c #161613", -"J0+ c #171514", -"K0+ c #161514", -"L0+ c #0B0B1A", -"M0+ c #040822", -"N0+ c #030527", -"O0+ c #020824", -"P0+ c #02051A", -"Q0+ c #000716", -"R0+ c #000715", -"S0+ c #02081A", -"T0+ c #070A1C", -"U0+ c #1B1B2C", -"V0+ c #222133", -"W0+ c #34343F", -"X0+ c #646063", -"Y0+ c #6D6869", -"Z0+ c #585559", -"`0+ c #403E47", -" a+ c #2E2F3A", -".a+ c #010515", -"+a+ c #090A1A", -"@a+ c #2B2818", -"#a+ c #2F2A18", -"$a+ c #2D2B19", -"%a+ c #252612", -"&a+ c #2D2A17", -"*a+ c #2B2613", -"=a+ c #2D2814", -"-a+ c #2F2916", -";a+ c #342F1C", -">a+ c #383422", -",a+ c #463F2E", -"'a+ c #5C5242", -")a+ c #614F3F", -"!a+ c #5B4F3C", -"~a+ c #755F4D", -"{a+ c #7C624E", -"]a+ c #7F614C", -"^a+ c #7D5C47", -"/a+ c #896450", -"(a+ c #895941", -"_a+ c #7C452A", -":a+ c #7A492F", -"b+ c #774427", -",b+ c #734828", -"'b+ c #5B4028", -")b+ c #282319", -"!b+ c #303A48", -"~b+ c #627089", -"{b+ c #4F4540", -"]b+ c #C49426", -"^b+ c #FCD325", -"/b+ c #F4D42D", -"(b+ c #908561", -"_b+ c #676C79", -":b+ c #686C78", -"c+ c #38322D", -",c+ c #273443", -"'c+ c #191B1E", -")c+ c #271E1F", -"!c+ c #B97C27", -"~c+ c #FAAD20", -"{c+ c #DA9724", -"]c+ c #89878C", -"^c+ c #EAF2F6", -"/c+ c #F5F7F9", -"(c+ c #7D89A7", -"_c+ c #503B1E", -":c+ c #38322A", -"d+ c #493B30", -",d+ c #4E3D2F", -"'d+ c #433020", -")d+ c #392C19", -"!d+ c #3B301A", -"~d+ c #483420", -"{d+ c #4C331E", -"]d+ c #4F3520", -"^d+ c #583B25", -"/d+ c #654027", -"(d+ c #70442C", -"_d+ c #72422A", -":d+ c #714226", -"e+ c #5C5F65", -",e+ c #62656B", -"'e+ c #686B73", -")e+ c #666972", -"!e+ c #585962", -"~e+ c #44454E", -"{e+ c #493118", -"]e+ c #CF9731", -"^e+ c #FBCE2A", -"/e+ c #EFCA34", -"(e+ c #817D71", -"_e+ c #60656C", -":e+ c #696E78", -"f+ c #867D5B", -",f+ c #EDB126", -"'f+ c #EFBA21", -")f+ c #6B5A2E", -"!f+ c #A3A5BA", -"~f+ c #FBFDFB", -"{f+ c #BCC1CA", -"]f+ c #584B43", -"^f+ c #503F25", -"/f+ c #1A1814", -"(f+ c #10110E", -"_f+ c #120E0F", -":f+ c #544433", -"g+ c #ECC01D", -",g+ c #F8C823", -"'g+ c #9F8642", -")g+ c #565961", -"!g+ c #42464C", -"~g+ c #52565F", -"{g+ c #4B4F57", -"]g+ c #4C4E56", -"^g+ c #474A54", -"/g+ c #494F56", -"(g+ c #7E6E58", -"_g+ c #D69333", -":g+ c #DB9227", -"h+ c #040518", -",h+ c #020520", -"'h+ c #050725", -")h+ c #0B0D29", -"!h+ c #0E102E", -"~h+ c #121432", -"{h+ c #131433", -"]h+ c #101130", -"^h+ c #0D0E2C", -"/h+ c #060826", -"(h+ c #02071D", -"_h+ c #02061D", -":h+ c #07091F", -"i+ c #75787F", -",i+ c #74777E", -"'i+ c #7D8089", -")i+ c #7A7E87", -"!i+ c #7A7D85", -"~i+ c #1B1817", -"{i+ c #484242", -"]i+ c #696D76", -"^i+ c #70747D", -"/i+ c #656972", -"(i+ c #666872", -"_i+ c #3D4042", -":i+ c #563E22", -"j+ c #825C2E", -",j+ c #80582A", -"'j+ c #5B4530", -")j+ c #0F100C", -"!j+ c #10100D", -"~j+ c #151410", -"{j+ c #3F2E1F", -"]j+ c #644526", -"^j+ c #5D442B", -"/j+ c #684D31", -"(j+ c #6D6F77", -"_j+ c #E5ECF1", -":j+ c #CED7E1", -"k+ c #0A0C0F", -",k+ c #0A0C10", -"'k+ c #0B0A11", -")k+ c #0C0C12", -"!k+ c #15161C", -"~k+ c #18191F", -"{k+ c #1A1B21", -"]k+ c #1B1C22", -"^k+ c #1C1D23", -"/k+ c #1D1F23", -"(k+ c #1B1D21", -"_k+ c #4C4E53", -":k+ c #5B5F66", -"l+ c #D99331", -",l+ c #FBBD29", -"'l+ c #FDBF26", -")l+ c #C89B3C", -"!l+ c #606064", -"~l+ c #51565D", -"{l+ c #555960", -"]l+ c #53575D", -"^l+ c #464C53", -"/l+ c #50515D", -"(l+ c #5A544F", -"_l+ c #86612B", -":l+ c #5D4E37", -"m+ c #3D290E", -",m+ c #8C5C28", -"'m+ c #B17929", -")m+ c #D18624", -"!m+ c #E3A229", -"~m+ c #756A5C", -"{m+ c #4F525C", -"]m+ c #4F535D", -"^m+ c #53504F", -"/m+ c #484C51", -"(m+ c #343436", -"_m+ c #333335", -":m+ c #292428", -"n+ c #5A5F67", -",n+ c #62656F", -"'n+ c #696C76", -")n+ c #4B4B51", -"!n+ c #6E727B", -"~n+ c #71757E", -"{n+ c #1D1C1B", -"]n+ c #2D2A31", -"^n+ c #45465C", -"/n+ c #403C40", -"(n+ c #A27027", -"_n+ c #F2A022", -":n+ c #E2952B", -"o+ c #66431C", -",o+ c #654627", -"'o+ c #151214", -")o+ c #0C0F0C", -"!o+ c #110D11", -"~o+ c #0A0C0E", -"{o+ c #0A0C13", -"]o+ c #595C61", -"^o+ c #343437", -"/o+ c #3D3F43", -"(o+ c #44484C", -"_o+ c #363333", -":o+ c #AE9799", -"p+ c #22252E", -",p+ c #252833", -"'p+ c #2A2D3A", -")p+ c #2E3140", -"!p+ c #323647", -"~p+ c #363A4F", -"{p+ c #373B51", -"]p+ c #34384D", -"^p+ c #32364A", -"/p+ c #2F3245", -"(p+ c #2B2E3F", -"_p+ c #242735", -":p+ c #1B1D28", -"q+ c #6A6864", -",q+ c #29251B", -"'q+ c #E2E4E9", -")q+ c #F6F7F8", -"!q+ c #E4E5EA", -"~q+ c #DEDFE5", -"{q+ c #DDDEE4", -"]q+ c #DFE0E6", -"^q+ c #EAEBEF", -"/q+ c #EDEEF1", -"(q+ c #525769", -"_q+ c #1E2131", -":q+ c #1C1F2E", -"r+ c #212539", -",r+ c #191D2C", -"'r+ c #171A28", -")r+ c #171B27", -"!r+ c #A2A3AC", -"~r+ c #8D8F97", -"{r+ c #1B1E23", -"]r+ c #191C20", -"^r+ c #181B1F", -"/r+ c #16191C", -"(r+ c #595A60", -"_r+ c #E4E4E7", -":r+ c #ECECEE", -"s+ c #44464A", -",s+ c #E1E1E4", -"'s+ c #7D7E84", -")s+ c #1A1915", -"!s+ c #848487", -"~s+ c #FBFCFC", -"{s+ c #D1D1D4", -"]s+ c #292722", -"^s+ c #18150F", -"/s+ c #161410", -"(s+ c #1A160F", -"_s+ c #20190F", -":s+ c #1C180F", -"t+ c #1C170F", -",t+ c #1D170F", -"'t+ c #18140E", -")t+ c #1B160D", -"!t+ c #251D0F", -"~t+ c #1C1E1E", -"{t+ c #212222", -"]t+ c #25221C", -"^t+ c #292110", -"/t+ c #2C230F", -"(t+ c #2D240F", -"_t+ c #2A210F", -":t+ c #211A0E", -"u+ c #282B2B", -",u+ c #1B1A15", -"'u+ c #1F1A12", -")u+ c #1E1911", -"!u+ c #1A1711", -"~u+ c #1B1914", -"{u+ c #A2A3A3", -"]u+ c #3D3E3E", -"^u+ c #404141", -"/u+ c #313249", -"(u+ c #4F5284", -"_u+ c #404885", -":u+ c #3C426F", -"v+ c #6E6C69", -",v+ c #696B6B", -"'v+ c #666769", -")v+ c #55534A", -"!v+ c #4A4631", -"~v+ c #423D2A", -"{v+ c #35332A", -"]v+ c #2E2F30", -"^v+ c #27292A", -"/v+ c #1A1812", -"(v+ c #211A10", -"_v+ c #201A10", -":v+ c #201A0E", -"w+ c #4E504F", -",w+ c #474949", -"'w+ c #505253", -")w+ c #585A5A", -"!w+ c #5D5E5F", -"~w+ c #595B5B", -"{w+ c #5F6161", -"]w+ c #616363", -"^w+ c #606162", -"/w+ c #5E5F60", -"(w+ c #5E6060", -"_w+ c #5B5D5D", -":w+ c #606262", -"x+ c #797672", -",x+ c #938E86", -"'x+ c #8B8881", -")x+ c #888887", -"!x+ c #6B6D6E", -"~x+ c #7C7D7C", -"{x+ c #747676", -"]x+ c #545759", -"^x+ c #767778", -"/x+ c #7E7F7F", -"(x+ c #898A8A", -"_x+ c #737474", -":x+ c #737475", -"y+ c #7F8492", -",y+ c #7E8086", -"'y+ c #7A7B81", -")y+ c #F1F1F2", -"!y+ c #5F6065", -"~y+ c #838489", -"{y+ c #5C5D62", -"]y+ c #EBEBED", -"^y+ c #76787C", -"/y+ c #29220E", -"(y+ c #271F0F", -"_y+ c #1F1A0E", -":y+ c #161C21", -"z+ c #252941", -",z+ c #23273D", -"'z+ c #202437", -")z+ c #1C1F2D", -"!z+ c #161921", -"~z+ c #171920", -"{z+ c #83848A", -"]z+ c #4E4F54", -"^z+ c #8F9095", -"/z+ c #D6D6D9", -"(z+ c #1D1B14", -"_z+ c #261F0E", -":z+ c #1F1A0F", -"A+ c #898A89", -",A+ c #6C6E6D", -"'A+ c #7E7D7C", -")A+ c #8D8E8E", -"!A+ c #282A2A", -"~A+ c #1C2124", -"{A+ c #131517", -"]A+ c #2A2C40", -"^A+ c #3F477E", -"/A+ c #1B1E2C", -"(A+ c #161924", -"_A+ c #1B1F32", -":A+ c #2F324B", -"B+ c #10121A", -",B+ c #0D1013", -"'B+ c #0C0E12", -")B+ c #3B3F4A", -"!B+ c #8A8E9B", -"~B+ c #F9FAFB", -"{B+ c #696A6E", -"]B+ c #323436", -"^B+ c #8F9096", -"/B+ c #D2D2D6", -"(B+ c #323437", -"_B+ c #6A6C70", -":B+ c #D0D1D4", -"C+ c #23273C", -",C+ c #262941", -"'C+ c #252940", -")C+ c #8A8C99", -"!C+ c #F1F2F4", -"~C+ c #EAEBEE", -"{C+ c #E9E9ED", -"]C+ c #E8E8EC", -"^C+ c #ECECEF", -"/C+ c #EEEEF1", -"(C+ c #8B8C93", -"_C+ c #616267", -":C+ c #E5E6E9", -"D+ c #3C3324", -",D+ c #3D3622", -"'D+ c #3B3620", -")D+ c #3C3721", -"!D+ c #393520", -"~D+ c #2A2B2A", -"{D+ c #434546", -"]D+ c #3A4170", -"^D+ c #353B62", -"/D+ c #212437", -"(D+ c #0F1218", -"_D+ c #232740", -":D+ c #1F2336", -"E+ c #191D2A", -",E+ c #878891", -"'E+ c #C3C4C7", -")E+ c #74757B", -"!E+ c #28292B", -"~E+ c #A7A8AE", -"{E+ c #E8E8EA", -"]E+ c #B5B6BA", -"^E+ c #464749", -"/E+ c #3E4043", -"(E+ c #545558", -"_E+ c #C2C3C6", -":E+ c #4D4E54", -"F+ c #AAA8A4", -",F+ c #82817E", -"'F+ c #14161E", -")F+ c #21253B", -"!F+ c #AEAEB4", -"~F+ c #CDCDD2", -"{F+ c #D0D1D7", -"]F+ c #75798B", -"^F+ c #212530", -"/F+ c #201F17", -"(F+ c #2B250D", -"_F+ c #231D0E", -":F+ c #17150E", -" , @ ' ) ! ~ { { ] ^ ^ / ( ( ( _ { ! : : ! { < ! _ _ [ } | 1 2 3 4 5 6 = = = = = = = = = = = = = = 7 5 8 9 0 0 a 1 b c d e f f g h i j k l m n o = = = = = = = = = = = = = = = = = = = = = = = = p q r s t > , u ' ) { v w ( { ( w x y y y y y y x x x ( w ( w x y y y y y x x x w w w w w w ( x x x x y x w x x w ( ( ( ( ( w y y x w ( { _ ~ . z A B = = = = = = = = = = = = = = C + D E F G = = = = = = = = = = = = = = = H I J K L M N O P Q R S T U V W X Y Y Z Z ` . .. +. +. Y @. Y #. $. %. &. *. =. -. ;. >. ,. '. ). !. ~. {. ]. ^. [ x x w w w x w w x x x x /. (. _. :. :. :. <. [ x w w x w w x w ( ( ( { { ( ( ( _ { _ { < < ) { < : ! { { _ ( _ _ ] ( { ( ", -"[. u }. |. @ 1. 2. = = = = = = = = = = = = = = = = = = = = 3. 4. 5. A }. u ' : < ~ _ _ 6. 5. 7. ! ! < : ' + 8. ' . . ' ' ) ! 9. 0 0. 0 a. b. c. 5 6 = = = = = = = = = = = = = = d. e. 8 f. 9 | g. | h. i. j. k. l. m. n. o. p. q. r. s. t. n u. = = = = = = = = = = = = = = = = = = = = = = = = = = v. w. x. }. A z y. ' : { v w w w w x y y y y y x w w ( x x w x x y y y y y x x x x w w w w w w w w x x y x x y y x x w ( ( ( w y y x x w ( _ ~ . z A B = = = = = = = = = = = = = = C + D z. F & = = = = = = = = = = = = = = = A. B. C. D. E. N F. G. H. I. J. K. G. L. U M. N. O. Z P. P. ` +. ` Y P. .. Q. +. R. S. T. U. Q V. W. X. Y. Z. `. ). !. + .+ ++ @+ x x w ( w x w w w w w w x /. (. _. :. :. :. <. x x x w x w w x w ( ( w ( ( { { ~ < ) : #+ : . . : #+ ' . : : ) ! < < ! ( _ _ ", -"u }. A $+ %+ = = = = = = = = = = = = = = = = = = = = = = = = &+ *+ , z + ' ) { _ =+ -+ ;+ >+ ' ,+ + y. u u u + y. u u u [. ' ! '+ 1 )+ !+ ~+ {+ 5 6 = = = = = = = = = = = = = = ]+ ^+ /+ (+ )+ d _+ :+ <+ [+ }+ |+ 1+ 2+ 3+ 4+ 5+ 2+ 6+ /+ c. n 7+ = = = = = = = = = = = = = = = = = = = = = = = = = = = = 8+ 9+ @ , z + #+ ! { { ( ( w x y y y y y x w ( w y x x x y 0+ 0+ a+ x x x x x x w w w w w w w w x y y y y y y x w b+ w ( ( [ a+ a+ x w ( { { ~ ' }. |. B = = = = = = = = = = = = = = c+ + z. z. u & = = = = = = = = = = = = = = = A. d+ e+ K f+ g+ h+ i+ j+ k+ l+ m+ n+ o+ p+ q+ r+ s+ t+ u+ Q. . .. Q. v+ Z +. Q. +. @. ` w+ x+ y+ z+ >. A+ B+ C+ D+ E+ ~. F+ .+ G+ H+ w w w ( ( w x x w ( ( w x a+ (. _. _. _. _. (. x x x x x x x x w ( w w ( ( { ~ < : ' + + [. y. y. + + + y. y. + [. ,+ ' . : ! _ v ", -"I+ A , 4. J+ = = = = = = = = = = = = = = = = = = = = = = = = v. K+ =+ , @ ,+ L+ 7. 7. L+ ,+ y. M+ N+ }. O+ , , , P+ P+ , , , P+ I+ Q+ ' r. 5+ R+ S+ T+ U+ V+ 6 = = = = = = = = = = = = = = W+ X+ 3+ Y+ 4+ Z+ `+ f @ .@ +@ @ c @@ #@ $@ %@ &@ /+ r. m *@ =@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -@ ;@ }. P+ u . #+ : { w w w x y y y y x w w ( w x x y y y >@ 0+ a+ x w w ( w x w ( w x x x [ [ ,@ y y y y y y 0+ ,@ ,@ '@ w w [ (. (. (. x w ( ~ : [. z A B = = = = = = = = = = = = = = c+ + E E u & = = = = = = = = = = = = = = = )@ !@ ~@ {@ r+ ]@ ^@ /@ (@ _@ P :@ <@ N ]@ N [@ Y @. }@ |@ 1@ 2@ s+ 3@ 4@ ` .. Q. Q. ` ` .. 5@ 6@ 7@ 8@ 9@ 0@ a@ b@ c@ a@ c@ d@ e@ b+ 9. ( ( w w x x x w ( w x a+ y y y y f@ g@ h@ h@ /. x x x w w w w ( ( ( < { ! : [. y. z P+ }. P+ , }. }. P+ P+ P+ I+ }. }. i@ y. j@ D 6. ^ ", -"|. > k@ l@ = = = = = = = = = = = = = = = = = = = = = = = = = = v. m@ M+ I+ y. ,+ ;+ ;+ >+ u n@ r r o@ o@ o@ o@ o@ o@ o@ o@ o@ o@ o@ p@ q@ u r@ !+ 6+ %@ T+ s@ t@ u@ = = = = = = = = = = = = = = v@ ^+ w@ x@ y@ z@ f A@ m. B@ B@ @ C@ D@ E@ F@ %@ q. G@ H@ s. ^+ I@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = B J@ A z K@ ' < ] w [ x x y y y y x w w ( w x y y L@ M@ >@ >@ a+ x x w w w x w w x y y y >@ >@ >@ y y y y y y y >@ >@ [ x x [ _. _. (. x w ( { ) [. z A B = = = = = = = = = = = = = = c+ + E E u G = = = = = = = = = = = = = = = )@ N@ O@ P@ Q@ R@ /@ /@ S@ T@ H. U@ V@ N p+ W@ @. . X@ Y@ r+ r+ Z@ `@ `@ # . .# ` +# +# ` .. @# ## $# %# &# *# *# =# c@ =# *# b@ -# 9. ;# ( w x x x x x w w x x y y y y y L@ g@ h@ ># h@ x y w ( ( w w ( w w { { < ' u ,# '# '# o@ o@ o@ o@ o@ o@ o@ o@ p@ o@ '# r )# $+ -+ 6. ^ ", -"!# ~# {# = = = = = = = = = = = = = = = = = = = = = = = = = = = = 8+ ]# A z y. ,+ ,+ y. }. ^# = = = = = = = = = = = = = = /# M+ (# T+ r. _# N@ :# *@ u@ = = = = = = = = = = = = = = v@ <# [# }# 0. } f f 2+ +@ B@ |# 1# 2# 3# 4# 2+ B. 5# (# s@ *@ I@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 6# s P+ u . < { w w x x x x x x x w v ( w [ x y y y 0+ ,@ '@ '@ x w ( w x w ( w x y y 0+ >@ >@ 0+ y M@ y y y >@ >@ >@ a+ x x [ :. :. <. [ w ( { < ' z A B = = = = = = = = = = = = = = c+ + E ' F G = = = = = = = = = = = = = = = H 7# O@ 8# E. M g+ 9# 0# _@ k+ U@ a# ]@ @. b# c# d# e# f# g# h# i# .. M . +. +# b# +. 6@ @. +. Z U. @# j# k# *# &# l# m# n# o# p# q# r# 9. w x x x w w w x x x x a+ a+ x x y y g@ h@ h@ h@ x x w ( w x x w w ( ( { : [. z s# = = = = = = = = = = = = = = t# F E u# 6. ", -"% u. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v# w# I+ @ y. y. y. P+ ^# = = = = = = = = = = = = = = /# I+ x# y# G@ r. r. :# 5 6 = = = = = = = = = = = = = = v@ 5 z# A# B# |# 0. B@ B@ g. | 1 5+ x@ C# 5+ 5+ j f. x# U+ D# o = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. E# # u . ! _ F# w w w w w w x x :. <. <. w w w a+ y x x [ w w w w w w w w [ x x y y y f@ 0+ 0+ >@ >@ 0+ y y a+ ,@ ,@ ,@ r# v v F# F# F# w v ( { ) ' M+ G# B = = = = = = = = = = = = = = c+ + : : + H# = = = = = = = = = = = = = = = I# J# K# L# E. g# M# N# O# &. P# Q# O R# S# Y Y #. r+ Y T# i# T# .. . U# V# W# X# .# h# h# i# P. Y# @# P. Z# `# $ .$ +$ o# l# @$ q# v w x x x x w v r# ,@ a+ x x [ <. ^ #$ [ [ w $$ ^ $$ F# F# F# w w [ <. %$ %$ v &$ u# L+ F O+ *$ = = = = = = = = = = = = = = =$ M+ ' ! v ", -"-$ ;$ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = J+ >$ # }. u u M+ , ,$ = = = = = = = = = = = = = = /# , '$ l 5# B. y# (# )$ u@ = = = = = = = = = = = = = = v@ !$ ~$ {$ ]$ 2+ 0. B@ ^$ /$ ($ 0. i _$ :$ d+ A@ 2+ G@ y# :# <$ o = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = [$ F z ' ! _ v w w w w w w [ [ <. ^ ^ F# v ( [ [ [ F# ( ( ( ( F# v v ( w [ x x x y y L@ y 0+ >@ 0+ 0+ y x '@ }$ r# r# 9. / _ ( ( ( ( ( ~ < : + M+ |. B = = = = = = = = = = = = = = c+ + z. ! ' |$ = = = = = = = = = = = = = = = 1$ 2$ 3$ 4$ ` 5$ /@ 6$ 7$ 8$ 7$ 9$ 0$ a$ b$ c$ E. d$ P@ e$ e$ e$ f$ 8# g$ h$ i$ j$ #. k$ f+ s+ v+ l$ Y# m$ n$ ` o$ p$ q$ +$ r$ s$ t$ @+ ( v [ [ [ [ w v r# r# v w x <. ^ 6. =+ ( ( _ 6. 6. 6. u$ u$ u$ v w F# ^ ^ ^ %$ / u# >+ v$ O+ w$ = = = = = = = = = = = = = = x$ }. ,+ ! ( ", -"W+ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = y$ z$ I+ @ z }. A A$ = = = = = = = = = = = = = = /# , U+ B$ y# C$ D$ E$ n 6 = = = = = = = = = = = = = = F$ F G$ H$ I$ J$ )+ } K$ _+ n. L$ M$ N$ O$ P$ Q$ r. r@ [# R$ V+ I@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. S$ I+ + ) { ( v w w w ( v w v 6. 6. =+ { { ~ _ ] ] _ { ! ! ! ~ _ _ _ ( w w x x a+ y T$ y 0+ a+ a+ 0+ x x r# r# 9. / u# D -+ ! ! ! ! < : ' [. F I+ |. B = = = = = = = = = = = = = = U$ F z. V$ W$ X$ Y$ Z$ `$ `$ `$ `$ `$ `$ `$ `$ `$ % Y$ .% +% @% #% $% %% &% 9$ ^@ h+ *% R. =% q+ -% ;% S# >% e$ ,% D. '% )% !% ~% 3$ {% g$ ]% ]% ^% u+ /% (% _% :% U. <% [% }% |% 1% 2% 3% 4% 5% 6% 7% _ _ ( ( ( ( v [ %$ 9. _ { v v 5. 5. 7. ! < ) 7. ;+ ;+ 8% 8% 7. ~ _ ] ^ ^ %$ 9. 9% D >+ v$ G# w$ = = = = = = = = = = = = = = r }. + : _ ", -"0% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = J+ a% A I+ }. , % b% = = = = = = = = = = = = = = /# c% d% B$ T+ !+ /+ e% n 6 = = = = = = = = = = = = = = v@ f% R$ g% h% G@ C$ %@ i% j% k% P$ j% l% !+ /+ H@ m% (# z# *@ n% I@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = o% # y. : { &$ 9. v w ( _ ( _ ! ;+ ;+ >+ : . . ' L+ L+ . ' [. [. ,+ ' : : ) ! _ F# /. a+ f@ y y y x x 0+ x /. w v / u# : ' ,+ $+ [. + + + + + + u }. # $ B = = = = = = = = = = = = = = p% u : z. E y. I+ A $ !# !# q% q% % % % |. c% r% t@ s% t% q. u% L# @. v% V@ R. g+ a# 5$ U# w% x% y% z% ~% 3$ O@ A% ~@ B% e+ C% D% E% d F% G% H% I% J% K% /% L% !% M% L# N% O% P% Q% R% S% T% ,@ ! ) ! ! < : ! _ { { 7. ;+ ;+ ;+ ;+ ;+ j@ ' ' + ,+ ,+ ,+ + + ,+ >+ L+ 5. _ _ v &$ _ : z$ N+ G# w$ = = = = = = = = = = = = = = r , y. . ! ", -"= = = = = = = = = = = = = = = - U% V% W% -@ = = = = = = = = = = = = = = X% % # , G# Y% b% = = = = = = = = = = = = = = /# |. t. m r@ r@ m Z% )$ 6 = = = = = = = = = = = = = = v@ `% *@ Z% & c. r@ .& e% +& +& ~+ ~+ h% @& ~+ #& m m X+ $& %& I@ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = && }. u . 9% 9. 9. 9. b+ ( { { < L+ >+ z$ v$ y. u @ @ M+ M+ z z }. M+ @ @ u y. + ' : ! _ v x g@ x x [ y y x [ F# _ -+ j@ + u z }. I+ }. }. }. }. }. z P+ A > !# B = = = = = = = = = = = = = = *& }. ' =& W$ $+ M+ P+ |. > $ !# Y% G# c% -& F %& %& $& :# t% ;& >& {@ &% >% ,& '& )& !& ~& ,% {& ]& ^& /& 2$ 6+ (& _& !@ q. :& I 7# <& [& }& |& M$ F@ C% 1& D. 2& 3& <% O. u+ 4& 5& 6& 7& 5& 8& t@ ' [. ' ' ' [. [. ' : : >+ >+ >+ >+ z$ z$ y. 9& @ I+ z z z }. }. z @ v$ ,+ : ! ! < : ' y. O+ % w$ = = = = = = = = = = = = = = r # @ ,+ : ", -"= = = = = = = = = = = = = = 2. 0& a& a& v$ b& = = = = = = = = = = = = = = c& Y% % |. % Y% d& = = = = = = = = = = = = = = /# % & d% U+ t. Z% e& V+ 6 = = = = = = = = = = = = = = f& g& h& i& i& '$ j& k& l& m& n& c. & o& e% y# s% R$ e& n *@ -& p& = = = = = = = = = = = = = = = - q& ;$ = = = = = = = = = = = = = = = [$ r& @ . _ 9. 9. v ( { < ! L+ $+ v$ N+ O+ , s& t& u& v& w& x& y& z& r A& B& s @ }. z u y. : { F# [ x x x g@ y x w _ : $+ F I+ , C& D& E& F& G& H& I& <. A |. > !# q% B = = = = = = = = = = = = = = *& # $+ z. J& + }. K& > Y% !# q% Y% L& M& -& c% -& `% V+ G$ (# N& O@ 4$ L O& P& Q& R& S& T& U& V& W& X& N@ Y& Z& `& * .* +* @* #* $* %* &* ** =* -* +& ;* >* C% D% {% g$ +. P. <% E. ,* '* )* !* F M+ }. }. }. z }. I+ }. z z }. O+ N+ O+ O+ O+ , , I+ ~* {* ]* y& ^* /* (* 5. O+ N+ + ' . : . $+ @ G# Y% w$ = = = = = = = = = = = = = = '# |. I+ @ + ", -"= = = = = = = = = = = = = = [$ % _* _* a& ^# = = = = = = = = = = = = = = Y$ O+ !# $ Y% q% d& = = = = = = = = = = = = = = /# Y% h& j& '$ e& Z% *@ :* 6 = = = = = = = = = = = = = = <* `% [* h& f% }* |* 1* 2* 3* 4* 5* 6* 6* 7* H 8* 9* <$ n 0* -& a* = = = = = = = = = = = = = = = z$ _. b* c* J+ = = = = = = = = = = = = = ;$ d* @ ' ! &$ v 9. 9% ! j@ ,+ v$ N+ O+ G# e* f* g* h* = = = = = = = = J+ w$ i* j* k* , }. y. L+ ! _ w [ a+ y y x ] : + M+ O+ l* 9+ * v. = = = = 8+ y$ m* 7. t q% a& B = = = = = = = = = = = = = = *& A @ ' + d* n* ,# o* /* /* /* p* p* p* q* ,# q* r* s* 8* t* ;& A% u* v* d$ w* w* e$ x* y* p. z* A* B* C* g* ;$ = = = = = = = = J+ * D* E* F* y# !@ |& G* H* I* J* K* L* M* 2@ N* O* P* n* Q* Q* Q* Q* Q* Q* Q* Q* R* R* R* R* R* S* % % > T* U* V* = = = = = 2. W* X* N+ }. @ u + + @ O+ |. !# w$ = = = = = = = = = = = = = = o@ Y% A , z ", -"= = = = = = = = = = = = = = Y* Z* t t q% p% = = = = = = = = = = = = = = `* s Z* q% q% a& d& = = = = = = = = = = = = = = /# q% = %& V+ 5 *@ h& -& .= = = = = = = = = = = = = = = c& c% -& -& += @= = = = = = = = = = = = d. )$ <# h& r% #= = = = = = = = = = = = = = = = v$ a& a& , $= = = = = = = = = = = = = = v. %= z ,+ ! _ ( _ D j@ $+ v$ O+ O+ 0& && -@ = = = = = = = = = = = = = = v. &= *= r& I+ u ,+ : _ v w w [ ( : + }. O+ == s# v. = = = = = = = = v. -= ;= a& a& B = = = = = = = = = = = = = = *& A , y. + H# = = = = = = = = = = = = = = = )@ (& O@ >= ,= ~& >% z% '= )= != ~= {= ]= 8+ = = = = = = = = = = = = = = v. ^= d. /= (= M$ J _= := <= [= }= |= 1= 2= = = = = = = = = = = = = = = = 3= t > p% {# v. = = = = = = = = -@ 4= %$ , P+ }. }. , A $ q% w$ = = = = = = = = = = = = = = v& q% !# > A ", -"= = = = = = = = = = = = = = c& q% Y% $ !# 5= = = = = = = = = = = = = = = 6= 7= a& 8= g* g* 0% = = = = = = = = = = = = = = 2. g* 9= /# /# d% 5 f% c% 0= = = = = = = = = = = = = = = f& % c% M& a= 6= = = = = = = = = = = v. b= :* !$ !$ r% #= = = = = = = = = = = = = = = = z$ Z* q% Z* A& v. = = = = = = = = = = = = = p% }. [. < { _ ! -+ $+ M+ O+ ;+ c= d= = = = = = = = = = = = = = = = = = = = e= f= , @ + : ~ _ v ( ~ ' u O+ g= h= = = = = = = = = = = = = i= u& a& B = = = = = = = = = = = = = = *& A P+ }. u G = = = = = = = = = = = = = = = j= k= ~@ l= m= n= M* o= /& ^. p= q= p = = = = = = = = = = = = = = = = = = = r= s= D$ t= u= v= w= 3& x= y= 7# z= = = = = = = = = = = = = = = = A= q% B= 6= = = = = = = = = = = = J+ C= z$ |. A A |. D= g* g* l@ = = = = = = = = = = = = = = * g* g* g* E= ", -"= = = = = = = = = = = = = = 4= !# > % $ F= = = = = = = = = = = = = = = = G= H= #* = = = = = = = = = = = = = = = = = = = = = = I= %& f% c% .= = = = = = = = = = = = = = = f& Y% J= Y% K= = = = = = = = = = = = 8+ L= n% n% !$ `% I@ = = = = = = = = = = = = = = = z$ q% !# q% M= v. = = = = = = = = = = = = = o@ }. + : ! ! -+ $+ M+ O+ r& N= v. = = = = = = = = = = = = = = = = = = = = = V* 5= , z ' : < _ _ ! y. }. O= P= = = = = = = = = = = = = = = Q= S$ B = = = = = = = = = = = = = = *& A I+ I+ P+ C = = = = = = = = = = = = = = = R= S= T= U= V= (% {% W= i% X= Y= J+ = = = = = = = = = = = = = = = = = = = = = p Z= `= (& - .- +- O@ @- -* #- = = = = = = = = = = = = = = = X% $- h= = = = = = = = = = = = = = v. v& !# Y% $ !# p = = = = = = = = = = = = = = = = = = = = = %- ", -"= = = = = = = = = = = = = = &- Y% |. A > *- = = = = = = = = = = = = = = = =- -- #* = = = = = = = = = = = = = = = = = = = = = = ;- -& `% c% 0= = = = = = = = = = = = = = = f& >- ,- '- f& = = = = = = = = = = = Y$ `% r% r% -& )- a* = = = = = = = = = = = = = = = $+ Y% $ !# ,+ v. = = = = = = = = = = = = = E# I+ y. ' -+ E $+ F I+ !- && v. = = = = = = = = = = = = = = = = = = = = = = = 0% ~- I+ y. . : ! ! L+ u y. 0= = = = = = = = = = = = = = = = = `* J+ = = = = = = = = = = = = = = *& A , I+ A c+ = = = = = = = = = = = = = = = {- y# != /& ]- e+ ^- N@ /- (- v. = = = = = = = = = = = = = = = = = = = = = = = _- :- T+ #% <- u= [- }- |- 1- = = = = = = = = = = = = = = = 2- 3- = = = = = = = = = = = = = = = `* 4- q% q% Z* p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = 6- > A A % 7- = = = = = = = = = = = = = = = r* -- #* = = = = = = = = = = = = = = = = = = = = = = ;- -& -& c% .= = = = = = = = = = = = = = = 8- a& a& q% s# = = = = = = = = = = = d. Y% Y% M& % Y% c& = = = = = = = = = = = = = = = >+ $ % $ !# v. = = = = = = = = = = = = = A= P+ y. ' j@ $+ F I+ F a* v. = = = = = = = = = = = = = = = = = = = = = = = = = `$ k* @ ,+ : 7. ! ' z 9- 8+ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *& A , , A 0- = = = = = = = = = = = = = = = a- b- g& 5 '$ R$ n% c- d- v. = = = = = = = = = = = = = = = = = = = = = = = = = e- f- g- #% h- h- N& :& i- = = = = = = = = = = = = = = = j- v. = = = = = = = = = = = = = = = v. k- a& a& a& p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = 6- > # # |. l- = = = = = = = = = = = = = = = m- -- #* = = = = = = = = = = = = = = = = = = = = = = ;- -& `% c% 6 = = = = = = = = = = = = = = f& -- -- n- = = = = = = = = = = = v. o- Y% % G# p- ,- c& = = = = = = = = = = = = = = = >+ > A > !# v. = = = = = = = = = = = = = q- , u + + r- M+ # s- = = = = = = = = = = = = = = = = = = = = = = = = = = = v. c= }. u [. L+ : y. }. t- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *& A , , A p% = = = = = = = = = = = = = = = V% M& )- c% c% M& $ %* v. = = = = = = = = = = = = = = = = = = = = = = = = = = v. u- `= g- v- h- 1+ N@ w- = = = = = = = = = = = = = = = v. = = = = = = = = = = = = = = = = = .% a& x- H= p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = 6- % # # |. l- = = = = = = = = = = = = = = = y- -- #* = = = = = = = = = = = = = = = = = = = = = = z- |. M& ,- 0= = = = = = = = = = = = = = = W% -- -- A- = = = = = = = = = = = &= B- J= M& M& J= ,- c& = = = = = = = = = = = = = = = j@ > A > Y% v. = = = = = = = = = = = = = q- , u + + @ }. C- D- = = = = = = = = = = = = = = = = = = = = = = = = = = = = p E- z y. ,+ ,+ @ (. F- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *& A I+ , A p% = = = = = = = = = = = = = = = G- % c% c% M& % H- I- = = = = = = = = = = = = = = = = = = = = = = = = = = = = J- K- d% G@ I d+ L- H- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 8+ _. -- -- p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = 6- % # # |. l- = = = = = = = = = = = = = = = #* -- #* = = = = = = = = = = = = = = = = = = = = = = <$ >- q% q% 0= = = = = = = = = = = = = = = N= -- -- a* = = = = = = = = = = = M- G# % M& )- M& Y% c& = = = = = = = = = = = = = = = L+ > A > Y% v. = = = = = = = = = = = = = q- , u ,+ + @ , N- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ]* , @ y. y. z O- d= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *& A I+ I+ A p% = = = = = = = = = = = = = = = G- J= M& M& L& p- X% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = P- J= Q- R- S- `% T- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. $- -- -- p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = U- % # O+ # V- = = = = = = = = = = = = = = = m@ -- #* = = = = = = = = = = = = = = = = = = = = = = 6. q% q% q% 0= = = = = = = = = = = = = = = N= -- :. @= = = = = = = = = = = = W- Y% % M& )- M& Y% c& = = = = = = = = = = = = = = = L+ > A > Y% v. = = = = = = = = = = = = = #* , u + y. }. M+ X- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Y- z$ I+ @ u }. B& v. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *& A , I+ G# p% = = = = = = = = = = = = = = = Z- J= % % % G# M- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = .% v$ % % J= Y% <. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. `- -- -- p = = = = = = = = = = = = = = = = = = = = = 5- ", -"= = = = = = = = = = = = = = U- |. , I+ # V- = = = = = = = = = = = = = = = ; -- #* = = = = = = = = = = = = = = = = = = = = = = .; q% q% q% 0= = = = = = = = = = = = = = = N= -- +; l@ = = = = = = = = = = = *& p- L& L& J= p- '- c& = = = = = = = = = = = = = = = L+ > % $ Y% v. = = = = = = = = = = = = = @; , u + F }. +; l@ = = = = = = = = = = = = - p% 0& #; v. = = = = = = = = = = = = = i= $; I+ }. z , %; = = = = = = = = = = = = = = = b& S$ &; *; = = = = = = = = = = = = = = = *& A }. }. # p% = = = = = = = = = = = = = = = V% % % % Y% =; ^= = = = = = = = = = = = = `* B= -; ;; v. = = = = = = = = = = = = = >; =; p- L& L& J= <. = = = = = = = = = = = = = = = J+ ,; G= m@ -@ = = = = = = = = = = = = = = '; H= a& p = = = = = = = = = = = = = = = = = = = = = %- ", -"= = = = = = = = = = = = = = U- |. P+ I+ # M= = = = = = = = = = = = = = = = ; a& ); Y* Y* X- = = = = = = = = = = = = = = J- Y* Y* Y* Y* ;+ Y% Y% q% 0= = = = = = = = = = = = = = = N= -- r = = = = = = = = = = = ;$ !; J= J= J= p- ,- ,- ~; = = = = = = = = = = = = = = = >+ $ > Y% }$ v. = = = = = = = = = = = = = X% , @ y. u I+ 2- v. = = = = = = = = = = = = K= a& a& C& {; = = = = = = = = = = = = = v. n@ A }. }. G# ]; = = = = = = = = = = = = = = 2. ;= a& x- R* v. = = = = = = = = = = = = = = *& G# }. }. # p% = = = = = = = = = = = = = = = Z- L& ^; /; % U$ v. = = = = = = = = = = = = k- (; _; T- w$ = = = = = = = = = = = = = v. :; ,- J= M& % :. = = = = = = = = = = = = = = = <; a& -- % *; = = = = = = = = = = = = = = q- a& a& K+ Y* Y* h* = = = = = = = = = = = = = = v# Y* D* D* '; ", -"= = = = = = = = = = = = = = [; A I+ }. , }; = = = = = = = = = = = = = = = ; Z* q% q% a& |; = = = = = = = = = = = = = = /# q% Y% Y% Y% J= J= $ '- 0= = = = = = = = = = = = = = = N= -- $= = = = = = = = = = = = 1; V+ M& 2; p- J= J= p- <* = = = = = = = = = = = = = = = $+ !# Y% t B- v. = = = = = = = = = = = = = x. # z @ M+ , 3; = = = = = = = = = = = = = $- a& a& q% i* = = = = = = = = = = = = = = p% A }. }. A 2- = = = = = = = = = = = = = = s# r& a& a& a% -@ = = = = = = = = = = = = = = *& A I+ }. # 0- = = = = = = = = = = = = = = = G- q% 4; = O+ 5; = = = = = = = = = = = = = D& a& a& a& a* = = = = = = = = = = = = = = r* Y% p- J= % :. = = = = = = = = = = = = = = = 6; a& a& a& <; = = = = = = = = = = = = = = 7; a& q% q% Z* a& w$ = = = = = = = = = = = = = = 8; t > G# , ", -"= = = = = = = = = = = = = = [; A P+ }. , 9; = = = = = = = = = = = = = = = 0; Y% $ !# q% d& = = = = = = = = = = = = = = /# Y% A |. a; |. |. $ ,- 0= = = = = = = = = = = = = = = N= N+ q& = = = = = = = = = = = b; M& c% M& L& M& L& J= <* = = = = = = = = = = = = = = = z$ q% q% Z* c; v. = = = = = = = = = = = = = d; , z @ z I+ e; = = = = = = = = = = = = = f; Z* q% _* W- = = = = = = = = = = = = = = s- |. , , |. U% = = = = = = = = = = = = = = g; ,+ a& a& h; l@ = = = = = = = = = = = = = = *& A , I+ # 0- = = = = = = = = = = = = = = = i; >- p- L& G# j; = = = = = = = = = = = = = ;= a& k; a& A= = = = = = = = = = = = = = = ,; q% ,- p- % :. = = = = = = = = = = = = = = = r a& a& a& c& = = = = = = = = = = = = = = a* q% Y% Y% !# q% w$ = = = = = = = = = = = = = = o@ $ , z F ", -"= = = = = = = = = = = = = = [; A }. }. }. l; M- M- M- M- m; m; m; m; m; m; m; M- M- M- M- |; A A A $ n; = = = = = = = = = = = = = = /# % , I+ Q- Q- Q- J= ,- 0= = = = = = = = = = = = = = = o; b* 2. = = = = = = = = = = J+ p; G# M& M& q; )- M& p- c& = = = = = = = = = = = = = = = v$ a& _* a& q- v. = = = = = = = = = = = = l@ r; , }. M+ }. =+ Y$ = = = = = = = = = = = = = s; q% !# q% ^# = = = = = = = = = = = = = = 6; |. # # > '; = = = = = = = = = = = = = = -= % q% Z* N+ B = = = = = = = = = = = = = = *& A I+ }. G# p% = = = = = = = = = = = = = = = i; q% '- '- t; Y- = = = = = = = = = = = = = u; v; q% v; o@ = = = = = = = = = = = = = = 7 q% Y% p- % <. = = = = = = = = = = = = = = = w; a& Z* a& C= = = = = = = = = = = = = = = K+ !# > % > t w$ = = = = = = = = = = = = = = '# |. }. y. ' ", -"= = = = = = = = = = = = = = [; A }. u u z P+ , , , # # # # # # A # , , , P+ P+ I+ , % b% = = = = = = = = = = = = = = /# A z u I+ c% # M& Y% 0= = = = = = = = = = = = = = = D* X% v. = = = = = = = = = = J- M= M& M& )- x; x; )- p- c& = = = = = = = = = = = = = = = v$ Y% ;+ U$ V* = = = = = = = = = = = = = `* y; , M+ z , z; [$ = = = = = = = = = = = = = A; !# Y% t x$ = = = = = = = = = = = = = = b; % # # > B; = = = = = = = = = = = = = = y$ q% q% q% _* B = = = = = = = = = = = = = = *& A }. }. G# p% = = = = = = = = = = = = = = = G- q% '- q% z$ g; = = = = = = = = = = = = = #- q% '- v; V% = = = = = = = = = = = = = = C; q% Y% % G# <. = = = = = = = = = = = = = = = &; q% q% Z* D; = = = = = = = = = = = = = = i* !# > A % Y% w$ = = = = = = = = = = = = = = r # @ ,+ < ", -"= = = = = = = = = = = = = = q- # z + [. u u 9& u @ @ @ @ @ @ M+ @ @ @ u @ u @ @ }. |. b% = = = = = = = = = = = = = = /# , 9& [. E; = c% M& J= 0= = = = = = = = = = = = = = = && F; = = = = = = = = = = = F- J= c% )- c% x; x; M& J= c& = = = = = = = = = = = = = = = W% D* `* v. = = = = = = = = = = = = = = G; M+ I+ u @ , s V* = = = = = = = = = = = = = =+ Y% > Y% r* = = = = = = = = = = = = = = c* > G# # > B; = = = = = = = = = = = = = = y$ q% !# t q% B = = = = = = = = = = = = = = *& G# I+ , G# p% = = = = = = = = = = = = = = = G- q% '- '- )$ {; = = = = = = = = = = = = = C& '- Y% q% ; = = = = = = = = = = = = = = W% q% ,- % # :. = = = = = = = = = = = = = = = H; q% q% q% m@ = = = = = = = = = = = = = = I; $ A A |. $ w$ = = = = = = = = = = = = = = r I+ y. : _ ", -"= = = = = = = = = = = = = = [; # @ + ' ' . ' + ,+ ' L+ . ,+ + + ' ' ,+ ' ,+ ' ' + @ A b% = = = = = = = = = = = = = = /# , J; . F -& c% )- % 0= = = = = = = = = = = = = = = K; `* = = = = = = = = = = = L; J= -& = M; x; x; c% % <* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = N; G# }. y. F }. l; 6= = = = = = = = = = = = = = =+ O; > Y% o* = = = = = = = = = = = = = = P; > G# # % N- = = = = = = = = = = = = = = y$ q% !# !# q% B = = = = = = = = = = = = = = *& G# , , A p% = = = = = = = = = = = = = = = G- q% '- '- ^ d= = = = = = = = = = = = = = Q; Y% Y% q% &; = = = = = = = = = = = = = = R; '- Y% A A <. = = = = = = = = = = = = = = = S; q% !# q% q- = = = = = = = = = = = = = = T; > # , A > w$ = = = = = = = = = = = = = = x$ }. ' ! F# ", -"= = = = = = = = = = = = = = U- # @ + ' : : . ' L+ : : : ' [. ,+ L+ L+ : : L+ L+ ' + @ , A$ = = = = = = = = = = = = = = /# , J; L+ !$ = x; )- L& 0= = = = = = = = = = = = = = = V* v. = = = = = = = = = = = & L& U; V; U; M; M; -& L& a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 8+ W; P+ u + y. z X; 8+ = = = = = = = = = = = = = 6. Y% > Y% o* = = = = = = = = = = = = = = q > G# # > N- = = = = = = = = = = = = = = y$ q% Y% !# q% B = = = = = = = = = = = = = = Y; A , I+ A p% = = = = = = = = = = = = = = = G- q% '- '- :. l@ = = = = = = = = = = = = = C& % Y% q% &; = = = = = = = = = = = = = = K; q% p- G# A <. = = = = = = = = = = = = = = = S$ !# Y% q% q- = = = = = = = = = = = = = = T; > # I+ , % w$ = = = = = = = = = = = = = = =$ @ L+ _ v ", -"= = = = = = = = = = = = = = U- A }. u ,+ ' ' ' ' L+ ' ' + + ,+ ' ' L+ : : : : L+ ' @ , b% = = = = = = = = = = = = = = /# , Z; : $+ = = )- L& 0= = = = = = = = = = = = = = = v. = = = = = = = = = = = p `; = > .> +> %& :* `% M& a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. %+ , z @> W$ ' @ C- = = = = = = = = = = = = = = =+ !# > !# #> = = = = = = = = = = = = = = $> > A A > N- = = = = = = = = = = = = = = y$ !# Y% Y% q% B = = = = = = = = = = = = = = Y; A P+ I+ # p% = = = = = = = = = = = = = = = G- '- %> %> _. = = = = = = = = = = = = = = C& Y% q% q% U$ = = = = = = = = = = = = = = &> q% Y% # K& <. = = = = = = = = = = = = = = = S$ !# Y% t q- = = = = = = = = = = = = = = b& % # I+ , |. w$ = = = = = = = = = = = = = = t# F ) _ ( ", -"= = = = = = = = = = = = = = 6- > , }. @ @ @ @ @ u y. u z M+ @ u u y. + + ,+ ,+ ' ,+ @ A b% = = = = = = = = = = = = = = /# , Z; . E M; -& )- J= 0= = = = = = = = = = = = = = = = = = = = = = = = = = = Y$ *> /; => -> ;> > :* `% )- a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -@ I@ A; }. y. W$ z. : @ }; = = = = = = = = = = = = = = 5. !# !# !# m- = = = = = = = = = = = = = = >> Y% |. A > N- = = = = = = = = = = = = = = y$ !# Y% Y% t B = = = = = = = = = = = = = = Y; K& z I+ # 0- = = = = = = = = = = = = = = = G- Y% % p- _. = = = = = = = = = = = = = = C& q% q% q% ,> = = = = = = = = = = = = = = r= >- Y% # K& <. = = = = = = = = = = = = = = = '> t Y% !# q- = = = = = = = = = = = = = = b& % # , , |. w$ = = = = = = = = = = = = = = =$ + =+ v w ", -"= = = = = = = = = = = = = = 6- t > |. A A A A # # , , G# G# G# # # , }. }. M+ @ u u }. A b% = = = = = = = = = = = = = = /# , 9& . -+ `% -& )- L& 0= = = = = = = = = = = = = = = = = = = = = = = = = = = )> ^; U; !> .> ~> V+ [* `% )- a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. v# {> F # u . V$ { ) u 9; = = = = = = = = = = = = = = 7. q% t Z* c= = = = = = = = = = = = = = = ]> $ % |. > B; = = = = = = = = = = = = = = y$ !# $ $ t B = = = = = = = = = = = = = = ^> , z M+ , /> = = = = = = = = = = = = = = = G- Y% p- '- _. = = = = = = = = = = = = = = (> q% q% q% _> = = = = = = = = = = = = = = :> >- % # A <. = = = = = = = = = = = = = = = <> !# Y% !# q- = = = = = = = = = = = = = = T; > A , A % w$ = = = = = = = = = = = = = = =$ F =+ v w ", -"= = = = = = = = = = = = = = [> a& q% Y* &= &= &= &= &= &= &= &= &= &= &= &= &= &= &= &= &= U- }. @ }. |. b% = = = = = = = = = = = = = = /# }. [. : : `% -& c% L& 0= = = = = = = = = = = = = = = = = = = = = = = = = = = B= O+ :* :* }> ~> )$ ~> %& )- a* = = = = = = = = = = = = = = = = = = = = = = = = = -@ |> A= 1> -+ q% $ P+ 2> #+ 3> 4> 5> ,+ 6> = = = = = = = = = = = = = = ;+ a& _* t K+ = = = = = = = = = = = = = = g* $ A A > B; = = = = = = = = = = = = = = y$ !# $ $ t B = = = = = = = = = = = = = = ^> , z @ , U$ = = = = = = = = = = = = = = = G- Y% p- p- 7> = = = = = = = = = = = = = = 8> k; q% q% 8- = = = = = = = = = = = = = = s# q% 9> G# A :. = = = = = = = = = = = = = = = <> !# Y% !# q- = = = = = = = = = = = = = = b& % # , A > w$ = = = = = = = = = = = = = = =$ F ! b+ 0> ", -"= = = = = = = = = = = = = = [> x- a& >> = = = = = = = = = = = = = = = = = 3= # }. I+ |. b% = = = = = = = = = = = = = = /# I+ + . : :* U; U; % 0= = = = = = = = = = = = = = = = = = = = = = = = = = J+ a> c% b> > c> .; c> ~> %& = a* = = = = = = = = = = = = = = = = = = = = = = = = = v. q& d- F= q% t > P+ 2> . d> e> 3> : 7- = = = = = = = = = = = = = = ;+ a& a& -$ Q= = = = = = = = = = = = = = = [$ > A G# % z& = = = = = = = = = = = = = = y$ !# $ $ t B = = = = = = = = = = = = = = ^> , M+ @ , U$ = = = = = = = = = = = = = = = G- p- p- 4; 7> = = = = = = = = = = = = = = 8> a& a& f> i= = = = = = = = = = = = = = = {# q% % A |. :. = = = = = = = = = = = = = = = <> !# Y% !# q- = = = = = = = = = = = = = = b& |. P+ I+ A > w$ = = = = = = = = = = = = = = =$ @ : &$ g> ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 3; A , # > b% = = = = = = = = = = = = = = /# , + . ! ;+ N+ = J= 0= = = = = = = = = = = = = = = = = = = = = = = = = = F- `% N+ :* ~> h> j& ~> i> j> N+ a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = 8+ &+ k> $ # u . 4> l> v =+ k* m> H& ); n* Q* p* p* /* k@ n> n> n> n> n> % O+ A- >; = = = = = = = = = = = = = = = o> $ A G# % N- = = = = = = = = = = = = = = y$ !# $ $ t B = = = = = = = = = = = = = = p% , @ @ , U$ = = = = = = = = = = = = = = = G- 4; L& p> > q> p* r> r> /* s> n> n> n> n> n> t> V% V% z$ % p* V* = = = = = = = = = = = = = = = Q= Y% > A A <. = = = = = = = = = = = = = = = <> !# !# !# q- = = = = = = = = = = = = = = b& |. }. }. A > w$ = = = = = = = = = = = = = = >$ z . { g> ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; |. G# # > b% = = = = = = = = = = = = = = /# I+ 9& . ! : u> )- p- 0= = = = = = = = = = = = = = = = = = = = = = = = = = v> G# = %& )$ j& w> x> y> .> `% a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. [$ z> # u : &$ b+ w v =+ : ' + u }. , |. $ q% _* a& a& -- q% b* <; -@ = = = = = = = = = = = = = = = = w. $ A A % N- = = = = = = = = = = = = = = y$ !# $ $ t B = = = = = = = = = = = = = = p% I+ F @ O+ U$ = = = = = = = = = = = = = = = G- L& A> )- = /; A> L& J= J= '- v; k; a& a& a& -- -- a& B> K+ 8+ = = = = = = = = = = = = = = = = Q= $ A # A <. = = = = = = = = = = = = = = = <> !# !# t q- = = = = = = = = = = = = = = b& |. }. I+ # % w$ = = = = = = = = = = = = = = x$ z ' _ x ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; % A # > b% = = = = = = = = = = = = = = /# , 9& . _ ! v$ /; p- 0= = = = = = = = = = = = = = = = = = = = = = = = = = *; z$ = %& }> <$ h> C> -> D> U; a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = E> F> z ' { b+ b+ w [ &$ { : ' u }. , |. $ q% a& a& G> H> h* = = = = = = = = = = = = = = = = = = 0% % A A % N- = = = = = = = = = = = = = = y$ !# $ $ !# B = = = = = = = = = = = = = = p% I+ @ @ O+ U$ = = = = = = = = = = = = = = = I> p> )- /; )- /; = = )- L& p- '- k; a& a& -- -- a> )> J- = = = = = = = = = = = = = = = = = = ;$ Y% A # |. <. = = = = = = = = = = = = = = = <> !# !# q% q- = = = = = = = = = = = = = = b& |. , I+ , |. w$ = = = = = = = = = = = = = = x$ @ ,+ ~ x ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; % A # % b% = = = = = = = = = = = = = = /# I+ + ) _ ] v$ ^; J= 0= = = = = = = = = = = = = = = = = = = = = = = = = = v. J> `% > V+ <$ h> K> w> i> U; a* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = v. L> z + ! b+ 0+ y g@ x &$ z. ' y. M+ , |. Y% Y% M> L; ^= = = = = = = = = = = = = = = = = = = = = {# % G# G# % N- = = = = = = = = = = = = = = y$ !# > $ !# B = = = = = = = = = = = = = = ^> , @ M+ , U$ = = = = = = = = = = = = = = = I> 4; N> = = O> O> b> )- M& p- '- k; a& a& #- 9+ >; = = = = = = = = = = = = = = = = = = = = l@ $ A , |. <. = = = = = = = = = = = = = = = <> !# Y% t q- = = = = = = = = = = = = = = b& |. , I+ , |. w$ = = = = = = = = = = = = = = x$ @ . ~ w ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; |. G# , > b% = = = = = = = = = = = = = = /# I+ ' _ F# ( $+ G# J= 0= = = = = = = = = = = = = = = = = = = = = = = = = = = P> -& %& V+ D# {+ Q> k& }> v$ I@ = = = = = = = = = = = = = = = $- u& z& @= v. = = = = = = = = = = = = -@ R> u z. '@ S> f@ f@ a+ v ! ' F }. A |. V- )> {# = = = = = = = = = = = = = = = = = = = = = = {# q% A T> % N- = = = = = = = = = = = = = = y$ !# > $ !# B = = = = = = = = = = = = = = p% O+ @ M+ , /> = = = = = = = = = = = = = = = V% % )- U; b> U> +> => )- % Y% '- q% V> m@ P= v. = = = = = = = = = = = = = = = = = = = = = l@ > # , K& <. = = = = = = = = = = = = = = = <> !# Y% t q- = = = = = = = = = = = = = = b& |. , }. , |. w$ = = = = = = = = = = = = = = x$ 9& ) 4> w ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; % # , % b% = = = = = = = = = = = = = = /# z : ] [ g> D )- J= 0= = = = = = = = = = = = = = = = = = = = = = = = = = = #* c% b> D# ;- ;- k& h> V+ v$ I@ = = = = = = = = = = = = = = = v$ a& _* r& F- = = = = = = = = = = = = = p& u W$ W> 0+ f@ f@ a+ v 7. + M+ , C& c= p = = = = = = = = = = = = = = = = = = = = = = = = {# q% Y% % % N- = = = = = = = = = = = = = = y$ !# > > !# B = = = = = = = = = = = = = = p% I+ F @ O+ U$ = = = = = = = = = = = = = = = V% % )- U; U; !> U; = L& Y% '- X> Y> >; = = = = = = = = = = = = = = = = = = = = = = = = l@ > , I+ # <. = = = = = = = = = = = = = = = :; Y% Y% !# q- = = = = = = = = = = = = = = b& |. , }. I+ |. w$ = = = = = = = = = = = = = = Z> 9& 3> `> y ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; > A , |. b% = = = = = = = = = = = = = = /# z : _ w b+ _ # Y% 0= = = = = = = = = = = = = = = = = = = = = = = = = = = #; O+ %& <$ , ., +, j& )$ `% a* = = = = = = = = = = = = = = = z$ q% !# q% Y> v. = = = = = = = = = = = = * @, @> { [ g@ a+ [ _ ' @ 7. V% :> v. = = = = = = = = = = = = = = = = = = = = = = = = = {# q% '- ,- q% z& = = = = = = = = = = = = = = y$ !# > > Y% B = = = = = = = = = = = = = = 0- }. F F }. U$ = = = = = = = = = = = = = = = V% )- = -& => U; = O+ % U; #, @= v. = = = = = = = = = = = = = = = = = = = = = = = = = l@ % # }. P+ }$ = = = = = = = = = = = = = = = :; Y% Y% !# q- = = = = = = = = = = = = = = b& % , }. , |. w$ = = = = = = = = = = = = = = x$ 9& ~ /. $, ", -"= = = = = = = = = = = = = = [> -- -- >> = = = = = = = = = = = = = = = = = 0; > # , |. b% = = = = = = = = = = = = = = /# }. L+ ] /. ( v z Y% 0= = = = = = = = = = = = = = = = = = = = = = = = = = = @= %, z$ j& 7> &, 7> n& += %& a* = = = = = = = = = = = = = = = >+ Y% > Y% H; v. = = = = = = = = = = = = v. *, + =+ [ /. F# _ L+ @ !; =, -@ = = = = = = = = = = = = = = = = = = = = = = = = = = = {# q% Y% Y% q% z& = = = = = = = = = = = = = = y$ Y% > > Y% B = = = = = = = = = = = = = = 0- }. y. y. }. c+ = = = = = = = = = = = = = = = s> N+ c% c% = = /; ^; -, c* 8+ = = = = = = = = = = = = = = = = = = = = = = = = = = = l@ > # z P+ }$ = = = = = = = = = = = = = = = :; Y% $ Y% q- = = = = = = = = = = = = = = b& |. , }. , |. w$ = = = = = = = = = = = = = = =$ r- V$ g> ;, ", -"= = = = = = = = = = = = = = [> x- a& >> = = = = = = = = = = = = = = = = = 0; > , O+ % b% = = = = = = = = = = = = = = /# @ : v F# F# v + Y% 0= = = = = = = = = = = = = = = = = = = = = = = = = = = h* f> > h> k& {+ {+ h> += :* a* = = = = = = = = = = = = = = = ;+ |. G# % +; v. = = = = = = = = = = = = = A& y. ! v _ ! L+ y. ~- I- v. = = = = = = = = = = = = = 6= = = = = = = = = = = = = = = {# q% Y% p- q% z& = = = = = = = = = = = = = = y$ Y% > $ Y% B = = = = = = = = = = = = = = /> }. y. y. M+ >, = = = = = = = = = = = = = = = a- = N+ = = = )- n- v# v. = = = = = = = = = = = = = 6= = = = = = = = = = = = = = = l@ > , z P+ }$ = = = = = = = = = = = = = = = '> !# > Y% q- = = = = = = = = = = = = = = b& |. P+ }. , % w$ = = = = = = = = = = = = = = =$ r- V$ w g@ ", -"= = = = = = = = = = = = = = [> a& Z* ,, 9+ 9+ w. = = = = = = = = = = = = = = 0; |. , O+ % b% = = = = = = = = = = = = = = /# @ : _ ] w v : Y% 0= = = = = = = = = = = = = = = = = = = = = = = = = = = = B= :* .; h> +, {+ h> <$ z$ a* = = = = = = = = = = = = = = = ;+ G# # |. ', v. = = = = = = = = = = = = = H& F : ! ! L+ y. *- ), = = = = = = = = = = = = = = 3- !, = = = = = = = = = = = = = = {# q% Y% Y% q% z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = 0- }. y. y. }. c+ = = = = = = = = = = = = = = = a- O+ `% = )- ^; T* v# v. = = = = = = = = = = = = = ~, b% = = = = = = = = = = = = = = l@ > # z P+ }$ = = = = = = = = = = = = = = = :; !# > Y% q- = = = = = = = = = = = = = = b& % , }. , A w$ = = = = = = = = = = = = = = =$ r- V$ x T$ ", -"= = = = = = = = = = = = = = {, q% !# !# !# q% q = = = = = = = = = = = = = = 0; A P+ O+ |. b% = = = = = = = = = = = = = = /# @ : ] [ a+ [ ! |. 0= = = = = = = = = = = = = = = = = = = = = = = = = = = = ], z$ <$ +, Q> ^, h> c> y. p& = = = = = = = = = = = = = = = 7. # , A }$ v. = = = = = = = = = = = = = /, @ j@ : L+ y. }. i* = = = = = = = = = = = = = = I- B- n> = = = = = = = = = = = = = = {# q% Y% Y% q% z& = = = = = = = = = = = = = = y$ Y% |. % Y% B = = = = = = = = = = = = = = 0- }. F + M+ >, = = = = = = = = = = = = = = = t> O+ b> U; )- 4; c& = = = = = = = = = = = = = = w$ *- (, = = = = = = = = = = = = = = l@ |. G# }. , }$ = = = = = = = = = = = = = = = :; O; > !# q- = = = = = = = = = = = = = = T; > , z P+ |. w$ = = = = = = = = = = = = = = t# u z. `> _, ", -"= = = = = = = = = = = = = = 6- Y% % |. > !# q = = = = = = = = = = = = = = 3; A P+ , A A$ = = = = = = = = = = = = = = /# @ 7. F# a+ a+ a+ 7. O+ 0= = = = = = = = = = = = = = = B = = = = = = = = = = = = 6 `% j> z- {+ k& z- 5. M+ :, = = = = = = = = = = = = = = = u# , O+ # N+ v. = = = = = = = = = = = = = '; @ ,+ L+ ,+ @ <, 2. = = = = = = = = = = = = = d= $- -- n> = = = = = = = = = = = = = = {# q% ,- ,- ,- z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = /> }. y. y. M+ c+ = = = = = = = = = = = = = = = a- = b> t; )- f; p = = = = = = = = = = = = = 2. :; -- (, = = = = = = = = = = = = = = l@ |. , }. , }$ = = = = = = = = = = = = = = = :; > > !# q- = = = = = = = = = = = = = = T; % P+ z I+ A w$ = = = = = = = = = = = = = = t# u #+ l> [, ", -"= = = = = = = = = = = = = = 6- > A # |. Y% q = = = = = = = = = = = = = = 0; |. # , A b% = = = = = = = = = = = = = = /# @ 7. F# a+ [ [ 7. M+ 0= = = = = = = = = = = = = = = /# -@ = = = = = = = = = = = V* += :* += {+ }, G$ j@ @ I@ = = = = = = = = = = = = = = = u# , M+ I+ G# v. = = = = = = = = = = = = = G& M+ ,+ ' + }. |, v. = = = = = = = = = = = = = Y> -- -- n> = = = = = = = = = = = = = = {# '- '- Y% Y% z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = 0- M+ + y. z c+ = = = = = = = = = = = = = = = n> O+ U; t; )- #> v. = = = = = = = = = = = = = 1, -- -- (, = = = = = = = = = = = = = = l@ % O+ @ , }$ = = = = = = = = = = = = = = = :; > > !# q- = = = = = = = = = = = = = = T; > P+ z I+ A w$ = = = = = = = = = = = = = = t# u #+ 2, 3, ", -"= = = = = = = = = = = = = = 6- % I+ I+ # |. 4, = = = = = = = = = = = = = = 0; |. # I+ A A$ = = = = = = = = = = = = = = /# @ : v a+ a+ F# 7. F 5, = = = = = = = = = = = = = = |> - = = = = = = = = = = = 2. 6, %& ~> z- G$ / j@ + I@ = = = = = = = = = = = = = = = =+ I+ u }. # v. = = = = = = = = = = = = = G& }. $+ j@ $+ }. 7, = = = = = = = = = = = = = I- *+ a& a& n> = = = = = = = = = = = = = = {# q% '- ,- ,- z& = = = = = = = = = = = = = = y$ Y% % % $ B = = = = = = = = = = = = = = 0- z + + z c+ = = = = = = = = = = = = = = = n> = U; N+ % 5- = = = = = = = = = = = = = q& 8, -- _; (, = = = = = = = = = = = = = = l@ |. I+ M+ , }$ = = = = = = = = = = = = = = = :; > > !# q- = = = = = = = = = = = = = = T; > P+ z P+ |. w$ = = = = = = = = = = = = = = x$ 9, 0, a, [, ", -"= = = = = = = = = = = = = = [; A }. z P+ |. Y* = = = = = = = = = = = = = = 0; |. P+ I+ A A$ = = = = = = = = = = = = = = /# @ : v x g@ [ ! F 6 = = = = = = = = = = = = = = && Y* = = = = = = = = = = = v. r* %& V+ += G$ G$ j@ : I@ = = = = = = = = = = = = = = = =+ }. u z # v. = = = = = = = = = = = = = b, }. $+ j@ $+ =+ 1; = = = = = = = = = = = = = 4= a& a& a& n> = = = = = = = = = = = = = = {# q% '- Y% Y% z& = = = = = = = = = = = = = = y$ Y% % % > B = = = = = = = = = = = = = = /> M+ $+ + M+ c+ = = = = = = = = = = = = = = = n> c% N+ U; N+ 6 = = = = = = = = = = = = = c& a& a& a& (, = = = = = = = = = = = = = = l@ |. , }. , }$ = = = = = = = = = = = = = = = :; $ > !# q- = = = = = = = = = = = = = = T; > P+ }. P+ |. w$ = = = = = = = = = = = = = = x$ 9& c, a, [, ", -"= = = = = = = = = = = = = = [; A }. z P+ K& Y* = = = = = = = = = = = = = = 0; A P+ I+ A A$ = = = = = = = = = = = = = = d, F ! v a+ g@ [ ! y. 6 = = = = = = = = = = = = = = N= 0; = = = = = = = = = = = = L; %& )$ )$ $& $& $& j@ e, = = = = = = = = = = = = = = = =+ z F z # v. = = = = = = = = = = = = = f, }. $+ ,+ @ g, w. = = = = = = = = = = = = = h, a& q% q% /* = = = = = = = = = = = = = = {# q% q% ,- Y% z& = = = = = = = = = = = = = = y$ Y% % % $ B = = = = = = = = = = = = = = /> z + ' M+ >, = = = = = = = = = = = = = = = a- O+ v$ v$ ^ ~, = = = = = = = = = = = = = m- a& k; a& (, = = = = = = = = = = = = = = l@ A , }. , }$ = = = = = = = = = = = = = = = :; $ > Y% q- = = = = = = = = = = = = = = T; % # I+ P+ |. w$ = = = = = = = = = = = = = = x$ 9, 0, a, [, ", -"= = = = = = = = = = = = = = U- A }. @ }. A Y* = = = = = = = = = = = = = = 0; A P+ I+ A A$ = = = = = = = = = = = = = = i, y. ! [ f@ M@ '@ _ y. 6 = = = = = = = = = = = = = = N= K= = = = = = = = = = = = = Y- )$ [* j, t@ u# 9. : I@ = = = = = = = = = = = = = = = u# M+ F M+ # v. = = = = = = = = = = = = = f, O+ z$ z$ N+ C& >; = = = = = = = = = = = = = k, k; q% q% /* = = = = = = = = = = = = = = {# q% q% ,- Y% z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = /> z + $+ u >, = = = = = = = = = = = = = = = t> -& z$ U; ;- {# = = = = = = = = = = = = = l, q% '- q% &; = = = = = = = = = = = = = = l@ A O+ }. O+ (. = = = = = = = = = = = = = = = :; $ > Y% q- = = = = = = = = = = = = = = b& A , I+ P+ |. w$ = = = = = = = = = = = = = = x$ u z. W> S> ", -"= = = = = = = = = = = = = = [; A }. @ }. A Y* = = = = = = = = = = = = = = 0; |. I+ z A b% = = = = = = = = = = = = = = i, y. ! [ L@ m, S> _ F 6 = = = = = = = = = = = = = = N= %= 8+ = = = = = = = = = = = {# -, `% h& $& -+ / ' I@ = = = = = = = = = = = = = = = u# }. F M+ # v. = = = = = = = = = = = = = q- O+ v$ z$ N+ J> h* = = = = = = = = = = = = = n- q% Y% ,- /* = = = = = = = = = = = = = = {# q% q% Y% Y% z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = /> z $+ + @ & = = = = = = = = = = = = = = = a- O+ z$ N+ &, ;$ = = = = = = = = = = = = = n, %> Y% q% &; = = = = = = = = = = = = = = l@ G# I+ @ O+ (. = = = = = = = = = = = = = = = :; > > Y% q- = = = = = = = = = = = = = = b& A }. }. P+ |. w$ = = = = = = = = = = = = = = x$ u #+ o, g> ", -"= = = = = = = = = = = = = = [; # }. M+ }. A Y* = = = = = = = = = = = = = = 3; A }. I+ A b% = = = = = = = = = = = = = = i, y. =+ a+ ;, m, 0+ V$ u 6 = = = = = = = = = = = = = = N= V> ^= = = = = = = = = = = = = 6, c% -& I+ y. #$ ' I@ = = = = = = = = = = = = = = = _ M+ + M+ # v. = = = = = = = = = = = = = q- O+ v$ z$ b> p, = = = = = = = = = = = = = = C& q% Y% Y% q, = = = = = = = = = = = = = = {# q% '- p- p- z& = = = = = = = = = = = = = = y$ Y% % % Y% B = = = = = = = = = = = = = = /> z + $+ z c+ = = = = = = = = = = = = = = = n> O+ b> `% h; = = = = = = = = = = = = = = r, Y% 4; 4; s, = = = = = = = = = = = = = = l@ G# I+ @ I+ (. = = = = = = = = = = = = = = = :; Y% > Y% q- = = = = = = = = = = = = = = b& G# M+ z P+ |. w$ = = = = = = = = = = = = = = =$ u z. o, 0> ", -"= = = = = = = = = = = = = = [; # }. }. , A Y* = = = = = = = = = = = = = = 0; A I+ I+ G# ,$ = = = = = = = = = = = = = = d, @ ! '@ ;, t, 0+ V$ + 6 = = = = = = = = = = = = = = N= a& w. = = = = = = = = = = = = v& L& t !# : _ ' I@ = = = = = = = = = = = = = = = / @ + @ # v. = = = = = = = = = = = = = q- O+ v$ b> N+ T* = = = = = = = = = = = = = = u, ,- p- Y% q, = = = = = = = = = = = = = = {# q% ,- Y% Y% z& = = = = = = = = = = = = = = y$ q% % % Y% B = = = = = = = = = = = = = = /> M+ + + z c+ = = = = = = = = = = = = = = = n> = b> `% h; = = = = = = = = = = = = = = a> Y% p- Y% v, = = = = = = = = = = = = = = l@ # }. @ }. (. = = = = = = = = = = = = = = = :; > > Y% q- = = = = = = = = = = = = = = b& A M+ z I+ |. w$ = = = = = = = = = = = = = = t# F : v M@ ", -"= = = = = = = = = = = = = = w, A P+ P+ , N+ G; = = = = = = = = = = = = = = 0; A }. }. G# b% = = = = = = = = = = = = = = /# @ z. '@ m, t, 0+ V$ $+ 6 = = = = = = = = = = = = = = N= -- #; = = = = = = = = = = = = H> a& a& x, ! =+ + I@ = = = = = = = = = = = = = = = / u [. Q+ # v. = = = = = = = = = = = = = q- O+ v$ b> N+ y, = = = = = = = = = = = = = = <$ '- Y% Y% q, = = = = = = = = = = = = = = {# q% ,- p- Y% z& = = = = = = = = = = = = = = y$ q% Y% > O; B = = = = = = = = = = = = = = /> @ + + M+ >, = = = = = = = = = = = = = = = n> -& %& N+ h; = = = = = = = = = = = = = = V> Y% p- Y% v, = = = = = = = = = = = = = = l@ # I+ M+ O+ (. = = = = = = = = = = = = = = = :; $ > Y% q- = = = = = = = = = = = = = = b& A }. E; P+ |. w$ = = = = = = = = = = = = = = =$ y. 7. F# f@ ", -"= = = = = = = = = = = = = = L; |. # , , ,+ |> = = = = = = = = = = = = = = 0; G# }. M+ G# b% = = = = = = = = = = = = = = /# M+ ! 0+ m, M@ '@ V$ + 6 = = = = = = = = = = = = = = =, -- q- = = = = = = = = = = = = .% Y% a& K& ! 7. + I@ = = = = = = = = = = = = = = = / u [. @ # v. = = = = = = = = = = = = = q- c% `% b> z, B- = = = = = = = = = = = = = = 6. '- Y% ,- q, = = = = = = = = = = = = = = {# ,- Y% % 4; A, = = = = = = = = = = = = = = y$ q% q% Y% Y% B = = = = = = = = = = = = = = /> u E ' u >, = = = = = = = = = = = = = = = n> = b> N+ ., = = = = = = = = = = = = = = V> p- % Y% v, = = = = = = = = = = = = = = l@ # I+ M+ , }$ = = = = = = = = = = = = = = = :; > > Y% B, = = = = = = = = = = = = = = b& G# }. u P+ |. w$ = = = = = = = = = = = = = = =$ F ! F# f@ ", -"= = = = = = = = = = = = = = d- % A # G# ^ C, = = = = = = = = = = = = = = 3; G# I+ }. A b% = = = = = = = = = = = = = = i, u V$ M@ M@ S> '@ ! u 6 = = = = = = = = = = = = = = 8- -- /* = = = = = = = = = = = = i= V> Z* D, ! 7. F I@ = = = = = = = = = = = = = = = / @ + @ , v. = = = = = = = = = = = = = E, O+ %& :* F, T* = = = = = = = = = = = = = = 6. Y% Y% q% /* = = = = = = = = = = = = = = {# '- p- L& p- z& = = = = = = = = = = = = = = y$ q% %> ,- ,- B = = = = = = = = = = = = = = /> @ ' E F & = = = = = = = = = = = = = = = n> O+ v$ N+ %, = = = = = = = = = = = = = = V> 4; 4; %> &; = = = = = = = = = = = = = = l@ # z @ I+ }$ = = = = = = = = = = = = = = = :; $ % $ f, = = = = = = = = = = = = = = b& G# }. @ }. A w$ = = = = = = = = = = = = = = =$ @ L+ [ f@ ", -"= = = = = = = = = = = = = = i* Y% % A % !- * = = = = = = = = = = = = = = 3; G# I+ }. A G, = = = = = = = = = = = = = = X- _ D '@ 0+ 0+ b+ : M+ 6 = = = = = = = = = = = = = = 8- -- F= J+ = = = = = = = = = = = -@ %= q% u ! : u :, = = = = = = = = = = = = = = = #$ @ + Q+ , v. = = = = = = = = = = = = = q- O+ %& > U; y, = = = = = = = = = = = = = = H, Y% ,- q% R* = = = = = = = = = = = = = = {# q% p- % Y% z& = = = = = = = = = = = = = = y$ q% '- '- 5. B = = = = = = = = = = = = = = U$ F ' : F & = = = = = = = = = = = = = = = V% O+ %& `% h; = = = = = = = = = = = = = = f; Y% p- %> I, = = = = = = = = = = = = = = l@ # M+ F }. (. = = = = = = = = = = = = = = = :; $ % Y% B, = = = = = = = = = = = = = = b& G# }. @ }. A J, = = = = = = = = = = = = = = '; }. ,+ _ a+ ", -"= = = = = = = = = = = = = = F- !# Y% > Y% r, -@ = = = = = = = = = = = = = = 3; G# I+ }. , =$ = = = = = = = = = = = = = = *; K, : &$ '@ a+ b+ : M+ 6 = = = = = = = = = = = = = = 8- -- C& {# = = = = = = = = = = = = U% t + : ' @ :, = = = = = = = = = = = = = = = / @ + @ , v. = = = = = = = = = = = = = 1, -& b> > U; p, = = = = = = = = = = = = = = L, ,- ,- q% r = = = = = = = = = = = = = = {# '- p- p- %> M, = = = = = = = = = = = = = = g* O+ q% q% %, l@ = = = = = = = = = = = = = = U$ u ' ' @ >, = = = = = = = = = = = = = = = V% O+ v$ U; h; = = = = = = = = = = = = = = N, '- Y% q% V% = = = = = = = = = = = = = = l@ # M+ F }. K, = = = = = = = = = = = = = = = :; $ > Y% q- = = = = = = = = = = = = = = b& # M+ @ I+ G# v# = = = = = = = = = = = = = = z& }. y. : v ", -"= = = = = = = = = = = = = = p a> q% q% Z* s- = = = = = = = = = = = = = = = 3= # M+ @ O+ O, = = = = = = = = = = = = = = s# s + ) ( ( ~ . }. 5, = = = = = = = = = = = = = = 8- -- v$ -= = = = = = = = = = = = = 8- $ + E ' @ :, = = = = = = = = = = = = = = = / @ ,+ F P+ v. = = = = = = = = = = = = = 1, U; > %& N+ M= = = = = = = = = = = = = = = b* q% q% a& ^# = = = = = = = = = = = = = = {# ,- Y% p- Y% X% = = = = = = = = = = = = = = @= 6. q% >- G> 8+ = = = = = = = = = = = = = = U$ F ' ' M+ >, = = = = = = = = = = = = = = = V% I+ z$ U; ., = = = = = = = = = = = = = = P, q% '- q% o@ = = = = = = = = = = = = = = l@ # z F z K, = = = = = = = = = = = = = = = Q, % % Y% q- = = = = = = = = = = = = = = b& # M+ @ }. G# -= = = = = = = = = = = = = = = B, , @ ' ) ", -"= = = = = = = = = = = = = = v. R, S, A T, q& = = = = = = = = = = = = = = = 3; # @ F I+ /* = = = = = = = = = = = = = = >; U, z [. #+ . ' 9& , 0= = = = = = = = = = = = = = = 8- -- -- F; = = = = = = = = = = = = X- $ F ' + z p& = = = = = = = = = = = = = = = #$ u ' y. I+ v. = = = = = = = = = = = = = E, = b> b> U; J> ;$ = = = = = = = = = = = = = V, a& a& a& 7 = = = = = = = = = = = = = = {# ,- Y% Y% '- r* = = = = = = = = = = = = = = 0% V> a& a& 0& J+ = = = = = = = = = = = = = = U$ F E E F G = = = = = = = = = = = = = = = V% O+ > N+ *+ 6= = = = = = = = = = = = = = K= a& v; a& P- = = = = = = = = = = = = = = l@ # M+ F z K, = = = = = = = = = = = = = = = W, % A $ f, = = = = = = = = = = = = = = b& K& z u M+ # >> = = = = = = = = = = = = = = c& % I+ @ + ", -"h* = = = = = = = = = = = = = = v. w$ v# d= = = = = = = = = = = = = = = = = 3= , @ F I+ Y; = = = = = = = = = = = = = = J+ A- <. ' 9& Q+ Q+ }. A 0= = = = = = = = = = = = = = = 8- -- -- 6; = = = = = = = = = = = = -@ X, u $+ F }. p& = = = = = = = = = = = = = = = #$ F j@ F I+ v. = = = = = = = = = = = = = q- O+ `% %& v$ Q; &= = = = = = = = = = = = = = c* Y% a& O+ G; = = = = = = = = = = = = = = {# Y% p- J= ,- Y, = = = = = = = = = = = = = = 8+ :; a& a& Y> v. = = = = = = = = = = = = = = U$ y. : : + G = = = = = = = = = = = = = = = Z, , >+ U; u, i= = = = = = = = = = = = = = F; Y% a& % i* = = = = = = = = = = = = = = l@ , @ F z K, = = = = = = = = = = = = = = = W, % A > f, = = = = = = = = = = = = = = b& K& z @ }. # 0= = = = = = = = = = = = = = = X- M> -+ @ , ", -"v> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = b; , @ F }. 9- = = = = = = = = = = = = = = = v. - b& i* 7 K& A $ 0= = = = = = = = = = = = = = = `, -- -- & = = = = = = = = = = = = v. D& }. F F }. p& = = = = = = = = = = = = = = = #$ + L+ y. }. v. = = = = = = = = = = = = = E, c% v$ %& `% , ' = = = = = = = = = = = = = 2. m@ s, .' 8+ = = = = = = = = = = = = = = {# '- p- J= Y% k, = = = = = = = = = = = = = = = F- +' @' >; = = = = = = = = = = = = = = = U$ y. : : [. H# = = = = = = = = = = = = = = = Z, G# z$ `% ^ g; = = = = = = = = = = = = = l@ L; s, m@ l@ = = = = = = = = = = = = = = l@ , Q+ y. z K, = = = = = = = = = = = = = = = Q, > |. > f, = = = = = = = = = = = = = = b& , u @ M+ , #' = = = = = = = = = = = = = = = J- .% Y* K+ ", -"V, J+ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = b; I+ y. y. M+ f= = = = = = = = = = = = = = = = = = = = .% > > t 0= = = = = = = = = = = = = = = 4= -- -- $' = = = = = = = = = = = = v. @; # }. M+ , a* = = = = = = = = = = = = = = = %$ + : y. }. v. = = = = = = = = = = = = = q- O+ %& %& %& )$ D= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = {# '- p- % % 7= v. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = >, y. ! ! ' H# = = = = = = = = = = = = = = = n> G# z$ v$ >+ 6 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = l@ , Q+ y. z K, = = = = = = = = = = = = = = = Q, % |. > f, = = = = = = = = = = = = = = b& O+ F y. u O+ d- = = = = = = = = = = = = = = = = = = = ", -"T- @= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = b; M+ ,+ ,+ u %' -@ = = = = = = = = = = = = = = = = = = .% !# !# q% 0= = = = = = = = = = = = = = = 4= -- a& N+ B = = = = = = = = = = = = F; A , I+ A a* = = = = = = = = = = = = = = = <. ,+ : [. z v. = = = = = = = = = = = = = 1, b> y> i> %& c% =, = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = {# ,- M& M& % 8, &= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = >, + u# _ . &' = = = = = = = = = = = = = = = n> # :* :* N+ %- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = l@ , Q+ u }. a+ = = = = = = = = = = = = = = = W, % A % 1, = = = = = = = = = = = = = = b& I+ y. $+ + }. x& = = = = = = = = = = = = = = = = = = = ", -"!# =$ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = b; i@ . L+ + K, X- = = = = = = = = = = = = = = = = = = Y$ q% q% Z* *' = = = = = = = = = = = = = = 4= a& a& a& 3- = = = = = = = = = = = = v# K, # # % a* = = = = = = = = = = = = = = = <. ' ! ' M+ v. = = = = = = = = = = = = = q- M& U; %& -& )- ^# v. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = {# J= L& L& % >+ >> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = >, ,+ ! _ ' H# = = = = = = = = = = = = = = = n> I+ F V+ N+ o@ v. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = l@ , @ y. M+ K, = = = = = = = = = = = = = = = W, % G# % 1, = = = = = = = = = = = = = = b& I+ y. ,+ ,+ @ /> = = = = = = = = = = = = = = = = = = = ", -"K& A; y$ = = = = = = = = = = = = = = = = = = = = = 8+ = = = = = = = = = = b; @ . 7. j@ F C* v. = = = = = = = = = = = = = = = = = Y$ Z* q% q% 0= = = = = = = = = = = = = = = 4= a& q% v; =' = = = = = = = = = = = = ;$ -' |. A $ a* = = = = = = = = = = = = = = = [ ' ) ' }. v. = = = = = = = = = = = = = q- p- O+ -& -& c% ;' 8+ = = = = = = = = = = = = = = = = 8+ v. = = = = = = = = = = = = = {# % G# G# L& L& >' v. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ,' . { _ . H# = = = = = = = = = = = = = = = '' I+ v$ -+ `% ;= ;$ = = = = = = = = = = = = = = = = -@ v. = = = = = = = = = = = = = l@ , M+ + M+ s& = = = = = = = = = = = = = = = W, % , % 1, = = = = = = = = = = = = = = b& }. y. j@ j@ y. %' i= = = = = = = = = = = = = = = = = = = ", -"M+ , k, 6= = = = = = = = = = = = = = = = = = = = q& )' = = = = = = = = = = !' 9& ~' =+ 7. $+ {' J- = = = = = = = = = = = = = = = = = Y$ q% q% q% 0= = = = = = = = = = = = = = = ]' q% %> q% y- = = = = = = = = = = = = = =- $ % Y% c& = = = = = = = = = = = = = = = [ ' ) ,+ Y% v. = = = = = = = = = = = = = q- L& -& v$ b> U; z$ I- = = = = = = = = = = = = = = = = v> -@ = = = = = = = = = = = = = _- M& )- )- )- G# ;= B = = = = = = = = = = = = = = = = l@ v. = = = = = = = = = = = = = = C : ( ] ) H# = = = = = = = = = = = = = = = k@ F M+ t@ %& z$ .% = = = = = = = = = = = = = = = = && ^= = = = = = = = = = = = = = l@ I+ u + z s& = = = = = = = = = = = = = = = P, A , % 1, = = = = = = = = = = = = = = b& }. y. L+ L+ ,+ F 7 v. = = = = = = = = = = = = = = = = = ", -",+ @ I+ ^' B = = = = = = = = = = = = = = = = = J+ s- /' v. = = = = = = = = = (' + ! v _ : + *= J+ = = = = = = = = = = = = = = = = Y$ q% q% q% 0= = = = = = = = = = = = = = = _' Y% % Y% s, v. = = = = = = = = = = = = #* $ % Y% c& = = = = = = = = = = = = = = = a+ : ) , q% v. = = = = = = = = = = = = = q- -& :* i> h> j> U; M, v. = = = = = = = = = = = = = = 6= :' 8+ = = = = = = = = = = = = = &= M& )- = = c% G# 8- = = = = = = = = = = = = = = = 8+ ^# B = = = = = = = = = = = = = = G : [ v : &' = = = = = = = = = = = = = = = o* ' u V+ 5 b> H J+ = = = = = = = = = = = = = = 2. <' &= = = = = = = = = = = = = = l@ I+ F $+ u [' = = = = = = = = = = = = = = = P, G# , |. 1, = = = = = = = = = = = = = = b& M+ ,+ L+ L+ : + s; X- = = = = = = = = = = = = = = = = = ", -"N+ y. F j@ z& -@ = = = = = = = = = = = = = = = v. && z$ 8> i= = = = = = = = = = (' ' &$ b+ b+ _ ' f@ }' v. = = = = = = = = = = = = = = = .% t Y% t 0= = = = = = = = = = = = = = = 9+ L& c% )- |' ;$ = = = = = = = = = = = = e; % |. $ a* = = = = = = = = = = = = = = = [' 7. y. Y% q% v. = = = = = = = = = = = = = E, `% i> h> ^, -> > -, 1; = = = = = = = = = = = = = v. 1' q% 8+ = = = = = = = = = = = = = &= G# c% U; U; U; = L, I- = = = = = = = = = = = = = v. 1' = B = = = = = = = = = = = = = = B= 9% a+ ,@ ! 2' = = = = = = = = = = = = = = = Q* u# D z$ )$ j, &, b& v. = = = = = = = = = = = = v. c* q% &= = = = = = = = = = = = = = l@ z + $+ F ;, = = = = = = = = = = = = = = = S; # I+ A w, = = = = = = = = = = = = = = 3' F : ! ! ! : y. 4' {; = = = = = = = = = = = = = = = = ", -" = = M& G# I+ {> >; = = = = = = = = = = = = = = -= #- Y% , q = = = = = = = = = 5' E w 0+ 0+ '@ { : _ 6' J- = = = = = = = = = = = = = = .% % A % 0= = = = = = = = = = = = = = = >' = U; -& 8, * = = = = = = = = = = = = q& u# I+ A a* = = = = = = = = = = = = = = = 7' z$ )- L& '- v. = = = = = = = = = = = = = @* > .; +, ^, K> c> %& 8' ]> = = = = = = = = = = = v. R; h> q% 8+ = = = = = = = = = = = = = &= = -& %& %& `% > `% 9' * = = = = = = = = = = = -@ [> v$ q% B = = = = = = = = = = = = = = 0' v f@ f@ v q@ = = = = = = = = = = = = = = = H& [ _ :* {+ ~> %& a' `$ = = = = = = = = = = = = W* ., a& &= = = = = = = = = = = = = = l@ u $+ : ' b' = = = = = = = = = = = = = = = c' I+ u I+ 4. = = = = = = = = = = = = = = $> ,+ =+ v #$ v ] : y. d' K; v. = = = = = = = = = = = = = = ", -"[* b> q; M& % % -$ e' J+ = = = = = = = = = = v. D= f' G# , # w& v. = = = = = = = = g' V$ '@ t, h' i' M@ '@ ! ! *, 3; j' P= p ;$ l@ J+ = = = = = = = k' }. M+ }. 6 = = = = = = = = = = = = = = l' b> :* :* %& m' = = = = = = = = = = = = 6= I& + y. e, = = = = = = = = = = = = = = = s& N+ => )- L& v. = = = = = = = = = = = = = m@ i> n' +, o' ^, w> j> b> p' t- h* = = = = = = = = -@ q' r& Y% p- r' = = = = = = = = = = = = = &= U; %& }> }> [* j, :* M; ;= y$ v. = = = = = = = = `* p* N+ J= J= B = = = = = = = = = = = = = = s' f@ t' t' T$ u' = = = = = = = = = = = = = = = v' y [ `% U+ X+ 5 f% w' W+ ;$ = = = = = = = = J+ 6 8> q% q% x' = = = = = = = = = = = = = l@ ' D 9. ! X, = = = = = = = = = = = = = = = c; u + F m@ = = = = = = = = = = = = = = $> : v [ x g@ a+ v : ,+ z; n> N= w. &= d= 2. 8+ v. = = = = = = = ", -"~> b> x; c% M& J= ,- V+ #> .% = = = = = = = = y' F& k* @ F + + ~* z' A' B' A' C' C' D' z' E' F' b+ M@ G' H' I' J' K' 0+ b+ v ! : L' M' N' <> == z' z' O' E' g= g= g= P' -+ ! : e* Q' E' g= g= E' z' z' O' R' /' S' T' U' U' V' }> <$ .; <$ W' X' Y' }* Z' `' `' ) ) .) E' +) @) #) $) _ u# %) #) &) +) &) @) X* X* #) *) X* X* X* =) =) g= > -) O> `% N+ /' /' .) ;) /' u& A' U' Z' }* >) Z' Z' ,) ') ^, )) !) ~) {) m& Q> y> j> V+ ]) N= J- = = = = v. v# v& )$ % ^; ^; s= ^) /) D& /) u& D& /' S' S' ^) ^) () T' _) [* *@ :) <) <) [) 5 f% -& -, }) :> = = = = = q& q- p, O+ = c% |) /' /) /) ^) D& 1) 2) .) /' /' /' /' 1) S' D& C- m, 3) 4) 5) 6) 7) 8) X* X* @) #) Q' Q' Q' Q' &) #) @) 9) 0) a) b) t' -& c. x# R$ *@ *@ V+ c) u. ^= = = = = v. @= U% d) p- p- Y% :; u& z' z' O' D' z' O' z' z' O' O' Q' +) +) _ b+ a+ b+ a+ @) g= E' O' e) e) O' z' z' z' D' D' z' O' g= f) : ! : (* g= z' C' X$ u& g) g) u& C' B' B' A' O' Q' h) #$ a+ f@ $, i) ;, f@ <. =+ : ,+ F u# }; B> $- S$ D& u& j) k) l) m) T' u& ", -" > b> U; U; x; x; L& J= Y% N+ n) ,; p& W* M- 0= o) Q* s y. $+ L+ 7. _ _ V$ ! ! =+ -+ z. D V$ ! v '@ S> i' p) q) q) q) r) s) K' m, f@ '@ [ b+ b+ v &$ v &$ v b+ r# v [ f@ f@ f@ a+ [ [ v b+ r# v v v b+ D N+ U; > i> D# k& '$ k& u, Q> += ^ j& j& D# :* [* [* M; O+ x y f@ f@ m, b' ;, t) M@ L@ L@ L@ $, i) $, u) u) v) v) b) w) %$ b> D> x) y) j> i> b> -& c% L& M& %& j> i> <$ .; h> z- += D# h> o' z) A) B) C) D) ~) )) E) ~> 5 V+ s; 2) F) X% G- G) ^ > U; N+ b> O> h& j, [* [* %& ;+ N+ `% > H) > U; D> .; -> *@ :) o& <) :) I) :) [) j, f% c- += 9' a- J) q, K) z- `% %& j> :* 5 ^+ h& L) `% L) O+ )- )- O+ N+ N+ N+ = = => v$ y. 0+ M) M) N) O) P) b) ;, m, L@ y Q) x /. /. g@ g@ R) u) S) P) 3) T) v$ U) 5# 8 V) n *@ ^+ h& E$ W) 6* s- X) Y) i> U; = )- N> L& N+ ! { { ] v _ _ _ v v w x x 0+ y m, i) M@ 0+ [ _ _ ] ] ] ( _ &$ v _ ! &$ v v [ '@ '@ &$ &$ 9% ! : ' ' ,+ : -+ ! 7. : 7. ~ #$ <. a+ f@ i) b) 5) t' b) ;, a+ [ #$ ! : L+ ;+ j> ;+ Z) Z) y> `) ! .! .! Z) ", -"[* [* [* %& [* b> U; )- L& p- p- ,- Y% J= , @ y. + L+ 7. _ v [ f@ M@ M@ 0+ a+ a+ a+ 0+ y 0+ 0+ i' i' J' +! @! #! $! %! &! *! r) p) 4) G' G' I' J' K' K' K' K' K' G' G' K' J' 4) 3) I' G' K' 4) J' J' K' b) K' K' h' i' L+ j> =! ^, -! 4 4 ;! U) n& ., >! ,! '! c. e& <) n c- : )! N) N) T) !! ~! {! !! {! ]! ^! ]! ]! /! (! /! (! _! ]! :! [! }! n' E) h> i> j> > `% -& %& }> .; |! 7> ., 7> ;- , ., 1! 2! 3! 4! 5! 6! >! 7! m& n& k& .; )$ )$ V+ )$ .; += h> += z- h> ^, K> D# D# =! }> }> ~> %& ~> h> n' w> D> .> .; o' 8! 9! Z% Z% 0! a! b! c! :) <) [) h& f% d! d! f% 5 <# *@ += &, e& e& k& D# ~> j, L) = b> > c> *> 5. }> j> j> D> j> >+ _ M) e! f! g! h! {! T) T) N) N) !! N) i! j! )! k! r) N) N) /! l! m! -+ }, @& #& m U) [# e& ^+ ^+ t@ <# f% L) b> b> > b> = = v$ <. b' n! o! p! i' m, m, m, i' K' 5) q! I' I' G' I' p) I' G' i' i' i' b) L@ i) t, m, m, i) ;, ;, ;, m, i) i) K' m, m, M@ S> 0> '@ 0+ '@ w 0+ f@ f@ 0+ '@ a+ s& f@ ;, r! b) t' 5) 5) K' t' t' b' ;, f@ (. :. :. o' +, o' o' ^, s! )) t! u! v! w! ", -"[* j, j, [* }> i> > L) M; -& x; q; L& p- x! K& z j@ v [ g@ ;, i) 5) y! y! y! t, t, t, h' h' s) z! s) s) H' q) :! A! A! B! C! m! q) :! :! :! D! E! ]! *! @! *! @! q) @! q) T) *! F! F! $! @! *! :! $! %! *! *! @! G! G! *! b) i> w> H! 1! B) 2! I! G@ J! L= K! L! M! N! O! r@ #& E; f@ P! Q! D! R! R! S! C! C! C! T! U! U! T! R! R! T! T! U! V! W! &, E) s! )) H! X! Y! -! j& D# 6. ;+ z$ U; j, <$ ^, )) Y! m& n& Z! `! C) 3! ~ .~ .~ .~ +~ @~ #~ #~ 7! m& {+ k& z- {+ , $~ %~ $~ l& Y! !) Y! -! H! ^, e& a! e& ~> +, Q> E) ^, x) h> n& &~ *~ =~ t. Z% I) -~ ;~ >~ ,~ '~ b! i& ^+ i& ^+ R$ )~ [# U+ &, {+ .; o' H! ^, D# j> b> F, !~ `) o' o' |! h> += h> n' K> y> y> s& ~~ {~ ]~ ^~ C! /~ (~ /~ W! C! e! R! _~ $! m! :~ <~ [~ }~ |~ 1~ M@ 2~ @& #& @& m C$ 3~ 3~ s@ 4~ 4~ 0* ~> y> -> D> [* `% U; u$ 5~ p) p) I' p) H' H' H' H' r) r) G! q) *! q) q) @! *! &! G! r) G! r) 6~ p) T) 6~ p) 4) 6~ ~> }> }> }> V+ j, L) `% L) `% -& )- |) e~ I+ c- J& }, ;, 0~ 5~ 4) s) s) s) +! 8~ r) p) r) r) f~ 8~ g~ h~ :! %! i~ j~ k~ l~ m~ n~ C! m~ S! o~ p~ }~ C! ^~ ^~ B! B! B! B! q~ r~ s~ ^~ m~ q~ n~ 1~ t~ u~ ^~ ^~ r~ /~ n~ B! #! :. s! Y! z) v~ w~ x~ j j y~ z~ A~ B~ a. a. ~+ l r- {! o~ T! U! C~ D~ E~ F~ G~ H~ I~ I~ E~ D~ C~ D~ E~ D~ D~ J~ =* m& {) {) ~) K~ ~) ~) 1! ., n& &, :. 5. L) L) j, c> u! C> |! n& n& $~ B) L~ .~ L~ ~ L~ M~ 2! 2! +~ >! N~ $~ ., &~ X> O~ P~ -* '! $~ K~ Q~ z) z) N~ 7! :. >+ [* z- &~ 4 E) s! ;> j& 4 '! R~ S~ l Z% a! T~ U~ V~ U~ >~ ;~ o& W~ W~ X~ Y~ 5# H@ ~+ Z! n& E) o' n' w> ~> [* L) Z~ d) )) X! K~ !) `~ I= 4 Y! H! H! { +, O- .{ F~ .{ +{ @{ #{ u~ ${ {~ %{ &{ o~ *{ ]~ ]~ ={ o~ T! V! F~ t, -{ ;{ J! J! >{ S~ g 2 ,{ H$ H$ m D# x> ;> .> [* L) %& '{ #! ){ ){ !{ !{ ){ %! :~ :~ q~ !{ :~ :~ n~ $! !{ q~ n~ n~ !{ $! m! q~ !{ $! B! :~ $! :! #! ~{ {{ L' ]{ !! ~! ){ q) g~ f~ +! p) +! p) p) p) I' I' I' p) p) 5~ 5~ 5~ 5~ 7~ 7~ 5~ 5~ 5~ ^{ /{ ({ _{ :{ ({ <{ [{ @~ C) B) +~ A) C) C) D) @~ D) D) /{ ", -";> D# ;> ;> =! .; i> > %& L) [* b> L) L) `% `% c- }{ !$ t@ -+ <. b' T) G! p) )! |{ N) ){ &! &! &! *! ){ n~ :! m~ m~ 1{ 2{ 3{ l~ l~ l~ V! 4{ %{ 5{ 6{ 4{ *{ @{ @{ #{ %{ %{ 4{ V! @{ %{ 7{ 4{ V! 4{ 8{ F~ F~ ${ ${ @{ #{ 9{ %{ 0{ a{ Q> X! b{ v~ v~ x~ [& (+ c{ d{ e{ f{ g{ e{ S~ '$ -{ :~ I~ I~ h{ h{ i{ j{ k{ l{ k{ j{ i{ i{ i{ i{ m{ n{ m{ o{ p{ Q~ q{ r{ s{ @~ b{ t{ u{ $~ $~ 4 v{ h; ^ j> = `% .> K> y> .> )$ <$ Q> !) M~ 5! L~ L~ .~ w{ w{ 4! 4! L~ 2! L= L= O~ v{ O~ Q; x{ s; (> ,! y{ ., -! ;> > N+ O+ G# = V+ i> c> K> n' {+ N! &~ B~ z{ B$ r@ A{ B{ C{ D{ E{ F{ G{ Z% & H{ z# (# I ~= T+ n& D# ;> y> i> c> j> `% U; -> w! c~ @~ b{ Q~ &~ &~ &~ K~ K~ z) I{ J{ D) K{ L{ M{ N{ O{ P{ P{ Q{ R{ O{ S{ S{ E~ N{ N{ P{ E~ T{ U{ V{ :! c- s. C$ W{ y~ a. a. J! X{ I$ I$ S+ Y{ -! y> =! > -& -+ A! f! q~ <~ Z{ S! S! V! 4{ `{ ] B! m~ l~ l~ 1~ n~ n~ S! ] .] 1~ V! S! S! S! 4{ 4{ R! ] B! #! #! f! $) +] ~! !{ G! h~ g~ h~ q) q) h~ g~ r) r) r) r) g~ g~ k! r) k! k! k! 3) @] @] s #] $] %] &] *] B) w{ 4! [{ 4! w{ =] 2! >! >! -] *] -] -] s{ ", -";] x) C> u! ;] >] ,] D> > [* ~> ~> }> j, L) [* [* '] [* 5. }> ~> }> %$ 5) )] i! i! !] ^! q~ n~ q~ q~ n~ B! q~ 1~ s~ 3{ ~] ~] l~ l~ #{ {] {] I~ ]] F~ @{ F~ ]] ]] I~ S{ ^] I~ ^] ^] ^] I~ ^] S{ ^] E~ F~ /] (] M{ _] /] :] D~ I~ <] A; #~ 4! 4! [] }] N$ N$ j% [& |] 1] 2] 3] z~ V+ ;# ]] S{ 4] 5] h{ 6] 7] 8] 9] 9] 8] m{ 0] 6] a] 7] b] c] d] e] f] g] h] i] b{ j] k] l] m] $~ $~ O~ !- :. 6. z$ O+ N+ v$ >+ >+ >+ ;+ )$ j& 4 y{ 2! w{ L~ L~ ~ ~ 4! w{ 3! L= n] '! r& 8, C& s; s; T- 5. N+ N+ N+ N+ N+ N+ N+ N+ N+ N+ N+ O+ O+ v$ 5 o] .& '! $~ n& T~ N! B{ p] 2! @~ q] r] k& }, s] t] U+ &~ l& j& ~> j> :* >+ ;+ ;+ v$ N+ z$ D# n& !) A) B) @~ $~ $~ '! b{ y{ L~ u] v] w] x] 8' y] k{ m{ i{ z] h{ h{ h{ j{ n{ n{ n{ 6] R{ /] /] A] :] k~ F z- 3~ g i B] j% }# k C] D] r. E] l& D# j> -) v$ F] l~ l~ 1~ U! &{ &{ &{ G] ^] I~ &{ H] V! #{ #{ #{ u~ l~ U{ {] {] {] &{ &{ {] {] G] I~ &{ H] U! 2{ f! f! 2{ f! $! q~ !{ !{ !{ ){ h~ ){ ){ *! !! ~! ~! h~ g~ g~ g~ h~ g~ !! L' +] I] #] J] $] L~ 2! w{ w{ w{ w{ 2! 4! .~ L~ w{ J] K] L] #] K] J] &] [{ ", -"{) x) x) C> Y! M] `) H) j, <$ c> j& j& j, [* j, j, N] j, .; ~> D# D# .; ^, .; K, 3) {! *! q~ n~ q~ n~ n~ n~ n~ m~ l~ 2{ 3{ ~] l~ l~ %{ G] I~ D~ O] /] O] /] /] P] Q] ^] I~ I~ S{ i{ S{ ^] ^] S{ S{ O{ ]] O] R] O] O] O] S{ S{ I~ o~ s D) L~ 4! [] S] i i n. n. T] U] V] W] *~ L) o, X] h{ ^] ^] S{ m{ 7] 9] 9] Y] Y] 7] i{ i{ Z] 8] `] ^ .^ +^ @^ e] #^ $^ B) %^ &^ &^ *^ L= L= 8, r& T- ^ >+ O+ G# G# v$ v$ v$ z$ > [* }> ;> ;] 4! 2! [{ B) 4! B) b{ B) '! $~ v{ `! T- :. z$ N+ O+ O+ O+ N+ N+ v$ v$ v$ v$ v$ v$ v$ N+ N+ N+ N+ = )- = }> n& k& {+ k& n& 1! b{ z) =^ -^ k& G$ ~$ G$ '$ k& D# }> j, j, `% v$ z$ O+ G# v$ >+ D# {+ l& N~ [{ b{ ;^ >^ ,^ '^ '^ )^ !^ ~^ {^ ]^ ^^ /^ (^ Z] m{ j{ S{ S{ _^ 7] 8] :^ 7] m{ R{ ]] ]] <^ Q] [^ $+ >+ b. N$ #@ 3+ j% j A@ '+ }^ (+ 2 &~ j& .> z, j@ |^ u~ u~ 9{ G] G] ^] S{ ^] I~ ^] I~ ^] ]] @{ @{ F~ @{ #{ 5{ I~ G] I~ G] I~ G] G] I~ ^] I~ G] o~ ~] ~] 2{ 2{ 3{ C! m~ m~ q~ q~ n~ n~ q~ q~ $! 1^ #! !! h~ ){ h~ ~! 2^ +] 3^ 4^ 4^ 5^ #] J] ~ L~ w{ v~ 6^ L~ L~ L~ w{ L~ .~ ~ 7^ 5^ K] J] J] 8^ $] 2! ", -"z) s! ;> y> ^, n' !~ -> }> j& ~> D# k& }> j, j, }> [) ~> h> D# k& {+ k& ;> 9^ <$ 0^ a^ t' r) b^ .] .] c^ <~ q~ n~ s~ B! 2{ s~ 1~ u~ @{ <^ :] :] N{ N{ N{ P{ P{ P] O{ d^ :] h{ i{ S{ I~ ^] I~ ^] h{ h{ X] N{ R{ R{ R] R] e^ N{ E~ f^ K{ g^ h^ i^ j^ k^ l^ m^ 5+ 3+ n^ o^ p^ q^ r^ %& 0~ o{ j{ h{ ^] O{ s^ n{ 7] 8] 9] Y] 8] n{ t^ Z] u^ v^ w^ x^ y^ z^ A^ B^ e] C^ D^ E^ F^ G^ H^ I^ O~ O~ Z! h> ;+ v$ G# G# O+ v$ v$ z, b> %& %& [* O> .; c~ X! )) J^ @~ D) 8, T- d) z$ I+ A I+ I+ N+ M+ r% t] K^ a~ L^ M^ 1- I m% `= N^ O^ P^ Q^ R^ S^ ~$ u I+ c% )- U; :* .; 7! [{ m] 1! T^ c> *@ $& $& $& > b> b> b> %& `% v$ N+ G# G# v$ j> ;> j& m& b{ B) L~ U^ V^ W^ W^ X^ Y^ Z^ `^ / ./ +/ @/ #/ $/ j{ %/ E~ &/ */ 9] 8] 7] $/ s^ N{ %{ 4{ 9{ V{ +{ r# !$ ~+ =/ 3# 3# 5+ f (+ [& 1 =/ }] y{ n& c> -/ w# ^~ l~ u~ #{ G] G] I~ O{ :] <^ I~ G] ^] :] P{ f^ F~ F~ #{ T{ <^ <^ 5{ Q] :] D~ Q] Q] D~ Q] 5{ %{ ;/ 3{ 2{ s~ s~ e! S! .] c^ q~ m~ m~ n~ q~ n~ E! ]! ]! G! @! $! >/ 8^ 8^ ~ .~ i^ ,/ '/ )/ !/ ~/ ~ {/ v~ ~ ~ ~ .~ ~ v~ v~ ]/ {/ ^/ 5^ L! L~ ~ 4! ", -"b{ 7! T- :. :. ~> ~> j& ~> D# ~> k& {+ ~> }> j, j, ~> D# j& D# k& k& D# }> }> j& j& ~> 5. 5. _. k! // E! <~ n~ m~ n~ m~ m~ m~ l~ #{ @{ %{ #{ f^ ^] S{ ^] S{ ^] G] ]] R] O] z] i{ S{ ^] S{ I~ ^] ^] h{ S{ h{ S{ N{ R] O] O] ]] O] s^ (/ ', %] _/ :/ P+ . { j/ k/ l/ m/ n/ o/ p/ q/ r/ s/ t/ u/ v/ w/ x/ y/ z/ A/ B/ C/ D/ E/ F/ G/ H/ I/ J/ K/ ' L/ M/ N/ 7> ., v! `) d) 6. <$ 6. 6. 5. 5. >+ >+ >+ v$ O+ A> O/ Z~ P/ x> s! K~ [{ L~ .~ Q/ R/ S/ T/ U/ V/ W/ X/ W/ Y/ Z/ B) !; #/ `/ e^ O] R] a] 8] n{ k{ ( O] :] &{ &{ f^ /] ]] .( z (# f +( @( $@ j% y~ #( 2] V] $( -^ m& c> u$ f! *{ l~ #{ @{ G] G] ^] ]] @{ 8{ ^] ^] I~ I~ G] G] P] F~ F~ @{ @{ F~ F~ @{ F~ ]] /] /] O] ]] @{ #{ u~ l~ 1~ 1~ m~ .] %( &( *( q~ q~ q~ !{ !{ q~ =( =( E! |^ q# J> 5! ~ 5! -( ;( >( ,( '( )( !( ,/ 5^ 5! L~ ~ ~ L~ ~ ~( ~/ {( )/ ]( ^( /( 5! (( _( 4! ", -"b{ [{ %, ^ 5. c> j& ~> ~> ~> D# {+ n& D# }> }> ~> D# D# j& j& {+ j& j& ~> }> D# ~> ~> ;+ z$ % y. (. ~{ A! 1~ q~ !{ n~ m~ 1~ u~ #{ #{ u~ l~ 8{ S{ S{ i{ h{ ^] :] /] /] O] :( j{ i{ i{ j{ S{ S{ j{ i{ i{ h{ h{ e^ R] R] R] O] R] %/ z] l- C) <( [( }( |( 1( $~ h> <$ 2( 3( i' F % O+ #$ $, 2^ 3{ t~ /] 4( 7] 7] 7] Z] n{ j{ ( R] 1^ 5( '^ 6( 7( 7( 8( ~^ {^ v] 9( 0( a( b( 3] c( C{ '! l& k& j, [* v$ G# % |. # # # O+ O+ O+ O+ O+ N+ N+ M+ G# O+ d( e( f( g( h( i( j( k( l( m( n( o( p( q( r( s( t( u( v( w( x( y( y( z( A( B( C( D( E( F( G( H( I( J( K( L( M( g, N( j@ u# -+ 5. 5. 5. 5. >+ >+ z$ z$ v$ O+ G# z, f/ v! !~ -> u! {) @~ 4! ~ [] O( z^ P( Q( R( W/ Y/ S( T( U( 2! y{ C- V( R{ O] R] :( Z] Z] k{ ( O] f^ {] I~ &/ R] /] G' { ,@ P^ m% W( X( g y~ Y( 2] U] Z( w] <{ += `( _ ]] @{ #{ F~ ^] I~ G] @{ @{ F~ ^] ^] I~ G] I~ G] @{ ]] /] F~ /] /] @{ @{ F~ F~ ]] ]] ]] ]] F~ @{ #{ u~ 1~ m~ n~ <~ %( ._ +_ !{ !{ q~ q~ q~ :! {{ $) X; @_ y, #_ .~ .~ {/ ,/ $_ 9( %_ &_ *_ )/ -( 5^ ~ L~ .~ v~ v~ v~ =_ -( ,/ -_ ;_ ]( -_ K] _( _( w{ ", -"4! A) X> 6. .; E) w> =! c> w> .; D# k& E) ~> ~> j& j& D# j& {+ k& j& j& j& D# D# }> ~> )$ b> % v$ N+ z$ v 8~ %! m! l~ l~ u~ #{ #{ @{ V{ f^ N{ z] S{ j{ j{ i{ s^ >_ O] ,_ Z] n{ j{ n{ a] i{ %/ n{ Z] j{ h{ h{ k{ l{ l{ k{ '_ k{ j{ z] 6) T* )_ =] m& j& U; p- q% % !_ l~ 1~ $! s& , H= -- a& > , ! b) e! E~ ~_ :^ {_ ]_ ^_ /_ `= 8^ (_ __ ./ / :_ <_ [_ ~^ w] }_ |_ V] e/ &^ H^ $~ n& c> L) %& N+ |. % e~ e~ e~ # G# O+ , % A # 9. ^. 1_ 2_ 3_ 4_ 5_ 6_ 7_ 8_ 9_ 0_ a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ A_ B_ C_ D_ E_ F_ G_ ]{ N( @ M+ }. }. I+ G# }. P+ I+ G# G# Z) w! *> H_ 9^ u! X! @~ w{ 6^ y^ Z/ I_ J_ J_ K_ 7( L_ M_ N_ O_ E{ (> P_ Q_ O] e^ R{ %/ s^ R_ S_ T_ 5{ 6{ U_ I~ #{ !{ V_ w) i' t) W_ a^ X_ Y_ L- Z_ `_ |_ : +^ N~ &, .: +: P{ ]] #{ F~ Q] D~ 5{ V{ P] P{ S{ S{ ^] ^] &/ D~ f^ /] O] O] Q{ X] #{ @{ #{ ]] F~ /] ]] @{ u~ #{ #{ u~ l~ n~ n~ .] @: E! @: !{ !{ !{ M) i' [ ^ -* 4^ #: ~/ w~ v~ v~ [] $: %: &: &: &: ;( ^/ -( 7^ {/ ]/ ]/ /( /( v~ {( 5^ 5^ )( ^( ]( *: &] =: -: 4! ", -"4! B) ;^ {+ ~> C> x> x> h/ ;: v! ! u! ;] ;> D# k& k& j& j& n& k& j& D# j& D# ~> j& ~> ~> j, 2; = v$ v$ `% %& D# F] n~ C! >: u~ F~ F~ G] I~ j{ h{ ^] j{ j{ n{ j{ j{ i{ i{ j{ n{ Z] ,: ,: ,_ j{ n{ n{ j{ h{ i{ Z] ': 7] 8] ': 7] n{ n{ n{ ]{ ;+ O+ % Y% Y% % Y% Y% ;, l~ l~ s~ 2{ !! ~ ): !: -- -- -- -- q% O+ ,+ ~: {: ]: ^: 4 b. 8> ,^ /: (: _: :: <: [: }: |: 1: 1: 2: U] 3: 4: K~ |! i> z$ v$ # e~ D, E; E; E; z K@ K@ #$ 5: R> 6: 7: 8: 9: 0: a: b: c: d: e: f: g: h: b_ b_ b_ i: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z: A: B: C: x_ D: E: F: G: H: I: J: K: L: M: (] a+ E !$ N+ E; N: E; D, D, O+ z$ 5. j, [* }> u! X! [{ .~ 1: 8( S/ S/ O: P: Q: R: S: T: Q$ B{ $~ C& U: j{ n{ R_ (] F~ V: H+ W: X: Y: Z: `: &{ // N) k! 3) b) p! /. /. [ w M@ < M^ .< A* +< @< I~ S{ S{ /] F~ O] /] /] P{ Q] ^] z] j{ j{ S{ ]] O] R] R] R] ( &/ ^] S{ X] ]] ]] O] O] ]] /] @{ #{ @{ #{ u~ u~ l~ 1~ m~ q~ !{ q~ n~ G! M@ 6. v$ %& )$ j& N~ w{ v~ v~ 6^ v~ 6^ c/ #< $< '( &_ '( ~ .~ .~ {/ 5^ -( {( %< {( ~( 5^ 5^ &< ;_ *< =^ 4! L~ 4! 2! ", -"w{ b{ n] l& }> C> C> C> >] d~ >] =< H! z) &~ {+ j& j& j& j& j& {+ k& k& j& D# j& {+ D# ~> [* M; = v$ z$ b> [* M; L) $& 7' -< #{ #{ %{ 5{ ^] S{ S{ S{ i{ Z] 7] 7] 7] Z] n{ Z] 7] 7] k{ O] O] i{ n{ Z] j{ i{ Z] n{ Z] 7] 9] 5/ 5/ 9] 7] i{ 1^ G# % % % % % q% % [ u~ u~ *{ 3{ 2{ f! k! ( x! -- -- -- -- -- -- -- ;< >< z$ D# S~ s; >^ ,< ]^ _: '< )< !< ~< : {< Z) z$ G# e~ E; E; r- r- r- -{ /< (< _< :< << [< }< |< 1< 2< 3< 3< 4< 5< 6< 7< 8< 9< 0< c_ a< b< c< d< e< f< g< h< i< j< l_ k< k< l< l< m< n< o< p< q< r< s< t< u< v< w< x< y< z< A< B< C< D< E< F< G< H< =; w# W$ I< r- E; D, O+ O+ v$ ~> j& j& C> u! {) [{ .~ R/ |: z^ 7( J< K< L< S: M< N< f. I! 8> 7~ +] ]{ w ! T$ O< P< Q< R< S< T< o{ S{ H] g! ~! k! G' U< /. /. x L@ f@ f@ M@ >@ i' 6~ H~ d^ ^] S{ e^ R] ( R] R] /] 6{ G] h{ j{ j{ i{ O] R] ( ,: ( ( %/ h{ h{ %/ R] R] O] R] F~ R] /] F~ @{ #{ u~ l~ 1~ l~ 1~ n~ ){ z! ,@ n% %& >+ v$ b> }> }> {+ B) ~ [] Q/ v~ v~ V< @^ W< ]( ;( ^( ~ ~ ~ 5^ 5^ -( ,/ X< ~( -( 5^ 5^ ^/ ]( ;_ C^ w{ v~ w{ 4! ", -"y{ N~ N~ Q~ w> u! u! u! ^, ,] ^, ;] H! H! 4 {+ j& k& j& w> a! k& 0! k& j& w> k& |! E) D# M; q; = v$ z$ > [* [* L) j> > V+ m, :! S! G] I~ G] :] &/ s^ n{ Z] 7] Z] n{ Z] j{ n{ */ N{ ]] O] 6] n{ Z] j{ h{ j{ 6] j{ ': 5/ Y] 5/ Y< 8] :] _ $ $ % T> A> Z< G# G# + 1~ %{ t~ ~~ 3{ ~~ 1~ m~ r) F q% -- -- -- -- -- -- a& G# j, .& x{ '! _$ `< [ .[ +[ z^ @[ __ #[ $[ 9/ 2] 3: %[ z) x> j> M+ G# z E; -{ r- 9% &[ *[ =[ -[ ;[ >[ ,[ '[ )[ ![ ~[ {[ ][ ^[ /[ ([ _[ :[ <[ [[ }[ |[ 1[ f< 2[ 3[ 4[ 5[ 5[ 5[ 6[ 7[ 8[ 9[ 0[ a[ b[ c[ d[ e[ f[ g[ h[ i[ j[ k[ l[ m[ n[ o[ p[ q[ r[ s[ t[ u[ v[ w[ x[ y[ z[ A[ {{ J& r- E; N+ M+ M+ `% V+ 4 X! H! X! z) 2! v~ <( y^ B[ C[ D[ E[ F[ G[ }# P$ 3 %, Y% a& x- x- >< `( H[ I[ J[ K[ L[ M[ N[ T! H] }~ {! 5~ i' O[ g@ g@ y b) 5~ 5) b) t, P[ !{ f^ d^ i{ j{ ,_ k{ ,_ e^ R{ '_ h{ I~ h{ n{ i{ h{ N{ N{ ,_ k{ k{ l{ 6] i{ j{ s^ ,: l{ R] R{ 8{ R{ e^ V{ #{ #{ #{ u~ 1~ /~ *! m, &$ J& `% `% %& z$ v$ v$ }> =! ;> z) w{ .~ .~ v~ Q[ %: v] w] #< 0( $< [] ~ ]/ 7^ 7^ ,/ ,/ ~( -( ~( ^/ R[ S[ e] $^ T[ w{ .~ ~ U[ ", -"L= n] A) b{ m& X! u! C> ~> c> k& {) H! u! n& {+ {+ -! u! u! a! -~ -~ w> u! ;> E) u! x> ;> M; 2; c% N+ v$ > j, j, b> >+ >+ z$ >+ $+ F# V[ H] 5{ N{ R] ,_ j{ j{ Z] 7] 7] j{ i{ 7] */ P{ /] '_ 7] Z] n{ i{ ^] ^] N{ ( W[ 4/ 8] 8] X[ Y[ d% Z[ p- `[ } K& .} => G# % }. @, U: C~ {] &{ 6{ *{ 3{ 2{ A! 5) 9& a& -- -- -- -- -- a& N+ Q> '! &~ +} @} 9/ #} $} o. @} 9/ h o. %} @} V] &} @~ x> z$ e~ r- *} =} -} ;} >} ,} '} )} !} ~} {} ]} ^} /} (} _} _} :} <} [} }} |} 1} 2} 3} 4} 5} 6} 7} 8} i< 9} 0} a} b} c} d} e} f} g} x( h} i} j} k} l} m} n} o} p} q} r} s} t} u} v} w} x} y} z} A} B} C} D} E} F} G} H} X' -' >+ N+ E; I} D, D, j@ ^, >] J} #~ [{ L~ v~ O( 8( / K} L} M} N} X{ P$ b. z$ -- -- -- !# t' A! 6~ O} 2( r~ P} Q} R} N) S} T} U} t) 0+ y L@ i) b) 5) 3) 3) 5~ 5~ k! A! V} h{ Z] Z] n{ n{ j{ &/ S{ i{ S{ I~ S{ i{ h{ I~ I~ ^] h{ i{ j{ n{ n{ n{ n{ Z] 7] Z] s^ h{ S{ ^] &/ G] {] H] o~ ~~ W} ,@ -+ %& L) `% U; v$ >+ z$ v$ v$ x) x> x> ;] @~ 2! ~ v~ .~ X} '^ Q/ '^ 6^ 6^ ~ .~ v~ ~ Q[ _/ Y} $: M= ^/ ;_ *< h^ w{ 4! 4! w{ .~ i^ V< ", -"P~ L= [{ b{ z) X! H! ;> ~> j& {+ H! K~ s! E) {+ {+ s! s! s! Z} -~ -~ 8! X! u! C> u! u! j& M; q; c% N+ N+ `% [* }> > >+ >+ z$ v$ v$ @ + v 2^ ;/ `} | n{ h{ j{ j{ 7] Z] Z] 7] j{ N{ ( ,: 8] Z] n{ n{ h{ S{ N{ R] ,: */ Z] 7] Q{ #{ 7~ .| +| @| #| # b- $| G# % |. W} %| 4] &{ G] E~ V} 3{ 2{ f! 2{ $) *+ G# -- -- -- -- -- % j> j& k& &| *| =| E@ k^ ]< ]< -| @} -| 2] 3: 3: ;| b{ x> -& E; E !_ >| ,| '| )| !| ~| {| ]| ^| /| (| _| :| <| [| }| || 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| a| b| c| d| e| f} f| f| g| g| h| 0} i| j| k| l| m| n| o| p| q| r| s| t| u| v| w| x| y| z| A| B| C| D| E| F| G| H| I| J| K| L| M| %< ;+ r- r- r- E; N+ u# *+ K~ @~ 2! ~ 6^ O( N| !< O| P| Q| j P$ O! k; -- -- q% ;, 2{ ~! T) W} W} `( O} R| S| T| U| G! U} t) f@ y y L@ b) k! !! #! #! A! f! f! Q! ^] 7] n{ j{ n{ i{ S{ I~ G] I~ G] S{ i{ j{ h{ S{ G] I~ i{ j{ h{ j{ j{ Z] Z] n{ j{ n{ h{ S{ I~ G] G] U! +] 0~ #$ >+ z, > L) L) > > >+ ;+ >+ v$ v$ 9^ x) C> s! H! b{ 2! L~ L~ .~ v~ [] 6^ v~ v~ .~ v~ [] v~ V| W| X| ;( )/ &< Y| ;_ K! ~ L~ L~ L~ L~ C^ c/ ", -"A) <{ [{ @~ [{ b{ K~ u! D# k& k& -! Q~ -! k& -! k& |! H! s! a! a! o] Z| {) C> u! s! H! E) x; M; = O+ N+ z$ :* ~> :* >+ :* >+ z$ v$ v$ %& 5. ^ `| >/ 1 .1 6] h{ j{ n{ t^ Z] 7] Z] >_ l{ +1 7] n{ 7] Z] Z] j{ N{ N{ '_ */ Z] a] @1 #1 $1 %1 &1 *1 =1 -1 ;1 T> G# 4; M& ,@ >1 C~ G] G] E~ 0{ <] 3{ ~~ 2{ ~] ,1 ^: }$ % -- -- -- -- % L) )$ X& '1 )1 !1 ~1 {1 ]1 p^ 3: ^1 /1 &^ G^ (1 M~ y> z- /- _1 :1 <1 [1 }1 |1 11 21 31 41 51 61 71 81 91 01 a1 b1 c1 d1 e1 f1 g1 6| h1 i1 j1 k1 l1 m1 n1 o1 p1 q1 r_ e} r1 u( s1 t1 u1 e} v1 w1 x1 y1 z1 A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1 N1 O1 P1 Q1 R1 S1 T1 U1 V1 W1 X1 Y1 Z1 `1 2 / J& @> @> r- t@ +, y{ A) 2! <{ .~ 1: Z/ S( .2 /: $@ C$ x; -- -- t _. $) 3{ $) &! 1- 8, R| 8, +2 @2 #2 /{ t% J' K^ g, b' T$ y 5) #! f! ~~ ={ 0{ %| $2 %2 %( :] j{ j{ i{ h{ S{ I~ &{ 6{ Q] S{ %/ s^ j{ z] D~ Q] i{ n{ j{ n{ 7] 7] n{ j{ j{ 6] i{ d^ I~ U! &2 T$ :* z$ v$ O> D> H) L) [* j> H) >+ >+ z$ v$ N+ .> C> u! s! ;] X! B) L~ 6^ 6^ [] 6^ (_ *2 6^ [] v~ v~ .~ X} =2 -2 >( ^( ^( $_ '( U[ L~ ~ .~ L~ L~ h^ ;2 ", -"5( 5( >2 5( 5( [{ z) s! j& j& j& n& 4 {+ -! ;] u! u! s! u! j& j& {+ K~ K~ ;] |! {+ `~ j& x; x; `% v$ v$ v$ v$ >+ :* }> j, j, ~> ~> j, :* }> ;> x> H! #~ ,2 '2 )2 :( */ n{ 7] 8] 7] */ j{ Z] 7] 7] 7] Z] Z] n{ i{ S{ z] Z] Q{ F~ !2 a) ~2 {2 ]2 ^2 /2 (2 _2 :2 <2 <2 2; 9% >1 [2 G] &{ ^] G] H] {] o~ {] U! l~ l~ s~ #! v x, -- -- -- q% G# , 2 g O$ 1( S] P~ w@ N$ Y( +< +< +< i- f) }2 |2 12 22 32 42 52 62 72 82 92 02 a2 b2 c2 d2 e2 f2 g2 h2 i2 j2 k2 l2 m2 n2 o2 p2 q2 r2 s2 t2 u2 v2 w2 x2 y2 z2 A2 o| B2 C2 l| n_ D2 E2 r_ F2 G2 H2 I2 J2 K2 L2 M2 N2 O2 P2 Q2 R2 S2 T2 U2 V2 W2 X2 Y2 Z2 `2 3 .3 +3 @3 #3 $3 %3 &3 *3 =3 -3 ( =& E :* J& r# X, n] &~ ;^ 6^ R/ S/ ;3 >3 g. c. a& -- x, L@ A! 1{ j> [* j, j, +> H) Z~ z, z$ N+ N+ ^3 -! m& H! u! x> K~ ~ Q/ 1: Q/ 6^ /3 ]< Z( '^ Q/ 6^ v~ @^ (3 _/ v] $< $_ $_ _3 Q[ L~ ~ .~ .~ .~ V< :3 ", -"d~ :{ :{ :{ 5( 2! B) {) j& k& k& {+ 4 4 X! s! u! u! s! s! E) k& k& !) @~ H! k& {+ n& j& L) x; `% >+ v$ N+ v$ z$ :* }> [* }> }> j& j& }> D# }> 9^ C> 7! ~) u, <3 ]~ ( [3 7] Z] j{ j{ j{ Z] 7] Z] Z] n{ 9] 9] n{ h{ i{ 8{ }3 |3 13 23 33 f> 43 l. 53 63 73 83 x; b- b- 93 4 ,4 '4 )4 !4 ~4 {4 ]4 ^4 /4 (4 _4 :4 <4 [4 }4 |4 14 D 24 D D 4 $~ n] 34 Q/ }( 44 54 g- J= -- q% T$ f! 2{ 4) U} 7% 64 74 m% Y_ a~ a~ a~ U} a~ Y_ |! A; 84 &2 ' a+ A! 94 V( Z] Z] ]_ 04 a4 Y: l~ !{ n~ I~ i{ ^] G] &{ ^] '_ ( ( ,: R] ( ,: O] R] s^ Z] j{ j{ j{ i{ Q{ O] /] b4 !; *+ 6. 5. >+ `% M; [* j, }> }> j, ~> }> > D> Z~ z, v$ v$ N+ 93 n& s! C> C> C> u! [{ ~ '^ <( [] 3: V] U] c4 1: 6^ Q/ u] d4 e4 $< %: f4 g4 f4 -_ .~ .~ .~ [] .~ h^ ^( ", -"d~ >2 :{ h4 -] B) [{ K~ |! k& {+ l& l& n& E) E) s! ;] X! {) `~ {+ {+ K~ {) H! |! n& 4 }> M; U; b> z$ v$ v$ z$ `% U; j, }> }> }> D# ~> }> ~> w> C> ;> C> ;> <$ t] >@ <3 F* $/ m{ 6] 6] j{ t^ n{ n{ Z] Z] i4 i4 Z] m{ E~ l~ j4 k4 l4 m4 n4 o4 ** p4 q4 r4 [^ -< w- s4 I N@ t4 t' E! {3 D~ I~ {] u4 G] &{ T{ #{ 4{ #{ V} ;/ t~ >: v4 w4 Y% a& >+ y~ w@ w@ L= x{ $~ &, / _. A! ^_ x4 y4 z4 A4 B4 C4 D4 E4 F4 G4 H4 I4 J4 9: K4 L4 M4 N4 O4 P4 Q4 R4 S4 T4 U4 V4 W4 d: X4 2} Y4 Z4 `4 7< 5 .5 +5 @5 #5 $5 %5 &5 *5 =5 -5 ;5 >5 ,5 '5 )5 !5 ~5 {5 ]5 ^5 /5 (5 _5 :5 <5 [5 }5 |5 15 25 35 45 55 65 75 85 95 05 a5 b5 c5 d5 e5 f5 g5 h5 i5 j5 k5 l5 m5 94 9. 03 ! *@ u, L= n5 6^ O( o5 p5 ^3 H= Y% s& j~ 3{ 2{ 9% / f) q5 r5 s5 ,1 t5 W} W} <3 W} u5 v5 w5 x5 y5 z5 A5 B5 k* e! 6] u^ C5 D5 ~3 E5 s~ m~ <~ // &{ I~ G] I~ z] ( ( R] ( ( ,: ( O] ( j{ 7] j{ j{ :( h{ .{ F5 G5 0^ m& ;> j> j> V+ :* ~> j& ~> j, ~> j, ~> [* j> Z~ Z~ z, z$ N+ N+ 2~ -! C> C> C> u! x> H! 2! 6^ '^ H5 I5 2] J5 K5 L5 c4 [] X} d4 M5 %: ;2 ]( N5 >( *_ .~ U[ K! v~ K! S[ *_ ", -"$~ '! P~ P~ n] n] y{ &~ {+ $~ n& 4 {+ k& E) k& {+ l& n& 4 4 n& n& !) {) H! T^ O5 !) i> %& >+ > j, [* [* [* %& [* j, ~> ~> }> }> ~> j, }> ~> D# ~> ~> j& k& n& l] P5 q^ 7= n- n- Q5 R_ R5 n{ Z] Z] S5 S5 R5 ,_ F~ u~ T5 |3 |3 U5 |3 V5 W5 W5 X5 Y5 Z5 |3 ~] @+ `5 6 d% M; c> o' @~ .6 +6 I~ :] G] &{ {] <^ ^] G] &{ G] ^] 5{ G] G] @] >+ I+ $~ @6 #6 h; ^ >+ w# 2{ $6 %6 &6 *6 =6 -6 ;6 >6 ,6 '6 )6 !6 ~6 {6 ]6 ^6 /6 (6 _6 :6 <6 [6 }6 |6 16 26 36 46 56 66 66 66 76 86 96 l: 06 a6 b6 c6 d6 e6 f6 g6 h6 i6 j6 k6 l6 m6 n6 o6 p6 q6 r6 s6 t6 u6 v6 w6 x6 y6 z6 A6 B6 C6 D6 E6 F6 G6 H6 I6 J6 K6 L6 M6 N6 O6 P6 Q6 R6 S6 T6 U6 V6 W6 X6 Y6 Z6 `6 7 .7 +7 9% 9% r# =* X< @7 #7 w' $ ' !! f! ~] 3{ ~! > G# z$ $7 %7 (> &7 y= *7 F! O} W} O} =7 2( -7 ;7 >7 ,7 '7 )7 !7 g@ ~{ %2 G] I~ o~ e! A! k! k! /! 3{ P{ /] ,: ~7 ,: R] ( ( ( ( R] O] &/ i{ n{ >_ #{ p) ,@ D# [* j, }> }> ~> }> ~> }> j& ~> ~> }> j, j, }> [* +> -) Z~ Z~ -) O/ /; [* -! k& u! C> C> x> s! {) 2! .~ [] [] *2 c4 {7 2] U] Q[ c/ $< v] @^ c/ v~ v~ Q/ X} c/ %: c/ #< h^ K! [] ", -"&~ '! ;^ '! n] n] '! '! 4 &~ &~ &~ 4 k& j& {+ 4 4 4 n& l& &~ $~ !) {) H! T^ q] Q~ c> z$ v$ j> D# }> L) [* j, j, [* }> j& D# D# ~> }> }> ~> j& {+ j& k& n& +< &^ ]7 ^7 /7 )^ Y/ a/ (7 y] 7] 7] n{ _7 _7 _7 1/ }3 :7 T5 |3 j4 j4 j4 <7 j4 |3 j4 9; )1 [7 C- H+ 7% s% x; 2; D# X! B) c~ }7 ;/ F~ <^ G] {] G] S{ I~ G] ^] h{ S{ I~ ^] 94 ;/ #! W} ,@ 9% ( |7 `: 17 27 37 47 57 67 77 87 97 07 a7 b7 c7 d7 e7 f7 g7 ^6 h7 i7 j7 k7 l7 m7 n7 o7 p7 q7 4} r7 s7 s7 s7 t7 u7 v7 v7 w7 x7 y7 z7 A7 B7 C7 D7 E7 F7 G7 H7 I7 J7 K7 L7 M7 N7 O7 P7 Q7 R7 S7 T7 U7 V7 W7 X7 Y7 Z7 `7 8 .8 +8 @8 #8 $8 %8 &8 *8 =8 -8 ;8 >8 ,8 '8 )8 !8 ~8 {8 ]8 ^8 /8 (8 _8 :8 <8 [8 ]! i) ( v r& }8 |8 U} 5) f! 3{ 3{ ;/ ;/ ;, Z* % N+ 18 28 38 48 58 68 78 88 f) =7 O} O} 98 08 a8 b8 c8 d8 e8 ;+ z$ $+ { y 5) !! !! k! k! k! !! s~ O] ( ,: ( ( ( R] R] R] R] M{ (] f8 2{ ;, 9. 9% z- D# }> }> j, j, ~> }> j, j, ~> ~> }> }> }> [* L) [* > -) -) -) g8 O/ O/ L) {+ k& u! s! C> x> s! ;] z) B) L~ 6^ <( '^ J5 2] 3: h8 #< #< %: c/ #< K! .~ U[ V< c/ v] @^ c/ V< Q[ [] ", -"e% P~ ;^ $~ z{ $~ &~ n] &~ 4 3~ ;^ n] n& 8! n& 4 n& &~ &~ &~ '! n] K~ {) H! i8 j8 Q~ %& O+ v$ > D# ~> [* [* }> ~> }> j, }> ~> D# D# j& ~> k& 4 n& k& l& ;^ P~ k8 j] k] l8 m8 n8 o8 a/ p8 :^ $/ Z] q8 r8 s8 X5 :7 t8 <7 u8 j4 j4 j4 |3 v8 <7 t8 w8 P_ x8 y8 <3 $+ r% M; c% U> X! [{ @~ d~ s; f! {] 6{ [2 {] I~ ^] G] h{ i{ S{ I~ I~ I~ I~ &/ F~ g~ m~ ': z8 A8 B8 C8 D8 E8 F8 G8 H8 I8 J8 K8 L8 M8 N8 O8 P8 Q8 R8 S8 T8 U8 V8 W8 X8 Y8 Z8 `8 9 .9 +9 x7 @9 @9 @9 @9 #9 $9 @9 %9 %9 &9 *9 =9 -9 ;9 >9 ,9 '9 )9 !9 ~9 {9 ]9 ^9 /9 (9 _9 :9 <9 <9 [9 }9 |9 19 29 39 49 59 69 79 89 99 09 a9 b9 c9 d9 e9 f9 g9 h9 i9 j9 k9 l9 m9 n9 o9 p9 q9 r9 s9 t9 u9 v9 w9 x9 y9 z9 A9 9. A; %! n~ U! ~~ ~~ ~] V} 2{ u _* % 6. B9 C9 D9 E9 F9 G9 H9 P_ 88 -< =7 O} O} I9 h4 J9 K9 L9 M9 i> L) b> c% > A z { 5) k! k! ~! ){ l~ O] R] R] ( >_ R] R] L{ Q_ ${ ', %, 5. )$ V+ ~> z- k& }> }> }> ~> j, j, [* j, }> }> }> ~> }> j, [* j, U> Z~ -) -) F, F, F, [* k& m& {) s! C> u! s! K~ b{ w{ 4! .~ 6^ 6^ 3: 3: F^ @^ @^ #< @^ @^ V< K! [] [] Q[ #< c/ j^ V< h^ U[ v~ ", -"l k N9 O9 N9 3~ O9 N9 .& O! .& P5 z~ P9 X! b{ b{ '! L= L= Q~ @~ A) y{ $~ $~ A) 2! K~ x; q; L) > }> }> [* j, }> }> ~> D# D# ~> D# k& n& n& {+ :# `~ z) Q9 q^ g R9 a. N9 `_ S9 T9 O: U9 V9 W9 X9 L{ 23 Y9 q# Y9 q# q# Z9 `9 `9 <7 |3 |3 /- b4 0 .0 +0 @+ %$ |. G# O+ O+ G# !$ l @0 R~ n& {+ u, k* #0 $0 &{ G] S{ G] S{ h{ S{ &{ I~ N{ ]] O] R] ( %0 &0 *0 =0 -0 ;0 >0 ,0 '0 )0 !0 ~0 {0 ]0 ^0 /0 (0 _0 :0 <0 O4 [0 }0 |0 10 X8 20 30 40 50 60 70 80 90 %9 00 a0 a0 a0 b0 a0 c0 d0 e0 f0 g0 h0 i0 j0 k0 l0 m0 n0 o0 p0 q0 r0 s0 t0 u0 v0 w0 x0 y0 59 z0 A0 B0 C0 D0 E0 F0 G0 H0 I0 J0 K0 L0 M0 N0 O0 p0 P0 Q0 R0 S0 T0 U0 V0 W0 X0 Y0 Z0 `0 a .a +a @a #a $a %a &a *a {~ =a 5{ &{ {] G] o~ 6{ I~ /! t _* -a }$ -+ D, : @& ;a >a ,a 6> 'a )a 7% =7 =7 f) 2( !a ~a {a ]a _. ^ 5. >+ v$ O+ % $ O+ 5. h; O- #! 1^ 0{ z] h{ %/ s^ j{ 6] 9; H- l& .; D# }> ~> }> ~> k& ~> D# ~> ~> {+ j& j, j, }> ~> D# j& D# j, }> }> j, > O> 9^ D> v$ N+ U; j, n& &~ @~ H! u! s! H! X! ^a /a (a T[ ~ v~ _a %: #< #< v] %: c/ @^ i^ i^ Q/ %[ :a 3: b( K5 V| { [a }a |a G{ B) B) n] n] +< B) [{ 2! ;^ n] n] 2! 2! {) 83 q; M; [* j, j, j, ~> j, }> }> ~> D# ~> D# k& &~ L= k& t] y{ ;| 1a &^ i N$ =/ w@ i 2a 3a 4a 5a {^ 6a 7a [^ [^ q# q# q# q# k~ ^~ `9 }3 T5 8a 9a J 0a aa [ W} r- $ Y% Y% G# % % h& ;{ ba z~ {+ j& :) j, 6. ca {] G] I~ G] I~ S{ S{ &{ ^] e^ O] R] ( R] da ea fa ga ha ia ja ka la ma na oa pa qa ra sa ta ua va wa xa ya za Aa Ba Ca Da Ea Fa Ga Ha Ia Ja Ja Ja %9 a0 a0 a0 a0 a0 a0 Ka La Ma Na Oa Pa Qa Ra Sa Ta Ua Va Wa 39 Xa Ya Za `a b .b +b @b #b $b %b &b D0 E0 *b =b -b ;b >b ,b 'b )b !b ~b {b ]b ^b /b (b _b :b + O+ O+ :. #! 2{ ~] ^] S{ i{ o{ 2{ 5~ u, k& n& j& ~> ~> ~> }> D# j& D# {+ j& j& {+ {+ ~> D# D# j& D# ~> }> }> ~> }> j, +> H_ 9^ D> N+ N+ O+ M; 4 $~ Q~ b{ X! ;] H! s! s! ;] z) 4! w{ K! V< @^ $< @^ %: v] #< @^ #< i^ [] v~ lb b( b( K5 u] mb { B{ O9 N9 >{ O9 N9 N9 z~ }a ob E{ [{ @~ '! n] P~ M~ B) w{ M~ <{ <{ M~ A) H! @| q; L) [* j, }> }> }> }> }> }> }> D# e& j& k& '! 4 u, N^ m] pb qb k8 E] i y~ a. y~ S9 rb sb tb ub P: n- [^ [^ q# q# H+ q# q# Z9 :7 vb wb xb yb zb Ab Bb d> e~ a3 $ Y% Y% Y% Y% Y% f% l Cb Db j& ~> }> [) <$ <. Eb ._ 6{ Q] G] S{ E~ G] S{ ( ( ( ( R_ Fb Gb Hb Ib Jb Kb Lb Mb Nb Ob Pb Qb Rb Sb Tb Ub Vb Wb Xb Yb Zb :6 `b /} c .c +c @c #c $c Ia %c Ja %9 Ja %9 a0 %9 %9 %9 %9 Ja &c *c =c -c ;c >c ,c 'c )c !c ~c {c ]c 39 r0 ^c /c (c _c :c k& k& k& z{ {+ D# 0! k& {+ n& 4 &~ 4 k& {+ 4 4 {+ k& D# D# D# ~> ;> }> U> +> H_ Ic +> N+ N+ G# 2; n& L= @~ K~ Jc G{ X! w> E) |! `~ B) w{ i^ %: c/ @^ %: $< v] #< #< #< Q[ '^ (_ {7 2] 3: Kc U[ n5 ]/ .~ ", -"{) G{ r^ O! 4 O9 O9 .& (a *: ^a b{ p] z) [{ B) [{ N~ ;^ >^ n5 L~ ~ v~ '^ n5 }> }> }> ~> ~> }> n )~ Lc d% >{ B{ O9 w@ O9 Y{ *^ C{ 3 i O$ B] a. T: Mc Nc Oc Pc Qc Rc }; K{ q# H+ Sc Z9 <7 <7 T5 8a Tc Uc Vc Wc Xc Yc Zc 9> `c x! % Y% Y% % G# > k& k& j& ;+ %& j> a! k& {+ :. X, V- {~ ]] M{ f8 f^ Q{ j{ j{ s^ >_ d .d +d @d #d $d %d &d *d =d -d ;d >d ,d 'd )d !d ~d {d ]d ^d [0 /d (d _d :d + ;, #! 8. +e @e #e )a $e %e &e <3 U} U} F] F] 7' ,3 *e O^ U) =e I' -e U} ,3 5. G# Y% Y% q% a& q% , z; ;e >e ,e f' ~^ m] j& &~ l& @& l 'e t. 0! B{ {) )e !e y{ $~ j& k& L= '! n& {+ j& j& k& j& j, Ic Ic ~e ~e H_ !> N+ O+ % 2; n& A) (a {e O5 ]e ]e Db ^e k& k& m& w{ '^ w] v] %: $< @^ @^ _a _a ;( :3 Q[ /e H5 6^ (_ v~ ~ }> }> }> }> )$ )~ K^ y# w@ N$ =/ j X{ B. ;^ n] L= O$ _$ O$ =/ _$ Mc [e }e |e 1e 2e l- q# }2 [^ Z9 W5 W5 |3 8a 3e I/ 4e 5e 6e 7e 8e 9e 0e `c K& G# G# % % % `% ~> D# ~> z$ >+ .; ;- {+ 4 l& H- ae =7 b^ p4 f8 Q_ 2/ >_ l{ R_ ^ be ce de ee fe ge he ie je ke le me ne oe ;4 pe qe re se te ue ve we xe ye ze Ae Be Ce De c0 a0 a0 a0 Ee a0 %9 %9 %9 %9 Ja Ja Fe Ge He Ie Je Ke Le Me Ne Oe Pe Qe Re Se Te Ue Ve We Xe Ye qa Ze `e f .f +f @f A0 &b #f F0 =b $f %f &f *f =f D0 -f ;f >f ,f 'f )f !f ~f {f ]f ^f /f (f _f :f +> H_ Ic H_ ~e ~e => t; G# Y% L& j& Q~ i] $^ )e if jf jf n& j& j& u! K~ [] A^ kf $< %: %: #< _a @^ lf mf U[ nf (_ [] v~ v~ [] 6^ ~( 5^ ", -"H! ;] n& {+ n& B{ A{ ba of (e *: (a 4! w{ ~ ~ L~ 34 #6 #6 [] 6^ [] pf <( v~ +~ $~ j& [* }> [* [* j, }> }> }> }> j, j, }> *@ ~$ qf I i g P$ D] rf C] E$ '! ;^ 3 O$ B] y~ g sf [e tf uf vf wf l- @+ H+ }2 xf yf zf Af Bf Cf Df ~@ Ef Ff Gf Hf If 0e `c x, % |. |. |. Y% % M; [* U; v$ :. +, n& 4 z{ z{ O9 3~ '! 4 O~ ,1 Jf 2/ R] Tc Kf Lf Mf Nf Of Pf Qf ]b Rf Sf O0 Tf Uf Vf Wf Xf Yf Zf `f g .g +g @g #g $g %g &g *g =g -g ;g @9 s# s# s# a0 a0 a0 %9 Ja Ja Ja 3d >g ,g 'g )g !g ~g {g ]g ^g /g (g _g :g Jg Kg Lg Mg Ng +0 .e 7% O} <3 W} <3 W} T) *! Og Pg S, r- t a& a& a& a& a& a& a& q% % J& 4) Qg D~ Rg Sg S( '! e% l ;{ Tg &@ a. w@ n& l& $~ $~ n& '! 4 $~ '! $~ l& n& k& ~> }> U> Ic H_ H_ ~e ~e => N+ G# J= 2; }> !) (a Ug Vg ]7 |a Db n& 8! E) u! C> B) %: v] @^ %: X} #< ^( Wg Xg Yg X} Zg }> ~> [* L) L) }> ~> }> }> }> j, }> n .h Q$ S+ >^ P~ b. J! P$ N9 y{ b{ y{ +h U^ (_ R9 a. U& @h #h $h @h 4^ @< `5 H+ %h &[ S_ 3e (* 2e /_ @] &h *h =h -h ;h M& G# Y% $ |. D, D, # # % Y% c% N+ >+ ^ +, {+ k& O! ;! 9! n& n& n& {+ *+ Ac K{ V( >h ,h 'h )h !h ~h {h ]h ^h Qb /h (h _h :h i ,i 'i )i !i ~i -- -- -- H= b3 E w y ~! {i ]i ^i /i (i _i :i j, U> +> M; bi bi bi ci N> di ei Ic fi ^7 (( gi hi s! ii nb |a >~ C> u! {) 2! i^ 6^ !/ !( !( '( &: ji +^ i^ H5 .~ ~ ~ ]/ ~( /( !/ w~ ", -"H! ;] l& l& n& k& k& n& K~ {) K~ H! [{ 6^ v~ L~ [] ~> D# D# D# }> }> n .h gf h% ff ;^ b. S~ O9 z{ w{ 6^ w{ 4! '^ 6^ g a. =| li mi ni oi &7 Sc `5 /- x8 Af pi qi ri si ti L, ui vi wi >< A ^; G# % $ E; r# 9. E; e~ |. q% % O+ v$ v$ :* ~> D# D# j& }> ~> ~> {+ {+ {+ u, c. xi yi zi Ai Bi Ci Di ]h Ei Fi Gi Hi Ii Ji Ki Li Mi Ni Oi Ea Pi Qi Ri Si Ti Ui Kh Vi Wi Xi Yi a0 Ee Ee a0 a0 a0 a0 a0 a0 %9 Ja Zi `i j .j +j @j #j $j %j &j *j =j -j ;j >j ,j 'j )j !j ~j {j 1g ]j ^j /j (j _j :j 45 Ej Fj Gj Hj Ij Jj wj _* a& q% q% Kj x; [* ~> D# <$ h> Lj Mj Nj tb Oj Q$ O9 Pj I^ $~ n] l& 4 l& l ;{ X{ (+ i y~ &@ ;{ Qj Rj j, [* [* [* [* L) L) L) M; @| +| +| di Ic ;] }a ]7 }a {) u! Sj Tj Uj ]e s! H! s! H! 2! ~ -( {( {( :3 '( $_ Vj ~ ~ .~ L~ L~ ]/ -( -( .~ .~ ", -"s! C> k& {+ n& {+ k& n& -! H! {) ;] K~ <( 6^ .~ Q/ Wj +} +} '^ O( )^ Xj Yj Z+ '! {+ x; x; M; L) [* [* j> j, ~> j& D# ~> ~> a! gf Qj 8 E$ '! b. S~ N9 Zj pb ^< M~ L~ v~ v~ =/ w@ i `j k .k +k V5 W5 V5 x8 @k #k $k %k &k *k =k -k ;k >k ,k 'k e~ 0e G# >+ }$ =7 W} 9. 9% J& x, q% Y% Y% q% G# )- M; L) j, D# ~> D# ~> D# k& a! o] )k !k ~k {k ]k ^k /k Ji (k _k :k l ,l 'l )l !l ~l {l ]l ^l /l ;< -- -- H= (l 9. '@ L@ b) 5~ t' .! b> _l :l ~> j& D# }> .> $< 7l Mj 8l 9l :$ N9 q^ 0l '! &~ &~ &~ $~ B$ Q$ ;{ S~ i B] (+ ;{ Qj o& [* [* L) [* [* b> b> M; = /; ci ~e ~e Ic u! Tj if nb { u! al Tj ]7 %^ [{ @~ !e u! z) h4 =] 5^ -( -_ ;( ;( !/ L~ L~ ~ ~ ~ {/ 5^ 5^ $] 4! ", -"k& E) j& {+ k& {+ l& l& s! s! ;] E) |! ,^ pf [] Q/ bl cl cl V^ dl el fl N_ pf '! k& q; M& b> %& z$ z$ >+ :* ~> j& j& ~> ~> D# e& c. [# f. k J! w@ w@ S~ gl I! hl Y{ il 3+ jl 0 } kl ll ml nl s8 wb ol _] ^_ pl ql rl sl tl ul vl wl xl yl y. 2~ s& zl m! /_ |^ ,3 ! b+ w j@ % a& q% a& % % M& G# `% [* [* }> i> ~> ~> <$ Al Bl Cl Dl El Fl /k le Gl Hl Il Jl Kl Ll Ml Nl Ol Pl Ql 31 Rl Sl Tl Ul Ul Vl Wl Xl Yl Zl `l m dh w$ 00 w$ dh s# dh a0 Ee .m +m @m #m $m %m &m 6h *m =m -m ;m >m ,m 'm )m !m ~m {m ]m ^m /m (m _m :m D# j& j& }> }> -> 6^ Rm Sm Tm Um Vm Wm Xm Q/ y{ !) C) H, ~+ k O9 P$ 3 w' B# ,{ @e Ym t@ [* [* [* z$ z$ z$ %& N+ = /; O/ /; V; L) E) {) G{ F{ if Zm U~ }a Pj j] J{ {e q] {) X! b{ >2 :{ J] 7^ /( U[ v~ ~ w{ L~ .~ v~ ]/ ~ .~ ~ 4! ", -"D# 4 n& n& n& k& {+ &~ H! ;] u! k& k& L= O( 1: O( O( 1: y^ `m el 0/ ~< T( Q/ Q~ j& 2; p- N+ v$ v$ >+ 6. )$ }> }> {+ k& ~> D# j& {+ c. ;{ hf h% P$ N9 >{ B{ B{ O9 w@ 3+ g n B@ ^$ .n +n @n #n s8 $n %n %n Tc &n *n =n -n ;n >n F5 K^ i/ R| ,n 'n :7 `9 )n r~ =7 D v x y y %$ E; _* a& q% % Y% % O+ x; x; b> > j, !n ~n {n ]n ^n /n (n _n :n :> :> w$ s# `* `* a0 Ee %9 :> gn hn in jn kn ln mn Gh nn on pn qn rn sn tn un vn wn xn yn zn #b An Bn Dh Ak Cn Dn En Fn Gn Hn In Jn ,j Kn Ln Mn Nn On Pn Qn Rn Sn Tn Un Vn Wn 8n Xn Yn Zn `n o .o +o @o #o $o %o &o *o =o -o ;o >o ,o 'o )o !o ~o {o ]o ^o /o (o _o %> :o E; ,@ L@ 5~ #! ~! !_ s4 O} f) 88 g- + c> D# j& D# ~> j& n' @~ 1o 2o 3o 3o 4o / C^ h^ 2! 2! /( M~ J! >{ S~ S~ H- Ac 5o 6o 7o t] h& [* j, V+ ;+ >+ z$ z$ N+ t; O/ Z< p> q; x; E) K~ z) 8o P9 |a Pj }a j] Pj j8 9o ;2 4! [{ K~ D) >2 5( 2! .~ ~ ~ v~ ~ L~ w{ L~ 4! 2! L~ ~ 2! ", -"n& n& &~ &~ l& {+ n& l& m& H! s! k& k& 4 <( |: z^ y^ y^ Z/ a/ 0o ao bo T( v~ m& ~> 2; J= N+ N+ v$ >+ 6. <$ ~> }> j& k& D# D# k& {+ a! Qj .h co >{ O! B{ A{ A{ B{ N9 N9 >{ do eo fo 1+ go go ho io jo ko k/ k/ lo nl &n mo no oo p5 po qo ro so 9a [^ `9 to ${ ,@ D f@ b) 5) h' uo vo V$ % Z* q% q% Y% M& q; 2; )- v$ L) wo xo yo zo Ao Bo Co Do s# w$ s# eh `* eh %9 %9 Xo Yo Zo `o p .p +p @p #p $p %p &p *p =p -p ;p >p ,p 'p )p !p ~p ]j 8k {p ]p ^p gg /p (p _p :p

+ V+ }> D# k& D# j& j& !~ u! Mp Np Op Pp 3o 4o ~^ h^ 2! b{ :{ -] G@ O9 N9 Qp -, g, Rp A# @e 93 <# [* [* }> >+ v$ v$ v$ N+ N+ O/ O/ N> 2; q; w> z) K~ H! if jf Tj }a Uj Uj e] h^ J{ !e K~ X! >] ;: C) C) 4! ~ .~ v~ L~ L~ w{ w{ w{ 4! 2! 2! 2! ", -"j& j& {+ n& l& !) |! -! !) m& l& {) {) H! Sp Tp Up Vp Wp Xp Yp 0o ao Zp X/ B) +, j> % )- v$ N+ `% L) L) `% j, }> D# j& k& j& ~> ~> ~> n e& c. 0! 0! 9! {+ 9! 9! n& {+ O! `p `p q .q +q `m @q #q %0 $q %q ko &q *q =q s8 -q ;q >q ,q 'q )q y, J/ V5 xb yb 3( >+ w! t' 3) f~ f~ 4) K' i' w !q _* q% q% p- 2; q; Qm D, ~q {q ]q ^q /q (q _q :q s# s# w$ iq m s# jq kq lq mq nq oq pq qq rq sq Ik tq uq vq ~m wq xq yq Jh zq tn Aq Bq Cq Dq Eq Fq Gq Hq Iq Wk Jq Kq Lq Mq Nq Oq Pq Qq Rq Sq Tq Uq Vq Wq Xq Yq Zq `q r .r 9d +r @r #r $r %r &r *r =r -r ;r >r ,r 'r )r !r ~r {r ]r ^r /r (r _r :r : .~ 6r 7r !_ W} O} <3 <3 <3 <3 a~ U} a~ 8r 9r 0r ar a~ br >@ r# u# h& j, D# j& D# }> U> }> cr dr er Pp fr gr hr ir hl ~+ <{ 4! N~ B~ jr hl S+ /+ ]$ l k& 5 5 [* j, i> H) g8 g8 g8 t; t; A> O+ G# p- G# .; K~ z) s! ii fi G{ 0i kr Cb u{ 2! {) T^ H! {) 7> !) n] N~ w{ ~ ~ L~ w{ 4! L~ L~ n5 34 L= N~ B) ", -"k& D# k& {+ !) @~ H! K~ $~ l& L= 4! 2! 8o k] @} lr mr nr or Xp 0o oi pr 8( b{ Q> v$ % v$ >+ z$ b> L) M; M; [* }> }> j, j, j, j, }> ~> }> ~> }> D# j& j& j& D# D# j& n& N! -~ o] A{ qr |_ rr sr tr ur vr wr $n s8 `9 }3 Sc e@ /- xr H+ yr zr ~* 7% 9{ Ar Br a+ Cr Ip 3) @] r) |{ k! k! 5) L@ w + Y% a& '- Kj 2; x; Dr Er Fr Gr Hr Ir Jr Kr Lr Mr Nr Or Pr Qr /0 Rr Sr Tr Ur Vr Wr Xr Yr Zr `r s B0 .s +s @s #s w$ :> w$ w$ s# 00 jq $s 00 jq lq %s &s *s =s -s ;s >s ,s 's )s !s ~s {s ]s Yr ^s >d /s (s _s (9 :s @ ,@ }, j, ~> k& j& j& ~> }> [* |( t .t +t @t #t Rm $t #( ;{ .& %t &t #( Zj =~ c{ '+ X{ r@ }> }> j, }> ~> U> g8 g8 .! .! g8 O/ O+ O+ % Y% % *> {) @~ H! u! H! y{ N9 A{ *t 4 !) m& K~ H! z) n& {+ ;^ <{ w{ L~ w{ 2! 4! L~ ~ L~ >^ +< +< M~ ~ ", -"j& j& k& &~ n& K~ H! {) m& $~ n] y{ z) ;] ba g{ =t or U& /: 43 0o -t ;t O( K~ .; O+ G# v$ >+ z$ %& L) M; x; x; M; [* L) L) L) L) [* [* j, ~> }> }> ~> D# }> }> j, j, j& j& -~ T~ [# >t ,t 't )t !t ~t {t ( %n vb `9 `9 -# /- /- `5 ]t ^t /t (t 7/ _t :t `l st st tt ut vt wt xt yt zt At Bt Ct (p Dt Et Ft Gt Ht It sn =d Jt 8g Kt Lt `e Mt Nt Ot Pt Ke Qt Rt Kh On St Tt Ut Vt Wt Xt Yt Zt `t u .u +u [4 @u #u $u %u &u *u =u -u ;u >u ,u 'u )u !u ~u {u ]u ^u /u (u _u :u k& n& D# D# j& ~> }> |( qu .t ru su tu uu vu wu P$ X{ 9 9 0 n Q$ '+ }# k [# ~> }> j, D# }> bi Z~ .! .! Z~ g8 O/ O+ O+ % Y% 4; >+ ;] @~ @~ ;] ;] z) y~ >{ A{ O^ 0^ O^ ~) z) z) `~ {+ $~ A) L~ 4! L~ w{ 2! ~ [{ B) y{ '! '! A) 4! ", -"n& k& k& k& j& l& m& 1! &~ l& 4 Q~ 1! -! A{ O9 xu 0o Xp 43 U& yu zu U( <( ;] Z) G# G# O+ N+ N+ -& M; x; q; q; x; M; x; M; M; L) M; %& >+ V+ V+ i> 5. i> <$ .; z$ > 5. += h> +, Z! E) Au 3~ Bu Cu Du Eu %2 ]~ }2 Fu }3 v8 j4 Sc ]t Gu Hu wb Iu Ju Ku Lu Mu Nu Ou Pu Qu Ru !_ Su p) G' p! G5 y! M) 2( [' z. # Tu Uu Vu Wu Xu Yu Zu `u v .v +v @v #v $v %v &v *v =v -v V8 ;v >v ,v 'v )v !v ~v {v ]v ^v /v (v _v +m Xo :v w ,w 'w N) ={ m{ )w !w ~w {w ]w ^w {) -q wf 88 f) =7 /w s4 s4 =7 |^ l- ,3 c- `= f) O} a~ u# M+ :* z- k& k& {+ n& ~> D# j, P~ (w _w :w w> C> s! ;> O> -) g8 Z< Jg Z< Z< A> O+ t; 4; %> O> u! z) @~ -! &~ y{ >{ B{ O! d% d% I= r^ N! ;~ D# k& 4 n& N~ N~ +~ <{ +~ M~ A) N~ 1! &~ n] Q~ Q~ ", -"l& k& j& {+ k& j& k& n& &~ 4 &~ l& l& 4 O! B{ #@ Yp oi ao 6w 7w #} 8w ~ s! j> G# % G# N+ z$ -& x; q; 2; q; q; x; M; M; L) L) [* b> >+ ;+ ;+ 5. 5. ;+ 5. 6. ;+ ;+ 5. f/ i/ >t f/ )$ t@ -, F> wf 2( 9w ;^ ^- 0w aw Gu bw W5 |3 |3 W5 9a %n cw Tc dw ew fw gw hw iw jw kw lw mw +! nw ){ `9 ow _] =7 9. W_ &, pw qw rw sw tw uw vw ww xw yw zw Aw Bw Cw Dw Ew Fw Gw Hw Iw Jw D6 Kw )v !v Lw Mw Nw Ow Pw w$ s# dh Qw Rw Sw Tw Tw Uw Vw Ww Xw Xw Ww 5v Vw 5v Yw Zw }m `w x hg We .x +x @x D0 #x D6 $x %x &x *x =x -x (d ;x ue >x ,x 'x bv -m )x !x ~x {x ]x ^x /x (x _x :x zr ( Hx Ix Jx Kx Lx Mx Nx Ox q# 88 f) /w #e t5 88 @+ &7 Px Qx G$ W} r# E; Y% N+ ;+ ~> ~> j& &~ {+ ~> j, L) n& Rx /: or Sx Tx Ux Sx #} $} Vx Wx Xx Yx Zx `x H@ `= |! x> C> u! x) Ic 9^ 9^ -) Jg Jg Jg Jg A> O+ N+ N+ Jg y g8 C> z) N~ n& $~ 3~ O! O9 >{ 4 &~ n] O! -~ -~ j& k& k& D# k& l& n] ;^ ;^ n] '! n] &~ l& &~ $~ &~ ", -"&~ l& k& {+ n& j& {+ {+ &~ L= L= n] &~ n] O9 N9 N$ .y ao +y @y #y #} $y B) C> D> G# % O+ v$ ;+ %& M; x; x; x; L) [* [* [* j, j, j, :* >+ >+ ;+ ;+ ;+ ;+ ;+ ;+ ;+ ;+ ;+ ;+ D 9% / 0> h~ >: %y vb G~ .{ &y *y =y -y y= ;y yb 9a |3 |3 /t =q $n ko >y ,y 'y )y !y ~y {y ]y ^y J/ /y 8a &q k/ jo (y t) >@ N^ nf _y :y f iy jy ky ly w$ :> my ny oy py qy ry Uw Ww sy sy ty uy vy sy Xw Z8 wy Vr xy yy :m zy D0 D0 Ay By #f yq Cy Dy &x Ey >j !c Fy Gy Hy >x Iy Jy ]j Ky Ak Ly Hh My Ny Oy Py Qy Ry Sy Ty Uy Vy Wy Xy Yy Zy `y z .z +z @z #z $z %z &z *z =z -z ;z >z ,z 'z )z !z ~z {z ]z ^z /z (z _z :z D# j& D# D# j, M; j& 2 x@ T: nz oz pz qz rz lr sz tz uz Zx do fo H@ L^ E) 9^ x) x) Ic Ic Ic /; Z< Jg Jg Jg Jg Z< O+ O+ G# Jg y Z< 9^ H! b{ $~ l& b. N9 N9 O9 O! l& '! N9 -~ -~ 0! {+ k& k& j& k& l& 4 l& l& 4 l& l& &~ $~ n] n] ", -"{+ n& {+ {+ n& 9! N! 0! m l 5# b. $~ +< gl y~ ;{ O$ vz Yj ,< Yj mr wz K~ x> Z) O+ G# N+ v$ z$ %& `% U; `% `% %& n% n% !$ c- c- M+ c- F $+ j@ ;+ ;+ Z) Z) 5. -+ 03 &$ xz yz o~ (/ zz Az Bz Cz M{ Dz H* Ez Fz Gz Hz Iz [3 ^_ Jz xb 9a yb 3e 3e Kz Lz Mz no Nz Oz _o Pz Qz Rz Sz Tz Uz Vz Wz Xz (~ w U} ;* Yz Zz `z A .A +A @A #A $A %A &A *A =A -A ;A >A ,A 'A )A )x !A ~A {A )v lt qd fd =4 ]A ^A /A (A st _A :A B ,B @{ .{ 'B Fc )B !B ~B {B cb ]~ @+ 88 |^ t= |^ 3( *7 T5 ]B ^B /B (B _B fb :B [ F# ! j, j, }> }> }> j, j, n% E n% n& =! j, +> bi +> bi x; % 4; 4; ^; ^; 4; G# G# % 4; %> ^; Ic s! <{ =~ N9 I! &t p] &t C{ &~ $~ 3~ {+ N! 4 n& l& O^ e% a^ '$ j& k& N! 5# r@ co J! S+ m% ff ", -"n& 4 n& k& j& T~ O9 A{ g% Q$ Q$ E$ &~ I^ |_ gl f. &@ =| ,< Yj /: ,< 6B s! x) Z) G# G# O+ N+ N+ v$ v$ v$ @ @ @ u E; E; E; r- r- r- J& E J& L+ L+ 7. 8% a+ G' F5 ow R] 9] A8 7B 8B 8B Y] 5/ >1 8, 9B C. 0B aB bB cB dB eB Bf fB 3e &n 3e S_ Af Tc jo jo %y 3e gB G9 hB iB oo jB dw kB lB mB f@ ;, /w 3$ nB oB pB qB rB sB tB uB vB wB xB yB zB AB BB CB DB EB FB %p GB HB IB JB KB ]j 6s ~p LB MB NB OB PB QB 9 RB n7 4v 6v SB TB UB VB UB WB XB YB ZB `B C .C +C @C #C $C %C &C xh |c *C JB =C -C ;C >C ,C 'C 'C hv )C !C ~C {C ]C ^C 6g /C (C _C :C j, j, )$ 9; %{ UC s& _ d) `! p' VC WC XC N_ or x@ O9 w@ a. p] x> x> =! }> L) M; M; x; M& % % Y% % % % O+ G# Y% Y% Y% ^; Ic C> b{ O9 =/ 3~ [{ @~ [{ >^ $~ n& l& '! &~ n] n& l& P^ s] t] *@ j& k& h% ;{ hf X{ A@ Q$ {$ 0^ ", -"n] ;^ k& k& k& B{ >{ >{ J! X{ ;{ ;! n] P~ k8 0i k w@ 3+ ,< Yj ,< Q| +h C> u! U; Y% % O+ N+ N+ v$ v$ v$ u YC YC ZC J& J& J& J& J& J& J& E : `C D _~ .D z] :( +D @D c] 5/ Y] A8 A8 #D 8B 7B V( 7. $D %D &D *D =D wb -D ;D >D ,D *n &n nl 8a /t =q cw $n O] 'D )D !D ~D {D 6w kB ]D ^D /D m! >@ i- /& 3& (D _D :D E >E ,E 'E )E !E ~E {E ]E ^E /E (E _E :E 9^ U> [* M; x; M; x; M& % % Y% Y% % G# O+ % % Y% Y% G# H_ x> p] y~ w@ *t F{ b{ A) Q~ n& k& n& +< P~ '! n& 4 :# 7o t] <$ j& {+ g% hf hf N< N< N< @& 0^ ", -"$~ I! B{ T~ o] h% h% Q$ co f. J! O9 !+ !+ %^ oE A@ a. a. =| Yj pE }/ &~ +, .; |. I+ M+ M+ E; F r- F F r- ZC ZC ZC J& J& qE qE rE 24 .( p) n~ ^] n{ 7] u^ Z] 7] 9] A8 7B A8 Y] 9] 7] 9] #D sE tE F! G' uE vE wE xE yE zE AE BE CE mB Kz yb 9a |3 |3 /y >q 8a ^& G* r8 DE jB /y EE FE GE HE IE 4) 2 JE KE LE ME NE OE PE QE RE SE TE UE VE WE XE YE ZE `E 5n F .F +F eA JB Ah bv @F #F $F %F &F *F =F -F 5q ;F >F ,F 'F )F !F ~F {F xt ]F ^F $m 9 /F (F /F 5A _F :F m .F 4F 5F 6F 7F 8F 9F 0F CD aF xk bF [g 'm cF dF eF fF gF hF iF jF kF lF Rr mF nF oF pF qF rF sF tF uF vF wF xF yF zF AF BF CF DF EF FF GF HF IF JF KF LF MF NF OF PF QF RF SF TF UF VF WF XF YF ZF `F G .G +G @G #G $G %G &G *G so ${ =G -q -G #n (y ${ :7 J/ >: Z9 ${ (y {! ;G f. ( >G ,G 'G 5) i) y >+ U; :* > b> %& )G !G ~G {G 9] A8 ]G */ :] S! {! b' t) M^ Y& W& 2 '! ;> 9^ Ic ~e = = = -& = c% % % 4; ^G Jg ^; 4; 4; 4; 4; Y% N+ P/ y) )) A) %t `g `~ $~ N~ {+ n& n& {+ P~ >^ , e% U) @e @e @e s@ a^ s% V) .h gf co ;! [# U+ , ", -"$~ n] T~ o] h% hf gf Qj T~ B{ >{ k n. j% /G #( (G N9 B{ O$ xu _G >^ *+ h; N+ # E; r- r- J& E E E E E J& E W$ J& @> < :G +! 1~ F~ O] '_ */ 7] 8] 7] 7] 5/ Y] 7B 8B #D 9] 9] 9] 8] c] q Uz Uz Af 3e 8G 9G 0G aG *7 bG cG dG g^ (> eG fG gG hG iG jG kG lG mG nG oG pG qG rG sG tG u[ uG (} vG hA 9n Kt wG xG +f 3F Hh yG )c zG AG BG CG DG uD EG DG FG GG 5n HG IG 4v =u JG KG R4 LG ya MG NG OG PG QG RG SG TG 19 td UG *C *C D0 VG WG Kk XG YG ZG `G H fv M0 |c %b .H Qk {C Fh +H @H #H $H %H &H *H =H -H ;H >H ,H 'H )H !H ~H {H ]H ^H /H (H _H :H U; b> = A> Z< A> O+ G# G# G# % 4; ^G ^G 4; ^G ^G %> Y% Y% t; .! !~ ,] @~ X! ;] l& &~ $~ n& 4 $~ {+ 4 P~ `= Lc 7o 7o 7o P^ Lc 7o s] H{ EH .h C$ ;^ $~ n] P~ ", -"'! &~ o] A{ B{ hf gf h% 'e T~ B{ l] q^ A~ 3: #( X{ >{ >{ O9 }/ :e ;^ X> 6. % e~ E; r- J& E E D D D D E E { FH !] T! Q] f^ X] O] R] ,_ n{ Z] 8] 7] 8] 9] 5/ #D 7B 7B 7B 7B A8 A8 #D Cz da ,: T) Ac GH HH IH _. Ig JH KH '{ `9 ow /y 9a yb Uz Uz LH &n &n =n MH NH ]D OH PH QH RH SH TH UH VH WH XH YH ZH `H I .I +I @I #I $I %I &I *I =I -I ;I >I Gn ,I 'I |j )I !I ~I {I ]I ^I ,c /I (I _I :I J ,J 'J )J !J ~J {J ]J ^J eE |8 /t /t /J to }3 `9 `9 }3 *7 (J _J :J x DJ >m Qt EJ FJ GJ HJ IJ K6 5m JJ KJ LJ MJ NJ OJ PJ -p QJ RJ SJ TJ UJ r3 [A VJ N4 WJ XJ YJ ZJ `J K 7q .K Eh +K @K #K $K {p *C &b E0 {p %K Yr uh &K *K jd =K 8h -K ;K >K ,K 'j 'K )K !K ~K {K ]K ^K /K (K _K :K q J/ K{ ', !! K' M@ L+ -- Y% O+ z SK TK #D #D 5/ 5/ 9] 5/ 9] 8] ': %/ &/ %/ t^ t^ k{ ,_ ,_ ,_ d^ ~~ k! '@ z. @> 2> 2> M+ M+ M+ e~ e~ e~ e~ e~ e~ e~ # |. Y% 4; i/ )) H! u! C> j& k& k& u, a^ i- -* ;^ ff d+ '3 UK l 8 z# ~$ ~$ ^3 H{ V) 8 G@ !+ s. 3~ ai ", -"A{ T~ 4 {+ k& T~ -~ I) Y~ Qj gf co w@ w@ :{ B) }a {) s! C> i/ V> 8> F -a E; E; E; J& @> ' : [ J' (~ ${ /] /] O] R] ( '_ S{ ^] i{ h{ h{ j{ Z] 7] 7] 8] A8 5/ Y] 8] 5/ A8 #D 7B 7B #D Y] 5/ 8] 5/ yc VK WK nw )n ow (y nl 3e Bf ko 4( XK YK ZK *n Cf `K L .L +L @L #L $L %L &L *L =L -L ;L >L ,L 'L )L !L ~L {L ]L ^L /L (L _L :L UL VL WL XL YL ZL `L M .M +M @M #M $M %M &M 3H *M =M -M ;M >M ,M 'M )M !M ~M {M ]M ^M /M (M _M :M + O+ G# y Y] A8 7B #D A8 Y] 5/ Y] 9] Y] Y] 7] Z] j{ n{ j{ j{ j{ n{ n{ n{ ^] V( ]3 2{ I' aM bM YC E; E; D, D, D, e~ e~ e~ e~ -a -a a3 t v$ h; H! u! C> j& k& j& 7o 7o P^ L= mb L= k% j Q$ hf .h Qj Ym t] ~$ ~$ ~$ t] l '+ X{ k B{ ", -"T~ o] k& {+ {+ o] I) I) Qj gf N< A{ A{ >{ #~ r] if hi u! u! h> r& ^ # D, E; r- J& E { ~: D! ={ :] X] P] ]] O] R] ]] O] Q{ ^] ^] S{ S{ S{ j{ j{ 7] 9] 9] A8 A8 A8 8] 8] A8 #D #D 7B 7B A8 5/ 8] 8] j{ |{ F5 cM `9 ol #n Bf rl dM FE eM fM gM hM iM jM ]D kM lM @L mM nM oM pM qM &L rM P. sM tM uM vM wM xM yM zM AM BM CM DM EM FM GM HM IM JM KM LM MM NM !9 OM 7L ]C PM >d QM RM SM TM UM VM tq WM XM YM ac Th ZM `M /9 N .N 9 +N @N #N jL Tr $N %N &N *N =N -N ;N Dh Ok =b 4c F0 2c #f >N ,N 'N )N !N ~N {N ]N {C GJ ^N (m /N (N _N :N D# 7o 7o P^ $~ #6 +< k% Q$ Qj .h EH gf Ym s] t] ^3 ^3 ^3 ZN N< X{ f. A{ ", -"b. .& 4 n& l& A{ T~ Y~ gf hf ;{ B$ N! 9! ., Q~ `g G{ X! H! 5. >+ # P+ P+ u W$ xz 6~ <] U_ U_ C~ I~ u4 <^ :] e^ '_ R] O] N{ f^ P{ D~ S{ i{ n{ n{ Z] 5/ Y] Y] 5/ 9] Z] 8] #D 8B 8B 7B #D Y] 5/ 5/ 7] :^ r) xz s) +! &! *q `N Vz O .O +O @O #O Hx $O %O &O *O =O -O ;O >O ,O 'O )O !O ~O {O ]O ^O /O (O _O :O C kO lO 1c mO nO oO pO qO rO sO VJ tO uO vO wO xO HJ `e yO zO AO 'N (m BO Ph >b em ud }c CO DO EO Ko yy `7 bm FO bA (s GO HO IO JO KO LO MO NO OO PO QO RO SO TO UO VO WO XO YO ZO `O P .P +P @P !C #P $P %P &P *P =P -P ;P >P ,P 'P )P !P ~P {P ]P ^P /P (P _P :P

: -e YN ZC D, r- % -- -- qP V( 8B rP sP 2J #D A8 Y] Y] 5/ 8] 5/ 8] 7] Z] 7] n{ n{ i{ i{ z] P{ &/ d^ d^ Us D~ P{ f^ @{ DH b^ J' .( W$ 2> E; F F tP uP e~ # $ # ~) ~) .; D# i> )$ z- a^ d% v{ H, ff '+ ;{ Qj vP V) V) ~$ t] t] X+ G$ G$ n z# @& [# N! ", -"&~ l& l& $~ &~ >{ N9 B{ N< N< ;{ d% {+ {+ 4 $~ n& +, E) => |. e~ D, @ ~' r! A! u~ #{ Q] G] &{ I~ ^] &{ G] h{ j{ '_ O] O] O] O] /] e^ i{ Z] 7] 7] 7] Y] A8 Y] 8] Z] Z] 5/ #D #D #D A8 Y] A8 A8 Y] C5 wP ~~ b+ [ w ( xP yP d( p) {! %! @+ zP S> 3) AP BP rM CP &L &L CP &L 'O DP )O T& EP FP GP HP IP JP eG KP LP M' MP NP OP PP QP RP SP TP UP VP WP XP YP 6s ok Se ZP #x Wk #b }g 1c 1c `P 2g Q .Q +Q @Q 3j 2s #Q $Q yk %Q [A &Q *Q 20 =Q -Q ;Q ta 69 >Q ,Q !s 'Q )Q !Q ~Q {Q ]Q ^Q /Q +x wL (Q _Q :Q ]c j, ~> k& {+ {+ ", -"4 n& &~ n] P~ Y{ a. O9 ;{ Q$ hf k& n& {+ 4 {+ [* I+ x! A P+ D, D I' :~ t~ {~ F~ #{ %{ G] G] ^] S{ ^] S{ i{ n{ k{ ( R] R] ( R] ,: 8] 7] Z] 8] 9] #D A8 Y] 9] Z] 7] 5/ #D #D A8 A8 Y] A8 Y] Y] A8 Y< >R [ b) 5~ 3) I' Ip Ip ,3 ,R 'R )R !R ~R {R ,B ]R ^R *L /R (R (R &L _R :R S >S ,S 'S )S !S ~S {S ]S ^S /S (S _S :S >t j& V) .h .h gf )~ t] ~$ ^3 ~$ s] c. k& k& }> D# D# j& k& ", -"m& !) y{ Q~ Q~ x~ y~ b. co co #& k& Q> )$ `% J= J= K& !q pS qS 4) b^ >: #{ @{ P] :] V{ Q] I~ I~ I~ :] P{ &/ %/ :( ,_ ( ,: ~7 ( ( ,: 7] n{ 7] 5/ A8 7B 7B Y] 8] 7] Z] 9] #D 7B A8 Y] Y] A8 A8 rS ]G sS Q5 M^ [ T ,T 'T )T tD ;F !T ~T {T ]T ^T z0 hd /T dI (T sh _T ~Q :T $f H0 8 xk U ,U 'U )U !U ~U GH $$ >@ 0^ i' z! 4) -e F] J& _* H= $+ {U z8 Y] #D 7B A8 9] 8] 7] 9] A8 8B 2J 7B #D A8 5/ 8] 9] j{ S{ &/ */ [3 */ h{ S{ h{ d^ 5{ %{ ]] F~ #{ @{ #{ ]U T{ 4{ 4{ ~~ /! o! + uP P+ # |. M+ $+ ^ _. .; <$ .; o' D# o& V) z# z# H{ ~$ ~$ s% s% '$ z- k& {+ {+ k& D# k& n& ", -"K~ K~ b{ @~ z) M~ :e >^ N9 O! a! :* G# % a3 -a D, =} xP +! n~ m~ 1~ l~ u~ #{ <^ G] I~ ^] S{ S{ O{ /] /] O] ( ,: R] R] ( R] R] ( k{ j{ j{ Z] 9] A8 #D #D 5/ 9] S5 S5 ^U #D #D Y] 5/ 5/ #D ~G (^ F' vz M< [/ /U =* -e v4 m~ u~ ,1 (U _U :U b 4c #f `P .x 49 Y7 IU pd JU KU LU MU NU OU PU QU RU SU TU UU VU WU XU YU ZU `U V .V +V @V #V $V %V &V *V =V -V ;V >V ,V 'V )V !V ~V wT {V ]V ^V /V (V _V :V ^3 ~$ t] ~$ ~$ t] &, 4 n& n& 4 k& j& D# j& k& 4 ", -"[{ b{ b{ b{ b{ L= ;^ (> Z! %& M& Y% G# O+ D, D, D z! !{ n~ 1~ l~ 1~ l~ l~ @{ 8{ I~ I~ I~ ^] h{ '_ R] O] O] ( ( R] O] /] O] O] ( 3/ 7] 7] 7] Y] #D A8 Y] Y] HV S5 S5 i4 A8 Y] 5/ 9] 5/ Y] IV JV KV LV MV h {7 NV +& 8~ q~ B! e! t8 NK OV PV QV RV SV TV UV VV WV XV YV ZV `V W .W Yx @ +W @W #W $W %W &W *W =W -W ;W >W ,W 'W )W !W ~W {W ]W {W ^W /W (W _W :W d eW 2W fW gW 4j We ig ig 8 hW iW jW kW lW mW o; nW oW pW qW rW sW tW uW vW wW xW yW zW AW BW CW DW EW FW GW HW IW JW KW LW MW NW OW PW QW RW SW TW UW VW WW XW YW HQ ZW `W X .X +X @X #X $X %X &X *X =X -X ;X >X ,X 'X )X !X ~X {X ]X ^X /X T, (X _X :X @ J& I+ O+ O+ N+ v$ ;+ += ~> ~> $& 93 ~$ ~$ t] s] U) $~ l& n& 4 k& D# j& k& n& l& ", -"C) C) h^ ~/ %] H, .; %& # # # I+ M+ z D i' b^ n~ n~ m~ ]U V! S! l~ 4{ f^ O{ I~ &{ o~ Q] &/ e^ O] R] R] R] ( ( /] /] O] O] R] ,_ Z] n{ Z] 5/ A8 Y] Y] 5/ Y] S5 8X rS 5/ 9] GV ^U i4 9X 0X Q( aX bX cX m8 dX V] 1w }2 6~ q) <~ ^. eX fX yc gX hX iX jX kX lX mX nX aG oX pX J$ qX rX sX tX uX vX wX xX yX zX AX BX CX DX EX FX GX HX IX JX KX ^W IX .T LX MX NX OX PX QX QX QX ud vd RX 0W Sk SX oR QX :T ZM TX TX UX VX 71 WX o3 &Q XX YX %K nO >N ZX yk CO `X Y _s Wk .Y sd zy 2F oR Bh sn +Y @Y }Q #Y $Y %Y ^C &Y *Y =Y -Y ;Y >Y ,Y 'Y )Y !Y 3I ~Y {Y ]Y ^Y /Y (Y _Y :Y : -# =7 }$ ' M+ I+ # G# -& f% )$ t@ t@ 9% G$ G$ s% U) $~ {+ k& l& n& D# j& {+ &~ N~ ", -":{ K] -_ %Z }J O+ % O+ M+ E; E; z #+ L@ *! m~ l~ 1~ m~ l~ {] &{ {] &{ G] ^] I~ G] G] V{ /] R] R] R] ( ( ( ,: O] /] O] O] R] ( ,: j{ h{ n{ 9] Y] Y] Y] 9] 9] S5 8X 5/ HV 5/ 5/ &Z a] *Z =Z -Z ;Z >Z ,Z 'Z b nZ ]Q !Q KU oZ 4c pZ qZ rZ sZ tZ ;Q te uZ vZ wy 30 wZ C6 =f xZ `P yZ Cd &b >N CD 2c 4c |c zy }Q zZ 19 AZ Mk BZ CZ DZ EZ ak pa FZ GZ HZ IZ Qb JZ KZ LZ MZ 15 NZ OZ PZ QZ RZ SZ TZ UZ VZ WZ XZ YZ ZZ `Z ` .` +` @` #` $` %` &` *` =` -` ;` >` ,` >` '` )` !` ~` {` ]` ^` /` (` _` :` <` [` }` |` 1` 2` 3` 4` 5` 6` 7` 8` 9` 0` a` b` c` d` e` f` g` h` i` j` k` l` m` n` o` d* C& p` q` f! ,n #{ u~ l~ s~ #! '{ >+ Vj r` s` t` u` [e v` w` x` *0 FV 9] Y] 9] 5/ 5/ 5/ 9] 5/ 9] n{ j{ h{ ^] I~ ^] R{ R] ( 6] ^] G] D~ O] O] O] O] F~ @{ G] G] I~ &{ G] 5{ F~ @{ #{ 1~ l~ u~ u~ l~ 1~ /~ h~ y` J& E; D, -a a3 e~ -& >+ 5. D# '$ &~ '! &~ n& {+ {+ {+ j& j& j& -! H! ", -"#] >] H) A> Z< A> O+ N+ E; E; r- w k! f! q~ n~ m~ l~ 1~ l~ 6{ ^] I~ G] G] I~ G] G] ^] e^ R] ( ( ( /] ]] R] R] R] O] O] R] ( R] ,: j{ h{ j{ 7] 5/ 9] 8] Z] 7] i4 i4 ^U 5/ Y] Y] z` A` [_ B` C` D` E` ,Z F` G` Q| O$ H` #7 /& &! f~ f~ I` J` K` L` M` N` ^Z *L O` P` Q` R` L~ D] S` T` U` V` W` xX 2Z X` Y` Z` `` .. .+ .@ .# .$ .% .& .* .= .- .; .> ., .' .) .! .~ .{ .] .^ .je Ed =b Tk !Q / .( ._ .: .< .[ .} .| .51 1 .2 .dL 3 .4 .5 .6 .`P Pk Wk DR #f E0 3c E0 3c 3c |c 3c 2c 3c 7 .8 .9 .0 .a .b .c .d .e .f .g .h .i .j .k . Q l .m .rL 4p n .o .p .q .r .s .t .u .v .w .tq x .y .z .A .B .C .D .E .F .G .H .I .J .K .L .M .J .N .O .P .Q .R .S .T .U .V .W .X .Y .Z .` . .....+..@..#..$..%..&..*..=..-..;..>..,..'..)..!..~..{..]..^../..(.._..:..<..[..}..|3 c^ n~ B! m~ m~ m~ n~ ~{ `| dl |..1..2..u` u` 3..4..5..6..7..8..5/ #D A8 #D Y] 8] 8] 9] 7] i{ S{ S{ h{ i{ i{ %/ ( ( a] h{ I~ T{ F~ O] ]] O] O] f^ ^] ^] ^] ^] G] 5{ #{ @{ F~ l~ u~ l~ l~ u~ 1~ m~ m~ n~ O) `> Z; tP D, e~ G# G# O+ %& {+ n& {+ {+ n& k& {+ {+ n& {+ k& w> s! ", -"N+ O+ I+ N+ N+ N+ N+ M+ E; D t' f! 1^ :~ q~ ){ n~ n~ m~ u~ 5{ S{ I~ ^] I~ ^] I~ G] I~ d^ e^ >_ R{ R] R] ( R] O] R] O] R] R] ,_ k{ k{ %/ d^ i{ j{ Z] n{ Z] n{ Z] S5 i4 i4 Y] A8 `] 9..0..a..b..c..d..e..LV f..g..il Y( ~1 /e h..@+ p) g~ $n i..j..dJ k..l..m..n..n..o..p..Cf 5# q..r..s..t..u..v..xX 2Z X` w..x..x..y..z..A..B..C..D..E..F..G..= .H..PP I..J..K..L..M..N..O..P..Q..je R..S..>b 4c 2c T..U..V..xd W..X..Hy 1 .]6 Y..Z..`.. +.JJ ed Eh .+.:m Pk #f 3c >b 2c Ti &b *b sd 4c ++.@+.#+.$+.%+.&+.*+.=+.-+.;+.>+.8W ,+.'+.kZ )+.Ey !+.~+.{+.]+.^+./+.1p (+._+.:+.<+.[+.}+.|+.1+.2+.3+.4+.5+.6+.7+.8+.9+.0+.a+.b+.c+.d+.e+.f+.g+.h+.i+.j+.k+.l+.m+.n+.o+.p+.q+.r+.s+.t+.u+.v+.w+.x+.y+.z+.A+.B+.C+.D+.E+.F+.G+.H+.I+.J+.K+.L+.M+.N+.O+.uj P+.Q+.e* R+.S+.T+.U+.V+.W+.X+.Y+.6~ G! @! @! G! 7% 6, Z+.fr `+. @..@.+@.:: @@.#@.$@.%@.&@.TK A8 *@.#D 5/ 8X S5 Z] t^ h{ S{ S{ i{ j{ n{ k{ ( ( l{ %/ S{ <^ P] R{ P] 8{ Q{ D~ S{ h{ h{ S{ I~ D~ 4{ @{ /] @{ #{ l~ l~ l~ l~ m~ n~ n~ _~ D! D z. ZC E; M+ N+ O+ M& x; :* i> u, 7> &~ ~) |! k& k& n& E) x> ", -"E; E; E; E; E; E; r- J& x #! (~ 1~ 1~ n~ q~ q~ n~ n~ l~ #{ <^ ^] G] G] I~ I~ G] I~ ^] S{ S{ S{ P{ O] R] ( /] O] R] R] R] l{ n{ Z] m{ R] R] '_ i{ i{ n{ 8X R5 S5 8X 8X 8X =@.*a -@.;@.>@.,@.'@.pz n8 rz 9/ 9/ rz @} &^ 4: [] M~ <{ O^ 9~ )@.vb ow >q !@.~@.{@.]@.^@./@.(@._B _@.:@.<@.[@.}@.W` v..|@.xX X` Z` x..1@.. .2@.3@.4@.5@.6@.7@.8@.9@.0@.a@.H..IX JX b@.c@.d@.e@.f@.g@.h@.QX 5c i@.;b _ .>b j@.j@.6c k@.QU l@.m@.n@.]6 Z..o@.p@.q@.r@.Ft 'j s@.t@.>d %b sd F0 3c 1c td >b F0 u@.v@.w@.x@.Vl me y@.z@.A@.B@.C@.D@.j@.E@.F@.G@.`7 H@.I@.J@.K@.L@.M@.N@.O@.P@.Q@.R@.S@.T@.U@.V@.W@.L1 X@.Y@.Z@.`@. #..#.+#.@#.##.$#.%#.&#.*#.=#.-#.;#.>#.,#.'#.)#.!#.~#.{#.]#.^#./#.(#._#.:#.<#.[#.}#.|#.1#.2#.3#.4#.5#.6#.7#.8#.9#.0#.a#.b#.c#.d#.e#.f#.g#.h#.i#.j#.qM k#.l#.m#.jM jS n#.dw o#./< J' M^ 2+ p#.q#.Z+.r#.s#.t#.u#.v#.w#.x#.y#.z#.7i A#.B#.A8 8..3J 8X S5 R5 R5 C#.C#.S{ j{ Z] n{ j{ k{ ,: R] R] ( O] f^ S{ z] h{ ^] S{ ^] S{ S{ ^] S{ I~ I~ #{ @{ F~ u~ l~ u~ u~ 1~ l~ l~ m~ n~ !{ m~ .] ){ U< bM @> E; E; N+ c% % % >+ h; #] D#.E#.s! j& n& l& j& ", -"r- r- r- r- r- E; E a~ f! 2{ f! B! n~ n~ m~ 1~ 1~ 1~ u~ #{ 6{ ^] ^] G] I~ ^] S{ h{ S{ S{ ^] G] %{ F~ O] ( ( ( ( R] ( F#.7] n{ j{ R] O] Q{ S{ i{ Z] i4 S5 S5 S5 i4 HV G#.mo H#.P| I#.J#.K#.m8 oz L#.h @} -| b( 1] Sp b{ z) l& $+ *} M#.]U .] N#.F5 Y+.I` O#.j4 P#.Q#.R#.S#.T#.U#.}@.}@.W` v..|@.xX X` V#.Z` x..W#.X#.Y#.Z#.`#. $..$.+$.Z#.@$.#$.$$.cZ JX %$.&$.*$.=$.-$.;$.>$.,$.'$.'$.j@.-b 7c x@.)$.!$.~$.^Q {$.]$.^$.]6 /$.Nq ($._$.:$.<$.[$.bc 6 .Vk 3c %b 2c *b 4c >b =b $f '$.}$.W..|$.1$.2$.3$.4$.5$.6$.7$.8$.9$.eL 0$.a$.b$.c$.d$.e$.f$.g$.h$.i$.j$.k$.l$.m$.n$.Mt o$.p$.q$.r$.s$.t$.u$.v$.w$.x$.y$.z$.A$.|M B$.C$.D$.E$.F$.G$.H$.I$.J$.K$.L$.M$.N$.O$.P$.Q$.R$.Y .S$.T$.U$.V$.W$.X$.Y$.Z$.`$. %..%.+%.@%.#%.|* $%.%%.+B &%.*%.=%.-%.;%.>%.<> (R /R ,%.'%.)%.!%.~%.n#.nl [^ W} @< dB {%.uu ]%.Mc r#.fr Op ^%./%.(%._%.:%.r` Oc <%.{' [%.]G i4 8X R5 R5 t^ Z] j{ Z] 7] 7] i{ ,_ ,: R] ( R] O] N{ h{ i{ h{ S{ S{ S{ S{ ^] G] I~ G] Q] @{ u~ #{ u~ 1~ 1~ l~ l~ l~ 1~ 1~ m~ !{ n~ l~ n~ m~ h~ '@ r- E; M+ N+ N+ N+ G# G# H) >t ;R 7> 4 4 k& ~> ", -"r- r- E; u r- v O} @+ ~] s~ 3{ m~ 1~ 1~ ] Z{ `{ V! u~ @{ ^] S{ S{ &{ G] ^] h{ s^ i{ &/ ^] G] Q] F~ ]] e^ ( ( ,_ k{ +1 ]G (^ $/ a] R] /] /] d^ n{ n{ R5 7] n{ S5 S5 ': }%.0/ |%. I+ 7%.N{ ': $/ m{ a] a] U: UC ;, ~$ 8%.9%.0%.a%.t..b%.V` W` v..|@.xX wX w..w..c%.d%.e%.f%.g%.h%.i%.j%.k%.l%.m%.n%.o%.p%.b@.cZ q%.r%.s%.t%.u%.v%.w%.,$.x%.y%.z%.6c A%.B%.C%.U..1T D%.E%.F%.G%.H%.I%.8m J%.K%.L%.M%.N%.Lk Tk O%.P%.Vl Q%.4c Un >b $f 7c ;b R%.S%.T%.U%.V%.W%.X%.Y%.Z%.`%. &..&.+&.T..@&.#&.$&.%&.&&.*&.=&.-&.;&.>&.,&.'&.)&.!&.~&.{&.]&.^&./&.(&._&.:&.<&.[&.}&.|&.1&.2&.3&.4&.5&.6&.7&.8&.9&.0&.a&.b&.c&.d&.e&.f&.AQ g&.h&.i&.j&.k&.l&.m&.n&.o&.p&.q&.r&.s&.t&.u&.v&.w&.x&.y&.z&.A&.B&.C&.D&.E&.F&.G&.H&.I&.J&.K&.L&.fE bw /J u8 M&.i' 9. t) r. N&.O&.U& 1= su q#.P&.Q&.R&.S&.T&.U&.4o @h V&.W&.X&.Y&.8X S5 j{ R5 Z] :( %/ m{ :( :( %/ ,_ ( ( >_ O] N{ R{ i{ i{ S{ I~ ^] G] &{ &{ <^ :] :] Q] #{ l~ l~ l~ 1~ 1~ l~ u~ 1~ 1~ l~ 1~ 1~ 1~ 1~ q~ q~ m! b^ K' W$ M+ @ i@ N+ v$ N+ G# G# O+ i> Q> n& k& D# ", -"r- u 9, K@ x 1^ 3{ 2{ l~ s~ l~ s~ l~ S! %( Z&.%( `&.{] G] ^] S{ ^] I~ S{ h{ >_ ( R] N{ ^] S{ S{ S{ &/ z] O] O] e^ i{ j{ m{ ( ( ( O] ]] /] O] ,: ,_ :( Z] n{ *.a] V} .*.4# )1 +*.@*.#*.b( 3: U] y@ $*.B] x~ L= Z| k& D# ;> u> 3i O[ F~ /] O] F~ @{ @{ m~ h~ y! .( %*.&*.**.=*.[@.V` u..W` v..|@.xX wX wX 5Z -*.;*.>*.,*.'*.)*.!*.~*.{*.]*.^*./*.(*._*.:*.<*.* .[*.}*.RU |*.1*.2*.3*.4*.5*.6*.7*.8*.9*.7 .0*.a*.VD b*.c*.d*.e*.ra f*.g*.h*.i*.j*.k*..+.&d l*.Z7 m*.n*.o*.n*.p*.{Q V@.q*.r*.B@.s*.t*.u*.v*.w*.x*.y*.z*.A*.|T B*.C*.D*.E*.F*.G*.H*.I*.J*.K*.L*.M*.N*.O*.P*.Q*.R*.S*.T*.U*.V*.W*.X*.Y*.!V Z*.`*. =..=.+=.@=.#=.$=.%=.&=.*=.==.-=.;=.>=.,=.'=.)=.!=.~=.{=.7V ]=.^=./=.(=._=.:=.<=.[=.}=.|=.1=.2=.3=.4=.5=.6=.7=.8=.9=.0=.a=.b=.c=.d=.e=.f=.g=.!_ `9 O] /] @{ ]] O] ( =( u :* '$ l& E] h=.(G )1 T= T= i=.j=.[w vu uu .t k=.l=.u` O| -@.Y&.m=.Z] j{ j{ '_ O] R] R] ( >_ ( R] R] %/ h{ S{ S{ h{ i{ S{ ^] I~ 5{ #{ 9{ #{ 8{ /] F~ #{ u~ l~ l~ u~ l~ u~ l~ 1~ m~ l~ 1~ n~ m~ 1~ m~ q~ n~ m~ n~ h~ n=.8. o=.i@ v$ v$ N+ N+ N+ N+ O+ ;+ c> ~> ", -"r- u K@ 5) 3{ ;/ ~] ~] *{ u~ l~ l~ u~ l~ `&.H] H] H] &{ I~ ^] ^] I~ I~ S{ i{ e^ R] ( 6] i{ j{ i{ i{ h{ z] O] O] e^ h{ S{ d^ R] ( O] O] /] O] O] O] ,_ Z] n{ $/ a] @, Z! (G 1+ (G p=.h. `+ q=.4: M! @0 y~ N$ l& k& D# }> j, x; A Q+ q) 1~ u~ l~ m~ !{ h~ g~ g~ P[ r=.s=.t=.u=.=*.[@.V` u..W` v=.|@.xX wX wX w=.x=.y=.z=.A=.B=.C=.D=.E=.F=.G=.H=.I=.J=.m%.K=.L=.$Y M=.N=.O=.P=.Q=.R=.4*.S=.T=.U=.7*.V=.W=.X=.Y=.Z=.`=. -..-.aO +-.@-.#-.$-.%-.&-.*-.=-.%8 --.;-.`%.>-.n*.n*.6j ,-.'-.zW )-.!-.~-.{-.]-.^-./-.(-._-.:-.<-.[-.}-.5*.|-.1-.2-.3-.4-.5-.6-.7-.8-.9-.0-.a-.b-.c-.C; d-.e-.f-.g-.h-.i-.j-.k-.l-.m-.n-.o-.p-.q-.r-.s-.t-.u-.v-.w-.x-.y-.z-.A-.B-.C-.D-.E-.F-.G-.H-.I-.J-.K-.L-.M-.N-.O-.P-.Q-.X7 R-.S-.T-.U-.V-.W-.UF X-.Y-.Z-.`-. ;..;.+;.@;.#;.$;.%;.#{ R] ,: O] R] ,: 3/ &{ 8. O+ ~> {+ E$ m. j '+ A@ (G R+ lb 3: 4+ x@ *| or &;.2a *;.=;.-;.': 8X Z] n{ >_ R] O] O] O] R] R] O] O] O{ S{ ^] I~ S{ h{ h{ h{ G] <^ #{ #{ #{ @{ F~ #{ #{ l~ 1~ u~ #{ #{ #{ u~ 1~ 1~ 1~ u~ l~ 1~ m~ l~ 1~ m~ 1~ m~ m~ m~ k! ) N+ v$ v$ v$ v$ v$ N+ N+ N+ O+ N+ ", -"2> : 5~ 2{ ~] ~] *{ s~ t~ l~ 1~ l~ u~ l~ U! `&.U{ T{ G] I~ I~ ^] I~ ^] S{ ^] N{ R] >_ s^ :( n{ s^ 6] %/ &/ /] P{ &/ h{ S{ &/ O] R{ N{ O] e^ R] R] R] ,: Z] Z] n{ @, .; x> ~= @@ (+ }^ ;;.>;.(1 A) {) O! O! >{ j& j, [* M; -& 2; T> . !{ m~ 1~ q~ ){ g~ g~ nw f~ A9 ,;.';.);.a%.=*.t..V` u..W` v..|@.xX !;.3Z ~;.{;.];.^;./;.(;._;.:;.<;.~*.[;.};.|;.1;.2;.3;.4;.5;.r%.F..6;.G=.7;.8;.9;.0;.h .6*.|-.a;.b;.c;.d;.e;.:0 f;.gR g;.h;.lg r@.$-.i;.j;.k;.l;.6W m;.oe n;.F0 |$.o;.%&.p;.q;.r;.s;.t;.u;.v;.Uf w;.x;.y;.z;.A;.B;.C;.D;.E;.U=.F;.G;.B%.H;.I;.J;.K;.L;.M;.N;.O;.P;.Q;.R;.S;.T;.U;.V;.=S W;.X;.Y;.Z;.`;. >..>.+>.@>.#>.$>.%>.&>.*>.=>.->.;>.>>.,>.'>.)>.!>.~>.{>.]>.^>./>.(>._>.:>.<>.[>.}>.|>.1>.2>.3>.4>.5>.6>.7>.8>.9>.0>.a>.b>.c>.d>.e>.f>.g>.h>.i>.j>..] 1~ #{ u~ F~ /] P] 6{ w I+ c% D# c. Y~ co J! A@ %@ i% ~1 1] p^ }- 3# K$ d k>._+ h..yf L{ k{ :( n{ :( R{ /] /] /] O] R] R] e^ N{ ^] I~ ^] h{ S{ h{ ^] ^] Q] @{ @{ @{ @{ F~ F~ #{ u~ S! ]U 4{ u~ @{ %{ #{ u~ #{ 4{ u~ u~ u~ u~ l~ l~ m~ 1~ 1~ m~ s~ +] v F @ M+ M+ M+ N+ N+ N+ i@ L/ ", -"#+ k! 2{ 2{ ~] l~ u~ @{ u~ 1~ 1~ u~ u~ l~ l~ ]U #{ <^ G] G] I~ ^] ^] S{ I~ ^] S{ O{ S{ &/ e^ R] O] ( R] &/ S{ ^] ^] ^] S{ d^ S{ ^] :] d^ S{ S{ O] ]] R{ t^ 5] l>.<$ j> j, n& L- '! &~ d% &~ L= &~ {+ k& {+ a! ~> [* L) -& G# G# u> w $! q~ q~ q~ !{ !{ ){ m>.Gc n>.o>.p>.);.q>.r>.}@.u..u..W` xX xX xX s>.t>.u>.v>.w>.x>.y>.z>.A>.B>.C>.D>.>W E>.F>.D=.G>.H>.I>.J>.K>.L>.M>.N>.O>.P>.Q>.R>.S>.T>.U>.V>.W>.X>.Y>.Z>.`>. ,..,.+,.@,.#,.$,.%,.&,.*,.=,.-,.;,.>,.,,.',.Sn o;.),.!,.~,.{,.],.^,./,.(,._,.:,.<,.[,.},.|,.1,.2,.3,.4,.5,.6,.7,.8,.9,.0,.a,.b,.c,.d,.e,.f,.g,.h,.i,.j,.k,.k,.l,.m,.n,.o,.p,.q,.r,.s,.t,.u,.v,.w,.x,.y,.z,.A,.B,.C,.D,.E,.F,.G,.H,.I,.J,.K,.L,.M,.N,.O,.P,.Q,.R,.S,.T,.U,.V,.W,.X,.Y,.Z,.`,. '..'.+'.@'.#'.$'.%'.&'.*'.='.-'.;'.>'.,'.''.G! g~ ){ q~ l~ #{ #{ #{ P[ YC # z$ ;+ n k& n& L= @6 #6 #6 :e @6 )'.,^ )1 !'.u= #@ 1( ,^ O~ -' R_ s^ h{ S{ I~ f^ /] O] '_ h{ h{ h{ S{ ^] ^] S{ S{ i{ S{ S{ ^] I~ I~ G] G] G] I~ I~ I~ {] yc H] {] Q] &{ 5{ G] T{ {] 9{ #{ @{ F~ u~ 1~ m~ m~ m~ l~ 1~ *{ m~ U< ~'.E; D, E; M+ N+ N+ N+ i@ ", -"~! 2{ 2{ 3{ 3{ u~ #{ #{ l~ m~ 1~ u~ u~ l~ 1~ #{ @{ G] G] I~ ^] ^] S{ j{ h{ i{ h{ G] ^] R{ ( ( R] ( ( &/ S{ h{ ^] ^] S{ S{ S{ G] G] ^] ^] :] R] R] R] L{ ar {'.L) [* [* j& &~ &~ 4 k& {+ {+ j& ~> D# k& ~> }> j, M; c% G# O+ @ r! *! ){ h~ ){ ){ ){ !{ g~ ]'.n>.^'.t=./'.q>.r>.}@.u..W` W` xX xX 2Z 2Z ('.%W _'.;*.:'.<'.['.}'.['.|'.1'.2'.3'.4'.5'.6'.7'.I>.8'.9'..$.0'.a'.b'.c'.c'.d'.e'.f'.g'.h'.i'.j'.k'.l'.qU m'.n'.o'.p'.^ .s@.q'.r'.s'.iW t'.u'.U@.v'.w'.x'.kZ ),.E;.4*.y'.z'.A'.B'.HC C'.D'.E'.F'.G'.H'.I'.J'.K'.L'.M'.N'.h@.O'.P'.Q'.R'.S'.T'.U'.V'.W'.X'.Y'.Z'.`'. )..).+).@).#).$).%).&).*).=).-).x,.;).>).,).').)).!).~).{).]).^)./).()._).:).<).[).}).|).1).2).3).4).5).6).7).8).9).0).7N a).b).c).d).e).f).g).h).i).j).k).*'.l).m).n).o).p).q). j& l& ;^ L= ;^ P~ #6 X< r).l. 1# SV Z+ s).;^ D# t).6> u).^] ^] I~ 8{ /] O] %/ i{ S{ ^] I~ G] I~ ^] h{ j{ j{ h{ S{ S{ I~ G] G] I~ ^] ^] S{ ^] &{ {] {] &{ G] G] I~ G] I~ @{ #{ /] ]] u~ m~ m~ m~ l~ 1~ 1~ 1~ n~ !{ A9 W$ E; E; D, v$ v$ v$ v$ ", -"B! 3{ *{ 3{ ~] t~ u~ u~ u~ u~ #{ #{ u~ l~ l~ @{ #{ U{ G] I~ ^] ^] S{ j{ j{ j{ h{ I~ I~ e^ ( ( ( R] R] Q{ %/ h{ ^] h{ i{ S{ I~ G] &{ I~ ^] &/ '_ ( M{ O} v$ => L) [* [* j, j& k& j& k& k& D# }> j, ~> D# j& j, L) x; L& O+ O+ N( gb r) f~ g~ g~ G! v4 :! h~ s) O[ v).w)./'./'.r>.}@.x).y).W` W` 1Z 1Z 1Z 2Z 1Z z).A).B).C).['.D).E).F).G).H).I).J).K).XZ L).M).N).O).P).Q).R).S).T).U).V).W).X).Y).Z).N=.`). !..!.+!.@!.#!.G;.$!.%!.&!.*!.=!.:h -!.;!.>!.,!.YR '!.x'.~,.~,.)!.!!.~!.{!.]!.^!./!.(!.SM _!.:!.~.g~ ){ q~ n~ q~ n~ n~ ){ ,~.M+ G# O+ %& }> D# {+ &~ $~ -, '! >^ ]/ #6 j% J$ N& M$ ,^ {+ j, *> '~.)~.I~ db !~.T{ ]] @{ :] S{ S{ S{ ^] G] G] ^] I~ i{ Z] j{ i{ h{ I~ I~ I~ ^] I~ G] S{ S{ I~ &{ G] I~ I~ G] G] Q] I~ P{ ]] @{ F~ @{ u~ 1~ n~ l~ l~ 1~ m~ q~ m~ q~ H' 24 E; M+ M+ M+ M+ v$ ", -"m~ l~ u~ l~ u~ u~ u~ u~ #{ #{ F~ ]] @{ u~ u~ #{ #{ u~ @{ @{ O{ i{ i{ l{ ,: R] P{ G] ^] '_ ( R] R] R] R] R] R] N{ &/ i{ h{ h{ 8{ #{ 7{ ]] O] '_ i{ ~~.8, [* M; M; N+ >+ >+ L) ~> k& j& D# D# }> j, j, j, [* [* U; N+ O+ % O+ O+ (. 3) 3) 6~ T) T) Bc G! {~.]~.^~./~.(~.t=.);.q>.[@.}@.y)._~.:~.y).1Z 1Z 1Z !;.<~.[~.}~.|~.1~.C).2~.3~.4~.5~.6~.7'.7~.8~.9~.0~.a~.b~.c~.d~.e~.f~.g~.h~.i~.j~.k~.l~.m~.n~.o~.p~.q~.r~.s~.t~.WZ u~.w .v~.w~.x~.y~.z~.A~.B~.C~.D~.E~.F~.G~.H~.I~.3*.*V J~.K~.L~.M~.N~.O~.@-.P~.Q~.R~.S~.T~.U~.V~.W~.X~.Y~.Z~.`~. {..{.+{.@{.#{.${.%{.&{.*{.={.-{.;{.>{.,{.lN '{.){.!{.~{.{{.]{.^{./{.({._{.:{.<{.[{.}{.|{.1{.2{.3{.4{.5{.6{.7{.'=.8{.9{.0{.a{.b{.c{.d{.e{.f{.g{.h{.i{.j{.k{.l{.m{.n{.`X o{.p{.q{.r{.s{.t{.u{.v{.w{.x{.y{.z{.A{.B{.C{.D{.h~ h~ h~ !{ ){ ){ h~ g~ n=.2> D, -a v$ ;+ .; ^, ;] !) %, h; r& ;^ <{ L- (= Z_ }/ Y{ j, [* > z$ '~..{ X] E{.T{ I~ G] G] ^] ^] S{ h{ S{ G] I~ I~ ^] j{ j{ h{ S{ I~ S{ ^] ^] ^] G] I~ I~ I~ G] &{ I~ ^] I~ #{ @{ V{ ]] @{ l~ F~ @{ u~ l~ 1~ l~ u~ l~ 1~ q~ n~ n~ /~ h~ y` 2> E; E; E; r- ", -"m~ 1~ u~ #{ u~ u~ u~ u~ #{ u~ u~ #{ l~ l~ l~ l~ l~ #{ F~ F~ :] i{ n{ :( R] O] Q] G] S{ '_ R] R] R] R] R] O] O] /] X] ^] ^] :] u~ #{ @{ ]] O] ,_ s^ #! N+ M; x; c% N+ v$ v$ x; M; D# D# ~> ~> ~> ~> [* [* M; x; = N+ O+ O+ N+ v$ t' 3) 5~ 6~ O} O} 7J F{.G{.H{.I{.J{.K{.t=.u=.a%.[@.L{.v=.M{.N{.O{.1Z P{.1Z Q{.R{.S{.T{.U{.V{.W{.X{.:'.Y{.Z{.`{. ]..].+].+].@].#].$].%].%].&].+ .*].f~.=].-].;].>].,].'].eZ )].!].~].l~.{].]].^]./].(]._].:].<].[].}].|].1].2].3].4].8;.3*.5].3*.6].7].8].9].0].a].b].c].d].e].f].g].h].i].j].k].l].m].n].o].p].q].r].s].t].u].v].w].x].y].z].A].B].C].D].E].F].G].H].I].J].K].L].M].N].O].P].Q].R].S].T].U].V].W].X].Y].Z].`]. ^..^.+^.@^.#^.$^.%^.&^.*^.=^.-^.;^.>^.,^.'^.)^.!^.~^.{^.]^.^^./^.(^._^.:^.<^.[^.}^.|^.1^.2^.3^.4^.5^.){ h~ g~ h~ h~ h~ g~ g~ A9 r- E; e~ O+ ;+ ;+ u! ;] H! T- _. *+ &~ $~ n] ;^ P~ P~ 4 [* [* U; v$ v$ 4) ]] Q_ 6{ &{ &{ I~ S{ ^] I~ S{ ^] G] I~ I~ S{ S{ h{ S{ ^] ^] I~ &{ I~ S{ I~ I~ ^] ^] I~ G] ^] I~ I~ @{ @{ @{ #{ u~ l~ #{ u~ #{ #{ u~ u~ u~ u~ 1~ n~ n~ n~ m~ q~ ){ '@ r- E; E; r- ", -"1~ l~ l~ *{ u~ u~ l~ u~ @{ 8{ u~ #{ u~ u~ u~ l~ u~ @{ /] /] &/ i{ Z] k{ R] O] :] G] ^] R{ ,: ( R{ R] R{ O] R{ N{ X] S{ ^] T{ l~ @{ F~ ]] ]] N{ R! + J= L& q; -& N+ O+ = M& q; [* }> j> }> j> j, M; M; L) -& -& I+ O+ O+ N+ ;+ 3) k! 3) k! W} Cc 6^.7^.8^.9^.0^.a^.b^.t=.u=.a%.[@.c^.W` d^.e^.f^.g^.h^.i^.j^.k^.l^.m^.n^.o^.p^.q^.r^.s^.t^.u^.v^.w^.x^.y^.z^.A^.B^.C^.D^.E^.*].F^.G^.H^.I^.J^.K^.L^.M^.N^.O^.P^.Q^.R^.S^.T^.U^.V^.W^.X^.Y^.Z^.`^. /../.+/.@/.#/.$/.%/.&/.*/.=/.^].-/.;/.>/.,/.'/.,/.)/.!/.~/.{/.]/.^/.//.(/._/.8~.:/.,.+,.D/.E/.F/.G/.H/.I/.J/.K/.L/.M/.N/.O/.P/.Q/.R/.S/./K T/.U/.V/.W/.X/.Y/.Z/.`/. (..(.+(.@(.){ I` #(.g~ I` nw f~ f~ s) D E; M+ % >+ >+ x) C> w> :. :. :. &, &~ '! '! L= L= ~> [* L) `% N+ -& + 4) ]3 5{ {] {] I~ G] G] I~ ^] E~ :] ^] I~ h{ S{ S{ ^] G] I~ {] {] G] ^] S{ S{ O{ &/ I~ I~ S{ G] Q] @{ u~ u~ u~ u~ #{ #{ u~ #{ @{ #{ u~ u~ u~ l~ m~ n~ m~ m~ q~ n~ m! /< $(.$(.r- ", -"l~ s~ 3{ 3{ 3{ 1~ 1~ #{ <^ Q] <^ G] T{ {] {] <^ ^] Q{ O] R] s^ n{ Z] Z] n{ i{ ^] u4 !~.h{ n{ n{ 6] &/ O{ i{ %/ S{ S{ %(.&{ &(.u~ @{ 8{ *(.df =(.N+ Y% Y% % G# O+ q; L& x; q; 2; x; %& z$ z$ v$ N+ = M; M; M; r% I+ I+ M+ F ,@ (.,(.'(.)(.!(.b^.**.~(.U#.U#.}@.{(.](.^(.n^./(.((._(.:(.<(.[(.}(.|(.|(.AX 1(.2(.3(.4(.5(.6(.7(.8(.9(.0(.a(.D^.C^.b(.E^.F^.+ .c(.d(.e(.f(.g(.h(.i(.j(.k(.l(.m(.n(.o(.p(.U^.q(.r(.~h s(.+/.t(.u(.v(.i'.w(.x(.y(.z(.A(.B(.C(.m].m(.D(.E(.F(.G(.+ .H(.I(.J(.K(.L(.M(.N(.O(.P(.Q(.R(.S(.T(.U(.V(.W(.X(.Y(.Z(.`(. _.._.+_.@_.#_.$_.%_.&_.*_.=_.-_.;_.>_.,_.'_.)_.!_.~_.{_.]_.!V r/.^_./_.(_.__.:_.<_.[_.}_.|_.1_.2_.3_.4_.5_.6_.7_.8_.9_.0_.a_.b_.c_.d_.e_.f_.g_.h_.i_.j_.k_.l_.m_.n_.o_.p_.q_.r_.s_.t_.u_.v_.w_.x_.y_.z_.2^ ar <3 r& 5~ 5~ 3) ,@ r- E; O+ v$ >+ > j, ~> :. :. _. n& 4 4 '! n] n& M; M; L) L) x; x; N+ v$ h; *{ A_.,n 7{ #{ u~ #{ @{ @{ @{ @{ @{ :] I~ ^] G] &{ &{ H] &{ I~ O{ R] R] R] e^ Q{ R{ /] F~ P] 5{ <^ G] &{ G] I~ #{ #{ u~ u~ u~ #{ u~ l~ l~ 1~ 1~ 1~ m~ n~ m~ m~ m~ Ip W$ E; ", -"1~ u~ 3{ 3{ B! m~ 1~ 9{ G] I~ G] G] G] G] &{ ^] h{ R] O] R] m{ n{ 7] 7] j{ i{ %(.!~.db i{ n{ j{ i{ ^] ^] S{ ^] G] ^] db u4 9{ u~ #{ H~ Us A! u Y% Y% Y% % % % q; 2; 2; 2; 2; L& N+ v$ v$ v$ N+ N+ )- x; M; r% D, D, E; E; ,3 J' 5~ 5~ a~ pu B_.C_.D_.E_.F_.R> G_.H_.0%.=*.[@.[@.}@.I_.J_.J_._(.((.K_.L_.h^.:(.2Z !;.3Z 1(.M_.M_.wX M_.|(.M_.`` N_.O_.P_.Q_.R_.S_.CM T_.U_.V_.W_.X_.Y_.Z_.J^.`_. :.7'..:.+:.@:.#:.$:.e'.%:.%:.&:.*:.=:.-:.;:.>:.,:.':.Ml ):.!:.~:.{:.B(.B(.]:.^:./:.(:._:.::._:.<:.[:.}:.|:.1:.2:.3:.4:.5:.6:.7:.8:.9:.0:.a:.b:.c:.d:.e:.f:.g:.h:.i:.j:.k:.l:.m:.n:.o:.p:.q:.r:.s:.t:.u:.v:.w:.x:.n,.y:.z:.A:.B:.C:.D:.E:.F:.G:.H:.I:.J:.K:.L:.M:.N:.O:.P:.Q:.DL R:.S:.T:.U:.V:.W:.X:.Y:.Z:.`:. <..<.+<.@<.#<.$<.%<.&<.*<.=<.-<.r_.;<.><.,<.'<.)<.!<.~<.{<.A! >2 ]<.5~ 5~ 6~ i' r- F N+ N+ > V+ j, }> c> 6. _. {+ {+ n& l& l& [* q; x; M; M; x; x; c% % % M@ C! u~ #{ u~ u~ u~ l~ u~ u~ u~ #{ P] I~ {] {] {] &{ &{ G] S{ 6] ( ( ( ( R] ( O] /] /] I~ G] G] I~ &{ I~ #{ #{ u~ u~ l~ u~ u~ l~ l~ l~ #{ u~ l~ l~ l~ l~ 1~ m~ J' J& ", -"l~ l~ 3{ ~] s~ 1~ u~ %{ ^] ^] ^] ^] ^] G] I~ ^] S{ O] O] R] s^ 7] 7] Z] j{ i{ %(.I~ !~.S{ h{ S{ S{ S{ ^] ^] ^] I~ !~.!~.^<.^<.#{ t~ .{ 7% r- |. Y% Y% Y% Y% % M& q; 2; q; 2; 2; J= = N+ N+ N+ N+ N+ M& q; x; I+ D, D, E; V$ 7~ 5~ 5~ 3) G! /<.(<._<.:<.<<.[<.}<.|<.1<.0%.=*.2<.t..V` 3<.4<.5<.[~.6<.K_.7<.1Z 8<.1Z xX 9<.0<.X` wX wX wX a<.b<.c<.d<.e<.e<.f<.g<.=W h<.i<.j<.k<.l<.m<.n<._;.o<.p<.q<.r<.s<.t<.u<.v<.w<.e'.x<.y<.z<.A<.B<.C<.D<.E<.F<.G<.C<.H<.I<.J<.K<.L<.M<.]:.N<.O<.P<.Q<.::.E(.R<.S<.T<.U<.V<.W<.X<.Y<.Z<.`<. [..[.+[.@[.#[.$[.%[.&[.*[.=[.-[.;[.#H >[.,[.'[.)[.![.~[.{[.][.^[./[.([._[.SO :[.<[.[[.}[.|[.1[.2[.3[.4[.5[.6[.G:.7[.8[.9[.0[.a[.b[.c[.d[.Y=.k .e[.f[.g[.h[.i[.j[.k[.l[.m[.n[.o[.p[.q[.r[.s[.t[.u[.v[.w[.x[.y[.z[.A[.B[.C[.D[.E[.ew F[.G[.H[.I[.y~ 3) 5~ 5~ }> }> ;+ ;+ 6. j& k& k& k& ~> 2; 2; q; x; x; M; x; Y% Y% Y% x! x 2{ *{ #{ u~ u~ u~ #{ #{ u~ #{ V{ I~ {] {] {] {] G] I~ S{ %/ R] R] >_ ( ( >_ O] O] /] 5{ {] G] ^] ^] :] V{ u~ u~ u~ l~ l~ #{ u~ u~ 1~ l~ u~ l~ l~ l~ u~ 1~ 1~ /~ <3 ", -"1~ m~ s~ u~ #{ u~ #{ F~ S{ S{ I~ ^] S{ I~ ^] S{ S{ P{ /] O] :( 7] n{ n{ n{ n{ J[.I~ S{ R{ /] /] O] ]] @{ %{ G] I~ T{ K[.L[.M[.9{ t~ UC V+ -& q; q; q; J= Y% Y% Y% Y% % M& J= J= J= )- M; M; -& -& )- |) e~ |) I+ D, D, tP y 3) I' p) )] 8> q) N[.O[.P[.Q[.R[.iX &*.S[.1<.1<.=*.[@.L{.T[.U[.4<.V[.u>.('.1Z 1Z 1Z 1Z :(.W[.('.!;.!;.!;.1Z 1Z !;.wX V#.X[.1(.Y[.Z[.`` `[.W#. }..}.+}.@}.#}.!*.$}.%}.&}.*}.=}.-}.;}.>}.,}.'}.)}.!}.~}.{}.]}.^}./}.(}._}.:}.<}.[}.}}.|}.1}.2}.B<.A(.3}.4}.5}.6}.7}.8}.9}.0}.a'.a}.b}.c}.d}.e}.f}.+R g}.h}.&i i}.j}.k}.l}.m}.n}.o}.p}.q}.r}.s}.t}.u}.v}.w}.x}.y}.z}.A}.B}.C}.D}.E}.F}.G}.H}.I}.J}.K}.L}.M}.N}.O}.P}.Q}.R}.(} S}.T}.U}.q> V}.W}.X}.Y}.Z}.`}. |..|.+|.@|.#|.$|.%|.&|.*|.=|.-|.;|.>|.#!.,|.'|.)|.!|.~|.{|.]|.^|./|.(|._|.:|.<|.[|.}|.||.1|.ff .0 2|.4) <3 r# F M+ v$ v$ >+ ;+ >+ >+ ;+ <$ j& j& D# 6. z$ Y% p- M& % % G# M& J= Y% Y% Y% Y% %, b4 u~ u~ T{ T{ T{ 9{ #{ @{ <^ ^] G] U{ l~ l~ 4{ I~ ^] h{ &/ z] i{ s^ s^ h{ O{ S{ O{ ^] &{ &{ P{ O] R] D~ &{ &{ G] o~ R! U{ T{ {] `{ 1~ u~ u~ u~ u~ u~ l~ m~ l~ >: ", -"l~ l~ l~ l~ u~ u~ u~ F~ S{ ^] I~ I~ I~ G] ^] S{ h{ '_ R] ( Z] 8] Z] n{ n{ n{ h{ ^] h{ '_ O] O] O] ]] @{ %{ &{ G] <^ K[.K[.K[.9{ s~ : x; x; x; M; L) -& G# Y% q% Y% Y% % % % p- J= x; M; M; M; x; |) e~ e~ D, D, E; @> i) 3) I' p) i~ 3|.4|.5|.6|.7|.8|.9|.0|.a|.b|.<@.1<.=*.[@.L{.W` W` W` W` 1Z 1Z 1Z 1Z 2Z 2Z :(.h^.1Z 2Z 2Z 1Z 1Z 1Z s>.|(.a<.|(.1(.w..c|.d|.Z` x..e|.f|.g|.h|.i|.j|.k|.l|.m|.n|.l<.W_.W_.o|.o|.p|.q|.r|.s|.U<.t|.u|.XS v|.O).n].w|.x|.y|.|}.z|.A|.B|.E^.{}.C|.D|.E|.F|.G|.d(.H|.9~.I|.J|.K|.L|.M|.N|.O|.P|.Q|.R|.S|.T|.U|.V|.W|.X|.Y|.Z|.`|. 1..1.+1.@1.#1.$1.%1.&1.*1.=1.-1.;1.>1.,1.'1.)1.!1.~1.{1.]1.^1./1.(1._1.:1.<1.[1.}1.|1.11.(j 21.31.41.51.rL 61.71.81.91.01.a1.b1.c1.d1.e1.f1.g1.h1.i1.j1.k1.l1.m1.n1.o1.p1.q1.r1.s1.t1.u1.v1.w1.x1.y1.z1.A1.B1.C1.h~ m>.7! X, F] r- v$ v$ N+ z$ ;+ N+ z$ 5. )$ }> ~> c> 5. G# % % G# % % % Y% Y% % % Y% Y% O+ L' l~ u~ T{ &{ &{ 5{ @{ #{ 9{ I~ I~ o~ u~ #{ u~ {] G] h{ h{ h{ h{ S{ S{ S{ G] I~ ^] ^] G] G] /] O] O] I~ &{ &{ ^] G] yc H] I~ {] `{ l~ l~ l~ l~ #{ l~ l~ l~ l~ l~ ", -"u~ l~ u~ ]U u~ 9{ 7{ ]] S{ S{ I~ &{ G] G] I~ ^] h{ e^ R] O] :( 7] n{ Z] n{ s^ i{ S{ S{ %/ O] O] R] /] F~ %{ G] I~ db D1.E1.]U Z{ S> P+ M; L) L) [* j, %& U; O+ % Y% Y% p- Y% Y% Y% p- q; q; x; M; b- Q- -a # D, M+ u z. 5) 3) P[ G' +] F1.G1.H1.I1.J1.K1.L1.M1.w).N1.O1.<@.=*.[@.L{.W` W` T[.W` 8<.1Z 1Z 1Z xX xX 1Z y).1Z 1Z 2Z 1Z 1Z 8<.h^.2(.wX M_.|(.V#.P1.w..V#.Q1.R1.S1.T1.U1.V1.W1.X1.Y1.;}.Z1.`1.`1.W_.p|.,}. 2..2.y<.+2.@2.#2.!].$2.%2.%2.&2.*2.=2.|}.|}.-2.;2.>2.,2.'2.8}.)2. ].!2.~2.{2.]2.^2.J[ /2.(2._2.:2.<2.[2.}2.|2.12.[2.22.32.42.52.62.72.82.92.02.a2.b2.c2.d2.e2.f2.g2.h2.i2.-o j2.k2.l2.m2.n2.o2.p2.q2.r2.s2.t2.u2.v2.w2.x2.y2.z2.A2._n od B2.6 .Ze ]c C2.D2.^N E2.F2.G2.H2.I2.J2.K2.L2.M2.N2.O2.P2.Q2.R2.!].S2.T2.U2.V2.W2.X2.Y2.iz Z2.`2. 3..3.0( +3.@3.#3.$3.%3.|{ &3.<3 a~ E M+ M+ N+ v$ >+ z$ z$ ;+ ;+ V+ }> c> >+ % Y% % % % % % % Y% p- J= Y% Y% Y% tP h~ u~ <^ I~ G] :] ]] @{ 9{ &{ G] 6{ @{ F~ 8{ &{ &{ I~ S{ h{ h{ h{ ^] ^] 6{ {] G] G] {] G] N{ O] /] :] G] G] ^] I~ G] G] G] H] 9{ #{ #{ 1~ l~ u~ u~ u~ l~ u~ #{ ", -"u~ u~ <^ G] :] G] <^ D~ ^] S{ ^] G] I~ I~ f^ /] O] d^ ^] h{ */ 7] 7] */ ( R] &/ h{ h{ R{ O] R] e^ A] !~.I~ S{ h{ %(.<^ *{ ,1 [' @ @ N+ N+ %& }> ~> }> L) j, L) = L& Kj Y% Y% Y% ,- Kj 2; q; q; q; % |. G# , L/ i@ [ I' I' +! s) *3.=3.-3.;3.>3.,3.'3.)3.w).w).H_.|<.u=.=*.[@.L{.W` W` T[.vX vX vX xX xX xX xX vX vX vX 1Z 2Z 1Z 1Z 1Z ('.!3.!;.1Z wX Y` Y` X` Y` Z` ~3.{3.4~.]3.^3./3.(3.z.._3.:3.<3.<3.[3.}3.{}.|3.`1.V_.+:.13.t|.23.k(.k(.33.43.53.*:.63.73.83.93.U_.03.a3.g<.b3.c3.d3.d3.e3.`` o^.f3.g3.h3.i3.j3.k3.l3.m3.n3.o3.p3.q3.r3.Y(.s3.t3.u3.v3.w3.x3.y3.z3.A3.B3.C3.D3.E3.F3.G3.H3.I3.J3.K3.L3.M3.N3.O3.P3.ij Q3.R3.S3.T3.U3.V3.W3.%Y X3.Y3.Z3.`3. 4..4.+4.@4.#4.$4.%4.&4.*4.=4.-4.;4.>4.,4.'4.)4.N/.!4.~4.{4.]4.^4./4.(4._4.:4.<4.[4.}4.|4.14.24.34.44.54.J# ^~.64.74./! &3.3) 4) w M+ E; M+ N+ v$ z$ j, j, }> ;+ V+ ;+ = % Y% % % % % Y% Y% Kj 2; q; G# % G# O+ z, =7 0{ &{ &{ O{ O] /] @{ @{ @{ 8{ Q] I~ D~ S{ I~ G] ^] S{ h{ S{ G] &{ u~ `{ V! {] &{ I~ /] O] F~ 8{ F~ V{ I~ ^] ^] I~ G] &{ V! @{ l~ 1~ l~ u~ u~ u~ u~ u~ u~ ", -"l~ ]U T{ G] I~ I~ I~ ^] ^] S{ I~ &{ G] I~ X] O] O] h{ ^] h{ j{ n{ n{ ,_ ( R] &/ S{ h{ N{ O] R] %/ db !~.db ^] ^] I~ db DH t) v$ v$ v$ v$ N+ %& [* [* j, j, }> j, [* M; q; Y% Y% '- ~i Kj 2; 2; q; q; # K& e~ e~ E; &$ G! Lz 84.Us X_ 94.04.a4.b4.c4.d4.c4.e4.w).H_.f4.g4.u=.~(.[@.L{.W` T[.T[.T[.T[.T[.T[.T[.T[.T[.T[.T[.xX xX 2Z 2Z 1Z 1Z 2Z 2Z 1Z 1Z wX M_.M_.Y` X` h4.i4.j4.k4.l4.m4.n4.o4.. .<3.<3.. .03.p4.q4.r4.W_.|3.s4.t4.u4.v4.w4.x4.x4.4}.y4.>2.z4.A4.73.B4.C4.+}.g<.<3.D4.D4.D4.D4.<3.x..x..E4.F4.G4.H4.I4.J4.K4.L4.M4.N4.O4.P4.Q4.R4.S4.T4.U4.V4.W4.X4.Y4.Z4.`4. 5..5.+5.@5.#5.$5.%5.&5.*5.=5.-5.;5.>5.,5.'5.)5.!5.~5.{5.]5.^5./5.(5._5.U@.:5.<5.[5.X}.}5.35 |5.15.25.35.45.55.65.75.85.95.05.a5.b5.c5.d5.e5.f5.g5.h5.i5.j5.k5.l5.m5.n5.o5.p5.q5.r5.s5.t5.u5.v5.%h w# w5.x5.m~ =e 5~ 3) M@ r- E; M+ N+ N+ v$ b> [* }> ;+ >+ z$ G# % % % % Y% Y% q% Y% )- M; L) `% O+ O+ A> ^; $+ :! &{ G] E~ O] /] ]] @{ #{ P] I~ G] I~ S{ I~ &{ I~ ^] ^] I~ &{ {] V! #{ #{ {] G] I~ /] /] #{ u~ #{ @{ :] S{ ^] I~ ^] G] V! #{ l~ m~ 1~ l~ u~ #{ #{ @{ l~ ", -"1~ 1~ {] G] G] I~ S{ S{ S{ h{ I~ G] I~ S{ O] R] O] z] ^] S{ i{ j{ s^ s^ ( O] z] h{ S{ N{ R] /] R{ db !~.I~ I~ I~ ^] Q] *! $+ > >+ z$ z$ v$ b> j, }> }> j, j, }> }> j, [* I+ % a& y5.~i Kj x; L) h& z5.Gc /y K` L` A5.B5.C5.D5.8, ;- E5.F5.G5.H5.I5.J5.K5.L5.w).M5.N5.O5.P5.=*.[@.L{.W` T[.T[.T[.T[.T[.T[.T[.T[.xX xX xX xX xX 2Z 2Z 1Z y).8<.P{.8<.1Z wX wX wX Q5.s>.R5.S5.T5.U5.V5.W5.Q_.l<.<3.D4.<3.z..7}.X5.Y5._3.Z5.+ .`5.-}.r4.,2. 6.7}..6.y4.+}.+}.8}.+6.@6.X_.g<.<3.<3.. .CX #6.+}.$6.d3.%6.E4.x..&6.*6.=6.,B -6.;6.>6.,6.'6.)6.f:.!6.~6.{6.]6.^6./6.(6._6.:6.<6.[6.}6.|6.16.26.$5.36.46.56.66.76.86.96.06.a6.b6.c6.d6.e6.f6.g6.h6.i6.j6.k6.l6.m6.n6.o6.p6.q6.r6.s6.t6.u6.zU v6.w6.x6.y6.z6.A6.B6.C6.D6.E6.F6.G6.H6.I6.J6.K6.L6.M6.N6.O6.P6.Q6.R6.S6.T6.U6.V6.W6.I5.X6.Vz Y6.*+ #] I9 5~ 5~ K' E D, M+ N+ O+ -& L) L) [* z$ z$ O+ q% ,- Y% Y% Y% Y% Y% G# v$ %& [* [* b> N+ O+ t; A> # Z6.H] G] D~ /] /] ]] @{ #{ P{ ^] G] G] G] &{ G] I~ I~ G] &{ {] {] u~ @{ ]] ^] ^] S{ /] O] ]] #{ l~ #{ :] S{ S{ G] I~ G] 7{ 4{ u~ l~ S! u~ u~ u~ #{ #{ u~ ", -"l~ V! G] ^] ^] S{ I~ &{ I~ S{ I~ G] ^] &/ O] R] ( '_ Q{ O] '_ e^ e^ k{ */ i{ R{ R] Q{ s^ i{ d^ E~ I~ ^] ^<.V{ 8{ V} `6.~a o' X! )) c> c> i> ~> ~> }> }> }> }> ~> G$ X+ $& 93 03 2~ 7.B# .7.+7.@7.#7.$7.J&.%7.&7.*7.=7.-7.;7.K{ *+ go >7.,7.'7.n..>7.c4./R )7.!7.1l ~7.jB {7.U#.[@.L{.W` T[.T[.T[.T[.T[.T[.T[.T[.xX xX xX xX xX 2Z xX W` W` vX 1Z 1Z 1Z 1Z 1Z !;.a<.]7.^7./7.(7._7.:7.<7.[7.D4.D4.D4.y..E4.%6.f<.+}.<3.}7.|7.1@.Z[.<3.17.17.27.9R 37.U_.47.57.67.-}.:3.. .<3.. .77.87.97.07.a7.b7.c7.d7.e7.f7.g7.h7.i7.j7.k7.l7.m7.n7.o7.p7.q7.r7.s7.t7.u7.v7.w7.x7.K= w& y7.z7.A7.B7.C7.D7.E7.F7.G7.H7.I7.J7.K7.L7.M7.N7.O7.P7.Q7.R7.S7.T7.U7.V7.W7.X7.Y7.n6.Z7.`7. 8..8.+8.@8.#8.$8.%8.&8.*8.=8.-8.;8.>8.,8.'8.)8.!8.~8.{8.]8.^8./8.(8._8.:8.<8.[8.}8.|8.18.28.38.48.58.68.K5.78.88.dz 98.Bc cw 'a 6X v F E; t; O+ G# U; [* M; `% M; J= '- '- ,- ,- ,- )- %& j, j, L) [* ~> >+ >+ v$ O+ t; N+ i@ 08.;/ E~ :] I~ I~ Q] G] ^] ^] G] &{ G] &{ G] G] I~ G] &{ {] &{ G] 5{ &/ d^ h{ h{ z] i{ O{ #{ 1~ l~ Q] ^] S{ ^] G] G] <^ 6{ G] &{ &{ <^ 4{ u~ u~ l~ @{ ", -"#{ f^ E~ S{ S{ S{ G] G] I~ I~ ^] ^] S{ h{ e^ ( ,: ( R] R] O] O] R] a] Z] j{ %/ O] O] &/ h{ S{ ^] I~ I~ Q] @{ *{ ^: v! g/ M] {) K~ X! {+ 4 n& n& {+ k& n& {+ ;- t% a8.]t /t jP 9J #7.b8.c8.d8.e8.f8.f8._R &L /R ]@.K5.g8.h8.U} i8.j8.68.k8.68.]@.]@.O` (R l8.m8.n8.Q, o8.p8.U#.[@.L{.W` W` W` W` W` T[.T[.T[.T[.xX xX 2Z 2Z 2Z 2Z xX xX T[.xX xX 2Z 1Z 1Z 1Z 2Z q8.r8.s8.t8.u8.^@.v8.w8.Z` Y` w..Y[.Z` Z` x..y..<3.D4.y.. .E4.W#.|7.*}.9R x8.y8.z8.h~.A8.B8.17.. .. .1@.d<.E4.27.C8.8~.D8.E8.+].F8.G8.H8.2(.I8.$W J8.K8.L8.M8.N8.O8.P8.Q8.R8.S8.T8.U8.V8.W8.X8.Y8.Z8.`8. 9..9.+9.@9.#9.$9.%9.&9.*9.=9.-9.;9.>9.,9.'9.)9.!9.~9.{9.]9.^9./9.(9._9.:9.<9.[9.}9.|9.19.29.39.49.59.69.79.89.99.09.a9.b9.c9.d9.e9.f9.g9.h9.i9.j9.k9.l9.m9.n9.o9.p9.q9.r9.s9.S6.t9.u9.v9.w9.x9.,7.k8.]@.y9.z9.A9.B9.C9.K5.D9..O E9.Sc s4 7o F9.c- -{ r% L) x; ~i ~i ~i ~i q; L) j, ~> ~> }> j, j, j, %& z$ N+ O+ N+ v$ F, -/ [' t~ I~ ^] ^] I~ I~ I~ I~ G] &{ G] G] I~ I~ ^] I~ S{ G] I~ h{ h{ S{ S{ h{ h{ h{ h{ O{ 8{ u~ 4{ :] ^] I~ h{ ^] ^] ^] G] ^] I~ I~ G] %{ #{ #{ l~ 1~ ", -"#{ F~ ^] S{ h{ S{ ^] S{ ^] I~ ^] S{ ^] h{ ,_ ,: ,: ( R] R] O] R] ,: a] n{ j{ '_ R] R] O{ I~ I~ ^] G] &{ :] E{.s~ y; g/ g/ J^ G9.{) K~ $~ Q~ &~ l& l& l& &~ $~ '! /t jP 8G H9.I9.J9.K9.K9.L9.U+.f8.U+.M9.e8.qM (R DS N9.wr -< O9.P9.Q9.R9.S9.]@.DS k8.T9.CP U9.V9.W9.]) X9.Y9.r>.[@.L{.u..W` W` W` W` W` W` W` W` W` vX 1Z vX 1Z 1Z 1Z W` W` W` 1Z 1Z 1Z 2Z s>.Z9.`9. 0..0.+0.@0.#0.$0.%0.Y` !;.wX M_.Y` w..w..Y[.D4.. .d<.x..`[.&0.*0.3@.=0.-0.;0.6Z g<.<3.d3.>0.2@.,0.x=.07.x=.T_. ].'0.)0.!0.~0.{0.]0.l^.^0./0.X` (0._0.:0.<0.[0.}0.|0.10.20.30.y3.40.50.60.70.80.90.00.a0.b0.c0.d0.e0.f0.g0.h0.i0.j0.k0.l0.W~.Cs m0.n0.o0.p0.q0.r0.s0.t0.u0.v0.Qc w0.x0.y0.z0.A0.B0.C0.D0.E0.F0.G0.H0.I0.J0.K0.L0.M0.N0.O0.P0.Q0.R0.S0.T0.U0.V0.W0.X0.Y0.Z0.`0. a..a.+a.@a.#a.$a.%a.,: &a.c4.K5.*a.=a.-a.;a.>a.`d ,a.'a.k8.(R )a.!a.!@.nl ]t ~a.c. i> p- ,- 2; L) }> D# j& j& D# }> j, j, }> ;+ z$ N+ v$ v$ z$ b> bi :* k! &{ &{ G] G] G] I~ ^] I~ G] G] G] &{ G] ^] ^] h{ S{ S{ i{ j{ h{ S{ h{ h{ S{ i{ S{ F~ 4{ #{ E~ ^] &{ ^] I~ ^] ^] ^] h{ ^] I~ I~ %{ @{ #{ m~ m~ ", -"u~ #{ 8{ f^ f^ &{ I~ S{ ^] ^] S{ S{ S{ i{ :^ 8] $/ k{ ( O] '_ s^ */ */ j{ j{ s^ 6] i{ S{ G] I~ ^] G] I~ E~ DH O- ^{ {) {) K~ z) {) K~ 1! z) 1! 4 l& l& !) 1! Q~ /t LH {a.]a.88.I9.^a.L9./a.M9.f8.f8.U+.f8.qM (a._a.:a..Aa.AX Ba.Ca.Da.Ea.Fa.Ga.Ha.Ia.Ja.Ka.La.Ma.Na.Oa.Pa.Qa.Ra.Sa.Ta.Ua.Va.Wa.Xa.Ya.Za.`a. b..b.+b.@b.Sd #b.$b.%b.&b.*b.=b.-b.;b.>b.,b.'b.)b.!b.~b.{b.]b.^b./b.(b._b.*..:b. j, .> ;> -> -> y> y> x) x) =! += c.,W ,c.77.t>.'c.)c.!c.~c.{c.g7.I8.]c.^c./c.(c._c.:c.d.,d.'d.Q9.k#.e8.)d.#L .L !d.9G dw jP Tz Tz Af DE xf `5 `= x> ;> j, j, =! C> u! C> u! C> u! s! s! C> j& {{ *{ u~ l~ 4{ o~ I~ ^] I~ G] S{ S{ S{ S{ S{ ^] O{ Q{ O] /] /] O] O] i{ S{ ^] ^] S{ h{ h{ ^] S{ S{ h{ S{ S{ I~ ^] P] ]] @{ u~ ]] F~ #{ u~ ", -"]] F~ @{ #{ l~ `&.{] &{ S{ h{ ^] h{ h{ n{ j{ i{ j{ ,: ( R] s^ j{ Z] 7] 9] 8] Z] Z] i{ h{ I~ G] I~ G] I~ B! b~ /{ #~ K~ {) K~ @~ b{ [{ K~ K~ z) &~ &~ m& !) {) c~ ~d.jB {d.9J 88.kB ]d.d8.^d./d.e8._R M9.e8.k#.*O @R !%.(d./R DS (R *L k#./Z _R qM O` T9.e8.S#._d.-q ;' :d.e.,e.'e.)e.!e.~e.{e.]e.^e./e.(e._e.:e. x> x> x> x> u! s! s! ;] ;] te.C> >t f! u~ u~ `{ {] G] G] G] I~ S{ h{ S{ i{ h{ h{ &/ /] R] O] O] O] Q{ h{ S{ ^] S{ h{ h{ h{ ^] ^] S{ ^] ^] ^] I~ I~ f^ @{ @{ @{ F~ @{ l~ l~ ", -"&/ P{ F~ u~ 4{ &{ G] I~ S{ S{ ^] h{ h{ i{ N{ R] k{ k{ :( */ 8] 7] 7] 7] 7] Z] Z] Z] S{ ^] G] &{ &{ 5{ f! s H, #~ 7! {) {) z) 1! 1! Q~ !) Q~ '! &~ &~ l& l& !) !) L- &n ue.!@.ve.we.^a.d8.xe.;O ;O ye.ze.k#.YV #R Ae.Be._R *L ]@./R *L qM CP _R /Z /R K5.Fb.Ce.De.Ee.dw Fe.Ge.He.t..t..Ie.}d.|@.b%.}@.b%.b%.b%.V` b%.b%.V` Je.Ke.Le.Me.Ne.Oe.Pe.Qe.Re.Se.Te.Ue.Ve.Ve.We.L|.Xe.Ye.Ze.7<.1Z 1Z 1Z 2Z 2Z 2Z 2Z 1Z 1Z !;.1Z wX V#.Y` M_.1(.%0.$W Z` I8.`e.[(. f. f..f.+f.@f.#f.$f.%f.&f.*f.=f.-f.;f.>f.,f.'f.)f.^@.!f.~f.{f.nb.]f.^f./f.(f._f.:f.g.,g.'g.)g.-U xe.bJ !d.0J dw 8G 8G jB jP LH Tz Tz Tz &[ '$ U> x> ;> x> ;> ;> =! w> w> E) k& E) E) u! Mg Y! h; m! l~ U{ V! #{ T{ o~ G] S{ h{ h{ j{ i{ h{ h{ &/ O{ d^ R] O] /] S{ S{ S{ S{ ^] h{ h{ ^] ^] ^] G] G] I~ G] ^] f^ @{ #{ u~ u~ #{ u~ u~ ", -"h{ S{ F~ #{ f^ I~ ^] ^] S{ S{ ^] h{ h{ h{ N{ O] ( m{ Z] Z] 7] Z] n{ i{ n{ 7] Z] j{ S{ I~ ^] I~ 5{ %2 ,! N~ b{ @~ z) K~ K~ Q~ n] '! $~ $~ '! '! $~ l& $~ $~ &~ E) |! *G !g.~g.~g.Fb./a./a.f8.>O N` N` {g.OH ]g.Fb._R f8.e8.e8.*L &L CP k#.*L T9.O` O` /R ^g.9%.w)./g.(g._g.:g..dg. c.X` X` wX X` 1(.5Z |(.eg.fg.d%.3(.gg.hg.ig.jg.kg.lg.mg.ng.og.pg.qg.rg.sg.tg.ug.vg.wg.ea.xg.yg.zg.Ag.Ag.Bg.Cg.Dg.m* Eg.Fg.Gg.Hg.Ig.Jg..0.Kg.Lg.Mg.Ng.Og.Pg.vH Qg.Rg.Sg.Tg.Ug.v>.Vg.Wg.Xg.Yg.Zg.`g. h..h.+h.@h.#h.$h.%h.&h.*h.=h.-h.;h.>h.,h.'h.)h.!h.~h.{h.]h.^h./h.(h._h.:h. x) w> j& D# ~> ~> ~> D# j& k& -! H! X! `~ `= r~ 9{ u~ l~ 7{ D~ G] S{ h{ i{ i{ i{ h{ ^] h{ S{ i{ ( R] R] S{ S{ ^] ^] ^] S{ S{ S{ S{ I~ G] &{ G] I~ h{ R{ F~ u~ l~ 1~ l~ 1~ l~ ", -"S{ &/ /] /] O] S{ h{ S{ ^] S{ I~ ^] S{ S{ R{ e^ R{ %/ j{ n{ j{ n{ 9] 7] 7] Z] j{ h{ S{ S{ ^] G] p~ C& B) lh.b{ b{ @~ b{ @~ Q~ '! '! $~ $~ Q~ $~ &~ 4 4 {+ }> j, n& mh.nh.Fb.^a.^a.U+.M9.k#.oh.oM ]Z ph.qh.rh./d.M9.^a.Fb./a.e8.qM &L qM CP O` ]@.]@.(R sh.th.u=.uh.vh.wh.xh.U#.r>.[@.t..}@.}@.}@.}@.}g.}g.}@.c^.yh.V` }@.L{.U` zh.Ah.Bh.Ch.Dh.Eh.Fh.Gh.u..5a.W` Hh.Ke.Ih.Jh.Kh.U[.1Z xX xX xX xX xX xX vX vX 1Z !3.%W h^.z).vX xX xX Q{.Lh.Mh.Q{.Nh.Oh.Ph.M_.Qh.Rh.6-.Sh.Th.mg.Uh.Vh.Wh.Xh.Yh.v9.Zh.`h. i..i.+i.@i.#i.$i.w& %i.&i.*i.=i.-i.;i.>i.,i.'i.)i.!i.~i.{i.]i.^i./i.8G (i._i.:i. x> x) 9^ =! ~> }> }> }> }> ~> D# k& m& {) K~ G{ ^e X, ^~ l~ l~ %{ ^] ^] S{ S{ S{ d^ h{ h{ ^] h{ i{ :( ,_ ( '_ i{ h{ ^] ^] h{ h{ i{ S{ S{ I~ I~ G] I~ I~ ^] P{ F~ u~ l~ 1~ l~ l~ l~ ", -"^] &/ &/ &/ R{ R{ R{ N{ X] N{ P{ :] ^] S{ O{ %/ :( h{ S{ n{ j{ n{ 9] 9] 8] 7] :( '_ e^ &/ Q] t~ E- 2! 2! -: L= L= N~ L= y{ &~ &~ '! $~ Q~ z) {) {+ k& D# ~> }> }> 7> Af Wi.^a.d8.d8.:R Xi.Yi.Zi.`i. j..j.+j.dJ /a.d8.d8.d8.M9.f8.qM *L /R FS GS qM ~O @j.#j.$j.);.u=.u=.a%.a%.~(.U#.[@.t..t..[g.t..r>.r>.%j.&j.t..*j.V` }@.V` U` }@.V` t..t..t..=j.%j.t..t..t..Ah.-j.;j.>j.Te.v..vX W` xX xX xX xX xX W` W` W` xX O{.z).vX ,j.xX vX y).<~.h4.'j._(.)j.Hg.7<.!j.~j./(.<(.{j.e^.]j.^j./j.(j._j.:j.k.,k.'k.)k.!k.~k.{k.]k.,O T9./R &L CP &L &L _R U+.^k.HS /k.(k.jS NH _k.aJ @R 9J 8G jB jB jB LH jP jP Tz jP L^ ~> C> ;> =! .> =! }> j, ~> D# ~> ~> j& 4 !) Q~ Q~ !) `g k& i- l~ D1.:k.^] I~ ^] P{ :] N{ Q{ R{ N{ h{ j{ :( ( R] O] %/ h{ S{ S{ h{ h{ j{ S{ S{ S{ S{ I~ I~ G] ^] f^ @{ #{ u~ l~ #{ u~ l~ ", -"I~ ^] S{ S{ ^] /] /] O] R] /] /] h{ ^] h{ i{ i{ j{ h{ h{ j{ n{ 8] 5/ 9] 8] 7] k{ R] O] ]] .{ E- ,! B) B) <{ L= L= n] n] $~ l& &~ '! '! z) X! E) j& {+ j& D# ~> i> ^ V5 we.Fb.xe.xe..s>.1Z 2Z 2Z X` 2Z #W ck.dk.ek.fk.('.gk.hk.[~.Te.Jh.ik.jk.kk.lk.mk.nk.ok.pk.qk.rk.sk.tk.uk.vk.wk.xk.yk.zk.Ak.uj.Bk.Ck.&a.Dk.Ek.Fk.Gk.Hk.Ik.Jk.xa.Kk.Kk.Lk.Mk.Nk.Ok.Pk.Qk.Rk.Sk.Tk.Uk.Vk.Wk.Xk.Yk.Zk.`k. l..l.+l.@l.#l.$l.%l.&l.*l.=l.-l.;l.>l.,l.'l.)l.!l.~l.{l.$* ]l.^l./l.(l._l.:l. s! w> D# ~> }> }> D# D# ~> ~> D# k& &~ &~ '! '! $~ '! 4 I= F! 9{ u4 I~ ^] :] /] O] /] /] O] /] h{ j{ j{ ,: ( R] S{ ^] I~ S{ S{ h{ j{ h{ h{ h{ h{ ^] I~ I~ ^] X] @{ #{ u~ u~ @{ #{ #{ ", -"G] G] I~ ^] ^] /] O] R] R] O] O] %/ S{ i{ n{ j{ j{ h{ i{ n{ 8] A8 A8 5/ 8] 7] l{ O] O] H~ H+ I^ lh.b{ b{ N~ n] n] '! '! $~ l& &~ $~ Q~ H! C> C> n& &~ k& D# D# c> :. t8 fl./a._R e8.gl.hl.il.jl.kl.ll.vV ;U NH ml./a.f8./Z CP qM &L *L qM nl.ZV >U ol.pl.ql.rl.u=.u=.u=.a%.a%.a%.U#.[@.[@.[@.[@.U#.U#.U#.sl.Bh.~(.[@.}@.}@.}@.V` }@.}@.t..[g.t..V` }@.}g.r>.ak.ak.zh.tl.tl.5a.5a.W` W` W` W` W` T[.T[.W` W` W` 5a.W` U[.{(.s>.s>.2Z :(.2Z 1Z T[.ul.vl.Qb.ek.wl.3<.xl.yl.zl.Al.xX Bl.Cl.Dl.El.Fl.Gl.Hl.Il.Jl.Kl.Ll.Ml.Nl.Ol.Pl.Ql.Rl.Sl.Tl.Ul.Ve.Vl.Gk.Wl.Wl.Xl.Yl.Zl.`l. m..m.+m.@m.#m.((.$m.%m.&m.pj.*m.=m.-m.;m.>m.,m.'m.)m.!m.~m.{m.]m.^m./m.(m._m.:m. u! D# ~> }> }> }> ~> ~> j, }> D# 4 $~ $~ '! n] L= n] $~ ., S, ~~ I~ ^] h{ &/ O] R] R] ( R] O] i{ j{ i{ R] R] R] i{ S{ ^] S{ h{ i{ 7] Z] i{ h{ h{ S{ ^] I~ S{ P{ F~ ]] @{ u~ #{ u~ @{ ", -"I~ {] &{ I~ h{ R] R] O] O] O] R] '_ R{ :( :( n{ j{ i{ j{ n{ 8] Y] A8 5/ 9] 7] ym.&/ N{ 9; zm.+h b{ Q~ 1! 1! $~ $~ '! $~ &~ m& -! w> C> x> C> w> m& K~ |! w> D# i> y> k= jM $L Am.R@ Bm.Cm.Dm.Em.Fm.Gm.Hb.Hm.~@.=O k#._R CP &L qM k#./R /R ,%.Im.J Jm.Km.Lm.|<.u=.u=.u=.a%.a%.a%.U#.U#.[@.[@.[@.U#.U#.U#.}Z }Z U#.U#.[@.[@.[@.[@.[@.t..U` ak.sl.0k.Mm.U#.s..s..s..ak.ak.ak.U` c^.}@.6a.6a.6a.u..W` W` v..6g.Nm.x).5a.T[.v..Hh.Om.Pm.:~.1Z vX W` Qm.Rm.Sm.Tm.Um.q8.ck.Vm.Wm.Xm.Ym.Zm.uS `m. n..n.+n.@n.#n.$n.%n.&n.*n.=n.-n.;n.>n.,n.'n.)n.!n.~n.{n.]n.^n./n.(n.Se._n.:n. ~> j, j, }> }> j, }> j, ~> 4 Q~ Q~ z) y{ N~ N~ y{ y{ C) O~ y; .e &/ >_ s^ %/ '_ ,_ */ 3/ '_ '_ '_ '_ :( s^ s^ n{ j{ S{ S{ S{ i{ 7] 9] n{ s^ e^ O{ X] :] N{ /] O] /] 8{ U{ U{ U{ 8{ ", -"S{ G] {] G] h{ /] O] O] O] R] ( O] R] '_ s^ n{ h{ h{ n{ Z] 8] 8] Y] Y] 5/ n{ S{ h{ 94 p' w{ B) N~ $~ &~ &~ &~ &~ &~ n& k& -! C> x) x) C> u! u! ;] ;] H! |! D# ~> x) t4 +j. o..o.f( +o.@o.#o.$o.lB U+.qM CP (R &L qM f8.qM k#.qM (R *L T9.%o.XN :& ]g.f8.&o.8k.a%.a%.a%.a%.a%.a%.~(.U#.[@.[@.[@.U#.[@.U#.[@.[g.U#.U#.[@.[@.[@.[@.[@.[@.[g.ak.sl.*o.rl.rl.rl.rl.rl.rl.=o.=o.[d.-o.;o.>o.>o.U` c^.V` V` |g.bk.-j.,o.u..}@.'o.)o.!o.v..W` 5a.vX Um.~o.{o.]o.^o./o.(o._o.:o.m.Ao.Bo.Co.Do.Eo.Fo.Go.Ho.Io.Jo.Ko.Lo.Mo.No.Oo.Po.Qo.Ro.So.To.Uo. /.Vo.3p Wo.Xo.Yo.Zo.`o. p..p.+p.@p.#p.$p.%p.&p.*p.%=.=p.-p.;p.>p.,p.'p.)p.!p.~p.{p.]p.^p./p.%L =O e8.xe.]d.]d.~g.se.@L Ab.dM dM kB n#.dw |3 rl I9.@L d8.^a.^a.]d.f$ K# & j, [* j, j, [* j, j, j, ~> j, j& Q~ @~ [{ B) b{ b{ b{ [{ B) B) L= '! ae O] R] R{ h{ i{ i{ n{ 7] */ O] R] k{ :^ j{ i{ n{ n{ h{ S{ S{ i{ Z] 9] Z] k{ R] O] O] /] O] ]] /] O] O{ &{ {] {] G] ", -"^] &{ H] I~ d^ /] O] R] R] R] R] R] ( ( :( Z] i{ i{ n{ Z] 8] 7] 9] 9] 8] n{ z] #j.p{ 4! [{ @~ y{ $~ &~ &~ l& n& k& ~> ~> k& C> x> x> x> C> u! s! ;] K~ n& D# =! x) s% }..K. '%.(p._p.:p.m.Rp.Sp.Xn.Tp.Up.Vp.Wp.[p.Xp.Yp.F8.Zp.`p. q.u8..q.+q.@q.#q.$q.%q.&q.*q.3p =q.-q.;q.>q.,q.'q.)q.!q.~q.{q.]q.^q./q.(q._q.:q. }> }> {+ $~ z) b{ [{ [{ [{ [{ [{ 2! [{ n] n] O~ l~ O] N{ S{ h{ n{ n{ 7] :( O] ( ,_ m{ Z] n{ n{ n{ i{ i{ i{ j{ n{ 8] n{ ,_ ( ( R] O] O] F~ ]] O] R{ S{ G] G] G] ", -"G] H] {] I~ S{ Q{ /] Q{ R{ e^ '_ ( R] ( :( aq.bq.s^ n{ Z] 9] 8] i4 cq.dq.k{ eq.fq.L~ <{ y{ Q~ 1! l& n& 4 n& D# }> }> D# |! s! u! C> ;> C> w> w> s! m& -! ;> .> =! a^ gq.hq.Vz iq.jq.kq.Yi.!O v5.lq.!O /Z /R CP (R O` T9./R (R mq.DS OH X_ t).=n pM !O nq.oq.q>.q>.q>.a%.a%.a%.a%.~(.=*.=*.=*.2<.U#.U#.U#.~(.=*.=*.2<.[@.[@.[@.[@.[@.2<.pq.s..=*.1<.r.,r.'r.)r.!r.~r.{r.]r.^r./r.(r._r.:r. j& l& $~ 1! N~ C) D) C) N~ A) A) A) n] n] M^ G! ${ L{ E~ P{ :( Z] n{ s^ %/ s^ ,_ '_ ,_ :( */ :( a] m{ j{ Z] s^ */ k{ '_ ( ( /] /] R] /] /] /] P{ :] <^ 5{ ^] ", -"G] {] {] &{ ^] e^ R] R] h{ h{ j{ ,: R] ( KC Or.Or.%/ n{ 7] 9] 9] 8] S5 :( Pr.fq.[{ 2! A) n] &~ l& n& D# ~> ~> }> }> ~> k& |! s! s! w> j& j& |! ;] ;] ;] u! x) x) ~> $& 23 Qr.,@ Rr.Sr.Tr.'%.Ur./R &L CP &L /R T9.(R K5.]@.T9.(R N[.Vr.T) $$ .q>.q>.rl.rl.1<.1<.1<.<@.<@.<@.=*.2<.[@.2<.=*.<@.=*.2<.[@.[@.[@.[@.[@.<@.<@.<@.<@.<@.`r. s.O1.1<.1<.<@.<@.<@.<@.<@.2<.[@.[@.U#.U#.[@.[@.[@.[@. r.Bh.U#.=*.<@.O1...s.+s.@s.#s.$s.%s.&s.*s.=s.YY -s.;s.>s.,s.;s.'s.)s.!s.~s.{s.]s.^s./s.(s._s.:s.Tb. l& n] $~ '! n] H, 8, s; s; H, n] L= L= L= +& N@ *t.@1 L{ O] ,_ n{ n{ i{ i{ j{ m{ ( ( O] R] ( ,: s^ j{ n{ ~7 ~7 ,: R] R] /] ]] ]] R] O] /] O] /] /] F~ Q] I~ ", -"I~ &{ H] &{ D~ R] R] R] h{ S{ 6] '_ O] R] =t.-t.-t.s^ j{ 8] 8] 7] Z] n{ #/ F> C) [{ b{ $~ '! n& j& D# }> }> j, j, }> ~> {+ n& X! s! ;> j& j& `~ !) H! H! H! x> 9^ 9^ w> -, $$ s& ;t.T9.>t.mq./R qM CP *L &L CP DS O` (R k8.k8.k8.,t./~ 't.)t.E- vV !t.Wz ~t.{t.1<.1<.1<.rl.rl.1<.1<.1<.<@.<@.<@.=*.2<.[@.2<.=*.<@.=*.2<.[@.[@.[@.[@.[g.]t.O1.<@.<@.<@.<@.<@.u=.1<.<@.<@.<@.<@.<@.=*.2<.[@.[@.[g.[g.[@.U#.[@.U#.Gh.Bh.-o.rq.<@.<@.tq.-o.-o.ak.tq.tq.2<.U#.U#.U#.[d.^t./t.(t._t.:t.u.Ab.9a }$ ,u.'u.4k.)u.P^ L) L) M; [* [* }> ~> ~> }> D# &~ n] n] L= n] H, s; 8, 8, '! $~ '! n] ;^ >^ 0l n5 #6 .{ ( ,_ :( j{ h{ i{ n{ j{ ( ( O] O] R] O] h{ j{ m{ k{ ,: ( R] O] ]] ]] /] R] ( R] ( O] /] /] d^ ^] ", -"S{ G] {] &{ ^] R{ R{ z] &/ S{ i{ ,_ '_ s^ s^ :( :( n{ j{ 7] ': */ s^ V( |l `6.,! N~ y{ $~ n& }> ~> D# }> ~> j, j, }> ~> k& -! {) s! C> j& w> |! ;] u! u! !u.y> ~> Y! )) z- p` 6J &L ~u.>t.FS {u.&L /R O` k8.T9./R CP *L m..]u.^u./u.'@ 98.(u.@, pP 'B _u.xz :u.1<.1<.1<.=*.=*.1<.1<.1<.<@.<@.<@.=*.=*.=*.=*.=*.<@.=*.=*.=*.=*.=*.=*.2<.O1.<@.<@.<@.1<.1<.1<.u=.1<.1<.<@.<@.<@.1<.1<.=*.=*.=*.2<.2<.~(.~(.s..~(.s..rq.Mm.v.,v.'v.)v.!v.bt.~v.{v.]v.^v./v.(v.]@ =! w> D# ~> ~> n& &~ P~ ;^ L= n] O~ O~ %~ '! '! n] n] L= P~ A) 4! L~ p' ~* f8 o{ ,_ :( z] j{ n{ j{ s^ s^ ,_ ,_ >_ Q{ h{ n{ n{ '_ R] O] O] /] O] O] %/ ,_ */ :( l{ e^ X] R{ %/ ^] ", -"^] G] &{ {] G] h{ h{ h{ h{ i{ h{ i{ n{ j{ h{ j{ j{ j{ 7] 7] l{ R] ]] |v.C& 8, H, '! n& D# ~> ~> D# j& D# ~> }> }> }> j, D# |! H! s! u! C> C> u! ;] x> ;> 1v.+= r& 2v.:. ^ Jr.3v.K*.O` T9.CP CP /R (R ]@.68./R qM /Z /R 4v.5v.6v.7v.$$ 8v.L@ 4- Fc z5.,@ >@ 9v.1<.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.1<.1<.1<.<@.<@.<@.<@.<@.sq.=o.a%.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.O1.w.,w.'w.)w.!w.~w.{w.]w.^w./w.(w._w.;7.:w./ 3w.4w.D% O> F, }> ~> .> x) x) =! ~> j& &~ &~ ;^ P~ L= n] '! '! '! '! n] L= n] L= ;^ n] B) w{ ~ B) $; f8 R] ( R] n{ Z] j{ n{ n{ Z] R5 C#.t^ j{ Z] n{ e^ O] O] O] O] R] s^ Z] Z] 7] 7] Z] n{ j{ j{ j{ S{ ", -"^] G] &{ &{ &{ S{ S{ S{ h{ I~ I~ ^] h{ i{ h{ i{ i{ j{ n{ 7] k{ ( F~ f) 8, !- `! n& D# ~> ~> j& k& j& j& D# }> }> j, j, }> w> x> s! C> u! u! u! u! x) K> 5w.H[ ^{ >t :. 6w.7w.O` jo.8w.T9./R (R CP /R (R k8.(R /Z k#.*L 9w.0w.aw.bw.cw.dw.h; #- 9~ xz >@ >@ ew.<@.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.=*.sq.rl.x.,x.'x.)x.!x.~x.{x.]x.^x./x.(x._x.:x.(w. [* [* .> 9^ Ic .> ~> {+ $~ $~ n] L= n] n] n] n] n] n] n] n] n] L= L= L= 4! ~ .~ B) O- ~] (] ( l{ Z] 7] Z] Z] Z] S5 R5 R5 R5 n{ Z] 7] ,_ O] R] O] R] R] m{ 8] 7] 8] 7] Z] Z] Z] n{ i{ S{ ", -"h{ ^] G] &{ ^] S{ ^] h{ &/ O{ O{ h{ h{ j{ n{ i{ h{ %/ :( :( (] a) 3{ %, Z! >t n& k& j& D# j& j& j& j& D# ~> }> j, j, j, j, }> =! C> C> ax.|! c. bx.!~ cx.dx.RV X, >t g, 2a.ex.fx.gx.*L DS &L qM qM *L /R /R (R hx.Ur.ix.jx.kx.lx.mx.nx.ox.6w.9; z5.'@ ,@ >@ Ws px.=*.=*.=*.=*.=*.=*.=*.=*.=*.<@.<@.<@.<@.1<.1<.1<.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.1<.a%.qx.rx.y.,y.'y.)y.!y.~y.@/.{y.]y.^y./y.(y._y.:y. j, i> x) x) w> D# {+ &~ '! n] n] n] '! n] n] n] n] n] n] n] <{ A) P~ 2! <{ M~ B) ({ 1- +{ R] e^ n{ Z] 7] 9] 9] 8] 8] i4 S5 j{ n{ 8] */ %/ R{ N{ O] ( :( 7] Z] 7] Z] Z] Z] [3 */ s^ s^ ", -"h{ h{ ^] G] ^] h{ S{ S{ O] R] O] %/ i{ Z] 7] j{ i{ '_ ( R] py.W: qy.=< s! X! `~ k& {+ k& j& j& j& D# ~> ~> }> }> j, j, }> }> }> j& ,~ ry.|! z- E) sy.ty.uy.vy.wy.*+ `K (R T9.]@.T9./R CP /Z M9._R CP CP *L /R }a.xy.yy.zy.Ay.By.Cy.)B Dy.M) <3 >@ ,@ ,@ >@ pu Ey.U#.=*.2<.2<.2<.2<.2<.2<.=*.<@.<@.<@.<@.1<.1<.1<.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.1<.);.oq.Fy.Gy.a%./'./'.a%.a%.a%.a%.a%.a%.a%.a%.a%.=*.=*.a%.a%.a%.a%.1<.1<.1<.1<.1<.1<.1<.sx.sx.rl.8k.P5.P5.rl.Hy.Iy.Jy.Ky.Ly.My.Ny.Oy.Py.Qy.Ry.Sy.Ty.Uy.Vy.Wy.Xy.Yy.Zy.`y. z..z.+z.@z.#z.$z.%z.&z.*z.=z.6s.-z.;z.8s.{p.>z.hu.,z.,z.%s.Bv.Dv.Ow.Ev.Fv.Hv.gs.rt.'z.)z.9d.!z.~z.{z.Yb.]z.^z./z.y>.(z._z.:z. x) 9^ E) n& n& n& '! ;^ n] L= '! '! '! '! '! n] n] L= 2! [{ M~ +< L= M~ 2! 2! <{ p= uz.e^ i{ n{ 7] 9] 9] 7] 8] 5/ 7] i{ j{ Z] Z] i{ j{ '_ O] R] m{ Z] j{ n{ Z] 8] C9.~7 ( ( ( ", -"S{ S{ ^] G] G] S{ S{ S{ ( O] Q{ h{ n{ Z] Z] Z] n{ k{ ,: ( Y9 [' ^, ;] X! @~ 4 n& n& j& k& k& j& D# ~> ~> ~> ~> }> j, }> ~> ~> j& '$ j& s! vz.wz.xz.yz.zz.Az.o' Bz.Cz.jo./R DS /R &L &L k#.e8.e8.CP &L CP CP O` Dz.Ez.Fz.Gz.Hz.Iz.Jz.*3.f! a~ ,@ ,@ >@ >@ Kz.Lz.[@.=*.[@.[@.[@.[@.[@.2<.=*.<@.<@.<@.<@.1<.<@.sq.1<.1<.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.<@.1<.u=.Aw.Mz.Aw.a%./'./'.a%.a%.a%.a%.a%.a%.a%.a%.a%.rl.rl.a%.a%.a%.a%.a%.1<.1<.1<.1<.1<.1<.sx.sx.sq.8k.P5.Nz.Nz.Nz.Oz.Pz.Xy.Px.Qz.s..Rz.Sz.3s.Tz.]D Uz.Vz.Wz.Xz.Yz.Zz.`z. A..A.+A.@A.#A.$A.%A.&A.*A.=A.-A.;A.-z.;z.8s.>A.>z.hu.,A.,z.%s.Bv.Dv.+y.Ev.Fv.'A.Iv.hs.)A.cd.!A.~A.{A.]A.da.Uw.^A./A.(A._A.:A.%.[A.}A.|A.1A.2z.2A.3A.4A.5A.6A.7A.8A.9A.0A.aA.bA.cA.dA.eA.fA.gA.hA.iA.jA.kA.lA.2g.mA.DE G5 ,3 W} nA.r4 qy.oA.pA.<3 ;U T9.*L CP f8.U+._R /Z (R CP CP /Z k#.,%.f( qA.R' rA.sA.tA.uA.W_ ,] 9^ H_ ;> {+ n& 4 $~ ;^ n] L= $~ $~ &~ &~ '! n] L= L= [{ [{ +~ n5 ;^ M~ B) 2! w{ A) ~* N{ i{ i{ Z] 8] 8] 7] 5/ #D 5/ Z] Z] n{ Z] j{ Z] k{ ( R] s^ n{ n{ j{ n{ n{ k{ ( R] R] ( ", -"h{ S{ ^] I~ I~ ^] S{ S{ '_ &/ N{ &/ s^ :( :( */ :( ,_ R_ vA.F] j& w> |! !) y{ l& n& {+ j& k& k& k& k& j& D# D# D# D# ~> ~> ~> :) '~ 0! 0! wA.xA.yA.zA.AA.BA.CA.)3 DA.m..EA.&L &L &L &L (R _R M9.e8./Z CP qM *L rb.FA.GA.HA.IA.JA.KA.LA.MA.|^ >@ r# ,@ 0+ a+ /< NA.2<.=*.[@.[@.[@.[@.[@.2<.=*.=*.=*.<@.=*.rq.OA.PA.sq.=*.1<.sx.sx.<@.<@.<@.<@.<@.<@.<@.<@.1<.1<.1<.a%.a%.a%.u=.=o.QA.=o.u=./'./'.u=.u=.u=.u=.u=.u=.u=.u=.u=.u=.u=.u=.**.**.**.u=.u=.u=.**.T#.**.0%.1<.sx.$j.RA.Nz.T#.p>.p>.SA.TA.UA.VA.WA.XA.Jb.Sz.YA.)O ZA.`A. B..B.+B.@B.#B.$B.%B.&B.*B.=B.-B.;B.>B.Ls ,B.'B.)B.!B.~B.pu.{B.>A.]B.zv.hu.,z.%s.Cv.^B./B.Ow.(B.'A.Iv._B.:B.%7._ ", -"^] ^] I~ I~ I~ I~ I~ S{ h{ h{ ^] Q{ R] ( ( ,: ( '_ (] C& c> ~> j& 4 4 '! &~ n& {+ n& n& {+ {+ k& j& k& k& {+ j& D# D# *@ '$ a! h> LB.MB.NB.OB.PB.QB.RB.SB.TB.UB.k8.O` (R qM &L T9.(R qM f8.f8.e8.k#.(R VB.WB.XB.YB.ZB.`B. C..C.+C.@C.t5 ,@ r# '@ x w K, #C.rq.2<.[@.[@.[@.t..t..[@.U#.U#.Mm.OA.2s.$C.%C.&C.*C.$s.qq.T#.sx.<@.<@.<@.<@.1<.1<.1<.1<.1<.u=.u=.u=.a%./'./'.a%.rl.u=.u=./'./'.u=.u=.u=.u=.u=.u=.u=.u=.u=.u=.u=.t=.t=.t=.t=.**.**.**.t=.S[.t=.**.u=.Nz.$j.RA.$j.P5.P5.P5.=C.-C.;C.>C.,C.'C.)C.!C.Y) ~C.{C.]C.^C.s5./C.1m.(C._C.:C. H~ s^ Z] 8] 9] 5/ Y] 5/ 5/ 7] j{ 7] Z] */ ~7 ~7 ,: R] O] R] ( ( R] R{ h{ I~ I~ i{ ", -"^] G] G] G] G] &{ G] S{ S{ h{ S{ O] R] R] R] O] R] R] !a E$ '! ~> D# k& n& $~ 4 n& {+ n& n& n& {+ j& j& {+ {+ n& {+ D# D# x> +, g@ &D.*D.=D.-D.;D.>D.,D.'D.)D.78.(R (R K5.*L k#.e8.*L /R k#._R e8./Z qM ]@.d4.!D.~D.{D.]D.^D.#C /D.(D.~t &y r# r# r# w ( %$ _D.ww.tq.[g.[g.t..}@.}@.t..U#.U#. r.:D.z.hu.,z.,z.%s.sD.^B./B.bC.cC.tD.uD.vD.wD.xD.K4.yD.zD.AD.BD.CD.DD.ED.FD.GD.HD.ID.JD.KD.LD.MD.ND.OD.PD.QD.RD.SD.TD.UD.VD.WD.XD.YD.ZD.`D.%w E..E.+E.@E.#E.$E.0c.%E.{a.7' p! &E.z5.*E.=E.-E.;E.>E.`p.,E.4^ 'E.yy.O` O` O` T9.*L CP T9.T9./R &L &L O` (R )E.!E.~E.{E.]E.^E./E.(E._E.oA.>t z- {+ k& {+ {+ {+ {+ n& l& &~ '! n] n] n] n] n] L= P~ +~ 2! w{ w{ w{ 4! 4! V> :E.0] j{ 7] 9] Y] 5/ 9] 8] Z] n{ 8] 7] n{ l{ ~7 R] /] O] ( ( ( /] E~ I~ G] &{ ^] ", -"G] G] &{ G] &{ &{ ^] S{ ^] S{ O{ O] R] O] X] P{ R] .e ~$ e. 3~ '! k& ~> j& n& n& n& {+ k& -! l& n& j& k& {+ j& n& 4 k& j& E) :. F.,F.'F.)F.!F.~F.{F.]F.^F./F.(F._F.:F. ~> j& w> H! z) -! k& k& k& k& k& n& n& {+ n& u, BF.CF.DF.EF.FF.GF.HF.IF.JF.KF.LF.}a.T9.&L CP f8.k#.qM *L /R (R ]@.]@.MF.NF.OF.PF.QF.RF.SF.TF.UF.VF.WF.XF.Ig r# 9. 9% 9% 9% 9% YF.ZF.`F.)o.)o. G.U` [g.[@.U#.U#..G.+G.@G.#G.$G.%G.&G.ko *G.PA.1<.<@.<@.<@.<@.1<.a%.a%./'./'.rl.a%./'.a%.u=.u=.u=.u=.u=.u=.u=.t=.t=.t=.t=.t=.t=.t=.t=.t=.t=.t=.t=.t=.S[.S[.rE.rE.rE.rE.rE.S[.t=.t=.t=.w).S[.w).=G.w4 -G.;G.>G.,G.'G.)G.!G.~G.{G.]G.^G./G.(G._G.:G.H.,H.'H.)H.!H.~H.{H.]H.^H.Lg >@ Ym '$ j& k& k& {+ 4 l& &~ $~ n] n] n] L= n] n] ;^ @~ [{ ~ 4! b{ @~ &~ &~ 6w.zb ,: ~7 Z] 9] 8] 7] 7] Z] 7] Z] j{ ,_ R] O] h{ S{ h{ S{ G] G] G] &{ I~ Q] @{ ", -"G] S{ ^] &{ G] &{ &{ I~ I~ ^] G] F~ /] /] O{ /] =7 z- j& ~> ~> &~ '! '! 4 j& ~> }> j, =! ;] ;] E) {+ {+ k& k& k& j& &~ '! ~) U) /H.(H._H.:H. iH.jH.kH.lH.mH.nH.oH.pH.qH.rH.sH.tH.uH.vH.wH.xH.yH.zH.AH.BH.CH.DH.EH.FH.GH.HH.HH.IH.JH.KH.LH.MH.NH.OH.PH.QH.r5.RH.SH.TH.UH.1~ VH.WH.WH.XH.*G.YH.l/ ZH.`H.`Q I..I.+I.@I.#I.$I.%I.&I.*I.=I.-I.;I.>I.,I.'I.)I.!I.~I.{I.]I.^I./I.(I._I.:I.y 7I.8I.9I.0I.:G :G n>.aI.^|.bI.cI.dI.eI.fI.gI.hI.iI.jI.kI.lI.*L /R /R *L O` K5.'a.]@.(R 'a.J5.mI.nI.D' oI.pI.qI.rI.sI.tI.uI.vI.wI.*3.}, D# j& j& {+ l& &~ $~ $~ '! '! n] L= n] '! Q~ 1! b{ [{ @~ z) X! n& 4 I= u~ ( ,_ j{ Z] Z] Z] n{ n{ Z] n{ i{ '_ R] R{ O{ S{ S{ ^] G] &{ G] G] S{ N{ ]] ", -"G] I~ G] I~ G] G] I~ G] &{ I~ Q] f^ O] R{ L{ /_ s% '$ ~> D# D# ~> &~ n] n] &~ {+ j& =! .> =! .> ;> k& k& {+ 4 n& k& 4 4 `~ ;! xI.yI.zI.AI.BI.&'.CI.DI.R. FS EI.FI._R qM _R (R k8.DS K5.qM O` T9.k8.J5.GI.H* fb HI.II.JI.KI.LI.MI.NI.Q) }$ r# 9. 9% 9% 9% ;+ $& f4.&j.|@.)o. G.U` U` [@.[@.[@.U` OI.PI.QI.NH RI.SI.pP TI.1<.1<.<@.<@.<@.<@.1<.a%.a%.a%.a%.a%.a%.u=.u=.u=.u=.u=.**.**.0%.0%.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.rE.rE.rE.rE.rE.rE.w).w).w).rE.UI.:. VI.WI.XI.YI.ZI.`I. J..J.+J.@J.#J.$J.%J.&J.*J.=J.-J.;J.>J.,J.'J.)J.!J.~J.{J.]J.^J./J.(J._J.:J..PJ.QJ.RJ.SJ.TJ.UJ.VJ.w9 WJ.XJ.YJ.VB.]@./R *L *L O` k8.(R k#.CP k8.c4.3H.ZJ.&g.`J. K..K.+K.@K._5.#K.$K.%K.&K.pA.D# D# j& {+ &~ &~ &~ l& 4 1! n] '! '! $~ l& !) 1! b{ K~ H! `~ `~ 4 I= 9~ %{ ,_ d^ h{ n{ n{ i{ j{ Z] :( 6] R{ O] Q{ ^] S{ S{ O{ O{ G] S{ S{ h{ '_ R] ", -"G] I~ G] I~ &{ ^] S{ <^ 9{ ]] ]] :] h{ m{ *K.{+ D# k& D# k& {+ {+ n& $~ '! '! !) E) s! ;> ~> D# ~> ~> D# {+ 4 k& {+ H! ;] |! ;] =K.-K.;K.>K.,K.'K.)K.!K.=g.T9.(R CP &L *L ]@.T9.O` T9.(R CP (R T9.K5.~K.{K.O} b) ]K.^K./K.(K._K.:K.J.BK.CK.DK.EK.FK.GK.HK.IK.JK.KK.LK.MK.NK.OK.PK.QK.RK.SK.TK.UK.VK.WK.XK.YK.ZK.`K. L..L.+L.@L.#L.$L.%L.&L.*L.=L.-L.;L.>L.,L.'L.)L.!L.~L.{L.]L.^L./L.(L._L.:L. }> ~> j& k& j& k& }> n& $~ &~ !) {) s! D# j& D# j& k& D# ~> ~> ~> w> ;] {) o' t! u) oL.pL.qL.rL.sL.tL.*g.cp.O` *L qM /R ]@.]@.*L qM (R /R T9.(R ]@.d4.u8.gq.%, T) uL.vL.wL.xL.yL.zL.W> g> _ 9% 9% 9% 9% 9% 03 ;+ I$ 8C.T[.T[.6a.6a.tl.6a.6a.V` }@.[@.1<.AL.$s.Fy.BL.CL.=s.P5.1<.<@.<@.<@.<@.1<.a%.a%.a%.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.S[.&*.5K.5K.5K.DL.DL.DL.5K.EL.FL.GL.HL.IL.JL.JL.KL.LL.ML.NL.OL.PL.QL.RL.SL.TL.UL.j0.VL.{G.j0.qK.WL.XL.YL.ZL.`L. M..M.e=.+M.@M.wK.#M.$M.%M.&M.*M.2b =M.-M.;M.>M.,M.'M.)M./|.!M.~M.{M.]M.uK.^M./M.(M._M.:M.@ >@ a+ vM.wM.xM.yM.zM.AM.BM.CM.DM.EM.FM.GM.*a.K5.(R /R O` DS DS 'a.T9.CP CP /Z /R /R ]@.&L HM.IM.JM.KM.LM.MM.NM.OM.PM.j& D# k& {+ k& j& k& k& |! ;] {) Q~ n& j& j& j& D# n& n& 4 n& n& 4 j& D# f/ /<.N{ O] O] i{ h{ h{ N{ ( ( i{ S{ h{ ^] S{ h{ '_ R] R] s^ n{ n{ '_ R] ", -"^] I~ I~ G] G] I~ ^] I~ 4{ u~ #{ <^ D~ g! z- }> }> }> D# ~> }> ~> j, j, n& n& -! {) X! n& k& k& k& n& k& ~> }> }> =! ;> s! ^, t! vo QM.RM.SM.TM.UM.VM.=g./R (R O` DS DS ]@.CP &L CP /R T9.*L T9.(R WM.XM.;& 2v.@] @1 YM.ZM.`M. N.K/ Cr y` K/ 9% 9% 9% D D D )$ .& .N.Um.U[.b%.6a.6a.6a.6a.6a.}@.t..2<.=*.He.N.,N.'N.)N.!N.~N.{G.{N.{N.]N.^N.YL./N.(N.(N._N.:N.J.6N.7N.8N.9N.0N.aN.[J.bN.cN.dN.eN.fN.gN.hN.lD.iN.jN.kN.rw.lN.mN.nN.oN.pN.qN.rN.sN.tN.uN.JR vN.wN.xN.yN.zN.AN.BN.CN.DN.EN.FN.GN.HN.IN.JN.KN.LN.MN.4y.NN.ON.PN.QN.RN.SN.TN.UN.r# 9. r# ,@ >@ 0+ n=.VN.NK WN.XN.YN.ZN.`N. O..O.+O.@O.yy.c4.DS *L (R *L O` ]@.]@.O` /Z qM k#.&L T9.K. #O.M] Yn.$O.%O.&O.*O.=O.-O.n& n& n& ~> =! =! D# D# E) u! w> E) k& D# ~> j& k& {+ n& n& {+ n& $~ l& ;O.u! 2v.DH O] Q{ z] S{ S{ N{ e^ e^ S{ S{ i{ S{ S{ S{ N{ P{ R{ s^ :( 6] R{ e^ ", -"G] G] ^] S{ ^] ^] &{ &{ u~ 1~ u~ {~ k~ ;- D# j, j, }> }> ~> }> }> [* L) D# n& u, h; _. &, n& 4 {+ $~ n& w> s! x) .> ~> }> .; D# =+ / >O.,O.'O.)O.%7./R 7E.(R /R T9.]@.O` *L &L (R qM /R /R T9.O` 'a.!O.t) ~O.'{ q` ]y {O.]O.n>.#$ r# r# r# 9. 9. 9% D D -+ ;+ 6. ^O.Ke./O.(O.W` 5a.x).6a.6a.c^.}@.yh.}@.t..2<.=*.=*.1<.1<.1<.<@.<@.<@.<@.1<.a%.a%.a%.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.sE.sE.sE.&*.N1.w).&*.5K.5K.DL.DL.DL.DL.DL.DL.DL.@N._O.u! :O.O.4O.5O.6O.7O.8O.9O.0O.ab aO.bO.cO.dO.eO.eO.eO.fO.gO.hO.iO.jO.kO.lO.mO.nO.oO.pO.qO.rO.sO.pk.tO.uO.sO.;J.vO.vO.-6.wO.xO.yO.zO.AO.BO.CO.DO.EO.FO.GO.HO.IO.JO.KO.LO.MO.NO.OO.5M.PO.QO.RO.SO.TO.UO.VO.WO.XO.YO.ZO.`O. P..P.+P.@P.#P.$P.%P.&P.ZD.*P.=P.-P.;P.>P.,P.'P.<$ r# r# r# ,@ >@ 0+ ,@ s% _u.8~ )P.!P.~P.{P.]P.^P./P.(P.WM.'a.DS O` CP &L (R DS DS CP qM k#.k#./Z /Z _P.:P.!= W_ x) =! ~> }> ~> ~> }> j, j, }> }> k& n& n& l& n& n& 4 &~ 1! !) s! u! =* .{ O{ ^] S{ I~ ^] S{ ^] ^] h{ i{ R{ R{ O] O{ ^] S{ e^ R] O] N{ %/ ", -"G] I~ S{ S{ I~ ^] G] {] u~ u~ u~ u~ a~ j& D# }> j, }> j, j& D# }> j, [* [* k& c. {+ j& k& k& j& j& k& D# 4 {) u! ;> }> ~> D# +, k* aB 3P.4P.5P.6P.0#.(d.(R O` *L /R O` T9.k#._R _R qM &L T9.(R 68.kI.-q ^ h/ 7P.~O./<.8P.i' +7 / r# ,@ r# 9. 9. 9% 9% D -+ ;+ ;+ =7 %G.Lp.Jh.T[.W` x).tl.tl.6a.6a.V` }@.t..2<.=*.<@.<@.<@.<@.<@.<@.<@.<@.1<.a%.a%.a%.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.sE.sE.sE.&*.&*.5K.5K.5K.5K.DL.DL.DL.DL.DL.5K.DL.9P.0P.aP.bP.:O.Q.,Q.'Q.)Q.!Q.~Q.{Q.]Q.^Q./Q.tX (Q.! 9. 9. r# ,@ >@ >@ ,@ ,@ [ X, Ac _Q.:Q. ;> 9^ Ic =! D# ~> }> j, }> }> }> D# k& k& l& &~ l& k& 4 [{ [{ @~ z) s! s! #~ i~ U_ I~ ^] ^] &{ I~ G] I~ S{ S{ Q{ R] O] &/ S{ S{ R{ O] O] &/ h{ ", -"I~ G] G] G] I~ I~ 6{ U! u~ #{ }3 r) t) u, j& D# ~> j& j& ~> }> [* ~> ~> j, D# j& I) I) :) j& j& c> D# D# |! {) ;] w> ~> }> D# l& 0Q.aQ.bQ.cQ.dQ.eQ.k..CP CP (R k#./Z &L qM _R fQ.U+.k#.qM (R n..NF.k8.`= w! gQ.hQ.iQ.jQ.^! 9. &$ R$ r# r# 9. 9. 9% 9% 9% 9% -+ ;+ -+ >t wb kQ.lQ.mQ.W` W` 6a.6a.6a.6a.6a.}@.t..2<.=*.<@.<@.<@.<@.<@.<@.<@.<@.1<.a%.a%.a%.a%.a%.u=.u=.**.**.**.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.&*.&*.5K.nQ.oQ.nQ.nQ.5K.5K.6K.5K.5K.nQ.DL.nQ.pQ.qQ.O> rQ.:O.sQ.tQ.uQ.vQ.|i wQ.xQ.yQ.zQ.zQ.AQ.BQ.CQ.DQ.EQ.Pn.FQ.GQ.HQ.IQ.JQ.rP.sP.KQ.LQ.MQ.NQ.OQ.PQ.QQ.RQ.SQ.TQ.UQ.6N.nj.VQ.WQ.CP.uO.tO.EP.B{.XQ.YQ.ZQ.UL.+J.`Q.-~. R..R.+R.,i @R.#R.$R.%R.&R.*R.=R.-R._[.;R.>R.,R.'R.)R.!R.~R.jA.{R.]R.^R./R.(R._R.:R.@ ,@ ,@ s] a^ )] bR.u$ cR.dR.eR.fR.gR.hR.iR.jR.kR.68.]@.CP /R k#.CP CP /R CP CP O` D.'a.X6.ou ~a lR.mR.nR.oR.pR.j, :) =! x) x) ;> D# D# D# j& ~> ~> ~> D# n& l& 4 4 4 {+ !) /a T[ (a [{ {) u! d~ 0r qR.6{ I~ db &{ I~ ^] G] ^] S{ N{ R] '_ %/ S{ ^] O{ O] O] z] h{ ", -"I~ &{ u~ #{ @{ %{ u~ u~ rR.[x.~d.c. j& D# D# j& D# k& D# ~> j, [* }> D# ~> D# D# {+ {+ j& {+ n& .; J} Y! n' n& n& $~ j& j, j, {+ ~a sR.tR.uR.vR.wR._R qM CP qM qM _R qM /R xR.'O ZV el.N` yR.0a.zR.vr += v! AR.BR.~{ s~ g> b+ b+ 9% 9. 9. 9. 9% 9% 9% 9. 9% 9% 9% 9% <$ s).CR.7:.[~.{(.W` W` 5a.b%.6a.6a.c^.[@.[@.[@.S.,S.'S.)S.!S.~S.{S.]S.^S./S.(S._S.:S.@ H+ @] LS.MS.NS.OS.PS.QS.RS.SS.TS.]@.DS ]@.CP qM e8.CP /R *L O` /R mq.*a.DS Gm.X_ '~.US.VS.WS.XS.YS.I) ^e s! u! C> C> C> |! n& j& {+ j& {+ '! r& T- ;- {+ &~ '! n] A) &~ {) {) H! J} Bu ZS.k~ K[.`S.u4 I~ S{ ^] ^] ^] E~ S{ h{ S{ I~ S{ ^] O{ h{ h{ h{ ", -"G] I~ %{ @{ F~ #{ u~ #{ T.m! x# n& k& j& D# j& ~> D# D# ~> j, [* }> ~> }> }> j, {+ {+ k& 4 n& n' ;: 5( c~ {+ k& n& j& j, [* D# <. .T.+T.@T.Sy.M9.k#.&L (R CP /R &L qM FS #T.DP $T.S+.nM %T.&T.u8.*T.=T.=< 98.,E.Vc wr m>.:G -T.V$ 9% 9. 9. 9% 9% 9% 9% 9% 9% 9. 9. 9% s; $n ;T.](.I_.{(.W` 5a.b%.6a.tl.c^.U` [g.pq.T.DR.DR.>T.HR.,T.'T.o, M@ mP )T.!T.~T.{T.1O.]T.^T./T.(T._T.:T.# $U.%U.&U.*U.=U.iR.-U.;U.]@.]@.]@.c4.T9.qM /R &L /R K5.DS k8.]@.O` >U.x{ $$ ,U.;R 'U.)U.B{ B{ Au u! ;] {) H! s! K~ l& {+ 4 l& &~ Z! !- _. ;- n& '! n] L= '! !) -! ;] ;] g/ d~ ;: V> *{ u4 &{ ^] ^] G] ^] I~ I~ G] I~ I~ &{ I~ G] ^] h{ h{ h{ ", -"{] Q] P] F~ F~ @{ #{ u~ 1~ <3 n& 4 {+ n& j& D# }> ~> }> }> }> }> D# D# }> }> [* j, D# D# k& j& ^, d~ >2 Y! ~> }> ~> *@ j, h& j& p` : !U.wg ~U.{U._R %g.*L *L CP k#.&L CP cp._R ]U.K&.#L k..X6.^U./U.(U._U.'t.M' :U.CS.Vr.@R V.P^ =+ y` w ( _ _ 9. r# r# r# 9. r# b+ r# H' |7 ,V.+= 'V.)V.!V.~V.{V.yy.'a.&L *L k8.(R /R qM qM qM *L DS DS K5.K5.]V.^V./V._l Ig Bu 4^ O9 A{ `g ;] K~ z) b{ X! C> {+ k& l& $~ &~ 4 *+ _. I= &~ '! L= A) L= n] X! ;] E) Y! ^{ ;: s; j~ 6{ &{ I~ Q] &{ G] G] &{ G] I~ G] {] I~ ^] h{ h{ h{ h{ ", -"u~ 8{ :] :] ^] G] %{ >: |- j& ~> D# j& k& j& ~> ~> ~> }> }> }> ~> j& n& }> ~> }> L) j, ~> ~> ~> E) K~ ;] |! ~> j, [* j, ^3 t8 (V.}$ L+ m, oP 9q.&O M` ^Z k#._R &L /Z *L k#._R _R HS #L $L OY _V.:V.W.,W.'W.)W.!W.~W.{W.]W.^W.Z4./W.#h.(W.r# v 9. 9. &$ _ _ &$ b+ r# 9. 9. w w w 0> A! T$ bB _W.:W. v{ '! L= ;^ a' .{ 7{ @{ {] &{ I~ G] G] G] G] &{ ^] &/ R] O] s^ i{ ", -"@{ ]] S{ ^] ^] G] #{ )n d% D# ~> ~> D# ~> }> j, j, }> ~> }> }> }> ~> {+ ~> D# ~> L) [* ~> ~> ~> E) X! x) |! D# }> }> K^ &n +j.9M a+ . Y+.]g.-u.N` $L oh.k#./a.M9._R CP k#.f8.M9.xe.ye.mM nM 1W.2W.3W.4W.5W.6W.7W.O` *L ]V.&O lM 8W.9J Uz [^ U} r# D D D 9% 9. 9% 9. b+ 9W.0W.aW.bW.cW.('.t>.1Z W` W` x).6a.tl.zh.>o.-o.[d.8k.8k.sq.<@.<@.<@.<@.1<.a%.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.&*.5K.5K.5K.5K.5K.nQ.dW.ZC ,2 eW.fW.gW.7V.hW.iW.jW.JH aV.kW.lW.^T.mW.nW.oW._T.pW.dU.qW.rW.sW.tW.uW.vW.^p.wW.xW.yW.zW.AW.BW.CW.jT.}S.pU.kT.DW.EW.FW.GW.HW.IW.kT.JW.KW.jT.CV.FV.i0.LW.MW.NW.9T.rV.|S.OW.PW.QW.RW.%M.SW.TW.UW.sT.VW.WW.XW.YW.ZW.`W. X..X.+X.@X.#X.$X.%X.&X.*X.=X.aF.-X.;X.>X.,X.'X.)X.!X.~X.{X.]X.^X./X.(X._X.:X. }> [* j, [* [* j, [* j, }> }> }> D# j& k& ~> [* L) j, }> }> x> u! =! |! k& 4 8X.gq.9X.0X.aX.a+ L+ (y bX.)O &O nM &O e8.f8.-O &L cX./Z /Z e8./Z >O #L ]Z dX.eX.fX.gX.hX.iX.~O *L &L jX.nM Ab.I/ 8G jP Tz yb j4 =e D 9. 9. r# 9% &$ b+ n' kX.lX.M_.W` 2Z L_.<~.W` W` u..6a.tl.zh.>o.>o.;o.mX.8k.sq.<@.<@.<@.<@.1<.a%.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.&*.5K.5K.5K.&*.5K.pQ.;# X; nX.oX.=1 pX.qX.rX.sX.bV.tX.bV.-7 uX.vX.wX.xX.yX.zX.AX.BX.Vx.CX.DX.EX.kV.vW.FX.4T.GX.HX.IX.JX.KX.KW.JW.LX.MX.MX.LX.dh.0o.oV.mV.NX.OX.KW.JW.PX.Y.,Y.'Y.)Y.!Y.,X.~Y.{Y.]Y.^Y./Y.(Y._Y.:Y. 3{ 7Y.8Y./R O` ]@.k8.(R CP /R (R k8.DS T9.T9.*L DS hq.,%.9Y.[ u$ ># ZY 4 {+ !) z) K~ {) @~ L~ #: P~ '! ;^ n] $~ n] L= P~ #6 L~ w{ ~ 0Y.+h b{ $~ n& k& k& '! N~ j8 9o (a 1{ Q_ P{ D~ G] G] ^] I~ &{ {] aY.db 7{ O] R{ N{ S{ ", -"E~ S{ h{ S{ ^] %{ T) U+ n& j& D# j& ~> j, j, j, j, j, j, j, t@ 93 $& '$ j& n& j& }> j, L) [* }> ;> u! += )~ v5 bY.9Y.!%.gl.cY.aX.}$ t) (W.0G dJ @L mM 7d.nM M` #L M` &O nM }q.U+.xe./Z dY.Q9.eY.fY.gY.hY.iY.jY.kY.k#.M9.ly.lY.`K =n LH Uz S_ yb /t Kr.9% 9% v w ( &$ 9. 9% S[ mY.nY.w..Ym.J_.oY.1Z y).1Z W` v..|@.zh.zh.>o.mX.8k.sq.sq.sq.sq.<@.1<.1<.a%.a%.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.&*.5K.5K.&*.&*.nQ.pY.88 7a qY.rY.sY.Lm tY.uY.-D vY.wY.xY.yY.zY.zY.AY.BY.BY.CY.DY.EY.xY.FY.CX.rW.GY.HY.IY.2j.2j.JY.HX.KY.LY.MY.NY.OY.UR.PY.QY.RY.SY.TY.UY.Vx.VY.WY.XY.YY.ZY.zQ.MX.`Y.bO. Z..Z.+Z.@Z.#Z.$Z.%Z.&Z.RW.*Z.=Z.-~.-Z.;Z.>Z.,Z.'Z.)Z.!Z.~Z.#R.{Z.]Z.K'.^Z./Z.(Z._Z.:Z. |- H! {) l& n& `~ b{ w{ h^ pZ.Q~ z{ '! &~ &~ P~ @6 :e @6 #6 #6 n. [& &@ n] l& {+ E) X! b{ b{ qZ.B) L] 6> zF.8{ @{ @{ :] S{ I~ aY.!~.I~ G] :] S{ S{ ^] ", -"G] ^] S{ S{ ^] m~ ,@ ~> 4 4 {+ j& j& ~> }> j, j, }> }> }> ^+ 93 93 '$ j& {+ {+ D# j, L) [* j, =! D# rZ.W5 MH ]D 3Q.;U gl.sZ.tZ._ %' ]D NH 0G lM nM N` @L uZ.{Z @L OY nM M9.U+./a.e8.&L vZ.wZ.xZ.yZ.zZ.ih.AZ.BZ.f8./a.nh.{t Cf =n LH Tz Af 8a CZ.DZ.D 9% &$ w ( { 9% D Q> EZ.FZ. }.wX !3.#m.s>.1Z _~.vX T[.v..tl.tl.zh.GZ.=o.8k.8k.8k.sq.<@.<@.1<.1<.1<.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.S[.S[.S[.S[.S[.S[.&*.5K.5K.5K.nQ.HZ.g- IZ.JZ.KZ.LZ.MZ.NZ.OZ.OZ.PZ.wY.QZ.RZ.CY.CY.CY.AY.BY.BY.CY.SZ.DY.wY.TZ.AB.UZ.VZ.GY.WZ.XZ.2j.2j.'v.YZ.[f [f ZZ.`Z.PY. `.(T.QY.QY..`.wY.QZ.+`.@`.fu #`.$`.%`.&`.*`.=`.-`.bT.]N.;`.>`.,`.'`.)`.BV.!`.`Q.~`.{`.]`.UW.YX.^`.9E ^`.YV./`.(`.)F._`.5M.:`.<`.[`.}`.|`.1`.2`.|Z.3`.4`.5`.6`.7`.8`.9`.0`.a`.b`.c`.bZ.d`.e`.f`.fX 7. 8% 5. 5. 9% D 9. y! w8 Iu W9.jS g`.)u.:s.'E.h`.hZ.:U.i`.tZ.'t.h@ h/ j`.k`.T9.*L qM k#./R (R DS ]@.O` *L &L CP *L CP (R CP (R l`.m`.n`.Hc iS 8X.$~ 4 l& m& @~ [{ 2! *: Z| >{ l& l& '! :e ,^ ,^ ,^ :e @6 }/ o`.+< ;^ '! l& s! s! K~ b{ b{ B) 4! fq.;/ *{ #{ #{ <^ S{ ^] G] !~.!~.!~.G] I~ S{ ^] ", -"G] &{ G] I~ D~ g~ 9. ~> 4 n& D# }> ~> ~> }> j, [* j, V+ 5 n% 2~ 93 *@ ~> j& *@ e& )$ j, j, j, G$ <& jB 0G L` cJ _X ;U :s.p`.ko 9. q`.]D )u.jM r`.$L M` mM {Z {Z @L #L :v.M9.U+.e8._R /Z CP s`.t`.u`.[..Lr.nM xe./a./a.Xn.9G rl rl dw LH nl |3 S^ ;# D -+ V$ ( { V$ 9% D E c( v`.w`.Z` M_.dg.:(.x`.<~.vX xX v..6a.6a.c^.s..GZ.mX.mX.8k.sq.<@.<@.<@.<@.<@.1<.u=.u=.u=.u=.u=.**.t=.t=.t=.t=.S[.S[.t=.w).w).5K.5K.5K.5K.y`.z`.s).U/ A`.B`.C`.D`.E`.DY.DY.uY.F`.G`.G`.AY.CY.CY.AY.BY.BY.AY.CY.CY.TZ.TZ.H`.I`.UZ.GY.J`.WZ.IY.K`.L`.M`.N`.Fx.O`.O`.P`.Q`.R`.P`.PY.S`.fV.DX.T`.U`.fu V`.W`.X`.Y`.Z`.mP.``. +. +. ++ + +, +' +) +! +~ +{ +] +^ +/ +( +_ +: +< +[ +} +| +1 +2 +3 +4 +5 +6 +A&.7 +8 +9 +0 +a +L@ 9% -+ 5. -+ D D =e 7J.b +l/ ho c +d +gl.Yi.p`.3v.'E.;7.e +f +1^ Ig N/ g +d4.DS k8.&L &L *L (R 68.*L /R (R qM k#.qM k#.T9.*L qM h +i +j +J/ k +AZ.m/ P~ .& %t [{ q] 0B l +G{ O9 &~ &~ +< :e mb +} ,^ :e `~ z) b{ 2! R~ M~ 88 >: u~ @{ <^ ^] O{ u4 aY.u4 db ^] I~ S{ h{ ", -"G] &{ u4 8{ k~ X_ u, j& n& n& j& }> }> }> D# ~> j, n% t@ 2~ 2~ 2~ 2~ m +z`.W~ <# $& ~$ *@ 5 P^ Jr.9G MH =U aJ n +d +$L OY kM yf a^ j..)u.)u.]D 0G I9.aJ !d.kB lY.@L .L GE M9.e8.qM e8.M9.Si.o +p +q +r +/a.s +W+.re.W+..L 8W.rl =n jB bE @1 _u.D D -+ -+ ! &$ _ _ V$ < z. ,~ t +u +I8.M_.X` !;.h4.Al.vX xX Om.x).5a.b%.c^.zh.>o.mX.8k.sq.sq.sq.sq.<@.<@.1<.u=.u=.u=.u=.u=.**.**.**.**.t=.S[.S[.b|.b|.a|.6K.DR.v +w +'T.ib x +y +z +A +{B B +C +AY.AY.AY.BY.BY.BY.CY.SZ.SZ.CY.BY.CY.D +E +F +G +H +I +O`.p).eU.J +K +L +M +mV.N +O +ZZ.P +Q +kV.QY.TR.R +S +T +U +V +W +X +Y +Q +Z +'v.` +1T. .+..+3m.kT.OW.+.+@.+#.+$.+MV.MW.%.+&.+*.+0{.=.+-.+;.+KR >.+,.+'.+).+!.+~.+{.+].+{F.^.+/.+(.+_.+:.+<.+[.+}.+|.+1.+2.+3.+4.+5.+6.+7.+8.+9.+dz.0.+Sz [ D D u# D D D K/ `9 wr pP kB jS gl.:s.:s.:s.Yi.4k.j`._a.&T.kX >t %$ Wz =7.68.T9.O` O` (R T9.(R qM &L qM qM k#.&L CP &L (R *L a.+b.+c.+xY.Am.wR.d.+e.+-y W{ N~ O5 J{ Q~ r^ l& &~ n] #6 :e mb +} _G mb ,^ s).@6 :e >^ >^ ;^ &~ k& n& 1! @~ [{ [{ B) <{ p' q# F~ 8{ f^ 8{ {] &{ I~ ^] ^] G] S{ h{ ", -"G] G] G] #{ F] j& D# D# n& l& {+ k& j& D# k& k& }> n% 93 2~ 2~ 2~ F9.m +f.+f.+z`.2~ ~$ 0^ 7# nl @R 9G 9G 9G dM kB lY.@L mM mM xf i- _X p`.;U kB 9G 9G 9G 9G kB H9.+L #L lM U+.xe.U+./a.^a.d8.g.+h.+i.+^d.U+.U+.ye.M` @L @L kB rl Cf =n (V.U} D E -+ 5. 5. 5. 9% 9% V$ { < < i> j.+k.+5Z |(.wX a<.1Z T[.xX 2Z xX W` W` 5a.6a.tl.zh.GZ.=o.8k.8k.8k.sq.<@.<@.1<.1<.1<.u=.u=.u=.u=.u=.u=.**.t=.S[.S[.N1.N1.UI.l.+m.+-} /< }7 n.+o.+1c.C`.p.+q.+p.+;~.AY.BY.BY.AY.BY.AY.SZ.SZ.SZ.CY.r.+OZ.s.+EY.t.+TZ.u.+v.+w.+x.+y.+z.+HY.A.+B.+C.+D.+E.+N`.F.+G.+H.+yQ.I.+D.+iV.sW.J.+R +K.+K.+L.+K.+M.+N.+nV.O.+P.+Q.+R.+pU.S.+T.+FU.U.+V.+W.+X.+Y.+&.+Z.+`.+UE. ++.+++++@++#++$++%++&++*++=++-++;++Zf.>++,++'++)++!++~++{++]++^++/++(++_++:++<++[++}++|++1++2++,@ 9% D D 9% D D D V$ :G $n 3++]D ~%.:s.9X.:s.:s.:s.9X.3v.3v.3v.Yi.~* r# q# >7.k8.CP /R T9.k8.k8./R CP /Z &L k#.k#.&L &L /Z /Z e8.4++5++6++7++gl.8++;U c$ T# 9++.< Y_ Q~ n] &~ n& 4 n] +< #6 :e _G +} +} s).,^ @6 :e #6 P~ ;^ '! 4 -! {) K~ z) [{ b{ B) >^ l- +{ F~ #{ u~ T{ &{ G] G] I~ I~ ^] h{ ", -"6{ <^ aY.p) D )$ D# D# D# n& D# }> n& D# ~> D# ~> n% t@ 2~ <# F9.0++0++a++f.+b++^3 .0 yf Bf c++d++8G 9J dM H9.dM H9..L .L Ab.xf &7 L e++jS dM 9G 9J @R 9G n#.bJ lM ye.:v.f8.xe.f++^a.xe.8q.g++h++Hk.i++/Z j++;O lM mM #L 0G `K `K rl /w ^3 D E -+ 5. 5. 5. 9% 9% V$ { { ] =+ ZN k++l++I8.m++n++M_.!;.1Z xX xX T[.W` u..6a.!o.c^.GZ.GZ.mX.mX.8k.sq.<@.<@.<@.1<.1<.1<.u=.u=.u=.u=.u=.**.t=.S[.S[.w)._d.o++p++q++@e ,2 r++s++t++u++p.+v++w++x++he.AY.BY.CY.SZ.SZ.SZ.r.+r.+y++z++A++B++C++MZ.D++E++F++G++H++I++J++K++L++M++N++O++P++Q++R++S++UH.P++UR.Xx.U`.VY.R`. `.yQ.T++U++V++W++X++Y++R.+P.+Z++P.+QY YZ.`++ @+.@++@+@@+#@+$@+%@+&@+*@+=@+-@+;@+>@+,@+'@+)@+!@+~@+{@+]@+^@+/@+(@+_@+:@+<@+|z [@+fA.}@+|@+1@+2@+3@+4@+5@+6@+7@+8@+9@+0@+a@+b@+D 9% D D 9% D E D 03 -T.]'.$q NH Yi.p`.3v.9X.9X.9X.D5.c@+j`.d@+:s.dC.!_ ({ e@+O` k`.(R &L ]@.*L /R /R CP qM _R k#./Z &L *L qM _R >U f@+g@+h@+i@+ze.ye.j@+fQ.fl.aJ 8a s4 &~ I= ;- l& L= M~ #6 @6 ,^ k@+l@+s).,^ mb @6 >^ +< L= '! 4 {+ `~ X! K~ @~ b{ B) +~ l- ${ @{ #{ u~ T{ &{ &{ {] &{ ^] O{ S{ ", -"7{ #{ @, %$ += D# k& D# j& k& j& }> 4 k& ~> ~> }> j, V+ 5 m +m@+m@+b++b++n@+o@+p@+Tz LH jB jB c++8G 9G 8W.{Z J9.nh.8q.Fb.Hr.9a Af aJ n#.9G @R dw dw aJ $7.(Z %g._R M9.=O e8.U+.d8.^a.U+.d8.J9.mM /d.>O &O ]Z k..nM $L mM L` HE q@+uz./ ;+ -+ -+ -+ 5. 5. 5. 9% 9% V$ _ _ / _ ~$ r@+s@+t@+u@+v@+w..Y` X` xX vX 1Z 1Z vX 5a.w@+b%.U` >o.>o.mX.8k.sq.sq.sq.tx.sx.0%.0%.0%.u=.u=.u=.u=.**.t=.w).S[.x@+y@+Uz.z@+A@+Y6.B@+C +rY.rY.58 C@+D@+x++E@+D`.F@+G@+H@+I@+J@+K@+DY.OZ.L@+M@+v++I@+N@+zX.O@+P@+Q@+R@+S@+T@+U@+V@+W@+X@+J`.Y@+Z@+`@+OY. #+sW.XY..#++#+@#+##+$#+%#+&#+*#+U++W++=#+8T.-#+-#+;#+>#+oU.9O.M`.,#+'#+)#+!#+|i ~#+{#+]#+^#+/#+^`..++(#+_#+:#+<#+[#+}#+~@+D&.|#+1#+2#+3#+4#+5#+6#+3I.7#+8#+9#+JC.0#+a#+b#+c#+d#+e#+f#+g#+h#+&Q.i#+fb _ _ 9% 9% 9% D E D D 9% 9% J9 8P.j#+Yi.9X.9X.'E.>t.B5.K*.k#+]V.]Z vV rl `= Sy.jX.yR.Ur.T9.O` &L qM _R qM k#.M9.f8._R qM &L &L _R OH l#+m#+n#+o#+ye.p#+U+.xe.q#+$7.we.r#+#e 4 , Y_ <{ +~ 34 @6 6! '^ Q/ 6^ +} ,^ :e #6 +< L= n] 4 k& H! {) K~ z) b{ B) +< A* s#+.e #{ l~ 4{ 7{ #{ 4{ u~ 7{ :] S{ ", -"#{ s~ *+ 6. _. n& n& k& j& k& j& }> ~> D# }> }> }> j, j, j, t#+u#+v#+w#+A5 x#+9a LH LH 8G 8G 8G dw 8G 9J Ir.{Z +L y#+Fb.Fb.fl.z#+Tz dM 9G 9J dw dw 9G 0G Mr.k#.k#.f8./a.M9.e8.M9.M9.M9.U+.V+.=q n#.U+.>O OY N` A#+N` nM M` M` mM B#+W_ -+ ;+ 5. 5. 5. 5. 5. 5. 9% 9% 9% 9% 9% 9% 9% 9. 7o C#+D#+4V.x..Z` n++n++cW.1Z 1Z 1Z _~.,j.5a.W` 6a.tl.zh.GZ.=o.8k.8k.8k.tx.sx.0%.0%.1<.1<.u=.u=.u=.**.w).w).S[.';.E#+F#+G#+H#+[U.I#+J#+K#+L#+K#+rY.u++2c.M#+A +u++u++u++s++p.+N#+I@+I@+O#+N#+p.+sY.P#+Q#+R#+S#+T#+U#+V#+W#+X#+Y#+Z#+z.+g++XZ.`#+`@+PY. `.%#+tW. $+.$+(T.+$+@$+ $+#$+$$+U++W++%$+=#+%$+oU.tV.&$+*$+]N.=$+-$+;$+>$+Q@+,$+'$+,$+)$+!$+~$+{$+]$+^$+/$+($+_$+:$+<$+[$+}$+|$+1$+2$+3$+4$+cF.5$+6$+7$+8$+9$+0$+a$+b$+c$+d$+e$+f$+g$+h$+i$+j$+,1 =+ ( ( 9% 9% 9% D E D 9% 9% 9% &$ ,n dC.;U 4k.p`.Cz.k$+e +e +e +4g.'%.AZ.3Q.x8 l$+N` oM ,%.(R qM &L M9.^a./a./a.d8.U+.f8./Z /Z M9.xe.)O d +m$+n$+mE.*O [v.f8.M9.U+./a.^a.Zn.Cf &[ w- t4 A) B) >^ @6 @6 v~ [] 6! s).,^ @6 :e +< L= n] &~ `~ {) z) K~ z) [{ 2! L~ 34 M~ }2 l~ l~ #{ #{ #{ u~ l~ l~ T{ G] ", -"u~ :! 6. ^ .; j& j& {+ {+ j& D# ~> j, }> }> [* j, }> j, j, z`.v#+o$+p$+|3 LH jB jB LH jB dw 9J @R 8G dw TB.{Z +L Xn.]d.Fb.Hr.Uz Tz 9J dw 9G ~%.0G )u.2w./a.k#.M9.xe.e8./a._R f8.U+.e8.M9.M9.!a q$+r$+k..oM A#+'%.N` &O $L OY .L s$+d( j@ ;+ 5. 5. 5. 5. 5. 7. ! ! ! 9% 9% 9% 9% 9. 9% t$+u$+v$+1@.x..Z` c|.n++X` 1Z 2Z t>.](.T[.5a.!o.6a.c^.s..=o.8k.8k.8k.sq.tx.sx.0%.1<.<@.O1.u=.);.);.t=.w).1D.w$+CZ.x$+H#+l.+UC.y$+I@+z$+A$+B$+C$+D$+E$+kX.F$+G$+H$+u++I$+I$+58 J$+u++u++s++p.+K$+L$+M$+N$+O$+P$+Q$+R$+S$+T$+U$+V$+W$+K`.`#+X$+uW.PY.OY.tW.Y$+ $+yQ.Xx.P`.@$+XY.Z$+>#+`$+%$+ %+%$+%$+;#+&$+o)..%+]N.+%+@%+YL.#%+$%+x.+V#+%%+&%+*%+=@+#++=%+-%+;%+>%+,%+'%+)%+!%+~%+{%+]%+^%+/%+(%+_%+:%+<%+[%+}%+|%+( +1%+2%+3%+4%+5%+6%+7%+8%+9%+0%+s% W> &$ &$ 9% u# u# D D D 9% 9% 9% V$ a%+b +b%+9X.h`.c%+d%+e%+f%+g%+go.go.4Y.:X h%+>D m#.ky.CP /Z qM qM d8.d8./a.d8.Fb.M9._R M9.U+.^a.M9.i%+j++j%+k%+l%+GE <..M9.U+.U+.xe.d8.we.aJ m%+fB `5 N~ +~ >^ #6 >^ L~ ~ ^ P~ L= n] '! l& {) {) z) @~ b{ b{ -^ $^ /a %' l~ l~ u~ u~ u~ u~ l~ l~ U{ &{ ", -"}3 F] <$ j> }> D# j& k& n& j& k& j& D# ~> }> [* }> }> t@ n`.^+ Ym ;* Af LH 8G 8G LH LH LH @R @R 9J kB kB H9.n%+{Z J9.Xn.Xn.aJ Bf LH ue.c8.we.V+.r +r +r +d8._R xe.xe./Z U+.M9.f8./a.M9.U+.U+. < ]~ o%+]V.Yq.p%+p%+lZ.Yq.f( q%+r%+03 03 u# D u# u# 5. 5. 5. 7. < < ! 9% 9% 9% 9% 9. ( (. s%+t%+*6.I8.Z` Q1.Y[.u%+v%+!;.3Z 3<.T[.v..v..x).6a.ak.[d.[d.8k.8k.8k.sq.sq.P5.P5.8k.AL.oq.);.);.**.w%+x%+/J .Z y%+_u.~t.$n z%+A%+B%+C%+D%+E%+B$+F%+G%+H%+I%+$k J%+eV.K%+L%+M%+N%+O%+P%+Q%+R%+S%+T%+U%+V%+W%+X%+Y%+Z%+`%+ &+.&++&+@&+#&+$&+OY.+$+UR.%&+#$+&&+ic.CW.W`.*&+=&+-&+`$+;&+>&+ %+%$+8T.,&+,&+qU.+Z.'&+ZL.ZL.MH.)&+!&+~&+{&+ZL.]&+^&+/&+(&+_&+:&+<&+[&+}&+|&+@x.1&+2&+3&+4&+Vu.5&+6&+7&+8&+9&+0&+a&+b&+c&+d&+e&+f&+g&+h&+i&+j&+k&+l&+t4 9. &$ &$ &$ u# 5. 5. 5. 5. 5. 5. u# 9% D V$ *e aX.Cz.;7.i`.jy.go.i`.(v.m&+n&+o&+k`.p&+j++q&+/R hx.qM (R &L e8.xe.^a.U+.d8./a.f8._R xe.xe.f8.r&+s&+t&+u&+v&+cJ w&+U+.f8.f8./a.^a.Yr.W+.+L !d.Bf 9a .< (= ;^ [{ M~ >^ #6 >^ +< +< #6 +< L= '! &~ 4 m& `~ 1! $~ '! y{ B) T[ =^ M~ X; NK u~ l~ u~ 9{ T{ U{ {] {] ", -"=7 :. ~> ~> }> }> k& ~> j& D# k& k& k& {+ j& ~> }> j, 93 x&+br Gu DE 3e jB 9J 8G LH jB dw @R @R 9G dM 9J 88.+L mM @L @L .L H9.=n 9G Xn.U+.f8.^a.d8.d8./a.xe.xe.e8.CP &L _R M9._R f8.f8._R M9.F] f@ k/ (d.k8.]@.O` O` /R Vr.`9 z. D 9% 9% 9% 9% 9% u# 6. 6. ! #+ #+ ! 9. 9. 9. 9. 9. { ! y&+z&+a3._3.I8.x..Z` Aa.A&+B&+C&+Kb.v..T[.W` W` x).c^.>o.>o.GZ.=o.rl.P5.P5.u=.tx.T` P5.8k.u=.u=.);.D&+E&+v8 Bb.F&+G&+7X.H&+Iz Yg I&+$R J&+J&+D%+K&+L&+M&+N&+N&+O&+P&+P&+Q&+Q&+eV.eV.R&+R&+S&+T&+U&+V&+W&+X&+Y&+Z&+`&+ *+.*++*+.*+@*+#*+-~.$*++$+PY.+$+}S.`Y.%*+-Z.SX.ic.KX.&*+CW.$ +**+=*+@t.@t.-*+rP.fO.;*+;*+;*+>*+KP.,*+'*+)*+!*+PV.~*+{*+]*+^*+/*+(*+_*+:*+<*+[*+}*+|*+1*+2*+3*+4*+5*+6*+7*+8*+9*+0*+a*+b*+c*+d*+e*+f*+g*+h*+i*+8*+j*+k*+9% 9. 9% 9% 9% u# 5. 5. 5. 5. 5. -+ D D D D E !a DA.~v.(v.go.l*+g%+m*+:U.hZ.n*+o*+D' p*+(R q*+g8./R k#.&L *L k#./Z e8.e8.U+./a.f8.xe.U+.Fb.r*+w% s*+t*+u*+-u.v*+/a./a.U+.U+.U+.we.{Z uZ.w*+0J @R &n Gu +& n] ;^ +< >^ >^ +< +< >^ :e +< n] l& n& n& 4 $~ '! '! n] <{ w{ B) B) 3! K{ t~ u~ u~ T{ G] &{ &{ &{ ", -">t *> ;> ~> }> }> ~> }> D# ~> ~> j& {+ n& n& n& j& D# s@ x*+yb yb Af Tz jP jB 8G LH LH dw @R dM kB dM dM aJ .L mM .L lM #L jS h%+jS K&.U+.xe.xe.f8._R M9.k#.M9.qM qM /Z qM k#./Z &L e8.qM &L !- :. J9 Be.k8.mq.]@.DS O` y*+z*+03 D u# u# u# u# u# u# u# u# 7. #+ W$ z. 9% 9% 9% _ &$ u# 03 A*+B*+C*+|3.BX d<.x..Z` ]7.D*+E*+F*+{(.{(.U[.W` W` 6a.!o.6a.GZ.GZ.rl.P5.G*+Qz.H*+I*+J*+T#.u=.P5.u=.T#.K*+L*+M*+N*+O*+nA.+; ;y }_ A$+P*+Q*+R*+w` D%+E%+E%+S*+N&+f=.LK T*+U*+g3.P&+V*+,'.,'.,'.,'.W*+X*+X*+Y*+Z*+`*+ =+.=++=+@=+#=+$=+%=+&=+SX.Xx.OY.ic.*=+KX.qc.==+MX.-=+g` g` ;=+%*+O+.>=+tP.cO.rP.eO.,=+'=+'=+)=+@.+IP.!=+~=+CO.{=+]=+^=+/=+(=+_=+:=+<=+[=+}=+|=+1=+2=+3=+4=+5=+@~.6=+7=+8=+9=+5$+oB.0=+a=+b=+c=+d=+e=+3*+f=+g=++B h=+i=+|7 9% D D 9% 9% 5. 5. 5. 5. 5. 5. -+ -+ -+ D D D 9% 'a j=+k=+go.g%+Ek.5Y.Bp.l=+m=+n=+o=+p=+q=+>U.3!.*L /Z &L qM &L &L _R _R xe.f8.U+.xe./a.]d.9q.MH r=+s=+n, re.t=+xe.U+.U+.xe./a.s ++L {Z {Z 9G @R dw LH yf p= ;^ +< +< +< P~ P~ +< #6 >^ L= &~ n& {+ l& $~ n] n] L= A) 2! [{ b{ D) $) t~ #{ #{ %{ G] &{ &{ &{ ", -":. c> D# ~> ~> c> ;+ V+ j> }> D# j& k& k& k& {+ n& 4 ff u=+S_ Tz Uz jP 8G 8G 9J 8G dw 9G kB n#.I9.l$+nh.@L .L mM Me.v&+v=+w=+x=+&O /d./a./a./Z xe.e8.qM k#.f8.M9./Z k#.f8.&L qM M9._R qM qM `! ,] ., y=+z=+A=+J5.4v._X OJ.V$ D 5. 5. 5. 5. 5. 5. u# u# D : W$ W$ : 9% 9% 9% _ &$ { qS &$ B=+C=+{j.;}.. .BX *6.D=+E=+F=+G=+Al.H=+:~.1Z y).y).x).c^.U` >o.U` rl.u=.wh.I=+l%+J=+K=+Aw.wh.T#.T#.S[.L=+M=+N=+O=+P=+xb ^- Q=+R=+S=+T=+U=+R*+w` V=+W=+X=+Y=+C%+Z=+`=+`=+ -+ -+D9 D9 D9 D9 U*+U*+.-++-+@-+#-+Pg.$-+XR.%-+&-+*-+8O.=-+--+=-+;-+>-+bG.*=+%*+$ +$ +,-+iP.'-+iP.%*+`$+)-+!-+cO.cO.uP.YL.fO.~-+{-+]-+^-+/-+(-+_-+:-+<-+[-+#++}-+|-+1-+1=+%I.2-+3-+4-+) +5-+6-+7-+8-+9-+0-+a-+IC.b-+c-+d-+:Z.e-+f-+g-+lv.h-+i-+j-+k-+l-+m-+]] { 9% D 9% 9% 9% 5. 5. 5. 5. 5. 5. ;+ ;+ ;+ ;+ -+ -+ ;+ f/ pG.n-+o-+p-+q-+r-+ba.ba.Ub.s-+t-+u-+v-+w-+Ur.&L CP k#.k#./Z k#.k#.f8.e8.U+.^a./a.~g.Fb.x-+uZ.+L y-+z-+p#+A-+xe.U+.M9.U+./a.pl.@L +L .L J9.w*+88.9G 9J Bf x8 (= <{ P~ ;^ ;^ P~ +< #6 P~ '! 4 {+ 4 $~ 1! y{ y{ Q~ [{ b{ b{ b{ g^ %' ${ V{ 5{ G] G] G] G] ", -"T- c> }> D# i> ;+ 5. 6. ~> ~> D# j& j& k& {+ {+ n& &~ &~ n] @1 3e S_ &n 9J dw @R @R kB jS 0G n#.I9.mM mM M` $L $L :v.kM :R B-+C-+w-+5k.f8./Z /Z k#./R (R T9.&L f8.e8._R CP (R CP f8.f8._R j@+v{ `) [J 4^ D-+*d.jR.E-+F-+03 9% u# 5. 5. 5. 5. 5. 5. u# 9% D D E E D 9% 9% 9% _ ( ( ( ( v v~ G-+27.. .. .H-+}(.I-+J-+K-+L-+M-+2Z 1Z P{.1Z 5a.t..)o.tl.c^.s..rl.rl.N-+kX O-+BL.Aw.oq.T#.P-+P-+L=+M=+M=+EL.Q-+O=+R-+S-+T-+U-+V-+Rn.W-+X-+X-+Y-+Z-+`-+Z-+ ;+.;+.;++;++;++;++;++;++;++;+.;++;+f=.@;+#;+$;+M|.%;+&;+*;+%-+oT.=;+-;+;;+zQ.oT.-Z.*=+*=+>;+$ +,;+KY HP.JW.$`.';+);+=#+;$+cO.RQ.!;+~;+{;+];+^;+/;+(;+(-+_;+:;+<;+[;+};+}-+|;+1;+2;+)F.3;+=l 4;+5;+6;+Hz.7;+8;+9;+0;+&x.}`.a;+b;+c;+d;+e;+f;+g;+h;+i;+j;+k;+l;+m;+n;+y` _ 9. 9. 9% 9% 9% 5. 5. 5. 5. 5. 5. ;+ ;+ ;+ ;+ ;+ 5. ;+ !~ YN o;+Ek.Dk.Gk.q-+l*+q-+p;+q;+r;+s;+t;+Xr.&L /Z CP _R /R T9.qM &L _R _R /a.d8./a.Fb./a.;u.{Z mM aX.u;+~@.e8._R _R f8.U+.Fb.#R @L @L .L +L +L L&.dM 9G @R *n &[ X& (= |- |- P~ P~ >^ +< n] l& {+ {+ &~ !) @~ b{ z) b{ @~ b{ [{ C) C& b4 5{ I~ I~ ^] I~ G] ", -"T- :. k& k& c> )$ 5. ^ j& j& j& j& k& {+ {+ {+ n& l& &~ '! s4 9a Bf dw dM @R @R @R 9G n#.0G n#.HE @L @L lM N` N` Hm./d.q +v;+w;+%L x;+M9./Z CP qM CP /R CP CP CP qM CP (R /R &L k#.M9.xe.YV %, `) v! y;+Hc z;+nI.ou 5. D 9% u# 5. 5. 5. 5. 5. 5. 5. 9% 9% D E E D 9% 9% 9% _ &$ &$ ( w ( z5.A;+B;+C;+. .D;+E;+F;+G;+H;+I;+J;+x`.P{.1Z vX u..9p.tl.tl.c^.;o.rl.rl.ak.K;+L;+M;+P5.P5.T#.T#.P-+L=+M=+M=+N;+O;+P;+Q;+R;+S;+T;+7i V-+T=+U;+X-+Y-+V;+V;+W;+X;+X;+ ;+.;+.;+.;+.;+.;+.;+ ;+ ;+ ;+Y;+@;+x.+Z;+XR.`;+ >+.>++>+@>+#>+$>+%>+HP.-Z.&>+*=+%*+>;+*>+=>+->+KW.jT.->+GP.;>+O+.tP.sP.>>+~;+,>+'>+)>+=p.!>+~>+{>+]>+5l.^>+/>+(>+_>+:>+<>+[>+}>+|>+KT.1>+2>+3>+fb.4>+5>+6>+7>+8>+9>+0>+a>+b>+c>+d>+e>+f>+g>+h>+P-.i>+j>+k>+l>+d> 03 9. 9. 9% 9% 9% 5. 5. -+ -+ 5. 5. 5. 5. 5. 5. 5. 5. -+ V$ D T) f%+m>+n>+m>+o>+p>+=&.q>+r>+s>+t>+u>+kR.*L qM CP O` ]@.(R (R *L k#.f8./Z xe.xe.k#.S+.#L .L lM v>+p#+w>+f8.e8._R f8.xe.Yr.+L @L .L @L +L J9.!d.dM 9G 88.@R Bb.Gu )a x>+>^ +< >^ #6 ;^ $~ n& k& l& !) z) @~ z) b{ b{ [{ [{ b{ >2 y>+@g.[2 ^] S{ ^] G] ", -"w! Q> j& j& {+ z- .; z- j& k& n& {+ {+ {+ {+ n& l& &~ z) @~ d% N^ z>+q$+Cf TB.dM 9G 9G 88.J9.L&.+L @L #L $L N` ]Z A#+Ho.A>+B>+=O dY.#T.f8.f8.DS ]@./R *L ]@.O` /R CP k#.&L T9.(R C>+=g. D.j@+2v.,] qy.hQ.S, D>+(t V$ ! D 9% u# u# u# u# 5. 5. 5. 5. 5. 5. -+ -+ -+ -+ 9% 9% 9% 9% &$ &$ ( w ( o, w! E>+F>+G>+d<..}.H-+H>+I>+J>+K>+Oh.h4.vX 1Z qv.L>+M>+.F.6s.N>+U` 2<.pq.sq.0%.u=.P5.P5.1<.**.T#.O>+O>+P>+Q>+R>+w8 .: S>+T>+U>+V>+K`.W>+U;+X>+Y#+BQ.y.+Y>+Z>+`>+ ,+ ;+ ;+.;+Z=+.,+V=++,++,+X;+@,+#,+$,+%,++*+&,+*,+=,+@&+-,+0o.VR.';+;,+ @+;&+%*+==+>,+,,+',+),+;;+!,+pH.~,+{,+# +],+k].-$+^,+/,+/,+(,+_,+:,+<,+1!.[,+},+|,+1,+FD.2,+3,+4,+5,+6,+7,+8,+9,+0,+a,+b,+c,+d,+e,+f,+g,+h,+i,+c>+j,+3R.k,+l,+m,+n,+o,+p,+q,+r,+hG.<. ] 03 9. 9. 9% ;# &$ ;# 5. -+ -+ u# u# -+ -+ 5. 5. 5. 5. D 03 D D s,+t,+u,+v,+w,+x,+y,+z,+A,+B,+C,+qb.D,+CP (R K5.k#.O` (R *L &L _R &L k#./a.e8.f8.^d.lM #L .L l$+OH p#+f8.e8.e8.e8.M9./d.s +#R #R mM .L L&.8W.9G @R K` dw jB jB S_ W5 Z_ +< >^ #6 +< n] 4 j& 4 m& m& !) K~ @~ b{ A) N~ N~ C) ({ :E.$2 N{ '_ O{ G] ", -"[J K> }> D# j& k& j& D# j& k& {+ {+ {+ {+ n& n& '! 1! z) z) -! {+ l& @< =n kB 9G n#.0G HE .L +L @L M` M` $L OY E,+k#+F,+G,+H,+ZV k#./R T9.CP /R /R e8./Z ]@.DS CP f8./Z k#.qM T9.T9.I,+S9.`V t)._W.qy.7P.14 iQ.ar < { 9% 9% 9% 9% 9. 9. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 9% 9% 9% 9% 9. _ ( w ( d( 9. yF.J,+K,+L,+W_.n|.|7.M,+N,+O,+cf.%W 1Z !;.4p.P,+Q,+R,+S,+T,+U,+V,+Hy.rl.W,+wh.P5.u=.mX.X,+H_.rE.Y,+Z,+`,+|8 '+.'+Xx.+'+*;+@'+#'+$'+XZ.A.+%'+&'+*'+='+-'+;'+>'+@,+@,+@,+@,+,'+''+B.+B.+,'+)'+$&+!'+% ++*+~'+{'+XR.]'+^'+/'+('+_'+:'+ @+<'+-Z.['+SL.}'+|'+1'+2'+3'+4'+5'+iK.>7 ZX.6'+7'+8'+9'+0'+a'+b'+c'+d'+e'+f'+g'+h'+i'+j'+k'+l'+4,+m'+n'+o'+p'+q'+r'+s'+t'+u'+v'+w'+x'+y'+z'+A'+B'+C'+D'+E'+F'+G'+H'+I'+J'+K'+nG.,@ ,@ r# 9% 9. 9. &$ y` y` o, 9% D D 9% 9% D -+ 5. 5. u# 9% 9% 9% 9% D 9. 9++L'+M'+N'+e) O'+P'+Q'+R'+S'+T'+K5.CP c4.k8.T9.T9.f8.k#.k#._R CP _R f8.U+.d8.;O mM mM _X dw 4k.)g./Z _R _R &L /Z e8.M9.d8.$7.lM .L L&.@R 9J 9J dw 9J 9J 9G 9J 3e u=+@6 >^ >^ >^ ;^ l& j& {+ n& l& &~ K~ @~ y{ A) n] '! N~ v{ L' H~ R] ( &/ ^] ", -"[J `) ~> j& D# j& k& j& j& {+ {+ n& {+ n& n& 4 $~ !) z) z) -! k& k& {+ z* `K `K dM 0G n +mM lM $L nM &O N` E,+yR.qe.U'+V'+W'+)a.(R k8.c4.O` qM /R CP (R 68.]@.K5.&L e8.qM &L (R p%+X'+ D.[B.~a _W._Q.Y'+># 't.+] 5) < _ 9. 9. 9. 9. 9. 5. 5. 5. 5. 5. 5. 5. 5. 5. 5. 9% 9% 9% 9% 9. _ { ( ( 0I./ %$ PR.Z'+`'+ )+|3.+ ..)++)+ed.e<.@)+#)+wl.$)+%)+uu.&)+*)+=)+-)+;)+*G.>)+,)+@u.')+P5.))+!)+~)+{)+])+*7 6J ^)+/)+()+_)+~N.~N.'N.@'+:)+lV.MW.->+<)+<)+[)+})+|)+1)+2)+3)+SR.+z)+IO.A)+g'+k'+l'+B)+C)+D)+E)+F)+G)+H)+I)+J)+K)+L)+M)+N)+O)+P)+Q)+R)+S)+T)+U)+V)+W)+[@+V0.X)+Y)+Z)+s] }$ ,@ r# 9% 9. 9. &$ y` y` K/ 9% 9% 9% D D u# 5. 5. 5. u# 9% 9% 9% 9% D 7. '@ `)+ !+.!+^_ +!+@!+#!+$!+%!+&!+}a.K5.DS CP 68.T9.k#.CP e8.&L &L *L &L xe.xe.#R {Z lM cJ 8G dM [v./Z f8.M9._R k#.k#._R U+.9q.mM +L n%+dM kB dM @R @R 9J kB dM Jm.z>+>^ >^ >^ P~ ;^ '! {+ k& {+ n& &~ 1! z) b{ A) L= '! b{ 7> f@ *{ R] R] R{ h{ ", -"^, n' D# ~> j& {+ k& j& k& k& k& j& k& k& {+ {+ l& !) !) !) n& j& D# D# {+ |& *!+gq.)u.zb.^k.-u.S+.dY.jX.Ur.=!+lZ.f( -!+;!+>!+,%.]@.k8.k8.O` &L qM qM T9.k8.T9.CP qM qM &L O` 'a.*a.ob.,!+'!+)!+!!+y> ~!+Y'+s& L' {!+#$ D 9% 9% D 9% 9% u# u# u# 5. 5. 5. u# 5. -+ D 9% 9. 9. 9. r# 9. _ v &$ b+ r# }, :# R`.]!+^!+/!+(!+a3.2i.c7._!+l++w=.ou.:!++q!+r!+.J.s!+7)+t!+u!+u!+% +v!+w!+x!+y!+XR.0o.z!+z!+A!+B!+C!+D!+E!+F!+G!+H!+I!+J!+K!+@J.L!+*z.M!+cN.N!+O!+P!+Q!+R!+q)+9G.OV.NP.S!+T!+U!+V!+W!+X!+Y!+Z!+`!+ ~+.~++~+@~+#~+$~+iB.%~+&~+*~+=~+-~+;~+>~+,~+'~+P)+)~+!~+~~+{~+]~+^~+/~+(~+_~+:~+<~+7o s] s% r# 9. 9% 9% D 03 &$ &$ 9. 9. 9. u# -+ -+ 5. 5. 5. 5. u# 9% 9% 9% D : 7. D =e [~+DA.U} !!+}~+|~+1~+2~+3~+p%+68.O` DS DS (R O` *L (R CP qM /R CP &L _R ^a.$7.9q.Wi.zf T5 4~+k#./Z k#.k#.CP qM k#.e8.xe.$7.Wn.5~+ve.#R Zn.8W.`K ,D Cf =n e@ H, C) Q; Q; -* s; n] 4 k& {+ {+ l& z) z) b{ N~ A) y{ N~ >t T- Ac f8 '_ &/ N{ ", -";] ;] j& j& n& &~ n& {+ k& {+ j& j& {+ {+ k& j& {+ 4 {+ k& {+ D# j& k& j& ~> L^ Cf NH ^k.f8.k#.k#.&L CP /R T9.T9.6~+7~+8~+9~+/R /R K5.DS (R _R /Z &L CP O` CP qM *L &L (R ]@.c4.WM.0~+a~+b~+c~+d~+e~+f~+c> g~+^{ =; r& u# D D D D 9% 9% 9. 9. 9% 9% 9% 9% D D 9% 9% 9. r# r# ,@ r# 9. 9. 9. 9. r# s% c. Zc h~+i~+j~+k~+W_.l~+9~.m~+n~+o~+p~+lQ.q~+r~+s~+t~+u~+v~+w~+x~+y~+z~+A~+B~+@L C~+D~+E~+F~+G~+:7 (* H~+I~+J~+K~+L~+A!+M~+YZ.yQ.N~+O~+->+i!+i!+r!+P~+4^.Q~+R~+R~+S~+T~+lc.9)+U~+V~+`%+W~+X~+Y~+Z~+`~+% +#>+#>+ {+.{++{++{+g` @{+#{+${+%{+%{+&{+*{+={+-{+;{+>{+,{+.u.'{+){+)J.`J.;Z.!{+~{+{{+]{+KU.^{+/{+#a ({+_{+:{+<{+[{+}{+:8 |{+1{+2{+3{+4{+mB.5{+6{+7{+8{+9{+0{+a{+b{+c{+d{+e{+f{+g{+h{+i{+j{+k{+l{+m{+,@ ,@ r# 9. 9% 9% 9% D D 9. 9. 9. 9. 9. u# 5. 5. 5. 5. 5. 5. 9% 9. 9. 9% D D D E 9. zb 2( n{+~!+o{+p{+q{+r{+s{+t{+O` /R c4.k8.DS /R ]@.K5.qM qM qM /Z *L k#.M9.e8.M9.V+.u{+~d.v{+qM qM &L CP /Z /Z &L e8.U+./a./a.^a.^a.^a.^a.n +dM W9. d Z_ y{ ;: 5( #] 8> 8, 8, O~ 4 {+ n& n& 4 1! K~ b{ @~ @~ @~ r] h/ v! i/ C- z] %/ /] ", -"C> s! &~ n& n& &~ n& k& {+ {+ k& {+ {+ {+ j& D# j& k& j& D# k& D# D# j& ~> }> }> m% w{+[v.e8.qM &L CP /R Q9.j8.:P.!K.x{+y{+z{+Xr.(R 68.68.k8.O` k#.*L CP ]@.k8.k#.O` T9.DS J5.^@.3H.8E.A{+B{+C{+D{+E{+F{+HH #$ $$ T- a> t) D E E E D 9% 9. 9. 9% 9% 9% 9% D D 9. r# 9. r# ,@ ,@ ,@ r# 9. 9% 9% 9. [ K, Q^ G{+H{+I{+J{+ )+=}.K{+L{+M{+N{+O{+9g.We.P{+Q{+F=+R{+S{+iG.lz.T{+6p.U{+V{+W{+[q.X{+d; Y{+Z{+H&+`{+ ]+9; .]++]+@]+@a.#]+1T.$]+%]+RR._T.&]+*]+=]+-]+C{.;]+>]+>]+,]+R~+RX.']+})+lc.)]+zQ.!]+~]+)]+{]+8O.';+oT.8O.]]+D!+d)+^]+/]+/]+(]+_]+pH.:]+<]+[]+}]+|]+|]+1]+'{+$J.2]+3]+4]+5]+6]+]'+IY.7]+8]+9]+0]+{=+a]+b]+c]+d]+e]+f]+g]+h]+i]+4Q j]+k]+l]+m]+n]+o]+p]+q]+r]+s]+t]+u]+v]+w]+x]+y]+z]+A]+B]+Cj.C]+(. ,@ ,@ ,@ 9. 9% 9% 9% 9% 9% 9. 9. 9. 9. 9. u# 5. 5. 5. 5. 5. 5. 9% 9. 9. 9. 9% D D D 88 7= 2v.M] D]+[ E]+F]+G]+H]+I]+d4.^@.68.DS /R e8.CP ]@.]@./R M9.e8.e8.U+.&L &L U+.!a.J]+_u.*G *L /R *L *L *L k#.k#./Z _R f8.f8.xe.^a.xe.q#+g`.kB DE H- y{ qZ.5( >2 ;: s; 8, %~ '! l& n& 4 n& n& m& {) b{ z) K~ @~ ;: h/ v! i/ b' D~ %/ O] ", -"x) ;] 4 {+ k& 4 n& j& {+ {+ {+ {+ k& j& D# D# D# ~> }> }> j& D# ~> D# }> j, j, ~> L- K]+)O L]+M]+O` T9.DS N]+.D.O]+P]+Q]+R]+k8.]@.(R O` qM &L k#.&L /Z qM O` CP K5.'a.^@.3H.68.WM.S]+T]+U]+V]+W]+X]+Y]+Z]+Ig 6. += C& 2( -+ -+ j@ -+ -+ u# 6. 6. / 9. 9. 9% 9% 9. r# r# r# r# ,@ >@ ,@ r# 9% D 9% 9. [ '@ `]+>@ DY. ^+.^++^+q|.@^+#^+$^+%^+mg.&^+*^+=^+-^+;^+Sp.>^+,^+Nb.Ud.'^+)^+!^+~^+{^+]^+^^+/^+(^+_^+Z{+:^+r; <^+[^+}^+|^+1^+2^+{'+6)+BQ.3^+4^+5^+6^+7^+-]+8^+9^+0^+a^++i o!+b^+5O.!]+b^+c^+d^+e^+zQ.f^+g^+h^+&=+KW.e!+i^+j^+=~.DV.VL.k^+l^+m^+n^+o^+p^+>{+q^+r^+s^+t^+u^+v^+w^+x^+y^+z^+)>+A^+B^+C^+D^+~*+E^+F^+G^+SM.H^+I^+J^+K^+L^+|{+M^+N^+O^+P^+Q^+R^+S^+T^+U^+V^+W^+X^+Y^+Z^+`^+ /+./++/+@/+#/+$/+,@ Q) _. _. }$ r# r# 9. 9. 9% 9% 9. 9. 9. 9. v 9% 5. 5. 5. 5. 5. 5. u# 9% 9. 9. 9% ;# o, zl %/+_{ d~ &/+*/+zP =/+-/+;/+>/+^@.u8.u8.WM.c4.CP T9.*L *L 68.DS ]@.qM U+.M9.e8./Z k#.j@+,/+t) t5 4k.,O &L (R ]@./R qM /Z _R /Z k#.M9.M9.f8.V+.W+.Jr.$~ -! X! (a J] 5( ;: s; 8, r& 1! Q~ m& 4 l& {+ -! 1! y{ Q~ 1! Q~ v{ )) Q> w! p` 2{ (] R] ", -"u! @~ !) {+ {+ n& {+ k& k& {+ {+ k& j& D# D# D# D# }> }> }> ~> ~> }> ~> }> }> }> }> }> d% '/+)/+!/+68.k8.~/+{/+(a.]/+^/+//+(/+K5.T9.*L T9.&L CP /R CP /R T9.K5.68.*a.*a.'a.d4.'a.c4.>/+68._/+:/+@ >@ r# 9. D 9. r# ,@ ,@ ,@ }$ s! 4/+5/+6/+7/+;}.W_.j<.b(.8/+9/+0/+a/+b/+c/+d/+e/+Kb.f/+7s.g/+h/+i/+8) j/+k/+l/+m/+c; n/+o/+p/+q/+y-+Wg r/+s/+t/+u/+W#+O++@,+4^+S&+R&+,'.v/+w/+x/+y/+z/+lf.A/+B/+C/++J.c^+2'+D/+i)+E/+F/+G/+H/+Qd I/+J/+K/+L/+L/+{,+M/+pK.N/+DK.O/+>J.n^+P/+Q/+R/+BH.S/+T/+v^+0G.U/+V/+3C.W/+X/+Y/+Z/+`/+7M (+.(++(+<-+>Z.@(+#(+$(+$(+%(+&(+wC.R^+*(+=(+-(+;(+>(+,(+'(+)(+!(+~(+{(+](+^(+/(+((+_(+:(+<(+OJ..( }$ _. _. r# r# ,@ r# r# r# r# r# r# 9. v w _ 9% 9% u# 5. 5. -+ D 9% 9% 9% 9% 9% [ [(+}(+y>+Zc y;+y;+qy.SY |(+1(+g%.2(+>/+'a.J5.'a.T9.CP f8./Z *L *L (R _R e8._R k#./R 68.]@.3(+Ac t).pG.]V.xR./R T9.(R &L *L qM _R _R _R M9.4(+5(+6(+U+ te.s! s! ~) 5( >2 ^{ 8, 8, r& ~) K~ K~ l& n& n& {+ l& $~ &~ &~ &~ &~ n& n& o' d) g, _] ( ", -"C> {) `~ n& {+ 4 k& k& k& k& k& j& D# }> ~> D# ~> }> }> }> ~> }> j, ~> }> }> }> j, j, y> +, 7(+8(+^@.c4.9(+0(+ve.a(+b(+c(+d(+N[.T9./R O` (R K5.DS O` ]@.O` k8.c4.K5.*a.68.k8.c4.68.K5.u8.e(+f(+g(+h(+i(+j(+k(+l(+m(+n(+o(+f; _. 5. 5. 5. 5. 6. 6. u# 9% 9% 9% 9% 9. 9. r# r# r# ,@ >@ >@ ,@ r# 9. 9. 9. r# r# ,@ r# }, Ig p(+q(+r(+s(+t(+Z5.a3.u(+G>+-W v(+w(+x(+y(+z(+A(+B(+nY.C(+Dh.D(+E(+F(+G(+nh.H(+I(+0J == J(+K(+L(+T=+J[ M(+''+N(+O(+0U.R&+4^+4^+P(+0U.Q(+R(+S(+T(+U(+V(+W(+X(+Y(+Z(+qV `(+ _+._++_+@_+L!+*z.l(+#_+$_+%_+'M.&_+M!+P/+fS p^+*_+*_+=_+zH.-_+;_+>_+,_+'_+)_+!_+~_+{_+]_+^_+/_+(_+__+:_+<_+[_+OV.}_+|_+1_+:{+2_+3_+4_+,5.5_+6_+;'.7_+8_+9_+0_+a_+b_+c_+d_+e_+f_+g_+h_+i_+j_+k_+l_+m_+n_+(. %$ %$ :. _. _. %$ 9. r# r# ,@ ,@ r# ,@ r# 9. v w &$ 9% 9% u# 5. 5. -+ E E D D D $& o_+p_+q_+r_+Zc y;+qy.3X.pA..e s_+t_+u_+*a.'a.K5.'a.68.*L _R _R e8.qM (R qM qM (R /Z *L T9.O` z=+p4 ^ 23 v_+FS *L CP /R T9.(R *L CP k#./Z jY.w_+f E) E) s! s! u! s! J} d~ >] r& 8, /{ {) X! m& !) n& n& n& 4 &~ l& &~ l& 4 k& k& o' i/ / F! ,: ", -"C> |! j& n& {+ k& k& n& k& j& j& D# ~> }> i> 5. i> }> }> }> }> }> j, }> j, j, .> .> =! ! x_+&, Oi.y_+I5.I5.>t.|3 z_+A_+B_+C_+*L /R CP qM &L /R K5.O` ]@.'a.'a.K5.J5.K5.d4.^@.c4.d4.'a.(@.D_+E_+F_+G_+H_+I_+J_+K_+L_+M_+N_+O_+P_ -+ 5. 5. -+ D u# u# 9% 9% ! 9% 9. r# r# 9. v [ '@ 0+ W_ [ r# 9. 9% 9% 9. 9. b+ B5 aM bR.P_+Q_+R_+S_+T_+=}.U_+V_+W_+X_+v@+d<.Y_+Z_+`_+ :+.:+W` V` 6a.5a.+:+@:+#:+$:+%:+&:+*:+=:+_) -:+<' ;:+>:+,:+':+XZ.):+):+!:+%k !:+~:+{:+]:+^:+/:+*E.(:+_:+::+<:+[:+ri }:+|:+1:+2:+3:+4:+5:+6:+7:+*(+8:+9:+0:+a:+b:+c:+)B.d:+e:+GK.d:+f:+g:+>~+h:+i:+j:+fe.}C.k:+a]+l:+<_+m:+n:+o:+p:+p:+}_+q:+r:+s:+t:+u:+v:+w:+x:+y:+z:+A:+B:+C:+D:+E:+F:+G:+H:+I:+J:+K:+L:+M:+N:+O:+P:+Q:+R:+hQ.i/ }$ %$ }$ }$ }$ v &$ ( w '@ [ r# r# r# b+ _ 9. 9. 9. 9. 9% 5. 5. -+ >+ j@ n% : : S:+T:+U:+V:+W:+X:+$~ [t q` *3.*!+Y:+Z:+`:+'a.K5.O` ]@.c4.k8.DS qM f8.&L qM (R O` /Z /R O` O` J5. <+Ox y> !; 9X.Ur.(R *L (R O` T9.(R xR.*L DP go r. O! Sj w> k& u! u! s! J^ d~ #~ D) C) H, c~ H! ;] H! `~ `~ |! |! `~ 4 l& 4 4 n& n& 7> Q> -+ ,@ so ", -"D# D# k& k& {+ {+ {+ {+ j& j& j& D# ~> }> i> 5. >+ :* j, j, }> }> j, [* [* [* +> Ic 9^ -> !~ .! ;+ Jr.=g..<+b%+0~ /V.+<+&{+@<+*L *L *L qM CP DS c4.*a.J5.68.*a.O` K5.*a.68.u8.u8.#<+H/ I]+4~.$<+%<+&<+*<+=<+-<+;<+><+,<+'<+)<+!<+CB.5. 5. -+ D 9% _ ( ( ! 9% 9. r# r# 9. _ { ( b+ Cr r# }$ r# 9. 9% 9% 9% b+ [ x [ ~a ~<+j5.{<+]<+^<+/<+(<+_<+`` `` x..|(.|(./0.2Z vX 1Z 1Z 2Z xX |@.Fp.yv.`s.:<+SC.e}.<<+[<+}<+|<+1<+2<+3<+4<+5<+6<+7<+8<+9<+$'+HY.0<+9V.dK.a<+b<+c<+d<+e<+f<+g<+h<+i<+j<+k<+l<+m<+n<+o<+p<+7:+q<+r<+s<+t<+u<+v<+w<+x<+y<+z<+A<+[8.B<+vR.C<+D<+E<+F<+G<+H<+I<+J<+K<+L<+M<+N<+O<+O<+P<+Q<+R<+S<+T<+I^+U<+V<+x:+W<+:;+X<+Y<+Z<+`<+ [+.[++[+@[+#[+$[+%[+&[+*[+=[+-[+;[+>[+,[+O^ s] '[+,@ ,@ ,@ ,@ r# v ( { ( w ( v 9. r# r# 9% 9. 9. 9% 9% 9% 9% 9% u# ;+ ;+ ;+ ~' x&+1'+)[+![+~[+{[+5] ][+^[++2 <. K]+/[+([+_[+'a.68.(R k8.K5./R T9./Z k#.qM _R k#.k#.CP O` k8.'a.#<+9(+:[+<[+,U.[[+}[+T9.O` DS T9.O` ]@.FS Hb.x* U) j& j& D# D# k& |! H! H! {) {) K~ @~ b{ @~ K~ X! s! u! ;] ;] s! s! s! `~ n& n& n& n& k& {+ j& }> i> s ", -"j& j& k& j& {+ {+ {+ j& j& j& j& j& D# )$ i> 5. >+ [* }> j, [* j, j, [* L) L) ~e H_ Ic D> .! Z~ -) H) yb |[+,D w! 1[+<$ W& &L (R ]@.T9.*L /R k8.c4.K5.*a.'a.K5.O` 68.'a.d4.2[+3[+4[+5[+(@.6[+7[+8[+9[+0[+a[+b[+c[+d[+e[+f[+g[+h[+i[+5. 5. -+ D 9% &$ ( ( _ 9% 9. r# r# r# b+ ( { qS o, %$ :. r# 9. 9% 9% 9% 9. [ x w j[+T$ >'+k[+l[+B8.^<+m[+n[+o[+`` x..|(.|(.|(.M_.M_.wX !;.2Z Ym.vX 5a.V` %j.p[+')+Lz.#g.:g.q[+r[+s[+t[+MH u[+v[+w[+x[+Oo.y[+z[+A[+BQ.B[+C[+dK.D[+E[+F[+G[+H[+`Q.I[+J[+K[+L[+M[+N[+O[+D/+w_.P[+t*+Q[+Q[+R[+Ab S[+T[+U[+V[+V[+1J.%A.V[+BE W[+X[+Y[+Z[+`[+ }+.}++}+@}+#}+$}+%}+&}+*}+=}+-}+;}+>}+]>+,}+'}+)}+!}+~}+{}+]}+^}+/}+(}+_}+:}+<}+[}+}}+|}+1}+2}+3}+4}+5}+6}+7}+s$+ZN #$ '@ ,@ ,@ r# r# 9. b+ ( { ( w ( &$ 9. r# r# 9% 9% D D 9% 9% 9% 9% 9% 5. 5. ;+ 8}+9}+0}+a}+b}+c}+d}+e}+f}+2^ g}+A; &t.h}+@O.d4.'a.k#.k#.T9.T9./R *L &L *L /Z T9.k#.k#.68.'a.K5.J5.J5.i}+b%+g~+[J j}+Cz.T9.k8.'a.k8.O` ]@.[B.k}+.h }> D# D# j& ~> j& ;] H! {) @~ z) @~ b{ K~ z) z) {) u! C> s! s! s! s! s! -! {+ n& n& j& D# k& D# }> j> 7. ", -"D# ~> j& k& {+ k& j& k& k& j& D# j& D# ~> }> )$ j> > ~> j, L) [* .> U> +> bi ~e ~e !> D> Z~ Z~ ;G -) u# Q5 l* pA.l}+c> m}+(R qM &L (R 68.DS 68.'a.DS 68.K5.'a.68.68.^@.3H.>/+n}+u,+o}+p}+q}+r}+s}+t}+u}+v}+w}+x}+y}+z}+A}+B}+C}+D}+5. 5. : D 9% &$ b+ &$ 9% 9. 9. 9. ,@ ,@ ,@ '@ b+ b+ o, ] #$ 9. 9. 9% 9% 9% 9. [ [ g> E}+u# s& V`.F}+G}+H}+I}+F(.J}+v$+*6.$W 5Z |(.I8.I8.Z` X` 2Z vX vX vX K}+u..b%.L{.2<.1<.L}+M}+N}+O}+gt.P}+B*+Q}+R}+e].S}+T}+nP.^p.`;+U}+V}+W}+X}+Y}+Z}+`}+ |+.|++|+@|+#|+WI.$|+%|+&|+*|+=|+-|+;|+>|+,|+'|+)|+!|+T6.~|+{|+]|+^|+/|+(|+_|+:|+<|+7O.[|+HU.}|+||+K<+1|+2|+3|+4|+4|+5|+6|+7|+8|+9|+@a.0|+a|+b|+c|+d|+e|+f|+g|+h|+i|+j|+k|+l|+m|+n|+4@+o|+p|+q|+r|+s|+t|+`> 2, u|+F# YN r# ,@ r# &$ 9. w w w w w w b+ r# r# r# 9% D D D 9% 9% 9% 9% u# 5. 5. *@ 9! v|+w|+x|+y|+z|+M=.A|+B|+w8 5r mP C|+D|+E|+S]+]@.O` DS qM /R k8.qM /R T9./R k8.(R O` DS DS K5.J5.N9.9(+sZ.pA.F|+UC 9X.mq.o..G|+o..k8.%7.O@ W~ 5 j, }> }> D# D# D# x> C> X! @~ qZ.$^ lh.X! {) K~ !) |! C> u! s! E) E) |! {+ {+ n& 4 w> ;> j& w> ;> i> >+ ", -"D# }> j& k& {+ {+ {+ k& j& j& j& k& ~> }> }> }> }> j, j, j, U> H_ 9^ Ic H_ bi => g8 g8 -) Z~ -) F, z$ 5. 1+,1+XR.'1+)1+!1+~1+DV {1+]1+^1+/1+(1+_1+:1+<1+@|+[1+}1+|1+11+21+31+41+51+61+71+81+91+01+a1+b1+81+'q c1+K~+,}+d1+e1+f1+g1+h1+#}+$}+i1+j1+k1+r:+=}+l1+m1+n1+o1+p1+q1+r1+s1+3/.t1+u1+v1+w1+x1+y1+z1+A1+B1+C1+D1+E1+F1+G1+H1+I1+J1+r# b+ K1+( w v 9. 9. v w x w w w w w w [ ,@ r# 9. 9% 9% 9% 9% 9% 9% 9% 9% 9% 9% 9% ( L1+M1+N1+O1+P1+Q1+R1+S1+T1+U1+s; g^ n}+V1+W1+0~+k8.c4.68.e8.*L ]@./R O` (R /R /R CP K5.O` DS *a.68.c4.,3.Fr.n{+># ~O.WN I5.yy.c4.X1+Y1+j ~> j, }> }> }> }> }> D# j& C> s! H! @~ i] Z1+2! z) K~ '! '! 4 C> x> s! j& j& k& k& {+ n& 1! ;] x> u! C> x) i> 6. ", -"~> ~> k& {+ k& {+ k& D# D# j& k& {+ j& ~> }> j, }> }> [* j, U> H_ Ic Ic H_ H_ g8 g8 g8 g8 g8 g8 t; v$ _. 5: Zc 3X.v! <$ H|+N9.]@.c4.K5.'a.*a.c4.DS 68.T9.DS 68.k8.68.>/+^@.S]+>/+`1+ 2+n}+.2++2+@2+#2+$2+%2+&2+*2+=2+-2+;2+>2+,2+zr 5. 5. 7. ( ( v 9. 9% D 9% 9% 9. ,@ ,@ ,@ ,@ >@ a+ x w v 9% 9% 9% 9% 9% 9. 9. 9. 9. 9. 9. ~$ A*+vo P{ '2+)2+!2+~2+q|. 1+;}._3.BX $W `` $W x..I8.Z` X` _~._~.T[.T[.T[.W` u..t..2<.2<.tq.tq.{2+]2+^2+/2+(2+_2+:2+.&+;'+O.+M|.<2+[2+}2+|2+12+22+32+42+52+62+72+&D.82+92+02+a2+b2+c2+d2+e2+f2+g2+h2+i2+j2+k2+'|+l2+m2+n2+o2+Yh.R#+p2+q2+{-+e1+r2+h1+$}+s2+i1+j1+j1+@}+t2+u2+v2+w2+x2+y2+z2+A2+B2+C2+D2+E2+F2+G2+H2+I2+J2++~.K2+L2+M2+N2+O2+P2+Q2+R2+a+ UN.S2+4> ( ( 9. 9% 9% &$ ( w ( ( ( ( w w '@ ,@ 9. 9% 9% 9. 9% 9% 9% 9% 9% 9% 9% 9% 9. l}+T2+U2+V2+W2+X2+Y2+Z2+`2+ 3+.3+%, 7/ +3+@3+#3+yy.*a.WM.k8.*L &L _R /R *L &L /R qM *L *a.K5.d4.WM.K5.#<+$3+%3+,2 h@ 14 88 &3+*3+=3+L '+ -3+j, j, j, j, ~> }> j, }> D# u! H! H! H! ;3+>3+lh.X! K~ A) '! l& w> Ic C> D# D# j& j& {+ n& H! s! x) C> C> x) i> 6. ", -"~> j& |! {+ E) h> c> )$ += D# ~> j& {+ k& ~> j, ~> }> %& :* Ic Ic Ic !> +> !> g8 g8 -) z, -) g8 N+ v$ 4- 9B 3X._Q._Q.6. zf yy.yy.:w.n..o..c4.*a.K5.c4.K5.DS u8.S]+'a.K5.T9.K5.S]+n}+,3+'3+>/+)3+!3+~3+{3+]3+^3+/3+k7 (3+_3+:3+<3+Su 5. 5. ! _ v b+ 9% 9% 9% 9. 9. r# _. _. K, K, >@ a+ '@ b+ 9. 9% 9% 9% 9% 9% 9. r# r# 9. 9. 9% 9% u$ v xz [3+m<.}3+|3+13+,/.k~+;}..1+BX d<.~3.~3.x..I8.|(.|(.|(.2Z vX vX y).W` V` t..[g.ak.23+=*.rq.33+43+Qj f] 53+63+73+83+93+03+a3+b3+c3+d3+e3+f3+g3+h3+i3+5U.j3+k3+l3+m3+n3+o3+p3+q3+r3+s3+t3+u3+v3+w3+x3+y3+z3+A3+k<+n2+B3+C3+D3+/..);+ +E3+h1+s2+F3+G3+H3+I3+B}.J3+K3+L3+M3+N3+O3+P3+Q3+R3+S3+T3+U3+V3+W3+X3+Y3+Z3+`3+ 4+.4++4+@4+#4+$4+%4+[ [K.&4+#U.W> ( ( v r# r# r# b+ &$ { ( ( ( w w '@ r# 9. 9% 9% 9% u# u# 5. 5. 5. 5. u# u# u# ^ *4+=4+-4+;4+>4+,4+'4+)4+!4+}3 `| }8 ~4+{4+@3+lI.J5.u8.J5.K5.M9.&L &L e8.T9.]@.*L /R ]@.k8.c4.'a.J5.d4.]4+D9.^4+SY _l m, /4+(4+>= 0! _4+:4++> .> U> +> [* =! }> j, j, =! E) E) K> Mg ^a @~ {) K~ A) L= &~ w> U> .> ~> D# D# j& {+ n& k& w> ;> ;> C> x> i> Z) ", -"j& E) E) s! u! 6. 5. 5. ^ 6. ;+ D# D# ~> j& j& j& 5. z$ >+ !> H_ H_ b> z$ v$ N+ v$ z$ z$ z$ F, v$ ^ r, ZY qy.qy.g/ .; ,y <4+[4+}4+}4+ q.|4+oF.k8.k8.68.DS J5.J5.K5.O` DS d4.S]+14+n}+e(+3[+5[+24+34+44+54+64+8+ 74+84+94+04+a4+b4+9% 9% 9% 9% 9% 9% 9% 9% 9% 9. r# r# _. _. _. K, >@ >@ ,@ r# 9. 9. 9. 9. 9% 9% 9% r# r# 9. 9. 9% 9% u# _ %$ F# c4+d4+I}+e4+f4+F(.g4+k~+;}._3.d<.~3.x..I8.I8.x..x..M_.!;.!;.y).u..u..u..Ie.Ie.}@.t..h4+i4+j4+k4+^2+s@ l4+m4+n4+o4+p4+q4+r4+s4+t4+u4+v4+w4+x4+y4+z4+A4+B4+s3+C4+D4+E4+F4+G4+H4+I4+J4+X&+K4+L4+M4+N4+21+O4+P4+Q4+R4+S4+T4+)$+U4+U4+CE.V4+W4+X4+Y4+Z4+`4+ 5+.5++5+@5+#5+$5+%5+&5+*5+=5+-5+;5+>5+,5+'5+)5+!5+~5+{5+]5+^5+/5+(5+_5+:5+<5+YN b+ ( 4> ( w w v r# r# 9. r# r# &$ ( ( w ( ( [ 9. 9. 9. 9% 9% u# 5. 5. 5. 5. 5. 5. 5. 5. %$ [5+}5+|5+15+25+35+45+55+65+75+w5 no 85+95+05+(@.c4.c4.d4.68.(R (R f8.k#./R CP /R k8.'a.J5.d4.K5.K5.a5+b5+c5+d5+e5+'@ y ;y xV m 9^ ~e ~e ~e 9^ Ic bi H_ 9^ ~> }> j, ~> D# .; K> v! >] {) s! |! !) '! &~ k& }> j, }> D# ~> D# j& {+ k& j& D# ;> x> C> ! !~ ", -"{+ n& u! u! w> 5. ;+ ;+ 6. 6. )$ ~> }> D# {+ D# ~> )$ >+ >+ !> ~e !> z, v$ N+ N+ v$ v$ v$ v$ v$ v$ s; ;= ^{ y;+1x.BR.n' f5+(;.g5+g5+h5+i5+j5+k5+J5.J5.^@.k8.c4.'a.J5.DS O` ^@.3H.3H.J|+u,+>/+N'+l5+m5+n5+o5+p5+q5+r5+s5+t5+u5+v5+$, 9. 9. 9% D D D 9% 9% 9% 9. r# }$ _. _. _. K, >@ >@ ,@ ,@ r# r# r# 9. 9% 9% 9% 9% 9. 9. 9. 9% 9% 9% 9. r# ^, ,@ w5+x5+y5+z5+13+A5+A5+T_+m[+(<+B5+x..x..x..`` `` I8.V#.w..wX xX xX v..v..v..W` u..7p.C5+`x.D5+E5+ s.F5+Lc G5+T%+H5+I5+J5+K5+L5+M5+N5+O5+P5+Q5+R5+S5+T5+U5+V5+W5+X5+Y5+Z5+`5+ 6+.6++6+2^.@6+#6+$6+%6+:|+&6+*6+=6+-6+;6+>6+,6+'6+)6+!6+~6+{6+]6+^6+/6+(6+_6+:6+<6+[6+}6+|6+16+26+36+46+56+66+#w.76+86+96+06+a6+b6+c6+d6+0u %@.A; <. v ( ( ( ( w w 9. 9. 9. 9. r# r# ( ( w w ( ( b+ 9. 9. 9. 9% 9% u# 5. 5. ;+ ;+ ;+ ;+ ;+ 5. d) el.e6+f6+g6+h6+i6+j6+k6+l6+m6+n6+i8.o6+H).p6+q6+c4.c4.J5.'a.'a.T9.e8.&L *L &L &L DS ]@.WM.u8.c4.68.D,+r6+s6+t6+u6+v <. q` t).U> Ic H_ H_ H_ 9^ H_ H_ Ic 9^ }> j, }> }> ~> k& d) [J [J u! C> u! {+ 4 4 k& D# ~> ~> D# ~> D# j& k& j& j& k& w> x> x) K> N/ ", -"j& k& =< o' u! 5. ;+ ;+ *> ;+ ;+ j> j> =! j& j, j, > V+ :* !> ~e H_ b> N+ N+ v$ v$ v$ N+ N+ N+ ,+ v6+yF.X, 9w 1x.0B ;R w6+x6+[4+h5+y6+/@.g5+z6+NF.J5.^@.3[+3H.WM.3H.*L K5.J5.k8.d4.WM.u8.'3.A6+y_+#] B6+., C6+D6+E6+F6+G6+H6+I6+;, 9% 9% 9% 9% D D 9% 9% 9. r# ,@ K, _. _. }$ ,@ ,@ ,@ ,@ ,@ ,@ r# r# 9. 9% 9% 9% 9. 9. 9% D 9. 9. 9. 9. ,@ 7o a+ *3.d) J6+K6+A5+L6+L6+>/.,/.M6+N6+*6.`` `` `` x..x..x..Z` V#.X` X` 2Z xX xX vX vX u..v=.Um.O6+vq.P6+Q6+R6+S6+T6+U6+V6+T[+W6+X6+Y6+Z6+`6+B!+V~+ 7+.7++7+&|+@7+#7+C/+T++$7+IY.%7+&7+*7+=7+-7+;7+>7+,7+'7+)7+!7+~7+{7+]7+^7+/7+(7+_7+:7+<7+[7+}7+|7+17+27+37+47+[6+57+67+77+87+97+cM.07+a7+b7+c7+d7+e7+f7+g7+h7+i7+j7+k7+l7+n>.`]+s] #$ ( ( v b+ w b+ &$ 9. 9. 9. r# r# v ( w [ w w '@ r# 9. 9. 9% 9% u# 5. 5. ;+ L+ L+ L+ ;+ 5. m7+(V.n7+o7+p7+8y.q7+r7+s7+t7+u7+v7+w7+x7+p6+y7+z7+A7+^@.T9./R O` T9.CP O` *L T9.(R *L 68.'a.*a.WM.3H.*d.B7+C7+D7+E7+F7+h@ G7+y;+P/ H_ H_ O> O> =! 9^ H_ H_ Ic U> U> .> }> }> =! N/ ,] v! s! u! E) k& k& {+ k& ~> ~> }> ~> }> D# j& D# ~> D# j& ;> =! x) y> !~ ", -"j& {+ J} g/ ,] 5. 6. 5. !~ !~ f/ `) N/ N/ ;> }> }> }> ~> j, ~e ~e H_ F, N+ N+ v$ v$ v$ N+ N+ O+ H7+I7+J7+t= K7+r4 X:+Z! 2w.L7+M7+[4+N7+S]+c4.o..*a.WM.^@.3H.>/+WM.u8.*a.O` ]@.O` k8.S]+J5.u8.K1.O7+P7+R) M] Q7+R7+S7+T7+U7+V7+W7+X7+9. D 9% 9% 9% 9% 9% 9% 9. r# ,@ K, >@ >@ ,@ ,@ ,@ ,@ ,@ ,@ r# 9. 9. v v ( _ &$ 9% 9% D 9% 9. 9. r# ,@ ,@ ,@ ,@ i/ ,@ Y7+M-+$:.Z7+e4+`7+I}+,/. 1+J}+*6.d<.x..x..x..x..I8.|(.|(./0.X` X` 2Z xX v..W` u..v=.9p. 8+.8++8+@8+#8+[- $8+>'+v!+0)+/'+%8+t!+&8+*8+=8+-8+;8+*'+MW.>8+,8+'8+)8+!8+Jd.`s.~8+{8+]8+o4 H$+^8+/8+(8+_8+:8+<8+[8+}8+|8+18+28+Y<+38+48+58+68+78+88+98+08+a8+b8+c8+d8+e8+f8+g8+h8+i8+j8+k8+l8+m8+n8+o8+p8+q8+V +s t) >@ W_ ,@ r# ,@ 9. 9. 9. r# b+ v ( ( b+ r# r# r# r# ,@ '@ x x '@ w w ( 9% 9% 5. 5. 5. -+ #+ #+ : -+ 5. p` yb r8+s8+t8+u8+[P.v8+w8+IU.x8+y8+z8+A8+B8+C8+D8+M'+E8+T9.CP k#.O` ]@.T9./R T9.&L (R K5.O` K5.u8.WM.WM.5[+F8+G8+H8+I8+J8+_l Zc x_+~e Ic O> v$ j> c> 9^ ~e H_ H_ H_ Ic }> ~> ~> 5. 5. 6. j& j& j& k& k& k& j& ~> }> }> j, }> ~> j& j& ~> ~> j& j& D# }> .> x> ", -"k& +, ;: h/ N/ 5. ^ 5. N/ g/ v! `) N/ `) h> k& }> j, j, [* bi ~e ~e U; v$ v$ v$ v$ v$ O+ O+ N+ K8+L8+M8+8(.N8+O8+P8+7> xm.([+Q8+[4+R8+3[+k8.^@.c4.c4.c4.J5.S]+^@.K5.DS O` DS T9.]@.'a.'a.>/+S8+h%.T8+A; &/+;: D 2^ ib U8+$*+*e 9% 9% 9% 9. 9. 9% 9% 9% 9. r# ,@ >@ >@ >@ ,@ ,@ ,@ ,@ ,@ ,@ r# 9% 9% 9% ( ( v 9. 9% 9% 9% 9. 9. 9. r# r# r# ,@ }$ :. %$ r# A*+#g.b3.13+V8+13+13+q|. 1+W8+_3.. .d<.`` `` 5Z 5Z 5Z |(.I8.I8.V#.X` X` 2Z 1Z 1Z W` |Z |Z |d.X8+Y8+Z8+`8+ 9+.9++9+@9+#9+CL.$9+%9+&9+*9+=9+-9+;9+>9+.L ,9+'9+)9+!9+~9+{9+v&+]9+^9+~^+/9+(9+_9+:9+Uy.<9+[9+*t.}9+|9+19+29+39+49+59+69+79+89+99+09+a9+b9+c9+d9+e;+e9+f9+g9+h9+i9+j9+k9+l9+m9+n9+(/.&< S> M@ ,3 t) >@ ,@ r# 9. 9. 9. 9. r# b+ b+ ( ( &$ 9. r# r# ,@ ,@ a+ x x w w ( &$ 9% 9% 5. 5. 5. -+ #+ #+ #+ -+ 5. ^ Cf o9+p9+q9+r9+s9+t9+u9+v9+w9+x9+y9+z9+A9+B9+C9+D9+g5+lI.CP /Z /R *L &L *L O` /R ]@.68.K5.*a.WM.^@.E9+d4.PC.F9+G9+H9+I9+J8+^{ X, H_ ~e ~e U; z$ c> C> ~e ~e H_ H_ H_ =! D# += 5. ;+ )$ )$ D# D# D# j& j& j& }> j, }> j, ~> D# j& D# ~> ~> ~> k& j& }> .> C> ", -"{+ m& g/ n' -> 5. 5. 5. n' h/ ,] Z) y> y> j& w> .> .> [* L) ~e => ci = N+ N+ N+ v$ N+ -/ }. z$ J9+K9+L9+M9+N9+O9+7' K, AP M'+E|+M7+h5+3H.d4.J5.DS [a.P9+d4.d4.'a.(R ]@.K5.O` T9.T9.^@.WM.J|+Q9+R9+S9+C) mP T} T9+{i /{ U9+jo V9+P^ D D D 9% 9% 9% V$ V$ 9% b+ ,@ ,@ ,@ >@ ,@ >@ >@ >@ ,@ ,@ r# V$ V$ V$ _ v b+ v 9% D 9% 9. 9. r# r# b+ r# [ [ ,@ :. W9+&$ _ x%+ c.g4+e4+X9+|3+F(. 1+|3.>}.. .d<.d<.~3.5Z 5Z I8.x..x..I8.|(.|(.V#.M_.M_.!;.W` vX Kb.7p.ek.Y9+.s.Z9+`9+ 0+.0++0+@0+#0+$0+%0+&0+*0+=0+-0+;0+8I.@:+Ep.>0+,0+'0+)0+!0+~0+{0+q@ K*.]0+Ah.^0+^0+Ie.}o.NA.uQ./0+(0+_0+41+:0+<0+t_.sc.[0+W%+}0+|0+10+20+30+40+50+60+70+80+90+00+{5+a0+b0+c0+w5.t) d0+t) >@ >@ >@ ,@ r# r# 9. r# r# r# r# v ( v v 9. 9. v [ ,@ '@ w '@ x '@ w b+ 9% V$ ! 5. 5. -+ : z. < -+ 5. %$ E9.b~ e0+f0+g0+h0+i0+j0+k0+l0+m0+n0+o0+p0+q0+r0+h5+nF.J5.(R CP ]@.k8.K5.J5.K5.K5.WM.^@.u8.WM.J5.n}+s0+S]+t0+u0+v0+w0+x0+y0+b' e@ O> => => U; v$ z, -> O> bi Ic +> Ic .> D# D# 6. c> )$ ~> j& k& j& ;> ;> ;> }> j, j, }> }> ~> ~> ~> ~> ~> }> ~> ~> }> .> x> ", -"u! s! {+ j& D# D# )$ ~> ,] `) !~ }> ~> =! =! x) .> Ic H_ .} O/ -) g8 = x; x; -& N+ N+ z0+z _t A0+B0+C0+D0+E0+F0+R) (. ^k.G0+['.&!+NF.>/+J5.'t T]+ke.H0+WM.*a.*a.k8.]@.DS /Z (R DS J5.2[+3[+3H.I]+^@.8X.t).I0+1x.J0+K0+d~ 8> Q5 9. E E z. V$ < < { qS qS b+ 0+ i' F] |^ /_ xf yb x>+>@ ,@ v ( { V$ V$ 9% 9. 9% 9% 9% 9% 9. 9. ( ( ( ( ( ( x w w ( ] ( E}+L0+M0+N0+|3+O0+ 1+o|.o|.|3.W8+W_.. .$W $W x..x..x..x..x..x..x..x..x..I8.P0+P0+P0+T[.Um.xX xX T[.$)+Q0+R0+R0+ 0+^0+ 0+S0+T0+%r.U0+V0+V0+0g.cg.Q{.ro.W0+X0+Y0+Z0+`0+ a+Fv. y.Ah.|Z .a+|g.Ah.+a+k~ @a+#a+$a+%a+&a+*a+=a+-a+;a+>a+,a+'a+)a+!a+~a+{a+]a+^a+/a+(a+_a+:a+@ >@ >@ >@ ,@ ,@ r# r# r# ,@ ,@ r# r# r# 9. 9. 9. r# b+ w '@ a+ r# '@ a+ a+ a+ '@ ( { ! ! u# u# 9% 9% 9% 9% 9% 9% X, ~) |a+F +1a+2a+3a+4a+5a+6a+7a+8a+9a+0a+85+aa+ba+E|+c4.O` (R ]@./R /R K5.J5.*a.d4.d4.d4.J5.c4.4[+ca+14+da+ea+fa+ga+ha+ia+t) F* :. G# N+ N+ v$ v$ v$ b> b> [* j, j, .> }> }> <$ ~> ~> ~> j& j& C> ;> x> =! }> j, j, }> }> }> }> }> w> x> x) .> }> }> =! x) ", -"C> u! k& D# D# D# }> ~> N/ .! .! =! }> =! x) x) 9^ ~e ~e => => -) g8 = q; q; = O+ O+ )- |. ja+ka+la+ma+na+oa+pa+qa+ra+q%+sa+R8+E|+/@.>/+I|+J5.ta+ua+va+c4.*a.'a.c4.d4.'a.O` K5.c4.u8.WM.3H.*a.^@.WM.ho 6. ;R `s Zc 1x.1x.7/ wf D D D wa+xa+OJ.vo 7J 'B bw Tc Tc `K ya+}..c +kB @R x*+,@ r# v ( ( { 9% D D D 9% 9% 9% 9. 9. ( { ( ( ( ( w w ( ( ( _ _ .; Z,+za+E4.g4+T_+o|.o|.|3.|3.|3.=}.D;+D;+*6.`` `` `` `` `` `` `` `` x..I8.|(.|(./0.s>.X` X` X` bW.Aa+Aa+Ba+Ba+H=+Ba+Ca+Da+Ea+Fa+Ga+Ha+Ia+Ja+4Z s>.Ka+La+Ma+Na+Oa+Pa+Oa+Qa+U[.{(.}o.U[.Ra+Sa+Ta+Ua+Va+Wa+Xa+&a+Ya+Za+`a+ b+.b++b+@b+#b+$b+%b+&b+*b+=b+-b+;b+>b+,b+'b+)b+t) YF.fb S> U< G5 >@ >@ >@ >@ >@ ,@ r# r# ,@ ,@ ,@ ,@ r# r# 9. 9. 9. r# b+ w w [ 9. r# ,@ >@ >@ '@ ( { V$ 9% 9% 9% 9% 9. 9% 9% 9% V$ |^ a> fb X7+!b+~b+{b+]b+^b+/b+(b+_b+:b+/+}b+|b+1b+2b+3b+4b+5b+#_ 0^ 7~ 8, O+ O+ N+ v$ v$ v$ v$ `% M; j, }> }> }> }> }> D# D# D# ~> D# C> u! ;> ~> ~> }> }> ~> ~> ~> }> ~> s! C> x) =! }> }> U> x> ", -"s! s! D# D# ~> D# ~> ;> !~ .! .! i> }> }> .> =! U> ~e => => => F, g8 /; q; q; c% O+ Y% t 6b+7b+8b+9b+0b+ab+bb+Jw -N.cb+ql db+/@./@.L7+2[+^@.VB.eb+*d.le.c4.*a.J5.J5.68.J5.*d.pb.A=+J5.68.K5.d4.J|+fb+gb+,@ >t y;+Zc hb+hb+8> uz.Cc J9 n8.*n kB Yi.pX 9X.9X.ib+jb+;U kb+O9.lb+bX.I9.l$+7J ,@ ,@ v _ { V$ 9% D D D D D 9% 9. 9. ( b+ ( ( ( ( ( ( ( ( ( ( 9% 9. [K.s% mb+7g.. .W_.;}.;}.W_.W_.W_.=}.=}..1+*6.d<.d<.d<.1@.x..x..x..x..x..x..x..I8.I8.I8.I8.I8.I8.nb+nb+W_+ob+ob+ob+pb+qb+rb+D=+sb+}~.tb+3Z %0.%6.ub+vb+I8.m++wb+M{.xb+yb+D=+:(.s>. :++m.zb+Ab+Bb+Cb+Db+Eb+xH.Fb+Gb+Hb+Ib+Jb+Kb+Lb+Mb+Nb+Ob+Pb+Qb+Rb+Sb+Tb+Ub+Vb+ui ># [, Wb+}$ S> G5 G5 >@ >@ >@ >@ >@ ,@ b+ b+ [ ,@ ,@ ,@ ,@ ,@ r# _ 9% _ &$ ( ( 98 Xb+pu *e t) W_ '@ ( { V$ 9% 9% 9% 9% _ 9% D 9% V$ G~ $' -, &, |3 Yb+Zb+`b+ c+.c++c+@c+#c+95+q0+hM.@3+i5+^@.3H.d4.c4.I]+$c+z7+u,+O7+]@.68.d4.d4.S]+>/+%c+&c+*c+=c+-c+;c+>c+,c+'c+(. %, z, N+ N+ N+ N+ N+ v$ U; M; [* U> j, .> }> ~> D# }> ;> .> D# ;] H! s! ;> ~> }> ~> ~> ~> ~> =! ;> C> x> 9^ }> }> }> j, .> ", -"u! x> D# }> .> 9^ 9^ x) ;+ Z) ;+ }> }> j, }> }> }> >+ U; N+ N+ F, N+ O+ c% c% G# Y% -- '- )c+!c+~c+{c+]c+^c+/c+(c+%z._c+:c+D).W1+#3+Q9+^@.c4.*a.'a.c4.'a..4Z 4Z /0./0./0.6c+7c+8c+9c+0c+ac+zH.bc+cc+dc+ec+fc+gc+hc+ic+jc+kc+lc+mc+nc+oc+pc+qc+rc+sc+g@ x g@ Q) x a+ >@ M@ >@ >@ >@ >@ >@ >@ r# b+ b+ w [ ,@ ,@ ,@ ,@ 9. &$ { { ( ( ( Kz 3!.T9.|p.:Z LH /t z! _u.K/ G$ D D ) ) ! D D D wf M> 7! ~O.tc+uc+vc+wc+xc+yc+vL.G0+zc+85+Ac+Bc+#3+Cc+Dc+u,+WM.h5+Ec+Fc+aa+Gc+Hc+'t K5.O` WM.3H.J5.Ec+Ic+Jc+Kc+Lc+Mc+Nc+Oc+Pc+CB.J} w! N+ N+ N+ N+ N+ v$ U; ~e ~e H_ Ic 9^ 9^ ~> D# }> x> x> C> H! s! X! ;] x> Ic }> }> j, x) x) u! C> x) 9^ ;> }> }> }> [* ", -"x) .> ;> [* U> x> x) x> 5. ;+ )$ j, }> }> }> }> ~> j> v$ N+ N+ v$ N+ G# O+ G# q% -- % ~> Qc+Rc+Sc+Tc+Uc+Vc+Wc+Xc+Yc+Zc+`c+ d+W1+#3+R8+3[+'a.K5.(R ]@.ob..d+eb+.d+A=+J5.u8.+d+ta+je.@d+68.3H.u8.d4.I|+([+jB y> qy.y;+|c+y;+1{ l*+5B.^@.^@.c4.DS (R *L CP &L dY.oM N` K&.gl.:s.~@.Gm.0M z5.,@ ,@ 9. D D D 9% 9% 9% 9% 9. 9% D 9% 9% D 9. 9. { { ( ( w w w w ( ( ( w r# 9. J& -/ r- ))+Nm.4V.#d+_3.D;+D;+_3.W_.|3.|3.g<.17.. .17.. .. .. .D;+. .. .. .. .. .D;+D;+D;+D;+D;+`` $W $W `` `` `` b3.wa.w=.$d+x..x..x..x..x..I8.5Z I8.I8.I8.I8.I8.5Z 5Z %d+&d+*d+=d+-d+;d+>d+DK.,d+'d+)d+!d+~d+{d+]d+^d+/d+(d+_d+:d+@ >@ >@ >@ >@ ,@ b+ v ( ( b+ ,@ ,@ ,@ ,@ ,@ v { { ( ( ( eX O` 68.io.|d+1d+2d+3d+n&+!O.:a.4d+x#+K, / D 9% E D |^ 4- [X _Q.5d+6d+7d+8d+9d+0d+ad+ $.bd+cd+dd+Fc+W1+ed+n}+S]+S]+Q8+ba+r0+fd+Bc+gd+WM.k8.c4.J5.J5.^@.hd+id+jd+kd+ld+md+nd+od+pd+qd+rd+P=+y. v$ N+ N+ N+ v$ U; ~e ~e ~e Ic 9^ 9^ }> ~> =! x> C> C> ;] s! z) K~ u! H_ bi [* L) .> x) s! u! x) x> ;> }> }> j, L) ", -"u! x> =! L) [* x> x> u! d) 5. ;+ j> D# ~> }> D# ~> >+ v$ N+ N+ N+ N+ O+ % a& >- O+ 5. sd+td+ud+vd+wd+xd+yd+zd+Ad+Bd+Cd+Dd+Ed+{4+ba+R8+J|+J5.T9.O` K5.*a.Fd+ke.Gd+d4.mI.Hd+.d+le.le.*a.'a.K5.u8.3H.I5.(!.-g.d) _W.n{+_Q.98.C- p;+Id+0~+^@.k8.T9.T9.*L qM k#.pM ]Z Gb.|V.p`.:s.6X.<../J '@ ,@ ,@ r# 9% D 9% 9% 9% 9% 9% 9. 9% D D 9% 9% 9. 9% V$ { v w w x '@ x w ( ( w v D E; Jd+!i H) Kd+Ld+Md+Nd+I8.1@.BX _3.=}.17.. .17.G>+Od+Z5.|3.=}.=}.Pd+|3.|3.|3.|3.=}.W8+W8+W8+W8+.1+.1+.1+la.v$+D;+W_._3.-W . .t@+. .1@.x..x..x..`` f7.x..1@.1@.x..`` `` `` x..Qd+Rd+Sd+Td+Ud+Vd+Wd+Xd+Yd+Zd+`d+ e+.e++e+@e+#e+$e+%e+&e+*e+w =e+'@ x x y f@ f@ f@ >@ >@ >@ K, K, a+ a+ '@ 9. &$ ( ( b+ ,@ ,@ ,@ ,@ ,@ [ ( ( v ( ( ~t.&L (R ob.gd+-e+;e+>e+,e+ 2+'e+)e+q}+!e+~e+el.V5 98 W_ `5 a> ,E.Ts K, {e+]e+^e+/e+(e+_e+q0+:e+/+3e+4e+5e+6e+7e+8e+9e+0e+ae+be+ce+JS de+z, N+ N+ N+ v$ F, !> ~e ~e Ic 9^ 9^ j, V+ i> -> u! ;] X! ;] {) H! C> Ic V; L) [* U> x> s! ;] C> C> ;> ~> D# [* [* ", -"~> =! 9^ H_ 9^ H! u! C> C> C> -> j, D# }> }> }> }> >+ v$ N+ N+ N+ O+ % a& Y% [* c> F# ;]+ee+fe+ge+he+ie+je+ke+le+me+ne+oe+pe+Q8+Q8+qe+4[+d4.u8.d4.K5.68.S]+u8.u_+Cc+i5+/@.A=+'a.S]+d4.T9.*a.3H.J|+re+se+te+ue+ve+we+xe+j& }7 eo.S]+ta+%d.'t k8.T9./R O` T9./R CP ,%.k..oM '%.ye+]D @! a+ >@ ,@ r# 9% 9% 9% 9% 9% 9% 9% 9. 9% 9% 9% 9% 9. 9. 9% V$ V$ 9. b+ r# r# ,@ ,@ [ ( { { #$ >+ v$ y. y. z$ W$ ze+Ae+Be+yw.Ce+~3.~3.~3.x..`` _3.|3.|3.|3.|3.|3.o|.o|.De+t(+L,+Ee+o|.o|.k~+k~+k~+::.::.::.g4+g4+g4+::.::.m[+Fe+ 1+ 1+J}+J}+N6+N6+J}+N6+N6+N6+N6+.1+17.17.b3. .%6.Ge+la. .He+Ie+Je+Ke+Le+Me+Ne+Oe+Pe+Qe+Re+Se+Te+ox.!~ -+ =+ $$ :. ,@ [ ,@ >@ >@ >@ >@ >@ K, _. _. (. /. '@ w [ [ r# 9. r# ,@ ,@ ,@ >@ ,@ [ [ [ ( ( 0+ j..7W.68.'3.14+4[+4[+D_+Ue+Ve+We+Xe+Ve+Ye+Ze+'e+vL.p}+Ek.p{ )] dz `e+ f+.f++f+@f+#f+p6+$f+['.%f+D9+~K.u8.(@.2(+i5+W1+&f+p6+B9+ed+#3+*f+=f+Gc+-f+y6+2[+u,+;f+q}+>f+,f+'f+)f+!f+~f+{f+]f+^f+/f+h; z$ v$ O+ N+ v$ F, H_ Ic ~e H_ Ic D> ;+ i> i> -> C> {) @~ H! (f+[J K> Z~ t; N+ v$ [* ~> D# ;> x> x) =! D# ~> j, ~> ", -"~> ~> x> x) u! {) ;] C> x) x) 9^ U> j, }> j, j, [* %& v$ O+ N+ G# Y% (l e~ V$ _f+g> hu :f+/+S]+9f+[e+*f+0f+o..c4.'a.J5.K5.O` 68.14+>/+*f+af+bf+cf+df+ef+ff+gf+hf+|d++d+ua+pb.k8.(R O` O` ]@.O` T9.T9.>U.E,+E,+oh.Wr.z! 0+ >@ ,@ r# 9. 9% 9% 9% 9% 9% 9% 9. 9. 9. 9. 9% 9% 9. 9% 9% 9% 9. 9. r# ,@ ,@ r# 9. { { ( 7. v$ v$ z$ z$ >+ -+ D D 03 wa+if+jf+}u.kf+Nd+v@+1@.t@+BX BX . .W_.|3.-}.,}.,}.,}.,}. 2.o|.q|.q|.::.::.q|.::.::.q|.q|.q|.::.lf+::.g4+g4+ 1+ 1+ 1+ 1+ 1+ 1+f|.mf+f|.f|.g<.g<.=W E4. .`` `` .nf+of+pf+qf+rf+sf+tf+uf+vf+K4+&e+aB .; wf+!~ ;+ ;+ ;+ 6. r# ,@ ,@ >@ >@ >@ >@ >@ K, _. _. (. /. x w v r# >@ ,@ r# ,@ >@ >@ >@ ,@ ,@ ,@ '@ w ( '@ ql z=+'a.c4.3[+xf+yf+yf+zf+Af+Ve+Bf+Cf+Ye+Df+Ze+Ef+Ff+Gf+y, s 9w 3X.Hf+If+Jf+Kf+Lf+85+0a+Mf+['.y6+*a.3H.I|+M7+ed+ed+p0+C8+95+y7+Gc+#3+*f+Nf+Fc+A>.Of+Pf+Qf+Rf+Sf+Tf+Uf+Vf+Wf+Xf+Yf+Zf+`f+ g+dz N+ N+ v$ v$ v$ v$ H_ H_ H_ H_ Ic D> ;+ 5. ;+ .> x> u! s! u! u! ^, `) .! t; N+ N+ %& j, D# =! x) x) .> }> ~> D# k& ", -"D# k& C> 9^ ;] M] H! C> Ic Ic Ic j, j, }> j, j, > z$ z$ N+ |. Y% Y% .g+0I.n>.Q) R^ +g+@g+#g+$g+%g+&g+*g+=g+r' -g+;g+>g+,g+'g+I|+/@.)g+u8.NF.K5.!g+68.K5.c4.WM.2[+~g+@3+{g+K5.K5.k8.J5.^@.c4.K5.^@.]g+^g+/g+(g+_g+:g+@ ,@ r# r# 9. 9% 9% 9% 9% 9% 9. _ _ _ 9% V$ 9% D D 9% 9% 9. r# r# 9. 9. &$ { ( { F N+ v$ z$ >+ >+ ;+ 5. 5. _ F# 1g+i/ t] x%+2g+2Z #)+v@+v@+Q1.1@.t@+. .17.Z5.V_.+ .3g+s4.4g+_:.5g+Q<.Q<.!}.6g+!}.(:.(:.!}._:.q|.q|.q|.q|.k~+k~+k~+k~+g4+g4+f|.f|.J}+J}+}7.}7.*6.f7.`` 1@.1@.7g+>r.8g+9g+0g+ag+bg+cg+dg+y) c- $+ !~ ! eg+N/ 5. 5. 5. -+ 9% r# r# ,@ ,@ ,@ >@ >@ ,@ }$ }$ }$ [ x w r# r# ,@ ,@ ,@ K, K, K, K, ,@ [ '@ x x w b+ vb fg+68.c4.c4.u,+MG.gg+hg+Bf+ig+jg+We+kg+Ye+kg+lg+mg+ng+}8 U| g}+Zc og+pg+qg+rg+sg+A8+a~+/@.tg+jo.^@.3H.S]+h5+[b+@3+ug+$f+H).vg+Gc+[b+wg+|e+Fc+xg+yg+zg+C=.qe+Ag+Bg+Cg+Dg+Eg+Fg+Gg+Hg+Ig+Jg+aV.^ Y% O+ N+ N+ N+ => ~e !> Ic Ic D> Z) c> i> 9^ .> C> u! x> x> K> `) f/ z$ N+ N+ `% L) j> w> ,~ [! Kg+[) j, b! Au ", -"D# D# x) x) u! [J ,] y> 9^ Ic 9^ U> Ic +> +> [* [* z$ O+ % $ -a J& xz U< n=.o! f@ Lg+Mg+Ng+Og+Pg+Qg+Rg+Sg+Tg+Ug+Vg+Wg+Xg+Yg+Zg+!e+k5+o..tg+`g+je.P9+0~+ h+*f+.h+je.&d..d+'t ke.ua+3H.3[+S]+68.c4.J5.~K.+h+.0.@h+#h+$h+%h+&h+*h+0a.ke.eb+!g+]@.T9.T9.O` (R DS J5.c4.DS (R *L ,t.jo xz }$ }$ }$ }$ r# r# 9% 9% 9% 9% 9% 9. _ { { { { _ { 9% D D 9% 9% 9% ( ( _ { ( 8. }. v$ z$ >+ ;+ ;+ 7. { _ ( w /. /. x 0+ 0+ =h+-h+;h+>h+y).bW.ob+,h+%d+,h+W8+'h+j<.)h+7Z p|.,}.s4.!h+f~.~h+{h+{h+A<.<:.]h+F^.^h+4g++ .,2.-}.`5.Z5.Z5./h+|3._3.BX J}+.1+f7.(h+_h+d<.:h++ Z) `) `) f/ ;+ 5. ;+ -+ 5. 5. ,@ >@ ,@ ,@ >@ ,@ ,@ ,@ r# r# ,@ [ ,@ ,@ ,@ >@ >@ K, _. _. _. v ( x a+ a+ a+ b+ 7J Y1+K5.k8.'a.^@.4[+MG.4h+5h+ig+6h+7h+g0+kg+8h+9h+0h+ah+bh+ch+ch+r4 AR.dh+eh+fh+gh+So.0a+A7+7E.T9.'a.'a.*a.+h+#3+*f+Fc+Fc+i5+Fc+Nf+-f+Nf+ba+-f+hh+ih+jh+kh+B9+lh+mh+nh+oh+ph+qh+rh+sh+th+uh+vh+Jf u ,- G# N+ N+ U; U; N+ O> Ic Ic 9^ y> x) }> ~> D# ;> =! =! 5. 5. 6. 5. v$ N+ N+ `% j> =! ;> Kg+wh+wh+xh+Kg+ii ", -"~> }> .> C> u! N/ N/ N/ y) 9^ Ic H_ ~e ~e L) L) M; O+ Y% % e~ D t) t, P[ U< p! U< B3+yh+zh+Ah+Bh+Ch+Dh+Eh+r' Fh+mD.Gh+Hh+Ih+Jh+TT.Kh+@O.[4+2(+ke.&d.9f+W1+*f+@3+%d.Lh+le.je.je.ta+3H.3[+>/+k8.DS n..0f+@3+Mh+Nh+Oh+Ph+Qh+Rh+Sh+Th+ta+ta+pF.]@.T9.]@.]@.k8.K5.*a.k8.k8.k8.(R >t.ol .( }$ }$ _. }$ }$ ,@ 9. 9% 9% 9% 9% 9. _ { { { ( ( ( D D E E D &$ &$ { { { < K@ @ v$ z$ ;+ 5. 5. ! { ( w x y y L@ i) z; ,U.gb G' WK Uh+Vh+Wh+N>+Xh+X` v@+y..W_.G>+Yh+z..z..$6.$6.B8.47.Zh+`h+ i+ i+.i+Zh++i+7}.47.47.@i+7Z $6.$6.+}.c3.$W |(.d<.#i+v@+#)+,o.$i+%i+&i+*i+=i+-i+,U.:. 6. 5. v$ % % G# N+ z$ H) !~ `) ,] 5. ;+ ;+ ;+ ;+ ;+ 9% ,@ >@ >@ >@ ,@ r# r# 9. r# ,@ ,@ ,@ >@ >@ >@ >@ K, _. _. _. v w w '@ >@ >@ r# Y6.3(+K5.68.'a.d4.u8.`1+s*.;i+>i+,i+Ze+Ze+Ze+'i+)i+)i+!i+;)+~i+r4 r4 %D t).{i+)e+85+H).q0+;e+J5.>/+WM.*a.^@.2(+i5+#3+Nf+Ac+Fc+V1+|e+]i+^i+Fc+Gc+/i+ih+85+'].(i+_i+:i+ ~> ~> }> ~> ~> ;+ 5. 5. ;+ z$ O+ O+ N+ >+ j> j> j, V+ )$ )$ i> j& ", -"j, j, Ic x> =< .! .! K> x) 9^ H_ ~e ~e => L) M; )- % % }. u# ,3 F] t, A9 A9 A9 7i+r! 8i+9i+0i+ai+bi+ci+di+ei+9} fi+gi+hi+ii+ji+ca+V5.@O.D9+ki+T]+[c+li+mi+@3+i5+.d+ob.ni+je.%d.eb+d4.^@.*a.DS *L FI.!/+g5+oi+pi+qi+ri+si+ti+ui+iR.&d.0~+'a.]@./R O` K5.68.68.d4.*a.J5.68.DS f( m>..( ,@ }$ }$ }$ r# r# 9% 9% 9% 9% 9% 9% 9% V$ { { _ { _ D E E -+ D D < ! { { #+ K@ v$ z$ >+ ;+ 5. 5. _ w x x y y i) b) 5) Gx ]<.-(.vi+2L.)3 *e i' wi+xi+yi+g4.zi+T[.v..xX M_.M_.5Z Ai+$d+W#.Bi+Ci+7}.h~.}3.Di+Ei+h<.Fi+h<.h<.,0.i<.ia.Gi+Hi+7<.Ii+}u.V,+Ji+Ki+Li+Mi+Ni+Oi+,1 Cc ,3 s& fb 9. t] t@ G# Y% % O+ N+ v$ -) N/ ,] ^ ;+ ;+ L+ L+ L+ : D b+ ,@ ,@ ,@ r# 9. 9. [ r# '@ ,@ ,@ ,@ a+ a+ ,@ }$ }$ }$ [ w w [ ,@ 0+ '@ ,;.]g.68.k8.*a.u8.u8.u8.xf+Pi+Qi+Ri+Si+Ef+Ze+Ti+)i+Ui+Vi+Wi+Xi+Lg 1x.bB l- W}.Yi+Zi+Fc+Ac+(@.NF.3H.J5.S]+*a.tg+#3+Fc+wg+ed+Mh+Fc+ed+|e+`i+Nf+wg+W1+ j+j+,j+'j+]3 .( ;+ G# Y% G# N+ U; bi H_ H_ Ic Ic Ic j, }> ~> }> }> V+ V+ ;+ i> }> %& N+ N+ N+ >+ K> x> )j+}c+!j+y> y> ~j+", -"L) j, O> !~ N/ [* j, ~> x) Ic ~e b> b> U; N+ G# % qP u [ h' P[ P[ P[ Gc WK WK n>.n>.7% f= {j+]j+^j+/j+(j+_j+:j++ ;+ 7. { _ { w y y L@ i) b) 3) 3) 3) p) j! 5~ )] 3) 3) 5~ 5) 5) b) i' U< dj+ej+fj+Aw.ux.gj+=j.|u.4p.qv.Md+hj+x`.x5+ij+jj+kj+lj+mj+mj+Kw.;z.nj+rD.oj+pj+Sn.qj+/_ [^ 88 l- K{ }; @+ ^. w- F] f@ [ z- 6. V+ u# 6. O+ O+ O+ N+ F, Z) 6. ^ 5. ;+ : #+ . #+ 8. 8. 7. ^ %$ r# 9% _ w b+ w w w w w w w b+ r# }$ w w w ( w x w W> yH z=+'a.^@.u8.S]+>/+e(+rj+sj+tj+uj+vj+wj+xj+Ti+yj+zj+:X g^ Aj+3X.s& ES /i+ba+i5+@3+3~+5j+ed+ba+~K.c4.:w.Bj+h5+h5+*f+wg+ed+Fc+[b+#3+Ac+Ac+-f+Gc+Gc+-f+/i+Cj+7- Dj+Ej+Fj+Gj+Hj+Ij+Jj+Kj+Lj+Mj+Nj+Oj+_. %$ 9. # v; 4; O/ ~e H_ H_ H_ Ic U> j, }> j, }> }> j, :* :* }> V+ %& N+ N+ N+ >+ =! ~> }J }c+n' )$ ~> Pj+", -"L) [* g8 -) !~ j, j, j, +> ~e ~e >+ v$ O+ % % O+ u w i) A9 P[ P[ +! Gc j/ j/ n>.:G (. '3 VC Qj+Rj+Sj+Tj+Uj+Vj+Wj+Xj+Yj+Zj+`j+ k+.k+#3+ed+@3+~g+=f+zR.%d.+k++d+@k+#k+$k+k8.K5.'a.u8.S]+d4.u8.*a./R DS 68.%k+&k+*k+=k+-k+;k+|[+#<+WM.d4.*a.68.]@.k8.c4.68.^@.WM.d4.S]+3H.J5.xm.r# ,@ ,@ r# r# r# r# 9. 9% 9% 9. 9% 9% 9% 9% 9% 9. 9% D E r- E; J& E -+ 5. 5. 5. 5. 5. 5. v$ z$ >+ ;+ 5. ! { ( ( x i) 5~ 3) !! !! ~! #! #! ~! ~! ~! ~! !! 3) 5~ 5~ 5~ 5~ 5~ b) p! y '@ }, '$ R$ >k+,k+,k+'k+'k+)k+!k+~k+~k+{k+]k+^k+/k+/k+(k+x>+J y8 }; %' }; +0 +0 Bz.H+ H+ H+ q# 88 88 =7 F] >@ %$ 5. 5. h; r& !- 6. O+ G# O+ N+ >+ 5. ^ 5. L+ #+ 8. 8. 8. 8. K@ v$ z$ 5. %$ 9. 9% v w w w w w w w b+ b+ r# ,@ [ w w ( ( ( { &$ 'B _k+u8.>/+2[+J|+n}+:k+/+^@.WM.E|+Q8+/@.h5+wg+[b+-f+/i+wg+r0+]i+7k+8k+9k+0k+]i+ak+A* E#.O- bk+ck+dk+ek+fk+gk+hk+ik+jk+kk+ZS.s] >@ 9. N+ Y% L& => Ic +> Ic H_ Ic j, j, j, }> ~> ~> j, j, j, j, v$ N+ v$ b> >+ V+ ~> *@ ^+ ^+ ^+ i& O=+", -"M; U; O/ Z~ .! j, j, j, ~e => H_ v$ # Y% G# N+ ;+ i) 3) 5) A9 P[ P[ m>.]'.A9 j/ WK :G R^ a^ E- iQ.lk+mk+nk+ok+pk+qk+rk+sk+tk+uk+vk+~g+W1+@3+.h+3~+=f+gd+Lh+0~+&d.wk+U@ rb._P.@d+DS k8.*a.c4.DS O` T9.DS ]@.K5.ob.ct.xk+yk+zk+Ak+Th+J5.u8.WM.68.]@.'a.J5.d4.^@.WM.u8.u8.cL.u8.4d+,@ ,@ r# r# r# r# ,@ r# 9% 9% 9. 9% D D 9% 9% 9% 9% J& E; E; J& D D -+ 5. 7. ;+ 7. 5. T- 5. z$ >+ ;+ ;+ ! { ( y t' 3) !! A! f! f! f! 2{ 3{ 3{ ~] Bk+f! #! k! 3) 3) 3) 5~ b) L@ /. h@ <. :. i/ :. :. :. :. `> Ck+3, !; A* #- #- T* *K.F> 9; }; M= M> wf Bz..e .e Dk++0 Bz.}2 H+ }2 q# @+ @+ f) F] >@ %$ *+ 8, =* V> l* !- z$ O+ G# N+ z$ ;+ *> 6. ;+ 8. 8. [. + K@ u @ v$ v$ j@ D 9% ( w w w b+ w w w b+ 9. 9. r# b+ ( ( ( &$ { < qS Ek+Fk+u8.Gk+S]+I|+u,+Hk+Ik+EN.Jk+|k+tj+Kk+Lk+)i+Mk+Nk+Wr.8, `! X_ p`.0k+Ok+Pk+$f+i5+K( Bj+K( 3~+Qk+14+A7+g5+/@.&!+#3+#3+Ac+/i+]i+wg+Mh+Rk+wg+Sk+Tk+Tk+Uk+Vk+O~ Wk+Xk+Yk+Zk+`k+ l+.l++l+@l+#l+$l+%l+&l+f@ ,@ ,@ ,@ J& Q- q; V; +> j, j, U> =! }> }> ~> ~> }> j, j, j, j, b> N+ v$ [* }> }> ~> *@ n@+^+ ^+ t@ |a.", -"-& -& b> i> j> [* j, L) U; U; v$ # |. e~ D, -+ w# 4) Ip +! I' Ip P[ +! +! P[ A9 A9 O[ xz ,@ }$ ,1 ^: *l+=l+^- -l+;l+>l+,l+'l+)l+!l+#3+~l+{l+Gk+G|+J|+u8.d4.3[+>/+0(+>7.DS =H.&d.]l+'a.WM.WM.]@.c4.68.k8.DS ]@.^l+/l+(l+_l+:l+ L) z$ >+ z$ y. 7' E- 1- W} !_ L' f! 3{ 0{ @g.|l+Qg |l+Qg >1 3{ A! k! k! 3) 5~ 5) i) g@ ># h@ h@ a+ [ [ '@ '@ w Z6.{ n! V> 4- a> #- M= T* 9; H+ H+ q# H+ H+ Y9 +0 p4 p4 +0 p4 p4 }2 q# q# 88 O} U} ,@ >@ W} |^ 88 @+ }2 wf 2( ^ N+ G# N+ v$ z$ z, v! i/ 1l+1l+y. v$ @ @ @ v$ v$ v$ v$ j@ 9. r# r# v r# [ ,@ [ v 9% 9% 9. r# 9. 9% 9% 9. 9% D D >@ |% ke.Gd+2l+Zi+3l+ba+Fc+4l+3l+5l+|k+6l+sj+7l+8l+8a+sZ.1- BR.3^ 9l+ed+ed+Mh+*f+|4+3~+I]+WM.E8+Ik+[b+1e+ba+#3+*f+ed+~g+Fc+ad+B8+jh+95+vg+y7+0k+0l+al+bl+cl+ZY iQ.:! dl+el+fl+gl+hl+il+jl+kl+ll+ml+nl+m, :G n>.G5 G5 qE |) L) }> ~> ~> D# D# -> .! =! ~> }> ~> D# }> }> [* `% L) [* }> ~> ~> 0* Uh+2~ ^+ t@ ol+", -"N+ -& M; j, [* L) L) `% N+ N+ $ a3 e~ r- 9. U} <3 +! Ip Ip Ip Ip Ip Ip Ip P[ A9 A9 U< >@ ,@ ,@ i' ]3 )t.LS.t) pl+ql+rl+sl+tl+ul+vl+wl+xl+T]+iR.2[+2[+^@.*a.k8.c4.k8.k#.yl+zl+=H.Fd+K5.]@.68.DS (R k8.DS (R (R va+Al+Bl+Cl+Dl+/+u8.3H.J|+>/+k5+o..El+Fl+,@ ,@ ,@ ,@ ,@ ,@ r# 9. 9% 9% 9. 9% D D j@ N+ O+ O+ N+ v$ z$ >+ ;+ 5. 5. 6. /V.=+ /V.I= $~ }> M; N+ v$ v$ 5. f; -$ -@.Gl+Bz.1{ f! ;/ SK ~3 !3 !3 Hl+df Qg ~] f! A! ~! !! 3) 5) L@ g@ ># ># ># g@ x x x x w ( ( y s C& !; 4- a> M= H+ }2 H+ H+ H+ H+ }2 p4 +0 Bz.+0 ;y Dz ;y Bz.}2 |^ F] ,@ a~ 7% 88 @+ }2 ;y Gl+Il+Dz V> z$ O+ N+ N+ N+ g8 g/ #] ~' 1l+Jl+N+ v$ v$ v$ v$ v$ N+ N+ F D r# r# r# ,@ ,@ ,@ r# 9. 9% 9% 9. r# 9. 9% 9% 9. 9% 9% 9. 9. 9++T]++k+Kl+Ac+[b+*f+ed+Fc+Ll+Ml+Nl+|k+Ol+}k+Pl+Ql+)E.b~ ;R o%+Rl+*f+#3+ed+@3+W1+W1+9f+^@.u8.~l+W1+jh+V1+ba+W1+=f+i5+Mh+.n>.WK WK j/ WK K/ G$ ~> ~> ~> D# j& i> Z~ .> }> }> ~> }> }> }> V+ `% b> [* j, }> ~> 0* *m+Kd+t@ x$+oY.", -"N+ = x; M; L) L) L) x; G# Y% % D, r- YN F] a~ a~ s) +! +! Ip Ip P[ A9 A9 A9 A9 A9 U< 0+ ,@ ,@ w gb =m+E$ -m+;m+>m+,m+'m+)m+!m+~m+{m+ua++d+Gd+J|+2[+S]+68.c4.(R (R ]@.O` !g+&d.eb+k8.*a.J5.68.WM.K5.68.'a.68.S9.Bj+]m+^m+;k.CS./m+'a.'a.k8.DS S]+3[+14+^@.3H.3[+3[++3+Qk+I&.OJ.r# r# r# ,@ ,@ ,@ r# 9. D 9% 9% 9% -+ -+ -+ V+ >+ z$ >+ ;+ >+ z$ >+ 5. 5. u# u# 7. :. ae $~ }> -& N+ N+ v$ C& B> ;' N' (m+_m++Z z%+V} %| :m+!3 a4 Hl+df E5 ;/ 3{ 1^ ~! !! k! 5~ i) y ># ># ># g@ x w ( ( ( ( { w k* r& V> 4- a> M= H+ H+ H+ H+ H+ H+ }2 +0 }2 Bz.Bz.p4 +0 p4 Dz 88 a~ F] f) @+ @+ @+ q# ;y => )) |m+~a 1l+Jl+i@ N+ N+ N+ v$ v$ v$ v$ v$ F J& 9. ,@ >@ >@ >@ r# 9. 9% 9. '@ r# 9. 9% D 9% 9. 9. r# 9. 1m+2m+.n>.WK WK WK j/ 9~ K, ~> j, j, )$ ~> j, O> j, }> ~> }> j, }> ~> }> b> b> [* [* .> ~> *@ lm+mm+93 x&+q8.", -"N+ = = = N+ v$ N+ L& a; -a D, pS y` z! s) 8~ 8~ J' -e 4) s) +! Ip P[ A9 U< WK WK WK 0+ ,@ ,@ r# [ l* K- O- K, i/ nm+om+pm+qm+rm+sm+`1+]l+J|+tm+[c+T]+u8.J5.k8.^@.K5.vZ.*a.Hd+VB.c4.c4.k8.]@.K5.]@.K5.(R k8.]g+*a.um+tg+t{+,7.vm+Fd+wm+v8.*a.WM.4[+$c+3[+A7+R8+L7+h5+xm+q$+9. %$ 9. 9. 9. r# r# 9. 9. 9% 6. -+ j@ z$ F ;+ n' ;> ;> *> *> !~ z$ z$ ;+ : < ! =+ -, 1( b. }> M; O+ O+ T- d* 4e :d.>| ym+>| %/+zm+1 >1 ;/ 3{ 1^ #! k! 5~ 5) i) g@ (. _. (. x w w w ( { { { w h; !- 8, C& a> M= M= M= M= }; }; T* 9; wf B- }2 Bz.}2 @+ q# q# =7 =7 q# +0 ;y }2 p4 aE Cm+bJ.Dm+>| q +*, -' / O+ O+ )- = ;] Em+/( Fm+{'.z$ N+ N+ N+ v$ v$ v$ v$ N+ N+ N+ v$ u# >@ >@ ,@ ,@ r# [ w x b+ ( ! ! _ ( &$ 9. 9. v5 Gm+Qk+4l+ba+[b+V1+5m++Zi+Lm+=f+3~+|4+K( i5+ q.G|+y6+['.[b+r0+q0+i5+Ac+ed+W1+*f+ba+1e+#3+Mm+aa+y7+`i+hh+Nm+Om+Pm+q# Qm+K] a> Rm+Sm+Tm+Um+Vm+Wm+Xm+Ym+.6 W_ 0+ z5.M@ m, P[ Ip A9 A9 0+ <$ }> }> }> }> L) b> j, }> }> }> j, j, ~> }> %& %& [* [* i> ~> ~> Zm+w#+93 ^3 3s.", -"N+ N+ N+ N+ N+ O+ % $ e~ D, W$ .( Ip Ip Ip f~ f~ J' <3 a~ s) Ip Ip Ip P[ U< n>.n>.n>.z5.>@ ,@ r# r# t) q`.@1 2X.zP h@ `m+ n+.n++n+%f+S]+J5.d4.T]+%d.*d./R K5.'a.&L CP CP *L T9.k8.]@.(R (R CP *L d4.k8.'a.'a.68.'a.K5.@n+#n+e8.$n+%n+9(+{n.d4.^@.2[+J|+3H.+3+y6+['.Q8+xm+'a 9. %$ 9. 9. 9. 9. 9. 9. 9. 9. 5. >+ z$ v$ v$ b> n' s! n' ,] ,] ,] >+ v$ z$ 8. #+ < [' :e 3+ I! }> L) L& z$ !; q`.[m+:d.&n+*n+ a> #- M= M= T* T* M= M= B- M> wf H+ q# 7% O} f) }2 Bz.;y p4 ;y p4 Gl+[m+ym+q +&n+-n+%/+_m+Gl+=7 O+ % )- = s! kf `^ h/ 1l+v$ v$ v$ v$ v$ v$ v$ v$ N+ O+ O+ G# G# F / ,@ ,@ r# w ( w w ( { { ( ( &$ 9. 9% @e ;n+$c+Mh+Mh+ba+>n+EN.2 =] {n+]n+^n+/n+(n+_n+:n+@ t) ,3 P[ Ip A9 'w t, s% <$ ~> ~> V+ [* > j, j, }> }> j, j, ~> }> [* [* L) L) .> ~> ~> w#+w#+93 ^3 }n+", -"v$ v$ N+ O+ G# % % G# E; E m, +! Ip Ip P[ p) r) 4) a~ <3 z! Ip P[ P[ P[ A9 O[ n>.n>.z5.>@ ,@ r# r# r# t) @+ g^ |n+b4+># R) 1n+2n+3n+u,+u8.A=+&d.je.4n+c4.^@.*a.T9.*L /R DS K5.DS 68.]@.&L (R K5.K5.K5.^@.d4.J5.^@.k8.Bj+Rf+K5.5n+Cf %9+2d.kI.3H.u8.u8.u8.O7+([+R8+y6+,7.Lp v 9. 9. 9. 9. 9. 9. r# %$ -+ z$ v$ z$ v$ N+ N+ D> ;] o' [J [J [J f/ v$ v$ ' < i' l; p, 1( n] j, M; L& *+ f; }m+%/+&n+(< 6n+7n+q +q +>| 8n+Gl+Bz.W! A! !! k! !! k! 3) 5) b) i) L@ y g@ fb :. :. w ( ( { { { { { w T- h; !- 8, 8> !; #- #- M= }; }; T* M= T* B- }; f) =7 7% @+ Bz.+0 Q5 aE ;y ;y Q5 mo (m+>| 7n+-n+-n+>| (m+aE 88 5. Y% L& x; 9n+kf 0n+~( ~' z$ N+ N+ N+ N+ N+ N+ O+ N+ O+ G# % %> t; `) z- r# r# w ( w ( _ { { &$ &$ 9% 9% D A5 S ~4+*f+ba+Q9+Jm+4m+_e+5m+Fc+[b+{4+@3+~g+W1+an+_a.:X 1e+bn+.k+W1+j5+{4+ q. q.@3+[b+@O.L7+ed+[b+{4+Fc+*f+3~+*f+*f+cn+W1+r0+Ac+ed+`i+`i+`i+r0+ba+,O ,3 ({ %Z |(+E5 S_ dn+en+fn+gn+hn+>@ ,@ ,@ >@ t) >@ *e P[ P[ P[ P[ Ip z! ,@ e& ~> )$ }> :* :* }> }> }> j, }> ~> }> [* L) M; L) .> ~> ~> Zm+w#+t@ in+}n+", -"L) > v$ G# % # D, z rE y! p) I' 3) 3) J' 6~ 6~ F-+W} <3 G' P[ P[ A9 P[ A9 j/ A9 U< z5.>@ >@ ,@ ,@ ,@ ,@ Lc 7% !- jn+Gp 't.*3.7X.kn+}'.2e+-e+c4.um+0~+Lm+ln+z6+]@./R 68./R *L K5.68.O` /R T9.O` K5.*a.]@.*a.'a.'a.k8.tg+[4+(@.mn+O#.s M> nn+on+pn+3H.6[+qn+([+R9+/@.p`..( v 9. 9. 9% 9% 9. %$ / j@ $+ V+ %& [* :* L) -& F, +, ., M] s! o' :. ;+ z$ 7. 5) t~ I] J5 2 4 [* x; M+ |^ I& -n+rn+sn+tn+6n+6n+6n+ V> a> #- M= }; H+ 9; wf F> wf }; 8> 2( -' ;y ;y Q5 aE Q5 Q5 aE p8 [m+bJ.ym+7n+*n+>| Cm+Cm+aE Bz.C& >+ p- V; x> (: un+vn+ZY ) K@ Q+ O+ G# G# G# % G# O+ % Y% 83 i> k& T- K, ^ [ r# b+ 9% ! D V$ &$ &$ 9% D D 9% XN O:.['.wn+xn+yn+zn+An+Bn+z7+Cn+Z:+Dn+h5+En+W}.e%+Fn+Gn+]m+Hn+~g+*f+ed+W1+*f+y6+~g+@O.[b+Fc+@O.ed+#3+ q.{4+{4+~g+|4+wg+7k+In+|e+wg+|e+Jn+Fc+}'.DA.~a hb+Kn+Ln+`6.2( S| Mn+Nn+On+z5.x ,@ ,@ ,@ >@ >@ _u.P[ P[ P[ P[ +! f~ z! ,3 ,3 [' <$ V+ %& j, }> }> }> ~> }> j, [* L) L) L) .> ~> ~> w#+n@+t@ in+2s.", -"[* [* N+ G# O+ D, r- qE A9 f~ g~ r) k! 3) <3 a~ <3 <3 W} <3 z! P[ P[ A9 A9 A9 A9 A9 U< >@ >@ >@ >@ >@ >@ ,@ r# a~ ~* +2 +2 '{ l}+0^ Pn+Fc+#3+R8+*a.'a.'a.|4+j5+Qn+DS (R CP qM (R CP *L ]@.K5.k8.DS *a.T9.]@.*a.'a.3H.>/+ q.#3+/i+4[+Cf :. g/ 8, E- Cf Rn+Sn+Tn+n}+%f+Un+*n Cr ( 9. 9. 9% 9% 9% D v$ N+ v$ [* [* [* }> j, M; N+ >+ !- K~ H! o' T- 6. >+ [' lP Vn+Wn+{1 ai 4 L) x; }, Gl+*n+Xn+Yn+Xn+Zn+tn+`n+rn+*n+:d.[m+mo Q5 |v.1^ k! 3) 5~ 5~ 5) b) i) L@ y y x h@ [K.[K.( ( { bf bf bf { { ( >@ t) U} 8, 8, 8> V> 4- #- }; H+ H+ Bz.p4 +0 9; C& !; -' Q5 Q5 Il+q`.Dz aE Il+mo Il+q`.Cm+_m+a!+Gl+mo (< o+0- k, !; O+ ci 9^ N_ .o+M_ WC i) < 9& N+ % Y% % Y% Y% % Y% % j> D# D# ^ T- ^ 9. 9. 9. 9% 9% D D 9. 9. 9. 9% D D `5 +o+C9+`1+xf+hg+/i+7k+@o+xn+e(+2[+P9+#o+gd+$o+%o+&o+Bc+W1+#3+~g+~g+=f+K( #3+5j+|4+[b+ed+M7+L7+M'+W1+ed+Nf+[b+*f+W1+#3+[b+|e+`i+V1+r0+Ve+*o+Cf+*n 3X.r4 =o+-o+2U.;o+%Z >o+,o+'o+)o+!o+0+ >@ ,@ ,@ ,@ W_ G5 A9 A9 P[ f~ +! Ip Ip +! J' 9% !$ g& L) j, }> D# D# j, [* b> M; L) L) .> ~> b! ^+ ^+ 93 ~o+{o+", -"j, `% O+ N+ N+ E; 9. F] f~ f~ g~ ~! 3) 3) <3 <3 <3 <3 <3 a~ t, P[ +! P[ P[ A9 A9 A9 U< 0+ ,@ a+ ,@ W_ W_ ,@ r# ,@ ~* /<.g}+ar K0+}J 9G Fc+ed+ki++3+WM.9f+@3+@3+/@.68.T9.DS ]@.O` CP DS ]@.'a.S]+c4.K5.DS k8.c4.^@.d4.d4.D9+#3+-f+Nf+]o+`5 v! [X r& 1- Y& ^o+/o+(o++3+2Q.T5 Cr ( 9. 9% 9% D J& r- v$ v$ b> L) L) M; j, }> L) N+ v$ 6. {) X! ;] 7> _. 5. S> _o+:o+@ a~ r& r& s; 8> !; #- q# q# H+ }2 }2 Bz.T* !; 8, -' aE q`.q`.Gl+Dz ;y aE Gl++0 p4 Il+ym+3o+tn+4o+5o+6o+jM.=- *- z$ +| 9^ 1: 7o+8o+9o+eq.b) 4> v$ O+ G# O+ % Y% q% a& v$ j& D# h> .; :. ^ / 9% 9% 9% 9% 9% 9% 9% 9% 9% 9% D -+ P^ 0o+}'.xf+ 2+ao+|e+|e+Q9+4[+S]+T'+8E.bo+co+do+i}+jo.eo+=f+wm+K( |4+0f+wm+#3+*f+*f+ba+~g+M7+h5+@O.&!+W1+ba+*f+[b+Fc+=f+=f+Mh+Gc+[b+{4+L7+Jn+Ve+xf y;+=o+-o+cm+2U.fo+8& go+cf y` d) }$ ,@ ,@ ,@ ,@ ,@ ,@ O[ U< A9 P[ h' t, A9 A9 M@ 9. E $& F -& `% L) L) = c% [* >+ x; x; L) .> ;> ;> ^+ ^+ n`.0* ho+", -":* U; r% M+ F b+ H' F-+I' s) H' T) I' J' z! J' J' J' K' y! t, y! y! y! t, y! i' G5 io+'@ <. x b+ }, -} 0B jo+ko+lo+mo+~{ gb ;R =< M^ t{++3+no+oo+[v.j@+~O zl+yb.(Z fQ.fQ.=O V+.r +`V Mr.)O po+EI.qo+ro+{U.so+k8.T9.T9.to+A=+p}+uo+cL.Mr.d% ^, z; `| 2X.2v.Ac s4 [^ vo+-e b+ _ G$ $& n% !$ :* [* %& %& L) b> `% L) [* [* L) `% v$ > k& -! t! `~ -! *> ( wo+xo+yo+'/ P~ <$ U; `% zo+mo c) 2o+sn+Ao+Bo+Co+Do+Eo+Fo+Go+ X> -, O~ i- zo+p= 7% |^ @+ *t.q# &7 *t.X, !; a' F> ,u.H+ *t.*t.@< @+ +0 mo ym+-n+Io+Io+uw.Jo+Ko+Lo+Mo+(* K, A> O> + %& v$ O+ % % p- = <$ j& D# D# 5. 6. 5. / -+ :* t@ u# u# -+ D $& 9% 9% $& -+ ~$ X 5[+io.T'+Qo+Ro+So+ui+To+Uo+Vo+Wo+Xo+Yo+I2+Zo+fJ /R 3!.CP :w.8w.rM 7E.:w.Qn+D,+G|+A=+iR.G|+*g.to+{l+ob.ob.u_+Lm+lI.Hd+0~+ob.Hd+`o+0f+ p+&f+r& g/ >2 5( -o+,2 !; gJ @k <$ ~ _ '$ s% }, 9. r# s% ,@ n=.G5 p! p! p! i' i' t, m, *e >@ 7o 9. F z r% c% |) :* V+ ;+ -& q; L) }> ;> x> 5 5 $& n H{ ", -"%& h& :* :* }> += += += e& Q;+.p++p+@p+#p+Ed $p+=s.}, <$ <$ <$ <$ <$ <$ <$ a^ I= $~ Y_ e% U) j& h> yj %p+&p+*p+lk+h> += h> .; c> ~> i> M^ X( 7# +& m% m% I I I m% m% D$ :& I I :& d+ :& /+ /+ t% `,+=p+-p+;p+>p+,p+'p+)p+!p+8(.~p+{p+iU ]p+^p+/p+(p+_p+Xe.:p+ ~> ~> ~> }> }> h> k& .; j& D# }> :* }> u, &~ n] -* -* L- n] L- O~ X> &~ , &, ;- ;- ;- u, z- z- j& += D# <$ ~> ~> )$ )$ )$ V+ V+ V+ V+ V+ V+ V+ V+ V+ V+ V+ V+ )$ ~> <$ D# D# D# D# += += j& j& j& '$ j& k& k& z- += <$ k& k& k& j& '$ {+ n& n& U) , X> -, +& |- x{ ae 1p+w' H- l& j& > j, k& 4 >t gF.y, +, )$ V+ j, :* [* [* [* j, }> *@ *@ }> }> V+ }> V+ V+ V+ 5 j, V+ V+ V+ V+ V+ }> *@ *@ V+ V+ O! W{ (= W{ (= W{ (= _{ 2p+92+3p+4p+5p+6p+L^ y# ~+ Y_ s. D$ !+ D$ C$ C$ m% !+ I I !+ :& I /+ m% S+ !+ S+ N@ N@ N@ !@ N@ S+ N@ I :& 7# (> ;> c> D# .; .; j& {+ u, )$ *@ *@ )$ )$ )$ )$ )$ )$ ~> ~> )$ ~> n ~> n <$ <$ n <$ <$ n n ~> )$ V+ :* h& [* :* j, V+ j, [* j, }> =! =! 5 }> =! =! ;> ", -"b> j, 5 )$ D# += += += e& e& 7p+8p+9p+0p+ap+Ym n <$ <$ <$ n n e& yf cj+bp+cp+k' dp+ep+fp+gp+hp+ip+jp+kp+lp+}J ~> c> D# {+ c> =! }> mp+np+op+pp+qp+rp+rp+sp+sp+tp+qp+up+vp+wp+xp+ T yp+zp+Ap+Bp+Cp+Dp+Ep+Fp+Gp+Hp+Ip+Jp+Kp+Lp+Mp+Np+Op+*Q Pp+Pp+Mp+Qp+Rp+;U.Sp+UK '$ X+ e& '$ 0^ U+ G$ }> V+ }> 5 V+ V+ 5 :* :* j, j, j, V+ j> V+ }> }> =! ~> ~> =! }> <$ D# :) ~> =! .> j, ~> &, $~ n] n] n] '! $~ $~ $~ &~ 4 &, U+ {+ {+ {+ k& z- j& j& += D# <$ <$ ~> )$ )$ }> }> }> }> }> }> }> }> }> }> V+ V+ V+ )$ ~> c> D# D# D# D# D# += += += j& j& j& j& z- '$ += <$ .; z- k& u, u, {+ n& n& U+ 4 , $~ n] -* ;^ -* |- P~ -* X> {+ j> j, j& -! -! )) /{ z- }> j, j, j, j, j, j> }> }> }> }> }> }> }> }> }> }> }> }> }> j> j> V+ V+ }> }> *@ *@ }> }> e& !+ L- L- Y_ ., mL.Tp+Up+Vp+Wp+Xp+Yp+-, s. e% y# d% d% e% (# e% s. ~+ Y_ Y_ C$ Y_ T+ D$ D$ D$ ff D$ D$ I S+ m% :& ~= :& +& N@ L- N@ (= Zp+}J ~> c> <$ <$ Q> u, *@ *@ *@ *@ )$ )$ )$ )$ )$ )$ ~> )$ )$ )$ ~> ~> ~> n <$ <$ <$ <$ n n <$ <$ )$ }> j, j, j, j, j, j, j, j, }> }> }> }> }> }> }> }> ", -"%& j> ~> '$ '$ '$ += += e& D# Ym `p+fH.)~ <$ <$ <$ <$ <$ <$ += W9. q+.q++q+@q+#q+$q+%q+&q+*q+=q+-q+;q+>q+,q+SB.+= c> c> ~> D# z- D# n Uq.L4 'q+J+ = = = v. )q+!q+~q+{q+]q+^q+8+ v. = /q+(q+_q+:q+ i> )$ <$ D# c> k& z- n }> }> }> }> j> j> .> }> j, j> j, V+ }> }> =! ~> ~> =! }> ~> j& D# }> }> j> j, z- e% -, n] L- O~ -, X> $~ X> , I= U) n& n& U+ {+ u, z- += += D# <$ <$ ~> )$ i> i> }> }> }> }> }> }> V+ V+ V+ V+ j> j> V+ i> ~> ~> D# D# D# D# D# .; += j& j& j& j& j& z- h> j& <$ ~> k& {+ {+ u, u, n& n& n& 4 , '! +& |- |- -* x{ P~ P~ n] e% ~> j, D# |! {+ ;> D# += }> j, j, j, j, }> }> }> }> }> }> ~> }> }> }> }> }> }> }> }> j> j> j> j, }> i> *@ *@ *@ *@ k& Y_ e% n& D# 0q+aq+bq+cq+dq+eq+jb 8, m% Y_ ~+ y# d% e% y# e% e% E$ ~+ ~+ !+ m% D$ ~+ Y_ T+ Y_ ff T+ C$ m% m% I :& +& :& N@ S+ ~= N@ 3! fq+gq+~> c> <$ j& k& )$ *@ )$ )$ )$ )$ )$ )$ )$ ~> ~> ~> )$ )$ )$ ~> ~> n <$ <$ <$ <$ <$ n n <$ <$ <$ ~> }> j, j, j, j, j, i> z- ~> n) hq+iq+s- W) <$ }> ", -":* D# z- k& z- '$ += += e& D# e& D# n D# D# <$ <$ <$ D# d% U8.jq+l@ kq+lq+mq+i- Q} nq+PM.1T.oq+pq+v. 1q+qq+!a.p$+rq+sq+tq+uq+vq+m^.wq+xq+yq+zq+Aq+= = = -@ b2 Bq+Cq+Dq+Eq+Bc+Fq+Gq+v. @q+xR.Hq+Hq+Iq+Jq+Kq+k= 'c+|p.Lq+v. = = -@ Mq+,y Nq+Oq+Pq+Qq+Rq+= v. Sq+Tq+e% }> i> i> i> i> ~> D# j& += += ~> }> j, j, j, }> }> }> j, }> }> }> }> }> ~> =! }> )$ j& D# }> j> j, }> n& X> ff L- L= O~ -, X> $~ E$ , l& 4 U) n& U+ {+ c. k& <$ <$ <$ ~> )$ )$ }> }> }> }> }> V+ V+ V+ V+ V+ V+ V+ j> j> j> j> i> ~> ~> <$ D# D# D# D# D# .; += j& j& j& j& j& j& += c> }> k& Q> c. u, u, {+ n& U) d% E$ O~ +& |- |- +& (= x{ x{ ;^ n] {+ j, ~> w> j& .; h> D# }> j, j, j, }> }> }> }> }> ~> }> }> }> }> }> }> }> }> }> }> .> .> xh+xh+j, .> ~> += k& {+ k& += <$ c> i> *> Uq+Vq+Vp+Wq+Xq+ti T+ y# s. E$ B$ r@ d% d% B$ d% e% s. s. Y_ C$ D$ Y_ s. y# ~+ C$ Y_ Y_ ~+ C$ S+ :& !+ S+ I S+ ~= |- Yq+Zq+`q+)$ c> j& d% n )$ *@ )$ )$ )$ )$ )$ )$ )$ ~> ~> ~> )$ )$ )$ )$ )$ ~> <$ !; x{ J> s#+V, G- 9* S$ !2 L, ]) dE /) r+o .r+d- C; c& P= ^= p h= w$ A* }> ", -"+= '$ c. c. z- z- += += += e& e& <$ <$ <$ <$ <$ <$ <$ d% +r+@r+v. Rq+#r+bE a^ Bc K7+so ko *, lI.$r+=q+v. -@ %r+&r+*r+=r+-r+;r+>r+Ia+,r+'r+)r+(B.!r+= = = =q+~r+{r+]r+^r+/r+B# S= (r+_r+:r+ i> i> i> i> i> i> i> ~> {+ 4 +, ~> }> }> }> }> }> j, }> }> }> }> }> ~> ~> i> )$ .; w> =! j> j, <$ d% Y_ L- L- n] ff ff X> &~ &~ l& l& 4 n& ;- ;- ;- {+ '$ )$ )$ )$ )$ }> }> }> V+ V+ V+ V+ V+ V+ V+ j> j> j> j> j> j> j> j> i> ~> <$ <$ D# D# D# D# D# += j& j& j& j& j& j& j& j& c> }> .; k& k& u, k& u, U+ U) 4 E$ ff H- -* x{ |- ;^ -* ;^ x{ H- l& V+ =! ~> D# j& z- c> }> V+ }> }> }> }> }> }> ~> ~> }> }> }> }> }> }> }> }> }> }> }> }> xh+}> ;> bB 7> E$ z- D# <$ ~> ~> ~> i> )$ 3r+4r+5r+Vq+6r+ff E$ e% e% e% e% e% E$ B$ e% e% d% y# T+ T+ ~+ D$ ff E$ Y_ T+ s. E$ ~+ T+ ff L- I !+ S+ S+ W{ _# Q; 7r+jp+8r+=! .; 4 4 {+ e& <$ )$ )$ )$ )$ )$ )$ )$ ~> ~> ~> ~> )$ )$ )$ )$ ~> <$ b& v# 9r+w$ >; w$ P= `* s# e- Y$ `, a* <; @= {# ^= s# g; ^= >; {; 0r+I- @6 }> ", -"s% += k& c. c. z- '$ += += D# <$ <$ <$ += }, )~ `]+ar+br+cr+v. v. dr+er+fr+gr+hr+ir+jr+kr+lr+mr+nr+or+v. v. Rq+pr+qr+rr+sr+tr+N*+ur+vr+Ym t] wr+xr+= = = =q+yr+K^ y# s. y# B$ d% m% zr+:r+Ar+T+ T+ T+ ~+ Y_ C$ L- I Br+J+ = = 8+ Cr+m% S+ I Y_ h/ Dr+J+ = = v. Er+X:+~> n c> Fr+Gr+Gr+gq+gq+Hr+|n+Ir+Jr+Kr+i> j> xh+j, j, }> }> }> }> }> =! ~> =! )$ D# w> ~> j, j, k& l& ff L= +& H- O~ n] X> &~ &~ e% 4 n& n& ;- ;- n& U+ u, ~> }> }> }> V+ j> j> j> j> j> j> j> j, j, j, j, j> j> j> j, j, j> i> ~> <$ <$ D# D# D# D# D# j& j& j& j& j& j& j& j& j& D# ~> D# j& z- k& k& k& {+ n& &, , -, n] n] |- ae ;^ +& x{ ;^ X> 4 )$ .> }> w> j& j& ~> }> }> }> }> }> }> }> }> }> =! }> }> }> }> }> }> }> j> j> V+ }> c> ^, AR.we+Lr+xe+u, D# c> D# <$ c> =! =! i> Mr+*p+Nr+Or+N@ I T+ y# B$ (# E$ e% (# e% e% e% e% e% E$ B$ E$ D$ E$ T+ Y_ E$ Y_ ~+ ~+ m% m% C$ ~+ D$ D$ D$ S+ (= %Z Pr+Qr+Rr+`) {+ j& D# <$ c> k& k& += D# ~> )$ )$ )$ )$ <) ~> ~> ~> ~> ~> ~> ~> n #; d= d= ^= I@ X% 7 j- >) S; ]) W) ,) Y> #* <; p /# Y* h= h= ^= h= - :e }> ", -"s% e& '$ k& c. z- += += += <$ <$ <$ Sr+Tr+Ur+1j /Q Vr+Wr+v. = v. Xr+Yr+Zr+`r+ s+.s+jX +s+@s+#s+$s+%s+&s+= v. kq+*s+=s+D$ s. T+ T+ d% '$ }> c. -s+= = = =q+;s+e% e% B$ e% y# E$ e% >s+,s+z;+y# T+ E$ Y_ D$ C$ m% I 's+6q+= = 8+ Cr+C$ m% S+ L- )s+!s+~s+= = = {s+]s+'$ @& l `~ Jr+^s+/s+%p+(s+we+_s+:s+ }> }> }> }> j, j, }> }> ~> ~> ~> ~> .; c> j, j, {+ Y_ H- H- -* -* ff ff Y_ X> , n& c. {+ n& ;- ;- ;- U+ {+ ~> j> j> j, j, j, j, j, j, j, j, j, j, j, j, j, j, j, j, j, j, j> )$ ~> <$ D# D# .; j& j& j& j& j& j& j& j& j& j& j& j& D# ~> ~> += j& += j& j& k& u, {+ 4 l& e% , ff H- O~ ff n] '! l& ;- ~> j, }> w> w> D# i> }> }> }> }> }> }> }> }> }> }> }> }> }> .> }> }> }> }> ~> Q> g/ %p+[s+}s+|s+1s+2s+<$ D# ;> ;> D# ;> c> ~> i> lk+Zq+3s+5( +& m% Y_ e% d% e% e% d% d% e% e% B$ B$ s. y# y# s. Y_ T+ T+ Y_ s. Y_ ~+ s. ~+ m% C$ Y_ D$ Y_ ff ~= W{ 4s+5s+6s+7s+~j+Q> ~> =! ~> =! ~> ~> c> .; {+ {+ += )$ )$ )$ )$ )$ ~> ~> n n n n 8s+^= i= v# 9s+0s+as+bs+1$ 0& cs+4= W% .= Y* @= ^= p d= >; Q= d= d= `* @6 }> ", -"}, <$ D# k& u, z- += += += D# D# e& ds+es+fs+gs+hs+is+= = = js+ks+ls+ms+/w ns+-o+os+^r+ps+m}+>* u{+mq = = = Sq+qs+y# y# E$ e% e% d% '$ D# 's+= = = =q+rs+E$ ~+ T+ :& ss+oo s. I ts+q. y# T+ T+ D$ C$ Y_ m% :& 's+6q+= = 8+ us+ff ff I m% L- vs+8+ = = = ws+G$+c. ]r+T= xs+ff Q} ys+zs+As+:s+(s+Bs+Ec ib j& j, }> }> }> }> }> ~> D# j& j& w> ~> ~> ;> ~> j, c> &~ L= -* |- x{ w' |- +& |- L= , ;- u, u, n& n& ;- {+ {+ {+ e& j, j, j, j, j, j, j, j> j, j, j, j, j, j, j, j, j, j, j, j, V+ ~> D# D# D# D# D# j& j& j& j& j& j& j& j& j& j& j& j& D# c> ~> z- j& j& k& ;- e% X> , $~ &~ ;- I= -, ff n] n] $~ &~ l& &, u, c> |! `~ Q> .; }> }> }> }> =! =! }> }> }> }> }> ;> D# D# D# k& E) gy.~) &/+nq+_1+Cs+Wp+Ds+|s+Es+gq+~> ;> ;> ;> ;> D# c> =! i> Fs+Gs+Kn+:& I D$ m% s. B$ y# e% e% E$ E$ e% s. s. T+ y# T+ T+ T+ C$ m% T+ Y_ ~+ E$ Y_ D$ D$ C$ D$ ~+ Y_ m% ~= >! Hs+Is+Js+Ks+Ls+Ms+Ns+Os+j& j& [J oA.gQ.Ps+gQ.<^+ib /s+gy.c> *@ ~> ~> ~> n n n n ]) 1; |> P= X- @* N= Xo >> W+ Qs+Qs+Rs+b; Ss+&= d= p h= I- * ^= p I- @6 }> ", -"}, n <$ '$ u, z- '$ j& += += e& e& Ts+Us+Vs+6j Ws+Xs+= = = Ys+Gm.UK K, y;+Zs+Q; m4 f- }^ `s+,{ , t+= = = v. .t+7# Y_ Y_ Y_ T+ E$ e% a! +t+= = = =q+@t+y# T+ T+ oo #t+$t+Y_ T+ m% D$ e% D$ Y_ s. D$ C$ T+ I 's+6q+= = 8+ Cr+Y_ Y_ D$ D$ L^ %t+kq+= = v. &t+ip+*t+v- =t+-t+e+ 7# ;t+>t+,t+>t+'t+)t+!t+_1+AR.c> j, 5 }> i> h> m& n] P~ ;^ Q~ 4 j& D# D# }> D# &~ L= +< }i mb z>+*K.L, &y a' ~t+-* X> &, I= &, 4 n& n& {+ k& D# D# D# <$ D# D# ~> i> i> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> <$ j& j& j& j& j& z- k& k& k& k& k& k& k& k& k& k& k& k& z- j& j& {+ n& l& '! Q; @6 _G ,^ {t+:e H- Y_ Y_ -* |- ;^ |- -* +& ae +< ;^ zm.3^ L= Z! h> ~> ~> ;> D# D# D# ~> ~> E) -! `! n] A) ;^ }i )/ ]t+yV &D.^t+Wq+/t+(t+(t+_t+:t+Gr+D# D# ;> D# .; .; ;> =! =! )$ ~> n n n n <$ S$ >' v# I- W' D# n& +} 0t+-= && hq+V' =- t- u. e; 9+ at+@6 a- h= bt+s# 4^ j, ", -"G$ n <$ += c. k& '$ '$ += += e& }, ct+dt+et+H0 ft+v. = = = 3q+|3 s% ,U.>] _# -G dl gt+R>+ , gQ.,] ht+= = = = it+bE ff E$ E$ e% T+ Y_ d% jt+= = = =q+@t+e% ~+ s. kt+lt+mt+y# C$ D$ T+ ~+ ~+ s. y# Y_ ff D$ I nt+6q+= = 8+ Cr+D$ Y_ I I N@ ot+J+ = = 1q+pt+qt+rt+l& C. el el st+ - ^{ _s+tt+ut+vt+wt+xt+yt+M] [) 5 }> h> v{ 4^ el -t zt+dl 6! Q; %~ $~ Z! &~ P~ J> {t+At+Bt+Ct+Dt+K) Et+Ft+Gt+Ht+*K.1p+;^ x{ ae Q; L= -, I= {+ {+ I= X> '! -, `! l& l& &~ $~ '! $~ `! $~ n] n] L= L= n] n] L= n] n] L= ;^ x{ P~ ;^ L= L= -* L= n] L= L= L= -* ;^ ,! ;^ (> ae }i s#+u=++y It+Ft+Jt+Kt+Lt+Mt+*K.Z_ 6w.~t+Z_ ~t+1p+@6 &y |( V' Nt+Ot+nE ,^ ae H- $~ &~ $~ Q~ Q~ &~ $~ N~ fq.x] Bt+Pt+Ot+i@+Qt+Z#+J$+Rt+St+Tt+Ut+Vt+Wt+Xt+B=+Yt+(# n& l& $~ Q~ v{ &~ Z! O^ <{ z* |& X& Z_ X& X& X& Zt+X& ~t+~t+*t.~t+X& Zt+z* &7 z* Zt+~t+X& z* `t+Zt+M$ Zt+|& |& u+|& &y z>+&y .u+;} Ht+$%++u+@u+#u+$u+%u+&u+*u+=u+-u+*t.;u+>u+s#+,u+'u+)u+F1.zs+!u+~u+)) ~> ~> <$ n n <$ <$ `' At+j- {u+;- <$ j& k& ,; 0t+a* ]u+B* 4= ^u+&, U+ 6w.}> V+ Kt+h= d= `* 4^ j, ", -"n )$ n n z- k& z- '$ j& += += }, /u+(u+_u+:u+ 4u+8+ = = = 5u+6u+Y_ e% E$ Y_ Y_ Y_ ff +t+= = = =q+7u+!@ xf 8u+9u+1q+0u+Y_ T+ E$ D$ ~+ T+ D$ m% m% S+ C$ m% au+6q+= = 8+ bu+Y_ ~+ m% :& Bp.:r+v. v. @r+cu+du+eu+fu+gu+I hu+el el st+N& iu+ju+ku+dq+dq+ku+lu+dh+[J }> ~> Z! @6 R< }* mu+nu+ou+pu+qu+ru+su+At+!2 `m +y G) tu+uu+nu+%* q, H vu+q* P> wu+9' xu++y a= a= 0/ k@+}i (> x{ A* W& el 0/ Mt+k@+k@+dl 0/ ') 0/ `m el 0o zt+zt+Pt+a= 0o yu+zu+o5 G) Y) -t E>+-t ao ao ao Bt+0/ Au+Bt+0/ yu+G) ao -t 9' qu+Bu+tu+Cu+P> q> Du+|* K= Z- uu+^u+Gt+o5 -t+Eu+** !2 Fu+a= Gu+at+Hu+Iu+}* Ju+Ku+ao +y `m `m ru+0/ Lu+dl Mu+Ct+Nu+Ou+Pu+%* Qu+Ru+Su+Tu+^p.Q6.Uu+Vu+Wu+I&+Xu+i8.K xr zm.p, }( W^ y%+dE +} Eu+Lt+Yu+Zu+`u+R< v+.v++v++v+Gt+@v+@v+#v+Lt+mY.K) +v+K) Fo+Gt+ v+$v+@v+%v+F&+@v+Lt+`u+K) Yu+Yu+8& &v+Eo+*v+{= =v+-v+;v+>v+,v+'v+I> )v+HE.!v+~v+{v+]v+mY.oi ^v+p' /v+(v+_v+:v+ <$ <$ n n <$ <$ z- ae W% W+ += z- k& {+ $* p ^= >; h= ^= }v+U) c. c. j& }> W' h= ^= {; `m j, ", -"`= '$ e& ~> <$ Q> c. z- '$ += += += s% p$+|v+1v+2v+= = = = 3v+4v+5v+6v+7v+8v+/k+({ 9v+_1+0v+`s Y_ av+bv+= = = cv+dv+E$ e% e% Y_ ff Y_ Y_ 's+= = = J+ ev+fv+gv+7q+v. 1q+n*+Y_ T+ ~+ ~+ Y_ D$ C$ Y_ ff C$ T+ m% 's+6q+= = kq+hv+iv+jv+kv+lv+mv+J+ pq+nv+#f+ov+pv+qv+rv+sv+Ms+'c+54 el xu tv+v- Kn+uv+vv+Vp+wv+xv+yv+zv+c> += ,! V' Av+Ku+%, |' Bv+Cv+q> Y, Dv+`' Ev+Fv+ ) Z' Gv+cs+P, &; Hv+,) 8, -$ Iv+Cv+Z- Jv+b= Kv+Kv+Z= W) zt+w^ nE Ct+/) at+v, Lv+2) 1) Mv+Nv+& p% Ov+b= Iu+X) i; Pv+Qv+Rv+nu+Rv+Sv++' a- Z- a- Pv+Iu+Tv+Iu+RC Y, Ou+Uv+at+Ou+nu+Vv+Pv+q, q* ,> 1$ Wv+Qv+!- 8, Xv+Yv+`' $* vu+Pv+Zv+ ) `v+Fo+G) 7X Cu+%* D& C& h; w+.w+ w+i; cs+v, v, Uv+Nv++w+^) ) Tv+2) -:+=$ @w+V> /{ #w+$w+%w+)}+&w+*w+=3 6% =w+-w+;w+f5+V' rm.>) v, >w+A' ,w+'w+)w+!w+>} ~w+cs+Z- {w+q* ]w+^w+!w+/w+(w+Z- _w+:w+]w+q* } q, [w+}w+|w+Z- nu+1w+%* q* q, A. 2w+A. 3w+Wv+4w+5w+/{ ,) 6w+Yv+Z- ^# 7w+8w+9w+0w+aw+bw+K) cw+B*+&7 dw+ew+5s+6s+fw+*N.+= ~> ~> n <$ <$ <$ s#+P- gw+X> ^ += u, N= d= d= d= d= d= m' K+ L, c. z- ~> +v+h= ^= {# V' j, ", -"Bc U) U) U+ '$ u, u, u, z- += += e& D# D# D# y# hw+= = = = iw+jw+kw+lw+mw+nw+2p.xu+ow+:Q.V> k= G@ pw+qw+= = = +q+rw+s. E$ E$ ~+ Y_ E$ s. 's+= = = J+ sw+tw+qD -q+= 1q+wb.Y_ D$ D$ ff +& ff D$ L- m% ~+ ff !+ nt+6q+= = v. uw+vw+ww+uw+kq+= xw+(r+J S+ I 8K.yw+rv+zw+Aw+AR.Bw+Cw+i% f /& B% w' Dw+Ew+bq+ku+*p+M9 |n+{+ #6 Fw+ w+W' -- +; Hv+Cv+Gw+M, Sv+3* Hw+Yv+=- Iw+$* Z= -- !- Ss+l, -- ;= 7 Cv+q= Jw+E= Wv+Pv+A- =$ Z= Kw+2) i; Lw+Iu++' Mw+Nw+Ow+_> q> R* zg.Pw+Qw+s> A- Rw+K= Sw+!, r* ^# Tw+2- Uw+w& Hw+E& ], Vw+2- Ww+Xw+X) i; Yw+Zw+n> `w+Lw+#> x+k- .x+_' +x+.) ,) @x+-- -- bs+Qw+/* $* I# s= #x+wu+wu+U$ `w+v{ -- =$ $x+.' 6w+Zw+%x+as+&x+X) nu+Ow+s> *x+=x+}i -- V% D* G# -- -x+;x+>x+,x+'x+)x+!x+1$ ~x+{x+]x+wu+Z' |* #> #, ,> `w+^x+/x+Ow+q* J) (x+Sw+H r* @; Nw+_x+d. :x+I# Tw+Jw+6* #> Rs+1$ +x+Tw+K= _x+E, 3w+a- 6w+ n <$ <$ <$ X> n- f& 0; /) D& Y> Q= d= d= ^= p h= ^= dx+Z' z- e& <$ $- h= d= 0% ' Kx+-- q% *+ &; -- :. ;+ a& f; a* `- N+ -- G# Lx+&x+ w+Du+I# h; a& a& r& Ww+0; #- a& a& _. q- A- -- >+ V> a& B> #- a& 5. Mx+s; -- T* % O+ P, O+ q% S$ Y> -- q% Nx+8, -- r G> -- 8> G# q% S; 1, -- a& V, -- -- _. 7= -- (x+2- -- B* RC Av+Uw+A- a& -- _. Ox+B> Y% -- 6. b% [x+-- -- N, :; Px+~x+q% -- z$ U$ O+ -- s; q% 4; Qx+=@ 7= q% a& _. Rx+Sx+q* iq+/' N+ -- % $- C; J) >+ -- % N, 9s+T* -- T* G# O+ S; N+ a& R> @* -- -- Kx+a& B- f> a& v$ q= :^+-- /) Rs+-- -- 0; -- -- 4- a& v$ Tx+%= -- ; N+ -- G# l- *+ n- Ux+IZ.`) Vx+Wx+X^ H* 78 v- B% w~ Xx+ax+6s+Yx+Zx+<$ <$ <$ <$ , Av++' c* ]> `x+x& /x+i* ^= v# E* :; Bu+Av+Qs+Z' += n <$ $- h= d= P= {t+j, ", -"s4 d% d% d% d% d% (# d% d% U) y+,t e& e& D# {+ fv+= = = = .y++y+Ms+@y+#y+$y+%y+&y+*y+Yr+=y+-y+;y+>y++q+= = = @r+8E.t% D$ D$ Y_ ~+ y# e% ,y+= = = =q+;s+D$ m% C$ 'y+)y+!y+D$ ff S+ C$ Y_ C$ C$ D$ C$ Y_ T+ m% nt+6q+= = 8+ ~y+6+ {y+]y+v. = v. pq+^y+I m% :& L- dw+pv+/y+(y+_y+e% :y+ P- -- -- W+ ;+ G= f& -- Kt+d. W+ p% -- *+ 2y+B= -- =; !, -- ,- c& *+ -- U% -- N+ Xw+3y+Jw+-; -- +; 4y+-- &; s- -- =; }* -- 0& b% -- T- m@ a& v$ [> v$ -- q- V> -- (, (, -- P, & -- h; 5y+-- q% 6y+V> -- `w+n- -- .) /* -- %, 4= -- q% _' -- -- @w+_x+-- z& n* -- %* :w+Oe.2w+Xv+T- -- `- 4. -- *+ p* -- M> 7y+-- -- -- /' 8y+]' V> -- &; e; O+ -- 9y+:; -- f= Rs+-- C& V, -- 0y++x+ay+.* ;+ -- 1$ N, G# _' G> -- /* *+ -- 5y+f; -- D& B= -- :' p* -- z$ %- -- -- 6- s; -- y- a> -- 2- k, -- &; by+-- -- )' -- -- 6; B- -- v& S; -- B= k, -- b* t- -@.r& u. T* ({ cy+dy+ey+fy+gy+0w B*+>u+,^ hy+pv+qt+iy+v! n ~> n ]) N= w& k, jy+rm.-, ;- b% t- s#+e& += += z- u, d% <$ n n ky+h= d= s# A* V+ ", -"r. r@ d% B$ B$ d% d% B$ e% T+ ly+my+ny+oy++= e& py+Rq+= = = qy+ry+sy+ty+ty+uy+vy+Y_ T+ ~+ /r+wy+xy+yy+v. = = = zy+Ay+By+[p+ms+C]+wr+qf D$ Cy+= = = =q+us+m% m% T+ `i.Dy+s8.D$ D$ ff Y_ E$ s. s. s. s. ~+ C$ D$ au+6q+= = 8+ Ey+L- I Fy+Sq+= = v. Gy+Hy+N@ S+ I +& Iy+sy+ju+jb %p+n& Jy+Ky+|= el el +- Jy+Bs+Ly+My+Ny+/v+w^ /) `w+<' -- $- W* -- -- &+ b* 4- 4= -- b= Oy+Py+K= -- s; ~, hq+-- k, G; -- -- =, -- -- c= -- -- E& @* 5y+9' -- ,) 8- f> n> G- -- G= k- -- *- G& -- 4- I- q% _. I- :. -- 9+ 4- -- G& Y> -- U% 1, -- _. C= -- q% ~, 4- -- !, *- -- Qw+W- -- :. %- -- q% Qy+-- -- Ry+Sy+a& R* s, Y% $* Qu+X) Rx+7y+8, -- w& A= -- V> b; -- 6. 5- -- -- -:+_> W- %- M> -- r ~, O+ -- 4= o@ -- Ty+^# -- #- v& -- %, L; 6- >' -- -- C= vu+f> Py+^ -- 0; !; -- Gw+n- -- E& q- -- 2- 4= -- % a* -- -- g* n- -- Uy+f= -- K= S; -- & )' -- -- Vy+-- -- D= :^+-- I# .) -- `- p% -- .) Wy+r* a& bs+%, 7= Xy+Yy+Zy+`y+~u+>;.O@ el -t+ u+ z+Up+Vq+.z+F|+n <$ W; H> (, 2) l& +z+z- e& Y) e% e& j& c. u, Y_ u, += n <$ n ky+h= d= /# H- <$ ", -":& d% B$ e% B$ B$ e% e% E$ #y.@z+#z+$z+%z+/B.U) &z+@r+= = = 5u+'>+*z+=z+r3+D) C$ T+ E$ (# d% e% D$ 8: = = = J+ -z+;z+>z+,z+'z+)z+^B.!z+~z+p~.= = = =q+{z+T+ T+ D$ |- ]z+oo C$ I +& f5+)= ff ~+ s. Y_ C$ D$ m% 's+6q+= = 8+ Cr+C$ D$ 7# ^z+&s+= = = /z+/o+:& :& :& L- (z+_z+:z+(s+*t+^, @& u+-t+0w U) 8v. ! y> l& Lu+>) r+B* -- $- W* -- -- F; K= ^ m- -- I# Oy+by+6* -- s; /# B= -- k, 6 -- -- W% -- -- ^ T- :. _> @x+[z+f= -- Z' |> }z+|z+`- -- $- d& -- a% P- -- 4- I- q% _. I- :. -- 7 a> -- G& Y> -- 1z+4. -- _. 5- -- q% [$ a> -- P- a% -- Qw+W- -- :. d- -- q% F; -- -- 0= 6 !; 0& 2z+^ Rs+3z+6* Hw+7y+8, -- w& !, -- !; L; -- += 4z+-- -- 5z+d. q= $x+B- -- o@ /# O+ -- 4= p@ -- f= w& -- Y% T- _. M= 6z+>' 7y+-- -- 7z+>> D= Wy+6. -- @w+!; -- E= r; -- _x+q- -- F) 4= -- % &+ -- -- 9= n- -- |> f= -- 4y+%; -- B= I@ -- -- W% -- -- 8z+:^+-- v& /' -- `- p% -- <' }z+9z+-- ^# O+ Kt+0z+x7.az+$6+bz+cz+B# dz+/= -t+^- ~u+lu+Qr+ez+d) ~> R< fz+c& q, e& d% ;- u, :' += += += ru+gz+`$ Sw+E$ n ~> )$ ky+h= d= y$ L- '$ ", -"q. e% e% e% e% B$ e% e% hz+iz+jz+kz+lz+{j n;.mz+l4 nz+= = = 8+ oz+pz+8K.L- !+ m% D$ ~+ Y_ s. y# !@ VB = = v. qz+w>+rz+sz+tz+uz+vz+Fp+wz+Bp+xz+= = = =q+yz+`,+Kq+D$ D$ C$ T+ Y_ D$ %h zz+Az+s. s. E$ ~+ T+ C$ I 's+6q+= = 8+ Bz+Y_ ~+ T+ -q #q+= = = J+ Cz+`n.m% D$ ff I Yl+Ps+}J K> c> =! D# @& Dz+Ez+]r+:# D# )$ D# l& l@+`' %i.P, -- $- $> -- -- =, )> Y% k, -- }) Hv+7y+p* -- 8, `x+V, -- 0& D* -- -- $= -- -- K+ P, -; A= m@ Fz+f= -- >) &+ -; vu+G- -- $- 4j.-- *- .r+-- 4- g; q% _. g; :. -- W- 4- -- z& x+-- X% 6- -- _. H> -- q% :> a> -- A= a% -- U% +* -- :. %- -- q% =, -- -- q 0= D& s; r, C& Ox+Gw+Wv+{x+@w+8, -- _> /x+-- V> 1' -- 6. Gz+-- -- C; .r+ r+l' M= -- 4y+Hz+O+ -- )> v& -- b* ,; -- r, 8- S$ .) )> @* 7y+-- -- `, k- -; t- 6. -- 1' !; -- #* n- -- m- c= -- 6* L; -- % o -- -- 3- r, -- $> }m+-- I# <' -- +' u. -- -- Sy+-- -- Uy+-$ -- 4y+.) -- +' ; -- P, b& Iz+N+ S$ -- l, zg.Jz+V' Kz+Q} yj bB U+ (& ^& >u+ - cz+ez+3r+oA.<$ ]) Lz+v# .% ~t+e& e& ; J) += += U+ Mz+Nz+Oz+^= ) ~> )$ )$ Ht+Sy+Pz+Qz+n& ;- ", -"q. e% B$ B$ e% e% e% e% '9+Rz+Sz+Tz+Uz+Vz+xq+1}.Wz+]0 Xz+v. = v. Yz+|m+Y_ C$ ff Y_ s. E$ E$ E$ (# h`.1q+= = 5q+Zz+Y_ E$ E$ y# T+ u5 `z+[q+ A+.A+= = = kq+/+.xq.+A+@A+N*+Hq+Yt+t% D$ #A+y' $A+~+ D$ D$ ~+ T+ C$ I %A+6q+= = 8+ Cr+Y_ D$ m% D$ )E.&A+v. = = 8+ Mq+`t+I !+ !+ L- Y_ u, ~> =! i> }> ~> G$ )~ c. j& .; c> c> 7> p, *A+Mw+=A+-- ;= q' -- -- )' e; 5. z$ a& Sw+-A+Tw+nu+-- 8, M- p% -- ;' o; -- -- a* O+ -- t- -- a& X% Gw+Tw+ky+-- S; 7y+-- D& p* -- f= 6w+-- F= ,; -- V> m' q% :. ;A+^ -- >A+!; -- d& '; -- v& P- -- :. )> -- q% F- !; -- y- r; -- r x& -- :. 4= -- a& 8- -- -- o; j- d& Y% O+ r, Pz+Xw+Qu+zg.7y+r& -- Nw+G& -- 8> q- -- r& Lz+-- -- l' *i.,A+Gw+a> -- 2- M- O+ -- 7 2- -- R< @; -- =; 'A+-- r& m@ Ww+)A+O+ -- Hv+/' q% 1' h; -- (x+C& -- c= 7= -- =$ A= -- /* W- -- % t- -- -- }z+f; -- q F= -- 6* P, -- ; c* -- -- o -- -- && 9' -- #> S; -- U$ (, -- ^u+Ss+Ss++; z$ -- a- $* ,w+!A+1p+L- U+ ;> c> D# (# 2+ ~A+5# w> c> E) ;- =- f& ~, g; 0/ D# e& (x+6w++= '$ 8' b0 Nz+d= d= ^) j& c. n& Kt+7z+Ht++& U) ;- ", -"'3 e% e% e% y# y# y# e% {A+]A+^A+RX =r+/A+(A+uq+_A+:A+r+5A+6A+7A+@A+8A+9A+0A+Zz+y# y# T+ y# y# T+ m% aA+J+ = = kq+bA+T+ ~+ D$ T+ T+ cA+dA+= = = 1q+eA+I ff L- ff D$ Y_ ;- n i> i> ~> c> c> c> c> c> c> c> Q> fq.Jt+F) :' -- v$ T* -- z$ bs+R; fA+-- )$ +x+3y+gA+cs+-- >+ 8= H; -- Ku+Mz+-- -- C; B> -- V> -- T- Xw+Hw+Ow+#, a& v$ C& q% _x+zg.a& z$ *+ -- r* X% -- 8> hA+q% 6. q 6. -- iA+C& -- r o@ -- /* d& -- ^ _' Y% -- 7= G# -- E& 7= -- r* ,; -- 6. @* -- a& Py+Y% -- /* {u+by+O+ -- -; Qs+-- h; .* )A+!- -- A- W+ q% % 8, -- /' x& -- -- jA+Zw+Z- *i.T* -- O= >' G# -- E= U]+-- f> kA+G# O+ %, -- Lx+B; Nw+Rw+f; -- 8> z$ !- #= G= -- 8, % O+ I@ *K.-- r* Ow+-- c+ .* -- Y% L; -- -- i* B- -- u. +; -- `- =- -- 6. l- -- -- H> -- -- Y= N, -- X) %= -- =- s, -- a> `w+lA+Kv+-- -- >$ mA+W) G&+w' ;* N@ 4 D# c> c> += :# {+ z- D# k& 4 2z+d. 1; [$ Y) <$ '$ K+ s- += += W) dx+Nz+d= d= >) U) X_ U) ]u+p i* L- U) ;- ", -":& (# y# nA+oA+H@ E$ T+ E$ T+ pA+%z+qA+rA+sA+tA+uA+vA+wA+xA+bv+v. v. yA+mp+Y_ Y_ ff Y_ e% B$ I zA+dA+v. lt+AA+`t+E$ E$ e% e% y# e% E$ E$ ~+ m% BA+= = = = CA+$d.DA+HS.EA+FA+GA+HA+Y>.0A+&s+IA+`z+ c> ;> c> <$ c> ~> ~> h> (> +y >w+]u+M= %= p% r, /* C= q- B> -- ae }) 4* q, Rx+F= {t+{t+b= M> <' (x+{t+{t+Tw+d. :; G> N, 4* NA+P> Sv+J) A' f; At+U$ 4. +* Rv+r; 7= &; 7z+2- T* a= OA+{t+8' @w+r; /U E& Y) B- 2- PA+M= X) r T* *- bs+QA+7= U$ |' =; X% Lx+M> p* 8= B- a% z& G> =; RA+X' G> B- #* `w+>+ -- cs+Lz+N+ {t+Ow+Xw+*- #- q, Lz+A- B> f; ,) @w+Qw+a> ae s> T' ]) RC cs+f; a' Av+At+L, SA+`- TA+z#.UA+VA+WA+XA+YA+ZA+/w+`A+]w+ B+W' L, ;= Xw+>' +x+}v+=; G) 3z+RA+:^+B- q, r T* V, _x+M> f; q= *K.M> @w+Bu+T* @* .B+M> V% 9+ f= +; n> f; Kx+(x+G> B- 7 :; G> /* X' G> cs+U- F= M> +B+7y+&; -- a& 3z+!w+K) &y N@ w' |- +& Y_ k& ;> D# .; .; D# D# D# D# Gu+W+ 6; q l@+<$ k& Ss+J) += c. Kv+d= J- J- J- @B+r@ (# X_ ph.p V* Y) n& n& ", -"#B+L>+$B+%B+&B+*B+y# E$ E$ y# H@ =B+-B+;B+>B+,B+'B+o@+%! )B+!B+]q+~B+v. jq+{B+Jz N@ I N@ ]B+^B+lt+l@ /B+Zg+N@ E$ E$ Y_ E$ E$ ff D$ D$ ^- (B+_B+|r+= = = = J+ :B+3f.l=+0u+ ~> ~> ~> c> ~> ~> ~> ;> !) mb E>+P> 1$ {x+3z+$* Ow+$* 4e 5. -, *& 6* Z' wu+0B+q* J) Cv+E* E& Hw+ug.Hw+J) 1$ J) m- Cv+1$ RC 2z+R< @v+aB+X) bB+Iw+5* Hu+t> I# Hw+Wv+iq+I# H Rx+cB+Uw+Du+H Uw+Qu+Vw+6w+Wv+8= Iw+|* Iw+|* K= =$ .x+vu+E* 4j.Ow+_> ay+Nw+Nw+dB+Qu+vu+1z+Qw+Cv+{x+Ow+eB+E* Nw+Ow+`w+;+ 6. f; Rw+8s+T* Oe.~w+1w+^w+F) R= A. 8= {x+fB+3z+gB+F) q* RC hB+Bt+el Bu+Av+r* iB+jB+Mw+kB+lB+mB+nB+i/.oB+pB+qB+rB+2* sB+tB+W uB+RC I# 6w+vB+j= (w+R= wB+Nw+xB+Cv+1$ eB+Hw+Rx+yB+6w+,v+Rx+zB+AB+BB+AB+E* I# CB+eB+H 6w+E* DB+EB+Xw+}) FB+GB+zg.Ow+3z+Vw+3w+Nw+3z+_x+Ow+$* _x+E* SA+fB+N T+ E$ e% e% d% vr+xq+PB+QB+,B+ZN (# t% RB+SB+TB+UB+VB+WB+5q+XB+YB+ZB+`B+ C+0A+8B+.C+%t.T+ E$ ~+ Y_ T+ y# E$ E$ T+ Y_ +C+@C+#C+$C+%C+%C+%C+%C+%C+%C+&C+*C+=C+Gy+2. +q++q++q+2. -C+;C+>C+,C+'C+)C+&C+!C+7q+~C+~C+{C+]C+^C+/C+Dy+(C+:& D$ ff D$ _C+:r+1r+:C+%C+ }> i> =! ~> ~> ~> c> |! v{ ;> D# D# D# v+-* Ot+v> 9' 4 e% Sw+Nw+M^ T+ EC+w$ J- J- J- cs+|- e% d% &v+p d= 3z+X_ d% ", -"FC+GC+HC+IC+JC+KC+@A+d% 4 U) 9! ~> DZ.LC+MC+NC+p$+T+ K^ {A+`,+{r+OC+C..PC+QC+`B ^q+-@ 5u+RC+SC+,D Y_ s. E$ D$ ff Y_ Y_ C$ E$ E$ L- L- ;} TC+TC+kS ]B+]B+]B+UC+b)+B!+u!+-$ VC+WC+XC+_1 o.WC+_1 54 T+ t% }> i> ~> ~> c> c> Q> l& (> p' *K.!A+/= Ht+*D+=D+tB+8C+Gt+/= z* p= }i &| !2 -G G&+-G ,u.z>+X= X= 8X.F* X= *K.&y J> '! l& , n] >^ X& z* :e w' 6w.A* ,^ {t+a' Z_ :e :e J> >^ J> :e }i @6 s#+A* s#+mb @6 @6 s#+A* @6 s#+s#+Z_ ,^ _G L, !2 !2 L, /U /U a' ,^ L, L, !2 -G -G X= -G !A+EC+%v+iC+W) Kw+i@+mY.-D+EC+W& X= X= u=+X= X= hu+/= vC+;} hu+At+&| P~ $~ 4 n& ., H, 8^ lW.;D+>D+,D+'D+'D+)D+!D+P@+~D+/= }%.m}+f- Zt+;* ;* u+u=+u=+-G |8 &| u+X= -G -G u=+z>+X= 9x+-G -G W& -G W& W& Fu+W& !A+st+u=+u=+X= z>+.u+hu+W& Fu+!A++q +q V& -t+Kx+mb /U -G /= vC+W& Fu+!A+Fu+hu+/= o5 Lt+&* {D+{= &v+3C+m}+_# :& N@ |- L- +& |- (= 7# w' Y_ j& ~> ~> ;> <$ 4 |! RC 1; o5 ~+ T+ Zv+.* Y_ E$ Y_ 5' d= d= X- 9' Y_ d% d% z>+&= J- E= U) 4 ", -"cc.]D+^D+D;.D;.ey /D+U) U) {+ ~> }> }> (D+_D+:D++sh.6D+ A+,z+EA+'C+Bp+7D+)z+.N.sz+^y Jy+wr+qf 5# 5# T+ m% Y_ Y_ ff Y_ E$ E$ T+ E$ Y_ ff ff E$ c. }> }> }> i> =! =! ~> D# j& u, {+ Y_ (= 1p+@< z>+m}+m}+&| w' L- E$ E$ Y_ ff !+ L- L- L- L- L- L- ff ff ff ff ff E$ c. j& j& k& {+ 4 I= &, U+ {+ U) d% I= I= n& u, ;- u, {+ ;- {+ {+ n& n& ;- ;- ;- ;- n& 4 4 4 I= &, n& &, 4 &~ &~ &~ &~ , l& l& l& , Y_ L- L- L- S+ +& |- !@ Z_ *K.-G u=+@- z* z* ~t+w' (= W{ |- |- :& (= w' 1p+7# w' H- n& k& .; D# ~> <$ D# o' 8D+9D+0D+aD+bD+bD+cD+dD+zm.!@ w' |- !+ I :& L- m% m% m% I +& !+ Y_ +& :& +& L- +& L- S+ (= (= (= eD+!@ w' |- |- |- N@ |- W{ W{ |- |- (= w' (= w' w' ;* ;* 1p+x{ I= -! $~ (= 7# (= W{ (= (= ~= w' eD+;* &| .u+vC+/= hu+&y 1p+I I +& I L- +& ff L- |- w' |- ff U+ ~> ~> ~> D# ;^ w& Ow+1p+Y_ Y_ Y_ b; Jv+x{ E$ X& a- Z- V' ~+ e% d% d% d% Wv+0= ; U) U) ", -"fD+2c gD+hD+T{.iD+jD+Q;+{+ ~> }> }> ~> {+ kD+lD+mD+C+wD+xD+yD+zD+AD+Jq+wr+qf qf N^ e% d% e% E$ E$ ~+ L- m% D$ L- D$ U) )$ }> }> i> i> i> i> }> }> }> K> m& C$ ff S+ ~= +& D$ E$ B$ d% d% r@ r@ x# r@ d% (# d% d% d% e% e% e% e% e% e% U+ += j& j& j& j& z- j& j& j& j& j& += <$ )$ )$ )$ )$ ~> ~> ~> ~> ~> ~> )$ )$ )$ )$ )$ )$ D# D# += D# D# D# j& k& k& k& k& k& k& j& j& z- d% (# (# B$ e% (# d% B$ E$ m% ff ff ~+ Y_ C$ E$ Y_ Y_ Y_ Y_ ff ff m% m% L- L- ff z- c> c> c> c> ~> i> }> 0q+ez+5r+BD+*z+fu+CD+pZ.q. !+ L- L- ~+ ff ff ff I !+ m% y# E$ s. e% E$ Y_ Y_ E$ d% e% d% T+ Y_ E$ T+ ff ff ~+ D$ Y_ E$ Y_ Y_ ff Y_ m% C$ ~+ Y_ C$ Y_ E$ D$ m% m% U) )$ c> U) T+ Y_ E$ ff ff ff E$ Y_ Y_ Y_ !+ (= 7# w' 1p+!@ +& !+ L- ff Y_ ff |- I I +& W{ |- :& L- U+ ~> ~> h> H, m@ el {+ E$ E$ E$ /= u@ DD+E$ ff Y_ (# E$ -, Y_ (# e% (# d% v+2y+&, U) ", -"Db.Wz+>z+ED+ap+FD+GD+HD+D# }> }> j& d% d% e% [q+>z+ID+N*+JD+KD+LD+Gy+Ys+MD+ND+:r+bv+)q+!C+OD+PD+QD+:X (= D$ Y_ ff D$ RD+SD+TD+T+ L- I m% m% ff Y_ /f+Yx+UD+:s+:z+VD+WD+ju+9r H- L- m% C$ m% ~= :& S+ I m% !+ C$ m% I C$ D$ C$ C$ C$ D$ T+ D$ Yt+sh.XD+ A+>r+b}.YD+;C+)z+0C.ZD+ms+ }> }> *> ! |a+`D+ E+.E++E+-, E$ E$ T+ s. d% d% d% r@ x# U) U) x# r@ d% e% d% d% d% (# e% B$ e% e% e% d% j& j& j& j& j& '$ j& j& j& += D# )$ )$ )$ )$ )$ )$ ~> )$ )$ )$ )$ )$ )$ )$ ~> )$ )$ )$ )$ n <$ D# += j& k& k& k& k& z- z- z- j& j& {+ e% e% (# e% e% d% d% d% d% d% d% r@ U) d% B$ e% e% E$ E$ Y_ Y_ ff L- !+ L- ff e% D# c> c> c> ~> i> i> i> gq+@E+vt+Vp+#E+6r+H- :& :& +& ff Y_ C$ m% D$ C$ I L- m% D$ T+ e% e% E$ y# y# E$ e% s. e% T+ Y_ E$ ~+ C$ D$ Y_ ff D$ E$ C$ m% m% C$ :& |- ff ff L- C$ ff L- L- e% c> ~> D# E$ ff Y_ ~+ Y_ Y_ T+ Y_ Y_ Y_ T+ m% m% Y_ !+ :& L- I I S+ m% I S+ +& ~= :& N@ L- I +& T+ T+ d% D# n& Mt+2y+mu+l& n] M^ (= (= ]v+2) s#+E$ Y_ +& R< AB+1p+L- |- N@ +& V' Rx+d% 4 ", -"m% $E+%E+&E+*E+=E+YD+-E+*@ }> '$ U) x# x# d% (# ;E+lD+>E+,E+1r+'E+)E+m%+@k !E+]z+~E+:r+v. v. = 8+ {E+]E+'f.^E+/E+(E+_E+Sq+:E+L- +& +& S+ I H, E+2E+xq+>r+3E+4E+xq.3K.5E+Iq+Jq+qf y# C$ D$ Y_ T+ E$ E$ l& {+ gq+=T.8r+:t+Rr+6E+xt+7E+@y+8E+s. e% e% B$ d% d% d% d% r@ d% d% e% B$ e% e% e% e% B$ e% e% e% y# e% e% e% c. j& j& j& j& j& j& j& e& n )$ )$ )$ ~> )$ )$ )$ )$ )$ )$ )$ )$ )$ i> ~> ~> ~> ~> )$ ~> )$ ~> D# z- z- k& k& k& k& '$ z- '$ j& += U) E$ E$ e% e% e% (# (# (# (# x# U) U) x# d% e% e% e% e% E$ Y_ Y_ Y_ ff L- L- D$ c. ~> ~> c> c> ~> i> }> i> 3r+xt+Nr+9E+0E+L- :& :& ~= ~= I D$ m% Y_ E$ D$ I m% ff ff Y_ e% e% e% B$ e% E$ Y_ s. s. s. e% y# ~+ D$ Y_ ff !+ ff Y_ ~+ Y_ ~+ C$ L- I I m% Y_ Y_ !+ ff E$ z- }> ~> j& Y_ ff T+ D$ ff Y_ E$ D$ D$ Y_ Y_ !+ m% C$ D$ :& +& m% m% !+ ff S+ +& S+ +& |- !@ :& +& L- m% +& L- Y_ }v+G- 8= o; <; Ry+<; G; aE+G& X- Uy+2y+by+&& {; q .= $> K; K; }z+j- Z' l& I= ", -"m% bE+cE+dE+eE+fE+bU gE+hE+U) d% r@ e% d% d% d% (# bg.iE+V{.{n.Gu (# e% e% e% d% (& jE+kE+&s+v. = v. v. J+ pq+lE++q+v. 8q+y= I I L- !+ D) mE+Nr+wv+ku+!t+xe+'$ }> -> 0q+[E+Ms+L= :& N@ ~= D$ !+ S+ I I !+ L- !+ ~+ L- L- m% D$ C$ ~+ Y_ D$ ~+ D$ L- !+ m% m% Y_ y# T+ t% ur+3K.tz+2E+nE+7D+)z+[q++A+=p+Dz+Kq+D$ T+ y# y# T+ ff Aj+oE+!t+oE+Es+pE+qE+rE+5r+sE+Aj+y# e% e% B$ d% d% (# (# d% d% e% e% e% e% y# E$ e% y# E$ e% e% E$ E$ E$ U) j& += j& j& j& e& ~> )$ )$ )$ )$ ~> ~> )$ )$ )$ )$ )$ )$ )$ i> =! *@ )$ ~> ~> ~> ~> ~> )$ )$ )$ += '$ k& k& z- z- z- '$ j& j& k& e% s. y# e% B$ (# d% d% d% x# U) U) U) U) U) d% d% (# e% s. T+ Y_ E$ ~+ ff D$ n& ~> ~> ~> ~> c> =! i> }> N/ tE+^t+[t+H, ff m% !+ C$ !+ m% C$ D$ ~+ e% B$ E$ T+ E$ E$ E$ e% e% E$ E$ e% Y_ ff D$ D$ D$ D$ ~+ D$ C$ Y_ Y_ L- I ff ff ff C$ ~+ m% ~= L- +& :& I L- L- !+ U) i> i> c> ;- S+ ff Y_ ff !+ C$ C$ C$ C$ Y_ D$ !+ D$ m% !+ :& I I L- Y_ C$ D$ !+ !+ L- +& ~= N@ +& Y_ ff m% ff Y_ |- ~( uE+vE+wE+xE+yE+zE+N= 6y+M- (x+xB+A= *; >; F- X- J- p h= J- d= AE+e% e% ", -"m% 7D+cE+kD+oy+BE+CE+;*. A+(# d% d% d% d% d% d% x# {A+uz+DE+|v+Kq+E$ (# e% E$ e% e% Y_ %% 8: -q+v. = = = = = v. lE+Wl.I N@ !@ L- Qm+EE+Vp+Vp+Nr+Xp+FE+N/ '$ ~> i> }> }> =! u, I I :& m% I C$ I !+ D$ !+ m% D$ ~+ m% D$ y# ~+ T+ T+ T+ Y_ ~+ s. ~+ T+ y# y# e% e% e% (# e% y# y# Iq+^y By+GE+tz+HE+3B+IE+JE+ur+Kq+C] H@ T+ y# $~ KE+sE+LE+UD+qE+ME+xv+7E+M9 `! l& (# d% r@ r@ d% d% r@ d% d% d% d% e% e% y# e% e% e% e% s. E$ E$ E$ I= '$ j& j& += D# *@ }> *@ )$ )$ ~> )$ )$ )$ *@ ~> ~> D# <$ .; [J }c+n' <$ ~> ~> i> i> )$ )$ )$ *@ )$ <$ j& z- z- k& '$ j& j& j& U) E$ ~+ E$ y# e% B$ E$ e% d% d% d% x# U) U) r@ (# E$ E$ E$ E$ Y_ t4 D$ Y_ Y_ :# ~> ~> i> i> =! i> }> }> }> Fr+Tp+NE+I L- L- m% D$ D$ I I L- ff ~+ r@ s. T+ E$ T+ Y_ E$ e% y# E$ e% e% e% T+ E$ T+ Y_ ~+ D$ y# D$ E$ ff S+ ff ff ff !+ S+ L- I L- !+ I S+ L- L- ff e% D# }> )$ ;> U) Y_ ~+ ff L- ff Y_ ff L- !+ C$ L- :& I L- S+ m% !+ I I Y_ ff !+ !+ !+ S+ |- +& |- +& L- L- ff Y_ E$ (= p, A%+A[+OE+PE+QE+RE+H> 3- v# Ow+b= 4= R, *; ]> 0% w$ SE+F- @= - u. I= e% ", -" < TE+qA+#9+UK UE+VE+WE+lD+,t d% U) d% d% U) d% d% e% qf XE+YE+kD+wr+x# B$ d% d% (# e% x# N@ ZE+a1 |A+v. = = v. @r+`E+(= m% +& S+ F+pz+ty+Vp+kp+M9 .F+dg+i> c. += =! i> i> }> i> d% I m% !+ ff L- I ff m% I m% C$ I I m% T+ Y_ Y_ ~+ D$ L- m% ~+ !+ m% E$ ~+ D$ E$ E$ s. y# y# ~+ T+ T+ T+ Y_ D$ `,+=p++A+By++F+@F+#F+,t Yt+,{ y# T+ -, !T.$F+%F+LE+vt+vt+Es+}y+., d% r@ x# r@ d% U) U) U) d% d% d% (# (# B$ e% e% e% e% E$ E$ E$ E$ y# U+ j& e& <$ }> }> }> )$ )$ ~> ~> n ~> e& D# u, U) e% Z! yj Ms+zv+&F+G9.t).)) h> D# ~> *@ )$ *@ i> i> i> D# j& z- '$ += += '$ e% E$ E$ Y_ E$ E$ e% e% e% d% d% d% U) U) U) U) d% e% e% E$ E$ E$ Y_ ff '! U+ ~> )$ ~> i> i> }> }> }> }> D# ., O~ m% Y_ T+ Y_ E$ E$ E$ C$ ff m% C$ Y_ T+ s. e% e% E$ E$ E$ Y_ E$ Y_ e% s. E$ E$ ~+ C$ m% Y_ C$ s. s. s. C$ m% D$ ff I I +& I S+ m% S+ :& +& ~= +& t4 z- }> i> ~> j& j& k& &~ ff S+ C$ Y_ E$ ff ff ff I I S+ !+ I Y_ I +& m% m% !+ I L- I I L- D$ !+ I m% ff Y_ e% e% X& ** a= *F+=F+-F+;F+>F+,F+@w+DB+aC+Eu+Kx+1p+Y) z= V' X& d% d% E$ X& (= d% d% ", -"D$ 3B+$p+H*+o@+:# UK 'F+)F+:q+r@ e% d% B$ B$ e% (# B$ e% Hq+YE+:D+#9+ y+x# d% s. E$ y# y# m% I ,y zA+!F+~F+{F+7I ]F+^F+'3 ~= ;^ /F+fu+(F+vv+_F+:F+Q> j& c> i> j& z- ~> =! =! }> }> }> d% Y_ !+ D$ m% D$ T+ ff m% D$ T+ C$ ~+ D$ T+ B$ (# (# E$ ~+ T+ E$ s. E$ y# s. y# ~+ s. y# B$ D$ Y_ T+ ~+ Y_ ff T+ D$ ~+ E$ y# D$ ,{ eE+N*+ms+`z+rz+`,+g- G@ v{ )$ }> *@ *@ n n <$ z- ;- z- .; ~> D# j& w! /s+}F+|F+Zx+%p+Hx+zs+Ls+Aj+AR.~j+o' '$ D# ~> )$ }> )$ <$ += j& j& += U+ E$ `= T+ ~+ T+ E$ y# e% e% d% d% x# U) U) U) U) U) d% d% e% e% e% E$ X> U) ~> ~> ~> }> }> }> }> }> e& d% Y_ D$ r. !+ C$ Y_ C$ E$ Y_ Y_ ~+ m% I +& m% I Y_ e% E$ E$ y# T+ C$ Y_ e% E$ s. E$ s. D$ m% Y_ D$ ~+ T+ E$ T+ ff Y_ ~+ C$ I C$ C$ L- ff D$ m% N@ +& I !+ E$ ~> i> ~> ~> u, j& i> += E$ +& m% L- m% ff m% ~= +& I L- ff L- C$ L- S+ m% ff m% !+ m% L- ff C$ ff L- I I m% ff e% E$ w' X= Z' Mt+ru+TV 1F+2F+3F+|E+4 L- @< z>+Kw+xu+&| 1p+L- U) U) U) &, d% d% d% ", -".0 IE+4F+5F+ y+U) x# p$+6F+7F+wr+e% U) e% r@ U) e% e% d% B$ }p+Dp+m^.8F+ y+d% d% U) B$ E$ Y_ D$ L- T+ ;& XN _B dU 9F+0F+aF+bF+cF+fu+dF+/y+ez+Y! R>+eE+Z% }> ~> u, U+ ~> ~> ~> ~> i> }> ~> z{ m% !+ !+ I L- ~= S+ L- C$ C$ Y_ D$ E$ s. T+ ~+ ~+ ff m% C$ D$ m% ~+ s. ~+ T+ y# T+ ~+ ~+ y# D$ ff ~+ Y_ Y_ ff y# ~+ E$ Y_ (# d% Y_ T+ T+ qf t% Yt+Yt+{A+P^ 2v.7t+eF+fF+gF+Jr+d% d% r@ d% d% U) U) U) U) x# U) d% B$ x# x# B$ (# e% E$ T+ s. E$ Y_ e% <$ *@ ~> D# c. ;- n& '$ ~> ~> <$ }> }> }> }> 8v.hF+iF+M9 jF+3u+Uq+kF+LE+4r+Rr+lF+Rr+.F+6t+^s+mF+h/ {+ n )$ )$ e& += += &, E$ Y_ `= E$ y# E$ e% e% e% (# d% r@ x# U) U) U) U) U) d% d% O^ d% e% d% D# i> i> }> }> }> }> D# &, E$ D$ C$ E$ T+ ~+ E$ y# e% e% e% e% e% e% y# E$ E$ E$ e% B$ (# e% B$ y# s. E$ d% E$ C$ Y_ ff I S+ T+ C$ ff Y_ C$ C$ !+ m% Y_ S+ S+ S+ m% ~= S+ :& +& :& :& :& +& k& }> ~> c> c> U+ D# ~> i> += e% L- S+ (= m% +& ~= I !+ I L- ff L- I +& ff L- S+ D$ Y_ ff Y_ E$ Y_ C$ D$ L- m% C$ Y_ Y_ E$ e% Y_ E$ E$ '! *N.lp+nF+oF+gy.U+ U) d% e% B$ (# d% d% X_ U) X_ d% d% d% d% "}; diff --git a/setup/linux/setup_image/setup.sh.in b/setup/linux/setup_image/setup.sh.in deleted file mode 100644 index a6ec1187..00000000 --- a/setup/linux/setup_image/setup.sh.in +++ /dev/null @@ -1,276 +0,0 @@ -dnl `uname -m` quoting is a nightmare -dnl TTimo: You could do: `uname -a` -changequote([[, ]]) - -#! /bin/sh -# -# Product setup script -# -# TTimo - run in fink environement -# I am not entirely sure this is needed -# but in any case, it doesn't hurt -ifdef([[M4_OSX]], [[source /sw/bin/init.sh]]) -# Go to the proper setup directory (if not already there) -cd `dirname $0` - -# defaults -FATAL_ERROR="Fatal error, no tech support email configured in this setup" -# try to get root prior to running setup? -# 0: no -# 1: prompt, but run anyway if fails -# 2: require, abort if root fails -GET_ROOT=0 -XSU_ICON="" -# You may want to set USE_XHOST to 1 if you want an X11 application to -# be launched with root privileges right after installation -USE_XHOST=0 -# this is the message for su call, printf -SU_MESSAGE="You need to run this installation as the super user.\nPlease enter the root password." - -NULL=/dev/null -# See if we have the XPG4 utilities (Solaris) -if test -d /usr/xpg4/bin; then - PATH=/usr/xpg4/bin:$PATH -fi - -# Return the appropriate architecture string -DetectARCH() -{ - status=1 - case `uname -m` in - i?86) - echo "x86" - status=0;; - 90*/*) - echo "hppa" - status=0;; - *) - case `uname -s` in - IRIX*) - echo "mips" - status=0;; - *) - arch=`uname -p 2> /dev/null || uname -m` - if test "$arch" = powerpc; then - echo "ppc" - else - echo $arch - fi - status=0;; - esac - esac - return $status -} - -# Return the appropriate version string -DetectLIBC() -{ - status=1 - if [ `uname -s` != Linux ]; then - echo "glibc-2.1" - return $status - fi - if [ -f `echo /lib/libc.so.6* | tail -1` ]; then - if fgrep GLIBC_2.1 /lib/libc.so.6* 2> $NULL >> $NULL; then - echo "glibc-2.1" - status=0 - else - echo "glibc-2.0" - status=0 - fi - elif [ -f /lib/libc.so.5 ]; then - echo "libc5" - status=0 - else - echo "unknown" - fi - return $status -} - -DetectOS() -{ - os=`uname -s` - if test "$os" = "OpenUNIX"; then - echo SCO_SV - else - echo $os - fi - return 0 -} - -# Detect the environment -arch=`DetectARCH` -libc=`DetectLIBC` -os=`DetectOS` - -# Import preferences from a secondary script -if [ -f setup.data/config.sh ]; then - . setup.data/config.sh -elif [ -f SETUP.DAT/CONFIG.SH\;1 ]; then - # HP-UX and other systems unable to get LFN correctly - . SETUP.DAT/CONFIG.SH\;1 -fi - -# Add some standard paths for compatibility -PATH=$PATH:/usr/ucb - -# call setup with -auth when ran through su/xsu -auth=0 -if [ "$1" = "-auth" ] -then - auth=1 - [[shift]] -fi - -if [ "$auth" -eq 1 ] -then - # if root is absolutely required - # this happens if xsu/su execs setup.sh but it still doesn't have root rights - if [ "$GET_ROOT" -eq 2 ] - then - # NOTE TTimo: this causes the following error message in some cases: - # return: can only `return' from a function or sourced script - # BUT: in other cases, the return is legit, if you replace by an exit call, it's broken - return 1 - fi -fi - -# Feel free to add some additional command-line arguments for setup here. -args="" - -# Find the installation program -# try_run [-absolute] [-fatal] INSTALLER_NAME [PARAMETERS_PASSED] -# -absolute option: if what you are trying to execute has an absolute path -# NOTE: maybe try_run_absolute would be easier -# -fatal option: if you want verbose messages in case -# - the script could not be found -# - it's execution would fail -# INSTALLER_NAME: setup.gtk or setup -# PARAMETERS_PASSED: additional arguments passed to the setup script -try_run() -{ - absolute=0 - if [ "$1" = "-absolute" ]; then - absolute=1 - [[shift]] - fi - - fatal=0 - # older bash < 2.* don't like == operator, using = - if [ "$1" = "-fatal" ]; then - # got fatal - fatal=1 - [[shift]] - fi - - setup=$1 - [[shift]] - - # First find the binary we want to run - failed=0 - if [ "$absolute" -eq 0 ] - then - setup_bin="setup.data/bin/$os/$arch/$libc/$setup" - # trying $setup_bin - if [ ! -f "$setup_bin" ]; then - setup_bin="setup.data/bin/$os/$arch/$setup" - # libc dependant version failed, trying again - if [ ! -f "$setup_bin" ]; then - failed=1 - fi - fi - if [ "$failed" -eq 1 ]; then - if [ "$fatal" -eq 1 ]; then - cat <<__EOF__ -This installation doesn't support $libc on $os / $arch -(tried to run $setup) -$FATAL_ERROR -__EOF__ - fi - return $failed - fi - - # Try to run the binary ($setup_bin) - # The executable is here but we can't execute it from CD - # NOTE TTimo: this is dangerous, we also use $setup to store the name of the try_run - setup="$HOME/.setup$$" - rm -f "$setup" - cp "$setup_bin" "$setup" - chmod 700 "$setup" - fi - # echo Running "$setup" "$@" - if [ "$fatal" -eq 0 ]; then - "$setup" "$@" - failed="$?" - else - "$setup" "$@" 2>> $NULL - failed="$?" - fi - if [ "$absolute" -eq 0 ] - then - # don't attempt removal when we are passed an absolute path - # no, I don't want to imagine a faulty try_run as root on /bin/su - rm -f "$setup" - fi - return "$failed" -} - -# if we have not been through the auth yet, and if we need to get root, then prompt -if [ "$auth" -eq 0 ] && [ "$GET_ROOT" -ne 0 ] -then - GOT_ROOT=`id -u` - if [ "$GOT_ROOT" != "0" ] - then - - if [ "$USE_XHOST" -eq 1 ]; then - xhost +127.0.0.1 2> $NULL > $NULL - fi - try_run xsu -e -a -u root -c "sh `pwd`/setup.sh -auth" $XSU_ICON - status="$?" - # echo "got $status" - # if try_run successfully executed xsu, it will return xsu's exit code - # xsu returns 2 if ran and cancelled (i.e. the user 'doesn't want' to auth) - # it will return 0 if the command was executed correctly - # summing up, if we get 1, something failed - if [ "$status" -eq 0 ] - then - # the auth command was properly executed - exit 0 - elif [ "$status" -eq 1 ] - then - ifdef([[M4_OSX]], [[echo "You need to run the installer as root" ; exit 1]]) - # xsu wasn't found, or failed to run - # if xsu actually ran and the auth was cancelled, $status is 2 - # try with su - printf "$SU_MESSAGE\n" - try_run -absolute /bin/su root -c "export DISPLAY=$DISPLAY;sh `pwd`/setup.sh -auth" - status="$?" - elif [ "$status" -eq 3 ] - then - # the auth failed or was canceled - # we don't want to even start the setup if not root - echo "Please run this installation as the super user" - exit 1 - fi - # continue running as is - fi -fi - -# Try to run the setup program -# TTimo - setup.gtk only -# try_run setup.gtk $args $* -# status=$? -# if [ $status -eq 2 ]; then # setup.gtk couldn't connect to X11 server - ignore - try_run -fatal setup.gtk $args $* || { - # TTimo - echo "setup.gtk failed to start?" - echo "DISPLAY: $DISPLAY" - echo "Do you need to issue an xhost + command to let root access X11?" - ifdef([[M4_OSX]], [[echo "See http://www.qeradiant.com/wikifaq/index.php?OSX%20fink%20installer%20known%20issues for details"]]) - echo "The setup program seems to have failed on $arch/$libc" - echo - echo $FATAL_ERROR - status=1 - } -#fi -exit $status diff --git a/setup/linux/source_archive.sh b/setup/linux/source_archive.sh deleted file mode 100644 index 21ef8f68..00000000 --- a/setup/linux/source_archive.sh +++ /dev/null @@ -1,22 +0,0 @@ -mkdir gtkradiant-1.5.0 -cp GtkRadiant/* gtkradiant-1.5.0 -mkdir gtkradiant-1.5.0/radiant -cp -R GtkRadiant/radiant/* gtkradiant-1.5.0/radiant -mkdir gtkradiant-1.5.0/plugins -cp -R GtkRadiant/plugins/* gtkradiant-1.5.0/plugins -mkdir gtkradiant-1.5.0/libs -cp -R GtkRadiant/libs/* gtkradiant-1.5.0/libs -mkdir gtkradiant-1.5.0/include -cp -R GtkRadiant/include/* gtkradiant-1.5.0/include -mkdir gtkradiant-1.5.0/contrib -cp -R GtkRadiant/contrib/* gtkradiant-1.5.0/contrib -mkdir gtkradiant-1.5.0/tools -cp -R GtkRadiant/tools/* gtkradiant-1.5.0/tools -mkdir gtkradiant-1.5.0/setup -cp -R GtkRadiant/setup/* gtkradiant-1.5.0/setup -mkdir gtkradiant-1.5.0/games -cp -R GtkRadiant/games/* gtkradiant-1.5.0/games -mkdir gtkradiant-1.5.0/docs -cp -R GtkRadiant/docs/* gtkradiant-1.5.0/docs -tar -czf gtkradiant-1.5.0.tar.gz gtkradiant-1.5.0/ -rm -rf gtkradiant-1.5.0 diff --git a/setup/linux/wolf.cf b/setup/linux/wolf.cf deleted file mode 100644 index 4124be03..00000000 --- a/setup/linux/wolf.cf +++ /dev/null @@ -1,8 +0,0 @@ -# Linux build config -# wolf.cf -# -# includes core + wolfpack - -$DO_CORE=1; -$DO_GAME_Q3=0; -$DO_GAME_WOLF=1; diff --git a/setup/openurl.sh b/setup/openurl.sh deleted file mode 100644 index d374a76a..00000000 --- a/setup/openurl.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# use this script to customize the way the engine should open URLs - -for test_browser in mozilla netscape -do - browser=`which $test_browser` - if [ "x$browser" != "x" ] - then - $browser -remote "openURL($1,new-window)" || $browser "$1" - exit - fi -done - -xterm -e lynx "$1" diff --git a/setup/osx/build.sh b/setup/osx/build.sh deleted file mode 100644 index 25324c13..00000000 --- a/setup/osx/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -(cd loki_setup && patch -N -p0 < ../setup.patch) -(cd loki_setupdb ; make distclean ; ./autogen.sh && ./configure && make) -( -cd loki_setup -make distclean -./autogen.sh && ./configure && make -mkdir -p image/setup.data/bin/Darwin/ppc/glibc-2.1 -make install -find image -name setup -exec rm {} \; -) - -(cd GtkRadiant ; scons BUILD=release SETUP=1) diff --git a/setup/osx/radiant.info.m4 b/setup/osx/radiant.info.m4 deleted file mode 100644 index 64b8e0bd..00000000 --- a/setup/osx/radiant.info.m4 +++ /dev/null @@ -1,32 +0,0 @@ -Package: radiant -Version: 1.M4_VER_MAJOR.M4_VER_MINOR -Revision: M4_REV -Description: GtkRadiant - level editor for Id technology games -DescDetail: << -You need to be running fink unstable to install GtkRadiant -Installation instructions: http://www.qeradiant.com/wikifaq/index.php?Installation%20on%20OSX -<< -DescPort: << -Add comments about dependencies here.. -<< -Maintainer: Timothee Besset -License: Restrictive -Homepage: http://www.qeradiant.com/ - -# Dependencies: -BuildDepends: gtk+2-dev, gtkglext1, libiconv-dev, scons, libxml, gtkglext1, libglade, glib, gtk+ -Depends: libglade, libxml-shlibs, gettext, libglade-shlibs, gtk+-shlibs, glib-shlibs, gtk+2-shlibs, dlcompat-shlibs, libxml2-shlibs, libiconv, glib2-shlibs, libpng-shlibs, x11, libpng3-shlibs, gtkglext1-shlibs, libglade-shlibs, glib-shlibs, gtk+-shlibs - -Source: http://zerowing.idsoftware.com/osx/GtkRadiant-osx-1.M4_VER_MAJOR.M4_VER_MINOR-M4_REV.tgz -Source-MD5: M4_MD5SUM - -PatchScript: echo "Dummy PatchScript" -CompileScript: sh ./build.sh - -# Install Phase: -InstallScript: << - mkdir -p %i/games/radiant-setup - mkdir -p %i/bin - cp GtkRadiant/M4_SETUP_TARGET %i/games/radiant-setup/M4_SETUP_TARGET - ln -s /sw/games/radiant-setup/M4_SETUP_TARGET %i/bin/radiant-setup -<< diff --git a/setup/quickstart.txt b/setup/quickstart.txt deleted file mode 100644 index b087f080..00000000 --- a/setup/quickstart.txt +++ /dev/null @@ -1,23 +0,0 @@ -Some info for a good transition from Q3Radiant 202 to GtkRadiant: - -- shortcut keys are now in shortcuts.ini - the syntax has changed a bit, no spaces between the '=' - see shortcuts.sample -- no longer using the registry, settings are stored in radiant.ini and savedinfo.bin - in Radiant directory -- project settings templates: - the project settings file format has changed a bit. - it has version information now, and the setups come with a new quakev2.qe4 file - the project files are true templates, Radiant will read them and then store actual - project settings it uses in baseq3/scripts/user0.qe4 user1.qe4 etc. -- new compilation monitoring - GtkRadiant comes with a modified version of q3map that reports to GtkRadiant through - the network. You get the output of q3map in the console window. And the compiling - errors can be processed (currently it detects leaks) -- sleep mode: - before running Quake 3 Arena to playtest your maps, you can put Radiant to sleep: - manually with File > Sleep command - automatic if you compile and set "Activate sleep mode when running the engine" - -known issues: -- View n2&3 crashes on sleep mode diff --git a/setup/radiantgtkrc b/setup/radiantgtkrc deleted file mode 100644 index c8b6e25b..00000000 --- a/setup/radiantgtkrc +++ /dev/null @@ -1,63 +0,0 @@ -# ---------------------------------------------------------------------------------------- -# Basic style settings for GtkRadiant -# ---------------------------------------------------------------------------------------- - - - -style "gtk_radiant_menus" -{ - font_name = "Tahoma, Helvetica, Arial 8" -} - - - - -style "gtk_radiant_text" -{ - font_name = "Courier New, Courier, Monospaced, Fixed 9" -} - - - - -style "gtk_radiant_statusbar" -{ - font_name = "Tahoma, Helvetica, Arial 8" -} - - - - -style "gtk_radiant_tooltips" { - bg[NORMAL] = "#ffffe0" - font_name = "Tahoma, Helvetica, Arial 8" -} - - - -# -- TOOLTIPS -widget "gtk-tooltips" style "gtk_radiant_tooltips" - - - -# -- ALL MENUS -widget_class "*GtkMenu*" style "gtk_radiant_menus" - - - -# -- ALL TEXT (console) -widget_class "*GtkText*" style "gtk_radiant_text" - - - -# -- ALL LABELS (Statusbar) -widget_class "*GtkLabel*" style "gtk_radiant_statusbar" - - -# -- lists, trees, dropdowns, entries, spinners, sliders -widget_class "*GtkCList*" style "gtk_radiant_menus" -widget_class "*GtkCTree*" style "gtk_radiant_menus" -widget_class "*GtkCombo*" style "gtk_radiant_menus" -widget_class "*GtkEntry*" style "gtk_radiant_menus" -widget_class "*GtkSpinButton*" style "gtk_radiant_menus" -widget_class "*GtkAdjustment*" style "gtk_radiant_menus" diff --git a/setup/setup.bmp b/setup/setup.bmp deleted file mode 100644 index f9e7cc1d..00000000 Binary files a/setup/setup.bmp and /dev/null differ diff --git a/setup/setup.patch b/setup/setup.patch deleted file mode 100644 index ca85c13b..00000000 --- a/setup/setup.patch +++ /dev/null @@ -1,665 +0,0 @@ -Index: CHANGES -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/CHANGES,v -retrieving revision 1.86 -diff -u -r1.86 CHANGES ---- CHANGES 2003/09/24 04:02:47 1.86 -+++ CHANGES 2003/10/24 18:12:36 -@@ -25,6 +25,10 @@ - Stephane Peter (Codehost) - Tue Feb 11 20:33:32 PST 2003 - * Added the 'environment' tag to store the values of - environment variables. -+TTimo (qeradiant.com) - Mon Feb 10 12:17:08 CET 2003 -+ * Added SETUP_COMPONENT_PATH env to run scripts -+TTimo (qeradiant.com) - Sun Jan 26 23:36:06 CET 2003 -+ * Ported over our subcomponent code - Ryan C. Gordon (icculus.org) - Tue Jan 14 23:46:31 EST 2003 - * Committed initial MacOS X patches to CVS on behalf of Jon C. - Stephane Peter (Codehost) - Fri Dec 6 16:31:27 PST 2002 -Index: Makefile.in -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/Makefile.in,v -retrieving revision 1.25 -diff -u -r1.25 Makefile.in ---- Makefile.in 2003/05/02 22:54:49 1.25 -+++ Makefile.in 2003/10/24 18:12:36 -@@ -134,19 +134,19 @@ - endif - @if [ -d image/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \ - cp setup image/setup.data/bin/$(os)/$(arch); \ -- strip image/setup.data/bin/$(os)/$(arch)/setup; \ -+ strip -r image/setup.data/bin/$(os)/$(arch)/setup; \ - $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/setup; \ - cp uninstall image/setup.data/bin/$(os)/$(arch); \ -- strip image/setup.data/bin/$(os)/$(arch)/uninstall; \ -+ strip -r image/setup.data/bin/$(os)/$(arch)/uninstall; \ - $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/uninstall; \ - cp xsu image/setup.data/bin/$(os)/$(arch)/$(libc); \ -- strip image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \ -+ strip -r image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \ - $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \ - cp setup.gtk image/setup.data/bin/$(os)/$(arch)/$(libc); \ -- strip image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ -+ strip -r image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo image/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - - install-image: all -@@ -171,7 +171,7 @@ - cp setup.gtk $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc); \ - strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - - # Pretty LPP-specific -@@ -181,7 +181,7 @@ - strip $(IMAGE)/bin/$(os)/$(arch)/check; \ - cp check.glade $(IMAGE)/misc/; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \ - fi - - # Copy loki_uninstall and the required files -@@ -196,7 +196,7 @@ - cp $$file $$path; \ - done; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \ - fi - - install-loki_uninstall: loki_uninstall -@@ -211,7 +211,7 @@ - cp $$file $$path; \ - done; \ - else \ -- echo No directory to copy the binary files to.; \ -+ echo $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc): No directory to copy the binary files to.; \ - fi - @if [ -d $(UPDATES) ]; then \ - rm -rf $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \ -Index: configure.in -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/configure.in,v -retrieving revision 1.41 -diff -u -r1.41 configure.in ---- configure.in 2003/08/13 21:48:29 1.41 -+++ configure.in 2003/10/24 18:12:36 -@@ -161,7 +161,7 @@ - LIBDL="" - ARCH=`uname -p` ;; - powerpc-apple-darwin*) -- STATIC="-static" -+ STATIC="" - RDYNAMIC="-Wl,-Sn" - BSTATIC="" - BDYNAMIC="" -@@ -242,16 +242,6 @@ - CARBONLIBS="$CARBON_LIBS $LIBINTL" - fi - ) -- --case "$target" in -- powerpc-apple-darwin*) -- if test -f /sw/lib/libintl.a; then -- LIBINTL="/sw/lib/libintl.a /sw/lib/libiconv.a" -- LIBS="$LIBS $LIBINTL" -- GUILIBS="$GUI_LIBS $LIBINTL" -- CARBONLIBS="$CARBON_LIBS $LIBINTL" -- fi --esac - - AC_CHECK_LIB(gpm, Gpm_Open, USE_GPM=yes) - -Index: copy.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/copy.c,v -retrieving revision 1.69 -diff -u -r1.69 copy.c ---- copy.c 2003/09/04 02:29:03 1.69 -+++ copy.c 2003/10/24 18:12:37 -@@ -347,7 +347,7 @@ - *slash = '\0'; - } - push_curdir(dir); -- if ( run_script(info, buf, 0, 1) == 0 ) { -+ if ( run_script(info, buf, NULL, 0, 1) == 0 ) { - const char *target = xmlGetProp(node, "target"); - if ( target ) { - char targetpath[PATH_MAX]; -@@ -719,7 +719,7 @@ - if ( ! update(info, _("Running script"), 0, 0, current_option_txt) ) - return 0; - } -- return(run_script(info, script, -1, 1)); -+ return(run_script(info, script, dest, -1, 1)); - } - - ssize_t copy_node(install_info *info, xmlNodePtr node, const char *dest, -@@ -808,6 +808,7 @@ - { - ssize_t size, copied; - char tmppath[PATH_MAX]; -+ const char *component_dest; - - size = 0; - while ( node ) { -@@ -894,6 +895,58 @@ - } - current_component = NULL; /* Out of the component */ - } -+ } -+ /* Parse subcomponents */ -+ else if (!strcmp(node->name, "subcomponent")) { -+ const char *name, *version; -+ xmlNodePtr child; -+ name = xmlGetProp(node, "name"); -+ if (!name) -+ log_fatal(_("SubComponent element must have a name")); -+ version = xmlGetProp(node, "version"); -+ if (!version) -+ { -+ log_warning(_("SubComponent doesn't have a version")); -+ version = strdup("noversion"); -+ } -+ child = node->childs; -+ while(child) -+ { -+ if(!strcmp(child->name, "option")) -+ { -+ /* only run if it has been actually selected for install */ -+ const char *install; -+ install = xmlGetProp(child, "install"); -+ if (install && !strcmp(install,"true")) -+ { -+ /* add this subcomponent as a standard component */ -+ current_component = add_component_entry(info, name, version, -+ (strcmp(xmlGetProp(child, "install"), "true") != 0) ? 0 : 1, NULL, NULL ); -+ if(xmlGetProp(child, "path")) -+ { -+ /* if the path's been changed, use the path it was changed to */ -+ component_dest = xmlGetProp(child, "path"); -+ } -+ else -+ { -+ /* if the path hasn't been changed, install to the default path */ -+ component_dest = xmlGetProp(child, "default_path"); -+ } -+ // TODO: verify the install location ? -+ copied = copy_node(info, child, component_dest, update); -+ if ( copied > 0 ) -+ { -+ size += copied; -+ } -+ copied = copy_tree(info, child->childs, component_dest, update); -+ if(copied > 0) -+ { -+ size += copied; -+ } -+ } -+ } -+ child = child->next; -+ } - } else if ( ! strcmp(node->name, "environment") ) { - const char *prop = xmlGetProp(node, "var"); - if ( prop ) { -Index: gtk_ui.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/gtk_ui.c,v -retrieving revision 1.87 -diff -u -r1.87 gtk_ui.c ---- gtk_ui.c 2003/10/15 00:08:11 1.87 -+++ gtk_ui.c 2003/10/24 18:12:37 -@@ -143,6 +143,7 @@ - static GladeXML *setup_glade = NULL; - static GladeXML *setup_glade_readme = NULL; - static GladeXML *setup_glade_license = NULL; -+static GladeXML *setup_glade_subcomponent = NULL; - static int cur_state; - static install_info *cur_info; - static int diskspace; -@@ -159,6 +160,7 @@ - void setup_destroy_view_readme_slot(GtkWidget*, gpointer); - static yesno_answer gtkui_prompt(const char*, yesno_answer); - static void gtkui_abort(install_info *info); -+static int gtkui_dir_prompt (install_info *info, const char *message, char *path); - - static int iterate_for_state(void) - { -@@ -1216,6 +1218,189 @@ - } - } - -+/*************** subcomponent *********************/ -+ -+void setup_button_subcomponent_browse(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *entry = (GtkWidget *)func_data; -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ char *widget_data = gtk_object_get_data(GTK_OBJECT(widget), "data"); -+ char path[PATH_MAX]; -+ strncpy(path, gtk_entry_get_text(GTK_ENTRY(entry)), PATH_MAX); -+ -+ gtkui_dir_prompt(cur_info, widget_data, path); -+ -+ if(path[strlen(path)-1] != '/') -+ strcat(path, "/"); -+ -+ gtk_entry_set_text(GTK_ENTRY(entry), path); -+ -+ xmlSetProp(node, "path", path); -+} -+ -+void setup_subcomponent_toggle(GtkWidget *widget, gpointer func_data) -+{ -+ int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); -+ GtkWidget *entry = gtk_object_get_data(GTK_OBJECT(widget), "entry"); -+ GtkWidget *button = gtk_object_get_data(GTK_OBJECT(widget), "button"); -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ -+ if(state) -+ { -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), TRUE); -+ gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE); -+ xmlSetProp(node, "install", "true"); -+ xmlSetProp(node, "path", gtk_entry_get_text(GTK_ENTRY(entry))); -+ } -+ else -+ { -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE); -+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); -+ xmlSetProp(node, "install", "false"); -+ xmlSetProp(node, "path", ""); -+ } -+} -+ -+void subcomponent_update_entry(GtkWidget *widget, gpointer func_data) -+{ -+ xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node"); -+ char *path = malloc(strlen(gtk_entry_get_text(GTK_ENTRY(widget)))+2); -+ strcpy(path, gtk_entry_get_text(GTK_ENTRY(widget))); -+ -+ if (path[strlen(path)-1] != '/') -+ strcat(path, "/"); -+ -+ if(path) -+ xmlSetProp(node, "path", path); -+} -+ -+void setup_button_subcomponent(GtkWidget *widget, gpointer func_data) -+{ -+ xmlNodePtr node; -+ xmlNodePtr child; -+ GtkWidget *window, *frame, *w, *vbox, *hbox, -+ *check, *entry, *button, *sep; -+ const char *text; -+ char name[256]; -+ int count=0; -+ int install=0; -+ -+ install_info *info = (install_info *)func_data; -+ -+ setup_glade_subcomponent = glade_xml_new(SETUP_GLADE, "subcomponent_dialog"); -+ glade_xml_signal_autoconnect(setup_glade_subcomponent); -+ window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ frame = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_frame"); -+ -+ w = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_button_cancel"); -+ gtk_widget_hide(w); -+ -+ gtk_widget_realize(window); -+ gtk_widget_realize(frame); -+ gtk_container_foreach(GTK_CONTAINER(frame), empty_container, frame); -+ -+ w = gtk_vbox_new(TRUE, 2); -+ gtk_container_add(GTK_CONTAINER(frame), w); -+ gtk_widget_show(w); -+ -+ gtk_object_set_data(GTK_OBJECT(window), "data", w); -+ -+ node = info->config->root->childs; -+ while(node != NULL && strcmp(node->name, "subcomponent")) -+ node = node->next; -+ if (!node) -+ log_fatal(_("subcomponent element not found")); -+ child = node->childs; -+ // subcomponent options -+ while(child != NULL) -+ { -+ if(!strcmp(child->name, "option")) -+ { -+ if(!strcmp(xmlGetProp(child, "install"), "true")) -+ install=1; -+ else -+ install=0; -+ -+ vbox = gtk_vbox_new(FALSE, 2); -+ gtk_box_pack_start(GTK_BOX(w), vbox, TRUE, FALSE, 0); -+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); -+ gtk_widget_show(vbox); -+ -+ if(count) -+ { -+ sep = gtk_hseparator_new(); -+ gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); -+ gtk_widget_show(sep); -+ } -+ -+ text = xmlNodeListGetString(info->config, child->childs, 1); -+ parse_line(&text, name, sizeof(name)); -+ -+ check = gtk_check_button_new_with_label(name); -+ gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); -+ if(install) -+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE); -+ gtk_signal_connect(GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(setup_subcomponent_toggle), NULL); -+ gtk_object_set_data(GTK_OBJECT(check), "name", name); -+ gtk_object_set_data(GTK_OBJECT(check), "node", child); -+ gtk_widget_show(check); -+ -+ hbox = gtk_hbox_new(FALSE, 2); -+ gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 0); -+ gtk_widget_show(hbox); -+ -+ entry = gtk_entry_new(); -+ //gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, FALSE, 0); -+ gtk_container_add(GTK_CONTAINER(hbox), entry); -+ if(!install) -+ gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE); -+ gtk_signal_connect(GTK_OBJECT(entry), "focus_out_event", GTK_SIGNAL_FUNC(subcomponent_update_entry), NULL); -+ gtk_object_set_data(GTK_OBJECT(entry), "name", name); -+ gtk_object_set_data(GTK_OBJECT(entry), "node", child); -+ gtk_widget_show(entry); -+ -+ if(xmlGetProp(child, "path")) -+ { -+ gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "path")); -+ } -+ else if (xmlGetProp(child, "default_path")) -+ { -+ gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "default_path")); -+ } -+ -+ -+ button = gtk_button_new_with_label("..."); -+ gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); -+ gtk_object_set_data(GTK_OBJECT(button), "data", gtk_entry_get_text(GTK_ENTRY(entry))); -+ gtk_object_set_data(GTK_OBJECT(button), "node", child); -+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent_browse), entry); -+ if(!install) -+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); -+ gtk_widget_show(button); -+ -+ gtk_object_set_data(GTK_OBJECT(check), "entry", entry); -+ gtk_object_set_data(GTK_OBJECT(check), "button", button); -+ -+ count++; -+ } -+ child = child->next; -+ } -+ gtk_widget_show(window); -+ //gtk_window_set_modal(GTK_WINDOW(window), TRUE); -+} -+ -+void setup_button_subcomponent_cancel(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ gtk_widget_hide(window); -+} -+ -+void setup_button_subcomponent_ok(GtkWidget *widget, gpointer func_data) -+{ -+ GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog"); -+ gtk_widget_hide(window); -+} -+ - /********** UI functions *************/ - - static install_state gtkui_init(install_info *info, int argc, char **argv, int noninteractive) -@@ -1533,6 +1718,12 @@ - } - } - } -+ } else if ( ! strcmp(node->name, "subcomponent") ) { -+ GtkWidget *widget = gtk_button_new_with_label(xmlGetProp(node, "name")); -+ gtk_box_pack_start(GTK_BOX(options), GTK_WIDGET(widget), FALSE, FALSE, 5); -+ gtk_object_set_data(GTK_OBJECT(widget), "data", (gpointer)xmlGetProp(node, "name")); -+ gtk_signal_connect(GTK_OBJECT(widget), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent), (gpointer)info); -+ gtk_widget_show(widget); - } - node = node->next; - } -@@ -1719,6 +1910,63 @@ - gtkui_idle(info); - } - -+static int dirname_loop; -+static int prompt_ret; -+ -+void store_dirname_slot(GtkFileSelection *selector, gpointer user_data) { -+ char *aux; -+ char *selected_dirname = (char *)user_data; -+ GtkWidget *parent; -+ -+ parent = gtk_widget_get_toplevel (GTK_WIDGET(selector)); -+ aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent)); -+ if (strlen(aux)) -+ strcpy(selected_dirname, aux); -+ -+ dirname_loop = 0; -+} -+ -+void abort_slot(GtkFileSelection *selector, gpointer user_data) { -+ dirname_loop = 0; -+ prompt_ret = 0; -+} -+ -+static int gtkui_dir_prompt (install_info *info, const char *message, char *path) -+{ -+ GtkWidget *selector; -+ char *aux; -+ -+ /* Create the selector */ -+ selector = gtk_file_selection_new(message); -+ -+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(selector), path); -+ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION(selector)); -+ -+ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->ok_button), -+ "clicked", GTK_SIGNAL_FUNC (store_dirname_slot), path); -+ -+ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->cancel_button), -+ "clicked", GTK_SIGNAL_FUNC (abort_slot), path); -+ -+ /* Display that dialog */ -+ -+ gtk_grab_add(selector); -+ gtk_widget_show (selector); -+ gtk_grab_remove(selector); -+ -+ dirname_loop = 1; -+ prompt_ret = 1; -+ -+ while (dirname_loop==1) -+ gtk_main_iteration(); -+ -+ aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector)); -+ -+ gtk_widget_destroy(selector); -+ -+ return prompt_ret; -+} -+ - int gtkui_okay(Install_UI *UI, int *argc, char ***argv) - { - extern int force_console; -@@ -1769,7 +2017,3 @@ - #endif - - #endif -- -- -- -- -Index: install.c -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/install.c,v -retrieving revision 1.124 -diff -u -r1.124 install.c ---- install.c 2003/09/27 01:52:38 1.124 -+++ install.c 2003/10/24 18:12:38 -@@ -429,7 +429,7 @@ - } - prop = xmlGetProp(node, "command"); - if ( prop ) { /* Run the command */ -- if ( run_script(info, prop, 0, 1) != 0 ) /* Failed, skip */ -+ if ( run_script(info, prop, NULL, 0, 1) != 0 ) /* Failed, skip */ - continue; - } - prop = xmlGetProp(node, "lang"); -@@ -1084,7 +1084,7 @@ - log_fatal(_("XML: 'require' tag doesn't have a mandatory 'command' attribute")); - } else { - /* Launch the command */ -- if ( run_script(info, prop, 0, 0) != 0 ) { -+ if ( run_script(info, prop, NULL, 0, 0) != 0 ) { - /* We failed: print out error message */ - text = xmlNodeListGetString(info->config, node->childs, 1); - if(text) { -@@ -1224,7 +1224,7 @@ - return 0; - - /* Launch the command */ -- return run_script(info, txt, 0, 0) == 0; -+ return run_script(info, txt, NULL, 0, 0) == 0; - } - } - return 1; -@@ -1431,7 +1431,7 @@ - - if (GetPreUnInstall(info) && info->installed_bytes>0) { - snprintf(path, sizeof(path), "sh %s", GetPreUnInstall(info)); -- run_script(info, path, 0, 1); -+ run_script(info, path, NULL, 0, 1); - } - - if ( file_exists(info->install_path) ) { -@@ -1448,7 +1448,7 @@ - /* Do not run scripts if nothing was installed */ - if ( info->installed_bytes>0 ) { - for ( selem = opt->pre_script_list; selem; selem = selem->next ) { /* RPM pre-uninstall */ -- run_script(info, selem->script, 0, 1); -+ run_script(info, selem->script, NULL, 0, 1); - } - } - -@@ -1465,7 +1465,7 @@ - } - if ( info->installed_bytes>0 ) { - for ( selem = opt->post_script_list; selem; selem = selem->next ) { /* RPM post-uninstall */ -- run_script(info, selem->script, 0, 1); -+ run_script(info, selem->script, NULL, 0, 1); - } - } - -@@ -1483,7 +1483,7 @@ - } - if (GetPostUnInstall(info) && info->installed_bytes>0) { - snprintf(path, sizeof(path), "sh %s", GetPostUnInstall(info)); -- run_script(info, path, 0, 1); -+ run_script(info, path, NULL, 0, 1); - } - - if ( uninstall_generated ) { -@@ -1896,7 +1896,7 @@ - if ( ! restoring_corrupt() ) { - script = GetPreInstall(info); - if ( script ) { -- exitval = run_script(info, script, -1, 1); -+ exitval = run_script(info, script, NULL, -1, 1); - } - } - return exitval; -@@ -1909,7 +1909,7 @@ - if ( ! restoring_corrupt() ) { - script = GetPostInstall(info); - if ( script ) { -- exitval = run_script(info, script, -1, 1); -+ exitval = run_script(info, script, NULL, -1, 1); - } - } - return exitval; -@@ -1930,7 +1930,7 @@ - /* Run the command and set it to "true" if the return value is ok */ - str = xmlGetProp(child, "command"); - if ( str ) { -- cmd = run_script(info, str, 0, 0); -+ cmd = run_script(info, str, NULL, 0, 0); - xmlSetProp(child, "install", cmd ? "false" : "true"); - log_debug("Script run: '%s' returned %d\n", str, cmd); - } else { -@@ -2370,13 +2370,16 @@ - } - - /* Run some shell script commands */ --int run_script(install_info *info, const char *script, int arg, int include_tags) -+int run_script(install_info *info, const char *script, const char *dest, int arg, int include_tags) - { - char script_file[PATH_MAX]; - int fd; - int exitval; - char working_dir[PATH_MAX]; - -+ if (!dest) -+ dest = ""; -+ - /* We need to append the working directory onto the script name so - it can always be found. Do this only if the script file exists - (to avoid problems with 'sh script.sh') -@@ -2412,13 +2415,16 @@ - "SETUP_CDROMPATH=\"%s\"\n" - "SETUP_DISTRO=\"%s\"\n" - "SETUP_REINSTALL=\"%s\"\n" -- "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_REINSTALL\n", -+ "SETUP_COMPONENT_PATH=\"%s\"\n" -+ "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_REINSTALL SETUP_OPTIONTAGS SETUP_COMPONENT_PATH\n", - info->name, info->version, - info->install_path, - info->symlinks_path, - info->cdroms_list ? info->cdroms_list->mounted : "", - info->distro ? distribution_symbol[info->distro] : "", -- info->options.reinstalling ? "1" : "0"); -+ info->options.reinstalling ? "1" : "0", -+ dest -+ ); - - if ( include_tags ) - fprintf(fp, - -Index: install.h -=================================================================== -RCS file: /cvs/cvsroot/loki_setup/install.h,v -retrieving revision 1.73 -diff -u -r1.73 install.h ---- install.h 2003/09/24 04:02:48 1.73 -+++ install.h 2003/10/24 18:12:38 -@@ -369,7 +369,7 @@ - otherwise the install path is passed as a command line argument. - 'include_tags' indicates if the SETUP_OPTIONTAGS should be set in the script header. - */ --extern int run_script(install_info *info, const char *script, int arg, int include_tags); -+extern int run_script(install_info *info, const char *script, const char *dest, int arg, int include_tags); - - /* returns true if any deviant paths are not writable */ - char check_deviant_paths(xmlNodePtr node, install_info *info); -@@ -399,4 +399,3 @@ - - - #endif /* _install_h */ -- diff --git a/setup/shortcuts.ini.sample b/setup/shortcuts.ini.sample deleted file mode 100644 index 48bc47f6..00000000 --- a/setup/shortcuts.ini.sample +++ /dev/null @@ -1,95 +0,0 @@ -; TTimo: a sample file used as an example - -; command mapping for QERadiant -; -; syntax is as follows -; Command name = keystroke -; -; use +alt, shift or ctrl to modify the keys (you can combine them) -; i.e. -; EntityColor = k+ctrl -; -; the special keys are as follows -; -; UP = Cursor up -; DOWN = Cursor down -; LEFT = Cursor left -; RIGHT = Cursor right -; SPACE = space -; BACKSPACE = back space -; ESCAPE = escape -; END = end -; INSERT = insert -; DELETE = delete -; PAGEUP = page up -; PAGEDOWN = page down -; TAB = tab -; RETURN = return (enter) -; F1..F2 = f1 .. f12 -; COMMAN = , -; PERIOD = . -; PLUS = + -; MULTIPLY = * -; SUBTRACT = - - -[Commands] -EntityColor=K -CameraForward=UP -CameraBack=DOWN -CameraLeft=LEFT -CameraRight=RIGHT -CameraUp=A -CameraDown=Z -CameraAngleUp=A+shift -CameraAngleDown=Z+shift -CameraStrafeRight=right+shift -CameraStrafeLeft=left+shift -ToggleGrid=0 -SetGrid1=1 -SetGrid2=2 -SetGrid4=3 -SetGrid8=4 -SetGrid16=5 -SetGrid32=6 -SetGrid64=7 -DragEdges=E -DragVertices=V -ViewEntityInfo=N -ViewConsole=`+ctrl -ViewTextures=T -SurfaceInspector=S -CloneSelection=D+ctrl -DeleteSelection=DELETE -UnSelectSelection=ESCAPE -CenterView=SPACE -ZoomOut=SUBTRACT -ZoomIn=PLUS -ZZoomOut=SUBTRACT+ctrl -ZZoomIn=PLUS+ctrl -UpFloor=PAGEUP -DownFloor=PAGEDOWN -ToggleClipper=X -ToggleRealtime=R -EntityList=L -MapInfo=M -Preferences=P -ToggleCamera=C -ToggleConsole=~ -;ToggleView=V+ctrl -;ToggleZ=Z+ctrl -ConnectSelection=K+ctrl -Brush3Sided=3+ctrl -Brush4Sided=4+ctrl -Brush5Sided=5+ctrl -Brush6Sided=6+ctrl -Brush7Sided=7+ctrl -Brush8Sided=8+ctrl -Brush9Sided=9+ctrl -ShowDetail=D+alt -MakeDetail=M+alt -NextLeakSpot=PAGEUP+ctrl -PrevLeakSpot=PAGEDOWN+ctrl -FileOpen=O+ctrl -FileSave=S+ctrl -Exit=X+ctrl -NextView=TAB+ctrl diff --git a/setup/win32/HOWTO b/setup/win32/HOWTO deleted file mode 100644 index af0ddb64..00000000 --- a/setup/win32/HOWTO +++ /dev/null @@ -1,32 +0,0 @@ -msi installer HOWTO for Radiant 1.5 ------------------------------------ - -Requirements: - -- all game packs from https://zerowing.idsoftware.com/svn/radiant.gamepacks/*Pack/trunk/ must be present in the ./games/ folder -- the Radiant manual from https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Rad_Manual/trunk/ in ./docs/manual/ -- msitools from http://zerowing.idsoftware.com/files/radiant/developer/1.5/msitools.zip. - - -Building a new installer .msi file: - -- Unzip msitools.zip to ./setup/win32/ and run MsiVal2.Msi (it automatically installes to C:\Program files\MsiVal2). -- Copy all files from C:\Program files\MsiVal2 to the ./setup/win32/ folder. -- You might have to edit the .xml files in ./setup/win32/components/ -- Create a file "aboutmsg.default" in ./include containing a single line: - Official qeradiant.com build by -- Open a command-prompt in ./ and run "makeversion.py" -- Build the GtkRadiant solution in 'Release' configuration. -- If you want to create a .msi installer for GtkRadiant, go on with the next step. To create a game pack - .msi installer you have to modify the file "build.py". -- Open a command-prompt in ./setup/win32/ and run "build.py". This will create the installer - file GtkRadiant-1.5.0-[YYYY]-[MM]-[DD].msi - - -Additional information: - -If you want to build the msi-Installer wiht Python 2.4 you have to modify msiquery.vcproj ('Release' configuration) -located in ./setup/win32/msi/ (include paths and linker libraries) and rebuild it - - -Written by Shaderman and Topsun in Sept 2006 \ No newline at end of file diff --git a/setup/win32/HOWTO_outdated b/setup/win32/HOWTO_outdated deleted file mode 100644 index 775887a8..00000000 --- a/setup/win32/HOWTO_outdated +++ /dev/null @@ -1,195 +0,0 @@ -Howto add new game packs to the InstallShield setup ---------------------------------------------------- - -Background Info ---------------- -The files that IS uses are pretty much all text files, in the template/ directory -we have a special copy of these files that make up the IS project. - -The copy in the template/ directory has files which contain string like -<> which are replaced with actual values whenever the setup.pl script -is used. - - -TTimo -8/5/2002 - -Disclaimer: I'm writing that as I am building the RTCW game pack. It is possible -that it is fairly outdated when you read it, but my guess is it can be a useful -reference document. -Update: using this for JKII support, made sure everything is still valid - -Hydra -5/6/2002 - - Updating for Halflife build, added a bit more info in places. - -NOTE: you need cygwin installed (http://www.cygwin.com) to run setup.pl tools -(Base installation + perl) - -You also need UUIDGEN.exe in your path. It's normally in the -"Visual Studio .NET\Common7\Tools" directory - -Some experience with IS and our particular way of handling it is expected. -The following information is DENSE, read everything - -- select a base name for the pack (which we will use in various variables): -WOLF -- make a RELEASE build of GtkRadiant. -- run setup.pl to generate the IS directories - e.g. ./setup.pl 'c:\\my documents\\Source\\GtkRadiant' q3.cf - (the directory contains GtkRadiant, Src, etc..) -- start WorkDir/GtkRadiant.ipr, this is an half-templated setup we can -easily work on to add new stuff - -- go to file groups and start adding new groups: -Wolf Executable Files - will hold the editor modules and binaries (map compiler, bspc) -Wolf Media Files - will hold sample files and editor files: - maps, models, additional textures, shader scripts, entities.def, project template -set the destination directory for those files: -Wolf Executable Files - goes in the game pack directory: DIR_GAMETOOLS_WOLF -Wolf Media Files - goes straight into the Wolf path: DIR_GAME_WOLF - -- start feeding stuff in those file groups - make sure all those files start from the prefix we are working with - (C:\home\Id in my case) - -- add a component: - Wolf (Wolf Executable Files) - -- Wolf editing media (Wolf Media Files) - NOTE: make sure that you put the file groups in those components you created! - -- go to add the pack to setup.rul: -add new globals -// Wolf -NUMBER DO_GAME_WOLF_BOOL; -STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF; - -- in OnFirstUIBefore -define any strings you use, e.g. szJKII and DEFAULTJKIIDIR; -add template for wolf pack inclusion -DO_GAME_WOLF_BOOL = <>; - -- copy 'game pack #1' code and paste is as a 'game pack #2' -start renaming the code and updating it -(use the registry key for default path lookup if possible) -Wolf setup doesn't leave an install path, we will hardcode to -C:\\Program Files\\Return To Castle Wolfenstein -and look for the binary -(note, this is by far the part with the most things to do, -read carefully the game pack code, replace everywhere it's needed, -put the right 'BACK' code etc.) - -NOTE: the 'if (nResult = BACK) then' code gets more complicated as new packs are added -sadly, it's not possible to store labels into variables for jumps -the next 'nResult = BACK' in non-gamepack code needs to be updated too - -- in Dlg_SdStartCopy, add summary for Wolf operations - if (DO_GAME_WOLF_BOOL == 1) then - ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_WOLF,AFTER); - ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_WOLF,AFTER); - endif; - -- in OnMoved, add generation of the game file for Wolf - if (DO_GAME_WOLF_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, " gamename=\"wolf\""); - WriteLine(nvFileHandle, " enginename=\"quake3\""); - CloseFile(nvFileHandle); - endif; - -- configure the setup so that the new components are installed by default: - in 'Setup Types' tab, check the new components - NOTE: do that in BOTH types, specially Custom - -- once all those changes are done, we are gonna validate the update.. -save and exit IS -make a backup copy of setup/win32/WorkDir ($ cp -R WorkDir/ WorkDir-backup) - -- templatize WorkDir/ with the setup.pl -$ ./setup.pl 'c:\\home\\Id' -template template-gen -Configured for base GtkRadiant directory: 'C:\\home\\Id' -Building a template version of WorkDir into template-gen/ -Copy files... -Templating UUID... -Processing 'C:\\home\\Id' into '<>' - -- check with a recursive diff that it's all good (Araxis Merge!) -Files template/Component Definitions/Default.cdf and template-gen/Component Definitions/Default.cdf differ -Files template/Component Definitions/Default.fgl and template-gen/Component Definitions/Default.fgl differ -Files template/File Groups/Default.fdf and template-gen/File Groups/Default.fdf differ -Files template/Script Files/Setup.rul and template-gen/Script Files/Setup.rul differ -Files template/Text Substitutions/Setup.tsb and template-gen/Text Substitutions/Setup.tsb differ - -newly added, the file groups files - -- copy over template-gen/ into template/ -$ cp -R template-gen/* template/ - -- cvs update in the template dir, add new files etc. - - - -- edit template/Component Definitions/Default.cdf in a text editor to configure the 'include in build' templates - search for [Wolf] and change the line: - INCLUDEINBUILD=NO - to: - INCLUDEINBUILD=<> - - search for [Wolf\Wolf Editing Media] and change the line: - INCLUDEINBUILD=NO - to: - INCLUDEINBUILD=<> - - that is, main is always installed, and the editing media only in full - NOTE: IS 6.0 has the nasty habit of changing order in Default.cdf on each save .. makes things harder - -- edit 'sub configure_tree' in setup/win32/setup.pl: - copy from an existing game pack code and adapt - there's a general boolean, and a full setup boolean - (search and replace affects Setup.rul and Default.cdf) - - add the corresponding items to - # set default config - - add a corresponding output string under - print " DO_CORE : $DO_CORE\n"; - -- search for '# set default config' and add the new default entry (default to 0) -as well as the verbosity below - -- create a new .cf file - -# ET setup - -# output dir name -$SETUP_DIR = 'Setup-ET'; - -$DO_CORE = 1; -$DO_GAME_ET = 1; - - -- build a new setup using a .cf file. - -e.g. - -./setup.pl 'C:\\home\\Id' wolf.cf - -- load up Setup-Wolf/GtkRadiant.ipl into IS and build it! diff --git a/setup/win32/TODO b/setup/win32/TODO deleted file mode 100644 index 78e9b423..00000000 --- a/setup/win32/TODO +++ /dev/null @@ -1,74 +0,0 @@ -TODO list for 1.2 setup: - -- do we need some DO_* variables for the plugins too.. -- does the nightly do some safe checks while installing? - (i.e. query the GUID of the existing full installation we expect to find) - -short explanation / design doc: - ------------- - -Any setup is made from a core and some game packs -In the template -> buildable setup process, we give a few parameters to -customize things: - -- Put only the binaries or put everything -- put / don't put the editor core -- put / don't put any game pack - -To do this, we mostly rely on a search replace in the template code: - -DO_* are variables telling wether are not a given component is INCLUDED into -the setup. We have currently: - -DO_CORE: editor core content - (ex: the central editor binary) -DO_CORE_FULL: include the full setup content related to the code - (ex: the GtkRadiant manual) -DO_GAME_Q3: include binaries for Q3 -DO_GAME_FULL_Q3: media for the Q3 game pack - -we search and replace for '<>' '<>' etc. -more such variables will be .. DO_GAME_WOLF_BOOL, DO_GAME_Q1_BOOL etc. -the *_BOOL are meant to be replaced by '1' or '0' -we use equivalents *_BOOL_YESNO that are replaced by 'Yes' and 'No' -(those are used for 'include in build setting') - -------------- - -Installation paths: -the variables DIR_* are holding the install paths for core or game packs -DIR_CORE is the install path for the core -DIR_GAME_Q3 is the Q3 directory -DIR_GAMETOOLS_Q3 is the subdirectory path choosen below Q3 dir to install - game specific stuff - -When the setup executes, it must rely on the stuff included in the setup to -prompt the user with the right questions (where do I install the editor, -where do I install the Q3 game pack?). This should be tempered by prior -selection of what and whatnot to install if necessary. There should always -be a 'Default' path that allows installing quickly without answering any -difficult questions. - -------------- - -Nightly builds: - -this was added afterwards. nightlies are intended to be an upgrade -over an existing installation it only holds binaries - -also adds some specific component and file groups for the media stuff -that may have changed since the full setup - -how does it work? -a matter of 'include in build' configuration again -if nightly is on, the *_FULL_* variables will be disabled -and the *_NIGHTLY_* ones will be enabled -Component Definitions/Default.cdf is the critical file in this operation -added the following: -DO_CORE_BOOL_FULL_YESNO -DO_GAME_Q3_BOOL_FULL_YESNO -DO_GAME_WOLF_BOOL_FULL_YESNO -those three are to disable the media we only put in full setup -DO_NIGHLY_BOOL_YESNO -this is for the specific additions of the nightly setup diff --git a/setup/win32/all.cf b/setup/win32/all.cf deleted file mode 100644 index 98518195..00000000 --- a/setup/win32/all.cf +++ /dev/null @@ -1,16 +0,0 @@ -# Core + all game packs - -# output dir name -$SETUP_DIR = 'Setup-All'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_WOLF = 1; -$DO_GAME_JKII = 1; -$DO_GAME_STVEF = 1; -$DO_GAME_HALFLIFE = 1; -$DO_GAME_SOF2 = 1; -$DO_GAME_ET = 1; -$DO_GAME_JA = 1; -$DO_GAME_Q2 = 1; -$DO_GAME_HER2 = 1; diff --git a/setup/win32/bin/bspc.exe b/setup/win32/bin/bspc.exe deleted file mode 100644 index 7385e1eb..00000000 Binary files a/setup/win32/bin/bspc.exe and /dev/null differ diff --git a/setup/win32/bin/msvcr70.dll b/setup/win32/bin/msvcr70.dll deleted file mode 100644 index 2ef28fdd..00000000 Binary files a/setup/win32/bin/msvcr70.dll and /dev/null differ diff --git a/setup/win32/build.py b/setup/win32/build.py deleted file mode 100644 index 86adc57d..00000000 --- a/setup/win32/build.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import datetime -from installer import MSIPackage - -def format_date_today(): - return str(datetime.date.today()) - -package = MSIPackage("gtkradiant-1.5.0.xml") -package.writeMSI("template.msi", "GtkRadiant-1.5.0-" + format_date_today() + ".msi") - -#package = MSIPackage("q3a_example_maps.xml") -#package.writeMSI("template.msi", "Q3A-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("wolf_example_maps.xml") -#package.writeMSI("template.msi", "Wolf-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("ja_example_maps.xml") -#package.writeMSI("template.msi", "JA-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("et_example_maps.xml") -#package.writeMSI("template.msi", "ET-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("jk2_example_maps.xml") -#package.writeMSI("template.msi", "JK2-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("sof2_example_maps.xml") -#package.writeMSI("template.msi", "SoF2-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("q2_example_maps.xml") -#package.writeMSI("template.msi", "Q2-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("her2_example_maps.xml") -#package.writeMSI("template.msi", "Heretic2-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("hl_example_maps.xml") -#package.writeMSI("template.msi", "HalfLife-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("ef_example_maps.xml") -#package.writeMSI("template.msi", "STVEF-Example-Maps-" + format_date_today() + ".msi") - -#package = MSIPackage("warsow_mapping_files.xml") -#package.writeMSI("template.msi", "Warsow-mapping-files-" + format_date_today() + ".msi") diff --git a/setup/win32/classic.cf b/setup/win32/classic.cf deleted file mode 100644 index e2302161..00000000 --- a/setup/win32/classic.cf +++ /dev/null @@ -1,9 +0,0 @@ -# classic gaming special - -# output dir name -$SETUP_DIR = 'Setup-Classic'; - -$DO_CORE = 1; -$DO_GAME_HALFLIFE = 1; -$DO_GAME_Q2 = 1; -$DO_GAME_HER2 = 1; diff --git a/setup/win32/components/archivepak.xml b/setup/win32/components/archivepak.xml deleted file mode 100644 index edaa0399..00000000 --- a/setup/win32/components/archivepak.xml +++ /dev/null @@ -1,6 +0,0 @@ - - -

- - - diff --git a/setup/win32/components/archivewad.xml b/setup/win32/components/archivewad.xml deleted file mode 100644 index b9bef749..00000000 --- a/setup/win32/components/archivewad.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/archivezip.xml b/setup/win32/components/archivezip.xml deleted file mode 100644 index 40eb6ee7..00000000 --- a/setup/win32/components/archivezip.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/atk.xml b/setup/win32/components/atk.xml deleted file mode 100644 index d8d0a38f..00000000 --- a/setup/win32/components/atk.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/bobtoolz.xml b/setup/win32/components/bobtoolz.xml deleted file mode 100644 index f48ba12b..00000000 --- a/setup/win32/components/bobtoolz.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/brushexport.xml b/setup/win32/components/brushexport.xml deleted file mode 100644 index 5c44e8c2..00000000 --- a/setup/win32/components/brushexport.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/setup/win32/components/bspc.xml b/setup/win32/components/bspc.xml deleted file mode 100644 index dcb34b67..00000000 --- a/setup/win32/components/bspc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/cairo.xml b/setup/win32/components/cairo.xml deleted file mode 100644 index 49b12e52..00000000 --- a/setup/win32/components/cairo.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/darkplaces.xml b/setup/win32/components/darkplaces.xml deleted file mode 100644 index 8ef35dad..00000000 --- a/setup/win32/components/darkplaces.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/setup/win32/components/dbghelp.xml b/setup/win32/components/dbghelp.xml deleted file mode 100644 index 92823106..00000000 --- a/setup/win32/components/dbghelp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/doom3.xml b/setup/win32/components/doom3.xml deleted file mode 100644 index 724011c3..00000000 --- a/setup/win32/components/doom3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/ef.xml b/setup/win32/components/ef.xml deleted file mode 100644 index 722ab2ed..00000000 --- a/setup/win32/components/ef.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/ef_data.xml b/setup/win32/components/ef_data.xml deleted file mode 100644 index 44322076..00000000 --- a/setup/win32/components/ef_data.xml +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/ef_docs.xml b/setup/win32/components/ef_docs.xml deleted file mode 100644 index e6020d39..00000000 --- a/setup/win32/components/ef_docs.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/ef_tools.xml b/setup/win32/components/ef_tools.xml deleted file mode 100644 index 007d2463..00000000 --- a/setup/win32/components/ef_tools.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/entityq3.xml b/setup/win32/components/entityq3.xml deleted file mode 100644 index 903aaca4..00000000 --- a/setup/win32/components/entityq3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/et.xml b/setup/win32/components/et.xml deleted file mode 100644 index 8d03843b..00000000 --- a/setup/win32/components/et.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/et_data.xml b/setup/win32/components/et_data.xml deleted file mode 100644 index 5ace631c..00000000 --- a/setup/win32/components/et_data.xml +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/et_docs.xml b/setup/win32/components/et_docs.xml deleted file mode 100644 index 9f310596..00000000 --- a/setup/win32/components/et_docs.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/glib2.xml b/setup/win32/components/glib2.xml deleted file mode 100644 index a49f02e3..00000000 --- a/setup/win32/components/glib2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/gtk2.xml b/setup/win32/components/gtk2.xml deleted file mode 100644 index 563fa8d3..00000000 --- a/setup/win32/components/gtk2.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/gtkglext.xml b/setup/win32/components/gtkglext.xml deleted file mode 100644 index 51124498..00000000 --- a/setup/win32/components/gtkglext.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/setup/win32/components/gtkradiant.xml b/setup/win32/components/gtkradiant.xml deleted file mode 100644 index 60d815ec..00000000 --- a/setup/win32/components/gtkradiant.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/gtkradiant_data.xml b/setup/win32/components/gtkradiant_data.xml deleted file mode 100644 index 0f1528c3..00000000 --- a/setup/win32/components/gtkradiant_data.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/gtkradiant_docs.xml b/setup/win32/components/gtkradiant_docs.xml deleted file mode 100644 index 8bfbdd7c..00000000 --- a/setup/win32/components/gtkradiant_docs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/her2.xml b/setup/win32/components/her2.xml deleted file mode 100644 index 2aab401b..00000000 --- a/setup/win32/components/her2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/her2_data.xml b/setup/win32/components/her2_data.xml deleted file mode 100644 index 63161f50..00000000 --- a/setup/win32/components/her2_data.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/hl.xml b/setup/win32/components/hl.xml deleted file mode 100644 index b1d28121..00000000 --- a/setup/win32/components/hl.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/hl_data.xml b/setup/win32/components/hl_data.xml deleted file mode 100644 index c9ff859a..00000000 --- a/setup/win32/components/hl_data.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/hlcs_data.xml b/setup/win32/components/hlcs_data.xml deleted file mode 100644 index b4873d64..00000000 --- a/setup/win32/components/hlcs_data.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/icarus_manual.xml b/setup/win32/components/icarus_manual.xml deleted file mode 100644 index 407cbd9e..00000000 --- a/setup/win32/components/icarus_manual.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/iconv.xml b/setup/win32/components/iconv.xml deleted file mode 100644 index cb661244..00000000 --- a/setup/win32/components/iconv.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/imagehl.xml b/setup/win32/components/imagehl.xml deleted file mode 100644 index 1f8a0ee0..00000000 --- a/setup/win32/components/imagehl.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/imagem8.xml b/setup/win32/components/imagem8.xml deleted file mode 100644 index 8c55315e..00000000 --- a/setup/win32/components/imagem8.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/imagepng.xml b/setup/win32/components/imagepng.xml deleted file mode 100644 index b2d318f3..00000000 --- a/setup/win32/components/imagepng.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/imageq2.xml b/setup/win32/components/imageq2.xml deleted file mode 100644 index f2353b2f..00000000 --- a/setup/win32/components/imageq2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/imageq3.xml b/setup/win32/components/imageq3.xml deleted file mode 100644 index 9bc54cb8..00000000 --- a/setup/win32/components/imageq3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/intl.xml b/setup/win32/components/intl.xml deleted file mode 100644 index af47c1d1..00000000 --- a/setup/win32/components/intl.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/ja.xml b/setup/win32/components/ja.xml deleted file mode 100644 index 2f54fcc5..00000000 --- a/setup/win32/components/ja.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/ja_data.xml b/setup/win32/components/ja_data.xml deleted file mode 100644 index 486f13f6..00000000 --- a/setup/win32/components/ja_data.xml +++ /dev/null @@ -1,2183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/ja_tools.xml b/setup/win32/components/ja_tools.xml deleted file mode 100644 index 31ec1d5b..00000000 --- a/setup/win32/components/ja_tools.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/jk2.xml b/setup/win32/components/jk2.xml deleted file mode 100644 index 7244c195..00000000 --- a/setup/win32/components/jk2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/jk2_data.xml b/setup/win32/components/jk2_data.xml deleted file mode 100644 index 999ad8f4..00000000 --- a/setup/win32/components/jk2_data.xml +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/jk2_docs.xml b/setup/win32/components/jk2_docs.xml deleted file mode 100644 index 251ccc09..00000000 --- a/setup/win32/components/jk2_docs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/jk2_raven_docs.xml b/setup/win32/components/jk2_raven_docs.xml deleted file mode 100644 index a7c31b0f..00000000 --- a/setup/win32/components/jk2_raven_docs.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/setup/win32/components/jk2_tools.xml b/setup/win32/components/jk2_tools.xml deleted file mode 100644 index 3627b5b5..00000000 --- a/setup/win32/components/jk2_tools.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/libmhash.xml b/setup/win32/components/libmhash.xml deleted file mode 100644 index f307af5f..00000000 --- a/setup/win32/components/libmhash.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/libpng13.xml b/setup/win32/components/libpng13.xml deleted file mode 100644 index ab7ab6da..00000000 --- a/setup/win32/components/libpng13.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/libxml2.xml b/setup/win32/components/libxml2.xml deleted file mode 100644 index a95a2736..00000000 --- a/setup/win32/components/libxml2.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/mapq3.xml b/setup/win32/components/mapq3.xml deleted file mode 100644 index 7a2b4214..00000000 --- a/setup/win32/components/mapq3.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/mapxml.xml b/setup/win32/components/mapxml.xml deleted file mode 100644 index 5f01e251..00000000 --- a/setup/win32/components/mapxml.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/modelmd3.xml b/setup/win32/components/modelmd3.xml deleted file mode 100644 index dad1e37e..00000000 --- a/setup/win32/components/modelmd3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/modelpico.xml b/setup/win32/components/modelpico.xml deleted file mode 100644 index 67e62c32..00000000 --- a/setup/win32/components/modelpico.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/msvcr80.xml b/setup/win32/components/msvcr80.xml deleted file mode 100644 index 696121a8..00000000 --- a/setup/win32/components/msvcr80.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/setup/win32/components/nexuiz.xml b/setup/win32/components/nexuiz.xml deleted file mode 100644 index 6dbad9da..00000000 --- a/setup/win32/components/nexuiz.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/setup/win32/components/pango.xml b/setup/win32/components/pango.xml deleted file mode 100644 index 28847287..00000000 --- a/setup/win32/components/pango.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/prey.xml b/setup/win32/components/prey.xml deleted file mode 100644 index ffb43216..00000000 --- a/setup/win32/components/prey.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/prtview.xml b/setup/win32/components/prtview.xml deleted file mode 100644 index 40fd2c93..00000000 --- a/setup/win32/components/prtview.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/setup/win32/components/q1.xml b/setup/win32/components/q1.xml deleted file mode 100644 index e2f5e2bf..00000000 --- a/setup/win32/components/q1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/q2.xml b/setup/win32/components/q2.xml deleted file mode 100644 index 3ecde5b5..00000000 --- a/setup/win32/components/q2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/q2_data.xml b/setup/win32/components/q2_data.xml deleted file mode 100644 index c2e33794..00000000 --- a/setup/win32/components/q2_data.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/q2map.xml b/setup/win32/components/q2map.xml deleted file mode 100644 index a8a03e8f..00000000 --- a/setup/win32/components/q2map.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/q3.xml b/setup/win32/components/q3.xml deleted file mode 100644 index 153e3746..00000000 --- a/setup/win32/components/q3.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/q3a_compile_manual.xml b/setup/win32/components/q3a_compile_manual.xml deleted file mode 100644 index f21b77ce..00000000 --- a/setup/win32/components/q3a_compile_manual.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/q3a_data.xml b/setup/win32/components/q3a_data.xml deleted file mode 100644 index 2a0bc8cf..00000000 --- a/setup/win32/components/q3a_data.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/q3a_model_manual.xml b/setup/win32/components/q3a_model_manual.xml deleted file mode 100644 index 361cdea2..00000000 --- a/setup/win32/components/q3a_model_manual.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/setup/win32/components/q3a_shader_manual.xml b/setup/win32/components/q3a_shader_manual.xml deleted file mode 100644 index e4f7aa70..00000000 --- a/setup/win32/components/q3a_shader_manual.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/q3a_terrain_manual.xml b/setup/win32/components/q3a_terrain_manual.xml deleted file mode 100644 index 36723ffb..00000000 --- a/setup/win32/components/q3a_terrain_manual.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/q3map2.xml b/setup/win32/components/q3map2.xml deleted file mode 100644 index 442d5627..00000000 --- a/setup/win32/components/q3map2.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/q3map2_docs.xml b/setup/win32/components/q3map2_docs.xml deleted file mode 100644 index fcaae12c..00000000 --- a/setup/win32/components/q3map2_docs.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/q3ta_data.xml b/setup/win32/components/q3ta_data.xml deleted file mode 100644 index 7c569a51..00000000 --- a/setup/win32/components/q3ta_data.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/setup/win32/components/q3ta_editing_manual.xml b/setup/win32/components/q3ta_editing_manual.xml deleted file mode 100644 index cac2fb65..00000000 --- a/setup/win32/components/q3ta_editing_manual.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/q3ta_teams_manual.xml b/setup/win32/components/q3ta_teams_manual.xml deleted file mode 100644 index bbbff411..00000000 --- a/setup/win32/components/q3ta_teams_manual.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/q4.xml b/setup/win32/components/q4.xml deleted file mode 100644 index 83d07389..00000000 --- a/setup/win32/components/q4.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/qdata3.xml b/setup/win32/components/qdata3.xml deleted file mode 100644 index e4c66326..00000000 --- a/setup/win32/components/qdata3.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/components/radiant_manual.xml b/setup/win32/components/radiant_manual.xml deleted file mode 100644 index bc57b7a6..00000000 --- a/setup/win32/components/radiant_manual.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/raven.xml b/setup/win32/components/raven.xml deleted file mode 100644 index 1df785d3..00000000 --- a/setup/win32/components/raven.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/setup/win32/components/shaderplug.xml b/setup/win32/components/shaderplug.xml deleted file mode 100644 index a32d816c..00000000 --- a/setup/win32/components/shaderplug.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/setup/win32/components/shadersq3.xml b/setup/win32/components/shadersq3.xml deleted file mode 100644 index 114b21bb..00000000 --- a/setup/win32/components/shadersq3.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/setup/win32/components/sof2.xml b/setup/win32/components/sof2.xml deleted file mode 100644 index 2a208472..00000000 --- a/setup/win32/components/sof2.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/sof2_data.xml b/setup/win32/components/sof2_data.xml deleted file mode 100644 index f813e816..00000000 --- a/setup/win32/components/sof2_data.xml +++ /dev/null @@ -1,848 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/sof2_docs.xml b/setup/win32/components/sof2_docs.xml deleted file mode 100644 index 168d8df5..00000000 --- a/setup/win32/components/sof2_docs.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/setup/win32/components/sof2_raven_docs.xml b/setup/win32/components/sof2_raven_docs.xml deleted file mode 100644 index 05fd609a..00000000 --- a/setup/win32/components/sof2_raven_docs.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/setup/win32/components/sof2_tools.xml b/setup/win32/components/sof2_tools.xml deleted file mode 100644 index af8e0fb8..00000000 --- a/setup/win32/components/sof2_tools.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/sunplug.xml b/setup/win32/components/sunplug.xml deleted file mode 100644 index 9fd915b6..00000000 --- a/setup/win32/components/sunplug.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/setup/win32/components/trem.xml b/setup/win32/components/trem.xml deleted file mode 100644 index a6440fbb..00000000 --- a/setup/win32/components/trem.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/trem_compile_manual.xml b/setup/win32/components/trem_compile_manual.xml deleted file mode 100644 index 8f735227..00000000 --- a/setup/win32/components/trem_compile_manual.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/trem_model_manual.xml b/setup/win32/components/trem_model_manual.xml deleted file mode 100644 index 5bd065bc..00000000 --- a/setup/win32/components/trem_model_manual.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/setup/win32/components/trem_shader_manual.xml b/setup/win32/components/trem_shader_manual.xml deleted file mode 100644 index dfeaffdd..00000000 --- a/setup/win32/components/trem_shader_manual.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/trem_terrain_manual.xml b/setup/win32/components/trem_terrain_manual.xml deleted file mode 100644 index a629c854..00000000 --- a/setup/win32/components/trem_terrain_manual.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/ufoai.xml b/setup/win32/components/ufoai.xml deleted file mode 100644 index 7acb9fcd..00000000 --- a/setup/win32/components/ufoai.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/setup/win32/components/ufoaiplug.xml b/setup/win32/components/ufoaiplug.xml deleted file mode 100644 index aad3a79c..00000000 --- a/setup/win32/components/ufoaiplug.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/vfsq3.xml b/setup/win32/components/vfsq3.xml deleted file mode 100644 index aff6d851..00000000 --- a/setup/win32/components/vfsq3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/setup/win32/components/warsow.xml b/setup/win32/components/warsow.xml deleted file mode 100644 index 23fb320b..00000000 --- a/setup/win32/components/warsow.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/setup/win32/components/warsow_data.xml b/setup/win32/components/warsow_data.xml deleted file mode 100644 index b768a8a4..00000000 --- a/setup/win32/components/warsow_data.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/setup/win32/components/warsow_docs.xml b/setup/win32/components/warsow_docs.xml deleted file mode 100644 index 6a84f7e2..00000000 --- a/setup/win32/components/warsow_docs.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/wolf.xml b/setup/win32/components/wolf.xml deleted file mode 100644 index 7df72809..00000000 --- a/setup/win32/components/wolf.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/setup/win32/components/wolf_data.xml b/setup/win32/components/wolf_data.xml deleted file mode 100644 index 7e23ae5c..00000000 --- a/setup/win32/components/wolf_data.xml +++ /dev/null @@ -1,887 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/wolf_docs.xml b/setup/win32/components/wolf_docs.xml deleted file mode 100644 index b82b1655..00000000 --- a/setup/win32/components/wolf_docs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/setup/win32/components/wolf_tools.xml b/setup/win32/components/wolf_tools.xml deleted file mode 100644 index cef04048..00000000 --- a/setup/win32/components/wolf_tools.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/setup/win32/components/zhlt.xml b/setup/win32/components/zhlt.xml deleted file mode 100644 index e3aa57b7..00000000 --- a/setup/win32/components/zhlt.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/components/zlib.xml b/setup/win32/components/zlib.xml deleted file mode 100644 index f7153234..00000000 --- a/setup/win32/components/zlib.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/setup/win32/ef_example_maps.xml b/setup/win32/ef_example_maps.xml deleted file mode 100644 index 56c9c277..00000000 --- a/setup/win32/ef_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/et.cf b/setup/win32/et.cf deleted file mode 100644 index 0dfec74e..00000000 --- a/setup/win32/et.cf +++ /dev/null @@ -1,7 +0,0 @@ -# ET setup - -# output dir name -$SETUP_DIR = 'Setup-ET'; - -$DO_CORE = 1; -$DO_GAME_ET = 1; diff --git a/setup/win32/et_example_maps.xml b/setup/win32/et_example_maps.xml deleted file mode 100644 index f58b2814..00000000 --- a/setup/win32/et_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/gtkradiant-1.5.0.xml b/setup/win32/gtkradiant-1.5.0.xml deleted file mode 100644 index 37bfb5e6..00000000 --- a/setup/win32/gtkradiant-1.5.0.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/halflife.cf b/setup/win32/halflife.cf deleted file mode 100644 index 710ab364..00000000 --- a/setup/win32/halflife.cf +++ /dev/null @@ -1,7 +0,0 @@ -# Core + Halflife game pack - -# output dir name -$SETUP_DIR = 'Setup-Halflife'; - -$DO_CORE = 1; -$DO_GAME_HALFLIFE = 1; diff --git a/setup/win32/her2_example_maps.xml b/setup/win32/her2_example_maps.xml deleted file mode 100644 index d52ea000..00000000 --- a/setup/win32/her2_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/heretic2.cf b/setup/win32/heretic2.cf deleted file mode 100644 index 34050c3a..00000000 --- a/setup/win32/heretic2.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-HER2'; - -$DO_CORE = 1; -$DO_GAME_HER2 = 1; diff --git a/setup/win32/hl_example_maps.xml b/setup/win32/hl_example_maps.xml deleted file mode 100644 index a9d9ad5b..00000000 --- a/setup/win32/hl_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/id-hl.cf b/setup/win32/id-hl.cf deleted file mode 100644 index 21dab8a7..00000000 --- a/setup/win32/id-hl.cf +++ /dev/null @@ -1,11 +0,0 @@ -# Core + all game packs - -# output dir name -$SETUP_DIR = 'Setup-IdHL'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_WOLF = 1; -$DO_GAME_HALFLIFE = 1; -$DO_GAME_ET = 1; -$DO_GAME_Q2 = 1; diff --git a/setup/win32/installer.py b/setup/win32/installer.py deleted file mode 100644 index 05e95821..00000000 --- a/setup/win32/installer.py +++ /dev/null @@ -1,432 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os.path -import xml.dom -import os -import stat -import string - -from xml.dom.minidom import parse - -import msi - -cwd = os.getcwd() -print("cwd=" + cwd) - - -def format_guid(guid): - return "{" + guid.upper() + "}" - -def generate_guid(): - os.system("uuidgen > tmp_uuid.txt") - uuidFile = file("tmp_uuid.txt", "rt") - guid = format_guid(uuidFile.read(36)) - uuidFile.close() - os.system("del tmp_uuid.txt") - return guid - -def path_components(path): - directories = [] - remaining = path - while(remaining != ""): - splitPath = os.path.split(remaining) - remaining = splitPath[0] - directories.append(splitPath[1]) - directories.reverse() - return directories - - - -class Feature: - def __init__(self, feature, parent, title, desc, display, level, directory, attributes): - self.feature = feature - self.parent = parent - self.title = title - self.desc = desc - self.display = display - self.level = level - self.directory = directory - self.attributes = attributes - -class FeatureComponent: - def __init__(self, feature, component): - self.feature = feature - self.component = component - -class Directory: - def __init__(self, directory, parent, default): - self.directory = directory - self.parent = parent - self.default = default - -class Component: - def __init__(self, name, keypath, directory, attributes): - self.name = name - self.keypath = keypath - self.directory = directory - self.attributes = attributes - -class File: - def __init__(self, file, component, filename, filesize, sequence): - self.file = file - self.component = component - self.filename = filename - self.filesize = filesize - self.sequence = sequence - -class Shortcut: - def __init__(self, name, directory, component, feature, icon): - self.name = name - self.directory = directory - self.component = component - self.feature = feature - self.icon = icon - -class ComponentFiles: - def __init__(self, name, files, directory): - self.name = name - self.files = files - self.directory = directory - -class MSIPackage: - def __init__(self, packageFile): - self.code = "" - self.name = "" - self.version = "" - self.target = "" - self.license = "" - self.cabList = [] - self.featureCount = 0 - self.featureTable = [] - self.featurecomponentsTable = [] - self.componentCache = {} - self.componentCount = 0 - self.componentTable = {} - self.directoryTree = {} - self.directoryCount = 0 - self.directoryTable = [] - self.fileCount = 0 - self.fileTable = [] - self.shortcutCount = 0 - self.shortcutTable = [] - self.createPackage(packageFile) - - def addDirectory(self, directoryName, parentKey, directory): - if(not directory.has_key(directoryName)): - directoryKey = "d" + str(self.directoryCount) - self.directoryCount = self.directoryCount + 1 - print("adding msi directory " + directoryKey + " parent=" + parentKey + " name=" + directoryName) - self.directoryTable.append(Directory(directoryKey, parentKey, directoryKey + "|" + directoryName)) - directory[directoryName] = (directoryKey, {}) - else: - print("ignored duplicate directory " + directoryName) - return directory[directoryName] - - def parseComponentTree(self, treeElement, parent, directory, directoryPath, component): - files = [] - for childElement in treeElement.childNodes: - if (childElement.nodeName == "file"): - fileName = childElement.getAttribute("name") - filePath = os.path.join(directoryPath, fileName) - if(fileName != "" and os.path.exists(filePath)): - print("found file " + filePath) - file = (fileName, os.path.getsize(filePath), filePath) - files.append(file) - else: - raise Exception("file not found " + filePath) - - if (childElement.nodeName == "dir"): - directoryName = childElement.getAttribute("name") - print("found directory " + directoryName) - directoryPair = self.addDirectory(directoryName, parent, directory) - self.parseComponentTree(childElement, directoryPair[0], directoryPair[1], os.path.join(directoryPath, directoryName), component) - - count = len(files) - if(count != 0): - componentKey = "c" + str(self.componentCount) - self.componentCount = self.componentCount + 1 - msiComponent = ComponentFiles(componentKey, files, parent); - print("adding msi component " + msiComponent.name + " with " + str(count) + " file(s)") - component.append(msiComponent) - - def parseComponent(self, componentElement, rootPath): - shortcut = componentElement.getAttribute("shortcut") - icon = componentElement.getAttribute("icon") - component = [] - subDirectory = componentElement.getAttribute("subdirectory") - directoryPair = ("TARGETDIR", self.directoryTree) - for directoryName in path_components(subDirectory): - directoryPair = self.addDirectory(directoryName, directoryPair[0], directoryPair[1]) - self.parseComponentTree(componentElement, directoryPair[0], directoryPair[1], rootPath, component) - component.reverse() - print("component requires " + str(len(component)) + " msi component(s)") - return (component, shortcut, icon) - - def parseComponentXML(self, filename, rootPath): - componentDocument = parse(filename) - print("parsing component file " + filename) - componentElement = componentDocument.documentElement - return self.parseComponent(componentElement, rootPath) - - def componentForName(self, name, rootPath): - if(self.componentCache.has_key(name)): - return self.componentCache[name] - else: - component = self.parseComponentXML(name, rootPath) - self.componentCache[name] = component - return component - - def parseFeature(self, featureElement, parent, index): - featureName = "ft" + str(self.featureCount) - self.featureCount = self.featureCount + 1 - title = featureElement.getAttribute("name") - desc = featureElement.getAttribute("desc") - print("adding msi feature " + featureName + " title=" + title) - feature = Feature(featureName, parent, title, desc, index, 1, "TARGETDIR", 8) - self.featureTable.append(feature) - featureComponents = {} - indexChild = 2 - for childElement in featureElement.childNodes: - if (childElement.nodeName == "feature"): - self.parseFeature(childElement, featureName, indexChild) - indexChild = indexChild + 2 - elif (childElement.nodeName == "component"): - componentName = os.path.normpath(os.path.join(cwd, childElement.getAttribute("name"))) - if(featureComponents.has_key(componentName)): - raise Exception("feature \"" + title + "\" contains more than one reference to \"" + componentName + "\"") - featureComponents[componentName] = "" - componentSource = os.path.normpath(childElement.getAttribute("root")) - print("found component reference " + componentName) - componentPair = self.componentForName(componentName, componentSource) - component = componentPair[0] - for msiComponent in component: - print("adding msi featurecomponent " + featureName + " name=" + msiComponent.name) - self.featurecomponentsTable.append(FeatureComponent(featureName, msiComponent.name)) - - if(not self.componentTable.has_key(msiComponent.name)): - keyPath = "" - for fileTuple in msiComponent.files: - fileKey = "f" + str(self.fileCount) - self.fileCount = self.fileCount + 1 - if(keyPath == ""): - keyPath = fileKey - print("component " + msiComponent.name + " keypath=" + keyPath) - print("adding msi file " + fileKey + " name=" + fileTuple[0] + " size=" + str(fileTuple[1])) - self.fileTable.append(File(fileKey, msiComponent.name, fileKey + "|" + fileTuple[0], fileTuple[1], self.fileCount)) - self.cabList.append("\"" + fileTuple[2] + "\" " + fileKey + "\n") - self.componentTable[msiComponent.name] = Component(msiComponent.name, keyPath, msiComponent.directory, 0) - - shortcut = componentPair[1] - if(shortcut != ""): - shortcutName = "sc" + str(self.shortcutCount) - self.shortcutCount = self.shortcutCount + 1 - self.shortcutTable.append(Shortcut(shortcutName + "|" + shortcut, "ProductShortcutFolder", component[0].name, featureName, componentPair[2])) - print("adding msi shortcut " + shortcut) - - def parsePackage(self, packageElement): - index = 2 - self.code = packageElement.getAttribute("code") - if(self.code == ""): - raise Exception("invalid package code") - self.version = packageElement.getAttribute("version") - if(self.version == ""): - raise Exception("invalid package version") - self.name = packageElement.getAttribute("name") - if(self.name == ""): - raise Exception("invalid package name") - self.target = packageElement.getAttribute("target") - if(self.target == ""): - raise Exception("invalid target directory") - self.license = packageElement.getAttribute("license") - if(self.license == ""): - raise Exception("invalid package license agreement") - for childElement in packageElement.childNodes: - if (childElement.nodeName == "feature"): - self.parseFeature(childElement, "", index) - index = index + 2 - - def parsePackageXML(self, filename): - document = parse(filename) - print("parsing package file " + filename) - self.parsePackage(document.documentElement) - - def createPackage(self, packageFile): - self.directoryTable.append(Directory("TARGETDIR", "", "SourceDir")) - self.directoryTable.append(Directory("ProgramMenuFolder", "TARGETDIR", ".")) - self.directoryTable.append(Directory("SystemFolder", "TARGETDIR", ".")) - self.parsePackageXML(packageFile) - if(self.shortcutCount != 0): - self.directoryTable.append(Directory("ProductShortcutFolder", "ProgramMenuFolder", "s0|" + self.name)) - - def writeFileTable(self, name): - tableFile = file(name, "wt") - tableFile.write("File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\ns72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\nFile\tFile\n") - for row in self.fileTable: - tableFile.write(row.file + "\t" + row.component + "\t" + row.filename + "\t" + str(row.filesize) + "\t" + "" + "\t" + "" + "\t" + "0" + "\t" + str(row.sequence) + "\n") - - def writeComponentTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\ns72\tS38\ts72\ti2\tS255\tS72\nComponent\tComponent\n") - for k, row in self.componentTable.iteritems(): - tableFile.write(row.name + "\t" + generate_guid() + "\t" + row.directory + "\t" + str(row.attributes) + "\t" + "" + "\t" + row.keypath + "\n") - - def writeFeatureComponentsTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Feature_\tComponent_\ns38\ts72\nFeatureComponents\tFeature_\tComponent_\n") - for row in self.featurecomponentsTable: - tableFile.write(row.feature + "\t" + row.component + "\n") - - def writeDirectoryTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Directory\tDirectory_Parent\tDefaultDir\ns72\tS72\tl255\nDirectory\tDirectory\n") - for row in self.directoryTable: - tableFile.write(row.directory + "\t" + row.parent + "\t" + row.default + "\n") - - def writeFeatureTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\ns38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\nFeature\tFeature\n") - for row in self.featureTable: - tableFile.write(row.feature + "\t" + row.parent + "\t" + row.title + "\t" + row.desc + "\t" + str(row.display) + "\t" + str(row.level) + "\t" + row.directory + "\t" + str(row.attributes) + "\n") - - def writeMediaTable(self, name): - tableFile = file(name, "wt") - tableFile.write("DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\ni2\ti2\tL64\tS255\tS32\tS72\nMedia\tDiskId\n") - tableFile.write("1" + "\t" + str(self.fileCount) + "\t" + "" + "\t" + "#archive.cab" + "\t" + "" + "\t" + "" + "\n") - - def writeShortcutTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\ns72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\nShortcut\tShortcut\n") - for row in self.shortcutTable: - tableFile.write(row.component + "\t" + row.directory + "\t" + row.name + "\t" + row.component + "\t" + row.feature + "\t" + "" + "\t" + "" + "\t" + "" + "\t" + row.icon + "\t" + "" + "\t" + "" + "\t" + "" + "\n") - - def writeRemoveFileTable(self, name): - tableFile = file(name, "wt") - tableFile.write("FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\ns72\ts72\tL255\ts72\ti2\nRemoveFile\tFileKey\n") - count = 0 - for row in self.shortcutTable: - tableFile.write("rf" + str(count) + "\t" + row.component + "\t" + "" + "\t" + row.directory + "\t" + "2" + "\n") - count = count + 1 - - def writeCustomActionTable(self, name): - tableFile = file(name, "wt") - tableFile.write("Action\tType\tSource\tTarget\ns72\ti2\tS72\tS255\nCustomAction\tAction\n") - tableFile.write("caSetTargetDir\t51\tTARGETDIR\t" + self.target) - - def writeUpgradeTable(self, name): - tableFile = file(name, "wt") - tableFile.write("UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\ns38\tS20\tS20\tS255\ti4\tS255\ts72\nUpgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n") - tableFile.write(format_guid(self.code) + "\t\t" + self.version + "\t1033\t1\t\tRELATEDPRODUCTS") - - def writeMSILicense(self, msiName, licenseName): - if(not os.path.exists(licenseName)): - raise Exception("file not found: " + licenseName) - print("license=\"" + licenseName + "\"") - licenseFile = file(licenseName, "rt") - text = licenseFile.read(1024) - rtfString = "" - while(text != ""): - rtfString += text - text = licenseFile.read(1024) - msiDB = msi.Database(msiName) - msiDB.setlicense(rtfString[:-1]) - msiDB.commit() - - def writeMSIProperties(self, msiName): - msiDB = msi.Database(msiName) - print("ProductCode=" + format_guid(self.code)) - msiDB.setproperty("ProductCode", format_guid(self.code)) - print("UpgradeCode=" + format_guid(self.code)) - msiDB.setproperty("UpgradeCode", format_guid(self.code)) - print("ProductName=" + self.name) - msiDB.setproperty("ProductName", self.name) - print("ProductVersion=" + self.version) - msiDB.setproperty("ProductVersion", self.version) - msiDB.setproperty("RELATEDPRODUCTS", "") - msiDB.setproperty("SecureCustomProperties", "RELATEDPRODUCTS") - msiDB.commit() - - def writeMSI(self, msiTemplate, msiName): - msiWorkName = "working.msi" - if(os.system("copy " + msiTemplate + " " + msiWorkName) != 0): - raise Exception("copy failed") - os.system("msiinfo " + msiWorkName + " /w 2 /v " + generate_guid() + " /a \"Radiant Community\" /j \"" + self.name + "\" /o \"This installation database contains the logic and data needed to install " + self.name + "\"") - - self.writeMSIProperties(msiWorkName) - self.writeMSILicense(msiWorkName, self.license) - - self.writeFileTable("File.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" File.idt") - os.system("del File.idt") - self.writeComponentTable("Component.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Component.idt") - os.system("del Component.idt") - self.writeFeatureComponentsTable("FeatureComponents.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" FeatureComponents.idt") - os.system("del FeatureComponents.idt") - self.writeDirectoryTable("Directory.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Directory.idt") - os.system("del Directory.idt") - self.writeFeatureTable("Feature.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Feature.idt") - os.system("del Feature.idt") - self.writeMediaTable("Media.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Media.idt") - os.system("del Media.idt") - self.writeShortcutTable("Shortcut.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Shortcut.idt") - os.system("del Shortcut.idt") - self.writeRemoveFileTable("RemoveFile.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" RemoveFile.idt") - os.system("del RemoveFile.idt") - self.writeCustomActionTable("CustomAction.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" CustomAction.idt") - os.system("del CustomAction.idt") - self.writeUpgradeTable("Upgrade.idt") - os.system("msidb -d " + msiWorkName + " -i -f \"" + cwd + "\" Upgrade.idt") - os.system("del Upgrade.idt") - - cabText = file("archive_files.txt", "wt") - for cabDirective in self.cabList: - cabText.write(cabDirective) - cabText.close() - if(os.system("cabarc -m LZX:21 n archive.cab @archive_files.txt") != 0): - raise Exception("cabarc returned error") - os.system("del archive_files.txt") - os.system("msidb -d " + msiWorkName + " -a archive.cab") - os.system("del archive.cab") - - - #print("running standard MSI validators ...") - #if(os.system("msival2 " + msiWorkName + " darice.cub > darice.txt") != 0): - # raise Exception("MSI VALIDATION ERROR: see darice.txt") - - #print("running Logo Program validators ...") - #if(os.system("msival2 " + msiWorkName + " logo.cub > logo.txt") != 0): - # raise Exception("MSI VALIDATION ERROR: see logo.txt") - #print("running XP Logo Program validators ...") - #if(os.system("msival2 " + msiWorkName + " XPlogo.cub > XPlogo.txt") != 0): - # raise Exception("MSI VALIDATION ERROR: see XPlogo.txt") - - msiNameQuoted = "\"" + msiName + "\"" - if(os.path.exists(os.path.join(".\\", msiName)) and os.system("del " + msiNameQuoted) != 0): - raise Exception("failed to delete old target") - if(os.system("rename " + msiWorkName + " " + msiNameQuoted) != 0): - raise Exception("failed to rename new target") - diff --git a/setup/win32/ja.cf b/setup/win32/ja.cf deleted file mode 100644 index 9a3988e8..00000000 --- a/setup/win32/ja.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-JA'; - -$DO_CORE = 1; -$DO_GAME_JA = 1; diff --git a/setup/win32/ja_example_maps.xml b/setup/win32/ja_example_maps.xml deleted file mode 100644 index 7a521f61..00000000 --- a/setup/win32/ja_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/jk2.cf b/setup/win32/jk2.cf deleted file mode 100644 index 09eb03a2..00000000 --- a/setup/win32/jk2.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-JK2'; - -$DO_CORE = 1; -$DO_GAME_JKII = 1; diff --git a/setup/win32/msi.py b/setup/win32/msi.py deleted file mode 100644 index a01f15f7..00000000 --- a/setup/win32/msi.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import msiquery - -class Record: - def __init__(self, record): - self.record = record - - def setstring(self, index, string): - self.record.setstring(index, string) - -class View: - def __init__(self, view): - self.view = view - - def fetch(self): - record = self.view.fetch() - if(record == None): - raise Exception("no records available") - return Record(record) - - def update(self, record): - self.view.update(record.record) - -class Database: - def __init__(self, name): - self.msiDB = msiquery.MsiDB(name) - - def commit(self): - result = self.msiDB.commit() - if(result != 0): - raise Exception("msi commit failed: error " + str(result)) - - def openview(self, query): - view = self.msiDB.openview(query) - if(view == None): - raise Exception("msi openview failed") - return View(view); - - def setproperty(self, propertyName, propertyValue): - query = "UPDATE `Property` SET `Property`.`Value`='" + propertyValue + "' WHERE `Property`.`Property`='" + propertyName + "'" - self.openview(query) - - def setlicense(self, rtfString): - view = self.openview("SELECT `Control`.`Text` FROM `Control` WHERE `Control`.`Control`='AgreementText'") - record = view.fetch(); - record.setstring(1, rtfString) - view.update(record) - diff --git a/setup/win32/msi/msiquery.c b/setup/win32/msi/msiquery.c deleted file mode 100644 index ca6f4fde..00000000 --- a/setup/win32/msi/msiquery.c +++ /dev/null @@ -1,474 +0,0 @@ -/* -Copyright (C) 2001-2006 William Joseph. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "Python.h" -#include "structmember.h" - -#include -#include -#include - -typedef struct { - PyObject_HEAD - MSIHANDLE handle; -} MsiRecord; - -static void -MsiRecord_dealloc(MsiRecord* self) -{ - if(self->handle != 0) - { - unsigned int result = MsiCloseHandle(self->handle); - } - self->ob_type->tp_free((PyObject*)self); -} - -static PyObject * -MsiRecord_new(PyTypeObject *type, PyObject *args) -{ - MsiRecord *self; - - self = (MsiRecord *)type->tp_alloc(type, 0); - if (self != NULL) - { - self->handle = 0; - } - - return (PyObject *)self; -} - -static int -MsiRecord_init(MsiRecord *self, PyObject *args) -{ - return 0; -} - -static PyMemberDef MsiRecord_members[] = { - {NULL} /* Sentinel */ -}; - -static PyObject * -MsiRecord_getstring(MsiRecord* self, PyObject *args) -{ - char string[16384]; - DWORD size = 16384; - int index; - unsigned int result = 1; - if (!PyArg_ParseTuple(args, "i", &index)) - { - return NULL; - } - if(self->handle != 0) - { - if(MsiRecordIsNull(self->handle, index)) - { - puts("null record index"); - } - result = MsiRecordGetString(self->handle, index, string, &size); - printf("string: %s, index: %i\n", string, index); - if(result != 0) - { - strcpy(string, "bleh"); - } - } - return PyString_FromString(string); -} - -static PyObject * -MsiRecord_setstring(MsiRecord* self, PyObject *args) -{ - char* string; - int index; - unsigned int result = 1; - if (!PyArg_ParseTuple(args, "is", &index, &string)) - { - return NULL; - } - if(self->handle != 0) - { - result = MsiRecordSetString(self->handle, index, string); - } - return Py_BuildValue("i", result); -} - -static PyMethodDef MsiRecord_methods[] = { - {"getstring", (PyCFunction)MsiRecord_getstring, METH_VARARGS, - "MsiRecordGetString" - }, - {"setstring", (PyCFunction)MsiRecord_setstring, METH_VARARGS, - "MsiRecordSetString" - }, - {NULL} /* Sentinel */ -}; - -static PyTypeObject MsiRecordType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "msiquery.MsiRecord", /*tp_name*/ - sizeof(MsiRecord), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)MsiRecord_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "MsiRecord objects", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - MsiRecord_methods, /* tp_methods */ - MsiRecord_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)MsiRecord_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)MsiRecord_new, /* tp_new */ -}; - -PyObject* -MsiRecord_FromHandle(MSIHANDLE handle) -{ - MsiRecord *record = (MsiRecord *)MsiRecordType.tp_new(&MsiRecordType, NULL, NULL); - record->handle = handle; - return (PyObject*)record; -} - - -typedef struct { - PyObject_HEAD - MSIHANDLE handle; -} MsiView; - -static void -MsiView_dealloc(MsiView* self) -{ - if(self->handle != 0) - { - unsigned int result; - result = MsiViewClose(self->handle); - result = MsiCloseHandle(self->handle); - } - self->ob_type->tp_free((PyObject*)self); -} - -static PyObject * -MsiView_new(PyTypeObject *type, PyObject *args) -{ - MsiView *self; - - self = (MsiView *)type->tp_alloc(type, 0); - if (self != NULL) - { - self->handle = 0; - } - - return (PyObject *)self; -} - -static int -MsiView_init(MsiView *self) -{ - return 0; -} - -static PyMemberDef MsiView_members[] = { - {NULL} /* Sentinel */ -}; - -static PyObject * -MsiView_fetch(MsiView* self) -{ - unsigned int result = 1; - MSIHANDLE record; - result = MsiViewFetch(self->handle, &record); - if(result == 0) - { - return MsiRecord_FromHandle(record); - } - else - { - Py_INCREF(Py_None); - return Py_None; - } -} - -static PyObject * -MsiView_update(MsiView* self, PyObject *args) -{ - unsigned int result = 1; - MsiRecord *record; - if(!PyArg_ParseTuple(args, "O!", &MsiRecordType, &record)) - { - return NULL; - } - result = MsiViewModify(self->handle, MSIMODIFY_UPDATE, record->handle); - return Py_BuildValue("i", result); -} - -static PyMethodDef MsiView_methods[] = { - {"fetch", (PyCFunction)MsiView_fetch, METH_NOARGS, - "MsiViewFetch" - }, - {"update", (PyCFunction)MsiView_update, METH_VARARGS, - "MsiViewModify(UPDATE)" - }, - {NULL} /* Sentinel */ -}; - -static PyTypeObject MsiViewType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "msiquery.MsiView", /*tp_name*/ - sizeof(MsiView), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)MsiView_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "MsiView objects", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - MsiView_methods, /* tp_methods */ - MsiView_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)MsiView_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)MsiView_new, /* tp_new */ -}; - -PyObject* -MsiView_FromHandle(MSIHANDLE handle) -{ - MsiView *view = (MsiView *)MsiViewType.tp_new(&MsiViewType, NULL, NULL); - view->handle = handle; - MsiViewExecute(handle, 0); - return (PyObject*)view; -} - - -typedef struct { - PyObject_HEAD - MSIHANDLE handle; -} MsiDB; - -static void -MsiDB_dealloc(MsiDB* self) -{ - if(self->handle != 0) - { - unsigned int result = MsiCloseHandle(self->handle); - } - self->ob_type->tp_free((PyObject*)self); -} - -static PyObject * -MsiDB_new(PyTypeObject *type, PyObject *args) -{ - MsiDB *self; - - self = (MsiDB *)type->tp_alloc(type, 0); - if (self != NULL) - { - self->handle = 0; - } - - return (PyObject *)self; -} - -static int -MsiDB_init(MsiDB *self, PyObject *args) -{ - char* filename; - if(!PyArg_ParseTuple(args, "s", &filename)) - { - return -1; - } - - MsiOpenDatabase(filename, MSIDBOPEN_TRANSACT, &self->handle); - - return 0; -} - -static PyMemberDef MsiDB_members[] = { - {NULL} /* Sentinel */ -}; - -static PyObject * -MsiDB_openview(MsiDB* self, PyObject *args) -{ - char* query; - unsigned int result = 1; - if (!PyArg_ParseTuple(args, "s", &query)) - { - return NULL; - } - if(self->handle != 0) - { - MSIHANDLE view; - result = MsiDatabaseOpenView(self->handle, query, &view); - if(result == ERROR_SUCCESS) - { - return MsiView_FromHandle(view); - } - } - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * -MsiDB_commit(MsiDB* self) -{ - unsigned int result = 1; - if(self->handle != 0) - { - result = MsiDatabaseCommit(self->handle); - if(result == ERROR_INVALID_HANDLE) - { - printf("invalid??\n"); - } - } - return Py_BuildValue("i", result); -} - -static PyMethodDef MsiDB_methods[] = { - {"openview", (PyCFunction)MsiDB_openview, METH_VARARGS, - "MsiViewExecute SQL query" - }, - {"commit", (PyCFunction)MsiDB_commit, METH_NOARGS, - "MsiDatabaseCommit" - }, - {NULL} /* Sentinel */ -}; - -static PyTypeObject MsiDBType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "msiquery.MsiDB", /*tp_name*/ - sizeof(MsiDB), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)MsiDB_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "MsiDB objects", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - MsiDB_methods, /* tp_methods */ - MsiDB_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)MsiDB_init, /* tp_init */ - 0, /* tp_alloc */ - (newfunc)MsiDB_new, /* tp_new */ -}; - -static PyMethodDef msiquery_methods[] = { - {NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC -initmsiquery(void) -{ - PyObject* m; - - if (PyType_Ready(&MsiRecordType) < 0) - return; - - if (PyType_Ready(&MsiViewType) < 0) - return; - - if (PyType_Ready(&MsiDBType) < 0) - return; - - m = Py_InitModule3("msiquery", msiquery_methods, "Msi API module."); - - if (m == NULL) - return; - - Py_INCREF(&MsiRecordType); - PyModule_AddObject(m, "MsiRecord", (PyObject *)&MsiRecordType); - - Py_INCREF(&MsiViewType); - PyModule_AddObject(m, "MsiView", (PyObject *)&MsiViewType); - - Py_INCREF(&MsiDBType); - PyModule_AddObject(m, "MsiDB", (PyObject *)&MsiDBType); -} - diff --git a/setup/win32/msi/msiquery.def b/setup/win32/msi/msiquery.def deleted file mode 100644 index 7c80b764..00000000 --- a/setup/win32/msi/msiquery.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - initmsiquery diff --git a/setup/win32/msi/msiquery.sln b/setup/win32/msi/msiquery.sln deleted file mode 100644 index 27170171..00000000 --- a/setup/win32/msi/msiquery.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msiquery", "msiquery.vcproj", "{7E8B9772-912C-4E32-88E2-62F9DE03C33C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7E8B9772-912C-4E32-88E2-62F9DE03C33C}.Debug|Win32.ActiveCfg = Debug|Win32 - {7E8B9772-912C-4E32-88E2-62F9DE03C33C}.Debug|Win32.Build.0 = Debug|Win32 - {7E8B9772-912C-4E32-88E2-62F9DE03C33C}.Release|Win32.ActiveCfg = Release|Win32 - {7E8B9772-912C-4E32-88E2-62F9DE03C33C}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/setup/win32/msi/msiquery.vcproj b/setup/win32/msi/msiquery.vcproj deleted file mode 100644 index 504ef77c..00000000 --- a/setup/win32/msi/msiquery.vcproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup/win32/msiquery.dll b/setup/win32/msiquery.dll deleted file mode 100644 index fae0a5eb..00000000 Binary files a/setup/win32/msiquery.dll and /dev/null differ diff --git a/setup/win32/msiquery.pyd b/setup/win32/msiquery.pyd deleted file mode 100644 index 63a40307..00000000 Binary files a/setup/win32/msiquery.pyd and /dev/null differ diff --git a/setup/win32/nightly.cf b/setup/win32/nightly.cf deleted file mode 100644 index 71884edc..00000000 --- a/setup/win32/nightly.cf +++ /dev/null @@ -1,14 +0,0 @@ -# Core + all game packs - -# output dir name -$SETUP_DIR = 'Setup-update'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_WOLF = 1; -$DO_GAME_JKII = 1; -$DO_GAME_STVEF = 1; -$DO_GAME_HALFLIFE = 1; -$DO_GAME_SOF2 = 1; - -$DO_NIGHTLY = 1; diff --git a/setup/win32/q1.cf b/setup/win32/q1.cf deleted file mode 100644 index b71789c2..00000000 --- a/setup/win32/q1.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-Q1'; - -$DO_CORE = 1; -$DO_GAME_Q1 = 1; diff --git a/setup/win32/q2_example_maps.xml b/setup/win32/q2_example_maps.xml deleted file mode 100644 index e2eb741a..00000000 --- a/setup/win32/q2_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/q3.cf b/setup/win32/q3.cf deleted file mode 100644 index 2772c689..00000000 --- a/setup/win32/q3.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-Q3'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; diff --git a/setup/win32/q3a_example_maps.xml b/setup/win32/q3a_example_maps.xml deleted file mode 100644 index 7895babe..00000000 --- a/setup/win32/q3a_example_maps.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/setup/win32/q3q1.cf b/setup/win32/q3q1.cf deleted file mode 100644 index 7c4d2f13..00000000 --- a/setup/win32/q3q1.cf +++ /dev/null @@ -1,5 +0,0 @@ -$SETUP_DIR = 'Setup-Q3Q1'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_Q1 = 1; diff --git a/setup/win32/q3wolf.cf b/setup/win32/q3wolf.cf deleted file mode 100644 index 8a360537..00000000 --- a/setup/win32/q3wolf.cf +++ /dev/null @@ -1,5 +0,0 @@ -$SETUP_DIR = 'Setup-Q3Wolf'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_WOLF = 1; diff --git a/setup/win32/q3wolfet.cf b/setup/win32/q3wolfet.cf deleted file mode 100644 index b0da33ac..00000000 --- a/setup/win32/q3wolfet.cf +++ /dev/null @@ -1,6 +0,0 @@ -$SETUP_DIR = 'Setup-Q3WolfET'; - -$DO_CORE = 1; -$DO_GAME_Q3 = 1; -$DO_GAME_WOLF = 1; -$DO_GAME_ET = 1; diff --git a/setup/win32/raven-hl.cf b/setup/win32/raven-hl.cf deleted file mode 100644 index e1595fb4..00000000 --- a/setup/win32/raven-hl.cf +++ /dev/null @@ -1,11 +0,0 @@ -# Core + all game packs - -# output dir name -$SETUP_DIR = 'Setup-RavenAndMisc'; - -$DO_CORE = 1; -$DO_GAME_JKII = 1; -$DO_GAME_STVEF = 1; -$DO_GAME_HALFLIFE = 1; -$DO_GAME_SOF2 = 1; -$DO_GAME_JA = 1; \ No newline at end of file diff --git a/setup/win32/raven.cf b/setup/win32/raven.cf deleted file mode 100644 index 4c9e04c9..00000000 --- a/setup/win32/raven.cf +++ /dev/null @@ -1,10 +0,0 @@ -# Core + all game packs - -# output dir name -$SETUP_DIR = 'Setup-Raven'; - -$DO_CORE = 1; -$DO_GAME_JKII = 1; -$DO_GAME_STVEF = 1; -$DO_GAME_SOF2 = 1; -$DO_GAME_JA = 1; diff --git a/setup/win32/setup.pl b/setup/win32/setup.pl deleted file mode 100644 index 2d370127..00000000 --- a/setup/win32/setup.pl +++ /dev/null @@ -1,497 +0,0 @@ -#!/usr/bin/env perl -# see ./setup.pl for usage info - -# the templated source -$TEMPLATE_DIR='template'; -# the 'meta' directory (no longer a template, not a final setup dir yet) -$WORK_DIR='WorkDir'; - -# Source common perl functions -BEGIN { - push @INC, "../common"; -} -use setup; -$common = new setup(); - -# replace in file -sub replace { - # only wrap setup::replace() for now - $common->replace(@_); -} - -sub svn_cleanup { - $CLEAN = shift(@_); - # take out .svn/ directories - print "SVN file cleanup in $CLEAN...\n"; - my $findscan; - open($findscan, "find $CLEAN -name .svn | "); - my $line = <$findscan>; - do - { - chop($line); - system("rm -rf '$line'"); - } until (!($line = <$findscan>)); - close($findscan); -} - -# make a work version from the template -# for IS developer use, and for custom setups generation -sub build_work_tree() -{ - print "Building a work tree in $WORK_DIR/ from $TEMPLATE_DIR/\n"; - - # make a clean copy - print "File copy...\n"; - system("rm -rf $WORK_DIR"); - system("cp -R $TEMPLATE_DIR $WORK_DIR"); - - svn_cleanup( "$WORK_DIR" ); - - my $ESCAPED_GTKRAD_DIR = $GTKRAD_DIR; - $ESCAPED_GTKRAD_DIR =~ s/\\/\\\\/g; - - # proceed to replace <> in .fgl files - print "search/replace for base dir...\n"; - open($findscan, "find $WORK_DIR -name '*.fgl' | "); - my $line = <$findscan>; - do - { - chop($line); - replace($line, '<>', $ESCAPED_GTKRAD_DIR); - } until (!($line = <$findscan>)); - close($findscan); -} - -# finalize from a work tree version -# this sets some common settings, but doesn't set customizable stuff (like game packs selection) -# as we customize more things, this should shrink -sub finalize_tree -{ - my $DIR = shift(@_); - # what is the version? - # NOTE: I've had countless shit getting this extracted correctly - my $GTKRAD_VERSION=`cat ../../include/version.default | tr -d \\\\n\\\\r\\\\f`; - - # what is the name of the binary? - my $GTKRAD_BIN="GtkRadiant-$GTKRAD_VERSION.exe"; - - print " Finalizing $DIR/...\n"; - - # copy the Radiant binary to a generated file with the right name - #print "the thing: cp ../../radiant/Release/GtkRadiant.exe ./bin/$GTKRAD_BIN\n"; - system("cp ../../radiant/Release/GtkRadiant.exe ./bin/$GTKRAD_BIN"); - - # copy the splash screen - ET version - system("cp ../setup.bmp '$DIR/Setup Files/Uncompressed Files/Language Independent/OS Independent'"); - - # PRODUCT_VERSION - print " Product version $GTKRAD_VERSION...\n"; - replace("$DIR/String Tables/0009-English/value.shl", '<>', "$GTKRAD_VERSION "); - - # set the binary name - print " Binary name $GTKRAD_BIN...\n"; - replace("$DIR/File Groups/Program Executable Files.fgl", '<>', "$GTKRAD_BIN"); - replace("$DIR/String Tables/0009-English/value.shl", '<>', "$GTKRAD_BIN"); - replace("$DIR/Shell Objects/Default.shl", '<>', "$GTKRAD_BIN"); - - # install path prompt - replace("$SETUP_DIR/String Tables/0009-English/value.shl", '<>', "GtkRadiant $GTKRAD_VERSION"); - - # uuid - my $MAIN_GUID=`uuidgen`; - chop($MAIN_GUID); - chop($MAIN_GUID); - print " $SETUP_DIR/ has uuid: $MAIN_GUID...\n"; - replace("$SETUP_DIR/GtkRadiant.ipr", '<>', "$MAIN_GUID"); - replace("$SETUP_DIR/String Tables/0009-English/value.shl", '<>', "$MAIN_GUID"); - -} - -# configure a tree: -# - what is included in the media (core, game packs) -# - full/nightly -# TODO: this could be cleaner -# the variable names could be generated from DO_CORE DO_GAME_Q3 DO_GAME_WOLF -sub configure_tree -{ - my $DIR = $SETUP_DIR; - print " Configuring $DIR/...\n"; - # get the major and minor - my $RADIANT_MAJOR=`cat ../../include/RADIANT_MAJOR`; - chomp($RADIANT_MAJOR); - chomp($RADIANT_MAJOR); - my $RADIANT_MINOR=`cat ../../include/RADIANT_MINOR`; - chomp($RADIANT_MINOR); - chomp($RADIANT_MINOR); - print " version 1.$RADIANT_MAJOR.$RADIANT_MINOR\n"; - replace("$DIR/Script Files/Setup.rul", '<>', "$RADIANT_MAJOR"); - replace("$DIR/Script Files/Setup.rul", '<>', "$RADIANT_MINOR"); - if ($DO_CORE == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_Q3 == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_WOLF == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_JKII == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_STVEF == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_HALFLIFE == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_SOF2 == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_ET == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_Q1 == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_JA == 1) - { - # prepare the dynamic JA media file group - print " Prepare JA media file group..\n"; - # would go faster by copying only the right files in the first place - # rsync might even go faster - if we use it on a toplevel JAPack copy - system( "cp -R ../../../JAPack/base $DIR/JAPack" ); - svn_cleanup( "$DIR/JAPack" ); - replace( "$DIR/File Groups/JA Media Files.fgl", '<>', "$GTKRAD_DIR/GtkRadiant/setup/win32/$DIR/JAPack" ); - - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_Q2 == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - if ($DO_GAME_HER2 == 1) - { - replace("$DIR/Script Files/Setup.rul", '<>', '1'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - } - else - { - replace("$DIR/Script Files/Setup.rul", '<>', '0'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } - # and now the nightly only stuff (i.e. media upgrade) - if ($DO_NIGHTLY == 1) - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'Yes'); - } - else - { - replace("$DIR/Component Definitions/Default.cdf", '<>', 'No'); - } -} - -# command line options, default to generating the setups -# optional, build a template from a work version - -# usage instructions -sub usage { - print < - ex: setup.pl 'C:\\\\home\\\\Id' q3.cf - where q3.cf holds Q3 only game pack config -or -Takes a work tree and turns it back into a template tree - setup.pl -template - ex: setup.pl 'C:\\\\home\\\\Id' -template template-gen -eof -}; - -# main - -# configure some shit -$UUIDGEN=`which uuidgen.exe 2>/dev/null`; -chop($UUIDGEN); -if (!-e $UUIDGEN) -{ - print "uuidgen not found\n"; - exit; -} - -if (scalar(@ARGV)<2) -{ - usage(); - exit; -}; - -$GTKRAD_DIR=$ARGV[0]; -print "Configured for base GtkRadiant directory: '$GTKRAD_DIR'\n"; - -if (@ARGV>2 && $ARGV[1] eq '-template') -{ - # building a template from a work dir - $TEMPLATE_GEN_DIR=$ARGV[2]; - print "Building a template version of $WORK_DIR/ into $TEMPLATE_GEN_DIR/\n"; - print "Copy files...\n"; - system("rm -rf $TEMPLATE_GEN_DIR"); - system("cp -R $WORK_DIR $TEMPLATE_GEN_DIR\n"); - # replace UUID - print "Templating UUID...\n"; - system("cat $TEMPLATE_GEN_DIR/GtkRadiant.ipr | sed -e 's/InstallationGUID.*/InstallationGUID=<>/' > $TEMPLATE_GEN_DIR/GtkRadiant.ipr.tmp"); - system("cp $TEMPLATE_GEN_DIR/GtkRadiant.ipr.tmp $TEMPLATE_GEN_DIR/GtkRadiant.ipr; rm $TEMPLATE_GEN_DIR/GtkRadiant.ipr.tmp"); - # base dir - print "Processing '$GTKRAD_DIR' into '<>'\n"; - open($findscan, "find $TEMPLATE_GEN_DIR -name '*.fgl' | "); - my $line = <$findscan>; - do - { - chop($line); - replace($line, $GTKRAD_DIR, '<>'); - } until (!($line = <$findscan>)); - close($findscan); - exit; -} - -# set default config -$SETUP_DIR = 'SetupOutput'; -$DO_CORE = 1; -$DO_GAME_Q3 = 0; -$DO_GAME_WOLF = 0; -$DO_GAME_JKII = 0; -$DO_GAME_STVEF = 0; -$DO_GAME_HALFLIFE = 0; -$DO_GAME_SOF2 = 0; -$DO_GAME_ET = 0; -$DO_GAME_Q1 = 0; -$DO_GAME_JA = 0; -$DO_GAME_Q2 = 0; -$DO_GAME_HER2 = 0; -$DO_NIGHTLY = 0; - -# load config - -my $config_file = $ARGV[1]; - -print "Reading config from $config_file\n"; -eval "require \"$config_file\""; -if ($SETUP_DIR eq $WORK_DIR) -{ - die "Error: $WORK_DIR is reserved\n"; -} - -print "Config:\n"; -print " Output directory : $SETUP_DIR\n"; -print " DO_CORE : $DO_CORE\n"; -print " DO_GAME_Q3 : $DO_GAME_Q3\n"; -print " DO_GAME_WOLF : $DO_GAME_WOLF\n"; -print " DO_GAME_JKII : $DO_GAME_JKII\n"; -print " DO_GAME_STVEF : $DO_GAME_STVEF\n"; -print " DO_GAME_HALFLIFE : $DO_GAME_HALFLIFE\n"; -print " DO_GAME_SOF2 : $DO_GAME_SOF2\n"; -print " DO_GAME_ET : $DO_GAME_ET\n"; -print " DO_GAME_Q1 : $DO_GAME_Q1\n"; -print " DO_GAME_JA : $DO_GAME_JA\n"; -print " DO_GAME_Q2 : $DO_GAME_Q2\n"; -print " DO_GAME_HER2 : $DO_GAME_HER2\n"; -if ($DO_NIGHTLY == 1) -{ - print " Configured for nightly setup\n"; -} -else -{ - print " Configured for full setup\n"; -} - -build_work_tree(); - -print "Preparing $SETUP_DIR/...\n"; -system("rm -rf $SETUP_DIR"); -system("cp -R $WORK_DIR $SETUP_DIR"); -finalize_tree("$SETUP_DIR"); -configure_tree(); diff --git a/setup/win32/sof2.cf b/setup/win32/sof2.cf deleted file mode 100644 index cf4e8898..00000000 --- a/setup/win32/sof2.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-SOF2'; - -$DO_CORE = 1; -$DO_GAME_SOF2 = 1; diff --git a/setup/win32/stvef.cf b/setup/win32/stvef.cf deleted file mode 100644 index 15cd584e..00000000 --- a/setup/win32/stvef.cf +++ /dev/null @@ -1,4 +0,0 @@ -$SETUP_DIR = 'Setup-STVEF'; - -$DO_CORE = 1; -$DO_GAME_STVEF = 1; diff --git a/setup/win32/template.msi b/setup/win32/template.msi deleted file mode 100644 index 48e56e3d..00000000 Binary files a/setup/win32/template.msi and /dev/null differ diff --git a/setup/win32/template/Component Definitions/Default.cdf b/setup/win32/template/Component Definitions/Default.cdf deleted file mode 100644 index 6f29fcf7..00000000 --- a/setup/win32/template/Component Definitions/Default.cdf +++ /dev/null @@ -1,1477 +0,0 @@ -[Info] -Name= -Type=CompDef -Version=2.10.000 - -[GtkRadiant core\Plugins\Curry\Curry Q3 pk3] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=aa6e48c3-31b7-400c-9e50-982af5930483 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - Curry pk3 -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Components] -component0=GtkRadiant core\Plugins\Curry\Curry Q3 pk3 -component1=JKII -component2=GtkRadiant core\Plugins\PrtView -component3=Wolf -component4=STVEF -component5=Halflife -component6=GtkRadiant core\Plugins\BobToolz -component7=Q2 -component8=ET\ET editing media -component9=GtkRadiant core\Plugins\GenSurf -component10=Q3 -component11=SOF2\SOF2 editing media -component12=Wolf\Wolf editing media -component13=Q3\Quake III Arena editing media\Q3TA editing media -component14=Q3\Quake III Arena editing media -component15=GtkRadiant core\Misc Manuals -component16=GtkRadiant core\Plugins\Curry\Curry Wolf pk3 -component17=GtkRadiant core\Plugins\bkgrnd2d -component18=GtkRadiant core\Plugins -component19=GtkRadiant core\Plugins\Curry -component20=JA\JA editing media -component21=JKII\JKII editing media -component22=GtkRadiant core\Plugins\TexTool -component23=JA -component24=SOF2 -component25=Q3\TA Manuals -component26=Q2\Q2 editing media -component27=Q3\Q3 media update -component28=STVEF\STVEF editing media -component29=HER2\HER2 editing media -component30=GtkRadiant core\Manual -component31=GtkRadiant core -component32=Wolf\Wolf media update -component33=ET -component34=Halflife\Halflife editing media -component35=HER2 -component36=Quake -component37=Quake\Quake editing media - - -[JKII] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Jedi Knight II: Jedi Outcast -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=bbfcdf2a-9651-47e1-8890-56c8e2cccb77 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=JKII\JKII editing media -filegroup0=JKII Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\PrtView] -OBJECT=No -DESCRIPTION=Displays the portal file generated by q3map -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=fd7c1ea2-c127-4924-a581-5ff750f41efa -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - PrtView -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Wolf] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Return To Castle Wolfenstein -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=b9350989-33c9-4542-8765-9f7ec3c186cb -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Wolf\Wolf editing media -member1=Wolf\Wolf media update -filegroup0=Wolf Exectuable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[STVEF] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Star Trek Voyager : Elite Force -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=dcc01d72-e04a-4731-aab9-f0983399996d -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=STVEF\STVEF editing media -filegroup0=STVEF Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Halflife] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Halflife -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=3b965464-c0dc-4ac8-bb2c-d3df4184eae3 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Halflife\Halflife editing media -filegroup0=Halflife Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\BobToolz] -OBJECT=No -DESCRIPTION=Adds a variety of features, including jumppad path-plotting, duplicate plane removal, and auto-caulk -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=828c7c80-5593-4ae1-bb42-8d7d0d23f6de -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - BobToolz -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q2] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Quake II -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=59c8a4d7-a765-4705-a9a1-de25ed3c9134 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Q2\Q2 editing media -filegroup0=Q2 Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[ET\ET editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=daf4e270-8ac5-47c2-8f23-dfd1e22299a4 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=ET Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\GenSurf] -OBJECT=No -DESCRIPTION=Surface generation tools essential for terrain -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=69f13834-cdbb-4bb3-a597-c84228392e2a -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - GTK GenSurf -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q3] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Quake III Arena and Quake III : Team Arena -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=74fd6635-0222-42f5-91ef-06f0951e3bfd -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Q3\Quake III Arena editing media -member1=Q3\TA Manuals -member2=Q3\Q3 media update -filegroup0=Q3 Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[SOF2\SOF2 editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=48a9daea-0264-49ee-a80a-3e64c032e9df -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=SOF2 Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Wolf\Wolf editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=aa5d193e-32a4-4947-9c42-22de9fd23130 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Wolf Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q3\Quake III Arena editing media\Q3TA editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Quake III: Team Arena editing media -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=c63fb899-152e-4764-bd47-ffb4106cd5e6 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=shaderlist-ta -filegroup1=TA Sample Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q3\Quake III Arena editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=4e964981-39bc-4fad-bed7-eee0123bc52d -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Q3\Quake III Arena editing media\Q3TA editing media -filegroup0=Q3 Default Project -filegroup1=Q3 Editor Images - SPoG pk3 -filegroup2=Q3 Misc Files -filegroup3=Q3 Sample Files -filegroup4=shaderlist -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Misc Manuals] -OBJECT=No -DESCRIPTION=Additional Manuals for Map Compiling, Models, Shaders and Terrain -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=c5cef5c7-edc2-47e1-b364-65307c32c2ab -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Compile Manual -filegroup1=Model Manual Files -filegroup2=Shader Manual Files -filegroup3=Terrain Manual Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\Curry\Curry Wolf pk3] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=66be5566-5455-4330-a15f-a1f6abbd6a88 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - Curry pk3 Wolf -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\bkgrnd2d] -OBJECT=No -DESCRIPTION=Draws a 2D image in the background -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=Yes -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=44efec54-497e-4e2a-aed2-97d4fcf9607a -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - bkgrnd2d -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins] -OBJECT=No -DESCRIPTION=Plugins to provide additional editing features -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=16b5392d-1494-4493-bdb7-16b23536b778 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=GtkRadiant core\Plugins\TexTool -member1=GtkRadiant core\Plugins\PrtView -member2=GtkRadiant core\Plugins\GenSurf -member3=GtkRadiant core\Plugins\Curry -member4=GtkRadiant core\Plugins\BobToolz -member5=GtkRadiant core\Plugins\bkgrnd2d -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\Curry] -OBJECT=No -DESCRIPTION=Displays a shader in Radiant, to show how it will appear in Quake III Arena -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=No -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=65c401da-80a8-4187-8396-c4bbfdb50067 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=GtkRadiant core\Plugins\Curry\Curry Q3 pk3 -member1=GtkRadiant core\Plugins\Curry\Curry Wolf pk3 -filegroup0=Plugins - Curry -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[JA\JA editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=cac92f56-1176-4149-9351-3c38919c7b6a -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=JA Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[JKII\JKII editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=1508df12-4479-43fc-90de-eafde8d26d28 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=JKII Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Plugins\TexTool] -OBJECT=No -DESCRIPTION=Texture Tools BETA -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=No -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=d4e4aba4-92df-4ece-8bbc-8dd440806f5b -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Plugins - TexTool -filegroup1=TexTool Help -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[JA] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Star Wars Jedi Knight Jedi Academy -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=450216da-07b4-408b-98c6-100148f3a712 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=JA\JA editing media -filegroup0=JA Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[SOF2] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Soldier Of Fortune 2 : Double Helix -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=50ad6ca3-f627-4789-adff-19f82cb68519 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=SOF2\SOF2 editing media -filegroup0=SOF2 Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q3\TA Manuals] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=02a28ce0-5537-4791-8c5a-ce2ee1741252 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=TA Manual Files -filegroup1=TA Teams Manual -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q2\Q2 editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=2d0b3180-ab5a-4228-ac8c-2bc41a182bbb -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Q2 Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Q3\Q3 media update] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=9053ca53-e588-424b-af96-c88e89aa55fd -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[STVEF\STVEF editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=09ce2fbf-a2ed-4cdf-8cf6-27dba629e587 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=STVEF Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[HER2\HER2 editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=72e2ce70-3766-4153-908f-f769afd69569 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Heretic2 Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core\Manual] -OBJECT=No -DESCRIPTION=GtkRadiant Manual -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=6c5a077f-6762-4392-82fc-83491144f07a -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Radiant Manual Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[GtkRadiant core] -OBJECT=No -DESCRIPTION=GtkRadiant core functionality -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=65e59be2-adce-4802-844d-74cbf2eeeb1a -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=GtkRadiant core\Manual -member1=GtkRadiant core\Plugins -member2=GtkRadiant core\Misc Manuals -filegroup0=Program DLL Files -filegroup1=Program Executable Files -filegroup2=Program Misc Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Wolf\Wolf media update] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=6cfb989b-5702-44f9-b24f-4f26b244ad02 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[ET] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Wolfenstein: Enemy Territory -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=22bc33ba-4ff9-41c0-bc9f-f611f6b560e7 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=ET\ET editing media -filegroup0=ET Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Halflife\Halflife editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=fd46d247-a2cb-4ce8-add7-7a3664fe32be -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Halflife Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[HER2] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT=Heretic II -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=6989f013-951e-4fbd-98a0-1de7928aef50 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=HER2\HER2 editing media -filegroup0=Heretic2 Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Quake] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=22bc33ba-4ff9-41c0-bd9f-f611f6c560e7 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -member0=Quake\Quake editing media -filegroup0=Quake Executable Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[Quake\Quake editing media] -OBJECT=No -DESCRIPTION= -STATUS= -VISIBLE=Yes -DISK=ANYDISK -FILENEED=STANDARD -INCLUDEINBUILD=<> -PASSWORD= -ENCRYPT=No -COMPRESSIFSEPARATE=No -UNINSTALLABLE=Yes -COMMENT= -DEFSELECTION=Yes -SELECTED=Yes -IMAGE= -TARGETDIRCDROM= -DISPLAYTEXT= -HTTPLOCATION= -FTPLOCATION= -MISC= -GUID=daf4f270-8ad5-47c2-8f23-dfd1e22299a4 -_SPLIT_BEFORE= -_SPLIT_AFTER= -_DATAASFILES= -_NO_SPLIT= -_NO_SPLIT_BEFORE= -VOLATILE= -filegroup0=Quake Media Files -HANDLERONInstalling= -HANDLERONInstalled= -HANDLERONUnInstalling= -HANDLERONUnInstalled= - -[TopComponents] -component0=GtkRadiant core -component1=Q3 -component2=Wolf -component3=JKII -component4=STVEF -component5=Halflife -component6=SOF2 -component7=ET -component8=JA -component9=Q2 -component10=HER2 -component11=Quake - -[SetupType] -setuptype0=Full Install -setuptype1=Custom - -[SetupTypeItem-Full Install] -Comment= -Descrip=Choose this setup type to install all components of the program, including the sample files. This will overwrite any existing sample files installed in your Quake III Arena folder -DisplayText= -item0=GtkRadiant core\Plugins\Curry\Curry Q3 pk3 -item1=Wolf -item2=GtkRadiant core\Plugins\PrtView -item3=JKII -item4=STVEF -item5=Halflife -item6=GtkRadiant core\Plugins\BobToolz -item7=Q2 -item8=ET\ET editing media -item9=SOF2\SOF2 editing media -item10=Q3 -item11=GtkRadiant core\Plugins\GenSurf -item12=Q3\Quake III Arena editing media -item13=Q3\Quake III Arena editing media\Q3TA editing media -item14=Wolf\Wolf editing media -item15=GtkRadiant core\Misc Manuals -item16=GtkRadiant core\Plugins\Curry\Curry Wolf pk3 -item17=GtkRadiant core\Plugins\bkgrnd2d -item18=JA\JA editing media -item19=GtkRadiant core\Plugins -item20=GtkRadiant core\Plugins\Curry -item21=JA -item22=GtkRadiant core\Plugins\TexTool -item23=JKII\JKII editing media -item24=SOF2 -item25=Q3\TA Manuals -item26=Q2\Q2 editing media -item27=Q3\Q3 media update -item28=STVEF\STVEF editing media -item29=HER2\HER2 editing media -item30=GtkRadiant core -item31=GtkRadiant core\Manual -item32=Wolf\Wolf media update -item33=ET -item34=Halflife\Halflife editing media -item35=HER2 -item36=Quake -item37=Quake\Quake editing media - -[SetupTypeItem-Custom] -Comment= -Descrip=Choose this setup type if you want to choose which components to install -DisplayText= -item0=GtkRadiant core\Plugins\Curry\Curry Q3 pk3 -item1=Wolf -item2=GtkRadiant core\Plugins\PrtView -item3=JKII -item4=STVEF -item5=Halflife -item6=GtkRadiant core\Plugins\BobToolz -item7=Q2 -item8=ET\ET editing media -item9=Q3 -item10=GtkRadiant core\Plugins\GenSurf -item11=SOF2\SOF2 editing media -item12=Q3\Quake III Arena editing media -item13=Q3\Quake III Arena editing media\Q3TA editing media -item14=Wolf\Wolf editing media -item15=GtkRadiant core\Misc Manuals -item16=GtkRadiant core\Plugins\Curry\Curry Wolf pk3 -item17=GtkRadiant core\Plugins\bkgrnd2d -item18=JA\JA editing media -item19=GtkRadiant core\Plugins -item20=GtkRadiant core\Plugins\Curry -item21=JA -item22=GtkRadiant core\Plugins\TexTool -item23=JKII\JKII editing media -item24=SOF2 -item25=Q3\TA Manuals -item26=Q2\Q2 editing media -item27=Q3\Q3 media update -item28=STVEF\STVEF editing media -item29=HER2\HER2 editing media -item30=GtkRadiant core -item31=GtkRadiant core\Manual -item32=Wolf\Wolf media update -item33=ET -item34=Halflife\Halflife editing media -item35=HER2 -item36=Quake -item37=Quake\Quake editing media - diff --git a/setup/win32/template/Component Definitions/Default.fgl b/setup/win32/template/Component Definitions/Default.fgl deleted file mode 100644 index cd5f9b2f..00000000 --- a/setup/win32/template/Component Definitions/Default.fgl +++ /dev/null @@ -1,336 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0= -SubDir1= -SubDir2= -SubDir3=USERDEFINED -SubDir4= - -[] -fulldirectory= -SubDir0=\ -DISPLAYTEXT=Windows Operating System -TYPE=TEXTSUBFIXED - -[\] -fulldirectory= -DISPLAYTEXT=Windows System Folder -TYPE=TEXTSUBFIXED - -[] -fulldirectory= -SubDir0=\ -DISPLAYTEXT=Program Files Folder -TYPE=TEXTSUBFIXED - -[\] -fulldirectory= -DISPLAYTEXT=Common Files Folder -TYPE=TEXTSUBFIXED - -[] -fulldirectory= -SubDir0=\plugins -DISPLAYTEXT=General Application Destination -TYPE=TEXTSUBFIXED - -[\plugins] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED] -fulldirectory= -SubDir0=USERDEFINED\ -SubDir1=USERDEFINED\ -SubDir2=USERDEFINED\ -SubDir3=USERDEFINED\ -SubDir4=USERDEFINED\ -SubDir5=USERDEFINED\ -SubDir6=USERDEFINED\ -SubDir7=USERDEFINED\ -SubDir8=USERDEFINED\ -SubDir9=USERDEFINED\ -SubDir10=USERDEFINED\ -SubDir11=USERDEFINED\ -SubDir12=USERDEFINED\ -SubDir13=USERDEFINED\ -SubDir14=USERDEFINED\ -SubDir15=USERDEFINED\ -SubDir16=USERDEFINED\ -SubDir17=USERDEFINED\ -SubDir18=USERDEFINED\ -SubDir19=USERDEFINED\ -SubDir20=USERDEFINED\ -SubDir21=USERDEFINED\ -SubDir22=USERDEFINED\ -SubDir23=USERDEFINED\ -SubDir24=USERDEFINED\ -DISPLAYTEXT=Script-defined Folders -TYPE=USERSTART - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\baseq3 -SubDir1=USERDEFINED\\missionpack -SubDir2=USERDEFINED\\GtkRadiant -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\baseq3] -fulldirectory= -SubDir0=USERDEFINED\\baseq3\scripts -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\baseq3\scripts] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\missionpack] -fulldirectory= -SubDir0=USERDEFINED\\missionpack\scripts -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\missionpack\scripts] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\GtkRadiant] -fulldirectory= -SubDir0=USERDEFINED\\GtkRadiant\Plugins -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\GtkRadiant\Plugins] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\Plugins -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\Plugins] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\baseq3 -SubDir1=USERDEFINED\\missionpack -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\baseq3] -fulldirectory= -SubDir0=USERDEFINED\\baseq3\scripts -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\baseq3\scripts] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\missionpack] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\plugins -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\plugins] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\plugins -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\plugins] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\main -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\main] -fulldirectory= -SubDir0=USERDEFINED\\main\scripts -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\\main\scripts] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\base -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\base] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\baseEf -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\baseEf] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\base -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\base] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\etmain -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\etmain] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\id1 -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\id1] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\Base -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\Base] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\baseq2 -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\baseq2] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[USERDEFINED\] -fulldirectory= -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\] -fulldirectory= -SubDir0=USERDEFINED\\base -DISPLAYTEXT= -TYPE=TEXTSUB - -[USERDEFINED\\base] -fulldirectory= -DISPLAYTEXT= -TYPE=FOLDER - -[] -fulldirectory= -DISPLAYTEXT=Support Folder -TYPE=TEXTSUBFIXED - diff --git a/setup/win32/template/File Groups/1_2_1 Wolf Media Upgrade.fgl b/setup/win32/template/File Groups/1_2_1 Wolf Media Upgrade.fgl deleted file mode 100644 index 3fab8b89..00000000 --- a/setup/win32/template/File Groups/1_2_1 Wolf Media Upgrade.fgl +++ /dev/null @@ -1,35 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=main - -[main] -fulldirectory= -SubDir0=main\scripts -SubDir1=main\models - -[main\scripts] -fulldirectory= -file0=<>\WolfPack\scripts\default_project.proj -file1=<>\WolfPack\scripts\skies.shader -file2=<>\WolfPack\scripts\common.shader -file3=<>\WolfPack\scripts\walls.shader -file4=<>\WolfPack\scripts\props.shader -file5=<>\WolfPack\scripts\models.shader -file6=<>\WolfPack\scripts\shaderlist.txt -file7=<>\WolfPack\scripts\wolf_entities.def - -[main\models] -fulldirectory= -SubDir0=main\models\mapobjects - -[main\models\mapobjects] -fulldirectory= -SubDir0=main\models\mapobjects\wine - -[main\models\mapobjects\wine] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\wine\wine_barrel.md3 - diff --git a/setup/win32/template/File Groups/Compile Manual.fgl b/setup/win32/template/File Groups/Compile Manual.fgl deleted file mode 100644 index 39772fac..00000000 --- a/setup/win32/template/File Groups/Compile Manual.fgl +++ /dev/null @@ -1,16 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Compile_Manual - -[Compile_Manual] -fulldirectory= -file0=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\q3map.html -file1=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\cfgq3.c -file2=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\headskins.txt -file3=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\index.html -file4=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\modelskins.txt -file5=<>\GtkRadiant\docs\manual\quake3\Compile_Manual\bspc.txt - diff --git a/setup/win32/template/File Groups/Default.fdf b/setup/win32/template/File Groups/Default.fdf deleted file mode 100644 index 32ac1689..00000000 --- a/setup/win32/template/File Groups/Default.fdf +++ /dev/null @@ -1,947 +0,0 @@ -[Info] -Name= -Type=FileGrp -Version=2.10.000 - -[Q2 Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[FileGroups] -group0=Q2 Executable Files -group1=shaderlist -group2=Heretic2 Executable Files -group3=Q3 Sample Files -group4=TA Manual Files -group5=JKII Executable Files -group6=Halflife Executable Files -group7=Compile Manual -group8=SOF2 Media Files -group9=Q3 Executable Files -group10=Program Executable Files -group11=TA Sample Files -group12=Model Manual Files -group13=JA Media Files -group14=Q3 Default Project -group15=Plugins - PrtView -group16=STVEF Media Files -group17=Program Misc Files -group18=ET Media Files -group19=SOF2 Executable Files -group20=Plugins - BobToolz -group21=Plugins - GTK GenSurf -group22=Radiant Manual Files -group23=Terrain Manual Files -group24=Plugins - Curry pk3 -group25=Q2 Media Files -group26=Shader Manual Files -group27=ET Executable Files -group28=Plugins - TexTool -group29=shaderlist-ta -group30=Wolf Exectuable Files -group31=Q3 Editor Images - SPoG pk3 -group32=Plugins - bkgrnd2d -group33=TexTool Help -group34=Heretic2 Media Files -group35=Plugins - Curry pk3 Wolf -group36=Q3 Misc Files -group37=Program DLL Files -group38=Halflife Media Files -group39=TA Teams Manual -group40=Plugins - Curry -group41=JA Executable Files -group42=STVEF Executable Files -group43=Wolf Media Files -group44=JKII Media Files -group45=Quake Executable Files -group46=Quake Media Files - -[shaderlist] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=Yes -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEVEROVERWRITE -TARGET=\baseq3 -TARGETHIDDEN=Script-defined Folders\\baseq3 - -[Heretic2 Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Q3 Sample Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseq3 -TARGETHIDDEN=Script-defined Folders\\baseq3 - -[TA Manual Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[JKII Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Halflife Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Compile Manual] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[SOF2 Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\base -TARGETHIDDEN=Script-defined Folders\\base - -[Q3 Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Program Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[TA Sample Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\missionpack -TARGETHIDDEN=Script-defined Folders\\missionpack - -[Model Manual Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[JA Media Files] -LINKTYPE=Dynamic Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\Base -TARGETHIDDEN=Script-defined Folders\\Base - -[Q3 Default Project] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseq3\scripts -TARGETHIDDEN=Script-defined Folders\\baseq3\scripts - -[Plugins - PrtView] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[STVEF Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseEf -TARGETHIDDEN=Script-defined Folders\\baseEf - -[Program Misc Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[ET Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\etmain -TARGETHIDDEN=Script-defined Folders\\etmain - -[SOF2 Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Plugins - BobToolz] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[Plugins - GTK GenSurf] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[Radiant Manual Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Terrain Manual Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Plugins - Curry pk3] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseq3 -TARGETHIDDEN=Script-defined Folders\\baseq3 - -[Q2 Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseq2 -TARGETHIDDEN=Script-defined Folders\\baseq2 - -[Shader Manual Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[ET Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Plugins - TexTool] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[shaderlist-ta] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=Yes -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEVEROVERWRITE -TARGET=\missionpack -TARGETHIDDEN=Script-defined Folders\\missionpack - -[Wolf Exectuable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Q3 Editor Images - SPoG pk3] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\baseq3 -TARGETHIDDEN=Script-defined Folders\\baseq3 - -[Plugins - bkgrnd2d] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[TexTool Help] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Heretic2 Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\base -TARGETHIDDEN=Script-defined Folders\\base - -[Plugins - Curry pk3 Wolf] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\main -TARGETHIDDEN=Script-defined Folders\\main - -[Q3 Misc Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Program DLL Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Halflife Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[TA Teams Manual] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Plugins - Curry] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\plugins -TARGETHIDDEN=Script-defined Folders\\plugins - -[JA Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[STVEF Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Wolf Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\main -TARGETHIDDEN=Script-defined Folders\\main - -[JKII Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\base -TARGETHIDDEN=Script-defined Folders\\base - -[Quake Executable Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET= -TARGETHIDDEN=Script-defined Folders\ - -[Quake Media Files] -LINKTYPE=Static Link -INFOTYPE=Standard -UNINSTALLABLE=Yes -FILETYPE=No -SELFREGISTERING=No -POTENTIALLY=No -COMPRESS=Yes -OPERATINGSYSTEM= -LANGUAGE= -COMMENT= -COMPRESSDLL= -HTTPLOCATION= -FTPLOCATION= -MISC= -INSTALLATION=NEWERVERSION\NEWERDATE -TARGET=\id1 -TARGETHIDDEN=Script-defined Folders\\id1 - diff --git a/setup/win32/template/File Groups/ET Executable Files.fgl b/setup/win32/template/File Groups/ET Executable Files.fgl deleted file mode 100644 index 95abd754..00000000 --- a/setup/win32/template/File Groups/ET Executable Files.fgl +++ /dev/null @@ -1,117 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\ETPack\game.xlink -file1=<>\ETPack\synapse.config -SubDir0=docs -SubDir1=bitmaps - -[docs] -fulldirectory= -SubDir0=docs\Level Designers Reference - -[docs\Level Designers Reference] -fulldirectory= -file0=<>\ETPack\docs\Level Designers Reference\tracemaps.html -file1=<>\ETPack\docs\Level Designers Reference\appendix_a.html -file2=<>\ETPack\docs\Level Designers Reference\appendix_b.html -file3=<>\ETPack\docs\Level Designers Reference\appendix_c.html -file4=<>\ETPack\docs\Level Designers Reference\arenafile.html -file5=<>\ETPack\docs\Level Designers Reference\cabinets.html -file6=<>\ETPack\docs\Level Designers Reference\campaignfile.html -file7=<>\ETPack\docs\Level Designers Reference\commandmaps.html -file8=<>\ETPack\docs\Level Designers Reference\commandposts.html -file9=<>\ETPack\docs\Level Designers Reference\compiling.html -file10=<>\ETPack\docs\Level Designers Reference\consolecommands.html -file11=<>\ETPack\docs\Level Designers Reference\construction.html -file12=<>\ETPack\docs\Level Designers Reference\contents.html -file13=<>\ETPack\docs\Level Designers Reference\dualobj.html -file14=<>\ETPack\docs\Level Designers Reference\enveffects.html -file15=<>\ETPack\docs\Level Designers Reference\foliage.html -file16=<>\ETPack\docs\Level Designers Reference\glossary.html -file17=<>\ETPack\docs\Level Designers Reference\implicitshaders.html -file18=<>\ETPack\docs\Level Designers Reference\index.html -file19=<>\ETPack\docs\Level Designers Reference\introduction.html -file20=<>\ETPack\docs\Level Designers Reference\movingbobj.html -file21=<>\ETPack\docs\Level Designers Reference\objcameras.html -file22=<>\ETPack\docs\Level Designers Reference\spawnpoints.html -file23=<>\ETPack\docs\Level Designers Reference\speakereditor.html -file24=<>\ETPack\docs\Level Designers Reference\splash.html -file25=<>\ETPack\docs\Level Designers Reference\splinepaths.html -file26=<>\ETPack\docs\Level Designers Reference\surfaceparms.html -SubDir0=docs\Level Designers Reference\images -SubDir1=docs\Level Designers Reference\styles - -[docs\Level Designers Reference\images] -fulldirectory= -file0=<>\ETPack\docs\Level Designers Reference\images\tracemap_red.jpg -file1=<>\ETPack\docs\Level Designers Reference\images\3logos.jpg -file2=<>\ETPack\docs\Level Designers Reference\images\arena.jpg -file3=<>\ETPack\docs\Level Designers Reference\images\bspmenu.jpg -file4=<>\ETPack\docs\Level Designers Reference\images\cabinet_1.jpg -file5=<>\ETPack\docs\Level Designers Reference\images\cabinet_2.jpg -file6=<>\ETPack\docs\Level Designers Reference\images\campaign.jpg -file7=<>\ETPack\docs\Level Designers Reference\images\cmicon_cab.jpg -file8=<>\ETPack\docs\Level Designers Reference\images\cmicon_con.jpg -file9=<>\ETPack\docs\Level Designers Reference\images\cmicon_cp.jpg -file10=<>\ETPack\docs\Level Designers Reference\images\cmicon_custom_1.jpg -file11=<>\ETPack\docs\Level Designers Reference\images\cmicon_custom_2.jpg -file12=<>\ETPack\docs\Level Designers Reference\images\cmicon_des.jpg -file13=<>\ETPack\docs\Level Designers Reference\images\cmicon_spawns.jpg -file14=<>\ETPack\docs\Level Designers Reference\images\commandmap_1.jpg -file15=<>\ETPack\docs\Level Designers Reference\images\commandmap_2.jpg -file16=<>\ETPack\docs\Level Designers Reference\images\commandmap_3.jpg -file17=<>\ETPack\docs\Level Designers Reference\images\commandmap_4.jpg -file18=<>\ETPack\docs\Level Designers Reference\images\commandpost_1.jpg -file19=<>\ETPack\docs\Level Designers Reference\images\commandpost_2.jpg -file20=<>\ETPack\docs\Level Designers Reference\images\commandpost_3.jpg -file21=<>\ETPack\docs\Level Designers Reference\images\construct.jpg -file22=<>\ETPack\docs\Level Designers Reference\images\dualobj_1.jpg -file23=<>\ETPack\docs\Level Designers Reference\images\dualobj_2.jpg -file24=<>\ETPack\docs\Level Designers Reference\images\objcameras_1.jpg -file25=<>\ETPack\docs\Level Designers Reference\images\objcameras_2.jpg -file26=<>\ETPack\docs\Level Designers Reference\images\singleteam_1.jpg -file27=<>\ETPack\docs\Level Designers Reference\images\singleteam_2.jpg -file28=<>\ETPack\docs\Level Designers Reference\images\speaker_1.jpg -file29=<>\ETPack\docs\Level Designers Reference\images\speaker_2.jpg -file30=<>\ETPack\docs\Level Designers Reference\images\speaker_3.jpg -file31=<>\ETPack\docs\Level Designers Reference\images\speaker_4.jpg -file32=<>\ETPack\docs\Level Designers Reference\images\speaker_5.jpg -file33=<>\ETPack\docs\Level Designers Reference\images\splash.jpg -file34=<>\ETPack\docs\Level Designers Reference\images\splinepaths_1.jpg -file35=<>\ETPack\docs\Level Designers Reference\images\splinepaths_2.jpg -file36=<>\ETPack\docs\Level Designers Reference\images\splinepaths_3.jpg -file37=<>\ETPack\docs\Level Designers Reference\images\tankstuff.jpg -file38=<>\ETPack\docs\Level Designers Reference\images\tracemap_alpha.jpg -file39=<>\ETPack\docs\Level Designers Reference\images\tracemap_blue.jpg -file40=<>\ETPack\docs\Level Designers Reference\images\tracemap_green.jpg -SubDir0=docs\Level Designers Reference\images\common - -[docs\Level Designers Reference\images\common] -fulldirectory= -file0=<>\ETPack\docs\Level Designers Reference\images\common\trigger.jpg -file1=<>\ETPack\docs\Level Designers Reference\images\common\caulk.jpg -file2=<>\ETPack\docs\Level Designers Reference\images\common\clip.jpg -file3=<>\ETPack\docs\Level Designers Reference\images\common\clipmissile.jpg -file4=<>\ETPack\docs\Level Designers Reference\images\common\clipweapmetal.jpg -file5=<>\ETPack\docs\Level Designers Reference\images\common\clipweapwood.jpg -file6=<>\ETPack\docs\Level Designers Reference\images\common\hint.jpg -file7=<>\ETPack\docs\Level Designers Reference\images\common\ladder.jpg -file8=<>\ETPack\docs\Level Designers Reference\images\common\lightgrid.jpg -file9=<>\ETPack\docs\Level Designers Reference\images\common\nodraw.jpg -file10=<>\ETPack\docs\Level Designers Reference\images\common\origin.jpg -file11=<>\ETPack\docs\Level Designers Reference\images\common\skip.jpg -file12=<>\ETPack\docs\Level Designers Reference\images\common\terrain.jpg -file13=<>\ETPack\docs\Level Designers Reference\images\common\terrain_sand.jpg -file14=<>\ETPack\docs\Level Designers Reference\images\common\terrain_snow.jpg - -[docs\Level Designers Reference\styles] -fulldirectory= -file0=<>\ETPack\docs\Level Designers Reference\styles\style.css - -[bitmaps] -fulldirectory= -file0=<>\ETPack\bitmaps\splash.bmp - diff --git a/setup/win32/template/File Groups/ET Media Files.fgl b/setup/win32/template/File Groups/ET Media Files.fgl deleted file mode 100644 index b34dd2c4..00000000 --- a/setup/win32/template/File Groups/ET Media Files.fgl +++ /dev/null @@ -1,463 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\ETPack\common.pk3 -file1=<>\ETPack\lights.pk3 -file2=<>\ETPack\astro-skies.pk3 -file3=<>\ETPack\mapmedia.pk3 -file4=<>\ETPack\goldrush.pcx -SubDir0=scripts -SubDir1=models -SubDir2=maps - -[scripts] -fulldirectory= -file0=<>\ETPack\scripts\xlab_wall.shader -file1=<>\ETPack\scripts\_unsorted.shader -file2=<>\ETPack\scripts\alpha.shader -file3=<>\ETPack\scripts\alpha_sd.shader -file4=<>\ETPack\scripts\assault.shader -file5=<>\ETPack\scripts\assault_rock.shader -file6=<>\ETPack\scripts\awf_props.shader -file7=<>\ETPack\scripts\battery.shader -file8=<>\ETPack\scripts\battery_wall.shader -file9=<>\ETPack\scripts\bbmodels_mapobjects.shader -file10=<>\ETPack\scripts\blimp.shader -file11=<>\ETPack\scripts\bunker_sd.shader -file12=<>\ETPack\scripts\castle_door.shader -file13=<>\ETPack\scripts\castle_floor.shader -file14=<>\ETPack\scripts\castle_window.shader -file15=<>\ETPack\scripts\castle_wood.shader -file16=<>\ETPack\scripts\chat.shader -file17=<>\ETPack\scripts\chat_window.shader -file18=<>\ETPack\scripts\chat_wood.shader -file19=<>\ETPack\scripts\chateau.shader -file20=<>\ETPack\scripts\common.shader -file21=<>\ETPack\scripts\decals.shader -file22=<>\ETPack\scripts\default_project.proj -file23=<>\ETPack\scripts\doors.shader -file24=<>\ETPack\scripts\eerie.shader -file25=<>\ETPack\scripts\egypt_door_sd.shader -file26=<>\ETPack\scripts\egypt_floor_sd.shader -file27=<>\ETPack\scripts\egypt_props_sd.shader -file28=<>\ETPack\scripts\egypt_rock_sd.shader -file29=<>\ETPack\scripts\egypt_trim_sd.shader -file30=<>\ETPack\scripts\egypt_walls_sd.shader -file31=<>\ETPack\scripts\egypt_windows_sd.shader -file32=<>\ETPack\scripts\egypt_wood_sd.shader -file33=<>\ETPack\scripts\et_entities.def -file34=<>\ETPack\scripts\factory_sd.shader -file35=<>\ETPack\scripts\fueldump.shader -file36=<>\ETPack\scripts\gfx_2d.shader -file37=<>\ETPack\scripts\gfx_clipboard.shader -file38=<>\ETPack\scripts\gfx_damage.shader -file39=<>\ETPack\scripts\gfx_hud.shader -file40=<>\ETPack\scripts\gfx_limbo.shader -file41=<>\ETPack\scripts\gfx_misc.shader -file42=<>\ETPack\scripts\goldrush.shader -file43=<>\ETPack\scripts\icons.shader -file44=<>\ETPack\scripts\levelshots.shader -file45=<>\ETPack\scripts\lights.shader -file46=<>\ETPack\scripts\liquids.shader -file47=<>\ETPack\scripts\liquids_sd.shader -file48=<>\ETPack\scripts\mapfx.shader -file49=<>\ETPack\scripts\metal_misc.shader -file50=<>\ETPack\scripts\metals_sd.shader -file51=<>\ETPack\scripts\miltary_door.shader -file52=<>\ETPack\scripts\miltary_trim.shader -file53=<>\ETPack\scripts\miltary_wall.shader -file54=<>\ETPack\scripts\models_ammo.shader -file55=<>\ETPack\scripts\models_foliage.shader -file56=<>\ETPack\scripts\models_furniture.shader -file57=<>\ETPack\scripts\models_mapobjects.shader -file58=<>\ETPack\scripts\models_multiplayer.shader -file59=<>\ETPack\scripts\models_players.shader -file60=<>\ETPack\scripts\models_shards.shader -file61=<>\ETPack\scripts\models_weapons2.shader -file62=<>\ETPack\scripts\mp_goldrush.shader -file63=<>\ETPack\scripts\mp_guns.shader -file64=<>\ETPack\scripts\mp_railgun.shader -file65=<>\ETPack\scripts\mp_rocket.shader -file66=<>\ETPack\scripts\mp_seawall.shader -file67=<>\ETPack\scripts\mp_siwa.shader -file68=<>\ETPack\scripts\mp_wurzburg.shader -file69=<>\ETPack\scripts\props.shader -file70=<>\ETPack\scripts\props_sd.shader -file71=<>\ETPack\scripts\radar.shader -file72=<>\ETPack\scripts\railgun_props.shader -file73=<>\ETPack\scripts\railway_sd.shader -file74=<>\ETPack\scripts\rock.shader -file75=<>\ETPack\scripts\rubble.shader -file76=<>\ETPack\scripts\seawall_wall.shader -file77=<>\ETPack\scripts\sfx.shader -file78=<>\ETPack\scripts\shaderlist.txt -file79=<>\ETPack\scripts\shadows.shader -file80=<>\ETPack\scripts\siwa_fx_sd.shader -file81=<>\ETPack\scripts\siwa_props_sd.shader -file82=<>\ETPack\scripts\siwa_skyboxes_sd.shader -file83=<>\ETPack\scripts\skies.shader -file84=<>\ETPack\scripts\skies_sd.shader -file85=<>\ETPack\scripts\snow.shader -file86=<>\ETPack\scripts\snow_sd.shader -file87=<>\ETPack\scripts\sprites.shader -file88=<>\ETPack\scripts\stone.shader -file89=<>\ETPack\scripts\swf.shader -file90=<>\ETPack\scripts\temperate_sd.shader -file91=<>\ETPack\scripts\terrain.shader -file92=<>\ETPack\scripts\textures.shader -file93=<>\ETPack\scripts\tobruk_wall_sd.shader -file94=<>\ETPack\scripts\tobruk_windows_sd.shader -file95=<>\ETPack\scripts\town_props.shader -file96=<>\ETPack\scripts\town_roof.shader -file97=<>\ETPack\scripts\town_wall.shader -file98=<>\ETPack\scripts\town_window.shader -file99=<>\ETPack\scripts\town_wood.shader -file100=<>\ETPack\scripts\tree.shader -file101=<>\ETPack\scripts\ui_assets2.shader -file102=<>\ETPack\scripts\ui_assets.shader -file103=<>\ETPack\scripts\villa_sd.shader -file104=<>\ETPack\scripts\village.shader -file105=<>\ETPack\scripts\wood.shader -file106=<>\ETPack\scripts\xlab_door.shader -file107=<>\ETPack\scripts\xlab_props.shader - -[models] -fulldirectory= -SubDir0=models\mapobjects - -[models\mapobjects] -fulldirectory= -SubDir0=models\mapobjects\archeology -SubDir1=models\mapobjects\battery_rocks -SubDir2=models\mapobjects\blitz_sd -SubDir3=models\mapobjects\book -SubDir4=models\mapobjects\chandelier -SubDir5=models\mapobjects\coat -SubDir6=models\mapobjects\dinghy_sd -SubDir7=models\mapobjects\flag -SubDir8=models\mapobjects\furniture -SubDir9=models\mapobjects\light -SubDir10=models\mapobjects\logs_sd -SubDir11=models\mapobjects\military_trim -SubDir12=models\mapobjects\xlab -SubDir13=models\mapobjects\trees_sd -SubDir14=models\mapobjects\tree_temperate_sd -SubDir15=models\mapobjects\tree_desert_sd -SubDir16=models\mapobjects\tanks_sd -SubDir17=models\mapobjects\spool_sd -SubDir18=models\mapobjects\shell_sd -SubDir19=models\mapobjects\seawall_rocks -SubDir20=models\mapobjects\rocks_sd -SubDir21=models\mapobjects\raster -SubDir22=models\mapobjects\props_sd -SubDir23=models\mapobjects\plants_sd -SubDir24=models\mapobjects\plants -SubDir25=models\mapobjects\pak75_sd -SubDir26=models\mapobjects\electronics -SubDir27=models\mapobjects\siwa_props_sd -SubDir28=models\mapobjects\prefabs_sd -SubDir29=models\mapobjects\vehicles -SubDir30=models\mapobjects\barrel_sd - -[models\mapobjects\archeology] -fulldirectory= -file0=<>\ETPack\models\mapobjects\archeology\vessel.md3 -file1=<>\ETPack\models\mapobjects\archeology\obelisk.md3 -file2=<>\ETPack\models\mapobjects\archeology\pitcher.md3 -file3=<>\ETPack\models\mapobjects\archeology\vase1.md3 -file4=<>\ETPack\models\mapobjects\archeology\vase2.md3 -file5=<>\ETPack\models\mapobjects\archeology\vase3.md3 -file6=<>\ETPack\models\mapobjects\archeology\vase4.md3 -file7=<>\ETPack\models\mapobjects\archeology\vase5.md3 - -[models\mapobjects\battery_rocks] -fulldirectory= -file0=<>\ETPack\models\mapobjects\battery_rocks\rocks3.ase -file1=<>\ETPack\models\mapobjects\battery_rocks\rocks1.ase -file2=<>\ETPack\models\mapobjects\battery_rocks\rocks2.ase - -[models\mapobjects\blitz_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsf_s_mm.md3 -file1=<>\ETPack\models\mapobjects\blitz_sd\blitz_sd_interior.tga -file2=<>\ETPack\models\mapobjects\blitz_sd\blitz_sd_s.tga -file3=<>\ETPack\models\mapobjects\blitz_sd\blitzbody2_s.md3 -file4=<>\ETPack\models\mapobjects\blitz_sd\blitzbody2_s.tag -file5=<>\ETPack\models\mapobjects\blitz_sd\blitzbody3_mm.md3 -file6=<>\ETPack\models\mapobjects\blitz_sd\blitzbody3_s.md3 -file7=<>\ETPack\models\mapobjects\blitz_sd\blitzbody3_s_mm.md3 -file8=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsb_mm.md3 -file9=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsb_s.md3 -file10=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsb_s_mm.md3 -file11=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsf_mm.md3 -file12=<>\ETPack\models\mapobjects\blitz_sd\blitzwheelsf_s.md3 - -[models\mapobjects\book] -fulldirectory= -file0=<>\ETPack\models\mapobjects\book\book.md3 - -[models\mapobjects\chandelier] -fulldirectory= -file0=<>\ETPack\models\mapobjects\chandelier\chandlier_new.md3 -file1=<>\ETPack\models\mapobjects\chandelier\chandelier.md3 -file2=<>\ETPack\models\mapobjects\chandelier\chandelier_lt.md3 -file3=<>\ETPack\models\mapobjects\chandelier\chandelier_lt_sm.md3 - -[models\mapobjects\coat] -fulldirectory= -file0=<>\ETPack\models\mapobjects\coat\coat.md3 - -[models\mapobjects\dinghy_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\dinghy_sd\dinghy.md3 - -[models\mapobjects\flag] -fulldirectory= -file0=<>\ETPack\models\mapobjects\flag\flag_axis.md3 -file1=<>\ETPack\models\mapobjects\flag\flag_allied.md3 - -[models\mapobjects\furniture] -fulldirectory= -file0=<>\ETPack\models\mapobjects\furniture\type.mdc -file1=<>\ETPack\models\mapobjects\furniture\bunks.md3 -file2=<>\ETPack\models\mapobjects\furniture\chat_armchair.md3 -file3=<>\ETPack\models\mapobjects\furniture\clubchair.md3 -file4=<>\ETPack\models\mapobjects\furniture\faucet.md3 -file5=<>\ETPack\models\mapobjects\furniture\furnace1.md3 -file6=<>\ETPack\models\mapobjects\furniture\type.md3 - -[models\mapobjects\light] -fulldirectory= -file0=<>\ETPack\models\mapobjects\light\sd_sconce3.md3 -file1=<>\ETPack\models\mapobjects\light\cagelight.md3 -file2=<>\ETPack\models\mapobjects\light\cagelighta5k.md3 -file3=<>\ETPack\models\mapobjects\light\cagelighta9k.md3 -file4=<>\ETPack\models\mapobjects\light\cagelighta.md3 -file5=<>\ETPack\models\mapobjects\light\cagelightr.md3 -file6=<>\ETPack\models\mapobjects\light\lantern.md3 -file7=<>\ETPack\models\mapobjects\light\p_nolight.md3 -file8=<>\ETPack\models\mapobjects\light\pendant10k.md3 -file9=<>\ETPack\models\mapobjects\light\sd_chad2.md3 -file10=<>\ETPack\models\mapobjects\light\bel_lamp_top40.md3 - -[models\mapobjects\logs_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\logs_sd\stump05s.md3 -file1=<>\ETPack\models\mapobjects\logs_sd\log1.md3 -file2=<>\ETPack\models\mapobjects\logs_sd\log2.2.md3 -file3=<>\ETPack\models\mapobjects\logs_sd\log2.md3 -file4=<>\ETPack\models\mapobjects\logs_sd\log2.tga -file5=<>\ETPack\models\mapobjects\logs_sd\log3.md3 -file6=<>\ETPack\models\mapobjects\logs_sd\stump02.md3 -file7=<>\ETPack\models\mapobjects\logs_sd\stump02s.md3 -file8=<>\ETPack\models\mapobjects\logs_sd\stump03.md3 -file9=<>\ETPack\models\mapobjects\logs_sd\stump03s.md3 -file10=<>\ETPack\models\mapobjects\logs_sd\stump04.md3 -file11=<>\ETPack\models\mapobjects\logs_sd\stump04s.md3 - -[models\mapobjects\military_trim] -fulldirectory= -file0=<>\ETPack\models\mapobjects\miltary_trim\sandbag1s.md3 -file1=<>\ETPack\models\mapobjects\miltary_trim\dragon_teeth.md3 - -[models\mapobjects\xlab] -fulldirectory= -file0=<>\ETPack\models\mapobjects\xlab\cart.md3 - -[models\mapobjects\trees_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\trees_sd\tree_e.md3 -file1=<>\ETPack\models\mapobjects\trees_sd\brokentree_b.md3 -file2=<>\ETPack\models\mapobjects\trees_sd\brokentree_t.md3 -file3=<>\ETPack\models\mapobjects\trees_sd\damptrunk01.tga -file4=<>\ETPack\models\mapobjects\trees_sd\tree_a.md3 -file5=<>\ETPack\models\mapobjects\trees_sd\tree_b.md3 -file6=<>\ETPack\models\mapobjects\trees_sd\tree_c.md3 -file7=<>\ETPack\models\mapobjects\trees_sd\tree_d.md3 - -[models\mapobjects\tree_temperate_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\tree_temperate_sd\trunk_cut.tga -file1=<>\ETPack\models\mapobjects\tree_temperate_sd\bush_temperate1.md3 -file2=<>\ETPack\models\mapobjects\tree_temperate_sd\bush_temperate2.md3 -file3=<>\ETPack\models\mapobjects\tree_temperate_sd\bush_temperate3.md3 -file4=<>\ETPack\models\mapobjects\tree_temperate_sd\bush_temperate4.md3 -file5=<>\ETPack\models\mapobjects\tree_temperate_sd\cuttrunk.md3 -file6=<>\ETPack\models\mapobjects\tree_temperate_sd\floor_leaf1.md3 -file7=<>\ETPack\models\mapobjects\tree_temperate_sd\floor_leaf1.tga -file8=<>\ETPack\models\mapobjects\tree_temperate_sd\highfoliage1.md3 -file9=<>\ETPack\models\mapobjects\tree_temperate_sd\highfoliage2.md3 -file10=<>\ETPack\models\mapobjects\tree_temperate_sd\hightree1.md3 -file11=<>\ETPack\models\mapobjects\tree_temperate_sd\hightree2.md3 -file12=<>\ETPack\models\mapobjects\tree_temperate_sd\hightrunk.md3 -file13=<>\ETPack\models\mapobjects\tree_temperate_sd\mediumfoliage1.md3 -file14=<>\ETPack\models\mapobjects\tree_temperate_sd\mediumfoliage2.md3 -file15=<>\ETPack\models\mapobjects\tree_temperate_sd\mediumtrunk.md3 -file16=<>\ETPack\models\mapobjects\tree_temperate_sd\smallfoliage1.md3 -file17=<>\ETPack\models\mapobjects\tree_temperate_sd\smallfoliage2.md3 -file18=<>\ETPack\models\mapobjects\tree_temperate_sd\smalltrunk.md3 -file19=<>\ETPack\models\mapobjects\tree_temperate_sd\tree_temperate_high.md3 - -[models\mapobjects\tree_desert_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\tree_desert_sd\tall.md3 -file1=<>\ETPack\models\mapobjects\tree_desert_sd\newpalm.md3 -file2=<>\ETPack\models\mapobjects\tree_desert_sd\newpalmsmall.md3 -file3=<>\ETPack\models\mapobjects\tree_desert_sd\newpalmtall.md3 -file4=<>\ETPack\models\mapobjects\tree_desert_sd\palm_bark2.tga -file5=<>\ETPack\models\mapobjects\tree_desert_sd\palm_bark.tga -file6=<>\ETPack\models\mapobjects\tree_desert_sd\palm_leaves1.md3 -file7=<>\ETPack\models\mapobjects\tree_desert_sd\palm_leaves2.md3 -file8=<>\ETPack\models\mapobjects\tree_desert_sd\palm_leaves2.tga -file9=<>\ETPack\models\mapobjects\tree_desert_sd\palm_leaves3.md3 -file10=<>\ETPack\models\mapobjects\tree_desert_sd\palm_leaves.tga -file11=<>\ETPack\models\mapobjects\tree_desert_sd\palm_trunk1.md3 -file12=<>\ETPack\models\mapobjects\tree_desert_sd\palm_trunk2.md3 -file13=<>\ETPack\models\mapobjects\tree_desert_sd\palm_trunk3.md3 -file14=<>\ETPack\models\mapobjects\tree_desert_sd\small.md3 - -[models\mapobjects\tanks_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\tanks_sd\wheel_b.tga -file1=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_additions_snow.tga -file2=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow.tga -file3=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_body.md3 -file4=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_body.tag -file5=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_damaged_body.md3 -file6=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_damaged_body.tag -file7=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_ext_hp.md3 -file8=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_ext_lp.md3 -file9=<>\ETPack\models\mapobjects\tanks_sd\jagdpanther_snow_turret.md3 -file10=<>\ETPack\models\mapobjects\tanks_sd\wheel2_a_s.tga -file11=<>\ETPack\models\mapobjects\tanks_sd\wheel_a_s.tga - -[models\mapobjects\spool_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\spool_sd\spool_s.md3 - -[models\mapobjects\shell_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\shell_sd\big_shell.tga -file1=<>\ETPack\models\mapobjects\shell_sd\big_shell.md3 - -[models\mapobjects\seawall_rocks] -fulldirectory= -file0=<>\ETPack\models\mapobjects\seawall_rocks\rocks3.ase -file1=<>\ETPack\models\mapobjects\seawall_rocks\rocks1.ase -file2=<>\ETPack\models\mapobjects\seawall_rocks\rocks2.ase - -[models\mapobjects\rocks_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\rocks_sd\rock_tunnelsiwa.jpg -file1=<>\ETPack\models\mapobjects\rocks_sd\rock_big1.md3 -file2=<>\ETPack\models\mapobjects\rocks_sd\rock_big2.md3 -file3=<>\ETPack\models\mapobjects\rocks_sd\rock_big3.md3 -file4=<>\ETPack\models\mapobjects\rocks_sd\rock_big4.md3 -file5=<>\ETPack\models\mapobjects\rocks_sd\rock_big5.md3 -file6=<>\ETPack\models\mapobjects\rocks_sd\rock_desert.jpg -file7=<>\ETPack\models\mapobjects\rocks_sd\rock_desert_big.jpg -file8=<>\ETPack\models\mapobjects\rocks_sd\rock_desert_small.jpg -file9=<>\ETPack\models\mapobjects\rocks_sd\rock_medium1.md3 -file10=<>\ETPack\models\mapobjects\rocks_sd\rock_medium2.md3 -file11=<>\ETPack\models\mapobjects\rocks_sd\rock_medium3.md3 -file12=<>\ETPack\models\mapobjects\rocks_sd\rock_small1.md3 -file13=<>\ETPack\models\mapobjects\rocks_sd\rock_small2.md3 -file14=<>\ETPack\models\mapobjects\rocks_sd\rock_small3.md3 -file15=<>\ETPack\models\mapobjects\rocks_sd\rock_snow_small.jpg -file16=<>\ETPack\models\mapobjects\rocks_sd\rock_temperate.jpg -file17=<>\ETPack\models\mapobjects\rocks_sd\rock_temperate_big.jpg - -[models\mapobjects\raster] -fulldirectory= -file0=<>\ETPack\models\mapobjects\raster\moto_wheel.md3 -file1=<>\ETPack\models\mapobjects\raster\moto.md3 -file2=<>\ETPack\models\mapobjects\raster\moto_body2.md3 -file3=<>\ETPack\models\mapobjects\raster\moto_body.md3 -file4=<>\ETPack\models\mapobjects\raster\moto_gastank.md3 -file5=<>\ETPack\models\mapobjects\raster\moto_handelbar.md3 - -[models\mapobjects\props_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\props_sd\xlight_fg2_oasis.md3 -file1=<>\ETPack\models\mapobjects\props_sd\basket.md3 -file2=<>\ETPack\models\mapobjects\props_sd\basketlevel_high.md3 -file3=<>\ETPack\models\mapobjects\props_sd\basketlevel_low.md3 -file4=<>\ETPack\models\mapobjects\props_sd\fuel_can.md3 -file5=<>\ETPack\models\mapobjects\props_sd\snowrock1_a.md3 -file6=<>\ETPack\models\mapobjects\props_sd\snowrock2_a.md3 -file7=<>\ETPack\models\mapobjects\props_sd\snowrock3_a.md3 -file8=<>\ETPack\models\mapobjects\props_sd\snowrock.tga -file9=<>\ETPack\models\mapobjects\props_sd\vase.md3 -file10=<>\ETPack\models\mapobjects\props_sd\vase_broken_1.md3 -file11=<>\ETPack\models\mapobjects\props_sd\vase_broken_2.md3 -file12=<>\ETPack\models\mapobjects\props_sd\vase_broken_bits.md3 -file13=<>\ETPack\models\mapobjects\props_sd\xlight_fg2.md3 - -[models\mapobjects\plants_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\plants_sd\shrub_green2.tga -file1=<>\ETPack\models\mapobjects\plants_sd\bush_high.md3 -file2=<>\ETPack\models\mapobjects\plants_sd\bush_low.md3 -file3=<>\ETPack\models\mapobjects\plants_sd\bush_snow2.tga -file4=<>\ETPack\models\mapobjects\plants_sd\catail3.tga -file5=<>\ETPack\models\mapobjects\plants_sd\catail.md3 -file6=<>\ETPack\models\mapobjects\plants_sd\deadbranch2_damp.tga -file7=<>\ETPack\models\mapobjects\plants_sd\deadbranch3_damp.tga -file8=<>\ETPack\models\mapobjects\plants_sd\grass_dry1.tga -file9=<>\ETPack\models\mapobjects\plants_sd\grass_dry2.tga -file10=<>\ETPack\models\mapobjects\plants_sd\grass_dry3.tga -file11=<>\ETPack\models\mapobjects\plants_sd\grass_green2.tga -file12=<>\ETPack\models\mapobjects\plants_sd\grass_green3.tga -file13=<>\ETPack\models\mapobjects\plants_sd\grass_low.md3 -file14=<>\ETPack\models\mapobjects\plants_sd\grassdryfoliage.md3 -file15=<>\ETPack\models\mapobjects\plants_sd\grassdryfoliage_oasis.md3 -file16=<>\ETPack\models\mapobjects\plants_sd\grassfoliage.md3 -file17=<>\ETPack\models\mapobjects\plants_sd\leaf1.tga -file18=<>\ETPack\models\mapobjects\plants_sd\leaf2.tga -file19=<>\ETPack\models\mapobjects\plants_sd\leaf3.tga -file20=<>\ETPack\models\mapobjects\plants_sd\leaf_high.md3 -file21=<>\ETPack\models\mapobjects\plants_sd\leaf_low.md3 -file22=<>\ETPack\models\mapobjects\plants_sd\mil1.tga -file23=<>\ETPack\models\mapobjects\plants_sd\mil2.tga -file24=<>\ETPack\models\mapobjects\plants_sd\mil.md3 -file25=<>\ETPack\models\mapobjects\plants_sd\shrub_green1.tga - -[models\mapobjects\plants] -fulldirectory= -file0=<>\ETPack\models\mapobjects\plants\bush.md3 -file1=<>\ETPack\models\mapobjects\plants\bush2.md3 - -[models\mapobjects\pak75_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\pak75_sd\pak75-a.tga -file1=<>\ETPack\models\mapobjects\pak75_sd\pak75_broken_s.md3 -file2=<>\ETPack\models\mapobjects\pak75_sd\pak75_s.md3 -file3=<>\ETPack\models\mapobjects\pak75_sd\pak75_s.tga - -[models\mapobjects\electronics] -fulldirectory= -file0=<>\ETPack\models\mapobjects\electronics\phone.md3 - -[models\mapobjects\siwa_props_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\siwa_props_sd\siwa_cushiona1.md3 - -[models\mapobjects\prefabs_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\prefabs_sd\goldrush_laundry.ase -file1=<>\ETPack\models\mapobjects\prefabs_sd\goldrush_bank_roof.ase - -[models\mapobjects\vehicles] -fulldirectory= -file0=<>\ETPack\models\mapobjects\vehicles\wagon_tilt.md3 - -[models\mapobjects\barrel_sd] -fulldirectory= -file0=<>\ETPack\models\mapobjects\barrel_sd\barrel.md3 - -[maps] -fulldirectory= -file0=<>\ETPack\maps\goldrush.map - diff --git a/setup/win32/template/File Groups/Example Files.fgl b/setup/win32/template/File Groups/Example Files.fgl deleted file mode 100644 index 04090b95..00000000 --- a/setup/win32/template/File Groups/Example Files.fgl +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - diff --git a/setup/win32/template/File Groups/Halflife Executable Files.fgl b/setup/win32/template/File Groups/Halflife Executable Files.fgl deleted file mode 100644 index a3412cf8..00000000 --- a/setup/win32/template/File Groups/Halflife Executable Files.fgl +++ /dev/null @@ -1,76 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\HalflifePack\gametools\common-hydra.wad -file1=<>\HalflifePack\gametools\radiant.wad -file2=<>\HalflifePack\gametools\synapse.config -SubDir0=modules -SubDir1=plugins -SubDir2=scripts -SubDir3=sprites -SubDir4=ZHLT - -[modules] -fulldirectory=modules - -[plugins] -fulldirectory=plugins -file0=<>\GtkRadiant\contrib\hydratoolz\Release\hydratoolz.dll - -[scripts] -fulldirectory= -file0=<>\HalflifePack\gametools\scripts\common-hydra.shader -file1=<>\HalflifePack\gametools\scripts\shaderlist.txt - -[sprites] -fulldirectory= -file0=<>\HalflifePack\gametools\sprites\speaker.spr -file1=<>\HalflifePack\gametools\sprites\lightbulb.spr -SubDir0=sprites\cs - -[sprites\cs] -fulldirectory= -file0=<>\HalflifePack\gametools\sprites\CS\VIP.spr -file1=<>\HalflifePack\gametools\sprites\CS\Armoury.spr -file2=<>\HalflifePack\gametools\sprites\CS\BombTarget.spr -file3=<>\HalflifePack\gametools\sprites\CS\CT.spr -file4=<>\HalflifePack\gametools\sprites\CS\Hostage.spr -file5=<>\HalflifePack\gametools\sprites\CS\HostageRescue.spr -file6=<>\HalflifePack\gametools\sprites\CS\MapParams.spr -file7=<>\HalflifePack\gametools\sprites\CS\Terrorist.spr - -[ZHLT] -fulldirectory= -file0=<>\HalflifePack\gametools\ZHLT\ZonersHalflifeTools.html -file1=<>\HalflifePack\gametools\ZHLT\CCXX32.dll -file2=<>\HalflifePack\gametools\ZHLT\clipnode.map -file3=<>\HalflifePack\gametools\ZHLT\default.hull -file4=<>\HalflifePack\gametools\ZHLT\dumpbrush.pl -file5=<>\HalflifePack\gametools\ZHLT\dumpent.pl -file6=<>\HalflifePack\gametools\ZHLT\dumpline.pl -file7=<>\HalflifePack\gametools\ZHLT\hlbsp.exe -file8=<>\HalflifePack\gametools\ZHLT\hlcsg.exe -file9=<>\HalflifePack\gametools\ZHLT\hlrad.exe -file10=<>\HalflifePack\gametools\ZHLT\hlvis.exe -file11=<>\HalflifePack\gametools\ZHLT\netvis.exe -file12=<>\HalflifePack\gametools\ZHLT\netvis.html -file13=<>\HalflifePack\gametools\ZHLT\numberbrush.pl -file14=<>\HalflifePack\gametools\ZHLT\ripent.exe -file15=<>\HalflifePack\gametools\ZHLT\stripnulents.pl -file16=<>\HalflifePack\gametools\ZHLT\tfcabbrev.pl -file17=<>\HalflifePack\gametools\ZHLT\zeditor.wad -file18=<>\HalflifePack\gametools\ZHLT\zhlt.css -file19=<>\HalflifePack\gametools\ZHLT\zhlt.wad -file20=<>\HalflifePack\gametools\ZHLT\ZHLTIntro.html -file21=<>\HalflifePack\gametools\ZHLT\ZHLTProblems.html -file22=<>\HalflifePack\gametools\ZHLT\ZHLTReference.html -SubDir0=ZHLT\pics - -[ZHLT\pics] -fulldirectory= -file0=<>\HalflifePack\gametools\ZHLT\pics\coplanar-1.gif -file1=<>\HalflifePack\gametools\ZHLT\pics\coplanar-2.gif -file2=<>\HalflifePack\gametools\ZHLT\pics\max_portals_on_leaf.gif - diff --git a/setup/win32/template/File Groups/Halflife Media Files.fgl b/setup/win32/template/File Groups/Halflife Media Files.fgl deleted file mode 100644 index b57e3e68..00000000 --- a/setup/win32/template/File Groups/Halflife Media Files.fgl +++ /dev/null @@ -1,30 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=valve -SubDir1=cstrike - -[valve] -fulldirectory= -SubDir0=valve\scripts - -[valve\scripts] -fulldirectory= -file0=<>\HalflifePack\valve\scripts\halflife.fgd -file1=<>\HalflifePack\valve\scripts\default_project.proj - -[cstrike] -fulldirectory= -SubDir0=cstrike\scripts -SubDir1=cstrike\maps - -[cstrike\scripts] -fulldirectory= -file0=<>\HalflifePack\cstrike\scripts\halflife-cs.fgd - -[cstrike\maps] -fulldirectory= -file0=<>\HalflifePack\cstrike\maps\de_mexico-sample.map - diff --git a/setup/win32/template/File Groups/Heretic2 Executable Files.fgl b/setup/win32/template/File Groups/Heretic2 Executable Files.fgl deleted file mode 100644 index 2d850b81..00000000 --- a/setup/win32/template/File Groups/Heretic2 Executable Files.fgl +++ /dev/null @@ -1,18 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\tools\quake2\qdata_heretic2\Release\qdata3.exe -file1=<>\GtkRadiant\tools\quake2\q2map\Release\q2map.exe -file2=<>\Her2Pack\synapse.config -file3=<>\Her2Pack\game.xlink -file4=<>\libxml2\win32\binaries-release\libxml2.dll -SubDir0=modules - -[modules] -fulldirectory= -file0=<>\GtkRadiant\plugins\vfspak\Release\vfspak.dll -file1=<>\GtkRadiant\plugins\imagem8\Release\imagem8.dll -file2=<>\GtkRadiant\plugins\surface_heretic2\Release\surface_heretic2.dll - diff --git a/setup/win32/template/File Groups/Heretic2 Media Files.fgl b/setup/win32/template/File Groups/Heretic2 Media Files.fgl deleted file mode 100644 index 4e7124c0..00000000 --- a/setup/win32/template/File Groups/Heretic2 Media Files.fgl +++ /dev/null @@ -1,66 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=models -SubDir1=scripts -SubDir2=textures - -[models] -fulldirectory= -SubDir0=models\radiant - -[models\radiant] -fulldirectory= -SubDir0=models\radiant\items - -[models\radiant\items] -fulldirectory= -SubDir0=models\radiant\items\mana -SubDir1=models\radiant\items\weapons - -[models\radiant\items\mana] -fulldirectory= -SubDir0=models\radiant\items\mana\defensive - -[models\radiant\items\mana\defensive] -fulldirectory= -SubDir0=models\radiant\items\mana\defensive\full -SubDir1=models\radiant\items\mana\defensive\half - -[models\radiant\items\mana\defensive\full] -fulldirectory= -file0=<>\Her2Pack\base\models\radiant\items\mana\defensive\full\tris.fm -file1=<>\Her2Pack\base\models\radiant\items\mana\defensive\full\!skin_def2.m8 -file2=<>\Her2Pack\base\models\radiant\items\mana\defensive\full\!skin_off2.m8 - -[models\radiant\items\mana\defensive\half] -fulldirectory= -file0=<>\Her2Pack\base\models\radiant\items\mana\defensive\half\tris.fm -file1=<>\Her2Pack\base\models\radiant\items\mana\defensive\half\!skin_def1.m8 -file2=<>\Her2Pack\base\models\radiant\items\mana\defensive\half\!skin_off1.m8 - -[models\radiant\items\weapons] -fulldirectory= -SubDir0=models\radiant\items\weapons\pbow - -[models\radiant\items\weapons\pbow] -fulldirectory= -file0=<>\Her2Pack\base\models\radiant\items\weapons\pbow\tris.fm -file1=<>\Her2Pack\base\models\radiant\items\weapons\pbow\!skin2.pcx.m8 -file2=<>\Her2Pack\base\models\radiant\items\weapons\pbow\!skin.pcx.m8 - -[scripts] -fulldirectory= -file0=<>\Her2Pack\base\scripts\entities.def -file1=<>\Her2Pack\base\scripts\default_project.proj - -[textures] -fulldirectory= -SubDir0=textures\radiant - -[textures\radiant] -fulldirectory= -file0=<>\Her2Pack\base\textures\radiant\notex.m8 - diff --git a/setup/win32/template/File Groups/JA Executable Files.fgl b/setup/win32/template/File Groups/JA Executable Files.fgl deleted file mode 100644 index 1376ab8c..00000000 --- a/setup/win32/template/File Groups/JA Executable Files.fgl +++ /dev/null @@ -1,58 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\JAPack\game.xlink -file1=<>\JAPack\synapse.config -SubDir0=docs -SubDir1=bitmaps -SubDir2=Tools - -[docs] -fulldirectory= -file0=<>\JAPack\docs\Siege.doc -file1=<>\JAPack\docs\JASDK.message.txt - -[bitmaps] -fulldirectory= -file0=<>\JAPack\bitmaps\splash.bmp - -[Tools] -fulldirectory= -file0=<>\JAPack\Tools\ShaderEd2.exe -file1=<>\JAPack\Tools\Assimilate.exe -file2=<>\JAPack\Tools\behaved.bhc -file3=<>\JAPack\Tools\BehavEd.exe -file4=<>\JAPack\Tools\Bot waypoint tutorial.doc -file5=<>\JAPack\Tools\carcass.exe -file6=<>\JAPack\Tools\Disclaimer-JediAcademy-Tools.htm -file7=<>\JAPack\Tools\IBIze.exe -file8=<>\JAPack\Tools\ICARUS Manual.doc -file9=<>\JAPack\Tools\JAscripts.zip -file10=<>\JAPack\Tools\JKA Game Source License.htm -file11=<>\JAPack\Tools\MD3View.exe -file12=<>\JAPack\Tools\ModView.exe -file13=<>\JAPack\Tools\Readme.txt -file14=<>\JAPack\Tools\roq.exe -SubDir0=Tools\docs -SubDir1=Tools\EffectsEd - -[Tools\docs] -fulldirectory= -file0=<>\JAPack\Tools\docs\template.vwp -file1=<>\JAPack\Tools\docs\NPC_read_me.txt -file2=<>\JAPack\Tools\docs\sab_read_me.txt -file3=<>\JAPack\Tools\docs\template.veh - -[Tools\EffectsEd] -fulldirectory= -file0=<>\JAPack\Tools\EffectsEd\Using_EffectsEd.doc -file1=<>\JAPack\Tools\EffectsEd\brick.jpg -file2=<>\JAPack\Tools\EffectsEd\clamp.jpg -file3=<>\JAPack\Tools\EffectsEd\dirt.jpg -file4=<>\JAPack\Tools\EffectsEd\EffectsEd.exe -file5=<>\JAPack\Tools\EffectsEd\none.jpg -file6=<>\JAPack\Tools\EffectsEd\stucco.jpg -file7=<>\JAPack\Tools\EffectsEd\transitions.exe - diff --git a/setup/win32/template/File Groups/JA Media Files.fgl b/setup/win32/template/File Groups/JA Media Files.fgl deleted file mode 100644 index b0417d89..00000000 --- a/setup/win32/template/File Groups/JA Media Files.fgl +++ /dev/null @@ -1,9 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[DYNAMIC] -FOLDER=<> -INCLUDESUBDIR=YES -WILDCARD0=*.* - diff --git a/setup/win32/template/File Groups/JKII Executable Files.fgl b/setup/win32/template/File Groups/JKII Executable Files.fgl deleted file mode 100644 index 92847eb0..00000000 --- a/setup/win32/template/File Groups/JKII Executable Files.fgl +++ /dev/null @@ -1,55 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\JK2Pack\game.xlink -file1=<>\JK2Pack\bin\BehavEd.bhc -file2=<>\RavenPack\bin\BehavEd.exe -file3=<>\RavenPack\bin\EffectsEd.exe -file4=<>\RavenPack\bin\IBIze.exe -file5=<>\RavenPack\bin\roq.exe -file6=<>\JK2Pack\synapse.config -SubDir0=docs - -[docs] -fulldirectory= -file0=<>\JK2Pack\docs\Bot waypoint tutorial.htm -file1=<>\RavenPack\docs\Using_EffectsEd.htm -file2=<>\RavenPack\docs\Guide to SOF2JK2 Vertigons.htm -file3=<>\RavenPack\docs\Guide to SOF2JK2 Weather.htm -file4=<>\RavenPack\docs\ICARUS Manual.htm -file5=<>\RavenPack\docs\Q3_Enhancements.htm -file6=<>\RavenPack\docs\ROQ_Files.htm -SubDir0=docs\GtkRadiant_JK2_HOWTO -SubDir1=docs\Using_EffectsEd_files - -[docs\GtkRadiant_JK2_HOWTO] -fulldirectory= -file0=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\index.html -file1=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\bsp_menu.png -file2=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\game1.png -file3=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\game2.png -file4=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\bsp_console.png -file5=<>\JK2Pack\docs\GtkRadiant_JK2_HOWTO\project.png - -[docs\Using_EffectsEd_files] -fulldirectory= -file0=<>\RavenPack\docs\Using_EffectsEd_files\filelist.xml -file1=<>\RavenPack\docs\Using_EffectsEd_files\image001.jpg -file2=<>\RavenPack\docs\Using_EffectsEd_files\image002.jpg -file3=<>\RavenPack\docs\Using_EffectsEd_files\image003.jpg -file4=<>\RavenPack\docs\Using_EffectsEd_files\image004.jpg -file5=<>\RavenPack\docs\Using_EffectsEd_files\image005.jpg -file6=<>\RavenPack\docs\Using_EffectsEd_files\image006.jpg -file7=<>\RavenPack\docs\Using_EffectsEd_files\image007.jpg -file8=<>\RavenPack\docs\Using_EffectsEd_files\image008.jpg -file9=<>\RavenPack\docs\Using_EffectsEd_files\image009.jpg -file10=<>\RavenPack\docs\Using_EffectsEd_files\image010.jpg -file11=<>\RavenPack\docs\Using_EffectsEd_files\image011.jpg -file12=<>\RavenPack\docs\Using_EffectsEd_files\image012.jpg -file13=<>\RavenPack\docs\Using_EffectsEd_files\image013.jpg -file14=<>\RavenPack\docs\Using_EffectsEd_files\image014.jpg -file15=<>\RavenPack\docs\Using_EffectsEd_files\image015.jpg -file16=<>\RavenPack\docs\Using_EffectsEd_files\image016.jpg - diff --git a/setup/win32/template/File Groups/JKII Media Files.fgl b/setup/win32/template/File Groups/JKII Media Files.fgl deleted file mode 100644 index 43606f0b..00000000 --- a/setup/win32/template/File Groups/JKII Media Files.fgl +++ /dev/null @@ -1,518 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\JK2Pack\mapextras.pk3 -file1=<>\JK2Pack\mapextras2.pk3 -SubDir0=maps -SubDir1=models -SubDir2=scripts -SubDir3=shaders - -[maps] -fulldirectory= -file0=<>\JK2Pack\maps\kejim_post.map -file1=<>\JK2Pack\maps\ctf_bespin.map -file2=<>\JK2Pack\maps\duel_valley.map -file3=<>\JK2Pack\maps\cairn_dock1.map -file4=<>\JK2Pack\maps\ctf_ns_streets.map -SubDir0=maps\prefabs - -[maps\prefabs] -fulldirectory= -file0=<>\JK2Pack\maps\prefabs\artus_control.map -file1=<>\JK2Pack\maps\prefabs\atst_physics.map -file2=<>\JK2Pack\maps\prefabs\center.map -file3=<>\JK2Pack\maps\prefabs\goodie_crate.map -file4=<>\JK2Pack\maps\prefabs\imp_controls.map -file5=<>\JK2Pack\maps\prefabs\lights_leavemealonedudethatmeansyou.map -file6=<>\JK2Pack\maps\prefabs\new_imp_controls.map -file7=<>\JK2Pack\maps\prefabs\open_srate.map -file8=<>\JK2Pack\maps\prefabs\ravensclaw.map -file9=<>\JK2Pack\maps\prefabs\scow_physics.map -file10=<>\JK2Pack\maps\prefabs\shuttle_physics.map -file11=<>\JK2Pack\maps\prefabs\standing_lamp_physics.map -file12=<>\JK2Pack\maps\prefabs\tie_physics.map -file13=<>\JK2Pack\maps\prefabs\xwing_physics.map -SubDir0=maps\prefabs\Bespin - -[maps\prefabs\Bespin] -fulldirectory= -file0=<>\JK2Pack\maps\prefabs\Bespin\cortosis.map -file1=<>\JK2Pack\maps\prefabs\Bespin\doubledoor.map - -[models] -fulldirectory= -SubDir0=models\chunks -SubDir1=models\flags -SubDir2=models\items -SubDir3=models\map_objects -SubDir4=models\player -SubDir5=models\weapons2 - -[models\chunks] -fulldirectory= -SubDir0=models\chunks\crate -SubDir1=models\chunks\generic -SubDir2=models\chunks\metal -SubDir3=models\chunks\rock - -[models\chunks\crate] -fulldirectory= -file0=<>\JK2Pack\models\chunks\crate\crate2_4.md3 -file1=<>\JK2Pack\models\chunks\crate\crate1_2.md3 -file2=<>\JK2Pack\models\chunks\crate\crate1_3.md3 -file3=<>\JK2Pack\models\chunks\crate\crate1_4.md3 -file4=<>\JK2Pack\models\chunks\crate\crate2_1.md3 -file5=<>\JK2Pack\models\chunks\crate\crate2_2.md3 -file6=<>\JK2Pack\models\chunks\crate\crate2_3.md3 -file7=<>\JK2Pack\models\chunks\crate\crate1_1.md3 - -[models\chunks\generic] -fulldirectory= -file0=<>\JK2Pack\models\chunks\generic\chunks_2.md3 -file1=<>\JK2Pack\models\chunks\generic\chunks_1.md3 - -[models\chunks\metal] -fulldirectory= -file0=<>\JK2Pack\models\chunks\metal\wmetal1_4.md3 -file1=<>\JK2Pack\models\chunks\metal\metal1_2.md3 -file2=<>\JK2Pack\models\chunks\metal\metal1_3.md3 -file3=<>\JK2Pack\models\chunks\metal\metal1_4.md3 -file4=<>\JK2Pack\models\chunks\metal\metal2_1.md3 -file5=<>\JK2Pack\models\chunks\metal\metal2_2.md3 -file6=<>\JK2Pack\models\chunks\metal\metal2_3.md3 -file7=<>\JK2Pack\models\chunks\metal\metal2_4.md3 -file8=<>\JK2Pack\models\chunks\metal\wmetal1_1.md3 -file9=<>\JK2Pack\models\chunks\metal\wmetal1_2.md3 -file10=<>\JK2Pack\models\chunks\metal\wmetal1_3.md3 -file11=<>\JK2Pack\models\chunks\metal\metal1_1.md3 - -[models\chunks\rock] -fulldirectory= -file0=<>\JK2Pack\models\chunks\rock\rock3_4.md3 -file1=<>\JK2Pack\models\chunks\rock\rock1_2.md3 -file2=<>\JK2Pack\models\chunks\rock\rock1_3.md3 -file3=<>\JK2Pack\models\chunks\rock\rock1_4.md3 -file4=<>\JK2Pack\models\chunks\rock\rock2_1.md3 -file5=<>\JK2Pack\models\chunks\rock\rock2_2.md3 -file6=<>\JK2Pack\models\chunks\rock\rock2_3.md3 -file7=<>\JK2Pack\models\chunks\rock\rock2_4.md3 -file8=<>\JK2Pack\models\chunks\rock\rock3_1.md3 -file9=<>\JK2Pack\models\chunks\rock\rock3_2.md3 -file10=<>\JK2Pack\models\chunks\rock\rock3_3.md3 -file11=<>\JK2Pack\models\chunks\rock\rock1_1.md3 - -[models\flags] -fulldirectory= -file0=<>\JK2Pack\models\flags\r_flag_ysal.md3 -file1=<>\JK2Pack\models\flags\b_flag_ysal.md3 -file2=<>\JK2Pack\models\flags\r_flag.md3 -file3=<>\JK2Pack\models\flags\b_flag.md3 - -[models\items] -fulldirectory= -file0=<>\JK2Pack\models\items\sphere.md3 -file1=<>\JK2Pack\models\items\a_shield_converter.md3 -file2=<>\JK2Pack\models\items\bacta.md3 -file3=<>\JK2Pack\models\items\battery.md3 -file4=<>\JK2Pack\models\items\binoculars.md3 -file5=<>\JK2Pack\models\items\datapad.md3 -file6=<>\JK2Pack\models\items\energy_cell.md3 -file7=<>\JK2Pack\models\items\forcegem.md3 -file8=<>\JK2Pack\models\items\key.md3 -file9=<>\JK2Pack\models\items\medpac.md3 -file10=<>\JK2Pack\models\items\metallic_bolts.md3 -file11=<>\JK2Pack\models\items\power_cell.md3 -file12=<>\JK2Pack\models\items\psd.md3 -file13=<>\JK2Pack\models\items\psd_sm.md3 -file14=<>\JK2Pack\models\items\remote.md3 -file15=<>\JK2Pack\models\items\rockets.md3 -file16=<>\JK2Pack\models\items\a_pwr_converter.md3 - -[models\map_objects] -fulldirectory= -SubDir0=models\map_objects\bespin -SubDir1=models\map_objects\cairn -SubDir2=models\map_objects\cinematics -SubDir3=models\map_objects\doom -SubDir4=models\map_objects\force_holocrons -SubDir5=models\map_objects\imp_detention -SubDir6=models\map_objects\imp_mine -SubDir7=models\map_objects\kejim -SubDir8=models\map_objects\mp -SubDir9=models\map_objects\nar_shaddar -SubDir10=models\map_objects\ships -SubDir11=models\map_objects\yavin - -[models\map_objects\bespin] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\bespin\twinpodcc.md3 -file1=<>\JK2Pack\models\map_objects\bespin\chair.md3 -file2=<>\JK2Pack\models\map_objects\bespin\panels.md3 -file3=<>\JK2Pack\models\map_objects\bespin\sconce.md3 -file4=<>\JK2Pack\models\map_objects\bespin\scow.md3 -file5=<>\JK2Pack\models\map_objects\bespin\statue.md3 -file6=<>\JK2Pack\models\map_objects\bespin\streetlight.md3 -file7=<>\JK2Pack\models\map_objects\bespin\bench.md3 -file8=<>\JK2Pack\models\map_objects\bespin\landostatue.md3 - -[models\map_objects\cairn] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\cairn\welder.md3 -file1=<>\JK2Pack\models\map_objects\cairn\absorber_d1.md3 -file2=<>\JK2Pack\models\map_objects\cairn\barrels.md3 -file3=<>\JK2Pack\models\map_objects\cairn\cargo_big.md3 -file4=<>\JK2Pack\models\map_objects\cairn\cargo_sm.md3 -file5=<>\JK2Pack\models\map_objects\cairn\container.md3 -file6=<>\JK2Pack\models\map_objects\cairn\controlpanel.md3 -file7=<>\JK2Pack\models\map_objects\cairn\emitter.md3 -file8=<>\JK2Pack\models\map_objects\cairn\floorlight.md3 -file9=<>\JK2Pack\models\map_objects\cairn\light.md3 -file10=<>\JK2Pack\models\map_objects\cairn\receptor.md3 -file11=<>\JK2Pack\models\map_objects\cairn\utilitylight.md3 -file12=<>\JK2Pack\models\map_objects\cairn\absorber.md3 - -[models\map_objects\cinematics] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\cinematics\table.md3 -file1=<>\JK2Pack\models\map_objects\cinematics\crystal2.md3 -file2=<>\JK2Pack\models\map_objects\cinematics\crystal3.md3 -file3=<>\JK2Pack\models\map_objects\cinematics\desk.md3 -file4=<>\JK2Pack\models\map_objects\cinematics\imp_shuttle.md3 -file5=<>\JK2Pack\models\map_objects\cinematics\kylesleg.md3 -file6=<>\JK2Pack\models\map_objects\cinematics\pod.md3 -file7=<>\JK2Pack\models\map_objects\cinematics\pod_hatch.md3 -file8=<>\JK2Pack\models\map_objects\cinematics\raven_cockpit.md3 -file9=<>\JK2Pack\models\map_objects\cinematics\ravensclaw.md3 -file10=<>\JK2Pack\models\map_objects\cinematics\shuttle.md3 -file11=<>\JK2Pack\models\map_objects\cinematics\chair.md3 -file12=<>\JK2Pack\models\map_objects\cinematics\substatue.md3 -file13=<>\JK2Pack\models\map_objects\cinematics\asteroid.md3 -file14=<>\JK2Pack\models\map_objects\cinematics\crystal.md3 -file15=<>\JK2Pack\models\map_objects\cinematics\crystals.md3 -file16=<>\JK2Pack\models\map_objects\cinematics\ladyluck_chairs.md3 -file17=<>\JK2Pack\models\map_objects\cinematics\statue.md3 - -[models\map_objects\doom] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\doom\antenna.md3 -file1=<>\JK2Pack\models\map_objects\doom\heater.md3 -file2=<>\JK2Pack\models\map_objects\doom\airpurifier.md3 - -[models\map_objects\force_holocrons] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\force_holocrons\speed.md3 -file1=<>\JK2Pack\models\map_objects\force_holocrons\pull.md3 -file2=<>\JK2Pack\models\map_objects\force_holocrons\push.md3 -file3=<>\JK2Pack\models\map_objects\force_holocrons\jump.md3 -file4=<>\JK2Pack\models\map_objects\force_holocrons\telepathy.md3 -file5=<>\JK2Pack\models\map_objects\force_holocrons\grip.md3 -file6=<>\JK2Pack\models\map_objects\force_holocrons\heal.md3 -file7=<>\JK2Pack\models\map_objects\force_holocrons\L1.md3 - -[models\map_objects\imp_detention] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\imp_detention\transport.md3 -file1=<>\JK2Pack\models\map_objects\imp_detention\door_lock.md3 -file2=<>\JK2Pack\models\map_objects\imp_detention\tie_fighter.md3 -file3=<>\JK2Pack\models\map_objects\imp_detention\tie_fighter_1.md3 -file4=<>\JK2Pack\models\map_objects\imp_detention\atst.md3 -file5=<>\JK2Pack\models\map_objects\imp_detention\tie_fighter_damage.md3 - -[models\map_objects\imp_mine] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\imp_mine\x_wing_1.md3 -file1=<>\JK2Pack\models\map_objects\imp_mine\con2.md3 -file2=<>\JK2Pack\models\map_objects\imp_mine\control_panel.md3 -file3=<>\JK2Pack\models\map_objects\imp_mine\crate.md3 -file4=<>\JK2Pack\models\map_objects\imp_mine\crate_open.md3 -file5=<>\JK2Pack\models\map_objects\imp_mine\crystal_raw.md3 -file6=<>\JK2Pack\models\map_objects\imp_mine\flightsuit.md3 -file7=<>\JK2Pack\models\map_objects\imp_mine\generator.md3 -file8=<>\JK2Pack\models\map_objects\imp_mine\generator_u1.md3 -file9=<>\JK2Pack\models\map_objects\imp_mine\ion_cannon_damage.md3 -file10=<>\JK2Pack\models\map_objects\imp_mine\ladyluck_gun.md3 -file11=<>\JK2Pack\models\map_objects\imp_mine\lamp.md3 -file12=<>\JK2Pack\models\map_objects\imp_mine\mbay.md3 -file13=<>\JK2Pack\models\map_objects\imp_mine\mine_drill.md3 -file14=<>\JK2Pack\models\map_objects\imp_mine\shuttle.md3 -file15=<>\JK2Pack\models\map_objects\imp_mine\spotlight.md3 -file16=<>\JK2Pack\models\map_objects\imp_mine\tank.md3 -file17=<>\JK2Pack\models\map_objects\imp_mine\turret_damage.md3 -file18=<>\JK2Pack\models\map_objects\imp_mine\x_wing.md3 -file19=<>\JK2Pack\models\map_objects\imp_mine\con1.md3 -file20=<>\JK2Pack\models\map_objects\imp_mine\turret_cannon2.md3 -file21=<>\JK2Pack\models\map_objects\imp_mine\turret_cannon2_damage.md3 -file22=<>\JK2Pack\models\map_objects\imp_mine\turret_cannon.md3 -file23=<>\JK2Pack\models\map_objects\imp_mine\wall_tank2.md3 -file24=<>\JK2Pack\models\map_objects\imp_mine\chair.md3 -file25=<>\JK2Pack\models\map_objects\imp_mine\desk.md3 -file26=<>\JK2Pack\models\map_objects\imp_mine\gonkdestroyed.md3 -file27=<>\JK2Pack\models\map_objects\imp_mine\ioncannon.md3 -file28=<>\JK2Pack\models\map_objects\imp_mine\ore_cart.md3 -file29=<>\JK2Pack\models\map_objects\imp_mine\ore_cart_rocks.md3 -file30=<>\JK2Pack\models\map_objects\imp_mine\probedestroyed.md3 -file31=<>\JK2Pack\models\map_objects\imp_mine\probedestroyed_1.md3 -file32=<>\JK2Pack\models\map_objects\imp_mine\psgun.md3 -file33=<>\JK2Pack\models\map_objects\imp_mine\r5destroyed.md3 - -[models\map_objects\kejim] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\kejim\weaponsrung.md3 -file1=<>\JK2Pack\models\map_objects\kejim\bombard_upper.md3 -file2=<>\JK2Pack\models\map_objects\kejim\cargo_small.md3 -file3=<>\JK2Pack\models\map_objects\kejim\crate_01.md3 -file4=<>\JK2Pack\models\map_objects\kejim\crate_02.md3 -file5=<>\JK2Pack\models\map_objects\kejim\crate_04.md3 -file6=<>\JK2Pack\models\map_objects\kejim\crate_xplode.md3 -file7=<>\JK2Pack\models\map_objects\kejim\crystal_machine.md3 -file8=<>\JK2Pack\models\map_objects\kejim\crystal_machine_d1.md3 -file9=<>\JK2Pack\models\map_objects\kejim\cutter.md3 -file10=<>\JK2Pack\models\map_objects\kejim\cutter_u1.md3 -file11=<>\JK2Pack\models\map_objects\kejim\dish.md3 -file12=<>\JK2Pack\models\map_objects\kejim\examiner.md3 -file13=<>\JK2Pack\models\map_objects\kejim\generator.md3 -file14=<>\JK2Pack\models\map_objects\kejim\generator_big.md3 -file15=<>\JK2Pack\models\map_objects\kejim\generator_big_d1.md3 -file16=<>\JK2Pack\models\map_objects\kejim\impcam.md3 -file17=<>\JK2Pack\models\map_objects\kejim\impcam_base.md3 -file18=<>\JK2Pack\models\map_objects\kejim\inc_mod.md3 -file19=<>\JK2Pack\models\map_objects\kejim\junction.md3 -file20=<>\JK2Pack\models\map_objects\kejim\ravensclaw.md3 -file21=<>\JK2Pack\models\map_objects\kejim\sec_panel.md3 -file22=<>\JK2Pack\models\map_objects\kejim\tram.md3 -file23=<>\JK2Pack\models\map_objects\kejim\tube.md3 -file24=<>\JK2Pack\models\map_objects\kejim\weaponsrack.md3 -file25=<>\JK2Pack\models\map_objects\kejim\bombard_base.md3 -file26=<>\JK2Pack\models\map_objects\kejim\stasistube.md3 -file27=<>\JK2Pack\models\map_objects\kejim\bombard.md3 -file28=<>\JK2Pack\models\map_objects\kejim\camera.md3 - -[models\map_objects\mp] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\mp\ysalimari.md3 -file1=<>\JK2Pack\models\map_objects\mp\dk_drain.md3 -file2=<>\JK2Pack\models\map_objects\mp\dk_enlightenment.md3 -file3=<>\JK2Pack\models\map_objects\mp\dk_grip.md3 -file4=<>\JK2Pack\models\map_objects\mp\dk_lightning.md3 -file5=<>\JK2Pack\models\map_objects\mp\dk_powerother.md3 -file6=<>\JK2Pack\models\map_objects\mp\dk_rage.md3 -file7=<>\JK2Pack\models\map_objects\mp\force_boon.md3 -file8=<>\JK2Pack\models\map_objects\mp\force_jump.md3 -file9=<>\JK2Pack\models\map_objects\mp\force_pull.md3 -file10=<>\JK2Pack\models\map_objects\mp\force_push.md3 -file11=<>\JK2Pack\models\map_objects\mp\force_sight.md3 -file12=<>\JK2Pack\models\map_objects\mp\force_speed.md3 -file13=<>\JK2Pack\models\map_objects\mp\holo.md3 -file14=<>\JK2Pack\models\map_objects\mp\jedi_enlightenment.md3 -file15=<>\JK2Pack\models\map_objects\mp\lt_absorb.md3 -file16=<>\JK2Pack\models\map_objects\mp\lt_heal.md3 -file17=<>\JK2Pack\models\map_objects\mp\lt_healother.md3 -file18=<>\JK2Pack\models\map_objects\mp\lt_protect.md3 -file19=<>\JK2Pack\models\map_objects\mp\lt_telepathy.md3 -file20=<>\JK2Pack\models\map_objects\mp\medpac.md3 -file21=<>\JK2Pack\models\map_objects\mp\psd.md3 -file22=<>\JK2Pack\models\map_objects\mp\psd_sm.md3 -file23=<>\JK2Pack\models\map_objects\mp\saber_attack.md3 -file24=<>\JK2Pack\models\map_objects\mp\saber_defend.md3 -file25=<>\JK2Pack\models\map_objects\mp\saber_throw.md3 -file26=<>\JK2Pack\models\map_objects\mp\shield.md3 -file27=<>\JK2Pack\models\map_objects\mp\sphere.md3 -file28=<>\JK2Pack\models\map_objects\mp\sphere_1.md3 -file29=<>\JK2Pack\models\map_objects\mp\bacta.md3 - -[models\map_objects\nar_shaddar] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\nar_shaddar\wine.md3 -file1=<>\JK2Pack\models\map_objects\nar_shaddar\book.md3 -file2=<>\JK2Pack\models\map_objects\nar_shaddar\coffee_pot.md3 -file3=<>\JK2Pack\models\map_objects\nar_shaddar\crate_xplode.md3 -file4=<>\JK2Pack\models\map_objects\nar_shaddar\cup.md3 -file5=<>\JK2Pack\models\map_objects\nar_shaddar\dualpod.md3 -file6=<>\JK2Pack\models\map_objects\nar_shaddar\fishtank.md3 -file7=<>\JK2Pack\models\map_objects\nar_shaddar\jabacam.md3 -file8=<>\JK2Pack\models\map_objects\nar_shaddar\plant.md3 -file9=<>\JK2Pack\models\map_objects\nar_shaddar\podbod.md3 -file10=<>\JK2Pack\models\map_objects\nar_shaddar\skiff.md3 -file11=<>\JK2Pack\models\map_objects\nar_shaddar\turret_cannon_damage.md3 -file12=<>\JK2Pack\models\map_objects\nar_shaddar\beerglass.md3 -file13=<>\JK2Pack\models\map_objects\nar_shaddar\bench01.md3 -file14=<>\JK2Pack\models\map_objects\nar_shaddar\crate.md3 -file15=<>\JK2Pack\models\map_objects\nar_shaddar\crate_banded.md3 -file16=<>\JK2Pack\models\map_objects\nar_shaddar\light_wall.md3 -file17=<>\JK2Pack\models\map_objects\nar_shaddar\reelochair.md3 -file18=<>\JK2Pack\models\map_objects\nar_shaddar\reelosdesk.md3 -file19=<>\JK2Pack\models\map_objects\nar_shaddar\table01.md3 - -[models\map_objects\ships] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\ships\x_wing.md3 -file1=<>\JK2Pack\models\map_objects\ships\tie_fighter.md3 - -[models\map_objects\yavin] -fulldirectory= -file0=<>\JK2Pack\models\map_objects\yavin\tree09_b.md3 -file1=<>\JK2Pack\models\map_objects\yavin\glowlight.md3 -file2=<>\JK2Pack\models\map_objects\yavin\grass_b.md3 -file3=<>\JK2Pack\models\map_objects\yavin\grass_tall_b.md3 -file4=<>\JK2Pack\models\map_objects\yavin\head.md3 -file5=<>\JK2Pack\models\map_objects\yavin\plant.md3 -file6=<>\JK2Pack\models\map_objects\yavin\tree_sidehill_b.md3 -file7=<>\JK2Pack\models\map_objects\yavin\tree02.md3 -file8=<>\JK2Pack\models\map_objects\yavin\tree02_b.md3 -file9=<>\JK2Pack\models\map_objects\yavin\tree05.md3 -file10=<>\JK2Pack\models\map_objects\yavin\tree05_b.md3 -file11=<>\JK2Pack\models\map_objects\yavin\tree06_b.md3 -file12=<>\JK2Pack\models\map_objects\yavin\tree08_b.md3 -file13=<>\JK2Pack\models\map_objects\yavin\tree09.md3 -file14=<>\JK2Pack\models\map_objects\yavin\fern3_b.md3 -file15=<>\JK2Pack\models\map_objects\yavin\tree_sidehill.md3 -file16=<>\JK2Pack\models\map_objects\yavin\fern2.md3 -file17=<>\JK2Pack\models\map_objects\yavin\fern2_b.md3 -file18=<>\JK2Pack\models\map_objects\yavin\fern3.md3 -file19=<>\JK2Pack\models\map_objects\yavin\fern.md3 -file20=<>\JK2Pack\models\map_objects\yavin\ferntwo.md3 -file21=<>\JK2Pack\models\map_objects\yavin\grass.md3 -file22=<>\JK2Pack\models\map_objects\yavin\grass_tall.md3 - -[models\player] -fulldirectory= -SubDir0=models\player\droids -SubDir1=models\player\mouse -SubDir2=models\player\shadowtrooper -SubDir3=models\player\remote - -[models\player\droids] -fulldirectory= -file0=<>\JK2Pack\models\players\droids\r5d2_head.md3 -file1=<>\JK2Pack\models\players\droids\probe_droid_head.md3 -file2=<>\JK2Pack\models\players\droids\probe_droid_smleg.md3 -file3=<>\JK2Pack\models\players\droids\r5d2.md3 -file4=<>\JK2Pack\models\players\droids\probe_droid_bigleg.md3 - -[models\player\mouse] -fulldirectory= -file0=<>\JK2Pack\models\players\mouse\lower.md3 - -[models\player\shadowtrooper] -fulldirectory= -file0=<>\JK2Pack\models\players\shadowtrooper\test.md3 - -[models\player\remote] -fulldirectory= -file0=<>\JK2Pack\models\players\remote\lower.md3 - -[models\weapons2] -fulldirectory= -SubDir0=models\weapons2\blaster_r -SubDir1=models\weapons2\bowcaster -SubDir2=models\weapons2\briar_pistol -SubDir3=models\weapons2\demp2 -SubDir4=models\weapons2\detpack -SubDir5=models\weapons2\disruptor -SubDir6=models\weapons2\golan_arms -SubDir7=models\weapons2\heavy_repeater -SubDir8=models\weapons2\imp_pistol -SubDir9=models\weapons2\laser_trap -SubDir10=models\weapons2\merr_sonn -SubDir11=models\weapons2\stun_baton -SubDir12=models\weapons2\thermal -SubDir13=models\weapons2\saber - -[models\weapons2\blaster_r] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\blaster_r\blaster.md3 - -[models\weapons2\bowcaster] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\bowcaster\bowcaster.md3 - -[models\weapons2\briar_pistol] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\briar_pistol\briar_pistol.md3 - -[models\weapons2\demp2] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\demp2\demp2.md3 - -[models\weapons2\detpack] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\detpack\det_pack.md3 - -[models\weapons2\disruptor] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\disruptor\disruptor.md3 - -[models\weapons2\golan_arms] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\golan_arms\golan_arms.md3 - -[models\weapons2\heavy_repeater] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\heavy_repeater\heavy_repeater.md3 - -[models\weapons2\imp_pistol] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\imp_pistol\pistol.md3 - -[models\weapons2\laser_trap] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\laser_trap\laser_trap.md3 - -[models\weapons2\merr_sonn] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\merr_sonn\merr_sonn.md3 - -[models\weapons2\stun_baton] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\stun_baton\baton.md3 - -[models\weapons2\thermal] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\thermal\thermal.md3 - -[models\weapons2\saber] -fulldirectory= -file0=<>\JK2Pack\models\weapons2\saber\saber_w.md3 - -[scripts] -fulldirectory= -file0=<>\JK2Pack\scripts\sp_entities.def -file1=<>\JK2Pack\scripts\mp_entities.def -file2=<>\JK2Pack\scripts\default_project.proj - -[shaders] -fulldirectory= -file0=<>\JK2Pack\shaders\zoom.shader -file1=<>\JK2Pack\shaders\cinematics.shader -file2=<>\JK2Pack\shaders\common.shader -file3=<>\JK2Pack\shaders\decals.shader -file4=<>\JK2Pack\shaders\doomgiver.shader -file5=<>\JK2Pack\shaders\effects.shader -file6=<>\JK2Pack\shaders\explosions.shader -file7=<>\JK2Pack\shaders\flares.shader -file8=<>\JK2Pack\shaders\fogs.shader -file9=<>\JK2Pack\shaders\gfx.shader -file10=<>\JK2Pack\shaders\gfx2.shader -file11=<>\JK2Pack\shaders\imperial.shader -file12=<>\JK2Pack\shaders\items.shader -file13=<>\JK2Pack\shaders\marks.shader -file14=<>\JK2Pack\shaders\metashader.shader -file15=<>\JK2Pack\shaders\models.shader -file16=<>\JK2Pack\shaders\mp.shader -file17=<>\JK2Pack\shaders\nar_shaddaa.shader -file18=<>\JK2Pack\shaders\players.shader -file19=<>\JK2Pack\shaders\sabers.shader -file20=<>\JK2Pack\shaders\scavenger.shader -file21=<>\JK2Pack\shaders\shaderlist.txt -file22=<>\JK2Pack\shaders\skies.shader -file23=<>\JK2Pack\shaders\sprites.shader -file24=<>\JK2Pack\shaders\system.shader -file25=<>\JK2Pack\shaders\test.shader -file26=<>\JK2Pack\shaders\text_crawl.shader -file27=<>\JK2Pack\shaders\ui.shader -file28=<>\JK2Pack\shaders\yavin.shader -file29=<>\JK2Pack\shaders\bespin.shader - diff --git a/setup/win32/template/File Groups/Model Manual Files.fgl b/setup/win32/template/File Groups/Model Manual Files.fgl deleted file mode 100644 index d4be5c23..00000000 --- a/setup/win32/template/File Groups/Model Manual Files.fgl +++ /dev/null @@ -1,16 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Model_Manual - -[Model_Manual] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Model_Manual -file0=<>\GtkRadiant\docs\manual\quake3\Model_Manual\model_manual.htm -SubDir0=Model_Manual\styles - -[Model_Manual\styles] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Model_Manual\styles -file0=<>\GtkRadiant\docs\manual\quake3\Model_Manual\styles\q3rad.css - diff --git a/setup/win32/template/File Groups/Plugins - BobToolz.fgl b/setup/win32/template/File Groups/Plugins - BobToolz.fgl deleted file mode 100644 index fc38ddc7..00000000 --- a/setup/win32/template/File Groups/Plugins - BobToolz.fgl +++ /dev/null @@ -1,30 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\contrib\bobtoolz\Release\bobToolz.dll -SubDir0=bt -SubDir1=bitmaps - -[bt] -fulldirectory= -file0=<>\GtkRadiant\contrib\bobtoolz\bt\door-tex.txt -file1=<>\GtkRadiant\contrib\bobtoolz\bt\bt-el2.txt -file2=<>\GtkRadiant\contrib\bobtoolz\bt\bt-el1.txt -file3=<>\GtkRadiant\contrib\bobtoolz\bt\door-tex-trim.txt -file4=<>\GtkRadiant\contrib\bobtoolz\bt\tp_ent.txt - -[bitmaps] -fulldirectory= -file0=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_turnedge.bmp -file1=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_caulk.bmp -file2=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_cleanup.bmp -file3=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_dropent.bmp -file4=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_merge.bmp -file5=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_poly.bmp -file6=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_split.bmp -file7=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_trainpathplot.bmp -file8=<>\GtkRadiant\contrib\bobtoolz\bitmaps\bobtoolz_treeplanter.bmp - - diff --git a/setup/win32/template/File Groups/Plugins - Curry pk3 Wolf.fgl b/setup/win32/template/File Groups/Plugins - Curry pk3 Wolf.fgl deleted file mode 100644 index 971a3066..00000000 --- a/setup/win32/template/File Groups/Plugins - Curry pk3 Wolf.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\baseq3\curry.pk3 - diff --git a/setup/win32/template/File Groups/Plugins - Curry pk3.fgl b/setup/win32/template/File Groups/Plugins - Curry pk3.fgl deleted file mode 100644 index 971a3066..00000000 --- a/setup/win32/template/File Groups/Plugins - Curry pk3.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\baseq3\curry.pk3 - diff --git a/setup/win32/template/File Groups/Plugins - Curry.fgl b/setup/win32/template/File Groups/Plugins - Curry.fgl deleted file mode 100644 index 45d45423..00000000 --- a/setup/win32/template/File Groups/Plugins - Curry.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\curry_gtk\Release\curry.dll - diff --git a/setup/win32/template/File Groups/Plugins - GTK GenSurf.fgl b/setup/win32/template/File Groups/Plugins - GTK GenSurf.fgl deleted file mode 100644 index 8073dccf..00000000 --- a/setup/win32/template/File Groups/Plugins - GTK GenSurf.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\contrib\gtkgensurf\Release\gensurf.dll - diff --git a/setup/win32/template/File Groups/Plugins - Pk3Man.fgl b/setup/win32/template/File Groups/Plugins - Pk3Man.fgl deleted file mode 100644 index 4fbc9e1f..00000000 --- a/setup/win32/template/File Groups/Plugins - Pk3Man.fgl +++ /dev/null @@ -1,20 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\pk3man_gtk_2\Release\pk3man.dll -SubDir0=bitmaps - -[bitmaps] -fulldirectory=\quake3\GtkRadiant\plugins\bitmaps -file0=<>\pk3man_gtk_2\bitmaps\pk3man_tbnew.bmp -file1=<>\pk3man_gtk_2\bitmaps\pk3man_tbdelete.bmp -file2=<>\pk3man_gtk_2\bitmaps\pk3man_tbextract.bmp -file3=<>\pk3man_gtk_2\bitmaps\pk3man_tbadd.bmp -file4=<>\pk3man_gtk_2\bitmaps\pk3man_tbopen.bmp -file5=<>\pk3man_gtk_2\bitmaps\pk3man_tbrename.bmp -file6=<>\pk3man_gtk_2\bitmaps\pk3man_tbsave.bmp -file7=<>\pk3man_gtk_2\bitmaps\pk3man_tbview.bmp -file8=<>\pk3man_gtk_2\bitmaps\pk3man_tbwizard.bmp - diff --git a/setup/win32/template/File Groups/Plugins - PrtView.fgl b/setup/win32/template/File Groups/Plugins - PrtView.fgl deleted file mode 100644 index fe746a48..00000000 --- a/setup/win32/template/File Groups/Plugins - PrtView.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\contrib\prtview\Release\PrtView.dll - diff --git a/setup/win32/template/File Groups/Plugins - TexTool.fgl b/setup/win32/template/File Groups/Plugins - TexTool.fgl deleted file mode 100644 index 531f04d5..00000000 --- a/setup/win32/template/File Groups/Plugins - TexTool.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\plugins\textool\Release\TexTool.dll - diff --git a/setup/win32/template/File Groups/Plugins - bkgrnd2d.fgl b/setup/win32/template/File Groups/Plugins - bkgrnd2d.fgl deleted file mode 100644 index 1041d7df..00000000 --- a/setup/win32/template/File Groups/Plugins - bkgrnd2d.fgl +++ /dev/null @@ -1,15 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\contrib\bkgrnd2d\Release\bkgrnd2d.dll -SubDir0=bitmaps - -[bitmaps] -fulldirectory= -file0=<>\GtkRadiant\contrib\bkgrnd2d\bitmaps\bkgrnd2d_yz_toggle.bmp -file1=<>\GtkRadiant\contrib\bkgrnd2d\bitmaps\bkgrnd2d_conf.bmp -file2=<>\GtkRadiant\contrib\bkgrnd2d\bitmaps\bkgrnd2d_xy_toggle.bmp -file3=<>\GtkRadiant\contrib\bkgrnd2d\bitmaps\bkgrnd2d_xz_toggle.bmp - diff --git a/setup/win32/template/File Groups/Program DLL Files.fgl b/setup/win32/template/File Groups/Program DLL Files.fgl deleted file mode 100644 index f0de24cb..00000000 --- a/setup/win32/template/File Groups/Program DLL Files.fgl +++ /dev/null @@ -1,119 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\gtk2-2.2\install\iconv.dll -file1=<>\gtk2-2.2\install\libatk-1.0-0.dll -file2=<>\gtk2-2.2\install\libgtkglext-win32-1.0-0.dll -file3=<>\gtk2-2.2\install\libgtk-win32-2.0-0.dll -file4=<>\gtk2-2.2\install\libgdk_pixbuf-2.0-0.dll -file5=<>\gtk2-2.2\install\libgdkglext-win32-1.0-0.dll -file6=<>\gtk2-2.2\install\libgdk-win32-2.0-0.dll -file7=<>\gtk2-2.2\install\libglib-2.0-0.dll -file8=<>\gtk2-2.2\install\libgmodule-2.0-0.dll -file9=<>\gtk2-2.2\install\libgobject-2.0-0.dll -file10=<>\gtk2-2.2\install\libgthread-2.0-0.dll -file11=<>\gtk2-2.2\install\intl.dll -file12=<>\gtk2-2.2\install\libpangowin32-1.0-0.dll -file13=<>\gtk2-2.2\install\libpango-1.0-0.dll -file14=<>\libpng-1.2\lib\libpng13.dll -file15=<>\zlib1-1.2\zlib1.dll -file16=<>\libxml2-2.6\win32\install\libxml2.dll -SubDir0=lib -SubDir1=etc -SubDir2=share - -[lib] -fulldirectory= -SubDir0=lib\gtk-2.0 -SubDir1=lib\locale -SubDir2=lib\pango - -[lib\gtk-2.0] -fulldirectory= -SubDir0=lib\gtk-2.0\2.2.0 - -[lib\gtk-2.0\2.2.0] -fulldirectory= -SubDir0=lib\gtk-2.0\2.2.0\engines -SubDir1=lib\gtk-2.0\2.2.0\immodules -SubDir2=lib\gtk-2.0\2.2.0\loaders - -[lib\gtk-2.0\2.2.0\engines] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\gtk-2.0\2.2.0\engines\libwimp.dll - -[lib\gtk-2.0\2.2.0\immodules] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\gtk-2.0\2.2.0\immodules\im-ipa.dll - -[lib\gtk-2.0\2.2.0\loaders] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\gtk-2.0\2.2.0\loaders\libpixbufloader-xpm.dll -file1=<>\gtk2-2.2\install\lib\gtk-2.0\2.2.0\loaders\libpixbufloader-bmp.dll - -[lib\locale] -fulldirectory= -SubDir0=lib\locale\en@IPA -SubDir1=lib\locale\en_GB - -[lib\locale\en@IPA] -fulldirectory= -SubDir0=lib\locale\en@IPA\LC_MESSAGES - -[lib\locale\en@IPA\LC_MESSAGES] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\locale\en@IPA\LC_MESSAGES\gtk20.mo - -[lib\locale\en_GB] -fulldirectory= -SubDir0=lib\locale\en_GB\LC_MESSAGES - -[lib\locale\en_GB\LC_MESSAGES] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\locale\en_GB\LC_MESSAGES\atk10.mo -file1=<>\gtk2-2.2\install\lib\locale\en_GB\LC_MESSAGES\gtk20.mo - -[lib\pango] -fulldirectory= -SubDir0=lib\pango\1.2.0 - -[lib\pango\1.2.0] -fulldirectory= -SubDir0=lib\pango\1.2.0\modules - -[lib\pango\1.2.0\modules] -fulldirectory= -file0=<>\gtk2-2.2\install\lib\pango\1.2.0\modules\pango-basic-win32.dll - -[etc] -fulldirectory= -SubDir0=etc\gtk-2.0 -SubDir1=etc\pango - -[etc\gtk-2.0] -fulldirectory= -file0=<>\gtk2-2.2\install\etc\gtk-2.0\gdk-pixbuf.loaders -file1=<>\gtk2-2.2\install\etc\gtk-2.0\gtk.immodules - -[etc\pango] -fulldirectory= -file0=<>\gtk2-2.2\install\etc\pango\pango.aliases -file1=<>\gtk2-2.2\install\etc\pango\pango.modules - -[share] -fulldirectory= -SubDir0=share\themes - -[share\themes] -fulldirectory= -SubDir0=share\themes\Default - -[share\themes\Default] -fulldirectory= -SubDir0=share\themes\Default\gtk-2.0 - -[share\themes\Default\gtk-2.0] -fulldirectory= -file0=<>\gtk2-2.2\install\share\themes\Default\gtk-2.0\gtkrc diff --git a/setup/win32/template/File Groups/Program DLLs.fgl b/setup/win32/template/File Groups/Program DLLs.fgl deleted file mode 100644 index 04090b95..00000000 --- a/setup/win32/template/File Groups/Program DLLs.fgl +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - diff --git a/setup/win32/template/File Groups/Program Executable Files.fgl b/setup/win32/template/File Groups/Program Executable Files.fgl deleted file mode 100644 index d4c2460c..00000000 --- a/setup/win32/template/File Groups/Program Executable Files.fgl +++ /dev/null @@ -1,43 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\win32\bin\<> -file1=<>\GtkRadiant\tools\quake3\q3map2\Release\q3map2.exe -SubDir0=modules -SubDir1=plugins - -[modules] -fulldirectory= -file0=<>\GtkRadiant\plugins\image\Release\imageq3.dll -file1=<>\GtkRadiant\plugins\mapq3\Release\mapq3.dll -file2=<>\GtkRadiant\plugins\shaders\Release\shadersq3.dll -file3=<>\GtkRadiant\plugins\vfspk3\Release\vfsq3.dll -file4=<>\GtkRadiant\plugins\eclassfgd\Release\fgd.dll -file5=<>\GtkRadiant\plugins\entity\Release\entityq3.dll -file6=<>\GtkRadiant\plugins\imagehl\Release\imagehl.dll -file7=<>\GtkRadiant\plugins\mapxml\Release\mapxml.dll -file8=<>\GtkRadiant\plugins\spritemodel\Release\spritemodel.dll -file9=<>\GtkRadiant\plugins\archivewad\Release\archivewad.dll -file10=<>\GtkRadiant\plugins\archivepak\Release\archivepak.dll -file11=<>\GtkRadiant\plugins\archivezip\Release\archivezip.dll -file12=<>\GtkRadiant\plugins\model\Release\modelpico.dll -file13=<>\GtkRadiant\plugins\surface\Release\surface.dll -file14=<>\GtkRadiant\plugins\imagepng\Release\imagepng.dll -SubDir0=modules\bitmaps - -[modules\bitmaps] -fulldirectory= -file0=<>\GtkRadiant\plugins\model\bitmaps\picomodel.bmp -file1=<>\GtkRadiant\plugins\model\bitmaps\model_reload_entity.bmp - -[plugins] -fulldirectory= -file0=<>\GtkRadiant\contrib\camera\Release\camera.dll -SubDir0=plugins\bitmaps - -[plugins\bitmaps] -fulldirectory= -file0=<>\GtkRadiant\contrib\camera\bitmaps\camera_insp.bmp - diff --git a/setup/win32/template/File Groups/Program Misc Files.fgl b/setup/win32/template/File Groups/Program Misc Files.fgl deleted file mode 100644 index 3ff3145a..00000000 --- a/setup/win32/template/File Groups/Program Misc Files.fgl +++ /dev/null @@ -1,76 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\tools\links.htm -file1=<>\GtkRadiant\setup\data\tools\shortcuts.ini.sample -file2=<>\GtkRadiant\setup\changelog.txt -file3=<>\GtkRadiant\setup\license.txt -file4=<>\GtkRadiant\setup\setup.bmp -file5=<>\GtkRadiant\setup\data\tools\Credits.html -file6=<>\GtkRadiant\setup\radiantgtkrc -file7=<>\GtkRadiant\setup\data\tools\global.xlink -file8=<>\GtkRadiant\tools\quake3\q3map2\changelog.q3map2.txt -SubDir0=bitmaps -SubDir1=dtds - -[bitmaps] -fulldirectory=<>\GtkRadiant\radiant\bitmaps -file0=<>\GtkRadiant\radiant\bitmaps\brush_flipx.bmp -file1=<>\GtkRadiant\radiant\bitmaps\brush_flipy.bmp -file2=<>\GtkRadiant\radiant\bitmaps\brush_flipz.bmp -file3=<>\GtkRadiant\radiant\bitmaps\brush_rotatex.bmp -file4=<>\GtkRadiant\radiant\bitmaps\brush_rotatey.bmp -file5=<>\GtkRadiant\radiant\bitmaps\brush_rotatez.bmp -file6=<>\GtkRadiant\radiant\bitmaps\cap_bevel.bmp -file7=<>\GtkRadiant\radiant\bitmaps\cap_endcap.bmp -file8=<>\GtkRadiant\radiant\bitmaps\cap_ibevel.bmp -file9=<>\GtkRadiant\radiant\bitmaps\cap_iendcap.bmp -file10=<>\GtkRadiant\radiant\bitmaps\curve_cap.bmp -file11=<>\GtkRadiant\radiant\bitmaps\dontselectcurve.bmp -file12=<>\GtkRadiant\radiant\bitmaps\dontselectmodel.bmp -file13=<>\GtkRadiant\radiant\bitmaps\file_open.bmp -file14=<>\GtkRadiant\radiant\bitmaps\file_save.bmp -file15=<>\GtkRadiant\radiant\bitmaps\icon.bmp -file16=<>\GtkRadiant\radiant\bitmaps\logo.bmp -file17=<>\GtkRadiant\radiant\bitmaps\patch_bend.bmp -file18=<>\GtkRadiant\radiant\bitmaps\patch_drilldown.bmp -file19=<>\GtkRadiant\radiant\bitmaps\patch_insdel.bmp -file20=<>\GtkRadiant\radiant\bitmaps\patch_showboundingbox.bmp -file21=<>\GtkRadiant\radiant\bitmaps\patch_weld.bmp -file22=<>\GtkRadiant\radiant\bitmaps\patch_wireframe.bmp -file23=<>\GtkRadiant\radiant\bitmaps\popup_selection.bmp -file24=<>\GtkRadiant\radiant\bitmaps\scalelockx.bmp -file25=<>\GtkRadiant\radiant\bitmaps\scalelocky.bmp -file26=<>\GtkRadiant\radiant\bitmaps\scalelockz.bmp -file27=<>\GtkRadiant\radiant\bitmaps\selection_csgmerge.bmp -file28=<>\GtkRadiant\radiant\bitmaps\selection_csgsubtract.bmp -file29=<>\GtkRadiant\radiant\bitmaps\selection_makehollow.bmp -file30=<>\GtkRadiant\radiant\bitmaps\selection_selectcompletetall.bmp -file31=<>\GtkRadiant\radiant\bitmaps\selection_selectinside.bmp -file32=<>\GtkRadiant\radiant\bitmaps\selection_selectpartialtall.bmp -file33=<>\GtkRadiant\radiant\bitmaps\selection_selecttouching.bmp -file34=<>\GtkRadiant\radiant\bitmaps\select_mouserotate.bmp -file35=<>\GtkRadiant\radiant\bitmaps\select_mousescale.bmp -file36=<>\GtkRadiant\radiant\bitmaps\select_mousetranslate.bmp -file37=<>\GtkRadiant\radiant\bitmaps\show_entities.bmp -file38=<>\GtkRadiant\radiant\bitmaps\splash.bmp -file39=<>\GtkRadiant\radiant\bitmaps\textures_popup.bmp -file40=<>\GtkRadiant\radiant\bitmaps\view_cameratoggle.bmp -file41=<>\GtkRadiant\radiant\bitmaps\view_cameraupdate.bmp -file42=<>\GtkRadiant\radiant\bitmaps\view_change.bmp -file43=<>\GtkRadiant\radiant\bitmaps\view_clipper.bmp -file44=<>\GtkRadiant\radiant\bitmaps\view_cubicclipping.bmp -file45=<>\GtkRadiant\radiant\bitmaps\view_entity.bmp -file46=<>\GtkRadiant\radiant\bitmaps\window1.bmp -file47=<>\GtkRadiant\radiant\bitmaps\window2.bmp -file48=<>\GtkRadiant\radiant\bitmaps\window3.bmp -file49=<>\GtkRadiant\radiant\bitmaps\window4.bmp - -[dtds] -fulldirectory=<>\GtkRadiant\setup\data\tools\dtds -file0=<>\GtkRadiant\setup\data\tools\dtds\project.dtd -file1=<>\GtkRadiant\setup\data\tools\dtds\mapq3.dtd - - diff --git a/setup/win32/template/File Groups/Q2 Executable Files.fgl b/setup/win32/template/File Groups/Q2 Executable Files.fgl deleted file mode 100644 index e1c1b154..00000000 --- a/setup/win32/template/File Groups/Q2 Executable Files.fgl +++ /dev/null @@ -1,18 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\Q2Pack\synapse.config -file1=<>\Q2Pack\game.xlink -file2=<>\GtkRadiant\tools\quake2\qdata\Release\qdata3.exe -file3=<>\GtkRadiant\tools\quake2\q2map\Release\q2map.exe -file4=<>\libxml2\win32\binaries-release\libxml2.dll -SubDir0=modules - -[modules] -fulldirectory= -file0=<>\GtkRadiant\plugins\vfspak\Release\vfspak.dll -file1=<>\GtkRadiant\plugins\imagewal\Release\imagewal.dll -file2=<>\GtkRadiant\plugins\surface_quake2\Release\surface_quake2.dll - diff --git a/setup/win32/template/File Groups/Q2 Media Files.fgl b/setup/win32/template/File Groups/Q2 Media Files.fgl deleted file mode 100644 index bf0c617d..00000000 --- a/setup/win32/template/File Groups/Q2 Media Files.fgl +++ /dev/null @@ -1,31 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=maps -SubDir1=scripts -SubDir2=pics -SubDir3=textures - -[maps] -fulldirectory= -file0=<>\Q2Pack\baseq2\maps\base1.map - -[scripts] -fulldirectory= -file0=<>\Q2Pack\baseq2\scripts\entities.def -file1=<>\Q2Pack\baseq2\scripts\default_project.proj - -[pics] -fulldirectory= -file0=<>\Q2Pack\baseq2\pics\colormap.pcx - -[textures] -fulldirectory= -SubDir0=textures\radiant - -[textures\radiant] -fulldirectory= -file0=<>\Q2Pack\baseq2\textures\radiant\notex.pcx - diff --git a/setup/win32/template/File Groups/Q3 Default Project.fgl b/setup/win32/template/File Groups/Q3 Default Project.fgl deleted file mode 100644 index 6764f7a2..00000000 --- a/setup/win32/template/File Groups/Q3 Default Project.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\baseq3\scripts\default_project.proj - diff --git a/setup/win32/template/File Groups/Q3 Editor Images - SPoG pk3.fgl b/setup/win32/template/File Groups/Q3 Editor Images - SPoG pk3.fgl deleted file mode 100644 index 3d633631..00000000 --- a/setup/win32/template/File Groups/Q3 Editor Images - SPoG pk3.fgl +++ /dev/null @@ -1,7 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\baseq3\common-spog.pk3 - diff --git a/setup/win32/template/File Groups/Q3 Executable Files.fgl b/setup/win32/template/File Groups/Q3 Executable Files.fgl deleted file mode 100644 index e17393aa..00000000 --- a/setup/win32/template/File Groups/Q3 Executable Files.fgl +++ /dev/null @@ -1,17 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\win32\bin\bspc.exe -file1=<>\GtkRadiant\tools\quake3\q3data\Release\q3data.exe -file2=<>\GtkRadiant\setup\data\tools\synapse.config -file3=<>\gtk2-2.2\install\libglib-2.0-0.dll -file4=<>\gtk2-2.2\install\iconv.dll -file5=<>\gtk2-2.2\install\intl.dll -file6=<>\libxml2-2.6\win32\install\libxml2.dll -SubDir0=modules - -[modules] -fulldirectory= - diff --git a/setup/win32/template/File Groups/Q3 Misc Files.fgl b/setup/win32/template/File Groups/Q3 Misc Files.fgl deleted file mode 100644 index 8050ce8e..00000000 --- a/setup/win32/template/File Groups/Q3 Misc Files.fgl +++ /dev/null @@ -1,8 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\tools\q3data.qdt -file1=<>\GtkRadiant\setup\data\tools\game.xlink - diff --git a/setup/win32/template/File Groups/Q3 Sample Files.fgl b/setup/win32/template/File Groups/Q3 Sample Files.fgl deleted file mode 100644 index 25aafaa1..00000000 --- a/setup/win32/template/File Groups/Q3 Sample Files.fgl +++ /dev/null @@ -1,184 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\baseq3\mapmedia.pk3 -SubDir0=models -SubDir1=maps -SubDir2=scripts - -[models] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models -SubDir0=models\mapobjects - -[models\mapobjects] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\gargoyle1.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\kmlamp1.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\statue_major.md3 -file3=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\visor_posed.md3 -file4=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\walllamp3.md3 -SubDir0=models\mapobjects\banner -SubDir1=models\mapobjects\baph -SubDir2=models\mapobjects\bitch -SubDir3=models\mapobjects\corpse -SubDir4=models\mapobjects\gratelamp -SubDir5=models\mapobjects\jesus -SubDir6=models\mapobjects\jets -SubDir7=models\mapobjects\lamps -SubDir8=models\mapobjects\pipe -SubDir9=models\mapobjects\podium -SubDir10=models\mapobjects\portal_2 -SubDir11=models\mapobjects\skel -SubDir12=models\mapobjects\skull -SubDir13=models\mapobjects\spotlamp -SubDir14=models\mapobjects\storch -SubDir15=models\mapobjects\teleporter -SubDir16=models\mapobjects\timlamp -SubDir17=models\mapobjects\tree2 -SubDir18=models\mapobjects\wallhead - -[models\mapobjects\banner] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\banner -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\banner\banner5.md3 - -[models\mapobjects\baph] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\baph -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\baph\baphomet_gold.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\baph\lil_baphomet.md3 - -[models\mapobjects\bitch] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\bitch -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\bitch\fembot.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\bitch\fembotbig.md3 - -[models\mapobjects\corpse] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\corpse -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\corpse\corpse.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\corpse\torso.md3 - -[models\mapobjects\gratelamp] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\gratelamp -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\gratelamp\gratelamp.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\gratelamp\gratetorch.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\gratelamp\gratetorchbig.md3 - -[models\mapobjects\jesus] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\jesus -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\jesus\jesus.md3 - -[models\mapobjects\jets] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\jets -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\jets\jets01.md3 - -[models\mapobjects\lamps] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\lamps -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\lamps\bot_lamp2.md3 - -[models\mapobjects\pipe] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\pipe -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\pipe\pipe02.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\pipe\pipe02b.md3 - -[models\mapobjects\podium] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\podium -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\podium\podium4.md3 - -[models\mapobjects\portal_2] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\portal_2 -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\portal_2\portal_2.md3 - -[models\mapobjects\skel] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel\skel01.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel\skel02mid.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel\skel_ribs.md3 -file3=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel\xray.md3 -file4=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skel\xraybig.md3 - -[models\mapobjects\skull] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skull -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skull\monkeyface.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skull\skull.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\skull\skull_tilt1.md3 - -[models\mapobjects\spotlamp] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\spotlamp -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\spotlamp\spotlamp.md3 - -[models\mapobjects\storch] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\storch -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\storch\storch.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\storch\storchx.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\storch\tall_torch.md3 - -[models\mapobjects\teleporter] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\teleporter -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\teleporter\teleporter.md3 - -[models\mapobjects\timlamp] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\timlamp -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\timlamp\timlamp.md3 - -[models\mapobjects\tree2] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2 -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\branch2.tga -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree1.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree10.md3 -file3=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree2.md3 -file4=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree3.md3 -file5=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree4.md3 -file6=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree5.md3 -file7=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree6.md3 -file8=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree7.md3 -file9=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree8.md3 -file10=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\tree9.md3 -file11=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\tree2\trunk2.tga - -[models\mapobjects\wallhead] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\wallhead -file0=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\wallhead\femhead.md3 -file1=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\wallhead\lion.md3 -file2=<>\GtkRadiant\setup\data\baseq3\models\mapobjects\wallhead\wallhead02.md3 - -[maps] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\maps -file0=<>\GtkRadiant\setup\data\baseq3\maps\q3dm17sample.map -file1=<>\GtkRadiant\setup\data\baseq3\maps\q3dm1sample.map -file2=<>\GtkRadiant\setup\data\baseq3\maps\q3dm7sample.map -file3=<>\GtkRadiant\setup\data\baseq3\maps\terrademoQ3.map -file4=<>\GtkRadiant\setup\data\baseq3\maps\museum.map - -[scripts] -fulldirectory= -file0=<>\GtkRadiant\setup\data\baseq3\scripts\base_button.shader -file1=<>\GtkRadiant\setup\data\baseq3\scripts\base_door.shader -file2=<>\GtkRadiant\setup\data\baseq3\scripts\base_floor.shader -file3=<>\GtkRadiant\setup\data\baseq3\scripts\base_light.shader -file4=<>\GtkRadiant\setup\data\baseq3\scripts\base_object.shader -file5=<>\GtkRadiant\setup\data\baseq3\scripts\base_support.shader -file6=<>\GtkRadiant\setup\data\baseq3\scripts\base_trim.shader -file7=<>\GtkRadiant\setup\data\baseq3\scripts\base_wall.shader -file8=<>\GtkRadiant\setup\data\baseq3\scripts\common.shader -file9=<>\GtkRadiant\setup\data\baseq3\scripts\ctf.shader -file10=<>\GtkRadiant\setup\data\baseq3\scripts\gfx.shader -file11=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_block.shader -file12=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_button.shader -file13=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_door.shader -file14=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_floor.shader -file15=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_light.shader -file16=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_trim.shader -file17=<>\GtkRadiant\setup\data\baseq3\scripts\gothic_wall.shader -file18=<>\GtkRadiant\setup\data\baseq3\scripts\hell.shader -file19=<>\GtkRadiant\setup\data\baseq3\scripts\liquids.shader -file20=<>\GtkRadiant\setup\data\baseq3\scripts\models.shader -file21=<>\GtkRadiant\setup\data\baseq3\scripts\museum.shader -file22=<>\GtkRadiant\setup\data\baseq3\scripts\organics.shader -file23=<>\GtkRadiant\setup\data\baseq3\scripts\sfx.shader -file24=<>\GtkRadiant\setup\data\baseq3\scripts\skies.shader -file25=<>\GtkRadiant\setup\data\baseq3\scripts\skin.shader -file26=<>\GtkRadiant\setup\data\baseq3\scripts\terrademoQ3.shader -file27=<>\GtkRadiant\setup\data\baseq3\scripts\test.shader -file28=<>\GtkRadiant\setup\data\baseq3\scripts\entities.def - diff --git a/setup/win32/template/File Groups/Radiant Manual Files.fgl b/setup/win32/template/File Groups/Radiant Manual Files.fgl deleted file mode 100644 index 331898a1..00000000 --- a/setup/win32/template/File Groups/Radiant Manual Files.fgl +++ /dev/null @@ -1,126 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Q3Rad_Manual - -[Q3Rad_Manual] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\index.htm -SubDir0=Q3Rad_Manual\appndx -SubDir1=Q3Rad_Manual\ch01 -SubDir2=Q3Rad_Manual\ch02 -SubDir3=Q3Rad_Manual\ch03 -SubDir4=Q3Rad_Manual\ch04 -SubDir5=Q3Rad_Manual\ch05 -SubDir6=Q3Rad_Manual\ch06 -SubDir7=Q3Rad_Manual\ch07 -SubDir8=Q3Rad_Manual\ch08 -SubDir9=Q3Rad_Manual\ch09 -SubDir10=Q3Rad_Manual\ch10 -SubDir11=Q3Rad_Manual\ch11 -SubDir12=Q3Rad_Manual\ch12 -SubDir13=Q3Rad_Manual\Q3Rad_Manual_files -SubDir14=Q3Rad_Manual\styles -SubDir15=Q3Rad_Manual\gtkrad - -[Q3Rad_Manual\appndx] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_a.htm -file1=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_1.htm -file2=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_2.htm -file3=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_3.htm -file4=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_4.htm -file5=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_5.htm -file6=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_6.htm -file7=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_7.htm -file8=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_8.htm -file9=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_b_9.htm -file10=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_c.htm -file11=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_d.htm -file12=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_e.htm -file13=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\appn_f.htm -file14=<>\GtkRadiant\docs\manual\Q3Rad_Manual\appndx\sskey_dl.htm - -[Q3Rad_Manual\ch01] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch01 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch01\pg1_1.htm -file1=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch01\pg1_2.htm - -[Q3Rad_Manual\ch02] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch02 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch02\pg2_1.htm - -[Q3Rad_Manual\ch03] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch03 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch03\pg3_1.htm - -[Q3Rad_Manual\ch04] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch04 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch04\pg4_1.htm - -[Q3Rad_Manual\ch05] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch05 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch05\pg5_1.htm - -[Q3Rad_Manual\ch06] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch06 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch06\pg6_1.htm - -[Q3Rad_Manual\ch07] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch07 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch07\pg7_1.htm - -[Q3Rad_Manual\ch08] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch08 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch08\pg8_1.htm - -[Q3Rad_Manual\ch09] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch09 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch09\pg9_1.htm - -[Q3Rad_Manual\ch10] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch10 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch10\pg10_1.htm - -[Q3Rad_Manual\ch11] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch11 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch11\pg11_1.htm - -[Q3Rad_Manual\ch12] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch12 -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\ch12\pg12_1.htm - -[Q3Rad_Manual\Q3Rad_Manual_files] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image002.png -file1=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image003.png -file2=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image004.png -file3=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image006.png -file4=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image008.png -file5=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image010.png -file6=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image012.png -file7=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image014.png -file8=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image016.png -file9=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image018.png -file10=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image020.png -file11=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image022.png -file12=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image024.png -file13=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image026.png -file14=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image028.png -file15=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image030.png -file16=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image032.png -file17=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image034.png -file18=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image035.png -file19=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image038.png -file20=<>\GtkRadiant\docs\manual\Q3Rad_Manual\Q3Rad_Manual_files\image040.png - -[Q3Rad_Manual\styles] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\styles -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\styles\q3rad.css - -[Q3Rad_Manual\gtkrad] -fulldirectory=<>\GtkRadiant\docs\manual\Q3Rad_Manual\gtkrad -file0=<>\GtkRadiant\docs\manual\Q3Rad_Manual\gtkrad\pg1_1.htm - diff --git a/setup/win32/template/File Groups/SOF2 Executable Files.fgl b/setup/win32/template/File Groups/SOF2 Executable Files.fgl deleted file mode 100644 index 2b71bdf3..00000000 --- a/setup/win32/template/File Groups/SOF2 Executable Files.fgl +++ /dev/null @@ -1,276 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\SOF2Pack\game.xlink -file1=<>\SOF2Pack\ChangeLog.txt -file2=<>\Sof2Pack\bin\BehavEd.bhc -file3=<>\RavenPack\bin\BehavEd.exe -file4=<>\RavenPack\bin\ConfusEditor.exe -file5=<>\RavenPack\bin\EffectsEd.exe -file6=<>\RavenPack\bin\IBIze.exe -file7=<>\RavenPack\bin\roq.exe -file8=<>\Sof2Pack\synapse.config -SubDir0=docs -SubDir1=modules - -[docs] -fulldirectory= -file0=<>\SOF2Pack\docs\SoF2_Terrain.html -file1=<>\SOF2Pack\docs\SoF2_MP_Maps.html -file2=<>\SOF2Pack\docs\SoF2_Shaders.html -file3=<>\RavenPack\docs\Guide to SOF2JK2 Vertigons.htm -file4=<>\RavenPack\docs\Guide to SOF2JK2 Weather.htm -file5=<>\RavenPack\docs\Using_EffectsEd.htm -file6=<>\RavenPack\docs\Q3_Enhancements.htm -file7=<>\RavenPack\docs\ROQ_Files.htm -file8=<>\Sof2Pack\docs\SoF2_Weapons_WpnFile.htm -file9=<>\Sof2Pack\docs\Nav Point System.htm -file10=<>\Sof2Pack\docs\RMG tutorial.htm -file11=<>\Sof2Pack\docs\SoF2_Animating Objects.htm -file12=<>\Sof2Pack\docs\SoF2_Character_NPCFile.htm -file13=<>\Sof2Pack\docs\SoF2_Character_Skins.htm -file14=<>\Sof2Pack\docs\SoF2_ConfusEd.htm -file15=<>\Sof2Pack\docs\SoF2_Model_Formats.htm -file16=<>\Sof2Pack\docs\SoF2_Raven Menu Format.htm -file17=<>\Sof2Pack\docs\SoF2_Scripting.htm -file18=<>\Sof2Pack\docs\SoF2_StripEd.htm -file19=<>\Sof2Pack\docs\SoF2_Weapons_AnimatorPOV.htm -file20=<>\Sof2Pack\docs\SoF2_Weapons_FramesFile.htm -file21=<>\Sof2Pack\docs\SoF2_Weapons_InviewFile.htm -file22=<>\Sof2Pack\docs\SoF2_Weapons_Overview.htm -SubDir0=docs\GtkRadiant_SoF2_HOWTO -SubDir1=docs\SoF2_MP_Maps_files -SubDir2=docs\SoF2_Shaders_files -SubDir3=docs\SoF2_Terrain_files -SubDir4=docs\Using_EffectsEd_files -SubDir5=docs\SoF2_Weapons_WpnFile_files -SubDir6=docs\SoF2_Weapons_Overview_files -SubDir7=docs\SoF2_Weapons_InviewFile_files -SubDir8=docs\SoF2_Weapons_FramesFile_files -SubDir9=docs\SoF2_Weapons_AnimatorPOV_files -SubDir10=docs\SoF2_StripEd_files -SubDir11=docs\SoF2_Scripting_files -SubDir12=docs\SoF2_Raven Menu Format_files -SubDir13=docs\SoF2_Model_Formats_files -SubDir14=docs\SoF2_ConfusEd_files -SubDir15=docs\SoF2_Character_Skins_files -SubDir16=docs\SoF2_Character_NPCFile_files -SubDir17=docs\SoF2_Animating Objects_files -SubDir18=docs\Nav Point System_files - -[docs\GtkRadiant_SoF2_HOWTO] -fulldirectory= -file0=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\project.png -file1=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\bsp_console.png -file2=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\bsp_menu.png -file3=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\game1.png -file4=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\game2.png -file5=<>\SOF2Pack\docs\GtkRadiant_SoF2_HOWTO\index.html - -[docs\SoF2_MP_Maps_files] -fulldirectory= -file0=<>\SOF2Pack\docs\SoF2_MP_Maps_files\image002.jpg -file1=<>\SOF2Pack\docs\SoF2_MP_Maps_files\filelist.xml -file2=<>\SOF2Pack\docs\SoF2_MP_Maps_files\header.html -file3=<>\SOF2Pack\docs\SoF2_MP_Maps_files\image001.jpg - -[docs\SoF2_Shaders_files] -fulldirectory= -file0=<>\SOF2Pack\docs\SoF2_Shaders_files\image002.jpg -file1=<>\SOF2Pack\docs\SoF2_Shaders_files\filelist.xml -file2=<>\SOF2Pack\docs\SoF2_Shaders_files\header.html -file3=<>\SOF2Pack\docs\SoF2_Shaders_files\image001.jpg - -[docs\SoF2_Terrain_files] -fulldirectory= -file0=<>\SOF2Pack\docs\SoF2_Terrain_files\image002.jpg -file1=<>\SOF2Pack\docs\SoF2_Terrain_files\filelist.xml -file2=<>\SOF2Pack\docs\SoF2_Terrain_files\header.html -file3=<>\SOF2Pack\docs\SoF2_Terrain_files\image001.jpg - -[docs\Using_EffectsEd_files] -fulldirectory= -file0=<>\RavenPack\docs\Using_EffectsEd_files\filelist.xml -file1=<>\RavenPack\docs\Using_EffectsEd_files\image001.jpg -file2=<>\RavenPack\docs\Using_EffectsEd_files\image002.jpg -file3=<>\RavenPack\docs\Using_EffectsEd_files\image003.jpg -file4=<>\RavenPack\docs\Using_EffectsEd_files\image004.jpg -file5=<>\RavenPack\docs\Using_EffectsEd_files\image005.jpg -file6=<>\RavenPack\docs\Using_EffectsEd_files\image006.jpg -file7=<>\RavenPack\docs\Using_EffectsEd_files\image007.jpg -file8=<>\RavenPack\docs\Using_EffectsEd_files\image008.jpg -file9=<>\RavenPack\docs\Using_EffectsEd_files\image009.jpg -file10=<>\RavenPack\docs\Using_EffectsEd_files\image010.jpg -file11=<>\RavenPack\docs\Using_EffectsEd_files\image011.jpg -file12=<>\RavenPack\docs\Using_EffectsEd_files\image012.jpg -file13=<>\RavenPack\docs\Using_EffectsEd_files\image013.jpg -file14=<>\RavenPack\docs\Using_EffectsEd_files\image014.jpg -file15=<>\RavenPack\docs\Using_EffectsEd_files\image015.jpg -file16=<>\RavenPack\docs\Using_EffectsEd_files\image016.jpg - -[docs\SoF2_Weapons_WpnFile_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Weapons_WpnFile_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Weapons_WpnFile_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Weapons_WpnFile_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Weapons_WpnFile_files\image002.jpg - -[docs\SoF2_Weapons_Overview_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Weapons_Overview_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Weapons_Overview_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Weapons_Overview_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Weapons_Overview_files\image002.jpg - -[docs\SoF2_Weapons_InviewFile_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Weapons_InviewFile_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Weapons_InviewFile_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Weapons_InviewFile_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Weapons_InviewFile_files\image002.jpg - -[docs\SoF2_Weapons_FramesFile_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Weapons_FramesFile_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Weapons_FramesFile_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Weapons_FramesFile_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Weapons_FramesFile_files\image002.jpg - -[docs\SoF2_Weapons_AnimatorPOV_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Weapons_AnimatorPOV_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Weapons_AnimatorPOV_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Weapons_AnimatorPOV_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Weapons_AnimatorPOV_files\image002.jpg - -[docs\SoF2_StripEd_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_StripEd_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_StripEd_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_StripEd_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_StripEd_files\image002.jpg - -[docs\SoF2_Scripting_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Scripting_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Scripting_files\header.htm - -[docs\SoF2_Raven Menu Format_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Raven Menu Format_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Raven Menu Format_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Raven Menu Format_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Raven Menu Format_files\image002.jpg - -[docs\SoF2_Model_Formats_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Model_Formats_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Model_Formats_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image002.jpg -file4=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image003.jpg -file5=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image004.jpg -file6=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image005.jpg -file7=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image006.jpg -file8=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image007.jpg -file9=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image008.jpg -file10=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image009.jpg -file11=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image010.jpg -file12=<>\Sof2Pack\docs\SoF2_Model_Formats_files\image011.jpg - -[docs\SoF2_ConfusEd_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_ConfusEd_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_ConfusEd_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_ConfusEd_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_ConfusEd_files\image002.jpg - -[docs\SoF2_Character_Skins_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Character_Skins_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Character_Skins_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image002.jpg -file4=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image003.jpg -file5=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image004.jpg -file6=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image005.jpg -file7=<>\Sof2Pack\docs\SoF2_Character_Skins_files\image006.jpg - -[docs\SoF2_Character_NPCFile_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image002.gif -file4=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image002.jpg -file5=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image003.gif -file6=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image004.gif -file7=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image005.gif -file8=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image006.gif -file9=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image007.gif -file10=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image008.gif -file11=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image009.gif -file12=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image010.gif -file13=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image011.gif -file14=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image012.gif -file15=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image013.gif -file16=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image014.gif -file17=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image015.gif -file18=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image016.gif -file19=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image017.gif -file20=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image018.gif -file21=<>\Sof2Pack\docs\SoF2_Character_NPCFile_files\image019.gif - -[docs\SoF2_Animating Objects_files] -fulldirectory= -file0=<>\Sof2Pack\docs\SoF2_Animating Objects_files\filelist.xml -file1=<>\Sof2Pack\docs\SoF2_Animating Objects_files\header.htm -file2=<>\Sof2Pack\docs\SoF2_Animating Objects_files\image001.jpg -file3=<>\Sof2Pack\docs\SoF2_Animating Objects_files\image002.jpg - -[docs\Nav Point System_files] -fulldirectory= -file0=<>\Sof2Pack\docs\Nav Point System_files\filelist.xml -file1=<>\Sof2Pack\docs\Nav Point System_files\header.htm -file2=<>\Sof2Pack\docs\Nav Point System_files\image001.png -file3=<>\Sof2Pack\docs\Nav Point System_files\image002.jpg -file4=<>\Sof2Pack\docs\Nav Point System_files\image003.png -file5=<>\Sof2Pack\docs\Nav Point System_files\image004.jpg -file6=<>\Sof2Pack\docs\Nav Point System_files\image005.png -file7=<>\Sof2Pack\docs\Nav Point System_files\image006.jpg -file8=<>\Sof2Pack\docs\Nav Point System_files\image007.png -file9=<>\Sof2Pack\docs\Nav Point System_files\image008.jpg -file10=<>\Sof2Pack\docs\Nav Point System_files\image009.png -file11=<>\Sof2Pack\docs\Nav Point System_files\image010.jpg -file12=<>\Sof2Pack\docs\Nav Point System_files\image011.png -file13=<>\Sof2Pack\docs\Nav Point System_files\image012.jpg -file14=<>\Sof2Pack\docs\Nav Point System_files\image013.png -file15=<>\Sof2Pack\docs\Nav Point System_files\image014.jpg -file16=<>\Sof2Pack\docs\Nav Point System_files\image015.png -file17=<>\Sof2Pack\docs\Nav Point System_files\image016.jpg -file18=<>\Sof2Pack\docs\Nav Point System_files\image017.png -file19=<>\Sof2Pack\docs\Nav Point System_files\image018.jpg -file20=<>\Sof2Pack\docs\Nav Point System_files\image019.png -file21=<>\Sof2Pack\docs\Nav Point System_files\image020.jpg -file22=<>\Sof2Pack\docs\Nav Point System_files\image021.png -file23=<>\Sof2Pack\docs\Nav Point System_files\image022.jpg -file24=<>\Sof2Pack\docs\Nav Point System_files\image023.png -file25=<>\Sof2Pack\docs\Nav Point System_files\image024.jpg -file26=<>\Sof2Pack\docs\Nav Point System_files\image025.png -file27=<>\Sof2Pack\docs\Nav Point System_files\image026.jpg -file28=<>\Sof2Pack\docs\Nav Point System_files\image027.png -file29=<>\Sof2Pack\docs\Nav Point System_files\image028.jpg -file30=<>\Sof2Pack\docs\Nav Point System_files\image029.png -file31=<>\Sof2Pack\docs\Nav Point System_files\image030.jpg -file32=<>\Sof2Pack\docs\Nav Point System_files\image031.png -file33=<>\Sof2Pack\docs\Nav Point System_files\image032.jpg -file34=<>\Sof2Pack\docs\Nav Point System_files\image033.png -file35=<>\Sof2Pack\docs\Nav Point System_files\image034.jpg -file36=<>\Sof2Pack\docs\Nav Point System_files\image035.png -file37=<>\Sof2Pack\docs\Nav Point System_files\image036.jpg - -[modules] -fulldirectory= - diff --git a/setup/win32/template/File Groups/SOF2 Media Files.fgl b/setup/win32/template/File Groups/SOF2 Media Files.fgl deleted file mode 100644 index eafb9079..00000000 --- a/setup/win32/template/File Groups/SOF2 Media Files.fgl +++ /dev/null @@ -1,1071 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\SOF2Pack\radiant.pk3 -SubDir0=maps -SubDir1=models -SubDir2=scripts -SubDir3=shaders - -[maps] -fulldirectory= -file0=<>\SOF2Pack\maps\mp_examples.map -file1=<>\Sof2Pack\maps\heli.map -file2=<>\Sof2Pack\maps\kam6.map - -[models] -fulldirectory= -SubDir0=models\chunks -SubDir1=models\flags -SubDir2=models\objects -SubDir3=models\pick_ups -SubDir4=models\weapons - -[models\chunks] -fulldirectory= -SubDir0=models\chunks\aqualid -SubDir1=models\chunks\bar -SubDir2=models\chunks\basket_sq -SubDir3=models\chunks\body_parts -SubDir4=models\chunks\canbase -SubDir5=models\chunks\candle -SubDir6=models\chunks\canlid -SubDir7=models\chunks\cart_bev -SubDir8=models\chunks\cart_food -SubDir9=models\chunks\clipboard -SubDir10=models\chunks\copier_chunks -SubDir11=models\chunks\cpu_chunk -SubDir12=models\chunks\dish -SubDir13=models\chunks\dishbase -SubDir14=models\chunks\fabric -SubDir15=models\chunks\fern -SubDir16=models\chunks\fish -SubDir17=models\chunks\flag -SubDir18=models\chunks\flag_blue -SubDir19=models\chunks\flag_red -SubDir20=models\chunks\glass -SubDir21=models\chunks\ice -SubDir22=models\chunks\katana -SubDir23=models\chunks\keyboard_chunks -SubDir24=models\chunks\lantern_long -SubDir25=models\chunks\leaf -SubDir26=models\chunks\lid -SubDir27=models\chunks\metal -SubDir28=models\chunks\micro1 -SubDir29=models\chunks\micro2 -SubDir30=models\chunks\micro3 -SubDir31=models\chunks\micro4 -SubDir32=models\chunks\micro5 -SubDir33=models\chunks\monitor_cart_chunks -SubDir34=models\chunks\monitor_chunks -SubDir35=models\chunks\monitor_front -SubDir36=models\chunks\paper -SubDir37=models\chunks\phone_chunks -SubDir38=models\chunks\poolchair -SubDir39=models\chunks\rebreather -SubDir40=models\chunks\rock -SubDir41=models\chunks\rubber -SubDir42=models\chunks\sam_missle -SubDir43=models\chunks\smalllid -SubDir44=models\chunks\spatula -SubDir45=models\chunks\spoon -SubDir46=models\chunks\sunglasses -SubDir47=models\chunks\tray -SubDir48=models\chunks\truck_chunks -SubDir49=models\chunks\tv -SubDir50=models\chunks\wood - -[models\chunks\aqualid] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\aqualid\aqualid.md3 - -[models\chunks\bar] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\bar\bar.md3 - -[models\chunks\basket_sq] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\basket_sq\basket_sq.md3 - -[models\chunks\body_parts] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\body_parts\head.md3 -file1=<>\SOF2Pack\models\chunks\body_parts\chunk_torso.md3 - -[models\chunks\canbase] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\canbase\canbase.md3 - -[models\chunks\candle] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\candle\candle.md3 - -[models\chunks\canlid] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\canlid\canlid.md3 - -[models\chunks\cart_bev] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\cart_bev\cart_bev.md3 - -[models\chunks\cart_food] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\cart_food\tray.md3 -file1=<>\SOF2Pack\models\chunks\cart_food\cart.md3 - -[models\chunks\clipboard] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\clipboard\clipboard.md3 - -[models\chunks\copier_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\copier_chunks\copier_chunk.md3 - -[models\chunks\cpu_chunk] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\cpu_chunk\cpu_chunk.md3 - -[models\chunks\dish] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\dish\dish.md3 - -[models\chunks\dishbase] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\dishbase\dishbase.md3 - -[models\chunks\fabric] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\fabric\fabric_small_wht.md3 -file1=<>\SOF2Pack\models\chunks\fabric\fabric_big.md3 -file2=<>\SOF2Pack\models\chunks\fabric\fabric_med.md3 -file3=<>\SOF2Pack\models\chunks\fabric\fabric_med_purp.md3 -file4=<>\SOF2Pack\models\chunks\fabric\fabric_med_wht.md3 -file5=<>\SOF2Pack\models\chunks\fabric\fabric_small.md3 - -[models\chunks\fern] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\fern\fern_ledge.md3 - -[models\chunks\fish] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\fish\fish.md3 - -[models\chunks\flag] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\flag\flag.md3 - -[models\chunks\flag_blue] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\flag_blue\flag_blue.md3 - -[models\chunks\flag_red] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\flag_red\flag_red.md3 - -[models\chunks\glass] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\glass\glass_big.md3 -file1=<>\SOF2Pack\models\chunks\glass\glass_med.md3 -file2=<>\SOF2Pack\models\chunks\glass\glass_small.md3 -file3=<>\SOF2Pack\models\chunks\glass\glchunks_1.md3 -file4=<>\SOF2Pack\models\chunks\glass\glchunks_2.md3 -file5=<>\SOF2Pack\models\chunks\glass\glchunks_3.md3 -file6=<>\SOF2Pack\models\chunks\glass\glchunks_4.md3 -file7=<>\SOF2Pack\models\chunks\glass\glchunks_5.md3 -file8=<>\SOF2Pack\models\chunks\glass\glchunks_6.md3 - -[models\chunks\ice] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\ice\ice_big.md3 -file1=<>\SOF2Pack\models\chunks\ice\ice_med.md3 -file2=<>\SOF2Pack\models\chunks\ice\ice_small.md3 - -[models\chunks\katana] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\katana\katana.md3 - -[models\chunks\keyboard_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\keyboard_chunks\keyboard_chunk1.md3 -file1=<>\SOF2Pack\models\chunks\keyboard_chunks\keyboard_chunk2.md3 -file2=<>\SOF2Pack\models\chunks\keyboard_chunks\keyboard_chunk_small.md3 - -[models\chunks\lantern_long] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\lantern_long\lantern_long.md3 - -[models\chunks\leaf] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\leaf\leaf.md3 - -[models\chunks\lid] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\lid\lid.md3 - -[models\chunks\metal] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\metal\metal_big.md3 -file1=<>\SOF2Pack\models\chunks\metal\metal_med.md3 -file2=<>\SOF2Pack\models\chunks\metal\metal_small.md3 - -[models\chunks\micro1] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\micro1\micro1.md3 - -[models\chunks\micro2] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\micro2\micro2.md3 - -[models\chunks\micro3] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\micro3\micro3.md3 - -[models\chunks\micro4] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\micro4\micro4.md3 - -[models\chunks\micro5] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\micro5\micro5.md3 - -[models\chunks\monitor_cart_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\monitor_cart_chunks\cart_wheel.md3 -file1=<>\SOF2Pack\models\chunks\monitor_cart_chunks\monitor_cart_chunk1.md3 - -[models\chunks\monitor_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\monitor_chunks\monitor_chunk_lrg.md3 -file1=<>\SOF2Pack\models\chunks\monitor_chunks\monitor_chunk_med.md3 - -[models\chunks\monitor_front] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\monitor_front\monitor_front.md3 - -[models\chunks\paper] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\paper\paper.md3 -file1=<>\SOF2Pack\models\chunks\paper\paper_mag1.md3 -file2=<>\SOF2Pack\models\chunks\paper\paper_mag2.md3 -file3=<>\SOF2Pack\models\chunks\paper\paper_mag3.md3 - -[models\chunks\phone_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\phone_chunks\phone_chunk1.md3 -file1=<>\SOF2Pack\models\chunks\phone_chunks\phone_chunk2.md3 - -[models\chunks\poolchair] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\poolchair\poolchair.md3 - -[models\chunks\rebreather] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\rebreather\rebreather.md3 - -[models\chunks\rock] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\rock\rock_big.md3 -file1=<>\SOF2Pack\models\chunks\rock\rock_med.md3 -file2=<>\SOF2Pack\models\chunks\rock\rock_small.md3 - -[models\chunks\rubber] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\rubber\rubber_big.md3 -file1=<>\SOF2Pack\models\chunks\rubber\rubber_med.md3 -file2=<>\SOF2Pack\models\chunks\rubber\rubber_small.md3 - -[models\chunks\sam_missle] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\sam_missle\sam_missle.md3 - -[models\chunks\smalllid] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\smalllid\smalllid.md3 - -[models\chunks\spatula] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\spatula\spatula.md3 - -[models\chunks\spoon] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\spoon\spoon.md3 - -[models\chunks\sunglasses] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\sunglasses\sunglass1.md3 -file1=<>\SOF2Pack\models\chunks\sunglasses\sunglass2.md3 -file2=<>\SOF2Pack\models\chunks\sunglasses\sunglass3.md3 - -[models\chunks\tray] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\tray\tray.md3 - -[models\chunks\truck_chunks] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\truck_chunks\truck_axle_chunk.md3 -file1=<>\SOF2Pack\models\chunks\truck_chunks\truck_back_chunk.md3 -file2=<>\SOF2Pack\models\chunks\truck_chunks\truck_cab_chunk.md3 -file3=<>\SOF2Pack\models\chunks\truck_chunks\truck_fender_chunk.md3 -file4=<>\SOF2Pack\models\chunks\truck_chunks\truck_hood_chunk.md3 -file5=<>\SOF2Pack\models\chunks\truck_chunks\truck_wheel_chunk.md3 - -[models\chunks\tv] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\tv\tv.md3 - -[models\chunks\wood] -fulldirectory= -file0=<>\SOF2Pack\models\chunks\wood\wood_big.md3 -file1=<>\SOF2Pack\models\chunks\wood\wood_med.md3 -file2=<>\SOF2Pack\models\chunks\wood\wood_small.md3 -file3=<>\SOF2Pack\models\chunks\wood\wood_splinter3.md3 -file4=<>\SOF2Pack\models\chunks\wood\wood_splinter4.md3 -file5=<>\SOF2Pack\models\chunks\wood\wood_splinter5.md3 -file6=<>\SOF2Pack\models\chunks\wood\wood_splinter6.md3 -file7=<>\SOF2Pack\models\chunks\wood\wood_splinter.md3 - -[models\flags] -fulldirectory= -file0=<>\SOF2Pack\models\flags\flag_blue.md3 -file1=<>\SOF2Pack\models\flags\flag_red.md3 - -[models\objects] -fulldirectory= -SubDir0=models\objects\Airport -SubDir1=models\objects\Armory -SubDir2=models\objects\Colombia -SubDir3=models\objects\Common -SubDir4=models\objects\Finca -SubDir5=models\objects\Hongkong -SubDir6=models\objects\Hospital -SubDir7=models\objects\Jordan -SubDir8=models\objects\Kamchatka -SubDir9=models\objects\Liner -SubDir10=models\objects\Prague -SubDir11=models\objects\Shop - -[models\objects\Airport] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Airport\box_cart.md3 -file1=<>\SOF2Pack\models\objects\Airport\box_cart_buggy.md3 -file2=<>\SOF2Pack\models\objects\Airport\box_cart_open.md3 -file3=<>\SOF2Pack\models\objects\Airport\gift_stand.md3 -file4=<>\SOF2Pack\models\objects\Airport\giftstore_candy.md3 -file5=<>\SOF2Pack\models\objects\Airport\luggage_cart.md3 -file6=<>\SOF2Pack\models\objects\Airport\magazine_stand.md3 -file7=<>\SOF2Pack\models\objects\Airport\parachute.md3 -file8=<>\SOF2Pack\models\objects\Airport\parachute_1.md3 -file9=<>\SOF2Pack\models\objects\Airport\parachute_2.md3 -file10=<>\SOF2Pack\models\objects\Airport\phone.md3 -file11=<>\SOF2Pack\models\objects\Airport\postcard_stand.md3 -file12=<>\SOF2Pack\models\objects\Airport\steps.md3 -file13=<>\SOF2Pack\models\objects\Airport\sunglass_stand.md3 -file14=<>\SOF2Pack\models\objects\Airport\sunglasses.md3 -file15=<>\SOF2Pack\models\objects\Airport\wand_detector.md3 - -[models\objects\Armory] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Armory\airtank.md3 -file1=<>\SOF2Pack\models\objects\Armory\airtank_1.md3 -file2=<>\SOF2Pack\models\objects\Armory\airtank_2.md3 -file3=<>\SOF2Pack\models\objects\Armory\ak74_armory.md3 -file4=<>\SOF2Pack\models\objects\Armory\ak74_nb.md3 -file5=<>\SOF2Pack\models\objects\Armory\dummy.md3 -file6=<>\SOF2Pack\models\objects\Armory\flippers.md3 -file7=<>\SOF2Pack\models\objects\Armory\knife_armory.md3 -file8=<>\SOF2Pack\models\objects\Armory\m4_armory.md3 -file9=<>\SOF2Pack\models\objects\Armory\m60_armory.md3 -file10=<>\SOF2Pack\models\objects\Armory\mask.md3 -file11=<>\SOF2Pack\models\objects\Armory\rebreather.md3 -file12=<>\SOF2Pack\models\objects\Armory\rebreather_1.md3 -file13=<>\SOF2Pack\models\objects\Armory\rebreather_2.md3 -file14=<>\SOF2Pack\models\objects\Armory\rope.md3 -file15=<>\SOF2Pack\models\objects\Armory\rope_1.md3 -file16=<>\SOF2Pack\models\objects\Armory\rope_2.md3 -file17=<>\SOF2Pack\models\objects\Armory\virus.md3 - -[models\objects\Colombia] -fulldirectory= -SubDir0=models\objects\Colombia\furniture -SubDir1=models\objects\Colombia\jungle -SubDir2=models\objects\Colombia\lights -SubDir3=models\objects\Colombia\market -SubDir4=models\objects\Colombia\misc -SubDir5=models\objects\Colombia\vehicles - -[models\objects\Colombia\furniture] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\furniture\chair_col.md3 -file1=<>\SOF2Pack\models\objects\Colombia\furniture\chair_col_1.md3 -file2=<>\SOF2Pack\models\objects\Colombia\furniture\chair_col_2.md3 -file3=<>\SOF2Pack\models\objects\Colombia\furniture\table_col.md3 -file4=<>\SOF2Pack\models\objects\Colombia\furniture\table_col_1.md3 - -[models\objects\Colombia\jungle] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\jungle\fern_ledge.md3 -file1=<>\SOF2Pack\models\objects\Colombia\jungle\fern_lrg01.md3 -file2=<>\SOF2Pack\models\objects\Colombia\jungle\fern_lrg01_1.md3 -file3=<>\SOF2Pack\models\objects\Colombia\jungle\fern_lrg01_2.md3 -file4=<>\SOF2Pack\models\objects\Colombia\jungle\fern_sm01.md3 -file5=<>\SOF2Pack\models\objects\Colombia\jungle\grass2.md3 -file6=<>\SOF2Pack\models\objects\Colombia\jungle\grass2sm.md3 -file7=<>\SOF2Pack\models\objects\Colombia\jungle\grass.md3 -file8=<>\SOF2Pack\models\objects\Colombia\jungle\grass_clump.md3 -file9=<>\SOF2Pack\models\objects\Colombia\jungle\grass_clumpsm.md3 -file10=<>\SOF2Pack\models\objects\Colombia\jungle\grass_tall.md3 -file11=<>\SOF2Pack\models\objects\Colombia\jungle\plant_4leafs.md3 -file12=<>\SOF2Pack\models\objects\Colombia\jungle\plant_lrg01.md3 -file13=<>\SOF2Pack\models\objects\Colombia\jungle\plant_lrg01_1.md3 -file14=<>\SOF2Pack\models\objects\Colombia\jungle\plant_lrg01_2.md3 -file15=<>\SOF2Pack\models\objects\Colombia\jungle\plant_stalk.md3 -file16=<>\SOF2Pack\models\objects\Colombia\jungle\rock01.md3 -file17=<>\SOF2Pack\models\objects\Colombia\jungle\rock02.md3 -file18=<>\SOF2Pack\models\objects\Colombia\jungle\tree01.md3 -file19=<>\SOF2Pack\models\objects\Colombia\jungle\tree02.md3 -file20=<>\SOF2Pack\models\objects\Colombia\jungle\tree02_1.md3 -file21=<>\SOF2Pack\models\objects\Colombia\jungle\tree02_2.md3 -file22=<>\SOF2Pack\models\objects\Colombia\jungle\tree02_rmg.md3 -file23=<>\SOF2Pack\models\objects\Colombia\jungle\tree02_rmg_1.md3 -file24=<>\SOF2Pack\models\objects\Colombia\jungle\tree02_rmg_2.md3 -file25=<>\SOF2Pack\models\objects\Colombia\jungle\tree04.md3 -file26=<>\SOF2Pack\models\objects\Colombia\jungle\tree05.md3 -file27=<>\SOF2Pack\models\objects\Colombia\jungle\tree06.md3 -file28=<>\SOF2Pack\models\objects\Colombia\jungle\tree06_1.md3 -file29=<>\SOF2Pack\models\objects\Colombia\jungle\tree06_2.md3 -file30=<>\SOF2Pack\models\objects\Colombia\jungle\tree06_rmg.md3 -file31=<>\SOF2Pack\models\objects\Colombia\jungle\tree06_rmg_1.md3 -file32=<>\SOF2Pack\models\objects\Colombia\jungle\tree06_rmg_2.md3 -file33=<>\SOF2Pack\models\objects\Colombia\jungle\tree08.md3 -file34=<>\SOF2Pack\models\objects\Colombia\jungle\tree08_1.md3 -file35=<>\SOF2Pack\models\objects\Colombia\jungle\tree08_2.md3 -file36=<>\SOF2Pack\models\objects\Colombia\jungle\tree08_3.md3 -file37=<>\SOF2Pack\models\objects\Colombia\jungle\tree08rmg.md3 -file38=<>\SOF2Pack\models\objects\Colombia\jungle\tree08rmg_1.md3 -file39=<>\SOF2Pack\models\objects\Colombia\jungle\tree08rmg_2.md3 -file40=<>\SOF2Pack\models\objects\Colombia\jungle\tree08rmg_3.md3 -file41=<>\SOF2Pack\models\objects\Colombia\jungle\tree09.md3 -file42=<>\SOF2Pack\models\objects\Colombia\jungle\tree09_1.md3 -file43=<>\SOF2Pack\models\objects\Colombia\jungle\tree09_2.md3 -file44=<>\SOF2Pack\models\objects\Colombia\jungle\tree09_3.md3 -file45=<>\SOF2Pack\models\objects\Colombia\jungle\tree09rmg.md3 -file46=<>\SOF2Pack\models\objects\Colombia\jungle\tree09rmg_1.md3 -file47=<>\SOF2Pack\models\objects\Colombia\jungle\tree09rmg_2.md3 -file48=<>\SOF2Pack\models\objects\Colombia\jungle\tree09rmg_3.md3 -file49=<>\SOF2Pack\models\objects\Colombia\jungle\tree10.md3 -file50=<>\SOF2Pack\models\objects\Colombia\jungle\tree_sidehill.md3 -file51=<>\SOF2Pack\models\objects\Colombia\jungle\tree_sidehill_1.md3 -file52=<>\SOF2Pack\models\objects\Colombia\jungle\tree_sidehill_2.md3 -file53=<>\SOF2Pack\models\objects\Colombia\jungle\treetest.md3 - -[models\objects\Colombia\lights] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\lights\hanging_light.md3 -file1=<>\SOF2Pack\models\objects\Colombia\lights\hanging_light_1.md3 -file2=<>\SOF2Pack\models\objects\Colombia\lights\hanging_light_2.md3 - -[models\objects\Colombia\market] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\market\basket.md3 -file1=<>\SOF2Pack\models\objects\Colombia\market\basket_1.md3 -file2=<>\SOF2Pack\models\objects\Colombia\market\basket_2.md3 -file3=<>\SOF2Pack\models\objects\Colombia\market\basket_cloth.md3 -file4=<>\SOF2Pack\models\objects\Colombia\market\basket_cloth_1.md3 -file5=<>\SOF2Pack\models\objects\Colombia\market\basket_cloth_2.md3 -file6=<>\SOF2Pack\models\objects\Colombia\market\basket_food.md3 -file7=<>\SOF2Pack\models\objects\Colombia\market\basket_food_1.md3 -file8=<>\SOF2Pack\models\objects\Colombia\market\basket_food_2.md3 -file9=<>\SOF2Pack\models\objects\Colombia\market\boxfruit.md3 -file10=<>\SOF2Pack\models\objects\Colombia\market\boxfruit_1.md3 -file11=<>\SOF2Pack\models\objects\Colombia\market\boxfruit_2.md3 -file12=<>\SOF2Pack\models\objects\Colombia\market\boxfruit_empty.md3 -file13=<>\SOF2Pack\models\objects\Colombia\market\boxfruit_empty_1.md3 -file14=<>\SOF2Pack\models\objects\Colombia\market\boxfruit_empty_2.md3 -file15=<>\SOF2Pack\models\objects\Colombia\market\chair.md3 -file16=<>\SOF2Pack\models\objects\Colombia\market\chair_1.md3 -file17=<>\SOF2Pack\models\objects\Colombia\market\chair_2.md3 -file18=<>\SOF2Pack\models\objects\Colombia\market\pots1.md3 -file19=<>\SOF2Pack\models\objects\Colombia\market\pots1_1.md3 -file20=<>\SOF2Pack\models\objects\Colombia\market\pots1_2.md3 -file21=<>\SOF2Pack\models\objects\Colombia\market\pots2.md3 -file22=<>\SOF2Pack\models\objects\Colombia\market\pots2_1.md3 -file23=<>\SOF2Pack\models\objects\Colombia\market\pots2_2.md3 -file24=<>\SOF2Pack\models\objects\Colombia\market\pots3.md3 -file25=<>\SOF2Pack\models\objects\Colombia\market\pots3_1.md3 -file26=<>\SOF2Pack\models\objects\Colombia\market\pots3_2.md3 -file27=<>\SOF2Pack\models\objects\Colombia\market\sawhorse.md3 -file28=<>\SOF2Pack\models\objects\Colombia\market\sawhorse_1.md3 -file29=<>\SOF2Pack\models\objects\Colombia\market\sawhorse_2.md3 - -[models\objects\Colombia\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\misc\claymore.md3 -file1=<>\SOF2Pack\models\objects\Colombia\misc\com_equip_phone.md3 -file2=<>\SOF2Pack\models\objects\Colombia\misc\com_equip_popup.md3 -file3=<>\SOF2Pack\models\objects\Colombia\misc\com_equip_sdish.md3 -file4=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox1.md3 -file5=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox1_empty.md3 -file6=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox2.md3 -file7=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox2_empty.md3 -file8=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox3.md3 -file9=<>\SOF2Pack\models\objects\Colombia\misc\flowerbox3_empty.md3 -file10=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big2.md3 -file11=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big2_1.md3 -file12=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big2_2.md3 -file13=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big.md3 -file14=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big_1.md3 -file15=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_big_2.md3 -file16=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_med.md3 -file17=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_med_1.md3 -file18=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_med_2.md3 -file19=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_small.md3 -file20=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_small_1.md3 -file21=<>\SOF2Pack\models\objects\Colombia\misc\flowerpot_small_2.md3 -file22=<>\SOF2Pack\models\objects\Colombia\misc\statue.md3 -file23=<>\SOF2Pack\models\objects\Colombia\misc\tire.md3 -file24=<>\SOF2Pack\models\objects\Colombia\misc\tire_1.md3 -file25=<>\SOF2Pack\models\objects\Colombia\misc\tire_2.md3 - -[models\objects\Colombia\vehicles] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Colombia\vehicles\jeep.md3 -file1=<>\SOF2Pack\models\objects\Colombia\vehicles\jeep_bombed.md3 -file2=<>\SOF2Pack\models\objects\Colombia\vehicles\jeep_dm.md3 -file3=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_black_temp.md3 -file4=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_black_temp_1.md3 -file5=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_black_temp_2.md3 -file6=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_flatbed.md3 -file7=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_personnel.md3 -file8=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_personnel_1.md3 -file9=<>\SOF2Pack\models\objects\Colombia\vehicles\truck_personnel_2.md3 - -[models\objects\Common] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\ashtray.md3 -file1=<>\SOF2Pack\models\objects\Common\beam.md3 -file2=<>\SOF2Pack\models\objects\Common\body_bag.md3 -file3=<>\SOF2Pack\models\objects\Common\candleholder.md3 -file4=<>\SOF2Pack\models\objects\Common\desklamp1.md3 -file5=<>\SOF2Pack\models\objects\Common\desklamp1_1.md3 -file6=<>\SOF2Pack\models\objects\Common\desklamp1_2.md3 -file7=<>\SOF2Pack\models\objects\Common\desklamp2.md3 -file8=<>\SOF2Pack\models\objects\Common\desklamp2_1.md3 -file9=<>\SOF2Pack\models\objects\Common\desklamp2_2.md3 -file10=<>\SOF2Pack\models\objects\Common\faucet.md3 -file11=<>\SOF2Pack\models\objects\Common\glass.md3 -file12=<>\SOF2Pack\models\objects\Common\lantern.md3 -file13=<>\SOF2Pack\models\objects\Common\lantern_1.md3 -file14=<>\SOF2Pack\models\objects\Common\lantern_2.md3 -file15=<>\SOF2Pack\models\objects\Common\payphone.md3 -file16=<>\SOF2Pack\models\objects\Common\phone.md3 -file17=<>\SOF2Pack\models\objects\Common\poolball.md3 -file18=<>\SOF2Pack\models\objects\Common\sandbag_corner.md3 -file19=<>\SOF2Pack\models\objects\Common\sandbag_end.md3 -file20=<>\SOF2Pack\models\objects\Common\sandbag_section.md3 -file21=<>\SOF2Pack\models\objects\Common\search_light.md3 -file22=<>\SOF2Pack\models\objects\Common\shoes.md3 -file23=<>\SOF2Pack\models\objects\Common\shoes_1.md3 -file24=<>\SOF2Pack\models\objects\Common\shoes_2.md3 -file25=<>\SOF2Pack\models\objects\Common\sink_faucet.md3 -file26=<>\SOF2Pack\models\objects\Common\sprinkler.md3 -file27=<>\SOF2Pack\models\objects\Common\sprinkler_1.md3 -file28=<>\SOF2Pack\models\objects\Common\sprinkler_2.md3 -file29=<>\SOF2Pack\models\objects\Common\taxi_cab.md3 -file30=<>\SOF2Pack\models\objects\Common\test.md3 -file31=<>\SOF2Pack\models\objects\Common\toilet.md3 -file32=<>\SOF2Pack\models\objects\Common\toilet_1.md3 -file33=<>\SOF2Pack\models\objects\Common\toilet_2.md3 -file34=<>\SOF2Pack\models\objects\Common\toilet_damaged.md3 -file35=<>\SOF2Pack\models\objects\Common\toolkit.md3 -file36=<>\SOF2Pack\models\objects\Common\tracklight.md3 -file37=<>\SOF2Pack\models\objects\Common\tracklight_1.md3 -file38=<>\SOF2Pack\models\objects\Common\trash_can_empty.md3 -file39=<>\SOF2Pack\models\objects\Common\trash_can_lid.md3 -file40=<>\SOF2Pack\models\objects\Common\trash_can_lid_1.md3 -file41=<>\SOF2Pack\models\objects\Common\trash_can_lid_2.md3 -file42=<>\SOF2Pack\models\objects\Common\trash_can_nolid.md3 -file43=<>\SOF2Pack\models\objects\Common\trash_can_nolid_1.md3 -file44=<>\SOF2Pack\models\objects\Common\trash_can_nolid_2.md3 -file45=<>\SOF2Pack\models\objects\Common\trucksandbag.md3 -file46=<>\SOF2Pack\models\objects\Common\tv.md3 -file47=<>\SOF2Pack\models\objects\Common\tv_1.md3 -file48=<>\SOF2Pack\models\objects\Common\tv_2.md3 -file49=<>\SOF2Pack\models\objects\Common\urinal.md3 -file50=<>\SOF2Pack\models\objects\Common\urinal_1.md3 -file51=<>\SOF2Pack\models\objects\Common\urinal_2.md3 -file52=<>\SOF2Pack\models\objects\Common\yugo.md3 -SubDir0=models\objects\Common\barrels -SubDir1=models\objects\Common\doorhandle -SubDir2=models\objects\Common\forklift -SubDir3=models\objects\Common\handcart -SubDir4=models\objects\Common\rope -SubDir5=models\objects\Common\SAM - -[models\objects\Common\barrels] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\barrels\barrel_hk.md3 - -[models\objects\Common\doorhandle] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\doorhandle\handle.md3 - -[models\objects\Common\forklift] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\forklift\forklift.md3 - -[models\objects\Common\handcart] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\handcart\handcart.md3 -file1=<>\SOF2Pack\models\objects\Common\handcart\handcart_lrg.md3 - -[models\objects\Common\rope] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\rope\rope.md3 -file1=<>\SOF2Pack\models\objects\Common\rope\rope_1.md3 -file2=<>\SOF2Pack\models\objects\Common\rope\rope_2.md3 - -[models\objects\Common\SAM] -fulldirectory= -SubDir0=models\objects\Common\SAM\missile - -[models\objects\Common\SAM\missile] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Common\SAM\missile\missle.md3 - -[models\objects\Finca] -fulldirectory= -SubDir0=models\objects\Finca\cars -SubDir1=models\objects\Finca\furniture -SubDir2=models\objects\Finca\lamps -SubDir3=models\objects\Finca\misc - -[models\objects\Finca\cars] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Finca\cars\hummer.md3 -file1=<>\SOF2Pack\models\objects\Finca\cars\limo.md3 -file2=<>\SOF2Pack\models\objects\Finca\cars\luxurysedan.md3 - -[models\objects\Finca\furniture] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Finca\furniture\bar_stool.md3 -file1=<>\SOF2Pack\models\objects\Finca\furniture\chair_finca.md3 -file2=<>\SOF2Pack\models\objects\Finca\furniture\masterchair_finca.md3 -file3=<>\SOF2Pack\models\objects\Finca\furniture\oak_table.md3 -file4=<>\SOF2Pack\models\objects\Finca\furniture\poolside_chair.md3 -file5=<>\SOF2Pack\models\objects\Finca\furniture\poolside_foot_stool.md3 -file6=<>\SOF2Pack\models\objects\Finca\furniture\poolside_table.md3 -file7=<>\SOF2Pack\models\objects\Finca\furniture\sundial.md3 - -[models\objects\Finca\lamps] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Finca\lamps\desklamp1.md3 -file1=<>\SOF2Pack\models\objects\Finca\lamps\desklamp2.md3 -file2=<>\SOF2Pack\models\objects\Finca\lamps\floorlamp1.md3 -file3=<>\SOF2Pack\models\objects\Finca\lamps\floorlamp2.md3 -file4=<>\SOF2Pack\models\objects\Finca\lamps\lightbulb1.md3 -file5=<>\SOF2Pack\models\objects\Finca\lamps\lightbulb2.md3 -file6=<>\SOF2Pack\models\objects\Finca\lamps\wall_light1.md3 -file7=<>\SOF2Pack\models\objects\Finca\lamps\wall_light2.md3 -file8=<>\SOF2Pack\models\objects\Finca\lamps\wall_light3.md3 - -[models\objects\Finca\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Finca\misc\bear_rug.md3 -file1=<>\SOF2Pack\models\objects\Finca\misc\bowling_ball.md3 -file2=<>\SOF2Pack\models\objects\Finca\misc\bowling_pin.md3 -file3=<>\SOF2Pack\models\objects\Finca\misc\bust.md3 -file4=<>\SOF2Pack\models\objects\Finca\misc\closed_book.md3 -file5=<>\SOF2Pack\models\objects\Finca\misc\coffee_cup.md3 -file6=<>\SOF2Pack\models\objects\Finca\misc\coffee_cup_1.md3 -file7=<>\SOF2Pack\models\objects\Finca\misc\coffee_cup_2.md3 -file8=<>\SOF2Pack\models\objects\Finca\misc\katana.md3 -file9=<>\SOF2Pack\models\objects\Finca\misc\moose.md3 -file10=<>\SOF2Pack\models\objects\Finca\misc\open_book.md3 -file11=<>\SOF2Pack\models\objects\Finca\misc\steer_horns.md3 -file12=<>\SOF2Pack\models\objects\Finca\misc\wine_bottle.md3 - -[models\objects\Hongkong] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\electric_chair.md3 -SubDir0=models\objects\Hongkong\baskets_pots -SubDir1=models\objects\Hongkong\lights -SubDir2=models\objects\Hongkong\misc -SubDir3=models\objects\Hongkong\paper_lanterns -SubDir4=models\objects\Hongkong\prison -SubDir5=models\objects\Hongkong\rice_bags -SubDir6=models\objects\Hongkong\vehicles - -[models\objects\Hongkong\baskets_pots] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_efx.md3 -file1=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_single_cover.md3 -file2=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_single_food.md3 -file3=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_single_open.md3 -file4=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_single_oval.md3 -file5=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\basket_single_over.md3 -file6=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\baskets_stack.md3 -file7=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\baskets_stack_lrg.md3 -file8=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\baskets_stack_single.md3 -file9=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\baskets_stack_square.md3 -file10=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\bucket_handles.md3 -file11=<>\SOF2Pack\models\objects\Hongkong\baskets_pots\pot_lrg.md3 - -[models\objects\Hongkong\lights] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\lights\cell.md3 - -[models\objects\Hongkong\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\misc\mahi.md3 -file1=<>\SOF2Pack\models\objects\Hongkong\misc\stoplight.md3 -file2=<>\SOF2Pack\models\objects\Hongkong\misc\tire_dock.md3 -file3=<>\SOF2Pack\models\objects\Hongkong\misc\tuna.md3 -file4=<>\SOF2Pack\models\objects\Hongkong\misc\vase.md3 - -[models\objects\Hongkong\paper_lanterns] -fulldirectory= - -[models\objects\Hongkong\prison] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\prison\bed.md3 -file1=<>\SOF2Pack\models\objects\Hongkong\prison\clipboard.md3 - -[models\objects\Hongkong\rice_bags] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bag_bentdown.md3 -file1=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bag_bentup.md3 -file2=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bag_single.md3 -file3=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bags_stack.md3 -file4=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bags_stack_lrg.md3 -file5=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bags_stacklow.md3 -file6=<>\SOF2Pack\models\objects\Hongkong\rice_bags\rice_bags_stacklow_lrg.md3 - -[models\objects\Hongkong\vehicles] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hongkong\vehicles\car_hk.md3 -file1=<>\SOF2Pack\models\objects\Hongkong\vehicles\truck_flatbed.md3 -file2=<>\SOF2Pack\models\objects\Hongkong\vehicles\truck_hk.md3 - -[models\objects\Hospital] -fulldirectory= -SubDir0=models\objects\Hospital\carts -SubDir1=models\objects\Hospital\misc - -[models\objects\Hospital\carts] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hospital\carts\cart_2tray.md3 -file1=<>\SOF2Pack\models\objects\Hospital\carts\cart_2tray_items2.md3 -file2=<>\SOF2Pack\models\objects\Hospital\carts\cart_2tray_items.md3 -file3=<>\SOF2Pack\models\objects\Hospital\carts\cart_beverage.md3 -file4=<>\SOF2Pack\models\objects\Hospital\carts\cart_food.md3 -file5=<>\SOF2Pack\models\objects\Hospital\carts\cart_medical.md3 -file6=<>\SOF2Pack\models\objects\Hospital\carts\monitor_cart.md3 -file7=<>\SOF2Pack\models\objects\Hospital\carts\monitor_cart_1.md3 -file8=<>\SOF2Pack\models\objects\Hospital\carts\monitor_cart_2.md3 - -[models\objects\Hospital\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Hospital\misc\ambulance.md3 -file1=<>\SOF2Pack\models\objects\Hospital\misc\bed.md3 -file2=<>\SOF2Pack\models\objects\Hospital\misc\drip_stand.md3 -file3=<>\SOF2Pack\models\objects\Hospital\misc\firetruck.md3 -file4=<>\SOF2Pack\models\objects\Hospital\misc\gurney.md3 -file5=<>\SOF2Pack\models\objects\Hospital\misc\microscope.md3 -file6=<>\SOF2Pack\models\objects\Hospital\misc\office_chair.md3 -file7=<>\SOF2Pack\models\objects\Hospital\misc\office_chair_1.md3 -file8=<>\SOF2Pack\models\objects\Hospital\misc\office_chair_2.md3 -file9=<>\SOF2Pack\models\objects\Hospital\misc\spray_bottle.md3 -file10=<>\SOF2Pack\models\objects\Hospital\misc\test_tube_1.md3 -file11=<>\SOF2Pack\models\objects\Hospital\misc\test_tube_2.md3 -file12=<>\SOF2Pack\models\objects\Hospital\misc\test_tube_3.md3 -file13=<>\SOF2Pack\models\objects\Hospital\misc\test_tube_4.md3 -file14=<>\SOF2Pack\models\objects\Hospital\misc\test_tube_tray.md3 -file15=<>\SOF2Pack\models\objects\Hospital\misc\wall_machine.md3 -file16=<>\SOF2Pack\models\objects\Hospital\misc\wheelchair.md3 - -[models\objects\Jordan] -fulldirectory= -SubDir0=models\objects\Jordan\misc - -[models\objects\Jordan\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Jordan\misc\cpu.md3 -file1=<>\SOF2Pack\models\objects\Jordan\misc\keyboard.md3 -file2=<>\SOF2Pack\models\objects\Jordan\misc\keyboard_1.md3 -file3=<>\SOF2Pack\models\objects\Jordan\misc\keyboard_2.md3 -file4=<>\SOF2Pack\models\objects\Jordan\misc\monitor.md3 -file5=<>\SOF2Pack\models\objects\Jordan\misc\monitor_1.md3 -file6=<>\SOF2Pack\models\objects\Jordan\misc\monitor_2.md3 - -[models\objects\Kamchatka] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Kamchatka\deadtree_med.md3 -file1=<>\SOF2Pack\models\objects\Kamchatka\limb_1.md3 -file2=<>\SOF2Pack\models\objects\Kamchatka\limb_2.md3 -file3=<>\SOF2Pack\models\objects\Kamchatka\tree2.md3 -file4=<>\SOF2Pack\models\objects\Kamchatka\tree2_1.md3 -file5=<>\SOF2Pack\models\objects\Kamchatka\tree2_2.md3 -file6=<>\SOF2Pack\models\objects\Kamchatka\tree2_rmg.md3 -file7=<>\SOF2Pack\models\objects\Kamchatka\tree2_rmg_1.md3 -file8=<>\SOF2Pack\models\objects\Kamchatka\tree2_rmg_2.md3 -file9=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg.md3 -file10=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg_1.md3 -file11=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg_2.md3 -file12=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg_rmg.md3 -file13=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg_rmg_1.md3 -file14=<>\SOF2Pack\models\objects\Kamchatka\tree_lrg_rmg_2.md3 -file15=<>\SOF2Pack\models\objects\Kamchatka\tree_med.md3 -file16=<>\SOF2Pack\models\objects\Kamchatka\tree_med_1.md3 -file17=<>\SOF2Pack\models\objects\Kamchatka\tree_med_2.md3 -file18=<>\SOF2Pack\models\objects\Kamchatka\tree_med_rmg.md3 -file19=<>\SOF2Pack\models\objects\Kamchatka\tree_med_rmg_1.md3 -file20=<>\SOF2Pack\models\objects\Kamchatka\tree_med_rmg_2.md3 -SubDir0=models\objects\Kamchatka\misc - -[models\objects\Kamchatka\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Kamchatka\misc\chem_suit.md3 - -[models\objects\Liner] -fulldirectory= -SubDir0=models\objects\Liner\furniture -SubDir1=models\objects\Liner\lights -SubDir2=models\objects\Liner\misc -SubDir3=models\objects\Liner\toilet - -[models\objects\Liner\furniture] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Liner\furniture\galley_chair.md3 -file1=<>\SOF2Pack\models\objects\Liner\furniture\galley_chair_1.md3 -file2=<>\SOF2Pack\models\objects\Liner\furniture\galley_chair_2.md3 -file3=<>\SOF2Pack\models\objects\Liner\furniture\sink.md3 - -[models\objects\Liner\lights] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Liner\lights\wall_light2.md3 -file1=<>\SOF2Pack\models\objects\Liner\lights\wall_light.md3 - -[models\objects\Liner\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Liner\misc\ax.md3 -file1=<>\SOF2Pack\models\objects\Liner\misc\ax_1.md3 -file2=<>\SOF2Pack\models\objects\Liner\misc\ax_2.md3 -file3=<>\SOF2Pack\models\objects\Liner\misc\big_pot.md3 -file4=<>\SOF2Pack\models\objects\Liner\misc\big_pot_1.md3 -file5=<>\SOF2Pack\models\objects\Liner\misc\big_pot_2.md3 -file6=<>\SOF2Pack\models\objects\Liner\misc\big_pot_nolid.md3 -file7=<>\SOF2Pack\models\objects\Liner\misc\big_pot_nolid_1.md3 -file8=<>\SOF2Pack\models\objects\Liner\misc\big_pot_nolid_2.md3 -file9=<>\SOF2Pack\models\objects\Liner\misc\cart_tray.md3 -file10=<>\SOF2Pack\models\objects\Liner\misc\cart_tray_1.md3 -file11=<>\SOF2Pack\models\objects\Liner\misc\cart_tray_2.md3 -file12=<>\SOF2Pack\models\objects\Liner\misc\coffee_maker.md3 -file13=<>\SOF2Pack\models\objects\Liner\misc\coffee_maker_1.md3 -file14=<>\SOF2Pack\models\objects\Liner\misc\coffee_maker_2.md3 -file15=<>\SOF2Pack\models\objects\Liner\misc\coffee_pot.md3 -file16=<>\SOF2Pack\models\objects\Liner\misc\control_1.md3 -file17=<>\SOF2Pack\models\objects\Liner\misc\extinguisher.md3 -file18=<>\SOF2Pack\models\objects\Liner\misc\extinguisher_1.md3 -file19=<>\SOF2Pack\models\objects\Liner\misc\extinguisher_2.md3 -file20=<>\SOF2Pack\models\objects\Liner\misc\foodtray.md3 -file21=<>\SOF2Pack\models\objects\Liner\misc\frying_pan.md3 -file22=<>\SOF2Pack\models\objects\Liner\misc\headphones.md3 -file23=<>\SOF2Pack\models\objects\Liner\misc\life_preserver.md3 -file24=<>\SOF2Pack\models\objects\Liner\misc\monitor.md3 -file25=<>\SOF2Pack\models\objects\Liner\misc\mop.md3 -file26=<>\SOF2Pack\models\objects\Liner\misc\mop_bucket.md3 -file27=<>\SOF2Pack\models\objects\Liner\misc\phone.md3 -file28=<>\SOF2Pack\models\objects\Liner\misc\pot.md3 -file29=<>\SOF2Pack\models\objects\Liner\misc\pot_nolid.md3 -file30=<>\SOF2Pack\models\objects\Liner\misc\raft.md3 -file31=<>\SOF2Pack\models\objects\Liner\misc\spatula.md3 -file32=<>\SOF2Pack\models\objects\Liner\misc\throttle.md3 -file33=<>\SOF2Pack\models\objects\Liner\misc\valve2.md3 -file34=<>\SOF2Pack\models\objects\Liner\misc\wood_spoon.md3 - -[models\objects\Liner\toilet] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Liner\toilet\toilet.md3 -file1=<>\SOF2Pack\models\objects\Liner\toilet\toilet_open.md3 - -[models\objects\Prague] -fulldirectory= -SubDir0=models\objects\Prague\furniture -SubDir1=models\objects\Prague\misc - -[models\objects\Prague\furniture] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Prague\furniture\table_long.md3 -file1=<>\SOF2Pack\models\objects\Prague\furniture\table_round.md3 -file2=<>\SOF2Pack\models\objects\Prague\furniture\umbrella.md3 - -[models\objects\Prague\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Prague\misc\big_chandelier.md3 -file1=<>\SOF2Pack\models\objects\Prague\misc\knife_prague.md3 -file2=<>\SOF2Pack\models\objects\Prague\misc\m1911a1_prague.md3 -file3=<>\SOF2Pack\models\objects\Prague\misc\med_chandelier.md3 -file4=<>\SOF2Pack\models\objects\Prague\misc\statue.md3 - -[models\objects\Shop] -fulldirectory= -SubDir0=models\objects\Shop\misc - -[models\objects\Shop\misc] -fulldirectory= -file0=<>\SOF2Pack\models\objects\Shop\misc\copy_machine.md3 -file1=<>\SOF2Pack\models\objects\Shop\misc\helipad_lights.md3 -file2=<>\SOF2Pack\models\objects\Shop\misc\helipad_lights_1.md3 -file3=<>\SOF2Pack\models\objects\Shop\misc\helipad_lights_2.md3 - -[models\pick_ups] -fulldirectory= -file0=<>\SOF2Pack\models\pick_ups\ammo_9mm_lrg.md3 -file1=<>\SOF2Pack\models\pick_ups\ammo_9mm_smll.md3 -file2=<>\SOF2Pack\models\pick_ups\ammo_20_lrg.md3 -file3=<>\SOF2Pack\models\pick_ups\ammo_20_smll.md3 -file4=<>\SOF2Pack\models\pick_ups\ammo_40_lrg.md3 -file5=<>\SOF2Pack\models\pick_ups\ammo_40_smll.md3 -file6=<>\SOF2Pack\models\pick_ups\ammo_45_lrg.md3 -file7=<>\SOF2Pack\models\pick_ups\ammo_45_smll.md3 -file8=<>\SOF2Pack\models\pick_ups\ammo_50_lrg.md3 -file9=<>\SOF2Pack\models\pick_ups\ammo_50_smll.md3 -file10=<>\SOF2Pack\models\pick_ups\ammo_556_lrg.md3 -file11=<>\SOF2Pack\models\pick_ups\ammo_556_smll.md3 -file12=<>\SOF2Pack\models\pick_ups\ammo_762_lrg.md3 -file13=<>\SOF2Pack\models\pick_ups\ammo_762_smll.md3 -file14=<>\SOF2Pack\models\pick_ups\ammo_rpg7_lrg.md3 -file15=<>\SOF2Pack\models\pick_ups\ammo_rpg7_smll.md3 -file16=<>\SOF2Pack\models\pick_ups\ammo_shotgun_lrg.md3 -file17=<>\SOF2Pack\models\pick_ups\ammo_shotgun_smll.md3 -file18=<>\SOF2Pack\models\pick_ups\anm14_lrg.md3 -file19=<>\SOF2Pack\models\pick_ups\anm14_smll.md3 -file20=<>\SOF2Pack\models\pick_ups\armor_large.md3 -file21=<>\SOF2Pack\models\pick_ups\armor_medium.md3 -file22=<>\SOF2Pack\models\pick_ups\armor_small.md3 -file23=<>\SOF2Pack\models\pick_ups\briefcase_silver.md3 -file24=<>\SOF2Pack\models\pick_ups\f1_lrg.md3 -file25=<>\SOF2Pack\models\pick_ups\f1_smll.md3 -file26=<>\SOF2Pack\models\pick_ups\health_lrg.md3 -file27=<>\SOF2Pack\models\pick_ups\health_smll.md3 -file28=<>\SOF2Pack\models\pick_ups\l2a2_lrg.md3 -file29=<>\SOF2Pack\models\pick_ups\l2a2_smll.md3 -file30=<>\SOF2Pack\models\pick_ups\m15_lrg.md3 -file31=<>\SOF2Pack\models\pick_ups\m15_smll.md3 -file32=<>\SOF2Pack\models\pick_ups\m67_lrg.md3 -file33=<>\SOF2Pack\models\pick_ups\m67_smll.md3 -file34=<>\SOF2Pack\models\pick_ups\m84_lrg.md3 -file35=<>\SOF2Pack\models\pick_ups\m84_smll.md3 -file36=<>\SOF2Pack\models\pick_ups\mdn11_lrg.md3 -file37=<>\SOF2Pack\models\pick_ups\mdn11_smll.md3 -file38=<>\SOF2Pack\models\pick_ups\rmg_book.md3 -file39=<>\SOF2Pack\models\pick_ups\rmg_briefcase.md3 -file40=<>\SOF2Pack\models\pick_ups\rmg_discs.md3 -file41=<>\SOF2Pack\models\pick_ups\rmg_documents.md3 -file42=<>\SOF2Pack\models\pick_ups\rmg_tnt.md3 -file43=<>\SOF2Pack\models\pick_ups\smohg92_lrg.md3 -file44=<>\SOF2Pack\models\pick_ups\smohg92_smll.md3 - -[models\weapons] -fulldirectory= -file0=<>\SOF2Pack\models\weapons\grenade_handle.md3 -SubDir0=models\weapons\ak74 -SubDir1=models\weapons\shells - -[models\weapons\ak74] -fulldirectory= -file0=<>\SOF2Pack\models\weapons\ak74\ak74_muzzle_model.md3 - -[models\weapons\shells] -fulldirectory= -file0=<>\SOF2Pack\models\weapons\shells\shell_40mm.md3 -file1=<>\SOF2Pack\models\weapons\shells\shell_40mm_empty.md3 -file2=<>\SOF2Pack\models\weapons\shells\shell_brass.md3 -file3=<>\SOF2Pack\models\weapons\shells\shell_brass_large.md3 -file4=<>\SOF2Pack\models\weapons\shells\shell_brass_small.md3 -file5=<>\SOF2Pack\models\weapons\shells\shell_shotgun.md3 - -[scripts] -fulldirectory= -file0=<>\SOF2Pack\scripts\mp_entities.def -file1=<>\Sof2Pack\scripts\sp_entities.def -file2=<>\Sof2Pack\scripts\default_project.proj -SubDir0=scripts\kam6 - -[scripts\kam6] -fulldirectory=kam6 -file0=<>\Sof2Pack\scripts\kam6\elev_see_player.txt -file1=<>\Sof2Pack\scripts\kam6\ambush_one.txt -file2=<>\Sof2Pack\scripts\kam6\ceiling_cart.txt -file3=<>\Sof2Pack\scripts\kam6\door_ambush.txt -file4=<>\Sof2Pack\scripts\kam6\el_down.txt -file5=<>\Sof2Pack\scripts\kam6\el_downb.txt -file6=<>\Sof2Pack\scripts\kam6\el_up.txt - -[shaders] -fulldirectory= -file0=<>\SOF2Pack\shaders\airport.shader -file1=<>\SOF2Pack\shaders\airport_models.shader -file2=<>\SOF2Pack\shaders\arioche.shader -file3=<>\SOF2Pack\shaders\armory.shader -file4=<>\SOF2Pack\shaders\armory_models.shader -file5=<>\SOF2Pack\shaders\average_armor.shader -file6=<>\SOF2Pack\shaders\average_sleeves.shader -file7=<>\SOF2Pack\shaders\bolt_ons.shader -file8=<>\SOF2Pack\shaders\cemetery.shader -file9=<>\SOF2Pack\shaders\chem_suit.shader -file10=<>\SOF2Pack\shaders\chunks.shader -file11=<>\SOF2Pack\shaders\colombia.shader -file12=<>\SOF2Pack\shaders\colombia_models.shader -file13=<>\SOF2Pack\shaders\colors.shader -file14=<>\SOF2Pack\shaders\common.shader -file15=<>\SOF2Pack\shaders\common_models.shader -file16=<>\SOF2Pack\shaders\decals.shader -file17=<>\SOF2Pack\shaders\dog.shader -file18=<>\SOF2Pack\shaders\effects.shader -file19=<>\SOF2Pack\shaders\fat.shader -file20=<>\SOF2Pack\shaders\female_armor.shader -file21=<>\SOF2Pack\shaders\female_pants.shader -file22=<>\SOF2Pack\shaders\female_skirt.shader -file23=<>\SOF2Pack\shaders\finca.shader -file24=<>\SOF2Pack\shaders\finca_models.shader -file25=<>\SOF2Pack\shaders\fogs.shader -file26=<>\SOF2Pack\shaders\gfx.shader -file27=<>\SOF2Pack\shaders\glass.shader -file28=<>\SOF2Pack\shaders\gore.shader -file29=<>\SOF2Pack\shaders\hongkong.shader -file30=<>\SOF2Pack\shaders\hongkong_models.shader -file31=<>\SOF2Pack\shaders\hospital.shader -file32=<>\SOF2Pack\shaders\hospital_models.shader -file33=<>\SOF2Pack\shaders\hud.shader -file34=<>\SOF2Pack\shaders\instances.shader -file35=<>\SOF2Pack\shaders\jordan.shader -file36=<>\SOF2Pack\shaders\jordan_models.shader -file37=<>\SOF2Pack\shaders\kamchatka.shader -file38=<>\SOF2Pack\shaders\kamchatka_models.shader -file39=<>\SOF2Pack\shaders\liner.shader -file40=<>\SOF2Pack\shaders\liner_models.shader -file41=<>\SOF2Pack\shaders\menu.shader -file42=<>\SOF2Pack\shaders\meta.txt -file43=<>\SOF2Pack\shaders\metashader.shader -file44=<>\SOF2Pack\shaders\mp.shader -file45=<>\SOF2Pack\shaders\osprey.shader -file46=<>\SOF2Pack\shaders\pick_ups.shader -file47=<>\SOF2Pack\shaders\prague.shader -file48=<>\SOF2Pack\shaders\prague_models.shader -file49=<>\SOF2Pack\shaders\roam.shader -file50=<>\SOF2Pack\shaders\shaderlist.txt -file51=<>\SOF2Pack\shaders\shop.shader -file52=<>\SOF2Pack\shaders\shop_models.shader -file53=<>\SOF2Pack\shaders\skies.shader -file54=<>\SOF2Pack\shaders\skingore.shader -file55=<>\SOF2Pack\shaders\snow.shader -file56=<>\SOF2Pack\shaders\sprites.shader -file57=<>\SOF2Pack\shaders\suit_long_coat.shader -file58=<>\SOF2Pack\shaders\suit_sleeves.shader -file59=<>\SOF2Pack\shaders\test.shader -file60=<>\SOF2Pack\shaders\tools.shader -file61=<>\SOF2Pack\shaders\weapons.shader - diff --git a/setup/win32/template/File Groups/STVEF Executable Files.fgl b/setup/win32/template/File Groups/STVEF Executable Files.fgl deleted file mode 100644 index c2f371b2..00000000 --- a/setup/win32/template/File Groups/STVEF Executable Files.fgl +++ /dev/null @@ -1,41 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\STVEFPack\game.xlink -file1=<>\STVEFPack\bin\bspc.exe -file2=<>\GtkRadiant\tools\quake3\q3data\Release\q3data.exe -file3=<>\RavenPack\bin\BehavEd.exe -file4=<>\STVEFPack\synapse.config -file5=<>\gtk2-win32\bin\libglib-2.0-0.dll -file6=<>\gtk2-win32\bin\intl.dll -file7=<>\libxml2\win32\binaries-release\libxml2.dll -SubDir0=docs - -[docs] -fulldirectory= -file0=<>\STVEFPack\docs\EF-GDK-FAQ.htm -file1=<>\RavenPack\docs\ICARUS Manual.htm -SubDir0=docs\GtkRadiant_STVEF_HOWTO -SubDir1=docs\EF-GDK-FAQ_files -SubDir2=docs\ICARUS Manual_files - -[docs\GtkRadiant_STVEF_HOWTO] -fulldirectory= -file0=<>\STVEFPack\docs\GtkRadiant_STVEF_HOWTO\project.png -file1=<>\STVEFPack\docs\GtkRadiant_STVEF_HOWTO\game1.png -file2=<>\STVEFPack\docs\GtkRadiant_STVEF_HOWTO\game2.png -file3=<>\STVEFPack\docs\GtkRadiant_STVEF_HOWTO\index.html -file4=<>\STVEFPack\docs\GtkRadiant_STVEF_HOWTO\monitor.png - -[docs\EF-GDK-FAQ_files] -fulldirectory= -file0=<>\STVEFPack\docs\EF-GDK-FAQ_files\image001.gif -file1=<>\STVEFPack\docs\EF-GDK-FAQ_files\filelist.xml - -[docs\ICARUS Manual_files] -fulldirectory= -file0=<>\STVEFPack\docs\ICARUS Manual_files\header.htm -file1=<>\STVEFPack\docs\ICARUS Manual_files\filelist.xml - diff --git a/setup/win32/template/File Groups/STVEF Media Files.fgl b/setup/win32/template/File Groups/STVEF Media Files.fgl deleted file mode 100644 index ad0608f0..00000000 --- a/setup/win32/template/File Groups/STVEF Media Files.fgl +++ /dev/null @@ -1,471 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\STVEFPack\mapextras.pk3 -SubDir0=maps -SubDir1=models -SubDir2=scripts - -[maps] -fulldirectory= -file0=<>\STVEFPack\maps\voy3.map -file1=<>\STVEFPack\maps\_brig.map -file2=<>\STVEFPack\maps\borg1.map -file3=<>\STVEFPack\maps\ctf_kln1.map -file4=<>\STVEFPack\maps\hm_blastradius.map -file5=<>\STVEFPack\maps\tutorial.map -file6=<>\STVEFPack\maps\voy1.map - -[models] -fulldirectory= -SubDir0=models\boltOns -SubDir1=models\chunks -SubDir2=models\flags -SubDir3=models\misc -SubDir4=models\weaphits -SubDir5=models\powerups -SubDir6=models\mapobjects - -[models\boltOns] -fulldirectory= -file0=<>\STVEFPack\models\boltOns\ted.md3 -file1=<>\STVEFPack\models\boltOns\detpack.md3 -file2=<>\STVEFPack\models\boltOns\emitter.md3 -file3=<>\STVEFPack\models\boltOns\glass.md3 -file4=<>\STVEFPack\models\boltOns\helmet.md3 -file5=<>\STVEFPack\models\boltOns\jetpack.md3 -file6=<>\STVEFPack\models\boltOns\pat_enh.md3 -file7=<>\STVEFPack\models\boltOns\phaser.md3 - -[models\chunks] -fulldirectory= -SubDir0=models\chunks\borg -SubDir1=models\chunks\generic -SubDir2=models\chunks\glass -SubDir3=models\chunks\warriorbot -SubDir4=models\chunks\stasis - -[models\chunks\borg] -fulldirectory= -file0=<>\STVEFPack\models\chunks\borg\borg_3.md3 -file1=<>\STVEFPack\models\chunks\borg\borg_1.md3 -file2=<>\STVEFPack\models\chunks\borg\borg_2.md3 - -[models\chunks\generic] -fulldirectory= -file0=<>\STVEFPack\models\chunks\generic\chunks_6.md3 -file1=<>\STVEFPack\models\chunks\generic\chunks_1.md3 -file2=<>\STVEFPack\models\chunks\generic\chunks_2.md3 -file3=<>\STVEFPack\models\chunks\generic\chunks_3.md3 -file4=<>\STVEFPack\models\chunks\generic\chunks_4.md3 -file5=<>\STVEFPack\models\chunks\generic\chunks_5.md3 - -[models\chunks\glass] -fulldirectory= -file0=<>\STVEFPack\models\chunks\glass\glchunks_6.md3 -file1=<>\STVEFPack\models\chunks\glass\glchunks_1.md3 -file2=<>\STVEFPack\models\chunks\glass\glchunks_2.md3 -file3=<>\STVEFPack\models\chunks\glass\glchunks_3.md3 -file4=<>\STVEFPack\models\chunks\glass\glchunks_4.md3 -file5=<>\STVEFPack\models\chunks\glass\glchunks_5.md3 - -[models\chunks\warriorbot] -fulldirectory= -file0=<>\STVEFPack\models\chunks\warriorbot\turret.md3 -file1=<>\STVEFPack\models\chunks\warriorbot\arm.md3 -file2=<>\STVEFPack\models\chunks\warriorbot\foot.md3 -file3=<>\STVEFPack\models\chunks\warriorbot\head.md3 -file4=<>\STVEFPack\models\chunks\warriorbot\leg.md3 - -[models\chunks\stasis] -fulldirectory= -file0=<>\STVEFPack\models\chunks\stasis\stasis_4.md3 -file1=<>\STVEFPack\models\chunks\stasis\stasis_1.md3 -file2=<>\STVEFPack\models\chunks\stasis\stasis_2.md3 -file3=<>\STVEFPack\models\chunks\stasis\stasis_3.md3 - -[models\flags] -fulldirectory= -file0=<>\STVEFPack\models\flags\flag_red.md3 -file1=<>\STVEFPack\models\flags\flag_blue.md3 - -[models\misc] -fulldirectory= -file0=<>\STVEFPack\models\misc\telep.md3 - -[models\weaphits] -fulldirectory= -file0=<>\STVEFPack\models\weaphits\ring02.md3 -file1=<>\STVEFPack\models\weaphits\explosion.md3 -file2=<>\STVEFPack\models\weaphits\nuke.md3 - -[models\powerups] -fulldirectory= -SubDir0=models\powerups\trek - -[models\powerups\trek] -fulldirectory= -file0=<>\STVEFPack\models\powerups\trek\transporter_1.md3 -file1=<>\STVEFPack\models\powerups\trek\arc_ammo.md3 -file2=<>\STVEFPack\models\powerups\trek\arc_ammo_1.md3 -file3=<>\STVEFPack\models\powerups\trek\armor2.md3 -file4=<>\STVEFPack\models\powerups\trek\armor2_1.md3 -file5=<>\STVEFPack\models\powerups\trek\armor3.md3 -file6=<>\STVEFPack\models\powerups\trek\armor3_1.md3 -file7=<>\STVEFPack\models\powerups\trek\armor.md3 -file8=<>\STVEFPack\models\powerups\trek\armor_1.md3 -file9=<>\STVEFPack\models\powerups\trek\armor_shard.md3 -file10=<>\STVEFPack\models\powerups\trek\decoy.md3 -file11=<>\STVEFPack\models\powerups\trek\detpak.md3 -file12=<>\STVEFPack\models\powerups\trek\flag_base.md3 -file13=<>\STVEFPack\models\powerups\trek\flight.md3 -file14=<>\STVEFPack\models\powerups\trek\flight_1.md3 -file15=<>\STVEFPack\models\powerups\trek\flight_2.md3 -file16=<>\STVEFPack\models\powerups\trek\flyer.md3 -file17=<>\STVEFPack\models\powerups\trek\glauncher_ammo.md3 -file18=<>\STVEFPack\models\powerups\trek\haste.md3 -file19=<>\STVEFPack\models\powerups\trek\haste_1.md3 -file20=<>\STVEFPack\models\powerups\trek\hypo_double.md3 -file21=<>\STVEFPack\models\powerups\trek\hypo_single.md3 -file22=<>\STVEFPack\models\powerups\trek\imod_ammo.md3 -file23=<>\STVEFPack\models\powerups\trek\invisible.md3 -file24=<>\STVEFPack\models\powerups\trek\invisible_1.md3 -file25=<>\STVEFPack\models\powerups\trek\med_kit.md3 -file26=<>\STVEFPack\models\powerups\trek\prifle_ammo.md3 -file27=<>\STVEFPack\models\powerups\trek\quad_damage.md3 -file28=<>\STVEFPack\models\powerups\trek\quad_damage_1.md3 -file29=<>\STVEFPack\models\powerups\trek\regen.md3 -file30=<>\STVEFPack\models\powerups\trek\scavenger_ammo.md3 -file31=<>\STVEFPack\models\powerups\trek\shield_gen.md3 -file32=<>\STVEFPack\models\powerups\trek\stasis_ammo.md3 -file33=<>\STVEFPack\models\powerups\trek\tetrion_ammo.md3 -file34=<>\STVEFPack\models\powerups\trek\torpedo.md3 -file35=<>\STVEFPack\models\powerups\trek\torpedo_1.md3 -file36=<>\STVEFPack\models\powerups\trek\transporter.md3 - -[models\mapobjects] -fulldirectory= -SubDir0=models\mapobjects\borg -SubDir1=models\mapobjects\bridge -SubDir2=models\mapobjects\cargo -SubDir3=models\mapobjects\confroom -SubDir4=models\mapobjects\dn -SubDir5=models\mapobjects\forge -SubDir6=models\mapobjects\stasis -SubDir7=models\mapobjects\scavenger -SubDir8=models\mapobjects\podium - -[models\mapobjects\borg] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\borg\vynclumn_d1.md3 -file1=<>\STVEFPack\models\mapobjects\borg\alien_ammo2.md3 -file2=<>\STVEFPack\models\mapobjects\borg\alien_ammo2_b.md3 -file3=<>\STVEFPack\models\mapobjects\borg\alien_ammo.md3 -file4=<>\STVEFPack\models\mapobjects\borg\blite.md3 -file5=<>\STVEFPack\models\mapobjects\borg\blite_d1.md3 -file6=<>\STVEFPack\models\mapobjects\borg\borg_munro.md3 -file7=<>\STVEFPack\models\mapobjects\borg\borg_munrof.md3 -file8=<>\STVEFPack\models\mapobjects\borg\BorgCrew1.md3 -file9=<>\STVEFPack\models\mapobjects\borg\borgmachine1_d1.md3 -file10=<>\STVEFPack\models\mapobjects\borg\circuit_1.md3 -file11=<>\STVEFPack\models\mapobjects\borg\circuit_1_d1.md3 -file12=<>\STVEFPack\models\mapobjects\borg\circuit_2.md3 -file13=<>\STVEFPack\models\mapobjects\borg\circuit_2_d1.md3 -file14=<>\STVEFPack\models\mapobjects\borg\circuit_3.md3 -file15=<>\STVEFPack\models\mapobjects\borg\circuit_3_d1.md3 -file16=<>\STVEFPack\models\mapobjects\borg\dead_borg.md3 -file17=<>\STVEFPack\models\mapobjects\borg\dead_borg_arm.md3 -file18=<>\STVEFPack\models\mapobjects\borg\dead_borg_bashed.md3 -file19=<>\STVEFPack\models\mapobjects\borg\dead_borg_legs.md3 -file20=<>\STVEFPack\models\mapobjects\borg\dead_leg.md3 -file21=<>\STVEFPack\models\mapobjects\borg\disnode.md3 -file22=<>\STVEFPack\models\mapobjects\borg\disnode_d1.md3 -file23=<>\STVEFPack\models\mapobjects\borg\foster_borg.md3 -file24=<>\STVEFPack\models\mapobjects\borg\plugin2.md3 -file25=<>\STVEFPack\models\mapobjects\borg\plugin2_d1.md3 -file26=<>\STVEFPack\models\mapobjects\borg\plugin2_in.md3 -file27=<>\STVEFPack\models\mapobjects\borg\plugin.md3 -file28=<>\STVEFPack\models\mapobjects\borg\plugin_in.md3 -file29=<>\STVEFPack\models\mapobjects\borg\tank.md3 -file30=<>\STVEFPack\models\mapobjects\borg\vynclumn.md3 - -[models\mapobjects\bridge] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\bridge\stationsleft.md3 -file1=<>\STVEFPack\models\mapobjects\bridge\cchair.md3 -file2=<>\STVEFPack\models\mapobjects\bridge\ceiling.md3 -file3=<>\STVEFPack\models\mapobjects\bridge\chair.md3 -file4=<>\STVEFPack\models\mapobjects\bridge\confchair.md3 -file5=<>\STVEFPack\models\mapobjects\bridge\confLight.md3 -file6=<>\STVEFPack\models\mapobjects\bridge\hazardchair.md3 -file7=<>\STVEFPack\models\mapobjects\bridge\helm.md3 -file8=<>\STVEFPack\models\mapobjects\bridge\paris_chair.md3 -file9=<>\STVEFPack\models\mapobjects\bridge\railing.md3 -file10=<>\STVEFPack\models\mapobjects\bridge\station.md3 - -[models\mapobjects\cargo] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\cargo\turbo_lite.md3 -file1=<>\STVEFPack\models\mapobjects\cargo\barrel0.md3 -file2=<>\STVEFPack\models\mapobjects\cargo\barrel1.md3 -file3=<>\STVEFPack\models\mapobjects\cargo\barrel2.md3 -file4=<>\STVEFPack\models\mapobjects\cargo\barrel_wood2.md3 -file5=<>\STVEFPack\models\mapobjects\cargo\barrel_wood.md3 -file6=<>\STVEFPack\models\mapobjects\cargo\bullseye.md3 -file7=<>\STVEFPack\models\mapobjects\cargo\control_stand.md3 -file8=<>\STVEFPack\models\mapobjects\cargo\crate.md3 -file9=<>\STVEFPack\models\mapobjects\cargo\cube.md3 -file10=<>\STVEFPack\models\mapobjects\cargo\delta_flyer.md3 -file11=<>\STVEFPack\models\mapobjects\cargo\exam_table2.md3 -file12=<>\STVEFPack\models\mapobjects\cargo\exam_table.md3 -file13=<>\STVEFPack\models\mapobjects\cargo\hypo.md3 -file14=<>\STVEFPack\models\mapobjects\cargo\jetpack.md3 -file15=<>\STVEFPack\models\mapobjects\cargo\laptop.md3 -file16=<>\STVEFPack\models\mapobjects\cargo\med_padd.md3 -file17=<>\STVEFPack\models\mapobjects\cargo\medcart.md3 -file18=<>\STVEFPack\models\mapobjects\cargo\padd.md3 -file19=<>\STVEFPack\models\mapobjects\cargo\rack.md3 -file20=<>\STVEFPack\models\mapobjects\cargo\rugby_football.md3 -file21=<>\STVEFPack\models\mapobjects\cargo\s_chair.md3 -file22=<>\STVEFPack\models\mapobjects\cargo\scanner.md3 -file23=<>\STVEFPack\models\mapobjects\cargo\sm_plant.md3 -file24=<>\STVEFPack\models\mapobjects\cargo\square_cup.md3 -file25=<>\STVEFPack\models\mapobjects\cargo\stool.md3 -file26=<>\STVEFPack\models\mapobjects\cargo\suit.md3 -file27=<>\STVEFPack\models\mapobjects\cargo\suitb.md3 -file28=<>\STVEFPack\models\mapobjects\cargo\suith.md3 -file29=<>\STVEFPack\models\mapobjects\cargo\suitr.md3 -file30=<>\STVEFPack\models\mapobjects\cargo\toolkit.md3 -file31=<>\STVEFPack\models\mapobjects\cargo\tray1.md3 -file32=<>\STVEFPack\models\mapobjects\cargo\tray2.md3 - -[models\mapobjects\confroom] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\confroom\sm_chair.md3 -file1=<>\STVEFPack\models\mapobjects\confroom\confplant.md3 -file2=<>\STVEFPack\models\mapobjects\confroom\conftable.md3 -file3=<>\STVEFPack\models\mapobjects\confroom\egg.md3 -file4=<>\STVEFPack\models\mapobjects\confroom\head_sculp.md3 - -[models\mapobjects\dn] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\dn\toparm_full.md3 -file1=<>\STVEFPack\models\mapobjects\dn\alien_ammo2.md3 -file2=<>\STVEFPack\models\mapobjects\dn\alien_ammo2_b.md3 -file3=<>\STVEFPack\models\mapobjects\dn\chair.md3 -file4=<>\STVEFPack\models\mapobjects\dn\chair_d1.md3 -file5=<>\STVEFPack\models\mapobjects\dn\energy_container.md3 -file6=<>\STVEFPack\models\mapobjects\dn\fighter.md3 -file7=<>\STVEFPack\models\mapobjects\dn\gunturret_arm.md3 -file8=<>\STVEFPack\models\mapobjects\dn\gunturret_base.md3 -file9=<>\STVEFPack\models\mapobjects\dn\gunturret_head.md3 -file10=<>\STVEFPack\models\mapobjects\dn\headbot_plug.md3 -file11=<>\STVEFPack\models\mapobjects\dn\laser.md3 -file12=<>\STVEFPack\models\mapobjects\dn\laser_arm.md3 -file13=<>\STVEFPack\models\mapobjects\dn\laser_base.md3 -file14=<>\STVEFPack\models\mapobjects\dn\laser_head.md3 -file15=<>\STVEFPack\models\mapobjects\dn\light.md3 -file16=<>\STVEFPack\models\mapobjects\dn\loader_arm_full.md3 -file17=<>\STVEFPack\models\mapobjects\dn\machine2.md3 -file18=<>\STVEFPack\models\mapobjects\dn\machine2_d1.md3 -file19=<>\STVEFPack\models\mapobjects\dn\machine.md3 -file20=<>\STVEFPack\models\mapobjects\dn\powercell2.md3 -file21=<>\STVEFPack\models\mapobjects\dn\powercell.md3 -file22=<>\STVEFPack\models\mapobjects\dn\sleep_chamber.md3 -file23=<>\STVEFPack\models\mapobjects\dn\sleep_chamber_c1.md3 -file24=<>\STVEFPack\models\mapobjects\dn\sleep_chamber_d1.md3 - -[models\mapobjects\forge] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\forge\turret_neck.md3 -file1=<>\STVEFPack\models\mapobjects\forge\alien_ammo.md3 -file2=<>\STVEFPack\models\mapobjects\forge\arm.md3 -file3=<>\STVEFPack\models\mapobjects\forge\boss_shell.md3 -file4=<>\STVEFPack\models\mapobjects\forge\boss_shell_1.md3 -file5=<>\STVEFPack\models\mapobjects\forge\boss_shell_2.md3 -file6=<>\STVEFPack\models\mapobjects\forge\capsule2.md3 -file7=<>\STVEFPack\models\mapobjects\forge\capsule2_d1.md3 -file8=<>\STVEFPack\models\mapobjects\forge\capsule3.md3 -file9=<>\STVEFPack\models\mapobjects\forge\capsule3_d1.md3 -file10=<>\STVEFPack\models\mapobjects\forge\d_grid2.md3 -file11=<>\STVEFPack\models\mapobjects\forge\d_grid.md3 -file12=<>\STVEFPack\models\mapobjects\forge\exam_table.md3 -file13=<>\STVEFPack\models\mapobjects\forge\exam_table_d1.md3 -file14=<>\STVEFPack\models\mapobjects\forge\flesh_vat.md3 -file15=<>\STVEFPack\models\mapobjects\forge\flesh_vat_d1.md3 -file16=<>\STVEFPack\models\mapobjects\forge\monitor.md3 -file17=<>\STVEFPack\models\mapobjects\forge\monitor_d1.md3 -file18=<>\STVEFPack\models\mapobjects\forge\panels2.md3 -file19=<>\STVEFPack\models\mapobjects\forge\panels3.md3 -file20=<>\STVEFPack\models\mapobjects\forge\panels.md3 -file21=<>\STVEFPack\models\mapobjects\forge\panels_d1.md3 -file22=<>\STVEFPack\models\mapobjects\forge\power_up2.md3 -file23=<>\STVEFPack\models\mapobjects\forge\power_up.md3 -file24=<>\STVEFPack\models\mapobjects\forge\power_up_boss.md3 -file25=<>\STVEFPack\models\mapobjects\forge\power_up_bossoff.md3 -file26=<>\STVEFPack\models\mapobjects\forge\probe.md3 -file27=<>\STVEFPack\models\mapobjects\forge\probe_d1.md3 -file28=<>\STVEFPack\models\mapobjects\forge\seed.md3 -file29=<>\STVEFPack\models\mapobjects\forge\trophy.md3 -file30=<>\STVEFPack\models\mapobjects\forge\turret.md3 -file31=<>\STVEFPack\models\mapobjects\forge\turret_d1.md3 -file32=<>\STVEFPack\models\mapobjects\forge\turret_head.md3 - -[models\mapobjects\stasis] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\stasis\thing_r7.md3 -file1=<>\STVEFPack\models\mapobjects\stasis\alien_ammo2.md3 -file2=<>\STVEFPack\models\mapobjects\stasis\alien_ammo2_b.md3 -file3=<>\STVEFPack\models\mapobjects\stasis\control1.md3 -file4=<>\STVEFPack\models\mapobjects\stasis\control1_d1.md3 -file5=<>\STVEFPack\models\mapobjects\stasis\control1left.md3 -file6=<>\STVEFPack\models\mapobjects\stasis\control1left_d1.md3 -file7=<>\STVEFPack\models\mapobjects\stasis\control2.md3 -file8=<>\STVEFPack\models\mapobjects\stasis\control2_d1.md3 -file9=<>\STVEFPack\models\mapobjects\stasis\control_switch.md3 -file10=<>\STVEFPack\models\mapobjects\stasis\door2.md3 -file11=<>\STVEFPack\models\mapobjects\stasis\door.md3 -file12=<>\STVEFPack\models\mapobjects\stasis\generator.md3 -file13=<>\STVEFPack\models\mapobjects\stasis\generator_d1.md3 -file14=<>\STVEFPack\models\mapobjects\stasis\guntree.md3 -file15=<>\STVEFPack\models\mapobjects\stasis\holo1.md3 -file16=<>\STVEFPack\models\mapobjects\stasis\holo2.md3 -file17=<>\STVEFPack\models\mapobjects\stasis\holo3.md3 -file18=<>\STVEFPack\models\mapobjects\stasis\holo4.md3 -file19=<>\STVEFPack\models\mapobjects\stasis\jumppad.md3 -file20=<>\STVEFPack\models\mapobjects\stasis\jumppad_d1.md3 -file21=<>\STVEFPack\models\mapobjects\stasis\light2.md3 -file22=<>\STVEFPack\models\mapobjects\stasis\light2_d1.md3 -file23=<>\STVEFPack\models\mapobjects\stasis\mine.md3 -file24=<>\STVEFPack\models\mapobjects\stasis\monitor.md3 -file25=<>\STVEFPack\models\mapobjects\stasis\plugin2.md3 -file26=<>\STVEFPack\models\mapobjects\stasis\plugin2_floor.md3 -file27=<>\STVEFPack\models\mapobjects\stasis\plugin2_floor_in.md3 -file28=<>\STVEFPack\models\mapobjects\stasis\plugin2_in.md3 -file29=<>\STVEFPack\models\mapobjects\stasis\plugin.md3 -file30=<>\STVEFPack\models\mapobjects\stasis\plugin_floor.md3 -file31=<>\STVEFPack\models\mapobjects\stasis\plugin_floor_in.md3 -file32=<>\STVEFPack\models\mapobjects\stasis\plugin_in.md3 -file33=<>\STVEFPack\models\mapobjects\stasis\pod1.md3 -file34=<>\STVEFPack\models\mapobjects\stasis\pod2.md3 -file35=<>\STVEFPack\models\mapobjects\stasis\pod.md3 -file36=<>\STVEFPack\models\mapobjects\stasis\projector.md3 -file37=<>\STVEFPack\models\mapobjects\stasis\teleporter_base.md3 -file38=<>\STVEFPack\models\mapobjects\stasis\teleporter_base_d1.md3 -file39=<>\STVEFPack\models\mapobjects\stasis\teleporter_top.md3 -file40=<>\STVEFPack\models\mapobjects\stasis\teleporter_top_d1.md3 -file41=<>\STVEFPack\models\mapobjects\stasis\thing.md3 -file42=<>\STVEFPack\models\mapobjects\stasis\thing_l1.md3 -file43=<>\STVEFPack\models\mapobjects\stasis\thing_l2.md3 -file44=<>\STVEFPack\models\mapobjects\stasis\thing_l3.md3 -file45=<>\STVEFPack\models\mapobjects\stasis\thing_l4.md3 -file46=<>\STVEFPack\models\mapobjects\stasis\thing_l5.md3 -file47=<>\STVEFPack\models\mapobjects\stasis\thing_l6.md3 -file48=<>\STVEFPack\models\mapobjects\stasis\thing_l7.md3 -file49=<>\STVEFPack\models\mapobjects\stasis\thing_r1.md3 -file50=<>\STVEFPack\models\mapobjects\stasis\thing_r2.md3 -file51=<>\STVEFPack\models\mapobjects\stasis\thing_r3.md3 -file52=<>\STVEFPack\models\mapobjects\stasis\thing_r4.md3 -file53=<>\STVEFPack\models\mapobjects\stasis\thing_r5.md3 -file54=<>\STVEFPack\models\mapobjects\stasis\thing_r6.md3 - -[models\mapobjects\scavenger] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\scavenger\weapons.md3 -file1=<>\STVEFPack\models\mapobjects\scavenger\alien_ammo2.md3 -file2=<>\STVEFPack\models\mapobjects\scavenger\alien_ammo2_b.md3 -file3=<>\STVEFPack\models\mapobjects\scavenger\alienlight.md3 -file4=<>\STVEFPack\models\mapobjects\scavenger\alienlight_d1.md3 -file5=<>\STVEFPack\models\mapobjects\scavenger\camera.md3 -file6=<>\STVEFPack\models\mapobjects\scavenger\card2.md3 -file7=<>\STVEFPack\models\mapobjects\scavenger\card3.md3 -file8=<>\STVEFPack\models\mapobjects\scavenger\card4.md3 -file9=<>\STVEFPack\models\mapobjects\scavenger\card.md3 -file10=<>\STVEFPack\models\mapobjects\scavenger\cards.md3 -file11=<>\STVEFPack\models\mapobjects\scavenger\cchair.md3 -file12=<>\STVEFPack\models\mapobjects\scavenger\chessboard.md3 -file13=<>\STVEFPack\models\mapobjects\scavenger\chessboard_d1.md3 -file14=<>\STVEFPack\models\mapobjects\scavenger\dcrystal.md3 -file15=<>\STVEFPack\models\mapobjects\scavenger\deadplant2.md3 -file16=<>\STVEFPack\models\mapobjects\scavenger\deadplant2_d1.md3 -file17=<>\STVEFPack\models\mapobjects\scavenger\deadplant.md3 -file18=<>\STVEFPack\models\mapobjects\scavenger\deadplant_d1.md3 -file19=<>\STVEFPack\models\mapobjects\scavenger\galileo.md3 -file20=<>\STVEFPack\models\mapobjects\scavenger\h_control.md3 -file21=<>\STVEFPack\models\mapobjects\scavenger\hypospray.md3 -file22=<>\STVEFPack\models\mapobjects\scavenger\hypospray_r.md3 -file23=<>\STVEFPack\models\mapobjects\scavenger\hypostack_b.md3 -file24=<>\STVEFPack\models\mapobjects\scavenger\hypostack_r.md3 -file25=<>\STVEFPack\models\mapobjects\scavenger\iso.md3 -file26=<>\STVEFPack\models\mapobjects\scavenger\k_barrel.md3 -file27=<>\STVEFPack\models\mapobjects\scavenger\k_chair1.md3 -file28=<>\STVEFPack\models\mapobjects\scavenger\k_chair2.md3 -file29=<>\STVEFPack\models\mapobjects\scavenger\k_crate.md3 -file30=<>\STVEFPack\models\mapobjects\scavenger\k_cup.md3 -file31=<>\STVEFPack\models\mapobjects\scavenger\k_plate.md3 -file32=<>\STVEFPack\models\mapobjects\scavenger\laundry.md3 -file33=<>\STVEFPack\models\mapobjects\scavenger\laundry_boots.md3 -file34=<>\STVEFPack\models\mapobjects\scavenger\laundry_f.md3 -file35=<>\STVEFPack\models\mapobjects\scavenger\m_tank.md3 -file36=<>\STVEFPack\models\mapobjects\scavenger\m_tank_d1.md3 -file37=<>\STVEFPack\models\mapobjects\scavenger\malon_hanging.md3 -file38=<>\STVEFPack\models\mapobjects\scavenger\matt.md3 -file39=<>\STVEFPack\models\mapobjects\scavenger\power_up2.md3 -file40=<>\STVEFPack\models\mapobjects\scavenger\power_up.md3 -file41=<>\STVEFPack\models\mapobjects\scavenger\sc_chair1.md3 -file42=<>\STVEFPack\models\mapobjects\scavenger\sc_chair1_d1.md3 -file43=<>\STVEFPack\models\mapobjects\scavenger\sc_handle.md3 -file44=<>\STVEFPack\models\mapobjects\scavenger\sc_monitor.md3 -file45=<>\STVEFPack\models\mapobjects\scavenger\sc_monitor_d1.md3 -file46=<>\STVEFPack\models\mapobjects\scavenger\sc_scanner.md3 -file47=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing1.md3 -file48=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing1_d1.md3 -file49=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing2.md3 -file50=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing2_d1.md3 -file51=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing3.md3 -file52=<>\STVEFPack\models\mapobjects\scavenger\sc_wallthing3_d1.md3 -file53=<>\STVEFPack\models\mapobjects\scavenger\tank.md3 -file54=<>\STVEFPack\models\mapobjects\scavenger\testtube.md3 -file55=<>\STVEFPack\models\mapobjects\scavenger\toolbox.md3 -file56=<>\STVEFPack\models\mapobjects\scavenger\toolbox_d1.md3 -file57=<>\STVEFPack\models\mapobjects\scavenger\vermin.md3 -file58=<>\STVEFPack\models\mapobjects\scavenger\wallpipe.md3 -file59=<>\STVEFPack\models\mapobjects\scavenger\wallpipe_d1.md3 - -[models\mapobjects\podium] -fulldirectory= -file0=<>\STVEFPack\models\mapobjects\podium\podium_single.md3 -file1=<>\STVEFPack\models\mapobjects\podium\hm_room.md3 -file2=<>\STVEFPack\models\mapobjects\podium\podium4.md3 - -[scripts] -fulldirectory= -file0=<>\STVEFPack\Scripts\weapons.shader -file1=<>\STVEFPack\Scripts\borg.shader -file2=<>\STVEFPack\Scripts\common.shader -file3=<>\STVEFPack\Scripts\ctf2.shader -file4=<>\STVEFPack\Scripts\ctf.shader -file5=<>\STVEFPack\Scripts\damagedvoyager.shader -file6=<>\STVEFPack\Scripts\decals.shader -file7=<>\STVEFPack\Scripts\dreadnought3.shader -file8=<>\STVEFPack\Scripts\effects.shader -file9=<>\STVEFPack\Scripts\engineering.shader -file10=<>\STVEFPack\Scripts\explosions.shader -file11=<>\STVEFPack\Scripts\forge.shader -file12=<>\STVEFPack\Scripts\gfx.shader -file13=<>\STVEFPack\Scripts\holodeck_temple.shader -file14=<>\STVEFPack\Scripts\holodeck_training.shader -file15=<>\STVEFPack\Scripts\menu.shader -file16=<>\STVEFPack\Scripts\mg.shader -file17=<>\STVEFPack\Scripts\scavenger.shader -file18=<>\STVEFPack\Scripts\shaderlist.txt -file19=<>\STVEFPack\Scripts\Stasis.shader -file20=<>\STVEFPack\Scripts\STModels.shader -file21=<>\STVEFPack\Scripts\transporter.shader -file22=<>\STVEFPack\Scripts\voyager.shader -file23=<>\STVEFPack\scripts\sp_entities.def -file24=<>\STVEFPack\scripts\hm_entities.def -file25=<>\STVEFPack\scripts\default_project.proj - diff --git a/setup/win32/template/File Groups/Shader Manual Files.fgl b/setup/win32/template/File Groups/Shader Manual Files.fgl deleted file mode 100644 index 54298602..00000000 --- a/setup/win32/template/File Groups/Shader Manual Files.fgl +++ /dev/null @@ -1,56 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Q3AShader_Manual - -[Q3AShader_Manual] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\index.htm -SubDir0=Q3AShader_Manual\ch01 -SubDir1=Q3AShader_Manual\ch02 -SubDir2=Q3AShader_Manual\ch03 -SubDir3=Q3AShader_Manual\ch04 -SubDir4=Q3AShader_Manual\ch05 -SubDir5=Q3AShader_Manual\ch06 -SubDir6=Q3AShader_Manual\q3ashader_manual_files -SubDir7=Q3AShader_Manual\styles -SubDir8=Q3AShader_Manual\appendix - -[Q3AShader_Manual\ch01] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch01 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch01\pg1_1.htm - -[Q3AShader_Manual\ch02] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch02 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch02\pg2_1.htm - -[Q3AShader_Manual\ch03] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch03 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch03\pg3_1.htm - -[Q3AShader_Manual\ch04] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch04 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch04\pg4_1.htm - -[Q3AShader_Manual\ch05] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch05 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch05\pg5_1.htm - -[Q3AShader_Manual\ch06] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch06 -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\ch06\pg6_1.htm - -[Q3AShader_Manual\q3ashader_manual_files] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\q3ashader_manual_files -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\q3ashader_manual_files\image002.jpg - -[Q3AShader_Manual\styles] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\styles -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\styles\q3rad.css - -[Q3AShader_Manual\appendix] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\appendix -file0=<>\GtkRadiant\docs\manual\quake3\Q3AShader_Manual\appendix\appA.html - diff --git a/setup/win32/template/File Groups/TA Manual Files.fgl b/setup/win32/template/File Groups/TA Manual Files.fgl deleted file mode 100644 index 07c17051..00000000 --- a/setup/win32/template/File Groups/TA Manual Files.fgl +++ /dev/null @@ -1,37 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Team_Arena_Mapping_Help - -[Team_Arena_Mapping_Help] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help -file0=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\start.html -SubDir0=Team_Arena_Mapping_Help\pages -SubDir1=Team_Arena_Mapping_Help\pics - -[Team_Arena_Mapping_Help\pages] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages -file0=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\design_tips.html -file1=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\map_converters_checklist.html -file2=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\preface.html -file3=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\related_links.html -file4=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\table_of_contents.htm -file5=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\ta_game_types.html -file6=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\team_arena_entity_definitions.html -file7=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\team_arena_prefabs.html -file8=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\team_powerup_bases.html -file9=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pages\using_new_game_entities.html - -[Team_Arena_Mapping_Help\pics] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics -file0=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\CRUSADER.gif -file1=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\INTRUDER.gif -file2=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\logo.gif -file3=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\MAINPOP.gif -file4=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\MENUBACKgif.gif -file5=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\PAGANs.gif -file6=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\STROGGS.gif -file7=<>\GtkRadiant\docs\manual\quake3\Team_Arena_Mapping_Help\pics\THEFALLEN.gif - diff --git a/setup/win32/template/File Groups/TA Sample Files.fgl b/setup/win32/template/File Groups/TA Sample Files.fgl deleted file mode 100644 index 6dfa9470..00000000 --- a/setup/win32/template/File Groups/TA Sample Files.fgl +++ /dev/null @@ -1,87 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\GtkRadiant\setup\data\missionpack\mapmedia-TA.pk3 -file1=<>\GtkRadiant\setup\data\missionpack\terrademo-README.txt -SubDir0=models -SubDir1=scripts -SubDir2=maps -SubDir3=textures - -[models] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\models -SubDir0=models\mapobjects - -[models\mapobjects] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\models\mapobjects -SubDir0=models\mapobjects\spawn - -[models\mapobjects\spawn] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\models\mapobjects\spawn -file0=<>\GtkRadiant\setup\data\missionpack\models\mapobjects\spawn\spawn.md3 -file1=<>\GtkRadiant\setup\data\missionpack\models\mapobjects\spawn\spawn_r.md3 - -[scripts] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\scripts -file0=<>\GtkRadiant\setup\data\missionpack\scripts\base_floor.shader -file1=<>\GtkRadiant\setup\data\missionpack\scripts\base_floor2.shader -file2=<>\GtkRadiant\setup\data\missionpack\scripts\base_light.shader -file3=<>\GtkRadiant\setup\data\missionpack\scripts\base_wall.shader -file4=<>\GtkRadiant\setup\data\missionpack\scripts\base_wall2.shader -file5=<>\GtkRadiant\setup\data\missionpack\scripts\common.shader -file6=<>\GtkRadiant\setup\data\missionpack\scripts\ctf.shader -file7=<>\GtkRadiant\setup\data\missionpack\scripts\ctf2.shader -file8=<>\GtkRadiant\setup\data\missionpack\scripts\gothic_trim.shader -file9=<>\GtkRadiant\setup\data\missionpack\scripts\gothic_wall.shader -file10=<>\GtkRadiant\setup\data\missionpack\scripts\liquids.shader -file11=<>\GtkRadiant\setup\data\missionpack\scripts\liquids2.shader -file12=<>\GtkRadiant\setup\data\missionpack\scripts\museum.shader -file13=<>\GtkRadiant\setup\data\missionpack\scripts\proto2.shader -file14=<>\GtkRadiant\setup\data\missionpack\scripts\sfx.shader -file15=<>\GtkRadiant\setup\data\missionpack\scripts\sfx2.shader -file16=<>\GtkRadiant\setup\data\missionpack\scripts\skies.shader -file17=<>\GtkRadiant\setup\data\missionpack\scripts\skies2.shader -file18=<>\GtkRadiant\setup\data\missionpack\scripts\stone2.shader -file19=<>\GtkRadiant\setup\data\missionpack\scripts\team.shader -file20=<>\GtkRadiant\setup\data\missionpack\scripts\terrain.shader -file21=<>\GtkRadiant\setup\data\missionpack\scripts\tim.shader -file22=<>\GtkRadiant\setup\data\missionpack\scripts\entities-ta.def - -[maps] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\maps -file0=<>\GtkRadiant\setup\data\missionpack\maps\terrademo.map -SubDir0=maps\Team Arena Prefabs - -[maps\Team Arena Prefabs] -fulldirectory=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs -file0=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\armorpad_blue.pfb -file1=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\armorpad_neutral.pfb -file2=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\armorpad_red.pfb -file3=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\TA_banner_blue.pfb -file4=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\TA_banner_red.pfb -file5=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\weaponpad_blue.pfb -file6=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\weaponpad_neutral.pfb -file7=<>\GtkRadiant\setup\data\missionpack\maps\Team Arena Prefabs\weaponpad_red.pfb - -[textures] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\textures -SubDir0=textures\proto2 -SubDir1=textures\skies2 -SubDir2=textures\stone - -[textures\proto2] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\textures\proto2 -file0=<>\GtkRadiant\setup\data\baseq3\textures\proto2\pj_terralpha01.pcx - -[textures\skies2] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\textures\skies2 -file0=<>\GtkRadiant\setup\data\baseq3\textures\skies2\clouds.tga - -[textures\stone] -fulldirectory=<>\GtkRadiant\setup\data\baseq3\textures\stone -file0=<>\GtkRadiant\setup\data\baseq3\textures\stone\pjrock10b_2.tga -file1=<>\GtkRadiant\setup\data\baseq3\textures\stone\pjrock12b_2.tga -file2=<>\GtkRadiant\setup\data\baseq3\textures\stone\pjrock9b_2.tga - diff --git a/setup/win32/template/File Groups/TA Teams Manual.fgl b/setup/win32/template/File Groups/TA Teams Manual.fgl deleted file mode 100644 index f095fd45..00000000 --- a/setup/win32/template/File Groups/TA Teams Manual.fgl +++ /dev/null @@ -1,11 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=New_Teams_For_Q3TA - -[New_Teams_For_Q3TA] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\New_Teams_For_Q3TA -file0=<>\GtkRadiant\docs\manual\quake3\New_Teams_For_Q3TA\index.html - diff --git a/setup/win32/template/File Groups/Terrain Manual Files.fgl b/setup/win32/template/File Groups/Terrain Manual Files.fgl deleted file mode 100644 index fe97ef3c..00000000 --- a/setup/win32/template/File Groups/Terrain Manual Files.fgl +++ /dev/null @@ -1,53 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=Terrain_Manual - -[Terrain_Manual] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual -file0=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\start.html -SubDir0=Terrain_Manual\pages -SubDir1=Terrain_Manual\pics - -[Terrain_Manual\pages] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages -file0=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\adding_bots.html -file1=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\adding_buildings_to_terrain.html -file2=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\art_tools.html -file3=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\blocking_vis.html -file4=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\boxing_in_the_world.html -file5=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\clipping_the_terrain.html -file6=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\creating_the_alphamap.html -file7=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\creating_the_terrain.html -file8=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\entity_keys_and_values.html -file9=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\glossary.html -file10=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\height_maps.html -file11=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\height_map_into_terrain_mesh.html -file12=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\Image3.gif -file13=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\Image4.gif -file14=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\Image5.gif -file15=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\Image6.gif -file16=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\introduction.html -file17=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\key_changes.html -file18=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\lighting_the_terrain.html -file19=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\manipulating_the_terrain_mesh.html -file20=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\mapping_the_textures.html -file21=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\new_or_revised_q3map_shader_comm.html -file22=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\other_possible_height_map_tools.html -file23=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\related_links.html -file24=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\suggested_gensurf_settings.html -file25=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\table_of_contents.html -file26=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\terrain_entity.html -file27=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\terrain_mesh_into_terrain_entity.html -file28=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\terrain_related_worldspawn_features.html -file29=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\terrain_texture.html -file30=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pages\the_meta_shader.html - -[Terrain_Manual\pics] -fulldirectory=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pics -file0=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pics\background.jpg -file1=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pics\start.gif -file2=<>\GtkRadiant\docs\manual\quake3\Terrain_Manual\pics\terrain.jpg - diff --git a/setup/win32/template/File Groups/TexTool Help.fgl b/setup/win32/template/File Groups/TexTool Help.fgl deleted file mode 100644 index 2672d46c..00000000 --- a/setup/win32/template/File Groups/TexTool Help.fgl +++ /dev/null @@ -1,12 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=TexToolHelp - -[TexToolHelp] -fulldirectory= -file0=<>\GtkRadiant\plugins\textool\Doc\Image2.jpg -file1=<>\GtkRadiant\plugins\textool\Doc\TexTool.html - diff --git a/setup/win32/template/File Groups/Wolf Exectuable Files.fgl b/setup/win32/template/File Groups/Wolf Exectuable Files.fgl deleted file mode 100644 index 265cafe3..00000000 --- a/setup/win32/template/File Groups/Wolf Exectuable Files.fgl +++ /dev/null @@ -1,31 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\WolfPack\bin\aascfg_lg.c -file1=<>\WolfPack\bin\aascfg_sm.c -file2=<>\WolfPack\bin\bspc.ai -file3=<>\WolfPack\bin\bspc.exe -file4=<>\WolfPack\bin\roq.exe -file5=<>\WolfPack\game.xlink -file6=<>\WolfPack\synapse.config -SubDir0=modules -SubDir1=docs - -[modules] -fulldirectory= - -[docs] -fulldirectory= -file0=<>\WolfPack\docs\scripting_definitions.htm -SubDir0=docs\GtkRadiant_WOLF_HOWTO - -[docs\GtkRadiant_WOLF_HOWTO] -fulldirectory= -file0=<>\WolfPack\docs\GtkRadiant_WOLF_HOWTO\game2.png -file1=<>\WolfPack\docs\GtkRadiant_WOLF_HOWTO\game1.png -file2=<>\WolfPack\docs\GtkRadiant_WOLF_HOWTO\index.html -file3=<>\WolfPack\docs\GtkRadiant_WOLF_HOWTO\monitor.png -file4=<>\WolfPack\docs\GtkRadiant_WOLF_HOWTO\project.png - diff --git a/setup/win32/template/File Groups/Wolf Media Files.fgl b/setup/win32/template/File Groups/Wolf Media Files.fgl deleted file mode 100644 index 383de651..00000000 --- a/setup/win32/template/File Groups/Wolf Media Files.fgl +++ /dev/null @@ -1,1046 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -file0=<>\WolfPack\common-astro-spog.pk3 -file1=<>\WolfPack\astro-skies.pk3 -file2=<>\WolfPack\lights.pk3 -SubDir0=scripts -SubDir1=maps -SubDir2=models - -[scripts] -fulldirectory= -file0=<>\WolfPack\scripts\shaderlist.txt -file1=<>\WolfPack\scripts\wolf_entities.def -file2=<>\WolfPack\scripts\alpha.shader -file3=<>\WolfPack\scripts\assault.shader -file4=<>\WolfPack\scripts\awf_props.shader -file5=<>\WolfPack\scripts\b-25.shader -file6=<>\WolfPack\scripts\blimp.shader -file7=<>\WolfPack\scripts\castle_door.shader -file8=<>\WolfPack\scripts\castle_floor.shader -file9=<>\WolfPack\scripts\castle_props.shader -file10=<>\WolfPack\scripts\castle_window.shader -file11=<>\WolfPack\scripts\castle_wood.shader -file12=<>\WolfPack\scripts\cathedrale_wall.shader -file13=<>\WolfPack\scripts\chat.shader -file14=<>\WolfPack\scripts\chateau.shader -file15=<>\WolfPack\scripts\common.shader -file16=<>\WolfPack\scripts\decals.shader -file17=<>\WolfPack\scripts\doors.shader -file18=<>\WolfPack\scripts\graveyard.shader -file19=<>\WolfPack\scripts\lights.shader -file20=<>\WolfPack\scripts\liquids.shader -file21=<>\WolfPack\scripts\metal_misc.shader -file22=<>\WolfPack\scripts\miltary_door.shader -file23=<>\WolfPack\scripts\miltary_floor.shader -file24=<>\WolfPack\scripts\miltary_wall.shader -file25=<>\WolfPack\scripts\models.shader -file26=<>\WolfPack\scripts\props.shader -file27=<>\WolfPack\scripts\rock.shader -file28=<>\WolfPack\scripts\rubble.shader -file29=<>\WolfPack\scripts\sfx.shader -file30=<>\WolfPack\scripts\skies.shader -file31=<>\WolfPack\scripts\snow.shader -file32=<>\WolfPack\scripts\stone.shader -file33=<>\WolfPack\scripts\swf.shader -file34=<>\WolfPack\scripts\terrain.shader -file35=<>\WolfPack\scripts\training.shader -file36=<>\WolfPack\scripts\tree.shader -file37=<>\WolfPack\scripts\village.shader -file38=<>\WolfPack\scripts\windows.shader -file39=<>\WolfPack\scripts\wood.shader -file40=<>\WolfPack\scripts\xlab_door.shader -file41=<>\WolfPack\scripts\xlab_props.shader -file42=<>\WolfPack\scripts\xlab_wall.shader -file43=<>\WolfPack\scripts\quakev3.qe4 -file44=<>\WolfPack\scripts\walls.shader -file45=<>\WolfPack\scripts\town_wood.shader -file46=<>\WolfPack\scripts\town_props.shader -file47=<>\WolfPack\scripts\town_roof.shader -file48=<>\WolfPack\scripts\town_wall.shader -file49=<>\WolfPack\scripts\town_window.shader -file50=<>\WolfPack\scripts\default_project.proj - -[maps] -fulldirectory= -file0=<>\WolfPack\maps\mp_beach_alpha.tga -file1=<>\WolfPack\maps\escape1.map -file2=<>\WolfPack\maps\escape1.script -file3=<>\WolfPack\maps\escape1_alpha.tga -file4=<>\WolfPack\maps\escape2.ai -file5=<>\WolfPack\maps\escape2.map -file6=<>\WolfPack\maps\escape2.script -file7=<>\WolfPack\maps\mp_beach.map -file8=<>\WolfPack\maps\mp_beach.script -file9=<>\WolfPack\maps\escape1.ai - -[models] -fulldirectory= -SubDir0=models\mapobjects - -[models\mapobjects] -fulldirectory= -SubDir0=models\mapobjects\apoth -SubDir1=models\mapobjects\archeology -SubDir2=models\mapobjects\b-25 -SubDir3=models\mapobjects\barbwire -SubDir4=models\mapobjects\bat -SubDir5=models\mapobjects\bjui -SubDir6=models\mapobjects\bodyparts -SubDir7=models\mapobjects\book -SubDir8=models\mapobjects\boxes -SubDir9=models\mapobjects\bush -SubDir10=models\mapobjects\chandelier -SubDir11=models\mapobjects\clipboard -SubDir12=models\mapobjects\clonetube -SubDir13=models\mapobjects\coat -SubDir14=models\mapobjects\coffin -SubDir15=models\mapobjects\corpse -SubDir16=models\mapobjects\curtain -SubDir17=models\mapobjects\deadosa -SubDir18=models\mapobjects\debris -SubDir19=models\mapobjects\door -SubDir20=models\mapobjects\electronics -SubDir21=models\mapobjects\end -SubDir22=models\mapobjects\eye -SubDir23=models\mapobjects\firehead -SubDir24=models\mapobjects\flag -SubDir25=models\mapobjects\furniture -SubDir26=models\mapobjects\gargoyle -SubDir27=models\mapobjects\gears -SubDir28=models\mapobjects\generator -SubDir29=models\mapobjects\goblet -SubDir30=models\mapobjects\ironmaiden -SubDir31=models\mapobjects\jetengine -SubDir32=models\mapobjects\knight -SubDir33=models\mapobjects\lamps -SubDir34=models\mapobjects\leaf -SubDir35=models\mapobjects\letters -SubDir36=models\mapobjects\light -SubDir37=models\mapobjects\lion -SubDir38=models\mapobjects\lop -SubDir39=models\mapobjects\miltary_trim -SubDir40=models\mapobjects\nazi -SubDir41=models\mapobjects\parachute -SubDir42=models\mapobjects\piano -SubDir43=models\mapobjects\plants -SubDir44=models\mapobjects\punchingbag -SubDir45=models\mapobjects\sawblade -SubDir46=models\mapobjects\sfx -SubDir47=models\mapobjects\shadtest -SubDir48=models\mapobjects\shield -SubDir49=models\mapobjects\size -SubDir50=models\mapobjects\skel -SubDir51=models\mapobjects\skull -SubDir52=models\mapobjects\sky -SubDir53=models\mapobjects\space -SubDir54=models\mapobjects\toolshed -SubDir55=models\mapobjects\torture -SubDir56=models\mapobjects\tree -SubDir57=models\mapobjects\tree_snow -SubDir58=models\mapobjects\ubergun -SubDir59=models\mapobjects\ui -SubDir60=models\mapobjects\undead -SubDir61=models\mapobjects\v2 -SubDir62=models\mapobjects\vacum -SubDir63=models\mapobjects\vehicles -SubDir64=models\mapobjects\watertower -SubDir65=models\mapobjects\weapons -SubDir66=models\mapobjects\wine -SubDir67=models\mapobjects\xlab -SubDir68=models\mapobjects\xlab_props -SubDir69=models\mapobjects\zemph -SubDir70=models\mapobjects\zombie - -[models\mapobjects\apoth] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\apoth\wired1.md3 - -[models\mapobjects\archeology] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\archeology\vessel.md3 -file1=<>\WolfPack\models\mapobjects\archeology\pitcher.md3 -file2=<>\WolfPack\models\mapobjects\archeology\vase1.md3 -file3=<>\WolfPack\models\mapobjects\archeology\vase2.md3 -file4=<>\WolfPack\models\mapobjects\archeology\vase3.md3 -file5=<>\WolfPack\models\mapobjects\archeology\vase4.md3 -file6=<>\WolfPack\models\mapobjects\archeology\vase5.md3 -file7=<>\WolfPack\models\mapobjects\archeology\obelisk.md3 - -[models\mapobjects\b-25] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\b-25\wires.md3 -file1=<>\WolfPack\models\mapobjects\b-25\door.md3 -file2=<>\WolfPack\models\mapobjects\b-25\ext_25.md3 -file3=<>\WolfPack\models\mapobjects\b-25\exterior.md3 -file4=<>\WolfPack\models\mapobjects\b-25\floor_cockpit.md3 -file5=<>\WolfPack\models\mapobjects\b-25\fuse1.md3 -file6=<>\WolfPack\models\mapobjects\b-25\fuse1a.md3 -file7=<>\WolfPack\models\mapobjects\b-25\fuse2.md3 -file8=<>\WolfPack\models\mapobjects\b-25\fuse2a.md3 -file9=<>\WolfPack\models\mapobjects\b-25\fuse3.md3 -file10=<>\WolfPack\models\mapobjects\b-25\fuse4.md3 -file11=<>\WolfPack\models\mapobjects\b-25\fuse5.md3 -file12=<>\WolfPack\models\mapobjects\b-25\fuse6.md3 -file13=<>\WolfPack\models\mapobjects\b-25\fuse7.md3 -file14=<>\WolfPack\models\mapobjects\b-25\glass.md3 -file15=<>\WolfPack\models\mapobjects\b-25\hatch.md3 -file16=<>\WolfPack\models\mapobjects\b-25\interior.md3 -file17=<>\WolfPack\models\mapobjects\b-25\main_hatch.md3 -file18=<>\WolfPack\models\mapobjects\b-25\nose1.md3 -file19=<>\WolfPack\models\mapobjects\b-25\nose1A.md3 -file20=<>\WolfPack\models\mapobjects\b-25\sawingspan.md3 -file21=<>\WolfPack\models\mapobjects\b-25\stringers.md3 -file22=<>\WolfPack\models\mapobjects\b-25\stringers1.md3 -file23=<>\WolfPack\models\mapobjects\b-25\stringers2.md3 -file24=<>\WolfPack\models\mapobjects\b-25\tail.md3 -file25=<>\WolfPack\models\mapobjects\b-25\tail_ext.md3 -file26=<>\WolfPack\models\mapobjects\b-25\wing_port.md3 -file27=<>\WolfPack\models\mapobjects\b-25\wing_starboard.md3 -file28=<>\WolfPack\models\mapobjects\b-25\wingspan.md3 -file29=<>\WolfPack\models\mapobjects\b-25\divider.md3 - -[models\mapobjects\barbwire] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\barbwire\danwire.md3 -file1=<>\WolfPack\models\mapobjects\barbwire\barbwire.md3 - -[models\mapobjects\bat] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\bat\bat.md3 - -[models\mapobjects\bjui] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\bjui\bjui_c.md3 -file1=<>\WolfPack\models\mapobjects\bjui\bjui_b.md3 -file2=<>\WolfPack\models\mapobjects\bjui\bjui.md3 - -[models\mapobjects\bodyparts] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\bodyparts\zomtorso.md3 -file1=<>\WolfPack\models\mapobjects\bodyparts\doa.md3 -file2=<>\WolfPack\models\mapobjects\bodyparts\helarm.md3 -file3=<>\WolfPack\models\mapobjects\bodyparts\helbody.md3 -file4=<>\WolfPack\models\mapobjects\bodyparts\helhand.md3 -file5=<>\WolfPack\models\mapobjects\bodyparts\helhead.md3 -file6=<>\WolfPack\models\mapobjects\bodyparts\l_arm.md3 -file7=<>\WolfPack\models\mapobjects\bodyparts\l_chest.md3 -file8=<>\WolfPack\models\mapobjects\bodyparts\l_engine.md3 -file9=<>\WolfPack\models\mapobjects\bodyparts\l_head.md3 -file10=<>\WolfPack\models\mapobjects\bodyparts\leg.md3 -file11=<>\WolfPack\models\mapobjects\bodyparts\legpelvis.md3 -file12=<>\WolfPack\models\mapobjects\bodyparts\legside.md3 -file13=<>\WolfPack\models\mapobjects\bodyparts\naziarm.md3 -file14=<>\WolfPack\models\mapobjects\bodyparts\nazitorso.md3 -file15=<>\WolfPack\models\mapobjects\bodyparts\torso.md3 -file16=<>\WolfPack\models\mapobjects\bodyparts\zom_loog.md3 -file17=<>\WolfPack\models\mapobjects\bodyparts\zomarm.md3 -file18=<>\WolfPack\models\mapobjects\bodyparts\deadnazi.md3 - -[models\mapobjects\book] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\book\book.md3 - -[models\mapobjects\boxes] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\boxes\box64.md3 -file1=<>\WolfPack\models\mapobjects\boxes\box48.md3 -file2=<>\WolfPack\models\mapobjects\boxes\box32.md3 - -[models\mapobjects\bush] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\bush\hedge.md3 -file1=<>\WolfPack\models\mapobjects\bush\bu.md3 - -[models\mapobjects\chandelier] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\chandelier\chandlier_new.md3 -file1=<>\WolfPack\models\mapobjects\chandelier\chandelier_lt.md3 -file2=<>\WolfPack\models\mapobjects\chandelier\chandelier_lt_sm.md3 -file3=<>\WolfPack\models\mapobjects\chandelier\chandelier.md3 - -[models\mapobjects\clipboard] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\clipboard\clipboard_v.md3 -file1=<>\WolfPack\models\mapobjects\clipboard\clipboard_h.md3 - -[models\mapobjects\clonetube] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\clonetube\clone.md3 - -[models\mapobjects\coat] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\coat\coat.md3 - -[models\mapobjects\coffin] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\coffin\coffin.md3 - -[models\mapobjects\corpse] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\corpse\legbroke.md3 -file1=<>\WolfPack\models\mapobjects\corpse\bone2.md3 -file2=<>\WolfPack\models\mapobjects\corpse\bone3.md3 -file3=<>\WolfPack\models\mapobjects\corpse\bone4.md3 -file4=<>\WolfPack\models\mapobjects\corpse\corpse.md3 -file5=<>\WolfPack\models\mapobjects\corpse\leg.md3 -file6=<>\WolfPack\models\mapobjects\corpse\bone1.md3 - -[models\mapobjects\curtain] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\curtain\curtain_direct.md3 -file1=<>\WolfPack\models\mapobjects\curtain\2curt_lghtwindB.md3 -file2=<>\WolfPack\models\mapobjects\curtain\2curtains_96.md3 -file3=<>\WolfPack\models\mapobjects\curtain\curtain.md3 -file4=<>\WolfPack\models\mapobjects\curtain\curtain_200.md3 -file5=<>\WolfPack\models\mapobjects\curtain\2curt_lghtwind.md3 - -[models\mapobjects\deadosa] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\deadosa\deadosa_new.md3 -file1=<>\WolfPack\models\mapobjects\deadosa\deadosa.md3 - -[models\mapobjects\debris] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\debris\woodxl.md3 -file1=<>\WolfPack\models\mapobjects\debris\boulder2.md3 -file2=<>\WolfPack\models\mapobjects\debris\boulder3.md3 -file3=<>\WolfPack\models\mapobjects\debris\brick1.md3 -file4=<>\WolfPack\models\mapobjects\debris\brick2.md3 -file5=<>\WolfPack\models\mapobjects\debris\brick3.md3 -file6=<>\WolfPack\models\mapobjects\debris\brick4.md3 -file7=<>\WolfPack\models\mapobjects\debris\brick5.md3 -file8=<>\WolfPack\models\mapobjects\debris\brick6.md3 -file9=<>\WolfPack\models\mapobjects\debris\bricksm.md3 -file10=<>\WolfPack\models\mapobjects\debris\brickxl.md3 -file11=<>\WolfPack\models\mapobjects\debris\fabric1.md3 -file12=<>\WolfPack\models\mapobjects\debris\fabric2.md3 -file13=<>\WolfPack\models\mapobjects\debris\fabric3.md3 -file14=<>\WolfPack\models\mapobjects\debris\personal1.md3 -file15=<>\WolfPack\models\mapobjects\debris\personal2.md3 -file16=<>\WolfPack\models\mapobjects\debris\personal3.md3 -file17=<>\WolfPack\models\mapobjects\debris\personal4.md3 -file18=<>\WolfPack\models\mapobjects\debris\personal5.md3 -file19=<>\WolfPack\models\mapobjects\debris\rubble1.md3 -file20=<>\WolfPack\models\mapobjects\debris\rubble2.md3 -file21=<>\WolfPack\models\mapobjects\debris\rubble3.md3 -file22=<>\WolfPack\models\mapobjects\debris\woodm.md3 -file23=<>\WolfPack\models\mapobjects\debris\woodsm.md3 -file24=<>\WolfPack\models\mapobjects\debris\boulder.md3 - -[models\mapobjects\door] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\door\slidingdoor.md3 -file1=<>\WolfPack\models\mapobjects\door\door.md3 - -[models\mapobjects\electronics] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\electronics\tuberadio_a.md3 -file1=<>\WolfPack\models\mapobjects\electronics\alarmbox.md3 -file2=<>\WolfPack\models\mapobjects\electronics\enigma.md3 -file3=<>\WolfPack\models\mapobjects\electronics\gramophone.md3 -file4=<>\WolfPack\models\mapobjects\electronics\gramophone_anim.md3 -file5=<>\WolfPack\models\mapobjects\electronics\loudspeaker.md3 -file6=<>\WolfPack\models\mapobjects\electronics\loudspeaker2.md3 -file7=<>\WolfPack\models\mapobjects\electronics\parloradio.md3 -file8=<>\WolfPack\models\mapobjects\electronics\phone.md3 -file9=<>\WolfPack\models\mapobjects\electronics\radar.md3 -file10=<>\WolfPack\models\mapobjects\electronics\radar_105.md3 -file11=<>\WolfPack\models\mapobjects\electronics\radar_90.md3 -file12=<>\WolfPack\models\mapobjects\electronics\radar_panel_blown.md3 -file13=<>\WolfPack\models\mapobjects\electronics\radar_panel_blown105.md3 -file14=<>\WolfPack\models\mapobjects\electronics\radar_panel_blown90.md3 -file15=<>\WolfPack\models\mapobjects\electronics\radio_port.md3 -file16=<>\WolfPack\models\mapobjects\electronics\radio1.md3 -file17=<>\WolfPack\models\mapobjects\electronics\radios.md3 -file18=<>\WolfPack\models\mapobjects\electronics\speaker.md3 -file19=<>\WolfPack\models\mapobjects\electronics\speaker_control.md3 -file20=<>\WolfPack\models\mapobjects\electronics\tesla_prod.md3 -file21=<>\WolfPack\models\mapobjects\electronics\3radios.md3 - -[models\mapobjects\end] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\end\castle.md3 - -[models\mapobjects\eye] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\eye\eye.md3 - -[models\mapobjects\firehead] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\firehead\kid.md3 - -[models\mapobjects\flag] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\flag\uibanner2.md3 -file1=<>\WolfPack\models\mapobjects\flag\banner1.md3 -file2=<>\WolfPack\models\mapobjects\flag\british.md3 -file3=<>\WolfPack\models\mapobjects\flag\flag.md3 -file4=<>\WolfPack\models\mapobjects\flag\flag_americanui.md3 -file5=<>\WolfPack\models\mapobjects\flag\flag_escape.md3 -file6=<>\WolfPack\models\mapobjects\flag\flag_larg.md3 -file7=<>\WolfPack\models\mapobjects\flag\flag_med.md3 -file8=<>\WolfPack\models\mapobjects\flag\flag_naziui.md3 -file9=<>\WolfPack\models\mapobjects\flag\flag01.md3 -file10=<>\WolfPack\models\mapobjects\flag\flag1a.md3 -file11=<>\WolfPack\models\mapobjects\flag\flag1b.md3 -file12=<>\WolfPack\models\mapobjects\flag\flag1c.md3 -file13=<>\WolfPack\models\mapobjects\flag\uibanner.md3 -file14=<>\WolfPack\models\mapobjects\flag\american.md3 - -[models\mapobjects\furniture] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\furniture\type.md3 -file1=<>\WolfPack\models\mapobjects\furniture\bench.md3 -file2=<>\WolfPack\models\mapobjects\furniture\bkshelfsm.md3 -file3=<>\WolfPack\models\mapobjects\furniture\bkshelfxl.md3 -file4=<>\WolfPack\models\mapobjects\furniture\bunks.md3 -file5=<>\WolfPack\models\mapobjects\furniture\candelabra_sm.md3 -file6=<>\WolfPack\models\mapobjects\furniture\candelabra_xl.md3 -file7=<>\WolfPack\models\mapobjects\furniture\castletable1.md3 -file8=<>\WolfPack\models\mapobjects\furniture\cbkshelfsm.md3 -file9=<>\WolfPack\models\mapobjects\furniture\cbkshelfxl.md3 -file10=<>\WolfPack\models\mapobjects\furniture\chandelier.md3 -file11=<>\WolfPack\models\mapobjects\furniture\chat_armchair.md3 -file12=<>\WolfPack\models\mapobjects\furniture\chat_chair.md3 -file13=<>\WolfPack\models\mapobjects\furniture\chat_couch.md3 -file14=<>\WolfPack\models\mapobjects\furniture\chat_endtable.md3 -file15=<>\WolfPack\models\mapobjects\furniture\chat_table_sm.md3 -file16=<>\WolfPack\models\mapobjects\furniture\chat_walltable.md3 -file17=<>\WolfPack\models\mapobjects\furniture\churchair.md3 -file18=<>\WolfPack\models\mapobjects\furniture\churchtable.md3 -file19=<>\WolfPack\models\mapobjects\furniture\churchutch.md3 -file20=<>\WolfPack\models\mapobjects\furniture\clubchair.md3 -file21=<>\WolfPack\models\mapobjects\furniture\cuckoo.md3 -file22=<>\WolfPack\models\mapobjects\furniture\cup.md3 -file23=<>\WolfPack\models\mapobjects\furniture\director_chair.md3 -file24=<>\WolfPack\models\mapobjects\furniture\eagleflag.md3 -file25=<>\WolfPack\models\mapobjects\furniture\eaglestand.md3 -file26=<>\WolfPack\models\mapobjects\furniture\faucet.md3 -file27=<>\WolfPack\models\mapobjects\furniture\floor_radio.md3 -file28=<>\WolfPack\models\mapobjects\furniture\footlocker.md3 -file29=<>\WolfPack\models\mapobjects\furniture\fptools.md3 -file30=<>\WolfPack\models\mapobjects\furniture\fptools_b.md3 -file31=<>\WolfPack\models\mapobjects\furniture\furnace.md3 -file32=<>\WolfPack\models\mapobjects\furniture\furnace1.md3 -file33=<>\WolfPack\models\mapobjects\furniture\globe.md3 -file34=<>\WolfPack\models\mapobjects\furniture\grandclock.md3 -file35=<>\WolfPack\models\mapobjects\furniture\heater.md3 -file36=<>\WolfPack\models\mapobjects\furniture\heinrichbust.md3 -file37=<>\WolfPack\models\mapobjects\furniture\heinrichsculptor.md3 -file38=<>\WolfPack\models\mapobjects\furniture\hitlerbust.md3 -file39=<>\WolfPack\models\mapobjects\furniture\locker_broken.md3 -file40=<>\WolfPack\models\mapobjects\furniture\loveseat.md3 -file41=<>\WolfPack\models\mapobjects\furniture\manacle.md3 -file42=<>\WolfPack\models\mapobjects\furniture\manacles.md3 -file43=<>\WolfPack\models\mapobjects\furniture\manacles_dark.md3 -file44=<>\WolfPack\models\mapobjects\furniture\metalchairgrid.md3 -file45=<>\WolfPack\models\mapobjects\furniture\metalshelf.md3 -file46=<>\WolfPack\models\mapobjects\furniture\plate1.md3 -file47=<>\WolfPack\models\mapobjects\furniture\plate2.md3 -file48=<>\WolfPack\models\mapobjects\furniture\plate3.md3 -file49=<>\WolfPack\models\mapobjects\furniture\sausage.md3 -file50=<>\WolfPack\models\mapobjects\furniture\sculptor.md3 -file51=<>\WolfPack\models\mapobjects\furniture\shelfxl.md3 -file52=<>\WolfPack\models\mapobjects\furniture\testchair.md3 -file53=<>\WolfPack\models\mapobjects\furniture\torture.md3 -file54=<>\WolfPack\models\mapobjects\furniture\beerstein.md3 - -[models\mapobjects\gargoyle] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\gargoyle\gargoyle.md3 - -[models\mapobjects\gears] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\gears\gear5.md3 -file1=<>\WolfPack\models\mapobjects\gears\gear2.md3 -file2=<>\WolfPack\models\mapobjects\gears\gear3.md3 -file3=<>\WolfPack\models\mapobjects\gears\gear4.md3 -file4=<>\WolfPack\models\mapobjects\gears\gear1.md3 - -[models\mapobjects\generator] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\generator\gen_sm.md3 -file1=<>\WolfPack\models\mapobjects\generator\gen.md3 -file2=<>\WolfPack\models\mapobjects\generator\gen_lrg.md3 -file3=<>\WolfPack\models\mapobjects\generator\gen_med.md3 -file4=<>\WolfPack\models\mapobjects\generator\expl_gen.md3 - -[models\mapobjects\goblet] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\goblet\chalice.md3 - -[models\mapobjects\ironmaiden] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\ironmaiden\maiden.md3 - -[models\mapobjects\jetengine] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\jetengine\jetengine.md3 - -[models\mapobjects\knight] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\knight\knight115.md3 -file1=<>\WolfPack\models\mapobjects\knight\knight_anim.md3 -file2=<>\WolfPack\models\mapobjects\knight\knight_anim2.md3 -file3=<>\WolfPack\models\mapobjects\knight\knight_anim3.md3 -file4=<>\WolfPack\models\mapobjects\knight\knight_stone.md3 -file5=<>\WolfPack\models\mapobjects\knight\knight.md3 - -[models\mapobjects\lamps] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\lamps\desklamp.md3 - -[models\mapobjects\leaf] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\leaf\leaf.md3 - -[models\mapobjects\letters] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\letters\type.md3 - -[models\mapobjects\light] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\light\worklamp_floor.md3 -file1=<>\WolfPack\models\mapobjects\light\bel_lamp_2k.md3 -file2=<>\WolfPack\models\mapobjects\light\bel_lamp_5k.md3 -file3=<>\WolfPack\models\mapobjects\light\bel_lamp_7k.md3 -file4=<>\WolfPack\models\mapobjects\light\bel_lamp_arm.md3 -file5=<>\WolfPack\models\mapobjects\light\bel_lamp_top.md3 -file6=<>\WolfPack\models\mapobjects\light\bel_lamp_top128.md3 -file7=<>\WolfPack\models\mapobjects\light\bel_lamp_top24.md3 -file8=<>\WolfPack\models\mapobjects\light\bel_lamp_top40.md3 -file9=<>\WolfPack\models\mapobjects\light\bel_lamp_top64.md3 -file10=<>\WolfPack\models\mapobjects\light\bel_lamp_top96.md3 -file11=<>\WolfPack\models\mapobjects\light\bel_lamp2.md3 -file12=<>\WolfPack\models\mapobjects\light\cagelight.md3 -file13=<>\WolfPack\models\mapobjects\light\cagelighta.md3 -file14=<>\WolfPack\models\mapobjects\light\cagelighta12k.md3 -file15=<>\WolfPack\models\mapobjects\light\cagelighta1k.md3 -file16=<>\WolfPack\models\mapobjects\light\cagelighta2k.md3 -file17=<>\WolfPack\models\mapobjects\light\cagelighta3k.md3 -file18=<>\WolfPack\models\mapobjects\light\cagelighta4k.md3 -file19=<>\WolfPack\models\mapobjects\light\cagelighta5k.md3 -file20=<>\WolfPack\models\mapobjects\light\cagelighta7k.md3 -file21=<>\WolfPack\models\mapobjects\light\cagelighta9k.md3 -file22=<>\WolfPack\models\mapobjects\light\cagelightr.md3 -file23=<>\WolfPack\models\mapobjects\light\camplt.md3 -file24=<>\WolfPack\models\mapobjects\light\camplt45.md3 -file25=<>\WolfPack\models\mapobjects\light\chad1.md3 -file26=<>\WolfPack\models\mapobjects\light\chad2.md3 -file27=<>\WolfPack\models\mapobjects\light\chandelier.md3 -file28=<>\WolfPack\models\mapobjects\light\floor_worklamp.md3 -file29=<>\WolfPack\models\mapobjects\light\gen_2lamps.md3 -file30=<>\WolfPack\models\mapobjects\light\lantern.md3 -file31=<>\WolfPack\models\mapobjects\light\lantern_r.md3 -file32=<>\WolfPack\models\mapobjects\light\p_nolight.md3 -file33=<>\WolfPack\models\mapobjects\light\pendant.md3 -file34=<>\WolfPack\models\mapobjects\light\pendant_1k.md3 -file35=<>\WolfPack\models\mapobjects\light\pendantb.md3 -file36=<>\WolfPack\models\mapobjects\light\sconce.md3 -file37=<>\WolfPack\models\mapobjects\light\sconce2.md3 -file38=<>\WolfPack\models\mapobjects\light\sconce3.md3 -file39=<>\WolfPack\models\mapobjects\light\searchlight.md3 -file40=<>\WolfPack\models\mapobjects\light\searchlight_l_broke.md3 -file41=<>\WolfPack\models\mapobjects\light\searchlight_pivot.md3 -file42=<>\WolfPack\models\mapobjects\light\searchlight1_b.md3 -file43=<>\WolfPack\models\mapobjects\light\searchlight1_l.md3 -file44=<>\WolfPack\models\mapobjects\light\test.md3 -file45=<>\WolfPack\models\mapobjects\light\worklamp.md3 -file46=<>\WolfPack\models\mapobjects\light\bel_lamp_10k.md3 - -[models\mapobjects\lion] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\lion\lion.md3 - -[models\mapobjects\lop] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\lop\lop3.md3 -file1=<>\WolfPack\models\mapobjects\lop\lop.md3 - -[models\mapobjects\miltary_trim] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\miltary_trim\sbag_st.md3 -file1=<>\WolfPack\models\mapobjects\miltary_trim\dish_only.md3 -file2=<>\WolfPack\models\mapobjects\miltary_trim\dragon_clip.md3 -file3=<>\WolfPack\models\mapobjects\miltary_trim\dragon_teeth.md3 -file4=<>\WolfPack\models\mapobjects\miltary_trim\dragon_teeth_e.md3 -file5=<>\WolfPack\models\mapobjects\miltary_trim\eagle150.md3 -file6=<>\WolfPack\models\mapobjects\miltary_trim\eagle250.md3 -file7=<>\WolfPack\models\mapobjects\miltary_trim\eagle90.md3 -file8=<>\WolfPack\models\mapobjects\miltary_trim\gangway.md3 -file9=<>\WolfPack\models\mapobjects\miltary_trim\gangway_up.md3 -file10=<>\WolfPack\models\mapobjects\miltary_trim\helmutbot.md3 -file11=<>\WolfPack\models\mapobjects\miltary_trim\helmuttop.md3 -file12=<>\WolfPack\models\mapobjects\miltary_trim\radar_twr.md3 -file13=<>\WolfPack\models\mapobjects\miltary_trim\rocket.md3 -file14=<>\WolfPack\models\mapobjects\miltary_trim\sandbag1.md3 -file15=<>\WolfPack\models\mapobjects\miltary_trim\sandbag1_45.md3 -file16=<>\WolfPack\models\mapobjects\miltary_trim\sbag_cr.md3 -file17=<>\WolfPack\models\mapobjects\miltary_trim\sbag_crs.md3 -file18=<>\WolfPack\models\mapobjects\miltary_trim\sbag_crs_90.md3 -file19=<>\WolfPack\models\mapobjects\miltary_trim\barbwire.md3 - -[models\mapobjects\nazi] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\nazi\soldierscale.md3 -file1=<>\WolfPack\models\mapobjects\nazi\soldier128.md3 -file2=<>\WolfPack\models\mapobjects\nazi\soldier72.md3 -file3=<>\WolfPack\models\mapobjects\nazi\soldier76.md3 -file4=<>\WolfPack\models\mapobjects\nazi\soldier80.md3 -file5=<>\WolfPack\models\mapobjects\nazi\soldier86.md3 -file6=<>\WolfPack\models\mapobjects\nazi\soldier96.md3 -file7=<>\WolfPack\models\mapobjects\nazi\soldier120.md3 - -[models\mapobjects\parachute] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\parachute\test2.md3 -file1=<>\WolfPack\models\mapobjects\parachute\asschute.md3 -file2=<>\WolfPack\models\mapobjects\parachute\assualtchute.md3 -file3=<>\WolfPack\models\mapobjects\parachute\assualtchute2.md3 -file4=<>\WolfPack\models\mapobjects\parachute\bjchute.md3 -file5=<>\WolfPack\models\mapobjects\parachute\test.md3 -file6=<>\WolfPack\models\mapobjects\parachute\assaultchute3.md3 - -[models\mapobjects\piano] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\piano\babyg.md3 - -[models\mapobjects\plants] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\plants\vine.md3 -file1=<>\WolfPack\models\mapobjects\plants\bush2.md3 -file2=<>\WolfPack\models\mapobjects\plants\flowers1.md3 -file3=<>\WolfPack\models\mapobjects\plants\flowers1_no_pot.md3 -file4=<>\WolfPack\models\mapobjects\plants\small_tree.md3 -file5=<>\WolfPack\models\mapobjects\plants\bush.md3 - -[models\mapobjects\punchingbag] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\punchingbag\pbag.md3 - -[models\mapobjects\sawblade] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\sawblade\saw_arm.md3 -file1=<>\WolfPack\models\mapobjects\sawblade\saw.md3 - -[models\mapobjects\sfx] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\sfx\hportal4.md3 -file1=<>\WolfPack\models\mapobjects\sfx\blob1.md3 -file2=<>\WolfPack\models\mapobjects\sfx\blob2.md3 -file3=<>\WolfPack\models\mapobjects\sfx\hportal.md3 -file4=<>\WolfPack\models\mapobjects\sfx\hportal1.md3 -file5=<>\WolfPack\models\mapobjects\sfx\hportal2.md3 -file6=<>\WolfPack\models\mapobjects\sfx\hportal3.md3 -file7=<>\WolfPack\models\mapobjects\sfx\blob.md3 -SubDir0=models\mapobjects\sfx\punchingbag - -[models\mapobjects\sfx\punchingbag] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\sfx\punchingbag\pbag4way.md3 -file1=<>\WolfPack\models\mapobjects\sfx\punchingbag\pbag.md3 - -[models\mapobjects\shadtest] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\shadtest\cin.md3 - -[models\mapobjects\shield] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\shield\shield_anim.md3 -file1=<>\WolfPack\models\mapobjects\shield\shield.md3 - -[models\mapobjects\size] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\size\bjsize.md3 - -[models\mapobjects\skel] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\skel\skeltest.md3 -file1=<>\WolfPack\models\mapobjects\skel\hand_bone.md3 -file2=<>\WolfPack\models\mapobjects\skel\hand_bone2.md3 -file3=<>\WolfPack\models\mapobjects\skel\leg.md3 -file4=<>\WolfPack\models\mapobjects\skel\leg_bone.md3 -file5=<>\WolfPack\models\mapobjects\skel\skel_ribs.md3 -file6=<>\WolfPack\models\mapobjects\skel\skel02mid.md3 -file7=<>\WolfPack\models\mapobjects\skel\hand.md3 - -[models\mapobjects\skull] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\skull\skull_wallb.md3 -file1=<>\WolfPack\models\mapobjects\skull\skul2t.md3 -file2=<>\WolfPack\models\mapobjects\skull\skull.md3 -file3=<>\WolfPack\models\mapobjects\skull\skull_scale.md3 -file4=<>\WolfPack\models\mapobjects\skull\skull_scale_t45.md3 -file5=<>\WolfPack\models\mapobjects\skull\skull_scale_t90.md3 -file6=<>\WolfPack\models\mapobjects\skull\skull_tilt1.md3 -file7=<>\WolfPack\models\mapobjects\skull\skull_wall.md3 -file8=<>\WolfPack\models\mapobjects\skull\skull_wall_f.md3 -file9=<>\WolfPack\models\mapobjects\skull\skul2.md3 - -[models\mapobjects\sky] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\sky\terrain9.md3 -file1=<>\WolfPack\models\mapobjects\sky\inner2.md3 -file2=<>\WolfPack\models\mapobjects\sky\mount2.md3 -file3=<>\WolfPack\models\mapobjects\sky\outer.md3 -file4=<>\WolfPack\models\mapobjects\sky\outer2.md3 -file5=<>\WolfPack\models\mapobjects\sky\plane.md3 -file6=<>\WolfPack\models\mapobjects\sky\plane2.md3 -file7=<>\WolfPack\models\mapobjects\sky\terrain.md3 -file8=<>\WolfPack\models\mapobjects\sky\terrain_ns.md3 -file9=<>\WolfPack\models\mapobjects\sky\terrain1.md3 -file10=<>\WolfPack\models\mapobjects\sky\terrain10.md3 -file11=<>\WolfPack\models\mapobjects\sky\terrain11.md3 -file12=<>\WolfPack\models\mapobjects\sky\terrain12.md3 -file13=<>\WolfPack\models\mapobjects\sky\terrain13.md3 -file14=<>\WolfPack\models\mapobjects\sky\terrain14.md3 -file15=<>\WolfPack\models\mapobjects\sky\terrain15.md3 -file16=<>\WolfPack\models\mapobjects\sky\terrain16.md3 -file17=<>\WolfPack\models\mapobjects\sky\terrain2.md3 -file18=<>\WolfPack\models\mapobjects\sky\terrain3.md3 -file19=<>\WolfPack\models\mapobjects\sky\terrain4.md3 -file20=<>\WolfPack\models\mapobjects\sky\terrain5.md3 -file21=<>\WolfPack\models\mapobjects\sky\terrain6.md3 -file22=<>\WolfPack\models\mapobjects\sky\terrain7.md3 -file23=<>\WolfPack\models\mapobjects\sky\terrain8.md3 -file24=<>\WolfPack\models\mapobjects\sky\inner.md3 - -[models\mapobjects\space] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\space\galaxystar.md3 -file1=<>\WolfPack\models\mapobjects\space\galaxy1.md3 -file2=<>\WolfPack\models\mapobjects\space\galaxyout.md3 -file3=<>\WolfPack\models\mapobjects\space\galaxy.md3 - -[models\mapobjects\toolshed] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\toolshed\weldtankxl.md3 -file1=<>\WolfPack\models\mapobjects\toolshed\pickax.md3 -file2=<>\WolfPack\models\mapobjects\toolshed\pickax_v.md3 -file3=<>\WolfPack\models\mapobjects\toolshed\shovel.md3 -file4=<>\WolfPack\models\mapobjects\toolshed\shovel_flat.md3 -file5=<>\WolfPack\models\mapobjects\toolshed\tools1.md3 -file6=<>\WolfPack\models\mapobjects\toolshed\weldtanksm.md3 -file7=<>\WolfPack\models\mapobjects\toolshed\generator.md3 - -[models\mapobjects\torture] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\torture\tools2.md3 -file1=<>\WolfPack\models\mapobjects\torture\brainjar.md3 -file2=<>\WolfPack\models\mapobjects\torture\cage1.md3 -file3=<>\WolfPack\models\mapobjects\torture\cage1BK.md3 -file4=<>\WolfPack\models\mapobjects\torture\cage2.md3 -file5=<>\WolfPack\models\mapobjects\torture\clamp.md3 -file6=<>\WolfPack\models\mapobjects\torture\fptools.md3 -file7=<>\WolfPack\models\mapobjects\torture\fptools_b.md3 -file8=<>\WolfPack\models\mapobjects\torture\headcrusher.md3 -file9=<>\WolfPack\models\mapobjects\torture\l_engine.md3 -file10=<>\WolfPack\models\mapobjects\torture\slash.md3 -file11=<>\WolfPack\models\mapobjects\torture\tools1.md3 -file12=<>\WolfPack\models\mapobjects\torture\beheader.md3 - -[models\mapobjects\tree] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\tree\weed_m01.md3 -file1=<>\WolfPack\models\mapobjects\tree\dead_tree.md3 -file2=<>\WolfPack\models\mapobjects\tree\dead_tree2.md3 -file3=<>\WolfPack\models\mapobjects\tree\dead_tree3.md3 -file4=<>\WolfPack\models\mapobjects\tree\dead_tree4.md3 -file5=<>\WolfPack\models\mapobjects\tree\dead_tree5.md3 -file6=<>\WolfPack\models\mapobjects\tree\dead_tree5a.md3 -file7=<>\WolfPack\models\mapobjects\tree\shrub.md3 -file8=<>\WolfPack\models\mapobjects\tree\shrubaa.md3 -file9=<>\WolfPack\models\mapobjects\tree\training_tree1.md3 -file10=<>\WolfPack\models\mapobjects\tree\training_tree2.md3 -file11=<>\WolfPack\models\mapobjects\tree\training_tree3.md3 -file12=<>\WolfPack\models\mapobjects\tree\tree_big.md3 -file13=<>\WolfPack\models\mapobjects\tree\tree_big1.md3 -file14=<>\WolfPack\models\mapobjects\tree\tree_big2.md3 -file15=<>\WolfPack\models\mapobjects\tree\tree_big3.md3 -file16=<>\WolfPack\models\mapobjects\tree\tree_big4.md3 -file17=<>\WolfPack\models\mapobjects\tree\tree_big5.md3 -file18=<>\WolfPack\models\mapobjects\tree\tree_d1.md3 -file19=<>\WolfPack\models\mapobjects\tree\tree_litl.md3 -file20=<>\WolfPack\models\mapobjects\tree\tree_low1.md3 -file21=<>\WolfPack\models\mapobjects\tree\tree_m01.md3 -file22=<>\WolfPack\models\mapobjects\tree\tree_m01s.md3 -file23=<>\WolfPack\models\mapobjects\tree\tree_m02.md3 -file24=<>\WolfPack\models\mapobjects\tree\tree_m03.md3 -file25=<>\WolfPack\models\mapobjects\tree\tree_m04.md3 -file26=<>\WolfPack\models\mapobjects\tree\tree_m05.md3 -file27=<>\WolfPack\models\mapobjects\tree\tree_m06.md3 -file28=<>\WolfPack\models\mapobjects\tree\tree_m07.md3 -file29=<>\WolfPack\models\mapobjects\tree\tree_m07_1.md3 -file30=<>\WolfPack\models\mapobjects\tree\tree_m07a.md3 -file31=<>\WolfPack\models\mapobjects\tree\tree_m08.md3 -file32=<>\WolfPack\models\mapobjects\tree\tree_m08_1.md3 -file33=<>\WolfPack\models\mapobjects\tree\tree_m08_snow.md3 -file34=<>\WolfPack\models\mapobjects\tree\tree_m08a.md3 -file35=<>\WolfPack\models\mapobjects\tree\tree_m09s.md3 -file36=<>\WolfPack\models\mapobjects\tree\tree_med.md3 -file37=<>\WolfPack\models\mapobjects\tree\tree_mp01.md3 -file38=<>\WolfPack\models\mapobjects\tree\tree_mp01_1.md3 -file39=<>\WolfPack\models\mapobjects\tree\tree_mp01_up.md3 -file40=<>\WolfPack\models\mapobjects\tree\tree_mp01a.md3 -file41=<>\WolfPack\models\mapobjects\tree\tree_mp01ab.md3 -file42=<>\WolfPack\models\mapobjects\tree\tree_mp02.md3 -file43=<>\WolfPack\models\mapobjects\tree\tree_new.md3 -file44=<>\WolfPack\models\mapobjects\tree\tree_pine.md3 -file45=<>\WolfPack\models\mapobjects\tree\tree_pine_2.md3 -file46=<>\WolfPack\models\mapobjects\tree\tree_pine_2_1.md3 -file47=<>\WolfPack\models\mapobjects\tree\tree_pine3.md3 -file48=<>\WolfPack\models\mapobjects\tree\tree_pine4.md3 -file49=<>\WolfPack\models\mapobjects\tree\tree_pine5.md3 -file50=<>\WolfPack\models\mapobjects\tree\tree_pine6.md3 -file51=<>\WolfPack\models\mapobjects\tree\tree_pine7.md3 -file52=<>\WolfPack\models\mapobjects\tree\tree_pine8.md3 -file53=<>\WolfPack\models\mapobjects\tree\tree_small.md3 -file54=<>\WolfPack\models\mapobjects\tree\tree_small3.md3 -file55=<>\WolfPack\models\mapobjects\tree\tree_tall.md3 -file56=<>\WolfPack\models\mapobjects\tree\tree_tall_256.md3 -file57=<>\WolfPack\models\mapobjects\tree\tree_vil1.md3 -file58=<>\WolfPack\models\mapobjects\tree\tree_vil2.md3 -file59=<>\WolfPack\models\mapobjects\tree\tree_village2.md3 -file60=<>\WolfPack\models\mapobjects\tree\bush1.md3 - -[models\mapobjects\tree_snow] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\tree_snow\snow_tree4.md3 -file1=<>\WolfPack\models\mapobjects\tree_snow\snow_rock.md3 -file2=<>\WolfPack\models\mapobjects\tree_snow\snow_tree1.md3 -file3=<>\WolfPack\models\mapobjects\tree_snow\snow_tree3.md3 -file4=<>\WolfPack\models\mapobjects\tree_snow\snow_bush1.md3 - -[models\mapobjects\ubergun] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\ubergun\ubergun2.md3 -file1=<>\WolfPack\models\mapobjects\ubergun\ubergun1.md3 - -[models\mapobjects\ui] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\ui\icon_burn.md3 - -[models\mapobjects\undead] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\undead\zom80.md3 -file1=<>\WolfPack\models\mapobjects\undead\undnazi76.md3 -file2=<>\WolfPack\models\mapobjects\undead\undnazi80.md3 -file3=<>\WolfPack\models\mapobjects\undead\zom2.md3 -file4=<>\WolfPack\models\mapobjects\undead\zom71.md3 -file5=<>\WolfPack\models\mapobjects\undead\zom76.md3 -file6=<>\WolfPack\models\mapobjects\undead\undnazi1.md3 - -[models\mapobjects\v2] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\v2\v4_tagsdestroyed.md3 -file1=<>\WolfPack\models\mapobjects\v2\v4_b.md3 -file2=<>\WolfPack\models\mapobjects\v2\v4_bw.md3 -file3=<>\WolfPack\models\mapobjects\v2\v4_c.md3 -file4=<>\WolfPack\models\mapobjects\v2\v4_cw.md3 -file5=<>\WolfPack\models\mapobjects\v2\v4_g.md3 -file6=<>\WolfPack\models\mapobjects\v2\v4_gw.md3 -file7=<>\WolfPack\models\mapobjects\v2\v4_side.md3 -file8=<>\WolfPack\models\mapobjects\v2\v4_side_lm.md3 -file9=<>\WolfPack\models\mapobjects\v2\v4_sideb.md3 -file10=<>\WolfPack\models\mapobjects\v2\v4_sideb_lm.md3 -file11=<>\WolfPack\models\mapobjects\v2\v4_tags.md3 -file12=<>\WolfPack\models\mapobjects\v2\v4.md3 - -[models\mapobjects\vacum] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\vacum\zom.md3 -file1=<>\WolfPack\models\mapobjects\vacum\box.md3 -file2=<>\WolfPack\models\mapobjects\vacum\vacum.md3 -file3=<>\WolfPack\models\mapobjects\vacum\bl.md3 - -[models\mapobjects\vehicles] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\vehicles\wheel.md3 -file1=<>\WolfPack\models\mapobjects\vehicles\boat_door.md3 -file2=<>\WolfPack\models\mapobjects\vehicles\flatbed.md3 -file3=<>\WolfPack\models\mapobjects\vehicles\gunflare.md3 -file4=<>\WolfPack\models\mapobjects\vehicles\halftrack.md3 -file5=<>\WolfPack\models\mapobjects\vehicles\halftrack2.md3 -file6=<>\WolfPack\models\mapobjects\vehicles\heinkel.md3 -file7=<>\WolfPack\models\mapobjects\vehicles\heinkel2.md3 -file8=<>\WolfPack\models\mapobjects\vehicles\heinkel3.md3 -file9=<>\WolfPack\models\mapobjects\vehicles\heinkelb1.md3 -file10=<>\WolfPack\models\mapobjects\vehicles\heinkelb2.md3 -file11=<>\WolfPack\models\mapobjects\vehicles\jeep.md3 -file12=<>\WolfPack\models\mapobjects\vehicles\jeepOLD.md3 -file13=<>\WolfPack\models\mapobjects\vehicles\jet_shadow.md3 -file14=<>\WolfPack\models\mapobjects\vehicles\lander.md3 -file15=<>\WolfPack\models\mapobjects\vehicles\lander_door.md3 -file16=<>\WolfPack\models\mapobjects\vehicles\lander_ndoor.md3 -file17=<>\WolfPack\models\mapobjects\vehicles\lander1w.md3 -file18=<>\WolfPack\models\mapobjects\vehicles\lander2.md3 -file19=<>\WolfPack\models\mapobjects\vehicles\lander2w.md3 -file20=<>\WolfPack\models\mapobjects\vehicles\m109.md3 -file21=<>\WolfPack\models\mapobjects\vehicles\m109_100 -file22=<>\WolfPack\models\mapobjects\vehicles\m109_prop.md3 -file23=<>\WolfPack\models\mapobjects\vehicles\M109_T.md3 -file24=<>\WolfPack\models\mapobjects\vehicles\M109_T1.md3 -file25=<>\WolfPack\models\mapobjects\vehicles\M109_T2.md3 -file26=<>\WolfPack\models\mapobjects\vehicles\m109crash.md3 -file27=<>\WolfPack\models\mapobjects\vehicles\m109debris_a.md3 -file28=<>\WolfPack\models\mapobjects\vehicles\m109debris_b.md3 -file29=<>\WolfPack\models\mapobjects\vehicles\m109debris_c.md3 -file30=<>\WolfPack\models\mapobjects\vehicles\m109debris_d.md3 -file31=<>\WolfPack\models\mapobjects\vehicles\natter.md3 -file32=<>\WolfPack\models\mapobjects\vehicles\natter_apart.md3 -file33=<>\WolfPack\models\mapobjects\vehicles\panzer.md3 -file34=<>\WolfPack\models\mapobjects\vehicles\panzer_a.md3 -file35=<>\WolfPack\models\mapobjects\vehicles\panzer_b.md3 -file36=<>\WolfPack\models\mapobjects\vehicles\panzer_b.md3BK -file37=<>\WolfPack\models\mapobjects\vehicles\panzer_c.md3 -file38=<>\WolfPack\models\mapobjects\vehicles\panzer_c.md3BK -file39=<>\WolfPack\models\mapobjects\vehicles\panzer_d.md3 -file40=<>\WolfPack\models\mapobjects\vehicles\panzer_dBK.md3 -file41=<>\WolfPack\models\mapobjects\vehicles\panzer_e.md3 -file42=<>\WolfPack\models\mapobjects\vehicles\raft.md3 -file43=<>\WolfPack\models\mapobjects\vehicles\raft1a.md3 -file44=<>\WolfPack\models\mapobjects\vehicles\raft2.md3 -file45=<>\WolfPack\models\mapobjects\vehicles\raft3.md3 -file46=<>\WolfPack\models\mapobjects\vehicles\rocket_notop.md3 -file47=<>\WolfPack\models\mapobjects\vehicles\rocket_top.md3 -file48=<>\WolfPack\models\mapobjects\vehicles\rocket_train.md3 -file49=<>\WolfPack\models\mapobjects\vehicles\rocket_trans.md3 -file50=<>\WolfPack\models\mapobjects\vehicles\rocketrain.md3 -file51=<>\WolfPack\models\mapobjects\vehicles\rocketraingear.md3 -file52=<>\WolfPack\models\mapobjects\vehicles\rocketrainWR.md3 -file53=<>\WolfPack\models\mapobjects\vehicles\shermanimtest.md3 -file54=<>\WolfPack\models\mapobjects\vehicles\shermanimtest_135.md3 -file55=<>\WolfPack\models\mapobjects\vehicles\shermanimtestbk.md3 -file56=<>\WolfPack\models\mapobjects\vehicles\sltrack.md3 -file57=<>\WolfPack\models\mapobjects\vehicles\srtrack.md3 -file58=<>\WolfPack\models\mapobjects\vehicles\staff_car.md3 -file59=<>\WolfPack\models\mapobjects\vehicles\staff_car_v.md3 -file60=<>\WolfPack\models\mapobjects\vehicles\staff4wheels.md3 -file61=<>\WolfPack\models\mapobjects\vehicles\staffcar.md3 -file62=<>\WolfPack\models\mapobjects\vehicles\staffdwheel.md3 -file63=<>\WolfPack\models\mapobjects\vehicles\staffpwheel.md3 -file64=<>\WolfPack\models\mapobjects\vehicles\sturret.md3 -file65=<>\WolfPack\models\mapobjects\vehicles\sub1.md3 -file66=<>\WolfPack\models\mapobjects\vehicles\sub1a.md3 -file67=<>\WolfPack\models\mapobjects\vehicles\sub2a.md3 -file68=<>\WolfPack\models\mapobjects\vehicles\sub3a.md3 -file69=<>\WolfPack\models\mapobjects\vehicles\tag_chassis.md3 -file70=<>\WolfPack\models\mapobjects\vehicles\tag_turret.md3 -file71=<>\WolfPack\models\mapobjects\vehicles\tankchassis.md3 -file72=<>\WolfPack\models\mapobjects\vehicles\tanktracks.md3 -file73=<>\WolfPack\models\mapobjects\vehicles\tankturret.md3 -file74=<>\WolfPack\models\mapobjects\vehicles\tankturret_b.md3 -file75=<>\WolfPack\models\mapobjects\vehicles\test.md3 -file76=<>\WolfPack\models\mapobjects\vehicles\torpedo.md3 -file77=<>\WolfPack\models\mapobjects\vehicles\train_trailer.md3 -file78=<>\WolfPack\models\mapobjects\vehicles\TRAIN_W.md3 -file79=<>\WolfPack\models\mapobjects\vehicles\TRAINCAR.md3 -file80=<>\WolfPack\models\mapobjects\vehicles\transport.md3 -file81=<>\WolfPack\models\mapobjects\vehicles\transport_w1.md3 -file82=<>\WolfPack\models\mapobjects\vehicles\transport_w1a.md3 -file83=<>\WolfPack\models\mapobjects\vehicles\transport_w2.md3 -file84=<>\WolfPack\models\mapobjects\vehicles\transport_w2a.md3 -file85=<>\WolfPack\models\mapobjects\vehicles\transport_w3.md3 -file86=<>\WolfPack\models\mapobjects\vehicles\transport_w3a.md3 -file87=<>\WolfPack\models\mapobjects\vehicles\truck.md3 -file88=<>\WolfPack\models\mapobjects\vehicles\truck_4wheels.md3 -file89=<>\WolfPack\models\mapobjects\vehicles\truck_4wheels.md3BK -file90=<>\WolfPack\models\mapobjects\vehicles\truck_b.md3 -file91=<>\WolfPack\models\mapobjects\vehicles\truck_base.md3 -file92=<>\WolfPack\models\mapobjects\vehicles\truck_exp.md3 -file93=<>\WolfPack\models\mapobjects\vehicles\truck_exp_ref.md3 -file94=<>\WolfPack\models\mapobjects\vehicles\truck_flatbed.md3 -file95=<>\WolfPack\models\mapobjects\vehicles\truck_flatbed_fire.md3 -file96=<>\WolfPack\models\mapobjects\vehicles\truck_flatbed_fire.md3BK -file97=<>\WolfPack\models\mapobjects\vehicles\truck_flatbed_grey.md3 -file98=<>\WolfPack\models\mapobjects\vehicles\truck_flatbed_grey.md3BK -file99=<>\WolfPack\models\mapobjects\vehicles\truck_lwheel.md3 -file100=<>\WolfPack\models\mapobjects\vehicles\truck_lwheel.MD3BK -file101=<>\WolfPack\models\mapobjects\vehicles\truck_rwheel.md3 -file102=<>\WolfPack\models\mapobjects\vehicles\truck_rwheel.MD3BK -file103=<>\WolfPack\models\mapobjects\vehicles\truck_shadow.md3 -file104=<>\WolfPack\models\mapobjects\vehicles\truck_support_grey.md3 -file105=<>\WolfPack\models\mapobjects\vehicles\truck_support_grey.md3BK -file106=<>\WolfPack\models\mapobjects\vehicles\truckn_90.md3 -file107=<>\WolfPack\models\mapobjects\vehicles\truckn_BK.md3 -file108=<>\WolfPack\models\mapobjects\vehicles\truckn_door.md3 -file109=<>\WolfPack\models\mapobjects\vehicles\truckn_door.md3BK -file110=<>\WolfPack\models\mapobjects\vehicles\truckn2.md3 -file111=<>\WolfPack\models\mapobjects\vehicles\truckn2.md3a -file112=<>\WolfPack\models\mapobjects\vehicles\truckn2aa.md3 -file113=<>\WolfPack\models\mapobjects\vehicles\truckn2bk.md3 -file114=<>\WolfPack\models\mapobjects\vehicles\trucknaa.md3 -file115=<>\WolfPack\models\mapobjects\vehicles\u_boat.md3 -file116=<>\WolfPack\models\mapobjects\vehicles\u_boat_ice.md3 -file117=<>\WolfPack\models\mapobjects\vehicles\vtol.md3 -file118=<>\WolfPack\models\mapobjects\vehicles\vtol_explode.md3 -file119=<>\WolfPack\models\mapobjects\vehicles\vtol_explode_ref.md3 -file120=<>\WolfPack\models\mapobjects\vehicles\vtol2.md3 -file121=<>\WolfPack\models\mapobjects\vehicles\vtol2_w1.md3 -file122=<>\WolfPack\models\mapobjects\vehicles\vtol2_w2.md3 -file123=<>\WolfPack\models\mapobjects\vehicles\vtol2_w3.md3 -file124=<>\WolfPack\models\mapobjects\vehicles\wagon_tilt.md3 -file125=<>\WolfPack\models\mapobjects\vehicles\blimp.md3 - -[models\mapobjects\watertower] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\watertower\watertower.md3 - -[models\mapobjects\weapons] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\weapons\turret_c.md3 -file1=<>\WolfPack\models\mapobjects\weapons\flak_b.md3 -file2=<>\WolfPack\models\mapobjects\weapons\flakgun.md3 -file3=<>\WolfPack\models\mapobjects\weapons\flakredux.md3 -file4=<>\WolfPack\models\mapobjects\weapons\mauser1.md3 -file5=<>\WolfPack\models\mapobjects\weapons\mauser2.md3 -file6=<>\WolfPack\models\mapobjects\weapons\mg42a.md3 -file7=<>\WolfPack\models\mapobjects\weapons\mg42a_BK.md3 -file8=<>\WolfPack\models\mapobjects\weapons\mg42b.md3 -file9=<>\WolfPack\models\mapobjects\weapons\monoflakgun.md3 -file10=<>\WolfPack\models\mapobjects\weapons\mortar.md3 -file11=<>\WolfPack\models\mapobjects\weapons\mp40_upright.md3 -file12=<>\WolfPack\models\mapobjects\weapons\mp40_upright_old.md3 -file13=<>\WolfPack\models\mapobjects\weapons\satchel_charge.md3 -file14=<>\WolfPack\models\mapobjects\weapons\sdagger.md3 -file15=<>\WolfPack\models\mapobjects\weapons\test.md3 -file16=<>\WolfPack\models\mapobjects\weapons\truckn_BK.md3 -file17=<>\WolfPack\models\mapobjects\weapons\turret_a.md3 -file18=<>\WolfPack\models\mapobjects\weapons\turret_b.md3 -file19=<>\WolfPack\models\mapobjects\weapons\flak_a.md3 - -[models\mapobjects\wine] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\wine\wine_barrel.md3 -file1=<>\WolfPack\models\mapobjects\wine\wine.md3 - -[models\mapobjects\xlab] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\xlab\tanks.md3 -file1=<>\WolfPack\models\mapobjects\xlab\shockchair.md3 -file2=<>\WolfPack\models\mapobjects\xlab\cart.md3 - -[models\mapobjects\xlab_props] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\xlab_props\xlight2.md3 -file1=<>\WolfPack\models\mapobjects\xlab_props\xlab_refer_insert.md3 -file2=<>\WolfPack\models\mapobjects\xlab_props\xlab_refer_insert2.md3 -file3=<>\WolfPack\models\mapobjects\xlab_props\xlight.md3 -file4=<>\WolfPack\models\mapobjects\xlab_props\xlight_dwn.md3 -file5=<>\WolfPack\models\mapobjects\xlab_props\xlight_dwn2.md3 -file6=<>\WolfPack\models\mapobjects\xlab_props\xlight_up.md3 -file7=<>\WolfPack\models\mapobjects\xlab_props\xlight_up2.md3 -file8=<>\WolfPack\models\mapobjects\xlab_props\xlab_refer.md3 - -[models\mapobjects\zemph] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\zemph\zemph.md3 - -[models\mapobjects\zombie] -fulldirectory= -file0=<>\WolfPack\models\mapobjects\zombie\zombie.md3 - diff --git a/setup/win32/template/File Groups/shaderlist-ta.fgl b/setup/win32/template/File Groups/shaderlist-ta.fgl deleted file mode 100644 index 2a484cb3..00000000 --- a/setup/win32/template/File Groups/shaderlist-ta.fgl +++ /dev/null @@ -1,11 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=scripts - -[scripts] -fulldirectory= -file0=<>\GtkRadiant\setup\data\missionpack\scripts\shaderlist.txt - diff --git a/setup/win32/template/File Groups/shaderlist.fgl b/setup/win32/template/File Groups/shaderlist.fgl deleted file mode 100644 index 7c4dc32e..00000000 --- a/setup/win32/template/File Groups/shaderlist.fgl +++ /dev/null @@ -1,11 +0,0 @@ -[General] -Type=FILELIST -Version=1.10.000 - -[TopDir] -SubDir0=scripts - -[scripts] -fulldirectory= -file0=<>\GtkRadiant\setup\data\baseq3\scripts\shaderlist.txt - diff --git a/setup/win32/template/GtkRadiant.ipr b/setup/win32/template/GtkRadiant.ipr deleted file mode 100644 index b487b905..00000000 --- a/setup/win32/template/GtkRadiant.ipr +++ /dev/null @@ -1,59 +0,0 @@ -[Data] -CurrentMedia=GtkRadiant -CurrentComponentDef=Default.cdf -CurrentFileGroupDef=Default.fdf -CurrentLanguage=English -CurrentPlatform= -InstallRoot=C:\home\Id\GtkRadiant\setup\win32\WorkDir -CompanyName=QERadiant.com -HomeURL= -EmailAddresss= -Copyright= -SummaryText= -Author= -Department= -ProductName=GtkRadiant -Version=1.1-TA -InstallationGUID=<> -DevEnvironment= -Type= -Category= -AppExe=C:\quake3\GtkRadiant\q3radiant.exe -Description=Description.txt -Notes=Notes.txt -Instructions=Instructions.txt -set_level=Level 3 -set_warnaserr=No -set_maxwarn=50 -set_maxerr=50 -set_preproc= -set_compileb4build=Yes -set_args= -set_testmode=No -set_dlldebug=No -set_dllcmdline= -set_mif=No -set_miffile=Status.mif -set_mifserial= -set_libraries=isrt.obl ifx.obl -set_linkpath= -set_inline_debug_info=No - -[OperatingSystem] -OSSupport=00000000001100d0 - -[General] -Type=INSTALLMAIN -Version=2.20.000 - -[MediaInfo] -mediadata0=GtkRadiant/Media\GtkRadiant - -[DepManager] -Application=C:\quake3\GtkRadiant\q3radiant.exe -CommandLine= -StartInFolder=C:\quake3\GtkRadiant -Mode=0 -LogResults=Yes -Component=Default - diff --git a/setup/win32/template/Media/GtkRadiant/Default.mda b/setup/win32/template/Media/GtkRadiant/Default.mda deleted file mode 100644 index c9b9c212..00000000 --- a/setup/win32/template/Media/GtkRadiant/Default.mda +++ /dev/null @@ -1,66 +0,0 @@ -[GeneralInfo] -Name=GtkRadiant -MediaType=Single -BuildType=Full -BuildSize= -Password= -GUID=f93c6af5-8487-46e7-90bb-e75f2d377eee -BuildFolder=\Media\GtkRadiant - -[SetupInfo] -ApplicationName= -EnableLangDlg=No - -[Platforms] -key0=0000000000000010 -key1=0000000000000040 -key2=0000000000000080 -key3=0000000000010000 -key4=0000000000100000 - -[Languages] -key0=0009 - -[Filter] -LanguageDefault=0009 - -[TagFileInfo] -Version=1.20.000 - -[Internet] -WebPage= -CreateDefaultWebPage=Yes - -[PostBuild] -FTPSite= -FTPFolder= -FTPUser= -FTPPassword= -Folder= -Batch File= - -[DataAsFilesComponents] -Program Files=No -Sample Files=No -Sample Files\Maps, Models and Textures=No -Sample Files\Scripts=No -Help Files=No -Help Files\Radiant Manual=No -Help Files\Shader Manual=No -Help Files\Terrain Manual=No -Help Files\Model Manual=No -Help Files\TA Help=No -Help Files\TexTool Help=No -Plugins=No -Plugins\TexTool=No -Plugins\PrtView=No -Plugins\GenSurf=No - -[Package] -Create=Yes -Welcome=No -File=GtkRadiant.exe -CommandLine= -ExtractFolder= -Password= - diff --git a/setup/win32/template/Registry Entries/Default.rge b/setup/win32/template/Registry Entries/Default.rge deleted file mode 100644 index a0a672a2..00000000 --- a/setup/win32/template/Registry Entries/Default.rge +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=REGISTRYDATA -Version=2.10.000 - diff --git a/setup/win32/template/Script Files/Setup.map b/setup/win32/template/Script Files/Setup.map deleted file mode 100644 index 1b92b267..00000000 --- a/setup/win32/template/Script Files/Setup.map +++ /dev/null @@ -1,556 +0,0 @@ -***** External Functions ***** -1 AppSearch isrt.obl(Driver.obs) -2 CCPSearch isrt.obl(Driver.obs) -3 CloseFile isrt.obl(Files.obs) -4 CmdGetHwndDlg isrt.obl(CustomDlg.obs) -5 ComponentCompareSizeRequired isrt.obl(component.obs) -6 ComponentErrorInfo isrt.obl(component.obs) -7 ComponentFilterLanguage isrt.obl(component.obs) -8 ComponentFilterOS isrt.obl(component.obs) -9 ComponentGetData isrt.obl(component.obs) -10 ComponentGetTotalCost isrt.obl(component.obs) -11 ComponentIsItemSelected isrt.obl(component.obs) -12 ComponentListItems isrt.obl(component.obs) -13 ComponentReinstall isrt.obl(component.obs) -14 ComponentRemoveAll isrt.obl(component.obs) -15 ComponentSaveTarget isrt.obl(component.obs) -16 ComponentSelectItem isrt.obl(component.obs) -17 ComponentSetTarget isrt.obl(component.obs) -18 ComponentSetupTypeEnum isrt.obl(component.obs) -19 ComponentSetupTypeGetData isrt.obl(component.obs) -20 ComponentSetupTypeSet isrt.obl(component.obs) -21 ComponentTransferData isrt.obl(component.obs) -22 ComponentTreeInit isrt.obl(Dialogs.obs) -23 CreateDir isrt.obl(Files.obs) -24 CreateFile isrt.obl(Files.obs) -25 CreateInstallationInfo isrt.obl(Registry.obs) -26 CtrlGetCurSel isrt.obl(CustomDlg.obs) -27 CtrlGetNotificationCode isrt.obl(CustomDlg.obs) -28 CtrlGetState isrt.obl(CustomDlg.obs) -29 CtrlGetSubCommand isrt.obl(CustomDlg.obs) -30 CtrlGetText isrt.obl(CustomDlg.obs) -31 CtrlPGroups isrt.obl(CustomDlg.obs) -32 CtrlSelectText isrt.obl(CustomDlg.obs) -33 CtrlSetCurSel isrt.obl(CustomDlg.obs) -34 CtrlSetList isrt.obl(CustomDlg.obs) -35 CtrlSetMLEText isrt.obl(CustomDlg.obs) -36 CtrlSetState isrt.obl(CustomDlg.obs) -37 CtrlSetText isrt.obl(CustomDlg.obs) -38 DefineDialog isrt.obl(CustomDlg.obs) -39 DeleteFile isrt.obl(Files.obs) -40 DialogSetDefaultFont isrt.obl(Dialogs.obs) -41 DialogSetFont isrt.obl(Dialogs.obs) -42 DialogSetInfo isrt.obl(Dialogs.obs) -43 Disable isrt.obl(Enable.obs) -44 DiskSizeToStr isrt.obl(SDINT.obs) -45 Divide isrt.obl(Misc.obs) -46 DllSizeOf isrt.obl(Str.obs) -47 Do isrt.obl(Misc.obs) -48 Enable isrt.obl(Enable.obs) -49 EndDialog isrt.obl(CustomDlg.obs) -50 EnterDisk isrt.obl(EnterDisk.obs) -51 ExistsDir isrt.obl(Files.obs) -52 ExistsDisk isrt.obl(Files.obs) -53 ExitInstall isrt.obl(Driver.obs) -54 EzDefineDialog isrt.obl(CustomDlg.obs) -55 FinalConstruct ifx.obl(Events.obs) -56 FinalRelease ifx.obl(Events.obs) -57 FindFile isrt.obl(Files.obs) -58 FormatMessage isrt.obl(Misc.obs) -59 GDI32.CreateRectRgn isrt.obl(AskDestPath.obs) -60 GDI32.GetDeviceCaps isrt.obl(AskDestPath.obs) -61 GetBillboard isrt.obl(SysVars.obs) -62 GetDialogTitle isrt.obl(Dialogs.obs) -63 GetDir isrt.obl(Str.obs) -64 GetDisk isrt.obl(Str.obs) -65 GetDiskSpace isrt.obl(GSI.obs) -66 GetDiskSpaceEx isrt.obl(GSI.obs) -67 GetErrorMsg isrt.obl(Dialogs.obs) -68 GetErrorTitle isrt.obl(Dialogs.obs) -69 GetExtents isrt.obl(GSI.obs) -70 GetFolderNameList isrt.obl(Shell.obs) -71 GetFolderPrograms isrt.obl(SysVars.obs) -72 GetISRes isrt.obl(SysVars.obs) -73 GetLine isrt.obl(Files.obs) -74 GetLog isrt.obl(SysVars.obs) -75 GetMaintenance isrt.obl(SysVars.obs) -76 GetOpenFileMode isrt.obl(Files.obs) -77 GetProductGUID isrt.obl(SysVars.obs) -78 GetProfString isrt.obl(Profile.obs) -79 GetProgramFiles isrt.obl(SysVars.obs) -80 GetSelectedLanguage isrt.obl(SysVars.obs) -81 GetSelectedTreeComponent isrt.obl(CmptView.obs) -82 GetSupportDir isrt.obl(SysVars.obs) -83 GetSystemInfo isrt.obl(GSI.obs) -84 GetWinDir isrt.obl(SysVars.obs) -85 GetWinSysDir isrt.obl(SysVars.obs) -86 GetWindowHandle isrt.obl(Misc.obs) -87 HIWORD isrt.obl(Misc.obs) -88 HexStrToNum isrt.obl(Str.obs) -89 ISDeterminePlatform isrt.obl(OsInfo.obs) -90 ISMIF32.InstallStatusMIF isrt.obl(MIF.obs) -91 ISRT.ComponentViewSetInfoEx isrt.obl(Dialogs.obs) -92 ISRT.EnableHourGlass isrt.obl(Enable.obs) -93 ISRT.EnumFoldersItems isrt.obl(Shell.obs) -94 ISRT.GetCPUType isrt.obl(GSI.obs) -95 ISRT.GetFontSub isrt.obl(Dialogs.obs) -96 ISRT.GetHandle Setup.Obs -97 ISRT.GetPorts isrt.obl(GSI.obs) -98 ISRT.IsEmpty Setup.Obs -99 ISRT.IsNTAdmin isrt.obl(Is.obs) -100 ISRT.IsObject Setup.Obs -101 ISRT.LangLoadString isrt.obl(SDINT.obs) -102 ISRT.MessageBeepP Setup.Obs -103 ISRT.PathCompactPathPixel isrt.obl(CustomDlg.obs) -104 ISRT.PathGetDir isrt.obl(Str.obs) -105 ISRT.PathGetDrive isrt.obl(Str.obs) -106 ISRT.PathGetFile isrt.obl(Str.obs) -107 ISRT.PathGetFileExt isrt.obl(Str.obs) -108 ISRT.PathGetFileName isrt.obl(Str.obs) -109 ISRT.PathGetPath isrt.obl(Str.obs) -110 ISRT.PathGetSpecialFolder isrt.obl(SysVars.obs) -111 ISRT.PathIsValidSyntax isrt.obl(Is.obs) -112 ISRT._AppSearch Setup.Obs -113 ISRT._BrowseForFolder isrt.obl(SelectDir.obs) -114 ISRT._CCPSearch Setup.Obs -115 ISRT._CleanupInet isrt.obl(MIO.obs) -116 ISRT._CloseFile isrt.obl(Files.obs) -117 ISRT._CmdGetHwndDlg isrt.obl(CustomDlg.obs) -118 ISRT._ComponentCompareSizeRequired isrt.obl(component.obs) -119 ISRT._ComponentErrorInfo isrt.obl(component.obs) -120 ISRT._ComponentFilterLanguage isrt.obl(component.obs) -121 ISRT._ComponentFilterOS isrt.obl(component.obs) -122 ISRT._ComponentGetData isrt.obl(component.obs) -123 ISRT._ComponentGetTotalCost isrt.obl(component.obs) -124 ISRT._ComponentIsItemSelected isrt.obl(component.obs) -125 ISRT._ComponentListItems isrt.obl(component.obs) -126 ISRT._ComponentReinstall isrt.obl(component.obs) -127 ISRT._ComponentRemoveAll isrt.obl(component.obs) -128 ISRT._ComponentSaveTarget isrt.obl(component.obs) -129 ISRT._ComponentSelectItem isrt.obl(component.obs) -130 ISRT._ComponentSetupTypeEnum isrt.obl(component.obs) -131 ISRT._ComponentSetupTypeGetData isrt.obl(component.obs) -132 ISRT._ComponentSetupTypeSet isrt.obl(component.obs) -133 ISRT._ComponentTransferData isrt.obl(component.obs) -134 ISRT._CreateDir isrt.obl(Files.obs) -135 ISRT._CtrlGetNotificationCode isrt.obl(CustomDlg.obs) -136 ISRT._CtrlGetSubCommand isrt.obl(CustomDlg.obs) -137 ISRT._DefineDialog isrt.obl(CustomDlg.obs) -138 ISRT._DialogSetFont isrt.obl(Dialogs.obs) -139 ISRT._DisableStatus isrt.obl(Enable.obs) -140 ISRT._Divide isrt.obl(Misc.obs) -141 ISRT._DoSprintf isrt.obl(MsgBox.obs) -142 ISRT._EnableDialogCache isrt.obl(Enable.obs) -143 ISRT._EnablePrevDialog isrt.obl(AskDestPath.obs) -144 ISRT._EnableStatus isrt.obl(Enable.obs) -145 ISRT._EndDialog isrt.obl(CustomDlg.obs) -146 ISRT._ExistsDir isrt.obl(Files.obs) -147 ISRT._ExistsDisk isrt.obl(Files.obs) -148 ISRT._ExistsFile isrt.obl(Files.obs) -149 ISRT._ExitInstall Setup.Obs -150 ISRT._GetDiskSpaceEx isrt.obl(GSI.obs) -151 ISRT._GetLine isrt.obl(Files.obs) -152 ISRT._GetSelectedTreeComponent isrt.obl(CmptView.obs) -153 ISRT._GetSupportDir isrt.obl(SysVars.obs) -154 ISRT._InetEndofTransfer isrt.obl(iftw.obs) -155 ISRT._InetGetLastError isrt.obl(iftw.obs) -156 ISRT._InetGetNextDisk isrt.obl(iftw.obs) -157 ISRT._InitInstall Setup.Obs -158 ISRT._ListAddItem isrt.obl(scrlist.obs) -159 ISRT._ListAddString isrt.obl(scrlist.obs) -160 ISRT._ListCount isrt.obl(scrlist.obs) -161 ISRT._ListCreate isrt.obl(scrlist.obs) -162 ISRT._ListCurrentString isrt.obl(scrlist.obs) -163 ISRT._ListDeleteString isrt.obl(scrlist.obs) -164 ISRT._ListDestroy isrt.obl(scrlist.obs) -165 ISRT._ListFindString isrt.obl(scrlist.obs) -166 ISRT._ListGetFirstItem isrt.obl(scrlist.obs) -167 ISRT._ListGetFirstString isrt.obl(scrlist.obs) -168 ISRT._ListGetNextItem isrt.obl(scrlist.obs) -169 ISRT._ListGetNextString isrt.obl(scrlist.obs) -170 ISRT._ListGetType isrt.obl(scrlist.obs) -171 ISRT._ListReadFromFile isrt.obl(scrlist.obs) -172 ISRT._ListSetIndex isrt.obl(scrlist.obs) -173 ISRT._OpenFile isrt.obl(Files.obs) -174 ISRT._Rebooted Setup.Obs -175 ISRT._RegCreateKey isrt.obl(Registry.obs) -176 ISRT._RegQueryKeyBinaryValue isrt.obl(Registry.obs) -177 ISRT._RegQueryKeyValue isrt.obl(Registry.obs) -178 ISRT._RegSetKeyBinaryValue isrt.obl(Registry.obs) -179 ISRT._RegSetKeyValue isrt.obl(Registry.obs) -180 ISRT._ReleaseDialog isrt.obl(CustomDlg.obs) -181 ISRT._SetAltMainImage isrt.obl(Dialogs.obs) -182 ISRT._SetDisplayEffect isrt.obl(ui.obs) -183 ISRT._SetPaletteFile isrt.obl(MIO.obs) -184 ISRT._SetTitle isrt.obl(ui.obs) -185 ISRT._SetupInet isrt.obl(MIO.obs) -186 ISRT._ShowObjWizardPages isrt.obl(Objects.obs) -187 ISRT._ShowWizardPages Setup.Obs -188 ISRT._StatusUpdate isrt.obl(ui.obs) -189 ISRT._TreeViewCreate isrt.obl(CmptView.obs) -190 ISRT._WaitOnDialog isrt.obl(CustomDlg.obs) -191 ISRT._WriteLine isrt.obl(Files.obs) -192 ISRT.__CreateObjectContext isrt.obl(ISRTInit.obs) -193 ISRT.__GetCmdLineOptions isrt.obl(ISRTInit.obs) -194 ISRT.__GetContextGUID isrt.obl(ISRTInit.obs) -195 ISRT.__GetFileRegistrar isrt.obl(ISRTInit.obs) -196 ISRT.__GetInfo isrt.obl(ISRTInit.obs) -197 ISRT.__GetLog isrt.obl(SysVars.obs) -198 ISRT.__GetLogDB isrt.obl(ISRTInit.obs) -199 ISRT.__GetMainWindow Setup.Obs -200 ISRT.__GetMaintenanceMode isrt.obl(SysVars.obs) -201 ISRT.__GetProductGuid isrt.obl(SysVars.obs) -202 ISRT.__GetProgress Setup.Obs -203 ISRT.__GetReboot isrt.obl(ISRTInit.obs) -204 ISRT.__GetTextSub isrt.obl(ISRTInit.obs) -205 ISRT.__GetUser isrt.obl(MIO.obs) -206 ISRT.__ISRTGetPropertyBag ifx.obl(PersistPropertyBag.obs) -207 ISRT.__ISRTReleasePropertyBag ifx.obl(PersistPropertyBag.obs) -208 ISRT.__LoadString isrt.obl(LoadStr.obs) -209 ISRT.__ReleaseObjectContext isrt.obl(ISRTInit.obs) -210 ISRT.__RestoreMainLog isrt.obl(ISRTInit.obs) -211 ISRT.__SetComponentLog isrt.obl(ISRTInit.obs) -212 IfxFilterComponents ifx.obl(MoveData.obs) -213 IfxFinalConstruct ifx.obl(EventsMIO.obs) -214 IfxFinalRelease ifx.obl(EventsMIO.obs) -215 IfxInitProperties ifx.obl(PersistPropertyBag.obs) -216 IfxMoveFileData ifx.obl(MoveData.obs) -217 IfxOnAbortInstall ifx.obl(Events.obs) -218 IfxOnAppSearch ifx.obl(Events.obs) -219 IfxOnCCPSearch ifx.obl(Events.obs) -220 IfxOnCanceling ifx.obl(Events.obs) -221 IfxOnDisk1Installed ifx.obl(EventsMIO.obs) -222 IfxOnDisk1Installing ifx.obl(EventsMIO.obs) -223 IfxOnExitInstall ifx.obl(EventsMIO.obs) -224 IfxOnFileError ifx.obl(Exceptions.obs) -225 IfxOnFileLocked ifx.obl(Exceptions.obs) -226 IfxOnFileReadOnly ifx.obl(Exceptions.obs) -227 IfxOnHelp ifx.obl(Events.obs) -228 IfxOnInitInstall ifx.obl(EventsMIO.obs) -229 IfxOnInternetError ifx.obl(Exceptions.obs) -230 IfxOnMD5Error ifx.obl(Exceptions.obs) -231 IfxOnNextDisk ifx.obl(Exceptions.obs) -232 IfxOnRebooted ifx.obl(Events.obs) -233 IfxOnRemovingSharedFile ifx.obl(Exceptions.obs) -234 IfxOnShowWizardPages ifx.obl(UserInterfaceMIO.obs) -235 IfxOnTransferred ifx.obl(Events.obs) -236 IfxOnTransferring ifx.obl(EventsMIO.obs) -237 IfxOnUnhandledException ifx.obl(Events.obs) -238 IfxReadProperties ifx.obl(PersistPropertyBag.obs) -239 IfxRunAfterReboot ifx.obl(Driver.obs) -240 IfxWriteProperties ifx.obl(PersistPropertyBag.obs) -241 InetEndofTransfer isrt.obl(iftw.obs) -242 InetErrorDisplayMode isrt.obl(iftw.obs) -243 InetGetLastError isrt.obl(iftw.obs) -244 InetNextDisk isrt.obl(iftw.obs) -245 InitInstall isrt.obl(Driver.obs) -246 InitProperties ifx.obl(PersistPropertyBag.obs) -247 Is isrt.obl(Is.obs) -248 IsInetInstall isrt.obl(iftw.obs) -249 KERNEL.GetModuleHandle Setup.Obs -250 KERNEL32.CloseHandle isrt.obl(AskDestPath.obs) -251 KERNEL32.CreateFileA isrt.obl(AskDestPath.obs) -252 KERNEL32.DeleteFileA isrt.obl(AskDestPath.obs) -253 KERNEL32.FindClose isrt.obl(AskDestPath.obs) -254 KERNEL32.FindFirstFileA isrt.obl(AskDestPath.obs) -255 KERNEL32.FindNextFileA isrt.obl(AskDestPath.obs) -256 KERNEL32.FormatMessageA isrt.obl(AskDestPath.obs) -257 KERNEL32.GetDriveType isrt.obl(AskDestPath.obs) -258 KERNEL32.GetFileAttributesA isrt.obl(AskDestPath.obs) -259 KERNEL32.GetLocalTime isrt.obl(AskDestPath.obs) -260 KERNEL32.GetLocaleInfo isrt.obl(AskDestPath.obs) -261 KERNEL32.GetPrivateProfileString isrt.obl(AskDestPath.obs) -262 KERNEL32.GetPrivateProfileStringA isrt.obl(AskDestPath.obs) -263 KERNEL32.GetProfileStringA isrt.obl(AskDestPath.obs) -264 KERNEL32.GetShortPathNameA isrt.obl(AskDestPath.obs) -265 KERNEL32.GetSystemDefaultLCID isrt.obl(AskDestPath.obs) -266 KERNEL32.GetUserDefaultLangID isrt.obl(AskDestPath.obs) -267 KERNEL32.GetVersion isrt.obl(AskDestPath.obs) -268 KERNEL32.GetVersionEx isrt.obl(AskDestPath.obs) -269 KERNEL32.GetVolumeInformation isrt.obl(AskDestPath.obs) -270 KERNEL32.GetWindowsDirectory isrt.obl(AskDestPath.obs) -271 KERNEL32.GlobalMemoryStatus isrt.obl(AskDestPath.obs) -272 KERNEL32.SetFileAttributesA isrt.obl(AskDestPath.obs) -273 KERNEL32.WritePrivateProfileString isrt.obl(AskDestPath.obs) -274 KERNEL32.WritePrivateProfileStringA isrt.obl(AskDestPath.obs) -275 KERNEL32.WriteProfileStringA isrt.obl(AskDestPath.obs) -276 KERNEL32.lstrlen isrt.obl(AskDestPath.obs) -277 LOWORD isrt.obl(Misc.obs) -278 ListAddItem isrt.obl(scrlist.obs) -279 ListAddString isrt.obl(scrlist.obs) -280 ListCount isrt.obl(scrlist.obs) -281 ListCreate isrt.obl(scrlist.obs) -282 ListCurrentString isrt.obl(scrlist.obs) -283 ListDeleteString isrt.obl(scrlist.obs) -284 ListDestroy isrt.obl(scrlist.obs) -285 ListFindString isrt.obl(scrlist.obs) -286 ListGetFirstItem isrt.obl(scrlist.obs) -287 ListGetFirstString isrt.obl(scrlist.obs) -288 ListGetNextItem isrt.obl(scrlist.obs) -289 ListGetNextString isrt.obl(scrlist.obs) -290 ListGetType isrt.obl(scrlist.obs) -291 ListReadFromFile isrt.obl(scrlist.obs) -292 ListSetIndex isrt.obl(scrlist.obs) -293 LongPathToQuote isrt.obl(Str.obs) -294 LongPathToShortPath isrt.obl(Str.obs) -295 MAKELONG isrt.obl(Misc.obs) -296 MIFCreateMIFFile isrt.obl(MIF.obs) -297 MIFDeleteMIFFile isrt.obl(MIF.obs) -298 MIFInitialize isrt.obl(MIF.obs) -299 MIFSetInformation isrt.obl(MIF.obs) -300 MIFUnInitialize isrt.obl(MIF.obs) -301 MIFWasSetInformationCalled isrt.obl(MIF.obs) -302 MIOShutdown isrt.obl(MIO.obs) -303 MIOStartup isrt.obl(MIO.obs) -304 MaintenanceStart isrt.obl(Registry.obs) -305 MessageBeep isrt.obl(Misc.obs) -306 MessageBox isrt.obl(MsgBox.obs) -307 OnAbort ifx.obl(Events.obs) -308 OnAppSearch ifx.obl(Events.obs) -309 OnBegin ifx.obl(Events.obs) -310 OnCCPSearch ifx.obl(Events.obs) -311 OnCanceling ifx.obl(EventsMIO.obs) -312 OnComponentError ifx.obl(Exceptions.obs) -313 OnEnd ifx.obl(Events.obs) -314 OnFileError ifx.obl(Exceptions.obs) -315 OnFileLocked ifx.obl(Exceptions.obs) -316 OnFileReadOnly ifx.obl(Exceptions.obs) -317 OnFirstUIAfter ifx.obl(UserInterfaceMIO.obs) -318 OnFirstUIBefore Setup.Obs -319 OnHelp ifx.obl(Events.obs) -320 OnInternetError ifx.obl(Exceptions.obs) -321 OnMD5Error ifx.obl(Exceptions.obs) -322 OnMaintUIAfter ifx.obl(UserInterfaceMIO.obs) -323 OnMaintUIBefore ifx.obl(UserInterfaceMIO.obs) -324 OnMoved Setup.Obs -325 OnMoving Setup.Obs -326 OnNextDisk ifx.obl(Exceptions.obs) -327 OnRebooted ifx.obl(Events.obs) -328 OnRemovingSharedFile ifx.obl(Exceptions.obs) -329 OnSelfRegistrationError ifx.obl(Events.obs) -330 OnUnhandledException ifx.obl(Events.obs) -331 OpenFile isrt.obl(Files.obs) -332 OpenFileMode isrt.obl(Files.obs) -333 ParsePath isrt.obl(Str.obs) -334 ProgDefGroupType isrt.obl(Shell.obs) -335 ProgGetGroupType isrt.obl(Shell.obs) -336 PthFixPath isrt.obl(Pth.obs) -337 PthIsAbsPath isrt.obl(Pth.obs) -338 ReadProperties ifx.obl(PersistPropertyBag.obs) -339 Rebooted isrt.obl(Driver.obs) -340 RegDBGetKeyValueEx isrt.obl(Registry.obs) -341 RegDBInit isrt.obl(Registry.obs) -342 RegDBQueryValue isrt.obl(Registry.obs) -343 RegDBSetDefaultRoot isrt.obl(Registry.obs) -344 RegDBSetItem isrt.obl(Registry.obs) -345 RegDBSetValue isrt.obl(Registry.obs) -346 ReleaseDialog isrt.obl(CustomDlg.obs) -347 SdAskDestPath isrt.obl(SDADPATH.obs) -348 SdCloseDlg isrt.obl(SDINT.obs) -349 SdComponentDlgCheckSpace isrt.obl(SDINT.obs) -350 SdComponentTree isrt.obl(SDCOMTREE.obs) -351 SdDlgToTop isrt.obl(SDINT.obs) -352 SdDoStdButton isrt.obl(SDINT.obs) -353 SdEnablement isrt.obl(SDINT.obs) -354 SdError isrt.obl(SDINT.obs) -355 SdExceptions isrt.obl(SdExceptions.obs) -356 SdFinish isrt.obl(SDFINISH.obs) -357 SdFinishEx isrt.obl(SdFinishEx.obs) -358 SdFinishReboot isrt.obl(SDFINBOT.obs) -359 SdGeneralInit isrt.obl(SDINT.obs) -360 SdInit isrt.obl(SDINT.obs) -361 SdIsShellExplorer isrt.obl(SDINT.obs) -362 SdIsStdButton isrt.obl(SDINT.obs) -363 SdLicense isrt.obl(SDLIC.obs) -364 SdLoadString isrt.obl(SDINT.obs) -365 SdMakeName isrt.obl(SDINT.obs) -366 SdPlugInProductName isrt.obl(SDINT.obs) -367 SdProductName isrt.obl(SDPRODCT.obs) -368 SdRemoveEndSpace isrt.obl(SDINT.obs) -369 SdSelectFolder isrt.obl(SDSFDR.obs) -370 SdSetDlgTitle isrt.obl(SDINT.obs) -371 SdSetStatic isrt.obl(SDINT.obs) -372 SdSetupTypeEx isrt.obl(Sdstypex.obs) -373 SdShowDlgEdit1 isrt.obl(SDSEDT1.obs) -374 SdShowInfoList isrt.obl(SDSINFOL.obs) -375 SdStartCopy isrt.obl(SDSCOPY.obs) -376 SdUnInit isrt.obl(SDINT.obs) -377 SdVerifyFolder isrt.obl(SDINT.obs) -378 SdWelcome isrt.obl(SDWEL.obs) -379 SdWelcomeMaint isrt.obl(SdWelcomeMaint.obs) -380 SelectDir isrt.obl(SelectDir.obs) -381 SelectDirNoLog isrt.obl(SelectDir.obs) -382 SendMessage isrt.obl(Misc.obs) -383 SetCmdLine isrt.obl(SysVars.obs) -384 SetDialogTitle isrt.obl(Dialogs.obs) -385 SetDisplayEffect isrt.obl(ui.obs) -386 SetFolderDesktop isrt.obl(SysVars.obs) -387 SetFolderPrograms isrt.obl(SysVars.obs) -388 SetFolderStartMenu isrt.obl(SysVars.obs) -389 SetFolderStartup isrt.obl(SysVars.obs) -390 SetInstallationInfo isrt.obl(Registry.obs) -391 SetStatusWindow isrt.obl(ui.obs) -392 SetTitle isrt.obl(ui.obs) -393 ShowObjWizardPages isrt.obl(Objects.obs) -394 ShowWizardPages isrt.obl(Driver.obs) -395 SilentCreateFile isrt.obl(Silent.obs) -396 SilentDoGeneralInfo isrt.obl(Silent.obs) -397 SilentFailed isrt.obl(Silent.obs) -398 SilentFinish isrt.obl(Silent.obs) -399 SilentGetMode isrt.obl(Silent.obs) -400 SilentInit isrt.obl(Silent.obs) -401 SilentLogWriteData isrt.obl(Silent.obs) -402 SilentReadData isrt.obl(Silent.obs) -403 SilentSetInfo isrt.obl(Silent.obs) -404 SilentSetMode isrt.obl(Silent.obs) -405 SilentWriteData isrt.obl(Silent.obs) -406 Sprintf isrt.obl(Str.obs) -407 SprintfBox isrt.obl(MsgBox.obs) -408 StatusUpdate isrt.obl(ui.obs) -409 StrGetTokens isrt.obl(Str.obs) -410 StrLength isrt.obl(Str.obs) -411 StrRemoveLastSlash isrt.obl(Str.obs) -412 StrRemoveSpaces isrt.obl(Str.obs) -413 StrToUpper isrt.obl(Str.obs) -414 SysVarsInit isrt.obl(SysVars.obs) -415 SysVarsUnInit isrt.obl(SysVars.obs) -416 System isrt.obl(Misc.obs) -417 TreeViewCreate isrt.obl(CmptView.obs) -418 USER.EnableWindow Setup.Obs -419 USER.GetClassName Setup.Obs -420 USER.GetClientRect Setup.Obs -421 USER.GetDC Setup.Obs -422 USER.GetDlgItem Setup.Obs -423 USER.GetFocus Setup.Obs -424 USER.GetWindowLong Setup.Obs -425 USER.GetWindowRect Setup.Obs -426 USER.IsIconic Setup.Obs -427 USER.IsWindow Setup.Obs -428 USER.IsWindowVisible isrt.obl(AskDestPath.obs) -429 USER.MoveWindow Setup.Obs -430 USER.ReleaseDC Setup.Obs -431 USER.SendMessageA isrt.obl(AskDestPath.obs) -432 USER.SetFocus Setup.Obs -433 USER.SetForegroundWindow isrt.obl(AskDestPath.obs) -434 USER.SetWindowPos Setup.Obs -435 USER.SetWindowText Setup.Obs -436 USER.ShowWindow Setup.Obs -437 USER32.CharUpperBuffA isrt.obl(AskDestPath.obs) -438 USER32.DrawText isrt.obl(AskDestPath.obs) -439 USER32.GetSystemMetrics isrt.obl(AskDestPath.obs) -440 USER32.GetWindowText isrt.obl(AskDestPath.obs) -441 USER32.GetWindowTextLength isrt.obl(AskDestPath.obs) -442 USER32.MessageBoxA isrt.obl(AskDestPath.obs) -443 USER32.ScreenToClient isrt.obl(AskDestPath.obs) -444 USER32.SendMessageA isrt.obl(AskDestPath.obs) -445 USER32.SetWindowLong isrt.obl(AskDestPath.obs) -446 USER32.SetWindowRgn isrt.obl(AskDestPath.obs) -447 VarRestore isrt.obl(SysVars.obs) -448 VarSave isrt.obl(SysVars.obs) -449 WaitOnDialog isrt.obl(CustomDlg.obs) -450 WriteLine isrt.obl(Files.obs) -451 WriteProfString isrt.obl(Profile.obs) -452 WriteProperties ifx.obl(PersistPropertyBag.obs) -453 _HandleException isrt.obl(exceptions.obs) -454 _WinSubEnableControl isrt.obl(WINSUB.obs) -455 _WinSubEnableWindow isrt.obl(WINSUB.obs) -456 _WinSubGetChildWindow isrt.obl(WINSUB.obs) -457 _WinSubIsWindow isrt.obl(WINSUB.obs) -458 __DefaultExitHandler isrt.obl(handlers.obs) -459 __ISRTDoExit isrt.obl(Misc.obs) -460 __ISRTInit isrt.obl(ISRTInit.obs) -461 __ISRTRestoreMainLog isrt.obl(ISRTInit.obs) -462 __ISRTSetComponentLog isrt.obl(ISRTInit.obs) -463 __ISRTUnInit isrt.obl(ISRTInit.obs) -464 __LoadIScriptString isrt.obl(LoadStr.obs) -465 program ifx.obl(Driver.obs) -466 sfc.SRSetRestorePoint Setup.Obs - - -***** External Variables ***** -1 BATCH_INSTALL Setup.Obs -2 CMDLINE isrt.obl(DebugSymbols.obs) -3 COMMONFILES isrt.obl(DebugSymbols.obs) -4 DISK1TARGET Setup.Obs -5 ERRORFILENAME Setup.Obs -6 Err Setup.Obs -7 FILETIME isrt.obl(AskDestPath.obs) -8 FIND_DATA isrt.obl(AskDestPath.obs) -9 FOLDER_DESKTOP isrt.obl(DebugSymbols.obs) -10 FOLDER_PROGRAMS isrt.obl(DebugSymbols.obs) -11 FOLDER_STARTMENU isrt.obl(DebugSymbols.obs) -12 FOLDER_STARTUP isrt.obl(DebugSymbols.obs) -13 FileRegistrar Setup.Obs -14 ISRES isrt.obl(DebugSymbols.obs) -15 ISUSER isrt.obl(DebugSymbols.obs) -16 ISVERSION isrt.obl(DebugSymbols.obs) -17 InetSRCDIR Setup.Obs -18 LAST_RESULT Setup.Obs -19 LogDB Setup.Obs -20 MAINTENANCE isrt.obl(DebugSymbols.obs) -21 MEDIA Setup.Obs -22 MEMORYSTATUS isrt.obl(AskDestPath.obs) -23 MODE isrt.obl(DebugSymbols.obs) -24 MainWindow Setup.Obs -25 NOTHING Setup.Obs -26 OSINFO_PLATFORM_INFO Setup.Obs -27 OSVERSIONINFO isrt.obl(AskDestPath.obs) -28 PRODUCT_GUID isrt.obl(DebugSymbols.obs) -29 PROGRAMFILES isrt.obl(DebugSymbols.obs) -30 RECT isrt.obl(AskDestPath.obs) -31 Reboot Setup.Obs -32 SELECTED_LANGUAGE isrt.obl(DebugSymbols.obs) -33 SHELL_OBJECT_FOLDER Setup.Obs -34 SRCDIR Setup.Obs -35 SRCDISK isrt.obl(DebugSymbols.obs) -36 SUPPORTDIR isrt.obl(DebugSymbols.obs) -37 SYSTEMTIME isrt.obl(AskDestPath.obs) -38 SetupInfo Setup.Obs -39 StatusDlg Setup.Obs -40 TARGETDIR Setup.Obs -41 TARGETDISK isrt.obl(DebugSymbols.obs) -42 TextSub Setup.Obs -43 UNINST Setup.Obs -44 UNINSTALL_STRING Setup.Obs -45 WINDIR isrt.obl(DebugSymbols.obs) -46 WINDISK isrt.obl(DebugSymbols.obs) -47 WINSYSDIR isrt.obl(DebugSymbols.obs) -48 WINSYSDISK isrt.obl(DebugSymbols.obs) -49 _INT64 Setup.Obs -50 _RESTOREINFO_ Setup.Obs -51 _RESTOREPTINFO Setup.Obs -52 _SMGRSTATUS Setup.Obs -53 _SMGSTATUS_ Setup.Obs -54 _WIN9X Setup.Obs -55 _WINNT Setup.Obs -56 __SYSTEMINFORMATION Setup.Obs -57 __hContext isrt.obl(AskYesNo.obs) -58 __objGlobalTextSub Setup.Obs -59 __szGUID isrt.obl(ISRTInit.obs) -60 bBackButton Setup.Obs -61 bCancelButton Setup.Obs -62 bEnterDiskBeep isrt.obl(AskDestPath.obs) -63 bFinishButton Setup.Obs -64 bIFXLFNoToAll Setup.Obs -65 bIFXLFOnRebootToAll Setup.Obs -66 bIFXLFYesToAll Setup.Obs -67 bIFXMD5IgnoreToAll Setup.Obs -68 bIFXRONoToAll Setup.Obs -69 bIFXROYesToAll Setup.Obs -70 bIFXSFNoToAll Setup.Obs -71 bIFXSFYesToAll Setup.Obs -72 bIfxPCHInitialized Setup.Obs -73 bIfxPCHOn Setup.Obs -74 bInstall16 Setup.Obs -75 bNextButton Setup.Obs -76 bSdInit Setup.Obs -77 bViewCmptKunits Setup.Obs -78 bViewCmptUseDecimal Setup.Obs -79 g_bSuppressMissingStringWarning isrt.obl(Enable.obs) -80 nIFXROKey ifx.obl(EventsMIO.obs) -81 nIFXSFKey ifx.obl(EventsMIO.obs) -82 nIfxPCHType Setup.Obs -83 szAppKey Setup.Obs -84 szInstallDeinstKey Setup.Obs -85 szSdProduct Setup.Obs -86 szSdStr_NotEnoughSpace Setup.Obs diff --git a/setup/win32/template/Script Files/Setup.rul b/setup/win32/template/Script Files/Setup.rul deleted file mode 100644 index b3a62d70..00000000 --- a/setup/win32/template/Script Files/Setup.rul +++ /dev/null @@ -1,1307 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-2000, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - -// Include header files - -#include "ifx.h" //DO NOT REMOVE - -////////////////////// string defines //////////////////////////// - -//////////////////// installation declarations /////////////////// - -// ---- globals ---- -// we don't need full/non-full information -// only the following are used for UI - -NUMBER DO_CORE_BOOL; -NUMBER DO_NIGHTLY_BOOL; - -// Q3 -NUMBER DO_GAME_Q3_BOOL; -// per-game package global config -STRING szDIR_GAME_Q3, szDIR_GAMETOOLS_Q3; - -// Wolf -NUMBER DO_GAME_WOLF_BOOL; -STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF; - -// JKII -NUMBER DO_GAME_JKII_BOOL; -STRING szDIR_GAME_JKII, szDIR_GAMETOOLS_JKII; - -// STVEF -NUMBER DO_GAME_STVEF_BOOL; -STRING szDIR_GAME_STVEF, szDIR_GAMETOOLS_STVEF; - -// SOF2 -NUMBER DO_GAME_SOF2_BOOL; -STRING szDIR_GAME_SOF2, szDIR_GAMETOOLS_SOF2; - -// Halflife -NUMBER DO_GAME_HALFLIFE_BOOL; -NUMBER DO_GAME_CSTRIKE_BOOL; // only used for .game generation -STRING szDIR_GAME_HALFLIFE, szDIR_GAMETOOLS_HALFLIFE; - -// ET -NUMBER DO_GAME_ET_BOOL; -STRING szDIR_GAME_ET, szDIR_GAMETOOLS_ET; - -// Quake -NUMBER DO_GAME_Q1_BOOL; -STRING szDIR_GAME_Q1, szDIR_GAMETOOLS_Q1; - -// JA -NUMBER DO_GAME_JA_BOOL; -STRING szDIR_GAME_JA, szDIR_GAMETOOLS_JA; - -// Q2 -NUMBER DO_GAME_Q2_BOOL; -STRING szDIR_GAME_Q2, szDIR_GAMETOOLS_Q2; - -// HER2 -NUMBER DO_GAME_HER2_BOOL; -STRING szDIR_GAME_HER2, szDIR_GAMETOOLS_HER2; - -// ---- script function prototypes ----- - - -// your script function prototypes -prototype ReadInfoList(LIST); - -function ReadInfoList(svInfoList) - STRING svLine; - NUMBER nFlag, nvFileHandle; - -begin - OpenFileMode(FILE_MODE_NORMAL); - OpenFile(nvFileHandle, SUPPORTDIR, "infolist.txt"); - while (nFlag = 0) - nFlag = GetLine(nvFileHandle, svLine); - ListAddString(svInfoList, svLine, AFTER); - endwhile; - CloseFile(nvFileHandle); -end; - - - -////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: OnFirstUIBefore -// -// EVENT: FirstUIBefore event is sent when installation is run for the first -// time on given machine. In the handler installation usually displays -// UI allowing end user to specify installation parameters. After this -// function returns, ComponentTransferData is called to perform file -// transfer. -// -/////////////////////////////////////////////////////////////////////////////// -function OnFirstUIBefore() - NUMBER nRegKey,nRegKeySize,nKeyType; - STRING szRegKey, szQuake3, szJKII, szSTVEF, szSOF2, szRTCW, szHL, szCStrike, szET, szQ1, szJA, szQ2, szHER2; - NUMBER nResult,nSetupType; - STRING szTitle, szMsg; - STRING szLicenseFile, szQuestion; - STRING szTargetPath; - STRING szDir, szSubDir; - STRING szfolder; - STRING szComponents, szTargetdir; - STRING svSetupType; - NUMBER nLevel; - LIST listStartCopy, listInfoList; - NUMBER nvSize; - STRING DEFAULTJKIIDIR; - STRING DEFAULTSTVEFDIR; - STRING DEFAULTSOF2DIR; - STRING DEFAULTRTCWDIR; - STRING DEFAULTHALFLIFEDIR; - STRING DEFAULTETDIR; - STRING DEFAULTQ1DIR; - STRING DEFAULTJADIR; -begin - -// config -// some defaults -szSubDir = "Radiant-1.<>"; - -// template -DO_CORE_BOOL = <>; -DO_NIGHTLY_BOOL = <>; -DO_GAME_Q3_BOOL = <>; -DO_GAME_WOLF_BOOL = <>; -DO_GAME_JKII_BOOL = <>; -DO_GAME_STVEF_BOOL = <>; -DO_GAME_SOF2_BOOL = <>; -DO_GAME_HALFLIFE_BOOL = <>; -DO_GAME_ET_BOOL = <>; -DO_GAME_Q1_BOOL = <>; -DO_GAME_JA_BOOL = <>; -DO_GAME_Q2_BOOL = <>; -DO_GAME_HER2_BOOL = <>; -// common stuff - - // TO DO: if you want to enable background, window title, and caption bar title - // SetTitle( @TITLE_MAIN, 24, WHITE ); - // SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); - // Enable( FULLWINDOWMODE ); - // Enable( BACKGROUND ); - // SetColor(BACKGROUND,RGB (0, 128, 128); - -Dlg_Start: - // beginning of dialogs label - -Dlg_SdWelcome: - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - if (nResult = BACK) goto Dlg_Start; - -Dlg_SdLicense: - szLicenseFile = SUPPORTDIR ^ "license.txt"; - szTitle = ""; - szMsg = ""; - szQuestion = ""; - nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile ); - if (nResult = BACK) goto Dlg_SdWelcome; - -Dlg_SdShowInfoList: - szTitle = "Information\nLatest " + @PRODUCT_NAME + " project information."; - szMsg = ""; - listInfoList = ListCreate( STRINGLIST ); - ReadInfoList(listInfoList); - // sdShowInfoList dialog customised in _IsUser.dll - nResult = SdShowInfoList( szTitle, szMsg, listInfoList ); - if (nResult = BACK) goto Dlg_SdLicense; - - // TODO TTimo: prompt for what is in the setup and what the user wants to install? - // i.e. by component - - // core - if (DO_CORE_BOOL == 1) then -Dlg_SdAskCorePath: - szDir = "C:\\Program Files\\GtkRadiant-1.<>"; - szTitle = "Installation of " + @PRODUCT_NAME + " core files."; - szMsg = "Select the installation path for " + @PRODUCT_NAME + " core files."; - nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 ); - // FIXME TTimo if a setup doesn't hold the core, it prolly needs to default that - // reading from registry for instance (if TARGETDIR init is required) - TARGETDIR = szDir; - ComponentSetTarget (MEDIA, "", TARGETDIR); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - endif; - - if (DO_NIGHTLY_BOOL == 1) then - MessageBox ("IMPORTANT NOTE ABOUT UPDATE SETUPS:\n" + - "You may be prompted about games that are not installed. This setup is a single update to all the games we support.\n" + - "Let the setup select the default paths, and in 'Setup Type' dialog, select custom setup and disable the updates for the games you don't have.", WARNING); - endif; - - // --------------------------------------------------------------------------------- - // game pack #1 - if (DO_GAME_Q3_BOOL == 1) then -Dlg_SdAskGamePath_Q3: - // guess the default game path - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Id\\Quake III Arena\\", "INSTALLPATH", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey, "quake3.exe", szQuake3); - if (szQuake3 = "quake3.exe") then - szDIR_GAME_Q3 = szRegKey; - else - szDIR_GAME_Q3 = @DEFAULTQUAKE3DIR; - endif; - else - szDIR_GAME_Q3 = @DEFAULTQUAKE3DIR; - endif; - - // prompt user for game path - szTitle = "Quake III Arena / Quake III: Team Arena and mods game package"; - szMsg = "Select the folder where Quake III Arena is installed.\nNOTE: For compatibility purposes, your Quake III Arena folder name must contain the word \"quake\" in the top level. eg. C:\\Program Files\\Quake III Arena\n\nTo continue, click Next."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q3, 0 ); - if (nResult = BACK) then - if (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_Q3: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Quake III Arena game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_Q3 = szDIR_GAME_Q3 ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_Q3; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_Q3); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_Q3); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #2 - if (DO_GAME_WOLF_BOOL == 1) then -Dlg_SdAskGamePath_Wolf: - - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Return to Castle Wolfenstein - Game of The Year Edition\\", "INSTALLPATH", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey, "wolfmp.exe", szRTCW); - if (szRTCW = "wolfmp.exe") then - szDIR_GAME_WOLF = szRegKey; - else - szDIR_GAME_WOLF = @DEFAULTRTCWDIR; - endif; - else - szDIR_GAME_WOLF = @DEFAULTRTCWDIR; - endif; - - // prompt user for game path - // NOTE TTimo: only required in full setup actually? - szTitle = "Return To Castle Wolfenstein game package"; - szMsg = "Select the folder where Return To Castle Wolfenstein is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_WOLF, 0 ); - if (nResult = BACK) then - if (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_Wolf: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Return to Castle Wolfenstein game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_WOLF = szDIR_GAME_WOLF ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_Wolf; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_WOLF); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_WOLF); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #3 - if (DO_GAME_JKII_BOOL == 1) then -Dlg_SdAskGamePath_JKII: - - // guess the default game path from registry - DEFAULTJKIIDIR = "C:\\Program Files\\LucasArts\\Star Wars JK II Jedi Outcast\\GameData"; - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\LucasArts Entertainment Company LLC\\Star Wars JK II Jedi Outcast\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey + "GameData", "jk2sp.exe", szJKII); - if (szJKII = "jk2sp.exe") then - szDIR_GAME_JKII = szRegKey; - else - szDIR_GAME_JKII = DEFAULTJKIIDIR; - endif; - else - szDIR_GAME_JKII = DEFAULTJKIIDIR; - endif; - - // prompt user for game path - szTitle = "Jedi Knight II: Jedi Outcast game package"; - szMsg = "Select the folder where Jedi Knight II: Jedi Outcast is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_JKII, 0 ); - if (nResult = BACK) then - if (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_JKII: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Jedi Knight II: Jedi Outcast game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_JKII = szDIR_GAME_JKII ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_JKII; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_JKII); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_JKII); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #4 - if (DO_GAME_STVEF_BOOL == 1) then -Dlg_SdAskGamePath_STVEF: - - // guess the default game path from registry - DEFAULTSTVEFDIR = "C:\\Program Files\\Raven\\Star Trek Voyager Elite Force\\"; - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Star Trek: Voyager - Elite Force\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey + "GameData", "stvoy.exe", szSTVEF); - if (szSTVEF = "stvoy.exe") then - szDIR_GAME_STVEF = szRegKey; - else - szDIR_GAME_STVEF = DEFAULTSTVEFDIR; - endif; - else - szDIR_GAME_STVEF = DEFAULTSTVEFDIR; - endif; - - // prompt user for game path - szTitle = "Star Trek Voyage : Elite Force game package"; - szMsg = "Select the folder where Star Trek Voyage : Elite Force is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_STVEF, 0 ); - if (nResult = BACK) then - if (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_STVEF: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Star Trek Voyage : Elite Force game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_STVEF = szDIR_GAME_STVEF ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_STVEF; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_STVEF); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_STVEF); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #5, SofII - // --------------------------------------------------------------------------------- - if (DO_GAME_SOF2_BOOL == 1) then -Dlg_SdAskGamePath_SOF2: - - // guess the default game path from registry - DEFAULTSOF2DIR = "C:\\Program Files\\Soldier of Fortune II - Double Helix\\"; - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Soldier of Fortune II - Double Helix\\", "InstallPath", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey + "GameData", "sof2.exe", szSOF2); - if (szSOF2 = "sof2.exe") then - szDIR_GAME_SOF2 = szRegKey; - else - szDIR_GAME_SOF2 = DEFAULTSOF2DIR; - endif; - else - szDIR_GAME_SOF2 = DEFAULTSOF2DIR; - endif; - - // prompt user for game path - szTitle = "Soldier of Fortune II - Double Helix game package"; - szMsg = "Select the folder where Soldier of Fortune II - Double Helix is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_SOF2, 0 ); - if (nResult = BACK) then - if (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_SOF2: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Soldier of Fortune II - Double Helix game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_SOF2 = szDIR_GAME_SOF2 ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_SOF2; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_SOF2); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_SOF2); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #6 - // Hydra: note, for addition game packs, do NOT copy this one. - if (DO_GAME_HALFLIFE_BOOL == 1) then -Dlg_SdAskGamePath_HALFLIFE: - - // for halflife/cs put the default in first, then override - DEFAULTHALFLIFEDIR = "C:\\Sierra\\Half-Life\\"; - szDIR_GAME_HALFLIFE = DEFAULTHALFLIFEDIR; - // for the .game file generation we need a flag. - DO_GAME_CSTRIKE_BOOL = 0; - - // guess the default game path (Counter Strike Retail) - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Sierra OnLine\\Setup\\CSTRIKE\\", "Directory", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey, "cstrike.exe", szCStrike); - if (szCStrike = "cstrike.exe") then - szDIR_GAME_HALFLIFE = szRegKey; - DO_GAME_CSTRIKE_BOOL = 1; // set the flag - endif; - endif; - - if (szDIR_GAME_HALFLIFE = DEFAULTHALFLIFEDIR) then - // guess the default game path (HalfLife) - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Sierra OnLine\\Setup\\HALFLIFE\\", "Directory", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey, "hl.exe", szHL); - if (szHL = "hl.exe") then - szDIR_GAME_HALFLIFE = szRegKey; - endif; - endif; - endif; - - // prompt user for game path - szTitle = "Halflife / Counterstrike-Retail and mods game package"; - szMsg = "Select the folder where Halflife or Counterstrike-Retail is installed.\nclick Next."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_HALFLIFE, 0 ); - if (nResult = BACK) then - if (DO_GAME_SOF2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_SOF2; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_HALFLIFE: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Halflife game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_HALFLIFE = szDIR_GAME_HALFLIFE ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_HALFLIFE; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_HALFLIFE); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_HALFLIFE); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #7, ET - // --------------------------------------------------------------------------------- - if (DO_GAME_ET_BOOL == 1) then -Dlg_SdAskGamePath_ET: - - // guess the default game path from registry - DEFAULTETDIR = "C:\\Program Files\\Wolfenstein - Enemy Territory\\"; - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\Activision\\Wolfenstein - Enemy Territory\\", "InstallPath", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey + "GameData", "ET.exe", szET); - if (szET = "ET.exe") then - szDIR_GAME_ET = szRegKey; - else - szDIR_GAME_ET = DEFAULTETDIR; - endif; - else - szDIR_GAME_ET = DEFAULTETDIR; - endif; - - // prompt user for game path - szTitle = "Wolfenstein: Enemy Territory game package"; - szMsg = "Select the folder where Wolfenstein: Enemy Territory is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_ET, 0 ); - if (nResult = BACK) then - if (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_ET: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Wolfenstein: Enemy Territory game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_ET = szDIR_GAME_ET ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_ET; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_ET); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_ET); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #8, Quake - // --------------------------------------------------------------------------------- - if (DO_GAME_Q1_BOOL == 1) then -Dlg_SdAskGamePath_Q1: - - // guess the default game path from registry - DEFAULTQ1DIR = "C:\\quake\\"; - - FindFile (szRegKey + "GameData", "quake.exe", szQ1); - if (szQ1 = "quake.exe") then - szDIR_GAME_Q1 = szRegKey; - else - szDIR_GAME_Q1 = DEFAULTQ1DIR; - endif; - - // prompt user for game path - szTitle = "Quake game package"; - szMsg = "Select the folder where Quake is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q1, 0 ); - if (nResult = BACK) then - if (DO_GAME_ET_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_ET; - elseif (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_SOF2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_SOF2; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_Q1: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Quake game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_Q1 = szDIR_GAME_Q1 ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_Q1; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_Q1); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_Q1); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #8, JA - if (DO_GAME_JA_BOOL == 1) then -Dlg_SdAskGamePath_JA: - - // guess the default game path from registry - DEFAULTJADIR = "C:\\Program Files\\LucasArts\\Star Wars Jedi Knight Jedi Academy\\GameData"; - nKeyType = REGDB_STRING; - RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE); - nRegKey = RegDBGetKeyValueEx ("SOFTWARE\\LucasArts\\Star Wars Jedi Knight Jedi Academy\\1.0\\", "Install Path", nKeyType, szRegKey, nRegKeySize); - if (nRegKey = 0) then - FindFile (szRegKey + "GameData", "jasp.exe", szJKII); - if (szJKII = "jasp.exe") then - szDIR_GAME_JA = szRegKey; - else - szDIR_GAME_JA = DEFAULTJADIR; - endif; - else - szDIR_GAME_JA = DEFAULTJADIR; - endif; - - // prompt user for game path - szTitle = "Star Wars Jedi Knight Jedi Academy"; - szMsg = "Select the folder where Star Wars Jedi Knight Jedi Academy is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_JA, 0 ); - if (nResult = BACK) then - if (DO_GAME_Q1_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q1; - elseif (DO_GAME_ET_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_ET; - elseif (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_SOF2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_SOF2; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_JA: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Star Wars Jedi Knight Jedi Academy game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_JA = szDIR_GAME_JA ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_JA; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_JA); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_JA); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #9, Q2 - // --------------------------------------------------------------------------------- - if (DO_GAME_Q2_BOOL == 1) then -Dlg_SdAskGamePath_Q2: - - // guess the default game path from registry - szDIR_GAME_Q2 = "C:\\Quake2\\"; - - // prompt user for game path - szTitle = "Quake II"; - szMsg = "Select the folder where Quake II is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_Q2, 0 ); - if (nResult = BACK) then - if (DO_GAME_JA_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JA; - elseif (DO_GAME_Q1_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q1; - elseif (DO_GAME_ET_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_ET; - elseif (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_Q2: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Quake II game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_Q2 = szDIR_GAME_Q2 ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_Q2; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_Q2); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_Q2); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #10, HER2 - // --------------------------------------------------------------------------------- - if (DO_GAME_HER2_BOOL == 1) then -Dlg_SdAskGamePath_HER2: - - // guess the default game path from registry - szDIR_GAME_HER2 = "C:\\Heretic2\\"; - - // prompt user for game path - szTitle = "Heretic II"; - szMsg = "Select the folder where Heretic II is installed."; - nResult = SdAskDestPath( szTitle, szMsg, szDIR_GAME_HER2, 0 ); - if (nResult = BACK) then - if (DO_GAME_Q2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q2; - elseif (DO_GAME_JA_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JA; - elseif (DO_GAME_Q1_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q1; - elseif (DO_GAME_ET_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_ET; - elseif (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - - // prompt user for game subdir -Dlg_SdShowDlgEdit1_HER2: - szTitle = "Choose Folder\nEnter a folder name."; - szMsg = "Please enter the folder name for " + @PRODUCT_NAME + " Heretic II game pack in the edit field below.\nNOTE: This is for installation of the game specific files."; - nResult = SdShowDlgEdit1 (szTitle, szMsg, "Folder", szSubDir); - szDIR_GAMETOOLS_HER2 = szDIR_GAME_HER2 ^ szSubDir; - if (nResult = BACK) goto Dlg_SdAskGamePath_HER2; - - // set values in components - ComponentSetTarget (MEDIA, "", szDIR_GAME_HER2); - ComponentSetTarget (MEDIA, "", szDIR_GAMETOOLS_HER2); - - endif; - - // --------------------------------------------------------------------------------- - // game pack #11, 'TODO: add your game pack here' - // --------------------------------------------------------------------------------- - - // prompt for typical, custom etc. install -Dlg_SetupType: - szTitle = ""; - szMsg = ""; - nResult = SdSetupTypeEx (szTitle, szMsg, "", svSetupType, 0); - if (nResult = BACK) then - // FIXME TTimo wish we could stick labels into variables instead? - if (DO_GAME_HER2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HER2; - elseif (DO_GAME_Q2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q2; - elseif (DO_GAME_JA_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JA; - elseif (DO_GAME_Q1_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q1; - elseif (DO_GAME_ET_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_ET; - elseif (DO_GAME_HALFLIFE_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_HALFLIFE; - elseif (DO_GAME_SOF2_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_SOF2; - elseif (DO_GAME_STVEF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_STVEF; - elseif (DO_GAME_JKII_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_JKII; - elseif (DO_GAME_WOLF_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Wolf; - elseif (DO_GAME_Q3_BOOL == 1) then - goto Dlg_SdShowDlgEdit1_Q3; - elseif (DO_CORE_BOOL == 1) then - goto Dlg_SdAskCorePath; - else - goto Dlg_SdShowInfoList; - endif; - endif; - if (svSetupType = "custom") then - nResult = CUSTOM; - endif; - nSetupType = nResult; - -Dlg_SdComponentTree: - if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType; - szTitle = ""; - szMsg = ""; - szTargetdir = TARGETDIR; - szComponents = ""; - nLevel = 2; - if (nSetupType = CUSTOM) then - nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel); - if (nResult = BACK) goto Dlg_SetupType; - endif; - -Dlg_ObjDialogs: - nResult = ShowObjWizardPages(nResult); - if (nResult = BACK) goto Dlg_SdComponentTree; - -Dlg_SdSelectFolder: - szfolder = @FOLDER_NAME; - szTitle = ""; - szMsg = ""; - nResult = SdSelectFolder( szTitle, szMsg, szfolder ); - SHELL_OBJECT_FOLDER = szfolder; - if (nResult = BACK) goto Dlg_ObjDialogs; - - // push the list of stuff -Dlg_SdStartCopy: - szTitle = ""; - szMsg = ""; - listStartCopy = ListCreate( STRINGLIST ); - if (DO_CORE_BOOL == 1) then - ListAddString(listStartCopy,@PRODUCT_NAME + " core installation directory:",AFTER); - ListAddString(listStartCopy," " + TARGETDIR,AFTER); - endif; - if (DO_GAME_Q3_BOOL == 1) then - ListAddString(listStartCopy,"Quake III Arena folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_Q3,AFTER); - ListAddString(listStartCopy,"Quake III Arena mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_Q3,AFTER); - endif; - if (DO_GAME_WOLF_BOOL == 1) then - ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_WOLF,AFTER); - ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_WOLF,AFTER); - endif; - if (DO_GAME_JKII_BOOL == 1) then - ListAddString(listStartCopy,"Jedi Knight II: Jedi Outcast folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_JKII,AFTER); - ListAddString(listStartCopy,"Jedi Knight II: Jedi Outcast mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_JKII,AFTER); - endif; - if (DO_GAME_STVEF_BOOL == 1) then - ListAddString(listStartCopy,"Star Trek Voyager : Elite Force folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_STVEF,AFTER); - ListAddString(listStartCopy,"Star Trek Voyager : Elite Force mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_STVEF,AFTER); - endif; - if (DO_GAME_SOF2_BOOL == 1) then - ListAddString(listStartCopy,"Soldier of Fortune II - Double Helix folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_SOF2,AFTER); - ListAddString(listStartCopy,"Soldier of Fortune II - Double Helix mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_SOF2,AFTER); - endif; - if (DO_GAME_HALFLIFE_BOOL == 1) then - ListAddString(listStartCopy,"Halflife or CounterStrike-Retail folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_HALFLIFE,AFTER); - ListAddString(listStartCopy,"Halflife or CounterStrike-Retail mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_HALFLIFE,AFTER); - endif; - if (DO_GAME_ET_BOOL == 1) then - ListAddString(listStartCopy,"Wolfenstein: Enemy Territory folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_ET,AFTER); - ListAddString(listStartCopy,"Wolfenstein: Enemy Territory mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_ET,AFTER); - endif; - if (DO_GAME_Q1_BOOL == 1) then - ListAddString(listStartCopy,"Quake folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_Q1,AFTER); - ListAddString(listStartCopy,"Quake mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_Q1,AFTER); - endif; - if (DO_GAME_JA_BOOL == 1) then - ListAddString(listStartCopy,"Star Wars Jedi Knight Jedi Academy folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_JA,AFTER); - ListAddString(listStartCopy,"Star Wars Jedi Knight Jedi Academy mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_JA,AFTER); - endif; - if (DO_GAME_Q2_BOOL == 1) then - ListAddString(listStartCopy,"Quake II folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_Q2,AFTER); - ListAddString(listStartCopy,"Quake II mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_Q2,AFTER); - endif; - if (DO_GAME_HER2_BOOL == 1) then - ListAddString(listStartCopy,"Heretic II folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAME_HER2,AFTER); - ListAddString(listStartCopy,"Heretic II mapping package folder:",AFTER); - ListAddString(listStartCopy," " + szDIR_GAMETOOLS_HER2,AFTER); - endif; - ListAddString(listStartCopy,"Setup type: ",AFTER); - ListAddString(listStartCopy," " + svSetupType,AFTER); - nResult = SdStartCopy( szTitle, szMsg, listStartCopy ); - ListDestroy(listStartCopy); - if (nResult = BACK) goto Dlg_SdSelectFolder; - - // setup default status - SetStatusWindow(0, ""); - Enable(STATUSEX); - StatusUpdate(ON, 100); - - - return 0; -end; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: OnMoving -// -// EVENT: Moving event is sent when file transfer is started as a result of -// ComponentTransferData call, before any file transfer operations -// are performed. -// -/////////////////////////////////////////////////////////////////////////////// -function OnMoving() - STRING szAppPath; -begin - // Set LOGO Compliance Application Path - // NOTE TTimo - // doc on RegDBSetItem says before calling you must call the InstallationInfo - // function, which provides information used to create the key - szAppPath = TARGETDIR; - RegDBSetItem(REGDB_APPPATH, szAppPath); - RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY); -end; - -///////////////////////////////////////////////////////////////////////////////// -// The OnMoved event handler responds to the Moved event that is generated just -// after all selected components have been installed or uninstalled on the -// target computer. -///////////////////////////////////////////////////////////////////////////////// - -function OnMoved() - NUMBER nvFileHandle; -begin - if !MAINTENANCE then - // generate RADIANT_MAJOR and RADIANT_MINOR file items - if (CreateFile(nvFileHandle, TARGETDIR, "RADIANT_MAJOR")< 0) then - MessageBox ("CreateFile " + TARGETDIR + "\\RADIANT_MAJOR failed.", SEVERE); - abort; - endif; - // template - WriteLine(nvFileHandle, "<>"); - CloseFile(nvFileHandle); - if (CreateFile(nvFileHandle, TARGETDIR, "RADIANT_MINOR")< 0) then - MessageBox ("CreateFile " + TARGETDIR + "\\RADIANT_MINOR failed.", SEVERE); - abort; - endif; - // template - WriteLine(nvFileHandle, "<>"); - CloseFile(nvFileHandle); - // generate the config files for the game packages - // NOTE: we are directly creating them, not using XCopyFile - // that means those won't be uninstalled, doesn't look like a big problem to me - if (DO_GAME_Q3_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q3.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q3.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_WOLF_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_JKII_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "jk2.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\jk2.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_STVEF_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "stvef.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\stvef.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_SOF2_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "sof2.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\sof2.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_HALFLIFE_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "hl.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\hl.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_ET_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "et.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\et.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_Q1_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q1.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q1.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_JA_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "ja.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\ja.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_Q2_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "q2.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\q2.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - if (DO_GAME_HER2_BOOL == 1) then - if (CreateDir(TARGETDIR ^ "games")< 0) then - // Report the error; then abort. - MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE); - abort; - endif; - if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "heretic2.game")< 0) then - // Report the error. - MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\heretic2.game failed.", SEVERE); - abort; - endif; - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - WriteLine(nvFileHandle, ""); - CloseFile(nvFileHandle); - endif; - - endif; -end; - -// --- include script file section --- diff --git a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/_IsUser.dll b/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/_IsUser.dll deleted file mode 100644 index 08c60142..00000000 Binary files a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/_IsUser.dll and /dev/null differ diff --git a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt deleted file mode 100644 index 9996ddef..00000000 --- a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt +++ /dev/null @@ -1,35 +0,0 @@ -GtkRadiant Win32 ----------------- - -Games currently supported: -Quake III Arena and Quake III: Team Arena -Return To Castle Wolfenstein -Wolfenstein: Enemy Territory -Star Wars - Jedi Knight II : Jedi Outcast -Star Wars Jedi Knight Jedi Academy -Star Trek Voyager : Elite Force -Soldier of Fortune II - Double Helix -Half-Life / Counter Strike -Quake II -Heretic II - -GtkRadiant is a cross-platform version of Q3Radiant. -The editor runs on Windows 98/ME/NT/2000 and linux x86 - - -The initial GTK port of Q3Radiant was done by Leonardo Zide. - - -This release was made possible by the many contributions of -the mapping community and the help of Loki software. -It contains technology from Id Software -and various additions/updates from contributors which are -placed under open source licenses. -All Id materials including Radiant binaries and original -textures, models, original shader scripts and Q3Radiant manual -are under the Q3 Tools EULA. -All other materials are the property of their respective owners. - -Please check the Help menu in Radiant for the Credits page. - -Stay tuned to http://www.qeradiant.com for updates \ No newline at end of file diff --git a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/license.txt b/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/license.txt deleted file mode 100644 index f69c934b..00000000 --- a/setup/win32/template/Setup Files/Compressed Files/Language Independent/OS Independent/license.txt +++ /dev/null @@ -1,45 +0,0 @@ - LIMITED USE SOFTWARE LICENSE AGREEMENT - -This Limited Use Software License Agreement (the "Agreement") is a legal agreement between you, the end-user, and Id Software, Inc. ("ID"). BY CONTINUING THE INSTALLATION OF THIS SOFTWARE (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. - -1. Grant of License. Subject to the terms and provisions of this Agreement, ID grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software. You are not receiving any ownership or proprietary right, title or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device and means the uses permitted in section 3. hereinbelow. You agree that the Software will not be shipped, transferred or exported into any country in violation of the U.S. Export Administration Act (or any other law governing such matters) by you or anyone at your direction and that you will not utilize and will not authorize anyone to utilize, in any other manner, the Software in violation of any applicable law. The Software shall not be downloaded or otherwise exported or reexported into (or to a national or resident of) any country to which the U.S. has embargoed goods or to anyone or into any country who/which are prohibited, by applicable law, from receiving such property. - -2. Prohibitions. You, whether directly or indirectly, shall not do any of the following acts: - -a. rent the Software; - -b. sell the Software; - -c. lease or lend the Software; - -d. distribute the Software (except as permitted by section 3. hereinbelow); - -e. in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose; - -f. disassemble, reverse engineer, decompile, modify or alter the Software; - -g. translate the Software; - -h. reproduce or copy the Software (except as permitted by section 3. hereinbelow); - -i. publicly display the Software; - -j. prepare or develop derivative works based upon the Software; or - -k. remove or alter any legal notices or other markings or legends, such as trademark and copyright notices, affixed on or within the Software. - - -3. Permitted Uses. So long as this Agreement accompanies each copy you make of the Software, and so long as you fully comply, at all times, with this Agreement, ID grants to you the non-exclusive and limited right to distribute copies of the Software free of charge for non-commercial purposes by electronic means only and the non-exclusive and limited right to use the Software to create your own modifications for operation only with the full version of the software game QUAKE III ARENA; provided, however, you shall not make any modifications unless and until you have agreed to be bound by the terms of the LIMITED USE SOFTWARE LICENSE AGREEMENT which accompanies the full version of QUAKE III ARENA. Other than the electronic copies permitted above, you may make only the following copies of the Software: (i) you may copy the Software onto your computer hard drive; (ii) you may copy the Software from your computer hard drive into your computer RAM; and (iii) you may make one (1) "back-up" or archival copy of the Software on one (1) hard disk. You shall not use, copy or distribute the Software in any infringing manner or in any manner which violates any law or third party right and you shall not distribute the Software together with any material which infringes against any third party right or which is libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. ID reserves all rights not granted in this Agreement, including, without limitation, all rights to ID's trademarks. You shall not commercially distribute the Software. - -4. Intellectual Property Rights. The Software and all copyrights, trademarks and all other conceivable intellectual property rights related to the Software are owned by ID and are protected by United States copyright laws, international treaty provisions and all applicable law, such as the Lanham Act. You must treat the Software like any other copyrighted material, as required by 17 U.S.C. §101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder complies with this Agreement. You agree that you are receiving a copy of the Software by license only and not by sale and that the "first sale" doctrine of 17 U.S.C. §109 does not apply to your receipt or use of the Software. - -5. NO WARRANTIES. ID DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE. ID DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID AND SHOULD NOT BE RELIED UPON. THIS SECTION 5. SHALL SURVIVE CANCELLATION OR TERMINATION OF THIS AGREEMENT. - -6. Governing Law, Venue, Indemnity and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas and applicable United States federal law. Copyright and other proprietary matters will be governed by United States laws and international treaties. Exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas and you agree to submit to the jurisdiction of the courts in Dallas, Texas for any such litigation. You agree to indemnify, defend and hold harmless ID and ID's officers, employees, directors, agents, licensees (excluding you), successors and assigns from and against all losses, lawsuits, damages, causes of action and claims relating to and/or arising from your breach of this Agreement and/or your distribution or other use of the Software. You agree that your unauthorized use of the Software, or any part thereof, may immediately and irreparably damage ID such that ID could not be adequately compensated solely by a monetary award and that at ID's option ID shall be entitled to an injunctive order, in addition to all other available remedies including a monetary award, appropriately restraining and/or prohibiting such unauthorized use without the necessity of ID posting bond or other security. IN ANY CASE, ID AND ID'S OFFICERS, EMPLOYEES, DIRECTORS, AGENTS, LICENSEES, SUBLICENSEES, SUCCESSORS AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, PUNITIVE OR OTHER SIMILAR DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID OR ITS AGENTS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This Section 6. shall survive cancellation or termination of this Agreement. - -7. U.S. Government Restricted Rights. To the extent applicable, the United States Government shall only have those rights to use the Software as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, inclusive. - -8. General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. ID may assign its rights under this Agreement in ID's sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of ID to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. Immediately upon your failure to comply with or breach of any term or provision of this Agreement, THIS AGREEMENT AND YOUR LICENSE SHALL AUTOMATICALLY TERMINATE, WITHOUT NOTICE, AND ID MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU WHICH ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. In the event this Agreement is terminated, you shall have no right to use the Software, in any manner, and you shall immediately destroy all copies of the Software in your possession, custody or control. - -YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS BETWEEN ID AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT. - diff --git a/setup/win32/template/Shell Objects/Default.shl b/setup/win32/template/Shell Objects/Default.shl deleted file mode 100644 index 0d31651c..00000000 --- a/setup/win32/template/Shell Objects/Default.shl +++ /dev/null @@ -1,126 +0,0 @@ -[Info] -Type=ShellObject -Version=2.10.000 - -[Data] -Folder0= -Folder1= -Folder2= -Folder3= -Group0=Main -Group1=Startup -Folder4=Folder2\GtkRadiant -Shortcut0=Folder4\GtkRadiant -Shortcut1=Folder4\Radiant Manual -Shortcut2=Folder4\Links -Shortcut3=Folder4\RTCW + GtkRadiant, Getting Started guide -Shortcut4=Folder4\JK2 + GtkRadiant, Getting Started guide -Shortcut5=Folder4\STVEF + GtkRadiant, Getting Started guide - -[Folder4] -Comments= -DisplayText= -Shared=Yes - -[Shortcut0] -DisplayText=PRODUCT_NAME -Target=\<> -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=Program Executable Files - -[Shortcut1] -DisplayText= -Target=\q3rad_manual\index.htm -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=Radiant Manual Files - -[Shortcut2] -DisplayText= -Target=\links.htm -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=Program Misc Files - -[Shortcut3] -DisplayText= -Target=\docs\GtkRadiant_WOLF_HOWTO\index.html -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=Wolf Exectuable Files - -[Shortcut4] -DisplayText= -Target=\docs\GtkRadiant_JK2_HOWTO\index.html -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=JKII Executable Files - -[Shortcut5] -DisplayText= -Target=\docs\GtkRadiant_STVEF_HOWTO\index.html -Parameters= -StartIn= -ShortcutKey= -Run=Normal Window -IconFile= -IconIndex= -Replace=Yes -SeparateMemorySpace=No -InternetShortcut=No -Uninstall=Yes -Type=Automatic -Comments= -FileGroup0=STVEF Executable Files - diff --git a/setup/win32/template/String Tables/0009-English/value.shl b/setup/win32/template/String Tables/0009-English/value.shl deleted file mode 100644 index ee19017c..00000000 --- a/setup/win32/template/String Tables/0009-English/value.shl +++ /dev/null @@ -1,16 +0,0 @@ -[General] -Type=STRINGTABLESPECIFIC -Version=1.00.000 -Language=0009 - -[Data] -TITLE_MAIN=GtkRadiant -TITLE_CAPTIONBAR=GtkRadiant Setup -COMPANY_NAME=QERadiant.com -PRODUCT_NAME=GtkRadiant-<> -PRODUCT_KEY=<> -PRODUCT_VERSION=<> -FOLDER_NAME=<> -DEFAULTQUAKE3DIR=C:\Program Files\Quake III Arena -DEFAULTRTCWDIR=C:\Program Files\Return To Castle Wolfenstein - diff --git a/setup/win32/template/String Tables/Default.shl b/setup/win32/template/String Tables/Default.shl deleted file mode 100644 index f8fae252..00000000 --- a/setup/win32/template/String Tables/Default.shl +++ /dev/null @@ -1,47 +0,0 @@ -[GENERAL] -TYPE=STRINGTABLE -VERSION=1.00.000 - -[LANGUAGE] -CURRENTLANG=0 -LANG0=0009 -LANG1=0000 - -[TITLE_MAIN] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[DATA] -ENTRY0=TITLE_MAIN -ENTRY1=TITLE_CAPTIONBAR -ENTRY2=COMPANY_NAME -ENTRY3=PRODUCT_NAME -ENTRY4=PRODUCT_KEY -ENTRY5=PRODUCT_VERSION -ENTRY6=FOLDER_NAME -ENTRY7=DEFAULTQUAKE3DIR -ENTRY8=DEFAULTRTCWDIR - -[TITLE_CAPTIONBAR] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[COMPANY_NAME] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[PRODUCT_NAME] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[PRODUCT_KEY] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[PRODUCT_VERSION] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[FOLDER_NAME] -Comment=Do not delete. Setup requires this Identifier even if your script doesn't use it. - -[DEFAULTQUAKE3DIR] -Comment= - -[DEFAULTRTCWDIR] -Comment= - diff --git a/setup/win32/template/Text Substitutions/Build.tsb b/setup/win32/template/Text Substitutions/Build.tsb deleted file mode 100644 index f18328d8..00000000 --- a/setup/win32/template/Text Substitutions/Build.tsb +++ /dev/null @@ -1,41 +0,0 @@ -[Data] -Key0= -Key1= -Key2= -Key3= -Key4= -Key5= -Key6= - -[General] -Type=TEXTSUB -Version=1.20.000 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value=c:\quake\gtkradiant_latest\ -KeyType=3 - -[] -Value= -KeyType=3 - diff --git a/setup/win32/template/Text Substitutions/Setup.tsb b/setup/win32/template/Text Substitutions/Setup.tsb deleted file mode 100644 index 93bd8ce8..00000000 --- a/setup/win32/template/Text Substitutions/Setup.tsb +++ /dev/null @@ -1,238 +0,0 @@ -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[Data] -Key0= -Key1= -Key2= -Key3= -Key4= -Key9= -Key5= -Key10= -Key6= -Key11= -Key7= -Key8= -Key12= -Key13= -Key14= -Key15= -Key16= -Key17= -Key18= -Key19= -Key20= -Key21= -Key22= -Key23= -Key24= -Key25= -Key26= -Key27= -Key28= -Key29= -Key30= -Key31= -Key32= -Key33= -Key34= -Key35= -Key36= -Key37= -Key38= -Key39= -Key40= -Key41= -Key42= -Key43= -Key44= -Key45= -Key46= -Key47= - -[] -Value= -KeyType=4 - -[General] -Type=TEXTSUB -Version=1.10.000 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=4 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - -[] -Value= -KeyType=3 - diff --git a/setup/win32/warsow_mapping_files.xml b/setup/win32/warsow_mapping_files.xml deleted file mode 100644 index cd966d39..00000000 --- a/setup/win32/warsow_mapping_files.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/setup/win32/wolf.cf b/setup/win32/wolf.cf deleted file mode 100644 index 6f7d0f1f..00000000 --- a/setup/win32/wolf.cf +++ /dev/null @@ -1,7 +0,0 @@ -# Core + Wolf game pack - -# output dir name -$SETUP_DIR = 'Setup-Wolf'; - -$DO_CORE = 1; -$DO_GAME_WOLF = 1; diff --git a/setup/win32/wolf_example_maps.xml b/setup/win32/wolf_example_maps.xml deleted file mode 100644 index 7ced580f..00000000 --- a/setup/win32/wolf_example_maps.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/svn.py b/svn.py deleted file mode 100644 index 68d60457..00000000 --- a/svn.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -import sys - -def getRevision(path): - cmd = os.popen("svn info " + path) - - while True: - line = cmd.readline() - if line == "": - raise Exception("failed to obtain revision number") - for word in line.split(): - try: - return int(word) - except: - pass - diff --git a/tools/quake2/common/bspfile.c b/tools/quake2/common/bspfile.c index 05808c51..df3f059b 100644 --- a/tools/quake2/common/bspfile.c +++ b/tools/quake2/common/bspfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/bspfile.h b/tools/quake2/common/bspfile.h index e11ec208..f25329fb 100644 --- a/tools/quake2/common/bspfile.h +++ b/tools/quake2/common/bspfile.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/cmdlib.c b/tools/quake2/common/cmdlib.c index e59bf215..68a16d82 100644 --- a/tools/quake2/common/cmdlib.c +++ b/tools/quake2/common/cmdlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -93,7 +93,7 @@ Mimic unix command line expansion #define MAX_EX_ARGC 1024 int ex_argc; char *ex_argv[MAX_EX_ARGC]; -#ifdef WIN32 +#ifdef _WIN32 #include "io.h" void ExpandWildcards( int *argc, char ***argv ) { @@ -337,7 +337,7 @@ void Q_getwd (char *out) { int i = 0; -#ifdef WIN32 +#ifdef _WIN32 _getcwd (out, 256); strcat (out, "\\"); #else @@ -356,7 +356,7 @@ void Q_getwd (char *out) void Q_mkdir (const char *path) { -#ifdef WIN32 +#ifdef _WIN32 if (_mkdir (path) != -1) return; #else @@ -1159,7 +1159,7 @@ void CreatePath (const char *path) char c; char dir[1024]; -#ifdef WIN32 +#ifdef _WIN32 int olddrive = -1; if ( path[1] == ':' ) @@ -1183,7 +1183,7 @@ void CreatePath (const char *path) } } -#ifdef WIN32 +#ifdef _WIN32 if ( olddrive != -1 ) { _chdrive( olddrive ); @@ -1212,7 +1212,7 @@ void QCopyFile (const char *from, const char *to) void Sys_Sleep(int n) { -#ifdef WIN32 +#ifdef _WIN32 Sleep (n); #endif #if defined (__linux__) || defined (__APPLE__) diff --git a/tools/quake2/common/cmdlib.h b/tools/quake2/common/cmdlib.h index 42bd1dee..02ced5be 100644 --- a/tools/quake2/common/cmdlib.h +++ b/tools/quake2/common/cmdlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float @@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #endif -#ifdef WIN32 +#ifdef _WIN32 #pragma intrinsic( memset, memcpy ) #endif diff --git a/tools/quake2/common/inout.c b/tools/quake2/common/inout.c index 3cf66e7f..33eac651 100644 --- a/tools/quake2/common/inout.c +++ b/tools/quake2/common/inout.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "l_net/l_net.h" #include "libxml/tree.h" -#ifdef WIN32 +#ifdef _WIN32 HWND hwndOut = NULL; qboolean lookedForServer = false; UINT wm_BroadcastCommand = -1; diff --git a/tools/quake2/common/inout.h b/tools/quake2/common/inout.h index 75ef55ee..05b56a09 100644 --- a/tools/quake2/common/inout.h +++ b/tools/quake2/common/inout.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/l3dslib.c b/tools/quake2/common/l3dslib.c index f120bec2..e9b25681 100644 --- a/tools/quake2/common/l3dslib.c +++ b/tools/quake2/common/l3dslib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/l3dslib.h b/tools/quake2/common/l3dslib.h index 1d362ce9..bb2c4991 100644 --- a/tools/quake2/common/l3dslib.h +++ b/tools/quake2/common/l3dslib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/lbmlib.c b/tools/quake2/common/lbmlib.c index edc2c3e4..5039dab6 100644 --- a/tools/quake2/common/lbmlib.c +++ b/tools/quake2/common/lbmlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/lbmlib.h b/tools/quake2/common/lbmlib.h index 40e6dce6..b51017da 100644 --- a/tools/quake2/common/lbmlib.h +++ b/tools/quake2/common/lbmlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/mathlib.c b/tools/quake2/common/mathlib.c index b912b450..84ebb2d9 100644 --- a/tools/quake2/common/mathlib.c +++ b/tools/quake2/common/mathlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/mathlib.h b/tools/quake2/common/mathlib.h index eb10f0fc..dc350ba3 100644 --- a/tools/quake2/common/mathlib.h +++ b/tools/quake2/common/mathlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/md4.c b/tools/quake2/common/md4.c index 95fa4a1a..e69de29b 100644 --- a/tools/quake2/common/md4.c +++ b/tools/quake2/common/md4.c @@ -1,297 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -/* GLOBAL.H - RSAREF types and constants */ - -#include - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - - -/* MD4.H - header file for MD4C.C */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. - -All rights reserved. - -License to copy and use this software is granted provided that it is identified as the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided as is without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* MD4 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD4_CTX; - -void MD4Init (MD4_CTX *); -void MD4Update (MD4_CTX *, unsigned char *, unsigned int); -void MD4Final (unsigned char [16], MD4_CTX *); - - - -/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ -/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. - -License to copy and use this software is granted provided that it is identified as the -RSA Data Security, Inc. MD4 Message-Digest Algorithm - in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as -derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm -in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided -as is without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* Constants for MD4Transform routine. */ -#define S11 3 -#define S12 7 -#define S13 11 -#define S14 19 -#define S21 3 -#define S22 5 -#define S23 9 -#define S24 13 -#define S31 3 -#define S32 9 -#define S33 11 -#define S34 15 - -static void MD4Transform (UINT4 [4], unsigned char [64]); -static void Encode (unsigned char *, UINT4 *, unsigned int); -static void Decode (UINT4 *, unsigned char *, unsigned int); -static void MD4_memcpy (POINTER, POINTER, unsigned int); -static void MD4_memset (POINTER, int, unsigned int); - -static unsigned char PADDING[64] = { -0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G and H are basic MD4 functions. */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -/* ROTATE_LEFT rotates x left n bits. */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG and HH are transformations for rounds 1, 2 and 3 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s) {(a) += F ((b), (c), (d)) + (x); (a) = ROTATE_LEFT ((a), (s));} - -#define GG(a, b, c, d, x, s) {(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; (a) = ROTATE_LEFT ((a), (s));} - -#define HH(a, b, c, d, x, s) {(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; (a) = \ -ROTATE_LEFT ((a), (s)); } - - -/* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (MD4_CTX *context) -{ - context->count[0] = context->count[1] = 0; - -/* Load magic initialization constants.*/ -context->state[0] = 0x67452301; -context->state[1] = 0xefcdab89; -context->state[2] = 0x98badcfe; -context->state[3] = 0x10325476; -} - -/* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ -void MD4Update (MD4_CTX *context, unsigned char *input, unsigned int inputLen) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3))< ((UINT4)inputLen << 3)) - context->count[1]++; - - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible.*/ - if (inputLen >= partLen) - { - memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD4Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD4Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); -} - - -/* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[16], MD4_CTX *context) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64.*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD4Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD4Update (context, bits, 8); - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information.*/ - memset ((POINTER)context, 0, sizeof (*context)); -} - - -/* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (UINT4 state[4], unsigned char block[64]) -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - -/* Round 1 */ -FF (a, b, c, d, x[ 0], S11); /* 1 */ -FF (d, a, b, c, x[ 1], S12); /* 2 */ -FF (c, d, a, b, x[ 2], S13); /* 3 */ -FF (b, c, d, a, x[ 3], S14); /* 4 */ -FF (a, b, c, d, x[ 4], S11); /* 5 */ -FF (d, a, b, c, x[ 5], S12); /* 6 */ -FF (c, d, a, b, x[ 6], S13); /* 7 */ -FF (b, c, d, a, x[ 7], S14); /* 8 */ -FF (a, b, c, d, x[ 8], S11); /* 9 */ -FF (d, a, b, c, x[ 9], S12); /* 10 */ -FF (c, d, a, b, x[10], S13); /* 11 */ -FF (b, c, d, a, x[11], S14); /* 12 */ -FF (a, b, c, d, x[12], S11); /* 13 */ -FF (d, a, b, c, x[13], S12); /* 14 */ -FF (c, d, a, b, x[14], S13); /* 15 */ -FF (b, c, d, a, x[15], S14); /* 16 */ - -/* Round 2 */ -GG (a, b, c, d, x[ 0], S21); /* 17 */ -GG (d, a, b, c, x[ 4], S22); /* 18 */ -GG (c, d, a, b, x[ 8], S23); /* 19 */ -GG (b, c, d, a, x[12], S24); /* 20 */ -GG (a, b, c, d, x[ 1], S21); /* 21 */ -GG (d, a, b, c, x[ 5], S22); /* 22 */ -GG (c, d, a, b, x[ 9], S23); /* 23 */ -GG (b, c, d, a, x[13], S24); /* 24 */ -GG (a, b, c, d, x[ 2], S21); /* 25 */ -GG (d, a, b, c, x[ 6], S22); /* 26 */ -GG (c, d, a, b, x[10], S23); /* 27 */ -GG (b, c, d, a, x[14], S24); /* 28 */ -GG (a, b, c, d, x[ 3], S21); /* 29 */ -GG (d, a, b, c, x[ 7], S22); /* 30 */ -GG (c, d, a, b, x[11], S23); /* 31 */ -GG (b, c, d, a, x[15], S24); /* 32 */ - -/* Round 3 */ -HH (a, b, c, d, x[ 0], S31); /* 33 */ -HH (d, a, b, c, x[ 8], S32); /* 34 */ -HH (c, d, a, b, x[ 4], S33); /* 35 */ -HH (b, c, d, a, x[12], S34); /* 36 */ -HH (a, b, c, d, x[ 2], S31); /* 37 */ -HH (d, a, b, c, x[10], S32); /* 38 */ -HH (c, d, a, b, x[ 6], S33); /* 39 */ -HH (b, c, d, a, x[14], S34); /* 40 */ -HH (a, b, c, d, x[ 1], S31); /* 41 */ -HH (d, a, b, c, x[ 9], S32); /* 42 */ -HH (c, d, a, b, x[ 5], S33); /* 43 */ -HH (b, c, d, a, x[13], S34); /* 44 */ -HH (a, b, c, d, x[ 3], S31); /* 45 */ -HH (d, a, b, c, x[11], S32); /* 46 */ -HH (c, d, a, b, x[ 7], S33); /* 47 */ -HH (b, c, d, a, x[15], S34); /* 48 */ - -state[0] += a; -state[1] += b; -state[2] += c; -state[3] += d; - - /* Zeroize sensitive information.*/ - memset ((POINTER)x, 0, sizeof (x)); -} - - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (unsigned char *output, UINT4 *input, unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (UINT4 *output, unsigned char *input, unsigned int len) -{ -unsigned int i, j; - -for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -//=================================================================== - -unsigned Com_BlockChecksum (void *buffer, int length) -{ - int digest[4]; - unsigned val; - MD4_CTX ctx; - - MD4Init (&ctx); - MD4Update (&ctx, (unsigned char *)buffer, length); - MD4Final ( (unsigned char *)digest, &ctx); - - val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3]; - - return val; -} diff --git a/tools/quake2/common/path_init.c b/tools/quake2/common/path_init.c index d309e95c..bf731c99 100644 --- a/tools/quake2/common/path_init.c +++ b/tools/quake2/common/path_init.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -18,9 +17,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Nurail: Swiped from Q3Map2 - */ diff --git a/tools/quake2/common/polylib.c b/tools/quake2/common/polylib.c index e177d728..6639d241 100644 --- a/tools/quake2/common/polylib.c +++ b/tools/quake2/common/polylib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/polylib.h b/tools/quake2/common/polylib.h index d89062d5..43515cf3 100644 --- a/tools/quake2/common/polylib.h +++ b/tools/quake2/common/polylib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/q2_threads.h b/tools/quake2/common/q2_threads.h index b8fc2f53..2b20c8d7 100644 --- a/tools/quake2/common/q2_threads.h +++ b/tools/quake2/common/q2_threads.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/qfiles.h b/tools/quake2/common/qfiles.h index 7c9cc864..1dd9d0ae 100644 --- a/tools/quake2/common/qfiles.h +++ b/tools/quake2/common/qfiles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -32,7 +32,7 @@ The .pak files are just a linear collapse of a directory tree ======================================================================== */ -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float diff --git a/tools/quake2/common/scriplib.c b/tools/quake2/common/scriplib.c index 9cab6391..07600a08 100644 --- a/tools/quake2/common/scriplib.c +++ b/tools/quake2/common/scriplib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/scriplib.h b/tools/quake2/common/scriplib.h index d07a9bb4..48a75c6a 100644 --- a/tools/quake2/common/scriplib.h +++ b/tools/quake2/common/scriplib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/threads.c b/tools/quake2/common/threads.c index 76e969da..a2e8a810 100644 --- a/tools/quake2/common/threads.c +++ b/tools/quake2/common/threads.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -110,7 +110,7 @@ WIN32 =================================================================== */ -#ifdef WIN32 +#ifdef _WIN32 #define USED diff --git a/tools/quake2/common/trilib.c b/tools/quake2/common/trilib.c index 6192b71a..05b0cf36 100644 --- a/tools/quake2/common/trilib.c +++ b/tools/quake2/common/trilib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/common/trilib.h b/tools/quake2/common/trilib.h index 5c32244a..4cdad831 100644 --- a/tools/quake2/common/trilib.h +++ b/tools/quake2/common/trilib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/brushbsp.c b/tools/quake2/q2map/brushbsp.c index 53985b03..63f861b7 100644 --- a/tools/quake2/q2map/brushbsp.c +++ b/tools/quake2/q2map/brushbsp.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/csg.c b/tools/quake2/q2map/csg.c index 2e058299..dc2bdab4 100644 --- a/tools/quake2/q2map/csg.c +++ b/tools/quake2/q2map/csg.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/faces.c b/tools/quake2/q2map/faces.c index 03d5b955..4839f9c0 100644 --- a/tools/quake2/q2map/faces.c +++ b/tools/quake2/q2map/faces.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/flow.c b/tools/quake2/q2map/flow.c index 8bd8022a..d831fbf0 100644 --- a/tools/quake2/q2map/flow.c +++ b/tools/quake2/q2map/flow.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/gldraw.c b/tools/quake2/q2map/gldraw.c index 6e249c31..d36355f8 100644 --- a/tools/quake2/q2map/gldraw.c +++ b/tools/quake2/q2map/gldraw.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/glfile.c b/tools/quake2/q2map/glfile.c index 6e98bd0f..b08053bd 100644 --- a/tools/quake2/q2map/glfile.c +++ b/tools/quake2/q2map/glfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/leakfile.c b/tools/quake2/q2map/leakfile.c index 8753eec5..6c814b20 100644 --- a/tools/quake2/q2map/leakfile.c +++ b/tools/quake2/q2map/leakfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/lightmap.c b/tools/quake2/q2map/lightmap.c index 8a9580b7..cc5da84d 100644 --- a/tools/quake2/q2map/lightmap.c +++ b/tools/quake2/q2map/lightmap.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/main.c b/tools/quake2/q2map/main.c index 5ed8daca..810205a5 100644 --- a/tools/quake2/q2map/main.c +++ b/tools/quake2/q2map/main.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/map.c b/tools/quake2/q2map/map.c index 818f2a1d..05e9df36 100644 --- a/tools/quake2/q2map/map.c +++ b/tools/quake2/q2map/map.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/nodraw.c b/tools/quake2/q2map/nodraw.c index 888b2570..e473fb34 100644 --- a/tools/quake2/q2map/nodraw.c +++ b/tools/quake2/q2map/nodraw.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/patches.c b/tools/quake2/q2map/patches.c index 2ff82315..8b9b75fb 100644 --- a/tools/quake2/q2map/patches.c +++ b/tools/quake2/q2map/patches.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/portals.c b/tools/quake2/q2map/portals.c index d0c9ea07..9857a3ba 100644 --- a/tools/quake2/q2map/portals.c +++ b/tools/quake2/q2map/portals.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/prtfile.c b/tools/quake2/q2map/prtfile.c index 790db065..bfac302c 100644 --- a/tools/quake2/q2map/prtfile.c +++ b/tools/quake2/q2map/prtfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/q2map.h b/tools/quake2/q2map/q2map.h index 331b35df..7303263c 100644 --- a/tools/quake2/q2map/q2map.h +++ b/tools/quake2/q2map/q2map.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #endif -#ifdef WIN32 +#ifdef _WIN32 #include #endif diff --git a/tools/quake2/q2map/q2map.vcproj b/tools/quake2/q2map/q2map.vcproj index 5f3652a2..90818f91 100644 --- a/tools/quake2/q2map/q2map.vcproj +++ b/tools/quake2/q2map/q2map.vcproj @@ -1,443 +1,153 @@ - - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/tools/quake2/q2map/qbsp.c b/tools/quake2/q2map/qbsp.c index 2809390c..4f1180da 100644 --- a/tools/quake2/q2map/qbsp.c +++ b/tools/quake2/q2map/qbsp.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/qbsp.h b/tools/quake2/q2map/qbsp.h index cc5c822a..47d8d4b5 100644 --- a/tools/quake2/q2map/qbsp.h +++ b/tools/quake2/q2map/qbsp.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -46,7 +46,7 @@ writebsp.c #include "bspfile.h" #include "inout.h" -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float diff --git a/tools/quake2/q2map/qrad.c b/tools/quake2/q2map/qrad.c index e1744cdd..c204b56f 100644 --- a/tools/quake2/q2map/qrad.c +++ b/tools/quake2/q2map/qrad.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/qrad.h b/tools/quake2/q2map/qrad.h index eda18919..2eef8bc4 100644 --- a/tools/quake2/q2map/qrad.h +++ b/tools/quake2/q2map/qrad.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -36,11 +36,11 @@ trace.c #include "lbmlib.h" #include "inout.h" -#ifdef WIN32 +#ifdef _WIN32 #include #endif -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float diff --git a/tools/quake2/q2map/qvis.c b/tools/quake2/q2map/qvis.c index 7785ebe5..bf7d3244 100644 --- a/tools/quake2/q2map/qvis.c +++ b/tools/quake2/q2map/qvis.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/qvis.h b/tools/quake2/q2map/qvis.h index 3f2306fb..44c84516 100644 --- a/tools/quake2/q2map/qvis.h +++ b/tools/quake2/q2map/qvis.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -30,7 +30,7 @@ qvis3.c #include "bspfile.h" #include "inout.h" -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float diff --git a/tools/quake2/q2map/textures.c b/tools/quake2/q2map/textures.c index 503d7a4d..c0589de0 100644 --- a/tools/quake2/q2map/textures.c +++ b/tools/quake2/q2map/textures.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/trace.c b/tools/quake2/q2map/trace.c index b9392b17..35902baf 100644 --- a/tools/quake2/q2map/trace.c +++ b/tools/quake2/q2map/trace.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/tree.c b/tools/quake2/q2map/tree.c index 52d78fa8..6ca4aa16 100644 --- a/tools/quake2/q2map/tree.c +++ b/tools/quake2/q2map/tree.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/q2map/writebsp.c b/tools/quake2/q2map/writebsp.c index 722f6ab9..7ab613fd 100644 --- a/tools/quake2/q2map/writebsp.c +++ b/tools/quake2/q2map/writebsp.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -495,31 +495,17 @@ void BeginBSPFile (void) EndBSPFile ============ */ -void EndBSPFile (void) -{ +void EndBSPFile( void ) { char path[1024]; -#if 0 - int len; - byte *buf; -#endif - - EmitBrushes (); - EmitPlanes (); - UnparseEntities (); - - // load the pop -#if 0 - sprintf (path, "%s/pics/pop.lmp", gamedir); - len = LoadFile (path, &buf); - memcpy (dpop, buf, sizeof(dpop)); - free (buf); -#endif + EmitBrushes(); + EmitPlanes(); + UnparseEntities(); // write the map - sprintf (path, "%s.bsp", source); - Sys_Printf ("Writing %s\n", path); - WriteBSPFile (path); + sprintf( path, "%s.bsp", source ); + Sys_Printf( "Writing %s\n", path ); + WriteBSPFile( path ); } diff --git a/tools/quake2/qdata/images.c b/tools/quake2/qdata/images.c index ec4e99f3..37a2fc19 100644 --- a/tools/quake2/qdata/images.c +++ b/tools/quake2/qdata/images.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "qdata.h" #include "inout.h" diff --git a/tools/quake2/qdata/models.c b/tools/quake2/qdata/models.c index 2316b0f6..76713a5b 100644 --- a/tools/quake2/qdata/models.c +++ b/tools/quake2/qdata/models.c @@ -1,23 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ #include "qdata.h" #include "inout.h" diff --git a/tools/quake2/qdata/qdata.c b/tools/quake2/qdata/qdata.c index 87475a1d..0502ec89 100644 --- a/tools/quake2/qdata/qdata.c +++ b/tools/quake2/qdata/qdata.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "qdata.h" #include "inout.h" @@ -47,8 +26,6 @@ void InitPaths( int *argc, char **argv ); ======================================================= */ -unsigned Com_BlockChecksum (void *buffer, int length); - typedef struct { char name[56]; @@ -166,7 +143,6 @@ void FinishPak (void) int dirlen; int d; int i; - unsigned checksum; if (!g_pak) return; @@ -179,8 +155,6 @@ void FinishPak (void) pakheader.dirofs = LittleLong(ftell(pakfile)); pakheader.dirlen = LittleLong(dirlen); - checksum = Com_BlockChecksum ( (void *)pfiles, dirlen ); - SafeWrite (pakfile, pfiles, dirlen); i = ftell (pakfile); @@ -191,7 +165,6 @@ void FinishPak (void) d = pf - pfiles; printf ("%i files packed in %i bytes\n",d, i); - printf ("checksum: 0x%x\n", checksum); } diff --git a/tools/quake2/qdata/qdata.h b/tools/quake2/qdata/qdata.h index 2e9b5b60..2a1da9cb 100644 --- a/tools/quake2/qdata/qdata.h +++ b/tools/quake2/qdata/qdata.h @@ -1,23 +1,5 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. +// qdata.h -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ #include #include @@ -34,7 +16,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "l3dslib.h" #include "bspfile.h" -#ifdef WIN32 +#ifdef _WIN32 #ifdef NDEBUG // Don't show in a Release build #pragma warning(disable : 4305) // truncate from double to float #pragma warning(disable : 4244) // conversion from double to float diff --git a/tools/quake2/qdata/qdata3.vcproj b/tools/quake2/qdata/qdata3.vcproj index 239e990a..f3be5b02 100644 --- a/tools/quake2/qdata/qdata3.vcproj +++ b/tools/quake2/qdata/qdata3.vcproj @@ -1,231 +1,117 @@ - - + - + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/tools/quake2/qdata/sprites.c b/tools/quake2/qdata/sprites.c index a70f0074..db812751 100644 --- a/tools/quake2/qdata/sprites.c +++ b/tools/quake2/qdata/sprites.c @@ -1,23 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ #include "qdata.h" #include "inout.h" diff --git a/tools/quake2/qdata/tables.c b/tools/quake2/qdata/tables.c index 58335f0b..6aee6126 100644 --- a/tools/quake2/qdata/tables.c +++ b/tools/quake2/qdata/tables.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "qdata.h" /* diff --git a/tools/quake2/qdata/video.c b/tools/quake2/qdata/video.c index c4027171..370f5e95 100644 --- a/tools/quake2/qdata/video.c +++ b/tools/quake2/qdata/video.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "qdata.h" #include "inout.h" diff --git a/tools/quake2/qdata_heretic2/adpcm.h b/tools/quake2/qdata_heretic2/adpcm.h index e70f9664..3698da9a 100644 --- a/tools/quake2/qdata_heretic2/adpcm.h +++ b/tools/quake2/qdata_heretic2/adpcm.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/animcomp.c b/tools/quake2/qdata_heretic2/animcomp.c index 6af022f6..c32b7bf6 100644 --- a/tools/quake2/qdata_heretic2/animcomp.c +++ b/tools/quake2/qdata_heretic2/animcomp.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/animcomp.h b/tools/quake2/qdata_heretic2/animcomp.h index d7f68f47..15d0dc5b 100644 --- a/tools/quake2/qdata_heretic2/animcomp.h +++ b/tools/quake2/qdata_heretic2/animcomp.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/anorms.h b/tools/quake2/qdata_heretic2/anorms.h index 8ba90a4d..f240902b 100644 --- a/tools/quake2/qdata_heretic2/anorms.h +++ b/tools/quake2/qdata_heretic2/anorms.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -180,5 +180,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA {-0.425325f, 0.688191f, -0.587785f}, {-0.425325f, -0.688191f, -0.587785f}, {-0.587785f, -0.425325f, -0.688191f}, - {-0.688191f, -0.587785f, -0.425325f}, - + {-0.688191f, -0.587785f, -0.425325f}, \ No newline at end of file diff --git a/tools/quake2/qdata_heretic2/book.c b/tools/quake2/qdata_heretic2/book.c index 89a2d890..fd8072cb 100644 --- a/tools/quake2/qdata_heretic2/book.c +++ b/tools/quake2/qdata_heretic2/book.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/bspfile.c b/tools/quake2/qdata_heretic2/common/bspfile.c index 146e03f3..d029a335 100644 --- a/tools/quake2/qdata_heretic2/common/bspfile.c +++ b/tools/quake2/qdata_heretic2/common/bspfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/bspfile.h b/tools/quake2/qdata_heretic2/common/bspfile.h index 1597a3df..4e5453bb 100644 --- a/tools/quake2/qdata_heretic2/common/bspfile.h +++ b/tools/quake2/qdata_heretic2/common/bspfile.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/cmdlib.c b/tools/quake2/qdata_heretic2/common/cmdlib.c index f3115d29..c5f5c3a6 100644 --- a/tools/quake2/qdata_heretic2/common/cmdlib.c +++ b/tools/quake2/qdata_heretic2/common/cmdlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -356,7 +356,7 @@ void Q_getwd (char *out) { int i = 0; -#ifdef WIN32 +#ifdef _WIN32 _getcwd (out, 256); strcat (out, "\\"); #else @@ -375,7 +375,7 @@ void Q_getwd (char *out) void Q_mkdir (const char *path) { -#ifdef WIN32 +#ifdef _WIN32 if (_mkdir (path) != -1) return; #else @@ -1229,7 +1229,7 @@ void QCopyFile (const char *from, const char *to) void Sys_Sleep(int n) { -#ifdef WIN32 +#ifdef _WIN32 Sleep (n); #endif #if defined (__linux__) || defined (__APPLE__) diff --git a/tools/quake2/qdata_heretic2/common/cmdlib.h b/tools/quake2/qdata_heretic2/common/cmdlib.h index 78d7a237..edc29d5c 100644 --- a/tools/quake2/qdata_heretic2/common/cmdlib.h +++ b/tools/quake2/qdata_heretic2/common/cmdlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/her2_threads.h b/tools/quake2/qdata_heretic2/common/her2_threads.h index 339b0c86..77e7414d 100644 --- a/tools/quake2/qdata_heretic2/common/her2_threads.h +++ b/tools/quake2/qdata_heretic2/common/her2_threads.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/inout.c b/tools/quake2/qdata_heretic2/common/inout.c index 3cf66e7f..33eac651 100644 --- a/tools/quake2/qdata_heretic2/common/inout.c +++ b/tools/quake2/qdata_heretic2/common/inout.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "l_net/l_net.h" #include "libxml/tree.h" -#ifdef WIN32 +#ifdef _WIN32 HWND hwndOut = NULL; qboolean lookedForServer = false; UINT wm_BroadcastCommand = -1; diff --git a/tools/quake2/qdata_heretic2/common/inout.h b/tools/quake2/qdata_heretic2/common/inout.h index 75ef55ee..05b56a09 100644 --- a/tools/quake2/qdata_heretic2/common/inout.h +++ b/tools/quake2/qdata_heretic2/common/inout.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/l3dslib.c b/tools/quake2/qdata_heretic2/common/l3dslib.c index 853ff1ca..12cdd193 100644 --- a/tools/quake2/qdata_heretic2/common/l3dslib.c +++ b/tools/quake2/qdata_heretic2/common/l3dslib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/l3dslib.h b/tools/quake2/qdata_heretic2/common/l3dslib.h index b20391c6..7a26ade9 100644 --- a/tools/quake2/qdata_heretic2/common/l3dslib.h +++ b/tools/quake2/qdata_heretic2/common/l3dslib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/lbmlib.c b/tools/quake2/qdata_heretic2/common/lbmlib.c index 5ea39bd9..7c1f714f 100644 --- a/tools/quake2/qdata_heretic2/common/lbmlib.c +++ b/tools/quake2/qdata_heretic2/common/lbmlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/lbmlib.h b/tools/quake2/qdata_heretic2/common/lbmlib.h index 5a5f46f2..e050efa6 100644 --- a/tools/quake2/qdata_heretic2/common/lbmlib.h +++ b/tools/quake2/qdata_heretic2/common/lbmlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/mathlib.c b/tools/quake2/qdata_heretic2/common/mathlib.c index aa53c44a..a1c0733c 100644 --- a/tools/quake2/qdata_heretic2/common/mathlib.c +++ b/tools/quake2/qdata_heretic2/common/mathlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/mathlib.h b/tools/quake2/qdata_heretic2/common/mathlib.h index 76dfda32..03e5325b 100644 --- a/tools/quake2/qdata_heretic2/common/mathlib.h +++ b/tools/quake2/qdata_heretic2/common/mathlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/md4.c b/tools/quake2/qdata_heretic2/common/md4.c index 0c04b5a1..e69de29b 100644 --- a/tools/quake2/qdata_heretic2/common/md4.c +++ b/tools/quake2/qdata_heretic2/common/md4.c @@ -1,298 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* GLOBAL.H - RSAREF types and constants */ - -#include - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - - -/* MD4.H - header file for MD4C.C */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. - -All rights reserved. - -License to copy and use this software is granted provided that it is identified as the “RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as “derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided “as is” without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* MD4 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD4_CTX; - -void MD4Init (MD4_CTX *); -void MD4Update (MD4_CTX *, unsigned char *, unsigned int); -void MD4Final (unsigned char [16], MD4_CTX *); - - - -/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ -/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. - -License to copy and use this software is granted provided that it is identified as the -RSA Data Security, Inc. MD4 Message-Digest Algorithm - in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as -derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm -in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided -as is without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* Constants for MD4Transform routine. */ -#define S11 3 -#define S12 7 -#define S13 11 -#define S14 19 -#define S21 3 -#define S22 5 -#define S23 9 -#define S24 13 -#define S31 3 -#define S32 9 -#define S33 11 -#define S34 15 - -static void MD4Transform (UINT4 [4], unsigned char [64]); -static void Encode (unsigned char *, UINT4 *, unsigned int); -static void Decode (UINT4 *, unsigned char *, unsigned int); -static void MD4_memcpy (POINTER, POINTER, unsigned int); -static void MD4_memset (POINTER, int, unsigned int); - -static unsigned char PADDING[64] = { -0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G and H are basic MD4 functions. */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -/* ROTATE_LEFT rotates x left n bits. */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG and HH are transformations for rounds 1, 2 and 3 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s) {(a) += F ((b), (c), (d)) + (x); (a) = ROTATE_LEFT ((a), (s));} - -#define GG(a, b, c, d, x, s) {(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; (a) = ROTATE_LEFT ((a), (s));} - -#define HH(a, b, c, d, x, s) {(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; (a) = \ -ROTATE_LEFT ((a), (s)); } - - -/* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (MD4_CTX *context) -{ - context->count[0] = context->count[1] = 0; - -/* Load magic initialization constants.*/ -context->state[0] = 0x67452301; -context->state[1] = 0xefcdab89; -context->state[2] = 0x98badcfe; -context->state[3] = 0x10325476; -} - -/* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ -void MD4Update (MD4_CTX *context, unsigned char *input, unsigned int inputLen) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3))< ((UINT4)inputLen << 3)) - context->count[1]++; - - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible.*/ - if (inputLen >= partLen) - { - memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD4Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD4Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); -} - - -/* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[16], MD4_CTX *context) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64.*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD4Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD4Update (context, bits, 8); - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information.*/ - memset ((POINTER)context, 0, sizeof (*context)); -} - - -/* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (UINT4 state[4], unsigned char block[64]) -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - -/* Round 1 */ -FF (a, b, c, d, x[ 0], S11); /* 1 */ -FF (d, a, b, c, x[ 1], S12); /* 2 */ -FF (c, d, a, b, x[ 2], S13); /* 3 */ -FF (b, c, d, a, x[ 3], S14); /* 4 */ -FF (a, b, c, d, x[ 4], S11); /* 5 */ -FF (d, a, b, c, x[ 5], S12); /* 6 */ -FF (c, d, a, b, x[ 6], S13); /* 7 */ -FF (b, c, d, a, x[ 7], S14); /* 8 */ -FF (a, b, c, d, x[ 8], S11); /* 9 */ -FF (d, a, b, c, x[ 9], S12); /* 10 */ -FF (c, d, a, b, x[10], S13); /* 11 */ -FF (b, c, d, a, x[11], S14); /* 12 */ -FF (a, b, c, d, x[12], S11); /* 13 */ -FF (d, a, b, c, x[13], S12); /* 14 */ -FF (c, d, a, b, x[14], S13); /* 15 */ -FF (b, c, d, a, x[15], S14); /* 16 */ - -/* Round 2 */ -GG (a, b, c, d, x[ 0], S21); /* 17 */ -GG (d, a, b, c, x[ 4], S22); /* 18 */ -GG (c, d, a, b, x[ 8], S23); /* 19 */ -GG (b, c, d, a, x[12], S24); /* 20 */ -GG (a, b, c, d, x[ 1], S21); /* 21 */ -GG (d, a, b, c, x[ 5], S22); /* 22 */ -GG (c, d, a, b, x[ 9], S23); /* 23 */ -GG (b, c, d, a, x[13], S24); /* 24 */ -GG (a, b, c, d, x[ 2], S21); /* 25 */ -GG (d, a, b, c, x[ 6], S22); /* 26 */ -GG (c, d, a, b, x[10], S23); /* 27 */ -GG (b, c, d, a, x[14], S24); /* 28 */ -GG (a, b, c, d, x[ 3], S21); /* 29 */ -GG (d, a, b, c, x[ 7], S22); /* 30 */ -GG (c, d, a, b, x[11], S23); /* 31 */ -GG (b, c, d, a, x[15], S24); /* 32 */ - -/* Round 3 */ -HH (a, b, c, d, x[ 0], S31); /* 33 */ -HH (d, a, b, c, x[ 8], S32); /* 34 */ -HH (c, d, a, b, x[ 4], S33); /* 35 */ -HH (b, c, d, a, x[12], S34); /* 36 */ -HH (a, b, c, d, x[ 2], S31); /* 37 */ -HH (d, a, b, c, x[10], S32); /* 38 */ -HH (c, d, a, b, x[ 6], S33); /* 39 */ -HH (b, c, d, a, x[14], S34); /* 40 */ -HH (a, b, c, d, x[ 1], S31); /* 41 */ -HH (d, a, b, c, x[ 9], S32); /* 42 */ -HH (c, d, a, b, x[ 5], S33); /* 43 */ -HH (b, c, d, a, x[13], S34); /* 44 */ -HH (a, b, c, d, x[ 3], S31); /* 45 */ -HH (d, a, b, c, x[11], S32); /* 46 */ -HH (c, d, a, b, x[ 7], S33); /* 47 */ -HH (b, c, d, a, x[15], S34); /* 48 */ - -state[0] += a; -state[1] += b; -state[2] += c; -state[3] += d; - - /* Zeroize sensitive information.*/ - memset ((POINTER)x, 0, sizeof (x)); -} - - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (unsigned char *output, UINT4 *input, unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (UINT4 *output, unsigned char *input, unsigned int len) -{ -unsigned int i, j; - -for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -//=================================================================== - -unsigned Com_BlockChecksum (void *buffer, int length) -{ - int digest[4]; - unsigned val; - MD4_CTX ctx; - - MD4Init (&ctx); - MD4Update (&ctx, (unsigned char *)buffer, length); - MD4Final ( (unsigned char *)digest, &ctx); - - val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3]; - - return val; -} diff --git a/tools/quake2/qdata_heretic2/common/path_init.c b/tools/quake2/qdata_heretic2/common/path_init.c index 8947de84..644908ea 100644 --- a/tools/quake2/qdata_heretic2/common/path_init.c +++ b/tools/quake2/qdata_heretic2/common/path_init.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/polylib.c b/tools/quake2/qdata_heretic2/common/polylib.c index ce1a909a..b4b69ac1 100644 --- a/tools/quake2/qdata_heretic2/common/polylib.c +++ b/tools/quake2/qdata_heretic2/common/polylib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/polylib.h b/tools/quake2/qdata_heretic2/common/polylib.h index fec80e06..68660e27 100644 --- a/tools/quake2/qdata_heretic2/common/polylib.h +++ b/tools/quake2/qdata_heretic2/common/polylib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/qfiles.c b/tools/quake2/qdata_heretic2/common/qfiles.c index 25600a25..7e9414f3 100644 --- a/tools/quake2/qdata_heretic2/common/qfiles.c +++ b/tools/quake2/qdata_heretic2/common/qfiles.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/qfiles.h b/tools/quake2/qdata_heretic2/common/qfiles.h index 3492136e..1aa61983 100644 --- a/tools/quake2/qdata_heretic2/common/qfiles.h +++ b/tools/quake2/qdata_heretic2/common/qfiles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/scriplib.c b/tools/quake2/qdata_heretic2/common/scriplib.c index c9001795..15042d5d 100644 --- a/tools/quake2/qdata_heretic2/common/scriplib.c +++ b/tools/quake2/qdata_heretic2/common/scriplib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/scriplib.h b/tools/quake2/qdata_heretic2/common/scriplib.h index 4a87d582..80ece66f 100644 --- a/tools/quake2/qdata_heretic2/common/scriplib.h +++ b/tools/quake2/qdata_heretic2/common/scriplib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/threads.c b/tools/quake2/qdata_heretic2/common/threads.c index bf37b9f7..ce51fb32 100644 --- a/tools/quake2/qdata_heretic2/common/threads.c +++ b/tools/quake2/qdata_heretic2/common/threads.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -110,7 +110,7 @@ WIN32 =================================================================== */ -#ifdef WIN32 +#ifdef _WIN32 #define USED diff --git a/tools/quake2/qdata_heretic2/common/token.c b/tools/quake2/qdata_heretic2/common/token.c index ba2850a2..911607cf 100644 --- a/tools/quake2/qdata_heretic2/common/token.c +++ b/tools/quake2/qdata_heretic2/common/token.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/token.h b/tools/quake2/qdata_heretic2/common/token.h index 1e2fd27e..ab0e0de5 100644 --- a/tools/quake2/qdata_heretic2/common/token.h +++ b/tools/quake2/qdata_heretic2/common/token.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/trilib.c b/tools/quake2/qdata_heretic2/common/trilib.c index e7583447..7a0f412f 100644 --- a/tools/quake2/qdata_heretic2/common/trilib.c +++ b/tools/quake2/qdata_heretic2/common/trilib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/common/trilib.h b/tools/quake2/qdata_heretic2/common/trilib.h index 94263e0b..5bceadde 100644 --- a/tools/quake2/qdata_heretic2/common/trilib.h +++ b/tools/quake2/qdata_heretic2/common/trilib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/fmodels.c b/tools/quake2/qdata_heretic2/fmodels.c index 7570240a..273a482d 100644 --- a/tools/quake2/qdata_heretic2/fmodels.c +++ b/tools/quake2/qdata_heretic2/fmodels.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/images.c b/tools/quake2/qdata_heretic2/images.c index 49f5cd27..c2dc29fb 100644 --- a/tools/quake2/qdata_heretic2/images.c +++ b/tools/quake2/qdata_heretic2/images.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/jointed.c b/tools/quake2/qdata_heretic2/jointed.c index 4d78a792..af458ba2 100644 --- a/tools/quake2/qdata_heretic2/jointed.c +++ b/tools/quake2/qdata_heretic2/jointed.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/jointed.h b/tools/quake2/qdata_heretic2/jointed.h index d0736c1f..ffd82631 100644 --- a/tools/quake2/qdata_heretic2/jointed.h +++ b/tools/quake2/qdata_heretic2/jointed.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/joints.h b/tools/quake2/qdata_heretic2/joints.h index c08dee10..046bebdf 100644 --- a/tools/quake2/qdata_heretic2/joints.h +++ b/tools/quake2/qdata_heretic2/joints.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/models.c b/tools/quake2/qdata_heretic2/models.c index 27145b70..5ae30a15 100644 --- a/tools/quake2/qdata_heretic2/models.c +++ b/tools/quake2/qdata_heretic2/models.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/pics.c b/tools/quake2/qdata_heretic2/pics.c index 61ecfb5b..70ff7d52 100644 --- a/tools/quake2/qdata_heretic2/pics.c +++ b/tools/quake2/qdata_heretic2/pics.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/angles.h b/tools/quake2/qdata_heretic2/qcommon/angles.h index 1a722dab..e51d2e29 100644 --- a/tools/quake2/qdata_heretic2/qcommon/angles.h +++ b/tools/quake2/qdata_heretic2/qcommon/angles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/arrayedlist.h b/tools/quake2/qdata_heretic2/qcommon/arrayedlist.h index c04d669f..831f37cf 100644 --- a/tools/quake2/qdata_heretic2/qcommon/arrayedlist.h +++ b/tools/quake2/qdata_heretic2/qcommon/arrayedlist.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/flex.h b/tools/quake2/qdata_heretic2/qcommon/flex.h index 0b231cbf..db86ac67 100644 --- a/tools/quake2/qdata_heretic2/qcommon/flex.h +++ b/tools/quake2/qdata_heretic2/qcommon/flex.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/fmodel.h b/tools/quake2/qdata_heretic2/qcommon/fmodel.h index ee198fff..f52d922c 100644 --- a/tools/quake2/qdata_heretic2/qcommon/fmodel.h +++ b/tools/quake2/qdata_heretic2/qcommon/fmodel.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/h2common.h b/tools/quake2/qdata_heretic2/qcommon/h2common.h index a7f6587d..aecfee64 100644 --- a/tools/quake2/qdata_heretic2/qcommon/h2common.h +++ b/tools/quake2/qdata_heretic2/qcommon/h2common.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/placement.h b/tools/quake2/qdata_heretic2/qcommon/placement.h index 4db2c55b..7194bf3c 100644 --- a/tools/quake2/qdata_heretic2/qcommon/placement.h +++ b/tools/quake2/qdata_heretic2/qcommon/placement.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/q_typedef.h b/tools/quake2/qdata_heretic2/qcommon/q_typedef.h index 02f9a459..63507f72 100644 --- a/tools/quake2/qdata_heretic2/qcommon/q_typedef.h +++ b/tools/quake2/qdata_heretic2/qcommon/q_typedef.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/qfiles.h b/tools/quake2/qdata_heretic2/qcommon/qfiles.h index d71eaf2b..9466b796 100644 --- a/tools/quake2/qdata_heretic2/qcommon/qfiles.h +++ b/tools/quake2/qdata_heretic2/qcommon/qfiles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/reference.c b/tools/quake2/qdata_heretic2/qcommon/reference.c index ddad0fe4..3145c052 100644 --- a/tools/quake2/qdata_heretic2/qcommon/reference.c +++ b/tools/quake2/qdata_heretic2/qcommon/reference.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/reference.h b/tools/quake2/qdata_heretic2/qcommon/reference.h index ace3678b..c61a1cec 100644 --- a/tools/quake2/qdata_heretic2/qcommon/reference.h +++ b/tools/quake2/qdata_heretic2/qcommon/reference.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/resourcemanager.c b/tools/quake2/qdata_heretic2/qcommon/resourcemanager.c index ef5613df..a48f372d 100644 --- a/tools/quake2/qdata_heretic2/qcommon/resourcemanager.c +++ b/tools/quake2/qdata_heretic2/qcommon/resourcemanager.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/resourcemanager.h b/tools/quake2/qdata_heretic2/qcommon/resourcemanager.h index e267ecd5..1891d49a 100644 --- a/tools/quake2/qdata_heretic2/qcommon/resourcemanager.h +++ b/tools/quake2/qdata_heretic2/qcommon/resourcemanager.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/skeletons.c b/tools/quake2/qdata_heretic2/qcommon/skeletons.c index 1da0b4f1..8e2f685d 100644 --- a/tools/quake2/qdata_heretic2/qcommon/skeletons.c +++ b/tools/quake2/qdata_heretic2/qcommon/skeletons.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qcommon/skeletons.h b/tools/quake2/qdata_heretic2/qcommon/skeletons.h index b36c12ed..6f340941 100644 --- a/tools/quake2/qdata_heretic2/qcommon/skeletons.h +++ b/tools/quake2/qdata_heretic2/qcommon/skeletons.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qd_fmodel.h b/tools/quake2/qdata_heretic2/qd_fmodel.h index 7ec6570c..c1db5da6 100644 --- a/tools/quake2/qdata_heretic2/qd_fmodel.h +++ b/tools/quake2/qdata_heretic2/qd_fmodel.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qd_skeletons.c b/tools/quake2/qdata_heretic2/qd_skeletons.c index 43395c8c..f36fb1df 100644 --- a/tools/quake2/qdata_heretic2/qd_skeletons.c +++ b/tools/quake2/qdata_heretic2/qd_skeletons.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qd_skeletons.h b/tools/quake2/qdata_heretic2/qd_skeletons.h index b6ff7bcd..59261432 100644 --- a/tools/quake2/qdata_heretic2/qd_skeletons.h +++ b/tools/quake2/qdata_heretic2/qd_skeletons.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qdata.c b/tools/quake2/qdata_heretic2/qdata.c index d8c1612a..64edf0a3 100644 --- a/tools/quake2/qdata_heretic2/qdata.c +++ b/tools/quake2/qdata_heretic2/qdata.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -55,8 +55,6 @@ extern qboolean g_nomkdir; ======================================================= */ -unsigned Com_BlockChecksum (void *buffer, int length); - typedef struct { char name[56]; @@ -155,7 +153,6 @@ void FinishPak (void) int dirlen; int d; int i; - unsigned checksum; if (!g_pak) return; @@ -168,8 +165,6 @@ void FinishPak (void) pakheader.dirofs = LittleLong(ftell(pakfile)); pakheader.dirlen = LittleLong(dirlen); - checksum = Com_BlockChecksum ( (void *)pfiles, dirlen ); - SafeWrite (pakfile, pfiles, dirlen); i = ftell (pakfile); @@ -180,7 +175,6 @@ void FinishPak (void) d = pf - pfiles; printf ("%i files packed in %i bytes\n",d, i); - printf ("checksum: 0x%x\n", checksum); } diff --git a/tools/quake2/qdata_heretic2/qdata.h b/tools/quake2/qdata_heretic2/qdata.h index 4685455f..bbe9c6b3 100644 --- a/tools/quake2/qdata_heretic2/qdata.h +++ b/tools/quake2/qdata_heretic2/qdata.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/qdata3_heretic2.vcproj b/tools/quake2/qdata_heretic2/qdata3_heretic2.vcproj index 2eea9286..4e0ae31e 100644 --- a/tools/quake2/qdata_heretic2/qdata3_heretic2.vcproj +++ b/tools/quake2/qdata_heretic2/qdata3_heretic2.vcproj @@ -1,329 +1,179 @@ - - + - + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + \ No newline at end of file diff --git a/tools/quake2/qdata_heretic2/sprites.c b/tools/quake2/qdata_heretic2/sprites.c index bd9d8bf2..86854063 100644 --- a/tools/quake2/qdata_heretic2/sprites.c +++ b/tools/quake2/qdata_heretic2/sprites.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/svdcmp.c b/tools/quake2/qdata_heretic2/svdcmp.c index 04ac7230..e4496a19 100644 --- a/tools/quake2/qdata_heretic2/svdcmp.c +++ b/tools/quake2/qdata_heretic2/svdcmp.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/tables.c b/tools/quake2/qdata_heretic2/tables.c index 86263b90..cc78ae9f 100644 --- a/tools/quake2/qdata_heretic2/tables.c +++ b/tools/quake2/qdata_heretic2/tables.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/tmix.c b/tools/quake2/qdata_heretic2/tmix.c index ac1b2f30..5bccddf8 100644 --- a/tools/quake2/qdata_heretic2/tmix.c +++ b/tools/quake2/qdata_heretic2/tmix.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake2/qdata_heretic2/video.c b/tools/quake2/qdata_heretic2/video.c index 181a9735..b4ed1a6f 100644 --- a/tools/quake2/qdata_heretic2/video.c +++ b/tools/quake2/qdata_heretic2/video.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/aselib.c b/tools/quake3/common/aselib.c index d147c202..94491f7f 100644 --- a/tools/quake3/common/aselib.c +++ b/tools/quake3/common/aselib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/aselib.h b/tools/quake3/common/aselib.h index 299e6053..e3e62adb 100644 --- a/tools/quake3/common/aselib.h +++ b/tools/quake3/common/aselib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/bspfile.c b/tools/quake3/common/bspfile.c index 828d0938..3ce497a7 100644 --- a/tools/quake3/common/bspfile.c +++ b/tools/quake3/common/bspfile.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/bspfile.h b/tools/quake3/common/bspfile.h index ad70bae5..c12daca8 100644 --- a/tools/quake3/common/bspfile.h +++ b/tools/quake3/common/bspfile.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/cmdlib.c b/tools/quake3/common/cmdlib.c index cb3e9d0c..e2ea8f0a 100644 --- a/tools/quake3/common/cmdlib.c +++ b/tools/quake3/common/cmdlib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -333,7 +333,7 @@ void Q_getwd (char *out) { int i = 0; -#ifdef WIN32 +#ifdef _WIN32 _getcwd (out, 256); strcat (out, "\\"); #else @@ -352,7 +352,7 @@ void Q_getwd (char *out) void Q_mkdir (const char *path) { -#ifdef WIN32 +#ifdef _WIN32 if (_mkdir (path) != -1) return; #else @@ -1144,7 +1144,7 @@ void QCopyFile (const char *from, const char *to) void Sys_Sleep(int n) { -#ifdef WIN32 +#ifdef _WIN32 Sleep (n); #endif #if defined (__linux__) || defined (__APPLE__) diff --git a/tools/quake3/common/cmdlib.h b/tools/quake3/common/cmdlib.h index 245f7ed0..7eee55ed 100644 --- a/tools/quake3/common/cmdlib.h +++ b/tools/quake3/common/cmdlib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/imagelib.c b/tools/quake3/common/imagelib.c index 5971d810..7a0d22cf 100644 --- a/tools/quake3/common/imagelib.c +++ b/tools/quake3/common/imagelib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // imagelib.c -#include "inout.h" #include "cmdlib.h" #include "imagelib.h" #include "vfs.h" @@ -885,242 +884,233 @@ typedef struct _TargaHeader { unsigned char pixel_size, attributes; } TargaHeader; -void TargaError(TargaHeader *t, const char *message) -{ - Sys_Printf("%s\n:TargaHeader:\nuint8 id_length = %i;\nuint8 colormap_type = %i;\nuint8 image_type = %i;\nuint16 colormap_index = %i;\nuint16 colormap_length = %i;\nuint8 colormap_size = %i;\nuint16 x_origin = %i;\nuint16 y_origin = %i;\nuint16 width = %i;\nuint16 height = %i;\nuint8 pixel_size = %i;\nuint8 attributes = %i;\n", message, t->id_length, t->colormap_type, t->image_type, t->colormap_index, t->colormap_length, t->colormap_size, t->x_origin, t->y_origin, t->width, t->height, t->pixel_size, t->attributes); -} - /* ============= LoadTGABuffer ============= */ -void LoadTGABuffer (const byte *f, const byte *enddata, byte **pic, int *width, int *height) +void LoadTGABuffer ( byte *buffer, byte **pic, int *width, int *height) { - int x, y, row_inc, compressed, readpixelcount, red, green, blue, alpha, runlen, pindex, alphabits, image_width, image_height; - byte *pixbuf, *image_rgba; - const byte *fin; - unsigned char *p; - TargaHeader targa_header; - unsigned char palette[256*4]; + int columns, rows, numPixels; + byte *pixbuf; + int row, column; + byte *buf_p; + TargaHeader targa_header; + byte *targa_rgba; *pic = NULL; - // abort if it is too small to parse - if (enddata - f < 19) - return; + buf_p = buffer; - targa_header.id_length = f[0]; - targa_header.colormap_type = f[1]; - targa_header.image_type = f[2]; + targa_header.id_length = *buf_p++; + targa_header.colormap_type = *buf_p++; + targa_header.image_type = *buf_p++; + + targa_header.colormap_index = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.colormap_length = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.colormap_size = *buf_p++; + targa_header.x_origin = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.y_origin = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.width = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.height = LittleShort ( *(short *)buf_p ); + buf_p += 2; + targa_header.pixel_size = *buf_p++; + targa_header.attributes = *buf_p++; - targa_header.colormap_index = f[3] + f[4] * 256; - targa_header.colormap_length = f[5] + f[6] * 256; - targa_header.colormap_size = f[7]; - targa_header.x_origin = f[8] + f[9] * 256; - targa_header.y_origin = f[10] + f[11] * 256; - targa_header.width = image_width = f[12] + f[13] * 256; - targa_header.height = image_height = f[14] + f[15] * 256; - - targa_header.pixel_size = f[16]; - targa_header.attributes = f[17]; - - // advance to end of header - fin = f + 18; - - // skip TARGA image comment (usually 0 bytes) - fin += targa_header.id_length; - - // read/skip the colormap if present (note: according to the TARGA spec it - // can be present even on truecolor or greyscale images, just not used by - // the image data) - if (targa_header.colormap_type) + if (targa_header.image_type!=2 + && targa_header.image_type!=10 + && targa_header.image_type != 3 ) { - if (targa_header.colormap_length > 256) + Error("LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n"); + } + + if ( targa_header.colormap_type != 0 ) + { + Error("LoadTGA: colormaps not supported\n" ); + } + + if ( ( targa_header.pixel_size != 32 && targa_header.pixel_size != 24 ) && targa_header.image_type != 3 ) + { + Error("LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); + } + + columns = targa_header.width; + rows = targa_header.height; + numPixels = columns * rows; + + if (width) + *width = columns; + if (height) + *height = rows; + + targa_rgba = safe_malloc (numPixels*4); + *pic = targa_rgba; + + if (targa_header.id_length != 0) + buf_p += targa_header.id_length; // skip TARGA image comment + + if ( targa_header.image_type==2 || targa_header.image_type == 3 ) + { + // Uncompressed RGB or gray scale image + for(row=rows-1; row>=0; row--) { - TargaError(&targa_header, "LoadTGA: only up to 256 colormap_length supported\n"); - return; - } - if (targa_header.colormap_index) - { - TargaError(&targa_header, "LoadTGA: colormap_index not supported\n"); - return; - } - if (targa_header.colormap_size == 24) - { - for (x = 0;x < targa_header.colormap_length;x++) + pixbuf = targa_rgba + row*columns*4; + for(column=0; column 0) - { - readpixelcount--; - red = green = blue = alpha = 255; - if (fin < enddata) + unsigned char red,green,blue,alphabyte; + switch (targa_header.pixel_size) { - switch(targa_header.image_type) - { - case 1: - case 9: - // colormapped - pindex = *fin++; - if (pindex >= targa_header.colormap_length) - pindex = 0; // error - p = palette + pindex * 4; - red = p[0]; - green = p[1]; - blue = p[2]; - alpha = p[3]; - break; - case 2: - case 10: - // BGR or BGRA - blue = *fin++; - if (fin < enddata) - green = *fin++; - if (fin < enddata) - red = *fin++; - if (targa_header.pixel_size == 32 && fin < enddata) - alpha = *fin++; - break; - case 3: - case 11: - // greyscale - red = green = blue = *fin++; - break; - } - if (!alphabits) - alpha = 255; + + case 8: + blue = *buf_p++; + green = blue; + red = blue; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + + case 24: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = 255; + break; + case 32: + blue = *buf_p++; + green = *buf_p++; + red = *buf_p++; + alphabyte = *buf_p++; + *pixbuf++ = red; + *pixbuf++ = green; + *pixbuf++ = blue; + *pixbuf++ = alphabyte; + break; + default: + //Error("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name ); + break; } } - *pixbuf++ = red; - *pixbuf++ = green; - *pixbuf++ = blue; - *pixbuf++ = alpha; - x++; - if (x == image_width) + } + } + else if (targa_header.image_type==10) { // Runlength encoded RGB images + unsigned char red,green,blue,alphabyte,packetHeader,packetSize,j; + + red = 0; + green = 0; + blue = 0; + alphabyte = 0xff; + + for(row=rows-1; row>=0; row--) { + pixbuf = targa_rgba + row*columns*4; + for(column=0; column0) + row--; + else + goto breakOut; + pixbuf = targa_rgba + row*columns*4; + } + } + } + else { // non run-length packet + for(j=0;j0) + row--; + else + goto breakOut; + pixbuf = targa_rgba + row*columns*4; + } + } + } + } + breakOut:; + } + } + + // vertically flipped + if ( (targa_header.attributes & (1<<5)) ) { + int flip; + for (row = 0; row < .5f * rows; row++) + { + for (column = 0; column < columns; column++) { - // end of line, advance to next - x = 0; - y++; - pixbuf += row_inc; + flip = *( (int*)targa_rgba + row * columns + column); + *( (int*)targa_rgba + row * columns + column) = *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ); + *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ) = flip; } } } - *pic = image_rgba; - if (width) - *width = image_width; - if (height) - *height = image_height; + //free(buffer); } + /* ============= LoadTGA @@ -1129,17 +1119,17 @@ LoadTGA void LoadTGA (const char *name, byte **pixels, int *width, int *height) { byte *buffer; - int nLen; + int nLen; // // load the file // nLen = vfsLoadFile ( ( char * ) name, (void **)&buffer, 0); - if (nLen == -1) - { + if (nLen == -1) + { Error ("Couldn't read %s", name); - } + } - LoadTGABuffer(buffer, buffer + nLen, pixels, width, height); + LoadTGABuffer(buffer, pixels, width, height); } diff --git a/tools/quake3/common/imagelib.h b/tools/quake3/common/imagelib.h index 171332f7..9a99d6af 100644 --- a/tools/quake3/common/imagelib.h +++ b/tools/quake3/common/imagelib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -36,9 +36,9 @@ void Save256Image (const char *name, byte *pixels, byte *palette, int width, int height); -void LoadTGA (const char *filename, byte **pixels, int *width, int *height); -void LoadTGABuffer ( const byte *buffer, const byte* enddata, byte **pic, int *width, int *height); -void WriteTGA (const char *filename, byte *data, int width, int height); - -void Load32BitImage (const char *name, unsigned **pixels, int *width, int *height); +void LoadTGA( const char *filename, byte **pixels, int *width, int *height ); +void LoadTGABuffer( byte *buffer, byte **pic, int *width, int *height ); +void WriteTGA( const char *filename, byte *data, int width, int height ); +int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ); +void Load32BitImage( const char *name, unsigned **pixels, int *width, int *height ); diff --git a/tools/quake3/common/inout.c b/tools/quake3/common/inout.c index aebc5db3..dcdd0893 100644 --- a/tools/quake3/common/inout.c +++ b/tools/quake3/common/inout.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -42,11 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "l_net/l_net.h" #include "libxml/tree.h" -// utf8 conversion -#include -#include - -#ifdef WIN32 +#ifdef _WIN32 HWND hwndOut = NULL; qboolean lookedForServer = qfalse; UINT wm_BroadcastCommand = -1; @@ -293,11 +289,7 @@ void FPrintf (int flag, char *buf) bGotXML = qtrue; } node = xmlNewNode (NULL, "message"); - { - gchar* utf8 = g_locale_to_utf8(buf, -1, NULL, NULL, NULL); - xmlNodeSetContent(node, utf8); - g_free(utf8); - } + xmlNodeSetContent (node, buf); level[0] = (int)'0' + flag; level[1] = 0; xmlSetProp (node, "level", (char *)&level ); diff --git a/tools/quake3/common/inout.h b/tools/quake3/common/inout.h index c60b0b85..d417a583 100644 --- a/tools/quake3/common/inout.h +++ b/tools/quake3/common/inout.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // inout is the only stuff relying on xml, include the headers there #include "libxml/tree.h" -#include "mathlib.h" // some useful xml routines xmlNodePtr xml_NodeForVec( vec3_t v ); diff --git a/tools/quake3/common/jpeg.c b/tools/quake3/common/jpeg.c new file mode 100644 index 00000000..68a1120e --- /dev/null +++ b/tools/quake3/common/jpeg.c @@ -0,0 +1,389 @@ +/* +Copyright (c) 2001, Loki software, inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of Loki software nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// +// Functions to load JPEG files from a buffer, based on jdatasrc.c +// +// Leonardo Zide (leo@lokigames.com) +// + +#include +#include +#include +#include + +#include +#include + +/* Expanded data source object for stdio input */ + +typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + int src_size; + JOCTET * src_buffer; + + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr * my_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +static void my_init_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +static boolean my_fill_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes; + + if (src->src_size > INPUT_BUF_SIZE) + nbytes = INPUT_BUF_SIZE; + else + nbytes = src->src_size; + + memcpy (src->buffer, src->src_buffer, nbytes); + src->src_buffer += nbytes; + src->src_size -= nbytes; + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +static void my_skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) my_fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +static void my_term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +static void jpeg_buffer_src (j_decompress_ptr cinfo, void* buffer, int bufsize) +{ + my_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + sizeof (my_source_mgr)); + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * sizeof (JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = my_init_source; + src->pub.fill_input_buffer = my_fill_input_buffer; + src->pub.skip_input_data = my_skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = my_term_source; + src->src_buffer = (JOCTET *)buffer; + src->src_size = bufsize; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} + +// ============================================================================= + +static char errormsg[JMSG_LENGTH_MAX]; + +typedef struct my_jpeg_error_mgr +{ + struct jpeg_error_mgr pub; // "public" fields + jmp_buf setjmp_buffer; // for return to caller +} bt_jpeg_error_mgr; + +static void my_jpeg_error_exit (j_common_ptr cinfo) +{ + bt_jpeg_error_mgr* myerr = (bt_jpeg_error_mgr*) cinfo->err; + + (*cinfo->err->format_message) (cinfo, errormsg); + + longjmp (myerr->setjmp_buffer, 1); +} + +// stash a scanline +static void j_putRGBScanline (unsigned char* jpegline, int widthPix, unsigned char* outBuf, int row) +{ + int offset = row * widthPix * 4; + int count; + + for (count = 0; count < widthPix; count++) + { + unsigned char iRed, iBlu, iGrn; + unsigned char *oRed, *oBlu, *oGrn, *oAlp; + + iRed = *(jpegline + count * 3 + 0); + iGrn = *(jpegline + count * 3 + 1); + iBlu = *(jpegline + count * 3 + 2); + + oRed = outBuf + offset + count * 4 + 0; + oGrn = outBuf + offset + count * 4 + 1; + oBlu = outBuf + offset + count * 4 + 2; + oAlp = outBuf + offset + count * 4 + 3; + + *oRed = iRed; + *oGrn = iGrn; + *oBlu = iBlu; + *oAlp = 255; + } +} + +// stash a scanline +static void j_putRGBAScanline (unsigned char* jpegline, int widthPix, unsigned char* outBuf, int row) +{ + int offset = row * widthPix * 4; + int count; + + for (count = 0; count < widthPix; count++) + { + unsigned char iRed, iBlu, iGrn, iAlp; + unsigned char *oRed, *oBlu, *oGrn, *oAlp; + + iRed = *(jpegline + count * 4 + 0); + iGrn = *(jpegline + count * 4 + 1); + iBlu = *(jpegline + count * 4 + 2); + iAlp = *(jpegline + count * 4 + 3); + + oRed = outBuf + offset + count * 4 + 0; + oGrn = outBuf + offset + count * 4 + 1; + oBlu = outBuf + offset + count * 4 + 2; + oAlp = outBuf + offset + count * 4 + 3; + + *oRed = iRed; + *oGrn = iGrn; + *oBlu = iBlu; + // ydnar: see bug 900 + *oAlp = 255; //% iAlp; + } +} + +// stash a gray scanline +static void j_putGrayScanlineToRGB (unsigned char* jpegline, int widthPix, unsigned char* outBuf, int row) +{ + int offset = row * widthPix * 4; + int count; + + for (count = 0; count < widthPix; count++) + { + unsigned char iGray; + unsigned char *oRed, *oBlu, *oGrn, *oAlp; + + // get our grayscale value + iGray = *(jpegline + count); + + oRed = outBuf + offset + count * 4; + oGrn = outBuf + offset + count * 4 + 1; + oBlu = outBuf + offset + count * 4 + 2; + oAlp = outBuf + offset + count * 4 + 3; + + *oRed = iGray; + *oGrn = iGray; + *oBlu = iGray; + *oAlp = 255; + } +} + +int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height ) { + struct jpeg_decompress_struct cinfo; + struct my_jpeg_error_mgr jerr; + JSAMPARRAY buffer; + int row_stride, size; + + cinfo.err = jpeg_std_error (&jerr.pub); + jerr.pub.error_exit = my_jpeg_error_exit; + + if (setjmp (jerr.setjmp_buffer)) + { + *pic = (unsigned char*)errormsg; + jpeg_destroy_decompress (&cinfo); + return -1; + } + + jpeg_create_decompress (&cinfo); + jpeg_buffer_src (&cinfo, src_buffer, src_size); + jpeg_read_header (&cinfo, TRUE); + jpeg_start_decompress (&cinfo); + + row_stride = cinfo.output_width * cinfo.output_components; + + size = cinfo.output_width * cinfo.output_height * 4; + *width = cinfo.output_width; + *height = cinfo.output_height; + *pic = (unsigned char*)( malloc( size+1 ) ); + memset (*pic, 0, size+1); + + buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + + while (cinfo.output_scanline < cinfo.output_height) + { + jpeg_read_scanlines (&cinfo, buffer, 1); + + if (cinfo.out_color_components == 4) + j_putRGBAScanline (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); + else if (cinfo.out_color_components == 3) + j_putRGBScanline (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); + else if (cinfo.out_color_components == 1) + j_putGrayScanlineToRGB (buffer[0], cinfo.output_width, *pic, cinfo.output_scanline-1); + } + + jpeg_finish_decompress (&cinfo); + jpeg_destroy_decompress (&cinfo); + + return 0; +} diff --git a/tools/quake3/common/l3dslib.c b/tools/quake3/common/l3dslib.c index 3030b0bf..0620f9b4 100644 --- a/tools/quake3/common/l3dslib.c +++ b/tools/quake3/common/l3dslib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/l3dslib.h b/tools/quake3/common/l3dslib.h index bac2433b..ae835963 100644 --- a/tools/quake3/common/l3dslib.h +++ b/tools/quake3/common/l3dslib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/md4.c b/tools/quake3/common/md4.c index 0c04b5a1..e69de29b 100644 --- a/tools/quake3/common/md4.c +++ b/tools/quake3/common/md4.c @@ -1,298 +0,0 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* GLOBAL.H - RSAREF types and constants */ - -#include - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - - -/* MD4.H - header file for MD4C.C */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. - -All rights reserved. - -License to copy and use this software is granted provided that it is identified as the “RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as “derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided “as is” without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* MD4 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD4_CTX; - -void MD4Init (MD4_CTX *); -void MD4Update (MD4_CTX *, unsigned char *, unsigned int); -void MD4Final (unsigned char [16], MD4_CTX *); - - - -/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ -/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. - -License to copy and use this software is granted provided that it is identified as the -RSA Data Security, Inc. MD4 Message-Digest Algorithm - in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as -derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm -in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided -as is without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this documentation and/or software. */ - -/* Constants for MD4Transform routine. */ -#define S11 3 -#define S12 7 -#define S13 11 -#define S14 19 -#define S21 3 -#define S22 5 -#define S23 9 -#define S24 13 -#define S31 3 -#define S32 9 -#define S33 11 -#define S34 15 - -static void MD4Transform (UINT4 [4], unsigned char [64]); -static void Encode (unsigned char *, UINT4 *, unsigned int); -static void Decode (UINT4 *, unsigned char *, unsigned int); -static void MD4_memcpy (POINTER, POINTER, unsigned int); -static void MD4_memset (POINTER, int, unsigned int); - -static unsigned char PADDING[64] = { -0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G and H are basic MD4 functions. */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -/* ROTATE_LEFT rotates x left n bits. */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG and HH are transformations for rounds 1, 2 and 3 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s) {(a) += F ((b), (c), (d)) + (x); (a) = ROTATE_LEFT ((a), (s));} - -#define GG(a, b, c, d, x, s) {(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; (a) = ROTATE_LEFT ((a), (s));} - -#define HH(a, b, c, d, x, s) {(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; (a) = \ -ROTATE_LEFT ((a), (s)); } - - -/* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (MD4_CTX *context) -{ - context->count[0] = context->count[1] = 0; - -/* Load magic initialization constants.*/ -context->state[0] = 0x67452301; -context->state[1] = 0xefcdab89; -context->state[2] = 0x98badcfe; -context->state[3] = 0x10325476; -} - -/* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ -void MD4Update (MD4_CTX *context, unsigned char *input, unsigned int inputLen) -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3))< ((UINT4)inputLen << 3)) - context->count[1]++; - - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible.*/ - if (inputLen >= partLen) - { - memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD4Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD4Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); -} - - -/* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[16], MD4_CTX *context) -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64.*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD4Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD4Update (context, bits, 8); - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information.*/ - memset ((POINTER)context, 0, sizeof (*context)); -} - - -/* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (UINT4 state[4], unsigned char block[64]) -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - -/* Round 1 */ -FF (a, b, c, d, x[ 0], S11); /* 1 */ -FF (d, a, b, c, x[ 1], S12); /* 2 */ -FF (c, d, a, b, x[ 2], S13); /* 3 */ -FF (b, c, d, a, x[ 3], S14); /* 4 */ -FF (a, b, c, d, x[ 4], S11); /* 5 */ -FF (d, a, b, c, x[ 5], S12); /* 6 */ -FF (c, d, a, b, x[ 6], S13); /* 7 */ -FF (b, c, d, a, x[ 7], S14); /* 8 */ -FF (a, b, c, d, x[ 8], S11); /* 9 */ -FF (d, a, b, c, x[ 9], S12); /* 10 */ -FF (c, d, a, b, x[10], S13); /* 11 */ -FF (b, c, d, a, x[11], S14); /* 12 */ -FF (a, b, c, d, x[12], S11); /* 13 */ -FF (d, a, b, c, x[13], S12); /* 14 */ -FF (c, d, a, b, x[14], S13); /* 15 */ -FF (b, c, d, a, x[15], S14); /* 16 */ - -/* Round 2 */ -GG (a, b, c, d, x[ 0], S21); /* 17 */ -GG (d, a, b, c, x[ 4], S22); /* 18 */ -GG (c, d, a, b, x[ 8], S23); /* 19 */ -GG (b, c, d, a, x[12], S24); /* 20 */ -GG (a, b, c, d, x[ 1], S21); /* 21 */ -GG (d, a, b, c, x[ 5], S22); /* 22 */ -GG (c, d, a, b, x[ 9], S23); /* 23 */ -GG (b, c, d, a, x[13], S24); /* 24 */ -GG (a, b, c, d, x[ 2], S21); /* 25 */ -GG (d, a, b, c, x[ 6], S22); /* 26 */ -GG (c, d, a, b, x[10], S23); /* 27 */ -GG (b, c, d, a, x[14], S24); /* 28 */ -GG (a, b, c, d, x[ 3], S21); /* 29 */ -GG (d, a, b, c, x[ 7], S22); /* 30 */ -GG (c, d, a, b, x[11], S23); /* 31 */ -GG (b, c, d, a, x[15], S24); /* 32 */ - -/* Round 3 */ -HH (a, b, c, d, x[ 0], S31); /* 33 */ -HH (d, a, b, c, x[ 8], S32); /* 34 */ -HH (c, d, a, b, x[ 4], S33); /* 35 */ -HH (b, c, d, a, x[12], S34); /* 36 */ -HH (a, b, c, d, x[ 2], S31); /* 37 */ -HH (d, a, b, c, x[10], S32); /* 38 */ -HH (c, d, a, b, x[ 6], S33); /* 39 */ -HH (b, c, d, a, x[14], S34); /* 40 */ -HH (a, b, c, d, x[ 1], S31); /* 41 */ -HH (d, a, b, c, x[ 9], S32); /* 42 */ -HH (c, d, a, b, x[ 5], S33); /* 43 */ -HH (b, c, d, a, x[13], S34); /* 44 */ -HH (a, b, c, d, x[ 3], S31); /* 45 */ -HH (d, a, b, c, x[11], S32); /* 46 */ -HH (c, d, a, b, x[ 7], S33); /* 47 */ -HH (b, c, d, a, x[15], S34); /* 48 */ - -state[0] += a; -state[1] += b; -state[2] += c; -state[3] += d; - - /* Zeroize sensitive information.*/ - memset ((POINTER)x, 0, sizeof (x)); -} - - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (unsigned char *output, UINT4 *input, unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (UINT4 *output, unsigned char *input, unsigned int len) -{ -unsigned int i, j; - -for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -//=================================================================== - -unsigned Com_BlockChecksum (void *buffer, int length) -{ - int digest[4]; - unsigned val; - MD4_CTX ctx; - - MD4Init (&ctx); - MD4Update (&ctx, (unsigned char *)buffer, length); - MD4Final ( (unsigned char *)digest, &ctx); - - val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3]; - - return val; -} diff --git a/tools/quake3/common/mutex.c b/tools/quake3/common/mutex.c index 38a383d6..f7be7f5f 100644 --- a/tools/quake3/common/mutex.c +++ b/tools/quake3/common/mutex.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -31,7 +31,7 @@ WIN32 =================================================================== */ -#ifdef WIN32 +#ifdef _WIN32 #define USED diff --git a/tools/quake3/common/mutex.h b/tools/quake3/common/mutex.h index aa929923..1bd34dc6 100644 --- a/tools/quake3/common/mutex.h +++ b/tools/quake3/common/mutex.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/polylib.c b/tools/quake3/common/polylib.c index 21067ca2..187b1e70 100644 --- a/tools/quake3/common/polylib.c +++ b/tools/quake3/common/polylib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -249,11 +249,8 @@ winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist) CrossProduct (vup, normal, vright); - // LordHavoc: this has to use *2 because otherwise some created points may - // be inside the world (think of a diagonal case), and any brush with such - // points should be removed, failure to detect such cases is disasterous - VectorScale (vup, MAX_WORLD_COORD*2, vup); - VectorScale (vright, MAX_WORLD_COORD*2, vright); + VectorScale (vup, MAX_WORLD_COORD, vup); + VectorScale (vright, MAX_WORLD_COORD, vright); // project a really big axis aligned box onto the plane w = AllocWinding (4); diff --git a/tools/quake3/common/polylib.h b/tools/quake3/common/polylib.h index e58875a2..58b21d5a 100644 --- a/tools/quake3/common/polylib.h +++ b/tools/quake3/common/polylib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/polyset.h b/tools/quake3/common/polyset.h index 12993999..04a4d5b7 100644 --- a/tools/quake3/common/polyset.h +++ b/tools/quake3/common/polyset.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/qfiles.h b/tools/quake3/common/qfiles.h index 29e94978..091640ed 100644 --- a/tools/quake3/common/qfiles.h +++ b/tools/quake3/common/qfiles.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/qthreads.h b/tools/quake3/common/qthreads.h index ab806030..25bacca4 100644 --- a/tools/quake3/common/qthreads.h +++ b/tools/quake3/common/qthreads.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/scriplib.c b/tools/quake3/common/scriplib.c index 47196e53..a4c9bb88 100644 --- a/tools/quake3/common/scriplib.c +++ b/tools/quake3/common/scriplib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/scriplib.h b/tools/quake3/common/scriplib.h index 1e3f2c31..e924e974 100644 --- a/tools/quake3/common/scriplib.h +++ b/tools/quake3/common/scriplib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/surfaceflags.h b/tools/quake3/common/surfaceflags.h index d7ab2ba7..425e4f28 100644 --- a/tools/quake3/common/surfaceflags.h +++ b/tools/quake3/common/surfaceflags.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,8 +19,6 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// Copyright (C) 1999-2000 Id Software, Inc. -// // This file must be identical in the quake and utils directories // contents flags are seperate bits diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 137597c7..463d32bd 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,7 @@ along with GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef WIN32 +#ifndef _WIN32 // The below define is necessary to use // pthreads extensions like pthread_mutexattr_settype #define _GNU_SOURCE @@ -110,7 +110,7 @@ WIN32 =================================================================== */ -#ifdef WIN32 +#ifdef _WIN32 #define USED diff --git a/tools/quake3/common/trilib.c b/tools/quake3/common/trilib.c index 15bc54a1..9726569e 100644 --- a/tools/quake3/common/trilib.c +++ b/tools/quake3/common/trilib.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/trilib.h b/tools/quake3/common/trilib.h index 89dcf764..30b10837 100644 --- a/tools/quake3/common/trilib.h +++ b/tools/quake3/common/trilib.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/unzip.c b/tools/quake3/common/unzip.c index 63878e6a..1949db22 100644 --- a/tools/quake3/common/unzip.c +++ b/tools/quake3/common/unzip.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/unzip.h b/tools/quake3/common/unzip.h index 5cbfce93..d2ba6532 100644 --- a/tools/quake3/common/unzip.h +++ b/tools/quake3/common/unzip.h @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index 25865661..3afb00c6 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -60,7 +60,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmdlib.h" #include "mathlib.h" -#include +#include "glib.h" #include "inout.h" #include "vfs.h" #include "unzip.h" diff --git a/tools/quake3/q3data/3dslib.c b/tools/quake3/q3data/3dslib.c index e2012c70..719a487f 100644 --- a/tools/quake3/q3data/3dslib.c +++ b/tools/quake3/q3data/3dslib.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include "q3data.h" diff --git a/tools/quake3/q3data/3dslib.h b/tools/quake3/q3data/3dslib.h index 406fe2d7..cd73cb43 100644 --- a/tools/quake3/q3data/3dslib.h +++ b/tools/quake3/q3data/3dslib.h @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - typedef struct { float x, y, z; diff --git a/tools/quake3/q3data/compress.c b/tools/quake3/q3data/compress.c index fdf9043a..af9669ab 100644 --- a/tools/quake3/q3data/compress.c +++ b/tools/quake3/q3data/compress.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "q3data.h" #if 0 diff --git a/tools/quake3/q3data/images.c b/tools/quake3/q3data/images.c index 5009ae38..de872d2b 100644 --- a/tools/quake3/q3data/images.c +++ b/tools/quake3/q3data/images.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "q3data.h" byte *byteimage, *lbmpalette; diff --git a/tools/quake3/q3data/md3lib.c b/tools/quake3/q3data/md3lib.c index aa277126..e959a411 100644 --- a/tools/quake3/q3data/md3lib.c +++ b/tools/quake3/q3data/md3lib.c @@ -1,26 +1,5 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include -#ifdef WIN32 +#ifdef _WIN32 #include #endif #include "md3lib.h" diff --git a/tools/quake3/q3data/md3lib.h b/tools/quake3/q3data/md3lib.h index fbf48b57..bdee0bd9 100644 --- a/tools/quake3/q3data/md3lib.h +++ b/tools/quake3/q3data/md3lib.h @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include "../common/cmdlib.h" #include "mathlib.h" diff --git a/tools/quake3/q3data/models.c b/tools/quake3/q3data/models.c index b87dc625..1d2d6904 100644 --- a/tools/quake3/q3data/models.c +++ b/tools/quake3/q3data/models.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include "q3data.h" diff --git a/tools/quake3/q3data/oldstuff.c b/tools/quake3/q3data/oldstuff.c index 045c67e7..c6083cf5 100644 --- a/tools/quake3/q3data/oldstuff.c +++ b/tools/quake3/q3data/oldstuff.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #if 0 /* diff --git a/tools/quake3/q3data/p3dlib.c b/tools/quake3/q3data/p3dlib.c index 3ccdfbe1..0c3b6026 100644 --- a/tools/quake3/q3data/p3dlib.c +++ b/tools/quake3/q3data/p3dlib.c @@ -1,27 +1,6 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "p3dlib.h" -#ifdef WIN32 +#ifdef _WIN32 #include #endif #include diff --git a/tools/quake3/q3data/p3dlib.h b/tools/quake3/q3data/p3dlib.h index 1bd63078..24e446d1 100644 --- a/tools/quake3/q3data/p3dlib.h +++ b/tools/quake3/q3data/p3dlib.h @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #define P3D_GET_CROSSLINE 1 #define P3D_GET_RESTOFLINE 2 diff --git a/tools/quake3/q3data/polyset.c b/tools/quake3/q3data/polyset.c index cdb0cda7..f89a8cc0 100644 --- a/tools/quake3/q3data/polyset.c +++ b/tools/quake3/q3data/polyset.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include "q3data.h" diff --git a/tools/quake3/q3data/q3data.c b/tools/quake3/q3data/q3data.c index 40887fcc..202f21dd 100644 --- a/tools/quake3/q3data/q3data.c +++ b/tools/quake3/q3data/q3data.c @@ -1,25 +1,4 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifdef WIN32 +#ifdef _WIN32 #include #endif #include "q3data.h" @@ -52,8 +31,6 @@ char writedir[1024]; ======================================================= */ -unsigned Com_BlockChecksum (void *buffer, int length); - typedef struct { char name[56]; diff --git a/tools/quake3/q3data/q3data.h b/tools/quake3/q3data/q3data.h index 778aaddb..458d4ed6 100644 --- a/tools/quake3/q3data/q3data.h +++ b/tools/quake3/q3data/q3data.h @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - // q3data.h diff --git a/tools/quake3/q3data/q3data.vcproj b/tools/quake3/q3data/q3data.vcproj index f5a0e163..70e5a465 100644 --- a/tools/quake3/q3data/q3data.vcproj +++ b/tools/quake3/q3data/q3data.vcproj @@ -1,207 +1,107 @@ - - + - + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + - + \ No newline at end of file diff --git a/tools/quake3/q3data/stripper.c b/tools/quake3/q3data/stripper.c index 76fc96b3..c42d4420 100644 --- a/tools/quake3/q3data/stripper.c +++ b/tools/quake3/q3data/stripper.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include #include diff --git a/tools/quake3/q3data/video.c b/tools/quake3/q3data/video.c index afabdeb9..9054d5e9 100644 --- a/tools/quake3/q3data/video.c +++ b/tools/quake3/q3data/video.c @@ -1,24 +1,3 @@ -/* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include #include "q3data.h" diff --git a/tools/quake3/q3map2/brush.c b/tools/quake3/q3map2/brush.c index aa60b8fa..28ade081 100644 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -78,7 +77,7 @@ int CountBrushList( brush_t *brushes ) /* count brushes */ - for( ; brushes != NULL; brushes = brushes->next ) + for( brushes; brushes != NULL; brushes = brushes->next ) c++; return c; } @@ -122,7 +121,7 @@ void FreeBrush( brush_t *b ) /* error check */ - if( *((unsigned int*) b) == 0xFEFEFEFE ) + if( *((int*) b) == 0xFEFEFEFE ) { Sys_FPrintf( SYS_VRB, "WARNING: Attempt to free an already freed brush!\n" ); return; @@ -135,7 +134,7 @@ void FreeBrush( brush_t *b ) /* ydnar: overwrite it */ memset( b, 0xFE, (int) &(((brush_t*) 0)->sides[ b->numsides ]) ); - *((unsigned int*) b) = 0xFEFEFEFE; + *((int*) b) = 0xFEFEFEFE; /* free it */ free( b ); @@ -156,7 +155,7 @@ void FreeBrushList( brush_t *brushes ) /* walk brush list */ - for( ; brushes != NULL; brushes = next ) + for( brushes; brushes != NULL; brushes = next ) { next = brushes->next; FreeBrush( brushes ); @@ -377,6 +376,8 @@ qboolean CreateBrushWindings( brush_t *brush ) continue; /* back side clipaway */ if( brush->sides[ j ].bevel ) continue; + if( brush->sides[ j ].backSide ) + continue; plane = &mapplanes[ brush->sides[ j ].planenum ^ 1 ]; ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); // CLIP_EPSILON ); @@ -849,6 +850,9 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back ) w = BaseWindingForPlane (plane->normal, plane->dist); for (i=0 ; inumsides && w ; i++) { + if ( brush->sides[i].backSide ) { + continue; // fake back-sided polygons never split + } plane2 = &mapplanes[brush->sides[i].planenum ^ 1]; ChopWindingInPlace (&w, plane2->normal, plane2->dist, 0); // PLANESIDE_EPSILON); } @@ -906,10 +910,18 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back ) // see if we have valid polygons on both sides for (i=0 ; i<2 ; i++) { - if (b[i]->numsides < 3 || !BoundBrush (b[i])) + BoundBrush (b[i]); + for (j=0 ; j<3 ; j++) { - if (b[i]->numsides >= 3) + if (b[i]->mins[j] < MIN_WORLD_COORD || b[i]->maxs[j] > MAX_WORLD_COORD) + { Sys_FPrintf (SYS_VRB,"bogus brush after clip\n"); + break; + } + } + + if (b[i]->numsides < 3 || j < 3) + { FreeBrush (b[i]); b[i] = NULL; } diff --git a/tools/quake3/q3map2/brush_primit.c b/tools/quake3/q3map2/brush_primit.c index 9edec67f..9bc2ab62 100644 --- a/tools/quake3/q3map2/brush_primit.c +++ b/tools/quake3/q3map2/brush_primit.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index fedf46c5..ed3d2430 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -587,9 +586,7 @@ int BSPMain( int argc, char **argv ) tempSource[ 0 ] = '\0'; - /* set standard game flags */ - maxSurfaceVerts = game->maxSurfaceVerts; - maxSurfaceIndexes = game->maxSurfaceIndexes; + /* set flares flag */ emitFlares = game->emitFlares; /* process arguments */ @@ -690,13 +687,11 @@ int BSPMain( int argc, char **argv ) } else if( !strcmp( argv[ i ], "-mv" ) ) { - maxLMSurfaceVerts = atoi( argv[ i + 1 ] ); - if( maxLMSurfaceVerts < 3 ) - maxLMSurfaceVerts = 3; - if( maxLMSurfaceVerts > maxSurfaceVerts ) - maxSurfaceVerts = maxLMSurfaceVerts; + maxSurfaceVerts = atoi( argv[ i + 1 ] ); + if( maxSurfaceVerts < 3 ) + maxSurfaceVerts = 3; i++; - Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts ); + Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts ); } else if( !strcmp( argv[ i ], "-mi" ) ) { diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index dc71d037..ae2fec30 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -436,7 +435,7 @@ void PrintBSPFileSizes( void ) Sys_Printf( "\n"); Sys_Printf( "%9d lightmaps %9d\n", - numBSPLightBytes / (game->lightmapSize * game->lightmapSize * 3), numBSPLightBytes ); + numBSPLightBytes / (LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3), numBSPLightBytes ); Sys_Printf( "%9d lightgrid %9d *\n", numBSPGridPoints, (int) (numBSPGridPoints * sizeof( *bspGridPoints )) ); Sys_Printf( " visibility %9d\n", diff --git a/tools/quake3/q3map2/bspfile_ibsp.c b/tools/quake3/q3map2/bspfile_ibsp.c index 97c3c4ea..71b982da 100644 --- a/tools/quake3/q3map2/bspfile_ibsp.c +++ b/tools/quake3/q3map2/bspfile_ibsp.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/bspfile_rbsp.c b/tools/quake3/q3map2/bspfile_rbsp.c index 7c18c424..1f4f1f77 100644 --- a/tools/quake3/q3map2/bspfile_rbsp.c +++ b/tools/quake3/q3map2/bspfile_rbsp.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/changelog.q3map1 b/tools/quake3/q3map2/changelog.q3map1 index 21b0cb99..e9be59b6 100644 --- a/tools/quake3/q3map2/changelog.q3map1 +++ b/tools/quake3/q3map2/changelog.q3map1 @@ -1,371 +1,371 @@ -Old Q3Map 1.x and Early Q3Map2 Changelog (Chronological Order) - -- FILE IS STATIC. IF YOU MAKE CHANGES, UPDATE CHANGELOG.Q3MAP2 - - - -Date Version Notes ----------------------------------------------------------------- -2001-12-03 1.2 (ydnar) Alpha Initial version (win32) - -2001-12-03 1.2 (ydnar 2) Alpha Tolerance expanded - (more brush faces caught) - -2001-12-04 1.2 (ydnar 3) Alpha Detail faces inside other - detail brushes now culled, - Small against large detail - faces also culled. - -2001-12-04 1.2 (ydnar 4) Alpha djbob found a bug where - coincident caulk faces - were causing textured - faces to be caulked. Fixed. - -2001-12-04 1.2 (ydnar 7) Alpha 5 and 6 were internal test - versions. This version - takes into account extra - surface info, so coplanar - clip brushes no longer - cull away textured sides. - -2001-12-22 1.2 (ydnar 8) Alpha Optimized light. Lighting - for most maps should now - be measurable in minutes - as opposed to hours. - -2001-12-24 1.2 (ydnar 9) Alpha Fixed light. It is still - faster, but to enable - "blinding fast" mode, - you must supply the -fast - switch on the commandline - after -light. Fast mode - should be approximately - 2x as fast as build 8. - -2001-12-24 1.2 (ydnar 10) Alpha Grid lighting is now - optimized. Not as much - as I would like, but - a distance^2 cull before - traces on EVERY SINGLE - SURFACE LIGHT IN THE MAP - certainly speeds things - the fuck up. -fast not - necessary to see this - optimization. Also added - the -cheap switch to - limit light contributions - to a point when it exceeds - 255 in R, G, and B. This - *may* cause artifacts. - Test away... - -2001-12-24 1.2 (ydnar 11) Alpha Now using PVS data (vis). - Well constructed and - hinted maps should now - see a bit of a speedup. - Lights in the void are - also now removed as a - byproduct. - -2001-12-24 1.2 (ydnar 12) Alpha Fixed bug that caused - vlight to crash. - -2001-12-27 1.2 (ydnar 13) Alpha - Fixed broken PVS check. - - Cheap now supresses sun - Sun trace skipped if - sample is "cheapened." - - Experimental -smooth - option for subsampling - shadow edges. - - Experimental radiosity - code. Will probably crash. - - Other minor optimizations. - -2001-12-27 1.2 (ydnar 14) Alpha Build 13 always subsampled, - making it slower. Fixed. - -2001-12-28 1.2 (ydnar 15) Alpha Bad windings from edge- or - vertex- manipulated brushes - no longer created. Vertex - lighting on func_* with - an origin now works. - Radiosity should be more - stable (but not fully - correct yet). Light - envelopes now properly - calculated for entities - with origins. - -2001-12-28 1.2 (ydnar 16) Alpha Un-vised maps will now light. - -2001-12-30 1.2 (ydnar 17) Alpha Radiosity. Use q3map_bounce - in shaders to specify - amount of light to reflect. - Use -bounce N after -light - to enable radiosity. Use - -dump to emit radiosity - lights as a prefab. - -2001-12-31 1.2 (ydnar 18) Alpha Normalization release. New - features include -fastgrid, - -cheapgrid, and -fastbounce. - Running with -fastgrid and - -cheapgrid will produce - results identical to normal - q3map (with the lightgrid - being a little darker). - Also added q3map_nofast to - shaders to override -fast - switch for a surface light. - -2002-01-01 1.2 (ydnar 19) Alpha Fixed an odd vertex lighting - bug (thanks Quakin) that was - causing sun to leak to brush - faces when using r_vertexlight - ingame. Changed a little bit - of the default behavior, so - test with vertex lighting - and with terrain. Minor - shader changes might be - necessary to get some maps to - look as before. - -2002-01-01 1.2 (ydnar 20) Alpha Colored alpha shadows. Some - minor optimizations in - shadow tracing. Should be - slightly faster than 19. - -2002-01-02 1.2 (ydnar 21) Alpha Set up colored shadows - properly to use - surfaceparm lightfilter. - Shaders must use this parm - to have colored shadows. - Can be used with alphashadow - as well. - -2002-01-04 1.2.1-y1 (nightly) This version is all new, - based off the official - GtkRadiant tree, which has - all the previous enhancements. - New features include colored - lightgrid tracing through - lightfilter shaders, and - surfaceparm lightgrid, for - large/space maps with large - volumes. Also fixed are - potential broken brush - winding radiosity crashes. - Maybe. - -2002-01-05 1.2.1-y2 (nightly) Merged latest CVS. Removed - bug where ambient was getting - calculated into the radiosity - solution for every pass, - leading to overbright maps - in a hurry. Also removed - the bad PTPFF reporting, - as it only caused problems - with radiosity in a big way. - Sue me. - -2002-01-05 1.2.1-y3 (nightly) I really suck. Sample color - now properly cleared to 0 - when bouncing. - -2002-01-07 1.2.1-y4 (nightly) Particle Studio generated - brush faces should no longer - be culled. I no longer cull - faces that are autosprite. - Added -bouncegrid to have - radiosity add to lightgrid. - -2002-01-08 1.2.1-y5 (nightly) Same as y4, but compiled with - full optimizations. Should - be 10-25% faster in all, - including BSP and vis - stages. - -2002-01-09 1.2.1-y6 (nightly) Brushfaces with polygonoffset - in their shader will no longer - be faceculled. - -2002-01-11 1.2.1-y7 (nightly) Increased stack size for threads - to 4MB on Win32 to (hopefully) - elminate stack overflow - crash with radiosity. Also - made subdivision use the heap - to lessen the stack load. Fixed - bug where q3map_bounce was not - being used in shader parsing. - Redid some of the divide math - to work in 0-255 instead of - 0-256. - -2002-01-11 1.2.1-y8 (nightly) More Win32 threading - crutches. Eat me, Bill. - -2002-01-15 1.2.1-y9 RR2DO2 noticed a stupid bug - in my PVS code. Fixed it, - so the PVS light opts work as - they should. Lighting is - faster. Also got rid of some - redundant square roots from - the raytracing, speeding up - lighting another ~25%. - -2002-01-20 1.2.1-y10 Fixed a potential crash bug - with maps with 0 lights. Also - changed how lightmaps are - projected onto patches that - lie in a single plane (bevel - endcaps, floors, etc). Shadows - now work properly on them. - -2002-01-22 1.2.1-y11 Fixed a divide-by-zero crash - with maps with no lights or - no tracing. Also added - code to make brush/patch - vertex lighting more closely - resemble lightmap, even on - less-than-perfect maps. And - -light is faster, too...about - 25% on q3dm17. 34->25 seconds. - -2002-01-24 1.2.1-y12 Completely rewrote the path - argument handling. Should find - the Quake 3 dir and other - dirs properly now. Needs to - be tested on Linux though. - Also made lights linear by - default when run with -game - wolf. This is to match the - Gray Matter q3map and - entity definition. - -2002-01-28 1.2.4-y1 Merged from 1.2.4-nightly CVS - sources. Fog sparklies gone. - -nopatchfix so vlight works - properly again. Cleaned up - paths processing some more, - including Linux stuff. Added - _lightmapscale entity key. - Brought -game wolf lighting - to parity with GM tools. - RR2DO2's PCX loading fix. A - bunch of other useful fun shit. - -2002-01-29 1.2.4-y2 Fixed a bug in RR2DO2's PCX fix. - Fixed a stupid bug in lightmap - dimension bounds checking (thanks - Laerth). - -2002-01-29 1.2.4-y3 Now will detect (and report to - GtkRadiant) all degenerate patches - like those created by capping a - cone. - -2002-02-23 2.0.0-a1 thru a3 Rewrote about 30% of the code. - Lots of cool new shit. - -2002-02-24 2.0.0-a4 thru a8 Terrain fix (thx Pointy), patches - are no longer circus colored, more - terrain texturing fixes. - -2002-02-26 2.0.0-a10 thru a11 Adjacent coplanar surfaces now - will share lightmaps. This prevents - most wierd edge cases with filter - and speeds things up a bit. Patches - too. - -2002-02-27 2.0.0-a12 More lightmap fixes for non-planar - surfaces. Bugfixes in allocation/ - compression of lightmaps as well. - -2002-03-02 2.0.0-a13 Fixed some surface light bugs, - adjusted the occluded-luxel finding - code, and amped the radiosity. Other - fixes to RTCW lighting code (better - angle attenuation on linear lights). - -2002-03-04 2.0.0-a14 Vertex light should now be near- - perfect on clean (and mostly on not- - so-clean) maps. Unlit maps will no - longer have tri-fanned brush faces - with random vertex colors. VLight is - now totally gone (reverts to -light). - -2002-03-06 2.0.0-a15 Relaxed the planar check, should now - classify all slightly-off plane brush - face metasurfaces as planar. Triangle - checking much more stringent as well. - -2002-03-11 2.0.0-a16 Vis crash gone. Lightmap allocation - now sorted by shader to minimize - shader count (and lessen chance for - RTCW shader substitution bug). Hit - big quarter-century also. - -2002-03-12 2.0.0-a17 Dammit. - -2002-03-12 2.0.0-a18 Hunting phantom lights... - -2002-03-16 2.0.0-a19 Fogclip and _celshader. Check the - extras folder... - -2002-03-18 2.0.0-b1-rc1 Beta release candidate. Fixed the - stupid phantom light bug finally. - Tricked out the sun tracing a wee - bit as well, should be a little - faster + more accurate. Other little - bits fixed up as well. Thanks to K, - {wf}ShadowSpawn and RR2DO2 for their - help tracking these last bugs down. - -2002-03-19 2.0.0-b1-rc2 Increased some maximums, and got - rid of some cruft. - -2002-03-22 2.0.0-b1-rc3 Some minor optimizations. - -2002-03-30 2.0.0-b1-rc5 Now with fur (see extras/fur.shader). - -2002-04-01 2.0.0-b1-rc6 Enhanced with baby seal technology. - -2002-05-01 2.0.1 OK, better late than never. Fixed the - alphashadow = 255 = transparent bug. - -2002-06-24 2.1.0-b1 Added _foghull functionality. Works - like terrain "_shader" where - you don't need "textures/" prefix. - Also added q3map_normalmap. See - NVIDIA's website for Photoshop filter - to generate normalmaps from grayscale - heightmaps. This makes lightmaps - look bumpmapped. Currently 50% broken. - -2002-07-06 2.2.0-b1 Empty epairs now stripped from map, - fixing Wolfenstein crash bug. Func_* - entities are now fogged properly. - Sort of. This will be enhanced later. - Added the .srf file to store all the - extra crap I was hiding in the BSP. - It's an editable text file that - -light uses, so you can change the - samplesize w/o recompiling the map - (just -light'ing it). Changed color - normalization to clamping, because - it looks better. Other stuff got - fixed as well. - -2002-07-08 2.2.0-b2 thru b11 Test versions. Thanks jer and jet! - -2002-07-09 2.2.0-b12 Larger-than-life lightmaps are now - supported, up to 1024x1024. Add - q3map_lightmapSize H W to a shader - to use. Lightmaps are stored in - maps/{mapname}/_lm_NNN.tga and a - shader script q3map_{mapname}.shader - is generated. Also added - q3map_lightmapGamma N.N. Use a - value of 2.0 to simulate - r_overBrightBits 1 and - r_mapOverBrightBits 2 on external - lightmap images. +Old Q3Map 1.x and Early Q3Map2 Changelog (Chronological Order) + +- FILE IS STATIC. IF YOU MAKE CHANGES, UPDATE CHANGELOG.Q3MAP2 - + + +Date Version Notes +---------------------------------------------------------------- +2001-12-03 1.2 (ydnar) Alpha Initial version (win32) + +2001-12-03 1.2 (ydnar 2) Alpha Tolerance expanded + (more brush faces caught) + +2001-12-04 1.2 (ydnar 3) Alpha Detail faces inside other + detail brushes now culled, + Small against large detail + faces also culled. + +2001-12-04 1.2 (ydnar 4) Alpha djbob found a bug where + coincident caulk faces + were causing textured + faces to be caulked. Fixed. + +2001-12-04 1.2 (ydnar 7) Alpha 5 and 6 were internal test + versions. This version + takes into account extra + surface info, so coplanar + clip brushes no longer + cull away textured sides. + +2001-12-22 1.2 (ydnar 8) Alpha Optimized light. Lighting + for most maps should now + be measurable in minutes + as opposed to hours. + +2001-12-24 1.2 (ydnar 9) Alpha Fixed light. It is still + faster, but to enable + "blinding fast" mode, + you must supply the -fast + switch on the commandline + after -light. Fast mode + should be approximately + 2x as fast as build 8. + +2001-12-24 1.2 (ydnar 10) Alpha Grid lighting is now + optimized. Not as much + as I would like, but + a distance^2 cull before + traces on EVERY SINGLE + SURFACE LIGHT IN THE MAP + certainly speeds things + the fuck up. -fast not + necessary to see this + optimization. Also added + the -cheap switch to + limit light contributions + to a point when it exceeds + 255 in R, G, and B. This + *may* cause artifacts. + Test away... + +2001-12-24 1.2 (ydnar 11) Alpha Now using PVS data (vis). + Well constructed and + hinted maps should now + see a bit of a speedup. + Lights in the void are + also now removed as a + byproduct. + +2001-12-24 1.2 (ydnar 12) Alpha Fixed bug that caused + vlight to crash. + +2001-12-27 1.2 (ydnar 13) Alpha - Fixed broken PVS check. + - Cheap now supresses sun + Sun trace skipped if + sample is "cheapened." + - Experimental -smooth + option for subsampling + shadow edges. + - Experimental radiosity + code. Will probably crash. + - Other minor optimizations. + +2001-12-27 1.2 (ydnar 14) Alpha Build 13 always subsampled, + making it slower. Fixed. + +2001-12-28 1.2 (ydnar 15) Alpha Bad windings from edge- or + vertex- manipulated brushes + no longer created. Vertex + lighting on func_* with + an origin now works. + Radiosity should be more + stable (but not fully + correct yet). Light + envelopes now properly + calculated for entities + with origins. + +2001-12-28 1.2 (ydnar 16) Alpha Un-vised maps will now light. + +2001-12-30 1.2 (ydnar 17) Alpha Radiosity. Use q3map_bounce + in shaders to specify + amount of light to reflect. + Use -bounce N after -light + to enable radiosity. Use + -dump to emit radiosity + lights as a prefab. + +2001-12-31 1.2 (ydnar 18) Alpha Normalization release. New + features include -fastgrid, + -cheapgrid, and -fastbounce. + Running with -fastgrid and + -cheapgrid will produce + results identical to normal + q3map (with the lightgrid + being a little darker). + Also added q3map_nofast to + shaders to override -fast + switch for a surface light. + +2002-01-01 1.2 (ydnar 19) Alpha Fixed an odd vertex lighting + bug (thanks Quakin) that was + causing sun to leak to brush + faces when using r_vertexlight + ingame. Changed a little bit + of the default behavior, so + test with vertex lighting + and with terrain. Minor + shader changes might be + necessary to get some maps to + look as before. + +2002-01-01 1.2 (ydnar 20) Alpha Colored alpha shadows. Some + minor optimizations in + shadow tracing. Should be + slightly faster than 19. + +2002-01-02 1.2 (ydnar 21) Alpha Set up colored shadows + properly to use + surfaceparm lightfilter. + Shaders must use this parm + to have colored shadows. + Can be used with alphashadow + as well. + +2002-01-04 1.2.1-y1 (nightly) This version is all new, + based off the official + GtkRadiant tree, which has + all the previous enhancements. + New features include colored + lightgrid tracing through + lightfilter shaders, and + surfaceparm lightgrid, for + large/space maps with large + volumes. Also fixed are + potential broken brush + winding radiosity crashes. + Maybe. + +2002-01-05 1.2.1-y2 (nightly) Merged latest CVS. Removed + bug where ambient was getting + calculated into the radiosity + solution for every pass, + leading to overbright maps + in a hurry. Also removed + the bad PTPFF reporting, + as it only caused problems + with radiosity in a big way. + Sue me. + +2002-01-05 1.2.1-y3 (nightly) I really suck. Sample color + now properly cleared to 0 + when bouncing. + +2002-01-07 1.2.1-y4 (nightly) Particle Studio generated + brush faces should no longer + be culled. I no longer cull + faces that are autosprite. + Added -bouncegrid to have + radiosity add to lightgrid. + +2002-01-08 1.2.1-y5 (nightly) Same as y4, but compiled with + full optimizations. Should + be 10-25% faster in all, + including BSP and vis + stages. + +2002-01-09 1.2.1-y6 (nightly) Brushfaces with polygonoffset + in their shader will no longer + be faceculled. + +2002-01-11 1.2.1-y7 (nightly) Increased stack size for threads + to 4MB on Win32 to (hopefully) + elminate stack overflow + crash with radiosity. Also + made subdivision use the heap + to lessen the stack load. Fixed + bug where q3map_bounce was not + being used in shader parsing. + Redid some of the divide math + to work in 0-255 instead of + 0-256. + +2002-01-11 1.2.1-y8 (nightly) More Win32 threading + crutches. Eat me, Bill. + +2002-01-15 1.2.1-y9 RR2DO2 noticed a stupid bug + in my PVS code. Fixed it, + so the PVS light opts work as + they should. Lighting is + faster. Also got rid of some + redundant square roots from + the raytracing, speeding up + lighting another ~25%. + +2002-01-20 1.2.1-y10 Fixed a potential crash bug + with maps with 0 lights. Also + changed how lightmaps are + projected onto patches that + lie in a single plane (bevel + endcaps, floors, etc). Shadows + now work properly on them. + +2002-01-22 1.2.1-y11 Fixed a divide-by-zero crash + with maps with no lights or + no tracing. Also added + code to make brush/patch + vertex lighting more closely + resemble lightmap, even on + less-than-perfect maps. And + -light is faster, too...about + 25% on q3dm17. 34->25 seconds. + +2002-01-24 1.2.1-y12 Completely rewrote the path + argument handling. Should find + the Quake 3 dir and other + dirs properly now. Needs to + be tested on Linux though. + Also made lights linear by + default when run with -game + wolf. This is to match the + Gray Matter q3map and + entity definition. + +2002-01-28 1.2.4-y1 Merged from 1.2.4-nightly CVS + sources. Fog sparklies gone. + -nopatchfix so vlight works + properly again. Cleaned up + paths processing some more, + including Linux stuff. Added + _lightmapscale entity key. + Brought -game wolf lighting + to parity with GM tools. + RR2DO2's PCX loading fix. A + bunch of other useful fun shit. + +2002-01-29 1.2.4-y2 Fixed a bug in RR2DO2's PCX fix. + Fixed a stupid bug in lightmap + dimension bounds checking (thanks + Laerth). + +2002-01-29 1.2.4-y3 Now will detect (and report to + GtkRadiant) all degenerate patches + like those created by capping a + cone. + +2002-02-23 2.0.0-a1 thru a3 Rewrote about 30% of the code. + Lots of cool new shit. + +2002-02-24 2.0.0-a4 thru a8 Terrain fix (thx Pointy), patches + are no longer circus colored, more + terrain texturing fixes. + +2002-02-26 2.0.0-a10 thru a11 Adjacent coplanar surfaces now + will share lightmaps. This prevents + most wierd edge cases with filter + and speeds things up a bit. Patches + too. + +2002-02-27 2.0.0-a12 More lightmap fixes for non-planar + surfaces. Bugfixes in allocation/ + compression of lightmaps as well. + +2002-03-02 2.0.0-a13 Fixed some surface light bugs, + adjusted the occluded-luxel finding + code, and amped the radiosity. Other + fixes to RTCW lighting code (better + angle attenuation on linear lights). + +2002-03-04 2.0.0-a14 Vertex light should now be near- + perfect on clean (and mostly on not- + so-clean) maps. Unlit maps will no + longer have tri-fanned brush faces + with random vertex colors. VLight is + now totally gone (reverts to -light). + +2002-03-06 2.0.0-a15 Relaxed the planar check, should now + classify all slightly-off plane brush + face metasurfaces as planar. Triangle + checking much more stringent as well. + +2002-03-11 2.0.0-a16 Vis crash gone. Lightmap allocation + now sorted by shader to minimize + shader count (and lessen chance for + RTCW shader substitution bug). Hit + big quarter-century also. + +2002-03-12 2.0.0-a17 Dammit. + +2002-03-12 2.0.0-a18 Hunting phantom lights... + +2002-03-16 2.0.0-a19 Fogclip and _celshader. Check the + extras folder... + +2002-03-18 2.0.0-b1-rc1 Beta release candidate. Fixed the + stupid phantom light bug finally. + Tricked out the sun tracing a wee + bit as well, should be a little + faster + more accurate. Other little + bits fixed up as well. Thanks to K, + {wf}ShadowSpawn and RR2DO2 for their + help tracking these last bugs down. + +2002-03-19 2.0.0-b1-rc2 Increased some maximums, and got + rid of some cruft. + +2002-03-22 2.0.0-b1-rc3 Some minor optimizations. + +2002-03-30 2.0.0-b1-rc5 Now with fur (see extras/fur.shader). + +2002-04-01 2.0.0-b1-rc6 Enhanced with baby seal technology. + +2002-05-01 2.0.1 OK, better late than never. Fixed the + alphashadow = 255 = transparent bug. + +2002-06-24 2.1.0-b1 Added _foghull functionality. Works + like terrain "_shader" where + you don't need "textures/" prefix. + Also added q3map_normalmap. See + NVIDIA's website for Photoshop filter + to generate normalmaps from grayscale + heightmaps. This makes lightmaps + look bumpmapped. Currently 50% broken. + +2002-07-06 2.2.0-b1 Empty epairs now stripped from map, + fixing Wolfenstein crash bug. Func_* + entities are now fogged properly. + Sort of. This will be enhanced later. + Added the .srf file to store all the + extra crap I was hiding in the BSP. + It's an editable text file that + -light uses, so you can change the + samplesize w/o recompiling the map + (just -light'ing it). Changed color + normalization to clamping, because + it looks better. Other stuff got + fixed as well. + +2002-07-08 2.2.0-b2 thru b11 Test versions. Thanks jer and jet! + +2002-07-09 2.2.0-b12 Larger-than-life lightmaps are now + supported, up to 1024x1024. Add + q3map_lightmapSize H W to a shader + to use. Lightmaps are stored in + maps/{mapname}/_lm_NNN.tga and a + shader script q3map_{mapname}.shader + is generated. Also added + q3map_lightmapGamma N.N. Use a + value of 2.0 to simulate + r_overBrightBits 1 and + r_mapOverBrightBits 2 on external + lightmap images. diff --git a/tools/quake3/q3map2/changelog.q3map2.txt b/tools/quake3/q3map2/changelog.q3map2.txt index d58c0242..47bceb51 100644 --- a/tools/quake3/q3map2/changelog.q3map2.txt +++ b/tools/quake3/q3map2/changelog.q3map2.txt @@ -1,107 +1,5 @@ Q3Map2 Version History + Changelog (Reverse Chronological Order) -2.5.16 (2004-10-18) - -- New: -fixaas mode to reassociate an AAS file with a changed BSP -- New: -nostyles switch on light phase disabling lightstyles -- Using libmhash cryptographic hashing library instead of md5lib - - -2.5.15 (2004-07-08) - -- New: q3map_rgbGen, q3map_rgbMod or q3map_colorGen, q3map_colorMod -- New: q3map_alphaGen const (like q3map_alphaMod set) -- New: q3map_noVertexLight to suppress overwriting of vertex rgb -- q3map_backShader now works again, can be used instead of - q3map_cloneShader + q3map_invert on the target shader -- q3map_alphaMod volume brushes in func_group entities will now only - affect that entity's surfaces -- q3map_clipModel now works on trans/nonsolid shaders, allowing - simplified clipping surfaces in models -- Fixed bug in alphaMod code where only the first vertex was being - modded (thanks Ratty) -- Vis exits instead of crashing with divide-by-zero when there are - no portals on simple box maps -- All of a surface's lightmaps must be solid or not solid, fixing - ST coord problem with non-Raven games using lightstyles -- Reverted a change in the meta code which was causing lightmap coord - overflows and ugly self-shadowing errors on surface boundaries -- Any use of lightstyles automatically sets -nocollapse to reduce - total shader counts -- Tenebrae lightmap size changed to 512x512 - - -2.5.14 (2004-04-09) - -- New: -dirty mode courtesy of RaP7oR (dirtmapping/ambient occlusion) -- New: q3map_skyLight code using more uniform angular distribution about - the sky hemisphere -- New: q3map_alphaMod set N.N -- New: q3map_alphaMod scale N.N -- New: q3map_alphaMod volume - applies all other q3map_alphaMod directives - to each vertex inside a brush textured with this shader, allowing large - faded scrolling fire shaders, waterfalls, marquees, explicit dotProduct - terrain blending control, etc. -- Fixed a bug in alphaMod code where the type of the first alphaMod was - being used for all subsequent alphaMods -- Lowered vertex-lit surface limits to 999 verts, 1000 was breaking Quake 3 -- Tightened up solid lightmap tolerances -- Fixed bug in solid lightmap code where lightmap SD coords were being - incorrectly set - - -2.5.13 (2004-03-03) - -- New: -convert -format to convert between different BSP formats. - Example, to convert a Jedi Academy map to Enemy Territory: - -game ja -convert -format et -- New: -game etut support for Urban Terror on Enemy Territory -- New: -analyze mode for reverse engineering a BSP format -- New: -compensate N.N (default 1.0) for descaling lightmap/vertex/grid - data to compensate for ingame overbrighting. 4.0 is a good value for - Quake 3 if used in combination with -gamma 2.2 -- New: compensate/gamma per-game setting -- New: -light -cpma argument for "classic" (sic) vertex lighting -- Replaced malloc() with stack allocation in IlluminateRawLightmap for - most small/medium lightmap calculations -- Misc cleanups in q3map2.h -- Support for non-128x128 lightmaps -- The -meta process will now generate surfaces with more than 64 - verts that have non-lightmapped shaders -- Extended lightmap size tolerance to 2x for merging meta triangles in - maps with aggressive lightmapscale. Sorry kids! -- Moved surface finish pass (celshading, cloning) to final surface pass. - This should fix a bug involving fog/tesselation/celshading/cloning -- Solid-color lightmaps (within 1/255 in RGB) are detected and replaced - with a single pixel lightmap, saving space - - -2.5.12 (2004-01-18) - -- New: -dark option for dark lightmap/brush seams in -light (Unreal 1-ish) -- New: spawnflags 4 on misc_model entities makes them forcemeta/lightmapped - unless explicitly set as vertex lit in their shader(s). This can be - combined with spawnflags 2 (solid) as spawnflags 6 -- New: -gamma N.N switch sets lightmap/vertex gamma value for more - realistic lighting, instead of using high ambient/minlight. Default - is 1.0 (linear ramp), good values are between 1.5 and 2.2 -- Changed q3map_lightmapGamma N.N to q3map_lightmapBrightness N.N, to - better match its intended function -- Ported to VS.NET 2003 and GtkRadiant 1.5 (spog_branch) -- Fixed bug in _skybox maps where sunlight was leaking through brushes. - Thanks pjw! -- Fixed bug in ASE loader where models without submodels/submaterials - would not load properly. -- Fixed bug where q3map_tcGen was not being applied to models -- Optimized MergeMetaTriangles a bit -- Added KOR's fix to raytracer -- -bouncegrid no longer affects the lightgrid dir -- Added feature to PicoModel where spaces in material names in 3DS, ASE - and LWO models will mark the end of the shader name, so you can have - "textures/foo/bar 1" and "textures/foo/bar 2" in Lightwave, and both - surfaces will map to "textures/foo/bar" - - 2.5.11 (2003-12-01) - New: added support for _skybox entities to generate "portal sky" diff --git a/tools/quake3/q3map2/convert_ase.c b/tools/quake3/q3map2/convert_ase.c index 6b4b8efd..f0ac6df5 100644 --- a/tools/quake3/q3map2/convert_ase.c +++ b/tools/quake3/q3map2/convert_ase.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/convert_map.c b/tools/quake3/q3map2/convert_map.c index 19e96cd8..ca0ba7fb 100644 --- a/tools/quake3/q3map2/convert_map.c +++ b/tools/quake3/q3map2/convert_map.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/decals.c b/tools/quake3/q3map2/decals.c index 45dfa941..5260437d 100644 --- a/tools/quake3/q3map2/decals.c +++ b/tools/quake3/q3map2/decals.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -660,6 +659,9 @@ static void ProjectDecalOntoWinding( decalProjector_t *dp, mapDrawSurface_t *ds, dv->color[ j ][ 3 ] = alpha; } } + + /* ydnar: finish the surface */ + FinishSurface( ds2 ); } @@ -786,7 +788,8 @@ static void ProjectDecalOntoTriangles( decalProjector_t *dp, mapDrawSurface_t *d /* triangle surfaces without shaders don't get marks by default */ - if( ds->type == SURFACE_TRIANGLES && ds->shaderInfo->shaderText == NULL ) + if( (ds->type == SURFACE_TRIANGLES || ds->type == SURFACE_FORCED_META) && + ds->shaderInfo->shaderText == NULL ) return; /* backface check */ diff --git a/tools/quake3/q3map2/facebsp.c b/tools/quake3/q3map2/facebsp.c index 8d15e9bc..484a7489 100644 --- a/tools/quake3/q3map2/facebsp.c +++ b/tools/quake3/q3map2/facebsp.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -180,7 +179,7 @@ int CountFaceList( face_t *list ) c = 0; - for( ; list != NULL; list = list->next ) + for( list; list != NULL; list = list->next ) c++; return c; } diff --git a/tools/quake3/q3map2/fog.c b/tools/quake3/q3map2/fog.c index b6f2203c..0cfdc924 100644 --- a/tools/quake3/q3map2/fog.c +++ b/tools/quake3/q3map2/fog.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -397,6 +396,8 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) { /* get brush side and plane */ s = &b->sides[ i ]; + if( s->backSide ) + continue; plane = &mapplanes[ s->planenum ]; /* handle coplanar outfacing (don't fog) */ diff --git a/tools/quake3/q3map2/game_ef.h b/tools/quake3/q3map2/game_ef.h index 0b711c89..8d15c732 100644 --- a/tools/quake3/q3map2/game_ef.h +++ b/tools/quake3/q3map2/game_ef.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -105,18 +104,11 @@ game_t struct ".ef", /* unix home sub-dir */ "elite", /* magic path word */ "scripts", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qfalse, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_etut.h b/tools/quake3/q3map2/game_etut.h deleted file mode 100644 index 8ee8a10c..00000000 --- a/tools/quake3/q3map2/game_etut.h +++ /dev/null @@ -1,264 +0,0 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ----------------------------------------------------------------------------------- - -This code has been altered significantly from its original form, to support -several games based on the Quake III Arena engine, in the form of "Q3Map2." - -------------------------------------------------------------------------------- */ - - - -/* marker */ -#ifndef GAME_ETUT_H -#define GAME_ETUT_H - - - -/* ------------------------------------------------------------------------------- - -content and surface flags - -------------------------------------------------------------------------------- */ - -/* game flags */ -#define U_CONT_SOLID 1 /* an eye is never valid in a solid */ -#define U_CONT_LAVA 8 -#define U_CONT_SLIME 16 -#define U_CONT_WATER 32 -#define U_CONT_FOG 64 - -#define U_CONT_AREAPORTAL 0x8000 - -#define U_CONT_PLAYERCLIP 0x10000 -#define U_CONT_MONSTERCLIP 0x20000 -#define U_CONT_TELEPORTER 0x40000 -#define U_CONT_JUMPPAD 0x80000 -#define U_CONT_CLUSTERPORTAL 0x100000 -#define U_CONT_DONOTENTER 0x200000 -#define U_CONT_BOTCLIP 0x400000 - -#define U_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */ - -#define U_CONT_BODY 0x2000000 /* should never be on a brush, only in game */ -#define U_CONT_CORPSE 0x4000000 -#define U_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */ -#define U_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */ -#define U_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */ -#define U_CONT_TRIGGER 0x40000000 -#define U_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */ - -#define U_SURF_NODAMAGE 0x1 /* never give falling damage */ -#define U_SURF_SLICK 0x2 /* effects game physics */ -#define U_SURF_SKY 0x4 /* lighting from environment map */ -#define U_SURF_LADDER 0x8 -#define U_SURF_NOIMPACT 0x10 /* don't make missile explosions */ -#define U_SURF_NOMARKS 0x20 /* don't leave missile marks */ -#define U_SURF_FLESH 0x40 /* make flesh sounds and effects */ -#define U_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */ -#define U_SURF_HINT 0x100 /* make a primary bsp splitter */ -#define U_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */ -#define U_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */ -#define U_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */ -#define U_SURF_METALSTEPS 0x1000 /* clanking footsteps */ -#define U_SURF_NOSTEPS 0x2000 /* no footstep sounds */ -#define U_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */ -#define U_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */ -#define U_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */ -#define U_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */ -#define U_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */ - -/* ydnar flags */ -#define U_SURF_VERTEXLIT (U_SURF_POINTLIGHT | U_SURF_NOLIGHTMAP) - -/* materials */ -#define U_MAT_MASK 0xFFF00000 /* mask to get the material type */ - -#define U_MAT_NONE 0x00000000 -#define U_MAT_TIN 0x00100000 -#define U_MAT_ALUMINUM 0x00200000 -#define U_MAT_IRON 0x00300000 -#define U_MAT_TITANIUM 0x00400000 -#define U_MAT_STEEL 0x00500000 -#define U_MAT_BRASS 0x00600000 -#define U_MAT_COPPER 0x00700000 -#define U_MAT_CEMENT 0x00800000 -#define U_MAT_ROCK 0x00900000 -#define U_MAT_GRAVEL 0x00A00000 -#define U_MAT_PAVEMENT 0x00B00000 -#define U_MAT_BRICK 0x00C00000 -#define U_MAT_CLAY 0x00D00000 -#define U_MAT_GRASS 0x00E00000 -#define U_MAT_DIRT 0x00F00000 -#define U_MAT_MUD 0x01000000 -#define U_MAT_SNOW 0x01100000 -#define U_MAT_ICE 0x01200000 -#define U_MAT_SAND 0x01300000 -#define U_MAT_CERAMICTILE 0x01400000 -#define U_MAT_LINOLEUM 0x01500000 -#define U_MAT_RUG 0x01600000 -#define U_MAT_PLASTER 0x01700000 -#define U_MAT_PLASTIC 0x01800000 -#define U_MAT_CARDBOARD 0x01900000 -#define U_MAT_HARDWOOD 0x01A00000 -#define U_MAT_SOFTWOOD 0x01B00000 -#define U_MAT_PLANK 0x01C00000 -#define U_MAT_GLASS 0x01D00000 -#define U_MAT_WATER 0x01E00000 -#define U_MAT_STUCCO 0x01F00000 - - - -/* ------------------------------------------------------------------------------- - -game_t struct - -------------------------------------------------------------------------------- */ - -{ - "etut", /* -game x */ - "etut", /* default base game data dir */ - ".etwolf", /* unix home sub-dir */ - "et", /* magic path word */ - "scripts", /* shader directory */ - 1024, /* max lightmapped surface verts */ - 1024, /* max surface verts */ - 6144, /* max surface indexes */ - qfalse, /* flares */ - "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 2.2f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ - "IBSP", /* bsp file prefix */ - 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ - LoadIBSPFile, /* bsp load function */ - WriteIBSPFile, /* bsp write function */ - - { - /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */ - - /* default */ - { "default", U_CONT_SOLID, -1, 0, -1, C_SOLID, -1 }, - - - /* ydnar */ - { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 }, - { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 }, - { "skip", 0, 0, 0, 0, C_SKIP, 0 }, - - - /* compiler */ - { "origin", U_CONT_ORIGIN, U_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID }, - { "areaportal", U_CONT_AREAPORTAL, U_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID }, - { "trans", U_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 }, - { "detail", U_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 }, - { "structural", U_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 }, - { "hint", 0, 0, U_SURF_HINT, 0, C_HINT, 0 }, - { "nodraw", 0, 0, U_SURF_NODRAW, 0, C_NODRAW, 0 }, - - { "alphashadow", 0, 0, U_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 }, - { "lightfilter", 0, 0, U_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 }, - { "nolightmap", 0, 0, U_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - { "pointlight", 0, 0, U_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - - - /* game */ - { "nonsolid", 0, U_CONT_SOLID, U_SURF_NONSOLID, 0, 0, C_SOLID }, - - { "trigger", U_CONT_TRIGGER, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "water", U_CONT_WATER, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "slime", U_CONT_SLIME, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "lava", U_CONT_LAVA, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - - { "playerclip", U_CONT_PLAYERCLIP, U_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "monsterclip", U_CONT_MONSTERCLIP, U_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "nodrop", U_CONT_NODROP, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "clusterportal", U_CONT_CLUSTERPORTAL, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "donotenter", U_CONT_DONOTENTER, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "botclip", U_CONT_BOTCLIP, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "fog", U_CONT_FOG, U_CONT_SOLID, 0, 0, C_FOG, C_SOLID }, - { "sky", 0, 0, U_SURF_SKY, 0, C_SKY, 0 }, - - { "slick", 0, 0, U_SURF_SLICK, 0, 0, 0 }, - - { "noimpact", 0, 0, U_SURF_NOIMPACT, 0, 0, 0 }, - { "nomarks", 0, 0, U_SURF_NOMARKS, 0, C_NOMARKS, 0 }, - { "ladder", 0, 0, U_SURF_LADDER, 0, 0, 0 }, - { "nodamage", 0, 0, U_SURF_NODAMAGE, 0, 0, 0 }, - { "metalsteps", 0, 0, U_SURF_METALSTEPS, 0, 0, 0 }, - { "flesh", 0, 0, U_SURF_FLESH, 0, 0, 0 }, - { "nosteps", 0, 0, U_SURF_NOSTEPS, 0, 0, 0 }, - { "nodlight", 0, 0, U_SURF_NODLIGHT, 0, 0, 0 }, - { "dust", 0, 0, U_SURF_DUST, 0, 0, 0 }, - - - /* materials */ - { "*mat_none", 0, 0, U_MAT_NONE, U_MAT_MASK, 0, 0 }, - { "*mat_tin", 0, 0, U_MAT_TIN, U_MAT_MASK, 0, 0 }, - { "*mat_aluminum", 0, 0, U_MAT_ALUMINUM, U_MAT_MASK, 0, 0 }, - { "*mat_iron", 0, 0, U_MAT_IRON, U_MAT_MASK, 0, 0 }, - { "*mat_titanium", 0, 0, U_MAT_TITANIUM, U_MAT_MASK, 0, 0 }, - { "*mat_steel", 0, 0, U_MAT_STEEL, U_MAT_MASK, 0, 0 }, - { "*mat_brass", 0, 0, U_MAT_BRASS, U_MAT_MASK, 0, 0 }, - { "*mat_copper", 0, 0, U_MAT_COPPER, U_MAT_MASK, 0, 0 }, - { "*mat_cement", 0, 0, U_MAT_CEMENT, U_MAT_MASK, 0, 0 }, - { "*mat_rock", 0, 0, U_MAT_ROCK, U_MAT_MASK, 0, 0 }, - { "*mat_gravel", 0, 0, U_MAT_GRAVEL, U_MAT_MASK, 0, 0 }, - { "*mat_pavement", 0, 0, U_MAT_PAVEMENT, U_MAT_MASK, 0, 0 }, - { "*mat_brick", 0, 0, U_MAT_BRICK, U_MAT_MASK, 0, 0 }, - { "*mat_clay", 0, 0, U_MAT_CLAY, U_MAT_MASK, 0, 0 }, - { "*mat_grass", 0, 0, U_MAT_GRASS, U_MAT_MASK, 0, 0 }, - { "*mat_dirt", 0, 0, U_MAT_DIRT, U_MAT_MASK, 0, 0 }, - { "*mat_mud", 0, 0, U_MAT_MUD, U_MAT_MASK, 0, 0 }, - { "*mat_snow", 0, 0, U_MAT_SNOW, U_MAT_MASK, 0, 0 }, - { "*mat_ice", 0, 0, U_MAT_ICE, U_MAT_MASK, 0, 0 }, - { "*mat_sand", 0, 0, U_MAT_SAND, U_MAT_MASK, 0, 0 }, - { "*mat_ceramic", 0, 0, U_MAT_CERAMICTILE, U_MAT_MASK, 0, 0 }, - { "*mat_ceramictile", 0, 0, U_MAT_CERAMICTILE, U_MAT_MASK, 0, 0 }, - { "*mat_linoleum", 0, 0, U_MAT_LINOLEUM, U_MAT_MASK, 0, 0 }, - { "*mat_rug", 0, 0, U_MAT_RUG, U_MAT_MASK, 0, 0 }, - { "*mat_plaster", 0, 0, U_MAT_PLASTER, U_MAT_MASK, 0, 0 }, - { "*mat_plastic", 0, 0, U_MAT_PLASTIC, U_MAT_MASK, 0, 0 }, - { "*mat_cardboard", 0, 0, U_MAT_CARDBOARD, U_MAT_MASK, 0, 0 }, - { "*mat_hardwood", 0, 0, U_MAT_HARDWOOD, U_MAT_MASK, 0, 0 }, - { "*mat_softwood", 0, 0, U_MAT_SOFTWOOD, U_MAT_MASK, 0, 0 }, - { "*mat_plank", 0, 0, U_MAT_PLANK, U_MAT_MASK, 0, 0 }, - { "*mat_glass", 0, 0, U_MAT_GLASS, U_MAT_MASK, 0, 0 }, - { "*mat_water", 0, 0, U_MAT_WATER, U_MAT_MASK, 0, 0 }, - { "*mat_stucco", 0, 0, U_MAT_STUCCO, U_MAT_MASK, 0, 0 }, - - - /* null */ - { NULL, 0, 0, 0, 0, 0, 0 } - } -} - - - -/* end marker */ -#endif - diff --git a/tools/quake3/q3map2/game_ja.h b/tools/quake3/q3map2/game_ja.h index 80cbb043..d7b39762 100644 --- a/tools/quake3/q3map2/game_ja.h +++ b/tools/quake3/q3map2/game_ja.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -59,18 +58,11 @@ game_t struct ".ja", /* unix home sub-dir */ "GameData", /* magic path word */ "shaders", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qtrue, /* flares */ "gfx/misc/flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_jk2.h b/tools/quake3/q3map2/game_jk2.h index 127c39a9..086eaced 100644 --- a/tools/quake3/q3map2/game_jk2.h +++ b/tools/quake3/q3map2/game_jk2.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -56,18 +55,11 @@ game_t struct ".jk2", /* unix home sub-dir */ "GameData", /* magic path word */ "shaders", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qtrue, /* flares */ "gfx/misc/flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_qfusion.h b/tools/quake3/q3map2/game_qfusion.h deleted file mode 100644 index 43c27fc5..00000000 --- a/tools/quake3/q3map2/game_qfusion.h +++ /dev/null @@ -1,195 +0,0 @@ -/* ------------------------------------------------------------------------------- - -This code is based on source provided under the terms of the Id Software -LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with the -GtkRadiant sources (see LICENSE_ID). If you did not receive a copy of -LICENSE_ID, please contact Id Software immediately at info@idsoftware.com. - -All changes and additions to the original source which have been developed by -other contributors (see CONTRIBUTORS) are provided under the terms of the -license the contributors choose (see LICENSE), to the extent permitted by the -LICENSE_ID. If you did not receive a copy of the contributor license, -please contact the GtkRadiant maintainers at info@gtkradiant.com immediately. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------------------- - -This code has been altered significantly from its original form, to support -several games based on the Quake III Arena engine, in the form of "Q3Map2." - -------------------------------------------------------------------------------- */ - - - -/* marker */ -#ifndef GAME_QFUSION_H -#define GAME_QFUSION_H - - - -/* ------------------------------------------------------------------------------- - -content and surface flags - -------------------------------------------------------------------------------- */ - -/* game flags */ -#define F_CONT_SOLID 1 /* an eye is never valid in a solid */ -#define F_CONT_LAVA 8 -#define F_CONT_SLIME 16 -#define F_CONT_WATER 32 -#define F_CONT_FOG 64 - -#define F_CONT_AREAPORTAL 0x8000 - -#define F_CONT_PLAYERCLIP 0x10000 -#define F_CONT_MONSTERCLIP 0x20000 -#define F_CONT_TELEPORTER 0x40000 -#define F_CONT_JUMPPAD 0x80000 -#define F_CONT_CLUSTERPORTAL 0x100000 -#define F_CONT_DONOTENTER 0x200000 -#define F_CONT_BOTCLIP 0x400000 - -#define F_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */ - -#define F_CONT_BODY 0x2000000 /* should never be on a brush, only in game */ -#define F_CONT_CORPSE 0x4000000 -#define F_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */ -#define F_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */ -#define F_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */ -#define F_CONT_TRIGGER 0x40000000 -#define F_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */ - -#define F_SURF_NODAMAGE 0x1 /* never give falling damage */ -#define F_SURF_SLICK 0x2 /* effects game physics */ -#define F_SURF_SKY 0x4 /* lighting from environment map */ -#define F_SURF_LADDER 0x8 -#define F_SURF_NOIMPACT 0x10 /* don't make missile explosions */ -#define F_SURF_NOMARKS 0x20 /* don't leave missile marks */ -#define F_SURF_FLESH 0x40 /* make flesh sounds and effects */ -#define F_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */ -#define F_SURF_HINT 0x100 /* make a primary bsp splitter */ -#define F_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */ -#define F_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */ -#define F_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */ -#define F_SURF_METALSTEPS 0x1000 /* clanking footsteps */ -#define F_SURF_NOSTEPS 0x2000 /* no footstep sounds */ -#define F_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */ -#define F_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */ -#define F_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */ -#define F_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */ -#define F_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */ - -/* ydnar flags */ -#define F_SURF_VERTEXLIT (F_SURF_POINTLIGHT | F_SURF_NOLIGHTMAP) - - - -/* ------------------------------------------------------------------------------- - -game_t struct - -------------------------------------------------------------------------------- */ - -{ - "qfusion", /* -game x */ - "baseq3", /* default base game data dir */ - ".q3a", /* unix home sub-dir */ - "quake", /* magic path word */ - "scripts", /* shader directory */ - 2048, /* max lightmapped surface verts */ - 2048, /* max surface verts */ - 12288, /* max surface indexes */ - qtrue, /* flares */ - "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 512, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ - "FBSP", /* bsp file prefix */ - 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ - LoadRBSPFile, /* bsp load function */ - WriteRBSPFile, /* bsp write function */ - - { - /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */ - - /* default */ - { "default", F_CONT_SOLID, -1, 0, -1, C_SOLID, -1 }, - - - /* ydnar */ - { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 }, - { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 }, - { "skip", 0, 0, 0, 0, C_SKIP, 0 }, - - - /* compiler */ - { "origin", F_CONT_ORIGIN, F_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID }, - { "areaportal", F_CONT_AREAPORTAL, F_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID }, - { "trans", F_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 }, - { "detail", F_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 }, - { "structural", F_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 }, - { "hint", 0, 0, F_SURF_HINT, 0, C_HINT, 0 }, - { "nodraw", 0, 0, F_SURF_NODRAW, 0, C_NODRAW, 0 }, - - { "alphashadow", 0, 0, F_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 }, - { "lightfilter", 0, 0, F_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 }, - { "nolightmap", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - { "pointlight", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - - - /* game */ - { "nonsolid", 0, F_CONT_SOLID, F_SURF_NONSOLID, 0, 0, C_SOLID }, - - { "trigger", F_CONT_TRIGGER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "water", F_CONT_WATER, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "slime", F_CONT_SLIME, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "lava", F_CONT_LAVA, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - - { "playerclip", F_CONT_PLAYERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "monsterclip", F_CONT_MONSTERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "nodrop", F_CONT_NODROP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "clusterportal", F_CONT_CLUSTERPORTAL, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "donotenter", F_CONT_DONOTENTER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "botclip", F_CONT_BOTCLIP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "fog", F_CONT_FOG, F_CONT_SOLID, 0, 0, C_FOG, C_SOLID }, - { "sky", 0, 0, F_SURF_SKY, 0, C_SKY, 0 }, - - { "slick", 0, 0, F_SURF_SLICK, 0, 0, 0 }, - - { "noimpact", 0, 0, F_SURF_NOIMPACT, 0, 0, 0 }, - { "nomarks", 0, 0, F_SURF_NOMARKS, 0, C_NOMARKS, 0 }, - { "ladder", 0, 0, F_SURF_LADDER, 0, 0, 0 }, - { "nodamage", 0, 0, F_SURF_NODAMAGE, 0, 0, 0 }, - { "metalsteps", 0, 0, F_SURF_METALSTEPS, 0, 0, 0 }, - { "flesh", 0, 0, F_SURF_FLESH, 0, 0, 0 }, - { "nosteps", 0, 0, F_SURF_NOSTEPS, 0, 0, 0 }, - { "nodlight", 0, 0, F_SURF_NODLIGHT, 0, 0, 0 }, - { "dust", 0, 0, F_SURF_DUST, 0, 0, 0 }, - - - /* null */ - { NULL, 0, 0, 0, 0, 0, 0 } - } -} - - - -/* end marker */ -#endif - diff --git a/tools/quake3/q3map2/game_quake3.h b/tools/quake3/q3map2/game_quake3.h index aa21bde1..9b55787d 100644 --- a/tools/quake3/q3map2/game_quake3.h +++ b/tools/quake3/q3map2/game_quake3.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -104,18 +103,11 @@ game_t struct ".q3a", /* unix home sub-dir */ "quake", /* magic path word */ "scripts", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qfalse, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_sof2.h b/tools/quake3/q3map2/game_sof2.h index 86619f9c..5d12d07d 100644 --- a/tools/quake3/q3map2/game_sof2.h +++ b/tools/quake3/q3map2/game_sof2.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -131,18 +130,11 @@ game_t struct ".sof2", /* unix home sub-dir */ "soldier", /* magic path word */ "shaders", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qtrue, /* flares */ "gfx/misc/lens_flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_t.h b/tools/quake3/q3map2/game_t.h index 778009e9..5eec9063 100644 --- a/tools/quake3/q3map2/game_t.h +++ b/tools/quake3/q3map2/game_t.h @@ -1,6 +1,6 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/game_tenebrae.h b/tools/quake3/q3map2/game_tenebrae.h index 764d0d34..a639288f 100644 --- a/tools/quake3/q3map2/game_tenebrae.h +++ b/tools/quake3/q3map2/game_tenebrae.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -104,18 +103,11 @@ game_t struct ".tenebrae", /* unix home sub-dir */ "tenebrae", /* magic path word */ "scripts", /* shader directory */ - 1024, /* max lightmapped surface verts */ - 1024, /* max surface verts */ - 6144, /* max surface indexes */ + qfalse, /* wolf lighting model? */ qfalse, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 512, /* lightmap width/height */ - 2.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_tremulous.h b/tools/quake3/q3map2/game_tremulous.h deleted file mode 100644 index 681ff1b7..00000000 --- a/tools/quake3/q3map2/game_tremulous.h +++ /dev/null @@ -1,160 +0,0 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. - -This file is part of GtkRadiant. - -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ----------------------------------------------------------------------------------- - -This code has been altered significantly from its original form, to support -several games based on the Quake III Arena engine, in the form of "Q3Map2." - -------------------------------------------------------------------------------- */ - -/* Tremulous support, by LinuxManMikeC */ - - -/* marker */ -#ifndef GAME_TREMULOUS_H -#define GAME_TREMULOUS_H - - - -/* ------------------------------------------------------------------------------- - -content and surface flags - also uses defines from game_quake3.h - -------------------------------------------------------------------------------- */ -#define TREM_CONT_NOALIENBUILD 0x1000 -#define TREM_CONT_NOHUMANBUILD 0x2000 -#define TREM_CONT_NOBUILD 0x4000 - -#define TREM_SURF_NOALIENBUILDSURFACE 0x80000 -#define TREM_SURF_NOHUMANBUILDSURFACE 0x100000 -#define TREM_SURF_NOBUILDSURFACE 0x200000 - - - -/* ------------------------------------------------------------------------------- - -game_t struct - -------------------------------------------------------------------------------- */ - -{ - "tremulous", /* -game x */ - "base", /* default base game data dir */ - ".tremulous", /* unix home sub-dir */ - "tremulous", /* magic path word - think this is right for trem*/ - "scripts", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ - qfalse, /* flares */ - "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ - "IBSP", /* bsp file prefix */ - 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ - LoadIBSPFile, /* bsp load function */ - WriteIBSPFile, /* bsp write function */ - - { - /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */ - - /* default */ - { "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 }, - - - /* ydnar */ - { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 }, - { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 }, - { "skip", 0, 0, 0, 0, C_SKIP, 0 }, - - - /* compiler */ - { "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID }, - { "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID }, - { "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 }, - { "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 }, - { "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 }, - { "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 }, - { "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 }, - - { "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 }, - { "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 }, - { "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - { "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 }, - - - /* game */ - { "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID }, - - { "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - { "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID }, - - { "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }, - { "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - { "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID }, - - { "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID }, - { "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 }, - - { "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 }, - - { "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 }, - { "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 }, - { "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 }, - { "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 }, - { "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 }, - { "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 }, - { "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 }, - { "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 }, - { "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 }, - - - /* tremulous */ - {"noalienbuild", TREM_CONT_NOALIENBUILD,0,0,0,0,0}, - {"nohumanbuild", TREM_CONT_NOHUMANBUILD,0,0,0,0,0}, - {"nobuild", TREM_CONT_NOBUILD,0,0,0,0,0}, - - {"noalienbuildsurface", 0,0,TREM_SURF_NOALIENBUILDSURFACE,0,0,0}, - {"nohumanbuildsurface", 0,0,TREM_SURF_NOHUMANBUILDSURFACE,0,0,0}, - {"nobuildsurface", 0,0,TREM_SURF_NOBUILDSURFACE,0,0,0}, - - - /* null */ - { NULL, 0, 0, 0, 0, 0, 0 } - } -} - - - -/* end marker */ -#endif - diff --git a/tools/quake3/q3map2/game_wolf.h b/tools/quake3/q3map2/game_wolf.h index f1d80643..0e882868 100644 --- a/tools/quake3/q3map2/game_wolf.h +++ b/tools/quake3/q3map2/game_wolf.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -121,18 +120,11 @@ game_t struct ".wolf", /* unix home sub-dir */ "wolf", /* magic path word */ "scripts", /* shader directory */ - 64, /* max lightmapped surface verts */ - 999, /* max surface verts */ - 6000, /* max surface indexes */ + qtrue, /* wolf lighting model? */ qfalse, /* flares */ "flareshader", /* default flare shader */ - qtrue, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_wolfet.h b/tools/quake3/q3map2/game_wolfet.h index 75ea60b8..fdc5b7e8 100644 --- a/tools/quake3/q3map2/game_wolfet.h +++ b/tools/quake3/q3map2/game_wolfet.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -58,18 +57,11 @@ game_t struct ".etwolf", /* unix home sub-dir */ "et", /* magic path word */ "scripts", /* shader directory */ - 1024, /* max lightmapped surface verts */ - 1024, /* max surface verts */ - 6144, /* max surface indexes */ + qtrue, /* wolf lighting model? */ qfalse, /* flares */ "flareshader", /* default flare shader */ - qtrue, /* wolf lighting model? */ - 128, /* lightmap width/height */ - 1.0f, /* lightmap gamma */ - 1.0f, /* lightmap compensate */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index 54779005..fec9f6f5 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -391,7 +390,7 @@ image_t *ImageLoad( const char *filename ) strcat( name, ".tga" ); size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 ); if( size > 0 ) - LoadTGABuffer( buffer, buffer + size, &image->pixels, &image->width, &image->height ); + LoadTGABuffer( buffer, &image->pixels, &image->width, &image->height ); else { /* attempt to load png */ diff --git a/tools/quake3/q3map2/leakfile.c b/tools/quake3/q3map2/leakfile.c index adcaca71..1d72604b 100644 --- a/tools/quake3/q3map2/leakfile.c +++ b/tools/quake3/q3map2/leakfile.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 175f16fa..670c9a0e 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -116,7 +115,6 @@ static void CreateSunLight( sun_t *sun ) light->fade = 1.0f; light->falloffTolerance = falloffTolerance; light->filterRadius = sun->filterRadius / sun->numSamples; - light->style = noStyles ? LS_NORMAL : sun->style; /* set the light's position out to infinity */ VectorMA( vec3_origin, (MAX_WORLD_COORD * 8.0f), direction, light->origin ); /* MAX_WORLD_COORD * 2.0f */ @@ -142,13 +140,11 @@ CreateSkyLights() - ydnar simulates sky light with multiple suns */ -static void CreateSkyLights( vec3_t color, float value, int iterations, float filterRadius, int style ) +static void CreateSkyLights( vec3_t color, float value, int iterations, float filterRadius ) { - int i, j, numSuns; - int angleSteps, elevationSteps; - float angle, elevation; - float angleStep, elevationStep; + int c, i, j, k, numSuns; float step, start; + vec3_t in; sun_t sun; @@ -165,49 +161,36 @@ static void CreateSkyLights( vec3_t color, float value, int iterations, float fi sun.deviance = 0.0f; sun.filterRadius = filterRadius; sun.numSamples = 1; - sun.style = noStyles ? LS_NORMAL : style; sun.next = NULL; - /* setup */ - elevationSteps = iterations - 1; - angleSteps = elevationSteps * 4; - angle = 0.0f; - elevationStep = DEG2RAD( 90.0f / iterations ); /* skip elevation 0 */ - angleStep = DEG2RAD( 360.0f / angleSteps ); - - /* calc individual sun brightness */ - numSuns = angleSteps * elevationSteps + 1; - sun.photons = value / numSuns; - - /* iterate elevation */ - elevation = elevationStep * 0.5f; - angle = 0.0f; - for( i = 0, elevation = elevationStep * 0.5f; i < elevationSteps; i++ ) + /* iterate */ + numSuns = 0; + for( c = 0; c < 2; c++ ) { - /* iterate angle */ - for( j = 0; j < angleSteps; j++ ) + for( k = 0, in[ 2 ] = start; k < iterations; k++, in[ 2 ] += step ) { - /* create sun */ - sun.direction[ 0 ] = cos( angle ) * cos( elevation ); - sun.direction[ 1 ] = sin( angle ) * cos( elevation ); - sun.direction[ 2 ] = sin( elevation ); - CreateSunLight( &sun ); + /* don't create sky light below the horizon */ + if( in[ 2 ] <= 0.0f ) + continue; - /* move */ - angle += angleStep; + for( j = 0, in[ 1 ] = start; j < iterations; j++, in[ 1 ] += step ) + { + for( i = 0, in[ 0 ] = start; i < iterations; i++, in[ 0 ] += step ) + { + if( VectorNormalize( in, sun.direction ) ) + { + if( c > 0 && numSuns > 0 ) + { + sun.photons = value / numSuns; + CreateSunLight( &sun ); + } + else + numSuns++; + } + } + } } - - /* move */ - elevation += elevationStep; - angle += angleStep / elevationSteps; } - - /* create vertical sun */ - VectorSet( sun.direction, 0.0f, 0.0f, 1.0f ); - CreateSunLight( &sun ); - - /* short circuit */ - return; } @@ -262,7 +245,7 @@ void CreateEntityLights( void ) spawnflags = IntForKey( e, "spawnflags" ); /* ydnar: quake 3+ light behavior */ - if( wolfLight == qfalse ) + if( game->wolfLight == qfalse ) { /* set default flags */ flags = LIGHT_Q3A_DEFAULT; @@ -334,15 +317,11 @@ void CreateEntityLights( void ) /* set origin */ GetVectorForKey( e, "origin", light->origin); light->style = IntForKey( e, "_style" ); - if( light->style == LS_NORMAL ) + if( light->style == 0 ) light->style = IntForKey( e, "style" ); if( light->style < LS_NORMAL || light->style >= LS_NONE ) Error( "Invalid lightstyle (%d) on entity %d", light->style, i ); - /* override */ - if( noStyles ) - light->style = LS_NORMAL; - /* set light intensity */ intensity = FloatForKey( e, "_light" ); if( intensity == 0.0f ) @@ -454,7 +433,6 @@ void CreateEntityLights( void ) sun.photons = (intensity / pointScale); sun.deviance = deviance / 180.0f * Q_PI; sun.numSamples = numSamples; - sun.style = noStyles ? LS_NORMAL : light->style; sun.next = NULL; /* make a sun light */ @@ -538,7 +516,7 @@ void CreateSurfaceLights( void ) if( si->skyLightValue > 0.0f ) { Sys_FPrintf( SYS_VRB, "Sky: %s\n", si->shader ); - CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius, si->lightStyle ); + CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius ); si->skyLightValue = 0.0f; /* FIXME: hack! */ } @@ -568,7 +546,7 @@ void CreateSurfaceLights( void ) VectorCopy( origin, light->origin ); VectorCopy( si->color, light->color ); light->falloffTolerance = falloffTolerance; - light->style = si->lightStyle; + light->style = light->style; /* add to point light count and continue */ numPointLights++; @@ -759,8 +737,35 @@ int LightContributionToSample( trace_t *trace ) return 0; } + /* ptpff approximation */ + if( light->type == EMIT_AREA && faster ) + { + /* get direction and distance */ + VectorCopy( light->origin, trace->end ); + dist = SetupTrace( trace ); + if( dist >= light->envelope ) + return 0; + + /* clamp the distance to prevent super hot spots */ + if( dist < 16.0f ) + dist = 16.0f; + + /* angle attenuation */ + angle = DotProduct( trace->normal, trace->direction ); + + /* twosided lighting */ + if( trace->twoSided ) + angle = fabs( angle ); + + /* attenuate */ + angle *= -DotProduct( light->normal, trace->direction ); + if( angle <= 0.0f ) + return 0; + add = light->photons / (dist * dist) * angle; + } + /* exact point to polygon form factor */ - if( light->type == EMIT_AREA ) + else if( light->type == EMIT_AREA ) { float factor; float d; @@ -769,6 +774,8 @@ int LightContributionToSample( trace_t *trace ) /* project sample point into light plane */ d = DotProduct( trace->origin, light->normal ) - light->dist; + //% if( !(light->flags & LIGHT_TWOSIDED) && d < -1.0f ) + //% return 0; if( d < 3.0f ) { /* sample point behind plane? */ @@ -793,51 +800,29 @@ int LightContributionToSample( trace_t *trace ) if( dist >= light->envelope ) return 0; - /* ptpff approximation */ - if( faster ) + /* calculate the contribution */ + factor = PointToPolygonFormFactor( pushedOrigin, trace->normal, light->w ); + if( factor == 0.0f ) + return 0; + else if( factor < 0.0f ) { - /* angle attenuation */ - angle = DotProduct( trace->normal, trace->direction ); - /* twosided lighting */ - if( trace->twoSided ) - angle = fabs( angle ); - - /* attenuate */ - angle *= -DotProduct( light->normal, trace->direction ); - if( angle == 0.0f ) - return 0; - else if( angle < 0.0f && - (trace->twoSided || (light->flags & LIGHT_TWOSIDED)) ) - angle = -angle; - add = light->photons / (dist * dist) * angle; - } - else - { - /* calculate the contribution */ - factor = PointToPolygonFormFactor( pushedOrigin, trace->normal, light->w ); - if( factor == 0.0f ) - return 0; - else if( factor < 0.0f ) + if( trace->twoSided || (light->flags & LIGHT_TWOSIDED) ) { - /* twosided lighting */ - if( trace->twoSided || (light->flags & LIGHT_TWOSIDED) ) - { - factor = -factor; + factor = -factor; - /* push light origin to other side of the plane */ - VectorMA( light->origin, -2.0f, light->normal, trace->end ); - dist = SetupTrace( trace ); - if( dist >= light->envelope ) - return 0; - } - else + /* push light origin to other side of the plane */ + VectorMA( light->origin, -2.0f, light->normal, trace->end ); + dist = SetupTrace( trace ); + if( dist >= light->envelope ) return 0; } - - /* ydnar: moved to here */ - add = factor * light->add; + else + return 0; } + + /* ydnar: moved to here */ + add = factor * light->add; } /* point/spot lights */ @@ -1451,8 +1436,7 @@ void TraceGrid( int num ) #endif /* store direction */ - if( !bouncing ) - NormalToLatLong( gp->dir, bgp->latLong ); + NormalToLatLong( gp->dir, bgp->latLong ); } @@ -1649,18 +1633,6 @@ void LightWorld( void ) Sys_Printf( "%9d luxels\n", numLuxels ); Sys_Printf( "%9d luxels mapped\n", numLuxelsMapped ); Sys_Printf( "%9d luxels occluded\n", numLuxelsOccluded ); - - /* dirty them up */ - if( dirty ) - { - Sys_Printf( "--- DirtyRawLightmap ---\n" ); - - - - - RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap ); - } - /* ydnar: set up light envelopes */ SetupEnvelopes( qfalse, fast ); @@ -1775,12 +1747,6 @@ int LightMain( int argc, char **argv ) /* note it */ Sys_Printf( "--- Light ---\n" ); - /* set standard game flags */ - wolfLight = game->wolfLight; - lmCustomSize = game->lightmapSize; - lightmapGamma = game->lightmapGamma; - lightmapCompensate = game->lightmapCompensate; - /* process commandline arguments */ for( i = 1; i < (argc - 1); i++ ) { @@ -1828,24 +1794,6 @@ int LightMain( int argc, char **argv ) i++; } - else if( !strcmp( argv[ i ], "-gamma" ) ) - { - f = atof( argv[ i + 1 ] ); - lightmapGamma = f; - Sys_Printf( "Lighting gamma set to %f\n", lightmapGamma ); - i++; - } - - else if( !strcmp( argv[ i ], "-compensate" ) ) - { - f = atof( argv[ i + 1 ] ); - if( f <= 0.0f ) - f = 1.0f; - lightmapCompensate = f; - Sys_Printf( "Lighting compensation set to 1/%f\n", lightmapCompensate ); - i++; - } - /* ydnar switches */ else if( !strcmp( argv[ i ], "-bounce" ) ) { @@ -1883,18 +1831,6 @@ int LightMain( int argc, char **argv ) Sys_Printf( "Lightmap filtering enabled\n" ); } - else if( !strcmp( argv[ i ], "-dark" ) ) - { - dark = qtrue; - Sys_Printf( "Dark lightmap seams enabled\n" ); - } - - - - - - - else if( !strcmp( argv[ i ], "-shadeangle" ) ) { shadeAngleDegrees = atof( argv[ i + 1 ] ); @@ -1948,13 +1884,13 @@ int LightMain( int argc, char **argv ) if( ((lmCustomSize - 1) & lmCustomSize) || lmCustomSize < 2 ) { Sys_Printf( "WARNING: Lightmap size must be a power of 2, greater or equal to 2 pixels.\n" ); - lmCustomSize = game->lightmapSize; + lmCustomSize = LIGHTMAP_WIDTH; } i++; Sys_Printf( "Default lightmap size set to %d x %d pixels\n", lmCustomSize, lmCustomSize ); /* enable external lightmaps */ - if( lmCustomSize != game->lightmapSize ) + if( lmCustomSize != LIGHTMAP_WIDTH ) { externalLightmaps = qtrue; Sys_Printf( "Storing all lightmaps externally\n" ); @@ -1971,15 +1907,8 @@ int LightMain( int argc, char **argv ) else if( !strcmp( argv[ i ], "-wolf" ) ) { /* -game should already be set */ - wolfLight = qtrue; - Sys_Printf( "Enabling Wolf lighting model (linear default)\n" ); - } - - else if( !strcmp( argv[ i ], "-q3" ) ) - { - /* -game should already be set */ - wolfLight = qfalse; - Sys_Printf( "Enabling Quake 3 lighting model (nonlinear default)\n" ); + game->wolfLight = qtrue; + Sys_Printf( "Enabling Wolf lighting model\n" ); } else if( !strcmp( argv[ i ], "-sunonly" ) ) @@ -2015,6 +1944,7 @@ int LightMain( int argc, char **argv ) else if( !strcmp( argv[ i ], "-smooth" ) ) { + smooth = qtrue; lightSamples = EXTRA_SCALE; Sys_Printf( "The -smooth argument is deprecated, use \"-samples 2\" instead\n" ); } @@ -2134,11 +2064,14 @@ int LightMain( int argc, char **argv ) } else if( !strcmp( argv[ i ], "-extra" ) ) { + extra = qtrue; superSample = EXTRA_SCALE; /* ydnar */ Sys_Printf( "The -extra argument is deprecated, use \"-super 2\" instead\n" ); } else if( !strcmp( argv[ i ], "-extrawide" ) ) { + extra = qtrue; + extraWide = qtrue; superSample = EXTRAWIDE_SCALE; /* ydnar */ filter = qtrue; /* ydnar */ Sys_Printf( "The -extrawide argument is deprecated, use \"-filter [-super 2]\" instead\n"); @@ -2181,64 +2114,9 @@ int LightMain( int argc, char **argv ) loMem = qtrue; Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" ); } - else if( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) - { - noStyles = qtrue; - Sys_Printf( "Disabling lightstyles\n" ); - } - else if( !strcmp( argv[ i ], "-cpma" ) ) - { - cpmaHack = qtrue; - Sys_Printf( "Enabling Challenge Pro Mode Asstacular Vertex Lighting Mode (tm)\n" ); - } - /* r7: dirtmapping */ - else if( !strcmp( argv[ i ], "-dirty" ) ) - { - dirty = qtrue; - Sys_Printf( "Dirtmapping enabled\n" ); - } - else if( !strcmp( argv[ i ], "-dirtdebug" ) || !strcmp( argv[ i ], "-debugdirt" ) ) - { - dirtDebug = qtrue; - Sys_Printf( "Dirtmap debugging enabled\n" ); - } - else if( !strcmp( argv[ i ], "-dirtmode" ) ) - { - dirtMode = atoi( argv[ i + 1 ] ); - if( dirtMode != 0 && dirtMode != 1 ) - dirtMode = 0; - if( dirtMode == 1 ) - Sys_Printf( "Enabling randomized dirtmapping\n" ); - else - Sys_Printf( "Enabling ordered dir mapping\n" ); - } - else if( !strcmp( argv[ i ], "-dirtdepth" ) ) - { - dirtDepth = atof( argv[ i + 1 ] ); - if( dirtDepth <= 0.0f ) - dirtDepth = 128.0f; - Sys_Printf( "Dirtmapping depth set to %.1f\n", dirtDepth ); - } - else if( !strcmp( argv[ i ], "-dirtscale" ) ) - { - dirtScale = atof( argv[ i + 1 ] ); - if( dirtScale <= 0.0f ) - dirtScale = 1.0f; - Sys_Printf( "Dirtmapping scale set to %.1f\n", dirtScale ); - } - else if( !strcmp( argv[ i ], "-dirtgain" ) ) - { - dirtGain = atof( argv[ i + 1 ] ); - if( dirtGain <= 0.0f ) - dirtGain = 1.0f; - Sys_Printf( "Dirtmapping gain set to %.1f\n", dirtGain ); - } - - /* unhandled args */ else - Sys_Printf( "WARNING: Unknown argument \"%s\"\n", argv[ i ] ); - + Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] ); } /* clean up map name */ @@ -2278,7 +2156,6 @@ int LightMain( int argc, char **argv ) /* ydnar: set up optimization */ SetupBrushes(); - SetupDirt(); SetupSurfaceLightmaps(); /* initialize the surface facet tracing */ diff --git a/tools/quake3/q3map2/light_bounce.c b/tools/quake3/q3map2/light_bounce.c index 8d2e4c1e..4181ce53 100644 --- a/tools/quake3/q3map2/light_bounce.c +++ b/tools/quake3/q3map2/light_bounce.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -510,7 +509,7 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw break; case MST_TRIANGLE_SOUP: - numTriangleDiffuseLights++; + numTriangleDiffuseLights; break; case MST_PATCH: @@ -547,9 +546,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw light->add = value * formFactorValueScale * areaScale; VectorCopy( si->color, light->color ); VectorScale( light->color, light->add, light->emitColor ); - light->style = noStyles ? LS_NORMAL : si->lightStyle; - if( light->style < LS_NORMAL || light->style >= LS_NONE ) - light->style = LS_NORMAL; + light->style = si->lightStyle; + if( light->style < 0 || light->style >= LS_NONE ) + light->style = 0; /* set origin */ VectorAdd( mins, maxs, light->origin ); @@ -578,7 +577,7 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw VectorMA( light->origin, si->backsplashDistance, normal, splash->origin ); VectorCopy( si->color, splash->color ); splash->falloffTolerance = falloffTolerance; - splash->style = noStyles ? LS_NORMAL : light->style; + splash->style = light->style; /* add to counts */ numPointLights++; @@ -592,9 +591,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw light->add = value * formFactorValueScale * bounceScale; VectorCopy( color, light->color ); VectorScale( light->color, light->add, light->emitColor ); - light->style = noStyles ? LS_NORMAL : style; - if( light->style < LS_NORMAL || light->style >= LS_NONE ) - light->style = LS_NORMAL; + light->style = style; + if( light->style < 0 || light->style >= LS_NONE ) + light->style = 0; /* set origin */ WindingCenter( w, light->origin ); @@ -953,4 +952,3 @@ void RadCreateDiffuseLights( void ) - diff --git a/tools/quake3/q3map2/light_shadows.c b/tools/quake3/q3map2/light_shadows.c index 70aafb86..df7cdd82 100644 --- a/tools/quake3/q3map2/light_shadows.c +++ b/tools/quake3/q3map2/light_shadows.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/light_trace.c b/tools/quake3/q3map2/light_trace.c index 8d6dd822..287b22dd 100644 --- a/tools/quake3/q3map2/light_trace.c +++ b/tools/quake3/q3map2/light_trace.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -73,7 +72,7 @@ traceVert_t; typedef struct traceInfo_s { shaderInfo_t *si; - int surfaceNum, castShadows; + int surfaceNum, castShadows, padding; } traceInfo_t; @@ -88,7 +87,7 @@ traceWinding_t; typedef struct traceTriangle_s { vec3_t edge1, edge2; - int infoNum; + int infoNum, padding; traceVert_t v[ 3 ]; } traceTriangle_t; @@ -327,8 +326,6 @@ static int AddItemToTraceNode( traceNode_t *node, int num ) node->maxItems *= 2; else node->maxItems += GROW_NODE_ITEMS; - if( node->maxItems <= 0 ) - node->maxItems = GROW_NODE_ITEMS; temp = safe_malloc( node->maxItems * sizeof( *node->items ) ); if( node->items != NULL ) { @@ -387,6 +384,16 @@ static int SetupTraceNodes_r( int bspNodeNum ) { bspLeafNum = -bspNode->children[ i ] - 1; + #if 0 + /* solid leaf */ + if( bspLeafs[ bspLeafNum ].cluster == -1 ) + traceNodes[ nodeNum ].children[ i ] = -1; + + /* passable leaf */ + else + traceNodes[ nodeNum ].children[ i ] = AllocTraceNode(); + #endif + /* new code */ traceNodes[ nodeNum ].children[ i ] = AllocTraceNode(); if( bspLeafs[ bspLeafNum ].cluster == -1 ) @@ -961,23 +968,17 @@ static void PopulateWithBSPModel( bspModel_t *model, m4x4_t transform ) ti.castShadows = info->castShadows; ti.surfaceNum = model->firstBSPBrush + i; - /* choose which node (normal or skybox) */ - if( info->parentSurfaceNum >= 0 ) - { - nodeNum = skyboxNodeNum; - - /* sky surfaces in portal skies are ignored */ - if( info->si->compileFlags & C_SKY ) - continue; - } - else - nodeNum = headNodeNum; - /* setup trace winding */ memset( &tw, 0, sizeof( tw ) ); tw.infoNum = AddTraceInfo( &ti ); tw.numVerts = 3; + /* choose which node (normal or skybox) */ + if( info->parentSurfaceNum >= 0 ) + nodeNum = skyboxNodeNum; + else + nodeNum = headNodeNum; + /* switch on type */ switch( ds->surfaceType ) { @@ -1435,7 +1436,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ) det = DotProduct( tt->edge1, pvec ); /* the non-culling branch */ - if( fabs( det ) < COPLANAR_EPSILON ) + if( det > -COPLANAR_EPSILON && det < COPLANAR_EPSILON ) return qfalse; invDet = 1.0f / det; @@ -1457,6 +1458,8 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ) /* calculate t (depth) */ depth = DotProduct( tt->edge2, qvec ) * invDet; + //% if( depth <= SELF_SHADOW_EPSILON || depth >= (trace->dist - SELF_SHADOW_EPSILON) ) + //% return qfalse; if( depth <= trace->inhibitRadius || depth >= trace->distance ) return qfalse; @@ -1482,7 +1485,6 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ) if( !(si->compileFlags & (C_ALPHASHADOW | C_LIGHTFILTER)) || si->lightImage == NULL || si->lightImage->pixels == NULL ) { - VectorMA( trace->origin, depth, trace->direction, trace->hit ); VectorClear( trace->color ); trace->opaque = qtrue; return qtrue; @@ -1529,7 +1531,6 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ) /* check filter for opaque */ if( trace->color[ 0 ] <= 0.001f && trace->color[ 1 ] <= 0.001f && trace->color[ 2 ] <= 0.001f ) { - VectorMA( trace->origin, depth, trace->direction, trace->hit ); trace->opaque = qtrue; return qtrue; } @@ -1595,7 +1596,6 @@ static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *tr /* bogus node number means solid, end tracing unless testing all */ if( nodeNum < 0 ) { - VectorCopy( origin, trace->hit ); trace->passSolid = qtrue; return qtrue; } @@ -1606,7 +1606,6 @@ static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *tr /* solid? */ if( node->type == TRACE_LEAF_SOLID ) { - VectorCopy( origin, trace->hit ); trace->passSolid = qtrue; return qtrue; } @@ -1667,9 +1666,6 @@ static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *tr /* fixme: check inhibit radius, then solid nodes and ignore */ - /* set trace hit here */ - //% VectorCopy( mid, trace->hit ); - /* trace first side */ r = TraceLine_r( node->children[ side ], origin, mid, trace ); if( r ) @@ -1706,7 +1702,7 @@ void TraceLine( trace_t *trace ) /* trace through nodes */ TraceLine_r( headNodeNum, trace->origin, trace->end, trace ); - if( trace->passSolid && !trace->testAll ) + if( (trace->passSolid && !trace->testAll) ) { trace->opaque = qtrue; return; @@ -1718,7 +1714,6 @@ void TraceLine( trace_t *trace ) /* testall means trace through sky */ if( trace->testAll && trace->numTestNodes < MAX_TRACE_TEST_NODES && - trace->compileFlags & C_SKY && (trace->numSurfaces == 0 || surfaceInfos[ trace->surfaces[ 0 ] ].childSurfaceNum < 0) ) { //% trace->testNodes[ trace->numTestNodes++ ] = skyboxNodeNum; @@ -1755,6 +1750,5 @@ float SetupTrace( trace_t *trace ) { VectorSubtract( trace->end, trace->origin, trace->displacement ); trace->distance = VectorNormalize( trace->displacement, trace->direction ); - VectorCopy( trace->origin, trace->hit ); return trace->distance; } diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index b33a0140..6a292156 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -46,8 +45,7 @@ ydnar: moved to here 2001-02-04 void ColorToBytes( const float *color, byte *colorBytes, float scale ) { - int i; - float max, gamma; + float max; vec3_t sample; @@ -58,20 +56,13 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ) /* make a local copy */ VectorScale( color, scale, sample ); - /* muck with it */ - gamma = 1.0f / lightmapGamma; - for( i = 0; i < 3; i++ ) - { - /* handle negative light */ - if( sample[ i ] < 0.0f ) - { - sample[ i ] = 0.0f; - continue; - } - - /* gamma */ - sample[ i ] = pow( sample[ i ] / 255.0f, gamma ) * 255.0f; - } + /* handle negative light */ + if( sample[ 0 ] < 0.0f ) + sample[ 0 ] = 0.0f; + if( sample[ 1 ] < 0.0f ) + sample[ 1 ] = 0.0f; + if( sample[ 2 ] < 0.0f ) + sample[ 2 ] = 0.0f; /* clamp with color normalization */ max = sample[ 0 ]; @@ -82,9 +73,6 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ) if( max > 255.0f ) VectorScale( sample, (255.0f / max), sample ); - /* compensate for ingame overbrighting/bitshifting */ - VectorScale( sample, (1.0f / lightmapCompensate), sample ); - /* store it off */ colorBytes[ 0 ] = sample[ 0 ]; colorBytes[ 1 ] = sample[ 1 ]; @@ -522,8 +510,8 @@ static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t /* another retarded hack, storing nudge count in luxel[ 1 ] */ luxel[ 1 ] = 0.0f; - /* point in solid? (except in dark mode) */ - if( pointCluster < 0 && dark == qfalse ) + /* point in solid? */ + if( pointCluster < 0 ) { /* nudge the the location around */ nudge = nudges[ 0 ]; @@ -545,8 +533,8 @@ static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t } } - /* as a last resort, if still in solid, try drawvert origin offset by normal (except in dark mode) */ - if( pointCluster < 0 && si != NULL && dark == qfalse ) + /* as a last resort, if still in solid, try drawvert origin offset by normal */ + if( pointCluster < 0 && si != NULL ) { VectorMA( dv->xyz, lightmapSampleOffset, dv->normal, nudged ); pointCluster = ClusterForPointExtFilter( nudged, LUXEL_EPSILON, numClusters, clusters ); @@ -1256,310 +1244,6 @@ void MapRawLightmap( int rawLightmapNum ) -/* -SetupDirt() -sets up dirtmap (ambient occlusion) -*/ - -#define DIRT_CONE_ANGLE 88 /* degrees */ -#define DIRT_NUM_ANGLE_STEPS 16 -#define DIRT_NUM_ELEVATION_STEPS 3 -#define DIRT_NUM_VECTORS (DIRT_NUM_ANGLE_STEPS * DIRT_NUM_ELEVATION_STEPS) - -static vec3_t dirtVectors[ DIRT_NUM_VECTORS ]; -static int numDirtVectors = 0; - -void SetupDirt( void ) -{ - int i, j; - float angle, elevation, angleStep, elevationStep; - - - /* note it */ - Sys_FPrintf( SYS_VRB, "--- SetupDirt ---\n" ); - - /* calculate angular steps */ - angleStep = DEG2RAD( 360.0f / DIRT_NUM_ANGLE_STEPS ); - elevationStep = DEG2RAD( DIRT_CONE_ANGLE / DIRT_NUM_ELEVATION_STEPS ); - - /* iterate angle */ - angle = 0.0f; - for( i = 0, angle = 0.0f; i < DIRT_NUM_ANGLE_STEPS; i++, angle += angleStep ) - { - /* iterate elevation */ - for( j = 0, elevation = elevationStep * 0.5f; j < DIRT_NUM_ELEVATION_STEPS; j++, elevation += elevationStep ) - { - dirtVectors[ numDirtVectors ][ 0 ] = sin( elevation ) * cos( angle ); - dirtVectors[ numDirtVectors ][ 1 ] = sin( elevation ) * sin( angle ); - dirtVectors[ numDirtVectors ][ 2 ] = cos( elevation ); - numDirtVectors++; - } - } - - /* emit some statistics */ - Sys_FPrintf( SYS_VRB, "%9d dirtmap vectors\n", numDirtVectors ); -} - - -/* -DirtForSample() -calculates dirt value for a given sample -*/ - -float DirtForSample( trace_t *trace ) -{ - int i; - float gatherDirt, outDirt, angle, elevation, ooDepth; - vec3_t normal, worldUp, myUp, myRt, temp, direction, displacement; - - - /* dummy check */ - if( !dirty ) - return 1.0f; - if( trace == NULL || trace->cluster < 0 ) - return 0.0f; - - /* setup */ - gatherDirt = 0.0f; - ooDepth = 1.0f / dirtDepth; - VectorCopy( trace->normal, normal ); - - /* check if the normal is aligned to the world-up */ - if( normal[ 0 ] == 0.0f && normal[ 1 ] == 0.0f ) - { - if( normal[ 2 ] == 1.0f ) - { - VectorSet( myRt, 1.0f, 0.0f, 0.0f ); - VectorSet( myUp, 0.0f, 1.0f, 0.0f ); - } - else if( normal[ 2 ] == -1.0f ) - { - VectorSet( myRt, -1.0f, 0.0f, 0.0f ); - VectorSet( myUp, 0.0f, 1.0f, 0.0f ); - } - } - else - { - VectorSet( worldUp, 0.0f, 0.0f, 1.0f ); - CrossProduct( normal, worldUp, myRt ); - VectorNormalize( myRt, myRt ); - CrossProduct( myRt, normal, myUp ); - VectorNormalize( myUp, myUp ); - } - - /* 1 = random mode, 0 (well everything else) = non-random mode */ - if( dirtMode == 1 ) - { - /* iterate */ - for( i = 0; i < numDirtVectors; i++ ) - { - /* get random vector */ - angle = Random() * DEG2RAD( 360.0f ); - elevation = Random() * DEG2RAD( DIRT_CONE_ANGLE ); - temp[ 0 ] = cos( angle ) * sin( elevation ); - temp[ 1 ] = sin( angle ) * sin( elevation ); - temp[ 2 ] = cos( elevation ); - - /* transform into tangent space */ - direction[ 0 ] = myRt[ 0 ] * temp[ 0 ] + myUp[ 0 ] * temp[ 1 ] + normal[ 0 ] * temp[ 2 ]; - direction[ 1 ] = myRt[ 1 ] * temp[ 0 ] + myUp[ 1 ] * temp[ 1 ] + normal[ 1 ] * temp[ 2 ]; - direction[ 2 ] = myRt[ 2 ] * temp[ 0 ] + myUp[ 2 ] * temp[ 1 ] + normal[ 2 ] * temp[ 2 ]; - - /* set endpoint */ - VectorMA( trace->origin, dirtDepth, direction, trace->end ); - SetupTrace( trace ); - - /* trace */ - TraceLine( trace ); - if( trace->opaque ) - { - VectorSubtract( trace->hit, trace->origin, displacement ); - gatherDirt += 1.0f - ooDepth * VectorLength( displacement ); - } - } - } - else - { - /* iterate through ordered vectors */ - for( i = 0; i < numDirtVectors; i++ ) - { - /* transform vector into tangent space */ - direction[ 0 ] = myRt[ 0 ] * dirtVectors[ i ][ 0 ] + myUp[ 0 ] * dirtVectors[ i ][ 1 ] + normal[ 0 ] * dirtVectors[ i ][ 2 ]; - direction[ 1 ] = myRt[ 1 ] * dirtVectors[ i ][ 0 ] + myUp[ 1 ] * dirtVectors[ i ][ 1 ] + normal[ 1 ] * dirtVectors[ i ][ 2 ]; - direction[ 2 ] = myRt[ 2 ] * dirtVectors[ i ][ 0 ] + myUp[ 2 ] * dirtVectors[ i ][ 1 ] + normal[ 2 ] * dirtVectors[ i ][ 2 ]; - - /* set endpoint */ - VectorMA( trace->origin, dirtDepth, direction, trace->end ); - SetupTrace( trace ); - - /* trace */ - TraceLine( trace ); - if( trace->opaque ) - { - VectorSubtract( trace->hit, trace->origin, displacement ); - gatherDirt += 1.0f - ooDepth * VectorLength( displacement ); - } - } - } - - /* direct ray */ - VectorMA( trace->origin, dirtDepth, normal, trace->end ); - SetupTrace( trace ); - - /* trace */ - TraceLine( trace ); - if( trace->opaque ) - { - VectorSubtract( trace->hit, trace->origin, displacement ); - gatherDirt += 1.0f - ooDepth * VectorLength( displacement ); - } - - /* early out */ - if( gatherDirt <= 0.0f ) - return 1.0f; - - /* apply gain (does this even do much? heh) */ - outDirt = pow( gatherDirt / (numDirtVectors + 1), dirtGain ); - if( outDirt > 1.0f ) - outDirt = 1.0f; - - /* apply scale */ - outDirt *= dirtScale; - if( outDirt > 1.0f ) - outDirt = 1.0f; - - /* return to sender */ - return 1.0f - outDirt; -} - - - -/* -DirtyRawLightmap() -calculates dirty fraction for each luxel -*/ - -void DirtyRawLightmap( int rawLightmapNum ) -{ - int i, x, y, sx, sy, *cluster; - float *origin, *normal, *dirt, *dirt2, average, samples; - rawLightmap_t *lm; - surfaceInfo_t *info; - trace_t trace; - - - /* bail if this number exceeds the number of raw lightmaps */ - if( rawLightmapNum >= numRawLightmaps ) - return; - - /* get lightmap */ - lm = &rawLightmaps[ rawLightmapNum ]; - - /* setup trace */ - trace.testOcclusion = qtrue; - trace.forceSunlight = qfalse; - trace.recvShadows = lm->recvShadows; - trace.numSurfaces = lm->numLightSurfaces; - trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; - trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; - trace.testAll = qfalse; - - /* twosided lighting (may or may not be a good idea for lightmapped stuff) */ - trace.twoSided = qfalse; - for( i = 0; i < trace.numSurfaces; i++ ) - { - /* get surface */ - info = &surfaceInfos[ trace.surfaces[ i ] ]; - - /* check twosidedness */ - if( info->si->twoSided ) - { - trace.twoSided = qtrue; - break; - } - } - - /* gather dirt */ - for( y = 0; y < lm->sh; y++ ) - { - for( x = 0; x < lm->sw; x++ ) - { - /* get luxel */ - cluster = SUPER_CLUSTER( x, y ); - origin = SUPER_ORIGIN( x, y ); - normal = SUPER_NORMAL( x, y ); - dirt = SUPER_DIRT( x, y ); - - /* set default dirt */ - *dirt = 0.0f; - - /* only look at mapped luxels */ - if( *cluster < 0 ) - continue; - - /* copy to trace */ - trace.cluster = *cluster; - VectorCopy( origin, trace.origin ); - VectorCopy( normal, trace.normal ); - - /* get dirt */ - *dirt = DirtForSample( &trace ); - } - } - - /* testing no filtering */ - //% return; - - /* filter dirt */ - for( y = 0; y < lm->sh; y++ ) - { - for( x = 0; x < lm->sw; x++ ) - { - /* get luxel */ - cluster = SUPER_CLUSTER( x, y ); - dirt = SUPER_DIRT( x, y ); - - /* filter dirt by adjacency to unmapped luxels */ - average = *dirt; - samples = 1.0f; - for( sy = (y - 1); sy <= (y + 1); sy++ ) - { - if( sy < 0 || sy >= lm->sh ) - continue; - - for( sx = (x - 1); sx <= (x + 1); sx++ ) - { - if( sx < 0 || sx >= lm->sw || (sx == x && sy == y) ) - continue; - - /* get neighboring luxel */ - cluster = SUPER_CLUSTER( sx, sy ); - dirt2 = SUPER_DIRT( sx, sy ); - if( *cluster < 0 || *dirt2 <= 0.0f ) - continue; - - /* add it */ - average += *dirt2; - samples += 1.0f; - } - - /* bail */ - if( samples <= 0.0f ) - break; - } - - /* bail */ - if( samples <= 0.0f ) - continue; - - /* scale dirt */ - *dirt = average / samples; - } - } -} - - - /* SubmapRawLuxel() calculates the pvs cluster, origin, normal of a sub-luxel @@ -1651,7 +1335,7 @@ SubsampleRawLuxel_r() recursively subsamples a luxel until its color gradient is low enough or subsampling limit is reached */ -static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampleOrigin, int x, int y, float bias, float *lightLuxel ) +void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampleOrigin, int x, int y, float bias, float *lightLuxel ) { int b, samples, mapped, lighted; int cluster[ 4 ]; @@ -1693,7 +1377,7 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl VectorCopy( normal[ b ], trace->normal ); /* sample light */ - + //% LightContributionToSample( light, cluster[ b ], origin[ b ], normal[ b ], luxel[ b ], qtrue, qfalse, lm->numLightSurfaces, &lightSurfaces[ lm->firstLightSurface ] ); LightContributionToSample( trace ); /* add to totals (fixme: make contrast function) */ @@ -1750,7 +1434,6 @@ IlluminateRawLightmap() illuminates the luxels */ -#define STACK_LL_SIZE (SUPER_LUXEL_SIZE * 64 * 64) #define LIGHT_LUXEL( x, y ) (lightLuxels + ((((y) * lm->sw) + (x)) * SUPER_LUXEL_SIZE)) void IlluminateRawLightmap( int rawLightmapNum ) @@ -1761,12 +1444,11 @@ void IlluminateRawLightmap( int rawLightmapNum ) surfaceInfo_t *info; qboolean filterColor, filterDir; float brightness; - float *origin, *normal, *dirt, *luxel, *luxel2, *deluxel, *deluxel2; + float *origin, *normal, *luxel, *luxel2, *deluxel, *deluxel2; float *lightLuxels, *lightLuxel, samples, filterRadius, weight; vec3_t color, averageColor, averageDir, total, temp, temp2; float tests[ 4 ][ 2 ] = { { 0.0f, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } }; trace_t trace; - float stackLightLuxels[ STACK_LL_SIZE ]; /* bail if this number exceeds the number of raw lightmaps */ @@ -1806,11 +1488,8 @@ void IlluminateRawLightmap( int rawLightmapNum ) fill pass ----------------------------------------------------------------- */ - /* set counts */ - numLuxelsIlluminated += (lm->sw * lm->sh); - /* test debugging state */ - if( debugSurfaces || debugAxis || debugCluster || debugOrigin || dirtDebug || normalmap ) + if( debugSurfaces || debugAxis || debugCluster || debugOrigin || normalmap ) { /* debug fill the luxels */ for( y = 0; y < lm->sh; y++ ) @@ -1864,11 +1543,8 @@ void IlluminateRawLightmap( int rawLightmapNum ) luxel[ 2 ] = (normal[ 2 ] + 1.0f) * 127.5f; } - /* otherwise clear it */ - else - VectorClear( luxel ); - /* add to counts */ + numLuxelsIlluminated++; luxel[ 3 ] = 1.0f; } } @@ -1877,10 +1553,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) { /* allocate temporary per-light luxel storage */ llSize = lm->sw * lm->sh * SUPER_LUXEL_SIZE * sizeof( float ); - if( llSize <= (STACK_LL_SIZE * sizeof( float )) ) - lightLuxels = stackLightLuxels; - else - lightLuxels = safe_malloc( llSize ); + lightLuxels = safe_malloc( llSize ); /* clear luxels */ //% memset( lm->superLuxels[ 0 ], 0, llSize ); @@ -2078,29 +1751,6 @@ void IlluminateRawLightmap( int rawLightmapNum ) } } - /* tertiary pass, apply dirt map (ambient occlusion) */ - if( 0 && dirty ) - { - /* walk luxels */ - for( y = 0; y < lm->sh; y++ ) - { - for( x = 0; x < lm->sw; x++ ) - { - /* get cluster */ - cluster = SUPER_CLUSTER( x, y ); - if( *cluster < 0 ) - continue; - - /* get particulars */ - lightLuxel = LIGHT_LUXEL( x, y ); - dirt = SUPER_DIRT( x, y ); - - /* scale light value */ - VectorScale( lightLuxel, *dirt, lightLuxel ); - } - } - } - /* allocate sampling lightmap storage */ if( lm->superLuxels[ lightmapNum ] == NULL ) { @@ -2215,51 +1865,12 @@ void IlluminateRawLightmap( int rawLightmapNum ) } /* free temporary luxels */ - if( lightLuxels != stackLightLuxels ) - free( lightLuxels ); + free( lightLuxels ); } /* free light list */ FreeTraceLights( &trace ); - /* ----------------------------------------------------------------- - dirt pass - ----------------------------------------------------------------- */ - - if( dirty ) - { - /* walk lightmaps */ - for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) - { - /* early out */ - if( lm->superLuxels[ lightmapNum ] == NULL ) - continue; - - /* apply dirt to each luxel */ - for( y = 0; y < lm->sh; y++ ) - { - for( x = 0; x < lm->sw; x++ ) - { - /* get cluster */ - cluster = SUPER_CLUSTER( x, y ); - //% if( *cluster < 0 ) - //% continue; - - /* get particulars */ - luxel = SUPER_LUXEL( lightmapNum, x, y ); - dirt = SUPER_DIRT( x, y ); - - /* apply dirt */ - VectorScale( luxel, *dirt, luxel ); - - /* debugging */ - if( dirtDebug ) - VectorSet( luxel, *dirt * 255.0f, *dirt * 255.0f, *dirt * 255.0f ); - } - } - } - } - /* ----------------------------------------------------------------- filter pass ----------------------------------------------------------------- */ @@ -2297,7 +1908,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) /* choose seed amount */ VectorClear( averageColor ); VectorClear( averageDir ); - samples = 0.0f; + samples = 0; /* walk 3x3 matrix */ for( sy = (y - 1); sy <= (y + 1); sy++ ) @@ -2329,17 +1940,9 @@ void IlluminateRawLightmap( int rawLightmapNum ) } /* fall through */ - if( samples <= 0.0f ) + if( samples == 0.0f ) continue; - /* dark lightmap seams */ - if( dark ) - { - if( lightmapNum == 0 ) - VectorMA( averageColor, 2.0f, ambientColor, averageColor ); - samples += 2.0f; - } - /* average it */ if( filterColor ) { @@ -2364,14 +1967,14 @@ IlluminateVertexes() light the surface vertexes */ -#define VERTEX_NUDGE 4.0f +#define VERTEX_NUDGE 2.0f void IlluminateVertexes( int num ) { int i, x, y, z, x1, y1, z1, sx, sy, radius, maxRadius, *cluster; - int lightmapNum, numAvg; - float samples, *vertLuxel, *radVertLuxel, *luxel, dirt; - vec3_t origin, temp, temp2, colors[ MAX_LIGHTMAPS ], avgColors[ MAX_LIGHTMAPS ]; + int lightmapNum; + float samples, *vertLuxel, *radVertLuxel, *luxel; + vec3_t origin, temp, temp2, colors[ MAX_LIGHTMAPS ]; bspDrawSurface_t *ds; surfaceInfo_t *info; rawLightmap_t *lm; @@ -2379,6 +1982,10 @@ void IlluminateVertexes( int num ) trace_t trace; + /* der... */ + if( noVertexLighting ) + return; + /* get surface, info, and raw lightmap */ ds = &bspDrawSurfaces[ num ]; info = &surfaceInfos[ num ]; @@ -2389,10 +1996,10 @@ void IlluminateVertexes( int num ) ----------------------------------------------------------------- */ /* calculate vertex lighting for surfaces without lightmaps */ - if( lm == NULL || cpmaHack ) + if( lm == NULL ) { /* setup trace */ - trace.testOcclusion = (cpmaHack && lm != NULL) ? qfalse : !noTrace; + trace.testOcclusion = !noTrace; trace.forceSunlight = info->si->forceSunlight; trace.recvShadows = info->recvShadows; trace.numSurfaces = 1; @@ -2405,12 +2012,8 @@ void IlluminateVertexes( int num ) /* make light list for this surface */ CreateTraceLightsForSurface( num, &trace ); - /* setup */ - verts = yDrawVerts + ds->firstVert; - numAvg = 0; - memset( avgColors, 0, sizeof( avgColors ) ); - /* walk the surface verts */ + verts = yDrawVerts + ds->firstVert; for( i = 0; i < ds->numVerts; i++ ) { /* get vertex luxel */ @@ -2443,7 +2046,7 @@ void IlluminateVertexes( int num ) else { /* clear vertex luxel */ - VectorSet( radVertLuxel, -1.0f, -1.0f, -1.0f ); + VectorCopy( ambientColor, radVertLuxel ); /* try at initial origin */ trace.cluster = ClusterForPointExtFilter( verts[ i ].xyz, VERTEX_EPSILON, info->numSurfaceClusters, &surfaceClusters[ info->firstSurfaceCluster ] ); @@ -2453,30 +2056,18 @@ void IlluminateVertexes( int num ) VectorCopy( verts[ i ].xyz, trace.origin ); VectorCopy( verts[ i ].normal, trace.normal ); - /* r7 dirt */ - if( dirty ) - dirt = DirtForSample( &trace ); - else - dirt = 1.0f; - /* trace */ LightingAtSample( &trace, ds->vertexStyles, colors ); /* store */ for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) { - /* r7 dirt */ - VectorScale( colors[ lightmapNum ], dirt, colors[ lightmapNum ] ); - - /* store */ radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i ); VectorCopy( colors[ lightmapNum ], radVertLuxel ); - VectorAdd( avgColors[ lightmapNum ], colors[ lightmapNum ], colors[ lightmapNum ] ); } } /* is this sample bright enough? */ - radVertLuxel = RAD_VERTEX_LUXEL( 0, ds->firstVert + i ); if( radVertLuxel[ 0 ] <= ambientColor[ 0 ] && radVertLuxel[ 1 ] <= ambientColor[ 1 ] && radVertLuxel[ 2 ] <= ambientColor[ 2 ] ) @@ -2511,10 +2102,6 @@ void IlluminateVertexes( int num ) /* store */ for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) { - /* r7 dirt */ - VectorScale( colors[ lightmapNum ], dirt, colors[ lightmapNum ] ); - - /* store */ radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i ); VectorCopy( colors[ lightmapNum ], radVertLuxel ); } @@ -2529,55 +2116,10 @@ void IlluminateVertexes( int num ) } } } - - /* add to average? */ - radVertLuxel = RAD_VERTEX_LUXEL( 0, ds->firstVert + i ); - if( radVertLuxel[ 0 ] > ambientColor[ 0 ] || - radVertLuxel[ 1 ] > ambientColor[ 1 ] || - radVertLuxel[ 2 ] > ambientColor[ 2 ] ) - { - numAvg++; - for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) - { - radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i ); - VectorAdd( avgColors[ lightmapNum ], radVertLuxel, avgColors[ lightmapNum ] ); - } - } } /* another happy customer */ numVertsIlluminated++; - } - - /* set average color */ - if( numAvg > 0 ) - { - for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) - VectorScale( avgColors[ lightmapNum ], (1.0f / numAvg), avgColors[ lightmapNum ] ); - } - else - { - VectorCopy( ambientColor, avgColors[ 0 ] ); - } - - /* clean up and store vertex color */ - for( i = 0; i < ds->numVerts; i++ ) - { - /* get vertex luxel */ - radVertLuxel = RAD_VERTEX_LUXEL( 0, ds->firstVert + i ); - - /* store average in occluded vertexes */ - if( radVertLuxel[ 0 ] < 0.0f ) - { - for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) - { - radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i ); - VectorCopy( avgColors[ lightmapNum ], radVertLuxel ); - - /* debug code */ - //% VectorSet( radVertLuxel, 255.0f, 0.0f, 0.0f ); - } - } /* store it */ for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) @@ -2589,8 +2131,7 @@ void IlluminateVertexes( int num ) /* store */ if( bouncing || bounce == 0 || !bounceOnly ) VectorAdd( vertLuxel, radVertLuxel, vertLuxel ); - if( !info->si->noVertexLight ) - ColorToBytes( vertLuxel, verts[ i ].color[ lightmapNum ], info->si->vertexScale ); + ColorToBytes( vertLuxel, verts[ i ].color[ lightmapNum ], info->si->vertexScale ); } } @@ -2700,8 +2241,7 @@ void IlluminateVertexes( int num ) numVertsIlluminated++; /* store into bytes (for vertex approximation) */ - if( !info->si->noVertexLight ) - ColorToBytes( vertLuxel, verts[ i ].color[ lightmapNum ], 1.0f ); + ColorToBytes( vertLuxel, verts[ i ].color[ lightmapNum ], 1.0f ); } } } @@ -3383,10 +2923,6 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ) /* filter into correct bucket */ light->next = buckets[ light->style ]; buckets[ light->style ] = light; - - /* if any styled light is present, automatically set nocollapse */ - if( light->style != LS_NORMAL ) - noCollapse = qtrue; } /* filter back into light list */ diff --git a/tools/quake3/q3map2/lightmaps.c b/tools/quake3/q3map2/lightmaps.c index 13dc1a6d..62977ddf 100644 --- a/tools/quake3/q3map2/lightmaps.c +++ b/tools/quake3/q3map2/lightmaps.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index d64357ff..df169351 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -137,12 +136,12 @@ void ExportLightmaps( void ) Q_mkdir( dirname ); /* iterate through the lightmaps */ - for( i = 0, lightmap = bspLightBytes; lightmap < (bspLightBytes + numBSPLightBytes); i++, lightmap += (game->lightmapSize * game->lightmapSize * 3) ) + for( i = 0, lightmap = bspLightBytes; lightmap < (bspLightBytes + numBSPLightBytes); i++, lightmap += (LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3) ) { /* write a tga image out */ sprintf( filename, "%s/lightmap_%04d.tga", dirname, i ); Sys_Printf( "Writing %s\n", filename ); - WriteTGA24( filename, lightmap, game->lightmapSize, game->lightmapSize, qfalse ); + WriteTGA24( filename, lightmap, LIGHTMAP_WIDTH, LIGHTMAP_HEIGHT, qfalse ); } } @@ -223,7 +222,7 @@ int ImportLightmapsMain( int argc, char **argv ) Q_mkdir( dirname ); /* iterate through the lightmaps */ - for( i = 0, lightmap = bspLightBytes; lightmap < (bspLightBytes + numBSPLightBytes); i++, lightmap += (game->lightmapSize * game->lightmapSize * 3) ) + for( i = 0, lightmap = bspLightBytes; lightmap < (bspLightBytes + numBSPLightBytes); i++, lightmap += (LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3) ) { /* read a tga image */ sprintf( filename, "%s/lightmap_%04d.tga", dirname, i ); @@ -238,7 +237,7 @@ int ImportLightmapsMain( int argc, char **argv ) /* parse file into an image */ pixels = NULL; - LoadTGABuffer( buffer, buffer + len, &pixels, &width, &height ); + LoadTGABuffer( buffer, &pixels, &width, &height ); free( buffer ); /* sanity check it */ @@ -247,16 +246,16 @@ int ImportLightmapsMain( int argc, char **argv ) Sys_Printf( "WARNING: Unable to load image %s\n", filename ); continue; } - if( width != game->lightmapSize || height != game->lightmapSize ) + if( width != LIGHTMAP_WIDTH || height != LIGHTMAP_HEIGHT ) Sys_Printf( "WARNING: Image %s is not the right size (%d, %d) != (%d, %d)\n", - filename, width, height, game->lightmapSize, game->lightmapSize ); + filename, width, height, LIGHTMAP_WIDTH, LIGHTMAP_HEIGHT ); /* copy the pixels */ in = pixels; - for( y = 1; y <= game->lightmapSize; y++ ) + for( y = 1; y <= LIGHTMAP_HEIGHT; y++ ) { - out = lightmap + ((game->lightmapSize - y) * game->lightmapSize * 3); - for( x = 0; x < game->lightmapSize; x++, in += 4, out += 3 ) + out = lightmap + ((LIGHTMAP_HEIGHT - y) * LIGHTMAP_WIDTH * 3); + for( x = 0; x < LIGHTMAP_WIDTH; x++, in += 4, out += 3 ) VectorCopy( in, out ); } @@ -616,7 +615,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ) info->recvShadows != lm->recvShadows || info->si->lmCustomWidth != lm->customWidth || info->si->lmCustomHeight != lm->customHeight || - info->si->lmBrightness != lm->brightness || + info->si->lmGamma != lm->gamma || info->si->lmFilterRadius != lm->filterRadius || info->si->splotchFix != lm->splotchFix ) return qfalse; @@ -1096,7 +1095,7 @@ void SetupSurfaceLightmaps( void ) lm->actualSampleSize = info->sampleSize; lm->entityNum = info->entityNum; lm->recvShadows = info->recvShadows; - lm->brightness = info->si->lmBrightness; + lm->gamma = info->si->lmGamma; lm->filterRadius = info->si->lmFilterRadius; VectorCopy( info->axis, lm->axis ); lm->plane = info->plane; @@ -1328,7 +1327,6 @@ CompareBSPLuxels() compares two surface lightmaps' bsp luxels, ignoring occluded luxels */ -#define SOLID_EPSILON 0.0625 #define LUXEL_TOLERANCE 0.0025 #define LUXEL_COLOR_FRAC 0.001302083 /* 1 / 3 / 256 */ @@ -1345,33 +1343,13 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, ((aNum == 0 && bNum != 0) || (aNum != 0 && bNum == 0)) ) return qfalse; - /* basic tests */ - if( a->customWidth != b->customWidth || a->customHeight != b->customHeight || - a->brightness != b->brightness || - a->solid[ aNum ] != b->solid[ bNum ] || + /* compare */ + if( a->w != b->w || a->h != b->h || + a->customWidth != b->customWidth || a->customHeight != b->customHeight || + a->gamma != b->gamma || a->bspLuxels[ aNum ] == NULL || b->bspLuxels[ bNum ] == NULL ) return qfalse; - /* compare solid color lightmaps */ - if( a->solid[ aNum ] && b->solid[ bNum ] ) - { - /* get deltas */ - rd = fabs( a->solidColor[ aNum ][ 0 ] - b->solidColor[ bNum ][ 0 ] ); - gd = fabs( a->solidColor[ aNum ][ 1 ] - b->solidColor[ bNum ][ 1 ] ); - bd = fabs( a->solidColor[ aNum ][ 2 ] - b->solidColor[ bNum ][ 2 ] ); - - /* compare color */ - if( rd > SOLID_EPSILON || gd > SOLID_EPSILON|| bd > SOLID_EPSILON ) - return qfalse; - - /* okay */ - return qtrue; - } - - /* compare nonsolid lightmaps */ - if( a->w != b->w || a->h != b->h ) - return qfalse; - /* compare luxels */ delta = 0.0; total = 0.0; @@ -1421,38 +1399,19 @@ MergeBSPLuxels() merges two surface lightmaps' bsp luxels, overwriting occluded luxels */ -static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ) +static void MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ) { rawLightmap_t *lm; int x, y; float luxel[ 3 ], *aLuxel, *bLuxel; - /* basic tests */ - if( a->customWidth != b->customWidth || a->customHeight != b->customHeight || - a->brightness != b->brightness || - a->solid[ aNum ] != b->solid[ bNum ] || + /* compare */ + if( a->w != b->w || a->h != b->h || + a->customWidth != b->customWidth || a->customHeight != b->customHeight || + a->gamma != b->gamma || a->bspLuxels[ aNum ] == NULL || b->bspLuxels[ bNum ] == NULL ) - return qfalse; - - /* compare solid lightmaps */ - if( a->solid[ aNum ] && b->solid[ bNum ] ) - { - /* average */ - VectorAdd( a->solidColor[ aNum ], b->solidColor[ bNum ], luxel ); - VectorScale( luxel, 0.5f, luxel ); - - /* copy to both */ - VectorCopy( luxel, a->solidColor[ aNum ] ); - VectorCopy( luxel, b->solidColor[ bNum ] ); - - /* return to sender */ - return qtrue; - } - - /* compare nonsolid lightmaps */ - if( a->w != b->w || a->h != b->h ) - return qfalse; + return; /* merge luxels */ for( y = 0; y < a->h; y++ ) @@ -1483,9 +1442,6 @@ static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, in } } } - - /* done */ - return qtrue; } @@ -1675,23 +1631,18 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ) ds = &bspDrawSurfaces[ num ]; info = &surfaceInfos[ num ]; - /* assume not-reduced initially */ - info->approximated = qfalse; - /* bail if lightmap doesn't match up */ if( info->lm != lm ) continue; - /* bail if not vertex lit */ - if( info->si->noVertexLight ) - continue; + /* assume reduced initially */ + info->approximated = qtrue; /* assume that surfaces whose bounding boxes is smaller than 2x samplesize will be forced to vertex */ if( (info->maxs[ 0 ] - info->mins[ 0 ]) <= (2.0f * info->sampleSize) && (info->maxs[ 1 ] - info->mins[ 1 ]) <= (2.0f * info->sampleSize) && (info->maxs[ 2 ] - info->mins[ 2 ]) <= (2.0f * info->sampleSize) ) { - info->approximated = qtrue; numSurfsVertexForced++; continue; } @@ -1704,7 +1655,6 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ) verts = yDrawVerts + ds->firstVert; /* map the triangles */ - info->approximated = qtrue; for( i = 0; i < ds->numIndexes && info->approximated; i += 3 ) { dv[ 0 ] = &verts[ bspDrawIndexes[ ds->firstIndex + i ] ]; @@ -1731,7 +1681,6 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ) verts = mesh->verts; /* map the mesh quads */ - info->approximated = qtrue; for( y = 0; y < (mesh->height - 1) && info->approximated; y++ ) { for( x = 0; x < (mesh->width - 1) && info->approximated; x++ ) @@ -1797,15 +1746,6 @@ static qboolean TestOutLightmapStamp( rawLightmap_t *lm, int lightmapNum, outLig if( x < 0 || y < 0 || (x + lm->w) > olm->customWidth || (y + lm->h) > olm->customHeight ) return qfalse; - /* solid lightmaps test a 1x1 stamp */ - if( lm->solid[ lightmapNum ] ) - { - offset = (y * olm->customWidth) + x; - if( olm->lightBits[ offset >> 3 ] & (1 << (offset & 7)) ) - return qfalse; - return qtrue; - } - /* test the stamp */ for( sy = 0; sy < lm->h; sy++ ) { @@ -1843,7 +1783,7 @@ static void SetupOutLightmap( rawLightmap_t *lm, outLightmap_t *olm ) return; /* is this a "normal" bsp-stored lightmap? */ - if( (lm->customWidth == game->lightmapSize && lm->customHeight == game->lightmapSize) || externalLightmaps ) + if( (lm->customWidth == LIGHTMAP_WIDTH && lm->customHeight == LIGHTMAP_HEIGHT) || externalLightmaps ) { olm->lightmapNum = numBSPLightmaps; numBSPLightmaps++; @@ -1898,7 +1838,7 @@ static void FindOutLightmaps( rawLightmap_t *lm ) /* set default lightmap number (-3 = LIGHTMAP_BY_VERTEX) */ for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) lm->outLightmapNums[ lightmapNum ] = -3; - + /* can this lightmap be approximated with vertex color? */ if( ApproximateLightmap( lm ) ) return; @@ -1996,16 +1936,8 @@ static void FindOutLightmaps( rawLightmap_t *lm ) continue; /* set maxs */ - if( lm->solid[ lightmapNum ] ) - { - xMax = olm->customWidth; - yMax = olm->customHeight; - } - else - { - xMax = (olm->customWidth - lm->w) + 1; - yMax = (olm->customHeight - lm->h) + 1; - } + xMax = (olm->customWidth - lm->w) + 1; + yMax = (olm->customHeight - lm->h) + 1; /* walk the origin around the lightmap */ for( y = 0; y < yMax; y++ ) @@ -2062,7 +1994,7 @@ static void FindOutLightmaps( rawLightmap_t *lm ) } /* if this is a style-using lightmap, it must be exported */ - if( lightmapNum > 0 && game->load != LoadRBSPFile ) + if( lightmapNum > 0 ) olm->extLightmapNum = 0; /* add the surface lightmap to the bsp lightmap */ @@ -2093,40 +2025,20 @@ static void FindOutLightmaps( rawLightmap_t *lm ) } } - /* set maxs */ - if( lm->solid[ lightmapNum ] ) - { - xMax = 1; - yMax = 1; - } - else - { - xMax = lm->w; - yMax = lm->h; - } - /* mark the bits used */ - for( y = 0; y < yMax; y++ ) + for( y = 0; y < lm->h; y++ ) { - for( x = 0; x < xMax; x++ ) + for( x = 0; x < lm->w; x++ ) { /* get luxel */ luxel = BSP_LUXEL( lightmapNum, x, y ); deluxel = BSP_DELUXEL( x, y ); - if( luxel[ 0 ] < 0.0f && !lm->solid[ lightmapNum ]) + if( luxel[ 0 ] < 0.0f ) continue; /* set minimum light */ - if( lm->solid[ lightmapNum ] ) - { - if( debug ) - VectorSet( color, 255.0f, 0.0f, 0.0f ); - else - VectorCopy( lm->solidColor[ lightmapNum ], color ); - } - else - VectorCopy( luxel, color ); - + VectorCopy( luxel, color ); + /* styles are not affected by minlight */ if( lightmapNum == 0 ) { @@ -2148,7 +2060,7 @@ static void FindOutLightmaps( rawLightmap_t *lm ) /* store color */ pixel = olm->bspLightBytes + (((oy * olm->customWidth) + ox) * 3); - ColorToBytes( color, pixel, lm->brightness ); + ColorToBytes( color, pixel, lm->gamma ); /* store direction */ if( deluxemap ) @@ -2237,7 +2149,7 @@ void StoreSurfaceLightmaps( void ) int i, j, k, x, y, lx, ly, sx, sy, *cluster, mappedSamples; int style, size, lightmapNum, lightmapNum2; float *normal, *luxel, *bspLuxel, *bspLuxel2, *radLuxel, samples, occludedSamples; - vec3_t sample, occludedSample, dirSample, colorMins, colorMaxs; + vec3_t sample, occludedSample, dirSample; float *deluxel, *bspDeluxel, *bspDeluxel2; byte *lb; int numUsed, numTwins, numTwinLuxels, numStored; @@ -2275,7 +2187,6 @@ void StoreSurfaceLightmaps( void ) numUsed = 0; numTwins = 0; numTwinLuxels = 0; - numSolidLightmaps = 0; for( i = 0; i < numRawLightmaps; i++ ) { /* get lightmap */ @@ -2425,11 +2336,8 @@ void StoreSurfaceLightmaps( void ) } } - /* setup */ - lm->used = 0; - ClearBounds( colorMins, colorMaxs ); - /* clean up and store into bsp luxels */ + lm->used = 0; for( y = 0; y < lm->h; y++ ) { for( x = 0; x < lm->w; x++ ) @@ -2525,41 +2433,6 @@ void StoreSurfaceLightmaps( void ) VectorAdd( bspLuxel, sample, bspLuxel ); if( deluxemap && lightmapNum == 0 ) VectorAdd( bspDeluxel, dirSample, bspDeluxel ); - - /* add color to bounds for solid checking */ - if( samples > 0.0f ) - AddPointToBounds( bspLuxel, colorMins, colorMaxs ); - } - } - - /* set solid color */ - lm->solid[ lightmapNum ] = qfalse; - VectorAdd( colorMins, colorMaxs, lm->solidColor[ lightmapNum ] ); - VectorScale( lm->solidColor[ lightmapNum ], 0.5f, lm->solidColor[ lightmapNum ] ); - - /* nocollapse prevents solid lightmaps */ - if( noCollapse == qfalse ) - { - /* check solid color */ - VectorSubtract( colorMaxs, colorMins, sample ); - if( (sample[ 0 ] <= SOLID_EPSILON && sample[ 1 ] <= SOLID_EPSILON && sample[ 2 ] <= SOLID_EPSILON) || - (lm->w <= 2 && lm->h <= 2) ) /* small lightmaps get forced to solid color */ - { - /* set to solid */ - VectorCopy( colorMins, lm->solidColor[ lightmapNum ] ); - lm->solid[ lightmapNum ] = qtrue; - numSolidLightmaps++; - } - - /* if all lightmaps aren't solid, then none of them are solid */ - if( lm->solid[ lightmapNum ] != lm->solid[ 0 ] ) - { - for( y = 0; y < MAX_LIGHTMAPS; y++ ) - { - if( lm->solid[ y ] ) - numSolidLightmaps--; - lm->solid[ y ] = qfalse; - } } } @@ -2657,17 +2530,15 @@ void StoreSurfaceLightmaps( void ) if( CompareBSPLuxels( lm, lightmapNum, lm2, lightmapNum2 ) ) { /* merge and set twin */ - if( MergeBSPLuxels( lm, lightmapNum, lm2, lightmapNum2 ) ) - { - lm2->twins[ lightmapNum2 ] = lm; - lm2->twinNums[ lightmapNum2 ] = lightmapNum; - numTwins++; - numTwinLuxels += (lm->w * lm->h); - - /* count styled twins */ - if( lightmapNum > 0 ) - lm->numStyledTwins++; - } + MergeBSPLuxels( lm, lightmapNum, lm2, lightmapNum2 ); + lm2->twins[ lightmapNum2 ] = lm; + lm2->twinNums[ lightmapNum2 ] = lightmapNum; + numTwins++; + numTwinLuxels += (lm->w * lm->h); + + /* count styled twins */ + if( lightmapNum > 0 ) + lm->numStyledTwins++; } } } @@ -2761,7 +2632,7 @@ void StoreSurfaceLightmaps( void ) } else { - numBSPLightBytes = (numBSPLightmaps * game->lightmapSize * game->lightmapSize * 3); + numBSPLightBytes = (numBSPLightmaps * LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3); bspLightBytes = safe_malloc( numBSPLightBytes ); memset( bspLightBytes, 0, numBSPLightBytes ); } @@ -2776,14 +2647,14 @@ void StoreSurfaceLightmaps( void ) if( olm->lightmapNum >= 0 && !externalLightmaps ) { /* copy lighting data */ - lb = bspLightBytes + (olm->lightmapNum * game->lightmapSize * game->lightmapSize * 3); - memcpy( lb, olm->bspLightBytes, game->lightmapSize * game->lightmapSize * 3 ); + lb = bspLightBytes + (olm->lightmapNum * LIGHTMAP_HEIGHT * LIGHTMAP_WIDTH * 3); + memcpy( lb, olm->bspLightBytes, LIGHTMAP_HEIGHT * LIGHTMAP_WIDTH * 3 ); /* copy direction data */ if( deluxemap ) { - lb = bspLightBytes + ((olm->lightmapNum + 1) * game->lightmapSize * game->lightmapSize * 3); - memcpy( lb, olm->bspDirBytes, game->lightmapSize * game->lightmapSize * 3 ); + lb = bspLightBytes + ((olm->lightmapNum + 1) * LIGHTMAP_HEIGHT * LIGHTMAP_WIDTH * 3); + memcpy( lb, olm->bspDirBytes, LIGHTMAP_HEIGHT * LIGHTMAP_WIDTH * 3 ); } } @@ -2916,21 +2787,13 @@ void StoreSurfaceLightmaps( void ) lmx = (float) lm->lightmapX[ lightmapNum ] / (float) olm->customWidth; lmy = (float) lm->lightmapY[ lightmapNum ] / (float) olm->customHeight; - /* calc lightmap st coords */ + /* calc lightmap st coords and store lighting values */ dv = &bspDrawVerts[ ds->firstVert ]; ydv = &yDrawVerts[ ds->firstVert ]; for( j = 0; j < ds->numVerts; j++ ) { - if( lm->solid[ lightmapNum ] ) - { - dv[ j ].lightmap[ lightmapNum ][ 0 ] = lmx + (0.5f / (float) olm->customWidth); - dv[ j ].lightmap[ lightmapNum ][ 1 ] = lmy + (0.5f / (float) olm->customWidth); - } - else - { - dv[ j ].lightmap[ lightmapNum ][ 0 ] = lmx + (ydv[ j ].lightmap[ 0 ][ 0 ] / (superSample * olm->customWidth)); - dv[ j ].lightmap[ lightmapNum ][ 1 ] = lmy + (ydv[ j ].lightmap[ 0 ][ 1 ] / (superSample * olm->customHeight)); - } + dv[ j ].lightmap[ lightmapNum ][ 0 ] = lmx + (ydv[ j ].lightmap[ 0 ][ 0 ] / (superSample * olm->customWidth)); + dv[ j ].lightmap[ lightmapNum ][ 1 ] = lmy + (ydv[ j ].lightmap[ 0 ][ 1 ] / (superSample * olm->customHeight)); } } } @@ -2961,8 +2824,7 @@ void StoreSurfaceLightmaps( void ) } /* store to bytes */ - if( !info->si->noVertexLight ) - ColorToBytes( color, dv[ j ].color[ lightmapNum ], info->si->vertexScale ); + ColorToBytes( color, dv[ j ].color[ lightmapNum ], info->si->vertexScale ); } } @@ -3085,7 +2947,7 @@ void StoreSurfaceLightmaps( void ) /* devise a custom shader for this surface (fixme: make this work with light styles) */ else if( olm != NULL && lm != NULL && !externalLightmaps && - (olm->customWidth != game->lightmapSize || olm->customHeight != game->lightmapSize) ) + (olm->customWidth != LIGHTMAP_WIDTH || olm->customHeight != LIGHTMAP_HEIGHT) ) { /* get output lightmap */ olm = &outLightmaps[ lm->outLightmapNums[ 0 ] ]; @@ -3119,7 +2981,6 @@ void StoreSurfaceLightmaps( void ) /* print stats */ Sys_Printf( "%9d luxels used\n", numUsed ); Sys_Printf( "%9d luxels stored (%3.2f percent efficiency)\n", numStored, efficiency * 100.0f ); - Sys_Printf( "%9d solid surface lightmaps\n", numSolidLightmaps ); Sys_Printf( "%9d identical surface lightmaps, using %d luxels\n", numTwins, numTwinLuxels ); Sys_Printf( "%9d vertex forced surfaces\n", numSurfsVertexForced ); Sys_Printf( "%9d vertex approximated surfaces\n", numSurfsVertexApproximated ); diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index 39a1b1fb..4da3bcf8 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -64,264 +63,6 @@ static void ExitQ3Map( void ) -/* -MD4BlockChecksum() -calculates an md4 checksum for a block of data -*/ - -static int MD4BlockChecksum( void *buffer, int length ) -{ - MHASH mh; - int digest[ 4 ], checksum; - - - /* make md4 hash */ - mh = mhash_init( MHASH_MD4 ); - if( !mh ) - Error( "Unable to initialize MD4 hash context" ); - mhash( mh, buffer, length ); - mhash_deinit( mh, digest ); - - /* xor the bits and return */ - checksum = digest[ 0 ] ^ digest[ 1 ] ^ digest[ 2 ] ^ digest[ 3 ]; - return checksum; -} - - - -/* -FixAAS() -resets an aas checksum to match the given BSP -*/ - -int FixAAS( int argc, char **argv ) -{ - int length, checksum; - void *buffer; - FILE *file; - char aas[ 1024 ], **ext; - char *exts[] = - { - ".aas", - "_b0.aas", - "_b1.aas", - NULL - }; - - - /* arg checking */ - if( argc < 2 ) - { - Sys_Printf( "Usage: q3map -fixaas [-v] \n" ); - return 0; - } - - /* do some path mangling */ - strcpy( source, ExpandArg( argv[ argc - 1 ] ) ); - StripExtension( source ); - DefaultExtension( source, ".bsp" ); - - /* note it */ - Sys_Printf( "--- FixAAS ---\n" ); - - /* load the bsp */ - Sys_Printf( "Loading %s\n", source ); - length = LoadFile( source, &buffer ); - - /* create bsp checksum */ - Sys_Printf( "Creating checksum...\n" ); - checksum = LittleLong( MD4BlockChecksum( buffer, length ) ); - - /* write checksum to aas */ - ext = exts; - while( *ext ) - { - /* mangle name */ - strcpy( aas, source ); - StripExtension( aas ); - strcat( aas, *ext ); - Sys_Printf( "Trying %s\n", aas ); - ext++; - - /* fix it */ - file = fopen( aas, "r+b" ); - if( !file ) - continue; - if( fwrite( &checksum, 4, 1, file ) != 1 ) - Error( "Error writing checksum to %s", aas ); - fclose( file ); - } - - /* return to sender */ - return 0; -} - - - -/* -AnalyzeBSP() - ydnar -analyzes a Quake engine BSP file -*/ - -typedef struct abspHeader_s -{ - char ident[ 4 ]; - int version; - - bspLump_t lumps[ 1 ]; /* unknown size */ -} -abspHeader_t; - -typedef struct abspLumpTest_s -{ - int radix, minCount; - char *name; -} -abspLumpTest_t; - -int AnalyzeBSP( int argc, char **argv ) -{ - abspHeader_t *header; - int size, i, version, offset, length, lumpInt, count; - char ident[ 5 ]; - void *lump; - float lumpFloat; - char lumpString[ 1024 ], source[ 1024 ]; - qboolean lumpSwap = qfalse; - abspLumpTest_t *lumpTest; - static abspLumpTest_t lumpTests[] = - { - { sizeof( bspPlane_t ), 6, "IBSP LUMP_PLANES" }, - { sizeof( bspBrush_t ), 1, "IBSP LUMP_BRUSHES" }, - { 8, 6, "IBSP LUMP_BRUSHSIDES" }, - { sizeof( bspBrushSide_t ), 6, "RBSP LUMP_BRUSHSIDES" }, - { sizeof( bspModel_t ), 1, "IBSP LUMP_MODELS" }, - { sizeof( bspNode_t ), 2, "IBSP LUMP_NODES" }, - { sizeof( bspLeaf_t ), 1, "IBSP LUMP_LEAFS" }, - { 104, 3, "IBSP LUMP_DRAWSURFS" }, - { 44, 3, "IBSP LUMP_DRAWVERTS" }, - { 4, 6, "IBSP LUMP_DRAWINDEXES" }, - { 128 * 128 * 3, 1, "IBSP LUMP_LIGHTMAPS" }, - { 256 * 256 * 3, 1, "IBSP LUMP_LIGHTMAPS (256 x 256)" }, - { 512 * 512 * 3, 1, "IBSP LUMP_LIGHTMAPS (512 x 512)" }, - { 0, 0, NULL } - }; - - - /* arg checking */ - if( argc < 1 ) - { - Sys_Printf( "Usage: q3map -analyze [-lumpswap] [-v] \n" ); - return 0; - } - - /* process arguments */ - for( i = 1; i < (argc - 1); i++ ) - { - /* -format map|ase|... */ - if( !strcmp( argv[ i ], "-lumpswap" ) ) - { - Sys_Printf( "Swapped lump structs enabled\n" ); - lumpSwap = qtrue; - } - } - - /* clean up map name */ - strcpy( source, ExpandArg( argv[ i ] ) ); - Sys_Printf( "Loading %s\n", source ); - - /* load the file */ - size = LoadFile( source, (void**) &header ); - if( size == 0 || header == NULL ) - { - Sys_Printf( "Unable to load %s.\n", source ); - return -1; - } - - /* analyze ident/version */ - memcpy( ident, header->ident, 4 ); - ident[ 4 ] = '\0'; - version = LittleLong( header->version ); - - Sys_Printf( "Identity: %s\n", ident ); - Sys_Printf( "Version: %d\n", version ); - Sys_Printf( "---------------------------------------\n" ); - - /* analyze each lump */ - for( i = 0; i < 100; i++ ) - { - /* call of duty swapped lump pairs */ - if( lumpSwap ) - { - offset = LittleLong( header->lumps[ i ].length ); - length = LittleLong( header->lumps[ i ].offset ); - } - - /* standard lump pairs */ - else - { - offset = LittleLong( header->lumps[ i ].offset ); - length = LittleLong( header->lumps[ i ].length ); - } - - /* extract data */ - lump = (byte*) header + offset; - lumpInt = LittleLong( (int) *((int*) lump) ); - lumpFloat = LittleFloat( (float) *((float*) lump) ); - memcpy( lumpString, (char*) lump, (length < 1024 ? length : 1024) ); - lumpString[ 1024 ] = '\0'; - - /* print basic lump info */ - Sys_Printf( "Lump: %d\n", i ); - Sys_Printf( "Offset: %d bytes\n", offset ); - Sys_Printf( "Length: %d bytes\n", length ); - - /* only operate on valid lumps */ - if( length > 0 ) - { - /* print data in 4 formats */ - Sys_Printf( "As hex: %08X\n", lumpInt ); - Sys_Printf( "As int: %d\n", lumpInt ); - Sys_Printf( "As float: %f\n", lumpFloat ); - Sys_Printf( "As string: %s\n", lumpString ); - - /* guess lump type */ - if( lumpString[ 0 ] == '{' && lumpString[ 2 ] == '"' ) - Sys_Printf( "Type guess: IBSP LUMP_ENTITIES\n" ); - else if( strstr( lumpString, "textures/" ) ) - Sys_Printf( "Type guess: IBSP LUMP_SHADERS\n" ); - else - { - /* guess based on size/count */ - for( lumpTest = lumpTests; lumpTest->radix > 0; lumpTest++ ) - { - if( (length % lumpTest->radix) != 0 ) - continue; - count = length / lumpTest->radix; - if( count < lumpTest->minCount ) - continue; - Sys_Printf( "Type guess: %s (%d x %d)\n", lumpTest->name, count, lumpTest->radix ); - } - } - } - - Sys_Printf( "---------------------------------------\n" ); - - /* end of file */ - if( offset + length >= size ) - break; - } - - /* last stats */ - Sys_Printf( "Lump count: %d\n", i + 1 ); - Sys_Printf( "File size: %d bytes\n", size ); - - /* return to caller */ - return 0; -} - - - /* BSPInfo() emits statistics about the bsp file @@ -509,12 +250,10 @@ int ConvertBSPMain( int argc, char **argv ) { int i; int (*convertFunc)( char * ); - game_t *convertGame; /* set default */ convertFunc = ConvertBSPToASE; - convertGame = NULL; /* arg checking */ if( argc < 1 ) @@ -535,11 +274,7 @@ int ConvertBSPMain( int argc, char **argv ) else if( !Q_stricmp( argv[ i ], "map" ) ) convertFunc = ConvertBSPToMap; else - { - convertGame = GetGame( argv[ i ] ); - if( convertGame == NULL ) - Sys_Printf( "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] ); - } + Sys_Printf( "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] ); } } @@ -560,23 +295,7 @@ int ConvertBSPMain( int argc, char **argv ) /* parse bsp entities */ ParseEntities(); - /* bsp format convert? */ - if( convertGame != NULL ) - { - /* set global game */ - game = convertGame; - - /* write bsp */ - StripExtension( source ); - DefaultExtension( source, "_c.bsp" ); - Sys_Printf( "Writing %s\n", source ); - WriteBSPFile( source ); - - /* return to sender */ - return 0; - } - - /* normal convert */ + /* convert */ return convertFunc( source ); } @@ -685,16 +404,8 @@ int main( int argc, char **argv ) if( argc < 2 ) Error( "Usage: %s [general options] [options] mapfile", argv[ 0 ] ); - /* fixaas */ - if( !strcmp( argv[ 1 ], "-fixaas" ) ) - r = FixAAS( argc - 1, argv + 1 ); - - /* analyze */ - else if( !strcmp( argv[ 1 ], "-analyze" ) ) - r = AnalyzeBSP( argc - 1, argv + 1 ); - /* info */ - else if( !strcmp( argv[ 1 ], "-info" ) ) + if( !strcmp( argv[ 1 ], "-info" ) ) r = BSPInfo( argc - 2, argv + 2 ); /* vis */ diff --git a/tools/quake3/q3map2/map.c b/tools/quake3/q3map2/map.c index 9ed0abde..633d327a 100644 --- a/tools/quake3/q3map2/map.c +++ b/tools/quake3/q3map2/map.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -186,13 +185,6 @@ snaps a plane to normal/distance epsilons void SnapPlane( vec3_t normal, vec_t *dist ) { -// SnapPlane disabled by LordHavoc because it often messes up collision -// brushes made from triangles of embedded models, and it has little effect -// on anything else (axial planes are usually derived from snapped points) -/* - SnapPlane reenabled by namespace because of multiple reports of - q3map2-crashes which were triggered by this patch. -*/ SnapNormal( normal ); if( fabs( *dist - Q_rint( *dist ) ) < distanceEpsilon ) @@ -581,7 +573,7 @@ and links it to the current entity brush_t *FinishBrush( void ) { - brush_t *b; + brush_t *b; /* create windings for sides and bounds for brush */ @@ -652,15 +644,6 @@ brush_t *FinishBrush( void ) mapEnt->lastBrush = b; } - /* link colorMod volume brushes to the entity directly */ - if( b->contentShader != NULL && - b->contentShader->colorMod != NULL && - b->contentShader->colorMod->type == CM_VOLUME ) - { - b->nextColorModBrush = mapEnt->colorModBrushes; - mapEnt->colorModBrushes = b; - } - /* return to sender */ return b; } @@ -1079,24 +1062,16 @@ void MoveBrushesToWorld( entity_t *ent ) entities[ 0 ].lastBrush->next = b; entities[ 0 ].lastBrush = b; } + + //% b->next = entities[ 0 ].brushes; + //% entities[ 0 ].brushes = b; } ent->brushes = NULL; - /* ydnar: move colormod brushes */ - if( ent->colorModBrushes != NULL ) - { - for( b = ent->colorModBrushes; b->nextColorModBrush != NULL; b = b->nextColorModBrush ); - - b->nextColorModBrush = entities[ 0 ].colorModBrushes; - entities[ 0 ].colorModBrushes = ent->colorModBrushes; - - ent->colorModBrushes = NULL; - } - /* move patches */ if( ent->patches != NULL ) { - for( pm = ent->patches; pm->next != NULL; pm = pm->next ); + for( pm = ent->patches; pm->next; pm = pm->next ); pm->next = entities[ 0 ].patches; entities[ 0 ].patches = ent->patches; diff --git a/tools/quake3/q3map2/mesh.c b/tools/quake3/q3map2/mesh.c index c7a8488b..9e205da7 100644 --- a/tools/quake3/q3map2/mesh.c +++ b/tools/quake3/q3map2/mesh.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -382,8 +381,7 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ) float len; mesh_t out; - /* ydnar: static for os x */ - MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; + static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; out.width = in.width; @@ -549,8 +547,7 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations ) bspDrawVert_t prev, next, mid; mesh_t out; - /* ydnar: static for os x */ - MAC_STATIC bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; + static bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; /* initial setup */ @@ -563,7 +560,7 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations ) } /* keep chopping */ - for( ; iterations > 0; iterations-- ) + for( iterations; iterations > 0; iterations-- ) { /* horizontal subdivisions */ for( j = 0; j + 2 < out.width; j += 4 ) @@ -655,8 +652,7 @@ mesh_t *RemoveLinearMeshColumnsRows( mesh_t *in ) { vec3_t proj, dir; mesh_t out; - /* ydnar: static for os x */ - MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; + static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; out.width = in->width; @@ -732,7 +728,8 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width vec3_t dir; float length, maxLength, amount; mesh_t out; - bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; + + static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; out.width = in->width; out.height = in->height; diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index 8dd44195..f303df75 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -323,7 +322,7 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade ds->lightmapScale = lightmapScale; /* force to meta? */ - if( (si != NULL && si->forceMeta) || (spawnFlags & 4) ) /* 3rd bit */ + if( si != NULL && si->forceMeta ) ds->type = SURFACE_FORCED_META; /* set particulars */ @@ -367,7 +366,6 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade } /* normal texture coordinates */ - else { st = PicoGetSurfaceST( surface, 0, i ); dv->st[ 0 ] = st[ 0 ]; @@ -395,6 +393,9 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade /* set cel shader */ ds->celShader = celShader; + /* finish surface */ + FinishSurface( ds ); + /* ydnar: giant hack land: generate clipping brushes for model triangles */ if( si->clipModel || (spawnFlags & 2) ) /* 2nd bit */ { @@ -404,8 +405,7 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade /* temp hack */ - if( !si->clipModel && - ((si->compileFlags & C_TRANSLUCENT) || !(si->compileFlags & C_SOLID)) ) + if( (si->compileFlags & C_TRANSLUCENT) || !(si->compileFlags & C_SOLID) ) continue; /* overflow check */ diff --git a/tools/quake3/q3map2/patch.c b/tools/quake3/q3map2/patch.c index 8a327ad6..a1134db3 100644 --- a/tools/quake3/q3map2/patch.c +++ b/tools/quake3/q3map2/patch.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/path_init.c b/tools/quake3/q3map2/path_init.c index cb1e7362..80e3c6d3 100644 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -201,19 +200,19 @@ void CleanPath( char *path ) /* -GetGame() - ydnar -gets the game_t based on a -game argument -returns NULL if no match found +SetGame() - ydnar +sets the game based on a -game argument +doesn't set it if the game doesn't match any known games */ -game_t *GetGame( char *arg ) +void SetGame( char *arg ) { int i; /* dummy check */ if( arg == NULL || arg[ 0 ] == '\0' ) - return NULL; + return; /* joke */ if( !Q_stricmp( arg, "quake1" ) || @@ -233,12 +232,9 @@ game_t *GetGame( char *arg ) while( games[ i ].arg != NULL ) { if( Q_stricmp( arg, games[ i ].arg ) == 0 ) - return &games[ i ]; + game = &games[ i ]; i++; } - - /* no matching game */ - return NULL; } @@ -353,9 +349,7 @@ void InitPaths( int *argc, char **argv ) if( ++i >= *argc ) Error( "Out of arguments: No game specified after %s", argv[ i - 1 ] ); argv[ i - 1 ] = NULL; - game = GetGame( argv[ i ] ); - if( game == NULL ) - game = &games[ 0 ]; + SetGame( argv[ i ] ); argv[ i ] = NULL; } @@ -383,7 +377,7 @@ void InitPaths( int *argc, char **argv ) /* remove processed arguments */ for( i = 0, j = 0, k = 0; i < *argc && j < *argc; i++, j++ ) { - for( ; j < *argc && argv[ j ] == NULL; j++ ); + for( j; j < *argc && argv[ j ] == NULL; j++ ); argv[ i ] = argv[ j ]; if( argv[ i ] != NULL ) k++; diff --git a/tools/quake3/q3map2/portals.c b/tools/quake3/q3map2/portals.c index 5b960892..59ed6daf 100644 --- a/tools/quake3/q3map2/portals.c +++ b/tools/quake3/q3map2/portals.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/prtfile.c b/tools/quake3/q3map2/prtfile.c index 44ef6f58..43fcbb03 100644 --- a/tools/quake3/q3map2/prtfile.c +++ b/tools/quake3/q3map2/prtfile.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 9d8dadde..a1e27a0c 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -35,8 +34,8 @@ several games based on the Quake III Arena engine, in the form of "Q3Map2." /* version */ -#define Q3MAP_VERSION "2.5.17" -#define Q3MAP_MOTD "Last one turns the lights off" +#define Q3MAP_VERSION "2.5.11" +#define Q3MAP_MOTD "A well-oiled toaster oven" @@ -57,7 +56,7 @@ dependencies #include #endif -#ifdef WIN32 +#ifdef _WIN32 #include #endif @@ -67,6 +66,7 @@ dependencies #include "cmdlib.h" #include "mathlib.h" +#include "md5lib.h" #include "ddslib.h" #include "picomodel.h" @@ -78,8 +78,6 @@ dependencies #include "inout.h" #include "vfs.h" #include "png.h" -#include "radiant_jpeglib.h" -#include "mhash.h" #include @@ -99,7 +97,7 @@ port-related hacks #endif #if 1 - #ifdef WIN32 + #ifdef _WIN32 #define Q_stricmp stricmp #define Q_strncasecmp strnicmp #else @@ -264,7 +262,7 @@ constants #define RAD_LUXEL_SIZE 3 #define SUPER_LUXEL_SIZE 4 #define SUPER_ORIGIN_SIZE 3 -#define SUPER_NORMAL_SIZE 4 +#define SUPER_NORMAL_SIZE 3 #define SUPER_DELUXEL_SIZE 3 #define BSP_DELUXEL_SIZE 3 @@ -273,12 +271,11 @@ constants #define BSP_LUXEL( s, x, y ) (lm->bspLuxels[ s ] + ((((y) * lm->w) + (x)) * BSP_LUXEL_SIZE)) #define RAD_LUXEL( s, x, y ) (lm->radLuxels[ s ] + ((((y) * lm->w) + (x)) * RAD_LUXEL_SIZE)) #define SUPER_LUXEL( s, x, y ) (lm->superLuxels[ s ] + ((((y) * lm->sw) + (x)) * SUPER_LUXEL_SIZE)) -#define SUPER_DELUXEL( x, y ) (lm->superDeluxels + ((((y) * lm->sw) + (x)) * SUPER_DELUXEL_SIZE)) -#define BSP_DELUXEL( x, y ) (lm->bspDeluxels + ((((y) * lm->w) + (x)) * BSP_DELUXEL_SIZE)) -#define SUPER_CLUSTER( x, y ) (lm->superClusters + (((y) * lm->sw) + (x))) #define SUPER_ORIGIN( x, y ) (lm->superOrigins + ((((y) * lm->sw) + (x)) * SUPER_ORIGIN_SIZE)) #define SUPER_NORMAL( x, y ) (lm->superNormals + ((((y) * lm->sw) + (x)) * SUPER_NORMAL_SIZE)) -#define SUPER_DIRT( x, y ) (lm->superNormals + ((((y) * lm->sw) + (x)) * SUPER_NORMAL_SIZE) + 3) /* stash dirtyness in normal[ 3 ] */ +#define SUPER_CLUSTER( x, y ) (lm->superClusters + (((y) * lm->sw) + (x))) +#define SUPER_DELUXEL( x, y ) (lm->superDeluxels + ((((y) * lm->sw) + (x)) * SUPER_DELUXEL_SIZE)) +#define BSP_DELUXEL( x, y ) (lm->bspDeluxels + ((((y) * lm->w) + (x)) * BSP_DELUXEL_SIZE)) @@ -304,7 +301,7 @@ abstracted bsp file #define MAX_MAP_BRUSHES 0x8000 #define MAX_MAP_ENTITIES 0x1000 //% 0x800 /* ydnar */ #define MAX_MAP_ENTSTRING 0x80000 //% 0x40000 /* ydnar */ -#define MAX_MAP_SHADERS 0x800 //% 0x400 /* ydnar */ +#define MAX_MAP_SHADERS 0x400 #define MAX_MAP_AREAS 0x100 /* MAX_MAP_AREA_BYTES in q_shared must match! */ #define MAX_MAP_FOGS 30 //& 0x100 /* RBSP (32 - world fog - goggles) */ @@ -312,7 +309,7 @@ abstracted bsp file #define MAX_MAP_NODES 0x20000 #define MAX_MAP_BRUSHSIDES 0x100000 //% 0x20000 /* ydnar */ #define MAX_MAP_LEAFS 0x20000 -#define MAX_MAP_LEAFFACES 0x100000 //% 0x20000 /* ydnar */ +#define MAX_MAP_LEAFFACES 0x20000 #define MAX_MAP_LEAFBRUSHES 0x40000 #define MAX_MAP_PORTALS 0x20000 #define MAX_MAP_LIGHTING 0x800000 @@ -345,7 +342,7 @@ typedef void (*bspFunc)( const char * ); typedef struct { - int offset, length; + int offset, length; } bspLump_t; @@ -535,18 +532,11 @@ typedef struct game_s char *homeBasePath; /* home sub-dir on unix */ char *magic; /* magic word for figuring out base path */ char *shaderPath; /* shader directory */ - int maxLMSurfaceVerts; /* default maximum meta surface verts */ - int maxSurfaceVerts; /* default maximum surface verts */ - int maxSurfaceIndexes; /* default maximum surface indexes (tris * 3) */ + qboolean wolfLight; /* when true, lights work like wolf q3map */ qboolean emitFlares; /* when true, emit flare surfaces */ char *flareShader; /* default flare shader (MUST BE SET) */ - qboolean wolfLight; /* when true, lights work like wolf q3map */ - int lightmapSize; /* bsp lightmap width/height */ - float lightmapGamma; /* default lightmap gamma */ - float lightmapCompensate; /* default lightmap compensate value */ char *bspIdent; /* 4-letter bsp file prefix */ - int bspVersion; /* bsp version to use */ - qboolean lumpSwap; /* cod-style len/ofs order */ + int bspVersion; /* BSP version to use */ bspFunc load, write; /* load/write function pointers */ surfaceParm_t surfaceParms[ 128 ]; /* surfaceparm array */ } @@ -568,7 +558,7 @@ typedef struct sun_s struct sun_s *next; vec3_t direction, color; float photons, deviance, filterRadius; - int numSamples, style; + int numSamples; } sun_t; @@ -611,32 +601,21 @@ typedef struct remap_s remap_t; -/* wingdi.h hack, it's the same: 0 */ -#undef CM_NONE - typedef enum { - CM_NONE, - CM_VOLUME, - CM_COLOR_SET, - CM_ALPHA_SET, - CM_COLOR_SCALE, - CM_ALPHA_SCALE, - CM_COLOR_DOT_PRODUCT, - CM_ALPHA_DOT_PRODUCT, - CM_COLOR_DOT_PRODUCT_2, - CM_ALPHA_DOT_PRODUCT_2 + AM_NONE, + AM_DOT_PRODUCT } -colorModType_t; +alphaModType_t; -typedef struct colorMod_s +typedef struct alphaMod_s { - struct colorMod_s *next; - colorModType_t type; + struct alphaMod_s *next; + alphaModType_t type; vec_t data[ 16 ]; } -colorMod_t; +alphaMod_t; typedef enum @@ -657,11 +636,10 @@ typedef struct shaderInfo_s int compileFlags; float value; /* light value */ - char *flareShader; /* for light flares */ - char *damageShader; /* ydnar: sof2 damage shader name */ - char *backShader; /* for surfaces that generate different front and back passes */ - char *cloneShader; /* ydnar: for cloning of a surface */ - char *remapShader; /* ydnar: remap a shader in final stage */ + char backShader[ MAX_QPATH ]; /* for surfaces that generate different front and back passes */ + char flareShader[ MAX_QPATH ]; /* for light flares */ + char cloneShader[ MAX_QPATH ]; /* ydnar: for cloning of a surface */ + char damageShader[ MAX_QPATH ]; /* ydnar: sof2 damage shader name */ surfaceModel_t *surfaceModel; /* ydnar: for distribution of models */ foliage_t *foliage; /* ydnar/splash damage: wolf et foliage */ @@ -692,7 +670,7 @@ typedef struct shaderInfo_s vec3_t vecs[ 2 ]; /* ydnar: explicit texture vectors for [0,1] texture space */ tcMod_t mod; /* ydnar: q3map_tcMod matrix for djbob :) */ vec3_t lightmapAxis; /* ydnar: explicit lightmap axis projection */ - colorMod_t *colorMod; /* ydnar: q3map_rgb/color/alpha/Set/Mod support */ + alphaMod_t *alphaMod; /* ydnar: q3map_alphaMod support */ int furNumLayers; /* ydnar: number of fur layers */ float furOffset; /* ydnar: offset of each layer */ @@ -711,8 +689,8 @@ typedef struct shaderInfo_s qb_t notjunc; /* don't use this surface for tjunction fixing */ qb_t fogParms; /* ydnar: has fogparms */ qb_t noFog; /* ydnar: supress fogging */ + qb_t clipModel; /* ydnar: solid model hack */ - qb_t noVertexLight; /* ydnar: leave vertex color alone */ byte styleMarker; /* ydnar: light styles hack */ @@ -741,7 +719,7 @@ typedef struct shaderInfo_s qb_t lmMergable; /* ydnar */ int lmCustomWidth, lmCustomHeight; /* ydnar */ - float lmBrightness; /* ydnar */ + float lmGamma; /* ydnar */ float lmFilterRadius; /* ydnar: lightmap filtering/blurring radius for this shader (default: 0) */ int shaderWidth, shaderHeight; /* ydnar */ @@ -806,6 +784,8 @@ typedef struct side_s qboolean visible; /* choose visble planes first */ qboolean bevel; /* don't ever use for bsp splitting, and don't bother making windings for it */ + qboolean backSide; /* generated side for a q3map_backShader */ + qboolean culled; /* ydnar: face culling */ } side_t; @@ -833,7 +813,6 @@ indexMap_t; typedef struct brush_s { struct brush_s *next; - struct brush_s *nextColorModBrush; /* ydnar: colorMod volume brushes go here */ struct brush_s *original; /* chopped up brushes will reference the originals */ int entityNum, brushNum;/* editor numbering */ @@ -969,11 +948,8 @@ typedef struct mapDrawSurface_s qboolean fur; /* ydnar: this is kind of a hack, but hey... */ qboolean skybox; /* ydnar: yet another fun hack */ - qboolean backSide; /* ydnar: q3map_backShader support */ struct mapDrawSurface_s *parent; /* ydnar: for cloned (skybox) surfaces to share lighting data */ - struct mapDrawSurface_s *clone; /* ydnar: for cloned surfaces */ - struct mapDrawSurface_s *cel; /* ydnar: for cloned cel surfaces */ shaderInfo_t *shaderInfo; shaderInfo_t *celShader; @@ -1056,7 +1032,7 @@ epair_t; typedef struct { vec3_t origin; - brush_t *brushes, *lastBrush, *colorModBrushes; + brush_t *brushes, *lastBrush; parseMesh_t *patches; int mapEntityNum, firstDrawSurf; int firstBrush, numBrushes; /* only valid during BSP compile */ @@ -1298,7 +1274,6 @@ typedef struct vec3_t color; /* starts out at full color, may be reduced if transparent surfaces are crossed */ /* output */ - vec3_t hit; int compileFlags; /* for determining surface compile flags traced through */ qboolean passSolid; qboolean opaque; @@ -1360,7 +1335,7 @@ typedef struct rawLightmap_s { qboolean finished, splotchFix, wrap[ 2 ]; int customWidth, customHeight; - float brightness; + float gamma; float filterRadius; int firstLightSurface, numLightSurfaces; /* index into lightSurfaces */ @@ -1373,9 +1348,6 @@ typedef struct rawLightmap_s float *plane; int w, h, sw, sh, used; - qboolean solid[ MAX_LIGHTMAPS ]; - vec3_t solidColor[ MAX_LIGHTMAPS ]; - int numStyledTwins; struct rawLightmap_s *twins[ MAX_LIGHTMAPS ]; @@ -1437,7 +1409,6 @@ int ConvertMain( int argc, char **argv ); /* path_init.c */ -game_t *GetGame( char *arg ); void InitPaths( int *argc, char **argv ); @@ -1699,11 +1670,6 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ); void SmoothNormals( void ); void MapRawLightmap( int num ); - -void SetupDirt(); -float DirtForSample( trace_t *trace ); -void DirtyRawLightmap( int num ); - void IlluminateRawLightmap( int num ); void IlluminateVertexes( int num ); @@ -1739,14 +1705,14 @@ image_t *ImageLoad( const char *filename ); /* shaders.c */ -void ColorMod( colorMod_t *am, int numVerts, bspDrawVert_t *drawVerts ); +void AlphaMod( alphaMod_t *am, int numVerts, bspDrawVert_t *drawVerts ); -void TCMod( tcMod_t mod, float st[ 2 ] ); -void TCModIdentity( tcMod_t mod ); -void TCModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ); -void TCModTranslate( tcMod_t mod, float s, float t ); -void TCModScale( tcMod_t mod, float s, float t ); -void TCModRotate( tcMod_t mod, float euler ); +void TcMod( tcMod_t mod, float st[ 2 ] ); +void TcModIdentity( tcMod_t mod ); +void TcModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ); +void TcModTranslate( tcMod_t mod, float s, float t ); +void TcModScale( tcMod_t mod, float s, float t ); +void TcModRotate( tcMod_t mod, float euler ); qboolean ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags ); @@ -1825,16 +1791,12 @@ Q_EXTERN game_t games[] { #include "game_quake3.h" , - #include "game_tremulous.h" /*LinuxManMikeC: must be after game_quake3.h, depends on #define's set in it */ - , #include "game_tenebrae.h" , #include "game_wolf.h" , #include "game_wolfet.h"/* most be after game_wolf.h as they share defines! */ , - #include "game_etut.h" - , #include "game_ef.h" , #include "game_sof2.h" @@ -1843,9 +1805,7 @@ Q_EXTERN game_t games[] , #include "game_ja.h" /* most be after game_jk2.h as they share defines! */ , - #include "game_qfusion.h" /* qfusion game */ - , - { NULL } /* null game */ + { NULL, NULL, NULL, NULL, NULL, qfalse, 0, 0, NULL } /* null game */ }; #endif Q_EXTERN game_t *game Q_ASSIGN( &games[ 0 ] ); @@ -1896,9 +1856,8 @@ Q_EXTERN qboolean skyFixHack Q_ASSIGN( qfalse ); /* ydnar */ Q_EXTERN int patchSubdivisions Q_ASSIGN( 8 ); /* ydnar: -patchmeta subdivisions */ -Q_EXTERN int maxLMSurfaceVerts Q_ASSIGN( 64 ); /* ydnar */ -Q_EXTERN int maxSurfaceVerts Q_ASSIGN( 999 ); /* ydnar */ -Q_EXTERN int maxSurfaceIndexes Q_ASSIGN( 6000 ); /* ydnar */ +Q_EXTERN int maxSurfaceVerts Q_ASSIGN( 64 ); /* ydnar */ +Q_EXTERN int maxSurfaceIndexes Q_ASSIGN( 1000 ); /* ydnar */ Q_EXTERN float npDegrees Q_ASSIGN( 0.0f ); /* ydnar: nonplanar degrees */ Q_EXTERN int bevelSnap Q_ASSIGN( 0 ); /* ydnar: bevel plane snap */ Q_EXTERN int texRange Q_ASSIGN( 0 ); @@ -2050,62 +2009,58 @@ light global variables ------------------------------------------------------------------------------- */ /* commandline arguments */ -Q_EXTERN qboolean wolfLight Q_ASSIGN( qfalse ); +Q_EXTERN qboolean noSurfaces; + +Q_EXTERN qboolean deluxemap; +Q_EXTERN qboolean debugDeluxemap; + Q_EXTERN qboolean loMem Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noStyles Q_ASSIGN( qfalse ); + +Q_EXTERN qboolean fast; +Q_EXTERN qboolean faster; +Q_EXTERN qboolean fastgrid; +Q_EXTERN qboolean fastbounce; +Q_EXTERN qboolean cheap; +Q_EXTERN qboolean cheapgrid; +Q_EXTERN qboolean smooth; +Q_EXTERN int bounce; +Q_EXTERN qboolean bounceOnly; +Q_EXTERN qboolean bouncing; +Q_EXTERN qboolean bouncegrid; +Q_EXTERN qboolean normalmap; +Q_EXTERN qboolean trisoup; +Q_EXTERN qboolean shade; +Q_EXTERN float shadeAngleDegrees Q_ASSIGN( 0.0f ); +Q_EXTERN int superSample Q_ASSIGN( 0 ); +Q_EXTERN int lightSamples Q_ASSIGN( 1 ); +Q_EXTERN qboolean filter; +Q_EXTERN qboolean sunOnly; +Q_EXTERN int approximateTolerance Q_ASSIGN( 0 ); +Q_EXTERN qboolean noCollapse; +Q_EXTERN qboolean debug; +Q_EXTERN qboolean debugSurfaces; +Q_EXTERN qboolean debugUnused; +Q_EXTERN qboolean debugAxis; +Q_EXTERN qboolean debugCluster; +Q_EXTERN qboolean debugOrigin; +Q_EXTERN qboolean exportLightmaps; +Q_EXTERN qboolean externalLightmaps; +Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH ); + +/* standard flags */ +Q_EXTERN qboolean noTrace; +Q_EXTERN qboolean patchShadows; +Q_EXTERN qboolean dump; +Q_EXTERN qboolean extra; +Q_EXTERN qboolean extraWide; +Q_EXTERN qboolean lightmapBorder; + +Q_EXTERN qboolean noSurfaces; Q_EXTERN int sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE ); Q_EXTERN qboolean noVertexLighting Q_ASSIGN( qfalse ); Q_EXTERN qboolean noGridLighting Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noTrace Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noSurfaces Q_ASSIGN( qfalse ); -Q_EXTERN qboolean patchShadows Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cpmaHack Q_ASSIGN( qfalse ); - -Q_EXTERN qboolean deluxemap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugDeluxemap Q_ASSIGN( qfalse ); - -Q_EXTERN qboolean fast Q_ASSIGN( qfalse ); -Q_EXTERN qboolean faster Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fastgrid Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fastbounce Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cheap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cheapgrid Q_ASSIGN( qfalse ); -Q_EXTERN int bounce Q_ASSIGN( 0 ); -Q_EXTERN qboolean bounceOnly Q_ASSIGN( qfalse ); -Q_EXTERN qboolean bouncing Q_ASSIGN( qfalse ); -Q_EXTERN qboolean bouncegrid Q_ASSIGN( qfalse ); -Q_EXTERN qboolean normalmap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean trisoup Q_ASSIGN( qfalse ); -Q_EXTERN qboolean shade Q_ASSIGN( qfalse ); -Q_EXTERN float shadeAngleDegrees Q_ASSIGN( 0.0f ); -Q_EXTERN int superSample Q_ASSIGN( 0 ); -Q_EXTERN int lightSamples Q_ASSIGN( 1 ); -Q_EXTERN qboolean filter Q_ASSIGN( qfalse ); -Q_EXTERN qboolean dark Q_ASSIGN( qfalse ); -Q_EXTERN qboolean sunOnly Q_ASSIGN( qfalse ); -Q_EXTERN int approximateTolerance Q_ASSIGN( 0 ); -Q_EXTERN qboolean noCollapse Q_ASSIGN( qfalse ); -Q_EXTERN qboolean exportLightmaps Q_ASSIGN( qfalse ); -Q_EXTERN qboolean externalLightmaps Q_ASSIGN( qfalse ); -Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH ); - -Q_EXTERN qboolean dirty Q_ASSIGN( qfalse ); -Q_EXTERN qboolean dirtDebug Q_ASSIGN( qfalse ); -Q_EXTERN int dirtMode Q_ASSIGN( 0 ); -Q_EXTERN float dirtDepth Q_ASSIGN( 128.0f ); -Q_EXTERN float dirtScale Q_ASSIGN( 1.0f ); -Q_EXTERN float dirtGain Q_ASSIGN( 1.0f ); - -Q_EXTERN qboolean dump Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debug Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugUnused Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugAxis Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugCluster Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugOrigin Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapBorder Q_ASSIGN( qfalse ); - /* longest distance across the map */ Q_EXTERN float maxMapDistance Q_ASSIGN( 0 ); @@ -2115,14 +2070,13 @@ Q_EXTERN float areaScale Q_ASSIGN( 0.25f ); Q_EXTERN float skyScale Q_ASSIGN( 1.0f ); Q_EXTERN float bounceScale Q_ASSIGN( 0.25f ); -/* ydnar: lightmap gamma/compensation */ -Q_EXTERN float lightmapGamma Q_ASSIGN( 1.0f ); -Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f ); - /* ydnar: for runtime tweaking of falloff tolerance */ Q_EXTERN float falloffTolerance Q_ASSIGN( 1.0f ); + Q_EXTERN qboolean exactPointToPolygon Q_ASSIGN( qtrue ); + Q_EXTERN float formFactorValueScale Q_ASSIGN( 3.0f ); + Q_EXTERN float linearScale Q_ASSIGN( 1.0f / 8000.0f ); Q_EXTERN light_t *lights; @@ -2215,7 +2169,6 @@ Q_EXTERN float *radVertexLuxels[ MAX_LIGHTMAPS ]; /* bsp lightmaps */ Q_EXTERN int numLightmapShaders Q_ASSIGN( 0 ); -Q_EXTERN int numSolidLightmaps Q_ASSIGN( 0 ); Q_EXTERN int numOutLightmaps Q_ASSIGN( 0 ); Q_EXTERN int numBSPLightmaps Q_ASSIGN( 0 ); Q_EXTERN int numExtLightmaps Q_ASSIGN( 0 ); diff --git a/tools/quake3/q3map2/q3map2.vcproj b/tools/quake3/q3map2/q3map2.vcproj index bbe6dacb..a3a45dae 100644 --- a/tools/quake3/q3map2/q3map2.vcproj +++ b/tools/quake3/q3map2/q3map2.vcproj @@ -1,532 +1,492 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 29398a1e..a0988938 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -1,6 +1,5 @@ -/* ------------------------------------------------------------------------------- - -Copyright (C) 1999-2006 Id Software, Inc. and contributors. +/* +Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -39,21 +38,20 @@ several games based on the Quake III Arena engine, in the form of "Q3Map2." /* -ColorMod() -routines for dealing with vertex color/alpha modification +AlphaMod() +routines for dealing with vertex alpha modification */ -void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) +void AlphaMod( alphaMod_t *am, int numVerts, bspDrawVert_t *drawVerts ) { - int i, j, k; - float c; - vec4_t mult, add; + int i, j; + float mult, add, a; bspDrawVert_t *dv; - colorMod_t *cm2; + alphaMod_t *am2; /* dummy check */ - if( cm == NULL || numVerts < 1 || drawVerts == NULL ) + if( am == NULL || numVerts < 1 || drawVerts == NULL ) return; @@ -63,72 +61,32 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) /* get vertex */ dv = &drawVerts[ i ]; - /* walk colorMod list */ - for( cm2 = cm; cm2 != NULL; cm2 = cm2->next ) + /* walk alphamod list */ + for( am2 = am; am2 != NULL; am2 = am2->next ) { - /* default */ - VectorSet( mult, 1.0f, 1.0f, 1.0f ); - mult[ 3 ] = 1.0f; - VectorSet( add, 0.0f, 0.0f, 0.0f ); - mult[ 3 ] = 0.0f; - /* switch on type */ - switch( cm2->type ) + switch( am->type ) { - case CM_COLOR_SET: - VectorClear( mult ); - VectorScale( cm2->data, 255.0f, add ); - break; - - case CM_ALPHA_SET: - mult[ 3 ] = 0.0f; - add[ 3 ] = cm2->data[ 0 ] * 255.0f; - break; - - case CM_COLOR_SCALE: - VectorCopy( cm2->data, mult ); - break; - - case CM_ALPHA_SCALE: - mult[ 3 ] = cm2->data[ 0 ]; - break; - - case CM_COLOR_DOT_PRODUCT: - c = DotProduct( dv->normal, cm2->data ); - VectorSet( mult, c, c, c ); - break; - - case CM_ALPHA_DOT_PRODUCT: - mult[ 3 ] = DotProduct( dv->normal, cm2->data ); - break; - - case CM_COLOR_DOT_PRODUCT_2: - c = DotProduct( dv->normal, cm2->data ); - c *= c; - VectorSet( mult, c, c, c ); - break; - - case CM_ALPHA_DOT_PRODUCT_2: - mult[ 3 ] = DotProduct( dv->normal, cm2->data ); - mult[ 3 ] *= mult[ 3 ]; + case AM_DOT_PRODUCT: + mult = DotProduct( dv->normal, am2->data ); + add = 0.0f; break; default: + mult = 1.0f; + add = 0.0f; break; } /* apply mod */ for( j = 0; j < MAX_LIGHTMAPS; j++ ) { - for( k = 0; k < 4; k++ ) - { - c = (mult[ k ] * dv->color[ j ][ k ]) + add[ k ]; - if( c < 0 ) - c = 0; - else if( c > 255 ) - c = 255; - dv->color[ j ][ k ] = c; - } + a = (mult * dv->color[ j ][ 3 ]) + add; + if( a < 0 ) + a = 0; + else if( a > 255 ) + a = 255; + dv->color[ j ][ 3 ] = a; } } } @@ -137,11 +95,11 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) /* -TCMod*() +TcMod*() routines for dealing with a 3x3 texture mod matrix */ -void TCMod( tcMod_t mod, float st[ 2 ] ) +void TcMod( tcMod_t mod, float st[ 2 ] ) { float old[ 2 ]; @@ -153,7 +111,7 @@ void TCMod( tcMod_t mod, float st[ 2 ] ) } -void TCModIdentity( tcMod_t mod ) +void TcModIdentity( tcMod_t mod ) { mod[ 0 ][ 0 ] = 1.0f; mod[ 0 ][ 1 ] = 0.0f; mod[ 0 ][ 2 ] = 0.0f; mod[ 1 ][ 0 ] = 0.0f; mod[ 1 ][ 1 ] = 1.0f; mod[ 1 ][ 2 ] = 0.0f; @@ -161,7 +119,7 @@ void TCModIdentity( tcMod_t mod ) } -void TCModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ) +void TcModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ) { int i; @@ -175,28 +133,28 @@ void TCModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ) } -void TCModTranslate( tcMod_t mod, float s, float t ) +void TcModTranslate( tcMod_t mod, float s, float t ) { mod[ 0 ][ 2 ] += s; mod[ 1 ][ 2 ] += t; } -void TCModScale( tcMod_t mod, float s, float t ) +void TcModScale( tcMod_t mod, float s, float t ) { mod[ 0 ][ 0 ] *= s; mod[ 1 ][ 1 ] *= t; } -void TCModRotate( tcMod_t mod, float euler ) +void TcModRotate( tcMod_t mod, float euler ) { tcMod_t old, temp; float radians, sinv, cosv; memcpy( old, mod, sizeof( tcMod_t ) ); - TCModIdentity( temp ); + TcModIdentity( temp ); radians = euler / 180 * Q_PI; sinv = sin( radians ); @@ -205,7 +163,7 @@ void TCModRotate( tcMod_t mod, float euler ) temp[ 0 ][ 0 ] = cosv; temp[ 0 ][ 1 ] = -sinv; temp[ 1 ][ 0 ] = sinv; temp[ 1 ][ 1 ] = cosv; - TCModMultiply( old, temp, mod ); + TcModMultiply( old, temp, mod ); } @@ -407,7 +365,7 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, char *find, char *replace ) char shader[ MAX_QPATH ]; char *s; int loc; - MHASH mh; + md5_state_t md5; byte digest[ 16 ]; char *srcShaderText, temp[ 8192 ], shaderText[ 8192 ]; /* ydnar: fixme (make this bigger?) */ @@ -529,11 +487,9 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, char *find, char *replace ) } /* make md5 hash of the shader text */ - mh = mhash_init( MHASH_MD5 ); - if( !mh ) - Error( "Unable to initialize MD5 hash context" ); - mhash( mh, shaderText, strlen( shaderText ) ); - mhash_deinit( mh, digest ); + md5_init( &md5 ); + md5_append( &md5, shaderText, strlen( shaderText ) ); + md5_finish( &md5, digest ); /* mangle hash into a shader name */ sprintf( shader, "%s/%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", mapName, @@ -569,7 +525,7 @@ adds a vertexremapshader key/value pair to worldspawn void EmitVertexRemapShader( char *from, char *to ) { - MHASH mh; + md5_state_t md5; byte digest[ 16 ]; char key[ 64 ], value[ 256 ]; @@ -583,11 +539,9 @@ void EmitVertexRemapShader( char *from, char *to ) sprintf( value, "%s;%s", from, to ); /* make md5 hash */ - mh = mhash_init( MHASH_MD5 ); - if( !mh ) - Error( "Unable to initialize MD5 hash context" ); - mhash( mh, value, strlen( value ) ); - mhash_deinit( mh, digest ); + md5_init( &md5 ); + md5_append( &md5, value, strlen( value ) ); + md5_finish( &md5, digest ); /* make key (this is annoying, as vertexremapshader is precisely 17 characters, which is one too long, so we leave off the last byte of the md5 digest) */ @@ -649,11 +603,11 @@ static shaderInfo_t *AllocShaderInfo( void ) si->notjunc = qfalse; /* ydnar: set texture coordinate transform matrix to identity */ - TCModIdentity( si->mod ); + TcModIdentity( si->mod ); - /* ydnar: lightmaps can now be > 128x128 in certain games or an externally generated tga */ - si->lmCustomWidth = lmCustomSize; - si->lmCustomHeight = lmCustomSize; + /* ydnar: lightmaps can now be > 128x128 in an externally generated tga */ + si->lmCustomWidth = lmCustomSize; //% LIGHTMAP_WIDTH; + si->lmCustomHeight = lmCustomSize; //% LIGHTMAP_HEIGHT; /* return to sender */ return si; @@ -829,7 +783,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ) if( !Q_stricmp( shader, si->shader ) ) { /* load image if necessary */ - if( si->finished == qfalse ) + if( si->shaderImage == NULL ) { LoadShaderImages( si ); FinishShader( si ); @@ -1124,21 +1078,17 @@ static void ParseShaderFile( const char *filename ) else if( !Q_stricmp( token, "light" ) ) { GetTokenAppend( shaderText, qfalse ); - si->flareShader = game->flareShader; + strcpy( si->flareShader, "flareshader" ); } /* ydnar: damageShader (sof2 mods) */ else if( !Q_stricmp( token, "damageShader" ) ) { GetTokenAppend( shaderText, qfalse ); - if( token[ 0 ] != '\0' ) - { - si->damageShader = safe_malloc( strlen( token ) + 1 ); - strcpy( si->damageShader, token ); - } + strcpy( si->damageShader, token ); GetTokenAppend( shaderText, qfalse ); /* don't do anything with health */ } - + /* ydnar: enemy territory implicit shaders */ else if( !Q_stricmp( token, "implicitMap" ) ) { @@ -1244,9 +1194,6 @@ static void ParseShaderFile( const char *filename ) sun = safe_malloc( sizeof( *sun ) ); memset( sun, 0, sizeof( *sun ) ); - /* set style */ - sun->style = si->lightStyle; - /* get color */ GetTokenAppend( shaderText, qfalse ); sun->color[ 0 ] = atof( token ); @@ -1329,8 +1276,6 @@ static void ParseShaderFile( const char *filename ) /* restore name and set to unfinished */ strcpy( si->shader, temp ); - si->shaderWidth = 0; - si->shaderHeight = 0; si->finished = qfalse; } } @@ -1403,8 +1348,8 @@ static void ParseShaderFile( const char *filename ) si->bounceScale = atof( token ); } - /* ydnar/splashdamage: q3map_skyLight */ - else if( !Q_stricmp( token, "q3map_skyLight" ) ) + /* ydnar/splashdamage: q3map_skylight */ + else if( !Q_stricmp( token, "q3map_skylight" ) ) { GetTokenAppend( shaderText, qfalse ); si->skyLightValue = atof( token ); @@ -1425,6 +1370,7 @@ static void ParseShaderFile( const char *filename ) si->value = atof( token ); } + /* q3map_lightStyle (sof2/jk2 lightstyle) */ else if( !Q_stricmp( token, "q3map_lightStyle" ) ) { @@ -1520,18 +1466,18 @@ static void ParseShaderFile( const char *filename ) { Sys_Printf( "WARNING: Non power-of-two lightmap size specified (%d, %d)\n", si->lmCustomWidth, si->lmCustomHeight ); - si->lmCustomWidth = lmCustomSize; - si->lmCustomHeight = lmCustomSize; + si->lmCustomWidth = LIGHTMAP_WIDTH; + si->lmCustomHeight = LIGHTMAP_HEIGHT; } } - /* ydnar: q3map_lightmapBrightness N (for autogenerated shaders + external tga lightmaps) */ - else if( !Q_stricmp( token, "q3map_lightmapBrightness" ) || !Q_stricmp( token, "q3map_lightmapGamma" ) ) + /* ydnar: q3map_lightmapGamma N (for autogenerated shaders + external tga lightmaps) */ + else if( !Q_stricmp( token, "q3map_lightmapGamma" ) ) { GetTokenAppend( shaderText, qfalse ); - si->lmBrightness = atof( token ); - if( si->lmBrightness < 0 ) - si->lmBrightness = 1.0; + si->lmGamma = atof( token ); + if( si->lmGamma < 0 ) + si->lmGamma = 1.0; } /* q3map_vertexScale (scale vertex lighting by this fraction) */ @@ -1541,54 +1487,18 @@ static void ParseShaderFile( const char *filename ) si->vertexScale = atof( token ); } - /* q3map_noVertexLight */ - else if( !Q_stricmp( token, "q3map_noVertexLight" ) ) - { - si->noVertexLight = qtrue; - } - - /* q3map_flare[Shader] */ + /* q3map_flare */ else if( !Q_stricmp( token, "q3map_flare" ) || !Q_stricmp( token, "q3map_flareShader" ) ) { GetTokenAppend( shaderText, qfalse ); - if( token[ 0 ] != '\0' ) - { - si->flareShader = safe_malloc( strlen( token ) + 1 ); - strcpy( si->flareShader, token ); - } + strcpy( si->flareShader, token ); } /* q3map_backShader */ else if( !Q_stricmp( token, "q3map_backShader" ) ) { GetTokenAppend( shaderText, qfalse ); - if( token[ 0 ] != '\0' ) - { - si->backShader = safe_malloc( strlen( token ) + 1 ); - strcpy( si->backShader, token ); - } - } - - /* ydnar: q3map_cloneShader */ - else if ( !Q_stricmp( token, "q3map_cloneShader" ) ) - { - GetTokenAppend( shaderText, qfalse ); - if( token[ 0 ] != '\0' ) - { - si->cloneShader = safe_malloc( strlen( token ) + 1 ); - strcpy( si->cloneShader, token ); - } - } - - /* q3map_remapShader */ - else if( !Q_stricmp( token, "q3map_remapShader" ) ) - { - GetTokenAppend( shaderText, qfalse ); - if( token[ 0 ] != '\0' ) - { - si->remapShader = safe_malloc( strlen( token ) + 1 ); - strcpy( si->remapShader, token ); - } + strcpy( si->backShader, token ); } /* ydnar: q3map_offset */ @@ -1598,6 +1508,13 @@ static void ParseShaderFile( const char *filename ) si->offset = atof( token ); } + /* ydnar: q3map_cloneShader */ + else if ( !Q_stricmp( token, "q3map_cloneShader" ) ) + { + GetTokenAppend( shaderText, qfalse ); + strcpy( si->cloneShader, token ); + } + /* ydnar: q3map_textureSize (substitute for q3map_lightimage derivation for terrain) */ else if( !Q_stricmp( token, "q3map_fur" ) ) { @@ -1678,32 +1595,26 @@ static void ParseShaderFile( const char *filename ) } } - /* ydnar: gs mods: q3map_[color|rgb|alpha][Gen|Mod]

q c #222328", -",q c #252323", -"'q c #34291D", -")q c #2A241B", -"!q c #070508", -"~q c #151C18", -"{q c #25342E", -"]q c #2D3F3D", -"^q c #747A7C", -"/q c #9F9EA3", -"(q c #888694", -"_q c #4F4E66", -":q c #4B4F66", -"r c #A5A49B", -",r c #92938A", -"'r c #858877", -")r c #858375", -"!r c #8C897D", -"~r c #AAA89D", -"{r c #C3C1BA", -"]r c #C7C6C1", -"^r c #C2C3BD", -"/r c #A9AA9F", -"(r c #7D7E6E", -"_r c #7B7D68", -":r c #848876", -"s c #8A92A2", -",s c #808395", -"'s c #75778F", -")s c #7D8094", -"!s c #7A7D93", -"~s c #5C5E79", -"{s c #5A5B7A", -"]s c #595C7B", -"^s c #535775", -"/s c #404364", -"(s c #484B6C", -"_s c #474A6A", -":s c #5A5E79", -"t c #111110", -",t c #14161B", -"'t c #4C5057", -")t c #5E4929", -"!t c #764D16", -"~t c #463A29", -"{t c #303035", -"]t c #1E1F22", -"^t c #1E2024", -"/t c #222327", -"(t c #242427", -"_t c #181310", -":t c #1E1612", -"u c #626883", -",u c #767E95", -"'u c #7D7989", -")u c #857C83", -"!u c #81716F", -"~u c #7E706B", -"{u c #867D75", -"]u c #777C71", -"^u c #727C6E", -"/u c #75796B", -"(u c #676B58", -"_u c #575D51", -":u c #535A4A", -"v c #6E718A", -",v c #515376", -"'v c #43466B", -")v c #3D4167", -"!v c #3B3F65", -"~v c #32375F", -"{v c #575A7B", -"]v c #868FA5", -"^v c #C4C9D1", -"/v c #DFE3E3", -"(v c #E0E1DF", -"_v c #E0E0DE", -":v c #E0E1E3", -"w c #675649", -",w c #332A28", -"'w c #131117", -")w c #302C34", -"!w c #382B23", -"~w c #5D3F1C", -"{w c #5E4E3B", -"]w c #4D5262", -"^w c #161B1E", -"/w c #18191B", -"(w c #343735", -"_w c #353937", -":w c #323635", -"x c #8D8FA0", -",x c #51536F", -"'x c #494D6D", -")x c #5B5F7B", -"!x c #646680", -"~x c #585D79", -"{x c #5E5A6C", -"]x c #978A8E", -"^x c #BAB8B4", -"/x c #C5CBC0", -"(x c #C1C5B9", -"_x c #ABACA4", -":x c #AAA6A1", -"y c #2E2B31", -",y c #2B2D30", -"'y c #302F34", -")y c #26231F", -"!y c #20272C", -"~y c #2E353F", -"{y c #1E1A1A", -"]y c #171515", -"^y c #16181D", -"/y c #232328", -"(y c #252529", -"_y c #2B3231", -":y c #101A20", -"z c #A1A096", -",z c #AFB1A9", -"'z c #A4A6A0", -")z c #919388", -"!z c #A3A696", -"~z c #9A9C8C", -"{z c #767B6B", -"]z c #565D4D", -"^z c #464C3E", -"/z c #4E4F3F", -"(z c #64604D", -"_z c #6F6557", -":z c #746D5D", -"A c #BBB8BF", -",A c #A3A2AD", -"'A c #9093A4", -")A c #8F92A4", -"!A c #45496C", -"~A c #383C62", -"{A c #393E63", -"]A c #AFB2BF", -"^A c #DFDDDD", -"/A c #E2E2E1", -"(A c #E1E2E1", -"_A c #C4C8CD", -":A c #C0C4C8", -"B c #584C3F", -",B c #2C282A", -"'B c #1C1C21", -")B c #151211", -"!B c #573A17", -"~B c #76501C", -"{B c #322D2B", -"]B c #292628", -"^B c #593B1C", -"/B c #6A502C", -"(B c #5A626E", -"_B c #282A2F", -":B c #0E0E14", -"C c #7E8096", -",C c #87899F", -"'C c #878A9D", -")C c #7F8298", -"!C c #5D617D", -"~C c #464968", -"{C c #454869", -"]C c #494C6B", -"^C c #545876", -"/C c #585B74", -"(C c #70677A", -"_C c #8E7C79", -":C c #919188", -"D c #2D2D34", -",D c #2D2E31", -"'D c #24262B", -")D c #26262D", -"!D c #31282C", -"~D c #352F24", -"{D c #2A2C2D", -"]D c #36373C", -"^D c #3B3B40", -"/D c #3B3A3F", -"(D c #191F27", -"_D c #192426", -":D c #2C3B38", -"E c #AFB2A9", -",E c #C9CCC3", -"'E c #D1D2CC", -")E c #CBCCC5", -"!E c #C4C5BC", -"~E c #B3B4A9", -"{E c #AEAD9F", -"]E c #A7AFA1", -"^E c #9CA495", -"/E c #8B8F7F", -"(E c #7F7E6E", -"_E c #938C7B", -":E c #938C79", -"F c #B6B8C3", -",F c #B8B9C6", -"'F c #ADAEBB", -")F c #A7A8B3", -"!F c #B6B7C2", -"~F c #C0C0CA", -"{F c #C4C4CD", -"]F c #C6C7CD", -"^F c #C4C6CB", -"/F c #A2A5B1", -"(F c #8F92A1", -"_F c #BBBEC1", -":F c #AFB3B7", -"G c #372815", -",G c #2E1F0E", -"'G c #181516", -")G c #1F1D1F", -"!G c #353035", -"~G c #342E34", -"{G c #332D33", -"]G c #302C32", -"^G c #040402", -"/G c #1A1F1C", -"(G c #1A1E1F", -"_G c #212322", -":G c #0F0E13", -"H c #807D8C", -",H c #9E9191", -"'H c #A29993", -")H c #9E9D99", -"!H c #8F8F92", -"~H c #898890", -"{H c #9F9BA2", -"]H c #B4B2B5", -"^H c #C0B9B5", -"/H c #C3BDB7", -"(H c #C4C4BF", -"_H c #CACCC5", -":H c #CECDCF", -"I c #9093A3", -",I c #85899B", -"'I c #5D607C", -")I c #4C4F71", -"!I c #484C6F", -"~I c #474B6B", -"{I c #505271", -"]I c #676883", -"^I c #6D6E87", -"/I c #808197", -"(I c #656A82", -"_I c #77798F", -":I c #9D9EAC", -"J c #866341", -",J c #7D5B32", -"'J c #766142", -")J c #827B6E", -"!J c #78756D", -"~J c #57514A", -"{J c #4B351A", -"]J c #664A20", -"^J c #3B2F27", -"/J c #212126", -"(J c #202025", -"_J c #2E241E", -":J c #4D3718", -"K c #464B6B", -",K c #575977", -"'K c #6F6D80", -")K c #817A79", -"!K c #968887", -"~K c #AAA198", -"{K c #9B9B89", -"]K c #9CA392", -"^K c #7C8175", -"/K c #72685F", -"(K c #88746B", -"_K c #898184", -":K c #707586", -"L c #1E2825", -",L c #171F22", -"'L c #1E2829", -")L c #38453D", -"!L c #3D4C43", -"~L c #334036", -"{L c #29352B", -"]L c #2E3A39", -"^L c #27333C", -"/L c #272D39", -"(L c #373C43", -"_L c #505458", -":L c #575A5B", -"M c #616950", -",M c #595E42", -"'M c #929380", -")M c #C0C0B7", -"!M c #C1BEB5", -"~M c #B7AFA6", -"{M c #D1CDC1", -"]M c #DCD6D0", -"^M c #C8C1B8", -"/M c #A8A398", -"(M c #BCB2A9", -"_M c #BCA999", -":M c #B29B87", -"N c #373B5D", -",N c #565977", -"'N c #676982", -")N c #7D7E94", -"!N c #666783", -"~N c #434765", -"{N c #373C5E", -"]N c #444869", -"^N c #606480", -"/N c #5C5B73", -"(N c #817780", -"_N c #91837B", -":N c #9C9083", -"O c #3A3B43", -",O c #3D3F46", -"'O c #3C3F45", -")O c #3B3E44", -"!O c #3E4149", -"~O c #3E4248", -"{O c #252D29", -"]O c #1D2621", -"^O c #121D1A", -"/O c #121E1E", -"(O c #182826", -"_O c #2A3A31", -":O c #2A362D", -"P c #BFC0B1", -",P c #C3C0B9", -"'P c #B9B5AE", -")P c #B3B6AA", -"!P c #BFC2B6", -"~P c #BBBDB2", -"{P c #BBBCB1", -"]P c #B0B1A4", -"^P c #949783", -"/P c #7B856D", -"(P c #747D64", -"_P c #A8A799", -":P c #DEDCD6", -"